[saods9] 06/07: Remove obsolete blt3.0.1 subdir: replaced by tlt3.0
Ole Streicher
olebole-guest at alioth.debian.org
Thu Sep 26 12:24:36 UTC 2013
This is an automated email from the git hooks/post-receive script.
olebole-guest pushed a commit to branch debian
in repository saods9.
commit 255ced6dd95c6ebe4ee3a23c956602a5cfc6ec27
Author: Ole Streicher <debian at liska.ath.cx>
Date: Thu Sep 26 14:21:36 2013 +0200
Remove obsolete blt3.0.1 subdir: replaced by tlt3.0
---
blt3.0.1/INSTALL | 115 -
blt3.0.1/MANIFEST | 394 -
blt3.0.1/Makefile.in | 70 -
blt3.0.1/Makefile.vc | 63 -
blt3.0.1/NEWS | 730 -
blt3.0.1/PROBLEMS | 146 -
blt3.0.1/README | 179 -
blt3.0.1/aclocal.m4 | 110 -
blt3.0.1/blt.mak | 34 -
blt3.0.1/cf/config.guess | 1526 --
blt3.0.1/cf/config.sub | 1669 --
blt3.0.1/cf/install-sh | 276 -
blt3.0.1/cf/install.sh | 238 -
blt3.0.1/cf/ldAix | 72 -
blt3.0.1/configure |18104 --------------------
blt3.0.1/configure.in | 1824 --
blt3.0.1/demos/Makefile.in | 92 -
blt3.0.1/demos/Makefile.vc | 78 -
blt3.0.1/demos/barchart1.tcl | 160 -
blt3.0.1/demos/barchart2.tcl | 209 -
blt3.0.1/demos/barchart3.tcl | 123 -
blt3.0.1/demos/barchart4.tcl | 101 -
blt3.0.1/demos/barchart5.tcl | 57 -
blt3.0.1/demos/bgexec1.tcl | 198 -
blt3.0.1/demos/bgexec2.tcl | 46 -
blt3.0.1/demos/bgexec3.tcl | 224 -
blt3.0.1/demos/bgexec4.tcl | 180 -
blt3.0.1/demos/bgexec5.tcl | 47 -
blt3.0.1/demos/bitmap.tcl | 230 -
blt3.0.1/demos/bitmap2.tcl | 191 -
blt3.0.1/demos/bitmaps/face.xbm | 171 -
blt3.0.1/demos/bitmaps/fish/left.xbm | 8 -
blt3.0.1/demos/bitmaps/fish/left1.xbm | 8 -
blt3.0.1/demos/bitmaps/fish/left1m.xbm | 8 -
blt3.0.1/demos/bitmaps/fish/leftm.xbm | 8 -
blt3.0.1/demos/bitmaps/fish/mid.xbm | 8 -
blt3.0.1/demos/bitmaps/fish/midm.xbm | 8 -
blt3.0.1/demos/bitmaps/fish/right.xbm | 8 -
blt3.0.1/demos/bitmaps/fish/right1.xbm | 8 -
blt3.0.1/demos/bitmaps/fish/right1m.xbm | 8 -
blt3.0.1/demos/bitmaps/fish/rightm.xbm | 8 -
blt3.0.1/demos/bitmaps/greenback.xbm | 885 -
blt3.0.1/demos/bitmaps/hand/hand01.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand01m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand02.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand02m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand03.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand03m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand04.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand04m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand05.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand05m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand06.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand06m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand07.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand07m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand08.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand08m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand09.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand09m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand10.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand10m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand11.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand11m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand12.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand12m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand13.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand13m.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand14.xbm | 8 -
blt3.0.1/demos/bitmaps/hand/hand14m.xbm | 8 -
blt3.0.1/demos/bitmaps/hobbes.xbm | 16 -
blt3.0.1/demos/bitmaps/hobbes_mask.xbm | 14 -
blt3.0.1/demos/bitmaps/sharky.xbm | 129 -
blt3.0.1/demos/bitmaps/xbob.xbm | 46 -
blt3.0.1/demos/busy1.tcl | 242 -
blt3.0.1/demos/busy2.tcl | 237 -
blt3.0.1/demos/busy3.tcl | 250 -
blt3.0.1/demos/cbutton1.tcl | 316 -
blt3.0.1/demos/cbutton2.tcl | 240 -
blt3.0.1/demos/cbutton3.tcl | 802 -
blt3.0.1/demos/centry1.tcl | 95 -
blt3.0.1/demos/cmenu.tcl | 63 -
blt3.0.1/demos/cmenu1.tcl | 255 -
blt3.0.1/demos/cmenu2.tcl | 295 -
blt3.0.1/demos/cmenu3.tcl | 801 -
blt3.0.1/demos/cmenu4.tcl | 39 -
blt3.0.1/demos/cmenu5.tcl | 90 -
blt3.0.1/demos/container.tcl | 19 -
blt3.0.1/demos/container3.tcl | 451 -
blt3.0.1/demos/ctree1.tcl | 55 -
blt3.0.1/demos/ctree2.tcl | 47 -
blt3.0.1/demos/dnd1.tcl | 202 -
blt3.0.1/demos/dnd2.tcl | 305 -
blt3.0.1/demos/dragdrop1.tcl | 131 -
blt3.0.1/demos/dragdrop2.tcl | 163 -
blt3.0.1/demos/drawer.tcl | 40 -
blt3.0.1/demos/drawerset1.tcl | 45 -
blt3.0.1/demos/drawerset2.tcl | 34 -
blt3.0.1/demos/eps.tcl | 315 -
blt3.0.1/demos/filmstrip1.tcl | 72 -
blt3.0.1/demos/graph1.tcl | 987 --
blt3.0.1/demos/graph2.tcl | 136 -
blt3.0.1/demos/graph3.tcl | 75 -
blt3.0.1/demos/graph4.tcl | 2280 ---
blt3.0.1/demos/graph4a.tab |14842 ----------------
blt3.0.1/demos/graph4a.tcl | 232 -
blt3.0.1/demos/graph5.tcl | 66 -
blt3.0.1/demos/graph6.tcl | 2320 ---
blt3.0.1/demos/graph7.tcl | 78 -
blt3.0.1/demos/hierbox1.tcl | 98 -
blt3.0.1/demos/hierbox2.tcl | 77 -
blt3.0.1/demos/hierbox3.tcl | 57 -
blt3.0.1/demos/hierbox4.tcl | 55 -
blt3.0.1/demos/hiertable1.tcl | 212 -
blt3.0.1/demos/hiertable2.tcl | 196 -
blt3.0.1/demos/hiertable3.tcl | 175 -
blt3.0.1/demos/htext.txt | 615 -
blt3.0.1/demos/htext1.tcl | 164 -
blt3.0.1/demos/images/blt98.gif | Bin 36719 -> 0 bytes
blt3.0.1/demos/images/buckskin.gif | Bin 7561 -> 0 bytes
blt3.0.1/demos/images/chalk.gif | Bin 4378 -> 0 bytes
blt3.0.1/demos/images/close.gif | Bin 142 -> 0 bytes
blt3.0.1/demos/images/close2.gif | Bin 142 -> 0 bytes
blt3.0.1/demos/images/clouds.gif | Bin 6414 -> 0 bytes
blt3.0.1/demos/images/corrugated_metal.gif | Bin 7708 -> 0 bytes
blt3.0.1/demos/images/folder.gif | Bin 88 -> 0 bytes
blt3.0.1/demos/images/jan25_palm3x_L.jpg | Bin 4048 -> 0 bytes
blt3.0.1/demos/images/mini-book1.gif | Bin 109 -> 0 bytes
blt3.0.1/demos/images/mini-book2.gif | Bin 93 -> 0 bytes
blt3.0.1/demos/images/mini-display.gif | Bin 109 -> 0 bytes
blt3.0.1/demos/images/mini-doc.gif | Bin 91 -> 0 bytes
blt3.0.1/demos/images/mini-filemgr.gif | Bin 106 -> 0 bytes
blt3.0.1/demos/images/mini-ofolder.gif | Bin 114 -> 0 bytes
blt3.0.1/demos/images/mini-windows.gif | Bin 86 -> 0 bytes
blt3.0.1/demos/images/ofolder.gif | Bin 110 -> 0 bytes
blt3.0.1/demos/images/open.gif | Bin 148 -> 0 bytes
blt3.0.1/demos/images/open2.gif | Bin 148 -> 0 bytes
blt3.0.1/demos/images/out.ps |11662 -------------
blt3.0.1/demos/images/qv100.t.gif | Bin 2694 -> 0 bytes
blt3.0.1/demos/images/rain.gif | Bin 3785 -> 0 bytes
blt3.0.1/demos/images/sample.gif | Bin 186103 -> 0 bytes
blt3.0.1/demos/images/smblue_rock.gif | Bin 3820 -> 0 bytes
blt3.0.1/demos/images/stopsign.gif | Bin 259 -> 0 bytes
blt3.0.1/demos/images/tan_paper.gif | Bin 18904 -> 0 bytes
blt3.0.1/demos/images/tan_paper2.gif | Bin 18901 -> 0 bytes
blt3.0.1/demos/images/txtrflag.gif | Bin 17135 -> 0 bytes
blt3.0.1/demos/listview1.tcl | 88 -
blt3.0.1/demos/mbar1.tcl | 276 -
blt3.0.1/demos/paneset1.tcl | 22 -
blt3.0.1/demos/paneset2.tcl | 20 -
blt3.0.1/demos/paneset3.tcl | 18 -
blt3.0.1/demos/paneset4.tcl | 20 -
blt3.0.1/demos/paneset5.tcl | 18 -
blt3.0.1/demos/paneset6.tcl | 98 -
blt3.0.1/demos/paneset7.tcl | 45 -
blt3.0.1/demos/picture3.tcl | 68 -
blt3.0.1/demos/picture4.tcl | 26 -
blt3.0.1/demos/picture5.tcl | 4 -
blt3.0.1/demos/pushbutton1.tcl | 23 -
blt3.0.1/demos/scripts/barchart2.tcl | 132 -
blt3.0.1/demos/scripts/bgtest.tcl | 35 -
blt3.0.1/demos/scripts/clone.tcl | 88 -
blt3.0.1/demos/scripts/demo.tcl | 28 -
blt3.0.1/demos/scripts/globe.tcl | 509 -
blt3.0.1/demos/scripts/graph1.tcl | 72 -
blt3.0.1/demos/scripts/graph2.tcl | 151 -
blt3.0.1/demos/scripts/graph3.tcl | 88 -
blt3.0.1/demos/scripts/graph5.tcl | 65 -
blt3.0.1/demos/scripts/graph8.tcl | 85 -
blt3.0.1/demos/scripts/page.tcl | 131 -
blt3.0.1/demos/scripts/patterns.tcl | 16 -
blt3.0.1/demos/scripts/ps.tcl | 822 -
blt3.0.1/demos/scripts/send.tcl | 115 -
blt3.0.1/demos/scripts/stipples.tcl | 153 -
blt3.0.1/demos/scripts/xcolors.tcl | 250 -
blt3.0.1/demos/scrollset1.tcl | 14 -
blt3.0.1/demos/scrollset2.tcl | 25 -
blt3.0.1/demos/scrollset3.tcl | 193 -
blt3.0.1/demos/scrollset4.tcl | 59 -
blt3.0.1/demos/spline.tcl | 61 -
blt3.0.1/demos/stripchart1.tcl | 407 -
blt3.0.1/demos/stripchart2.tcl | 397 -
blt3.0.1/demos/tabnotebook1.tcl | 64 -
blt3.0.1/demos/tabnotebook2.tcl | 57 -
blt3.0.1/demos/tabnotebook3.tcl | 609 -
blt3.0.1/demos/tabset1.tcl | 63 -
blt3.0.1/demos/tabset2.tcl | 52 -
blt3.0.1/demos/tabset3.tcl | 180 -
blt3.0.1/demos/tabset4.tcl | 90 -
blt3.0.1/demos/tour.tcl | 141 -
blt3.0.1/demos/treeview1.tcl | 183 -
blt3.0.1/demos/treeview2.tcl | 208 -
blt3.0.1/demos/treeview3.tcl | 66 -
blt3.0.1/demos/tv1.tcl | 32 -
blt3.0.1/demos/tv2.tcl | 24 -
blt3.0.1/demos/tv3.tcl | 31 -
blt3.0.1/demos/usmap.tcl | 71 -
blt3.0.1/demos/winop1.tcl | 57 -
blt3.0.1/demos/winop2.tcl | 30 -
blt3.0.1/demos/winop3.tcl | 74 -
blt3.0.1/demos/winop4.tcl | 86 -
blt3.0.1/demos/winop5.tcl | 81 -
blt3.0.1/demos/winop6.tcl | 40 -
blt3.0.1/demos/winop7.tcl | 28 -
blt3.0.1/demos/winop9.tcl | 19 -
blt3.0.1/examples/calendar.tcl | 141 -
blt3.0.1/examples/form.tcl | 1061 --
blt3.0.1/examples/pareto.tcl | 144 -
blt3.0.1/html/BLT.html | 161 -
blt3.0.1/html/Makefile.vc | 32 -
blt3.0.1/html/barchart.html | 2240 ---
blt3.0.1/html/beep.html | 41 -
blt3.0.1/html/bgexec.html | 271 -
blt3.0.1/html/bitmap.html | 208 -
blt3.0.1/html/bltdebug.html | 34 -
blt3.0.1/html/busy.html | 218 -
blt3.0.1/html/container.html | 272 -
blt3.0.1/html/cutbuffer.html | 57 -
blt3.0.1/html/dragdrop.html | 479 -
blt3.0.1/html/eps.html | 1231 --
blt3.0.1/html/graph.html | 2311 ---
blt3.0.1/html/hierbox.html | 2331 ---
blt3.0.1/html/hiertable.html | 2331 ---
blt3.0.1/html/htext.html | 397 -
blt3.0.1/html/spline.html | 160 -
blt3.0.1/html/stripchart.html | 2179 ---
blt3.0.1/html/table.html | 721 -
blt3.0.1/html/tabset.html | 936 -
blt3.0.1/html/tile.html | 100 -
blt3.0.1/html/tree.html | 930 -
blt3.0.1/html/treeview.html | 2336 ---
blt3.0.1/html/vector.html | 1124 --
blt3.0.1/html/watch.html | 140 -
blt3.0.1/html/winop.html | 124 -
blt3.0.1/library/Makefile.in | 93 -
blt3.0.1/library/Makefile.vc | 71 -
blt3.0.1/library/ZoomStack.itcl | 359 -
blt3.0.1/library/afm/AvantGarde-Book.afm | 574 -
blt3.0.1/library/afm/AvantGarde-BookOblique.afm | 574 -
blt3.0.1/library/afm/AvantGarde-Demi.afm | 577 -
blt3.0.1/library/afm/AvantGarde-DemiOblique.afm | 577 -
blt3.0.1/library/afm/Bookman-Demi.afm | 416 -
blt3.0.1/library/afm/Bookman-DemiItalic.afm | 418 -
blt3.0.1/library/afm/Bookman-Light.afm | 408 -
blt3.0.1/library/afm/Bookman-LightItalic.afm | 411 -
blt3.0.1/library/afm/Courier-Bold.afm | 345 -
blt3.0.1/library/afm/Courier-BoldOblique.afm | 345 -
blt3.0.1/library/afm/Courier-Oblique.afm | 345 -
blt3.0.1/library/afm/Courier.afm | 345 -
blt3.0.1/library/afm/Helvetica-Bold.afm | 571 -
blt3.0.1/library/afm/Helvetica-BoldOblique.afm | 571 -
blt3.0.1/library/afm/Helvetica-Condensed-Bold.afm | 419 -
.../library/afm/Helvetica-Condensed-BoldObl.afm | 419 -
.../library/afm/Helvetica-Condensed-Oblique.afm | 421 -
blt3.0.1/library/afm/Helvetica-Condensed.afm | 421 -
blt3.0.1/library/afm/Helvetica-Narrow-Bold.afm | 571 -
.../library/afm/Helvetica-Narrow-BoldOblique.afm | 571 -
blt3.0.1/library/afm/Helvetica-Narrow-Oblique.afm | 613 -
blt3.0.1/library/afm/Helvetica-Narrow.afm | 613 -
blt3.0.1/library/afm/Helvetica-Oblique.afm | 613 -
blt3.0.1/library/afm/Helvetica.afm | 613 -
blt3.0.1/library/afm/Makefile.in | 78 -
blt3.0.1/library/afm/NewCenturySchlbk-Bold.afm | 473 -
.../library/afm/NewCenturySchlbk-BoldItalic.afm | 603 -
blt3.0.1/library/afm/NewCenturySchlbk-Italic.afm | 537 -
blt3.0.1/library/afm/NewCenturySchlbk-Roman.afm | 525 -
blt3.0.1/library/afm/Palatino-Bold.afm | 435 -
blt3.0.1/library/afm/Palatino-BoldItalic.afm | 442 -
blt3.0.1/library/afm/Palatino-Italic.afm | 440 -
blt3.0.1/library/afm/Palatino-Roman.afm | 446 -
blt3.0.1/library/afm/Symbol.afm | 210 -
blt3.0.1/library/afm/Times-Bold.afm | 649 -
blt3.0.1/library/afm/Times-BoldItalic.afm | 649 -
blt3.0.1/library/afm/Times-Italic.afm | 649 -
blt3.0.1/library/afm/Times-Roman.afm | 649 -
blt3.0.1/library/afm/ZapfChancery-MediumItalic.afm | 481 -
blt3.0.1/library/afm/ZapfDingbats.afm | 223 -
blt3.0.1/library/bltCanvEps.pro | 78 -
blt3.0.1/library/bltGraph.pro | 472 -
blt3.0.1/library/combobutton.tcl | 256 -
blt3.0.1/library/comboentry.tcl | 687 -
blt3.0.1/library/combomenu.tcl | 576 -
blt3.0.1/library/combotree.tcl | 520 -
blt3.0.1/library/dd_protocols/dd-color.tcl | 51 -
blt3.0.1/library/dd_protocols/dd-file.tcl | 53 -
blt3.0.1/library/dd_protocols/dd-number.tcl | 51 -
blt3.0.1/library/dd_protocols/dd-text.tcl | 48 -
blt3.0.1/library/dd_protocols/tclIndex | 12 -
blt3.0.1/library/dnd.tcl | 102 -
blt3.0.1/library/dragdrop.tcl | 75 -
blt3.0.1/library/drawer.tcl | 40 -
blt3.0.1/library/filmstrip.tcl | 52 -
blt3.0.1/library/graph.tcl | 842 -
blt3.0.1/library/hierbox.tcl | 522 -
blt3.0.1/library/hiertable.tcl | 943 -
blt3.0.1/library/listview.tcl | 926 -
blt3.0.1/library/macButton.tcl | 158 -
blt3.0.1/library/panes.tcl | 213 -
blt3.0.1/library/paneset.tcl | 39 -
blt3.0.1/library/pkgIndex.tcl.in | 112 -
blt3.0.1/library/pushbutton.tcl | 166 -
blt3.0.1/library/scrollbar.tcl | 461 -
blt3.0.1/library/scrollset.tcl | 44 -
blt3.0.1/library/tabset.tcl | 398 -
blt3.0.1/library/tclIndex | 13 -
blt3.0.1/library/treeview.cur | Bin 326 -> 0 bytes
blt3.0.1/library/treeview.tcl | 1063 --
blt3.0.1/library/treeview.xbm | 8 -
blt3.0.1/library/treeview_m.xbm | 8 -
blt3.0.1/library/unixButton.tcl | 180 -
blt3.0.1/library/winButton.tcl | 240 -
blt3.0.1/man/BLT.mann | 153 -
blt3.0.1/man/Blt_Tree.man3 | 232 -
blt3.0.1/man/Blt_TreeCreate.man3 | 100 -
blt3.0.1/man/Blt_TreeCreateNode.man3 | 95 -
blt3.0.1/man/Blt_TreeDeleteNode.man3 | 75 -
blt3.0.1/man/Blt_TreeExists.man3 | 66 -
blt3.0.1/man/Blt_TreeGetNode.man3 | 69 -
blt3.0.1/man/Blt_TreeGetToken.man3 | 88 -
blt3.0.1/man/Blt_TreeName.man3 | 59 -
blt3.0.1/man/Blt_TreeNodeId.man3 | 58 -
blt3.0.1/man/Blt_TreeReleaseToken.man3 | 64 -
blt3.0.1/man/Makefile.in | 74 -
blt3.0.1/man/barchart.mann | 2236 ---
blt3.0.1/man/beep.mann | 48 -
blt3.0.1/man/bgexec.mann | 309 -
blt3.0.1/man/bitmap.mann | 219 -
blt3.0.1/man/bltdebug.mann | 38 -
blt3.0.1/man/busy.mann | 260 -
blt3.0.1/man/container.mann | 303 -
blt3.0.1/man/cutbuffer.mann | 54 -
blt3.0.1/man/datatable.mann | 1505 --
blt3.0.1/man/dragdrop.mann | 470 -
blt3.0.1/man/eps.mann | 163 -
blt3.0.1/man/graph.mann | 2397 ---
blt3.0.1/man/hierbox.mann | 2261 ---
blt3.0.1/man/hiertable.mann | 2261 ---
blt3.0.1/man/htext.mann | 384 -
blt3.0.1/man/man.macros | 240 -
blt3.0.1/man/scrollset.mann | 763 -
blt3.0.1/man/spline.mann | 181 -
blt3.0.1/man/stripchart.mann | 2168 ---
blt3.0.1/man/table.mann | 757 -
blt3.0.1/man/tabset.mann | 942 -
blt3.0.1/man/tile.mann | 108 -
blt3.0.1/man/tree.mann | 933 -
blt3.0.1/man/treeview.mann | 2264 ---
blt3.0.1/man/vector.mann | 1130 --
blt3.0.1/man/watch.mann | 137 -
blt3.0.1/man/winop.mann | 131 -
blt3.0.1/src/Makefile-cyg.in | 672 -
blt3.0.1/src/Makefile-macosx.in | 623 -
blt3.0.1/src/Makefile.bc | 341 -
blt3.0.1/src/Makefile.in | 605 -
blt3.0.1/src/Makefile.vc | 775 -
blt3.0.1/src/TODO | 175 -
blt3.0.1/src/blt.h | 53 -
blt3.0.1/src/blt.mak | 321 -
blt3.0.1/src/bltAlloc.c | 229 -
blt3.0.1/src/bltAlloc.h | 40 -
blt3.0.1/src/bltArrayObj.c | 232 -
blt3.0.1/src/bltArrayObj.h | 43 -
blt3.0.1/src/bltAssert.h | 25 -
blt3.0.1/src/bltBase64.c | 350 -
blt3.0.1/src/bltBeep.c | 90 -
blt3.0.1/src/bltBgStyle.c | 3324 ----
blt3.0.1/src/bltBgStyle.h | 87 -
blt3.0.1/src/bltBgexec.c | 1971 ---
blt3.0.1/src/bltBind.c | 1825 --
blt3.0.1/src/bltBind.h | 120 -
blt3.0.1/src/bltBitmap.c | 1415 --
blt3.0.1/src/bltBitmap.h | 14 -
blt3.0.1/src/bltBusy.c | 1815 --
blt3.0.1/src/bltCanvEps.c | 1849 --
blt3.0.1/src/bltChain.c | 518 -
blt3.0.1/src/bltChain.h | 90 -
blt3.0.1/src/bltComboBtn.c | 2049 ---
blt3.0.1/src/bltComboEntry.c | 4470 -----
blt3.0.1/src/bltComboMenu.c | 6568 -------
blt3.0.1/src/bltComboTree.c | 7149 --------
blt3.0.1/src/bltConfig.c | 2493 ---
blt3.0.1/src/bltConfig.h | 406 -
blt3.0.1/src/bltContainer.c | 2011 ---
blt3.0.1/src/bltCoreInit.c | 375 -
blt3.0.1/src/bltCrc32.c | 229 -
blt3.0.1/src/bltCsv.c | 414 -
blt3.0.1/src/bltCutbuffer.c | 256 -
blt3.0.1/src/bltDBuffer.c | 438 -
blt3.0.1/src/bltDBuffer.h | 95 -
blt3.0.1/src/bltDataTable.c | 5889 -------
blt3.0.1/src/bltDataTable.h | 729 -
blt3.0.1/src/bltDebug.c | 427 -
blt3.0.1/src/bltDragdrop.c | 2747 ---
blt3.0.1/src/bltDtCmd.c | 7776 ---------
blt3.0.1/src/bltDtCsv.c | 740 -
blt3.0.1/src/bltDtMysql.c | 445 -
blt3.0.1/src/bltDtTree.c | 315 -
blt3.0.1/src/bltDtVec.c | 243 -
blt3.0.1/src/bltDtXml.c | 825 -
blt3.0.1/src/bltExtInit.c | 219 -
blt3.0.1/src/bltFont.h | 139 -
blt3.0.1/src/bltGrAxis.c | 5765 -------
blt3.0.1/src/bltGrAxis.h | 332 -
blt3.0.1/src/bltGrBar.c | 2543 ---
blt3.0.1/src/bltGrContour.c | 2798 ---
blt3.0.1/src/bltGrElem.c | 2456 ---
blt3.0.1/src/bltGrElem.h | 271 -
blt3.0.1/src/bltGrHairs.c | 534 -
blt3.0.1/src/bltGrLegd.c | 3047 ----
blt3.0.1/src/bltGrLegd.h | 60 -
blt3.0.1/src/bltGrLine.c | 5347 ------
blt3.0.1/src/bltGrMarker.c | 5196 ------
blt3.0.1/src/bltGrMesh.c | 1747 --
blt3.0.1/src/bltGrMisc.c | 2024 ---
blt3.0.1/src/bltGrPen.c | 765 -
blt3.0.1/src/bltGrPs.c | 731 -
blt3.0.1/src/bltGraph.c | 2381 ---
blt3.0.1/src/bltGraph.h | 699 -
blt3.0.1/src/bltHash.c | 1281 --
blt3.0.1/src/bltHash.h.in | 212 -
blt3.0.1/src/bltHtext.c | 4451 -----
blt3.0.1/src/bltImage.c | 155 -
blt3.0.1/src/bltImage.h | 53 -
blt3.0.1/src/bltInit.c | 124 -
blt3.0.1/src/bltInt.h | 1000 --
blt3.0.1/src/bltList.c | 557 -
blt3.0.1/src/bltList.h | 116 -
blt3.0.1/src/bltListView.c | 6283 -------
blt3.0.1/src/bltMacBitmap.c | 685 -
blt3.0.1/src/bltMacImage.c | 2430 ---
blt3.0.1/src/bltMacOSX.h | 71 -
blt3.0.1/src/bltMacOSXPainter.c | 1394 --
blt3.0.1/src/bltMacPainter.c | 1394 --
blt3.0.1/src/bltMacWindow.c | 487 -
blt3.0.1/src/bltMath.h | 202 -
blt3.0.1/src/bltMenubar.c | 3030 ----
blt3.0.1/src/bltNsUtil.c | 174 -
blt3.0.1/src/bltNsUtil.h | 101 -
blt3.0.1/src/bltOldConfig.c | 293 -
blt3.0.1/src/bltOp.h | 37 -
blt3.0.1/src/bltPaintDraw.c | 1464 --
blt3.0.1/src/bltPainter.c | 968 --
blt3.0.1/src/bltPainter.h | 85 -
blt3.0.1/src/bltPainterInt.h | 143 -
blt3.0.1/src/bltPaneset.c | 7529 --------
blt3.0.1/src/bltParse.c | 546 -
blt3.0.1/src/bltParse.h | 43 -
blt3.0.1/src/bltPictBmp.c | 1643 --
blt3.0.1/src/bltPictCmd.c | 4546 -----
blt3.0.1/src/bltPictDraw.c | 3421 ----
blt3.0.1/src/bltPictFmts.h | 105 -
blt3.0.1/src/bltPictGif.c | 2334 ---
blt3.0.1/src/bltPictInt.h | 219 -
blt3.0.1/src/bltPictJpg.c | 878 -
blt3.0.1/src/bltPictMmx.c | 2257 ---
blt3.0.1/src/bltPictPbm.c | 962 --
blt3.0.1/src/bltPictPdf.c | 1245 --
blt3.0.1/src/bltPictPhoto.c | 219 -
blt3.0.1/src/bltPictPng.c | 774 -
blt3.0.1/src/bltPictPs.c | 1246 --
blt3.0.1/src/bltPictTif.c | 874 -
blt3.0.1/src/bltPictXbm.c | 719 -
blt3.0.1/src/bltPictXpm.c | 662 -
blt3.0.1/src/bltPicture.c | 6440 -------
blt3.0.1/src/bltPicture.h | 416 -
blt3.0.1/src/bltPool.c | 473 -
blt3.0.1/src/bltPool.h | 23 -
blt3.0.1/src/bltPs.c | 1697 --
blt3.0.1/src/bltPs.h | 215 -
blt3.0.1/src/bltPsAfm.c | 1835 --
blt3.0.1/src/bltPsInt.h | 49 -
blt3.0.1/src/bltRound.h | 32 -
blt3.0.1/src/bltScrollbar.c | 1349 --
blt3.0.1/src/bltScrollset.c | 2014 ---
blt3.0.1/src/bltSpline.c | 1399 --
blt3.0.1/src/bltString.h | 61 -
blt3.0.1/src/bltSwitch.c | 554 -
blt3.0.1/src/bltSwitch.h | 136 -
blt3.0.1/src/bltTable.c | 5138 ------
blt3.0.1/src/bltTable.h | 374 -
blt3.0.1/src/bltTabset.c | 8075 ---------
blt3.0.1/src/bltTed.c | 1826 --
blt3.0.1/src/bltText.c | 2018 ---
blt3.0.1/src/bltText.h | 265 -
blt3.0.1/src/bltTile.c | 1315 --
blt3.0.1/src/bltTile.h | 61 -
blt3.0.1/src/bltTree.c | 4366 -----
blt3.0.1/src/bltTree.h | 502 -
blt3.0.1/src/bltTreeCmd.c | 5893 -------
blt3.0.1/src/bltTreeView.c | 5489 ------
blt3.0.1/src/bltTreeView.h | 1079 --
blt3.0.1/src/bltTreeXml.c | 1040 --
blt3.0.1/src/bltTri.c | 746 -
blt3.0.1/src/bltTvCmd.c | 4701 -----
blt3.0.1/src/bltTvCol.c | 2067 ---
blt3.0.1/src/bltTvEdit.c | 1703 --
blt3.0.1/src/bltTvStyle.c | 2684 ---
blt3.0.1/src/bltTypes.h | 141 -
blt3.0.1/src/bltUnixBgexec.c | 2425 ---
blt3.0.1/src/bltUnixBitmap.c | 674 -
blt3.0.1/src/bltUnixDnd.c | 5110 ------
blt3.0.1/src/bltUnixFont.c | 2824 ---
blt3.0.1/src/bltUnixMain.c | 327 -
blt3.0.1/src/bltUnixPainter.c | 2005 ---
blt3.0.1/src/bltUnixPainter.h | 143 -
blt3.0.1/src/bltUnixPipe.c | 1093 --
blt3.0.1/src/bltUnixWindow.c | 520 -
blt3.0.1/src/bltUtil.c | 1376 --
blt3.0.1/src/bltVar.c | 43 -
blt3.0.1/src/bltVar.h | 62 -
blt3.0.1/src/bltVar84.c | 284 -
blt3.0.1/src/bltVar85.c | 465 -
blt3.0.1/src/bltVecCmd.c | 2414 ---
blt3.0.1/src/bltVecInt.h | 251 -
blt3.0.1/src/bltVecMath.c | 1895 --
blt3.0.1/src/bltVector.c | 2808 ---
blt3.0.1/src/bltVector.h | 137 -
blt3.0.1/src/bltWait.h | 246 -
blt3.0.1/src/bltWatch.c | 856 -
blt3.0.1/src/bltWin.h | 265 -
blt3.0.1/src/bltWinBitmap.c | 917 -
blt3.0.1/src/bltWinConfig.h | 144 -
blt3.0.1/src/bltWinDde.c | 1350 --
blt3.0.1/src/bltWinDll.c | 71 -
blt3.0.1/src/bltWinDraw.c | 2929 ----
blt3.0.1/src/bltWinFont.c | 1690 --
blt3.0.1/src/bltWinMain.c | 630 -
blt3.0.1/src/bltWinPainter.c | 957 --
blt3.0.1/src/bltWinPainter.h | 106 -
blt3.0.1/src/bltWinPipe.c | 2481 ---
blt3.0.1/src/bltWinPrnt.c | 1658 --
blt3.0.1/src/bltWinUtil.c | 90 -
blt3.0.1/src/bltWinWindow.c | 441 -
blt3.0.1/src/bltWindow.c | 601 -
blt3.0.1/src/bltWinop.c | 410 -
blt3.0.1/src/config.h.in | 335 -
blt3.0.1/src/missing.h | 44 -
blt3.0.1/src/pure_api.c | 126 -
blt3.0.1/src/shared/Makefile.in | 534 -
blt3.0.1/src/tclGet.c | 45 -
blt3.0.1/src/tclIntDecls.h | 401 -
blt3.0.1/src/tclIntPlatDecls.h | 133 -
blt3.0.1/src/tclInterp.h | 272 -
blt3.0.1/src/tkButton.c | 2189 ---
blt3.0.1/src/tkConsole.c | 652 -
blt3.0.1/src/tkDisplay.h | 908 -
blt3.0.1/src/tkFont.h | 179 -
blt3.0.1/src/tkFrame.c | 975 --
blt3.0.1/src/tkIntBorder.h | 65 -
blt3.0.1/src/tkIntDecls.h | 369 -
blt3.0.1/src/tkIntPlatDecls.h | 186 -
blt3.0.1/src/tkMenubutton.c | 1200 --
blt3.0.1/src/tkPlatDecls.h | 228 -
blt3.0.1/src/tkUnixFont.h | 128 -
blt3.0.1/src/tkWinDisplay.h | 106 -
blt3.0.1/src/tkWinFont.h | 163 -
blt3.0.1/tests/datatable.tcl | 4252 -----
blt3.0.1/tests/defs | 97 -
blt3.0.1/tests/renumber.tcl | 17 -
blt3.0.1/tests/tree.tcl | 2108 ---
blt3.0.1/win/README | 277 -
blt3.0.1/win/README.vc++ | 123 -
blt3.0.1/win/X11/X.h | 673 -
blt3.0.1/win/X11/Xatom.h | 79 -
blt3.0.1/win/X11/Xfuncproto.h | 60 -
blt3.0.1/win/X11/Xlib.h | 1468 --
blt3.0.1/win/X11/Xutil.h | 855 -
blt3.0.1/win/X11/cursorfont.h | 79 -
blt3.0.1/win/X11/keysym.h | 39 -
blt3.0.1/win/X11/keysymdef.h | 1169 --
blt3.0.1/win/install.tcl | 739 -
blt3.0.1/win/makedefs | 90 -
572 files changed, 438961 deletions(-)
diff --git a/blt3.0.1/INSTALL b/blt3.0.1/INSTALL
deleted file mode 100644
index fb209d5..0000000
--- a/blt3.0.1/INSTALL
+++ /dev/null
@@ -1,115 +0,0 @@
-This file describes how to compile and install the BLT library for UNIX.
-[See the file ./win/README for details on how to build under Win32.]
-
-1. Uncompress and untar the distribution file.
-
- zcat BLT3.0.tar.gz | tar -xvf -
-
- This will create a directory "blt3.0" with the following subdirectories:
-
- blt3.0
- ______________|_____________________________
- | | | | | | |
- demos examples html library man src win
- | | |
- scripts shared X11
-
-2. Run ./configure
-
- Go into the "blt3.0" directory
-
- cd blt3.0
-
- and run the auto-configuration script "./configure". Tell where to find
- the Tcl and Tk header files and libraries with the "--with-tcl" switch.
-
- ./configure --with-tcl=/util/lang/tcl
-
- Switches:
-
- --prefix=path Specifies the path where "bltwish", the BLT
- header files, libraries, scripts, and manual
- pages are installed. The default is
- "/usr/local/blt".
-
- This switch also indicates where to find the
- Tcl/Tk header files and libraries. You can use
- the --with-tcl and --with-tk switches to override
- this value if the location of the Tcl/Tk files
- is different.
-
- --with-tcl=dir Directory where Tcl and/or Tk is installed.
-
- --with-tk=dir Directory where Tk is installed if different
- from "--with-tcl".
-
- --with-cc=program Lets you specify the C compiler, such as
- "acc" or "gcc".
-
- The configure script creates a header file "src/bltConfig.h". It will also
- generate new Makefiles from their respective templates (Makefile.in).
-
- Makefile.in ==> Makefile
- src/Makefile.in ==> src/Makefile
- src/shared/Makefile.in ==> src/shared/Makefile
- man/Makefile.in ==> man/Makefile
- library/Makefile.in ==> library/Makefile
-
-3. Compile the libraries and build the demonstration program "bltwish".
-
- make
-
- The program "bltwish" will be created in the ./src directory.
-
-4. Test by running the demos.
-
- Go into the demos directory
-
- cd demos
-
- and run the test scripts.
-
- ./graph1.tcl
-
- If your system doesn't support "#!" in shell scripts, then it's
-
- ../src/bltwish ./graph1.tcl
-
-
-5. Installing BLT
-
- make install
-
- The following directories will be created when BLT is installed.
- By default, the top directory is /usr/local/blt.
-
- ___________|__________
- | | | |
- bin include lib man
- |
- blt3.0
- ____|____
- | |
- demos dd_protocols
-
- You can change the top directory by supplying the "--prefix=dir" switch
- to ./configure.
-
-*6. (Optional) Compiling BLT into your own custom "wish".
-
- [If your version of "wish" supports dynamic loading of packages
- you can simply add
-
- package require BLT
-
- to the start of your script.]
-
- Add the following lines to your program's Tcl_AppInit routine in
- tkAppInit.c
-
- if (Blt_Init(interp) != TCL_OK) {
- return TCL_ERROR;
- }
-
- then link with libBLT.a. And that's all there's to it.
-
diff --git a/blt3.0.1/MANIFEST b/blt3.0.1/MANIFEST
deleted file mode 100644
index 04087eb..0000000
--- a/blt3.0.1/MANIFEST
+++ /dev/null
@@ -1,394 +0,0 @@
-blt2.4z
-blt2.4z/MANIFEST
-blt2.4z/INSTALL
-blt2.4z/cf
-blt2.4z/cf/config.guess
-blt2.4z/cf/config.sub
-blt2.4z/cf/install-sh
-blt2.4z/cf/install.sh
-blt2.4z/cf/ldAix
-blt2.4z/html
-blt2.4z/html/BLT.html
-blt2.4z/html/Makefile.vc
-blt2.4z/html/barchart.html
-blt2.4z/html/beep.html
-blt2.4z/html/bgexec.html
-blt2.4z/html/bitmap.html
-blt2.4z/html/bltdebug.html
-blt2.4z/html/busy.html
-blt2.4z/html/container.html
-blt2.4z/html/cutbuffer.html
-blt2.4z/html/dragdrop.html
-blt2.4z/html/eps.html
-blt2.4z/html/graph.html
-blt2.4z/html/hierbox.html
-blt2.4z/html/hiertable.html
-blt2.4z/html/htext.html
-blt2.4z/html/spline.html
-blt2.4z/html/stripchart.html
-blt2.4z/html/table.html
-blt2.4z/html/tabset.html
-blt2.4z/html/tile.html
-blt2.4z/html/tree.html
-blt2.4z/html/treeview.html
-blt2.4z/html/vector.html
-blt2.4z/html/watch.html
-blt2.4z/html/winop.html
-blt2.4z/Makefile.in
-blt2.4z/Makefile.vc
-blt2.4z/NEWS
-blt2.4z/PROBLEMS
-blt2.4z/README
-blt2.4z/acconfig.h
-blt2.4z/aclocal.m4
-blt2.4z/blt.mak
-blt2.4z/configure
-blt2.4z/configure.in
-blt2.4z/demos
-blt2.4z/demos/bitmaps
-blt2.4z/demos/bitmaps/fish
-blt2.4z/demos/bitmaps/fish/left.xbm
-blt2.4z/demos/bitmaps/fish/left1.xbm
-blt2.4z/demos/bitmaps/fish/left1m.xbm
-blt2.4z/demos/bitmaps/fish/leftm.xbm
-blt2.4z/demos/bitmaps/fish/mid.xbm
-blt2.4z/demos/bitmaps/fish/midm.xbm
-blt2.4z/demos/bitmaps/fish/right.xbm
-blt2.4z/demos/bitmaps/fish/right1.xbm
-blt2.4z/demos/bitmaps/fish/right1m.xbm
-blt2.4z/demos/bitmaps/fish/rightm.xbm
-blt2.4z/demos/bitmaps/hand
-blt2.4z/demos/bitmaps/hand/hand01.xbm
-blt2.4z/demos/bitmaps/hand/hand01m.xbm
-blt2.4z/demos/bitmaps/hand/hand02.xbm
-blt2.4z/demos/bitmaps/hand/hand02m.xbm
-blt2.4z/demos/bitmaps/hand/hand03.xbm
-blt2.4z/demos/bitmaps/hand/hand03m.xbm
-blt2.4z/demos/bitmaps/hand/hand04.xbm
-blt2.4z/demos/bitmaps/hand/hand04m.xbm
-blt2.4z/demos/bitmaps/hand/hand05.xbm
-blt2.4z/demos/bitmaps/hand/hand05m.xbm
-blt2.4z/demos/bitmaps/hand/hand06.xbm
-blt2.4z/demos/bitmaps/hand/hand06m.xbm
-blt2.4z/demos/bitmaps/hand/hand07.xbm
-blt2.4z/demos/bitmaps/hand/hand07m.xbm
-blt2.4z/demos/bitmaps/hand/hand08.xbm
-blt2.4z/demos/bitmaps/hand/hand08m.xbm
-blt2.4z/demos/bitmaps/hand/hand09.xbm
-blt2.4z/demos/bitmaps/hand/hand09m.xbm
-blt2.4z/demos/bitmaps/hand/hand10.xbm
-blt2.4z/demos/bitmaps/hand/hand10m.xbm
-blt2.4z/demos/bitmaps/hand/hand11.xbm
-blt2.4z/demos/bitmaps/hand/hand11m.xbm
-blt2.4z/demos/bitmaps/hand/hand12.xbm
-blt2.4z/demos/bitmaps/hand/hand12m.xbm
-blt2.4z/demos/bitmaps/hand/hand13.xbm
-blt2.4z/demos/bitmaps/hand/hand13m.xbm
-blt2.4z/demos/bitmaps/hand/hand14.xbm
-blt2.4z/demos/bitmaps/hand/hand14m.xbm
-blt2.4z/demos/bitmaps/face.xbm
-blt2.4z/demos/bitmaps/greenback.xbm
-blt2.4z/demos/bitmaps/hobbes.xbm
-blt2.4z/demos/bitmaps/hobbes_mask.xbm
-blt2.4z/demos/bitmaps/sharky.xbm
-blt2.4z/demos/bitmaps/xbob.xbm
-blt2.4z/demos/Makefile.in
-blt2.4z/demos/Makefile.vc
-blt2.4z/demos/barchart1.tcl
-blt2.4z/demos/barchart2.tcl
-blt2.4z/demos/barchart3.tcl
-blt2.4z/demos/barchart4.tcl
-blt2.4z/demos/barchart5.tcl
-blt2.4z/demos/bgexec1.tcl
-blt2.4z/demos/bgexec2.tcl
-blt2.4z/demos/bgexec3.tcl
-blt2.4z/demos/bgexec4.tcl
-blt2.4z/demos/bgexec5.tcl
-blt2.4z/demos/bitmap.tcl
-blt2.4z/demos/bitmap2.tcl
-blt2.4z/demos/busy1.tcl
-blt2.4z/demos/busy2.tcl
-blt2.4z/demos/container.tcl
-blt2.4z/demos/container3.tcl
-blt2.4z/demos/dnd1.tcl
-blt2.4z/demos/dnd2.tcl
-blt2.4z/demos/dragdrop1.tcl
-blt2.4z/demos/dragdrop2.tcl
-blt2.4z/demos/eps.tcl
-blt2.4z/demos/graph1.tcl
-blt2.4z/demos/graph2.tcl
-blt2.4z/demos/graph3.tcl
-blt2.4z/demos/graph4.tcl
-blt2.4z/demos/graph5.tcl
-blt2.4z/demos/graph6.tcl
-blt2.4z/demos/graph7.tcl
-blt2.4z/demos/hierbox1.tcl
-blt2.4z/demos/hierbox2.tcl
-blt2.4z/demos/hierbox3.tcl
-blt2.4z/demos/hierbox4.tcl
-blt2.4z/demos/hiertable1.tcl
-blt2.4z/demos/hiertable2.tcl
-blt2.4z/demos/hiertable3.tcl
-blt2.4z/demos/htext.txt
-blt2.4z/demos/htext1.tcl
-blt2.4z/demos/spline.tcl
-blt2.4z/demos/stripchart1.tcl
-blt2.4z/demos/tabnotebook1.tcl
-blt2.4z/demos/tabnotebook2.tcl
-blt2.4z/demos/tabnotebook3.tcl
-blt2.4z/demos/tabset1.tcl
-blt2.4z/demos/tabset2.tcl
-blt2.4z/demos/tabset3.tcl
-blt2.4z/demos/tabset4.tcl
-blt2.4z/demos/tour.tcl
-blt2.4z/demos/treeview1.tcl
-blt2.4z/demos/winop1.tcl
-blt2.4z/demos/winop2.tcl
-blt2.4z/demos/images
-blt2.4z/demos/images/blt98.gif
-blt2.4z/demos/images/buckskin.gif
-blt2.4z/demos/images/chalk.gif
-blt2.4z/demos/images/close.gif
-blt2.4z/demos/images/close2.gif
-blt2.4z/demos/images/clouds.gif
-blt2.4z/demos/images/corrugated_metal.gif
-blt2.4z/demos/images/folder.gif
-blt2.4z/demos/images/jan25_palm3x_L.jpg
-blt2.4z/demos/images/mini-book1.gif
-blt2.4z/demos/images/mini-book2.gif
-blt2.4z/demos/images/mini-display.gif
-blt2.4z/demos/images/mini-doc.gif
-blt2.4z/demos/images/mini-filemgr.gif
-blt2.4z/demos/images/mini-ofolder.gif
-blt2.4z/demos/images/mini-windows.gif
-blt2.4z/demos/images/ofolder.gif
-blt2.4z/demos/images/open.gif
-blt2.4z/demos/images/open2.gif
-blt2.4z/demos/images/out.ps
-blt2.4z/demos/images/qv100.t.gif
-blt2.4z/demos/images/rain.gif
-blt2.4z/demos/images/sample.gif
-blt2.4z/demos/images/smblue_rock.gif
-blt2.4z/demos/images/stopsign.gif
-blt2.4z/demos/images/tan_paper.gif
-blt2.4z/demos/images/tan_paper2.gif
-blt2.4z/demos/images/txtrflag.gif
-blt2.4z/demos/scripts
-blt2.4z/demos/scripts/barchart2.tcl
-blt2.4z/demos/scripts/bgtest.tcl
-blt2.4z/demos/scripts/clone.tcl
-blt2.4z/demos/scripts/demo.tcl
-blt2.4z/demos/scripts/globe.tcl
-blt2.4z/demos/scripts/graph1.tcl
-blt2.4z/demos/scripts/graph2.tcl
-blt2.4z/demos/scripts/graph3.tcl
-blt2.4z/demos/scripts/graph5.tcl
-blt2.4z/demos/scripts/graph8.tcl
-blt2.4z/demos/scripts/page.tcl
-blt2.4z/demos/scripts/patterns.tcl
-blt2.4z/demos/scripts/ps.tcl
-blt2.4z/demos/scripts/send.tcl
-blt2.4z/demos/scripts/stipples.tcl
-blt2.4z/demos/scripts/xcolors.tcl
-blt2.4z/examples
-blt2.4z/examples/calendar.tcl
-blt2.4z/examples/form.tcl
-blt2.4z/examples/pareto.tcl
-blt2.4z/library
-blt2.4z/library/dd_protocols
-blt2.4z/library/dd_protocols/dd-color.tcl
-blt2.4z/library/dd_protocols/dd-file.tcl
-blt2.4z/library/dd_protocols/dd-number.tcl
-blt2.4z/library/dd_protocols/dd-text.tcl
-blt2.4z/library/dd_protocols/tclIndex
-blt2.4z/library/Makefile.in
-blt2.4z/library/Makefile.vc
-blt2.4z/library/ZoomStack.itcl
-blt2.4z/library/bltCanvEps.pro
-blt2.4z/library/bltGraph.pro
-blt2.4z/library/dnd.tcl
-blt2.4z/library/dragdrop.tcl
-blt2.4z/library/graph.tcl
-blt2.4z/library/hierbox.tcl
-blt2.4z/library/hiertable.tcl
-blt2.4z/library/pkgIndex.tcl.in
-blt2.4z/library/tabnotebook.tcl
-blt2.4z/library/tabset.tcl
-blt2.4z/library/tclIndex
-blt2.4z/library/treeview.cur
-blt2.4z/library/treeview.tcl
-blt2.4z/library/treeview.xbm
-blt2.4z/library/treeview_m.xbm
-blt2.4z/man
-blt2.4z/man/BLT.mann
-blt2.4z/man/Blt_Tree.man3
-blt2.4z/man/Blt_TreeCreate.man3
-blt2.4z/man/Blt_TreeCreateNode.man3
-blt2.4z/man/Blt_TreeDeleteNode.man3
-blt2.4z/man/Blt_TreeExists.man3
-blt2.4z/man/Blt_TreeGetNode.man3
-blt2.4z/man/Blt_TreeGetToken.man3
-blt2.4z/man/Blt_TreeName.man3
-blt2.4z/man/Blt_TreeNodeId.man3
-blt2.4z/man/Blt_TreeReleaseToken.man3
-blt2.4z/man/Makefile.in
-blt2.4z/man/barchart.mann
-blt2.4z/man/beep.mann
-blt2.4z/man/bgexec.mann
-blt2.4z/man/bitmap.mann
-blt2.4z/man/bltdebug.mann
-blt2.4z/man/busy.mann
-blt2.4z/man/container.mann
-blt2.4z/man/cutbuffer.mann
-blt2.4z/man/dragdrop.mann
-blt2.4z/man/eps.mann
-blt2.4z/man/graph.mann
-blt2.4z/man/hierbox.mann
-blt2.4z/man/hiertable.mann
-blt2.4z/man/htext.mann
-blt2.4z/man/man.macros
-blt2.4z/man/spline.mann
-blt2.4z/man/stripchart.mann
-blt2.4z/man/table.mann
-blt2.4z/man/tabset.mann
-blt2.4z/man/tile.mann
-blt2.4z/man/tree.mann
-blt2.4z/man/treeview.mann
-blt2.4z/man/vector.mann
-blt2.4z/man/watch.mann
-blt2.4z/man/winop.mann
-blt2.4z/src
-blt2.4z/src/shared
-blt2.4z/src/shared/Makefile.in
-blt2.4z/src/Makefile-cyg.in
-blt2.4z/src/Makefile.bc
-blt2.4z/src/Makefile.in
-blt2.4z/src/Makefile.vc
-blt2.4z/src/TODO
-blt2.4z/src/blt.h
-blt2.4z/src/blt.mak
-blt2.4z/src/bltAlloc.c
-blt2.4z/src/bltArrayObj.c
-blt2.4z/src/bltBeep.c
-blt2.4z/src/bltBgexec.c
-blt2.4z/src/bltBind.c
-blt2.4z/src/bltBind.h
-blt2.4z/src/bltBitmap.c
-blt2.4z/src/bltBusy.c
-blt2.4z/src/bltCanvEps.c
-blt2.4z/src/bltChain.c
-blt2.4z/src/bltChain.h
-blt2.4z/src/bltColor.c
-blt2.4z/src/bltConfig.c
-blt2.4z/src/bltConfig.h.in
-blt2.4z/src/bltContainer.c
-blt2.4z/src/bltCutbuffer.c
-blt2.4z/src/bltDebug.c
-blt2.4z/src/bltDragdrop.c
-blt2.4z/src/bltGrAxis.c
-blt2.4z/src/bltGrAxis.h
-blt2.4z/src/bltGrBar.c
-blt2.4z/src/bltGrElem.c
-blt2.4z/src/bltGrElem.h
-blt2.4z/src/bltGrGrid.c
-blt2.4z/src/bltGrHairs.c
-blt2.4z/src/bltGrLegd.c
-blt2.4z/src/bltGrLegd.h
-blt2.4z/src/bltGrLine.c
-blt2.4z/src/bltGrMarker.c
-blt2.4z/src/bltGrMisc.c
-blt2.4z/src/bltGrPen.c
-blt2.4z/src/bltGrPs.c
-blt2.4z/src/bltGraph.c
-blt2.4z/src/bltGraph.h
-blt2.4z/src/bltHash.c
-blt2.4z/src/bltHash.h.in
-blt2.4z/src/bltHierbox.c
-blt2.4z/src/bltHtext.c
-blt2.4z/src/bltImage.c
-blt2.4z/src/bltImage.h
-blt2.4z/src/bltInit.c
-blt2.4z/src/bltInt.h
-blt2.4z/src/bltInterp.h
-blt2.4z/src/bltList.c
-blt2.4z/src/bltList.h
-blt2.4z/src/bltMath.h
-blt2.4z/src/bltNsUtil.c
-blt2.4z/src/bltNsUtil.h
-blt2.4z/src/bltObjConfig.c
-blt2.4z/src/bltObjConfig.h
-blt2.4z/src/bltParse.c
-blt2.4z/src/bltPool.c
-blt2.4z/src/bltPool.h
-blt2.4z/src/bltPs.c
-blt2.4z/src/bltPs.h
-blt2.4z/src/bltScrollbar.c
-blt2.4z/src/bltSpline.c
-blt2.4z/src/bltSwitch.c
-blt2.4z/src/bltSwitch.h
-blt2.4z/src/bltTable.c
-blt2.4z/src/bltTable.h
-blt2.4z/src/bltTabnotebook.c
-blt2.4z/src/bltTabset.c
-blt2.4z/src/bltTed.c
-blt2.4z/src/bltText.c
-blt2.4z/src/bltText.h
-blt2.4z/src/bltTile.c
-blt2.4z/src/bltTile.h
-blt2.4z/src/bltTkInt.h
-blt2.4z/src/bltTree.c
-blt2.4z/src/bltTree.h
-blt2.4z/src/bltTreeCmd.c
-blt2.4z/src/bltTreeView.c
-blt2.4z/src/bltTreeView.h
-blt2.4z/src/bltTreeViewCmd.c
-blt2.4z/src/bltTreeViewColumn.c
-blt2.4z/src/bltTreeViewEdit.c
-blt2.4z/src/bltTreeViewStyle.c
-blt2.4z/src/bltTuple.c
-blt2.4z/src/bltTuple.h
-blt2.4z/src/bltTupleCmd.c
-blt2.4z/src/bltUnixDnd.c
-blt2.4z/src/bltUnixImage.c
-blt2.4z/src/bltUnixMain.c
-blt2.4z/src/bltUnixPipe.c
-blt2.4z/src/bltUtil.c
-blt2.4z/src/bltVecCmd.c
-blt2.4z/src/bltVecInt.h
-blt2.4z/src/bltVecMath.c
-blt2.4z/src/bltVecObjCmd.c
-blt2.4z/src/bltVector.c
-blt2.4z/src/bltVector.h
-blt2.4z/src/bltWait.h
-blt2.4z/src/bltWatch.c
-blt2.4z/src/bltWin.h
-blt2.4z/src/bltWinConfig.h
-blt2.4z/src/bltWinDde.c
-blt2.4z/src/bltWinDraw.c
-blt2.4z/src/bltWinImage.c
-blt2.4z/src/bltWinMain.c
-blt2.4z/src/bltWinPipe.c
-blt2.4z/src/bltWinPrnt.c
-blt2.4z/src/bltWinUtil.c
-blt2.4z/src/bltWindow.c
-blt2.4z/src/bltWinop.c
-blt2.4z/src/missing.h
-blt2.4z/src/pure_api.c
-blt2.4z/src/tkButton.c
-blt2.4z/src/tkConsole.c
-blt2.4z/src/tkFrame.c
-blt2.4z/src/tkMenubutton.c
-blt2.4z/src/tkScrollbar.c
-blt2.4z/win
-blt2.4z/win/install.tcl
-blt2.4z/win/README
-blt2.4z/win/X11
-blt2.4z/win/X11/Xatom.h
-blt2.4z/win/X11/X.h
-blt2.4z/win/X11/Xfuncproto.h
-blt2.4z/win/X11/Xlib.h
-blt2.4z/win/X11/Xutil.h
-blt2.4z/win/X11/cursorfont.h
-blt2.4z/win/X11/keysym.h
-blt2.4z/win/X11/keysymdef.h
-blt2.4z/win/makedefs
diff --git a/blt3.0.1/Makefile.in b/blt3.0.1/Makefile.in
deleted file mode 100644
index d92d6ef..0000000
--- a/blt3.0.1/Makefile.in
+++ /dev/null
@@ -1,70 +0,0 @@
-# ------------------------------------------------------------------------
-# Makefile for BLT distribution
-# ------------------------------------------------------------------------
-
-# ------------------------------------------------------------------------
-# Source and target installation directories
-# ------------------------------------------------------------------------
-
-bindir = @bindir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-exec_prefix = @exec_prefix@
-includedir = @includedir@
-libdir = @libdir@
-prefix = @prefix@
-srcdir = @srcdir@
-
-version = @BLT_VERSION@
-scriptdir = $(prefix)/lib
-bltdir = $(prefix)/lib/blt$(version)
-
-instdirs = $(prefix) \
- $(exec_prefix) \
- $(bindir) \
- $(libdir) \
- $(includedir) \
- $(scriptdir) \
- $(bltdir)
-
-# ------------------------------------------------------------------------
-# Don't edit anything beyond this point
-# ------------------------------------------------------------------------
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-SHELL = /bin/sh
-MKDIR_P = @MKDIR_P@
-RM = rm -f
-
-#subdirs = src library man demos
-subdirs = src
-
-all:
- for i in $(subdirs); do \
- $(MAKE) -C $$i all || exit 1 ; \
- done
-
-install: mkdirs install-all
-
-install-all:
- for i in $(subdirs); do \
- $(MAKE) -C $$i install || exit 1 ; \
- done
-
-mkdirs:
- @for i in $(instdirs) ; do \
- $(MKDIR_P) $(DESTDIR)$$i; \
- done
-
-clean:
- for i in $(subdirs); do \
- $(MAKE) -C $$i clean || exit 1 ; \
- done
- $(RM) *.bak *\~ "#"* *pure* .pure*
-
-GENERATED_FILES = \
- config.status config.cache config.log Makefile
-
-distclean: clean
- $(RM) $(GENERATED_FILES)
diff --git a/blt3.0.1/Makefile.vc b/blt3.0.1/Makefile.vc
deleted file mode 100644
index befd59c..0000000
--- a/blt3.0.1/Makefile.vc
+++ /dev/null
@@ -1,63 +0,0 @@
-
-# ------------------------------------------------------------------------
-# Makefile for demonstation shell of BLT library
-# ------------------------------------------------------------------------
-
-include vc.config
-srcdir = $(TOP)
-
-# ------------------------------------------------------------------------
-# Source and target installation directories
-# ------------------------------------------------------------------------
-
-instdirs = $(prefix) $(exec_prefix) $(bindir) $(libdir) $(includedir)
-
-# ------------------------------------------------------------------------
-# Don't edit anything beyond this point
-# ------------------------------------------------------------------------
-
-subdirs = src demos library html
-
-all:
- (cd src; $(MAKE) -f Makefile.vc all)
- (cd demos; $(MAKE) -f Makefile.vc all)
- (cd library; $(MAKE) -f Makefile.vc all)
- (cd html; $(MAKE) -f Makefile.vc all)
-
-install: install-dirs install-all install-readme
-
-install-all:
- (cd src; $(MAKE) -f Makefile.vc install)
- (cd demos; $(MAKE) -f Makefile.vc install)
- (cd library; $(MAKE) -f Makefile.vc install)
- (cd html; $(MAKE) -f Makefile.vc install)
-
-install-dirs:
- @for i in $(instdirs) ; do \
- if test ! -d "$$i" ; then \
- echo " mkdir $$i" ; \
- mkdir $$i ; \
- fi ; \
- done
-
-install-readme:
- $(INSTALL_DATA) $(srcdir)/README $(scriptdir)
- $(INSTALL_DATA) $(srcdir)/PROBLEMS $(scriptdir)
- $(INSTALL_DATA) $(srcdir)/NEWS $(scriptdir)
-
-clean:
- (cd src; $(MAKE) -f Makefile.vc clean)
- (cd demos; $(MAKE) -f Makefile.vc clean)
- (cd library; $(MAKE) -f Makefile.vc clean)
- (cd html; $(MAKE) -f Makefile.vc clean)
- $(RM) *.bak *\~ "#"* *pure* .pure*
-
-GENERATED_FILES = \
- config.status config.cache config.log Makefile
-
-distclean: clean
- (cd src; $(MAKE) -f Makefile.vc distclean)
- (cd demos; $(MAKE) -f Makefile.vc distclean)
- (cd library; $(MAKE) -f Makefile.vc distclean)
- (cd html; $(MAKE) -f Makefile.vc distclean)
- $(RM) $(GENERATED_FILES)
diff --git a/blt3.0.1/NEWS b/blt3.0.1/NEWS
deleted file mode 100644
index 3ff432b..0000000
--- a/blt3.0.1/NEWS
+++ /dev/null
@@ -1,730 +0,0 @@
-FEATURES
-========
-
-stripchart
- The graph's -areapattern, -areaforeground, -areabackground, and
- -areatile options are now available in the stripchart too.
-
-
-BUG FIXES
-=========
-
-tree
- On 64-bit platforms, bltTree.c doesn't compile because of missing
- macros START_LOGSIZE and MAX_LIST_VALUES. Thanks to Keith
- W. Johnson <kwjohnson at llnl.gov> for the bug report.
-general
- When compiling under Tru64, bltInit.c fails to compile. Again many
- thanks to Keith W. Johnson <kwjohnson at llnl.gov> for the bug report.
-vector
- Vector always uses array variable in global namespace when name
- is not namespace-qualified. Thanks to Paul Kienzle
- <pkienzle at jazz.ncnr.nist.gov> for the bug report and example
- script.
-
-Changes from 2.4y to 2.4z
-
-FEATURES
-========
-
-graph/stripchart/barchart
- Under Windows, both the "print1" and "print2" operations will
- pop-up a standard printer dialog when you don't pass a printer
- argument.
-graph/stripchart/barchart
- New -state option for both elements and markers. If "disabled",
- marker or element isn't eligible for binding events. This is
- useful when you have lots (>100,000) of data points.
-graph/stripchart/barchart
- New axis option -titlealternate lets you place the axis title to
- the top or right of the axis. This used to automatically happen when
- you had more than one axis in a margin. This option lets you control
- it.
-tree
- Both "find" and "apply" operations may be given more than one
- pattern switch (-exact, -glob, or -regexp). This performs a
- logical "or"--if any one of the pattern matches, the node is
- a match.
-tree
- Both "find" and "apply" operations now have addition switches
- -keyexact, -keyglob, and -keyregexp (the -key switch works like
- -keyexact). You may supply more than one switch. This performs
- a logical "or"--if any one of the pattern matches, the node is a
- match.
-graph/stripchart/barchart
- New axis options -scrollmin and -scrollmax allow you to specify
- the scroll region. Thanks to both Meaghan Parizeau
- <Meaghan_Parizeau at srtelecom.com> and Julian H J
- Loaring <jhjl at bigj.demon.co.uk> for the solution.
-graph/stripchart/barchart
- Polygon marker will trigger bindings even if the marker is not
- filled (-fill "") or has no outline (-linewidth 0). Interior
- is always considered part of the polygon.
-tree
- Tree adaptively restructures data values from a linked list into a
- hash table when the number of values exceeds 20.
-configure.in
- Can build BLT with cygwin (gcc under Windows) distribution. Type
- ./configure and make to build. Use -disable-cygwin switch to build
- "mingw" version. Many thanks to Mumit Khan <khan at pluto.xraylith.wisc.edu>
- for all the hard work of porting the configure.in and Makefiles.
-
-BUG FIXES
-=========
-
-eps
- Canvas item errors out with "can't get handle to EPS file" message.
- Thanks to Shamil Daghestani <shamild at hotmail.com> for the bug report.
-graph/stripchart/barchart
- Image marker doesn't get scaled correctly when scaling factor is
- large. Thanks to Paul Kienzle <pkienzle at jazz.ncnr.nist.gov>
- for the bug report and example script. It really helped.
-vector
- "min" and "max" initially don't report the correct value. Many
- thanks to Alexander Eisenhuth <stacom at stacom-software.de> for the
- bug report.
-treeview/tree
- "show -full $key" operation doesn't work.
-graph/stripchart/barchart
- Doesn't display trailing data points when there are more than
- 65331 points. Thanks to Val Shkolnikov <nvsoft at pacbell.net>
- for the bug report.
-vector
- Vectors leak memory when accessing them through the Tcl array
- variable. Thanks to Alexander Eisenhuth <stacom at stacom-software.de>
- for the bug report and especially the test script to demonstrate
- the problem.
-treeview/tree
- In "apply" operation, -regexp, -exact, or -glob switches don't
- work. Always matches every node.
-graph/stripchart/barchart
- Axis "-hide" option no longer accepts "all" value. "all" was
- supposed to hide the axis *and* all the elements mapped to it.
- I don't think this option ever worked correctly. It was also
- unclear whether to hide the legend entry, markers, etc.
-graph/stripchart/barchart
- Changing a marker's -hide option doesn't take effect until the
- graph is redrawn. Thanks to Alex Verstak <averstak at vt.edu> for
- the bug report.
-graph/stripchart/barchart
- Spurious characters in PostScript output generated under Windows.
- Thanks to Cary D. Renzema <Cary.Renzema at analog.com> for the bug
- report and sample files.
-graph/stripchart/barchart
- "snap" operation core dumps or returns X protocol error depending
- on arguments. Thanks to Carsten Mortensen <cbm at microlex.dk> for
- both the bug report and the fix.
-graph/stripchart/barchart
- Polygon marker not drawn unless no outline is specified (-linewith 0).
- Thanks to Nestor Patino <npatino at infovia.com.ar> for the bug report.
-treeview/tree
- Tags are removed when tree or treeview widget is destroyed. Many
- thanks to Todd Copeland <todd.copeland at legerity.com> for the report.
-treeview/tree
- "index" operation segfaults when tag is empty. Again thanks to Todd
- Copeland <todd.copeland at legerity.com> for the report.
-pkgIndex.tcl
- Added checks for package directory and its parent when searching
- for BLT shared library. Thanks to Anton Hartl <toni at devsoft.com>
- for the bug report.
-
-Changes from 2.4x to 2.4y
-
-FEATURES
-========
-
-tree
- Added -notags switch to "restore" operation.
-tree
- Added additional fields to the tree "dump" format. When trees are
- restored, will try to reuse old node ids (not always possible).
-tree
- Added -label switch to "copy" operation. This lets you relabel the
- destination node.
-
-BUG FIXES
-=========
-
-graph/stripchart/barchart
- PostScript output sometimes includes a spurious box around an axis.
- Thanks to Harvey.Davies at csiro.au for the bug report and example.
-tabset/tabnotebook
- On errors tabnotebook grows ad infinitum. Thanks to Terri Fischer
- <terri at ner.com> for the bug report and example.
-<general>
- Tcl_Init fails with "can't find usable init.tcl" when running
- bltsh or bltwish compile with ActiveTcl. Changed Tcl_AppInit to
- set global "tclDefaultLibrary" variable.
-graph
- "legend get" operation doesn't account for hidden entries
- (i.e. -label is configured to ""). Thanks to Karl Voskuil
- <voskuil at ll.mit.edu> for the bug report and the fix.
-graph
- NULL pointer referenced (bindingTable) when destroying axis.
-bgexec
- File redirection broken under Windows.
-graph
- Area under curve not stippled correctly when bitmap is greater than
- 8x8 (W95/W98) or device context is a metafile (all?). Created
- XFillPolygon replacement for Windows.
-tree
- Node modifiers are incorrectly ignored when first component is a tag.
-treeview
- -shadow option no longer accepts empty string (no shadow). Many
- thanks to Todd Copeland <todd.copeland at legerity.com> for the report.
-vector
- Vector "create" operation slows down using #auto as more vectors
- are created. Thanks to Todd Copeland <todd.copeland at legerity.com>
- for the bug report.
-treeview/hiertable
- Widget doesn't scroll horizontally correctly when -hideleaves is
- true. Ignores last level when computing world width.
-treeview/hiertable
- Deleting a node doesn't remove tag references to it. Thanks to
- Steven Hafer <steven.hafer at legerity.com> for the bug report.
-treeview/hiertable
- Giving the -path option to the "index" operation always fails. Thanks
- to Paul Robins <paul.robins at st.com> for the bug report.
-<treeview.mann/hiertable.mann>
- Documentation for the "get" operation isn't clear that it always returns
- a list of lists when the -separator option is "" (the default), even
- when there is only one node specified.
-
-Changes from 2.4w to 2.4x
-
-FEATURES
-========
-
-dragdrop
- Back ported 8.3 "dde" command for use with 8.0.
-
-BUG FIXES
-=========
-
-treeview/hiertable
- Can't create column that starts with a minus. Thanks to Todd Copeland
- <todd.copeland at legerity.com> for the bug report.
-<Makefile.in>
- pkgIndex.tcl file not getting rebuilt. Thanks to Terri Fischer
- <terri at ner.com> for the bug report and fix.
-<dragdrop1.tcl,dragdrop2.tcl>
- Send emulation script isn't needed for Tcl8.0 under Windows. Thanks to
- Linh H Phan <phan at grover.jpl.nasa.gov> for the bug report.
-graph/stripchart/barchart
- Using pen styles results in a bus error. Thanks to Julian H J
- Loaring <jhjl at bigj.demon.co.uk> for the bug report.
-hiertable/treeview/tree
- List of data values is reversed from 2.4v. Thanks to Jorge Suit
- Prez Ronda <jsperez at bayesinf.com> for the bug report.
-<bltObjConfig.c>
- Missing header file for varargs. Thanks to Terri Fischer <terri at ner.com>
- for the bug report and fix.
-<bltAlloc.c>
- TclpAlloc and TclpFree not found in Tcl 8.0. Again, thanks to Terri
- Fischer <terri at ner.com> for the bug report and fix.
-<BLT.mann,barchart.mann,eps.mann,graph.mann,tabset.man>
- Updated manual pages graciously provided by Terri Fischer <terri at ner.com>.
-
-Changes from 2.4v to 2.4w
-
-FEATURES
-========
-
-treeview
- New treeview widget is updated version of hiertable. Uses Tcl_Objs.
- The "hiertable" and "treeview" are the 100% syntax compatible. The
- old hiertable is temporariliy available as "hiertable-old" should
- you find errors. Also use the "treeview" instead of the "hierbox"
- widget. The "hierbox" isn't as capable and doesn't use tree data
- objects.
-treeview/hiertable
- Added tagging operations similar to the "tree" command. Attaching
- a tree to the treeview/hiertable (the -tree option) now gives you
- access to the tree's tags too. Don't confuse this with "bindtags".
- For example, you can tag nodes with the "tree" command and operate
- on them in the treeview/hiertable widget using that tag. If you
- don't want to share tags, the -newtags option will prevent this.
- There's an update "treeview" manual entry to describe this.
-treeview/hiertable
- The "nearest" operation can report what part of the entry the pointer
- is over. If a variable name argument is given, the variable will
- contain either "button", "label", "icon", or "".
-eps/winop
- Faster image zooming and rotation (fixed-point arithmetic).
-
-BUG FIXES
-=========
-
-vector
- Test of real number in a range is broken. Thanks to Paul Robins
- for the bug report.
-treeview/hiertable
- "nearest" operation doesn't allow an optional "variable" argument.
-hiertable/hierbox
- The -selectioncommand command is invoked when closing an entry
- with no selected descendants. Thanks to Jorge Suit Prez Ronda
- <jsperez at bayesinf.com> for the bug report.
-hiertable/hierbox
- In single "mode", the selection anchor is not updated when the
- selection is moved via the keyboard. Thanks to Jorge Suit Prez Ronda
- <jsperez at bayesinf.com> for the bug report.
-hiertable
- Editor overwrites memory (seen best under Windows).
-hiertable
- The "open" and "close" operations don't check for no arguments.
-hiertable
- Vertical dotted lines start on wrong y-coordinate when clipped.
-hiertable
- Active button isn't clipped by column titles.
-hiertable
- Column titles are still displayed and picked despite -showtitles
- set to "no".
-hiertable
- Editor doesn't automatically select acquired text.
-hiertable
- Moving the cursor in the editor doesn't clear the selection.
-hiertable
- Typing a "space" doesn't replace the selection with a space.
-tree
- Traces on the same node loop infinitely. TRACE_ACTIVE flag not
- set/unset.
-tree
- The "restore" and "restorefile" operations don't handle newlines
- in data key/values, node labels, or tags.
-graph/barchart/stripchart
- Crosshairs left on screen when the mouse is pulled quicky from the
- widget.
-graph/barchart/stripchart
- Spurious crosshairs also left on the screen if axes are reconfigured
- (active axes).
-graph/barchart/stripchart
- Image marker not updated if image is changed.
-graph/barchart/stripchart
- PostScript not generated for -showvalues option.
-graph/barchart/stripchart
- PostScript not generated for errorbars.
-bgexec
- No check for wrong number of arguments if switch is present.
-<bltAlloc.c>
- Blt_MallocProcPtr and Blt_FreeProcPtr not declared extern in
- bltInt.h
-<bltTile.c>
- Bogus test for mask in Blt_TilePolygon routine.
-<bltImage.c>
- Counter for transparent pixels wrong in Win32 version of Blt_PolygonMask.
-<bltInit.c>
- blt_version not set when dynamically loaded into wish83.exe.
-
-Note: Stub support is still missing although patches have been
- graciously provided for the 2.4q release. This will be added as
- soon as I can get some free time.
-
-Changes from 2.4u to 2.4v
-
-FEATURES
-========
-bgexec
- New -linebuffered switch.
-
- bgexec myVar -linebuffered yes -onoutput ShowLine myProg &
-
- This option lets you process updated data (-onerror, -onoutput,
- -error, or -output) on a line by line basis. Normally notifications
- occur once for entire data block. This switch causes separate
- notifications to made for each complete line.
-bgexec
- New -decodeoutput and -decodeerror switches.
-
- bgexec myVar -decodeoutput unicode -output myOut myProg &
-
- Translates data from the specified encoding to UTF before passing
- it to the Tcl interpreter. Normally no translation is made (under
- Windows CR-LF conversions are made) and the raw, typically ASCII,
- characters are passed back to the Tcl interpreter.
- Binary data can be collected with the "binary" encoding. For
- versions using Tcl 8.1 or greater, data is returned as Tcl byte
- array object, so you can use the "binary" command to convert it
- as needed.
-
- set out [bgexec myVar -decodeoutput binary myProg]
- binary scan $myOut f values
-tree
- New "dumpfile" and "restorefile" operations to "tree" command.
-tree
- Extended -> syntax in tree command to use node names.
-
- set data [$tree get root->"fred"->"pebbles"]
-tree
- Improved memory handling of large trees. Pool allocators added to
- reduce overall memory consumption.
-graph/stripchart/barchart
- New -buffergraph switch.
- .graph configure -buffergraph no
-graph
- New options to fill area under curve of an element.
-
- .graph element configure line1 -areapattern solid
- .graph element configure line2 -areapattern BLT
-
-graph/stripchart/barchart
- New -reduce option.
-
- .graph element configure line1 -abstol 0.5
-
- Designates error tolerance for line simplificiation. Points that
- vary less than the given tolerance are merged into a single line
- segment.
-miscellaneous
- Can globally replace memory allocation routines by setting
- pointers Blt_MallocProcPtr and Blt_FreeProcPtr.
-winop
- New "rotate" operation lets you rotate photo images.
-
-BUG FIXES
-=========
-bgexec
- Fixed a race condition that caused assertion under Windows to fail.
- When both stdout and stderr are collected, if the stdout handler
- finishes first, the memory used by read thread handler could be
- freed before the stderr pipe was closed.
-graph/stripchart/barchart
- PostScript coordinates are no longer integers (screen resolution).
-graph/stripchart/barchart
- Polygon markers now clipped properly.
-vector
- Vectors can't be mapped to local variables. This was broken
- in the 2.4r release. Thanks to Johannes Zellner
- <johannes at zellner.org> for the bug report.
-vector
- Tcl command associated with a vector not destroyed when the vector
- is deleted. Much thanks to Alexander Eisenhuth <stacom at topmail.de>
- for the bug report and the example script.
-drag&drop
- "drag&drop" command fails when multiple formats are specified.
- Seen in the dragdrop2.tcl demo.
-spline
- Incorrectly reports the spline's x-vector to be non-monotonic.
- Thanks to Chang Li <changl at neatware.com> for the bug report.
-<pkgIndex.tcl>
- Fixed pkgIndex.tcl.in to figure out whether to load libBLT24.so
- or libBLTlite24.so when BLT is loaded, not when the package is
- registered. Thanks to Dr. Dieter Ruppert <ru at swb.siemens.de> for
- the bug report and fix.
-
-Changes from 2.4t to 2.4u
-
-BUG FIXES
-=========
-<./configure>
- Fixed my stupid error (missing close brace) in ./configure file.
-<Makefile.in>
- Makefile in src/shared doesn't define BLT_LIBRARY. Thanks
- to terri at ner.com (Terri L. Fischer) for the bug report and fix.
-graph/barchart/stripchart
- graph doesn't find vector in global namespace when inside of another
- namespace. Thanks to Julian H J Loaring <bigj at bigj.demon.co.uk> for
- the bug report.
-graph/barchart/stripchart
- Scratch buffer to small for PostScript prolog. Thanks again to
- Julian H J Loaring <bigj at bigj.demon.co.uk> for the bug report
- and fix.
-graph
- "bind" would fail on elements without traces (-linewidth 0).
- Thanks again to terri at ner.com (Terri L. Fischer) for the bug report.
-
- o Many changes to "dnd" command.
-
- + -package option is treated as a command prefix (like the
- scrollbar), not a script. Percent sign substitutions are
- no longer allowed. Information is passed via key-value
- parameters like the -onleave, -ondrop procedures. Procedure
- must return 1 if operation was Ok, and 0 if it failed.
-
- + The command arguments for both the "setdata" and "getdata"
- operations have changed from an arbitrary Tcl script with
- percent sign substitutions, to a command prefix with
- key-value arguments appended. The general form is
-
- procName widget args...
-
- where args is one of more key value pairs.
-
- x Relative X-coordinate of drop or pickup.
- y Relative Y-coordinate of drop or pickup.
- timestamp Timestamp of transaction.
- format Format desired.
- value Value transfered (setdata only).
-
- You can use array set to parse "args". For example:
-
- proc GetColor { widget args } {
- array set info $args
-
- puts "x-coordinate is $info(x)"
- puts "selected format is $info(format)"
-
- return [$widget cget -bg]
- }
-
- + If an -onmotion procedure is specified for the target, it is
- automatically invoked on drops before the -dropcmd is run.
- If it returns 0, the drop is canceled.
-
- + Added ./demos/dnd2.tcl to show more complicated example.
- Just like dnd1.tcl, you need to run two of them at the same
- time to see the drag-and-drop operations.
-
- + Target property wasn't getting reset when changing -onmotion,
- -onleave, etc. procedures.
-
- + Timestamps now displayed as unsigned.
-
- Many thanks to Tom Lane <tgl at sss.pgh.pa.us> for all his help and
- suggestions.
-
-Changes from 2.4s to 2.4t
-
- o Tree command syntax changes. Notify and trace operation now work
- as advertised and a copy operation added. Many thanks to Matt
- Newman <matt at sensus.org> for meticulously reviewing the command.
-
- o graph "snap" operation syntax change. Added support for generating
- Aldus metafiles and enhanced metafiles under Windows.
-
- # Normal syntax.
- set image [image create photo]
- .graph snap $image
-
- # New additions.
- .graph snap -format emf myFile.emf ;# Enhanced metafile
- .graph snap -format wmf myFile.wmf ;# Aldus placable metafile
- .graph snap -format emf CLIPBOARD ;# Metafile written into clipboard.
-
- Old width and height arguments are replaced with -width and -height
- switches.
-
- .graph snap $image 500 500 ;# Old
- .graph snap -width 500 -height 500 $image ;# New
-
- Thanks to Alain Zuur <a.zuur at marlab.ac.uk> for the enhancement.
-
- o Tabset/Tabnotebook -selectforeground option for tabs using wrong
- configuration option type. Both the bug report and fix are from
- Mark E. Smith <mark at pearl.grand.gdats.com>. Thanks.
-
- o graph "bind" to use closest point instead of line segment when
- element contains only 1 point. Thanks to Uwe Klein
- <uwe-klein at foni.net> for the bug report and script.
-
- o Hiertable tree view column has been internally renamed to
-
- "BLT Hiertable widgetName".
-
- It was formerly the name of the widget. Fortunately, you can
- refer to the column as "treeView" instead.
-
- .ht column configure treeView -text "View Label"
-
- o There's no ".tree" suffix anymore on the default tree created by
- the hiertable widget. It's now just the widget name.
-
- o Many hiertable column bug fixes. Thanks to Julian H J Loaring
- <bigj at bigj.demon.co.uk> for all the tests and reports.
-
- o Rotated text displayed incorrectly under Windows 95/98 using
- non-TrueType fonts. A test for typetype fonts has been restored.
- Thanks to James Pakko <jpakko at ford.com> for the bug report and
- script.
-
- Under Windows, Non-TrueType fonts are drawn into a bitmap and
- the bitmap is rotated. This provides the same quality as using
- rotated fonts for on-screen display. Unfortunately it's much
- poorer for higher resolution devices such as printers. The best
- bet is to simply choose TrueType fonts if you can.
-
- o Improved Hiertable folder images. Many thanks to Tom Lane
- <tgl at sss.pgh.pa.us> for the new images.
-
- o Bgexec segfaults under Windows (NT/95) if file handler is
- deleted inside of callback. Thanks to Chris Oliver
- <coliver at mminternet.com> for the bug report.
-
- o graph segfaults if pen style range min/max are the same.
- Thanks to Thomas Wu <twu at gene.com> for the bug report and script.
-
- o tabnotebook and tabset widgets would generate X11 errors if
- embedded window was resize to zero width/height. Thanks to
- Ed Ohsone <eosn at rahul.net> for the report and the script to
- demonstrate the error.
-
-Changes from 2.4r to 2.4s
-
- o Fixed bug in stripchart (introduced in 2.4r) allowing uninitialized
- data to be displayed. Thanks to Dick Gooris <gooris at lucent.com> for
- the bug report.
-
- o AIX dynamic loading. Actually made it work on a 4.3 AIX box.
-
- o Fixed -tree option in hiertable. Would segfault if tree was not
- fully initialized first.
-
- o Tree insert operation syntax changed from
-
- tree0 insert $node key1 value1 key2 value2
- to
- tree0 insert $node -data { key1 value1 key2 value2 }
-
- o Fixed tree label operation. Save uid instead of string.
-
- o Bug in TreeEventProc, should be node != NULL instead of node >= 0
- Thanks to Julian H J Loaring <bigj at bigj.demon.co.uk> for the
- bug report.
-
-
-What's new in 2.4?
-
- 1. "eps" canvas item.
-
- An encapsulated PostScript canvas item lets you embed an EPS file into
- the canvas. The "eps" item displays either a EPS preview image found
- in the file, or a Tk image that you provide.
-
- 2. "hierbox" and "hiertable" widget.
-
- Hierarchical listbox widget. Displays a general ordered tree which
- may be built on-the-fly or all at once.
-
- 3. "tabset" and "tabnotebook" widget.
-
- Can be used either as a tab notebook or simple tabset. Tabs can
- be arranged in a variety of ways: multi-tiered, scrolled, and
- attached to any of the four sides. Tab labels can contain both
- images and text (text can be arbitrarily rotated). Notebook pages
- can be torn-off into separate windows and replaced later.
-
- 4. Changes to vectors.
-
- New features:
-
- o Vector expressions. The vector now has an "expr" operation
- that lets you perform math (including math library
- functions) on vectors. There are several new functions
- (such as "max", "min", "mean" "median", "q1", "q3", "prod",
- "sum", "adev", "sdev", "skew", ...)
-
- vector expr { sin(x)^2 + cos(x)^2 }
- y expr { log(x) * $value }
-
- o New syntax to create and destroy vectors:
-
- vector create x
- vector destroy x
-
- The old syntax for creating vectors still works.
-
- vector x
-
- o Vectors are *not* automatically deleted when their Tcl
- variable is unset anymore. This means that you can
- temporarily map vectors to variables and use them as you
- would an ordinary Tcl array (kind of like "upvar").
-
- proc AddValue { vecName value } {
- $vecName variable x
-
- set x(++end) $value
- }
-
- There's an "-watchunset" flag to restore the old
- behavior if you need it.
-
- vector create x -watchunset yes
-
- o Vectors still automatically create Tcl variables by
- default. I'd like to change this, but it silently
- breaks lots of code, so it will stay.
-
- Bug fixes:
-
- o Vector reallocation failed when shrinking the vector.
-
- o Vector "destroy" callback made after vector was already freed.
-
- o Fixed vector/scalar operations.
-
- o Always store results in temporary, so not to overwrite accidently
- current vector values.
-
- 5. Changes to Graph, Barchart, Stripchart widgets.
-
- New features:
-
- o Drop shadows for text (titles, markers, etc). Drop
- shadows improve contrast when displaying text over a
- background with similar color intensities.
-
- o Postscript "-preview" option to generate a EPS
- PostScript preview image that can be read and
- displayed by the EPS canvas item.
-
- o New "-topvariable", "-bottomvariable",
- "-leftvariable", and "-rightvariable" options. They
- specify variables to contain the current margin
- sizes. These variables are updated whenever the
- graph is redrawn.
-
- o New "-aspect" option. Let's you maintain a particular aspect
- ratio for the the graph.
-
- o Image markers can now be stretched and zoomed like
- bitmap markers.
-
- o Bind operation for legend entries, markers, and elements.
-
- Much thanks to Julian Loaring <bigj at bigj.demon.co.uk>
- for the idea.
-
- o New "-xor" option for line markers, lets you draw the line
- by rubberbanded by XOR-ing without requiring the graph to
- be redrawn. This can be used, for example, to select regions
- for zooming.
-
- Thanks to Johannes Zellner (joze at krisal.physik.uni-karlsruhe.de)
- for the idea.
-
- o Can attach a scrollbar to an axis.
-
- .sbar configure -command { .graph axis view y }
- .graph axis configure y -scrollcommand { .sbar set }
-
- Bug fixes:
-
- o Closest line (point) broken when using pens styles.
-
- o Marker elastic coordinates were wrong.
-
- o PostScript bounding box included the border of the page.
-
- o Bad PostScript generated for barchart symbols with stipples.
-
- o Wrong dimensions computed with postscript " -maxpect" option.
-
- o Text markers fixed.
-
- Thanks to De Clarke for the bug report and fix.
-
-
- o Renamed axis configuration from "-range" to "-autorange" to
- match the documentation.
-
- Thanks to Brian Smith for the correction.
-
- o Fixed polygon marker pick routine.
-
- o Fixed active tab labels overlapping the selected tab.
-
- o PostScript graph footer turned off by default. Use -footer option
- to turn on.
-
- .graph postscript configure -footer yes
-
diff --git a/blt3.0.1/PROBLEMS b/blt3.0.1/PROBLEMS
deleted file mode 100644
index c43d055..0000000
--- a/blt3.0.1/PROBLEMS
+++ /dev/null
@@ -1,146 +0,0 @@
-Specific problems:
-
-1. I've built BLT, but when I run "bltwish", it doesn't know about any
- of the BLT commands.
-
- % graph .g
- invalid command name "graph"
-
- Starting with Tcl 8.x, the BLT commands are stored in their own
- namespace called "blt". The idea is to prevent name clashes with Tcl
- commands and variables from other packages, such as a "table" command
- in two different packages.
-
- You can access the BLT commands in a couple of ways.
-
- Prefix the BLT commands with the namespace qualifier "blt::"
-
- % blt::graph .g
- % blt::table . .g -resize both
-
- or import the BLT commands into the global namespace.
-
- % namespace import blt::*
- % graph .g
- % table . .g -resize both
-
-2. I'm try to compile BLT with ActiveState's Tcl/Tk distribution,
- but all the demos core dump.
-
- Look in the "include" directory where you installed ActiveState.
- Is there an "X11" directory? Remove it and recompile BLT.
- It contains all the fake X11 headers needed for Windows builds.
- So it's okay to remove it for Solaris and Linux.
-
-3. Under Windows the "drag&drop" command doesn't work for me.
-
- The "drag&drop" command uses the "send" command to communicate
- between Tk applications and under Windows Tk has no built-in
- "send" command. In ./demos/scripts/send.tcl there is a "send"
- look-a-like that uses the DDE package. Source this first and
- make sure you invoke the procedures "SendInit" and "SendVerify"
- *before* you create and drag-and-drop targets.
-
-4. I'm using Windows 95/98 and the -stipple option doesn't seem to work.
-
- Under Windows 95/98, your bitmap must be exactly 8x8. If you use
- a bigger or smaller bitmap, Windows won't stipple the pattern correctly.
- For bitmaps larger than 8x8, only the upper-left 8x8 corner of the
- bitmap is used. For smaller bitmaps, the bitmap is extended to 8x8
- with the new bits 0 (blank). This is a limitation of Windows 95/98,
- not Tk.
-
-5. I can't run bltwish.exe under Windows with Tcl/Tk version 8.0.
-
- Did you compile and install Tcl/Tk yourself? Tcl is expecting a
- registry key to be set. The installer normally does that for you.
- The key tells Tcl where to find the Tcl library scripts. Setting
- the TCL_LIBRARY environment variable to the location of the Tcl
- script directory (where init.tcl is located) will fix things.
- Dynamic loading (package require BLT) of BLT should also work.
- This problem is fixed in later versions of Tcl.
-
-6. I'm on a DEC Alpha running the graph widget. I don't see any ticks
- or lines.
-
- There's a problem with code generated by the GNU C compiler
- 2.8.[0-1] for bltGrAxis.c and bltGrLine.c (I think it's just
- these two files).
-
- Try compiling with either the native "cc" compiler or compile
- the two modules with -O0.
-
-7. When I compile BLT on Solaris (maybe others?), I get lots of error
- messages in the form:
-
- <unknown> 0xf44 /usr/local/lib/libtcl7.6.a(tclCmdIL.o)
- <unknown> 0xf3c /usr/local/lib/libtcl7.6.a(tclCmdIL.o)
- <unknown> 0x628 /usr/local/lib/libtcl7.6.a(tclCmdIL.o)
-
- This is because Tcl and Tk have been installed only as static libraries,
- not shared libraries. The ./src/shared/Makefile creates the shared BLT
- library with a back-link to these libraries. The advantage of this link
- is that when you dynamically load BLT, the correct Tcl/Tk libraries are
- automatically searched for any unresolved references.
-
- You can fix this in one of two ways.
-
- o Remove the back-link. Edit ./src/shared/Makefile and cut the
- "-ltcl* -ltk*" references from the SHLIB_LD_LIBS macro.
-
- o Create shared libraries for Tcl and Tk. Re-configure, compile,
- and install Tcl/Tk from their sources. Make sure you add the
- "--enable-shared" switch to "configure".
-
- ./configure --enable-shared
-
-8. How do I create a shared library of BLT under AIX?
-
- Check that Tcl and Tk were both configured with the --enable-shared flag.
- When you compile each of them, a "lib.exp" file is created in their
- respective "unix" subdirectories. The lib.exp files are removed when
- you do a "make clean", so you may need to recompile.
-
- The BLT Makefile uses the TCL_SRC_DIR and TK_SRC_DIR values in the
- tclConfig.sh and tkConfig.sh files to find these lib.exp files. You
- may need to edit ./src/Makefile/shared to reflect the real paths of
- the Tcl and Tk source distributions.
-
-9. ./configure can't find the Tcl/Tk libraries (or finds the wrong version).
-
- If you build Tcl/Tk Tk with --enable-symbols versions, ./configure
- won't find the libraries (it's looking for libtcl8.4.a and your
- library is named libtcl8.4g.a) You need to build Tcl/Tk again, this
- time with --disable-symbols.
-
-General Problems:
-
-1. I can't compile BLT.
-
- Send the output of both "./configure" and "make" to me at
-
- ghowlett at grandecom.net
- gah at silconmetrics.com
-
- This will make it easier to track down the exact problem. Make
- sure you put "BLT" in the subject line.
-
-2. I get a segfault when running BLT in my application.
-
- The best method is to send a Tcl script that I can run that
- demonstrates the problem. Make sure you include all the necessary
- pieces to make it run (e.g. data file). If it's needed, include
- directions how to make the problem occur (e.g. "double click on the
- left mouse button").
-
- The hard work you do pruning down the problem into a small script
- will greatly help solve it. Once I see the problem, I can usually
- fix it right away.
-
-
-3. The manual page lies.
-
- I appreciate any help in pointing out errors, omissions, or lies
- in the manuals. If you have ideas how they might be improved,
- I'd love to hear them.
-
diff --git a/blt3.0.1/README b/blt3.0.1/README
deleted file mode 100644
index 24d4840..0000000
--- a/blt3.0.1/README
+++ /dev/null
@@ -1,179 +0,0 @@
-
-This is version 3.0 of the BLT library. It's an extension to the
-Tcl/Tk toolkit. You simply compile and link with the Tcl/Tk
-libraries. It does not require the Tcl or Tk source files.
-
-BLT is available from
-
- www.sourceforge.net/projects/blt/files
-
-This release has been built and tested with the following Tcl/Tk
-versions:
-
- Tcl/Tk 8.0
- Tcl/Tk 8.1
- Tcl/Tk 8.2
- Tcl/Tk 8.3
- Tcl/Tk 8.4 thru 8.4.0
-
-Tcl 7.6/Tk 4.2 isn't supported any more. If you need Tcl 7.x, use the
-2.4z release.
-
-Avoid alpha and beta versions of Tcl/Tk. They probably won't work.
-
-What is BLT?
-
- BLT is an extension to Tcl/Tk. It adds plotting widgets (X-Y graph,
- barchart, stripchart), a powerful geometry manager, a new canvas
- item, and several new commands to Tk.
-
- Plotting widgets:
-
- graph, barchart, stripchart
- BLT has X-Y graph, barchart, and stripchart widgets that are
- both easy to use and customize. All the widgets work with
- BLT vector data objects, which makes it easy to manage data.
-
- Tree viewer
-
- treeview Displays a general ordered tree which may be built
- on-the-fly or all at once.
-
- tree Tree data object.
-
- Tab set:
-
- tabset Can be used either as a tab notebook or simple tabset.
- Multi-tiered and/or scrolled tabsets are available.
- Notebook pages can be torn-off into separate windows and
- later put back.
-
- Geometry Manager:
-
- table A table-based geometry manager. Lets you specify widget
- layouts by row and column positions in the table. Unlike the
- packer or grid, you can finely control and constrain window
- sizes.
-
- Vector Data Object:
-
- vector Lets you manage a vector of floating point values in a
- high-level fashion. Vectors inter-operate seamlessly with
- the plotting widgets. The graphs will automatically redraw
- themselves when the vector data changes. Vector's components
- can be managed through a Tcl array variable, a Tcl command,
- or the using its own C API.
-
- Background Program Execution:
-
- bgexec Like Tcl's "exec ... &", but collects the output, error, and
- status of the detached UNIX subprocesses. Sets a Tcl variable
- upon completion.
-
- Busy Command:
-
- busy For preventing user-interactions when the application is
- busy. Manages an invisible "busy" window which prevents
- further user interactions (keyboard, mouse, button, etc.).
- Also you can provide a busy cursor that temporarily
- overrides those of the Tk widgets.
-
- New Canvas Item:
-
- eps An new item is added to the Tk canvas for handling
- encapsulated PostScript. It lets you embed an EPS file into
- the canvas displaying either an EPS preview image found in
- the file, or a Tk image that you provide. When you print
- the canvas the EPS item will automatically include the EPS
- file, translating and scaling the PostScript. For example,
- you could use "eps" items to tile several PostScript pages
- into single page.
-
- The "eps" item can also be used as a replacement for "image"
- canvas items. Unlike "image" canvas items, the image of an
- eps item can be printed and scaled arbitrarily.
-
- Drag & Drop Facility:
-
- drag&drop Adds drag-n-drop capabilities to Tk. It uses "send"-style
- communication between drag-drop sources and targets. The
- result is a much more powerful drag-and-drop mechanism than
- is available with OpenLook or Motif.
-
- Bitmap Command:
-
- bitmap Lets you read and write bitmaps from Tcl. You can define
- bitmaps from ordinary text strings. Bitmaps can also be
- scaled and rotated. For example, you can create a button
- with rotated text by defining a bitmap from a text string
- and rotating it. You can then use the bitmap in the button
- widget.
-
- Miscellaneous Commands:
-
- winop Basic window operations. You can raise, lower, map, or,
- unmap windows. Other operations let you move the pointer
- or take photo image snapshots of Tk widgets.
-
- bltdebug Lets you trace the execution of Tcl commands and procedures.
- Prints out each Tcl command before it's executed.
-
- watch Lets you specify Tcl procedures to be run before and/or
- after every Tcl command. May be used for logging, tracing,
- profiling, or debugging or Tcl code.
-
- spline Computes a spline fitting a set of data points (x and y
- vectors) and produces a vector of the interpolated images
- (y-coordinates) at a given set of x-coordinates.
-
- htext A simple hypertext widget. Allows text and Tk widgets to
- be combined in a scroll-able text window. Any Tk widget
- can be embedded and used to form hyper-links. Other
- options allow for selections and text searches.
-
-
-How to compile and test BLT?
-
- See the file "INSTALL" for instructions.
-
-
-Does BLT work under Windows?
-
- Yes. Windows 95/98/ME/NT/2000/XP. I've compiled it with both
- MS VC++ 5.0/6.0p4 and EGCS 1.1.1. Self-installing pre-compiled versions
- are available.
-
-What are the differences between the Windows and Unix releases?
-
- All commands work: graphs, bgexec, busy, drag&drop etc. except
- the "container", and "cutbuffer" widgets.
-
- The "drag&drop" command still needs to use "send" to transfer
- information between Tk applications. You can use
-
- ./demos/scripts/send.tcl
-
- to imitate "send" using DDE. Just source the script and execute
-
- SendInit
- SendVerify
-
- to set up the new send command.
-
-When will...?
-
- In general, I can't answer the "When will" questions, mostly out of
- embarrassment. My estimates of when new features and releases will
- occur usually turn out to be way way off.
-
-What does BLT stand for?
-
- Whatever you want it to.
-
-Where to send bugs reports, suggestions, etc. ?
-
- ghowlett at grandecom.net
-
- Make sure you include BLT and the version number in the subject line.
-
---gah
diff --git a/blt3.0.1/aclocal.m4 b/blt3.0.1/aclocal.m4
deleted file mode 100644
index eee9b2e..0000000
--- a/blt3.0.1/aclocal.m4
+++ /dev/null
@@ -1,110 +0,0 @@
-dnl BLT_RUN_WITH_OUTPUT(VARIABLE, PROGRAM,)
-AC_DEFUN(BLT_RUN_WITH_OUTPUT,
-[AC_REQUIRE([AC_PROG_CC])dnl
-if test "$cross_compiling" = yes; then
- ifelse([$3], ,
- [errprint(__file__:__line__: warning: [AC_TRY_RUN_WITH_OUTPUT] called without default to
- allow cross compiling
-)dnl
- AC_MSG_ERROR(can not run test program while cross compiling)],
- [$3])
-else
-cat > conftest.$ac_ext <<EOF
-[#]line __oline__ "configure"
-[#include "confdefs.h"
-#ifdef __cplusplus
-extern "C" void exit(int);
-#endif
-]dnl
-[$2]
-EOF
-eval $ac_link
-if test -s conftest && (./conftest > ./conftest.stdout; exit) 2>/dev/null; then
- $1=`cat ./conftest.stdout`
-else
- $1=""
-fi
-fi
-rm -fr conftest*])
-
-dnl BLT_GET_SYMBOL(VARIABLE, SYMBOL, FILE)
-AC_DEFUN(BLT_GET_SYMBOL,
-[AC_REQUIRE([AC_PROG_AWK])dnl
-cat > conftest.awk <<EOF
-[/^# *define *]$2[[ \t]]/ { print [\$][3] }
-EOF
-$1=`${AWK} -f conftest.awk "$3"`
-rm -rf conftest*])
-
-dnl BLT_CHECK_LIBRARY(NAME, SPEC, SYMBOL, WITH, EXTRALIBS)
-AC_DEFUN(BLT_CHECK_LIBRARY,
-[
- if test "$4" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "$4" = "yes" ; then
- lib_spec="-l$2"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- AC_CHECK_LIB([$2], [$3], [found="yes"],[found="no"])
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -l$2 $5"
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- AC_CHECK_LIB([$2], [$3], [found="yes"],[found="no"])
- if test "${found}" = "yes" ; then
- $1_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in $4 $4/lib ; do
- lib_spec="-L${dir} -l$2 $5"
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- AC_CHECK_LIB([$2], [$3],[found="yes"],[found="no"])
- if test "${found}" = "yes" ; then
- $1_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
- AC_DEFINE([HAVE_LIB$1], 1,
- [Define to 1 if you have the `$1' library (-l$2).])
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- $1_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-])
-
-
-dnl BLT_CHECK_HEADER(NAME, SPEC, WITH, DEF)
-AC_DEFUN(BLT_CHECK_HEADER,
-[
- if test "$3" != "no" ; then
- new_CPPFLAGS=""
- if test "$3" != "yes" ; then
- for dir in $3 $3/include ; do
- if test -r "${dir}/$2" ; then
- new_CPPFLAGS="-I${dir}"
- $1_INC_DIR="$dir"
- break
- fi
- done
- else
- for dir in $prefix $prefix/include ; do
- if test -r "${dir}/$2" ; then
- new_CPPFLAGS="-I${dir}"
- $1_INC_DIR="$dir"
- break
- fi
- done
- fi
- save_CPPFLAGS=${CPPFLAGS}
- CPPFLAGS="$4 ${new_CPPFLAGS}"
- AC_CHECK_HEADERS($2, [$1_INC_SPEC="${new_CPPFLAGS}"], [$1_INC_SPEC=""])
- CPPFLAGS=${save_CPPFLAGS}
- fi
-])
diff --git a/blt3.0.1/blt.mak b/blt3.0.1/blt.mak
deleted file mode 100644
index a208592..0000000
--- a/blt3.0.1/blt.mak
+++ /dev/null
@@ -1,34 +0,0 @@
-# ------------------------------------------------------------------------
-# Makefile for demonstation shell of BLT library
-# ------------------------------------------------------------------------
-
-!INCLUDE ./win/makedefs
-
-# ------------------------------------------------------------------------
-# Source and target installation directories
-# ------------------------------------------------------------------------
-
-srcdir = .
-
-# ------------------------------------------------------------------------
-# Don't edit anything beyond this point
-# ------------------------------------------------------------------------
-
-all:
- cd $(MAKEDIR)\src
- $(MAKE) -f blt.mak all
- cd $(MAKEDIR)
-
-install: install-all
-
-install-all:
- wish$(v2)d.exe win/install.tcl $(v1) $(srcdir)
-
-clean:
- cd $(MAKEDIR)\src
- $(MAKE) -f blt.mak clean
- cd $(MAKEDIR)
- $(RM) *.bak *\~ "#"* *pure* .pure*
-
-distclean: clean
-
diff --git a/blt3.0.1/cf/config.guess b/blt3.0.1/cf/config.guess
deleted file mode 100755
index c7607c7..0000000
--- a/blt3.0.1/cf/config.guess
+++ /dev/null
@@ -1,1526 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
-
-timestamp='2008-04-14'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner <per at bothner.com>.
-# Please send patches to <config-patches at gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches at gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi at noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[456])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- *:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- *:Interix*:[3456]*)
- case ${UNAME_MACHINE} in
- x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- EM64T | authenticamd)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
- esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- arm*:Linux:*:*)
- eval $set_cc_for_build
- if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_EABI__
- then
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
- fi
- exit ;;
- avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- cris:Linux:*:*)
- echo cris-axis-linux-gnu
- exit ;;
- crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
- exit ;;
- frv:Linux:*:*)
- echo frv-unknown-linux-gnu
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- or32:Linux:*:*)
- echo or32-unknown-linux-gnu
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
- exit ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit ;;
- xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel at ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes at openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf at swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green at stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green at stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches at gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-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`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/blt3.0.1/cf/config.sub b/blt3.0.1/cf/config.sub
deleted file mode 100755
index 63bfff0..0000000
--- a/blt3.0.1/cf/config.sub
+++ /dev/null
@@ -1,1669 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
-
-timestamp='2008-04-14'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Please send patches to <config-patches at gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches at gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | bfin \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | mt \
- | msp430 \
- | nios | nios2 \
- | ns16k | ns32k \
- | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | score \
- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nios-* | nios2-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tile*)
- basic_machine=tile-unknown
- os=-linux-gnu
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -dicos*)
- os=-dicos
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mep-*)
- os=-elf
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/blt3.0.1/cf/install-sh b/blt3.0.1/cf/install-sh
deleted file mode 100755
index 36f96f3..0000000
--- a/blt3.0.1/cf/install-sh
+++ /dev/null
@@ -1,276 +0,0 @@
-#!/bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
-#
-# Copyright 1991 by the Massachusetts Institute of Technology
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission. M.I.T. makes no representations about the
-# suitability of this software for any purpose. It is provided "as is"
-# without express or implied warranty.
-#
-# 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. It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd=$cpprog
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd=$stripprog
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "$0: no input file specified" >&2
- exit 1
-else
- :
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d "$dst" ]; then
- instcmd=:
- chmodcmd=""
- else
- instcmd=$mkdirprog
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f "$src" ] || [ -d "$src" ]
- then
- :
- else
- echo "$0: $src does not exist" >&2
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "$0: no destination specified" >&2
- exit 1
- else
- :
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d "$dst" ]
- then
- dst=$dst/`basename "$src"`
- else
- :
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
- '
-IFS="${IFS-$defaultIFS}"
-
-oIFS=$IFS
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS=$oIFS
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp=$pathcomp$1
- shift
-
- if [ ! -d "$pathcomp" ] ;
- then
- $mkdirprog "$pathcomp"
- else
- :
- fi
-
- pathcomp=$pathcomp/
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd "$dst" &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename "$dst"`
- else
- dstfile=`basename "$dst" $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename "$dst"`
- else
- :
- fi
-
-# Make a couple of temp file names in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
- rmtmp=$dstdir/#rm.$$#
-
-# Trap to clean up temp files at exit.
-
- trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
- trap '(exit $?); exit' 1 2 13 15
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd "$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 $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
-
-# 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.
-
-{
- if [ -f "$dstdir/$dstfile" ]
- then
- $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
- $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
- {
- echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
- (exit 1); exit
- }
- else
- :
- fi
-} &&
-
-# Now rename the file to the real destination.
-
- $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-
-fi &&
-
-# The final little trick to "correctly" pass the exit status to the exit trap.
-
-{
- (exit 0); exit
-}
diff --git a/blt3.0.1/cf/install.sh b/blt3.0.1/cf/install.sh
deleted file mode 100644
index ed46b48..0000000
--- a/blt3.0.1/cf/install.sh
+++ /dev/null
@@ -1,238 +0,0 @@
-
-#
-# install - install a program, script, or datafile
-# This comes from X11R5.
-#
-# 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.
-#
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- true
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- else
- instcmd=mkdir
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f $src -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- true
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
- shift
-
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- true
- fi
-
- pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
- else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
- else
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# 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 $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
-fi &&
-
-
-exit 0
diff --git a/blt3.0.1/cf/ldAix b/blt3.0.1/cf/ldAix
deleted file mode 100644
index 199c125..0000000
--- a/blt3.0.1/cf/ldAix
+++ /dev/null
@@ -1,72 +0,0 @@
-
-#
-# ldAix ldCmd ldArg ldArg ...
-#
-# This shell script provides a wrapper for ld under AIX in order to
-# create the .exp file required for linking. Its arguments consist
-# of the name and arguments that would normally be provided to the
-# ld command. This script extracts the names of the object files
-# from the argument list, creates a .exp file describing all of the
-# symbols exported by those files, and then invokes "ldCmd" to
-# perform the real link.
-#
-# SCCS: @(#) ldAix 1.8 97/02/21 14:50:27
-
-# Extract from the arguments the names of all of the object files.
-
-args=$*
-ofiles=""
-for i do
- x=`echo $i | grep '[^.].o$'`
- if test "$x" != ""; then
- ofiles="$ofiles $i"
- fi
-done
-
-# Create the export file from all of the object files, using nm followed
-# by sed editing. Here are some tricky aspects of this:
-#
-# 1. Nm produces different output under AIX 4.1 than under AIX 3.2.5;
-# the following statements handle both versions.
-# 2. Use the -g switch to nm instead of -e under 4.1 (this shows just
-# externals, not statics; -g isn't available under 3.2.5, though).
-# 3. Eliminate lines that end in ":": these are the names of object
-# files (relevant in 4.1 only).
-# 4. Eliminate entries with the "U" key letter; these are undefined
-# symbols (relevant in 4.1 only).
-# 5. Eliminate lines that contain the string "0|extern" preceded by space;
-# in 3.2.5, these are undefined symbols (address 0).
-# 6. Eliminate lines containing the "unamex" symbol. In 3.2.5, these
-# are also undefined symbols.
-# 7. If a line starts with ".", delete the leading ".", since this will
-# just cause confusion later.
-# 8. Eliminate everything after the first field in a line, so that we're
-# left with just the symbol name.
-
-nmopts="-g -C"
-osver=`uname -v`
-if test $osver -eq 3; then
- nmopts="-e"
-fi
-rm -f lib.exp
-echo "#! " >lib.exp
-/usr/ccs/bin/nm $nmopts -h $ofiles | sed -e '/:$/d' -e '/ U /d' -e '/[ ]0|extern/d' -e '/unamex/d' -e 's/^\.//' -e 's/[ |].*//' | sort | uniq >>lib.exp
-
-# Extract the name of the object file that we're linking. If it's a .a
-# file, then link all the objects together into a single file "shr.o"
-# and then put that into the archive. Otherwise link the object files
-# directly into the .a file.
-
-outputFile=`echo $args | sed -e 's/.*-o \([^ ]*\).*/\1/'`
-noDotA=`echo $outputFile | sed -e '/\.a$/d'`
-echo "noDotA=\"$noDotA\""
-if test "$noDotA" = "" ; then
- linkArgs=`echo $args | sed -e 's/-o .*\.a /-o shr.o /'`
- echo $linkArgs
- eval $linkArgs
- echo ar cr $outputFile shr.o
- ar cr $outputFile shr.o
- rm -f shr.o
-else
- eval $args
-fi
diff --git a/blt3.0.1/configure b/blt3.0.1/configure
deleted file mode 100755
index d807195..0000000
--- a/blt3.0.1/configure
+++ /dev/null
@@ -1,18104 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61.
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 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=:
- # Zsh 3.x and 4.x performs 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
-
-
-
-
-# PATH needs CR
-# 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
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-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.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-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
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-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
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-if test "x$CONFIG_SHELL" = x; then
- if (eval ":") 2>/dev/null; then
- as_have_required=yes
-else
- as_have_required=no
-fi
-
- if test $as_have_required = yes && (eval ":
-(as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=\$LINENO
- as_lineno_2=\$LINENO
- test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
- test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
- :
-else
- as_candidate_shells=
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- case $as_dir in
- /*)
- for as_base in sh bash ksh sh5; do
- as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
- done;;
- esac
-done
-IFS=$as_save_IFS
-
-
- for as_shell in $as_candidate_shells $SHELL; do
- # Try only shells that exist, to save several forks.
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs 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
-
-
-:
-_ASEOF
-}; then
- CONFIG_SHELL=$as_shell
- as_have_required=yes
- if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs 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_func_return () {
- (exit $1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
- break
-fi
-
-fi
-
- done
-
- if test "x$CONFIG_SHELL" != x; then
- for as_var in BASH_ENV ENV
- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- done
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
- if test $as_have_required = no; then
- echo This script requires a shell more modern than all the
- echo shells that I found on your system. Please install a
- echo modern shell, or manually run the script under such a
- echo shell if you do have one.
- { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
- echo No shell found that supports shell functions.
- echo Please tell autoconf at gnu.org about your system,
- echo including any error possibly output before this
- echo message
-}
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. 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" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # 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
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-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
-fi
-echo >conf$$.file
-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 -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-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=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# 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 7<&0 </dev/null 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, 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=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_unique_file="src/bltInit.c"
-# 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='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
-target
-target_cpu
-target_vendor
-target_os
-ac_prefix_program
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-CPP
-AWK
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-RANLIB
-LN_S
-GREP
-EGREP
-SIZEOF_INT
-SIZEOF_LONG
-SIZEOF_LONG_LONG
-SIZEOF_VOID_P
-SIZEOF_FLOAT
-XMKMF
-HAVE_INTTYPES_H
-BLT_SO_CFLAGS
-BLT_TARGET
-BLT_SO_LD
-BLT_SO_LDFLAGS
-BLT_SO_LIBS
-BLT_SO_EXT
-LD_RUN_PATH
-BLT_SO_PREFIX
-BLT_LIB_SUFFIX
-IMPLIB_PREFIX
-IMPLIB_EXT
-TCL_STUBS_SPEC
-TK_STUBS_SPEC
-WIN32
-AUX_LIBS
-BLT_MAJOR_VERSION
-BLT_MINOR_VERSION
-BLT_VERSION
-DEFINES
-DLL_PREFIX
-EXPAT_INC_SPEC
-EXPAT_LIB_SPEC
-EXTRA_LIBS
-FT2_INC_SPEC
-FT2_LIB_SPEC
-FTCFG_LIB_SPEC
-GCCFLAGS
-INCLUDES
-JPG_INC_SPEC
-JPG_LIB_SPEC
-LIB_PREFIX
-LIB_SUFFIX
-MYSQL_INC_SPEC
-MYSQL_LIB_SPEC
-PNG_INC_SPEC
-PNG_LIB_SPEC
-TCL_DBGX
-TCL_INC_SPEC
-TCL_LIB_DIR
-TCL_LIB_SPEC
-TCL_VERSION
-TIF_INC_SPEC
-TIF_LIB_SPEC
-TK_INC_SPEC
-TK_LIB_SPEC
-TK_XLIBSW
-X11_INC_SPEC
-X11_LIB_SPEC
-XAU_LIB_SPEC
-XDMCP_LIB_SPEC
-XFT_INC_SPEC
-XFT_LIB_SPEC
-XPM_INC_SPEC
-XPM_LIB_SPEC
-XRANDR_LIB_SPEC
-XRENDER_LIB_SPEC
-Z_LIB_SPEC
-BLT_LIBRARY
-LIBOBJS
-LTLIBOBJS'
-ac_subst_files=''
- 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
-# 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}'
-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=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- 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'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute directory names.
-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
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; }
-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
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- 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 .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
- { (exit 1); exit 1; }; }
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
- { (exit 1); exit 1; }; }
-
-
-# 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 -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
- 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 .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
- { (exit 1); exit 1; }; }
- 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 this package 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/PACKAGE]
- --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
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
- --target=TARGET configure for building compilers for TARGET [HOST]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-shared created shared libraries
- --enable-symbols compile with debugging symbols
- --enable-stubs compile with stubbed version of Tcl library
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-blt=DIR install BLT scripts in DIR
- --with-tcl=DIR find tclConfig.sh in DIR
- --with-tk=DIR find tkConfig.sh in DIR
- --with-tclincdir=DIR find Tcl includes in DIR
- --with-tkincdir=DIR find Tk includes in DIR
- --with-tcllibdir=DIR find Tcl libraries in DIR
- --with-tklibdir=DIR find Tk libraries in DIR
- --with-jpegincdir=DIR find JPEG headers in DIR
- --with-jpeglibdir=DIR find JPEG libraries in DIR
- --with-tiffincdir=DIR find TIFF headers in DIR
- --with-tifflibdir=DIR find TIFF libraries in DIR
- --with-pngincdir=DIR find PNG headers in DIR
- --with-pnglibdir=DIR find PNG libraries in DIR
- --with-zlibdir=DIR find zlib libraries in DIR
- --with-xpmincdir=DIR find XPM headers in DIR
- --with-xpmlibdir=DIR find XPM libraries in DIR
- --with-freetype2incdir=DIR
- find freetype2 headers in DIR
- --with-freetype2libdir=DIR
- find freetype2 libraries in DIR
- --with-xftincdir=DIR find Xft headers in DIR
- --with-xftlibdir=DIR find Xft libraries in DIR
- --with-xrandrincdir=DIR find Xrandr headers in DIR
- --with-xrandrlibdir=DIR find Xrandr libraries in DIR
- --with-expatincdir=DIR find expat headers in DIR
- --with-expatlibdir=DIR find expat libraries in DIR
- --with-mysqlincdir=DIR find mysql headers in DIR
- --with-mysqllibdir=DIR find mysql libraries in DIR
- --with-gnu-ld use GNU linker
- --with-x use the X Window System
-
-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 C/C++/Objective 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.
-
-_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" || continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`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
- 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
-configure
-generated by GNU Autoconf 2.61
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 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
-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 $as_me, which was
-generated by GNU Autoconf 2.61. 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=.
- 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$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
- ac_configure_args="$ac_configure_args '$ac_arg'"
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_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
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------------- ##
-## File substitutions. ##
-## ------------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- 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'; { (exit 1); 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
-
-# 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
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
-elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
-else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
-fi
-shift
-for ac_site_file
-do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-
-# 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,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-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
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`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.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-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_config_headers="$ac_config_headers src/config.h"
-
-ac_aux_dir=
-for ac_dir in cf "$srcdir"/cf; 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
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in cf \"$srcdir\"/cf" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in cf \"$srcdir\"/cf" >&2;}
- { (exit 1); exit 1; }; }
-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.
-
-
-
-
-# -----------------------------------------------------------------------
-#
-# Handle command line options
-#
-# --with-tcl=DIR
-# --with-tk=DIR
-# --with-cflags=flags This is probably for me only
-# --with-gnu-ld
-#
-# -----------------------------------------------------------------------
-
-INC_SPECS=""
-loader_run_path=""
-DEFINES=""
-
-
-blt_enable_symbols="no"
-blt_enable_shared="yes"
-blt_with_expat_include_dir="yes"
-blt_with_expat_lib_dir="yes"
-blt_with_ft2_include_dir="yes"
-blt_with_ft2_lib_dir="yes"
-blt_with_gnu_ld="no"
-blt_with_jpeg_include_dir="yes"
-blt_with_jpeg_lib_dir="yes"
-blt_with_mysql_include_dir="yes"
-blt_with_mysql_lib_dir="yes"
-blt_with_png_include_dir="yes"
-blt_with_png_lib_dir="yes"
-blt_with_z_lib_dir="yes"
-blt_with_scriptdir=""
-blt_with_tcl=""
-blt_with_tcl_include_dir="yes"
-blt_with_tcl_lib_dir="yes"
-blt_with_tiff_include_dir="yes"
-blt_with_tiff_lib_dir="yes"
-blt_with_tk=""
-blt_with_tk_include_dir="yes"
-blt_with_tk_lib_dir="yes"
-blt_with_xft_include_dir="yes"
-blt_with_xft_lib_dir="yes"
-blt_with_xpm_include_dir="yes"
-blt_with_xpm_lib_dir="yes"
-blt_with_xrandr_include_dir="yes"
-blt_with_xrandr_lib_dir="yes"
-
-
-# Check whether --with-blt was given.
-if test "${with_blt+set}" = set; then
- withval=$with_blt; blt_with_scriptdir=$withval
-fi
-
-
-# Check whether --with-tcl was given.
-if test "${with_tcl+set}" = set; then
- withval=$with_tcl; blt_with_tcl=$withval
-fi
-
-
-# Check whether --with-tk was given.
-if test "${with_tk+set}" = set; then
- withval=$with_tk; blt_with_tk=$withval
-fi
-
-
-# Check whether --with-tclincdir was given.
-if test "${with_tclincdir+set}" = set; then
- withval=$with_tclincdir; blt_with_tcl_include_dir=$withval
-fi
-
-
-# Check whether --with-tkincdir was given.
-if test "${with_tkincdir+set}" = set; then
- withval=$with_tkincdir; blt_with_tk_include_dir=$withval
-fi
-
-
-# Check whether --with-tcllibdir was given.
-if test "${with_tcllibdir+set}" = set; then
- withval=$with_tcllibdir; blt_with_tcl_lib_dir=$withval
-fi
-
-
-# Check whether --with-tklibdir was given.
-if test "${with_tklibdir+set}" = set; then
- withval=$with_tklibdir; blt_with_tk_lib_dir=$withval
-fi
-
-
-# Check whether --with-jpegincdir was given.
-if test "${with_jpegincdir+set}" = set; then
- withval=$with_jpegincdir; unset ac_cv_header_jpeglib_h; blt_with_jpeg_include_dir=$withval
-fi
-
-
-# Check whether --with-jpeglibdir was given.
-if test "${with_jpeglibdir+set}" = set; then
- withval=$with_jpeglibdir; unset ac_cv_lib_jpeg ac_cv_lib_jpeg_jpeg_read_header
- blt_with_jpeg_lib_dir=$withval
-fi
-
-
-# --with-tiffincdir
-
-# Check whether --with-tiffincdir was given.
-if test "${with_tiffincdir+set}" = set; then
- withval=$with_tiffincdir; blt_with_tiff_include_dir=$withval
-fi
-
-# --with-tifflibdir
-
-# Check whether --with-tifflibdir was given.
-if test "${with_tifflibdir+set}" = set; then
- withval=$with_tifflibdir; blt_with_tiff_lib_dir=$withval
-fi
-
-# --with-pngincdir
-
-# Check whether --with-pngincdir was given.
-if test "${with_pngincdir+set}" = set; then
- withval=$with_pngincdir; blt_with_png_include_dir=$withval
-fi
-
-# --with-pnglibdir
-
-# Check whether --with-pnglibdir was given.
-if test "${with_pnglibdir+set}" = set; then
- withval=$with_pnglibdir; blt_with_png_lib_dir=$withval
-fi
-
-# --with-zlibdir
-
-# Check whether --with-zlibdir was given.
-if test "${with_zlibdir+set}" = set; then
- withval=$with_zlibdir; blt_with_z_lib_dir=$withval
-fi
-
-# --with-xpmincdir
-
-# Check whether --with-xpmincdir was given.
-if test "${with_xpmincdir+set}" = set; then
- withval=$with_xpmincdir; blt_with_xpm_include_dir=$withval
-fi
-
-# --with-xpmlibdir
-
-# Check whether --with-xpmlibdir was given.
-if test "${with_xpmlibdir+set}" = set; then
- withval=$with_xpmlibdir; blt_with_xpm_lib_dir=$withval
-fi
-
-# --with-freetype2incdir
-
-# Check whether --with-freetype2incdir was given.
-if test "${with_freetype2incdir+set}" = set; then
- withval=$with_freetype2incdir; blt_with_ft2_include_dir=$withval
-fi
-
-# --with-freetype2libdir
-
-# Check whether --with-freetype2libdir was given.
-if test "${with_freetype2libdir+set}" = set; then
- withval=$with_freetype2libdir; blt_with_ft2_lib_dir=$withval
-fi
-
-# --with-xftincdir
-
-# Check whether --with-xftincdir was given.
-if test "${with_xftincdir+set}" = set; then
- withval=$with_xftincdir; blt_with_xft_include_dir=$withval
-fi
-
-# --with-xftlibdir
-
-# Check whether --with-xftlibdir was given.
-if test "${with_xftlibdir+set}" = set; then
- withval=$with_xftlibdir; blt_with_xft_lib_dir=$withval
-fi
-
-# --with-xrandrincdir
-
-# Check whether --with-xrandrincdir was given.
-if test "${with_xrandrincdir+set}" = set; then
- withval=$with_xrandrincdir; blt_with_xrandr_include_dir=$withval
-fi
-
-# --with-xrandrlibdir
-
-# Check whether --with-xrandrlibdir was given.
-if test "${with_xrandrlibdir+set}" = set; then
- withval=$with_xrandrlibdir; blt_with_xrandr_lib_dir=$withval
-fi
-
-# --with-expatincdir
-
-# Check whether --with-expatincdir was given.
-if test "${with_expatincdir+set}" = set; then
- withval=$with_expatincdir; blt_with_expat_include_dir=$withval
-fi
-
-# --with-expatlibdir
-
-# Check whether --with-expatlibdir was given.
-if test "${with_expatlibdir+set}" = set; then
- withval=$with_expatlibdir; blt_with_expat_lib_dir=$withval
-fi
-
-# --with-mysqlincdir
-
-# Check whether --with-mysqlincdir was given.
-if test "${with_mysqlincdir+set}" = set; then
- withval=$with_mysqlincdir; blt_with_mysql_include_dir=$withval
-fi
-
-# --with-mysqllibdir
-
-# Check whether --with-mysqllibdir was given.
-if test "${with_mysqllibdir+set}" = set; then
- withval=$with_mysqllibdir; blt_with_mysql_lib_dir=$withval
-fi
-
-
-
-# Check whether --with-gnu_ld was given.
-if test "${with_gnu_ld+set}" = set; then
- withval=$with_gnu_ld; blt_with_gnu_ld="yes"
-fi
-
-
-# Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval=$enable_shared; blt_enable_shared=$enableval
-fi
-
-
-# Check whether --enable-symbols was given.
-if test "${enable_symbols+set}" = set; then
- enableval=$enable_symbols; blt_enable_symbols=$enableval
-fi
-
-# Check whether --enable-stubs was given.
-if test "${enable_stubs+set}" = set; then
- enableval=$enable_stubs; blt_enable_stubs=$enableval
-fi
-
-
-EXPAT_INC_SPEC=""
-EXPAT_LIB_SPEC=""
-FTCFG_LIB_SPEC=""
-FT2_INC_SPEC=""
-FT2_LIB_SPEC=""
-XFT_INC_SPEC=""
-XFT_LIB_SPEC=""
-JPG_INC_SPEC=""
-JPG_LIB_SPEC=""
-MYSQL_INC_SPEC=""
-MYSQL_LIB_SPEC=""
-PNG_INC_SPEC=""
-PNG_LIB_SPEC=""
-TCL_INC_SPEC=""
-TCL_LIB_SPEC=""
-TIF_INC_SPEC=""
-TIF_LIB_SPEC=""
-TK_INC_SPEC=""
-TK_LIB_SPEC=""
-TK_XLIBSW=""
-XPM_INC_SPEC=""
-XPM_LIB_SPEC=""
-XRANDR_INC_SPEC=""
-XRANDR_LIB_SPEC=""
-XRENDER_LIB_SPEC=""
-XAU_LIB_SPEC=""
-XDMCP_LIB_SPEC=""
-Z_LIB_SPEC=""
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
- { (exit 1); exit 1; }; }
-
-{ echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-echo "$as_me: error: invalid value of canonical build" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-echo "$as_me: error: invalid value of canonical host" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-{ echo "$as_me:$LINENO: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
-if test "${ac_cv_target+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "x$target_alias" = x; then
- ac_cv_target=$ac_cv_host
-else
- ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
-echo "$as_me: error: invalid value of canonical target" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-target=$ac_cv_target
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_target
-shift
-target_cpu=$1
-target_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-target_os=$*
-IFS=$ac_save_IFS
-case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
-
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-if test "x$prefix" = xNONE; then
- echo $ECHO_N "checking for prefix by $ECHO_C" >&6
- # Extract the first word of "wish", so it can be a program name with args.
-set dummy wish; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_ac_prefix_program+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $ac_prefix_program in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_prefix_program="$ac_prefix_program" # Let the user override the test with a path.
- ;;
- *)
- 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_ac_prefix_program="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-ac_prefix_program=$ac_cv_path_ac_prefix_program
-if test -n "$ac_prefix_program"; then
- { echo "$as_me:$LINENO: result: $ac_prefix_program" >&5
-echo "${ECHO_T}$ac_prefix_program" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- if test -n "$ac_prefix_program"; then
- prefix=`$as_dirname -- "$ac_prefix_program" ||
-$as_expr X"$ac_prefix_program" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_prefix_program" : 'X\(//\)[^/]' \| \
- X"$ac_prefix_program" : 'X\(//\)$' \| \
- X"$ac_prefix_program" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_prefix_program" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- prefix=`$as_dirname -- "$prefix" ||
-$as_expr X"$prefix" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$prefix" : 'X\(//\)[^/]' \| \
- X"$prefix" : 'X\(//\)$' \| \
- X"$prefix" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$prefix" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- fi
-fi
-
-
-# -----------------------------------------------------------------------
-# Set a variable containing current working directory if /bin/sh
-# doesn't do it already.
-# -----------------------------------------------------------------------
-
-PWD=`pwd`
-
-# -----------------------------------------------------------------------
-# Programs: Check for existence of ranlib and install programs
-# -----------------------------------------------------------------------
-# -----------------------------------------------------------------------
-# C compiler and debugging flags
-# -----------------------------------------------------------------------
-
-if test "x${CC}" = "x" ; then
- CC=cc
-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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$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
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$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
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$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
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
- echo "$as_me:$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
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$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
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$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
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}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:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out 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.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; 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 | *.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
-
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-if test -z "$ac_file"; then
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; 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 | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; 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 ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- 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
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-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
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$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
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* 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"
- 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_c89=$ac_arg
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-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)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
- xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-
-
-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
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f 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
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-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 "x${GCC}" != "x" ; then
- blt_have_gcc="yes"
-fi
-
-case $host_os in
- *mingw*)
- blt_platform_win32="yes"
- { echo "$as_me:$LINENO: checking if using MinGW compiler" >&5
-echo $ECHO_N "checking if using MinGW compiler... $ECHO_C" >&6; }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
-#ifndef __MINGW32__
- _cc_is_not_mingw_
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- blt_have_mingw=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- blt_have_mingw=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { echo "$as_me:$LINENO: result: $blt_have_mingw" >&5
-echo "${ECHO_T}$blt_have_mingw" >&6; }
- ;;
- * )
- blt_platform_win32="no"
- ;;
-esac
-
-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
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f 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
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-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 "x${GCC}" != "x" ; then
- blt_have_gcc="yes"
-else
- { echo "$as_me:$LINENO: checking if C compiler is really gcc" >&5
-echo $ECHO_N "checking if C compiler is really gcc... $ECHO_C" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
-#ifndef __GNUC__
- _cc_is_not_gcc_
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- blt_have_gcc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- blt_have_gcc=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { echo "$as_me:$LINENO: result: $blt_have_gcc" >&5
-echo "${ECHO_T}$blt_have_gcc" >&6; }
-fi
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AWK="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-IFS=$as_save_IFS
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$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
- { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}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
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$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
- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
- { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6; }
-fi
-
-{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
-echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
-if test -z "$MKDIR_P"; then
- if test "${ac_cv_path_mkdir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
-done
-IFS=$as_save_IFS
-
-fi
-
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- test -d ./--version && rmdir ./--version
- MKDIR_P="$ac_install_sh -d"
- fi
-fi
-{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
-echo "${ECHO_T}$MKDIR_P" >&6; }
-
-
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- 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"
- { test -f "$ac_path_GREP" && $as_test_x "$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
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- 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
- ac_count=`expr $ac_count + 1`
- 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
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_GREP=$GREP
-fi
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- 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"
- { test -f "$ac_path_EGREP" && $as_test_x "$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
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- 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
- ac_count=`expr $ac_count + 1`
- 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
-
-
-fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
-
- fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-_ACEOF
-rm -f -r conftest*
-
-
-#
-# CFLAGS search order
-#
-# 1. command line (--with-cflags)
-# 2. cached variable ($blt_cv_prog_cflags)
-# 3. set to "-O3" if using gcc ($blt_have_gcc)
-# 4. otherwise, default to "-O"
-#
-
-# Setup default flags for the compiler.
-case $target:$blt_have_gcc:$blt_enable_symbols in
- *-solaris2*:no:yes)
-# CFLAGS="-g -xs -O"
- ;;
- *:yes:no)
-# CFLAGS="-O3"
- ;;
- *:yes:yes)
-# CFLAGS="-g -O3"
- ;;
- *:no:no)
-# CFLAGS="-O"
- ;;
- *)
-# CFLAGS="-g -O3"
- ;;
-esac
-CFLAGS="${CFLAGS}"
-
-GCCFLAGS=""
-if test "${blt_have_gcc}" = "yes" ; then
- GCCFLAGS="-Wall -Wpointer-arith -Wno-uninitialized -Wmissing-declarations -Wimplicit -Wwrite-strings -Wmissing-prototypes -Wundef"
-fi
-
-SO_PREFIX=""
-SO_EXT=""
-IMPLIB_SUFFIX=""
-IMPLIB_EXT=""
-
-case $target in
- *-*-mingw*)
- blt_platform="win"
- if test "${blt_have_mingw}" = "yes" ; then
- SO_PREFIX=""
- SO_EXT=".dll"
- IMPLIB_EXT=".lib"
- IMPLIB_PREFIX=""
- else
- SO_PREFIX="cyg"
- SO_EXT=".dll"
- IMPLIB_EXT=".dll.a"
- IMPLIB_PREFIX="lib"
- fi
- ;;
- *-*-cygwin*)
- blt_platform="unix"
- SO_PREFIX="cyg"
- SO_EXT=".dll"
- IMPLIB_EXT=""
- IMPLIB_PREFIX=""
- ;;
- *-hpux*)
- SO_EXT=".sl"
- blt_platform="unix"
- SO_PREFIX="lib"
- IMPLIB_SUFFIX=""
- IMPLIB_EXT=""
- ;;
- *-*-darwin*)
- blt_platform="unix"
- SO_EXT=".dylib"
- SO_PREFIX="lib"
- IMPLIB_SUFFIX=""
- IMPLIB_EXT=""
- ;;
- *)
- blt_platform="unix"
- SO_PREFIX="lib"
- SO_EXT=".so"
- IMPLIB_SUFFIX=""
- IMPLIB_EXT=""
- ;;
-esac
-
-build_shared="yes"
-if test $blt_enable_symbols = "yes" ; then
- LIB_SUFFIX=g
-fi
-
-# -----------------------------------------------------------------------
-# Hardware characteristics:
-# -----------------------------------------------------------------------
-
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_header_stdc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- 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 >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 -r conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 -r conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-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=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # See if sys/param.h defines the BYTE_ORDER macro.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- # It does; now see whether it defined to BIG_ENDIAN or not.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_c_bigendian=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_c_bigendian=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # It does not; compile a test program.
-if test "$cross_compiling" = yes; then
- # try to guess the endianness by grepping values into an object file
- ac_cv_c_bigendian=unknown
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 };
-void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
-int
-main ()
-{
- _ascii (); _ebcdic ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; 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
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_c_bigendian=no
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
-case $ac_cv_c_bigendian in
- yes)
-
-cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 1
-_ACEOF
- ;;
- no)
- ;;
- *)
- { { echo "$as_me:$LINENO: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-echo "$as_me: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
- { (exit 1); exit 1; }; } ;;
-esac
-
-{ echo "$as_me:$LINENO: checking for int" >&5
-echo $ECHO_N "checking for int... $ECHO_C" >&6; }
-if test "${ac_cv_type_int+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef int ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_int=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_int=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
-echo "${ECHO_T}$ac_cv_type_int" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of int" >&5
-echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_int+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_int=$ac_lo;;
-'') if test "$ac_cv_type_int" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_int=0
- fi ;;
-esac
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_int=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_int" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_int=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: checking for long" >&5
-echo $ECHO_N "checking for long... $ECHO_C" >&6; }
-if test "${ac_cv_type_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef long ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_long=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_long=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
-echo "${ECHO_T}$ac_cv_type_long" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of long" >&5
-echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long=$ac_lo;;
-'') if test "$ac_cv_type_long" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long=0
- fi ;;
-esac
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_long=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_long" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: checking for long long" >&5
-echo $ECHO_N "checking for long long... $ECHO_C" >&6; }
-if test "${ac_cv_type_long_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef long long ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_long_long=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_long_long=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_long_long" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of long long" >&5
-echo $ECHO_N "checking size of long long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_long_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long_long=$ac_lo;;
-'') if test "$ac_cv_type_long_long" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long_long=0
- fi ;;
-esac
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_long_long=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_long_long" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long_long=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: checking for void *" >&5
-echo $ECHO_N "checking for void *... $ECHO_C" >&6; }
-if test "${ac_cv_type_void_p+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef void * ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_void_p=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_void_p=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5
-echo "${ECHO_T}$ac_cv_type_void_p" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of void *" >&5
-echo $ECHO_N "checking size of void *... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_void_p+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef void * ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef void * ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef void * ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef void * ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef void * ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_void_p=$ac_lo;;
-'') if test "$ac_cv_type_void_p" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (void *)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_void_p=0
- fi ;;
-esac
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef void * ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_void_p=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_void_p" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (void *)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_void_p=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
-echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: checking for float" >&5
-echo $ECHO_N "checking for float... $ECHO_C" >&6; }
-if test "${ac_cv_type_float+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef float ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_float=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_float=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5
-echo "${ECHO_T}$ac_cv_type_float" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of float" >&5
-echo $ECHO_N "checking size of float... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_float+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef float ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef float ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef float ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef float ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef float ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_float=$ac_lo;;
-'') if test "$ac_cv_type_float" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (float)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (float)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_float=0
- fi ;;
-esac
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef float ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_float=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_float" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (float)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (float)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_float=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5
-echo "${ECHO_T}$ac_cv_sizeof_float" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_FLOAT $ac_cv_sizeof_float
-_ACEOF
-
-
-
-# Save the values as shell variables so that we can substitute them
-# into bltHash.h for situtations where there's no bltInt.h.
-
-SIZEOF_INT=${ac_cv_sizeof_int}
-
-SIZEOF_LONG=${ac_cv_sizeof_long}
-
-SIZEOF_LONG_LONG=${ac_cv_sizeof_long_long}
-
-SIZEOF_VOID_P=${ac_cv_sizeof_void_p}
-
-SIZEOF_FLOAT=${ac_cv_sizeof_float}
-
-
-
-# -----------------------------------------------------------------------
-# Libraries:
-# -----------------------------------------------------------------------
-
-{ echo "$as_me:$LINENO: checking for main in -lm" >&5
-echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6; }
-if test "${ac_cv_lib_m_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-return main ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_m_main=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_m_main=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
-echo "${ECHO_T}$ac_cv_lib_m_main" >&6; }
-if test $ac_cv_lib_m_main = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
-_ACEOF
-
- LIBS="-lm $LIBS"
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for main in -lnsl" >&5
-echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_nsl_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-return main ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_nsl_main=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_nsl_main=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6; }
-if test $ac_cv_lib_nsl_main = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNSL 1
-_ACEOF
-
- LIBS="-lnsl $LIBS"
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for main in -lsocket" >&5
-echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; }
-if test "${ac_cv_lib_socket_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-return main ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_socket_main=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_socket_main=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; }
-if test $ac_cv_lib_socket_main = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSOCKET 1
-_ACEOF
-
- LIBS="-lsocket $LIBS"
-
-fi
-
-{ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_dld_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dld_shl_load=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
-if test $ac_cv_lib_dld_shl_load = yes; then
- blt_have_dld=yes
-else
- blt_have_dld=no
-fi
-
-
-{ echo "$as_me:$LINENO: checking for X" >&5
-echo $ECHO_N "checking for X... $ECHO_C" >&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 #(
- *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
-echo "$as_me: error: Cannot use X directory names containing '" >&2;}
- { (exit 1); exit 1; }; };; #(
- *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&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 | /lib) ;;
- *) 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/X11R6/include
-/usr/X11R5/include
-/usr/X11R4/include
-
-/usr/include/X11
-/usr/include/X11R6
-/usr/include/X11R5
-/usr/include/X11R4
-
-/usr/local/X11/include
-/usr/local/X11R6/include
-/usr/local/X11R5/include
-/usr/local/X11R4/include
-
-/usr/local/include/X11
-/usr/local/include/X11R6
-/usr/local/include/X11R5
-/usr/local/include/X11R4
-
-/usr/X386/include
-/usr/x386/include
-/usr/XFree86/include/X11
-
-/usr/include
-/usr/local/include
-/usr/unsupported/include
-/usr/athena/include
-/usr/local/x11r5/include
-/usr/lpp/Xamples/include
-
-/usr/openwin/include
-/usr/openwin/share/include'
-
-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 >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <X11/Xlib.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # We can compile using X headers with no special include directory.
-ac_x_includes=
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- 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.$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 >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <X11/Xlib.h>
-int
-main ()
-{
-XrmInitialize ()
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- LIBS=$ac_save_LIBS
-# We can link X programs with no special library path.
-ac_x_libraries=
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- LIBS=$ac_save_LIBS
-for ac_dir in `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_ipa8_conftest.oo \
- 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
- { echo "$as_me:$LINENO: result: $have_x" >&5
-echo "${ECHO_T}$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'"
- { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
-echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; }
-fi
-
-
-if test "x${x_libraries}" != "x" ; then
- xtop=`dirname ${x_libraries}`
- PATH=$xtop/bin:$PATH
-fi
-
-# -----------------------------------------------------------------------
-# Headers:
-# -----------------------------------------------------------------------
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_header_stdc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- 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 >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 -r conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 -r conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
-echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; }
-if test "${ac_cv_header_sys_wait_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/wait.h>
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
-
-int
-main ()
-{
- int s;
- wait (&s);
- s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_header_sys_wait_h=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_sys_wait_h=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
-if test $ac_cv_header_sys_wait_h = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_WAIT_H 1
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
-if test "${ac_cv_header_time+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
-int
-main ()
-{
-if ((struct tm *) 0)
-return 0;
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_header_time=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_time=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6; }
-if test $ac_cv_header_time = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define TIME_WITH_SYS_TIME 1
-_ACEOF
-
-fi
-
-
-
-for ac_header in inttypes.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-if test "${ac_cv_header_inttypes_h}" = "yes" ; then
- HAVE_INTTYPES_H="#define HAVE_INTTYPES_H 1"
-
-else
- HAVE_INTTYPES_H="/* can't find inttypes.h */"
-
-fi
-
-
-for ac_header in limits.h sys/param.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_header in string.h ctype.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-for ac_header in errno.h float.h math.h ieeefp.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-for ac_header in sys/time.h waitflags.h sys/wait.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_header in malloc.h memory.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in setjmp.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-for ac_header in stdlib.h stddef.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_header in stropts.h termios.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-
-
-
-
-for ac_func in posix_openpt ptsname getpt grantpt unlockpt isastream setsid
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); 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 $ac_func
-
-/* 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 $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-for ac_func in tcflush openpty
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); 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 $ac_func
-
-/* 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 $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-for ac_func in open_controlling_pty
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); 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 $ac_func
-
-/* 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 $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-# FREETYPE2 header
-if test "${blt_with_ft2_include_dir}" != "no" ; then
- ft2_inc_spec=`freetype-config --cflags`
-echo ft2_inc_spec=$ft2_inc_spec
- save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="${ft2_inc_spec}"
-
-for ac_header in ft2build.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- FT2_INC_SPEC=${ft2_inc_spec}
-else
- FT2_INC_SPEC=""
-fi
-
-done
-
- CPPFLAGS=${save_CPPFLAGS}
-
- # Xft header
- if test "${blt_with_xft_include_dir}" != "no" ; then
-
- if test "$blt_with_xft_include_dir" != "no" ; then
- new_CPPFLAGS=""
- if test "$blt_with_xft_include_dir" != "yes" ; then
- for dir in $blt_with_xft_include_dir $blt_with_xft_include_dir/include ; do
- if test -r "${dir}/X11/Xft/Xft.h" ; then
- new_CPPFLAGS="-I${dir}"
- XFT_INC_DIR="$dir"
- break
- fi
- done
- else
- for dir in $prefix $prefix/include ; do
- if test -r "${dir}/X11/Xft/Xft.h" ; then
- new_CPPFLAGS="-I${dir}"
- XFT_INC_DIR="$dir"
- break
- fi
- done
- fi
- save_CPPFLAGS=${CPPFLAGS}
- CPPFLAGS="${ft2_inc_spec} ${new_CPPFLAGS}"
-
-for ac_header in X11/Xft/Xft.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- XFT_INC_SPEC="${new_CPPFLAGS}"
-else
- XFT_INC_SPEC=""
-fi
-
-done
-
- CPPFLAGS=${save_CPPFLAGS}
- fi
-
- fi
-fi
-
-# EXPAT header
-if test "${blt_with_expat_include_dir}" != "no" ; then
-
- if test "$blt_with_expat_include_dir" != "no" ; then
- new_CPPFLAGS=""
- if test "$blt_with_expat_include_dir" != "yes" ; then
- for dir in $blt_with_expat_include_dir $blt_with_expat_include_dir/include ; do
- if test -r "${dir}/expat.h" ; then
- new_CPPFLAGS="-I${dir}"
- EXPAT_INC_DIR="$dir"
- break
- fi
- done
- else
- for dir in $prefix $prefix/include ; do
- if test -r "${dir}/expat.h" ; then
- new_CPPFLAGS="-I${dir}"
- EXPAT_INC_DIR="$dir"
- break
- fi
- done
- fi
- save_CPPFLAGS=${CPPFLAGS}
- CPPFLAGS=" ${new_CPPFLAGS}"
-
-for ac_header in expat.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- EXPAT_INC_SPEC="${new_CPPFLAGS}"
-else
- EXPAT_INC_SPEC=""
-fi
-
-done
-
- CPPFLAGS=${save_CPPFLAGS}
- fi
-
-fi
-
-# MYSQL header
-if test "${blt_with_mysql_include_dir}" != "no" ; then
-
- if test "$blt_with_mysql_include_dir" != "no" ; then
- new_CPPFLAGS=""
- if test "$blt_with_mysql_include_dir" != "yes" ; then
- for dir in $blt_with_mysql_include_dir $blt_with_mysql_include_dir/include ; do
- if test -r "${dir}/mysql/mysql.h" ; then
- new_CPPFLAGS="-I${dir}"
- MYSQL_INC_DIR="$dir"
- break
- fi
- done
- else
- for dir in $prefix $prefix/include ; do
- if test -r "${dir}/mysql/mysql.h" ; then
- new_CPPFLAGS="-I${dir}"
- MYSQL_INC_DIR="$dir"
- break
- fi
- done
- fi
- save_CPPFLAGS=${CPPFLAGS}
- CPPFLAGS=" ${new_CPPFLAGS}"
-
-for ac_header in mysql/mysql.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- MYSQL_INC_SPEC="${new_CPPFLAGS}"
-else
- MYSQL_INC_SPEC=""
-fi
-
-done
-
- CPPFLAGS=${save_CPPFLAGS}
- fi
-
-fi
-
-# XPM header
-if test "${blt_with_xpm_include_dir}" != "no" ; then
-
- if test "$blt_with_xpm_include_dir" != "no" ; then
- new_CPPFLAGS=""
- if test "$blt_with_xpm_include_dir" != "yes" ; then
- for dir in $blt_with_xpm_include_dir $blt_with_xpm_include_dir/include ; do
- if test -r "${dir}/X11/xpm.h" ; then
- new_CPPFLAGS="-I${dir}"
- XPM_INC_DIR="$dir"
- break
- fi
- done
- else
- for dir in $prefix $prefix/include ; do
- if test -r "${dir}/X11/xpm.h" ; then
- new_CPPFLAGS="-I${dir}"
- XPM_INC_DIR="$dir"
- break
- fi
- done
- fi
- save_CPPFLAGS=${CPPFLAGS}
- CPPFLAGS=" ${new_CPPFLAGS}"
-
-for ac_header in X11/xpm.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- XPM_INC_SPEC="${new_CPPFLAGS}"
-else
- XPM_INC_SPEC=""
-fi
-
-done
-
- CPPFLAGS=${save_CPPFLAGS}
- fi
-
-fi
-
-# JPEG header
-if test "${blt_with_jpeg_include_dir}" != "no" ; then
-
- if test "$blt_with_jpeg_include_dir" != "no" ; then
- new_CPPFLAGS=""
- if test "$blt_with_jpeg_include_dir" != "yes" ; then
- for dir in $blt_with_jpeg_include_dir $blt_with_jpeg_include_dir/include ; do
- if test -r "${dir}/jpeglib.h" ; then
- new_CPPFLAGS="-I${dir}"
- JPG_INC_DIR="$dir"
- break
- fi
- done
- else
- for dir in $prefix $prefix/include ; do
- if test -r "${dir}/jpeglib.h" ; then
- new_CPPFLAGS="-I${dir}"
- JPG_INC_DIR="$dir"
- break
- fi
- done
- fi
- save_CPPFLAGS=${CPPFLAGS}
- CPPFLAGS=" ${new_CPPFLAGS}"
-
-for ac_header in jpeglib.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- JPG_INC_SPEC="${new_CPPFLAGS}"
-else
- JPG_INC_SPEC=""
-fi
-
-done
-
- CPPFLAGS=${save_CPPFLAGS}
- fi
-
-fi
-
-# TIFF header
-if test "${blt_with_tiff_include_dir}" != "no" ; then
-
- if test "$blt_with_tiff_include_dir" != "no" ; then
- new_CPPFLAGS=""
- if test "$blt_with_tiff_include_dir" != "yes" ; then
- for dir in $blt_with_tiff_include_dir $blt_with_tiff_include_dir/include ; do
- if test -r "${dir}/tiff.h" ; then
- new_CPPFLAGS="-I${dir}"
- TIF_INC_DIR="$dir"
- break
- fi
- done
- else
- for dir in $prefix $prefix/include ; do
- if test -r "${dir}/tiff.h" ; then
- new_CPPFLAGS="-I${dir}"
- TIF_INC_DIR="$dir"
- break
- fi
- done
- fi
- save_CPPFLAGS=${CPPFLAGS}
- CPPFLAGS=" ${new_CPPFLAGS}"
-
-for ac_header in tiff.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- TIF_INC_SPEC="${new_CPPFLAGS}"
-else
- TIF_INC_SPEC=""
-fi
-
-done
-
- CPPFLAGS=${save_CPPFLAGS}
- fi
-
-fi
-
-# PNG header
-if test "${blt_with_png_include_dir}" != "no" ; then
-
- if test "$blt_with_png_include_dir" != "no" ; then
- new_CPPFLAGS=""
- if test "$blt_with_png_include_dir" != "yes" ; then
- for dir in $blt_with_png_include_dir $blt_with_png_include_dir/include ; do
- if test -r "${dir}/png.h" ; then
- new_CPPFLAGS="-I${dir}"
- PNG_INC_DIR="$dir"
- break
- fi
- done
- else
- for dir in $prefix $prefix/include ; do
- if test -r "${dir}/png.h" ; then
- new_CPPFLAGS="-I${dir}"
- PNG_INC_DIR="$dir"
- break
- fi
- done
- fi
- save_CPPFLAGS=${CPPFLAGS}
- CPPFLAGS=" ${new_CPPFLAGS}"
-
-for ac_header in png.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- PNG_INC_SPEC="${new_CPPFLAGS}"
-else
- PNG_INC_SPEC=""
-fi
-
-done
-
- CPPFLAGS=${save_CPPFLAGS}
- fi
-
-fi
-
-# XRANDR header
-if test "${blt_with_xrandr_include_dir}" != "no" ; then
-
- if test "$blt_with_xrandr_include_dir" != "no" ; then
- new_CPPFLAGS=""
- if test "$blt_with_xrandr_include_dir" != "yes" ; then
- for dir in $blt_with_xrandr_include_dir $blt_with_xrandr_include_dir/include ; do
- if test -r "${dir}/X11/extensions/randr.h" ; then
- new_CPPFLAGS="-I${dir}"
- XRANDR_INC_DIR="$dir"
- break
- fi
- done
- else
- for dir in $prefix $prefix/include ; do
- if test -r "${dir}/X11/extensions/randr.h" ; then
- new_CPPFLAGS="-I${dir}"
- XRANDR_INC_DIR="$dir"
- break
- fi
- done
- fi
- save_CPPFLAGS=${CPPFLAGS}
- CPPFLAGS=" ${new_CPPFLAGS}"
-
-for ac_header in X11/extensions/randr.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- XRANDR_INC_SPEC="${new_CPPFLAGS}"
-else
- XRANDR_INC_SPEC=""
-fi
-
-done
-
- CPPFLAGS=${save_CPPFLAGS}
- fi
-
-fi
-
-# -----------------------------------------------------------------------
-# Types:
-# -----------------------------------------------------------------------
-{ echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_size_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef size_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_size_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_size_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
-if test $ac_cv_type_size_t = yes; then
- :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_pid_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef pid_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_pid_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_pid_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-echo "${ECHO_T}$ac_cv_type_pid_t" >&6; }
-if test $ac_cv_type_pid_t = yes; then
- :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define pid_t int
-_ACEOF
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether union wait is defined correctly" >&5
-echo $ECHO_N "checking whether union wait is defined correctly... $ECHO_C" >&6; }
-if test "${blt_cv_struct_wait_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/wait.h>
-int
-main ()
-{
-
- /*
- * Check whether <sys/wait.h> defines the type "union wait"
- * correctly. It's needed because of weirdness in HP-UX where
- * "union wait" is defined in both the BSD and SYS-V environments.
- * Checking the usability of WIFEXITED seems to do the trick.
- */
- union wait x;
- WIFEXITED(x); /* Generates compiler error if WIFEXITED
- * uses an int. */
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- blt_cv_struct_wait_works="yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- blt_cv_struct_wait_works="no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-if test "${blt_cv_struct_wait_works}" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_UNION_WAIT 1
-_ACEOF
-
-fi
-{ echo "$as_me:$LINENO: result: $blt_cv_struct_wait_works" >&5
-echo "${ECHO_T}$blt_cv_struct_wait_works" >&6; }
-
-
-# -----------------------------------------------------------------------
-#
-# Library Functions: Check for drand48, and srand48.
-#
-# -----------------------------------------------------------------------
-
-
-
-
-
-
-
-
-for ac_func in strtolower strcasecmp strncasecmp drand48 srand48 finite isnan
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); 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 $ac_func
-
-/* 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 $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-# For HPUX it's a little more complicated to search for isfinite
-{ echo "$as_me:$LINENO: checking for isfinite" >&5
-echo $ECHO_N "checking for isfinite... $ECHO_C" >&6; }
-if test "${blt_cv_have_isfinite+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <math.h>
-int
-main ()
-{
-
-double x = 1.0;
-if (isfinite(x)) {
- return 0;
-}
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- blt_cv_have_isfinite="yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- blt_cv_have_isfinite="no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-
-
-if test "${blt_cv_have_isfinite}" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ISFINITE 1
-_ACEOF
-
-fi
-{ echo "$as_me:$LINENO: result: $blt_cv_have_isfinite" >&5
-echo "${ECHO_T}$blt_cv_have_isfinite" >&6; }
-
-# -----------------------------------------------------------------------
-#
-# Check the smallest value such that 1.0 + x != 1.0.
-# For ANSI compilers this is DBL_EPSILON in float.h
-#
-#--------------------------------------------------------------------
-
-{ echo "$as_me:$LINENO: checking whether DBL_EPSILON is defined in float.h" >&5
-echo $ECHO_N "checking whether DBL_EPSILON is defined in float.h... $ECHO_C" >&6; }
-if test "${blt_cv_found_dbl_epsilon+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
-
-int
-main ()
-{
-
-#ifdef DBL_EPSILON
- exit(0);
-#else
- exit(1);
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- blt_cv_found_dbl_epsilon=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- blt_cv_found_dbl_epsilon=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-
-{ echo "$as_me:$LINENO: result: ${blt_cv_found_dbl_epsilon}" >&5
-echo "${ECHO_T}${blt_cv_found_dbl_epsilon}" >&6; }
-
-if test "${blt_cv_found_dbl_epsilon}" = "no" ; then
- if test "${blt_cv_dbl_epsilon+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- old_flags="$CFLAGS"
- CFLAGS="-lm"
- { echo "$as_me:$LINENO: checking whether DBL_EPSILON can be computed." >&5
-echo $ECHO_N "checking whether DBL_EPSILON can be computed.... $ECHO_C" >&6; }
- if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: can not run test program while cross compiling" >&5
-echo "$as_me: error: can not run test program while cross compiling" >&2;}
- { (exit 1); exit 1; }; }
-else
-cat > conftest.$ac_ext <<EOF
-#line 11247 "configure"
-#include "confdefs.h"
-#ifdef __cplusplus
-extern "C" void exit(int);
-#endif
-
-main () {
- double e, u;
- /*
- * Check the smallest value such that 1.0 + x != 1.0.
- * For ANSI compilers this is DBL_EPSILON in float.h
- */
- u = 1.0;
- for(;;) {
- u *= 0.5;
- if ((1.0 + u) == 1.0) {
- break;
- }
- }
- e = u * 2.0;
- printf("%.17e\n", e);
- exit(0);
-}
-EOF
-eval $ac_link
-if test -s conftest && (./conftest > ./conftest.stdout; exit) 2>/dev/null; then
- blt_cv_dbl_epsilon=`cat ./conftest.stdout`
-else
- blt_cv_dbl_epsilon=""
-fi
-fi
-rm -fr conftest*
- CFLAGS="$old_flags"
-
-cat >>confdefs.h <<_ACEOF
-#define BLT_DBL_EPSILON ${blt_cv_dbl_epsilon}
-_ACEOF
-
- { echo "$as_me:$LINENO: result: ${blt_cv_dbl_epsilon}" >&5
-echo "${ECHO_T}${blt_cv_dbl_epsilon}" >&6; }
-
-fi
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether strcasecmp is declared" >&5
-echo $ECHO_N "checking whether strcasecmp is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_strcasecmp+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-
-int
-main ()
-{
-#ifndef strcasecmp
- (void) strcasecmp;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_strcasecmp=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_strcasecmp=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strcasecmp" >&5
-echo "${ECHO_T}$ac_cv_have_decl_strcasecmp" >&6; }
-if test $ac_cv_have_decl_strcasecmp = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRCASECMP 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRCASECMP 0
-_ACEOF
-
-
-fi
-
-
-
-{ echo "$as_me:$LINENO: checking whether strncasecmp is declared" >&5
-echo $ECHO_N "checking whether strncasecmp is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_strncasecmp+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-
-int
-main ()
-{
-#ifndef strncasecmp
- (void) strncasecmp;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_strncasecmp=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_strncasecmp=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strncasecmp" >&5
-echo "${ECHO_T}$ac_cv_have_decl_strncasecmp" >&6; }
-if test $ac_cv_have_decl_strncasecmp = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRNCASECMP 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRNCASECMP 0
-_ACEOF
-
-
-fi
-
-
-
-{ echo "$as_me:$LINENO: checking whether strtolower is declared" >&5
-echo $ECHO_N "checking whether strtolower is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_strtolower+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-
-int
-main ()
-{
-#ifndef strtolower
- (void) strtolower;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_strtolower=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_strtolower=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtolower" >&5
-echo "${ECHO_T}$ac_cv_have_decl_strtolower" >&6; }
-if test $ac_cv_have_decl_strtolower = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRTOLOWER 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRTOLOWER 0
-_ACEOF
-
-
-fi
-
-
-
-{ echo "$as_me:$LINENO: checking whether drand48 is declared" >&5
-echo $ECHO_N "checking whether drand48 is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_drand48+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-
-int
-main ()
-{
-#ifndef drand48
- (void) drand48;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_drand48=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_drand48=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_drand48" >&5
-echo "${ECHO_T}$ac_cv_have_decl_drand48" >&6; }
-if test $ac_cv_have_decl_drand48 = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_DRAND48 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_DRAND48 0
-_ACEOF
-
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether srand48 is declared" >&5
-echo $ECHO_N "checking whether srand48 is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_srand48+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-
-int
-main ()
-{
-#ifndef srand48
- (void) srand48;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_srand48=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_srand48=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_srand48" >&5
-echo "${ECHO_T}$ac_cv_have_decl_srand48" >&6; }
-if test $ac_cv_have_decl_srand48 = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SRAND48 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SRAND48 0
-_ACEOF
-
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether j1 is declared" >&5
-echo $ECHO_N "checking whether j1 is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_j1+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-
-int
-main ()
-{
-#ifndef j1
- (void) j1;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_j1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_j1=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_j1" >&5
-echo "${ECHO_T}$ac_cv_have_decl_j1" >&6; }
-if test $ac_cv_have_decl_j1 = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_J1 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_J1 0
-_ACEOF
-
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether hypot is declared" >&5
-echo $ECHO_N "checking whether hypot is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_hypot+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-
-int
-main ()
-{
-#ifndef hypot
- (void) hypot;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_hypot=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_hypot=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_hypot" >&5
-echo "${ECHO_T}$ac_cv_have_decl_hypot" >&6; }
-if test $ac_cv_have_decl_hypot = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_HYPOT 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_HYPOT 0
-_ACEOF
-
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5
-echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_isnan+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-
-int
-main ()
-{
-#ifndef isnan
- (void) isnan;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_isnan=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_isnan=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5
-echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; }
-if test $ac_cv_have_decl_isnan = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ISNAN 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ISNAN 0
-_ACEOF
-
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5
-echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_isfinite+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-
-int
-main ()
-{
-#ifndef isfinite
- (void) isfinite;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_isfinite=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_isfinite=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5
-echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; }
-if test $ac_cv_have_decl_isfinite = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ISFINITE 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ISFINITE 0
-_ACEOF
-
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether finite is declared" >&5
-echo $ECHO_N "checking whether finite is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_finite+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-
-int
-main ()
-{
-#ifndef finite
- (void) finite;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_finite=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_finite=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_finite" >&5
-echo "${ECHO_T}$ac_cv_have_decl_finite" >&6; }
-if test $ac_cv_have_decl_finite = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FINITE 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FINITE 0
-_ACEOF
-
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking whether free is declared" >&5
-echo $ECHO_N "checking whether free is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_free+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-
-int
-main ()
-{
-#ifndef free
- (void) free;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_free=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl_free=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5
-echo "${ECHO_T}$ac_cv_have_decl_free" >&6; }
-if test $ac_cv_have_decl_free = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FREE 1
-_ACEOF
-
-
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FREE 0
-_ACEOF
-
-
-fi
-
-
-
-# -----------------------------------------------------------------------
-#
-# System services: X, Tcl, Tk
-#
-# -----------------------------------------------------------------------
-
-if test "x${x_libraries}" = "x" ; then
- X11_LIB_SPEC="-lX11"
-else
- X11_LIB_SPEC="-L${x_libraries} -lX11"
-fi
-if test "x${x_includes}" = "x" ; then
- X11_INC_SPEC=""
-else
- X11_INC_SPEC="-I${x_includes}"
-fi
-
-case "$target_cpu" in
- i[3-9]86|x86*|k5|k6|k6-2|k6-3|pentium*|athlon*)
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_X86 1
-_ACEOF
-
- ;;
- *)
- ;;
-esac
-
-# -----------------------------------------------------------------------
-#
-# Find the Tcl build configuration file "tclConfig.sh"
-#
-# -----------------------------------------------------------------------
-
-{ echo "$as_me:$LINENO: checking for tclConfig.sh" >&5
-echo $ECHO_N "checking for tclConfig.sh... $ECHO_C" >&6; }
-tcl_config_sh=""
-if test "x$blt_with_tcl" != "x" ; then
-
- # Verify that a tclConfig.sh file exists in the directory specified
- # by --with-tcl.
-
- for dir in \
- $blt_with_tcl
- do
- if test -r "$dir/tclConfig.sh" ; then
- tcl_config_sh="$dir/tclConfig.sh"
- break
- elif test -r "$dir/lib/tclConfig.sh" ; then
- tcl_config_sh="$dir/lib/tclConfig.sh"
- break
- elif test -r "$dir/$blt_platform/tclConfig.sh" ; then
- tcl_config_sh="$dir/$blt_platform/tclConfig.sh"
- break
- fi
- done
-elif test "${blt_with_tcl_include_dir}" = "yes" -a \
- "${blt_with_tcl_lib_dir}" = "yes" ; then
-
- # Otherwise, search for Tcl configuration file.
-
- # 1. Search previously named locations.
-
- for dir in \
- $prefix \
- $exec_prefix \
- $blt_cv_tcl_lib
- do
- if test -r "$dir/tclConfig.sh" ; then
- tcl_config_sh="$dir/tclConfig.sh"
- break
- elif test -r "$dir/lib/tclConfig.sh" ; then
- tcl_config_sh="$dir/lib/tclConfig.sh"
- break
- elif test -r "$dir/$blt_platform/tclConfig.sh" ; then
- tcl_config_sh="$dir/$blt_platform/tclConfig.sh"
- break
- fi
- done
-
- # 2. Search source directories.
-
- if test "x$tcl_config_sh" = "x" ; then
- for dir in \
- `ls -dr ../tcl[7-9].[0-9]* 2>/dev/null` \
- ../tcl \
- `ls -dr ../../tcl[7-9].[0-9]* 2>/dev/null` \
- ../../tcl \
- `ls -dr ../../../tcl[7-9].[0-9]* 2>/dev/null` \
- ../../../tcl
- do
- if test -r "$dir/$blt_platform/tclConfig.sh" ; then
- tcl_config_sh="$dir/$blt_platform/tclConfig.sh"
- break
- fi
- done
- fi
-
- # 3. Search standard locations.
-
- if test "x$tcl_config_sh" = "x" ; then
- for dir in \
- /usr/local \
- /usr
- do
- if test -r "$dir/tclConfig.sh" ; then
- tcl_config_sh="$dir/tclConfig.sh"
- break
- elif test -r "$dir/lib/tclConfig.sh" ; then
- tcl_config_sh="$dir/lib/tclConfig.sh"
- break
- fi
- done
- fi
-fi
-
-{ echo "$as_me:$LINENO: result: ${tcl_config_sh}" >&5
-echo "${ECHO_T}${tcl_config_sh}" >&6; }
-
-
-# -----------------------------------------------------------------------
-#
-# Find the Tk build configuration file "tkConfig.sh"
-#
-# -----------------------------------------------------------------------
-
-{ echo "$as_me:$LINENO: checking for tkConfig.sh" >&5
-echo $ECHO_N "checking for tkConfig.sh... $ECHO_C" >&6; }
-tk_config_sh=""
-if test "x$blt_with_tk" != "x" -o "x$blt_with_tcl" != "x"; then
-
- # Verify that a tkConfig.sh file exists in the directory specified
- # by --with-tcl or --with-tk.
-
- for dir in \
- $blt_with_tk \
- $blt_with_tcl
- do
- if test -r "$dir/tkConfig.sh" ; then
- tk_config_sh="$dir/tkConfig.sh"
- break
- elif test -r "$dir/lib/tkConfig.sh" ; then
- tk_config_sh="$dir/lib/tkConfig.sh"
- break
- elif test -r "$dir/$blt_platform/tkConfig.sh" ; then
- tk_config_sh="$dir/$blt_platform/tkConfig.sh"
- break
- fi
- done
-elif test "${blt_with_tk_include_dir}" = "yes" -a \
- "${blt_with_tk_lib_dir}" = "yes" ; then
-
- # Search for Tk configuration file.
-
- # 1. Search previously named locations.
-
- for dir in \
- $prefix \
- $exec_prefix \
- $blt_cv_tk_lib \
- $blt_cv_tcl_lib
- do
- if test -r "$dir/tkConfig.sh" ; then
- tk_config_sh="$dir/tkConfig.sh"
- break
- elif test -r "$dir/lib/tkConfig.sh" ; then
- tk_config_sh="$dir/lib/tkConfig.sh"
- break
- elif test -r "$dir/$blt_platform/tkConfig.sh" ; then
- tk_config_sh="$dir/$blt_platform/tkConfig.sh"
- break
- fi
- done
-
- # 2. Search source directories.
-
- if test "x$tk_config_sh" = "x" ; then
- for dir in \
- ../tcl \
- `ls -dr ../tk[4-9].[0-9]* 2>/dev/null` \
- ../../tcl \
- `ls -dr ../../tk[4-9].[0-9]* 2>/dev/null` \
- ../../../tcl \
- `ls -dr ../../../tk[4-9].[0-9]* 2>/dev/null`
- do
- if test -r "$dir/$blt_platform/tkConfig.sh"; then
- tk_config_sh="$dir/$blt_platform/tkConfig.sh"
- break
- fi
- done
- fi
-
- # 3. Search standard locations.
-
- if test "x$tk_config_sh" = "x" ; then
- for dir in \
- /usr/local \
- ${x_libraries} \
- /usr
- do
- if test -r "$dir/tkConfig.sh" ; then
- tk_config_sh="$dir/tkConfig.sh"
- break
- elif test -r "$dir/lib/tkConfig.sh" ; then
- tk_config_sh="$dir/lib/tkConfig.sh"
- break
- fi
- done
- fi
-fi
-{ echo "$as_me:$LINENO: result: ${tk_config_sh}" >&5
-echo "${ECHO_T}${tk_config_sh}" >&6; }
-
-# -----------------------------------------------------------------------
-#
-# Source in the Tcl/Tk configuration scripts.
-#
-#
-# Check for tclConfig.sh and tkConfig.sh. If found use values
-# in file, but don't check if libraries exist.
-#
-# -----------------------------------------------------------------------
-
-if test "x${tcl_config_sh}" != "x" ; then
- . $tcl_config_sh
- TCL_INC_SPEC=${TCL_INCLUDE_SPEC}
-fi
-
-if test "x${tk_config_sh}" != "x" ; then
- . $tk_config_sh
- TK_INC_SPEC=${TK_INCLUDE_SPEC}
-fi
-
-tcl_includes_dir=""
-tk_includes_dir=""
-TCL_INC_SPEC=${TCL_INCLUDE_SPEC}
-TK_INC_SPEC=${TK_INCLUDE_SPEC}
-
-if test "${blt_with_tcl_include_dir}" = "no" ; then
- { { echo "$as_me:$LINENO: error: Can't find tcl.h: use --with-tclincdir switch" >&5
-echo "$as_me: error: Can't find tcl.h: use --with-tclincdir switch" >&2;}
- { (exit 1); exit 1; }; }
-elif test "${blt_with_tcl_include_dir}" != "yes" ; then
- if test -r "${blt_with_tcl_include_dir}/tcl.h" ; then
- tcl_includes_dir=${blt_with_tcl_include_dir}
- TCL_INC_SPEC="-I${tcl_includes_dir}"
- cat > conftest.awk <<EOF
-/^# *define *TCL_MAJOR_VERSION[ \t]/ { print \$3 }
-EOF
-TCL_MAJOR_VERSION=`${AWK} -f conftest.awk "${tcl_includes_dir}/tcl.h"`
-rm -rf conftest*
- cat > conftest.awk <<EOF
-/^# *define *TCL_MINOR_VERSION[ \t]/ { print \$3 }
-EOF
-TCL_MINOR_VERSION=`${AWK} -f conftest.awk "${tcl_includes_dir}/tcl.h"`
-rm -rf conftest*
- TCL_VERSION=${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}
- else
- { { echo "$as_me:$LINENO: error: Can't find tcl.h in \"${blt_with_tcl_include_dir}\"" >&5
-echo "$as_me: error: Can't find tcl.h in \"${blt_with_tcl_include_dir}\"" >&2;}
- { (exit 1); exit 1; }; }
- fi
-else
- for dir in \
- ${TCL_PREFIX}/include \
- ${TCL_SRC_DIR}/generic \
- /usr/local/include \
- /usr/include
- do
- if test -r "$dir/tcl.h" ; then
- tcl_includes_dir=$dir
- break
- fi
- done
- if test "x${tcl_includes_dir}" = "x" ; then
- { { echo "$as_me:$LINENO: error: Can't find tcl.h header file." >&5
-echo "$as_me: error: Can't find tcl.h header file." >&2;}
- { (exit 1); exit 1; }; }
- fi
-fi
-
-if test "${blt_with_tk_include_dir}" = "no" ; then
- { { echo "$as_me:$LINENO: error: Can't find tk.h: use --with-tkincdir switch" >&5
-echo "$as_me: error: Can't find tk.h: use --with-tkincdir switch" >&2;}
- { (exit 1); exit 1; }; }
-elif test "${blt_with_tk_include_dir}" != "yes" ; then
- if test -r "${blt_with_tk_include_dir}/tk.h" ; then
- tk_includes_dir=${blt_with_tk_include_dir}
- TK_INC_SPEC="-I${tk_includes_dir}"
- cat > conftest.awk <<EOF
-/^# *define *TK_MAJOR_VERSION[ \t]/ { print \$3 }
-EOF
-TK_MAJOR_VERSION=`${AWK} -f conftest.awk "${tk_includes_dir}/tk.h"`
-rm -rf conftest*
- cat > conftest.awk <<EOF
-/^# *define *TK_MINOR_VERSION[ \t]/ { print \$3 }
-EOF
-TK_MINOR_VERSION=`${AWK} -f conftest.awk "${tk_includes_dir}/tk.h"`
-rm -rf conftest*
- TK_VERSION=${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}
- else
- { { echo "$as_me:$LINENO: error: Can't find tk.h in \"${blt_with_tk_include_dir}\"" >&5
-echo "$as_me: error: Can't find tk.h in \"${blt_with_tk_include_dir}\"" >&2;}
- { (exit 1); exit 1; }; }
- fi
-else
- for dir in \
- ${TK_PREFIX}/include \
- ${TK_SRC_DIR}/generic \
- ${tcl_includes_dir} \
- /usr/local/include \
- /usr/include
- do
- if test -r "$dir/tk.h" ; then
- tk_includes_dir=$dir
- break
- fi
- done
- if test "x${tk_includes_dir}" = "x" ; then
- { { echo "$as_me:$LINENO: error: Can't find tk.h header file." >&5
-echo "$as_me: error: Can't find tk.h header file." >&2;}
- { (exit 1); exit 1; }; }
- fi
-fi
-
-case $target in
- *-*-mingw*)
- TCL_LIB_VERSION="${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}g"
- TK_LIB_VERSION="${TK_MAJOR_VERSION}${TK_MINOR_VERSION}g"
- ;;
- *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|OpenBSD-*)
- TCL_LIB_VERSION="${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}"
- TK_LIB_VERSION="${TK_MAJOR_VERSION}${TK_MINOR_VERSION}"
- ;;
- *)
- TCL_LIB_VERSION="${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}"
- TK_LIB_VERSION="${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}"
- ;;
-esac
-
-if test "${blt_with_tcl_lib_dir}" = "no" ; then
- { { echo "$as_me:$LINENO: error: Can't find Tcl library: use --with-tcllibdir switch" >&5
-echo "$as_me: error: Can't find Tcl library: use --with-tcllibdir switch" >&2;}
- { (exit 1); exit 1; }; }
-elif test "${blt_with_tcl_lib_dir}" = "yes" ; then
- for libname in \
- "${TCL_EXEC_PREFIX}/lib/${SO_PREFIX}tcl${TCL_LIB_VERSION}${SO_EXT}" \
- "${TCL_EXEC_PREFIX}/lib/${IMPLIB_PREFIX}tcl${TCL_LIB_VERSION}${IMPLIB_EXT}" \
- "${TCL_EXEC_PREFIX}/lib/${IMPLIB_PREFIX}tcl${TCL_LIB_VERSION}.lib" \
- "${TCL_EXEC_PREFIX}/lib/libtcl${TCL_LIB_VERSION}.a"
- do
- if test -r "$libname" ; then
- TCL_LIB_DIR="${TCL_EXEC_PREFIX}/lib"
- TCL_LIB_SPEC="-L${TCL_LIB_DIR} -ltcl${TCL_LIB_VERSION}"
- break
- fi
- done
-else
- for libname in \
- "${blt_with_tcl_lib_dir}/${SO_PREFIX}tcl${TCL_LIB_VERSION}${SO_EXT}" \
- "${blt_with_tcl_lib_dir}/${IMPLIB_PREFIX}tcl${TCL_LIB_VERSION}${IMPLIB_EXT}" \
- "${blt_with_tcl_lib_dir}/${IMPLIB_PREFIX}tcl${TCL_LIB_VERSION}.lib" \
- "${blt_with_tcl_lib_dir}/libtcl${TCL_LIB_VERSION}.a"
- do
- if test -r "$libname" ; then
- TCL_LIB_DIR="${blt_with_tcl_lib_dir}"
- TCL_LIB_SPEC="-L${TCL_LIB_DIR} -ltcl${TCL_LIB_VERSION}"
- break
- fi
- done
-fi
-if test "x${TCL_LIB_DIR}" = "xx" ; then
- { { echo "$as_me:$LINENO: error: Can't find tcl library ${libname} in \"${blt_with_tcl_lib_dir}\"" >&5
-echo "$as_me: error: Can't find tcl library ${libname} in \"${blt_with_tcl_lib_dir}\"" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-if test "${blt_with_tk_lib_dir}" = "no" ; then
- { { echo "$as_me:$LINENO: error: Can't find Tcl library: use --with-tcllibdir switch" >&5
-echo "$as_me: error: Can't find Tcl library: use --with-tcllibdir switch" >&2;}
- { (exit 1); exit 1; }; }
-elif test "${blt_with_tk_lib_dir}" = "yes" ; then
- for libname in \
- "${TK_EXEC_PREFIX}/lib/${SO_PREFIX}tk${TK_LIB_VERSION}${SO_EXT}" \
- "${TK_EXEC_PREFIX}/lib/${IMPLIB_PREFIX}tk${TK_LIB_VERSION}${IMPLIB_EXT}" \
- "${TK_EXEC_PREFIX}/lib/${IMPLIB_PREFIX}tk${TK_LIB_VERSION}.lib" \
- "${TK_EXEC_PREFIX}/lib/libtk${TK_LIB_VERSION}.a"
- do
- if test -r "$libname" ; then
- TK_LIB_DIR="${TK_EXEC_PREFIX}/lib"
- TK_LIB_SPEC="-L${TK_LIB_DIR} -ltk${TK_LIB_VERSION}"
- break
- fi
- done
-else
- for libname in \
- "${blt_with_tk_lib_dir}/${SO_PREFIX}tk${TK_LIB_VERSION}${SO_EXT}" \
- "${blt_with_tk_lib_dir}/${IMPLIB_PREFIX}tk${TK_LIB_VERSION}${IMPLIB_EXT}" \
- "${blt_with_tk_lib_dir}/${IMPLIB_PREFIX}tk${TK_LIB_VERSION}$.lib" \
- "${blt_with_tk_lib_dir}/libtk${TK_LIB_VERSION}.a"
- do
- if test -r "$libname" ; then
- TK_LIB_DIR="${blt_with_tk_lib_dir}"
- TK_LIB_SPEC="-L${TK_LIB_DIR} -ltk${TK_LIB_VERSION}"
- break
- fi
- done
-fi
-if test "x${TK_LIB_DIR}" = "xx" ; then
- { { echo "$as_me:$LINENO: error: Can't find tk library." >&5
-echo "$as_me: error: Can't find tk library." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# -----------------------------------------------------------------------
-#
-# Include files
-#
-# Append to INC_SPECS the various include files specifications
-# (built fromt the include directory information).
-#
-# -----------------------------------------------------------------------
-
-# Tk include files
-if test "${tk_includes_dir}" != "/usr/include" ; then
- INC_SPECS="${INC_SPECS} ${TK_INC_SPEC}"
-fi
-
-# Tcl include files
-#
-# Add the include directory specification only if the Tcl
-# headers reside in a different directory from Tk's.
-if test "${tcl_includes_dir}" != "/usr/include" -a \
- "${tcl_includes_dir}" != "${tk_includes_dir}" ; then
- INC_SPECS="${INC_SPECS} ${TCL_INC_SPEC}"
-fi
-
-
-# On Windows, override the default include directory with our own.
-if test "${blt_platform}" = "win"; then
- x_includes="NONE"
-fi
-
-# X11 include files
-if test "x${x_includes}" != "x" -a \
- "${x_includes}" != "NONE" -a \
- "${x_includes}" != "/usr/include" -a \
- "${x_includes}" != "${tk_includes_dir}" -a \
- "${x_includes}" != "${tcl_includes_dir}" ; then
- INC_SPECS="${INC_SPECS} -I${x_includes}"
-fi
-
-# -----------------------------------------------------------------------
-#
-# Libraries
-#
-# Append to LIB the various library specifications
-# (built from the library directory information).
-#
-# -----------------------------------------------------------------------
-
-# Collect the libraries for AIX that aren't using stubs.
-aix_lib_specs=$LIBS
-
-if test "${blt_platform}" = "unix"; then
-
- # Add specification for X11 library only on Unix platforms.
-
- if test "x${x_libraries}" = "x" -o \
- "x${x_libraries}" = "NONE" -o \
- "${x_libraries}" = "/usr/lib" -o \
- "${x_libraries}" = "/usr/lib64" -o \
- "${x_libraries}" = "${TK_LIB_DIR}" -o \
- "${x_libraries}" = "${TCL_LIB_DIR}" ; then
- x_lib_spec=""
- aix_lib_specs="-lX11 ${aix_lib_specs}"
- else
- x_lib_spec="-L${x_libraries}"
- aix_lib_specs="-L${x_libraries} -lX11 ${aix_lib_specs}"
- if test "x${loader_run_path}" = "x" ; then
- loader_run_path="${x_libraries}"
- else
- loader_run_path="${loader_run_path}:${x_libraries}"
- fi
- fi
-fi
-
-
-# EXPAT library
-
-if test "${blt_with_expat_lib_dir}" != "no" -a \
- "${ac_cv_header_expat_h}" != "no" ; then
-
- if test "$blt_with_expat_lib_dir" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "$blt_with_expat_lib_dir" = "yes" ; then
- lib_spec="-lexpat"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5
-echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6; }
-if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lexpat $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XML_ParserCreate ();
-int
-main ()
-{
-return XML_ParserCreate ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_expat_XML_ParserCreate=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_expat_XML_ParserCreate=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5
-echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6; }
-if test $ac_cv_lib_expat_XML_ParserCreate = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -lexpat "
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5
-echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6; }
-if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lexpat $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XML_ParserCreate ();
-int
-main ()
-{
-return XML_ParserCreate ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_expat_XML_ParserCreate=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_expat_XML_ParserCreate=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5
-echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6; }
-if test $ac_cv_lib_expat_XML_ParserCreate = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- EXPAT_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in $blt_with_expat_lib_dir $blt_with_expat_lib_dir/lib ; do
- lib_spec="-L${dir} -lexpat "
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5
-echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6; }
-if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lexpat $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XML_ParserCreate ();
-int
-main ()
-{
-return XML_ParserCreate ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_expat_XML_ParserCreate=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_expat_XML_ParserCreate=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5
-echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6; }
-if test $ac_cv_lib_expat_XML_ParserCreate = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- EXPAT_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBEXPAT 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- EXPAT_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-fi
-
-# MYSQL client library
-
-if test "${blt_with_mysql_lib_dir}" != "no" -a \
- "${ac_cv_header_mysql_mysql_h}" != "no" ; then
-
- if test "$blt_with_mysql_lib_dir" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "$blt_with_mysql_lib_dir" = "yes" ; then
- lib_spec="-lmysqlclient"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for mysql_init in -lmysqlclient" >&5
-echo $ECHO_N "checking for mysql_init in -lmysqlclient... $ECHO_C" >&6; }
-if test "${ac_cv_lib_mysqlclient_mysql_init+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmysqlclient $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 mysql_init ();
-int
-main ()
-{
-return mysql_init ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_mysqlclient_mysql_init=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_mysqlclient_mysql_init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mysqlclient_mysql_init" >&5
-echo "${ECHO_T}$ac_cv_lib_mysqlclient_mysql_init" >&6; }
-if test $ac_cv_lib_mysqlclient_mysql_init = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -lmysqlclient "
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for mysql_init in -lmysqlclient" >&5
-echo $ECHO_N "checking for mysql_init in -lmysqlclient... $ECHO_C" >&6; }
-if test "${ac_cv_lib_mysqlclient_mysql_init+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmysqlclient $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 mysql_init ();
-int
-main ()
-{
-return mysql_init ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_mysqlclient_mysql_init=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_mysqlclient_mysql_init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mysqlclient_mysql_init" >&5
-echo "${ECHO_T}$ac_cv_lib_mysqlclient_mysql_init" >&6; }
-if test $ac_cv_lib_mysqlclient_mysql_init = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- MYSQL_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in $blt_with_mysql_lib_dir $blt_with_mysql_lib_dir/lib ; do
- lib_spec="-L${dir} -lmysqlclient "
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for mysql_init in -lmysqlclient" >&5
-echo $ECHO_N "checking for mysql_init in -lmysqlclient... $ECHO_C" >&6; }
-if test "${ac_cv_lib_mysqlclient_mysql_init+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmysqlclient $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 mysql_init ();
-int
-main ()
-{
-return mysql_init ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_mysqlclient_mysql_init=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_mysqlclient_mysql_init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mysqlclient_mysql_init" >&5
-echo "${ECHO_T}$ac_cv_lib_mysqlclient_mysql_init" >&6; }
-if test $ac_cv_lib_mysqlclient_mysql_init = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- MYSQL_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBMYSQL 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- MYSQL_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-fi
-
-# JPEG library
-
-if test "${blt_with_jpeg_lib_dir}" != "no" -a \
- "${ac_cv_header_jpeglib_h}" != "no" ; then
-
- if test "$blt_with_jpeg_lib_dir" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "$blt_with_jpeg_lib_dir" = "yes" ; then
- lib_spec="-ljpeg"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for jpeg_read_header in -ljpeg" >&5
-echo $ECHO_N "checking for jpeg_read_header in -ljpeg... $ECHO_C" >&6; }
-if test "${ac_cv_lib_jpeg_jpeg_read_header+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ljpeg $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 jpeg_read_header ();
-int
-main ()
-{
-return jpeg_read_header ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_jpeg_jpeg_read_header=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_jpeg_jpeg_read_header=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_read_header" >&5
-echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_read_header" >&6; }
-if test $ac_cv_lib_jpeg_jpeg_read_header = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -ljpeg "
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for jpeg_read_header in -ljpeg" >&5
-echo $ECHO_N "checking for jpeg_read_header in -ljpeg... $ECHO_C" >&6; }
-if test "${ac_cv_lib_jpeg_jpeg_read_header+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ljpeg $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 jpeg_read_header ();
-int
-main ()
-{
-return jpeg_read_header ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_jpeg_jpeg_read_header=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_jpeg_jpeg_read_header=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_read_header" >&5
-echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_read_header" >&6; }
-if test $ac_cv_lib_jpeg_jpeg_read_header = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- JPG_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in $blt_with_jpeg_lib_dir $blt_with_jpeg_lib_dir/lib ; do
- lib_spec="-L${dir} -ljpeg "
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for jpeg_read_header in -ljpeg" >&5
-echo $ECHO_N "checking for jpeg_read_header in -ljpeg... $ECHO_C" >&6; }
-if test "${ac_cv_lib_jpeg_jpeg_read_header+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ljpeg $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 jpeg_read_header ();
-int
-main ()
-{
-return jpeg_read_header ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_jpeg_jpeg_read_header=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_jpeg_jpeg_read_header=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_read_header" >&5
-echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_read_header" >&6; }
-if test $ac_cv_lib_jpeg_jpeg_read_header = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- JPG_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBJPG 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- JPG_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-fi
-
-# TIFF library
-
-if test "${blt_with_tiff_lib_dir}" != "no" -a \
- "${ac_cv_header_tiff_h}" != "no" ; then
-
- if test "$blt_with_tiff_lib_dir" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "$blt_with_tiff_lib_dir" = "yes" ; then
- lib_spec="-ltiff"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for TIFFReadRGBAImage in -ltiff" >&5
-echo $ECHO_N "checking for TIFFReadRGBAImage in -ltiff... $ECHO_C" >&6; }
-if test "${ac_cv_lib_tiff_TIFFReadRGBAImage+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltiff $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 TIFFReadRGBAImage ();
-int
-main ()
-{
-return TIFFReadRGBAImage ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_tiff_TIFFReadRGBAImage=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_tiff_TIFFReadRGBAImage=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFReadRGBAImage" >&5
-echo "${ECHO_T}$ac_cv_lib_tiff_TIFFReadRGBAImage" >&6; }
-if test $ac_cv_lib_tiff_TIFFReadRGBAImage = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -ltiff -lz"
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for TIFFReadRGBAImage in -ltiff" >&5
-echo $ECHO_N "checking for TIFFReadRGBAImage in -ltiff... $ECHO_C" >&6; }
-if test "${ac_cv_lib_tiff_TIFFReadRGBAImage+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltiff $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 TIFFReadRGBAImage ();
-int
-main ()
-{
-return TIFFReadRGBAImage ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_tiff_TIFFReadRGBAImage=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_tiff_TIFFReadRGBAImage=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFReadRGBAImage" >&5
-echo "${ECHO_T}$ac_cv_lib_tiff_TIFFReadRGBAImage" >&6; }
-if test $ac_cv_lib_tiff_TIFFReadRGBAImage = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- TIF_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in $blt_with_tiff_lib_dir $blt_with_tiff_lib_dir/lib ; do
- lib_spec="-L${dir} -ltiff -lz"
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for TIFFReadRGBAImage in -ltiff" >&5
-echo $ECHO_N "checking for TIFFReadRGBAImage in -ltiff... $ECHO_C" >&6; }
-if test "${ac_cv_lib_tiff_TIFFReadRGBAImage+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltiff $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 TIFFReadRGBAImage ();
-int
-main ()
-{
-return TIFFReadRGBAImage ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_tiff_TIFFReadRGBAImage=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_tiff_TIFFReadRGBAImage=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFReadRGBAImage" >&5
-echo "${ECHO_T}$ac_cv_lib_tiff_TIFFReadRGBAImage" >&6; }
-if test $ac_cv_lib_tiff_TIFFReadRGBAImage = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- TIF_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBTIF 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- TIF_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-fi
-
-# PNG library
-
-if test "${blt_with_png_lib_dir}" != "no" -a \
- "${ac_cv_header_png_h}" != "no" ; then
-
- if test "$blt_with_png_lib_dir" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "$blt_with_png_lib_dir" = "yes" ; then
- lib_spec="-lpng"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for png_read_png in -lpng" >&5
-echo $ECHO_N "checking for png_read_png in -lpng... $ECHO_C" >&6; }
-if test "${ac_cv_lib_png_png_read_png+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpng $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 png_read_png ();
-int
-main ()
-{
-return png_read_png ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_png_png_read_png=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_png_png_read_png=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_read_png" >&5
-echo "${ECHO_T}$ac_cv_lib_png_png_read_png" >&6; }
-if test $ac_cv_lib_png_png_read_png = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -lpng -lz"
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for png_read_png in -lpng" >&5
-echo $ECHO_N "checking for png_read_png in -lpng... $ECHO_C" >&6; }
-if test "${ac_cv_lib_png_png_read_png+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpng $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 png_read_png ();
-int
-main ()
-{
-return png_read_png ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_png_png_read_png=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_png_png_read_png=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_read_png" >&5
-echo "${ECHO_T}$ac_cv_lib_png_png_read_png" >&6; }
-if test $ac_cv_lib_png_png_read_png = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- PNG_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in $blt_with_png_lib_dir $blt_with_png_lib_dir/lib ; do
- lib_spec="-L${dir} -lpng -lz"
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for png_read_png in -lpng" >&5
-echo $ECHO_N "checking for png_read_png in -lpng... $ECHO_C" >&6; }
-if test "${ac_cv_lib_png_png_read_png+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpng $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 png_read_png ();
-int
-main ()
-{
-return png_read_png ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_png_png_read_png=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_png_png_read_png=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_read_png" >&5
-echo "${ECHO_T}$ac_cv_lib_png_png_read_png" >&6; }
-if test $ac_cv_lib_png_png_read_png = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- PNG_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBPNG 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- PNG_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-fi
-
-# zlib library
-if test "${blt_with_z_lib_dir}" != "no" ; then
-
- if test "$blt_with_z_lib_dir" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "$blt_with_z_lib_dir" = "yes" ; then
- lib_spec="-lz"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for deflate in -lz" >&5
-echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6; }
-if test "${ac_cv_lib_z_deflate+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 deflate ();
-int
-main ()
-{
-return deflate ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_z_deflate=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_z_deflate=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5
-echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6; }
-if test $ac_cv_lib_z_deflate = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -lz "
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for deflate in -lz" >&5
-echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6; }
-if test "${ac_cv_lib_z_deflate+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 deflate ();
-int
-main ()
-{
-return deflate ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_z_deflate=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_z_deflate=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5
-echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6; }
-if test $ac_cv_lib_z_deflate = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- Z_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in $blt_with_z_lib_dir $blt_with_z_lib_dir/lib ; do
- lib_spec="-L${dir} -lz "
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for deflate in -lz" >&5
-echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6; }
-if test "${ac_cv_lib_z_deflate+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 deflate ();
-int
-main ()
-{
-return deflate ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_z_deflate=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_z_deflate=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5
-echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6; }
-if test $ac_cv_lib_z_deflate = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- Z_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBZ 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- Z_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-fi
-
-# XPM library
-
-old_CFLAGS=$CFLAGS
-CFLAGS=$X11_LIB_SPEC
-
-if test "${blt_with_xpm_lib_dir}" != "no" -a \
- "${ac_cv_header_xpm_h}" != "no" ; then
-
- if test "$blt_with_xpm_lib_dir" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "$blt_with_xpm_lib_dir" = "yes" ; then
- lib_spec="-lXpm"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XpmCreateXpmImageFromBuffer in -lXpm" >&5
-echo $ECHO_N "checking for XpmCreateXpmImageFromBuffer in -lXpm... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXpm $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XpmCreateXpmImageFromBuffer ();
-int
-main ()
-{
-return XpmCreateXpmImageFromBuffer ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer" >&5
-echo "${ECHO_T}$ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer" >&6; }
-if test $ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -lXpm "
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XpmCreateXpmImageFromBuffer in -lXpm" >&5
-echo $ECHO_N "checking for XpmCreateXpmImageFromBuffer in -lXpm... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXpm $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XpmCreateXpmImageFromBuffer ();
-int
-main ()
-{
-return XpmCreateXpmImageFromBuffer ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer" >&5
-echo "${ECHO_T}$ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer" >&6; }
-if test $ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- XPM_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in $blt_with_xpm_lib_dir $blt_with_xpm_lib_dir/lib ; do
- lib_spec="-L${dir} -lXpm "
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XpmCreateXpmImageFromBuffer in -lXpm" >&5
-echo $ECHO_N "checking for XpmCreateXpmImageFromBuffer in -lXpm... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXpm $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XpmCreateXpmImageFromBuffer ();
-int
-main ()
-{
-return XpmCreateXpmImageFromBuffer ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer" >&5
-echo "${ECHO_T}$ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer" >&6; }
-if test $ac_cv_lib_Xpm_XpmCreateXpmImageFromBuffer = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- XPM_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBXPM 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- XPM_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-fi
-
-# FREETYPE library
-
-if test "${blt_with_ft2_lib_dir}" != "no" -a \
- "${ac_cv_header_ft2build_h}" != "no" ; then
-
- if test "$blt_with_ft2_lib_dir" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "$blt_with_ft2_lib_dir" = "yes" ; then
- lib_spec="-lfreetype"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5
-echo $ECHO_N "checking for FT_Init_FreeType in -lfreetype... $ECHO_C" >&6; }
-if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfreetype $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 FT_Init_FreeType ();
-int
-main ()
-{
-return FT_Init_FreeType ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_freetype_FT_Init_FreeType=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_freetype_FT_Init_FreeType=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5
-echo "${ECHO_T}$ac_cv_lib_freetype_FT_Init_FreeType" >&6; }
-if test $ac_cv_lib_freetype_FT_Init_FreeType = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -lfreetype "
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5
-echo $ECHO_N "checking for FT_Init_FreeType in -lfreetype... $ECHO_C" >&6; }
-if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfreetype $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 FT_Init_FreeType ();
-int
-main ()
-{
-return FT_Init_FreeType ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_freetype_FT_Init_FreeType=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_freetype_FT_Init_FreeType=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5
-echo "${ECHO_T}$ac_cv_lib_freetype_FT_Init_FreeType" >&6; }
-if test $ac_cv_lib_freetype_FT_Init_FreeType = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- FT2_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in $blt_with_ft2_lib_dir $blt_with_ft2_lib_dir/lib ; do
- lib_spec="-L${dir} -lfreetype "
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5
-echo $ECHO_N "checking for FT_Init_FreeType in -lfreetype... $ECHO_C" >&6; }
-if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfreetype $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 FT_Init_FreeType ();
-int
-main ()
-{
-return FT_Init_FreeType ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_freetype_FT_Init_FreeType=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_freetype_FT_Init_FreeType=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5
-echo "${ECHO_T}$ac_cv_lib_freetype_FT_Init_FreeType" >&6; }
-if test $ac_cv_lib_freetype_FT_Init_FreeType = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- FT2_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBFT2 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- FT2_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-fi
-
-# Xft library
-
-if test "${blt_with_xft2_lib_dir}" != "no" -a \
- "${ac_cv_header_x11_xft_xft_h}" != "no" ; then
-
- if test "$blt_with_xft_lib_dir" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "$blt_with_xft_lib_dir" = "yes" ; then
- lib_spec="-lXft"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XftFontOpenPattern in -lXft -lexpat" >&5
-echo $ECHO_N "checking for XftFontOpenPattern in -lXft -lexpat... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xft__lexpat_XftFontOpenPattern+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXft -lexpat $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XftFontOpenPattern ();
-int
-main ()
-{
-return XftFontOpenPattern ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xft__lexpat_XftFontOpenPattern=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xft__lexpat_XftFontOpenPattern=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xft__lexpat_XftFontOpenPattern" >&5
-echo "${ECHO_T}$ac_cv_lib_Xft__lexpat_XftFontOpenPattern" >&6; }
-if test $ac_cv_lib_Xft__lexpat_XftFontOpenPattern = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -lXft -lexpat "
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XftFontOpenPattern in -lXft -lexpat" >&5
-echo $ECHO_N "checking for XftFontOpenPattern in -lXft -lexpat... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xft__lexpat_XftFontOpenPattern+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXft -lexpat $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XftFontOpenPattern ();
-int
-main ()
-{
-return XftFontOpenPattern ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xft__lexpat_XftFontOpenPattern=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xft__lexpat_XftFontOpenPattern=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xft__lexpat_XftFontOpenPattern" >&5
-echo "${ECHO_T}$ac_cv_lib_Xft__lexpat_XftFontOpenPattern" >&6; }
-if test $ac_cv_lib_Xft__lexpat_XftFontOpenPattern = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- XFT_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in $blt_with_xft_lib_dir $blt_with_xft_lib_dir/lib ; do
- lib_spec="-L${dir} -lXft -lexpat "
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XftFontOpenPattern in -lXft -lexpat" >&5
-echo $ECHO_N "checking for XftFontOpenPattern in -lXft -lexpat... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xft__lexpat_XftFontOpenPattern+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXft -lexpat $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XftFontOpenPattern ();
-int
-main ()
-{
-return XftFontOpenPattern ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xft__lexpat_XftFontOpenPattern=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xft__lexpat_XftFontOpenPattern=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xft__lexpat_XftFontOpenPattern" >&5
-echo "${ECHO_T}$ac_cv_lib_Xft__lexpat_XftFontOpenPattern" >&6; }
-if test $ac_cv_lib_Xft__lexpat_XftFontOpenPattern = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- XFT_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBXFT 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- XFT_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-
- if test "yes" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "yes" = "yes" ; then
- lib_spec="-lfontconfig"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for FcPatternCreate in -lfontconfig" >&5
-echo $ECHO_N "checking for FcPatternCreate in -lfontconfig... $ECHO_C" >&6; }
-if test "${ac_cv_lib_fontconfig_FcPatternCreate+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfontconfig $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 FcPatternCreate ();
-int
-main ()
-{
-return FcPatternCreate ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_fontconfig_FcPatternCreate=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_fontconfig_FcPatternCreate=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_fontconfig_FcPatternCreate" >&5
-echo "${ECHO_T}$ac_cv_lib_fontconfig_FcPatternCreate" >&6; }
-if test $ac_cv_lib_fontconfig_FcPatternCreate = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -lfontconfig "
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for FcPatternCreate in -lfontconfig" >&5
-echo $ECHO_N "checking for FcPatternCreate in -lfontconfig... $ECHO_C" >&6; }
-if test "${ac_cv_lib_fontconfig_FcPatternCreate+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfontconfig $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 FcPatternCreate ();
-int
-main ()
-{
-return FcPatternCreate ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_fontconfig_FcPatternCreate=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_fontconfig_FcPatternCreate=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_fontconfig_FcPatternCreate" >&5
-echo "${ECHO_T}$ac_cv_lib_fontconfig_FcPatternCreate" >&6; }
-if test $ac_cv_lib_fontconfig_FcPatternCreate = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- FTCFG_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in yes yes/lib ; do
- lib_spec="-L${dir} -lfontconfig "
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for FcPatternCreate in -lfontconfig" >&5
-echo $ECHO_N "checking for FcPatternCreate in -lfontconfig... $ECHO_C" >&6; }
-if test "${ac_cv_lib_fontconfig_FcPatternCreate+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfontconfig $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 FcPatternCreate ();
-int
-main ()
-{
-return FcPatternCreate ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_fontconfig_FcPatternCreate=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_fontconfig_FcPatternCreate=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_fontconfig_FcPatternCreate" >&5
-echo "${ECHO_T}$ac_cv_lib_fontconfig_FcPatternCreate" >&6; }
-if test $ac_cv_lib_fontconfig_FcPatternCreate = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- FTCFG_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBFTCFG 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- FTCFG_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-
- if test "yes" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "yes" = "yes" ; then
- lib_spec="-lXrender"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XRenderQueryExtension in -lXrender" >&5
-echo $ECHO_N "checking for XRenderQueryExtension in -lXrender... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xrender_XRenderQueryExtension+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXrender $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XRenderQueryExtension ();
-int
-main ()
-{
-return XRenderQueryExtension ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xrender_XRenderQueryExtension=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xrender_XRenderQueryExtension=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderQueryExtension" >&5
-echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderQueryExtension" >&6; }
-if test $ac_cv_lib_Xrender_XRenderQueryExtension = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -lXrender "
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XRenderQueryExtension in -lXrender" >&5
-echo $ECHO_N "checking for XRenderQueryExtension in -lXrender... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xrender_XRenderQueryExtension+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXrender $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XRenderQueryExtension ();
-int
-main ()
-{
-return XRenderQueryExtension ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xrender_XRenderQueryExtension=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xrender_XRenderQueryExtension=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderQueryExtension" >&5
-echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderQueryExtension" >&6; }
-if test $ac_cv_lib_Xrender_XRenderQueryExtension = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- XRENDER_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in yes yes/lib ; do
- lib_spec="-L${dir} -lXrender "
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XRenderQueryExtension in -lXrender" >&5
-echo $ECHO_N "checking for XRenderQueryExtension in -lXrender... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xrender_XRenderQueryExtension+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXrender $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XRenderQueryExtension ();
-int
-main ()
-{
-return XRenderQueryExtension ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xrender_XRenderQueryExtension=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xrender_XRenderQueryExtension=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderQueryExtension" >&5
-echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderQueryExtension" >&6; }
-if test $ac_cv_lib_Xrender_XRenderQueryExtension = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- XRENDER_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBXRENDER 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- XRENDER_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-fi
-
-# Xrandr library
-
-
- if test "no" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "yes" = "yes" ; then
- lib_spec="-lXrandr"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XRRGetScreenInfo in -lXrandr" >&5
-echo $ECHO_N "checking for XRRGetScreenInfo in -lXrandr... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xrandr_XRRGetScreenInfo+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXrandr $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XRRGetScreenInfo ();
-int
-main ()
-{
-return XRRGetScreenInfo ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xrandr_XRRGetScreenInfo=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xrandr_XRRGetScreenInfo=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xrandr_XRRGetScreenInfo" >&5
-echo "${ECHO_T}$ac_cv_lib_Xrandr_XRRGetScreenInfo" >&6; }
-if test $ac_cv_lib_Xrandr_XRRGetScreenInfo = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -lXrandr "
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XRRGetScreenInfo in -lXrandr" >&5
-echo $ECHO_N "checking for XRRGetScreenInfo in -lXrandr... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xrandr_XRRGetScreenInfo+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXrandr $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XRRGetScreenInfo ();
-int
-main ()
-{
-return XRRGetScreenInfo ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xrandr_XRRGetScreenInfo=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xrandr_XRRGetScreenInfo=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xrandr_XRRGetScreenInfo" >&5
-echo "${ECHO_T}$ac_cv_lib_Xrandr_XRRGetScreenInfo" >&6; }
-if test $ac_cv_lib_Xrandr_XRRGetScreenInfo = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- XRANDR_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in yes yes/lib ; do
- lib_spec="-L${dir} -lXrandr "
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XRRGetScreenInfo in -lXrandr" >&5
-echo $ECHO_N "checking for XRRGetScreenInfo in -lXrandr... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xrandr_XRRGetScreenInfo+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXrandr $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XRRGetScreenInfo ();
-int
-main ()
-{
-return XRRGetScreenInfo ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xrandr_XRRGetScreenInfo=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xrandr_XRRGetScreenInfo=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xrandr_XRRGetScreenInfo" >&5
-echo "${ECHO_T}$ac_cv_lib_Xrandr_XRRGetScreenInfo" >&6; }
-if test $ac_cv_lib_Xrandr_XRRGetScreenInfo = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- XRANDR_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBXRANDR 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- XRANDR_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-
-
- if test "no" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "yes" = "yes" ; then
- lib_spec="-lXdmcp"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XdmcpWrap in -lXdmcp" >&5
-echo $ECHO_N "checking for XdmcpWrap in -lXdmcp... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xdmcp_XdmcpWrap+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXdmcp $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XdmcpWrap ();
-int
-main ()
-{
-return XdmcpWrap ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xdmcp_XdmcpWrap=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xdmcp_XdmcpWrap=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xdmcp_XdmcpWrap" >&5
-echo "${ECHO_T}$ac_cv_lib_Xdmcp_XdmcpWrap" >&6; }
-if test $ac_cv_lib_Xdmcp_XdmcpWrap = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -lXdmcp "
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XdmcpWrap in -lXdmcp" >&5
-echo $ECHO_N "checking for XdmcpWrap in -lXdmcp... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xdmcp_XdmcpWrap+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXdmcp $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XdmcpWrap ();
-int
-main ()
-{
-return XdmcpWrap ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xdmcp_XdmcpWrap=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xdmcp_XdmcpWrap=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xdmcp_XdmcpWrap" >&5
-echo "${ECHO_T}$ac_cv_lib_Xdmcp_XdmcpWrap" >&6; }
-if test $ac_cv_lib_Xdmcp_XdmcpWrap = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- XDMCP_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in yes yes/lib ; do
- lib_spec="-L${dir} -lXdmcp "
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XdmcpWrap in -lXdmcp" >&5
-echo $ECHO_N "checking for XdmcpWrap in -lXdmcp... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xdmcp_XdmcpWrap+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXdmcp $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XdmcpWrap ();
-int
-main ()
-{
-return XdmcpWrap ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xdmcp_XdmcpWrap=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xdmcp_XdmcpWrap=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xdmcp_XdmcpWrap" >&5
-echo "${ECHO_T}$ac_cv_lib_Xdmcp_XdmcpWrap" >&6; }
-if test $ac_cv_lib_Xdmcp_XdmcpWrap = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- XDMCP_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBXDMCP 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- XDMCP_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-
- if test "no" != "no" ; then
- save_LDFLAGS="${LDFLAGS}"
- if test "yes" = "yes" ; then
- lib_spec="-lXau"
- dir=""
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XauReadAuth in -lXau" >&5
-echo $ECHO_N "checking for XauReadAuth in -lXau... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xau_XauReadAuth+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXau $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XauReadAuth ();
-int
-main ()
-{
-return XauReadAuth ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xau_XauReadAuth=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xau_XauReadAuth=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xau_XauReadAuth" >&5
-echo "${ECHO_T}$ac_cv_lib_Xau_XauReadAuth" >&6; }
-if test $ac_cv_lib_Xau_XauReadAuth = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "no" ; then
- lib_spec="-L${dir} -lXau "
- dir=$exec_prefix/lib
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XauReadAuth in -lXau" >&5
-echo $ECHO_N "checking for XauReadAuth in -lXau... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xau_XauReadAuth+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXau $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XauReadAuth ();
-int
-main ()
-{
-return XauReadAuth ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xau_XauReadAuth=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xau_XauReadAuth=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xau_XauReadAuth" >&5
-echo "${ECHO_T}$ac_cv_lib_Xau_XauReadAuth" >&6; }
-if test $ac_cv_lib_Xau_XauReadAuth = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- XAU_LIB_DIR="$dir"
- fi
- fi
- else
- for dir in yes yes/lib ; do
- lib_spec="-L${dir} -lXau "
- LDFLAGS="${lib_spec} ${save_LDFLAGS}"
- { echo "$as_me:$LINENO: checking for XauReadAuth in -lXau" >&5
-echo $ECHO_N "checking for XauReadAuth in -lXau... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xau_XauReadAuth+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXau $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* 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 XauReadAuth ();
-int
-main ()
-{
-return XauReadAuth ();
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xau_XauReadAuth=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xau_XauReadAuth=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xau_XauReadAuth" >&5
-echo "${ECHO_T}$ac_cv_lib_Xau_XauReadAuth" >&6; }
-if test $ac_cv_lib_Xau_XauReadAuth = yes; then
- found="yes"
-else
- found="no"
-fi
-
- if test "${found}" = "yes" ; then
- XAU_LIB_DIR="$dir"
- break
- fi
- done
- fi
- if test "${found}" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBXAU 1
-_ACEOF
-
- aix_lib_specs="${aix_lib_specs} ${lib_spec}"
- XAU_LIB_SPEC=${lib_spec}
- if test "x${dir}" != "x" ; then
- loader_run_path="${loader_run_path}:${dir}"
- fi
- fi
- LDFLAGS=${save_LDFLAGS}
- fi
-
-CFLAGS=$old_CFLAGS
-# Tcl libraries
-if test "${TCL_LIB_DIR}" != "/usr/lib" -a \
- "${TCL_LIB_DIR}" != "/usr/lib64" -a \
- "${TCL_LIB_DIR}" != "${TK_LIB_DIR}" ; then
- if test "x${loader_run_path}" = "x" ; then
- loader_run_path="${TCL_LIB_DIR}"
- else
- loader_run_path="${TCL_LIB_DIR}:${loader_run_path}"
- fi
-fi
-
-# Tk libraries
-if test "${TK_LIB_DIR}" != "/usr/lib" -a \
- "${TK_LIB_DIR}" != "/usr/lib64" ; then
- if test "x${loader_run_path}" = "x" ; then
- loader_run_path="${TK_LIB_DIR}"
- else
- loader_run_path="${TK_LIB_DIR}:${loader_run_path}"
- fi
-fi
-
-
-# -----------------------------------------------------------------------
-#
-# Set up a new default prefix to installation path. The ways
-# the prefix can be set and their precedence are as follows:
-#
-# 1. --prefix option given to ./configure. (prefix != NONE)
-# 2. use previously configured Tk prefix
-#
-# -----------------------------------------------------------------------
-
-if test "$prefix" = "NONE" ; then
- prefix=${TCL_PREFIX}
-fi
-
-if test "$exec_prefix" = "NONE" ; then
- exec_prefix=${TCL_EXEC_PREFIX}
-fi
-
-# -------------------------------------------------------------------------
-#
-# Extract the BLT version number for the blt.h header
-#
-# -------------------------------------------------------------------------
-{ echo "$as_me:$LINENO: checking BLT_MAJOR_VERSION" >&5
-echo $ECHO_N "checking BLT_MAJOR_VERSION... $ECHO_C" >&6; }
-if test "${blt_cv_major_version+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat > conftest.awk <<EOF
-/^# *define *BLT_MAJOR_VERSION[ \t]/ { print \$3 }
-EOF
-blt_cv_major_version=`${AWK} -f conftest.awk "${srcdir}/src/blt.h"`
-rm -rf conftest*
-
-fi
-
-BLT_MAJOR_VERSION=${blt_cv_major_version}
-{ echo "$as_me:$LINENO: result: $blt_cv_major_version" >&5
-echo "${ECHO_T}$blt_cv_major_version" >&6; }
-
-{ echo "$as_me:$LINENO: checking BLT_MINOR_VERSION" >&5
-echo $ECHO_N "checking BLT_MINOR_VERSION... $ECHO_C" >&6; }
-if test "${blt_cv_minor_version+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat > conftest.awk <<EOF
-/^# *define *BLT_MINOR_VERSION[ \t]/ { print \$3 }
-EOF
-blt_cv_minor_version=`${AWK} -f conftest.awk "${srcdir}/src/blt.h"`
-rm -rf conftest*
-
-fi
-
-{ echo "$as_me:$LINENO: result: $blt_cv_minor_version" >&5
-echo "${ECHO_T}$blt_cv_minor_version" >&6; }
-BLT_MINOR_VERSION=${blt_cv_minor_version}
-
-BLT_VERSION=${BLT_MAJOR_VERSION}.${BLT_MINOR_VERSION}
-
-# Add BLT to the run path
-libdir=${exec_prefix}/lib
-
-if test "x${libdir}" != "x" -a \
- "${libdir}" != "/usr/lib" -a \
- "${libdir}" != "/usr/lib64" -a \
- "${libdir}" != "${x_libraries}" -a \
- "${libdir}" != "${TK_LIB_DIR}" -a \
- "${libdir}" != "${TCL_LIB_DIR}" ; then
- if test "x${loader_run_path}" = "x" ; then
- loader_run_path="${libdir}"
- else
- loader_run_path="${libdir}:${loader_run_path}"
- fi
-fi
-
-# -------------------------------------------------------------------------
-#
-# Extract the Tcl version number for the tcl.h header
-#
-# -------------------------------------------------------------------------
-
-if test "$TCL_VERSION" = "7.6" -a "$TK_VERSION" = "4.2" ; then
- :
-elif test "$TCL_VERSION" = "7.5" -a "$TK_VERSION" = "4.1" ; then
- :
-elif test "$TCL_VERSION" = "$TK_VERSION" ; then
- :
-else
- { { echo "$as_me:$LINENO: error: Mismatched Tcl/Tk versions ($TCL_VERSION != $TK_VERSION)" >&5
-echo "$as_me: error: Mismatched Tcl/Tk versions ($TCL_VERSION != $TK_VERSION)" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-#--------------------------------------------------------------------
-#
-# Check if we can generate shared libraries on this system. Set flags
-# to generate shared libraries for systems that we know about. Start
-# with the values found in tclConfig.sh, make changes as we know about
-# the different systems.
-#
-#--------------------------------------------------------------------
-
-LIB_BASE_NAME=libBLT
-
-# Initialize shared library build variables
-
-SO_LD="$TCL_SHLIB_LD"
-SO_LDFLAGS="$TCL_LD_FLAGS"
-SO_RUNPATH="$TCL_LD_SEARCH_FLAGS"
-
-SO_TARGET=""
-SO_CFLAGS=""
-SO_LIBS=""
-LDFLAGS=""
-LD_RUN_PATH=""
-EXTRA_LIBS=""
-
-case $target in
- *-aix4.[2-9]*)
- # No Position-Independent flags needed
- SO_CFLAGS=""
-
- # Use the installed export file or the one found in the source directory.
-
- if test -r "${TCL_LIB_DIR}/libtcl${TCL_LIB_VERSION}.exp" ; then
- tcl_exp="${TCL_LIB_DIR}/libtcl${TCL_LIB_VERSION}.exp"
- else
- tcl_exp="${TCL_SRC_DIR}/unix/lib.exp"
- fi
- if test -r "${TK_LIB_DIR}/libtk${TK_LIB_VERSION}.exp" ; then
- tk_exp="${TK_LIB_DIR}/libtk${TK_LIB_VERSION}.exp"
- else
- tk_exp="${TK_SRC_DIR}/unix/lib.exp"
- fi
-
- full_src_path=`cd ${srcdir}; pwd`
-
- # Use shell-script to link shared library
- SO_LD="${full_src_path}/cf/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}"
-
- SO_LIBS="${aix_lib_specs} -lc"
-
- LDFLAGS="-L${loader_run_path}"
- EXTRA_LIBS="-ldl"
- ;;
-
- *-aix*)
- # No Position-Independent flags needed
- SO_CFLAGS=""
-
- # Use the installed export file or the one found in the source directory.
-
- if test -r "${TCL_LIB_DIR}/libtcl${TCL_LIB_VERSION}.exp" ; then
- tcl_exp="${TCL_LIB_DIR}/libtcl${TCL_LIB_VERSION}.exp"
- else
- tcl_exp="${TCL_SRC_DIR}/unix/lib.exp"
- fi
- if test -r "${TK_LIB_DIR}/libtk${TK_LIB_VERSION}.exp" ; then
- tk_exp="${TK_LIB_DIR}/libtk${TK_LIB_VERSION}.exp"
- else
- tk_exp="${TK_SRC_DIR}/unix/lib.exp"
- fi
-
- full_src_path=`cd ${srcdir}/cf; pwd`
-
- # Use shell-script to link shared library
-
- SO_LD="${full_src_path}/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}"
-
- SO_LIBS="${aix_lib_specs} -lc"
-
- LDFLAGS="-L${loader_run_path}"
- EXTRA_LIBS="-lld"
- ;;
-
- *-bsdi2*|*-bsdi3*)
- SO_CFLAGS=""
- SO_LD="shlicc"
- SO_LDFLAGS="-r"
-
- EXTRA_LIBS="-ldl"
- ;;
-
- *-bsdi4*)
- SO_CFLAGS="-export-dynamic -fPIC"
- SO_LD="${CC}"
- SO_LDFLAGS='-shared -Wl,-E -Wl,-soname,$@'
- ;;
-
- *-*-cygwin* | *-*-mingw*)
- SO_LD="${CC}"
- SO_LDFLAGS='-shared -Wl,-E -Wl,--out-implib,$@'
- EXTRA_LIBS="-lwinspool"
- SO_EXT=".dll"
- LDFLAGS=""
- ;;
-
- *-*-darwin*)
- SO_CFLAGS="-fno-common"
- SO_EXT=".dylib"
- SO_LD="${CC}"
- SO_LDFLAGS="-dynamiclib"
-
- { echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5
-echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6; }
- save_LDFLAGS=$LDFLAGS
- LDFLAGS="$SO_LDFLAGS -Wl,-single_module"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-int i;
- ;
- return 0;
-}
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- single_module=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- single_module=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- if test "${single_module}" = "yes" ; then
- SO_LDFLAGS=$LDFLAGS
- fi
- { echo "$as_me:$LINENO: result: $single_module" >&5
-echo "${ECHO_T}$single_module" >&6; }
- SO_LIBRARY_PATH="DYLD_LIBRARY_PATH"
- LDFLAGS=""
- ;;
-
- *-dgux*)
- SO_CFLAGS="-K PIC"
- SO_LD="cc"
- SO_LDFLAGS="-G"
- EXTRA_LIBS="-ldl"
- ;;
-
- *-hpux*)
- if test "$blt_have_gcc" = "no" ; then
- DEFINES="$DEFINES -D_HPUX_SOURCE"
- fi
- if test "${blt_have_dld}" = "yes" ; then
- SO_CFLAGS="+Z"
- SO_LD="ld"
- SO_LDFLAGS="-b -E -n +s +b,${loader_run_path}:."
- SO_EXT=".sl"
-
- # The run path is included in both LDFLAGS and SO_LDFLAGS
- # because SO_LD is ld and LD is cc/gcc.
-
- LDFLAGS="-Wl,-E -Wl,+s,+b,${loader_run_path}:."
- EXTRA_LIBS="-ldld"
- fi
- ;;
-
- *-irix64-6.5*)
- SO_CFLAGS=""
- SO_LD="ld"
- SO_LDFLAGS="-32 -shared -rdata_shared"
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- ;;
-
- *-irix-56.*|*-irix64-*)
- SO_CFLAGS=""
- SO_LD="ld"
- SO_LDFLAGS="-shared -rdata_shared"
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- LDFLAGS=""
- if test "$blt_have_gcc" = "yes" ; then
- SO_CFLAGS="-mabi=n32 $SO_CFLAGS"
- SO_LDFLAGS="-mabi=n32 $SO_LDFLAGS"
- LDFLAGS="-mabi=n32 $LDFLAGS"
- else
- CFLAGS="-n32 $CFLAGS"
- LDFLAGS="-n32 $LDFLAGS"
- fi
- ;;
-
- *-linux*)
- SO_CFLAGS="-fPIC"
- SO_LD="${CC}"
- SO_LDFLAGS='-rdynamic -shared -Wl,-E -Wl,-soname,$@'
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
-
- LDFLAGS=""
- EXTRA_LIBS="-ldl"
- ;;
-
- *-mp-ras-02*)
- SO_CFLAGS="-G -K PIC"
- SO_LD="${CC}"
- SO_LDFLAGS=""
- ;;
-
- *-mp-ras-*)
- SO_CFLAGS="-G -K PIC"
- SO_LD="${CC}"
- SO_LDFLAGS="-Wl,-Bexport"
- ;;
-
- *-ncr-sysv4-*2*)
- SO_CFLAGS="-K PIC"
- SO_LD="cc"
- SO_LDFLAGS="-G"
-
- EXTRA_LIBS="-ldl"
- ;;
-
- *-ncr-sysv4*)
- SO_CFLAGS="-K PIC"
- SO_LD="cc"
- SO_LDFLAGS="-G -Wl,-Bexport"
-
- LDFLAGS="-Wl,-Bexport"
- EXTRA_LIBS="-ldl"
- ;;
-
- *-netbsd*|*-freebsd*|*-openbsd*)
- # Not available on all versions: check for include file.
- if test "${ac_cv_header_dlfcn_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for dlfcn.h" >&5
-echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dlfcn_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
-echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking dlfcn.h usability" >&5
-echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <dlfcn.h>
-_ACEOF
-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking dlfcn.h presence" >&5
-echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <dlfcn.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for dlfcn.h" >&5
-echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dlfcn_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_dlfcn_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
-echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; }
-
-fi
-if test $ac_cv_header_dlfcn_h = yes; then
- test_ok=yes
-else
- test_ok=no
-fi
-
-
- if test "$test_ok" = yes; then
- SO_CFLAGS="-fpic"
- SO_LD="ld"
- SO_LDFLAGS="-Bshareable -x"
- fi
- ;;
-
- *-nextstep*)
- SO_CFLAGS=""
- SO_LD="cc"
- SO_LDFLAGS="-nostdlib -r"
- ;;
-
- *-osf1-1.012*)
- # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
-
- SO_CFLAGS=""
-
- # Warning: Ugly Makefile Hack
- # Make package name same as library name
-
- SO_LD='ld -R -export $@:'
- ;;
-
- *-osf1-1.*)
- # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
-
- SO_CFLAGS="-fpic"
- SO_LD="ld -shared"
- ;;
-
- *-osf1V*)
- # Digital OSF/1
-
- SO_CFLAGS=""
- SO_LD='ld'
- SO_LDFLAGS='-shared -expect_unresolved "*"'
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- LDFLAGS=""
- ;;
-
- *-sco*)
- # Note, dlopen is available only on SCO 3.2.5 and greater. However,
- # this test works, since "uname -s" was non-standard in 3.2.4 and
- # below.
-
- SO_CFLAGS="-Kpic -belf"
- SO_LD="ld"
- SO_LDFLAGS="-G"
- LDFLAGS="-belf -Wl,-Bexport"
- ;;
-
- *-sni-sysv*)
-
- SO_CFLAGS="-K PIC"
- SO_LD="cc"
- SO_LDFLAGS="-G"
-
- EXTRA_LIBS="-ldl"
- ;;
-
- *-sunos4*)
-
- SO_CFLAGS="-PIC"
- SO_LD="ld"
- SO_LDFLAGS="-assert pure-text"
-
- EXTRA_LIBS="-ldl"
- ;;
-
- *-solaris2*)
-
- SO_CFLAGS="-KPIC"
- if test "${blt_with_gnu_ld}" = "yes" -a "$blt_have_gcc" = "yes" ; then
- SO_LD="gcc"
- SO_LDFLAGS='-rdynamic -shared -Wl,-E -Wl,-soname,$@'
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- else
- SO_LD="/usr/ccs/bin/ld"
- SO_LDFLAGS="-G -z text"
- LD_RUN_PATH="-R ${loader_run_path}"
- fi
- EXTRA_LIBS="-ldl"
- ;;
-
- *-mips-dde-sysv*)
-
- SO_CFLAGS="-KPIC"
- SO_LD="cc"
- SO_LDFLAGS="-G"
-
- EXTRA_LIBS="-ldl"
- ;;
-
- *-pc-sysv4* | *-unixware-5*)
- SO_CFLAGS="-G -KPIC"
- SO_LD="${CC}"
- SO_LDFLAGS=" -Wl,-Bexport"
- ;;
-
- *)
- build_shared="no"
- ;;
-
-esac
-
-# If we're running gcc, then set SO_CFLAGS flags for compiling
-# shared libraries for gcc, instead of those of the vendor's
-# compiler.
-
-
-if test "$blt_have_gcc" = "yes" ; then
- if test "$blt_platform_win32" = "no" ; then
- SO_CFLAGS="-fPIC"
- fi
-fi
-
-# We can't back link against static versions of Tcl/Tk.
-# If # ${TCL_SHARED_BUILD} can't be found or isn't "1", assume that
-# shared libraries weren't built.
-
-if test "${TCL_SHARED_BUILD}" != "1" ; then
- SO_LIBS=""
-fi
-
-if test "${build_shared}" = "yes" -a "$blt_enable_shared" = "yes"; then
- BLT_SO_CFLAGS="$SO_CFLAGS"
-
- BLT_TARGET="shared"
-
- BLT_SO_LD="$SO_LD"
-
- BLT_SO_LDFLAGS="$SO_LDFLAGS"
-
- BLT_SO_LIBS="$SO_LIBS"
-
- BLT_SO_EXT="$SO_EXT"
-
-
-else
- BLT_TARGET="static"
-
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define BLT_SO_EXT "$SO_EXT"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define BLT_SO_PREFIX "$SO_PREFIX"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define BLT_LIB_SUFFIX "$LIB_SUFFIX"
-_ACEOF
-
-BLT_SO_PREFIX="$SO_PREFIX"
-
-BLT_LIB_SUFFIX="$LIB_SUFFIX"
-
-
-
-
-if test "${blt_enable_stubs}" = "yes" ; then
-
-cat >>confdefs.h <<_ACEOF
-#define USE_TCL_STUBS 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define USE_TK_STUBS 1
-_ACEOF
-
- TCL_STUBS_SPEC="-L${TCL_LIB_DIR} -ltclstub${TCL_LIB_VERSION}"
-
- TK_STUBS_SPEC="-L${TK_LIB_DIR} -ltkstub${TK_LIB_VERSION}"
-
-fi
-
-if test "${blt_platform_win32}" = "yes" ; then
-
-cat >>confdefs.h <<_ACEOF
-#define WIN32 1
-_ACEOF
-
-fi
-WIN32=${blt_platform_win32}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-INCLUDES=${INC_SPECS}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#--------------------------------------------------------------------
-# The BLT script directory was either specified or we
-# assume <prefix>/lib
-#--------------------------------------------------------------------
-if test "x${blt_with_scriptdir}" = "x" ; then
- BLT_LIBRARY="${prefix}/lib/blt${BLT_VERSION}"
-else
- BLT_LIBRARY="${blt_with_scriptdir}/blt${BLT_VERSION}"
-fi
-
-
-#--------------------------------------------------------------------
-# Print out some of the more important settings
-#--------------------------------------------------------------------
-echo ""
-echo "Configuration results:"
-echo ""
-echo " tcl.h found in $TCL_INC_SPEC"
-echo " tk.h found in $TK_INC_SPEC"
-echo " X11/Xlib.h found in $x_includes"
-echo " libtcl${TCL_LIB_VERSION} found in $TCL_LIB_SPEC"
-echo " libtk${TK_LIB_VERSION} found in $TK_LIB_SPEC"
-echo " libX11 found in $x_libraries"
-echo ""
-echo "Directories where BLT is to be installed:"
-echo ""
-echo " \"\$prefix\" is $prefix"
-echo " \"\$exec_prefix\" is $exec_prefix"
-echo ""
-echo " shells to be installed in $bindir"
-echo " libraries to be installed in $libdir"
-echo " scripts to be installed in $BLT_LIBRARY"
-echo " manual pages to be installed in $mandir"
-echo " MYSQL_LIB_SPEC=$MYSQL_LIB_SPEC"
-echo " MYSQL_INC_SPEC=$MYSQL_INC_SPEC"
-echo " EXPAT_LIB_SPEC=$EXPAT_LIB_SPEC"
-echo " EXPAT_INC_SPEC=$EXPAT_INC_SPEC"
-echo " FT2_LIB_SPEC=$FT2_LIB_SPEC"
-echo " FT2_INC_SPEC=$FT2_INC_SPEC"
-echo " JPG_LIB_SPEC=$JPG_LIB_SPEC"
-echo " JPG_INC_SPEC=$JPG_INC_SPEC"
-echo ""
-
-#--------------------------------------------------------------------
-#
-# Generate the following Makefiles
-#
-# ./Makefile
-# ./src/Makefile
-# ./src/shared/Makefile
-# ./man/Makefile
-# ./library/Makefile
-# ./demos/Makefile
-#
-#--------------------------------------------------------------------
-src_Makefile="src/Makefile"
-
-case ${blt_platform} in
- "win")
- src_Makefile="src/Makefile:src/Makefile-cyg.in"
- ;;
- "macosx")
- src_Makefile="src/Makefile:src/Makefile-macosx.in"
- ;;
- *)
- ;;
-esac
-
-# --------------------------------------------------------------
-# List of files to have be generated from <name>.in files with
-# autoconf substitutions.
-# --------------------------------------------------------------
-ac_config_files="$ac_config_files Makefile ${src_Makefile} src/bltHash.h src/shared/Makefile man/Makefile library/Makefile library/afm/Makefile demos/Makefile"
-
-
-
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-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=`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.
- ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $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}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## 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=:
- # Zsh 3.x and 4.x performs 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
-
-
-
-
-# PATH needs CR
-# 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
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-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.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-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
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-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
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. 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" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # 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
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-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
-fi
-echo >conf$$.file
-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 -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-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=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# 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
-
-# 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 $as_me, which was
-generated by GNU Autoconf 2.61. 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
-
-cat >>$CONFIG_STATUS <<_ACEOF
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- -q, --quiet 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
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Report bugs to <bug-autoconf at gnu.org>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.61,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2006 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'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-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=$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 )
- echo "$ac_cs_version"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- { echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- 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.
- -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$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
-if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
- export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "${src_Makefile}") CONFIG_FILES="$CONFIG_FILES ${src_Makefile}" ;;
- "src/bltHash.h") CONFIG_FILES="$CONFIG_FILES src/bltHash.h" ;;
- "src/shared/Makefile") CONFIG_FILES="$CONFIG_FILES src/shared/Makefile" ;;
- "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
- "library/Makefile") CONFIG_FILES="$CONFIG_FILES library/Makefile" ;;
- "library/afm/Makefile") CONFIG_FILES="$CONFIG_FILES library/afm/Makefile" ;;
- "demos/Makefile") CONFIG_FILES="$CONFIG_FILES demos/Makefile" ;;
-
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- 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
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-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=
- trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
-' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "$CONFIG_FILES"; then
-
-_ACEOF
-
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-build!$build$ac_delim
-build_cpu!$build_cpu$ac_delim
-build_vendor!$build_vendor$ac_delim
-build_os!$build_os$ac_delim
-host!$host$ac_delim
-host_cpu!$host_cpu$ac_delim
-host_vendor!$host_vendor$ac_delim
-host_os!$host_os$ac_delim
-target!$target$ac_delim
-target_cpu!$target_cpu$ac_delim
-target_vendor!$target_vendor$ac_delim
-target_os!$target_os$ac_delim
-ac_prefix_program!$ac_prefix_program$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-CPP!$CPP$ac_delim
-AWK!$AWK$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-RANLIB!$RANLIB$ac_delim
-LN_S!$LN_S$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-SIZEOF_INT!$SIZEOF_INT$ac_delim
-SIZEOF_LONG!$SIZEOF_LONG$ac_delim
-SIZEOF_LONG_LONG!$SIZEOF_LONG_LONG$ac_delim
-SIZEOF_VOID_P!$SIZEOF_VOID_P$ac_delim
-SIZEOF_FLOAT!$SIZEOF_FLOAT$ac_delim
-XMKMF!$XMKMF$ac_delim
-HAVE_INTTYPES_H!$HAVE_INTTYPES_H$ac_delim
-BLT_SO_CFLAGS!$BLT_SO_CFLAGS$ac_delim
-BLT_TARGET!$BLT_TARGET$ac_delim
-BLT_SO_LD!$BLT_SO_LD$ac_delim
-BLT_SO_LDFLAGS!$BLT_SO_LDFLAGS$ac_delim
-BLT_SO_LIBS!$BLT_SO_LIBS$ac_delim
-BLT_SO_EXT!$BLT_SO_EXT$ac_delim
-LD_RUN_PATH!$LD_RUN_PATH$ac_delim
-BLT_SO_PREFIX!$BLT_SO_PREFIX$ac_delim
-BLT_LIB_SUFFIX!$BLT_LIB_SUFFIX$ac_delim
-IMPLIB_PREFIX!$IMPLIB_PREFIX$ac_delim
-IMPLIB_EXT!$IMPLIB_EXT$ac_delim
-TCL_STUBS_SPEC!$TCL_STUBS_SPEC$ac_delim
-TK_STUBS_SPEC!$TK_STUBS_SPEC$ac_delim
-WIN32!$WIN32$ac_delim
-AUX_LIBS!$AUX_LIBS$ac_delim
-BLT_MAJOR_VERSION!$BLT_MAJOR_VERSION$ac_delim
-BLT_MINOR_VERSION!$BLT_MINOR_VERSION$ac_delim
-BLT_VERSION!$BLT_VERSION$ac_delim
-DEFINES!$DEFINES$ac_delim
-DLL_PREFIX!$DLL_PREFIX$ac_delim
-EXPAT_INC_SPEC!$EXPAT_INC_SPEC$ac_delim
-EXPAT_LIB_SPEC!$EXPAT_LIB_SPEC$ac_delim
-EXTRA_LIBS!$EXTRA_LIBS$ac_delim
-FT2_INC_SPEC!$FT2_INC_SPEC$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-CEOF$ac_eof
-_ACEOF
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-FT2_LIB_SPEC!$FT2_LIB_SPEC$ac_delim
-FTCFG_LIB_SPEC!$FTCFG_LIB_SPEC$ac_delim
-GCCFLAGS!$GCCFLAGS$ac_delim
-INCLUDES!$INCLUDES$ac_delim
-JPG_INC_SPEC!$JPG_INC_SPEC$ac_delim
-JPG_LIB_SPEC!$JPG_LIB_SPEC$ac_delim
-LIB_PREFIX!$LIB_PREFIX$ac_delim
-LIB_SUFFIX!$LIB_SUFFIX$ac_delim
-MYSQL_INC_SPEC!$MYSQL_INC_SPEC$ac_delim
-MYSQL_LIB_SPEC!$MYSQL_LIB_SPEC$ac_delim
-PNG_INC_SPEC!$PNG_INC_SPEC$ac_delim
-PNG_LIB_SPEC!$PNG_LIB_SPEC$ac_delim
-TCL_DBGX!$TCL_DBGX$ac_delim
-TCL_INC_SPEC!$TCL_INC_SPEC$ac_delim
-TCL_LIB_DIR!$TCL_LIB_DIR$ac_delim
-TCL_LIB_SPEC!$TCL_LIB_SPEC$ac_delim
-TCL_VERSION!$TCL_VERSION$ac_delim
-TIF_INC_SPEC!$TIF_INC_SPEC$ac_delim
-TIF_LIB_SPEC!$TIF_LIB_SPEC$ac_delim
-TK_INC_SPEC!$TK_INC_SPEC$ac_delim
-TK_LIB_SPEC!$TK_LIB_SPEC$ac_delim
-TK_XLIBSW!$TK_XLIBSW$ac_delim
-X11_INC_SPEC!$X11_INC_SPEC$ac_delim
-X11_LIB_SPEC!$X11_LIB_SPEC$ac_delim
-XAU_LIB_SPEC!$XAU_LIB_SPEC$ac_delim
-XDMCP_LIB_SPEC!$XDMCP_LIB_SPEC$ac_delim
-XFT_INC_SPEC!$XFT_INC_SPEC$ac_delim
-XFT_LIB_SPEC!$XFT_LIB_SPEC$ac_delim
-XPM_INC_SPEC!$XPM_INC_SPEC$ac_delim
-XPM_LIB_SPEC!$XPM_LIB_SPEC$ac_delim
-XRANDR_LIB_SPEC!$XRANDR_LIB_SPEC$ac_delim
-XRENDER_LIB_SPEC!$XRENDER_LIB_SPEC$ac_delim
-Z_LIB_SPEC!$Z_LIB_SPEC$ac_delim
-BLT_LIBRARY!$BLT_LIBRARY$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 36; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
-_ACEOF
-
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ 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[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
-s/:*$//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-fi # test -n "$CONFIG_FILES"
-
-
-for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
- { (exit 1); exit 1; }; };;
- :[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="$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 ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
- { (exit 1); exit 1; }; };;
- esac
- ac_file_inputs="$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 "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- fi
-
- case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
- 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 ||
-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"
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`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 ||
-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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`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
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# 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=
-
-case `sed -n '/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- 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
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
-s&@top_builddir@&$ac_top_builddir_sub&;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
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
-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 "$tmp/stdin"
- case $ac_file in
- -) cat "$tmp/out"; rm -f "$tmp/out";;
- *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
- esac
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
-_ACEOF
-
-# Transform confdefs.h into a sed script `conftest.defines', that
-# substitutes the proper values into config.h.in to produce config.h.
-rm -f conftest.defines conftest.tail
-# First, append a space to every undef/define line, to ease matching.
-echo 's/$/ /' >conftest.defines
-# Then, protect against being on the right side of a sed subst, or in
-# an unquoted here document, in config.status. If some macros were
-# called several times there might be several #defines for the same
-# symbol, which is useless. But do not sort them, since the last
-# AC_DEFINE must be honored.
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
-# NAME is the cpp macro being defined, VALUE is the value it is being given.
-# PARAMS is the parameter list in the macro definition--in most cases, it's
-# just an empty string.
-ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
-ac_dB='\\)[ (].*,\\1define\\2'
-ac_dC=' '
-ac_dD=' ,'
-
-uniq confdefs.h |
- sed -n '
- t rset
- :rset
- s/^[ ]*#[ ]*define[ ][ ]*//
- t ok
- d
- :ok
- s/[\\&,]/\\&/g
- s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
- s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
- ' >>conftest.defines
-
-# Remove the space that was appended to ease matching.
-# Then replace #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-# (The regexp can be short, since the line contains either #define or #undef.)
-echo 's/ $//
-s,^[ #]*u.*,/* & */,' >>conftest.defines
-
-# Break up conftest.defines:
-ac_max_sed_lines=50
-
-# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
-# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
-# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
-# et cetera.
-ac_in='$ac_file_inputs'
-ac_out='"$tmp/out1"'
-ac_nxt='"$tmp/out2"'
-
-while :
-do
- # Write a here document:
- cat >>$CONFIG_STATUS <<_ACEOF
- # First, check the format of the line:
- cat >"\$tmp/defines.sed" <<\\CEOF
-/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
-/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
-b
-:def
-_ACEOF
- sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
- echo 'CEOF
- sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
- ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
- sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
- grep . conftest.tail >/dev/null || break
- rm -f conftest.defines
- mv conftest.tail conftest.defines
-done
-rm -f conftest.defines conftest.tail
-
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
-cat >>$CONFIG_STATUS <<\_ACEOF
- if test x"$ac_file" != x-; then
- echo "/* $configure_input */" >"$tmp/config.h"
- cat "$ac_result" >>"$tmp/config.h"
- if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f $ac_file
- mv "$tmp/config.h" $ac_file
- fi
- else
- echo "/* $configure_input */"
- cat "$ac_result"
- fi
- rm -f "$tmp/out12"
- ;;
-
-
- esac
-
-done # for ac_tag
-
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# 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 || { (exit 1); exit 1; }
-fi
-
-
diff --git a/blt3.0.1/configure.in b/blt3.0.1/configure.in
deleted file mode 100644
index 02d9f13..0000000
--- a/blt3.0.1/configure.in
+++ /dev/null
@@ -1,1824 +0,0 @@
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-AC_INIT(src/bltInit.c)
-AC_CONFIG_HEADER(src/config.h)
-AC_CONFIG_AUX_DIR(cf)
-AC_PREREQ(2.0)
-
-# -----------------------------------------------------------------------
-#
-# Handle command line options
-#
-# --with-tcl=DIR
-# --with-tk=DIR
-# --with-cflags=flags This is probably for me only
-# --with-gnu-ld
-#
-# -----------------------------------------------------------------------
-
-INC_SPECS=""
-loader_run_path=""
-DEFINES=""
-
-
-blt_enable_symbols="no"
-blt_enable_shared="yes"
-blt_with_expat_include_dir="yes"
-blt_with_expat_lib_dir="yes"
-blt_with_ft2_include_dir="yes"
-blt_with_ft2_lib_dir="yes"
-blt_with_gnu_ld="no"
-blt_with_jpeg_include_dir="yes"
-blt_with_jpeg_lib_dir="yes"
-blt_with_mysql_include_dir="yes"
-blt_with_mysql_lib_dir="yes"
-blt_with_png_include_dir="yes"
-blt_with_png_lib_dir="yes"
-blt_with_z_lib_dir="yes"
-blt_with_scriptdir=""
-blt_with_tcl=""
-blt_with_tcl_include_dir="yes"
-blt_with_tcl_lib_dir="yes"
-blt_with_tiff_include_dir="yes"
-blt_with_tiff_lib_dir="yes"
-blt_with_tk=""
-blt_with_tk_include_dir="yes"
-blt_with_tk_lib_dir="yes"
-blt_with_xft_include_dir="yes"
-blt_with_xft_lib_dir="yes"
-blt_with_xpm_include_dir="yes"
-blt_with_xpm_lib_dir="yes"
-blt_with_xrandr_include_dir="yes"
-blt_with_xrandr_lib_dir="yes"
-
-AC_ARG_WITH(blt,
- [AS_HELP_STRING([--with-blt=DIR],[install BLT scripts in DIR])],
- [blt_with_scriptdir=$withval])
-AC_ARG_WITH(tcl,
- [AS_HELP_STRING([--with-tcl=DIR],[find tclConfig.sh in DIR])],
- [ blt_with_tcl=$withval])
-AC_ARG_WITH(tk,
- [AS_HELP_STRING([--with-tk=DIR],[find tkConfig.sh in DIR])],
- [ blt_with_tk=$withval])
-AC_ARG_WITH(tclincdir,
- [AS_HELP_STRING([--with-tclincdir=DIR],[find Tcl includes in DIR])],
- [blt_with_tcl_include_dir=$withval])
-AC_ARG_WITH(tkincdir,
- [AS_HELP_STRING([--with-tkincdir=DIR],[find Tk includes in DIR])],
- [blt_with_tk_include_dir=$withval])
-AC_ARG_WITH(tcllibdir,
- [AS_HELP_STRING([--with-tcllibdir=DIR],[find Tcl libraries in DIR])],
- [blt_with_tcl_lib_dir=$withval])
-AC_ARG_WITH(tklibdir,
- [AS_HELP_STRING([--with-tklibdir=DIR],[find Tk libraries in DIR])],
- [blt_with_tk_lib_dir=$withval])
-AC_ARG_WITH(jpegincdir,
- [AS_HELP_STRING([--with-jpegincdir=DIR],[find JPEG headers in DIR])],
- [unset ac_cv_header_jpeglib_h; blt_with_jpeg_include_dir=$withval])
-AC_ARG_WITH(jpeglibdir,
- [AS_HELP_STRING([--with-jpeglibdir=DIR],[find JPEG libraries in DIR])],
- [unset ac_cv_lib_jpeg ac_cv_lib_jpeg_jpeg_read_header
- blt_with_jpeg_lib_dir=$withval])
-
-# --with-tiffincdir
-AC_ARG_WITH(tiffincdir,
- [AS_HELP_STRING([--with-tiffincdir=DIR],[find TIFF headers in DIR])],
- [blt_with_tiff_include_dir=$withval])
-# --with-tifflibdir
-AC_ARG_WITH(tifflibdir,
- [AS_HELP_STRING([--with-tifflibdir=DIR],[find TIFF libraries in DIR])],
- [blt_with_tiff_lib_dir=$withval])
-# --with-pngincdir
-AC_ARG_WITH(pngincdir,
- [AS_HELP_STRING([--with-pngincdir=DIR],[find PNG headers in DIR])],
- [blt_with_png_include_dir=$withval])
-# --with-pnglibdir
-AC_ARG_WITH(pnglibdir,
- [AS_HELP_STRING([--with-pnglibdir=DIR],[find PNG libraries in DIR])],
- [blt_with_png_lib_dir=$withval])
-# --with-zlibdir
-AC_ARG_WITH(zlibdir,
- [AS_HELP_STRING([--with-zlibdir=DIR],[find zlib libraries in DIR])],
- [blt_with_z_lib_dir=$withval])
-# --with-xpmincdir
-AC_ARG_WITH(xpmincdir,
- [AS_HELP_STRING([--with-xpmincdir=DIR],[find XPM headers in DIR])],
- [blt_with_xpm_include_dir=$withval])
-# --with-xpmlibdir
-AC_ARG_WITH(xpmlibdir,
- [AS_HELP_STRING([--with-xpmlibdir=DIR],[find XPM libraries in DIR])],
- [blt_with_xpm_lib_dir=$withval])
-# --with-freetype2incdir
-AC_ARG_WITH(freetype2incdir,
- [AS_HELP_STRING([--with-freetype2incdir=DIR],[find freetype2 headers in DIR])],
- [blt_with_ft2_include_dir=$withval])
-# --with-freetype2libdir
-AC_ARG_WITH(freetype2libdir,
- [AS_HELP_STRING([--with-freetype2libdir=DIR],[find freetype2 libraries in DIR])],
- [blt_with_ft2_lib_dir=$withval])
-# --with-xftincdir
-AC_ARG_WITH(xftincdir,
- [AS_HELP_STRING([--with-xftincdir=DIR],[find Xft headers in DIR])],
- [blt_with_xft_include_dir=$withval])
-# --with-xftlibdir
-AC_ARG_WITH(xftlibdir,
- [AS_HELP_STRING([--with-xftlibdir=DIR],[find Xft libraries in DIR])],
- [blt_with_xft_lib_dir=$withval])
-# --with-xrandrincdir
-AC_ARG_WITH(xrandrincdir,
- [AS_HELP_STRING([--with-xrandrincdir=DIR],[find Xrandr headers in DIR])],
- [blt_with_xrandr_include_dir=$withval])
-# --with-xrandrlibdir
-AC_ARG_WITH(xrandrlibdir,
- [AS_HELP_STRING([--with-xrandrlibdir=DIR],[find Xrandr libraries in DIR])],
- [blt_with_xrandr_lib_dir=$withval])
-# --with-expatincdir
-AC_ARG_WITH(expatincdir,
- [AS_HELP_STRING([--with-expatincdir=DIR],[find expat headers in DIR])],
- [blt_with_expat_include_dir=$withval])
-# --with-expatlibdir
-AC_ARG_WITH(expatlibdir,
- [AS_HELP_STRING([--with-expatlibdir=DIR],[find expat libraries in DIR])],
- [blt_with_expat_lib_dir=$withval])
-# --with-mysqlincdir
-AC_ARG_WITH(mysqlincdir,
- [AS_HELP_STRING([--with-mysqlincdir=DIR],[find mysql headers in DIR])],
- [blt_with_mysql_include_dir=$withval])
-# --with-mysqllibdir
-AC_ARG_WITH(mysqllibdir,
- [AS_HELP_STRING([--with-mysqllibdir=DIR],[find mysql libraries in DIR])],
- [blt_with_mysql_lib_dir=$withval])
-
-AC_ARG_WITH(gnu_ld,
- [AS_HELP_STRING([--with-gnu-ld], [use GNU linker])],
- [blt_with_gnu_ld="yes"])
-
-AC_ARG_ENABLE(shared,
- [AS_HELP_STRING([--enable-shared],[created shared libraries])],
- [blt_enable_shared=$enableval])
-
-AC_ARG_ENABLE(symbols,
- [AS_HELP_STRING([--enable-symbols],[compile with debugging symbols])],
- [blt_enable_symbols=$enableval])
-AC_ARG_ENABLE(stubs,
- [AS_HELP_STRING([--enable-stubs],[compile with stubbed version of Tcl library])],
- [blt_enable_stubs=$enableval])
-
-EXPAT_INC_SPEC=""
-EXPAT_LIB_SPEC=""
-FTCFG_LIB_SPEC=""
-FT2_INC_SPEC=""
-FT2_LIB_SPEC=""
-XFT_INC_SPEC=""
-XFT_LIB_SPEC=""
-JPG_INC_SPEC=""
-JPG_LIB_SPEC=""
-MYSQL_INC_SPEC=""
-MYSQL_LIB_SPEC=""
-PNG_INC_SPEC=""
-PNG_LIB_SPEC=""
-TCL_INC_SPEC=""
-TCL_LIB_SPEC=""
-TIF_INC_SPEC=""
-TIF_LIB_SPEC=""
-TK_INC_SPEC=""
-TK_LIB_SPEC=""
-XPM_INC_SPEC=""
-XPM_LIB_SPEC=""
-XRANDR_INC_SPEC=""
-XRANDR_LIB_SPEC=""
-XRENDER_LIB_SPEC=""
-XAU_LIB_SPEC=""
-XDMCP_LIB_SPEC=""
-Z_LIB_SPEC=""
-
-AC_CANONICAL_TARGET
-AC_PREFIX_PROGRAM(wish)
-
-# -----------------------------------------------------------------------
-# Set a variable containing current working directory if /bin/sh
-# doesn't do it already.
-# -----------------------------------------------------------------------
-
-PWD=`pwd`
-
-# -----------------------------------------------------------------------
-# Programs: Check for existence of ranlib and install programs
-# -----------------------------------------------------------------------
-# -----------------------------------------------------------------------
-# C compiler and debugging flags
-# -----------------------------------------------------------------------
-
-if test "x${CC}" = "x" ; then
- CC=cc
-fi
-
-AC_PROG_CC
-AC_PROG_CPP
-
-if test "x${GCC}" != "x" ; then
- blt_have_gcc="yes"
-fi
-
-case $host_os in
- *cygwin* | *mingw*)
- blt_platform_win32="yes"
- AC_MSG_CHECKING([if using MinGW compiler])
- AC_TRY_COMPILE([], [
-#ifndef __MINGW32__
- _cc_is_not_mingw_
-#endif
-], [blt_have_mingw=yes], [blt_have_mingw=no])
- AC_MSG_RESULT([$blt_have_mingw])
- ;;
- * )
- blt_platform_win32="no"
- ;;
-esac
-
-AC_PROG_CPP
-if test "x${GCC}" != "x" ; then
- blt_have_gcc="yes"
-else
- AC_MSG_CHECKING([if C compiler is really gcc])
- AC_TRY_COMPILE([], [
-#ifndef __GNUC__
- _cc_is_not_gcc_
-#endif
-], [blt_have_gcc=yes], [blt_have_gcc=no])
- AC_MSG_RESULT([$blt_have_gcc])
-fi
-
-AC_PROG_AWK
-AC_PROG_INSTALL
-AC_PROG_RANLIB
-AC_PROG_LN_S
-AC_PROG_MKDIR_P
-AC_EGREP_CPP
-
-#
-# CFLAGS search order
-#
-# 1. command line (--with-cflags)
-# 2. cached variable ($blt_cv_prog_cflags)
-# 3. set to "-O3" if using gcc ($blt_have_gcc)
-# 4. otherwise, default to "-O"
-#
-
-# Setup default flags for the compiler.
-case $target:$blt_have_gcc:$blt_enable_symbols in
- *-solaris2*:no:yes)
- CFLAGS="-g -xs -O"
- ;;
- *:yes:no)
- CFLAGS="-O3"
- ;;
- *:yes:yes)
- CFLAGS="-g -O3"
- ;;
- *:no:no)
- CFLAGS="-O"
- ;;
- *)
- CFLAGS="-g -O3"
- ;;
-esac
-
-GCCFLAGS=""
-if test "${blt_have_gcc}" = "yes" ; then
- GCCFLAGS="-Wall -Wpointer-arith -Wno-uninitialized -Wmissing-declarations -Wimplicit -Wwrite-strings -Wmissing-prototypes -Wundef"
-fi
-
-SO_PREFIX=""
-SO_EXT=""
-IMPLIB_SUFFIX=""
-IMPLIB_EXT=""
-
-case $target in
- *-*-cygwin*|*-*-mingw*)
- blt_platform="win"
- if test "${blt_have_mingw}" = "yes" ; then
- SO_PREFIX=""
- SO_EXT=".dll"
- IMPLIB_EXT=".lib"
- IMPLIB_PREFIX=""
- else
- SO_PREFIX="cyg"
- SO_EXT=".dll"
- IMPLIB_EXT=".dll.a"
- IMPLIB_PREFIX="lib"
- fi
- ;;
- *-hpux*)
- SO_EXT=".sl"
- blt_platform="unix"
- SO_PREFIX="lib"
- IMPLIB_SUFFIX=""
- IMPLIB_EXT=""
- ;;
- *-*-darwin*)
- blt_platform="macosx"
- SO_EXT=".dylib"
- SO_PREFIX="lib"
- IMPLIB_SUFFIX=""
- IMPLIB_EXT=""
- ;;
- *)
- blt_platform="unix"
- SO_PREFIX="lib"
- SO_EXT=".so"
- IMPLIB_SUFFIX=""
- IMPLIB_EXT=""
- ;;
-esac
-
-build_shared="yes"
-if test $blt_enable_symbols = "yes" ; then
- LIB_SUFFIX=g
-fi
-
-# -----------------------------------------------------------------------
-# Hardware characteristics:
-# -----------------------------------------------------------------------
-
-AC_C_BIGENDIAN
-AC_CHECK_SIZEOF(int, 4)
-AC_CHECK_SIZEOF(long, 4)
-AC_CHECK_SIZEOF(long long, 8)
-AC_CHECK_SIZEOF(void *, 4)
-AC_CHECK_SIZEOF(float, 4)
-
-# Save the values as shell variables so that we can substitute them
-# into bltHash.h for situtations where there's no bltInt.h.
-
-AC_SUBST(SIZEOF_INT, ${ac_cv_sizeof_int})
-AC_SUBST(SIZEOF_LONG, ${ac_cv_sizeof_long})
-AC_SUBST(SIZEOF_LONG_LONG, ${ac_cv_sizeof_long_long})
-AC_SUBST(SIZEOF_VOID_P, ${ac_cv_sizeof_void_p})
-AC_SUBST(SIZEOF_FLOAT, ${ac_cv_sizeof_float})
-
-
-# -----------------------------------------------------------------------
-# Libraries:
-# -----------------------------------------------------------------------
-AC_CHECK_LIB(m, main)
-AC_CHECK_LIB(nsl, main)
-AC_CHECK_LIB(socket, main)
-AC_CHECK_LIB(dld, shl_load, [blt_have_dld=yes], [blt_have_dld=no])
-
-AC_PATH_X
-
-if test "x${x_libraries}" != "x" ; then
- xtop=`dirname ${x_libraries}`
- PATH=$xtop/bin:$PATH
-fi
-
-# -----------------------------------------------------------------------
-# Headers:
-# -----------------------------------------------------------------------
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_HEADER_TIME
-
-AC_CHECK_HEADERS(inttypes.h)
-if test "${ac_cv_header_inttypes_h}" = "yes" ; then
- AC_SUBST(HAVE_INTTYPES_H, ["#define HAVE_INTTYPES_H 1"])
-else
- AC_SUBST(HAVE_INTTYPES_H, ["/* can't find inttypes.h */"])
-fi
-AC_CHECK_HEADERS(limits.h sys/param.h)
-AC_CHECK_HEADERS(string.h ctype.h)
-AC_CHECK_HEADERS(errno.h float.h math.h ieeefp.h)
-AC_CHECK_HEADERS(sys/time.h waitflags.h sys/wait.h)
-AC_CHECK_HEADERS(malloc.h memory.h)
-AC_CHECK_HEADERS(setjmp.h)
-AC_CHECK_HEADERS(stdlib.h stddef.h unistd.h)
-AC_CHECK_HEADERS(stropts.h termios.h)
-
-AC_CHECK_FUNCS(posix_openpt ptsname getpt grantpt unlockpt isastream setsid)
-AC_CHECK_FUNCS(tcflush openpty)
-AC_CHECK_FUNCS(open_controlling_pty)
-
-# FREETYPE2 header
-if test "${blt_with_ft2_include_dir}" != "no" ; then
- ft2_inc_spec=`freetype-config --cflags`
-echo ft2_inc_spec=$ft2_inc_spec
- save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="${ft2_inc_spec}"
- AC_CHECK_HEADERS(ft2build.h, FT2_INC_SPEC=${ft2_inc_spec}, FT2_INC_SPEC="")
- CPPFLAGS=${save_CPPFLAGS}
-
- # Xft header
- if test "${blt_with_xft_include_dir}" != "no" ; then
- BLT_CHECK_HEADER(XFT, X11/Xft/Xft.h, $blt_with_xft_include_dir, ${ft2_inc_spec})
- fi
-fi
-
-# EXPAT header
-if test "${blt_with_expat_include_dir}" != "no" ; then
- BLT_CHECK_HEADER(EXPAT, expat.h, $blt_with_expat_include_dir)
-fi
-
-# MYSQL header
-if test "${blt_with_mysql_include_dir}" != "no" ; then
- BLT_CHECK_HEADER(MYSQL, mysql/mysql.h, $blt_with_mysql_include_dir)
-fi
-
-# XPM header
-if test "${blt_with_xpm_include_dir}" != "no" ; then
- BLT_CHECK_HEADER(XPM, X11/xpm.h, $blt_with_xpm_include_dir)
-fi
-
-# JPEG header
-if test "${blt_with_jpeg_include_dir}" != "no" ; then
- BLT_CHECK_HEADER(JPG, jpeglib.h, $blt_with_jpeg_include_dir)
-fi
-
-# TIFF header
-if test "${blt_with_tiff_include_dir}" != "no" ; then
- BLT_CHECK_HEADER(TIF, tiff.h, $blt_with_tiff_include_dir)
-fi
-
-# PNG header
-if test "${blt_with_png_include_dir}" != "no" ; then
- BLT_CHECK_HEADER(PNG, png.h, $blt_with_png_include_dir)
-fi
-
-# XRANDR header
-if test "${blt_with_xrandr_include_dir}" != "no" ; then
- BLT_CHECK_HEADER(XRANDR, X11/extensions/randr.h, $blt_with_xrandr_include_dir)
-fi
-
-# -----------------------------------------------------------------------
-# Types:
-# -----------------------------------------------------------------------
-AC_TYPE_SIZE_T
-AC_TYPE_PID_T
-
-AC_MSG_CHECKING([whether union wait is defined correctly])
-AC_CACHE_VAL(blt_cv_struct_wait_works,
- AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/wait.h>], [
- /*
- * Check whether <sys/wait.h> defines the type "union wait"
- * correctly. It's needed because of weirdness in HP-UX where
- * "union wait" is defined in both the BSD and SYS-V environments.
- * Checking the usability of WIFEXITED seems to do the trick.
- */
- union wait x;
- WIFEXITED(x); /* Generates compiler error if WIFEXITED
- * uses an int. */
-],
- [blt_cv_struct_wait_works="yes"],
- [blt_cv_struct_wait_works="no"]))
-
-if test "${blt_cv_struct_wait_works}" = "yes"; then
- AC_DEFINE([HAVE_UNION_WAIT], 1, [Define if 'wait' is a union.])
-fi
-AC_MSG_RESULT([$blt_cv_struct_wait_works])
-
-
-# -----------------------------------------------------------------------
-#
-# Library Functions: Check for drand48, and srand48.
-#
-# -----------------------------------------------------------------------
-
-AC_HAVE_FUNCS(strtolower strcasecmp strncasecmp drand48 srand48 finite isnan)
-
-# For HPUX it's a little more complicated to search for isfinite
-AC_MSG_CHECKING([for isfinite])
-AC_CACHE_VAL(blt_cv_have_isfinite,
- AC_TRY_LINK([#include <math.h>], [
-double x = 1.0;
-if (isfinite(x)) {
- return 0;
-}
-], [blt_cv_have_isfinite="yes"], [blt_cv_have_isfinite="no"]))
-
-if test "${blt_cv_have_isfinite}" = "yes"; then
- AC_DEFINE([HAVE_ISFINITE], 1, [Define if we have a working 'isinfinite'.])
-fi
-AC_MSG_RESULT([$blt_cv_have_isfinite])
-
-# -----------------------------------------------------------------------
-#
-# Check the smallest value such that 1.0 + x != 1.0.
-# For ANSI compilers this is DBL_EPSILON in float.h
-#
-#--------------------------------------------------------------------
-
-AC_MSG_CHECKING([whether DBL_EPSILON is defined in float.h])
-AC_CACHE_VAL(blt_cv_found_dbl_epsilon,
- AC_TRY_COMPILE([
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
-], [
-#ifdef DBL_EPSILON
- exit(0);
-#else
- exit(1);
-#endif
-], blt_cv_found_dbl_epsilon=yes, blt_cv_found_dbl_epsilon=no)
-)
-AC_MSG_RESULT([${blt_cv_found_dbl_epsilon}])
-
-if test "${blt_cv_found_dbl_epsilon}" = "no" ; then
- AC_CACHE_VAL([blt_cv_dbl_epsilon],
- old_flags="$CFLAGS"
- CFLAGS="-lm"
- AC_MSG_CHECKING([whether DBL_EPSILON can be computed.])
- BLT_RUN_WITH_OUTPUT([blt_cv_dbl_epsilon], [
-main () {
- double e, u;
- /*
- * Check the smallest value such that 1.0 + x != 1.0.
- * For ANSI compilers this is DBL_EPSILON in float.h
- */
- u = 1.0;
- for(;;) {
- u *= 0.5;
- if ((1.0 + u) == 1.0) {
- break;
- }
- }
- e = u * 2.0;
- printf("%.17e\n", e);
- exit(0);
-}])
- CFLAGS="$old_flags"
- AC_DEFINE_UNQUOTED([BLT_DBL_EPSILON], ${blt_cv_dbl_epsilon},
- [Define the smallest machine value DBL_EPILSON.])
- AC_MSG_RESULT([${blt_cv_dbl_epsilon}])
-)
-fi
-
-
-AC_CHECK_DECLS(strcasecmp,,,[
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-])
-
-AC_CHECK_DECLS(strncasecmp,,,[
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-])
-
-AC_CHECK_DECLS(strtolower,,,[
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-])
-
-AC_CHECK_DECLS(drand48,,,[
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-])
-AC_CHECK_DECLS(srand48,,,[
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-])
-AC_CHECK_DECLS(j1,,,[
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-])
-AC_CHECK_DECLS(hypot,,,[
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-])
-AC_CHECK_DECLS(isnan,,,[
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-])
-AC_CHECK_DECLS(isfinite,,,[
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-])
-AC_CHECK_DECLS(finite,,,[
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-])
-AC_CHECK_DECLS(free,,,[
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-])
-
-# -----------------------------------------------------------------------
-#
-# System services: X, Tcl, Tk
-#
-# -----------------------------------------------------------------------
-
-if test "x${x_libraries}" = "x" ; then
- X11_LIB_SPEC="-lX11"
-else
- X11_LIB_SPEC="-L${x_libraries} -lX11"
-fi
-if test "x${x_includes}" = "x" ; then
- X11_INC_SPEC=""
-else
- X11_INC_SPEC="-I${x_includes}"
-fi
-
-case "$target_cpu" in
- [i[3-9]86|x86*|k5|k6|k6-2|k6-3|pentium*|athlon*])
- AC_DEFINE([HAVE_X86], 1, [Define if we're compiling for an X86.])
- ;;
- *)
- ;;
-esac
-
-# -----------------------------------------------------------------------
-#
-# Find the Tcl build configuration file "tclConfig.sh"
-#
-# -----------------------------------------------------------------------
-
-AC_MSG_CHECKING([for tclConfig.sh])
-tcl_config_sh=""
-if test "x$blt_with_tcl" != "x" ; then
-
- # Verify that a tclConfig.sh file exists in the directory specified
- # by --with-tcl.
-
- for dir in \
- $blt_with_tcl
- do
- if test -r "$dir/tclConfig.sh" ; then
- tcl_config_sh="$dir/tclConfig.sh"
- break
- elif test -r "$dir/lib/tclConfig.sh" ; then
- tcl_config_sh="$dir/lib/tclConfig.sh"
- break
- elif test -r "$dir/$blt_platform/tclConfig.sh" ; then
- tcl_config_sh="$dir/$blt_platform/tclConfig.sh"
- break
- fi
- done
-elif test "${blt_with_tcl_include_dir}" = "yes" -a \
- "${blt_with_tcl_lib_dir}" = "yes" ; then
-
- # Otherwise, search for Tcl configuration file.
-
- # 1. Search previously named locations.
-
- for dir in \
- $prefix \
- $exec_prefix \
- $blt_cv_tcl_lib
- do
- if test -r "$dir/tclConfig.sh" ; then
- tcl_config_sh="$dir/tclConfig.sh"
- break
- elif test -r "$dir/lib/tclConfig.sh" ; then
- tcl_config_sh="$dir/lib/tclConfig.sh"
- break
- elif test -r "$dir/$blt_platform/tclConfig.sh" ; then
- tcl_config_sh="$dir/$blt_platform/tclConfig.sh"
- break
- fi
- done
-
- # 2. Search source directories.
-
- if test "x$tcl_config_sh" = "x" ; then
- for dir in \
- `ls -dr ../tcl[[7-9]].[[0-9]]* 2>/dev/null` \
- ../tcl \
- `ls -dr ../../tcl[[7-9]].[[0-9]]* 2>/dev/null` \
- ../../tcl \
- `ls -dr ../../../tcl[[7-9]].[[0-9]]* 2>/dev/null` \
- ../../../tcl
- do
- if test -r "$dir/$blt_platform/tclConfig.sh" ; then
- tcl_config_sh="$dir/$blt_platform/tclConfig.sh"
- break
- fi
- done
- fi
-
- # 3. Search standard locations.
-
- if test "x$tcl_config_sh" = "x" ; then
- for dir in \
- /usr/local \
- /usr
- do
- if test -r "$dir/tclConfig.sh" ; then
- tcl_config_sh="$dir/tclConfig.sh"
- break
- elif test -r "$dir/lib/tclConfig.sh" ; then
- tcl_config_sh="$dir/lib/tclConfig.sh"
- break
- fi
- done
- fi
-fi
-
-AC_MSG_RESULT([${tcl_config_sh}])
-
-
-# -----------------------------------------------------------------------
-#
-# Find the Tk build configuration file "tkConfig.sh"
-#
-# -----------------------------------------------------------------------
-
-AC_MSG_CHECKING([for tkConfig.sh])
-tk_config_sh=""
-if test "x$blt_with_tk" != "x" -o "x$blt_with_tcl" != "x"; then
-
- # Verify that a tkConfig.sh file exists in the directory specified
- # by --with-tcl or --with-tk.
-
- for dir in \
- $blt_with_tk \
- $blt_with_tcl
- do
- if test -r "$dir/tkConfig.sh" ; then
- tk_config_sh="$dir/tkConfig.sh"
- break
- elif test -r "$dir/lib/tkConfig.sh" ; then
- tk_config_sh="$dir/lib/tkConfig.sh"
- break
- elif test -r "$dir/$blt_platform/tkConfig.sh" ; then
- tk_config_sh="$dir/$blt_platform/tkConfig.sh"
- break
- fi
- done
-elif test "${blt_with_tk_include_dir}" = "yes" -a \
- "${blt_with_tk_lib_dir}" = "yes" ; then
-
- # Search for Tk configuration file.
-
- # 1. Search previously named locations.
-
- for dir in \
- $prefix \
- $exec_prefix \
- $blt_cv_tk_lib \
- $blt_cv_tcl_lib
- do
- if test -r "$dir/tkConfig.sh" ; then
- tk_config_sh="$dir/tkConfig.sh"
- break
- elif test -r "$dir/lib/tkConfig.sh" ; then
- tk_config_sh="$dir/lib/tkConfig.sh"
- break
- elif test -r "$dir/$blt_platform/tkConfig.sh" ; then
- tk_config_sh="$dir/$blt_platform/tkConfig.sh"
- break
- fi
- done
-
- # 2. Search source directories.
-
- if test "x$tk_config_sh" = "x" ; then
- for dir in \
- ../tcl \
- `ls -dr ../tk[[4-9]].[[0-9]]* 2>/dev/null` \
- ../../tcl \
- `ls -dr ../../tk[[4-9]].[[0-9]]* 2>/dev/null` \
- ../../../tcl \
- `ls -dr ../../../tk[[4-9]].[[0-9]]* 2>/dev/null`
- do
- if test -r "$dir/$blt_platform/tkConfig.sh"; then
- tk_config_sh="$dir/$blt_platform/tkConfig.sh"
- break
- fi
- done
- fi
-
- # 3. Search standard locations.
-
- if test "x$tk_config_sh" = "x" ; then
- for dir in \
- /usr/local \
- ${x_libraries} \
- /usr
- do
- if test -r "$dir/tkConfig.sh" ; then
- tk_config_sh="$dir/tkConfig.sh"
- break
- elif test -r "$dir/lib/tkConfig.sh" ; then
- tk_config_sh="$dir/lib/tkConfig.sh"
- break
- fi
- done
- fi
-fi
-AC_MSG_RESULT([${tk_config_sh}])
-
-# -----------------------------------------------------------------------
-#
-# Source in the Tcl/Tk configuration scripts.
-#
-#
-# Check for tclConfig.sh and tkConfig.sh. If found use values
-# in file, but don't check if libraries exist.
-#
-# -----------------------------------------------------------------------
-
-if test "x${tcl_config_sh}" != "x" ; then
- . $tcl_config_sh
- TCL_INC_SPEC=${TCL_INCLUDE_SPEC}
-fi
-
-if test "x${tk_config_sh}" != "x" ; then
- . $tk_config_sh
- TK_INC_SPEC=${TK_INCLUDE_SPEC}
-fi
-
-tcl_includes_dir=""
-tk_includes_dir=""
-TCL_INC_SPEC=${TCL_INCLUDE_SPEC}
-TK_INC_SPEC=${TK_INCLUDE_SPEC}
-
-if test "${blt_with_tcl_include_dir}" = "no" ; then
- AC_ERROR([Can't find tcl.h: use --with-tclincdir switch])
-elif test "${blt_with_tcl_include_dir}" != "yes" ; then
- if test -r "${blt_with_tcl_include_dir}/tcl.h" ; then
- tcl_includes_dir=${blt_with_tcl_include_dir}
- TCL_INC_SPEC="-I${tcl_includes_dir}"
- BLT_GET_SYMBOL(TCL_MAJOR_VERSION, TCL_MAJOR_VERSION,
- [${tcl_includes_dir}/tcl.h])
- BLT_GET_SYMBOL(TCL_MINOR_VERSION, TCL_MINOR_VERSION,
- [${tcl_includes_dir}/tcl.h])
- TCL_VERSION=${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}
- else
- AC_ERROR([Can't find tcl.h in \"${blt_with_tcl_include_dir}\"])
- fi
-else
- for dir in \
- ${TCL_PREFIX}/include \
- ${TCL_SRC_DIR}/generic \
- /usr/local/include \
- /usr/include
- do
- if test -r "$dir/tcl.h" ; then
- tcl_includes_dir=$dir
- break
- fi
- done
- if test "x${tcl_includes_dir}" = "x" ; then
- AC_ERROR([Can't find tcl.h header file.])
- fi
-fi
-
-if test "${blt_with_tk_include_dir}" = "no" ; then
- AC_ERROR([Can't find tk.h: use --with-tkincdir switch])
-elif test "${blt_with_tk_include_dir}" != "yes" ; then
- if test -r "${blt_with_tk_include_dir}/tk.h" ; then
- tk_includes_dir=${blt_with_tk_include_dir}
- TK_INC_SPEC="-I${tk_includes_dir}"
- BLT_GET_SYMBOL(TK_MAJOR_VERSION, TK_MAJOR_VERSION,
- ${tk_includes_dir}/tk.h)
- BLT_GET_SYMBOL(TK_MINOR_VERSION, TK_MINOR_VERSION,
- ${tk_includes_dir}/tk.h)
- TK_VERSION=${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}
- else
- AC_ERROR([Can't find tk.h in \"${blt_with_tk_include_dir}\"])
- fi
-else
- for dir in \
- ${TK_PREFIX}/include \
- ${TK_SRC_DIR}/generic \
- ${tcl_includes_dir} \
- /usr/local/include \
- /usr/include
- do
- if test -r "$dir/tk.h" ; then
- tk_includes_dir=$dir
- break
- fi
- done
- if test "x${tk_includes_dir}" = "x" ; then
- AC_ERROR([Can't find tk.h header file.])
- fi
-fi
-
-case $target in
- *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|OpenBSD-*|*-*-cygwin*|*-*-mingw*)
- TCL_LIB_VERSION="${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}"
- TK_LIB_VERSION="${TK_MAJOR_VERSION}${TK_MINOR_VERSION}"
- ;;
- *)
- TCL_LIB_VERSION="${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}"
- TK_LIB_VERSION="${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}"
- ;;
-esac
-
-if test "${blt_with_tcl_lib_dir}" = "no" ; then
- AC_ERROR([Can't find Tcl library: use --with-tcllibdir switch])
-elif test "${blt_with_tcl_lib_dir}" = "yes" ; then
- for libname in \
- "${TCL_EXEC_PREFIX}/lib/${SO_PREFIX}tcl${TCL_LIB_VERSION}${SO_EXT}" \
- "${TCL_EXEC_PREFIX}/lib/${IMPLIB_PREFIX}tcl${TCL_LIB_VERSION}${IMPLIB_EXT}" \
- "${TCL_EXEC_PREFIX}/lib/${IMPLIB_PREFIX}tcl${TCL_LIB_VERSION}.lib" \
- "${TCL_EXEC_PREFIX}/lib/libtcl${TCL_LIB_VERSION}.a"
- do
- if test -r "$libname" ; then
- TCL_LIB_DIR="${TCL_EXEC_PREFIX}/lib"
- TCL_LIB_SPEC="-L${TCL_LIB_DIR} -ltcl${TCL_LIB_VERSION}"
- break
- fi
- done
-else
- for libname in \
- "${blt_with_tcl_lib_dir}/${SO_PREFIX}tcl${TCL_LIB_VERSION}${SO_EXT}" \
- "${blt_with_tcl_lib_dir}/${IMPLIB_PREFIX}tcl${TCL_LIB_VERSION}${IMPLIB_EXT}" \
- "${blt_with_tcl_lib_dir}/${IMPLIB_PREFIX}tcl${TCL_LIB_VERSION}.lib" \
- "${blt_with_tcl_lib_dir}/libtcl${TCL_LIB_VERSION}.a"
- do
- if test -r "$libname" ; then
- TCL_LIB_DIR="${blt_with_tcl_lib_dir}"
- TCL_LIB_SPEC="-L${TCL_LIB_DIR} -ltcl${TCL_LIB_VERSION}"
- break
- fi
- done
-fi
-if test "x${TCL_LIB_DIR}" = "x" ; then
- AC_ERROR([Can't find tcl library ${libname} in \"${blt_with_tcl_lib_dir}\"])
-fi
-
-if test "${blt_with_tk_lib_dir}" = "no" ; then
- AC_ERROR([Can't find Tcl library: use --with-tcllibdir switch])
-elif test "${blt_with_tk_lib_dir}" = "yes" ; then
- for libname in \
- "${TK_EXEC_PREFIX}/lib/${SO_PREFIX}tk${TK_LIB_VERSION}${SO_EXT}" \
- "${TK_EXEC_PREFIX}/lib/${IMPLIB_PREFIX}tk${TK_LIB_VERSION}${IMPLIB_EXT}" \
- "${TK_EXEC_PREFIX}/lib/${IMPLIB_PREFIX}tk${TK_LIB_VERSION}.lib" \
- "${TK_EXEC_PREFIX}/lib/libtk${TK_LIB_VERSION}.a"
- do
- if test -r "$libname" ; then
- TK_LIB_DIR="${TK_EXEC_PREFIX}/lib"
- TK_LIB_SPEC="-L${TK_LIB_DIR} -ltk${TK_LIB_VERSION}"
- break
- fi
- done
-else
- for libname in \
- "${blt_with_tk_lib_dir}/${SO_PREFIX}tk${TK_LIB_VERSION}${SO_EXT}" \
- "${blt_with_tk_lib_dir}/${IMPLIB_PREFIX}tk${TK_LIB_VERSION}${IMPLIB_EXT}" \
- "${blt_with_tk_lib_dir}/${IMPLIB_PREFIX}tk${TK_LIB_VERSION}$.lib" \
- "${blt_with_tk_lib_dir}/libtk${TK_LIB_VERSION}.a"
- do
- if test -r "$libname" ; then
- TK_LIB_DIR="${blt_with_tk_lib_dir}"
- TK_LIB_SPEC="-L${TK_LIB_DIR} -ltk${TK_LIB_VERSION}"
- break
- fi
- done
-fi
-if test "x${TK_LIB_DIR}" = "x" ; then
- AC_ERROR([Can't find tk library.])
-fi
-
-# -----------------------------------------------------------------------
-#
-# Include files
-#
-# Append to INC_SPECS the various include files specifications
-# (built fromt the include directory information).
-#
-# -----------------------------------------------------------------------
-
-# Tk include files
-if test "${tk_includes_dir}" != "/usr/include" ; then
- INC_SPECS="${INC_SPECS} ${TK_INC_SPEC}"
-fi
-
-# Tcl include files
-#
-# Add the include directory specification only if the Tcl
-# headers reside in a different directory from Tk's.
-if test "${tcl_includes_dir}" != "/usr/include" -a \
- "${tcl_includes_dir}" != "${tk_includes_dir}" ; then
- INC_SPECS="${INC_SPECS} ${TCL_INC_SPEC}"
-fi
-
-
-# On Windows, override the default include directory with our own.
-if test "${blt_platform}" = "win"; then
- x_includes="NONE"
-fi
-
-# X11 include files
-if test "x${x_includes}" != "x" -a \
- "${x_includes}" != "NONE" -a \
- "${x_includes}" != "/usr/include" -a \
- "${x_includes}" != "${tk_includes_dir}" -a \
- "${x_includes}" != "${tcl_includes_dir}" ; then
- INC_SPECS="${INC_SPECS} -I${x_includes}"
-fi
-
-# -----------------------------------------------------------------------
-#
-# Libraries
-#
-# Append to LIB the various library specifications
-# (built from the library directory information).
-#
-# -----------------------------------------------------------------------
-
-# Collect the libraries for AIX that aren't using stubs.
-aix_lib_specs=$LIBS
-
-if test "${blt_platform}" = "unix"; then
-
- # Add specification for X11 library only on Unix platforms.
-
- if test "x${x_libraries}" = "x" -o \
- "x${x_libraries}" = "NONE" -o \
- "${x_libraries}" = "/usr/lib" -o \
- "${x_libraries}" = "/usr/lib64" -o \
- "${x_libraries}" = "${TK_LIB_DIR}" -o \
- "${x_libraries}" = "${TCL_LIB_DIR}" ; then
- x_lib_spec=""
- aix_lib_specs="-lX11 ${aix_lib_specs}"
- else
- x_lib_spec="-L${x_libraries}"
- aix_lib_specs="-L${x_libraries} -lX11 ${aix_lib_specs}"
- if test "x${loader_run_path}" = "x" ; then
- loader_run_path="${x_libraries}"
- else
- loader_run_path="${loader_run_path}:${x_libraries}"
- fi
- fi
-fi
-
-
-# EXPAT library
-
-if test "${blt_with_expat_lib_dir}" != "no" -a \
- "${ac_cv_header_expat_h}" != "no" ; then
- BLT_CHECK_LIBRARY(EXPAT, expat, XML_ParserCreate, $blt_with_expat_lib_dir)
-fi
-
-# MYSQL client library
-
-if test "${blt_with_mysql_lib_dir}" != "no" -a \
- "${ac_cv_header_mysql_mysql_h}" != "no" ; then
- BLT_CHECK_LIBRARY(MYSQL, mysqlclient, mysql_init, $blt_with_mysql_lib_dir)
-fi
-
-# JPEG library
-
-if test "${blt_with_jpeg_lib_dir}" != "no" -a \
- "${ac_cv_header_jpeglib_h}" != "no" ; then
- BLT_CHECK_LIBRARY(JPG, jpeg, jpeg_read_header, $blt_with_jpeg_lib_dir)
-fi
-
-# TIFF library
-
-if test "${blt_with_tiff_lib_dir}" != "no" -a \
- "${ac_cv_header_tiff_h}" != "no" ; then
- BLT_CHECK_LIBRARY(TIF, tiff, TIFFReadRGBAImage, $blt_with_tiff_lib_dir, -lz)
-fi
-
-# PNG library
-
-if test "${blt_with_png_lib_dir}" != "no" -a \
- "${ac_cv_header_png_h}" != "no" ; then
- BLT_CHECK_LIBRARY(PNG, png, png_read_png, $blt_with_png_lib_dir, -lz)
-fi
-
-# zlib library
-if test "${blt_with_z_lib_dir}" != "no" ; then
- BLT_CHECK_LIBRARY(Z, z, deflate, $blt_with_z_lib_dir)
-fi
-
-# XPM library
-
-old_CFLAGS=$CFLAGS
-CFLAGS=$X11_LIB_SPEC
-
-if test "${blt_with_xpm_lib_dir}" != "no" -a \
- "${ac_cv_header_xpm_h}" != "no" ; then
- BLT_CHECK_LIBRARY(XPM, Xpm, XpmCreateXpmImageFromBuffer, $blt_with_xpm_lib_dir)
-fi
-
-# FREETYPE library
-
-if test "${blt_with_ft2_lib_dir}" != "no" -a \
- "${ac_cv_header_ft2build_h}" != "no" ; then
- BLT_CHECK_LIBRARY(FT2, freetype, FT_Init_FreeType, $blt_with_ft2_lib_dir)
-fi
-
-# Xft library
-
-if test "${blt_with_xft2_lib_dir}" != "no" -a \
- "${ac_cv_header_x11_xft_xft_h}" != "no" ; then
- BLT_CHECK_LIBRARY(XFT, [Xft -lexpat], XftFontOpenPattern, $blt_with_xft_lib_dir)
- BLT_CHECK_LIBRARY(FTCFG, fontconfig, FcPatternCreate, yes)
- BLT_CHECK_LIBRARY(XRENDER, Xrender, XRenderQueryExtension, yes)
-fi
-
-# Xrandr library
-
-BLT_CHECK_LIBRARY(XRANDR, Xrandr, XRRGetScreenInfo, yes)
-
-BLT_CHECK_LIBRARY(XDMCP, Xdmcp, XdmcpWrap, yes)
-BLT_CHECK_LIBRARY(XAU, Xau, XauReadAuth, yes)
-CFLAGS=$old_CFLAGS
-# Tcl libraries
-if test "${TCL_LIB_DIR}" != "/usr/lib" -a \
- "${TCL_LIB_DIR}" != "/usr/lib64" -a \
- "${TCL_LIB_DIR}" != "${TK_LIB_DIR}" ; then
- if test "x${loader_run_path}" = "x" ; then
- loader_run_path="${TCL_LIB_DIR}"
- else
- loader_run_path="${TCL_LIB_DIR}:${loader_run_path}"
- fi
-fi
-
-# Tk libraries
-if test "${TK_LIB_DIR}" != "/usr/lib" -a \
- "${TK_LIB_DIR}" != "/usr/lib64" ; then
- if test "x${loader_run_path}" = "x" ; then
- loader_run_path="${TK_LIB_DIR}"
- else
- loader_run_path="${TK_LIB_DIR}:${loader_run_path}"
- fi
-fi
-
-
-# -----------------------------------------------------------------------
-#
-# Set up a new default prefix to installation path. The ways
-# the prefix can be set and their precedence are as follows:
-#
-# 1. --prefix option given to ./configure. (prefix != NONE)
-# 2. use previously configured Tk prefix
-#
-# -----------------------------------------------------------------------
-
-if test "$prefix" = "NONE" ; then
- prefix=${TCL_PREFIX}
-fi
-
-if test "$exec_prefix" = "NONE" ; then
- exec_prefix=${TCL_EXEC_PREFIX}
-fi
-
-# -------------------------------------------------------------------------
-#
-# Extract the BLT version number for the blt.h header
-#
-# -------------------------------------------------------------------------
-AC_MSG_CHECKING([BLT_MAJOR_VERSION])
-AC_CACHE_VAL(blt_cv_major_version,
-BLT_GET_SYMBOL(blt_cv_major_version, BLT_MAJOR_VERSION, ${srcdir}/src/blt.h)
-)
-BLT_MAJOR_VERSION=${blt_cv_major_version}
-AC_MSG_RESULT([$blt_cv_major_version])
-
-AC_MSG_CHECKING([BLT_MINOR_VERSION])
-AC_CACHE_VAL(blt_cv_minor_version,
-BLT_GET_SYMBOL(blt_cv_minor_version, BLT_MINOR_VERSION, ${srcdir}/src/blt.h)
-)
-AC_MSG_RESULT([$blt_cv_minor_version])
-BLT_MINOR_VERSION=${blt_cv_minor_version}
-
-BLT_VERSION=${BLT_MAJOR_VERSION}.${BLT_MINOR_VERSION}
-
-# Add BLT to the run path
-libdir=${exec_prefix}/lib
-
-if test "x${libdir}" != "x" -a \
- "${libdir}" != "/usr/lib" -a \
- "${libdir}" != "/usr/lib64" -a \
- "${libdir}" != "${x_libraries}" -a \
- "${libdir}" != "${TK_LIB_DIR}" -a \
- "${libdir}" != "${TCL_LIB_DIR}" ; then
- if test "x${loader_run_path}" = "x" ; then
- loader_run_path="${libdir}"
- else
- loader_run_path="${libdir}:${loader_run_path}"
- fi
-fi
-
-# -------------------------------------------------------------------------
-#
-# Extract the Tcl version number for the tcl.h header
-#
-# -------------------------------------------------------------------------
-
-if test "$TCL_VERSION" = "7.6" -a "$TK_VERSION" = "4.2" ; then
- :
-elif test "$TCL_VERSION" = "7.5" -a "$TK_VERSION" = "4.1" ; then
- :
-elif test "$TCL_VERSION" = "$TK_VERSION" ; then
- :
-else
- AC_ERROR([Mismatched Tcl/Tk versions ($TCL_VERSION != $TK_VERSION)])
-fi
-
-#--------------------------------------------------------------------
-#
-# Check if we can generate shared libraries on this system. Set flags
-# to generate shared libraries for systems that we know about. Start
-# with the values found in tclConfig.sh, make changes as we know about
-# the different systems.
-#
-#--------------------------------------------------------------------
-
-LIB_BASE_NAME=libBLT
-
-# Initialize shared library build variables
-
-SO_LD="$TCL_SHLIB_LD"
-SO_LDFLAGS="$TCL_LD_FLAGS"
-SO_RUNPATH="$TCL_LD_SEARCH_FLAGS"
-
-SO_TARGET=""
-SO_CFLAGS=""
-SO_LIBS=""
-LDFLAGS=""
-LD_RUN_PATH=""
-EXTRA_LIBS=""
-
-case $target in
- *-aix4.[[2-9]]*)
- # No Position-Independent flags needed
- SO_CFLAGS=""
-
- # Use the installed export file or the one found in the source directory.
-
- if test -r "${TCL_LIB_DIR}/libtcl${TCL_LIB_VERSION}.exp" ; then
- tcl_exp="${TCL_LIB_DIR}/libtcl${TCL_LIB_VERSION}.exp"
- else
- tcl_exp="${TCL_SRC_DIR}/unix/lib.exp"
- fi
- if test -r "${TK_LIB_DIR}/libtk${TK_LIB_VERSION}.exp" ; then
- tk_exp="${TK_LIB_DIR}/libtk${TK_LIB_VERSION}.exp"
- else
- tk_exp="${TK_SRC_DIR}/unix/lib.exp"
- fi
-
- full_src_path=`cd ${srcdir}; pwd`
-
- # Use shell-script to link shared library
- SO_LD="${full_src_path}/cf/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}"
-
- SO_LIBS="${aix_lib_specs} -lc"
-
- LDFLAGS="-L${loader_run_path}"
- EXTRA_LIBS="-ldl"
- ;;
-
- *-aix*)
- # No Position-Independent flags needed
- SO_CFLAGS=""
-
- # Use the installed export file or the one found in the source directory.
-
- if test -r "${TCL_LIB_DIR}/libtcl${TCL_LIB_VERSION}.exp" ; then
- tcl_exp="${TCL_LIB_DIR}/libtcl${TCL_LIB_VERSION}.exp"
- else
- tcl_exp="${TCL_SRC_DIR}/unix/lib.exp"
- fi
- if test -r "${TK_LIB_DIR}/libtk${TK_LIB_VERSION}.exp" ; then
- tk_exp="${TK_LIB_DIR}/libtk${TK_LIB_VERSION}.exp"
- else
- tk_exp="${TK_SRC_DIR}/unix/lib.exp"
- fi
-
- full_src_path=`cd ${srcdir}/cf; pwd`
-
- # Use shell-script to link shared library
-
- SO_LD="${full_src_path}/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}"
-
- SO_LIBS="${aix_lib_specs} -lc"
-
- LDFLAGS="-L${loader_run_path}"
- EXTRA_LIBS="-lld"
- ;;
-
- *-bsdi2*|*-bsdi3*)
- SO_CFLAGS=""
- SO_LD="shlicc"
- SO_LDFLAGS="-r"
-
- EXTRA_LIBS="-ldl"
- ;;
-
- *-bsdi4*)
- SO_CFLAGS="-export-dynamic -fPIC"
- SO_LD="${CC}"
- SO_LDFLAGS='-shared -Wl,-E -Wl,-soname,$@'
- ;;
-
- *-*-cygwin* | *-*-mingw*)
- SO_LD="${CC}"
- SO_LDFLAGS='-shared -Wl,-E -Wl,--out-implib,$@'
- EXTRA_LIBS="-lwinspool"
- SO_EXT=".dll"
- LDFLAGS=""
- ;;
-
- *-*-darwin*)
- SO_CFLAGS="-fno-common"
- SO_EXT=".dylib"
- SO_LD="${CC}"
- SO_LDFLAGS="-dynamiclib"
-
- AC_MSG_CHECKING([if ld accepts -single_module flag])
- save_LDFLAGS=$LDFLAGS
- LDFLAGS="$SO_LDFLAGS -Wl,-single_module"
- AC_TRY_LINK(, [int i;], [single_module=yes], [single_module=no])
- if test "${single_module}" = "yes" ; then
- SO_LDFLAGS=$LDFLAGS
- fi
- AC_MSG_RESULT([$single_module])
- SO_LIBRARY_PATH="DYLD_LIBRARY_PATH"
- LDFLAGS=""
- ;;
-
- *-dgux*)
- SO_CFLAGS="-K PIC"
- SO_LD="cc"
- SO_LDFLAGS="-G"
- EXTRA_LIBS="-ldl"
- ;;
-
- *-hpux*)
- if test "$blt_have_gcc" = "no" ; then
- DEFINES="$DEFINES -D_HPUX_SOURCE"
- fi
- if test "${blt_have_dld}" = "yes" ; then
- SO_CFLAGS="+Z"
- SO_LD="ld"
- SO_LDFLAGS="-b -E -n +s +b,${loader_run_path}:."
- SO_EXT=".sl"
-
- # The run path is included in both LDFLAGS and SO_LDFLAGS
- # because SO_LD is ld and LD is cc/gcc.
-
- LDFLAGS="-Wl,-E -Wl,+s,+b,${loader_run_path}:."
- EXTRA_LIBS="-ldld"
- fi
- ;;
-
- *-irix64-6.5*)
- SO_CFLAGS=""
- SO_LD="ld"
- SO_LDFLAGS="-32 -shared -rdata_shared"
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- ;;
-
- *-irix-[56].*|*-irix64-*)
- SO_CFLAGS=""
- SO_LD="ld"
- SO_LDFLAGS="-shared -rdata_shared"
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- LDFLAGS=""
- if test "$blt_have_gcc" = "yes" ; then
- SO_CFLAGS="-mabi=n32 $SO_CFLAGS"
- SO_LDFLAGS="-mabi=n32 $SO_LDFLAGS"
- LDFLAGS="-mabi=n32 $LDFLAGS"
- else
- CFLAGS="-n32 $CFLAGS"
- LDFLAGS="-n32 $LDFLAGS"
- fi
- ;;
-
- *-linux*)
- SO_CFLAGS="-fPIC"
- SO_LD="${CC}"
- SO_LDFLAGS='-rdynamic -shared -Wl,-E -Wl,-soname,$@'
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
-
- LDFLAGS=""
- EXTRA_LIBS="-ldl"
- ;;
-
- *-mp-ras-02*)
- SO_CFLAGS="-G -K PIC"
- SO_LD="${CC}"
- SO_LDFLAGS=""
- ;;
-
- *-mp-ras-*)
- SO_CFLAGS="-G -K PIC"
- SO_LD="${CC}"
- SO_LDFLAGS="-Wl,-Bexport"
- ;;
-
- *-ncr-sysv4-*2*)
- SO_CFLAGS="-K PIC"
- SO_LD="cc"
- SO_LDFLAGS="-G"
-
- EXTRA_LIBS="-ldl"
- ;;
-
- *-ncr-sysv4*)
- SO_CFLAGS="-K PIC"
- SO_LD="cc"
- SO_LDFLAGS="-G -Wl,-Bexport"
-
- LDFLAGS="-Wl,-Bexport"
- EXTRA_LIBS="-ldl"
- ;;
-
- *-netbsd*|*-freebsd*|*-openbsd*)
- # Not available on all versions: check for include file.
- AC_CHECK_HEADER(dlfcn.h, test_ok=yes, test_ok=no)
- if test "$test_ok" = yes; then
- SO_CFLAGS="-fpic"
- SO_LD="ld"
- SO_LDFLAGS="-Bshareable -x"
- fi
- ;;
-
- *-nextstep*)
- SO_CFLAGS=""
- SO_LD="cc"
- SO_LDFLAGS="-nostdlib -r"
- ;;
-
- *-osf1-1.[012]*)
- # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
-
- SO_CFLAGS=""
-
- # Warning: Ugly Makefile Hack
- # Make package name same as library name
-
- SO_LD='ld -R -export $@:'
- ;;
-
- *-osf1-1.*)
- # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
-
- SO_CFLAGS="-fpic"
- SO_LD="ld -shared"
- ;;
-
- *-osf1V*)
- # Digital OSF/1
-
- SO_CFLAGS=""
- SO_LD='ld'
- SO_LDFLAGS='-shared -expect_unresolved "*"'
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- LDFLAGS=""
- ;;
-
- *-sco*)
- # Note, dlopen is available only on SCO 3.2.5 and greater. However,
- # this test works, since "uname -s" was non-standard in 3.2.4 and
- # below.
-
- SO_CFLAGS="-Kpic -belf"
- SO_LD="ld"
- SO_LDFLAGS="-G"
- LDFLAGS="-belf -Wl,-Bexport"
- ;;
-
- *-sni-sysv*)
-
- SO_CFLAGS="-K PIC"
- SO_LD="cc"
- SO_LDFLAGS="-G"
-
- EXTRA_LIBS="-ldl"
- ;;
-
- *-sunos4*)
-
- SO_CFLAGS="-PIC"
- SO_LD="ld"
- SO_LDFLAGS="-assert pure-text"
-
- EXTRA_LIBS="-ldl"
- ;;
-
- *-solaris2*)
-
- SO_CFLAGS="-KPIC"
- if test "${blt_with_gnu_ld}" = "yes" -a "$blt_have_gcc" = "yes" ; then
- SO_LD="gcc"
- SO_LDFLAGS='-rdynamic -shared -Wl,-E -Wl,-soname,$@'
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- else
- SO_LD="/usr/ccs/bin/ld"
- SO_LDFLAGS="-G -z text"
- LD_RUN_PATH="-R ${loader_run_path}"
- fi
- EXTRA_LIBS="-ldl"
- ;;
-
- *-mips-dde-sysv*)
-
- SO_CFLAGS="-KPIC"
- SO_LD="cc"
- SO_LDFLAGS="-G"
-
- EXTRA_LIBS="-ldl"
- ;;
-
- *-pc-sysv4* | *-unixware-5*)
- SO_CFLAGS="-G -KPIC"
- SO_LD="${CC}"
- SO_LDFLAGS=" -Wl,-Bexport"
- ;;
-
- *)
- build_shared="no"
- ;;
-
-esac
-
-# If we're running gcc, then set SO_CFLAGS flags for compiling
-# shared libraries for gcc, instead of those of the vendor's
-# compiler.
-
-
-if test "$blt_have_gcc" = "yes" ; then
- if test "$blt_platform_win32" = "no" ; then
- SO_CFLAGS="-fPIC"
- fi
-fi
-
-# We can't back link against static versions of Tcl/Tk.
-# If # ${TCL_SHARED_BUILD} can't be found or isn't "1", assume that
-# shared libraries weren't built.
-
-if test "${TCL_SHARED_BUILD}" != "1" ; then
- SO_LIBS=""
-fi
-
-if test "${build_shared}" = "yes" -a "$blt_enable_shared" = "yes"; then
- AC_SUBST(BLT_SO_CFLAGS, "$SO_CFLAGS")
- AC_SUBST(BLT_TARGET, "shared")
- AC_SUBST(BLT_SO_LD, "$SO_LD")
- AC_SUBST(BLT_SO_LDFLAGS, "$SO_LDFLAGS")
- AC_SUBST(BLT_SO_LIBS, "$SO_LIBS")
- AC_SUBST(BLT_SO_EXT, "$SO_EXT")
- AC_SUBST(LD_RUN_PATH)
-else
- AC_SUBST(BLT_TARGET, "static")
-fi
-
-AC_DEFINE_UNQUOTED([BLT_SO_EXT], "$SO_EXT", [Define 'soext' as the extension for shared libraries.])
-AC_DEFINE_UNQUOTED([BLT_SO_PREFIX], "$SO_PREFIX", [Define 'prefix' as the prefix for shared library names.])
-AC_DEFINE_UNQUOTED([BLT_LIB_SUFFIX], "$LIB_SUFFIX", [Define 'suffix' as the suffix for library names.])
-AC_SUBST(BLT_SO_PREFIX, "$SO_PREFIX")
-AC_SUBST(BLT_LIB_SUFFIX, "$LIB_SUFFIX")
-AC_SUBST(IMPLIB_PREFIX)
-AC_SUBST(IMPLIB_EXT)
-
-if test "${blt_enable_stubs}" = "yes" ; then
- AC_DEFINE_UNQUOTED([USE_TCL_STUBS], [1], [Define if Tcl stubs are used.])
- AC_DEFINE_UNQUOTED([USE_TK_STUBS], [1], [Define if Tk stubs are used.])
- TCL_STUBS_SPEC="-L${TCL_LIB_DIR} -ltclstub${TCL_LIB_VERSION}"
- AC_SUBST(TCL_STUBS_SPEC)
- TK_STUBS_SPEC="-L${TK_LIB_DIR} -ltkstub${TK_LIB_VERSION}"
- AC_SUBST(TK_STUBS_SPEC)
-fi
-
-if test "${blt_platform_win32}" = "yes" ; then
- AC_DEFINE_UNQUOTED([WIN32], [1], [Define if building for Win32.])
-fi
-WIN32=${blt_platform_win32}
-AC_SUBST(WIN32)
-
-AC_SUBST(AUX_LIBS)
-AC_SUBST(BLT_MAJOR_VERSION)
-AC_SUBST(BLT_MINOR_VERSION)
-AC_SUBST(BLT_VERSION)
-AC_SUBST(CC)
-AC_SUBST(CFLAGS)
-AC_SUBST(DEFINES)
-AC_SUBST(DLL_PREFIX)
-AC_SUBST(EXPAT_INC_SPEC)
-AC_SUBST(EXPAT_LIB_SPEC)
-AC_SUBST(EXTRA_LIBS)
-AC_SUBST(FT2_INC_SPEC)
-AC_SUBST(FT2_LIB_SPEC)
-AC_SUBST(FTCFG_LIB_SPEC)
-AC_SUBST(GCCFLAGS)
-AC_SUBST(INCLUDES, ${INC_SPECS})
-AC_SUBST(JPG_INC_SPEC)
-AC_SUBST(JPG_LIB_SPEC)
-AC_SUBST(LDFLAGS)
-AC_SUBST(LIBS)
-AC_SUBST(LIB_PREFIX)
-AC_SUBST(LIB_SUFFIX)
-AC_SUBST(MYSQL_INC_SPEC)
-AC_SUBST(MYSQL_LIB_SPEC)
-AC_SUBST(PNG_INC_SPEC)
-AC_SUBST(PNG_LIB_SPEC)
-AC_SUBST(TCL_DBGX)
-AC_SUBST(TCL_INC_SPEC)
-AC_SUBST(TCL_LIB_DIR)
-AC_SUBST(TCL_LIB_SPEC)
-AC_SUBST(TCL_VERSION)
-AC_SUBST(TIF_INC_SPEC)
-AC_SUBST(TIF_LIB_SPEC)
-AC_SUBST(TK_INC_SPEC)
-AC_SUBST(TK_LIB_SPEC)
-AC_SUBST(X11_INC_SPEC)
-AC_SUBST(X11_LIB_SPEC)
-AC_SUBST(XAU_LIB_SPEC)
-AC_SUBST(XDMCP_LIB_SPEC)
-AC_SUBST(XFT_INC_SPEC)
-AC_SUBST(XFT_LIB_SPEC)
-AC_SUBST(XPM_INC_SPEC)
-AC_SUBST(XPM_LIB_SPEC)
-AC_SUBST(XRANDR_LIB_SPEC)
-AC_SUBST(XRENDER_LIB_SPEC)
-AC_SUBST(Z_LIB_SPEC)
-
-
-#--------------------------------------------------------------------
-# The BLT script directory was either specified or we
-# assume <prefix>/lib
-#--------------------------------------------------------------------
-if test "x${blt_with_scriptdir}" = "x" ; then
- BLT_LIBRARY="${prefix}/lib/blt${BLT_VERSION}"
-else
- BLT_LIBRARY="${blt_with_scriptdir}/blt${BLT_VERSION}"
-fi
-AC_SUBST(BLT_LIBRARY)
-
-#--------------------------------------------------------------------
-# Print out some of the more important settings
-#--------------------------------------------------------------------
-echo ""
-echo "Configuration results:"
-echo ""
-echo " tcl.h found in $TCL_INC_SPEC"
-echo " tk.h found in $TK_INC_SPEC"
-echo " X11/Xlib.h found in $x_includes"
-echo " libtcl${TCL_LIB_VERSION} found in $TCL_LIB_SPEC"
-echo " libtk${TK_LIB_VERSION} found in $TK_LIB_SPEC"
-echo " libX11 found in $x_libraries"
-echo ""
-echo "Directories where BLT is to be installed:"
-echo ""
-echo " \"\$prefix\" is $prefix"
-echo " \"\$exec_prefix\" is $exec_prefix"
-echo ""
-echo " shells to be installed in $bindir"
-echo " libraries to be installed in $libdir"
-echo " scripts to be installed in $BLT_LIBRARY"
-echo " manual pages to be installed in $mandir"
-echo " MYSQL_LIB_SPEC=$MYSQL_LIB_SPEC"
-echo " MYSQL_INC_SPEC=$MYSQL_INC_SPEC"
-echo " EXPAT_LIB_SPEC=$EXPAT_LIB_SPEC"
-echo " EXPAT_INC_SPEC=$EXPAT_INC_SPEC"
-echo " FT2_LIB_SPEC=$FT2_LIB_SPEC"
-echo " FT2_INC_SPEC=$FT2_INC_SPEC"
-echo " JPG_LIB_SPEC=$JPG_LIB_SPEC"
-echo " JPG_INC_SPEC=$JPG_INC_SPEC"
-echo ""
-
-#--------------------------------------------------------------------
-#
-# Generate the following Makefiles
-#
-# ./Makefile
-# ./src/Makefile
-# ./src/shared/Makefile
-# ./man/Makefile
-# ./library/Makefile
-# ./demos/Makefile
-#
-#--------------------------------------------------------------------
-src_Makefile="src/Makefile"
-
-case ${blt_platform} in
- "win")
- src_Makefile="src/Makefile:src/Makefile-cyg.in"
- ;;
- "macosx")
- src_Makefile="src/Makefile:src/Makefile-macosx.in"
- ;;
- *)
- ;;
-esac
-
-# --------------------------------------------------------------
-# List of files to have be generated from <name>.in files with
-# autoconf substitutions.
-# --------------------------------------------------------------
-AC_CONFIG_FILES(
-[
- Makefile
- ${src_Makefile}
- src/bltHash.h
- src/shared/Makefile
- man/Makefile
- library/Makefile
- library/afm/Makefile
- demos/Makefile
-]
-)
-
-AC_OUTPUT()
-
diff --git a/blt3.0.1/demos/Makefile.in b/blt3.0.1/demos/Makefile.in
deleted file mode 100644
index cac676e..0000000
--- a/blt3.0.1/demos/Makefile.in
+++ /dev/null
@@ -1,92 +0,0 @@
-# ------------------------------------------------------------------------
-# Makefile for demos
-# ------------------------------------------------------------------------
-
-datadir = @datadir@
-datarootdir = @datarootdir@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-prefix = @prefix@
-srcdir = @srcdir@
-
-version = @BLT_VERSION@
-scriptdir = $(prefix)/lib/blt$(version)
-destdir = $(scriptdir)/demos
-
-SHELL = /bin/sh
-RM = rm -rf
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-
-instdirs = $(prefix) \
- $(exec_prefix) \
- $(libdir) \
- $(scriptdir) \
- $(destdir) \
- $(destdir)/bitmaps \
- $(destdir)/bitmaps/hand \
- $(destdir)/bitmaps/fish \
- $(destdir)/images \
- $(destdir)/scripts
-
-demos = barchart1.tcl barchart2.tcl barchart3.tcl barchart4.tcl \
- barchart5.tcl \
- bgexec1.tcl bgexec2.tcl bgexec3.tcl bgexec4.tcl \
- bitmap.tcl \
- busy1.tcl busy2.tcl \
- dnd1.tcl dnd2.tcl dragdrop1.tcl dragdrop2.tcl \
- eps.tcl \
- graph1.tcl graph2.tcl graph3.tcl graph4.tcl graph5.tcl \
- graph6.tcl graph7.tcl \
- hierbox1.tcl hierbox2.tcl hierbox3.tcl hierbox4.tcl \
- hiertable1.tcl hiertable2.tcl \
- htext1.tcl htext.txt \
- spline.tcl stripchart1.tcl \
- tabset1.tcl tabset2.tcl tabset3.tcl tabset4.tcl \
- tabnotebook1.tcl tabnotebook2.tcl tabnotebook3.tcl \
- treeview1.tcl \
- winop1.tcl winop2.tcl
-
-all:
-
-install: mkdirs install-bitmaps install-images install-scripts
-
-install-scripts:
- for i in $(srcdir)/scripts/*.tcl ; do \
- $(INSTALL) $$i $(DESTDIR)$(destdir)/scripts ; \
- done
- for i in $(demos) ; do \
- $(INSTALL) $(srcdir)/$$i $(DESTDIR)$(destdir)/$$i ; \
- done
-
-install-bitmaps:
- for i in $(srcdir)/bitmaps/*.xbm ; do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(destdir)/bitmaps ; \
- done
- for i in $(srcdir)/bitmaps/hand/*.xbm ; do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(destdir)/bitmaps/hand ; \
- done
- for i in $(srcdir)/bitmaps/fish/*.xbm ; do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(destdir)/bitmaps/fish ; \
- done
-
-install-images:
- for i in $(srcdir)/images/*.gif $(srcdir)/images/*.ps ; do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(destdir)/images ; \
- done
-
-mkdirs:
- @for i in $(instdirs) ; do \
- if test -d $(DESTDIR)"$$i" ; then \
- : ; \
- else \
- echo " mkdir $(DESTDIR)$$i" ; \
- mkdir $(DESTDIR)"$$i" ; \
- fi ; \
- done
-
-clean:
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"*
-
-distclean: clean
- $(RM) *.ps Makefile
diff --git a/blt3.0.1/demos/Makefile.vc b/blt3.0.1/demos/Makefile.vc
deleted file mode 100644
index 5e4dc2b..0000000
--- a/blt3.0.1/demos/Makefile.vc
+++ /dev/null
@@ -1,78 +0,0 @@
-# ------------------------------------------------------------------------
-# Makefile for demos
-# ------------------------------------------------------------------------
-
-include ../vc.config
-srcdir = ../$(TOP)/demos
-
-destdir = $(scriptdir)/demos
-
-SHELL = bash
-RM = rm -rf
-INSTALL = install -m 0755
-INSTALL_DATA = install -m 0644
-
-instdirs = $(prefix) $(exec_prefix) $(libdir) $(scriptdir) \
- $(destdir) \
- $(destdir)/bitmaps \
- $(destdir)/bitmaps/hand \
- $(destdir)/bitmaps/fish \
- $(destdir)/images \
- $(destdir)/scripts
-
-demos = barchart1.tcl barchart2.tcl barchart3.tcl barchart4.tcl \
- barchart5.tcl \
- bgexec1.tcl bgexec2.tcl bgexec3.tcl bgexec4.tcl \
- bitmap.tcl \
- busy1.tcl \
- dragdrop1.tcl dragdrop2.tcl \
- eps.tcl \
- graph1.tcl graph2.tcl graph3.tcl graph4.tcl graph5.tcl \
- graph6.tcl graph7.tcl \
- hierbox1.tcl hierbox2.tcl hierbox3.tcl hierbox4.tcl \
- hiertable1.tcl hiertable2.tcl hiertable3.tcl \
- htext1.tcl htext.txt \
- spline.tcl stripchart1.tcl \
- tabset1.tcl tabset2.tcl tabset3.tcl tabset4.tcl \
- tabnotebook1.tcl tabnotebook2.tcl tabnotebook3.tcl \
- treeview1.tcl \
- winop1.tcl winop2.tcl
-
-all:
-
-install: inst-dirs inst-bitmaps inst-images inst-scripts
-
-inst-scripts:
- for i in $(srcdir)/scripts/*.tcl ; do \
- $(INSTALL) $$i $(destdir)/scripts ; \
- done
- for i in $(demos) ; do \
- $(INSTALL) $(srcdir)/$$i $(destdir)/$$i ; \
- done
-
-inst-bitmaps:
- for i in $(srcdir)/bitmaps/*.xbm ; do \
- $(INSTALL_DATA) $$i $(destdir)/bitmaps ; \
- done
- for i in $(srcdir)/bitmaps/hand/*.xbm ; do \
- $(INSTALL_DATA) $$i $(destdir)/bitmaps/hand ; \
- done
- for i in $(srcdir)/bitmaps/fish/*.xbm ; do \
- $(INSTALL_DATA) $$i $(destdir)/bitmaps/fish ; \
- done
-
-inst-images:
- for i in $(srcdir)/images/*.gif $(srcdir)/images/*.ps ; do \
- $(INSTALL_DATA) $$i $(destdir)/images ; \
- done
-
-inst-dirs:
- @for i in $(instdirs) ; do \
- if test -d "$$i" ; then : ; else mkdir "$$i" ; fi ; \
- done
-
-clean:
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"*
-
-distclean: clean
- $(RM) *.ps Makefile
diff --git a/blt3.0.1/demos/barchart1.tcl b/blt3.0.1/demos/barchart1.tcl
deleted file mode 100755
index f4f7228..0000000
--- a/blt3.0.1/demos/barchart1.tcl
+++ /dev/null
@@ -1,160 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-
-source scripts/demo.tcl
-
-set graph .bc
-
-proc random {{max 1.0} {min 0.0}} {
- global randomSeed
-
- set randomSeed [expr (7141*$randomSeed+54773) % 259200]
- set num [expr $randomSeed/259200.0*($max-$min)+$min]
- return $num
-}
-set randomSeed 148230
-
-proc FormatLabel { w value } {
-
- # Determine the element name from the value
-
- set names [$w element show]
- set index [expr round($value)]
- if { $index != $value } {
- return $value
- }
- global elemLabels
- if { [info exists elemLabels($index)] } {
- return $elemLabels($index)
- }
- return $value
-}
-
-source scripts/stipples.tcl
-
-set normalBg [blt::bgpattern create gradient -shape linear \
- -dir y -low white -high grey -relativeto self]
-set normalBg [blt::bgpattern create solid -color lightblue -opacity 50]
-#set normalBg lightblue
-
-option add *Htext.tileOffset no
-
-option add *Barchart.title "A Simple Barchart"
-
-option add *x.Title "X Axis Label"
-option add *x.Rotate 60
-option add *x.Command FormatLabel
-option add *y.Title "Y Axis Label"
-option add *x.tickFont "{San Serif} 8"
-option add *Element.Background white
-#option add *Element.Relief solid
-option add *Element.BorderWidth 1
-
-option add *Legend.hide yes
-
-option add *Grid.hide no
-option add *Grid.dashes { 2 4 }
-option add *Grid.mapX ""
-
-set visual [winfo screenvisual .]
-if { $visual != "staticgray" && $visual != "grayscale" } {
- option add *print.background yellow
- option add *quit.background red
- option add *graph.background palegreen
-}
-
-blt::htext .header -text {
- The barchart has several components: coordinate axes, data
- elements, legend, crosshairs, grid, postscript, and markers.
- They each control various aspects of the barchart. For example,
- the postscript component lets you generate PostScript output.
- Pressing the %%
-
- set w $htext(widget)
- button $w.print -text {Print} -command {
- .bc postscript output bar.ps
- }
- $w append $w.print
-
-%% button will create a file "bar.ps"
-}
-
-blt::htext .footer -text {
- Hit the %%
-
- set w $htext(widget)
- button $w.quit -text quit -command exit
- $w append $w.quit
-
-%% button when you've seen enough.%%
-
- label $w.logo -bitmap BLT
- $w append $w.logo -padx 20
-
-%% }
-
-blt::barchart .bc -plotpadx 10
-
-.bc configure -bg white -plotborderwidth 0
-#
-# Element attributes:
-#
-# Label Foreground Background Stipple Pattern
-
-source scripts/stipples.tcl
-set bg [blt::bgpattern create gradient -high orange2 -low yellow2 \
- -shape linear -dir y -jitter no -log no -relativeto toplevel]
-
-set bitmaps {
- bdiagonal1 bdiagonal2 checker2 checker3 cross1 cross2 cross3 crossdiag
- dot1 dot2 dot3 dot4 fdiagonal1 fdiagonal2 hline1 hline2 lbottom ltop
- rbottom rtop vline1 vline2
-}
-set count 1
-foreach stipple $bitmaps {
- set label [file tail $stipple]
- set label [file root $label]
- set y [random -2 10]
- set yhigh [expr $y + 0.5]
- set ylow [expr $y - 0.5]
- .bc element create $label -y $y -x $count \
- -fg "" -bg $normalBg -yhigh $yhigh -ylow $ylow -errorbarcolor brown \
- -relief raised -bd 2
- set elemLabels($count) $label
- incr count
-}
-
-blt::table . \
- 0,0 .header -fill x \
- 1,0 .bc -fill both \
- 2,0 .footer -fill x
-
-blt::table configure . r0 r2 -resize none
-
-Blt_ZoomStack .bc
-Blt_Crosshairs .bc
-Blt_ActiveLegend .bc
-Blt_ClosestPoint .bc
-
-if 0 {
-set printer [blt::printer open [lindex [blt::printer names] 0]]
-blt::printer getattr $printer attrs
-set attrs(Orientation) Portrait
-blt::printer setattr $printer attrs
-after 2000 {
- $graph print2 $printer
- blt::printer close $printer
-}
-}
-
-.bc axis bind x <Enter> {
- set axis [%W axis get current]
- %W axis configure $axis -color blue3 -titlecolor blue3
-}
-.bc axis bind x <Leave> {
- set axis [%W axis get current]
- %W axis configure $axis -color black -titlecolor black
-}
-
-
diff --git a/blt3.0.1/demos/barchart2.tcl b/blt3.0.1/demos/barchart2.tcl
deleted file mode 100755
index 0959d4a..0000000
--- a/blt3.0.1/demos/barchart2.tcl
+++ /dev/null
@@ -1,209 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-proc FormatXTicks { w value } {
-
- # Determine the element name from the value
-
- set index [expr round($value)]
- if { $index != $value } {
- return $value
- }
- incr index -1
-
- set name [lindex { A1 B1 A2 B2 C1 D1 C2 A3 E1 } $index]
- return $name
-}
-
-source scripts/stipples.tcl
-
-#image create picture bgTexture -file ./images/chalk.gif
-
-option add *Button.padX 5
-
-option add *Radiobutton.relief flat
-option add *Radiobutton.borderWidth 2
-option add *Radiobutton.highlightThickness 0
-option add *Radiobutton.font "Arial 10 bold"
-option add *Htext.tileOffset no
-
-option add *Barchart.title "Comparison of Simulators"
-
-option add *x.Command FormatXTicks
-option add *x.Title "Simulator"
-option add *y.Title "Time (hrs)"
-option add *Axis.tickInterior yes
-option add *plotPadX 0
-option add *plotPadY 0
-
-option add *activeBar.Foreground pink
-option add *activeBar.stipple dot3
-option add *Element.Background red
-option add *Element.Relief solid
-
-option add *Grid.dashes { 2 4 }
-option add *Grid.hide no
-option add *Grid.mapX ""
-
-option add *Legend.activeBorderWidth 2
-option add *Legend.activeRelief raised
-option add *Legend.anchor ne
-option add *Legend.borderWidth 0
-option add *Legend.position right
-
-set visual [winfo screenvisual .]
-if { $visual != "staticgray" && $visual != "grayscale" } {
- option add *print.background yellow
- option add *quit.background red
- option add *quit.activeBackground red2
-}
-
-blt::htext .title -text {\
- Data points with like x-coordinates, can have their bar segments displayed
- in one of the following modes (using the -barmode option):
-}
-blt::htext .header -text {
- %%
- blt::tk::radiobutton .header.stacked -text stacked -variable barMode \
- -anchor w -value "stacked" -command {
- .graph configure -barmode $barMode
- }
- .header append .header.stacked -width 1.0i -anchor w
- %% Bars are stacked on top of each other. The overall height is the
- sum of the y-coordinates.
- %%
- blt::tk::radiobutton .header.aligned -text aligned -variable barMode \
- -anchor w -value "aligned" -command {
- .graph configure -barmode $barMode
- }
- .header append .header.aligned -width 1.0i -fill x
- %% Bars are drawn side-by-side at a fraction of their normal width.
- %%
- blt::tk::radiobutton .header.overlap -text "overlap" -variable barMode \
- -anchor w -value "overlap" -command {
- .graph configure -barmode $barMode
- }
- .header append .header.overlap -width 1.0i -fill x
- %% Bars overlap slightly.
- %%
- blt::tk::radiobutton .header.normal -text "normal" -variable barMode \
- -anchor w -value "normal" -command {
- .graph configure -barmode $barMode
- }
- .header append .header.normal -width 1.0i -fill x
- %% Bars are overlayed one on top of the next.
-}
-
-blt::htext .footer -text { Hit the %%
- set im [image create picture -file ./images/stopsign.gif]
- button $htext(widget).quit -image $im -command { exit }
- $htext(widget) append $htext(widget).quit -pady 2
-%% button when you've seen enough. %%
- label $htext(widget).logo -bitmap BLT
- $htext(widget) append $htext(widget).logo
-%%}
-
-if 0 {
-set file ./images/jan25_palm3x_L.jpg
-set file ./images/blt98.gif
-set file ./images/folder.gif
-image create picture bgTexture -file $file
-set style [blt::bgpattern create tile -image bgTexture \
- -xorigin 0 -yorigin 0 -relativeto self]
-} else {
-set style [blt::bgpattern create gradient -high grey60 -low grey85 \
- -xorigin 0 -yorigin 0 -relativeto self -logscale yes]
-}
-
-blt::barchart .graph -bg $style -barwidth 0.9
-
-blt::vector X Y0 Y1 Y2 Y3 Y4
-
-X set { 1 2 3 4 5 6 7 8 9 }
-Y0 set {
- 0.729111111 0.002250000 0.09108333 0.006416667 0.026509167
- 0.007027778 0.1628611 0.06405278 0.08786667
-}
-Y1 set {
- 0.003120278 0.004638889 0.01113889 0.048888889 0.001814722
- 0.291388889 0.0503500 0.13876389 0.04513333
-}
-Y2 set {
- 11.534444444 3.879722222 4.54444444 4.460277778 2.334055556
- 1.262194444 1.8009444 4.12194444 3.24527778
-}
-Y3 set {
- 1.015750000 0.462888889 0.49394444 0.429166667 1.053694444
- 0.466111111 1.4152500 2.17538889 2.55294444
-}
-Y4 set {
- 0.022018611 0.516333333 0.54772222 0.177638889 0.021703889
- 0.134305556 0.5189278 0.07957222 0.41155556
-}
-
-
-#
-# Element attributes:
-#
-# Label yData Foreground Background Stipple Borderwidth
-set attributes {
- "Setup" Y1 lightyellow3 lightyellow1 fdiagonal1 1
- "Read In" Y0 lightgoldenrod3 lightgoldenrod1 bdiagonal1 1
- "Other" Y4 lightpink3 lightpink1 fdiagonal1 1
- "Solve" Y3 cyan3 cyan1 bdiagonal1 1
- "Load" Y2 lightblue3 lightblue1 fdiagonal1 1
-}
-
-
-foreach {label yData fg bg stipple bd} $attributes {
-# set img [image create picture -width 5 -height 5]
-# foreach {r g b} [winfo rgb . $bg] break
-# set r [expr int($r / 257.0)]
-# set g [expr int($g / 257.0)]
-# set b [expr int($b / 257.0)]
-# set color [format "0xA0%0.2x%0.2x%0.2x" $r $g $b]
-# puts stderr color=$color
-# $img blank $color
- set pat [blt::bgpattern create solid -color $bg -opacity 90.0]
- .graph element create $yData -label $label -bd $bd -relief raised \
- -y $yData -x X -outline $fg -fill $pat
-}
-.header.stacked invoke
-
-blt::table . \
- 0,0 .title -fill x \
- 1,0 .header -fill x \
- 2,0 .graph -fill both \
- 3,0 .footer -fill x
-
-blt::table configure . r0 r1 r3 -resize none
-
-Blt_ZoomStack .graph
-Blt_Crosshairs .graph
-Blt_ActiveLegend .graph
-Blt_ClosestPoint .graph
-
-.graph marker bind all <B2-Motion> {
- set coords [%W invtransform %x %y]
- catch { %W marker configure [%W marker get current] -coords $coords }
-}
-
-.graph marker bind all <Enter> {
- set marker [%W marker get current]
- catch { %W marker configure $marker -bg green}
-}
-
-.graph marker bind all <Leave> {
- set marker [%W marker get current]
- catch { %W marker configure $marker -bg ""}
-}
-
-.graph element bind all <Enter> {
- set data [.graph element closest %x %y]
- if { $data != "" } {
- array set info $data
- puts stderr "$info(x) $info(y)"
- }
-}
diff --git a/blt3.0.1/demos/barchart3.tcl b/blt3.0.1/demos/barchart3.tcl
deleted file mode 100755
index 52417bd..0000000
--- a/blt3.0.1/demos/barchart3.tcl
+++ /dev/null
@@ -1,123 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-
-source scripts/demo.tcl
-source scripts/stipples.tcl
-source scripts/patterns.tcl
-
-option add *graph.xTitle "X Axis Label"
-option add *graph.yTitle "Y Axis Label"
-option add *graph.title "A Simple Barchart"
-option add *graph.xFont *Times-Medium-R*12*
-option add *graph.elemBackground white
-option add *graph.elemRelief raised
-
-set visual [winfo screenvisual .]
-if { $visual != "staticgray" && $visual != "grayscale" } {
- option add *print.background yellow
- option add *quit.background red
-}
-
-blt::htext .header -text {
-This is an example of the barchart widget. To create a postscript
-file "bar.ps", press the %%
-button $htext(widget).print -text {Print} -command {
- $graph postscript output bar.ps -maxpect 1
-}
-$htext(widget) append $htext(widget).print
-%% button.}
-
-set graph [blt::barchart .b]
-$graph configure \
- -invert false \
- -baseline 1.2
-$graph xaxis configure \
- -command FormatLabel \
- -descending no
-$graph legend configure \
- -hide yes
-
-blt::htext .footer -text {Hit the %%
- button $htext(widget).quit -text quit -command exit
- $htext(widget) append $htext(widget).quit
-%% button when you've seen enough.%%
- label $htext(widget).logo -bitmap BLT
- $htext(widget) append $htext(widget).logo -padx 20
-%%}
-
-set data {
- One 1 1 red green bdiagonal1 raised
- Two 2 2 green blue bdiagonal2 raised
- Three 3 3 blue purple checker2 raised
- Four 4 4 purple orange checker3 raised
- Five 5 5 orange brown cross1 raised
- Six 6 6 brown cyan cross2 raised
- Seven 7 7 cyan navy cross3 raised
- Eight 8 8 navy red crossdiag raised
- Nine 9 -1 pink black "" solid
- Ten 10 -2 seagreen palegreen hobbes raised
- Eleven 11 -3 blue blue4 "" raised
-}
-
-foreach { name x y fg bg bitmap relief } $data {
- $graph element create $name \
- -data { $x $y } -fg $fg -bg $bg -stipple $bitmap \
- -relief $relief -bd 2
- set labels($x) $name
-}
-
-$graph marker create bitmap \
- -coords { 4 0.3 } -anchor center \
- -bitmap @bitmaps/sharky.xbm \
- -name bitmap -fill ""
-
-$graph marker create text \
- -coords { 10 5.3 } -anchor center \
- -text "Hi there" \
- -name text -rotate 45 -font "Arial 14" -fg blue
-
-$graph marker create polygon \
- -coords { 5 0 7 2 10 10 10 2 } \
- -name poly -linewidth 1 -fill "" -outline red4 -under yes
-
-blt::table . \
- .header 0,0 -padx .25i \
- $graph 1,0 -fill both \
- .footer 2,0 -padx .25i
-
-blt::table configure . r0 r2 -resize none
-
-wm min . 0 0
-
-proc FormatLabel { w value } {
- global labels
-
- set value [expr int(round($value))]
- # Determine the element name from the value
- if { [info exists labels($value)] } {
- return "$labels($value)"
- }
- return "$value"
-}
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
-
-$graph marker bind all <B3-Motion> {
- set coords [%W invtransform %x %y]
- catch { %W marker configure [%W marker get current] -coords $coords }
-}
-
-$graph marker bind all <Enter> {
- set marker [%W marker get current]
- catch { %W marker configure $marker -fill green3 }
-}
-
-$graph marker bind all <Leave> {
- set marker [%W marker get current]
- catch { %W marker configure $marker -fill "" }
-}
-
diff --git a/blt3.0.1/demos/barchart4.tcl b/blt3.0.1/demos/barchart4.tcl
deleted file mode 100755
index 7f8f4bd..0000000
--- a/blt3.0.1/demos/barchart4.tcl
+++ /dev/null
@@ -1,101 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-proc random {{max 1.0} {min 0.0}} {
- global randomSeed
-
- set randomSeed [expr (7141*$randomSeed+54773) % 259200]
- set num [expr $randomSeed/259200.0*($max-$min)+$min]
- return $num
-}
-set randomSeed 14823
-
-
-set graph .graph
-
-source scripts/stipples.tcl
-source scripts/patterns.tcl
-
-
-option add *x.Title "X Axis"
-option add *y.Title "Y Axis"
-option add *LineMarker.Foreground yellow
-
-set visual [winfo screenvisual .]
-if { $visual != "staticgray" && $visual != "grayscale" } {
- option add *print.background yellow
- option add *quit.background red
- option add *graph.background palegreen
-}
-
-blt::htext .header -text \
-{ This is an example of the barchart widget. The barchart has
- many components; x and y axis, legend, crosshairs, elements, etc.
- To create a postscript file "bar.ps", press the %%
- set w $htext(widget)
- button $w.print -text {Print} -command {
- $graph postscript output bar.ps
- }
- $w append $w.print
-
-%% button.
-}
-blt::barchart $graph
-$graph xaxis configure -rotate 90 -stepsize 0
-
-blt::htext .footer -text { Hit the %%
- set im [image create picture -file ./images/stopsign.gif]
- button $htext(widget).quit -image $im -command { exit }
- $htext(widget) append $htext(widget).quit -pady 2
-%% button when you've seen enough. %%
- label $htext(widget).logo -bitmap BLT
- $htext(widget) append $htext(widget).logo
-%%}
-
-set attributes {
- red bdiagonal1
- orange bdiagonal2
- yellow fdiagonal1
- green fdiagonal2
- blue hline1
- cyan hline2
- magenta vline1
- violetred vline2
- purple crossdiag
- lightblue hobbes
-}
-
-set count 0
-foreach { color stipple } $attributes {
- $graph pen create pen$count \
- -fill ${color}1 -outline ${color}4 -relief solid
- lappend styles [list pen$count $count $count]
- incr count
-}
-
-blt::vector x y w
-
-x seq 0 1000 400
-y expr random(x)*90.0
-w expr round(y/10.0)%$count
-y expr y+10.0
-
-$graph element create data -label {} \
- -x x -y y -weight w -styles $styles
-
-blt::table . \
- 0,0 .header -fill x \
- 1,0 .graph -fill both \
- 2,0 .footer -fill x
-
-blt::table configure . r0 r2 -resize none
-
-wm min . 0 0
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
-
diff --git a/blt3.0.1/demos/barchart5.tcl b/blt3.0.1/demos/barchart5.tcl
deleted file mode 100755
index 982c866..0000000
--- a/blt3.0.1/demos/barchart5.tcl
+++ /dev/null
@@ -1,57 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-source scripts/stipples.tcl
-
-option add *graph.x.Title "X Axis Label"
-option add *graph.y.Title "Y Axis Label"
-option add *graph.title "A Simple Barchart"
-option add *graph.Element.Relief raised
-
-blt::htext .htext -text \
-{ This is an example of the barchart widget. The barchart has
- many components; x and y axis, legend, crosshairs, elements, etc.
- To create a postscript file "bar.ps", press the %%
- set w $htext(widget)
- button $w.print -text {Print} -command {
- $graph postscript output bar.ps
- }
- $w append $w.print
-
-%% button.
-%%
-
- set graph [blt::barchart .htext.graph]
- $graph xaxis configure -stepsize 0
- $w append $graph -fill both -padx 4
-
-%%
- Hit the %%
-
- button $w.quit -text quit -command exit
- $w append $w.quit
-
-%% button when you've seen enough.%%
-
- label $w.logo -bitmap BLT
- $w append $w.logo -padx 20
-
-%% }
-
-set tcl_precision 15
-blt::vector create x
-blt::vector create y
-x seq -5.0 5.0 50
-y expr sin(x)
-set barWidth 0.19
-
-$graph element create sin -relief raised -bd 1 -x x -y y -barwidth $barWidth
-blt::table . .htext -fill both
-
-wm min . 0 0
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
diff --git a/blt3.0.1/demos/bgexec1.tcl b/blt3.0.1/demos/bgexec1.tcl
deleted file mode 100755
index 2753387..0000000
--- a/blt3.0.1/demos/bgexec1.tcl
+++ /dev/null
@@ -1,198 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-# --------------------------------------------------------------------------
-# Starting with Tcl 8.x, the BLT commands are stored in their own
-# namespace called "blt". The idea is to prevent name clashes with
-# Tcl commands and variables from other packages, such as a "table"
-# command in two different packages.
-#
-# You can access the BLT commands in a couple of ways. You can prefix
-# all the BLT commands with the namespace qualifier "blt::"
-#
-# blt::graph .g
-# blt::table . .g -resize both
-#
-# or you can import all the command into the global namespace.
-#
-# namespace import blt::*
-# graph .g
-# table . .g -resize both
-#
-# --------------------------------------------------------------------------
-
-if { $tcl_version >= 8.0 } {
- namespace import blt::*
- namespace import -force blt::tk::*
-}
-
-source scripts/demo.tcl
-
-bitmap define blt.0 {{40 40} {
- 00 00 00 00 00 00 fc 07 00 00 00 04 08 00 00 00 04 04 00 00 00 e4 03 00
- 00 00 64 fe 07 00 00 64 02 04 00 00 e4 03 04 00 00 64 7e 02 00 00 64 1a
- 02 00 00 e4 1b 01 00 00 04 1a 01 00 00 04 1a 01 00 00 fc 1b 02 00 00 0c
- 1a 02 00 00 0c 02 04 00 00 0c 02 f4 03 80 ed fe 07 04 e0 0c 00 20 09 10
- 0c 00 00 12 10 0c 00 00 10 30 00 00 00 19 d0 03 00 00 14 b0 fe ff ff 1b
- 50 55 55 55 0d e8 aa aa aa 16 e4 ff ff ff 2f f4 ff ff ff 27 d8 ae aa bd
- 2d 6c 5f d5 67 1b bc f3 7f d0 36 f8 01 10 cc 1f e0 45 8e 92 0f b0 32 41
- 43 0b d0 cf 3c 7c 0d b0 aa c2 ab 0a 60 55 55 55 05 c0 ff ab aa 03 00 00
- fe ff 00 00 00 00 00 00}
-}
-
-bitmap define blt.1 {{40 40} {
- 00 00 00 00 00 00 fc 07 00 00 00 04 08 00 00 00 04 04 00 00 00 e4 ff 0f
- 00 00 64 06 08 00 00 64 06 08 00 00 e4 ff 04 00 00 64 36 04 00 00 64 36
- 02 00 00 e4 37 02 00 00 04 34 02 00 00 04 34 04 00 00 fc 35 04 00 00 0c
- 04 08 00 00 0c 04 08 00 00 0c fc ef 03 80 ed 01 00 04 e0 0c 00 20 09 10
- 0c 00 00 12 10 0c 00 00 10 30 00 00 00 19 d0 03 00 00 14 b0 fe ff ff 1b
- 50 55 55 55 0d e8 aa aa aa 16 e4 ff ff ff 2f f4 ff ff ff 27 d8 ae aa bd
- 2d 6c 5f d5 67 1b bc f3 7f d0 36 f8 01 10 cc 1f e0 45 8e 92 0f b0 32 41
- 43 0b d0 cf 3c 7c 0d b0 aa c2 ab 0a 60 55 55 55 05 c0 ff ab aa 03 00 00
- fe ff 00 00 00 00 00 00}
-}
-
-bitmap define blt.2 {{40 40} {
- 00 00 00 00 00 00 fc 0f 00 00 00 04 10 00 00 00 04 10 00 00 00 e4 fb 3f
- 00 00 64 0e 20 00 00 64 0e 20 00 00 e4 fb 13 00 00 64 ce 10 00 00 64 ce
- 08 00 00 e4 cb 08 00 00 04 c8 08 00 00 04 c8 10 00 00 fc cf 10 00 00 0c
- 08 20 00 00 0c 08 20 00 00 0c f8 bf 03 80 ed 03 00 04 e0 0c 00 20 09 10
- 0c 00 00 12 10 0c 00 00 10 30 00 00 00 19 d0 03 00 00 14 b0 fe ff ff 1b
- 50 55 55 55 0d e8 aa aa aa 16 e4 ff ff ff 2f f4 ff ff ff 27 d8 ae aa bd
- 2d 6c 5f d5 67 1b bc f3 7f d0 36 f8 01 10 cc 1f e0 45 8e 92 0f b0 32 41
- 43 0b d0 cf 3c 7c 0d b0 aa c2 ab 0a 60 55 55 55 05 c0 ff ab aa 03 00 00
- fe ff 00 00 00 00 00 00}
-}
-
-bitmap define blt.3 {{40 40} {
- 00 00 00 00 00 00 fc 0f 00 00 00 04 f0 ff 00 00 04 00 80 00 00 e4 03 80
- 00 00 64 d6 4f 00 00 64 16 43 00 00 e4 13 23 00 00 64 16 23 00 00 64 16
- 23 00 00 e4 13 43 00 00 04 70 43 00 00 04 00 80 00 00 fc 0f 80 00 00 0c
- f0 ff 00 00 0c 00 00 00 00 0c f8 ff 03 80 ed 07 00 04 e0 0c 00 20 09 10
- 0c 00 00 12 10 0c 00 00 10 30 00 00 00 19 d0 03 00 00 14 b0 fe ff ff 1b
- 50 55 55 55 0d e8 aa aa aa 16 e4 ff ff ff 2f f4 ff ff ff 27 d8 ae aa bd
- 2d 6c 5f d5 67 1b bc f3 7f d0 36 f8 01 10 cc 1f e0 45 8e 92 0f b0 32 41
- 43 0b d0 cf 3c 7c 0d b0 aa c2 ab 0a 60 55 55 55 05 c0 ff ab aa 03 00 00
- fe ff 00 00 00 00 00 00}
-}
-
-bitmap define blt.4 {{40 40} {
- 00 00 00 00 00 00 fc ff ff 03 00 04 00 00 02 00 04 00 00 02 00 e4 33 3f
- 01 00 64 36 0c 01 00 64 36 8c 00 00 e4 33 8c 00 00 64 36 8c 00 00 64 36
- 0c 01 00 e4 f3 0d 01 00 04 00 00 02 00 04 00 00 02 00 fc ff ff 03 00 0c
- 00 00 00 00 0c 00 00 00 00 0c f8 ff 03 80 ed 07 00 04 e0 0c 00 20 09 10
- 0c 00 00 12 10 0c 00 00 10 30 00 00 00 19 d0 03 00 00 14 b0 fe ff ff 1b
- 50 55 55 55 0d e8 aa aa aa 16 e4 ff ff ff 2f f4 ff ff ff 27 d8 ae aa bd
- 2d 6c 5f d5 67 1b bc f3 7f d0 36 f8 01 10 cc 1f e0 45 8e 92 0f b0 32 41
- 43 0b d0 cf 3c 7c 0d b0 aa c2 ab 0a 60 55 55 55 05 c0 ff ab aa 03 00 00
- fe ff 00 00 00 00 00 00}
-}
-
-
-
-#set animate(colors) { #ff8813 #ffaa13 #ffcc13 #ffff13 #ffcc13 #ffaa13 #ff8813 }
-bitmap define blt.5 [bitmap data blt.3]
-bitmap define blt.6 [bitmap data blt.2]
-bitmap define blt.7 [bitmap data blt.1]
-
-
-set interval 200
-
-proc AnimateBitmap { index } {
- global interval afterId
- if { ![winfo exists .logo] } {
- return
- }
- if { $index >= 0 } {
- .logo configure -bitmap blt.$index
- incr index
- if { $index >= 7 } {
- set index 0
- }
- set afterId [after $interval "AnimateBitmap $index"]
- }
-}
-
-set length 80
-
-option add *text.yScrollCommand { .vscroll set }
-option add *text.relief sunken
-option add *text.width $length
-option add *text.height 10
-option add *text.borderWidth 2
-option add *vscroll.command { .text yview }
-option add *vscroll.minSlider 4p
-option add *quit.command { exit }
-option add *quit.text { quit }
-option add *stop.command { set bgStatus {} }
-option add *stop.text { stop }
-option add *logo.relief sunken
-option add *logo.padX 4
-option add *title.text "Virtual Memory Statistics"
-option add *title.font -*-Helvetica-Bold-R-*-*-14-*-*-*-*-*-*-*
-
-set visual [winfo screenvisual .]
-if { $visual != "staticgray" && $visual != "grayscale" } {
- option add *text.background lightblue
- option add *text.foreground blue
- option add *quit.background red
- option add *quit.foreground white
- option add *stop.background yellow
- option add *stop.foreground navyblue
- option add *logo.background beige
- option add *logo.foreground brown
-}
-
-# Create widgets
-text .text
-scrollbar .vscroll
-button .quit
-button .stop
-label .logo
-label .title
-
-# Layout widgets in table
-blt::table . \
- .title 0,0 -columnspan 4 \
- .text 1,0 -columnspan 3 \
- .vscroll 1,3 -fill y \
- .logo 2,0 -anchor w -padx 10 -reqheight .6i -pady 4 \
- .stop 2,1 \
- .quit 2,2
-
-set buttonWidth 1i
-blt::table configure . c1 c2 -width 1i
-blt::table configure . c3 -resize none
-blt::table configure . .stop .quit -reqwidth $buttonWidth -anchor e
-blt::table configure . .title .text -fill both
-
-wm min . 0 0
-
-proc DisplayStats { data } {
- .text insert end "$data\n"
- set textlen [expr int([.text index end])]
- scan [.vscroll get] "%s %s %s %s" total window first last
- if { $textlen > $total } {
- .text yview [expr $textlen-$window]
- }
- update idletasks
-}
-
-set bgStatus {}
-
-AnimateBitmap 0
-
-#
-# Pick a command that
-# 1) periodically writes output and
-# 2) flushes output each time.
-#
-set command { vmstat 1 }
-#set command { netstat -c }
-
-catch { eval "bgexec bgStatus -onoutput DisplayStats $command" }
-
-# Turn off animation by canceling any pending after task.
-if { [info exists afterId] } {
- after cancel $afterId
-}
diff --git a/blt3.0.1/demos/bgexec2.tcl b/blt3.0.1/demos/bgexec2.tcl
deleted file mode 100755
index 7639404..0000000
--- a/blt3.0.1/demos/bgexec2.tcl
+++ /dev/null
@@ -1,46 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-# --------------------------------------------------------------------------
-# Starting with Tcl 8.x, the BLT commands are stored in their own
-# namespace called "blt". The idea is to prevent name clashes with
-# Tcl commands and variables from other packages, such as a "table"
-# command in two different packages.
-#
-# You can access the BLT commands in a couple of ways. You can prefix
-# all the BLT commands with the namespace qualifier "blt::"
-#
-# blt::graph .g
-# blt::table . .g -resize both
-#
-# or you can import all the command into the global namespace.
-#
-# namespace import blt::*
-# graph .g
-# table . .g -resize both
-#
-# --------------------------------------------------------------------------
-
-if { $tcl_version >= 8.0 } {
- namespace import blt::*
-# namespace import -force blt::tk::*
-}
-
-source scripts/demo.tcl
-
-proc ShowResult { name1 name2 how } {
- global var
- .l$name2 configure -text "$var($name2)"
- after 2000 "blt::table forget .l$name2"
-}
-
-for { set i 1 } { $i <= 20 } { incr i } {
- label .l$i
- blt::table . .l$i $i,0
- set pid [bgexec var($i) du /usr/include &]
- .l$i configure -text "Starting #$i pid=$pid"
- trace variable var($i) w ShowResult
- update
- after 500
-}
-
diff --git a/blt3.0.1/demos/bgexec3.tcl b/blt3.0.1/demos/bgexec3.tcl
deleted file mode 100755
index 364484d..0000000
--- a/blt3.0.1/demos/bgexec3.tcl
+++ /dev/null
@@ -1,224 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-# --------------------------------------------------------------------------
-# Starting with Tcl 8.x, the BLT commands are stored in their own
-# namespace called "blt". The idea is to prevent name clashes with
-# Tcl commands and variables from other packages, such as a "table"
-# command in two different packages.
-#
-# You can access the BLT commands in a couple of ways. You can prefix
-# all the BLT commands with the namespace qualifier "blt::"
-#
-# blt::graph .g
-# blt::table . .g -resize both
-#
-# or you can import all the command into the global namespace.
-#
-# namespace import blt::*
-# graph .g
-# table . .g -resize both
-#
-# --------------------------------------------------------------------------
-
-if { $tcl_version >= 8.0 } {
- namespace import blt::*
- namespace import -force blt::tk::*
-}
-
-source scripts/demo.tcl
-
-bitmap define blt.0 {{40 40} {
- 00 00 00 00 00 00 fc 07 00 00 00 04 08 00 00 00 04 04 00 00 00 e4 03 00
- 00 00 64 fe 07 00 00 64 02 04 00 00 e4 03 04 00 00 64 7e 02 00 00 64 1a
- 02 00 00 e4 1b 01 00 00 04 1a 01 00 00 04 1a 01 00 00 fc 1b 02 00 00 0c
- 1a 02 00 00 0c 02 04 00 00 0c 02 f4 03 80 ed fe 07 04 e0 0c 00 20 09 10
- 0c 00 00 12 10 0c 00 00 10 30 00 00 00 19 d0 03 00 00 14 b0 fe ff ff 1b
- 50 55 55 55 0d e8 aa aa aa 16 e4 ff ff ff 2f f4 ff ff ff 27 d8 ae aa bd
- 2d 6c 5f d5 67 1b bc f3 7f d0 36 f8 01 10 cc 1f e0 45 8e 92 0f b0 32 41
- 43 0b d0 cf 3c 7c 0d b0 aa c2 ab 0a 60 55 55 55 05 c0 ff ab aa 03 00 00
- fe ff 00 00 00 00 00 00}
-}
-
-bitmap define blt.1 {{40 40} {
- 00 00 00 00 00 00 fc 07 00 00 00 04 08 00 00 00 04 04 00 00 00 e4 ff 0f
- 00 00 64 06 08 00 00 64 06 08 00 00 e4 ff 04 00 00 64 36 04 00 00 64 36
- 02 00 00 e4 37 02 00 00 04 34 02 00 00 04 34 04 00 00 fc 35 04 00 00 0c
- 04 08 00 00 0c 04 08 00 00 0c fc ef 03 80 ed 01 00 04 e0 0c 00 20 09 10
- 0c 00 00 12 10 0c 00 00 10 30 00 00 00 19 d0 03 00 00 14 b0 fe ff ff 1b
- 50 55 55 55 0d e8 aa aa aa 16 e4 ff ff ff 2f f4 ff ff ff 27 d8 ae aa bd
- 2d 6c 5f d5 67 1b bc f3 7f d0 36 f8 01 10 cc 1f e0 45 8e 92 0f b0 32 41
- 43 0b d0 cf 3c 7c 0d b0 aa c2 ab 0a 60 55 55 55 05 c0 ff ab aa 03 00 00
- fe ff 00 00 00 00 00 00}
-}
-
-bitmap define blt.2 {{40 40} {
- 00 00 00 00 00 00 fc 0f 00 00 00 04 10 00 00 00 04 10 00 00 00 e4 fb 3f
- 00 00 64 0e 20 00 00 64 0e 20 00 00 e4 fb 13 00 00 64 ce 10 00 00 64 ce
- 08 00 00 e4 cb 08 00 00 04 c8 08 00 00 04 c8 10 00 00 fc cf 10 00 00 0c
- 08 20 00 00 0c 08 20 00 00 0c f8 bf 03 80 ed 03 00 04 e0 0c 00 20 09 10
- 0c 00 00 12 10 0c 00 00 10 30 00 00 00 19 d0 03 00 00 14 b0 fe ff ff 1b
- 50 55 55 55 0d e8 aa aa aa 16 e4 ff ff ff 2f f4 ff ff ff 27 d8 ae aa bd
- 2d 6c 5f d5 67 1b bc f3 7f d0 36 f8 01 10 cc 1f e0 45 8e 92 0f b0 32 41
- 43 0b d0 cf 3c 7c 0d b0 aa c2 ab 0a 60 55 55 55 05 c0 ff ab aa 03 00 00
- fe ff 00 00 00 00 00 00}
-}
-
-bitmap define blt.3 {{40 40} {
- 00 00 00 00 00 00 fc 0f 00 00 00 04 f0 ff 00 00 04 00 80 00 00 e4 03 80
- 00 00 64 d6 4f 00 00 64 16 43 00 00 e4 13 23 00 00 64 16 23 00 00 64 16
- 23 00 00 e4 13 43 00 00 04 70 43 00 00 04 00 80 00 00 fc 0f 80 00 00 0c
- f0 ff 00 00 0c 00 00 00 00 0c f8 ff 03 80 ed 07 00 04 e0 0c 00 20 09 10
- 0c 00 00 12 10 0c 00 00 10 30 00 00 00 19 d0 03 00 00 14 b0 fe ff ff 1b
- 50 55 55 55 0d e8 aa aa aa 16 e4 ff ff ff 2f f4 ff ff ff 27 d8 ae aa bd
- 2d 6c 5f d5 67 1b bc f3 7f d0 36 f8 01 10 cc 1f e0 45 8e 92 0f b0 32 41
- 43 0b d0 cf 3c 7c 0d b0 aa c2 ab 0a 60 55 55 55 05 c0 ff ab aa 03 00 00
- fe ff 00 00 00 00 00 00}
-}
-
-bitmap define blt.4 {{40 40} {
- 00 00 00 00 00 00 fc ff ff 03 00 04 00 00 02 00 04 00 00 02 00 e4 33 3f
- 01 00 64 36 0c 01 00 64 36 8c 00 00 e4 33 8c 00 00 64 36 8c 00 00 64 36
- 0c 01 00 e4 f3 0d 01 00 04 00 00 02 00 04 00 00 02 00 fc ff ff 03 00 0c
- 00 00 00 00 0c 00 00 00 00 0c f8 ff 03 80 ed 07 00 04 e0 0c 00 20 09 10
- 0c 00 00 12 10 0c 00 00 10 30 00 00 00 19 d0 03 00 00 14 b0 fe ff ff 1b
- 50 55 55 55 0d e8 aa aa aa 16 e4 ff ff ff 2f f4 ff ff ff 27 d8 ae aa bd
- 2d 6c 5f d5 67 1b bc f3 7f d0 36 f8 01 10 cc 1f e0 45 8e 92 0f b0 32 41
- 43 0b d0 cf 3c 7c 0d b0 aa c2 ab 0a 60 55 55 55 05 c0 ff ab aa 03 00 00
- fe ff 00 00 00 00 00 00}
-}
-
-set program tclsh
-if { [info exists tcl_platform ] } {
- puts stderr $tcl_platform(platform)
- if { $tcl_platform(platform) == "windows" } {
- set shells [glob C:/Program\ Files/Tcl/bin/tclsh8*.exe ]
- set program [lindex $shells 0]
- }
-}
-if { ![file executable $program] } {
-# error "Can't execute $program"
-}
-set command [list $program scripts/bgtest.tcl]
-set animate(index) -1
-set animate(interval) 200
-#set animate(colors) { #ff8813 #ffaa13 #ffcc13 #ffff13 #ffcc13 #ffaa13 #ff8813 }
-bitmap define blt.5 [bitmap data blt.3]
-bitmap define blt.6 [bitmap data blt.2]
-bitmap define blt.7 [bitmap data blt.1]
-
-proc Animate {} {
- global animate
- if { [info commands .logo] != ".logo" } {
- set animate(index) 0
- return
- }
- if { $animate(index) >= 0 } {
- .logo configure -bitmap blt.$animate(index)
- incr animate(index)
- if { $animate(index) >= 7 } {
- set animate(index) 0
- }
- after $animate(interval) Animate
- }
-}
-
-
-proc InsertText { string tag } {
- .text insert end "$tag: " "" $string $tag
- set textlen [expr int([.text index end])]
- scan [.vscroll get] "%s %s %s %s" total window first last
- if { $textlen > $total } {
- .text yview [expr $textlen-$window]
- }
- update idletasks
- update
-}
-
-proc DisplayOutput { data } {
- InsertText "$data\n" stdout
-}
-
-proc DisplayErrors { data } {
- InsertText "$data\n" stderr
-}
-
-set length 80
-
-option add *text.yScrollCommand { .vscroll set }
-option add *text.relief sunken
-option add *text.width 20
-option add *text.height 10
-option add *text.height 10
-option add *text.borderWidth 2
-option add *vscroll.command { .text yview }
-option add *vscroll.minSlider 4p
-option add *stop.command { set results {} }
-option add *stop.text { stop }
-option add *logo.relief sunken
-option add *logo.padX 4
-option add *title.text "Catching stdout and stderr"
-option add *title.font -*-Helvetica-Bold-R-*-*-14-*-*-*-*-*-*-*
-
-set visual [winfo screenvisual .]
-if { [string match *color $visual] } {
- option add *text.background white
- option add *text.foreground blue
- option add *stop.background yellow
- option add *stop.activeBackground yellow2
- option add *stop.foreground navyblue
- option add *start.activeBackground green2
- option add *start.background green
- option add *start.foreground navyblue
- option add *logo.background beige
- option add *logo.foreground brown
-}
-
-proc Start { command } {
- global results animate
- .text delete 1.0 end
- if { $animate(index) < 0 } {
- set results {}
- set animate(index) 0
- eval "blt::ptyexec -variable results -error barney -output fred -killsignal SIGINT \
- -onoutput DisplayOutput -onerror DisplayErrors -linebuffered no \
- $command &"
- Animate
- }
-}
-
-proc Stop { } {
- global results animate
- set results {}
- set animate(index) -1
-}
-
-# Create widgets
-text .text
-.text tag configure stdout -font { Courier-Bold 14 } -foreground green2
-.text tag configure stderr -font { Courier 14 } -foreground red2
-
-scrollbar .vscroll
-button .start -text "Start" -command [list Start $command]
-button .stop -text "Stop" -command Stop
-label .logo -bitmap blt.0
-label .title
-
-# Layout widgets in table
-blt::table . \
- .title 0,0 -columnspan 4 \
- .text 1,0 -columnspan 3 \
- .vscroll 1,3 -fill y \
- .logo 2,0 -anchor w -padx 10 -reqheight .6i -pady 4 \
- .start 2,1 \
- .stop 2,2
-
-set buttonWidth 1i
-blt::table configure . c1 c2 -width 1i
-blt::table configure . c3 r0 r2 -resize none
-blt::table configure . .start .stop -reqwidth $buttonWidth -anchor e
-blt::table configure . .title .text -fill both
-
-wm min . 0 0
-
-
diff --git a/blt3.0.1/demos/bgexec4.tcl b/blt3.0.1/demos/bgexec4.tcl
deleted file mode 100755
index 1bad07e..0000000
--- a/blt3.0.1/demos/bgexec4.tcl
+++ /dev/null
@@ -1,180 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-# --------------------------------------------------------------------------
-# Starting with Tcl 8.x, the BLT commands are stored in their own
-# namespace called "blt". The idea is to prevent name clashes with
-# Tcl commands and variables from other packages, such as a "table"
-# command in two different packages.
-#
-# You can access the BLT commands in a couple of ways. You can prefix
-# all the BLT commands with the namespace qualifier "blt::"
-#
-# blt::graph .g
-# blt::table . .g -resize both
-#
-# or you can import all the command into the global namespace.
-#
-# namespace import blt::*
-# graph .g
-# table . .g -resize both
-#
-# --------------------------------------------------------------------------
-
-if { $tcl_version >= 8.0 } {
- namespace import blt::*
- namespace import -force blt::tk::*
-}
-
-source scripts/demo.tcl
-source scripts/globe.tcl
-
-option add *HighlightThickness 0
-
-set program ../src/bltwish
-if { [info exists tcl_platform ] } {
- puts stderr $tcl_platform(platform)
- if { $tcl_platform(platform) == "windows" } {
- set shells [glob C:/Program\ Files/Tcl/bin/tclsh8*.exe ]
- set program [lindex $shells 0]
- }
-}
-if { ![file executable $program] } {
- error "Can't execute $program"
-}
-
-set command [list $program scripts/bgtest.tcl]
-
-array set animate {
- index -1
- interval 200
- colors "#ff8813 #ffaa13 #ffcc13 #ffff13 #ffcc13 #ffaa13 #ff8813"
- numBitmaps 30
- prefix globe
-}
-
-proc Animate {} {
- global animate
- if { [info commands .logo] != ".logo" } {
- set animate(index) 0
- return
- }
- if { $animate(index) >= 0 } {
- .logo configure -bitmap $animate(prefix).$animate(index)
- incr animate(index)
- if { $animate(index) >= $animate(numBitmaps) } {
- set animate(index) 0
- }
- after $animate(interval) Animate
- }
-}
-
-proc InsertText { string tag } {
- .text insert end "$tag: " "" $string $tag
- set textlen [expr int([.text index end])]
- scan [.vscroll get] "%s %s %s %s" total window first last
- if { $textlen > $total } {
- .text yview [expr $textlen-$window]
- }
- update idletasks
-}
-
-proc DisplayOutput { name1 name2 how } {
- upvar #0 $name1 arr
-
- InsertText "$arr($name2)\n" stdout
- set arr($name2) {}
-}
-
-proc DisplayErrors { name1 name2 how } {
- upvar #0 $name1 arr
-
- InsertText "$arr($name2)\n" stderr
- set arr($name2) {}
-}
-
-
-option add *text.yScrollCommand { .vscroll set }
-option add *text.relief sunken
-option add *text.width 20
-option add *text.height 10
-option add *text.height 10
-option add *text.borderWidth 2
-option add *vscroll.command { .text yview }
-option add *vscroll.minSlider 4p
-option add *stop.command { set results {} }
-option add *stop.text { stop }
-option add *logo.padX 4
-option add *title.text "Catching stdout and stderr"
-option add *title.font -*-Helvetica-Bold-R-*-*-14-*-*-*-*-*-*-*
-
-set visual [winfo screenvisual .]
-if { [string match *color $visual] } {
- option add *text.background white
- option add *text.foreground blue
- option add *stop.background yellow
- option add *stop.activeBackground yellow2
- option add *stop.foreground navyblue
- option add *start.activeBackground green2
- option add *start.background green
- option add *start.foreground navyblue
- option add *logo.background beige
- option add *logo.foreground brown
- option add *logo.foreground green4
- option add *title.background lightblue
- option add *logo.background lightblue
-}
-. configure -bg lightblue
-
-trace variable results(stdout) w DisplayOutput
-trace variable results(stderr) w DisplayErrors
-
-proc Start { command } {
- global results animate
- .text delete 1.0 end
- if { $animate(index) < 0 } {
- set results(status) {}
- eval "bgexec results(status) -lasterror results(stderr) \
- -lastoutput results(stdout) $command &"
- set animate(index) 0
- Animate
- }
-}
-
-proc Stop { } {
- global results animate
- set results(status) {}
- set animate(index) -1
-}
-
-# Create widgets
-text .text
-.text tag configure stdout -font -*-Helvetica-Bold-R-*-*-18-*-*-*-*-*-*-* \
- -foreground green2
-.text tag configure stderr -font -*-Helvetica-Medium-O-*-*-18-*-*-*-*-*-*-* \
- -foreground red2
-
-scrollbar .vscroll
-button .start -text "Start" -command [list Start $command]
-button .stop -text "Stop" -command Stop
-label .logo -bitmap globe.0
-label .title
-
-# Layout widgets in table
-blt::table . \
- .title 0,0 -columnspan 4 \
- .text 1,0 -columnspan 3 \
- .vscroll 1,3 -fill y \
- .logo 2,0 -anchor w -padx 10 -reqheight .6i -pady 4 \
- .start 2,1 \
- .stop 2,2
-
-set buttonWidth 1i
-blt::table configure . c1 c2 -width 1i
-blt::table configure . c3 r0 r2 -resize none
-blt::table configure . .start .stop -reqwidth $buttonWidth -anchor e
-blt::table configure . .title .text -fill both
-
-wm min . 0 0
-
-
diff --git a/blt3.0.1/demos/bgexec5.tcl b/blt3.0.1/demos/bgexec5.tcl
deleted file mode 100755
index aa228d7..0000000
--- a/blt3.0.1/demos/bgexec5.tcl
+++ /dev/null
@@ -1,47 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-# --------------------------------------------------------------------------
-# Starting with Tcl 8.x, the BLT commands are stored in their own
-# namespace called "blt". The idea is to prevent name clashes with
-# Tcl commands and variables from other packages, such as a "table"
-# command in two different packages.
-#
-# You can access the BLT commands in a couple of ways. You can prefix
-# all the BLT commands with the namespace qualifier "blt::"
-#
-# blt::graph .g
-# blt::table . .g -resize both
-#
-# or you can import all the command into the global namespace.
-#
-# namespace import blt::*
-# graph .g
-# table . .g -resize both
-#
-# --------------------------------------------------------------------------
-
-if { $tcl_version >= 8.0 } {
- namespace import blt::*
- namespace import -force blt::tk::*
-}
-
-source scripts/demo.tcl
-
-set shell bltwish
-if { [info exists tcl_platform] && $tcl_platform(platform) == "windows" } {
- set shell "$shell.exe"
-}
-if { [file executable "../src/$shell"] } {
- set shell "../src/$shell"
-}
-
-set count 0
-foreach demo [glob barchart?.tcl] {
- bgexec var $shell $demo &
-}
-
-button .kill -text "Kill All" -command { set var 0 }
-blt::table . .kill -fill both
-
-
diff --git a/blt3.0.1/demos/bitmap.tcl b/blt3.0.1/demos/bitmap.tcl
deleted file mode 100755
index f299cfb..0000000
--- a/blt3.0.1/demos/bitmap.tcl
+++ /dev/null
@@ -1,230 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-# --------------------------------------------------------------------------
-# Starting with Tcl 8.x, the BLT commands are stored in their own
-# namespace called "blt". The idea is to prevent name clashes with
-# Tcl commands and variables from other packages, such as a "table"
-# command in two different packages.
-#
-# You can access the BLT commands in a couple of ways. You can prefix
-# all the BLT commands with the namespace qualifier "blt::"
-#
-# blt::graph .g
-# blt::table . .g -resize both
-#
-# or you can import all the command into the global namespace.
-#
-# namespace import blt::*
-# graph .g
-# table . .g -resize both
-#
-# --------------------------------------------------------------------------
-
-if { $tcl_version >= 8.0 } {
- namespace import blt::*
- namespace import -force blt::tk::*
-}
-
-source scripts/demo.tcl
-source scripts/stipples.tcl
-source scripts/patterns.tcl
-
-bitmap define wide_weave {
-#define wide_weave_width 16
-#define wide_weave_height 16
-static char wide_weave_bits[] = {
- 0x11, 0x11, 0xb8, 0xb8, 0x7c, 0x7c, 0x3a, 0x3a, 0x11, 0x11, 0xa3, 0xa3,
- 0xc7, 0xc7, 0x8b, 0x8b, 0x11, 0x11, 0xb8, 0xb8, 0x7c, 0x7c, 0x3a, 0x3a,
- 0x11, 0x11, 0xa3, 0xa3, 0xc7, 0xc7, 0x8b, 0x8b};
-}
-
-bitmap define hobbes3 {
-#define hobbes_width 25
-#define hobbes_height 25
-static char hobbes_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00,
- 0x78, 0xe0, 0x07, 0x00, 0xfc, 0xf8, 0x07, 0x00, 0xcc, 0x07, 0x04, 0x00,
- 0x0c, 0xf0, 0x0b, 0x00, 0x7c, 0x1c, 0x06, 0x00, 0x38, 0x00, 0x00, 0x00,
- 0xe0, 0x03, 0x10, 0x00, 0xe0, 0x41, 0x11, 0x00, 0x20, 0x40, 0x11, 0x00,
- 0xe0, 0x07, 0x10, 0x00, 0xe0, 0xc1, 0x17, 0x00, 0x10, 0xe0, 0x2f, 0x00,
- 0x20, 0xe0, 0x6f, 0x00, 0x18, 0xe0, 0x2f, 0x00, 0x20, 0xc6, 0x67, 0x00,
- 0x18, 0x84, 0x2b, 0x00, 0x20, 0x08, 0x64, 0x00, 0x70, 0xf0, 0x13, 0x00,
- 0x80, 0x01, 0x08, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00};
-} -scale 3.0
-
-
-bitmap define gort {
-#define gort_width 64
-#define gort_height 64
-static char gort_bits[] = {
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf0,
- 0x3f, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x80,
- 0x01, 0x00, 0xc0, 0xdf, 0x0f, 0x1e, 0x00, 0x80, 0x01, 0x00, 0x60, 0xdf,
- 0x7f, 0x38, 0x00, 0x80, 0x01, 0x00, 0x30, 0x84, 0xfd, 0x67, 0x00, 0x80,
- 0x01, 0x00, 0x18, 0x04, 0xf6, 0xef, 0x00, 0x80, 0x01, 0x00, 0x0c, 0x86,
- 0xe1, 0xc7, 0x01, 0x80, 0x01, 0x00, 0x06, 0x06, 0xc0, 0x96, 0x01, 0x80,
- 0x01, 0x00, 0x06, 0x06, 0x00, 0x97, 0x03, 0x80, 0x01, 0x00, 0x06, 0x06,
- 0x00, 0x3c, 0x03, 0x80, 0x01, 0x00, 0x03, 0x06, 0x00, 0x5c, 0x07, 0x80,
- 0x01, 0x00, 0x03, 0x02, 0x00, 0xd8, 0x06, 0x80, 0x01, 0x00, 0x03, 0x02,
- 0x00, 0xd8, 0x06, 0x80, 0x01, 0x00, 0x43, 0x02, 0x00, 0xb0, 0x0c, 0x80,
- 0x01, 0x80, 0x31, 0x03, 0x00, 0xe0, 0x0d, 0x80, 0x01, 0x80, 0x61, 0x03,
- 0x00, 0xe0, 0x0d, 0x80, 0x01, 0x80, 0x1b, 0x03, 0x00, 0xf0, 0x0c, 0x80,
- 0x01, 0x80, 0xb3, 0x03, 0xff, 0xff, 0x1d, 0x80, 0x01, 0xc0, 0xeb, 0xfb,
- 0xff, 0xff, 0x1d, 0x80, 0x01, 0xe0, 0xc5, 0x7f, 0xfe, 0x7f, 0x3f, 0x01,
- 0xe0, 0xeb, 0xe3, 0xff, 0xff, 0x6e, 0x80, 0x01, 0xd0, 0x3b, 0xfe, 0x01,
- 0x80, 0x40, 0xcf, 0x80, 0x01, 0xf0, 0xf7, 0x07, 0x00, 0x30, 0x8e, 0x80,
- 0x01, 0xf0, 0xf4, 0x00, 0x00, 0x1b, 0x98, 0x80, 0x01, 0x70, 0x14, 0x00,
- 0x00, 0x1f, 0xdc, 0x80, 0x01, 0x30, 0xfe, 0xff, 0x1f, 0xc8, 0xff, 0x80,
- 0x01, 0x20, 0xee, 0xff, 0xff, 0xff, 0xff, 0x80, 0x01, 0x20, 0xf7, 0xff,
- 0x7f, 0xfe, 0x7f, 0x80, 0x01, 0xc0, 0xe1, 0xff, 0xff, 0xfe, 0x3f, 0x80,
- 0x01, 0x80, 0xed, 0xff, 0xff, 0xff, 0x19, 0x80, 0x01, 0x80, 0x99, 0xff,
- 0xff, 0xff, 0x18, 0x80, 0x01, 0x00, 0x63, 0x83, 0xff, 0x7f, 0x08, 0x80,
- 0x01, 0x00, 0xc3, 0x06, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0x9b, 0x07,
- 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0xb6, 0x07, 0x00, 0x10, 0x0c, 0x80,
- 0x01, 0x00, 0xc6, 0x07, 0x00, 0x10, 0x04, 0x80, 0x01, 0x00, 0x36, 0x06,
- 0x00, 0x18, 0x06, 0x80, 0x01, 0x00, 0x66, 0x06, 0x00, 0x18, 0x06, 0x80,
- 0x01, 0x00, 0x8c, 0x0d, 0x00, 0x18, 0x02, 0x80, 0x01, 0x00, 0x18, 0x0e,
- 0x00, 0x18, 0x03, 0x80, 0x01, 0x00, 0xf0, 0x0c, 0x00, 0x18, 0x03, 0x80,
- 0x01, 0x00, 0x30, 0x0f, 0x00, 0x98, 0x01, 0x80, 0x01, 0x00, 0xb0, 0x1f,
- 0x01, 0x98, 0x01, 0x80, 0x01, 0x00, 0x60, 0x1f, 0x03, 0xdc, 0x00, 0x80,
- 0x01, 0x00, 0xe0, 0x3f, 0x03, 0xdc, 0x00, 0x80, 0x01, 0x00, 0xe0, 0x3b,
- 0x07, 0xee, 0x00, 0x80, 0x01, 0x00, 0x70, 0xf8, 0xff, 0xff, 0x01, 0x80,
- 0x01, 0x00, 0xf0, 0x80, 0xff, 0x37, 0x03, 0x80, 0x01, 0x00, 0xfc, 0x00,
- 0x08, 0xd8, 0x03, 0x80, 0x01, 0x00, 0xfe, 0x03, 0xf8, 0x7f, 0x07, 0x80,
- 0x01, 0xc0, 0x87, 0x07, 0xe0, 0x3f, 0x1c, 0x80, 0x01, 0xf0, 0x03, 0x00,
- 0x00, 0x00, 0xf8, 0x8f, 0x81, 0xff, 0x00, 0x38, 0x00, 0xf6, 0xf9, 0xff,
- 0xfd, 0x3f, 0x00, 0xe0, 0x00, 0x83, 0x8f, 0xff, 0xff, 0x00, 0x00, 0x80,
- 0x01, 0x00, 0xfc, 0xc0, 0x07, 0x0e, 0x00, 0x38, 0xe0, 0x00, 0xe0, 0x9f,
- 0xf9, 0x07, 0x00, 0x00, 0x80, 0x03, 0x00, 0xff, 0x7f, 0x80, 0x01, 0x00,
- 0xc0, 0x00, 0x00, 0xf0, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
- 0x0f, 0xf0, 0x00, 0x38, 0x00, 0x00, 0x00, 0x80, 0x01, 0x30, 0x00, 0x00,
- 0x38, 0xc0, 0xc0, 0x80, 0x01, 0x1c, 0xe0, 0x00, 0x0c, 0xc0, 0x83, 0x81,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-} -rotate 180
-
-bitmap define xbob {
-#define bob_x_hot 30
-#define bob_y_hot 37
-#define bob_width 61
-#define bob_height 75
-static char bob_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
- 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x1f, 0x00, 0x00,
- 0x00, 0x80, 0xff, 0xff, 0xff, 0xfb, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xcf,
- 0x9f, 0xd1, 0x03, 0x00, 0x00, 0xf0, 0x7f, 0x8c, 0x33, 0x91, 0x07, 0x00,
- 0x00, 0xf8, 0xa7, 0x18, 0x27, 0xb1, 0x06, 0x00, 0x00, 0xfc, 0x47, 0x31,
- 0x4e, 0xa6, 0x0e, 0x00, 0x00, 0xfe, 0x4f, 0x21, 0x4c, 0xae, 0x3d, 0x00,
- 0x00, 0xff, 0xdf, 0x23, 0x8d, 0xbe, 0x7d, 0x00, 0x80, 0xff, 0xff, 0x67,
- 0xbd, 0xfe, 0xff, 0x01, 0x80, 0xff, 0xff, 0x7f, 0xbf, 0xff, 0xff, 0x03,
- 0xc0, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xf8, 0x07, 0xc0, 0xff, 0xff, 0xff,
- 0xbf, 0x3f, 0xf8, 0x07, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf8, 0x0f,
- 0xc0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xf8, 0x0f, 0xe0, 0x7f, 0x00, 0xf8,
- 0x07, 0x00, 0xf0, 0x0f, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07,
- 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0xe0, 0x3f, 0x00, 0x00,
- 0x00, 0x00, 0xf4, 0x07, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x07,
- 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x07, 0xe0, 0x3f, 0x00, 0x00,
- 0x00, 0x00, 0xe6, 0x07, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x07,
- 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x07, 0xe0, 0x3f, 0x00, 0x00,
- 0x00, 0x00, 0xe6, 0x07, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x07,
- 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x78, 0xf6, 0x07, 0xa0, 0xbf, 0xff, 0x00,
- 0x00, 0xff, 0xf7, 0x07, 0x70, 0x9f, 0xff, 0x01, 0x80, 0xff, 0xef, 0x07,
- 0xf0, 0x1c, 0x80, 0x03, 0xe0, 0x01, 0xef, 0x07, 0xf0, 0x1f, 0xbe, 0x07,
- 0xf0, 0x3f, 0xee, 0x07, 0xe0, 0x9d, 0x83, 0x1f, 0xf8, 0xe1, 0xdc, 0x07,
- 0xe0, 0xc1, 0x7f, 0x1f, 0xfc, 0xff, 0xc8, 0x07, 0xe0, 0xc1, 0x69, 0x1e,
- 0x7e, 0xca, 0xc0, 0x03, 0xe0, 0x81, 0xb8, 0x1f, 0xc0, 0x0e, 0xc0, 0x03,
- 0xe0, 0x01, 0xc0, 0x1b, 0xc0, 0xcf, 0xc1, 0x03, 0xc0, 0x03, 0xf7, 0x11,
- 0x00, 0x7f, 0xc0, 0x03, 0xc0, 0x03, 0x7c, 0x18, 0x00, 0x1c, 0xc0, 0x02,
- 0xc0, 0x02, 0x30, 0x08, 0x00, 0x00, 0x40, 0x03, 0x40, 0x03, 0x00, 0x08,
- 0x00, 0x00, 0x40, 0x02, 0x40, 0x13, 0x00, 0x0c, 0x00, 0x00, 0x60, 0x02,
- 0x40, 0x12, 0x00, 0x0e, 0x00, 0x00, 0xc0, 0x03, 0x80, 0x33, 0x80, 0x0e,
- 0x00, 0x00, 0xa8, 0x01, 0x00, 0x33, 0x40, 0x0f, 0xa0, 0x03, 0x2c, 0x00,
- 0x00, 0x74, 0x30, 0x0f, 0x38, 0x07, 0x2e, 0x00, 0x00, 0x74, 0x98, 0x1f,
- 0x1e, 0x1e, 0x2f, 0x00, 0x00, 0xfc, 0x8f, 0xff, 0x0f, 0xfc, 0x2f, 0x00,
- 0x00, 0xf8, 0xe3, 0xff, 0x03, 0xf8, 0x2f, 0x00, 0x00, 0xf8, 0xfd, 0xff,
- 0x81, 0xff, 0x3f, 0x00, 0x00, 0xb8, 0xf9, 0x1f, 0xf8, 0x0f, 0x1e, 0x00,
- 0x00, 0x30, 0xf1, 0xf0, 0x0f, 0x03, 0x0e, 0x00, 0x00, 0x30, 0xf1, 0x01,
- 0x80, 0x01, 0x0f, 0x00, 0x00, 0x20, 0xf1, 0xf7, 0xff, 0x00, 0x07, 0x00,
- 0x00, 0x60, 0xe3, 0x01, 0x60, 0x80, 0x07, 0x00, 0x00, 0x60, 0xc3, 0xef,
- 0x3f, 0x80, 0x03, 0x00, 0x00, 0x40, 0xc2, 0xff, 0x0f, 0xc0, 0x03, 0x00,
- 0x00, 0xc0, 0xe6, 0x1f, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0xf4, 0xfe,
- 0x3f, 0xe0, 0x00, 0x00, 0x00, 0x80, 0x79, 0xfe, 0x1f, 0xe0, 0x00, 0x00,
- 0xc0, 0x01, 0x3d, 0x3e, 0x00, 0x70, 0x00, 0x00, 0x30, 0x06, 0x3e, 0x0f,
- 0x00, 0x38, 0x00, 0x00, 0xc8, 0x8c, 0x1f, 0x07, 0x00, 0x38, 0x00, 0x00,
- 0xf4, 0xcc, 0x8f, 0x07, 0x00, 0x1c, 0x00, 0x00, 0x72, 0xee, 0xf7, 0x07,
- 0x00, 0x0e, 0x00, 0x00, 0x02, 0xff, 0xe3, 0x07, 0x00, 0x07, 0x00, 0x00,
- 0x32, 0xfe, 0xc1, 0xff, 0x8f, 0x03, 0x00, 0x00, 0x3e, 0xfe, 0x80, 0xff,
- 0xff, 0x01, 0x00, 0x00, 0x7e, 0x7c, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
- 0x7c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1c, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-} -rotate -123
-
-bitmap compose top "Top\nScaled 2x" -pady 5 -padx 10 -rotate 0 -scale 2.0
-bitmap compose left "Left\na\nb\nc" -rotate 90
-bitmap compose right {Right} -rotate 270
-bitmap compose center {Center} -rotate 45
-bitmap compose bottom {Bottom} -rotate 180
-
-#
-# Test bitmap
-#
-# 1. Test of rotated text bitmap
-# 2. Define bitmap from output of "data" command
-# 3. Define bitmap from X11 bitmap file
-# 4. Define bitmap from X10 bitmap file
-# 5. Define bitmap from internal Tcl list
-# 6. Use predefined internal bitmap
-#
-proc ChangeBitmap { w } {
- global count bitmapList
- if { [incr count] >= [llength $bitmapList] } {
- exit
- }
- $w configure -bitmap [lindex $bitmapList $count]
-}
-set count -1
-set bitmapList {
- sharky
- hobbes3
- xbob
- gort
- question
- large_question
- questhead
- large_questhead
- hobbes
- BLT
-}
-
-option add *center*padX 8
-option add *center*padY 4
-
-button .left -bitmap left -command {
- .center configure -bitmap sharky ; set count -1
-}
-button .top -bitmap top -command {
- .center configure -bitmap hobbes3 ; set count 0
-}
-button .right -bitmap right -command {
- .center configure -bitmap xbob ; set count 1
-}
-button .bottom -bitmap bottom -command {
- .center configure -bitmap gort ; set count 2
-}
-button .center -bitmap center -command "ChangeBitmap .center"
-
-set bitmapFile @bitmaps/sharky.xbm
-bitmap define sharky [bitmap data $bitmapFile] -rotate 45 -scale 0.75
-bitmap define large_question [bitmap data question] -scale 2.0
-bitmap define large_questhead [bitmap data questhead] -scale 2.0
-
-blt::table . \
- .top 0,1 -fill x \
- .left 1,0 -fill y \
- .center 1,1 -fill both \
- .right 1,2 -fill y \
- .bottom 2,1 -fill x
-
diff --git a/blt3.0.1/demos/bitmap2.tcl b/blt3.0.1/demos/bitmap2.tcl
deleted file mode 100755
index ce14ca3..0000000
--- a/blt3.0.1/demos/bitmap2.tcl
+++ /dev/null
@@ -1,191 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-
-source scripts/demo.tcl
-source scripts/patterns.tcl
-source scripts/stipples.tcl
-
-blt::bitmap define hobbes {
-#define hobbes_width 25
-#define hobbes_height 25
-static char hobbes_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00,
- 0x78, 0xe0, 0x07, 0x00, 0xfc, 0xf8, 0x07, 0x00, 0xcc, 0x07, 0x04, 0x00,
- 0x0c, 0xf0, 0x0b, 0x00, 0x7c, 0x1c, 0x06, 0x00, 0x38, 0x00, 0x00, 0x00,
- 0xe0, 0x03, 0x10, 0x00, 0xe0, 0x41, 0x11, 0x00, 0x20, 0x40, 0x11, 0x00,
- 0xe0, 0x07, 0x10, 0x00, 0xe0, 0xc1, 0x17, 0x00, 0x10, 0xe0, 0x2f, 0x00,
- 0x20, 0xe0, 0x6f, 0x00, 0x18, 0xe0, 0x2f, 0x00, 0x20, 0xc6, 0x67, 0x00,
- 0x18, 0x84, 0x2b, 0x00, 0x20, 0x08, 0x64, 0x00, 0x70, 0xf0, 0x13, 0x00,
- 0x80, 0x01, 0x08, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00};
-}
-
-blt::bitmap define gort {
-#define gort_width 64
-#define gort_height 64
-static char gort_bits[] = {
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf0,
- 0x3f, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x80,
- 0x01, 0x00, 0xc0, 0xdf, 0x0f, 0x1e, 0x00, 0x80, 0x01, 0x00, 0x60, 0xdf,
- 0x7f, 0x38, 0x00, 0x80, 0x01, 0x00, 0x30, 0x84, 0xfd, 0x67, 0x00, 0x80,
- 0x01, 0x00, 0x18, 0x04, 0xf6, 0xef, 0x00, 0x80, 0x01, 0x00, 0x0c, 0x86,
- 0xe1, 0xc7, 0x01, 0x80, 0x01, 0x00, 0x06, 0x06, 0xc0, 0x96, 0x01, 0x80,
- 0x01, 0x00, 0x06, 0x06, 0x00, 0x97, 0x03, 0x80, 0x01, 0x00, 0x06, 0x06,
- 0x00, 0x3c, 0x03, 0x80, 0x01, 0x00, 0x03, 0x06, 0x00, 0x5c, 0x07, 0x80,
- 0x01, 0x00, 0x03, 0x02, 0x00, 0xd8, 0x06, 0x80, 0x01, 0x00, 0x03, 0x02,
- 0x00, 0xd8, 0x06, 0x80, 0x01, 0x00, 0x43, 0x02, 0x00, 0xb0, 0x0c, 0x80,
- 0x01, 0x80, 0x31, 0x03, 0x00, 0xe0, 0x0d, 0x80, 0x01, 0x80, 0x61, 0x03,
- 0x00, 0xe0, 0x0d, 0x80, 0x01, 0x80, 0x1b, 0x03, 0x00, 0xf0, 0x0c, 0x80,
- 0x01, 0x80, 0xb3, 0x03, 0xff, 0xff, 0x1d, 0x80, 0x01, 0xc0, 0xeb, 0xfb,
- 0xff, 0xff, 0x1d, 0x80, 0x01, 0xe0, 0xc5, 0x7f, 0xfe, 0x7f, 0x3f, 0x01,
- 0xe0, 0xeb, 0xe3, 0xff, 0xff, 0x6e, 0x80, 0x01, 0xd0, 0x3b, 0xfe, 0x01,
- 0x80, 0x40, 0xcf, 0x80, 0x01, 0xf0, 0xf7, 0x07, 0x00, 0x30, 0x8e, 0x80,
- 0x01, 0xf0, 0xf4, 0x00, 0x00, 0x1b, 0x98, 0x80, 0x01, 0x70, 0x14, 0x00,
- 0x00, 0x1f, 0xdc, 0x80, 0x01, 0x30, 0xfe, 0xff, 0x1f, 0xc8, 0xff, 0x80,
- 0x01, 0x20, 0xee, 0xff, 0xff, 0xff, 0xff, 0x80, 0x01, 0x20, 0xf7, 0xff,
- 0x7f, 0xfe, 0x7f, 0x80, 0x01, 0xc0, 0xe1, 0xff, 0xff, 0xfe, 0x3f, 0x80,
- 0x01, 0x80, 0xed, 0xff, 0xff, 0xff, 0x19, 0x80, 0x01, 0x80, 0x99, 0xff,
- 0xff, 0xff, 0x18, 0x80, 0x01, 0x00, 0x63, 0x83, 0xff, 0x7f, 0x08, 0x80,
- 0x01, 0x00, 0xc3, 0x06, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0x9b, 0x07,
- 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0xb6, 0x07, 0x00, 0x10, 0x0c, 0x80,
- 0x01, 0x00, 0xc6, 0x07, 0x00, 0x10, 0x04, 0x80, 0x01, 0x00, 0x36, 0x06,
- 0x00, 0x18, 0x06, 0x80, 0x01, 0x00, 0x66, 0x06, 0x00, 0x18, 0x06, 0x80,
- 0x01, 0x00, 0x8c, 0x0d, 0x00, 0x18, 0x02, 0x80, 0x01, 0x00, 0x18, 0x0e,
- 0x00, 0x18, 0x03, 0x80, 0x01, 0x00, 0xf0, 0x0c, 0x00, 0x18, 0x03, 0x80,
- 0x01, 0x00, 0x30, 0x0f, 0x00, 0x98, 0x01, 0x80, 0x01, 0x00, 0xb0, 0x1f,
- 0x01, 0x98, 0x01, 0x80, 0x01, 0x00, 0x60, 0x1f, 0x03, 0xdc, 0x00, 0x80,
- 0x01, 0x00, 0xe0, 0x3f, 0x03, 0xdc, 0x00, 0x80, 0x01, 0x00, 0xe0, 0x3b,
- 0x07, 0xee, 0x00, 0x80, 0x01, 0x00, 0x70, 0xf8, 0xff, 0xff, 0x01, 0x80,
- 0x01, 0x00, 0xf0, 0x80, 0xff, 0x37, 0x03, 0x80, 0x01, 0x00, 0xfc, 0x00,
- 0x08, 0xd8, 0x03, 0x80, 0x01, 0x00, 0xfe, 0x03, 0xf8, 0x7f, 0x07, 0x80,
- 0x01, 0xc0, 0x87, 0x07, 0xe0, 0x3f, 0x1c, 0x80, 0x01, 0xf0, 0x03, 0x00,
- 0x00, 0x00, 0xf8, 0x8f, 0x81, 0xff, 0x00, 0x38, 0x00, 0xf6, 0xf9, 0xff,
- 0xfd, 0x3f, 0x00, 0xe0, 0x00, 0x83, 0x8f, 0xff, 0xff, 0x00, 0x00, 0x80,
- 0x01, 0x00, 0xfc, 0xc0, 0x07, 0x0e, 0x00, 0x38, 0xe0, 0x00, 0xe0, 0x9f,
- 0xf9, 0x07, 0x00, 0x00, 0x80, 0x03, 0x00, 0xff, 0x7f, 0x80, 0x01, 0x00,
- 0xc0, 0x00, 0x00, 0xf0, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
- 0x0f, 0xf0, 0x00, 0x38, 0x00, 0x00, 0x00, 0x80, 0x01, 0x30, 0x00, 0x00,
- 0x38, 0xc0, 0xc0, 0x80, 0x01, 0x1c, 0xe0, 0x00, 0x0c, 0xc0, 0x83, 0x81,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-}
-
-blt::bitmap define xbob {
-#define bob_x_hot 30
-#define bob_y_hot 37
-#define bob_width 61
-#define bob_height 75
-static char bob_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
- 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x1f, 0x00, 0x00,
- 0x00, 0x80, 0xff, 0xff, 0xff, 0xfb, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xcf,
- 0x9f, 0xd1, 0x03, 0x00, 0x00, 0xf0, 0x7f, 0x8c, 0x33, 0x91, 0x07, 0x00,
- 0x00, 0xf8, 0xa7, 0x18, 0x27, 0xb1, 0x06, 0x00, 0x00, 0xfc, 0x47, 0x31,
- 0x4e, 0xa6, 0x0e, 0x00, 0x00, 0xfe, 0x4f, 0x21, 0x4c, 0xae, 0x3d, 0x00,
- 0x00, 0xff, 0xdf, 0x23, 0x8d, 0xbe, 0x7d, 0x00, 0x80, 0xff, 0xff, 0x67,
- 0xbd, 0xfe, 0xff, 0x01, 0x80, 0xff, 0xff, 0x7f, 0xbf, 0xff, 0xff, 0x03,
- 0xc0, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xf8, 0x07, 0xc0, 0xff, 0xff, 0xff,
- 0xbf, 0x3f, 0xf8, 0x07, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf8, 0x0f,
- 0xc0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xf8, 0x0f, 0xe0, 0x7f, 0x00, 0xf8,
- 0x07, 0x00, 0xf0, 0x0f, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07,
- 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0xe0, 0x3f, 0x00, 0x00,
- 0x00, 0x00, 0xf4, 0x07, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x07,
- 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x07, 0xe0, 0x3f, 0x00, 0x00,
- 0x00, 0x00, 0xe6, 0x07, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x07,
- 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x07, 0xe0, 0x3f, 0x00, 0x00,
- 0x00, 0x00, 0xe6, 0x07, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x07,
- 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x78, 0xf6, 0x07, 0xa0, 0xbf, 0xff, 0x00,
- 0x00, 0xff, 0xf7, 0x07, 0x70, 0x9f, 0xff, 0x01, 0x80, 0xff, 0xef, 0x07,
- 0xf0, 0x1c, 0x80, 0x03, 0xe0, 0x01, 0xef, 0x07, 0xf0, 0x1f, 0xbe, 0x07,
- 0xf0, 0x3f, 0xee, 0x07, 0xe0, 0x9d, 0x83, 0x1f, 0xf8, 0xe1, 0xdc, 0x07,
- 0xe0, 0xc1, 0x7f, 0x1f, 0xfc, 0xff, 0xc8, 0x07, 0xe0, 0xc1, 0x69, 0x1e,
- 0x7e, 0xca, 0xc0, 0x03, 0xe0, 0x81, 0xb8, 0x1f, 0xc0, 0x0e, 0xc0, 0x03,
- 0xe0, 0x01, 0xc0, 0x1b, 0xc0, 0xcf, 0xc1, 0x03, 0xc0, 0x03, 0xf7, 0x11,
- 0x00, 0x7f, 0xc0, 0x03, 0xc0, 0x03, 0x7c, 0x18, 0x00, 0x1c, 0xc0, 0x02,
- 0xc0, 0x02, 0x30, 0x08, 0x00, 0x00, 0x40, 0x03, 0x40, 0x03, 0x00, 0x08,
- 0x00, 0x00, 0x40, 0x02, 0x40, 0x13, 0x00, 0x0c, 0x00, 0x00, 0x60, 0x02,
- 0x40, 0x12, 0x00, 0x0e, 0x00, 0x00, 0xc0, 0x03, 0x80, 0x33, 0x80, 0x0e,
- 0x00, 0x00, 0xa8, 0x01, 0x00, 0x33, 0x40, 0x0f, 0xa0, 0x03, 0x2c, 0x00,
- 0x00, 0x74, 0x30, 0x0f, 0x38, 0x07, 0x2e, 0x00, 0x00, 0x74, 0x98, 0x1f,
- 0x1e, 0x1e, 0x2f, 0x00, 0x00, 0xfc, 0x8f, 0xff, 0x0f, 0xfc, 0x2f, 0x00,
- 0x00, 0xf8, 0xe3, 0xff, 0x03, 0xf8, 0x2f, 0x00, 0x00, 0xf8, 0xfd, 0xff,
- 0x81, 0xff, 0x3f, 0x00, 0x00, 0xb8, 0xf9, 0x1f, 0xf8, 0x0f, 0x1e, 0x00,
- 0x00, 0x30, 0xf1, 0xf0, 0x0f, 0x03, 0x0e, 0x00, 0x00, 0x30, 0xf1, 0x01,
- 0x80, 0x01, 0x0f, 0x00, 0x00, 0x20, 0xf1, 0xf7, 0xff, 0x00, 0x07, 0x00,
- 0x00, 0x60, 0xe3, 0x01, 0x60, 0x80, 0x07, 0x00, 0x00, 0x60, 0xc3, 0xef,
- 0x3f, 0x80, 0x03, 0x00, 0x00, 0x40, 0xc2, 0xff, 0x0f, 0xc0, 0x03, 0x00,
- 0x00, 0xc0, 0xe6, 0x1f, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0xf4, 0xfe,
- 0x3f, 0xe0, 0x00, 0x00, 0x00, 0x80, 0x79, 0xfe, 0x1f, 0xe0, 0x00, 0x00,
- 0xc0, 0x01, 0x3d, 0x3e, 0x00, 0x70, 0x00, 0x00, 0x30, 0x06, 0x3e, 0x0f,
- 0x00, 0x38, 0x00, 0x00, 0xc8, 0x8c, 0x1f, 0x07, 0x00, 0x38, 0x00, 0x00,
- 0xf4, 0xcc, 0x8f, 0x07, 0x00, 0x1c, 0x00, 0x00, 0x72, 0xee, 0xf7, 0x07,
- 0x00, 0x0e, 0x00, 0x00, 0x02, 0xff, 0xe3, 0x07, 0x00, 0x07, 0x00, 0x00,
- 0x32, 0xfe, 0xc1, 0xff, 0x8f, 0x03, 0x00, 0x00, 0x3e, 0xfe, 0x80, 0xff,
- 0xff, 0x01, 0x00, 0x00, 0x7e, 0x7c, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
- 0x7c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1c, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-}
-
-blt::bitmap compose text "Text String" -font {courier 12}
-
-. configure -bg grey80
-label .angle -text "Angle" -font { Helvetica 12 bold } -bg grey80
-label .scale -text "Scale" -font { Helvetica 12 bold } -bg grey80
-
-blt::table . \
- 0,0 .angle -fill both \
- 0,5 .scale -fill both
-
-set row 1
-foreach angle { 0 90 180 270 360 45 -45 101 } {
- label .angle$angle -text $angle -bg grey80
- blt::table . \
- $row,0 .angle$angle -fill both
- set column 1
- foreach bitmap { hobbes gort xbob text } {
- set data [blt::bitmap data $bitmap]
- blt::bitmap define $bitmap$row$column $data -rotate $angle
- label .$bitmap$row$column -bitmap $bitmap$row$column -bg white
- blt::table . \
- $row,$column .$bitmap$row$column
- incr column
- }
- incr row
-}
-
-set row 1
-foreach scale { 1.0 0.5 0.75 1.4 3.0 } {
- label .scale$row -text $scale -bg grey80
- blt::table . \
- $row,5 .scale$row -fill both
- set column 6
- foreach bitmap { hobbes gort xbob text } {
- set data [blt::bitmap data $bitmap]
- blt::bitmap define $bitmap$row$column $data -scale $scale
- label .$bitmap$row$column -bitmap $bitmap$row$column -bg white
- blt::table . \
- $row,$column .$bitmap$row$column
- incr column
- }
- incr row
-}
-
-foreach scale { 2.0 0.8 1.2 } angle { 45 -45 101 } {
- label .scale$row -text "$scale/$angle" -bg grey80
- blt::table . \
- $row,5 .scale$row -fill both
- set column 6
- foreach bitmap { hobbes gort xbob text } {
- set data [blt::bitmap data $bitmap]
- blt::bitmap define $bitmap$row $data -scale $scale -rotate $angle
- label .$bitmap$row -bitmap $bitmap$row -bg white
- blt::table . \
- $row,$column .$bitmap$row
- incr column
- }
- incr row
-}
-
-blt::table configure . c* -padx 2
\ No newline at end of file
diff --git a/blt3.0.1/demos/bitmaps/face.xbm b/blt3.0.1/demos/bitmaps/face.xbm
deleted file mode 100644
index 8e09419..0000000
--- a/blt3.0.1/demos/bitmaps/face.xbm
+++ /dev/null
@@ -1,171 +0,0 @@
-#define face_width 108
-#define face_height 144
-static char face_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x09,
- 0x20, 0x80, 0x24, 0x05, 0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x00, 0x88,
- 0x24, 0x20, 0x80, 0x24, 0x00, 0x00, 0x00, 0x10, 0x80, 0x04, 0x00, 0x01,
- 0x00, 0x01, 0x40, 0x0a, 0x09, 0x00, 0x92, 0x04, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x10, 0x40, 0x12, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x84,
- 0x24, 0x40, 0x22, 0xa8, 0x02, 0x14, 0x84, 0x92, 0x40, 0x42, 0x12, 0x04,
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x52, 0x11, 0x00, 0x12, 0x00,
- 0x40, 0x02, 0x00, 0x20, 0x00, 0x08, 0x00, 0xaa, 0x02, 0x54, 0x85, 0x24,
- 0x00, 0x10, 0x12, 0x00, 0x00, 0x81, 0x44, 0x00, 0x90, 0x5a, 0x00, 0xea,
- 0x1b, 0x00, 0x80, 0x40, 0x40, 0x02, 0x00, 0x08, 0x00, 0x20, 0xa2, 0x05,
- 0x8a, 0xb4, 0x6e, 0x45, 0x12, 0x04, 0x08, 0x00, 0x00, 0x00, 0x10, 0x02,
- 0xa8, 0x92, 0x00, 0xda, 0x5f, 0x10, 0x00, 0x10, 0xa1, 0x04, 0x20, 0x41,
- 0x02, 0x00, 0x5a, 0x25, 0xa0, 0xff, 0xfb, 0x05, 0x41, 0x02, 0x04, 0x00,
- 0x00, 0x08, 0x40, 0x80, 0xec, 0x9b, 0xec, 0xfe, 0x7f, 0x01, 0x04, 0x20,
- 0x90, 0x02, 0x04, 0x00, 0x08, 0x20, 0xfb, 0x2e, 0xf5, 0xff, 0xff, 0x57,
- 0x00, 0x04, 0x02, 0x00, 0x00, 0x20, 0x01, 0xc1, 0x6e, 0xab, 0xfa, 0xff,
- 0xff, 0x05, 0x90, 0x20, 0x48, 0x02, 0x00, 0x04, 0x20, 0xa8, 0xdf, 0xb5,
- 0xfe, 0xff, 0xff, 0x0b, 0x01, 0x00, 0x01, 0x00, 0x80, 0x80, 0x04, 0xe0,
- 0xbb, 0xef, 0xff, 0xff, 0x7f, 0x01, 0x00, 0x04, 0x48, 0x02, 0x00, 0x20,
- 0x80, 0xf4, 0x6f, 0xfb, 0xff, 0xff, 0xff, 0x20, 0x90, 0x40, 0x02, 0x00,
- 0x00, 0x04, 0x08, 0xb8, 0xf6, 0xff, 0xff, 0xdf, 0xbe, 0x12, 0x45, 0x10,
- 0x90, 0x04, 0x90, 0x00, 0x22, 0xfa, 0xff, 0xff, 0xff, 0xbb, 0xd7, 0xe9,
- 0x3a, 0x02, 0x02, 0x00, 0x04, 0x90, 0x80, 0xfe, 0xdf, 0xf6, 0xb7, 0xef,
- 0xbe, 0x56, 0x57, 0x40, 0x48, 0x09, 0x00, 0x04, 0x00, 0xfa, 0xf5, 0xdf,
- 0xed, 0x5a, 0xd5, 0xea, 0xbd, 0x09, 0x00, 0x00, 0x40, 0x00, 0x92, 0xfe,
- 0xbf, 0x7d, 0xb7, 0x6a, 0x55, 0xbf, 0xf7, 0x02, 0x11, 0x01, 0x00, 0x91,
- 0x00, 0xff, 0xff, 0xaf, 0x55, 0x55, 0x5b, 0xeb, 0xef, 0x22, 0x04, 0x04,
- 0x04, 0x00, 0xa4, 0xff, 0xf7, 0xad, 0xaa, 0xaa, 0xaa, 0xbe, 0xfe, 0x03,
- 0x20, 0x00, 0x10, 0x44, 0x80, 0xff, 0x7f, 0x55, 0x12, 0x91, 0x2a, 0xeb,
- 0xbf, 0x0b, 0x82, 0x02, 0x00, 0x00, 0xd1, 0x7f, 0xdf, 0xa2, 0xa4, 0x54,
- 0x55, 0xfd, 0xfd, 0x47, 0x08, 0x08, 0x00, 0x21, 0xe4, 0xff, 0x37, 0x11,
- 0x09, 0xa5, 0xaa, 0xb6, 0xff, 0x0d, 0x80, 0x00, 0x00, 0x04, 0xd0, 0xff,
- 0x4f, 0x44, 0x20, 0x48, 0x55, 0xfb, 0xff, 0x27, 0x11, 0x02, 0x40, 0x40,
- 0xe2, 0xfb, 0x15, 0x11, 0x4a, 0x55, 0x4a, 0x7d, 0xf7, 0x0f, 0x00, 0x00,
- 0x04, 0x08, 0xf8, 0xdf, 0x52, 0x44, 0x01, 0x52, 0xb5, 0xfa, 0xff, 0x0f,
- 0x49, 0x02, 0x00, 0x02, 0xe9, 0xf6, 0x0a, 0x11, 0xa4, 0x88, 0x4a, 0x6d,
- 0xff, 0x5f, 0x00, 0x00, 0x10, 0x20, 0xf0, 0x2f, 0x21, 0x44, 0x10, 0x52,
- 0xb5, 0xfa, 0xff, 0x0f, 0x44, 0x04, 0x80, 0x08, 0xf8, 0xab, 0x8a, 0x00,
- 0x81, 0xa4, 0xd4, 0xd6, 0xfe, 0x2f, 0x00, 0x00, 0x04, 0x40, 0xb5, 0x2d,
- 0x21, 0x08, 0x04, 0x90, 0xaa, 0xfa, 0xff, 0x1f, 0x11, 0x01, 0x00, 0x04,
- 0xf0, 0x57, 0x0a, 0x22, 0x40, 0x4a, 0xda, 0x5e, 0xfb, 0x1f, 0x40, 0x00,
- 0x40, 0x20, 0xba, 0x95, 0x90, 0x00, 0x01, 0xa0, 0xaa, 0xea, 0xff, 0x5f,
- 0x02, 0x02, 0x00, 0x01, 0xe8, 0x57, 0x05, 0x00, 0x00, 0x12, 0xd5, 0xfe,
- 0xfd, 0x1f, 0x48, 0x00, 0x04, 0x48, 0x7a, 0x95, 0x08, 0x02, 0x10, 0x40,
- 0xaa, 0x55, 0xf7, 0x1f, 0x00, 0x09, 0x20, 0x00, 0xf8, 0x57, 0x22, 0x10,
- 0x00, 0x28, 0xa9, 0xfa, 0xff, 0x5f, 0x02, 0x00, 0x00, 0x49, 0xdd, 0x29,
- 0x01, 0x00, 0x80, 0x80, 0xaa, 0xd7, 0xff, 0x0f, 0x10, 0x00, 0x08, 0x00,
- 0xf8, 0x96, 0x08, 0x00, 0x00, 0x20, 0x54, 0xfa, 0xee, 0x3f, 0x81, 0x04,
- 0x40, 0x24, 0xfe, 0x55, 0x82, 0x00, 0x00, 0x82, 0xd2, 0xad, 0xff, 0x0f,
- 0x08, 0x00, 0x04, 0x80, 0x6c, 0x97, 0x00, 0x00, 0x02, 0x20, 0xa9, 0xf6,
- 0xdf, 0x5f, 0x00, 0x02, 0x20, 0x09, 0xfa, 0x49, 0x12, 0x00, 0x20, 0x84,
- 0x54, 0xdb, 0xfe, 0x1f, 0x91, 0x00, 0x00, 0x00, 0xf8, 0x2b, 0x00, 0x20,
- 0x00, 0x40, 0xa4, 0xf6, 0xbb, 0x1f, 0x04, 0x00, 0x44, 0x92, 0x7e, 0x95,
- 0x02, 0x00, 0x00, 0x89, 0xaa, 0xdd, 0xff, 0x1f, 0x20, 0x09, 0x10, 0x00,
- 0xf4, 0x57, 0x20, 0x01, 0x08, 0x20, 0xa9, 0x76, 0xff, 0x5f, 0x02, 0x00,
- 0x00, 0x21, 0xfc, 0x4a, 0x05, 0x00, 0x01, 0x80, 0x54, 0xdb, 0xff, 0x1e,
- 0x08, 0x02, 0x04, 0x08, 0xf9, 0x2b, 0x00, 0x00, 0x40, 0x28, 0xd2, 0xf6,
- 0xff, 0xbf, 0x80, 0x00, 0x90, 0x00, 0xbc, 0x92, 0x08, 0x10, 0x00, 0x82,
- 0x54, 0xdb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x44, 0xf9, 0x55, 0x02, 0x01,
- 0x00, 0x20, 0xaa, 0xbd, 0xfd, 0x3f, 0x08, 0x04, 0x04, 0x10, 0xf4, 0x2a,
- 0x01, 0x00, 0x22, 0x80, 0xd4, 0xf6, 0xff, 0x5f, 0x82, 0x00, 0x40, 0x02,
- 0xf8, 0x55, 0x20, 0x00, 0x00, 0x50, 0x6a, 0xdf, 0xfe, 0x3f, 0x00, 0x00,
- 0x00, 0x48, 0xe9, 0x4a, 0x05, 0x08, 0x00, 0xa5, 0xd5, 0xf5, 0xff, 0x3f,
- 0x10, 0x01, 0x10, 0x01, 0xb0, 0xab, 0x92, 0x02, 0x40, 0xf8, 0xbf, 0xde,
- 0xfe, 0x5f, 0x02, 0x04, 0x04, 0x48, 0xfa, 0xd4, 0x6f, 0x20, 0x84, 0xef,
- 0xff, 0xfb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x00, 0xe0, 0xed, 0xbf, 0x0b,
- 0xa1, 0x7e, 0xff, 0xbf, 0xfd, 0x5f, 0x04, 0x01, 0x20, 0x49, 0xd2, 0xfb,
- 0xfe, 0x55, 0xd4, 0xff, 0xff, 0xf6, 0xff, 0x07, 0x00, 0x04, 0x00, 0x00,
- 0xc0, 0xaa, 0xfb, 0x2b, 0xa2, 0xfe, 0xff, 0xdf, 0xee, 0x1f, 0x91, 0x00,
- 0x82, 0xa4, 0xa4, 0xf5, 0xff, 0x57, 0xd5, 0xff, 0xbf, 0xfd, 0xff, 0x4d,
- 0x00, 0x00, 0x20, 0x00, 0x88, 0x5b, 0xff, 0x2f, 0x69, 0xff, 0xff, 0xdb,
- 0xfe, 0x1f, 0x24, 0x02, 0x00, 0x49, 0xa2, 0xd6, 0xff, 0x5f, 0xea, 0xff,
- 0x7f, 0x7f, 0x7f, 0x0d, 0x00, 0x00, 0x10, 0x00, 0x40, 0xab, 0xf7, 0xbb,
- 0xf0, 0xdf, 0xff, 0xd5, 0xff, 0xbf, 0x82, 0x04, 0x42, 0x24, 0x91, 0xd5,
- 0xaa, 0xae, 0xd4, 0xaa, 0x52, 0x7b, 0xff, 0x15, 0x08, 0x00, 0x00, 0x01,
- 0x04, 0x55, 0xd5, 0x55, 0x70, 0x5b, 0x75, 0xdd, 0xdf, 0x1f, 0x40, 0x00,
- 0x08, 0x48, 0xa0, 0x4a, 0xa9, 0x56, 0xea, 0x56, 0xad, 0x6a, 0x7d, 0x9b,
- 0x04, 0x01, 0x00, 0x02, 0x42, 0x2a, 0xd5, 0xaa, 0xa8, 0xaa, 0xaa, 0xfa,
- 0xdf, 0x2f, 0x10, 0x04, 0x22, 0x48, 0x08, 0x45, 0x2a, 0x15, 0x68, 0x55,
- 0x55, 0xd7, 0x76, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x40, 0x2a, 0x80, 0xa0,
- 0xb2, 0x09, 0x48, 0xb9, 0xdf, 0x17, 0x22, 0x01, 0x00, 0x24, 0x45, 0x8a,
- 0x24, 0x4a, 0x54, 0x51, 0x91, 0xf6, 0x6e, 0x4b, 0x00, 0x04, 0x90, 0x00,
- 0x80, 0x52, 0x00, 0x20, 0x69, 0x05, 0xa4, 0xaa, 0xff, 0x1e, 0x48, 0x00,
- 0x02, 0x92, 0x08, 0x05, 0x81, 0x94, 0xd4, 0x92, 0x40, 0xfd, 0xb6, 0x8b,
- 0x00, 0x01, 0x40, 0x00, 0x82, 0x54, 0x00, 0x48, 0x68, 0x05, 0x90, 0xa4,
- 0xef, 0x06, 0x24, 0x00, 0x08, 0x12, 0x10, 0x05, 0x00, 0x10, 0xb5, 0x01,
- 0x42, 0xfb, 0xbf, 0x43, 0x00, 0x09, 0x00, 0x40, 0x81, 0xa8, 0x08, 0x4a,
- 0xaa, 0x96, 0x90, 0xac, 0x6d, 0x15, 0x22, 0x00, 0x20, 0x09, 0x04, 0x15,
- 0x80, 0x28, 0xdc, 0x01, 0x24, 0xfb, 0xbf, 0x01, 0x80, 0x04, 0x09, 0x00,
- 0x40, 0x48, 0x02, 0x45, 0xb2, 0x2e, 0x41, 0x6d, 0xef, 0x05, 0x11, 0x00,
- 0x40, 0x52, 0x02, 0x15, 0x29, 0x2a, 0xac, 0x42, 0x54, 0xfb, 0x3b, 0x51,
- 0x84, 0x00, 0x08, 0x00, 0x20, 0x54, 0x80, 0x05, 0xb5, 0x3d, 0xa2, 0xb6,
- 0xdf, 0x00, 0x20, 0x04, 0x20, 0x49, 0x89, 0xa8, 0x6a, 0x29, 0xac, 0xd6,
- 0x54, 0xff, 0x3f, 0x84, 0x00, 0x01, 0x04, 0x10, 0x00, 0x94, 0xa8, 0x56,
- 0xda, 0x5f, 0xab, 0xd5, 0x1e, 0x10, 0x48, 0x00, 0x90, 0x82, 0x48, 0xa8,
- 0xb2, 0xac, 0xfd, 0x55, 0xd5, 0xfe, 0x9f, 0x80, 0x00, 0x0a, 0x02, 0x08,
- 0x02, 0x55, 0x5a, 0x75, 0xff, 0xaf, 0xb6, 0xf7, 0x2d, 0x12, 0x92, 0x00,
- 0x10, 0x20, 0x10, 0xa8, 0x54, 0xd5, 0xbf, 0x5d, 0xad, 0xdd, 0x0f, 0x00,
- 0x00, 0x04, 0x40, 0x09, 0x84, 0xa8, 0xaa, 0x5a, 0xed, 0xeb, 0x6a, 0xff,
- 0x9f, 0xa4, 0x24, 0x01, 0x02, 0xa0, 0x20, 0x50, 0x55, 0xd5, 0xbe, 0xae,
- 0xad, 0xfd, 0x16, 0x00, 0x10, 0x04, 0x20, 0x0a, 0x08, 0xb4, 0xaa, 0x95,
- 0xaa, 0x7b, 0xb7, 0xdb, 0x5f, 0x92, 0x04, 0x01, 0x84, 0x20, 0x21, 0x51,
- 0xd5, 0x2a, 0xa9, 0xee, 0xd5, 0xfe, 0x0d, 0x00, 0x20, 0x04, 0x10, 0x00,
- 0x08, 0x50, 0xe9, 0xd7, 0xd4, 0xfb, 0xb5, 0xff, 0x9f, 0x24, 0x09, 0x01,
- 0x42, 0x4a, 0xa2, 0x64, 0xd5, 0x55, 0x7b, 0x7f, 0xda, 0x7d, 0x4f, 0x00,
- 0x20, 0x04, 0x00, 0x80, 0x00, 0xa0, 0x2a, 0x13, 0x84, 0x6a, 0x55, 0xff,
- 0x1d, 0x48, 0x8a, 0x00, 0x94, 0x24, 0x8a, 0xc8, 0xaa, 0x42, 0x20, 0x5d,
- 0xf5, 0xff, 0x5f, 0x01, 0x00, 0x02, 0x01, 0x00, 0x20, 0xa2, 0x4a, 0x1a,
- 0x82, 0x56, 0xda, 0xbd, 0x3f, 0x92, 0x92, 0x00, 0x90, 0x92, 0x00, 0x40,
- 0x95, 0x6a, 0xf4, 0x55, 0x6d, 0xff, 0xd6, 0x00, 0x00, 0x0a, 0x04, 0x20,
- 0x14, 0x49, 0x4b, 0xaa, 0xaa, 0x56, 0xf5, 0xff, 0xbf, 0xab, 0xa4, 0x00,
- 0x20, 0x89, 0x40, 0x80, 0xaa, 0xaa, 0xaa, 0xaa, 0xde, 0xbf, 0xeb, 0x03,
- 0x00, 0x02, 0x04, 0x02, 0x0a, 0x10, 0x2b, 0x2a, 0x55, 0x5b, 0xf5, 0xff,
- 0xd7, 0x2f, 0x92, 0x00, 0x10, 0x28, 0x21, 0x01, 0x56, 0x95, 0xa0, 0x56,
- 0xdf, 0xef, 0xea, 0x87, 0x40, 0x0a, 0x42, 0x41, 0x00, 0x90, 0xaa, 0x52,
- 0xb6, 0xad, 0xfa, 0xff, 0xd5, 0x2f, 0x14, 0x00, 0x00, 0x04, 0x95, 0x04,
- 0xaa, 0xac, 0x55, 0x6b, 0xff, 0xb7, 0xea, 0x9f, 0x40, 0x02, 0x28, 0x51,
- 0x00, 0x40, 0x58, 0xd5, 0xda, 0xd6, 0x6e, 0x7f, 0xf9, 0x3f, 0x12, 0x04,
- 0x02, 0x04, 0x49, 0x25, 0x55, 0xaa, 0x77, 0xab, 0xff, 0x2b, 0xfd, 0x3f,
- 0x48, 0x01, 0x20, 0x41, 0x00, 0x00, 0x58, 0xa9, 0xda, 0xea, 0xfd, 0xaf,
- 0xfa, 0xff, 0x02, 0x04, 0x08, 0x14, 0x29, 0x49, 0x52, 0x55, 0x55, 0x55,
- 0xff, 0x8d, 0xfe, 0x3f, 0xa8, 0x00, 0x02, 0x41, 0x00, 0x02, 0xa0, 0xa2,
- 0xaa, 0xea, 0xff, 0x53, 0xfd, 0xff, 0x02, 0x04, 0x50, 0x04, 0x25, 0xa8,
- 0x54, 0x49, 0x52, 0xb5, 0xbf, 0x8a, 0xfe, 0xff, 0xa9, 0x08, 0x04, 0x50,
- 0x80, 0x02, 0xa1, 0x2a, 0x95, 0xea, 0xff, 0xa1, 0xff, 0xff, 0x03, 0x02,
- 0x90, 0x02, 0x09, 0x08, 0x44, 0x49, 0x52, 0xbd, 0x7f, 0xca, 0xff, 0xff,
- 0x2b, 0x09, 0x04, 0x48, 0x40, 0x82, 0x90, 0x56, 0xa9, 0xf6, 0xbf, 0xd0,
- 0xff, 0xff, 0x47, 0x00, 0x50, 0x02, 0x15, 0x11, 0x40, 0x95, 0xaa, 0xfd,
- 0x2f, 0xe9, 0xff, 0xff, 0x8f, 0x0a, 0x84, 0x50, 0x40, 0x84, 0x14, 0xaa,
- 0x6a, 0xff, 0x5f, 0xf2, 0xff, 0xff, 0x7f, 0x00, 0x10, 0x02, 0x09, 0x10,
- 0x40, 0x7d, 0xf7, 0xff, 0x0b, 0xfc, 0xff, 0xff, 0xaf, 0x02, 0x84, 0x50,
- 0x42, 0x85, 0x12, 0xd0, 0xdd, 0xff, 0xa7, 0xf2, 0xff, 0xff, 0xff, 0x04,
- 0x00, 0x0a, 0x08, 0x10, 0x48, 0xf8, 0xff, 0xff, 0x0a, 0xfe, 0xff, 0xff,
- 0x7f, 0x03, 0xa4, 0x80, 0xa2, 0x8a, 0x02, 0x68, 0xff, 0xff, 0x52, 0xfd,
- 0xff, 0xff, 0xff, 0x07, 0x00, 0x2a, 0x08, 0x20, 0x28, 0xdc, 0xff, 0x5f,
- 0x05, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x92, 0x40, 0x22, 0x09, 0x02, 0xea,
- 0xfb, 0xaf, 0x48, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x12, 0x81, 0xa0,
- 0x48, 0x9c, 0x6e, 0x93, 0xa2, 0xff, 0xff, 0xff, 0xff, 0x07, 0xa8, 0x40,
- 0x28, 0x0a, 0x02, 0x74, 0xb5, 0x45, 0x81, 0xff, 0xff, 0xff, 0xff, 0x0f,
- 0x02, 0x0a, 0x81, 0x20, 0x08, 0xae, 0xaa, 0x90, 0xe8, 0xff, 0xff, 0xff,
- 0xff, 0x0f, 0x90, 0x40, 0x28, 0x88, 0x12, 0x58, 0x15, 0x50, 0xd0, 0xff,
- 0xff, 0xff, 0xff, 0x0f, 0x44, 0x0a, 0x41, 0x21, 0x08, 0xae, 0x04, 0x14,
- 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40, 0x14, 0x88, 0x04, 0xba,
- 0x02, 0x28, 0xe8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x42, 0x15, 0x41, 0x21,
- 0x05, 0xad, 0x00, 0x05, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40,
- 0x24, 0x8a, 0x0e, 0x36, 0x00, 0x0a, 0xf4, 0xff, 0xff, 0xff, 0xff, 0x0f,
- 0x42, 0x25, 0x90, 0xd0, 0x8b, 0xc2, 0x41, 0x05, 0xfc, 0xff, 0xff, 0xff,
- 0xff, 0x0f, 0x10, 0x08, 0x05, 0xe8, 0x8e, 0x58, 0x80, 0x02, 0xfa, 0xff,
- 0xff, 0xff, 0xff, 0x0f, 0x4a, 0x20, 0xa8, 0xba, 0x0b, 0x2b, 0x51, 0x01,
- 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x8a, 0x02, 0xe8, 0xaf, 0x84,
- 0x90, 0x04, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x52, 0x21, 0x54, 0xbf,
- 0x1f, 0x15, 0xa5, 0x02, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x08,
- 0x01, 0xfa, 0xb6, 0xa4, 0x52, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
- 0x4a, 0xa2, 0x54, 0xef, 0x5f, 0x4b, 0xa4, 0x80, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0x0f, 0x80, 0x10, 0x82, 0xfe, 0xbf, 0x92, 0x52, 0x42, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0x0f, 0x12, 0x42, 0xa8, 0xbf, 0x1f, 0x24, 0x80, 0xa0,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28, 0x8a, 0xf7, 0x37, 0x80,
- 0x52, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x82, 0xe0, 0xff,
- 0x1f, 0x00, 0x20, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28,
- 0xca, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
- 0x10, 0x42, 0xf0, 0xfd, 0x1b, 0x00, 0x50, 0xf0, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0x0f, 0xa4, 0x10, 0xc5, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0x0f, 0x00, 0x22, 0xf8, 0xff, 0x0e, 0x00, 0x00, 0xf0,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xaa, 0x88, 0xe2, 0xff, 0x0f, 0x10,
- 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x25, 0xfa, 0xff,
- 0x0f, 0x01, 0x11, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xfb,
- 0xfb, 0xff, 0x7f, 0x5d, 0xd5, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f};
diff --git a/blt3.0.1/demos/bitmaps/fish/left.xbm b/blt3.0.1/demos/bitmaps/fish/left.xbm
deleted file mode 100644
index 84d3c67..0000000
--- a/blt3.0.1/demos/bitmaps/fish/left.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define fc_left_width 16
-#define fc_left_height 16
-#define fc_left_x_hot 8
-#define fc_left_y_hot 8
-static char fc_left_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x04, 0x70, 0x82, 0x8c, 0xe2,
- 0x22, 0x9c, 0x2d, 0x90, 0x2d, 0x80, 0x21, 0x90, 0x22, 0x9c, 0x1c, 0xe3,
- 0x70, 0x82, 0x80, 0x02, 0x00, 0x07, 0x00, 0x00};
diff --git a/blt3.0.1/demos/bitmaps/fish/left1.xbm b/blt3.0.1/demos/bitmaps/fish/left1.xbm
deleted file mode 100644
index 077c5c9..0000000
--- a/blt3.0.1/demos/bitmaps/fish/left1.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define fc_left1_width 16
-#define fc_left1_height 16
-#define fc_left1_x_hot 8
-#define fc_left1_y_hot 8
-static char fc_left1_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x02, 0xe0, 0x14, 0x10, 0x1f,
- 0xd8, 0x14, 0xd8, 0x14, 0x08, 0x10, 0x08, 0x14, 0xd0, 0x14, 0x70, 0x1e,
- 0x60, 0x13, 0x80, 0x01, 0x00, 0x01, 0x00, 0x00};
diff --git a/blt3.0.1/demos/bitmaps/fish/left1m.xbm b/blt3.0.1/demos/bitmaps/fish/left1m.xbm
deleted file mode 100644
index c05c9b0..0000000
--- a/blt3.0.1/demos/bitmaps/fish/left1m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define fc_left1m_width 16
-#define fc_left1m_height 16
-#define fc_left1m_x_hot 8
-#define fc_left1m_y_hot 8
-static char fc_left1m_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x03, 0xe0, 0x17, 0xf0, 0x1f,
- 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf0, 0x1f, 0xf0, 0x1f,
- 0xe0, 0x13, 0x80, 0x01, 0x00, 0x01, 0x00, 0x00};
diff --git a/blt3.0.1/demos/bitmaps/fish/leftm.xbm b/blt3.0.1/demos/bitmaps/fish/leftm.xbm
deleted file mode 100644
index 5b58736..0000000
--- a/blt3.0.1/demos/bitmaps/fish/leftm.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define fc_leftm_width 16
-#define fc_leftm_height 16
-#define fc_leftm_x_hot 8
-#define fc_leftm_y_hot 8
-static char fc_leftm_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x07, 0xf0, 0x83, 0xfc, 0xe3,
- 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfc, 0xe3,
- 0xf0, 0x83, 0x80, 0x03, 0x00, 0x07, 0x00, 0x00};
diff --git a/blt3.0.1/demos/bitmaps/fish/mid.xbm b/blt3.0.1/demos/bitmaps/fish/mid.xbm
deleted file mode 100644
index e7a3c6e..0000000
--- a/blt3.0.1/demos/bitmaps/fish/mid.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define fc_mid_width 16
-#define fc_mid_height 16
-#define fc_mid_x_hot 8
-#define fc_mid_y_hot 8
-static char fc_mid_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x80, 0x03, 0x40, 0x04, 0x20, 0x08,
- 0xe0, 0x0e, 0xe0, 0x0e, 0x20, 0x08, 0xa0, 0x0b, 0xe0, 0x0f, 0xa0, 0x0b,
- 0x40, 0x04, 0x80, 0x03, 0x80, 0x03, 0x00, 0x00};
diff --git a/blt3.0.1/demos/bitmaps/fish/midm.xbm b/blt3.0.1/demos/bitmaps/fish/midm.xbm
deleted file mode 100644
index 227afe2..0000000
--- a/blt3.0.1/demos/bitmaps/fish/midm.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define fc_midm_width 16
-#define fc_midm_height 16
-#define fc_midm_x_hot 8
-#define fc_midm_y_hot 8
-static char fc_midm_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x80, 0x03, 0xc0, 0x07, 0xe0, 0x0f,
- 0xe0, 0x0f, 0xe0, 0x0f, 0xe0, 0x0f, 0xe0, 0x0f, 0xe0, 0x0f, 0xe0, 0x0f,
- 0xc0, 0x07, 0x80, 0x03, 0x80, 0x03, 0x00, 0x00};
diff --git a/blt3.0.1/demos/bitmaps/fish/right.xbm b/blt3.0.1/demos/bitmaps/fish/right.xbm
deleted file mode 100644
index 4fb6b80..0000000
--- a/blt3.0.1/demos/bitmaps/fish/right.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define fc_right_width 16
-#define fc_right_height 16
-#define fc_right_x_hot 8
-#define fc_right_y_hot 8
-static char fc_right_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x20, 0x03, 0x41, 0x0e, 0x47, 0x30,
- 0x39, 0x44, 0x09, 0xb4, 0x01, 0xb4, 0x09, 0x84, 0x39, 0x44, 0xc7, 0x38,
- 0x41, 0x0e, 0x40, 0x01, 0xe0, 0x00, 0x00, 0x00};
diff --git a/blt3.0.1/demos/bitmaps/fish/right1.xbm b/blt3.0.1/demos/bitmaps/fish/right1.xbm
deleted file mode 100644
index 7858fa5..0000000
--- a/blt3.0.1/demos/bitmaps/fish/right1.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define fc_right1_width 16
-#define fc_right1_height 16
-#define fc_right1_x_hot 8
-#define fc_right1_y_hot 8
-static char fc_right1_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x03, 0x28, 0x07, 0xf8, 0x08,
- 0x28, 0x1b, 0x28, 0x1b, 0x08, 0x10, 0x28, 0x10, 0x28, 0x0b, 0x38, 0x0e,
- 0xc8, 0x06, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00};
diff --git a/blt3.0.1/demos/bitmaps/fish/right1m.xbm b/blt3.0.1/demos/bitmaps/fish/right1m.xbm
deleted file mode 100644
index 75cda36..0000000
--- a/blt3.0.1/demos/bitmaps/fish/right1m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define fc_right1m_width 16
-#define fc_right1m_height 16
-#define fc_right1m_x_hot 8
-#define fc_right1m_y_hot 8
-static char fc_right1m_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xc0, 0x03, 0xe8, 0x07, 0xf8, 0x0f,
- 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x0f, 0xf8, 0x0f,
- 0xc8, 0x07, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00};
diff --git a/blt3.0.1/demos/bitmaps/fish/rightm.xbm b/blt3.0.1/demos/bitmaps/fish/rightm.xbm
deleted file mode 100644
index 4f8ee37..0000000
--- a/blt3.0.1/demos/bitmaps/fish/rightm.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define fc_rightm_width 16
-#define fc_rightm_height 16
-#define fc_rightm_x_hot 8
-#define fc_rightm_y_hot 8
-static char fc_rightm_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0xe0, 0x03, 0xc1, 0x0f, 0xc7, 0x3f,
- 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xc7, 0x3f,
- 0xc1, 0x0f, 0xc0, 0x01, 0xe0, 0x00, 0x00, 0x00};
diff --git a/blt3.0.1/demos/bitmaps/greenback.xbm b/blt3.0.1/demos/bitmaps/greenback.xbm
deleted file mode 100644
index f54211c..0000000
--- a/blt3.0.1/demos/bitmaps/greenback.xbm
+++ /dev/null
@@ -1,885 +0,0 @@
-#define greenback_width 499
-#define greenback_height 210
-static char greenback_bits[] = {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x44,
- 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x09,0x10,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
- 0x20,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x22,0x00,0x40,0x00,
- 0x08,0x20,0x20,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10,
- 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x02,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x11,0x00,0x00,0x01,0x00,
- 0x00,0x00,0x48,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x20,0x02,0x04,
- 0x48,0x10,0x02,0x01,0x01,0x09,0x00,0x00,0x80,0x00,0x80,0x00,0x00,0x00,0x00,
- 0x22,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x04,0x04,0x48,0x10,0x01,
- 0x41,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x10,0x40,0x00,0x00,0x00,
- 0x40,0x00,0x02,0x08,0x48,0x00,0x02,0x80,0x20,0x00,0x00,0x80,0x04,0x00,0x00,
- 0x01,0x40,0x00,0x00,0x04,0x10,0x00,0x44,0x00,0x00,0x00,0x10,0x14,0x22,0x54,
- 0xa4,0xb6,0xf7,0xfe,0x6f,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0x9f,0xaa,0xd9,
- 0x95,0xef,0xfe,0xba,0xda,0xd7,0x56,0x77,0xaf,0x56,0x7d,0x81,0x50,0x45,0x15,
- 0xc9,0x00,0x00,0x00,0x6d,0xb5,0xd3,0x95,0xab,0xaa,0x35,0xad,0xaa,0x4a,0x29,
- 0x40,0x92,0x40,0x80,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x20,0x11,0x22,0x12,0x00,0x21,0x25,0x55,0xa8,0xa4,0x54,0xa9,0xaa,0x92,0x7e,
- 0x6f,0x7b,0xed,0xbe,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x88,0x00,0x42,0xa4,0x00,0x08,
- 0x41,0x00,0x00,0x01,0x00,0x81,0x80,0xa4,0x54,0x5b,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xbf,0x08,0x00,0x10,0xfd,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xbb,0xf7,0x80,0x84,
- 0x28,0x22,0x00,0x06,0x14,0x0c,0x68,0x04,0x08,0x80,0xf7,0xf7,0xfd,0xff,0xbf,
- 0xfb,0xff,0xf3,0xff,0xff,0xbb,0xea,0xef,0xbb,0xbf,0x00,0x00,0x00,0xdd,0xbf,
- 0xfe,0xbf,0xfe,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xef,0xe7,0x8a,0x5a,
- 0x82,0x92,0xb4,0x40,0x48,0x40,0x7f,0x7b,0x54,0x3e,0x02,0x06,0x00,0x07,0x00,
- 0x00,0x0c,0x06,0x03,0x23,0x08,0x1e,0x30,0x8e,0xe1,0x84,0x08,0x0e,0xe7,0xbf,
- 0xbe,0xef,0x7b,0xf5,0xda,0xb5,0xbd,0x5f,0xbf,0xff,0xee,0xae,0xbf,0x00,0x00,
- 0x00,0xf5,0x5d,0x9f,0xdf,0xdf,0xff,0xff,0xef,0xbf,0x63,0xeb,0xfe,0xbf,0xd6,
- 0xe5,0xc0,0x18,0x1c,0x83,0xc1,0xe0,0x38,0x1a,0x3c,0xf0,0x81,0x3f,0x18,0x18,
- 0x1c,0x83,0x7f,0xf0,0x1c,0x06,0x02,0x77,0x78,0x3e,0x61,0x83,0x43,0x82,0x19,
- 0x2c,0x67,0xd5,0x6f,0x53,0xb7,0xdd,0xff,0xe5,0x67,0xed,0xee,0xae,0xe7,0x7d,
- 0xab,0x08,0x00,0x00,0xbd,0xdf,0xaf,0x7f,0xbb,0xfd,0xee,0xcf,0xfb,0xdf,0xbf,
- 0xff,0xfd,0xfb,0xe7,0xc1,0x19,0x2c,0x87,0xc1,0x61,0x3b,0x1c,0x1c,0xf0,0xc1,
- 0x7f,0x38,0x38,0x6c,0x01,0xf0,0xa0,0x1d,0x06,0x06,0x7f,0xc8,0x7f,0xc0,0x83,
- 0xc3,0x96,0x9b,0xf0,0xe7,0xfe,0xdd,0xdd,0xfd,0xdf,0xae,0xa4,0xbb,0xba,0xbf,
- 0xdd,0x77,0xff,0xbb,0x00,0x00,0x00,0xf5,0x6e,0xaf,0x6f,0xfe,0x5f,0xfb,0xd7,
- 0xbf,0x7b,0xff,0x4e,0x77,0xef,0xe5,0x01,0x1e,0xe2,0x87,0xc3,0x21,0x3f,0x80,
- 0xdf,0xe0,0xe1,0xff,0x00,0x3e,0xe4,0x03,0x60,0x10,0x3f,0x82,0x0f,0x7a,0xd0,
- 0xfe,0x01,0x83,0xc3,0x87,0x1f,0x6c,0xe7,0x5b,0x7f,0xbf,0xb7,0xad,0x7b,0xe6,
- 0xad,0x6a,0xd7,0xfb,0xcd,0xbe,0xbd,0x20,0x00,0x24,0x5d,0xbf,0xb6,0x5f,0xdd,
- 0x57,0xfd,0x95,0xff,0xf7,0xdb,0xbd,0xbf,0xde,0xe7,0xc1,0x9e,0x6c,0x87,0xc1,
- 0x61,0x3b,0x08,0x2e,0xe0,0xe1,0x7f,0x18,0x3c,0x6c,0x17,0x60,0xa2,0x1d,0x06,
- 0x0f,0x3c,0x78,0x7e,0x03,0x83,0xc3,0x03,0x1f,0x3c,0xf7,0xfe,0xdb,0xfb,0xee,
- 0xff,0x7f,0xe6,0xdf,0xf7,0xf6,0x76,0xcb,0xbe,0xbd,0x02,0x00,0x00,0xf5,0x7b,
- 0x33,0xb5,0x5e,0xeb,0x57,0x97,0xdf,0xb5,0x7f,0xff,0xb5,0x5f,0xe3,0xc0,0x1f,
- 0x1c,0x83,0xc1,0xe0,0x38,0x18,0xe6,0xc0,0x61,0x3c,0x10,0x18,0x0c,0xf3,0x70,
- 0x30,0x0c,0x24,0x1e,0x1e,0x08,0x1e,0x46,0x8f,0xf1,0x03,0x86,0x04,0xa7,0xdd,
- 0xb6,0xfe,0xba,0xaf,0x7f,0x67,0xf7,0xdf,0xbf,0xdb,0xdb,0x7f,0xbe,0x00,0x00,
- 0x00,0xdd,0xfc,0xaa,0x2e,0xff,0xfa,0xff,0x27,0x7f,0x7b,0xb3,0x77,0x7b,0xdb,
- 0x67,0x10,0x06,0x00,0x49,0xba,0x2a,0x08,0x25,0x80,0x00,0x84,0x2c,0x64,0x00,
- 0x50,0x57,0xbf,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xe7,0xfe,0xea,0xff,0xb3,0xff,0x6f,0xd7,0xfa,0xb5,0xf6,0xeb,0x9a,0x9f,
- 0xb6,0x20,0x00,0x00,0xbd,0x79,0x3b,0xb6,0xde,0xde,0xdb,0x35,0xef,0xf6,0x5d,
- 0xf7,0xdb,0x7e,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xe7,0xff,0xff,0xff,0xff,0xff,0xbf,0x47,0x6d,0xff,0xba,
- 0xff,0xdb,0x97,0xbe,0x08,0x00,0x00,0xcd,0xf6,0xb6,0xae,0xad,0xf7,0x76,0x35,
- 0xfe,0xff,0xff,0xff,0xff,0xff,0xa7,0x56,0x7b,0x55,0x92,0x52,0x40,0x22,0x01,
- 0x08,0xa4,0x54,0x4a,0x01,0x12,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xe0,0xe7,
- 0xd6,0xef,0xe7,0x91,0x35,0x57,0xbe,0x00,0x00,0x00,0xfd,0xe6,0x3c,0xf7,0x5a,
- 0xfc,0xcf,0x32,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x10,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x01,
- 0x00,0x00,0x42,0x04,0xb5,0xd2,0xaa,0xfa,0xef,0xff,0xf7,0xf7,0xbd,0x55,0xdd,
- 0xb6,0xad,0xc7,0xf3,0xfe,0xfe,0xe3,0x9d,0x6b,0xbe,0x00,0x00,0x40,0xdd,0xde,
- 0x77,0x8e,0xc5,0x7f,0xaf,0x5f,0xf2,0xff,0xff,0xff,0xff,0xbf,0xed,0x75,0xab,
- 0xd6,0x5a,0x55,0x8b,0x54,0x55,0xa9,0xab,0xaa,0xaa,0xaa,0x00,0x02,0x08,0x80,
- 0x10,0x10,0x00,0x84,0x20,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0xa2,0xd3,0xfd,0x4b,0x49,0x40,0x77,0x7f,0xbe,0x02,0x00,
- 0x00,0xfd,0xd6,0xbd,0x81,0xb6,0xfd,0xaf,0x3b,0x02,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x04,0x20,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x92,0xe7,0x74,0x01,0x00,0x04,0x00,0x20,
- 0xbe,0x00,0x00,0x08,0xed,0xaa,0x7d,0x48,0x1d,0xee,0x6f,0x7e,0x36,0x40,0x80,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x04,0x00,0x00,0x00,0x41,0x20,0x84,0x00,0x02,0x00,0x00,0x08,0x10,0x00,0x20,
- 0x42,0x02,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x55,0xf7,0xa7,0xad,
- 0xfe,0x6d,0x79,0xbf,0x40,0x00,0x00,0xfd,0x96,0x3d,0x82,0xeb,0xba,0x7f,0x2b,
- 0x15,0x02,0x21,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x24,0x22,0x00,
- 0x00,0x00,0x00,0x28,0x00,0x42,0x00,0x00,0x02,0x00,0x00,0x00,0x11,0x00,0x00,
- 0x00,0x44,0x08,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x00,0x21,0xb0,0x67,
- 0xa7,0xe7,0xff,0xf7,0xff,0x1b,0xbf,0x00,0x00,0x00,0xed,0xb4,0x0d,0xfc,0x14,
- 0xf4,0xed,0x7c,0x82,0x10,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x80,0x80,0x24,
- 0x00,0x00,0x04,0x01,0x00,0x20,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x40,0x00,
- 0x00,0x02,0x00,0x08,0x00,0x02,0x80,0x10,0x80,0x40,0x04,0x11,0x20,0x40,0x10,
- 0x08,0xa9,0xad,0xe5,0xb7,0xff,0x7b,0xff,0x5a,0xb3,0x08,0x00,0x00,0xdd,0x2a,
- 0x01,0x7f,0xff,0xe9,0xef,0xb8,0x0a,0x00,0x00,0x20,0x00,0x00,0x04,0x00,0x08,
- 0x20,0x08,0x80,0x08,0x00,0x40,0x00,0x40,0x00,0x00,0x09,0x01,0x20,0x00,0x00,
- 0x10,0x00,0x00,0xc0,0x40,0x42,0x02,0x0a,0xa8,0x60,0xeb,0x7f,0x5a,0x1b,0xd5,
- 0xa1,0x0a,0x0c,0x00,0xa5,0xaf,0x53,0xb3,0xde,0xfa,0x57,0xdb,0xbf,0x00,0x00,
- 0x20,0xfd,0x4a,0x93,0x6f,0xf7,0xc9,0xaf,0x78,0x03,0x40,0x24,0x8a,0x02,0x40,
- 0x01,0x25,0x21,0x15,0xa5,0x02,0x52,0x49,0x05,0xad,0x00,0x80,0x11,0x52,0x42,
- 0x41,0xb5,0xfd,0x17,0xbd,0x07,0x10,0x45,0x95,0x00,0x10,0x00,0x49,0x55,0xd1,
- 0xea,0x4a,0xfd,0xc8,0x16,0x28,0x00,0xda,0x7d,0xe5,0x52,0xff,0xb3,0x7f,0xd2,
- 0xbb,0x00,0x00,0x08,0xad,0x1a,0xc8,0xdb,0xef,0x87,0xaf,0xb8,0x2e,0xf8,0xff,
- 0x3f,0x3f,0x3f,0x17,0xf0,0x79,0x5e,0xcf,0xf7,0xff,0xbc,0x9e,0xdf,0x04,0x68,
- 0xfe,0xff,0x87,0xe1,0xef,0x78,0x5c,0x8c,0x0b,0x34,0x16,0x8e,0x0b,0x5c,0xf6,
- 0xf2,0xc0,0xe1,0xf2,0x78,0x79,0x74,0x5c,0x5c,0x00,0xe5,0xff,0xe2,0x79,0xdf,
- 0xcc,0xb7,0xe7,0xbf,0x00,0x00,0x00,0xfd,0x65,0xe4,0x7f,0xfe,0x1e,0xaf,0x7d,
- 0x0b,0x78,0x67,0x3c,0x1e,0x3e,0x07,0xf8,0x60,0xbe,0x86,0xf7,0xef,0x38,0x5c,
- 0x1e,0x0b,0x70,0x9c,0xbb,0xc7,0xe5,0xde,0x71,0x9c,0x07,0x03,0x3d,0xae,0x8e,
- 0x43,0x98,0xf8,0xe5,0xd9,0xe9,0xf4,0x78,0x7a,0x7a,0x4a,0x1c,0x00,0x6d,0x3f,
- 0x13,0x38,0xa9,0xf9,0xad,0x85,0xb6,0x09,0x00,0x00,0x5d,0x69,0x75,0xb3,0xd4,
- 0x9b,0x0e,0xbb,0x01,0xb8,0xef,0xbc,0x9e,0x9c,0x6e,0xf0,0x29,0x3d,0xa1,0x77,
- 0xce,0x38,0x1b,0x1e,0x2f,0x3c,0xb1,0x79,0xd3,0x73,0xce,0x70,0x3e,0xe7,0x36,
- 0x9c,0x5e,0x4f,0x13,0x3e,0xe2,0xe9,0xf4,0xe9,0xf4,0xfe,0x7a,0x3a,0x95,0xbe,
- 0x41,0xb9,0x5d,0x30,0xdf,0x76,0xb7,0xd7,0x1f,0xf6,0x00,0x00,0x04,0xad,0x12,
- 0xb2,0x7e,0xbe,0x39,0xae,0x71,0x08,0x10,0xe7,0x3e,0x9e,0x9c,0xa6,0xf0,0x34,
- 0x7d,0x94,0x33,0xcf,0x38,0x5c,0x9f,0x4f,0x78,0xbd,0x39,0xd6,0x63,0x9e,0x79,
- 0x18,0x4f,0x27,0x1d,0x9f,0x8e,0x12,0x3e,0xf1,0xe9,0xec,0xd9,0xfc,0x7c,0x3a,
- 0x3e,0xcb,0x3d,0x02,0x7a,0x5b,0xa5,0xff,0xfc,0x08,0x4e,0x7f,0xbf,0x00,0x00,
- 0x00,0xbd,0x37,0xb9,0xda,0x5e,0xea,0x4c,0x73,0x05,0x99,0x67,0xbc,0x9f,0x9e,
- 0x26,0xf0,0x8c,0xfa,0xb0,0x37,0xcf,0x3c,0x8b,0x1e,0xcf,0xfc,0x85,0x78,0xd7,
- 0x73,0x4f,0x71,0x0a,0xff,0x10,0x9e,0x3f,0x4e,0x33,0x39,0xd3,0xe3,0xc5,0x59,
- 0xf8,0x7a,0x7e,0x3d,0x41,0x78,0x02,0xe6,0xbe,0xe2,0xb7,0x70,0xa5,0xe6,0xbb,
- 0xb7,0x00,0x00,0x00,0xdd,0x2d,0x3d,0xb7,0xfa,0x79,0xcd,0xb3,0x28,0x54,0x6f,
- 0x3e,0x9e,0xdc,0x6a,0xf0,0x2e,0xf1,0xd0,0x27,0xcf,0x3c,0x4b,0x9f,0x8f,0xf8,
- 0x9f,0x3c,0xa5,0x27,0xdf,0x78,0x83,0xff,0x33,0x3e,0x9f,0x7e,0x10,0x78,0xd2,
- 0xeb,0xec,0x1f,0xfb,0x3e,0x79,0x7c,0xd3,0x78,0x06,0x6a,0x5d,0x62,0xfa,0x6c,
- 0x00,0xb6,0x97,0xbf,0x00,0x00,0x00,0xbd,0x9b,0x5c,0x7a,0x5f,0xf6,0x5a,0x33,
- 0x0d,0x40,0x47,0xbc,0x9e,0xdc,0x24,0xf0,0x84,0xe2,0x93,0x93,0x9e,0xb8,0x53,
- 0x1f,0x5f,0xf0,0xff,0x7a,0x05,0xa7,0x8e,0x74,0xd3,0xfe,0x17,0x9f,0x3e,0x6f,
- 0xae,0xf1,0x8d,0xe7,0xc4,0xd9,0xf4,0x9c,0x7d,0x3d,0xb5,0x7c,0x04,0xec,0x59,
- 0x73,0x9f,0x39,0x00,0xd7,0x9d,0xbd,0x10,0x00,0x08,0xad,0x4e,0xbe,0x1d,0x50,
- 0xdd,0xb1,0x5b,0x06,0xa0,0x2f,0x3f,0x9e,0x9c,0x28,0xf0,0x24,0xdb,0xb3,0x77,
- 0x4f,0x3a,0x21,0x9e,0xcf,0x88,0x3f,0x3a,0x89,0xaf,0xce,0x75,0x3a,0xa0,0x07,
- 0x9e,0x9e,0x4e,0x81,0xfa,0x94,0xf7,0xec,0x89,0xf0,0x78,0x38,0x3e,0x19,0xf0,
- 0x04,0x54,0x57,0x33,0xfd,0x06,0x00,0xeb,0xaf,0xbb,0x04,0x00,0x00,0xfd,0x4f,
- 0xce,0xd5,0xcb,0xfa,0x35,0x13,0x0d,0x81,0x47,0x3c,0x9f,0x3c,0x0c,0xf2,0x24,
- 0xe1,0xd3,0xa7,0xce,0x3c,0x14,0x9e,0x8e,0x04,0x3c,0x79,0x52,0x2f,0x0f,0x79,
- 0x00,0x82,0x27,0x3d,0x9f,0x4e,0x86,0xf0,0xcc,0xe7,0xcd,0xc9,0xf2,0x7a,0x7b,
- 0x39,0x91,0xe1,0x09,0x95,0xa7,0xb6,0xfb,0x11,0x10,0x6e,0x47,0xbf,0x00,0x00,
- 0x00,0x5d,0xa3,0xdf,0x09,0xc0,0xad,0x77,0xab,0x06,0x88,0x67,0xbe,0x9e,0x9e,
- 0x4e,0xf0,0x8d,0x92,0xab,0x17,0x4f,0x38,0x39,0x1f,0x4f,0xd8,0x3a,0x3d,0x0d,
- 0x5e,0xde,0x70,0xba,0x79,0x66,0x9e,0x9e,0xce,0xc3,0xe4,0x99,0xf3,0xc4,0xfb,
- 0xf4,0x7a,0x7e,0x7a,0xc6,0xfc,0x09,0xd8,0x6a,0xbd,0x5e,0x0f,0x01,0xdf,0x65,
- 0xbf,0x00,0x00,0x00,0xfd,0x27,0xd7,0x06,0xd0,0xf7,0xeb,0x0a,0x2a,0x85,0x27,
- 0xbc,0x1e,0xbd,0x4e,0xf0,0x24,0xb3,0xd3,0x13,0xcf,0x3c,0x9f,0x9e,0xcf,0x98,
- 0x32,0x7b,0xca,0x9e,0x9e,0x75,0x1e,0x53,0x47,0x3c,0x8f,0x8e,0xa2,0xee,0x91,
- 0xea,0xd5,0xe9,0xf8,0x7c,0x79,0x76,0xca,0xf0,0x09,0x30,0x75,0x9b,0xfa,0x1e,
- 0x80,0xb6,0x57,0xbb,0x00,0x00,0x00,0xbd,0x65,0xfb,0x09,0xd0,0x5d,0xf7,0x62,
- 0x07,0xa0,0x6f,0x3d,0x9f,0x1e,0x4f,0xe0,0x09,0x47,0xd3,0xb7,0x9f,0xba,0x3c,
- 0x1e,0xa3,0x38,0x3b,0x7d,0x1a,0x9d,0x1f,0x79,0xbe,0xcf,0x31,0x34,0xe7,0x7f,
- 0xf8,0xf5,0x7b,0xf9,0xfa,0xab,0x74,0xf5,0xac,0xec,0xb1,0x96,0x32,0x60,0xaf,
- 0xed,0x54,0xbf,0x00,0xdf,0xd2,0xbf,0x12,0x00,0x00,0xed,0x96,0x6b,0x82,0xc0,
- 0xb7,0x4e,0xa2,0x85,0xa0,0x1f,0xff,0xbf,0xbf,0x8f,0xd0,0x8b,0x1f,0xe6,0xaf,
- 0xbf,0x7e,0x9f,0xdf,0x51,0xfc,0x8c,0xfd,0x5e,0x7f,0x7f,0xfd,0x1a,0xbf,0x28,
- 0xa4,0x21,0x84,0x00,0x09,0x80,0x01,0x00,0x00,0x00,0x04,0x00,0x12,0x00,0x00,
- 0x10,0x61,0x9a,0x7d,0xb6,0x2d,0x10,0x77,0x99,0xbb,0x00,0x00,0x08,0xad,0x93,
- 0xd6,0x24,0xd8,0xfd,0xf5,0xd5,0x25,0x20,0x40,0x00,0x00,0x00,0x40,0x00,0x60,
- 0x40,0x10,0x00,0x00,0x02,0x80,0x00,0x2c,0x00,0x20,0x02,0x80,0x00,0x00,0x02,
- 0x00,0x01,0x14,0x10,0xd0,0x28,0x61,0x50,0x55,0xbe,0xaf,0xba,0xae,0x95,0xb6,
- 0x4d,0x7e,0x6b,0x37,0x40,0x6a,0x9f,0xed,0xbd,0x00,0xbf,0xeb,0xb7,0x00,0x00,
- 0x00,0xfd,0x92,0xfd,0x01,0xe0,0x1f,0x6d,0x97,0x05,0x44,0xa5,0x2a,0xa0,0xaa,
- 0x52,0xc0,0xa0,0x52,0xb4,0x52,0x4a,0x69,0x55,0x15,0x29,0x20,0x68,0x00,0x84,
- 0x24,0xa9,0x55,0xf7,0x4a,0x0b,0x90,0x2c,0x57,0x81,0x47,0x55,0x61,0x55,0xeb,
- 0x52,0xeb,0xda,0xa6,0x45,0xad,0xea,0x80,0x59,0x8c,0x6a,0x37,0x00,0xfb,0x7b,
- 0xbe,0x10,0x00,0x00,0xfd,0xa9,0xb3,0x0f,0xd0,0xab,0xdd,0xe9,0x0a,0x00,0x5b,
- 0xd5,0xaf,0x5a,0xad,0x00,0x5d,0xac,0x28,0x6d,0xb4,0x52,0x55,0x55,0x0b,0xc0,
- 0x17,0xf8,0xb5,0xea,0x6a,0x53,0x4d,0xb9,0x02,0x40,0x05,0x54,0x02,0x95,0xaa,
- 0x4a,0xad,0x2a,0x45,0x15,0xa5,0x0a,0x02,0x83,0x04,0x08,0xff,0x4d,0xb1,0x9f,
- 0x00,0x5e,0x41,0xbd,0x00,0x00,0x00,0xad,0xd9,0xcf,0x06,0xf2,0x53,0xee,0x6d,
- 0x01,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0xa8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,
- 0x4e,0x6a,0x3d,0x88,0xab,0x35,0xb6,0x00,0x00,0x00,0x7d,0xa9,0xbd,0x13,0xc0,
- 0x09,0xd3,0x7a,0x03,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x02,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,0x00,
- 0x10,0x05,0x78,0x35,0x6d,0xb7,0x00,0x1e,0x2d,0xb7,0x08,0x00,0x00,0x9d,0xa9,
- 0x3f,0x06,0xd0,0x7c,0xa2,0x6b,0x10,0x90,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x20,
- 0x08,0x00,0x00,0x00,0x80,0x42,0x00,0x00,0x00,0x20,0x00,0x00,0x80,0x00,0x00,
- 0x00,0x00,0x20,0x00,0x18,0x62,0xfd,0xf2,0xb0,0x80,0xe2,0xc9,0xbb,0x00,0x00,
- 0x20,0xdd,0xa8,0xb6,0x15,0xf2,0x1d,0xf2,0xbe,0x82,0x00,0x20,0x00,0x00,0x00,
- 0x00,0x80,0x00,0x00,0x02,0x00,0x04,0x00,0x40,0x40,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x10,0x00,0x02,0x02,0x80,0x10,0x08,0x00,0x00,0x11,0x00,0x04,0x41,0x00,
- 0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x90,0xc8,0xec,0xf5,0x35,0x20,0xf7,0xe9,
- 0xbd,0x00,0x00,0x04,0xbd,0xa9,0xaf,0x85,0xc0,0x35,0xd4,0x54,0x28,0x80,0x00,
- 0x10,0x11,0x01,0x04,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x09,0x00,0x00,0x00,
- 0x00,0x04,0x00,0x00,0x00,0x10,0x40,0x20,0x22,0x80,0x00,0x00,0x40,0x00,0x21,
- 0x01,0x00,0x00,0x08,0x20,0x04,0x88,0x08,0x02,0x00,0xbc,0xe5,0x1f,0xf1,0xbd,
- 0x08,0x6b,0xe9,0xbf,0x22,0x00,0x00,0xdc,0x98,0xb7,0x17,0xd8,0x7d,0xae,0xad,
- 0x02,0x20,0x00,0x04,0x00,0x20,0x01,0x10,0x00,0x00,0x00,0x24,0x00,0x49,0x00,
- 0x00,0x00,0x22,0x04,0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x40,
- 0x10,0x00,0x00,0x00,0x20,0x84,0x80,0x00,0x80,0x00,0x00,0x20,0x04,0x64,0x92,
- 0x1d,0x65,0x2d,0x00,0xde,0x65,0xb5,0x00,0x00,0x00,0xdd,0x28,0xfb,0x07,0xc0,
- 0xfb,0x6c,0x23,0x5a,0x08,0x20,0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x00,0x00,
- 0x10,0x00,0x00,0x10,0x20,0x00,0x20,0x02,0x10,0x00,0x40,0x80,0x08,0x00,0x00,
- 0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x40,0xb8,0xa7,0xdb,0xf3,0xb6,0x80,0x66,0xf1,0xbb,0x08,0x00,0x00,0x7d,0x4c,
- 0x5f,0x17,0xd0,0x5b,0xe4,0x00,0x20,0x01,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x20,0x02,0x00,0x00,0x00,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,
- 0x00,0x44,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x40,0x10,
- 0x00,0x00,0x00,0x00,0x68,0x55,0xda,0xe3,0x1e,0x00,0xdf,0xf5,0xbd,0x00,0x00,
- 0x00,0x9d,0x58,0xf7,0x82,0xd0,0x9f,0x2d,0x9f,0x97,0x06,0x00,0x00,0x38,0x15,
- 0x62,0x1f,0x9f,0xfc,0x8a,0xcb,0xbe,0x87,0x20,0x00,0x00,0x00,0x00,0x40,0x00,
- 0x00,0x00,0x10,0x90,0x00,0x22,0x0a,0x09,0x92,0x10,0x84,0x20,0x00,0x80,0x10,
- 0x00,0x04,0x00,0x20,0x82,0x08,0x00,0xc0,0x75,0xeb,0x62,0xbd,0x00,0x5a,0x75,
- 0xb7,0x02,0x00,0x00,0xed,0xc8,0x94,0x15,0xe4,0x55,0xc9,0x3c,0x10,0x8c,0x00,
- 0x00,0x90,0x35,0x0e,0x09,0x8d,0xd4,0x0b,0xe9,0xaa,0x23,0x00,0xa0,0x2a,0xad,
- 0x57,0x09,0x8a,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,
- 0x00,0x24,0x04,0x44,0x00,0x00,0x08,0x20,0x00,0x02,0x00,0xde,0xae,0xe7,0x3a,
- 0x88,0xd7,0x9b,0xbf,0x10,0x00,0x00,0x7d,0xd8,0x2c,0x04,0xd0,0x58,0xab,0x77,
- 0xa0,0x0c,0x00,0x00,0x41,0x00,0x26,0x2b,0x89,0x71,0x0d,0x81,0x9a,0x13,0x00,
- 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x48,0xa5,0xa2,0x4a,0x45,0x00,
- 0x84,0x00,0x00,0x04,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x00,0x00,0x20,0x70,
- 0xcd,0x62,0xad,0x00,0x4b,0xb5,0xbb,0x0a,0x00,0x00,0x9d,0xa8,0xb1,0x07,0xe0,
- 0xbb,0xca,0x99,0xd2,0x11,0x04,0x10,0x00,0x14,0x00,0x10,0x00,0x00,0x40,0x00,
- 0x00,0x00,0x01,0x40,0xc7,0x9f,0x7c,0xef,0x87,0xff,0xff,0xe3,0x97,0xbd,0xfc,
- 0xe5,0x02,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x08,0x01,0x00,0x00,0x40,
- 0x00,0x42,0xa0,0xff,0xe3,0x1d,0x00,0xb6,0x5b,0xbd,0x00,0x00,0x00,0x6c,0x1c,
- 0xdb,0x15,0xd1,0xbb,0xd1,0xf6,0x85,0x3b,0x00,0x01,0x00,0x80,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x33,0x1f,0x34,0xeb,0xf1,0xff,0xff,0x8f,
- 0x77,0x5d,0xfd,0xd0,0x05,0x00,0x00,0x00,0x80,0x40,0x00,0x00,0x00,0x01,0x80,
- 0x00,0x00,0x02,0x40,0x80,0x6a,0xbb,0x73,0xb6,0x90,0xae,0xf3,0xbf,0x00,0x00,
- 0x00,0xfd,0x88,0xea,0x07,0xd0,0xfb,0xe9,0xa9,0xa2,0x6e,0x00,0x10,0x11,0x01,
- 0x08,0x25,0x00,0x02,0x42,0x10,0x2a,0x09,0x0c,0x40,0xfd,0xe0,0xb7,0x7f,0xfe,
- 0xff,0xff,0x7f,0xfc,0xcb,0x27,0xbf,0x04,0x80,0x10,0x04,0x20,0x00,0x08,0x00,
- 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0xd6,0xee,0xf3,0x3d,0x00,0xab,0x93,
- 0xbf,0x00,0x00,0x00,0x6d,0x58,0xd8,0x05,0xc4,0xdd,0xab,0xe2,0x4f,0x7f,0x02,
- 0xb7,0xa5,0xc4,0xed,0x37,0x3e,0xd6,0x67,0x72,0x6c,0xab,0x0f,0x49,0xeb,0xe5,
- 0xd7,0x1b,0xff,0xff,0xff,0xff,0xd1,0xeb,0xcf,0xbf,0x05,0x00,0x00,0x00,0x04,
- 0x00,0x80,0x10,0x10,0x00,0x00,0x08,0x08,0x00,0x00,0x00,0xb8,0x5d,0x73,0x97,
- 0x00,0xde,0x73,0xb5,0x02,0x00,0x40,0x6d,0x32,0x7f,0x97,0xd0,0x7b,0xeb,0xcd,
- 0xf2,0x5a,0x00,0x8e,0x61,0xc4,0xed,0x32,0x9e,0x52,0xa1,0x56,0x7c,0x2d,0x0d,
- 0x00,0x3f,0xeb,0xf9,0xe7,0xff,0xff,0xff,0xff,0x47,0xdf,0xaa,0xee,0x02,0x00,
- 0x44,0x80,0x00,0x40,0x20,0x00,0x02,0x20,0x00,0x80,0x00,0x20,0x00,0x00,0x42,
- 0xb7,0xf9,0xbe,0x90,0xee,0xf3,0xbf,0x20,0x00,0x10,0x7c,0x30,0xbe,0x07,0xd2,
- 0xff,0xd3,0xc2,0xc7,0xf5,0x20,0xab,0x71,0x44,0xa5,0x02,0x24,0x96,0x65,0x54,
- 0x42,0x65,0x05,0x40,0xc3,0xee,0xf7,0xe2,0xff,0x7f,0xf5,0xff,0x9f,0xb5,0xab,
- 0x83,0x01,0x09,0x00,0x20,0x00,0x08,0x04,0x10,0x40,0x02,0x00,0x00,0x40,0x08,
- 0x00,0x10,0xa0,0xfb,0xd9,0x2a,0x04,0xf7,0xa2,0xbd,0x08,0x00,0x00,0xfd,0x5a,
- 0xbc,0x04,0xf0,0xda,0xeb,0x94,0x0d,0x68,0x00,0x22,0x08,0xca,0x64,0xb2,0x66,
- 0x52,0x82,0x14,0x40,0x14,0x04,0x00,0x3c,0x6b,0xbd,0xfc,0xff,0x02,0x80,0xff,
- 0x3f,0xbe,0xcd,0x3c,0x02,0x80,0x40,0x08,0x00,0x02,0x00,0x00,0x00,0x80,0x88,
- 0x00,0x08,0x00,0x08,0x00,0xb4,0xee,0xf9,0xb6,0xa0,0xea,0xe7,0xb7,0x02,0x00,
- 0x00,0xcd,0x30,0xbd,0x17,0xd1,0x2c,0xaa,0xe5,0x27,0x80,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x43,0x77,0x3d,0xff,0x0b,
- 0x0a,0x21,0xfc,0xff,0x68,0xef,0x80,0x00,0x00,0x10,0x00,0x80,0x80,0x00,0x08,
- 0x42,0x08,0x00,0x08,0x00,0x01,0x00,0x01,0x51,0xfb,0xf9,0xb1,0x00,0xd6,0xe7,
- 0xbe,0x00,0x00,0x00,0xfd,0x68,0xcc,0x06,0xd0,0xfd,0xeb,0x8c,0x0d,0x00,0x08,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x40,0x80,0xb6,
- 0x16,0xff,0xf5,0x00,0x00,0xf1,0xff,0xf1,0x7a,0x02,0x20,0x00,0x00,0x08,0x20,
- 0x02,0x00,0x20,0x10,0x00,0x01,0x05,0x00,0x28,0x40,0x10,0x8c,0xb5,0x59,0x39,
- 0x90,0x66,0xe5,0xbb,0x00,0x00,0x00,0xad,0xd8,0xbe,0x13,0xd0,0xe7,0xdb,0xe4,
- 0x06,0x12,0x00,0x00,0x09,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x00,0x00,
- 0x88,0x01,0x7a,0xc7,0x7f,0x83,0x90,0x44,0x82,0xff,0xcf,0x6f,0xc3,0x03,0x00,
- 0x00,0xfa,0x80,0x8f,0x3e,0x3e,0xe4,0xd1,0xc7,0x9d,0x3e,0x78,0xc1,0x10,0x60,
- 0xbd,0x6c,0x36,0x82,0xbe,0xcf,0xb5,0x40,0x00,0x04,0xed,0xe8,0xf6,0x07,0xe2,
- 0x4b,0xd9,0xb4,0x87,0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x00,
- 0x11,0x00,0x10,0x40,0x85,0xd6,0xe3,0xbf,0x14,0x00,0x42,0xc0,0xff,0xcf,0x7c,
- 0x23,0x06,0x20,0x10,0xa4,0x80,0x19,0x3a,0x20,0x30,0x43,0x84,0x00,0x22,0xca,
- 0xc0,0x10,0xc5,0xda,0xbc,0x5d,0x00,0x6a,0xdb,0xbb,0x00,0x00,0x20,0x99,0x31,
- 0x57,0x07,0xd0,0xbb,0xee,0xaa,0x0b,0x00,0x08,0x00,0x00,0x00,0x08,0x40,0x20,
- 0x42,0x00,0x10,0x00,0x04,0x00,0x60,0x09,0xfa,0xf8,0xbf,0x89,0x42,0x00,0x01,
- 0xff,0xbf,0x6b,0xd3,0x0a,0x02,0x00,0x09,0x81,0x10,0x03,0x10,0x10,0x22,0x84,
- 0x00,0x60,0x84,0x40,0x10,0x22,0x2c,0x56,0x47,0xad,0xf8,0x9c,0xbd,0x20,0x00,
- 0x00,0xfd,0x32,0xff,0x91,0xd0,0x7f,0x56,0xd8,0x0b,0x00,0x00,0x81,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x01,0x44,0x02,0xde,0xfd,0x9f,0x02,
- 0x04,0x48,0x24,0xff,0x3f,0x7f,0x51,0x8d,0x00,0x00,0x88,0x00,0x18,0x23,0xa0,
- 0x00,0x40,0x86,0x00,0x20,0x48,0xc0,0x18,0x62,0x4a,0xf6,0x03,0x00,0xd0,0x9b,
- 0xbf,0x04,0x00,0x00,0xdc,0xf1,0x75,0x0f,0xd0,0x9f,0x7a,0xb5,0x05,0x10,0x41,
- 0x00,0x40,0x10,0x01,0x08,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x90,0x08,0x7a,
- 0xfe,0x77,0x5c,0x11,0x02,0x01,0xf8,0x7f,0x4e,0x23,0x0d,0x00,0x08,0xd4,0x10,
- 0x0e,0x3c,0x30,0x00,0xc3,0x91,0x1f,0x1c,0x7c,0x40,0x4f,0x08,0x6d,0xab,0xfe,
- 0xff,0xff,0x2a,0xb7,0x00,0x00,0x00,0xfd,0xf1,0xf6,0x03,0xe4,0x66,0x55,0xa0,
- 0x07,0x00,0x00,0x00,0x02,0x00,0x40,0x00,0x00,0x10,0x08,0x00,0x00,0x00,0x80,
- 0xa0,0x88,0x6a,0xfe,0x6b,0x05,0x00,0x40,0x00,0xf4,0x7f,0x5c,0x23,0x09,0x00,
- 0x00,0xf8,0x04,0x16,0x36,0x24,0xc4,0x91,0x86,0x10,0x38,0xd9,0xc0,0x10,0x12,
- 0x15,0xeb,0xff,0xff,0xbf,0x35,0xbf,0x40,0x00,0x00,0xfd,0xa5,0xaf,0x44,0x01,
- 0xef,0x39,0x42,0x05,0x02,0x10,0x40,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,
- 0x81,0x00,0x20,0xc0,0x98,0x9e,0xff,0x5a,0x05,0x90,0x10,0x90,0xf0,0xff,0xf9,
- 0x12,0x06,0x00,0x01,0x84,0x80,0x18,0x23,0x20,0x70,0x60,0x04,0x10,0x60,0x84,
- 0xc2,0x10,0x81,0xab,0x5f,0xff,0xff,0xff,0x5e,0xbe,0x00,0x00,0x40,0xac,0xe1,
- 0x6e,0x10,0x80,0xfa,0x3e,0x80,0x03,0x00,0x04,0x00,0x40,0x00,0x00,0x00,0x04,
- 0x02,0x00,0x40,0x00,0x10,0x00,0x00,0x88,0xda,0xbf,0x55,0x50,0x00,0x04,0x22,
- 0xc4,0xff,0xb3,0x32,0x00,0x00,0x00,0x08,0x01,0x10,0x41,0x20,0x10,0x64,0x0c,
- 0x08,0x00,0x84,0x40,0x10,0xd3,0x90,0x7b,0x45,0xa1,0xdd,0x77,0xbe,0x40,0x00,
- 0x08,0x7d,0xe9,0xdf,0xff,0xff,0xff,0x36,0x80,0x01,0x80,0x00,0x00,0x10,0x00,
- 0x00,0x04,0x00,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x48,0xcf,0x7f,0xc6,0x0a,
- 0x14,0x41,0x08,0xc1,0xff,0xe7,0x10,0x00,0x00,0x80,0x88,0x00,0x18,0x23,0x30,
- 0x12,0x20,0x04,0x18,0x61,0xcc,0xc0,0x10,0x75,0x34,0xdf,0x7e,0x55,0xdd,0x3f,
- 0xbe,0x04,0x00,0x02,0xdd,0xe2,0xd7,0xff,0xff,0x6f,0x9d,0x10,0x00,0x20,0x00,
- 0x20,0x00,0x40,0x10,0x40,0x20,0x00,0x24,0x00,0x00,0x00,0x00,0x10,0x48,0xe7,
- 0xaf,0x35,0x05,0x10,0x88,0x41,0x94,0xff,0xcf,0x34,0x80,0x10,0x00,0x7c,0x80,
- 0x0f,0x3e,0xae,0xf0,0xc3,0x83,0x07,0x1e,0x38,0xc0,0x10,0x0b,0x40,0xd4,0xf5,
- 0xfb,0xf7,0x8c,0xbf,0x10,0x00,0x00,0xfa,0xcb,0x3d,0xad,0x7f,0x79,0x0d,0x00,
- 0x00,0x01,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,
- 0x04,0x0c,0xf3,0x9f,0x0a,0x01,0x40,0x20,0x04,0x01,0xff,0xcf,0x14,0x00,0x00,
- 0x08,0x68,0x80,0x02,0x0c,0xfc,0xd8,0x02,0x41,0x05,0x14,0x40,0x00,0x00,0x05,
- 0x80,0xc9,0xea,0xde,0xda,0xc0,0xb7,0x00,0x00,0x00,0x9d,0xca,0xaf,0x7e,0xeb,
- 0xba,0x0f,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0xa4,0xf9,0x55,0xa1,0x08,0x0d,0x00,0x00,0x24,0xdf,0x9f,
- 0x2d,0x20,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,
- 0x10,0x40,0x02,0x40,0xa2,0x7a,0xf3,0x67,0xf2,0xbf,0x00,0x00,0x00,0xfc,0x97,
- 0x37,0x6b,0x6f,0xbd,0x06,0x00,0x00,0x00,0x20,0x00,0x00,0x40,0x00,0x00,0x42,
- 0x00,0x00,0x82,0x00,0x04,0x00,0x00,0xa8,0xf9,0x37,0x54,0x10,0x90,0x20,0xa8,
- 0x00,0xfc,0x1f,0x2b,0x00,0x00,0x00,0x00,0x08,0x80,0x00,0x00,0x00,0x08,0x10,
- 0x20,0x00,0x00,0x00,0x10,0x90,0x00,0x96,0xea,0xfd,0x57,0x7b,0xbf,0x44,0x00,
- 0x00,0xad,0x57,0xcf,0x7d,0xfd,0x4c,0x83,0x00,0x42,0x00,0x02,0x40,0x20,0x08,
- 0x00,0x92,0x00,0x04,0x00,0x20,0x20,0x80,0x00,0x01,0xd6,0xfc,0x6b,0xa9,0x84,
- 0x04,0x14,0x48,0xa0,0xfc,0x7f,0x4b,0x00,0x00,0x81,0x00,0x00,0x24,0x40,0x00,
- 0x80,0x40,0x04,0x04,0x04,0x00,0x00,0x00,0x04,0x08,0x88,0xdd,0xbb,0x6d,0xde,
- 0xb9,0x00,0x00,0x00,0xf9,0x06,0x5b,0x3f,0xef,0xd9,0x0b,0x00,0x00,0x20,0x00,
- 0x04,0x08,0x02,0x80,0x00,0x00,0x00,0x80,0x00,0x08,0x00,0x20,0x00,0xc2,0xfe,
- 0xa7,0x5c,0x0e,0xaa,0x00,0x15,0x09,0xfc,0x7f,0x53,0x00,0x04,0x20,0x00,0x00,
- 0x00,0x01,0x80,0x24,0x00,0x00,0x01,0x41,0x02,0x00,0x00,0x00,0x80,0x94,0xf4,
- 0xf3,0xa7,0x7c,0xbb,0x00,0x00,0x00,0x7c,0x4b,0xcf,0x6d,0xba,0xa9,0x01,0x00,
- 0x10,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x80,0x08,0x00,0x00,0x00,0x08,
- 0x80,0x62,0xfe,0x8d,0xb2,0x20,0x0a,0xa1,0x00,0x50,0xf9,0xff,0xf4,0x08,0x01,
- 0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x40,0x00,0x80,0x08,0x11,0x00,
- 0x00,0x92,0xf5,0x6a,0xef,0xfe,0xb7,0x08,0x00,0x40,0xad,0x2f,0xf4,0x7e,0x6f,
- 0xf5,0x05,0x40,0x00,0x08,0x24,0x00,0x00,0x00,0x40,0x00,0x08,0x10,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x2b,0xff,0xb7,0xaa,0x14,0x56,0x48,0x55,0x00,0xf2,0xff,
- 0xac,0x00,0x00,0x00,0x00,0x04,0xdb,0x10,0x00,0x00,0x04,0x40,0xa8,0xc2,0x12,
- 0x00,0x00,0x02,0x40,0x88,0xdb,0xed,0xb5,0xfe,0xbf,0x00,0x00,0x00,0xdd,0x0d,
- 0xff,0x5b,0xfb,0xdb,0x00,0x11,0x00,0x02,0x00,0x20,0x40,0x00,0x08,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x04,0x01,0x10,0x35,0xff,0x2d,0x65,0x81,0x08,0x11,0x00,
- 0x95,0xf9,0xfb,0x2d,0x00,0x00,0x04,0x00,0x41,0x5a,0x40,0xa9,0x55,0x55,0x4c,
- 0x47,0x44,0x04,0x00,0x00,0x10,0x09,0x8a,0x7f,0x5b,0x7f,0xb6,0xbb,0x40,0x00,
- 0x00,0xae,0x7a,0xb2,0xff,0xde,0x6d,0x40,0x00,0x80,0x00,0x00,0x00,0x00,0x00,
- 0x02,0x80,0x80,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0xd0,0xff,0xd5,0x9a,0xa7,
- 0x52,0x02,0x0a,0x28,0x62,0xff,0x4b,0x01,0x80,0x80,0x40,0x00,0x16,0x33,0x24,
- 0x8c,0x50,0xb3,0x41,0xc4,0x00,0x40,0x80,0x00,0x00,0x30,0xdf,0xea,0x2f,0x6f,
- 0xae,0x08,0x00,0x08,0xfd,0xdf,0xfa,0x7e,0xff,0x7e,0x08,0x00,0x08,0x00,0x82,
- 0x04,0x00,0x90,0x00,0x08,0x00,0x00,0x52,0x08,0x91,0x00,0x00,0x84,0xd8,0xff,
- 0x9a,0xed,0x2a,0x25,0x24,0xd1,0x44,0xf1,0xff,0x53,0x81,0x00,0x00,0x10,0x00,
- 0x36,0xf4,0xbd,0xb1,0x40,0xb2,0x45,0x56,0x84,0x10,0x08,0x00,0x80,0x74,0xff,
- 0xfb,0x37,0xfb,0xbf,0x00,0x00,0x00,0xda,0xdf,0xd4,0x5f,0x3f,0x1f,0x02,0x00,
- 0x00,0x40,0x00,0x00,0x12,0x02,0x60,0x06,0x24,0x40,0x00,0x00,0x00,0x00,0x10,
- 0x80,0xca,0xff,0xf5,0xab,0x4b,0x4d,0x45,0x00,0x00,0xc2,0xff,0xb3,0x00,0x08,
- 0x20,0x00,0x00,0x24,0x94,0x06,0xa5,0x66,0xb2,0x9a,0xd4,0x18,0x04,0x20,0x48,
- 0x12,0x80,0x7c,0xfb,0x9e,0x97,0xbe,0x00,0x00,0x00,0xbd,0xad,0x94,0x7b,0xf5,
- 0x8d,0x00,0x00,0x00,0x04,0x08,0x00,0x80,0x00,0x61,0x0c,0x01,0x12,0x00,0x00,
- 0x00,0x00,0x01,0x00,0xca,0x7f,0x7d,0x55,0xbd,0x96,0x10,0x49,0x49,0xd1,0xff,
- 0xb7,0x20,0x00,0x04,0x04,0x00,0xa4,0xbd,0xb4,0x2c,0x65,0xda,0xde,0x92,0x0a,
- 0x00,0x00,0x02,0x00,0xd2,0xfc,0xb3,0xcf,0xdf,0xbe,0x44,0x00,0x00,0xfd,0xb7,
- 0xb3,0x7c,0xbd,0x03,0x00,0x44,0x90,0x00,0x00,0x80,0x00,0x50,0xff,0xff,0x00,
- 0x00,0x00,0x02,0x00,0x10,0x40,0x42,0xe5,0xff,0x6b,0xbb,0x53,0x2b,0xaa,0x80,
- 0x90,0xca,0xbb,0x2f,0x03,0x40,0x00,0x01,0x20,0x10,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xa0,0xf3,0xf5,0xf3,0x7f,0xbe,0x00,0x00,
- 0x10,0xaa,0x2a,0x63,0x43,0xde,0x09,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,
- 0xdf,0xf2,0x01,0x00,0x84,0x00,0x00,0x00,0x00,0x50,0xf4,0x7f,0xd7,0xea,0x96,
- 0xcc,0x3e,0x12,0x04,0xc2,0xff,0x0f,0x01,0x00,0x40,0x00,0x00,0x04,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x42,0x00,0x00,0x14,0xc3,0xca,0xfc,0xac,
- 0xae,0x00,0x00,0x00,0x6d,0x57,0x8f,0xb8,0xf3,0x02,0x40,0x00,0x00,0x88,0x80,
- 0x00,0x20,0xf8,0xbe,0xff,0x9e,0x42,0x00,0x80,0x44,0x00,0x40,0x80,0xf2,0xff,
- 0xbd,0xbe,0xaa,0xb3,0xf4,0xa7,0xf9,0x92,0xff,0x4f,0x05,0x08,0x02,0x80,0x00,
- 0x01,0x00,0x02,0x42,0x82,0x00,0x90,0x80,0x00,0x40,0x00,0x00,0x41,0xd0,0x1e,
- 0x3f,0xe4,0x77,0xbc,0x24,0x00,0x00,0xbc,0x77,0x14,0x0b,0x5d,0x00,0x04,0x00,
- 0x00,0x00,0x10,0x00,0x08,0xdc,0x99,0x93,0x1b,0x00,0x00,0x00,0x00,0x80,0x00,
- 0xa0,0xfb,0x7f,0x6d,0xa9,0x4a,0xaf,0xe6,0x05,0x7e,0xa5,0xff,0xdf,0x02,0x02,
- 0x10,0x00,0x40,0x00,0x05,0x80,0x00,0x20,0x40,0x00,0x10,0x00,0x01,0x00,0x00,
- 0x10,0xa0,0xef,0x8c,0xcb,0x5a,0xbe,0x00,0x00,0x00,0xfd,0xea,0xba,0x74,0x9f,
- 0x88,0x00,0x10,0x49,0x00,0x00,0x42,0x80,0xec,0x9b,0xe3,0x2e,0x10,0x20,0x00,
- 0x00,0x08,0x10,0x08,0xfb,0xdf,0xde,0x5a,0xe3,0xfa,0xcd,0xab,0xe7,0x87,0xfb,
- 0x9f,0x82,0x80,0x00,0x02,0x10,0x40,0x88,0xb0,0x1a,0x50,0xbf,0xbf,0x6f,0x1f,
- 0x00,0x00,0x00,0x00,0xe8,0xbf,0xc0,0x8b,0xbb,0xbc,0x00,0x00,0x10,0xfa,0xad,
- 0x7e,0xa4,0x30,0x80,0x04,0x04,0x00,0x42,0x00,0x10,0xc0,0xfb,0xff,0xdf,0xda,
- 0x03,0x02,0x00,0x00,0x00,0x00,0x42,0xfd,0x77,0x69,0x69,0x88,0x55,0x21,0x8f,
- 0x0b,0xa5,0xff,0x3f,0x06,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x22,0x00,0x22,
- 0x40,0x80,0x04,0x00,0x80,0x20,0x02,0xf2,0x7f,0xeb,0x1b,0x2f,0xbc,0x04,0x00,
- 0x00,0xbe,0xf4,0xae,0x0a,0xd2,0x40,0x80,0x00,0x00,0x00,0x44,0x00,0x82,0x6f,
- 0xbf,0x7a,0xff,0x01,0x00,0x08,0x08,0x00,0x40,0x40,0xfd,0x6f,0x5f,0xcb,0x65,
- 0xff,0xbf,0x57,0xb7,0x25,0xfe,0x3f,0x05,0x30,0x80,0x20,0x02,0x10,0x20,0x80,
- 0x04,0x01,0x15,0x34,0x81,0x02,0x00,0x08,0x00,0x00,0x40,0x7d,0xf6,0x95,0x5f,
- 0xbd,0x40,0x00,0x00,0xf8,0xfe,0xf7,0x43,0xe0,0xc8,0x30,0x00,0x80,0x08,0x00,
- 0x00,0x90,0x9f,0xc7,0xf4,0xe5,0x21,0x08,0x02,0x00,0x00,0x01,0xc0,0xfc,0xd5,
- 0xd0,0x28,0xb2,0xcd,0xc7,0x96,0xfd,0x02,0xff,0x3e,0x05,0x00,0x00,0x02,0x00,
- 0x20,0x80,0x10,0x18,0x90,0x0a,0x50,0x00,0x04,0x08,0x00,0x00,0x00,0x81,0xf2,
- 0xf9,0x18,0x1b,0xb6,0x00,0x00,0x00,0x3f,0xff,0xb6,0x0e,0xb0,0xc0,0x40,0x00,
- 0x22,0x00,0x00,0x04,0x80,0xcd,0x9e,0x32,0xaf,0x02,0x00,0x00,0x01,0x02,0x00,
- 0xa0,0xfc,0x7b,0xd5,0x82,0x45,0x57,0xcd,0x2e,0xbe,0x2b,0xfc,0x7f,0x05,0x00,
- 0x10,0x08,0x80,0x14,0x04,0x01,0x25,0x00,0x12,0x60,0x01,0x15,0x02,0x00,0x00,
- 0x51,0x00,0xc5,0x70,0x15,0x9f,0xbe,0x00,0x00,0x00,0xd8,0x7f,0xb3,0xfd,0xda,
- 0x80,0x31,0x00,0xc0,0x03,0x00,0x00,0xf8,0xf6,0xfc,0x3f,0xdd,0x9d,0x80,0x00,
- 0x00,0x00,0x00,0x82,0xde,0xa5,0x16,0xd0,0x78,0xe0,0x11,0x9d,0x40,0x42,0xfa,
- 0x7f,0x08,0x00,0x00,0x00,0x22,0x02,0x80,0x00,0x48,0x66,0x0a,0x90,0x40,0x04,
- 0x00,0x01,0x78,0x04,0x08,0xd7,0x67,0x59,0x1f,0xbe,0x00,0x00,0x40,0xfa,0x75,
- 0x72,0xb7,0xbb,0x00,0x01,0x10,0xf0,0x83,0x10,0x00,0xb1,0xfc,0xff,0x7b,0x7d,
- 0x0f,0x00,0x00,0x48,0x20,0x24,0xa0,0xfe,0xdb,0xf5,0x93,0x83,0x95,0x26,0x1b,
- 0x69,0xdd,0xfc,0xf7,0x0a,0x10,0x80,0x80,0x00,0x00,0x00,0x22,0x6a,0x56,0x83,
- 0x60,0x10,0x0a,0x00,0x80,0xf8,0x00,0x40,0x09,0xe9,0x15,0x5f,0xb6,0x10,0x00,
- 0x00,0xda,0x3f,0xf3,0x7a,0xf8,0x00,0x00,0x04,0x39,0x0e,0x00,0x22,0xf0,0x6f,
- 0x0b,0xb0,0x27,0x0d,0x04,0x00,0x02,0x00,0x00,0x40,0xff,0x6d,0x05,0xa4,0x75,
- 0xa2,0x00,0x2a,0x21,0x22,0xba,0xfd,0x1a,0x00,0x20,0x24,0x00,0x0c,0x80,0x04,
- 0xd4,0xff,0x3f,0x90,0x00,0x00,0x00,0x00,0x8e,0x03,0x04,0x16,0x86,0x3b,0x0e,
- 0xb6,0x00,0x00,0x08,0x5e,0x27,0x73,0x4d,0xa8,0x08,0x48,0x00,0x00,0x2c,0x80,
- 0x00,0x38,0xf3,0x01,0x80,0xf3,0x0f,0x01,0x00,0x00,0x08,0x00,0x50,0xff,0xf7,
- 0x3e,0x79,0xb9,0x23,0x52,0x15,0x44,0xac,0xf4,0xef,0x14,0x01,0x01,0x00,0x00,
- 0x01,0x40,0x01,0xfc,0x68,0xf9,0x29,0x01,0x84,0x00,0x00,0x02,0x03,0x10,0x04,
- 0xba,0x9d,0x5e,0xbf,0x00,0x00,0x00,0xf9,0x3d,0x6b,0x10,0xf9,0x00,0x00,0x00,
- 0x10,0x0c,0x00,0x00,0xfe,0x67,0x00,0x00,0xaf,0x3a,0x40,0x00,0x00,0x00,0x01,
- 0x70,0xff,0xff,0xf5,0x6e,0xe5,0x54,0x44,0xb5,0xa4,0x2a,0xeb,0x7b,0x15,0x10,
- 0x00,0x08,0x80,0x0a,0x42,0x80,0x3c,0xff,0xcf,0x61,0x01,0x24,0x20,0x08,0x00,
- 0x03,0x80,0x94,0xda,0x35,0x16,0xbb,0x44,0x00,0x00,0x1a,0x3b,0xe2,0x5a,0x2e,
- 0x00,0x00,0x00,0x82,0x07,0x22,0x80,0x9e,0x7f,0x10,0x10,0xfe,0x69,0x00,0x20,
- 0x01,0x00,0x00,0x68,0x7f,0xff,0x5a,0xbb,0xf5,0x09,0x21,0x54,0x02,0x94,0x77,
- 0xdf,0x05,0x00,0x00,0x01,0x10,0x04,0x80,0x83,0xf7,0xbd,0x24,0x5f,0x20,0x00,
- 0x00,0x02,0xc0,0x81,0x00,0x08,0x34,0xbd,0x8e,0xbf,0x00,0x00,0x00,0x7d,0x39,
- 0xeb,0xb1,0x3d,0x80,0x44,0x90,0xc0,0x27,0x00,0x08,0x9e,0x3f,0x00,0x01,0xfc,
- 0x7d,0x00,0x02,0x08,0x12,0x10,0xa9,0xdf,0xff,0xef,0x75,0x75,0x57,0x44,0x25,
- 0xd4,0x5a,0xca,0xf7,0x35,0x00,0x08,0x00,0x80,0x02,0x40,0x8a,0xbb,0xfb,0xfa,
- 0x5e,0x01,0x08,0x00,0x00,0xf0,0x00,0x48,0x32,0x68,0x3f,0xae,0xbb,0x20,0x00,
- 0x00,0xfa,0xa0,0x73,0xde,0x0f,0x10,0x00,0x00,0xf0,0x00,0x00,0x01,0xfc,0x1f,
- 0x7f,0x9e,0xf8,0x17,0x08,0x00,0x00,0x00,0x04,0xa8,0xff,0xfb,0xff,0xdd,0xf5,
- 0x57,0x84,0x58,0x2a,0xda,0xf6,0xff,0x21,0x00,0x02,0x10,0x01,0x4c,0x44,0xf5,
- 0xec,0xd4,0xfb,0x5a,0x80,0x08,0x00,0x40,0x3c,0x00,0x00,0xd0,0xa0,0xba,0xd2,
- 0xbd,0x00,0x00,0x10,0xfd,0x29,0x63,0xad,0x8f,0x00,0x10,0x04,0x30,0x00,0x41,
- 0x40,0xee,0x1f,0x7c,0x3c,0xe8,0xbb,0x40,0x00,0x00,0x00,0x00,0xa8,0xfd,0xdf,
- 0xfd,0xfb,0xaa,0xad,0x18,0x95,0x88,0x7a,0xe9,0xfd,0x29,0x88,0x00,0x04,0x80,
- 0x13,0x40,0x72,0xbf,0x2f,0xdf,0xf6,0x11,0x08,0x08,0x10,0x0c,0x20,0x40,0x70,
- 0x65,0x3e,0x96,0xb7,0x14,0x00,0x00,0xba,0xed,0x75,0xda,0x00,0x04,0x82,0x00,
- 0x18,0x20,0x00,0x80,0xbb,0x07,0x38,0x3c,0xf0,0xef,0x00,0x00,0x00,0x00,0x00,
- 0xa0,0xef,0xef,0xff,0xaf,0x55,0x2b,0x51,0x5a,0xa4,0xfa,0xee,0xff,0x69,0x00,
- 0x40,0x00,0x10,0x04,0x80,0xb4,0xeb,0xfe,0x75,0x59,0x00,0x00,0x00,0x00,0x06,
- 0x08,0x08,0x82,0x83,0x35,0xd7,0xbe,0x00,0x00,0x00,0xed,0xd1,0x73,0x7e,0x01,
- 0x00,0x00,0x00,0x19,0x00,0x00,0x88,0xe7,0x0e,0xbc,0x3c,0x72,0xe6,0x01,0x20,
- 0x01,0x80,0x80,0x84,0xff,0xfe,0x7e,0xa6,0xf6,0x5b,0x26,0x25,0x88,0x7a,0xe9,
- 0xf7,0x29,0x20,0x00,0x00,0x41,0x05,0x40,0x9f,0xb6,0x7b,0xc7,0xf5,0x01,0x00,
- 0x00,0x04,0x06,0x00,0x40,0xa0,0x0e,0xad,0xea,0xb5,0x04,0x00,0x00,0xda,0x8c,
- 0xf9,0x3c,0x04,0x01,0x04,0x40,0xf8,0x0f,0x04,0x02,0x5d,0x0b,0x78,0xbc,0xc0,
- 0xb3,0x00,0x04,0x00,0x10,0x10,0x90,0xff,0xff,0xdf,0x9f,0xab,0x5e,0x14,0x5b,
- 0x52,0xdb,0x7b,0xbf,0x69,0x00,0x00,0x00,0x40,0x11,0x44,0xfd,0xee,0xef,0x3f,
- 0xbb,0x93,0x00,0x80,0x00,0xfe,0x03,0x01,0x04,0x71,0xbe,0xed,0xb6,0x00,0x00,
- 0x00,0xbf,0x39,0xb3,0xdf,0x41,0x90,0x40,0x08,0x00,0x89,0x40,0x00,0x76,0x47,
- 0x3c,0x3c,0xe0,0xbe,0x08,0x01,0x20,0x04,0x04,0x94,0xef,0xad,0xff,0xbf,0xf5,
- 0x59,0x83,0xff,0xaa,0x7a,0xfb,0xff,0x5b,0x04,0x00,0x08,0x40,0x06,0x41,0x27,
- 0xfb,0xde,0xfe,0x66,0x02,0x08,0x11,0x00,0x20,0x04,0x08,0x48,0xe0,0x1d,0xfb,
- 0xbf,0x00,0x00,0x00,0xea,0x28,0xb3,0x6f,0x08,0x00,0x00,0x00,0x40,0x00,0x00,
- 0x00,0x6e,0x07,0x3c,0x3c,0xe0,0xde,0x40,0x00,0x00,0x00,0x01,0x94,0x7b,0xff,
- 0xf7,0xaf,0xf7,0xb7,0xa4,0xdd,0x46,0xdd,0xff,0xff,0x5b,0x00,0x42,0x00,0x49,
- 0x11,0x40,0xf5,0xbf,0x9f,0xdf,0xb7,0x43,0x00,0x00,0x00,0x01,0x00,0x02,0x41,
- 0xe1,0xbb,0xda,0xbd,0x20,0x00,0x20,0xfa,0x9c,0xeb,0xe3,0x00,0x00,0x00,0x02,
- 0x02,0x20,0x08,0x80,0xef,0x07,0xf8,0x07,0xa0,0xa2,0x00,0x00,0x00,0x00,0x00,
- 0xdc,0xff,0xb7,0xfe,0xff,0x6c,0x6d,0x91,0xfe,0xa9,0xba,0xff,0xfd,0x4b,0x10,
- 0x00,0x40,0x80,0x16,0x40,0xaf,0x0c,0x44,0x84,0xf9,0x8d,0x00,0x00,0x40,0x10,
- 0x11,0x40,0x10,0xf4,0xba,0x7d,0xbb,0x00,0x00,0x00,0x7e,0x7a,0xff,0x65,0x00,
- 0x80,0x00,0x40,0x00,0x00,0x00,0xe0,0x67,0x47,0xf8,0x07,0xe0,0xde,0x03,0x01,
- 0x00,0x22,0x00,0x94,0xdf,0xfd,0xfb,0xff,0xef,0xab,0x26,0xbd,0x89,0xdd,0x7f,
- 0xdf,0x57,0x81,0x00,0x04,0x40,0x05,0x10,0xcb,0x46,0x37,0x22,0xef,0x0d,0x00,
- 0x00,0x02,0x00,0x04,0x01,0x83,0x10,0xf7,0xfe,0xb7,0x08,0x00,0x00,0xd9,0x54,
- 0xd5,0xb0,0x20,0x02,0x10,0x00,0x00,0x04,0x82,0x04,0x7d,0x0f,0x3a,0xbc,0xa8,
- 0x96,0x10,0x00,0x84,0x00,0x20,0xdd,0x77,0xdf,0xae,0xef,0xd5,0xb5,0x11,0x01,
- 0x52,0xfe,0xdf,0xff,0x53,0x20,0x10,0x01,0xa0,0x92,0xc0,0x3d,0x47,0xfa,0x05,
- 0xb6,0xa6,0x90,0x40,0x00,0x00,0x01,0x08,0x1f,0xed,0xb5,0xff,0xbe,0x00,0x00,
- 0x00,0xfa,0x32,0xbb,0x92,0x04,0x00,0x00,0x02,0x40,0x00,0x20,0x00,0xfd,0x07,
- 0x38,0x3c,0xe0,0xbe,0x00,0x00,0x01,0x00,0x04,0xdc,0xfd,0xff,0xf7,0xdd,0x55,
- 0x6f,0x64,0x52,0x88,0xd5,0xfe,0xdb,0x57,0x10,0x00,0x80,0x88,0x14,0xc0,0xcf,
- 0x93,0xff,0x4f,0xee,0x1e,0x00,0x00,0x00,0x40,0x00,0x00,0x2d,0xa9,0xd7,0x6b,
- 0xbb,0x00,0x00,0x40,0xfe,0xd4,0x6a,0x19,0x00,0x00,0x02,0x00,0x10,0x80,0x00,
- 0x00,0x7e,0x07,0x78,0x78,0xe0,0xbe,0x88,0x00,0x00,0x04,0x00,0xea,0xff,0xff,
- 0xdf,0xbe,0xef,0x5f,0x8a,0x04,0x56,0xfd,0xf7,0xff,0x17,0x00,0x00,0x00,0x20,
- 0x05,0x80,0xaf,0xc7,0x62,0x30,0xfa,0xab,0x00,0x08,0x00,0x00,0x40,0x00,0xff,
- 0x70,0x2f,0x8f,0xb5,0x00,0x00,0x04,0xda,0xaa,0x7e,0x9a,0x00,0x00,0x00,0x41,
- 0x04,0x00,0x00,0x00,0xfc,0x0f,0x3a,0x78,0xc0,0xbf,0x00,0x10,0x00,0x40,0x08,
- 0xda,0xff,0xb7,0xfd,0xd7,0xfb,0xd4,0x24,0x89,0x28,0xbe,0x7f,0xbd,0xd7,0x00,
- 0x00,0x04,0x80,0x12,0xc0,0xaa,0x47,0x6e,0x12,0xde,0x1d,0x00,0x00,0x00,0x08,
- 0x08,0x84,0xac,0x81,0x7b,0x87,0xbf,0x20,0x00,0x00,0xfb,0x6d,0xab,0x7c,0x00,
- 0x20,0x00,0x10,0x00,0x44,0x08,0x84,0xef,0x0b,0x78,0x78,0xf2,0xf7,0x01,0x00,
- 0x80,0x00,0x00,0xea,0xbf,0xff,0xef,0xfd,0x56,0x57,0xed,0xff,0x5f,0xfa,0xff,
- 0xf7,0x06,0x20,0x02,0x81,0x20,0x15,0xc0,0xaa,0xa5,0x35,0xbc,0xde,0xb2,0x88,
- 0x00,0x20,0x00,0x00,0x00,0x7b,0xf5,0xbf,0xf7,0xbf,0x08,0x00,0x00,0xba,0xb1,
- 0x3d,0x8d,0x80,0x08,0x00,0x00,0x00,0x00,0x40,0x00,0xfa,0x4f,0x3c,0x7c,0xf0,
- 0xf7,0x08,0x02,0x00,0x10,0x80,0xea,0xef,0xff,0x7b,0xaf,0xff,0xaf,0x09,0x40,
- 0x02,0xff,0xdd,0xfe,0x97,0x00,0x40,0x00,0x80,0x14,0x68,0xdf,0x67,0x6d,0x4a,
- 0x36,0x77,0x00,0x40,0x00,0x02,0x00,0x01,0x71,0xe3,0xea,0x8b,0xb5,0x00,0x00,
- 0x00,0xfa,0x7b,0x35,0x5e,0x04,0x00,0x40,0x00,0x00,0x00,0x00,0x01,0xde,0x1f,
- 0x38,0x3c,0xe8,0x73,0x80,0x80,0x00,0x02,0x00,0xea,0xff,0xfd,0xff,0xdf,0xfb,
- 0x5b,0x13,0x08,0x28,0xdd,0xff,0xd7,0x87,0x10,0x10,0x00,0x90,0x05,0xc2,0xdd,
- 0x56,0x7d,0x6e,0xfe,0x35,0x00,0x00,0x00,0x40,0x42,0x00,0xe6,0x66,0xf7,0x7e,
- 0xb7,0x00,0x00,0x00,0xda,0xa7,0xad,0x9f,0x00,0x00,0x04,0x04,0x41,0x00,0x08,
- 0x00,0xfe,0x39,0x7f,0x0f,0xf0,0x1b,0x00,0x00,0x80,0x00,0x22,0xea,0x7e,0xdf,
- 0xee,0xb6,0x5e,0xbf,0xd4,0x22,0x49,0xff,0xf7,0xfd,0xa6,0x00,0x02,0x80,0xa4,
- 0x12,0x40,0xf7,0x6b,0xd9,0x59,0xbe,0x57,0x10,0x04,0x00,0x00,0x10,0x10,0x00,
- 0x97,0xbd,0xdf,0xbb,0x00,0x00,0x00,0xfa,0x37,0x4b,0xcf,0x40,0x00,0x01,0x00,
- 0x04,0x48,0x42,0x10,0xbe,0x2e,0xff,0x03,0x3e,0x1f,0x08,0x00,0x04,0x00,0x00,
- 0xea,0xf7,0xff,0xbb,0xdf,0xf6,0x6d,0x25,0x4b,0x12,0xed,0xbd,0xff,0x87,0x00,
- 0x00,0x00,0x80,0x14,0x40,0xdf,0xc7,0xbe,0x35,0x36,0xb5,0x04,0x00,0x80,0x08,
- 0x00,0x00,0x95,0x8b,0x7f,0xff,0xbf,0x20,0x00,0x40,0xfa,0x4e,0x8b,0x5f,0x00,
- 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0x7b,0x00,0x40,0xee,0x6d,0x00,0x00,
- 0x00,0x00,0x00,0xea,0xff,0xdf,0xff,0xaf,0xbe,0x5f,0xd5,0xd4,0x44,0xff,0xff,
- 0xb7,0xa7,0x80,0x00,0x10,0x20,0x93,0x70,0x77,0x03,0x77,0x27,0xfe,0x76,0x80,
- 0x40,0x20,0x00,0x00,0x02,0x4c,0xbd,0xfe,0x7b,0xbd,0x00,0x00,0x10,0xfe,0xef,
- 0xcd,0x5b,0x10,0x00,0x00,0x40,0x00,0x02,0x00,0x00,0xfe,0xfb,0x00,0x00,0xc5,
- 0x7f,0x00,0x20,0x00,0x04,0x04,0xaa,0xbf,0xf7,0x5a,0xbd,0xed,0xfb,0x2a,0xa9,
- 0x55,0xff,0xee,0xfe,0x87,0x08,0x00,0x00,0x80,0x14,0xc0,0xdb,0x47,0xfb,0x0e,
- 0xae,0x7d,0x00,0x00,0x08,0x00,0x00,0x00,0x48,0x5d,0xb7,0x95,0xbf,0x00,0x00,
- 0x00,0xda,0x95,0xf5,0x4c,0x00,0x00,0x00,0x10,0x04,0x00,0x00,0x41,0xf8,0xcf,
- 0x01,0xc0,0xdb,0x0f,0x00,0x01,0x01,0x81,0x00,0xea,0xed,0xfd,0xef,0x6f,0xfb,
- 0xae,0xa5,0x50,0xb4,0xdf,0xff,0xff,0x87,0x00,0x00,0x00,0x40,0x13,0x48,0xff,
- 0xc5,0xde,0xbd,0x7e,0x17,0x00,0x00,0x00,0x40,0x20,0x00,0x30,0xf5,0xef,0xea,
- 0xb2,0x10,0x00,0x00,0xfa,0xbf,0xfd,0xb9,0x00,0x21,0x80,0x00,0x00,0x00,0x21,
- 0x08,0xf0,0xed,0x07,0x60,0xf9,0x07,0x08,0x00,0x40,0x00,0x40,0xea,0xff,0xbf,
- 0xba,0x5f,0xdd,0xff,0x4d,0x85,0xca,0xff,0xef,0xdd,0xa7,0x00,0x00,0x04,0x41,
- 0x15,0xc0,0xdf,0xf3,0xee,0x2b,0xbe,0x17,0x00,0x10,0x00,0x04,0x00,0x48,0xb0,
- 0x7c,0xbd,0xfd,0xbf,0x00,0x00,0x00,0xfa,0xa9,0x1d,0x4c,0x10,0x00,0x12,0x00,
- 0x00,0x21,0x00,0x00,0x50,0xfd,0xfe,0xff,0x56,0x0e,0x40,0x10,0x10,0x00,0x00,
- 0xea,0xff,0xdd,0xef,0x7f,0x6b,0xfb,0x2a,0x5a,0xf2,0xb7,0x7d,0xf7,0x87,0x00,
- 0x81,0x40,0x50,0x05,0xf0,0xde,0x3e,0x33,0xef,0xf6,0x35,0x02,0x04,0x00,0x00,
- 0x84,0x00,0x84,0xd5,0xd7,0x03,0xba,0x20,0x00,0x00,0x5a,0x2f,0x6d,0x5a,0x04,
- 0x00,0x00,0x10,0x40,0x00,0x00,0x80,0xf8,0xf7,0xfa,0xdf,0x9c,0x1d,0x01,0x00,
- 0x00,0x00,0x01,0x62,0x7b,0xaf,0xbd,0xdf,0xec,0xfe,0x7f,0x45,0xfa,0xfd,0xdf,
- 0x7f,0x97,0x00,0x20,0x00,0x40,0x11,0x82,0x87,0xcf,0xa8,0xac,0x5f,0x11,0x90,
- 0x00,0x02,0x10,0x00,0x00,0x40,0xee,0xdf,0xc9,0xbd,0x00,0x00,0x00,0xfe,0xdd,
- 0x3e,0x58,0x01,0x08,0x00,0x04,0x09,0x00,0x80,0x04,0x6a,0xed,0x78,0xb7,0xbe,
- 0x43,0x10,0x00,0x01,0x20,0x00,0xca,0xff,0xbf,0xff,0x7f,0xdb,0xbf,0x6e,0x55,
- 0xbd,0xef,0xff,0xfb,0xa7,0x88,0x00,0x00,0x80,0x96,0xc0,0xba,0xb7,0x6e,0x7b,
- 0x7b,0x8b,0x08,0x00,0x20,0x01,0x00,0x08,0x90,0xd8,0xee,0x74,0xb7,0x08,0x00,
- 0x00,0x5a,0x73,0xbc,0x5a,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x80,0xcf,
- 0x7b,0xf3,0x7f,0x01,0x00,0x40,0x00,0x00,0x40,0xea,0xff,0xfb,0xbf,0xbd,0x6e,
- 0xfb,0xfb,0xcb,0xfa,0xba,0xfb,0xde,0x97,0x00,0x00,0x00,0x40,0x11,0xc0,0xf7,
- 0x3f,0xc9,0xce,0xef,0x1b,0x08,0x80,0x00,0x00,0x41,0x82,0x00,0x61,0x77,0xa5,
- 0x9a,0x00,0x00,0x00,0xde,0x73,0x2d,0x5d,0x00,0x40,0x00,0x00,0x00,0x48,0x00,
- 0x40,0x80,0x4f,0x7f,0xd7,0xe6,0x09,0x00,0x10,0x00,0x01,0x10,0xca,0xbf,0xbf,
- 0xef,0xff,0xbd,0xef,0xdf,0x7e,0xef,0xff,0xaf,0xff,0x86,0x00,0x00,0x10,0x04,
- 0x56,0xd0,0x7b,0x2d,0xb8,0xe5,0x7e,0x3f,0x00,0x08,0x00,0x04,0x10,0x00,0x44,
- 0x60,0xbd,0x10,0xa5,0x00,0x00,0x80,0x5a,0x99,0x3e,0x4c,0x00,0x04,0x40,0x20,
- 0x00,0x01,0x80,0x00,0x80,0xff,0xf5,0x2f,0xd9,0x01,0x00,0x00,0x00,0x20,0x00,
- 0xda,0xff,0xfb,0xfe,0xff,0xd2,0xbc,0xff,0xfb,0x7e,0xeb,0xfe,0xdb,0x57,0x40,
- 0x08,0x00,0x00,0x05,0x84,0x4d,0xcf,0xff,0x13,0x53,0x05,0x04,0x02,0x20,0x21,
- 0x00,0x00,0x00,0xc1,0x52,0x40,0xb9,0x40,0x00,0x00,0xda,0x6f,0x3d,0x5e,0x80,
- 0x00,0x00,0x04,0x20,0x00,0x00,0x00,0xa0,0xbc,0x75,0x6e,0x2d,0x00,0x00,0x02,
- 0x20,0x00,0x00,0xd8,0xfb,0xbf,0x5f,0x7f,0xed,0xfb,0xfa,0x3f,0xff,0xbf,0x77,
- 0x7f,0x13,0x00,0x00,0x00,0x01,0x15,0x40,0xcb,0x6f,0x82,0x12,0x77,0x05,0x8c,
- 0x00,0x00,0x00,0x02,0x08,0x08,0xf0,0xd7,0x27,0xbc,0x00,0x00,0x00,0xfa,0xdf,
- 0x96,0x5c,0x20,0x00,0x08,0x00,0x04,0x00,0x00,0x00,0x00,0xf8,0xf7,0xa6,0x1b,
- 0x24,0x40,0x00,0x00,0x08,0x22,0xda,0xff,0xf7,0xff,0xdf,0xab,0xdd,0xdf,0x6f,
- 0x6f,0xf7,0xff,0xed,0x57,0x00,0x00,0x02,0x40,0x12,0xd0,0xbb,0xde,0xab,0xce,
- 0xbb,0x0d,0x20,0x00,0x20,0x00,0x00,0x80,0x42,0xe5,0xfc,0xff,0xbf,0x00,0x00,
- 0x00,0x7a,0xbf,0x0d,0xce,0x00,0x00,0x00,0x00,0x00,0x20,0x10,0x42,0x08,0xf8,
- 0xff,0xfc,0x1f,0x00,0x02,0x00,0x08,0x00,0x00,0x9c,0x7f,0xef,0xee,0xf7,0x77,
- 0x7f,0xfb,0x1a,0xfb,0xfd,0xed,0xbf,0x53,0x10,0x00,0x00,0x90,0x02,0x82,0xbe,
- 0x3a,0xa0,0xc1,0xf0,0x0f,0x08,0x00,0x09,0x00,0x00,0x01,0x00,0xe0,0xbb,0xf7,
- 0xbf,0x00,0x00,0x00,0xba,0x6f,0xab,0x5d,0x00,0x20,0x00,0x01,0x20,0x04,0x04,
- 0x00,0x00,0x00,0xfb,0xcf,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xd4,0xf7,0xbf,
- 0x7f,0xff,0xab,0xf6,0xb7,0x17,0xff,0xdf,0x7f,0xff,0x5b,0x00,0x00,0x40,0x00,
- 0x14,0x40,0xc7,0xb7,0xa5,0xfe,0x5e,0x02,0x06,0x00,0x00,0x80,0x10,0x00,0x40,
- 0x62,0x5e,0xdf,0xaf,0x10,0x00,0x00,0xfa,0x87,0x83,0x5f,0x00,0x00,0x02,0x10,
- 0x01,0x00,0x00,0x00,0x00,0x00,0xf1,0xcf,0x00,0x00,0x00,0x80,0x00,0x00,0x20,
- 0x94,0xfd,0xda,0xf7,0xff,0xdf,0xed,0xfe,0x05,0x7f,0xfb,0xde,0xfb,0x53,0x04,
- 0x22,0x00,0x00,0x09,0x40,0xed,0xef,0xcf,0x37,0xff,0x01,0x09,0x00,0x00,0x02,
- 0x00,0x40,0x20,0xe5,0xbe,0xbd,0xba,0x00,0x00,0x00,0x5a,0x82,0xa1,0x5e,0x00,
- 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x61,0x0e,0x00,0x10,0x00,0x00,
- 0x00,0x01,0x09,0x94,0xbf,0xff,0xdb,0xef,0xd7,0xbf,0xff,0x83,0xff,0xbf,0xf7,
- 0xff,0x69,0x00,0x00,0x00,0x00,0x02,0x80,0xde,0xde,0x9b,0x9e,0xdb,0x03,0x0d,
- 0x40,0x40,0x08,0x0f,0x11,0x00,0x70,0xf7,0xab,0xad,0x00,0x00,0x00,0x7a,0xe9,
- 0x4a,0x4f,0x04,0x00,0x20,0x00,0x84,0x08,0x00,0x11,0x01,0x00,0x20,0x00,0x00,
- 0x05,0x00,0x00,0x40,0x40,0x00,0x90,0xf7,0xd7,0xfe,0xff,0xaf,0xea,0xb6,0x20,
- 0xbf,0xed,0xff,0xdf,0x69,0x00,0x00,0x02,0x04,0x08,0x91,0xb0,0x6f,0xfe,0xf3,
- 0x7f,0x00,0x00,0x10,0x00,0x00,0x01,0x00,0x08,0xa0,0x9b,0xde,0xba,0x00,0x00,
- 0x00,0xda,0x63,0xe2,0x5f,0x40,0x08,0x01,0x08,0x00,0x02,0x04,0x00,0x20,0x80,
- 0x04,0x00,0x00,0x00,0x40,0x40,0x08,0x04,0x00,0x90,0xbe,0xff,0xff,0xff,0xbf,
- 0xff,0x5f,0x04,0xfe,0xff,0xfb,0xf6,0x69,0x00,0x00,0x20,0x00,0x42,0x00,0xb0,
- 0xbb,0x51,0x7d,0x6b,0x41,0x8e,0x04,0x00,0x89,0x01,0x00,0x40,0xea,0x77,0xb5,
- 0xbf,0x20,0x00,0x80,0xfa,0xf9,0xff,0x5f,0x00,0x00,0x00,0x40,0x88,0x00,0x40,
- 0x00,0x00,0x22,0x00,0x10,0x10,0x00,0x11,0x00,0x00,0x00,0x00,0xa0,0xef,0x6d,
- 0xb5,0xfa,0xff,0x6a,0x17,0xa0,0xee,0x7b,0xff,0xff,0x29,0x00,0x01,0x00,0x80,
- 0x04,0x40,0xc9,0xfe,0xfa,0xff,0x7b,0x81,0x04,0x00,0x24,0x80,0x40,0x4b,0x01,
- 0xe0,0xb7,0x6f,0xaf,0x08,0x00,0x00,0xfa,0x62,0xb5,0x4f,0x01,0x41,0x00,0x01,
- 0x00,0x20,0x00,0x04,0x04,0x00,0x00,0x00,0x02,0x40,0x00,0x10,0x00,0x00,0x00,
- 0xa9,0xff,0xfb,0xef,0xdf,0xbf,0xbd,0x2d,0x00,0x7b,0xdf,0xdf,0xff,0x21,0x08,
- 0x00,0x00,0x02,0x20,0x90,0xc0,0xfd,0x46,0xea,0x18,0x81,0x01,0x00,0x00,0x08,
- 0x51,0xab,0x88,0xf0,0xdf,0xbb,0xbc,0x00,0x00,0x00,0xba,0x2e,0xee,0x5b,0x10,
- 0x10,0x14,0x10,0x02,0x04,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x00,
- 0x00,0x00,0x00,0x28,0x77,0xdf,0xf7,0xff,0x3b,0x56,0x00,0xa1,0xcf,0xfb,0x7b,
- 0xff,0x25,0x00,0x00,0x04,0x00,0x10,0x20,0xa0,0xd7,0xde,0x3b,0x6f,0x41,0x06,
- 0x00,0x80,0x00,0x47,0x93,0x00,0x42,0x7f,0xff,0xbf,0x08,0x00,0x00,0xfa,0xd6,
- 0xfb,0x5d,0x00,0x00,0x00,0x00,0x20,0x01,0x00,0x00,0x00,0x00,0x42,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x10,0x40,0x68,0xff,0x7f,0xfe,0x6f,0xff,0xbf,0x11,0x80,
- 0xdf,0xde,0xfe,0xfb,0x14,0x02,0x00,0x01,0x00,0x20,0x14,0xa4,0xae,0x7b,0x3d,
- 0x1b,0x01,0x20,0x04,0x01,0x00,0x00,0x00,0x00,0xe0,0x7e,0xf7,0xba,0x00,0x00,
- 0x20,0x3a,0x7f,0xfb,0x4e,0x00,0x00,0x80,0x00,0x08,0x00,0x02,0x40,0x40,0x04,
- 0x00,0x84,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x69,0xff,0xef,0xdb,0xfe,0x3f,
- 0xa5,0x00,0xe9,0xdf,0xf7,0xef,0xdf,0x16,0x01,0x40,0x40,0x40,0x00,0x03,0xa8,
- 0xfe,0xaa,0xd2,0x55,0x2a,0x09,0x20,0x00,0x08,0x00,0x00,0x20,0xb8,0xb5,0xbf,
- 0xb7,0x00,0x00,0x00,0xba,0xf7,0xbf,0x5d,0x00,0x00,0x01,0x00,0x00,0x82,0x80,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x40,0x00,0x80,0x52,0x7f,0x77,
- 0xff,0xff,0xbe,0x2d,0x40,0xd0,0xdd,0x7a,0x7f,0xf7,0x92,0x00,0x10,0x00,0x10,
- 0x00,0x00,0x00,0xc0,0xff,0x3f,0x00,0x00,0x00,0x00,0x84,0x00,0x00,0x00,0x04,
- 0x66,0xc2,0xef,0xbd,0x40,0x00,0x00,0x7a,0xbf,0xdf,0x4e,0x00,0x09,0x00,0x08,
- 0x01,0x20,0x20,0x10,0x08,0x40,0x04,0x00,0x80,0x00,0x00,0x04,0x04,0x00,0x84,
- 0x59,0xef,0xdd,0xfb,0xef,0xbf,0x2a,0x2a,0xd4,0xff,0xdf,0xff,0xff,0x9e,0x00,
- 0x01,0x00,0x04,0x88,0x00,0x01,0x40,0xf6,0x33,0x00,0x00,0x00,0x00,0x20,0x90,
- 0x40,0x04,0x01,0xce,0xef,0xf6,0xbb,0x00,0x00,0x00,0xba,0xef,0xab,0x7d,0x04,
- 0x80,0x10,0x40,0xf8,0x00,0x0c,0x10,0x78,0x10,0x41,0x12,0x37,0x34,0x68,0x00,
- 0x21,0x00,0x80,0x06,0xfe,0xbf,0x7f,0xfd,0xff,0xaa,0x02,0xf0,0x7f,0xf7,0x7b,
- 0xff,0x58,0x41,0x00,0x00,0x00,0x02,0x40,0x00,0x00,0x22,0x00,0x10,0x00,0x00,
- 0x01,0x04,0x04,0x00,0x02,0x00,0xe5,0xb9,0xff,0xb7,0x10,0x00,0x00,0x7a,0xff,
- 0xfe,0x82,0x43,0x00,0x80,0x00,0xd0,0x01,0x1e,0x7c,0x58,0xc0,0x01,0x07,0x6f,
- 0x28,0xd0,0x01,0x21,0x00,0x20,0x8b,0xfe,0xf7,0xfa,0xdf,0xbf,0xaa,0x00,0xe8,
- 0xbd,0xfc,0xde,0x6b,0x9a,0x01,0x00,0x00,0x00,0x80,0x10,0x10,0x00,0x20,0x00,
- 0x00,0x00,0x02,0x00,0x00,0x00,0x10,0x80,0x40,0x81,0xff,0x6f,0xbd,0x00,0x00,
- 0x00,0xba,0xbf,0x1f,0x04,0x08,0x20,0x00,0x00,0x08,0x03,0x21,0x4c,0x20,0x60,
- 0x86,0x0c,0x01,0xcc,0x98,0x21,0x21,0x00,0x80,0xba,0xfc,0xef,0xef,0xff,0x3f,
- 0x44,0x00,0x75,0xff,0xcb,0xff,0x7f,0xe9,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x04,0x80,0x00,0x00,0x01,0x00,0x04,0x01,0x28,0x27,0xbd,0xbe,
- 0xb5,0x00,0x00,0x00,0xfa,0xfa,0xaf,0x95,0x30,0x08,0x02,0x08,0x08,0x03,0x23,
- 0x44,0x40,0x22,0x86,0x08,0x01,0xc4,0x18,0x01,0x21,0x00,0x42,0xac,0xfc,0xbb,
- 0xff,0xbf,0x7d,0xa8,0x40,0x52,0xbd,0xf2,0xff,0x7f,0xac,0x05,0x00,0x84,0x40,
- 0x20,0x00,0x00,0x80,0x02,0x00,0x00,0x12,0x00,0x48,0x88,0x10,0x00,0x00,0x04,
- 0x03,0xed,0xdd,0xbd,0x00,0x00,0x00,0x7a,0x7d,0x91,0x5e,0xc4,0x00,0x08,0x80,
- 0x18,0x21,0x30,0x4d,0x60,0x00,0x84,0x08,0x01,0xc0,0x88,0x01,0x29,0x10,0xc0,
- 0xb9,0x7c,0xef,0xf7,0x6f,0x7f,0x01,0x06,0x74,0xbd,0x4e,0xff,0x3f,0xed,0x07,
- 0x88,0x00,0x10,0x00,0x02,0x00,0x20,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x40,0x80,0x08,0xee,0xb2,0x7b,0xb6,0x00,0x00,0x00,0xfa,0xed,0x6b,0xc7,0x01,
- 0x00,0x20,0x20,0x90,0x03,0x18,0x54,0x60,0x00,0x86,0x0d,0x1d,0x50,0xf0,0x00,
- 0x3f,0x04,0x40,0x69,0xfc,0xff,0xbb,0xfa,0xf5,0x22,0x43,0xc8,0x7e,0xdb,0xf4,
- 0x3f,0xa7,0x45,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x80,0x40,0x00,0x00,
- 0x01,0x00,0x08,0x01,0x00,0x2c,0x6b,0xf1,0x56,0x3f,0x20,0x00,0x10,0xfa,0xba,
- 0xb5,0x1e,0x97,0x82,0x08,0x01,0x78,0x01,0x1c,0x5c,0x60,0xc0,0x81,0x0b,0x23,
- 0x70,0x98,0x01,0x21,0x00,0x88,0x49,0xfd,0xfd,0xff,0xff,0xfd,0x41,0x2e,0x81,
- 0xf6,0xae,0x4f,0xaf,0xd6,0x25,0x00,0x20,0x04,0x02,0x20,0x00,0x01,0x00,0x10,
- 0x10,0x00,0x00,0x00,0x40,0x00,0x20,0x80,0xb0,0xff,0x0d,0x95,0xbf,0x00,0x00,
- 0x00,0xba,0x53,0xfd,0xe5,0x7f,0x08,0x00,0x00,0x08,0x03,0x20,0xc4,0x60,0x60,
- 0x40,0x18,0x60,0xc0,0x18,0x09,0x21,0x01,0xc1,0x1b,0x73,0x77,0xe7,0xbb,0xef,
- 0x57,0x25,0x24,0xf8,0xd5,0xbd,0x9f,0xa2,0x09,0x00,0x08,0x41,0x20,0x08,0x08,
- 0x00,0x08,0x00,0x00,0x20,0x21,0x10,0x04,0x00,0x24,0x60,0xe7,0x85,0x47,0xbc,
- 0xba,0x08,0x00,0x00,0xda,0xa6,0x59,0x00,0xfe,0x08,0x05,0x10,0x09,0x03,0x20,
- 0x86,0x20,0x20,0x80,0x10,0x60,0xc0,0x08,0x03,0x21,0x00,0xd0,0xcb,0xfa,0xdf,
- 0xfb,0xfe,0xfb,0x23,0x4b,0x08,0xea,0x5d,0xef,0xda,0xea,0x15,0x02,0x00,0x10,
- 0x00,0x01,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x42,0x50,0x10,0xe3,
- 0x00,0xce,0xa8,0xb7,0x00,0x00,0x00,0xba,0x57,0x37,0xde,0xd0,0x93,0x80,0x00,
- 0x58,0x43,0x33,0x44,0x60,0x28,0x80,0x08,0x30,0xc6,0xd8,0x41,0x21,0x00,0x40,
- 0xa7,0xb2,0xff,0xdf,0xf7,0xb7,0x47,0x1e,0x80,0xf5,0xfd,0xbb,0x4f,0x4d,0x35,
- 0x40,0x08,0x00,0x04,0x00,0x08,0x00,0x00,0x82,0x00,0x04,0x00,0x40,0x20,0x00,
- 0x02,0x92,0x33,0xfe,0x80,0xdb,0xbd,0x00,0x00,0x00,0xea,0xf5,0x8f,0x55,0xe1,
- 0x07,0x00,0x00,0xb8,0x81,0x2f,0x7c,0xf8,0xd3,0x87,0x0d,0x1f,0xdc,0x78,0x01,
- 0x21,0x00,0x50,0x27,0xf4,0xeb,0xfd,0xef,0xff,0xc7,0x0a,0x51,0xee,0xaf,0xfe,
- 0x0a,0xc1,0x06,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
- 0x08,0x00,0x20,0x28,0xd8,0x0b,0xff,0xf3,0xb3,0x2e,0x00,0x00,0x00,0xfa,0xc3,
- 0x47,0xed,0xcf,0x67,0x90,0x20,0x20,0x00,0x08,0x10,0x08,0xa0,0x04,0x07,0x05,
- 0x10,0x00,0x00,0x00,0x20,0xa8,0xf5,0xe5,0xbb,0xfb,0xfb,0xfb,0x9f,0x1a,0xa4,
- 0xd0,0xbf,0xeb,0xa7,0xd7,0x11,0x00,0x40,0x10,0x41,0x00,0x00,0x02,0x80,0x00,
- 0x00,0x80,0x00,0x00,0x00,0x08,0x21,0xe0,0xc3,0x13,0xcb,0xe7,0xb5,0x20,0x00,
- 0x00,0xfa,0x65,0x71,0xab,0x95,0x5e,0x02,0x04,0x02,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x01,0x22,0xa5,0xcd,0xfe,0x7f,0xbf,0xef,
- 0x5e,0x2a,0x69,0xda,0x7b,0xbd,0xb3,0xd5,0x04,0x01,0x00,0x04,0x00,0x20,0x80,
- 0x00,0x10,0x10,0x08,0x00,0x04,0x42,0x90,0x00,0x14,0xe4,0xb3,0xee,0xcd,0xaf,
- 0xbf,0x00,0x00,0x00,0x7a,0x13,0x91,0x7e,0x29,0x9f,0x20,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x57,0xcb,0xf7,
- 0xd7,0xef,0xbf,0x8f,0x3a,0x85,0xa2,0xbb,0xdf,0xd3,0xd7,0x4c,0x00,0x08,0x00,
- 0x00,0x00,0x00,0x40,0x00,0x00,0x40,0x10,0x80,0x00,0x02,0x42,0x02,0x72,0x59,
- 0x7f,0x3b,0x9d,0x37,0x00,0x00,0x80,0xea,0xf8,0xfc,0x04,0x35,0xba,0x22,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x40,
- 0x6e,0xc2,0xbf,0xfc,0xf5,0xfb,0x2f,0x6a,0xad,0xa9,0xeb,0xf6,0xd3,0x76,0x15,
- 0x20,0x40,0x80,0x10,0x01,0x02,0x00,0x00,0x00,0x01,0x04,0x00,0x20,0x00,0x00,
- 0x0c,0xfa,0xdc,0x81,0x3a,0x97,0xb7,0x10,0x00,0x00,0xda,0xf9,0xa4,0x03,0xef,
- 0x6e,0x01,0x40,0x04,0x08,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x11,
- 0x04,0x20,0x88,0xd8,0x93,0xf7,0x6b,0xef,0xd7,0x9f,0xad,0x12,0x85,0xf6,0xbd,
- 0xc9,0xb7,0x02,0x08,0xfa,0xff,0x0e,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,
- 0x00,0x91,0x88,0x10,0xbc,0xb8,0x81,0x7d,0xb8,0xba,0x00,0x00,0x00,0xba,0x7c,
- 0x56,0x80,0xdb,0x6c,0x00,0x15,0x00,0x81,0xe0,0x00,0x01,0x14,0x00,0x08,0x40,
- 0x10,0x10,0x00,0x80,0x08,0x44,0x7f,0x2e,0xfd,0xff,0xbf,0xff,0x5f,0x35,0x50,
- 0xa5,0x6e,0xff,0x64,0xd7,0x4b,0x04,0xf8,0xce,0x0e,0x00,0x10,0x00,0x00,0x04,
- 0x00,0x40,0x00,0x10,0x00,0x00,0x0d,0x7d,0xe6,0x80,0xdb,0x3c,0x33,0x04,0x00,
- 0x00,0xea,0x5c,0x6e,0x00,0x6f,0x79,0x00,0x00,0x40,0x00,0x18,0x10,0xc0,0x3f,
- 0x04,0x80,0x88,0x04,0x04,0x00,0x00,0x80,0x82,0xd4,0x2a,0xff,0xdf,0xf7,0xfe,
- 0xbf,0xa6,0x6a,0xca,0xff,0xb7,0xf4,0xbf,0xaa,0x93,0x68,0x5a,0x28,0x01,0x00,
- 0x00,0x40,0x00,0x08,0x00,0x12,0x04,0x0a,0x42,0x02,0x6d,0x3d,0x80,0xbf,0x5c,
- 0xbb,0x00,0x00,0x00,0xba,0x3e,0xfd,0x80,0xfd,0xe8,0x13,0x00,0x02,0x00,0x04,
- 0x0c,0x30,0x01,0xc0,0x00,0xe0,0x03,0xc1,0x87,0x00,0x80,0x7d,0xfa,0xcd,0xee,
- 0xf6,0xde,0xef,0xbe,0xde,0x06,0x51,0xcf,0x7e,0xb2,0xca,0x7a,0x04,0x00,0x00,
- 0x00,0x08,0x00,0x78,0x00,0x00,0x80,0x19,0x00,0x00,0xc1,0x20,0x85,0x3e,0x7b,
- 0x80,0xb5,0x79,0x3e,0x10,0x00,0x00,0x7a,0x3e,0x7b,0x81,0xdb,0xf9,0x02,0x10,
- 0x2c,0x00,0x26,0x00,0x90,0x00,0xe0,0x00,0xe0,0x8e,0xc0,0x0d,0x00,0x64,0xab,
- 0xe2,0xdf,0xfe,0xff,0x7f,0xff,0x7f,0xa9,0xac,0xc8,0xfd,0x7b,0xbb,0xf7,0x4e,
- 0x05,0x40,0xb3,0x05,0x10,0x80,0x44,0x01,0x00,0x01,0x09,0x60,0x00,0x10,0x48,
- 0x83,0x2e,0xd7,0x80,0xef,0x69,0xbe,0x00,0x00,0x00,0x7a,0x16,0xb5,0x91,0xb5,
- 0xda,0x01,0x01,0x7f,0x20,0x90,0x00,0x38,0x11,0x60,0xa0,0x42,0x0a,0x42,0x00,
- 0x04,0x81,0xfc,0x0f,0x3e,0xdd,0x6d,0xef,0x5f,0xff,0xae,0x22,0x42,0xef,0x3f,
- 0xf9,0xc6,0x17,0x01,0x40,0x8d,0x41,0x02,0x40,0x02,0x01,0x00,0x41,0x09,0x20,
- 0x00,0x00,0xe0,0x8b,0x9e,0xbd,0x91,0x7b,0xba,0x36,0x00,0x00,0x00,0x7a,0xbe,
- 0xf7,0x01,0x77,0x73,0x01,0x80,0xe3,0x08,0xd1,0x20,0x08,0x19,0x25,0xcf,0x30,
- 0x65,0x67,0x22,0x00,0x20,0xd1,0x95,0x3c,0xf9,0xdf,0xfb,0xfb,0x7b,0x93,0x20,
- 0xc1,0x5d,0x9f,0xbc,0xa3,0x8d,0x44,0x44,0x97,0x00,0x00,0x00,0x02,0x01,0x00,
- 0xc5,0x3f,0x00,0x00,0x00,0xe8,0x8f,0x16,0xdb,0x80,0xaf,0xdb,0xbe,0x24,0x00,
- 0x00,0x5a,0x96,0xda,0x80,0xff,0xb2,0x11,0x80,0xc1,0x80,0xdd,0x28,0x80,0xd4,
- 0xdf,0x29,0x98,0x3c,0xb8,0xb3,0x41,0x88,0xf6,0x57,0x77,0xf1,0xff,0xff,0xfd,
- 0xdf,0x5e,0x2b,0xb0,0xfe,0x97,0x5e,0xf8,0xe7,0x93,0x40,0x93,0x20,0x00,0x00,
- 0x02,0x4d,0x99,0x07,0xcb,0x93,0x8d,0x01,0x31,0x09,0x8e,0xdd,0x81,0xfb,0xf2,
- 0x3a,0x00,0x00,0x20,0x7a,0x8e,0x5a,0x89,0x55,0xd3,0x81,0x08,0xd0,0x00,0xe7,
- 0x1b,0x80,0xbc,0x33,0x3c,0x04,0x36,0xe4,0xe9,0x00,0x62,0x2f,0xbf,0xee,0xf2,
- 0xfd,0xbf,0xff,0x7d,0x2b,0x63,0x60,0xf7,0x4f,0x46,0xbd,0xfa,0x2d,0x00,0x08,
- 0x08,0x00,0x03,0x46,0x6b,0x4d,0x03,0x4d,0x59,0x4b,0x01,0xa4,0x2a,0x9f,0xb7,
- 0x80,0x53,0xb3,0xbe,0x04,0x00,0x00,0x7a,0xdb,0xbe,0x21,0xff,0x76,0x05,0x00,
- 0xe5,0x10,0xc0,0x20,0x08,0x40,0x01,0x00,0x80,0x00,0x00,0x00,0x00,0xe8,0xcd,
- 0x65,0xfc,0xe4,0x77,0xf7,0x77,0xff,0x5a,0x54,0xa2,0xb6,0x67,0x7f,0x7a,0x0b,
- 0x77,0x11,0x0c,0x00,0x01,0x20,0x3c,0xd9,0x3b,0x0d,0xc9,0x37,0xb9,0x07,0x48,
- 0x4a,0x92,0x6c,0x81,0xf5,0xb2,0x3c,0x00,0x00,0x00,0x7a,0xcb,0xdd,0x81,0xed,
- 0xe7,0x05,0x02,0x3e,0x00,0x60,0x00,0x00,0x90,0x00,0x01,0x00,0x00,0x00,0x00,
- 0x08,0x11,0xb5,0xde,0xb8,0xc9,0xff,0xff,0xfd,0xff,0xd5,0x90,0xb0,0xba,0x93,
- 0xdb,0x8d,0xbf,0x42,0x02,0x1e,0x42,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x40,0x65,0x4f,0x9f,0xbf,0x91,0x7f,0xd7,0xbd,0x00,0x00,0x80,0x7a,0x5d,
- 0x6f,0x21,0xe7,0x66,0x83,0x00,0x0f,0x02,0x40,0x80,0x20,0xd2,0x00,0x00,0x00,
- 0x00,0x00,0x20,0x00,0xae,0xae,0xd3,0xf3,0x9b,0xd7,0xef,0xbf,0xff,0x1f,0x2c,
- 0x2d,0xdd,0x99,0x7f,0x57,0x4a,0xac,0x41,0x14,0x08,0x10,0x00,0x00,0x20,0x00,
- 0x00,0x10,0x00,0x00,0x00,0xe8,0x47,0xd3,0x6d,0x81,0xf7,0x75,0x35,0x04,0x00,
- 0x00,0x3a,0xd7,0xdc,0x89,0xef,0xe5,0x22,0xa0,0x83,0x00,0x10,0x00,0x00,0x20,
- 0x00,0x00,0x80,0xc0,0x08,0x00,0x00,0x61,0x11,0xea,0xce,0x36,0x7f,0xbf,0xff,
- 0xfe,0x69,0x0b,0x4d,0xf7,0xe4,0xca,0xb5,0x8e,0x2b,0x04,0x88,0x00,0x0b,0x08,
- 0x00,0x00,0x10,0x20,0x00,0x00,0x84,0x00,0x72,0x40,0x8b,0xef,0x81,0x55,0xd3,
- 0xbd,0x00,0x00,0x10,0x78,0xd5,0xdf,0x81,0x7b,0xa7,0x05,0x01,0x09,0x90,0x00,
- 0x10,0x04,0x38,0x80,0x00,0x00,0x30,0x01,0x82,0x20,0x40,0xc4,0xb0,0xbf,0x27,
- 0xfe,0xfb,0xaf,0xff,0x5b,0x93,0x4a,0x75,0xe4,0xfb,0x4a,0x3d,0x29,0x81,0x00,
- 0xa0,0x34,0x00,0x08,0x08,0x00,0x00,0x02,0x04,0x00,0x50,0xa8,0x00,0xdb,0xad,
- 0xa0,0xef,0xf7,0xbc,0x00,0x00,0x00,0x7a,0xdb,0xde,0x81,0xed,0xf6,0x22,0x88,
- 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x0c,0x02,0x20,0x00,0xa8,0x7f,
- 0xaf,0xb6,0x6d,0xee,0xbf,0xfb,0x00,0x00,0x0c,0x54,0xfd,0xec,0xb7,0xfd,0xfd,
- 0x5f,0x10,0x24,0x04,0x3e,0x00,0x00,0x01,0x04,0x01,0x80,0x80,0x00,0x04,0x32,
- 0x40,0x95,0xcf,0x81,0x73,0x55,0x2d,0x00,0x00,0x04,0x7a,0xc5,0x5b,0x11,0xff,
- 0xe5,0x09,0x80,0xff,0x00,0x04,0x02,0x80,0x00,0x00,0x00,0x40,0xe0,0x40,0x00,
- 0x08,0xe9,0xff,0x7e,0x7d,0x27,0xfe,0xf7,0x8f,0x0b,0xee,0xe3,0x49,0xed,0xd9,
- 0xff,0x77,0xd7,0xb6,0xef,0xdf,0xfb,0x57,0x40,0x40,0x80,0x00,0x70,0x04,0x00,
- 0x00,0x80,0x68,0x0d,0x9b,0x7e,0x81,0x7f,0xf3,0xbd,0x20,0x00,0x00,0x5a,0x97,
- 0xde,0x81,0x6d,0xb7,0x00,0x02,0x20,0x22,0x89,0x80,0x00,0x20,0x10,0x18,0x02,
- 0x94,0x03,0x04,0x00,0x00,0x00,0x00,0x00,0x90,0x61,0x3f,0x34,0xaa,0xea,0x60,
- 0xd9,0x16,0x22,0x00,0x89,0x2a,0x55,0xb5,0x6a,0xad,0x56,0x48,0x04,0x00,0x74,
- 0x10,0x90,0x10,0x44,0x00,0xf6,0x4f,0x96,0xeb,0x88,0xf7,0x5a,0x37,0x00,0x00,
- 0x00,0x6a,0x8a,0xb9,0x80,0x73,0xd3,0x01,0x20,0x09,0x00,0x04,0x20,0xa0,0x42,
- 0x00,0x0a,0x02,0xb0,0xef,0xfb,0x77,0x7f,0xf7,0xb7,0xef,0x9f,0xcd,0x57,0x9b,
- 0x03,0x00,0x52,0xa5,0x7e,0xe6,0xff,0xfe,0xdd,0xfb,0xdd,0xff,0xf7,0x71,0x00,
- 0xd5,0x3e,0xe5,0xd2,0x96,0x0f,0x00,0x20,0x01,0x00,0x95,0xde,0x81,0xb9,0x73,
- 0xae,0x04,0x00,0x00,0x58,0xb6,0xf7,0x00,0xbb,0xba,0x4a,0x00,0x00,0x91,0xba,
- 0x86,0x9a,0xa9,0xf2,0xe1,0x1c,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
- 0xd3,0x84,0xf0,0xff,0xff,0x1f,0x06,0xb1,0x0f,0x00,0x00,0x00,0x00,0x12,0x12,
- 0x24,0x2a,0xc0,0x58,0xa1,0x92,0x28,0x65,0x10,0x00,0x21,0x34,0x84,0x86,0xb9,
- 0xa0,0x7f,0xdb,0xb6,0x10,0x00,0x00,0xaa,0x26,0x3d,0x91,0xbd,0x59,0x03,0x00,
- 0x00,0x00,0xa5,0x6a,0x05,0x46,0x24,0x49,0x45,0xdc,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0x69,0x82,0xff,0xff,0xff,0xff,0x87,0xce,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0x27,0x03,0x00,0x10,0x00,0x00,0x00,0x02,0x44,0x88,0x00,
- 0xa1,0x36,0x7f,0x81,0xcd,0x19,0xbe,0x00,0x00,0x08,0xfa,0x2e,0x7b,0x01,0x7b,
- 0xb9,0x43,0x04,0x48,0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xb3,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xf3,0xf8,0xff,0xfd,0xff,0xff,0xbf,0x8e,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdb,0x02,0x04,0x00,0x00,0x00,0x00,0x02,
- 0x01,0x40,0x2a,0x80,0x36,0xb3,0x80,0xbd,0x79,0xbe,0x00,0x00,0x00,0xba,0x5b,
- 0x6f,0x00,0xcd,0x49,0x00,0x21,0x04,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
- 0xd5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfa,0xff,0x5f,0x95,0x00,0xf0,
- 0xff,0xff,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x25,0x1a,0x42,0x48,0x41,
- 0x08,0x00,0x48,0x21,0xad,0x31,0x14,0x65,0xef,0x08,0xef,0x0c,0x31,0x10,0x00,
- 0x80,0xea,0x55,0x0a,0x04,0x58,0xac,0x54,0x00,0x00,0x08,0x00,0x00,0x01,0x00,
- 0x00,0x00,0x10,0x15,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xd5,0xee,0xb7,
- 0xad,0xfe,0x8b,0xfe,0xf7,0xa9,0xda,0xff,0xff,0xff,0xff,0xff,0xff,0x95,0xc6,
- 0x90,0x5a,0x1d,0x73,0x6f,0x27,0x94,0x5a,0xce,0x51,0x55,0x1d,0x40,0xbc,0x5c,
- 0xbf,0x00,0x00,0x00,0xf8,0xc5,0xfc,0xff,0xbf,0x56,0x9b,0x73,0x6b,0xe7,0xac,
- 0xbd,0xae,0x95,0xb3,0x56,0x4b,0xe5,0x49,0x0a,0x00,0x02,0x40,0x00,0x00,0x00,
- 0x3e,0x00,0x00,0x2b,0x20,0x30,0x00,0x70,0x01,0xe0,0x88,0xc0,0x06,0x40,0x80,
- 0x85,0x84,0x88,0xb4,0x56,0x45,0xa5,0x52,0x6a,0xa9,0xb5,0xab,0xb4,0x68,0xf6,
- 0xff,0xf7,0xb4,0xbf,0x04,0x00,0x00,0x9a,0xb9,0xd4,0xff,0x97,0x26,0x2d,0x55,
- 0x6d,0x55,0x1a,0x63,0x4a,0x90,0x54,0x2d,0x2a,0x95,0x56,0x05,0x07,0x06,0xc0,
- 0x61,0x00,0x00,0xe2,0x00,0x03,0x2f,0x70,0xe0,0x01,0xfc,0x03,0xf0,0x7f,0xc0,
- 0x1d,0xc0,0x00,0xb7,0x2b,0x53,0x6a,0xd7,0x56,0x49,0x0c,0x2b,0x2d,0xdf,0x67,
- 0xb5,0x88,0xd8,0xff,0x57,0xae,0xb5,0x00,0x00,0x00,0xda,0x1b,0xb9,0xb6,0x2e,
- 0xcb,0x4e,0x4b,0x0c,0xa9,0xb5,0xba,0xb7,0xb5,0x96,0xb2,0x57,0xb1,0xed,0x00,
- 0x0f,0x18,0x80,0xf7,0x00,0x07,0xae,0x09,0x07,0x0c,0x70,0x80,0x03,0xfc,0x07,
- 0xf8,0x2b,0x80,0x7f,0xc0,0x01,0x5f,0x72,0xb6,0xdf,0xfa,0xbd,0xf7,0xfb,0xea,
- 0xd6,0x6a,0xda,0x4b,0xdb,0xbd,0xfe,0x3d,0x93,0xbb,0x00,0x00,0x10,0xfa,0xaa,
- 0xe3,0xba,0x3c,0xab,0xfd,0xf7,0xf7,0xf7,0x6e,0x77,0xad,0x77,0xf7,0xfd,0xd6,
- 0x4e,0x5f,0x01,0x0f,0x38,0x04,0xf7,0x00,0x17,0x5e,0x81,0x97,0x0c,0x70,0x80,
- 0x03,0xbe,0x05,0xfc,0x5f,0x08,0x77,0xc0,0x20,0xbe,0x35,0x0a,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x04,0x20,0x56,0xd1,0x2e,0x16,0x47,0x3d,0x00,0x00,
- 0x00,0xe8,0x27,0xa6,0xb5,0x87,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x80,0x78,0xb7,0x00,0x0f,0xb8,0x00,0xf6,0x00,0xe1,0xdf,0x00,0x07,
- 0x08,0x70,0x80,0x01,0x6e,0x02,0xbc,0xb0,0x01,0x5f,0xe0,0x80,0x9f,0xca,0xf1,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x87,0x63,0x5b,0xc5,0x69,
- 0xae,0x40,0x00,0x00,0xfa,0x2c,0x8d,0xaf,0xe3,0xe8,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xaf,0xb7,0x5a,0x08,0x0f,0xb8,0x01,0xf0,0x04,0xf1,
- 0xb7,0x01,0x07,0x08,0x70,0xc0,0x03,0x3e,0x06,0x6c,0x8d,0x01,0x5e,0x40,0xc8,
- 0xbf,0xfc,0xc7,0xd5,0xbe,0xc5,0xba,0xea,0xff,0xdd,0xff,0xf7,0xff,0x6f,0x8c,
- 0x57,0x63,0xe4,0xbb,0x10,0x00,0x00,0xba,0x5c,0x1c,0xd6,0x70,0xe4,0xff,0xfd,
- 0xf7,0xee,0xfd,0xff,0xff,0x6f,0xfb,0xee,0xd7,0x6d,0xdd,0x00,0x07,0xb8,0x21,
- 0xb0,0x00,0xe3,0x5c,0x13,0x07,0x08,0xf0,0x80,0x23,0x5e,0x06,0xfc,0xdc,0x21,
- 0x3e,0xd0,0x80,0xaf,0xae,0xae,0xff,0xff,0xaa,0xfe,0xde,0xdf,0xf7,0xfd,0x55,
- 0xbf,0x9d,0x0e,0xdd,0xf1,0xb2,0xbd,0x00,0x00,0x00,0xea,0x9e,0x71,0x00,0x1c,
- 0xf5,0xfa,0x2b,0xfd,0xb7,0xbf,0xcf,0xf5,0xad,0xde,0x7f,0x6b,0x7f,0xbe,0x40,
- 0x0f,0xb8,0x07,0xf0,0x00,0x37,0x56,0x04,0x47,0x0e,0x71,0x80,0x03,0x1e,0x86,
- 0x38,0xec,0x01,0x7c,0xe0,0x80,0xb7,0xfa,0xcd,0xdf,0xdd,0x75,0xb7,0x55,0xf7,
- 0xbd,0xff,0xd5,0xbf,0x2f,0x71,0x00,0x1c,0xf9,0xb9,0x00,0x00,0x40,0x7a,0x3f,
- 0xe5,0x01,0x2f,0xda,0xdb,0x55,0x5f,0xef,0xed,0xfb,0xbe,0x6d,0xeb,0xaa,0xe3,
- 0xfb,0x7a,0x01,0x8f,0x18,0x0f,0xf0,0x00,0x0f,0xde,0x01,0x07,0x1c,0x70,0xc0,
- 0x01,0x0f,0x06,0x3c,0xcc,0x03,0x38,0xc4,0x04,0xaf,0xad,0xaa,0x97,0xfb,0xcd,
- 0xdb,0xff,0x3a,0xd7,0xfd,0xba,0xfd,0x7f,0xf5,0x21,0xaf,0x7c,0xb7,0x00,0x00,
- 0x00,0x48,0xfb,0x92,0xff,0xa3,0xfd,0xf6,0xe7,0xfe,0xd6,0x77,0xdf,0xf7,0xa7,
- 0x7e,0xf3,0x74,0x77,0xaf,0x00,0x07,0x1e,0x1b,0xf0,0x20,0x03,0xae,0x00,0x03,
- 0x1e,0x30,0xe0,0x00,0x02,0x02,0x08,0x84,0x01,0x18,0xc0,0x00,0x6f,0xbe,0x4d,
- 0x1c,0xfb,0xba,0xbe,0x55,0xef,0x7b,0xbb,0xad,0xdb,0xad,0x04,0xef,0x25,0xfe,
- 0xbb,0x20,0x00,0x00,0xfa,0xff,0x84,0x7c,0x80,0xee,0x7b,0x37,0xfb,0xbf,0xfb,
- 0xeb,0x6d,0x5b,0xfd,0xf1,0x6a,0x5d,0x7d,0x06,0x07,0x0e,0x2c,0x30,0x08,0x00,
- 0x1e,0x00,0x41,0x7f,0x20,0x38,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x01,0x83,
- 0xd8,0xfd,0xae,0xa5,0xbd,0x5d,0xef,0xef,0xef,0xfe,0x7e,0x5a,0xef,0xbb,0x28,
- 0xd6,0x12,0xf7,0x3d,0x00,0x00,0x00,0x9a,0xb5,0x33,0x02,0x2a,0xdb,0xf6,0xd5,
- 0x6a,0xdd,0xde,0xdf,0xd7,0xf5,0xba,0x2d,0x60,0xb4,0xde,0xfd,0xfa,0xff,0xdf,
- 0xff,0xff,0xff,0xf7,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0x5f,0x5a,0x2a,0x3b,0xf7,0xbe,0xaf,0x5b,0xf7,0xeb,0x73,0xfd,
- 0x5e,0xcf,0x03,0x20,0xc9,0xbd,0xbb,0x08,0x00,0x00,0x7a,0xf7,0x62,0x01,0x88,
- 0x75,0xef,0x73,0xfd,0xdb,0xbf,0xef,0xef,0x5b,0x7d,0xcb,0xe5,0x75,0xbf,0xfe,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x75,0x57,0xac,0x75,0xba,0x7c,0xaf,0xe7,
- 0xfb,0xae,0xad,0xd5,0xbf,0x07,0x50,0x60,0x6f,0xb5,0x00,0x00,0x00,0xba,0x7d,
- 0x1f,0xfe,0x71,0xb7,0xdf,0xdc,0xb6,0x7d,0xcf,0xbb,0xfb,0xf2,0xd7,0x51,0x51,
- 0x8f,0x77,0xfb,0xff,0xff,0x7f,0xff,0xff,0xff,0xdf,0xff,0xff,0x6f,0xff,0xaf,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xdd,0x1e,0xc7,0xaf,0x7d,
- 0xa7,0xff,0xdf,0xbf,0xdb,0xfa,0xfe,0xfb,0xff,0xa0,0xfe,0xef,0x3f,0x00,0x00,
- 0x40,0x72,0xdf,0xff,0x00,0xce,0xdf,0xb7,0x7b,0xef,0x77,0x7f,0xff,0xde,0xff,
- 0xff,0xff,0xff,0xfb,0x5d,0xea,0xff,0xe5,0xef,0xfe,0xff,0xff,0x37,0xff,0xff,
- 0xdb,0xee,0x7b,0xff,0xff,0xff,0xdd,0xf7,0xff,0x7b,0xab,0xaa,0x2a,0x85,0x54,
- 0x55,0x54,0x52,0x52,0x51,0x04,0x84,0x14,0x02,0x08,0x04,0x00,0x12,0x09,0x00,
- 0x80,0x00,0x00,0x10,0xf8,0xff,0xff,0xd7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xbf,0xff,0xde,0x56,0xad,0xaa,0x56,0x53,0x15,0x04,0x0a,0x11,0x01,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,
- 0x00,0x00,0x20,0x80,0x24,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x22,0x22,0x91,0xac,0xea,0x6a,0x7b,0xed,
- 0xbe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfb,0xff,0xff,0xff,0xff,0xb7,
- 0xde,0xff,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0x20,0x04,0x01,0x00,0x00,0x00,0x4a,0xca,0xaa,0xbe,0xdd,
- 0x76,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xef,0xfd,0x6d,0x6d,0xab,0xaa,
- 0x9a,0x4a,0x81,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x40,0x02,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x01,0x00,0x20,0x80,0x00,0x00,0x00,
- 0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x01,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x44,0x10,0xa4,0x08,0x80,0x80,0x00,0x08,
- 0x80,0x00,0x00,0x00,0x00,0x01,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x02,0x21,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,
- 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x00,0x00,0x00,
- 0x20,0x00,0x00,0x10,0x10,0x00,0x80,0x40,0x00,0x80,0x00,0x00,0x00,0x00,0x00,
- 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x08,0x00,0x00,0x42,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x10,
- 0x41,0x00,0x02,0x04,0x00,0x10,0x00,0x00,0x08,0x00,0x00,0x40,0x04,0x00,0x80,
- 0x00,0x00,0x20,0x00,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x04,0x02,
- 0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x10,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x02,0x10,0x02,0x80,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x22,0x02,0x00,0x00,0x01,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x84,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x00,0x00,0x20,0x04,0x00,
- 0x08,0x00,0x04,0x80,0x10,0x02,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x02,0x00,
- 0x00,0x00,0x40,0x24,0x84,0x20,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x00,0x00,0x02,0x00,0x01,0x20,0x10,0x84,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x08,0x20,0x00,0x01,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,0x20,0x00,0x00,0x01,0x00,0x00,0x01,
- 0x00,0x00,0x00,0x24,0x02,0x01,0x00,0x00,0x00,0x00,0x20,0x00,0x14,0x88,0x10,
- 0x00,0x00,0x84,0x00,0x00,0x00,0x04,0x10,0x00,0x40,0x00,0x40,0x00,0x42,0x00,
- 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x21,0x00,0x08,0x04,0x01,0x08,0x00,0x48,
- 0x00,0x00,0x04,0x08,0x00,0x80,0x00,0x10,0x00,0x20,0x00,0x08,0x00,0x40,0x00,
- 0x00,0x00,0x00,0x08,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand01.xbm b/blt3.0.1/demos/bitmaps/hand/hand01.xbm
deleted file mode 100644
index 096b56c..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand01.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-1_width 16
-#define hand6-1_height 16
-#define hand6-1_x_hot 8
-#define hand6-1_y_hot 10
-static unsigned char hand6-1_bits[] = {
- 0x00, 0x00, 0x80, 0x03, 0xe0, 0x0e, 0xa0, 0x1a, 0xa0, 0x2a, 0xa0, 0x2a,
- 0xa0, 0x2a, 0xb8, 0x2a, 0x28, 0x28, 0x28, 0x20, 0x28, 0x20, 0x08, 0x20,
- 0x08, 0x20, 0x10, 0x20, 0x20, 0x10, 0xe0, 0x1f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand01m.xbm b/blt3.0.1/demos/bitmaps/hand/hand01m.xbm
deleted file mode 100644
index eabce63..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand01m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-1m_width 16
-#define hand6-1m_height 16
-#define hand6-1m_x_hot 8
-#define hand6-1m_y_hot 9
-static unsigned char hand6-1m_bits[] = {
- 0x00, 0x00, 0x80, 0x03, 0xe0, 0x0f, 0xe0, 0x1f, 0xe0, 0x3f, 0xe0, 0x3f,
- 0xe0, 0x3f, 0xf8, 0x3f, 0xf8, 0x3f, 0xf8, 0x3f, 0xf8, 0x3f, 0xf8, 0x3f,
- 0xf8, 0x3f, 0xf0, 0x3f, 0xe0, 0x1f, 0xe0, 0x1f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand02.xbm b/blt3.0.1/demos/bitmaps/hand/hand02.xbm
deleted file mode 100644
index 39cbf11..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand02.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-02_width 16
-#define hand6-02_height 16
-#define hand6-02_x_hot 10
-#define hand6-02_y_hot 11
-static unsigned char hand6-02_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3b, 0x80, 0x2a, 0x80, 0x6a,
- 0x80, 0xaa, 0xbc, 0xaa, 0xa4, 0xaa, 0xa4, 0xa0, 0xbc, 0x80, 0x80, 0x80,
- 0xf8, 0x80, 0x08, 0x80, 0xf8, 0xc0, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand02m.xbm b/blt3.0.1/demos/bitmaps/hand/hand02m.xbm
deleted file mode 100644
index 6466efe..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand02m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-02m_width 16
-#define hand6-02m_height 16
-#define hand6-02m_x_hot 10
-#define hand6-02m_y_hot 11
-static unsigned char hand6-02m_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3f, 0x80, 0x3f, 0x80, 0x7f,
- 0x80, 0xff, 0xbc, 0xff, 0xbc, 0xff, 0xbc, 0xff, 0xbc, 0xff, 0x80, 0xff,
- 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand03.xbm b/blt3.0.1/demos/bitmaps/hand/hand03.xbm
deleted file mode 100644
index 9ad0c3d..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand03.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-03_width 16
-#define hand6-03_height 16
-#define hand6-03_x_hot 10
-#define hand6-03_y_hot 11
-static unsigned char hand6-03_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3b, 0x80, 0x2a, 0x80, 0x6a,
- 0xbc, 0xaa, 0xa4, 0xaa, 0xa4, 0xaa, 0xbc, 0xa0, 0x80, 0x80, 0x80, 0x80,
- 0xf8, 0x80, 0x08, 0x80, 0xf8, 0xc0, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand03m.xbm b/blt3.0.1/demos/bitmaps/hand/hand03m.xbm
deleted file mode 100644
index 026b54c..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand03m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-03m_width 16
-#define hand6-03m_height 16
-#define hand6-03m_x_hot 10
-#define hand6-03m_y_hot 11
-static unsigned char hand6-03m_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3f, 0x80, 0x3f, 0x80, 0x7f,
- 0xbc, 0xff, 0xbc, 0xff, 0xbc, 0xff, 0xbc, 0xff, 0x80, 0xff, 0x80, 0xff,
- 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand04.xbm b/blt3.0.1/demos/bitmaps/hand/hand04.xbm
deleted file mode 100644
index 0fb8628..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand04.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-04_width 16
-#define hand6-04_height 16
-#define hand6-04_x_hot 10
-#define hand6-04_y_hot 11
-static unsigned char hand6-04_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3b, 0x80, 0x2a, 0xbc, 0x6a,
- 0xa4, 0xaa, 0xa4, 0xaa, 0xbc, 0xaa, 0x80, 0xa0, 0xb8, 0x80, 0xc8, 0x80,
- 0x98, 0x80, 0x30, 0x80, 0xe0, 0xc0, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand04m.xbm b/blt3.0.1/demos/bitmaps/hand/hand04m.xbm
deleted file mode 100644
index e391196..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand04m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-04m_width 16
-#define hand6-04m_height 16
-#define hand6-04m_x_hot 10
-#define hand6-04m_y_hot 11
-static unsigned char hand6-04m_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3f, 0x80, 0x3f, 0xbc, 0x7f,
- 0xbc, 0xff, 0xbc, 0xff, 0xbc, 0xff, 0x80, 0xff, 0xb8, 0xff, 0xf8, 0xff,
- 0xf8, 0xff, 0xf0, 0xff, 0xe0, 0xff, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand05.xbm b/blt3.0.1/demos/bitmaps/hand/hand05.xbm
deleted file mode 100644
index 57708c3..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand05.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-05_width 16
-#define hand6-05_height 16
-#define hand6-05_x_hot 10
-#define hand6-05_y_hot 11
-static unsigned char hand6-05_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xbc, 0x3b, 0xa4, 0x2a, 0xa4, 0x6a,
- 0xbc, 0xaa, 0x80, 0xaa, 0x80, 0xaa, 0x80, 0xa0, 0xb8, 0x80, 0xc8, 0x80,
- 0x98, 0x80, 0x30, 0x80, 0xe0, 0xc0, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand05m.xbm b/blt3.0.1/demos/bitmaps/hand/hand05m.xbm
deleted file mode 100644
index 8d6704c..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand05m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-05m_width 16
-#define hand6-05m_height 16
-#define hand6-05m_x_hot 10
-#define hand6-05m_y_hot 11
-static unsigned char hand6-05m_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xbc, 0x3f, 0xbc, 0x3f, 0xbc, 0x7f,
- 0xbc, 0xff, 0x80, 0xff, 0x80, 0xff, 0x80, 0xff, 0xb8, 0xff, 0xf8, 0xff,
- 0xf8, 0xff, 0xf0, 0xff, 0xe0, 0xff, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand06.xbm b/blt3.0.1/demos/bitmaps/hand/hand06.xbm
deleted file mode 100644
index 6e0aae0..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand06.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-06_width 16
-#define hand6-06_height 16
-#define hand6-06_x_hot 10
-#define hand6-06_y_hot 11
-static unsigned char hand6-06_bits[] = {
- 0x00, 0x00, 0x3c, 0x00, 0x24, 0x0e, 0xa4, 0x3b, 0xbc, 0x2a, 0x80, 0x6a,
- 0x80, 0xaa, 0x80, 0xaa, 0x80, 0xaa, 0x80, 0xa0, 0xb8, 0x80, 0xc8, 0x80,
- 0x98, 0x80, 0x30, 0x80, 0xe0, 0xc0, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand06m.xbm b/blt3.0.1/demos/bitmaps/hand/hand06m.xbm
deleted file mode 100644
index de93e1d..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand06m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-06m_width 16
-#define hand6-06m_height 16
-#define hand6-06m_x_hot 10
-#define hand6-06m_y_hot 11
-static unsigned char hand6-06m_bits[] = {
- 0x00, 0x00, 0x3c, 0x00, 0x3c, 0x0e, 0xbc, 0x3f, 0xbc, 0x3f, 0x80, 0x7f,
- 0x80, 0xff, 0x80, 0xff, 0x80, 0xff, 0x80, 0xff, 0xb8, 0xff, 0xf8, 0xff,
- 0xf8, 0xff, 0xf0, 0xff, 0xe0, 0xff, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand07.xbm b/blt3.0.1/demos/bitmaps/hand/hand07.xbm
deleted file mode 100644
index dbc002a..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand07.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-07_width 16
-#define hand6-07_height 16
-#define hand6-07_x_hot 10
-#define hand6-07_y_hot 11
-static unsigned char hand6-07_bits[] = {
- 0x1e, 0x00, 0x12, 0x00, 0x12, 0x0e, 0x9e, 0x3b, 0x80, 0x2a, 0x80, 0x6a,
- 0x80, 0xaa, 0x80, 0xaa, 0xe0, 0xaa, 0xa0, 0xa0, 0xa0, 0x80, 0xa0, 0x80,
- 0x20, 0x80, 0x60, 0x80, 0xc0, 0xc0, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand07m.xbm b/blt3.0.1/demos/bitmaps/hand/hand07m.xbm
deleted file mode 100644
index 3b435a8..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand07m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-07m_width 16
-#define hand6-07m_height 16
-#define hand6-07m_x_hot 10
-#define hand6-07m_y_hot 11
-static unsigned char hand6-07m_bits[] = {
- 0x1e, 0x00, 0x1e, 0x00, 0x1e, 0x0e, 0x9e, 0x3f, 0x80, 0x3f, 0x80, 0x7f,
- 0x80, 0xff, 0x80, 0xff, 0xe0, 0xff, 0xe0, 0xff, 0xe0, 0xff, 0xe0, 0xff,
- 0xe0, 0xff, 0xe0, 0xff, 0xc0, 0xff, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand08.xbm b/blt3.0.1/demos/bitmaps/hand/hand08.xbm
deleted file mode 100644
index 2ed12f4..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand08.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-08_width 16
-#define hand6-08_height 16
-#define hand6-08_x_hot 10
-#define hand6-08_y_hot 11
-static unsigned char hand6-08_bits[] = {
- 0x00, 0x00, 0x0f, 0x00, 0x09, 0x0e, 0x89, 0x3b, 0x8f, 0x2a, 0x80, 0x6a,
- 0x80, 0xaa, 0x80, 0xaa, 0xe0, 0xaa, 0xa0, 0xa0, 0xa0, 0x80, 0xa0, 0x80,
- 0x20, 0x80, 0x60, 0x80, 0xc0, 0xc0, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand08m.xbm b/blt3.0.1/demos/bitmaps/hand/hand08m.xbm
deleted file mode 100644
index c1c700e..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand08m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-08m_width 16
-#define hand6-08m_height 16
-#define hand6-08m_x_hot 10
-#define hand6-08m_y_hot 11
-static unsigned char hand6-08m_bits[] = {
- 0x00, 0x00, 0x0f, 0x00, 0x0f, 0x0e, 0x8f, 0x3f, 0x8f, 0x3f, 0x80, 0x7f,
- 0x80, 0xff, 0x80, 0xff, 0xe0, 0xff, 0xe0, 0xff, 0xe0, 0xff, 0xe0, 0xff,
- 0xe0, 0xff, 0xe0, 0xff, 0xc0, 0xff, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand09.xbm b/blt3.0.1/demos/bitmaps/hand/hand09.xbm
deleted file mode 100644
index 589b415..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand09.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-09_width 16
-#define hand6-09_height 16
-#define hand6-09_x_hot 10
-#define hand6-09_y_hot 11
-static unsigned char hand6-09_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0e, 0x89, 0x3b, 0x89, 0x2a, 0x8f, 0x6a,
- 0x80, 0xaa, 0x80, 0xaa, 0xe0, 0xaa, 0xa0, 0xa0, 0xa0, 0x80, 0xa0, 0x80,
- 0x20, 0x80, 0x60, 0x80, 0xc0, 0xc0, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand09m.xbm b/blt3.0.1/demos/bitmaps/hand/hand09m.xbm
deleted file mode 100644
index ec289cc..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand09m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-09m_width 16
-#define hand6-09m_height 16
-#define hand6-09m_x_hot 10
-#define hand6-09m_y_hot 11
-static unsigned char hand6-09m_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0e, 0x8f, 0x3f, 0x8f, 0x3f, 0x8f, 0x7f,
- 0x80, 0xff, 0x80, 0xff, 0xe0, 0xff, 0xe0, 0xff, 0xe0, 0xff, 0xe0, 0xff,
- 0xe0, 0xff, 0xe0, 0xff, 0xc0, 0xff, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand10.xbm b/blt3.0.1/demos/bitmaps/hand/hand10.xbm
deleted file mode 100644
index e0c728f..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand10.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-10_width 16
-#define hand6-10_height 16
-#define hand6-10_x_hot 10
-#define hand6-10_y_hot 11
-static unsigned char hand6-10_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3b, 0x8f, 0x2a, 0x89, 0x6a,
- 0x89, 0xaa, 0x8f, 0xaa, 0xe0, 0xaa, 0xa0, 0xa0, 0xa0, 0x80, 0xa0, 0x80,
- 0x20, 0x80, 0x60, 0x80, 0xc0, 0xc0, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand10m.xbm b/blt3.0.1/demos/bitmaps/hand/hand10m.xbm
deleted file mode 100644
index 49c134b..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand10m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-10m_width 16
-#define hand6-10m_height 16
-#define hand6-10m_x_hot 10
-#define hand6-10m_y_hot 11
-static unsigned char hand6-10m_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3f, 0x8f, 0x3f, 0x8f, 0x7f,
- 0x8f, 0xff, 0x8f, 0xff, 0xe0, 0xff, 0xe0, 0xff, 0xe0, 0xff, 0xe0, 0xff,
- 0xe0, 0xff, 0xe0, 0xff, 0xc0, 0xff, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand11.xbm b/blt3.0.1/demos/bitmaps/hand/hand11.xbm
deleted file mode 100644
index 719919b..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand11.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-11_width 16
-#define hand6-11_height 16
-#define hand6-11_x_hot 10
-#define hand6-11_y_hot 11
-static unsigned char hand6-11_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3b, 0x80, 0x2a, 0x80, 0x6a,
- 0x8f, 0xaa, 0x89, 0xaa, 0xe9, 0xaa, 0xaf, 0xa0, 0xa0, 0x80, 0xa0, 0x80,
- 0x20, 0x80, 0x60, 0x80, 0xc0, 0xc0, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand11m.xbm b/blt3.0.1/demos/bitmaps/hand/hand11m.xbm
deleted file mode 100644
index 5ea63b3..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand11m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-11m_width 16
-#define hand6-11m_height 16
-#define hand6-11m_x_hot 10
-#define hand6-11m_y_hot 11
-static unsigned char hand6-11m_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3f, 0x80, 0x3f, 0x80, 0x7f,
- 0x8f, 0xff, 0x8f, 0xff, 0xef, 0xff, 0xef, 0xff, 0xe0, 0xff, 0xe0, 0xff,
- 0xe0, 0xff, 0xe0, 0xff, 0xc0, 0xff, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand12.xbm b/blt3.0.1/demos/bitmaps/hand/hand12.xbm
deleted file mode 100644
index c394581..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand12.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-12_width 16
-#define hand6-12_height 16
-#define hand6-12_x_hot 10
-#define hand6-12_y_hot 11
-static unsigned char hand6-12_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3b, 0x80, 0x2a, 0x80, 0x6a,
- 0x80, 0xaa, 0x80, 0xaa, 0xef, 0xaa, 0xa9, 0xa0, 0xa9, 0x80, 0xaf, 0x80,
- 0x20, 0x80, 0x60, 0x80, 0xc0, 0xc0, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand12m.xbm b/blt3.0.1/demos/bitmaps/hand/hand12m.xbm
deleted file mode 100644
index d0cf21b..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand12m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-12m_width 16
-#define hand6-12m_height 16
-#define hand6-12m_x_hot 10
-#define hand6-12m_y_hot 11
-static unsigned char hand6-12m_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3f, 0x80, 0x3f, 0x80, 0x7f,
- 0x80, 0xff, 0x80, 0xff, 0xef, 0xff, 0xef, 0xff, 0xef, 0xff, 0xef, 0xff,
- 0xe0, 0xff, 0xe0, 0xff, 0xc0, 0xff, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand13.xbm b/blt3.0.1/demos/bitmaps/hand/hand13.xbm
deleted file mode 100644
index 414efb0..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand13.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-13_width 16
-#define hand6-13_height 16
-#define hand6-13_x_hot 10
-#define hand6-13_y_hot 11
-static unsigned char hand6-13_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3b, 0x80, 0x2a, 0x80, 0x6a,
- 0x80, 0xaa, 0x80, 0xaa, 0xe0, 0xaa, 0xa0, 0xa0, 0xaf, 0x80, 0xa9, 0x80,
- 0x29, 0x80, 0x6f, 0x80, 0xc0, 0xc0, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand13m.xbm b/blt3.0.1/demos/bitmaps/hand/hand13m.xbm
deleted file mode 100644
index 6179c56..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand13m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-13m_width 16
-#define hand6-13m_height 16
-#define hand6-13m_x_hot 10
-#define hand6-13m_y_hot 11
-static unsigned char hand6-13m_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3f, 0x80, 0x3f, 0x80, 0x7f,
- 0x80, 0xff, 0x80, 0xff, 0xe0, 0xff, 0xe0, 0xff, 0xef, 0xff, 0xef, 0xff,
- 0xef, 0xff, 0xef, 0xff, 0xc0, 0xff, 0x80, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand14.xbm b/blt3.0.1/demos/bitmaps/hand/hand14.xbm
deleted file mode 100644
index f1f9c27..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand14.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-14_width 16
-#define hand6-14_height 16
-#define hand6-14_x_hot 10
-#define hand6-14_y_hot 11
-static unsigned char hand6-14_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3b, 0x80, 0x2a, 0x80, 0x6a,
- 0x80, 0xaa, 0x80, 0xaa, 0xe0, 0xaa, 0xa0, 0xa0, 0xa0, 0x80, 0xa0, 0x80,
- 0x2f, 0x80, 0x69, 0x80, 0xc9, 0xc0, 0x8f, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hand/hand14m.xbm b/blt3.0.1/demos/bitmaps/hand/hand14m.xbm
deleted file mode 100644
index f623eec..0000000
--- a/blt3.0.1/demos/bitmaps/hand/hand14m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define hand6-14m_width 16
-#define hand6-14m_height 16
-#define hand6-14m_x_hot 10
-#define hand6-14m_y_hot 11
-static unsigned char hand6-14m_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x80, 0x3f, 0x80, 0x3f, 0x80, 0x7f,
- 0x80, 0xff, 0x80, 0xff, 0xe0, 0xff, 0xe0, 0xff, 0xe0, 0xff, 0xe0, 0xff,
- 0xef, 0xff, 0xef, 0xff, 0xcf, 0xff, 0x8f, 0x7f};
diff --git a/blt3.0.1/demos/bitmaps/hobbes.xbm b/blt3.0.1/demos/bitmaps/hobbes.xbm
deleted file mode 100644
index a3778c3..0000000
--- a/blt3.0.1/demos/bitmaps/hobbes.xbm
+++ /dev/null
@@ -1,16 +0,0 @@
-#define hobbes_width 25
-#define hobbes_height 25
-#define hobbes_x_hot 16
-#define hobbes_y_hot 15
-static char hobbes_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00,
- 0x78, 0xe0, 0x07, 0x00, 0xfc, 0xf8, 0x07, 0x00, 0xcc, 0x07, 0x04, 0x00,
- 0x0c, 0xf0, 0x0b, 0x00, 0x7c, 0x1c, 0x06, 0x00, 0x38, 0x00, 0x00, 0x00,
- 0xe0, 0x03, 0x10, 0x00, 0xe0, 0x41, 0x11, 0x00, 0x20, 0x40, 0x11, 0x00,
- 0xe0, 0x07, 0x10, 0x00, 0xe0, 0xc1, 0x17, 0x00, 0x10, 0xe0, 0x2f, 0x00,
- 0x20, 0xe0, 0x6f, 0x00, 0x18, 0xe0, 0x2f, 0x00, 0x20, 0xc6, 0x67, 0x00,
- 0x18, 0x84, 0x2b, 0x00, 0x20, 0x08, 0x64, 0x00, 0x70, 0xf0, 0x13, 0x00,
- 0x80, 0x01, 0x08, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00};
-
-
diff --git a/blt3.0.1/demos/bitmaps/hobbes_mask.xbm b/blt3.0.1/demos/bitmaps/hobbes_mask.xbm
deleted file mode 100644
index 682ce5f..0000000
--- a/blt3.0.1/demos/bitmaps/hobbes_mask.xbm
+++ /dev/null
@@ -1,14 +0,0 @@
-#define hobbes_width 25
-#define hobbes_height 25
-#define hobbes_x_hot 16
-#define hobbes_y_hot 15
-static unsigned char hobbes_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00,
- 0x78, 0xe0, 0x07, 0x00, 0xfc, 0xf8, 0x07, 0x00, 0xfc, 0xff, 0x07, 0x00,
- 0xfc, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0xf8, 0xff, 0x0f, 0x00,
- 0xe0, 0xff, 0x1f, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0xe0, 0xff, 0x1f, 0x00,
- 0xe0, 0xff, 0x1f, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x3f, 0x00,
- 0xe0, 0xff, 0x7f, 0x00, 0xf8, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0x7f, 0x00,
- 0xf8, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0x1f, 0x00,
- 0x80, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00};
diff --git a/blt3.0.1/demos/bitmaps/sharky.xbm b/blt3.0.1/demos/bitmaps/sharky.xbm
deleted file mode 100644
index 25f923f..0000000
--- a/blt3.0.1/demos/bitmaps/sharky.xbm
+++ /dev/null
@@ -1,129 +0,0 @@
-#define sharky_width 171
-#define sharky_height 68
-static char sharky_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x80, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xdf, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfd, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xe0, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
- 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xd0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x54, 0xfd, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x49, 0x92, 0x54, 0x55, 0x45, 0xeb,
- 0x07, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x10, 0x41, 0x55, 0x84, 0x44, 0x85, 0xa2, 0x50, 0x94, 0x0f, 0x00,
- 0x00, 0x06, 0x00, 0xfc, 0x17, 0x00, 0x40, 0x12, 0x12, 0x42, 0x00, 0x01,
- 0x04, 0x04, 0x51, 0x75, 0x75, 0xd5, 0xae, 0x55, 0x10, 0x00, 0x80, 0x0f,
- 0x00, 0xfe, 0x1f, 0x00, 0x5c, 0x54, 0x45, 0x89, 0x04, 0x10, 0x00, 0x80,
- 0x08, 0x55, 0xd5, 0x5e, 0x55, 0xa5, 0x25, 0x15, 0xa0, 0x1f, 0x00, 0xfe,
- 0x1f, 0x00, 0xde, 0x55, 0xb5, 0x76, 0x65, 0x25, 0x52, 0x22, 0xd0, 0x56,
- 0x7b, 0xd5, 0xff, 0x5d, 0xb5, 0xa2, 0xd7, 0x1f, 0x00, 0xff, 0x0d, 0x00,
- 0x17, 0x41, 0x40, 0x00, 0x7a, 0x95, 0x00, 0x91, 0x0a, 0xd9, 0xed, 0x7f,
- 0xd5, 0x73, 0x5b, 0x55, 0x54, 0x7f, 0x80, 0xde, 0x07, 0x00, 0xab, 0x54,
- 0x14, 0x49, 0xa8, 0x6e, 0x55, 0x0c, 0x64, 0x75, 0xff, 0xff, 0xbf, 0xde,
- 0x57, 0xd5, 0x95, 0xfa, 0x43, 0x7f, 0x07, 0x00, 0x17, 0x00, 0x09, 0x00,
- 0x74, 0xd1, 0x5b, 0xb5, 0xa9, 0xdd, 0xd5, 0xf7, 0xfd, 0x5f, 0x5e, 0x55,
- 0x52, 0x95, 0xdd, 0xfd, 0x05, 0x00, 0x76, 0x55, 0x52, 0x25, 0xf9, 0x15,
- 0x76, 0x6f, 0xb6, 0xf7, 0xff, 0xff, 0xff, 0xfb, 0xd7, 0xf7, 0xaa, 0x75,
- 0xf7, 0xf7, 0x03, 0x00, 0xd8, 0x15, 0x50, 0x00, 0xf8, 0x60, 0xe8, 0xdd,
- 0x5d, 0x7f, 0xff, 0xff, 0xef, 0xff, 0xfd, 0x5e, 0x5b, 0xff, 0xbf, 0xad,
- 0x03, 0x00, 0x70, 0x27, 0x05, 0x49, 0xf9, 0x0a, 0x12, 0xb6, 0xf5, 0xfd,
- 0x7f, 0xdf, 0xfd, 0xff, 0xff, 0xdf, 0xff, 0xbd, 0x6d, 0xd6, 0x07, 0x00,
- 0xe0, 0x5b, 0x75, 0x04, 0x7c, 0x01, 0x40, 0xa8, 0xee, 0xff, 0xff, 0xff,
- 0xdf, 0xff, 0xbf, 0xff, 0xeb, 0xd7, 0xd5, 0xbd, 0x05, 0x00, 0x80, 0x7f,
- 0x05, 0x51, 0xb1, 0x44, 0x95, 0x46, 0x75, 0xe7, 0xff, 0xff, 0xff, 0xde,
- 0xfb, 0xfb, 0x7e, 0x7d, 0x75, 0xef, 0x07, 0x00, 0x00, 0x7e, 0x5b, 0x12,
- 0x00, 0x10, 0x00, 0x18, 0x4a, 0x9d, 0xfd, 0xdf, 0xf6, 0xfb, 0xff, 0xdf,
- 0xd7, 0xa5, 0x4d, 0xd5, 0x06, 0x00, 0x00, 0xf8, 0xd7, 0xad, 0x0a, 0x02,
- 0x44, 0x82, 0x52, 0x77, 0xef, 0xfd, 0xbf, 0xdf, 0xd6, 0xf6, 0x7e, 0x5f,
- 0x03, 0xf7, 0x0f, 0x00, 0x00, 0xe0, 0x5f, 0xb6, 0x44, 0x08, 0x11, 0x51,
- 0x54, 0x4a, 0xbb, 0xf7, 0xed, 0x7a, 0xdf, 0xdd, 0xd5, 0x75, 0x00, 0x5e,
- 0x1d, 0x00, 0x00, 0x00, 0x3f, 0x93, 0x5d, 0x43, 0x44, 0x08, 0x11, 0x69,
- 0xd5, 0x5e, 0x7f, 0xdf, 0x7b, 0x77, 0x75, 0x3b, 0x00, 0xf0, 0x2b, 0x00,
- 0x00, 0x00, 0xfc, 0x5d, 0x67, 0x11, 0x00, 0x21, 0x44, 0x55, 0x7b, 0x75,
- 0xd5, 0x6b, 0xd5, 0x6d, 0x5f, 0x07, 0x00, 0x50, 0x37, 0x00, 0x00, 0x00,
- 0xf0, 0xff, 0x9d, 0x84, 0x48, 0x48, 0x89, 0x50, 0xb6, 0xd6, 0xbd, 0x5a,
- 0x77, 0xdb, 0xd6, 0x3d, 0x00, 0xc0, 0x76, 0x00, 0x00, 0x00, 0x80, 0xff,
- 0xff, 0x57, 0x40, 0x02, 0x45, 0x44, 0xd7, 0x55, 0x55, 0xd5, 0x54, 0x55,
- 0x35, 0x33, 0x00, 0x80, 0xdf, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f,
- 0x15, 0x50, 0x50, 0xd1, 0x7f, 0x54, 0xb5, 0x56, 0xdd, 0xf6, 0x1d, 0x5c,
- 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x40, 0x45, 0x09,
- 0x41, 0xe4, 0x5f, 0x95, 0x52, 0x55, 0x25, 0x55, 0x07, 0x74, 0x00, 0x00,
- 0xbc, 0x01, 0x00, 0x00, 0x00, 0x80, 0x54, 0x12, 0x32, 0x11, 0x15, 0xf1,
- 0xff, 0x52, 0x15, 0x53, 0xa9, 0xdd, 0x1f, 0x10, 0x00, 0x00, 0xe8, 0x02,
- 0x00, 0x00, 0x00, 0x40, 0x05, 0xc9, 0x44, 0x49, 0x55, 0xf4, 0xf7, 0x12,
- 0x45, 0x11, 0x55, 0xd5, 0x1f, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00,
- 0x00, 0xc0, 0xff, 0x56, 0x5b, 0xb5, 0xa4, 0xea, 0x5f, 0x4f, 0x51, 0xcc,
- 0xd6, 0x3f, 0x74, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xf5, 0x56, 0x5b, 0xf5, 0xff, 0x50, 0x55, 0xdb, 0xff, 0x1f,
- 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
- 0xbf, 0xff, 0x55, 0xff, 0xff, 0xaf, 0xd6, 0xff, 0xc1, 0x17, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xef,
- 0xfe, 0xf7, 0xff, 0xdf, 0xff, 0x05, 0xe0, 0x0b, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xff, 0xff, 0xdf, 0xff,
- 0xff, 0xff, 0x1e, 0x00, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xaf,
- 0x1f, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x02, 0x00, 0x3c, 0x00,
- 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xfc, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0x00, 0x80, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xfe, 0xff, 0x07, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
- 0xff, 0x03, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03,
- 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x00,
- 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0xc0,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
- 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec,
- 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0x0f, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xda, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
- 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x03, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
diff --git a/blt3.0.1/demos/bitmaps/xbob.xbm b/blt3.0.1/demos/bitmaps/xbob.xbm
deleted file mode 100644
index 5ed778d..0000000
--- a/blt3.0.1/demos/bitmaps/xbob.xbm
+++ /dev/null
@@ -1,46 +0,0 @@
-#define bob_x_hot 30
-#define bob_y_hot 37
-#define bob_width 61
-#define bob_height 75
-static short bobr_bits[] = { /* a right-going ``Bob'' */
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, 0x07ff, 0x0000,
- 0x0000, 0xfffe, 0x1fff, 0x0000, 0x8000, 0xffff, 0xfbff, 0x0000,
- 0xc000, 0xcfff, 0xd19f, 0x0003, 0xf000, 0x8c7f, 0x9133, 0x0007,
- 0xf800, 0x18a7, 0xb127, 0x0006, 0xfc00, 0x3147, 0xa64e, 0x000e,
- 0xfe00, 0x214f, 0xae4c, 0x003d, 0xff00, 0x23df, 0xbe8d, 0x007d,
- 0xff80, 0x67ff, 0xfebd, 0x01ff, 0xff80, 0x7fff, 0xffbf, 0x03ff,
- 0xffc0, 0xffff, 0xffbf, 0x07f8, 0xffc0, 0xffff, 0x3fbf, 0x07f8,
- 0xffc0, 0xffff, 0x07ff, 0x0ff8, 0xffc0, 0xffff, 0x003f, 0x0ff8,
- 0x7fe0, 0xf800, 0x0007, 0x0ff0, 0x3fe0, 0x0000, 0x0000, 0x07f0,
- 0x3fe0, 0x0000, 0x0000, 0x07f0, 0x3fe0, 0x0000, 0x0000, 0x07f4,
- 0x3fe0, 0x0000, 0x0000, 0x07e4, 0x3fe0, 0x0000, 0x0000, 0x07e4,
- 0x3fe0, 0x0000, 0x0000, 0x07e6, 0x3fe0, 0x0000, 0x0000, 0x07e7,
- 0x3fe0, 0x0000, 0x0000, 0x07e6, 0x3fe0, 0x0000, 0x0000, 0x07e6,
- 0x3fe0, 0x0000, 0x0000, 0x07e6, 0x3fc0, 0x0000, 0x7800, 0x07f6,
- 0xbfa0, 0x00ff, 0xff00, 0x07f7, 0x9f70, 0x01ff, 0xff80, 0x07ef,
- 0x1cf0, 0x0380, 0x01e0, 0x07ef, 0x1ff0, 0x07be, 0x3ff0, 0x07ee,
- 0x9de0, 0x1f83, 0xe1f8, 0x07dc, 0xc1e0, 0x1f7f, 0xfffc, 0x07c8,
- 0xc1e0, 0x1e69, 0xca7e, 0x03c0, 0x81e0, 0x1fb8, 0x0ec0, 0x03c0,
- 0x01e0, 0x1bc0, 0xcfc0, 0x03c1, 0x03c0, 0x11f7, 0x7f00, 0x03c0,
- 0x03c0, 0x187c, 0x1c00, 0x02c0, 0x02c0, 0x0830, 0x0000, 0x0340,
- 0x0340, 0x0800, 0x0000, 0x0240, 0x1340, 0x0c00, 0x0000, 0x0260,
- 0x1240, 0x0e00, 0x0000, 0x03c0, 0x3380, 0x0e80, 0x0000, 0x01a8,
- 0x3300, 0x0f40, 0x03a0, 0x002c, 0x7400, 0x0f30, 0x0738, 0x002e,
- 0x7400, 0x1f98, 0x1e1e, 0x002f, 0xfc00, 0xff8f, 0xfc0f, 0x002f,
- 0xf800, 0xffe3, 0xf803, 0x002f, 0xf800, 0xfffd, 0xff81, 0x003f,
- 0xb800, 0x1ff9, 0x0ff8, 0x001e, 0x3000, 0xf0f1, 0x030f, 0x000e,
- 0x3000, 0x01f1, 0x0180, 0x000f, 0x2000, 0xf7f1, 0x00ff, 0x0007,
- 0x6000, 0x01e3, 0x8060, 0x0007, 0x6000, 0xefc3, 0x803f, 0x0003,
- 0x4000, 0xffc2, 0xc00f, 0x0003, 0xc000, 0x1fe6, 0xc000, 0x0001,
- 0x8000, 0xfef4, 0xe03f, 0x0000, 0x8000, 0xfe79, 0xe01f, 0x0000,
- 0x01c0, 0x3e3d, 0x7000, 0x0000, 0x0630, 0x0f3e, 0x3800, 0x0000,
- 0x8cc8, 0x071f, 0x3800, 0x0000, 0xccf4, 0x078f, 0x1c00, 0x0000,
- 0xee72, 0x07f7, 0x0e00, 0x0000, 0xff02, 0x07e3, 0x0700, 0x0000,
- 0xfe32, 0xffc1, 0x038f, 0x0000, 0xfe3e, 0xff80, 0x01ff, 0x0000,
- 0x7c7e, 0x0000, 0x007e, 0x0000, 0x3c7c, 0x0000, 0x0000, 0x0000,
- 0x1cfc, 0x0000, 0x0000, 0x0000, 0x1cf8, 0x0000, 0x0000, 0x0000,
- 0x0ff0, 0x0000, 0x0000, 0x0000, 0x07e0, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000};
-
-
-
diff --git a/blt3.0.1/demos/busy1.tcl b/blt3.0.1/demos/busy1.tcl
deleted file mode 100755
index 268084c..0000000
--- a/blt3.0.1/demos/busy1.tcl
+++ /dev/null
@@ -1,242 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-set image [image create picture -file images/tan_paper.gif]
-#set normalBg [blt::bgpattern create tile -image $image]
-set normalBg [blt::bgpattern create texture -high grey95 -low grey90]
-set activeBg [blt::bgpattern create texture -high red1 -low red2]
-#set normalBg grey80
-#set normalBg grey80
-#set activeBg grey70
-
-#
-# Script to test the "busy" command.
-#
-
-#
-# General widget class resource attributes
-#
-option add *Button.padX 10
-option add *Button.padY 2
-option add *Scale.relief sunken
-#option add *Scale.orient horizontal
-option add *Entry.relief sunken
-option add *borderWidth 1
-
-set visual [winfo screenvisual .]
-if { $visual == "staticgray" || $visual == "grayscale" } {
- set activeBg black
- set normalBg white
- set bitmapFg black
- set bitmapBg white
- option add *f1.background white
-} else {
-# set activeBg red
- set bitmapFg blue
- set bitmapBg green
- option add *Button.background khaki2
- option add *Button.activeBackground khaki1
- option add *Frame.background khaki2
-
- option add *releaseButton.background limegreen
- option add *releaseButton.activeBackground springgreen
- option add *releaseButton.foreground black
-
- option add *holdButton.background red
- option add *holdButton.activeBackground pink
- option add *holdButton.foreground black
- option add *f1.background springgreen
-}
-
-#
-# Instance specific widget options
-#
-option add *f1.relief sunken
-option add *f1.background $normalBg
-option add *testButton.text "Test"
-option add *quitButton.text "Quit"
-option add *newButton.text "New\nButton"
-option add *holdButton.text "Hold"
-option add *releaseButton.text "Release"
-option add *buttonLabel.text "Buttons"
-option add *entryLabel.text "Entries"
-option add *scaleLabel.text "Scales"
-option add *textLabel.text "Text"
-
-bind keepRaised <Visibility> { raise %W }
-
-proc KeepRaised { w } {
- bindtags $w keepRaised
-}
-
-#
-# This never gets used; it's reset by the Animate proc. It's
-# here to just demonstrate how to set busy window options via
-# the host window path name
-#
-#option add *f1.busyCursor bogosity
-
-#
-# Counter for new buttons created by the "New button" button
-#
-set numWin 0
-
-#
-# Create two frames. The top frame will be the host window for the
-# busy window. It'll contain widgets to test the effectiveness of
-# the busy window. The bottom frame will contain buttons to
-# control the testing.
-#
-
-blt::tk::frame .f1 -bg $normalBg
-blt::tk::frame .f2 -bg $normalBg
-
-#
-# Create some widgets to test the busy window and its cursor
-#
-label .buttonLabel
- blt::tk::button .testButton -command {
- puts stdout "Not busy."
-}
-blt::tk::button .quitButton -command { exit }
-entry .entry
-scale .scale
-text .text -width 20 -height 4
-
-#
-# The following buttons sit in the lower frame to control the demo
-#
-blt::tk::button .newButton -command {
- global numWin
- incr numWin
- set name button#${numWin}
- blt::tk::button .f1.$name -text "$name" \
- -command [list .f1 configure -bg blue]
- blt::table .f1 \
- .f1.$name $numWin+3,0 -padx 10 -pady 10
-}
-
-blt::tk::button .holdButton -command {
- if { [blt::busy isbusy .f1] == "" } {
- global activeBg
- .f1 configure -bg $activeBg
- }
- blt::busy .f1
- focus -force .
-}
-
-blt::tk::button .releaseButton -command {
- if { [blt::busy isbusy .f1] == ".f1" } {
- blt::busy release .f1
- }
- global normalBg
- .f1 configure -bg $normalBg
-}
-
-#
-# Notice that the widgets packed in .f1 and .f2 are not their children
-#
-blt::table .f1 \
- 0,0 .testButton \
- 1,0 .scale -fill y \
- 0,1 .entry -fill x \
- 1,1 .text -fill both \
- 2,0 .quitButton -cspan 2
-
-blt::table .f2 \
- 0,0 .holdButton \
- 0,1 .releaseButton \
- 0,2 .newButton
-
-blt::table configure .f1 \
- .testButton .scale .entry .quitButton -padx 10 -pady 10
-blt::table configure .f2 \
- .newButton .holdButton .releaseButton -padx 10 -pady 4 -reqwidth 1.i
-
-blt::table configure .f1 r0 r2 -resize none
-blt::table configure .f2 r* -resize none
-
-#
-# Finally, realize and map the top level window
-#
-blt::table . \
- 0,0 .f1 -fill both \
- 1,0 .f2 -fill both
-
-blt::table configure . r1 -resize none
-
-blt::table configure .f1 c1 -weight 2.0
-
-# Initialize a list of bitmap file names which make up the animated
-# fish cursor. The bitmap mask files have a "m" appended to them.
-
-set bitmapList {
- left left1 mid right1 right
-}
-
-#
-# Simple cursor animation routine: Uses the "after" command to
-# circulate through a list of cursors every 0.075 seconds. The
-# first pass through the cursor list may appear sluggish because
-# the bitmaps have to be read from the disk. Tk's cursor cache
-# takes care of it afterwards.
-#
-proc StartAnimation { widget count } {
- global bitmapList
- set prefix bitmaps/fish/[lindex $bitmapList $count]
- set cursor [list @${prefix}.xbm ${prefix}m.xbm blue green ]
- blt::busy configure $widget -cursor $cursor
-
- incr count
- set limit [llength $bitmapList]
- if { $count >= $limit } {
- set count 0
- }
- global afterId
- set afterId($widget) [after 125 StartAnimation $widget $count]
-}
-
-proc StopAnimation { widget } {
- global afterId
- after cancel $afterId($widget)
-}
-
-proc TranslateBusy { window } {
- set widget [string trimright $window "_Busy"]
- if { $widget != "." } {
- set widget [string trimright $widget "."]
- }
- return $widget
-}
-
-if { [info exists tcl_platform] && $tcl_platform(platform) == "unix" } {
- bind Busy <Map> {
- StartAnimation [TranslateBusy %W] 0
- }
- bind Busy <Unmap> {
- StopAnimation [TranslateBusy %W]
- }
-}
-
-#
-# For testing, allow the top level window to be resized
-#
-wm min . 0 0
-
-#
-# Force the demo to stay raised
-#
-raise .
-KeepRaised .
-
-bind .f1 <Enter> { puts stderr "Entering %W" }
-bind .f1 <Leave> { puts stderr "Leaving %W" }
-bind .f1 <B1-Leave> { puts stderr "B1 Leaving %W" }
-bind .f1 <B1-Enter> { puts stderr "B1 Entering %W" }
-
-bind .f1 <Motion> { puts stderr "Motion %W" }
-
-.testButton configure -font "{San Serif} 6"
-puts stderr [.testButton configure]
diff --git a/blt3.0.1/demos/busy2.tcl b/blt3.0.1/demos/busy2.tcl
deleted file mode 100755
index f206b46..0000000
--- a/blt3.0.1/demos/busy2.tcl
+++ /dev/null
@@ -1,237 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-#source scripts/demo.tcl
-
-#
-# Script to test the "busy" command.
-#
-
-#
-# General widget class resource attributes
-#
-option add *Button.padX 10
-option add *Button.padY 2
-option add *Scale.relief sunken
-#option add *Scale.orient horizontal
-option add *Entry.relief sunken
-option add *Frame.borderWidth 2
-
-set visual [winfo screenvisual .]
-if { $visual == "staticgray" || $visual == "grayscale" } {
- set activeBg black
- set normalBg white
- set bitmapFg black
- set bitmapBg white
- option add *f1.background white
-} else {
- set activeBg red
- set normalBg springgreen
- set bitmapFg blue
- set bitmapBg green
- option add *Button.background khaki2
- option add *Button.activeBackground khaki1
- option add *Frame.background khaki2
- option add *f2.tile textureBg
-# option add *Button.tile textureBg
-
- option add *releaseButton.background limegreen
- option add *releaseButton.activeBackground springgreen
- option add *releaseButton.foreground black
-
- option add *holdButton.background red
- option add *holdButton.activeBackground pink
- option add *holdButton.foreground black
- option add *f1.background springgreen
-}
-
-#
-# Instance specific widget options
-#
-option add *f1.relief sunken
-option add *f1.background $normalBg
-option add *testButton.text "Test"
-option add *quitButton.text "Quit"
-option add *newButton.text "New button"
-option add *holdButton.text "Hold"
-option add *releaseButton.text "Release"
-option add *buttonLabel.text "Buttons"
-option add *entryLabel.text "Entries"
-option add *scaleLabel.text "Scales"
-option add *textLabel.text "Text"
-
-proc LoseFocus {} {
- focus -force .
-}
-proc KeepRaised { w } {
- bindtags $w keepRaised
-}
-
-bind keepRaised <Visibility> { raise %W }
-
-set file ./images/chalk.gif
-image create picture textureBg -file $file
-
-#
-# This never gets used; it's reset by the Animate proc. It's
-# here to just demonstrate how to set busy window options via
-# the host window path name
-#
-#option add *f1.busyCursor bogosity
-
-
-#
-# Counter for new buttons created by the "New button" button
-#
-set numWin 0
-
-menu .menu
-.menu add command -label "First"
-.menu add command -label "Second"
-.menu add command -label "Third"
-.menu add command -label "Fourth"
-. configure -menu .menu
-
-#
-# Create two frames. The top frame will be the host window for the
-# busy window. It'll contain widgets to test the effectiveness of
-# the busy window. The bottom frame will contain buttons to
-# control the testing.
-#
-frame .f1
-frame .f2
-
-#
-# Create some widgets to test the busy window and its cursor
-#
-label .buttonLabel
-button .testButton -command {
- puts stdout "Not busy."
-}
-button .quitButton -command { exit }
-entry .entry
-scale .scale
-text .text -width 20 -height 4
-
-#
-# The following buttons sit in the lower frame to control the demo
-#
-button .newButton -command {
- global numWin
- incr numWin
- set name button#${numWin}
- button .f1.$name -text "$name" \
- -command [list .f1 configure -bg blue]
- blt::table .f1 \
- .f1.$name $numWin+3,0 -padx 10 -pady 10
-}
-
-button .holdButton -command {
- if { [blt::busy isbusy .f1] == "" } {
- global activeBg
- .f1 configure -bg $activeBg
- }
- blt::busy .f1
- blt::busy .#menu
- LoseFocus
-}
-button .releaseButton -command {
- if { [blt::busy isbusy .f1] == ".f1" } {
- blt::busy release .f1
- blt::busy release .#menu
- }
- global normalBg
- .f1 configure -bg $normalBg
-}
-
-#
-# Notice that the widgets packed in .f1 and .f2 are not their children
-#
-blt::table .f1 \
- .testButton 0,0 \
- .scale 1,0 \
- .entry 0,1 \
- .text 1,1 -fill both \
- .quitButton 2,0
-
-blt::table .f2 \
- .newButton 0,0 \
- .holdButton 1,0 \
- .releaseButton 2,0
-
-blt::table configure .f1 .testButton .scale .entry .quitButton \
- -padx 10 -pady 10 -fill both
-blt::table configure .f2 .newButton .holdButton .releaseButton \
- -padx 10 -pady 10
-blt::table configure .f2 c0 -resize none
-#
-# Finally, realize and map the top level window
-#
-blt::table . \
- .f1 0,0 \
- .f2 1,0
-
-blt::table configure . .f1 .f2 -fill both
-# Initialize a list of bitmap file names which make up the animated
-# fish cursor. The bitmap mask files have a "m" appended to them.
-
-blt::table configure . r1 -resize none
-
-set bitmapList { left left1 mid right1 right }
-
-#
-# Simple cursor animation routine: Uses the "after" command to
-# circulate through a list of cursors every 0.075 seconds. The
-# first pass through the cursor list may appear sluggish because
-# the bitmaps have to be read from the disk. Tk's cursor cache
-# takes care of it afterwards.
-#
-proc StartAnimation { widget count } {
- global bitmapList
- set prefix "bitmaps/fish/[lindex $bitmapList $count]"
- set cursor [list @${prefix}.xbm ${prefix}m.xbm black white ]
- blt::busy configure $widget -cursor $cursor
-
- incr count
- set limit [llength $bitmapList]
- if { $count >= $limit } {
- set count 0
- }
- global afterId
- set afterId($widget) [after 125 StartAnimation $widget $count]
-}
-
-proc StopAnimation { widget } {
- global afterId
- after cancel $afterId($widget)
-}
-
-proc TranslateBusy { window } {
- #set widget [string trimright $window "_Busy"]
- set widget [string trimright $window "Busy"]
- set widget [string trimright $widget "_"]
-# if { [winfo toplevel $widget] != $widget } {
-# set widget [string trimright $widget "."]
-# }
- return $widget
-}
-
-if { [info exists tcl_platform] && $tcl_platform(platform) == "unix" } {
- bind Busy <Map> {
- StartAnimation [TranslateBusy %W] 0
- }
- bind Busy <Unmap> {
- StopAnimation [TranslateBusy %W]
- }
-}
-
-#
-# For testing, allow the top level window to be resized
-#
-wm min . 0 0
-
-#
-# Force the demo to stay raised
-#
-raise .
-KeepRaised .
diff --git a/blt3.0.1/demos/busy3.tcl b/blt3.0.1/demos/busy3.tcl
deleted file mode 100755
index ac7a1f2..0000000
--- a/blt3.0.1/demos/busy3.tcl
+++ /dev/null
@@ -1,250 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-#source scripts/demo.tcl
-
-set spcount 0
-#
-# Script to test the "busy" command.
-#
-
-#
-# General widget class resource attributes
-#
-option add *Button.padX 10
-option add *Button.padY 2
-option add *Scale.relief sunken
-#option add *Scale.orient horizontal
-option add *Entry.relief sunken
-option add *Frame.borderWidth 2
-
-set visual [winfo screenvisual .]
-if { $visual == "staticgray" || $visual == "grayscale" } {
- set activeBg black
- set normalBg white
- set bitmapFg black
- set bitmapBg white
- option add *f1.background white
-} else {
- set activeBg red
- set normalBg springgreen
- set bitmapFg blue
- set bitmapBg green
- option add *Button.background khaki2
- option add *Button.activeBackground khaki1
- option add *Frame.background khaki2
- option add *f2.tile textureBg
-# option add *Button.tile textureBg
-
- option add *releaseButton.background limegreen
- option add *releaseButton.activeBackground springgreen
- option add *releaseButton.foreground black
-
- option add *holdButton.background red
- option add *holdButton.activeBackground pink
- option add *holdButton.foreground black
- option add *f1.background springgreen
-}
-
-#
-# Instance specific widget options
-#
-option add *f1.relief sunken
-option add *f1.background $normalBg
-option add *testButton.text "Test"
-option add *quitButton.text "Quit"
-option add *newButton.text "New button"
-option add *holdButton.text "Hold"
-option add *releaseButton.text "Release"
-option add *buttonLabel.text "Buttons"
-option add *entryLabel.text "Entries"
-option add *scaleLabel.text "Scales"
-option add *textLabel.text "Text"
-
-proc LoseFocus {} {
- focus -force .
-}
-proc KeepRaised { w } {
- bindtags $w keepRaised
-}
-
-bind keepRaised <Visibility> { raise %W }
-
-set file ./images/chalk.gif
-image create picture textureBg -file $file
-
-#
-# This never gets used; it's reset by the Animate proc. It's
-# here to just demonstrate how to set busy window options via
-# the host window path name
-#
-#option add *f1.busyCursor bogosity
-
-
-#
-# Counter for new buttons created by the "New button" button
-#
-set numWin 0
-
-menu .menu
-.menu add command -label "First"
-.menu add command -label "Second"
-.menu add command -label "Third"
-.menu add command -label "Fourth"
-. configure -menu .menu
-
-#
-# Create two frames. The top frame will be the host window for the
-# busy window. It'll contain widgets to test the effectiveness of
-# the busy window. The bottom frame will contain buttons to
-# control the testing.
-#
-frame .f1
-frame .f2
-
-#
-# Create some widgets to test the busy window and its cursor
-#
-label .buttonLabel
-button .testButton -command {
- puts stdout "Not busy."
-}
-button .quitButton -command { exit }
-entry .entry
-scale .scale
-text .text -width 20 -height 4
-
-#
-# The following buttons sit in the lower frame to control the demo
-#
-button .newButton -command {
- global numWin
- incr numWin
- set name button#${numWin}
- button .f1.$name -text "$name" \
- -command [list .f1 configure -bg blue]
- blt::table .f1 \
- .f1.$name $numWin+3,0 -padx 10 -pady 10
-}
-
-set spinner [image create picture]
-
-button .holdButton -command {
- if { [blt::busy isbusy .f1] == "" } {
- global activeBg
- .f1 configure -bg $activeBg
- }
- blt::busy .f1 -opaque 1 -darken 50 -image $spinner
- blt::busy .#menu
- LoseFocus
-}
-button .releaseButton -command {
- if { [blt::busy isbusy .f1] == ".f1" } {
- blt::busy release .f1
- blt::busy release .#menu
- }
- global normalBg
- .f1 configure -bg $normalBg
-}
-
-#
-# Notice that the widgets packed in .f1 and .f2 are not their children
-#
-blt::table .f1 \
- .testButton 0,0 \
- .scale 1,0 \
- .entry 0,1 \
- .text 1,1 -fill both \
- .quitButton 2,0
-
-blt::table .f2 \
- .newButton 0,0 \
- .holdButton 1,0 \
- .releaseButton 2,0
-
-blt::table configure .f1 .testButton .scale .entry .quitButton \
- -padx 10 -pady 10 -fill both
-blt::table configure .f2 .newButton .holdButton .releaseButton \
- -padx 10 -pady 10
-blt::table configure .f2 c0 -resize none
-#
-# Finally, realize and map the top level window
-#
-blt::table . \
- .f1 0,0 \
- .f2 1,0
-
-blt::table configure . .f1 .f2 -fill both
-# Initialize a list of bitmap file names which make up the animated
-# fish cursor. The bitmap mask files have a "m" appended to them.
-
-blt::table configure . r1 -resize none
-
-set bitmapList { left left1 mid right1 right }
-
-#
-# Simple cursor animation routine: Uses the "after" command to
-# circulate through a list of cursors every 0.075 seconds. The
-# first pass through the cursor list may appear sluggish because
-# the bitmaps have to be read from the disk. Tk's cursor cache
-# takes care of it afterwards.
-#
-proc StartAnimation { widget count } {
- global bitmapList
- set prefix "bitmaps/fish/[lindex $bitmapList $count]"
- set cursor [list @${prefix}.xbm ${prefix}m.xbm black white ]
- blt::busy configure $widget -cursor $cursor
-
- incr count
- global spinner
- global spcount
- set file [format ~/spinner%02d.png [incr spcount]]
- $spinner configure -file $file
- blt::busy configure .f1 -image $spinner
- puts stderr "changing to picture $file"
- update
- if { $spcount >= 30 } {
- set spcount 0
- }
- set limit [llength $bitmapList]
- if { $count >= $limit } {
- set count 0
- }
- global afterId
- set afterId($widget) [after 125 StartAnimation $widget $count]
-}
-
-proc StopAnimation { widget } {
- global afterId
- after cancel $afterId($widget)
-}
-
-proc TranslateBusy { window } {
- #set widget [string trimright $window "_Busy"]
- set widget [string trimright $window "Busy"]
- set widget [string trimright $widget "_"]
-# if { [winfo toplevel $widget] != $widget } {
-# set widget [string trimright $widget "."]
-# }
- return $widget
-}
-
-if { [info exists tcl_platform] && $tcl_platform(platform) == "unix" } {
- bind Busy <Map> {
- StartAnimation [TranslateBusy %W] 0
- }
- bind Busy <Unmap> {
- StopAnimation [TranslateBusy %W]
- }
-}
-
-#
-# For testing, allow the top level window to be resized
-#
-wm min . 0 0
-
-#
-# Force the demo to stay raised
-#
-raise .
-KeepRaised .
diff --git a/blt3.0.1/demos/cbutton1.tcl b/blt3.0.1/demos/cbutton1.tcl
deleted file mode 100644
index 3f9be50..0000000
--- a/blt3.0.1/demos/cbutton1.tcl
+++ /dev/null
@@ -1,316 +0,0 @@
-
-foreach {key file} {
-save_as /usr/share/gtk-doc/html/pygtk/icons/stock_save_as_24.png
-new_tab /usr/share/gtk-doc/html/pygtk/icons/stock_new_24.png
-new_window /usr/share/gtk-doc/html/pygtk/icons/stock_network_24.png
-open_file /usr/share/gtk-doc/html/pygtk/icons/stock_open_24.png
-quit /usr/share/gtk-doc/html/pygtk/icons/stock_exit_24.png
-print /usr/share/gtk-doc/html/pygtk/icons/stock_print_24.png
-print_preview /usr/share/gtk-doc/html/pygtk/icons/stock_print_preview_24.png
-undo /usr/share/gtk-doc/html/pygtk/icons/stock_undo_24.png
-redo /usr/share/gtk-doc/html/pygtk/icons/stock_redo_24.png
-cut /usr/share/gtk-doc/html/pygtk/icons/stock_cut_24.png
-paste /usr/share/gtk-doc/html/pygtk/icons/stock_paste_24.png
-copy /usr/share/gtk-doc/html/pygtk/icons/stock_copy_24.png
-delete /usr/share/gtk-doc/html/pygtk/icons/stock_trash_24.png
-select_all /usr/share/gtk-doc/html/pygtk/icons/stock_broken_image_24.png
-find /usr/share/gtk-doc/html/pygtk/icons/stock_search_24.png
-preferences /usr/share/gtk-doc/html/pygtk/icons/stock_preferences_24.png
-stop /usr/share/gtk-doc/html/pygtk/icons/stock_stop_24.png
-reload /usr/share/gtk-doc/html/pygtk/icons/stock_refresh_24.png
-back /usr/share/gtk-doc/html/pygtk/icons/stock_left_arrow_24.png
-forward /usr/share/gtk-doc/html/pygtk/icons/stock_right_arrow_24.png
-home /usr/share/gtk-doc/html/pygtk/icons/stock_home_24.png
-help /usr/share/gtk-doc/html/pygtk/icons/stock_help_24.png
-about /usr/share/gtk-doc/html/pygtk/icons/stock_about_24.png
-download /usr/share/icons/gnome/24x24/emblems/emblem-downloads.png
-bookmark /usr/share/icons/gnome/24x24/stock/object/stock_bookmark.png
-} {
- set icon($key) [image create picture -file $file]
-}
-
-if { [file exists ../library] } {
- set blt_library ../library
-}
-
-set imgData {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
- ZTKAsiCtWq0JADs=
-}
-
-#set image [image create picture -file ~/images.jpeg]
-set bg [blt::bgpattern create gradient -high grey70 -low grey95 \
- -jitter yes -log yes -relativeto self]
-
-set image ""
-
-blt::tk::frame .mbar -bg $bg
-
-set t "Hello, World"
-blt::combobutton .mbar.file \
- -text "File" \
- -underline 0 \
- -image $image \
- -relief flat \
- -activerelief raised \
- -arrowon off \
- -bg $bg \
- -font { Arial 9 } -justify left \
- -menuanchor sw \
- -menu .mbar.file.m
-
-
-
-blt::combomenu .mbar.file.m \
- -width { 0 400 } -font "Arial 9" -acceleratorfont "Arial 9" \
- -bg grey85 -relief raised -bd 1
-.mbar.file.m add -text "New Window" -accelerator "Ctrl+N" -underline 0 \
- -icon $icon(new_window)
-.mbar.file.m add -text "New Tab" -accelerator "Ctrl+T" -underline 4 \
- -icon $icon(new_tab)
-.mbar.file.m add -text "Open Location..." -accelerator "Ctrl+L" -underline 5
-.mbar.file.m add -text "Open File..." -accelerator "Ctrl+O" -underline 0 \
- -icon $icon(open_file)
-.mbar.file.m add -text "Close Window" -accelerator "Ctrl+Shift+W" -underline 9
-.mbar.file.m add -text "Close Tab" -accelerator "Ctrl+W" -underline 0
-.mbar.file.m add -type separator
-.mbar.file.m add -text "Save Page As..." -accelerator "Ctrl+O" -underline 10 \
- -icon $icon(save_as)
-.mbar.file.m add -text "Save Page As PDF..." -accelerator "Ctrl+Shift+W" -underline 15
-.mbar.file.m add -text "Send Link..." -accelerator "Ctrl+W" -underline 1
-.mbar.file.m add -type separator
-.mbar.file.m add -text "Page Setup..." -underline 8
-.mbar.file.m add -text "Print Preview" -accelerator "Ctrl+Shift+W" -underline 9 \
- -icon $icon(print_preview)
-.mbar.file.m add -text "Print..." -accelerator "Ctrl+P" -underline 0 \
- -icon $icon(print)
-.mbar.file.m add -type separator
-.mbar.file.m add -text "Import..." -underline 0
-.mbar.file.m add -type separator
-.mbar.file.m add -text "Work Offline" -underline 0
-.mbar.file.m add -text "Quit" -accelerator "Ctrl+Q" -underline 0 \
- -icon $icon(quit)
-
-blt::combobutton .mbar.edit \
- -text "Edit" \
- -relief flat \
- -activerelief raised \
- -bg $bg \
- -font { Arial 9 } -justify left \
- -underline 0 \
- -arrowon no \
- -menuanchor nw \
- -menu .mbar.edit.m
-
-blt::combomenu .mbar.edit.m \
- -width { 0 400 } -font "Arial 9" -acceleratorfont "Arial 9" \
- -bg grey85 -relief raised -bd 1
-.mbar.edit.m add -text "Undo" -accelerator "Ctrl+Z" \
- -icon $icon(undo)
-.mbar.edit.m add -text "Redo" -accelerator "Ctrl+Shift+Z" \
- -icon $icon(redo)
-.mbar.edit.m add -type separator
-.mbar.edit.m add -text "Cut" -accelerator "Ctrl+X" \
- -icon $icon(cut)
-.mbar.edit.m add -text "Copy" -accelerator "Ctrl+C" \
- -icon $icon(copy)
-.mbar.edit.m add -text "Paste" -accelerator "Ctrl+V" \
- -icon $icon(paste)
-.mbar.edit.m add -text "Delete" -accelerator "Del" \
- -icon $icon(delete)
-.mbar.edit.m add -type separator
-.mbar.edit.m add -text "Select All" -accelerator "Ctrl+X" \
- -icon $icon(select_all)
-.mbar.edit.m add -type separator
-.mbar.edit.m add -text "Find" -accelerator "Ctrl+F" \
- -icon $icon(find)
-.mbar.edit.m add -text "Find Again" -accelerator "Ctrl+G"
-.mbar.edit.m add -type separator
-.mbar.edit.m add -text "Preferences" \
- -icon $icon(preferences)
-
-blt::combomenu .mbar.edit.m.m
-.mbar.edit.m.m add -type command -text "five" -accelerator "^A" -command "set t five"
-.mbar.edit.m.m add -type command -text "six" -accelerator "^B" -command "set t six"
-.mbar.edit.m.m add -type command -text "seven" -accelerator "^C" -command "set t seven"
-.mbar.edit.m.m add -type command -text "eight" -accelerator "^D" -command "set t eight"
-.mbar.edit.m.m add -type cascade -text "cascade" -accelerator "^E"
-
-
-blt::combobutton .mbar.view \
- -text "View" \
- -relief flat \
- -activerelief raised \
- -bg $bg \
- -font { Arial 9 } -justify left \
- -underline 0 \
- -arrowon no \
- -menuanchor nw \
- -menu .mbar.view.m
-
-blt::combomenu .mbar.view.m \
- -width { 0 600 } -font "Arial 9" -acceleratorfont "Arial 9" \
- -bg grey85 -relief raised -bd 1
-.mbar.view.m add -type cascade -text "Toolbars" -underline 0
-.mbar.view.m add -type checkbutton -text "Status Bar" \
- -underline 4 -variable statusbar
-.mbar.view.m add -type checkbutton -text "Sidebar" \
- -underline 5 -variable sidebar
-.mbar.view.m add -type checkbutton -text "Adblock Plus: Blockable items" \
- -accelerator "Ctrl+Shift+V" -underline 0 -variable adblock
-.mbar.view.m add -type separator
-.mbar.view.m add -text "Stop" -accelerator "Esc" -underline 9 \
- -icon $icon(stop)
-.mbar.view.m add -text "Reload" -accelerator "Ctrl+R" -underline 0 \
- -icon $icon(reload)
-.mbar.view.m add -type separator
-.mbar.view.m add -type cascade -text "Zoom" -accelerator "Ctrl+O" -underline 10
-.mbar.view.m add -type cascade -text "Page Style" -accelerator "Ctrl+Shift+W" \
- -underline 15
-.mbar.view.m add -type cascade -text "Character Encoding" -accelerator "Ctrl+W" \
- -underline 1
-.mbar.view.m add -type separator
-.mbar.view.m add -text "Page Source" -underline 8 -accelerator "Ctrl+U"
-.mbar.view.m add -text "Full Screen" -accelerator "F11" -underline 9
-
-
-blt::combobutton .mbar.history \
- -text "History" \
- -relief flat \
- -activerelief raised \
- -bg $bg \
- -font { Arial 9 } -justify left \
- -underline 0 \
- -arrowon no \
- -menuanchor nw \
- -menu .mbar.history.m
-
-blt::combomenu .mbar.history.m \
- -width { 0 600 } -font "Arial 9" -acceleratorfont "Arial 9" \
- -bg grey85 -relief raised -bd 1
-.mbar.history.m add -text "Back" -accelerator "Alt+Left Arrow" \
- -underline 0 -icon $icon(back)
-.mbar.history.m add -text "Forward" -accelerator "Alt+Right Arrow" \
- -underline 4 -icon $icon(forward)
-.mbar.history.m add -text "Home" -accelerator "Alt+Home" \
- -underline 5 -icon $icon(home)
-.mbar.history.m add -text "Show All History" -accelerator "Ctrl+Shift+H" \
- -underline 0
-.mbar.history.m add -type separator
-.mbar.history.m add -type cascade -text "Recently Closed Tabs" \
- -accelerator "Ctrl+O" -underline 10
-
-blt::combobutton .mbar.bmarks \
- -text "Bookmarks" \
- -relief flat \
- -activerelief raised \
- -bg $bg \
- -font { Arial 9 } -justify left \
- -underline 0 \
- -arrowon no \
- -menuanchor nw \
- -menu .mbar.bmarks.m
-
-blt::combomenu .mbar.bmarks.m \
- -width { 0 600 } -font "Arial 9" -acceleratorfont "Arial 9" \
- -bg grey85 -relief raised -bd 1
-.mbar.bmarks.m add -text "Bookmark This Page" -accelerator "Ctrl+D" \
- -underline 0 -icon $icon(bookmark)
-.mbar.bmarks.m add -text "Subscribe to This Page..." \
- -underline 4 -icon $icon(forward)
-.mbar.bmarks.m add -text "Bookmark All Tabs" \
- -underline 5 -icon $icon(home)
-.mbar.bmarks.m add -text "Organize Bookmarks" \
- -underline 0
-.mbar.bmarks.m add -type separator
-.mbar.bmarks.m add -type cascade -text "Bookmarks Toolbar" \
- -underline 10
-.mbar.bmarks.m add -type separator
-.mbar.bmarks.m add -type cascade -text "Recently Bookmarked" \
- -underline 10
-.mbar.bmarks.m add -type cascade -text "Recent Tags" \
- -underline 10
-.mbar.bmarks.m add -type separator
-.mbar.bmarks.m add -text "Page 1" \
- -underline 10
-.mbar.bmarks.m add -text "Page 2" \
- -underline 10
-
-blt::combobutton .mbar.tools \
- -text "Tools" \
- -relief flat \
- -activerelief raised \
- -bg $bg \
- -font { Arial 9 } -justify left \
- -underline 0 \
- -arrowon no \
- -menuanchor nw \
- -menu .mbar.tools.m
-
-blt::combomenu .mbar.tools.m \
- -width { 0 600 } -font "Arial 9" -acceleratorfont "Arial 9" \
- -bg grey85 -relief raised -bd 1
-.mbar.tools.m add -text "Web Search" -accelerator "Ctrl+K" \
- -underline 0
-.mbar.tools.m add -type separator
-.mbar.tools.m add -text "Downloads" -accelerator "Ctrl+Y" \
- -underline 4 -icon $icon(download)
-.mbar.tools.m add -text "Add-ons" -underline 0
-.mbar.tools.m add -type separator
-.mbar.tools.m add -text "PDF Download - Options" -underline 0
-.mbar.tools.m add -text "Save Images From Tabs" -underline 10
-.mbar.tools.m add -text "Error Console" \
- -accelerator "Ctrl+Shift+J" -underline 10
-.mbar.tools.m add -text "Adblock Plus Preferences..." \
- -accelerator "Ctrl+Shift+E" -underline 10
-.mbar.tools.m add -text "Page Info" \
- -accelerator "Ctrl+I" -underline 10
-.mbar.tools.m add -type separator
-.mbar.tools.m add -text "Clear Private Data" \
- -accelerator "Ctrl+Shift+Del" -underline 10
-.mbar.tools.m add -text "Batch Download Settings" \
- -underline 10
-
-blt::combobutton .mbar.help \
- -text "Help" \
- -relief flat \
- -activerelief raised \
- -bg $bg \
- -font { Arial 9 } -justify left \
- -underline 0 \
- -arrowon no \
- -menuanchor nw \
- -menu .mbar.help.m
-
-blt::combomenu .mbar.help.m \
- -width { 0 600 } -font "Arial 9" -acceleratorfont "Arial 9" \
- -bg grey85 -relief raised -bd 1
-.mbar.help.m add -text "Help Contents" \
- -underline 0 -icon $icon(help)
-.mbar.help.m add -text "Release Notes" -underline 0
-.mbar.help.m add -text "Report Broken Website..." -underline 5
-.mbar.help.m add -text "Report Web Forgery..." -underline 0
-.mbar.help.m add -type separator
-.mbar.help.m add -text "Check For Updates..." -underline 0
-.mbar.help.m add -text "About..." -underline 0 -icon $icon(about)
-
-canvas .c
-blt::table .mbar \
- 1,0 .mbar.file -fill both \
- 1,1 .mbar.edit -fill both \
- 1,2 .mbar.view -fill both \
- 1,3 .mbar.history -fill both \
- 1,4 .mbar.bmarks -fill both \
- 1,5 .mbar.tools -fill both \
- 1,6 .mbar.help -fill both \
-
-blt::table configure .mbar c* -padx 2 -resize none
-blt::table configure .mbar c7 -resize expand
-
-blt::table . \
- 0,0 .mbar -fill x \
- 1,0 .c -fill both
-
-blt::table configure . r0 -resize none
-blt::table configure . r1 -resize expand
diff --git a/blt3.0.1/demos/cbutton2.tcl b/blt3.0.1/demos/cbutton2.tcl
deleted file mode 100644
index c481c88..0000000
--- a/blt3.0.1/demos/cbutton2.tcl
+++ /dev/null
@@ -1,240 +0,0 @@
-
-set imgData {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
- ZTKAsiCtWq0JADs=
-}
-
-set icon2 [image create picture -file images/blt98.gif]
-set icon [image create picture -data $imgData]
-set bg [blt::bgpattern create gradient -high grey100 -low grey90 \
- -dir x -jitter yes -log yes -relativeto self]
-
-set image ""
-option add *ComboEntry.takeFocus 1
-
-if { [file exists ../library] } {
- set blt_library ../library
-}
-
-set myIcon ""
-blt::combobutton .b \
- -font { arial 10 } \
- -image $image \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -arrowon yes \
- -menu .b.m \
- -menuanchor se \
- -command "puts {button pressed}"
-
-blt::combomenu .b.m \
- -bg $bg \
- -cursor crosshair \
- -activebackground skyblue4 \
- -activeforeground white \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -font { Arial 9 bold } \
- -acceleratorfont { Arial 8 } \
- -disabledforeground grey35 \
- -disabledbackground grey85 \
- -disabledacceleratorforeground grey35 \
- -yscrollbar .b.m.ybar \
- -xscrollbar .b.m.xbar
-
-blt::tk::scrollbar .b.m.xbar
-# -elementborderwidth 2 -borderwidth 0
-blt::tk::scrollbar .b.m.ybar
-#-elementborderwidth 2 -borderwidth 0
-
-set onOff 0
-set wwho ""
-foreach item { Undo X1 Y1 Redo Cut Copy X2 Y2 Paste "Select All" X3 Y3
- Find Replace } {
- set char [string range $item 0 0]
- .b.m add \
- -text $item \
- -type checkbutton \
- -accel "Ctrl+$char" \
- -underline 0 \
- -tag [string tolower $char] \
- -icon $icon \
- -variable onOff \
- -value $item \
-
-}
-
-.b.m item configure Undo -type command
-.b.m item configure Cut -type command
-.b.m item configure Find -type cascade -menu .b.m.m
-#-state disabled
-.b.m item configure Y3 -type command -image $icon2
-.b.m item configure Undo -type command
-.b.m item configure Paste -type separator
-.b.m item configure x -state disabled
-.b.m item configure y -type radiobutton -variable wwho
-.b.m item configure Y1 -state disabled
-set wwho Y1
-blt::combomenu .b.m.m \
- -bg $bg \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -font { Arial 9 bold } \
- -acceleratorfont { Arial 8 } \
- -disabledforeground grey45 \
- -disabledbackground grey85 \
- -disabledacceleratorforeground grey45 \
- -width { 0 400 } \
- -height { 0 500 } \
- -yscrollbar .b.m.m.ybar \
- -xscrollbar .b.m.m.xbar
-
-blt::tk::scrollbar .b.m.m.xbar
-blt::tk::scrollbar .b.m.m.ybar
-
-set onOff 0
-foreach item { Undo X1 Y1 Redo Cut Copy X2 Y2 Paste "Select All" X3 Y3
- Find Replace } {
- set char [string range $item 0 0]
- .b.m.m add \
- -text $item \
- -type checkbutton \
- -accel "Ctrl+$char" \
- -accel "" \
- -underline 0 \
- -tag [string tolower $char] \
- -icon $icon \
- -variable onOff \
- -value $item \
-
-}
-
-.b.m.m item configure Undo -type command
-.b.m.m item configure Cut -type command
-.b.m.m item configure Find -type cascade -menu .b.m.m.m
-#-state disabled
-.b.m.m item configure Y3 -type command -image $icon2
-.b.m.m item configure Undo -type command
-.b.m.m item configure Paste -type separator
-.b.m.m item configure x -state disabled
-.b.m.m item configure y -type radiobutton -variable wwho
-
-set labels {
- Aarhus Aaron Ababa aback abaft abandon abandoned abandoning
- abandonment abandons abase abased abasement abasements abases
- abash abashed abashes abashing abasing abate abated abatement
- abatements abater abates abating Abba abbe abbey abbeys abbot
- abbots Abbott abbreviate abbreviated abbreviates abbreviating
- abbreviation abbreviations Abby abdomen abdomens abdominal
- abduct abducted abduction abductions abductor abductors abducts
- Abe abed Abel Abelian Abelson Aberdeen Abernathy aberrant
- aberration aberrations abet abets abetted abetter abetting
- abeyance abhor abhorred abhorrent abhorrer abhorring abhors
- abide abided abides abiding Abidjan Abigail Abilene abilities
- ability abject abjection abjections abjectly abjectness abjure
- abjured abjures abjuring ablate ablated ablates ablating
- ablation ablative ablaze able abler ablest ably Abner abnormal
- abnormalities abnormality abnormally Abo aboard abode abodes
- abolish abolished abolisher abolishers abolishes abolishing
- abolishment abolishments abolition abolitionist abolitionists
- abominable abominate aboriginal aborigine aborigines abort
- aborted aborting abortion abortions abortive abortively aborts
- Abos abound abounded abounding abounds about above aboveboard
- aboveground abovementioned abrade abraded abrades abrading
- Abraham Abram Abrams Abramson abrasion abrasions abrasive
- abreaction abreactions abreast abridge abridged abridges
- abridging abridgment abroad abrogate abrogated abrogates
- abrogating abrupt abruptly abruptness abscess abscessed
- abscesses abscissa abscissas abscond absconded absconding
- absconds absence absences absent absented absentee
- absenteeism absentees absentia absenting absently absentminded
- absents absinthe absolute absolutely absoluteness absolutes
- absolution absolve absolved absolves absolving absorb
- absorbed absorbency absorbent absorber absorbing absorbs
- absorption absorptions absorptive abstain abstained abstainer
- abstaining abstains abstention abstentions abstinence
- abstract abstracted abstracting abstraction abstractionism
- abstractionist abstractions abstractly abstractness
- abstractor abstractors abstracts abstruse abstruseness
- absurd absurdities absurdity absurdly Abu abundance abundant
- abundantly abuse abused abuses abusing abusive abut abutment
- abuts abutted abutter abutters abutting abysmal abysmally
- abyss abysses Abyssinia Abyssinian Abyssinians acacia
- academia academic academically academics academies academy
- Acadia Acapulco accede acceded accedes accelerate accelerated
- accelerates accelerating acceleration accelerations
- accelerator accelerators accelerometer accelerometers accent
- accented accenting accents accentual accentuate accentuated
- accentuates accentuating accentuation accept acceptability
- acceptable acceptably acceptance acceptances accepted
- accepter accepters accepting acceptor acceptors accepts
- access accessed accesses accessibility accessible accessibly
- accessing accession accessions accessories accessors
- accessory accident accidental accidentally accidently
- accidents acclaim acclaimed acclaiming acclaims acclamation
- acclimate acclimated acclimates acclimating acclimatization
- acclimatized accolade accolades accommodate accommodated
- accommodates accommodating accommodation accommodations
- accompanied accompanies accompaniment accompaniments
- accompanist accompanists accompany accompanying accomplice
- accomplices accomplish accomplished accomplisher accomplishers
- accomplishes accomplishing accomplishment accomplishments
- accord accordance accorded accorder accorders according
- accordingly accordion accordions accords accost accosted
- accosting accosts account accountability accountable accountably
- accountancy accountant accountants accounted accounting
- accounts Accra accredit accreditation accreditations
- accredited accretion accretions accrue accrued accrues
- accruing acculturate acculturated acculturates acculturating
- acculturation accumulate accumulated accumulates accumulating
- accumulation accumulations accumulator accumulators
- accuracies accuracy accurate accurately accurateness accursed
- accusal accusation accusations accusative accuse accused
- accuser accuses accusing accusingly accustom accustomed
- accustoming accustoms ace aces acetate acetone acetylene
- Achaean Achaeans ache ached aches achievable achieve achieved
- achievement achievements achiever achievers achieves achieving
- Achilles aching acid acidic acidities acidity acidly acids
- acidulous Ackerman Ackley acknowledge acknowledgeable
- acknowledged acknowledgement acknowledgements acknowledger
- acknowledgers acknowledges acknowledging acknowledgment
- acknowledgments acme acne acolyte acolytes acorn acorns
- acoustic acoustical acoustically acoustician acoustics
- acquaint acquaintance acquaintances acquainted acquainting
- acquaints acquiesce acquiesced acquiescence acquiescent
- acquiesces acquiescing acquirable acquire acquired acquires
- acquiring acquisition acquisitions
-}
-
-blt::combomenu .b.m.m.m \
- -bg $bg \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -font { Arial 9 bold } \
- -acceleratorfont { Arial 8 } \
- -disabledforeground grey45 \
- -disabledbackground grey85 \
- -disabledacceleratorforeground grey45 \
- -width { 0 400 } \
- -height { 0 500 } \
- -yscrollbar .b.m.m.m.ybar \
- -xscrollbar .b.m.m.m.xbar
-
-.b.m.m.m listadd $labels \
- -icon $icon
-
-blt::tk::scrollbar .b.m.m.m.xbar
-blt::tk::scrollbar .b.m.m.m.ybar
-
-blt::tk::scrollbar .s -orient vertical -command { .b xview }
-
-bind ComboEntry <3> {
- grab release [grab current]
-}
-
-blt::table . \
- 0,0 .b -fill both
-
-blt::table configure . r0 -resize shrink
-
diff --git a/blt3.0.1/demos/cbutton3.tcl b/blt3.0.1/demos/cbutton3.tcl
deleted file mode 100644
index 727d307..0000000
--- a/blt3.0.1/demos/cbutton3.tcl
+++ /dev/null
@@ -1,802 +0,0 @@
-set colors {
- 000000 black
- 000000 gray0
- 000000 grey0
- 000080 NavyBlue
- 000080 navy
- 000080 {navy blue}
- 00008B DarkBlue
- 00008B blue4
- 00008B {dark blue}
- 0000CD MediumBlue
- 0000CD blue3
- 0000CD {medium blue}
- 0000EE blue2
- 0000FF blue
- 0000FF blue1
- 006400 DarkGreen
- 006400 {dark green}
- 00688B DeepSkyBlue4
- 00868B turquoise4
- 008B00 green4
- 008B45 SpringGreen4
- 008B8B DarkCyan
- 008B8B cyan4
- 008B8B {dark cyan}
- 009ACD DeepSkyBlue3
- 00B2EE DeepSkyBlue2
- 00BFFF DeepSkyBlue
- 00BFFF DeepSkyBlue1
- 00BFFF {deep sky blue}
- 00C5CD turquoise3
- 00CD00 green3
- 00CD66 SpringGreen3
- 00CDCD cyan3
- 00CED1 DarkTurquoise
- 00CED1 {dark turquoise}
- 00E5EE turquoise2
- 00EE00 green2
- 00EE76 SpringGreen2
- 00EEEE cyan2
- 00F5FF turquoise1
- 00FA9A MediumSpringGreen
- 00FA9A {medium spring green}
- 00FF00 green
- 00FF00 green1
- 00FF7F SpringGreen
- 00FF7F SpringGreen1
- 00FF7F {spring green}
- 00FFFF cyan
- 00FFFF cyan1
- 030303 gray1
- 030303 grey1
- 050505 gray2
- 050505 grey2
- 080808 gray3
- 080808 grey3
- 0A0A0A gray4
- 0A0A0A grey4
- 0D0D0D gray5
- 0D0D0D grey5
- 0F0F0F gray6
- 0F0F0F grey6
- 104E8B DodgerBlue4
- 121212 gray7
- 121212 grey7
- 141414 gray8
- 141414 grey8
- 171717 gray9
- 171717 grey9
- 1874CD DodgerBlue3
- 191970 MidnightBlue
- 191970 {midnight blue}
- 1A1A1A gray10
- 1A1A1A grey10
- 1C1C1C gray11
- 1C1C1C grey11
- 1C86EE DodgerBlue2
- 1E90FF DodgerBlue
- 1E90FF DodgerBlue1
- 1E90FF {dodger blue}
- 1F1F1F gray12
- 1F1F1F grey12
- 20B2AA LightSeaGreen
- 20B2AA {light sea green}
- 212121 gray13
- 212121 grey13
- 228B22 ForestGreen
- 228B22 {forest green}
- 242424 gray14
- 242424 grey14
- 262626 gray15
- 262626 grey15
- 27408B RoyalBlue4
- 292929 gray16
- 292929 grey16
- 2B2B2B gray17
- 2B2B2B grey17
- 2E2E2E gray18
- 2E2E2E grey18
- 2E8B57 SeaGreen
- 2E8B57 SeaGreen4
- 2E8B57 {sea green}
- 2F4F4F DarkSlateGray
- 2F4F4F DarkSlateGrey
- 2F4F4F {dark slate gray}
- 2F4F4F {dark slate grey}
- 303030 gray19
- 303030 grey19
- 32CD32 LimeGreen
- 32CD32 {lime green}
- 333333 gray20
- 333333 grey20
- 363636 gray21
- 363636 grey21
- 36648B SteelBlue4
- 383838 gray22
- 383838 grey22
- 3A5FCD RoyalBlue3
- 3B3B3B gray23
- 3B3B3B grey23
- 3CB371 MediumSeaGreen
- 3CB371 {medium sea green}
- 3D3D3D gray24
- 3D3D3D grey24
- 404040 gray25
- 404040 grey25
- 40E0D0 turquoise
- 4169E1 RoyalBlue
- 4169E1 {royal blue}
- 424242 gray26
- 424242 grey26
- 436EEE RoyalBlue2
- 43CD80 SeaGreen3
- 454545 gray27
- 454545 grey27
- 458B00 chartreuse4
- 458B74 aquamarine4
- 4682B4 SteelBlue
- 4682B4 {steel blue}
- 473C8B SlateBlue4
- 474747 gray28
- 474747 grey28
- 483D8B DarkSlateBlue
- 483D8B {dark slate blue}
- 4876FF RoyalBlue1
- 48D1CC MediumTurquoise
- 48D1CC {medium turquoise}
- 4A4A4A gray29
- 4A4A4A grey29
- 4A708B SkyBlue4
- 4D4D4D gray30
- 4D4D4D grey30
- 4EEE94 SeaGreen2
- 4F4F4F gray31
- 4F4F4F grey31
- 4F94CD SteelBlue3
- 525252 gray32
- 525252 grey32
- 528B8B DarkSlateGray4
- 53868B CadetBlue4
- 545454 gray33
- 545454 grey33
- 548B54 PaleGreen4
- 54FF9F SeaGreen1
- 551A8B purple4
- 556B2F DarkOliveGreen
- 556B2F {dark olive green}
- 575757 gray34
- 575757 grey34
- 595959 gray35
- 595959 grey35
- 5C5C5C gray36
- 5C5C5C grey36
- 5CACEE SteelBlue2
- 5D478B MediumPurple4
- 5E5E5E gray37
- 5E5E5E grey37
- 5F9EA0 CadetBlue
- 5F9EA0 {cadet blue}
- 607B8B LightSkyBlue4
- 616161 gray38
- 616161 grey38
- 636363 gray39
- 636363 grey39
- 63B8FF SteelBlue1
- 6495ED CornflowerBlue
- 6495ED {cornflower blue}
- 666666 gray40
- 666666 grey40
- 668B8B PaleTurquoise4
- 66CD00 chartreuse3
- 66CDAA MediumAquamarine
- 66CDAA aquamarine3
- 66CDAA {medium aquamarine}
- 68228B DarkOrchid4
- 68838B LightBlue4
- 6959CD SlateBlue3
- 696969 DimGray
- 696969 DimGrey
- 696969 gray41
- 696969 grey41
- 696969 {dim gray}
- 696969 {dim grey}
- 698B22 OliveDrab4
- 698B69 DarkSeaGreen4
- 6A5ACD SlateBlue
- 6A5ACD {slate blue}
- 6B6B6B gray42
- 6B6B6B grey42
- 6B8E23 OliveDrab
- 6B8E23 {olive drab}
- 6C7B8B SlateGray4
- 6CA6CD SkyBlue3
- 6E6E6E gray43
- 6E6E6E grey43
- 6E7B8B LightSteelBlue4
- 6E8B3D DarkOliveGreen4
- 707070 gray44
- 707070 grey44
- 708090 SlateGray
- 708090 SlateGrey
- 708090 {slate gray}
- 708090 {slate grey}
- 737373 gray45
- 737373 grey45
- 757575 gray46
- 757575 grey46
- 76EE00 chartreuse2
- 76EEC6 aquamarine2
- 778899 LightSlateGray
- 778899 LightSlateGrey
- 778899 {light slate gray}
- 778899 {light slate grey}
- 787878 gray47
- 787878 grey47
- 79CDCD DarkSlateGray3
- 7A378B MediumOrchid4
- 7A67EE SlateBlue2
- 7A7A7A gray48
- 7A7A7A grey48
- 7A8B8B LightCyan4
- 7AC5CD CadetBlue3
- 7B68EE MediumSlateBlue
- 7B68EE {medium slate blue}
- 7CCD7C PaleGreen3
- 7CFC00 LawnGreen
- 7CFC00 {lawn green}
- 7D26CD purple3
- 7D7D7D gray49
- 7D7D7D grey49
- 7EC0EE SkyBlue2
- 7F7F7F gray50
- 7F7F7F grey50
- 7FFF00 chartreuse
- 7FFF00 chartreuse1
- 7FFFD4 aquamarine
- 7FFFD4 aquamarine1
- 828282 gray51
- 828282 grey51
- 836FFF SlateBlue1
- 838B83 honeydew4
- 838B8B azure4
- 8470FF LightSlateBlue
- 8470FF {light slate blue}
- 858585 gray52
- 858585 grey52
- 878787 gray53
- 878787 grey53
- 87CEEB SkyBlue
- 87CEEB {sky blue}
- 87CEFA LightSkyBlue
- 87CEFA {light sky blue}
- 87CEFF SkyBlue1
- 8968CD MediumPurple3
- 8A2BE2 BlueViolet
- 8A2BE2 {blue violet}
- 8A8A8A gray54
- 8A8A8A grey54
- 8B0000 DarkRed
- 8B0000 red4
- 8B0000 {dark red}
- 8B008B DarkMagenta
- 8B008B magenta4
- 8B008B {dark magenta}
- 8B0A50 DeepPink4
- 8B1A1A firebrick4
- 8B1C62 maroon4
- 8B2252 VioletRed4
- 8B2323 brown4
- 8B2500 OrangeRed4
- 8B3626 tomato4
- 8B3A3A IndianRed4
- 8B3A62 HotPink4
- 8B3E2F coral4
- 8B4500 DarkOrange4
- 8B4513 SaddleBrown
- 8B4513 chocolate4
- 8B4513 {saddle brown}
- 8B4726 sienna4
- 8B475D PaleVioletRed4
- 8B4789 orchid4
- 8B4C39 salmon4
- 8B5742 LightSalmon4
- 8B5A00 orange4
- 8B5A2B tan4
- 8B5F65 LightPink4
- 8B636C pink4
- 8B6508 DarkGoldenrod4
- 8B668B plum4
- 8B6914 goldenrod4
- 8B6969 RosyBrown4
- 8B7355 burlywood4
- 8B7500 gold4
- 8B7765 PeachPuff4
- 8B795E NavajoWhite4
- 8B7B8B thistle4
- 8B7D6B bisque4
- 8B7D7B MistyRose4
- 8B7E66 wheat4
- 8B814C LightGoldenrod4
- 8B8378 AntiqueWhite4
- 8B8386 LavenderBlush4
- 8B864E khaki4
- 8B8682 seashell4
- 8B8878 cornsilk4
- 8B8970 LemonChiffon4
- 8B8989 snow4
- 8B8B00 yellow4
- 8B8B7A LightYellow4
- 8B8B83 ivory4
- 8C8C8C gray55
- 8C8C8C grey55
- 8DB6CD LightSkyBlue3
- 8DEEEE DarkSlateGray2
- 8EE5EE CadetBlue2
- 8F8F8F gray56
- 8F8F8F grey56
- 8FBC8F DarkSeaGreen
- 8FBC8F {dark sea green}
- 90EE90 LightGreen
- 90EE90 PaleGreen2
- 90EE90 {light green}
- 912CEE purple2
- 919191 gray57
- 919191 grey57
- 9370DB MediumPurple
- 9370DB {medium purple}
- 9400D3 DarkViolet
- 9400D3 {dark violet}
- 949494 gray58
- 949494 grey58
- 969696 gray59
- 969696 grey59
- 96CDCD PaleTurquoise3
- 97FFFF DarkSlateGray1
- 98F5FF CadetBlue1
- 98FB98 PaleGreen
- 98FB98 {pale green}
- 9932CC DarkOrchid
- 9932CC {dark orchid}
- 999999 gray60
- 999999 grey60
- 9A32CD DarkOrchid3
- 9AC0CD LightBlue3
- 9ACD32 OliveDrab3
- 9ACD32 YellowGreen
- 9ACD32 {yellow green}
- 9AFF9A PaleGreen1
- 9B30FF purple1
- 9BCD9B DarkSeaGreen3
- 9C9C9C gray61
- 9C9C9C grey61
- 9E9E9E gray62
- 9E9E9E grey62
- 9F79EE MediumPurple2
- 9FB6CD SlateGray3
- A020F0 purple
- A0522D sienna
- A1A1A1 gray63
- A1A1A1 grey63
- A2B5CD LightSteelBlue3
- A2CD5A DarkOliveGreen3
- A3A3A3 gray64
- A3A3A3 grey64
- A4D3EE LightSkyBlue2
- A52A2A brown
- A6A6A6 gray65
- A6A6A6 grey65
- A8A8A8 gray66
- A8A8A8 grey66
- A9A9A9 DarkGray
- A9A9A9 DarkGrey
- A9A9A9 {dark gray}
- A9A9A9 {dark grey}
- AB82FF MediumPurple1
- ABABAB gray67
- ABABAB grey67
- ADADAD gray68
- ADADAD grey68
- ADD8E6 LightBlue
- ADD8E6 {light blue}
- ADFF2F GreenYellow
- ADFF2F {green yellow}
- AEEEEE PaleTurquoise2
- AFEEEE PaleTurquoise
- AFEEEE {pale turquoise}
- B03060 maroon
- B0B0B0 gray69
- B0B0B0 grey69
- B0C4DE LightSteelBlue
- B0C4DE {light steel blue}
- B0E0E6 PowderBlue
- B0E0E6 {powder blue}
- B0E2FF LightSkyBlue1
- B22222 firebrick
- B23AEE DarkOrchid2
- B2DFEE LightBlue2
- B3B3B3 gray70
- B3B3B3 grey70
- B3EE3A OliveDrab2
- B452CD MediumOrchid3
- B4CDCD LightCyan3
- B4EEB4 DarkSeaGreen2
- B5B5B5 gray71
- B5B5B5 grey71
- B8860B DarkGoldenrod
- B8860B {dark goldenrod}
- B8B8B8 gray72
- B8B8B8 grey72
- B9D3EE SlateGray2
- BA55D3 MediumOrchid
- BA55D3 {medium orchid}
- BABABA gray73
- BABABA grey73
- BBFFFF PaleTurquoise1
- BC8F8F RosyBrown
- BC8F8F {rosy brown}
- BCD2EE LightSteelBlue2
- BCEE68 DarkOliveGreen2
- BDB76B DarkKhaki
- BDB76B {dark khaki}
- BDBDBD gray74
- BDBDBD grey74
- BEBEBE gray
- BEBEBE grey
- BF3EFF DarkOrchid1
- BFBFBF gray75
- BFBFBF grey75
- BFEFFF LightBlue1
- C0FF3E OliveDrab1
- C1CDC1 honeydew3
- C1CDCD azure3
- C1FFC1 DarkSeaGreen1
- C2C2C2 gray76
- C2C2C2 grey76
- C4C4C4 gray77
- C4C4C4 grey77
- C6E2FF SlateGray1
- C71585 MediumVioletRed
- C71585 {medium violet red}
- C7C7C7 gray78
- C7C7C7 grey78
- C9C9C9 gray79
- C9C9C9 grey79
- CAE1FF LightSteelBlue1
- CAFF70 DarkOliveGreen1
- CCCCCC gray80
- CCCCCC grey80
- CD0000 red3
- CD00CD magenta3
- CD1076 DeepPink3
- CD2626 firebrick3
- CD2990 maroon3
- CD3278 VioletRed3
- CD3333 brown3
- CD3700 OrangeRed3
- CD4F39 tomato3
- CD5555 IndianRed3
- CD5B45 coral3
- CD5C5C IndianRed
- CD5C5C {indian red}
- CD6090 HotPink3
- CD6600 DarkOrange3
- CD661D chocolate3
- CD6839 sienna3
- CD6889 PaleVioletRed3
- CD69C9 orchid3
- CD7054 salmon3
- CD8162 LightSalmon3
- CD8500 orange3
- CD853F peru
- CD853F tan3
- CD8C95 LightPink3
- CD919E pink3
- CD950C DarkGoldenrod3
- CD96CD plum3
- CD9B1D goldenrod3
- CD9B9B RosyBrown3
- CDAA7D burlywood3
- CDAD00 gold3
- CDAF95 PeachPuff3
- CDB38B NavajoWhite3
- CDB5CD thistle3
- CDB79E bisque3
- CDB7B5 MistyRose3
- CDBA96 wheat3
- CDBE70 LightGoldenrod3
- CDC0B0 AntiqueWhite3
- CDC1C5 LavenderBlush3
- CDC5BF seashell3
- CDC673 khaki3
- CDC8B1 cornsilk3
- CDC9A5 LemonChiffon3
- CDC9C9 snow3
- CDCD00 yellow3
- CDCDB4 LightYellow3
- CDCDC1 ivory3
- CFCFCF gray81
- CFCFCF grey81
- D02090 VioletRed
- D02090 {violet red}
- D15FEE MediumOrchid2
- D1D1D1 gray82
- D1D1D1 grey82
- D1EEEE LightCyan2
- D2691E chocolate
- D2B48C tan
- D3D3D3 LightGray
- D3D3D3 LightGrey
- D3D3D3 {light gray}
- D3D3D3 {light grey}
- D4D4D4 gray83
- D4D4D4 grey83
- D6D6D6 gray84
- D6D6D6 grey84
- D8BFD8 thistle
- D9D9D9 gray85
- D9D9D9 grey85
- DA70D6 orchid
- DAA520 goldenrod
- DB7093 PaleVioletRed
- DB7093 {pale violet red}
- DBDBDB gray86
- DBDBDB grey86
- DCDCDC gainsboro
- DDA0DD plum
- DEB887 burlywood
- DEDEDE gray87
- DEDEDE grey87
- E066FF MediumOrchid1
- E0E0E0 gray88
- E0E0E0 grey88
- E0EEE0 honeydew2
- E0EEEE azure2
- E0FFFF LightCyan
- E0FFFF LightCyan1
- E0FFFF {light cyan}
- E3E3E3 gray89
- E3E3E3 grey89
- E5E5E5 gray90
- E5E5E5 grey90
- E6E6FA lavender
- E8E8E8 gray91
- E8E8E8 grey91
- E9967A DarkSalmon
- E9967A {dark salmon}
- EBEBEB gray92
- EBEBEB grey92
- EDEDED gray93
- EDEDED grey93
- EE0000 red2
- EE00EE magenta2
- EE1289 DeepPink2
- EE2C2C firebrick2
- EE30A7 maroon2
- EE3A8C VioletRed2
- EE3B3B brown2
- EE4000 OrangeRed2
- EE5C42 tomato2
- EE6363 IndianRed2
- EE6A50 coral2
- EE6AA7 HotPink2
- EE7600 DarkOrange2
- EE7621 chocolate2
- EE7942 sienna2
- EE799F PaleVioletRed2
- EE7AE9 orchid2
- EE8262 salmon2
- EE82EE violet
- EE9572 LightSalmon2
- EE9A00 orange2
- EE9A49 tan2
- EEA2AD LightPink2
- EEA9B8 pink2
- EEAD0E DarkGoldenrod2
- EEAEEE plum2
- EEB422 goldenrod2
- EEB4B4 RosyBrown2
- EEC591 burlywood2
- EEC900 gold2
- EECBAD PeachPuff2
- EECFA1 NavajoWhite2
- EED2EE thistle2
- EED5B7 bisque2
- EED5D2 MistyRose2
- EED8AE wheat2
- EEDC82 LightGoldenrod2
- EEDD82 LightGoldenrod
- EEDD82 {light goldenrod}
- EEDFCC AntiqueWhite2
- EEE0E5 LavenderBlush2
- EEE5DE seashell2
- EEE685 khaki2
- EEE8AA PaleGoldenrod
- EEE8AA {pale goldenrod}
- EEE8CD cornsilk2
- EEE9BF LemonChiffon2
- EEE9E9 snow2
- EEEE00 yellow2
- EEEED1 LightYellow2
- EEEEE0 ivory2
- F08080 LightCoral
- F08080 {light coral}
- F0E68C khaki
- F0F0F0 gray94
- F0F0F0 grey94
- F0F8FF AliceBlue
- F0F8FF {alice blue}
- F0FFF0 honeydew
- F0FFF0 honeydew1
- F0FFFF azure
- F0FFFF azure1
- F2F2F2 gray95
- F2F2F2 grey95
- F4A460 SandyBrown
- F4A460 {sandy brown}
- F5DEB3 wheat
- F5F5DC beige
- F5F5F5 WhiteSmoke
- F5F5F5 gray96
- F5F5F5 grey96
- F5F5F5 {white smoke}
- F5FFFA MintCream
- F5FFFA {mint cream}
- F7F7F7 gray97
- F7F7F7 grey97
- F8F8FF GhostWhite
- F8F8FF {ghost white}
- FA8072 salmon
- FAEBD7 AntiqueWhite
- FAEBD7 {antique white}
- FAF0E6 linen
- FAFAD2 LightGoldenrodYellow
- FAFAD2 {light goldenrod yellow}
- FAFAFA gray98
- FAFAFA grey98
- FCFCFC gray99
- FCFCFC grey99
- FDF5E6 OldLace
- FDF5E6 {old lace}
- FF0000 red
- FF0000 red1
- FF00FF magenta
- FF00FF magenta1
- FF1493 DeepPink
- FF1493 DeepPink1
- FF1493 {deep pink}
- FF3030 firebrick1
- FF34B3 maroon1
- FF3E96 VioletRed1
- FF4040 brown1
- FF4500 OrangeRed
- FF4500 OrangeRed1
- FF4500 {orange red}
- FF6347 tomato
- FF6347 tomato1
- FF69B4 HotPink
- FF69B4 {hot pink}
- FF6A6A IndianRed1
- FF6EB4 HotPink1
- FF7256 coral1
- FF7F00 DarkOrange1
- FF7F24 chocolate1
- FF7F50 coral
- FF8247 sienna1
- FF82AB PaleVioletRed1
- FF83FA orchid1
- FF8C00 DarkOrange
- FF8C00 {dark orange}
- FF8C69 salmon1
- FFA07A LightSalmon
- FFA07A LightSalmon1
- FFA07A {light salmon}
- FFA500 orange
- FFA500 orange1
- FFA54F tan1
- FFAEB9 LightPink1
- FFB5C5 pink1
- FFB6C1 LightPink
- FFB6C1 {light pink}
- FFB90F DarkGoldenrod1
- FFBBFF plum1
- FFC0CB pink
- FFC125 goldenrod1
- FFC1C1 RosyBrown1
- FFD39B burlywood1
- FFD700 gold
- FFD700 gold1
- FFDAB9 PeachPuff
- FFDAB9 PeachPuff1
- FFDAB9 {peach puff}
- FFDEAD NavajoWhite
- FFDEAD NavajoWhite1
- FFDEAD {navajo white}
- FFE1FF thistle1
- FFE4B5 moccasin
- FFE4C4 bisque
- FFE4C4 bisque1
- FFE4E1 MistyRose
- FFE4E1 MistyRose1
- FFE4E1 {misty rose}
- FFE7BA wheat1
- FFEBCD BlanchedAlmond
- FFEBCD {blanched almond}
- FFEC8B LightGoldenrod1
- FFEFD5 PapayaWhip
- FFEFD5 {papaya whip}
- FFEFDB AntiqueWhite1
- FFF0F5 LavenderBlush
- FFF0F5 LavenderBlush1
- FFF0F5 {lavender blush}
- FFF5EE seashell
- FFF5EE seashell1
- FFF68F khaki1
- FFF8DC cornsilk
- FFF8DC cornsilk1
- FFFACD LemonChiffon
- FFFACD LemonChiffon1
- FFFACD {lemon chiffon}
- FFFAF0 FloralWhite
- FFFAF0 {floral white}
- FFFAFA snow
- FFFAFA snow1
- FFFF00 yellow
- FFFF00 yellow1
- FFFFE0 LightYellow
- FFFFE0 LightYellow1
- FFFFE0 {light yellow}
- FFFFF0 ivory
- FFFFF0 ivory1
- FFFFFF gray100
- FFFFFF grey100
- FFFFFF white
-}
-
-if { [file exists ../library] } {
- set blt_library ../library
-}
-
-set bg [blt::bgpattern create gradient -low grey100 -high grey90 \
- -dir y -jitter yes -log yes -relativeto toplevel]
-set bg white
-set myIcon ""
-blt::combobutton .b \
- -font { arial 10 bold } \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -borderwidth 2 \
- -highlightthickness 1 \
- -arrowon yes \
- -menu .b.m
-
-blt::table . \
- 0,0 .b -fill both
-
-
-blt::combomenu .b.m \
- -textvariable myText1 \
- -height 400 \
- -background $bg \
- -iconvariable myIcon1 \
- -font { Arial 9 bold } \
- -acceleratorfont { Arial 8 } \
- -yscrollbar .b.m.ybar \
- -xscrollbar .b.m.xbar
-
-blt::tk::scrollbar .b.m.xbar
-blt::tk::scrollbar .b.m.ybar
-
-set bg [image create picture -width 30 -height 20]
-$bg blank 0x0000000
-$bg draw rectangle 5 5 14 26 -color 0xFF00000
-$bg blur $bg 4
-
-foreach {rgb name} $colors {
- set icon [image create picture -width 25 -height 25]
- $icon blank 0x00000000
- $icon draw circle 11 11 9 -fill \#$rgb -antialias yes \
- -outline black -linewidth 1 -shadow 2
- #$icon draw circle 10 10 2 -color black -antialias yes
- .b.m add -text $name -icon $icon
-}
diff --git a/blt3.0.1/demos/centry1.tcl b/blt3.0.1/demos/centry1.tcl
deleted file mode 100644
index 49a17af..0000000
--- a/blt3.0.1/demos/centry1.tcl
+++ /dev/null
@@ -1,95 +0,0 @@
-
-package require BLT
-
-set imgData {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
- ZTKAsiCtWq0JADs=
-}
-
-#set icon [image create picture -data $imgData]
-set icon [image create picture -file images/mini-book1.gif]
-#set icon [image create picture -file images/blt98.gif]
-#set image [image create picture -file ~/images.jpeg]
-set activebg [blt::bgpattern create gradient -high grey70 -low grey85 \
- -jitter yes -log yes -relativeto self]
-set bg [blt::bgpattern create gradient -high grey80 -low grey95 \
- -jitter yes -log yes -relativeto self]
-
-set image ""
-option add *ComboEntry.takeFocus 1
-
-blt::comboentry .e \
- -textvariable t \
- -font { arial 10 } \
- -image $image \
- -iconvariable icon \
- -textwidth 6 \
- -menu .e.m \
- -exportselection yes \
- -xscrollcommand { .s set } \
- -command "puts {button pressed}" \
- -closebutton yes \
- -closecommand { .e delete 0 end }
-
-blt::combobutton .b \
- -textvariable t \
- -image $image \
- -iconvariable icon \
- -bg $bg \
- -font { Arial 12 } -justify left \
- -underline 19 \
- -arrowborderwidth 2 \
- -arrowrelief flat
-
-blt::tk::scrollbar .s -orient vertical -command { .e xview }
-
-blt::table . \
- 0,0 .e -fill both -cspan 2 -padx 2 -pady 2
-
-blt::table configure . c1 -resize shrink
-blt::table configure . r0 -resize shrink
-blt::table configure . c0 -pad { 2 0 }
-blt::table configure . c1 -pad { 0 2 }
-
-blt::combomenu .e.m -relief sunken -bg white -textvariable t
-.e.m add -text "one" -accelerator "^A"
-.e.m add -text "two" -accelerator "^B"
-.e.m add -text "three" -accelerator "^C"
-.e.m add -text "four" -accelerator "^D"
-.e.m add -type cascade -text "cascade" -accelerator "^E" -menu .e.m.m
-
-blt::combomenu .e.m.m -relief sunken -bg white -textvariable t
-.e.m.m add -text "five" -accelerator "^A"
-.e.m.m add -text "six" -accelerator "^B"
-.e.m.m add -text "seven" -accelerator "^C"
-.e.m.m add -text "eight" -accelerator "^D"
-.e.m.m add -text "nine" -accelerator "^D" -command "set t {really really really long entry}"
-.e.m.m add -type cascade -text "cascade" -accelerator "^E"
-
-
-after idle {
- set t "Hello, World"
- .e insert 0 "Fred says: \n"
- puts "($t)"
- update
-}
-
-proc AddEntry { e m } {
- set s [$e get]
- puts stderr "current entry is $s"
-
- puts stderr "$m find $s -from 0 -type command => [$m find $s -from 0 -type command]"
- puts stderr "$m find * -from 0 -type separator -glob => [$m find * -from 0 -type separator -glob]"
-
- if { [$m find $s -from 0 -type command] < 0 } {
- set sep [$m index "mysep"]
- if { $sep < 0 } {
- $m insert before 0 -type separator -text "mysep"
- }
- $m insert before 0 -text $s
- }
-}
-
-bind .e <Return> [list AddEntry .e .e.m]
-
diff --git a/blt3.0.1/demos/cmenu.tcl b/blt3.0.1/demos/cmenu.tcl
deleted file mode 100644
index b4cf5e7..0000000
--- a/blt3.0.1/demos/cmenu.tcl
+++ /dev/null
@@ -1,63 +0,0 @@
-set imgData {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
- ZTKAsiCtWq0JADs=
-}
-
-set icon [image create picture -data $imgData]
-set icon2 [image create picture -file images/blt98.gif]
-set bg [blt::bgpattern create gradient -high grey98 -low grey85 \
- -dir x -jitter yes -log yes -relativeto self]
-
-blt::combomenu .m \
- -bg $bg \
- -textvariable myText \
- -iconvariable myIcon \
- -font { Arial 9 bold } \
- -activebackground lightblue1 \
- -acceleratorfont { Arial 8 } \
- -borderwidth 2 \
- -disabledforeground grey45 \
- -disabledbackground grey85 \
- -disabledacceleratorforeground grey45 \
- -height 200 \
- -relief raised
-
-#pack .m -fill both -expand yes
-
-set onOff 0
-set wwho ""
-foreach item { Undo X1 Y1 Redo Cut Copy X2 Y2 Paste "Select All" X3 Y3 Find Replace } {
- set char [string range $item 0 0]
- .m add \
- -text $item \
- -type checkbutton \
- -accel "Ctrl+$char" \
- -underline 0 \
- -tag [string tolower $char] \
- -icon $icon \
- -variable onOff \
- -onvalue 1 -offvalue 0 -value $item
-}
-
-.m item configure Undo -type command
-.m item configure Cut -type command
-.m item configure Find -type cascade -state disabled
-.m item configure Redo -type command
-.m item configure Undo -type command
-.m item configure Paste -type separator -state disabled
-.m item configure x -state disabled
-.m item configure y -type radiobutton -variable wwho
-
-bind ComboMenu <Enter> { %W activate @%x,%y }
-bind ComboMenu <Leave> { %W activate "" }
-
-bind ComboMenu <Motion> { %W activate @%x,%y }
-bind ComboMenu <ButtonRelease-1> {
- %W invoke active
- puts text=$myText
- puts icon=$myIcon
-}
-
-bind ComboMenu <ButtonPress-1> { puts stderr [%W index next] }
-
diff --git a/blt3.0.1/demos/cmenu1.tcl b/blt3.0.1/demos/cmenu1.tcl
deleted file mode 100755
index 897a6ba..0000000
--- a/blt3.0.1/demos/cmenu1.tcl
+++ /dev/null
@@ -1,255 +0,0 @@
-
-package require BLT
-
-set imgData {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
- ZTKAsiCtWq0JADs=
-}
-
-set icon2 [image create picture -file images/blt98.gif]
-set icon [image create picture -data $imgData]
-set bg white
-
-set image ""
-option add *ComboEntry.takeFocus 1
-
-if { [file exists ../library] } {
- set blt_library ../library
-}
-
-# -postcommand {.e.m configure -width [winfo width .e] ; update} \
-set myIcon ""
-blt::comboentry .e \
- -image $image \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -textwidth 0 \
- -menu .e.m \
- -menuanchor se \
- -exportselection yes \
- -xscrollcommand { .s set } \
- -closebutton yes \
- -command "puts {button pressed}"
-
-# -bg $bg
-
-blt::combomenu .e.m \
- -background white \
- -activebackground skyblue4 \
- -activeforeground white \
- -restrictwidth min \
- -height 200 \
- -checkbuttonoutlinecolor "" \
- -checkbuttonfillcolor "" \
- -disabledbackground \#f0f0f0 \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -yscrollbar .e.m.ybar \
- -xscrollbar .e.m.xbar
-
-blt::tk::scrollbar .e.m.xbar
-blt::tk::scrollbar .e.m.ybar
-
-set onOff 1
-set wwho ""
-foreach {item type} {
- Undo command
- X1 checkbutton
- Y1 radiobutton
- Redo checkbutton
- Cut command
- Copy checkbutton
- X2 checkbutton
- Y2 radiobutton
- Paste checkbutton
- "Edit Options" separator
- "Select All" checkbutton
- X3 checkbutton
- Y3 radiobutton
- Find cascade
- Replace checkbutton
-} {
- set char [string range $item 0 0]
- .e.m add \
- -type $type \
- -text $item \
- -accel "Ctrl+$char" \
- -underline 0 \
- -tag "$type [string tolower $char]" \
- -icon $icon \
- -variable $item \
- -value $item \
-
-}
-set X1 1
-set Redo 1
-
-.e.m item configure Find -menu .e.m.m
-#-state disabled
-.e.m item configure x -state disabled
-.e.m item configure radiobutton -variable wwho
-.e.m item configure Y1 -state disabled
-puts stderr "config=[.e.m item configure Y3]"
-set wwho Y1
-blt::combomenu .e.m.m \
- -bg $bg \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -disabledforeground grey45 \
- -disabledbackground grey85 \
- -disabledacceleratorforeground grey45 \
- -height { 0 500 } \
- -yscrollbar .e.m.m.ybar \
- -xscrollbar .e.m.m.xbar \
- -font "Arial 8"
-
-blt::tk::scrollbar .e.m.m.xbar
-blt::tk::scrollbar .e.m.m.ybar
-
-set onOff 0
-foreach item {
- Undo X1 Y1 Redo Cut Copy X2 Y2 Paste "Select All" X3 Y3 Find Replace
-} {
- set char [string range $item 0 0]
- .e.m.m add \
- -type checkbutton \
- -text $item \
- -accel "Ctrl+$char" \
- -accel "" \
- -underline 0 \
- -tag [string tolower $char] \
- -icon $icon \
- -variable $item \
- -value $item \
-
-}
-set wwho2 ""
-.e.m.m item configure Undo -type command
-.e.m.m item configure Cut -type command
-.e.m.m item configure Find -type cascade -menu .e.m.m.m
-#-state disabled
-.e.m.m item configure Y3 -type command -image $icon2
-.e.m.m item configure Undo -type command
-.e.m.m item configure Paste -type separator
-.e.m.m item configure x -state disabled
-.e.m.m item configure y -type radiobutton -variable wwho2
-
-set labels {
- Aarhus Aaron Ababa aback abaft abandon abandoned abandoning
- abandonment abandons abase abased abasement abasements abases
- abash abashed abashes abashing abasing abate abated abatement
- abatements abater abates abating Abba abbe abbey abbeys abbot
- abbots Abbott abbreviate abbreviated abbreviates abbreviating
- abbreviation abbreviations Abby abdomen abdomens abdominal
- abduct abducted abduction abductions abductor abductors abducts
- Abe abed Abel Abelian Abelson Aberdeen Abernathy aberrant
- aberration aberrations abet abets abetted abetter abetting
- abeyance abhor abhorred abhorrent abhorrer abhorring abhors
- abide abided abides abiding Abidjan Abigail Abilene abilities
- ability abject abjection abjections abjectly abjectness abjure
- abjured abjures abjuring ablate ablated ablates ablating
- ablation ablative ablaze able abler ablest ably Abner abnormal
- abnormalities abnormality abnormally Abo aboard abode abodes
- abolish abolished abolisher abolishers abolishes abolishing
- abolishment abolishments abolition abolitionist abolitionists
- abominable abominate aboriginal aborigine aborigines abort
- aborted aborting abortion abortions abortive abortively aborts
- Abos abound abounded abounding abounds about above aboveboard
- aboveground abovementioned abrade abraded abrades abrading
- Abraham Abram Abrams Abramson abrasion abrasions abrasive
- abreaction abreactions abreast abridge abridged abridges
- abridging abridgment abroad abrogate abrogated abrogates
- abrogating abrupt abruptly abruptness abscess abscessed
- abscesses abscissa abscissas abscond absconded absconding
- absconds absence absences absent absented absentee
- absenteeism absentees absentia absenting absently absentminded
- absents absinthe absolute absolutely absoluteness absolutes
- absolution absolve absolved absolves absolving absorb
- absorbed absorbency absorbent absorber absorbing absorbs
- absorption absorptions absorptive abstain abstained abstainer
- abstaining abstains abstention abstentions abstinence
- abstract abstracted abstracting abstraction abstractionism
- abstractionist abstractions abstractly abstractness
- abstractor abstractors abstracts abstruse abstruseness
- absurd absurdities absurdity absurdly Abu abundance abundant
- abundantly abuse abused abuses abusing abusive abut abutment
- abuts abutted abutter abutters abutting abysmal abysmally
- abyss abysses Abyssinia Abyssinian Abyssinians acacia
- academia academic academically academics academies academy
- Acadia Acapulco accede acceded accedes accelerate accelerated
- accelerates accelerating acceleration accelerations
- accelerator accelerators accelerometer accelerometers accent
- accented accenting accents accentual accentuate accentuated
- accentuates accentuating accentuation accept acceptability
- acceptable acceptably acceptance acceptances accepted
- accepter accepters accepting acceptor acceptors accepts
- access accessed accesses accessibility accessible accessibly
- accessing accession accessions accessories accessors
- accessory accident accidental accidentally accidently
- accidents acclaim acclaimed acclaiming acclaims acclamation
- acclimate acclimated acclimates acclimating acclimatization
- acclimatized accolade accolades accommodate accommodated
- accommodates accommodating accommodation accommodations
- accompanied accompanies accompaniment accompaniments
- accompanist accompanists accompany accompanying accomplice
- accomplices accomplish accomplished accomplisher accomplishers
- accomplishes accomplishing accomplishment accomplishments
- accord accordance accorded accorder accorders according
- accordingly accordion accordions accords accost accosted
- accosting accosts account accountability accountable accountably
- accountancy accountant accountants accounted accounting
- accounts Accra accredit accreditation accreditations
- accredited accretion accretions accrue accrued accrues
- accruing acculturate acculturated acculturates acculturating
- acculturation accumulate accumulated accumulates accumulating
- accumulation accumulations accumulator accumulators
- accuracies accuracy accurate accurately accurateness accursed
- accusal accusation accusations accusative accuse accused
- accuser accuses accusing accusingly accustom accustomed
- accustoming accustoms ace aces acetate acetone acetylene
- Achaean Achaeans ache ached aches achievable achieve achieved
- achievement achievements achiever achievers achieves achieving
- Achilles aching acid acidic acidities acidity acidly acids
- acidulous Ackerman Ackley acknowledge acknowledgeable
- acknowledged acknowledgement acknowledgements acknowledger
- acknowledgers acknowledges acknowledging acknowledgment
- acknowledgments acme acne acolyte acolytes acorn acorns
- acoustic acoustical acoustically acoustician acoustics
- acquaint acquaintance acquaintances acquainted acquainting
- acquaints acquiesce acquiesced acquiescence acquiescent
- acquiesces acquiescing acquirable acquire acquired acquires
- acquiring acquisition acquisitions
-}
-
-blt::combomenu .e.m.m.m \
- -bg $bg \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -disabledforeground grey45 \
- -disabledbackground grey85 \
- -disabledacceleratorforeground grey45 \
- -width { 0 400 } \
- -height { 0 500 } \
- -yscrollbar .e.m.m.m.ybar \
- -xscrollbar .e.m.m.m.xbar
-
-.e.m.m.m listadd $labels \
- -icon $icon
-
-blt::tk::scrollbar .e.m.m.m.xbar
-blt::tk::scrollbar .e.m.m.m.ybar
-
-blt::tk::scrollbar .s -orient vertical -command { .e xview }
-
-bind ComboEntry <3> {
- grab release [grab current]
-}
-
-blt::table . \
- 0,0 .e -fill x -anchor n
-
-#blt::table configure . r0 -resize none
-#blt::table configure . r1 -resize both
-
-
diff --git a/blt3.0.1/demos/cmenu2.tcl b/blt3.0.1/demos/cmenu2.tcl
deleted file mode 100644
index bd209c7..0000000
--- a/blt3.0.1/demos/cmenu2.tcl
+++ /dev/null
@@ -1,295 +0,0 @@
-
-set colors {
- aliceblue
- antiquewhite
- aqua
- aquamarine
- azure
- beige
- bisque
- black
- blanchedalmond
- blue
- blueviolet
- brown
- burlywood
- cadetblue
- chartreuse
- chocolate
- coral
- cornflowerblue
- cornsilk
- crimson
- cyan
- darkblue
- darkcyan
- darkgoldenrod
- darkgray
- darkgreen
- darkkhaki
- darkmagenta
- darkolivegreen
- darkorange
- darkorchid
- darkred
- darksalmon
- darkseagreen
- darkslateblue
- darkslategray
- darkturquoise
- darkviolet
- deeppink
- deepskyblue
- dimgray
- dodgerblue
- firebrick
- floralwhite
- forestgreen
- fuchsia
- gainsboro
- ghostwhite
- gold
- goldenrod
- gray
- green
- greenyellow
- honeydew
- hotpink
- indianred
- indigo
- ivory
- khaki
- lavender
- lavenderblush
- lawngreen
- lemonchiffon
- lightblue
- lightcoral
- lightcyan
- lightgoldenrodyellow
- lightgreen
- lightgrey
- lightpink
- lightsalmon
- lightseagreen
- lightskyblue
- lightslategray
- lightsteelblue
- lightyellow
- lime
- limegreen
- linen
- magenta
- #008000
- mediumaquamarine
- mediumblue
- mediumorchid
- mediumpurple
- mediumseagreen
- mediumslateblue
- mediumspringgreen
- mediumturquoise
- mediumvioletred
- midnightblue
- mintcream
- mistyrose
- moccasin
- navajowhite
- navy
- oldlace
- olive
- olivedrab
- orange
- orangered
- orchid
- palegoldenrod
- palegreen
- paleturquoise
- palevioletred
- papayawhip
- peachpuff
- peru
- pink
- plum
- powderblue
- purple
- red
- rosybrown
- royalblue
- saddlebrown
- salmon
- sandybrown
- seagreen
- seashell
- sienna
- silver
- skyblue
- slateblue
- slategray
- snow
- springgreen
- steelblue
- tan
- teal
- thistle
- tomato
- turquoise
- violet
- wheat
- white
- whitesmoke
- yellow
- yellowgreen
-}
-
-set imgData {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
- ZTKAsiCtWq0JADs=
-}
-
-set icon2 [image create picture -file images/blt98.gif]
-set icon [image create picture -data $imgData]
-set bg [blt::bgpattern create gradient -high grey100 -low grey90 \
- -dir x -jitter yes -log yes -relativeto self]
-
-set image ""
-option add *ComboEntry.takeFocus 1
-
-if { [file exists ../library] } {
- set blt_library ../library
-}
-
-set myIcon ""
-blt::comboentry .e \
- -image $image \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -textwidth 6 \
- -menu .e.m \
- -menuanchor se \
- -exportselection yes \
- -xscrollcommand { .s set } \
- -postcommand {.e.m configure -width [winfo width .e] ; update} \
- -command "puts {button pressed}"
-
-
-set labels {
- Aarhus Aaron Ababa aback abaft abandon abandoned abandoning
- abandonment abandons abase abased abasement abasements abases
- abash abashed abashes abashing abasing abate abated abatement
- abatements abater abates abating Abba abbe abbey abbeys abbot
- abbots Abbott abbreviate abbreviated abbreviates abbreviating
- abbreviation abbreviations Abby abdomen abdomens abdominal
- abduct abducted abduction abductions abductor abductors abducts
- Abe abed Abel Abelian Abelson Aberdeen Abernathy aberrant
- aberration aberrations abet abets abetted abetter abetting
- abeyance abhor abhorred abhorrent abhorrer abhorring abhors
- abide abided abides abiding Abidjan Abigail Abilene abilities
- ability abject abjection abjections abjectly abjectness abjure
- abjured abjures abjuring ablate ablated ablates ablating
- ablation ablative ablaze able abler ablest ably Abner abnormal
- abnormalities abnormality abnormally Abo aboard abode abodes
- abolish abolished abolisher abolishers abolishes abolishing
- abolishment abolishments abolition abolitionist abolitionists
- abominable abominate aboriginal aborigine aborigines abort
- aborted aborting abortion abortions abortive abortively aborts
- Abos abound abounded abounding abounds about above aboveboard
- aboveground abovementioned abrade abraded abrades abrading
- Abraham Abram Abrams Abramson abrasion abrasions abrasive
- abreaction abreactions abreast abridge abridged abridges
- abridging abridgment abroad abrogate abrogated abrogates
- abrogating abrupt abruptly abruptness abscess abscessed
- abscesses abscissa abscissas abscond absconded absconding
- absconds absence absences absent absented absentee
- absenteeism absentees absentia absenting absently absentminded
- absents absinthe absolute absolutely absoluteness absolutes
- absolution absolve absolved absolves absolving absorb
- absorbed absorbency absorbent absorber absorbing absorbs
- absorption absorptions absorptive abstain abstained abstainer
- abstaining abstains abstention abstentions abstinence
- abstract abstracted abstracting abstraction abstractionism
- abstractionist abstractions abstractly abstractness
- abstractor abstractors abstracts abstruse abstruseness
- absurd absurdities absurdity absurdly Abu abundance abundant
- abundantly abuse abused abuses abusing abusive abut abutment
- abuts abutted abutter abutters abutting abysmal abysmally
- abyss abysses Abyssinia Abyssinian Abyssinians acacia
- academia academic academically academics academies academy
- Acadia Acapulco accede acceded accedes accelerate accelerated
- accelerates accelerating acceleration accelerations
- accelerator accelerators accelerometer accelerometers accent
- accented accenting accents accentual accentuate accentuated
- accentuates accentuating accentuation accept acceptability
- acceptable acceptably acceptance acceptances accepted
- accepter accepters accepting acceptor acceptors accepts
- access accessed accesses accessibility accessible accessibly
- accessing accession accessions accessories accessors
- accessory accident accidental accidentally accidently
- accidents acclaim acclaimed acclaiming acclaims acclamation
- acclimate acclimated acclimates acclimating acclimatization
- acclimatized accolade accolades accommodate accommodated
- accommodates accommodating accommodation accommodations
- accompanied accompanies accompaniment accompaniments
- accompanist accompanists accompany accompanying accomplice
- accomplices accomplish accomplished accomplisher accomplishers
- accomplishes accomplishing accomplishment accomplishments
- accord accordance accorded accorder accorders according
- accordingly accordion accordions accords accost accosted
- accosting accosts account accountability accountable accountably
- accountancy accountant accountants accounted accounting
- accounts Accra accredit accreditation accreditations
- accredited accretion accretions accrue accrued accrues
- accruing acculturate acculturated acculturates acculturating
- acculturation accumulate accumulated accumulates accumulating
- accumulation accumulations accumulator accumulators
- accuracies accuracy accurate accurately accurateness accursed
- accusal accusation accusations accusative accuse accused
- accuser accuses accusing accusingly accustom accustomed
- accustoming accustoms ace aces acetate acetone acetylene
- Achaean Achaeans ache ached aches achievable achieve achieved
- achievement achievements achiever achievers achieves achieving
- Achilles aching acid acidic acidities acidity acidly acids
- acidulous Ackerman Ackley acknowledge acknowledgeable
- acknowledged acknowledgement acknowledgements acknowledger
- acknowledgers acknowledges acknowledging acknowledgment
- acknowledgments acme acne acolyte acolytes acorn acorns
- acoustic acoustical acoustically acoustician acoustics
- acquaint acquaintance acquaintances acquainted acquainting
- acquaints acquiesce acquiesced acquiescence acquiescent
- acquiesces acquiescing acquirable acquire acquired acquires
- acquiring acquisition acquisitions
-}
-
-blt::combomenu .e.m \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -disabledforeground grey45 \
- -disabledbackground grey85 \
- -disabledacceleratorforeground grey45 \
- -width { 0 400 } \
- -height { 0 2i } \
- -yscrollbar .e.m.ybar \
- -xscrollbar .e.m.xbar
-
-.e.m listadd $labels \
- -icon $icon
-
-blt::tk::scrollbar .e.m.xbar
-blt::tk::scrollbar .e.m.ybar
-
-blt::tk::scrollbar .s -orient vertical -command { .e xview }
-
-bind ComboEntry <3> {
- grab release [grab current]
-}
-
-blt::table . \
- 0,0 .e -fill x -anchor n
-
-blt::table configure . r0 -resize none
-blt::table configure . r1 -resize expand
-
-wm geometry . 200x400
-
-#blt::bltdebug 100
\ No newline at end of file
diff --git a/blt3.0.1/demos/cmenu3.tcl b/blt3.0.1/demos/cmenu3.tcl
deleted file mode 100644
index 5835a89..0000000
--- a/blt3.0.1/demos/cmenu3.tcl
+++ /dev/null
@@ -1,801 +0,0 @@
-set colors {
- 000000 black
- 000000 gray0
- 000000 grey0
- 000080 NavyBlue
- 000080 navy
- 000080 {navy blue}
- 00008B DarkBlue
- 00008B blue4
- 00008B {dark blue}
- 0000CD MediumBlue
- 0000CD blue3
- 0000CD {medium blue}
- 0000EE blue2
- 0000FF blue
- 0000FF blue1
- 006400 DarkGreen
- 006400 {dark green}
- 00688B DeepSkyBlue4
- 00868B turquoise4
- 008B00 green4
- 008B45 SpringGreen4
- 008B8B DarkCyan
- 008B8B cyan4
- 008B8B {dark cyan}
- 009ACD DeepSkyBlue3
- 00B2EE DeepSkyBlue2
- 00BFFF DeepSkyBlue
- 00BFFF DeepSkyBlue1
- 00BFFF {deep sky blue}
- 00C5CD turquoise3
- 00CD00 green3
- 00CD66 SpringGreen3
- 00CDCD cyan3
- 00CED1 DarkTurquoise
- 00CED1 {dark turquoise}
- 00E5EE turquoise2
- 00EE00 green2
- 00EE76 SpringGreen2
- 00EEEE cyan2
- 00F5FF turquoise1
- 00FA9A MediumSpringGreen
- 00FA9A {medium spring green}
- 00FF00 green
- 00FF00 green1
- 00FF7F SpringGreen
- 00FF7F SpringGreen1
- 00FF7F {spring green}
- 00FFFF cyan
- 00FFFF cyan1
- 030303 gray1
- 030303 grey1
- 050505 gray2
- 050505 grey2
- 080808 gray3
- 080808 grey3
- 0A0A0A gray4
- 0A0A0A grey4
- 0D0D0D gray5
- 0D0D0D grey5
- 0F0F0F gray6
- 0F0F0F grey6
- 104E8B DodgerBlue4
- 121212 gray7
- 121212 grey7
- 141414 gray8
- 141414 grey8
- 171717 gray9
- 171717 grey9
- 1874CD DodgerBlue3
- 191970 MidnightBlue
- 191970 {midnight blue}
- 1A1A1A gray10
- 1A1A1A grey10
- 1C1C1C gray11
- 1C1C1C grey11
- 1C86EE DodgerBlue2
- 1E90FF DodgerBlue
- 1E90FF DodgerBlue1
- 1E90FF {dodger blue}
- 1F1F1F gray12
- 1F1F1F grey12
- 20B2AA LightSeaGreen
- 20B2AA {light sea green}
- 212121 gray13
- 212121 grey13
- 228B22 ForestGreen
- 228B22 {forest green}
- 242424 gray14
- 242424 grey14
- 262626 gray15
- 262626 grey15
- 27408B RoyalBlue4
- 292929 gray16
- 292929 grey16
- 2B2B2B gray17
- 2B2B2B grey17
- 2E2E2E gray18
- 2E2E2E grey18
- 2E8B57 SeaGreen
- 2E8B57 SeaGreen4
- 2E8B57 {sea green}
- 2F4F4F DarkSlateGray
- 2F4F4F DarkSlateGrey
- 2F4F4F {dark slate gray}
- 2F4F4F {dark slate grey}
- 303030 gray19
- 303030 grey19
- 32CD32 LimeGreen
- 32CD32 {lime green}
- 333333 gray20
- 333333 grey20
- 363636 gray21
- 363636 grey21
- 36648B SteelBlue4
- 383838 gray22
- 383838 grey22
- 3A5FCD RoyalBlue3
- 3B3B3B gray23
- 3B3B3B grey23
- 3CB371 MediumSeaGreen
- 3CB371 {medium sea green}
- 3D3D3D gray24
- 3D3D3D grey24
- 404040 gray25
- 404040 grey25
- 40E0D0 turquoise
- 4169E1 RoyalBlue
- 4169E1 {royal blue}
- 424242 gray26
- 424242 grey26
- 436EEE RoyalBlue2
- 43CD80 SeaGreen3
- 454545 gray27
- 454545 grey27
- 458B00 chartreuse4
- 458B74 aquamarine4
- 4682B4 SteelBlue
- 4682B4 {steel blue}
- 473C8B SlateBlue4
- 474747 gray28
- 474747 grey28
- 483D8B DarkSlateBlue
- 483D8B {dark slate blue}
- 4876FF RoyalBlue1
- 48D1CC MediumTurquoise
- 48D1CC {medium turquoise}
- 4A4A4A gray29
- 4A4A4A grey29
- 4A708B SkyBlue4
- 4D4D4D gray30
- 4D4D4D grey30
- 4EEE94 SeaGreen2
- 4F4F4F gray31
- 4F4F4F grey31
- 4F94CD SteelBlue3
- 525252 gray32
- 525252 grey32
- 528B8B DarkSlateGray4
- 53868B CadetBlue4
- 545454 gray33
- 545454 grey33
- 548B54 PaleGreen4
- 54FF9F SeaGreen1
- 551A8B purple4
- 556B2F DarkOliveGreen
- 556B2F {dark olive green}
- 575757 gray34
- 575757 grey34
- 595959 gray35
- 595959 grey35
- 5C5C5C gray36
- 5C5C5C grey36
- 5CACEE SteelBlue2
- 5D478B MediumPurple4
- 5E5E5E gray37
- 5E5E5E grey37
- 5F9EA0 CadetBlue
- 5F9EA0 {cadet blue}
- 607B8B LightSkyBlue4
- 616161 gray38
- 616161 grey38
- 636363 gray39
- 636363 grey39
- 63B8FF SteelBlue1
- 6495ED CornflowerBlue
- 6495ED {cornflower blue}
- 666666 gray40
- 666666 grey40
- 668B8B PaleTurquoise4
- 66CD00 chartreuse3
- 66CDAA MediumAquamarine
- 66CDAA aquamarine3
- 66CDAA {medium aquamarine}
- 68228B DarkOrchid4
- 68838B LightBlue4
- 6959CD SlateBlue3
- 696969 DimGray
- 696969 DimGrey
- 696969 gray41
- 696969 grey41
- 696969 {dim gray}
- 696969 {dim grey}
- 698B22 OliveDrab4
- 698B69 DarkSeaGreen4
- 6A5ACD SlateBlue
- 6A5ACD {slate blue}
- 6B6B6B gray42
- 6B6B6B grey42
- 6B8E23 OliveDrab
- 6B8E23 {olive drab}
- 6C7B8B SlateGray4
- 6CA6CD SkyBlue3
- 6E6E6E gray43
- 6E6E6E grey43
- 6E7B8B LightSteelBlue4
- 6E8B3D DarkOliveGreen4
- 707070 gray44
- 707070 grey44
- 708090 SlateGray
- 708090 SlateGrey
- 708090 {slate gray}
- 708090 {slate grey}
- 737373 gray45
- 737373 grey45
- 757575 gray46
- 757575 grey46
- 76EE00 chartreuse2
- 76EEC6 aquamarine2
- 778899 LightSlateGray
- 778899 LightSlateGrey
- 778899 {light slate gray}
- 778899 {light slate grey}
- 787878 gray47
- 787878 grey47
- 79CDCD DarkSlateGray3
- 7A378B MediumOrchid4
- 7A67EE SlateBlue2
- 7A7A7A gray48
- 7A7A7A grey48
- 7A8B8B LightCyan4
- 7AC5CD CadetBlue3
- 7B68EE MediumSlateBlue
- 7B68EE {medium slate blue}
- 7CCD7C PaleGreen3
- 7CFC00 LawnGreen
- 7CFC00 {lawn green}
- 7D26CD purple3
- 7D7D7D gray49
- 7D7D7D grey49
- 7EC0EE SkyBlue2
- 7F7F7F gray50
- 7F7F7F grey50
- 7FFF00 chartreuse
- 7FFF00 chartreuse1
- 7FFFD4 aquamarine
- 7FFFD4 aquamarine1
- 828282 gray51
- 828282 grey51
- 836FFF SlateBlue1
- 838B83 honeydew4
- 838B8B azure4
- 8470FF LightSlateBlue
- 8470FF {light slate blue}
- 858585 gray52
- 858585 grey52
- 878787 gray53
- 878787 grey53
- 87CEEB SkyBlue
- 87CEEB {sky blue}
- 87CEFA LightSkyBlue
- 87CEFA {light sky blue}
- 87CEFF SkyBlue1
- 8968CD MediumPurple3
- 8A2BE2 BlueViolet
- 8A2BE2 {blue violet}
- 8A8A8A gray54
- 8A8A8A grey54
- 8B0000 DarkRed
- 8B0000 red4
- 8B0000 {dark red}
- 8B008B DarkMagenta
- 8B008B magenta4
- 8B008B {dark magenta}
- 8B0A50 DeepPink4
- 8B1A1A firebrick4
- 8B1C62 maroon4
- 8B2252 VioletRed4
- 8B2323 brown4
- 8B2500 OrangeRed4
- 8B3626 tomato4
- 8B3A3A IndianRed4
- 8B3A62 HotPink4
- 8B3E2F coral4
- 8B4500 DarkOrange4
- 8B4513 SaddleBrown
- 8B4513 chocolate4
- 8B4513 {saddle brown}
- 8B4726 sienna4
- 8B475D PaleVioletRed4
- 8B4789 orchid4
- 8B4C39 salmon4
- 8B5742 LightSalmon4
- 8B5A00 orange4
- 8B5A2B tan4
- 8B5F65 LightPink4
- 8B636C pink4
- 8B6508 DarkGoldenrod4
- 8B668B plum4
- 8B6914 goldenrod4
- 8B6969 RosyBrown4
- 8B7355 burlywood4
- 8B7500 gold4
- 8B7765 PeachPuff4
- 8B795E NavajoWhite4
- 8B7B8B thistle4
- 8B7D6B bisque4
- 8B7D7B MistyRose4
- 8B7E66 wheat4
- 8B814C LightGoldenrod4
- 8B8378 AntiqueWhite4
- 8B8386 LavenderBlush4
- 8B864E khaki4
- 8B8682 seashell4
- 8B8878 cornsilk4
- 8B8970 LemonChiffon4
- 8B8989 snow4
- 8B8B00 yellow4
- 8B8B7A LightYellow4
- 8B8B83 ivory4
- 8C8C8C gray55
- 8C8C8C grey55
- 8DB6CD LightSkyBlue3
- 8DEEEE DarkSlateGray2
- 8EE5EE CadetBlue2
- 8F8F8F gray56
- 8F8F8F grey56
- 8FBC8F DarkSeaGreen
- 8FBC8F {dark sea green}
- 90EE90 LightGreen
- 90EE90 PaleGreen2
- 90EE90 {light green}
- 912CEE purple2
- 919191 gray57
- 919191 grey57
- 9370DB MediumPurple
- 9370DB {medium purple}
- 9400D3 DarkViolet
- 9400D3 {dark violet}
- 949494 gray58
- 949494 grey58
- 969696 gray59
- 969696 grey59
- 96CDCD PaleTurquoise3
- 97FFFF DarkSlateGray1
- 98F5FF CadetBlue1
- 98FB98 PaleGreen
- 98FB98 {pale green}
- 9932CC DarkOrchid
- 9932CC {dark orchid}
- 999999 gray60
- 999999 grey60
- 9A32CD DarkOrchid3
- 9AC0CD LightBlue3
- 9ACD32 OliveDrab3
- 9ACD32 YellowGreen
- 9ACD32 {yellow green}
- 9AFF9A PaleGreen1
- 9B30FF purple1
- 9BCD9B DarkSeaGreen3
- 9C9C9C gray61
- 9C9C9C grey61
- 9E9E9E gray62
- 9E9E9E grey62
- 9F79EE MediumPurple2
- 9FB6CD SlateGray3
- A020F0 purple
- A0522D sienna
- A1A1A1 gray63
- A1A1A1 grey63
- A2B5CD LightSteelBlue3
- A2CD5A DarkOliveGreen3
- A3A3A3 gray64
- A3A3A3 grey64
- A4D3EE LightSkyBlue2
- A52A2A brown
- A6A6A6 gray65
- A6A6A6 grey65
- A8A8A8 gray66
- A8A8A8 grey66
- A9A9A9 DarkGray
- A9A9A9 DarkGrey
- A9A9A9 {dark gray}
- A9A9A9 {dark grey}
- AB82FF MediumPurple1
- ABABAB gray67
- ABABAB grey67
- ADADAD gray68
- ADADAD grey68
- ADD8E6 LightBlue
- ADD8E6 {light blue}
- ADFF2F GreenYellow
- ADFF2F {green yellow}
- AEEEEE PaleTurquoise2
- AFEEEE PaleTurquoise
- AFEEEE {pale turquoise}
- B03060 maroon
- B0B0B0 gray69
- B0B0B0 grey69
- B0C4DE LightSteelBlue
- B0C4DE {light steel blue}
- B0E0E6 PowderBlue
- B0E0E6 {powder blue}
- B0E2FF LightSkyBlue1
- B22222 firebrick
- B23AEE DarkOrchid2
- B2DFEE LightBlue2
- B3B3B3 gray70
- B3B3B3 grey70
- B3EE3A OliveDrab2
- B452CD MediumOrchid3
- B4CDCD LightCyan3
- B4EEB4 DarkSeaGreen2
- B5B5B5 gray71
- B5B5B5 grey71
- B8860B DarkGoldenrod
- B8860B {dark goldenrod}
- B8B8B8 gray72
- B8B8B8 grey72
- B9D3EE SlateGray2
- BA55D3 MediumOrchid
- BA55D3 {medium orchid}
- BABABA gray73
- BABABA grey73
- BBFFFF PaleTurquoise1
- BC8F8F RosyBrown
- BC8F8F {rosy brown}
- BCD2EE LightSteelBlue2
- BCEE68 DarkOliveGreen2
- BDB76B DarkKhaki
- BDB76B {dark khaki}
- BDBDBD gray74
- BDBDBD grey74
- BEBEBE gray
- BEBEBE grey
- BF3EFF DarkOrchid1
- BFBFBF gray75
- BFBFBF grey75
- BFEFFF LightBlue1
- C0FF3E OliveDrab1
- C1CDC1 honeydew3
- C1CDCD azure3
- C1FFC1 DarkSeaGreen1
- C2C2C2 gray76
- C2C2C2 grey76
- C4C4C4 gray77
- C4C4C4 grey77
- C6E2FF SlateGray1
- C71585 MediumVioletRed
- C71585 {medium violet red}
- C7C7C7 gray78
- C7C7C7 grey78
- C9C9C9 gray79
- C9C9C9 grey79
- CAE1FF LightSteelBlue1
- CAFF70 DarkOliveGreen1
- CCCCCC gray80
- CCCCCC grey80
- CD0000 red3
- CD00CD magenta3
- CD1076 DeepPink3
- CD2626 firebrick3
- CD2990 maroon3
- CD3278 VioletRed3
- CD3333 brown3
- CD3700 OrangeRed3
- CD4F39 tomato3
- CD5555 IndianRed3
- CD5B45 coral3
- CD5C5C IndianRed
- CD5C5C {indian red}
- CD6090 HotPink3
- CD6600 DarkOrange3
- CD661D chocolate3
- CD6839 sienna3
- CD6889 PaleVioletRed3
- CD69C9 orchid3
- CD7054 salmon3
- CD8162 LightSalmon3
- CD8500 orange3
- CD853F peru
- CD853F tan3
- CD8C95 LightPink3
- CD919E pink3
- CD950C DarkGoldenrod3
- CD96CD plum3
- CD9B1D goldenrod3
- CD9B9B RosyBrown3
- CDAA7D burlywood3
- CDAD00 gold3
- CDAF95 PeachPuff3
- CDB38B NavajoWhite3
- CDB5CD thistle3
- CDB79E bisque3
- CDB7B5 MistyRose3
- CDBA96 wheat3
- CDBE70 LightGoldenrod3
- CDC0B0 AntiqueWhite3
- CDC1C5 LavenderBlush3
- CDC5BF seashell3
- CDC673 khaki3
- CDC8B1 cornsilk3
- CDC9A5 LemonChiffon3
- CDC9C9 snow3
- CDCD00 yellow3
- CDCDB4 LightYellow3
- CDCDC1 ivory3
- CFCFCF gray81
- CFCFCF grey81
- D02090 VioletRed
- D02090 {violet red}
- D15FEE MediumOrchid2
- D1D1D1 gray82
- D1D1D1 grey82
- D1EEEE LightCyan2
- D2691E chocolate
- D2B48C tan
- D3D3D3 LightGray
- D3D3D3 LightGrey
- D3D3D3 {light gray}
- D3D3D3 {light grey}
- D4D4D4 gray83
- D4D4D4 grey83
- D6D6D6 gray84
- D6D6D6 grey84
- D8BFD8 thistle
- D9D9D9 gray85
- D9D9D9 grey85
- DA70D6 orchid
- DAA520 goldenrod
- DB7093 PaleVioletRed
- DB7093 {pale violet red}
- DBDBDB gray86
- DBDBDB grey86
- DCDCDC gainsboro
- DDA0DD plum
- DEB887 burlywood
- DEDEDE gray87
- DEDEDE grey87
- E066FF MediumOrchid1
- E0E0E0 gray88
- E0E0E0 grey88
- E0EEE0 honeydew2
- E0EEEE azure2
- E0FFFF LightCyan
- E0FFFF LightCyan1
- E0FFFF {light cyan}
- E3E3E3 gray89
- E3E3E3 grey89
- E5E5E5 gray90
- E5E5E5 grey90
- E6E6FA lavender
- E8E8E8 gray91
- E8E8E8 grey91
- E9967A DarkSalmon
- E9967A {dark salmon}
- EBEBEB gray92
- EBEBEB grey92
- EDEDED gray93
- EDEDED grey93
- EE0000 red2
- EE00EE magenta2
- EE1289 DeepPink2
- EE2C2C firebrick2
- EE30A7 maroon2
- EE3A8C VioletRed2
- EE3B3B brown2
- EE4000 OrangeRed2
- EE5C42 tomato2
- EE6363 IndianRed2
- EE6A50 coral2
- EE6AA7 HotPink2
- EE7600 DarkOrange2
- EE7621 chocolate2
- EE7942 sienna2
- EE799F PaleVioletRed2
- EE7AE9 orchid2
- EE8262 salmon2
- EE82EE violet
- EE9572 LightSalmon2
- EE9A00 orange2
- EE9A49 tan2
- EEA2AD LightPink2
- EEA9B8 pink2
- EEAD0E DarkGoldenrod2
- EEAEEE plum2
- EEB422 goldenrod2
- EEB4B4 RosyBrown2
- EEC591 burlywood2
- EEC900 gold2
- EECBAD PeachPuff2
- EECFA1 NavajoWhite2
- EED2EE thistle2
- EED5B7 bisque2
- EED5D2 MistyRose2
- EED8AE wheat2
- EEDC82 LightGoldenrod2
- EEDD82 LightGoldenrod
- EEDD82 {light goldenrod}
- EEDFCC AntiqueWhite2
- EEE0E5 LavenderBlush2
- EEE5DE seashell2
- EEE685 khaki2
- EEE8AA PaleGoldenrod
- EEE8AA {pale goldenrod}
- EEE8CD cornsilk2
- EEE9BF LemonChiffon2
- EEE9E9 snow2
- EEEE00 yellow2
- EEEED1 LightYellow2
- EEEEE0 ivory2
- F08080 LightCoral
- F08080 {light coral}
- F0E68C khaki
- F0F0F0 gray94
- F0F0F0 grey94
- F0F8FF AliceBlue
- F0F8FF {alice blue}
- F0FFF0 honeydew
- F0FFF0 honeydew1
- F0FFFF azure
- F0FFFF azure1
- F2F2F2 gray95
- F2F2F2 grey95
- F4A460 SandyBrown
- F4A460 {sandy brown}
- F5DEB3 wheat
- F5F5DC beige
- F5F5F5 WhiteSmoke
- F5F5F5 gray96
- F5F5F5 grey96
- F5F5F5 {white smoke}
- F5FFFA MintCream
- F5FFFA {mint cream}
- F7F7F7 gray97
- F7F7F7 grey97
- F8F8FF GhostWhite
- F8F8FF {ghost white}
- FA8072 salmon
- FAEBD7 AntiqueWhite
- FAEBD7 {antique white}
- FAF0E6 linen
- FAFAD2 LightGoldenrodYellow
- FAFAD2 {light goldenrod yellow}
- FAFAFA gray98
- FAFAFA grey98
- FCFCFC gray99
- FCFCFC grey99
- FDF5E6 OldLace
- FDF5E6 {old lace}
- FF0000 red
- FF0000 red1
- FF00FF magenta
- FF00FF magenta1
- FF1493 DeepPink
- FF1493 DeepPink1
- FF1493 {deep pink}
- FF3030 firebrick1
- FF34B3 maroon1
- FF3E96 VioletRed1
- FF4040 brown1
- FF4500 OrangeRed
- FF4500 OrangeRed1
- FF4500 {orange red}
- FF6347 tomato
- FF6347 tomato1
- FF69B4 HotPink
- FF69B4 {hot pink}
- FF6A6A IndianRed1
- FF6EB4 HotPink1
- FF7256 coral1
- FF7F00 DarkOrange1
- FF7F24 chocolate1
- FF7F50 coral
- FF8247 sienna1
- FF82AB PaleVioletRed1
- FF83FA orchid1
- FF8C00 DarkOrange
- FF8C00 {dark orange}
- FF8C69 salmon1
- FFA07A LightSalmon
- FFA07A LightSalmon1
- FFA07A {light salmon}
- FFA500 orange
- FFA500 orange1
- FFA54F tan1
- FFAEB9 LightPink1
- FFB5C5 pink1
- FFB6C1 LightPink
- FFB6C1 {light pink}
- FFB90F DarkGoldenrod1
- FFBBFF plum1
- FFC0CB pink
- FFC125 goldenrod1
- FFC1C1 RosyBrown1
- FFD39B burlywood1
- FFD700 gold
- FFD700 gold1
- FFDAB9 PeachPuff
- FFDAB9 PeachPuff1
- FFDAB9 {peach puff}
- FFDEAD NavajoWhite
- FFDEAD NavajoWhite1
- FFDEAD {navajo white}
- FFE1FF thistle1
- FFE4B5 moccasin
- FFE4C4 bisque
- FFE4C4 bisque1
- FFE4E1 MistyRose
- FFE4E1 MistyRose1
- FFE4E1 {misty rose}
- FFE7BA wheat1
- FFEBCD BlanchedAlmond
- FFEBCD {blanched almond}
- FFEC8B LightGoldenrod1
- FFEFD5 PapayaWhip
- FFEFD5 {papaya whip}
- FFEFDB AntiqueWhite1
- FFF0F5 LavenderBlush
- FFF0F5 LavenderBlush1
- FFF0F5 {lavender blush}
- FFF5EE seashell
- FFF5EE seashell1
- FFF68F khaki1
- FFF8DC cornsilk
- FFF8DC cornsilk1
- FFFACD LemonChiffon
- FFFACD LemonChiffon1
- FFFACD {lemon chiffon}
- FFFAF0 FloralWhite
- FFFAF0 {floral white}
- FFFAFA snow
- FFFAFA snow1
- FFFF00 yellow
- FFFF00 yellow1
- FFFFE0 LightYellow
- FFFFE0 LightYellow1
- FFFFE0 {light yellow}
- FFFFF0 ivory
- FFFFF0 ivory1
- FFFFFF gray100
- FFFFFF grey100
- FFFFFF white
-}
-
-if { [file exists ../library] } {
- set blt_library ../library
-}
-
-set bg [blt::bgpattern create gradient -low grey100 -high grey90 \
- -dir y -jitter yes -log yes -relativeto toplevel]
-set bg white
-set myIcon ""
-blt::comboentry .e \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -textbackground $bg \
- -menu .e.m \
- -menuanchor ne \
- -exportselection yes
-
-
-blt::combomenu .e.m \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -height { 0 400 } \
- -width { 0 400 } \
- -background $bg \
- -yscrollbar .e.m.ybar \
- -xscrollbar .e.m.xbar
-
-blt::tk::scrollbar .e.m.xbar
-blt::tk::scrollbar .e.m.ybar
-
-set bg [image create picture -width 30 -height 20]
-$bg blank 0x0000000
-$bg draw rectangle 5 5 14 26 -color 0xFF00000
-$bg blur $bg 4
-
-foreach {rgb name} $colors {
- set icon [image create picture -width 27 -height 27]
- $icon blank 0x00000000
- $icon draw circle 12 12 11 -fill \#$rgb \
- -shadow 2 -antialiased 1 -linewidth 1
- .e.m add -text $name -icon $icon
-}
-
-button .quit -text "Exit" -command exit
-blt::table . \
- 0,0 .e -fill both -padx 2 -pady 2 \
- 1,0 .quit
diff --git a/blt3.0.1/demos/cmenu4.tcl b/blt3.0.1/demos/cmenu4.tcl
deleted file mode 100644
index dd8980b..0000000
--- a/blt3.0.1/demos/cmenu4.tcl
+++ /dev/null
@@ -1,39 +0,0 @@
-package require BLT
-
-blt::tk::button .quit -command exit -text "Quit"
-blt::tk::button .cancel -command exit -text "Cancel"
-blt::tk::button .cont -command exit -text "Continue"
-
-blt::combomenu .m \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -background grey90 \
- -relief raised \
- -font "arial 9"
-
-set image1 [image create picture -file ~/neeshub/indeed/src/icons/sensor/hidden/user.png]
-set image2 [image create picture -file ~/neeshub/indeed/src/icons/sensor/user.png]
-set image3 [image create picture -width 20 -height 20]
-$image3 copy $image1 -from "0 0 11 20"
-$image3 copy $image2 -from "10 0 20 20" -to "10 0"
-.m add -text "Hide" -accel "Ctrl-H" \
- -command "puts hide" -underline 0 -icon $image1
-.m add -text "Show" -accel "Ctrl-S" \
- -command "puts show" -underline 0 -icon $image2
-.m add -text "Toggle" -accel "Ctrl-T" \
- -command "puts toggle" -underline 0
-
-proc Post { x y } {
- puts stderr "posting menu..."
- blt::ComboMenu::popup .m $x $y
-}
-
-bind all <ButtonPress-3> { Post %X %Y }
-
-
-blt::table . \
- 0,0 .cont -pady 10 \
- 0,1 .quit -pady 10 \
- 0,2 .cancel -pady 10
-
-
diff --git a/blt3.0.1/demos/cmenu5.tcl b/blt3.0.1/demos/cmenu5.tcl
deleted file mode 100644
index 576b607..0000000
--- a/blt3.0.1/demos/cmenu5.tcl
+++ /dev/null
@@ -1,90 +0,0 @@
-
-set imgData {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
- ZTKAsiCtWq0JADs=
-}
-
-set icon2 [image create picture -file images/blt98.gif]
-set icon [image create picture -data $imgData]
-set bg [blt::bgpattern create gradient -low grey100 -high grey90 \
- -dir x -jitter yes -log yes -relativeto self]
-
-set image ""
-option add *ComboEntry.takeFocus 1
-
-if { [file exists ../library] } {
- set blt_library ../library
-}
-
-# -postcommand {.e.m configure -width [winfo width .e] ; update} \
-set myIcon ""
-blt::comboentry .e \
- -image $image \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -textwidth 6 \
- -menu .e.m \
- -menuanchor se \
- -exportselection yes \
- -xscrollcommand { .s set } \
- -command "puts {button pressed}"
-
-# -bg $bg
-
-blt::combomenu .e.m \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -font { Arial 8 } -acceleratorfont { Arial 8 } \
- -yscrollbar .e.m.ybar \
- -xscrollbar .e.m.xbar
-
-blt::tk::scrollbar .e.m.xbar
-blt::tk::scrollbar .e.m.ybar
-
-set onOff 1
-set wwho ""
-foreach {item type} {
- Undo command
- X1 checkbutton
- Y1 radiobutton
- Redo checkbutton
- Cut command
- Copy checkbutton
- X2 checkbutton
- Y2 radiobutton
- Paste checkbutton
- separator separator
- "Select" checkbutton
- X3 checkbutton
- Y3 radiobutton
- Find cascade
- Replace checkbutton
-} {
- set char [string range $item 0 0]
- .e.m add \
- -type $type \
- -text $item \
- -accel "Ctrl+$char" \
- -underline 0 \
- -tag "$type [string tolower $char]" \
- -icon $icon \
- -variable $item \
- -value $item \
-
-}
-.e.m item configure radiobutton -variable "wwho"
-set X1 1
-set Redo 1
-set wwho2 ""
-blt::tk::scrollbar .s -orient vertical -command { .e xview }
-
-bind ComboEntry <3> {
- grab release [grab current]
-}
-
-blt::table . \
- 0,0 .e -fill x -anchor n
-
-blt::table configure . r0 -resize none
-blt::table configure . r1 -resize expand
diff --git a/blt3.0.1/demos/container.tcl b/blt3.0.1/demos/container.tcl
deleted file mode 100755
index 835b655..0000000
--- a/blt3.0.1/demos/container.tcl
+++ /dev/null
@@ -1,19 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-namespace import blt::*
-
-#set cmd "xterm"
-set cmd "xclock"
-set cmd "xterm"
-blt::container .c -width 800 -height 400
-eval bgexec myVar $cmd &
-pack .c -fill both -expand yes
-.c configure -relief raised -bd 2
-button .b -text "Quit" -command exit
-pack .b
-update
-#.c configure -relief raised -bd 2 -name "Mozilla Firefox"
-#.c configure -relief raised -bd 2 -command $cmd
-
-
diff --git a/blt3.0.1/demos/container3.tcl b/blt3.0.1/demos/container3.tcl
deleted file mode 100755
index 5cb2845..0000000
--- a/blt3.0.1/demos/container3.tcl
+++ /dev/null
@@ -1,451 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-namespace import blt::*
-
-
-image create picture mini-apm-alert -data {
- R0lGODdhEAAQAPIAALLA3AAAAAAAoMDAwKCgoICAgP8AAP///ywAAAAAEAAQAAADSgiq1bGQ
- tTNKuBHMMmrwEdeMDfEAhqENROu2Z7q6xhurXJvWsCLnOpsPx3q5bjNjD0VULhdAJTJqnBZ0
- qZbgBAkIvuBtRnEpYyIJADs=
-}
-
-image create picture mini-apm-empty -data {
- R0lGODdhEAAQAPIAALLA3AAAAMDAwKCgoICAgP8AAP///wAAACwAAAAAEAAQAAADSQiq1LGQ
- NSNIuBFMImrwUVE0ZCNGhDisq/hAnNoWw7twgyrbjDDTK57Gl5PVUD4dUBgDFo8w40woZZ1g
- BJYWCglsgxnFZYyJJAAAOw==
-}
-
-image create picture mini-apm-full -data {
- R0lGODdhEAAQAPIAALLA3AAAAAAAoMDAwICAgP8AAP///wAAACwAAAAAEAAQAAADQAiq1LGQ
- NTNIuBFMMmrwEdeMjfBAnKCu6rmkasG6zBAXchva8byzPhQPaPoRi8Ij8jUE0jSEW265CByf
- 1YsWmwAAOw==
-}
-
-image create picture mini-apm-half -data {
- R0lGODdhEAAQAPIAALLA3AAAAAAAoMDAwKCgoICAgP8AAP///ywAAAAAEAAQAAADRwiq1bGQ
- tTNKuBHMMmrwEdeMDfFAHKGu6rmkqsG6zBAbchva8byzKwFNMxAYj8YhB4lUFpnJHTSKKhhx
- huMQEJhuFZcwJpIAADs=
-}
-
-image create picture mini-apm-loading -data {
- R0lGODdhEAAQAPMAALLA3AAAAP//AMDAwKCgoICAgP8AAICAAP///wAAAAAAAAAAAAAAAAAA
- AAAAAAAAACwAAAAAEAAQAAAEXRBIWWo4oNyZKxqHcFzi5BUDKBYhRg1VFcqC9hJ4rFvZkH+p
- ICzQwxk0gaSSWDQWENCUrfkTTlGCbA0oZWK1ggBw2gNnl5yd9smkPKGI2KcNgCoH8AEdkOQv
- +xwAEQA7
-}
-
-image create picture mini-apm-online -data {
- R0lGODdhEAAQAPIAALLA3AAAAICAAMDAwICAgP//AP///wAAACwAAAAAEAAQAAADRQi6QCHt
- sSkKrHAuDLhWFUGEwSeeaMkQxuC+g6M5QW2rs6G7stm+vRwsqAn8iJ/bBLVg4RosneHUeups
- A+ngCagtblxAAgA7
-}
-
-image create picture mini-apm-unknown -data {
- R0lGODdhEAAQAPIAALLA3AAAAP//AMDAwICAgP8AAP///wAAACwAAAAAEAAQAAADRAiq1LGQ
- NTNIuBFMMmrwEdeMjfBAnKCu6rmkQiGvLjPEa9GGt676Nc0tR+MRi6ghDvlSskzGHytYeu4i
- ASs0A7h4MZEEADs=
-}
-
-image create picture mini-folder -data {
- R0lGODdhIAAbAPIAALLA3ICAgP//////AMDAwAAAAICAAAAAACwAAAAAIAAbAAADeQgK0e4r
- yhmDuBgHyqUdBCiGxNZxHzmO5lkRcCzPT10XTKbvPF8UqZVqKBQagAKisrg8BpdQpjPJrEan
- 1qxyGu0Wsd4wiKsth8BmLVnsRbOt6/QVKVcj3206Hn6vz59+Rn17TXqBW0AGiouMjY6Pijg/
- k5SVlpeTAAkAOw==
-}
-
-image create picture mini-arch -data {
- R0lGODdhEAAQAPEAAICAgAAAAMBkMv+gMiwAAAAAEAAQAAACQQSCqXoi46B7YtlVA51Q1sxN
- EaQhmyKWmoMYzTCoZOUes/kF9SrHtKvxIW47mIr1M/AyxqQtF2wVYzpG7ZC4arcFADs=
-}
-
-image create picture mini-asmail -data {
- R0lGODdhEAAQAPMAAJSUlP///97e3mNjYzz4NK2trfgUQL29vXNzc0JCQoCAgAAAAAAAAAAA
- AAAAAAAAACwAAAAAEAAQAAAEVFDJOYGgmA5iMwaGIYwfAAzDqJLT6q4ScMyvOsSyW9i3MhwC
- hGo3GhR6JuHLeEAoAgUTcGVEWA9Q089WOCQTWROgcBxYv2GxWoxIeK3weDzhqdvrEQA7
-}
-
-image create picture mini-audiovol -data {
- R0lGODdhDgAOAPEAALLA3AAA7v///2ZmZiwAAAAADgAOAAACMYQdcxgLkdhQK8E0oIMz4+19
- ztMNwohQ5zkmK8BK0Xtel0I/tgv3uq3y7SiGmARlKAAAOw==
-}
-
-image create picture mini-ball -data {
- R0lGODdhEAAQAPEAALLA3AAAAP///4CAgCwAAAAAEAAQAAACG4SPqcvtD1mYMAhBncVh6Dl5
- Xyc6wxml6so+BQA7
-}
-
-image create picture mini-bball -data {
- R0lGODdhEAAQAPEAALLA3AAA/////4CAgCwAAAAAEAAQAAACG4SPqcvtD1mYMAhBncVh6Dl5
- Xyc6wxml6so+BQA7
-}
-
-image create picture mini-bomb -data {
- R0lGODdhEAAQAPIAALLA3AAAAICAgMDAwP//AP///wAAAAAAACwAAAAAEAAQAAADPAi63K4h
- vhZWneDaGTV0nbQxgVAMHbkIQcF2wpgFw5sqBJCHHVHlhNwsJEDhggpbhBXTUXgeh62JqVon
- CQA7
-}
-
-image create picture mini-book1 -data {
- R0lGODdhEAAQAPIAALLA3AAAAP8AAP//AICAgP///wAAAAAAACwAAAAAEAAQAAADPAi63K4h
- vBaFkLNai5neWwcEwwCeXVSeIBZcK8uNXNymtckFBeHlkUKPIHpdeMOI48UjEEWUwHPigVKv
- CQA7
-}
-
-image create picture mini-book2 -data {
- R0lGODdhEAAQAPEAAL+/vwAAAICAgP///ywAAAAAEAAQAAACOYSPeRHqIUZbLMEhAcNzRf5J
- lXFxGNiVUgil7Lm6p9p6M1zbK5fbgYgRdDwMgdE4JLUYzKTSAY0CCgA7
-}
-
-image create picture mini-books -data {
- R0lGODdhEAAQAPIAAICAgP////8AAAAA/wAAAP//AAAAAAAAACwAAAAAEAAQAAADSgi63B3B
- wRdFGGoSBy5exaYIwjJgRQGECwlgJ0Bs7FjGqFoDLgGvOhGvJIgBV0KXwKdIIVtEX+6Zqcww
- k11PQVMJZbPG7MspmzkJADs=
-}
-
-image create picture mini-briefcase -data {
- R0lGODdhEAAQAPIAALLA3ICAAMDAwAAAAICAgP///wAAAAAAACwAAAAAEAAQAAADSQi63B4Q
- OhaKuCJMFcT4g9ZEZFgClWANAuGpahBegTsUa1eHRY17v5lMRyrWCLwOZpnJzJo6aAZZiVqh
- z6uVauzKAKCw+LMpJwAAOw==
-}
-
-image create picture mini-bug1 -data {
- R0lGODdhEAAQAPIAALLA3AAAAMDAwICAgP///wAAAAAAAAAAACwAAAAAEAAQAAADNAi63P5Q
- hTWjDDUKzEUcAcENEChiIOlgxCCA2MoF2yxjddwEMD1mjA4H4ituLDygZckEJAAAOw==
-}
-
-image create picture mini-bug2 -data {
- R0lGODdhEAAQAPIAALLA3AAAAICAgMDAwP///wAAAAAAAAAAACwAAAAAEAAQAAADOAi63A5h
- xceCpUvYLajQW/A9FsFdjWZ+oFiV1hCiyiyHjT1XbXBbmtzmN+ENTw/QrYMBCAbMZjMBADs=
-}
-
-image create picture mini-bx2 -data {
- R0lGODdhEAAQAPAAALLA3AAAACwAAAAAEAAQAAACIoSPqcuNAeEKL9Kn7AU7ae5EoAOKDfVN
- R4pVptGtFknXdQEAOw==
-}
-
-image create picture mini-calc -data {
- R0lGODdhEAAQAPIAALLA3ICAgP///wAAANnZ2QAAAAAAAAAAACwAAAAAEAAQAAADRAi63Bow
- SgmCuDjjUQUhQyiKYPcN2hWU1jdJrPfN9NkFA4Hr+c5ZIVAuSLz1jrwYcciM7Z7In2AprP5q
- WBtgxB05vo0EADs=
-}
-
-image create picture mini-camera -data {
- R0lGODdhEAAQAPEAALLA3AAAAP///4CAgCwAAAAAEAAQAAACNYSPqRDta4KYNCAnhxviyYo1
- YBgMJplp5XSWqtByptrC9HyLc7O7bx/q2YA4DQNFgiiXTGYBADs=
-}
-
-image create picture mini-cat -data {
- R0lGODdhEAAQAPEAAICAgAAAAP//AP8AACwAAAAAEAAQAAACOYSPecGqIUR4YNZoEdw36yh1
- FTNBoGSa2Cah5xsN2AW/llqHHYjPdErydTiblCG1wvhIo2PJ44gWAAA7
-}
-
-image create picture mini-cave -data {
- R0lGODdhEAAQAPMAAAD//wBy/QAA/AAAuAD/jwD/Cv+EAHL/AP//AA8Pbf8AAP9FAP/HAAAA
- AAAAAAAAACwAAAAAEAAQAAAEWhBIGaq4I+c5a7iCNhBEYRzGCFjggCAJARCJ8hKskOwJIAAw
- Cc5C4yVgiUEBODHydL9dgVRw8haJxeKAtO4WBgSDofAaGYcD1sxD49iJwAE9hbcRZXtPz7dH
- AAA7
-}
-
-image create picture mini-cd -data {
- R0lGODdhEAAQAPIAALLA3ICAgP//AMDAwAAAAAD//wD/AP///ywAAAAAEAAQAAADUQiq0b2Q
- BSGGJSSCUGi1FxQYRfdZx5AxBkmBqcpYbYeCcgCSAaHjmR8tQ8DlcIceB7iBoQyCAmili9Gi
- 0tXGesVqm7gW5SvZGTCaRQNDTrsVCQA7
-}
-
-image create picture mini-cdlabel -data {
- R0lGODdhEAAQAPEAALLA3AAAAICAgAAAACwAAAAAEAAQAAACM4SPecEg8SJcIFQpqVWpsfcx
- 21aVBmmlZTqpbinE66yeVUt7NC2/qAkciYYQEeeITCoTBQA7
-}
-
-image create picture mini-chinese -data {
- R0lGODdhEAAQAPAAAICAgAAA/ywAAAAAEAAQAAACJoQdB6kXrx5ri0FapZ4R2baFEpVAHFkt
- WCaunuuFcDq/NV1f91oAADs=
-}
-
-image create picture mini-clipboard -data {
- R0lGODdhEAAQAPIAALLA3AAAAP//AICAAICAgMDAwAAAgP///ywAAAAAEAAQAAADUgi63B4w
- OBWhEFXSQUbAX9ARmkgWaCp6BBBwWUSQ7TpyeCe6+WD8QMPOxjEcjsdfrWdEHowG141gjDyB
- r1vTmSRSD7Gnq7LlRgGzWXB9bqTfswQAOw==
-}
-
-image create picture mini-clock -data {
- R0lGODdhEAAQAPEAALLA3AAAAP///8DAwCwAAAAAEAAQAAACMoSPqRDda5qY86UwaKAjXCps
- GiJqYHiU1elFoPSmrNoybDjKZ55me6eAaWpBBxGCTCoKADs=
-}
-
-image create picture mini-colors -data {
- R0lGODdhEAAQAPIAALLA3ICAgP8AAP//AAAA/wAAAP///wAAACwAAAAAEAAQAAADPgi63P4w
- skCrtSqILYYfREgEBaBxHyiSJtd94lieWxqzgaEbVuEXuB2v8gPOhL1fcJf04S5QSglQrFYl
- WGwCADs=
-}
-
-image create picture mini-connect -data {
- R0lGODdhEAAQAPIAALLA3AAAAICAgP8AAP//AAAAAAAAAAAAACwAAAAAEAAQAAADLwi63P7Q
- hbgECJaKMfJ8GzdcWROKHXSKpYl2n7MKsUkIOK3edFAzAh6l0tIMj44EADs=
-}
-
-image create picture mini-crosbone -data {
- R0lGODdhEAAQAPEAAICAgAAAAP///8DAwCwAAAAAEAAQAAACQUQCqXqMu5qRMJ0HxBV8jygM
- 4jhoUPAhKTBgVnvAqGtkIcrVJ1uKeoUi0Rwz2SnQmSE1j4PgJXowLRHKr4LNagEFADs=
-}
-
-image create picture mini-cross -data {
- R0lGODdhEAAQAPEAALLA3P8AAICAgAAAACwAAAAAEAAQAAACKISPqcsbHgQKFEpAM8x0DMYF
- X8ONYNhgovpApqasU5TItWngiZ72TAEAOw==
-}
-
-image create picture mini-desktop -data {
- R0lGODdhEAAQAPIAAICAgACAgAAAAAD//8DAwP///4CAAP//ACwAAAAAEAAQAAADQgi6EMIQ
- BveidEBUG8asWqSNobJZzIku6tq62UIARSEQhkHsRDXXNtwhd/PRgoaD8vB49EjPkekIrAJj
- K0iTxCUpEgA7
-}
-
-image create picture mini-dfolder -data {
- R0lGODdhEAAQAPIAALLA3ICAgMDAwP//AAAA/wAAAP///wAAACwAAAAAEAAQAAADSQi63BsQ
- OhbEsCJMUK/PkcQZZGmSQTF+YTtiwWkWsRcTeB7TBmwQP52BZwvmCLuY74hLGopM5LAVo+4A
- hax2u93ESJkNlqsFJAAAOw==
-}
-
-image create picture mini-diff -data {
- R0lGODdhEAAQAPEAALLA3P8AAAAAAP///ywAAAAAEAAQAAACQYSPqcLtckSYQYyLIZDGVnxB
- HDBYw5dtAbldaKhGrhkyVTODTBnU07PjUSiaTsZBlIEyydbS93M+RVGgo1NUaA0FADs=
-}
-
-image create picture mini-diskette -data {
- R0lGODdhEAAQAPIAAAAAgAAAAICAgP//AODg4P///8DAwAAAACwAAAAAEAAQAAADQAgQ3B5K
- qEGrHQoCwrsnmVKMZFmE2/ehZouq6yK2JarcOK4pRu8bOhwQ8AvehsXbjsjzGXnNnk4STWYE
- goe2kQAAOw==
-}
-
-image create picture mini-display -data {
- R0lGODdhEAAQAPIAALLA3ICAgP///wAAAAAA/8DAwAAAAAAAACwAAAAAEAAQAAADPgi63Bsw
- SviEvdgOFcT4INhtwEic6DlyHiGkqscOMLqWbU3cps7ntd9gIpHhMkgSIMQEOTqXQkC5aDYd
- 2EYCADs=
-}
-
-image create picture mini-doc -data {
- R0lGODdhEAAQAPIAALLA3ICAgMDAwAAAAP///wAAAAAAAAAAACwAAAAAEAAQAAADNAix3PAw
- kEmnCPDJSgXBEUcN5BCKnamh6ckKqsJa8fbWMwG76L7OPhkQN4wIjshksMRsqhIAOw==
-}
-
-image create picture mini-doc1 -data {
- R0lGODdhEAAQAPEAALLA3AAAAP///4CAgCwAAAAAEAAQAAACOYSPicEdeoKYk0EghxbyKUlx
- zSdomxYMCRhW6lKaW7q2FA3L8xvZbq0bcHgGVgsXcSiJhqDsAgUUAAA7
-}
-
-image create picture mini-dog -data {
- R0lGODdhEAAQAPEAAICAgAAAAP///8DAwCwAAAAAEAAQAAACPoSPqRbt6oKYgiEpxqA1XKkJ
- zeRdGTZg4pVybgk0sTvFMENydhJsI3WbTVIRnoiSWqhsMmOIEzRwntGFFVAAADs=
-}
-
-image create picture mini-edit -data {
- R0lGODdhEAAQAPIAALLA3AAAAICAgP///wAA/wAAAAAAAAAAACwAAAAAEAAQAAADPwi63CAw
- RveGvUMEJ7LMw7YQHWZpgUiQXoRta1CaVxBX0ndXtLXjOQ1BpJi9UkRgBBliGEMvZ6/GQFqv
- lGwjAQA7
-}
-
-image create picture mini-espada -data {
- R0lGODdhEAAQAPAAAICAgAAAACwAAAAAEAAQAAACIoSPqRbr7RSMJ1jK7I26v+4l4CiOYWVq
- 0tWo1IQBMHfGSwEAOw==
-}
-
-image create picture mini-exclam -data {
- R0lGODdhEAAQAPIAALLA3ICAgACAAP///wAAAAAAAAAAAAAAACwAAAAAEAAQAAADLQi6GsKQ
- hSFEiJJWglf9XOeAV/dtnXKGKZh6AvvGLyOnU1UDZznHPhwhuEslAAA7
-}
-
-image create picture mini-exp -data {
- R0lGODdhEAAQAPEAALLA3AAAAICAgP//ACwAAAAAEAAQAAACMoSPqRbrzYQDYbQAD97VWtUN
- 4shJzIiSSZhmDKuuaayJmN1lHGVT2GHSuAJB0OSInBQAADs=
-}
-
-image create picture mini-eye -data {
- R0lGODdhEAAQAPEAALLA3AAAAIKCgsPDwywAAAAAEAAQAAACK4SPqcvtb4KcYs1wKJIADzF0
- HTZGgBBU5JiaX0hWh6Bmp5yoHA71/g+EFAAAOw==
-}
-
-image create picture mini-eyes -data {
- R0lGODdhEAAQAPIAALLA3AAAAICAgMDAwP///wAAAAAAAAAAACwAAAAAEAAQAAADPwi63P4w
- tkDDqvYOQoYNW5eBHOeF5leWwcoFQuvKK9xSLIG/sSefO48AQBL1UoIhsZJcUpqLJBQgVUqu
- 2KwiAQA7
-}
-
-image create picture mini-fax -data {
- R0lGODdhEAAQAPIAALLA3ICAgAAAAMDAwP///wAAAAAAAAAAACwAAAAAEAAQAAADSAi6HM5w
- BUIfdI5qIuQk39Yp0zBkokScpTlwJ1DOQuAKZkYHtXvWu17OAaSYhBii0DhMdnC5VZI3Agig
- LGXEitNuF9fqd7xIAAA7
-}
-
-image create picture mini-fdisk -data {
- R0lGODdhEAAQAPIAALLA3ICAgMDAwAAAAP8AAP///wAAAAAAACwAAAAAEAAQAAADMgi63P4w
- yhmqvVYFwbvnwRAUZGmSlfh9hJBu3eW9bjrcVq125hxiQMtAcSsajZOkcpkAADs=
-}
-
-image create picture mini-filemgr -data {
- R0lGODdhEAAQAPIAALLA3ICAgMDAwAAAAP///wAAAAAAAAAAACwAAAAAEAAQAAADPggK0f5L
- BUGraCO+jTX5IDF0S0BY1Bhk5TkMlcpKJyp7qHCXb9+TtNBnR8sRGS5YCog0riJN24zn60Gv
- 2EUCADs=
-}
-
-image create picture mini-folder -data {
- R0lGODdhEAAQAPIAALLA3ICAgMDAwP//AAAAAP///wAAAAAAACwAAAAAEAAQAAADOwi63BsQ
- OhbEsCJMUK/PkcQVZGmSATF+rJWOWHu9QSHHdBHvs1rfnhxvlwO6fKFkSAUgOJ9Q6GZKdSQA
- ADs=
-}
-
-image create picture mini-font -data {
- R0lGODdhEAAQAPEAALLA3AAAAICAgAAAACwAAAAAEAAQAAACJ4SPqcvtF8IzMYhXrYuCN95p
- Cwh4Y2YmoBBequWWIpLKMcIm+cQ3BQA7
-}
-
-image create picture mini-fractal -data {
- R0lGODdhEAAQAPIAALLA3AAAAICAgP8AAP//AMDAwACAAAAA/ywAAAAAEAAQAAADSQi63BpB
- MAHjqvCNQXh4T7V15Fd8gZF24iZpxqBe3hXPALp9j4HzgcMAuBnmLofDK7AL5ZJE1iMJvZQu
- kFeOZHTQrt4HlxcuexMAOw==
-}
-
-image create picture mini-frame -data {
- R0lGODdhEAAQAPEAALLA3P8AAAAAAAAAACwAAAAAEAAQAAACM4SPqcGsGISU4YF43V3izrpx
- IdMlWFRhZqeeD+rFJniWEHu4ptGwNmSQyF4NlQUw+R2PBQA7
-}
-
-image create picture mini-ftp -data {
- R0lGODdhEAAQAPEAAICAgP///wAAAAAA/ywAAAAAEAAQAAACNoSPqcEdelwDDwh7w9hN+ItI
- EhhtphmQhuiolMa1l/eyaQKf3ZzZd3gatHA+l+93+CiVkCagAAA7
-}
-
-image create picture mini-gball -data {
- R0lGODdhEAAQAPEAALLA3ACAAP///4CAgCwAAAAAEAAQAAACG4SPqcvtD1mYMAhBncVh6Dl5
- Xyc6wxml6so+BQA7
-}
-
-image create picture mini-go -data {
- R0lGODdhEAAQAPEAAICAgAAA//8AAP///ywAAAAAEAAQAAACMoSPecEpj8IYzYgJjaTh3JEB
- zOg9oViVgsK27gtbJ9p52KpN6Rduu4mjpQCmBCmGdBUAADs=
-}
-
-image create picture mini-gopher -data {
- R0lGODdhEAAQAPIAAICAgICAAIAAAP///wAAAAAAAAAAAAAAACwAAAAAEAAQAAADSQgKESLN
- LRXAg+41SzO+zbM4Q0mawuQQxECy0ijAGZzKmheOHst+qcvFRwAKQT8joIhkhggK5oywoq4m
- LFSJNZloB92weExWJAAAOw==
-}
-
-image create picture mini-graph -data {
- R0lGODdhEAAQAPIAAICAgAAAAP8A/wAA/wD/AP8AAAAAAAAAACwAAAAAEAAQAAADOwi6G86Q
- CRGindUCV7EGw9BRXzhmlgl4DAeKK8kQRKWyC23Dnqu/J0ChUPndSMNiDRirJDnQKPRDrSoS
- ADs=
-}
-
-image create picture mini-gv -data {
- R0lGODdhEAAQAPEAALLA3AAAAP///wAAACwAAAAAEAAQAAACMYSPqcGhGYQU7oE4ZV1ZP0Zp
- FINgYYhtZjdtF9tyrHussdzRL0yV7e+pNS4kkuUIKAAAOw==
-}
-
-image create picture mini-hammer -data {
- R0lGODdhEAAQAPEAAL+/vwAAAP///4CAgCwAAAAAEAAQAAACK4SPiRHAr5wQYdqWqt00i6FN
- TLc0TzA4WAQZq9JG5SurtBzXtn7ktc8L6goAOw==
-}
-
-image create picture mini-happy -data {
- R0lGODdhEAAQAPEAALLA3AAAAP//AAAAACwAAAAAEAAQAAACM4SPqRDda5qY86VAc70VSxEg
- WAeO4GFK3xlpbti6GcxU2kjXpbOJFN8TmToQhiNXTCoPBQA7
-}
-
-image create picture mini-hdisk -data {
- R0lGODdhEAAQAPIAALLA3ICAgMDAwAAAAACAAP///wAAAAAAACwAAAAAEAAQAAADLgi63P4w
- yhmqvVYFwbvnwRAUZGmSlfh9hJBu6/e62EWr53nXfKgMwKAwOCkajwkAOw==
-}
-
-image create picture mini-heart -data {
- R0lGODdhEAAQAPAAAICAgAAAACwAAAAAEAAQAAACIoSPqbvh54KKj0pogb16b+RRSRhNIeMx
- RqauTwvBoBzTbQEAOw==
-}
-
-image create picture mini-hex -data {
- R0lGODdhEAAQAPEAAICAgP///wAAAAAA/ywAAAAAEAAQAAACO4SPecHdIBIbjQYQ4qLcQqFh
- 3FRlS2ChZei0DauSJDtYY20a8qjC6Z/DuFq+0myjulFoydjyAIpKpYACADs=
-}
-
-image create picture mini-hextris -data {
- R0lGODdhEAAQAPIAALLA3ICAgP//AAAAAP8AAAAAAAAAAAAAACwAAAAAEAAQAAADNAi63P5Q
- hRlXEHjUSzrR0eANQQUMaLlhAvlM3EhZrNgNtSR4H7qPCttHJXQFUwyU0cRsMhMAOw==
-}
-
-image create picture mini-iconify -data {
- R0lGODdhEAAOAPEAALLA3P8AAAAAAAAAACwAAAAAEAAOAAACKoyPKSHt7xgDtFoqxd0g8+tV
- iIYtJHacIWqopgWJ7ydPdGnfUsKn0A8pAAA7
-}
-
-image create picture mini-icons -data {
- R0lGODdhEAAQAPIAAICAgP///wAAAAAA/wD/AP8AAP//AAAAACwAAAAAEAAQAAADPAi63BoQ
- ihfDBGFo+4jnmDaAgUeQImmS1VWBQiwr8uzceL68bvsUQJJhSAIWhESXEWlgRXpPWu0yvega
- CQA7
-}
-
-image create picture mini-keyboard -data {
- R0lGODdhEQAQAPEAAICAgP///wAAAMDAwCwAAAAAEQAQAAACPYSPecHtDgQIqsY5hwiab31R
- QzQKZRlqwsq2kuTFHQPC2nkPqO32LxZrdGoYnI50gUV8rYul8mL2ntRqogAAOw==
-}
-
-set images1 {
- apm-alert apm-empty apm-full apm-half apm-loading apm-online
- apm-unknown folder arch asmail audiovol ball bball
-}
-set images2 {
- bomb book1 book2 books briefcase bug1 bug2 bx2 calc camera cat
- cave cd cdlabel chinese clipboard clock colors connect crosbone
-}
-set images3 {
- cross desktop dfolder diff diskette display doc doc1 dog edit
- espada exclam exp eye eyes fax fdisk filemgr font fractal
-}
-set images4 {
- frame ftp gball go gopher graph gv hammer happy hdisk heart hex
- hextris iconify icons keyboard
-}
-
-proc MakeContainer { count images } {
- set c .c$count
- set top .top$count
- set b .b$count
-
- blt::container $c -bd 0 -highlightthickness 0
- toplevel $top
- wm withdraw $top
-
- wm protocol $top WM_DELETE_WINDOW "$b invoke"
-
- frame $top.f -relief raised -highlightthickness 0
- pack $top.f -expand yes -fill x
-
- foreach img $images {
- button $top.f.$img -image mini-$img -bd 1 -command "puts $img" \
- -highlightthickness 0
- pack $top.f.$img -side left -padx 0 -pady 0
- }
- global $img
- checkbutton $b -variable $img -onvalue $top -offvalue "" -command \
- [subst -nocommands { $c configure -window \$$img }]
- $b select
- blt::table . \
- $b $count,0 -anchor w \
- $c $count,1 -fill x
- blt::table configure . c0 -resize none
- blt::table configure . r$count -resize none
- after 1 [subst {
- update
- wm deiconify $top
- $c configure -window $top
- }]
- return $c
-}
-
-MakeContainer 1 $images1
-MakeContainer 2 $images2
-MakeContainer 3 $images3
-MakeContainer 4 $images4
-
-canvas .a
-blt::table . .a -cspan 40
-
diff --git a/blt3.0.1/demos/ctree1.tcl b/blt3.0.1/demos/ctree1.tcl
deleted file mode 100644
index 81eaa16..0000000
--- a/blt3.0.1/demos/ctree1.tcl
+++ /dev/null
@@ -1,55 +0,0 @@
-
-proc find { tree parent dir } {
- global count
- set saved [pwd]
-
- cd $dir
- foreach f [glob -nocomplain *] {
- set name [file tail $f]
- if { [file type $f] == "directory" } {
- set node [$tree insert $parent -label $name]
- find $tree $node $f
- }
- }
- cd $saved
-}
-
-set tree [blt::tree create]
-set path ../..
-find $tree root $path
-$tree label root [file normalize $path]
-if { [file exists ../library] } {
- set blt_library ../library
-}
-puts [$tree label 0]
-# -postcommand {.e.m configure -width [winfo width .e] ; update} \
-set myIcon ""
-blt::comboentry .e \
- -font { arial 9 } \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -textwidth 20 \
- -menu .e.m \
- -menuanchor se \
- -exportselection yes \
- -command "puts {button pressed}"
-
-blt::combotree .e.m \
- -tree $tree \
- -borderwidth 1 \
- -font { arial 10 } \
- -textvariable myText1 \
- -iconvariable myIcon1 \
- -separator / \
- -height -200 \
- -linecolor grey50 \
- -yscrollbar .e.m.ybar \
- -xscrollbar .e.m.xbar
-
-blt::tk::scrollbar .e.m.xbar
-blt::tk::scrollbar .e.m.ybar
-
-focus .e.m
-
-blt::table . \
- .e -fill x
diff --git a/blt3.0.1/demos/ctree2.tcl b/blt3.0.1/demos/ctree2.tcl
deleted file mode 100644
index 66e1d96..0000000
--- a/blt3.0.1/demos/ctree2.tcl
+++ /dev/null
@@ -1,47 +0,0 @@
-
-proc find { tree parent dir } {
- global count
- set saved [pwd]
-
- cd $dir
- foreach f [glob -nocomplain *] {
- set name [file tail $f]
- if { [file type $f] == "directory" } {
- set node [$tree insert $parent -label $name]
- find $tree $node $f
- }
- }
- cd $saved
-}
-
-set tree [blt::tree create]
-set path ../..
-find $tree root $path
-$tree label root [file normalize $path]
-if { [file exists ../library] } {
- set blt_library ../library
-}
-puts [$tree label 0]
-# -postcommand {.e.m configure -width [winfo width .e] ; update} \
-set myIcon ""
-blt::combobutton .b \
- -text "Select Directory" \
- -command "puts {button pressed}" \
- -font { arial 10 bold } \
- -menu .b.m
-
-blt::combotree .b.m \
- -tree $tree \
- -borderwidth 1 \
- -font { arial 10 } \
- -separator / \
- -yscrollbar .b.m.ybar \
- -xscrollbar .b.m.xbar
-
-blt::tk::scrollbar .b.m.xbar
-blt::tk::scrollbar .b.m.ybar
-
-focus .b
-
-blt::table . \
- .b -fill x
\ No newline at end of file
diff --git a/blt3.0.1/demos/dnd1.tcl b/blt3.0.1/demos/dnd1.tcl
deleted file mode 100755
index 0a36481..0000000
--- a/blt3.0.1/demos/dnd1.tcl
+++ /dev/null
@@ -1,202 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-
-source scripts/demo.tcl
-
-if { ([info exists tcl_platform]) && ($tcl_platform(platform) == "windows") } {
- source scripts/send.tcl
- SendInit
- SendVerify
-}
-
-proc OnEnter { widget args } {
- array set info $args
- $widget configure -highlightbackground red
- return 1
-}
-
-proc OnMotion { widget args } {
- puts stderr "OnMotion: args=$args"
- array set info $args
- set x1 [$widget cget -bd]
- set x1 20
- set y1 $x1
- set x2 [expr [winfo width $widget] - $x1]
- set y2 [expr [winfo height $widget] - $y1]
- if { ($info(x) >= $x1) && ($info(x) <= $x2) &&
- ($info(y) >= $y1) && ($info(y) <= $y2) } {
- puts stderr "OnMotion: found args=$args"
-
- $widget configure -highlightbackground red -relief sunken -highlightthickness 10
- return 1
- }
- $widget configure -highlightbackground grey -relief raised
- return 0
-}
-
-proc OnLeave { widget args } {
- $widget configure -highlightbackground grey
- return 0
-}
-
-option add *OnEnter OnEnter
-option add *OnLeave OnLeave
-option add *OnMotion OnMotion
-
-# ----------------------------------------------------------------------
-# This procedure is invoked each time a token is grabbed from the
-# sample window. It configures the token to display the current
-# color, and returns the color value that is later passed to the
-# target handler.
-# ----------------------------------------------------------------------
-
-proc PackageSample { widget args } {
- array set info $args
- set bg [.sample cget -background]
- set fg [.sample cget -foreground]
- $info(token).label configure -background $bg -foreground $fg
- return 1
-}
-
-proc ShowResult { widget args } {
- puts stderr args=$args
- array set info $args
- puts "drop transaction($info(timestamp)) completed: result was $info(action)"
-}
-
-
-# ----------------------------------------------------------------------
-# Main application window...
-# ----------------------------------------------------------------------
-image create picture openFolder -data {
-R0lGODdhEAAOAPIAAP///wAAAH9/f9nZ2f//AAAAAAAAAAAAACwAAAAAEAAOAAADOwgqzPoQ
-iDjjAoPkIZuTgCZykBCA2ziaXusRrFUGQ5zeRMCcE76xvJBPozuBVCmT0eUKGAHOqFQqqwIS
-ADs=
- }
-label .sample \
- -text "Color" \
- -height 12 \
- -width 20 \
- -bd 2 \
- -relief raised \
- -highlightthickness 2
-
-set cursors {
- { @bitmaps/hand/hand01.xbm bitmaps/hand/hand01m.xbm black white }
- { @bitmaps/hand/hand02.xbm bitmaps/hand/hand02m.xbm black white }
- { @bitmaps/hand/hand03.xbm bitmaps/hand/hand03m.xbm black white }
- { @bitmaps/hand/hand04.xbm bitmaps/hand/hand04m.xbm black white }
- { @bitmaps/hand/hand05.xbm bitmaps/hand/hand05m.xbm black white }
- { @bitmaps/hand/hand06.xbm bitmaps/hand/hand06m.xbm black white }
- { @bitmaps/hand/hand07.xbm bitmaps/hand/hand07m.xbm black white }
- { @bitmaps/hand/hand08.xbm bitmaps/hand/hand08m.xbm black white }
- { @bitmaps/hand/hand09.xbm bitmaps/hand/hand09m.xbm black white }
- { @bitmaps/hand/hand10.xbm bitmaps/hand/hand10m.xbm black white }
- { @bitmaps/hand/hand11.xbm bitmaps/hand/hand11m.xbm black white }
- { @bitmaps/hand/hand12.xbm bitmaps/hand/hand12m.xbm black white }
- { @bitmaps/hand/hand13.xbm bitmaps/hand/hand13m.xbm black white }
- { @bitmaps/hand/hand14.xbm bitmaps/hand/hand14m.xbm black white }
-}
-
-
-# Set up the color sample as a drag&drop source and target for "color" values:
-blt::dnd register .sample \
- -source yes \
- -target yes \
- -package PackageSample \
- -result ShowResult \
- -cursors $cursors
-
-blt::dnd getdata .sample color GetColor
-blt::dnd setdata .sample color SetColor
-
-# Establish the appearance of the token window:
-set token [blt::dnd token window .sample]
-label $token.label -text "Color" -bd 2 -highlightthickness 1
-pack $token.label
-blt::dnd token configure .sample \
- -borderwidth 2 \
- -relief raised \
- -activerelief raised \
- -outline pink \
- -fill red \
- -anchor s
-
-if 1 {
- scale .redScale -label "Red" -orient horizontal \
- -from 0 -to 255 -command adjust_color
- frame .red -width 20 -height 20 -borderwidth 3 -relief sunken
-
- scale .greenScale -label "Green" -orient horizontal \
- -from 0 -to 255 -command adjust_color
- frame .green -width 20 -height 20 -borderwidth 3 -relief sunken
-
- scale .blueScale -label "Blue" -orient horizontal \
- -from 0 -to 255 -command adjust_color
- frame .blue -width 20 -height 20 -borderwidth 3 -relief sunken
-
- # ----------------------------------------------------------------------
- # This procedure loads a new color value into this editor.
- # ----------------------------------------------------------------------
- proc GetColor { widget args } {
- return [$widget cget -bg]
- }
-
- proc SetColor { widget args } {
- array set info $args
- set rgb [winfo rgb . $info(value)]
- set r [lindex $rgb 0]
- set g [lindex $rgb 1]
- set b [lindex $rgb 2]
-
- .redScale set [expr round($r/65535.0 * 255)]
- .greenScale set [expr round($g/65535.0 * 255)]
- .blueScale set [expr round($b/65535.0 * 255)]
- }
-
- # ----------------------------------------------------------------------
- # This procedure is invoked whenever an RGB slider changes to
- # update the color samples in this display.
- # ----------------------------------------------------------------------
- proc adjust_color {args} {
- set rval [.redScale get]
- .red configure -background [format "#%.2x0000" $rval]
- set gval [.greenScale get]
- .green configure -background [format "#00%.2x00" $gval]
- set bval [.blueScale get]
- .blue configure -background [format "#0000%.2x" $bval]
-
- .sample configure -background \
- [format "#%.2x%.2x%.2x" $rval $gval $bval]
- if {$rval+$gval+$bval < 1.5*255} {
- .sample configure -foreground white
- } else {
- .sample configure -foreground black
- }
- }
- blt::table . .redScale 1,0 -fill both
- blt::table . .red 1,1 -fill both
- blt::table . .greenScale 2,0 -fill both
- blt::table . .green 2,1 -fill both
- blt::table . .blueScale 3,0 -fill both
- blt::table . .blue 3,1 -fill both
-}
-blt::table . .sample 0,0 -columnspan 2 -fill both -pady {0 4}
-
-proc random {{max 1.0} {min 0.0}} {
- global randomSeed
-
- set randomSeed [expr (7141*$randomSeed+54773) % 259200]
- set num [expr $randomSeed/259200.0*($max-$min)+$min]
- return $num
-}
-set randomSeed [clock clicks]
-
-.redScale set [expr round([random 255.0])]
-.blueScale set [expr round([random 255.0])]
-.greenScale set [expr round([random 255.0])]
-bind .sample <KeyPress-Escape> { blt::dnd cancel .sample }
-focus .sample
-
-
diff --git a/blt3.0.1/demos/dnd2.tcl b/blt3.0.1/demos/dnd2.tcl
deleted file mode 100755
index c28cc3e..0000000
--- a/blt3.0.1/demos/dnd2.tcl
+++ /dev/null
@@ -1,305 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-if { ([info exists tcl_platform]) && ($tcl_platform(platform) == "windows") } {
- error "This script works only under X11"
-}
-
-canvas .c -width 320 -height 320 -background white
-
-blt::table . .c -fill both
-
-set lastCell ""
-set cellWidth 1
-set cellHeight 1
-proc RedrawWorld { canvas } {
- global cells cellWidth cellHeight
-
- $canvas delete all
-
- set width [winfo width $canvas]
- set height [winfo height $canvas]
-
- set cellWidth [expr $width / 8]
- set cellHeight [expr $height / 8]
-
- for { set row 0 } { $row < 8 } { incr row } {
- set y [expr $row * $cellHeight]
- set h [expr $y + $cellHeight]
- for { set column 0 } { $column < 8 } { incr column } {
- set x [expr $column * $cellWidth]
- set w [expr $x + $cellWidth]
- $canvas create rectangle $x $y $w $h -fill white -outline "" \
- -tags "$row,$column"
- }
- }
-
- for { set row 0 } { $row < 8 } { incr row } {
- set y [expr $row * $cellHeight]
- $canvas create line 0 $y $width $y
- }
-
- for { set column 0 } { $column < 8 } { incr column } {
- set x [expr $column * $cellWidth]
- $canvas create line $x 0 $x $height
- }
- foreach name [array names cells] {
- set rc [split $name ,]
- set row [lindex $rc 0]
- set column [lindex $rc 1]
- set x [expr ($column * $cellWidth) + 5]
- set y [expr ($row * $cellHeight) + 5]
- set w [expr $cellWidth - 10]
- set h [expr $cellHeight - 10]
- set color [lindex $cells($name) 0]
- set type [lindex $cells($name) 1]
- set pi1_2 [expr 3.14159265358979323846/180.0]
- set points {}
- switch $type {
- hexagon {
- lappend points $x [expr $y + $h/2] [expr $x + $w * 1/3] \
- $y [expr $x + $w * 2/3] $y [expr $x + $w] [expr $y + $h/2] \
- [expr $x + $w * 2/3] [expr $y + $h] \
- [expr $x + $w * 1/3] [expr $y + $h]
- }
- parallelogram {
- lappend points $x [expr $y + $h * 2/3] \
- [expr $x + $w * 2/3] $y \
- [expr $x + $w] [expr $y + $h * 1/3] \
- [expr $x + $w * 1/3] [expr $y + $h]
- }
- triangle {
- lappend points \
- $x [expr $y + $h] \
- [expr $x + $w * 1/2] $y \
- [expr $x + $w] [expr $y + $h]
- }
- }
- eval .c create polygon $points -fill $color -outline black
- }
-}
-
-bind .c <Configure> { RedrawWorld %W }
-
-# ----------------------------------------------------------------------
-# USAGE: random ?<max>? ?<min>?
-#
-# Returns a random number in the range <min> to <max>.
-# If <min> is not specified, the default is 0; if max is not
-# specified, the default is 1.
-# ----------------------------------------------------------------------
-
-proc random {{max 1.0} {min 0.0}} {
- global randomSeed
-
- set randomSeed [expr (7141*$randomSeed+54773) % 259200]
- set num [expr $randomSeed/259200.0*($max-$min)+$min]
- return $num
-}
-set randomSeed [clock clicks]
-
-set itemTypes { parallelogram hexagon triangle }
-set itemTypes { hexagon triangle parallelogram }
-
-for { set i 0 } { $i < 20 } { incr i } {
- while { 1 } {
- set row [expr int([random 8])]
- set column [expr int([random 8])]
- set type [expr int([random 3])]
- set type [lindex $itemTypes $type]
- if { ![info exists cells($row,$column)] } {
- set r [expr int([random 256 128])]
- set g [expr int([random 256 128])]
- set b [expr int([random 256 128])]
- set cells($row,$column) [format "#%.2x%.2x%.2x %s" $r $g $b $type]
- break
- }
- }
-}
-
-proc ScreenToCell { widget x y } {
- global cellWidth cellHeight
- set column [expr $x / $cellWidth]
- set row [expr $y / $cellHeight]
- return $row,$column
-}
-
-
-set count 0
-foreach i [winfo interps] {
- puts $i
- if { [string match "dnd2.tcl*" $i] } {
- incr count
- }
-}
-
-if { $count == 1 } {
- toplevel .info
- raise .info
- text .info.text -width 65 -height 12 -font { Helvetica 10 } -bg white \
- -tabs { 0.25i }
- .info.text insert end {
- This is a more involved example of the new "dnd" command.
- Run this script again to get another window. You can then drag
- and drop symbols between the windows by clicking with the left
- mouse button on a symbol.
-
- It demonstates how to
- o Drag-and-drop on specific areas (canvas items) of a widget.
- o How to receive and handle Enter/Leave/Motion events in the target.
- o How to send drag feedback to the source.
- o Use a drag threshold.
- }
- button .info.quit -text "Dismiss" -command { destroy .info }
- blt::table .info \
- 0,0 .info.text -fill both \
- 1,0 .info.quit
-}
-
-
-# -----------------------------------------------------------------
-#
-# Setup finished. Start of drag-and-drop code here.
-#
-
-# Set up the entire canvas as a drag&drop source.
-
-blt::dnd register .c -source yes -dragthreshold 5 -button 1
-
-# Register code to pick up the information about a canvas item
-
-blt::dnd getdata .c color GetColor
-
-proc GetColor { widget args } {
- array set info $args
- global itemInfo
- set id $itemInfo($info(timestamp))
- set color [$widget itemcget $id -fill]
- set ncoords [llength [$widget coords $id]]
- if { $ncoords == 6 } {
- set type triangle
- } elseif { $ncoords == 8 } {
- set type parallelogram
- } elseif { $ncoords == 12 } {
- set type hexagon
- } else {
- error "unknown type n=$ncoords"
- }
- return [list $color $type]
-}
-
-blt::dnd configure .c -package PackageSample
-
-proc PackageSample { widget args } {
- array set info $args
-
- # Check if we're over a canvas item
- set items [$widget find overlapping $info(x) $info(y) $info(x) $info(y)]
- set pickedItem ""
- foreach i $items {
- if { [$widget type $i] == "polygon" } {
- set pickedItem $i
- break
- }
- }
- if { $pickedItem == "" } {
- # Cancel the drag
- puts "Cancel the drag x=$info(x) y=$info(y)"
- return 0
- }
- set fill [$widget itemcget $pickedItem -fill]
- set outline [$widget itemcget $pickedItem -outline]
-
- set ncoords [llength [$widget coords $pickedItem]]
- if { $ncoords == 6 } {
- set type triangle
- } elseif { $ncoords == 8 } {
- set type parallelogram
- } elseif { $ncoords == 12 } {
- set type hexagon
- } else {
- error "unknown type n=$ncoords"
- }
- set tag [ScreenToCell $widget $info(x) $info(y)]
- $info(token).label configure -background $fill -foreground $outline \
- -text $type
- update idletasks
- update
- global itemInfo
- set itemInfo($info(timestamp)) $pickedItem
- return 1
-}
-
-# Configure a set of animated cursors.
-
-blt::dnd configure .c -cursors {
- { @bitmaps/hand/hand01.xbm bitmaps/hand/hand01m.xbm black white }
- { @bitmaps/hand/hand02.xbm bitmaps/hand/hand02m.xbm black white }
- { @bitmaps/hand/hand03.xbm bitmaps/hand/hand03m.xbm black white }
- { @bitmaps/hand/hand04.xbm bitmaps/hand/hand04m.xbm black white }
- { @bitmaps/hand/hand05.xbm bitmaps/hand/hand05m.xbm black white }
- { @bitmaps/hand/hand06.xbm bitmaps/hand/hand06m.xbm black white }
- { @bitmaps/hand/hand07.xbm bitmaps/hand/hand07m.xbm black white }
- { @bitmaps/hand/hand08.xbm bitmaps/hand/hand08m.xbm black white }
- { @bitmaps/hand/hand09.xbm bitmaps/hand/hand09m.xbm black white }
- { @bitmaps/hand/hand10.xbm bitmaps/hand/hand10m.xbm black white }
- { @bitmaps/hand/hand11.xbm bitmaps/hand/hand11m.xbm black white }
- { @bitmaps/hand/hand12.xbm bitmaps/hand/hand12m.xbm black white }
- { @bitmaps/hand/hand13.xbm bitmaps/hand/hand13m.xbm black white }
- { @bitmaps/hand/hand14.xbm bitmaps/hand/hand14m.xbm black white }
-}
-
-# Create a widget to place in the drag-and-drop token
-
-set token [blt::dnd token window .c]
-
-label $token.label -bd 2 -highlightthickness 1
-pack $token.label
-blt::dnd token configure .c \
- -borderwidth 2 \
- -relief raised -activerelief raised \
- -outline pink -fill red \
- -anchor s
-
-
-blt::dnd configure .c -target yes
-
-blt::dnd setdata .c color {
- NewObject
-}
-
-proc NewObject { widget args } {
- array set info $args
- set tag [ScreenToCell $widget $info(x) $info(y)]
- global cells
- if { [info exists cells($tag)] } {
- error "Cell already exists"
- }
- set cells($tag) $info(value)
- RedrawWorld $widget
-
-}
-
-blt::dnd configure .c -onmotion OnMotion -onenter OnMotion -onleave OnMotion
-
-proc OnMotion { widget args } {
- global cells lastCell
-
- array set info $args
- set tag [ScreenToCell $widget $info(x) $info(y)]
- if { $lastCell != "" } {
- $widget itemconfigure $lastCell -fill white -outline "" -width 1 \
- -stipple ""
- }
- # Check that we're not over a canvas item
- if { ![info exists cells($tag)] } {
- $widget itemconfigure $tag -outline lightblue -fill lightblue \
- -width 2 -stipple BLT
- set lastCell $tag
- return 1
- }
- return 0
-}
-
diff --git a/blt3.0.1/demos/dragdrop1.tcl b/blt3.0.1/demos/dragdrop1.tcl
deleted file mode 100755
index 36ea14b..0000000
--- a/blt3.0.1/demos/dragdrop1.tcl
+++ /dev/null
@@ -1,131 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-
-# --------------------------------------------------------------------------
-# Starting with Tcl 8.x, the BLT commands are stored in their own
-# namespace called "blt". The idea is to prevent name clashes with
-# Tcl commands and variables from other packages, such as a "table"
-# command in two different packages.
-#
-# You can access the BLT commands in a couple of ways. You can prefix
-# all the BLT commands with the namespace qualifier "blt::"
-#
-# blt::graph .g
-# blt::table . .g -resize both
-#
-# or you can import all the command into the global namespace.
-#
-# namespace import blt::*
-# graph .g
-# table . .g -resize both
-#
-# --------------------------------------------------------------------------
-if { $tcl_version >= 8.0 } {
- namespace import blt::*
- namespace import -force blt::tk::*
-}
-source scripts/demo.tcl
-
-if { ([info exists tcl_platform]) && ($tcl_platform(platform) == "windows") } {
- source scripts/send.tcl
- SendInit
- SendVerify
-}
-
-# ----------------------------------------------------------------------
-# This procedure is invoked each time a token is grabbed from the
-# sample window. It configures the token to display the current
-# color, and returns the color value that is later passed to the
-# target handler.
-# ----------------------------------------------------------------------
-proc package_color {token} {
- set bg [.sample cget -background]
- set fg [.sample cget -foreground]
-
- $token.label configure -background $bg -foreground $fg
- return $bg
-}
-
-# ----------------------------------------------------------------------
-# Main application window...
-# ----------------------------------------------------------------------
-label .sample -text "Color" -height 2 -bd 10 -relief sunken
-
-#
-# Set up the color sample as a drag&drop source for "color" values:
-#
-drag&drop source .sample \
- -packagecmd {package_color %t} \
- -sitecmd { puts "%s %t" }
-
-drag&drop source .sample handler color
-
-#
-# Set up the color sample as a drag&drop target for "color" values:
-#
-drag&drop target .sample handler color {set_color %v}
-
-#
-# Establish the appearance of the token window:
-#
-set token [drag&drop token .sample]
-label $token.label -text "Color"
-pack $token.label
-
-scale .redScale -label "Red" -orient horizontal \
- -from 0 -to 255 -command adjust_color
-frame .redSample -width 20 -height 20 -borderwidth 3 -relief sunken
-
-scale .greenScale -label "Green" -orient horizontal \
- -from 0 -to 255 -command adjust_color
-frame .greenSample -width 20 -height 20 -borderwidth 3 -relief sunken
-
-scale .blueScale -label "Blue" -orient horizontal \
- -from 0 -to 255 -command adjust_color
-frame .blueSample -width 20 -height 20 -borderwidth 3 -relief sunken
-
-# ----------------------------------------------------------------------
-# This procedure loads a new color value into this editor.
-# ----------------------------------------------------------------------
-proc set_color {cval} {
- set rgb [winfo rgb . $cval]
-
- set rval [expr round([lindex $rgb 0]/65535.0*255)]
- .redScale set $rval
-
- set gval [expr round([lindex $rgb 1]/65535.0*255)]
- .greenScale set $gval
-
- set bval [expr round([lindex $rgb 2]/65535.0*255)]
- .blueScale set $bval
-}
-
-# ----------------------------------------------------------------------
-# This procedure is invoked whenever an RGB slider changes to
-# update the color samples in this display.
-# ----------------------------------------------------------------------
-proc adjust_color {args} {
- set rval [.redScale get]
- .redSample configure -background [format "#%.2x0000" $rval]
- set gval [.greenScale get]
- .greenSample configure -background [format "#00%.2x00" $gval]
- set bval [.blueScale get]
- .blueSample configure -background [format "#0000%.2x" $bval]
-
- .sample configure -background \
- [format "#%.2x%.2x%.2x" $rval $gval $bval]
- if {$rval+$gval+$bval < 1.5*255} {
- .sample configure -foreground white
- } else {
- .sample configure -foreground black
- }
-}
-
-blt::table . .sample 0,0 -columnspan 2 -fill both -pady {0 4}
-blt::table . .redScale 1,0 -fill both
-blt::table . .redSample 1,1 -fill both
-blt::table . .greenScale 2,0 -fill both
-blt::table . .greenSample 2,1 -fill both
-blt::table . .blueScale 3,0 -fill both
-blt::table . .blueSample 3,1 -fill both
diff --git a/blt3.0.1/demos/dragdrop2.tcl b/blt3.0.1/demos/dragdrop2.tcl
deleted file mode 100755
index c56fb07..0000000
--- a/blt3.0.1/demos/dragdrop2.tcl
+++ /dev/null
@@ -1,163 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-
-if { $tcl_version >= 8.0 } {
- namespace import blt::*
- namespace import -force blt::tk::*
-}
-source scripts/demo.tcl
-
-if { ([info exists tcl_platform]) && ($tcl_platform(platform) == "windows") } {
- source scripts/send.tcl
- SendInit
- SendVerify
-}
-
-# ----------------------------------------------------------------------
-# This procedure is invoked each time a token is grabbed from the
-# sample window. It configures the token to display the current
-# color, and returns the color value that is later passed to the
-# target handler.
-# ----------------------------------------------------------------------
-
-proc package_color {token} {
- set bg [.sample cget -background]
- set fg [.sample cget -foreground]
-
- $token.label configure -text "Color" -background $bg -foreground $fg
- return $bg
-}
-
-# ----------------------------------------------------------------------
-# This procedure is invoked each time a token is grabbed from an
-# entry widget. It configures the token to display the current
-# string, and returns the string that is later passed to the target
-# handler.
-# ----------------------------------------------------------------------
-proc package_string {str token} {
- if {[string length $str] > 20} {
- set mesg "[string range $str 0 19]..."
- } else {
- set mesg $str
- }
- $token.label configure -text $mesg
- return $str
-}
-
-# ----------------------------------------------------------------------
-# Main application window...
-# ----------------------------------------------------------------------
-label .sample -text "Color" -height 2 -borderwidth 3 -relief sunken
-
-#
-# Set up the color sample as a drag&drop source for "color" values
-# and "string" values
-#
-drag&drop source .sample -packagecmd {package_color %t}
-drag&drop source .sample handler color
-drag&drop source .sample handler string
-
-#
-# Set up the color sample as a drag&drop target for "color" values:
-#
-drag&drop target .sample handler color {set_color %v}
-
-#
-# Establish the appearance of the token window:
-#
-set token [drag&drop token .sample -activebackground yellow ]
-label $token.label -text "Color"
-pack $token.label
-
-scale .redScale -label "Red" -orient horizontal \
- -from 0 -to 255 -command adjust_color
-frame .redSample -width 20 -height 20 -borderwidth 3 -relief sunken
-
-scale .greenScale -label "Green" -orient horizontal \
- -from 0 -to 255 -command adjust_color
-frame .greenSample -width 20 -height 20 -borderwidth 3 -relief sunken
-
-scale .blueScale -label "Blue" -orient horizontal \
- -from 0 -to 255 -command adjust_color
-frame .blueSample -width 20 -height 20 -borderwidth 3 -relief sunken
-
-frame .color
-label .color.label -text "Color:"
-pack .color.label -side left
-entry .color.value -width 10
-pack .color.value -side left -expand yes -fill both
-
-bind .color.value <KeyPress-Return> {set_color [%W get]}
-
-#
-# Set up the entry widget as a drag&drop source for "string" values:
-#
-drag&drop source .color.value \
- -packagecmd {package_string [%W get] %t} \
- -selftarget yes
-drag&drop source .color.value handler string
-
-#
-# Set up the entry widget as a drag&drop target for "string" values:
-#
-drag&drop target .color.value handler string {
- %W delete 0 end
- %W insert 0 "%v"
-}
-
-#
-# Establish the appearance of the token window:
-#
-set token [drag&drop token .color.value]
-label $token.label
-pack $token.label
-
-# ----------------------------------------------------------------------
-# This procedure loads a new color value into this editor.
-# ----------------------------------------------------------------------
-proc set_color {cval} {
- set rgb [winfo rgb . $cval]
-
- set rval [expr round([lindex $rgb 0]/65535.0*255)]
- .redScale set $rval
-
- set gval [expr round([lindex $rgb 1]/65535.0*255)]
- .greenScale set $gval
-
- set bval [expr round([lindex $rgb 2]/65535.0*255)]
- .blueScale set $bval
-}
-
-# ----------------------------------------------------------------------
-# This procedure is invoked whenever an RGB slider changes to
-# update the color samples in this display.
-# ----------------------------------------------------------------------
-proc adjust_color {args} {
- set rval [.redScale get]
- .redSample configure -background [format "#%.2x0000" $rval]
- set gval [.greenScale get]
- .greenSample configure -background [format "#00%.2x00" $gval]
- set bval [.blueScale get]
- .blueSample configure -background [format "#0000%.2x" $bval]
-
- .sample configure -background \
- [format "#%.2x%.2x%.2x" $rval $gval $bval]
- if {$rval+$gval+$bval < 1.5*255} {
- .sample configure -foreground white
- } else {
- .sample configure -foreground black
- }
-}
-
-blt::table . \
- 0,0 .sample -columnspan 2 -pady {0 4} \
- 1,0 .color -columnspan 2 -padx 4 -pady 4 \
- 2,0 .redScale \
- 2,1 .redSample \
- 3,0 .greenScale \
- 3,1 .greenSample \
- 4,0 .blueScale \
- 4,1 .blueSample
-
-eval blt::table configure . [winfo children .] -fill both
diff --git a/blt3.0.1/demos/drawer.tcl b/blt3.0.1/demos/drawer.tcl
deleted file mode 100644
index 0e03e29..0000000
--- a/blt3.0.1/demos/drawer.tcl
+++ /dev/null
@@ -1,40 +0,0 @@
-namespace eval blt::Drawer {
- set buttonPressed 0
- proc Initialize {} {
- }
-}
-
-bind DrawerHandle <Enter> {
- if { !$blt::Drawer::buttonPressed } {
- %W activate
- }
-}
-bind DrawerHandle <Leave> {
- if { !$blt::Drawer::buttonPressed } {
- %W deactivate
- }
-}
-bind DrawerHandle <KeyPress-Left> {
- %W move -10 0
-}
-bind DrawerHandle <KeyPress-Right> {
- %W move 10 0
-}
-bind DrawerHandle <KeyPress-Up> {
- %W move 0 -10
-}
-bind DrawerHandle <KeyPress-Down> {
- %W move 0 10
-}
-bind DrawerHandle <ButtonPress-1> {
- set blt::Paneset::buttonPressed 1
- %W anchor %X %Y
-}
-bind DrawerHandle <B1-Motion> {
- %W mark %X %Y
-}
-bind DrawerHandle <ButtonRelease-1> {
- set blt::Paneset::buttonPressed 0
- %W set %X %Y
-}
-
diff --git a/blt3.0.1/demos/drawerset1.tcl b/blt3.0.1/demos/drawerset1.tcl
deleted file mode 100644
index 3cdd13f..0000000
--- a/blt3.0.1/demos/drawerset1.tcl
+++ /dev/null
@@ -1,45 +0,0 @@
-
-package require BLT
-source scripts/demo.tcl
-
-blt::graph .g -bg \#CCCCFF -height 800 -width 801
-set w [blt::drawerset .g -handlethickness 3 -animate yes]
-blt::barchart .g.b -bg \#FFCCCC -height 1600 -width 300
-blt::barchart .g.b2 -bg \#CCFFCC -height 300 -width 300
-blt::barchart .g.b3 -bg \#FFFFCC -height 300 -width 300
-blt::barchart .g.b4 -bg \#CCFFFF -height 300 -width 300
-$w add top -window .g.b -fill no \
- -side top -variable top -handlecolor \#FFCCCC -showhandle no
-$w add left -window .g.b2 -side left -variable left -handlecolor \#CCFFCC \
- -showhandle no
-$w add right -window .g.b3 -side right -variable right -handlecolor \#FFFFCC
-$w add bottom -window .g.b4 -side bottom -variable bottom \
- -handlecolor \#CCFFFF -showhandle no
-checkbutton .left -text "L" -overrelief raised \
- -variable left -indicatoron no
-checkbutton .right -text "R" -overrelief raised \
- -variable right -indicatoron no
-checkbutton .top -text "T" -overrelief raised \
- -variable top -indicatoron no
-checkbutton .bottom -text "B" -overrelief raised \
- -variable bottom -indicatoron no
-
-blt::table . \
- 0,0 .g -fill both -rspan 5 \
- 0,1 .left \
- 1,1 .right \
- 2,1 .top \
- 3,1 .bottom
-
-blt::table configure . r* -resize none
-blt::table configure . r4 -resize both
-
-puts stderr [info commands .g.*]
-
-$w open all
-update
-puts stderr drawer=$w
-puts stderr "left is [$w isopen left] left=$left"
-after 2000 {
- $w raise top
-}
diff --git a/blt3.0.1/demos/drawerset2.tcl b/blt3.0.1/demos/drawerset2.tcl
deleted file mode 100644
index e8bdb2a..0000000
--- a/blt3.0.1/demos/drawerset2.tcl
+++ /dev/null
@@ -1,34 +0,0 @@
-
-package require BLT
-source scripts/demo.tcl
-
-blt::graph .g -bg \#CCCCFF -height 800
-set w [blt::drawerset .g -side top -sashthickness 20]
-blt::barchart .g.b -bg \#FFCCCC -height 300
-blt::barchart .g.b2 -bg \#CCFFCC -height 300
-$w add -window .g.b -fill x -resize both
-$w add -window .g.b2 -fill y
-$w open pane0
-set pressed 0
-bind PanesetSash <Enter> { if { !$pressed } { %W activate } }
-bind PanesetSash <Leave> { if { !$pressed } { %W deactivate } }
-bind PanesetSash <KeyPress-Left> { %W move -10 0 }
-bind PanesetSash <KeyPress-Right> { %W move 10 0 }
-bind PanesetSash <KeyPress-Up> { %W move 0 -10 }
-bind PanesetSash <KeyPress-Down> { %W move 0 10 }
-bind PanesetSash <Shift-KeyPress-Left> { %W move -100 0 }
-bind PanesetSash <Shift-KeyPress-Right> { %W move 100 0 }
-bind PanesetSash <Shift-KeyPress-Up> { %W move 0 -100 }
-bind PanesetSash <Shift-KeyPress-Down> { %W move 0 100 }
-bind PanesetSash <ButtonPress-1> {
- set pressed 1
- %W anchor %X %Y
-}
-bind PanesetSash <B1-Motion> { %W mark %X %Y }
-bind PanesetSash <ButtonRelease-1> {
- set pressed 0
- %W set %X %Y
-}
-
-blt::table . \
- 0,0 .g -fill both
diff --git a/blt3.0.1/demos/eps.tcl b/blt3.0.1/demos/eps.tcl
deleted file mode 100755
index 02b53b9..0000000
--- a/blt3.0.1/demos/eps.tcl
+++ /dev/null
@@ -1,315 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-blt::debug watch ResizeEpsItem
-
-proc StartMove { canvas tagName x y } {
- SaveImageCoords $canvas $tagName $x $y
- $canvas itemconfigure $tagName-image -quick yes
-}
-
-proc EndMove { canvas tagName } {
- $canvas configure -cursor {}
- $canvas itemconfigure $tagName-image -quick no
-}
-
-proc MoveEpsItem { canvas tagName x y } {
- global lastX lastY
- $canvas move $tagName \
- [expr $x - $lastX($tagName)] [expr $y - $lastY($tagName)]
- set lastX($tagName) $x
- set lastY($tagName) $y
-}
-
-proc GetEpsBBox { canvas tagName } {
- global left top right bottom
- set anchor [$canvas coords $tagName-image]
- set left [lindex $anchor 0]
- set top [lindex $anchor 1]
- if { [$canvas type $tagName-image] == "image" } {
- set image [$canvas itemcget $tagName-image -image]
- set width [image width $image]
- set height [image height $image]
- } else {
- set width [$canvas itemcget $tagName-image -width]
- set height [$canvas itemcget $tagName-image -height]
- }
- set right [expr $left + $width]
- set bottom [expr $top + $height]
-}
-
-proc SaveImageCoords { canvas tagName x y } {
- global lastX lastY
- set lastX($tagName) $x
- set lastY($tagName) $y
- $canvas configure -cursor sb_h_double_arrow
- $canvas itemconfigure $tagName-image -quick yes
-}
-
-array set cursors {
- sw bottom_left_corner
- ne top_right_corner
- se bottom_right_corner
- nw top_left_corner
-}
-
-proc StartResize { canvas tagName x y anchor } {
- global left top right bottom image
-
- GetEpsBBox $canvas $tagName
- $canvas itemconfigure $tagName-image -quick yes
- $canvas itemconfigure $tagName-grip -fill red
- $canvas create line $left $top $right $bottom \
- -tags "$tagName $tagName-cross $tagName-l1" \
- -fill red -width 2
-
- $canvas create line $left $bottom $right $top \
- -tags "$tagName $tagName-cross $tagName-l2" \
- -fill red -width 2
- $canvas raise $tagName-grip
- global cursors
- $canvas configure -cursor $cursors($anchor)
- global lastX lastY
- set lastX($tagName) $x
- set lastY($tagName) $y
-}
-
-proc EndResize { canvas tagName x y anchor } {
- $canvas itemconfigure $tagName-image -quick no \
- -showimage yes
- ResizeEpsItem $canvas $anchor $tagName $x $y
- $canvas itemconfigure $tagName-grip -fill green
- $canvas delete $tagName-cross
- $canvas configure -cursor ""
-}
-
-proc ResetGrips { canvas tagName } {
- global gripSize
- global left top right bottom
-
- GetEpsBBox $canvas $tagName
- $canvas coords $tagName-nw \
- $left $top [expr $left + $gripSize] [expr $top + $gripSize]
- $canvas coords $tagName-se \
- [expr $right - $gripSize] [expr $bottom - $gripSize] $right $bottom
- $canvas coords $tagName-ne \
- [expr $right - $gripSize] [expr $top + $gripSize] $right $top
- $canvas coords $tagName-sw \
- $left $bottom [expr $left + $gripSize] [expr $bottom - $gripSize]
- $canvas coords $tagName-l1 $left $top $right $bottom
- $canvas coords $tagName-l2 $left $bottom $right $top
-}
-
-proc ResizeEpsItem { canvas anchor tagName x y } {
- global left top right bottom
-
- GetEpsBBox $canvas $tagName
- switch $anchor {
- sw {
- set left $x ; set bottom $y
- set cursor bottom_left_corner
- }
- ne {
- set right $x ; set top $y
- set cursor top_right_corner
- }
- se {
- set right $x ; set bottom $y
- set cursor bottom_right_corner
- }
- nw {
- set left $x ; set top $y
- set cursor top_left_corner
- }
- default {
- error "anchor can't be $anchor"
- }
- }
- set w [expr $right - $left]
- set h [expr $bottom - $top]
- set options ""
- if { $w > 1 } {
- append options "-width $w "
- }
- if { $h > 1 } {
- append options "-height $h "
- }
- $canvas coords $tagName-image $left $top
- eval $canvas itemconfigure $tagName-image $options
- GetEpsBBox $canvas $tagName
- ResetGrips $canvas $tagName
-}
-
-set numGroups 0
-set id 0
-
-proc MakeEps { canvas {epsFile ""} {imageFile ""} } {
- global numGroups id gripSize image
-
- set image ""
- if { $imageFile != "" } {
- set image [image create picture -file $imageFile]
- }
- set tagName "epsGroup[incr numGroups]"
- $canvas create eps 20 20 \
- -anchor nw \
- -tags "$tagName $tagName-image" \
- -titlecolor white \
- -titlerotate 0 \
- -titleanchor nw \
- -font { Courier 24 } \
- -stipple BLT \
- -outline orange4 \
- -fill orange \
- -file $epsFile \
- -showimage yes \
- -image $image
-
- set gripSize 8
- GetEpsBBox $canvas $tagName
- global left top right bottom
- $canvas create rectangle \
- $left $top [expr $left + $gripSize] [expr $top + $gripSize] \
- -tags "$tagName $tagName-grip $tagName-nw" \
- -fill red -outline ""
- $canvas create rectangle \
- [expr $right - $gripSize] [expr $bottom - $gripSize] $right $bottom \
- -tags "$tagName $tagName-grip $tagName-se" \
- -fill red -outline ""
- $canvas create rectangle \
- [expr $right - $gripSize] [expr $top + $gripSize] $right $top \
- -tags "$tagName $tagName-grip $tagName-ne" \
- -fill red -outline ""
- $canvas create rectangle \
- $left $bottom [expr $left + $gripSize] [expr $bottom - $gripSize] \
- -tags "$tagName $tagName-grip $tagName-sw" \
- -fill red -outline ""
-
- $canvas bind $tagName-image <ButtonPress-1> \
- "StartMove $canvas $tagName %x %y"
- $canvas bind $tagName-image <B1-Motion> \
- "MoveEpsItem $canvas $tagName %x %y"
- $canvas bind $tagName <ButtonRelease-1> \
- "EndMove $canvas $tagName"
-
- foreach grip { sw ne se nw } {
- $canvas bind $tagName-$grip <ButtonPress-1> \
- "StartResize $canvas $tagName %x %y $grip"
- $canvas bind $tagName-$grip <B1-Motion> \
- "ResizeEpsItem $canvas $grip $tagName %x %y"
- $canvas bind $tagName-$grip <ButtonRelease-1> \
- "EndResize $canvas $tagName %x %y $grip"
- $canvas raise $tagName-$grip
- }
-}
-
-proc MakeImage { canvas fileName } {
- global numGroups id gripSize image
-
- set image ""
- set image [image create picture -file $fileName]
-
- set tagName "epsGroup[incr numGroups]"
- $canvas create image 20 20 \
- -anchor nw \
- -tags "$tagName $tagName-image" \
- -image $image
-
- set gripSize 8
- GetEpsBBox $canvas $tagName
- global left top right bottom
- $canvas create rectangle \
- $left $top [expr $left + $gripSize] [expr $top + $gripSize] \
- -tags "$tagName $tagName-grip $tagName-nw" \
- -fill red -outline ""
- $canvas create rectangle \
- [expr $right - $gripSize] [expr $bottom - $gripSize] $right $bottom \
- -tags "$tagName $tagName-grip $tagName-se" \
- -fill red -outline ""
- $canvas create rectangle \
- [expr $right - $gripSize] [expr $top + $gripSize] $right $top \
- -tags "$tagName $tagName-grip $tagName-ne" \
- -fill red -outline ""
- $canvas create rectangle \
- $left $bottom [expr $left + $gripSize] [expr $bottom - $gripSize] \
- -tags "$tagName $tagName-grip $tagName-sw" \
- -fill red -outline ""
-
- $canvas bind $tagName <ButtonRelease-1> \
- "$canvas configure -cursor {}"
- $canvas bind $tagName-image <ButtonPress-1> \
- "SaveImageCoords $canvas $tagName %x %y"
- $canvas bind $tagName-image <B1-Motion> \
- "MoveEpsItem $canvas $tagName %x %y"
-
- foreach grip { sw ne se nw } {
- $canvas bind $tagName-$grip <ButtonPress-1> \
- "StartResize $canvas $tagName %x %y $grip"
- $canvas bind $tagName-$grip <B1-Motion> \
- "ResizeEpsItem $canvas $grip $tagName %x %y"
- $canvas bind $tagName-$grip <ButtonRelease-1> \
- "EndResize $canvas $tagName %x %y $grip"
- $canvas raise $tagName-$grip
- }
-}
-
-source scripts/stipples.tcl
-
-#
-# Script to test the BLT "eps" canvas item.
-#
-
-canvas .layout -bg white
-
-button .print -text "Print" -command {
- wm iconify .
- update
- .layout postscript -file eps.ps
- wm deiconify .
- update
-}
-button .quit -text "Quit" -command {
- exit 0
-}
-
-blt::table . \
- 0,0 .layout -fill both -cspan 2 \
- 1,0 .print \
- 1,1 .quit \
-
-blt::table configure . r1 -resize none
-
-MakeImage .layout test2.gif
-
-foreach file { ./images/out.ps xy.ps test.ps } {
- if { [file exists $file] } {
- MakeEps .layout $file
- }
-}
-
-if 0 {
-set image [image create picture -file testImg.jpg]
-.layout create eps 20 20 \
- -anchor nw \
- -outline blue \
- -fill yellow \
- -showimage yes \
- -image $image
-}
-
-
-.layout create rectangle 10 10 50 50 -fill blue -outline white
-
-.layout create text 200 200 \
- -text "This is a text item" \
- -fill yellow \
- -anchor w \
- -font { Times 24 }
-
-
-.layout create rectangle 50 50 150 150 -fill green -outline red
-
-wm colormapwindows . .layout
-
-.layout configure -scrollregion [.layout bbox all]
diff --git a/blt3.0.1/demos/filmstrip1.tcl b/blt3.0.1/demos/filmstrip1.tcl
deleted file mode 100644
index b10a005..0000000
--- a/blt3.0.1/demos/filmstrip1.tcl
+++ /dev/null
@@ -1,72 +0,0 @@
-
-package require BLT
-source scripts/demo.tcl
-
-set pictures [glob -nocomplain "*.jpg"]
-set autocolors {
-#0000cd
-#cd0000
-#00cd00
-#3a5fcd
-#cdcd00
-#cd1076
-#009acd
-#00c5cd
-#a2b5cd
-#7ac5cd
-#66cdaa
-#a2cd5a
-#cd9b9b
-#cdba96
-#cd3333
-#cd6600
-#cd8c95
-#cd00cd
-#9a32cd
-#6ca6cd
-#9ac0cd
-#9bcd9b
-#00cd66
-#cdc673
-#cdad00
-#cd5555
-#cd853f
-#cd7054
-#cd5b45
-#cd6889
-#cd69c9
-#551a8b
-}
-
-#blt::debug 100
-
-proc Move { w pane } {
-# puts stderr "w=$w pane=$pane"
- .ss.fs see $pane
-}
-
-blt::scrollset .ss \
- -xviewcommand { .ss.fs view } \
- -xscrollbar .ss.xs \
- -window .ss.fs
-
-blt::filmstrip .ss.fs -width 600 \
- -scrolldelay 10 -scrollincrement 30 -animate yes \
- -scrollcommand { .ss set x }
-
-blt::tk::scrollbar .ss.xs -orient horizontal -command { .ss xview }
-
-for { set i 0 } { $i < 32 } { incr i } {
- set color [lindex $autocolors $i]
- set g .ss.fs.g$i
- blt::graph $g -bg $color -width 500
- set pane [.ss.fs add -window $g -fill x -showhandle yes]
- bind $g <ButtonPress-1> [list Move %W $pane]
- bind $g <ButtonPress-2> [list Move %W 0]
- bind $g <ButtonPress-3> [list Move %W end]
-}
-
-blt::table . \
- 0,0 .ss -fill both
-focus .ss.fs
-
diff --git a/blt3.0.1/demos/graph1.tcl b/blt3.0.1/demos/graph1.tcl
deleted file mode 100755
index ea8d888..0000000
--- a/blt3.0.1/demos/graph1.tcl
+++ /dev/null
@@ -1,987 +0,0 @@
-#!../src/bltwish
-
-if { [info exists env(BLT_LIBRARY)] } {
- lappend auto_path $env(BLT_LIBRARY)
-}
-package require BLT
-
-source scripts/demo.tcl
-
-set normalBg [blt::bgpattern create gradient -low grey40 -high grey95 \
- -jitter yes -log no -opacity 80]
-set normalBg [blt::bgpattern create texture -type checkered -low grey85 -high grey98]
-
-#set normalBg white
-#set activeBg grey95
-# option add *Axis.activeBackground $activeBg
-# option add *Legend.activeBackground $activeBg
-
-set graph .g
-blt::graph .g \
- -bg $normalBg \
- -plotrelief solid \
- -plotborderwidth 1 \
- -relief raised \
- -plotpadx 0 -plotpady 0 \
- -borderwidth 2
-
-blt::htext .header \
- -text {\
-This is an example of the graph widget. It displays two-variable data
-with assorted line attributes and symbols. To create a postscript file
-"xy.ps", press the %%
- blt::tk::button $htext(widget).print -text print -command {
- puts stderr [time {
- blt::busy hold .
- update
- .g postscript output demo1.eps -width 5i -height 5i
- update
- blt::busy release .
- update
- }]
- }
- $htext(widget) append $htext(widget).print
-%% button.}
-
-
-set X {
- 2.00000e-01 4.00000e-01 6.00000e-01 8.00000e-01 1.00000e+00
- 1.20000e+00 1.40000e+00 1.60000e+00 1.80000e+00 2.00000e+00
- 2.20000e+00 2.40000e+00 2.60000e+00 2.80000e+00 3.00000e+00
- 3.20000e+00 3.40000e+00 3.60000e+00 3.80000e+00 4.00000e+00
- 4.20000e+00 4.40000e+00 4.60000e+00 4.80000e+00 5.00000e+00
-}
-
-set Y1 {
- 4.07008e+01 7.95658e+01 1.16585e+02 1.51750e+02 1.85051e+02
- 2.16479e+02 2.46024e+02 2.73676e+02 2.99427e+02 3.23267e+02
- 3.45187e+02 3.65177e+02 3.83228e+02 3.99331e+02 4.13476e+02
- 4.25655e+02 4.35856e+02 4.44073e+02 4.50294e+02 4.54512e+02
- 4.56716e+02 4.57596e+02 4.58448e+02 4.59299e+02 4.60151e+02
-}
-
-set Y2 {
- 5.14471e-00 2.09373e+01 2.84608e+01 3.40080e+01 3.75691e+01
- 3.91345e+01 3.92706e+01 3.93474e+01 3.94242e+01 3.95010e+01
- 3.95778e+01 3.96545e+01 3.97313e+01 3.98081e+01 3.98849e+01
- 3.99617e+01 4.00384e+01 4.01152e+01 4.01920e+01 4.02688e+01
- 4.03455e+01 4.04223e+01 4.04990e+01 4.05758e+01 4.06526e+01
-}
-
-set Y3 {
- 2.61825e+01 5.04696e+01 7.28517e+01 9.33192e+01 1.11863e+02
- 1.28473e+02 1.43140e+02 1.55854e+02 1.66606e+02 1.75386e+02
- 1.82185e+02 1.86994e+02 1.89802e+02 1.90683e+02 1.91047e+02
- 1.91411e+02 1.91775e+02 1.92139e+02 1.92503e+02 1.92867e+02
- 1.93231e+02 1.93595e+02 1.93958e+02 1.94322e+02 1.94686e+02
-}
-
-set configOptions {
- Element.Pixels 6
- Element.Smooth catrom
- Legend.ActiveBackground khaki2
- Legend.ActiveRelief sunken
- Legend.Background ""
- Legend.Position plotarea
- Title "A Simple X-Y Graph"
- activeLine.Color yellow4
- activeLine.Fill yellow
- background khaki3
- line1.Color red4
- line1.Fill red1
- line1.Symbol splus
- line2.Color purple4
- line2.Fill purple1
- line2.Symbol arrow
- line3.Color green4
- line3.Fill green1
- line3.Symbol triangle
- x.Descending no
- x.Loose no
- x.Title "X Axis Label"
- y.Rotate 0
- y.Title "Y Axis Label"
-}
-
-set resource [string trimleft $graph .]
-foreach { option value } $configOptions {
- option add *$resource.$option $value
-}
-$graph element create line1 -x $X -y $Y2
-$graph element create line2 -x $X -y $Y3
-$graph element create line3 -x $X -y $Y1
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-#Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
-
-blt::htext .footer \
- -text {Hit the %%
-blt::tk::button $htext(widget).quit -text quit -command { exit }
-$htext(widget) append $htext(widget).quit
-%% button when you've seen enough.%%
-label $htext(widget).logo -bitmap BLT
-$htext(widget) append $htext(widget).logo
-%%}
-
-proc MultiplexView { args } {
- eval .g axis view y $args
- eval .g axis view y2 $args
-}
-
-blt::tk::scrollbar .xbar \
- -command { .g axis view x } \
- -orient horizontal \
- -highlightthickness 0
-blt::tk::scrollbar .ybar \
- -command MultiplexView \
- -orient vertical -highlightthickness 0
-blt::table . \
- 0,0 .header -cspan 3 -fill x \
- 1,0 .g -fill both -cspan 3 -rspan 3 \
- 2,3 .ybar -fill y -padx 0 -pady 0 \
- 4,1 .xbar -fill x \
- 5,0 .footer -cspan 3 -fill x
-
-blt::table configure . c3 r0 r4 r5 -resize none
-
-.g axis configure x \
- -scrollcommand { .xbar set } \
- -scrollmax 10 \
- -scrollmin 2 \
- -activeforeground red3 \
- -activebackground white \
- -title "X ayis" \
- -exterior no
-
-.g axis configure y \
- -scrollcommand { .ybar set } \
- -scrollmax 1000 \
- -activeforeground red3 \
- -activebackground white \
- -scrollmin -100 \
- -rotate 0 \
- -title "Y ayis" \
- -exterior no
-
-.g axis configure y2 \
- -scrollmin 0.0 -scrollmax 1.0 \
- -hide no \
- -rotate 0 \
- -exterior no \
- -title "Y2"
-
-.g axis configure x2 \
- -scrollmin 0.0 -scrollmax 1.0 \
- -hide no \
- -rotate 0 \
- -exterior no \
- -title "X2"
-
-.g legend configure \
- -relief flat -bd 0 \
- -activerelief flat \
- -activeborderwidth 1 \
- -position plotarea -anchor ne -padx 10 -pady 10 -bg ""
-
-#.g configure -plotpadx 0 -plotpady 0 -plotborderwidth 1 -plotrelief solid \
-# -Width 4.4i -plotwidth 2.0i -leftmargin 0i -rightmargin 1.0i
-
-.g pen configure "activeLine" \
- -showvalues y
-.g configure -halo 50
-.g element bind all <Enter> {
- eval %W legend deactivate *
- %W legend activate [%W element get current]
-}
-.g configure -plotpady { 0 0 }
-
-.g element bind all <Leave> {
- %W legend deactivate *
-}
-.g axis bind all <Enter> {
- set axis [%W axis get current]
- #%W axis activate $axis
- %W axis focus $axis
-}
-.g axis bind all <Leave> {
- set axis [%W axis get current]
- #%W axis deactivate $axis
- %W axis focus ""
-}
-.g configure -leftvariable left
-trace variable left w "UpdateTable .g"
-proc UpdateTable { graph p1 p2 how } {
- blt::table configure . c0 -width [$graph extents leftmargin]
- blt::table configure . c2 -width [$graph extents rightmargin]
- blt::table configure . r1 -height [$graph extents topmargin]
- blt::table configure . r3 -height [$graph extents bottommargin]
-}
-
-set image1 [image create picture -file bitmaps/sharky.xbm]
-set image2 [image create picture -file images/buckskin.gif]
-set bg1 [blt::bgpattern create solid -color blue -opacity 30]
-set bg2 [blt::bgpattern create solid -color green -opacity 40]
-set bg3 [blt::bgpattern create solid -color pink -opacity 40]
-.g element configure line1 -areabackground $bg1 -areaforeground blue
-#.g element configure line2 -areabackground $bg2
-#.g element configure line3 -areabackground $bg3
-.g configure -title "Graph Title"
-
-.g marker create line -name "y100" -coords { -Inf 100 Inf 100 } -dashes 1 \
- -outline green -linewidth 1
-.g configure -plotpady 10 -plotpadx 10
-
-if { $tcl_platform(platform) == "windows" } {
- if 0 {
- set name [lindex [blt::printer names] 0]
- set printer {Lexmark Optra E310}
- blt::printer open $printer
- blt::printer getattrs $printer attrs
- puts $attrs(Orientation)
- set attrs(Orientation) Landscape
- set attrs(DocumentName) "This is my print job"
- blt::printer setattrs $printer attrs
- blt::printer getattrs $printer attrs
- puts $attrs(Orientation)
- after 5000 {
- $graph print2 $printer
- blt::printer close $printer
- }
- } else {
- after 5000 {
- $graph print2
- }
- }
- if 1 {
- after 2000 {
- $graph snap -format emf CLIPBOARD
- }
- }
-}
-
-focus .g
-.g xaxis bind <Left> {
- .g xaxis view scroll -1 units
-}
-
-.g xaxis bind <Right> {
- .g xaxis view scroll 1 units
-}
-
-.g yaxis bind <Up> {
- .g yaxis view scroll -1 units
-}
-
-.g yaxis bind <Down> {
- .g yaxis view scroll 1 units
-}
-
-.g y2axis bind <Up> {
- .g y2axis view scroll -1 units
-}
-
-.g y2axis bind <Down> {
- .g y2axis view scroll 1 units
-}
-
-.g axis bind all <ButtonPress-1> {
- set b1(x) %x
- set b1(y) %y
- set axis [%W axis get current]
- %W axis activate $axis
-}
-.g axis bind all <ButtonRelease-1> {
- set b1(x) %x
- set b1(y) %y
- set axis [%W axis get current]
- %W axis deactivate $axis
-# %W axis focus ""
-}
-
-.g xaxis bind <B1-Motion> {
- set dist [expr %x - $b1(x)]
- .g xaxis view scroll $dist pixels
- set b1(x) %x
-}
-
-.g yaxis bind <B1-Motion> {
- set dist [expr %y - $b1(y)]
- .g yaxis view scroll $dist pixels
- set b1(y) %y
-}
-
-blt::LegendSelections .g
-.g legend configure -selectmode multiple
-
-
-proc FixAxes { g option value } {
- global axisd
- foreach a [$g axis names $axisd(axis)] {
- $g axis configure $a $option $value
- }
-}
-
-proc AxisOptions { w } {
- global axisd
- $w insert end "Axis"
- set t [frame $w.axis]
- $w tab configure "Axis" -window $w.axis
-
- blt::tk::label $t.axis_l -text "Select Axis:"
- blt::combobutton $t.axis -textvariable axisd(-axis) \
- -menu $t.axis.m -command "puts hi"
- set m [blt::combomenu $t.axis.m -textvariable axisd(-axis)]
- foreach axis [.g axis names] {
- $m add -type radiobutton -text $axis -value $axis
- }
- $m add -type radiobutton -text "all" -value "*"
- $m item configure all -variable axisd(axis)
-
- blt::tk::label $t.exterior_l -text "-exterior"
- blt::combobutton $t.exterior -textvariable axisd(-exterior) \
- -menu $t.exterior.m
- set m [blt::combomenu $t.exterior.m]
- $m add -type radiobutton -text "yes"
- $m add -type radiobutton -text "no"
- $m item configure all -variable axisd(-exterior) \
- -command { FixAxes .g -exterior $axisd(-exterior) }
-
- blt::tk::label $t.color_l -text "-color"
- blt::combobutton $t.color -textvariable axisd(-color) \
- -menu $t.color.m
- set m [blt::combomenu $t.color.m]
- $m add -type radiobutton -text "black"
- $m add -type radiobutton -text "blue"
- $m add -type radiobutton -text "green"
- $m add -type radiobutton -text "red"
- $m add -type radiobutton -text "white"
- $m add -type radiobutton -text "yellow"
- $m item configure all -variable axisd(-color) \
- -command { FixAxes .g -color $axisd(-color) }
-
- blt::tk::label $t.linewidth_l -text "-linewidth"
- blt::combobutton $t.linewidth -textvariable axisd(-linewidth) \
- -menu $t.linewidth.m
- set m [blt::combomenu $t.linewidth.m]
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "1"
- $m add -type radiobutton -text "2"
- $m add -type radiobutton -text "3"
- $m add -type radiobutton -text "4"
- $m add -type radiobutton -text "10"
- $m item configure all -variable axisd(-linewidth) \
- -command { FixAxes .g -linewidth $axisd(-linewidth) }
-
- blt::tk::label $t.showticks_l -text "-showticks"
- blt::combobutton $t.showticks -textvariable axisd(-showticks) \
- -menu $t.showticks.m
- set m [blt::combomenu $t.showticks.m]
- $m add -type radiobutton -text "yes"
- $m add -type radiobutton -text "no"
- $m item configure all -variable axisd(-showticks) \
- -command { FixAxes .g -showticks $axisd(-showticks) }
-
- blt::tk::label $t.hide_l -text "-hide"
- blt::combobutton $t.hide -textvariable axisd(-hide) \
- -menu $t.hide.m
- set m [blt::combomenu $t.hide.m]
- $m add -type radiobutton -text "yes"
- $m add -type radiobutton -text "no"
- $m item configure all -variable axisd(-hide) \
- -command { FixAxes .g -hide $axisd(-hide) }
-
-
- blt::tk::label $t.loose_l -text "-loose"
- blt::combobutton $t.loose -textvariable axisd(-loose) \
- -menu $t.loose.m
- set m [blt::combomenu $t.loose.m]
- $m add -type radiobutton -text "yes"
- $m add -type radiobutton -text "no"
- $m add -type radiobutton -text "always"
- $m item configure all -variable axisd(-loose) \
- -command { FixAxes .g -loose $axisd(-loose) }
-
- blt::tk::label $t.title_l -text "-title"
- blt::combobutton $t.title -textvariable axisd(-title) \
- -menu $t.title.m
- set m [blt::combomenu $t.title.m]
- $m add -type radiobutton -text "title1"
- $m add -type radiobutton -text "Title2"
- $m add -type radiobutton -text "none" -value ""
- $m item configure all -variable axisd(-title) \
- -command { FixAxes .g -title $axisd(-title) }
-
- $t.axis.m select 0
- foreach option { color exterior showticks linewidth loose title hide } {
- set value [.g axis cget $axisd(axis) -$option]
- set axisd(-$option) $value
- }
- blt::table $t \
- 0,0 $t.axis_l -anchor e \
- 0,1 $t.axis -fill x \
- 2,0 $t.color_l -anchor e \
- 2,1 $t.color -fill x \
- 3,0 $t.exterior_l -anchor e \
- 3,1 $t.exterior -fill x \
- 4,0 $t.hide_l -anchor e \
- 4,1 $t.hide -fill x \
- 5,0 $t.linewidth_l -anchor e \
- 5,1 $t.linewidth -fill x \
- 6,0 $t.loose_l -anchor e \
- 6,1 $t.loose -fill x \
- 7,0 $t.showticks_l -anchor e \
- 7,1 $t.showticks -fill x \
- 8,0 $t.title_l -anchor e \
- 8,1 $t.title -fill x
- blt::table configure $t r0 -pady 8
-}
-
-proc GraphOptions { w } {
- global graphd
- $w insert end "Graph"
- set t [frame $w.graph]
- $w tab configure "Graph" -window $w.graph
- blt::tk::label $t.plotborderwidth_l -text "-plotborderwidth"
- blt::combobutton $t.plotborderwidth -textvariable graphd(-plotborderwidth) \
- -menu $t.plotborderwidth.m
- set m [blt::combomenu $t.plotborderwidth.m]
- $m add -type radiobutton -text [.g cget -plotborderwidth]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "1"
- $m add -type radiobutton -text "2"
- $m add -type radiobutton -text "3"
- $m add -type radiobutton -text "4"
- $m add -type radiobutton -text "10"
- $m item configure all -variable graphd(-plotborderwidth) \
- -command { .g configure -plotborderwidth $graphd(-plotborderwidth) }
-
- blt::tk::label $t.borderwidth_l -text "-borderwidth"
- blt::combobutton $t.borderwidth -textvariable graphd(-borderwidth) \
- -menu $t.borderwidth.m
- set m [blt::combomenu $t.borderwidth.m]
- $m add -type radiobutton -text [.g cget -borderwidth]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "1"
- $m add -type radiobutton -text "2"
- $m add -type radiobutton -text "3"
- $m add -type radiobutton -text "4"
- $m add -type radiobutton -text "10"
- $m item configure all -variable graphd(-borderwidth) \
- -command { .g configure -borderwidth $graphd(-borderwidth) }
-
- blt::tk::label $t.plotpady_l -text "-plotpady"
- blt::combobutton $t.plotpady -textvariable graphd(-plotpady) \
- -menu $t.plotpady.m
- set m [blt::combomenu $t.plotpady.m]
- $m add -type radiobutton -text [.g cget -plotpady]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "1"
- $m add -type radiobutton -text "2"
- $m add -type radiobutton -text "3"
- $m add -type radiobutton -text "4"
- $m add -type radiobutton -text "10"
- $m item configure all -variable graphd(-plotpady) \
- -command { .g configure -plotpady $graphd(-plotpady) }
-
- blt::tk::label $t.plotpadx_l -text "-plotpadx"
- blt::combobutton $t.plotpadx -textvariable graphd(-plotpadx) \
- -menu $t.plotpadx.m
- set m [blt::combomenu $t.plotpadx.m]
- $m add -type radiobutton -text [.g cget -plotpadx]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "1"
- $m add -type radiobutton -text "2"
- $m add -type radiobutton -text "3"
- $m add -type radiobutton -text "4"
- $m add -type radiobutton -text "10"
- $m item configure all -variable graphd(-plotpadx) \
- -command { .g configure -plotpadx $graphd(-plotpadx) }
-
- blt::tk::label $t.plotrelief_l -text "-plotrelief"
- blt::combobutton $t.plotrelief -textvariable graphd(-plotrelief) \
- -menu $t.plotrelief.m
- set m [blt::combomenu $t.plotrelief.m]
- $m add -type radiobutton -text [.g cget -plotrelief]
- $m add -type separator
- $m add -type radiobutton -text "flat"
- $m add -type radiobutton -text "groove"
- $m add -type radiobutton -text "raised"
- $m add -type radiobutton -text "ridge"
- $m add -type radiobutton -text "solid"
- $m add -type radiobutton -text "sunken"
- $m item configure all -variable graphd(-plotrelief) \
- -command { .g configure -plotrelief $graphd(-plotrelief) }
-
- blt::tk::label $t.relief_l -text "-relief"
- blt::combobutton $t.relief -textvariable graphd(-relief) \
- -menu $t.relief.m
- set m [blt::combomenu $t.relief.m]
- $m add -type radiobutton -text [.g cget -relief]
- $m add -type separator
- $m add -type radiobutton -text "flat"
- $m add -type radiobutton -text "groove"
- $m add -type radiobutton -text "raised"
- $m add -type radiobutton -text "ridge"
- $m add -type radiobutton -text "solid"
- $m add -type radiobutton -text "sunken"
- $m item configure all -variable graphd(-relief) \
- -command { .g configure -relief $graphd(-relief) }
-
- blt::tk::label $t.plotwidth_l -text "-plotwidth"
- blt::combobutton $t.plotwidth -textvariable graphd(-plotwidth) \
- -menu $t.plotwidth.m
- set m [blt::combomenu $t.plotwidth.m]
- $m add -type radiobutton -text [.g cget -plotwidth]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "100"
- $m add -type radiobutton -text "200"
- $m add -type radiobutton -text "2i"
- $m add -type radiobutton -text "4i"
- $m add -type radiobutton -text "8i"
- $m item configure all -variable graphd(-plotwidth) \
- -command { .g configure -plotwidth $graphd(-plotwidth) }
-
- blt::tk::label $t.plotheight_l -text "-plotheight"
- blt::combobutton $t.plotheight -textvariable graphd(-plotheight) \
- -menu $t.plotheight.m
- set m [blt::combomenu $t.plotheight.m]
- $m add -type radiobutton -text [.g cget -plotheight]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "100"
- $m add -type radiobutton -text "200"
- $m add -type radiobutton -text "2i"
- $m add -type radiobutton -text "4i"
- $m add -type radiobutton -text "8i"
- $m item configure all -variable graphd(-plotheight) \
- -command { .g configure -plotheight $graphd(-plotheight) }
-
- blt::tk::label $t.width_l -text "-width"
- blt::combobutton $t.width -textvariable graphd(-width) \
- -menu $t.width.m
- set m [blt::combomenu $t.width.m]
- $m add -type radiobutton -text [.g cget -width]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "100"
- $m add -type radiobutton -text "2.5i"
- $m add -type radiobutton -text "4i"
- $m add -type radiobutton -text "6i"
- $m add -type radiobutton -text "8.5i"
- $m item configure all -variable graphd(-width) \
- -command { .g configure -width $graphd(-width) }
-
- blt::tk::label $t.height_l -text "-height"
- blt::combobutton $t.height -textvariable graphd(-height) \
- -menu $t.height.m
- set m [blt::combomenu $t.height.m]
- $m add -type radiobutton -text [.g cget -height]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "200"
- $m add -type radiobutton -text "2.5i"
- $m add -type radiobutton -text "4i"
- $m add -type radiobutton -text "6i"
- $m add -type radiobutton -text "8.5i"
- $m item configure all -variable graphd(-height) \
- -command { .g configure -height $graphd(-height) }
-
- blt::tk::label $t.plotbackground_l -text "-plotbackground"
- blt::combobutton $t.plotbackground -textvariable graphd(-plotbackground) \
- -menu $t.plotbackground.m
- set m [blt::combomenu $t.plotbackground.m]
- $m add -type radiobutton -text [.g cget -plotbackground]
- $m add -type separator
- $m add -type radiobutton -text "black"
- $m add -type radiobutton -text "blue"
- $m add -type radiobutton -text "green"
- $m add -type radiobutton -text "grey"
- $m add -type radiobutton -text "red"
- $m add -type radiobutton -text "white"
- $m add -type radiobutton -text "yellow"
- $m item configure all -variable graphd(-plotbackground) \
- -command { .g configure -plotbackground $graphd(-plotbackground) }
-
- blt::tk::label $t.background_l -text "-background"
- blt::combobutton $t.background -textvariable graphd(-background) \
- -menu $t.background.m
- set m [blt::combomenu $t.background.m]
- $m add -type radiobutton -text [.g cget -background]
- $m add -type separator
- $m add -type radiobutton -text "black"
- $m add -type radiobutton -text "blue"
- $m add -type radiobutton -text "green"
- $m add -type radiobutton -text "grey"
- $m add -type radiobutton -text "red"
- $m add -type radiobutton -text "white"
- $m add -type radiobutton -text "yellow"
- $m item configure all -variable graphd(-background) \
- -command { .g configure -background $graphd(-background) }
-
- blt::tk::label $t.title_l -text "-title"
- blt::combobutton $t.title -textvariable graphd(-title) \
- -menu $t.title.m
- set m [blt::combomenu $t.title.m]
- $m add -type radiobutton -text [.g cget -title]
- $m add -type separator
- $m add -type radiobutton -text "title1"
- $m add -type radiobutton -text "Title2"
- $m add -type radiobutton -text "none" -value ""
- $m item configure all -variable graphd(-title) \
- -command { .g configure -title $graphd(-title) }
-
- blt::tk::label $t.leftmargin_l -text "-leftmargin"
- blt::combobutton $t.leftmargin -textvariable graphd(-leftmargin) \
- -menu $t.leftmargin.m
- set m [blt::combomenu $t.leftmargin.m]
- $m add -type radiobutton -text [.g cget -leftmargin]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "10"
- $m add -type radiobutton -text ".25i"
- $m add -type radiobutton -text ".5i"
- $m add -type radiobutton -text "1.0i"
- $m add -type radiobutton -text "2.0i"
- $m item configure all -variable graphd(-leftmargin) \
- -command { .g configure -leftmargin $graphd(-leftmargin) }
-
- blt::tk::label $t.rightmargin_l -text "-rightmargin"
- blt::combobutton $t.rightmargin -textvariable graphd(-rightmargin) \
- -menu $t.rightmargin.m
- set m [blt::combomenu $t.rightmargin.m]
- $m add -type radiobutton -text [.g cget -rightmargin]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "10"
- $m add -type radiobutton -text ".25i"
- $m add -type radiobutton -text ".5i"
- $m add -type radiobutton -text "1.0i"
- $m add -type radiobutton -text "2.0i"
- $m item configure all -variable graphd(-rightmargin) \
- -command { .g configure -rightmargin $graphd(-rightmargin) }
-
- blt::tk::label $t.topmargin_l -text "-topmargin"
- blt::combobutton $t.topmargin -textvariable graphd(-topmargin) \
- -menu $t.topmargin.m
- set m [blt::combomenu $t.topmargin.m]
- $m add -type radiobutton -text [.g cget -topmargin]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "10"
- $m add -type radiobutton -text ".25i"
- $m add -type radiobutton -text ".5i"
- $m add -type radiobutton -text "1.0i"
- $m add -type radiobutton -text "2.0i"
- $m item configure all -variable graphd(-topmargin) \
- -command { .g configure -topmargin $graphd(-topmargin) }
-
- blt::tk::label $t.bottommargin_l -text "-bottommargin"
- blt::combobutton $t.bottommargin -textvariable graphd(-bottommargin) \
- -menu $t.bottommargin.m
- set m [blt::combomenu $t.bottommargin.m]
- $m add -type radiobutton -text [.g cget -bottommargin]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "10"
- $m add -type radiobutton -text ".25i"
- $m add -type radiobutton -text ".5i"
- $m add -type radiobutton -text "1.0i"
- $m add -type radiobutton -text "2.0i"
- $m item configure all -variable graphd(-bottommargin) \
- -command { .g configure -bottommargin $graphd(-bottommargin) }
-
- foreach option { borderwidth plotrelief relief background
- plotbackground background plotborderwidth plotpadx plotpady
- plotwidth plotheight width height title rightmargin leftmargin
- topmargin bottommargin } {
- $t.$option.m select 0
- }
-
- blt::table $t \
- 1,0 $t.background_l -anchor e \
- 1,1 $t.background -fill x \
- 2,0 $t.borderwidth_l -anchor e \
- 2,1 $t.borderwidth -fill x \
- 3,0 $t.bottommargin_l -anchor e \
- 3,1 $t.bottommargin -fill x \
- 4,0 $t.height_l -anchor e \
- 4,1 $t.height -fill x \
- 5,0 $t.leftmargin_l -anchor e \
- 5,1 $t.leftmargin -fill x \
- 6,0 $t.plotbackground_l -anchor e \
- 6,1 $t.plotbackground -fill x \
- 7,0 $t.plotborderwidth_l -anchor e \
- 7,1 $t.plotborderwidth -fill x \
- 8,0 $t.plotheight_l -anchor e \
- 8,1 $t.plotheight -fill x \
- 9,0 $t.plotpadx_l -anchor e \
- 9,1 $t.plotpadx -fill x \
- 10,0 $t.plotpady_l -anchor e \
- 10,1 $t.plotpady -fill x \
- 11,0 $t.plotrelief_l -anchor e \
- 11,1 $t.plotrelief -fill x \
- 12,0 $t.plotwidth_l -anchor e \
- 12,1 $t.plotwidth -fill x \
- 13,0 $t.relief_l -anchor e \
- 13,1 $t.relief -fill x \
- 14,0 $t.rightmargin_l -anchor e \
- 14,1 $t.rightmargin -fill x \
- 15,0 $t.title_l -anchor e \
- 15,1 $t.title -fill x \
- 16,0 $t.topmargin_l -anchor e \
- 16,1 $t.topmargin -fill x \
- 17,0 $t.width_l -anchor e \
- 17,1 $t.width -fill x
-}
-
-proc LegendOptions { w } {
- global legend
- $w insert end "Legend"
- set t [frame $w.legend]
- $w tab configure "Legend" -window $w.legend
- blt::tk::label $t.selectborderwidth_l -text "-selectborderwidth"
- blt::combobutton $t.selectborderwidth -textvariable legend(-selectborderwidth) \
- -menu $t.selectborderwidth.m
- set m [blt::combomenu $t.selectborderwidth.m]
- $m add -type radiobutton -text [.g legend cget -selectborderwidth]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "1"
- $m add -type radiobutton -text "2"
- $m add -type radiobutton -text "3"
- $m add -type radiobutton -text "4"
- $m add -type radiobutton -text "10"
- $m item configure all -variable legend(-selectborderwidth) \
- -command { .g legend configure -selectborderwidth $legend(-selectborderwidth) }
-
- blt::tk::label $t.borderwidth_l -text "-borderwidth"
- blt::combobutton $t.borderwidth -textvariable legend(-borderwidth) \
- -menu $t.borderwidth.m
- set m [blt::combomenu $t.borderwidth.m]
- $m add -type radiobutton -text [.g legend cget -borderwidth]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "1"
- $m add -type radiobutton -text "2"
- $m add -type radiobutton -text "3"
- $m add -type radiobutton -text "4"
- $m add -type radiobutton -text "10"
- $m item configure all -variable legend(-borderwidth) \
- -command { .g legend configure -borderwidth $legend(-borderwidth) }
-
- blt::tk::label $t.pady_l -text "-pady"
- blt::combobutton $t.pady -textvariable legend(-pady) \
- -menu $t.pady.m
- set m [blt::combomenu $t.pady.m]
- $m add -type radiobutton -text [.g legend cget -pady]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "1"
- $m add -type radiobutton -text "2"
- $m add -type radiobutton -text "3"
- $m add -type radiobutton -text "4"
- $m add -type radiobutton -text "10"
- $m item configure all -variable legend(-pady) \
- -command { .g legend configure -pady $legend(-pady) }
-
- blt::tk::label $t.padx_l -text "-padx"
- blt::combobutton $t.padx -textvariable legend(-padx) \
- -menu $t.padx.m
- set m [blt::combomenu $t.padx.m]
- $m add -type radiobutton -text [.g legend cget -padx]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "1"
- $m add -type radiobutton -text "2"
- $m add -type radiobutton -text "3"
- $m add -type radiobutton -text "4"
- $m add -type radiobutton -text "10"
- $m item configure all -variable legend(-padx) \
- -command { .g legend configure -padx $legend(-padx) }
-
- blt::tk::label $t.selectrelief_l -text "-selectrelief"
- blt::combobutton $t.selectrelief -textvariable legend(-selectrelief) \
- -menu $t.selectrelief.m
- set m [blt::combomenu $t.selectrelief.m]
- $m add -type radiobutton -text [.g legend cget -selectrelief]
- $m add -type separator
- $m add -type radiobutton -text "flat"
- $m add -type radiobutton -text "groove"
- $m add -type radiobutton -text "raised"
- $m add -type radiobutton -text "ridge"
- $m add -type radiobutton -text "solid"
- $m add -type radiobutton -text "sunken"
- $m item configure all -variable legend(-selectrelief) \
- -command { .g legend configure -selectrelief $legend(-selectrelief) }
-
- blt::tk::label $t.relief_l -text "-relief"
- blt::combobutton $t.relief -textvariable legend(-relief) \
- -menu $t.relief.m
- set m [blt::combomenu $t.relief.m]
- $m add -type radiobutton -text [.g legend cget -relief]
- $m add -type separator
- $m add -type radiobutton -text "flat"
- $m add -type radiobutton -text "groove"
- $m add -type radiobutton -text "raised"
- $m add -type radiobutton -text "ridge"
- $m add -type radiobutton -text "solid"
- $m add -type radiobutton -text "sunken"
- $m item configure all -variable legend(-relief) \
- -command { .g legend configure -relief $legend(-relief) }
-
- blt::tk::label $t.position_l -text "-position"
- blt::combobutton $t.position -textvariable legend(-position) \
- -menu $t.position.m
- set m [blt::combomenu $t.position.m]
- $m add -type radiobutton -text [.g legend cget -position]
- $m add -type separator
- $m add -type radiobutton -text "left"
- $m add -type radiobutton -text "right"
- $m add -type radiobutton -text "top"
- $m add -type radiobutton -text "bottom"
- $m add -type radiobutton -text "plotarea"
- $m add -type radiobutton -text "@200,200"
- $m item configure all -variable legend(-position) \
- -command { .g legend configure -position $legend(-position) }
-
- blt::tk::label $t.hide_l -text "-hide"
- blt::combobutton $t.hide -textvariable legend(-hide) \
- -menu $t.hide.m
- set m [blt::combomenu $t.hide.m]
- $m add -type radiobutton -text [.g legend cget -hide]
- $m add -type separator
- $m add -type radiobutton -text "yes"
- $m add -type radiobutton -text "no"
- $m item configure all -variable legend(-hide) \
- -command { .g legend configure -hide $legend(-hide) }
-
- blt::tk::label $t.activebackground_l -text "-activebackground"
- blt::combobutton $t.activebackground -textvariable legend(-activebackground) \
- -menu $t.activebackground.m
- set m [blt::combomenu $t.activebackground.m]
- $m add -type radiobutton -text [.g legend cget -activebackground]
- $m add -type separator
- $m add -type radiobutton -text "black"
- $m add -type radiobutton -text "blue"
- $m add -type radiobutton -text "green"
- $m add -type radiobutton -text "grey"
- $m add -type radiobutton -text "red"
- $m add -type radiobutton -text "white"
- $m add -type radiobutton -text "yellow"
- $m item configure all -variable legend(-activebackground) \
- -command { .g legend configure -activebackground $legend(-activebackground) }
-
- blt::tk::label $t.activeborderwidth_l -text "-activeborderwidth"
- blt::combobutton $t.activeborderwidth -textvariable legend(-activeborderwidth) \
- -menu $t.activeborderwidth.m
- set m [blt::combomenu $t.activeborderwidth.m]
- $m add -type radiobutton -text [.g legend cget -activeborderwidth]
- $m add -type separator
- $m add -type radiobutton -text "0"
- $m add -type radiobutton -text "1"
- $m add -type radiobutton -text "2"
- $m add -type radiobutton -text "3"
- $m add -type radiobutton -text "4"
- $m add -type radiobutton -text "10"
- $m item configure all -variable legend(-activeborderwidth) \
- -command { .g legend configure -activeborderwidth $legend(-activeborderwidth) }
-
- blt::tk::label $t.selectbackground_l -text "-selectbackground"
- blt::combobutton $t.selectbackground -textvariable legend(-selectbackground) \
- -menu $t.selectbackground.m
- set m [blt::combomenu $t.selectbackground.m]
- $m add -type radiobutton -text [.g legend cget -selectbackground]
- $m add -type separator
- $m add -type radiobutton -text "black"
- $m add -type radiobutton -text "blue"
- $m add -type radiobutton -text "green"
- $m add -type radiobutton -text "grey"
- $m add -type radiobutton -text "red"
- $m add -type radiobutton -text "white"
- $m add -type radiobutton -text "yellow"
- $m item configure all -variable legend(-selectbackground) \
- -command { .g legend configure -selectbackground $legend(-selectbackground) }
-
- blt::tk::label $t.selectforeground_l -text "-selectforeground"
- blt::combobutton $t.selectforeground -textvariable legend(-selectforeground) \
- -menu $t.selectforeground.m
- set m [blt::combomenu $t.selectforeground.m]
- $m add -type radiobutton -text [.g legend cget -selectforeground]
- $m add -type separator
- $m add -type radiobutton -text "black"
- $m add -type radiobutton -text "blue"
- $m add -type radiobutton -text "green"
- $m add -type radiobutton -text "grey"
- $m add -type radiobutton -text "red"
- $m add -type radiobutton -text "white"
- $m add -type radiobutton -text "yellow"
- $m item configure all -variable legend(-selectforeground) \
- -command { .g legend configure -selectforeground $legend(-selectforeground) }
-
-
- blt::tk::label $t.background_l -text "-background"
- blt::combobutton $t.background -textvariable legend(-background) \
- -menu $t.background.m
- set m [blt::combomenu $t.background.m]
- $m add -type radiobutton -text [.g legend cget -background]
- $m add -type separator
- $m add -type radiobutton -text "black"
- $m add -type radiobutton -text "blue"
- $m add -type radiobutton -text "green"
- $m add -type radiobutton -text "grey"
- $m add -type radiobutton -text "red"
- $m add -type radiobutton -text "white"
- $m add -type radiobutton -text "yellow"
- $m item configure all -variable legend(-background) \
- -command { .g legend configure -background $legend(-background) }
- puts stderr [$m item configure "black"]
- foreach option { borderwidth selectrelief relief
- selectbackground background selectborderwidth padx pady
- selectforeground activebackground
- position hide activeborderwidth } {
- $t.$option.m select 0
- }
-
- blt::table $t \
- 1,0 $t.activebackground_l -anchor e \
- 1,1 $t.activebackground -fill x \
- 2,0 $t.activeborderwidth_l -anchor e \
- 2,1 $t.activeborderwidth -fill x \
- 3,0 $t.background_l -anchor e \
- 3,1 $t.background -fill x \
- 4,0 $t.borderwidth_l -anchor e \
- 4,1 $t.borderwidth -fill x \
- 5,0 $t.hide_l -anchor e \
- 5,1 $t.hide -fill x \
- 6,0 $t.padx_l -anchor e \
- 6,1 $t.padx -fill x \
- 7,0 $t.pady_l -anchor e \
- 7,1 $t.pady -fill x \
- 8,0 $t.position_l -anchor e \
- 8,1 $t.position -fill x \
- 9,0 $t.relief_l -anchor e \
- 9,1 $t.relief -fill x \
- 10,0 $t.selectbackground_l -anchor e \
- 10,1 $t.selectbackground -fill x \
- 11,0 $t.selectborderwidth_l -anchor e \
- 11,1 $t.selectborderwidth -fill x \
- 12,0 $t.selectforeground_l -anchor e \
- 12,1 $t.selectforeground -fill x \
- 13,0 $t.selectrelief_l -anchor e \
- 13,1 $t.selectrelief -fill x
-}
-
-set t [toplevel .cntrl]
-blt::tabnotebook $t.tb
-blt::table $t \
- 0,0 $t.tb -fill both
-GraphOptions $t.tb
-AxisOptions $t.tb
-LegendOptions $t.tb
diff --git a/blt3.0.1/demos/graph2.tcl b/blt3.0.1/demos/graph2.tcl
deleted file mode 100755
index 5ab8ee2..0000000
--- a/blt3.0.1/demos/graph2.tcl
+++ /dev/null
@@ -1,136 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-
-source scripts/demo.tcl
-source scripts/stipples.tcl
-
-if { ![string match "*gray*" [winfo screenvisual .]] } {
- option add *Button.Background red
- option add *TextMarker.Foreground black
- option add *TextMarker.Background yellow
- option add *LineMarker.Foreground black
- option add *LineMarker.Background yellow
- option add *PolyMarker.Fill yellow2
- option add *PolyMarker.Outline ""
- option add *PolyMarker.Stipple bdiagonal1
- option add *activeLine.Color red4
- option add *activeLine.Fill red2
- option add *Element.Color purple
-}
-
-set data {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
- ZTKAsiCtWq0JADs=
-}
-set data {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM1WBrM+rAEMigJ8c3Kb3OSII6kGABhp1JnaK1VGwjwKwtvHqNzzd263M3H4n2OH1QBwGw6
- nQkAOw==
-}
-set image [image create picture -data $data]
-
-set graph [blt::graph .g]
-blt::table . \
- 0,0 $graph -fill both
-
-source scripts/graph2.tcl
-
-$graph postscript configure \
- -landscape yes
-
-$graph configure \
- -width 6i \
- -height 4i \
- -title "Graph" \
- -plotpady 0 -plotpadx 0 -plotborderwidth 0
-
-$graph axis configure y \
- -titlefont "arial 10" \
- -title "Y Axis"
-
-if 1 {
- set bg [blt::bgpattern create gradient -low grey40 -high grey95 \
- -jitter yes -log no -opacity 80]
- $graph element configure line1
-# -areapattern solid -areaforeground green
-# -areatile $image
- $graph element configure line3 \
- -areaforeground red \
- -areabackground $bg
-}
-
-if 0 {
-set fileName testImg.jpg
-if { [file exists $fileName] } {
- set image [image create picture -file $fileName]
- if 1 {
- puts stderr [time {
- $graph marker create image -image $image -resamplefilter sinc \
- -coords "-360.0 -1.0 360.0 1.0" \
- -under yes \
- -mapx degrees \
- -name $fileName
- }]
- }
-}
-}
-
-bind $graph <Control-ButtonPress-3> { MakeSnapshot }
-bind $graph <Shift-ButtonPress-3> {
- %W postscript output demo2.ps
- update
- %W snap -format emf demo2.emf
-}
-
-$graph configure -title "This is the \nTitle\n"
-set unique 0
-proc MakeSnapshot {} {
- update idletasks
- global unique graph
- set top ".snapshot[incr unique]"
- set im [image create photo]
- $graph snap $im 210 150
-
- toplevel $top
- wm title $top "Snapshot \#$unique of \"[$graph cget -title]\""
- label $top.lab -image $im
- button $top.but -text "Dismiss" -command "DestroySnapshot $top"
- blt::table $top $top.lab
- blt::table $top $top.but -pady 4
- focus $top.but
-}
-
-proc DestroySnapshot { win } {
- set im [$win.lab cget -image]
- image delete $im
- destroy $win
- exit
-}
-
-if { $tcl_platform(platform) == "windows" } {
- if 0 {
- set name [lindex [blt::printer names] 0]
- set printer {Lexmark Optra E310}
- blt::printer open $printer
- blt::printer getattrs $printer attrs
- puts $attrs(Orientation)
- set attrs(Orientation) Landscape
- set attrs(DocumentName) "This is my print job"
- blt::printer setattrs $printer attrs
- blt::printer getattrs $printer attrs
- puts $attrs(Orientation)
- after 5000 {
- $graph print2 $printer
- blt::printer close $printer
- }
- } else {
- after 5000 {
- # $graph print2
- }
- }
- if 1 {
- after 2000 {$graph snap -format emf CLIPBOARD}
- }
-}
diff --git a/blt3.0.1/demos/graph3.tcl b/blt3.0.1/demos/graph3.tcl
deleted file mode 100755
index 8943a4a..0000000
--- a/blt3.0.1/demos/graph3.tcl
+++ /dev/null
@@ -1,75 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-source scripts/stipples.tcl
-puts stderr "class=[winfo class .]"
-set visual [winfo screenvisual .]
-if { $visual != "staticgray" && $visual != "grayscale" } {
- option add *Graph3.Button.Background red
- option add *TextMarker.Foreground black
- option add *TextMarker.Background yellow
- option add *LineMarker.Foreground black
- option add *LineMarker.Background yellow
- option add *PolyMarker.Fill yellow2
- option add *PolyMarker.Outline ""
- option add *PolyMarker.Stipple fdiagonal1
- option add *activeLine.Color red4
- option add *activeLine.Fill red2
- option add *Element.Color purple
-}
-
-image create picture bgTexture -file ./images/chalk.gif
-
-option add *Tile bgTexture
-option add *Button.Tile ""
-option add *Text.font { "Serif" 12 }
-option add *header.font { "Serif" 12 }
-option add *footer.font { "Serif" 12 }
-option add *HighlightThickness 0
-option add *plotBorderWidth 0
-option add *plotPadX 0
-option add *plotPadY 0
-set graph [blt::graph .g]
-source scripts/graph3.tcl
-
-
-set text {
-This is an example of a bitmap marker. Try zooming in on
-a region by clicking the left button, moving the pointer,
-and clicking again. Notice that the bitmap scales too.
-To restore the last view, click on the right button.
-}
-blt::htext .header -text $text
-
-blt::htext .footer -text {Hit the %%
- set im [image create picture -file ./images/stopsign.gif]
- button $htext(widget).quit -image $im -command { exit }
- $htext(widget) append $htext(widget).quit
-%% button when you've seen enough. %%
- label $htext(widget).logo -bitmap BLT
- $htext(widget) append $htext(widget).logo
-%%}
-
-blt::table . \
- .header 0,0 -fill x -padx 4 -pady 4\
- $graph 1,0 -fill both \
- .footer 2,0 -fill x -padx 4 -pady 4
-
-blt::table configure . r0 r2 -resize none
-
-source scripts/ps.tcl
-
-bind $graph <Shift-ButtonPress-1> {
- MakePsLayout $graph
-}
-
-if 0 {
-set printer [printer open [lindex [printer names] 0]]
-after 2000 {
- $graph print2 $printer
-}
-}
-after 2000 {
- PsDialog $graph
-}
diff --git a/blt3.0.1/demos/graph4.tcl b/blt3.0.1/demos/graph4.tcl
deleted file mode 100755
index 4502f7d..0000000
--- a/blt3.0.1/demos/graph4.tcl
+++ /dev/null
@@ -1,2280 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-package require blt_datatable_vector
-source scripts/demo.tcl
-
-set tcl_precision 15
-
-set graph .graph
-image create picture bgTexture -file ./images/chalk.gif
-
-option add *default normal
-option add *Button.tile bgTexture
-
-#option add *Htext.font -*-times*-bold-r-*-*-18-*-*
-#option add *Text.font "Serif 18"
-option add *header.font "{Times New Roman} 12"
-#option add *footer.font -*-times*-medium-r-*-*-18-*-*
-option add *Graph.relief raised
-#option add *Graph.borderWidth 2
-option add *Graph.height 5i
-option add *Graph.plotBackground black
-option add *Graph.width 7i
-option add *Graph.tile bgTexture
-option add *Graph.halo 0
-
-option add *Graph.title "s27.out"
-
-option add *Axis.titleColor red2
-option add *x.title "Time"
-option add *y.title "Signals"
-
-option add *Crosshairs.Color white
-
-option add *activeLine.Fill navyblue
-option add *activeLine.LineWidth 2
-option add *Element.ScaleSymbols yes
-option add *Element.Smooth natural
-
-option add *Symbol square
-option add *Element.LineWidth 1
-option add *Pen.LineWidth 1
-option add *Pixels 1
-
-option add *Grid.color grey50
-option add *Grid.dashes "2 4"
-option add *Grid.hide no
-
-option add *Legend.ActiveRelief sunken
-option add *Legend.Position right
-option add *Legend.Relief flat
-option add *Legend.Pad 0
-option add *Legend.hide no
-
-option add *LineMarker.Dashes 5
-option add *LineMarker.Foreground white
-option add *zoomOutline.outline yellow
-
-option add *TextMarker.Background {}
-option add *TextMarker.Foreground white
-
-blt::vector create x -variable ""
-for { set i 1 } { $i <= 39 } { incr i } {
- blt::vector create "v$i" -variable ""
-}
-
-x set {
- 0 1e-10 2e-10 3e-10 4e-10 5e-10 6e-10 7e-10 8e-10 9e-10
- 1e-09 1.1e-09 1.2e-09 1.3e-09 1.4e-09 1.5e-09 1.6e-09 1.7e-09
- 1.8e-09 1.9e-09 2e-09 2.1e-09 2.2e-09 2.3e-09 2.4e-09 2.5e-09
- 2.6e-09 2.7e-09 2.8e-09 2.9e-09 3e-09 3.1e-09 3.2e-09 3.3e-09
- 3.4e-09 3.5e-09 3.6e-09 3.7e-09 3.8e-09 3.9e-09 4e-09 4.1e-09
- 4.2e-09 4.3e-09 4.4e-09 4.5e-09 4.6e-09 4.7e-09 4.8e-09
- 4.9e-09 5e-09 5.1e-09 5.2e-09 5.3e-09 5.4e-09 5.5e-09 5.6e-09
- 5.7e-09 5.8e-09 5.9e-09 6e-09 6.1e-09 6.2e-09 6.3e-09 6.4e-09
- 6.5e-09 6.6e-09 6.7e-09 6.8e-09 6.9e-09 7e-09 7.1e-09 7.2e-09
- 7.3e-09 7.4e-09 7.5e-09 7.6e-09 7.7e-09 7.8e-09 7.9e-09
- 8e-09 8.1e-09 8.2e-09 8.3e-09 8.4e-09 8.5e-09 8.6e-09 8.7e-09
- 8.8e-09 8.9e-09 9e-09 9.1e-09 9.2e-09 9.3e-09 9.4e-09 9.5e-09
- 9.6e-09 9.7e-09 9.8e-09 9.9e-09 1e-08 1.01e-08 1.02e-08
- 1.03e-08 1.04e-08 1.05e-08 1.06e-08 1.07e-08 1.08e-08 1.09e-08
- 1.1e-08 1.11e-08 1.12e-08 1.13e-08 1.14e-08 1.15e-08 1.16e-08
- 1.17e-08 1.18e-08 1.19e-08 1.2e-08 1.21e-08 1.22e-08 1.23e-08
- 1.24e-08 1.25e-08 1.26e-08 1.27e-08 1.28e-08 1.29e-08 1.3e-08
- 1.31e-08 1.32e-08 1.33e-08 1.34e-08 1.35e-08 1.36e-08 1.37e-08
- 1.38e-08 1.39e-08 1.4e-08 1.41e-08 1.42e-08 1.43e-08 1.44e-08
- 1.45e-08 1.46e-08 1.47e-08 1.48e-08 1.49e-08 1.5e-08 1.51e-08
- 1.52e-08 1.53e-08 1.54e-08 1.55e-08 1.56e-08 1.57e-08 1.58e-08
- 1.59e-08 1.6e-08 1.61e-08 1.62e-08 1.63e-08 1.64e-08 1.65e-08
- 1.66e-08 1.67e-08 1.68e-08 1.69e-08 1.7e-08 1.71e-08 1.72e-08
- 1.73e-08 1.74e-08 1.75e-08 1.76e-08 1.77e-08 1.78e-08 1.79e-08
- 1.8e-08 1.81e-08 1.82e-08 1.83e-08 1.84e-08 1.85e-08 1.86e-08
- 1.87e-08 1.88e-08 1.89e-08 1.9e-08 1.91e-08 1.92e-08 1.93e-08
- 1.94e-08 1.95e-08 1.96e-08 1.97e-08 1.98e-08 1.99e-08 2e-08
- 2.01e-08 2.02e-08 2.03e-08 2.04e-08 2.05e-08 2.06e-08 2.07e-08
- 2.08e-08 2.09e-08 2.1e-08 2.11e-08 2.12e-08 2.13e-08 2.14e-08
- 2.15e-08 2.16e-08 2.17e-08 2.18e-08 2.19e-08 2.2e-08 2.21e-08
- 2.22e-08 2.23e-08 2.24e-08 2.25e-08 2.26e-08 2.27e-08 2.28e-08
- 2.29e-08 2.3e-08 2.31e-08 2.32e-08 2.33e-08 2.34e-08 2.35e-08
- 2.36e-08 2.37e-08 2.38e-08 2.39e-08 2.4e-08 2.41e-08 2.42e-08
- 2.43e-08 2.44e-08 2.45e-08 2.46e-08 2.47e-08 2.48e-08 2.49e-08
- 2.5e-08 2.51e-08 2.52e-08 2.53e-08 2.54e-08 2.55e-08 2.56e-08
- 2.57e-08 2.58e-08 2.59e-08 2.6e-08 2.61e-08 2.62e-08 2.63e-08
- 2.64e-08 2.65e-08 2.66e-08 2.67e-08 2.68e-08 2.69e-08 2.7e-08
- 2.71e-08 2.72e-08 2.73e-08 2.74e-08 2.75e-08 2.76e-08 2.77e-08
- 2.78e-08 2.79e-08 2.8e-08 2.81e-08 2.82e-08 2.83e-08 2.84e-08
- 2.85e-08 2.86e-08 2.87e-08 2.88e-08 2.89e-08 2.9e-08 2.91e-08
- 2.92e-08 2.93e-08 2.94e-08 2.95e-08 2.96e-08 2.97e-08 2.98e-08
- 2.99e-08 3e-08 3.01e-08 3.02e-08 3.03e-08 3.04e-08 3.05e-08
- 3.06e-08 3.07e-08 3.08e-08 3.09e-08 3.1e-08 3.11e-08 3.12e-08
- 3.13e-08 3.14e-08 3.15e-08 3.16e-08 3.17e-08 3.18e-08 3.19e-08
- 3.2e-08 3.21e-08 3.22e-08 3.23e-08 3.24e-08 3.25e-08 3.26e-08
- 3.27e-08 3.28e-08 3.29e-08 3.3e-08 3.31e-08 3.32e-08 3.33e-08
- 3.34e-08 3.35e-08 3.36e-08 3.37e-08 3.38e-08 3.39e-08 3.4e-08
- 3.41e-08 3.42e-08 3.43e-08 3.44e-08 3.45e-08 3.46e-08 3.47e-08
- 3.48e-08 3.49e-08 3.5e-08 3.51e-08 3.52e-08 3.53e-08 3.54e-08
- 3.55e-08 3.56e-08 3.57e-08 3.58e-08 3.59e-08 3.6e-08
-}
-v1 set {
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
-}
-
-v2 set {
- 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1
- 5.32907e-15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5
- 5 5 5 5 5 5 5 5 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0
-}
-v3 set {
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 8.88178e-16
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 2.13718e-14 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0
-}
-v4 set {
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
-}
-v5 set {
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
-}
-v6 set {
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 8.88178e-16
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 2.13718e-14 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0
-}
-v7 set {
- 5 5.16904 4.84159 3.34542 0.317102 0.103304 0.0275721 0.0221534
- 0.017689 0.0142639 0.0113974 0.00918238 0.00742541 0.00616602
- 0.00481195 0.00397049 -0.0659889 -0.025671 0.165495 0.986891
- 3.05229 4.55511 4.91611 4.98192 4.99428 4.99833 4.99095
- 4.97295 4.95493 4.93428 4.90723 4.94799 4.98584 4.99566
- 4.99813 4.99907 4.99947 4.99965 4.99976 4.99984 4.99989
- 4.99992 4.99994 4.99996 4.99998 5.00002 5.00006 5.00002
- 4.99996 4.99994 4.99999 5.00003 5.00002 5 4.99997 4.99997
- 4.99997 4.99997 4.99997 4.99996 4.99997 4.99997 4.99998
- 4.99998 4.99999 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99998 4.99998 4.99998 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5.16575
- 4.69986 2.43862 0.0230224 0.035229 -0.0210607 -0.0292766
- -0.0172693 -0.00271479 -0.000912251 -0.000349106 -0.000116866
- -4.24733e-05 -1.39536e-05 -3.01179e-05 -0.0657192 -0.0204835
- 0.183378 1.07181 3.118 4.46472 4.84158 4.94795 4.98173 4.99236
- 4.99762 5.01939 5.0433 5.05332 5.04959 5.03955 5.02851 5.02052
- 5.01422 5.00965 5.00631 5.00405 5.00248 5.00083 5.00012
- 5.00209 5.00387 5.00347 4.99917 4.99213 4.98411 4.97521
- 4.96332 4.94601 4.9304 4.94633 4.97936 4.99264 4.99685 4.99857
- 4.99925 4.99954 4.9997 4.99973 4.9997 4.99973 4.99979 4.99983
- 4.99986 4.99988 4.9999 4.9999 4.99992 4.99993 4.99994 4.99995
- 4.99996 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002
- 5.00002 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 5 5 5.14242 4.76101 3.16003 0.299374
- 0.0645506 -0.000498424 -2.45108e-05 -2.27986e-05 -5.24401e-05
- -4.9884e-05 -4.92491e-05 -2.93354e-05 -3.21402e-05 -2.11851e-05
- -3.37925e-05 -0.0657892 -0.020563 0.182582 1.06058 3.12484
- 4.46552 4.84146 4.95102 4.98556 4.99472 4.99806 4.99909
- 4.99955 4.99976 4.99994 4.99992 5.00029 4.99967 4.99849
- 4.99736 4.99884 5.00099 5.00377 5.00215 4.99994 4.99893
- 4.99788 4.99862 5.00055 5.00134 5.00127 5.00073 5.00039
- 5.00018 5.00006 5.00001 4.99985 5.00026 5.00018 5.00003
- 4.99981 4.99985 4.99987 4.99985 4.99982 4.99982 4.99982
- 4.99983 4.99985 4.99987 4.99989 4.99991 4.99992 4.99994
- 4.99995 4.99995 4.99994 4.99994 4.99996 4.99999 5.00002
- 5.00008 5.00009 5.00006 5.00001 5 4.99999 4.99998 4.99997
- 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999 4.99999
- 4.99999 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99998 4.99998
- 4.99998
-}
-v8 set {
- 5 5.03758 5.04711 4.96911 4.20882 3.96295 4.01117 4.15521
- 4.2967 4.42274 4.5295 4.6176 4.69014 4.74831 4.7966 4.83537
- 4.80526 4.787 4.79295 4.88588 5.08978 5.15615 5.10778 5.07718
- 5.06652 5.08225 4.9744 4.52977 3.77452 2.69426 1.15294 0.245509
- 0.0981544 0.0567527 0.0367487 0.0252578 0.0180599 0.0133837
- 0.0101497 0.0078616 0.00620186 0.00499056 0.0041027 0.00344223
- 0.00295808 0.00260089 0.00229887 0.00200817 0.00176397 0.00160116
- 0.00147381 0.00134645 0.00125029 0.00116043 0.00107371 0.00101981
- 0.000965921 0.000912028 0.000858135 0.000804242 0.000761669
- 0.00072672 0.000691771 0.000656823 0.000621874 0.000588722
- 0.00057041 0.000552098 0.000533785 0.000515473 0.000497162
- 0.00047885 0.000460537 0.000442226 0.000423914 0.000405601
- 0.000388399 0.000378694 0.000368989 0.000359284 0.00034958
- 0.000339875 0.00033017 0.000320465 0.00031076 0.000301055
- 0.00029135 0.000282207 0.000276247 0.000270287 0.000264327
- 0.000258367 0.000252407 0.000246447 0.000240487 0.000234527
- 0.000228567 0.000222607 0.000217086 0.000213696 0.000210307
- 0.000206918 0.000203528 0.000200139 0.00019675 0.00019336
- 0.000189971 0.000186582 0.000183192 0.000179803 0.000176414
- 0.000173025 0.000169635 0.000166246 0.000162857 0.000159467
- 0.000156078 0.000152689 0.000149299 0.00014591 0.00014255
- 0.0316021 0.163272 0.348732 0.603651 0.35745 0.135965 0.0707354
- 0.0314595 0.0201047 0.00994945 0.00389601 0.00138839 0.00060778
- 0.000329648 0.000492396 -0.0732035 -0.0844077 -0.0789062
- -0.0390837 0.0197559 0.0183094 -0.00180099 -0.0189565 -0.0424144
- -0.0735904 -0.0892423 0.285039 1.13702 2.10809 2.95826 3.60164
- 4.0435 4.35771 4.57254 4.71769 4.81329 4.87534 4.91487 4.94264
- 4.97375 5.01526 5.06517 5.10154 5.06259 4.89005 4.5787 4.12226
- 3.46151 2.49023 1.2586 0.32725 0.116753 0.0701865 0.0455509
- 0.0286914 0.0178176 0.0117599 0.00902715 0.00760583 0.00637745
- 0.00543811 0.00439377 0.00352448 0.0030151 0.00285771 0.002465
- 0.00203114 0.00173004 0.0014839 0.00125177 0.00105327 0.000894905
- 0.000766372 0.000658894 0.000569105 0.000492114 0.000427938
- 0.000370217 0.000314758 0.000266569 0.000233726 0.000209048
- 0.000191957 0.000177169 0.000166604 0.000161 0.000157314
- 0.000143828 0.000130342 0.000116857 0.000103371 8.98855e-05
- 7.63998e-05 6.29141e-05 5.76583e-05 5.30027e-05 4.8347e-05
- 4.36913e-05 3.90357e-05 3.438e-05 2.97243e-05 2.72507e-05
- 2.59083e-05 2.45659e-05 2.32235e-05 2.18811e-05 2.05387e-05
- 1.91963e-05 1.78539e-05 1.65115e-05 1.51691e-05 1.38267e-05
- 1.24843e-05 1.11419e-05 9.79954e-06 8.51574e-06 7.69807e-06
- 6.8804e-06 6.06273e-06 5.24506e-06 0.0287318 0.0317111 -0.0320087
- -0.103609 0.0369639 0.0121128 0.00961197 0.00934971 0.00820853
- 0.00699769 0.00607002 0.00535541 0.00476552 0.00427601 0.00376357
- -0.073012 -0.0866964 -0.0809538 -0.038005 0.0277001 0.0188906
- 0.00614597 0.00373629 0.00489787 0.0146573 0.0191052 0.0151708
- 0.0124224 0.0105859 0.00879272 0.00729464 0.0070047 0.00449575
- -0.00626652 -0.0252417 -0.0147287 0.022538 0.0822905 0.0947372
- 0.0657516 0.0445506 0.0316753 0.0220971 0.0158101 0.0140971
- 0.0161498 0.0139876 0.0122447 0.0106994 0.009397 0.00822236
- 0.00686509 0.00797431 0.00751269 0.00671173 0.00595243 0.00524633
- 0.00459528 0.00401688 0.00350109 0.00303954 0.00260569 0.00222792
- 0.00191033 0.00163917 0.00140949 0.00121464 0.0010471 0.000900638
- 0.000768847 0.000645236 0.000524807 0.000460275 0.000442237
- 0.000446775 0.000397026 0.000301585 0.000228994 0.000190894
- 0.000166569 0.000152261 0.000137953 0.000123644 0.000109336
- 9.50281e-05 8.56557e-05 7.78437e-05 7.00318e-05 6.22198e-05
- 5.44079e-05 4.87539e-05 4.57761e-05 4.27982e-05 3.98203e-05
- 3.68425e-05 3.38646e-05 3.08868e-05 2.79089e-05 2.4931e-05
- 2.19532e-05 1.89753e-05 1.75244e-05 1.64095e-05 1.52946e-05
- 1.41797e-05 1.30648e-05 1.19499e-05 1.0835e-05 9.72011e-06
- 8.60521e-06 7.4903e-06 6.5117e-06 6.10334e-06 5.69497e-06
- 5.2866e-06 4.87824e-06 4.46987e-06 4.06151e-06 3.65314e-06
- 3.24477e-06
-}
-
-v9 set {
- 1.86175 1.99708 2.07867 2.01211 2.43309 3.27194 3.63896
- 3.90426 4.11074 4.27932 4.41496 4.52543 4.61491 4.68862
- 4.7479 4.79666 4.72895 4.68886 4.70354 4.81353 5.01568 5.14184
- 5.10482 5.07362 5.05143 5.03638 5.02323 5.01465 5.00853
- 5.00383 4.99985 5.00454 5.00652 5.00546 5.00411 5.003 5.00214
- 5.00151 5.00106 5.00073 5.0005 5.00034 5.00023 5.00015 5.0001
- 5.00005 5 5.00001 5.00005 5.00005 5.00003 5 4.99998 4.99996
- 4.99994 4.99995 4.99997 4.99998 5 5.00001 5.00002 5.00002
- 5.00003 5.00003 5.00003 5.00003 5.00003 5.00003 5.00002
- 5.00002 5.00001 5.00001 5.00001 5 5 5 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998
- 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 5 5 5 5
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.17392 4.94828 3.78491
- 1.52079 0.608874 0.244031 0.127087 0.0552995 0.0361032 0.0169025
- 0.006364 0.00217624 0.000921391 0.000457305 0.000786754
- -0.120016 -0.148054 -0.15898 -0.0801463 0.16463 0.174017
- 0.0799249 0.0318788 0.0129696 0.00483397 0.0025677 0.0042079
- 0.00350003 0.00178404 -8.72902e-05 -0.00128497 -0.00142213
- -0.00130018 -0.00106874 -0.000789207 -0.000824335 -0.00104518
- -0.00136799 -0.004366 -0.0102621 -0.0109254 -0.00649259
- -0.00194842 0.00029793 0.00148673 0.00221085 0.00228291
- 0.00185261 0.00139687 0.00148183 0.00562266 0.00844119 0.00754627
- 0.00657396 0.00591212 0.00539269 0.0049282 0.00448417 0.0040572
- 0.00363719 0.00320392 0.00279607 0.00243938 0.00211505 0.00182302
- 0.00156254 0.0013341 0.00113834 0.000971865 0.00082776 0.000706193
- 0.000602499 0.000515059 0.000441401 0.00037897 0.000325459
- 0.00028083 0.000242096 0.000207274 0.000176444 0.000150372
- 0.000126407 0.000103373 9.05522e-05 8.53555e-05 8.63685e-05
- 9.02593e-05 8.37346e-05 7.72099e-05 7.06852e-05 6.41605e-05
- 5.76358e-05 5.11112e-05 4.45865e-05 4.08176e-05 3.72497e-05
- 3.36818e-05 3.01138e-05 2.65459e-05 2.2978e-05 1.94101e-05
- 1.76154e-05 1.67399e-05 1.58645e-05 1.4989e-05 1.41136e-05
- 1.32381e-05 1.23626e-05 1.14872e-05 1.06117e-05 9.73629e-06
- 8.86083e-06 7.98538e-06 7.10993e-06 6.23447e-06 5.44363e-06
- 5.32578e-06 5.20792e-06 5.09007e-06 4.97222e-06 0.0784323
- 0.0474527 -0.0764232 -0.151146 0.0615785 0.0144489 0.00974161
- 0.00947176 0.00849005 0.00728201 0.00630581 0.00554032 0.00487809
- 0.00441504 0.00384139 -0.118943 -0.149894 -0.161173 -0.0825299
- 0.171686 0.176912 0.0816085 0.0335236 0.013791 0.0056976
- 0.00238833 0.00105348 0.000526199 0.00025969 0.000396026
- 0.000837835 0.00170131 0.00196699 -0.000553314 -0.0061621
- -0.0111895 -0.0142698 -0.0124608 -0.00795847 -0.00467822
- -0.0043058 -0.00874449 -0.0118584 -0.00871386 -0.00377892
- 1.95244e-05 0.00218952 0.00325486 0.00386497 0.00422837
- 0.00446883 0.00447065 0.00486647 0.00547838 0.00565398 0.00559092
- 0.00538752 0.00507015 0.00466305 0.00420756 0.00373465 0.00328404
- 0.00287059 0.00250057 0.00216124 0.00184861 0.00156815 0.00134624
- 0.00117857 0.00103412 0.0008948 0.000761012 0.000619853
- 0.000462614 0.000319965 0.000287666 0.000356415 0.000379946
- 0.000339183 0.00027972 0.000252982 0.000226244 0.000199507
- 0.000172769 0.000146031 0.000130097 0.000117578 0.000105059
- 9.25401e-05 8.00213e-05 7.11204e-05 6.67061e-05 6.22918e-05
- 5.78775e-05 5.34632e-05 4.90489e-05 4.46346e-05 4.02203e-05
- 3.5806e-05 3.13916e-05 2.69773e-05 2.4827e-05 2.31747e-05
- 2.15225e-05 1.98702e-05 1.8218e-05 1.65658e-05 1.49135e-05
- 1.32613e-05 1.1609e-05 9.95678e-06 8.50108e-06 7.86765e-06
- 7.23422e-06 6.60079e-06 5.96736e-06 5.33393e-06 4.7005e-06
- 4.06707e-06 3.43363e-06
-}
-v10 set {
- 1.86175 1.99308 2.16619 2.46661 3.09359 3.76864 4.31299
- 4.65564 4.83425 4.92153 4.96157 4.98063 4.98649 4.99039
- 4.9945 4.9972 4.96206 4.89882 4.83865 4.83202 4.91016 5.04479
- 5.06078 5.04827 5.03474 5.0246 5.01639 5.00996 5.00569 5.00239
- 5.00043 5.00296 5.00437 5.00382 5.00287 5.00208 5.00148
- 5.00104 5.00073 5.0005 5.00034 5.00023 5.00016 5.00011 5.00008
- 5.00007 5.00007 5.00004 5 4.99998 4.99998 4.99997 4.99998
- 4.99999 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001
- 5.00001 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 5.10081
- 5.10949 4.98359 5.00733 5.15145 4.37298 2.36126 0.470759
- 0.0577238 0.0115884 0.00262611 0.000671499 0.000389038 0.000291291
- 0.000317347 -0.0167823 -0.0158344 -0.0140559 0.0104849 0.0865874
- 0.107813 0.0524688 0.0214369 0.00876443 0.00341595 0.00170778
- 0.00259042 0.0022241 0.00118519 1.10217e-06 -0.000784506
- -0.000948169 -0.000856256 -0.000696719 -0.000485987 -0.000724787
- -0.000981491 -0.001454 -0.00552498 -0.0114992 -0.0105266
- -0.00543527 -0.000982798 0.00127356 0.00224212 0.00275439
- 0.00281098 0.0025471 0.00230368 0.00222576 0.00485522 0.00729453
- 0.00691796 0.0062615 0.00573987 0.0052688 0.00481185 0.00436934
- 0.00394326 0.00352712 0.00309978 0.00270038 0.00235335 0.00203742
- 0.00175256 0.00150067 0.00128126 0.00109323 0.000933619
- 0.000795113 0.000678182 0.00057843 0.000494345 0.000423609
- 0.000363821 0.000312766 0.000269856 0.000232389 0.000198382
- 0.000168126 0.00014267 0.000119293 9.69034e-05 8.5669e-05
- 8.26828e-05 8.64066e-05 9.26665e-05 8.5454e-05 7.82416e-05
- 7.10291e-05 6.38167e-05 5.66043e-05 4.93918e-05 4.21794e-05
- 3.86073e-05 3.53007e-05 3.19941e-05 2.86876e-05 2.5381e-05
- 2.20744e-05 1.87678e-05 1.70933e-05 1.62648e-05 1.54363e-05
- 1.46079e-05 1.37794e-05 1.2951e-05 1.21225e-05 1.12941e-05
- 1.04656e-05 9.63716e-06 8.80871e-06 7.98026e-06 7.1518e-06
- 6.32335e-06 5.5374e-06 5.08959e-06 4.64178e-06 4.19397e-06
- 3.74616e-06 0.0438026 0.0242078 -0.0602019 -0.0840866 0.00148461
- -0.00292489 0.000442098 0.00219489 0.00281478 0.00290756
- 0.00277945 0.00263896 0.00240099 0.00223283 0.001947 -0.0153629
- -0.0148815 -0.0128673 0.0126017 0.0905161 0.11051 0.0538958
- 0.022562 0.00935726 0.00397422 0.00172534 0.000790207 0.000416322
- 0.000191632 0.000469721 0.0009779 0.00192566 0.00200688
- -0.0016502 -0.00733932 -0.0128113 -0.0147608 -0.0115456
- -0.00668995 -0.00401368 -0.00463908 -0.0101197 -0.0118993
- -0.0076276 -0.00262656 0.000813059 0.00264455 0.00350796
- 0.00399494 0.0043049 0.00451658 0.00444739 0.00503842 0.00559516
- 0.00568213 0.00556459 0.0053176 0.00496654 0.00454337 0.00408592
- 0.00362171 0.00317793 0.00277001 0.00240394 0.00207009 0.00176575
- 0.00149725 0.00129045 0.00114257 0.00101135 0.000871672
- 0.000723764 0.000580438 0.000427507 0.000296956 0.000281834
- 0.000376628 0.000412266 0.000367547 0.000295305 0.000264513
- 0.000233721 0.000202929 0.000172137 0.000141345 0.000124721
- 0.000112577 0.000100433 8.82893e-05 7.61453e-05 6.75517e-05
- 6.33609e-05 5.91701e-05 5.49792e-05 5.07884e-05 4.65976e-05
- 4.24067e-05 3.82159e-05 3.40251e-05 2.98342e-05 2.56434e-05
- 2.36401e-05 2.21181e-05 2.05961e-05 1.90741e-05 1.75521e-05
- 1.60301e-05 1.45081e-05 1.29861e-05 1.14641e-05 9.94208e-06
- 8.59252e-06 7.96439e-06 7.33626e-06 6.70813e-06 6.07999e-06
- 5.45186e-06 4.82373e-06 4.1956e-06 3.56747e-06
-}
-v11 set {
- 1.86175 1.73419 1.42874 1.04055 0.943004 0.268275 0.0826455
- 0.0388346 0.0214104 0.0135431 0.00961322 0.00712846 0.00588262
- 0.00432397 0.00377774 0.00270134 -0.00393731 -0.00542187
- -0.00126596 0.0113777 0.0134522 0.00477056 -0.00211067 -0.00229253
- -0.00173355 -0.00122404 -0.00113426 -0.000744931 -0.000520112
- -0.000410048 -0.000220439 0.000508104 5.15856e-05 -0.000112593
- -0.000118917 -9.57394e-05 -7.15727e-05 -5.11847e-05 -3.58275e-05
- -2.47166e-05 -1.68866e-05 -1.14082e-05 -7.66646e-06 -5.12139e-06
- -3.63426e-06 -3.01815e-06 -2.64862e-06 -1.4947e-06 -1.91403e-07
- -2.5763e-08 -7.73699e-07 -1.52164e-06 -1.07268e-06 -3.81696e-07
- 2.6727e-07 4.75489e-07 6.83708e-07 8.91926e-07 1.10014e-06
- 1.30836e-06 1.2482e-06 1.00726e-06 7.66311e-07 5.25364e-07
- 2.84417e-07 6.27857e-08 7.43904e-10 -6.12979e-08 -1.2334e-07
- -1.85382e-07 -2.47423e-07 -3.09465e-07 -3.71507e-07 -4.33549e-07
- -4.95591e-07 -5.57633e-07 -6.04571e-07 -5.4944e-07 -4.9431e-07
- -4.3918e-07 -3.84049e-07 -3.28919e-07 -2.73789e-07 -2.18659e-07
- -1.63528e-07 -1.08398e-07 -5.32678e-08 1.062e-09 5.08502e-08
- 1.00638e-07 1.50427e-07 2.00215e-07 2.50003e-07 2.99791e-07
- 3.4958e-07 3.99368e-07 4.49156e-07 4.98944e-07 5.34512e-07
- 5.01032e-07 4.67553e-07 4.34073e-07 4.00593e-07 3.67113e-07
- 3.33633e-07 3.00153e-07 2.66674e-07 2.33194e-07 1.99714e-07
- 1.66234e-07 1.32754e-07 9.92744e-08 6.57945e-08 3.23147e-08
- -1.16513e-09 -3.4645e-08 -6.81248e-08 -1.01605e-07 -1.35084e-07
- -1.68564e-07 -2.18729e-07 0.0114926 -0.0245378 -0.111828
- 0.0964775 1.61491 3.22668 4.22041 4.54492 4.82845 4.94868
- 4.98588 4.99609 4.9981 4.99908 4.99788 4.98395 4.99294 4.99724
- 5.01939 5.0471 5.00902 4.98194 4.98496 4.99188 4.99623 4.99862
- 5.00025 4.99974 4.99953 4.99946 4.99958 5.00012 4.99997
- 4.99992 4.99988 4.99985 4.9998 4.9997 4.9988 4.99806 4.99982
- 5.00143 5.00159 5.00098 5.00053 5.00028 5.00007 4.99977
- 4.99992 5.00005 5.00133 5.0009 4.99993 4.99972 4.99975 4.9998
- 4.99982 4.99983 4.99983 4.99983 4.99983 4.99984 4.99986
- 4.99987 4.99989 4.9999 4.99991 4.99992 4.99994 4.99995 4.99995
- 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998 4.99998
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 5 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 5 5 5.01457 4.99482 4.96561 4.99326
- 5.03452 5.00424 5.00101 5.00045 5.00004 4.99965 4.99997
- 4.99994 4.99958 4.99999 4.99936 4.9839 4.99248 4.99717 5.01976
- 5.04869 5.0087 4.98143 4.98488 4.99199 4.99622 4.9983 4.99928
- 4.99971 4.99986 5.00031 5.00022 5.00035 5.0001 4.99884 4.99811
- 4.99803 4.99887 5.00078 5.00151 5.00116 5.00007 4.99843
- 4.99915 5.00107 5.00168 5.00141 5.00092 5.00055 5.0003 5.00016
- 5.0001 5.00001 5.00016 5.0002 5.00009 4.99993 4.99975 4.99984
- 4.99991 4.99991 4.99982 4.99974 4.99974 4.99985 4.99995
- 4.99999 4.99998 5.00004 5.00013 5.00015 5.00007 4.99988
- 4.99982 4.99985 4.99995 5.00006 5.0002 5.00025 5.0002 5.00009
- 5.00006 5.00004 5.00002 5 4.99998 4.99997 4.99998 4.99998
- 4.99999 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999
- 4.99998 4.99998 4.99998
-}
-v12 set {
- 5 5.16975 4.78685 2.94241 0.126698 0.0487004 -0.00422591
- -0.00130689 -0.000486756 -0.000195875 -0.000108988 -6.66736e-05
- -7.26005e-05 -5.63608e-05 -3.81859e-05 -2.123e-05 -0.0646846
- -0.0184474 0.182248 1.06731 3.10988 4.46133 4.84133 4.95113
- 4.98364 4.99455 4.99694 4.99727 4.9994 4.99975 5.0001 5.00132
- 5.00089 5.00039 5.00019 5.00011 5.00006 5.00005 5.00004
- 5.00001 4.99992 4.99992 5.00002 5.00013 5.00017 5.00009
- 4.99992 4.99991 4.99994 4.99996 4.99998 4.99999 5.00001
- 5.00004 5.00006 5.00005 5.00004 5.00003 5.00002 5.00001
- 5 4.99999 4.99999 4.99998 4.99998 4.99997 4.99997 4.99998
- 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999
- 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 5 5.14699 4.78074
- 3.19424 0.305663 0.0611255 -0.00179951 -0.0012032 0.000405978
- 0.000989399 0.000445194 0.000191447 8.30476e-05 3.96236e-05
- 1.91866e-05 1.70665e-05 -0.0655239 -0.0210234 0.1827 1.06848
- 3.11554 4.46518 4.84212 4.94853 4.98244 4.99434 4.9997 5.00081
- 5.00009 4.99972 4.99985 4.99974 4.9995 4.99949 4.99958 4.99973
- 4.99948 4.99914 4.99874 4.99946 5.00309 5.0091 5.01576 5.01835
- 5.01852 5.0176 5.01625 5.01479 5.01345 5.01264 5.011 5.01092
- 5.01344 5.01363 5.01289 5.01184 5.01071 5.00956 5.00848
- 5.00751 5.00663 5.00577 5.00497 5.00427 5.00365 5.0031 5.00264
- 5.00224 5.00191 5.00163 5.00138 5.00117 5.00099 5.00083
- 5.00071 5.00061 5.00053 5.00045 5.00037 5.00029 5.00022
- 5.00019 5.0002 5.00023 5.00024 5.00023 5.00023 5.00022 5.0002
- 5.00018 5.00016 5.00014 5.00011 5.00009 5.00007 5.00006
- 5.00005 5.00005 5.00004 5.00003 5.00002 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00001 5.00001 5.00001 5.14298 4.79809 3.32704
- 0.498385 0.105773 0.0160646 0.0319912 0.0299434 0.0240102
- 0.0185844 0.0130411 0.0106532 0.00864871 0.00744519 0.00660887
- -0.0612913 -0.0203719 0.174998 0.991787 3.06292 4.60005
- 4.93058 4.98917 5.00033 4.9999 4.99909 4.9966 4.9955 4.99488
- 4.99374 4.9943 5.00131 5.00506 4.99311 4.96288 4.93567 4.92439
- 4.94236 4.9732 4.98864 4.99458 5.00031 5.00694 5.01525 5.01945
- 5.01998 5.01953 5.01874 5.01766 5.0164 5.01509 5.01326 5.01423
- 5.01455 5.01361 5.01245 5.01122 5.01002 5.00888 5.00783
- 5.00687 5.00596 5.00514 5.00442 5.00379 5.00325 5.00279
- 5.0024 5.00208 5.0018 5.00153 5.00126 5.00107 5.00094 5.00085
- 5.00078 5.00072 5.00063 5.00053 5.00042 5.00038 5.00034
- 5.0003 5.00027 5.00023 5.00021 5.00019 5.00017 5.00015 5.00013
- 5.00012 5.00011 5.0001 5.0001 5.00009 5.00008 5.00007 5.00007
- 5.00006 5.00005 5.00005 5.00004 5.00004 5.00003 5.00003
- 5.00002 5.00002 5.00002 5.00001 5.00001 5 5 5 5.00001 5.00001
- 5.00001 5.00002 5.00002 5.00002 5.00002
-}
-v13 set {
- 9.73784e-10 0.0189926 0.0926769 0.206309 0.111533 0.0953491
- 0.0426966 0.0214177 0.0117943 0.00741442 0.00528816 0.00398417
- 0.0032967 0.00266499 0.00206647 0.00158788 -0.0371391 -0.0439528
- -0.0408653 -0.0188706 0.0150241 0.0126852 0.00209817 -0.000239206
- -5.31488e-05 0.000876324 -0.00451221 -0.0165223 -0.0284127
- -0.0427584 -0.0502453 -0.0257366 -0.00903938 -0.00376456
- -0.00233385 -0.00169922 -0.00130397 -0.00102542 -0.000811435
- -0.000648115 -0.000529266 -0.00043795 -0.00036574 -0.00030716
- -0.00026221 -0.000229662 -0.000205112 -0.000181038 -0.000162045
- -0.000148988 -0.000137633 -0.000126278 -0.000115562 -0.000104976
- -9.49324e-05 -9.0585e-05 -8.62375e-05 -8.18901e-05 -7.75426e-05
- -7.31952e-05 -6.93752e-05 -6.59106e-05 -6.24461e-05 -5.89815e-05
- -5.55169e-05 -5.22412e-05 -5.05263e-05 -4.88114e-05 -4.70966e-05
- -4.53817e-05 -4.36668e-05 -4.19519e-05 -4.0237e-05 -3.85222e-05
- -3.68073e-05 -3.50924e-05 -3.34782e-05 -3.25442e-05 -3.16102e-05
- -3.06763e-05 -2.97423e-05 -2.88083e-05 -2.78744e-05 -2.69404e-05
- -2.60064e-05 -2.50725e-05 -2.41385e-05 -2.32635e-05 -2.27232e-05
- -2.21829e-05 -2.16426e-05 -2.11023e-05 -2.0562e-05 -2.00217e-05
- -1.94814e-05 -1.89411e-05 -1.84007e-05 -1.78604e-05 -1.73647e-05
- -1.70853e-05 -1.68059e-05 -1.65265e-05 -1.62471e-05 -1.59677e-05
- -1.56883e-05 -1.54089e-05 -1.51295e-05 -1.48501e-05 -1.45707e-05
- -1.42913e-05 -1.40119e-05 -1.37325e-05 -1.34531e-05 -1.31737e-05
- -1.28943e-05 -1.26149e-05 -1.23355e-05 -1.20561e-05 -1.17767e-05
- -1.14973e-05 -1.10954e-05 0.0152675 0.0228237 -0.00460678
- -0.0341525 0.0232109 -0.0138039 -0.0416538 -0.0458764 -0.0201967
- -0.00878316 -0.00379173 -0.00164621 -0.000785131 -0.00037575
- -0.000352375 -0.0545586 -0.0746881 -0.0771865 -0.05386 -0.0022199
- 0.0136703 0.00633526 0.00138826 -0.00108934 0.0038886 0.0298077
- 0.0475776 0.0481003 0.0464167 0.047818 0.042789 0.035207
- 0.0264423 0.0193959 0.0151614 0.00624257 -0.00913057 -0.0310696
- -0.0430238 0.016426 0.189762 0.49025 0.820116 1.13919 1.43549
- 1.70658 1.95183 2.17414 2.38506 2.5657 2.73958 2.97905 3.21403
- 3.43025 3.62645 3.8028 3.96002 4.09996 4.22443 4.33427 4.42886
- 4.51097 4.5817 4.64326 4.6957 4.74132 4.7797 4.81298 4.84102
- 4.86512 4.88523 4.90224 4.91649 4.92846 4.93868 4.94755
- 4.95483 4.96114 4.96682 4.97161 4.97502 4.9776 4.97944 4.98141
- 4.98319 4.98467 4.98585 4.9869 4.98796 4.98902 4.99008 4.99114
- 4.9922 4.99326 4.9938 4.99429 4.99479 4.99528 4.99578 4.99628
- 4.99677 4.99704 4.99718 4.99733 4.99747 4.99762 4.99777
- 4.99791 4.99806 4.9982 4.99835 4.9985 4.99864 4.99879 4.99893
- 4.99907 4.99916 4.99925 4.99934 4.99943 5.01473 4.92293
- 4.61974 4.0316 3.7835 3.74195 3.78344 3.87272 3.97386 4.07319
- 4.16686 4.25256 4.33126 4.40264 4.46697 4.49249 4.51807
- 4.55803 4.64055 4.78574 4.86074 4.88334 4.8999 4.91455 4.92814
- 4.93926 4.94761 4.95433 4.95907 4.9654 4.98317 5.0208 5.05134
- 4.85852 4.16041 3.00077 1.68376 0.672707 0.240838 0.0794725
- -0.0106347 -0.00879443 0.107196 0.368163 0.701424 1.03581
- 1.3601 1.6678 1.95731 2.22701 2.47544 2.69099 2.92327 3.16648
- 3.3877 3.59067 3.77344 3.93584 4.08066 4.20863 4.32065 4.41791
- 4.50211 4.57423 4.63614 4.68888 4.73377 4.7721 4.80519 4.83338
- 4.85732 4.87815 4.89514 4.90927 4.92108 4.93122 4.94014
- 4.94845 4.95601 4.96251 4.96576 4.969 4.97225 4.9755 4.97874
- 4.98087 4.98265 4.98442 4.9862 4.98797 4.98924 4.9899 4.99055
- 4.9912 4.99186 4.99251 4.99316 4.99381 4.99447 4.99512 4.99577
- 4.99609 4.99634 4.99659 4.99683 4.99708 4.99732 4.99757
- 4.99782 4.99806 4.99831 4.99853 4.99863 4.99873 4.99883
- 4.99893 4.99903 4.99913 4.99923 4.99933
-}
-
-v14 set {
- 1.86175 2.00147 1.85141 1.0654 0.275481 0.205547 0.0712627
- 0.0313387 0.0151431 0.00864531 0.00593861 0.00438111 0.0037479
- 0.00305857 0.00221221 0.0017081 -0.0896128 -0.109079 -0.121356
- -0.0542001 0.175821 0.177442 0.0814591 0.0333042 0.0134909
- 0.00625777 0.00100092 -0.00552776 -0.00411139 -0.00150395
- -0.000564784 3.48169e-05 -0.000287014 -0.000538515 -0.000456537
- -0.000325677 -0.000275468 -0.000166452 -8.27481e-05 -8.28704e-05
- -7.47644e-05 -4.60552e-05 -2.61481e-06 2.26359e-05 2.53852e-05
- -1.39853e-06 -4.23456e-05 -4.0907e-05 -2.8501e-05 -1.5945e-05
- -9.01122e-06 -2.07747e-06 1.49328e-06 4.38398e-06 6.84248e-06
- 4.76711e-06 2.69173e-06 6.16362e-07 -1.45901e-06 -3.53438e-06
- -4.14256e-06 -3.76238e-06 -3.3822e-06 -3.00202e-06 -2.62184e-06
- -2.24878e-06 -1.93456e-06 -1.62033e-06 -1.3061e-06 -9.91867e-07
- -6.77638e-07 -3.63409e-07 -4.91792e-08 2.6505e-07 5.7928e-07
- 8.93509e-07 1.16076e-06 1.11055e-06 1.06034e-06 1.01014e-06
- 9.59927e-07 9.09719e-07 8.59511e-07 8.09302e-07 7.59094e-07
- 7.08886e-07 6.58678e-07 5.99251e-07 4.87523e-07 3.75795e-07
- 2.64068e-07 1.5234e-07 4.06119e-08 -7.1116e-08 -1.82844e-07
- -2.94572e-07 -4.063e-07 -5.18027e-07 -6.08517e-07 -5.95879e-07
- -5.83241e-07 -5.70604e-07 -5.57966e-07 -5.45328e-07 -5.3269e-07
- -5.20053e-07 -5.07415e-07 -4.94777e-07 -4.8214e-07 -4.69502e-07
- -4.56864e-07 -4.44226e-07 -4.31589e-07 -4.18951e-07 -4.06313e-07
- -3.93676e-07 -3.81038e-07 -3.684e-07 -3.55762e-07 -3.43125e-07
- 1.06736e-05 0.0797407 0.0437947 -0.0645098 -0.0877312 0.0653203
- -0.00621184 -0.0353188 -0.0491378 -0.0251957 -0.0110996
- -0.00481123 -0.0020941 -0.000998038 -0.000478747 -0.000445332
- -0.102046 -0.135753 -0.154351 -0.0827509 0.163348 0.174012
- 0.0794822 0.0310624 0.0112213 0.00249061 0.00130764 0.00181315
- 0.00163875 0.00101454 0.000497435 0.000195258 5.31901e-05
- 2.4607e-05 6.62736e-05 7.90718e-05 4.0372e-05 -0.000141184
- -0.000280623 5.5608e-05 0.000799565 0.000920189 0.000931616
- 0.000494527 0.000162303 -8.24884e-05 -0.000183938 -0.000203899
- -0.000144788 -9.87063e-05 -0.000227929 2.93932e-05 0.000208563
- 1.88958e-06 -7.6335e-05 -0.000172472 -0.000165656 -0.000145889
- -0.000177311 -0.000191058 -0.000168287 -0.00015755 -0.00013142
- -8.10488e-05 -6.36115e-05 -7.8699e-05 -8.11282e-05 -7.98625e-05
- -5.98807e-05 -3.40879e-05 -1.95464e-05 -1.79247e-05 -4.45514e-05
- -7.47995e-05 -8.7682e-05 -7.50806e-05 -3.25561e-05 -4.34114e-05
- -7.69099e-05 -0.000141101 -0.00018743 -0.000148471 -5.06546e-05
- 0.000120195 0.000177635 0.000177052 0.000146344 9.75126e-05
- 8.31233e-05 6.8734e-05 5.43447e-05 3.99554e-05 2.55661e-05
- 1.11768e-05 -3.21253e-06 -3.88937e-06 -3.56628e-06 -3.24318e-06
- -2.92008e-06 -2.59699e-06 -2.27389e-06 -1.9508e-06 -1.73227e-06
- -1.56796e-06 -1.40365e-06 -1.23934e-06 -1.07503e-06 -9.10722e-07
- -7.46412e-07 -5.82101e-07 -4.1779e-07 -2.5348e-07 -8.91694e-08
- 7.51412e-08 2.39452e-07 4.03762e-07 5.95733e-07 1.00771e-06
- 1.41969e-06 1.83167e-06 2.24365e-06 0.0828257 0.231038 0.465438
- 1.54516 2.8461 3.19221 3.40395 3.6382 3.80758 3.93848 4.04882
- 4.15428 4.247 4.32917 4.40235 4.36941 4.397 4.48862 4.64552
- 4.86595 5.03475 5.0348 5.02627 5.01967 5.01542 5.00925 4.98613
- 4.9519 4.91581 4.87357 4.82302 4.80403 4.82565 4.86102 4.89483
- 4.92253 4.94428 4.96257 4.97608 4.98373 4.98823 4.99182
- 4.99437 4.99635 4.99745 4.99802 4.99843 4.99873 4.99895
- 4.99912 4.99925 4.99931 4.99962 4.99973 4.99972 4.99971
- 4.9997 4.99969 4.9997 4.99971 4.99973 4.99974 4.99976 4.99978
- 4.9998 4.99982 4.99985 4.99987 4.99989 4.9999 4.99991 4.99991
- 4.99993 4.99994 4.99997 5.00001 5.00006 5.00008 5.00006
- 5.00002 5 4.99999 4.99998 4.99997 4.99995 4.99995 4.99995
- 4.99995 4.99995 4.99995 4.99995 4.99996 4.99997 4.99997
- 4.99998 4.99999 5 5 5.00001 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00001
- 5.00001 5.00001 5.00001 5.00001 5 5 5 4.99999 4.99999 4.99999
-
-}
-v15 set {
- 1.86175 2.00199 2.08919 1.84314 1.08254 0.214737 0.0377351
- 0.00952455 0.00232763 0.000563614 0.000263477 0.000148642
- 0.000285086 0.000242592 7.34699e-05 -1.53467e-05 -0.0161874
- -0.0157876 -0.0141194 0.0132576 0.0903272 0.109938 0.0535295
- 0.0224216 0.00940945 0.00466825 -0.000649972 -0.00654752
- -0.00333248 -0.00103671 -0.000508276 -5.8896e-05 -0.00043938
- -0.000544704 -0.00044444 -0.000307093 -0.00024517 -0.000154538
- -8.78602e-05 -7.10461e-05 -6.06485e-05 -3.91039e-05 -8.45988e-06
- 9.43442e-06 1.28351e-05 -2.16734e-06 -2.6142e-05 -2.54768e-05
- -1.88997e-05 -1.17906e-05 -7.3808e-06 -2.97101e-06 1.19146e-07
- 2.94246e-06 5.38942e-06 3.88851e-06 2.38761e-06 8.86704e-07
- -6.14201e-07 -2.11511e-06 -2.59565e-06 -2.38885e-06 -2.18205e-06
- -1.97525e-06 -1.76845e-06 -1.56241e-06 -1.36258e-06 -1.16276e-06
- -9.62939e-07 -7.63116e-07 -5.63293e-07 -3.6347e-07 -1.63647e-07
- 3.61756e-08 2.35999e-07 4.35822e-07 6.07653e-07 5.90323e-07
- 5.72994e-07 5.55665e-07 5.38336e-07 5.21007e-07 5.03678e-07
- 4.86349e-07 4.6902e-07 4.51691e-07 4.34361e-07 4.11899e-07
- 3.60315e-07 3.08731e-07 2.57146e-07 2.05562e-07 1.53977e-07
- 1.02393e-07 5.08082e-08 -7.76222e-10 -5.23607e-08 -1.03945e-07
- -1.47815e-07 -1.54225e-07 -1.60635e-07 -1.67045e-07 -1.73455e-07
- -1.79864e-07 -1.86274e-07 -1.92684e-07 -1.99094e-07 -2.05504e-07
- -2.11914e-07 -2.18324e-07 -2.24734e-07 -2.31144e-07 -2.37554e-07
- -2.43964e-07 -2.50373e-07 -2.56783e-07 -2.63193e-07 -2.69603e-07
- -2.76013e-07 -2.82423e-07 2.92534e-06 0.0446777 0.024278
- -0.0518987 -0.0636547 0.00983929 -0.000518204 -0.000265194
- 0.000154772 0.000299538 3.12715e-05 -3.18225e-05 -2.48268e-05
- -1.16701e-05 -6.05117e-06 7.61116e-06 -0.0163668 -0.0158244
- -0.0141177 0.0100085 0.0857144 0.107784 0.051862 0.0204448
- 0.00629858 0.000967736 0.00121674 0.00190276 0.00154009
- 0.000860922 0.000410386 0.000164585 3.99493e-05 1.93797e-05
- 5.67594e-05 0.000110126 2.49925e-05 -7.17815e-05 -0.000142299
- -1.63109e-05 0.000439529 0.000562489 0.000594599 0.000326164
- 0.000126423 -4.26063e-05 -0.000122927 -0.000114152 -6.72706e-05
- -6.41242e-05 -0.000135588 2.61507e-05 0.000134036 6.43734e-06
- -4.6223e-05 -0.000112047 -0.000101388 -8.67847e-05 -0.000117664
- -0.000133957 -0.000116558 -0.000100873 -7.65448e-05 -4.44964e-05
- -3.6677e-05 -5.26632e-05 -5.45172e-05 -5.13545e-05 -3.73869e-05
- -1.99732e-05 -1.0907e-05 -1.10081e-05 -3.02609e-05 -5.18517e-05
- -6.13597e-05 -5.30706e-05 -2.39572e-05 -3.24146e-05 -5.70062e-05
- -0.000103448 -0.000135376 -0.0001024 -2.39007e-05 0.000110929
- 0.000151226 0.000142044 0.000105922 5.62834e-05 4.78476e-05
- 3.94117e-05 3.09759e-05 2.25401e-05 1.41042e-05 5.66837e-06
- -2.76747e-06 -3.08639e-06 -2.81341e-06 -2.54043e-06 -2.26745e-06
- -1.99447e-06 -1.72149e-06 -1.44851e-06 -1.26226e-06 -1.12096e-06
- -9.79661e-07 -8.38363e-07 -6.97065e-07 -5.55768e-07 -4.1447e-07
- -2.73173e-07 -1.31875e-07 9.42259e-09 1.5072e-07 2.92018e-07
- 4.33315e-07 5.74613e-07 7.10363e-07 8.01984e-07 8.93604e-07
- 9.85225e-07 1.07685e-06 0.04474 0.0928765 0.141327 0.0176048
- -0.071675 -0.0124613 0.989022 2.28104 3.40619 4.21417 4.67173
- 4.87438 4.96044 4.98996 4.99858 4.96672 4.89502 4.79391
- 4.76433 4.8387 4.98612 5.0161 5.01722 5.01437 5.01256 4.99827
- 4.95807 4.9209 4.88217 4.83006 4.78461 4.80759 4.85548 4.89604
- 4.9254 4.94617 4.96126 4.97374 4.98255 4.98792 4.99126 4.99361
- 4.99554 4.99699 4.99792 4.99846 4.99881 4.99905 4.99924
- 4.99938 4.99949 4.99955 4.9997 4.9998 4.99982 4.99982 4.99982
- 4.99982 4.99982 4.99983 4.99984 4.99985 4.99986 4.99987
- 4.99988 4.99989 4.9999 4.99992 4.99993 4.99994 4.99995 4.99995
- 4.99996 4.99996 4.99998 4.99999 5.00001 5.00002 5.00002
- 5.00001 5.00001 5 4.99999 4.99999 4.99998 4.99998 4.99998
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
-
-}
-v16 set {
- 1.86175 1.73073 1.50572 1.89001 3.39004 4.36034 4.79012
- 4.93798 4.98305 4.99539 4.9979 4.99904 4.99772 4.9983 4.99935
- 4.99975 4.98837 4.99456 4.99728 5.01838 5.04568 5.00759
- 4.98112 4.98479 4.99197 4.99641 4.99747 4.99775 5.00043
- 5.0007 5.00035 5.00023 4.99976 5.00002 5.00007 5.0002 4.99993
- 5.00003 5.00021 5.00006 4.99993 4.99992 5.00002 5.00013
- 5.00017 5.00009 4.99992 4.99991 4.99993 4.99996 4.99998
- 4.99999 5.00001 5.00003 5.00005 5.00004 5.00004 5.00003
- 5.00002 5.00001 5 4.99999 4.99999 4.99998 4.99998 4.99997
- 4.99997 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999
- 4.99999 4.99999 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00002 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 5 5.01498 4.99342 4.96899 5.00301 5.02627 4.9977
- 4.99548 4.99757 5.00277 5.00245 5.0014 5.00069 5.00032 5.00014
- 5.00009 4.9867 4.99262 4.99607 5.01805 5.04713 5.00927 4.98184
- 4.98483 4.9914 4.99616 4.99902 4.9999 4.99987 4.99979 4.99981
- 4.99989 4.99994 4.99998 5.0002 5.00001 5.00008 5.00008 5.0001
- 5.00021 5.00032 5.00025 5.00019 5.00006 5.00007 4.99994
- 4.99997 4.99999 5.00023 5.00008 4.99993 4.99998 4.99986
- 4.99982 5.00003 4.99985 4.99996 5.00014 5 4.99984 4.99979
- 4.99982 4.99993 5.00008 5.00011 5.00002 4.99996 4.9999 4.99994
- 5.00001 5.00007 5.00009 4.99995 4.99978 4.99971 4.99976
- 4.99997 4.99996 4.99989 4.99972 4.99955 4.99953 4.99959
- 4.99976 4.9999 5.00005 5.00023 5.00039 5.00034 5.00029 5.00024
- 5.00019 5.00014 5.00009 5.00004 5.00003 5.00002 5.00001
- 5 5 4.99999 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5
- 5.00001 5.00002 5.00003 5.00004 5.01564 5.03395 5.04932
- 5.11868 3.92502 1.31888 0.163888 0.0946876 0.0789578 0.0565084
- 0.0260333 0.0156986 0.00907667 0.00613629 0.00468417 -0.00174008
- -0.0021422 0.000586962 0.0124937 0.0147977 0.00838454 0.00039383
- -0.000522021 -0.000426598 -0.000290214 -0.00173713 -0.00384132
- -0.00382945 -0.00429219 -0.00580193 -0.00393246 0.0017543
- 0.00423045 0.00408931 0.0031976 0.00245457 0.00187293 0.00159068
- 0.00105697 0.000609902 0.000358825 0.000334125 0.000212708
- 0.000168116 8.97349e-05 5.21578e-05 3.84527e-05 2.93033e-05
- 2.10067e-05 1.59954e-05 1.13917e-05 5.49738e-06 2.77217e-05
- 6.51259e-06 -6.65468e-06 2.09837e-06 -6.617e-06 -4.80187e-06
- 1.55031e-06 4.26536e-06 7.69457e-07 -1.46213e-06 -7.25202e-07
- 3.26501e-06 6.55807e-06 7.524e-06 6.07209e-06 6.00701e-06
- 5.41166e-06 3.86573e-06 1.10651e-06 -2.74603e-06 -2.18566e-06
- 2.3658e-06 8.59956e-06 8.35046e-06 2.90621e-06 -8.75982e-07
- -1.87189e-06 -2.1528e-06 -1.94875e-06 -1.74471e-06 -1.54067e-06
- -1.33662e-06 -1.13258e-06 -8.40567e-07 -5.20743e-07 -2.00918e-07
- 1.18906e-07 4.38731e-07 6.11382e-07 6.01529e-07 5.91675e-07
- 5.81822e-07 5.71968e-07 5.62115e-07 5.52261e-07 5.42407e-07
- 5.32554e-07 5.227e-07 5.12847e-07 4.72812e-07 4.26137e-07
- 3.79462e-07 3.32786e-07 2.86111e-07 2.39436e-07 1.92761e-07
- 1.46086e-07 9.94107e-08 5.27356e-08 -2.77779e-10 -7.98079e-08
- -1.59338e-07 -2.38868e-07 -3.18398e-07 -3.97928e-07 -4.77458e-07
- -5.56988e-07 -6.36519e-07
-}
-v17 set {
- 5 5.16963 4.84136 3.33754 0.316206 0.103113 0.0273341 0.0221102
- 0.0177008 0.0143758 0.0115203 0.00929231 0.00752716 0.00625439
- 0.00489872 0.00403656 -0.0657317 -0.0256467 0.165394 0.985963
- 3.05067 4.55799 4.89728 4.92464 4.8882 4.90592 4.97315 4.99241
- 4.99694 4.99845 4.99905 4.99939 4.99959 4.99971 4.9998 4.99986
- 4.9999 4.99993 4.99995 4.99996 4.99997 4.99998 4.99998 4.99999
- 4.99999 4.99999 4.99999 4.99999 5 5.00001 5.00003 5.00005
- 5.00004 5.00002 5 4.99999 4.99999 4.99998 4.99998 4.99997
- 4.99997 4.99998 4.99998 4.99999 4.99999 5 5 5 5 5 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5
- 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998
- 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 5 5 5 5 5 5 5.00025 5.1657 4.69981 2.43895
- 0.0229743 0.0351406 -0.0211974 -0.0312063 -0.0160331 -0.0021718
- -0.000766597 -0.000251052 -5.49363e-05 -3.36364e-06 -2.01983e-06
- -9.70575e-06 -0.0657007 -0.0205247 0.183332 1.07163 3.11839
- 4.46213 4.84163 4.95195 4.99159 5.02084 5.04029 5.04138
- 5.0271 5.00445 4.97957 4.95702 4.95231 4.97819 4.99191 4.9963
- 4.99822 4.99878 4.99903 4.99925 4.99942 4.9995 4.99954 4.99957
- 4.99961 4.99966 4.9997 4.99974 4.99977 4.99981 4.99983 4.99986
- 4.99988 4.9999 4.99991 4.99992 4.99994 4.99995 4.99995 4.99996
- 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00001 5.00001 5.00001
- 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5 5 5 4.99999 4.99998 4.99997 4.99996 5.14239 4.76219
- 3.16574 0.299969 0.0631609 -0.00118611 -0.00026052 -5.96333e-05
- -1.44904e-05 -4.3859e-06 -2.99454e-06 1.10547e-06 4.84662e-06
- 1.30971e-05 2.23082e-05 -0.0655844 -0.0204818 0.182507 1.05954
- 3.12277 4.46735 4.83915 4.94512 4.97679 4.98654 4.9966 5.00833
- 5.00776 5.00432 5.00199 5.00086 5.00033 5.00008 5 5.00001
- 5 5.00005 5.00002 4.99981 4.99991 4.99998 4.99979 4.99979
- 4.99984 4.9998 4.9998 5.00006 5.00002 5.00001 5 5 4.99992
- 4.99998 4.99999 5.00002 5.00014 4.99999 4.99987 4.99993
- 5.00003 5.00011 5.00005 4.99996 4.99987 4.99985 4.99994
- 5.00009 5.0001 5 4.99993 4.99997 5.00008 5.00015 5.00021
- 5.00021 5.00007 4.99978 4.99965 4.99973 4.9999 4.99992 4.99995
- 4.99997 4.99999 5.00001 5.00002 5.00001 5.00001 5.00001
- 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001 5.00001 5.00002
- 5.00002 5.00002
-}
-v18 set {
- 5 5.0333 5.02472 4.92559 4.18383 3.93923 3.9961 4.14293
- 4.28591 4.41336 4.52157 4.61101 4.68472 4.7439 4.79294 4.83239
- 4.80697 4.78808 4.79322 4.8838 5.08529 5.21863 4.88852 3.90198
- 2.14586 0.383977 0.101103 0.0525711 0.0318287 0.020895 0.0146908
- 0.010831 0.00830272 0.00656377 0.00532066 0.00440078 0.00369956
- 0.00315713 0.00272614 0.00237965 0.00209659 0.00186339 0.00167014
- 0.0015081 0.00137172 0.00125607 0.00115393 0.00106076 0.000980166
- 0.000918015 0.000862837 0.00080766 0.000763488 0.000721541
- 0.000680825 0.000653026 0.000625226 0.000597426 0.000569627
- 0.000541827 0.000519087 0.000499756 0.000480424 0.000461093
- 0.000441761 0.000423291 0.000411941 0.00040059 0.00038924
- 0.000377889 0.000366539 0.000355188 0.000343838 0.000332487
- 0.000321137 0.000309786 0.000299055 0.000292509 0.000285963
- 0.000279417 0.000272871 0.000266325 0.000259779 0.000253233
- 0.000246686 0.00024014 0.000233594 0.000227387 0.0002231
- 0.000218813 0.000214526 0.00021024 0.000205953 0.000201666
- 0.000197379 0.000193092 0.000188805 0.000184519 0.000180526
- 0.000177963 0.0001754 0.000172837 0.000170274 0.000167711
- 0.000165148 0.000162585 0.000160022 0.000157459 0.000154895
- 0.000152332 0.000149769 0.000147206 0.000144643 0.00014208
- 0.000139517 0.000136954 0.000134391 0.000131828 0.000129265
- 0.000126702 0.000132838 0.0311184 0.163151 0.34986 0.604501
- 0.357125 0.136137 0.0711304 0.0346959 0.0212674 0.00872193
- 0.00252206 0.000455269 7.59332e-05 2.91532e-05 0.000320562
- -0.0720911 -0.0840491 -0.0791345 -0.0404143 0.0182035 -0.0235871
- -0.0426072 -0.0597501 0.00824773 0.481404 1.32496 2.11949
- 2.57317 2.58202 2.15054 1.33786 0.45702 0.153772 0.0913584
- 0.0604989 0.0421591 0.0271456 0.0170021 0.0115815 0.00907886
- 0.00742466 0.00626096 0.00531127 0.00450501 0.00381927 0.00323718
- 0.00274374 0.00232494 0.00196885 0.00166686 0.00141134 0.00119437
- 0.0010109 0.000855534 0.000723378 0.000611408 0.000516704
- 0.000436769 0.000369523 0.000313026 0.00026526 0.000223976
- 0.000188972 0.000159042 0.000134148 0.000112688 9.49738e-05
- 7.97877e-05 6.721e-05 5.65115e-05 4.77194e-05 4.03591e-05
- 3.42848e-05 2.92627e-05 2.50435e-05 2.1412e-05 1.84532e-05
- 1.58624e-05 1.34673e-05 1.14461e-05 1.00935e-05 9.12375e-06
- 8.50202e-06 7.81431e-06 7.20729e-06 6.73936e-06 6.3702e-06
- 5.90049e-06 5.43077e-06 4.96105e-06 4.49133e-06 4.02162e-06
- 3.5519e-06 3.08218e-06 2.79099e-06 2.51281e-06 2.23463e-06
- 1.95645e-06 1.67827e-06 1.40009e-06 1.12191e-06 1.01376e-06
- 9.9375e-07 9.73741e-07 9.53733e-07 9.33724e-07 9.13715e-07
- 8.93707e-07 8.73698e-07 8.5369e-07 8.33681e-07 8.13673e-07
- 7.93664e-07 7.73655e-07 7.53647e-07 7.21781e-07 5.956e-07
- 4.69419e-07 3.43239e-07 2.17058e-07 0.0284032 0.0374438
- -0.0157543 -0.0680497 0.0504768 0.0100294 0.00222261 0.000528697
- 0.000132929 3.99489e-05 2.46066e-05 4.56327e-06 -6.54853e-06
- 1.33783e-05 -3.68221e-05 -0.0724498 -0.0843663 -0.0792935
- -0.0406426 0.0200019 0.0426259 0.0220753 0.00668555 -0.000968483
- 0.024662 0.0383437 0.0911513 0.087848 0.0602076 0.0390559
- 0.0260573 0.0180444 0.012974 0.00985409 0.00788132 0.0064228
- 0.005545 0.00453571 0.00364245 0.00310278 0.00270523 0.00236439
- 0.0020945 0.00186808 0.00167493 0.00151731 0.00138594 0.00126945
- 0.00116695 0.0010762 0.000996366 0.000928387 0.000864414
- 0.000808258 0.000759574 0.000713865 0.000666712 0.000632716
- 0.000601262 0.000572163 0.000543986 0.000515253 0.0004897
- 0.000468112 0.000449313 0.000432981 0.000417911 0.000401307
- 0.000382712 0.000366678 0.000355736 0.000349171 0.000335727
- 0.000317091 0.000296086 0.000283543 0.000277366 0.000272233
- 0.000267001 0.000263147 0.000256699 0.000250251 0.000243803
- 0.000237355 0.000230907 0.000225424 0.000220247 0.000215069
- 0.000209892 0.000204714 0.000200213 0.000196548 0.000192884
- 0.00018922 0.000185556 0.000181892 0.000178228 0.000174564
- 0.0001709 0.000167236 0.000163572 0.000160824 0.000158279
- 0.000155733 0.000153187 0.000150641 0.000148095 0.000145549
- 0.000143003 0.000140457 0.000137911 0.000135457 0.000133386
- 0.000131315 0.000129245 0.000127174 0.000125103 0.000123032
- 0.000120961 0.000118891
-}
-v19 set {
- 1.86175 1.99994 2.0833 2.01627 2.42503 3.25769 3.62134 3.88827
- 4.09688 4.26773 4.40529 4.51734 4.60827 4.68313 4.74346
- 4.79302 4.72815 4.68959 4.70421 4.81316 5.01375 5.14493
- 5.10305 5.0699 5.04484 5.03751 5.03348 5.02504 5.01799 5.01271
- 5.00895 5.00628 5.0044 5.00309 5.00216 5.00151 5.00105 5.00073
- 5.00051 5.00034 5.00023 5.00015 5.0001 5.00007 5.00003 4.99998
- 4.99993 4.99993 4.99995 4.99999 5.00001 5.00003 5.00002
- 5.00001 5 5 5 5 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00017 5.17398
- 4.94779 3.78508 1.52302 0.608808 0.244311 0.126053 0.0597175
- 0.038422 0.0158174 0.00481338 0.00107847 0.000301256 0.000114861
- 0.00059489 -0.118904 -0.147478 -0.158986 -0.080544 0.165361
- 0.171378 0.0776087 0.0435738 0.0428235 0.0423755 0.0347695
- 0.0225061 0.0155539 0.0121357 0.0107997 0.0103976 0.0124406
- 0.016814 0.0167556 0.0149852 0.01459 0.0141182 0.0131934
- 0.0120286 0.0108692 0.0097184 0.00855881 0.00744912 0.00643877
- 0.00554044 0.00475165 0.00406535 0.00347158 0.00295981 0.00251995
- 0.00214318 0.00182101 0.00154613 0.00131196 0.0011119 0.000941587
- 0.000796999 0.000674582 0.000571283 0.000484276 0.000410649
- 0.000347005 0.000292984 0.000246715 0.000208143 0.00017489
- 0.000147412 0.000123854 0.000104332 8.77229e-05 7.40686e-05
- 6.2637e-05 5.32e-05 4.53946e-05 3.88343e-05 3.31864e-05
- 2.85905e-05 2.45725e-05 2.08671e-05 1.77301e-05 1.55911e-05
- 1.40153e-05 1.29421e-05 1.18693e-05 1.09815e-05 1.03484e-05
- 9.87664e-06 9.14446e-06 8.41228e-06 7.68011e-06 6.94793e-06
- 6.21575e-06 5.48357e-06 4.7514e-06 4.38454e-06 4.04432e-06
- 3.7041e-06 3.36388e-06 3.02366e-06 2.68344e-06 2.34322e-06
- 2.15196e-06 2.03791e-06 1.92386e-06 1.80982e-06 1.69577e-06
- 1.58173e-06 1.46768e-06 1.35363e-06 1.23959e-06 1.12554e-06
- 1.0115e-06 8.9745e-07 7.83404e-07 6.69358e-07 4.76113e-07
- -3.47071e-07 -1.17025e-06 -1.99344e-06 -2.81662e-06 0.0783754
- 0.0500262 -0.0659563 -0.120914 0.0815957 0.0154255 0.00347177
- 0.000840357 0.000214582 6.54655e-05 3.91709e-05 8.07396e-06
- -4.44265e-07 1.74384e-05 -4.52725e-05 -0.119379 -0.147984
- -0.159247 -0.0824604 0.169014 0.177628 0.0758742 0.010558
- -0.0346506 -0.0710288 -0.0838952 -0.0599521 -0.034568 -0.0181615
- -0.00968034 -0.00547115 -0.00333511 -0.00232468 -0.00181159
- -0.00143841 -0.00116601 -0.000839755 -0.000569764 -0.000578683
- -0.000490551 -0.000411712 -0.000437859 -0.000408185 -0.000356644
- -0.000311332 -0.000269006 -0.000221396 -0.000210054 -0.0001923
- -0.000175122 -0.000161039 -0.0001428 -0.000126123 -0.000127893
- -8.14516e-05 -0.000120166 -0.000154909 -0.000112733 -8.40377e-05
- -7.11342e-05 -8.09538e-05 -9.77789e-05 -9.82402e-05 -7.73531e-05
- -5.28255e-05 -3.1096e-05 -1.87967e-05 -1.96552e-05 -4.16655e-05
- -5.77185e-05 -5.24142e-05 -2.83153e-05 -1.90012e-05 -1.54415e-05
- -2.52569e-05 -6.23747e-05 -0.000130543 -0.000149394 -0.000110886
- -4.35517e-05 -4.17084e-05 -3.98651e-05 -3.80218e-05 -3.61785e-05
- -3.43352e-05 -3.36249e-05 -3.32729e-05 -3.29208e-05 -3.25687e-05
- -3.22166e-05 -3.17143e-05 -3.10258e-05 -3.03372e-05 -2.96486e-05
- -2.89601e-05 -2.82715e-05 -2.75829e-05 -2.68944e-05 -2.62058e-05
- -2.55173e-05 -2.48287e-05 -2.43043e-05 -2.38159e-05 -2.33276e-05
- -2.28393e-05 -2.2351e-05 -2.18626e-05 -2.13743e-05 -2.0886e-05
- -2.03977e-05 -1.99093e-05 -1.945e-05 -1.91122e-05 -1.87744e-05
- -1.84366e-05 -1.80987e-05 -1.77609e-05 -1.74231e-05 -1.70853e-05
- -1.67474e-05
-}
-v20 set {
- 1.86175 1.99724 2.17266 2.48439 3.15933 3.85231 4.38091
- 4.69033 4.85034 4.92851 4.96453 4.98188 4.98736 4.991 4.99482
- 4.9973 4.96422 4.89989 4.83907 4.83151 4.90868 5.04854 5.06104
- 5.04571 5.03219 5.03025 5.02273 5.01707 5.0123 5.0087 5.00611
- 5.00429 5.00301 5.00211 5.00148 5.00103 5.00072 5.0005 5.00035
- 5.00024 5.00016 5.00011 5.00007 5.00005 5.00003 5.00001
- 4.99999 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999
- 5 5 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5
- 5 5 4.99981 5.10081 5.10903 4.98404 5.00999 5.14946 4.36501
- 2.23938 0.325144 0.00660272 -0.0102186 -0.0082401 -0.00556785
- -0.00374178 -0.00264763 -0.00202823 -0.0182241 -0.0169551
- -0.0150395 0.0103736 0.0877592 0.104382 0.0515938 0.0373818
- 0.0411547 0.0397009 0.0308946 0.0205793 0.0154037 0.0129191
- 0.0119327 0.011527 0.0124295 0.0161152 0.0161076 0.0145391
- 0.0144541 0.0139287 0.0129215 0.0117239 0.0105795 0.00942983
- 0.00827423 0.00718354 0.00619954 0.00532868 0.00456631 0.00390448
- 0.00333254 0.00284003 0.00241714 0.00205524 0.0017458 0.00148202
- 0.00125739 0.0010655 0.000902213 0.000763611 0.000646279
- 0.000547291 0.000463934 0.000393401 0.000332424 0.000280655
- 0.000236328 0.000199386 0.000167536 0.000141218 0.000118654
- 9.99559e-05 8.40479e-05 7.09694e-05 6.00188e-05 5.09786e-05
- 4.3502e-05 3.72191e-05 3.18114e-05 2.74071e-05 2.35539e-05
- 1.99967e-05 1.69871e-05 1.49449e-05 1.3451e-05 1.24492e-05
- 1.14256e-05 1.05669e-05 9.94487e-06 9.47514e-06 8.77318e-06
- 8.07123e-06 7.36927e-06 6.66731e-06 5.96536e-06 5.2634e-06
- 4.56144e-06 4.23044e-06 3.92649e-06 3.62254e-06 3.31858e-06
- 3.01463e-06 2.71068e-06 2.40673e-06 2.23063e-06 2.12082e-06
- 2.01102e-06 1.90121e-06 1.7914e-06 1.68159e-06 1.57178e-06
- 1.46197e-06 1.35216e-06 1.24235e-06 1.13255e-06 1.02274e-06
- 9.12929e-07 8.0312e-07 6.33171e-07 -1.51288e-08 -6.63428e-07
- -1.31173e-06 -1.96003e-06 0.0437517 0.0265689 -0.0515377
- -0.0658688 0.010727 -0.000511921 -8.36924e-05 2.13278e-05
- 1.45207e-05 4.54862e-06 -6.14726e-06 2.0062e-06 1.02709e-06
- 1.4152e-05 -3.08225e-05 -0.0166501 -0.0157139 -0.013957
- 0.0107537 0.0873717 0.111302 0.0454129 -0.00530142 -0.0468336
- -0.0790063 -0.0826944 -0.0534753 -0.0288705 -0.0149009 -0.00801592
- -0.0046342 -0.00291835 -0.00213019 -0.00170055 -0.001352
- -0.00110593 -0.000742655 -0.000532042 -0.000544742 -0.000479206
- -0.000407307 -0.000403575 -0.000366209 -0.000324161 -0.000286183
- -0.000247579 -0.000214281 -0.000203435 -0.000186896 -0.000171033
- -0.00015779 -0.000145259 -0.000128069 -0.000122647 -9.89398e-05
- -0.000114926 -0.000132195 -0.000107872 -8.91015e-05 -7.87996e-05
- -8.14061e-05 -8.9098e-05 -8.83368e-05 -7.6122e-05 -6.14668e-05
- -4.75402e-05 -3.81855e-05 -3.69696e-05 -4.78656e-05 -5.61346e-05
- -5.35007e-05 -4.1459e-05 -3.35411e-05 -2.52374e-05 -2.37479e-05
- -4.6406e-05 -9.41884e-05 -0.000109222 -8.52676e-05 -4.25166e-05
- -4.10125e-05 -3.95085e-05 -3.80045e-05 -3.65004e-05 -3.49964e-05
- -3.41627e-05 -3.3541e-05 -3.29193e-05 -3.22976e-05 -3.16758e-05
- -3.10334e-05 -3.03653e-05 -2.96971e-05 -2.9029e-05 -2.83609e-05
- -2.76928e-05 -2.70246e-05 -2.63565e-05 -2.56884e-05 -2.50203e-05
- -2.43521e-05 -2.38716e-05 -2.34324e-05 -2.29932e-05 -2.25539e-05
- -2.21147e-05 -2.16755e-05 -2.12362e-05 -2.0797e-05 -2.03578e-05
- -1.99186e-05 -1.95079e-05 -1.9217e-05 -1.8926e-05 -1.8635e-05
- -1.8344e-05 -1.8053e-05 -1.7762e-05 -1.74711e-05 -1.71801e-05
-
-}
-v21 set {
- 1.86175 1.73273 1.42016 1.02483 0.944013 0.274107 0.0823742
- 0.0379366 0.020816 0.0132952 0.00955525 0.00717008 0.00592286
- 0.00437379 0.00383557 0.00273694 -0.0037467 -0.0054191 -0.00131454
- 0.0112179 0.0133918 0.00519747 -0.00260113 -0.00252847 -0.00181292
- 0.000183398 -0.000667607 -0.000750747 -0.000594314 -0.000433904
- -0.000308985 -0.000217858 -0.000152926 -0.000107454 -7.54076e-05
- -5.2675e-05 -3.66299e-05 -2.54341e-05 -1.75095e-05 -1.18848e-05
- -7.97289e-06 -5.30239e-06 -3.53615e-06 -2.38504e-06 -2.40158e-06
- -3.84485e-06 -5.29435e-06 -2.57099e-06 1.95189e-06 3.55083e-06
- 2.06179e-06 5.72753e-07 3.30469e-07 3.40296e-07 3.60221e-07
- 4.86081e-07 6.1194e-07 7.37799e-07 8.63659e-07 9.89518e-07
- 9.21274e-07 7.22275e-07 5.23276e-07 3.24277e-07 1.25278e-07
- -5.59467e-08 -9.03265e-08 -1.24706e-07 -1.59086e-07 -1.93466e-07
- -2.27846e-07 -2.62226e-07 -2.96605e-07 -3.30985e-07 -3.65365e-07
- -3.99745e-07 -4.24266e-07 -3.82163e-07 -3.40061e-07 -2.97959e-07
- -2.55857e-07 -2.13755e-07 -1.71652e-07 -1.2955e-07 -8.7448e-08
- -4.53457e-08 -3.24353e-09 3.76901e-08 7.19937e-08 1.06297e-07
- 1.40601e-07 1.74904e-07 2.09208e-07 2.43512e-07 2.77815e-07
- 3.12119e-07 3.46422e-07 3.80726e-07 4.04507e-07 3.77191e-07
- 3.49876e-07 3.22561e-07 2.95246e-07 2.67931e-07 2.40616e-07
- 2.13301e-07 1.85986e-07 1.58671e-07 1.31356e-07 1.04041e-07
- 7.67256e-08 4.94105e-08 2.20955e-08 -5.21962e-09 -3.25347e-08
- -5.98498e-08 -8.71649e-08 -1.1448e-07 -1.41795e-07 -1.6911e-07
- 7.87893e-06 0.0114592 -0.0245712 -0.111637 0.0961324 1.61168
- 3.22343 4.20442 4.53535 4.83834 4.95464 4.98874 4.99746
- 4.99883 4.99948 4.99815 4.98431 4.99298 4.99718 5.01948
- 5.04749 5.008 4.98243 4.98985 4.99781 4.99887 4.99679 4.99616
- 4.99743 4.99859 4.99936 4.99972 5.00058 5.00123 5.0002 4.99945
- 4.99983 4.9998 4.99966 4.99958 4.99956 4.99956 4.99956 4.99958
- 4.99961 4.99965 4.99969 4.99973 4.99977 4.9998 4.99983 4.99985
- 4.99987 4.99989 4.99991 4.99992 4.99993 4.99994 4.99995
- 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00001 5.00001
- 5.00001 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5 5 5 4.99999 4.99998 4.99997 4.99996 5.01454
- 4.99566 4.96796 4.99819 5.03232 5.00034 4.99867 4.99937
- 4.99977 4.99992 4.99997 4.99999 5.00001 5.00021 4.99974
- 4.98462 4.99301 4.99723 5.01936 5.04807 5.00929 4.9789 4.97876
- 4.98244 4.9863 4.99575 5.0069 5.00863 5.00624 5.00357 5.0019
- 5.00098 5.00048 5.00025 5.00016 5.00011 5.00013 5.00009
- 4.99982 4.99994 5.00005 4.99994 4.99988 4.99989 4.99997
- 5.00003 5.00005 5.00002 5.00001 5.00001 5.00001 4.99993
- 4.99999 5 5.00021 4.99997 4.99981 5 5.00009 5.0001 5.00001
- 4.99991 4.9999 5 5.00011 5.00017 5.00018 5.00018 5.00014
- 5.00007 4.99999 4.9999 4.9999 5.00001 5.00016 5.00014 4.99999
- 4.99993 4.99999 5.00009 5.00007 5.00006 5.00004 5.00003
- 5.00001 5.00001 5 4.99999 4.99998 4.99997 4.99997 4.99997
- 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999
- 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002
- 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5 5
-}
-v22 set {
- 7.10441e-10 0.00107105 0.000637109 -0.00236346 -0.018079
- -0.0120077 -0.00217059 0.00266679 0.00403383 0.00403836
- 0.00356705 0.00303303 0.00244716 0.00198586 0.0016855 0.00136497
- -3.96022e-05 -0.000367409 -3.77079e-05 0.00194085 0.00506964
- -0.0400214 -0.0402572 0.0524434 0.286234 0.803011 1.44795
- 2.02473 2.54768 3.02748 3.4415 3.78287 4.09667 4.35152 4.53987
- 4.67614 4.77407 4.84319 4.89227 4.92702 4.95119 4.96764
- 4.97846 4.98557 4.98982 4.99209 4.99371 4.99569 4.99727
- 4.99802 4.99834 4.99867 4.99892 4.99915 4.99936 4.99939
- 4.99943 4.99946 4.9995 4.99953 4.99957 4.9996 4.99963 4.99967
- 4.9997 4.99973 4.99974 4.99975 4.99976 4.99977 4.99978 4.9998
- 4.99981 4.99982 4.99983 4.99984 4.99985 4.99986 4.99986
- 4.99986 4.99987 4.99987 4.99988 4.99988 4.99989 4.99989
- 4.9999 4.9999 4.9999 4.9999 4.99991 4.99991 4.99991 4.99991
- 4.99992 4.99992 4.99992 4.99992 4.99993 4.99993 4.99993
- 4.99993 4.99993 4.99993 4.99993 4.99993 4.99994 4.99994
- 4.99994 4.99994 4.99994 4.99994 4.99994 4.99994 4.99995
- 4.99995 4.99995 4.99995 4.99995 4.99995 4.99995 5.00145
- 5.00659 5.01209 5.01931 5.00279 4.99273 4.99217 4.99295
- 4.99471 4.99594 4.99696 4.9978 4.99844 4.99891 4.99924 4.99635
- 4.99699 4.99813 5.00068 5.00307 5.0588 4.96365 4.54012 3.6307
- 2.35176 1.0322 0.354379 0.115986 0.0435668 0.0245112 0.020786
- 0.0164656 0.0118409 0.00849698 0.00597078 0.0040105 0.0026076
- 0.0016597 0.00118185 0.00121067 0.00153587 0.00174836 0.00136519
- -0.000189116 -0.00315555 -0.00646603 -0.00898042 -0.010203
- -0.0110896 -0.0123764 -0.00953841 -0.00225795 0.000818314
- 0.00152252 0.00150269 0.00119025 0.000767068 0.000308852
- -3.79272e-05 -0.00019691 -0.000186642 -9.73653e-05 -8.49784e-06
- 2.04147e-05 -9.91086e-06 -1.55959e-05 -1.80499e-05 -1.77097e-05
- -1.51548e-05 -1.1978e-05 -9.84916e-06 -1.29728e-05 -1.67235e-05
- -1.74153e-05 -1.39958e-05 -5.92272e-06 -8.08216e-06 -1.53077e-05
- -2.92531e-05 -3.91049e-05 -2.98935e-05 -7.32122e-06 3.18534e-05
- 4.39134e-05 4.18753e-05 3.22759e-05 1.86766e-05 1.58432e-05
- 1.30098e-05 1.01765e-05 7.34312e-06 4.50975e-06 1.67639e-06
- -1.15697e-06 -1.23877e-06 -1.11991e-06 -1.00106e-06 -8.82208e-07
- -7.63355e-07 -6.44502e-07 -5.2565e-07 -4.29318e-07 -3.44661e-07
- -2.60004e-07 -1.75347e-07 -9.06904e-08 -6.03349e-09 7.86234e-08
- 1.6328e-07 2.47937e-07 3.32594e-07 4.17251e-07 5.01908e-07
- 5.86565e-07 6.71222e-07 7.36123e-07 6.43886e-07 5.5165e-07
- 4.59414e-07 3.67178e-07 0.000334759 -4.60833e-05 -0.00106139
- -0.00166624 0.000859563 0.00102606 0.00410037 0.00419931
- 0.00518997 0.00459791 0.00503125 0.00523877 0.00452158 0.00339924
- 0.00233399 0.000876915 0.000546439 0.000444299 0.000983968
- 0.00119304 -0.0429422 -0.0403983 0.0534896 0.288013 0.807345
- 1.44247 2.03448 2.57021 3.05049 3.47332 3.8131 4.1009 4.34677
- 4.53512 4.67127 4.76531 4.82526 4.86593 4.89586 4.91904
- 4.93806 4.95348 4.96597 4.97629 4.9843 4.98983 4.99335 4.9957
- 4.99741 4.99864 4.99946 4.99994 5.00047 5.00073 5.00086
- 5.00092 5.00094 5.00091 5.00087 5.00081 5.00074 5.00067
- 5.00059 5.00052 5.00046 5.0004 5.00034 5.0003 5.00026 5.00022
- 5.00019 5.00016 5.00014 5.00012 5.0001 5.00009 5.00007 5.00006
- 5.00006 5.00005 5.00004 5.00004 5.00004 5.00003 5.00003
- 5.00003 5.00002 5.00002 5.00002 5.00002 5.00001 5.00001
- 5.00001 5.00001 5.00001 5 5 5 5 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5.00001 5.00001
- 5.00001 5.00001 5.00002 5.00002
-}
-v23 set {
- 5 5.00284 5.01266 5.01895 4.98936 4.99575 4.99217 4.99545
- 4.99775 4.99894 4.99946 4.99968 4.99975 4.99977 4.99986
- 4.9999 4.99528 4.99808 5.00039 5.00392 5.00512 4.99985 4.99863
- 4.99942 4.99992 5.00017 4.99897 4.99803 4.99784 4.99739
- 4.99883 5.00365 5.00298 5.00133 5.00048 5.00019 5.00008
- 5.00005 5.00004 5.00003 5.00002 5.00002 5.00001 5.00001
- 5.00001 5.00001 5.00001 5 5 4.99999 4.99997 4.99995 4.99996
- 4.99998 5 5.00001 5.00001 5.00002 5.00002 5.00003 5.00003
- 5.00002 5.00002 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99998 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002
- 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5 5 5 5 5 5 5 5.00217 5.00108 4.99547 4.99658 5.00667
- 4.99641 4.99532 4.99938 5.00328 5.00222 5.00114 5.00052
- 5.00024 5.00011 5.00009 4.99285 4.99591 4.99897 5.00403
- 5.00786 5.00318 4.99942 4.9992 4.99949 5.001 5.00408 5.00319
- 5.00063 4.99995 5.00014 4.99982 4.99832 4.99838 4.99865
- 4.99912 4.99836 4.99735 4.99606 4.99814 5.00958 5.02973
- 5.05293 5.06103 4.99342 4.80726 4.50744 4.07509 3.41358
- 2.37924 1.03194 0.261552 0.142392 0.0904482 0.0555071 0.0322869
- 0.018289 0.0113802 0.00875182 0.00757055 0.00629906 0.00523
- 0.00403349 0.0031953 0.00280864 0.00286119 0.00250389 0.00202815
- 0.001723 0.00147312 0.0012411 0.00104401 0.000886204 0.000758277
- 0.000651915 0.00056348 0.000487966 0.000424048 0.000365613
- 0.000308178 0.000258725 0.000228061 0.000207976 0.000198491
- 0.00018518 0.000172716 0.000163197 0.000155007 0.000141734
- 0.000128461 0.000115188 0.000101915 8.86417e-05 7.53686e-05
- 6.20956e-05 5.69164e-05 5.23275e-05 4.77385e-05 4.31495e-05
- 3.85605e-05 3.39716e-05 2.93826e-05 2.69449e-05 2.56224e-05
- 2.42999e-05 2.29774e-05 2.16549e-05 2.03324e-05 1.90099e-05
- 1.76873e-05 1.63648e-05 1.50423e-05 1.37198e-05 1.23973e-05
- 1.10748e-05 9.75232e-06 8.48447e-06 7.65129e-06 6.81811e-06
- 5.98494e-06 5.15176e-06 0.00056893 -0.00787906 -0.0217381
- -0.0370066 -0.00770505 0.00659312 0.00975477 0.00949456
- 0.00777552 0.00655645 0.00568776 0.00508782 0.00458121 0.00410187
- 0.00365665 0.0015121 0.00160863 0.00263181 0.00638941 0.00772607
- 0.00225583 0.0010843 0.000882939 0.000801563 0.00075632
- 0.000554992 0.000435131 0.0003474 0.000217667 0.000491602
- 0.0012267 0.00250446 0.000212058 -0.0174972 -0.0527527 -0.0479071
- 0.194908 1.45838 3.40677 4.49242 4.86894 4.97215 5.01218
- 5.04342 5.06228 5.03069 4.87169 4.57056 4.11523 3.38264
- 2.19691 0.715839 0.172818 0.102162 0.0627162 0.0363388 0.020289
- 0.0119414 0.00826608 0.0066417 0.00549092 0.00492505 0.00439443
- 0.0037156 0.00306471 0.00247451 0.00195965 0.0014822 0.0010815
- 0.000904464 0.0010514 0.00152308 0.00120752 0.000228447
- -0.00102833 -0.00116644 -0.00042067 4.78758e-05 5.09599e-05
- -4.45756e-05 -3.22966e-06 3.81163e-05 7.94622e-05 0.000120808
- 0.000162154 0.000161895 0.000148481 0.000135068 0.000121654
- 0.000108241 9.81453e-05 9.2164e-05 8.61827e-05 8.02014e-05
- 7.42201e-05 6.82388e-05 6.22576e-05 5.62763e-05 5.0295e-05
- 4.43137e-05 3.83324e-05 3.54323e-05 3.321e-05 3.09877e-05
- 2.87654e-05 2.65431e-05 2.43209e-05 2.20986e-05 1.98763e-05
- 1.7654e-05 1.54317e-05 1.34612e-05 1.25441e-05 1.1627e-05
- 1.07099e-05 9.79276e-06 8.87564e-06 7.95851e-06 7.04139e-06
- 6.12427e-06
-}
-v24 set {
- 5 5.01099 5.00866 4.97845 4.92369 4.9273 4.97413 4.9929
- 4.99826 4.99958 4.99978 5.00005 4.99968 4.99959 5.00014
- 4.99979 4.99914 4.99982 5.00023 5.00295 5.00664 4.99854
- 4.99647 5.00438 5.01722 5.03681 5.04766 5.04799 5.04867
- 5.04873 5.04685 5.04413 5.0367 5.02505 5.01726 5.01183 5.00806
- 5.00549 5.00371 5.00246 5.00162 5.00105 5.00069 5.00045
- 5.00031 5.00024 5.00019 5.00012 5.00007 5.00004 5.00001
- 4.99998 4.99999 4.99999 5 5.00001 5.00001 5.00002 5.00002
- 5.00003 5.00003 5.00003 5.00002 5.00002 5.00001 5.00001
- 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 5 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5.00418 4.99953 4.99152
- 4.99807 5.00497 5.00112 5.00055 5.00038 5.00018 5.00006
- 5.00006 5.00007 5.00006 5.00004 5.00004 4.99853 4.99945
- 4.99998 5.00304 5.00935 5.00742 4.99181 4.97421 4.93603
- 4.8853 4.8927 4.93984 4.97458 4.99039 4.99614 4.99801 4.99851
- 4.99869 4.99924 5.00108 5.00181 5.00119 5.00059 5.00031
- 5.00022 5.00018 5.00011 5.00001 5.00006 4.99981 4.99977
- 4.99982 5.00012 4.99993 5.00008 5.00043 5.00048 5.00024
- 5.00008 4.99984 4.99993 5.00011 4.99996 4.9998 4.99977 4.9998
- 4.99993 5.00008 5.00011 5.00002 4.99995 4.99989 4.99993
- 5 5.00007 5.00009 4.99994 4.99977 4.9997 4.99975 4.99996
- 4.99996 4.99988 4.9997 4.99952 4.9995 4.99956 4.99973 4.99988
- 5.00005 5.00025 5.00042 5.00036 5.00031 5.00025 5.0002 5.00014
- 5.00009 5.00003 5.00002 5.00001 5.00001 5 4.99999 4.99998
- 4.99998 4.99997 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5.00284
- 5.00442 5.00381 4.98997 4.99092 5.00733 5.07791 4.98237
- 4.86434 4.76835 4.74067 4.79278 4.85094 4.90068 4.93603
- 4.95698 4.96984 4.97856 4.98869 4.99904 5.0005 4.99524 5.00181
- 5.01878 5.05177 5.07986 4.98917 4.56217 3.68 2.3539 1.18541
- 0.505772 0.221044 0.115287 0.0760938 0.0589194 0.0476784
- 0.0457213 0.0412911 0.033889 0.0259741 0.0191452 0.0139018
- 0.0100235 0.00711788 0.00497657 0.00349368 0.00250021 0.00176179
- 0.00121843 0.000838368 0.000582711 0.000423458 0.000294608
- 0.000201251 0.000133748 8.6227e-05 5.44252e-05 3.30514e-05
- 1.93926e-05 1.09814e-05 5.29857e-06 1.92247e-06 3.08708e-07
- -3.74311e-07 -6.11121e-07 -7.27807e-07 -4.87604e-07 -4.80493e-07
- -9.15925e-07 -2.03774e-06 -4.01128e-06 -2.46644e-06 2.10626e-06
- 8.22422e-06 1.04922e-05 9.83047e-06 7.27106e-06 3.29654e-06
- -2.06736e-06 -2.18019e-06 -2.29303e-06 -2.40586e-06 -2.51869e-06
- -2.63153e-06 -2.24615e-06 -1.70325e-06 -1.16036e-06 -6.17468e-07
- -7.45754e-08 2.45198e-07 2.88285e-07 3.31373e-07 3.7446e-07
- 4.17548e-07 4.60635e-07 5.03723e-07 5.4681e-07 5.89898e-07
- 6.32985e-07 6.76073e-07 6.19054e-07 5.4001e-07 4.60967e-07
- 3.81923e-07 3.02879e-07 2.23836e-07 1.44792e-07 6.57488e-08
- -1.32948e-08 -9.23383e-08 -1.6698e-07 -2.23206e-07 -2.79432e-07
- -3.35658e-07 -3.91884e-07 -4.48109e-07 -5.04335e-07 -5.60561e-07
- -6.16787e-07
-}
-v25 set {
- 1.34824 1.35838 1.36465 1.34675 1.29167 1.23161 1.2201 1.2185
- 1.2181 1.21798 1.21793 1.21788 1.21785 1.21782 1.21779 1.21776
- 1.21655 1.21656 1.21669 1.21871 1.22421 1.22247 1.21858
- 1.2228 1.23803 1.27737 1.10647 0.395248 0.0600669 0.027687
- 0.0192374 0.015425 0.0130881 0.00977445 0.00696598 0.00491122
- 0.00341952 0.00237078 0.00162339 0.00109178 0.000726647
- 0.000478886 0.00031568 0.000207902 0.000143494 0.000109768
- 8.62987e-05 5.69775e-05 3.36547e-05 2.30356e-05 1.86108e-05
- 1.41861e-05 1.08293e-05 7.68835e-06 4.79593e-06 4.51019e-06
- 4.22444e-06 3.9387e-06 3.65295e-06 3.36721e-06 3.04559e-06
- 2.69981e-06 2.35403e-06 2.00825e-06 1.66247e-06 1.34508e-06
- 1.26225e-06 1.17941e-06 1.09657e-06 1.01373e-06 9.30893e-07
- 8.48054e-07 7.65216e-07 6.82378e-07 5.9954e-07 5.16702e-07
- 4.37489e-07 3.82774e-07 3.2806e-07 2.73346e-07 2.18632e-07
- 1.63917e-07 1.09203e-07 5.4489e-08 -2.2523e-10 -5.49395e-08
- -1.09654e-07 -1.52862e-07 -1.3079e-07 -1.08718e-07 -8.6646e-08
- -6.45739e-08 -4.25019e-08 -2.04298e-08 1.64229e-09 2.37144e-08
- 4.57864e-08 6.78585e-08 8.71693e-08 9.30725e-08 9.89758e-08
- 1.04879e-07 1.10782e-07 1.16685e-07 1.22589e-07 1.28492e-07
- 1.34395e-07 1.40298e-07 1.46201e-07 1.52105e-07 1.58008e-07
- 1.63911e-07 1.69814e-07 1.75718e-07 1.81621e-07 1.87524e-07
- 1.93427e-07 1.9933e-07 2.05234e-07 2.11137e-07 2.19788e-07
- 0.000393944 -0.000218983 -0.00105784 0.00172403 -0.00027134
- -0.000204147 8.79968e-06 5.93762e-05 5.83554e-05 4.13815e-05
- 3.71369e-05 3.03372e-05 2.25336e-05 1.5986e-05 1.07284e-05
- -7.5239e-05 5.60593e-05 6.97571e-05 0.000667617 0.000960856
- 0.00131749 -0.00759564 -0.0217897 -0.0450321 -0.076646 -0.128569
- -0.186391 -0.202175 -0.206953 -0.2082 -0.208416 -0.208669
- -0.208934 -0.209111 -0.209234 -0.209329 -0.209389 -0.209416
- -0.2094 -0.209329 -0.20926 -0.209204 -0.209208 -0.209285
- -0.209454 -0.209641 -0.20977 -0.209811 -0.209833 -0.209887
- -0.209653 -0.209127 -0.208893 -0.208811 -0.208777 -0.208758
- -0.208747 -0.20874 -0.208726 -0.208697 -0.208657 -0.208611
- -0.208565 -0.208524 -0.208488 -0.208451 -0.208412 -0.208373
- -0.208333 -0.208294 -0.208256 -0.208219 -0.208183 -0.208145
- -0.208107 -0.208066 -0.208029 -0.207993 -0.207959 -0.207923
- -0.207883 -0.207838 -0.207789 -0.207747 -0.20771 -0.207675
- -0.207642 -0.207605 -0.207568 -0.207531 -0.207494 -0.207457
- -0.20742 -0.207383 -0.207346 -0.207308 -0.207271 -0.207233
- -0.207196 -0.207158 -0.207121 -0.207084 -0.207046 -0.207009
- -0.206972 -0.206935 -0.206898 -0.206861 -0.206823 -0.206786
- -0.206749 -0.206712 -0.206675 -0.206638 -0.2066 -0.206563
- -0.206526 -0.206489 -0.206452 -0.206415 -0.203384 -0.20015
- -0.196872 -0.205024 -0.210727 -0.206779 -0.0685263 0.586138
- 1.4665 2.22945 2.77554 3.076 3.24926 3.34515 3.40164 3.43006
- 3.43713 3.43075 3.42886 3.4384 3.46567 3.49025 3.51287 3.53821
- 3.57841 3.39846 2.80753 2.22947 1.7549 1.30429 0.707786
- 0.303206 0.131352 0.0671706 0.0429955 0.032461 0.0257161
- 0.0239521 0.0217397 0.0179705 0.0138745 0.0102813 0.00749643
- 0.0054328 0.00386817 0.0027004 0.00189442 0.00135552 0.000954715
- 0.000659981 0.000453435 0.000313993 0.000231347 0.000159665
- 0.000108122 7.10528e-05 4.50233e-05 2.77892e-05 1.62765e-05
- 8.9893e-06 4.5471e-06 1.54614e-06 -1.6542e-07 -8.68508e-07
- -1.04369e-06 -9.63086e-07 -8.44294e-07 -6.57339e-07 -7.35885e-07
- -9.80056e-07 -1.39772e-06 -2.10199e-06 -1.37474e-06 6.13269e-07
- 3.3028e-06 4.60941e-06 4.91053e-06 4.14186e-06 2.45258e-06
- -8.7388e-09 -3.59647e-07 -7.10554e-07 -1.06146e-06 -1.41237e-06
- -1.76328e-06 -1.63073e-06 -1.34534e-06 -1.05995e-06 -7.74561e-07
- -4.8917e-07 -2.95733e-07 -2.16326e-07 -1.3692e-07 -5.75135e-08
- 2.18929e-08 1.01299e-07 1.80706e-07 2.60112e-07 3.39519e-07
- 4.18925e-07 4.98332e-07 4.83984e-07 4.4901e-07 4.14035e-07
- 3.79061e-07 3.44087e-07 3.09112e-07 2.74138e-07 2.39163e-07
- 2.04189e-07 1.69215e-07 1.26002e-07 4.83213e-08 -2.9359e-08
- -1.07039e-07 -1.8472e-07 -2.624e-07 -3.4008e-07 -4.1776e-07
- -4.95441e-07
-}
-v26 set {
- 7.10441e-10 0.000309731 -0.000308186 -0.001694 -0.00360784
- 8.40909e-05 0.00203175 0.0012896 0.000596548 0.000277191
- 0.000161134 0.000120439 8.4915e-05 9.49929e-05 6.18812e-05
- 1.65433e-05 1.89682e-05 3.97578e-05 4.95446e-05 0.000225325
- 0.000214579 -0.00230134 -0.000451102 0.00997237 0.0341443
- 0.0449314 0.0424411 0.0341996 0.0315315 0.0308892 0.0291614
- 0.024365 0.0190282 0.0188976 0.017238 0.0138526 0.0105645
- 0.00778548 0.00561753 0.0039871 0.00279554 0.00194075 0.0013468
- 0.000934775 0.000664723 0.000498911 0.000377384 0.000254183
- 0.000163421 0.000120773 9.65058e-05 7.22384e-05 5.60316e-05
- 4.14549e-05 2.79516e-05 2.57096e-05 2.34677e-05 2.12257e-05
- 1.89837e-05 1.67417e-05 1.46737e-05 1.27228e-05 1.07719e-05
- 8.82099e-06 6.87009e-06 5.0896e-06 4.71705e-06 4.34451e-06
- 3.97196e-06 3.59941e-06 3.22686e-06 2.85431e-06 2.48176e-06
- 2.10921e-06 1.73666e-06 1.36411e-06 1.02855e-06 9.42931e-07
- 8.57316e-07 7.71701e-07 6.86086e-07 6.00471e-07 5.14856e-07
- 4.29241e-07 3.43626e-07 2.58011e-07 1.72396e-07 9.85409e-08
- 9.14091e-08 8.42773e-08 7.71456e-08 7.00138e-08 6.2882e-08
- 5.57503e-08 4.86185e-08 4.14867e-08 3.4355e-08 2.72232e-08
- 2.05821e-08 1.63235e-08 1.2065e-08 7.80643e-09 3.54786e-09
- -7.10696e-10 -4.96926e-09 -9.22782e-09 -1.34864e-08 -1.77449e-08
- -2.20035e-08 -2.62621e-08 -3.05206e-08 -3.47792e-08 -3.90378e-08
- -4.32963e-08 -4.75549e-08 -5.18134e-08 -5.6072e-08 -6.03306e-08
- -6.45891e-08 -6.88477e-08 -8.76373e-06 0.000131607 -0.00021685
- -0.000433027 0.00047234 0.000211593 -0.000189601 3.2492e-05
- 0.000575955 7.72235e-05 -0.000285172 -0.000242061 -0.000135112
- -3.50117e-05 -2.75868e-05 5.48974e-05 1.80604e-07 5.48911e-05
- 3.97478e-05 0.000192909 0.000297932 0.00402253 -0.0122366
- -0.047853 -0.0963082 -0.108071 -0.0567275 -0.0239271 -0.0178628
- -0.0233027 -0.031853 -0.0400843 -0.0482725 -0.0576154 -0.0627218
- -0.0511236 -0.0279524 -0.0150986 -0.00931091 -0.00652876
- -0.00479286 -0.00344346 -0.00249578 -0.0019532 -0.00157977
- -0.00131848 -0.00111251 -0.000939229 -0.000797445 -0.000708384
- -0.000630452 -0.000539722 -0.000508862 -0.000480596 -0.000439484
- -0.000407217 -0.000363866 -0.000329506 -0.000318642 -0.000307362
- -0.000286511 -0.000266253 -0.000242943 -0.000218107 -0.000204661
- -0.00020241 -0.000194435 -0.000185062 -0.000173042 -0.000160549
- -0.000151407 -0.000145626 -0.000145976 -0.000147342 -0.000145288
- -0.000137979 -0.000124481 -0.000123218 -0.000127453 -0.000139006
- -0.000145486 -0.000129764 -9.82749e-05 -4.72596e-05 -3.08671e-05
- -3.28834e-05 -4.52254e-05 -6.25389e-05 -6.32516e-05 -6.39643e-05
- -6.4677e-05 -6.53897e-05 -6.61023e-05 -6.6815e-05 -6.75277e-05
- -6.61005e-05 -6.45173e-05 -6.29341e-05 -6.13509e-05 -5.97676e-05
- -5.81844e-05 -5.66012e-05 -5.54231e-05 -5.4455e-05 -5.3487e-05
- -5.25189e-05 -5.15508e-05 -5.05828e-05 -4.96147e-05 -4.86466e-05
- -4.76785e-05 -4.67105e-05 -4.57424e-05 -4.47743e-05 -4.38063e-05
- -4.28382e-05 -4.18821e-05 -4.10211e-05 -4.016e-05 -3.9299e-05
- -3.8438e-05 4.29885e-05 5.14113e-05 -0.000127986 -0.000611463
- -0.000149428 0.000882394 0.00297059 -0.00405825 -0.00591067
- -0.00546997 -0.00158744 0.00190677 0.00298403 0.00268595
- 0.00196161 0.00130289 0.000783347 0.000520683 0.000565306
- 0.00053419 -0.00224696 -0.000920818 0.0132755 0.0322504
- 0.0442808 0.0638615 0.0701007 0.0539356 0.0247771 0.056244
- 0.294266 0.831368 1.45424 2.02898 2.54559 2.9937 3.35333
- 3.72609 4.06363 4.32789 4.52413 4.66504 4.7652 4.83637 4.88631
- 4.92109 4.94464 4.96046 4.97218 4.98079 4.98679 4.99076
- 4.99361 4.99555 4.99686 4.99783 4.99853 4.99902 4.99936
- 4.99959 4.99973 4.99983 4.9999 4.99993 4.99996 4.99998 5
- 5.00001 5 4.99999 4.99997 4.99994 4.99993 4.99994 4.99996
- 4.99999 5.00004 5.00006 5.00005 5.00003 5.00002 5.00001
- 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998
-
-}
-v27 set {
- 5 4.99984 4.99796 4.99478 4.9889 4.98738 4.98896 4.99087
- 4.99262 4.99419 4.99552 4.99659 4.99743 4.99807 4.99855
- 4.9989 4.99894 4.99908 4.99935 5.00001 5.0007 5.00132 5.00032
- 4.99976 5.00134 5.00339 5.00315 5.00157 5.00091 5.00058
- 5.00012 4.99944 4.99886 4.9994 4.99934 4.99899 4.99876 4.99868
- 4.99872 4.99883 4.99898 4.99914 4.9993 4.99944 4.99956 4.99967
- 4.99976 4.99982 4.99986 4.9999 4.99993 4.99997 4.99997 4.99998
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00009 5.00028 5.00015 4.99983
- 5.00036 4.99996 4.99834 4.99783 5.00383 5.00734 5.00387
- 5.00058 4.99893 4.99836 4.99832 4.99854 4.99873 4.99905
- 4.99927 4.99952 4.99969 4.99834 4.99536 4.99163 4.99073
- 5.0053 5.03631 5.03103 4.9008 4.62503 4.21887 3.70902 3.09967
- 2.35791 1.41912 0.519675 0.210458 0.131362 0.0980819 0.0708209
- 0.0471701 0.0323272 0.0253535 0.0199144 0.0152615 0.0117228
- 0.00917696 0.00738117 0.00609292 0.00512664 0.00436184 0.0037961
- 0.00331639 0.00289006 0.0025477 0.00226529 0.00202925 0.00182793
- 0.00165474 0.00150531 0.00137529 0.00125983 0.00115603 0.00106455
- 0.000982977 0.000911255 0.000846819 0.000790092 0.000738698
- 0.000692816 0.00065107 0.000613595 0.000579642 0.000548935
- 0.00052106 0.000495598 0.000472174 0.000450849 0.000431118
- 0.000412667 0.000395868 0.000381319 0.000368487 0.000357327
- 0.000344212 0.000330334 0.00031622 0.000303298 0.000295809
- 0.00028832 0.000280831 0.000273342 0.000265853 0.000258364
- 0.000250875 0.000245118 0.000239488 0.000233857 0.000228227
- 0.000222596 0.000216966 0.000211336 0.000207047 0.000203455
- 0.000199863 0.00019627 0.000192678 0.000189085 0.000185493
- 0.0001819 0.000178308 0.000174716 0.000171123 0.000167531
- 0.000163938 0.000160346 0.000156835 0.000153973 0.00015111
- 0.000148248 0.000145385 0.000296579 -3.96718e-05 -0.000449085
- 0.000323433 0.000750086 0.000268264 0.000149028 -0.000100249
- 7.00956e-05 0.00012605 0.00022592 0.000193036 0.000120453
- 8.07865e-05 7.65771e-05 -3.27828e-05 0.000116759 0.000169498
- 0.000409804 0.000414965 0.00092323 -0.00590633 -0.0175477
- -0.032433 -0.0559842 -0.0820373 0.0688484 0.626629 1.32929
- 2.01657 2.60925 3.12329 3.38952 3.14128 2.38463 1.23802
- 0.316019 0.107832 0.0694707 0.051837 0.035247 0.0209999
- 0.0116618 0.00967674 0.00789182 0.00574566 0.00386872 0.00258612
- 0.00167126 0.00104169 0.000641093 0.000401246 0.000277928
- 0.000171775 0.000102266 5.89376e-05 3.29258e-05 1.80463e-05
- 1.0057e-05 6.4571e-06 5.10093e-06 4.06791e-06 3.62716e-06
- 3.63321e-06 3.99625e-06 4.64368e-06 5.20886e-06 4.77728e-06
- 3.23919e-06 1.14113e-06 -1.29416e-06 -4.15607e-06 -1.88532e-06
- 5.24411e-06 1.38678e-05 1.28823e-05 3.6758e-06 -2.52285e-06
- -3.97133e-06 -4.03071e-06 -3.37154e-06 -2.71238e-06 -2.05321e-06
- -1.39404e-06 -7.34872e-07 -3.73325e-07 -1.05873e-07 1.61578e-07
- 4.2903e-07 6.96482e-07 8.18468e-07 7.60065e-07 7.01662e-07
- 6.43258e-07 5.84855e-07 5.26452e-07 4.68049e-07 4.09646e-07
- 3.51243e-07 2.9284e-07 2.34437e-07 1.71213e-07 1.06928e-07
- 4.2644e-08 -2.16403e-08 -8.59247e-08 -1.50209e-07 -2.14493e-07
- -2.78778e-07 -3.43062e-07 -4.07346e-07 -4.55065e-07 -4.3348e-07
- -4.11896e-07 -3.90311e-07 -3.68726e-07 -3.47141e-07 -3.25556e-07
- -3.03971e-07 -2.82386e-07
-}
-v28 set {
- 0.368163 0.361756 0.327463 0.269513 0.149476 0.0805716 0.0501146
- 0.03403 0.0230886 0.0160474 0.0116071 0.00870013 0.00679614
- 0.00542384 0.00432512 0.00340653 -0.00129719 -0.00399429
- -0.00318719 0.00443085 0.0150156 0.0334147 0.0132288 -0.0189751
- -0.0508377 -0.0252174 -0.0142489 -0.00675908 -0.0038653
- -0.00243423 -0.00168891 -0.00120901 -0.000900426 -0.000685575
- -0.000557595 -0.000457268 -0.000377427 -0.000315269 -0.000266613
- -0.000228397 -0.000198283 -0.000174248 -0.000154886 -0.00013892
- -0.000125864 -0.000115189 -0.000105841 -9.66611e-05 -8.84262e-05
- -8.23872e-05 -7.74668e-05 -7.25463e-05 -6.79992e-05 -6.35276e-05
- -5.92413e-05 -5.68994e-05 -5.45574e-05 -5.22154e-05 -4.98735e-05
- -4.75315e-05 -4.54981e-05 -4.36726e-05 -4.18471e-05 -4.00216e-05
- -3.81961e-05 -3.64559e-05 -3.54209e-05 -3.43858e-05 -3.33508e-05
- -3.23157e-05 -3.12807e-05 -3.02456e-05 -2.92105e-05 -2.81755e-05
- -2.71404e-05 -2.61054e-05 -2.51232e-05 -2.44984e-05 -2.38736e-05
- -2.32487e-05 -2.26239e-05 -2.19991e-05 -2.13742e-05 -2.07494e-05
- -2.01246e-05 -1.94998e-05 -1.88749e-05 -1.82865e-05 -1.79044e-05
- -1.75224e-05 -1.71403e-05 -1.67582e-05 -1.63762e-05 -1.59941e-05
- -1.56121e-05 -1.523e-05 -1.4848e-05 -1.44659e-05 -1.41138e-05
- -1.39075e-05 -1.37011e-05 -1.34947e-05 -1.32883e-05 -1.30819e-05
- -1.28755e-05 -1.26691e-05 -1.24627e-05 -1.22563e-05 -1.205e-05
- -1.18436e-05 -1.16372e-05 -1.14308e-05 -1.12244e-05 -1.1018e-05
- -1.08116e-05 -1.06052e-05 -1.03988e-05 -1.01924e-05 -9.98605e-06
- -9.77966e-06 -2.85319e-05 0.00281092 0.00180106 -0.000981083
- 0.00551926 -0.00119763 -0.0295069 -0.0367677 0.064749 0.119022
- 0.0882007 0.0552062 0.03418 0.0223243 0.015545 0.011949
- 0.00757134 0.00667655 0.00583243 0.00644443 0.00650959 -0.0302575
- -0.0437806 -0.0355466 0.0381776 0.282109 0.674178 1.07582
- 1.45189 1.789 2.08649 2.34663 2.57245 2.81211 3.04778 3.2523
- 3.45877 3.65593 3.83396 3.9923 4.13368 4.25864 4.36719 4.46064
- 4.54086 4.60962 4.66835 4.71838 4.76094 4.79716 4.82796
- 4.85413 4.87634 4.89518 4.91116 4.92476 4.93631 4.94608
- 4.95434 4.9613 4.96715 4.97211 4.97638 4.98001 4.98312 4.98571
- 4.98795 4.98979 4.99138 4.99269 4.99381 4.99474 4.99551
- 4.99615 4.99668 4.99713 4.99752 4.99783 4.99811 4.99836
- 4.99858 4.99873 4.99884 4.99892 4.999 4.99907 4.99912 4.99916
- 4.99921 4.99926 4.99932 4.99937 4.99942 4.99948 4.99953
- 4.99956 4.99958 4.99961 4.99963 4.99966 4.99968 4.99971
- 4.99972 4.99973 4.99974 4.99975 4.99976 4.99977 4.99978
- 4.99979 4.9998 4.9998 4.99981 4.99982 4.99983 4.99984 4.99985
- 4.99986 4.99986 4.99987 4.99987 5.00498 5.00354 4.99359
- 4.98981 5.00498 5.00099 5.00041 5.00022 5.00015 5.00012
- 5.0001 5.00008 5.00005 5.00003 5 4.99431 4.99459 4.99591
- 5.00087 5.01029 5.03935 4.92784 4.51643 3.78356 2.68745
- 1.43417 0.583128 0.205094 0.0777337 0.0391566 0.02723 0.023883
- 0.018808 0.010165 0.00254623 -0.00377463 -0.0038097 0.00144145
- 0.00267231 0.00193045 0.00144538 0.00121758 0.00112893 0.00109424
- 0.0010226 0.000948072 0.000882573 0.000826996 0.000776391
- 0.000729719 0.000686499 0.000647333 0.000610108 0.000575631
- 0.000545069 0.000515485 0.000488514 0.000465316 0.000443215
- 0.000422454 0.00040292 0.00038488 0.000368472 0.000353628
- 0.000339643 0.000326197 0.000313483 0.000302884 0.000294038
- 0.000284003 0.000270941 0.000254925 0.000246511 0.000244089
- 0.000245538 0.000242099 0.000235728 0.000227482 0.000218001
- 0.000207257 0.000202127 0.000196997 0.000191868 0.000186738
- 0.000181608 0.00017758 0.000173899 0.000170219 0.000166538
- 0.000162857 0.000159576 0.00015679 0.000154005 0.000151219
- 0.000148433 0.000145647 0.000142861 0.000140076 0.00013729
- 0.000134504 0.000131718 0.000129603 0.000127635 0.000125668
- 0.0001237 0.000121732 0.000119765 0.000117797 0.000115829
- 0.000113862 0.000111894 0.000109993 0.000108372 0.000106751
- 0.00010513 0.000103509 0.000101887 0.000100266 9.86449e-05
- 9.70237e-05
-}
-v29 set {
- 5 4.99899 4.99654 4.99327 4.9863 4.98954 4.99212 4.99378
- 4.9951 4.99624 4.99715 4.99786 4.99839 4.99879 4.99909 4.99931
- 4.99922 4.99933 4.99971 5.00064 5.00084 5.00123 4.99865
- 4.99853 4.99983 5.00457 5.00242 5.00105 5.00062 5.00042
- 4.99971 4.9994 4.9992 4.9996 4.99955 4.99932 4.99918 4.99915
- 4.99919 4.99927 4.99937 4.99948 4.99957 4.99966 4.99974
- 4.9998 4.99985 4.99989 4.99992 4.99993 4.99994 4.99994 4.99996
- 4.99998 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001
- 5.00001 5.00001 5 5 5 5 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99998 4.99998 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5
- 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5 5 5 5 5 5 4.9997 4.99998 4.99954 4.99963
- 5.00059 4.99945 4.99732 4.99957 5.00919 5.00558 5.00033
- 4.99851 4.9983 4.99854 4.99871 4.99928 4.99914 4.99939 4.99952
- 4.9998 4.99976 4.99744 4.99598 4.99478 4.99806 5.01911 5.04602
- 5.05469 5.01317 4.89484 4.69655 4.42036 4.06069 3.60793
- 3.12531 2.72975 2.45187 2.25081 2.09841 1.98509 1.90211
- 1.84084 1.79411 1.7574 1.72763 1.70283 1.68188 1.66389 1.64823
- 1.63438 1.62201 1.61088 1.60081 1.59163 1.58323 1.57549
- 1.56835 1.56173 1.55558 1.54985 1.54451 1.53951 1.53479
- 1.53035 1.52615 1.5222 1.51845 1.5149 1.51153 1.50834 1.50529
- 1.5024 1.49964 1.497 1.49449 1.49208 1.48977 1.48755 1.48542
- 1.48336 1.48138 1.47948 1.47765 1.4759 1.47419 1.47255 1.47096
- 1.46949 1.46823 1.46696 1.4657 1.46444 1.46317 1.46191 1.46065
- 1.45956 1.4585 1.45743 1.45636 1.45529 1.45422 1.45315 1.45226
- 1.45145 1.45064 1.44983 1.44902 1.44821 1.4474 1.44659 1.44579
- 1.44498 1.44417 1.44336 1.44255 1.44174 1.44094 1.44019
- 1.43944 1.43868 1.43793 1.43765 1.43679 1.43515 1.43405
- 1.43478 1.43387 1.43345 1.43184 1.43086 1.43021 1.43003
- 1.42988 1.42944 1.42883 1.42818 1.42702 1.42642 1.42595
- 1.42586 1.42616 1.42783 1.41733 1.38106 1.30738 1.3877 2.09819
- 3.05285 3.58059 3.77601 3.87609 4.02557 4.24887 4.4608 4.60411
- 4.72109 4.8255 4.90465 4.97379 5.01253 5.01532 5.01239 5.0092
- 5.00665 5.00474 5.00333 5.00232 5.00163 5.00117 5.00082
- 5.00057 5.00039 5.00027 5.00019 5.00013 5.00009 5.00006
- 5.00004 5.00003 5.00002 5.00001 5.00001 5 5 5 4.99998 4.99995
- 4.99992 4.99996 5.00005 5.00012 5.00008 4.99996 4.9999 4.99985
- 4.99986 4.99997 5.00021 5.0003 5.00024 5.00009 5.00007 5.00005
- 5.00003 5.00001 4.99998 4.99998 4.99998 4.99999 4.99999
- 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99998
- 4.99998 4.99998
-}
-v30 set {
- 7.10441e-10 5.70385e-05 0.000226143 0.000131916 -0.000887764
- -8.01837e-05 -3.49653e-05 9.40039e-05 0.000118663 0.000108025
- 8.6059e-05 6.33268e-05 4.99295e-05 3.16843e-05 3.60692e-05
- 2.07572e-05 -8.6375e-05 3.44583e-05 8.07397e-05 0.000196296
- 0.000115615 -7.12768e-05 -0.000129812 -4.18679e-05 7.94364e-05
- 0.000182034 -5.41226e-05 -0.000451819 -0.000713937 -0.00129863
- -0.00262186 -0.00213417 -0.00133767 0.000775698 0.000969902
- 0.000549281 0.000280946 0.000140321 8.6919e-05 7.22446e-05
- 6.5631e-05 6.45263e-05 6.63087e-05 7.17391e-05 7.59042e-05
- 7.59172e-05 7.03353e-05 6.33558e-05 5.31136e-05 4.64278e-05
- 4.40594e-05 4.16909e-05 4.05674e-05 3.96957e-05 3.87875e-05
- 3.74977e-05 3.62079e-05 3.49181e-05 3.36283e-05 3.23385e-05
- 3.12427e-05 3.02775e-05 2.93124e-05 2.83472e-05 2.7382e-05
- 2.64613e-05 2.59077e-05 2.5354e-05 2.48004e-05 2.42468e-05
- 2.36931e-05 2.31395e-05 2.25859e-05 2.20322e-05 2.14786e-05
- 2.0925e-05 2.03916e-05 1.9995e-05 1.95984e-05 1.92019e-05
- 1.88053e-05 1.84087e-05 1.80122e-05 1.76156e-05 1.7219e-05
- 1.68225e-05 1.64259e-05 1.6051e-05 1.57991e-05 1.55471e-05
- 1.52952e-05 1.50433e-05 1.47913e-05 1.45394e-05 1.42875e-05
- 1.40356e-05 1.37836e-05 1.35317e-05 1.32978e-05 1.31513e-05
- 1.30048e-05 1.28583e-05 1.27118e-05 1.25653e-05 1.24188e-05
- 1.22724e-05 1.21259e-05 1.19794e-05 1.18329e-05 1.16864e-05
- 1.15399e-05 1.13934e-05 1.12469e-05 1.11005e-05 1.0954e-05
- 1.08075e-05 1.0661e-05 1.05145e-05 1.0368e-05 1.02215e-05
- 1.76447e-05 7.21516e-05 -3.59786e-05 -0.000159618 0.000156236
- 0.000135106 -0.000336402 -0.000302283 0.000699323 0.000473866
- -0.000156146 -0.000225625 -0.000123592 -3.78116e-05 8.47472e-06
- 2.43387e-06 -7.44762e-05 7.80111e-05 9.43608e-05 0.000170159
- 8.83919e-05 -0.00018802 -0.000373512 -0.000390597 0.000156875
- 0.0032343 0.00776304 -0.000566905 -0.00760695 -0.0159226
- -0.0245989 -0.0331402 -0.0100902 0.067837 0.266702 0.910818
- 1.82282 2.69714 3.43247 3.98325 4.32893 4.51529 4.67087
- 4.79288 4.87574 4.92797 4.95902 4.97655 4.98622 4.99195
- 4.99526 4.99735 4.9991 4.99974 4.99982 4.99974 4.99961 4.9995
- 4.99943 4.9994 4.9994 4.99942 4.99944 4.99948 4.99952 4.99956
- 4.99961 4.99965 4.9997 4.99974 4.99977 4.99981 4.99983 4.99986
- 4.99988 4.9999 4.99991 4.99992 4.99993 4.99994 4.99995 4.99995
- 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999 4.99999
- 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5
- 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 5 5.00019 4.99888 4.99663 4.99457 4.99902
- 5.00229 5.00323 5.00302 5.0023 5.0015 5.00085 5.00041 5.00013
- 4.99993 4.99979 4.99948 4.99954 4.99983 5.00055 5.00109
- 5.00009 4.9987 4.998 4.99755 4.99676 4.99618 5.01091 5.05272
- 5.04156 4.80112 4.27692 3.42343 2.23953 0.967179 0.429813
- 0.540757 1.32991 2.32147 3.14903 3.78143 4.22325 4.47978
- 4.59448 4.69875 4.79798 4.87419 4.92339 4.95249 4.97174
- 4.98408 4.99124 4.99478 4.99729 4.99868 4.9992 4.99941 4.99947
- 4.99946 4.99943 4.9994 4.99939 4.9994 4.99942 4.99946 4.99951
- 4.99956 4.99961 4.99967 4.99973 4.99977 4.9998 4.99981 4.99983
- 4.99984 4.99987 4.99992 5.00001 5.00005 5.00001 4.99994
- 4.99995 4.99995 4.99996 4.99996 4.99996 4.99997 4.99997
- 4.99997 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999
- 4.99999 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5 5 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999
- 4.99998 4.99998 4.99998
-}
-v31 set {
- 1.8179e-09 -5.28841e-06 -1.44913e-05 -3.62932e-05 -9.75719e-05
- 0.000141781 3.73396e-05 -1.65603e-05 -1.5271e-05 -6.73884e-06
- 4.40157e-06 -4.85345e-06 -1.02964e-05 2.03126e-05 -1.89457e-05
- -8.75564e-06 7.67422e-06 4.71103e-06 1.29798e-05 6.13469e-06
- -1.14363e-05 -0.0394563 -0.0477298 -0.0622012 -0.0519225
- 0.262499 0.943611 1.67052 2.31017 2.84028 3.28467 3.61582
- 3.85887 4.13011 4.36511 4.54063 4.67013 4.76408 4.83263
- 4.8825 4.91837 4.94373 4.96117 4.97318 4.98093 4.98562 4.98906
- 4.99267 4.99539 4.99666 4.99731 4.99797 4.99844 4.99887
- 4.99927 4.99933 4.99938 4.99944 4.99949 4.99955 4.9996 4.99965
- 4.9997 4.99975 4.9998 4.99985 4.99986 4.99987 4.99989 4.9999
- 4.99991 4.99992 4.99993 4.99995 4.99996 4.99997 4.99998
- 4.99998 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5.00001
- 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99997 5.00002 5.00004 5.0001 5.0001 4.99987 5.00009
- 5.00021 5.00002 5.00004 4.99988 5.00013 4.99993 5.00026
- 4.99973 5 5.00006 5.00009 5.00004 5.00004 5.04854 4.82711
- 4.04208 2.64155 0.838902 0.19014 0.0982549 0.0723197 0.0576863
- 0.0427644 0.0301979 0.020146 0.0135728 0.00980358 0.00774482
- 0.00586604 0.0036687 0.00211511 0.00121906 0.000647581 0.000828436
- 0.00190938 0.00224254 0.00199956 0.00165488 0.00135612 0.00113715
- 0.000984181 0.000877175 0.000789973 0.000741139 0.000689338
- 0.000625676 0.000586082 0.000550152 0.000529573 0.000505606
- 0.000482117 0.000460574 0.000441649 0.000424674 0.000408398
- 0.000391914 0.000376272 0.000361487 0.000348181 0.000336045
- 0.000324466 0.000313545 0.000303046 0.000293056 0.00028356
- 0.000274586 0.000266155 0.000258279 0.000250938 0.000243789
- 0.000236912 0.000230244 0.000224186 0.000219291 0.000215346
- 0.000212468 0.000207291 0.000200862 0.00019368 0.000186767
- 0.000183515 0.000180263 0.00017701 0.000173758 0.000170506
- 0.000167253 0.000164001 0.000161164 0.000158357 0.00015555
- 0.000152743 0.000149936 0.000147129 0.000144322 0.000142066
- 0.000140096 0.000138127 0.000136157 0.000134187 0.000132218
- 0.000130248 0.000128278 0.000126308 0.000124339 0.000122369
- 0.000120399 0.000118429 0.00011646 0.000114527 0.000112892
- 0.000111258 0.000109623 0.000107988 0.000103598 6.86052e-05
- 3.337e-05 7.00783e-05 0.000218764 0.000221318 0.000118593
- -0.000113962 5.78552e-05 9.42068e-05 0.000237037 0.000171302
- 0.0001033 6.16066e-05 5.52908e-05 6.30233e-05 7.01897e-05
- 8.48573e-05 0.000106859 8.37213e-05 -0.0391541 -0.047722
- -0.0618454 -0.0169804 0.345725 1.03426 1.74825 2.37152 2.88737
- 3.32173 3.66761 3.9707 4.17762 3.98832 3.30483 2.09737 0.710892
- 0.148159 0.0707463 0.0555808 0.045618 0.0319116 0.0199589
- 0.0133357 0.00898528 0.00586075 0.00375478 0.00245443 0.00156038
- 0.000962344 0.000590953 0.000375107 0.000250243 0.00015882
- 0.000100203 6.18122e-05 3.7372e-05 2.23009e-05 1.32569e-05
- 8.29437e-06 5.72457e-06 3.96832e-06 2.98935e-06 2.59699e-06
- 2.75024e-06 3.38689e-06 4.0453e-06 3.50095e-06 1.64988e-06
- -3.84371e-07 -2.03828e-06 -3.46401e-06 -1.24301e-06 4.63458e-06
- 1.14104e-05 1.02619e-05 2.15487e-06 -2.98487e-06 -3.67221e-06
- -2.94279e-06 -2.58649e-06 -2.23019e-06 -1.87389e-06 -1.5176e-06
- -1.1613e-06 -7.92127e-07 -4.18889e-07 -4.56502e-08 3.27588e-07
- 7.00827e-07 8.79539e-07 8.17025e-07 7.5451e-07 6.91996e-07
- 6.29481e-07 5.66966e-07 5.04452e-07 4.41937e-07 3.79422e-07
- 3.16908e-07 2.54393e-07 1.90078e-07 1.25366e-07 6.0654e-08
- -4.05776e-09 -6.87696e-08 -1.33481e-07 -1.98193e-07 -2.62905e-07
- -3.27617e-07 -3.92329e-07 -4.40392e-07 -4.18802e-07 -3.97213e-07
- -3.75624e-07 -3.54035e-07 -3.32446e-07 -3.10856e-07 -2.89267e-07
- -2.67678e-07
-}
-v32 set {
- 1.10294 1.10297 1.10291 1.10277 1.10259 1.10294 1.10313
- 1.10306 1.10299 1.10296 1.10295 1.10295 1.10294 1.10294
- 1.10294 1.10294 1.10294 1.10294 1.10294 1.10296 1.10296
- 1.00547 0.998599 1.5201 2.49297 3.31258 3.73162 3.84757
- 3.92505 4.02965 4.16599 4.30294 4.41541 4.52886 4.64414
- 4.73865 4.81065 4.86391 4.90315 4.93188 4.95258 4.96726
- 4.97738 4.98436 4.98888 4.99162 4.99363 4.99573 4.99731
- 4.99804 4.99843 4.99881 4.99909 4.99934 4.99957 4.9996 4.99964
- 4.99967 4.9997 4.99973 4.99977 4.9998 4.99983 4.99986 4.99988
- 4.99991 4.99992 4.99992 4.99993 4.99994 4.99994 4.99995
- 4.99996 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999
- 4.99999 4.99999 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 5.00028 4.99988 4.99968
- 5.00019 4.99987 5.00021 4.99973 4.99977 4.99996 4.99997
- 5.0002 4.99957 5.00026 4.99947 5.00074 5.00003 4.99987 4.99979
- 5.00008 4.99997 5.08794 5.05993 4.76875 3.99197 3.10174
- 2.5197 2.21771 2.04 1.92235 1.83874 1.77592 1.72665 1.686
- 1.65276 1.6286 1.61299 1.60039 1.58934 1.57954 1.57083 1.56306
- 1.55604 1.54963 1.54375 1.53832 1.53331 1.52865 1.52432
- 1.52026 1.51645 1.51287 1.50949 1.50629 1.50327 1.50039
- 1.49766 1.49505 1.49257 1.49019 1.48792 1.48574 1.48365
- 1.48164 1.47971 1.47784 1.47604 1.47431 1.47264 1.47102
- 1.46945 1.46794 1.46647 1.46505 1.46367 1.46233 1.46103
- 1.45976 1.45853 1.45733 1.45616 1.45502 1.45392 1.45284
- 1.45179 1.45076 1.44975 1.4488 1.44795 1.44711 1.44626 1.44541
- 1.44457 1.44372 1.44287 1.44212 1.44138 1.44063 1.43989
- 1.43914 1.4384 1.43766 1.43701 1.43641 1.43581 1.43522 1.43462
- 1.43402 1.43342 1.43282 1.43223 1.43163 1.43103 1.43043
- 1.42984 1.42924 1.42865 1.42808 1.42752 1.42695 1.42639
- 1.42584 1.42529 1.42472 1.42412 1.42365 1.42326 1.42304
- 1.42162 1.42082 1.42032 1.42029 1.42026 1.41995 1.41947
- 1.41894 1.41841 1.4179 1.41742 1.41699 1.41656 1.32097 1.30963
- 1.78765 2.64656 3.35764 3.747 3.86589 3.94217 4.04185 4.18453
- 4.3561 4.53439 4.68621 4.74905 4.77848 4.84629 4.91261 4.97541
- 5.01284 5.01548 5.01248 5.00924 5.00666 5.00475 5.00334
- 5.00234 5.00164 5.00118 5.00083 5.00058 5.0004 5.00028 5.00019
- 5.00013 5.00009 5.00007 5.00004 5.00003 5.00002 5.00001
- 5.00001 5.00001 5 5 4.99999 4.99995 4.99992 4.99996 5.00006
- 5.00012 5.00009 4.99997 4.9999 4.99985 4.99986 4.99997 5.00021
- 5.00031 5.00024 5.0001 5.00007 5.00005 5.00003 5.00001 4.99998
- 4.99998 4.99999 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5
- 5 4.99999 4.99999 4.99999 4.99998 4.99998 4.99998
-}
-v33 set {
- 5 5.00012 5.00023 5.0003 4.99972 4.99988 4.99984 4.99991
- 4.99996 4.99999 5.00008 5.00009 4.99986 5.00003 5.00007
- 4.99995 4.9999 4.99997 5.00013 5.00014 5.00013 4.99701 4.99763
- 4.99742 4.99998 5.02836 5.07262 4.96856 4.57267 3.85637
- 2.79544 1.45942 0.408016 0.084885 0.0271375 0.0119294 0.00707546
- 0.0051087 0.00373035 0.00264737 0.00186477 0.00130379 0.000915857
- 0.000653121 0.000483893 0.000380852 0.000302362 0.000219498
- 0.000154435 0.000121928 0.000104026 8.61242e-05 7.48526e-05
- 6.49216e-05 5.56238e-05 5.29689e-05 5.03139e-05 4.7659e-05
- 4.5004e-05 4.23491e-05 4.00356e-05 3.79522e-05 3.58687e-05
- 3.37852e-05 3.17018e-05 2.97592e-05 2.89804e-05 2.82016e-05
- 2.74228e-05 2.66441e-05 2.58653e-05 2.50865e-05 2.43077e-05
- 2.35289e-05 2.27501e-05 2.19714e-05 2.12346e-05 2.07821e-05
- 2.03295e-05 1.98769e-05 1.94244e-05 1.89718e-05 1.85192e-05
- 1.80667e-05 1.76141e-05 1.71615e-05 1.6709e-05 1.62828e-05
- 1.60061e-05 1.57294e-05 1.54527e-05 1.5176e-05 1.48993e-05
- 1.46226e-05 1.43459e-05 1.40692e-05 1.37925e-05 1.35158e-05
- 1.3262e-05 1.31191e-05 1.29761e-05 1.28332e-05 1.26903e-05
- 1.25474e-05 1.24045e-05 1.22615e-05 1.21186e-05 1.19757e-05
- 1.18328e-05 1.16898e-05 1.15469e-05 1.1404e-05 1.12611e-05
- 1.11182e-05 1.09752e-05 1.08323e-05 1.06894e-05 1.05465e-05
- 1.04036e-05 1.02606e-05 1.00185e-05 3.8343e-05 -3.06781e-05
- -0.000111758 0.000111673 0.000130815 -0.000210491 -0.000231304
- 0.000310226 0.000265303 3.0878e-05 -4.48405e-05 -1.2852e-05
- -7.84469e-06 3.29986e-05 -1.23286e-05 -6.07871e-05 5.35082e-05
- 7.69194e-05 0.000126221 6.57178e-05 0.00223349 -0.0148854
- -0.0476636 -0.0491447 0.220125 1.11174 2.03988 2.90209 3.61069
- 4.13554 4.50679 4.71501 4.83916 4.91027 4.95284 4.98086
- 4.99151 4.98651 4.97113 4.95075 4.93102 4.93683 4.95457
- 4.97071 4.98212 4.98948 4.99386 4.99636 4.99785 4.9987 4.99927
- 4.99989 5.00014 5.00007 4.99988 4.99982 4.99976 4.99973
- 4.99972 4.99972 4.99973 4.99974 4.99975 4.99977 4.99979
- 4.99981 4.99984 4.99986 4.99988 4.99989 4.99991 4.99992
- 4.99993 4.99994 4.99995 4.99996 4.99996 4.99997 4.99997
- 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999
- 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00002 5.00001 5.00001
- 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 5 5.00012 4.99946 4.99839 4.99733
- 4.99948 5.00114 5.00158 5.00147 5.00113 5.00073 5.00043
- 5.0002 5.00006 4.99995 4.99986 4.99973 4.99976 4.9999 5.00029
- 5.00055 4.99704 4.99734 4.9972 5.00278 5.03354 5.07184 4.94057
- 4.51936 3.75638 2.60982 1.23803 0.315016 0.0796102 0.0252894
- 0.0165723 0.0827785 0.491298 1.40686 2.33436 3.1251 3.7691
- 4.22201 4.49976 4.68115 4.80513 4.88509 4.93208 4.95861
- 4.97579 4.98655 4.99268 4.99571 4.99771 4.99881 4.99929
- 4.99954 4.99965 4.9997 4.99971 4.99971 4.99971 4.99971 4.99972
- 4.99974 4.99976 4.99978 4.99981 4.99984 4.99987 4.99989
- 4.99991 4.99991 4.99992 4.99992 4.99993 4.99997 5.00003
- 5.00006 5.00004 5.00001 5 4.99999 4.99998 4.99998 4.99997
- 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999 4.99999
- 4.99999 4.99999 5 5 5 5 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 4.99999
- 4.99999 4.99999 4.99999 4.99998 4.99998
-}
-v34 set {
- 5 5.00207 5.00813 5.01486 5.00156 5.0018 4.99861 4.99844
- 4.99888 4.9993 4.99956 4.99971 4.99979 4.99983 4.99987 4.99989
- 4.99671 4.9974 4.99864 5.00131 5.00377 5.0021 5.00039 4.99993
- 5.00004 5.0009 5.00109 4.99636 4.98617 4.96778 4.92047 4.89528
- 4.91112 4.9559 4.98286 4.99369 4.99812 4.99951 4.99994 5.00014
- 5.00008 4.99994 4.99984 4.99989 4.99998 5.00004 5.00004
- 5.00006 5.00005 5.00001 4.99997 4.99992 4.99993 4.99994
- 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996
- 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996
- 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997
- 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997
- 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99998 4.99998 4.99998 4.99998 5.00131 5.00072 4.9977 4.99811
- 5.00325 4.99647 4.98948 4.99459 5.00262 5.00276 5.00156
- 5.00072 5.0003 5.00013 4.99995 4.99668 4.99775 4.99917 5.00173
- 5.00386 5.00188 4.99888 4.99757 4.99951 5.01712 5.0557 5.07088
- 5.07704 5.07758 5.06958 5.04223 5.03331 5.0279 5.03408 5.07611
- 5.01911 4.68594 3.99152 2.92195 1.69878 0.809 0.344091 0.154663
- 0.0788717 0.0467212 0.0336168 0.0280514 0.0254947 0.024173
- 0.0223567 0.0220555 0.0271514 0.0295872 0.0296052 0.0283971
- 0.0264726 0.0241813 0.0218244 0.0195349 0.017368 0.0152495
- 0.013295 0.0115444 0.00996982 0.00857091 0.00733891 0.00627261
- 0.0053494 0.00456316 0.00388373 0.00331073 0.00282181 0.00240991
- 0.00206389 0.00177187 0.00152283 0.00131167 0.00112558 0.000954373
- 0.000805726 0.00069326 0.000600991 0.000525743 0.00047355
- 0.00044359 0.000434815 0.000436053 0.000402511 0.000368969
- 0.000335427 0.000301886 0.000268344 0.000234802 0.00020126
- 0.000184967 0.000169932 0.000154896 0.000139861 0.000124825
- 0.00010979 9.47546e-05 8.67896e-05 8.24901e-05 7.81906e-05
- 7.38911e-05 6.95915e-05 6.5292e-05 6.09925e-05 5.66929e-05
- 5.23934e-05 4.80939e-05 4.37943e-05 3.94948e-05 3.51953e-05
- 3.08957e-05 2.67968e-05 2.42936e-05 2.17904e-05 1.92872e-05
- 1.6784e-05 0.00125927 -0.00794344 -0.0305499 -0.0621697
- -0.0463796 -0.0224608 -0.00538381 0.00546086 0.0108675 0.012883
- 0.0131787 0.0127271 0.0119702 0.0110398 0.0100635 0.00649617
- 0.00489388 0.00545863 0.0098351 0.0167428 0.0126563 0.00697542
- 0.00427027 0.00330002 0.00390774 0.00408999 -0.00259143
- -0.0160578 -0.0451849 -0.0409651 0.1301 0.597429 1.3848
- 2.63426 3.81272 4.51373 4.8412 4.98731 4.88165 4.37165 3.40034
- 2.17681 1.12217 0.505129 0.219703 0.104992 0.0622333 0.0448317
- 0.0355782 0.0311867 0.0293529 0.0274615 0.0288739 0.0307845
- 0.0304909 0.029245 0.0273602 0.0251006 0.022697 0.0202765
- 0.0179357 0.0157106 0.0136562 0.0117951 0.0101273 0.00865784
- 0.00739394 0.00634364 0.00551356 0.00480538 0.00415747 0.00356084
- 0.00297585 0.00236711 0.00181853 0.00160713 0.00169822 0.00166542
- 0.00145504 0.00120252 0.00109259 0.000982658 0.00087273
- 0.000762802 0.000652874 0.000584068 0.000528263 0.000472458
- 0.000416653 0.000360848 0.000321155 0.000301442 0.000281729
- 0.000262016 0.000242303 0.00022259 0.000202877 0.000183164
- 0.000163451 0.000143738 0.000124025 0.000114582 0.000107399
- 0.000100216 9.30332e-05 8.58502e-05 7.86672e-05 7.14841e-05
- 6.43011e-05 5.7118e-05 4.9935e-05 4.35378e-05 4.04281e-05
- 3.73184e-05 3.42088e-05 3.10991e-05 2.79894e-05 2.48798e-05
- 2.17701e-05 1.86604e-05
-}
-v35 set {
- 7.24585e-12 2.21843e-05 3.20014e-05 1.25076e-05 -2.44947e-05
- 1.8425e-05 5.50546e-06 3.53025e-05 -1.07551e-05 -3.94383e-06
- -2.27848e-06 -9.04789e-05 7.44215e-05 -2.7662e-05 0.000200038
- -2.11998e-05 -2.09011e-05 2.37098e-05 2.18751e-05 -2.28422e-05
- -6.23659e-05 3.58241e-05 1.76386e-05 -4.28311e-05 0.000355626
- 0.00156903 0.00100999 -0.0085304 -0.02067 -0.0389485 -0.0651568
- -0.128475 -0.314362 -0.406837 -0.421558 -0.421277 -0.418176
- -0.414481 -0.410845 -0.407348 -0.403971 -0.400716 -0.397582
- -0.394563 -0.391658 -0.388866 -0.386178 -0.383585 -0.381094
- -0.378789 -0.376569 -0.37435 -0.372256 -0.370188 -0.36815
- -0.366422 -0.364694 -0.362967 -0.361239 -0.359511 -0.357888
- -0.356334 -0.354781 -0.353227 -0.351674 -0.350152 -0.348888
- -0.347625 -0.346361 -0.345098 -0.343834 -0.342571 -0.341307
- -0.340044 -0.33878 -0.337517 -0.336279 -0.335215 -0.334152
- -0.333088 -0.332024 -0.330961 -0.329897 -0.328833 -0.32777
- -0.326706 -0.325642 -0.324601 -0.323683 -0.322766 -0.321849
- -0.320932 -0.320014 -0.319097 -0.31818 -0.317263 -0.316345
- -0.315428 -0.314545 -0.313825 -0.313106 -0.312387 -0.311667
- -0.310948 -0.310228 -0.309509 -0.308789 -0.30807 -0.307351
- -0.306631 -0.305912 -0.305192 -0.304473 -0.303754 -0.303034
- -0.302315 -0.301595 -0.300876 -0.300157 -0.299437 -0.298716
- -0.29798 -0.297329 -0.296691 -0.295837 -0.29516 -0.294725
- -0.294044 -0.292917 -0.292351 -0.291965 -0.291365 -0.290687
- -0.290027 -0.289376 -0.288772 -0.288193 -0.287505 -0.286892
- -0.28626 -0.285714 -0.284545 -0.289246 -0.298717 -0.298492
- -0.214163 0.181451 0.0749974 0.0454707 0.0292987 0.0196837
- 0.0124119 0.00884715 0.00527181 0.00585821 0.0296361 0.169856
- 0.361207 0.538856 0.67469 0.685933 0.392802 0.17772 0.0813085
- 0.0424601 0.0246654 0.0175258 0.0144256 0.0129859 0.012205
- 0.0112846 0.010933 0.0134813 0.0147254 0.0147981 0.0142156
- 0.0132732 0.0121355 0.0109587 0.00981238 0.00872731 0.00767007
- 0.00669346 0.00581341 0.00502167 0.00431819 0.00369842 0.00316168
- 0.00269663 0.00230035 0.00195801 0.00166928 0.00142286 0.00121522
- 0.00104072 0.000893384 0.000767675 0.000661268 0.000567659
- 0.000481766 0.000407101 0.000350044 0.000302721 0.000263424
- 0.000236813 0.00022199 0.000218182 0.000219548 0.0002027
- 0.000185853 0.000169006 0.000152158 0.000135311 0.000118463
- 0.000101616 9.33782e-05 8.57685e-05 7.81588e-05 7.0549e-05
- 6.29393e-05 5.53296e-05 4.77199e-05 4.36954e-05 4.15296e-05
- 3.93637e-05 3.71978e-05 3.50319e-05 3.28661e-05 3.07002e-05
- 2.85343e-05 2.63685e-05 2.42026e-05 2.20367e-05 1.98709e-05
- 1.7705e-05 1.55391e-05 1.34772e-05 1.22416e-05 1.10061e-05
- 9.77055e-06 8.535e-06 0.000631271 -0.00362586 -0.0146235
- -0.0308486 -0.0237466 -0.0117522 -0.00304171 0.00251033
- 0.00531986 0.0063897 0.00657351 0.00636494 0.00599705 0.00553442
- 0.00505994 0.00330925 0.00246671 0.0027006 0.00473161 0.00830333
- 0.00649147 0.00356815 0.00217448 0.00187579 0.00270447 0.00219543
- -0.00546118 -0.0179576 -0.0445306 -0.0649309 0.0197935 0.473629
- 0.87268 0.269542 0.0086094 0.0844602 0.606456 1.04929 0.906014
- 0.916205 0.919425 0.872867 0.556244 0.262457 0.11838 0.0571226
- 0.0333451 0.0237133 0.0185096 0.0159617 0.0148663 0.0138683
- 0.0144081 0.0153797 0.0152551 0.0146487 0.0137192 0.0125973
- 0.0113996 0.0101903 0.00901851 0.00790495 0.00687502 0.00593994
- 0.00510092 0.00436111 0.00372439 0.0031945 0.00277537 0.00241888
- 0.002095 0.00179943 0.00150419 0.00119264 0.00090934 0.000802394
- 0.000852816 0.000838368 0.000730842 0.000601028 0.000546616
- 0.000492205 0.000437793 0.000383381 0.000328969 0.00029454
- 0.000266428 0.000238317 0.000210205 0.000182093 0.000162091
- 0.000152145 0.000142198 0.000132252 0.000122306 0.000112359
- 0.000102413 9.24665e-05 8.25201e-05 7.25738e-05 6.26274e-05
- 5.78553e-05 5.42216e-05 5.05878e-05 4.69541e-05 4.33204e-05
- 3.96867e-05 3.60529e-05 3.24192e-05 2.87855e-05 2.51518e-05
- 2.19153e-05 2.03406e-05 1.8766e-05 1.71913e-05 1.56167e-05
- 1.4042e-05 1.24674e-05 1.08927e-05 9.31806e-06
-}
-v36 set {
- 5 5.01426 5.02852 5.01923 4.77685 4.56471 4.52338 4.56813
- 4.63122 4.693 4.74776 4.79385 4.83258 4.86358 4.88918 4.91021
- 4.90553 4.89733 4.89554 4.91953 5.00757 5.07101 5.06318
- 5.05241 5.05535 5.08042 5.07251 4.90973 4.56136 3.98637
- 3.237 2.67216 2.33678 2.13529 2.00544 1.91429 1.84638 1.79461
- 1.75338 1.71958 1.69175 1.6686 1.64918 1.63258 1.61836 1.60607
- 1.59506 1.58483 1.57575 1.56847 1.56193 1.55538 1.54968
- 1.54416 1.5388 1.53523 1.53165 1.52807 1.52449 1.52091 1.51771
- 1.51477 1.51182 1.50888 1.50593 1.50309 1.50113 1.49917
- 1.4972 1.49524 1.49328 1.49132 1.48935 1.48739 1.48543 1.48346
- 1.48157 1.48012 1.47868 1.47724 1.47579 1.47435 1.47291
- 1.47146 1.47002 1.46857 1.46713 1.46574 1.46462 1.4635 1.46238
- 1.46126 1.46014 1.45902 1.4579 1.45678 1.45567 1.45455 1.45349
- 1.45275 1.45201 1.45127 1.45053 1.44979 1.44905 1.44831
- 1.44757 1.44683 1.44609 1.44535 1.44461 1.44387 1.44313
- 1.44239 1.44165 1.44091 1.44017 1.43943 1.43869 1.43795
- 1.43721 1.43874 1.43976 1.43619 1.43182 1.43726 1.43084
- 1.42587 1.42383 1.42642 1.42728 1.42736 1.4271 1.42669 1.42621
- 1.42569 1.41703 1.41244 1.41019 1.41199 1.41833 1.42502
- 1.41504 1.37535 1.28381 1.44779 2.33713 3.25835 3.67554
- 3.84975 4.01125 4.2253 4.45433 4.62215 4.74478 4.82998 4.8868
- 4.92396 4.94768 4.96498 4.98537 5.0128 5.04467 5.06722 5.06535
- 5.01475 4.91956 4.80647 4.7242 4.7059 4.73552 4.76379 4.81684
- 4.87376 4.92276 4.96112 4.9884 5.0045 5.00999 5.00933 5.00619
- 5.00384 5.00342 5.00373 5.00362 5.00309 5.00272 5.00239
- 5.00204 5.00172 5.00146 5.00124 5.00105 5.00089 5.00076
- 5.00065 5.00057 5.00048 5.00041 5.00034 5.00028 5.00023
- 5.00019 5.00015 5.00015 5.00016 5.0002 5.00023 5.00021 5.00019
- 5.00017 5.00015 5.00012 5.0001 5.00008 5.00007 5.00006 5.00005
- 5.00004 5.00003 5.00002 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00001
- 5.00001 5.00001 5.00062 4.99506 4.9835 4.96726 4.9728 4.97877
- 4.98675 4.9966 5.00406 5.00679 5.00629 5.00561 5.00487 5.00429
- 5.00384 5.002 5.00164 5.00229 5.00484 5.00769 5.00019 5.00242
- 5.01319 5.0335 5.07265 5.10129 5.11485 5.12551 5.13953 5.16048
- 5.18862 5.22811 5.25656 5.25627 5.19975 4.9139 4.24745 3.43732
- 2.8202 2.43224 2.17409 2.01333 1.93951 1.94622 1.98861 2.02217
- 2.05383 2.08376 2.11184 2.13793 2.16191 2.18267 2.20502
- 2.22837 2.24958 2.26901 2.28648 2.302 2.31582 2.32802 2.33869
- 2.34795 2.35596 2.36282 2.3687 2.37371 2.37797 2.38161 2.38476
- 2.38743 2.3897 2.39168 2.39329 2.39463 2.39575 2.39671 2.39756
- 2.39835 2.39907 2.39968 2.39999 2.4003 2.40061 2.40091 2.40122
- 2.40142 2.40159 2.40176 2.40193 2.4021 2.40222 2.40228 2.40234
- 2.4024 2.40247 2.40253 2.40259 2.40265 2.40271 2.40277 2.40284
- 2.40287 2.40289 2.40291 2.40294 2.40296 2.40298 2.40301
- 2.40303 2.40305 2.40308 2.4031 2.40311 2.40312 2.40313 2.40314
- 2.40315 2.40316 2.40317 2.40318
-}
-v37 set {
- 5 5.01732 5.03181 5.05944 5.12686 5.20725 5.28103 5.31254
- 5.32901 5.33709 5.3408 5.34257 5.34311 5.34347 5.34386 5.34411
- 5.3406 5.33484 5.32942 5.32904 5.33644 5.34869 5.35001 5.34882
- 5.34758 5.34672 5.34599 5.34496 5.34364 5.34165 5.33712
- 5.33502 5.3366 5.34067 5.34306 5.34398 5.34434 5.34442 5.34443
- 5.34443 5.34441 5.34439 5.34437 5.34437 5.34438 5.34438
- 5.34438 5.34438 5.34438 5.34437 5.34437 5.34436 5.34436
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.35377 5.35451
- 5.34265 5.34488 5.35861 5.28622 4.90033 4.75027 4.89731
- 4.97098 4.99293 4.99832 4.99909 4.99956 4.99858 4.99829
- 4.9998 5.00035 5.0038 5.00989 5.00251 4.99438 4.9953 4.99761
- 4.99985 5.00152 5.0011 5.00046 4.99996 4.99925 4.99862 4.99919
- 4.99961 5.00048 5.00234 4.99654 4.98235 4.95936 4.83738
- 4.53021 4.21004 4.00593 3.91207 3.88059 3.87822 3.89117
- 3.91278 3.94044 3.97376 4.01152 4.05052 4.10679 4.17908
- 4.25673 4.33414 4.40875 4.47879 4.54342 4.60258 4.65595
- 4.70291 4.74414 4.78018 4.81185 4.83915 4.86291 4.88301
- 4.90048 4.91528 4.92802 4.9387 4.94777 4.95539 4.9618 4.96725
- 4.97195 4.97588 4.97932 4.98247 4.98512 4.98697 4.98831
- 4.98919 4.99015 4.99101 4.99169 4.99222 4.99282 4.99341
- 4.994 4.9946 4.99519 4.99578 4.99638 4.99667 4.99693 4.9972
- 4.99747 4.99773 4.998 4.99827 4.99841 4.99849 4.99856 4.99864
- 4.99872 4.9988 4.99888 4.99896 4.99904 4.99911 4.99919 4.99927
- 4.99935 4.99943 4.9995 4.99955 4.9996 4.99965 4.9997 5.00736
- 4.98252 4.87516 4.66727 4.49142 4.43103 4.4301 4.4571 4.49729
- 4.5407 4.5835 4.62363 4.66114 4.69577 4.72738 4.74632 4.75971
- 4.77576 4.80671 4.87073 4.91665 4.93252 4.94418 4.95331
- 4.96094 4.96727 4.97148 4.97471 4.97612 4.98276 5.00247
- 5.04086 5.08628 5.10673 5.08887 5.0564 5.02767 5.01336 4.99685
- 4.97422 4.90866 4.67035 4.33117 4.07888 3.94432 3.89105
- 3.88174 3.89292 3.91442 3.94564 3.98708 4.0355 4.09134 4.16315
- 4.24088 4.31918 4.39527 4.46693 4.53337 4.59405 4.6486 4.69693
- 4.73938 4.77617 4.80809 4.83551 4.85895 4.87894 4.89596
- 4.91081 4.92417 4.93651 4.94552 4.95198 4.9565 4.96096 4.96523
- 4.96972 4.97428 4.97868 4.98064 4.9826 4.98455 4.98651 4.98847
- 4.98967 4.99064 4.9916 4.99257 4.99353 4.99422 4.99457 4.99493
- 4.99528 4.99563 4.99598 4.99633 4.99668 4.99703 4.99738
- 4.99773 4.9979 4.99804 4.99817 4.9983 4.99843 4.99856 4.99869
- 4.99883 4.99896 4.99909 4.99921 4.99926 4.99931 4.99937
- 4.99942 4.99948 4.99953 4.99959 4.99964
-}
-v38 set {
- 4.49849 4.53282 4.58329 4.66625 4.83345 4.97823 5.0207 5.01816
- 5.01116 5.00595 5.00296 5.00148 5.00073 5.00062 5.00033
- 5.0003 4.99864 4.99661 4.99652 4.99928 5.00361 5.12573 5.17251
- 5.22612 5.33479 5.44503 5.44432 5.44379 5.44334 5.443 5.44276
- 5.44258 5.44246 5.44238 5.44232 5.44228 5.44225 5.44223
- 5.44221 5.4422 5.44219 5.44219 5.44218 5.44218 5.44218 5.44218
- 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217
- 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217
- 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44216
- 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216
- 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216
- 5.44216 5.44216 5.44216 5.44216 5.44215 5.44215 5.44215
- 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215
- 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215
- 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215
- 5.44214 5.44214 5.44214 5.44214 5.44214 5.44214 5.44214
- 5.44214 5.44214 5.44214 5.44214 5.44212 5.45159 5.45236
- 5.44064 5.44307 5.45616 5.38122 4.77163 3.53297 2.74466
- 2.34448 2.11802 1.9783 1.88656 1.82001 1.77389 1.72955 1.69632
- 1.66971 1.6526 1.65236 1.56034 1.53764 1.97139 2.75096 3.39212
- 3.74042 3.82345 3.85696 3.88547 3.91862 3.9585 4.00467 4.05903
- 4.1254 4.19533 4.26791 4.34517 4.42112 4.49238 4.55807 4.6179
- 4.6713 4.71815 4.75889 4.79418 4.82456 4.85062 4.87291 4.89196
- 4.90823 4.92209 4.93388 4.9439 4.95242 4.95968 4.96585 4.97108
- 4.9755 4.97923 4.98237 4.98503 4.98732 4.98927 4.99094 4.99233
- 4.99353 4.99452 4.99538 4.99608 4.99668 4.99718 4.9976 4.99794
- 4.99822 4.99847 4.99867 4.99884 4.99899 4.99913 4.99924
- 4.99932 4.99938 4.99943 4.99947 4.99951 4.99953 4.99955
- 4.99958 4.99961 4.99964 4.99967 4.99969 4.99972 4.99975
- 4.99977 4.99978 4.99979 4.99981 4.99982 4.99983 4.99985
- 4.99986 4.99986 4.99987 4.99987 4.99988 4.99988 4.99988
- 4.99989 4.99989 4.9999 4.9999 4.99991 4.99991 4.99992 4.99992
- 4.99993 4.99993 4.99993 4.99994 5.00381 5.00064 4.99246
- 4.99823 5.00349 5.00076 5.00033 5.00015 5.00009 5.00007
- 5.00005 5.00004 5.00003 5.00002 4.99988 4.99732 4.99728
- 4.9978 5.00187 5.00927 5.08712 5.07654 4.92855 4.4863 3.76162
- 3.00049 2.49834 2.20883 2.03492 1.92384 1.84676 1.79021
- 1.74716 1.7132 1.68576 1.66309 1.64406 1.62785 1.61383 1.60162
- 1.59081 1.58117 1.57253 1.56473 1.55765 1.55117 1.54527
- 1.53988 1.53485 1.53012 1.5257 1.5216 1.51773 1.51411 1.51071
- 1.50746 1.50438 1.50146 1.49868 1.49603 1.4935 1.49109 1.48878
- 1.48657 1.48445 1.48242 1.48046 1.47858 1.47677 1.47502
- 1.47333 1.4717 1.47012 1.46859 1.46711 1.46568 1.46428 1.46292
- 1.4616 1.46034 1.45923 1.45812 1.45701 1.4559 1.45479 1.45378
- 1.45279 1.45181 1.45082 1.44983 1.44893 1.44813 1.44732
- 1.44652 1.44571 1.44491 1.4441 1.4433 1.44249 1.44169 1.44089
- 1.44019 1.43951 1.43883 1.43815 1.43747 1.4368 1.43612 1.43544
- 1.43476 1.43408 1.43342 1.43283 1.43223 1.43163 1.43104
- 1.43044 1.42984 1.42924 1.42865
-}
-v39 set {
- 5 5.01048 5.01221 4.98887 4.76261 4.54943 4.51564 4.56249
- 4.62621 4.68843 4.74374 4.79044 4.82972 4.86127 4.88724
- 4.90862 4.90791 4.89858 4.89589 4.91767 5.00405 5.16956
- 5.12391 4.7557 3.87953 3.01124 2.48482 2.20424 2.03812 1.92679
- 1.84956 1.79256 1.74907 1.71487 1.68724 1.6644 1.64513 1.6287
- 1.61446 1.60197 1.59095 1.58117 1.57245 1.5646 1.55752 1.55109
- 1.54516 1.53958 1.53444 1.53008 1.52606 1.52205 1.51843
- 1.5149 1.51146 1.50893 1.50639 1.50387 1.50133 1.4988 1.49651
- 1.49436 1.49222 1.49007 1.48793 1.48585 1.48433 1.4828 1.48128
- 1.47975 1.47823 1.4767 1.47518 1.47365 1.47213 1.4706 1.46912
- 1.46795 1.46678 1.46561 1.46444 1.46327 1.4621 1.46093 1.45976
- 1.45859 1.45741 1.45628 1.45534 1.45441 1.45347 1.45254
- 1.4516 1.45067 1.44973 1.4488 1.44786 1.44693 1.44604 1.44539
- 1.44475 1.4441 1.44345 1.44281 1.44216 1.44151 1.44086 1.44022
- 1.43957 1.43892 1.43828 1.43763 1.43698 1.43633 1.43569
- 1.43504 1.43439 1.43375 1.4331 1.43245 1.4318 1.43157 1.43089
- 1.43001 1.43042 1.42899 1.42439 1.42216 1.43447 1.44048
- 1.43705 1.43314 1.43039 1.42861 1.42739 1.42651 1.42548
- 1.42488 1.4243 1.42392 1.4235 1.32443 1.31149 1.78169 2.64844
- 3.43211 3.95252 4.20231 4.3746 4.49948 4.58929 4.65742 4.71183
- 4.77057 4.83196 4.88354 4.92894 4.96625 4.99235 5.00651
- 5.00941 5.00813 5.00689 5.00588 5.00504 5.00431 5.00368
- 5.00314 5.00268 5.00228 5.00194 5.00165 5.0014 5.00118 5.001
- 5.00085 5.00072 5.00061 5.00052 5.00044 5.00037 5.00031
- 5.00027 5.00022 5.00019 5.00016 5.00013 5.00011 5.00009
- 5.00008 5.00007 5.00006 5.00005 5.00004 5.00003 5.00003
- 5.00003 5.00002 5.00002 5.00002 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99998
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5.00001
- 5.00002 5.00003 5.00004 5.00022 4.99974 4.99942 4.99997
- 5.00063 5.00002 5.00003 4.99994 4.99998 4.99999 5 5 5 5
- 5 4.99981 4.99998 5.00004 5.00036 5.00049 5.12012 5.16315
- 5.19712 5.21835 4.87874 4.10151 3.31555 2.74207 2.38075
- 2.15872 2.01614 1.91886 1.84852 1.79401 1.75052 1.71508
- 1.68672 1.66467 1.64602 1.62985 1.61576 1.60343 1.59256
- 1.58287 1.57418 1.56632 1.55922 1.55282 1.54687 1.54132
- 1.53618 1.53143 1.52698 1.52282 1.51895 1.51527 1.5118 1.50851
- 1.5054 1.50244 1.49963 1.49695 1.4944 1.49196 1.48963 1.4874
- 1.48527 1.48322 1.48124 1.47934 1.47751 1.47574 1.47403
- 1.47239 1.4708 1.46926 1.46777 1.46632 1.46491 1.46355 1.46237
- 1.4612 1.46002 1.45884 1.45766 1.45659 1.45555 1.45451 1.45346
- 1.45242 1.45147 1.45062 1.44978 1.44894 1.44809 1.44725
- 1.4464 1.44556 1.44472 1.44387 1.44303 1.4423 1.44159 1.44088
- 1.44017 1.43947 1.43876 1.43805 1.43734 1.43664 1.43593
- 1.43524 1.43462 1.434 1.43338 1.43276 1.43213 1.43151 1.43089
- 1.43027
-}
-
-set attributes {
- V1 v1 red red
- V2 v2 green red
- V3 v3 blue red
- V4 v4 yellow red
- V5 v5 magenta red
- V6 v6 cyan red
- V7 v7 white red
- V8 v8 red green
- V9 v9 green green
- V10 v10 blue green
- V11 v11 yellow green
- V12 v12 magenta green
- V13 v13 cyan green
- V14 v14 red red
- V15 v15 green red
- V16 v16 blue red
- V17 v17 yellow red
- V18 v18 magenta red
- V19 v19 cyan red
- V20 v20 white red
- V21 v21 red green
- V22 v22 green green
- V23 v23 blue green
- V24 v24 yellow green
- V25 v25 magenta green
- V26 v26 cyan green
- V27 v27 red red
- V28 v28 green red
- V29 v29 blue red
- V30 v30 yellow red
- V31 v31 magenta red
- V32 v32 cyan red
- V33 v33 white red
- V34 v34 red green
- V35 v35 green green
- V36 v36 blue green
- V37 v37 yellow green
- V38 v38 magenta green
- V39 v39 cyan green
-}
-
-text .header -wrap word -width 0 -height 6
-
-set text {
-To zoom in on a region of the graph, simply click once on the left
-mouse button to pick one corner of the area to be zoomed. Move the
-mouse to the other corner and click again.
-}
-
-regsub -all "\n" $text "" text
-.header insert end "$text\n"
-.header insert end { You can click on the }
-set im [image create picture -file ./images/qv100.t.gif]
-button .header.snap -image $im -command { MakeSnapshot }
-.header window create end -window .header.snap
-.header insert end { button to see a picture image snapshot.}
-.header configure -state disabled
-blt::graph $graph
-
-blt::htext .footer -text {Hit the %%
- set im [image create picture -file ./images/stopsign.gif]
- button $htext(widget).quit -image $im -command { exit }
- $htext(widget) append $htext(widget).quit
-%% button when you've seen enough. %%
- label $htext(widget).logo -bitmap BLT
- $htext(widget) append $htext(widget).logo
-%%}
-
-foreach {label yData outline color} $attributes {
- .graph element create $label -x x -y $yData -outline $outline -color $color
-}
-
-set unique 0
-
-proc Sharpen { photo } {
- set kernel { -1 -1 -1 -1 16 -1 -1 -1 -1 }
- #set kernel { 0 -1 0 -1 4.9 -1 0 -1 0 }
- blt::winop convolve $photo $photo $kernel
-}
-
-proc MakeSnapshot {} {
- update idletasks
- global unique
- set top ".snapshot[incr unique]"
- set im1 [image create picture]
- .graph snap $im1
- set width 410
- set height 293
- set thumb1 [image create picture -width $width -height $height -gamma 2.2]
- $thumb1 resize $im1 -filter sinc
- image delete $im1
-
- set thumb2 [image create picture -window .graph -width $width \
- -height $height -filter sinc -gamma 2.2 -aspect yes]
-
- toplevel $top
- wm title $top "Snapshot \#$unique of \"[.graph cget -title]\""
- label $top.l1 -image $thumb1
- label $top.l2 -image $thumb2
-
- button $top.but -text "Dismiss" -command "DestroySnapshot $top"
- blt::table $top \
- 0,0 $top.l1 \
- 0,1 $top.l2 \
- 1,0 $top.but -pady 4
- focus $top.but
-}
-
-proc DestroySnapshot { win } {
- set im [$win.l1 cget -image]
- $im export jpg -file test.jpg
- image delete $im
- destroy $win
-}
-
-blt::table . \
- .header 0,0 -fill x \
- .graph 1,0 -fill both \
- .footer 2,0 -fill x
-
-blt::table configure . r0 r2 -resize none
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
-Blt_PrintKey $graph
-
-$graph element bind all <Enter> {
- %W legend activate [%W element get current]
-}
-
-$graph element bind all <Leave> {
- %W legend deactivate [%W element get current]
-}
-
-set table [blt::datatable create]
-$table column extend "x"
-$table import vector "x" 1
-$table column type "x" double
-set col 1
-foreach vector [lsort -dictionary [blt::vector names ::v*]] {
- set name [string trim $vector ::]
- $table column extend $name
- $table column type $name double
- incr col
- $table import vector $vector $col
-}
-
-$table dump -file graph4.tab
diff --git a/blt3.0.1/demos/graph4a.tab b/blt3.0.1/demos/graph4a.tab
deleted file mode 100644
index 91a68ea..0000000
--- a/blt3.0.1/demos/graph4a.tab
+++ /dev/null
@@ -1,14842 +0,0 @@
-i 361 40 0 0
-c 1 x double {}
-c 2 v1 double {}
-c 3 v2 double {}
-c 4 v3 double {}
-c 5 v4 double {}
-c 6 v5 double {}
-c 7 v6 double {}
-c 8 v7 double {}
-c 9 v8 double {}
-c 10 v9 double {}
-c 11 v10 double {}
-c 12 v11 double {}
-c 13 v12 double {}
-c 14 v13 double {}
-c 15 v14 double {}
-c 16 v15 double {}
-c 17 v16 double {}
-c 18 v17 double {}
-c 19 v18 double {}
-c 20 v19 double {}
-c 21 v20 double {}
-c 22 v21 double {}
-c 23 v22 double {}
-c 24 v23 double {}
-c 25 v24 double {}
-c 26 v25 double {}
-c 27 v26 double {}
-c 28 v27 double {}
-c 29 v28 double {}
-c 30 v29 double {}
-c 31 v30 double {}
-c 32 v31 double {}
-c 33 v32 double {}
-c 34 v33 double {}
-c 35 v34 double {}
-c 36 v35 double {}
-c 37 v36 double {}
-c 38 v37 double {}
-c 39 v38 double {}
-c 40 v39 double {}
-r 1 r1 {}
-r 2 r2 {}
-r 3 r3 {}
-r 4 r4 {}
-r 5 r5 {}
-r 6 r6 {}
-r 7 r7 {}
-r 8 r8 {}
-r 9 r9 {}
-r 10 r10 {}
-r 11 r11 {}
-r 12 r12 {}
-r 13 r13 {}
-r 14 r14 {}
-r 15 r15 {}
-r 16 r16 {}
-r 17 r17 {}
-r 18 r18 {}
-r 19 r19 {}
-r 20 r20 {}
-r 21 r21 {}
-r 22 r22 {}
-r 23 r23 {}
-r 24 r24 {}
-r 25 r25 {}
-r 26 r26 {}
-r 27 r27 {}
-r 28 r28 {}
-r 29 r29 {}
-r 30 r30 {}
-r 31 r31 {}
-r 32 r32 {}
-r 33 r33 {}
-r 34 r34 {}
-r 35 r35 {}
-r 36 r36 {}
-r 37 r37 {}
-r 38 r38 {}
-r 39 r39 {}
-r 40 r40 {}
-r 41 r41 {}
-r 42 r42 {}
-r 43 r43 {}
-r 44 r44 {}
-r 45 r45 {}
-r 46 r46 {}
-r 47 r47 {}
-r 48 r48 {}
-r 49 r49 {}
-r 50 r50 {}
-r 51 r51 {}
-r 52 r52 {}
-r 53 r53 {}
-r 54 r54 {}
-r 55 r55 {}
-r 56 r56 {}
-r 57 r57 {}
-r 58 r58 {}
-r 59 r59 {}
-r 60 r60 {}
-r 61 r61 {}
-r 62 r62 {}
-r 63 r63 {}
-r 64 r64 {}
-r 65 r65 {}
-r 66 r66 {}
-r 67 r67 {}
-r 68 r68 {}
-r 69 r69 {}
-r 70 r70 {}
-r 71 r71 {}
-r 72 r72 {}
-r 73 r73 {}
-r 74 r74 {}
-r 75 r75 {}
-r 76 r76 {}
-r 77 r77 {}
-r 78 r78 {}
-r 79 r79 {}
-r 80 r80 {}
-r 81 r81 {}
-r 82 r82 {}
-r 83 r83 {}
-r 84 r84 {}
-r 85 r85 {}
-r 86 r86 {}
-r 87 r87 {}
-r 88 r88 {}
-r 89 r89 {}
-r 90 r90 {}
-r 91 r91 {}
-r 92 r92 {}
-r 93 r93 {}
-r 94 r94 {}
-r 95 r95 {}
-r 96 r96 {}
-r 97 r97 {}
-r 98 r98 {}
-r 99 r99 {}
-r 100 r100 {}
-r 101 r101 {}
-r 102 r102 {}
-r 103 r103 {}
-r 104 r104 {}
-r 105 r105 {}
-r 106 r106 {}
-r 107 r107 {}
-r 108 r108 {}
-r 109 r109 {}
-r 110 r110 {}
-r 111 r111 {}
-r 112 r112 {}
-r 113 r113 {}
-r 114 r114 {}
-r 115 r115 {}
-r 116 r116 {}
-r 117 r117 {}
-r 118 r118 {}
-r 119 r119 {}
-r 120 r120 {}
-r 121 r121 {}
-r 122 r122 {}
-r 123 r123 {}
-r 124 r124 {}
-r 125 r125 {}
-r 126 r126 {}
-r 127 r127 {}
-r 128 r128 {}
-r 129 r129 {}
-r 130 r130 {}
-r 131 r131 {}
-r 132 r132 {}
-r 133 r133 {}
-r 134 r134 {}
-r 135 r135 {}
-r 136 r136 {}
-r 137 r137 {}
-r 138 r138 {}
-r 139 r139 {}
-r 140 r140 {}
-r 141 r141 {}
-r 142 r142 {}
-r 143 r143 {}
-r 144 r144 {}
-r 145 r145 {}
-r 146 r146 {}
-r 147 r147 {}
-r 148 r148 {}
-r 149 r149 {}
-r 150 r150 {}
-r 151 r151 {}
-r 152 r152 {}
-r 153 r153 {}
-r 154 r154 {}
-r 155 r155 {}
-r 156 r156 {}
-r 157 r157 {}
-r 158 r158 {}
-r 159 r159 {}
-r 160 r160 {}
-r 161 r161 {}
-r 162 r162 {}
-r 163 r163 {}
-r 164 r164 {}
-r 165 r165 {}
-r 166 r166 {}
-r 167 r167 {}
-r 168 r168 {}
-r 169 r169 {}
-r 170 r170 {}
-r 171 r171 {}
-r 172 r172 {}
-r 173 r173 {}
-r 174 r174 {}
-r 175 r175 {}
-r 176 r176 {}
-r 177 r177 {}
-r 178 r178 {}
-r 179 r179 {}
-r 180 r180 {}
-r 181 r181 {}
-r 182 r182 {}
-r 183 r183 {}
-r 184 r184 {}
-r 185 r185 {}
-r 186 r186 {}
-r 187 r187 {}
-r 188 r188 {}
-r 189 r189 {}
-r 190 r190 {}
-r 191 r191 {}
-r 192 r192 {}
-r 193 r193 {}
-r 194 r194 {}
-r 195 r195 {}
-r 196 r196 {}
-r 197 r197 {}
-r 198 r198 {}
-r 199 r199 {}
-r 200 r200 {}
-r 201 r201 {}
-r 202 r202 {}
-r 203 r203 {}
-r 204 r204 {}
-r 205 r205 {}
-r 206 r206 {}
-r 207 r207 {}
-r 208 r208 {}
-r 209 r209 {}
-r 210 r210 {}
-r 211 r211 {}
-r 212 r212 {}
-r 213 r213 {}
-r 214 r214 {}
-r 215 r215 {}
-r 216 r216 {}
-r 217 r217 {}
-r 218 r218 {}
-r 219 r219 {}
-r 220 r220 {}
-r 221 r221 {}
-r 222 r222 {}
-r 223 r223 {}
-r 224 r224 {}
-r 225 r225 {}
-r 226 r226 {}
-r 227 r227 {}
-r 228 r228 {}
-r 229 r229 {}
-r 230 r230 {}
-r 231 r231 {}
-r 232 r232 {}
-r 233 r233 {}
-r 234 r234 {}
-r 235 r235 {}
-r 236 r236 {}
-r 237 r237 {}
-r 238 r238 {}
-r 239 r239 {}
-r 240 r240 {}
-r 241 r241 {}
-r 242 r242 {}
-r 243 r243 {}
-r 244 r244 {}
-r 245 r245 {}
-r 246 r246 {}
-r 247 r247 {}
-r 248 r248 {}
-r 249 r249 {}
-r 250 r250 {}
-r 251 r251 {}
-r 252 r252 {}
-r 253 r253 {}
-r 254 r254 {}
-r 255 r255 {}
-r 256 r256 {}
-r 257 r257 {}
-r 258 r258 {}
-r 259 r259 {}
-r 260 r260 {}
-r 261 r261 {}
-r 262 r262 {}
-r 263 r263 {}
-r 264 r264 {}
-r 265 r265 {}
-r 266 r266 {}
-r 267 r267 {}
-r 268 r268 {}
-r 269 r269 {}
-r 270 r270 {}
-r 271 r271 {}
-r 272 r272 {}
-r 273 r273 {}
-r 274 r274 {}
-r 275 r275 {}
-r 276 r276 {}
-r 277 r277 {}
-r 278 r278 {}
-r 279 r279 {}
-r 280 r280 {}
-r 281 r281 {}
-r 282 r282 {}
-r 283 r283 {}
-r 284 r284 {}
-r 285 r285 {}
-r 286 r286 {}
-r 287 r287 {}
-r 288 r288 {}
-r 289 r289 {}
-r 290 r290 {}
-r 291 r291 {}
-r 292 r292 {}
-r 293 r293 {}
-r 294 r294 {}
-r 295 r295 {}
-r 296 r296 {}
-r 297 r297 {}
-r 298 r298 {}
-r 299 r299 {}
-r 300 r300 {}
-r 301 r301 {}
-r 302 r302 {}
-r 303 r303 {}
-r 304 r304 {}
-r 305 r305 {}
-r 306 r306 {}
-r 307 r307 {}
-r 308 r308 {}
-r 309 r309 {}
-r 310 r310 {}
-r 311 r311 {}
-r 312 r312 {}
-r 313 r313 {}
-r 314 r314 {}
-r 315 r315 {}
-r 316 r316 {}
-r 317 r317 {}
-r 318 r318 {}
-r 319 r319 {}
-r 320 r320 {}
-r 321 r321 {}
-r 322 r322 {}
-r 323 r323 {}
-r 324 r324 {}
-r 325 r325 {}
-r 326 r326 {}
-r 327 r327 {}
-r 328 r328 {}
-r 329 r329 {}
-r 330 r330 {}
-r 331 r331 {}
-r 332 r332 {}
-r 333 r333 {}
-r 334 r334 {}
-r 335 r335 {}
-r 336 r336 {}
-r 337 r337 {}
-r 338 r338 {}
-r 339 r339 {}
-r 340 r340 {}
-r 341 r341 {}
-r 342 r342 {}
-r 343 r343 {}
-r 344 r344 {}
-r 345 r345 {}
-r 346 r346 {}
-r 347 r347 {}
-r 348 r348 {}
-r 349 r349 {}
-r 350 r350 {}
-r 351 r351 {}
-r 352 r352 {}
-r 353 r353 {}
-r 354 r354 {}
-r 355 r355 {}
-r 356 r356 {}
-r 357 r357 {}
-r 358 r358 {}
-r 359 r359 {}
-r 360 r360 {}
-r 361 r361 {}
-d 1 1 0.0
-d 2 1 1e-10
-d 3 1 2e-10
-d 4 1 3e-10
-d 5 1 4e-10
-d 6 1 5e-10
-d 7 1 6e-10
-d 8 1 7e-10
-d 9 1 8e-10
-d 10 1 9e-10
-d 11 1 1e-09
-d 12 1 1.1e-09
-d 13 1 1.2e-09
-d 14 1 1.3e-09
-d 15 1 1.4e-09
-d 16 1 1.5e-09
-d 17 1 1.6e-09
-d 18 1 1.7e-09
-d 19 1 1.8e-09
-d 20 1 1.9e-09
-d 21 1 2e-09
-d 22 1 2.1e-09
-d 23 1 2.2e-09
-d 24 1 2.3e-09
-d 25 1 2.4e-09
-d 26 1 2.5e-09
-d 27 1 2.6e-09
-d 28 1 2.7e-09
-d 29 1 2.8e-09
-d 30 1 2.9e-09
-d 31 1 3e-09
-d 32 1 3.1e-09
-d 33 1 3.2e-09
-d 34 1 3.3e-09
-d 35 1 3.4e-09
-d 36 1 3.5e-09
-d 37 1 3.6e-09
-d 38 1 3.7e-09
-d 39 1 3.8e-09
-d 40 1 3.9e-09
-d 41 1 4e-09
-d 42 1 4.1e-09
-d 43 1 4.2e-09
-d 44 1 4.3e-09
-d 45 1 4.4e-09
-d 46 1 4.5e-09
-d 47 1 4.6e-09
-d 48 1 4.7e-09
-d 49 1 4.8e-09
-d 50 1 4.9e-09
-d 51 1 5e-09
-d 52 1 5.1e-09
-d 53 1 5.2e-09
-d 54 1 5.3e-09
-d 55 1 5.4e-09
-d 56 1 5.5e-09
-d 57 1 5.6e-09
-d 58 1 5.7e-09
-d 59 1 5.8e-09
-d 60 1 5.9e-09
-d 61 1 6e-09
-d 62 1 6.1e-09
-d 63 1 6.2e-09
-d 64 1 6.3e-09
-d 65 1 6.4e-09
-d 66 1 6.5e-09
-d 67 1 6.6e-09
-d 68 1 6.7e-09
-d 69 1 6.8e-09
-d 70 1 6.9e-09
-d 71 1 7e-09
-d 72 1 7.1e-09
-d 73 1 7.2e-09
-d 74 1 7.3e-09
-d 75 1 7.4e-09
-d 76 1 7.5e-09
-d 77 1 7.6e-09
-d 78 1 7.7e-09
-d 79 1 7.8e-09
-d 80 1 7.9e-09
-d 81 1 8e-09
-d 82 1 8.1e-09
-d 83 1 8.2e-09
-d 84 1 8.3e-09
-d 85 1 8.4e-09
-d 86 1 8.5e-09
-d 87 1 8.6e-09
-d 88 1 8.7e-09
-d 89 1 8.8e-09
-d 90 1 8.9e-09
-d 91 1 9e-09
-d 92 1 9.1e-09
-d 93 1 9.2e-09
-d 94 1 9.3e-09
-d 95 1 9.4e-09
-d 96 1 9.5e-09
-d 97 1 9.6e-09
-d 98 1 9.7e-09
-d 99 1 9.8e-09
-d 100 1 9.9e-09
-d 101 1 1e-08
-d 102 1 1.01e-08
-d 103 1 1.02e-08
-d 104 1 1.03e-08
-d 105 1 1.04e-08
-d 106 1 1.05e-08
-d 107 1 1.06e-08
-d 108 1 1.07e-08
-d 109 1 1.08e-08
-d 110 1 1.09e-08
-d 111 1 1.1e-08
-d 112 1 1.11e-08
-d 113 1 1.12e-08
-d 114 1 1.13e-08
-d 115 1 1.14e-08
-d 116 1 1.15e-08
-d 117 1 1.16e-08
-d 118 1 1.17e-08
-d 119 1 1.18e-08
-d 120 1 1.19e-08
-d 121 1 1.2e-08
-d 122 1 1.21e-08
-d 123 1 1.22e-08
-d 124 1 1.23e-08
-d 125 1 1.24e-08
-d 126 1 1.25e-08
-d 127 1 1.26e-08
-d 128 1 1.27e-08
-d 129 1 1.28e-08
-d 130 1 1.29e-08
-d 131 1 1.3e-08
-d 132 1 1.31e-08
-d 133 1 1.32e-08
-d 134 1 1.33e-08
-d 135 1 1.34e-08
-d 136 1 1.35e-08
-d 137 1 1.36e-08
-d 138 1 1.37e-08
-d 139 1 1.38e-08
-d 140 1 1.39e-08
-d 141 1 1.4e-08
-d 142 1 1.41e-08
-d 143 1 1.42e-08
-d 144 1 1.43e-08
-d 145 1 1.44e-08
-d 146 1 1.45e-08
-d 147 1 1.46e-08
-d 148 1 1.47e-08
-d 149 1 1.48e-08
-d 150 1 1.49e-08
-d 151 1 1.5e-08
-d 152 1 1.51e-08
-d 153 1 1.52e-08
-d 154 1 1.53e-08
-d 155 1 1.54e-08
-d 156 1 1.55e-08
-d 157 1 1.56e-08
-d 158 1 1.57e-08
-d 159 1 1.58e-08
-d 160 1 1.59e-08
-d 161 1 1.6e-08
-d 162 1 1.61e-08
-d 163 1 1.62e-08
-d 164 1 1.63e-08
-d 165 1 1.64e-08
-d 166 1 1.65e-08
-d 167 1 1.66e-08
-d 168 1 1.67e-08
-d 169 1 1.68e-08
-d 170 1 1.69e-08
-d 171 1 1.7e-08
-d 172 1 1.71e-08
-d 173 1 1.72e-08
-d 174 1 1.73e-08
-d 175 1 1.74e-08
-d 176 1 1.75e-08
-d 177 1 1.76e-08
-d 178 1 1.77e-08
-d 179 1 1.78e-08
-d 180 1 1.79e-08
-d 181 1 1.8e-08
-d 182 1 1.81e-08
-d 183 1 1.82e-08
-d 184 1 1.83e-08
-d 185 1 1.84e-08
-d 186 1 1.85e-08
-d 187 1 1.86e-08
-d 188 1 1.87e-08
-d 189 1 1.88e-08
-d 190 1 1.89e-08
-d 191 1 1.9e-08
-d 192 1 1.91e-08
-d 193 1 1.92e-08
-d 194 1 1.93e-08
-d 195 1 1.94e-08
-d 196 1 1.95e-08
-d 197 1 1.96e-08
-d 198 1 1.97e-08
-d 199 1 1.98e-08
-d 200 1 1.99e-08
-d 201 1 2e-08
-d 202 1 2.01e-08
-d 203 1 2.02e-08
-d 204 1 2.03e-08
-d 205 1 2.04e-08
-d 206 1 2.05e-08
-d 207 1 2.06e-08
-d 208 1 2.07e-08
-d 209 1 2.08e-08
-d 210 1 2.09e-08
-d 211 1 2.1e-08
-d 212 1 2.11e-08
-d 213 1 2.12e-08
-d 214 1 2.13e-08
-d 215 1 2.14e-08
-d 216 1 2.15e-08
-d 217 1 2.16e-08
-d 218 1 2.17e-08
-d 219 1 2.18e-08
-d 220 1 2.19e-08
-d 221 1 2.2e-08
-d 222 1 2.21e-08
-d 223 1 2.22e-08
-d 224 1 2.23e-08
-d 225 1 2.24e-08
-d 226 1 2.25e-08
-d 227 1 2.26e-08
-d 228 1 2.27e-08
-d 229 1 2.28e-08
-d 230 1 2.29e-08
-d 231 1 2.3e-08
-d 232 1 2.31e-08
-d 233 1 2.32e-08
-d 234 1 2.33e-08
-d 235 1 2.34e-08
-d 236 1 2.35e-08
-d 237 1 2.36e-08
-d 238 1 2.37e-08
-d 239 1 2.38e-08
-d 240 1 2.39e-08
-d 241 1 2.4e-08
-d 242 1 2.41e-08
-d 243 1 2.42e-08
-d 244 1 2.43e-08
-d 245 1 2.44e-08
-d 246 1 2.45e-08
-d 247 1 2.46e-08
-d 248 1 2.47e-08
-d 249 1 2.48e-08
-d 250 1 2.49e-08
-d 251 1 2.5e-08
-d 252 1 2.51e-08
-d 253 1 2.52e-08
-d 254 1 2.53e-08
-d 255 1 2.54e-08
-d 256 1 2.55e-08
-d 257 1 2.56e-08
-d 258 1 2.57e-08
-d 259 1 2.58e-08
-d 260 1 2.59e-08
-d 261 1 2.6e-08
-d 262 1 2.61e-08
-d 263 1 2.62e-08
-d 264 1 2.63e-08
-d 265 1 2.64e-08
-d 266 1 2.65e-08
-d 267 1 2.66e-08
-d 268 1 2.67e-08
-d 269 1 2.68e-08
-d 270 1 2.69e-08
-d 271 1 2.7e-08
-d 272 1 2.71e-08
-d 273 1 2.72e-08
-d 274 1 2.73e-08
-d 275 1 2.74e-08
-d 276 1 2.75e-08
-d 277 1 2.76e-08
-d 278 1 2.77e-08
-d 279 1 2.78e-08
-d 280 1 2.79e-08
-d 281 1 2.8e-08
-d 282 1 2.81e-08
-d 283 1 2.82e-08
-d 284 1 2.83e-08
-d 285 1 2.84e-08
-d 286 1 2.85e-08
-d 287 1 2.86e-08
-d 288 1 2.87e-08
-d 289 1 2.88e-08
-d 290 1 2.89e-08
-d 291 1 2.9e-08
-d 292 1 2.91e-08
-d 293 1 2.92e-08
-d 294 1 2.93e-08
-d 295 1 2.94e-08
-d 296 1 2.95e-08
-d 297 1 2.96e-08
-d 298 1 2.97e-08
-d 299 1 2.98e-08
-d 300 1 2.99e-08
-d 301 1 3e-08
-d 302 1 3.01e-08
-d 303 1 3.02e-08
-d 304 1 3.03e-08
-d 305 1 3.04e-08
-d 306 1 3.05e-08
-d 307 1 3.06e-08
-d 308 1 3.07e-08
-d 309 1 3.08e-08
-d 310 1 3.09e-08
-d 311 1 3.1e-08
-d 312 1 3.11e-08
-d 313 1 3.12e-08
-d 314 1 3.13e-08
-d 315 1 3.14e-08
-d 316 1 3.15e-08
-d 317 1 3.16e-08
-d 318 1 3.17e-08
-d 319 1 3.18e-08
-d 320 1 3.19e-08
-d 321 1 3.2e-08
-d 322 1 3.21e-08
-d 323 1 3.22e-08
-d 324 1 3.23e-08
-d 325 1 3.24e-08
-d 326 1 3.25e-08
-d 327 1 3.26e-08
-d 328 1 3.27e-08
-d 329 1 3.28e-08
-d 330 1 3.29e-08
-d 331 1 3.3e-08
-d 332 1 3.31e-08
-d 333 1 3.32e-08
-d 334 1 3.33e-08
-d 335 1 3.34e-08
-d 336 1 3.35e-08
-d 337 1 3.36e-08
-d 338 1 3.37e-08
-d 339 1 3.38e-08
-d 340 1 3.39e-08
-d 341 1 3.4e-08
-d 342 1 3.41e-08
-d 343 1 3.42e-08
-d 344 1 3.43e-08
-d 345 1 3.44e-08
-d 346 1 3.45e-08
-d 347 1 3.46e-08
-d 348 1 3.47e-08
-d 349 1 3.48e-08
-d 350 1 3.49e-08
-d 351 1 3.5e-08
-d 352 1 3.51e-08
-d 353 1 3.52e-08
-d 354 1 3.53e-08
-d 355 1 3.54e-08
-d 356 1 3.55e-08
-d 357 1 3.56e-08
-d 358 1 3.57e-08
-d 359 1 3.58e-08
-d 360 1 3.59e-08
-d 361 1 3.6e-08
-d 1 2 5.0
-d 2 2 5.0
-d 3 2 5.0
-d 4 2 5.0
-d 5 2 5.0
-d 6 2 5.0
-d 7 2 5.0
-d 8 2 5.0
-d 9 2 5.0
-d 10 2 5.0
-d 11 2 5.0
-d 12 2 5.0
-d 13 2 5.0
-d 14 2 5.0
-d 15 2 5.0
-d 16 2 5.0
-d 17 2 5.0
-d 18 2 5.0
-d 19 2 5.0
-d 20 2 5.0
-d 21 2 5.0
-d 22 2 5.0
-d 23 2 5.0
-d 24 2 5.0
-d 25 2 5.0
-d 26 2 5.0
-d 27 2 5.0
-d 28 2 5.0
-d 29 2 5.0
-d 30 2 5.0
-d 31 2 5.0
-d 32 2 5.0
-d 33 2 5.0
-d 34 2 5.0
-d 35 2 5.0
-d 36 2 5.0
-d 37 2 5.0
-d 38 2 5.0
-d 39 2 5.0
-d 40 2 5.0
-d 41 2 5.0
-d 42 2 5.0
-d 43 2 5.0
-d 44 2 5.0
-d 45 2 5.0
-d 46 2 5.0
-d 47 2 5.0
-d 48 2 5.0
-d 49 2 5.0
-d 50 2 5.0
-d 51 2 5.0
-d 52 2 5.0
-d 53 2 5.0
-d 54 2 5.0
-d 55 2 5.0
-d 56 2 5.0
-d 57 2 5.0
-d 58 2 5.0
-d 59 2 5.0
-d 60 2 5.0
-d 61 2 5.0
-d 62 2 5.0
-d 63 2 5.0
-d 64 2 5.0
-d 65 2 5.0
-d 66 2 5.0
-d 67 2 5.0
-d 68 2 5.0
-d 69 2 5.0
-d 70 2 5.0
-d 71 2 5.0
-d 72 2 5.0
-d 73 2 5.0
-d 74 2 5.0
-d 75 2 5.0
-d 76 2 5.0
-d 77 2 5.0
-d 78 2 5.0
-d 79 2 5.0
-d 80 2 5.0
-d 81 2 5.0
-d 82 2 5.0
-d 83 2 5.0
-d 84 2 5.0
-d 85 2 5.0
-d 86 2 5.0
-d 87 2 5.0
-d 88 2 5.0
-d 89 2 5.0
-d 90 2 5.0
-d 91 2 5.0
-d 92 2 5.0
-d 93 2 5.0
-d 94 2 5.0
-d 95 2 5.0
-d 96 2 5.0
-d 97 2 5.0
-d 98 2 5.0
-d 99 2 5.0
-d 100 2 5.0
-d 101 2 5.0
-d 102 2 5.0
-d 103 2 5.0
-d 104 2 5.0
-d 105 2 5.0
-d 106 2 5.0
-d 107 2 5.0
-d 108 2 5.0
-d 109 2 5.0
-d 110 2 5.0
-d 111 2 5.0
-d 112 2 5.0
-d 113 2 5.0
-d 114 2 5.0
-d 115 2 5.0
-d 116 2 5.0
-d 117 2 5.0
-d 118 2 5.0
-d 119 2 5.0
-d 120 2 5.0
-d 121 2 5.0
-d 122 2 5.0
-d 123 2 5.0
-d 124 2 5.0
-d 125 2 5.0
-d 126 2 5.0
-d 127 2 5.0
-d 128 2 5.0
-d 129 2 5.0
-d 130 2 5.0
-d 131 2 5.0
-d 132 2 5.0
-d 133 2 5.0
-d 134 2 5.0
-d 135 2 5.0
-d 136 2 5.0
-d 137 2 5.0
-d 138 2 5.0
-d 139 2 5.0
-d 140 2 5.0
-d 141 2 5.0
-d 142 2 5.0
-d 143 2 5.0
-d 144 2 5.0
-d 145 2 5.0
-d 146 2 5.0
-d 147 2 5.0
-d 148 2 5.0
-d 149 2 5.0
-d 150 2 5.0
-d 151 2 5.0
-d 152 2 5.0
-d 153 2 5.0
-d 154 2 5.0
-d 155 2 5.0
-d 156 2 5.0
-d 157 2 5.0
-d 158 2 5.0
-d 159 2 5.0
-d 160 2 5.0
-d 161 2 5.0
-d 162 2 5.0
-d 163 2 5.0
-d 164 2 5.0
-d 165 2 5.0
-d 166 2 5.0
-d 167 2 5.0
-d 168 2 5.0
-d 169 2 5.0
-d 170 2 5.0
-d 171 2 5.0
-d 172 2 5.0
-d 173 2 5.0
-d 174 2 5.0
-d 175 2 5.0
-d 176 2 5.0
-d 177 2 5.0
-d 178 2 5.0
-d 179 2 5.0
-d 180 2 5.0
-d 181 2 5.0
-d 182 2 5.0
-d 183 2 5.0
-d 184 2 5.0
-d 185 2 5.0
-d 186 2 5.0
-d 187 2 5.0
-d 188 2 5.0
-d 189 2 5.0
-d 190 2 5.0
-d 191 2 5.0
-d 192 2 5.0
-d 193 2 5.0
-d 194 2 5.0
-d 195 2 5.0
-d 196 2 5.0
-d 197 2 5.0
-d 198 2 5.0
-d 199 2 5.0
-d 200 2 5.0
-d 201 2 5.0
-d 202 2 5.0
-d 203 2 5.0
-d 204 2 5.0
-d 205 2 5.0
-d 206 2 5.0
-d 207 2 5.0
-d 208 2 5.0
-d 209 2 5.0
-d 210 2 5.0
-d 211 2 5.0
-d 212 2 5.0
-d 213 2 5.0
-d 214 2 5.0
-d 215 2 5.0
-d 216 2 5.0
-d 217 2 5.0
-d 218 2 5.0
-d 219 2 5.0
-d 220 2 5.0
-d 221 2 5.0
-d 222 2 5.0
-d 223 2 5.0
-d 224 2 5.0
-d 225 2 5.0
-d 226 2 5.0
-d 227 2 5.0
-d 228 2 5.0
-d 229 2 5.0
-d 230 2 5.0
-d 231 2 5.0
-d 232 2 5.0
-d 233 2 5.0
-d 234 2 5.0
-d 235 2 5.0
-d 236 2 5.0
-d 237 2 5.0
-d 238 2 5.0
-d 239 2 5.0
-d 240 2 5.0
-d 241 2 5.0
-d 242 2 5.0
-d 243 2 5.0
-d 244 2 5.0
-d 245 2 5.0
-d 246 2 5.0
-d 247 2 5.0
-d 248 2 5.0
-d 249 2 5.0
-d 250 2 5.0
-d 251 2 5.0
-d 252 2 5.0
-d 253 2 5.0
-d 254 2 5.0
-d 255 2 5.0
-d 256 2 5.0
-d 257 2 5.0
-d 258 2 5.0
-d 259 2 5.0
-d 260 2 5.0
-d 261 2 5.0
-d 262 2 5.0
-d 263 2 5.0
-d 264 2 5.0
-d 265 2 5.0
-d 266 2 5.0
-d 267 2 5.0
-d 268 2 5.0
-d 269 2 5.0
-d 270 2 5.0
-d 271 2 5.0
-d 272 2 5.0
-d 273 2 5.0
-d 274 2 5.0
-d 275 2 5.0
-d 276 2 5.0
-d 277 2 5.0
-d 278 2 5.0
-d 279 2 5.0
-d 280 2 5.0
-d 281 2 5.0
-d 282 2 5.0
-d 283 2 5.0
-d 284 2 5.0
-d 285 2 5.0
-d 286 2 5.0
-d 287 2 5.0
-d 288 2 5.0
-d 289 2 5.0
-d 290 2 5.0
-d 291 2 5.0
-d 292 2 5.0
-d 293 2 5.0
-d 294 2 5.0
-d 295 2 5.0
-d 296 2 5.0
-d 297 2 5.0
-d 298 2 5.0
-d 299 2 5.0
-d 300 2 5.0
-d 301 2 5.0
-d 302 2 5.0
-d 303 2 5.0
-d 304 2 5.0
-d 305 2 5.0
-d 306 2 5.0
-d 307 2 5.0
-d 308 2 5.0
-d 309 2 5.0
-d 310 2 5.0
-d 311 2 5.0
-d 312 2 5.0
-d 313 2 5.0
-d 314 2 5.0
-d 315 2 5.0
-d 316 2 5.0
-d 317 2 5.0
-d 318 2 5.0
-d 319 2 5.0
-d 320 2 5.0
-d 321 2 5.0
-d 322 2 5.0
-d 323 2 5.0
-d 324 2 5.0
-d 325 2 5.0
-d 326 2 5.0
-d 327 2 5.0
-d 328 2 5.0
-d 329 2 5.0
-d 330 2 5.0
-d 331 2 5.0
-d 332 2 5.0
-d 333 2 5.0
-d 334 2 5.0
-d 335 2 5.0
-d 336 2 5.0
-d 337 2 5.0
-d 338 2 5.0
-d 339 2 5.0
-d 340 2 5.0
-d 341 2 5.0
-d 342 2 5.0
-d 343 2 5.0
-d 344 2 5.0
-d 345 2 5.0
-d 346 2 5.0
-d 347 2 5.0
-d 348 2 5.0
-d 349 2 5.0
-d 350 2 5.0
-d 351 2 5.0
-d 352 2 5.0
-d 353 2 5.0
-d 354 2 5.0
-d 355 2 5.0
-d 356 2 5.0
-d 357 2 5.0
-d 358 2 5.0
-d 359 2 5.0
-d 360 2 5.0
-d 361 2 5.0
-d 1 3 0.0
-d 2 3 1.0
-d 3 3 2.0
-d 4 3 3.0
-d 5 3 4.0
-d 6 3 5.0
-d 7 3 5.0
-d 8 3 5.0
-d 9 3 5.0
-d 10 3 5.0
-d 11 3 5.0
-d 12 3 5.0
-d 13 3 5.0
-d 14 3 5.0
-d 15 3 5.0
-d 16 3 5.0
-d 17 3 4.0
-d 18 3 3.0
-d 19 3 2.0
-d 20 3 1.0
-d 21 3 0.0
-d 22 3 0.0
-d 23 3 0.0
-d 24 3 0.0
-d 25 3 0.0
-d 26 3 0.0
-d 27 3 0.0
-d 28 3 0.0
-d 29 3 0.0
-d 30 3 0.0
-d 31 3 0.0
-d 32 3 0.0
-d 33 3 0.0
-d 34 3 0.0
-d 35 3 0.0
-d 36 3 0.0
-d 37 3 0.0
-d 38 3 0.0
-d 39 3 0.0
-d 40 3 0.0
-d 41 3 0.0
-d 42 3 0.0
-d 43 3 0.0
-d 44 3 0.0
-d 45 3 0.0
-d 46 3 0.0
-d 47 3 0.0
-d 48 3 0.0
-d 49 3 0.0
-d 50 3 0.0
-d 51 3 0.0
-d 52 3 0.0
-d 53 3 0.0
-d 54 3 0.0
-d 55 3 0.0
-d 56 3 0.0
-d 57 3 0.0
-d 58 3 0.0
-d 59 3 0.0
-d 60 3 0.0
-d 61 3 0.0
-d 62 3 0.0
-d 63 3 0.0
-d 64 3 0.0
-d 65 3 0.0
-d 66 3 0.0
-d 67 3 0.0
-d 68 3 0.0
-d 69 3 0.0
-d 70 3 0.0
-d 71 3 0.0
-d 72 3 0.0
-d 73 3 0.0
-d 74 3 0.0
-d 75 3 0.0
-d 76 3 0.0
-d 77 3 0.0
-d 78 3 0.0
-d 79 3 0.0
-d 80 3 0.0
-d 81 3 0.0
-d 82 3 0.0
-d 83 3 0.0
-d 84 3 0.0
-d 85 3 0.0
-d 86 3 0.0
-d 87 3 0.0
-d 88 3 0.0
-d 89 3 0.0
-d 90 3 0.0
-d 91 3 0.0
-d 92 3 0.0
-d 93 3 0.0
-d 94 3 0.0
-d 95 3 0.0
-d 96 3 0.0
-d 97 3 0.0
-d 98 3 0.0
-d 99 3 0.0
-d 100 3 0.0
-d 101 3 0.0
-d 102 3 0.0
-d 103 3 0.0
-d 104 3 0.0
-d 105 3 0.0
-d 106 3 0.0
-d 107 3 0.0
-d 108 3 0.0
-d 109 3 0.0
-d 110 3 0.0
-d 111 3 0.0
-d 112 3 0.0
-d 113 3 0.0
-d 114 3 0.0
-d 115 3 0.0
-d 116 3 0.0
-d 117 3 0.0
-d 118 3 0.0
-d 119 3 0.0
-d 120 3 0.0
-d 121 3 0.0
-d 122 3 1.0
-d 123 3 2.0
-d 124 3 3.0
-d 125 3 4.0
-d 126 3 5.0
-d 127 3 5.0
-d 128 3 5.0
-d 129 3 5.0
-d 130 3 5.0
-d 131 3 5.0
-d 132 3 5.0
-d 133 3 5.0
-d 134 3 5.0
-d 135 3 5.0
-d 136 3 5.0
-d 137 3 4.0
-d 138 3 3.0
-d 139 3 2.0
-d 140 3 1.0
-d 141 3 5.32907e-15
-d 142 3 0.0
-d 143 3 0.0
-d 144 3 0.0
-d 145 3 0.0
-d 146 3 0.0
-d 147 3 0.0
-d 148 3 0.0
-d 149 3 0.0
-d 150 3 0.0
-d 151 3 0.0
-d 152 3 0.0
-d 153 3 0.0
-d 154 3 0.0
-d 155 3 0.0
-d 156 3 0.0
-d 157 3 0.0
-d 158 3 0.0
-d 159 3 0.0
-d 160 3 0.0
-d 161 3 0.0
-d 162 3 0.0
-d 163 3 0.0
-d 164 3 0.0
-d 165 3 0.0
-d 166 3 0.0
-d 167 3 0.0
-d 168 3 0.0
-d 169 3 0.0
-d 170 3 0.0
-d 171 3 0.0
-d 172 3 0.0
-d 173 3 0.0
-d 174 3 0.0
-d 175 3 0.0
-d 176 3 0.0
-d 177 3 0.0
-d 178 3 0.0
-d 179 3 0.0
-d 180 3 0.0
-d 181 3 0.0
-d 182 3 0.0
-d 183 3 0.0
-d 184 3 0.0
-d 185 3 0.0
-d 186 3 0.0
-d 187 3 0.0
-d 188 3 0.0
-d 189 3 0.0
-d 190 3 0.0
-d 191 3 0.0
-d 192 3 0.0
-d 193 3 0.0
-d 194 3 0.0
-d 195 3 0.0
-d 196 3 0.0
-d 197 3 0.0
-d 198 3 0.0
-d 199 3 0.0
-d 200 3 0.0
-d 201 3 0.0
-d 202 3 0.0
-d 203 3 0.0
-d 204 3 0.0
-d 205 3 0.0
-d 206 3 0.0
-d 207 3 0.0
-d 208 3 0.0
-d 209 3 0.0
-d 210 3 0.0
-d 211 3 0.0
-d 212 3 0.0
-d 213 3 0.0
-d 214 3 0.0
-d 215 3 0.0
-d 216 3 0.0
-d 217 3 0.0
-d 218 3 0.0
-d 219 3 0.0
-d 220 3 0.0
-d 221 3 0.0
-d 222 3 0.0
-d 223 3 0.0
-d 224 3 0.0
-d 225 3 0.0
-d 226 3 0.0
-d 227 3 0.0
-d 228 3 0.0
-d 229 3 0.0
-d 230 3 0.0
-d 231 3 0.0
-d 232 3 0.0
-d 233 3 0.0
-d 234 3 0.0
-d 235 3 0.0
-d 236 3 0.0
-d 237 3 0.0
-d 238 3 0.0
-d 239 3 0.0
-d 240 3 0.0
-d 241 3 0.0
-d 242 3 1.0
-d 243 3 2.0
-d 244 3 3.0
-d 245 3 4.0
-d 246 3 5.0
-d 247 3 5.0
-d 248 3 5.0
-d 249 3 5.0
-d 250 3 5.0
-d 251 3 5.0
-d 252 3 5.0
-d 253 3 5.0
-d 254 3 5.0
-d 255 3 5.0
-d 256 3 5.0
-d 257 3 4.0
-d 258 3 3.0
-d 259 3 2.0
-d 260 3 1.0
-d 261 3 0.0
-d 262 3 0.0
-d 263 3 0.0
-d 264 3 0.0
-d 265 3 0.0
-d 266 3 0.0
-d 267 3 0.0
-d 268 3 0.0
-d 269 3 0.0
-d 270 3 0.0
-d 271 3 0.0
-d 272 3 0.0
-d 273 3 0.0
-d 274 3 0.0
-d 275 3 0.0
-d 276 3 0.0
-d 277 3 0.0
-d 278 3 0.0
-d 279 3 0.0
-d 280 3 0.0
-d 281 3 0.0
-d 282 3 0.0
-d 283 3 0.0
-d 284 3 0.0
-d 285 3 0.0
-d 286 3 0.0
-d 287 3 0.0
-d 288 3 0.0
-d 289 3 0.0
-d 290 3 0.0
-d 291 3 0.0
-d 292 3 0.0
-d 293 3 0.0
-d 294 3 0.0
-d 295 3 0.0
-d 296 3 0.0
-d 297 3 0.0
-d 298 3 0.0
-d 299 3 0.0
-d 300 3 0.0
-d 301 3 0.0
-d 302 3 0.0
-d 303 3 0.0
-d 304 3 0.0
-d 305 3 0.0
-d 306 3 0.0
-d 307 3 0.0
-d 308 3 0.0
-d 309 3 0.0
-d 310 3 0.0
-d 311 3 0.0
-d 312 3 0.0
-d 313 3 0.0
-d 314 3 0.0
-d 315 3 0.0
-d 316 3 0.0
-d 317 3 0.0
-d 318 3 0.0
-d 319 3 0.0
-d 320 3 0.0
-d 321 3 0.0
-d 322 3 0.0
-d 323 3 0.0
-d 324 3 0.0
-d 325 3 0.0
-d 326 3 0.0
-d 327 3 0.0
-d 328 3 0.0
-d 329 3 0.0
-d 330 3 0.0
-d 331 3 0.0
-d 332 3 0.0
-d 333 3 0.0
-d 334 3 0.0
-d 335 3 0.0
-d 336 3 0.0
-d 337 3 0.0
-d 338 3 0.0
-d 339 3 0.0
-d 340 3 0.0
-d 341 3 0.0
-d 342 3 0.0
-d 343 3 0.0
-d 344 3 0.0
-d 345 3 0.0
-d 346 3 0.0
-d 347 3 0.0
-d 348 3 0.0
-d 349 3 0.0
-d 350 3 0.0
-d 351 3 0.0
-d 352 3 0.0
-d 353 3 0.0
-d 354 3 0.0
-d 355 3 0.0
-d 356 3 0.0
-d 357 3 0.0
-d 358 3 0.0
-d 359 3 0.0
-d 360 3 0.0
-d 361 3 0.0
-d 1 4 5.0
-d 2 4 5.0
-d 3 4 5.0
-d 4 4 5.0
-d 5 4 5.0
-d 6 4 5.0
-d 7 4 5.0
-d 8 4 5.0
-d 9 4 5.0
-d 10 4 5.0
-d 11 4 5.0
-d 12 4 5.0
-d 13 4 5.0
-d 14 4 5.0
-d 15 4 5.0
-d 16 4 5.0
-d 17 4 5.0
-d 18 4 5.0
-d 19 4 5.0
-d 20 4 5.0
-d 21 4 5.0
-d 22 4 4.0
-d 23 4 3.0
-d 24 4 2.0
-d 25 4 1.0
-d 26 4 8.88178e-16
-d 27 4 0.0
-d 28 4 0.0
-d 29 4 0.0
-d 30 4 0.0
-d 31 4 0.0
-d 32 4 0.0
-d 33 4 0.0
-d 34 4 0.0
-d 35 4 0.0
-d 36 4 0.0
-d 37 4 0.0
-d 38 4 0.0
-d 39 4 0.0
-d 40 4 0.0
-d 41 4 0.0
-d 42 4 0.0
-d 43 4 0.0
-d 44 4 0.0
-d 45 4 0.0
-d 46 4 0.0
-d 47 4 0.0
-d 48 4 0.0
-d 49 4 0.0
-d 50 4 0.0
-d 51 4 0.0
-d 52 4 0.0
-d 53 4 0.0
-d 54 4 0.0
-d 55 4 0.0
-d 56 4 0.0
-d 57 4 0.0
-d 58 4 0.0
-d 59 4 0.0
-d 60 4 0.0
-d 61 4 0.0
-d 62 4 0.0
-d 63 4 0.0
-d 64 4 0.0
-d 65 4 0.0
-d 66 4 0.0
-d 67 4 0.0
-d 68 4 0.0
-d 69 4 0.0
-d 70 4 0.0
-d 71 4 0.0
-d 72 4 0.0
-d 73 4 0.0
-d 74 4 0.0
-d 75 4 0.0
-d 76 4 0.0
-d 77 4 0.0
-d 78 4 0.0
-d 79 4 0.0
-d 80 4 0.0
-d 81 4 0.0
-d 82 4 0.0
-d 83 4 0.0
-d 84 4 0.0
-d 85 4 0.0
-d 86 4 0.0
-d 87 4 0.0
-d 88 4 0.0
-d 89 4 0.0
-d 90 4 0.0
-d 91 4 0.0
-d 92 4 0.0
-d 93 4 0.0
-d 94 4 0.0
-d 95 4 0.0
-d 96 4 0.0
-d 97 4 0.0
-d 98 4 0.0
-d 99 4 0.0
-d 100 4 0.0
-d 101 4 0.0
-d 102 4 0.0
-d 103 4 0.0
-d 104 4 0.0
-d 105 4 0.0
-d 106 4 0.0
-d 107 4 0.0
-d 108 4 0.0
-d 109 4 0.0
-d 110 4 0.0
-d 111 4 0.0
-d 112 4 0.0
-d 113 4 0.0
-d 114 4 0.0
-d 115 4 0.0
-d 116 4 0.0
-d 117 4 0.0
-d 118 4 0.0
-d 119 4 0.0
-d 120 4 0.0
-d 121 4 0.0
-d 122 4 0.0
-d 123 4 0.0
-d 124 4 0.0
-d 125 4 0.0
-d 126 4 0.0
-d 127 4 0.0
-d 128 4 0.0
-d 129 4 0.0
-d 130 4 0.0
-d 131 4 0.0
-d 132 4 0.0
-d 133 4 0.0
-d 134 4 0.0
-d 135 4 0.0
-d 136 4 0.0
-d 137 4 0.0
-d 138 4 0.0
-d 139 4 0.0
-d 140 4 0.0
-d 141 4 0.0
-d 142 4 1.0
-d 143 4 2.0
-d 144 4 3.0
-d 145 4 4.0
-d 146 4 5.0
-d 147 4 5.0
-d 148 4 5.0
-d 149 4 5.0
-d 150 4 5.0
-d 151 4 5.0
-d 152 4 5.0
-d 153 4 5.0
-d 154 4 5.0
-d 155 4 5.0
-d 156 4 5.0
-d 157 4 5.0
-d 158 4 5.0
-d 159 4 5.0
-d 160 4 5.0
-d 161 4 5.0
-d 162 4 5.0
-d 163 4 5.0
-d 164 4 5.0
-d 165 4 5.0
-d 166 4 5.0
-d 167 4 5.0
-d 168 4 5.0
-d 169 4 5.0
-d 170 4 5.0
-d 171 4 5.0
-d 172 4 5.0
-d 173 4 5.0
-d 174 4 5.0
-d 175 4 5.0
-d 176 4 5.0
-d 177 4 5.0
-d 178 4 5.0
-d 179 4 5.0
-d 180 4 5.0
-d 181 4 5.0
-d 182 4 5.0
-d 183 4 5.0
-d 184 4 5.0
-d 185 4 5.0
-d 186 4 5.0
-d 187 4 5.0
-d 188 4 5.0
-d 189 4 5.0
-d 190 4 5.0
-d 191 4 5.0
-d 192 4 5.0
-d 193 4 5.0
-d 194 4 5.0
-d 195 4 5.0
-d 196 4 5.0
-d 197 4 5.0
-d 198 4 5.0
-d 199 4 5.0
-d 200 4 5.0
-d 201 4 5.0
-d 202 4 5.0
-d 203 4 5.0
-d 204 4 5.0
-d 205 4 5.0
-d 206 4 5.0
-d 207 4 5.0
-d 208 4 5.0
-d 209 4 5.0
-d 210 4 5.0
-d 211 4 5.0
-d 212 4 5.0
-d 213 4 5.0
-d 214 4 5.0
-d 215 4 5.0
-d 216 4 5.0
-d 217 4 5.0
-d 218 4 5.0
-d 219 4 5.0
-d 220 4 5.0
-d 221 4 5.0
-d 222 4 5.0
-d 223 4 5.0
-d 224 4 5.0
-d 225 4 5.0
-d 226 4 5.0
-d 227 4 5.0
-d 228 4 5.0
-d 229 4 5.0
-d 230 4 5.0
-d 231 4 5.0
-d 232 4 5.0
-d 233 4 5.0
-d 234 4 5.0
-d 235 4 5.0
-d 236 4 5.0
-d 237 4 5.0
-d 238 4 5.0
-d 239 4 5.0
-d 240 4 5.0
-d 241 4 5.0
-d 242 4 5.0
-d 243 4 5.0
-d 244 4 5.0
-d 245 4 5.0
-d 246 4 5.0
-d 247 4 5.0
-d 248 4 5.0
-d 249 4 5.0
-d 250 4 5.0
-d 251 4 5.0
-d 252 4 5.0
-d 253 4 5.0
-d 254 4 5.0
-d 255 4 5.0
-d 256 4 5.0
-d 257 4 5.0
-d 258 4 5.0
-d 259 4 5.0
-d 260 4 5.0
-d 261 4 5.0
-d 262 4 4.0
-d 263 4 3.0
-d 264 4 2.0
-d 265 4 1.0
-d 266 4 2.13718e-14
-d 267 4 0.0
-d 268 4 0.0
-d 269 4 0.0
-d 270 4 0.0
-d 271 4 0.0
-d 272 4 0.0
-d 273 4 0.0
-d 274 4 0.0
-d 275 4 0.0
-d 276 4 0.0
-d 277 4 0.0
-d 278 4 0.0
-d 279 4 0.0
-d 280 4 0.0
-d 281 4 0.0
-d 282 4 0.0
-d 283 4 0.0
-d 284 4 0.0
-d 285 4 0.0
-d 286 4 0.0
-d 287 4 0.0
-d 288 4 0.0
-d 289 4 0.0
-d 290 4 0.0
-d 291 4 0.0
-d 292 4 0.0
-d 293 4 0.0
-d 294 4 0.0
-d 295 4 0.0
-d 296 4 0.0
-d 297 4 0.0
-d 298 4 0.0
-d 299 4 0.0
-d 300 4 0.0
-d 301 4 0.0
-d 302 4 0.0
-d 303 4 0.0
-d 304 4 0.0
-d 305 4 0.0
-d 306 4 0.0
-d 307 4 0.0
-d 308 4 0.0
-d 309 4 0.0
-d 310 4 0.0
-d 311 4 0.0
-d 312 4 0.0
-d 313 4 0.0
-d 314 4 0.0
-d 315 4 0.0
-d 316 4 0.0
-d 317 4 0.0
-d 318 4 0.0
-d 319 4 0.0
-d 320 4 0.0
-d 321 4 0.0
-d 322 4 0.0
-d 323 4 0.0
-d 324 4 0.0
-d 325 4 0.0
-d 326 4 0.0
-d 327 4 0.0
-d 328 4 0.0
-d 329 4 0.0
-d 330 4 0.0
-d 331 4 0.0
-d 332 4 0.0
-d 333 4 0.0
-d 334 4 0.0
-d 335 4 0.0
-d 336 4 0.0
-d 337 4 0.0
-d 338 4 0.0
-d 339 4 0.0
-d 340 4 0.0
-d 341 4 0.0
-d 342 4 0.0
-d 343 4 0.0
-d 344 4 0.0
-d 345 4 0.0
-d 346 4 0.0
-d 347 4 0.0
-d 348 4 0.0
-d 349 4 0.0
-d 350 4 0.0
-d 351 4 0.0
-d 352 4 0.0
-d 353 4 0.0
-d 354 4 0.0
-d 355 4 0.0
-d 356 4 0.0
-d 357 4 0.0
-d 358 4 0.0
-d 359 4 0.0
-d 360 4 0.0
-d 361 4 0.0
-d 1 5 0.0
-d 2 5 0.0
-d 3 5 0.0
-d 4 5 0.0
-d 5 5 0.0
-d 6 5 0.0
-d 7 5 0.0
-d 8 5 0.0
-d 9 5 0.0
-d 10 5 0.0
-d 11 5 0.0
-d 12 5 0.0
-d 13 5 0.0
-d 14 5 0.0
-d 15 5 0.0
-d 16 5 0.0
-d 17 5 0.0
-d 18 5 0.0
-d 19 5 0.0
-d 20 5 0.0
-d 21 5 0.0
-d 22 5 1.0
-d 23 5 2.0
-d 24 5 3.0
-d 25 5 4.0
-d 26 5 5.0
-d 27 5 5.0
-d 28 5 5.0
-d 29 5 5.0
-d 30 5 5.0
-d 31 5 5.0
-d 32 5 5.0
-d 33 5 5.0
-d 34 5 5.0
-d 35 5 5.0
-d 36 5 5.0
-d 37 5 5.0
-d 38 5 5.0
-d 39 5 5.0
-d 40 5 5.0
-d 41 5 5.0
-d 42 5 5.0
-d 43 5 5.0
-d 44 5 5.0
-d 45 5 5.0
-d 46 5 5.0
-d 47 5 5.0
-d 48 5 5.0
-d 49 5 5.0
-d 50 5 5.0
-d 51 5 5.0
-d 52 5 5.0
-d 53 5 5.0
-d 54 5 5.0
-d 55 5 5.0
-d 56 5 5.0
-d 57 5 5.0
-d 58 5 5.0
-d 59 5 5.0
-d 60 5 5.0
-d 61 5 5.0
-d 62 5 5.0
-d 63 5 5.0
-d 64 5 5.0
-d 65 5 5.0
-d 66 5 5.0
-d 67 5 5.0
-d 68 5 5.0
-d 69 5 5.0
-d 70 5 5.0
-d 71 5 5.0
-d 72 5 5.0
-d 73 5 5.0
-d 74 5 5.0
-d 75 5 5.0
-d 76 5 5.0
-d 77 5 5.0
-d 78 5 5.0
-d 79 5 5.0
-d 80 5 5.0
-d 81 5 5.0
-d 82 5 5.0
-d 83 5 5.0
-d 84 5 5.0
-d 85 5 5.0
-d 86 5 5.0
-d 87 5 5.0
-d 88 5 5.0
-d 89 5 5.0
-d 90 5 5.0
-d 91 5 5.0
-d 92 5 5.0
-d 93 5 5.0
-d 94 5 5.0
-d 95 5 5.0
-d 96 5 5.0
-d 97 5 5.0
-d 98 5 5.0
-d 99 5 5.0
-d 100 5 5.0
-d 101 5 5.0
-d 102 5 5.0
-d 103 5 5.0
-d 104 5 5.0
-d 105 5 5.0
-d 106 5 5.0
-d 107 5 5.0
-d 108 5 5.0
-d 109 5 5.0
-d 110 5 5.0
-d 111 5 5.0
-d 112 5 5.0
-d 113 5 5.0
-d 114 5 5.0
-d 115 5 5.0
-d 116 5 5.0
-d 117 5 5.0
-d 118 5 5.0
-d 119 5 5.0
-d 120 5 5.0
-d 121 5 5.0
-d 122 5 5.0
-d 123 5 5.0
-d 124 5 5.0
-d 125 5 5.0
-d 126 5 5.0
-d 127 5 5.0
-d 128 5 5.0
-d 129 5 5.0
-d 130 5 5.0
-d 131 5 5.0
-d 132 5 5.0
-d 133 5 5.0
-d 134 5 5.0
-d 135 5 5.0
-d 136 5 5.0
-d 137 5 5.0
-d 138 5 5.0
-d 139 5 5.0
-d 140 5 5.0
-d 141 5 5.0
-d 142 5 4.0
-d 143 5 3.0
-d 144 5 2.0
-d 145 5 1.0
-d 146 5 0.0
-d 147 5 0.0
-d 148 5 0.0
-d 149 5 0.0
-d 150 5 0.0
-d 151 5 0.0
-d 152 5 0.0
-d 153 5 0.0
-d 154 5 0.0
-d 155 5 0.0
-d 156 5 0.0
-d 157 5 0.0
-d 158 5 0.0
-d 159 5 0.0
-d 160 5 0.0
-d 161 5 0.0
-d 162 5 0.0
-d 163 5 0.0
-d 164 5 0.0
-d 165 5 0.0
-d 166 5 0.0
-d 167 5 0.0
-d 168 5 0.0
-d 169 5 0.0
-d 170 5 0.0
-d 171 5 0.0
-d 172 5 0.0
-d 173 5 0.0
-d 174 5 0.0
-d 175 5 0.0
-d 176 5 0.0
-d 177 5 0.0
-d 178 5 0.0
-d 179 5 0.0
-d 180 5 0.0
-d 181 5 0.0
-d 182 5 0.0
-d 183 5 0.0
-d 184 5 0.0
-d 185 5 0.0
-d 186 5 0.0
-d 187 5 0.0
-d 188 5 0.0
-d 189 5 0.0
-d 190 5 0.0
-d 191 5 0.0
-d 192 5 0.0
-d 193 5 0.0
-d 194 5 0.0
-d 195 5 0.0
-d 196 5 0.0
-d 197 5 0.0
-d 198 5 0.0
-d 199 5 0.0
-d 200 5 0.0
-d 201 5 0.0
-d 202 5 0.0
-d 203 5 0.0
-d 204 5 0.0
-d 205 5 0.0
-d 206 5 0.0
-d 207 5 0.0
-d 208 5 0.0
-d 209 5 0.0
-d 210 5 0.0
-d 211 5 0.0
-d 212 5 0.0
-d 213 5 0.0
-d 214 5 0.0
-d 215 5 0.0
-d 216 5 0.0
-d 217 5 0.0
-d 218 5 0.0
-d 219 5 0.0
-d 220 5 0.0
-d 221 5 0.0
-d 222 5 0.0
-d 223 5 0.0
-d 224 5 0.0
-d 225 5 0.0
-d 226 5 0.0
-d 227 5 0.0
-d 228 5 0.0
-d 229 5 0.0
-d 230 5 0.0
-d 231 5 0.0
-d 232 5 0.0
-d 233 5 0.0
-d 234 5 0.0
-d 235 5 0.0
-d 236 5 0.0
-d 237 5 0.0
-d 238 5 0.0
-d 239 5 0.0
-d 240 5 0.0
-d 241 5 0.0
-d 242 5 0.0
-d 243 5 0.0
-d 244 5 0.0
-d 245 5 0.0
-d 246 5 0.0
-d 247 5 0.0
-d 248 5 0.0
-d 249 5 0.0
-d 250 5 0.0
-d 251 5 0.0
-d 252 5 0.0
-d 253 5 0.0
-d 254 5 0.0
-d 255 5 0.0
-d 256 5 0.0
-d 257 5 0.0
-d 258 5 0.0
-d 259 5 0.0
-d 260 5 0.0
-d 261 5 0.0
-d 262 5 1.0
-d 263 5 2.0
-d 264 5 3.0
-d 265 5 4.0
-d 266 5 5.0
-d 267 5 5.0
-d 268 5 5.0
-d 269 5 5.0
-d 270 5 5.0
-d 271 5 5.0
-d 272 5 5.0
-d 273 5 5.0
-d 274 5 5.0
-d 275 5 5.0
-d 276 5 5.0
-d 277 5 5.0
-d 278 5 5.0
-d 279 5 5.0
-d 280 5 5.0
-d 281 5 5.0
-d 282 5 5.0
-d 283 5 5.0
-d 284 5 5.0
-d 285 5 5.0
-d 286 5 5.0
-d 287 5 5.0
-d 288 5 5.0
-d 289 5 5.0
-d 290 5 5.0
-d 291 5 5.0
-d 292 5 5.0
-d 293 5 5.0
-d 294 5 5.0
-d 295 5 5.0
-d 296 5 5.0
-d 297 5 5.0
-d 298 5 5.0
-d 299 5 5.0
-d 300 5 5.0
-d 301 5 5.0
-d 302 5 5.0
-d 303 5 5.0
-d 304 5 5.0
-d 305 5 5.0
-d 306 5 5.0
-d 307 5 5.0
-d 308 5 5.0
-d 309 5 5.0
-d 310 5 5.0
-d 311 5 5.0
-d 312 5 5.0
-d 313 5 5.0
-d 314 5 5.0
-d 315 5 5.0
-d 316 5 5.0
-d 317 5 5.0
-d 318 5 5.0
-d 319 5 5.0
-d 320 5 5.0
-d 321 5 5.0
-d 322 5 5.0
-d 323 5 5.0
-d 324 5 5.0
-d 325 5 5.0
-d 326 5 5.0
-d 327 5 5.0
-d 328 5 5.0
-d 329 5 5.0
-d 330 5 5.0
-d 331 5 5.0
-d 332 5 5.0
-d 333 5 5.0
-d 334 5 5.0
-d 335 5 5.0
-d 336 5 5.0
-d 337 5 5.0
-d 338 5 5.0
-d 339 5 5.0
-d 340 5 5.0
-d 341 5 5.0
-d 342 5 5.0
-d 343 5 5.0
-d 344 5 5.0
-d 345 5 5.0
-d 346 5 5.0
-d 347 5 5.0
-d 348 5 5.0
-d 349 5 5.0
-d 350 5 5.0
-d 351 5 5.0
-d 352 5 5.0
-d 353 5 5.0
-d 354 5 5.0
-d 355 5 5.0
-d 356 5 5.0
-d 357 5 5.0
-d 358 5 5.0
-d 359 5 5.0
-d 360 5 5.0
-d 361 5 5.0
-d 1 6 0.0
-d 2 6 0.0
-d 3 6 0.0
-d 4 6 0.0
-d 5 6 0.0
-d 6 6 0.0
-d 7 6 0.0
-d 8 6 0.0
-d 9 6 0.0
-d 10 6 0.0
-d 11 6 0.0
-d 12 6 0.0
-d 13 6 0.0
-d 14 6 0.0
-d 15 6 0.0
-d 16 6 0.0
-d 17 6 0.0
-d 18 6 0.0
-d 19 6 0.0
-d 20 6 0.0
-d 21 6 0.0
-d 22 6 1.0
-d 23 6 2.0
-d 24 6 3.0
-d 25 6 4.0
-d 26 6 5.0
-d 27 6 5.0
-d 28 6 5.0
-d 29 6 5.0
-d 30 6 5.0
-d 31 6 5.0
-d 32 6 5.0
-d 33 6 5.0
-d 34 6 5.0
-d 35 6 5.0
-d 36 6 5.0
-d 37 6 5.0
-d 38 6 5.0
-d 39 6 5.0
-d 40 6 5.0
-d 41 6 5.0
-d 42 6 5.0
-d 43 6 5.0
-d 44 6 5.0
-d 45 6 5.0
-d 46 6 5.0
-d 47 6 5.0
-d 48 6 5.0
-d 49 6 5.0
-d 50 6 5.0
-d 51 6 5.0
-d 52 6 5.0
-d 53 6 5.0
-d 54 6 5.0
-d 55 6 5.0
-d 56 6 5.0
-d 57 6 5.0
-d 58 6 5.0
-d 59 6 5.0
-d 60 6 5.0
-d 61 6 5.0
-d 62 6 5.0
-d 63 6 5.0
-d 64 6 5.0
-d 65 6 5.0
-d 66 6 5.0
-d 67 6 5.0
-d 68 6 5.0
-d 69 6 5.0
-d 70 6 5.0
-d 71 6 5.0
-d 72 6 5.0
-d 73 6 5.0
-d 74 6 5.0
-d 75 6 5.0
-d 76 6 5.0
-d 77 6 5.0
-d 78 6 5.0
-d 79 6 5.0
-d 80 6 5.0
-d 81 6 5.0
-d 82 6 5.0
-d 83 6 5.0
-d 84 6 5.0
-d 85 6 5.0
-d 86 6 5.0
-d 87 6 5.0
-d 88 6 5.0
-d 89 6 5.0
-d 90 6 5.0
-d 91 6 5.0
-d 92 6 5.0
-d 93 6 5.0
-d 94 6 5.0
-d 95 6 5.0
-d 96 6 5.0
-d 97 6 5.0
-d 98 6 5.0
-d 99 6 5.0
-d 100 6 5.0
-d 101 6 5.0
-d 102 6 5.0
-d 103 6 5.0
-d 104 6 5.0
-d 105 6 5.0
-d 106 6 5.0
-d 107 6 5.0
-d 108 6 5.0
-d 109 6 5.0
-d 110 6 5.0
-d 111 6 5.0
-d 112 6 5.0
-d 113 6 5.0
-d 114 6 5.0
-d 115 6 5.0
-d 116 6 5.0
-d 117 6 5.0
-d 118 6 5.0
-d 119 6 5.0
-d 120 6 5.0
-d 121 6 5.0
-d 122 6 5.0
-d 123 6 5.0
-d 124 6 5.0
-d 125 6 5.0
-d 126 6 5.0
-d 127 6 5.0
-d 128 6 5.0
-d 129 6 5.0
-d 130 6 5.0
-d 131 6 5.0
-d 132 6 5.0
-d 133 6 5.0
-d 134 6 5.0
-d 135 6 5.0
-d 136 6 5.0
-d 137 6 5.0
-d 138 6 5.0
-d 139 6 5.0
-d 140 6 5.0
-d 141 6 5.0
-d 142 6 4.0
-d 143 6 3.0
-d 144 6 2.0
-d 145 6 1.0
-d 146 6 0.0
-d 147 6 0.0
-d 148 6 0.0
-d 149 6 0.0
-d 150 6 0.0
-d 151 6 0.0
-d 152 6 0.0
-d 153 6 0.0
-d 154 6 0.0
-d 155 6 0.0
-d 156 6 0.0
-d 157 6 0.0
-d 158 6 0.0
-d 159 6 0.0
-d 160 6 0.0
-d 161 6 0.0
-d 162 6 0.0
-d 163 6 0.0
-d 164 6 0.0
-d 165 6 0.0
-d 166 6 0.0
-d 167 6 0.0
-d 168 6 0.0
-d 169 6 0.0
-d 170 6 0.0
-d 171 6 0.0
-d 172 6 0.0
-d 173 6 0.0
-d 174 6 0.0
-d 175 6 0.0
-d 176 6 0.0
-d 177 6 0.0
-d 178 6 0.0
-d 179 6 0.0
-d 180 6 0.0
-d 181 6 0.0
-d 182 6 0.0
-d 183 6 0.0
-d 184 6 0.0
-d 185 6 0.0
-d 186 6 0.0
-d 187 6 0.0
-d 188 6 0.0
-d 189 6 0.0
-d 190 6 0.0
-d 191 6 0.0
-d 192 6 0.0
-d 193 6 0.0
-d 194 6 0.0
-d 195 6 0.0
-d 196 6 0.0
-d 197 6 0.0
-d 198 6 0.0
-d 199 6 0.0
-d 200 6 0.0
-d 201 6 0.0
-d 202 6 0.0
-d 203 6 0.0
-d 204 6 0.0
-d 205 6 0.0
-d 206 6 0.0
-d 207 6 0.0
-d 208 6 0.0
-d 209 6 0.0
-d 210 6 0.0
-d 211 6 0.0
-d 212 6 0.0
-d 213 6 0.0
-d 214 6 0.0
-d 215 6 0.0
-d 216 6 0.0
-d 217 6 0.0
-d 218 6 0.0
-d 219 6 0.0
-d 220 6 0.0
-d 221 6 0.0
-d 222 6 0.0
-d 223 6 0.0
-d 224 6 0.0
-d 225 6 0.0
-d 226 6 0.0
-d 227 6 0.0
-d 228 6 0.0
-d 229 6 0.0
-d 230 6 0.0
-d 231 6 0.0
-d 232 6 0.0
-d 233 6 0.0
-d 234 6 0.0
-d 235 6 0.0
-d 236 6 0.0
-d 237 6 0.0
-d 238 6 0.0
-d 239 6 0.0
-d 240 6 0.0
-d 241 6 0.0
-d 242 6 0.0
-d 243 6 0.0
-d 244 6 0.0
-d 245 6 0.0
-d 246 6 0.0
-d 247 6 0.0
-d 248 6 0.0
-d 249 6 0.0
-d 250 6 0.0
-d 251 6 0.0
-d 252 6 0.0
-d 253 6 0.0
-d 254 6 0.0
-d 255 6 0.0
-d 256 6 0.0
-d 257 6 0.0
-d 258 6 0.0
-d 259 6 0.0
-d 260 6 0.0
-d 261 6 0.0
-d 262 6 1.0
-d 263 6 2.0
-d 264 6 3.0
-d 265 6 4.0
-d 266 6 5.0
-d 267 6 5.0
-d 268 6 5.0
-d 269 6 5.0
-d 270 6 5.0
-d 271 6 5.0
-d 272 6 5.0
-d 273 6 5.0
-d 274 6 5.0
-d 275 6 5.0
-d 276 6 5.0
-d 277 6 5.0
-d 278 6 5.0
-d 279 6 5.0
-d 280 6 5.0
-d 281 6 5.0
-d 282 6 5.0
-d 283 6 5.0
-d 284 6 5.0
-d 285 6 5.0
-d 286 6 5.0
-d 287 6 5.0
-d 288 6 5.0
-d 289 6 5.0
-d 290 6 5.0
-d 291 6 5.0
-d 292 6 5.0
-d 293 6 5.0
-d 294 6 5.0
-d 295 6 5.0
-d 296 6 5.0
-d 297 6 5.0
-d 298 6 5.0
-d 299 6 5.0
-d 300 6 5.0
-d 301 6 5.0
-d 302 6 5.0
-d 303 6 5.0
-d 304 6 5.0
-d 305 6 5.0
-d 306 6 5.0
-d 307 6 5.0
-d 308 6 5.0
-d 309 6 5.0
-d 310 6 5.0
-d 311 6 5.0
-d 312 6 5.0
-d 313 6 5.0
-d 314 6 5.0
-d 315 6 5.0
-d 316 6 5.0
-d 317 6 5.0
-d 318 6 5.0
-d 319 6 5.0
-d 320 6 5.0
-d 321 6 5.0
-d 322 6 5.0
-d 323 6 5.0
-d 324 6 5.0
-d 325 6 5.0
-d 326 6 5.0
-d 327 6 5.0
-d 328 6 5.0
-d 329 6 5.0
-d 330 6 5.0
-d 331 6 5.0
-d 332 6 5.0
-d 333 6 5.0
-d 334 6 5.0
-d 335 6 5.0
-d 336 6 5.0
-d 337 6 5.0
-d 338 6 5.0
-d 339 6 5.0
-d 340 6 5.0
-d 341 6 5.0
-d 342 6 5.0
-d 343 6 5.0
-d 344 6 5.0
-d 345 6 5.0
-d 346 6 5.0
-d 347 6 5.0
-d 348 6 5.0
-d 349 6 5.0
-d 350 6 5.0
-d 351 6 5.0
-d 352 6 5.0
-d 353 6 5.0
-d 354 6 5.0
-d 355 6 5.0
-d 356 6 5.0
-d 357 6 5.0
-d 358 6 5.0
-d 359 6 5.0
-d 360 6 5.0
-d 361 6 5.0
-d 1 7 5.0
-d 2 7 5.0
-d 3 7 5.0
-d 4 7 5.0
-d 5 7 5.0
-d 6 7 5.0
-d 7 7 5.0
-d 8 7 5.0
-d 9 7 5.0
-d 10 7 5.0
-d 11 7 5.0
-d 12 7 5.0
-d 13 7 5.0
-d 14 7 5.0
-d 15 7 5.0
-d 16 7 5.0
-d 17 7 5.0
-d 18 7 5.0
-d 19 7 5.0
-d 20 7 5.0
-d 21 7 5.0
-d 22 7 4.0
-d 23 7 3.0
-d 24 7 2.0
-d 25 7 1.0
-d 26 7 8.88178e-16
-d 27 7 0.0
-d 28 7 0.0
-d 29 7 0.0
-d 30 7 0.0
-d 31 7 0.0
-d 32 7 0.0
-d 33 7 0.0
-d 34 7 0.0
-d 35 7 0.0
-d 36 7 0.0
-d 37 7 0.0
-d 38 7 0.0
-d 39 7 0.0
-d 40 7 0.0
-d 41 7 0.0
-d 42 7 0.0
-d 43 7 0.0
-d 44 7 0.0
-d 45 7 0.0
-d 46 7 0.0
-d 47 7 0.0
-d 48 7 0.0
-d 49 7 0.0
-d 50 7 0.0
-d 51 7 0.0
-d 52 7 0.0
-d 53 7 0.0
-d 54 7 0.0
-d 55 7 0.0
-d 56 7 0.0
-d 57 7 0.0
-d 58 7 0.0
-d 59 7 0.0
-d 60 7 0.0
-d 61 7 0.0
-d 62 7 0.0
-d 63 7 0.0
-d 64 7 0.0
-d 65 7 0.0
-d 66 7 0.0
-d 67 7 0.0
-d 68 7 0.0
-d 69 7 0.0
-d 70 7 0.0
-d 71 7 0.0
-d 72 7 0.0
-d 73 7 0.0
-d 74 7 0.0
-d 75 7 0.0
-d 76 7 0.0
-d 77 7 0.0
-d 78 7 0.0
-d 79 7 0.0
-d 80 7 0.0
-d 81 7 0.0
-d 82 7 0.0
-d 83 7 0.0
-d 84 7 0.0
-d 85 7 0.0
-d 86 7 0.0
-d 87 7 0.0
-d 88 7 0.0
-d 89 7 0.0
-d 90 7 0.0
-d 91 7 0.0
-d 92 7 0.0
-d 93 7 0.0
-d 94 7 0.0
-d 95 7 0.0
-d 96 7 0.0
-d 97 7 0.0
-d 98 7 0.0
-d 99 7 0.0
-d 100 7 0.0
-d 101 7 0.0
-d 102 7 0.0
-d 103 7 0.0
-d 104 7 0.0
-d 105 7 0.0
-d 106 7 0.0
-d 107 7 0.0
-d 108 7 0.0
-d 109 7 0.0
-d 110 7 0.0
-d 111 7 0.0
-d 112 7 0.0
-d 113 7 0.0
-d 114 7 0.0
-d 115 7 0.0
-d 116 7 0.0
-d 117 7 0.0
-d 118 7 0.0
-d 119 7 0.0
-d 120 7 0.0
-d 121 7 0.0
-d 122 7 0.0
-d 123 7 0.0
-d 124 7 0.0
-d 125 7 0.0
-d 126 7 0.0
-d 127 7 0.0
-d 128 7 0.0
-d 129 7 0.0
-d 130 7 0.0
-d 131 7 0.0
-d 132 7 0.0
-d 133 7 0.0
-d 134 7 0.0
-d 135 7 0.0
-d 136 7 0.0
-d 137 7 0.0
-d 138 7 0.0
-d 139 7 0.0
-d 140 7 0.0
-d 141 7 0.0
-d 142 7 1.0
-d 143 7 2.0
-d 144 7 3.0
-d 145 7 4.0
-d 146 7 5.0
-d 147 7 5.0
-d 148 7 5.0
-d 149 7 5.0
-d 150 7 5.0
-d 151 7 5.0
-d 152 7 5.0
-d 153 7 5.0
-d 154 7 5.0
-d 155 7 5.0
-d 156 7 5.0
-d 157 7 5.0
-d 158 7 5.0
-d 159 7 5.0
-d 160 7 5.0
-d 161 7 5.0
-d 162 7 5.0
-d 163 7 5.0
-d 164 7 5.0
-d 165 7 5.0
-d 166 7 5.0
-d 167 7 5.0
-d 168 7 5.0
-d 169 7 5.0
-d 170 7 5.0
-d 171 7 5.0
-d 172 7 5.0
-d 173 7 5.0
-d 174 7 5.0
-d 175 7 5.0
-d 176 7 5.0
-d 177 7 5.0
-d 178 7 5.0
-d 179 7 5.0
-d 180 7 5.0
-d 181 7 5.0
-d 182 7 5.0
-d 183 7 5.0
-d 184 7 5.0
-d 185 7 5.0
-d 186 7 5.0
-d 187 7 5.0
-d 188 7 5.0
-d 189 7 5.0
-d 190 7 5.0
-d 191 7 5.0
-d 192 7 5.0
-d 193 7 5.0
-d 194 7 5.0
-d 195 7 5.0
-d 196 7 5.0
-d 197 7 5.0
-d 198 7 5.0
-d 199 7 5.0
-d 200 7 5.0
-d 201 7 5.0
-d 202 7 5.0
-d 203 7 5.0
-d 204 7 5.0
-d 205 7 5.0
-d 206 7 5.0
-d 207 7 5.0
-d 208 7 5.0
-d 209 7 5.0
-d 210 7 5.0
-d 211 7 5.0
-d 212 7 5.0
-d 213 7 5.0
-d 214 7 5.0
-d 215 7 5.0
-d 216 7 5.0
-d 217 7 5.0
-d 218 7 5.0
-d 219 7 5.0
-d 220 7 5.0
-d 221 7 5.0
-d 222 7 5.0
-d 223 7 5.0
-d 224 7 5.0
-d 225 7 5.0
-d 226 7 5.0
-d 227 7 5.0
-d 228 7 5.0
-d 229 7 5.0
-d 230 7 5.0
-d 231 7 5.0
-d 232 7 5.0
-d 233 7 5.0
-d 234 7 5.0
-d 235 7 5.0
-d 236 7 5.0
-d 237 7 5.0
-d 238 7 5.0
-d 239 7 5.0
-d 240 7 5.0
-d 241 7 5.0
-d 242 7 5.0
-d 243 7 5.0
-d 244 7 5.0
-d 245 7 5.0
-d 246 7 5.0
-d 247 7 5.0
-d 248 7 5.0
-d 249 7 5.0
-d 250 7 5.0
-d 251 7 5.0
-d 252 7 5.0
-d 253 7 5.0
-d 254 7 5.0
-d 255 7 5.0
-d 256 7 5.0
-d 257 7 5.0
-d 258 7 5.0
-d 259 7 5.0
-d 260 7 5.0
-d 261 7 5.0
-d 262 7 4.0
-d 263 7 3.0
-d 264 7 2.0
-d 265 7 1.0
-d 266 7 2.13718e-14
-d 267 7 0.0
-d 268 7 0.0
-d 269 7 0.0
-d 270 7 0.0
-d 271 7 0.0
-d 272 7 0.0
-d 273 7 0.0
-d 274 7 0.0
-d 275 7 0.0
-d 276 7 0.0
-d 277 7 0.0
-d 278 7 0.0
-d 279 7 0.0
-d 280 7 0.0
-d 281 7 0.0
-d 282 7 0.0
-d 283 7 0.0
-d 284 7 0.0
-d 285 7 0.0
-d 286 7 0.0
-d 287 7 0.0
-d 288 7 0.0
-d 289 7 0.0
-d 290 7 0.0
-d 291 7 0.0
-d 292 7 0.0
-d 293 7 0.0
-d 294 7 0.0
-d 295 7 0.0
-d 296 7 0.0
-d 297 7 0.0
-d 298 7 0.0
-d 299 7 0.0
-d 300 7 0.0
-d 301 7 0.0
-d 302 7 0.0
-d 303 7 0.0
-d 304 7 0.0
-d 305 7 0.0
-d 306 7 0.0
-d 307 7 0.0
-d 308 7 0.0
-d 309 7 0.0
-d 310 7 0.0
-d 311 7 0.0
-d 312 7 0.0
-d 313 7 0.0
-d 314 7 0.0
-d 315 7 0.0
-d 316 7 0.0
-d 317 7 0.0
-d 318 7 0.0
-d 319 7 0.0
-d 320 7 0.0
-d 321 7 0.0
-d 322 7 0.0
-d 323 7 0.0
-d 324 7 0.0
-d 325 7 0.0
-d 326 7 0.0
-d 327 7 0.0
-d 328 7 0.0
-d 329 7 0.0
-d 330 7 0.0
-d 331 7 0.0
-d 332 7 0.0
-d 333 7 0.0
-d 334 7 0.0
-d 335 7 0.0
-d 336 7 0.0
-d 337 7 0.0
-d 338 7 0.0
-d 339 7 0.0
-d 340 7 0.0
-d 341 7 0.0
-d 342 7 0.0
-d 343 7 0.0
-d 344 7 0.0
-d 345 7 0.0
-d 346 7 0.0
-d 347 7 0.0
-d 348 7 0.0
-d 349 7 0.0
-d 350 7 0.0
-d 351 7 0.0
-d 352 7 0.0
-d 353 7 0.0
-d 354 7 0.0
-d 355 7 0.0
-d 356 7 0.0
-d 357 7 0.0
-d 358 7 0.0
-d 359 7 0.0
-d 360 7 0.0
-d 361 7 0.0
-d 1 8 5.0
-d 2 8 5.16904
-d 3 8 4.84159
-d 4 8 3.34542
-d 5 8 0.317102
-d 6 8 0.103304
-d 7 8 0.0275721
-d 8 8 0.0221534
-d 9 8 0.017689
-d 10 8 0.0142639
-d 11 8 0.0113974
-d 12 8 0.00918238
-d 13 8 0.00742541
-d 14 8 0.00616602
-d 15 8 0.00481195
-d 16 8 0.00397049
-d 17 8 -0.0659889
-d 18 8 -0.025671
-d 19 8 0.165495
-d 20 8 0.986891
-d 21 8 3.05229
-d 22 8 4.55511
-d 23 8 4.91611
-d 24 8 4.98192
-d 25 8 4.99428
-d 26 8 4.99833
-d 27 8 4.99095
-d 28 8 4.97295
-d 29 8 4.95493
-d 30 8 4.93428
-d 31 8 4.90723
-d 32 8 4.94799
-d 33 8 4.98584
-d 34 8 4.99566
-d 35 8 4.99813
-d 36 8 4.99907
-d 37 8 4.99947
-d 38 8 4.99965
-d 39 8 4.99976
-d 40 8 4.99984
-d 41 8 4.99989
-d 42 8 4.99992
-d 43 8 4.99994
-d 44 8 4.99996
-d 45 8 4.99998
-d 46 8 5.00002
-d 47 8 5.00006
-d 48 8 5.00002
-d 49 8 4.99996
-d 50 8 4.99994
-d 51 8 4.99999
-d 52 8 5.00003
-d 53 8 5.00002
-d 54 8 5.0
-d 55 8 4.99997
-d 56 8 4.99997
-d 57 8 4.99997
-d 58 8 4.99997
-d 59 8 4.99997
-d 60 8 4.99996
-d 61 8 4.99997
-d 62 8 4.99997
-d 63 8 4.99998
-d 64 8 4.99998
-d 65 8 4.99999
-d 66 8 5.0
-d 67 8 5.0
-d 68 8 5.0
-d 69 8 5.0
-d 70 8 5.0
-d 71 8 5.0
-d 72 8 5.00001
-d 73 8 5.00001
-d 74 8 5.00001
-d 75 8 5.00001
-d 76 8 5.00001
-d 77 8 5.00001
-d 78 8 5.00001
-d 79 8 5.00001
-d 80 8 5.00001
-d 81 8 5.00001
-d 82 8 5.00001
-d 83 8 5.00001
-d 84 8 5.00001
-d 85 8 5.0
-d 86 8 5.0
-d 87 8 5.0
-d 88 8 5.0
-d 89 8 5.0
-d 90 8 5.0
-d 91 8 5.0
-d 92 8 4.99999
-d 93 8 4.99999
-d 94 8 4.99999
-d 95 8 4.99999
-d 96 8 4.99999
-d 97 8 4.99999
-d 98 8 4.99998
-d 99 8 4.99998
-d 100 8 4.99998
-d 101 8 4.99999
-d 102 8 4.99999
-d 103 8 4.99999
-d 104 8 4.99999
-d 105 8 4.99999
-d 106 8 4.99999
-d 107 8 4.99999
-d 108 8 4.99999
-d 109 8 4.99999
-d 110 8 4.99999
-d 111 8 4.99999
-d 112 8 4.99999
-d 113 8 4.99999
-d 114 8 4.99999
-d 115 8 5.0
-d 116 8 5.0
-d 117 8 5.0
-d 118 8 5.0
-d 119 8 5.0
-d 120 8 5.0
-d 121 8 5.0
-d 122 8 5.16575
-d 123 8 4.69986
-d 124 8 2.43862
-d 125 8 0.0230224
-d 126 8 0.035229
-d 127 8 -0.0210607
-d 128 8 -0.0292766
-d 129 8 -0.0172693
-d 130 8 -0.00271479
-d 131 8 -0.000912251
-d 132 8 -0.000349106
-d 133 8 -0.000116866
-d 134 8 -4.24733e-05
-d 135 8 -1.39536e-05
-d 136 8 -3.01179e-05
-d 137 8 -0.0657192
-d 138 8 -0.0204835
-d 139 8 0.183378
-d 140 8 1.07181
-d 141 8 3.118
-d 142 8 4.46472
-d 143 8 4.84158
-d 144 8 4.94795
-d 145 8 4.98173
-d 146 8 4.99236
-d 147 8 4.99762
-d 148 8 5.01939
-d 149 8 5.0433
-d 150 8 5.05332
-d 151 8 5.04959
-d 152 8 5.03955
-d 153 8 5.02851
-d 154 8 5.02052
-d 155 8 5.01422
-d 156 8 5.00965
-d 157 8 5.00631
-d 158 8 5.00405
-d 159 8 5.00248
-d 160 8 5.00083
-d 161 8 5.00012
-d 162 8 5.00209
-d 163 8 5.00387
-d 164 8 5.00347
-d 165 8 4.99917
-d 166 8 4.99213
-d 167 8 4.98411
-d 168 8 4.97521
-d 169 8 4.96332
-d 170 8 4.94601
-d 171 8 4.9304
-d 172 8 4.94633
-d 173 8 4.97936
-d 174 8 4.99264
-d 175 8 4.99685
-d 176 8 4.99857
-d 177 8 4.99925
-d 178 8 4.99954
-d 179 8 4.9997
-d 180 8 4.99973
-d 181 8 4.9997
-d 182 8 4.99973
-d 183 8 4.99979
-d 184 8 4.99983
-d 185 8 4.99986
-d 186 8 4.99988
-d 187 8 4.9999
-d 188 8 4.9999
-d 189 8 4.99992
-d 190 8 4.99993
-d 191 8 4.99994
-d 192 8 4.99995
-d 193 8 4.99996
-d 194 8 4.99996
-d 195 8 4.99997
-d 196 8 4.99997
-d 197 8 4.99998
-d 198 8 4.99998
-d 199 8 4.99998
-d 200 8 4.99999
-d 201 8 4.99999
-d 202 8 4.99999
-d 203 8 4.99999
-d 204 8 4.99999
-d 205 8 4.99999
-d 206 8 4.99999
-d 207 8 5.0
-d 208 8 5.0
-d 209 8 5.0
-d 210 8 5.00001
-d 211 8 5.00001
-d 212 8 5.00001
-d 213 8 5.00001
-d 214 8 5.00002
-d 215 8 5.00002
-d 216 8 5.00002
-d 217 8 5.00002
-d 218 8 5.00001
-d 219 8 5.00001
-d 220 8 5.00001
-d 221 8 5.0
-d 222 8 5.0
-d 223 8 5.0
-d 224 8 5.0
-d 225 8 5.0
-d 226 8 5.0
-d 227 8 5.0
-d 228 8 5.0
-d 229 8 4.99999
-d 230 8 4.99999
-d 231 8 4.99999
-d 232 8 4.99999
-d 233 8 4.99999
-d 234 8 4.99999
-d 235 8 4.99999
-d 236 8 4.99999
-d 237 8 4.99999
-d 238 8 4.99999
-d 239 8 4.99999
-d 240 8 5.0
-d 241 8 5.0
-d 242 8 5.14242
-d 243 8 4.76101
-d 244 8 3.16003
-d 245 8 0.299374
-d 246 8 0.0645506
-d 247 8 -0.000498424
-d 248 8 -2.45108e-05
-d 249 8 -2.27986e-05
-d 250 8 -5.24401e-05
-d 251 8 -4.9884e-05
-d 252 8 -4.92491e-05
-d 253 8 -2.93354e-05
-d 254 8 -3.21402e-05
-d 255 8 -2.11851e-05
-d 256 8 -3.37925e-05
-d 257 8 -0.0657892
-d 258 8 -0.020563
-d 259 8 0.182582
-d 260 8 1.06058
-d 261 8 3.12484
-d 262 8 4.46552
-d 263 8 4.84146
-d 264 8 4.95102
-d 265 8 4.98556
-d 266 8 4.99472
-d 267 8 4.99806
-d 268 8 4.99909
-d 269 8 4.99955
-d 270 8 4.99976
-d 271 8 4.99994
-d 272 8 4.99992
-d 273 8 5.00029
-d 274 8 4.99967
-d 275 8 4.99849
-d 276 8 4.99736
-d 277 8 4.99884
-d 278 8 5.00099
-d 279 8 5.00377
-d 280 8 5.00215
-d 281 8 4.99994
-d 282 8 4.99893
-d 283 8 4.99788
-d 284 8 4.99862
-d 285 8 5.00055
-d 286 8 5.00134
-d 287 8 5.00127
-d 288 8 5.00073
-d 289 8 5.00039
-d 290 8 5.00018
-d 291 8 5.00006
-d 292 8 5.00001
-d 293 8 4.99985
-d 294 8 5.00026
-d 295 8 5.00018
-d 296 8 5.00003
-d 297 8 4.99981
-d 298 8 4.99985
-d 299 8 4.99987
-d 300 8 4.99985
-d 301 8 4.99982
-d 302 8 4.99982
-d 303 8 4.99982
-d 304 8 4.99983
-d 305 8 4.99985
-d 306 8 4.99987
-d 307 8 4.99989
-d 308 8 4.99991
-d 309 8 4.99992
-d 310 8 4.99994
-d 311 8 4.99995
-d 312 8 4.99995
-d 313 8 4.99994
-d 314 8 4.99994
-d 315 8 4.99996
-d 316 8 4.99999
-d 317 8 5.00002
-d 318 8 5.00008
-d 319 8 5.00009
-d 320 8 5.00006
-d 321 8 5.00001
-d 322 8 5.0
-d 323 8 4.99999
-d 324 8 4.99998
-d 325 8 4.99997
-d 326 8 4.99996
-d 327 8 4.99997
-d 328 8 4.99997
-d 329 8 4.99998
-d 330 8 4.99998
-d 331 8 4.99999
-d 332 8 4.99999
-d 333 8 4.99999
-d 334 8 5.0
-d 335 8 5.0
-d 336 8 5.0
-d 337 8 5.0
-d 338 8 5.00001
-d 339 8 5.00001
-d 340 8 5.00001
-d 341 8 5.00001
-d 342 8 5.00001
-d 343 8 5.00001
-d 344 8 5.00001
-d 345 8 5.00001
-d 346 8 5.00001
-d 347 8 5.00001
-d 348 8 5.00001
-d 349 8 5.00001
-d 350 8 5.0
-d 351 8 5.0
-d 352 8 5.0
-d 353 8 5.0
-d 354 8 5.0
-d 355 8 4.99999
-d 356 8 4.99999
-d 357 8 4.99999
-d 358 8 4.99999
-d 359 8 4.99998
-d 360 8 4.99998
-d 361 8 4.99998
-d 1 9 5.0
-d 2 9 5.03758
-d 3 9 5.04711
-d 4 9 4.96911
-d 5 9 4.20882
-d 6 9 3.96295
-d 7 9 4.01117
-d 8 9 4.15521
-d 9 9 4.2967
-d 10 9 4.42274
-d 11 9 4.5295
-d 12 9 4.6176
-d 13 9 4.69014
-d 14 9 4.74831
-d 15 9 4.7966
-d 16 9 4.83537
-d 17 9 4.80526
-d 18 9 4.787
-d 19 9 4.79295
-d 20 9 4.88588
-d 21 9 5.08978
-d 22 9 5.15615
-d 23 9 5.10778
-d 24 9 5.07718
-d 25 9 5.06652
-d 26 9 5.08225
-d 27 9 4.9744
-d 28 9 4.52977
-d 29 9 3.77452
-d 30 9 2.69426
-d 31 9 1.15294
-d 32 9 0.245509
-d 33 9 0.0981544
-d 34 9 0.0567527
-d 35 9 0.0367487
-d 36 9 0.0252578
-d 37 9 0.0180599
-d 38 9 0.0133837
-d 39 9 0.0101497
-d 40 9 0.0078616
-d 41 9 0.00620186
-d 42 9 0.00499056
-d 43 9 0.0041027
-d 44 9 0.00344223
-d 45 9 0.00295808
-d 46 9 0.00260089
-d 47 9 0.00229887
-d 48 9 0.00200817
-d 49 9 0.00176397
-d 50 9 0.00160116
-d 51 9 0.00147381
-d 52 9 0.00134645
-d 53 9 0.00125029
-d 54 9 0.00116043
-d 55 9 0.00107371
-d 56 9 0.00101981
-d 57 9 0.000965921
-d 58 9 0.000912028
-d 59 9 0.000858135
-d 60 9 0.000804242
-d 61 9 0.000761669
-d 62 9 0.00072672
-d 63 9 0.000691771
-d 64 9 0.000656823
-d 65 9 0.000621874
-d 66 9 0.000588722
-d 67 9 0.00057041
-d 68 9 0.000552098
-d 69 9 0.000533785
-d 70 9 0.000515473
-d 71 9 0.000497162
-d 72 9 0.00047885
-d 73 9 0.000460537
-d 74 9 0.000442226
-d 75 9 0.000423914
-d 76 9 0.000405601
-d 77 9 0.000388399
-d 78 9 0.000378694
-d 79 9 0.000368989
-d 80 9 0.000359284
-d 81 9 0.00034958
-d 82 9 0.000339875
-d 83 9 0.00033017
-d 84 9 0.000320465
-d 85 9 0.00031076
-d 86 9 0.000301055
-d 87 9 0.00029135
-d 88 9 0.000282207
-d 89 9 0.000276247
-d 90 9 0.000270287
-d 91 9 0.000264327
-d 92 9 0.000258367
-d 93 9 0.000252407
-d 94 9 0.000246447
-d 95 9 0.000240487
-d 96 9 0.000234527
-d 97 9 0.000228567
-d 98 9 0.000222607
-d 99 9 0.000217086
-d 100 9 0.000213696
-d 101 9 0.000210307
-d 102 9 0.000206918
-d 103 9 0.000203528
-d 104 9 0.000200139
-d 105 9 0.00019675
-d 106 9 0.00019336
-d 107 9 0.000189971
-d 108 9 0.000186582
-d 109 9 0.000183192
-d 110 9 0.000179803
-d 111 9 0.000176414
-d 112 9 0.000173025
-d 113 9 0.000169635
-d 114 9 0.000166246
-d 115 9 0.000162857
-d 116 9 0.000159467
-d 117 9 0.000156078
-d 118 9 0.000152689
-d 119 9 0.000149299
-d 120 9 0.00014591
-d 121 9 0.00014255
-d 122 9 0.0316021
-d 123 9 0.163272
-d 124 9 0.348732
-d 125 9 0.603651
-d 126 9 0.35745
-d 127 9 0.135965
-d 128 9 0.0707354
-d 129 9 0.0314595
-d 130 9 0.0201047
-d 131 9 0.00994945
-d 132 9 0.00389601
-d 133 9 0.00138839
-d 134 9 0.00060778
-d 135 9 0.000329648
-d 136 9 0.000492396
-d 137 9 -0.0732035
-d 138 9 -0.0844077
-d 139 9 -0.0789062
-d 140 9 -0.0390837
-d 141 9 0.0197559
-d 142 9 0.0183094
-d 143 9 -0.00180099
-d 144 9 -0.0189565
-d 145 9 -0.0424144
-d 146 9 -0.0735904
-d 147 9 -0.0892423
-d 148 9 0.285039
-d 149 9 1.13702
-d 150 9 2.10809
-d 151 9 2.95826
-d 152 9 3.60164
-d 153 9 4.0435
-d 154 9 4.35771
-d 155 9 4.57254
-d 156 9 4.71769
-d 157 9 4.81329
-d 158 9 4.87534
-d 159 9 4.91487
-d 160 9 4.94264
-d 161 9 4.97375
-d 162 9 5.01526
-d 163 9 5.06517
-d 164 9 5.10154
-d 165 9 5.06259
-d 166 9 4.89005
-d 167 9 4.5787
-d 168 9 4.12226
-d 169 9 3.46151
-d 170 9 2.49023
-d 171 9 1.2586
-d 172 9 0.32725
-d 173 9 0.116753
-d 174 9 0.0701865
-d 175 9 0.0455509
-d 176 9 0.0286914
-d 177 9 0.0178176
-d 178 9 0.0117599
-d 179 9 0.00902715
-d 180 9 0.00760583
-d 181 9 0.00637745
-d 182 9 0.00543811
-d 183 9 0.00439377
-d 184 9 0.00352448
-d 185 9 0.0030151
-d 186 9 0.00285771
-d 187 9 0.002465
-d 188 9 0.00203114
-d 189 9 0.00173004
-d 190 9 0.0014839
-d 191 9 0.00125177
-d 192 9 0.00105327
-d 193 9 0.000894905
-d 194 9 0.000766372
-d 195 9 0.000658894
-d 196 9 0.000569105
-d 197 9 0.000492114
-d 198 9 0.000427938
-d 199 9 0.000370217
-d 200 9 0.000314758
-d 201 9 0.000266569
-d 202 9 0.000233726
-d 203 9 0.000209048
-d 204 9 0.000191957
-d 205 9 0.000177169
-d 206 9 0.000166604
-d 207 9 0.000161
-d 208 9 0.000157314
-d 209 9 0.000143828
-d 210 9 0.000130342
-d 211 9 0.000116857
-d 212 9 0.000103371
-d 213 9 8.98855e-05
-d 214 9 7.63998e-05
-d 215 9 6.29141e-05
-d 216 9 5.76583e-05
-d 217 9 5.30027e-05
-d 218 9 4.8347e-05
-d 219 9 4.36913e-05
-d 220 9 3.90357e-05
-d 221 9 3.438e-05
-d 222 9 2.97243e-05
-d 223 9 2.72507e-05
-d 224 9 2.59083e-05
-d 225 9 2.45659e-05
-d 226 9 2.32235e-05
-d 227 9 2.18811e-05
-d 228 9 2.05387e-05
-d 229 9 1.91963e-05
-d 230 9 1.78539e-05
-d 231 9 1.65115e-05
-d 232 9 1.51691e-05
-d 233 9 1.38267e-05
-d 234 9 1.24843e-05
-d 235 9 1.11419e-05
-d 236 9 9.79954e-06
-d 237 9 8.51574e-06
-d 238 9 7.69807e-06
-d 239 9 6.8804e-06
-d 240 9 6.06273e-06
-d 241 9 5.24506e-06
-d 242 9 0.0287318
-d 243 9 0.0317111
-d 244 9 -0.0320087
-d 245 9 -0.103609
-d 246 9 0.0369639
-d 247 9 0.0121128
-d 248 9 0.00961197
-d 249 9 0.00934971
-d 250 9 0.00820853
-d 251 9 0.00699769
-d 252 9 0.00607002
-d 253 9 0.00535541
-d 254 9 0.00476552
-d 255 9 0.00427601
-d 256 9 0.00376357
-d 257 9 -0.073012
-d 258 9 -0.0866964
-d 259 9 -0.0809538
-d 260 9 -0.038005
-d 261 9 0.0277001
-d 262 9 0.0188906
-d 263 9 0.00614597
-d 264 9 0.00373629
-d 265 9 0.00489787
-d 266 9 0.0146573
-d 267 9 0.0191052
-d 268 9 0.0151708
-d 269 9 0.0124224
-d 270 9 0.0105859
-d 271 9 0.00879272
-d 272 9 0.00729464
-d 273 9 0.0070047
-d 274 9 0.00449575
-d 275 9 -0.00626652
-d 276 9 -0.0252417
-d 277 9 -0.0147287
-d 278 9 0.022538
-d 279 9 0.0822905
-d 280 9 0.0947372
-d 281 9 0.0657516
-d 282 9 0.0445506
-d 283 9 0.0316753
-d 284 9 0.0220971
-d 285 9 0.0158101
-d 286 9 0.0140971
-d 287 9 0.0161498
-d 288 9 0.0139876
-d 289 9 0.0122447
-d 290 9 0.0106994
-d 291 9 0.009397
-d 292 9 0.00822236
-d 293 9 0.00686509
-d 294 9 0.00797431
-d 295 9 0.00751269
-d 296 9 0.00671173
-d 297 9 0.00595243
-d 298 9 0.00524633
-d 299 9 0.00459528
-d 300 9 0.00401688
-d 301 9 0.00350109
-d 302 9 0.00303954
-d 303 9 0.00260569
-d 304 9 0.00222792
-d 305 9 0.00191033
-d 306 9 0.00163917
-d 307 9 0.00140949
-d 308 9 0.00121464
-d 309 9 0.0010471
-d 310 9 0.000900638
-d 311 9 0.000768847
-d 312 9 0.000645236
-d 313 9 0.000524807
-d 314 9 0.000460275
-d 315 9 0.000442237
-d 316 9 0.000446775
-d 317 9 0.000397026
-d 318 9 0.000301585
-d 319 9 0.000228994
-d 320 9 0.000190894
-d 321 9 0.000166569
-d 322 9 0.000152261
-d 323 9 0.000137953
-d 324 9 0.000123644
-d 325 9 0.000109336
-d 326 9 9.50281e-05
-d 327 9 8.56557e-05
-d 328 9 7.78437e-05
-d 329 9 7.00318e-05
-d 330 9 6.22198e-05
-d 331 9 5.44079e-05
-d 332 9 4.87539e-05
-d 333 9 4.57761e-05
-d 334 9 4.27982e-05
-d 335 9 3.98203e-05
-d 336 9 3.68425e-05
-d 337 9 3.38646e-05
-d 338 9 3.08868e-05
-d 339 9 2.79089e-05
-d 340 9 2.4931e-05
-d 341 9 2.19532e-05
-d 342 9 1.89753e-05
-d 343 9 1.75244e-05
-d 344 9 1.64095e-05
-d 345 9 1.52946e-05
-d 346 9 1.41797e-05
-d 347 9 1.30648e-05
-d 348 9 1.19499e-05
-d 349 9 1.0835e-05
-d 350 9 9.72011e-06
-d 351 9 8.60521e-06
-d 352 9 7.4903e-06
-d 353 9 6.5117e-06
-d 354 9 6.10334e-06
-d 355 9 5.69497e-06
-d 356 9 5.2866e-06
-d 357 9 4.87824e-06
-d 358 9 4.46987e-06
-d 359 9 4.06151e-06
-d 360 9 3.65314e-06
-d 361 9 3.24477e-06
-d 1 10 1.86175
-d 2 10 1.99708
-d 3 10 2.07867
-d 4 10 2.01211
-d 5 10 2.43309
-d 6 10 3.27194
-d 7 10 3.63896
-d 8 10 3.90426
-d 9 10 4.11074
-d 10 10 4.27932
-d 11 10 4.41496
-d 12 10 4.52543
-d 13 10 4.61491
-d 14 10 4.68862
-d 15 10 4.7479
-d 16 10 4.79666
-d 17 10 4.72895
-d 18 10 4.68886
-d 19 10 4.70354
-d 20 10 4.81353
-d 21 10 5.01568
-d 22 10 5.14184
-d 23 10 5.10482
-d 24 10 5.07362
-d 25 10 5.05143
-d 26 10 5.03638
-d 27 10 5.02323
-d 28 10 5.01465
-d 29 10 5.00853
-d 30 10 5.00383
-d 31 10 4.99985
-d 32 10 5.00454
-d 33 10 5.00652
-d 34 10 5.00546
-d 35 10 5.00411
-d 36 10 5.003
-d 37 10 5.00214
-d 38 10 5.00151
-d 39 10 5.00106
-d 40 10 5.00073
-d 41 10 5.0005
-d 42 10 5.00034
-d 43 10 5.00023
-d 44 10 5.00015
-d 45 10 5.0001
-d 46 10 5.00005
-d 47 10 5.0
-d 48 10 5.00001
-d 49 10 5.00005
-d 50 10 5.00005
-d 51 10 5.00003
-d 52 10 5.0
-d 53 10 4.99998
-d 54 10 4.99996
-d 55 10 4.99994
-d 56 10 4.99995
-d 57 10 4.99997
-d 58 10 4.99998
-d 59 10 5.0
-d 60 10 5.00001
-d 61 10 5.00002
-d 62 10 5.00002
-d 63 10 5.00003
-d 64 10 5.00003
-d 65 10 5.00003
-d 66 10 5.00003
-d 67 10 5.00003
-d 68 10 5.00003
-d 69 10 5.00002
-d 70 10 5.00002
-d 71 10 5.00001
-d 72 10 5.00001
-d 73 10 5.00001
-d 74 10 5.0
-d 75 10 5.0
-d 76 10 5.0
-d 77 10 4.99999
-d 78 10 4.99999
-d 79 10 4.99999
-d 80 10 4.99999
-d 81 10 4.99999
-d 82 10 4.99999
-d 83 10 4.99999
-d 84 10 4.99999
-d 85 10 4.99999
-d 86 10 4.99998
-d 87 10 4.99998
-d 88 10 4.99998
-d 89 10 4.99999
-d 90 10 4.99999
-d 91 10 4.99999
-d 92 10 4.99999
-d 93 10 5.0
-d 94 10 5.0
-d 95 10 5.0
-d 96 10 5.0
-d 97 10 5.00001
-d 98 10 5.00001
-d 99 10 5.00001
-d 100 10 5.00001
-d 101 10 5.00001
-d 102 10 5.00001
-d 103 10 5.00001
-d 104 10 5.00001
-d 105 10 5.00001
-d 106 10 5.00001
-d 107 10 5.00001
-d 108 10 5.00001
-d 109 10 5.00001
-d 110 10 5.00001
-d 111 10 5.00001
-d 112 10 5.00001
-d 113 10 5.00001
-d 114 10 5.00001
-d 115 10 5.00001
-d 116 10 5.00001
-d 117 10 5.00001
-d 118 10 5.00001
-d 119 10 5.00001
-d 120 10 5.00001
-d 121 10 5.00001
-d 122 10 5.17392
-d 123 10 4.94828
-d 124 10 3.78491
-d 125 10 1.52079
-d 126 10 0.608874
-d 127 10 0.244031
-d 128 10 0.127087
-d 129 10 0.0552995
-d 130 10 0.0361032
-d 131 10 0.0169025
-d 132 10 0.006364
-d 133 10 0.00217624
-d 134 10 0.000921391
-d 135 10 0.000457305
-d 136 10 0.000786754
-d 137 10 -0.120016
-d 138 10 -0.148054
-d 139 10 -0.15898
-d 140 10 -0.0801463
-d 141 10 0.16463
-d 142 10 0.174017
-d 143 10 0.0799249
-d 144 10 0.0318788
-d 145 10 0.0129696
-d 146 10 0.00483397
-d 147 10 0.0025677
-d 148 10 0.0042079
-d 149 10 0.00350003
-d 150 10 0.00178404
-d 151 10 -8.72902e-05
-d 152 10 -0.00128497
-d 153 10 -0.00142213
-d 154 10 -0.00130018
-d 155 10 -0.00106874
-d 156 10 -0.000789207
-d 157 10 -0.000824335
-d 158 10 -0.00104518
-d 159 10 -0.00136799
-d 160 10 -0.004366
-d 161 10 -0.0102621
-d 162 10 -0.0109254
-d 163 10 -0.00649259
-d 164 10 -0.00194842
-d 165 10 0.00029793
-d 166 10 0.00148673
-d 167 10 0.00221085
-d 168 10 0.00228291
-d 169 10 0.00185261
-d 170 10 0.00139687
-d 171 10 0.00148183
-d 172 10 0.00562266
-d 173 10 0.00844119
-d 174 10 0.00754627
-d 175 10 0.00657396
-d 176 10 0.00591212
-d 177 10 0.00539269
-d 178 10 0.0049282
-d 179 10 0.00448417
-d 180 10 0.0040572
-d 181 10 0.00363719
-d 182 10 0.00320392
-d 183 10 0.00279607
-d 184 10 0.00243938
-d 185 10 0.00211505
-d 186 10 0.00182302
-d 187 10 0.00156254
-d 188 10 0.0013341
-d 189 10 0.00113834
-d 190 10 0.000971865
-d 191 10 0.00082776
-d 192 10 0.000706193
-d 193 10 0.000602499
-d 194 10 0.000515059
-d 195 10 0.000441401
-d 196 10 0.00037897
-d 197 10 0.000325459
-d 198 10 0.00028083
-d 199 10 0.000242096
-d 200 10 0.000207274
-d 201 10 0.000176444
-d 202 10 0.000150372
-d 203 10 0.000126407
-d 204 10 0.000103373
-d 205 10 9.05522e-05
-d 206 10 8.53555e-05
-d 207 10 8.63685e-05
-d 208 10 9.02593e-05
-d 209 10 8.37346e-05
-d 210 10 7.72099e-05
-d 211 10 7.06852e-05
-d 212 10 6.41605e-05
-d 213 10 5.76358e-05
-d 214 10 5.11112e-05
-d 215 10 4.45865e-05
-d 216 10 4.08176e-05
-d 217 10 3.72497e-05
-d 218 10 3.36818e-05
-d 219 10 3.01138e-05
-d 220 10 2.65459e-05
-d 221 10 2.2978e-05
-d 222 10 1.94101e-05
-d 223 10 1.76154e-05
-d 224 10 1.67399e-05
-d 225 10 1.58645e-05
-d 226 10 1.4989e-05
-d 227 10 1.41136e-05
-d 228 10 1.32381e-05
-d 229 10 1.23626e-05
-d 230 10 1.14872e-05
-d 231 10 1.06117e-05
-d 232 10 9.73629e-06
-d 233 10 8.86083e-06
-d 234 10 7.98538e-06
-d 235 10 7.10993e-06
-d 236 10 6.23447e-06
-d 237 10 5.44363e-06
-d 238 10 5.32578e-06
-d 239 10 5.20792e-06
-d 240 10 5.09007e-06
-d 241 10 4.97222e-06
-d 242 10 0.0784323
-d 243 10 0.0474527
-d 244 10 -0.0764232
-d 245 10 -0.151146
-d 246 10 0.0615785
-d 247 10 0.0144489
-d 248 10 0.00974161
-d 249 10 0.00947176
-d 250 10 0.00849005
-d 251 10 0.00728201
-d 252 10 0.00630581
-d 253 10 0.00554032
-d 254 10 0.00487809
-d 255 10 0.00441504
-d 256 10 0.00384139
-d 257 10 -0.118943
-d 258 10 -0.149894
-d 259 10 -0.161173
-d 260 10 -0.0825299
-d 261 10 0.171686
-d 262 10 0.176912
-d 263 10 0.0816085
-d 264 10 0.0335236
-d 265 10 0.013791
-d 266 10 0.0056976
-d 267 10 0.00238833
-d 268 10 0.00105348
-d 269 10 0.000526199
-d 270 10 0.00025969
-d 271 10 0.000396026
-d 272 10 0.000837835
-d 273 10 0.00170131
-d 274 10 0.00196699
-d 275 10 -0.000553314
-d 276 10 -0.0061621
-d 277 10 -0.0111895
-d 278 10 -0.0142698
-d 279 10 -0.0124608
-d 280 10 -0.00795847
-d 281 10 -0.00467822
-d 282 10 -0.0043058
-d 283 10 -0.00874449
-d 284 10 -0.0118584
-d 285 10 -0.00871386
-d 286 10 -0.00377892
-d 287 10 1.95244e-05
-d 288 10 0.00218952
-d 289 10 0.00325486
-d 290 10 0.00386497
-d 291 10 0.00422837
-d 292 10 0.00446883
-d 293 10 0.00447065
-d 294 10 0.00486647
-d 295 10 0.00547838
-d 296 10 0.00565398
-d 297 10 0.00559092
-d 298 10 0.00538752
-d 299 10 0.00507015
-d 300 10 0.00466305
-d 301 10 0.00420756
-d 302 10 0.00373465
-d 303 10 0.00328404
-d 304 10 0.00287059
-d 305 10 0.00250057
-d 306 10 0.00216124
-d 307 10 0.00184861
-d 308 10 0.00156815
-d 309 10 0.00134624
-d 310 10 0.00117857
-d 311 10 0.00103412
-d 312 10 0.0008948
-d 313 10 0.000761012
-d 314 10 0.000619853
-d 315 10 0.000462614
-d 316 10 0.000319965
-d 317 10 0.000287666
-d 318 10 0.000356415
-d 319 10 0.000379946
-d 320 10 0.000339183
-d 321 10 0.00027972
-d 322 10 0.000252982
-d 323 10 0.000226244
-d 324 10 0.000199507
-d 325 10 0.000172769
-d 326 10 0.000146031
-d 327 10 0.000130097
-d 328 10 0.000117578
-d 329 10 0.000105059
-d 330 10 9.25401e-05
-d 331 10 8.00213e-05
-d 332 10 7.11204e-05
-d 333 10 6.67061e-05
-d 334 10 6.22918e-05
-d 335 10 5.78775e-05
-d 336 10 5.34632e-05
-d 337 10 4.90489e-05
-d 338 10 4.46346e-05
-d 339 10 4.02203e-05
-d 340 10 3.5806e-05
-d 341 10 3.13916e-05
-d 342 10 2.69773e-05
-d 343 10 2.4827e-05
-d 344 10 2.31747e-05
-d 345 10 2.15225e-05
-d 346 10 1.98702e-05
-d 347 10 1.8218e-05
-d 348 10 1.65658e-05
-d 349 10 1.49135e-05
-d 350 10 1.32613e-05
-d 351 10 1.1609e-05
-d 352 10 9.95678e-06
-d 353 10 8.50108e-06
-d 354 10 7.86765e-06
-d 355 10 7.23422e-06
-d 356 10 6.60079e-06
-d 357 10 5.96736e-06
-d 358 10 5.33393e-06
-d 359 10 4.7005e-06
-d 360 10 4.06707e-06
-d 361 10 3.43363e-06
-d 1 11 1.86175
-d 2 11 1.99308
-d 3 11 2.16619
-d 4 11 2.46661
-d 5 11 3.09359
-d 6 11 3.76864
-d 7 11 4.31299
-d 8 11 4.65564
-d 9 11 4.83425
-d 10 11 4.92153
-d 11 11 4.96157
-d 12 11 4.98063
-d 13 11 4.98649
-d 14 11 4.99039
-d 15 11 4.9945
-d 16 11 4.9972
-d 17 11 4.96206
-d 18 11 4.89882
-d 19 11 4.83865
-d 20 11 4.83202
-d 21 11 4.91016
-d 22 11 5.04479
-d 23 11 5.06078
-d 24 11 5.04827
-d 25 11 5.03474
-d 26 11 5.0246
-d 27 11 5.01639
-d 28 11 5.00996
-d 29 11 5.00569
-d 30 11 5.00239
-d 31 11 5.00043
-d 32 11 5.00296
-d 33 11 5.00437
-d 34 11 5.00382
-d 35 11 5.00287
-d 36 11 5.00208
-d 37 11 5.00148
-d 38 11 5.00104
-d 39 11 5.00073
-d 40 11 5.0005
-d 41 11 5.00034
-d 42 11 5.00023
-d 43 11 5.00016
-d 44 11 5.00011
-d 45 11 5.00008
-d 46 11 5.00007
-d 47 11 5.00007
-d 48 11 5.00004
-d 49 11 5.0
-d 50 11 4.99998
-d 51 11 4.99998
-d 52 11 4.99997
-d 53 11 4.99998
-d 54 11 4.99999
-d 55 11 5.0
-d 56 11 5.0
-d 57 11 5.00001
-d 58 11 5.00001
-d 59 11 5.00001
-d 60 11 5.00002
-d 61 11 5.00002
-d 62 11 5.00001
-d 63 11 5.00001
-d 64 11 5.00001
-d 65 11 5.00001
-d 66 11 5.0
-d 67 11 5.0
-d 68 11 5.0
-d 69 11 5.0
-d 70 11 5.0
-d 71 11 5.0
-d 72 11 4.99999
-d 73 11 4.99999
-d 74 11 4.99999
-d 75 11 4.99999
-d 76 11 4.99999
-d 77 11 4.99999
-d 78 11 4.99999
-d 79 11 4.99999
-d 80 11 4.99999
-d 81 11 4.99999
-d 82 11 4.99999
-d 83 11 4.99999
-d 84 11 5.0
-d 85 11 5.0
-d 86 11 5.0
-d 87 11 5.0
-d 88 11 5.0
-d 89 11 5.0
-d 90 11 5.0
-d 91 11 5.0
-d 92 11 5.0
-d 93 11 5.00001
-d 94 11 5.00001
-d 95 11 5.00001
-d 96 11 5.00001
-d 97 11 5.00001
-d 98 11 5.00001
-d 99 11 5.00001
-d 100 11 5.00001
-d 101 11 5.00001
-d 102 11 5.00001
-d 103 11 5.00001
-d 104 11 5.00001
-d 105 11 5.00001
-d 106 11 5.00001
-d 107 11 5.00001
-d 108 11 5.00001
-d 109 11 5.00001
-d 110 11 5.00001
-d 111 11 5.00001
-d 112 11 5.00001
-d 113 11 5.00001
-d 114 11 5.0
-d 115 11 5.0
-d 116 11 5.0
-d 117 11 5.0
-d 118 11 5.0
-d 119 11 5.0
-d 120 11 5.0
-d 121 11 5.0
-d 122 11 5.10081
-d 123 11 5.10949
-d 124 11 4.98359
-d 125 11 5.00733
-d 126 11 5.15145
-d 127 11 4.37298
-d 128 11 2.36126
-d 129 11 0.470759
-d 130 11 0.0577238
-d 131 11 0.0115884
-d 132 11 0.00262611
-d 133 11 0.000671499
-d 134 11 0.000389038
-d 135 11 0.000291291
-d 136 11 0.000317347
-d 137 11 -0.0167823
-d 138 11 -0.0158344
-d 139 11 -0.0140559
-d 140 11 0.0104849
-d 141 11 0.0865874
-d 142 11 0.107813
-d 143 11 0.0524688
-d 144 11 0.0214369
-d 145 11 0.00876443
-d 146 11 0.00341595
-d 147 11 0.00170778
-d 148 11 0.00259042
-d 149 11 0.0022241
-d 150 11 0.00118519
-d 151 11 1.10217e-06
-d 152 11 -0.000784506
-d 153 11 -0.000948169
-d 154 11 -0.000856256
-d 155 11 -0.000696719
-d 156 11 -0.000485987
-d 157 11 -0.000724787
-d 158 11 -0.000981491
-d 159 11 -0.001454
-d 160 11 -0.00552498
-d 161 11 -0.0114992
-d 162 11 -0.0105266
-d 163 11 -0.00543527
-d 164 11 -0.000982798
-d 165 11 0.00127356
-d 166 11 0.00224212
-d 167 11 0.00275439
-d 168 11 0.00281098
-d 169 11 0.0025471
-d 170 11 0.00230368
-d 171 11 0.00222576
-d 172 11 0.00485522
-d 173 11 0.00729453
-d 174 11 0.00691796
-d 175 11 0.0062615
-d 176 11 0.00573987
-d 177 11 0.0052688
-d 178 11 0.00481185
-d 179 11 0.00436934
-d 180 11 0.00394326
-d 181 11 0.00352712
-d 182 11 0.00309978
-d 183 11 0.00270038
-d 184 11 0.00235335
-d 185 11 0.00203742
-d 186 11 0.00175256
-d 187 11 0.00150067
-d 188 11 0.00128126
-d 189 11 0.00109323
-d 190 11 0.000933619
-d 191 11 0.000795113
-d 192 11 0.000678182
-d 193 11 0.00057843
-d 194 11 0.000494345
-d 195 11 0.000423609
-d 196 11 0.000363821
-d 197 11 0.000312766
-d 198 11 0.000269856
-d 199 11 0.000232389
-d 200 11 0.000198382
-d 201 11 0.000168126
-d 202 11 0.00014267
-d 203 11 0.000119293
-d 204 11 9.69034e-05
-d 205 11 8.5669e-05
-d 206 11 8.26828e-05
-d 207 11 8.64066e-05
-d 208 11 9.26665e-05
-d 209 11 8.5454e-05
-d 210 11 7.82416e-05
-d 211 11 7.10291e-05
-d 212 11 6.38167e-05
-d 213 11 5.66043e-05
-d 214 11 4.93918e-05
-d 215 11 4.21794e-05
-d 216 11 3.86073e-05
-d 217 11 3.53007e-05
-d 218 11 3.19941e-05
-d 219 11 2.86876e-05
-d 220 11 2.5381e-05
-d 221 11 2.20744e-05
-d 222 11 1.87678e-05
-d 223 11 1.70933e-05
-d 224 11 1.62648e-05
-d 225 11 1.54363e-05
-d 226 11 1.46079e-05
-d 227 11 1.37794e-05
-d 228 11 1.2951e-05
-d 229 11 1.21225e-05
-d 230 11 1.12941e-05
-d 231 11 1.04656e-05
-d 232 11 9.63716e-06
-d 233 11 8.80871e-06
-d 234 11 7.98026e-06
-d 235 11 7.1518e-06
-d 236 11 6.32335e-06
-d 237 11 5.5374e-06
-d 238 11 5.08959e-06
-d 239 11 4.64178e-06
-d 240 11 4.19397e-06
-d 241 11 3.74616e-06
-d 242 11 0.0438026
-d 243 11 0.0242078
-d 244 11 -0.0602019
-d 245 11 -0.0840866
-d 246 11 0.00148461
-d 247 11 -0.00292489
-d 248 11 0.000442098
-d 249 11 0.00219489
-d 250 11 0.00281478
-d 251 11 0.00290756
-d 252 11 0.00277945
-d 253 11 0.00263896
-d 254 11 0.00240099
-d 255 11 0.00223283
-d 256 11 0.001947
-d 257 11 -0.0153629
-d 258 11 -0.0148815
-d 259 11 -0.0128673
-d 260 11 0.0126017
-d 261 11 0.0905161
-d 262 11 0.11051
-d 263 11 0.0538958
-d 264 11 0.022562
-d 265 11 0.00935726
-d 266 11 0.00397422
-d 267 11 0.00172534
-d 268 11 0.000790207
-d 269 11 0.000416322
-d 270 11 0.000191632
-d 271 11 0.000469721
-d 272 11 0.0009779
-d 273 11 0.00192566
-d 274 11 0.00200688
-d 275 11 -0.0016502
-d 276 11 -0.00733932
-d 277 11 -0.0128113
-d 278 11 -0.0147608
-d 279 11 -0.0115456
-d 280 11 -0.00668995
-d 281 11 -0.00401368
-d 282 11 -0.00463908
-d 283 11 -0.0101197
-d 284 11 -0.0118993
-d 285 11 -0.0076276
-d 286 11 -0.00262656
-d 287 11 0.000813059
-d 288 11 0.00264455
-d 289 11 0.00350796
-d 290 11 0.00399494
-d 291 11 0.0043049
-d 292 11 0.00451658
-d 293 11 0.00444739
-d 294 11 0.00503842
-d 295 11 0.00559516
-d 296 11 0.00568213
-d 297 11 0.00556459
-d 298 11 0.0053176
-d 299 11 0.00496654
-d 300 11 0.00454337
-d 301 11 0.00408592
-d 302 11 0.00362171
-d 303 11 0.00317793
-d 304 11 0.00277001
-d 305 11 0.00240394
-d 306 11 0.00207009
-d 307 11 0.00176575
-d 308 11 0.00149725
-d 309 11 0.00129045
-d 310 11 0.00114257
-d 311 11 0.00101135
-d 312 11 0.000871672
-d 313 11 0.000723764
-d 314 11 0.000580438
-d 315 11 0.000427507
-d 316 11 0.000296956
-d 317 11 0.000281834
-d 318 11 0.000376628
-d 319 11 0.000412266
-d 320 11 0.000367547
-d 321 11 0.000295305
-d 322 11 0.000264513
-d 323 11 0.000233721
-d 324 11 0.000202929
-d 325 11 0.000172137
-d 326 11 0.000141345
-d 327 11 0.000124721
-d 328 11 0.000112577
-d 329 11 0.000100433
-d 330 11 8.82893e-05
-d 331 11 7.61453e-05
-d 332 11 6.75517e-05
-d 333 11 6.33609e-05
-d 334 11 5.91701e-05
-d 335 11 5.49792e-05
-d 336 11 5.07884e-05
-d 337 11 4.65976e-05
-d 338 11 4.24067e-05
-d 339 11 3.82159e-05
-d 340 11 3.40251e-05
-d 341 11 2.98342e-05
-d 342 11 2.56434e-05
-d 343 11 2.36401e-05
-d 344 11 2.21181e-05
-d 345 11 2.05961e-05
-d 346 11 1.90741e-05
-d 347 11 1.75521e-05
-d 348 11 1.60301e-05
-d 349 11 1.45081e-05
-d 350 11 1.29861e-05
-d 351 11 1.14641e-05
-d 352 11 9.94208e-06
-d 353 11 8.59252e-06
-d 354 11 7.96439e-06
-d 355 11 7.33626e-06
-d 356 11 6.70813e-06
-d 357 11 6.07999e-06
-d 358 11 5.45186e-06
-d 359 11 4.82373e-06
-d 360 11 4.1956e-06
-d 361 11 3.56747e-06
-d 1 12 1.86175
-d 2 12 1.73419
-d 3 12 1.42874
-d 4 12 1.04055
-d 5 12 0.943004
-d 6 12 0.268275
-d 7 12 0.0826455
-d 8 12 0.0388346
-d 9 12 0.0214104
-d 10 12 0.0135431
-d 11 12 0.00961322
-d 12 12 0.00712846
-d 13 12 0.00588262
-d 14 12 0.00432397
-d 15 12 0.00377774
-d 16 12 0.00270134
-d 17 12 -0.00393731
-d 18 12 -0.00542187
-d 19 12 -0.00126596
-d 20 12 0.0113777
-d 21 12 0.0134522
-d 22 12 0.00477056
-d 23 12 -0.00211067
-d 24 12 -0.00229253
-d 25 12 -0.00173355
-d 26 12 -0.00122404
-d 27 12 -0.00113426
-d 28 12 -0.000744931
-d 29 12 -0.000520112
-d 30 12 -0.000410048
-d 31 12 -0.000220439
-d 32 12 0.000508104
-d 33 12 5.15856e-05
-d 34 12 -0.000112593
-d 35 12 -0.000118917
-d 36 12 -9.57394e-05
-d 37 12 -7.15727e-05
-d 38 12 -5.11847e-05
-d 39 12 -3.58275e-05
-d 40 12 -2.47166e-05
-d 41 12 -1.68866e-05
-d 42 12 -1.14082e-05
-d 43 12 -7.66646e-06
-d 44 12 -5.12139e-06
-d 45 12 -3.63426e-06
-d 46 12 -3.01815e-06
-d 47 12 -2.64862e-06
-d 48 12 -1.4947e-06
-d 49 12 -1.91403e-07
-d 50 12 -2.5763e-08
-d 51 12 -7.73699e-07
-d 52 12 -1.52164e-06
-d 53 12 -1.07268e-06
-d 54 12 -3.81696e-07
-d 55 12 2.6727e-07
-d 56 12 4.75489e-07
-d 57 12 6.83708e-07
-d 58 12 8.91926e-07
-d 59 12 1.10014e-06
-d 60 12 1.30836e-06
-d 61 12 1.2482e-06
-d 62 12 1.00726e-06
-d 63 12 7.66311e-07
-d 64 12 5.25364e-07
-d 65 12 2.84417e-07
-d 66 12 6.27857e-08
-d 67 12 7.43904e-10
-d 68 12 -6.12979e-08
-d 69 12 -1.2334e-07
-d 70 12 -1.85382e-07
-d 71 12 -2.47423e-07
-d 72 12 -3.09465e-07
-d 73 12 -3.71507e-07
-d 74 12 -4.33549e-07
-d 75 12 -4.95591e-07
-d 76 12 -5.57633e-07
-d 77 12 -6.04571e-07
-d 78 12 -5.4944e-07
-d 79 12 -4.9431e-07
-d 80 12 -4.3918e-07
-d 81 12 -3.84049e-07
-d 82 12 -3.28919e-07
-d 83 12 -2.73789e-07
-d 84 12 -2.18659e-07
-d 85 12 -1.63528e-07
-d 86 12 -1.08398e-07
-d 87 12 -5.32678e-08
-d 88 12 1.062e-09
-d 89 12 5.08502e-08
-d 90 12 1.00638e-07
-d 91 12 1.50427e-07
-d 92 12 2.00215e-07
-d 93 12 2.50003e-07
-d 94 12 2.99791e-07
-d 95 12 3.4958e-07
-d 96 12 3.99368e-07
-d 97 12 4.49156e-07
-d 98 12 4.98944e-07
-d 99 12 5.34512e-07
-d 100 12 5.01032e-07
-d 101 12 4.67553e-07
-d 102 12 4.34073e-07
-d 103 12 4.00593e-07
-d 104 12 3.67113e-07
-d 105 12 3.33633e-07
-d 106 12 3.00153e-07
-d 107 12 2.66674e-07
-d 108 12 2.33194e-07
-d 109 12 1.99714e-07
-d 110 12 1.66234e-07
-d 111 12 1.32754e-07
-d 112 12 9.92744e-08
-d 113 12 6.57945e-08
-d 114 12 3.23147e-08
-d 115 12 -1.16513e-09
-d 116 12 -3.4645e-08
-d 117 12 -6.81248e-08
-d 118 12 -1.01605e-07
-d 119 12 -1.35084e-07
-d 120 12 -1.68564e-07
-d 121 12 -2.18729e-07
-d 122 12 0.0114926
-d 123 12 -0.0245378
-d 124 12 -0.111828
-d 125 12 0.0964775
-d 126 12 1.61491
-d 127 12 3.22668
-d 128 12 4.22041
-d 129 12 4.54492
-d 130 12 4.82845
-d 131 12 4.94868
-d 132 12 4.98588
-d 133 12 4.99609
-d 134 12 4.9981
-d 135 12 4.99908
-d 136 12 4.99788
-d 137 12 4.98395
-d 138 12 4.99294
-d 139 12 4.99724
-d 140 12 5.01939
-d 141 12 5.0471
-d 142 12 5.00902
-d 143 12 4.98194
-d 144 12 4.98496
-d 145 12 4.99188
-d 146 12 4.99623
-d 147 12 4.99862
-d 148 12 5.00025
-d 149 12 4.99974
-d 150 12 4.99953
-d 151 12 4.99946
-d 152 12 4.99958
-d 153 12 5.00012
-d 154 12 4.99997
-d 155 12 4.99992
-d 156 12 4.99988
-d 157 12 4.99985
-d 158 12 4.9998
-d 159 12 4.9997
-d 160 12 4.9988
-d 161 12 4.99806
-d 162 12 4.99982
-d 163 12 5.00143
-d 164 12 5.00159
-d 165 12 5.00098
-d 166 12 5.00053
-d 167 12 5.00028
-d 168 12 5.00007
-d 169 12 4.99977
-d 170 12 4.99992
-d 171 12 5.00005
-d 172 12 5.00133
-d 173 12 5.0009
-d 174 12 4.99993
-d 175 12 4.99972
-d 176 12 4.99975
-d 177 12 4.9998
-d 178 12 4.99982
-d 179 12 4.99983
-d 180 12 4.99983
-d 181 12 4.99983
-d 182 12 4.99983
-d 183 12 4.99984
-d 184 12 4.99986
-d 185 12 4.99987
-d 186 12 4.99989
-d 187 12 4.9999
-d 188 12 4.99991
-d 189 12 4.99992
-d 190 12 4.99994
-d 191 12 4.99995
-d 192 12 4.99995
-d 193 12 4.99996
-d 194 12 4.99997
-d 195 12 4.99997
-d 196 12 4.99998
-d 197 12 4.99998
-d 198 12 4.99998
-d 199 12 4.99998
-d 200 12 4.99999
-d 201 12 4.99999
-d 202 12 4.99999
-d 203 12 4.99999
-d 204 12 4.99999
-d 205 12 4.99999
-d 206 12 4.99999
-d 207 12 5.0
-d 208 12 5.0
-d 209 12 5.0
-d 210 12 5.00001
-d 211 12 5.00001
-d 212 12 5.00001
-d 213 12 5.00002
-d 214 12 5.00002
-d 215 12 5.00002
-d 216 12 5.00002
-d 217 12 5.00002
-d 218 12 5.00001
-d 219 12 5.00001
-d 220 12 5.00001
-d 221 12 5.0
-d 222 12 5.0
-d 223 12 5.0
-d 224 12 5.0
-d 225 12 5.0
-d 226 12 5.0
-d 227 12 5.0
-d 228 12 5.0
-d 229 12 4.99999
-d 230 12 4.99999
-d 231 12 4.99999
-d 232 12 4.99999
-d 233 12 4.99999
-d 234 12 4.99999
-d 235 12 4.99999
-d 236 12 4.99999
-d 237 12 4.99999
-d 238 12 4.99999
-d 239 12 4.99999
-d 240 12 5.0
-d 241 12 5.0
-d 242 12 5.01457
-d 243 12 4.99482
-d 244 12 4.96561
-d 245 12 4.99326
-d 246 12 5.03452
-d 247 12 5.00424
-d 248 12 5.00101
-d 249 12 5.00045
-d 250 12 5.00004
-d 251 12 4.99965
-d 252 12 4.99997
-d 253 12 4.99994
-d 254 12 4.99958
-d 255 12 4.99999
-d 256 12 4.99936
-d 257 12 4.9839
-d 258 12 4.99248
-d 259 12 4.99717
-d 260 12 5.01976
-d 261 12 5.04869
-d 262 12 5.0087
-d 263 12 4.98143
-d 264 12 4.98488
-d 265 12 4.99199
-d 266 12 4.99622
-d 267 12 4.9983
-d 268 12 4.99928
-d 269 12 4.99971
-d 270 12 4.99986
-d 271 12 5.00031
-d 272 12 5.00022
-d 273 12 5.00035
-d 274 12 5.0001
-d 275 12 4.99884
-d 276 12 4.99811
-d 277 12 4.99803
-d 278 12 4.99887
-d 279 12 5.00078
-d 280 12 5.00151
-d 281 12 5.00116
-d 282 12 5.00007
-d 283 12 4.99843
-d 284 12 4.99915
-d 285 12 5.00107
-d 286 12 5.00168
-d 287 12 5.00141
-d 288 12 5.00092
-d 289 12 5.00055
-d 290 12 5.0003
-d 291 12 5.00016
-d 292 12 5.0001
-d 293 12 5.00001
-d 294 12 5.00016
-d 295 12 5.0002
-d 296 12 5.00009
-d 297 12 4.99993
-d 298 12 4.99975
-d 299 12 4.99984
-d 300 12 4.99991
-d 301 12 4.99991
-d 302 12 4.99982
-d 303 12 4.99974
-d 304 12 4.99974
-d 305 12 4.99985
-d 306 12 4.99995
-d 307 12 4.99999
-d 308 12 4.99998
-d 309 12 5.00004
-d 310 12 5.00013
-d 311 12 5.00015
-d 312 12 5.00007
-d 313 12 4.99988
-d 314 12 4.99982
-d 315 12 4.99985
-d 316 12 4.99995
-d 317 12 5.00006
-d 318 12 5.0002
-d 319 12 5.00025
-d 320 12 5.0002
-d 321 12 5.00009
-d 322 12 5.00006
-d 323 12 5.00004
-d 324 12 5.00002
-d 325 12 5.0
-d 326 12 4.99998
-d 327 12 4.99997
-d 328 12 4.99998
-d 329 12 4.99998
-d 330 12 4.99999
-d 331 12 4.99999
-d 332 12 4.99999
-d 333 12 5.0
-d 334 12 5.0
-d 335 12 5.0
-d 336 12 5.0
-d 337 12 5.0
-d 338 12 5.00001
-d 339 12 5.00001
-d 340 12 5.00001
-d 341 12 5.00001
-d 342 12 5.00001
-d 343 12 5.00001
-d 344 12 5.00001
-d 345 12 5.00001
-d 346 12 5.00001
-d 347 12 5.00001
-d 348 12 5.00001
-d 349 12 5.00001
-d 350 12 5.0
-d 351 12 5.0
-d 352 12 5.0
-d 353 12 5.0
-d 354 12 5.0
-d 355 12 4.99999
-d 356 12 4.99999
-d 357 12 4.99999
-d 358 12 4.99999
-d 359 12 4.99998
-d 360 12 4.99998
-d 361 12 4.99998
-d 1 13 5.0
-d 2 13 5.16975
-d 3 13 4.78685
-d 4 13 2.94241
-d 5 13 0.126698
-d 6 13 0.0487004
-d 7 13 -0.00422591
-d 8 13 -0.00130689
-d 9 13 -0.000486756
-d 10 13 -0.000195875
-d 11 13 -0.000108988
-d 12 13 -6.66736e-05
-d 13 13 -7.26005e-05
-d 14 13 -5.63608e-05
-d 15 13 -3.81859e-05
-d 16 13 -2.123e-05
-d 17 13 -0.0646846
-d 18 13 -0.0184474
-d 19 13 0.182248
-d 20 13 1.06731
-d 21 13 3.10988
-d 22 13 4.46133
-d 23 13 4.84133
-d 24 13 4.95113
-d 25 13 4.98364
-d 26 13 4.99455
-d 27 13 4.99694
-d 28 13 4.99727
-d 29 13 4.9994
-d 30 13 4.99975
-d 31 13 5.0001
-d 32 13 5.00132
-d 33 13 5.00089
-d 34 13 5.00039
-d 35 13 5.00019
-d 36 13 5.00011
-d 37 13 5.00006
-d 38 13 5.00005
-d 39 13 5.00004
-d 40 13 5.00001
-d 41 13 4.99992
-d 42 13 4.99992
-d 43 13 5.00002
-d 44 13 5.00013
-d 45 13 5.00017
-d 46 13 5.00009
-d 47 13 4.99992
-d 48 13 4.99991
-d 49 13 4.99994
-d 50 13 4.99996
-d 51 13 4.99998
-d 52 13 4.99999
-d 53 13 5.00001
-d 54 13 5.00004
-d 55 13 5.00006
-d 56 13 5.00005
-d 57 13 5.00004
-d 58 13 5.00003
-d 59 13 5.00002
-d 60 13 5.00001
-d 61 13 5.0
-d 62 13 4.99999
-d 63 13 4.99999
-d 64 13 4.99998
-d 65 13 4.99998
-d 66 13 4.99997
-d 67 13 4.99997
-d 68 13 4.99998
-d 69 13 4.99998
-d 70 13 4.99998
-d 71 13 4.99998
-d 72 13 4.99999
-d 73 13 4.99999
-d 74 13 4.99999
-d 75 13 4.99999
-d 76 13 5.0
-d 77 13 5.0
-d 78 13 5.0
-d 79 13 5.0
-d 80 13 5.0
-d 81 13 5.0
-d 82 13 5.00001
-d 83 13 5.00001
-d 84 13 5.00001
-d 85 13 5.00001
-d 86 13 5.00001
-d 87 13 5.00001
-d 88 13 5.00002
-d 89 13 5.00001
-d 90 13 5.00001
-d 91 13 5.00001
-d 92 13 5.00001
-d 93 13 5.00001
-d 94 13 5.00001
-d 95 13 5.00001
-d 96 13 5.0
-d 97 13 5.0
-d 98 13 5.0
-d 99 13 5.0
-d 100 13 5.0
-d 101 13 5.0
-d 102 13 5.0
-d 103 13 5.0
-d 104 13 5.0
-d 105 13 5.0
-d 106 13 5.0
-d 107 13 5.0
-d 108 13 5.0
-d 109 13 5.0
-d 110 13 5.0
-d 111 13 5.0
-d 112 13 5.0
-d 113 13 5.0
-d 114 13 4.99999
-d 115 13 4.99999
-d 116 13 4.99999
-d 117 13 4.99999
-d 118 13 4.99999
-d 119 13 4.99999
-d 120 13 4.99999
-d 121 13 5.0
-d 122 13 5.14699
-d 123 13 4.78074
-d 124 13 3.19424
-d 125 13 0.305663
-d 126 13 0.0611255
-d 127 13 -0.00179951
-d 128 13 -0.0012032
-d 129 13 0.000405978
-d 130 13 0.000989399
-d 131 13 0.000445194
-d 132 13 0.000191447
-d 133 13 8.30476e-05
-d 134 13 3.96236e-05
-d 135 13 1.91866e-05
-d 136 13 1.70665e-05
-d 137 13 -0.0655239
-d 138 13 -0.0210234
-d 139 13 0.1827
-d 140 13 1.06848
-d 141 13 3.11554
-d 142 13 4.46518
-d 143 13 4.84212
-d 144 13 4.94853
-d 145 13 4.98244
-d 146 13 4.99434
-d 147 13 4.9997
-d 148 13 5.00081
-d 149 13 5.00009
-d 150 13 4.99972
-d 151 13 4.99985
-d 152 13 4.99974
-d 153 13 4.9995
-d 154 13 4.99949
-d 155 13 4.99958
-d 156 13 4.99973
-d 157 13 4.99948
-d 158 13 4.99914
-d 159 13 4.99874
-d 160 13 4.99946
-d 161 13 5.00309
-d 162 13 5.0091
-d 163 13 5.01576
-d 164 13 5.01835
-d 165 13 5.01852
-d 166 13 5.0176
-d 167 13 5.01625
-d 168 13 5.01479
-d 169 13 5.01345
-d 170 13 5.01264
-d 171 13 5.011
-d 172 13 5.01092
-d 173 13 5.01344
-d 174 13 5.01363
-d 175 13 5.01289
-d 176 13 5.01184
-d 177 13 5.01071
-d 178 13 5.00956
-d 179 13 5.00848
-d 180 13 5.00751
-d 181 13 5.00663
-d 182 13 5.00577
-d 183 13 5.00497
-d 184 13 5.00427
-d 185 13 5.00365
-d 186 13 5.0031
-d 187 13 5.00264
-d 188 13 5.00224
-d 189 13 5.00191
-d 190 13 5.00163
-d 191 13 5.00138
-d 192 13 5.00117
-d 193 13 5.00099
-d 194 13 5.00083
-d 195 13 5.00071
-d 196 13 5.00061
-d 197 13 5.00053
-d 198 13 5.00045
-d 199 13 5.00037
-d 200 13 5.00029
-d 201 13 5.00022
-d 202 13 5.00019
-d 203 13 5.0002
-d 204 13 5.00023
-d 205 13 5.00024
-d 206 13 5.00023
-d 207 13 5.00023
-d 208 13 5.00022
-d 209 13 5.0002
-d 210 13 5.00018
-d 211 13 5.00016
-d 212 13 5.00014
-d 213 13 5.00011
-d 214 13 5.00009
-d 215 13 5.00007
-d 216 13 5.00006
-d 217 13 5.00005
-d 218 13 5.00005
-d 219 13 5.00004
-d 220 13 5.00003
-d 221 13 5.00002
-d 222 13 5.00001
-d 223 13 5.00001
-d 224 13 5.00001
-d 225 13 5.00001
-d 226 13 5.00001
-d 227 13 5.00001
-d 228 13 5.00001
-d 229 13 5.00001
-d 230 13 5.00001
-d 231 13 5.00002
-d 232 13 5.00002
-d 233 13 5.00002
-d 234 13 5.00002
-d 235 13 5.00002
-d 236 13 5.00002
-d 237 13 5.00002
-d 238 13 5.00002
-d 239 13 5.00001
-d 240 13 5.00001
-d 241 13 5.00001
-d 242 13 5.14298
-d 243 13 4.79809
-d 244 13 3.32704
-d 245 13 0.498385
-d 246 13 0.105773
-d 247 13 0.0160646
-d 248 13 0.0319912
-d 249 13 0.0299434
-d 250 13 0.0240102
-d 251 13 0.0185844
-d 252 13 0.0130411
-d 253 13 0.0106532
-d 254 13 0.00864871
-d 255 13 0.00744519
-d 256 13 0.00660887
-d 257 13 -0.0612913
-d 258 13 -0.0203719
-d 259 13 0.174998
-d 260 13 0.991787
-d 261 13 3.06292
-d 262 13 4.60005
-d 263 13 4.93058
-d 264 13 4.98917
-d 265 13 5.00033
-d 266 13 4.9999
-d 267 13 4.99909
-d 268 13 4.9966
-d 269 13 4.9955
-d 270 13 4.99488
-d 271 13 4.99374
-d 272 13 4.9943
-d 273 13 5.00131
-d 274 13 5.00506
-d 275 13 4.99311
-d 276 13 4.96288
-d 277 13 4.93567
-d 278 13 4.92439
-d 279 13 4.94236
-d 280 13 4.9732
-d 281 13 4.98864
-d 282 13 4.99458
-d 283 13 5.00031
-d 284 13 5.00694
-d 285 13 5.01525
-d 286 13 5.01945
-d 287 13 5.01998
-d 288 13 5.01953
-d 289 13 5.01874
-d 290 13 5.01766
-d 291 13 5.0164
-d 292 13 5.01509
-d 293 13 5.01326
-d 294 13 5.01423
-d 295 13 5.01455
-d 296 13 5.01361
-d 297 13 5.01245
-d 298 13 5.01122
-d 299 13 5.01002
-d 300 13 5.00888
-d 301 13 5.00783
-d 302 13 5.00687
-d 303 13 5.00596
-d 304 13 5.00514
-d 305 13 5.00442
-d 306 13 5.00379
-d 307 13 5.00325
-d 308 13 5.00279
-d 309 13 5.0024
-d 310 13 5.00208
-d 311 13 5.0018
-d 312 13 5.00153
-d 313 13 5.00126
-d 314 13 5.00107
-d 315 13 5.00094
-d 316 13 5.00085
-d 317 13 5.00078
-d 318 13 5.00072
-d 319 13 5.00063
-d 320 13 5.00053
-d 321 13 5.00042
-d 322 13 5.00038
-d 323 13 5.00034
-d 324 13 5.0003
-d 325 13 5.00027
-d 326 13 5.00023
-d 327 13 5.00021
-d 328 13 5.00019
-d 329 13 5.00017
-d 330 13 5.00015
-d 331 13 5.00013
-d 332 13 5.00012
-d 333 13 5.00011
-d 334 13 5.0001
-d 335 13 5.0001
-d 336 13 5.00009
-d 337 13 5.00008
-d 338 13 5.00007
-d 339 13 5.00007
-d 340 13 5.00006
-d 341 13 5.00005
-d 342 13 5.00005
-d 343 13 5.00004
-d 344 13 5.00004
-d 345 13 5.00003
-d 346 13 5.00003
-d 347 13 5.00002
-d 348 13 5.00002
-d 349 13 5.00002
-d 350 13 5.00001
-d 351 13 5.00001
-d 352 13 5.0
-d 353 13 5.0
-d 354 13 5.0
-d 355 13 5.00001
-d 356 13 5.00001
-d 357 13 5.00001
-d 358 13 5.00002
-d 359 13 5.00002
-d 360 13 5.00002
-d 361 13 5.00002
-d 1 14 9.73784e-10
-d 2 14 0.0189926
-d 3 14 0.0926769
-d 4 14 0.206309
-d 5 14 0.111533
-d 6 14 0.0953491
-d 7 14 0.0426966
-d 8 14 0.0214177
-d 9 14 0.0117943
-d 10 14 0.00741442
-d 11 14 0.00528816
-d 12 14 0.00398417
-d 13 14 0.0032967
-d 14 14 0.00266499
-d 15 14 0.00206647
-d 16 14 0.00158788
-d 17 14 -0.0371391
-d 18 14 -0.0439528
-d 19 14 -0.0408653
-d 20 14 -0.0188706
-d 21 14 0.0150241
-d 22 14 0.0126852
-d 23 14 0.00209817
-d 24 14 -0.000239206
-d 25 14 -5.31488e-05
-d 26 14 0.000876324
-d 27 14 -0.00451221
-d 28 14 -0.0165223
-d 29 14 -0.0284127
-d 30 14 -0.0427584
-d 31 14 -0.0502453
-d 32 14 -0.0257366
-d 33 14 -0.00903938
-d 34 14 -0.00376456
-d 35 14 -0.00233385
-d 36 14 -0.00169922
-d 37 14 -0.00130397
-d 38 14 -0.00102542
-d 39 14 -0.000811435
-d 40 14 -0.000648115
-d 41 14 -0.000529266
-d 42 14 -0.00043795
-d 43 14 -0.00036574
-d 44 14 -0.00030716
-d 45 14 -0.00026221
-d 46 14 -0.000229662
-d 47 14 -0.000205112
-d 48 14 -0.000181038
-d 49 14 -0.000162045
-d 50 14 -0.000148988
-d 51 14 -0.000137633
-d 52 14 -0.000126278
-d 53 14 -0.000115562
-d 54 14 -0.000104976
-d 55 14 -9.49324e-05
-d 56 14 -9.0585e-05
-d 57 14 -8.62375e-05
-d 58 14 -8.18901e-05
-d 59 14 -7.75426e-05
-d 60 14 -7.31952e-05
-d 61 14 -6.93752e-05
-d 62 14 -6.59106e-05
-d 63 14 -6.24461e-05
-d 64 14 -5.89815e-05
-d 65 14 -5.55169e-05
-d 66 14 -5.22412e-05
-d 67 14 -5.05263e-05
-d 68 14 -4.88114e-05
-d 69 14 -4.70966e-05
-d 70 14 -4.53817e-05
-d 71 14 -4.36668e-05
-d 72 14 -4.19519e-05
-d 73 14 -4.0237e-05
-d 74 14 -3.85222e-05
-d 75 14 -3.68073e-05
-d 76 14 -3.50924e-05
-d 77 14 -3.34782e-05
-d 78 14 -3.25442e-05
-d 79 14 -3.16102e-05
-d 80 14 -3.06763e-05
-d 81 14 -2.97423e-05
-d 82 14 -2.88083e-05
-d 83 14 -2.78744e-05
-d 84 14 -2.69404e-05
-d 85 14 -2.60064e-05
-d 86 14 -2.50725e-05
-d 87 14 -2.41385e-05
-d 88 14 -2.32635e-05
-d 89 14 -2.27232e-05
-d 90 14 -2.21829e-05
-d 91 14 -2.16426e-05
-d 92 14 -2.11023e-05
-d 93 14 -2.0562e-05
-d 94 14 -2.00217e-05
-d 95 14 -1.94814e-05
-d 96 14 -1.89411e-05
-d 97 14 -1.84007e-05
-d 98 14 -1.78604e-05
-d 99 14 -1.73647e-05
-d 100 14 -1.70853e-05
-d 101 14 -1.68059e-05
-d 102 14 -1.65265e-05
-d 103 14 -1.62471e-05
-d 104 14 -1.59677e-05
-d 105 14 -1.56883e-05
-d 106 14 -1.54089e-05
-d 107 14 -1.51295e-05
-d 108 14 -1.48501e-05
-d 109 14 -1.45707e-05
-d 110 14 -1.42913e-05
-d 111 14 -1.40119e-05
-d 112 14 -1.37325e-05
-d 113 14 -1.34531e-05
-d 114 14 -1.31737e-05
-d 115 14 -1.28943e-05
-d 116 14 -1.26149e-05
-d 117 14 -1.23355e-05
-d 118 14 -1.20561e-05
-d 119 14 -1.17767e-05
-d 120 14 -1.14973e-05
-d 121 14 -1.10954e-05
-d 122 14 0.0152675
-d 123 14 0.0228237
-d 124 14 -0.00460678
-d 125 14 -0.0341525
-d 126 14 0.0232109
-d 127 14 -0.0138039
-d 128 14 -0.0416538
-d 129 14 -0.0458764
-d 130 14 -0.0201967
-d 131 14 -0.00878316
-d 132 14 -0.00379173
-d 133 14 -0.00164621
-d 134 14 -0.000785131
-d 135 14 -0.00037575
-d 136 14 -0.000352375
-d 137 14 -0.0545586
-d 138 14 -0.0746881
-d 139 14 -0.0771865
-d 140 14 -0.05386
-d 141 14 -0.0022199
-d 142 14 0.0136703
-d 143 14 0.00633526
-d 144 14 0.00138826
-d 145 14 -0.00108934
-d 146 14 0.0038886
-d 147 14 0.0298077
-d 148 14 0.0475776
-d 149 14 0.0481003
-d 150 14 0.0464167
-d 151 14 0.047818
-d 152 14 0.042789
-d 153 14 0.035207
-d 154 14 0.0264423
-d 155 14 0.0193959
-d 156 14 0.0151614
-d 157 14 0.00624257
-d 158 14 -0.00913057
-d 159 14 -0.0310696
-d 160 14 -0.0430238
-d 161 14 0.016426
-d 162 14 0.189762
-d 163 14 0.49025
-d 164 14 0.820116
-d 165 14 1.13919
-d 166 14 1.43549
-d 167 14 1.70658
-d 168 14 1.95183
-d 169 14 2.17414
-d 170 14 2.38506
-d 171 14 2.5657
-d 172 14 2.73958
-d 173 14 2.97905
-d 174 14 3.21403
-d 175 14 3.43025
-d 176 14 3.62645
-d 177 14 3.8028
-d 178 14 3.96002
-d 179 14 4.09996
-d 180 14 4.22443
-d 181 14 4.33427
-d 182 14 4.42886
-d 183 14 4.51097
-d 184 14 4.5817
-d 185 14 4.64326
-d 186 14 4.6957
-d 187 14 4.74132
-d 188 14 4.7797
-d 189 14 4.81298
-d 190 14 4.84102
-d 191 14 4.86512
-d 192 14 4.88523
-d 193 14 4.90224
-d 194 14 4.91649
-d 195 14 4.92846
-d 196 14 4.93868
-d 197 14 4.94755
-d 198 14 4.95483
-d 199 14 4.96114
-d 200 14 4.96682
-d 201 14 4.97161
-d 202 14 4.97502
-d 203 14 4.9776
-d 204 14 4.97944
-d 205 14 4.98141
-d 206 14 4.98319
-d 207 14 4.98467
-d 208 14 4.98585
-d 209 14 4.9869
-d 210 14 4.98796
-d 211 14 4.98902
-d 212 14 4.99008
-d 213 14 4.99114
-d 214 14 4.9922
-d 215 14 4.99326
-d 216 14 4.9938
-d 217 14 4.99429
-d 218 14 4.99479
-d 219 14 4.99528
-d 220 14 4.99578
-d 221 14 4.99628
-d 222 14 4.99677
-d 223 14 4.99704
-d 224 14 4.99718
-d 225 14 4.99733
-d 226 14 4.99747
-d 227 14 4.99762
-d 228 14 4.99777
-d 229 14 4.99791
-d 230 14 4.99806
-d 231 14 4.9982
-d 232 14 4.99835
-d 233 14 4.9985
-d 234 14 4.99864
-d 235 14 4.99879
-d 236 14 4.99893
-d 237 14 4.99907
-d 238 14 4.99916
-d 239 14 4.99925
-d 240 14 4.99934
-d 241 14 4.99943
-d 242 14 5.01473
-d 243 14 4.92293
-d 244 14 4.61974
-d 245 14 4.0316
-d 246 14 3.7835
-d 247 14 3.74195
-d 248 14 3.78344
-d 249 14 3.87272
-d 250 14 3.97386
-d 251 14 4.07319
-d 252 14 4.16686
-d 253 14 4.25256
-d 254 14 4.33126
-d 255 14 4.40264
-d 256 14 4.46697
-d 257 14 4.49249
-d 258 14 4.51807
-d 259 14 4.55803
-d 260 14 4.64055
-d 261 14 4.78574
-d 262 14 4.86074
-d 263 14 4.88334
-d 264 14 4.8999
-d 265 14 4.91455
-d 266 14 4.92814
-d 267 14 4.93926
-d 268 14 4.94761
-d 269 14 4.95433
-d 270 14 4.95907
-d 271 14 4.9654
-d 272 14 4.98317
-d 273 14 5.0208
-d 274 14 5.05134
-d 275 14 4.85852
-d 276 14 4.16041
-d 277 14 3.00077
-d 278 14 1.68376
-d 279 14 0.672707
-d 280 14 0.240838
-d 281 14 0.0794725
-d 282 14 -0.0106347
-d 283 14 -0.00879443
-d 284 14 0.107196
-d 285 14 0.368163
-d 286 14 0.701424
-d 287 14 1.03581
-d 288 14 1.3601
-d 289 14 1.6678
-d 290 14 1.95731
-d 291 14 2.22701
-d 292 14 2.47544
-d 293 14 2.69099
-d 294 14 2.92327
-d 295 14 3.16648
-d 296 14 3.3877
-d 297 14 3.59067
-d 298 14 3.77344
-d 299 14 3.93584
-d 300 14 4.08066
-d 301 14 4.20863
-d 302 14 4.32065
-d 303 14 4.41791
-d 304 14 4.50211
-d 305 14 4.57423
-d 306 14 4.63614
-d 307 14 4.68888
-d 308 14 4.73377
-d 309 14 4.7721
-d 310 14 4.80519
-d 311 14 4.83338
-d 312 14 4.85732
-d 313 14 4.87815
-d 314 14 4.89514
-d 315 14 4.90927
-d 316 14 4.92108
-d 317 14 4.93122
-d 318 14 4.94014
-d 319 14 4.94845
-d 320 14 4.95601
-d 321 14 4.96251
-d 322 14 4.96576
-d 323 14 4.969
-d 324 14 4.97225
-d 325 14 4.9755
-d 326 14 4.97874
-d 327 14 4.98087
-d 328 14 4.98265
-d 329 14 4.98442
-d 330 14 4.9862
-d 331 14 4.98797
-d 332 14 4.98924
-d 333 14 4.9899
-d 334 14 4.99055
-d 335 14 4.9912
-d 336 14 4.99186
-d 337 14 4.99251
-d 338 14 4.99316
-d 339 14 4.99381
-d 340 14 4.99447
-d 341 14 4.99512
-d 342 14 4.99577
-d 343 14 4.99609
-d 344 14 4.99634
-d 345 14 4.99659
-d 346 14 4.99683
-d 347 14 4.99708
-d 348 14 4.99732
-d 349 14 4.99757
-d 350 14 4.99782
-d 351 14 4.99806
-d 352 14 4.99831
-d 353 14 4.99853
-d 354 14 4.99863
-d 355 14 4.99873
-d 356 14 4.99883
-d 357 14 4.99893
-d 358 14 4.99903
-d 359 14 4.99913
-d 360 14 4.99923
-d 361 14 4.99933
-d 1 15 1.86175
-d 2 15 2.00147
-d 3 15 1.85141
-d 4 15 1.0654
-d 5 15 0.275481
-d 6 15 0.205547
-d 7 15 0.0712627
-d 8 15 0.0313387
-d 9 15 0.0151431
-d 10 15 0.00864531
-d 11 15 0.00593861
-d 12 15 0.00438111
-d 13 15 0.0037479
-d 14 15 0.00305857
-d 15 15 0.00221221
-d 16 15 0.0017081
-d 17 15 -0.0896128
-d 18 15 -0.109079
-d 19 15 -0.121356
-d 20 15 -0.0542001
-d 21 15 0.175821
-d 22 15 0.177442
-d 23 15 0.0814591
-d 24 15 0.0333042
-d 25 15 0.0134909
-d 26 15 0.00625777
-d 27 15 0.00100092
-d 28 15 -0.00552776
-d 29 15 -0.00411139
-d 30 15 -0.00150395
-d 31 15 -0.000564784
-d 32 15 3.48169e-05
-d 33 15 -0.000287014
-d 34 15 -0.000538515
-d 35 15 -0.000456537
-d 36 15 -0.000325677
-d 37 15 -0.000275468
-d 38 15 -0.000166452
-d 39 15 -8.27481e-05
-d 40 15 -8.28704e-05
-d 41 15 -7.47644e-05
-d 42 15 -4.60552e-05
-d 43 15 -2.61481e-06
-d 44 15 2.26359e-05
-d 45 15 2.53852e-05
-d 46 15 -1.39853e-06
-d 47 15 -4.23456e-05
-d 48 15 -4.0907e-05
-d 49 15 -2.8501e-05
-d 50 15 -1.5945e-05
-d 51 15 -9.01122e-06
-d 52 15 -2.07747e-06
-d 53 15 1.49328e-06
-d 54 15 4.38398e-06
-d 55 15 6.84248e-06
-d 56 15 4.76711e-06
-d 57 15 2.69173e-06
-d 58 15 6.16362e-07
-d 59 15 -1.45901e-06
-d 60 15 -3.53438e-06
-d 61 15 -4.14256e-06
-d 62 15 -3.76238e-06
-d 63 15 -3.3822e-06
-d 64 15 -3.00202e-06
-d 65 15 -2.62184e-06
-d 66 15 -2.24878e-06
-d 67 15 -1.93456e-06
-d 68 15 -1.62033e-06
-d 69 15 -1.3061e-06
-d 70 15 -9.91867e-07
-d 71 15 -6.77638e-07
-d 72 15 -3.63409e-07
-d 73 15 -4.91792e-08
-d 74 15 2.6505e-07
-d 75 15 5.7928e-07
-d 76 15 8.93509e-07
-d 77 15 1.16076e-06
-d 78 15 1.11055e-06
-d 79 15 1.06034e-06
-d 80 15 1.01014e-06
-d 81 15 9.59927e-07
-d 82 15 9.09719e-07
-d 83 15 8.59511e-07
-d 84 15 8.09302e-07
-d 85 15 7.59094e-07
-d 86 15 7.08886e-07
-d 87 15 6.58678e-07
-d 88 15 5.99251e-07
-d 89 15 4.87523e-07
-d 90 15 3.75795e-07
-d 91 15 2.64068e-07
-d 92 15 1.5234e-07
-d 93 15 4.06119e-08
-d 94 15 -7.1116e-08
-d 95 15 -1.82844e-07
-d 96 15 -2.94572e-07
-d 97 15 -4.063e-07
-d 98 15 -5.18027e-07
-d 99 15 -6.08517e-07
-d 100 15 -5.95879e-07
-d 101 15 -5.83241e-07
-d 102 15 -5.70604e-07
-d 103 15 -5.57966e-07
-d 104 15 -5.45328e-07
-d 105 15 -5.3269e-07
-d 106 15 -5.20053e-07
-d 107 15 -5.07415e-07
-d 108 15 -4.94777e-07
-d 109 15 -4.8214e-07
-d 110 15 -4.69502e-07
-d 111 15 -4.56864e-07
-d 112 15 -4.44226e-07
-d 113 15 -4.31589e-07
-d 114 15 -4.18951e-07
-d 115 15 -4.06313e-07
-d 116 15 -3.93676e-07
-d 117 15 -3.81038e-07
-d 118 15 -3.684e-07
-d 119 15 -3.55762e-07
-d 120 15 -3.43125e-07
-d 121 15 1.06736e-05
-d 122 15 0.0797407
-d 123 15 0.0437947
-d 124 15 -0.0645098
-d 125 15 -0.0877312
-d 126 15 0.0653203
-d 127 15 -0.00621184
-d 128 15 -0.0353188
-d 129 15 -0.0491378
-d 130 15 -0.0251957
-d 131 15 -0.0110996
-d 132 15 -0.00481123
-d 133 15 -0.0020941
-d 134 15 -0.000998038
-d 135 15 -0.000478747
-d 136 15 -0.000445332
-d 137 15 -0.102046
-d 138 15 -0.135753
-d 139 15 -0.154351
-d 140 15 -0.0827509
-d 141 15 0.163348
-d 142 15 0.174012
-d 143 15 0.0794822
-d 144 15 0.0310624
-d 145 15 0.0112213
-d 146 15 0.00249061
-d 147 15 0.00130764
-d 148 15 0.00181315
-d 149 15 0.00163875
-d 150 15 0.00101454
-d 151 15 0.000497435
-d 152 15 0.000195258
-d 153 15 5.31901e-05
-d 154 15 2.4607e-05
-d 155 15 6.62736e-05
-d 156 15 7.90718e-05
-d 157 15 4.0372e-05
-d 158 15 -0.000141184
-d 159 15 -0.000280623
-d 160 15 5.5608e-05
-d 161 15 0.000799565
-d 162 15 0.000920189
-d 163 15 0.000931616
-d 164 15 0.000494527
-d 165 15 0.000162303
-d 166 15 -8.24884e-05
-d 167 15 -0.000183938
-d 168 15 -0.000203899
-d 169 15 -0.000144788
-d 170 15 -9.87063e-05
-d 171 15 -0.000227929
-d 172 15 2.93932e-05
-d 173 15 0.000208563
-d 174 15 1.88958e-06
-d 175 15 -7.6335e-05
-d 176 15 -0.000172472
-d 177 15 -0.000165656
-d 178 15 -0.000145889
-d 179 15 -0.000177311
-d 180 15 -0.000191058
-d 181 15 -0.000168287
-d 182 15 -0.00015755
-d 183 15 -0.00013142
-d 184 15 -8.10488e-05
-d 185 15 -6.36115e-05
-d 186 15 -7.8699e-05
-d 187 15 -8.11282e-05
-d 188 15 -7.98625e-05
-d 189 15 -5.98807e-05
-d 190 15 -3.40879e-05
-d 191 15 -1.95464e-05
-d 192 15 -1.79247e-05
-d 193 15 -4.45514e-05
-d 194 15 -7.47995e-05
-d 195 15 -8.7682e-05
-d 196 15 -7.50806e-05
-d 197 15 -3.25561e-05
-d 198 15 -4.34114e-05
-d 199 15 -7.69099e-05
-d 200 15 -0.000141101
-d 201 15 -0.00018743
-d 202 15 -0.000148471
-d 203 15 -5.06546e-05
-d 204 15 0.000120195
-d 205 15 0.000177635
-d 206 15 0.000177052
-d 207 15 0.000146344
-d 208 15 9.75126e-05
-d 209 15 8.31233e-05
-d 210 15 6.8734e-05
-d 211 15 5.43447e-05
-d 212 15 3.99554e-05
-d 213 15 2.55661e-05
-d 214 15 1.11768e-05
-d 215 15 -3.21253e-06
-d 216 15 -3.88937e-06
-d 217 15 -3.56628e-06
-d 218 15 -3.24318e-06
-d 219 15 -2.92008e-06
-d 220 15 -2.59699e-06
-d 221 15 -2.27389e-06
-d 222 15 -1.9508e-06
-d 223 15 -1.73227e-06
-d 224 15 -1.56796e-06
-d 225 15 -1.40365e-06
-d 226 15 -1.23934e-06
-d 227 15 -1.07503e-06
-d 228 15 -9.10722e-07
-d 229 15 -7.46412e-07
-d 230 15 -5.82101e-07
-d 231 15 -4.1779e-07
-d 232 15 -2.5348e-07
-d 233 15 -8.91694e-08
-d 234 15 7.51412e-08
-d 235 15 2.39452e-07
-d 236 15 4.03762e-07
-d 237 15 5.95733e-07
-d 238 15 1.00771e-06
-d 239 15 1.41969e-06
-d 240 15 1.83167e-06
-d 241 15 2.24365e-06
-d 242 15 0.0828257
-d 243 15 0.231038
-d 244 15 0.465438
-d 245 15 1.54516
-d 246 15 2.8461
-d 247 15 3.19221
-d 248 15 3.40395
-d 249 15 3.6382
-d 250 15 3.80758
-d 251 15 3.93848
-d 252 15 4.04882
-d 253 15 4.15428
-d 254 15 4.247
-d 255 15 4.32917
-d 256 15 4.40235
-d 257 15 4.36941
-d 258 15 4.397
-d 259 15 4.48862
-d 260 15 4.64552
-d 261 15 4.86595
-d 262 15 5.03475
-d 263 15 5.0348
-d 264 15 5.02627
-d 265 15 5.01967
-d 266 15 5.01542
-d 267 15 5.00925
-d 268 15 4.98613
-d 269 15 4.9519
-d 270 15 4.91581
-d 271 15 4.87357
-d 272 15 4.82302
-d 273 15 4.80403
-d 274 15 4.82565
-d 275 15 4.86102
-d 276 15 4.89483
-d 277 15 4.92253
-d 278 15 4.94428
-d 279 15 4.96257
-d 280 15 4.97608
-d 281 15 4.98373
-d 282 15 4.98823
-d 283 15 4.99182
-d 284 15 4.99437
-d 285 15 4.99635
-d 286 15 4.99745
-d 287 15 4.99802
-d 288 15 4.99843
-d 289 15 4.99873
-d 290 15 4.99895
-d 291 15 4.99912
-d 292 15 4.99925
-d 293 15 4.99931
-d 294 15 4.99962
-d 295 15 4.99973
-d 296 15 4.99972
-d 297 15 4.99971
-d 298 15 4.9997
-d 299 15 4.99969
-d 300 15 4.9997
-d 301 15 4.99971
-d 302 15 4.99973
-d 303 15 4.99974
-d 304 15 4.99976
-d 305 15 4.99978
-d 306 15 4.9998
-d 307 15 4.99982
-d 308 15 4.99985
-d 309 15 4.99987
-d 310 15 4.99989
-d 311 15 4.9999
-d 312 15 4.99991
-d 313 15 4.99991
-d 314 15 4.99993
-d 315 15 4.99994
-d 316 15 4.99997
-d 317 15 5.00001
-d 318 15 5.00006
-d 319 15 5.00008
-d 320 15 5.00006
-d 321 15 5.00002
-d 322 15 5.0
-d 323 15 4.99999
-d 324 15 4.99998
-d 325 15 4.99997
-d 326 15 4.99995
-d 327 15 4.99995
-d 328 15 4.99995
-d 329 15 4.99995
-d 330 15 4.99995
-d 331 15 4.99995
-d 332 15 4.99995
-d 333 15 4.99996
-d 334 15 4.99997
-d 335 15 4.99997
-d 336 15 4.99998
-d 337 15 4.99999
-d 338 15 5.0
-d 339 15 5.0
-d 340 15 5.00001
-d 341 15 5.00002
-d 342 15 5.00002
-d 343 15 5.00002
-d 344 15 5.00002
-d 345 15 5.00002
-d 346 15 5.00002
-d 347 15 5.00002
-d 348 15 5.00002
-d 349 15 5.00002
-d 350 15 5.00002
-d 351 15 5.00001
-d 352 15 5.00001
-d 353 15 5.00001
-d 354 15 5.00001
-d 355 15 5.00001
-d 356 15 5.0
-d 357 15 5.0
-d 358 15 5.0
-d 359 15 4.99999
-d 360 15 4.99999
-d 361 15 4.99999
-d 1 16 1.86175
-d 2 16 2.00199
-d 3 16 2.08919
-d 4 16 1.84314
-d 5 16 1.08254
-d 6 16 0.214737
-d 7 16 0.0377351
-d 8 16 0.00952455
-d 9 16 0.00232763
-d 10 16 0.000563614
-d 11 16 0.000263477
-d 12 16 0.000148642
-d 13 16 0.000285086
-d 14 16 0.000242592
-d 15 16 7.34699e-05
-d 16 16 -1.53467e-05
-d 17 16 -0.0161874
-d 18 16 -0.0157876
-d 19 16 -0.0141194
-d 20 16 0.0132576
-d 21 16 0.0903272
-d 22 16 0.109938
-d 23 16 0.0535295
-d 24 16 0.0224216
-d 25 16 0.00940945
-d 26 16 0.00466825
-d 27 16 -0.000649972
-d 28 16 -0.00654752
-d 29 16 -0.00333248
-d 30 16 -0.00103671
-d 31 16 -0.000508276
-d 32 16 -5.8896e-05
-d 33 16 -0.00043938
-d 34 16 -0.000544704
-d 35 16 -0.00044444
-d 36 16 -0.000307093
-d 37 16 -0.00024517
-d 38 16 -0.000154538
-d 39 16 -8.78602e-05
-d 40 16 -7.10461e-05
-d 41 16 -6.06485e-05
-d 42 16 -3.91039e-05
-d 43 16 -8.45988e-06
-d 44 16 9.43442e-06
-d 45 16 1.28351e-05
-d 46 16 -2.16734e-06
-d 47 16 -2.6142e-05
-d 48 16 -2.54768e-05
-d 49 16 -1.88997e-05
-d 50 16 -1.17906e-05
-d 51 16 -7.3808e-06
-d 52 16 -2.97101e-06
-d 53 16 1.19146e-07
-d 54 16 2.94246e-06
-d 55 16 5.38942e-06
-d 56 16 3.88851e-06
-d 57 16 2.38761e-06
-d 58 16 8.86704e-07
-d 59 16 -6.14201e-07
-d 60 16 -2.11511e-06
-d 61 16 -2.59565e-06
-d 62 16 -2.38885e-06
-d 63 16 -2.18205e-06
-d 64 16 -1.97525e-06
-d 65 16 -1.76845e-06
-d 66 16 -1.56241e-06
-d 67 16 -1.36258e-06
-d 68 16 -1.16276e-06
-d 69 16 -9.62939e-07
-d 70 16 -7.63116e-07
-d 71 16 -5.63293e-07
-d 72 16 -3.6347e-07
-d 73 16 -1.63647e-07
-d 74 16 3.61756e-08
-d 75 16 2.35999e-07
-d 76 16 4.35822e-07
-d 77 16 6.07653e-07
-d 78 16 5.90323e-07
-d 79 16 5.72994e-07
-d 80 16 5.55665e-07
-d 81 16 5.38336e-07
-d 82 16 5.21007e-07
-d 83 16 5.03678e-07
-d 84 16 4.86349e-07
-d 85 16 4.6902e-07
-d 86 16 4.51691e-07
-d 87 16 4.34361e-07
-d 88 16 4.11899e-07
-d 89 16 3.60315e-07
-d 90 16 3.08731e-07
-d 91 16 2.57146e-07
-d 92 16 2.05562e-07
-d 93 16 1.53977e-07
-d 94 16 1.02393e-07
-d 95 16 5.08082e-08
-d 96 16 -7.76222e-10
-d 97 16 -5.23607e-08
-d 98 16 -1.03945e-07
-d 99 16 -1.47815e-07
-d 100 16 -1.54225e-07
-d 101 16 -1.60635e-07
-d 102 16 -1.67045e-07
-d 103 16 -1.73455e-07
-d 104 16 -1.79864e-07
-d 105 16 -1.86274e-07
-d 106 16 -1.92684e-07
-d 107 16 -1.99094e-07
-d 108 16 -2.05504e-07
-d 109 16 -2.11914e-07
-d 110 16 -2.18324e-07
-d 111 16 -2.24734e-07
-d 112 16 -2.31144e-07
-d 113 16 -2.37554e-07
-d 114 16 -2.43964e-07
-d 115 16 -2.50373e-07
-d 116 16 -2.56783e-07
-d 117 16 -2.63193e-07
-d 118 16 -2.69603e-07
-d 119 16 -2.76013e-07
-d 120 16 -2.82423e-07
-d 121 16 2.92534e-06
-d 122 16 0.0446777
-d 123 16 0.024278
-d 124 16 -0.0518987
-d 125 16 -0.0636547
-d 126 16 0.00983929
-d 127 16 -0.000518204
-d 128 16 -0.000265194
-d 129 16 0.000154772
-d 130 16 0.000299538
-d 131 16 3.12715e-05
-d 132 16 -3.18225e-05
-d 133 16 -2.48268e-05
-d 134 16 -1.16701e-05
-d 135 16 -6.05117e-06
-d 136 16 7.61116e-06
-d 137 16 -0.0163668
-d 138 16 -0.0158244
-d 139 16 -0.0141177
-d 140 16 0.0100085
-d 141 16 0.0857144
-d 142 16 0.107784
-d 143 16 0.051862
-d 144 16 0.0204448
-d 145 16 0.00629858
-d 146 16 0.000967736
-d 147 16 0.00121674
-d 148 16 0.00190276
-d 149 16 0.00154009
-d 150 16 0.000860922
-d 151 16 0.000410386
-d 152 16 0.000164585
-d 153 16 3.99493e-05
-d 154 16 1.93797e-05
-d 155 16 5.67594e-05
-d 156 16 0.000110126
-d 157 16 2.49925e-05
-d 158 16 -7.17815e-05
-d 159 16 -0.000142299
-d 160 16 -1.63109e-05
-d 161 16 0.000439529
-d 162 16 0.000562489
-d 163 16 0.000594599
-d 164 16 0.000326164
-d 165 16 0.000126423
-d 166 16 -4.26063e-05
-d 167 16 -0.000122927
-d 168 16 -0.000114152
-d 169 16 -6.72706e-05
-d 170 16 -6.41242e-05
-d 171 16 -0.000135588
-d 172 16 2.61507e-05
-d 173 16 0.000134036
-d 174 16 6.43734e-06
-d 175 16 -4.6223e-05
-d 176 16 -0.000112047
-d 177 16 -0.000101388
-d 178 16 -8.67847e-05
-d 179 16 -0.000117664
-d 180 16 -0.000133957
-d 181 16 -0.000116558
-d 182 16 -0.000100873
-d 183 16 -7.65448e-05
-d 184 16 -4.44964e-05
-d 185 16 -3.6677e-05
-d 186 16 -5.26632e-05
-d 187 16 -5.45172e-05
-d 188 16 -5.13545e-05
-d 189 16 -3.73869e-05
-d 190 16 -1.99732e-05
-d 191 16 -1.0907e-05
-d 192 16 -1.10081e-05
-d 193 16 -3.02609e-05
-d 194 16 -5.18517e-05
-d 195 16 -6.13597e-05
-d 196 16 -5.30706e-05
-d 197 16 -2.39572e-05
-d 198 16 -3.24146e-05
-d 199 16 -5.70062e-05
-d 200 16 -0.000103448
-d 201 16 -0.000135376
-d 202 16 -0.0001024
-d 203 16 -2.39007e-05
-d 204 16 0.000110929
-d 205 16 0.000151226
-d 206 16 0.000142044
-d 207 16 0.000105922
-d 208 16 5.62834e-05
-d 209 16 4.78476e-05
-d 210 16 3.94117e-05
-d 211 16 3.09759e-05
-d 212 16 2.25401e-05
-d 213 16 1.41042e-05
-d 214 16 5.66837e-06
-d 215 16 -2.76747e-06
-d 216 16 -3.08639e-06
-d 217 16 -2.81341e-06
-d 218 16 -2.54043e-06
-d 219 16 -2.26745e-06
-d 220 16 -1.99447e-06
-d 221 16 -1.72149e-06
-d 222 16 -1.44851e-06
-d 223 16 -1.26226e-06
-d 224 16 -1.12096e-06
-d 225 16 -9.79661e-07
-d 226 16 -8.38363e-07
-d 227 16 -6.97065e-07
-d 228 16 -5.55768e-07
-d 229 16 -4.1447e-07
-d 230 16 -2.73173e-07
-d 231 16 -1.31875e-07
-d 232 16 9.42259e-09
-d 233 16 1.5072e-07
-d 234 16 2.92018e-07
-d 235 16 4.33315e-07
-d 236 16 5.74613e-07
-d 237 16 7.10363e-07
-d 238 16 8.01984e-07
-d 239 16 8.93604e-07
-d 240 16 9.85225e-07
-d 241 16 1.07685e-06
-d 242 16 0.04474
-d 243 16 0.0928765
-d 244 16 0.141327
-d 245 16 0.0176048
-d 246 16 -0.071675
-d 247 16 -0.0124613
-d 248 16 0.989022
-d 249 16 2.28104
-d 250 16 3.40619
-d 251 16 4.21417
-d 252 16 4.67173
-d 253 16 4.87438
-d 254 16 4.96044
-d 255 16 4.98996
-d 256 16 4.99858
-d 257 16 4.96672
-d 258 16 4.89502
-d 259 16 4.79391
-d 260 16 4.76433
-d 261 16 4.8387
-d 262 16 4.98612
-d 263 16 5.0161
-d 264 16 5.01722
-d 265 16 5.01437
-d 266 16 5.01256
-d 267 16 4.99827
-d 268 16 4.95807
-d 269 16 4.9209
-d 270 16 4.88217
-d 271 16 4.83006
-d 272 16 4.78461
-d 273 16 4.80759
-d 274 16 4.85548
-d 275 16 4.89604
-d 276 16 4.9254
-d 277 16 4.94617
-d 278 16 4.96126
-d 279 16 4.97374
-d 280 16 4.98255
-d 281 16 4.98792
-d 282 16 4.99126
-d 283 16 4.99361
-d 284 16 4.99554
-d 285 16 4.99699
-d 286 16 4.99792
-d 287 16 4.99846
-d 288 16 4.99881
-d 289 16 4.99905
-d 290 16 4.99924
-d 291 16 4.99938
-d 292 16 4.99949
-d 293 16 4.99955
-d 294 16 4.9997
-d 295 16 4.9998
-d 296 16 4.99982
-d 297 16 4.99982
-d 298 16 4.99982
-d 299 16 4.99982
-d 300 16 4.99982
-d 301 16 4.99983
-d 302 16 4.99984
-d 303 16 4.99985
-d 304 16 4.99986
-d 305 16 4.99987
-d 306 16 4.99988
-d 307 16 4.99989
-d 308 16 4.9999
-d 309 16 4.99992
-d 310 16 4.99993
-d 311 16 4.99994
-d 312 16 4.99995
-d 313 16 4.99995
-d 314 16 4.99996
-d 315 16 4.99996
-d 316 16 4.99998
-d 317 16 4.99999
-d 318 16 5.00001
-d 319 16 5.00002
-d 320 16 5.00002
-d 321 16 5.00001
-d 322 16 5.00001
-d 323 16 5.0
-d 324 16 4.99999
-d 325 16 4.99999
-d 326 16 4.99998
-d 327 16 4.99998
-d 328 16 4.99998
-d 329 16 4.99998
-d 330 16 4.99998
-d 331 16 4.99998
-d 332 16 4.99998
-d 333 16 4.99998
-d 334 16 4.99998
-d 335 16 4.99998
-d 336 16 4.99999
-d 337 16 4.99999
-d 338 16 4.99999
-d 339 16 4.99999
-d 340 16 5.0
-d 341 16 5.0
-d 342 16 5.0
-d 343 16 5.0
-d 344 16 5.0
-d 345 16 5.0
-d 346 16 5.00001
-d 347 16 5.00001
-d 348 16 5.00001
-d 349 16 5.00001
-d 350 16 5.00001
-d 351 16 5.00001
-d 352 16 5.00001
-d 353 16 5.00001
-d 354 16 5.00001
-d 355 16 5.00001
-d 356 16 5.00001
-d 357 16 5.00001
-d 358 16 5.00001
-d 359 16 5.00001
-d 360 16 5.00001
-d 361 16 5.00001
-d 1 17 1.86175
-d 2 17 1.73073
-d 3 17 1.50572
-d 4 17 1.89001
-d 5 17 3.39004
-d 6 17 4.36034
-d 7 17 4.79012
-d 8 17 4.93798
-d 9 17 4.98305
-d 10 17 4.99539
-d 11 17 4.9979
-d 12 17 4.99904
-d 13 17 4.99772
-d 14 17 4.9983
-d 15 17 4.99935
-d 16 17 4.99975
-d 17 17 4.98837
-d 18 17 4.99456
-d 19 17 4.99728
-d 20 17 5.01838
-d 21 17 5.04568
-d 22 17 5.00759
-d 23 17 4.98112
-d 24 17 4.98479
-d 25 17 4.99197
-d 26 17 4.99641
-d 27 17 4.99747
-d 28 17 4.99775
-d 29 17 5.00043
-d 30 17 5.0007
-d 31 17 5.00035
-d 32 17 5.00023
-d 33 17 4.99976
-d 34 17 5.00002
-d 35 17 5.00007
-d 36 17 5.0002
-d 37 17 4.99993
-d 38 17 5.00003
-d 39 17 5.00021
-d 40 17 5.00006
-d 41 17 4.99993
-d 42 17 4.99992
-d 43 17 5.00002
-d 44 17 5.00013
-d 45 17 5.00017
-d 46 17 5.00009
-d 47 17 4.99992
-d 48 17 4.99991
-d 49 17 4.99993
-d 50 17 4.99996
-d 51 17 4.99998
-d 52 17 4.99999
-d 53 17 5.00001
-d 54 17 5.00003
-d 55 17 5.00005
-d 56 17 5.00004
-d 57 17 5.00004
-d 58 17 5.00003
-d 59 17 5.00002
-d 60 17 5.00001
-d 61 17 5.0
-d 62 17 4.99999
-d 63 17 4.99999
-d 64 17 4.99998
-d 65 17 4.99998
-d 66 17 4.99997
-d 67 17 4.99997
-d 68 17 4.99998
-d 69 17 4.99998
-d 70 17 4.99998
-d 71 17 4.99998
-d 72 17 4.99999
-d 73 17 4.99999
-d 74 17 4.99999
-d 75 17 4.99999
-d 76 17 5.0
-d 77 17 5.0
-d 78 17 5.0
-d 79 17 5.0
-d 80 17 5.0
-d 81 17 5.0
-d 82 17 5.00001
-d 83 17 5.00001
-d 84 17 5.00001
-d 85 17 5.00001
-d 86 17 5.00001
-d 87 17 5.00001
-d 88 17 5.00002
-d 89 17 5.00001
-d 90 17 5.00001
-d 91 17 5.00001
-d 92 17 5.00001
-d 93 17 5.00001
-d 94 17 5.00001
-d 95 17 5.00001
-d 96 17 5.0
-d 97 17 5.0
-d 98 17 5.0
-d 99 17 5.0
-d 100 17 5.0
-d 101 17 5.0
-d 102 17 5.0
-d 103 17 5.0
-d 104 17 5.0
-d 105 17 5.0
-d 106 17 5.0
-d 107 17 5.0
-d 108 17 5.0
-d 109 17 5.0
-d 110 17 5.0
-d 111 17 5.0
-d 112 17 5.0
-d 113 17 4.99999
-d 114 17 4.99999
-d 115 17 4.99999
-d 116 17 4.99999
-d 117 17 4.99999
-d 118 17 4.99999
-d 119 17 4.99999
-d 120 17 4.99999
-d 121 17 5.0
-d 122 17 5.01498
-d 123 17 4.99342
-d 124 17 4.96899
-d 125 17 5.00301
-d 126 17 5.02627
-d 127 17 4.9977
-d 128 17 4.99548
-d 129 17 4.99757
-d 130 17 5.00277
-d 131 17 5.00245
-d 132 17 5.0014
-d 133 17 5.00069
-d 134 17 5.00032
-d 135 17 5.00014
-d 136 17 5.00009
-d 137 17 4.9867
-d 138 17 4.99262
-d 139 17 4.99607
-d 140 17 5.01805
-d 141 17 5.04713
-d 142 17 5.00927
-d 143 17 4.98184
-d 144 17 4.98483
-d 145 17 4.9914
-d 146 17 4.99616
-d 147 17 4.99902
-d 148 17 4.9999
-d 149 17 4.99987
-d 150 17 4.99979
-d 151 17 4.99981
-d 152 17 4.99989
-d 153 17 4.99994
-d 154 17 4.99998
-d 155 17 5.0002
-d 156 17 5.00001
-d 157 17 5.00008
-d 158 17 5.00008
-d 159 17 5.0001
-d 160 17 5.00021
-d 161 17 5.00032
-d 162 17 5.00025
-d 163 17 5.00019
-d 164 17 5.00006
-d 165 17 5.00007
-d 166 17 4.99994
-d 167 17 4.99997
-d 168 17 4.99999
-d 169 17 5.00023
-d 170 17 5.00008
-d 171 17 4.99993
-d 172 17 4.99998
-d 173 17 4.99986
-d 174 17 4.99982
-d 175 17 5.00003
-d 176 17 4.99985
-d 177 17 4.99996
-d 178 17 5.00014
-d 179 17 5.0
-d 180 17 4.99984
-d 181 17 4.99979
-d 182 17 4.99982
-d 183 17 4.99993
-d 184 17 5.00008
-d 185 17 5.00011
-d 186 17 5.00002
-d 187 17 4.99996
-d 188 17 4.9999
-d 189 17 4.99994
-d 190 17 5.00001
-d 191 17 5.00007
-d 192 17 5.00009
-d 193 17 4.99995
-d 194 17 4.99978
-d 195 17 4.99971
-d 196 17 4.99976
-d 197 17 4.99997
-d 198 17 4.99996
-d 199 17 4.99989
-d 200 17 4.99972
-d 201 17 4.99955
-d 202 17 4.99953
-d 203 17 4.99959
-d 204 17 4.99976
-d 205 17 4.9999
-d 206 17 5.00005
-d 207 17 5.00023
-d 208 17 5.00039
-d 209 17 5.00034
-d 210 17 5.00029
-d 211 17 5.00024
-d 212 17 5.00019
-d 213 17 5.00014
-d 214 17 5.00009
-d 215 17 5.00004
-d 216 17 5.00003
-d 217 17 5.00002
-d 218 17 5.00001
-d 219 17 5.0
-d 220 17 5.0
-d 221 17 4.99999
-d 222 17 4.99998
-d 223 17 4.99998
-d 224 17 4.99998
-d 225 17 4.99998
-d 226 17 4.99998
-d 227 17 4.99999
-d 228 17 4.99999
-d 229 17 4.99999
-d 230 17 4.99999
-d 231 17 4.99999
-d 232 17 4.99999
-d 233 17 4.99999
-d 234 17 5.0
-d 235 17 5.0
-d 236 17 5.0
-d 237 17 5.0
-d 238 17 5.00001
-d 239 17 5.00002
-d 240 17 5.00003
-d 241 17 5.00004
-d 242 17 5.01564
-d 243 17 5.03395
-d 244 17 5.04932
-d 245 17 5.11868
-d 246 17 3.92502
-d 247 17 1.31888
-d 248 17 0.163888
-d 249 17 0.0946876
-d 250 17 0.0789578
-d 251 17 0.0565084
-d 252 17 0.0260333
-d 253 17 0.0156986
-d 254 17 0.00907667
-d 255 17 0.00613629
-d 256 17 0.00468417
-d 257 17 -0.00174008
-d 258 17 -0.0021422
-d 259 17 0.000586962
-d 260 17 0.0124937
-d 261 17 0.0147977
-d 262 17 0.00838454
-d 263 17 0.00039383
-d 264 17 -0.000522021
-d 265 17 -0.000426598
-d 266 17 -0.000290214
-d 267 17 -0.00173713
-d 268 17 -0.00384132
-d 269 17 -0.00382945
-d 270 17 -0.00429219
-d 271 17 -0.00580193
-d 272 17 -0.00393246
-d 273 17 0.0017543
-d 274 17 0.00423045
-d 275 17 0.00408931
-d 276 17 0.0031976
-d 277 17 0.00245457
-d 278 17 0.00187293
-d 279 17 0.00159068
-d 280 17 0.00105697
-d 281 17 0.000609902
-d 282 17 0.000358825
-d 283 17 0.000334125
-d 284 17 0.000212708
-d 285 17 0.000168116
-d 286 17 8.97349e-05
-d 287 17 5.21578e-05
-d 288 17 3.84527e-05
-d 289 17 2.93033e-05
-d 290 17 2.10067e-05
-d 291 17 1.59954e-05
-d 292 17 1.13917e-05
-d 293 17 5.49738e-06
-d 294 17 2.77217e-05
-d 295 17 6.51259e-06
-d 296 17 -6.65468e-06
-d 297 17 2.09837e-06
-d 298 17 -6.617e-06
-d 299 17 -4.80187e-06
-d 300 17 1.55031e-06
-d 301 17 4.26536e-06
-d 302 17 7.69457e-07
-d 303 17 -1.46213e-06
-d 304 17 -7.25202e-07
-d 305 17 3.26501e-06
-d 306 17 6.55807e-06
-d 307 17 7.524e-06
-d 308 17 6.07209e-06
-d 309 17 6.00701e-06
-d 310 17 5.41166e-06
-d 311 17 3.86573e-06
-d 312 17 1.10651e-06
-d 313 17 -2.74603e-06
-d 314 17 -2.18566e-06
-d 315 17 2.3658e-06
-d 316 17 8.59956e-06
-d 317 17 8.35046e-06
-d 318 17 2.90621e-06
-d 319 17 -8.75982e-07
-d 320 17 -1.87189e-06
-d 321 17 -2.1528e-06
-d 322 17 -1.94875e-06
-d 323 17 -1.74471e-06
-d 324 17 -1.54067e-06
-d 325 17 -1.33662e-06
-d 326 17 -1.13258e-06
-d 327 17 -8.40567e-07
-d 328 17 -5.20743e-07
-d 329 17 -2.00918e-07
-d 330 17 1.18906e-07
-d 331 17 4.38731e-07
-d 332 17 6.11382e-07
-d 333 17 6.01529e-07
-d 334 17 5.91675e-07
-d 335 17 5.81822e-07
-d 336 17 5.71968e-07
-d 337 17 5.62115e-07
-d 338 17 5.52261e-07
-d 339 17 5.42407e-07
-d 340 17 5.32554e-07
-d 341 17 5.227e-07
-d 342 17 5.12847e-07
-d 343 17 4.72812e-07
-d 344 17 4.26137e-07
-d 345 17 3.79462e-07
-d 346 17 3.32786e-07
-d 347 17 2.86111e-07
-d 348 17 2.39436e-07
-d 349 17 1.92761e-07
-d 350 17 1.46086e-07
-d 351 17 9.94107e-08
-d 352 17 5.27356e-08
-d 353 17 -2.77779e-10
-d 354 17 -7.98079e-08
-d 355 17 -1.59338e-07
-d 356 17 -2.38868e-07
-d 357 17 -3.18398e-07
-d 358 17 -3.97928e-07
-d 359 17 -4.77458e-07
-d 360 17 -5.56988e-07
-d 361 17 -6.36519e-07
-d 1 18 5.0
-d 2 18 5.16963
-d 3 18 4.84136
-d 4 18 3.33754
-d 5 18 0.316206
-d 6 18 0.103113
-d 7 18 0.0273341
-d 8 18 0.0221102
-d 9 18 0.0177008
-d 10 18 0.0143758
-d 11 18 0.0115203
-d 12 18 0.00929231
-d 13 18 0.00752716
-d 14 18 0.00625439
-d 15 18 0.00489872
-d 16 18 0.00403656
-d 17 18 -0.0657317
-d 18 18 -0.0256467
-d 19 18 0.165394
-d 20 18 0.985963
-d 21 18 3.05067
-d 22 18 4.55799
-d 23 18 4.89728
-d 24 18 4.92464
-d 25 18 4.8882
-d 26 18 4.90592
-d 27 18 4.97315
-d 28 18 4.99241
-d 29 18 4.99694
-d 30 18 4.99845
-d 31 18 4.99905
-d 32 18 4.99939
-d 33 18 4.99959
-d 34 18 4.99971
-d 35 18 4.9998
-d 36 18 4.99986
-d 37 18 4.9999
-d 38 18 4.99993
-d 39 18 4.99995
-d 40 18 4.99996
-d 41 18 4.99997
-d 42 18 4.99998
-d 43 18 4.99998
-d 44 18 4.99999
-d 45 18 4.99999
-d 46 18 4.99999
-d 47 18 4.99999
-d 48 18 4.99999
-d 49 18 5.0
-d 50 18 5.00001
-d 51 18 5.00003
-d 52 18 5.00005
-d 53 18 5.00004
-d 54 18 5.00002
-d 55 18 5.0
-d 56 18 4.99999
-d 57 18 4.99999
-d 58 18 4.99998
-d 59 18 4.99998
-d 60 18 4.99997
-d 61 18 4.99997
-d 62 18 4.99998
-d 63 18 4.99998
-d 64 18 4.99999
-d 65 18 4.99999
-d 66 18 5.0
-d 67 18 5.0
-d 68 18 5.0
-d 69 18 5.0
-d 70 18 5.0
-d 71 18 5.00001
-d 72 18 5.00001
-d 73 18 5.00001
-d 74 18 5.00001
-d 75 18 5.00001
-d 76 18 5.00001
-d 77 18 5.00002
-d 78 18 5.00001
-d 79 18 5.00001
-d 80 18 5.00001
-d 81 18 5.00001
-d 82 18 5.00001
-d 83 18 5.00001
-d 84 18 5.00001
-d 85 18 5.0
-d 86 18 5.0
-d 87 18 5.0
-d 88 18 5.0
-d 89 18 5.0
-d 90 18 5.0
-d 91 18 5.0
-d 92 18 4.99999
-d 93 18 4.99999
-d 94 18 4.99999
-d 95 18 4.99999
-d 96 18 4.99999
-d 97 18 4.99999
-d 98 18 4.99998
-d 99 18 4.99998
-d 100 18 4.99998
-d 101 18 4.99999
-d 102 18 4.99999
-d 103 18 4.99999
-d 104 18 4.99999
-d 105 18 4.99999
-d 106 18 4.99999
-d 107 18 4.99999
-d 108 18 4.99999
-d 109 18 4.99999
-d 110 18 4.99999
-d 111 18 4.99999
-d 112 18 4.99999
-d 113 18 4.99999
-d 114 18 4.99999
-d 115 18 5.0
-d 116 18 5.0
-d 117 18 5.0
-d 118 18 5.0
-d 119 18 5.0
-d 120 18 5.0
-d 121 18 5.00025
-d 122 18 5.1657
-d 123 18 4.69981
-d 124 18 2.43895
-d 125 18 0.0229743
-d 126 18 0.0351406
-d 127 18 -0.0211974
-d 128 18 -0.0312063
-d 129 18 -0.0160331
-d 130 18 -0.0021718
-d 131 18 -0.000766597
-d 132 18 -0.000251052
-d 133 18 -5.49363e-05
-d 134 18 -3.36364e-06
-d 135 18 -2.01983e-06
-d 136 18 -9.70575e-06
-d 137 18 -0.0657007
-d 138 18 -0.0205247
-d 139 18 0.183332
-d 140 18 1.07163
-d 141 18 3.11839
-d 142 18 4.46213
-d 143 18 4.84163
-d 144 18 4.95195
-d 145 18 4.99159
-d 146 18 5.02084
-d 147 18 5.04029
-d 148 18 5.04138
-d 149 18 5.0271
-d 150 18 5.00445
-d 151 18 4.97957
-d 152 18 4.95702
-d 153 18 4.95231
-d 154 18 4.97819
-d 155 18 4.99191
-d 156 18 4.9963
-d 157 18 4.99822
-d 158 18 4.99878
-d 159 18 4.99903
-d 160 18 4.99925
-d 161 18 4.99942
-d 162 18 4.9995
-d 163 18 4.99954
-d 164 18 4.99957
-d 165 18 4.99961
-d 166 18 4.99966
-d 167 18 4.9997
-d 168 18 4.99974
-d 169 18 4.99977
-d 170 18 4.99981
-d 171 18 4.99983
-d 172 18 4.99986
-d 173 18 4.99988
-d 174 18 4.9999
-d 175 18 4.99991
-d 176 18 4.99992
-d 177 18 4.99994
-d 178 18 4.99995
-d 179 18 4.99995
-d 180 18 4.99996
-d 181 18 4.99997
-d 182 18 4.99997
-d 183 18 4.99998
-d 184 18 4.99998
-d 185 18 4.99998
-d 186 18 4.99999
-d 187 18 4.99999
-d 188 18 4.99999
-d 189 18 4.99999
-d 190 18 4.99999
-d 191 18 4.99999
-d 192 18 4.99999
-d 193 18 5.0
-d 194 18 5.0
-d 195 18 5.0
-d 196 18 5.0
-d 197 18 5.0
-d 198 18 5.0
-d 199 18 5.0
-d 200 18 5.0
-d 201 18 5.0
-d 202 18 5.0
-d 203 18 5.0
-d 204 18 5.0
-d 205 18 5.0
-d 206 18 5.0
-d 207 18 5.0
-d 208 18 5.0
-d 209 18 5.0
-d 210 18 5.0
-d 211 18 5.0
-d 212 18 5.0
-d 213 18 5.0
-d 214 18 5.0
-d 215 18 5.0
-d 216 18 5.0
-d 217 18 5.00001
-d 218 18 5.00001
-d 219 18 5.00001
-d 220 18 5.00002
-d 221 18 5.00002
-d 222 18 5.00002
-d 223 18 5.00002
-d 224 18 5.00002
-d 225 18 5.00002
-d 226 18 5.00002
-d 227 18 5.00002
-d 228 18 5.00001
-d 229 18 5.00001
-d 230 18 5.00001
-d 231 18 5.00001
-d 232 18 5.00001
-d 233 18 5.00001
-d 234 18 5.00001
-d 235 18 5.0
-d 236 18 5.0
-d 237 18 5.0
-d 238 18 4.99999
-d 239 18 4.99998
-d 240 18 4.99997
-d 241 18 4.99996
-d 242 18 5.14239
-d 243 18 4.76219
-d 244 18 3.16574
-d 245 18 0.299969
-d 246 18 0.0631609
-d 247 18 -0.00118611
-d 248 18 -0.00026052
-d 249 18 -5.96333e-05
-d 250 18 -1.44904e-05
-d 251 18 -4.3859e-06
-d 252 18 -2.99454e-06
-d 253 18 1.10547e-06
-d 254 18 4.84662e-06
-d 255 18 1.30971e-05
-d 256 18 2.23082e-05
-d 257 18 -0.0655844
-d 258 18 -0.0204818
-d 259 18 0.182507
-d 260 18 1.05954
-d 261 18 3.12277
-d 262 18 4.46735
-d 263 18 4.83915
-d 264 18 4.94512
-d 265 18 4.97679
-d 266 18 4.98654
-d 267 18 4.9966
-d 268 18 5.00833
-d 269 18 5.00776
-d 270 18 5.00432
-d 271 18 5.00199
-d 272 18 5.00086
-d 273 18 5.00033
-d 274 18 5.00008
-d 275 18 5.0
-d 276 18 5.00001
-d 277 18 5.0
-d 278 18 5.00005
-d 279 18 5.00002
-d 280 18 4.99981
-d 281 18 4.99991
-d 282 18 4.99998
-d 283 18 4.99979
-d 284 18 4.99979
-d 285 18 4.99984
-d 286 18 4.9998
-d 287 18 4.9998
-d 288 18 5.00006
-d 289 18 5.00002
-d 290 18 5.00001
-d 291 18 5.0
-d 292 18 5.0
-d 293 18 4.99992
-d 294 18 4.99998
-d 295 18 4.99999
-d 296 18 5.00002
-d 297 18 5.00014
-d 298 18 4.99999
-d 299 18 4.99987
-d 300 18 4.99993
-d 301 18 5.00003
-d 302 18 5.00011
-d 303 18 5.00005
-d 304 18 4.99996
-d 305 18 4.99987
-d 306 18 4.99985
-d 307 18 4.99994
-d 308 18 5.00009
-d 309 18 5.0001
-d 310 18 5.0
-d 311 18 4.99993
-d 312 18 4.99997
-d 313 18 5.00008
-d 314 18 5.00015
-d 315 18 5.00021
-d 316 18 5.00021
-d 317 18 5.00007
-d 318 18 4.99978
-d 319 18 4.99965
-d 320 18 4.99973
-d 321 18 4.9999
-d 322 18 4.99992
-d 323 18 4.99995
-d 324 18 4.99997
-d 325 18 4.99999
-d 326 18 5.00001
-d 327 18 5.00002
-d 328 18 5.00001
-d 329 18 5.00001
-d 330 18 5.00001
-d 331 18 5.0
-d 332 18 5.0
-d 333 18 5.0
-d 334 18 5.0
-d 335 18 5.0
-d 336 18 4.99999
-d 337 18 4.99999
-d 338 18 4.99999
-d 339 18 4.99999
-d 340 18 4.99999
-d 341 18 4.99999
-d 342 18 4.99998
-d 343 18 4.99998
-d 344 18 4.99999
-d 345 18 4.99999
-d 346 18 4.99999
-d 347 18 4.99999
-d 348 18 4.99999
-d 349 18 4.99999
-d 350 18 4.99999
-d 351 18 5.0
-d 352 18 5.0
-d 353 18 5.0
-d 354 18 5.0
-d 355 18 5.0
-d 356 18 5.00001
-d 357 18 5.00001
-d 358 18 5.00001
-d 359 18 5.00002
-d 360 18 5.00002
-d 361 18 5.00002
-d 1 19 5.0
-d 2 19 5.0333
-d 3 19 5.02472
-d 4 19 4.92559
-d 5 19 4.18383
-d 6 19 3.93923
-d 7 19 3.9961
-d 8 19 4.14293
-d 9 19 4.28591
-d 10 19 4.41336
-d 11 19 4.52157
-d 12 19 4.61101
-d 13 19 4.68472
-d 14 19 4.7439
-d 15 19 4.79294
-d 16 19 4.83239
-d 17 19 4.80697
-d 18 19 4.78808
-d 19 19 4.79322
-d 20 19 4.8838
-d 21 19 5.08529
-d 22 19 5.21863
-d 23 19 4.88852
-d 24 19 3.90198
-d 25 19 2.14586
-d 26 19 0.383977
-d 27 19 0.101103
-d 28 19 0.0525711
-d 29 19 0.0318287
-d 30 19 0.020895
-d 31 19 0.0146908
-d 32 19 0.010831
-d 33 19 0.00830272
-d 34 19 0.00656377
-d 35 19 0.00532066
-d 36 19 0.00440078
-d 37 19 0.00369956
-d 38 19 0.00315713
-d 39 19 0.00272614
-d 40 19 0.00237965
-d 41 19 0.00209659
-d 42 19 0.00186339
-d 43 19 0.00167014
-d 44 19 0.0015081
-d 45 19 0.00137172
-d 46 19 0.00125607
-d 47 19 0.00115393
-d 48 19 0.00106076
-d 49 19 0.000980166
-d 50 19 0.000918015
-d 51 19 0.000862837
-d 52 19 0.00080766
-d 53 19 0.000763488
-d 54 19 0.000721541
-d 55 19 0.000680825
-d 56 19 0.000653026
-d 57 19 0.000625226
-d 58 19 0.000597426
-d 59 19 0.000569627
-d 60 19 0.000541827
-d 61 19 0.000519087
-d 62 19 0.000499756
-d 63 19 0.000480424
-d 64 19 0.000461093
-d 65 19 0.000441761
-d 66 19 0.000423291
-d 67 19 0.000411941
-d 68 19 0.00040059
-d 69 19 0.00038924
-d 70 19 0.000377889
-d 71 19 0.000366539
-d 72 19 0.000355188
-d 73 19 0.000343838
-d 74 19 0.000332487
-d 75 19 0.000321137
-d 76 19 0.000309786
-d 77 19 0.000299055
-d 78 19 0.000292509
-d 79 19 0.000285963
-d 80 19 0.000279417
-d 81 19 0.000272871
-d 82 19 0.000266325
-d 83 19 0.000259779
-d 84 19 0.000253233
-d 85 19 0.000246686
-d 86 19 0.00024014
-d 87 19 0.000233594
-d 88 19 0.000227387
-d 89 19 0.0002231
-d 90 19 0.000218813
-d 91 19 0.000214526
-d 92 19 0.00021024
-d 93 19 0.000205953
-d 94 19 0.000201666
-d 95 19 0.000197379
-d 96 19 0.000193092
-d 97 19 0.000188805
-d 98 19 0.000184519
-d 99 19 0.000180526
-d 100 19 0.000177963
-d 101 19 0.0001754
-d 102 19 0.000172837
-d 103 19 0.000170274
-d 104 19 0.000167711
-d 105 19 0.000165148
-d 106 19 0.000162585
-d 107 19 0.000160022
-d 108 19 0.000157459
-d 109 19 0.000154895
-d 110 19 0.000152332
-d 111 19 0.000149769
-d 112 19 0.000147206
-d 113 19 0.000144643
-d 114 19 0.00014208
-d 115 19 0.000139517
-d 116 19 0.000136954
-d 117 19 0.000134391
-d 118 19 0.000131828
-d 119 19 0.000129265
-d 120 19 0.000126702
-d 121 19 0.000132838
-d 122 19 0.0311184
-d 123 19 0.163151
-d 124 19 0.34986
-d 125 19 0.604501
-d 126 19 0.357125
-d 127 19 0.136137
-d 128 19 0.0711304
-d 129 19 0.0346959
-d 130 19 0.0212674
-d 131 19 0.00872193
-d 132 19 0.00252206
-d 133 19 0.000455269
-d 134 19 7.59332e-05
-d 135 19 2.91532e-05
-d 136 19 0.000320562
-d 137 19 -0.0720911
-d 138 19 -0.0840491
-d 139 19 -0.0791345
-d 140 19 -0.0404143
-d 141 19 0.0182035
-d 142 19 -0.0235871
-d 143 19 -0.0426072
-d 144 19 -0.0597501
-d 145 19 0.00824773
-d 146 19 0.481404
-d 147 19 1.32496
-d 148 19 2.11949
-d 149 19 2.57317
-d 150 19 2.58202
-d 151 19 2.15054
-d 152 19 1.33786
-d 153 19 0.45702
-d 154 19 0.153772
-d 155 19 0.0913584
-d 156 19 0.0604989
-d 157 19 0.0421591
-d 158 19 0.0271456
-d 159 19 0.0170021
-d 160 19 0.0115815
-d 161 19 0.00907886
-d 162 19 0.00742466
-d 163 19 0.00626096
-d 164 19 0.00531127
-d 165 19 0.00450501
-d 166 19 0.00381927
-d 167 19 0.00323718
-d 168 19 0.00274374
-d 169 19 0.00232494
-d 170 19 0.00196885
-d 171 19 0.00166686
-d 172 19 0.00141134
-d 173 19 0.00119437
-d 174 19 0.0010109
-d 175 19 0.000855534
-d 176 19 0.000723378
-d 177 19 0.000611408
-d 178 19 0.000516704
-d 179 19 0.000436769
-d 180 19 0.000369523
-d 181 19 0.000313026
-d 182 19 0.00026526
-d 183 19 0.000223976
-d 184 19 0.000188972
-d 185 19 0.000159042
-d 186 19 0.000134148
-d 187 19 0.000112688
-d 188 19 9.49738e-05
-d 189 19 7.97877e-05
-d 190 19 6.721e-05
-d 191 19 5.65115e-05
-d 192 19 4.77194e-05
-d 193 19 4.03591e-05
-d 194 19 3.42848e-05
-d 195 19 2.92627e-05
-d 196 19 2.50435e-05
-d 197 19 2.1412e-05
-d 198 19 1.84532e-05
-d 199 19 1.58624e-05
-d 200 19 1.34673e-05
-d 201 19 1.14461e-05
-d 202 19 1.00935e-05
-d 203 19 9.12375e-06
-d 204 19 8.50202e-06
-d 205 19 7.81431e-06
-d 206 19 7.20729e-06
-d 207 19 6.73936e-06
-d 208 19 6.3702e-06
-d 209 19 5.90049e-06
-d 210 19 5.43077e-06
-d 211 19 4.96105e-06
-d 212 19 4.49133e-06
-d 213 19 4.02162e-06
-d 214 19 3.5519e-06
-d 215 19 3.08218e-06
-d 216 19 2.79099e-06
-d 217 19 2.51281e-06
-d 218 19 2.23463e-06
-d 219 19 1.95645e-06
-d 220 19 1.67827e-06
-d 221 19 1.40009e-06
-d 222 19 1.12191e-06
-d 223 19 1.01376e-06
-d 224 19 9.9375e-07
-d 225 19 9.73741e-07
-d 226 19 9.53733e-07
-d 227 19 9.33724e-07
-d 228 19 9.13715e-07
-d 229 19 8.93707e-07
-d 230 19 8.73698e-07
-d 231 19 8.5369e-07
-d 232 19 8.33681e-07
-d 233 19 8.13673e-07
-d 234 19 7.93664e-07
-d 235 19 7.73655e-07
-d 236 19 7.53647e-07
-d 237 19 7.21781e-07
-d 238 19 5.956e-07
-d 239 19 4.69419e-07
-d 240 19 3.43239e-07
-d 241 19 2.17058e-07
-d 242 19 0.0284032
-d 243 19 0.0374438
-d 244 19 -0.0157543
-d 245 19 -0.0680497
-d 246 19 0.0504768
-d 247 19 0.0100294
-d 248 19 0.00222261
-d 249 19 0.000528697
-d 250 19 0.000132929
-d 251 19 3.99489e-05
-d 252 19 2.46066e-05
-d 253 19 4.56327e-06
-d 254 19 -6.54853e-06
-d 255 19 1.33783e-05
-d 256 19 -3.68221e-05
-d 257 19 -0.0724498
-d 258 19 -0.0843663
-d 259 19 -0.0792935
-d 260 19 -0.0406426
-d 261 19 0.0200019
-d 262 19 0.0426259
-d 263 19 0.0220753
-d 264 19 0.00668555
-d 265 19 -0.000968483
-d 266 19 0.024662
-d 267 19 0.0383437
-d 268 19 0.0911513
-d 269 19 0.087848
-d 270 19 0.0602076
-d 271 19 0.0390559
-d 272 19 0.0260573
-d 273 19 0.0180444
-d 274 19 0.012974
-d 275 19 0.00985409
-d 276 19 0.00788132
-d 277 19 0.0064228
-d 278 19 0.005545
-d 279 19 0.00453571
-d 280 19 0.00364245
-d 281 19 0.00310278
-d 282 19 0.00270523
-d 283 19 0.00236439
-d 284 19 0.0020945
-d 285 19 0.00186808
-d 286 19 0.00167493
-d 287 19 0.00151731
-d 288 19 0.00138594
-d 289 19 0.00126945
-d 290 19 0.00116695
-d 291 19 0.0010762
-d 292 19 0.000996366
-d 293 19 0.000928387
-d 294 19 0.000864414
-d 295 19 0.000808258
-d 296 19 0.000759574
-d 297 19 0.000713865
-d 298 19 0.000666712
-d 299 19 0.000632716
-d 300 19 0.000601262
-d 301 19 0.000572163
-d 302 19 0.000543986
-d 303 19 0.000515253
-d 304 19 0.0004897
-d 305 19 0.000468112
-d 306 19 0.000449313
-d 307 19 0.000432981
-d 308 19 0.000417911
-d 309 19 0.000401307
-d 310 19 0.000382712
-d 311 19 0.000366678
-d 312 19 0.000355736
-d 313 19 0.000349171
-d 314 19 0.000335727
-d 315 19 0.000317091
-d 316 19 0.000296086
-d 317 19 0.000283543
-d 318 19 0.000277366
-d 319 19 0.000272233
-d 320 19 0.000267001
-d 321 19 0.000263147
-d 322 19 0.000256699
-d 323 19 0.000250251
-d 324 19 0.000243803
-d 325 19 0.000237355
-d 326 19 0.000230907
-d 327 19 0.000225424
-d 328 19 0.000220247
-d 329 19 0.000215069
-d 330 19 0.000209892
-d 331 19 0.000204714
-d 332 19 0.000200213
-d 333 19 0.000196548
-d 334 19 0.000192884
-d 335 19 0.00018922
-d 336 19 0.000185556
-d 337 19 0.000181892
-d 338 19 0.000178228
-d 339 19 0.000174564
-d 340 19 0.0001709
-d 341 19 0.000167236
-d 342 19 0.000163572
-d 343 19 0.000160824
-d 344 19 0.000158279
-d 345 19 0.000155733
-d 346 19 0.000153187
-d 347 19 0.000150641
-d 348 19 0.000148095
-d 349 19 0.000145549
-d 350 19 0.000143003
-d 351 19 0.000140457
-d 352 19 0.000137911
-d 353 19 0.000135457
-d 354 19 0.000133386
-d 355 19 0.000131315
-d 356 19 0.000129245
-d 357 19 0.000127174
-d 358 19 0.000125103
-d 359 19 0.000123032
-d 360 19 0.000120961
-d 361 19 0.000118891
-d 1 20 1.86175
-d 2 20 1.99994
-d 3 20 2.0833
-d 4 20 2.01627
-d 5 20 2.42503
-d 6 20 3.25769
-d 7 20 3.62134
-d 8 20 3.88827
-d 9 20 4.09688
-d 10 20 4.26773
-d 11 20 4.40529
-d 12 20 4.51734
-d 13 20 4.60827
-d 14 20 4.68313
-d 15 20 4.74346
-d 16 20 4.79302
-d 17 20 4.72815
-d 18 20 4.68959
-d 19 20 4.70421
-d 20 20 4.81316
-d 21 20 5.01375
-d 22 20 5.14493
-d 23 20 5.10305
-d 24 20 5.0699
-d 25 20 5.04484
-d 26 20 5.03751
-d 27 20 5.03348
-d 28 20 5.02504
-d 29 20 5.01799
-d 30 20 5.01271
-d 31 20 5.00895
-d 32 20 5.00628
-d 33 20 5.0044
-d 34 20 5.00309
-d 35 20 5.00216
-d 36 20 5.00151
-d 37 20 5.00105
-d 38 20 5.00073
-d 39 20 5.00051
-d 40 20 5.00034
-d 41 20 5.00023
-d 42 20 5.00015
-d 43 20 5.0001
-d 44 20 5.00007
-d 45 20 5.00003
-d 46 20 4.99998
-d 47 20 4.99993
-d 48 20 4.99993
-d 49 20 4.99995
-d 50 20 4.99999
-d 51 20 5.00001
-d 52 20 5.00003
-d 53 20 5.00002
-d 54 20 5.00001
-d 55 20 5.0
-d 56 20 5.0
-d 57 20 5.0
-d 58 20 5.0
-d 59 20 4.99999
-d 60 20 4.99999
-d 61 20 4.99999
-d 62 20 5.0
-d 63 20 5.0
-d 64 20 5.0
-d 65 20 5.0
-d 66 20 5.0
-d 67 20 5.0
-d 68 20 5.0
-d 69 20 5.0
-d 70 20 5.0
-d 71 20 5.0
-d 72 20 5.0
-d 73 20 5.0
-d 74 20 5.0
-d 75 20 5.0
-d 76 20 5.0
-d 77 20 5.0
-d 78 20 5.0
-d 79 20 5.0
-d 80 20 5.0
-d 81 20 5.0
-d 82 20 5.0
-d 83 20 5.0
-d 84 20 5.0
-d 85 20 5.0
-d 86 20 5.0
-d 87 20 5.0
-d 88 20 5.0
-d 89 20 5.0
-d 90 20 5.0
-d 91 20 5.0
-d 92 20 5.0
-d 93 20 5.0
-d 94 20 5.0
-d 95 20 5.0
-d 96 20 5.0
-d 97 20 5.0
-d 98 20 5.0
-d 99 20 5.0
-d 100 20 5.0
-d 101 20 5.0
-d 102 20 5.0
-d 103 20 5.0
-d 104 20 5.0
-d 105 20 5.0
-d 106 20 5.0
-d 107 20 5.0
-d 108 20 5.0
-d 109 20 5.0
-d 110 20 5.0
-d 111 20 5.0
-d 112 20 5.0
-d 113 20 5.0
-d 114 20 5.0
-d 115 20 5.0
-d 116 20 5.0
-d 117 20 5.0
-d 118 20 5.0
-d 119 20 5.0
-d 120 20 5.0
-d 121 20 5.00017
-d 122 20 5.17398
-d 123 20 4.94779
-d 124 20 3.78508
-d 125 20 1.52302
-d 126 20 0.608808
-d 127 20 0.244311
-d 128 20 0.126053
-d 129 20 0.0597175
-d 130 20 0.038422
-d 131 20 0.0158174
-d 132 20 0.00481338
-d 133 20 0.00107847
-d 134 20 0.000301256
-d 135 20 0.000114861
-d 136 20 0.00059489
-d 137 20 -0.118904
-d 138 20 -0.147478
-d 139 20 -0.158986
-d 140 20 -0.080544
-d 141 20 0.165361
-d 142 20 0.171378
-d 143 20 0.0776087
-d 144 20 0.0435738
-d 145 20 0.0428235
-d 146 20 0.0423755
-d 147 20 0.0347695
-d 148 20 0.0225061
-d 149 20 0.0155539
-d 150 20 0.0121357
-d 151 20 0.0107997
-d 152 20 0.0103976
-d 153 20 0.0124406
-d 154 20 0.016814
-d 155 20 0.0167556
-d 156 20 0.0149852
-d 157 20 0.01459
-d 158 20 0.0141182
-d 159 20 0.0131934
-d 160 20 0.0120286
-d 161 20 0.0108692
-d 162 20 0.0097184
-d 163 20 0.00855881
-d 164 20 0.00744912
-d 165 20 0.00643877
-d 166 20 0.00554044
-d 167 20 0.00475165
-d 168 20 0.00406535
-d 169 20 0.00347158
-d 170 20 0.00295981
-d 171 20 0.00251995
-d 172 20 0.00214318
-d 173 20 0.00182101
-d 174 20 0.00154613
-d 175 20 0.00131196
-d 176 20 0.0011119
-d 177 20 0.000941587
-d 178 20 0.000796999
-d 179 20 0.000674582
-d 180 20 0.000571283
-d 181 20 0.000484276
-d 182 20 0.000410649
-d 183 20 0.000347005
-d 184 20 0.000292984
-d 185 20 0.000246715
-d 186 20 0.000208143
-d 187 20 0.00017489
-d 188 20 0.000147412
-d 189 20 0.000123854
-d 190 20 0.000104332
-d 191 20 8.77229e-05
-d 192 20 7.40686e-05
-d 193 20 6.2637e-05
-d 194 20 5.32e-05
-d 195 20 4.53946e-05
-d 196 20 3.88343e-05
-d 197 20 3.31864e-05
-d 198 20 2.85905e-05
-d 199 20 2.45725e-05
-d 200 20 2.08671e-05
-d 201 20 1.77301e-05
-d 202 20 1.55911e-05
-d 203 20 1.40153e-05
-d 204 20 1.29421e-05
-d 205 20 1.18693e-05
-d 206 20 1.09815e-05
-d 207 20 1.03484e-05
-d 208 20 9.87664e-06
-d 209 20 9.14446e-06
-d 210 20 8.41228e-06
-d 211 20 7.68011e-06
-d 212 20 6.94793e-06
-d 213 20 6.21575e-06
-d 214 20 5.48357e-06
-d 215 20 4.7514e-06
-d 216 20 4.38454e-06
-d 217 20 4.04432e-06
-d 218 20 3.7041e-06
-d 219 20 3.36388e-06
-d 220 20 3.02366e-06
-d 221 20 2.68344e-06
-d 222 20 2.34322e-06
-d 223 20 2.15196e-06
-d 224 20 2.03791e-06
-d 225 20 1.92386e-06
-d 226 20 1.80982e-06
-d 227 20 1.69577e-06
-d 228 20 1.58173e-06
-d 229 20 1.46768e-06
-d 230 20 1.35363e-06
-d 231 20 1.23959e-06
-d 232 20 1.12554e-06
-d 233 20 1.0115e-06
-d 234 20 8.9745e-07
-d 235 20 7.83404e-07
-d 236 20 6.69358e-07
-d 237 20 4.76113e-07
-d 238 20 -3.47071e-07
-d 239 20 -1.17025e-06
-d 240 20 -1.99344e-06
-d 241 20 -2.81662e-06
-d 242 20 0.0783754
-d 243 20 0.0500262
-d 244 20 -0.0659563
-d 245 20 -0.120914
-d 246 20 0.0815957
-d 247 20 0.0154255
-d 248 20 0.00347177
-d 249 20 0.000840357
-d 250 20 0.000214582
-d 251 20 6.54655e-05
-d 252 20 3.91709e-05
-d 253 20 8.07396e-06
-d 254 20 -4.44265e-07
-d 255 20 1.74384e-05
-d 256 20 -4.52725e-05
-d 257 20 -0.119379
-d 258 20 -0.147984
-d 259 20 -0.159247
-d 260 20 -0.0824604
-d 261 20 0.169014
-d 262 20 0.177628
-d 263 20 0.0758742
-d 264 20 0.010558
-d 265 20 -0.0346506
-d 266 20 -0.0710288
-d 267 20 -0.0838952
-d 268 20 -0.0599521
-d 269 20 -0.034568
-d 270 20 -0.0181615
-d 271 20 -0.00968034
-d 272 20 -0.00547115
-d 273 20 -0.00333511
-d 274 20 -0.00232468
-d 275 20 -0.00181159
-d 276 20 -0.00143841
-d 277 20 -0.00116601
-d 278 20 -0.000839755
-d 279 20 -0.000569764
-d 280 20 -0.000578683
-d 281 20 -0.000490551
-d 282 20 -0.000411712
-d 283 20 -0.000437859
-d 284 20 -0.000408185
-d 285 20 -0.000356644
-d 286 20 -0.000311332
-d 287 20 -0.000269006
-d 288 20 -0.000221396
-d 289 20 -0.000210054
-d 290 20 -0.0001923
-d 291 20 -0.000175122
-d 292 20 -0.000161039
-d 293 20 -0.0001428
-d 294 20 -0.000126123
-d 295 20 -0.000127893
-d 296 20 -8.14516e-05
-d 297 20 -0.000120166
-d 298 20 -0.000154909
-d 299 20 -0.000112733
-d 300 20 -8.40377e-05
-d 301 20 -7.11342e-05
-d 302 20 -8.09538e-05
-d 303 20 -9.77789e-05
-d 304 20 -9.82402e-05
-d 305 20 -7.73531e-05
-d 306 20 -5.28255e-05
-d 307 20 -3.1096e-05
-d 308 20 -1.87967e-05
-d 309 20 -1.96552e-05
-d 310 20 -4.16655e-05
-d 311 20 -5.77185e-05
-d 312 20 -5.24142e-05
-d 313 20 -2.83153e-05
-d 314 20 -1.90012e-05
-d 315 20 -1.54415e-05
-d 316 20 -2.52569e-05
-d 317 20 -6.23747e-05
-d 318 20 -0.000130543
-d 319 20 -0.000149394
-d 320 20 -0.000110886
-d 321 20 -4.35517e-05
-d 322 20 -4.17084e-05
-d 323 20 -3.98651e-05
-d 324 20 -3.80218e-05
-d 325 20 -3.61785e-05
-d 326 20 -3.43352e-05
-d 327 20 -3.36249e-05
-d 328 20 -3.32729e-05
-d 329 20 -3.29208e-05
-d 330 20 -3.25687e-05
-d 331 20 -3.22166e-05
-d 332 20 -3.17143e-05
-d 333 20 -3.10258e-05
-d 334 20 -3.03372e-05
-d 335 20 -2.96486e-05
-d 336 20 -2.89601e-05
-d 337 20 -2.82715e-05
-d 338 20 -2.75829e-05
-d 339 20 -2.68944e-05
-d 340 20 -2.62058e-05
-d 341 20 -2.55173e-05
-d 342 20 -2.48287e-05
-d 343 20 -2.43043e-05
-d 344 20 -2.38159e-05
-d 345 20 -2.33276e-05
-d 346 20 -2.28393e-05
-d 347 20 -2.2351e-05
-d 348 20 -2.18626e-05
-d 349 20 -2.13743e-05
-d 350 20 -2.0886e-05
-d 351 20 -2.03977e-05
-d 352 20 -1.99093e-05
-d 353 20 -1.945e-05
-d 354 20 -1.91122e-05
-d 355 20 -1.87744e-05
-d 356 20 -1.84366e-05
-d 357 20 -1.80987e-05
-d 358 20 -1.77609e-05
-d 359 20 -1.74231e-05
-d 360 20 -1.70853e-05
-d 361 20 -1.67474e-05
-d 1 21 1.86175
-d 2 21 1.99724
-d 3 21 2.17266
-d 4 21 2.48439
-d 5 21 3.15933
-d 6 21 3.85231
-d 7 21 4.38091
-d 8 21 4.69033
-d 9 21 4.85034
-d 10 21 4.92851
-d 11 21 4.96453
-d 12 21 4.98188
-d 13 21 4.98736
-d 14 21 4.991
-d 15 21 4.99482
-d 16 21 4.9973
-d 17 21 4.96422
-d 18 21 4.89989
-d 19 21 4.83907
-d 20 21 4.83151
-d 21 21 4.90868
-d 22 21 5.04854
-d 23 21 5.06104
-d 24 21 5.04571
-d 25 21 5.03219
-d 26 21 5.03025
-d 27 21 5.02273
-d 28 21 5.01707
-d 29 21 5.0123
-d 30 21 5.0087
-d 31 21 5.00611
-d 32 21 5.00429
-d 33 21 5.00301
-d 34 21 5.00211
-d 35 21 5.00148
-d 36 21 5.00103
-d 37 21 5.00072
-d 38 21 5.0005
-d 39 21 5.00035
-d 40 21 5.00024
-d 41 21 5.00016
-d 42 21 5.00011
-d 43 21 5.00007
-d 44 21 5.00005
-d 45 21 5.00003
-d 46 21 5.00001
-d 47 21 4.99999
-d 48 21 4.99998
-d 49 21 4.99998
-d 50 21 4.99998
-d 51 21 4.99998
-d 52 21 4.99998
-d 53 21 4.99999
-d 54 21 5.0
-d 55 21 5.0
-d 56 21 5.00001
-d 57 21 5.00001
-d 58 21 5.00002
-d 59 21 5.00002
-d 60 21 5.00002
-d 61 21 5.00002
-d 62 21 5.00002
-d 63 21 5.00002
-d 64 21 5.00001
-d 65 21 5.00001
-d 66 21 5.0
-d 67 21 5.0
-d 68 21 5.0
-d 69 21 5.0
-d 70 21 5.0
-d 71 21 5.0
-d 72 21 4.99999
-d 73 21 4.99999
-d 74 21 4.99999
-d 75 21 4.99999
-d 76 21 4.99999
-d 77 21 4.99999
-d 78 21 4.99999
-d 79 21 4.99999
-d 80 21 4.99999
-d 81 21 4.99999
-d 82 21 4.99999
-d 83 21 4.99999
-d 84 21 4.99999
-d 85 21 5.0
-d 86 21 5.0
-d 87 21 5.0
-d 88 21 5.0
-d 89 21 5.0
-d 90 21 5.0
-d 91 21 5.0
-d 92 21 5.0
-d 93 21 5.00001
-d 94 21 5.00001
-d 95 21 5.00001
-d 96 21 5.00001
-d 97 21 5.00001
-d 98 21 5.00001
-d 99 21 5.00001
-d 100 21 5.00001
-d 101 21 5.00001
-d 102 21 5.00001
-d 103 21 5.00001
-d 104 21 5.00001
-d 105 21 5.00001
-d 106 21 5.00001
-d 107 21 5.00001
-d 108 21 5.00001
-d 109 21 5.00001
-d 110 21 5.00001
-d 111 21 5.00001
-d 112 21 5.00001
-d 113 21 5.00001
-d 114 21 5.00001
-d 115 21 5.0
-d 116 21 5.0
-d 117 21 5.0
-d 118 21 5.0
-d 119 21 5.0
-d 120 21 5.0
-d 121 21 4.99981
-d 122 21 5.10081
-d 123 21 5.10903
-d 124 21 4.98404
-d 125 21 5.00999
-d 126 21 5.14946
-d 127 21 4.36501
-d 128 21 2.23938
-d 129 21 0.325144
-d 130 21 0.00660272
-d 131 21 -0.0102186
-d 132 21 -0.0082401
-d 133 21 -0.00556785
-d 134 21 -0.00374178
-d 135 21 -0.00264763
-d 136 21 -0.00202823
-d 137 21 -0.0182241
-d 138 21 -0.0169551
-d 139 21 -0.0150395
-d 140 21 0.0103736
-d 141 21 0.0877592
-d 142 21 0.104382
-d 143 21 0.0515938
-d 144 21 0.0373818
-d 145 21 0.0411547
-d 146 21 0.0397009
-d 147 21 0.0308946
-d 148 21 0.0205793
-d 149 21 0.0154037
-d 150 21 0.0129191
-d 151 21 0.0119327
-d 152 21 0.011527
-d 153 21 0.0124295
-d 154 21 0.0161152
-d 155 21 0.0161076
-d 156 21 0.0145391
-d 157 21 0.0144541
-d 158 21 0.0139287
-d 159 21 0.0129215
-d 160 21 0.0117239
-d 161 21 0.0105795
-d 162 21 0.00942983
-d 163 21 0.00827423
-d 164 21 0.00718354
-d 165 21 0.00619954
-d 166 21 0.00532868
-d 167 21 0.00456631
-d 168 21 0.00390448
-d 169 21 0.00333254
-d 170 21 0.00284003
-d 171 21 0.00241714
-d 172 21 0.00205524
-d 173 21 0.0017458
-d 174 21 0.00148202
-d 175 21 0.00125739
-d 176 21 0.0010655
-d 177 21 0.000902213
-d 178 21 0.000763611
-d 179 21 0.000646279
-d 180 21 0.000547291
-d 181 21 0.000463934
-d 182 21 0.000393401
-d 183 21 0.000332424
-d 184 21 0.000280655
-d 185 21 0.000236328
-d 186 21 0.000199386
-d 187 21 0.000167536
-d 188 21 0.000141218
-d 189 21 0.000118654
-d 190 21 9.99559e-05
-d 191 21 8.40479e-05
-d 192 21 7.09694e-05
-d 193 21 6.00188e-05
-d 194 21 5.09786e-05
-d 195 21 4.3502e-05
-d 196 21 3.72191e-05
-d 197 21 3.18114e-05
-d 198 21 2.74071e-05
-d 199 21 2.35539e-05
-d 200 21 1.99967e-05
-d 201 21 1.69871e-05
-d 202 21 1.49449e-05
-d 203 21 1.3451e-05
-d 204 21 1.24492e-05
-d 205 21 1.14256e-05
-d 206 21 1.05669e-05
-d 207 21 9.94487e-06
-d 208 21 9.47514e-06
-d 209 21 8.77318e-06
-d 210 21 8.07123e-06
-d 211 21 7.36927e-06
-d 212 21 6.66731e-06
-d 213 21 5.96536e-06
-d 214 21 5.2634e-06
-d 215 21 4.56144e-06
-d 216 21 4.23044e-06
-d 217 21 3.92649e-06
-d 218 21 3.62254e-06
-d 219 21 3.31858e-06
-d 220 21 3.01463e-06
-d 221 21 2.71068e-06
-d 222 21 2.40673e-06
-d 223 21 2.23063e-06
-d 224 21 2.12082e-06
-d 225 21 2.01102e-06
-d 226 21 1.90121e-06
-d 227 21 1.7914e-06
-d 228 21 1.68159e-06
-d 229 21 1.57178e-06
-d 230 21 1.46197e-06
-d 231 21 1.35216e-06
-d 232 21 1.24235e-06
-d 233 21 1.13255e-06
-d 234 21 1.02274e-06
-d 235 21 9.12929e-07
-d 236 21 8.0312e-07
-d 237 21 6.33171e-07
-d 238 21 -1.51288e-08
-d 239 21 -6.63428e-07
-d 240 21 -1.31173e-06
-d 241 21 -1.96003e-06
-d 242 21 0.0437517
-d 243 21 0.0265689
-d 244 21 -0.0515377
-d 245 21 -0.0658688
-d 246 21 0.010727
-d 247 21 -0.000511921
-d 248 21 -8.36924e-05
-d 249 21 2.13278e-05
-d 250 21 1.45207e-05
-d 251 21 4.54862e-06
-d 252 21 -6.14726e-06
-d 253 21 2.0062e-06
-d 254 21 1.02709e-06
-d 255 21 1.4152e-05
-d 256 21 -3.08225e-05
-d 257 21 -0.0166501
-d 258 21 -0.0157139
-d 259 21 -0.013957
-d 260 21 0.0107537
-d 261 21 0.0873717
-d 262 21 0.111302
-d 263 21 0.0454129
-d 264 21 -0.00530142
-d 265 21 -0.0468336
-d 266 21 -0.0790063
-d 267 21 -0.0826944
-d 268 21 -0.0534753
-d 269 21 -0.0288705
-d 270 21 -0.0149009
-d 271 21 -0.00801592
-d 272 21 -0.0046342
-d 273 21 -0.00291835
-d 274 21 -0.00213019
-d 275 21 -0.00170055
-d 276 21 -0.001352
-d 277 21 -0.00110593
-d 278 21 -0.000742655
-d 279 21 -0.000532042
-d 280 21 -0.000544742
-d 281 21 -0.000479206
-d 282 21 -0.000407307
-d 283 21 -0.000403575
-d 284 21 -0.000366209
-d 285 21 -0.000324161
-d 286 21 -0.000286183
-d 287 21 -0.000247579
-d 288 21 -0.000214281
-d 289 21 -0.000203435
-d 290 21 -0.000186896
-d 291 21 -0.000171033
-d 292 21 -0.00015779
-d 293 21 -0.000145259
-d 294 21 -0.000128069
-d 295 21 -0.000122647
-d 296 21 -9.89398e-05
-d 297 21 -0.000114926
-d 298 21 -0.000132195
-d 299 21 -0.000107872
-d 300 21 -8.91015e-05
-d 301 21 -7.87996e-05
-d 302 21 -8.14061e-05
-d 303 21 -8.9098e-05
-d 304 21 -8.83368e-05
-d 305 21 -7.6122e-05
-d 306 21 -6.14668e-05
-d 307 21 -4.75402e-05
-d 308 21 -3.81855e-05
-d 309 21 -3.69696e-05
-d 310 21 -4.78656e-05
-d 311 21 -5.61346e-05
-d 312 21 -5.35007e-05
-d 313 21 -4.1459e-05
-d 314 21 -3.35411e-05
-d 315 21 -2.52374e-05
-d 316 21 -2.37479e-05
-d 317 21 -4.6406e-05
-d 318 21 -9.41884e-05
-d 319 21 -0.000109222
-d 320 21 -8.52676e-05
-d 321 21 -4.25166e-05
-d 322 21 -4.10125e-05
-d 323 21 -3.95085e-05
-d 324 21 -3.80045e-05
-d 325 21 -3.65004e-05
-d 326 21 -3.49964e-05
-d 327 21 -3.41627e-05
-d 328 21 -3.3541e-05
-d 329 21 -3.29193e-05
-d 330 21 -3.22976e-05
-d 331 21 -3.16758e-05
-d 332 21 -3.10334e-05
-d 333 21 -3.03653e-05
-d 334 21 -2.96971e-05
-d 335 21 -2.9029e-05
-d 336 21 -2.83609e-05
-d 337 21 -2.76928e-05
-d 338 21 -2.70246e-05
-d 339 21 -2.63565e-05
-d 340 21 -2.56884e-05
-d 341 21 -2.50203e-05
-d 342 21 -2.43521e-05
-d 343 21 -2.38716e-05
-d 344 21 -2.34324e-05
-d 345 21 -2.29932e-05
-d 346 21 -2.25539e-05
-d 347 21 -2.21147e-05
-d 348 21 -2.16755e-05
-d 349 21 -2.12362e-05
-d 350 21 -2.0797e-05
-d 351 21 -2.03578e-05
-d 352 21 -1.99186e-05
-d 353 21 -1.95079e-05
-d 354 21 -1.9217e-05
-d 355 21 -1.8926e-05
-d 356 21 -1.8635e-05
-d 357 21 -1.8344e-05
-d 358 21 -1.8053e-05
-d 359 21 -1.7762e-05
-d 360 21 -1.74711e-05
-d 361 21 -1.71801e-05
-d 1 22 1.86175
-d 2 22 1.73273
-d 3 22 1.42016
-d 4 22 1.02483
-d 5 22 0.944013
-d 6 22 0.274107
-d 7 22 0.0823742
-d 8 22 0.0379366
-d 9 22 0.020816
-d 10 22 0.0132952
-d 11 22 0.00955525
-d 12 22 0.00717008
-d 13 22 0.00592286
-d 14 22 0.00437379
-d 15 22 0.00383557
-d 16 22 0.00273694
-d 17 22 -0.0037467
-d 18 22 -0.0054191
-d 19 22 -0.00131454
-d 20 22 0.0112179
-d 21 22 0.0133918
-d 22 22 0.00519747
-d 23 22 -0.00260113
-d 24 22 -0.00252847
-d 25 22 -0.00181292
-d 26 22 0.000183398
-d 27 22 -0.000667607
-d 28 22 -0.000750747
-d 29 22 -0.000594314
-d 30 22 -0.000433904
-d 31 22 -0.000308985
-d 32 22 -0.000217858
-d 33 22 -0.000152926
-d 34 22 -0.000107454
-d 35 22 -7.54076e-05
-d 36 22 -5.2675e-05
-d 37 22 -3.66299e-05
-d 38 22 -2.54341e-05
-d 39 22 -1.75095e-05
-d 40 22 -1.18848e-05
-d 41 22 -7.97289e-06
-d 42 22 -5.30239e-06
-d 43 22 -3.53615e-06
-d 44 22 -2.38504e-06
-d 45 22 -2.40158e-06
-d 46 22 -3.84485e-06
-d 47 22 -5.29435e-06
-d 48 22 -2.57099e-06
-d 49 22 1.95189e-06
-d 50 22 3.55083e-06
-d 51 22 2.06179e-06
-d 52 22 5.72753e-07
-d 53 22 3.30469e-07
-d 54 22 3.40296e-07
-d 55 22 3.60221e-07
-d 56 22 4.86081e-07
-d 57 22 6.1194e-07
-d 58 22 7.37799e-07
-d 59 22 8.63659e-07
-d 60 22 9.89518e-07
-d 61 22 9.21274e-07
-d 62 22 7.22275e-07
-d 63 22 5.23276e-07
-d 64 22 3.24277e-07
-d 65 22 1.25278e-07
-d 66 22 -5.59467e-08
-d 67 22 -9.03265e-08
-d 68 22 -1.24706e-07
-d 69 22 -1.59086e-07
-d 70 22 -1.93466e-07
-d 71 22 -2.27846e-07
-d 72 22 -2.62226e-07
-d 73 22 -2.96605e-07
-d 74 22 -3.30985e-07
-d 75 22 -3.65365e-07
-d 76 22 -3.99745e-07
-d 77 22 -4.24266e-07
-d 78 22 -3.82163e-07
-d 79 22 -3.40061e-07
-d 80 22 -2.97959e-07
-d 81 22 -2.55857e-07
-d 82 22 -2.13755e-07
-d 83 22 -1.71652e-07
-d 84 22 -1.2955e-07
-d 85 22 -8.7448e-08
-d 86 22 -4.53457e-08
-d 87 22 -3.24353e-09
-d 88 22 3.76901e-08
-d 89 22 7.19937e-08
-d 90 22 1.06297e-07
-d 91 22 1.40601e-07
-d 92 22 1.74904e-07
-d 93 22 2.09208e-07
-d 94 22 2.43512e-07
-d 95 22 2.77815e-07
-d 96 22 3.12119e-07
-d 97 22 3.46422e-07
-d 98 22 3.80726e-07
-d 99 22 4.04507e-07
-d 100 22 3.77191e-07
-d 101 22 3.49876e-07
-d 102 22 3.22561e-07
-d 103 22 2.95246e-07
-d 104 22 2.67931e-07
-d 105 22 2.40616e-07
-d 106 22 2.13301e-07
-d 107 22 1.85986e-07
-d 108 22 1.58671e-07
-d 109 22 1.31356e-07
-d 110 22 1.04041e-07
-d 111 22 7.67256e-08
-d 112 22 4.94105e-08
-d 113 22 2.20955e-08
-d 114 22 -5.21962e-09
-d 115 22 -3.25347e-08
-d 116 22 -5.98498e-08
-d 117 22 -8.71649e-08
-d 118 22 -1.1448e-07
-d 119 22 -1.41795e-07
-d 120 22 -1.6911e-07
-d 121 22 7.87893e-06
-d 122 22 0.0114592
-d 123 22 -0.0245712
-d 124 22 -0.111637
-d 125 22 0.0961324
-d 126 22 1.61168
-d 127 22 3.22343
-d 128 22 4.20442
-d 129 22 4.53535
-d 130 22 4.83834
-d 131 22 4.95464
-d 132 22 4.98874
-d 133 22 4.99746
-d 134 22 4.99883
-d 135 22 4.99948
-d 136 22 4.99815
-d 137 22 4.98431
-d 138 22 4.99298
-d 139 22 4.99718
-d 140 22 5.01948
-d 141 22 5.04749
-d 142 22 5.008
-d 143 22 4.98243
-d 144 22 4.98985
-d 145 22 4.99781
-d 146 22 4.99887
-d 147 22 4.99679
-d 148 22 4.99616
-d 149 22 4.99743
-d 150 22 4.99859
-d 151 22 4.99936
-d 152 22 4.99972
-d 153 22 5.00058
-d 154 22 5.00123
-d 155 22 5.0002
-d 156 22 4.99945
-d 157 22 4.99983
-d 158 22 4.9998
-d 159 22 4.99966
-d 160 22 4.99958
-d 161 22 4.99956
-d 162 22 4.99956
-d 163 22 4.99956
-d 164 22 4.99958
-d 165 22 4.99961
-d 166 22 4.99965
-d 167 22 4.99969
-d 168 22 4.99973
-d 169 22 4.99977
-d 170 22 4.9998
-d 171 22 4.99983
-d 172 22 4.99985
-d 173 22 4.99987
-d 174 22 4.99989
-d 175 22 4.99991
-d 176 22 4.99992
-d 177 22 4.99993
-d 178 22 4.99994
-d 179 22 4.99995
-d 180 22 4.99996
-d 181 22 4.99997
-d 182 22 4.99997
-d 183 22 4.99998
-d 184 22 4.99998
-d 185 22 4.99998
-d 186 22 4.99999
-d 187 22 4.99999
-d 188 22 4.99999
-d 189 22 4.99999
-d 190 22 4.99999
-d 191 22 4.99999
-d 192 22 4.99999
-d 193 22 5.0
-d 194 22 5.0
-d 195 22 5.0
-d 196 22 5.0
-d 197 22 5.0
-d 198 22 5.0
-d 199 22 5.0
-d 200 22 5.0
-d 201 22 5.0
-d 202 22 5.0
-d 203 22 5.0
-d 204 22 5.0
-d 205 22 5.0
-d 206 22 5.0
-d 207 22 5.0
-d 208 22 5.0
-d 209 22 5.0
-d 210 22 5.0
-d 211 22 5.0
-d 212 22 5.0
-d 213 22 5.0
-d 214 22 5.0
-d 215 22 5.0
-d 216 22 5.0
-d 217 22 5.00001
-d 218 22 5.00001
-d 219 22 5.00001
-d 220 22 5.00002
-d 221 22 5.00002
-d 222 22 5.00002
-d 223 22 5.00002
-d 224 22 5.00002
-d 225 22 5.00002
-d 226 22 5.00002
-d 227 22 5.00002
-d 228 22 5.00001
-d 229 22 5.00001
-d 230 22 5.00001
-d 231 22 5.00001
-d 232 22 5.00001
-d 233 22 5.00001
-d 234 22 5.00001
-d 235 22 5.0
-d 236 22 5.0
-d 237 22 5.0
-d 238 22 4.99999
-d 239 22 4.99998
-d 240 22 4.99997
-d 241 22 4.99996
-d 242 22 5.01454
-d 243 22 4.99566
-d 244 22 4.96796
-d 245 22 4.99819
-d 246 22 5.03232
-d 247 22 5.00034
-d 248 22 4.99867
-d 249 22 4.99937
-d 250 22 4.99977
-d 251 22 4.99992
-d 252 22 4.99997
-d 253 22 4.99999
-d 254 22 5.00001
-d 255 22 5.00021
-d 256 22 4.99974
-d 257 22 4.98462
-d 258 22 4.99301
-d 259 22 4.99723
-d 260 22 5.01936
-d 261 22 5.04807
-d 262 22 5.00929
-d 263 22 4.9789
-d 264 22 4.97876
-d 265 22 4.98244
-d 266 22 4.9863
-d 267 22 4.99575
-d 268 22 5.0069
-d 269 22 5.00863
-d 270 22 5.00624
-d 271 22 5.00357
-d 272 22 5.0019
-d 273 22 5.00098
-d 274 22 5.00048
-d 275 22 5.00025
-d 276 22 5.00016
-d 277 22 5.00011
-d 278 22 5.00013
-d 279 22 5.00009
-d 280 22 4.99982
-d 281 22 4.99994
-d 282 22 5.00005
-d 283 22 4.99994
-d 284 22 4.99988
-d 285 22 4.99989
-d 286 22 4.99997
-d 287 22 5.00003
-d 288 22 5.00005
-d 289 22 5.00002
-d 290 22 5.00001
-d 291 22 5.00001
-d 292 22 5.00001
-d 293 22 4.99993
-d 294 22 4.99999
-d 295 22 5.0
-d 296 22 5.00021
-d 297 22 4.99997
-d 298 22 4.99981
-d 299 22 5.0
-d 300 22 5.00009
-d 301 22 5.0001
-d 302 22 5.00001
-d 303 22 4.99991
-d 304 22 4.9999
-d 305 22 5.0
-d 306 22 5.00011
-d 307 22 5.00017
-d 308 22 5.00018
-d 309 22 5.00018
-d 310 22 5.00014
-d 311 22 5.00007
-d 312 22 4.99999
-d 313 22 4.9999
-d 314 22 4.9999
-d 315 22 5.00001
-d 316 22 5.00016
-d 317 22 5.00014
-d 318 22 4.99999
-d 319 22 4.99993
-d 320 22 4.99999
-d 321 22 5.00009
-d 322 22 5.00007
-d 323 22 5.00006
-d 324 22 5.00004
-d 325 22 5.00003
-d 326 22 5.00001
-d 327 22 5.00001
-d 328 22 5.0
-d 329 22 4.99999
-d 330 22 4.99998
-d 331 22 4.99997
-d 332 22 4.99997
-d 333 22 4.99997
-d 334 22 4.99998
-d 335 22 4.99998
-d 336 22 4.99998
-d 337 22 4.99998
-d 338 22 4.99999
-d 339 22 4.99999
-d 340 22 4.99999
-d 341 22 5.0
-d 342 22 5.0
-d 343 22 5.0
-d 344 22 5.0
-d 345 22 5.0
-d 346 22 5.0
-d 347 22 5.00001
-d 348 22 5.00001
-d 349 22 5.00001
-d 350 22 5.00001
-d 351 22 5.00001
-d 352 22 5.00002
-d 353 22 5.00002
-d 354 22 5.00001
-d 355 22 5.00001
-d 356 22 5.00001
-d 357 22 5.00001
-d 358 22 5.00001
-d 359 22 5.00001
-d 360 22 5.0
-d 361 22 5.0
-d 1 23 7.10441e-10
-d 2 23 0.00107105
-d 3 23 0.000637109
-d 4 23 -0.00236346
-d 5 23 -0.018079
-d 6 23 -0.0120077
-d 7 23 -0.00217059
-d 8 23 0.00266679
-d 9 23 0.00403383
-d 10 23 0.00403836
-d 11 23 0.00356705
-d 12 23 0.00303303
-d 13 23 0.00244716
-d 14 23 0.00198586
-d 15 23 0.0016855
-d 16 23 0.00136497
-d 17 23 -3.96022e-05
-d 18 23 -0.000367409
-d 19 23 -3.77079e-05
-d 20 23 0.00194085
-d 21 23 0.00506964
-d 22 23 -0.0400214
-d 23 23 -0.0402572
-d 24 23 0.0524434
-d 25 23 0.286234
-d 26 23 0.803011
-d 27 23 1.44795
-d 28 23 2.02473
-d 29 23 2.54768
-d 30 23 3.02748
-d 31 23 3.4415
-d 32 23 3.78287
-d 33 23 4.09667
-d 34 23 4.35152
-d 35 23 4.53987
-d 36 23 4.67614
-d 37 23 4.77407
-d 38 23 4.84319
-d 39 23 4.89227
-d 40 23 4.92702
-d 41 23 4.95119
-d 42 23 4.96764
-d 43 23 4.97846
-d 44 23 4.98557
-d 45 23 4.98982
-d 46 23 4.99209
-d 47 23 4.99371
-d 48 23 4.99569
-d 49 23 4.99727
-d 50 23 4.99802
-d 51 23 4.99834
-d 52 23 4.99867
-d 53 23 4.99892
-d 54 23 4.99915
-d 55 23 4.99936
-d 56 23 4.99939
-d 57 23 4.99943
-d 58 23 4.99946
-d 59 23 4.9995
-d 60 23 4.99953
-d 61 23 4.99957
-d 62 23 4.9996
-d 63 23 4.99963
-d 64 23 4.99967
-d 65 23 4.9997
-d 66 23 4.99973
-d 67 23 4.99974
-d 68 23 4.99975
-d 69 23 4.99976
-d 70 23 4.99977
-d 71 23 4.99978
-d 72 23 4.9998
-d 73 23 4.99981
-d 74 23 4.99982
-d 75 23 4.99983
-d 76 23 4.99984
-d 77 23 4.99985
-d 78 23 4.99986
-d 79 23 4.99986
-d 80 23 4.99986
-d 81 23 4.99987
-d 82 23 4.99987
-d 83 23 4.99988
-d 84 23 4.99988
-d 85 23 4.99989
-d 86 23 4.99989
-d 87 23 4.9999
-d 88 23 4.9999
-d 89 23 4.9999
-d 90 23 4.9999
-d 91 23 4.99991
-d 92 23 4.99991
-d 93 23 4.99991
-d 94 23 4.99991
-d 95 23 4.99992
-d 96 23 4.99992
-d 97 23 4.99992
-d 98 23 4.99992
-d 99 23 4.99993
-d 100 23 4.99993
-d 101 23 4.99993
-d 102 23 4.99993
-d 103 23 4.99993
-d 104 23 4.99993
-d 105 23 4.99993
-d 106 23 4.99993
-d 107 23 4.99994
-d 108 23 4.99994
-d 109 23 4.99994
-d 110 23 4.99994
-d 111 23 4.99994
-d 112 23 4.99994
-d 113 23 4.99994
-d 114 23 4.99994
-d 115 23 4.99995
-d 116 23 4.99995
-d 117 23 4.99995
-d 118 23 4.99995
-d 119 23 4.99995
-d 120 23 4.99995
-d 121 23 4.99995
-d 122 23 5.00145
-d 123 23 5.00659
-d 124 23 5.01209
-d 125 23 5.01931
-d 126 23 5.00279
-d 127 23 4.99273
-d 128 23 4.99217
-d 129 23 4.99295
-d 130 23 4.99471
-d 131 23 4.99594
-d 132 23 4.99696
-d 133 23 4.9978
-d 134 23 4.99844
-d 135 23 4.99891
-d 136 23 4.99924
-d 137 23 4.99635
-d 138 23 4.99699
-d 139 23 4.99813
-d 140 23 5.00068
-d 141 23 5.00307
-d 142 23 5.0588
-d 143 23 4.96365
-d 144 23 4.54012
-d 145 23 3.6307
-d 146 23 2.35176
-d 147 23 1.0322
-d 148 23 0.354379
-d 149 23 0.115986
-d 150 23 0.0435668
-d 151 23 0.0245112
-d 152 23 0.020786
-d 153 23 0.0164656
-d 154 23 0.0118409
-d 155 23 0.00849698
-d 156 23 0.00597078
-d 157 23 0.0040105
-d 158 23 0.0026076
-d 159 23 0.0016597
-d 160 23 0.00118185
-d 161 23 0.00121067
-d 162 23 0.00153587
-d 163 23 0.00174836
-d 164 23 0.00136519
-d 165 23 -0.000189116
-d 166 23 -0.00315555
-d 167 23 -0.00646603
-d 168 23 -0.00898042
-d 169 23 -0.010203
-d 170 23 -0.0110896
-d 171 23 -0.0123764
-d 172 23 -0.00953841
-d 173 23 -0.00225795
-d 174 23 0.000818314
-d 175 23 0.00152252
-d 176 23 0.00150269
-d 177 23 0.00119025
-d 178 23 0.000767068
-d 179 23 0.000308852
-d 180 23 -3.79272e-05
-d 181 23 -0.00019691
-d 182 23 -0.000186642
-d 183 23 -9.73653e-05
-d 184 23 -8.49784e-06
-d 185 23 2.04147e-05
-d 186 23 -9.91086e-06
-d 187 23 -1.55959e-05
-d 188 23 -1.80499e-05
-d 189 23 -1.77097e-05
-d 190 23 -1.51548e-05
-d 191 23 -1.1978e-05
-d 192 23 -9.84916e-06
-d 193 23 -1.29728e-05
-d 194 23 -1.67235e-05
-d 195 23 -1.74153e-05
-d 196 23 -1.39958e-05
-d 197 23 -5.92272e-06
-d 198 23 -8.08216e-06
-d 199 23 -1.53077e-05
-d 200 23 -2.92531e-05
-d 201 23 -3.91049e-05
-d 202 23 -2.98935e-05
-d 203 23 -7.32122e-06
-d 204 23 3.18534e-05
-d 205 23 4.39134e-05
-d 206 23 4.18753e-05
-d 207 23 3.22759e-05
-d 208 23 1.86766e-05
-d 209 23 1.58432e-05
-d 210 23 1.30098e-05
-d 211 23 1.01765e-05
-d 212 23 7.34312e-06
-d 213 23 4.50975e-06
-d 214 23 1.67639e-06
-d 215 23 -1.15697e-06
-d 216 23 -1.23877e-06
-d 217 23 -1.11991e-06
-d 218 23 -1.00106e-06
-d 219 23 -8.82208e-07
-d 220 23 -7.63355e-07
-d 221 23 -6.44502e-07
-d 222 23 -5.2565e-07
-d 223 23 -4.29318e-07
-d 224 23 -3.44661e-07
-d 225 23 -2.60004e-07
-d 226 23 -1.75347e-07
-d 227 23 -9.06904e-08
-d 228 23 -6.03349e-09
-d 229 23 7.86234e-08
-d 230 23 1.6328e-07
-d 231 23 2.47937e-07
-d 232 23 3.32594e-07
-d 233 23 4.17251e-07
-d 234 23 5.01908e-07
-d 235 23 5.86565e-07
-d 236 23 6.71222e-07
-d 237 23 7.36123e-07
-d 238 23 6.43886e-07
-d 239 23 5.5165e-07
-d 240 23 4.59414e-07
-d 241 23 3.67178e-07
-d 242 23 0.000334759
-d 243 23 -4.60833e-05
-d 244 23 -0.00106139
-d 245 23 -0.00166624
-d 246 23 0.000859563
-d 247 23 0.00102606
-d 248 23 0.00410037
-d 249 23 0.00419931
-d 250 23 0.00518997
-d 251 23 0.00459791
-d 252 23 0.00503125
-d 253 23 0.00523877
-d 254 23 0.00452158
-d 255 23 0.00339924
-d 256 23 0.00233399
-d 257 23 0.000876915
-d 258 23 0.000546439
-d 259 23 0.000444299
-d 260 23 0.000983968
-d 261 23 0.00119304
-d 262 23 -0.0429422
-d 263 23 -0.0403983
-d 264 23 0.0534896
-d 265 23 0.288013
-d 266 23 0.807345
-d 267 23 1.44247
-d 268 23 2.03448
-d 269 23 2.57021
-d 270 23 3.05049
-d 271 23 3.47332
-d 272 23 3.8131
-d 273 23 4.1009
-d 274 23 4.34677
-d 275 23 4.53512
-d 276 23 4.67127
-d 277 23 4.76531
-d 278 23 4.82526
-d 279 23 4.86593
-d 280 23 4.89586
-d 281 23 4.91904
-d 282 23 4.93806
-d 283 23 4.95348
-d 284 23 4.96597
-d 285 23 4.97629
-d 286 23 4.9843
-d 287 23 4.98983
-d 288 23 4.99335
-d 289 23 4.9957
-d 290 23 4.99741
-d 291 23 4.99864
-d 292 23 4.99946
-d 293 23 4.99994
-d 294 23 5.00047
-d 295 23 5.00073
-d 296 23 5.00086
-d 297 23 5.00092
-d 298 23 5.00094
-d 299 23 5.00091
-d 300 23 5.00087
-d 301 23 5.00081
-d 302 23 5.00074
-d 303 23 5.00067
-d 304 23 5.00059
-d 305 23 5.00052
-d 306 23 5.00046
-d 307 23 5.0004
-d 308 23 5.00034
-d 309 23 5.0003
-d 310 23 5.00026
-d 311 23 5.00022
-d 312 23 5.00019
-d 313 23 5.00016
-d 314 23 5.00014
-d 315 23 5.00012
-d 316 23 5.0001
-d 317 23 5.00009
-d 318 23 5.00007
-d 319 23 5.00006
-d 320 23 5.00006
-d 321 23 5.00005
-d 322 23 5.00004
-d 323 23 5.00004
-d 324 23 5.00004
-d 325 23 5.00003
-d 326 23 5.00003
-d 327 23 5.00003
-d 328 23 5.00002
-d 329 23 5.00002
-d 330 23 5.00002
-d 331 23 5.00002
-d 332 23 5.00001
-d 333 23 5.00001
-d 334 23 5.00001
-d 335 23 5.00001
-d 336 23 5.00001
-d 337 23 5.0
-d 338 23 5.0
-d 339 23 5.0
-d 340 23 5.0
-d 341 23 4.99999
-d 342 23 4.99999
-d 343 23 4.99999
-d 344 23 4.99999
-d 345 23 4.99999
-d 346 23 4.99999
-d 347 23 5.0
-d 348 23 5.0
-d 349 23 5.0
-d 350 23 5.0
-d 351 23 5.0
-d 352 23 5.0
-d 353 23 5.0
-d 354 23 5.0
-d 355 23 5.0
-d 356 23 5.00001
-d 357 23 5.00001
-d 358 23 5.00001
-d 359 23 5.00001
-d 360 23 5.00002
-d 361 23 5.00002
-d 1 24 5.0
-d 2 24 5.00284
-d 3 24 5.01266
-d 4 24 5.01895
-d 5 24 4.98936
-d 6 24 4.99575
-d 7 24 4.99217
-d 8 24 4.99545
-d 9 24 4.99775
-d 10 24 4.99894
-d 11 24 4.99946
-d 12 24 4.99968
-d 13 24 4.99975
-d 14 24 4.99977
-d 15 24 4.99986
-d 16 24 4.9999
-d 17 24 4.99528
-d 18 24 4.99808
-d 19 24 5.00039
-d 20 24 5.00392
-d 21 24 5.00512
-d 22 24 4.99985
-d 23 24 4.99863
-d 24 24 4.99942
-d 25 24 4.99992
-d 26 24 5.00017
-d 27 24 4.99897
-d 28 24 4.99803
-d 29 24 4.99784
-d 30 24 4.99739
-d 31 24 4.99883
-d 32 24 5.00365
-d 33 24 5.00298
-d 34 24 5.00133
-d 35 24 5.00048
-d 36 24 5.00019
-d 37 24 5.00008
-d 38 24 5.00005
-d 39 24 5.00004
-d 40 24 5.00003
-d 41 24 5.00002
-d 42 24 5.00002
-d 43 24 5.00001
-d 44 24 5.00001
-d 45 24 5.00001
-d 46 24 5.00001
-d 47 24 5.00001
-d 48 24 5.0
-d 49 24 5.0
-d 50 24 4.99999
-d 51 24 4.99997
-d 52 24 4.99995
-d 53 24 4.99996
-d 54 24 4.99998
-d 55 24 5.0
-d 56 24 5.00001
-d 57 24 5.00001
-d 58 24 5.00002
-d 59 24 5.00002
-d 60 24 5.00003
-d 61 24 5.00003
-d 62 24 5.00002
-d 63 24 5.00002
-d 64 24 5.00001
-d 65 24 5.00001
-d 66 24 5.0
-d 67 24 5.0
-d 68 24 5.0
-d 69 24 5.0
-d 70 24 5.0
-d 71 24 4.99999
-d 72 24 4.99999
-d 73 24 4.99999
-d 74 24 4.99999
-d 75 24 4.99999
-d 76 24 4.99999
-d 77 24 4.99998
-d 78 24 4.99999
-d 79 24 4.99999
-d 80 24 4.99999
-d 81 24 4.99999
-d 82 24 4.99999
-d 83 24 4.99999
-d 84 24 4.99999
-d 85 24 5.0
-d 86 24 5.0
-d 87 24 5.0
-d 88 24 5.0
-d 89 24 5.0
-d 90 24 5.0
-d 91 24 5.0
-d 92 24 5.00001
-d 93 24 5.00001
-d 94 24 5.00001
-d 95 24 5.00001
-d 96 24 5.00001
-d 97 24 5.00001
-d 98 24 5.00001
-d 99 24 5.00002
-d 100 24 5.00002
-d 101 24 5.00001
-d 102 24 5.00001
-d 103 24 5.00001
-d 104 24 5.00001
-d 105 24 5.00001
-d 106 24 5.00001
-d 107 24 5.00001
-d 108 24 5.00001
-d 109 24 5.00001
-d 110 24 5.00001
-d 111 24 5.00001
-d 112 24 5.00001
-d 113 24 5.00001
-d 114 24 5.00001
-d 115 24 5.0
-d 116 24 5.0
-d 117 24 5.0
-d 118 24 5.0
-d 119 24 5.0
-d 120 24 5.0
-d 121 24 5.0
-d 122 24 5.00217
-d 123 24 5.00108
-d 124 24 4.99547
-d 125 24 4.99658
-d 126 24 5.00667
-d 127 24 4.99641
-d 128 24 4.99532
-d 129 24 4.99938
-d 130 24 5.00328
-d 131 24 5.00222
-d 132 24 5.00114
-d 133 24 5.00052
-d 134 24 5.00024
-d 135 24 5.00011
-d 136 24 5.00009
-d 137 24 4.99285
-d 138 24 4.99591
-d 139 24 4.99897
-d 140 24 5.00403
-d 141 24 5.00786
-d 142 24 5.00318
-d 143 24 4.99942
-d 144 24 4.9992
-d 145 24 4.99949
-d 146 24 5.001
-d 147 24 5.00408
-d 148 24 5.00319
-d 149 24 5.00063
-d 150 24 4.99995
-d 151 24 5.00014
-d 152 24 4.99982
-d 153 24 4.99832
-d 154 24 4.99838
-d 155 24 4.99865
-d 156 24 4.99912
-d 157 24 4.99836
-d 158 24 4.99735
-d 159 24 4.99606
-d 160 24 4.99814
-d 161 24 5.00958
-d 162 24 5.02973
-d 163 24 5.05293
-d 164 24 5.06103
-d 165 24 4.99342
-d 166 24 4.80726
-d 167 24 4.50744
-d 168 24 4.07509
-d 169 24 3.41358
-d 170 24 2.37924
-d 171 24 1.03194
-d 172 24 0.261552
-d 173 24 0.142392
-d 174 24 0.0904482
-d 175 24 0.0555071
-d 176 24 0.0322869
-d 177 24 0.018289
-d 178 24 0.0113802
-d 179 24 0.00875182
-d 180 24 0.00757055
-d 181 24 0.00629906
-d 182 24 0.00523
-d 183 24 0.00403349
-d 184 24 0.0031953
-d 185 24 0.00280864
-d 186 24 0.00286119
-d 187 24 0.00250389
-d 188 24 0.00202815
-d 189 24 0.001723
-d 190 24 0.00147312
-d 191 24 0.0012411
-d 192 24 0.00104401
-d 193 24 0.000886204
-d 194 24 0.000758277
-d 195 24 0.000651915
-d 196 24 0.00056348
-d 197 24 0.000487966
-d 198 24 0.000424048
-d 199 24 0.000365613
-d 200 24 0.000308178
-d 201 24 0.000258725
-d 202 24 0.000228061
-d 203 24 0.000207976
-d 204 24 0.000198491
-d 205 24 0.00018518
-d 206 24 0.000172716
-d 207 24 0.000163197
-d 208 24 0.000155007
-d 209 24 0.000141734
-d 210 24 0.000128461
-d 211 24 0.000115188
-d 212 24 0.000101915
-d 213 24 8.86417e-05
-d 214 24 7.53686e-05
-d 215 24 6.20956e-05
-d 216 24 5.69164e-05
-d 217 24 5.23275e-05
-d 218 24 4.77385e-05
-d 219 24 4.31495e-05
-d 220 24 3.85605e-05
-d 221 24 3.39716e-05
-d 222 24 2.93826e-05
-d 223 24 2.69449e-05
-d 224 24 2.56224e-05
-d 225 24 2.42999e-05
-d 226 24 2.29774e-05
-d 227 24 2.16549e-05
-d 228 24 2.03324e-05
-d 229 24 1.90099e-05
-d 230 24 1.76873e-05
-d 231 24 1.63648e-05
-d 232 24 1.50423e-05
-d 233 24 1.37198e-05
-d 234 24 1.23973e-05
-d 235 24 1.10748e-05
-d 236 24 9.75232e-06
-d 237 24 8.48447e-06
-d 238 24 7.65129e-06
-d 239 24 6.81811e-06
-d 240 24 5.98494e-06
-d 241 24 5.15176e-06
-d 242 24 0.00056893
-d 243 24 -0.00787906
-d 244 24 -0.0217381
-d 245 24 -0.0370066
-d 246 24 -0.00770505
-d 247 24 0.00659312
-d 248 24 0.00975477
-d 249 24 0.00949456
-d 250 24 0.00777552
-d 251 24 0.00655645
-d 252 24 0.00568776
-d 253 24 0.00508782
-d 254 24 0.00458121
-d 255 24 0.00410187
-d 256 24 0.00365665
-d 257 24 0.0015121
-d 258 24 0.00160863
-d 259 24 0.00263181
-d 260 24 0.00638941
-d 261 24 0.00772607
-d 262 24 0.00225583
-d 263 24 0.0010843
-d 264 24 0.000882939
-d 265 24 0.000801563
-d 266 24 0.00075632
-d 267 24 0.000554992
-d 268 24 0.000435131
-d 269 24 0.0003474
-d 270 24 0.000217667
-d 271 24 0.000491602
-d 272 24 0.0012267
-d 273 24 0.00250446
-d 274 24 0.000212058
-d 275 24 -0.0174972
-d 276 24 -0.0527527
-d 277 24 -0.0479071
-d 278 24 0.194908
-d 279 24 1.45838
-d 280 24 3.40677
-d 281 24 4.49242
-d 282 24 4.86894
-d 283 24 4.97215
-d 284 24 5.01218
-d 285 24 5.04342
-d 286 24 5.06228
-d 287 24 5.03069
-d 288 24 4.87169
-d 289 24 4.57056
-d 290 24 4.11523
-d 291 24 3.38264
-d 292 24 2.19691
-d 293 24 0.715839
-d 294 24 0.172818
-d 295 24 0.102162
-d 296 24 0.0627162
-d 297 24 0.0363388
-d 298 24 0.020289
-d 299 24 0.0119414
-d 300 24 0.00826608
-d 301 24 0.0066417
-d 302 24 0.00549092
-d 303 24 0.00492505
-d 304 24 0.00439443
-d 305 24 0.0037156
-d 306 24 0.00306471
-d 307 24 0.00247451
-d 308 24 0.00195965
-d 309 24 0.0014822
-d 310 24 0.0010815
-d 311 24 0.000904464
-d 312 24 0.0010514
-d 313 24 0.00152308
-d 314 24 0.00120752
-d 315 24 0.000228447
-d 316 24 -0.00102833
-d 317 24 -0.00116644
-d 318 24 -0.00042067
-d 319 24 4.78758e-05
-d 320 24 5.09599e-05
-d 321 24 -4.45756e-05
-d 322 24 -3.22966e-06
-d 323 24 3.81163e-05
-d 324 24 7.94622e-05
-d 325 24 0.000120808
-d 326 24 0.000162154
-d 327 24 0.000161895
-d 328 24 0.000148481
-d 329 24 0.000135068
-d 330 24 0.000121654
-d 331 24 0.000108241
-d 332 24 9.81453e-05
-d 333 24 9.2164e-05
-d 334 24 8.61827e-05
-d 335 24 8.02014e-05
-d 336 24 7.42201e-05
-d 337 24 6.82388e-05
-d 338 24 6.22576e-05
-d 339 24 5.62763e-05
-d 340 24 5.0295e-05
-d 341 24 4.43137e-05
-d 342 24 3.83324e-05
-d 343 24 3.54323e-05
-d 344 24 3.321e-05
-d 345 24 3.09877e-05
-d 346 24 2.87654e-05
-d 347 24 2.65431e-05
-d 348 24 2.43209e-05
-d 349 24 2.20986e-05
-d 350 24 1.98763e-05
-d 351 24 1.7654e-05
-d 352 24 1.54317e-05
-d 353 24 1.34612e-05
-d 354 24 1.25441e-05
-d 355 24 1.1627e-05
-d 356 24 1.07099e-05
-d 357 24 9.79276e-06
-d 358 24 8.87564e-06
-d 359 24 7.95851e-06
-d 360 24 7.04139e-06
-d 361 24 6.12427e-06
-d 1 25 5.0
-d 2 25 5.01099
-d 3 25 5.00866
-d 4 25 4.97845
-d 5 25 4.92369
-d 6 25 4.9273
-d 7 25 4.97413
-d 8 25 4.9929
-d 9 25 4.99826
-d 10 25 4.99958
-d 11 25 4.99978
-d 12 25 5.00005
-d 13 25 4.99968
-d 14 25 4.99959
-d 15 25 5.00014
-d 16 25 4.99979
-d 17 25 4.99914
-d 18 25 4.99982
-d 19 25 5.00023
-d 20 25 5.00295
-d 21 25 5.00664
-d 22 25 4.99854
-d 23 25 4.99647
-d 24 25 5.00438
-d 25 25 5.01722
-d 26 25 5.03681
-d 27 25 5.04766
-d 28 25 5.04799
-d 29 25 5.04867
-d 30 25 5.04873
-d 31 25 5.04685
-d 32 25 5.04413
-d 33 25 5.0367
-d 34 25 5.02505
-d 35 25 5.01726
-d 36 25 5.01183
-d 37 25 5.00806
-d 38 25 5.00549
-d 39 25 5.00371
-d 40 25 5.00246
-d 41 25 5.00162
-d 42 25 5.00105
-d 43 25 5.00069
-d 44 25 5.00045
-d 45 25 5.00031
-d 46 25 5.00024
-d 47 25 5.00019
-d 48 25 5.00012
-d 49 25 5.00007
-d 50 25 5.00004
-d 51 25 5.00001
-d 52 25 4.99998
-d 53 25 4.99999
-d 54 25 4.99999
-d 55 25 5.0
-d 56 25 5.00001
-d 57 25 5.00001
-d 58 25 5.00002
-d 59 25 5.00002
-d 60 25 5.00003
-d 61 25 5.00003
-d 62 25 5.00003
-d 63 25 5.00002
-d 64 25 5.00002
-d 65 25 5.00001
-d 66 25 5.00001
-d 67 25 5.00001
-d 68 25 5.0
-d 69 25 5.0
-d 70 25 5.0
-d 71 25 5.0
-d 72 25 5.0
-d 73 25 4.99999
-d 74 25 4.99999
-d 75 25 4.99999
-d 76 25 4.99999
-d 77 25 4.99999
-d 78 25 4.99999
-d 79 25 4.99999
-d 80 25 4.99999
-d 81 25 4.99999
-d 82 25 4.99999
-d 83 25 4.99999
-d 84 25 4.99999
-d 85 25 5.0
-d 86 25 5.0
-d 87 25 5.0
-d 88 25 5.0
-d 89 25 5.0
-d 90 25 5.0
-d 91 25 5.0
-d 92 25 5.00001
-d 93 25 5.00001
-d 94 25 5.00001
-d 95 25 5.00001
-d 96 25 5.00001
-d 97 25 5.00001
-d 98 25 5.00001
-d 99 25 5.00002
-d 100 25 5.00001
-d 101 25 5.00001
-d 102 25 5.00001
-d 103 25 5.00001
-d 104 25 5.00001
-d 105 25 5.00001
-d 106 25 5.00001
-d 107 25 5.00001
-d 108 25 5.00001
-d 109 25 5.00001
-d 110 25 5.00001
-d 111 25 5.00001
-d 112 25 5.00001
-d 113 25 5.00001
-d 114 25 5.00001
-d 115 25 5.0
-d 116 25 5.0
-d 117 25 5.0
-d 118 25 5.0
-d 119 25 5.0
-d 120 25 5.0
-d 121 25 5.0
-d 122 25 5.00418
-d 123 25 4.99953
-d 124 25 4.99152
-d 125 25 4.99807
-d 126 25 5.00497
-d 127 25 5.00112
-d 128 25 5.00055
-d 129 25 5.00038
-d 130 25 5.00018
-d 131 25 5.00006
-d 132 25 5.00006
-d 133 25 5.00007
-d 134 25 5.00006
-d 135 25 5.00004
-d 136 25 5.00004
-d 137 25 4.99853
-d 138 25 4.99945
-d 139 25 4.99998
-d 140 25 5.00304
-d 141 25 5.00935
-d 142 25 5.00742
-d 143 25 4.99181
-d 144 25 4.97421
-d 145 25 4.93603
-d 146 25 4.8853
-d 147 25 4.8927
-d 148 25 4.93984
-d 149 25 4.97458
-d 150 25 4.99039
-d 151 25 4.99614
-d 152 25 4.99801
-d 153 25 4.99851
-d 154 25 4.99869
-d 155 25 4.99924
-d 156 25 5.00108
-d 157 25 5.00181
-d 158 25 5.00119
-d 159 25 5.00059
-d 160 25 5.00031
-d 161 25 5.00022
-d 162 25 5.00018
-d 163 25 5.00011
-d 164 25 5.00001
-d 165 25 5.00006
-d 166 25 4.99981
-d 167 25 4.99977
-d 168 25 4.99982
-d 169 25 5.00012
-d 170 25 4.99993
-d 171 25 5.00008
-d 172 25 5.00043
-d 173 25 5.00048
-d 174 25 5.00024
-d 175 25 5.00008
-d 176 25 4.99984
-d 177 25 4.99993
-d 178 25 5.00011
-d 179 25 4.99996
-d 180 25 4.9998
-d 181 25 4.99977
-d 182 25 4.9998
-d 183 25 4.99993
-d 184 25 5.00008
-d 185 25 5.00011
-d 186 25 5.00002
-d 187 25 4.99995
-d 188 25 4.99989
-d 189 25 4.99993
-d 190 25 5.0
-d 191 25 5.00007
-d 192 25 5.00009
-d 193 25 4.99994
-d 194 25 4.99977
-d 195 25 4.9997
-d 196 25 4.99975
-d 197 25 4.99996
-d 198 25 4.99996
-d 199 25 4.99988
-d 200 25 4.9997
-d 201 25 4.99952
-d 202 25 4.9995
-d 203 25 4.99956
-d 204 25 4.99973
-d 205 25 4.99988
-d 206 25 5.00005
-d 207 25 5.00025
-d 208 25 5.00042
-d 209 25 5.00036
-d 210 25 5.00031
-d 211 25 5.00025
-d 212 25 5.0002
-d 213 25 5.00014
-d 214 25 5.00009
-d 215 25 5.00003
-d 216 25 5.00002
-d 217 25 5.00001
-d 218 25 5.00001
-d 219 25 5.0
-d 220 25 4.99999
-d 221 25 4.99998
-d 222 25 4.99998
-d 223 25 4.99997
-d 224 25 4.99998
-d 225 25 4.99998
-d 226 25 4.99998
-d 227 25 4.99998
-d 228 25 4.99998
-d 229 25 4.99998
-d 230 25 4.99998
-d 231 25 4.99999
-d 232 25 4.99999
-d 233 25 4.99999
-d 234 25 4.99999
-d 235 25 4.99999
-d 236 25 4.99999
-d 237 25 4.99999
-d 238 25 4.99999
-d 239 25 4.99999
-d 240 25 4.99999
-d 241 25 4.99999
-d 242 25 5.00284
-d 243 25 5.00442
-d 244 25 5.00381
-d 245 25 4.98997
-d 246 25 4.99092
-d 247 25 5.00733
-d 248 25 5.07791
-d 249 25 4.98237
-d 250 25 4.86434
-d 251 25 4.76835
-d 252 25 4.74067
-d 253 25 4.79278
-d 254 25 4.85094
-d 255 25 4.90068
-d 256 25 4.93603
-d 257 25 4.95698
-d 258 25 4.96984
-d 259 25 4.97856
-d 260 25 4.98869
-d 261 25 4.99904
-d 262 25 5.0005
-d 263 25 4.99524
-d 264 25 5.00181
-d 265 25 5.01878
-d 266 25 5.05177
-d 267 25 5.07986
-d 268 25 4.98917
-d 269 25 4.56217
-d 270 25 3.68
-d 271 25 2.3539
-d 272 25 1.18541
-d 273 25 0.505772
-d 274 25 0.221044
-d 275 25 0.115287
-d 276 25 0.0760938
-d 277 25 0.0589194
-d 278 25 0.0476784
-d 279 25 0.0457213
-d 280 25 0.0412911
-d 281 25 0.033889
-d 282 25 0.0259741
-d 283 25 0.0191452
-d 284 25 0.0139018
-d 285 25 0.0100235
-d 286 25 0.00711788
-d 287 25 0.00497657
-d 288 25 0.00349368
-d 289 25 0.00250021
-d 290 25 0.00176179
-d 291 25 0.00121843
-d 292 25 0.000838368
-d 293 25 0.000582711
-d 294 25 0.000423458
-d 295 25 0.000294608
-d 296 25 0.000201251
-d 297 25 0.000133748
-d 298 25 8.6227e-05
-d 299 25 5.44252e-05
-d 300 25 3.30514e-05
-d 301 25 1.93926e-05
-d 302 25 1.09814e-05
-d 303 25 5.29857e-06
-d 304 25 1.92247e-06
-d 305 25 3.08708e-07
-d 306 25 -3.74311e-07
-d 307 25 -6.11121e-07
-d 308 25 -7.27807e-07
-d 309 25 -4.87604e-07
-d 310 25 -4.80493e-07
-d 311 25 -9.15925e-07
-d 312 25 -2.03774e-06
-d 313 25 -4.01128e-06
-d 314 25 -2.46644e-06
-d 315 25 2.10626e-06
-d 316 25 8.22422e-06
-d 317 25 1.04922e-05
-d 318 25 9.83047e-06
-d 319 25 7.27106e-06
-d 320 25 3.29654e-06
-d 321 25 -2.06736e-06
-d 322 25 -2.18019e-06
-d 323 25 -2.29303e-06
-d 324 25 -2.40586e-06
-d 325 25 -2.51869e-06
-d 326 25 -2.63153e-06
-d 327 25 -2.24615e-06
-d 328 25 -1.70325e-06
-d 329 25 -1.16036e-06
-d 330 25 -6.17468e-07
-d 331 25 -7.45754e-08
-d 332 25 2.45198e-07
-d 333 25 2.88285e-07
-d 334 25 3.31373e-07
-d 335 25 3.7446e-07
-d 336 25 4.17548e-07
-d 337 25 4.60635e-07
-d 338 25 5.03723e-07
-d 339 25 5.4681e-07
-d 340 25 5.89898e-07
-d 341 25 6.32985e-07
-d 342 25 6.76073e-07
-d 343 25 6.19054e-07
-d 344 25 5.4001e-07
-d 345 25 4.60967e-07
-d 346 25 3.81923e-07
-d 347 25 3.02879e-07
-d 348 25 2.23836e-07
-d 349 25 1.44792e-07
-d 350 25 6.57488e-08
-d 351 25 -1.32948e-08
-d 352 25 -9.23383e-08
-d 353 25 -1.6698e-07
-d 354 25 -2.23206e-07
-d 355 25 -2.79432e-07
-d 356 25 -3.35658e-07
-d 357 25 -3.91884e-07
-d 358 25 -4.48109e-07
-d 359 25 -5.04335e-07
-d 360 25 -5.60561e-07
-d 361 25 -6.16787e-07
-d 1 26 1.34824
-d 2 26 1.35838
-d 3 26 1.36465
-d 4 26 1.34675
-d 5 26 1.29167
-d 6 26 1.23161
-d 7 26 1.2201
-d 8 26 1.2185
-d 9 26 1.2181
-d 10 26 1.21798
-d 11 26 1.21793
-d 12 26 1.21788
-d 13 26 1.21785
-d 14 26 1.21782
-d 15 26 1.21779
-d 16 26 1.21776
-d 17 26 1.21655
-d 18 26 1.21656
-d 19 26 1.21669
-d 20 26 1.21871
-d 21 26 1.22421
-d 22 26 1.22247
-d 23 26 1.21858
-d 24 26 1.2228
-d 25 26 1.23803
-d 26 26 1.27737
-d 27 26 1.10647
-d 28 26 0.395248
-d 29 26 0.0600669
-d 30 26 0.027687
-d 31 26 0.0192374
-d 32 26 0.015425
-d 33 26 0.0130881
-d 34 26 0.00977445
-d 35 26 0.00696598
-d 36 26 0.00491122
-d 37 26 0.00341952
-d 38 26 0.00237078
-d 39 26 0.00162339
-d 40 26 0.00109178
-d 41 26 0.000726647
-d 42 26 0.000478886
-d 43 26 0.00031568
-d 44 26 0.000207902
-d 45 26 0.000143494
-d 46 26 0.000109768
-d 47 26 8.62987e-05
-d 48 26 5.69775e-05
-d 49 26 3.36547e-05
-d 50 26 2.30356e-05
-d 51 26 1.86108e-05
-d 52 26 1.41861e-05
-d 53 26 1.08293e-05
-d 54 26 7.68835e-06
-d 55 26 4.79593e-06
-d 56 26 4.51019e-06
-d 57 26 4.22444e-06
-d 58 26 3.9387e-06
-d 59 26 3.65295e-06
-d 60 26 3.36721e-06
-d 61 26 3.04559e-06
-d 62 26 2.69981e-06
-d 63 26 2.35403e-06
-d 64 26 2.00825e-06
-d 65 26 1.66247e-06
-d 66 26 1.34508e-06
-d 67 26 1.26225e-06
-d 68 26 1.17941e-06
-d 69 26 1.09657e-06
-d 70 26 1.01373e-06
-d 71 26 9.30893e-07
-d 72 26 8.48054e-07
-d 73 26 7.65216e-07
-d 74 26 6.82378e-07
-d 75 26 5.9954e-07
-d 76 26 5.16702e-07
-d 77 26 4.37489e-07
-d 78 26 3.82774e-07
-d 79 26 3.2806e-07
-d 80 26 2.73346e-07
-d 81 26 2.18632e-07
-d 82 26 1.63917e-07
-d 83 26 1.09203e-07
-d 84 26 5.4489e-08
-d 85 26 -2.2523e-10
-d 86 26 -5.49395e-08
-d 87 26 -1.09654e-07
-d 88 26 -1.52862e-07
-d 89 26 -1.3079e-07
-d 90 26 -1.08718e-07
-d 91 26 -8.6646e-08
-d 92 26 -6.45739e-08
-d 93 26 -4.25019e-08
-d 94 26 -2.04298e-08
-d 95 26 1.64229e-09
-d 96 26 2.37144e-08
-d 97 26 4.57864e-08
-d 98 26 6.78585e-08
-d 99 26 8.71693e-08
-d 100 26 9.30725e-08
-d 101 26 9.89758e-08
-d 102 26 1.04879e-07
-d 103 26 1.10782e-07
-d 104 26 1.16685e-07
-d 105 26 1.22589e-07
-d 106 26 1.28492e-07
-d 107 26 1.34395e-07
-d 108 26 1.40298e-07
-d 109 26 1.46201e-07
-d 110 26 1.52105e-07
-d 111 26 1.58008e-07
-d 112 26 1.63911e-07
-d 113 26 1.69814e-07
-d 114 26 1.75718e-07
-d 115 26 1.81621e-07
-d 116 26 1.87524e-07
-d 117 26 1.93427e-07
-d 118 26 1.9933e-07
-d 119 26 2.05234e-07
-d 120 26 2.11137e-07
-d 121 26 2.19788e-07
-d 122 26 0.000393944
-d 123 26 -0.000218983
-d 124 26 -0.00105784
-d 125 26 0.00172403
-d 126 26 -0.00027134
-d 127 26 -0.000204147
-d 128 26 8.79968e-06
-d 129 26 5.93762e-05
-d 130 26 5.83554e-05
-d 131 26 4.13815e-05
-d 132 26 3.71369e-05
-d 133 26 3.03372e-05
-d 134 26 2.25336e-05
-d 135 26 1.5986e-05
-d 136 26 1.07284e-05
-d 137 26 -7.5239e-05
-d 138 26 5.60593e-05
-d 139 26 6.97571e-05
-d 140 26 0.000667617
-d 141 26 0.000960856
-d 142 26 0.00131749
-d 143 26 -0.00759564
-d 144 26 -0.0217897
-d 145 26 -0.0450321
-d 146 26 -0.076646
-d 147 26 -0.128569
-d 148 26 -0.186391
-d 149 26 -0.202175
-d 150 26 -0.206953
-d 151 26 -0.2082
-d 152 26 -0.208416
-d 153 26 -0.208669
-d 154 26 -0.208934
-d 155 26 -0.209111
-d 156 26 -0.209234
-d 157 26 -0.209329
-d 158 26 -0.209389
-d 159 26 -0.209416
-d 160 26 -0.2094
-d 161 26 -0.209329
-d 162 26 -0.20926
-d 163 26 -0.209204
-d 164 26 -0.209208
-d 165 26 -0.209285
-d 166 26 -0.209454
-d 167 26 -0.209641
-d 168 26 -0.20977
-d 169 26 -0.209811
-d 170 26 -0.209833
-d 171 26 -0.209887
-d 172 26 -0.209653
-d 173 26 -0.209127
-d 174 26 -0.208893
-d 175 26 -0.208811
-d 176 26 -0.208777
-d 177 26 -0.208758
-d 178 26 -0.208747
-d 179 26 -0.20874
-d 180 26 -0.208726
-d 181 26 -0.208697
-d 182 26 -0.208657
-d 183 26 -0.208611
-d 184 26 -0.208565
-d 185 26 -0.208524
-d 186 26 -0.208488
-d 187 26 -0.208451
-d 188 26 -0.208412
-d 189 26 -0.208373
-d 190 26 -0.208333
-d 191 26 -0.208294
-d 192 26 -0.208256
-d 193 26 -0.208219
-d 194 26 -0.208183
-d 195 26 -0.208145
-d 196 26 -0.208107
-d 197 26 -0.208066
-d 198 26 -0.208029
-d 199 26 -0.207993
-d 200 26 -0.207959
-d 201 26 -0.207923
-d 202 26 -0.207883
-d 203 26 -0.207838
-d 204 26 -0.207789
-d 205 26 -0.207747
-d 206 26 -0.20771
-d 207 26 -0.207675
-d 208 26 -0.207642
-d 209 26 -0.207605
-d 210 26 -0.207568
-d 211 26 -0.207531
-d 212 26 -0.207494
-d 213 26 -0.207457
-d 214 26 -0.20742
-d 215 26 -0.207383
-d 216 26 -0.207346
-d 217 26 -0.207308
-d 218 26 -0.207271
-d 219 26 -0.207233
-d 220 26 -0.207196
-d 221 26 -0.207158
-d 222 26 -0.207121
-d 223 26 -0.207084
-d 224 26 -0.207046
-d 225 26 -0.207009
-d 226 26 -0.206972
-d 227 26 -0.206935
-d 228 26 -0.206898
-d 229 26 -0.206861
-d 230 26 -0.206823
-d 231 26 -0.206786
-d 232 26 -0.206749
-d 233 26 -0.206712
-d 234 26 -0.206675
-d 235 26 -0.206638
-d 236 26 -0.2066
-d 237 26 -0.206563
-d 238 26 -0.206526
-d 239 26 -0.206489
-d 240 26 -0.206452
-d 241 26 -0.206415
-d 242 26 -0.203384
-d 243 26 -0.20015
-d 244 26 -0.196872
-d 245 26 -0.205024
-d 246 26 -0.210727
-d 247 26 -0.206779
-d 248 26 -0.0685263
-d 249 26 0.586138
-d 250 26 1.4665
-d 251 26 2.22945
-d 252 26 2.77554
-d 253 26 3.076
-d 254 26 3.24926
-d 255 26 3.34515
-d 256 26 3.40164
-d 257 26 3.43006
-d 258 26 3.43713
-d 259 26 3.43075
-d 260 26 3.42886
-d 261 26 3.4384
-d 262 26 3.46567
-d 263 26 3.49025
-d 264 26 3.51287
-d 265 26 3.53821
-d 266 26 3.57841
-d 267 26 3.39846
-d 268 26 2.80753
-d 269 26 2.22947
-d 270 26 1.7549
-d 271 26 1.30429
-d 272 26 0.707786
-d 273 26 0.303206
-d 274 26 0.131352
-d 275 26 0.0671706
-d 276 26 0.0429955
-d 277 26 0.032461
-d 278 26 0.0257161
-d 279 26 0.0239521
-d 280 26 0.0217397
-d 281 26 0.0179705
-d 282 26 0.0138745
-d 283 26 0.0102813
-d 284 26 0.00749643
-d 285 26 0.0054328
-d 286 26 0.00386817
-d 287 26 0.0027004
-d 288 26 0.00189442
-d 289 26 0.00135552
-d 290 26 0.000954715
-d 291 26 0.000659981
-d 292 26 0.000453435
-d 293 26 0.000313993
-d 294 26 0.000231347
-d 295 26 0.000159665
-d 296 26 0.000108122
-d 297 26 7.10528e-05
-d 298 26 4.50233e-05
-d 299 26 2.77892e-05
-d 300 26 1.62765e-05
-d 301 26 8.9893e-06
-d 302 26 4.5471e-06
-d 303 26 1.54614e-06
-d 304 26 -1.6542e-07
-d 305 26 -8.68508e-07
-d 306 26 -1.04369e-06
-d 307 26 -9.63086e-07
-d 308 26 -8.44294e-07
-d 309 26 -6.57339e-07
-d 310 26 -7.35885e-07
-d 311 26 -9.80056e-07
-d 312 26 -1.39772e-06
-d 313 26 -2.10199e-06
-d 314 26 -1.37474e-06
-d 315 26 6.13269e-07
-d 316 26 3.3028e-06
-d 317 26 4.60941e-06
-d 318 26 4.91053e-06
-d 319 26 4.14186e-06
-d 320 26 2.45258e-06
-d 321 26 -8.7388e-09
-d 322 26 -3.59647e-07
-d 323 26 -7.10554e-07
-d 324 26 -1.06146e-06
-d 325 26 -1.41237e-06
-d 326 26 -1.76328e-06
-d 327 26 -1.63073e-06
-d 328 26 -1.34534e-06
-d 329 26 -1.05995e-06
-d 330 26 -7.74561e-07
-d 331 26 -4.8917e-07
-d 332 26 -2.95733e-07
-d 333 26 -2.16326e-07
-d 334 26 -1.3692e-07
-d 335 26 -5.75135e-08
-d 336 26 2.18929e-08
-d 337 26 1.01299e-07
-d 338 26 1.80706e-07
-d 339 26 2.60112e-07
-d 340 26 3.39519e-07
-d 341 26 4.18925e-07
-d 342 26 4.98332e-07
-d 343 26 4.83984e-07
-d 344 26 4.4901e-07
-d 345 26 4.14035e-07
-d 346 26 3.79061e-07
-d 347 26 3.44087e-07
-d 348 26 3.09112e-07
-d 349 26 2.74138e-07
-d 350 26 2.39163e-07
-d 351 26 2.04189e-07
-d 352 26 1.69215e-07
-d 353 26 1.26002e-07
-d 354 26 4.83213e-08
-d 355 26 -2.9359e-08
-d 356 26 -1.07039e-07
-d 357 26 -1.8472e-07
-d 358 26 -2.624e-07
-d 359 26 -3.4008e-07
-d 360 26 -4.1776e-07
-d 361 26 -4.95441e-07
-d 1 27 7.10441e-10
-d 2 27 0.000309731
-d 3 27 -0.000308186
-d 4 27 -0.001694
-d 5 27 -0.00360784
-d 6 27 8.40909e-05
-d 7 27 0.00203175
-d 8 27 0.0012896
-d 9 27 0.000596548
-d 10 27 0.000277191
-d 11 27 0.000161134
-d 12 27 0.000120439
-d 13 27 8.4915e-05
-d 14 27 9.49929e-05
-d 15 27 6.18812e-05
-d 16 27 1.65433e-05
-d 17 27 1.89682e-05
-d 18 27 3.97578e-05
-d 19 27 4.95446e-05
-d 20 27 0.000225325
-d 21 27 0.000214579
-d 22 27 -0.00230134
-d 23 27 -0.000451102
-d 24 27 0.00997237
-d 25 27 0.0341443
-d 26 27 0.0449314
-d 27 27 0.0424411
-d 28 27 0.0341996
-d 29 27 0.0315315
-d 30 27 0.0308892
-d 31 27 0.0291614
-d 32 27 0.024365
-d 33 27 0.0190282
-d 34 27 0.0188976
-d 35 27 0.017238
-d 36 27 0.0138526
-d 37 27 0.0105645
-d 38 27 0.00778548
-d 39 27 0.00561753
-d 40 27 0.0039871
-d 41 27 0.00279554
-d 42 27 0.00194075
-d 43 27 0.0013468
-d 44 27 0.000934775
-d 45 27 0.000664723
-d 46 27 0.000498911
-d 47 27 0.000377384
-d 48 27 0.000254183
-d 49 27 0.000163421
-d 50 27 0.000120773
-d 51 27 9.65058e-05
-d 52 27 7.22384e-05
-d 53 27 5.60316e-05
-d 54 27 4.14549e-05
-d 55 27 2.79516e-05
-d 56 27 2.57096e-05
-d 57 27 2.34677e-05
-d 58 27 2.12257e-05
-d 59 27 1.89837e-05
-d 60 27 1.67417e-05
-d 61 27 1.46737e-05
-d 62 27 1.27228e-05
-d 63 27 1.07719e-05
-d 64 27 8.82099e-06
-d 65 27 6.87009e-06
-d 66 27 5.0896e-06
-d 67 27 4.71705e-06
-d 68 27 4.34451e-06
-d 69 27 3.97196e-06
-d 70 27 3.59941e-06
-d 71 27 3.22686e-06
-d 72 27 2.85431e-06
-d 73 27 2.48176e-06
-d 74 27 2.10921e-06
-d 75 27 1.73666e-06
-d 76 27 1.36411e-06
-d 77 27 1.02855e-06
-d 78 27 9.42931e-07
-d 79 27 8.57316e-07
-d 80 27 7.71701e-07
-d 81 27 6.86086e-07
-d 82 27 6.00471e-07
-d 83 27 5.14856e-07
-d 84 27 4.29241e-07
-d 85 27 3.43626e-07
-d 86 27 2.58011e-07
-d 87 27 1.72396e-07
-d 88 27 9.85409e-08
-d 89 27 9.14091e-08
-d 90 27 8.42773e-08
-d 91 27 7.71456e-08
-d 92 27 7.00138e-08
-d 93 27 6.2882e-08
-d 94 27 5.57503e-08
-d 95 27 4.86185e-08
-d 96 27 4.14867e-08
-d 97 27 3.4355e-08
-d 98 27 2.72232e-08
-d 99 27 2.05821e-08
-d 100 27 1.63235e-08
-d 101 27 1.2065e-08
-d 102 27 7.80643e-09
-d 103 27 3.54786e-09
-d 104 27 -7.10696e-10
-d 105 27 -4.96926e-09
-d 106 27 -9.22782e-09
-d 107 27 -1.34864e-08
-d 108 27 -1.77449e-08
-d 109 27 -2.20035e-08
-d 110 27 -2.62621e-08
-d 111 27 -3.05206e-08
-d 112 27 -3.47792e-08
-d 113 27 -3.90378e-08
-d 114 27 -4.32963e-08
-d 115 27 -4.75549e-08
-d 116 27 -5.18134e-08
-d 117 27 -5.6072e-08
-d 118 27 -6.03306e-08
-d 119 27 -6.45891e-08
-d 120 27 -6.88477e-08
-d 121 27 -8.76373e-06
-d 122 27 0.000131607
-d 123 27 -0.00021685
-d 124 27 -0.000433027
-d 125 27 0.00047234
-d 126 27 0.000211593
-d 127 27 -0.000189601
-d 128 27 3.2492e-05
-d 129 27 0.000575955
-d 130 27 7.72235e-05
-d 131 27 -0.000285172
-d 132 27 -0.000242061
-d 133 27 -0.000135112
-d 134 27 -3.50117e-05
-d 135 27 -2.75868e-05
-d 136 27 5.48974e-05
-d 137 27 1.80604e-07
-d 138 27 5.48911e-05
-d 139 27 3.97478e-05
-d 140 27 0.000192909
-d 141 27 0.000297932
-d 142 27 0.00402253
-d 143 27 -0.0122366
-d 144 27 -0.047853
-d 145 27 -0.0963082
-d 146 27 -0.108071
-d 147 27 -0.0567275
-d 148 27 -0.0239271
-d 149 27 -0.0178628
-d 150 27 -0.0233027
-d 151 27 -0.031853
-d 152 27 -0.0400843
-d 153 27 -0.0482725
-d 154 27 -0.0576154
-d 155 27 -0.0627218
-d 156 27 -0.0511236
-d 157 27 -0.0279524
-d 158 27 -0.0150986
-d 159 27 -0.00931091
-d 160 27 -0.00652876
-d 161 27 -0.00479286
-d 162 27 -0.00344346
-d 163 27 -0.00249578
-d 164 27 -0.0019532
-d 165 27 -0.00157977
-d 166 27 -0.00131848
-d 167 27 -0.00111251
-d 168 27 -0.000939229
-d 169 27 -0.000797445
-d 170 27 -0.000708384
-d 171 27 -0.000630452
-d 172 27 -0.000539722
-d 173 27 -0.000508862
-d 174 27 -0.000480596
-d 175 27 -0.000439484
-d 176 27 -0.000407217
-d 177 27 -0.000363866
-d 178 27 -0.000329506
-d 179 27 -0.000318642
-d 180 27 -0.000307362
-d 181 27 -0.000286511
-d 182 27 -0.000266253
-d 183 27 -0.000242943
-d 184 27 -0.000218107
-d 185 27 -0.000204661
-d 186 27 -0.00020241
-d 187 27 -0.000194435
-d 188 27 -0.000185062
-d 189 27 -0.000173042
-d 190 27 -0.000160549
-d 191 27 -0.000151407
-d 192 27 -0.000145626
-d 193 27 -0.000145976
-d 194 27 -0.000147342
-d 195 27 -0.000145288
-d 196 27 -0.000137979
-d 197 27 -0.000124481
-d 198 27 -0.000123218
-d 199 27 -0.000127453
-d 200 27 -0.000139006
-d 201 27 -0.000145486
-d 202 27 -0.000129764
-d 203 27 -9.82749e-05
-d 204 27 -4.72596e-05
-d 205 27 -3.08671e-05
-d 206 27 -3.28834e-05
-d 207 27 -4.52254e-05
-d 208 27 -6.25389e-05
-d 209 27 -6.32516e-05
-d 210 27 -6.39643e-05
-d 211 27 -6.4677e-05
-d 212 27 -6.53897e-05
-d 213 27 -6.61023e-05
-d 214 27 -6.6815e-05
-d 215 27 -6.75277e-05
-d 216 27 -6.61005e-05
-d 217 27 -6.45173e-05
-d 218 27 -6.29341e-05
-d 219 27 -6.13509e-05
-d 220 27 -5.97676e-05
-d 221 27 -5.81844e-05
-d 222 27 -5.66012e-05
-d 223 27 -5.54231e-05
-d 224 27 -5.4455e-05
-d 225 27 -5.3487e-05
-d 226 27 -5.25189e-05
-d 227 27 -5.15508e-05
-d 228 27 -5.05828e-05
-d 229 27 -4.96147e-05
-d 230 27 -4.86466e-05
-d 231 27 -4.76785e-05
-d 232 27 -4.67105e-05
-d 233 27 -4.57424e-05
-d 234 27 -4.47743e-05
-d 235 27 -4.38063e-05
-d 236 27 -4.28382e-05
-d 237 27 -4.18821e-05
-d 238 27 -4.10211e-05
-d 239 27 -4.016e-05
-d 240 27 -3.9299e-05
-d 241 27 -3.8438e-05
-d 242 27 4.29885e-05
-d 243 27 5.14113e-05
-d 244 27 -0.000127986
-d 245 27 -0.000611463
-d 246 27 -0.000149428
-d 247 27 0.000882394
-d 248 27 0.00297059
-d 249 27 -0.00405825
-d 250 27 -0.00591067
-d 251 27 -0.00546997
-d 252 27 -0.00158744
-d 253 27 0.00190677
-d 254 27 0.00298403
-d 255 27 0.00268595
-d 256 27 0.00196161
-d 257 27 0.00130289
-d 258 27 0.000783347
-d 259 27 0.000520683
-d 260 27 0.000565306
-d 261 27 0.00053419
-d 262 27 -0.00224696
-d 263 27 -0.000920818
-d 264 27 0.0132755
-d 265 27 0.0322504
-d 266 27 0.0442808
-d 267 27 0.0638615
-d 268 27 0.0701007
-d 269 27 0.0539356
-d 270 27 0.0247771
-d 271 27 0.056244
-d 272 27 0.294266
-d 273 27 0.831368
-d 274 27 1.45424
-d 275 27 2.02898
-d 276 27 2.54559
-d 277 27 2.9937
-d 278 27 3.35333
-d 279 27 3.72609
-d 280 27 4.06363
-d 281 27 4.32789
-d 282 27 4.52413
-d 283 27 4.66504
-d 284 27 4.7652
-d 285 27 4.83637
-d 286 27 4.88631
-d 287 27 4.92109
-d 288 27 4.94464
-d 289 27 4.96046
-d 290 27 4.97218
-d 291 27 4.98079
-d 292 27 4.98679
-d 293 27 4.99076
-d 294 27 4.99361
-d 295 27 4.99555
-d 296 27 4.99686
-d 297 27 4.99783
-d 298 27 4.99853
-d 299 27 4.99902
-d 300 27 4.99936
-d 301 27 4.99959
-d 302 27 4.99973
-d 303 27 4.99983
-d 304 27 4.9999
-d 305 27 4.99993
-d 306 27 4.99996
-d 307 27 4.99998
-d 308 27 5.0
-d 309 27 5.00001
-d 310 27 5.0
-d 311 27 4.99999
-d 312 27 4.99997
-d 313 27 4.99994
-d 314 27 4.99993
-d 315 27 4.99994
-d 316 27 4.99996
-d 317 27 4.99999
-d 318 27 5.00004
-d 319 27 5.00006
-d 320 27 5.00005
-d 321 27 5.00003
-d 322 27 5.00002
-d 323 27 5.00001
-d 324 27 5.0
-d 325 27 4.99999
-d 326 27 4.99999
-d 327 27 4.99999
-d 328 27 4.99999
-d 329 27 4.99999
-d 330 27 4.99999
-d 331 27 4.99999
-d 332 27 5.0
-d 333 27 5.0
-d 334 27 5.0
-d 335 27 5.0
-d 336 27 5.0
-d 337 27 5.0
-d 338 27 5.00001
-d 339 27 5.00001
-d 340 27 5.00001
-d 341 27 5.00001
-d 342 27 5.00001
-d 343 27 5.00001
-d 344 27 5.00001
-d 345 27 5.00001
-d 346 27 5.00001
-d 347 27 5.00001
-d 348 27 5.00001
-d 349 27 5.00001
-d 350 27 5.00001
-d 351 27 5.0
-d 352 27 5.0
-d 353 27 5.0
-d 354 27 5.0
-d 355 27 5.0
-d 356 27 4.99999
-d 357 27 4.99999
-d 358 27 4.99999
-d 359 27 4.99999
-d 360 27 4.99999
-d 361 27 4.99998
-d 1 28 5.0
-d 2 28 4.99984
-d 3 28 4.99796
-d 4 28 4.99478
-d 5 28 4.9889
-d 6 28 4.98738
-d 7 28 4.98896
-d 8 28 4.99087
-d 9 28 4.99262
-d 10 28 4.99419
-d 11 28 4.99552
-d 12 28 4.99659
-d 13 28 4.99743
-d 14 28 4.99807
-d 15 28 4.99855
-d 16 28 4.9989
-d 17 28 4.99894
-d 18 28 4.99908
-d 19 28 4.99935
-d 20 28 5.00001
-d 21 28 5.0007
-d 22 28 5.00132
-d 23 28 5.00032
-d 24 28 4.99976
-d 25 28 5.00134
-d 26 28 5.00339
-d 27 28 5.00315
-d 28 28 5.00157
-d 29 28 5.00091
-d 30 28 5.00058
-d 31 28 5.00012
-d 32 28 4.99944
-d 33 28 4.99886
-d 34 28 4.9994
-d 35 28 4.99934
-d 36 28 4.99899
-d 37 28 4.99876
-d 38 28 4.99868
-d 39 28 4.99872
-d 40 28 4.99883
-d 41 28 4.99898
-d 42 28 4.99914
-d 43 28 4.9993
-d 44 28 4.99944
-d 45 28 4.99956
-d 46 28 4.99967
-d 47 28 4.99976
-d 48 28 4.99982
-d 49 28 4.99986
-d 50 28 4.9999
-d 51 28 4.99993
-d 52 28 4.99997
-d 53 28 4.99997
-d 54 28 4.99998
-d 55 28 4.99998
-d 56 28 4.99998
-d 57 28 4.99998
-d 58 28 4.99998
-d 59 28 4.99998
-d 60 28 4.99998
-d 61 28 4.99998
-d 62 28 4.99999
-d 63 28 4.99999
-d 64 28 4.99999
-d 65 28 4.99999
-d 66 28 5.0
-d 67 28 5.0
-d 68 28 5.0
-d 69 28 5.0
-d 70 28 5.0
-d 71 28 5.0
-d 72 28 5.0
-d 73 28 5.0
-d 74 28 5.0
-d 75 28 5.0
-d 76 28 5.0
-d 77 28 5.0
-d 78 28 5.0
-d 79 28 5.0
-d 80 28 5.0
-d 81 28 5.0
-d 82 28 5.0
-d 83 28 5.0
-d 84 28 5.0
-d 85 28 5.0
-d 86 28 5.0
-d 87 28 5.0
-d 88 28 5.0
-d 89 28 5.0
-d 90 28 5.0
-d 91 28 5.0
-d 92 28 5.0
-d 93 28 5.0
-d 94 28 5.0
-d 95 28 5.0
-d 96 28 5.0
-d 97 28 5.0
-d 98 28 5.0
-d 99 28 5.0
-d 100 28 5.0
-d 101 28 5.0
-d 102 28 5.0
-d 103 28 5.0
-d 104 28 5.0
-d 105 28 5.0
-d 106 28 5.0
-d 107 28 5.0
-d 108 28 5.0
-d 109 28 5.0
-d 110 28 5.0
-d 111 28 5.0
-d 112 28 5.0
-d 113 28 5.0
-d 114 28 5.0
-d 115 28 5.0
-d 116 28 5.0
-d 117 28 5.0
-d 118 28 5.0
-d 119 28 5.0
-d 120 28 5.0
-d 121 28 5.00009
-d 122 28 5.00028
-d 123 28 5.00015
-d 124 28 4.99983
-d 125 28 5.00036
-d 126 28 4.99996
-d 127 28 4.99834
-d 128 28 4.99783
-d 129 28 5.00383
-d 130 28 5.00734
-d 131 28 5.00387
-d 132 28 5.00058
-d 133 28 4.99893
-d 134 28 4.99836
-d 135 28 4.99832
-d 136 28 4.99854
-d 137 28 4.99873
-d 138 28 4.99905
-d 139 28 4.99927
-d 140 28 4.99952
-d 141 28 4.99969
-d 142 28 4.99834
-d 143 28 4.99536
-d 144 28 4.99163
-d 145 28 4.99073
-d 146 28 5.0053
-d 147 28 5.03631
-d 148 28 5.03103
-d 149 28 4.9008
-d 150 28 4.62503
-d 151 28 4.21887
-d 152 28 3.70902
-d 153 28 3.09967
-d 154 28 2.35791
-d 155 28 1.41912
-d 156 28 0.519675
-d 157 28 0.210458
-d 158 28 0.131362
-d 159 28 0.0980819
-d 160 28 0.0708209
-d 161 28 0.0471701
-d 162 28 0.0323272
-d 163 28 0.0253535
-d 164 28 0.0199144
-d 165 28 0.0152615
-d 166 28 0.0117228
-d 167 28 0.00917696
-d 168 28 0.00738117
-d 169 28 0.00609292
-d 170 28 0.00512664
-d 171 28 0.00436184
-d 172 28 0.0037961
-d 173 28 0.00331639
-d 174 28 0.00289006
-d 175 28 0.0025477
-d 176 28 0.00226529
-d 177 28 0.00202925
-d 178 28 0.00182793
-d 179 28 0.00165474
-d 180 28 0.00150531
-d 181 28 0.00137529
-d 182 28 0.00125983
-d 183 28 0.00115603
-d 184 28 0.00106455
-d 185 28 0.000982977
-d 186 28 0.000911255
-d 187 28 0.000846819
-d 188 28 0.000790092
-d 189 28 0.000738698
-d 190 28 0.000692816
-d 191 28 0.00065107
-d 192 28 0.000613595
-d 193 28 0.000579642
-d 194 28 0.000548935
-d 195 28 0.00052106
-d 196 28 0.000495598
-d 197 28 0.000472174
-d 198 28 0.000450849
-d 199 28 0.000431118
-d 200 28 0.000412667
-d 201 28 0.000395868
-d 202 28 0.000381319
-d 203 28 0.000368487
-d 204 28 0.000357327
-d 205 28 0.000344212
-d 206 28 0.000330334
-d 207 28 0.00031622
-d 208 28 0.000303298
-d 209 28 0.000295809
-d 210 28 0.00028832
-d 211 28 0.000280831
-d 212 28 0.000273342
-d 213 28 0.000265853
-d 214 28 0.000258364
-d 215 28 0.000250875
-d 216 28 0.000245118
-d 217 28 0.000239488
-d 218 28 0.000233857
-d 219 28 0.000228227
-d 220 28 0.000222596
-d 221 28 0.000216966
-d 222 28 0.000211336
-d 223 28 0.000207047
-d 224 28 0.000203455
-d 225 28 0.000199863
-d 226 28 0.00019627
-d 227 28 0.000192678
-d 228 28 0.000189085
-d 229 28 0.000185493
-d 230 28 0.0001819
-d 231 28 0.000178308
-d 232 28 0.000174716
-d 233 28 0.000171123
-d 234 28 0.000167531
-d 235 28 0.000163938
-d 236 28 0.000160346
-d 237 28 0.000156835
-d 238 28 0.000153973
-d 239 28 0.00015111
-d 240 28 0.000148248
-d 241 28 0.000145385
-d 242 28 0.000296579
-d 243 28 -3.96718e-05
-d 244 28 -0.000449085
-d 245 28 0.000323433
-d 246 28 0.000750086
-d 247 28 0.000268264
-d 248 28 0.000149028
-d 249 28 -0.000100249
-d 250 28 7.00956e-05
-d 251 28 0.00012605
-d 252 28 0.00022592
-d 253 28 0.000193036
-d 254 28 0.000120453
-d 255 28 8.07865e-05
-d 256 28 7.65771e-05
-d 257 28 -3.27828e-05
-d 258 28 0.000116759
-d 259 28 0.000169498
-d 260 28 0.000409804
-d 261 28 0.000414965
-d 262 28 0.00092323
-d 263 28 -0.00590633
-d 264 28 -0.0175477
-d 265 28 -0.032433
-d 266 28 -0.0559842
-d 267 28 -0.0820373
-d 268 28 0.0688484
-d 269 28 0.626629
-d 270 28 1.32929
-d 271 28 2.01657
-d 272 28 2.60925
-d 273 28 3.12329
-d 274 28 3.38952
-d 275 28 3.14128
-d 276 28 2.38463
-d 277 28 1.23802
-d 278 28 0.316019
-d 279 28 0.107832
-d 280 28 0.0694707
-d 281 28 0.051837
-d 282 28 0.035247
-d 283 28 0.0209999
-d 284 28 0.0116618
-d 285 28 0.00967674
-d 286 28 0.00789182
-d 287 28 0.00574566
-d 288 28 0.00386872
-d 289 28 0.00258612
-d 290 28 0.00167126
-d 291 28 0.00104169
-d 292 28 0.000641093
-d 293 28 0.000401246
-d 294 28 0.000277928
-d 295 28 0.000171775
-d 296 28 0.000102266
-d 297 28 5.89376e-05
-d 298 28 3.29258e-05
-d 299 28 1.80463e-05
-d 300 28 1.0057e-05
-d 301 28 6.4571e-06
-d 302 28 5.10093e-06
-d 303 28 4.06791e-06
-d 304 28 3.62716e-06
-d 305 28 3.63321e-06
-d 306 28 3.99625e-06
-d 307 28 4.64368e-06
-d 308 28 5.20886e-06
-d 309 28 4.77728e-06
-d 310 28 3.23919e-06
-d 311 28 1.14113e-06
-d 312 28 -1.29416e-06
-d 313 28 -4.15607e-06
-d 314 28 -1.88532e-06
-d 315 28 5.24411e-06
-d 316 28 1.38678e-05
-d 317 28 1.28823e-05
-d 318 28 3.6758e-06
-d 319 28 -2.52285e-06
-d 320 28 -3.97133e-06
-d 321 28 -4.03071e-06
-d 322 28 -3.37154e-06
-d 323 28 -2.71238e-06
-d 324 28 -2.05321e-06
-d 325 28 -1.39404e-06
-d 326 28 -7.34872e-07
-d 327 28 -3.73325e-07
-d 328 28 -1.05873e-07
-d 329 28 1.61578e-07
-d 330 28 4.2903e-07
-d 331 28 6.96482e-07
-d 332 28 8.18468e-07
-d 333 28 7.60065e-07
-d 334 28 7.01662e-07
-d 335 28 6.43258e-07
-d 336 28 5.84855e-07
-d 337 28 5.26452e-07
-d 338 28 4.68049e-07
-d 339 28 4.09646e-07
-d 340 28 3.51243e-07
-d 341 28 2.9284e-07
-d 342 28 2.34437e-07
-d 343 28 1.71213e-07
-d 344 28 1.06928e-07
-d 345 28 4.2644e-08
-d 346 28 -2.16403e-08
-d 347 28 -8.59247e-08
-d 348 28 -1.50209e-07
-d 349 28 -2.14493e-07
-d 350 28 -2.78778e-07
-d 351 28 -3.43062e-07
-d 352 28 -4.07346e-07
-d 353 28 -4.55065e-07
-d 354 28 -4.3348e-07
-d 355 28 -4.11896e-07
-d 356 28 -3.90311e-07
-d 357 28 -3.68726e-07
-d 358 28 -3.47141e-07
-d 359 28 -3.25556e-07
-d 360 28 -3.03971e-07
-d 361 28 -2.82386e-07
-d 1 29 0.368163
-d 2 29 0.361756
-d 3 29 0.327463
-d 4 29 0.269513
-d 5 29 0.149476
-d 6 29 0.0805716
-d 7 29 0.0501146
-d 8 29 0.03403
-d 9 29 0.0230886
-d 10 29 0.0160474
-d 11 29 0.0116071
-d 12 29 0.00870013
-d 13 29 0.00679614
-d 14 29 0.00542384
-d 15 29 0.00432512
-d 16 29 0.00340653
-d 17 29 -0.00129719
-d 18 29 -0.00399429
-d 19 29 -0.00318719
-d 20 29 0.00443085
-d 21 29 0.0150156
-d 22 29 0.0334147
-d 23 29 0.0132288
-d 24 29 -0.0189751
-d 25 29 -0.0508377
-d 26 29 -0.0252174
-d 27 29 -0.0142489
-d 28 29 -0.00675908
-d 29 29 -0.0038653
-d 30 29 -0.00243423
-d 31 29 -0.00168891
-d 32 29 -0.00120901
-d 33 29 -0.000900426
-d 34 29 -0.000685575
-d 35 29 -0.000557595
-d 36 29 -0.000457268
-d 37 29 -0.000377427
-d 38 29 -0.000315269
-d 39 29 -0.000266613
-d 40 29 -0.000228397
-d 41 29 -0.000198283
-d 42 29 -0.000174248
-d 43 29 -0.000154886
-d 44 29 -0.00013892
-d 45 29 -0.000125864
-d 46 29 -0.000115189
-d 47 29 -0.000105841
-d 48 29 -9.66611e-05
-d 49 29 -8.84262e-05
-d 50 29 -8.23872e-05
-d 51 29 -7.74668e-05
-d 52 29 -7.25463e-05
-d 53 29 -6.79992e-05
-d 54 29 -6.35276e-05
-d 55 29 -5.92413e-05
-d 56 29 -5.68994e-05
-d 57 29 -5.45574e-05
-d 58 29 -5.22154e-05
-d 59 29 -4.98735e-05
-d 60 29 -4.75315e-05
-d 61 29 -4.54981e-05
-d 62 29 -4.36726e-05
-d 63 29 -4.18471e-05
-d 64 29 -4.00216e-05
-d 65 29 -3.81961e-05
-d 66 29 -3.64559e-05
-d 67 29 -3.54209e-05
-d 68 29 -3.43858e-05
-d 69 29 -3.33508e-05
-d 70 29 -3.23157e-05
-d 71 29 -3.12807e-05
-d 72 29 -3.02456e-05
-d 73 29 -2.92105e-05
-d 74 29 -2.81755e-05
-d 75 29 -2.71404e-05
-d 76 29 -2.61054e-05
-d 77 29 -2.51232e-05
-d 78 29 -2.44984e-05
-d 79 29 -2.38736e-05
-d 80 29 -2.32487e-05
-d 81 29 -2.26239e-05
-d 82 29 -2.19991e-05
-d 83 29 -2.13742e-05
-d 84 29 -2.07494e-05
-d 85 29 -2.01246e-05
-d 86 29 -1.94998e-05
-d 87 29 -1.88749e-05
-d 88 29 -1.82865e-05
-d 89 29 -1.79044e-05
-d 90 29 -1.75224e-05
-d 91 29 -1.71403e-05
-d 92 29 -1.67582e-05
-d 93 29 -1.63762e-05
-d 94 29 -1.59941e-05
-d 95 29 -1.56121e-05
-d 96 29 -1.523e-05
-d 97 29 -1.4848e-05
-d 98 29 -1.44659e-05
-d 99 29 -1.41138e-05
-d 100 29 -1.39075e-05
-d 101 29 -1.37011e-05
-d 102 29 -1.34947e-05
-d 103 29 -1.32883e-05
-d 104 29 -1.30819e-05
-d 105 29 -1.28755e-05
-d 106 29 -1.26691e-05
-d 107 29 -1.24627e-05
-d 108 29 -1.22563e-05
-d 109 29 -1.205e-05
-d 110 29 -1.18436e-05
-d 111 29 -1.16372e-05
-d 112 29 -1.14308e-05
-d 113 29 -1.12244e-05
-d 114 29 -1.1018e-05
-d 115 29 -1.08116e-05
-d 116 29 -1.06052e-05
-d 117 29 -1.03988e-05
-d 118 29 -1.01924e-05
-d 119 29 -9.98605e-06
-d 120 29 -9.77966e-06
-d 121 29 -2.85319e-05
-d 122 29 0.00281092
-d 123 29 0.00180106
-d 124 29 -0.000981083
-d 125 29 0.00551926
-d 126 29 -0.00119763
-d 127 29 -0.0295069
-d 128 29 -0.0367677
-d 129 29 0.064749
-d 130 29 0.119022
-d 131 29 0.0882007
-d 132 29 0.0552062
-d 133 29 0.03418
-d 134 29 0.0223243
-d 135 29 0.015545
-d 136 29 0.011949
-d 137 29 0.00757134
-d 138 29 0.00667655
-d 139 29 0.00583243
-d 140 29 0.00644443
-d 141 29 0.00650959
-d 142 29 -0.0302575
-d 143 29 -0.0437806
-d 144 29 -0.0355466
-d 145 29 0.0381776
-d 146 29 0.282109
-d 147 29 0.674178
-d 148 29 1.07582
-d 149 29 1.45189
-d 150 29 1.789
-d 151 29 2.08649
-d 152 29 2.34663
-d 153 29 2.57245
-d 154 29 2.81211
-d 155 29 3.04778
-d 156 29 3.2523
-d 157 29 3.45877
-d 158 29 3.65593
-d 159 29 3.83396
-d 160 29 3.9923
-d 161 29 4.13368
-d 162 29 4.25864
-d 163 29 4.36719
-d 164 29 4.46064
-d 165 29 4.54086
-d 166 29 4.60962
-d 167 29 4.66835
-d 168 29 4.71838
-d 169 29 4.76094
-d 170 29 4.79716
-d 171 29 4.82796
-d 172 29 4.85413
-d 173 29 4.87634
-d 174 29 4.89518
-d 175 29 4.91116
-d 176 29 4.92476
-d 177 29 4.93631
-d 178 29 4.94608
-d 179 29 4.95434
-d 180 29 4.9613
-d 181 29 4.96715
-d 182 29 4.97211
-d 183 29 4.97638
-d 184 29 4.98001
-d 185 29 4.98312
-d 186 29 4.98571
-d 187 29 4.98795
-d 188 29 4.98979
-d 189 29 4.99138
-d 190 29 4.99269
-d 191 29 4.99381
-d 192 29 4.99474
-d 193 29 4.99551
-d 194 29 4.99615
-d 195 29 4.99668
-d 196 29 4.99713
-d 197 29 4.99752
-d 198 29 4.99783
-d 199 29 4.99811
-d 200 29 4.99836
-d 201 29 4.99858
-d 202 29 4.99873
-d 203 29 4.99884
-d 204 29 4.99892
-d 205 29 4.999
-d 206 29 4.99907
-d 207 29 4.99912
-d 208 29 4.99916
-d 209 29 4.99921
-d 210 29 4.99926
-d 211 29 4.99932
-d 212 29 4.99937
-d 213 29 4.99942
-d 214 29 4.99948
-d 215 29 4.99953
-d 216 29 4.99956
-d 217 29 4.99958
-d 218 29 4.99961
-d 219 29 4.99963
-d 220 29 4.99966
-d 221 29 4.99968
-d 222 29 4.99971
-d 223 29 4.99972
-d 224 29 4.99973
-d 225 29 4.99974
-d 226 29 4.99975
-d 227 29 4.99976
-d 228 29 4.99977
-d 229 29 4.99978
-d 230 29 4.99979
-d 231 29 4.9998
-d 232 29 4.9998
-d 233 29 4.99981
-d 234 29 4.99982
-d 235 29 4.99983
-d 236 29 4.99984
-d 237 29 4.99985
-d 238 29 4.99986
-d 239 29 4.99986
-d 240 29 4.99987
-d 241 29 4.99987
-d 242 29 5.00498
-d 243 29 5.00354
-d 244 29 4.99359
-d 245 29 4.98981
-d 246 29 5.00498
-d 247 29 5.00099
-d 248 29 5.00041
-d 249 29 5.00022
-d 250 29 5.00015
-d 251 29 5.00012
-d 252 29 5.0001
-d 253 29 5.00008
-d 254 29 5.00005
-d 255 29 5.00003
-d 256 29 5.0
-d 257 29 4.99431
-d 258 29 4.99459
-d 259 29 4.99591
-d 260 29 5.00087
-d 261 29 5.01029
-d 262 29 5.03935
-d 263 29 4.92784
-d 264 29 4.51643
-d 265 29 3.78356
-d 266 29 2.68745
-d 267 29 1.43417
-d 268 29 0.583128
-d 269 29 0.205094
-d 270 29 0.0777337
-d 271 29 0.0391566
-d 272 29 0.02723
-d 273 29 0.023883
-d 274 29 0.018808
-d 275 29 0.010165
-d 276 29 0.00254623
-d 277 29 -0.00377463
-d 278 29 -0.0038097
-d 279 29 0.00144145
-d 280 29 0.00267231
-d 281 29 0.00193045
-d 282 29 0.00144538
-d 283 29 0.00121758
-d 284 29 0.00112893
-d 285 29 0.00109424
-d 286 29 0.0010226
-d 287 29 0.000948072
-d 288 29 0.000882573
-d 289 29 0.000826996
-d 290 29 0.000776391
-d 291 29 0.000729719
-d 292 29 0.000686499
-d 293 29 0.000647333
-d 294 29 0.000610108
-d 295 29 0.000575631
-d 296 29 0.000545069
-d 297 29 0.000515485
-d 298 29 0.000488514
-d 299 29 0.000465316
-d 300 29 0.000443215
-d 301 29 0.000422454
-d 302 29 0.00040292
-d 303 29 0.00038488
-d 304 29 0.000368472
-d 305 29 0.000353628
-d 306 29 0.000339643
-d 307 29 0.000326197
-d 308 29 0.000313483
-d 309 29 0.000302884
-d 310 29 0.000294038
-d 311 29 0.000284003
-d 312 29 0.000270941
-d 313 29 0.000254925
-d 314 29 0.000246511
-d 315 29 0.000244089
-d 316 29 0.000245538
-d 317 29 0.000242099
-d 318 29 0.000235728
-d 319 29 0.000227482
-d 320 29 0.000218001
-d 321 29 0.000207257
-d 322 29 0.000202127
-d 323 29 0.000196997
-d 324 29 0.000191868
-d 325 29 0.000186738
-d 326 29 0.000181608
-d 327 29 0.00017758
-d 328 29 0.000173899
-d 329 29 0.000170219
-d 330 29 0.000166538
-d 331 29 0.000162857
-d 332 29 0.000159576
-d 333 29 0.00015679
-d 334 29 0.000154005
-d 335 29 0.000151219
-d 336 29 0.000148433
-d 337 29 0.000145647
-d 338 29 0.000142861
-d 339 29 0.000140076
-d 340 29 0.00013729
-d 341 29 0.000134504
-d 342 29 0.000131718
-d 343 29 0.000129603
-d 344 29 0.000127635
-d 345 29 0.000125668
-d 346 29 0.0001237
-d 347 29 0.000121732
-d 348 29 0.000119765
-d 349 29 0.000117797
-d 350 29 0.000115829
-d 351 29 0.000113862
-d 352 29 0.000111894
-d 353 29 0.000109993
-d 354 29 0.000108372
-d 355 29 0.000106751
-d 356 29 0.00010513
-d 357 29 0.000103509
-d 358 29 0.000101887
-d 359 29 0.000100266
-d 360 29 9.86449e-05
-d 361 29 9.70237e-05
-d 1 30 5.0
-d 2 30 4.99899
-d 3 30 4.99654
-d 4 30 4.99327
-d 5 30 4.9863
-d 6 30 4.98954
-d 7 30 4.99212
-d 8 30 4.99378
-d 9 30 4.9951
-d 10 30 4.99624
-d 11 30 4.99715
-d 12 30 4.99786
-d 13 30 4.99839
-d 14 30 4.99879
-d 15 30 4.99909
-d 16 30 4.99931
-d 17 30 4.99922
-d 18 30 4.99933
-d 19 30 4.99971
-d 20 30 5.00064
-d 21 30 5.00084
-d 22 30 5.00123
-d 23 30 4.99865
-d 24 30 4.99853
-d 25 30 4.99983
-d 26 30 5.00457
-d 27 30 5.00242
-d 28 30 5.00105
-d 29 30 5.00062
-d 30 30 5.00042
-d 31 30 4.99971
-d 32 30 4.9994
-d 33 30 4.9992
-d 34 30 4.9996
-d 35 30 4.99955
-d 36 30 4.99932
-d 37 30 4.99918
-d 38 30 4.99915
-d 39 30 4.99919
-d 40 30 4.99927
-d 41 30 4.99937
-d 42 30 4.99948
-d 43 30 4.99957
-d 44 30 4.99966
-d 45 30 4.99974
-d 46 30 4.9998
-d 47 30 4.99985
-d 48 30 4.99989
-d 49 30 4.99992
-d 50 30 4.99993
-d 51 30 4.99994
-d 52 30 4.99994
-d 53 30 4.99996
-d 54 30 4.99998
-d 55 30 5.0
-d 56 30 5.0
-d 57 30 5.00001
-d 58 30 5.00001
-d 59 30 5.00001
-d 60 30 5.00002
-d 61 30 5.00002
-d 62 30 5.00001
-d 63 30 5.00001
-d 64 30 5.00001
-d 65 30 5.0
-d 66 30 5.0
-d 67 30 5.0
-d 68 30 5.0
-d 69 30 4.99999
-d 70 30 4.99999
-d 71 30 4.99999
-d 72 30 4.99999
-d 73 30 4.99999
-d 74 30 4.99999
-d 75 30 4.99999
-d 76 30 4.99998
-d 77 30 4.99998
-d 78 30 4.99999
-d 79 30 4.99999
-d 80 30 4.99999
-d 81 30 4.99999
-d 82 30 4.99999
-d 83 30 4.99999
-d 84 30 4.99999
-d 85 30 4.99999
-d 86 30 5.0
-d 87 30 5.0
-d 88 30 5.0
-d 89 30 5.0
-d 90 30 5.0
-d 91 30 5.0
-d 92 30 5.00001
-d 93 30 5.00001
-d 94 30 5.00001
-d 95 30 5.00001
-d 96 30 5.00001
-d 97 30 5.00001
-d 98 30 5.00001
-d 99 30 5.00002
-d 100 30 5.00002
-d 101 30 5.00001
-d 102 30 5.00001
-d 103 30 5.00001
-d 104 30 5.00001
-d 105 30 5.00001
-d 106 30 5.00001
-d 107 30 5.00001
-d 108 30 5.00001
-d 109 30 5.00001
-d 110 30 5.00001
-d 111 30 5.00001
-d 112 30 5.00001
-d 113 30 5.00001
-d 114 30 5.00001
-d 115 30 5.0
-d 116 30 5.0
-d 117 30 5.0
-d 118 30 5.0
-d 119 30 5.0
-d 120 30 5.0
-d 121 30 4.9997
-d 122 30 4.99998
-d 123 30 4.99954
-d 124 30 4.99963
-d 125 30 5.00059
-d 126 30 4.99945
-d 127 30 4.99732
-d 128 30 4.99957
-d 129 30 5.00919
-d 130 30 5.00558
-d 131 30 5.00033
-d 132 30 4.99851
-d 133 30 4.9983
-d 134 30 4.99854
-d 135 30 4.99871
-d 136 30 4.99928
-d 137 30 4.99914
-d 138 30 4.99939
-d 139 30 4.99952
-d 140 30 4.9998
-d 141 30 4.99976
-d 142 30 4.99744
-d 143 30 4.99598
-d 144 30 4.99478
-d 145 30 4.99806
-d 146 30 5.01911
-d 147 30 5.04602
-d 148 30 5.05469
-d 149 30 5.01317
-d 150 30 4.89484
-d 151 30 4.69655
-d 152 30 4.42036
-d 153 30 4.06069
-d 154 30 3.60793
-d 155 30 3.12531
-d 156 30 2.72975
-d 157 30 2.45187
-d 158 30 2.25081
-d 159 30 2.09841
-d 160 30 1.98509
-d 161 30 1.90211
-d 162 30 1.84084
-d 163 30 1.79411
-d 164 30 1.7574
-d 165 30 1.72763
-d 166 30 1.70283
-d 167 30 1.68188
-d 168 30 1.66389
-d 169 30 1.64823
-d 170 30 1.63438
-d 171 30 1.62201
-d 172 30 1.61088
-d 173 30 1.60081
-d 174 30 1.59163
-d 175 30 1.58323
-d 176 30 1.57549
-d 177 30 1.56835
-d 178 30 1.56173
-d 179 30 1.55558
-d 180 30 1.54985
-d 181 30 1.54451
-d 182 30 1.53951
-d 183 30 1.53479
-d 184 30 1.53035
-d 185 30 1.52615
-d 186 30 1.5222
-d 187 30 1.51845
-d 188 30 1.5149
-d 189 30 1.51153
-d 190 30 1.50834
-d 191 30 1.50529
-d 192 30 1.5024
-d 193 30 1.49964
-d 194 30 1.497
-d 195 30 1.49449
-d 196 30 1.49208
-d 197 30 1.48977
-d 198 30 1.48755
-d 199 30 1.48542
-d 200 30 1.48336
-d 201 30 1.48138
-d 202 30 1.47948
-d 203 30 1.47765
-d 204 30 1.4759
-d 205 30 1.47419
-d 206 30 1.47255
-d 207 30 1.47096
-d 208 30 1.46949
-d 209 30 1.46823
-d 210 30 1.46696
-d 211 30 1.4657
-d 212 30 1.46444
-d 213 30 1.46317
-d 214 30 1.46191
-d 215 30 1.46065
-d 216 30 1.45956
-d 217 30 1.4585
-d 218 30 1.45743
-d 219 30 1.45636
-d 220 30 1.45529
-d 221 30 1.45422
-d 222 30 1.45315
-d 223 30 1.45226
-d 224 30 1.45145
-d 225 30 1.45064
-d 226 30 1.44983
-d 227 30 1.44902
-d 228 30 1.44821
-d 229 30 1.4474
-d 230 30 1.44659
-d 231 30 1.44579
-d 232 30 1.44498
-d 233 30 1.44417
-d 234 30 1.44336
-d 235 30 1.44255
-d 236 30 1.44174
-d 237 30 1.44094
-d 238 30 1.44019
-d 239 30 1.43944
-d 240 30 1.43868
-d 241 30 1.43793
-d 242 30 1.43765
-d 243 30 1.43679
-d 244 30 1.43515
-d 245 30 1.43405
-d 246 30 1.43478
-d 247 30 1.43387
-d 248 30 1.43345
-d 249 30 1.43184
-d 250 30 1.43086
-d 251 30 1.43021
-d 252 30 1.43003
-d 253 30 1.42988
-d 254 30 1.42944
-d 255 30 1.42883
-d 256 30 1.42818
-d 257 30 1.42702
-d 258 30 1.42642
-d 259 30 1.42595
-d 260 30 1.42586
-d 261 30 1.42616
-d 262 30 1.42783
-d 263 30 1.41733
-d 264 30 1.38106
-d 265 30 1.30738
-d 266 30 1.3877
-d 267 30 2.09819
-d 268 30 3.05285
-d 269 30 3.58059
-d 270 30 3.77601
-d 271 30 3.87609
-d 272 30 4.02557
-d 273 30 4.24887
-d 274 30 4.4608
-d 275 30 4.60411
-d 276 30 4.72109
-d 277 30 4.8255
-d 278 30 4.90465
-d 279 30 4.97379
-d 280 30 5.01253
-d 281 30 5.01532
-d 282 30 5.01239
-d 283 30 5.0092
-d 284 30 5.00665
-d 285 30 5.00474
-d 286 30 5.00333
-d 287 30 5.00232
-d 288 30 5.00163
-d 289 30 5.00117
-d 290 30 5.00082
-d 291 30 5.00057
-d 292 30 5.00039
-d 293 30 5.00027
-d 294 30 5.00019
-d 295 30 5.00013
-d 296 30 5.00009
-d 297 30 5.00006
-d 298 30 5.00004
-d 299 30 5.00003
-d 300 30 5.00002
-d 301 30 5.00001
-d 302 30 5.00001
-d 303 30 5.0
-d 304 30 5.0
-d 305 30 5.0
-d 306 30 4.99998
-d 307 30 4.99995
-d 308 30 4.99992
-d 309 30 4.99996
-d 310 30 5.00005
-d 311 30 5.00012
-d 312 30 5.00008
-d 313 30 4.99996
-d 314 30 4.9999
-d 315 30 4.99985
-d 316 30 4.99986
-d 317 30 4.99997
-d 318 30 5.00021
-d 319 30 5.0003
-d 320 30 5.00024
-d 321 30 5.00009
-d 322 30 5.00007
-d 323 30 5.00005
-d 324 30 5.00003
-d 325 30 5.00001
-d 326 30 4.99998
-d 327 30 4.99998
-d 328 30 4.99998
-d 329 30 4.99999
-d 330 30 4.99999
-d 331 30 5.0
-d 332 30 5.0
-d 333 30 5.0
-d 334 30 5.0
-d 335 30 5.0
-d 336 30 5.00001
-d 337 30 5.00001
-d 338 30 5.00001
-d 339 30 5.00001
-d 340 30 5.00001
-d 341 30 5.00001
-d 342 30 5.00002
-d 343 30 5.00002
-d 344 30 5.00001
-d 345 30 5.00001
-d 346 30 5.00001
-d 347 30 5.00001
-d 348 30 5.00001
-d 349 30 5.00001
-d 350 30 5.0
-d 351 30 5.0
-d 352 30 5.0
-d 353 30 5.0
-d 354 30 5.0
-d 355 30 4.99999
-d 356 30 4.99999
-d 357 30 4.99999
-d 358 30 4.99999
-d 359 30 4.99998
-d 360 30 4.99998
-d 361 30 4.99998
-d 1 31 7.10441e-10
-d 2 31 5.70385e-05
-d 3 31 0.000226143
-d 4 31 0.000131916
-d 5 31 -0.000887764
-d 6 31 -8.01837e-05
-d 7 31 -3.49653e-05
-d 8 31 9.40039e-05
-d 9 31 0.000118663
-d 10 31 0.000108025
-d 11 31 8.6059e-05
-d 12 31 6.33268e-05
-d 13 31 4.99295e-05
-d 14 31 3.16843e-05
-d 15 31 3.60692e-05
-d 16 31 2.07572e-05
-d 17 31 -8.6375e-05
-d 18 31 3.44583e-05
-d 19 31 8.07397e-05
-d 20 31 0.000196296
-d 21 31 0.000115615
-d 22 31 -7.12768e-05
-d 23 31 -0.000129812
-d 24 31 -4.18679e-05
-d 25 31 7.94364e-05
-d 26 31 0.000182034
-d 27 31 -5.41226e-05
-d 28 31 -0.000451819
-d 29 31 -0.000713937
-d 30 31 -0.00129863
-d 31 31 -0.00262186
-d 32 31 -0.00213417
-d 33 31 -0.00133767
-d 34 31 0.000775698
-d 35 31 0.000969902
-d 36 31 0.000549281
-d 37 31 0.000280946
-d 38 31 0.000140321
-d 39 31 8.6919e-05
-d 40 31 7.22446e-05
-d 41 31 6.5631e-05
-d 42 31 6.45263e-05
-d 43 31 6.63087e-05
-d 44 31 7.17391e-05
-d 45 31 7.59042e-05
-d 46 31 7.59172e-05
-d 47 31 7.03353e-05
-d 48 31 6.33558e-05
-d 49 31 5.31136e-05
-d 50 31 4.64278e-05
-d 51 31 4.40594e-05
-d 52 31 4.16909e-05
-d 53 31 4.05674e-05
-d 54 31 3.96957e-05
-d 55 31 3.87875e-05
-d 56 31 3.74977e-05
-d 57 31 3.62079e-05
-d 58 31 3.49181e-05
-d 59 31 3.36283e-05
-d 60 31 3.23385e-05
-d 61 31 3.12427e-05
-d 62 31 3.02775e-05
-d 63 31 2.93124e-05
-d 64 31 2.83472e-05
-d 65 31 2.7382e-05
-d 66 31 2.64613e-05
-d 67 31 2.59077e-05
-d 68 31 2.5354e-05
-d 69 31 2.48004e-05
-d 70 31 2.42468e-05
-d 71 31 2.36931e-05
-d 72 31 2.31395e-05
-d 73 31 2.25859e-05
-d 74 31 2.20322e-05
-d 75 31 2.14786e-05
-d 76 31 2.0925e-05
-d 77 31 2.03916e-05
-d 78 31 1.9995e-05
-d 79 31 1.95984e-05
-d 80 31 1.92019e-05
-d 81 31 1.88053e-05
-d 82 31 1.84087e-05
-d 83 31 1.80122e-05
-d 84 31 1.76156e-05
-d 85 31 1.7219e-05
-d 86 31 1.68225e-05
-d 87 31 1.64259e-05
-d 88 31 1.6051e-05
-d 89 31 1.57991e-05
-d 90 31 1.55471e-05
-d 91 31 1.52952e-05
-d 92 31 1.50433e-05
-d 93 31 1.47913e-05
-d 94 31 1.45394e-05
-d 95 31 1.42875e-05
-d 96 31 1.40356e-05
-d 97 31 1.37836e-05
-d 98 31 1.35317e-05
-d 99 31 1.32978e-05
-d 100 31 1.31513e-05
-d 101 31 1.30048e-05
-d 102 31 1.28583e-05
-d 103 31 1.27118e-05
-d 104 31 1.25653e-05
-d 105 31 1.24188e-05
-d 106 31 1.22724e-05
-d 107 31 1.21259e-05
-d 108 31 1.19794e-05
-d 109 31 1.18329e-05
-d 110 31 1.16864e-05
-d 111 31 1.15399e-05
-d 112 31 1.13934e-05
-d 113 31 1.12469e-05
-d 114 31 1.11005e-05
-d 115 31 1.0954e-05
-d 116 31 1.08075e-05
-d 117 31 1.0661e-05
-d 118 31 1.05145e-05
-d 119 31 1.0368e-05
-d 120 31 1.02215e-05
-d 121 31 1.76447e-05
-d 122 31 7.21516e-05
-d 123 31 -3.59786e-05
-d 124 31 -0.000159618
-d 125 31 0.000156236
-d 126 31 0.000135106
-d 127 31 -0.000336402
-d 128 31 -0.000302283
-d 129 31 0.000699323
-d 130 31 0.000473866
-d 131 31 -0.000156146
-d 132 31 -0.000225625
-d 133 31 -0.000123592
-d 134 31 -3.78116e-05
-d 135 31 8.47472e-06
-d 136 31 2.43387e-06
-d 137 31 -7.44762e-05
-d 138 31 7.80111e-05
-d 139 31 9.43608e-05
-d 140 31 0.000170159
-d 141 31 8.83919e-05
-d 142 31 -0.00018802
-d 143 31 -0.000373512
-d 144 31 -0.000390597
-d 145 31 0.000156875
-d 146 31 0.0032343
-d 147 31 0.00776304
-d 148 31 -0.000566905
-d 149 31 -0.00760695
-d 150 31 -0.0159226
-d 151 31 -0.0245989
-d 152 31 -0.0331402
-d 153 31 -0.0100902
-d 154 31 0.067837
-d 155 31 0.266702
-d 156 31 0.910818
-d 157 31 1.82282
-d 158 31 2.69714
-d 159 31 3.43247
-d 160 31 3.98325
-d 161 31 4.32893
-d 162 31 4.51529
-d 163 31 4.67087
-d 164 31 4.79288
-d 165 31 4.87574
-d 166 31 4.92797
-d 167 31 4.95902
-d 168 31 4.97655
-d 169 31 4.98622
-d 170 31 4.99195
-d 171 31 4.99526
-d 172 31 4.99735
-d 173 31 4.9991
-d 174 31 4.99974
-d 175 31 4.99982
-d 176 31 4.99974
-d 177 31 4.99961
-d 178 31 4.9995
-d 179 31 4.99943
-d 180 31 4.9994
-d 181 31 4.9994
-d 182 31 4.99942
-d 183 31 4.99944
-d 184 31 4.99948
-d 185 31 4.99952
-d 186 31 4.99956
-d 187 31 4.99961
-d 188 31 4.99965
-d 189 31 4.9997
-d 190 31 4.99974
-d 191 31 4.99977
-d 192 31 4.99981
-d 193 31 4.99983
-d 194 31 4.99986
-d 195 31 4.99988
-d 196 31 4.9999
-d 197 31 4.99991
-d 198 31 4.99992
-d 199 31 4.99993
-d 200 31 4.99994
-d 201 31 4.99995
-d 202 31 4.99995
-d 203 31 4.99996
-d 204 31 4.99997
-d 205 31 4.99997
-d 206 31 4.99998
-d 207 31 4.99998
-d 208 31 4.99999
-d 209 31 4.99999
-d 210 31 4.99999
-d 211 31 5.0
-d 212 31 5.0
-d 213 31 5.0
-d 214 31 5.00001
-d 215 31 5.00001
-d 216 31 5.00001
-d 217 31 5.00001
-d 218 31 5.00001
-d 219 31 5.0
-d 220 31 5.0
-d 221 31 5.0
-d 222 31 5.0
-d 223 31 5.0
-d 224 31 5.0
-d 225 31 5.0
-d 226 31 4.99999
-d 227 31 4.99999
-d 228 31 4.99999
-d 229 31 4.99999
-d 230 31 4.99999
-d 231 31 4.99999
-d 232 31 4.99999
-d 233 31 4.99999
-d 234 31 4.99999
-d 235 31 4.99999
-d 236 31 4.99999
-d 237 31 4.99999
-d 238 31 4.99999
-d 239 31 4.99999
-d 240 31 4.99999
-d 241 31 5.0
-d 242 31 5.00019
-d 243 31 4.99888
-d 244 31 4.99663
-d 245 31 4.99457
-d 246 31 4.99902
-d 247 31 5.00229
-d 248 31 5.00323
-d 249 31 5.00302
-d 250 31 5.0023
-d 251 31 5.0015
-d 252 31 5.00085
-d 253 31 5.00041
-d 254 31 5.00013
-d 255 31 4.99993
-d 256 31 4.99979
-d 257 31 4.99948
-d 258 31 4.99954
-d 259 31 4.99983
-d 260 31 5.00055
-d 261 31 5.00109
-d 262 31 5.00009
-d 263 31 4.9987
-d 264 31 4.998
-d 265 31 4.99755
-d 266 31 4.99676
-d 267 31 4.99618
-d 268 31 5.01091
-d 269 31 5.05272
-d 270 31 5.04156
-d 271 31 4.80112
-d 272 31 4.27692
-d 273 31 3.42343
-d 274 31 2.23953
-d 275 31 0.967179
-d 276 31 0.429813
-d 277 31 0.540757
-d 278 31 1.32991
-d 279 31 2.32147
-d 280 31 3.14903
-d 281 31 3.78143
-d 282 31 4.22325
-d 283 31 4.47978
-d 284 31 4.59448
-d 285 31 4.69875
-d 286 31 4.79798
-d 287 31 4.87419
-d 288 31 4.92339
-d 289 31 4.95249
-d 290 31 4.97174
-d 291 31 4.98408
-d 292 31 4.99124
-d 293 31 4.99478
-d 294 31 4.99729
-d 295 31 4.99868
-d 296 31 4.9992
-d 297 31 4.99941
-d 298 31 4.99947
-d 299 31 4.99946
-d 300 31 4.99943
-d 301 31 4.9994
-d 302 31 4.99939
-d 303 31 4.9994
-d 304 31 4.99942
-d 305 31 4.99946
-d 306 31 4.99951
-d 307 31 4.99956
-d 308 31 4.99961
-d 309 31 4.99967
-d 310 31 4.99973
-d 311 31 4.99977
-d 312 31 4.9998
-d 313 31 4.99981
-d 314 31 4.99983
-d 315 31 4.99984
-d 316 31 4.99987
-d 317 31 4.99992
-d 318 31 5.00001
-d 319 31 5.00005
-d 320 31 5.00001
-d 321 31 4.99994
-d 322 31 4.99995
-d 323 31 4.99995
-d 324 31 4.99996
-d 325 31 4.99996
-d 326 31 4.99996
-d 327 31 4.99997
-d 328 31 4.99997
-d 329 31 4.99997
-d 330 31 4.99998
-d 331 31 4.99998
-d 332 31 4.99998
-d 333 31 4.99998
-d 334 31 4.99999
-d 335 31 4.99999
-d 336 31 4.99999
-d 337 31 4.99999
-d 338 31 5.0
-d 339 31 5.0
-d 340 31 5.0
-d 341 31 5.00001
-d 342 31 5.00001
-d 343 31 5.00001
-d 344 31 5.00001
-d 345 31 5.00001
-d 346 31 5.00001
-d 347 31 5.0
-d 348 31 5.0
-d 349 31 5.0
-d 350 31 5.0
-d 351 31 5.0
-d 352 31 5.0
-d 353 31 5.0
-d 354 31 5.0
-d 355 31 4.99999
-d 356 31 4.99999
-d 357 31 4.99999
-d 358 31 4.99999
-d 359 31 4.99998
-d 360 31 4.99998
-d 361 31 4.99998
-d 1 32 1.8179e-09
-d 2 32 -5.28841e-06
-d 3 32 -1.44913e-05
-d 4 32 -3.62932e-05
-d 5 32 -9.75719e-05
-d 6 32 0.000141781
-d 7 32 3.73396e-05
-d 8 32 -1.65603e-05
-d 9 32 -1.5271e-05
-d 10 32 -6.73884e-06
-d 11 32 4.40157e-06
-d 12 32 -4.85345e-06
-d 13 32 -1.02964e-05
-d 14 32 2.03126e-05
-d 15 32 -1.89457e-05
-d 16 32 -8.75564e-06
-d 17 32 7.67422e-06
-d 18 32 4.71103e-06
-d 19 32 1.29798e-05
-d 20 32 6.13469e-06
-d 21 32 -1.14363e-05
-d 22 32 -0.0394563
-d 23 32 -0.0477298
-d 24 32 -0.0622012
-d 25 32 -0.0519225
-d 26 32 0.262499
-d 27 32 0.943611
-d 28 32 1.67052
-d 29 32 2.31017
-d 30 32 2.84028
-d 31 32 3.28467
-d 32 32 3.61582
-d 33 32 3.85887
-d 34 32 4.13011
-d 35 32 4.36511
-d 36 32 4.54063
-d 37 32 4.67013
-d 38 32 4.76408
-d 39 32 4.83263
-d 40 32 4.8825
-d 41 32 4.91837
-d 42 32 4.94373
-d 43 32 4.96117
-d 44 32 4.97318
-d 45 32 4.98093
-d 46 32 4.98562
-d 47 32 4.98906
-d 48 32 4.99267
-d 49 32 4.99539
-d 50 32 4.99666
-d 51 32 4.99731
-d 52 32 4.99797
-d 53 32 4.99844
-d 54 32 4.99887
-d 55 32 4.99927
-d 56 32 4.99933
-d 57 32 4.99938
-d 58 32 4.99944
-d 59 32 4.99949
-d 60 32 4.99955
-d 61 32 4.9996
-d 62 32 4.99965
-d 63 32 4.9997
-d 64 32 4.99975
-d 65 32 4.9998
-d 66 32 4.99985
-d 67 32 4.99986
-d 68 32 4.99987
-d 69 32 4.99989
-d 70 32 4.9999
-d 71 32 4.99991
-d 72 32 4.99992
-d 73 32 4.99993
-d 74 32 4.99995
-d 75 32 4.99996
-d 76 32 4.99997
-d 77 32 4.99998
-d 78 32 4.99998
-d 79 32 4.99999
-d 80 32 4.99999
-d 81 32 4.99999
-d 82 32 4.99999
-d 83 32 5.0
-d 84 32 5.0
-d 85 32 5.0
-d 86 32 5.0
-d 87 32 5.00001
-d 88 32 5.00001
-d 89 32 5.00001
-d 90 32 5.0
-d 91 32 5.0
-d 92 32 5.0
-d 93 32 5.0
-d 94 32 5.0
-d 95 32 5.0
-d 96 32 4.99999
-d 97 32 4.99999
-d 98 32 4.99999
-d 99 32 4.99999
-d 100 32 4.99999
-d 101 32 4.99999
-d 102 32 4.99999
-d 103 32 4.99999
-d 104 32 4.99999
-d 105 32 4.99999
-d 106 32 4.99999
-d 107 32 4.99999
-d 108 32 4.99999
-d 109 32 4.99999
-d 110 32 4.99999
-d 111 32 4.99999
-d 112 32 4.99999
-d 113 32 4.99999
-d 114 32 4.99999
-d 115 32 4.99999
-d 116 32 4.99999
-d 117 32 4.99999
-d 118 32 4.99999
-d 119 32 4.99999
-d 120 32 4.99999
-d 121 32 4.99999
-d 122 32 4.99997
-d 123 32 5.00002
-d 124 32 5.00004
-d 125 32 5.0001
-d 126 32 5.0001
-d 127 32 4.99987
-d 128 32 5.00009
-d 129 32 5.00021
-d 130 32 5.00002
-d 131 32 5.00004
-d 132 32 4.99988
-d 133 32 5.00013
-d 134 32 4.99993
-d 135 32 5.00026
-d 136 32 4.99973
-d 137 32 5.0
-d 138 32 5.00006
-d 139 32 5.00009
-d 140 32 5.00004
-d 141 32 5.00004
-d 142 32 5.04854
-d 143 32 4.82711
-d 144 32 4.04208
-d 145 32 2.64155
-d 146 32 0.838902
-d 147 32 0.19014
-d 148 32 0.0982549
-d 149 32 0.0723197
-d 150 32 0.0576863
-d 151 32 0.0427644
-d 152 32 0.0301979
-d 153 32 0.020146
-d 154 32 0.0135728
-d 155 32 0.00980358
-d 156 32 0.00774482
-d 157 32 0.00586604
-d 158 32 0.0036687
-d 159 32 0.00211511
-d 160 32 0.00121906
-d 161 32 0.000647581
-d 162 32 0.000828436
-d 163 32 0.00190938
-d 164 32 0.00224254
-d 165 32 0.00199956
-d 166 32 0.00165488
-d 167 32 0.00135612
-d 168 32 0.00113715
-d 169 32 0.000984181
-d 170 32 0.000877175
-d 171 32 0.000789973
-d 172 32 0.000741139
-d 173 32 0.000689338
-d 174 32 0.000625676
-d 175 32 0.000586082
-d 176 32 0.000550152
-d 177 32 0.000529573
-d 178 32 0.000505606
-d 179 32 0.000482117
-d 180 32 0.000460574
-d 181 32 0.000441649
-d 182 32 0.000424674
-d 183 32 0.000408398
-d 184 32 0.000391914
-d 185 32 0.000376272
-d 186 32 0.000361487
-d 187 32 0.000348181
-d 188 32 0.000336045
-d 189 32 0.000324466
-d 190 32 0.000313545
-d 191 32 0.000303046
-d 192 32 0.000293056
-d 193 32 0.00028356
-d 194 32 0.000274586
-d 195 32 0.000266155
-d 196 32 0.000258279
-d 197 32 0.000250938
-d 198 32 0.000243789
-d 199 32 0.000236912
-d 200 32 0.000230244
-d 201 32 0.000224186
-d 202 32 0.000219291
-d 203 32 0.000215346
-d 204 32 0.000212468
-d 205 32 0.000207291
-d 206 32 0.000200862
-d 207 32 0.00019368
-d 208 32 0.000186767
-d 209 32 0.000183515
-d 210 32 0.000180263
-d 211 32 0.00017701
-d 212 32 0.000173758
-d 213 32 0.000170506
-d 214 32 0.000167253
-d 215 32 0.000164001
-d 216 32 0.000161164
-d 217 32 0.000158357
-d 218 32 0.00015555
-d 219 32 0.000152743
-d 220 32 0.000149936
-d 221 32 0.000147129
-d 222 32 0.000144322
-d 223 32 0.000142066
-d 224 32 0.000140096
-d 225 32 0.000138127
-d 226 32 0.000136157
-d 227 32 0.000134187
-d 228 32 0.000132218
-d 229 32 0.000130248
-d 230 32 0.000128278
-d 231 32 0.000126308
-d 232 32 0.000124339
-d 233 32 0.000122369
-d 234 32 0.000120399
-d 235 32 0.000118429
-d 236 32 0.00011646
-d 237 32 0.000114527
-d 238 32 0.000112892
-d 239 32 0.000111258
-d 240 32 0.000109623
-d 241 32 0.000107988
-d 242 32 0.000103598
-d 243 32 6.86052e-05
-d 244 32 3.337e-05
-d 245 32 7.00783e-05
-d 246 32 0.000218764
-d 247 32 0.000221318
-d 248 32 0.000118593
-d 249 32 -0.000113962
-d 250 32 5.78552e-05
-d 251 32 9.42068e-05
-d 252 32 0.000237037
-d 253 32 0.000171302
-d 254 32 0.0001033
-d 255 32 6.16066e-05
-d 256 32 5.52908e-05
-d 257 32 6.30233e-05
-d 258 32 7.01897e-05
-d 259 32 8.48573e-05
-d 260 32 0.000106859
-d 261 32 8.37213e-05
-d 262 32 -0.0391541
-d 263 32 -0.047722
-d 264 32 -0.0618454
-d 265 32 -0.0169804
-d 266 32 0.345725
-d 267 32 1.03426
-d 268 32 1.74825
-d 269 32 2.37152
-d 270 32 2.88737
-d 271 32 3.32173
-d 272 32 3.66761
-d 273 32 3.9707
-d 274 32 4.17762
-d 275 32 3.98832
-d 276 32 3.30483
-d 277 32 2.09737
-d 278 32 0.710892
-d 279 32 0.148159
-d 280 32 0.0707463
-d 281 32 0.0555808
-d 282 32 0.045618
-d 283 32 0.0319116
-d 284 32 0.0199589
-d 285 32 0.0133357
-d 286 32 0.00898528
-d 287 32 0.00586075
-d 288 32 0.00375478
-d 289 32 0.00245443
-d 290 32 0.00156038
-d 291 32 0.000962344
-d 292 32 0.000590953
-d 293 32 0.000375107
-d 294 32 0.000250243
-d 295 32 0.00015882
-d 296 32 0.000100203
-d 297 32 6.18122e-05
-d 298 32 3.7372e-05
-d 299 32 2.23009e-05
-d 300 32 1.32569e-05
-d 301 32 8.29437e-06
-d 302 32 5.72457e-06
-d 303 32 3.96832e-06
-d 304 32 2.98935e-06
-d 305 32 2.59699e-06
-d 306 32 2.75024e-06
-d 307 32 3.38689e-06
-d 308 32 4.0453e-06
-d 309 32 3.50095e-06
-d 310 32 1.64988e-06
-d 311 32 -3.84371e-07
-d 312 32 -2.03828e-06
-d 313 32 -3.46401e-06
-d 314 32 -1.24301e-06
-d 315 32 4.63458e-06
-d 316 32 1.14104e-05
-d 317 32 1.02619e-05
-d 318 32 2.15487e-06
-d 319 32 -2.98487e-06
-d 320 32 -3.67221e-06
-d 321 32 -2.94279e-06
-d 322 32 -2.58649e-06
-d 323 32 -2.23019e-06
-d 324 32 -1.87389e-06
-d 325 32 -1.5176e-06
-d 326 32 -1.1613e-06
-d 327 32 -7.92127e-07
-d 328 32 -4.18889e-07
-d 329 32 -4.56502e-08
-d 330 32 3.27588e-07
-d 331 32 7.00827e-07
-d 332 32 8.79539e-07
-d 333 32 8.17025e-07
-d 334 32 7.5451e-07
-d 335 32 6.91996e-07
-d 336 32 6.29481e-07
-d 337 32 5.66966e-07
-d 338 32 5.04452e-07
-d 339 32 4.41937e-07
-d 340 32 3.79422e-07
-d 341 32 3.16908e-07
-d 342 32 2.54393e-07
-d 343 32 1.90078e-07
-d 344 32 1.25366e-07
-d 345 32 6.0654e-08
-d 346 32 -4.05776e-09
-d 347 32 -6.87696e-08
-d 348 32 -1.33481e-07
-d 349 32 -1.98193e-07
-d 350 32 -2.62905e-07
-d 351 32 -3.27617e-07
-d 352 32 -3.92329e-07
-d 353 32 -4.40392e-07
-d 354 32 -4.18802e-07
-d 355 32 -3.97213e-07
-d 356 32 -3.75624e-07
-d 357 32 -3.54035e-07
-d 358 32 -3.32446e-07
-d 359 32 -3.10856e-07
-d 360 32 -2.89267e-07
-d 361 32 -2.67678e-07
-d 1 33 1.10294
-d 2 33 1.10297
-d 3 33 1.10291
-d 4 33 1.10277
-d 5 33 1.10259
-d 6 33 1.10294
-d 7 33 1.10313
-d 8 33 1.10306
-d 9 33 1.10299
-d 10 33 1.10296
-d 11 33 1.10295
-d 12 33 1.10295
-d 13 33 1.10294
-d 14 33 1.10294
-d 15 33 1.10294
-d 16 33 1.10294
-d 17 33 1.10294
-d 18 33 1.10294
-d 19 33 1.10294
-d 20 33 1.10296
-d 21 33 1.10296
-d 22 33 1.00547
-d 23 33 0.998599
-d 24 33 1.5201
-d 25 33 2.49297
-d 26 33 3.31258
-d 27 33 3.73162
-d 28 33 3.84757
-d 29 33 3.92505
-d 30 33 4.02965
-d 31 33 4.16599
-d 32 33 4.30294
-d 33 33 4.41541
-d 34 33 4.52886
-d 35 33 4.64414
-d 36 33 4.73865
-d 37 33 4.81065
-d 38 33 4.86391
-d 39 33 4.90315
-d 40 33 4.93188
-d 41 33 4.95258
-d 42 33 4.96726
-d 43 33 4.97738
-d 44 33 4.98436
-d 45 33 4.98888
-d 46 33 4.99162
-d 47 33 4.99363
-d 48 33 4.99573
-d 49 33 4.99731
-d 50 33 4.99804
-d 51 33 4.99843
-d 52 33 4.99881
-d 53 33 4.99909
-d 54 33 4.99934
-d 55 33 4.99957
-d 56 33 4.9996
-d 57 33 4.99964
-d 58 33 4.99967
-d 59 33 4.9997
-d 60 33 4.99973
-d 61 33 4.99977
-d 62 33 4.9998
-d 63 33 4.99983
-d 64 33 4.99986
-d 65 33 4.99988
-d 66 33 4.99991
-d 67 33 4.99992
-d 68 33 4.99992
-d 69 33 4.99993
-d 70 33 4.99994
-d 71 33 4.99994
-d 72 33 4.99995
-d 73 33 4.99996
-d 74 33 4.99996
-d 75 33 4.99997
-d 76 33 4.99997
-d 77 33 4.99998
-d 78 33 4.99998
-d 79 33 4.99999
-d 80 33 4.99999
-d 81 33 4.99999
-d 82 33 4.99999
-d 83 33 5.0
-d 84 33 5.0
-d 85 33 5.0
-d 86 33 5.00001
-d 87 33 5.00001
-d 88 33 5.00001
-d 89 33 5.00001
-d 90 33 5.00001
-d 91 33 5.00001
-d 92 33 5.00001
-d 93 33 5.00001
-d 94 33 5.00001
-d 95 33 5.00001
-d 96 33 5.00001
-d 97 33 5.0
-d 98 33 5.0
-d 99 33 5.0
-d 100 33 5.0
-d 101 33 5.0
-d 102 33 5.0
-d 103 33 5.0
-d 104 33 5.0
-d 105 33 5.0
-d 106 33 5.0
-d 107 33 5.0
-d 108 33 5.0
-d 109 33 5.0
-d 110 33 5.0
-d 111 33 5.0
-d 112 33 5.0
-d 113 33 5.0
-d 114 33 5.0
-d 115 33 4.99999
-d 116 33 4.99999
-d 117 33 4.99999
-d 118 33 4.99999
-d 119 33 4.99999
-d 120 33 4.99999
-d 121 33 4.99999
-d 122 33 5.00028
-d 123 33 4.99988
-d 124 33 4.99968
-d 125 33 5.00019
-d 126 33 4.99987
-d 127 33 5.00021
-d 128 33 4.99973
-d 129 33 4.99977
-d 130 33 4.99996
-d 131 33 4.99997
-d 132 33 5.0002
-d 133 33 4.99957
-d 134 33 5.00026
-d 135 33 4.99947
-d 136 33 5.00074
-d 137 33 5.00003
-d 138 33 4.99987
-d 139 33 4.99979
-d 140 33 5.00008
-d 141 33 4.99997
-d 142 33 5.08794
-d 143 33 5.05993
-d 144 33 4.76875
-d 145 33 3.99197
-d 146 33 3.10174
-d 147 33 2.5197
-d 148 33 2.21771
-d 149 33 2.04
-d 150 33 1.92235
-d 151 33 1.83874
-d 152 33 1.77592
-d 153 33 1.72665
-d 154 33 1.686
-d 155 33 1.65276
-d 156 33 1.6286
-d 157 33 1.61299
-d 158 33 1.60039
-d 159 33 1.58934
-d 160 33 1.57954
-d 161 33 1.57083
-d 162 33 1.56306
-d 163 33 1.55604
-d 164 33 1.54963
-d 165 33 1.54375
-d 166 33 1.53832
-d 167 33 1.53331
-d 168 33 1.52865
-d 169 33 1.52432
-d 170 33 1.52026
-d 171 33 1.51645
-d 172 33 1.51287
-d 173 33 1.50949
-d 174 33 1.50629
-d 175 33 1.50327
-d 176 33 1.50039
-d 177 33 1.49766
-d 178 33 1.49505
-d 179 33 1.49257
-d 180 33 1.49019
-d 181 33 1.48792
-d 182 33 1.48574
-d 183 33 1.48365
-d 184 33 1.48164
-d 185 33 1.47971
-d 186 33 1.47784
-d 187 33 1.47604
-d 188 33 1.47431
-d 189 33 1.47264
-d 190 33 1.47102
-d 191 33 1.46945
-d 192 33 1.46794
-d 193 33 1.46647
-d 194 33 1.46505
-d 195 33 1.46367
-d 196 33 1.46233
-d 197 33 1.46103
-d 198 33 1.45976
-d 199 33 1.45853
-d 200 33 1.45733
-d 201 33 1.45616
-d 202 33 1.45502
-d 203 33 1.45392
-d 204 33 1.45284
-d 205 33 1.45179
-d 206 33 1.45076
-d 207 33 1.44975
-d 208 33 1.4488
-d 209 33 1.44795
-d 210 33 1.44711
-d 211 33 1.44626
-d 212 33 1.44541
-d 213 33 1.44457
-d 214 33 1.44372
-d 215 33 1.44287
-d 216 33 1.44212
-d 217 33 1.44138
-d 218 33 1.44063
-d 219 33 1.43989
-d 220 33 1.43914
-d 221 33 1.4384
-d 222 33 1.43766
-d 223 33 1.43701
-d 224 33 1.43641
-d 225 33 1.43581
-d 226 33 1.43522
-d 227 33 1.43462
-d 228 33 1.43402
-d 229 33 1.43342
-d 230 33 1.43282
-d 231 33 1.43223
-d 232 33 1.43163
-d 233 33 1.43103
-d 234 33 1.43043
-d 235 33 1.42984
-d 236 33 1.42924
-d 237 33 1.42865
-d 238 33 1.42808
-d 239 33 1.42752
-d 240 33 1.42695
-d 241 33 1.42639
-d 242 33 1.42584
-d 243 33 1.42529
-d 244 33 1.42472
-d 245 33 1.42412
-d 246 33 1.42365
-d 247 33 1.42326
-d 248 33 1.42304
-d 249 33 1.42162
-d 250 33 1.42082
-d 251 33 1.42032
-d 252 33 1.42029
-d 253 33 1.42026
-d 254 33 1.41995
-d 255 33 1.41947
-d 256 33 1.41894
-d 257 33 1.41841
-d 258 33 1.4179
-d 259 33 1.41742
-d 260 33 1.41699
-d 261 33 1.41656
-d 262 33 1.32097
-d 263 33 1.30963
-d 264 33 1.78765
-d 265 33 2.64656
-d 266 33 3.35764
-d 267 33 3.747
-d 268 33 3.86589
-d 269 33 3.94217
-d 270 33 4.04185
-d 271 33 4.18453
-d 272 33 4.3561
-d 273 33 4.53439
-d 274 33 4.68621
-d 275 33 4.74905
-d 276 33 4.77848
-d 277 33 4.84629
-d 278 33 4.91261
-d 279 33 4.97541
-d 280 33 5.01284
-d 281 33 5.01548
-d 282 33 5.01248
-d 283 33 5.00924
-d 284 33 5.00666
-d 285 33 5.00475
-d 286 33 5.00334
-d 287 33 5.00234
-d 288 33 5.00164
-d 289 33 5.00118
-d 290 33 5.00083
-d 291 33 5.00058
-d 292 33 5.0004
-d 293 33 5.00028
-d 294 33 5.00019
-d 295 33 5.00013
-d 296 33 5.00009
-d 297 33 5.00007
-d 298 33 5.00004
-d 299 33 5.00003
-d 300 33 5.00002
-d 301 33 5.00001
-d 302 33 5.00001
-d 303 33 5.00001
-d 304 33 5.0
-d 305 33 5.0
-d 306 33 4.99999
-d 307 33 4.99995
-d 308 33 4.99992
-d 309 33 4.99996
-d 310 33 5.00006
-d 311 33 5.00012
-d 312 33 5.00009
-d 313 33 4.99997
-d 314 33 4.9999
-d 315 33 4.99985
-d 316 33 4.99986
-d 317 33 4.99997
-d 318 33 5.00021
-d 319 33 5.00031
-d 320 33 5.00024
-d 321 33 5.0001
-d 322 33 5.00007
-d 323 33 5.00005
-d 324 33 5.00003
-d 325 33 5.00001
-d 326 33 4.99998
-d 327 33 4.99998
-d 328 33 4.99999
-d 329 33 4.99999
-d 330 33 4.99999
-d 331 33 5.0
-d 332 33 5.0
-d 333 33 5.0
-d 334 33 5.0
-d 335 33 5.0
-d 336 33 5.00001
-d 337 33 5.00001
-d 338 33 5.00001
-d 339 33 5.00001
-d 340 33 5.00001
-d 341 33 5.00001
-d 342 33 5.00002
-d 343 33 5.00002
-d 344 33 5.00001
-d 345 33 5.00001
-d 346 33 5.00001
-d 347 33 5.00001
-d 348 33 5.00001
-d 349 33 5.00001
-d 350 33 5.00001
-d 351 33 5.0
-d 352 33 5.0
-d 353 33 5.0
-d 354 33 5.0
-d 355 33 5.0
-d 356 33 4.99999
-d 357 33 4.99999
-d 358 33 4.99999
-d 359 33 4.99998
-d 360 33 4.99998
-d 361 33 4.99998
-d 1 34 5.0
-d 2 34 5.00012
-d 3 34 5.00023
-d 4 34 5.0003
-d 5 34 4.99972
-d 6 34 4.99988
-d 7 34 4.99984
-d 8 34 4.99991
-d 9 34 4.99996
-d 10 34 4.99999
-d 11 34 5.00008
-d 12 34 5.00009
-d 13 34 4.99986
-d 14 34 5.00003
-d 15 34 5.00007
-d 16 34 4.99995
-d 17 34 4.9999
-d 18 34 4.99997
-d 19 34 5.00013
-d 20 34 5.00014
-d 21 34 5.00013
-d 22 34 4.99701
-d 23 34 4.99763
-d 24 34 4.99742
-d 25 34 4.99998
-d 26 34 5.02836
-d 27 34 5.07262
-d 28 34 4.96856
-d 29 34 4.57267
-d 30 34 3.85637
-d 31 34 2.79544
-d 32 34 1.45942
-d 33 34 0.408016
-d 34 34 0.084885
-d 35 34 0.0271375
-d 36 34 0.0119294
-d 37 34 0.00707546
-d 38 34 0.0051087
-d 39 34 0.00373035
-d 40 34 0.00264737
-d 41 34 0.00186477
-d 42 34 0.00130379
-d 43 34 0.000915857
-d 44 34 0.000653121
-d 45 34 0.000483893
-d 46 34 0.000380852
-d 47 34 0.000302362
-d 48 34 0.000219498
-d 49 34 0.000154435
-d 50 34 0.000121928
-d 51 34 0.000104026
-d 52 34 8.61242e-05
-d 53 34 7.48526e-05
-d 54 34 6.49216e-05
-d 55 34 5.56238e-05
-d 56 34 5.29689e-05
-d 57 34 5.03139e-05
-d 58 34 4.7659e-05
-d 59 34 4.5004e-05
-d 60 34 4.23491e-05
-d 61 34 4.00356e-05
-d 62 34 3.79522e-05
-d 63 34 3.58687e-05
-d 64 34 3.37852e-05
-d 65 34 3.17018e-05
-d 66 34 2.97592e-05
-d 67 34 2.89804e-05
-d 68 34 2.82016e-05
-d 69 34 2.74228e-05
-d 70 34 2.66441e-05
-d 71 34 2.58653e-05
-d 72 34 2.50865e-05
-d 73 34 2.43077e-05
-d 74 34 2.35289e-05
-d 75 34 2.27501e-05
-d 76 34 2.19714e-05
-d 77 34 2.12346e-05
-d 78 34 2.07821e-05
-d 79 34 2.03295e-05
-d 80 34 1.98769e-05
-d 81 34 1.94244e-05
-d 82 34 1.89718e-05
-d 83 34 1.85192e-05
-d 84 34 1.80667e-05
-d 85 34 1.76141e-05
-d 86 34 1.71615e-05
-d 87 34 1.6709e-05
-d 88 34 1.62828e-05
-d 89 34 1.60061e-05
-d 90 34 1.57294e-05
-d 91 34 1.54527e-05
-d 92 34 1.5176e-05
-d 93 34 1.48993e-05
-d 94 34 1.46226e-05
-d 95 34 1.43459e-05
-d 96 34 1.40692e-05
-d 97 34 1.37925e-05
-d 98 34 1.35158e-05
-d 99 34 1.3262e-05
-d 100 34 1.31191e-05
-d 101 34 1.29761e-05
-d 102 34 1.28332e-05
-d 103 34 1.26903e-05
-d 104 34 1.25474e-05
-d 105 34 1.24045e-05
-d 106 34 1.22615e-05
-d 107 34 1.21186e-05
-d 108 34 1.19757e-05
-d 109 34 1.18328e-05
-d 110 34 1.16898e-05
-d 111 34 1.15469e-05
-d 112 34 1.1404e-05
-d 113 34 1.12611e-05
-d 114 34 1.11182e-05
-d 115 34 1.09752e-05
-d 116 34 1.08323e-05
-d 117 34 1.06894e-05
-d 118 34 1.05465e-05
-d 119 34 1.04036e-05
-d 120 34 1.02606e-05
-d 121 34 1.00185e-05
-d 122 34 3.8343e-05
-d 123 34 -3.06781e-05
-d 124 34 -0.000111758
-d 125 34 0.000111673
-d 126 34 0.000130815
-d 127 34 -0.000210491
-d 128 34 -0.000231304
-d 129 34 0.000310226
-d 130 34 0.000265303
-d 131 34 3.0878e-05
-d 132 34 -4.48405e-05
-d 133 34 -1.2852e-05
-d 134 34 -7.84469e-06
-d 135 34 3.29986e-05
-d 136 34 -1.23286e-05
-d 137 34 -6.07871e-05
-d 138 34 5.35082e-05
-d 139 34 7.69194e-05
-d 140 34 0.000126221
-d 141 34 6.57178e-05
-d 142 34 0.00223349
-d 143 34 -0.0148854
-d 144 34 -0.0476636
-d 145 34 -0.0491447
-d 146 34 0.220125
-d 147 34 1.11174
-d 148 34 2.03988
-d 149 34 2.90209
-d 150 34 3.61069
-d 151 34 4.13554
-d 152 34 4.50679
-d 153 34 4.71501
-d 154 34 4.83916
-d 155 34 4.91027
-d 156 34 4.95284
-d 157 34 4.98086
-d 158 34 4.99151
-d 159 34 4.98651
-d 160 34 4.97113
-d 161 34 4.95075
-d 162 34 4.93102
-d 163 34 4.93683
-d 164 34 4.95457
-d 165 34 4.97071
-d 166 34 4.98212
-d 167 34 4.98948
-d 168 34 4.99386
-d 169 34 4.99636
-d 170 34 4.99785
-d 171 34 4.9987
-d 172 34 4.99927
-d 173 34 4.99989
-d 174 34 5.00014
-d 175 34 5.00007
-d 176 34 4.99988
-d 177 34 4.99982
-d 178 34 4.99976
-d 179 34 4.99973
-d 180 34 4.99972
-d 181 34 4.99972
-d 182 34 4.99973
-d 183 34 4.99974
-d 184 34 4.99975
-d 185 34 4.99977
-d 186 34 4.99979
-d 187 34 4.99981
-d 188 34 4.99984
-d 189 34 4.99986
-d 190 34 4.99988
-d 191 34 4.99989
-d 192 34 4.99991
-d 193 34 4.99992
-d 194 34 4.99993
-d 195 34 4.99994
-d 196 34 4.99995
-d 197 34 4.99996
-d 198 34 4.99996
-d 199 34 4.99997
-d 200 34 4.99997
-d 201 34 4.99998
-d 202 34 4.99998
-d 203 34 4.99998
-d 204 34 4.99998
-d 205 34 4.99999
-d 206 34 4.99999
-d 207 34 4.99999
-d 208 34 4.99999
-d 209 34 5.0
-d 210 34 5.0
-d 211 34 5.0
-d 212 34 5.00001
-d 213 34 5.00001
-d 214 34 5.00001
-d 215 34 5.00002
-d 216 34 5.00001
-d 217 34 5.00001
-d 218 34 5.00001
-d 219 34 5.00001
-d 220 34 5.00001
-d 221 34 5.0
-d 222 34 5.0
-d 223 34 5.0
-d 224 34 5.0
-d 225 34 5.0
-d 226 34 5.0
-d 227 34 5.0
-d 228 34 5.0
-d 229 34 4.99999
-d 230 34 4.99999
-d 231 34 4.99999
-d 232 34 4.99999
-d 233 34 4.99999
-d 234 34 4.99999
-d 235 34 4.99999
-d 236 34 4.99999
-d 237 34 4.99999
-d 238 34 4.99999
-d 239 34 4.99999
-d 240 34 4.99999
-d 241 34 5.0
-d 242 34 5.00012
-d 243 34 4.99946
-d 244 34 4.99839
-d 245 34 4.99733
-d 246 34 4.99948
-d 247 34 5.00114
-d 248 34 5.00158
-d 249 34 5.00147
-d 250 34 5.00113
-d 251 34 5.00073
-d 252 34 5.00043
-d 253 34 5.0002
-d 254 34 5.00006
-d 255 34 4.99995
-d 256 34 4.99986
-d 257 34 4.99973
-d 258 34 4.99976
-d 259 34 4.9999
-d 260 34 5.00029
-d 261 34 5.00055
-d 262 34 4.99704
-d 263 34 4.99734
-d 264 34 4.9972
-d 265 34 5.00278
-d 266 34 5.03354
-d 267 34 5.07184
-d 268 34 4.94057
-d 269 34 4.51936
-d 270 34 3.75638
-d 271 34 2.60982
-d 272 34 1.23803
-d 273 34 0.315016
-d 274 34 0.0796102
-d 275 34 0.0252894
-d 276 34 0.0165723
-d 277 34 0.0827785
-d 278 34 0.491298
-d 279 34 1.40686
-d 280 34 2.33436
-d 281 34 3.1251
-d 282 34 3.7691
-d 283 34 4.22201
-d 284 34 4.49976
-d 285 34 4.68115
-d 286 34 4.80513
-d 287 34 4.88509
-d 288 34 4.93208
-d 289 34 4.95861
-d 290 34 4.97579
-d 291 34 4.98655
-d 292 34 4.99268
-d 293 34 4.99571
-d 294 34 4.99771
-d 295 34 4.99881
-d 296 34 4.99929
-d 297 34 4.99954
-d 298 34 4.99965
-d 299 34 4.9997
-d 300 34 4.99971
-d 301 34 4.99971
-d 302 34 4.99971
-d 303 34 4.99971
-d 304 34 4.99972
-d 305 34 4.99974
-d 306 34 4.99976
-d 307 34 4.99978
-d 308 34 4.99981
-d 309 34 4.99984
-d 310 34 4.99987
-d 311 34 4.99989
-d 312 34 4.99991
-d 313 34 4.99991
-d 314 34 4.99992
-d 315 34 4.99992
-d 316 34 4.99993
-d 317 34 4.99997
-d 318 34 5.00003
-d 319 34 5.00006
-d 320 34 5.00004
-d 321 34 5.00001
-d 322 34 5.0
-d 323 34 4.99999
-d 324 34 4.99998
-d 325 34 4.99998
-d 326 34 4.99997
-d 327 34 4.99997
-d 328 34 4.99997
-d 329 34 4.99998
-d 330 34 4.99998
-d 331 34 4.99998
-d 332 34 4.99999
-d 333 34 4.99999
-d 334 34 4.99999
-d 335 34 4.99999
-d 336 34 5.0
-d 337 34 5.0
-d 338 34 5.0
-d 339 34 5.0
-d 340 34 5.00001
-d 341 34 5.00001
-d 342 34 5.00001
-d 343 34 5.00001
-d 344 34 5.00001
-d 345 34 5.00001
-d 346 34 5.00001
-d 347 34 5.00001
-d 348 34 5.00001
-d 349 34 5.0
-d 350 34 5.0
-d 351 34 5.0
-d 352 34 5.0
-d 353 34 5.0
-d 354 34 5.0
-d 355 34 5.0
-d 356 34 4.99999
-d 357 34 4.99999
-d 358 34 4.99999
-d 359 34 4.99999
-d 360 34 4.99998
-d 361 34 4.99998
-d 1 35 5.0
-d 2 35 5.00207
-d 3 35 5.00813
-d 4 35 5.01486
-d 5 35 5.00156
-d 6 35 5.0018
-d 7 35 4.99861
-d 8 35 4.99844
-d 9 35 4.99888
-d 10 35 4.9993
-d 11 35 4.99956
-d 12 35 4.99971
-d 13 35 4.99979
-d 14 35 4.99983
-d 15 35 4.99987
-d 16 35 4.99989
-d 17 35 4.99671
-d 18 35 4.9974
-d 19 35 4.99864
-d 20 35 5.00131
-d 21 35 5.00377
-d 22 35 5.0021
-d 23 35 5.00039
-d 24 35 4.99993
-d 25 35 5.00004
-d 26 35 5.0009
-d 27 35 5.00109
-d 28 35 4.99636
-d 29 35 4.98617
-d 30 35 4.96778
-d 31 35 4.92047
-d 32 35 4.89528
-d 33 35 4.91112
-d 34 35 4.9559
-d 35 35 4.98286
-d 36 35 4.99369
-d 37 35 4.99812
-d 38 35 4.99951
-d 39 35 4.99994
-d 40 35 5.00014
-d 41 35 5.00008
-d 42 35 4.99994
-d 43 35 4.99984
-d 44 35 4.99989
-d 45 35 4.99998
-d 46 35 5.00004
-d 47 35 5.00004
-d 48 35 5.00006
-d 49 35 5.00005
-d 50 35 5.00001
-d 51 35 4.99997
-d 52 35 4.99992
-d 53 35 4.99993
-d 54 35 4.99994
-d 55 35 4.99996
-d 56 35 4.99996
-d 57 35 4.99996
-d 58 35 4.99996
-d 59 35 4.99996
-d 60 35 4.99996
-d 61 35 4.99996
-d 62 35 4.99996
-d 63 35 4.99996
-d 64 35 4.99996
-d 65 35 4.99996
-d 66 35 4.99996
-d 67 35 4.99996
-d 68 35 4.99996
-d 69 35 4.99997
-d 70 35 4.99997
-d 71 35 4.99997
-d 72 35 4.99997
-d 73 35 4.99997
-d 74 35 4.99997
-d 75 35 4.99997
-d 76 35 4.99997
-d 77 35 4.99997
-d 78 35 4.99997
-d 79 35 4.99997
-d 80 35 4.99997
-d 81 35 4.99997
-d 82 35 4.99997
-d 83 35 4.99997
-d 84 35 4.99997
-d 85 35 4.99997
-d 86 35 4.99997
-d 87 35 4.99997
-d 88 35 4.99997
-d 89 35 4.99997
-d 90 35 4.99998
-d 91 35 4.99998
-d 92 35 4.99998
-d 93 35 4.99998
-d 94 35 4.99998
-d 95 35 4.99998
-d 96 35 4.99998
-d 97 35 4.99998
-d 98 35 4.99998
-d 99 35 4.99998
-d 100 35 4.99998
-d 101 35 4.99998
-d 102 35 4.99998
-d 103 35 4.99998
-d 104 35 4.99998
-d 105 35 4.99998
-d 106 35 4.99998
-d 107 35 4.99998
-d 108 35 4.99998
-d 109 35 4.99998
-d 110 35 4.99998
-d 111 35 4.99998
-d 112 35 4.99998
-d 113 35 4.99998
-d 114 35 4.99998
-d 115 35 4.99998
-d 116 35 4.99998
-d 117 35 4.99998
-d 118 35 4.99998
-d 119 35 4.99998
-d 120 35 4.99998
-d 121 35 4.99998
-d 122 35 5.00131
-d 123 35 5.00072
-d 124 35 4.9977
-d 125 35 4.99811
-d 126 35 5.00325
-d 127 35 4.99647
-d 128 35 4.98948
-d 129 35 4.99459
-d 130 35 5.00262
-d 131 35 5.00276
-d 132 35 5.00156
-d 133 35 5.00072
-d 134 35 5.0003
-d 135 35 5.00013
-d 136 35 4.99995
-d 137 35 4.99668
-d 138 35 4.99775
-d 139 35 4.99917
-d 140 35 5.00173
-d 141 35 5.00386
-d 142 35 5.00188
-d 143 35 4.99888
-d 144 35 4.99757
-d 145 35 4.99951
-d 146 35 5.01712
-d 147 35 5.0557
-d 148 35 5.07088
-d 149 35 5.07704
-d 150 35 5.07758
-d 151 35 5.06958
-d 152 35 5.04223
-d 153 35 5.03331
-d 154 35 5.0279
-d 155 35 5.03408
-d 156 35 5.07611
-d 157 35 5.01911
-d 158 35 4.68594
-d 159 35 3.99152
-d 160 35 2.92195
-d 161 35 1.69878
-d 162 35 0.809
-d 163 35 0.344091
-d 164 35 0.154663
-d 165 35 0.0788717
-d 166 35 0.0467212
-d 167 35 0.0336168
-d 168 35 0.0280514
-d 169 35 0.0254947
-d 170 35 0.024173
-d 171 35 0.0223567
-d 172 35 0.0220555
-d 173 35 0.0271514
-d 174 35 0.0295872
-d 175 35 0.0296052
-d 176 35 0.0283971
-d 177 35 0.0264726
-d 178 35 0.0241813
-d 179 35 0.0218244
-d 180 35 0.0195349
-d 181 35 0.017368
-d 182 35 0.0152495
-d 183 35 0.013295
-d 184 35 0.0115444
-d 185 35 0.00996982
-d 186 35 0.00857091
-d 187 35 0.00733891
-d 188 35 0.00627261
-d 189 35 0.0053494
-d 190 35 0.00456316
-d 191 35 0.00388373
-d 192 35 0.00331073
-d 193 35 0.00282181
-d 194 35 0.00240991
-d 195 35 0.00206389
-d 196 35 0.00177187
-d 197 35 0.00152283
-d 198 35 0.00131167
-d 199 35 0.00112558
-d 200 35 0.000954373
-d 201 35 0.000805726
-d 202 35 0.00069326
-d 203 35 0.000600991
-d 204 35 0.000525743
-d 205 35 0.00047355
-d 206 35 0.00044359
-d 207 35 0.000434815
-d 208 35 0.000436053
-d 209 35 0.000402511
-d 210 35 0.000368969
-d 211 35 0.000335427
-d 212 35 0.000301886
-d 213 35 0.000268344
-d 214 35 0.000234802
-d 215 35 0.00020126
-d 216 35 0.000184967
-d 217 35 0.000169932
-d 218 35 0.000154896
-d 219 35 0.000139861
-d 220 35 0.000124825
-d 221 35 0.00010979
-d 222 35 9.47546e-05
-d 223 35 8.67896e-05
-d 224 35 8.24901e-05
-d 225 35 7.81906e-05
-d 226 35 7.38911e-05
-d 227 35 6.95915e-05
-d 228 35 6.5292e-05
-d 229 35 6.09925e-05
-d 230 35 5.66929e-05
-d 231 35 5.23934e-05
-d 232 35 4.80939e-05
-d 233 35 4.37943e-05
-d 234 35 3.94948e-05
-d 235 35 3.51953e-05
-d 236 35 3.08957e-05
-d 237 35 2.67968e-05
-d 238 35 2.42936e-05
-d 239 35 2.17904e-05
-d 240 35 1.92872e-05
-d 241 35 1.6784e-05
-d 242 35 0.00125927
-d 243 35 -0.00794344
-d 244 35 -0.0305499
-d 245 35 -0.0621697
-d 246 35 -0.0463796
-d 247 35 -0.0224608
-d 248 35 -0.00538381
-d 249 35 0.00546086
-d 250 35 0.0108675
-d 251 35 0.012883
-d 252 35 0.0131787
-d 253 35 0.0127271
-d 254 35 0.0119702
-d 255 35 0.0110398
-d 256 35 0.0100635
-d 257 35 0.00649617
-d 258 35 0.00489388
-d 259 35 0.00545863
-d 260 35 0.0098351
-d 261 35 0.0167428
-d 262 35 0.0126563
-d 263 35 0.00697542
-d 264 35 0.00427027
-d 265 35 0.00330002
-d 266 35 0.00390774
-d 267 35 0.00408999
-d 268 35 -0.00259143
-d 269 35 -0.0160578
-d 270 35 -0.0451849
-d 271 35 -0.0409651
-d 272 35 0.1301
-d 273 35 0.597429
-d 274 35 1.3848
-d 275 35 2.63426
-d 276 35 3.81272
-d 277 35 4.51373
-d 278 35 4.8412
-d 279 35 4.98731
-d 280 35 4.88165
-d 281 35 4.37165
-d 282 35 3.40034
-d 283 35 2.17681
-d 284 35 1.12217
-d 285 35 0.505129
-d 286 35 0.219703
-d 287 35 0.104992
-d 288 35 0.0622333
-d 289 35 0.0448317
-d 290 35 0.0355782
-d 291 35 0.0311867
-d 292 35 0.0293529
-d 293 35 0.0274615
-d 294 35 0.0288739
-d 295 35 0.0307845
-d 296 35 0.0304909
-d 297 35 0.029245
-d 298 35 0.0273602
-d 299 35 0.0251006
-d 300 35 0.022697
-d 301 35 0.0202765
-d 302 35 0.0179357
-d 303 35 0.0157106
-d 304 35 0.0136562
-d 305 35 0.0117951
-d 306 35 0.0101273
-d 307 35 0.00865784
-d 308 35 0.00739394
-d 309 35 0.00634364
-d 310 35 0.00551356
-d 311 35 0.00480538
-d 312 35 0.00415747
-d 313 35 0.00356084
-d 314 35 0.00297585
-d 315 35 0.00236711
-d 316 35 0.00181853
-d 317 35 0.00160713
-d 318 35 0.00169822
-d 319 35 0.00166542
-d 320 35 0.00145504
-d 321 35 0.00120252
-d 322 35 0.00109259
-d 323 35 0.000982658
-d 324 35 0.00087273
-d 325 35 0.000762802
-d 326 35 0.000652874
-d 327 35 0.000584068
-d 328 35 0.000528263
-d 329 35 0.000472458
-d 330 35 0.000416653
-d 331 35 0.000360848
-d 332 35 0.000321155
-d 333 35 0.000301442
-d 334 35 0.000281729
-d 335 35 0.000262016
-d 336 35 0.000242303
-d 337 35 0.00022259
-d 338 35 0.000202877
-d 339 35 0.000183164
-d 340 35 0.000163451
-d 341 35 0.000143738
-d 342 35 0.000124025
-d 343 35 0.000114582
-d 344 35 0.000107399
-d 345 35 0.000100216
-d 346 35 9.30332e-05
-d 347 35 8.58502e-05
-d 348 35 7.86672e-05
-d 349 35 7.14841e-05
-d 350 35 6.43011e-05
-d 351 35 5.7118e-05
-d 352 35 4.9935e-05
-d 353 35 4.35378e-05
-d 354 35 4.04281e-05
-d 355 35 3.73184e-05
-d 356 35 3.42088e-05
-d 357 35 3.10991e-05
-d 358 35 2.79894e-05
-d 359 35 2.48798e-05
-d 360 35 2.17701e-05
-d 361 35 1.86604e-05
-d 1 36 7.24585e-12
-d 2 36 2.21843e-05
-d 3 36 3.20014e-05
-d 4 36 1.25076e-05
-d 5 36 -2.44947e-05
-d 6 36 1.8425e-05
-d 7 36 5.50546e-06
-d 8 36 3.53025e-05
-d 9 36 -1.07551e-05
-d 10 36 -3.94383e-06
-d 11 36 -2.27848e-06
-d 12 36 -9.04789e-05
-d 13 36 7.44215e-05
-d 14 36 -2.7662e-05
-d 15 36 0.000200038
-d 16 36 -2.11998e-05
-d 17 36 -2.09011e-05
-d 18 36 2.37098e-05
-d 19 36 2.18751e-05
-d 20 36 -2.28422e-05
-d 21 36 -6.23659e-05
-d 22 36 3.58241e-05
-d 23 36 1.76386e-05
-d 24 36 -4.28311e-05
-d 25 36 0.000355626
-d 26 36 0.00156903
-d 27 36 0.00100999
-d 28 36 -0.0085304
-d 29 36 -0.02067
-d 30 36 -0.0389485
-d 31 36 -0.0651568
-d 32 36 -0.128475
-d 33 36 -0.314362
-d 34 36 -0.406837
-d 35 36 -0.421558
-d 36 36 -0.421277
-d 37 36 -0.418176
-d 38 36 -0.414481
-d 39 36 -0.410845
-d 40 36 -0.407348
-d 41 36 -0.403971
-d 42 36 -0.400716
-d 43 36 -0.397582
-d 44 36 -0.394563
-d 45 36 -0.391658
-d 46 36 -0.388866
-d 47 36 -0.386178
-d 48 36 -0.383585
-d 49 36 -0.381094
-d 50 36 -0.378789
-d 51 36 -0.376569
-d 52 36 -0.37435
-d 53 36 -0.372256
-d 54 36 -0.370188
-d 55 36 -0.36815
-d 56 36 -0.366422
-d 57 36 -0.364694
-d 58 36 -0.362967
-d 59 36 -0.361239
-d 60 36 -0.359511
-d 61 36 -0.357888
-d 62 36 -0.356334
-d 63 36 -0.354781
-d 64 36 -0.353227
-d 65 36 -0.351674
-d 66 36 -0.350152
-d 67 36 -0.348888
-d 68 36 -0.347625
-d 69 36 -0.346361
-d 70 36 -0.345098
-d 71 36 -0.343834
-d 72 36 -0.342571
-d 73 36 -0.341307
-d 74 36 -0.340044
-d 75 36 -0.33878
-d 76 36 -0.337517
-d 77 36 -0.336279
-d 78 36 -0.335215
-d 79 36 -0.334152
-d 80 36 -0.333088
-d 81 36 -0.332024
-d 82 36 -0.330961
-d 83 36 -0.329897
-d 84 36 -0.328833
-d 85 36 -0.32777
-d 86 36 -0.326706
-d 87 36 -0.325642
-d 88 36 -0.324601
-d 89 36 -0.323683
-d 90 36 -0.322766
-d 91 36 -0.321849
-d 92 36 -0.320932
-d 93 36 -0.320014
-d 94 36 -0.319097
-d 95 36 -0.31818
-d 96 36 -0.317263
-d 97 36 -0.316345
-d 98 36 -0.315428
-d 99 36 -0.314545
-d 100 36 -0.313825
-d 101 36 -0.313106
-d 102 36 -0.312387
-d 103 36 -0.311667
-d 104 36 -0.310948
-d 105 36 -0.310228
-d 106 36 -0.309509
-d 107 36 -0.308789
-d 108 36 -0.30807
-d 109 36 -0.307351
-d 110 36 -0.306631
-d 111 36 -0.305912
-d 112 36 -0.305192
-d 113 36 -0.304473
-d 114 36 -0.303754
-d 115 36 -0.303034
-d 116 36 -0.302315
-d 117 36 -0.301595
-d 118 36 -0.300876
-d 119 36 -0.300157
-d 120 36 -0.299437
-d 121 36 -0.298716
-d 122 36 -0.29798
-d 123 36 -0.297329
-d 124 36 -0.296691
-d 125 36 -0.295837
-d 126 36 -0.29516
-d 127 36 -0.294725
-d 128 36 -0.294044
-d 129 36 -0.292917
-d 130 36 -0.292351
-d 131 36 -0.291965
-d 132 36 -0.291365
-d 133 36 -0.290687
-d 134 36 -0.290027
-d 135 36 -0.289376
-d 136 36 -0.288772
-d 137 36 -0.288193
-d 138 36 -0.287505
-d 139 36 -0.286892
-d 140 36 -0.28626
-d 141 36 -0.285714
-d 142 36 -0.284545
-d 143 36 -0.289246
-d 144 36 -0.298717
-d 145 36 -0.298492
-d 146 36 -0.214163
-d 147 36 0.181451
-d 148 36 0.0749974
-d 149 36 0.0454707
-d 150 36 0.0292987
-d 151 36 0.0196837
-d 152 36 0.0124119
-d 153 36 0.00884715
-d 154 36 0.00527181
-d 155 36 0.00585821
-d 156 36 0.0296361
-d 157 36 0.169856
-d 158 36 0.361207
-d 159 36 0.538856
-d 160 36 0.67469
-d 161 36 0.685933
-d 162 36 0.392802
-d 163 36 0.17772
-d 164 36 0.0813085
-d 165 36 0.0424601
-d 166 36 0.0246654
-d 167 36 0.0175258
-d 168 36 0.0144256
-d 169 36 0.0129859
-d 170 36 0.012205
-d 171 36 0.0112846
-d 172 36 0.010933
-d 173 36 0.0134813
-d 174 36 0.0147254
-d 175 36 0.0147981
-d 176 36 0.0142156
-d 177 36 0.0132732
-d 178 36 0.0121355
-d 179 36 0.0109587
-d 180 36 0.00981238
-d 181 36 0.00872731
-d 182 36 0.00767007
-d 183 36 0.00669346
-d 184 36 0.00581341
-d 185 36 0.00502167
-d 186 36 0.00431819
-d 187 36 0.00369842
-d 188 36 0.00316168
-d 189 36 0.00269663
-d 190 36 0.00230035
-d 191 36 0.00195801
-d 192 36 0.00166928
-d 193 36 0.00142286
-d 194 36 0.00121522
-d 195 36 0.00104072
-d 196 36 0.000893384
-d 197 36 0.000767675
-d 198 36 0.000661268
-d 199 36 0.000567659
-d 200 36 0.000481766
-d 201 36 0.000407101
-d 202 36 0.000350044
-d 203 36 0.000302721
-d 204 36 0.000263424
-d 205 36 0.000236813
-d 206 36 0.00022199
-d 207 36 0.000218182
-d 208 36 0.000219548
-d 209 36 0.0002027
-d 210 36 0.000185853
-d 211 36 0.000169006
-d 212 36 0.000152158
-d 213 36 0.000135311
-d 214 36 0.000118463
-d 215 36 0.000101616
-d 216 36 9.33782e-05
-d 217 36 8.57685e-05
-d 218 36 7.81588e-05
-d 219 36 7.0549e-05
-d 220 36 6.29393e-05
-d 221 36 5.53296e-05
-d 222 36 4.77199e-05
-d 223 36 4.36954e-05
-d 224 36 4.15296e-05
-d 225 36 3.93637e-05
-d 226 36 3.71978e-05
-d 227 36 3.50319e-05
-d 228 36 3.28661e-05
-d 229 36 3.07002e-05
-d 230 36 2.85343e-05
-d 231 36 2.63685e-05
-d 232 36 2.42026e-05
-d 233 36 2.20367e-05
-d 234 36 1.98709e-05
-d 235 36 1.7705e-05
-d 236 36 1.55391e-05
-d 237 36 1.34772e-05
-d 238 36 1.22416e-05
-d 239 36 1.10061e-05
-d 240 36 9.77055e-06
-d 241 36 8.535e-06
-d 242 36 0.000631271
-d 243 36 -0.00362586
-d 244 36 -0.0146235
-d 245 36 -0.0308486
-d 246 36 -0.0237466
-d 247 36 -0.0117522
-d 248 36 -0.00304171
-d 249 36 0.00251033
-d 250 36 0.00531986
-d 251 36 0.0063897
-d 252 36 0.00657351
-d 253 36 0.00636494
-d 254 36 0.00599705
-d 255 36 0.00553442
-d 256 36 0.00505994
-d 257 36 0.00330925
-d 258 36 0.00246671
-d 259 36 0.0027006
-d 260 36 0.00473161
-d 261 36 0.00830333
-d 262 36 0.00649147
-d 263 36 0.00356815
-d 264 36 0.00217448
-d 265 36 0.00187579
-d 266 36 0.00270447
-d 267 36 0.00219543
-d 268 36 -0.00546118
-d 269 36 -0.0179576
-d 270 36 -0.0445306
-d 271 36 -0.0649309
-d 272 36 0.0197935
-d 273 36 0.473629
-d 274 36 0.87268
-d 275 36 0.269542
-d 276 36 0.0086094
-d 277 36 0.0844602
-d 278 36 0.606456
-d 279 36 1.04929
-d 280 36 0.906014
-d 281 36 0.916205
-d 282 36 0.919425
-d 283 36 0.872867
-d 284 36 0.556244
-d 285 36 0.262457
-d 286 36 0.11838
-d 287 36 0.0571226
-d 288 36 0.0333451
-d 289 36 0.0237133
-d 290 36 0.0185096
-d 291 36 0.0159617
-d 292 36 0.0148663
-d 293 36 0.0138683
-d 294 36 0.0144081
-d 295 36 0.0153797
-d 296 36 0.0152551
-d 297 36 0.0146487
-d 298 36 0.0137192
-d 299 36 0.0125973
-d 300 36 0.0113996
-d 301 36 0.0101903
-d 302 36 0.00901851
-d 303 36 0.00790495
-d 304 36 0.00687502
-d 305 36 0.00593994
-d 306 36 0.00510092
-d 307 36 0.00436111
-d 308 36 0.00372439
-d 309 36 0.0031945
-d 310 36 0.00277537
-d 311 36 0.00241888
-d 312 36 0.002095
-d 313 36 0.00179943
-d 314 36 0.00150419
-d 315 36 0.00119264
-d 316 36 0.00090934
-d 317 36 0.000802394
-d 318 36 0.000852816
-d 319 36 0.000838368
-d 320 36 0.000730842
-d 321 36 0.000601028
-d 322 36 0.000546616
-d 323 36 0.000492205
-d 324 36 0.000437793
-d 325 36 0.000383381
-d 326 36 0.000328969
-d 327 36 0.00029454
-d 328 36 0.000266428
-d 329 36 0.000238317
-d 330 36 0.000210205
-d 331 36 0.000182093
-d 332 36 0.000162091
-d 333 36 0.000152145
-d 334 36 0.000142198
-d 335 36 0.000132252
-d 336 36 0.000122306
-d 337 36 0.000112359
-d 338 36 0.000102413
-d 339 36 9.24665e-05
-d 340 36 8.25201e-05
-d 341 36 7.25738e-05
-d 342 36 6.26274e-05
-d 343 36 5.78553e-05
-d 344 36 5.42216e-05
-d 345 36 5.05878e-05
-d 346 36 4.69541e-05
-d 347 36 4.33204e-05
-d 348 36 3.96867e-05
-d 349 36 3.60529e-05
-d 350 36 3.24192e-05
-d 351 36 2.87855e-05
-d 352 36 2.51518e-05
-d 353 36 2.19153e-05
-d 354 36 2.03406e-05
-d 355 36 1.8766e-05
-d 356 36 1.71913e-05
-d 357 36 1.56167e-05
-d 358 36 1.4042e-05
-d 359 36 1.24674e-05
-d 360 36 1.08927e-05
-d 361 36 9.31806e-06
-d 1 37 5.0
-d 2 37 5.01426
-d 3 37 5.02852
-d 4 37 5.01923
-d 5 37 4.77685
-d 6 37 4.56471
-d 7 37 4.52338
-d 8 37 4.56813
-d 9 37 4.63122
-d 10 37 4.693
-d 11 37 4.74776
-d 12 37 4.79385
-d 13 37 4.83258
-d 14 37 4.86358
-d 15 37 4.88918
-d 16 37 4.91021
-d 17 37 4.90553
-d 18 37 4.89733
-d 19 37 4.89554
-d 20 37 4.91953
-d 21 37 5.00757
-d 22 37 5.07101
-d 23 37 5.06318
-d 24 37 5.05241
-d 25 37 5.05535
-d 26 37 5.08042
-d 27 37 5.07251
-d 28 37 4.90973
-d 29 37 4.56136
-d 30 37 3.98637
-d 31 37 3.237
-d 32 37 2.67216
-d 33 37 2.33678
-d 34 37 2.13529
-d 35 37 2.00544
-d 36 37 1.91429
-d 37 37 1.84638
-d 38 37 1.79461
-d 39 37 1.75338
-d 40 37 1.71958
-d 41 37 1.69175
-d 42 37 1.6686
-d 43 37 1.64918
-d 44 37 1.63258
-d 45 37 1.61836
-d 46 37 1.60607
-d 47 37 1.59506
-d 48 37 1.58483
-d 49 37 1.57575
-d 50 37 1.56847
-d 51 37 1.56193
-d 52 37 1.55538
-d 53 37 1.54968
-d 54 37 1.54416
-d 55 37 1.5388
-d 56 37 1.53523
-d 57 37 1.53165
-d 58 37 1.52807
-d 59 37 1.52449
-d 60 37 1.52091
-d 61 37 1.51771
-d 62 37 1.51477
-d 63 37 1.51182
-d 64 37 1.50888
-d 65 37 1.50593
-d 66 37 1.50309
-d 67 37 1.50113
-d 68 37 1.49917
-d 69 37 1.4972
-d 70 37 1.49524
-d 71 37 1.49328
-d 72 37 1.49132
-d 73 37 1.48935
-d 74 37 1.48739
-d 75 37 1.48543
-d 76 37 1.48346
-d 77 37 1.48157
-d 78 37 1.48012
-d 79 37 1.47868
-d 80 37 1.47724
-d 81 37 1.47579
-d 82 37 1.47435
-d 83 37 1.47291
-d 84 37 1.47146
-d 85 37 1.47002
-d 86 37 1.46857
-d 87 37 1.46713
-d 88 37 1.46574
-d 89 37 1.46462
-d 90 37 1.4635
-d 91 37 1.46238
-d 92 37 1.46126
-d 93 37 1.46014
-d 94 37 1.45902
-d 95 37 1.4579
-d 96 37 1.45678
-d 97 37 1.45567
-d 98 37 1.45455
-d 99 37 1.45349
-d 100 37 1.45275
-d 101 37 1.45201
-d 102 37 1.45127
-d 103 37 1.45053
-d 104 37 1.44979
-d 105 37 1.44905
-d 106 37 1.44831
-d 107 37 1.44757
-d 108 37 1.44683
-d 109 37 1.44609
-d 110 37 1.44535
-d 111 37 1.44461
-d 112 37 1.44387
-d 113 37 1.44313
-d 114 37 1.44239
-d 115 37 1.44165
-d 116 37 1.44091
-d 117 37 1.44017
-d 118 37 1.43943
-d 119 37 1.43869
-d 120 37 1.43795
-d 121 37 1.43721
-d 122 37 1.43874
-d 123 37 1.43976
-d 124 37 1.43619
-d 125 37 1.43182
-d 126 37 1.43726
-d 127 37 1.43084
-d 128 37 1.42587
-d 129 37 1.42383
-d 130 37 1.42642
-d 131 37 1.42728
-d 132 37 1.42736
-d 133 37 1.4271
-d 134 37 1.42669
-d 135 37 1.42621
-d 136 37 1.42569
-d 137 37 1.41703
-d 138 37 1.41244
-d 139 37 1.41019
-d 140 37 1.41199
-d 141 37 1.41833
-d 142 37 1.42502
-d 143 37 1.41504
-d 144 37 1.37535
-d 145 37 1.28381
-d 146 37 1.44779
-d 147 37 2.33713
-d 148 37 3.25835
-d 149 37 3.67554
-d 150 37 3.84975
-d 151 37 4.01125
-d 152 37 4.2253
-d 153 37 4.45433
-d 154 37 4.62215
-d 155 37 4.74478
-d 156 37 4.82998
-d 157 37 4.8868
-d 158 37 4.92396
-d 159 37 4.94768
-d 160 37 4.96498
-d 161 37 4.98537
-d 162 37 5.0128
-d 163 37 5.04467
-d 164 37 5.06722
-d 165 37 5.06535
-d 166 37 5.01475
-d 167 37 4.91956
-d 168 37 4.80647
-d 169 37 4.7242
-d 170 37 4.7059
-d 171 37 4.73552
-d 172 37 4.76379
-d 173 37 4.81684
-d 174 37 4.87376
-d 175 37 4.92276
-d 176 37 4.96112
-d 177 37 4.9884
-d 178 37 5.0045
-d 179 37 5.00999
-d 180 37 5.00933
-d 181 37 5.00619
-d 182 37 5.00384
-d 183 37 5.00342
-d 184 37 5.00373
-d 185 37 5.00362
-d 186 37 5.00309
-d 187 37 5.00272
-d 188 37 5.00239
-d 189 37 5.00204
-d 190 37 5.00172
-d 191 37 5.00146
-d 192 37 5.00124
-d 193 37 5.00105
-d 194 37 5.00089
-d 195 37 5.00076
-d 196 37 5.00065
-d 197 37 5.00057
-d 198 37 5.00048
-d 199 37 5.00041
-d 200 37 5.00034
-d 201 37 5.00028
-d 202 37 5.00023
-d 203 37 5.00019
-d 204 37 5.00015
-d 205 37 5.00015
-d 206 37 5.00016
-d 207 37 5.0002
-d 208 37 5.00023
-d 209 37 5.00021
-d 210 37 5.00019
-d 211 37 5.00017
-d 212 37 5.00015
-d 213 37 5.00012
-d 214 37 5.0001
-d 215 37 5.00008
-d 216 37 5.00007
-d 217 37 5.00006
-d 218 37 5.00005
-d 219 37 5.00004
-d 220 37 5.00003
-d 221 37 5.00002
-d 222 37 5.00001
-d 223 37 5.00001
-d 224 37 5.00001
-d 225 37 5.00001
-d 226 37 5.00001
-d 227 37 5.00001
-d 228 37 5.00001
-d 229 37 5.00002
-d 230 37 5.00002
-d 231 37 5.00002
-d 232 37 5.00002
-d 233 37 5.00002
-d 234 37 5.00002
-d 235 37 5.00002
-d 236 37 5.00002
-d 237 37 5.00002
-d 238 37 5.00002
-d 239 37 5.00001
-d 240 37 5.00001
-d 241 37 5.00001
-d 242 37 5.00062
-d 243 37 4.99506
-d 244 37 4.9835
-d 245 37 4.96726
-d 246 37 4.9728
-d 247 37 4.97877
-d 248 37 4.98675
-d 249 37 4.9966
-d 250 37 5.00406
-d 251 37 5.00679
-d 252 37 5.00629
-d 253 37 5.00561
-d 254 37 5.00487
-d 255 37 5.00429
-d 256 37 5.00384
-d 257 37 5.002
-d 258 37 5.00164
-d 259 37 5.00229
-d 260 37 5.00484
-d 261 37 5.00769
-d 262 37 5.00019
-d 263 37 5.00242
-d 264 37 5.01319
-d 265 37 5.0335
-d 266 37 5.07265
-d 267 37 5.10129
-d 268 37 5.11485
-d 269 37 5.12551
-d 270 37 5.13953
-d 271 37 5.16048
-d 272 37 5.18862
-d 273 37 5.22811
-d 274 37 5.25656
-d 275 37 5.25627
-d 276 37 5.19975
-d 277 37 4.9139
-d 278 37 4.24745
-d 279 37 3.43732
-d 280 37 2.8202
-d 281 37 2.43224
-d 282 37 2.17409
-d 283 37 2.01333
-d 284 37 1.93951
-d 285 37 1.94622
-d 286 37 1.98861
-d 287 37 2.02217
-d 288 37 2.05383
-d 289 37 2.08376
-d 290 37 2.11184
-d 291 37 2.13793
-d 292 37 2.16191
-d 293 37 2.18267
-d 294 37 2.20502
-d 295 37 2.22837
-d 296 37 2.24958
-d 297 37 2.26901
-d 298 37 2.28648
-d 299 37 2.302
-d 300 37 2.31582
-d 301 37 2.32802
-d 302 37 2.33869
-d 303 37 2.34795
-d 304 37 2.35596
-d 305 37 2.36282
-d 306 37 2.3687
-d 307 37 2.37371
-d 308 37 2.37797
-d 309 37 2.38161
-d 310 37 2.38476
-d 311 37 2.38743
-d 312 37 2.3897
-d 313 37 2.39168
-d 314 37 2.39329
-d 315 37 2.39463
-d 316 37 2.39575
-d 317 37 2.39671
-d 318 37 2.39756
-d 319 37 2.39835
-d 320 37 2.39907
-d 321 37 2.39968
-d 322 37 2.39999
-d 323 37 2.4003
-d 324 37 2.40061
-d 325 37 2.40091
-d 326 37 2.40122
-d 327 37 2.40142
-d 328 37 2.40159
-d 329 37 2.40176
-d 330 37 2.40193
-d 331 37 2.4021
-d 332 37 2.40222
-d 333 37 2.40228
-d 334 37 2.40234
-d 335 37 2.4024
-d 336 37 2.40247
-d 337 37 2.40253
-d 338 37 2.40259
-d 339 37 2.40265
-d 340 37 2.40271
-d 341 37 2.40277
-d 342 37 2.40284
-d 343 37 2.40287
-d 344 37 2.40289
-d 345 37 2.40291
-d 346 37 2.40294
-d 347 37 2.40296
-d 348 37 2.40298
-d 349 37 2.40301
-d 350 37 2.40303
-d 351 37 2.40305
-d 352 37 2.40308
-d 353 37 2.4031
-d 354 37 2.40311
-d 355 37 2.40312
-d 356 37 2.40313
-d 357 37 2.40314
-d 358 37 2.40315
-d 359 37 2.40316
-d 360 37 2.40317
-d 361 37 2.40318
-d 1 38 5.0
-d 2 38 5.01732
-d 3 38 5.03181
-d 4 38 5.05944
-d 5 38 5.12686
-d 6 38 5.20725
-d 7 38 5.28103
-d 8 38 5.31254
-d 9 38 5.32901
-d 10 38 5.33709
-d 11 38 5.3408
-d 12 38 5.34257
-d 13 38 5.34311
-d 14 38 5.34347
-d 15 38 5.34386
-d 16 38 5.34411
-d 17 38 5.3406
-d 18 38 5.33484
-d 19 38 5.32942
-d 20 38 5.32904
-d 21 38 5.33644
-d 22 38 5.34869
-d 23 38 5.35001
-d 24 38 5.34882
-d 25 38 5.34758
-d 26 38 5.34672
-d 27 38 5.34599
-d 28 38 5.34496
-d 29 38 5.34364
-d 30 38 5.34165
-d 31 38 5.33712
-d 32 38 5.33502
-d 33 38 5.3366
-d 34 38 5.34067
-d 35 38 5.34306
-d 36 38 5.34398
-d 37 38 5.34434
-d 38 38 5.34442
-d 39 38 5.34443
-d 40 38 5.34443
-d 41 38 5.34441
-d 42 38 5.34439
-d 43 38 5.34437
-d 44 38 5.34437
-d 45 38 5.34438
-d 46 38 5.34438
-d 47 38 5.34438
-d 48 38 5.34438
-d 49 38 5.34438
-d 50 38 5.34437
-d 51 38 5.34437
-d 52 38 5.34436
-d 53 38 5.34436
-d 54 38 5.34437
-d 55 38 5.34437
-d 56 38 5.34437
-d 57 38 5.34437
-d 58 38 5.34437
-d 59 38 5.34437
-d 60 38 5.34437
-d 61 38 5.34437
-d 62 38 5.34437
-d 63 38 5.34437
-d 64 38 5.34437
-d 65 38 5.34437
-d 66 38 5.34437
-d 67 38 5.34437
-d 68 38 5.34437
-d 69 38 5.34437
-d 70 38 5.34437
-d 71 38 5.34437
-d 72 38 5.34437
-d 73 38 5.34437
-d 74 38 5.34437
-d 75 38 5.34437
-d 76 38 5.34437
-d 77 38 5.34437
-d 78 38 5.34437
-d 79 38 5.34437
-d 80 38 5.34437
-d 81 38 5.34437
-d 82 38 5.34437
-d 83 38 5.34437
-d 84 38 5.34437
-d 85 38 5.34437
-d 86 38 5.34437
-d 87 38 5.34437
-d 88 38 5.34437
-d 89 38 5.34437
-d 90 38 5.34437
-d 91 38 5.34437
-d 92 38 5.34437
-d 93 38 5.34437
-d 94 38 5.34437
-d 95 38 5.34437
-d 96 38 5.34437
-d 97 38 5.34437
-d 98 38 5.34437
-d 99 38 5.34437
-d 100 38 5.34437
-d 101 38 5.34437
-d 102 38 5.34437
-d 103 38 5.34437
-d 104 38 5.34437
-d 105 38 5.34437
-d 106 38 5.34437
-d 107 38 5.34437
-d 108 38 5.34437
-d 109 38 5.34437
-d 110 38 5.34437
-d 111 38 5.34437
-d 112 38 5.34437
-d 113 38 5.34437
-d 114 38 5.34437
-d 115 38 5.34437
-d 116 38 5.34437
-d 117 38 5.34437
-d 118 38 5.34437
-d 119 38 5.34437
-d 120 38 5.34437
-d 121 38 5.34437
-d 122 38 5.35377
-d 123 38 5.35451
-d 124 38 5.34265
-d 125 38 5.34488
-d 126 38 5.35861
-d 127 38 5.28622
-d 128 38 4.90033
-d 129 38 4.75027
-d 130 38 4.89731
-d 131 38 4.97098
-d 132 38 4.99293
-d 133 38 4.99832
-d 134 38 4.99909
-d 135 38 4.99956
-d 136 38 4.99858
-d 137 38 4.99829
-d 138 38 4.9998
-d 139 38 5.00035
-d 140 38 5.0038
-d 141 38 5.00989
-d 142 38 5.00251
-d 143 38 4.99438
-d 144 38 4.9953
-d 145 38 4.99761
-d 146 38 4.99985
-d 147 38 5.00152
-d 148 38 5.0011
-d 149 38 5.00046
-d 150 38 4.99996
-d 151 38 4.99925
-d 152 38 4.99862
-d 153 38 4.99919
-d 154 38 4.99961
-d 155 38 5.00048
-d 156 38 5.00234
-d 157 38 4.99654
-d 158 38 4.98235
-d 159 38 4.95936
-d 160 38 4.83738
-d 161 38 4.53021
-d 162 38 4.21004
-d 163 38 4.00593
-d 164 38 3.91207
-d 165 38 3.88059
-d 166 38 3.87822
-d 167 38 3.89117
-d 168 38 3.91278
-d 169 38 3.94044
-d 170 38 3.97376
-d 171 38 4.01152
-d 172 38 4.05052
-d 173 38 4.10679
-d 174 38 4.17908
-d 175 38 4.25673
-d 176 38 4.33414
-d 177 38 4.40875
-d 178 38 4.47879
-d 179 38 4.54342
-d 180 38 4.60258
-d 181 38 4.65595
-d 182 38 4.70291
-d 183 38 4.74414
-d 184 38 4.78018
-d 185 38 4.81185
-d 186 38 4.83915
-d 187 38 4.86291
-d 188 38 4.88301
-d 189 38 4.90048
-d 190 38 4.91528
-d 191 38 4.92802
-d 192 38 4.9387
-d 193 38 4.94777
-d 194 38 4.95539
-d 195 38 4.9618
-d 196 38 4.96725
-d 197 38 4.97195
-d 198 38 4.97588
-d 199 38 4.97932
-d 200 38 4.98247
-d 201 38 4.98512
-d 202 38 4.98697
-d 203 38 4.98831
-d 204 38 4.98919
-d 205 38 4.99015
-d 206 38 4.99101
-d 207 38 4.99169
-d 208 38 4.99222
-d 209 38 4.99282
-d 210 38 4.99341
-d 211 38 4.994
-d 212 38 4.9946
-d 213 38 4.99519
-d 214 38 4.99578
-d 215 38 4.99638
-d 216 38 4.99667
-d 217 38 4.99693
-d 218 38 4.9972
-d 219 38 4.99747
-d 220 38 4.99773
-d 221 38 4.998
-d 222 38 4.99827
-d 223 38 4.99841
-d 224 38 4.99849
-d 225 38 4.99856
-d 226 38 4.99864
-d 227 38 4.99872
-d 228 38 4.9988
-d 229 38 4.99888
-d 230 38 4.99896
-d 231 38 4.99904
-d 232 38 4.99911
-d 233 38 4.99919
-d 234 38 4.99927
-d 235 38 4.99935
-d 236 38 4.99943
-d 237 38 4.9995
-d 238 38 4.99955
-d 239 38 4.9996
-d 240 38 4.99965
-d 241 38 4.9997
-d 242 38 5.00736
-d 243 38 4.98252
-d 244 38 4.87516
-d 245 38 4.66727
-d 246 38 4.49142
-d 247 38 4.43103
-d 248 38 4.4301
-d 249 38 4.4571
-d 250 38 4.49729
-d 251 38 4.5407
-d 252 38 4.5835
-d 253 38 4.62363
-d 254 38 4.66114
-d 255 38 4.69577
-d 256 38 4.72738
-d 257 38 4.74632
-d 258 38 4.75971
-d 259 38 4.77576
-d 260 38 4.80671
-d 261 38 4.87073
-d 262 38 4.91665
-d 263 38 4.93252
-d 264 38 4.94418
-d 265 38 4.95331
-d 266 38 4.96094
-d 267 38 4.96727
-d 268 38 4.97148
-d 269 38 4.97471
-d 270 38 4.97612
-d 271 38 4.98276
-d 272 38 5.00247
-d 273 38 5.04086
-d 274 38 5.08628
-d 275 38 5.10673
-d 276 38 5.08887
-d 277 38 5.0564
-d 278 38 5.02767
-d 279 38 5.01336
-d 280 38 4.99685
-d 281 38 4.97422
-d 282 38 4.90866
-d 283 38 4.67035
-d 284 38 4.33117
-d 285 38 4.07888
-d 286 38 3.94432
-d 287 38 3.89105
-d 288 38 3.88174
-d 289 38 3.89292
-d 290 38 3.91442
-d 291 38 3.94564
-d 292 38 3.98708
-d 293 38 4.0355
-d 294 38 4.09134
-d 295 38 4.16315
-d 296 38 4.24088
-d 297 38 4.31918
-d 298 38 4.39527
-d 299 38 4.46693
-d 300 38 4.53337
-d 301 38 4.59405
-d 302 38 4.6486
-d 303 38 4.69693
-d 304 38 4.73938
-d 305 38 4.77617
-d 306 38 4.80809
-d 307 38 4.83551
-d 308 38 4.85895
-d 309 38 4.87894
-d 310 38 4.89596
-d 311 38 4.91081
-d 312 38 4.92417
-d 313 38 4.93651
-d 314 38 4.94552
-d 315 38 4.95198
-d 316 38 4.9565
-d 317 38 4.96096
-d 318 38 4.96523
-d 319 38 4.96972
-d 320 38 4.97428
-d 321 38 4.97868
-d 322 38 4.98064
-d 323 38 4.9826
-d 324 38 4.98455
-d 325 38 4.98651
-d 326 38 4.98847
-d 327 38 4.98967
-d 328 38 4.99064
-d 329 38 4.9916
-d 330 38 4.99257
-d 331 38 4.99353
-d 332 38 4.99422
-d 333 38 4.99457
-d 334 38 4.99493
-d 335 38 4.99528
-d 336 38 4.99563
-d 337 38 4.99598
-d 338 38 4.99633
-d 339 38 4.99668
-d 340 38 4.99703
-d 341 38 4.99738
-d 342 38 4.99773
-d 343 38 4.9979
-d 344 38 4.99804
-d 345 38 4.99817
-d 346 38 4.9983
-d 347 38 4.99843
-d 348 38 4.99856
-d 349 38 4.99869
-d 350 38 4.99883
-d 351 38 4.99896
-d 352 38 4.99909
-d 353 38 4.99921
-d 354 38 4.99926
-d 355 38 4.99931
-d 356 38 4.99937
-d 357 38 4.99942
-d 358 38 4.99948
-d 359 38 4.99953
-d 360 38 4.99959
-d 361 38 4.99964
-d 1 39 4.49849
-d 2 39 4.53282
-d 3 39 4.58329
-d 4 39 4.66625
-d 5 39 4.83345
-d 6 39 4.97823
-d 7 39 5.0207
-d 8 39 5.01816
-d 9 39 5.01116
-d 10 39 5.00595
-d 11 39 5.00296
-d 12 39 5.00148
-d 13 39 5.00073
-d 14 39 5.00062
-d 15 39 5.00033
-d 16 39 5.0003
-d 17 39 4.99864
-d 18 39 4.99661
-d 19 39 4.99652
-d 20 39 4.99928
-d 21 39 5.00361
-d 22 39 5.12573
-d 23 39 5.17251
-d 24 39 5.22612
-d 25 39 5.33479
-d 26 39 5.44503
-d 27 39 5.44432
-d 28 39 5.44379
-d 29 39 5.44334
-d 30 39 5.443
-d 31 39 5.44276
-d 32 39 5.44258
-d 33 39 5.44246
-d 34 39 5.44238
-d 35 39 5.44232
-d 36 39 5.44228
-d 37 39 5.44225
-d 38 39 5.44223
-d 39 39 5.44221
-d 40 39 5.4422
-d 41 39 5.44219
-d 42 39 5.44219
-d 43 39 5.44218
-d 44 39 5.44218
-d 45 39 5.44218
-d 46 39 5.44218
-d 47 39 5.44217
-d 48 39 5.44217
-d 49 39 5.44217
-d 50 39 5.44217
-d 51 39 5.44217
-d 52 39 5.44217
-d 53 39 5.44217
-d 54 39 5.44217
-d 55 39 5.44217
-d 56 39 5.44217
-d 57 39 5.44217
-d 58 39 5.44217
-d 59 39 5.44217
-d 60 39 5.44217
-d 61 39 5.44217
-d 62 39 5.44217
-d 63 39 5.44217
-d 64 39 5.44217
-d 65 39 5.44217
-d 66 39 5.44217
-d 67 39 5.44216
-d 68 39 5.44216
-d 69 39 5.44216
-d 70 39 5.44216
-d 71 39 5.44216
-d 72 39 5.44216
-d 73 39 5.44216
-d 74 39 5.44216
-d 75 39 5.44216
-d 76 39 5.44216
-d 77 39 5.44216
-d 78 39 5.44216
-d 79 39 5.44216
-d 80 39 5.44216
-d 81 39 5.44216
-d 82 39 5.44216
-d 83 39 5.44216
-d 84 39 5.44216
-d 85 39 5.44216
-d 86 39 5.44215
-d 87 39 5.44215
-d 88 39 5.44215
-d 89 39 5.44215
-d 90 39 5.44215
-d 91 39 5.44215
-d 92 39 5.44215
-d 93 39 5.44215
-d 94 39 5.44215
-d 95 39 5.44215
-d 96 39 5.44215
-d 97 39 5.44215
-d 98 39 5.44215
-d 99 39 5.44215
-d 100 39 5.44215
-d 101 39 5.44215
-d 102 39 5.44215
-d 103 39 5.44215
-d 104 39 5.44215
-d 105 39 5.44215
-d 106 39 5.44215
-d 107 39 5.44215
-d 108 39 5.44215
-d 109 39 5.44215
-d 110 39 5.44214
-d 111 39 5.44214
-d 112 39 5.44214
-d 113 39 5.44214
-d 114 39 5.44214
-d 115 39 5.44214
-d 116 39 5.44214
-d 117 39 5.44214
-d 118 39 5.44214
-d 119 39 5.44214
-d 120 39 5.44214
-d 121 39 5.44212
-d 122 39 5.45159
-d 123 39 5.45236
-d 124 39 5.44064
-d 125 39 5.44307
-d 126 39 5.45616
-d 127 39 5.38122
-d 128 39 4.77163
-d 129 39 3.53297
-d 130 39 2.74466
-d 131 39 2.34448
-d 132 39 2.11802
-d 133 39 1.9783
-d 134 39 1.88656
-d 135 39 1.82001
-d 136 39 1.77389
-d 137 39 1.72955
-d 138 39 1.69632
-d 139 39 1.66971
-d 140 39 1.6526
-d 141 39 1.65236
-d 142 39 1.56034
-d 143 39 1.53764
-d 144 39 1.97139
-d 145 39 2.75096
-d 146 39 3.39212
-d 147 39 3.74042
-d 148 39 3.82345
-d 149 39 3.85696
-d 150 39 3.88547
-d 151 39 3.91862
-d 152 39 3.9585
-d 153 39 4.00467
-d 154 39 4.05903
-d 155 39 4.1254
-d 156 39 4.19533
-d 157 39 4.26791
-d 158 39 4.34517
-d 159 39 4.42112
-d 160 39 4.49238
-d 161 39 4.55807
-d 162 39 4.6179
-d 163 39 4.6713
-d 164 39 4.71815
-d 165 39 4.75889
-d 166 39 4.79418
-d 167 39 4.82456
-d 168 39 4.85062
-d 169 39 4.87291
-d 170 39 4.89196
-d 171 39 4.90823
-d 172 39 4.92209
-d 173 39 4.93388
-d 174 39 4.9439
-d 175 39 4.95242
-d 176 39 4.95968
-d 177 39 4.96585
-d 178 39 4.97108
-d 179 39 4.9755
-d 180 39 4.97923
-d 181 39 4.98237
-d 182 39 4.98503
-d 183 39 4.98732
-d 184 39 4.98927
-d 185 39 4.99094
-d 186 39 4.99233
-d 187 39 4.99353
-d 188 39 4.99452
-d 189 39 4.99538
-d 190 39 4.99608
-d 191 39 4.99668
-d 192 39 4.99718
-d 193 39 4.9976
-d 194 39 4.99794
-d 195 39 4.99822
-d 196 39 4.99847
-d 197 39 4.99867
-d 198 39 4.99884
-d 199 39 4.99899
-d 200 39 4.99913
-d 201 39 4.99924
-d 202 39 4.99932
-d 203 39 4.99938
-d 204 39 4.99943
-d 205 39 4.99947
-d 206 39 4.99951
-d 207 39 4.99953
-d 208 39 4.99955
-d 209 39 4.99958
-d 210 39 4.99961
-d 211 39 4.99964
-d 212 39 4.99967
-d 213 39 4.99969
-d 214 39 4.99972
-d 215 39 4.99975
-d 216 39 4.99977
-d 217 39 4.99978
-d 218 39 4.99979
-d 219 39 4.99981
-d 220 39 4.99982
-d 221 39 4.99983
-d 222 39 4.99985
-d 223 39 4.99986
-d 224 39 4.99986
-d 225 39 4.99987
-d 226 39 4.99987
-d 227 39 4.99988
-d 228 39 4.99988
-d 229 39 4.99988
-d 230 39 4.99989
-d 231 39 4.99989
-d 232 39 4.9999
-d 233 39 4.9999
-d 234 39 4.99991
-d 235 39 4.99991
-d 236 39 4.99992
-d 237 39 4.99992
-d 238 39 4.99993
-d 239 39 4.99993
-d 240 39 4.99993
-d 241 39 4.99994
-d 242 39 5.00381
-d 243 39 5.00064
-d 244 39 4.99246
-d 245 39 4.99823
-d 246 39 5.00349
-d 247 39 5.00076
-d 248 39 5.00033
-d 249 39 5.00015
-d 250 39 5.00009
-d 251 39 5.00007
-d 252 39 5.00005
-d 253 39 5.00004
-d 254 39 5.00003
-d 255 39 5.00002
-d 256 39 4.99988
-d 257 39 4.99732
-d 258 39 4.99728
-d 259 39 4.9978
-d 260 39 5.00187
-d 261 39 5.00927
-d 262 39 5.08712
-d 263 39 5.07654
-d 264 39 4.92855
-d 265 39 4.4863
-d 266 39 3.76162
-d 267 39 3.00049
-d 268 39 2.49834
-d 269 39 2.20883
-d 270 39 2.03492
-d 271 39 1.92384
-d 272 39 1.84676
-d 273 39 1.79021
-d 274 39 1.74716
-d 275 39 1.7132
-d 276 39 1.68576
-d 277 39 1.66309
-d 278 39 1.64406
-d 279 39 1.62785
-d 280 39 1.61383
-d 281 39 1.60162
-d 282 39 1.59081
-d 283 39 1.58117
-d 284 39 1.57253
-d 285 39 1.56473
-d 286 39 1.55765
-d 287 39 1.55117
-d 288 39 1.54527
-d 289 39 1.53988
-d 290 39 1.53485
-d 291 39 1.53012
-d 292 39 1.5257
-d 293 39 1.5216
-d 294 39 1.51773
-d 295 39 1.51411
-d 296 39 1.51071
-d 297 39 1.50746
-d 298 39 1.50438
-d 299 39 1.50146
-d 300 39 1.49868
-d 301 39 1.49603
-d 302 39 1.4935
-d 303 39 1.49109
-d 304 39 1.48878
-d 305 39 1.48657
-d 306 39 1.48445
-d 307 39 1.48242
-d 308 39 1.48046
-d 309 39 1.47858
-d 310 39 1.47677
-d 311 39 1.47502
-d 312 39 1.47333
-d 313 39 1.4717
-d 314 39 1.47012
-d 315 39 1.46859
-d 316 39 1.46711
-d 317 39 1.46568
-d 318 39 1.46428
-d 319 39 1.46292
-d 320 39 1.4616
-d 321 39 1.46034
-d 322 39 1.45923
-d 323 39 1.45812
-d 324 39 1.45701
-d 325 39 1.4559
-d 326 39 1.45479
-d 327 39 1.45378
-d 328 39 1.45279
-d 329 39 1.45181
-d 330 39 1.45082
-d 331 39 1.44983
-d 332 39 1.44893
-d 333 39 1.44813
-d 334 39 1.44732
-d 335 39 1.44652
-d 336 39 1.44571
-d 337 39 1.44491
-d 338 39 1.4441
-d 339 39 1.4433
-d 340 39 1.44249
-d 341 39 1.44169
-d 342 39 1.44089
-d 343 39 1.44019
-d 344 39 1.43951
-d 345 39 1.43883
-d 346 39 1.43815
-d 347 39 1.43747
-d 348 39 1.4368
-d 349 39 1.43612
-d 350 39 1.43544
-d 351 39 1.43476
-d 352 39 1.43408
-d 353 39 1.43342
-d 354 39 1.43283
-d 355 39 1.43223
-d 356 39 1.43163
-d 357 39 1.43104
-d 358 39 1.43044
-d 359 39 1.42984
-d 360 39 1.42924
-d 361 39 1.42865
-d 1 40 5.0
-d 2 40 5.01048
-d 3 40 5.01221
-d 4 40 4.98887
-d 5 40 4.76261
-d 6 40 4.54943
-d 7 40 4.51564
-d 8 40 4.56249
-d 9 40 4.62621
-d 10 40 4.68843
-d 11 40 4.74374
-d 12 40 4.79044
-d 13 40 4.82972
-d 14 40 4.86127
-d 15 40 4.88724
-d 16 40 4.90862
-d 17 40 4.90791
-d 18 40 4.89858
-d 19 40 4.89589
-d 20 40 4.91767
-d 21 40 5.00405
-d 22 40 5.16956
-d 23 40 5.12391
-d 24 40 4.7557
-d 25 40 3.87953
-d 26 40 3.01124
-d 27 40 2.48482
-d 28 40 2.20424
-d 29 40 2.03812
-d 30 40 1.92679
-d 31 40 1.84956
-d 32 40 1.79256
-d 33 40 1.74907
-d 34 40 1.71487
-d 35 40 1.68724
-d 36 40 1.6644
-d 37 40 1.64513
-d 38 40 1.6287
-d 39 40 1.61446
-d 40 40 1.60197
-d 41 40 1.59095
-d 42 40 1.58117
-d 43 40 1.57245
-d 44 40 1.5646
-d 45 40 1.55752
-d 46 40 1.55109
-d 47 40 1.54516
-d 48 40 1.53958
-d 49 40 1.53444
-d 50 40 1.53008
-d 51 40 1.52606
-d 52 40 1.52205
-d 53 40 1.51843
-d 54 40 1.5149
-d 55 40 1.51146
-d 56 40 1.50893
-d 57 40 1.50639
-d 58 40 1.50387
-d 59 40 1.50133
-d 60 40 1.4988
-d 61 40 1.49651
-d 62 40 1.49436
-d 63 40 1.49222
-d 64 40 1.49007
-d 65 40 1.48793
-d 66 40 1.48585
-d 67 40 1.48433
-d 68 40 1.4828
-d 69 40 1.48128
-d 70 40 1.47975
-d 71 40 1.47823
-d 72 40 1.4767
-d 73 40 1.47518
-d 74 40 1.47365
-d 75 40 1.47213
-d 76 40 1.4706
-d 77 40 1.46912
-d 78 40 1.46795
-d 79 40 1.46678
-d 80 40 1.46561
-d 81 40 1.46444
-d 82 40 1.46327
-d 83 40 1.4621
-d 84 40 1.46093
-d 85 40 1.45976
-d 86 40 1.45859
-d 87 40 1.45741
-d 88 40 1.45628
-d 89 40 1.45534
-d 90 40 1.45441
-d 91 40 1.45347
-d 92 40 1.45254
-d 93 40 1.4516
-d 94 40 1.45067
-d 95 40 1.44973
-d 96 40 1.4488
-d 97 40 1.44786
-d 98 40 1.44693
-d 99 40 1.44604
-d 100 40 1.44539
-d 101 40 1.44475
-d 102 40 1.4441
-d 103 40 1.44345
-d 104 40 1.44281
-d 105 40 1.44216
-d 106 40 1.44151
-d 107 40 1.44086
-d 108 40 1.44022
-d 109 40 1.43957
-d 110 40 1.43892
-d 111 40 1.43828
-d 112 40 1.43763
-d 113 40 1.43698
-d 114 40 1.43633
-d 115 40 1.43569
-d 116 40 1.43504
-d 117 40 1.43439
-d 118 40 1.43375
-d 119 40 1.4331
-d 120 40 1.43245
-d 121 40 1.4318
-d 122 40 1.43157
-d 123 40 1.43089
-d 124 40 1.43001
-d 125 40 1.43042
-d 126 40 1.42899
-d 127 40 1.42439
-d 128 40 1.42216
-d 129 40 1.43447
-d 130 40 1.44048
-d 131 40 1.43705
-d 132 40 1.43314
-d 133 40 1.43039
-d 134 40 1.42861
-d 135 40 1.42739
-d 136 40 1.42651
-d 137 40 1.42548
-d 138 40 1.42488
-d 139 40 1.4243
-d 140 40 1.42392
-d 141 40 1.4235
-d 142 40 1.32443
-d 143 40 1.31149
-d 144 40 1.78169
-d 145 40 2.64844
-d 146 40 3.43211
-d 147 40 3.95252
-d 148 40 4.20231
-d 149 40 4.3746
-d 150 40 4.49948
-d 151 40 4.58929
-d 152 40 4.65742
-d 153 40 4.71183
-d 154 40 4.77057
-d 155 40 4.83196
-d 156 40 4.88354
-d 157 40 4.92894
-d 158 40 4.96625
-d 159 40 4.99235
-d 160 40 5.00651
-d 161 40 5.00941
-d 162 40 5.00813
-d 163 40 5.00689
-d 164 40 5.00588
-d 165 40 5.00504
-d 166 40 5.00431
-d 167 40 5.00368
-d 168 40 5.00314
-d 169 40 5.00268
-d 170 40 5.00228
-d 171 40 5.00194
-d 172 40 5.00165
-d 173 40 5.0014
-d 174 40 5.00118
-d 175 40 5.001
-d 176 40 5.00085
-d 177 40 5.00072
-d 178 40 5.00061
-d 179 40 5.00052
-d 180 40 5.00044
-d 181 40 5.00037
-d 182 40 5.00031
-d 183 40 5.00027
-d 184 40 5.00022
-d 185 40 5.00019
-d 186 40 5.00016
-d 187 40 5.00013
-d 188 40 5.00011
-d 189 40 5.00009
-d 190 40 5.00008
-d 191 40 5.00007
-d 192 40 5.00006
-d 193 40 5.00005
-d 194 40 5.00004
-d 195 40 5.00003
-d 196 40 5.00003
-d 197 40 5.00003
-d 198 40 5.00002
-d 199 40 5.00002
-d 200 40 5.00002
-d 201 40 5.00001
-d 202 40 5.00001
-d 203 40 5.00001
-d 204 40 5.00001
-d 205 40 5.00001
-d 206 40 5.00001
-d 207 40 5.00001
-d 208 40 5.00001
-d 209 40 5.00001
-d 210 40 5.00001
-d 211 40 5.00001
-d 212 40 5.00001
-d 213 40 5.0
-d 214 40 5.0
-d 215 40 5.0
-d 216 40 5.0
-d 217 40 5.0
-d 218 40 4.99999
-d 219 40 4.99999
-d 220 40 4.99999
-d 221 40 4.99998
-d 222 40 4.99998
-d 223 40 4.99998
-d 224 40 4.99998
-d 225 40 4.99998
-d 226 40 4.99998
-d 227 40 4.99998
-d 228 40 4.99999
-d 229 40 4.99999
-d 230 40 4.99999
-d 231 40 4.99999
-d 232 40 4.99999
-d 233 40 4.99999
-d 234 40 5.0
-d 235 40 5.0
-d 236 40 5.0
-d 237 40 5.0
-d 238 40 5.00001
-d 239 40 5.00002
-d 240 40 5.00003
-d 241 40 5.00004
-d 242 40 5.00022
-d 243 40 4.99974
-d 244 40 4.99942
-d 245 40 4.99997
-d 246 40 5.00063
-d 247 40 5.00002
-d 248 40 5.00003
-d 249 40 4.99994
-d 250 40 4.99998
-d 251 40 4.99999
-d 252 40 5.0
-d 253 40 5.0
-d 254 40 5.0
-d 255 40 5.0
-d 256 40 5.0
-d 257 40 4.99981
-d 258 40 4.99998
-d 259 40 5.00004
-d 260 40 5.00036
-d 261 40 5.00049
-d 262 40 5.12012
-d 263 40 5.16315
-d 264 40 5.19712
-d 265 40 5.21835
-d 266 40 4.87874
-d 267 40 4.10151
-d 268 40 3.31555
-d 269 40 2.74207
-d 270 40 2.38075
-d 271 40 2.15872
-d 272 40 2.01614
-d 273 40 1.91886
-d 274 40 1.84852
-d 275 40 1.79401
-d 276 40 1.75052
-d 277 40 1.71508
-d 278 40 1.68672
-d 279 40 1.66467
-d 280 40 1.64602
-d 281 40 1.62985
-d 282 40 1.61576
-d 283 40 1.60343
-d 284 40 1.59256
-d 285 40 1.58287
-d 286 40 1.57418
-d 287 40 1.56632
-d 288 40 1.55922
-d 289 40 1.55282
-d 290 40 1.54687
-d 291 40 1.54132
-d 292 40 1.53618
-d 293 40 1.53143
-d 294 40 1.52698
-d 295 40 1.52282
-d 296 40 1.51895
-d 297 40 1.51527
-d 298 40 1.5118
-d 299 40 1.50851
-d 300 40 1.5054
-d 301 40 1.50244
-d 302 40 1.49963
-d 303 40 1.49695
-d 304 40 1.4944
-d 305 40 1.49196
-d 306 40 1.48963
-d 307 40 1.4874
-d 308 40 1.48527
-d 309 40 1.48322
-d 310 40 1.48124
-d 311 40 1.47934
-d 312 40 1.47751
-d 313 40 1.47574
-d 314 40 1.47403
-d 315 40 1.47239
-d 316 40 1.4708
-d 317 40 1.46926
-d 318 40 1.46777
-d 319 40 1.46632
-d 320 40 1.46491
-d 321 40 1.46355
-d 322 40 1.46237
-d 323 40 1.4612
-d 324 40 1.46002
-d 325 40 1.45884
-d 326 40 1.45766
-d 327 40 1.45659
-d 328 40 1.45555
-d 329 40 1.45451
-d 330 40 1.45346
-d 331 40 1.45242
-d 332 40 1.45147
-d 333 40 1.45062
-d 334 40 1.44978
-d 335 40 1.44894
-d 336 40 1.44809
-d 337 40 1.44725
-d 338 40 1.4464
-d 339 40 1.44556
-d 340 40 1.44472
-d 341 40 1.44387
-d 342 40 1.44303
-d 343 40 1.4423
-d 344 40 1.44159
-d 345 40 1.44088
-d 346 40 1.44017
-d 347 40 1.43947
-d 348 40 1.43876
-d 349 40 1.43805
-d 350 40 1.43734
-d 351 40 1.43664
-d 352 40 1.43593
-d 353 40 1.43524
-d 354 40 1.43462
-d 355 40 1.434
-d 356 40 1.43338
-d 357 40 1.43276
-d 358 40 1.43213
-d 359 40 1.43151
-d 360 40 1.43089
-d 361 40 1.43027
diff --git a/blt3.0.1/demos/graph4a.tcl b/blt3.0.1/demos/graph4a.tcl
deleted file mode 100644
index 5f30e49..0000000
--- a/blt3.0.1/demos/graph4a.tcl
+++ /dev/null
@@ -1,232 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-set tcl_precision 15
-
-set graph .graph
-image create picture bgTexture -file ./images/chalk.gif
-
-option add *default normal
-option add *Button.tile bgTexture
-
-option add *Htext.font "Times 18 bold"
-option add *Text.font "Times 18 bold"
-option add *header.font "Times 12"
-option add *footer.font "Times 18"
-option add *Graph.relief raised
-#option add *Graph.borderWidth 2
-#option add *Graph.Legend.activeBackground white
-option add *Graph.height 5i
-option add *Graph.plotBackground black
-option add *Graph.width 7i
-option add *Graph.tile bgTexture
-option add *Graph.halo 0
-
-option add *Graph.title "s27.out"
-
-option add *Axis.titleColor red2
-option add *x.title "Time"
-option add *y.title "Signals"
-
-option add *Crosshairs.Color white
-
-option add *activeLine.Fill navyblue
-option add *activeLine.LineWidth 2
-option add *Element.ScaleSymbols yes
-option add *Element.Smooth natural
-
-option add *Symbol square
-option add *Element.LineWidth 1
-option add *Pen.LineWidth 1
-option add *Pixels 1
-
-option add *Grid.color grey50
-option add *Grid.dashes "2 4"
-option add *Grid.hide no
-
-option add *Legend.ActiveRelief sunken
-option add *Legend.Position right
-option add *Legend.Relief flat
-option add *Legend.font "Helvetica 6"
-option add *Legend.Pad 0
-option add *Legend.hide no
-
-option add *LineMarker.Dashes 5
-option add *LineMarker.Foreground white
-option add *zoomOutline.outline yellow
-
-option add *TextMarker.Background {}
-option add *TextMarker.Foreground white
-
-set table [blt::datatable create]
-$table restore -file graph4a.tab
-
-set attributes {
- V1 v1 red red
- V2 v2 green red
- V3 v3 blue red
- V4 v4 yellow red
- V5 v5 magenta red
- V6 v6 cyan red
- V7 v7 white red
- V8 v8 red green
- V9 v9 green green
- V10 v10 blue green
- V11 v11 yellow green
- V12 v12 magenta green
- V13 v13 cyan green
- V14 v14 red red
- V15 v15 green red
- V16 v16 blue red
- V17 v17 yellow red
- V18 v18 magenta red
- V19 v19 cyan red
- V20 v20 white red
- V21 v21 red green
- V22 v22 green green
- V23 v23 blue green
- V24 v24 yellow green
- V25 v25 magenta green
- V26 v26 cyan green
- V27 v27 red red
- V28 v28 green red
- V29 v29 blue red
- V30 v30 yellow red
- V31 v31 magenta red
- V32 v32 cyan red
- V33 v33 white red
- V34 v34 red green
- V35 v35 green green
- V36 v36 blue green
- V37 v37 yellow green
- V38 v38 magenta green
- V39 v39 cyan green
-}
-
-text .header -wrap word -width 0 -height 6
-
-set text {
-To zoom in on a region of the graph, simply click once on the left
-mouse button to pick one corner of the area to be zoomed. Move the
-mouse to the other corner and click again.
-}
-
-regsub -all "\n" $text "" text
-.header insert end "$text\n"
-.header insert end { You can click on the }
-set im [image create picture -file ./images/qv100.t.gif]
-button .header.snap -image $im -command { MakeSnapshot }
-.header window create end -window .header.snap
-.header insert end { button to see a picture image snapshot.}
-.header configure -state disabled
-blt::graph $graph
-
-blt::htext .footer -text {Hit the %%
- set im [image create picture -file ./images/stopsign.gif]
- button $htext(widget).quit -image $im -command { exit }
- $htext(widget) append $htext(widget).quit
-%% button when you've seen enough. %%
- label $htext(widget).logo -bitmap BLT
- $htext(widget) append $htext(widget).logo
-%%}
-
-foreach {label yData outline color} $attributes {
- set xx [list $table "x"]
- set yy [list $table $yData]
- .graph element create $label -x $xx -y $yy -outline $outline -color $color
-}
-
-set unique 0
-
-proc Sharpen { photo } {
- set kernel { -1 -1 -1 -1 16 -1 -1 -1 -1 }
- #set kernel { 0 -1 0 -1 4.9 -1 0 -1 0 }
- blt::winop convolve $photo $photo $kernel
-}
-
-proc MakeSnapshot {} {
- update idletasks
- global unique
- set top ".snapshot[incr unique]"
- set im1 [image create picture]
- .graph snap $im1
- set width 210
- set height 150
- set thumb1 [image create picture -width $width -height $height -gamma 2.2]
- $thumb1 resize $im1 -filter sinc
- image delete $im1
-
- set thumb2 [image create picture -window .graph -width $width \
- -height $height -filter sinc -gamma 2.2 -aspect yes]
-
- toplevel $top
- wm title $top "Snapshot \#$unique of \"[.graph cget -title]\""
- label $top.l1 -image $thumb1
- label $top.l2 -image $thumb2
-
- button $top.but -text "Dismiss" -command "DestroySnapshot $top"
- blt::table $top \
- 0,0 $top.l1 \
- 0,1 $top.l2 \
- 1,0 $top.but -pady 4
- focus $top.but
-}
-
-proc DestroySnapshot { win } {
- set im [$win.l1 cget -image]
- $im export jpg -file test.jpg
- image delete $im
- destroy $win
-}
-
-blt::table . \
- .header 0,0 -fill x \
- .graph 1,0 -fill both \
- .footer 2,0 -fill x
-
-blt::table configure . r0 r2 -resize none
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-#Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
-Blt_PrintKey $graph
-
-$graph element bind all <Enter> {
- %W legend activate [%W element get current]
-}
-
-$graph element bind all <Leave> {
- %W legend deactivate [%W element get current]
-}
-
-if 0 {
-$table column extend "x"
-$table import vector "x" 1
-$table column type "x" double
-set col 1
-foreach vector [lsort -dictionary [blt::vector names ::v*]] {
- set name [string trim $vector ::]
- $table column extend $name
- $table column type $name double
- incr col
- $table import vector $vector $col
-}
-
-$table dump -file graph4.tab
-}
-
-blt::LegendSelections $graph
-focus $graph
-toplevel .top
-update
-$graph legend configure \
- -exportselection yes \
- -selectbackground lightblue4 \
- -selectforeground white \
- -position .top.legend
-pack .top.legend -fill both -expand yes
-#-nofocusselectbackground grey90
-# -nofocusselectforeground white
diff --git a/blt3.0.1/demos/graph5.tcl b/blt3.0.1/demos/graph5.tcl
deleted file mode 100755
index d8a0d41..0000000
--- a/blt3.0.1/demos/graph5.tcl
+++ /dev/null
@@ -1,66 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-option add *Element.ScaleSymbols true
-option add *Axis.loose true
-option add *Pixels .8c
-option add *Element.lineWidth 0
-option add *Legend.ActiveRelief raised
-option add *Legend.padY 0
-option add *Button*Font { Arial 14 } widgetDefault
-option add *Legend*Font { Arial 14 bold } widgetDefault
-option add *Graph.Font { Arial 18 bold } widgetDefault
-option add *Graph.title "Element Symbol Types"
-option add *Graph.width 8i
-option add *Graph.height 6i
-option add *Graph.plotPadY .25i
-option add *Graph.plotPadX .25i
-
-set graph .graph
-
-blt::graph $graph
-
-blt::vector x -variable ""
-x set { 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 }
-
-for { set i 0 } { $i < 11 } { incr i } {
- set vecName "y${i}"
- blt::vector ${vecName}
- $vecName length 11
- $vecName variable y
- set y(:) [expr $i*100.0]
-}
-
-set attributes {
- none "None" red red4 y0
- arrow "Arrow" brown brown4 y10
- circle "Circle" yellow yellow4 y2
- cross "Cross" cyan cyan4 y6
- diamond "Diamond" green green4 y3
- plus "Plus" magenta magenta4 y9
- splus "Splus" Purple purple4 y7
- scross "Scross" red red4 y8
- square "Square" orange orange4 y1
- triangle "Triangle" blue blue4 y4
- "@bitmaps/hobbes.xbm @bitmaps/hobbes_mask.xbm"
- "Bitmap" yellow black y5
-}
-
-set count 0
-foreach {symbol label fill color yVec} $attributes {
- $graph element create line${count} \
- -label $label -symbol $symbol -color $color -fill $fill -x x -y $yVec
- incr count
-}
-$graph element configure line0 -dashes { 2 4 2 } -linewidth 2
-button .quit -text Quit -command exit
-blt::table . \
- $graph 0,0 -fill both \
- .quit 1,0 -fill x
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
-Blt_PrintKey $graph
diff --git a/blt3.0.1/demos/graph6.tcl b/blt3.0.1/demos/graph6.tcl
deleted file mode 100755
index f22e4d5..0000000
--- a/blt3.0.1/demos/graph6.tcl
+++ /dev/null
@@ -1,2320 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-set tcl_precision 15
-
-set graph .graph
-
-option add *Graph.Width 10i
-option add *Graph.leftMargin .75i
-option add *Graph.Height 6i
-option add *Graph.plotBackground black
-
-option add *LineMarker.color white
-option add *LineMarker.Dashes 5
-option add *TextMarker.foreground white
-option add *TextMarker.Background {}
-
-option add *Graph.x.hide yes
-option add *Graph.x.title ""
-option add *Graph.y.rotate 90
-#option add *Graph.y.stepSize 2.0
-option add *Graph.title ""
-option add *graph.Title "Example s27"
-option add *graph.x.hide no
-option add *graph.topMargin 0
-option add *graph.bottomMargin 0
-option add *x.Title Time
-option add *y.Title Signals
-option add *Pixels 1
-
-option add *Reduce 0.5
-option add *bufferElements no
-
-option add *Element.color green4
-option add *Element.ScaleSymbols true
-option add *Element.Color grey70
-option add *Element.Symbol none
-option add *Element.LineWidth 1
-#option add *Element.Smooth natural
-option add *Element.Smooth catrom
-
-option add *activeLine.LineWidth 2
-option add *activeLine.Color white
-option add *activeLine.Color green1
-
-#option add *Legend.Hide yes
-option add *Legend.Position right
-option add *Legend.Relief flat
-option add *Legend.activeRelief sunken
-option add *Legend.borderWidth 2
-option add *Legend.Font -*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*
-option add *Grid.hide no
-option add *Grid.dashes "1 5"
-
-#option add *foreground white
-option add *zoomOutline.outline yellow
-
-blt::graph .graph
-
-blt::vector x -variable ""
-for { set i 1 } { $i <= 39 } { incr i } {
- blt::vector create v${i} -variable ""
-}
-
-x set {
- 0 1e-10 2e-10 3e-10 4e-10 5e-10 6e-10 7e-10 8e-10 9e-10
- 1e-09 1.1e-09 1.2e-09 1.3e-09 1.4e-09 1.5e-09 1.6e-09 1.7e-09
- 1.8e-09 1.9e-09 2e-09 2.1e-09 2.2e-09 2.3e-09 2.4e-09 2.5e-09
- 2.6e-09 2.7e-09 2.8e-09 2.9e-09 3e-09 3.1e-09 3.2e-09 3.3e-09
- 3.4e-09 3.5e-09 3.6e-09 3.7e-09 3.8e-09 3.9e-09 4e-09 4.1e-09
- 4.2e-09 4.3e-09 4.4e-09 4.5e-09 4.6e-09 4.7e-09 4.8e-09
- 4.9e-09 5e-09 5.1e-09 5.2e-09 5.3e-09 5.4e-09 5.5e-09 5.6e-09
- 5.7e-09 5.8e-09 5.9e-09 6e-09 6.1e-09 6.2e-09 6.3e-09 6.4e-09
- 6.5e-09 6.6e-09 6.7e-09 6.8e-09 6.9e-09 7e-09 7.1e-09 7.2e-09
- 7.3e-09 7.4e-09 7.5e-09 7.6e-09 7.7e-09 7.8e-09 7.9e-09
- 8e-09 8.1e-09 8.2e-09 8.3e-09 8.4e-09 8.5e-09 8.6e-09 8.7e-09
- 8.8e-09 8.9e-09 9e-09 9.1e-09 9.2e-09 9.3e-09 9.4e-09 9.5e-09
- 9.6e-09 9.7e-09 9.8e-09 9.9e-09 1e-08 1.01e-08 1.02e-08
- 1.03e-08 1.04e-08 1.05e-08 1.06e-08 1.07e-08 1.08e-08 1.09e-08
- 1.1e-08 1.11e-08 1.12e-08 1.13e-08 1.14e-08 1.15e-08 1.16e-08
- 1.17e-08 1.18e-08 1.19e-08 1.2e-08 1.21e-08 1.22e-08 1.23e-08
- 1.24e-08 1.25e-08 1.26e-08 1.27e-08 1.28e-08 1.29e-08 1.3e-08
- 1.31e-08 1.32e-08 1.33e-08 1.34e-08 1.35e-08 1.36e-08 1.37e-08
- 1.38e-08 1.39e-08 1.4e-08 1.41e-08 1.42e-08 1.43e-08 1.44e-08
- 1.45e-08 1.46e-08 1.47e-08 1.48e-08 1.49e-08 1.5e-08 1.51e-08
- 1.52e-08 1.53e-08 1.54e-08 1.55e-08 1.56e-08 1.57e-08 1.58e-08
- 1.59e-08 1.6e-08 1.61e-08 1.62e-08 1.63e-08 1.64e-08 1.65e-08
- 1.66e-08 1.67e-08 1.68e-08 1.69e-08 1.7e-08 1.71e-08 1.72e-08
- 1.73e-08 1.74e-08 1.75e-08 1.76e-08 1.77e-08 1.78e-08 1.79e-08
- 1.8e-08 1.81e-08 1.82e-08 1.83e-08 1.84e-08 1.85e-08 1.86e-08
- 1.87e-08 1.88e-08 1.89e-08 1.9e-08 1.91e-08 1.92e-08 1.93e-08
- 1.94e-08 1.95e-08 1.96e-08 1.97e-08 1.98e-08 1.99e-08 2e-08
- 2.01e-08 2.02e-08 2.03e-08 2.04e-08 2.05e-08 2.06e-08 2.07e-08
- 2.08e-08 2.09e-08 2.1e-08 2.11e-08 2.12e-08 2.13e-08 2.14e-08
- 2.15e-08 2.16e-08 2.17e-08 2.18e-08 2.19e-08 2.2e-08 2.21e-08
- 2.22e-08 2.23e-08 2.24e-08 2.25e-08 2.26e-08 2.27e-08 2.28e-08
- 2.29e-08 2.3e-08 2.31e-08 2.32e-08 2.33e-08 2.34e-08 2.35e-08
- 2.36e-08 2.37e-08 2.38e-08 2.39e-08 2.4e-08 2.41e-08 2.42e-08
- 2.43e-08 2.44e-08 2.45e-08 2.46e-08 2.47e-08 2.48e-08 2.49e-08
- 2.5e-08 2.51e-08 2.52e-08 2.53e-08 2.54e-08 2.55e-08 2.56e-08
- 2.57e-08 2.58e-08 2.59e-08 2.6e-08 2.61e-08 2.62e-08 2.63e-08
- 2.64e-08 2.65e-08 2.66e-08 2.67e-08 2.68e-08 2.69e-08 2.7e-08
- 2.71e-08 2.72e-08 2.73e-08 2.74e-08 2.75e-08 2.76e-08 2.77e-08
- 2.78e-08 2.79e-08 2.8e-08 2.81e-08 2.82e-08 2.83e-08 2.84e-08
- 2.85e-08 2.86e-08 2.87e-08 2.88e-08 2.89e-08 2.9e-08 2.91e-08
- 2.92e-08 2.93e-08 2.94e-08 2.95e-08 2.96e-08 2.97e-08 2.98e-08
- 2.99e-08 3e-08 3.01e-08 3.02e-08 3.03e-08 3.04e-08 3.05e-08
- 3.06e-08 3.07e-08 3.08e-08 3.09e-08 3.1e-08 3.11e-08 3.12e-08
- 3.13e-08 3.14e-08 3.15e-08 3.16e-08 3.17e-08 3.18e-08 3.19e-08
- 3.2e-08 3.21e-08 3.22e-08 3.23e-08 3.24e-08 3.25e-08 3.26e-08
- 3.27e-08 3.28e-08 3.29e-08 3.3e-08 3.31e-08 3.32e-08 3.33e-08
- 3.34e-08 3.35e-08 3.36e-08 3.37e-08 3.38e-08 3.39e-08 3.4e-08
- 3.41e-08 3.42e-08 3.43e-08 3.44e-08 3.45e-08 3.46e-08 3.47e-08
- 3.48e-08 3.49e-08 3.5e-08 3.51e-08 3.52e-08 3.53e-08 3.54e-08
- 3.55e-08 3.56e-08 3.57e-08 3.58e-08 3.59e-08 3.6e-08
-}
-
-wm min . 0 0
-
-v1 set {
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
-}
-
-.graph element create V1 -x x -y v1
-
-v2 set {
- 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1
- 5.32907e-15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5
- 5 5 5 5 5 5 5 5 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0
-}
-
-.graph element create V2 -x x -y v2
-
-v3 set {
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 8.88178e-16
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 2.13718e-14 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0
-}
-
-.graph element create V3 -x x -y v3
-
-v4 set {
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
-}
-
-.graph element create V4 -x x -y v4
-
-v5 set {
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
-}
-
-.graph element create V5 -x x -y v5
-v6 set {
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 8.88178e-16
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 1 2 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 2.13718e-14 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0
-}
-.graph element create V6 -x x -y v6
-v7 set {
- 5 5.16904 4.84159 3.34542 0.317102 0.103304 0.0275721 0.0221534
- 0.017689 0.0142639 0.0113974 0.00918238 0.00742541 0.00616602
- 0.00481195 0.00397049 -0.0659889 -0.025671 0.165495 0.986891
- 3.05229 4.55511 4.91611 4.98192 4.99428 4.99833 4.99095
- 4.97295 4.95493 4.93428 4.90723 4.94799 4.98584 4.99566
- 4.99813 4.99907 4.99947 4.99965 4.99976 4.99984 4.99989
- 4.99992 4.99994 4.99996 4.99998 5.00002 5.00006 5.00002
- 4.99996 4.99994 4.99999 5.00003 5.00002 5 4.99997 4.99997
- 4.99997 4.99997 4.99997 4.99996 4.99997 4.99997 4.99998
- 4.99998 4.99999 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99998 4.99998 4.99998 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5.16575
- 4.69986 2.43862 0.0230224 0.035229 -0.0210607 -0.0292766
- -0.0172693 -0.00271479 -0.000912251 -0.000349106 -0.000116866
- -4.24733e-05 -1.39536e-05 -3.01179e-05 -0.0657192 -0.0204835
- 0.183378 1.07181 3.118 4.46472 4.84158 4.94795 4.98173 4.99236
- 4.99762 5.01939 5.0433 5.05332 5.04959 5.03955 5.02851 5.02052
- 5.01422 5.00965 5.00631 5.00405 5.00248 5.00083 5.00012
- 5.00209 5.00387 5.00347 4.99917 4.99213 4.98411 4.97521
- 4.96332 4.94601 4.9304 4.94633 4.97936 4.99264 4.99685 4.99857
- 4.99925 4.99954 4.9997 4.99973 4.9997 4.99973 4.99979 4.99983
- 4.99986 4.99988 4.9999 4.9999 4.99992 4.99993 4.99994 4.99995
- 4.99996 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002
- 5.00002 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 5 5 5.14242 4.76101 3.16003 0.299374
- 0.0645506 -0.000498424 -2.45108e-05 -2.27986e-05 -5.24401e-05
- -4.9884e-05 -4.92491e-05 -2.93354e-05 -3.21402e-05 -2.11851e-05
- -3.37925e-05 -0.0657892 -0.020563 0.182582 1.06058 3.12484
- 4.46552 4.84146 4.95102 4.98556 4.99472 4.99806 4.99909
- 4.99955 4.99976 4.99994 4.99992 5.00029 4.99967 4.99849
- 4.99736 4.99884 5.00099 5.00377 5.00215 4.99994 4.99893
- 4.99788 4.99862 5.00055 5.00134 5.00127 5.00073 5.00039
- 5.00018 5.00006 5.00001 4.99985 5.00026 5.00018 5.00003
- 4.99981 4.99985 4.99987 4.99985 4.99982 4.99982 4.99982
- 4.99983 4.99985 4.99987 4.99989 4.99991 4.99992 4.99994
- 4.99995 4.99995 4.99994 4.99994 4.99996 4.99999 5.00002
- 5.00008 5.00009 5.00006 5.00001 5 4.99999 4.99998 4.99997
- 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999 4.99999
- 4.99999 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99998 4.99998
- 4.99998
-}
-
-.graph element create V7 -x x -y v7
-
-v8 set {
- 5 5.03758 5.04711 4.96911 4.20882 3.96295 4.01117 4.15521
- 4.2967 4.42274 4.5295 4.6176 4.69014 4.74831 4.7966 4.83537
- 4.80526 4.787 4.79295 4.88588 5.08978 5.15615 5.10778 5.07718
- 5.06652 5.08225 4.9744 4.52977 3.77452 2.69426 1.15294 0.245509
- 0.0981544 0.0567527 0.0367487 0.0252578 0.0180599 0.0133837
- 0.0101497 0.0078616 0.00620186 0.00499056 0.0041027 0.00344223
- 0.00295808 0.00260089 0.00229887 0.00200817 0.00176397 0.00160116
- 0.00147381 0.00134645 0.00125029 0.00116043 0.00107371 0.00101981
- 0.000965921 0.000912028 0.000858135 0.000804242 0.000761669
- 0.00072672 0.000691771 0.000656823 0.000621874 0.000588722
- 0.00057041 0.000552098 0.000533785 0.000515473 0.000497162
- 0.00047885 0.000460537 0.000442226 0.000423914 0.000405601
- 0.000388399 0.000378694 0.000368989 0.000359284 0.00034958
- 0.000339875 0.00033017 0.000320465 0.00031076 0.000301055
- 0.00029135 0.000282207 0.000276247 0.000270287 0.000264327
- 0.000258367 0.000252407 0.000246447 0.000240487 0.000234527
- 0.000228567 0.000222607 0.000217086 0.000213696 0.000210307
- 0.000206918 0.000203528 0.000200139 0.00019675 0.00019336
- 0.000189971 0.000186582 0.000183192 0.000179803 0.000176414
- 0.000173025 0.000169635 0.000166246 0.000162857 0.000159467
- 0.000156078 0.000152689 0.000149299 0.00014591 0.00014255
- 0.0316021 0.163272 0.348732 0.603651 0.35745 0.135965 0.0707354
- 0.0314595 0.0201047 0.00994945 0.00389601 0.00138839 0.00060778
- 0.000329648 0.000492396 -0.0732035 -0.0844077 -0.0789062
- -0.0390837 0.0197559 0.0183094 -0.00180099 -0.0189565 -0.0424144
- -0.0735904 -0.0892423 0.285039 1.13702 2.10809 2.95826 3.60164
- 4.0435 4.35771 4.57254 4.71769 4.81329 4.87534 4.91487 4.94264
- 4.97375 5.01526 5.06517 5.10154 5.06259 4.89005 4.5787 4.12226
- 3.46151 2.49023 1.2586 0.32725 0.116753 0.0701865 0.0455509
- 0.0286914 0.0178176 0.0117599 0.00902715 0.00760583 0.00637745
- 0.00543811 0.00439377 0.00352448 0.0030151 0.00285771 0.002465
- 0.00203114 0.00173004 0.0014839 0.00125177 0.00105327 0.000894905
- 0.000766372 0.000658894 0.000569105 0.000492114 0.000427938
- 0.000370217 0.000314758 0.000266569 0.000233726 0.000209048
- 0.000191957 0.000177169 0.000166604 0.000161 0.000157314
- 0.000143828 0.000130342 0.000116857 0.000103371 8.98855e-05
- 7.63998e-05 6.29141e-05 5.76583e-05 5.30027e-05 4.8347e-05
- 4.36913e-05 3.90357e-05 3.438e-05 2.97243e-05 2.72507e-05
- 2.59083e-05 2.45659e-05 2.32235e-05 2.18811e-05 2.05387e-05
- 1.91963e-05 1.78539e-05 1.65115e-05 1.51691e-05 1.38267e-05
- 1.24843e-05 1.11419e-05 9.79954e-06 8.51574e-06 7.69807e-06
- 6.8804e-06 6.06273e-06 5.24506e-06 0.0287318 0.0317111 -0.0320087
- -0.103609 0.0369639 0.0121128 0.00961197 0.00934971 0.00820853
- 0.00699769 0.00607002 0.00535541 0.00476552 0.00427601 0.00376357
- -0.073012 -0.0866964 -0.0809538 -0.038005 0.0277001 0.0188906
- 0.00614597 0.00373629 0.00489787 0.0146573 0.0191052 0.0151708
- 0.0124224 0.0105859 0.00879272 0.00729464 0.0070047 0.00449575
- -0.00626652 -0.0252417 -0.0147287 0.022538 0.0822905 0.0947372
- 0.0657516 0.0445506 0.0316753 0.0220971 0.0158101 0.0140971
- 0.0161498 0.0139876 0.0122447 0.0106994 0.009397 0.00822236
- 0.00686509 0.00797431 0.00751269 0.00671173 0.00595243 0.00524633
- 0.00459528 0.00401688 0.00350109 0.00303954 0.00260569 0.00222792
- 0.00191033 0.00163917 0.00140949 0.00121464 0.0010471 0.000900638
- 0.000768847 0.000645236 0.000524807 0.000460275 0.000442237
- 0.000446775 0.000397026 0.000301585 0.000228994 0.000190894
- 0.000166569 0.000152261 0.000137953 0.000123644 0.000109336
- 9.50281e-05 8.56557e-05 7.78437e-05 7.00318e-05 6.22198e-05
- 5.44079e-05 4.87539e-05 4.57761e-05 4.27982e-05 3.98203e-05
- 3.68425e-05 3.38646e-05 3.08868e-05 2.79089e-05 2.4931e-05
- 2.19532e-05 1.89753e-05 1.75244e-05 1.64095e-05 1.52946e-05
- 1.41797e-05 1.30648e-05 1.19499e-05 1.0835e-05 9.72011e-06
- 8.60521e-06 7.4903e-06 6.5117e-06 6.10334e-06 5.69497e-06
- 5.2866e-06 4.87824e-06 4.46987e-06 4.06151e-06 3.65314e-06
- 3.24477e-06
-}
-
-.graph element create V8 -x x -y v8
-
-v9 set {
- 1.86175 1.99708 2.07867 2.01211 2.43309 3.27194 3.63896
- 3.90426 4.11074 4.27932 4.41496 4.52543 4.61491 4.68862
- 4.7479 4.79666 4.72895 4.68886 4.70354 4.81353 5.01568 5.14184
- 5.10482 5.07362 5.05143 5.03638 5.02323 5.01465 5.00853
- 5.00383 4.99985 5.00454 5.00652 5.00546 5.00411 5.003 5.00214
- 5.00151 5.00106 5.00073 5.0005 5.00034 5.00023 5.00015 5.0001
- 5.00005 5 5.00001 5.00005 5.00005 5.00003 5 4.99998 4.99996
- 4.99994 4.99995 4.99997 4.99998 5 5.00001 5.00002 5.00002
- 5.00003 5.00003 5.00003 5.00003 5.00003 5.00003 5.00002
- 5.00002 5.00001 5.00001 5.00001 5 5 5 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998
- 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 5 5 5 5
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.17392 4.94828 3.78491
- 1.52079 0.608874 0.244031 0.127087 0.0552995 0.0361032 0.0169025
- 0.006364 0.00217624 0.000921391 0.000457305 0.000786754
- -0.120016 -0.148054 -0.15898 -0.0801463 0.16463 0.174017
- 0.0799249 0.0318788 0.0129696 0.00483397 0.0025677 0.0042079
- 0.00350003 0.00178404 -8.72902e-05 -0.00128497 -0.00142213
- -0.00130018 -0.00106874 -0.000789207 -0.000824335 -0.00104518
- -0.00136799 -0.004366 -0.0102621 -0.0109254 -0.00649259
- -0.00194842 0.00029793 0.00148673 0.00221085 0.00228291
- 0.00185261 0.00139687 0.00148183 0.00562266 0.00844119 0.00754627
- 0.00657396 0.00591212 0.00539269 0.0049282 0.00448417 0.0040572
- 0.00363719 0.00320392 0.00279607 0.00243938 0.00211505 0.00182302
- 0.00156254 0.0013341 0.00113834 0.000971865 0.00082776 0.000706193
- 0.000602499 0.000515059 0.000441401 0.00037897 0.000325459
- 0.00028083 0.000242096 0.000207274 0.000176444 0.000150372
- 0.000126407 0.000103373 9.05522e-05 8.53555e-05 8.63685e-05
- 9.02593e-05 8.37346e-05 7.72099e-05 7.06852e-05 6.41605e-05
- 5.76358e-05 5.11112e-05 4.45865e-05 4.08176e-05 3.72497e-05
- 3.36818e-05 3.01138e-05 2.65459e-05 2.2978e-05 1.94101e-05
- 1.76154e-05 1.67399e-05 1.58645e-05 1.4989e-05 1.41136e-05
- 1.32381e-05 1.23626e-05 1.14872e-05 1.06117e-05 9.73629e-06
- 8.86083e-06 7.98538e-06 7.10993e-06 6.23447e-06 5.44363e-06
- 5.32578e-06 5.20792e-06 5.09007e-06 4.97222e-06 0.0784323
- 0.0474527 -0.0764232 -0.151146 0.0615785 0.0144489 0.00974161
- 0.00947176 0.00849005 0.00728201 0.00630581 0.00554032 0.00487809
- 0.00441504 0.00384139 -0.118943 -0.149894 -0.161173 -0.0825299
- 0.171686 0.176912 0.0816085 0.0335236 0.013791 0.0056976
- 0.00238833 0.00105348 0.000526199 0.00025969 0.000396026
- 0.000837835 0.00170131 0.00196699 -0.000553314 -0.0061621
- -0.0111895 -0.0142698 -0.0124608 -0.00795847 -0.00467822
- -0.0043058 -0.00874449 -0.0118584 -0.00871386 -0.00377892
- 1.95244e-05 0.00218952 0.00325486 0.00386497 0.00422837
- 0.00446883 0.00447065 0.00486647 0.00547838 0.00565398 0.00559092
- 0.00538752 0.00507015 0.00466305 0.00420756 0.00373465 0.00328404
- 0.00287059 0.00250057 0.00216124 0.00184861 0.00156815 0.00134624
- 0.00117857 0.00103412 0.0008948 0.000761012 0.000619853
- 0.000462614 0.000319965 0.000287666 0.000356415 0.000379946
- 0.000339183 0.00027972 0.000252982 0.000226244 0.000199507
- 0.000172769 0.000146031 0.000130097 0.000117578 0.000105059
- 9.25401e-05 8.00213e-05 7.11204e-05 6.67061e-05 6.22918e-05
- 5.78775e-05 5.34632e-05 4.90489e-05 4.46346e-05 4.02203e-05
- 3.5806e-05 3.13916e-05 2.69773e-05 2.4827e-05 2.31747e-05
- 2.15225e-05 1.98702e-05 1.8218e-05 1.65658e-05 1.49135e-05
- 1.32613e-05 1.1609e-05 9.95678e-06 8.50108e-06 7.86765e-06
- 7.23422e-06 6.60079e-06 5.96736e-06 5.33393e-06 4.7005e-06
- 4.06707e-06 3.43363e-06
-}
-
-.graph element create V9 -x x -y v9
-
-v10 set {
- 1.86175 1.99308 2.16619 2.46661 3.09359 3.76864 4.31299
- 4.65564 4.83425 4.92153 4.96157 4.98063 4.98649 4.99039
- 4.9945 4.9972 4.96206 4.89882 4.83865 4.83202 4.91016 5.04479
- 5.06078 5.04827 5.03474 5.0246 5.01639 5.00996 5.00569 5.00239
- 5.00043 5.00296 5.00437 5.00382 5.00287 5.00208 5.00148
- 5.00104 5.00073 5.0005 5.00034 5.00023 5.00016 5.00011 5.00008
- 5.00007 5.00007 5.00004 5 4.99998 4.99998 4.99997 4.99998
- 4.99999 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001
- 5.00001 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 5.10081
- 5.10949 4.98359 5.00733 5.15145 4.37298 2.36126 0.470759
- 0.0577238 0.0115884 0.00262611 0.000671499 0.000389038 0.000291291
- 0.000317347 -0.0167823 -0.0158344 -0.0140559 0.0104849 0.0865874
- 0.107813 0.0524688 0.0214369 0.00876443 0.00341595 0.00170778
- 0.00259042 0.0022241 0.00118519 1.10217e-06 -0.000784506
- -0.000948169 -0.000856256 -0.000696719 -0.000485987 -0.000724787
- -0.000981491 -0.001454 -0.00552498 -0.0114992 -0.0105266
- -0.00543527 -0.000982798 0.00127356 0.00224212 0.00275439
- 0.00281098 0.0025471 0.00230368 0.00222576 0.00485522 0.00729453
- 0.00691796 0.0062615 0.00573987 0.0052688 0.00481185 0.00436934
- 0.00394326 0.00352712 0.00309978 0.00270038 0.00235335 0.00203742
- 0.00175256 0.00150067 0.00128126 0.00109323 0.000933619
- 0.000795113 0.000678182 0.00057843 0.000494345 0.000423609
- 0.000363821 0.000312766 0.000269856 0.000232389 0.000198382
- 0.000168126 0.00014267 0.000119293 9.69034e-05 8.5669e-05
- 8.26828e-05 8.64066e-05 9.26665e-05 8.5454e-05 7.82416e-05
- 7.10291e-05 6.38167e-05 5.66043e-05 4.93918e-05 4.21794e-05
- 3.86073e-05 3.53007e-05 3.19941e-05 2.86876e-05 2.5381e-05
- 2.20744e-05 1.87678e-05 1.70933e-05 1.62648e-05 1.54363e-05
- 1.46079e-05 1.37794e-05 1.2951e-05 1.21225e-05 1.12941e-05
- 1.04656e-05 9.63716e-06 8.80871e-06 7.98026e-06 7.1518e-06
- 6.32335e-06 5.5374e-06 5.08959e-06 4.64178e-06 4.19397e-06
- 3.74616e-06 0.0438026 0.0242078 -0.0602019 -0.0840866 0.00148461
- -0.00292489 0.000442098 0.00219489 0.00281478 0.00290756
- 0.00277945 0.00263896 0.00240099 0.00223283 0.001947 -0.0153629
- -0.0148815 -0.0128673 0.0126017 0.0905161 0.11051 0.0538958
- 0.022562 0.00935726 0.00397422 0.00172534 0.000790207 0.000416322
- 0.000191632 0.000469721 0.0009779 0.00192566 0.00200688
- -0.0016502 -0.00733932 -0.0128113 -0.0147608 -0.0115456
- -0.00668995 -0.00401368 -0.00463908 -0.0101197 -0.0118993
- -0.0076276 -0.00262656 0.000813059 0.00264455 0.00350796
- 0.00399494 0.0043049 0.00451658 0.00444739 0.00503842 0.00559516
- 0.00568213 0.00556459 0.0053176 0.00496654 0.00454337 0.00408592
- 0.00362171 0.00317793 0.00277001 0.00240394 0.00207009 0.00176575
- 0.00149725 0.00129045 0.00114257 0.00101135 0.000871672
- 0.000723764 0.000580438 0.000427507 0.000296956 0.000281834
- 0.000376628 0.000412266 0.000367547 0.000295305 0.000264513
- 0.000233721 0.000202929 0.000172137 0.000141345 0.000124721
- 0.000112577 0.000100433 8.82893e-05 7.61453e-05 6.75517e-05
- 6.33609e-05 5.91701e-05 5.49792e-05 5.07884e-05 4.65976e-05
- 4.24067e-05 3.82159e-05 3.40251e-05 2.98342e-05 2.56434e-05
- 2.36401e-05 2.21181e-05 2.05961e-05 1.90741e-05 1.75521e-05
- 1.60301e-05 1.45081e-05 1.29861e-05 1.14641e-05 9.94208e-06
- 8.59252e-06 7.96439e-06 7.33626e-06 6.70813e-06 6.07999e-06
- 5.45186e-06 4.82373e-06 4.1956e-06 3.56747e-06
-}
-
-.graph element create V10 -x x -y v10
-
-v11 set {
- 1.86175 1.73419 1.42874 1.04055 0.943004 0.268275 0.0826455
- 0.0388346 0.0214104 0.0135431 0.00961322 0.00712846 0.00588262
- 0.00432397 0.00377774 0.00270134 -0.00393731 -0.00542187
- -0.00126596 0.0113777 0.0134522 0.00477056 -0.00211067 -0.00229253
- -0.00173355 -0.00122404 -0.00113426 -0.000744931 -0.000520112
- -0.000410048 -0.000220439 0.000508104 5.15856e-05 -0.000112593
- -0.000118917 -9.57394e-05 -7.15727e-05 -5.11847e-05 -3.58275e-05
- -2.47166e-05 -1.68866e-05 -1.14082e-05 -7.66646e-06 -5.12139e-06
- -3.63426e-06 -3.01815e-06 -2.64862e-06 -1.4947e-06 -1.91403e-07
- -2.5763e-08 -7.73699e-07 -1.52164e-06 -1.07268e-06 -3.81696e-07
- 2.6727e-07 4.75489e-07 6.83708e-07 8.91926e-07 1.10014e-06
- 1.30836e-06 1.2482e-06 1.00726e-06 7.66311e-07 5.25364e-07
- 2.84417e-07 6.27857e-08 7.43904e-10 -6.12979e-08 -1.2334e-07
- -1.85382e-07 -2.47423e-07 -3.09465e-07 -3.71507e-07 -4.33549e-07
- -4.95591e-07 -5.57633e-07 -6.04571e-07 -5.4944e-07 -4.9431e-07
- -4.3918e-07 -3.84049e-07 -3.28919e-07 -2.73789e-07 -2.18659e-07
- -1.63528e-07 -1.08398e-07 -5.32678e-08 1.062e-09 5.08502e-08
- 1.00638e-07 1.50427e-07 2.00215e-07 2.50003e-07 2.99791e-07
- 3.4958e-07 3.99368e-07 4.49156e-07 4.98944e-07 5.34512e-07
- 5.01032e-07 4.67553e-07 4.34073e-07 4.00593e-07 3.67113e-07
- 3.33633e-07 3.00153e-07 2.66674e-07 2.33194e-07 1.99714e-07
- 1.66234e-07 1.32754e-07 9.92744e-08 6.57945e-08 3.23147e-08
- -1.16513e-09 -3.4645e-08 -6.81248e-08 -1.01605e-07 -1.35084e-07
- -1.68564e-07 -2.18729e-07 0.0114926 -0.0245378 -0.111828
- 0.0964775 1.61491 3.22668 4.22041 4.54492 4.82845 4.94868
- 4.98588 4.99609 4.9981 4.99908 4.99788 4.98395 4.99294 4.99724
- 5.01939 5.0471 5.00902 4.98194 4.98496 4.99188 4.99623 4.99862
- 5.00025 4.99974 4.99953 4.99946 4.99958 5.00012 4.99997
- 4.99992 4.99988 4.99985 4.9998 4.9997 4.9988 4.99806 4.99982
- 5.00143 5.00159 5.00098 5.00053 5.00028 5.00007 4.99977
- 4.99992 5.00005 5.00133 5.0009 4.99993 4.99972 4.99975 4.9998
- 4.99982 4.99983 4.99983 4.99983 4.99983 4.99984 4.99986
- 4.99987 4.99989 4.9999 4.99991 4.99992 4.99994 4.99995 4.99995
- 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998 4.99998
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 5 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 5 5 5.01457 4.99482 4.96561 4.99326
- 5.03452 5.00424 5.00101 5.00045 5.00004 4.99965 4.99997
- 4.99994 4.99958 4.99999 4.99936 4.9839 4.99248 4.99717 5.01976
- 5.04869 5.0087 4.98143 4.98488 4.99199 4.99622 4.9983 4.99928
- 4.99971 4.99986 5.00031 5.00022 5.00035 5.0001 4.99884 4.99811
- 4.99803 4.99887 5.00078 5.00151 5.00116 5.00007 4.99843
- 4.99915 5.00107 5.00168 5.00141 5.00092 5.00055 5.0003 5.00016
- 5.0001 5.00001 5.00016 5.0002 5.00009 4.99993 4.99975 4.99984
- 4.99991 4.99991 4.99982 4.99974 4.99974 4.99985 4.99995
- 4.99999 4.99998 5.00004 5.00013 5.00015 5.00007 4.99988
- 4.99982 4.99985 4.99995 5.00006 5.0002 5.00025 5.0002 5.00009
- 5.00006 5.00004 5.00002 5 4.99998 4.99997 4.99998 4.99998
- 4.99999 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999
- 4.99998 4.99998 4.99998
-}
-
-.graph element create V11 -x x -y v11
-
-v12 set {
- 5 5.16975 4.78685 2.94241 0.126698 0.0487004 -0.00422591
- -0.00130689 -0.000486756 -0.000195875 -0.000108988 -6.66736e-05
- -7.26005e-05 -5.63608e-05 -3.81859e-05 -2.123e-05 -0.0646846
- -0.0184474 0.182248 1.06731 3.10988 4.46133 4.84133 4.95113
- 4.98364 4.99455 4.99694 4.99727 4.9994 4.99975 5.0001 5.00132
- 5.00089 5.00039 5.00019 5.00011 5.00006 5.00005 5.00004
- 5.00001 4.99992 4.99992 5.00002 5.00013 5.00017 5.00009
- 4.99992 4.99991 4.99994 4.99996 4.99998 4.99999 5.00001
- 5.00004 5.00006 5.00005 5.00004 5.00003 5.00002 5.00001
- 5 4.99999 4.99999 4.99998 4.99998 4.99997 4.99997 4.99998
- 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999
- 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 5 5.14699 4.78074
- 3.19424 0.305663 0.0611255 -0.00179951 -0.0012032 0.000405978
- 0.000989399 0.000445194 0.000191447 8.30476e-05 3.96236e-05
- 1.91866e-05 1.70665e-05 -0.0655239 -0.0210234 0.1827 1.06848
- 3.11554 4.46518 4.84212 4.94853 4.98244 4.99434 4.9997 5.00081
- 5.00009 4.99972 4.99985 4.99974 4.9995 4.99949 4.99958 4.99973
- 4.99948 4.99914 4.99874 4.99946 5.00309 5.0091 5.01576 5.01835
- 5.01852 5.0176 5.01625 5.01479 5.01345 5.01264 5.011 5.01092
- 5.01344 5.01363 5.01289 5.01184 5.01071 5.00956 5.00848
- 5.00751 5.00663 5.00577 5.00497 5.00427 5.00365 5.0031 5.00264
- 5.00224 5.00191 5.00163 5.00138 5.00117 5.00099 5.00083
- 5.00071 5.00061 5.00053 5.00045 5.00037 5.00029 5.00022
- 5.00019 5.0002 5.00023 5.00024 5.00023 5.00023 5.00022 5.0002
- 5.00018 5.00016 5.00014 5.00011 5.00009 5.00007 5.00006
- 5.00005 5.00005 5.00004 5.00003 5.00002 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00001 5.00001 5.00001 5.14298 4.79809 3.32704
- 0.498385 0.105773 0.0160646 0.0319912 0.0299434 0.0240102
- 0.0185844 0.0130411 0.0106532 0.00864871 0.00744519 0.00660887
- -0.0612913 -0.0203719 0.174998 0.991787 3.06292 4.60005
- 4.93058 4.98917 5.00033 4.9999 4.99909 4.9966 4.9955 4.99488
- 4.99374 4.9943 5.00131 5.00506 4.99311 4.96288 4.93567 4.92439
- 4.94236 4.9732 4.98864 4.99458 5.00031 5.00694 5.01525 5.01945
- 5.01998 5.01953 5.01874 5.01766 5.0164 5.01509 5.01326 5.01423
- 5.01455 5.01361 5.01245 5.01122 5.01002 5.00888 5.00783
- 5.00687 5.00596 5.00514 5.00442 5.00379 5.00325 5.00279
- 5.0024 5.00208 5.0018 5.00153 5.00126 5.00107 5.00094 5.00085
- 5.00078 5.00072 5.00063 5.00053 5.00042 5.00038 5.00034
- 5.0003 5.00027 5.00023 5.00021 5.00019 5.00017 5.00015 5.00013
- 5.00012 5.00011 5.0001 5.0001 5.00009 5.00008 5.00007 5.00007
- 5.00006 5.00005 5.00005 5.00004 5.00004 5.00003 5.00003
- 5.00002 5.00002 5.00002 5.00001 5.00001 5 5 5 5.00001 5.00001
- 5.00001 5.00002 5.00002 5.00002 5.00002
-}
-
-.graph element create V12 -x x -y v12
-
-v13 set {
- 9.73784e-10 0.0189926 0.0926769 0.206309 0.111533 0.0953491
- 0.0426966 0.0214177 0.0117943 0.00741442 0.00528816 0.00398417
- 0.0032967 0.00266499 0.00206647 0.00158788 -0.0371391 -0.0439528
- -0.0408653 -0.0188706 0.0150241 0.0126852 0.00209817 -0.000239206
- -5.31488e-05 0.000876324 -0.00451221 -0.0165223 -0.0284127
- -0.0427584 -0.0502453 -0.0257366 -0.00903938 -0.00376456
- -0.00233385 -0.00169922 -0.00130397 -0.00102542 -0.000811435
- -0.000648115 -0.000529266 -0.00043795 -0.00036574 -0.00030716
- -0.00026221 -0.000229662 -0.000205112 -0.000181038 -0.000162045
- -0.000148988 -0.000137633 -0.000126278 -0.000115562 -0.000104976
- -9.49324e-05 -9.0585e-05 -8.62375e-05 -8.18901e-05 -7.75426e-05
- -7.31952e-05 -6.93752e-05 -6.59106e-05 -6.24461e-05 -5.89815e-05
- -5.55169e-05 -5.22412e-05 -5.05263e-05 -4.88114e-05 -4.70966e-05
- -4.53817e-05 -4.36668e-05 -4.19519e-05 -4.0237e-05 -3.85222e-05
- -3.68073e-05 -3.50924e-05 -3.34782e-05 -3.25442e-05 -3.16102e-05
- -3.06763e-05 -2.97423e-05 -2.88083e-05 -2.78744e-05 -2.69404e-05
- -2.60064e-05 -2.50725e-05 -2.41385e-05 -2.32635e-05 -2.27232e-05
- -2.21829e-05 -2.16426e-05 -2.11023e-05 -2.0562e-05 -2.00217e-05
- -1.94814e-05 -1.89411e-05 -1.84007e-05 -1.78604e-05 -1.73647e-05
- -1.70853e-05 -1.68059e-05 -1.65265e-05 -1.62471e-05 -1.59677e-05
- -1.56883e-05 -1.54089e-05 -1.51295e-05 -1.48501e-05 -1.45707e-05
- -1.42913e-05 -1.40119e-05 -1.37325e-05 -1.34531e-05 -1.31737e-05
- -1.28943e-05 -1.26149e-05 -1.23355e-05 -1.20561e-05 -1.17767e-05
- -1.14973e-05 -1.10954e-05 0.0152675 0.0228237 -0.00460678
- -0.0341525 0.0232109 -0.0138039 -0.0416538 -0.0458764 -0.0201967
- -0.00878316 -0.00379173 -0.00164621 -0.000785131 -0.00037575
- -0.000352375 -0.0545586 -0.0746881 -0.0771865 -0.05386 -0.0022199
- 0.0136703 0.00633526 0.00138826 -0.00108934 0.0038886 0.0298077
- 0.0475776 0.0481003 0.0464167 0.047818 0.042789 0.035207
- 0.0264423 0.0193959 0.0151614 0.00624257 -0.00913057 -0.0310696
- -0.0430238 0.016426 0.189762 0.49025 0.820116 1.13919 1.43549
- 1.70658 1.95183 2.17414 2.38506 2.5657 2.73958 2.97905 3.21403
- 3.43025 3.62645 3.8028 3.96002 4.09996 4.22443 4.33427 4.42886
- 4.51097 4.5817 4.64326 4.6957 4.74132 4.7797 4.81298 4.84102
- 4.86512 4.88523 4.90224 4.91649 4.92846 4.93868 4.94755
- 4.95483 4.96114 4.96682 4.97161 4.97502 4.9776 4.97944 4.98141
- 4.98319 4.98467 4.98585 4.9869 4.98796 4.98902 4.99008 4.99114
- 4.9922 4.99326 4.9938 4.99429 4.99479 4.99528 4.99578 4.99628
- 4.99677 4.99704 4.99718 4.99733 4.99747 4.99762 4.99777
- 4.99791 4.99806 4.9982 4.99835 4.9985 4.99864 4.99879 4.99893
- 4.99907 4.99916 4.99925 4.99934 4.99943 5.01473 4.92293
- 4.61974 4.0316 3.7835 3.74195 3.78344 3.87272 3.97386 4.07319
- 4.16686 4.25256 4.33126 4.40264 4.46697 4.49249 4.51807
- 4.55803 4.64055 4.78574 4.86074 4.88334 4.8999 4.91455 4.92814
- 4.93926 4.94761 4.95433 4.95907 4.9654 4.98317 5.0208 5.05134
- 4.85852 4.16041 3.00077 1.68376 0.672707 0.240838 0.0794725
- -0.0106347 -0.00879443 0.107196 0.368163 0.701424 1.03581
- 1.3601 1.6678 1.95731 2.22701 2.47544 2.69099 2.92327 3.16648
- 3.3877 3.59067 3.77344 3.93584 4.08066 4.20863 4.32065 4.41791
- 4.50211 4.57423 4.63614 4.68888 4.73377 4.7721 4.80519 4.83338
- 4.85732 4.87815 4.89514 4.90927 4.92108 4.93122 4.94014
- 4.94845 4.95601 4.96251 4.96576 4.969 4.97225 4.9755 4.97874
- 4.98087 4.98265 4.98442 4.9862 4.98797 4.98924 4.9899 4.99055
- 4.9912 4.99186 4.99251 4.99316 4.99381 4.99447 4.99512 4.99577
- 4.99609 4.99634 4.99659 4.99683 4.99708 4.99732 4.99757
- 4.99782 4.99806 4.99831 4.99853 4.99863 4.99873 4.99883
- 4.99893 4.99903 4.99913 4.99923 4.99933
-}
-
-.graph element create V13 -x x -y v13
-
-v14 set {
- 1.86175 2.00147 1.85141 1.0654 0.275481 0.205547 0.0712627
- 0.0313387 0.0151431 0.00864531 0.00593861 0.00438111 0.0037479
- 0.00305857 0.00221221 0.0017081 -0.0896128 -0.109079 -0.121356
- -0.0542001 0.175821 0.177442 0.0814591 0.0333042 0.0134909
- 0.00625777 0.00100092 -0.00552776 -0.00411139 -0.00150395
- -0.000564784 3.48169e-05 -0.000287014 -0.000538515 -0.000456537
- -0.000325677 -0.000275468 -0.000166452 -8.27481e-05 -8.28704e-05
- -7.47644e-05 -4.60552e-05 -2.61481e-06 2.26359e-05 2.53852e-05
- -1.39853e-06 -4.23456e-05 -4.0907e-05 -2.8501e-05 -1.5945e-05
- -9.01122e-06 -2.07747e-06 1.49328e-06 4.38398e-06 6.84248e-06
- 4.76711e-06 2.69173e-06 6.16362e-07 -1.45901e-06 -3.53438e-06
- -4.14256e-06 -3.76238e-06 -3.3822e-06 -3.00202e-06 -2.62184e-06
- -2.24878e-06 -1.93456e-06 -1.62033e-06 -1.3061e-06 -9.91867e-07
- -6.77638e-07 -3.63409e-07 -4.91792e-08 2.6505e-07 5.7928e-07
- 8.93509e-07 1.16076e-06 1.11055e-06 1.06034e-06 1.01014e-06
- 9.59927e-07 9.09719e-07 8.59511e-07 8.09302e-07 7.59094e-07
- 7.08886e-07 6.58678e-07 5.99251e-07 4.87523e-07 3.75795e-07
- 2.64068e-07 1.5234e-07 4.06119e-08 -7.1116e-08 -1.82844e-07
- -2.94572e-07 -4.063e-07 -5.18027e-07 -6.08517e-07 -5.95879e-07
- -5.83241e-07 -5.70604e-07 -5.57966e-07 -5.45328e-07 -5.3269e-07
- -5.20053e-07 -5.07415e-07 -4.94777e-07 -4.8214e-07 -4.69502e-07
- -4.56864e-07 -4.44226e-07 -4.31589e-07 -4.18951e-07 -4.06313e-07
- -3.93676e-07 -3.81038e-07 -3.684e-07 -3.55762e-07 -3.43125e-07
- 1.06736e-05 0.0797407 0.0437947 -0.0645098 -0.0877312 0.0653203
- -0.00621184 -0.0353188 -0.0491378 -0.0251957 -0.0110996
- -0.00481123 -0.0020941 -0.000998038 -0.000478747 -0.000445332
- -0.102046 -0.135753 -0.154351 -0.0827509 0.163348 0.174012
- 0.0794822 0.0310624 0.0112213 0.00249061 0.00130764 0.00181315
- 0.00163875 0.00101454 0.000497435 0.000195258 5.31901e-05
- 2.4607e-05 6.62736e-05 7.90718e-05 4.0372e-05 -0.000141184
- -0.000280623 5.5608e-05 0.000799565 0.000920189 0.000931616
- 0.000494527 0.000162303 -8.24884e-05 -0.000183938 -0.000203899
- -0.000144788 -9.87063e-05 -0.000227929 2.93932e-05 0.000208563
- 1.88958e-06 -7.6335e-05 -0.000172472 -0.000165656 -0.000145889
- -0.000177311 -0.000191058 -0.000168287 -0.00015755 -0.00013142
- -8.10488e-05 -6.36115e-05 -7.8699e-05 -8.11282e-05 -7.98625e-05
- -5.98807e-05 -3.40879e-05 -1.95464e-05 -1.79247e-05 -4.45514e-05
- -7.47995e-05 -8.7682e-05 -7.50806e-05 -3.25561e-05 -4.34114e-05
- -7.69099e-05 -0.000141101 -0.00018743 -0.000148471 -5.06546e-05
- 0.000120195 0.000177635 0.000177052 0.000146344 9.75126e-05
- 8.31233e-05 6.8734e-05 5.43447e-05 3.99554e-05 2.55661e-05
- 1.11768e-05 -3.21253e-06 -3.88937e-06 -3.56628e-06 -3.24318e-06
- -2.92008e-06 -2.59699e-06 -2.27389e-06 -1.9508e-06 -1.73227e-06
- -1.56796e-06 -1.40365e-06 -1.23934e-06 -1.07503e-06 -9.10722e-07
- -7.46412e-07 -5.82101e-07 -4.1779e-07 -2.5348e-07 -8.91694e-08
- 7.51412e-08 2.39452e-07 4.03762e-07 5.95733e-07 1.00771e-06
- 1.41969e-06 1.83167e-06 2.24365e-06 0.0828257 0.231038 0.465438
- 1.54516 2.8461 3.19221 3.40395 3.6382 3.80758 3.93848 4.04882
- 4.15428 4.247 4.32917 4.40235 4.36941 4.397 4.48862 4.64552
- 4.86595 5.03475 5.0348 5.02627 5.01967 5.01542 5.00925 4.98613
- 4.9519 4.91581 4.87357 4.82302 4.80403 4.82565 4.86102 4.89483
- 4.92253 4.94428 4.96257 4.97608 4.98373 4.98823 4.99182
- 4.99437 4.99635 4.99745 4.99802 4.99843 4.99873 4.99895
- 4.99912 4.99925 4.99931 4.99962 4.99973 4.99972 4.99971
- 4.9997 4.99969 4.9997 4.99971 4.99973 4.99974 4.99976 4.99978
- 4.9998 4.99982 4.99985 4.99987 4.99989 4.9999 4.99991 4.99991
- 4.99993 4.99994 4.99997 5.00001 5.00006 5.00008 5.00006
- 5.00002 5 4.99999 4.99998 4.99997 4.99995 4.99995 4.99995
- 4.99995 4.99995 4.99995 4.99995 4.99996 4.99997 4.99997
- 4.99998 4.99999 5 5 5.00001 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00001
- 5.00001 5.00001 5.00001 5.00001 5 5 5 4.99999 4.99999 4.99999
-
-}
-
-.graph element create V14 -x x -y v14
-
-v15 set {
- 1.86175 2.00199 2.08919 1.84314 1.08254 0.214737 0.0377351
- 0.00952455 0.00232763 0.000563614 0.000263477 0.000148642
- 0.000285086 0.000242592 7.34699e-05 -1.53467e-05 -0.0161874
- -0.0157876 -0.0141194 0.0132576 0.0903272 0.109938 0.0535295
- 0.0224216 0.00940945 0.00466825 -0.000649972 -0.00654752
- -0.00333248 -0.00103671 -0.000508276 -5.8896e-05 -0.00043938
- -0.000544704 -0.00044444 -0.000307093 -0.00024517 -0.000154538
- -8.78602e-05 -7.10461e-05 -6.06485e-05 -3.91039e-05 -8.45988e-06
- 9.43442e-06 1.28351e-05 -2.16734e-06 -2.6142e-05 -2.54768e-05
- -1.88997e-05 -1.17906e-05 -7.3808e-06 -2.97101e-06 1.19146e-07
- 2.94246e-06 5.38942e-06 3.88851e-06 2.38761e-06 8.86704e-07
- -6.14201e-07 -2.11511e-06 -2.59565e-06 -2.38885e-06 -2.18205e-06
- -1.97525e-06 -1.76845e-06 -1.56241e-06 -1.36258e-06 -1.16276e-06
- -9.62939e-07 -7.63116e-07 -5.63293e-07 -3.6347e-07 -1.63647e-07
- 3.61756e-08 2.35999e-07 4.35822e-07 6.07653e-07 5.90323e-07
- 5.72994e-07 5.55665e-07 5.38336e-07 5.21007e-07 5.03678e-07
- 4.86349e-07 4.6902e-07 4.51691e-07 4.34361e-07 4.11899e-07
- 3.60315e-07 3.08731e-07 2.57146e-07 2.05562e-07 1.53977e-07
- 1.02393e-07 5.08082e-08 -7.76222e-10 -5.23607e-08 -1.03945e-07
- -1.47815e-07 -1.54225e-07 -1.60635e-07 -1.67045e-07 -1.73455e-07
- -1.79864e-07 -1.86274e-07 -1.92684e-07 -1.99094e-07 -2.05504e-07
- -2.11914e-07 -2.18324e-07 -2.24734e-07 -2.31144e-07 -2.37554e-07
- -2.43964e-07 -2.50373e-07 -2.56783e-07 -2.63193e-07 -2.69603e-07
- -2.76013e-07 -2.82423e-07 2.92534e-06 0.0446777 0.024278
- -0.0518987 -0.0636547 0.00983929 -0.000518204 -0.000265194
- 0.000154772 0.000299538 3.12715e-05 -3.18225e-05 -2.48268e-05
- -1.16701e-05 -6.05117e-06 7.61116e-06 -0.0163668 -0.0158244
- -0.0141177 0.0100085 0.0857144 0.107784 0.051862 0.0204448
- 0.00629858 0.000967736 0.00121674 0.00190276 0.00154009
- 0.000860922 0.000410386 0.000164585 3.99493e-05 1.93797e-05
- 5.67594e-05 0.000110126 2.49925e-05 -7.17815e-05 -0.000142299
- -1.63109e-05 0.000439529 0.000562489 0.000594599 0.000326164
- 0.000126423 -4.26063e-05 -0.000122927 -0.000114152 -6.72706e-05
- -6.41242e-05 -0.000135588 2.61507e-05 0.000134036 6.43734e-06
- -4.6223e-05 -0.000112047 -0.000101388 -8.67847e-05 -0.000117664
- -0.000133957 -0.000116558 -0.000100873 -7.65448e-05 -4.44964e-05
- -3.6677e-05 -5.26632e-05 -5.45172e-05 -5.13545e-05 -3.73869e-05
- -1.99732e-05 -1.0907e-05 -1.10081e-05 -3.02609e-05 -5.18517e-05
- -6.13597e-05 -5.30706e-05 -2.39572e-05 -3.24146e-05 -5.70062e-05
- -0.000103448 -0.000135376 -0.0001024 -2.39007e-05 0.000110929
- 0.000151226 0.000142044 0.000105922 5.62834e-05 4.78476e-05
- 3.94117e-05 3.09759e-05 2.25401e-05 1.41042e-05 5.66837e-06
- -2.76747e-06 -3.08639e-06 -2.81341e-06 -2.54043e-06 -2.26745e-06
- -1.99447e-06 -1.72149e-06 -1.44851e-06 -1.26226e-06 -1.12096e-06
- -9.79661e-07 -8.38363e-07 -6.97065e-07 -5.55768e-07 -4.1447e-07
- -2.73173e-07 -1.31875e-07 9.42259e-09 1.5072e-07 2.92018e-07
- 4.33315e-07 5.74613e-07 7.10363e-07 8.01984e-07 8.93604e-07
- 9.85225e-07 1.07685e-06 0.04474 0.0928765 0.141327 0.0176048
- -0.071675 -0.0124613 0.989022 2.28104 3.40619 4.21417 4.67173
- 4.87438 4.96044 4.98996 4.99858 4.96672 4.89502 4.79391
- 4.76433 4.8387 4.98612 5.0161 5.01722 5.01437 5.01256 4.99827
- 4.95807 4.9209 4.88217 4.83006 4.78461 4.80759 4.85548 4.89604
- 4.9254 4.94617 4.96126 4.97374 4.98255 4.98792 4.99126 4.99361
- 4.99554 4.99699 4.99792 4.99846 4.99881 4.99905 4.99924
- 4.99938 4.99949 4.99955 4.9997 4.9998 4.99982 4.99982 4.99982
- 4.99982 4.99982 4.99983 4.99984 4.99985 4.99986 4.99987
- 4.99988 4.99989 4.9999 4.99992 4.99993 4.99994 4.99995 4.99995
- 4.99996 4.99996 4.99998 4.99999 5.00001 5.00002 5.00002
- 5.00001 5.00001 5 4.99999 4.99999 4.99998 4.99998 4.99998
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
-
-}
-.graph element create V15 -x x -y v15
-
-v16 set {
- 1.86175 1.73073 1.50572 1.89001 3.39004 4.36034 4.79012
- 4.93798 4.98305 4.99539 4.9979 4.99904 4.99772 4.9983 4.99935
- 4.99975 4.98837 4.99456 4.99728 5.01838 5.04568 5.00759
- 4.98112 4.98479 4.99197 4.99641 4.99747 4.99775 5.00043
- 5.0007 5.00035 5.00023 4.99976 5.00002 5.00007 5.0002 4.99993
- 5.00003 5.00021 5.00006 4.99993 4.99992 5.00002 5.00013
- 5.00017 5.00009 4.99992 4.99991 4.99993 4.99996 4.99998
- 4.99999 5.00001 5.00003 5.00005 5.00004 5.00004 5.00003
- 5.00002 5.00001 5 4.99999 4.99999 4.99998 4.99998 4.99997
- 4.99997 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999
- 4.99999 4.99999 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00002 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 5 5.01498 4.99342 4.96899 5.00301 5.02627 4.9977
- 4.99548 4.99757 5.00277 5.00245 5.0014 5.00069 5.00032 5.00014
- 5.00009 4.9867 4.99262 4.99607 5.01805 5.04713 5.00927 4.98184
- 4.98483 4.9914 4.99616 4.99902 4.9999 4.99987 4.99979 4.99981
- 4.99989 4.99994 4.99998 5.0002 5.00001 5.00008 5.00008 5.0001
- 5.00021 5.00032 5.00025 5.00019 5.00006 5.00007 4.99994
- 4.99997 4.99999 5.00023 5.00008 4.99993 4.99998 4.99986
- 4.99982 5.00003 4.99985 4.99996 5.00014 5 4.99984 4.99979
- 4.99982 4.99993 5.00008 5.00011 5.00002 4.99996 4.9999 4.99994
- 5.00001 5.00007 5.00009 4.99995 4.99978 4.99971 4.99976
- 4.99997 4.99996 4.99989 4.99972 4.99955 4.99953 4.99959
- 4.99976 4.9999 5.00005 5.00023 5.00039 5.00034 5.00029 5.00024
- 5.00019 5.00014 5.00009 5.00004 5.00003 5.00002 5.00001
- 5 5 4.99999 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5
- 5.00001 5.00002 5.00003 5.00004 5.01564 5.03395 5.04932
- 5.11868 3.92502 1.31888 0.163888 0.0946876 0.0789578 0.0565084
- 0.0260333 0.0156986 0.00907667 0.00613629 0.00468417 -0.00174008
- -0.0021422 0.000586962 0.0124937 0.0147977 0.00838454 0.00039383
- -0.000522021 -0.000426598 -0.000290214 -0.00173713 -0.00384132
- -0.00382945 -0.00429219 -0.00580193 -0.00393246 0.0017543
- 0.00423045 0.00408931 0.0031976 0.00245457 0.00187293 0.00159068
- 0.00105697 0.000609902 0.000358825 0.000334125 0.000212708
- 0.000168116 8.97349e-05 5.21578e-05 3.84527e-05 2.93033e-05
- 2.10067e-05 1.59954e-05 1.13917e-05 5.49738e-06 2.77217e-05
- 6.51259e-06 -6.65468e-06 2.09837e-06 -6.617e-06 -4.80187e-06
- 1.55031e-06 4.26536e-06 7.69457e-07 -1.46213e-06 -7.25202e-07
- 3.26501e-06 6.55807e-06 7.524e-06 6.07209e-06 6.00701e-06
- 5.41166e-06 3.86573e-06 1.10651e-06 -2.74603e-06 -2.18566e-06
- 2.3658e-06 8.59956e-06 8.35046e-06 2.90621e-06 -8.75982e-07
- -1.87189e-06 -2.1528e-06 -1.94875e-06 -1.74471e-06 -1.54067e-06
- -1.33662e-06 -1.13258e-06 -8.40567e-07 -5.20743e-07 -2.00918e-07
- 1.18906e-07 4.38731e-07 6.11382e-07 6.01529e-07 5.91675e-07
- 5.81822e-07 5.71968e-07 5.62115e-07 5.52261e-07 5.42407e-07
- 5.32554e-07 5.227e-07 5.12847e-07 4.72812e-07 4.26137e-07
- 3.79462e-07 3.32786e-07 2.86111e-07 2.39436e-07 1.92761e-07
- 1.46086e-07 9.94107e-08 5.27356e-08 -2.77779e-10 -7.98079e-08
- -1.59338e-07 -2.38868e-07 -3.18398e-07 -3.97928e-07 -4.77458e-07
- -5.56988e-07 -6.36519e-07
-}
-.graph element create V16 -x x -y v16
-
-v17 set {
- 5 5.16963 4.84136 3.33754 0.316206 0.103113 0.0273341 0.0221102
- 0.0177008 0.0143758 0.0115203 0.00929231 0.00752716 0.00625439
- 0.00489872 0.00403656 -0.0657317 -0.0256467 0.165394 0.985963
- 3.05067 4.55799 4.89728 4.92464 4.8882 4.90592 4.97315 4.99241
- 4.99694 4.99845 4.99905 4.99939 4.99959 4.99971 4.9998 4.99986
- 4.9999 4.99993 4.99995 4.99996 4.99997 4.99998 4.99998 4.99999
- 4.99999 4.99999 4.99999 4.99999 5 5.00001 5.00003 5.00005
- 5.00004 5.00002 5 4.99999 4.99999 4.99998 4.99998 4.99997
- 4.99997 4.99998 4.99998 4.99999 4.99999 5 5 5 5 5 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5
- 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998
- 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 5 5 5 5 5 5 5.00025 5.1657 4.69981 2.43895
- 0.0229743 0.0351406 -0.0211974 -0.0312063 -0.0160331 -0.0021718
- -0.000766597 -0.000251052 -5.49363e-05 -3.36364e-06 -2.01983e-06
- -9.70575e-06 -0.0657007 -0.0205247 0.183332 1.07163 3.11839
- 4.46213 4.84163 4.95195 4.99159 5.02084 5.04029 5.04138
- 5.0271 5.00445 4.97957 4.95702 4.95231 4.97819 4.99191 4.9963
- 4.99822 4.99878 4.99903 4.99925 4.99942 4.9995 4.99954 4.99957
- 4.99961 4.99966 4.9997 4.99974 4.99977 4.99981 4.99983 4.99986
- 4.99988 4.9999 4.99991 4.99992 4.99994 4.99995 4.99995 4.99996
- 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00001 5.00001 5.00001
- 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5 5 5 4.99999 4.99998 4.99997 4.99996 5.14239 4.76219
- 3.16574 0.299969 0.0631609 -0.00118611 -0.00026052 -5.96333e-05
- -1.44904e-05 -4.3859e-06 -2.99454e-06 1.10547e-06 4.84662e-06
- 1.30971e-05 2.23082e-05 -0.0655844 -0.0204818 0.182507 1.05954
- 3.12277 4.46735 4.83915 4.94512 4.97679 4.98654 4.9966 5.00833
- 5.00776 5.00432 5.00199 5.00086 5.00033 5.00008 5 5.00001
- 5 5.00005 5.00002 4.99981 4.99991 4.99998 4.99979 4.99979
- 4.99984 4.9998 4.9998 5.00006 5.00002 5.00001 5 5 4.99992
- 4.99998 4.99999 5.00002 5.00014 4.99999 4.99987 4.99993
- 5.00003 5.00011 5.00005 4.99996 4.99987 4.99985 4.99994
- 5.00009 5.0001 5 4.99993 4.99997 5.00008 5.00015 5.00021
- 5.00021 5.00007 4.99978 4.99965 4.99973 4.9999 4.99992 4.99995
- 4.99997 4.99999 5.00001 5.00002 5.00001 5.00001 5.00001
- 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001 5.00001 5.00002
- 5.00002 5.00002
-}
-.graph element create V17 -x x -y v17
-
-v18 set {
- 5 5.0333 5.02472 4.92559 4.18383 3.93923 3.9961 4.14293
- 4.28591 4.41336 4.52157 4.61101 4.68472 4.7439 4.79294 4.83239
- 4.80697 4.78808 4.79322 4.8838 5.08529 5.21863 4.88852 3.90198
- 2.14586 0.383977 0.101103 0.0525711 0.0318287 0.020895 0.0146908
- 0.010831 0.00830272 0.00656377 0.00532066 0.00440078 0.00369956
- 0.00315713 0.00272614 0.00237965 0.00209659 0.00186339 0.00167014
- 0.0015081 0.00137172 0.00125607 0.00115393 0.00106076 0.000980166
- 0.000918015 0.000862837 0.00080766 0.000763488 0.000721541
- 0.000680825 0.000653026 0.000625226 0.000597426 0.000569627
- 0.000541827 0.000519087 0.000499756 0.000480424 0.000461093
- 0.000441761 0.000423291 0.000411941 0.00040059 0.00038924
- 0.000377889 0.000366539 0.000355188 0.000343838 0.000332487
- 0.000321137 0.000309786 0.000299055 0.000292509 0.000285963
- 0.000279417 0.000272871 0.000266325 0.000259779 0.000253233
- 0.000246686 0.00024014 0.000233594 0.000227387 0.0002231
- 0.000218813 0.000214526 0.00021024 0.000205953 0.000201666
- 0.000197379 0.000193092 0.000188805 0.000184519 0.000180526
- 0.000177963 0.0001754 0.000172837 0.000170274 0.000167711
- 0.000165148 0.000162585 0.000160022 0.000157459 0.000154895
- 0.000152332 0.000149769 0.000147206 0.000144643 0.00014208
- 0.000139517 0.000136954 0.000134391 0.000131828 0.000129265
- 0.000126702 0.000132838 0.0311184 0.163151 0.34986 0.604501
- 0.357125 0.136137 0.0711304 0.0346959 0.0212674 0.00872193
- 0.00252206 0.000455269 7.59332e-05 2.91532e-05 0.000320562
- -0.0720911 -0.0840491 -0.0791345 -0.0404143 0.0182035 -0.0235871
- -0.0426072 -0.0597501 0.00824773 0.481404 1.32496 2.11949
- 2.57317 2.58202 2.15054 1.33786 0.45702 0.153772 0.0913584
- 0.0604989 0.0421591 0.0271456 0.0170021 0.0115815 0.00907886
- 0.00742466 0.00626096 0.00531127 0.00450501 0.00381927 0.00323718
- 0.00274374 0.00232494 0.00196885 0.00166686 0.00141134 0.00119437
- 0.0010109 0.000855534 0.000723378 0.000611408 0.000516704
- 0.000436769 0.000369523 0.000313026 0.00026526 0.000223976
- 0.000188972 0.000159042 0.000134148 0.000112688 9.49738e-05
- 7.97877e-05 6.721e-05 5.65115e-05 4.77194e-05 4.03591e-05
- 3.42848e-05 2.92627e-05 2.50435e-05 2.1412e-05 1.84532e-05
- 1.58624e-05 1.34673e-05 1.14461e-05 1.00935e-05 9.12375e-06
- 8.50202e-06 7.81431e-06 7.20729e-06 6.73936e-06 6.3702e-06
- 5.90049e-06 5.43077e-06 4.96105e-06 4.49133e-06 4.02162e-06
- 3.5519e-06 3.08218e-06 2.79099e-06 2.51281e-06 2.23463e-06
- 1.95645e-06 1.67827e-06 1.40009e-06 1.12191e-06 1.01376e-06
- 9.9375e-07 9.73741e-07 9.53733e-07 9.33724e-07 9.13715e-07
- 8.93707e-07 8.73698e-07 8.5369e-07 8.33681e-07 8.13673e-07
- 7.93664e-07 7.73655e-07 7.53647e-07 7.21781e-07 5.956e-07
- 4.69419e-07 3.43239e-07 2.17058e-07 0.0284032 0.0374438
- -0.0157543 -0.0680497 0.0504768 0.0100294 0.00222261 0.000528697
- 0.000132929 3.99489e-05 2.46066e-05 4.56327e-06 -6.54853e-06
- 1.33783e-05 -3.68221e-05 -0.0724498 -0.0843663 -0.0792935
- -0.0406426 0.0200019 0.0426259 0.0220753 0.00668555 -0.000968483
- 0.024662 0.0383437 0.0911513 0.087848 0.0602076 0.0390559
- 0.0260573 0.0180444 0.012974 0.00985409 0.00788132 0.0064228
- 0.005545 0.00453571 0.00364245 0.00310278 0.00270523 0.00236439
- 0.0020945 0.00186808 0.00167493 0.00151731 0.00138594 0.00126945
- 0.00116695 0.0010762 0.000996366 0.000928387 0.000864414
- 0.000808258 0.000759574 0.000713865 0.000666712 0.000632716
- 0.000601262 0.000572163 0.000543986 0.000515253 0.0004897
- 0.000468112 0.000449313 0.000432981 0.000417911 0.000401307
- 0.000382712 0.000366678 0.000355736 0.000349171 0.000335727
- 0.000317091 0.000296086 0.000283543 0.000277366 0.000272233
- 0.000267001 0.000263147 0.000256699 0.000250251 0.000243803
- 0.000237355 0.000230907 0.000225424 0.000220247 0.000215069
- 0.000209892 0.000204714 0.000200213 0.000196548 0.000192884
- 0.00018922 0.000185556 0.000181892 0.000178228 0.000174564
- 0.0001709 0.000167236 0.000163572 0.000160824 0.000158279
- 0.000155733 0.000153187 0.000150641 0.000148095 0.000145549
- 0.000143003 0.000140457 0.000137911 0.000135457 0.000133386
- 0.000131315 0.000129245 0.000127174 0.000125103 0.000123032
- 0.000120961 0.000118891
-}
-.graph element create V18 -x x -y v18
-
-v19 set {
- 1.86175 1.99994 2.0833 2.01627 2.42503 3.25769 3.62134 3.88827
- 4.09688 4.26773 4.40529 4.51734 4.60827 4.68313 4.74346
- 4.79302 4.72815 4.68959 4.70421 4.81316 5.01375 5.14493
- 5.10305 5.0699 5.04484 5.03751 5.03348 5.02504 5.01799 5.01271
- 5.00895 5.00628 5.0044 5.00309 5.00216 5.00151 5.00105 5.00073
- 5.00051 5.00034 5.00023 5.00015 5.0001 5.00007 5.00003 4.99998
- 4.99993 4.99993 4.99995 4.99999 5.00001 5.00003 5.00002
- 5.00001 5 5 5 5 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00017 5.17398
- 4.94779 3.78508 1.52302 0.608808 0.244311 0.126053 0.0597175
- 0.038422 0.0158174 0.00481338 0.00107847 0.000301256 0.000114861
- 0.00059489 -0.118904 -0.147478 -0.158986 -0.080544 0.165361
- 0.171378 0.0776087 0.0435738 0.0428235 0.0423755 0.0347695
- 0.0225061 0.0155539 0.0121357 0.0107997 0.0103976 0.0124406
- 0.016814 0.0167556 0.0149852 0.01459 0.0141182 0.0131934
- 0.0120286 0.0108692 0.0097184 0.00855881 0.00744912 0.00643877
- 0.00554044 0.00475165 0.00406535 0.00347158 0.00295981 0.00251995
- 0.00214318 0.00182101 0.00154613 0.00131196 0.0011119 0.000941587
- 0.000796999 0.000674582 0.000571283 0.000484276 0.000410649
- 0.000347005 0.000292984 0.000246715 0.000208143 0.00017489
- 0.000147412 0.000123854 0.000104332 8.77229e-05 7.40686e-05
- 6.2637e-05 5.32e-05 4.53946e-05 3.88343e-05 3.31864e-05
- 2.85905e-05 2.45725e-05 2.08671e-05 1.77301e-05 1.55911e-05
- 1.40153e-05 1.29421e-05 1.18693e-05 1.09815e-05 1.03484e-05
- 9.87664e-06 9.14446e-06 8.41228e-06 7.68011e-06 6.94793e-06
- 6.21575e-06 5.48357e-06 4.7514e-06 4.38454e-06 4.04432e-06
- 3.7041e-06 3.36388e-06 3.02366e-06 2.68344e-06 2.34322e-06
- 2.15196e-06 2.03791e-06 1.92386e-06 1.80982e-06 1.69577e-06
- 1.58173e-06 1.46768e-06 1.35363e-06 1.23959e-06 1.12554e-06
- 1.0115e-06 8.9745e-07 7.83404e-07 6.69358e-07 4.76113e-07
- -3.47071e-07 -1.17025e-06 -1.99344e-06 -2.81662e-06 0.0783754
- 0.0500262 -0.0659563 -0.120914 0.0815957 0.0154255 0.00347177
- 0.000840357 0.000214582 6.54655e-05 3.91709e-05 8.07396e-06
- -4.44265e-07 1.74384e-05 -4.52725e-05 -0.119379 -0.147984
- -0.159247 -0.0824604 0.169014 0.177628 0.0758742 0.010558
- -0.0346506 -0.0710288 -0.0838952 -0.0599521 -0.034568 -0.0181615
- -0.00968034 -0.00547115 -0.00333511 -0.00232468 -0.00181159
- -0.00143841 -0.00116601 -0.000839755 -0.000569764 -0.000578683
- -0.000490551 -0.000411712 -0.000437859 -0.000408185 -0.000356644
- -0.000311332 -0.000269006 -0.000221396 -0.000210054 -0.0001923
- -0.000175122 -0.000161039 -0.0001428 -0.000126123 -0.000127893
- -8.14516e-05 -0.000120166 -0.000154909 -0.000112733 -8.40377e-05
- -7.11342e-05 -8.09538e-05 -9.77789e-05 -9.82402e-05 -7.73531e-05
- -5.28255e-05 -3.1096e-05 -1.87967e-05 -1.96552e-05 -4.16655e-05
- -5.77185e-05 -5.24142e-05 -2.83153e-05 -1.90012e-05 -1.54415e-05
- -2.52569e-05 -6.23747e-05 -0.000130543 -0.000149394 -0.000110886
- -4.35517e-05 -4.17084e-05 -3.98651e-05 -3.80218e-05 -3.61785e-05
- -3.43352e-05 -3.36249e-05 -3.32729e-05 -3.29208e-05 -3.25687e-05
- -3.22166e-05 -3.17143e-05 -3.10258e-05 -3.03372e-05 -2.96486e-05
- -2.89601e-05 -2.82715e-05 -2.75829e-05 -2.68944e-05 -2.62058e-05
- -2.55173e-05 -2.48287e-05 -2.43043e-05 -2.38159e-05 -2.33276e-05
- -2.28393e-05 -2.2351e-05 -2.18626e-05 -2.13743e-05 -2.0886e-05
- -2.03977e-05 -1.99093e-05 -1.945e-05 -1.91122e-05 -1.87744e-05
- -1.84366e-05 -1.80987e-05 -1.77609e-05 -1.74231e-05 -1.70853e-05
- -1.67474e-05
-}
-.graph element create V19 -x x -y v19
-
-v20 set {
- 1.86175 1.99724 2.17266 2.48439 3.15933 3.85231 4.38091
- 4.69033 4.85034 4.92851 4.96453 4.98188 4.98736 4.991 4.99482
- 4.9973 4.96422 4.89989 4.83907 4.83151 4.90868 5.04854 5.06104
- 5.04571 5.03219 5.03025 5.02273 5.01707 5.0123 5.0087 5.00611
- 5.00429 5.00301 5.00211 5.00148 5.00103 5.00072 5.0005 5.00035
- 5.00024 5.00016 5.00011 5.00007 5.00005 5.00003 5.00001
- 4.99999 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999
- 5 5 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5
- 5 5 4.99981 5.10081 5.10903 4.98404 5.00999 5.14946 4.36501
- 2.23938 0.325144 0.00660272 -0.0102186 -0.0082401 -0.00556785
- -0.00374178 -0.00264763 -0.00202823 -0.0182241 -0.0169551
- -0.0150395 0.0103736 0.0877592 0.104382 0.0515938 0.0373818
- 0.0411547 0.0397009 0.0308946 0.0205793 0.0154037 0.0129191
- 0.0119327 0.011527 0.0124295 0.0161152 0.0161076 0.0145391
- 0.0144541 0.0139287 0.0129215 0.0117239 0.0105795 0.00942983
- 0.00827423 0.00718354 0.00619954 0.00532868 0.00456631 0.00390448
- 0.00333254 0.00284003 0.00241714 0.00205524 0.0017458 0.00148202
- 0.00125739 0.0010655 0.000902213 0.000763611 0.000646279
- 0.000547291 0.000463934 0.000393401 0.000332424 0.000280655
- 0.000236328 0.000199386 0.000167536 0.000141218 0.000118654
- 9.99559e-05 8.40479e-05 7.09694e-05 6.00188e-05 5.09786e-05
- 4.3502e-05 3.72191e-05 3.18114e-05 2.74071e-05 2.35539e-05
- 1.99967e-05 1.69871e-05 1.49449e-05 1.3451e-05 1.24492e-05
- 1.14256e-05 1.05669e-05 9.94487e-06 9.47514e-06 8.77318e-06
- 8.07123e-06 7.36927e-06 6.66731e-06 5.96536e-06 5.2634e-06
- 4.56144e-06 4.23044e-06 3.92649e-06 3.62254e-06 3.31858e-06
- 3.01463e-06 2.71068e-06 2.40673e-06 2.23063e-06 2.12082e-06
- 2.01102e-06 1.90121e-06 1.7914e-06 1.68159e-06 1.57178e-06
- 1.46197e-06 1.35216e-06 1.24235e-06 1.13255e-06 1.02274e-06
- 9.12929e-07 8.0312e-07 6.33171e-07 -1.51288e-08 -6.63428e-07
- -1.31173e-06 -1.96003e-06 0.0437517 0.0265689 -0.0515377
- -0.0658688 0.010727 -0.000511921 -8.36924e-05 2.13278e-05
- 1.45207e-05 4.54862e-06 -6.14726e-06 2.0062e-06 1.02709e-06
- 1.4152e-05 -3.08225e-05 -0.0166501 -0.0157139 -0.013957
- 0.0107537 0.0873717 0.111302 0.0454129 -0.00530142 -0.0468336
- -0.0790063 -0.0826944 -0.0534753 -0.0288705 -0.0149009 -0.00801592
- -0.0046342 -0.00291835 -0.00213019 -0.00170055 -0.001352
- -0.00110593 -0.000742655 -0.000532042 -0.000544742 -0.000479206
- -0.000407307 -0.000403575 -0.000366209 -0.000324161 -0.000286183
- -0.000247579 -0.000214281 -0.000203435 -0.000186896 -0.000171033
- -0.00015779 -0.000145259 -0.000128069 -0.000122647 -9.89398e-05
- -0.000114926 -0.000132195 -0.000107872 -8.91015e-05 -7.87996e-05
- -8.14061e-05 -8.9098e-05 -8.83368e-05 -7.6122e-05 -6.14668e-05
- -4.75402e-05 -3.81855e-05 -3.69696e-05 -4.78656e-05 -5.61346e-05
- -5.35007e-05 -4.1459e-05 -3.35411e-05 -2.52374e-05 -2.37479e-05
- -4.6406e-05 -9.41884e-05 -0.000109222 -8.52676e-05 -4.25166e-05
- -4.10125e-05 -3.95085e-05 -3.80045e-05 -3.65004e-05 -3.49964e-05
- -3.41627e-05 -3.3541e-05 -3.29193e-05 -3.22976e-05 -3.16758e-05
- -3.10334e-05 -3.03653e-05 -2.96971e-05 -2.9029e-05 -2.83609e-05
- -2.76928e-05 -2.70246e-05 -2.63565e-05 -2.56884e-05 -2.50203e-05
- -2.43521e-05 -2.38716e-05 -2.34324e-05 -2.29932e-05 -2.25539e-05
- -2.21147e-05 -2.16755e-05 -2.12362e-05 -2.0797e-05 -2.03578e-05
- -1.99186e-05 -1.95079e-05 -1.9217e-05 -1.8926e-05 -1.8635e-05
- -1.8344e-05 -1.8053e-05 -1.7762e-05 -1.74711e-05 -1.71801e-05
-
-}
-.graph element create V20 -x x -y v20
-
-v21 set {
- 1.86175 1.73273 1.42016 1.02483 0.944013 0.274107 0.0823742
- 0.0379366 0.020816 0.0132952 0.00955525 0.00717008 0.00592286
- 0.00437379 0.00383557 0.00273694 -0.0037467 -0.0054191 -0.00131454
- 0.0112179 0.0133918 0.00519747 -0.00260113 -0.00252847 -0.00181292
- 0.000183398 -0.000667607 -0.000750747 -0.000594314 -0.000433904
- -0.000308985 -0.000217858 -0.000152926 -0.000107454 -7.54076e-05
- -5.2675e-05 -3.66299e-05 -2.54341e-05 -1.75095e-05 -1.18848e-05
- -7.97289e-06 -5.30239e-06 -3.53615e-06 -2.38504e-06 -2.40158e-06
- -3.84485e-06 -5.29435e-06 -2.57099e-06 1.95189e-06 3.55083e-06
- 2.06179e-06 5.72753e-07 3.30469e-07 3.40296e-07 3.60221e-07
- 4.86081e-07 6.1194e-07 7.37799e-07 8.63659e-07 9.89518e-07
- 9.21274e-07 7.22275e-07 5.23276e-07 3.24277e-07 1.25278e-07
- -5.59467e-08 -9.03265e-08 -1.24706e-07 -1.59086e-07 -1.93466e-07
- -2.27846e-07 -2.62226e-07 -2.96605e-07 -3.30985e-07 -3.65365e-07
- -3.99745e-07 -4.24266e-07 -3.82163e-07 -3.40061e-07 -2.97959e-07
- -2.55857e-07 -2.13755e-07 -1.71652e-07 -1.2955e-07 -8.7448e-08
- -4.53457e-08 -3.24353e-09 3.76901e-08 7.19937e-08 1.06297e-07
- 1.40601e-07 1.74904e-07 2.09208e-07 2.43512e-07 2.77815e-07
- 3.12119e-07 3.46422e-07 3.80726e-07 4.04507e-07 3.77191e-07
- 3.49876e-07 3.22561e-07 2.95246e-07 2.67931e-07 2.40616e-07
- 2.13301e-07 1.85986e-07 1.58671e-07 1.31356e-07 1.04041e-07
- 7.67256e-08 4.94105e-08 2.20955e-08 -5.21962e-09 -3.25347e-08
- -5.98498e-08 -8.71649e-08 -1.1448e-07 -1.41795e-07 -1.6911e-07
- 7.87893e-06 0.0114592 -0.0245712 -0.111637 0.0961324 1.61168
- 3.22343 4.20442 4.53535 4.83834 4.95464 4.98874 4.99746
- 4.99883 4.99948 4.99815 4.98431 4.99298 4.99718 5.01948
- 5.04749 5.008 4.98243 4.98985 4.99781 4.99887 4.99679 4.99616
- 4.99743 4.99859 4.99936 4.99972 5.00058 5.00123 5.0002 4.99945
- 4.99983 4.9998 4.99966 4.99958 4.99956 4.99956 4.99956 4.99958
- 4.99961 4.99965 4.99969 4.99973 4.99977 4.9998 4.99983 4.99985
- 4.99987 4.99989 4.99991 4.99992 4.99993 4.99994 4.99995
- 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00001 5.00001
- 5.00001 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5 5 5 4.99999 4.99998 4.99997 4.99996 5.01454
- 4.99566 4.96796 4.99819 5.03232 5.00034 4.99867 4.99937
- 4.99977 4.99992 4.99997 4.99999 5.00001 5.00021 4.99974
- 4.98462 4.99301 4.99723 5.01936 5.04807 5.00929 4.9789 4.97876
- 4.98244 4.9863 4.99575 5.0069 5.00863 5.00624 5.00357 5.0019
- 5.00098 5.00048 5.00025 5.00016 5.00011 5.00013 5.00009
- 4.99982 4.99994 5.00005 4.99994 4.99988 4.99989 4.99997
- 5.00003 5.00005 5.00002 5.00001 5.00001 5.00001 4.99993
- 4.99999 5 5.00021 4.99997 4.99981 5 5.00009 5.0001 5.00001
- 4.99991 4.9999 5 5.00011 5.00017 5.00018 5.00018 5.00014
- 5.00007 4.99999 4.9999 4.9999 5.00001 5.00016 5.00014 4.99999
- 4.99993 4.99999 5.00009 5.00007 5.00006 5.00004 5.00003
- 5.00001 5.00001 5 4.99999 4.99998 4.99997 4.99997 4.99997
- 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999
- 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002
- 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5 5
-}
-.graph element create V21 -x x -y v21
-
-v22 set {
- 7.10441e-10 0.00107105 0.000637109 -0.00236346 -0.018079
- -0.0120077 -0.00217059 0.00266679 0.00403383 0.00403836
- 0.00356705 0.00303303 0.00244716 0.00198586 0.0016855 0.00136497
- -3.96022e-05 -0.000367409 -3.77079e-05 0.00194085 0.00506964
- -0.0400214 -0.0402572 0.0524434 0.286234 0.803011 1.44795
- 2.02473 2.54768 3.02748 3.4415 3.78287 4.09667 4.35152 4.53987
- 4.67614 4.77407 4.84319 4.89227 4.92702 4.95119 4.96764
- 4.97846 4.98557 4.98982 4.99209 4.99371 4.99569 4.99727
- 4.99802 4.99834 4.99867 4.99892 4.99915 4.99936 4.99939
- 4.99943 4.99946 4.9995 4.99953 4.99957 4.9996 4.99963 4.99967
- 4.9997 4.99973 4.99974 4.99975 4.99976 4.99977 4.99978 4.9998
- 4.99981 4.99982 4.99983 4.99984 4.99985 4.99986 4.99986
- 4.99986 4.99987 4.99987 4.99988 4.99988 4.99989 4.99989
- 4.9999 4.9999 4.9999 4.9999 4.99991 4.99991 4.99991 4.99991
- 4.99992 4.99992 4.99992 4.99992 4.99993 4.99993 4.99993
- 4.99993 4.99993 4.99993 4.99993 4.99993 4.99994 4.99994
- 4.99994 4.99994 4.99994 4.99994 4.99994 4.99994 4.99995
- 4.99995 4.99995 4.99995 4.99995 4.99995 4.99995 5.00145
- 5.00659 5.01209 5.01931 5.00279 4.99273 4.99217 4.99295
- 4.99471 4.99594 4.99696 4.9978 4.99844 4.99891 4.99924 4.99635
- 4.99699 4.99813 5.00068 5.00307 5.0588 4.96365 4.54012 3.6307
- 2.35176 1.0322 0.354379 0.115986 0.0435668 0.0245112 0.020786
- 0.0164656 0.0118409 0.00849698 0.00597078 0.0040105 0.0026076
- 0.0016597 0.00118185 0.00121067 0.00153587 0.00174836 0.00136519
- -0.000189116 -0.00315555 -0.00646603 -0.00898042 -0.010203
- -0.0110896 -0.0123764 -0.00953841 -0.00225795 0.000818314
- 0.00152252 0.00150269 0.00119025 0.000767068 0.000308852
- -3.79272e-05 -0.00019691 -0.000186642 -9.73653e-05 -8.49784e-06
- 2.04147e-05 -9.91086e-06 -1.55959e-05 -1.80499e-05 -1.77097e-05
- -1.51548e-05 -1.1978e-05 -9.84916e-06 -1.29728e-05 -1.67235e-05
- -1.74153e-05 -1.39958e-05 -5.92272e-06 -8.08216e-06 -1.53077e-05
- -2.92531e-05 -3.91049e-05 -2.98935e-05 -7.32122e-06 3.18534e-05
- 4.39134e-05 4.18753e-05 3.22759e-05 1.86766e-05 1.58432e-05
- 1.30098e-05 1.01765e-05 7.34312e-06 4.50975e-06 1.67639e-06
- -1.15697e-06 -1.23877e-06 -1.11991e-06 -1.00106e-06 -8.82208e-07
- -7.63355e-07 -6.44502e-07 -5.2565e-07 -4.29318e-07 -3.44661e-07
- -2.60004e-07 -1.75347e-07 -9.06904e-08 -6.03349e-09 7.86234e-08
- 1.6328e-07 2.47937e-07 3.32594e-07 4.17251e-07 5.01908e-07
- 5.86565e-07 6.71222e-07 7.36123e-07 6.43886e-07 5.5165e-07
- 4.59414e-07 3.67178e-07 0.000334759 -4.60833e-05 -0.00106139
- -0.00166624 0.000859563 0.00102606 0.00410037 0.00419931
- 0.00518997 0.00459791 0.00503125 0.00523877 0.00452158 0.00339924
- 0.00233399 0.000876915 0.000546439 0.000444299 0.000983968
- 0.00119304 -0.0429422 -0.0403983 0.0534896 0.288013 0.807345
- 1.44247 2.03448 2.57021 3.05049 3.47332 3.8131 4.1009 4.34677
- 4.53512 4.67127 4.76531 4.82526 4.86593 4.89586 4.91904
- 4.93806 4.95348 4.96597 4.97629 4.9843 4.98983 4.99335 4.9957
- 4.99741 4.99864 4.99946 4.99994 5.00047 5.00073 5.00086
- 5.00092 5.00094 5.00091 5.00087 5.00081 5.00074 5.00067
- 5.00059 5.00052 5.00046 5.0004 5.00034 5.0003 5.00026 5.00022
- 5.00019 5.00016 5.00014 5.00012 5.0001 5.00009 5.00007 5.00006
- 5.00006 5.00005 5.00004 5.00004 5.00004 5.00003 5.00003
- 5.00003 5.00002 5.00002 5.00002 5.00002 5.00001 5.00001
- 5.00001 5.00001 5.00001 5 5 5 5 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5.00001 5.00001
- 5.00001 5.00001 5.00002 5.00002
-}
-.graph element create V22 -x x -y v22
-
-v23 set {
- 5 5.00284 5.01266 5.01895 4.98936 4.99575 4.99217 4.99545
- 4.99775 4.99894 4.99946 4.99968 4.99975 4.99977 4.99986
- 4.9999 4.99528 4.99808 5.00039 5.00392 5.00512 4.99985 4.99863
- 4.99942 4.99992 5.00017 4.99897 4.99803 4.99784 4.99739
- 4.99883 5.00365 5.00298 5.00133 5.00048 5.00019 5.00008
- 5.00005 5.00004 5.00003 5.00002 5.00002 5.00001 5.00001
- 5.00001 5.00001 5.00001 5 5 4.99999 4.99997 4.99995 4.99996
- 4.99998 5 5.00001 5.00001 5.00002 5.00002 5.00003 5.00003
- 5.00002 5.00002 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99998 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002
- 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5 5 5 5 5 5 5 5.00217 5.00108 4.99547 4.99658 5.00667
- 4.99641 4.99532 4.99938 5.00328 5.00222 5.00114 5.00052
- 5.00024 5.00011 5.00009 4.99285 4.99591 4.99897 5.00403
- 5.00786 5.00318 4.99942 4.9992 4.99949 5.001 5.00408 5.00319
- 5.00063 4.99995 5.00014 4.99982 4.99832 4.99838 4.99865
- 4.99912 4.99836 4.99735 4.99606 4.99814 5.00958 5.02973
- 5.05293 5.06103 4.99342 4.80726 4.50744 4.07509 3.41358
- 2.37924 1.03194 0.261552 0.142392 0.0904482 0.0555071 0.0322869
- 0.018289 0.0113802 0.00875182 0.00757055 0.00629906 0.00523
- 0.00403349 0.0031953 0.00280864 0.00286119 0.00250389 0.00202815
- 0.001723 0.00147312 0.0012411 0.00104401 0.000886204 0.000758277
- 0.000651915 0.00056348 0.000487966 0.000424048 0.000365613
- 0.000308178 0.000258725 0.000228061 0.000207976 0.000198491
- 0.00018518 0.000172716 0.000163197 0.000155007 0.000141734
- 0.000128461 0.000115188 0.000101915 8.86417e-05 7.53686e-05
- 6.20956e-05 5.69164e-05 5.23275e-05 4.77385e-05 4.31495e-05
- 3.85605e-05 3.39716e-05 2.93826e-05 2.69449e-05 2.56224e-05
- 2.42999e-05 2.29774e-05 2.16549e-05 2.03324e-05 1.90099e-05
- 1.76873e-05 1.63648e-05 1.50423e-05 1.37198e-05 1.23973e-05
- 1.10748e-05 9.75232e-06 8.48447e-06 7.65129e-06 6.81811e-06
- 5.98494e-06 5.15176e-06 0.00056893 -0.00787906 -0.0217381
- -0.0370066 -0.00770505 0.00659312 0.00975477 0.00949456
- 0.00777552 0.00655645 0.00568776 0.00508782 0.00458121 0.00410187
- 0.00365665 0.0015121 0.00160863 0.00263181 0.00638941 0.00772607
- 0.00225583 0.0010843 0.000882939 0.000801563 0.00075632
- 0.000554992 0.000435131 0.0003474 0.000217667 0.000491602
- 0.0012267 0.00250446 0.000212058 -0.0174972 -0.0527527 -0.0479071
- 0.194908 1.45838 3.40677 4.49242 4.86894 4.97215 5.01218
- 5.04342 5.06228 5.03069 4.87169 4.57056 4.11523 3.38264
- 2.19691 0.715839 0.172818 0.102162 0.0627162 0.0363388 0.020289
- 0.0119414 0.00826608 0.0066417 0.00549092 0.00492505 0.00439443
- 0.0037156 0.00306471 0.00247451 0.00195965 0.0014822 0.0010815
- 0.000904464 0.0010514 0.00152308 0.00120752 0.000228447
- -0.00102833 -0.00116644 -0.00042067 4.78758e-05 5.09599e-05
- -4.45756e-05 -3.22966e-06 3.81163e-05 7.94622e-05 0.000120808
- 0.000162154 0.000161895 0.000148481 0.000135068 0.000121654
- 0.000108241 9.81453e-05 9.2164e-05 8.61827e-05 8.02014e-05
- 7.42201e-05 6.82388e-05 6.22576e-05 5.62763e-05 5.0295e-05
- 4.43137e-05 3.83324e-05 3.54323e-05 3.321e-05 3.09877e-05
- 2.87654e-05 2.65431e-05 2.43209e-05 2.20986e-05 1.98763e-05
- 1.7654e-05 1.54317e-05 1.34612e-05 1.25441e-05 1.1627e-05
- 1.07099e-05 9.79276e-06 8.87564e-06 7.95851e-06 7.04139e-06
- 6.12427e-06
-}
-.graph element create V23 -x x -y v23
-
-v24 set {
- 5 5.01099 5.00866 4.97845 4.92369 4.9273 4.97413 4.9929
- 4.99826 4.99958 4.99978 5.00005 4.99968 4.99959 5.00014
- 4.99979 4.99914 4.99982 5.00023 5.00295 5.00664 4.99854
- 4.99647 5.00438 5.01722 5.03681 5.04766 5.04799 5.04867
- 5.04873 5.04685 5.04413 5.0367 5.02505 5.01726 5.01183 5.00806
- 5.00549 5.00371 5.00246 5.00162 5.00105 5.00069 5.00045
- 5.00031 5.00024 5.00019 5.00012 5.00007 5.00004 5.00001
- 4.99998 4.99999 4.99999 5 5.00001 5.00001 5.00002 5.00002
- 5.00003 5.00003 5.00003 5.00002 5.00002 5.00001 5.00001
- 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 5 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5.00418 4.99953 4.99152
- 4.99807 5.00497 5.00112 5.00055 5.00038 5.00018 5.00006
- 5.00006 5.00007 5.00006 5.00004 5.00004 4.99853 4.99945
- 4.99998 5.00304 5.00935 5.00742 4.99181 4.97421 4.93603
- 4.8853 4.8927 4.93984 4.97458 4.99039 4.99614 4.99801 4.99851
- 4.99869 4.99924 5.00108 5.00181 5.00119 5.00059 5.00031
- 5.00022 5.00018 5.00011 5.00001 5.00006 4.99981 4.99977
- 4.99982 5.00012 4.99993 5.00008 5.00043 5.00048 5.00024
- 5.00008 4.99984 4.99993 5.00011 4.99996 4.9998 4.99977 4.9998
- 4.99993 5.00008 5.00011 5.00002 4.99995 4.99989 4.99993
- 5 5.00007 5.00009 4.99994 4.99977 4.9997 4.99975 4.99996
- 4.99996 4.99988 4.9997 4.99952 4.9995 4.99956 4.99973 4.99988
- 5.00005 5.00025 5.00042 5.00036 5.00031 5.00025 5.0002 5.00014
- 5.00009 5.00003 5.00002 5.00001 5.00001 5 4.99999 4.99998
- 4.99998 4.99997 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5.00284
- 5.00442 5.00381 4.98997 4.99092 5.00733 5.07791 4.98237
- 4.86434 4.76835 4.74067 4.79278 4.85094 4.90068 4.93603
- 4.95698 4.96984 4.97856 4.98869 4.99904 5.0005 4.99524 5.00181
- 5.01878 5.05177 5.07986 4.98917 4.56217 3.68 2.3539 1.18541
- 0.505772 0.221044 0.115287 0.0760938 0.0589194 0.0476784
- 0.0457213 0.0412911 0.033889 0.0259741 0.0191452 0.0139018
- 0.0100235 0.00711788 0.00497657 0.00349368 0.00250021 0.00176179
- 0.00121843 0.000838368 0.000582711 0.000423458 0.000294608
- 0.000201251 0.000133748 8.6227e-05 5.44252e-05 3.30514e-05
- 1.93926e-05 1.09814e-05 5.29857e-06 1.92247e-06 3.08708e-07
- -3.74311e-07 -6.11121e-07 -7.27807e-07 -4.87604e-07 -4.80493e-07
- -9.15925e-07 -2.03774e-06 -4.01128e-06 -2.46644e-06 2.10626e-06
- 8.22422e-06 1.04922e-05 9.83047e-06 7.27106e-06 3.29654e-06
- -2.06736e-06 -2.18019e-06 -2.29303e-06 -2.40586e-06 -2.51869e-06
- -2.63153e-06 -2.24615e-06 -1.70325e-06 -1.16036e-06 -6.17468e-07
- -7.45754e-08 2.45198e-07 2.88285e-07 3.31373e-07 3.7446e-07
- 4.17548e-07 4.60635e-07 5.03723e-07 5.4681e-07 5.89898e-07
- 6.32985e-07 6.76073e-07 6.19054e-07 5.4001e-07 4.60967e-07
- 3.81923e-07 3.02879e-07 2.23836e-07 1.44792e-07 6.57488e-08
- -1.32948e-08 -9.23383e-08 -1.6698e-07 -2.23206e-07 -2.79432e-07
- -3.35658e-07 -3.91884e-07 -4.48109e-07 -5.04335e-07 -5.60561e-07
- -6.16787e-07
-}
-.graph element create V24 -x x -y v24
-
-v25 set {
- 1.34824 1.35838 1.36465 1.34675 1.29167 1.23161 1.2201 1.2185
- 1.2181 1.21798 1.21793 1.21788 1.21785 1.21782 1.21779 1.21776
- 1.21655 1.21656 1.21669 1.21871 1.22421 1.22247 1.21858
- 1.2228 1.23803 1.27737 1.10647 0.395248 0.0600669 0.027687
- 0.0192374 0.015425 0.0130881 0.00977445 0.00696598 0.00491122
- 0.00341952 0.00237078 0.00162339 0.00109178 0.000726647
- 0.000478886 0.00031568 0.000207902 0.000143494 0.000109768
- 8.62987e-05 5.69775e-05 3.36547e-05 2.30356e-05 1.86108e-05
- 1.41861e-05 1.08293e-05 7.68835e-06 4.79593e-06 4.51019e-06
- 4.22444e-06 3.9387e-06 3.65295e-06 3.36721e-06 3.04559e-06
- 2.69981e-06 2.35403e-06 2.00825e-06 1.66247e-06 1.34508e-06
- 1.26225e-06 1.17941e-06 1.09657e-06 1.01373e-06 9.30893e-07
- 8.48054e-07 7.65216e-07 6.82378e-07 5.9954e-07 5.16702e-07
- 4.37489e-07 3.82774e-07 3.2806e-07 2.73346e-07 2.18632e-07
- 1.63917e-07 1.09203e-07 5.4489e-08 -2.2523e-10 -5.49395e-08
- -1.09654e-07 -1.52862e-07 -1.3079e-07 -1.08718e-07 -8.6646e-08
- -6.45739e-08 -4.25019e-08 -2.04298e-08 1.64229e-09 2.37144e-08
- 4.57864e-08 6.78585e-08 8.71693e-08 9.30725e-08 9.89758e-08
- 1.04879e-07 1.10782e-07 1.16685e-07 1.22589e-07 1.28492e-07
- 1.34395e-07 1.40298e-07 1.46201e-07 1.52105e-07 1.58008e-07
- 1.63911e-07 1.69814e-07 1.75718e-07 1.81621e-07 1.87524e-07
- 1.93427e-07 1.9933e-07 2.05234e-07 2.11137e-07 2.19788e-07
- 0.000393944 -0.000218983 -0.00105784 0.00172403 -0.00027134
- -0.000204147 8.79968e-06 5.93762e-05 5.83554e-05 4.13815e-05
- 3.71369e-05 3.03372e-05 2.25336e-05 1.5986e-05 1.07284e-05
- -7.5239e-05 5.60593e-05 6.97571e-05 0.000667617 0.000960856
- 0.00131749 -0.00759564 -0.0217897 -0.0450321 -0.076646 -0.128569
- -0.186391 -0.202175 -0.206953 -0.2082 -0.208416 -0.208669
- -0.208934 -0.209111 -0.209234 -0.209329 -0.209389 -0.209416
- -0.2094 -0.209329 -0.20926 -0.209204 -0.209208 -0.209285
- -0.209454 -0.209641 -0.20977 -0.209811 -0.209833 -0.209887
- -0.209653 -0.209127 -0.208893 -0.208811 -0.208777 -0.208758
- -0.208747 -0.20874 -0.208726 -0.208697 -0.208657 -0.208611
- -0.208565 -0.208524 -0.208488 -0.208451 -0.208412 -0.208373
- -0.208333 -0.208294 -0.208256 -0.208219 -0.208183 -0.208145
- -0.208107 -0.208066 -0.208029 -0.207993 -0.207959 -0.207923
- -0.207883 -0.207838 -0.207789 -0.207747 -0.20771 -0.207675
- -0.207642 -0.207605 -0.207568 -0.207531 -0.207494 -0.207457
- -0.20742 -0.207383 -0.207346 -0.207308 -0.207271 -0.207233
- -0.207196 -0.207158 -0.207121 -0.207084 -0.207046 -0.207009
- -0.206972 -0.206935 -0.206898 -0.206861 -0.206823 -0.206786
- -0.206749 -0.206712 -0.206675 -0.206638 -0.2066 -0.206563
- -0.206526 -0.206489 -0.206452 -0.206415 -0.203384 -0.20015
- -0.196872 -0.205024 -0.210727 -0.206779 -0.0685263 0.586138
- 1.4665 2.22945 2.77554 3.076 3.24926 3.34515 3.40164 3.43006
- 3.43713 3.43075 3.42886 3.4384 3.46567 3.49025 3.51287 3.53821
- 3.57841 3.39846 2.80753 2.22947 1.7549 1.30429 0.707786
- 0.303206 0.131352 0.0671706 0.0429955 0.032461 0.0257161
- 0.0239521 0.0217397 0.0179705 0.0138745 0.0102813 0.00749643
- 0.0054328 0.00386817 0.0027004 0.00189442 0.00135552 0.000954715
- 0.000659981 0.000453435 0.000313993 0.000231347 0.000159665
- 0.000108122 7.10528e-05 4.50233e-05 2.77892e-05 1.62765e-05
- 8.9893e-06 4.5471e-06 1.54614e-06 -1.6542e-07 -8.68508e-07
- -1.04369e-06 -9.63086e-07 -8.44294e-07 -6.57339e-07 -7.35885e-07
- -9.80056e-07 -1.39772e-06 -2.10199e-06 -1.37474e-06 6.13269e-07
- 3.3028e-06 4.60941e-06 4.91053e-06 4.14186e-06 2.45258e-06
- -8.7388e-09 -3.59647e-07 -7.10554e-07 -1.06146e-06 -1.41237e-06
- -1.76328e-06 -1.63073e-06 -1.34534e-06 -1.05995e-06 -7.74561e-07
- -4.8917e-07 -2.95733e-07 -2.16326e-07 -1.3692e-07 -5.75135e-08
- 2.18929e-08 1.01299e-07 1.80706e-07 2.60112e-07 3.39519e-07
- 4.18925e-07 4.98332e-07 4.83984e-07 4.4901e-07 4.14035e-07
- 3.79061e-07 3.44087e-07 3.09112e-07 2.74138e-07 2.39163e-07
- 2.04189e-07 1.69215e-07 1.26002e-07 4.83213e-08 -2.9359e-08
- -1.07039e-07 -1.8472e-07 -2.624e-07 -3.4008e-07 -4.1776e-07
- -4.95441e-07
-}
-.graph element create V25 -x x -y v25
-
-v26 set {
- 7.10441e-10 0.000309731 -0.000308186 -0.001694 -0.00360784
- 8.40909e-05 0.00203175 0.0012896 0.000596548 0.000277191
- 0.000161134 0.000120439 8.4915e-05 9.49929e-05 6.18812e-05
- 1.65433e-05 1.89682e-05 3.97578e-05 4.95446e-05 0.000225325
- 0.000214579 -0.00230134 -0.000451102 0.00997237 0.0341443
- 0.0449314 0.0424411 0.0341996 0.0315315 0.0308892 0.0291614
- 0.024365 0.0190282 0.0188976 0.017238 0.0138526 0.0105645
- 0.00778548 0.00561753 0.0039871 0.00279554 0.00194075 0.0013468
- 0.000934775 0.000664723 0.000498911 0.000377384 0.000254183
- 0.000163421 0.000120773 9.65058e-05 7.22384e-05 5.60316e-05
- 4.14549e-05 2.79516e-05 2.57096e-05 2.34677e-05 2.12257e-05
- 1.89837e-05 1.67417e-05 1.46737e-05 1.27228e-05 1.07719e-05
- 8.82099e-06 6.87009e-06 5.0896e-06 4.71705e-06 4.34451e-06
- 3.97196e-06 3.59941e-06 3.22686e-06 2.85431e-06 2.48176e-06
- 2.10921e-06 1.73666e-06 1.36411e-06 1.02855e-06 9.42931e-07
- 8.57316e-07 7.71701e-07 6.86086e-07 6.00471e-07 5.14856e-07
- 4.29241e-07 3.43626e-07 2.58011e-07 1.72396e-07 9.85409e-08
- 9.14091e-08 8.42773e-08 7.71456e-08 7.00138e-08 6.2882e-08
- 5.57503e-08 4.86185e-08 4.14867e-08 3.4355e-08 2.72232e-08
- 2.05821e-08 1.63235e-08 1.2065e-08 7.80643e-09 3.54786e-09
- -7.10696e-10 -4.96926e-09 -9.22782e-09 -1.34864e-08 -1.77449e-08
- -2.20035e-08 -2.62621e-08 -3.05206e-08 -3.47792e-08 -3.90378e-08
- -4.32963e-08 -4.75549e-08 -5.18134e-08 -5.6072e-08 -6.03306e-08
- -6.45891e-08 -6.88477e-08 -8.76373e-06 0.000131607 -0.00021685
- -0.000433027 0.00047234 0.000211593 -0.000189601 3.2492e-05
- 0.000575955 7.72235e-05 -0.000285172 -0.000242061 -0.000135112
- -3.50117e-05 -2.75868e-05 5.48974e-05 1.80604e-07 5.48911e-05
- 3.97478e-05 0.000192909 0.000297932 0.00402253 -0.0122366
- -0.047853 -0.0963082 -0.108071 -0.0567275 -0.0239271 -0.0178628
- -0.0233027 -0.031853 -0.0400843 -0.0482725 -0.0576154 -0.0627218
- -0.0511236 -0.0279524 -0.0150986 -0.00931091 -0.00652876
- -0.00479286 -0.00344346 -0.00249578 -0.0019532 -0.00157977
- -0.00131848 -0.00111251 -0.000939229 -0.000797445 -0.000708384
- -0.000630452 -0.000539722 -0.000508862 -0.000480596 -0.000439484
- -0.000407217 -0.000363866 -0.000329506 -0.000318642 -0.000307362
- -0.000286511 -0.000266253 -0.000242943 -0.000218107 -0.000204661
- -0.00020241 -0.000194435 -0.000185062 -0.000173042 -0.000160549
- -0.000151407 -0.000145626 -0.000145976 -0.000147342 -0.000145288
- -0.000137979 -0.000124481 -0.000123218 -0.000127453 -0.000139006
- -0.000145486 -0.000129764 -9.82749e-05 -4.72596e-05 -3.08671e-05
- -3.28834e-05 -4.52254e-05 -6.25389e-05 -6.32516e-05 -6.39643e-05
- -6.4677e-05 -6.53897e-05 -6.61023e-05 -6.6815e-05 -6.75277e-05
- -6.61005e-05 -6.45173e-05 -6.29341e-05 -6.13509e-05 -5.97676e-05
- -5.81844e-05 -5.66012e-05 -5.54231e-05 -5.4455e-05 -5.3487e-05
- -5.25189e-05 -5.15508e-05 -5.05828e-05 -4.96147e-05 -4.86466e-05
- -4.76785e-05 -4.67105e-05 -4.57424e-05 -4.47743e-05 -4.38063e-05
- -4.28382e-05 -4.18821e-05 -4.10211e-05 -4.016e-05 -3.9299e-05
- -3.8438e-05 4.29885e-05 5.14113e-05 -0.000127986 -0.000611463
- -0.000149428 0.000882394 0.00297059 -0.00405825 -0.00591067
- -0.00546997 -0.00158744 0.00190677 0.00298403 0.00268595
- 0.00196161 0.00130289 0.000783347 0.000520683 0.000565306
- 0.00053419 -0.00224696 -0.000920818 0.0132755 0.0322504
- 0.0442808 0.0638615 0.0701007 0.0539356 0.0247771 0.056244
- 0.294266 0.831368 1.45424 2.02898 2.54559 2.9937 3.35333
- 3.72609 4.06363 4.32789 4.52413 4.66504 4.7652 4.83637 4.88631
- 4.92109 4.94464 4.96046 4.97218 4.98079 4.98679 4.99076
- 4.99361 4.99555 4.99686 4.99783 4.99853 4.99902 4.99936
- 4.99959 4.99973 4.99983 4.9999 4.99993 4.99996 4.99998 5
- 5.00001 5 4.99999 4.99997 4.99994 4.99993 4.99994 4.99996
- 4.99999 5.00004 5.00006 5.00005 5.00003 5.00002 5.00001
- 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998
-
-}
-.graph element create V26 -x x -y v26
-
-v27 set {
- 5 4.99984 4.99796 4.99478 4.9889 4.98738 4.98896 4.99087
- 4.99262 4.99419 4.99552 4.99659 4.99743 4.99807 4.99855
- 4.9989 4.99894 4.99908 4.99935 5.00001 5.0007 5.00132 5.00032
- 4.99976 5.00134 5.00339 5.00315 5.00157 5.00091 5.00058
- 5.00012 4.99944 4.99886 4.9994 4.99934 4.99899 4.99876 4.99868
- 4.99872 4.99883 4.99898 4.99914 4.9993 4.99944 4.99956 4.99967
- 4.99976 4.99982 4.99986 4.9999 4.99993 4.99997 4.99997 4.99998
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00009 5.00028 5.00015 4.99983
- 5.00036 4.99996 4.99834 4.99783 5.00383 5.00734 5.00387
- 5.00058 4.99893 4.99836 4.99832 4.99854 4.99873 4.99905
- 4.99927 4.99952 4.99969 4.99834 4.99536 4.99163 4.99073
- 5.0053 5.03631 5.03103 4.9008 4.62503 4.21887 3.70902 3.09967
- 2.35791 1.41912 0.519675 0.210458 0.131362 0.0980819 0.0708209
- 0.0471701 0.0323272 0.0253535 0.0199144 0.0152615 0.0117228
- 0.00917696 0.00738117 0.00609292 0.00512664 0.00436184 0.0037961
- 0.00331639 0.00289006 0.0025477 0.00226529 0.00202925 0.00182793
- 0.00165474 0.00150531 0.00137529 0.00125983 0.00115603 0.00106455
- 0.000982977 0.000911255 0.000846819 0.000790092 0.000738698
- 0.000692816 0.00065107 0.000613595 0.000579642 0.000548935
- 0.00052106 0.000495598 0.000472174 0.000450849 0.000431118
- 0.000412667 0.000395868 0.000381319 0.000368487 0.000357327
- 0.000344212 0.000330334 0.00031622 0.000303298 0.000295809
- 0.00028832 0.000280831 0.000273342 0.000265853 0.000258364
- 0.000250875 0.000245118 0.000239488 0.000233857 0.000228227
- 0.000222596 0.000216966 0.000211336 0.000207047 0.000203455
- 0.000199863 0.00019627 0.000192678 0.000189085 0.000185493
- 0.0001819 0.000178308 0.000174716 0.000171123 0.000167531
- 0.000163938 0.000160346 0.000156835 0.000153973 0.00015111
- 0.000148248 0.000145385 0.000296579 -3.96718e-05 -0.000449085
- 0.000323433 0.000750086 0.000268264 0.000149028 -0.000100249
- 7.00956e-05 0.00012605 0.00022592 0.000193036 0.000120453
- 8.07865e-05 7.65771e-05 -3.27828e-05 0.000116759 0.000169498
- 0.000409804 0.000414965 0.00092323 -0.00590633 -0.0175477
- -0.032433 -0.0559842 -0.0820373 0.0688484 0.626629 1.32929
- 2.01657 2.60925 3.12329 3.38952 3.14128 2.38463 1.23802
- 0.316019 0.107832 0.0694707 0.051837 0.035247 0.0209999
- 0.0116618 0.00967674 0.00789182 0.00574566 0.00386872 0.00258612
- 0.00167126 0.00104169 0.000641093 0.000401246 0.000277928
- 0.000171775 0.000102266 5.89376e-05 3.29258e-05 1.80463e-05
- 1.0057e-05 6.4571e-06 5.10093e-06 4.06791e-06 3.62716e-06
- 3.63321e-06 3.99625e-06 4.64368e-06 5.20886e-06 4.77728e-06
- 3.23919e-06 1.14113e-06 -1.29416e-06 -4.15607e-06 -1.88532e-06
- 5.24411e-06 1.38678e-05 1.28823e-05 3.6758e-06 -2.52285e-06
- -3.97133e-06 -4.03071e-06 -3.37154e-06 -2.71238e-06 -2.05321e-06
- -1.39404e-06 -7.34872e-07 -3.73325e-07 -1.05873e-07 1.61578e-07
- 4.2903e-07 6.96482e-07 8.18468e-07 7.60065e-07 7.01662e-07
- 6.43258e-07 5.84855e-07 5.26452e-07 4.68049e-07 4.09646e-07
- 3.51243e-07 2.9284e-07 2.34437e-07 1.71213e-07 1.06928e-07
- 4.2644e-08 -2.16403e-08 -8.59247e-08 -1.50209e-07 -2.14493e-07
- -2.78778e-07 -3.43062e-07 -4.07346e-07 -4.55065e-07 -4.3348e-07
- -4.11896e-07 -3.90311e-07 -3.68726e-07 -3.47141e-07 -3.25556e-07
- -3.03971e-07 -2.82386e-07
-}
-.graph element create V27 -x x -y v27
-
-v28 set {
- 0.368163 0.361756 0.327463 0.269513 0.149476 0.0805716 0.0501146
- 0.03403 0.0230886 0.0160474 0.0116071 0.00870013 0.00679614
- 0.00542384 0.00432512 0.00340653 -0.00129719 -0.00399429
- -0.00318719 0.00443085 0.0150156 0.0334147 0.0132288 -0.0189751
- -0.0508377 -0.0252174 -0.0142489 -0.00675908 -0.0038653
- -0.00243423 -0.00168891 -0.00120901 -0.000900426 -0.000685575
- -0.000557595 -0.000457268 -0.000377427 -0.000315269 -0.000266613
- -0.000228397 -0.000198283 -0.000174248 -0.000154886 -0.00013892
- -0.000125864 -0.000115189 -0.000105841 -9.66611e-05 -8.84262e-05
- -8.23872e-05 -7.74668e-05 -7.25463e-05 -6.79992e-05 -6.35276e-05
- -5.92413e-05 -5.68994e-05 -5.45574e-05 -5.22154e-05 -4.98735e-05
- -4.75315e-05 -4.54981e-05 -4.36726e-05 -4.18471e-05 -4.00216e-05
- -3.81961e-05 -3.64559e-05 -3.54209e-05 -3.43858e-05 -3.33508e-05
- -3.23157e-05 -3.12807e-05 -3.02456e-05 -2.92105e-05 -2.81755e-05
- -2.71404e-05 -2.61054e-05 -2.51232e-05 -2.44984e-05 -2.38736e-05
- -2.32487e-05 -2.26239e-05 -2.19991e-05 -2.13742e-05 -2.07494e-05
- -2.01246e-05 -1.94998e-05 -1.88749e-05 -1.82865e-05 -1.79044e-05
- -1.75224e-05 -1.71403e-05 -1.67582e-05 -1.63762e-05 -1.59941e-05
- -1.56121e-05 -1.523e-05 -1.4848e-05 -1.44659e-05 -1.41138e-05
- -1.39075e-05 -1.37011e-05 -1.34947e-05 -1.32883e-05 -1.30819e-05
- -1.28755e-05 -1.26691e-05 -1.24627e-05 -1.22563e-05 -1.205e-05
- -1.18436e-05 -1.16372e-05 -1.14308e-05 -1.12244e-05 -1.1018e-05
- -1.08116e-05 -1.06052e-05 -1.03988e-05 -1.01924e-05 -9.98605e-06
- -9.77966e-06 -2.85319e-05 0.00281092 0.00180106 -0.000981083
- 0.00551926 -0.00119763 -0.0295069 -0.0367677 0.064749 0.119022
- 0.0882007 0.0552062 0.03418 0.0223243 0.015545 0.011949
- 0.00757134 0.00667655 0.00583243 0.00644443 0.00650959 -0.0302575
- -0.0437806 -0.0355466 0.0381776 0.282109 0.674178 1.07582
- 1.45189 1.789 2.08649 2.34663 2.57245 2.81211 3.04778 3.2523
- 3.45877 3.65593 3.83396 3.9923 4.13368 4.25864 4.36719 4.46064
- 4.54086 4.60962 4.66835 4.71838 4.76094 4.79716 4.82796
- 4.85413 4.87634 4.89518 4.91116 4.92476 4.93631 4.94608
- 4.95434 4.9613 4.96715 4.97211 4.97638 4.98001 4.98312 4.98571
- 4.98795 4.98979 4.99138 4.99269 4.99381 4.99474 4.99551
- 4.99615 4.99668 4.99713 4.99752 4.99783 4.99811 4.99836
- 4.99858 4.99873 4.99884 4.99892 4.999 4.99907 4.99912 4.99916
- 4.99921 4.99926 4.99932 4.99937 4.99942 4.99948 4.99953
- 4.99956 4.99958 4.99961 4.99963 4.99966 4.99968 4.99971
- 4.99972 4.99973 4.99974 4.99975 4.99976 4.99977 4.99978
- 4.99979 4.9998 4.9998 4.99981 4.99982 4.99983 4.99984 4.99985
- 4.99986 4.99986 4.99987 4.99987 5.00498 5.00354 4.99359
- 4.98981 5.00498 5.00099 5.00041 5.00022 5.00015 5.00012
- 5.0001 5.00008 5.00005 5.00003 5 4.99431 4.99459 4.99591
- 5.00087 5.01029 5.03935 4.92784 4.51643 3.78356 2.68745
- 1.43417 0.583128 0.205094 0.0777337 0.0391566 0.02723 0.023883
- 0.018808 0.010165 0.00254623 -0.00377463 -0.0038097 0.00144145
- 0.00267231 0.00193045 0.00144538 0.00121758 0.00112893 0.00109424
- 0.0010226 0.000948072 0.000882573 0.000826996 0.000776391
- 0.000729719 0.000686499 0.000647333 0.000610108 0.000575631
- 0.000545069 0.000515485 0.000488514 0.000465316 0.000443215
- 0.000422454 0.00040292 0.00038488 0.000368472 0.000353628
- 0.000339643 0.000326197 0.000313483 0.000302884 0.000294038
- 0.000284003 0.000270941 0.000254925 0.000246511 0.000244089
- 0.000245538 0.000242099 0.000235728 0.000227482 0.000218001
- 0.000207257 0.000202127 0.000196997 0.000191868 0.000186738
- 0.000181608 0.00017758 0.000173899 0.000170219 0.000166538
- 0.000162857 0.000159576 0.00015679 0.000154005 0.000151219
- 0.000148433 0.000145647 0.000142861 0.000140076 0.00013729
- 0.000134504 0.000131718 0.000129603 0.000127635 0.000125668
- 0.0001237 0.000121732 0.000119765 0.000117797 0.000115829
- 0.000113862 0.000111894 0.000109993 0.000108372 0.000106751
- 0.00010513 0.000103509 0.000101887 0.000100266 9.86449e-05
- 9.70237e-05
-}
-.graph element create V28 -x x -y v28
-
-v29 set {
- 5 4.99899 4.99654 4.99327 4.9863 4.98954 4.99212 4.99378
- 4.9951 4.99624 4.99715 4.99786 4.99839 4.99879 4.99909 4.99931
- 4.99922 4.99933 4.99971 5.00064 5.00084 5.00123 4.99865
- 4.99853 4.99983 5.00457 5.00242 5.00105 5.00062 5.00042
- 4.99971 4.9994 4.9992 4.9996 4.99955 4.99932 4.99918 4.99915
- 4.99919 4.99927 4.99937 4.99948 4.99957 4.99966 4.99974
- 4.9998 4.99985 4.99989 4.99992 4.99993 4.99994 4.99994 4.99996
- 4.99998 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001
- 5.00001 5.00001 5 5 5 5 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99998 4.99998 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5
- 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5 5 5 5 5 5 4.9997 4.99998 4.99954 4.99963
- 5.00059 4.99945 4.99732 4.99957 5.00919 5.00558 5.00033
- 4.99851 4.9983 4.99854 4.99871 4.99928 4.99914 4.99939 4.99952
- 4.9998 4.99976 4.99744 4.99598 4.99478 4.99806 5.01911 5.04602
- 5.05469 5.01317 4.89484 4.69655 4.42036 4.06069 3.60793
- 3.12531 2.72975 2.45187 2.25081 2.09841 1.98509 1.90211
- 1.84084 1.79411 1.7574 1.72763 1.70283 1.68188 1.66389 1.64823
- 1.63438 1.62201 1.61088 1.60081 1.59163 1.58323 1.57549
- 1.56835 1.56173 1.55558 1.54985 1.54451 1.53951 1.53479
- 1.53035 1.52615 1.5222 1.51845 1.5149 1.51153 1.50834 1.50529
- 1.5024 1.49964 1.497 1.49449 1.49208 1.48977 1.48755 1.48542
- 1.48336 1.48138 1.47948 1.47765 1.4759 1.47419 1.47255 1.47096
- 1.46949 1.46823 1.46696 1.4657 1.46444 1.46317 1.46191 1.46065
- 1.45956 1.4585 1.45743 1.45636 1.45529 1.45422 1.45315 1.45226
- 1.45145 1.45064 1.44983 1.44902 1.44821 1.4474 1.44659 1.44579
- 1.44498 1.44417 1.44336 1.44255 1.44174 1.44094 1.44019
- 1.43944 1.43868 1.43793 1.43765 1.43679 1.43515 1.43405
- 1.43478 1.43387 1.43345 1.43184 1.43086 1.43021 1.43003
- 1.42988 1.42944 1.42883 1.42818 1.42702 1.42642 1.42595
- 1.42586 1.42616 1.42783 1.41733 1.38106 1.30738 1.3877 2.09819
- 3.05285 3.58059 3.77601 3.87609 4.02557 4.24887 4.4608 4.60411
- 4.72109 4.8255 4.90465 4.97379 5.01253 5.01532 5.01239 5.0092
- 5.00665 5.00474 5.00333 5.00232 5.00163 5.00117 5.00082
- 5.00057 5.00039 5.00027 5.00019 5.00013 5.00009 5.00006
- 5.00004 5.00003 5.00002 5.00001 5.00001 5 5 5 4.99998 4.99995
- 4.99992 4.99996 5.00005 5.00012 5.00008 4.99996 4.9999 4.99985
- 4.99986 4.99997 5.00021 5.0003 5.00024 5.00009 5.00007 5.00005
- 5.00003 5.00001 4.99998 4.99998 4.99998 4.99999 4.99999
- 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99998
- 4.99998 4.99998
-}
-.graph element create V29 -x x -y v29
-v30 set {
- 7.10441e-10 5.70385e-05 0.000226143 0.000131916 -0.000887764
- -8.01837e-05 -3.49653e-05 9.40039e-05 0.000118663 0.000108025
- 8.6059e-05 6.33268e-05 4.99295e-05 3.16843e-05 3.60692e-05
- 2.07572e-05 -8.6375e-05 3.44583e-05 8.07397e-05 0.000196296
- 0.000115615 -7.12768e-05 -0.000129812 -4.18679e-05 7.94364e-05
- 0.000182034 -5.41226e-05 -0.000451819 -0.000713937 -0.00129863
- -0.00262186 -0.00213417 -0.00133767 0.000775698 0.000969902
- 0.000549281 0.000280946 0.000140321 8.6919e-05 7.22446e-05
- 6.5631e-05 6.45263e-05 6.63087e-05 7.17391e-05 7.59042e-05
- 7.59172e-05 7.03353e-05 6.33558e-05 5.31136e-05 4.64278e-05
- 4.40594e-05 4.16909e-05 4.05674e-05 3.96957e-05 3.87875e-05
- 3.74977e-05 3.62079e-05 3.49181e-05 3.36283e-05 3.23385e-05
- 3.12427e-05 3.02775e-05 2.93124e-05 2.83472e-05 2.7382e-05
- 2.64613e-05 2.59077e-05 2.5354e-05 2.48004e-05 2.42468e-05
- 2.36931e-05 2.31395e-05 2.25859e-05 2.20322e-05 2.14786e-05
- 2.0925e-05 2.03916e-05 1.9995e-05 1.95984e-05 1.92019e-05
- 1.88053e-05 1.84087e-05 1.80122e-05 1.76156e-05 1.7219e-05
- 1.68225e-05 1.64259e-05 1.6051e-05 1.57991e-05 1.55471e-05
- 1.52952e-05 1.50433e-05 1.47913e-05 1.45394e-05 1.42875e-05
- 1.40356e-05 1.37836e-05 1.35317e-05 1.32978e-05 1.31513e-05
- 1.30048e-05 1.28583e-05 1.27118e-05 1.25653e-05 1.24188e-05
- 1.22724e-05 1.21259e-05 1.19794e-05 1.18329e-05 1.16864e-05
- 1.15399e-05 1.13934e-05 1.12469e-05 1.11005e-05 1.0954e-05
- 1.08075e-05 1.0661e-05 1.05145e-05 1.0368e-05 1.02215e-05
- 1.76447e-05 7.21516e-05 -3.59786e-05 -0.000159618 0.000156236
- 0.000135106 -0.000336402 -0.000302283 0.000699323 0.000473866
- -0.000156146 -0.000225625 -0.000123592 -3.78116e-05 8.47472e-06
- 2.43387e-06 -7.44762e-05 7.80111e-05 9.43608e-05 0.000170159
- 8.83919e-05 -0.00018802 -0.000373512 -0.000390597 0.000156875
- 0.0032343 0.00776304 -0.000566905 -0.00760695 -0.0159226
- -0.0245989 -0.0331402 -0.0100902 0.067837 0.266702 0.910818
- 1.82282 2.69714 3.43247 3.98325 4.32893 4.51529 4.67087
- 4.79288 4.87574 4.92797 4.95902 4.97655 4.98622 4.99195
- 4.99526 4.99735 4.9991 4.99974 4.99982 4.99974 4.99961 4.9995
- 4.99943 4.9994 4.9994 4.99942 4.99944 4.99948 4.99952 4.99956
- 4.99961 4.99965 4.9997 4.99974 4.99977 4.99981 4.99983 4.99986
- 4.99988 4.9999 4.99991 4.99992 4.99993 4.99994 4.99995 4.99995
- 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999 4.99999
- 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5
- 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 5 5.00019 4.99888 4.99663 4.99457 4.99902
- 5.00229 5.00323 5.00302 5.0023 5.0015 5.00085 5.00041 5.00013
- 4.99993 4.99979 4.99948 4.99954 4.99983 5.00055 5.00109
- 5.00009 4.9987 4.998 4.99755 4.99676 4.99618 5.01091 5.05272
- 5.04156 4.80112 4.27692 3.42343 2.23953 0.967179 0.429813
- 0.540757 1.32991 2.32147 3.14903 3.78143 4.22325 4.47978
- 4.59448 4.69875 4.79798 4.87419 4.92339 4.95249 4.97174
- 4.98408 4.99124 4.99478 4.99729 4.99868 4.9992 4.99941 4.99947
- 4.99946 4.99943 4.9994 4.99939 4.9994 4.99942 4.99946 4.99951
- 4.99956 4.99961 4.99967 4.99973 4.99977 4.9998 4.99981 4.99983
- 4.99984 4.99987 4.99992 5.00001 5.00005 5.00001 4.99994
- 4.99995 4.99995 4.99996 4.99996 4.99996 4.99997 4.99997
- 4.99997 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999
- 4.99999 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5 5 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999
- 4.99998 4.99998 4.99998
-}
-.graph element create V30 -x x -y v30
-
-v31 set {
- 1.8179e-09 -5.28841e-06 -1.44913e-05 -3.62932e-05 -9.75719e-05
- 0.000141781 3.73396e-05 -1.65603e-05 -1.5271e-05 -6.73884e-06
- 4.40157e-06 -4.85345e-06 -1.02964e-05 2.03126e-05 -1.89457e-05
- -8.75564e-06 7.67422e-06 4.71103e-06 1.29798e-05 6.13469e-06
- -1.14363e-05 -0.0394563 -0.0477298 -0.0622012 -0.0519225
- 0.262499 0.943611 1.67052 2.31017 2.84028 3.28467 3.61582
- 3.85887 4.13011 4.36511 4.54063 4.67013 4.76408 4.83263
- 4.8825 4.91837 4.94373 4.96117 4.97318 4.98093 4.98562 4.98906
- 4.99267 4.99539 4.99666 4.99731 4.99797 4.99844 4.99887
- 4.99927 4.99933 4.99938 4.99944 4.99949 4.99955 4.9996 4.99965
- 4.9997 4.99975 4.9998 4.99985 4.99986 4.99987 4.99989 4.9999
- 4.99991 4.99992 4.99993 4.99995 4.99996 4.99997 4.99998
- 4.99998 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5.00001
- 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99997 5.00002 5.00004 5.0001 5.0001 4.99987 5.00009
- 5.00021 5.00002 5.00004 4.99988 5.00013 4.99993 5.00026
- 4.99973 5 5.00006 5.00009 5.00004 5.00004 5.04854 4.82711
- 4.04208 2.64155 0.838902 0.19014 0.0982549 0.0723197 0.0576863
- 0.0427644 0.0301979 0.020146 0.0135728 0.00980358 0.00774482
- 0.00586604 0.0036687 0.00211511 0.00121906 0.000647581 0.000828436
- 0.00190938 0.00224254 0.00199956 0.00165488 0.00135612 0.00113715
- 0.000984181 0.000877175 0.000789973 0.000741139 0.000689338
- 0.000625676 0.000586082 0.000550152 0.000529573 0.000505606
- 0.000482117 0.000460574 0.000441649 0.000424674 0.000408398
- 0.000391914 0.000376272 0.000361487 0.000348181 0.000336045
- 0.000324466 0.000313545 0.000303046 0.000293056 0.00028356
- 0.000274586 0.000266155 0.000258279 0.000250938 0.000243789
- 0.000236912 0.000230244 0.000224186 0.000219291 0.000215346
- 0.000212468 0.000207291 0.000200862 0.00019368 0.000186767
- 0.000183515 0.000180263 0.00017701 0.000173758 0.000170506
- 0.000167253 0.000164001 0.000161164 0.000158357 0.00015555
- 0.000152743 0.000149936 0.000147129 0.000144322 0.000142066
- 0.000140096 0.000138127 0.000136157 0.000134187 0.000132218
- 0.000130248 0.000128278 0.000126308 0.000124339 0.000122369
- 0.000120399 0.000118429 0.00011646 0.000114527 0.000112892
- 0.000111258 0.000109623 0.000107988 0.000103598 6.86052e-05
- 3.337e-05 7.00783e-05 0.000218764 0.000221318 0.000118593
- -0.000113962 5.78552e-05 9.42068e-05 0.000237037 0.000171302
- 0.0001033 6.16066e-05 5.52908e-05 6.30233e-05 7.01897e-05
- 8.48573e-05 0.000106859 8.37213e-05 -0.0391541 -0.047722
- -0.0618454 -0.0169804 0.345725 1.03426 1.74825 2.37152 2.88737
- 3.32173 3.66761 3.9707 4.17762 3.98832 3.30483 2.09737 0.710892
- 0.148159 0.0707463 0.0555808 0.045618 0.0319116 0.0199589
- 0.0133357 0.00898528 0.00586075 0.00375478 0.00245443 0.00156038
- 0.000962344 0.000590953 0.000375107 0.000250243 0.00015882
- 0.000100203 6.18122e-05 3.7372e-05 2.23009e-05 1.32569e-05
- 8.29437e-06 5.72457e-06 3.96832e-06 2.98935e-06 2.59699e-06
- 2.75024e-06 3.38689e-06 4.0453e-06 3.50095e-06 1.64988e-06
- -3.84371e-07 -2.03828e-06 -3.46401e-06 -1.24301e-06 4.63458e-06
- 1.14104e-05 1.02619e-05 2.15487e-06 -2.98487e-06 -3.67221e-06
- -2.94279e-06 -2.58649e-06 -2.23019e-06 -1.87389e-06 -1.5176e-06
- -1.1613e-06 -7.92127e-07 -4.18889e-07 -4.56502e-08 3.27588e-07
- 7.00827e-07 8.79539e-07 8.17025e-07 7.5451e-07 6.91996e-07
- 6.29481e-07 5.66966e-07 5.04452e-07 4.41937e-07 3.79422e-07
- 3.16908e-07 2.54393e-07 1.90078e-07 1.25366e-07 6.0654e-08
- -4.05776e-09 -6.87696e-08 -1.33481e-07 -1.98193e-07 -2.62905e-07
- -3.27617e-07 -3.92329e-07 -4.40392e-07 -4.18802e-07 -3.97213e-07
- -3.75624e-07 -3.54035e-07 -3.32446e-07 -3.10856e-07 -2.89267e-07
- -2.67678e-07
-}
-.graph element create V31 -x x -y v31
-v32 set {
- 1.10294 1.10297 1.10291 1.10277 1.10259 1.10294 1.10313
- 1.10306 1.10299 1.10296 1.10295 1.10295 1.10294 1.10294
- 1.10294 1.10294 1.10294 1.10294 1.10294 1.10296 1.10296
- 1.00547 0.998599 1.5201 2.49297 3.31258 3.73162 3.84757
- 3.92505 4.02965 4.16599 4.30294 4.41541 4.52886 4.64414
- 4.73865 4.81065 4.86391 4.90315 4.93188 4.95258 4.96726
- 4.97738 4.98436 4.98888 4.99162 4.99363 4.99573 4.99731
- 4.99804 4.99843 4.99881 4.99909 4.99934 4.99957 4.9996 4.99964
- 4.99967 4.9997 4.99973 4.99977 4.9998 4.99983 4.99986 4.99988
- 4.99991 4.99992 4.99992 4.99993 4.99994 4.99994 4.99995
- 4.99996 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999
- 4.99999 4.99999 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 5.00028 4.99988 4.99968
- 5.00019 4.99987 5.00021 4.99973 4.99977 4.99996 4.99997
- 5.0002 4.99957 5.00026 4.99947 5.00074 5.00003 4.99987 4.99979
- 5.00008 4.99997 5.08794 5.05993 4.76875 3.99197 3.10174
- 2.5197 2.21771 2.04 1.92235 1.83874 1.77592 1.72665 1.686
- 1.65276 1.6286 1.61299 1.60039 1.58934 1.57954 1.57083 1.56306
- 1.55604 1.54963 1.54375 1.53832 1.53331 1.52865 1.52432
- 1.52026 1.51645 1.51287 1.50949 1.50629 1.50327 1.50039
- 1.49766 1.49505 1.49257 1.49019 1.48792 1.48574 1.48365
- 1.48164 1.47971 1.47784 1.47604 1.47431 1.47264 1.47102
- 1.46945 1.46794 1.46647 1.46505 1.46367 1.46233 1.46103
- 1.45976 1.45853 1.45733 1.45616 1.45502 1.45392 1.45284
- 1.45179 1.45076 1.44975 1.4488 1.44795 1.44711 1.44626 1.44541
- 1.44457 1.44372 1.44287 1.44212 1.44138 1.44063 1.43989
- 1.43914 1.4384 1.43766 1.43701 1.43641 1.43581 1.43522 1.43462
- 1.43402 1.43342 1.43282 1.43223 1.43163 1.43103 1.43043
- 1.42984 1.42924 1.42865 1.42808 1.42752 1.42695 1.42639
- 1.42584 1.42529 1.42472 1.42412 1.42365 1.42326 1.42304
- 1.42162 1.42082 1.42032 1.42029 1.42026 1.41995 1.41947
- 1.41894 1.41841 1.4179 1.41742 1.41699 1.41656 1.32097 1.30963
- 1.78765 2.64656 3.35764 3.747 3.86589 3.94217 4.04185 4.18453
- 4.3561 4.53439 4.68621 4.74905 4.77848 4.84629 4.91261 4.97541
- 5.01284 5.01548 5.01248 5.00924 5.00666 5.00475 5.00334
- 5.00234 5.00164 5.00118 5.00083 5.00058 5.0004 5.00028 5.00019
- 5.00013 5.00009 5.00007 5.00004 5.00003 5.00002 5.00001
- 5.00001 5.00001 5 5 4.99999 4.99995 4.99992 4.99996 5.00006
- 5.00012 5.00009 4.99997 4.9999 4.99985 4.99986 4.99997 5.00021
- 5.00031 5.00024 5.0001 5.00007 5.00005 5.00003 5.00001 4.99998
- 4.99998 4.99999 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5
- 5 4.99999 4.99999 4.99999 4.99998 4.99998 4.99998
-}
-.graph element create V32 -x x -y v32
-v33 set {
- 5 5.00012 5.00023 5.0003 4.99972 4.99988 4.99984 4.99991
- 4.99996 4.99999 5.00008 5.00009 4.99986 5.00003 5.00007
- 4.99995 4.9999 4.99997 5.00013 5.00014 5.00013 4.99701 4.99763
- 4.99742 4.99998 5.02836 5.07262 4.96856 4.57267 3.85637
- 2.79544 1.45942 0.408016 0.084885 0.0271375 0.0119294 0.00707546
- 0.0051087 0.00373035 0.00264737 0.00186477 0.00130379 0.000915857
- 0.000653121 0.000483893 0.000380852 0.000302362 0.000219498
- 0.000154435 0.000121928 0.000104026 8.61242e-05 7.48526e-05
- 6.49216e-05 5.56238e-05 5.29689e-05 5.03139e-05 4.7659e-05
- 4.5004e-05 4.23491e-05 4.00356e-05 3.79522e-05 3.58687e-05
- 3.37852e-05 3.17018e-05 2.97592e-05 2.89804e-05 2.82016e-05
- 2.74228e-05 2.66441e-05 2.58653e-05 2.50865e-05 2.43077e-05
- 2.35289e-05 2.27501e-05 2.19714e-05 2.12346e-05 2.07821e-05
- 2.03295e-05 1.98769e-05 1.94244e-05 1.89718e-05 1.85192e-05
- 1.80667e-05 1.76141e-05 1.71615e-05 1.6709e-05 1.62828e-05
- 1.60061e-05 1.57294e-05 1.54527e-05 1.5176e-05 1.48993e-05
- 1.46226e-05 1.43459e-05 1.40692e-05 1.37925e-05 1.35158e-05
- 1.3262e-05 1.31191e-05 1.29761e-05 1.28332e-05 1.26903e-05
- 1.25474e-05 1.24045e-05 1.22615e-05 1.21186e-05 1.19757e-05
- 1.18328e-05 1.16898e-05 1.15469e-05 1.1404e-05 1.12611e-05
- 1.11182e-05 1.09752e-05 1.08323e-05 1.06894e-05 1.05465e-05
- 1.04036e-05 1.02606e-05 1.00185e-05 3.8343e-05 -3.06781e-05
- -0.000111758 0.000111673 0.000130815 -0.000210491 -0.000231304
- 0.000310226 0.000265303 3.0878e-05 -4.48405e-05 -1.2852e-05
- -7.84469e-06 3.29986e-05 -1.23286e-05 -6.07871e-05 5.35082e-05
- 7.69194e-05 0.000126221 6.57178e-05 0.00223349 -0.0148854
- -0.0476636 -0.0491447 0.220125 1.11174 2.03988 2.90209 3.61069
- 4.13554 4.50679 4.71501 4.83916 4.91027 4.95284 4.98086
- 4.99151 4.98651 4.97113 4.95075 4.93102 4.93683 4.95457
- 4.97071 4.98212 4.98948 4.99386 4.99636 4.99785 4.9987 4.99927
- 4.99989 5.00014 5.00007 4.99988 4.99982 4.99976 4.99973
- 4.99972 4.99972 4.99973 4.99974 4.99975 4.99977 4.99979
- 4.99981 4.99984 4.99986 4.99988 4.99989 4.99991 4.99992
- 4.99993 4.99994 4.99995 4.99996 4.99996 4.99997 4.99997
- 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999
- 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00002 5.00001 5.00001
- 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
- 4.99999 4.99999 4.99999 5 5.00012 4.99946 4.99839 4.99733
- 4.99948 5.00114 5.00158 5.00147 5.00113 5.00073 5.00043
- 5.0002 5.00006 4.99995 4.99986 4.99973 4.99976 4.9999 5.00029
- 5.00055 4.99704 4.99734 4.9972 5.00278 5.03354 5.07184 4.94057
- 4.51936 3.75638 2.60982 1.23803 0.315016 0.0796102 0.0252894
- 0.0165723 0.0827785 0.491298 1.40686 2.33436 3.1251 3.7691
- 4.22201 4.49976 4.68115 4.80513 4.88509 4.93208 4.95861
- 4.97579 4.98655 4.99268 4.99571 4.99771 4.99881 4.99929
- 4.99954 4.99965 4.9997 4.99971 4.99971 4.99971 4.99971 4.99972
- 4.99974 4.99976 4.99978 4.99981 4.99984 4.99987 4.99989
- 4.99991 4.99991 4.99992 4.99992 4.99993 4.99997 5.00003
- 5.00006 5.00004 5.00001 5 4.99999 4.99998 4.99998 4.99997
- 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999 4.99999
- 4.99999 4.99999 5 5 5 5 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 4.99999
- 4.99999 4.99999 4.99999 4.99998 4.99998
-}
-.graph element create V33 -x x -y v33
-v34 set {
- 5 5.00207 5.00813 5.01486 5.00156 5.0018 4.99861 4.99844
- 4.99888 4.9993 4.99956 4.99971 4.99979 4.99983 4.99987 4.99989
- 4.99671 4.9974 4.99864 5.00131 5.00377 5.0021 5.00039 4.99993
- 5.00004 5.0009 5.00109 4.99636 4.98617 4.96778 4.92047 4.89528
- 4.91112 4.9559 4.98286 4.99369 4.99812 4.99951 4.99994 5.00014
- 5.00008 4.99994 4.99984 4.99989 4.99998 5.00004 5.00004
- 5.00006 5.00005 5.00001 4.99997 4.99992 4.99993 4.99994
- 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996
- 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996
- 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997
- 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997
- 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
- 4.99998 4.99998 4.99998 4.99998 5.00131 5.00072 4.9977 4.99811
- 5.00325 4.99647 4.98948 4.99459 5.00262 5.00276 5.00156
- 5.00072 5.0003 5.00013 4.99995 4.99668 4.99775 4.99917 5.00173
- 5.00386 5.00188 4.99888 4.99757 4.99951 5.01712 5.0557 5.07088
- 5.07704 5.07758 5.06958 5.04223 5.03331 5.0279 5.03408 5.07611
- 5.01911 4.68594 3.99152 2.92195 1.69878 0.809 0.344091 0.154663
- 0.0788717 0.0467212 0.0336168 0.0280514 0.0254947 0.024173
- 0.0223567 0.0220555 0.0271514 0.0295872 0.0296052 0.0283971
- 0.0264726 0.0241813 0.0218244 0.0195349 0.017368 0.0152495
- 0.013295 0.0115444 0.00996982 0.00857091 0.00733891 0.00627261
- 0.0053494 0.00456316 0.00388373 0.00331073 0.00282181 0.00240991
- 0.00206389 0.00177187 0.00152283 0.00131167 0.00112558 0.000954373
- 0.000805726 0.00069326 0.000600991 0.000525743 0.00047355
- 0.00044359 0.000434815 0.000436053 0.000402511 0.000368969
- 0.000335427 0.000301886 0.000268344 0.000234802 0.00020126
- 0.000184967 0.000169932 0.000154896 0.000139861 0.000124825
- 0.00010979 9.47546e-05 8.67896e-05 8.24901e-05 7.81906e-05
- 7.38911e-05 6.95915e-05 6.5292e-05 6.09925e-05 5.66929e-05
- 5.23934e-05 4.80939e-05 4.37943e-05 3.94948e-05 3.51953e-05
- 3.08957e-05 2.67968e-05 2.42936e-05 2.17904e-05 1.92872e-05
- 1.6784e-05 0.00125927 -0.00794344 -0.0305499 -0.0621697
- -0.0463796 -0.0224608 -0.00538381 0.00546086 0.0108675 0.012883
- 0.0131787 0.0127271 0.0119702 0.0110398 0.0100635 0.00649617
- 0.00489388 0.00545863 0.0098351 0.0167428 0.0126563 0.00697542
- 0.00427027 0.00330002 0.00390774 0.00408999 -0.00259143
- -0.0160578 -0.0451849 -0.0409651 0.1301 0.597429 1.3848
- 2.63426 3.81272 4.51373 4.8412 4.98731 4.88165 4.37165 3.40034
- 2.17681 1.12217 0.505129 0.219703 0.104992 0.0622333 0.0448317
- 0.0355782 0.0311867 0.0293529 0.0274615 0.0288739 0.0307845
- 0.0304909 0.029245 0.0273602 0.0251006 0.022697 0.0202765
- 0.0179357 0.0157106 0.0136562 0.0117951 0.0101273 0.00865784
- 0.00739394 0.00634364 0.00551356 0.00480538 0.00415747 0.00356084
- 0.00297585 0.00236711 0.00181853 0.00160713 0.00169822 0.00166542
- 0.00145504 0.00120252 0.00109259 0.000982658 0.00087273
- 0.000762802 0.000652874 0.000584068 0.000528263 0.000472458
- 0.000416653 0.000360848 0.000321155 0.000301442 0.000281729
- 0.000262016 0.000242303 0.00022259 0.000202877 0.000183164
- 0.000163451 0.000143738 0.000124025 0.000114582 0.000107399
- 0.000100216 9.30332e-05 8.58502e-05 7.86672e-05 7.14841e-05
- 6.43011e-05 5.7118e-05 4.9935e-05 4.35378e-05 4.04281e-05
- 3.73184e-05 3.42088e-05 3.10991e-05 2.79894e-05 2.48798e-05
- 2.17701e-05 1.86604e-05
-}
-.graph element create V34 -x x -y v34
-v35 set {
- 7.24585e-12 2.21843e-05 3.20014e-05 1.25076e-05 -2.44947e-05
- 1.8425e-05 5.50546e-06 3.53025e-05 -1.07551e-05 -3.94383e-06
- -2.27848e-06 -9.04789e-05 7.44215e-05 -2.7662e-05 0.000200038
- -2.11998e-05 -2.09011e-05 2.37098e-05 2.18751e-05 -2.28422e-05
- -6.23659e-05 3.58241e-05 1.76386e-05 -4.28311e-05 0.000355626
- 0.00156903 0.00100999 -0.0085304 -0.02067 -0.0389485 -0.0651568
- -0.128475 -0.314362 -0.406837 -0.421558 -0.421277 -0.418176
- -0.414481 -0.410845 -0.407348 -0.403971 -0.400716 -0.397582
- -0.394563 -0.391658 -0.388866 -0.386178 -0.383585 -0.381094
- -0.378789 -0.376569 -0.37435 -0.372256 -0.370188 -0.36815
- -0.366422 -0.364694 -0.362967 -0.361239 -0.359511 -0.357888
- -0.356334 -0.354781 -0.353227 -0.351674 -0.350152 -0.348888
- -0.347625 -0.346361 -0.345098 -0.343834 -0.342571 -0.341307
- -0.340044 -0.33878 -0.337517 -0.336279 -0.335215 -0.334152
- -0.333088 -0.332024 -0.330961 -0.329897 -0.328833 -0.32777
- -0.326706 -0.325642 -0.324601 -0.323683 -0.322766 -0.321849
- -0.320932 -0.320014 -0.319097 -0.31818 -0.317263 -0.316345
- -0.315428 -0.314545 -0.313825 -0.313106 -0.312387 -0.311667
- -0.310948 -0.310228 -0.309509 -0.308789 -0.30807 -0.307351
- -0.306631 -0.305912 -0.305192 -0.304473 -0.303754 -0.303034
- -0.302315 -0.301595 -0.300876 -0.300157 -0.299437 -0.298716
- -0.29798 -0.297329 -0.296691 -0.295837 -0.29516 -0.294725
- -0.294044 -0.292917 -0.292351 -0.291965 -0.291365 -0.290687
- -0.290027 -0.289376 -0.288772 -0.288193 -0.287505 -0.286892
- -0.28626 -0.285714 -0.284545 -0.289246 -0.298717 -0.298492
- -0.214163 0.181451 0.0749974 0.0454707 0.0292987 0.0196837
- 0.0124119 0.00884715 0.00527181 0.00585821 0.0296361 0.169856
- 0.361207 0.538856 0.67469 0.685933 0.392802 0.17772 0.0813085
- 0.0424601 0.0246654 0.0175258 0.0144256 0.0129859 0.012205
- 0.0112846 0.010933 0.0134813 0.0147254 0.0147981 0.0142156
- 0.0132732 0.0121355 0.0109587 0.00981238 0.00872731 0.00767007
- 0.00669346 0.00581341 0.00502167 0.00431819 0.00369842 0.00316168
- 0.00269663 0.00230035 0.00195801 0.00166928 0.00142286 0.00121522
- 0.00104072 0.000893384 0.000767675 0.000661268 0.000567659
- 0.000481766 0.000407101 0.000350044 0.000302721 0.000263424
- 0.000236813 0.00022199 0.000218182 0.000219548 0.0002027
- 0.000185853 0.000169006 0.000152158 0.000135311 0.000118463
- 0.000101616 9.33782e-05 8.57685e-05 7.81588e-05 7.0549e-05
- 6.29393e-05 5.53296e-05 4.77199e-05 4.36954e-05 4.15296e-05
- 3.93637e-05 3.71978e-05 3.50319e-05 3.28661e-05 3.07002e-05
- 2.85343e-05 2.63685e-05 2.42026e-05 2.20367e-05 1.98709e-05
- 1.7705e-05 1.55391e-05 1.34772e-05 1.22416e-05 1.10061e-05
- 9.77055e-06 8.535e-06 0.000631271 -0.00362586 -0.0146235
- -0.0308486 -0.0237466 -0.0117522 -0.00304171 0.00251033
- 0.00531986 0.0063897 0.00657351 0.00636494 0.00599705 0.00553442
- 0.00505994 0.00330925 0.00246671 0.0027006 0.00473161 0.00830333
- 0.00649147 0.00356815 0.00217448 0.00187579 0.00270447 0.00219543
- -0.00546118 -0.0179576 -0.0445306 -0.0649309 0.0197935 0.473629
- 0.87268 0.269542 0.0086094 0.0844602 0.606456 1.04929 0.906014
- 0.916205 0.919425 0.872867 0.556244 0.262457 0.11838 0.0571226
- 0.0333451 0.0237133 0.0185096 0.0159617 0.0148663 0.0138683
- 0.0144081 0.0153797 0.0152551 0.0146487 0.0137192 0.0125973
- 0.0113996 0.0101903 0.00901851 0.00790495 0.00687502 0.00593994
- 0.00510092 0.00436111 0.00372439 0.0031945 0.00277537 0.00241888
- 0.002095 0.00179943 0.00150419 0.00119264 0.00090934 0.000802394
- 0.000852816 0.000838368 0.000730842 0.000601028 0.000546616
- 0.000492205 0.000437793 0.000383381 0.000328969 0.00029454
- 0.000266428 0.000238317 0.000210205 0.000182093 0.000162091
- 0.000152145 0.000142198 0.000132252 0.000122306 0.000112359
- 0.000102413 9.24665e-05 8.25201e-05 7.25738e-05 6.26274e-05
- 5.78553e-05 5.42216e-05 5.05878e-05 4.69541e-05 4.33204e-05
- 3.96867e-05 3.60529e-05 3.24192e-05 2.87855e-05 2.51518e-05
- 2.19153e-05 2.03406e-05 1.8766e-05 1.71913e-05 1.56167e-05
- 1.4042e-05 1.24674e-05 1.08927e-05 9.31806e-06
-}
-.graph element create V35 -x x -y v35
-v36 set {
- 5 5.01426 5.02852 5.01923 4.77685 4.56471 4.52338 4.56813
- 4.63122 4.693 4.74776 4.79385 4.83258 4.86358 4.88918 4.91021
- 4.90553 4.89733 4.89554 4.91953 5.00757 5.07101 5.06318
- 5.05241 5.05535 5.08042 5.07251 4.90973 4.56136 3.98637
- 3.237 2.67216 2.33678 2.13529 2.00544 1.91429 1.84638 1.79461
- 1.75338 1.71958 1.69175 1.6686 1.64918 1.63258 1.61836 1.60607
- 1.59506 1.58483 1.57575 1.56847 1.56193 1.55538 1.54968
- 1.54416 1.5388 1.53523 1.53165 1.52807 1.52449 1.52091 1.51771
- 1.51477 1.51182 1.50888 1.50593 1.50309 1.50113 1.49917
- 1.4972 1.49524 1.49328 1.49132 1.48935 1.48739 1.48543 1.48346
- 1.48157 1.48012 1.47868 1.47724 1.47579 1.47435 1.47291
- 1.47146 1.47002 1.46857 1.46713 1.46574 1.46462 1.4635 1.46238
- 1.46126 1.46014 1.45902 1.4579 1.45678 1.45567 1.45455 1.45349
- 1.45275 1.45201 1.45127 1.45053 1.44979 1.44905 1.44831
- 1.44757 1.44683 1.44609 1.44535 1.44461 1.44387 1.44313
- 1.44239 1.44165 1.44091 1.44017 1.43943 1.43869 1.43795
- 1.43721 1.43874 1.43976 1.43619 1.43182 1.43726 1.43084
- 1.42587 1.42383 1.42642 1.42728 1.42736 1.4271 1.42669 1.42621
- 1.42569 1.41703 1.41244 1.41019 1.41199 1.41833 1.42502
- 1.41504 1.37535 1.28381 1.44779 2.33713 3.25835 3.67554
- 3.84975 4.01125 4.2253 4.45433 4.62215 4.74478 4.82998 4.8868
- 4.92396 4.94768 4.96498 4.98537 5.0128 5.04467 5.06722 5.06535
- 5.01475 4.91956 4.80647 4.7242 4.7059 4.73552 4.76379 4.81684
- 4.87376 4.92276 4.96112 4.9884 5.0045 5.00999 5.00933 5.00619
- 5.00384 5.00342 5.00373 5.00362 5.00309 5.00272 5.00239
- 5.00204 5.00172 5.00146 5.00124 5.00105 5.00089 5.00076
- 5.00065 5.00057 5.00048 5.00041 5.00034 5.00028 5.00023
- 5.00019 5.00015 5.00015 5.00016 5.0002 5.00023 5.00021 5.00019
- 5.00017 5.00015 5.00012 5.0001 5.00008 5.00007 5.00006 5.00005
- 5.00004 5.00003 5.00002 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002
- 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00001
- 5.00001 5.00001 5.00062 4.99506 4.9835 4.96726 4.9728 4.97877
- 4.98675 4.9966 5.00406 5.00679 5.00629 5.00561 5.00487 5.00429
- 5.00384 5.002 5.00164 5.00229 5.00484 5.00769 5.00019 5.00242
- 5.01319 5.0335 5.07265 5.10129 5.11485 5.12551 5.13953 5.16048
- 5.18862 5.22811 5.25656 5.25627 5.19975 4.9139 4.24745 3.43732
- 2.8202 2.43224 2.17409 2.01333 1.93951 1.94622 1.98861 2.02217
- 2.05383 2.08376 2.11184 2.13793 2.16191 2.18267 2.20502
- 2.22837 2.24958 2.26901 2.28648 2.302 2.31582 2.32802 2.33869
- 2.34795 2.35596 2.36282 2.3687 2.37371 2.37797 2.38161 2.38476
- 2.38743 2.3897 2.39168 2.39329 2.39463 2.39575 2.39671 2.39756
- 2.39835 2.39907 2.39968 2.39999 2.4003 2.40061 2.40091 2.40122
- 2.40142 2.40159 2.40176 2.40193 2.4021 2.40222 2.40228 2.40234
- 2.4024 2.40247 2.40253 2.40259 2.40265 2.40271 2.40277 2.40284
- 2.40287 2.40289 2.40291 2.40294 2.40296 2.40298 2.40301
- 2.40303 2.40305 2.40308 2.4031 2.40311 2.40312 2.40313 2.40314
- 2.40315 2.40316 2.40317 2.40318
-}
-.graph element create V36 -x x -y v36
-v37 set {
- 5 5.01732 5.03181 5.05944 5.12686 5.20725 5.28103 5.31254
- 5.32901 5.33709 5.3408 5.34257 5.34311 5.34347 5.34386 5.34411
- 5.3406 5.33484 5.32942 5.32904 5.33644 5.34869 5.35001 5.34882
- 5.34758 5.34672 5.34599 5.34496 5.34364 5.34165 5.33712
- 5.33502 5.3366 5.34067 5.34306 5.34398 5.34434 5.34442 5.34443
- 5.34443 5.34441 5.34439 5.34437 5.34437 5.34438 5.34438
- 5.34438 5.34438 5.34438 5.34437 5.34437 5.34436 5.34436
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
- 5.34437 5.34437 5.34437 5.34437 5.34437 5.35377 5.35451
- 5.34265 5.34488 5.35861 5.28622 4.90033 4.75027 4.89731
- 4.97098 4.99293 4.99832 4.99909 4.99956 4.99858 4.99829
- 4.9998 5.00035 5.0038 5.00989 5.00251 4.99438 4.9953 4.99761
- 4.99985 5.00152 5.0011 5.00046 4.99996 4.99925 4.99862 4.99919
- 4.99961 5.00048 5.00234 4.99654 4.98235 4.95936 4.83738
- 4.53021 4.21004 4.00593 3.91207 3.88059 3.87822 3.89117
- 3.91278 3.94044 3.97376 4.01152 4.05052 4.10679 4.17908
- 4.25673 4.33414 4.40875 4.47879 4.54342 4.60258 4.65595
- 4.70291 4.74414 4.78018 4.81185 4.83915 4.86291 4.88301
- 4.90048 4.91528 4.92802 4.9387 4.94777 4.95539 4.9618 4.96725
- 4.97195 4.97588 4.97932 4.98247 4.98512 4.98697 4.98831
- 4.98919 4.99015 4.99101 4.99169 4.99222 4.99282 4.99341
- 4.994 4.9946 4.99519 4.99578 4.99638 4.99667 4.99693 4.9972
- 4.99747 4.99773 4.998 4.99827 4.99841 4.99849 4.99856 4.99864
- 4.99872 4.9988 4.99888 4.99896 4.99904 4.99911 4.99919 4.99927
- 4.99935 4.99943 4.9995 4.99955 4.9996 4.99965 4.9997 5.00736
- 4.98252 4.87516 4.66727 4.49142 4.43103 4.4301 4.4571 4.49729
- 4.5407 4.5835 4.62363 4.66114 4.69577 4.72738 4.74632 4.75971
- 4.77576 4.80671 4.87073 4.91665 4.93252 4.94418 4.95331
- 4.96094 4.96727 4.97148 4.97471 4.97612 4.98276 5.00247
- 5.04086 5.08628 5.10673 5.08887 5.0564 5.02767 5.01336 4.99685
- 4.97422 4.90866 4.67035 4.33117 4.07888 3.94432 3.89105
- 3.88174 3.89292 3.91442 3.94564 3.98708 4.0355 4.09134 4.16315
- 4.24088 4.31918 4.39527 4.46693 4.53337 4.59405 4.6486 4.69693
- 4.73938 4.77617 4.80809 4.83551 4.85895 4.87894 4.89596
- 4.91081 4.92417 4.93651 4.94552 4.95198 4.9565 4.96096 4.96523
- 4.96972 4.97428 4.97868 4.98064 4.9826 4.98455 4.98651 4.98847
- 4.98967 4.99064 4.9916 4.99257 4.99353 4.99422 4.99457 4.99493
- 4.99528 4.99563 4.99598 4.99633 4.99668 4.99703 4.99738
- 4.99773 4.9979 4.99804 4.99817 4.9983 4.99843 4.99856 4.99869
- 4.99883 4.99896 4.99909 4.99921 4.99926 4.99931 4.99937
- 4.99942 4.99948 4.99953 4.99959 4.99964
-}
-.graph element create V37 -x x -y v37
-v38 set {
- 4.49849 4.53282 4.58329 4.66625 4.83345 4.97823 5.0207 5.01816
- 5.01116 5.00595 5.00296 5.00148 5.00073 5.00062 5.00033
- 5.0003 4.99864 4.99661 4.99652 4.99928 5.00361 5.12573 5.17251
- 5.22612 5.33479 5.44503 5.44432 5.44379 5.44334 5.443 5.44276
- 5.44258 5.44246 5.44238 5.44232 5.44228 5.44225 5.44223
- 5.44221 5.4422 5.44219 5.44219 5.44218 5.44218 5.44218 5.44218
- 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217
- 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217
- 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44216
- 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216
- 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216
- 5.44216 5.44216 5.44216 5.44216 5.44215 5.44215 5.44215
- 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215
- 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215
- 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215
- 5.44214 5.44214 5.44214 5.44214 5.44214 5.44214 5.44214
- 5.44214 5.44214 5.44214 5.44214 5.44212 5.45159 5.45236
- 5.44064 5.44307 5.45616 5.38122 4.77163 3.53297 2.74466
- 2.34448 2.11802 1.9783 1.88656 1.82001 1.77389 1.72955 1.69632
- 1.66971 1.6526 1.65236 1.56034 1.53764 1.97139 2.75096 3.39212
- 3.74042 3.82345 3.85696 3.88547 3.91862 3.9585 4.00467 4.05903
- 4.1254 4.19533 4.26791 4.34517 4.42112 4.49238 4.55807 4.6179
- 4.6713 4.71815 4.75889 4.79418 4.82456 4.85062 4.87291 4.89196
- 4.90823 4.92209 4.93388 4.9439 4.95242 4.95968 4.96585 4.97108
- 4.9755 4.97923 4.98237 4.98503 4.98732 4.98927 4.99094 4.99233
- 4.99353 4.99452 4.99538 4.99608 4.99668 4.99718 4.9976 4.99794
- 4.99822 4.99847 4.99867 4.99884 4.99899 4.99913 4.99924
- 4.99932 4.99938 4.99943 4.99947 4.99951 4.99953 4.99955
- 4.99958 4.99961 4.99964 4.99967 4.99969 4.99972 4.99975
- 4.99977 4.99978 4.99979 4.99981 4.99982 4.99983 4.99985
- 4.99986 4.99986 4.99987 4.99987 4.99988 4.99988 4.99988
- 4.99989 4.99989 4.9999 4.9999 4.99991 4.99991 4.99992 4.99992
- 4.99993 4.99993 4.99993 4.99994 5.00381 5.00064 4.99246
- 4.99823 5.00349 5.00076 5.00033 5.00015 5.00009 5.00007
- 5.00005 5.00004 5.00003 5.00002 4.99988 4.99732 4.99728
- 4.9978 5.00187 5.00927 5.08712 5.07654 4.92855 4.4863 3.76162
- 3.00049 2.49834 2.20883 2.03492 1.92384 1.84676 1.79021
- 1.74716 1.7132 1.68576 1.66309 1.64406 1.62785 1.61383 1.60162
- 1.59081 1.58117 1.57253 1.56473 1.55765 1.55117 1.54527
- 1.53988 1.53485 1.53012 1.5257 1.5216 1.51773 1.51411 1.51071
- 1.50746 1.50438 1.50146 1.49868 1.49603 1.4935 1.49109 1.48878
- 1.48657 1.48445 1.48242 1.48046 1.47858 1.47677 1.47502
- 1.47333 1.4717 1.47012 1.46859 1.46711 1.46568 1.46428 1.46292
- 1.4616 1.46034 1.45923 1.45812 1.45701 1.4559 1.45479 1.45378
- 1.45279 1.45181 1.45082 1.44983 1.44893 1.44813 1.44732
- 1.44652 1.44571 1.44491 1.4441 1.4433 1.44249 1.44169 1.44089
- 1.44019 1.43951 1.43883 1.43815 1.43747 1.4368 1.43612 1.43544
- 1.43476 1.43408 1.43342 1.43283 1.43223 1.43163 1.43104
- 1.43044 1.42984 1.42924 1.42865
-}
-.graph element create V38 -x x -y v38
-v39 set {
- 5 5.01048 5.01221 4.98887 4.76261 4.54943 4.51564 4.56249
- 4.62621 4.68843 4.74374 4.79044 4.82972 4.86127 4.88724
- 4.90862 4.90791 4.89858 4.89589 4.91767 5.00405 5.16956
- 5.12391 4.7557 3.87953 3.01124 2.48482 2.20424 2.03812 1.92679
- 1.84956 1.79256 1.74907 1.71487 1.68724 1.6644 1.64513 1.6287
- 1.61446 1.60197 1.59095 1.58117 1.57245 1.5646 1.55752 1.55109
- 1.54516 1.53958 1.53444 1.53008 1.52606 1.52205 1.51843
- 1.5149 1.51146 1.50893 1.50639 1.50387 1.50133 1.4988 1.49651
- 1.49436 1.49222 1.49007 1.48793 1.48585 1.48433 1.4828 1.48128
- 1.47975 1.47823 1.4767 1.47518 1.47365 1.47213 1.4706 1.46912
- 1.46795 1.46678 1.46561 1.46444 1.46327 1.4621 1.46093 1.45976
- 1.45859 1.45741 1.45628 1.45534 1.45441 1.45347 1.45254
- 1.4516 1.45067 1.44973 1.4488 1.44786 1.44693 1.44604 1.44539
- 1.44475 1.4441 1.44345 1.44281 1.44216 1.44151 1.44086 1.44022
- 1.43957 1.43892 1.43828 1.43763 1.43698 1.43633 1.43569
- 1.43504 1.43439 1.43375 1.4331 1.43245 1.4318 1.43157 1.43089
- 1.43001 1.43042 1.42899 1.42439 1.42216 1.43447 1.44048
- 1.43705 1.43314 1.43039 1.42861 1.42739 1.42651 1.42548
- 1.42488 1.4243 1.42392 1.4235 1.32443 1.31149 1.78169 2.64844
- 3.43211 3.95252 4.20231 4.3746 4.49948 4.58929 4.65742 4.71183
- 4.77057 4.83196 4.88354 4.92894 4.96625 4.99235 5.00651
- 5.00941 5.00813 5.00689 5.00588 5.00504 5.00431 5.00368
- 5.00314 5.00268 5.00228 5.00194 5.00165 5.0014 5.00118 5.001
- 5.00085 5.00072 5.00061 5.00052 5.00044 5.00037 5.00031
- 5.00027 5.00022 5.00019 5.00016 5.00013 5.00011 5.00009
- 5.00008 5.00007 5.00006 5.00005 5.00004 5.00003 5.00003
- 5.00003 5.00002 5.00002 5.00002 5.00001 5.00001 5.00001
- 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
- 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99998
- 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999
- 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5.00001
- 5.00002 5.00003 5.00004 5.00022 4.99974 4.99942 4.99997
- 5.00063 5.00002 5.00003 4.99994 4.99998 4.99999 5 5 5 5
- 5 4.99981 4.99998 5.00004 5.00036 5.00049 5.12012 5.16315
- 5.19712 5.21835 4.87874 4.10151 3.31555 2.74207 2.38075
- 2.15872 2.01614 1.91886 1.84852 1.79401 1.75052 1.71508
- 1.68672 1.66467 1.64602 1.62985 1.61576 1.60343 1.59256
- 1.58287 1.57418 1.56632 1.55922 1.55282 1.54687 1.54132
- 1.53618 1.53143 1.52698 1.52282 1.51895 1.51527 1.5118 1.50851
- 1.5054 1.50244 1.49963 1.49695 1.4944 1.49196 1.48963 1.4874
- 1.48527 1.48322 1.48124 1.47934 1.47751 1.47574 1.47403
- 1.47239 1.4708 1.46926 1.46777 1.46632 1.46491 1.46355 1.46237
- 1.4612 1.46002 1.45884 1.45766 1.45659 1.45555 1.45451 1.45346
- 1.45242 1.45147 1.45062 1.44978 1.44894 1.44809 1.44725
- 1.4464 1.44556 1.44472 1.44387 1.44303 1.4423 1.44159 1.44088
- 1.44017 1.43947 1.43876 1.43805 1.43734 1.43664 1.43593
- 1.43524 1.43462 1.434 1.43338 1.43276 1.43213 1.43151 1.43089
- 1.43027
-}
-.graph element create V39 -x x -y v39
-toplevel .top
-.graph legend configure -position .top.legend
-pack .top.legend -fill both -expand yes
-
-button .quit -text "quit" -bg "red" -command "exit"
-blt::table . \
- .graph 0,0 -fill both \
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-Blt_ClosestPoint $graph
-Blt_PrintKey $graph
-
-$graph legend bind all <ButtonRelease-1> { HighlightTrace %W }
-$graph legend bind all <ButtonRelease-3> {
- %W legend deactivate *
- eval %W element deactivate [%W element activate]
-}
-
-proc HighlightTrace { graph } {
- set entry [$graph legend get current]
- set active [$graph legend activate]
- if { [lsearch $active $entry] < 0 } {
- $graph legend activate $entry
- $graph element activate $entry
- } else {
- $graph legend deactivate $entry
- $graph element deactivate $entry
- }
-}
-
-set lastRow 0
-set logicPlots {}
-set leftMargin 0
-set rightMargin 0
-
-proc LogicPlot { from graph signal args } {
- if { ![winfo exists $graph] } {
- global rightMargin leftMargin
- graph $graph -title "" -topmargin 1 -bottommargin 1 -height 0.75i \
- -plotpadx 4 -plotpady 8 -bd 0 \
- -leftmargin $leftMargin -rightmargin $rightMargin
- $graph grid off
- set xMin [$from axis cget x -min]
- set xMax [$from axis cget x -max]
- set yLim [$from axis limits y]
- set yMin [lindex $yLim 0]
- set yMax [lindex $yLim 1]
- $graph axis configure x -title "" -hide yes -min $xMin -max $xMax
- $graph axis configure y -title $signal -min $yMin -max $yMax
- $graph legend configure -anchor nw
- global lastRow
- incr lastRow
- blt::table . $graph $lastRow,0 -fill both
- global logicPlots
- lappend logicPlots $graph
- }
- set list [linsert $args 0 $signal ]
- foreach i [$graph element names] {
- if { [lsearch $list $i] < 0 } {
- $graph element delete $i
- }
- }
- foreach i $list {
- if { ![$graph element exists $i] } {
- $graph element create $i
- }
- set pen [$from element cget $i -pen]
- set xData [$from element cget $i -x]
- set yData [$from element cget $i -y]
- $graph element configure $i -x $xData -y $yData -pen $pen
- }
-}
-
-set changePending "no"
-proc EventuallyChangePlots { p1 p2 how } {
- global changePending
- if { $changePending == "no" } {
- after idle ChangePlots
- }
- set changePending "yes"
-}
-
-proc ChangePlots { } {
- global changePending
- global logicPlots
- global leftMargin rightMargin
- set from .graph
- set xMin [$from axis cget x -min]
- set xMax [$from axis cget x -max]
- set yLim [$from axis limits y]
- set yMin [lindex $yLim 0]
- set yMax [lindex $yLim 1]
- foreach g ".graph .g2 .g3" {
- $g configure -leftmargin $leftMargin -rightmargin $rightMargin
- $g axis configure x -min $xMin -max $xMax
- #$g axis configure y -min $yMin -max $yMax
- }
- set changePending "no"
-}
-
-#LogicPlot .graph .g1 V1
-#LogicPlot .graph .g2 V5
-#LogicPlot .graph .g3 V9
-# LogicPlot .graph .g4 V13
-# LogicPlot .graph .g5 V17
-# LogicPlot .graph .g6 V22
-# LogicPlot .graph .g7 V26
-
-#.g1 configure -leftvariable leftMargin -rightvariable rightMargin
-trace variable leftMargin w EventuallyChangePlots
-trace variable rightMargin w EventuallyChangePlots
-
diff --git a/blt3.0.1/demos/graph7.tcl b/blt3.0.1/demos/graph7.tcl
deleted file mode 100755
index 756f5c7..0000000
--- a/blt3.0.1/demos/graph7.tcl
+++ /dev/null
@@ -1,78 +0,0 @@
-#!../src/bltwish
-
-
-set blt_library ../library
-package require BLT
-set blt_library ../library
-set auto_path [linsert $auto_path 0 ../library]
-source scripts/demo.tcl
-
-image create picture bgTexture -file ./images/buckskin.gif
-
-option add *Graph.Tile bgTexture
-option add *Label.Tile bgTexture
-option add *Frame.Tile bgTexture
-option add *Htext.Tile bgTexture
-option add *TileOffset 0
-option add *HighlightThickness 0
-option add *Element.ScaleSymbols no
-option add *Element.Smooth linear
-option add *activeLine.Color yellow4
-option add *activeLine.Fill yellow
-option add *activeLine.LineWidth 0
-option add *Element.Pixels 3
-option add *Graph.halo 7i
-
-set visual [winfo screenvisual .]
-if { $visual != "staticgray" } {
- option add *print.background yellow
- option add *quit.background red
-}
-
-proc FormatLabel { w value } {
- return $value
-}
-
-set graph .graph
-
-set s1 [image create picture -width 25 -height 25]
-$s1 blank 0x00000000
-$s1 draw circle 12 12 5 -shadow 0 -linewidth 1 \
- -fill 0x90FF0000 -antialias yes
-
-set length 2500000
-blt::graph $graph -title "Scatter Plot\n$length points" -font Arial \
- -plotborderwidth 1 -plotrelief solid -plotpadx 0 -plotpady 0
-$graph xaxis configure \
- -loose no \
- -title "X Axis Label"
-$graph yaxis configure \
- -title "Y Axis Label"
-$graph y2axis configure \
- -title "Y2 Axis Label"
-$graph legend configure \
- -activerelief sunken \
- -background ""
-
-$graph element create line3 -symbol circle -color green4 -fill green2 \
- -linewidth 0 -outlinewidth 1 -pixels 4
-blt::table . .graph 0,0 -fill both
-update
-
-blt::vector x($length) y($length)
-x expr random(x)
-y expr random(y)
-x sort y
-$graph element configure line3 -x x -y y
-
-wm min . 0 0
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
-
-blt::busy hold $graph
-update
-blt::busy release $graph
-
diff --git a/blt3.0.1/demos/hierbox1.tcl b/blt3.0.1/demos/hierbox1.tcl
deleted file mode 100755
index 28f0070..0000000
--- a/blt3.0.1/demos/hierbox1.tcl
+++ /dev/null
@@ -1,98 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-#source scripts/demo.tcl
-
-set saved [pwd]
-
-#blt::bltdebug 100
-
-set imagedir images
-image create picture bgTexture -file $imagedir/rain.gif
-
-set imageList {}
-foreach f [glob $imagedir/mini-*.gif] {
- lappend imageList [image create picture -file $f]
-}
-
-#option add *TreeView.Tile bgTexture
-option add *TreeView.ScrollTile yes
-
-option add *xTreeview.openCommand {
- set path /home/gah/src/blt/%P
- if { [file isdirectory $path] } {
- cd $path
- set files [glob -nocomplain * */. ]
- if { $files != "" } {
- eval %W insert -at %n end $files
- }
- }
-}
-
-option add *xTreeView.closeCommand {
- eval %W delete %n 0 end
-}
-
-blt::treeview .h \
- -yscrollcommand { .vs set } \
- -xscrollcommand { .hs set }
-
-scrollbar .vs -orient vertical -command { .h yview }
-scrollbar .hs -orient horizontal -command { .h xview }
-blt::table . \
- 0,0 .h -fill both \
- 0,1 .vs -fill y \
- 1,0 .hs -fill x
-
-blt::table configure . c1 r1 -resize none
-
-proc DoFind { entry } {
- global fileList
- lappend fileList $entry
- #puts "$entry"
- if { [file type $entry] == "directory" } {
- foreach f [lsort [glob -nocomplain $entry/*]] {
- DoFind $f
- }
- }
-}
-
-proc Find { dir } {
- global fileList
- set fileList {}
- DoFind $dir
- return $fileList
-}
-proc GetAbsolutePath { dir } {
- set saved [pwd]
- cd $dir
- set path [pwd]
- cd $saved
- return $path
-}
-
-set top [GetAbsolutePath .]
-set trim "$top"
-
-.h configure -separator "/" -autocreate yes -trim $trim
-
-.h entry configure root -label "$top"
-.h configure -bg grey90
-update
-
-set fileList [Find $top]
-eval .h insert end $fileList
-.h configure -bg white -alternatebackground grey95
-
-# %n => %#
-# no -activebackground
-# no -image
-
-focus .h
-
-# -labelcolor == -foreground
-set nodes [.h find -glob -name *.c]
-eval .h entry configure $nodes -foreground red
-
-cd $saved
-
diff --git a/blt3.0.1/demos/hierbox2.tcl b/blt3.0.1/demos/hierbox2.tcl
deleted file mode 100755
index bc0648f..0000000
--- a/blt3.0.1/demos/hierbox2.tcl
+++ /dev/null
@@ -1,77 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-proc AddDirEntries { w dir } {
- if { [file isdirectory $dir] } {
- set files [glob -nocomplain $dir/*]
- eval $w insert end [lsort $files]
- set subdirs [glob -nocomplain $dir/*/]
- eval $w entry configure [lsort $subdirs] -button yes
- }
-}
-
-set imageList {}
-foreach f [glob ./images/mini-*.gif] {
- lappend imageList [image create picture -file $f]
-}
-
-set top ../
-
-#option add *Hierbox.Tile bgTexture
-option add *Hierbox.TileOffset yes
-
-option add *forceGadgets no
-option add *Hierbox.openCommand {
- AddDirEntries %W "$top/%P"
-}
-option add *Hierbox.closeCommand {
- eval %W delete %n 0 end
-}
-
-image create picture openFolder -file images/open.gif
-image create picture closeFolder -file images/close.gif
-
-option add *Hierbox.icons "closeFolder openFolder"
-
-#option add *Hierbox.Button.activeForeground red
-#option add *Hierbox.bindTags "Label all"
-
-hierbox .h \
- -selectmode multiple \
- -hideroot yes \
- -yscrollcommand { .vs set } \
- -xscrollcommand { .hs set }
-
-.h button configure -activebackground grey92
-scrollbar .vs -orient vertical -command { .h yview }
-scrollbar .hs -orient horizontal -command { .h xview }
-button .test -text Test -command {
- set index [.h curselection]
- set names [eval .h get -full $index]
- puts "selected names are $names"
-}
-
-button .quit -text Quit -command { exit 0 }
-
-blt::table . \
- 0,0 .h -fill both \
- 2,0 .quit \
- 0,1 .vs -fill y 1,0 .hs -fill x \
- 3,0 .test
-
-blt::table configure . c1 r1 r2 r3 -resize none
-
-.h configure -separator "/" -trim $top \
- -allowduplicates no
-
-#.h entry configure 0 -label [file tail $top]
-
-AddDirEntries .h $top
-focus .h
-set nodes [.h find -glob -name *.c]
-eval .h entry configure $nodes -labelcolor red
-
-wm protocol . WM_DELETE_WINDOW { destroy . }
-#blt::bltdebug 100
\ No newline at end of file
diff --git a/blt3.0.1/demos/hierbox3.tcl b/blt3.0.1/demos/hierbox3.tcl
deleted file mode 100755
index f1826d5..0000000
--- a/blt3.0.1/demos/hierbox3.tcl
+++ /dev/null
@@ -1,57 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-proc AddDirEntries { w dir } {
- if { [file isdirectory $dir] } {
- set files [glob -nocomplain $dir/*]
- eval $w insert end [lsort $files]
- set subdirs [glob -nocomplain $dir/*/]
- eval $w entry configure [lsort $subdirs] -button yes
- }
-}
-
-set imageList {}
-foreach f [glob ./images/mini-*.gif] {
- lappend imageList [image create picture -file $f]
-}
-
-image create picture openFolder -file images/open.gif
-image create picture closeFolder -file images/close.gif
-option add *Hierbox.icons "closeFolder openFolder"
-
-#option add *Hierbox.openCommand { AddDirEntries %W "$top/%P" }
-#option add *Hierbox.closeCommand { eval %W delete %n 0 end }
-
-hierbox .h \
- -allowduplicates no \
- -hideroot yes \
- -yscrollcommand { .vs set } \
- -xscrollcommand { .hs set }
-
-scrollbar .vs -orient vertical -command { .h yview }
-scrollbar .hs -orient horizontal -command { .h xview }
-button .test -text Test -command {
- set index [.h curselection]
- set names [eval .h get -full $index]
- puts "selected names are $names"
-}
-
-blt::table . \
- 0,0 .h -fill both \
- 0,1 .vs -fill y \
- 1,0 .hs -fill x \
-
-blt::table configure . c1 r1 r2 -resize none
-
-set top ../
-.h configure -separator "/" -trim $top -autocreate yes
-#.h entry configure 0 -label [file tail $top]
-
-catch { exec du $top } files
-foreach f [split $files \n ] {
- .h insert end [lindex $f 1] -text [lindex $f 0] -button auto
-}
-
-focus .h
diff --git a/blt3.0.1/demos/hierbox4.tcl b/blt3.0.1/demos/hierbox4.tcl
deleted file mode 100755
index e714e8a..0000000
--- a/blt3.0.1/demos/hierbox4.tcl
+++ /dev/null
@@ -1,55 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-proc AddDirEntries { w dir } {
- if { [file isdirectory $dir] } {
- set files [glob -nocomplain $dir/*]
- eval $w insert end [lsort $files]
- set subdirs [glob -nocomplain $dir/*/]
- eval $w entry configure [lsort $subdirs] -gadget yes
- }
-}
-
-#blt::bltdebug 100
-
-image create picture openFolder -file images/open.gif
-image create picture closeFolder -file images/close.gif
-
-option add *Hierbox.icons "closeFolder openFolder"
-
-option add *Hierbox.cursor crosshair
-option add *Hierbox.Button.Relief solid
-option add *Hierbox.Button.ActiveBackground white
-option add *Hierbox.Button.Background white
-
-hierbox .h \
- -yscrollcommand { .vs set } \
- -xscrollcommand { .hs set } \
- -activebackground lightskyblue1 \
- -selectbackground lightskyblue2
-
-scrollbar .vs -orient vertical -command { .h yview }
-scrollbar .hs -orient horizontal -command { .h xview }
-button .test -text Test -command {
- set index [.h curselection]
- set names [eval .h get -full $index]
- puts "selected names are $names"
-}
-
-blt::table . \
- 0,0 .h -fill both \
- 0,1 .vs -fill y \
- 1,0 .hs -fill x \
- 2,0 .test
-
-blt::table configure . c1 r1 -resize none
-
-.h configure -autocreate yes -font { Helvetica 34 }
-focus .h
-.h insert end { The Quick Brown Fox Jumped Over the }
-.h entry configure root -label {[Root]}
-.h insert end { The\nQuick\nBrown\nFox\nJumped\nOver\nthe }
-
-.h configure -focusedit yes
diff --git a/blt3.0.1/demos/hiertable1.tcl b/blt3.0.1/demos/hiertable1.tcl
deleted file mode 100755
index 299e204..0000000
--- a/blt3.0.1/demos/hiertable1.tcl
+++ /dev/null
@@ -1,212 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-set saved [pwd]
-
-#blt::bltdebug 100
-
-image create picture bgTexture -file ./images/rain.gif
-
-set imageList {}
-foreach f [glob ./images/mini-*.gif] {
- lappend imageList [image create picture -file $f]
-}
-
-#option add *Hiertable.Tile bgTexture
-#option add *Hiertable.Column.background grey90
-option add *Hiertable.ScrollTile yes
-option add *Hiertable.titleShadow { grey80 }
-option add *Hiertable.titleFont {*-helvetica-bold-r-*-*-11-*-*-*-*-*-*-*}
-
-option add *xHiertable.openCommand {
- set path /home/gah/src/blt/%P
- if { [file isdirectory $path] } {
- cd $path
- set files [glob -nocomplain * */. ]
- if { $files != "" } {
- eval %W insert -at %n end $files
- }
- }
-}
-
-option add *xHiertable.closeCommand {
- eval %W delete %n 0 end
-}
-
-hiertable .h -hideroot no -width 0 \
- -yscrollcommand { .vs set } \
- -xscrollcommand { .hs set } \
- -selectmode single -hideleaves false
-
-
-.h column configure treeView -text View
-.h column insert 0 mtime atime gid
-.h column insert end nlink mode type ctime uid ino size dev
-.h column configure uid -background \#eaeaff -relief raised -bd 1
-.h column configure mtime -hide no -bg \#ffeaea -relief raised -bd 1
-.h column configure size gid nlink uid ino dev -justify right -edit yes
-.h column configure treeView -hide no -edit no
-scrollbar .vs -orient vertical -command { .h yview }
-scrollbar .hs -orient horizontal -command { .h xview }
-blt::table . \
- 0,0 .h -fill both \
- 0,1 .vs -fill y \
- 1,0 .hs -fill x
-
-proc FormatSize { size } {
- set string ""
- while { $size > 0 } {
- set rem [expr $size % 1000]
- set size [expr $size / 1000]
- if { $size > 0 } {
- set rem [format "%03d" $rem]
- }
- if { $string != "" } {
- set string "$rem,$string"
- } else {
- set string "$rem"
- }
- }
- return $string
-}
-
-array set modes {
- 0 ---
- 1 --x
- 2 -w-
- 3 -wx
- 4 r--
- 5 r-x
- 6 rw-
- 7 rwx
-}
-
-proc FormatMode { mode } {
- global modes
-
- set mode [format %o [expr $mode & 07777]]
- set owner $modes([string index $mode 0])
- set group $modes([string index $mode 1])
- set world $modes([string index $mode 2])
-
- return "${owner}${group}${world}"
-}
-
-blt::table configure . c1 r1 -resize none
-image create picture fileImage -file images/stopsign.gif
-proc DoFind { dir path } {
- global fileList count
- set saved [pwd]
-
- cd $dir
- foreach f [lsort [glob -nocomplain *]] {
- set entry [file join $path $f]
- if { [catch { file stat $entry info }] != 0 } {
- lappend fileList $entry
- } else {
- if 0 {
- if { $info(type) == "file" } {
- set info(type) @fileImage
- } else {
- set info(type) ""
- }
- }
- set info(mtime) [clock format $info(mtime) -format "%b %d, %Y"]
- set info(atime) [clock format $info(atime) -format "%b %d, %Y"]
- set info(ctime) [clock format $info(ctime) -format "%b %d, %Y"]
- set info(size) [FormatSize $info(size)]
- set info(mode) [FormatMode $info(mode)]
- lappend fileList $entry -data [array get info]
- }
- incr count
- if { [file type $f] == "directory" } {
- DoFind $f $entry
- }
- }
- cd $saved
-}
-
-proc Find { dir } {
- global fileList count
- set fileList {}
- catch { file stat $dir info }
- incr count
- lappend fileList $dir -data [array get info]
- DoFind $dir $dir
- return $fileList
-}
-
-proc GetAbsolutePath { dir } {
- set saved [pwd]
- cd $dir
- set path [pwd]
- cd $saved
- return $path
-}
-
-set top [GetAbsolutePath ..]
-set trim "$top"
-
-.h configure -separator "/" -trim $trim
-
-set count 0
-.h entry configure root -label [file tail [GetAbsolutePath $top]]
-.h configure -bg grey90
-regsub -all {\.\./*} [Find $top] {} fileList
-puts "$count entries"
-eval .h insert end $fileList
-.h configure -bg white
-
-focus .h
-
-set nodes [.h find -glob -name *.c]
-eval .h entry configure $nodes -foreground green4
-set nodes [.h find -glob -name *.h]
-eval .h entry configure $nodes -foreground cyan4
-set nodes [.h find -glob -name *.o]
-eval .h entry configure $nodes -foreground red4
-
-cd $saved
-#bltdebug 100
-
-toplevel .top
-blt::hiertable .top.h2 -tree .h -yscrollcommand { .top.sbar set }
-scrollbar .top.sbar -command { .top.h2 yview }
-pack .top.h2 -side left -expand yes -fill both
-pack .top.sbar -side right -fill y
-
-.h column bind all <ButtonRelease-3> {
- %W configure -flat no
-}
-
-proc SortColumn { column } {
- set old [.h sort cget -column]
- set decreasing 0
- if { "$old" == "$column" } {
- set decreasing [.h sort cget -decreasing]
- set decreasing [expr !$decreasing]
- }
- .h sort configure -decreasing $decreasing -column $column -mode integer
- .h configure -flat yes
- .h sort auto yes
-
- blt::busy hold .h
- update
- blt::busy release .h
-}
-
-foreach column [.h column names] {
- .h column configure $column -command [list SortColumn $column]
-}
-
-scale .s -from 0 -to 300 -orient horizontal -length 300
-blt::table . \
- 3,0 .s
-update
-.s set 20
-if 1 {
- .s configure -command { .h entry configure 0 -height }
-}
-
diff --git a/blt3.0.1/demos/hiertable2.tcl b/blt3.0.1/demos/hiertable2.tcl
deleted file mode 100755
index 0182d35..0000000
--- a/blt3.0.1/demos/hiertable2.tcl
+++ /dev/null
@@ -1,196 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-set saved [pwd]
-
-#blt::bltdebug 100
-
-image create picture bgTexture -file ./images/rain.gif
-
-set imageList {}
-foreach f [glob ./images/mini-*.gif] {
- lappend imageList [image create picture -file $f]
-}
-
-#option add *Hiertable.Tile bgTexture
-option add *Hiertable.ScrollTile yes
-#option add *Hiertable.Column.background grey90
-option add *Hiertable.titleShadow { grey80 }
-option add *Hiertable.titleFont {*-helvetica-bold-r-*-*-11-*-*-*-*-*-*-*}
-
-option add *xHiertable.openCommand {
- set path /home/gah/src/blt/%P
- if { [file isdirectory $path] } {
- cd $path
- set files [glob -nocomplain * */. ]
- if { $files != "" } {
- eval %W insert -at %n end $files
- }
- }
-}
-
-option add *xHiertable.closeCommand {
- eval %W delete %n 0 end
-}
-
-hiertable .h -width 0\
- -yscrollcommand { .vs set } \
- -xscrollcommand { .hs set } \
- -selectmode multiple
-
-
-.h column configure treeView -text "View"
-.h column insert 0 mtime atime gid
-.h column insert end nlink mode type ctime uid ino size dev
-.h column configure uid -background \#eaeaff
-.h column configure mtime -hide no -bg \#ffeaea
-.h column configure size gid nlink uid ino dev -justify right
-.h column configure treeView -hide no -edit no
-
-scrollbar .vs -orient vertical -command { .h yview }
-scrollbar .hs -orient horizontal -command { .h xview }
-blt::table . \
- 0,0 .h -fill both \
- 0,1 .vs -fill y \
- 1,0 .hs -fill x
-
-proc FormatSize { size } {
- set string ""
- while { $size > 0 } {
- set rem [expr $size % 1000]
- set size [expr $size / 1000]
- if { $size > 0 } {
- set rem [format "%03d" $rem]
- }
- if { $string != "" } {
- set string "$rem,$string"
- } else {
- set string "$rem"
- }
- }
- return $string
-}
-
-array set modes {
- 0 ---
- 1 --x
- 2 -w-
- 3 -wx
- 4 r--
- 5 r-x
- 6 rw-
- 7 rwx
-}
-
-proc FormatMode { mode } {
- global modes
-
- set mode [format %o [expr $mode & 07777]]
- set owner $modes([string index $mode 0])
- set group $modes([string index $mode 1])
- set world $modes([string index $mode 2])
-
- return "${owner}${group}${world}"
-}
-
-blt::table configure . c1 r1 -resize none
-image create picture fileImage -file images/stopsign.gif
-proc DoFind { dir path } {
- global fileList count
- set saved [pwd]
-
- cd $dir
- foreach f [lsort [glob -nocomplain *]] {
- set entry [file join $path $f]
- if { [catch { file stat $entry info }] != 0 } {
- lappend fileList $entry
- } else {
- if 0 {
- if { $info(type) == "file" } {
- set info(type) @fileImage
- } else {
- set info(type) ""
- }
- }
- set info(mtime) [clock format $info(mtime) -format "%b %d, %Y"]
- set info(atime) [clock format $info(atime) -format "%b %d, %Y"]
- set info(ctime) [clock format $info(ctime) -format "%b %d, %Y"]
- set info(size) [FormatSize $info(size)]
- set info(mode) [FormatMode $info(mode)]
- lappend fileList $entry -data [array get info]
- }
- incr count
- if { [file isdirectory $f] } {
- DoFind $f $entry
- }
- }
- cd $saved
-}
-
-proc Find { dir } {
- global fileList count
- set fileList {}
- catch { file stat $dir info }
- incr count
- lappend fileList $dir -data [array get info]
- DoFind $dir $dir
- return $fileList
-}
-
-proc GetAbsolutePath { dir } {
- set saved [pwd]
- cd $dir
- set path [pwd]
- cd $saved
- return $path
-}
-
-set top [GetAbsolutePath ..]
-set trim "$top"
-
-.h configure -separator "/" -trim $trim
-
-set count 0
-#.h entry configure root -label [file tail [GetAbsolutePath $top]]
-.h configure -bg grey90
-regsub -all {\.\./*} [Find $top] {} fileList
-puts "$count entries"
-eval .h insert end $fileList
-.h configure -bg white
-
-focus .h
-
-set nodes [.h find -glob -name *.c]
-eval .h entry configure $nodes -foreground green4
-set nodes [.h find -glob -name *.h]
-eval .h entry configure $nodes -foreground cyan4
-set nodes [.h find -glob -name *.o]
-eval .h entry configure $nodes -foreground red4
-
-cd $saved
-#bltdebug 100
-
-.h column bind all <ButtonRelease-3> {
- %W configure -flat no
-}
-
-proc SortColumn { column } {
- set old [.h sort cget -column]
- set decreasing 0
- if { "$old" == "$column" } {
- set decreasing [.h sort cget -decreasing]
- set decreasing [expr !$decreasing]
- }
- .h sort configure -decreasing $decreasing -column $column
- .h configure -flat yes
- .h sort auto yes
- blt::busy hold .h
- update
- blt::busy release .h
-}
-
-foreach column [.h column names] {
- .h column configure $column -command [list SortColumn $column]
-}
diff --git a/blt3.0.1/demos/hiertable3.tcl b/blt3.0.1/demos/hiertable3.tcl
deleted file mode 100755
index 556a78a..0000000
--- a/blt3.0.1/demos/hiertable3.tcl
+++ /dev/null
@@ -1,175 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-set saved [pwd]
-
-#blt::bltdebug 100
-
-image create picture bgTexture -file ./images/rain.gif
-
-set imageList {}
-foreach f [glob ./images/mini-*.gif] {
- lappend imageList [image create picture -file $f]
-}
-
-#option add *Hiertable.Tile bgTexture
-option add *Hiertable.ScrollTile yes
-#option add *Hiertable.Column.background grey90
-option add *Hiertable.titleShadow { grey80 }
-option add *Hiertable.titleFont {*-helvetica-bold-r-*-*-11-*-*-*-*-*-*-*}
-
-hiertable .h -width 0\
- -yscrollcommand { .vs set } \
- -xscrollcommand { .hs set } \
- -selectmode multiple \
- -hideroot yes
-
-#.h configure -icons "" -activeicons ""
-
-.h column configure treeView -text "View"
-.h column insert 0 mtime atime gid
-.h column insert end nlink mode type ctime uid ino size dev
-.h column configure uid -background \#eaeaff -style text
-.h column configure mtime -hide no -bg \#ffeaea -style text
-.h column configure size gid nlink uid ino dev -justify right -style text
-.h column configure treeView -hide no -edit no -style text
-
-scrollbar .vs -orient vertical -command { .h yview }
-scrollbar .hs -orient horizontal -command { .h xview }
-blt::table . \
- 0,0 .h -fill both \
- 0,1 .vs -fill y \
- 1,0 .hs -fill x
-
-proc FormatSize { size } {
- set string ""
- while { $size > 0 } {
- set rem [expr $size % 1000]
- set size [expr $size / 1000]
- if { $size > 0 } {
- set rem [format "%03d" $rem]
- }
- if { $string != "" } {
- set string "$rem,$string"
- } else {
- set string "$rem"
- }
- }
- return $string
-}
-
-array set modes {
- 0 ---
- 1 --x
- 2 -w-
- 3 -wx
- 4 r--
- 5 r-x
- 6 rw-
- 7 rwx
-}
-
-proc FormatMode { mode } {
- global modes
-
- set mode [format %o [expr $mode & 07777]]
- set owner $modes([string index $mode 0])
- set group $modes([string index $mode 1])
- set world $modes([string index $mode 2])
-
- return "${owner}${group}${world}"
-}
-
-blt::table configure . c1 r1 -resize none
-image create picture fileImage -file images/stopsign.gif
-
-proc DoFind { dir parent } {
- global count
- set saved [pwd]
-
- cd $dir
- foreach f [lsort [glob -nocomplain *]] {
- set node [tree0 insert $parent -label $f]
- if { [catch { file stat $f info }] == 0 } {
- if 0 {
- if { $info(type) == "file" } {
- set info(type) @fileImage
- } else {
- set info(type) ""
- }
- }
- set info(mtime) [clock format $info(mtime) -format "%b %d, %Y"]
- set info(atime) [clock format $info(atime) -format "%b %d, %Y"]
- set info(ctime) [clock format $info(ctime) -format "%b %d, %Y"]
- set info(size) [FormatSize $info(size)]
- set info(mode) [FormatMode $info(mode)]
- eval tree0 set $node [array get info]
- }
- incr count
- if { [file isdirectory $f] } {
- DoFind $f $node
- }
- }
- cd $saved
-}
-
-proc Find { dir } {
- global count
- set count 0
- catch { file stat $dir info }
- incr count
- tree create tree0
- tree0 label root [file tail $dir]
- eval tree0 set root [array get info]
- DoFind $dir root
- puts "$count entries"
-}
-
-proc GetAbsolutePath { dir } {
- set saved [pwd]
- cd $dir
- set path [pwd]
- cd $saved
- return $path
-}
-
-set top [GetAbsolutePath ..]
-Find $top
-
-focus .h
-
-.h configure -tree tree0 -separator /
-
-set nodes [.h find -glob -name *.c]
-eval .h entry configure $nodes -foreground green4
-set nodes [.h find -glob -name *.h]
-eval .h entry configure $nodes -foreground cyan4
-set nodes [.h find -glob -name *.o]
-eval .h entry configure $nodes -foreground red4
-
-cd $saved
-
-.h column bind all <ButtonRelease-3> {
- %W configure -flat no
-}
-
-proc SortColumn { column } {
- set old [.h sort cget -column]
- set decreasing 0
- if { "$old" == "$column" } {
- set decreasing [.h sort cget -decreasing]
- set decreasing [expr !$decreasing]
- }
- .h sort configure -decreasing $decreasing -column $column
- .h configure -flat yes
- .h sort auto yes
- blt::busy hold .h
- update
- blt::busy release .h
-}
-
-foreach column [.h column names] {
- .h column configure $column -command [list SortColumn $column]
-}
diff --git a/blt3.0.1/demos/htext.txt b/blt3.0.1/demos/htext.txt
deleted file mode 100644
index b03db51..0000000
--- a/blt3.0.1/demos/htext.txt
+++ /dev/null
@@ -1,615 +0,0 @@
-
- This is a (for lack of a better name) hypertext widget.
-
-This widget combines text and other Tk widgets in the same window.
-It is sort of a cross between a read-only text widget and the pack command.
-Any widget can be attached to the hypertext window by the %%
-set this $htext(widget)
-blt::tile::label $this.lab -text "append " -relief sunken \
- -font *-Courier-Bold-R-Normal-*-12-120-*
-$this append $this.lab
-%% command.
-For example,
-%% message $this.msg -relief sunken -bd 2 -aspect 10000 -font \
- *-Courier-Medium-R-Normal-*-12-* -text {set w $htext(widget)
-blt::tile::label $w.face -bitmap @bitmaps/face.xbm \
- -relief sunken -borderwidth 2
-$w append $w.face -padx 2 -pady 0.25i}
-$this append $this.msg \
- -fill both %% added this %%
-global tk_library
-blt::tile::label $this.face \
- -bitmap @bitmaps/face.xbm \
- -relief sunken -borderwidth 2
-$this append $this.face -padx 2 -pady 0.25i
-%%.
-There can be many types of widgets in the same document. For example,
-this is a simple %%
-blt::tile::button $this.but -bg pink -text { button } \
- -command { puts stderr { a stupid message } }
-$this append $this.but
-%%. If you click on the button, it prints a stupid message.
-Any Tk widget can be used, including %%
-set whichTile 0
-proc ChangeTile { w } {
- global whichTile
-
- if { $whichTile } {
- $w configure -bg $bg2
- } else {
- $w configure -bg $bg1
- }
-}
-blt::tile::checkbutton $this.ckbut -bg lightblue -text { check buttons } \
- -variable whichTile -command "ChangeTile $this"
-$this append $this.ckbut -justify top
-%%, %%
-blt::tile::radiobutton $this.rdbut -bg mediumseagreen -text { radio buttons } \
- -command { puts stderr { radio button pressed } }
-$this append $this.rdbut -justify bottom
-%%,
-and scales %%
-# -sliderforeground
-scale $this.sc -showvalue true \
- -length 100 \
- -foreground powderblue \
- -sliderlength 10 \
- -orient horizontal
-$this append $this.sc
-%%.
-
- Widget trees can be also be included. The following example is
-*borrowed* from the widget demo. It is a couple of frames surrounding a
-listbox, a message, and a button widget.
-%%
- set w $this.frame
- frame $w
- message $w.msg -font *times-medium-r-normal--*-12-120-* -aspect 300 \
- -text "A listbox containing the 50 states is displayed below, along with a scrollbar. You can scan the list either using the scrollbar or by dragging in the listbox window with button 3 pressed. Click the \"OK\" button when you've seen enough." -bg lightsteelblue -relief sunken
- frame $w.frame -borderwidth 10
- pack append $w.frame \
- [scrollbar $w.frame.scroll -relief sunken \
- -command "$w.frame.list yview"] {right expand filly frame w} \
- [listbox $w.frame.list -yscroll "$w.frame.scroll set" -relief sunken] \
- {left expand filly frame e}
- $w.frame.list insert 0 Alabama Alaska Arizona Arkansas California \
- Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois \
- Indiana Iowa Kansas Kentucky Louisiana Maine Maryland \
- Massachusetts Michigan Minnesota Mississippi Missouri \
- Montana Nebraska Nevada "New Hampshire" "New Jersey" "New Mexico" \
- "New York" "North Carolina" "North Dakota" \
- Ohio Oklahoma Oregon Pennsylvania "Rhode Island" \
- "South Carolina" "South Dakota" \
- Tennessee Texas Utah Vermont Virginia Washington \
- "West Virginia" Wisconsin Wyoming
- button $w.ok -text OK -command "puts stderr $w; destroy $w"
-
- pack append $w $w.msg {top fill} $w.frame {top expand fill} \
- $w.ok {bottom fill}
- $w config -bg lightsteelblue -relief sunken
-
-$this append $w -pady 0.25i
-%%
-
-You can add you own home-grown widgets. Here's the graph widget.
-Beside it is the "color" demo. Moving the scales, adjusts the background
-color of the graph.
-%%
-#
-# Simple script to change colors of a window.
-#
-global xlabel ylabel red green blue graph
-set red 255
-set green 215
-set blue 0
-
-option add *Scale.sliderForeground "#cdb79e"
-option add *Scale.activeForeground "#ffe4c4"
-set w $this.colorFrame
-frame $w
-scale $w.red -command "color red" -label "Red Intensity" \
- -from 0 -to 255 -orient horizontal -bg "#ffaeb9" -length 250
-scale $w.green -command "color green" -label "Green Intensity" \
- -from 0 -to 255 -orient horizontal -bg "#43cd80"
-scale $w.blue -command "color blue" -label "Blue Intensity" \
- -from 0 -to 255 -orient horizontal -bg "#7ec0ee"
-
-$w.blue set $blue
-$w.green set $green
-$w.red set $red
-
-pack append $w $w.red {top expand fill}
-pack append $w $w.green {top expand fill}
-pack append $w $w.blue {top expand fill}
-
-proc color {which intensity} {
- global red green blue graph xlabel ylabel
- set $which $intensity
- set rgb [format #%02x%02x%02x $red $green $blue]
- $graph config -bg $rgb
- $xlabel config -bg $rgb
- $ylabel config -bg $rgb
-}
-
-$this append $w
-
-%%
-%%
-proc makeplot { widget } {
-
- blt::graph $widget
- set X {
- 2.00000e-01 4.00000e-01 6.00000e-01 8.00000e-01 1.00000e+00
- 1.20000e+00 1.40000e+00 1.60000e+00 1.80000e+00 2.00000e+00
- 2.20000e+00 2.40000e+00 2.60000e+00 2.80000e+00 3.00000e+00
- 3.20000e+00 3.40000e+00 3.60000e+00 3.80000e+00 4.00000e+00
- 4.20000e+00 4.40000e+00 4.60000e+00 4.80000e+00 5.00000e+00
- }
-
- $widget element create Y1 -x $X -y {
- 1.14471e+01 2.09373e+01 2.84608e+01 3.40080e+01 3.75691e+01
- 3.91345e+01 3.92706e+01 3.93474e+01 3.94242e+01 3.95010e+01
- 3.95778e+01 3.96545e+01 3.97313e+01 3.98081e+01 3.98849e+01
- 3.99617e+01 4.00384e+01 4.01152e+01 4.01920e+01 4.02688e+01
- 4.03455e+01 4.04223e+01 4.04990e+01 4.05758e+01 4.06526e+01
- } -symbol circle -label VGS=2.0 -color blue4 -fill blue
-
- $widget element create Y2 -x $X -y {
- 2.61825e+01 5.04696e+01 7.28517e+01 9.33192e+01 1.11863e+02
- 1.28473e+02 1.43140e+02 1.55854e+02 1.66606e+02 1.75386e+02
- 1.82185e+02 1.86994e+02 1.89802e+02 1.90683e+02 1.91047e+02
- 1.91411e+02 1.91775e+02 1.92139e+02 1.92503e+02 1.92867e+02
- 1.93231e+02 1.93595e+02 1.93958e+02 1.94322e+02 1.94686e+02
- } -symbol diamond -label VGS=3.5 -color green4 -fill green
-
- $widget element create Y3 -x $X -y {
- 4.07008e+01 7.95658e+01 1.16585e+02 1.51750e+02 1.85051e+02
- 2.16479e+02 2.46024e+02 2.73676e+02 2.99427e+02 3.23267e+02
- 3.45187e+02 3.65177e+02 3.83228e+02 3.99331e+02 4.13476e+02
- 4.25655e+02 4.35856e+02 4.44073e+02 4.50294e+02 4.54512e+02
- 4.56716e+02 4.57596e+02 4.58448e+02 4.59299e+02 4.60151e+02
- } -symbol triangle -label VGS=5.0 -color red4 -fill red
-
-}
-
-option add *graph.title "Plot Title"
-option add *graph.xTitle "X Axis Label"
-option add *graph.yTitle "Y Axis Label"
-#option add *graph.legendMapped false
-option add *graph.elemPixels 8
-option add *graph.relief ridge
-option add *graph.borderWidth 2
-
-set graph $this.graph
-set xlabel $this.xlab
-set ylabel $this.ylab
-makeplot $graph
-$this append $graph -padx 0.25i -pady 0.25i
-
-%%
-If you click on any button in the graph, you will get the coordinate
-values at the pointer location.
-
-The current coordinate values are %%
-label $xlabel -text { ??? ??? } -relief sunken
-label $ylabel -text { ??? ??? } -relief sunken
-bind $graph <ButtonPress> {labelxy [ %W invtransform %x %y ]}
-
-proc labelxy { values } {
- global xlabel ylabel
- scan $values "%e %e" x y
- $xlabel config -text $x
- $ylabel config -text $y
-}
-$this append $this.xlab -width 100 -fill x
-%% and %%
-$this append $this.ylab -width 100 -fill x
-%%.
-
-
-There are four global variables automatically created when a hypertext
-file is read. They are:
-
-%%
-button $this.l1 -text " \$htext(widget) " \
- -command "puts $this" -bg orange
-$this append $this.l1 -width 200 -pady 4
-%%the pathname of the hypertext widget.
-%%
-button $this.l2 -text " \$htext(file) " \
- -command "puts $htext(file)" -bg orange
-$this append $this.l2 -width 200 -pady 4
-%%the file being read.
-%%
-button $this.l3 -text " \$htext(line) " \
- -command "puts $htext(line)" -bg orange
-$this append $this.l3 -width 200 -pady 4
-%%the current line number.
-%%
-button $this.l4 -text " \$htext(index) " \
- -command "puts $htext(index)" -bg orange
-$this append $this.l4 -width 200 -pady 4
-%%the current index in the text.
-
-Click on any button and the current value is printed on standard output.
-
-The hypertext widget works with plain text too. If you don't want
-to read it, click on the %%
-button $this.goto -text button -fg purple -bg white \
- -command "global endOfText; $this gotoline \$endOfText"
-$this append $this.goto
-%% to jump to the end of the plain text.
-
- ------------------------------------------------------
-
-[This is a pre-release version of BLT. It's basically the latest
-
-snapshot of BLT, as it moves towards a full release. What this means
-is that the documentation and demos still need work. Let me know
-about any configuration/compiler/installation goofs so I make sure
-they're fixed for the next release.]
-
-This is version 2.4 of the BLT library. It's an extension to the
-Tcl/Tk toolkit. You simply compile and link with the Tcl/Tk
-libraries. It does not require the Tcl or Tk source files.
-
-BLT is available from
-
- ftp.tcltk.com
-
-in the "pub/blt" directory. The URL is
-
- ftp://ftp.tcltk.com/pub/blt/BLT2.4.tar.gz
-
-This release has been compiled and tested with versions:
-
- Tcl 7.5 / Tk 4.1
- Tcl 7.6 / Tk 4.2
- Tcl/Tk 8.0
- Tcl/Tk 8.1a2
-
-What is BLT?
-
- BLT is an extension to Tk. It adds plotting widgets (X-Y graph,
- barchart, stripchart), a powerful geometry manager, a new canvas
- item, and several new commands to Tk.
-
- Plotting widgets:
-
- graph, barchart, stripchart
- BLT has X-Y graph, barchart, and stripchart widgets that are
- both easy to use and customize. All the widgets work with
- BLT vector data objects, which makes it easy to manage data.
-
- Hierarchical list box:
-
- hierbox Displays a general ordered tree which may be built
- on-the-fly or all at once.
-
- Tab set:
-
- tabset Can be used either as a tab notebook or simple tabset.
- Multi-tiered and/or scrolled tabsets are available.
- Notebook pages can be torn-off into separate windows and
- later put back.
-
- Geometry Manager:
-
- table A table-based geometry manager. Lets you specify widget
- layouts by row and column positions in the table. Unlike the
- packer or grid, you can finely control and constrain window
- sizes.
-
- Vector Data Object:
-
- vector Lets you manage a vector of floating point values in a
- high-level fashion. Vectors inter-operate seamlessly with
- the plotting widgets. The graphs will automatically redraw
- themselves when the vector data changes. Vector's components
- can be managed through a Tcl array variable, a Tcl command,
- or the using its own C API.
-
- Background Program Execution:
-
- bgexec Like Tcl's "exec ... &", but collects the output, error, and
- status of the detached UNIX subprocesses. Sets a Tcl variable
- upon completion.
-
- Busy Command:
-
- busy For preventing user-interactions when the application is
- busy. Manages an invisible "busy" window which prevents
- further user interactions (keyboard, mouse, button, etc.).
- Also you can provide a busy cursor that temporarily
- overrides those of the Tk widgets.
-
- New Canvas Item:
-
- eps An new item is added to the Tk canvas for handling
- encapsulated PostScript. It lets you embed an EPS file into
- the canvas displaying either an EPS preview image found in
- the file, or a Tk image that you provide. When you print
- the canvas the EPS item will automatically include the EPS
- file, translating and scaling the PostScript. For example,
- you could use "eps" items to tile several PostScript pages
- into single page.
-
- The "eps" item can also be used as a replacement for "image"
- canvas items. Unlike "image" canvas items, the image of an
- eps item can be printed and scaled arbitrarily.
-
- Drag & Drop Facility:
-
- drag&drop Adds drag-n-drop capabilities to Tk. It uses "send"-style
- communication between drag-drop sources and targets. The
- result is a much more powerful drag-and-drop mechanism than
- is available with OpenLook or Motif.
-
- Bitmap Command:
-
- bitmap Lets you read and write bitmaps from Tcl. You can define
- bitmaps from ordinary text strings. Bitmaps can also be
- scaled and rotated. For example, you can create a button
- with rotated text by defining a bitmap from a text string
- and rotating it. You can then use the bitmap in the button
- widget.
-
- Miscellaneous Commands:
-
- winop Basic window operations. You can raise, lower, map, or,
- unmap windows. Other operations let you move the pointer
- or take photo image snapshots of Tk widgets.
-
- bltdebug Lets you trace the execution of Tcl commands and procedures.
- Prints out each Tcl command before it's executed.
-
- watch Lets you specify Tcl procedures to be run before and/or
- after every Tcl command. May be used for logging, tracing,
- profiling, or debugging or Tcl code.
-
- spline Computes a spline fitting a set of data points (x and y
- vectors) and produces a vector of the interpolated images
- (y-coordinates) at a given set of x-coordinates.
-
- htext A simple hypertext widget. Allows text and Tk widgets to
- be combined in a scroll-able text window. Any Tk widget
- can be embedded and used to form hyper-links. Other
- options allow for selections and text searches.
-
-What's new in 2.4?
-
- 1. "eps" canvas item.
-
- An encapsulated PostScript canvas item lets you embed an EPS file into
- the canvas. The "eps" item displays either a EPS preview image found
- in the file, or a Tk image that you provide.
-
- 2. "hierbox" widget.
-
- Hierarchical listbox widget. Displays a general ordered tree which
- may be built on-the-fly or all at once.
-
- 3. "tabset" widget.
-
- Can be used either as a tab notebook or simple tabset. Tabs can
- be arranged in a variety of ways: multi-tiered, scrolled, and
- attached to any of the four sides. Tab labels can contain both
- images and text (text can be arbitrarily rotated). Notebook pages
- can be torn-off into separate windows and replaced later.
-
- 4. Changes to vectors.
-
- New features:
-
- o Vector expressions. The vector now has an "expr" operation
- that lets you perform math (including math library
- functions) on vectors. There are several new functions
- (such as "max", "min", "mean" "median", "q1", "q3", "prod",
- "sum", "adev", "sdev", "skew", ...)
-
- vector expr { sin(x)^2 + cos(x)^2 }
- y expr { log(x) * $value }
-
- o New syntax to create and destroy vectors:
-
- vector create x
- vector destroy x
-
- The old syntax for creating vectors still works.
-
- vector x
-
- o Vectors are *not* automatically deleted when their Tcl
- variable is unset anymore. This means that you can
- temporarily map vectors to variables and use them as you
- would an ordinary Tcl array (kind of like "upvar").
-
- proc AddValue { vecName value } {
- $vecName variable x
-
- set x(++end) $value
- }
-
- There's an "-watchunset" flag to restore the old
- behavior if you need it.
-
- vector create x -watchunset yes
-
- o Vectors still automatically create Tcl variables by
- default. I'd like to change this, but it silently
- breaks lots of code, so it will stay.
-
- Bug fixes:
-
- o Vector reallocation failed when shrinking the vector.
-
- o Vector "destroy" callback made after vector was
- already freed.
-
- 5. Changes to Graph, Barchart, Stripchart widgets.
-
- New features:
-
- o Drop shadows for text (titles, markers, etc). Drop
- shadows improve contrast when displaying text over a
- background with similar color intensities.
-
- o Postscript "-preview" option to generate a EPS
- PostScript preview image that can be read and
- displayed by the EPS canvas item.
-
- o New "-topvariable", "-bottomvariable",
- "-leftvariable", and "-rightvariable" options. They
- specify variables to contain the current margin
- sizes. These variables are updated whenever the
- graph is redrawn.
-
- o New "-aspect" option. Let's you maintain a particular aspect
- ratio for the the graph.
-
- o Image markers can now be stretched and zoomed like
- bitmap markers.
-
- o Bind operation for legend entries, markers, and elements.
-
- Much thanks to Julian Loaring <bigj at bigj.demon.co.uk>
- for the suggestions.
-
- o New "-xor" option for line markers, lets you draw the line
- by rubberbanded by XOR-ing without requiring the graph to
- be redrawn. This can be used, for example, to select regions
- like in zooming.
-
- Thanks to Johannes Zellner (joze at krisal.physik.uni-karlsruhe.de)
- for the suggestion.
-
- Bug fixes:
-
- o Closest line (point) broken when using pens styles.
-
- o Marker elastic coordinates were wrong.
-
- o PostScript bounding box included the border of the page.
-
- o Bad PostScript generated for barchart symbols with stipples.
-
- o Wrong dimensions computed with postscript " -maxpect" option.
-
- o Text markers fixed.
-
- Thanks to De Clarke for the bug report and fix.
-
-
- o Renamed axis configuration from "-range" to "-autorange" to
- match the documentation.
-
- Thanks to Brian Smith for the correction.
-
- o Fixed polygon marker pick routine.
-
- o Fixed active tab labels overlapping the selected tab.
-
-
-What's incompatible with releases prior to BLT 2.4?
-
- 1. Vector names must start with a letter and contain letters, digits,
- or underscores.
-
- Namespace Issues: Vector names are still global. If Tcl provides
- an API, vectors may in the future be created on
- a per-namespace basis. Right now, there's no
- mechanism for detecting when a namespace has been
- destroyed. Which is why you can't currently
- prefix a vector name with a namespace qualifier.
-
- [Ok, there is... Thanks to Michael McLennan for
- pointing this out to me. So maybe soon there
- will be vectors on a per namespace basis.]
-
- 2. The "-mapped" options throughout the graph have been replaced
- by the "-hide" option. The many usages of the word "map" was
- getting confusing.
-
- # No longer works.
- .graph legend configure -mapped no
-
- # Instead use this.
- .graph legend configure -hide yes
-
-
-How to compile and test BLT?
-
- See the file "INSTALL" for instructions.
-
-When will the so-called "official" BLT work with Windows?
-
- It currently compiles and runs with MS VC++ and EGCS 1.1 under
- Windows 95/NT (loadable binary versions will be forthcoming).
- Everything pretty much works: graphs, bgexec, busy, drag&drop etc.
-
-When will...?
-
- In general, I can't answer the "When will" questions, mostly out of
- embarrassment. My estimates of when new features and releases will
- occur usually turn out to be way way off.
-
-What does BLT stand for?
-
- Whatever you want it to.
-
---gah
-
-%%
-global endOfText
-set endOfText [expr $htext(line)-1 ]
-
-global updateInterval count barchart
-global Red Green Blue
-set updateInterval 200
-set count 0
-set Red bb
-set Green 00
-set Blue 33
-
-option add *barchart.title "Bar Chart"
-option add *barchart.x.title "X"
-option add *barchart.y.title "Y"
-option add *barchart.y2.title "Y"
-option add *barchart.Axis.subTicks 0
-option add *barchart.x.stepSize 0
-option add *barchart.x.Ticks 0
-option add *barchart.legend.hide yes
-option add *barchart.Axis.Font *-Courier-Bold-R-Normal-*-8-80-*
-option add *barchart.y2.hide yes
-
-set barchart $this.barchart
-blt::barchart $barchart -bd 2 -relief raised -bg $bg2
-$barchart y2axis use y
-$this append $barchart -fill both -padx 10 -pady 10 -relwidth 0.8
-
-proc AnimateBarchart { } {
- global updateInterval
- global barchart count Red Blue Green
-
- if { [info commands $barchart] != $barchart } {
- return
- }
- incr count
- if { $count > 100 } {
- $barchart element delete [lindex [$barchart element show] end]
- }
- set color [format "%x" [expr $count%16]]
- set Green ${color}${color}
- $barchart element create $count -data { $count sin($count*0.1)} \
- -fg #${Red}${Green}${Blue} -bg brown
- after $updateInterval AnimateBarchart
-}
-AnimateBarchart
-
-%%
-
- Press %%
-button $this.quit -command { exit } -text {Quit} -bg pink
-$this append $this.quit
-%% to remove the window.
-
diff --git a/blt3.0.1/demos/htext1.tcl b/blt3.0.1/demos/htext1.tcl
deleted file mode 100755
index 66d1cb6..0000000
--- a/blt3.0.1/demos/htext1.tcl
+++ /dev/null
@@ -1,164 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-#source scripts/demo.tcl
-
-set visual [winfo screenvisual .]
-if { $visual == "staticgray" || $visual == "grayscale" } {
- set activeBg black
- set normalBg white
- set bitmapFg black
- set bitmapBg white
- option add *top.background white
-} else {
- option add *htext.foreground navyblue
- if { $tk_version >= 4.0 } {
- set file1 ./images/clouds.gif
- set file2 ./images/chalk.gif
- image create picture texture1 -file $file1
- image create picture texture2 -file $file2
- set bg1 [blt::bgpattern create tile -image texture1]
- set bg2 [blt::bgpattern create tile -image texture2]
- option add *htext.foreground black
- option add *htext.background $bg1
- option add *htext.selectBackground gold1
- }
-}
-option add *highlightThickness 0
-
-proc Blt_FindPattern { htext } {
- toplevel .search
- wm title .search "Text search"
- label .search.label1 -text "Enter Pattern"
- entry .search.entry -relief sunken
- label .search.clear -text "Clear" \
- -command ".search.entry delete 0 end"
- label .search.cancel -text "Cancel" \
- -command "destroy .search; focus $htext"
- label .search.search -text "Search" -command "Blt_Search&Move $htext"
- bind .search.entry <Return> "Blt_Search&Move $htext"
- blt::table .search \
- .search.label1 0,0 -padx 4 \
- .search.entry 0,1 -cspan 2 -pady 4 -padx 4 -reqwidth 3i \
- .search.search 3,0 -reqwidth .75i -anchor w -padx 10 -pady 5 \
- .search.clear 3,1 -reqwidth .75i -anchor center -padx 10 -pady 5 \
- .search.cancel 3,2 -reqwidth .75i -anchor e -padx 10 -pady 5
- focus .search.entry
- bind .search <Visibility> { raise .search }
-}
-
-set last 0
-set lastPattern {}
-
-proc Blt_Search&Move { h } {
- global last
- global lastPattern
-
-
- set pattern [.search.entry get]
- if { [string compare $pattern $lastPattern] != 0 } {
- set last 0
- set lastPattern $pattern
- }
- if { $pattern == "" } {
- return
- }
-
- set indices [$h search $pattern $last end]
- if { $indices == "" } {
- bell
- } else {
- set first [lindex $indices 0]
- set last [lindex $indices 1]
- $h selection range $first $last
- $h gotoline $first
- incr last
- }
-}
-
-# Create horizonatal and vertical scrollbars
-scrollbar .vscroll -command { .htext yview } -orient vertical
-scrollbar .hscroll -command { .htext xview } -orient horizontal
-
-# Create the hypertext widget
-blt::htext .htext -file ./htext.txt \
- -yscrollcommand { .vscroll set } \
- -xscrollcommand { .hscroll set } \
- -yscrollunits 10m -xscrollunits .25i \
- -height 6i
-
-
-blt::table . \
- .htext 0,0 -fill both \
- .vscroll 0,1 -fill y \
- .hscroll 1,0 -fill x
-
-blt::table configure . r1 c1 -resize none
-
-bind .htext <B1-Motion> {
- %W select to @%x,%y
-}
-bind .htext <1> {
- %W select from @%x,%y
- %W select to @%x,%y
-}
-
-bind .htext <Shift-1> {
- %W select word @%x,%y
-}
-bind .htext <Meta-1> {
- %W select line @%x,%y
-}
-bind .htext <Control-1> {
- puts stderr [%W select index @%x,%y]
-}
-
-bind .htext <B2-Motion> {
- %W scan dragto @%x,%y
-}
-bind .htext <2> {
- %W scan mark @%x,%y
-}
-
-bind .htext <3> {
- %W select adjust @%x,%y
-}
-
-bind .htext <Control-p> {
- set line [%W gotoline]
- if { $line == 0 } {
- bell
- } else {
- set line [expr $line-1]
- %W gotoline $line.0
- }
-}
-bind .htext <Control-n> {
- set line [%W gotoline]
- incr line
- if { [%W gotoline $line.0] != $line } {
- bell
- }
-}
-
-bind .htext <Control-v> {
- %W yview [expr [%W yview]+10]
-}
-
-bind .htext <Meta-v> {
- %W yview [expr [%W yview]-10]
-}
-
-bind .htext <Alt-v> {
- %W yview [expr [%W yview]-10]
-}
-
-bind .htext <Any-q> {
- exit 0
-}
-bind .htext <Control-s> {
- Blt_FindPattern %W
-}
-
-wm min . 0 0
-focus .htext
diff --git a/blt3.0.1/demos/images/blt98.gif b/blt3.0.1/demos/images/blt98.gif
deleted file mode 100644
index 5d8c964..0000000
Binary files a/blt3.0.1/demos/images/blt98.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/buckskin.gif b/blt3.0.1/demos/images/buckskin.gif
deleted file mode 100644
index e2d7be9..0000000
Binary files a/blt3.0.1/demos/images/buckskin.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/chalk.gif b/blt3.0.1/demos/images/chalk.gif
deleted file mode 100644
index 30d29a7..0000000
Binary files a/blt3.0.1/demos/images/chalk.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/close.gif b/blt3.0.1/demos/images/close.gif
deleted file mode 100644
index 02f8363..0000000
Binary files a/blt3.0.1/demos/images/close.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/close2.gif b/blt3.0.1/demos/images/close2.gif
deleted file mode 100644
index 09cbdff..0000000
Binary files a/blt3.0.1/demos/images/close2.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/clouds.gif b/blt3.0.1/demos/images/clouds.gif
deleted file mode 100644
index 49d15c2..0000000
Binary files a/blt3.0.1/demos/images/clouds.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/corrugated_metal.gif b/blt3.0.1/demos/images/corrugated_metal.gif
deleted file mode 100644
index f212bd7..0000000
Binary files a/blt3.0.1/demos/images/corrugated_metal.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/folder.gif b/blt3.0.1/demos/images/folder.gif
deleted file mode 100644
index 86eb798..0000000
Binary files a/blt3.0.1/demos/images/folder.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/jan25_palm3x_L.jpg b/blt3.0.1/demos/images/jan25_palm3x_L.jpg
deleted file mode 100644
index de30779..0000000
Binary files a/blt3.0.1/demos/images/jan25_palm3x_L.jpg and /dev/null differ
diff --git a/blt3.0.1/demos/images/mini-book1.gif b/blt3.0.1/demos/images/mini-book1.gif
deleted file mode 100644
index b8868dc..0000000
Binary files a/blt3.0.1/demos/images/mini-book1.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/mini-book2.gif b/blt3.0.1/demos/images/mini-book2.gif
deleted file mode 100644
index 266251a..0000000
Binary files a/blt3.0.1/demos/images/mini-book2.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/mini-display.gif b/blt3.0.1/demos/images/mini-display.gif
deleted file mode 100644
index a2416fb..0000000
Binary files a/blt3.0.1/demos/images/mini-display.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/mini-doc.gif b/blt3.0.1/demos/images/mini-doc.gif
deleted file mode 100644
index 3034320..0000000
Binary files a/blt3.0.1/demos/images/mini-doc.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/mini-filemgr.gif b/blt3.0.1/demos/images/mini-filemgr.gif
deleted file mode 100644
index cd16bc2..0000000
Binary files a/blt3.0.1/demos/images/mini-filemgr.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/mini-ofolder.gif b/blt3.0.1/demos/images/mini-ofolder.gif
deleted file mode 100644
index 78d7436..0000000
Binary files a/blt3.0.1/demos/images/mini-ofolder.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/mini-windows.gif b/blt3.0.1/demos/images/mini-windows.gif
deleted file mode 100644
index 5a504fc..0000000
Binary files a/blt3.0.1/demos/images/mini-windows.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/ofolder.gif b/blt3.0.1/demos/images/ofolder.gif
deleted file mode 100644
index 1238fa2..0000000
Binary files a/blt3.0.1/demos/images/ofolder.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/open.gif b/blt3.0.1/demos/images/open.gif
deleted file mode 100644
index ea826a9..0000000
Binary files a/blt3.0.1/demos/images/open.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/open2.gif b/blt3.0.1/demos/images/open2.gif
deleted file mode 100644
index 6db5fb7..0000000
Binary files a/blt3.0.1/demos/images/open2.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/out.ps b/blt3.0.1/demos/images/out.ps
deleted file mode 100644
index 1536442..0000000
--- a/blt3.0.1/demos/images/out.ps
+++ /dev/null
@@ -1,11662 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%BoundingBox: 72 104 539 687
-%%Pages: 0
-%%Creator: (BLT 2.4 Graph)
-%%CreationDate: (Sun May 16 22:17:22 1999)
-%%Title: (out.ps)
-%%%%DocumentData: Clean7Bit
-%Orientation: Landscape
-%%DocumentNeededResources: font Helvetica Courier
-%%EndComments
-%%BeginPreview: 599 480 8 9584
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000000000000000000FF
-% 101018111818181818181818181818181818181818181818181811181010
-% 1218181818181A181A181818161010101010101010101010101817181818
-% 161210101210121012101216181818181818181818181010121018181818
-% 181818101012101018111818181818181818181818181818181818181818
-% 1818111810101218181818181A181A181818161010101010101010101010
-% 101817181818161210101210121012101216181818181818181818181010
-% 121018181818181818101012101018111818181818181818181818181818
-% 1818181818181818111810101218181818181A181A181818161010101010
-% 101010101010101817181818161210101210121012101216181818181818
-% 181818181010121018181818181818101012101018111818181818181818
-% 1818181818181818181818181818111810101218181818181A181A181818
-% 161010101010101010101010101817181818161210101210121012101216
-% 181818181818181818181010121018181818181818101012101018111818
-% 181818181818181818181818181818181818181811181010121818181818
-% 1A181A181818161010101010101010101010101817181818161210101210
-% 121012101216181818181818181818181010121018181818181818101012
-% 101018111818181818181818181818181818181818181818181811181010
-% 1218181818181A181A181818161010101010101010101010101817181818
-% 161210101210121012101216181818181818181818181010121018181818
-% 18181810101210101811181818181818181818181818181818181800FF12
-% 1810181018181018181818181A1818181818181A18181818161818131810
-% 181818181A18181818181818181012101010101010101010181818181818
-% 18181012161816121610181218161818161818121012101012101818181A
-% 1818101010121810181018181018181818181A1818181818181A18181818
-% 161818131810181818181A18181818181818181012101010101010101010
-% 181818181818181810121618161216101812181618181618181210121010
-% 12101818181A1818101010121810181018181018181818181A1818181818
-% 181A18181818161818131810181818181A18181818181818181012101010
-% 101010101010181818181818181810121618161216101812181618181618
-% 18121012101012101818181A181810101012181018101818101818181818
-% 1A1818181818181A18181818161818131810181818181A18181818181818
-% 181012101010101010101010181818181818181810121618161216101812
-% 18161818161818121012101012101818181A181810101012181018101818
-% 1018181818181A1818181818181A18181818161818131810181818181A18
-% 181818181818181012101010101010101010181818181818181810121618
-% 16121610181218161818161818121012101012101818181A181810101012
-% 1810181018181018181818181A1818181818181A18181818161818131810
-% 181818181A18181818181818181012101010101010101010181818181818
-% 18181012161816121610181218161818161818121012101012101818181A
-% 1818101010121810181018181018181818181A1818181818181A00FF1810
-% 121812161218101818181818181818181A18181818181818181810181018
-% 181818181818181818181818101810121010101010101012121012181818
-% 181012181818181212101210181218181810101810181010121218181818
-% 181810121810121812161218101818181818181818181A18181818181818
-% 181810181018181818181818181818181818101810121010101010101012
-% 121012181818181012181818181212101210181218181810101810181010
-% 121218181818181810121810121812161218101818181818181818181A18
-% 181818181818181810181018181818181818181818181818101810121010
-% 101010101012121012181818181012181818181212101210181218181810
-% 101810181010121218181818181810121810121812161218101818181818
-% 181818181A18181818181818181810181018181818181818181818181818
-% 101810121010101010101012121012181818181012181818181212101210
-% 181218181810101810181010121218181818181810121810121812161218
-% 101818181818181818181A18181818181818181810181018181818181818
-% 181818181818101810121010101010101012121012181818181012181818
-% 181212101210181218181810101810181010121218181818181810121810
-% 121812161218101818181818181818181A18181818181818181810181018
-% 181818181818181818181818101810121010101010101012121012181818
-% 181012181818181212101210181218181810101810181010121218181818
-% 181810121810121812161218101818181818181818181A181800FF171816
-% 12161012161210181818181818181A181818181818181818181810181818
-% 18181A181818101812181810121018101210121010101010101010121818
-% 121618181818161010121012101216121818181818181010101012101818
-% 16181817181612161012161210181818181818181A181818181818181818
-% 18181018181818181A181818101812181810121018101210121010101010
-% 101010121818121618181818161010121012101216121818181818181010
-% 10101210181816181817181612161012161210181818181818181A181818
-% 18181818181818181018181818181A181818101812181810121018101210
-% 121010101010101010121818121618181818161010121012101216121818
-% 181818181010101012101818161818171816121610121612101818181818
-% 18181A18181818181818181818181018181818181A181818101812181810
-% 121018101210121010101010101010121818121618181818161010121012
-% 101216121818181818181010101012101818161818171816121610121612
-% 10181818181818181A18181818181818181818181018181818181A181818
-% 101812181810121018101210121010101010101010121818121618181818
-% 161010121012101216121818181818181010101012101818161818171816
-% 12161012161210181818181818181A181818181818181818181810181818
-% 18181A181818101812181810121018101210121010101010101010121818
-% 121618181818161010121012101216121818181818181010101012101818
-% 16181817181612161012161210181818181818181A18181800FF18181818
-% 121010101010121618181818181818181A1818181A181818181818181818
-% 181818181818181010101012101818181010101010101010101010181810
-% 121810181318131010101012101210101210181818181818121012101018
-% 181818181818121010101010121618181818181818181A1818181A181818
-% 181818181818181818181818181010101012101818181010101010101010
-% 101010181810121810181318131010101012101210101210181818181818
-% 121012101018181818181818121010101010121618181818181818181A18
-% 18181A181818181818181818181818181818181010101012101818181010
-% 101010101010101010181810121810181318131010101012101210101210
-% 181818181818121012101018181818181818121010101010121618181818
-% 181818181A1818181A181818181818181818181818181818181010101012
-% 101818181010101010101010101010181810121810181318131010101012
-% 101210101210181818181818121012101018181818181818121010101010
-% 121618181818181818181A1818181A181818181818181818181818181818
-% 181010101012101818181010101010101010101010181810121810181318
-% 131010101012101210101210181818181818121012101018181818181818
-% 121010101010121618181818181818181A1818181A181818181818181818
-% 181818181818181010101012101818181010101010101010101010181810
-% 121810181318131010101012101210101210181818181818121012101018
-% 181818181818121010101010121618181818181818181A00FF1012181010
-% 1010101010101012181818181818181818181A181A181818181818181818
-% 181818181818101210101010181210181012101010101012101218181817
-% 181618161816121012101012101012101210121818181818101012121218
-% 1210121810101010101010101012181818181818181818181A181A181818
-% 181818181818181818181818101210101010181210181012101010101012
-% 101218181817181618161816121012101012101012101210121818181818
-% 101012121218121012181010101010101010101218181818181818181818
-% 1A181A181818181818181818181818181818101210101010181210181012
-% 101010101012101218181817181618161816121012101012101012101210
-% 121818181818101012121218121012181010101010101010101218181818
-% 1818181818181A181A181818181818181818181818181818101210101010
-% 181210181012101010101012101218181817181618161816121012101012
-% 101012101210121818181818101012121218121012181010101010101010
-% 1012181818181818181818181A181A181818181818181818181818181818
-% 101210101010181210181012101010101012101218181817181618161816
-% 121012101012101012101210121818181818101012121218121012181010
-% 1010101010101012181818181818181818181A181A181818181818181818
-% 181818181818101210101010181210181012101010101012101218181817
-% 181618161816121012101012101012101210121818181818101012121218
-% 1210121810101010101010101012181818181818181800FF121010101010
-% 0810101010101010101218161818181A181A181818181817181818181818
-% 181818181818101010101010101210121010181010101010121818181818
-% 181818181818181810181010121010121010101210181818181810101010
-% 1210101010100810101010101010101218161818181A181A181818181817
-% 181818181818181818181818101010101010101210121010181010101010
-% 121818181818181818181818181810181010121010121010101210181818
-% 1818101010101210101010100810101010101010101218161818181A181A
-% 181818181817181818181818181818181818101010101010101210121010
-% 181010101010121818181818181818181818181810181010121010121010
-% 101210181818181810101010121010101010081010101010101010121816
-% 1818181A181A181818181817181818181818181818181818101010101010
-% 101210121010181010101010121818181818181818181818181810181010
-% 121010121010101210181818181810101010121010101010081010101010
-% 1010101218161818181A181A181818181817181818181818181818181818
-% 101010101010101210121010181010101010121818181818181818181818
-% 181810181010121010121010101210181818181810101010121010101010
-% 0810101010101010101218161818181A181A181818181817181818181818
-% 181818181818101010101010101210121010181010101010121818181818
-% 181818181818181810181010121010121010101210181818181810101010
-% 12101010101008101010101010101012181618181800FF10101210101010
-% 0A0F0A10101010101010121618181820181A181818181818121618181818
-% 1818181818121010101010101010101818181817121018161818181A1818
-% 181818181818181812101210101210121012101012101816181612101010
-% 1012101010100A0F0A10101010101010121618181820181A181818181818
-% 121618181818181818181812101010101010101010181818181712101816
-% 1818181A1818181818181818181812101210101210121012101012101816
-% 1816121010101012101010100A0F0A10101010101010121618181820181A
-% 181818181818121618181818181818181812101010101010101010181818
-% 1817121018161818181A1818181818181818181812101210101210121012
-% 1010121018161816121010101012101010100A0F0A101010101010101216
-% 18181820181A181818181818121618181818181818181812101010101010
-% 1010101818181817121018161818181A1818181818181818181812101210
-% 1012101210121010121018161816121010101012101010100A0F0A101010
-% 10101010121618181820181A181818181818121618181818181818181812
-% 1010101010101010101818181817121018161818181A1818181818181818
-% 181812101210101210121012101012101816181612101010101210101010
-% 0A0F0A10101010101010121618181820181A181818181818121618181818
-% 1818181818121010101010101010101818181817121018161818181A1818
-% 181818181818181812101210101210121012101012101816181612101010
-% 1012101010100A0F0A101010101010101216181800FF1012101010101010
-% 0A1010080A10081010101818181A18181818181818101810181217181818
-% 181818181010101010101010101218181818181818181818181818181818
-% 181618181818181612161012101010101010101010121818181818181012
-% 1010101010100A1010080A10081010101818181A18181818181818101810
-% 181217181818181818181010101010101010101218181818181818181818
-% 181818181818181618181818181612161012101010101010101010121818
-% 1818181810121010101010100A1010080A10081010101818181A18181818
-% 181818101810181217181818181818181010101010101010101218181818
-% 181818181818181818181818181618181818181612161012101010101010
-% 1010101218181818181810121010101010100A1010080A10081010101818
-% 181A18181818181818101810181217181818181818181010101010101010
-% 101218181818181818181818181818181818181618181818181612161012
-% 1010101010101010101218181818181810121010101010100A1010080A10
-% 081010101818181A18181818181818101810181217181818181818181010
-% 101010101010101218181818181818181818181818181818181618181818
-% 181612161012101010101010101010121818181818181012101010101010
-% 0A1010080A10081010101818181A18181818181818101810181217181818
-% 181818181010101010101010101218181818181818181818181818181818
-% 181618181818181612161012101010101010101010121818181818181012
-% 1010101010100A1010080A100810101018181800FF181216121818181010
-% 10101008100810101012181818181A181818181818101210101818121818
-% 12161216121010100A10101012181818181818181818181A181818181818
-% 121018181818181210121018101812121612101010181818181818181216
-% 12181818101010101008100810101012181818181A181818181818101210
-% 10181812181812161216121010100A10101012181818181818181818181A
-% 181818181818121018181818181210121018101812121612101010181818
-% 18181818121612181818101010101008100810101012181818181A181818
-% 18181810121010181812181812161216121010100A101010121818181818
-% 18181818181A181818181818121018181818181210121018101812121612
-% 101010181818181818181216121818181010101010081008101010121818
-% 18181A18181818181810121010181812181812161216121010100A101010
-% 12181818181818181818181A181818181818121018181818181210121018
-% 101812121612101010181818181818181216121818181010101010081008
-% 10101012181818181A181818181818101210101818121818121612161210
-% 10100A10101012181818181818181818181A181818181818121018181818
-% 181210121018101812121612101010181818181818181216121818181010
-% 10101008100810101012181818181A181818181818101210101818121818
-% 12161216121010100A10101012181818181818181818181A181818181818
-% 121018181818181210121018101812121612101010181818181818181216
-% 12181818101010101008100810101012181800FF18161210181618101210
-% 101010080A10101010101818181818181817121012161218101210101010
-% 121018121012101010101012181818181A18181818181818181818181010
-% 121818171818101810181018181818181818181210121218161818161210
-% 181618101210101010080A10101010101818181818181817121012161218
-% 101210101010121018121012101010101012181818181A18181818181818
-% 181818181010121818171818101810181018181818181818181210121218
-% 161818161210181618101210101010080A10101010101818181818181817
-% 121012161218101210101010121018121012101010101012181818181A18
-% 181818181818181818181010121818171818101810181018181818181818
-% 181210121218161818161210181618101210101010080A10101010101818
-% 181818181817121012161218101210101010121018121012101010101012
-% 181818181A18181818181818181818181010121818171818101810181018
-% 181818181818181210121218161818161210181618101210101010080A10
-% 101010101818181818181817121012161218101210101010121018121012
-% 101010101012181818181A18181818181818181818181010121818171818
-% 101810181018181818181818181210121218161818161210181618101210
-% 101010080A10101010101818181818181817121012161218101210101010
-% 121018121012101010101012181818181A18181818181818181818181010
-% 121818171818101810181018181818181818181210121218161818161210
-% 181618101210101010080A10101010101800FF1012101012181818181012
-% 101010101010101218181818181818181812101218121012101210121010
-% 18121612101010101010101818181A181A18181A181A1818181810121010
-% 10181218101218181818181818181A181818181210101012181012101012
-% 181818181012101010101010101218181818181818181812101218121012
-% 10121012101018121612101010101010101818181A181A18181A181A1818
-% 18181012101010181218101218181818181818181A181818181210101012
-% 181012101012181818181012101010101010101218181818181818181812
-% 10121812101210121012101018121612101010101010101818181A181A18
-% 181A181A181818181012101010181218101218181818181818181A181818
-% 1812101010121810121010121818181810121010101010FF1012181818FF
-% 181818181812101218121012101210121010181216121010101010101018
-% 18181A181A18181A181A1818181810121010101812181012181818181818
-% 18181A181818181210101012181012101012181818181012101010101010
-% 101218181818181818181812101218121012101210121010181216121010
-% 10101010101818181A181A18181A181A1818181810121010101812181012
-% 18181818181818181A181818181210101012181012101012181818181012
-% 101010101010101218181818181818181812101218121012101210121010
-% 18121612101010101010101818181A181A18181A181A1818181810121010
-% 10181218101218181818181818181A181818181210101012181012101012
-% 1818181810121010101010101012181800FF181012101210101012101210
-% 100A08101010101012101218101810121010101010181818181010101010
-% 101210121810181012121818181A18181818181818181818101010101010
-% 101010121010101012101818181818181818181818181018181012101210
-% 101012101210100A08101010101012101218101810121010101010181818
-% 181010101010101210121810181012121818181A18181818181818181818
-% 101010101010101010121010101012101818181818181818181818181018
-% 181012101210101012101210100A08101010101012101218101810121010
-% 101010181818181010101010101210121810181012121818181A18181818
-% 181818181818101010101010101010121010101012101818181818181818
-% 181818181018181012101210101012101210100A081010FF101012FF1218
-% 101810121010101010181818181010101010101210121810181012121818
-% 181A18181818181818181818101010101010101010121010101012101818
-% 181818181818181818181018181012101210101012101210100A08101010
-% 101012101218101810121010101010181818181010101010101210121810
-% 181012121818181A18181818181818181818101010101010101010121010
-% 101012101818181818181818181818181018181012101210101012101210
-% 100A08101010101012101218101810121010101010181818181010101010
-% 101210121810181012121818181A18181818181818181818101010101010
-% 101010121010101012101818181818181818181818181018181012101210
-% 101012101210100A0810101010101200FF18181810101010121012161010
-% 101010101010101010121012121010101010101018181818181810181010
-% 101012101816121816181818181818181818181818181810101010101010
-% 101012101210121018181718181618181818181818181818181810101010
-% 121012161010101010101010101010121012121010101010101018181818
-% 181810181010101012101816121816181818181818181818181818181810
-% 101010101010101012101210121018181718181618181818181818181818
-% 181810101010121012161010101010101010101010121012121010101010
-% 101018181818181810181010101012101816121816181818181818181818
-% 181818181810101010101010101012101210121018181718181618181818
-% 18181818181818181010101012101216101010101010FF101010FF121012
-% 121010101010101018181818181810181010101012101816121816181818
-% 181818181818181818181810101010101010101012101210121018181718
-% 181618181818181818181818181810101010121012161010101010101010
-% 101010121012121010101010101018181818181810181010101012101816
-% 121816181818181818181818181818181810101010101010101012101210
-% 121018181718181618181818181818181818181810101010121012161010
-% 101010101010101010121012121010101010101018181818181810181010
-% 101012101816121816181818181818181818181818181810101010101010
-% 101012101210121018181718181618181818181818181818181810101010
-% 121012161010101010101010101000FF1818171818181810101210121010
-% 101010101010101010101010101010081010101218181818181818101010
-% 101010181212161818181A16181818181618181818101210101010101210
-% 181818101810181018121818181818181818181818181818171818181810
-% 101210121010101010101010101010101010101010081010101218181818
-% 181818101010101010181212161818181A16181818181618181818101210
-% 101010101210181818101810181018121818181818181818181818181818
-% 171818181810101210121010101010101010101010101010101010081010
-% 101218181818181818101010101010181212161818181A16181818181618
-% 181818101210101010101210181818101810181018121818181818181818
-% 18181818181817181818181010121012101010101010FF10FF1010101010
-% 101010081010101218181818181818101010101010181212161818181A16
-% 181818181618181818101210101010101210181818101810181018121818
-% 181818181818181818181818171818181810101210121010101010101010
-% 101010101010101010081010101218181818181818101010101010181212
-% 161818181A16181818181618181818101210101010101210181818101810
-% 181018121818181818181818181818181818171818181810101210121010
-% 101010101010101010101010101010081010101218181818181818101010
-% 101010181212161818181A16181818181618181818101210101010101210
-% 181818101810181018121818181818181818181818181818171818181810
-% 1012101210101010101010101000FF121818181818181012101810181816
-% 12181818121010101210101010100A081010181818181818181818121010
-% 101012101012121818181818161818181818161310101010101012161818
-% 181818181210121012101810181818181818181818121818181818181012
-% 10181018181612181818121010101210101010100A081010181818181818
-% 181818121010101012101012121818181818161818181818161310101010
-% 101012161818181818181210121012101810181818181818181818121818
-% 18181818101210181018181612181818121010101210101010100A081010
-% 181818181818181818121010101012101012121818181818161818181818
-% 161310101010101012161818181818181210121012101810181818181818
-% 18181812181818181818101210181018181612181818FF10101012101010
-% 10100A081010181818181818181818121010101012101012121818181818
-% 161818181818161310101010101012161818181818181210121012101810
-% 181818181818181818121818181818181012101810181816121818181210
-% 10101210101010100A081010181818181818181818121010101012101012
-% 121818181818161818181818161310101010101012161818181818181210
-% 121012101810181818181818181818121818181818181012101810181816
-% 12181818121010101210101010100A081010181818181818181818121010
-% 101012101012121818181818161818181818161310101010101012161818
-% 181818181210121012101810181818181818181818121818181818181012
-% 10181018181612181818121000FF10121012101212101012121618181818
-% 181818181818101818131610101010101210181818181818181010101010
-% 101010101010121018181818181818181818101210101010101818181818
-% 1A1818181010101010121012101812161818181010121012101212101012
-% 121618181818181818181818101818131610101010101210181818181818
-% 181010101010101010101010121018181818181818181818101210101010
-% 1018181818181A1818181010101010121012101812161818181010121012
-% 101212101012121618181818181818181818101818131610101010101210
-% 181818181818181010101010101010101010121018181818181818181818
-% 1012101010101018181818181A1818181010101010121012101812161818
-% 181010121012101212101012121618181818181818FF1818101818131610
-% 101010101210181818181818181010101010101010101010121018181818
-% 1818181818181012101010101018181818181A1818181010101010121012
-% 101812161818181010121012101212101012121618181818181818181818
-% 101818131610101010101210181818181818181010101010101010101010
-% 1210181818181818181818181012101010101018181818181A1818181010
-% 101010121012101812161818181010121012101212101012121618181818
-% 181818181818101818131610101010101210181818181818181010101010
-% 101010101010121018181818181818181818101210101010101818181818
-% 1A1818181010101010121012101812161818181010121012101212101012
-% 121618181818181818181800FF1210101210101010181010121818181818
-% 181A181A1818181718181218181810101810181218181012101210101818
-% 1010101010101212181818181818181818181012101010101818181A1818
-% 181818121010101010121010101012101818101210101210101010181010
-% 121818181818181A181A1818181718181218181810101810181218181012
-% 101210101818101010101010121218181818181818181818101210101010
-% 1818181A1818181818121010101010121010101012101818101210101210
-% 101010181010121818181818181A181A1818181718181218181810101810
-% 181218181012101210101818101010101010121218181818181818181818
-% 1012101010101818181A1818181818121010101010121010101012101818
-% 10121010121010101018101012181818181818FF18FF1818181718181218
-% 181810101810181218181012101210101818101010101010121218181818
-% 1818181818181012101010101818181A1818181818121010101010121010
-% 101012101818101210101210101010181010121818181818181A181A1818
-% 181718181218181810101810181218181012101210101818101010101010
-% 1212181818181818181818181012101010101818181A1818181818121010
-% 101010121010101012101818101210101210101010181010121818181818
-% 181A181A1818181718181218181810101810181218181012101210101818
-% 1010101010101212181818181818181818181012101010101818181A1818
-% 181818121010101010121010101012101818101210101210101010181010
-% 121818181818181A181A00FF181812101012101212101210101818161818
-% 1A1818181818181818171818181612121012101010181810101212181018
-% 181010101210101818181A18181818181816121012121818181818181A18
-% 181810100B0E10101010100E101010121818181812101012101212101210
-% 1018181618181A1818181818181818171818181612121012101010181810
-% 101212181018181010101210101818181A18181818181816121012121818
-% 181818181A18181810100B0E10101010100E101010121818181812101012
-% 1012121012101018181618181A1818181818181818171818181612121012
-% 101010181810101212181018181010101210101818181A18181818181816
-% 121012121818181818181A18181810100B0E10101010100E101010121818
-% 1818121010121012121012101018181618FF1A1818FF1818181818171818
-% 181612121012101010181810101212181018181010101210101818181A18
-% 181818181816121012121818181818181A18181810100B0E10101010100E
-% 1010101218181818121010121012121012101018181618181A1818181818
-% 181818171818181612121012101010181810101212181018181010101210
-% 101818181A18181818181816121012121818181818181A18181810100B0E
-% 10101010100E101010121818181812101012101212101210101818161818
-% 1A1818181818181818171818181612121012101010181810101212181018
-% 181010101210101818181A18181818181816121012121818181818181A18
-% 181810100B0E10101010100E101010121818181812101012101212101210
-% 1018181618181A181800FF18181818121010181010101012181810101818
-% 181818121012101818181818181810101010101018181012101010181818
-% 18181612161218181818181818181818181018131618181818181A181A18
-% 1812101010101010100A100A101012161818181818121010181010101012
-% 181810101818181818121012101818181818181810101010101018181012
-% 101010181818181816121612181818181818181818181810181316181818
-% 18181A181A181812101010101010100A100A101012161818181818121010
-% 181010101012181810101818181818121012101818181818181810101010
-% 101018181012101010181818181816121612181818181818181818181810
-% 18131618181818181A181A181812101010101010100A100A101012161818
-% 18181812101018101010101218181010FF181818FF121012101818181818
-% 181810101010101018181012101010181818181816121612181818181818
-% 18181818181018131618181818181A181A181812101010101010100A100A
-% 101012161818181818121010181010101012181810101818181818121012
-% 101818181818181810101010101018181012101010181818181816121612
-% 18181818181818181818181018131618181818181A181A18181210101010
-% 1010100A100A101012161818181818121010181010101012181810101818
-% 181818121012101818181818181810101010101018181012101010181818
-% 18181612161218181818181818181818181018131618181818181A181A18
-% 1812101010101010100A100A101012161818181818121010181010101012
-% 181810101818181800FF1618181818181018181810121010101818161818
-% 18161810101018131618181A181818121010101810181210181813181818
-% 18181818181818181818181818181018101216181818181A181A18181818
-% 1818181810100A1010101010101012181618181818181018181810121010
-% 10181816181818161810101018131618181A181818121010101810181210
-% 18181318181818181818181818181818181818181018101216181818181A
-% 181A181818181818181810100A1010101010101012181618181818181018
-% 18181012101010181816181818161810101018131618181A181818121010
-% 101810181210181813181818181818181818181818181818181810181012
-% 16181818181A181A181818181818181810100A1010101010101012181618
-% 1818181810181818101210101018FF1618181816FF10101018131618181A
-% 181818121010101810181210181813181818181818181818181818181818
-% 18181018101216181818181A181A181818181818181810100A1010101010
-% 101012181618181818181018181810121010101818161818181618101010
-% 18131618181A181818121010101810181210181813181818181818181818
-% 18181818181818181018101216181818181A181A18181818181818181010
-% 0A1010101010101012181618181818181018181810121010101818161818
-% 18161810101018131618181A181818121010101810181210181813181818
-% 18181818181818181818181818181018101216181818181A181A18181818
-% 1818181810100A1010101010101012181618181818181018181810121010
-% 1018181618181800FF121818181818181818171210101010121012181018
-% 121818181812161812161818181818101810121012161818101818181818
-% 1818181818181818181A1818181818181818181818181818181818181216
-% 181812101010121010101010101012121818181818181818171210101010
-% 121012181018121818181812161812161818181818101810121012161818
-% 1018181818181818181818181818181A1818181818181818181818181818
-% 181818181216181812101010121010101010101012121818181818181818
-% 171210101010121012181018121818181812161812161818181818101810
-% 1210121618181018181818181818181818181818181A1818181818181818
-% 181818181818181818181216181812101010121010101010101012121818
-% 181818181818171210101010121012181018121818181812161812161818
-% 1818181018101210121618181018181818181818181818181818181A1818
-% 181818181818181818181818181818181216181812101010121010101010
-% 101012121818181818181818171210101010121012181018121818181812
-% 161812161818181818101810121012161818101818181818181818181818
-% 1818181A1818181818181818181818181818181818181216181812101010
-% 121010101010101012121818181818181818171210101010121012181018
-% 121818181812161812161818181818101810121012161818101818181818
-% 1818181818181818181A1818181818181818181818181818181818181216
-% 181812101010121010101010101012121818181818181818171210101010
-% 12101218101800FF10121612181610181818121612101012101210121618
-% 181818181818121018101216181618181810181012101210181618181818
-% 18181A181A18181818181818181818181818181018181818181812101012
-% 161818121018101010101010101010121612181610181818121612101012
-% 101210121618181818181818121018101216181618181810181012101210
-% 18161818181818181A181A18181818181818181818181818181018181818
-% 181812101012161818121018101010101010101010121612181610181818
-% 121612101012101210121618181818181818121018101216181618181810
-% 18101210121018161818181818181A181A18181818181818181818181818
-% 181018181818181812101012161818121018101010101010101010121612
-% 181610181818121612101012101210121618181818181818121018101216
-% 18161818181018101210121018161818181818181A181A18181818181818
-% 181818181818181018181818181812101012161818121018101010101010
-% 101010121612181610181818121612101012101210121618181818181818
-% 12101810121618161818181018101210121018161818181818181A181A18
-% 181818181818181818181818181018181818181812101012161818121018
-% 101010101010101010121612181610181818121612101012101210121618
-% 181818181818121018101216181618181810181012101210181618181818
-% 18181A181A18181818181818181818181818181018181818181812101012
-% 161818121018101010101010101010121612181610181818121612101012
-% 101210121600FF1010121012181218161810121012101010101010121216
-% 181818161810181010121012181818181612101810121012121018181818
-% 18181818181A18181A1E181A181818181818181818181818181810101210
-% 181216181810121010121010101010121012181218161810121012101010
-% 101010121216181818161810181010121012181818181612101810121012
-% 12101818181818181818181A18181A1E181A181818181818181818181818
-% 181810101210181216181810121010121010101010121012181218161810
-% 121012101010101010121216181818161810181010121012181818181612
-% 10181012101212101818181818181818181A18181A1E181A181818181818
-% 181818181818181810101210181216181810121010121010101010121012
-% 181218161810121012101010101010121216181818161810181010121012
-% 18181818161210181012101212101818181818181818181A18181A1E181A
-% 181818181818181818181818181810101210181216181810121010121010
-% 101010121012181218161810121012101010101010121216181818161810
-% 18101012101218181818161210181012101212101818181818181818181A
-% 18181A1E181A181818181818181818181818181810101210181216181810
-% 121010121010101010121012181218161810121012101010101010121216
-% 181818161810181010121012181818181612101810121012121018181818
-% 18181818181A18181A1E181A181818181818181818181818181810101210
-% 181216181810121010121010101010121012181218161810121012101010
-% 1010101200FF101010101012161218101812161210101012101210101210
-% 181218181818181810181810121210121810121010101010121012181818
-% 1818181818181A181A18181818181818181818181A181818181010121012
-% 101210121810121010101210101010101012161218101812161210101012
-% 101210101210181218181818181810181810121210121810121010101010
-% 1210121818181818181818181A181A18181818181818181818181A181818
-% 181010121012101210121810121010101210101010101012161218101812
-% 161210101012101210101210181218181818181810181810121210121810
-% 1210101010101210121818181818181818181A181A181818181818181818
-% 18181A181818181010121012101210121810121010101210101010101012
-% 161218101812161210101012101210101210181218181818181810181810
-% 1212101218101210101010101210121818181818181818181A181A181818
-% 18181818181818181A181818181010121012101210121810121010101210
-% 101010101012161218101812161210101012101210101210181218181818
-% 181810181810121210121810121010101010121012181818181818181818
-% 1A181A18181818181818181818181A181818181010121012101210121810
-% 121010101210101010101012161218101812161210101012101210101210
-% 181218181818181810181810121210121810121010101010121012181818
-% 1818181818181A181A18181818181818181818181A181818181010121012
-% 101210121810121010101210101010101012161218101812161210101012
-% 10121000FF10101012181818161818181018161810101010101012101210
-% 101218161818181818101210101018161210121010101010101210121612
-% 181818181A18201E1A181A18181818181818181818181818181812101010
-% 101018101818181812101010101012181818161818181018161810101010
-% 101012101210101218161818181818101210101018161210121010101010
-% 101210121612181818181A18201E1A181A18181818181818181818181818
-% 181812101010101018101818181812101010101012181818161818181018
-% 161810101010101012101210101218161818181818101210101018161210
-% 121010101010101210121612181818181A18201E1A181A18181818181818
-% 181818181818181812101010101018101818181812101010101012181818
-% 161818181018161810101010101012101210101218161818181818101210
-% 101018161210121010101010101210121612181818181A18201E1A181A18
-% 181818181818181818181818181812101010101018101818181812101010
-% 101012181818161818181018161810101010101012101210101218161818
-% 181818101210101018161210121010101010101210121612181818181A18
-% 201E1A181A18181818181818181818181818181812101010101018101818
-% 181812101010101012181818161818181018161810101010101012101210
-% 101218161818181818101210101018161210121010101010101210121612
-% 181818181A18201E1A181A18181818181818181818181818181812101010
-% 101018101818181812101010101012181818161818181018161810101010
-% 101000FF1810121018181818121810181818181810121012101010101012
-% 101012121018181018101010101812101010101010101010101010101018
-% 18181818181A181A18181818181613181818181818181818121010101010
-% 101012101818181818181810121018181818121810181818181810121012
-% 101010101012101012121018181018101010101812101010101010101010
-% 10101010101818181818181A181A18181818181613181818181818181818
-% 121010101010101012101818181818181810121018181818121810181818
-% 181810121012101010101012101012121018181018101010101812101010
-% 10101010101010101010101818181818181A181A18181818181613181818
-% 181818181818121010101010101012101818181818181810121018181818
-% 121810181818181810121012101010101012101012121018181018101010
-% 10181210101010101010101010101010101818181818181A181A18181818
-% 181613181818181818181818121010101010101012101818181818181810
-% 121018181818121810181818181810121012101010101012101012121018
-% 18101810101010181210101010101010101010101010101818181818181A
-% 181A18181818181613181818181818181818121010101010101012101818
-% 181818181810121018181818121810181818181810121012101010101012
-% 101012121018181018101010101812101010101010101010101010101018
-% 18181818181A181A18181818181613181818181818181818121010101010
-% 101012101818181818181810121018181818121810181818181810121012
-% 1000FF1A1818181618181816181818181618181818101010101012121012
-% 101010101218101210121010181016121010101010101010101010101018
-% 18181818181820181A181818121612101818181012161216101010101012
-% 1010181818181818181A1818181618181816181818181618181818101010
-% 101012121012101010101218101210121010181016121010101010101010
-% 10101010101818181818181820181A181818121612101818181012161216
-% 1010101010121010181818181818181A1818181618181816181818181618
-% 181818101010101012121012101010101218101210121010181016121010
-% 10101010101010101010101818181818181820181A181818121612101818
-% 1810121612161010101010121010181818181818181A1818181618181816
-% 181818181618181818101010101012121012101010101218101210121010
-% 18101612101010101010101010101010101818181818181820181A181818
-% 1216121018181810121612161010101010121010181818181818181A1818
-% 181618181816181818181618181818101010101012121012101010101218
-% 101210121010181016121010101010101010101010101018181818181818
-% 20181A181818121612101818181012161216101010101012101018181818
-% 1818181A1818181618181816181818181618181818101010101012121012
-% 101010101218101210121010181016121010101010101010101010101018
-% 18181818181820181A181818121612101818181012161216101010101012
-% 1010181818181818181A1818181618181816181818181618181818101010
-% 00FF181818181A1818181810181018181816181216121018101010121010
-% 101010101012101216181812181818181810101010101010101010101210
-% 18181A20211818181818101612101210101210181018181310100A080810
-% 10101216181A1818181818181A1818181810181018181816181216121018
-% 101010121010101010101012101216181812181818181810101010101010
-% 10101010121018181A202118181818181016121012101012101810181813
-% 10100A08081010101216181A1818181818181A1818181810181018181816
-% 181216121018101010121010101010101012101216181812181818181810
-% 10101010101010101010121018181A202118181818181016121012101012
-% 10181018181310100A08081010101216181A1818181818181A1818181810
-% 181018181816181216121018101010121010101010101012101216181812
-% 18181818181010101010101010101010121018181A202118181818181016
-% 12101210101210181018181310100A08081010101216181A181818181818
-% 1A1818181810181018181816181216121018101010121010101010101012
-% 10121618181218181818181010101010101010101010121018181A202118
-% 18181818101612101210101210181018181310100A08081010101216181A
-% 1818181818181A1818181810181018181816181216121018101010121010
-% 101010101012101216181812181818181810101010101010101010101210
-% 18181A20211818181818101612101210101210181018181310100A080810
-% 10101216181A1818181818181A1818181810181018181816181216121000
-% FF1818181818181A18101812121212181818181012101210101216181818
-% 181210121018101812181612181618181818101010101010101010101218
-% 1818201A1818181212181218101810121018101218161818101010081010
-% 10181818181A181818181818181A18101812121212181818181012101210
-% 101216181818181210121018101812181612181618181818101010101010
-% 1010101012181818201A1818181212181218101810121018101218161818
-% 10101008101010181818181A181818181818181A18101812121212181818
-% 181012101210101216181818181210121018101812181612181618181818
-% 1010101010101010101012181818201A1818181212181218101810121018
-% 10121816181810101008101010181818181A181818181818181A18101812
-% 121212181818181012101210101216181818181210121018101812181612
-% 1816181818181010101010101010101012181818201A1818181212181218
-% 10181012101810121816181810101008101010181818181A181818181818
-% 181A18101812121212181818181012101210101216181818181210121018
-% 1018121816121816181818181010101010101010101012181818201A1818
-% 18121218121810181012101810121816181810101008101010181818181A
-% 181818181818181A18101812121212181818181012101210101216181818
-% 181210121018101812181612181618181818101010101010101010101218
-% 1818201A1818181212181218101810121018101218161818101010081010
-% 10181818181A181818181818181A181018121212121818181810121000FF
-% 1A181A181A18181818121010101010181210101012101216121818181818
-% 1818181818121618121012101212161818101010121010100E1010101218
-% 181818181810101012101818181818101210121018181818121010101012
-% 1818181A18181A181A181A18181818121010101010181210101012101216
-% 121818181818181818181812161812101210121216181810101012101010
-% 0E1010101218181818181810101012101818181818101210121018181818
-% 1210101010121818181A18181A181A181A18181818121010101010181210
-% 101012101216121818181818181818181812161812101210121216181810
-% 1010121010100E1010101218181818181810101012101818181818101210
-% 1210181818181210101010121818181A18181A181A181A18181818121010
-% 101010181210101012101216121818181818181818181812161812101210
-% 1212161818101010121010100E1010101218181818181810101012101818
-% 1818181012101210181818181210101010121818181A18181A181A181A18
-% 181818121010101010181210101012101216121818181818181818181812
-% 1618121012101212161818101010121010100E1010101218181818181810
-% 1010121018181818181012101210181818181210101010121818181A1818
-% 1A181A181A18181818121010101010181210101012101216121818181818
-% 1818181818121618121012101212161818101010121010100E1010101218
-% 181818181810101012101818181818101210121018181818121010101012
-% 1818181A18181A181A181A1818181812101010101018121010101200FF18
-% 181818181818181810101010101018181012101010121012161818181818
-% 181818181818131612101010101212181012101010101010101010101216
-% 181812101210121012161818181818121010101012181818181210121018
-% 18181A181818181818181818181810101010101018181012101010121012
-% 161818181818181818181818131612101010101212181012101010101010
-% 101010101216181812101210121012161818181818121010101012181818
-% 18121012101818181A181818181818181818181810101010101018181012
-% 101010121012161818181818181818181818131612101010101212181012
-% 101010101010101010101216181812101210121012161818181818121010
-% 10101218181818121012101818181A181818181818181818181810101010
-% 101018181012101010121012161818181818181818181818131612101010
-% 101212181012101010101010101010101216181812101210121012161818
-% 18181812101010101218181818121012101818181A181818181818181818
-% 181810101010101018181012101010121012161818181818181818181818
-% 131612101010101212181012101010101010101010101216181812101210
-% 12101216181818181812101010101218181818121012101818181A181818
-% 181818181818181810101010101018181012101010121012161818181818
-% 181818181818131612101010101212181012101010101010101010101216
-% 181812101210121012161818181818121010101012181818181210121018
-% 18181A181818181818181818181810101010101018181012101000FF1818
-% 181818181818121010101010101818101010101218101012181818181818
-% 181818181816181818121010101012161218101012101010101010121012
-% 101010101010101212181818181818101210101010101216181216181818
-% 18181A181818181818181818121010101010101818101010101218101012
-% 181818181818181818181816181818121010101012161218101012101010
-% 101010121012101010101010101212181818181818101210101010101216
-% 18121618181818181A181818181818181818121010101010101818101010
-% 101218101012181818181818181818181816181818121010101012161218
-% 101012101010101010121012101010101010101212181818181818101210
-% 10101010121618121618181818181A181818181818181818121010101010
-% 101818101010101218101012181818181818181818181816181818121010
-% 101012161218101012101010101010121012101010101010101212181818
-% 18181810121010101010121618121618181818181A181818181818181818
-% 121010101010101818101010101218101012181818181818181818181816
-% 181818121010101012161218101012101010101010121012101010101010
-% 10121218181818181810121010101010121618121618181818181A181818
-% 181818181818121010101010101818101010101218101012181818181818
-% 181818181816181818121010101012161218101012101010101010121012
-% 101010101010101212181818181818101210101010101216181216181818
-% 18181A1818181818181818181210101010101018181010101000FF181818
-% 181818181810121010101010181618181216121010101210181810121818
-% 181818181818181818161210101018121612101010101010121010121010
-% 12101010101010101818181A181812101010100808101012101812171818
-% 181818181818181818181810121010101010181618181216121010101210
-% 181810121818181818181818181818161210101018121612101010101010
-% 12101012101012101010101010101818181A181812101010100808101012
-% 101812171818181818181818181818181810121010101010181618181216
-% 121010101210181810121818181818181818181818161210101018121612
-% 10101010101012101012101012101010101010101818181A181812101010
-% 100808101012101812171818181818181818181818181810121010101010
-% 181618181216121010101210181810121818181818181818181818161210
-% 10101812161210101010101012101012101012101010101010101818181A
-% 181812101010100808101012101812171818181818181818181818181810
-% 121010101010181618181216121010101210181810121818181818181818
-% 181818161210101018121612101010101010121010121010121010101010
-% 10101818181A181812101010100808101012101812171818181818181818
-% 181818181810121010101010181618181216121010101210181810121818
-% 181818181818181818161210101018121612101010101010121010121010
-% 12101010101010101818181A181812101010100808101012101812171818
-% 18181818181818181818181012101010101018161818121600FF12161818
-% 101810181210121010101212181818181812101010121613101210181618
-% 181818181818181818181010101216121012101216181810181012101216
-% 12101010FFFFFFFF18181818FFFFFFFF1010100AFFFFFFFF121612181818
-% 181812161818101810181210121010101212181818181812101010121613
-% FFFFFFFFFFFF18181818FFFF1818181810FFFFFFFF121012101216181810
-% 181012101216121010101010101818181818181818101010100A10FFFFFF
-% FFFFFF181818FFFFFFFF18181018FFFFFFFF121010101212181818181812
-% 1010101216131012101816181818181818181818181810101012161210FF
-% FFFFFF1818101810FFFFFFFF121010101010101818181818181818101010
-% 100A10101010121612181818181812161818101810181210121010FFFFFF
-% FF1818181812101010121613101210181618181818181818181818181010
-% 10121612101210121618181018101210121612FFFFFFFF1010181818FFFF
-% FFFF18101010100A10101010121612181818181812161818101810181210
-% 12101010121218181818181210FFFFFFFFFFFF121018FFFFFFFF18181818
-% FFFFFFFF1010101216121012101216181810181012101216121010101010
-% 10181818181818181810FFFFFFFFFFFF10101216FFFF1818181812FFFFFF
-% FF1810181210121010101212181818181812101010121613101210181618
-% 181818181818181818FFFFFFFF12161210FFFFFFFF18181018FFFFFFFF16
-% 121010101010101818181818181818101010100A10101010121612181818
-% 181812161818101810181210121010101212181818181800FF1012101012
-% 161210101010121012161818181A18181210181218181818101218121216
-% 181818181218181818181012101810181018101218181818181216121812
-% 1010FF101010FFFF181AFFFF1818FFFF1010FFFF100AFFFF101818181818
-% 121012101012161210101010121012161818181A18181210181218181818
-% FFFF18121216181818FFFF18181818FFFF1210FFFF181018101218181818
-% 1812161218121010101010101818181A20181818101210101010100AFFFF
-% 10181818FFFF1210FFFF1012FFFF1010FFFF121012161818181A18181210
-% 181218181818101218121216181818181218181818181012101810181018
-% 10FFFF181818FFFF1612FFFF1010101010101818181A2018181810121010
-% 1010100A101210181818181812101210101216121010101012FFFF1618FF
-% FF1A18181210181218181818101218121216181818181218181818181012
-% 101810181018101218181818181216121812101010FFFF101818FFFF2018
-% FFFF101210101010100A1012101818181818121012101012161210101010
-% 121012161818181A181812101812FFFF18181012FFFF1216FFFF1818FFFF
-% 1818FFFF1012101810181018101218181818181216121812101010101010
-% 1818181A201818181012FFFF1010100A101210FFFF18181812FFFF1010FF
-% FF1210101010121012161818181A18181210181218181818101218121216
-% 18181818121818FF181810FFFF1810FFFF1810FFFF1818FFFF1216FFFF12
-% 1010101010101818181A20181818101210101010100A1012101818181818
-% 121012101012161210101010121012161818181A181800FF181818181810
-% 1216121612161218181818181A1818181010101010121018101010101218
-% 18181810121010101018181012101812181816181A181818181816181818
-% 1818101010FFFF1216FFFF1818FFFF1210FFFF1010FFFF10101012101818
-% 1818181818101216121612161218181818181A1818181010101010121018
-% FFFF10101218181818FFFF101010FFFF1810FFFF1812181816181A181818
-% 181816181818181810101010101216181818181810121010101010FFFF10
-% 101012FFFF1818FFFF1818FFFF1612FFFF161218181818181A1818181010
-% 101010121018101010101218181818101210101010181810121018121818
-% 16FFFF1818FFFF1816FFFF18181810101010101216181818181810121010
-% 101010101010101012101818181818181810121612161216FFFF1818FFFF
-% 1A1818181010101010121018101010101218181818101210101010181810
-% 12101812181816181A181818181816181818181810FFFF1010FFFF1818FF
-% FF1810121010101010101010101012101818181818181810121612161216
-% 1218181818181A181818101010FFFF12101810FFFF1012FFFF1818FFFF10
-% 10FFFF18181012101812181816181A181818181816181818181810101010
-% 10121618181818181012FFFF10101010101010FFFF101818FFFF1818FFFF
-% 1216121612161218181818181A1818181010101010121018101010101218
-% 18181810121010101018FFFF1210FFFF1818FFFF1A18FFFF1818FFFF1818
-% 181810101010101216181818181810121010101010101010101012101818
-% 1818181818101216121612161218181818181A181800FF1A181818101210
-% 181012101216181818181818181818181010101010101010101010101216
-% 1818181010121012181810101216121618181818181AFFFFFFFFFFFF1818
-% 16181818FFFF1012FFFF1810FFFF1010FFFF1210FFFF101210121618181A
-% 18181810121018101210121618181818181818FFFFFFFFFFFF1010101010
-% FFFF101012161818FFFF101210FFFF1810FFFF16121618181818181A1818
-% 18181818181816181818101010121810FFFFFFFFFFFF10101210FFFF1012
-% 1012FFFF181AFFFF1810FFFF1810FFFF1216181818181818181818181010
-% 101010101010101010101216181818101012FFFFFFFFFFFF121612FFFFFF
-% FFFF181AFFFF1818FFFF1818161818181010101218101810181210101010
-% 12101010101210121618181A1818181012101810121012FFFF1818FFFF18
-% 181818181010101010101010101010101216181818101012101218181010
-% 1216121618181818181A18181818181818FFFFFFFFFF1010FFFF1810FFFF
-% 18121010101012101010101210121618181A181818101210181012101216
-% 181818181818181818181010FFFF10101010FFFF1010FFFF1818FFFF1012
-% FFFF181810101216121618181818181A1818181818181818161818181010
-% 10121810181018121010FFFF121010101012FFFF161818FFFF1818FFFF10
-% 181012101216181818181818181818181010101010101010101010101216
-% 181818101012101218FFFF1012FFFF1618FFFF1818FFFF1818FFFF181818
-% 16181818101010121810181018121010101012101010101210121618181A
-% 181818101210181012101216181818181818181800FF1818181818111813
-% 161216121818181818181A18181818101010101010100A10101010101218
-% 181818181012161218101210181318181818181818181818181012161318
-% 18FFFFFF101012FFFFFFFFFF101012FFFF1618FFFF12161818FFFF181818
-% 181818111813161216121818181818181A18181818101010101010100A10
-% FFFF1010121818FFFF181012FFFF1810FFFF18131818FFFF181818181818
-% 18101216131818181812101012101012101810101210121618FFFF121618
-% 1818FFFFFFFF181818FFFF1316FFFF12181818FFFF181A18181818101010
-% 101010100A1010101010121818181818101216121810121018FFFF1818FF
-% FF1818FFFF1818FFFF16131818FFFF121010121010121018101012101216
-% 18161812161818181818181818181811181316121612FFFF1818FFFF1A18
-% 1818FFFF1010101010100A10101010101218181818181012161218101210
-% 181318181818181818181818181012FFFF1818FFFF1210FFFF1010FFFF18
-% 101012FFFF16181618121618181818181818181818111813161216121818
-% 181818181A181818181010FFFF1010100A10FFFFFFFF121818FFFF1810FF
-% FF12181012FFFF1318181818181818181818181012161318181818121010
-% 12101012101810101210FFFF1816181216FFFF181818FFFF1818FFFF1813
-% 1612FFFF1818181818181A18181818101010101010100A10101010101218
-% 181818181012FFFFFF101210FFFFFFFFFF181818FFFF1818FFFF12161318
-% FFFF18121010121010121018101012101216181618121618181818181818
-% 181818111813161216121818181818181A181800FF1A1818181818161818
-% 1210121618181A181A181818181810101010101010101010081010101818
-% 181818181018161216121810181018101818181818181810101012181818
-% 1818FFFF1010FFFF121012101210FFFF1818FFFF181818FF1818FF1A1818
-% 1818181618181210121618181A181A18181818181010101010FFFF1010FF
-% FF101010181818FFFF1810FFFF1216FFFF101810FF1018FF181818181810
-% 101012181818181818181010101012101210121012161818FFFF18181818
-% FFFF181AFFFF1818FFFF1818FFFF121618FF1A18FF181818181810101010
-% 101010101010081010101818181818181018161216121810FFFF1810FFFF
-% 1818FFFF1810FFFF121818FF1818FF181010101012101210121012161818
-% 1818181818181818181A1818181818161818121012FFFF181AFFFF181818
-% FF1810FF1010101010101010081010101818181818181018161216121810
-% 1810181018181818181818101010FFFF1818FFFF1818FFFF1010FFFF1210
-% 12FF1216FF181818181818181818181A1818181818161818121012161818
-% 1A181A18181818181010FFFF10101010FFFF0810FFFF1818FFFF1818FFFF
-% 161216FF1810FF1018101818181818181810101012181818181818181010
-% 1010121012FFFF1012FFFF181818181818FFFF1818FFFF1818FFFF161818
-% FF1012FF18181A181A181818181810101010101010101010081010101818
-% 18181818101816FFFF1218FFFF101810181818FFFF1818FFFF101218FF18
-% 18FF181810101010121012101210121618181818181818181818181A1818
-% 1818181618181210121618181A181A18181800FF18181818181818181712
-% 16181818181818181A181818181118121012101010101010080E10101818
-% 181818181210121018101810121812101818181817181218181816FF1818
-% 18FFFF181810FFFF1810181012FFFF1818FFFF181818FF1818FF18181818
-% 18181818171216181818181818181A181818181118121012FFFF1010FFFF
-% 080EFF101818FFFF1818FFFF1210FFFF181012FF1210FF18181817181218
-% 181816181818181818181810121018101810121018FFFFFFFF18181818FF
-% FF1818FFFF1818FFFF1817FFFF181818FF1818FF1A181818181118121012
-% 101010101010080E101018181818181812101210181018FFFF1812FFFF18
-% 18FFFF1812FFFF181618FF1818FF18181810121018101810121018181818
-% 1818181818181818181818181818181817121618FFFF1818FFFF1A1818FF
-% 1811FF121012101010101010080E10101818181818181210121018101810
-% 12181210181818181718121818FFFF1818FFFF1818FFFF1012FFFF101810
-% FF1018FF1818181818181818181818181818181818181712161818181818
-% 18181A18181818FFFFFFFF12101010FFFF1008FFFF1018FFFF1818FFFF10
-% 1210FF1018FF121812101818181817181218181816181818181818181810
-% 12101810FFFF1210FFFF1818FF181818FFFF1818FFFF1818FFFF181817FF
-% 1618FF18181818181A181818181118121012101010101010080E10101818
-% 1818FF181210FFFF181018FFFF1812101818FFFF1718FFFF181816FF1818
-% FF1818181810121018101810121018181818181818181818181818181818
-% 18181818171216181818181818181A181800FF18181818181A1818181812
-% 181818181818181818181618181612161810121012101010101010101218
-% 161818181018181316131810121010121612181812161818181818FFFFFF
-% FF1818181718FFFFFFFF101210FFFFFFFF1818181818FFFF181818181818
-% 1A1818181812181818181818181818181618181612161810FFFFFFFF1010
-% 10FFFFFFFFFFFF181818FFFFFFFF1613181012FFFF121612181812161818
-% 18181810181218181818171818181210101210121218FFFF1818181818FF
-% FFFFFF1818181AFFFFFFFF1218181818FFFF181818181618181612161810
-% 1210121010101010101012181618181810181813161318FFFFFFFF121612
-% 18FFFFFFFF1818181810FFFF181818181718181812101012101212181818
-% 1818181818181818181818181A18181818121818FFFFFFFF1818181816FF
-% FF1612161810121012101010101010101218161818181018181316131810
-% 12101012161218181216181818FFFFFFFF12181818FFFFFFFF1812101012
-% FFFF121818181818181818181818181818181A1818181812181818181818
-% 1818181816181816FFFF1810121012FFFFFFFF10101012FFFFFFFF181018
-% 1813FFFF1810121010121612181812161818181818101812181818181718
-% 18181210FFFFFFFF121818FFFFFFFFFFFF181818FFFFFFFF1A18181818FF
-% FF1818181818181818181618181612161810121012101010101010101218
-% 1618FFFFFFFF1813161318FFFFFFFF121612FFFFFFFF1818181818FFFF12
-% 181818181718181812101012101212181818181818181818181818181818
-% 1A18181818121818181818181818181800FF18181A181818181818181718
-% 181818121818181818121210121012101216121012101210101010101012
-% 181613101216181812161210121010121618181018181818181816121618
-% 18181818181612161210101010121018181818181A18181818181A181818
-% 181818181718181818121818181818121210121012101216121012101210
-% 101010101012181613101216181812161210121010121618181018181818
-% 18181612161818181818181612161210101010121018181818181A181818
-% 18181A181818181818181718181818121818181818121210121012101216
-% 121012101210101010101012181613101216181812161210121010121618
-% 181018181818181816121618181818181816121612101010101210181818
-% 18181A18181818181A181818181818181718181818121818181818121210
-% 121012101216121012101210101010101012181613101216181812161210
-% 121010121618181018181818181816121618181818181816121612101010
-% 10121018181818181A18181818181A181818181818181718181818121818
-% 181818121210121012101216121012101210101010101012181613101216
-% 181812161210121010121618181018181818181816121618181818181816
-% 12161210101010121018181818181A18181818181A181818181818181718
-% 181818121818181818121210121012101216121012101210101010101012
-% 181613101216181812161210121010121618181018181818181816121618
-% 18181818181612161210101010121018181818181A18181818181A181818
-% 18181818171818181812181818181800FF1818181818181A181818181818
-% 181818161818161810101010101010121012181612101010100A10101210
-% 181810121818181018101010101010121810181018181618181818181018
-% 1818181612101810121010101010181612181818181A181818181818181A
-% 181818181818181818161818161810101010101010121012181612101010
-% 100A10101210181810121818181018101010101010121810181018181618
-% 1818181810181818181612101810121010101010181612181818181A1818
-% 18181818181A181818181818181818161818161810101010101010121012
-% 181612101010100A10101210181810121818181018101010101010121810
-% 181018181618181818181018181818161210181012101010101018161218
-% 1818181A181818181818181A181818181818181818161818161810101010
-% 101010121012181612101010100A10101210181810121818181018101010
-% 101010121810181018181618181818181018181818161210181012101010
-% 1010181612181818181A181818181818181A181818181818181818161818
-% 161810101010101010121012181612101010100A10101210181810121818
-% 181018101010101010121810181018181618181818181018181818161210
-% 1810121010101010181612181818181A181818181818181A181818181818
-% 181818161818161810101010101010121012181612101010100A10101210
-% 181810121818181018101010101010121810181018181618181818181018
-% 1818181612101810121010101010181612181818181A181818181818181A
-% 181818181818181818161818161800FF181818181A181818181818181818
-% 181818181818181818101012101010101018121810181010101012161818
-% 181818161817181818181810101010101218181012121818181812101210
-% 12101210121816121010101010101010101216181810181818181A181818
-% 181818181818181818181818181818101012101010101018121810181010
-% 101012161818181818161817181818181810101010101218181012121818
-% 181812101210121012101218161210101010101010101012161818101818
-% 18181A181818181818181818181818181818181818101012101010101018
-% 121810181010101012161818181818161817181818181810101010101218
-% 181012121818181812101210121012101218161210101010101010101012
-% 16181810181818181A181818181818181818181818181818181818101012
-% 101010101018121810181010101012161818181818161817181818181810
-% 101010101218181012121818181812101210121012101218161210101010
-% 10101010101216181810181818181A181818181818181818181818181818
-% 181818101012101010101018121810181010101012161818181818161817
-% 181818181810101010101218181012121818181812101210121012101218
-% 16121010101010101010101216181810181818181A181818181818181818
-% 181818181818181818101012101010101018121810181010101012161818
-% 181818161817181818181810101010101218181012121818181812101210
-% 12101210121816121010101010101010101216181810181818181A181818
-% 1818181818181818181818181800FF1818181A1E181A1818181612101218
-% 181818181818101810121010101010101218171818101210101018181818
-% 181818181818171818161012101210121010101010101010121612161216
-% 1218101810121010101010101010101010121810181818181A1E181A1818
-% 181612101218181818181818101810121010101010101218171818101210
-% 101018181818181818181818171818161012101210121010101010101010
-% 121612161216121810181012101010101010101010101012181018181818
-% 1A1E181A1818181612101218181818181818101810121010101010101218
-% 171818101210101018181818181818181818171818161012101210121010
-% 101010101010121612161216121810181012101010101010101010101012
-% 1810181818181A1E181A1818181612101218181818181818101810121010
-% 101010101218171818101210101018181818181818181818171818161012
-% 101210121010101010101010121612161216121810181012101010101010
-% 1010101010121810181818181A1E181A1818181612101218181818181818
-% 101810121010101010101218171818101210101018181818181818181818
-% 171818161012101210121010101010101010121612161216121810181012
-% 1010101010101010101010121810181818181A1E181A1818181612101218
-% 181818181818101810121010101010101218171818101210101018181818
-% 181818181818171818161012101210121010101010101010121612161216
-% 1218101810121010101010101010101010121810181818181A1E181A1818
-% 18161210121818181818181800FF1818181A181A18181812101210101012
-% 161218101818181010101010101010121612181818181812181818181818
-% 181818181818181818181816121010121012101010101010121012101210
-% 101012101210101210100810100F1010101012181818181A181A18181812
-% 101210101012161218101818181010101010101010121612181818181812
-% 181818181818181818181818181818181816121010121012101010101010
-% 121012101210101012101210101210100810100F1010101012181818181A
-% 181A18181812101210101012161218101818181010101010101010121612
-% 181818181812181818181818181818181818181818181816121010121012
-% 101010101010121012101210101012101210101210100810100F10101010
-% 12181818181A181A18181812101210101012161218101818181010101010
-% 101010121612181818181812181818181818181818181818181818181816
-% 121010121012101010101010121012101210101012101210101210100810
-% 100F1010101012181818181A181A18181812101210101012161218101818
-% 181010101010101010121612181818181812181818181818181818181818
-% 181818181816121010121012101010101010121012101210101012101210
-% 101210100810100F1010101012181818181A181A18181812101210101012
-% 161218101818181010101010101010121612181818181812181818181818
-% 181818181818181818181816121010121012101010101010121012101210
-% 101012101210101210100810100F1010101012181818181A181A18181812
-% 101210101012161218101800FF1818181A18181A18181810101010121012
-% 101212161218101010100A1010101012181818181818181818181A181818
-% 181818161812181818181818101210101810101010101010121613181018
-% 1218161818181010100A100B101010101010181818181A18181A18181810
-% 101010121012101212161218101010100A10101010121818181818181818
-% 18181A181818181818161812181818181818101210101810101010101010
-% 1216131810181218161818181010100A100B101010101010181818181A18
-% 181A18181810101010121012101212161218101010100A10101010121818
-% 18181818181818181A181818181818161812181818181818101210101810
-% 1010101010101216131810181218161818181010100A100B101010101010
-% 181818181A18181A18181810101010121012101212161218101010100A10
-% 10101012181818181818181818181A181818181818161812181818181818
-% 1012101018101010101010101216131810181218161818181010100A100B
-% 101010101010181818181A18181A18181810101010121012101212161218
-% 101010100A1010101012181818181818181818181A181818181818161812
-% 181818181818101210101810101010101010121613181018121816181818
-% 1010100A100B101010101010181818181A18181A18181810101010121012
-% 101212161218101010100A1010101012181818181818181818181A181818
-% 181818161812181818181818101210101810101010101010121613181018
-% 1218161818181010100A100B101010101010181818181A18181A18181810
-% 1010101210121012121600FF1818181A181A181818181210121010121010
-% 10101210121818101010100810121618181A181A181818181A1818181818
-% 181012121816181212181018161010181818181810101012161216101316
-% 101818181818181010100E101010101010181818181A181A181818181210
-% 12101012101010101210121818101010100810121618181A181A18181818
-% 1A1818181818181012121816181212181018161010181818181810101012
-% 161216101316101818181818181010100E101010101010181818181A181A
-% 18181818121012101012101010101210121818101010100810121618181A
-% 181A181818181A1818181818181012121816181212181018161010181818
-% 181810101012161216101316101818181818181010100E10101010101018
-% 1818181A181A181818181210121010121010101012101218181010101008
-% 10121618181A181A181818181A1818181818181012121816181212181018
-% 161010181818181810101012161216101316101818181818181010100E10
-% 1010101010181818181A181A181818181210121010121010101012101218
-% 18101010100810121618181A181A181818181A1818181818181012121816
-% 181212181018161010181818181810101012161216101316101818181818
-% 181010100E101010101010181818181A181A181818181210121010121010
-% 10101210121818101010100810121618181A181A181818181A1818181818
-% 181012121816181212181018161010181818181810101012161216101316
-% 101818181818181010100E101010101010181818181A181A181818181210
-% 12101012101010101200FF10181818181818181818161216121810181018
-% 1012101018181610101010081012161818181818181A1818181818181810
-% 1210101012181010101210121818181818181A1818121818121818181218
-% 181818181818161210101010101010101210181818181818181818161216
-% 1218101810181012101018181610101010081012161818181818181A1818
-% 1818181818101210101012181010101210121818181818181A1818121818
-% 121818181218181818181818161210101010101010101210181818181818
-% 181818161216121810181018101210101818161010101008101216181818
-% 1818181A1818181818181810121010101218101010121012181818181818
-% 1A1818121818121818181218181818181818161210101010101010101210
-% 181818181818181818161216121810181018101210101818161010101008
-% 1012161818181818181A1818181818181810121010101218101010121012
-% 1818181818181A1818121818121818181218181818181818161210101010
-% 101010101210181818181818181818161216121810181018101210101818
-% 1610101010081012161818181818181A1818181818181810121010101218
-% 1010101210121818181818181A1818121818121818181218181818181818
-% 161210101010101010101210181818181818181818161216121810181018
-% 1012101018181610101010081012161818181818181A1818181818181810
-% 1210101012181010101210121818181818181A1818121818121818181218
-% 181818181818161210101010101010101210181818181818181818161216
-% 121810181018101200FF1012161818181818101210121018181818181312
-% 101010101212181810121012101818181818181818181A18181818101210
-% 10101012161010121012101210181818181818181810181618101818FF12
-% 101010121818181010101010101010101012161818181818101210121018
-% 18181818131210101010121218181012101210181818181818FF18181A18
-% 181818101210101010121610101210121012101818181818181818101816
-% 18101818161210101012181818101010101010101010FF12161818181818
-% 101210121018181818181312101010101212181810121012101818181818
-% 181818181A181818181012101010101216101012FF121012101818181818
-% 181818101816181018181612101010121818181010101010101010101012
-% 1618181818181012101210181818181813FF101010101212181810121012
-% 101818181818181818181A18181818101210101010121610101210121012
-% 1018181818181818181018161810FF181612101010121818181010101010
-% 101010101012161818181818101210121018181818181312101010101212
-% 181810121012101818181818FF1818181A18181818101210101010121610
-% 101210121012101818181818181818101816181018181612101010121818
-% 181010101010101010FF1012161818181818101210121018181818181312
-% 101010101212181810121012101818181818181818181A18181818101210
-% 10101012161010FF10121012101818181818181818101816181018181612
-% 101010121818181010101010101010101012161818181818101210121018
-% 1818181813121000FF101218161818101010101010101818181818181010
-% 101010101618181816101018181818181818181818181818181012101010
-% 101010121010101210101210181812161218181A18181218181810FF1010
-% 101010101218101010121010101010101218161818101010101010101818
-% 181818181010101010101618181816101018181818181818FF1818181818
-% 181012101010101010121010101210101210181812161218181A18181218
-% 181810181010101010101218101010121010101010FF1218161818101010
-% 101010101818181818181010101010101618181816101018181818181818
-% 18181818181818101210101010101012101010FF10101210181812161218
-% 181A18181218181810181010101010101218101010121010101010101218
-% 16181810101010101010181818181818FF10101010101618181816101018
-% 181818181818181818181818181012101010101010121010101210101210
-% 181812161218181A1818121818FF10181010101010101218101010121010
-% 101010101218161818101010101010101818181818181010101010101618
-% 1818161010181818181818FF181818181818181012101010101010121010
-% 101210101210181812161218181A18181218181810181010101010101218
-% 1010101210101010FF101218161818101010101010101818181818181010
-% 101010101618181816101018181818181818181818181818181012101010
-% 101010121010FF1210101210181812161218181A18181218181810181010
-% 101010101218101010121010101010101218161818101010101010101818
-% 18181818101000FF10101012101012101010101012181818181818181010
-% 080A10101012181818181818181818181218181818171812181010101010
-% 101012181810101012161818161816181618171A181818101218FF181812
-% 101010101018121610101210101010101012101012101010101012181818
-% 181818181010080A101010121818181818181818181812FF181818171812
-% 181010101010101012181810101012161818161816181618171A18181810
-% 1218181818121010101010181216101012101010FF101012101012101010
-% 101012181818181818181010080A10101012181818181818181818181218
-% 181818171812181010101010101012181810FF1012161818161816181618
-% 171A18181810121818181812101010101018121610101210101010101012
-% 101012101010101012181818181818FF1010080A10101012181818181818
-% 181818181218181818171812181010101010101012181810101012161818
-% 161816181618171A18181810FF1818181812101010101018121610101210
-% 101010101012101012101010101012181818181818181010080A10101012
-% 18181818181818181818FF18181818171812181010101010101012181810
-% 101012161818161816181618171A18181810121818181812101010101018
-% 12161010121010FF10101012101012101010101012181818181818181010
-% 080A10101012181818181818181818181218181818171812181010101010
-% 1010121818FF101012161818161816181618171A18181810121818181812
-% 101010101018121610101210101010101012101012101010101012181818
-% 181818181000FF1210121018101810101010101012161818181A18181010
-% 101010101010101018181818181818161818181818101810121010101010
-% 12181818181612101210181818181818181818181818181618FF18181710
-% 101210121612101210101818101210121018101810101010101012161818
-% 181A1818101010101010101010101818181818181816FF18181818101810
-% 121010101010121818181816121012101818181818181818181818181816
-% 18181818171010121012161210121010181810FF10121018101810101010
-% 101012161818181A18181010101010101010101018181818181818161818
-% 1818181018101210101010101218181818FF121012101818181818181818
-% 181818181816181818181710101210121612101210101818101210121018
-% 101810101010101012161818181AFF181010101010101010101018181818
-% 181818161818181818101810121010101010121818181816121012101818
-% 1818181818181818181818FF181818181710101210121612101210101818
-% 101210121018101810101010101012161818181A18181010101010101010
-% 101018181818181818FF1818181818101810121010101010121818181816
-% 121012101818181818181818181818181816181818181710101210121612
-% 101210101818FF1210121018101810101010101012161818181A18181010
-% 101010101010101018181818181818161818181818101810121010101010
-% 12181818FF16121012101818181818181818181818181816181818181710
-% 101210121612101210101818101210121018101810101010101012161818
-% 181A181800FF181818181818181810121210121012181818181818181010
-% 101010101010101012161818181818181718121612101210101210121818
-% 181818181818101210181818181818181818181818181811FF1218181818
-% 161210181018101818181818181818181818181810121210121012181818
-% 181818181010101010101010101012161818181818FF1718121612101210
-% 101210121818181818181818101210181818181818181818181818181811
-% 181218181818161210181018101818181818FF1818181818181810121210
-% 121012181818181818181010101010101010101012161818181818181718
-% 12161210121010121012181818181818FF18101210181818181818181818
-% 181818181811181218181818161210181018101818181818181818181818
-% 18181012121012101218181818FF18181010101010101010101012161818
-% 181818181718121612101210101210121818181818181818101210181818
-% 18181818181818181818FF11181218181818161210181018101818181818
-% 181818181818181810121210121012181818181818181010101010101010
-% 1010121618181818FF181718121612101210101210121818181818181818
-% 101210181818181818181818181818181811181218181818161210181018
-% 1018181818FF181818181818181810121210121012181818181818181010
-% 101010101010101012161818181818181718121612101210101210121818
-% 181818FF1818101210181818181818181818181818181811181218181818
-% 161210181018101818181818181818181818181810121210121012181818
-% 18181800FF1A181818181818181818101010101012181818181818101810
-% 121010101010101210181218181818181612181012101010101010181818
-% 18181A1818101010121012161216121012101818181818FF101210181818
-% 1012101210121818181A181A181818181818181818101010101012181818
-% 1818181018101210101010101012101812181818FF181612181012101010
-% 10101018181818181A181810101012101216121612101210181818181810
-% 1012101818181012101210121818181A18FF181818181818181818101010
-% 101012181818181818101810121010101010101210181218181818181612
-% 18101210101010101018181818181AFF1810101012101216121612101210
-% 1818181818101012101818181012101210121818181A181A181818181818
-% 181818101010101012181818FF1818101810121010101010101210181218
-% 18181818161218101210101010101018181818181A181810101012101216
-% 121612101210181818FF18101012101818181012101210121818181A181A
-% 181818181818181818101010101012181818181818101810121010101010
-% 10121018121818FF1818161218101210101010101018181818181A181810
-% 101012101216121612101210181818181810101210181818101210121012
-% 1818181AFF1A181818181818181818101010101012181818181818101810
-% 121010101010101210181218181818181612181012101010101010181818
-% 1818FF181810101012101216121612101210181818181810101210181818
-% 1012101210121818181A181A181818181818181818101010101012181818
-% 181800FF1818181818181818181818121010101210121018101812101216
-% 181018121610101210181718181818181810181012101010121818181A18
-% 18181818181010101010101010101010101216181810FF10101018121210
-% 101810121018181818181818181818181818181818121010101210121018
-% 10181210121618101812161010121018171818FF18181810181012101010
-% 121818181A18181818181810101010101010101010101012161818101210
-% 10101812121010181012101818181818FF18181818181818181818121010
-% 101210121018101812101216181018121610101210181718181818181810
-% 181012101010121818181A181818FF181810101010101010101010101012
-% 161818101210101018121210101810121018181818181818181818181818
-% 1818181210101012101210FF101812101216181018121610101210181718
-% 181818181810181012101010121818181A18181818181810101010101010
-% 1010101010121618FF101210101018121210101810121018181818181818
-% 181818181818181818121010101210121018101812101216181018121610
-% 101210181718FF1818181810181012101010121818181A18181818181810
-% 101010101010101010101012161818101210101018121210101810121018
-% 181818FF1818181818181818181818121010101210121018101812101216
-% 181018121610101210181718181818181810181012101010121818181A18
-% 18FF18181810101010101010101010101012161818101210101018121210
-% 101810121018181818181818181818181818181818121010101210121018
-% 1000FF1A1818181818181818181818181210101010101012101018101218
-% 1818181A181012101818181818181818181817181012101216181818181A
-% 181818121010101010101010101010101012181618FF1012101210101010
-% 1210181018161818181A1818181818181818181818181210101010101012
-% 1010181012181818181A1810121018181818FF1818181818171810121012
-% 16181818181A181818121010101010101010101010101012181618181012
-% 101210101010121018101816181818FF1818181818181818181818181210
-% 1010101010121010181012181818181A1810121018181818181818181818
-% 17181012101216181818181A18FF18121010101010101010101010101012
-% 1816181810121012101010101210181018161818181A1818181818181818
-% 18181818121010101010FF121010181012181818181A1810121018181818
-% 18181818181817181012101216181818181A181818121010101010101010
-% 10101010101218FF181810121012101010101210181018161818181A1818
-% 1818181818181818181812101010101010121010181012181818181A1810
-% 1210181818FF18181818181817181012101216181818181A181818121010
-% 101010101010101010101012181618181012101210101010121018101816
-% 1818FF1A1818181818181818181818181210101010101012101018101218
-% 1818181A181012101818181818181818181817181012101216181818181A
-% FF1818121010101010101010101010101012181618181012101210101010
-% 1210181018161818181A1818181818181818181818181210101010101012
-% 00FF18181818181012101817181818181810121010121010121012161818
-% 18181818181810181818181818181818181818181816181818181A181818
-% 1816181818101010101010101010101010101218FF181818181612161216
-% 121012101218181818181818181012101817181818181810121010121010
-% 1210121618181818181818181018181818FF181818181818181818161818
-% 18181A181818181618181810101010101010101010101010121818181818
-% 1816121612161210121012181818FF181818181012101817181818181810
-% 121010121010121012161818181818181818101818181818181818181818
-% 18181816181818181A181818FF1618181810101010101010101010101010
-% 121818181818181612161216121012101218181818181818181012101817
-% 181818181810121010FF1010121012161818181818181818101818181818
-% 18181818181818181816181818181A181818181618181810101010101010
-% 101010101010FF1818181818181612161216121012101218181818181818
-% 181012101817181818181810121010121010121012161818181818181818
-% 10181818FF1818181818181818181816181818181A181818181618181810
-% 101010101010101010101010121818181818181612161216121012101218
-% 18FF18181818181012101817181818181810121010121010121012161818
-% 18181818181810181818181818181818181818181816181818181A1818FF
-% 181618181810101010101010101010101010121818181818181612161216
-% 121012101218181818181818181012101817181818181810121010121000
-% FF1818111210101010121818181818181818181210101210101210121810
-% 121618181818181818181A1818181818181818181818181818181A181818
-% 18181818101210121010121010101010101818FF20191818181818181818
-% 101010121012181818111210101010121818181818181818181210101210
-% 10121012181012161818181818181818FF18181818181818181818181818
-% 18181A181818181818181012101210101210101010101018181820191818
-% 18181818181810101012101218FF18111210101010121818181818181818
-% 181210101210101210121810121618181818181818181A18181818181818
-% 18181818181818181A1818FF181818181012101210101210101010101018
-% 181820191818181818181818101010121012181818111210101010121818
-% 1818181818181812FF101210101210121810121618181818181818181A18
-% 18181818181818181818181818181A181818181818181012101210101210
-% 1010101010FF181820191818181818181818101010121012181818111210
-% 101010121818181818181818181210101210101210121810121618181818
-% 181818FF1A1818181818181818181818181818181A181818181818181012
-% 101210101210101010101018181820191818181818181818101010121012
-% FF1818111210101010121818181818181818181210101210101210121810
-% 121618181818181818181A1818181818181818181818181818181A18FF18
-% 181818181012101210101210101010101018181820191818181818181818
-% 1010101210121818181112101010101218181818181818181812101000FF
-% 181818161812181612101212181818181018101813181818181612161818
-% 181818181818181A181818181A1818181812101316181818181818181812
-% 101210121012161818181010101010101018FF1818181818181810181818
-% 181012101018181818161812181612101212181818181018101813181818
-% 181612161818181818181818181A18FF18181A1818181812101316181818
-% 181818181812101210121012161818181010101010101018181818181818
-% 181810181818181012101018FF1818161812181612101212181818181018
-% 101813181818181612161818181818181818181A181818181A1818181812
-% 10131618181818181818FF12101210121012161818181010101010101018
-% 181818181818181810181818181012101018181818161812181612101212
-% 18181818101810FF13181818181612161818181818181818181A18181818
-% 1A1818181812101316181818181818181812101210121012161818181010
-% 10101010FF18181818181818181810181818181012101018181818161812
-% 181612101212181818181018101813181818181612161818181818181818
-% 181AFF1818181A1818181812101316181818181818181812101210121012
-% 1618181810101010101010181818181818181818101818181810121010FF
-% 181818161812181612101212181818181018101813181818181612161818
-% 181818181818181A181818181A1818181812101316181818181818FF1812
-% 101210121012161818181010101010101018181818181818181810181818
-% 18101210101818181816181218161210121218181818101810181300FF10
-% 181018101818181818101618181818181818181816181212101210121818
-% 181818181818181818181818181A18181618181818181818181818181610
-% 1012101012101810181210121010101210FF101217181818101818181810
-% 121010101810181018101818181818101618181818181818181816181212
-% 1012101218181818181818181818FF181818181A18181618181818181818
-% 181818181610101210101210181018121012101010121012101217181818
-% 1018181818101210101018FF181018101818181818101618181818181818
-% 181816181212101210121818181818181818181818181818181A18181618
-% 181818181818181818FF1610101210101210181018121012101010121012
-% 101217181818101818181810121010101810181018101818181818101618
-% 181818181818FF1816181212101210121818181818181818181818181818
-% 181A18181618181818181818181818181610101210101210181018121012
-% 101010FF1012101217181818101818181810121010101810181018101818
-% 181818101618181818181818181816181212101210121818181818181818
-% 18FF18181818181A18181618181818181818181818181610101210101210
-% 18101812101210101012101210121718181810181818181012101010FF10
-% 181018101818181818101618181818181818181816181212101210121818
-% 181818181818181818181818181A181816181818181818181818FF181610
-% 101210101210181018121012101010121012101217181818101818181810
-% 121010101810181018101818181818101618181818181818181800FF1012
-% 121212101018181818181210121018121612161210101010101010101018
-% 181818181818181818181A18181818181818181818181818181818181813
-% 10101210121012181010101010101010FFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF18181813
-% 101012101210121810101010101010101012181812181618101210121010
-% 1010101210121212121010181818181812101210181216121600FF121010
-% 101010121810181818161010121010101210121612101010101010101012
-% 10161818181818181A1820181A1818181818181818181818181818181618
-% 101010101012101812121012101012101012101817121210181618101210
-% 101010121010101010121810181818161010121010101210121612101010
-% 10101010101210161818181818181A1820181A1818181818181818181818
-% 181818181618101010101012101812121012101012101012101817121210
-% 181618101210101010121010101010121810181818161010121010101210
-% 12161210101010101010101210161818181818181A1820181A1818181818
-% 181818181818181818181618101010101012101812121012101012101012
-% 101817121210181618101210101010121010101010121810181818161010
-% 12101010121012161210101010101010101210161818181818181A182018
-% 1A1818181818181818181818181818181618101010101012101812121012
-% 101012101012101817121210181618101210101010121010101010121810
-% 181818161010121010101210121612101010101010101012101618181818
-% 18181A1820181A1818181818181818181818181818181618101010101012
-% 101812121012101012101012101817121210181618101210101010121010
-% 101010121810181818161010121010101210121612101010101010101012
-% 10161818181818181A1820181A1818181818181818181818181818181618
-% 101010101012101812121012101012101012101817121210181618101210
-% 10101012101010101012181018181816101012101010121000FF10101012
-% 101210101218181810121012161218121612101010101008100E10101010
-% 12121618181818181A181818181818181818181818181818181818181810
-% 101010101012101817181612101010121618181818101618181816181618
-% 181010101012101210101218181810121012161218121612101010101008
-% 100E1010101012121618181818181A181818181818181818181818181818
-% 181818181810101010101012101817181612101010121618181818101618
-% 181816181618181010101012101210101218181810121012161218121612
-% 101010101008100E1010101012121618181818181A181818181818181818
-% 181818181818181818181810101010101012101817181612101010121618
-% 181818101618181816181618181010101012101210101218181810121012
-% 161218121612101010101008100E1010101012121618181818181A181818
-% 181818181818181818181818181818181810101010101012101817181612
-% 101010121618181818101618181816181618181010101012101210101218
-% 181810121012161218121612101010101008100E10101010121216181818
-% 18181A181818181818181818181818181818181818181810101010101012
-% 101817181612101010121618181818101618181816181618181010101012
-% 101210101218181810121012161218121612101010101008100E10101010
-% 12121618181818181A181818181818181818181818181818181818181810
-% 101010101012101817181612101010121618181818101618181816181618
-% 181010101012101210101218181810121012161218121600FF1012101010
-% 101010101012181818181012101010101210121010101010101010101010
-% 1012181818181A18181A1818181818171818121618181818181618181010
-% 101008101018181818181818181613181818181818121818181818181818
-% 101012101010101010101012181818181012101010101210121010101010
-% 1010101010101012181818181A18181A1818181818171818121618181818
-% 181618181010101008101018181818181818181613181818181818121818
-% 181818181818101012101010101010101012181818181012101010101210
-% 1210101010101010101010101012181818181A18181A1818181818171818
-% 121618181818181618181010101008101018181818181818181613181818
-% 181818121818181818181818101012101010101010101012181818181012
-% 1010101012101210101010101010101010101012181818181A18181A1818
-% 181818171818121618181818181618181010101008101018181818181818
-% 181613181818181818121818181818181818101012101010101010101012
-% 181818181012101010101210121010101010101010101010101218181818
-% 1A18181A1818181818171818121618181818181618181010101008101018
-% 181818181818181613181818181818121818181818181818101012101010
-% 101010101012181818181012101010101210121010101010101010101010
-% 1012181818181A18181A1818181818171818121618181818181618181010
-% 101008101018181818181818181613181818181818121818181818181818
-% 1010121010101010101010121818181810121010101000FF121010121012
-% 101210121010121612161216121813181718101210101010101010101010
-% 101816181818181A18181818181812101210121812171818181218101010
-% 08101010101818181A18181A181818181A18181818181818181818181810
-% 121010121012101210121010121612161216121813181718101210101010
-% 101010101010101816181818181A18181818181812101210121812171818
-% 18121810101008101010101818181A18181A181818181A18181818181818
-% 181818181810121010121012101210121010121612161216121813181718
-% 101210101010101010101010101816181818181A18181818181812101210
-% 12181217181818121810101008101010101818181A18181A181818181A18
-% 181818181818181818181810121010121012101210121010121612161216
-% 121813181718101210101010101010101010101816181818181A18181818
-% 18181210121012181217181818121810101008101010101818181A18181A
-% 181818181A18181818181818181818181810121010121012101210121010
-% 121612161216121813181718101210101010101010101010101816181818
-% 181A18181818181812101210121812171818181218101010081010101018
-% 18181A18181A181818181A18181818181818181818181810121010121012
-% 101210121010121612161216121813181718101210101010101010101010
-% 101816181818181A18181818181812101210121812171818181218101010
-% 08101010101818181A18181A181818181A18181818181818181818181810
-% 12101012101210121012101012161216121612181300FF10101210101210
-% 1812101210101210181818181816181818181610101010100A0E10101212
-% 181218181818181818181818101012101010121618121612181610101008
-% 0A0000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000008
-% 0A1010121818181820181818181818181818181812101210181216181010
-% 101210101210181210121010121018181818181600FF1218101818181818
-% 1A1818181810101818161216121012101218181818121010101010101010
-% 101818181818181818101018121816121612101210121010121818101010
-% FF2121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121001010
-% 1010101816181A181A181A18181A181A1816121010121012101210181218
-% 1018181818181A18181818101018181612161200FF101012101818181818
-% 181A18181218181818181812101810101218181010101010101010101210
-% AF16181818181612101210181018181818101810121012101216121010FF
-% 7D0000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000002100101010
-% 101018181818181A18181A181A1818181812101210121012101812101012
-% 101818181818181A1818121818181818181200FF10121010121012181818
-% 1818181818181818181817181310101010101210101010101010101012AF
-% 10121212101210101012101218181818181810121010101010121818FF7D
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 007F7F7F0000000000000000000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000000000000000000FF
-% FFFF00000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000007F7F7F000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000FFFFFF000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000210018181813
-% 16181818181A181818181818181818181010101010101012101010121010
-% 121012181818181818181818181818181700FF1810101210101818181818
-% 18181818181818181818181610101210101010101010101010121010AF10
-% 121010121010101010101216181818181818101010101010101018FF7D00
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000000000000007F7F7F
-% 1313137F7F7F000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000FFFFFFFF5353
-% 53FFFFFF0000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 00000000000000000000000000000000007F7F7F1313137F7F7F00000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 0000000000000000000000000000FFFFFF535353FFFFFF00000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000021001018181612
-% 181818181818181818181818181810101010101010121010181810101210
-% 1018181818181818181818181818181800FF181818101612181018181818
-% 181818181818181818181818181010121018181010101210101012AF1010
-% 10121010121010101010121818181818181012101010100A1010FF7D0000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000000007F7F7F131313
-% 7F7F1313137F7F0000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000FFFF53FF535353FFFF
-% 535353FFFF00000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 00000000000000000000000000007F7F7F1313137F7F1313137F7F000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 0000000000000000000000FFFFFF535353FFFF535353FFFF000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000002100101010121818
-% 1818181818181817181818181210121010C5C5C5C5181818181818101612
-% 18101818181818181818181818181800FF1A181812121210181012121018
-% 1818181818181812161818181012101818181010181018181818AF121012
-% 10101216101010101012181818181818101210101010100810FF7D000000
-% 00000000000000000000000000000000AFAFAFAFAFAF0000000000000000
-% 000000FFFFFFFF0000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000007F13137F13137F13
-% 13131313137F7F7F00000000000000000000000000000000000000000000
-% 00000000000000000000000000000000000000FF535353FF5353FF535353
-% 5353FFFFFF00000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 00000000000000000000007F7F13137F13137F13131313137F7F7F000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000FF5353FF5353FF535353535353FFFFFF0000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000210008101010101818
-% 171818181818181818181612101010C5C51012C5C518181A181812121210
-% 181012121018181818181818181200FF1818121010101012101010121012
-% 1818181718181618121810121210121218181818181818181AAF18181010
-% 181818101210101010101818181818161217121010101010FF7D00000000
-% 0000000000000000000000000000000000AFAF0000000000000000000000
-% 00FFFF0000FFFF0000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000007F7F7F137F1313137F1313
-% 13137F7F1313137F7F000000000000000000000000000000000000000000
-% 00000000000000000000000000000000FFFFFF5353FF535353FF535353FF
-% FF535353FFFF000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 00000000000000007F7F137F137F1313137F1313137F7F1313137F7F0000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000FFFFFF53FF535353FF53535353FFFF535353FFFF00000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000021001010101010101218
-% 1818181818181118131810101010C5C51218C5C5181A1818121010101012
-% 1010101210121818181718181600FF181810101010101210101010101216
-% 181818181012101210101010101010101818181818181818181818181818
-% 18181810101010AFAFAFAFAFAFAFAFAFAFAFAFAF181210FF7D0000000000
-% 0000003A3A3A3A3A3A3A3A3A3A3A3A3AAFAF3A3A3A3A3A3A3A3A3A3A3A3A
-% FFFF3A3AFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F137F13137F13137F13131313
-% 7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53FF535353FF5353FF535353FF5353
-% 5353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A7F13137F13137F13137F1313137F131313131313137F3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3AFF53FF5353FF5353FF53535353FF53535353535353FF3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A000000000000210012101010C5C5C5C5C5
-% C5C5C5C5C5C5C5C51012101010C5C51618C5C51A18181810101010101210
-% 10101010121618181818101200FF1818181010080810101010100B0E0A10
-% 101618181818181810181316121612161210121618181818181818161218
-% 101818181818161010101012101010121010AF121818FF7D000000000000
-% 00003A3A3AAFAFAFAFAFAF3A3A3A3AAFAF3A3A3A3A3A3A3A3A3A3A3A3AFF
-% FF3A3AFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F137F13137F13137F131313137F
-% 13131313137F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3AFF53FF535353FF5353FF535353FF535353
-% 5353FFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A7F13137F13137F13137F1313137F13131313137F7F7F3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3AFF53FF5353FF5353FF53535353FF5353535353FFFFFF3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A000000000000210018181618C51010181618
-% 181A18181813101018101810C5C51818C5C5181818181810100808101010
-% 10100B0E0A10101618181800FF1818181612101010101010101010101010
-% 12181818181816101810161217121810121012AF1818181818AF18101810
-% 1818181818181818101210101210101010AF161818FF7D00000000000000
-% 003A3A3A3A3A3A3A3A3A3A3A3A3AAFAF3A3A3A3A3A3A3A3A3A3A3A3AFFFF
-% 3A3AFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F13137F1313137F137F1313137F1313
-% 13137F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3AFFFF5353FF53535353FF53FF5353FF53535353FF
-% FF535353FFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A7F7F1313137F1313137F137F13137F131313137F7F1313137F7F3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% FFFF5353FF535353FF53FF535353FF53535353FFFF535353FFFF3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A000000000000210018181818C5181818181818
-% 1818181818101210121816C5C51818C5C51A181818181612101010101010
-% 1010101010101218181800FF181618181818181012101010101010101010
-% 121618181818121812181218121012101210AF1018181816AF1810181210
-% 12101818181818121010121012101210AF121818FF7D0000000000000000
-% 3A3A3A3A3A3A3A3A3A3A3A3A3AAFAF3A3A3A3A3A3A3A3A3A3A3A3AFFFF3A
-% 3AFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F137F1313137F13137F13137F13137F131313
-% 7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3AFF53FF535353FF535353FF5353FF53FF535353FF5353
-% 5353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 7F137F131313137F13137F13137F137F1313137F131313131313137F3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53
-% FF535353FF5353FF5353FF5353FF535353FF53535353535353FF3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A000000000000210018181818C518181818181818
-% 18181818181316181012C5C51818C5C51818181618181818181012101010
-% 10101010101012161800FF1812121618181812161210101010100A0F1010
-% 12181818161817181618161810121010AFAFAFAFAFAFAFAF161218101010
-% 181818181818121612181018101810AF101216FF7D00000000000000003A
-% 3A9D3A3A9D3A3A9D3A3AAFAFAFAF9D3A3A3A3A3A3A3A3A3A3A3AFFFF3A3A
-% FFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A7F137F1313137F1313137F7F7F13137F1313137F
-% 131313131313137F3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3AFF53FF535353FF53535353FFFFFF53FF535353FF535353
-% 53535353FF3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A7F
-% 137F131313137F1313137F7F7F137F1313137F131313131313137F3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3AFF53FF
-% 535353FF535353FFFFFF5353FF535353FF53535353535353FF3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A000000000000210012161818C518181A1818181A18
-% 18181818181818181816C5C5C5C518181818121216181818121612101010
-% 10100A0F1010121800FF1810101012101216121810121010121010101010
-% 121618181818181818181810101010AFAFAFAFAFAFAFAF12181018101818
-% 1818181818161218101810181210AF101212FF7D0000000000000000FF3A
-% 9D3A3A9D3A3A9D3A3A3A3AAFAF9D3A3A3A3A3A3A3A3A3A3A3A3AFFFFFFFF
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A7F1313137F1313137F7F1313137F7F7F137F137F1313
-% 131313137F7F7F7F3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3AFF535353FF535353FFFF535353FFFFFFFFFF53FF5353535353
-% 53FFFFFFFF3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F1313
-% 137F131313137F7F1313137F7F7F7F137F131313131313137F7F7F3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3AFF535353FF
-% 535353FFFF535353FFFFFF53FF53FF535353535353FFFFFFFF3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3AFF3A3A3A3AFF0000000000210012121818C518181818181818181A
-% 181818181818181818181818181818181810101012101216121810121010
-% 1210101010101200FF181612101010101210121612101216101010101210
-% 121818181818181818181612101010101210121012AF1216121818181818
-% 18161210121012101210121010AF101010FF7D0000000000000000FF3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A9D3A3A3A9D3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A7F7F1313137F13131313137F7F7F3A3A3A7F7F137F131313
-% 137F7F1313137F7F3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3AFFFF535353FF5353535353FFFFFF3A3A3A3AFF53FF53535353FFFF
-% 535353FFFF3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A
-% 3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F131313
-% 7F1313131313137F7F7F3A3A3A7F137F13131313137F7F1313137F7F3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFFFF535353FF53
-% 53535353FFFFFF3A3A3AFFFF53FF53535353FFFF535353FFFF3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3AFF3A3A3A3A3A00FF00000000210010101218C518181818181818181818
-% 181A18181818181818181818181818181612101010101210121612101216
-% 10101010121000FF18181816101010101012101210181216121010101012
-% 1618181818181818181218101010101010101210AF101810181818181818
-% 181210101210121012101210AF100F10FF7D0000000000000000FF3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A9D
-% 3A3A3A9D7F137F131313137F7F1313137F7F3A3A3A3A3A3A7F7F1313137F
-% 131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3AFF53FF53535353FFFF535353FFFF3A9D3A3A3A3AFFFF535353FF535353
-% 53535353FF3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F137F13131313
-% 7F7F1313137F7F9D3A3A3A3A3A7F7F131313137F131313131313137F3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3AFF5353FF53535353FFFF
-% 535353FFFF3A3A3A3A3A3AFFFF535353FF53535353535353FF3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% FF3A3AFF3A3A00FF0000000021000F101010C5101818181818181A18181A
-% 181A18181818181818181818181818181816101010101012101210181216
-% 121010101000FF1818181818121010101010101818181810101010101012
-% 181818181818181818181012101010121010101012101818101818181818
-% 1816121010101210101010AF100A10FF7D0000000000000000FF3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A9D3A
-% 3A3A9D7F13137F13131313137F7F7F3A3A3A3A3A3A3A3A9D3A7F13137F13
-% 1313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% FF5353FF5353535353FFFFFF3A3A3A9D3A3A3A3A3A3AFF5353FF53535353
-% 535353FF3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13137F13131313
-% 137F7F7F3A3A9D3A3A3A3A3A3A3A7F1313137F131313131313137F3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3AFF535353FF5353535353FF
-% FFFF3A3A3A3A3A3A3A3A3A3AFF5353FF53535353535353FF3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3AFF
-% 3A3AFF3A3A00FF0000000021000A101010C510121018181818181A181A18
-% 201818181818181818181818181818181818121010101010101818181810
-% 1010101000FF181818181010101010101218181618181818181818181818
-% 1A1818181810101816181818181216101210121018101210101018181810
-% 12101012101010121010AF100A08FF7D0000000000000000FF3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A7F1313137F131313131313137F3A3A3A3A3A3A3A3A3A3A7F137F131313
-% 1313131313137F3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3AFF53
-% 5353FF53535353535353FF3A3A3A3A3A3A3A3A3A3AFF53FF535353535353
-% 535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313137F1313131313
-% 13137F3A3A3A3A9D3A3A3A3A3A7F13137F1313131313131313137F3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353FF53535353535353
-% FF3A3A3A3A3A3A3A3A3A3AFF53FF535353535353535353FF3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF
-% FFFFFFFFFFFF0000000021000A081010C510101012161818181818181A18
-% 181818101012101810181618181818181010101010101218181618181818
-% 18181800FF16181818101012081010101012181818181818181818181A18
-% 1A1818161212181818181818161210121010121216181010121010101212
-% 161218101210101012AF101010FF7D0000000000000000FF3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 7F131313137F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A7F7F13131313
-% 13137F7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF5353
-% 5353FFFF535353FFFF3A3A3A3A3A3A3A3A3A3A3A3AFFFF53535353535353
-% FFFFFF3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A9D3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313137F7F1313137F
-% 7F3A3A3A3A3A3A3A3A3A3A3A9D7F7F7F1313131313137F7F7F7F3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3AFF5353535353FFFF535353FFFF3A
-% 9D3A3A3A3A3A3A3A3A3A3AFFFF535353535353FFFFFFFF3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF
-% 3AFFFFFF0000000000210010101010C5101010101218181818181A181818
-% 181810121012101210121216181818101012081010101012181818181818
-% 181800FF121018121612100E0A081010101818181A18181A181818181818
-% 181812101018181818181818181010181318161818121010101010101018
-% 1816181810181216AF101010FF7D00000000000000003A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F
-% 1313131313137F7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313137F
-% 7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF535353
-% 535353FFFFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF5353535353FFFF53
-% 5353FFFF3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A9D3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313131313137F7F7F7F3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F131313137F7F1313137F7F3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A9D3A3A3AFFFF53535353535353FFFFFF3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3AFF53535353FFFF535353FFFF3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A000000000000210010101010C5100E1010121018181818181A181818
-% 18101216121018101210121018121612100E0A081010101818181A18181A
-% 1800FF101210181818181010100A1010181818181818181818181A181818
-% 181010121012101818181810181218161818181816181010101010121818
-% 18181618121618AF121010FF7D00000000000000003A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313137F
-% 131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13137F1313
-% 13131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF5353FF535353
-% 53535353FF3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3AFF535353FF53535353
-% 535353FF3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A7F13137F131313131313137F3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13137F131313131313137F3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3AFF5353FF53535353535353FF9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3AFF5353FF53535353535353FF3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A000000000000210010101010C510101010101212101818181818181818
-% 181810181112101610101210181818181010100A10101818181818181818
-% 00FF1010101012101818181010101218181818181818181818181A181818
-% 101210101010121012101018101818181818181818181818181010181218
-% 101212101218AF101810FF7D0000000000FF00003A3AFF3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313137F13
-% 1313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13137F131313
-% 131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF5353FF53535353
-% 535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF535353FF5353535353
-% 5353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13137F131313131313137F3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F13137F131313131313137F3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3AFF5353FF53535353535353FF3A3A3A3A3A3A3A
-% 9D3A3A9D3A9D3A3A9D3AFF5353FF53535353535353FF3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3AFFFFFFFF
-% FF0000000000210018101210C51010101010101012181818181818181018
-% 101812181018121010101010121018181810101012181818181818181800
-% FF1012101010101218181810121618181818181818181818181818181012
-% 1010101010101012101212101810181818181818181A1818181216121612
-% 1010101012AF181012FF7D00000000FF0000003A3A3AFF3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13131313137F7F
-% 1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313131313
-% 131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353FFFF535353
-% FFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFFFF53535353535353
-% 5353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F131313137F7F1313137F7F3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313131313131313137F3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3AFF53535353FFFF535353FFFF3A3A3A3A3A3A3A3A9D
-% 3A3A9D3A9D3A3A9D3A3AFFFF535353535353535353FF3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3AFFFFFFFFFFFF
-% FF00000000210010121010C5101010101012101012121818161210101212
-% 1612161818181210121010101012181818101216181818181818181800FF
-% 1810121010100E1816121810181618161818161818181818181818121012
-% 101010101218181812101012121612181618181818181818181818181810
-% 18121010AF101216FF7D00000000FF0000FF3A3A3AFF3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F
-% 7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313
-% 1313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF535353535353FFFFFFFF
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3AFF5353535353535353
-% 53FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F1313131313137F7F7F7F3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3AFF535353535353FFFFFFFF3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF3AFF3A3A00FF
-% 00000000210012161210C510101010101012101210121012101010101012
-% 1818181818181810121010100E181612181018161816181816181800FF18
-% 1810100A100A101010101812121218181818181818181818181810101010
-% 101216181818181810121010121612181812101010181818181818181818
-% 18180AAF101216FF7D00000000FF0000FF3A3A3AFF3A3A3A3A9D3A9D3A3A
-% 9D3A3A9D3A3A3A9D9D3A9D3A9D3A9D3A3A9D9D9D9D9D3A9D9D3A9D9D3A9D
-% 9D3A9D9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D7F131313131313131313
-% 7F9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D7F1313131313137F
-% 7F7F7F3A9D9D3A9D9D3A9D3A9D3A3A9D3A9DFF535353535353535353FF3A
-% 9D3A9D3A3A9D3A9D3A3A3A3A3A9D3A3A3A3A3A3AFF535353535353FFFFFF
-% FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313137F7F7F7F3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3AFF535353535353FFFFFFFF3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3AFF3A3AFF3A3A00FF00
-% 000000210012161210C51010101010101010101010121010101010101210
-% 18181A181A181810100A100A101010101812121218181818181800FF1818
-% 18101010100B101012101818181818181818181010181216121012101010
-% 101218181818181A18181216121818121018181818181818181612181618
-% 1818AF101210FF7D00000000FFFFFFFFFFFFFFFF3A3A3A3A9D3A9D3A3A9D
-% 3A3A9D3A3A3A9D9D3A9D3A9D3A9D3A3A9D9D9D9D9D3A9D9D3A9D9D3A9D9D
-% 3A9D9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D7F7F7F131313131313137F9D
-% 9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D9D7F1313137F7F1313
-% 137F7F9D9D3A9D9D3A9D3A9D3A3A9D3AFFFFFF53535353535353FF9D3A9D
-% 3A9D3A3A9D3A9D3A3A3A3A3A9D3A3A3A3A3A3A3AFF535353FFFF535353FF
-% FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A7F7F7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F1313137F7F1313137F7F3A3A3A3A3A3A3A
-% 3A3A3A3A3AFFFFFF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3AFF535353FFFF535353FFFF3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3AFF3A3AFFFFFFFFFF0000
-% 0000210012101818C5101216121818181810101210101210101010101218
-% 18181818181818101010100B1010121018181818181818181800FF181818
-% 101210101010101012101210181818181818181211181012101012101010
-% 101818181818181812101210181810121012181018181818181210121210
-% 18AF181012FF7D0000000000FFFF00FFFFFF3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13137F131313131313137F3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A9D3A3A7F13137F1313131313
-% 13137F3A9D3A3A9D9D3A9D3A3A9DFF5353FF53535353535353FF3A9D9D3A
-% 9D9D9D9D3A9D3A9D3A9D9D9D3A9D9D9D9D9D3AFF5353FF53535353535353
-% FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D
-% 9D3A9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D7F13137F131313131313137F9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D7F13137F131313131313137F9D9D9D9D9D9D9D
-% 9D9D9DFF5353FF53535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9DFF5353FF53535353535353FF9D9D9D3A3A3A3A9D3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF3A3A3AFFFFFF00000000
-% 00210010121612C518181818181818181218161812101010101010101012
-% 18181818181810121010101010101210121018181818181800FF16181216
-% 121012101010121010101018181818181818181812161216121012101218
-% 181818181A18181010101010101010101010121012101210101010101018
-% AF121012FF7D00000000000000003A3A3A3A9D3A3A3A3A3A9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D7F1313137F7F1313137F7F9D3A9D9D
-% 9D9D3A9D9D3A9D3A9D3A9D3A9D3A9D9D3A9D3A3A9D7F7F7F131313131313
-% 137F9D3A9D9D3A3A9D3A9D3A3AFF535353FFFF535353FFFF3A3A3A9D3A9D
-% 3A3A3A3A9D3A3A9D3A3A3A9D3A3A3A3A3A3A3AFFFFFF53535353535353FF
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A7F1313137F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F7F7F131313131313137F3A3A3A3A3A3A3A3A
-% 3A3AFF535353FFFF535353FFFF3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3AFFFFFF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A000000000000
-% 210010121018C51316181818181818181818181618181818101010101010
-% 181816181216121012101010121010101018181818181800FF1812161218
-% 10101210121010101010101218181818181818101812101210101217181A
-% 18181A1818181810101010101010101010101010101818121810101012AF
-% 121010FF7D00000000000000003A3A3A3A9D3A3A3A3A3A9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D7F1313131313137F7F7F7F9D9D3A9D9D9D
-% 9D3A9D9D3A9D3A9D3A9D3A9D3A9D9D3A9D3A3A9D3A7F1313131313131313
-% 137F3A9D9D3A3A9D3A9D3AFF535353535353FFFFFFFF3A3A3A3A9D3A9D3A
-% 3A3A3A9D3A3A9D3A3A3A9D3A3A3A3A3A3A3A3AFF535353535353535353FF
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F1313131313137F7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A
-% FF535353535353FFFFFFFF3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A00000000000021
-% 0010101216C518181818181818181A181818121818181818121010101012
-% 1818121612181010121012101010101010121818181800FF101018111818
-% 181818181818181818181818181818181818181811181010121818181818
-% 1A181A18181816101010101010101010101010181718181816121010AF10
-% 1210FF7D000000000000FFFFFFFFFF3A3A3A3A3A9D3A3A9D9D9D3A9D9D9D
-% 9D3A9D9D9D9D9D9D9D9D9D3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D9D9D9D9D
-% 9D3A9D9D9D9D3A9D9D3A9D9D9D3A9D9D9D3A9D9D9D9D3A9D9D9D9D9D9D3A
-% 9D9D3A9D9D9D9D9D9D9D3A9D7F1313131313131313137F9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D7F131313131313131313
-% 7F9D9D3A9D9D9D3A9D3AFF535353535353535353FF9D9D9D9D3A9D3A3A9D
-% 9D9D9D9D9D3A9D9D9D3A9D9D9D9D9D9D9D9DFF535353535353535353FF9D
-% 9D9D9D9D3A9D9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D
-% 9D3A9D9D3A9D9D9D9D9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D3A9D9D9D3A9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D
-% 9D3A9D9D9D9D3A9D9D3A9D3A9D3A3A9D3A9D3A9D3A9D3A9D3A3A9D3A3A9D
-% 3A9D7F1313131313131313137F3A9D3A9D3A3A9D3A3A3A9D3A9D3A9D3A3A
-% 3A3A9D3A9D3A3A9D3A3A7F1313131313131313137F3A3A9D3A3A3A3A3AFF
-% 535353535353535353FF3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3AFF535353535353535353FF3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3AFFFFFFFFFFFF00000000002100
-% 12101210C516181818181818181818181010121018181818181818101012
-% 10101811181818181818181818181818181818181800FF12181018101818
-% 1018181818181A1818181818181A18181818161818131810181818181A18
-% 181818181818181012101010101010101010181818181818181810AF1618
-% 16FF7D0000000000FFFFFFFFFFFFFF3A3A3A3A9D3A9D9D9D3A9D9D3A9D9D
-% 9D9D3A9D9D9D9D9D3A3A3A9D9D9D9D9D9D9D9D3A3A3A9D9D3A9D9D9D3A9D
-% 9D3A9D9D9D9D9D3A9D9D3A3A9D9D9D3A9D3A9D9D3A9D9D3A9D9D3A9D9D9D
-% 9D3A9D9D9D9D3A3A9D9D9D7F1313131313131313137F9D9D3A9D3A3A9D9D
-% 9D9D9D9D3A9D3A9D9D9D3A3A3A9D3A3A9D3A3A7F1313131313131313137F
-% 9D9D9D9D3A9D9D9D3AFF535353535353535353FF9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9DFF535353535353535353FF9D9D
-% 9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A
-% 9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A
-% 9D7F1313131313131313137F3A9D9D9D3A3A9D9D9D9D9D9D3A9D3A9D9D3A
-% 9D9D9D9D3A9D9D9D3A7F1313131313131313137F9D9D9D9D3A9D9D9DFF53
-% 5353535353535353FF3A9D9D3A9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D3A9D
-% 9D9D9D9D9D9DFF535353535353535353FF3A9D3A9D9D9D9D9D9D9D9D9D9D
-% 3A9D9D9D9D9D9D9D9D3A3A3A3A3A3AFFFFFFFFFFFFFFFF00000000210018
-% 161216C5181218161818161818121012101012101818181A181810101012
-% 1810181018181018181818181A1818181818181A00FF1810121812161218
-% 101818181818181818181A18181818181818181810181018181818181818
-% 1818181818181018101210101010101010121210121818181810AF181818
-% FF7D00000000FFFF00FF3A3A3AFF3A3A3A3A9D3A9D9D9D3A9D9D3A9D9D9D
-% 9D3A9D9D9D9D9D3A3A3A9D9D9D9D9D9D9D9D3A3A3A9D9D3A9D9D9D3A9D9D
-% 3A9D9D9D9D9D3A9D9D3A3A9D9D9D3A9D3A9D9D3A9D9D3A9D9D3A9D9D9D9D
-% 3A9D9D9D9D3A3A9D9D9D3A7F131313131313137F9D9D9D3A9D3A3A9D9D9D
-% 9D9D9D3A9D3A9D9D9D3A3A3A9D3A3A9D3A3A3A7F131313131313137F3A9D
-% 9D9D9D3A9D9D9D3A9DFF53535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9DFF53535353535353FF9D9D9D9D
-% 9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D
-% 9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A9D
-% 9D7F131313131313137F3A3A9D9D9D3A3A9D9D9D9D9D9D3A9D3A9D9D3A9D
-% 9D9D9D3A9D9D9D3A3A7F131313131313137F9D9D9D9D9D3A9D9D9D9DFF53
-% 535353535353FF9D3A9D9D3A9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D3A9D9D
-% 9D9D9D9D9D9DFF53535353535353FF9D3A9D3A9D9D9D9D9D9D9D9D9D9D3A
-% 9D9D9D9D9D9D9D9D3A3A3A3A3A3AFF3A3A3A3A3A00FF0000000021001818
-% 1812C5101210181218181810101810181010121218181818181810121810
-% 121812161218101818181818181818181A181800FF171816121610121612
-% 10181818181818181A18181818181818181818181018181818181A181818
-% 10181218181012101810121012101010101010101012181812AF181818FF
-% 7D00000000FF0000FF3A3A3AFF3A3A3A3A9D3A9D9D9D9D3A9D9D9D3A9D9D
-% 9D3A9D3A3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D9D3A9D3A9D9D9D
-% 3A9D9D9D3A9D9D9D9D9D3A3A9D9D3A9D3A9D9D9D9D9D9D9D9D3A9D3A9D9D
-% 9D9D9D9D9D9D3A9D9D9D7F131313131313137F3A9D9D9D9D3A9D9D3A9D3A
-% 9D3A9D9D9D9D3A9D9D3A9D3A3A9D9D3A9D3A7F1313131313137F7F7F3A9D
-% 9D9D9D9D9D3A3AFFFF53535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF5353535353FFFFFF9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D7F
-% 7F131313131313137F9D3A3A3A9D9D3A3A9D9D3A9D3A9D9D9D3A3A3A9D9D
-% 9D3A9D3A3A9D9D9D7F13131313137F7F7F9D9D9D9D3A9D9D9D9D9DFF5353
-% 5353535353FF3A9D3A9D9D3A9D9D3A3A9D9D3A9D3A9D3A9D9D9D9D9D9D9D
-% 3A9D9D9D9DFF5353535353FFFFFF3A9D3A3A3A3A3A9D9D3A9D9D9D9D3A9D
-% 9D3A3A9D3A9D9D3A9D3A3A3A3AFF3A3A3A3A3A00FF000000002100181818
-% 16C510121012101216121818181818181010101012101818161818171816
-% 12161012161210181818181818181A18181800FF18181818121010101010
-% 121618181818181818181A1818181A181818181818181818181818181818
-% 181010101012101818181010101010101010101010181810AF181018FF7D
-% 00000000FF0000FFFFFFFFFF3A3A3A3A9D3A9D9D3A3A9D9D3A9D3A9D3A9D
-% 9D9D3A3A9D9D3A3A9D3A3A3A3A3A3A3A9D3A9D3A3A3A9D9D3A9D9D3A9D9D
-% 3A9D3A9D9D9D9D9D3A9D3A9D3A9D3A9D3A9D3A9D9D3A9D3A9D9D3A9D9D3A
-% 9D9D9D9D3A9D9D7F7F137F7F1313137F7F3A3A9D9D9D3A9D3A9D9D9D9D3A
-% 3A9D9D9D3A9D9D3A9D9D3A9D3A3A3A3A3A3A7F7F13137F7F1313137F7F9D
-% 9D9D9D3AFFFF5353FFFF535353FFFF3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9DFFFF53FFFF535353FFFF9D9D9D9D
-% 3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A3A7F7F1313
-% 7F7F1313137F7F9D3A3A9D9D3A9D9D3A3A9D9D9D3A9D9D9D9D3A9D9D9D9D
-% 3A9D9D9D9D9D3A9D7F7F137F7F1313137F7F9D9D3A9D9D9DFFFF53FFFF53
-% 5353FFFF3A9D9D9D3A9D3A9D9D9D9D9D3A9D9D9D9D3A9D3A9D9D9D3A3A9D
-% 9D9D9D3A3AFFFF53FFFF535353FFFF3A9D3A3A3A3A9D9D9D3A9D9D9D9D3A
-% 9D9D3A9D9D9D3A9D3A3A3A9DFFFFFFFFFFFFFFFF00000000210010181318
-% C51010101012101210101210181818181818121012101018181818181818
-% 121010101010121618181818181818181A00FF1012181010101010101010
-% 1012181818181818181818181A181A181818181818181818181818181818
-% 1012101010101812101810121010101010121012181818AF181618FF7D00
-% 000000FF000000FFFFFF3A3A3A3A3A9D3A9D9D3A3A9D9D3A9D3A9D3A9D9D
-% 9D3A3A9D9D3A3A9D3A3A3A3A3A3A3A9D3A9D3A3A3A9D9D3A9D9D3A9D9D3A
-% 9D3A9D9D9D9D9D3A9D3A9D3A9D3A9D3A9D3A9D9D3A9D3A9D9D3A9D9D3A9D
-% 9D9D9D3A9D7F13131313137F7F7F9D9D3A3A9D9D9D3A9D3A9D9D9D9D3A3A
-% 9D9D9D3A9D9D3A9D9D3A9D3A3A3A3A3A3A9D9D7F7F131313131313137F9D
-% 9D9DFF535353535353FFFFFF3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF53535353535353FF9D9D9D3A
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A7F1313131313
-% 137F7F7F9D3A9D3A3A9D9D3A9D9D3A3A9D9D9D3A9D9D9D9D3A9D9D9D9D3A
-% 9D9D9D9D9D3A9D3A9D7F131313131313137F9D3A9D9DFF5353535353FFFF
-% FF9D3A3A9D9D9D3A9D3A9D9D9D9D9D3A9D9D9D9D3A9D3A9D9D9D3A3A9D9D
-% 9D9D3A3A3A3AFF53535353535353FF9D3A3A3A3A9D9D9D3A9D9D9D9D3A9D
-% 9D3A9D9D9D3A9D3A3A3A9D3AFFFFFFFFFFFF0000000000210016181618C5
-% 121012101012101012101210121818181818101012121218121012181010
-% 1010101010101012181818181818181800FF121010101010081010101010
-% 1010101218161818181A181A181818181817181818181818181818181818
-% 10101010101010121012101018101010101012181818AF181818FF7D0000
-% 0000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A3A
-% 9D3A3A3A3A3A3A9D9D9D9D9D3A3A3A3A3A3A3A9D3A9D9D9D3A9D9D9D9D3A
-% 9D9D9D9D3A9D9D9D3A9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A
-% 9D9D9D9D7F131313131313137F3A9D9D3A9D3A9D9D3A9D9D3A9D3A9D3A9D
-% 9D9D9D9D9D3A3A3A9D9D9D3A9D3A9D3A9D9D3A7F131313131313137F9D9D
-% 9DFF53535353535353FF3A9D9D9D3A3A3A3A3A9D9D9D3A3A3A3A3A3A9D3A
-% 9D3A3A3A3A3A3A9D9D3A3A3A3A9D3A3AFF53535353535353FF3A9D9D9D9D
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D9D9D9D9D9D9D3A3A3A3A3A9D
-% 3A3A3A3A3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A9D9D3A3A3A3A3A9D3A3A3A9D3A9D9D7F131313131313
-% 137F9D9D3A9D3A9D9D3A9D3A3A3A9D9D3A9D9D9D9D3A9D9D3A9D9D3A9D3A
-% 9D9D9D9D3A9D9D9D7F131313131313137F9D3A9D9DFF53535353535353FF
-% 9D9D9D9D9D9D3A3A9D3A9D3A9D3A9D9D9D9D3A9D9D9D9D3A9D9D9D3A9D3A
-% 3A3A9D3A9DFF53535353535353FF3A9D3A3A3A3A3A9D9D9D3A9D9D9D9D3A
-% 9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A000000000000210018181818C518
-% 181810181010121010121010101210181818181810101010121010101010
-% 08101010101010101012181618181800FF101012101010100A0F0A101010
-% 10101010121618181820181A181818181818121618181818181818181812
-% 101010101010101010181818181712101816181818AF181818FF7D000000
-% 00000000003A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D9D3A9D9D9D9D3A9D3A
-% 3A9D3A3A9D9D9D9D9D9D9D9D9D9D3A3A3A3A9D9D3A9D9D9D9D9D9D3A9D3A
-% 9D9D9D9D9D9D9D3A3A9D9D3A9D9D9D9D9D9D9D3A9D9D3A3A9D9D9D9D9D3A
-% 9D9D7F1313131313131313137F9D3A9D9D9D9D9D9D3A3A9D3A9D3A9D9D9D
-% 9D9D3A9D9D3A3A9D9D9D3A3A9D3A9D9D9D7F1313131313131313137F9DFF
-% 535353535353535353FF9D9D9D3A3A3A3A3A9D9D9D9D3A3A3A9D3A9D9D3A
-% 3A3A3A3A3A3A9D9D9D3A3A3A3A3AFF535353535353535353FF9D9D9D3A9D
-% 3A3A3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A9D9D9D9D3A3A3A3A3A3A9D9D3A
-% 3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A9D3A3A3A9D9D3A3A3A3A3A3A3A3A3A9D9D3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D9D9D3A9D9D7F1313131313131313
-% 137F9D3A3A9D3A3A3A9D9D3A3A3A9D9D3A9D9D9D9D9D3A3A9D9D9D3A9D3A
-% 9D9D9D9D9D3A7F1313131313131313137F3A9DFF535353535353535353FF
-% 3A9D9D9D3A9D9D3A9D9D3A3A9D9D9D3A9D9D3A9D9D9D3A9D3A9D3A9D3A3A
-% 9D3A3AFF535353535353535353FF3A9D3A9D3A3A3A9D9D9D9D9D9D9D9D3A
-% 9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210018181818C51818
-% 181812101210101210121012101012101816181612101010101210101010
-% 0A0F0A101010101010101216181800FF10121010101010100A1010080A10
-% 081010101818181A18181818181818101810181217181818181818181010
-% 1010101010101012181818181818181818181818AF181818FF7D00000000
-% 00FFFFFFFFFFFF3A3A3A3A3A3A3A9D3A3A9D3A9D9D3A9D9D9D9D3A9D3A3A
-% 9D3A3A9D9D9D9D9D9D9D9D9D9D3A3A3A3A9D9D3A9D9D9D9D9D9D3A9D3A9D
-% 9D9D9D9D9D9D3A3A9D9D3A9D9D9D9D9D9D9D3A9D9D3A3A9D9D9D9D9D3A9D
-% 9D7F1313131313131313137F9D3A9D9D9D9D9D9D3A3A9D3A9D3A9D9D9D9D
-% 9D3A9D9D3A3A9D9D9D3A3A9D3A9D9D9D7F1313131313131313137F9DFF53
-% 5353535353535353FF9D9D9D3A3A3A3A3A9D9D9D9D3A3A3A9D3A9D9D3A3A
-% 3A3A3A3A3A9D9D9D3A3A3A3A3AFF535353535353535353FF9D9D9D3A9D3A
-% 3A3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A9D9D9D9D3A3A3A3A3A3A9D9D3A3A
-% 3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A9D3A3A3A9D9D3A3A3A3A3A3A3A3A3A9D9D3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D9D9D3A9D9D7F131313131313131313
-% 7F9D3A3A9D3A3A3A9D9D3A3A3A9D9D3A9D9D9D9D9D3A3A9D9D9D3A9D3A9D
-% 9D9D9D9D3A7F1313131313131313137F3A9DFF535353535353535353FF3A
-% 9D9D9D3A9D9D3A9D9D3A3A9D9D9D3A9D9D3A9D9D9D3A9D3A9D3A9D3A3A9D
-% 3A3AFF535353535353535353FF3A9D3A9D3A3A3A9D9D9D9D9D9D9D9D3A9D
-% 9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210018181816C5181818
-% 181612161012101010101010101010121818181818181012101010101010
-% 0A1010080A100810101018181800FF181216121818181010101010081008
-% 10101012181818181A181818181818101210101818121818121612161210
-% 10100A10101012181818181818181818181A18AF181818FF7D00000000FF
-% FFFFFFFFFFFFFF3A3A3A3A9D3A9D9D9D9D3A9D9D9D9D9D3A3A9D3A9D3A3A
-% 9D9D9D3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A9D3A9D9D3A9D9D9D3A9D9D3A
-% 9D9D9D3A9D3A9D3A3A9D9D9D9D9D3A9D3A9D9D9D3A9D9D9D9D3A9D9D3A9D
-% 7F1313131313131313137F9D9D9D3A9D9D3A9D9D3A9D9D3A9D3A9D3A9D9D
-% 9D3A9D3A9D3A9D3A9D9D3A3A3A9D9D7F1313131313131313137F9DFF5353
-% 53535353535353FF9D9D9D9D3A3A9D3A3A3A9D9D3A3A3A9D9D9D3A3A3A3A
-% 3A3A3A3A9D9D9D3A3A3A3A3AFF535353535353535353FF9D9D9D9D3A9D9D
-% 3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A9D9D9D3A3A
-% 3A3A3A3A3A9D9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A9D9D3A3A3A3A3A3A
-% 9D9D9D9D3A3A3A3A9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A9D9D9D3A3A3A3A
-% 9D3A3A3A9D3A3A9D3A3A3A3A3A9D9D9D3A9D3A7F1313131313131313137F
-% 9D3A9D3A9D9D9D9D3A3A3A9D9D9D3A9D9D9D9D9D9D3A9D3A3A9D9D9D9D3A
-% 9D9D3A9D7F1313131313131313137F9D9DFF535353535353535353FF9D9D
-% 9D9D9D9D3A9D3A9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D3A
-% 9DFF535353535353535353FF9D9D3A9D3A9D3A3A9D9D9D9D9D3A9D9D3A9D
-% 9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210018181812C518181818
-% 181210121018101812121612101010181818181818181216121818181010
-% 10101008100810101012181800FF18161210181618101210101010080A10
-% 101010101818181818181817121012161218101210101010121018121012
-% 101010101012181818181A18181818181818AF181818FF7D00000000FF00
-% 00003A3A3AFF3A3A3A3A9D3A9D3A9D9D9D3A9D9D9D3A3A9D9D3A3A3A9D9D
-% 9D3A3A3A3A3A3A3A3A3A3A9D9D3A3A3A9D3A9D3A9D9D9D9D3A3A9D9D9D9D
-% 9D9D9D3A9D3A9D3A9D3A9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D9D9D3A
-% 7F131313131313137F3A9D3A9D9D9D9D3A9D9D3A9D3A9D3A9D9D9D3A9D9D
-% 9D9D9D9D9D9D3A9D9D3A9D3A9D9D3A7F131313131313137F9D9D9DFF5353
-% 5353535353FF3A9D9D9D9D3A3A3A3A3A3A9D9D9D3A9D9D9D3A3A3A3A3A3A
-% 3A3A3A9D9D9D3A3A3A3A3A3AFF53535353535353FF3A9D9D3A9D3A9D3A3A
-% 9D3A3A3A3A3A9D9D9D3A3A9D3A3A9D9D9D3A3A3A3A9D3A3A9D9D9D3A3A3A
-% 3A3A3A3A3A9D9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A9D9D3A3A3A3A3A3A3A
-% 9D9D9D3A3A3A3A9D9D3A9D9D9D3A3A3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A
-% 3A3A9D9D3A3A3A3A3A3A3A9D9D9D9D3A9D3A9D7F131313131313137F9D9D
-% 3A3A9D9D9D9D9D9D3A9D9D9D3A9D9D9D3A9D9D9D3A3A9D9D9D3A9D9D9D3A
-% 9D9D3A9D7F131313131313137F9D3A9D9DFF53535353535353FF9D9D9D9D
-% 9D9D9D9D3A9D3A3A9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D3A3A9D3A3A3A9D
-% 9DFF53535353535353FF3A3A9D9D3A3A3A9D3A3A9D9D9D9D9D3A3A9D9D9D
-% 3A9D3A3A3A3A3A3A3A3A3A3A000000000000210018181010C51818171818
-% 101810181018181818181818181210121218161818161210181618101210
-% 101010080A10101010101800FF1012101012181818181012101010101010
-% 101218181818181818181812101218121012101210121010181216121010
-% 10101010101818181A181A18181A181A18AF181810FF7D00000000FF0000
-% 003A3A3AFF3A3A3A3A9D3A9D3A9D9D9D3A9D9D9D3A3A9D9D3A3A3A9D9D9D
-% 3A3A3A3A3A3A3A3A3A3A9D9D3A3A3A9D3A9D3A9D9D9D9D3A3A9D9D9D9D9D
-% 9D9D3A9D3A9D3A9D3A9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D9D9D3A7F
-% 131313131313137F3A9D3A9D9D9D9D3A9D9D3A9D3A9D3A9D9D9D3A9D9D9D
-% 9D9D9D9D9D3A9D9D3A9D3A9D9D3A7F13131313137F7F7F9D9D9DFF535353
-% 53535353FF3A9D9D9D9D3A3A3A3A3A3A9D9D9D3A9D9D9D3A3A3A3A3A3A3A
-% 3A3A9D9D9D3A3A3A3A3A3AFF5353535353FFFFFF3A9D9D3A9D3A9D3A3A9D
-% 3A3A3A3A3A9D9D9D3A3A9D3A3A9D9D9D3A3A3A3A9D3A3A9D9D9D3A3A3A3A
-% 3A3A3A3A9D9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A9D9D3A3A3A3A3A3A3A9D
-% 9D9D3A3A3A3A9D9D3A9D9D9D3A3A3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A3A
-% 3A9D9D3A3A3A3A3A3A3A9D9D9D9D3A9D3A9D7F131313131313137F9D9D3A
-% 3A9D9D9D9D9D9D3A9D9D9D3A9D9D9D3A9D9D9D3A3A9D9D9D3A9D9D9D3A9D
-% 9D3A9D7F13131313137F7F7F9D3A9D9DFF53535353535353FF9D9D9D9D9D
-% 9D9D9D3A9D3A3A9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D3A3A9D3A3A3A9D9D
-% FF535353535353FFFFFF3A9D9D3A3A3A9D3A3A9D9D9D9D9D3A3A9D9D9D3A
-% 9D3A3A3A3A3A3A3A3A3A3A000000000000210018101210C5C5C5C5C5C5C5
-% 18181818181818181A181818181210101012181012101012181818181012
-% 1010101010101012181800FF181012101210101012101210100A08101010
-% 101012101218101810121010101010181818181010101010101210121810
-% 181012121818181A1818181818181818AF181010FF7D00000000FFFFFFFF
-% FFFFFFFF3A3A3A3A9D3A9D9D9D3A9D3A3A9D9D3A9D3A3A3A9D9D9D3A3A3A
-% 9D9D3A9D3A9D9D3A3A3A3A9D9D3A3A3A9D3A3A9D9D9D9D9D9D9D9D9D9D9D
-% 3A9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D9D3A9D9D9D9D3A9D9D9D7F7F137F
-% 7F1313137F7F9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A9D9D9D9D9D3A9D
-% 9D9D3A9D9D9D9D9D3A9D3A9D9D9D7F7F137F7F1313137FFFFF53FFFF5353
-% 53FFFF3A3A9D9D9D3A3A3A3A3A3A3A9D9D9D3A9D9D3A3A3A9D3A3A3A3A3A
-% 3A9D9D3A3A3A3A3A3A3A3AFFFF53FFFF535353FFFF9D9D9D3A9D3A9D3A3A
-% 9D3A3A3A9D9D9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A
-% 3A3A3A9D9D3A3A3A9D3A3A3A9D9D9D3A9D3A3A9D9D3A3A3A3A3A3A9D9D9D
-% 9D9D9D3A3A9D9D3A9D9D9D3A3A3A3A9D3A3A3A9D9D9D9D3A3A3A3A3A3A9D
-% 3A9D3A3A3A3A3A3A3A9D9D9D9D3A9D7F7F137F7F1313137F7F9D9D9D3A9D
-% 3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A9D3A9D3A9D9D9D9D9D
-% 9D3A9D7F7F137F7F1313137F7FFFFF53FFFF535353FFFF9D3A9D9D9D9D9D
-% 9D9D3A9D3A3A9D3A9D9D9D9D9D9D3A9D9D3A9D9D3A3A9D3A9D9D9D3A3A3A
-% FFFF5353FFFF535353FFFF3A9D9D9D3A9D3A3A9D9D3A9D3A9D9D9D9D3A9D
-% 3A3A3A3A3A3A3A3A3A3A000000000000210010101010C510101010121010
-% 101012101818181818181818181818181018181012101210101012101210
-% 100A0810101010101200FF18181810101010121012161010101010101010
-% 101010121012121010101010101018181818181810181010101012101816
-% 121816181818181818181818181818AF181010FF7D0000000000FFFFFFFF
-% FFFF3A3A3A3A3A9D3A9D9D9D9D9D3A3A9D3A9D3A3A9D3A9D9D3A3A3A9D9D
-% 9D9D3A9D3A9D9D9D3A3A3A9D9D3A3A3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D7F1313131313
-% 7F7F7F9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D7F1313131313FF5353535353FFFFFF
-% 3A3A3A3A9D9D9D9D3A3A3A3A3A3A9D9D9D3A9D9D3A3A3A3A3A3A3A3A3A3A
-% 9D9D9D3A3A9D3A3A3A3A3A9DFF53535353535353FF3A9D9D3A9D3A3A3A3A
-% 3A3A3A9D9D9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A
-% 3A9D9D9D3A3A3A3A3A3A3A9D9D9D9D3A3A3A9D9D3A3A3A3A3A3A9D9D3A9D
-% 9D3A9D3A9D9D3A3A9D9D3A3A3A3A3A3A3A3A9D9D9D3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A9D9D9D9D9D9D7F13131313137F7F7F9D9D9D9D3A3A3A9D
-% 9D9D3A9D3A3A9D9D3A9D9D9D9D9D3A9D9D3A3A3A3A9D9D3A9D3A9D9D9D3A
-% 3A9D3A9D7F131313131313FF5353535353FFFFFF3A9D9D9D9D9D9D9D9D9D
-% 9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A3A3A9D9D3A3A3A9D
-% 9DFFFF53535353535353FF9D9D3A3A3A9D3A3A9D9D9D9D3A9D9D9D3A9D3A
-% 3A3A3A3A3A3A3A3A3A000000000000210010101010C51010101012101210
-% 121018181718181618181818181818181818181810101010121012161010
-% 101010101010101000FF1818171818181810101210121010101010101010
-% 101010101010101010081010101218181818181818101010101010181212
-% 161818181A161818181816181818AF101210FF7D00000000000000003A3A
-% 3A3A3A3A3A3A9D3A9D9D9D9D9D3A3A9D3A9D3A3A9D3A9D9D3A3A3A9D9D9D
-% 9D3A9D3A9D9D9D3A3A3A9D9D3A3A3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D7F131313131313
-% 137F9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D3A9D3A9D9D9D9D7F1313131313FF53535353535353FF3A
-% 3A3A3A9D9D9D9D3A3A3A3A3A3A9D9D9D3A9D9D3A3A3A3A3A3A3A3A3A3A9D
-% 9D9D3A3A9D3A3A3A3A3A9DFF53535353535353FF3A9D9D3A9D3A3A3A3A3A
-% 3A3A9D9D9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A3A
-% 9D9D9D3A3A3A3A3A3A3A9D9D9D9D3A3A3A9D9D3A3A3A3A3A3A9D9D3A9D9D
-% 3A9D3A9D9D3A3A9D9D3A3A3A3A3A3A3A3A9D9D9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A9D9D9D9D9D9D7F131313131313137F9D9D9D9D3A3A3A9D9D
-% 9D3A9D3A3A9D9D3A9D9D9D9D9D3A9D9D3A3A3A3A9D9D3A9D3A9D9D9D3A3A
-% 9D3A9D7F131313131313FF53535353535353FF3A9D9D9D9D9D9D9D9D9D9D
-% 9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A3A3A9D9D3A3A3A9D9D
-% 9DFF53535353535353FF9D9D3A3A3A9D3A3A9D9D9D9D3A9D9D9D3A9D3A3A
-% 3A3A3A3A3A3A3A3A000000000000210012101010C5101210181818101810
-% 181018121818181818181818181818181818171818181810101210121010
-% 1010101010101000FF121818181818181012101810181816121818181210
-% 10101210101010100A081010181818181818181818121010101012101012
-% 12181818181816181818181816AF101010FF7D00000000000000003A3A3A
-% 3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D3A9D3A3A3A9D9D3A3A9D3A9D3A9D3A
-% 9D9D3A9D9D9D9D3A3A3A9D9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313131313
-% 137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A7F1313131313FF535353535353535353FF3A
-% 3A3A9D9D9D9D3A3A3A3A3A3A9D9D9D3A9D3A3A3A3A3A3A3A3A9D9D3A9D9D
-% 9D3A3A3A3A3A3A3A3AFF535353535353535353FF9D3A9D3A3A3A3A3A3A3A
-% 3A9D9D9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A9D9D3A9D9D3A3A9D3A3A3A3A3A3A3A9D9D9D9D3A9D
-% 3A3A3A3A9D3A9D9D3A3A3A3A3A3A3A9D9D9D9D3A9D3A3A3A3A3A3A9D9D3A
-% 3A3A3A3A3A3A9D9D9D9D7F1313131313131313137F9D3A3A3A9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D7F131313131313FF535353535353535353FF9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A3A9D9D9D3A3A3A9D3A9D9DFF
-% 535353535353535353FF9D9D9D3A3A9D3A9D9D3A9D9D9D3A9D3A9D3A3A3A
-% 3A3A9D3A3A3A3A000000000000210010101010C512161818181818181210
-% 121012101810181818181818181818121818181818181012101810181816
-% 12181818121000FF10121012101212101012121618181818181818181818
-% 101818131610101010101210181818181818181010101010101010101010
-% 121018181818181818181818AF121010FF7D00000000000000003A3A3A3A
-% 9D3A3A3A9D3A9D9D9D9D9D3A9D3A3A9D3A9D9D9D3A3A3A9D9D3A9D3A9D9D
-% 9D3A9D3A3A9D9D9D3A3A9D9D3A9D3A9D3A9D9D3A9D9D9D9D9D9D9D9D3A9D
-% 9D9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D3A9D9D7F131313131313131313
-% 7F3A9D3A9D9D3A3A9D9D9D9D3A9D9D9D3A9D9D3A9D9D9D9D9D3A9D9D9D9D
-% 9D3A9D9D3A9D3A9D9D3A9D7F1313131313FF535353535353535353FF3A3A
-% 3A9D9D9D9D3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D9D
-% 3A3A3A3A3A3A3A3AFF535353535353535353FF9D3A9D3A3A3A3A3A3A3A9D
-% 9D9D9D3A3A3A9D3A3A9D9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A3A3A9D
-% 9D3A3A3A3A3A3A3A9D9D9D9D3A9D9D3A9D3A3A3A3A3A3A9D9D9D9D9D9D9D
-% 9D9D9D3A9D3A3A3A3A9D3A3A3A3A9D9D3A9D9D9D3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A9D3A3A3A9D9D7F1313131313131313137F3A9D3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 7F131313131313FF535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A9D3A9D3A9D3A3A3A9D3A9D3A9DFF53
-% 5353535353535353FF3A3A9D9D9D3A3A3A9D3A3A9D9D9D9D3A3A3A3A3A3A
-% 3AFF3A3A3A3A00FF00000000210010101010C518181818181A1818181010
-% 101010121012101812161818181010121012101212101012121618181818
-% 181818181800FF1210101210101010181010121818181818181A181A1818
-% 181718181218181810101810181218181012101210101818101010101010
-% 1212181818181818181818AF101210FF7D00000000000000003A3A3A3A9D
-% 3A3A3A9D3A9D9D9D9D9D3A9D3A3A9D3A9D9D9D3A3A3A9D9D3A9D3A9D9D9D
-% 3A9D3A3A9D9D9D3A3A9D9D3A9D3A9D3A9D9D3A9D9D9D9D9D9D9D9D3A9D9D
-% 9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D3A9D9D7F1313131313131313137F
-% 3A9D3A9D9D3A3A9D9D9D9D3A9D9D9D3A9D9D3A9D9D9D9D9D3A9D9D9D9D9D
-% 3A9D9D3A9D3A9D9D3A9D7F1313131313FF535353535353535353FF3A3A3A
-% 9D9D9D9D3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D9D3A
-% 3A3A3A3A3A3A3AFF535353535353535353FF9D3A9D3A3A3A3A3A3A3A9D9D
-% 9D9D3A3A3A9D3A3A9D9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A3A3A9D9D
-% 3A3A3A3A3A3A3A9D9D9D9D3A9D9D3A9D3A3A3A3A3A3A9D9D9D9D9D9D9D9D
-% 9D9D3A9D3A3A3A3A9D3A3A3A3A9D9D3A9D9D9D3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A9D3A3A3A9D9D7F1313131313131313137F3A9D3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F
-% 131313131313FF535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A9D3A9D3A9D3A9D3A3A3A9D3A9D3A9DFF5353
-% 53535353535353FF3A3A9D9D9D3A3A3A9D3A3A9D9D9D9D3A3A3A3A3A3A3A
-% FF3A3A3A3A00FF00000000210012101010C51818181A1818181818121010
-% 101010121010101012101818101210101210101010181010121818181818
-% 181A181A00FF1818121010121012121012101018181618181A1818181818
-% 181818171818181612121012101010181810101212181018181010101210
-% 101818181A1818181818AF161210FF7D00000000000000003A3A3A3A3A3A
-% 3A3A9D3A9D9D3A9D9D9D9D3A9D3A3A3A9D3A3A9D9D9D3A3A9D9D3A9D9D3A
-% 9D3A9D9D9D3A3A3A9D9D3A9D3A3A9D9D3A9D9D3A3A9D3A9D9D3A9D3A3A3A
-% 3A3A9D9D3A3A3A3A9D3A3A3A9D3A9D9D3A9D3A7F131313131313137F3A9D
-% 9D9D9D3A9D3A9D9D3A9D3A9D9D3A9D3A9D3A9D3A3A9D3A9D3A3A9D9D3A9D
-% 9D9D3A9D3A9D3A9D3A3A7F1313131313FF53535353535353FF3A3A3A3A9D
-% 9D9D9D3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A9D9D9D9D3A9D9D9D3A3A
-% 3A3A3A3A3A3A9DFF53535353535353FF9D3A9D3A9D3A3A9D3A3A3A3A9D9D
-% 9D3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A3A3A9D9D3A
-% 3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D3A3A3A3A3A3A3A9D9D9D9D9D9D9D3A
-% 9D3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D3A3A3A3A3A3A3A9D9D3A3A3A
-% 3A3A3A3A9D9D9D9D7F131313131313137F9D3A9D9D3A9D9D3A9D9D9D9D9D
-% 3A9D9D3A9D3A9D9D9D9D9D9D3A9D9D9D3A9D9D9D9D3A9D9D9D9D9D3A9D7F
-% 131313131313FF53535353535353FF3A9D3A9D3A9D3A9D9D3A3A9D3A9D3A
-% 9D9D9D9D3A9D3A3A9D3A9D3A9D9D3A9D9D9D3A9D9D9D9D3A3A9D9DFF5353
-% 5353535353FF9D3A3A9D9D3A3A9D3A3A9D9D3A9D9D9D3A9D3A3A3A3AFFFF
-% FFFFFFFFFFFF00000000210012101212C518181818181A18181810100B0E
-% 10101010100E101010121818181812101012101212101210101818161818
-% 1A181800FF18181818121010181010101012181810101818181818121012
-% 101818181818181810101010101018181012101010181818181816121612
-% 181818AFAFAFAFAFAFAF181018FF7D00000000000000003A3A3A3A3A3A3A
-% 3A9D3A9D9D3A3A9D9D3A3A9D9D3A9D3A3A9D3A9D3A9D9D9D9D9D9D9D9D9D
-% 9D9D9D3A3A3A9D3A9D9D3A3A9D3A3A9D3A9D3A9D3A3A9D3A9D3A9D3A3A9D
-% 3A9D9D3A9D9D3A9D3A9D3A3A9D3A3A9D3A9D7F131313131313137F9D3A3A
-% 9D3A9D3A9D3A3A3A3A3A9D3A3A9D3A3A3A9D3A9D3A9D3A9D9D3A9D3A3A9D
-% 3A9D3A9D3A3A9D3A9D7F1313131313FF53535353535353FF3A3A3A3A9D9D
-% 9D3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A3A9D9D9D3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3AFF53535353535353FF3A3A9D9D3A3A3A3A3A3A3A3A9D9D3A
-% 3A3A3A3A9D9D9D9D3A9D3A3A3A3A3A9D9D9D3A3A3A3A3A3A9D9D9D3A3A3A
-% 3A3A3A3A3A3A9D9D9D9D9D9D9D3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D
-% 9D9D3A3A3A3A3A3A3A9D9D9D3A9D9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A9D9D9D3A7F131313131313137F3A3A9D3A3A9D3A9D3A3A9D3A9D3A
-% 9D3A9D9D9D3A9D3A9D9D3A9D3A9D3A9D3A9D3A3A9D3A3A3A3A3A9D9D7F13
-% 1313131313FF53535353535353FF9D3A3A9D9D9D9D3A9D9D9D9D9D3A3A9D
-% 3A9D3A9D3A9D9D3A9D3A3A9D3A3A3A9D3A3A3A9D9D3A9D9D9D9DFF535353
-% 53535353FF3A9D3A3A9D9D9D3A9D3A9D3A9D3A9D9D3A9D3A3A3A3AFFFFFF
-% FFFFFFFFFF00000000210010181316C5181818181A181A18181210101010
-% 1010100A100A101012161818181818121010181010101012181810101818
-% 181800FF1618181818181018181810121010101818161818181618101010
-% 18131618181A181818121010101810181210181813181818181818181818
-% 1818181818181818AF181012FF7D00000000000000003A3A3A3A3A3A3A3A
-% 9D3A9D9D3A3A9D9D3A3A9D9D3A9D3A3A9D3A9D3A9D9D9D9D9D9D9D9D9D9D
-% 9D9D3A3A3A9D3A9D9D3A3A9D3A3A9D3A9D3A9D3A3A9D3A9D3A9D3A3A9D3A
-% 9D9D3A9D9D3A9D3A9D3A3A9D3A3A9D3A9D7F7F7F1313137F7F9D9D3A3A9D
-% 3A9D3A9D3A3A3A3A3A9D3A3A9D3A3A3A9D3A9D3A9D3A9D9D3A9D3A3A9D3A
-% 9D3A9D3A3A9D3A9D3A7F7F131313FFFFFF535353FFFF3A3A3A3A3A9D9D9D
-% 3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A3A9D9D9D3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3AFFFF535353FFFFFF3A3A9D9D3A3A3A3A3A3A3A3A9D9D3A3A
-% 3A3A3A9D9D9D9D3A9D3A3A3A3A3A9D9D9D3A3A3A3A3A3A9D9D9D3A3A3A3A
-% 3A3A3A3A3A9D9D9D9D9D9D9D3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D9D
-% 9D3A3A3A3A3A3A3A9D9D9D3A9D9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A9D9D9D3A7F7F7F1313137F7F9D3A3A9D3A3A9D3A9D3A3A9D3A9D3A9D
-% 3A9D9D9D3A9D3A9D9D3A9D3A9D3A9D3A9D3A3A9D3A3A3A3A3A9D9D3A7F7F
-% 131313FFFFFFFF535353FFFF3A9D3A3A9D9D9D9D3A9D9D9D9D9D3A3A9D3A
-% 9D3A9D3A9D9D3A9D3A3A9D3A3A3A9D3A3A3A9D9D3A9D9D9D9D9DFFFF5353
-% 53FFFFFF3A9D3A3A9D9D9D3A9D3A9D3A9D3A9D9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A00FF00000000210010121618C518181A181A18181818181818181010
-% 0A1010101010101012181618181818181018181810121010101818161818
-% 1800FF121818181818181818171210101010121012181018121818181812
-% 161812161818181818101810121012161818101818181818181818181818
-% 1818181A181818AF181818FF7D00000000000000003A3A3A3A3A3A3A3A3A
-% 3A9D9D9D9D9D9D3A9D3A3A9D9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D3A9D3A9D9D3A9D3A9D3A9D3A9D9D3A3A9D9D9D3A3A9D9D3A9D9D3A
-% 9D3A9D9D3A9D9D9D3A9D9D9D3A3A7F7F1313137F7F7F9D9D9D3A9D3A9D9D
-% 9D3A3A9D9D3A9D3A9D3A3A9D9D3A3A9D9D3A9D3A9D9D3A9D3A3A9D9D3A9D
-% 3A3A9D3A9D3A9D3A9D9D7FFFFF535353FFFFFF9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3AFFFFFF535353FFFF9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D9D3A9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A3A3A9D3A3A
-% 9D3A3A3A3A3A3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D9D3A7F7F1313137F7F7F3A3A3A3A3A3A3A9D3A3A3A9D3A3A9D3A9D3A9D
-% 3A9D9D3A9D3A9D3A9D3A3A3A3A9D3A9D3A9D3A3A9D3A3A9D3A3A9D3A9D7F
-% FFFF535353FFFFFFFF3A9D3A9D3A9D3A9D3A9D9D3A9D9D9D3A9D3A3A9D3A
-% 3A9D3A9D9D3A9D3A3A9D3A9D9D3A3A9D9D3A9D9D9D9D9D9D9D9D9DFFFFFF
-% 535353FFFF9D3A3A9D3A9D9D3A9D9D9D9D9D9D3A9D3A3A9D3A3A3A3A3A3A
-% 3A00FF00000000210018181818C518181818181818181216181812101010
-% 121010101010101012121818181818181818171210101010121012181018
-% 00FF10121612181610181818121612101012101210121618181818181818
-% 12101810121618161818181018101210121018161818181818181A181A18
-% 181818181818AF181818FF7D00000000000000003A3A3A3A3A3A3A3A9D3A
-% 9D3A9D9D9D9D3A9D3A3A9D3A3A9D3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 9D3A9D3A3A3A9D9D3A9D3A9D3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A9D3A9D3A3A3AFF53535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9DFF53535353535353FF9D3A9D9D9D3A9D9D9D9D9D9D3A9D3A
-% 9D9D3A9D9D3A9D3A9D3A9D9D9D9D9D9D9D9D3A9D3A3A3A3A9D9D9D9D9D9D
-% 9D9D9D9D3A9D9D9D9D3A3A9D3A9D3A3A9D3A9D9D3A9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D7F131313131313137F3A9D3A3A3A9D9D3A3A3A9D9D3A3A3A3A3A3A9D3A
-% 9D3A9D9D3A9D3A9D3A9D9D3A3A3A9D9D3A3A9D9D3A9D9D9D9D3A9D9DFF53
-% 535353535353FF3A9D3A9D3A3A3A9D3A9D9D3A9D3A3A9D9D9D3A9D9D9D3A
-% 3A3A9D3A9D3A9D3A3A9D3A9D3A9D3A9D9D9D3A3A3A3A3A3A3A3AFF535353
-% 53535353FF3A3A9D9D9D3A9D3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 000000000000210018181818C51018181818181812101012161818121018
-% 101010101010101010121612181610181818121612101012101210121600
-% FF1010121012181218161810121012101010101010121216181818161810
-% 18101012101218181818161210181012101212101818181818181818181A
-% 18181A1E18AF181818FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D
-% 3A9D9D9D9D3A9D3A3A9D3A3A9D3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D
-% 3A9D3A3A3A9D9D3A9D3A9D3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A9D3A9D3A3A3AFF53535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9DFF53535353535353FF9D3A9D9D9D3A9D9D9D9D9D9D3A9D3A9D
-% 9D3A9D9D3A9D3A9D3A9D9D9D9D9D9D9D9D3A9D3A3A3A3A9D9D9D9D9D9D9D
-% 9D9D9D3A9D9D9D9D3A3A9D3A9D3A3A9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 7F131313131313137F3A9D3A3A3A9D9D3A3A3A9D9D3A3A3A3A3A3A9D3A9D
-% 3A9D9D3A9D3A9D3A9D9D3A3A3A9D9D3A3A9D9D3A9D9D9D9D3A9D9DFF5353
-% 5353535353FF3A9D3A9D3A3A3A9D3A9D9D3A9D3A3A9D9D9D3A9D9D9D3A3A
-% 3A9D3A9D3A9D3A3A9D3A9D3A9D3A9D9D9D3A3A3A3A3A3A3A3AFF53535353
-% 535353FF3A3A9D9D9D3A9D3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A00
-% 0000000000210018181818C5181818181818181810101210181216181810
-% 1210101210101010101210121812181618101210121010101010101200FF
-% 101010101012161218101812161210101012101210101210181218181818
-% 181810181810121210121810121010101010121012181818181818181818
-% 1A181A18AF181818FF7D0000000000FFFFFFFFFFFF3A3A3A3A3A9D3A9D9D
-% 9D3A9D9D9D3A9D3A9D3A9D9D9D9D3A9D9D3A3A3A3A3A3A3A3A9D3A9D9D3A
-% 9D9D9D3A3A9D3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A9D3A3AFF535353535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9DFF535353535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D
-% 3A9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D7F13
-% 13131313131313137F3A9D3A3A9D3A9D9D3A3A3A3A9D3A3A3A9D3A3A3A3A
-% 9D3A3A9D3A9D3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3AFF53535353
-% 5353535353FF3A3A3A9D3A3A3A9D9D3A9D3A9D9D3A3A3A9D3A3A3A3A9D3A
-% 9D3A3A3A9D3A3A3A9D9D3A9D9D9D9D3A9D9D3A3A3A9D3AFF535353535353
-% 535353FF3A9D9D3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A0000
-% 00000000210018181818C51818181A181818181010121012101210121810
-% 12101010121010101010101216121810181216121010101210121000FF10
-% 101012181818161818181018161810101010101012101210101218161818
-% 181818101210101018161210121010101010101210121612181818181A18
-% 201E1AAF1A1818FF7D00000000FFFFFFFFFFFFFFFF3A3A3A3A9D3A9D9D9D
-% 9D9D3A9D9D3A9D3A3A9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A9D9D3A9D9D9D
-% 3A9D3A3A9D9D9D3A9D9D3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A9D3A3A9D
-% 3A3A3A9D3A3A3A9D7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 9D9D3A3A9DFF535353535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9DFF535353535353535353FF3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D3A
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D
-% 9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D7F1313
-% 131313131313137F9D3A9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF5353535353
-% 53535353FF3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A9D3A9D3A9D9D3A3A9D9D3A3A9D9D3A3A3A3A3A3AFF53535353535353
-% 5353FF3A3A9D9D9D9D3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000
-% 000000210018181818C51818181818181818181812101010101018101818
-% 181812101010101012181818161818181018161810101010101000FF1810
-% 121018181818121810181818181810121012101010101012101012121018
-% 18101810101010181210101010101010101010101010101818181818181A
-% 181AAF181818FF7D00000000FF0000003A3A3AFF3A3A3A3A9D3A9D9D9D9D
-% 9D3A9D9D3A9D3A3A9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A9D9D3A9D9D9D3A
-% 9D3A3A9D9D9D3A9D9D3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A9D3A3A9D3A
-% 3A3A9D3A3A3A9D7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D
-% 9D3A3A9DFF535353535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9DFF535353535353535353FF3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D
-% 3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D7F131313
-% 1313131313137F9D3A9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF535353535353
-% 535353FF3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A
-% 3A9D3A9D3A9D9D3A3A9D9D3A3A9D9D3A3A3A3A3A3AFF5353535353535353
-% 53FF3A3A9D9D9D9D3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A00000000
-% 0000210018181816C5181818181818181818121010101010101012101818
-% 1818181818101210181818181218101818181818101210121000FF1A1818
-% 181618181816181818181618181818101010101012121012101010101218
-% 101210121010181016121010101010101010101010101018181818181818
-% 20AF1A1818FF7D00000000FF0000003A3A3AFF3A3A3A3A9D3A9D3A9D3A9D
-% 3A9D9D3A9D3A3A9D3A9D9D9D9D3A3A3A3A3A9D3A3A9D9D3A9D9D9D3A9D9D
-% 3A3A9D9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D7F131313131313137F9D3A9D9D3A9D3A9D3A3A3A3A3A9D
-% 9D3A3A3A9D3A3A3A3A3A9D3A3A9D3A3A9D3A3A3A9D3A9D3A3A3A9D3A3A3A
-% 9D9D3A9DFF53535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9DFF53535353535353FF9D3A9D3A3A3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A3A9D3A9D9D3A
-% 3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D7F131313
-% 131313137F3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF535353535353
-% 53FF3A9D3A3A3A9D3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A9D3A
-% 9D3A9D3A9D9D3A3A9D9D9D9D9D9D3A9D3A3A3A3A3AFF53535353535353FF
-% 9D3A3A9D9D3A3A3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A0000000000
-% 00210018181812C512101818181012161216101010101012101018181818
-% 1818181A181818161818181618181818161818181810101000FF18181818
-% 1A1818181810181018181816181216121018101010121010101010101012
-% 10121618181218181818181010101010101010101010121018181A202118
-% AF181818FF7D00000000FFFFFFFFFFFFFFFF3A3A3A3A3A3A9D9D3A9D3A3A
-% 9D9D3A9D3A9D9D9D9D3A9D9D9D3A3A3A3A3A3A3A3A9D9D3A9D9D3A9D3A9D
-% 3A9D9D9D3A9D3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A9D3A7F131313131313137F3A3A3A3A9D3A9D3A9D3A3A9D9D3A3A
-% 9D3A9D3A9D3A3A3A9D9D9D9D9D3A3A3A3A9D9D3A3A9D9D9D3A3A3A3A3A9D
-% 3A3A9DFF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% FF53535353535353FF9D3A3A9D3A3A3A3A9D3A3A3A3A9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A9D9D3A3A3A3A3A9D3A3A3A9D
-% 3A9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A9D3A3A9D3A3A3A3A7F13131313
-% 1313137F9D3A9D3A3A3A3A3A3A3A9D9D3A3A3A9D3A9D3A9D3A3A3A3A9D3A
-% 9D3A3A3A9D3A3A9D3A3A3A9D3A9D3A9D3A9D3A3A9D9DFF53535353535353
-% FF3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D3A3A3A3A9D3A3A3A3A9D
-% 3A9D3A3A3A3A9D9D3A3A9D9D9D3A3A3A3A3A3A9DFF53535353535353FF9D
-% 9D3A9D9D3A9D3A9D9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000
-% 210018181016C5101210101210181018181310100A08081010101216181A
-% 1818181818181A1818181810181018181816181216121000FF1818181818
-% 181A18101812121212181818181012101210101216181818181210121018
-% 1018121816121816181818181010101010101010101012181818201A18AF
-% 181212FF7D0000000000FFFFFFFFFFFF3A3A3A3A3A3A3A9D9D3A9D3A3A9D
-% 9D3A9D3A9D9D9D9D3A9D9D9D3A3A3A3A3A3A3A3A9D9D3A9D9D3A9D3A9D3A
-% 9D9D9D3A9D3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A9D3A9D7F7F1313137F7F9D3A3A3A3A9D3A9D3A9D3A3A9D9D3A3A9D
-% 3A9D3A9D3A3A3A9D9D9D9D9D3A3A3A3A9D9D3A3A9D9D9D3A3A3A3A3A9D3A
-% 3A9D3AFFFF535353FFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% FFFF535353FFFF3A9D3A3A9D3A3A3A3A9D3A3A3A3A9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A9D9D3A3A3A3A3A9D3A3A3A9D3A
-% 9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A9D3A3A9D3A3A3A3A3A7F7F131313
-% 7F7F3A9D3A9D3A3A3A3A3A3A3A9D9D3A3A3A9D3A9D3A9D3A3A3A3A9D3A9D
-% 3A3A3A9D3A3A9D3A3A3A9D3A9D3A9D3A9D3A3A9D9D3AFFFF535353FFFF3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D3A3A3A3A9D3A3A3A3A9D3A
-% 9D3A3A3A3A9D9D3A3A9D9D9D3A3A3A3A3A3A9D3AFFFF535353FFFF3A9D9D
-% 3A9D9D3A9D3A9D9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A00000000000021
-% 0012121812C510181012101810121816181810101008101010181818181A
-% 181818181818181A181018121212121818181810121000FF1A181A181A18
-% 181818121010101010181210101012101216121818181818181818181812
-% 1618121012101212161818101010121010100E101010121818181818AF10
-% 1010FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D3A9D9D3A3A9D3A
-% 3A3A3A9D9D3A3A9D9D9D3A3A3A3A3A3A3A3A9D9D9D3A3A9D9D3A9D9D3A3A
-% 9D3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A7F7F7F7F7F7F7F3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A9D3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D
-% 3AFFFFFFFFFFFF7F7F7F9D3A9D9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D
-% 9D3A9D9D3A9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D3A3A
-% 9DFFFFFFFFFFFFFF9D9D9D3A9D3A9D3A9D9D3A9D3A3A9D9D9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A9D3A9D3A3A9D3A9D3A9D9D9D9D9D3A
-% 3A9D9D3A3A9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D3A9D9D
-% 9D3A9D9D9D9D9D9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D9D7F7F7F7F7F7F9D
-% 3A3A3A9D9D9D3A3A3A3A3A3A3A3A9D3A9D3A3A9D9D3A9D9D9D9D9D3A3A9D
-% 3A3A3A9D9D9D3A9D3A3A9D3A9D3A9D9D3A9D3A3AFFFFFFFFFFFF7F7F7F7F
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A9D3A3A9D3A9D9D9D9D3A9D9D3A3A3A3A3A3A9D9DFFFFFFFFFFFF9D9D3A
-% 3A9D9D9D3A9D9D9D3A9D3A9D3A3A9D3A3A3A3A3A3A3A0000000000002100
-% 10101210C5181818181012101210181818181210101010121818181A1818
-% 1A181A181A1818181812101010101018121010101200FF18181818181818
-% 181810101010101018181012101010121012161818181818181818181818
-% 131612101010101212181012101010101010101010101216181812AF1210
-% 12FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D3A9D3A9D9D9D3A
-% 3A3A9D3A9D9D9D9D3A9D9D3A3A3A3A3A3A9D9D3A9D9D3A9D3A9D9D9D3A9D
-% 9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A9D
-% 7F7F1313137F7F3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A9D3A3A3A3A3A3A9D9D3A3A3A9D3A3A3A3A3A3A3A3A9D3AFFFF
-% 535353FFFF7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 9D3AFFFF535353FFFF9D9D9D9D3A3A3A3A9D3A9D3A3A3A9D3A9D3A9D3A9D
-% 3A3A9D3A9D9D9D3A3A3A3A3A9D3A9D3A3A9D9D3A9D9D3A9D9D3A3A3A3A3A
-% 9D3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A9D3A9D3A9D3A9D3A3A9D
-% 3A3A9D3A9D3A9D3A9D3A9D9D3A3A9D3A9D3A9D9D7F7F1313137F7F9D3A9D
-% 9D3A9D3A9D3A3A3A9D3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D9D9D3A3A3A3A3A9D3A3A3A3A3A3A9DFFFF535353FFFF7F7F1313137F
-% 7F3A3A9D3A3A3A3A3A3A3A3A3A9D9D3A9D9D9D9D9D9D9D3A3A9D3A3A9D3A
-% 9D3A3A9D9D9D3A9D3A9D9D3A3A3A9D3A3A3A9D9D9DFFFF535353FFFF3A9D
-% 9D3A9D3A9D9D3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A000000000000210010
-% 121012C5181818181812101010101218181818121012101818181A181818
-% 181818181818181810101010101018181012101000FF1818181818181818
-% 121010101010101818101010101218101012181818181818181818181816
-% 1818181210101010121612181010121010101010101210121010AF101010
-% FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D3A9D3A9D9D9D3A3A
-% 3A9D3A9D9D9D9D3A9D9D3A3A3A3A3A3A9D9D3A9D9D3A9D3A9D9D9D3A9D9D
-% 3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A7F13
-% 1313131313137F3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A9D3A3A3A3A3A3A9D9D3A3A3A9D3A3A3A3A3A3A3A3A9DFF535353
-% 53535353FF13131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D
-% FF53535353535353FF9D9D9D3A3A3A3A9D3A9D3A3A3A9D3A9D3A9D3A9D3A
-% 3A9D3A9D9D9D3A3A3A3A3A9D3A9D3A3A9D9D3A9D9D3A9D9D3A3A3A3A3A9D
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A9D3A9D3A9D3A9D3A3A9D3A
-% 3A9D3A9D3A9D3A9D3A9D9D3A3A9D3A9D3A9D7F131313131313137F3A9D9D
-% 3A9D3A9D3A3A3A9D3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D9D9D3A3A3A3A3A9D3A3A3A3A3A3AFF53535353535353FF131313131313
-% 7F3A9D3A3A3A3A3A3A3A3A3A9D9D3A9D9D9D9D9D9D9D3A3A9D3A3A9D3A9D
-% 3A3A9D9D9D3A9D3A9D9D3A3A3A9D3A3A3A9D9DFF53535353535353FF9D9D
-% 3A9D3A9D9D3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A00000000000021001010
-% 1012C518181818181810121010101010121618121618181818181A181818
-% 1818181818181210101010101018181010101000FF181818181818181810
-% 121010101010181618181216121010101210181810121818181818181818
-% 18181816121010101812161210101010101012101012101012AF101010FF
-% 7D00000000000000003A3A9D3A3A3A3A3A9D3A9D9D9D9D3A9D3A9D3A3A9D
-% 9D9D9D3A9D9D3A9D3A3A3A3A9D3A3A3A9D9D9D9D9D9D9D9D3A9D3A3A9D9D
-% 9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D3A3A3A3A7F1313
-% 13131313137F3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3AFF53535353
-% 535353FF13131313137F3A3A3A3A3A3A3A9D3A3A3A9D3A3A9D3A9D9D9D9D
-% 9D9D9D9D9D9D3A9D9D9D9D9D3A9D3A9D9D9D9D9D3A9D9D9D3A9D3A3A3AFF
-% 53535353535353FF3A9D9D9D9D9D9D9D9D3A3A9D9D9D3A9D3A3A3A3A3A9D
-% 9D3A9D9D9D9D9D3A3A3A9D9D9D3A3A9D3A3A9D3A9D3A9D3A9D9D9D9D3A3A
-% 9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D9D9D3A9D3A9D9D3A9D3A
-% 9D9D3A9D9D9D9D9D3A9D9D9D9D9D9D9D3A7F131313131313137F9D9D9D3A
-% 9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A9D9D3A3A3A9D3AFF53535353535353FF1313131313137F
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A9D3A9D3A9D9D3A3A3A3A9D3A9D9D3A
-% 3A9D3A9D9D9D9D9D3A9D3A3A3A3A3A3A9D9DFF53535353535353FF3A9D9D
-% 9D9D3A9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A0000000000002100101010
-% 10C51818181A181812101010100808101012101812171818181818181818
-% 18181818181012101010101018161818121600FF12161818101810181210
-% 121010101212181818181812101010121613101210181618181818181818
-% 181818181010101216121012101216181810181012101216AF101010FF7D
-% 00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D3A9D3A9D9D
-% 3A9D9D9D9D3A9D9D3A3A3A3A3A3A9D9D3A9D9D3A9D9D3A9D9D3A9D9D9D9D
-% 3A3A3A3A9D3A3A3A3A3A9D3A3A3A9D9D9D3A3A3A3A3A3A3A3A7F13131313
-% 13131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3AFF535353535353
-% 535353FF13131313137F9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D
-% 9D9D9D9D3A9D9D9D9D3A9D3A3A9D9D3A9D9D3A9D9D3A9D3A9D9D3AFF5353
-% 53535353535353FF9D9D3A9D9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D9D3A3A3A3A3A9D3A9D3A9D3A9D3A9D9D9D9D9D3A3A9D9D
-% 3A9D9D9D9D9D3A9D9D3A9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D
-% 3A9D3A3A3A3A3A9D3A3A3A3A9D3A3A7F1313131313131313137F9D9D9D9D
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3AFF535353535353535353FF1313131313137F
-% 3A3A3A9D3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A9D3A9D3A3A9D3A3A
-% 9D9D9D9D9D3A3A9D9D3A3A3A3A3A3A9DFF535353535353535353FF9D3A9D
-% 3A3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A000000000000210010101010
-% C51818181818181818101010100A10101010121612181818181812161818
-% 101810181210121010101212181818181800FF1012101012161210101010
-% 121012161818181A18181210181218181818101218121216181818181218
-% 1818181810121018101810181012181818181812161218AF101010FF7D00
-% 000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D3A9D3A9D9D3A
-% 9D9D9D9D3A9D9D3A3A3A3A3A3A9D9D3A9D9D3A9D9D3A9D9D3A9D9D9D9D3A
-% 3A3A3A9D3A3A3A3A3A9D3A3A3A9D9D9D3A3A3A3A3A3A3A3A7F1313131313
-% 131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3AFF53535353535353
-% 5353FF13131313137F9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D9D
-% 9D9D9D3A9D9D9D9D3A9D3A3A9D9D3A9D9D3A9D9D3A9D3A9D9D3AFF535353
-% 535353535353FF9D9D3A9D9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D9D3A3A3A3A3A9D3A9D3A9D3A9D3A9D9D9D9D9D3A3A9D9D3A
-% 9D9D9D9D9D3A9D9D3A9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D3A
-% 9D3A3A3A3A3A9D3A3A3A3A9D3A3A7F1313131313131313137F9D9D9D9D9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3AFF535353535353535353FF1313131313137F3A
-% 3A3A9D3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A9D3A9D3A3A9D3A3A9D
-% 9D9D9D9D3A3A9D9D3A3A3A3A3A3A9DFF535353535353535353FF9D3A9D3A
-% 3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A000000000000210010101010C5
-% 1818181A20181818101210101010100A1012101818181818121012101012
-% 161210101010121012161818181A181800FF181818181810121612161216
-% 1218181818181A1818181010101010121018101010101218181818101210
-% 10101018181012101812181816181A18181818181618AF181818FF7D0000
-% 0000000000003A3A3A3A9D3A3A3A3A3A9D9D9D9D3A9D3A9D3A3A9D9D9D9D
-% 9D9D9D3A9D9D3A3A3A3A3A3A9D9D9D3A9D9D9D3A9D9D9D3A3A9D3A9D9D3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A7F131313131313
-% 1313137F3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF5353535353535353
-% 53FF13131313137F3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A9D9D3A3A3A3A9D9D3A9D9D9D9D9D9D3A9D9D9D9D3A9D3A3AFF53535353
-% 5353535353FF9D9D9D9D9D9D9D9D3A3A9D9D9D9D9D9D9D9D9D9D3A9D9D3A
-% 9D3A9D9D3A3A9D3A3A3A9D3A9D3A3A9D3A9D3A9D3A9D9D3A3A3A9D3A3A9D
-% 9D9D9D3A9D9D9D9D9D3A9D3A9D3A9D3A9D3A9D9D9D9D3A3A9D3A9D3A9D3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A9D3A9D9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3AFF535353535353535353FF1313131313137F3A3A
-% 3A3A3A9D3A9D3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A9D3A9D9D3A9D9D9D
-% 3A9D9D3A9D3A3A3A3A3A3A9D3A9DFF535353535353535353FF9D9D9D3A3A
-% 9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210018181010C510
-% 101216181818181810121010101010101010101012101818181818181810
-% 1216121612161218181818181A181800FF1A181818101210181012101216
-% 181818181818181818181010101010101010101010101216181818101012
-% 1012181810101216121618181818181A1818181818AF181816FF7D000000
-% 00000000003A3A3A3A3A3A3A3A9D3A9D9D9D3A3A9D9D9D3A3A9D9D3A3A9D
-% 9D9D3A9D9D3A3A9D3A3A3A9D9D9D9D9D3A9D9D9D3A9D3A3A9D9D9D3A3A3A
-% 3A9D3A3A3A3A3A3A3A9D3A9D9D3A3A3A3A3A9D3A3A3A3A7F131313131313
-% 137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3AFF53535353535353FF
-% 13131313137F3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D9D3A9D3A3A9D3A
-% 3A3A3A9D3A9D3A9D9D3A9D9D9D3A3A9D9D3A9D9D3A9D3A3A9DFF53535353
-% 535353FF9D9D9D3A9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D3A9D3A9D9D
-% 3A9D9D3A9D3A3A3A9D3A9D9D3A3A9D3A9D9D9D3A9D9D9D3A3A9D3A3A9D9D
-% 3A9D3A9D3A3A9D9D9D3A9D3A9D3A9D3A9D9D9D3A3A3A9D9D3A9D3A9D3A3A
-% 3A3A9D3A3A3A3A3A3A3A9D3A3A7F131313131313137F9D9D3A9D3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3AFF53535353535353FF1313131313137F3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A9D9D3A3A3A3A3A3A3A9D3A9D3A9D3A3A3A9D9D9D
-% 9D9D3A9D9D9D3A3A3A3A3A3A9D9DFF53535353535353FF3A9D3A9D9D3A9D
-% 9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210018161818C51010
-% 10121810181018121010101012101010101210121618181A181818101210
-% 181012101216181818181818181800FF1818181818111813161216121818
-% 181818181A18181818101010101010100A10101010101218181818181012
-% 1612181012101813181818181818181818181810AF161318FF7D00000000
-% 000000003A3A3A3A3A3A3A3A9D3A9D9D9D3A3A9D9D9D3A3A9D9D3A3A9D9D
-% 9D3A9D9D3A3A9D3A3A3A9D9D9D9D9D3A9D9D9D3A9D3A3A9D9D9D3A3A3A3A
-% 9D3A3A3A3A3A3A3A9D3A9D9D3A3A3A3A3A9D3A3A3A3A7F13131313131313
-% 7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3AFF53535353535353FF13
-% 131313137F3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D9D3A9D3A3A9D3A3A
-% 3A3A9D3A9D3A9D9D3A9D9D9D3A3A9D9D3A9D9D3A9D3A3A9DFF5353535353
-% 5353FF9D9D9D3A9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D3A9D3A9D9D3A
-% 9D9D3A9D3A3A3A9D3A9D9D3A3A9D3A9D9D9D3A9D9D9D3A3A9D3A3A9D9D3A
-% 9D3A9D3A3A9D9D9D3A9D3A9D3A9D3A9D9D9D3A3A3A9D9D3A9D3A9D3A3A3A
-% 3A9D3A3A3A3A3A3A3A9D3A3A7F131313131313137F9D9D3A9D3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3AFF53535353535353FF1313131313137F3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A9D9D3A3A3A3A3A3A3A9D3A9D3A9D3A3A3A9D9D9D9D
-% 9D3A9D9D9D3A3A3A3A3A3A9D9DFF53535353535353FF3A9D3A9D9D3A9D9D
-% 9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210013181818C5121010
-% 121010121018101012101216181618121618181818181818181818111813
-% 161216121818181818181A181800FF1A1818181818161818121012161818
-% 1A181A181818181810101010101010101010081010101818181818181018
-% 16121612181018101810181818181818181010AF121818FF7D0000000000
-% 0000003A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D3A9D9D3A9D3A9D9D9D9D3A
-% 9D9D3A3A3A3A3A9D3A3A9D9D9D3A3A9D9D3A9D9D3A3A9D9D3A9D3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A3A9D3A3A3A7F7F1313137F7F3A
-% 9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A9D3A9D9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF535353FFFF7F1313
-% 137F7F3A3A9D3A3A3A3A3A3A3A3A3A3A9D9D9D3A9D3A9D3A9D9D3A9D3A9D
-% 9D9D3A3A9D3A9D9D9D3A3A9D9D9D9D9D9D3A9D3A3A9D9D9DFFFF535353FF
-% FF9D9D3A9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A3A
-% 3A9D9D3A9D3A9D3A9D9D3A9D3A3A9D3A9D9D3A9D9D9D3A3A9D9D3A3A9D9D
-% 9D9D9D9D9D3A9D9D9D3A3A9D3A3A9D3A9D3A3A9D3A3A3A9D3A9D3A9D9D3A
-% 3A3A3A3A3A3A3A9D3A9D3A3A7F7F1313137F7F3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9DFFFF535353FFFF7F7F1313137F7F3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A9D9D9D9D9D3A3A3A9D3A9D3A3A9D3A9D9D9D3A9D9D
-% 3A9D3A9D3A3A3A3A3A3A9D9D9DFFFF535353FFFF9D3A9D9D9D3A3A9D3A9D
-% 9D3A3A3A3A9D3A3A3A3A3A3A3A000000000000210018181818C518181010
-% 1010121012101210121618181818C5C5C5C51818181A18C5C518181618C5
-% C5C5C5C5C5181A181A18181800FF18181818181818181712161818181818
-% 18181A181818181118121012101010101010080E10101818181818181210
-% 121018101810121812101818181817181218AF181618FF7D000000000000
-% 00003A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D3A3A3A9D9D9D3A9D9D9D3A
-% 9D9D3A3A3A3A3A3A9D9D3A9D9D3A9D9D9D9D9D3A3A9D9D9D9D3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A9D9D9D9D9D3A3A3A3A3A3A3A3A3A7F7F7F3A3A9D9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFFFF3A3A3A7F7F7F
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A9D3A3A3A9D3A3A9D9D3A9D3A
-% 9D9D9D9D3A9D3A3A3A9D9D9D3A9D9D3A3A3A3A9D9D9D9D9D9DFFFFFF9D9D
-% 9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A9D9D3A3A
-% 3A3A9D3A3A3A3A3A3A9D9D3A9D3A9D3A9D9D3A9D9D9D3A3A9D3A3A9D9D3A
-% 9D9D3A9D9D9D3A9D9D3A3A9D9D9D9D9D9D9D3A9D3A3A3A3A3A9D3A3A9D3A
-% 3A3A3A3A3A9D9D9D9D3A3A3A3A7F7F7F3A9D3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3AFFFFFF3A3A3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A9D3A9D3A3A9D3A9D9D9D9D3A3A9D3A9D9D9D9D3A3A9D9D9D9D9D9D
-% 9D3A9D3A3A3A9D3A3A9D9D9D9D9DFFFFFF9D9D9D3A9D3A9D9D3A9D9D9D9D
-% 3A9D3A3A3A3A3A3A3A3A3A3A000000000000210016181818C51818181810
-% 121018101810121018181818C5C51818C5C518181818C5C51818181817C5
-% C5181818181818181A181800FF18181818181A1818181812181818181818
-% 181818181618181612161810121012101010101010101218161818181018
-% 1813161318101210101216121818121618AF181818FF7D00000000000000
-% 003A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D3A3A3A9D9D9D3A9D9D9D3A9D
-% 9D3A3A3A3A3A3A9D9D3A9D9D3A9D9D9D9D9D3A3A9D9D9D9D3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A9D9D9D9D9D3A3A3A3A3A3A7F7F7F3A3A3A3A3A9D9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFFFF3A3A3A3A3A3A3A3A3A7F
-% 7F7F3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A9D3A3A3A9D3A3A9D9D3A9D3A9D
-% 9D9D9D3A9D3A3A3A9D9D9D3A9D9D3A3A3A3A9D9D9D9D9D9D9D9D9DFFFFFF
-% 9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A9D9D3A3A3A
-% 3A9D3A3A3A3A3A3A9D9D3A9D3A9D3A9D9D3A9D9D9D3A3A9D3A3A9D9D3A9D
-% 9D3A9D9D9D3A9D9D3A3A9D9D9D9D9D9D9D3A9D3A3A3A3A3A9D3A3A9D3A3A
-% 3A3A3A3A9D9D9D9D3A7F7F7F9D3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3AFFFFFF3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A3A3A3A
-% 9D3A9D3A9D3A3A9D3A9D9D9D9D3A3A9D3A9D9D9D9D3A3A9D9D9D9D9D9D9D
-% 3A9D3A3A3A9D3A3A9D9D9D9D9D9D9D3AFFFFFF3A9D3A9D9D3A9D9D9D9D3A
-% 9D3A3A3A3A3A3A3A3A3A3A000000000000210018181018C5181818181718
-% 1818121010121012121818C5C51818C5C5181818181818181A18181818C5
-% C518181818181818181800FF18181A181818181818181718181818121818
-% 181818121210121012101216121012101210101010101012181613101216
-% 18181216121012101012161818101818AF181818FF7D0000000000000000
-% 3A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D3A9D3A9D9D3A9D9D9D9D9D3A9D
-% 3A3A3A3A9D3A3A9D9D9D9D9D9D9D3A9D9D3A9D9D9D3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A9D3A3A9D9D9D3A3A7F7F1313137F7F3A3A3A3A9D3A3A
-% 3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3AFFFF535353FFFF3A3A3A3A3A7F7F1313
-% 137F7F3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D3A3A9D9D9D3A9D
-% 3A3A9D3A3A3A9D9D9D9D9D9D3A3A9D3A9D9D9D9D9D9D3A9DFFFF535353FF
-% FF9D9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D3A3A9D9D3A9D3A3A3A9D3A
-% 9D3A3A3A9D3A3A3A9D3A9D3A9D9D3A9D3A9D9D9D9D3A3A9D9D3A9D9D9D9D
-% 9D9D3A3A9D3A9D9D9D3A9D9D3A9D3A3A3A3A9D9D3A9D9D9D3A9D3A3A3A9D
-% 3A3A3A3A9D9D7F7F1313137F7F3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A9D9D9D3A3A9D3A3A9D9D3A9D9D9D3A9D9D9D3A3A9D3A9D9D3A3A
-% 3A9D3AFFFF535353FFFF9D9D3A9D3A3A7F7F1313137F7F9D9D9D3A3A3A3A
-% 3A3A3A3A9D3A9D3A3A9D3A9D3A3A9D3A3A3A3A9D3A3A9D3A3A9D9D3A9D3A
-% 9D3A3A3A3A3A3A9D9D3A9D3A9DFFFF535353FFFF9D3A3A3A9D9D9D9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A000000000000210018181612C5C5C5C5C5C5C5C5
-% C5C5C5C5C51010121018C5C51818C5C5181818181A1818181818181817C5
-% C5181812181818181800FF1818181818181A181818181818181818161818
-% 161810101010101010121012181612101010100A10101210181810121818
-% 181018101010101010121810181018AF161818FF7D00000000000000003A
-% 3A3A3A3A9D3A3A9D3A9D9D9D9D3A3A9D9D3A3A3A9D3A9D3A9D9D3A9D3A3A
-% 3A9D3A3A3A9D9D3A9D3A3A9D3A9D9D3A3A9D3A9D9D9D3A3A3A3A3A9D3A3A
-% 3A9D3A3A3A3A3A3A3A9D3A9D9D3A7F131313131313137F3A3A9D9D9D9D3A
-% 9D9D3A3A3A3A3A3A3A3A3A9D3A3A9D9D9D9D3A9D9D3A3A9D9D3A3A3A3A9D
-% 9D9D9D3A3A3A9D3A3A3A3A3AFF53535353535353FF9D3A3A7F1313131313
-% 13137F9D3A3A3A3A3A3A3A3A9D3A3A3A9D9D3A9D9D9D3A9D3A3A9D9D9D9D
-% 9D9D3A3A9D9D9D3A9D9D9D3A9D3A3A9D9D9D9D3A9D9DFF53535353535353
-% FF3A9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D3A9D3A9D3A9D3A3A9D9D3A3A3A
-% 9D3A3A3A3A3A3A9D9D3A9D9D9D3A9D9D9D9D9D9D9D3A3A9D3A9D9D3A3A3A
-% 9D3A9D3A9D9D9D3A9D3A9D3A9D9D9D9D9D9D3A9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A9D9D3A3A9D3A9D9D3A9D3A9D9D3A9D3A9D3A3A9D3A9D9D3A3A3A3A3A
-% 9DFF53535353535353FF3A9D3A9D7F131313131313137F3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A9D3A9D3A9D3A9D3A3A9D9D9D9D3A3A9D9D9D9D3A9D9D3A3A
-% 3A3A3A3A3A3A9D9D9D3A3AFF53535353535353FF3A3A9D9D9D9D9D3A9D3A
-% 3A9D3A3A3A3A3A3A3A000000000000210018181818C51018181818161210
-% 181012101010101018C5C51818C5C51A181818181818181A1818181818C5
-% C51818161818161800FF181818181A181818181818181818181818181818
-% 18181810101210101010101812181018101010AF12161818181818161817
-% 1818181818101010101012181810AF121818FF7D00000000000000003A3A
-% 3A3A3A9D3A3A9D3A9D9D9D9D3A3A9D9D3A3A3A9D3A9D3A9D9D3A9D3A3A3A
-% 9D3A3A3A9D9D3A9D3A3A9D3A9D9D3A3A9D3A9D9D9D3A3A3A3A3A9D3A3A3A
-% 9D3A3A3A3A3A3A3A9D3A9D9D3A7F131313131313137F3A3A9D9D9D9D3A9D
-% 9D3A3A3A3A3A3A3A3A3A9D3A3A9D9D9D9D3A9D9D3A3A9D9D3A3A3A3A9D9D
-% 9D9D3A3A3A9D3A3A3A3A3AFF53535353535353FF9D3A3A7F131313131313
-% 137F9D3A3A3A3A3A3A3A3A9D3A3A3A9D9D3A9D9D9D3A9D3A3A9D9D9D9D9D
-% 9D3A3A9D9D9D3A9D9D9D3A9D3A3A9D9D9D9D3A9D9DFF53535353535353FF
-% 3A9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D3A9D3A9D3A9D3A3A9D9D3A3A3A9D
-% 3A3A3A3A3A3A9D9D3A9D9D9D3A9D9D9D9D9D9D9D3A3A9D3A9D9D3A3A3A9D
-% 3A9D3A9D9D9D3A9D3A9D3A9D9D9D9D9D9D3A9D3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A9D9D3A3A9D3A9D9D3A9D3A9D9D3A9D3A9D3A3A9D3A9D9D3A3A3A3A3A9D
-% FF53535353535353FF3A9D3A9D7F131313131313137F3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A9D3A9D3A9D3A9D3A3A9D9D9D9D3A3A9D9D9D9D3A9D9D3A3A3A
-% 3A3A3A3A3A9D9D9D3A3AFF53535353535353FF3A3A9D9D9D9D9D3A9D3A3A
-% 9D3A3A3A3A3A3A3A000000000000210018181818C5101210121012101218
-% 1612101010101010C5C51012C5C51810181818181A181818C5C51818C5C5
-% 1818181818181800FF1818181A1E181A1818181612101218181818181818
-% 101810121010101010101218171818101210AF1018181818181818181818
-% 17181816101210121012101010AF101010FF7D00000000000000003A3A3A
-% 3A3A3A3A3A9D3A9D9D3A9D3A3A9D9D3A3A3A9D3A9D3A9D9D3A9D3A3A3A3A
-% 3A3A3A9D9D9D9D9D9D9D9D3A9D3A3A9D9D3A9D9D3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A9D9D7F1313131313131313137F9D3A9D3A3A3A9D3A
-% 9D3A3A3A3A3A3A3A3A9D3A3A9D3A9D3A9D9D9D9D9D9D3A9D9D9D3A3A9D3A
-% 9D3A3A3A3A9D9D3A3AFF535353535353535353FF9D7F1313131313131313
-% 137F9D3A3A3A3A9D3A3A3A3A9D3A3A3A9D3A9D3A9D9D9D9D9D9D9D3A9D3A
-% 3A9D9D9D3A9D9D9D3A9D3A3A3A9D9D9D9D9D9DFF535353535353535353FF
-% 9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D9D9D3A9D3A9D9D3A9D3A9D3A
-% 3A3A3A3A9D9D3A9D3A9D9D9D9D9D9D9D9D9D3A9D3A3A3A9D9D9D9D3A9D3A
-% 3A3A3A9D9D9D9D9D9D9D3A3A9D9D9D9D3A3A9D3A3A9D3A3A3A3A3A3A3A9D
-% 9D7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A9D3A9D9D3A3A9D3A9D3A9D9D3A3A9D9D9D9D3A3A3A3AFF53
-% 5353535353535353FF3A3A7F1313131313131313137F3A3A3A3A3A3A9D3A
-% 3A3A9D3A3A9D3A3A9D3A3A3A3A3A9D9D3A3A3A9D9D3A9D9D9D3A9D9D3A3A
-% 3A3A3A3A9D9D9D3AFF535353535353535353FF3A9D3A9D9D9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A000000000000210010101012C512161216121810181012
-% 10101010101010C5C51010C5C510181818181A1E181A18C5C51612C5C518
-% 18181818181800FF1818181A181A18181812101210101012161218101818
-% 1810101010101010101216121818181818AF181818181818181818181818
-% 181818181816121010121012AF101010FF7D00000000000000003A3A3A3A
-% 3A3A3A3A9D3A9D9D9D9D3A3A9D9D9D9D3A9D9D9D9D3A9D9D9D9D3A3A3A3A
-% 3A3A3A9D9D9D3A9D9D3A9D9D3A3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D9D3A3A3A9D9D9D7F1313131313131313137F9D3A9D3A3A3A3A3A9D
-% 3A3A3A3A3A9D3A3A3A9D3A3A9D9D3A3A3A9D3A3A3A9D3A3A9D9D9D9D3A3A
-% 9D3A3A3A3A9D9D3AFF535353535353535353FF3A7F131313131313131313
-% 7F3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A9D3A9D9D9D3A9D3A9D3A3A
-% 3A3A9D9D9D9D3A3A9D3A3A9D9D9D9D9D9D9DFF535353535353535353FF9D
-% 9D9D3A9D9D9D9D9D9D3A9D9D9D9D3A9D3A3A9D3A3A9D3A3A3A3A3A9D3A9D
-% 3A3A3A3A3A9D9D9D3A9D9D3A9D3A9D9D9D9D9D3A3A3A3A9D9D9D9D3A9D9D
-% 9D3A3A3A3A9D9D3A9D9D3A3A3A9D3A3A3A3A3A9D3A3A3A9D3A3A3A3A9D9D
-% 7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A9DFF5353
-% 53535353535353FF3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A
-% 9D3A9D9D9D9D9D9D3A3A3A9D3A9D3A9D3A3A3A9D9D3A9D9D3A9D3A3A3A3A
-% 3A3A3A9D9D9D9DFF535353535353535353FF3A9D9D9D9D9D3A9D3A3A9D3A
-% 3A3A3A3A3A3A000000000000210010101010C51012101210101012101210
-% 10121010081010C5C5C5C51012181818181A181A181818C5C5C5C5101012
-% 161218101800FF1818181A18181A18181810101010121012101212161218
-% 101010100A1010101012181818181818AF1818181A181818181818161812
-% 1818181818181012101018AF101010FF7D00000000000000003A3A3A3A3A
-% 3A3A3A9D3A9D9D9D9D3A3A9D9D9D9D3A9D9D9D9D3A9D9D9D9D3A3A3A3A3A
-% 3A3A9D9D9D3A9D9D3A9D9D3A3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D9D3A3A3A9D9D9D7F1313131313131313137F9D3A9D3A3A3A3A3A9D3A
-% 3A3A3A3A9D3A3A3A9D3A3A9D9D3A3A3A9D3A3A3A9D3A3A9D9D9D9D3A3A9D
-% 3A3A3A3A9D9D3AFF535353535353535353FF3A7F1313131313131313137F
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A9D3A9D9D9D3A9D3A9D3A3A3A
-% 3A9D9D9D9D3A3A9D3A3A9D9D9D9D9D9D9DFF535353535353535353FF9D9D
-% 9D3A9D9D9D9D9D9D3A9D9D9D9D3A9D3A3A9D3A3A9D3A3A3A3A3A9D3A9D3A
-% 3A3A3A3A9D9D9D3A9D9D3A9D3A9D9D9D9D9D3A3A3A3A9D9D9D9D3A9D9D9D
-% 3A3A3A3A9D9D3A9D9D3A3A3A9D3A3A3A3A3A9D3A3A3A9D3A3A3A3A9D9D7F
-% 1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A9DFF535353
-% 535353535353FF3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A9D
-% 3A9D9D9D9D9D9D3A3A3A9D3A9D3A9D3A3A3A9D9D3A9D9D3A9D3A3A3A3A3A
-% 3A3A9D9D9D9DFF535353535353535353FF3A9D9D9D9D9D3A9D3A3A9D3A3A
-% 3A3A3A3A3A000000000000210010101010C5121613181018121816181818
-% 1010100A100B101010101010181818181A18181A18181810101010121012
-% 1012121600FF1818181A181A181818181210121010121010101012101218
-% 18101010100810121618181A181A18AF18181A1818181818181012121816
-% 18121218101816101018AF181818FF7D00000000000000003A3A3A3A3A3A
-% 3A3A9D3A9D9D9D9D3A3A9D9D3A3A3A3A9D3A9D3A9D9D3A9D3A3A3A9D3A3A
-% 9D9D3A9D3A9D3A9D3A9D3A9D9D3A9D9D9D3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 9D9D9D9D9D9D9D3A3A7F131313131313137F3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D9D3A3A9D3A3A3A9D3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A9D3A3A
-% 9D3A3A3A3A9D3AFF53535353535353FF3A3A3A7F131313131313137F3A3A
-% 3A9D3A3A3A3A9D3A3A3A3A3A3A9D3A3A9D9D9D9D9D9D9D9D9D3A3A3A3A9D
-% 9D9D9D9D3A3A9D3A9D9D3A9D9D9D3A9D9DFF53535353535353FF9D9D9D9D
-% 9D9D3A9D3A9D9D9D9D9D9D9D9D3A9D9D3A9D3A9D3A9D3A3A3A9D3A3A9D3A
-% 3A3A3A9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D3A3A3A3A9D9D9D9D9D3A9D9D
-% 3A3A9D9D9D9D9D3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D7F
-% 131313131313137F3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9DFF535353
-% 53535353FF3A3A9D3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D9D9D9D3A9D3A3A3A9D3A9D9D9D3A3A9D9D3A9D9D9D9D3A9D3A3A3A9D3A
-% 3A9D9D9D3A9DFF53535353535353FF3A3A9D9D3A9D9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A000000000000210018181010C512161216101316101818181818
-% 181010100E101010101010181818181A181A181818181210121010121010
-% 10101200FF10181818181818181818161216121810181018101210101818
-% 1610101010081012161818181818AF1A1818181818181810121010101218
-% 101010121012181818AF18181AFF7D00000000000000003A3A3A3A3A3A3A
-% 3A9D3A9D9D9D9D3A3A9D9D9D9D3A3A9D9D3A9D9D9D9D3A3A3A3A3A3A3A9D
-% 9D9D3A9D3A9D9D9D3A3A9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A9D9D3A9D3A3A3A7F131313131313137F3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D9D9DFF53535353535353FF3A3A3A7F131313131313137F3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A9D9D3A9D3A9D3A9D3A9D3A9D3A3A3A9D9D9D9D9D
-% 9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9DFF53535353535353FF9D3A9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D3A9D3A9D3A3A9D9D3A9D3A3A3A3A9D
-% 3A3A9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D3A9D3A9D9D9D3A9D9D9D9D3A
-% 9D9D9D3A9D9D9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A7F13
-% 1313131313137F3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A
-% 9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9DFF53535353
-% 535353FF3A3A9D9D7F131313131313137F3A3A3A9D3A3A3A3A3A3A9D3A9D
-% 3A9D9D3A3A3A3A3A9D3A9D9D3A9D3A3A9D9D9D3A9D3A9D3A3A3A3A3A3A3A
-% 9D9D9D9D3AFF53535353535353FF9D3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A
-% 3A3A3A0000000000002100181A1818C51818121818181218181818181818
-% 161210101010101010101210181818181818181818161216121810181018
-% 101200FF1012161818181818101210121018181818181312101010101212
-% 181810121012101818181818181818181A18181818101210101010121610
-% 1012101210121018AF181818FF7D00000000000000003A3A3A3A3A3A3A3A
-% 9D3A9D9D9D9D3A3A9D9D9D9D3A3A9D9D3A9D9D9D9D3A3A3A3A3A3A3A9D9D
-% 9D3A9D3A9D9D9D3A3A9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 9D9D3A9D3A3A3A3A7F7F1313137F7F9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D9D9D3AFFFF535353FFFF3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A9D9D3A9D3A9D3A9D3A9D3A9D3A3A3A9D9D9D9D9D9D
-% 9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9DFFFF535353FFFF9D9D3A9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D3A9D3A9D3A9D3A9D3A3A9D9D3A9D3A3A3A3A9D3A
-% 3A9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D3A9D3A9D9D9D3A9D9D9D9D3A9D
-% 9D9D3A9D9D9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A7F7F
-% 1313137F7F3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A9D
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3AFFFF535353
-% FFFF3A3A3A9D9D3A7F7F1313137F7F3A3A3A3A9D3A3A3A3A3A3A9D3A9D3A
-% 9D9D3A3A3A3A3A9D3A9D9D3A9D3A3A9D9D9D3A9D3A9D3A3A3A3A3A3A3A9D
-% 9D9D9D3A9DFFFF535353FFFF9D9D3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A000000000000210018181818C5101816181018181612101010121818
-% 181010101010101010101012161818181818101210121018181818181312
-% 1000FF101218161818101010101010101818181818181010101010101618
-% 181816101018181818181818181818181818181012101010101010121010
-% 10121010121018AF121612FF7D00000000000000003A3A3A3A3A3A3A3A9D
-% 3A9D9D9D3A9D3A9D9D9D9D3A3A9D3A9D9D9D9D9D3A3A3A3A3A3A3A9D9D3A
-% 9D9D9D9D9D3A3A3A9D3A9D9D9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A7F7F7F3A3A9D3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A
-% 3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D9D9D9D9DFFFFFFFF3A9D3A3A3A3A3A9D9D7F7F7F7F3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D9D3A9D9D9D9D3A3A9D3A9D9D9D9D9D3A9D9D3A
-% 3A9D9D3A9D9D3A9D9D9D3A9D9D3A9D9D9DFFFFFF9D9D3A9D9D9D9D9D9D3A
-% 9D9D3A9D9D9D9D9D3A9D3A9D9D9D3A9D9D3A9D9D3A3A3A3A9D3A3A3A9D3A
-% 9D3A9D9D9D3A3A9D9D3A9D9D9D9D9D9D3A9D3A3A9D9D3A9D3A9D3A9D3A9D
-% 9D3A9D3A9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F
-% 7F7F3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9DFFFFFF3A
-% 3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A9D
-% 3A9D3A3A3A3A9D3A9D9D9D9D3A3A9D9D3A9D9D9D3A3A3A3A3A3A3A3A9D9D
-% 3A9D3A9D3A9DFFFFFF9D9D9D9D3A9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A000000000000210016121818C518181218181810181010101010101218
-% 101010121010101010101218161818101010101010101818181818181010
-% 00FF10101012101012101010101012181818181818181010080A10101012
-% 1818181818181818AFAFAFAFAFAF18171812181010101010101012181810
-% 101012161818AF181618FF7D00000000000000003A3A3A3A3A3A3A3A9D3A
-% 9D3A9D9D9D3A3A9D9D3A9D3A3A9D9D9D3A9D9D3A3A3A3A3A3A3A3A9D9D9D
-% 9D3A9D3A9D3A3A9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A7F3A3A3A3A3A3A9D9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A9D9D9D9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A9D3A3AFF3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A7F3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A9D3A9D3A9D3A9D3A9D3A9D
-% 3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9DFF3A9D9D9D9D3A9D9D9D9D9D
-% 9D9D9D9D9D9D9D3A9D3A9D3A3A9D3A9D3A9D3A9D3A9D3A3A9D3A9D3A3A9D
-% 9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A3A3A9D3A9D9D9D9D9D9D9D9D9D3A9D
-% 3A9D3A9D3A9D3A9D9D3A3A9D3A3A9D3A3A3A9D3A9D3A3A9D3A9D9D7F9D3A
-% 3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3AFF3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A9D3A7F3A3A3A9D3A9D3A3A3A3A3A9D3A3A3A9D3A3A9D
-% 3A3A3A3A3A3A9D3A9D3A9D9D3A9D3A9D9D9D9D3A3A3A3A3A3A3A3A9D9D9D
-% 9D9D9D3A9D3A3AFF9D9D3A9D3A9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 000000000000210016181618C51A18181810121818181812101010101018
-% 121610101210101010101012101012101010101012181818181818181000
-% FF1210121018101810101010101012161818181A18181010101010101010
-% 101018181818AFAFAFAFAFAFAFAF18101810121010101010121818181816
-% 1210121018AF181818FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D
-% 3A9D9D9D3A3A9D9D3A9D3A3A9D9D9D3A9D9D3A3A3A3A3A3A3A3A9D9D9D9D
-% 3A9D3A9D3A3A9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A7F7F7F3A3A3A3A3A3A9D9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 9D9D9D9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3AFFFFFFFF3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A7F7F7F7F3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A9D3A9D3A9D3A9D3A9D3A9D3A
-% 3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9DFFFFFF9D9D3A9D9D9D9D9D9D
-% 9D9D9D9D9D9D3A9D3A9D3A3A9D3A9D3A9D3A9D3A9D3A3A9D3A9D3A3A9D9D
-% 9D9D9D9D9D9D9D9D9D9D3A9D9D3A3A3A9D3A9D9D9D9D9D9D9D9D9D3A9D3A
-% 9D3A9D3A9D3A9D9D3A3A9D3A3A9D3A3A3A9D3A9D3A3A9D3A7F7F7F9D3A3A
-% 3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3AFFFFFF3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A9D3A3A7F7F7F9D3A9D3A3A3A3A3A9D3A3A3A9D3A3A9D3A
-% 3A3A3A3A3A9D3A9D3A9D9D3A9D3A9D9D9D9D3A3A3A3A3A3A3A3A9D9D9D9D
-% 9D9D3A9D3A3A9DFFFFFF9D3A9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A00
-% 0000000000210018181818C5181818181816181818181710101210121612
-% 101210101818101210121018101810101010101012161818181A181800FF
-% 181818181818181810121210121012181818181818181010101010101010
-% 1010121618AF181818181718AF1612101210101210121818181818181818
-% 10121018AF181818FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D
-% 9D3A9D3A3A9D9D9D9D3A3A9D9D3A9D3A9D3A3A3A3A3A3A3A9D9D9D3A9D3A
-% 9D9D3A3A9D9D3A9D9D3A3A3A3A3A3A3A3A9D3A9D3A9D3A3A3A3A3A3A3A3A
-% 3A7F7F1313137F7F9D3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3AFFFF
-% 535353FFFF3A3A3A3A3A3A3A9D3A3A3A3A3A7F7F1313137F7F3A3A3A3A9D
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D3A3A9D9D9D3A9D3A3A
-% 9D3A9D9D9D9D9D9D9D9D9D9D9D9D9DFFFF535353FFFF9D9D9D9D9D9D9D9D
-% 9D9D9D9D3A9D3A9D3A3A9D9D3A3A3A3A3A3A9D3A3A9D3A9D3A3A9D3A9D3A
-% 9D9D3A9D9D3A9D9D9D9D9D9D9D3A3A9D3A3A9D9D3A9D9D9D3A3A9D9D9D9D
-% 3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D3A7F7F1313137F7F3A9D
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF535353FFFF9D3A3A3A3A
-% 3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D9D
-% 3A3A3A3A9D3A9D9D9D9D3A3A9D9D3A3A9D9D3A3A3A3A3A3A3A9D9D9D3A9D
-% 3A9D9D3AFFFF535353FFFF9D3A3A9D9D3A3A3A3A9D3A3A3A3A3A3A3A0000
-% 00000000210018181818C518181818181811181218181818161210181018
-% 10181818181818181818181818181012121012101218181818181800FF1A
-% 181818181818181818101010101012181818181818101810121010101010
-% 10121018AF181818181816AF18101210101010101018181818181A181810
-% 101012AF121612FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D3A
-% 9D9D9D3A3A9D9D9D9D3A3A9D3A3A9D3A9D9D3A3A3A3A3A3A9D9D9D9D3A9D
-% 9D3A9D9D9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A7F
-% 131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF535353
-% 53535353FF3A9D3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A9D3A3A3A9D3A3A3A9D9D3A9D9D9D3A3A9D3A3A9D9D
-% 9D9D3A9D9D9D9D9D3A9D3A9D9DFF53535353535353FF9D9D3A3A9D9D9D9D
-% 9D9D9D3A3A9D9D3A9D3A9D3A9D3A9D3A3A9D3A3A9D3A9D3A3A3A3A9D3A9D
-% 9D3A9D9D9D9D3A9D9D9D9D3A9D3A3A9D3A3A9D9D9D9D9D3A9D3A9D3A9D3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A9D9D9D9D7F131313131313137F9D9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A
-% 3A3A3A3A3A7F131313131313137F9D3A3A9D3A3A3A9D3A3A9D3A3A3A3A9D
-% 3A3A3A3A3A9D9D9D3A9D3A3A3A9D9D9D3A9D3A3A3A3A3A3A9D9D3A9D9D9D
-% 9D3AFF53535353535353FF3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000
-% 000000210016121612C51210181818181810101210181818101210121012
-% 1818181A181A181818181818181818101010101012181818181800FF1818
-% 181818181818181818121010101210121018101812101216181018121610
-% 101210AFAFAFAFAFAFAFAF10181012101010121818181A18181818181810
-% 1010AF101010FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D3A9D
-% 9D9D3A3A9D9D9D9D3A3A9D3A3A9D3A9D9D3A3A3A3A3A3A9D9D9D9D3A9D9D
-% 3A9D9D9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A7F13
-% 1313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353
-% 535353FF3A9D3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A9D3A3A3A9D3A3A3A9D9D3A9D9D9D3A3A9D3A3A9D9D9D
-% 9D3A9D9D9D9D9D3A9D3A9D9DFF53535353535353FF9D9D3A3A9D9D9D9D9D
-% 9D9D3A3A9D9D3A9D3A9D3A9D3A9D3A3A9D3A3A9D3A9D3A3A3A3A9D3A9D9D
-% 3A9D9D9D9D3A9D9D9D9D3A9D3A3A9D3A3A9D9D9D9D9D3A9D3A9D3A9D3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A9D3A9D9D9D9D7F131313131313137F9D9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A3A
-% 3A3A3A3A7F131313131313137F9D3A3A9D3A3A3A9D3A3A9D3A3A3A3A9D3A
-% 3A3A3A3A9D9D9D3A9D3A3A3A9D9D9D3A9D3A3A3A3A3A3A9D9D3A9D9D9D9D
-% 3AFF53535353535353FF3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A00000000
-% 0000210010101010C5101012161818101210101018121210101810121018
-% 1818181818181818181818181818181210101012101210181000FF1A1818
-% 1818181818181818181812101010101010121010181012181818181A1810
-% 121018AFAFAFAFAFAF18181817181012101216181818181A181818121010
-% 10AF101010FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D3A9D9D9D
-% 3A3A3A9D9D9D9D3A3A9D9D9D9D9D3A3A9D3A3A3A3A3A9D3A9D3A9D3A3A3A
-% 9D3A9D9D9D3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313
-% 1313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3AFF535353535353
-% 535353FF3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A9D9D9D3A9D3A3A9D3A3A3A3A9D9D9D9D9D
-% 9D9D3A9D3A3A9D9D9D9DFF535353535353535353FF3A9D9D9D9D9D9D9D9D
-% 3A9D3A3A3A3A9D3A9D9D3A9D3A9D9D3A9D3A9D3A3A9D3A9D3A9D9D9D3A3A
-% 9D9D9D3A9D9D3A9D9D9D9D9D3A3A9D3A9D9D3A9D9D3A9D9D3A9D3A9D3A9D
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3AFF535353535353535353FF3A3A3A3A3A3A
-% 3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A3A
-% 3A3A3A9D9D9D9D9D3A3A9D9D9D3A9D9D3A3A3A3A3A3A9D3A9D3A9D9D3AFF
-% 535353535353535353FF3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A0000000000
-% 00210010101010C510101012181618181012101210101010121018101816
-% 1818181A181818181818181818181818121010101010101200FF18181818
-% 181012101817181818181810121010121010121012161818181818181818
-% 101818181818181818181818181818161818AFAFAFAFAFAFAFAFAFAFAFAF
-% AF101010FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D
-% 9D3A3A3A3A3A9D3A3A3A9D3A3A3A9D9D9D9D9D9D3A9D3A3A9D3A3A3A9D9D
-% 9D9D9D3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13131313
-% 13131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353
-% 5353FF3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A9D3A3A9D9D3A9D3A3A9D9D9D9D9D3A
-% 9D9D9D9D9D9D3A9D3AFF535353535353535353FF9D9D9D3A9D9D9D9D9D3A
-% 3A3A9D3A3A9D9D9D3A3A9D3A9D3A3A3A3A3A9D3A3A3A9D3A9D9D9D3A9D9D
-% 3A9D9D9D9D9D9D3A9D9D9D3A3A9D3A9D9D9D9D9D3A3A9D9D3A3A9D9D3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F1313131313131313137F3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A3A9D
-% 3A7F1313131313131313137F3A3A3A3A9D3A3A3A9D3A3A9D3A3A3A3A3A3A
-% 3A3A3A9D9D9D3A9D3A3A9D9D3A3A9D9D9D9D9D9D9D3A9D9D3A9D9D3AFF53
-% 5353535353535353FF3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A000000000000
-% 210010101010C51010101010121818181818181612161216121012101218
-% 181818181818181012101817181818181810121010121000FF1818111210
-% 101010121818181818181818181210101210101210121810121618181818
-% 181818181A1818181818181818181818181818181A1818181818181810AF
-% 101210FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D
-% 3A3A3A3A3A9D3A3A3A9D3A3A3A9D9D9D9D9D9D3A9D3A3A9D3A3A3A9D9D9D
-% 9D9D3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313
-% 131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF5353535353535353
-% 53FF3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D9D9D3A9D3A3A9D9D3A9D3A3A9D9D9D9D9D3A9D
-% 9D9D9D9D9D3A9D3AFF535353535353535353FF9D9D9D3A9D9D9D9D9D3A3A
-% 3A9D3A3A9D9D9D3A3A9D3A9D3A3A3A3A3A9D3A3A3A9D3A9D9D9D3A9D9D3A
-% 9D9D9D9D9D9D3A9D9D9D3A3A9D3A9D9D9D9D9D3A3A9D9D3A3A9D9D3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F1313131313131313137F3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A3A9D3A
-% 7F1313131313131313137F3A3A3A3A9D3A3A3A9D3A3A9D3A3A3A3A3A3A3A
-% 3A3A9D9D9D3A9D3A3A9D9D3A3A9D9D9D9D9D9D9D3A9D9D3A9D9D3AFF5353
-% 53535353535353FF3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A00000000000021
-% 0012101012C5101010101018181820191818181818181818101010121012
-% 1818181112101010101218181818181818181812101000FF181818161812
-% 181612101212181818181018101813181818181612161818181818181818
-% 181A181818181A181818181210131618181818181818181210121012AF12
-% 1618FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D3A9D
-% 3A9D9D3A9D3A3A3A9D9D9D3A9D3A9D3A9D3A9D9D3A9D3A3A3A9D3A9D9D9D
-% 9D3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A7F1313131313
-% 13137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF
-% 3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A9D3A9D3A3A9D3A9D3A9D9D3A3A9D9D3A9D9D9D9D9D
-% 9D9D9D9D9D9D9D9DFF53535353535353FF9D9D9D3A9D9D3A9D9D9D9D3A9D
-% 3A3A3A9D3A9D3A3A9D3A3A9D3A9D3A3A9D3A9D9D3A9D9D9D9D3A9D9D9D3A
-% 9D3A9D9D9D9D3A9D9D3A3A9D9D3A9D9D3A9D3A3A9D9D3A3A9D3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A9D3AFF53535353535353FF3A3A3A9D3A3A3A3A3A9D
-% 7F131313131313137F9D3A3A9D3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A
-% 3A3A9D9D9D9D9D3A3A9D9D3A3A9D9D9D3A9D9D9D9D3A9D3A3A9D9DFF5353
-% 5353535353FF9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A0000000000002100
-% 16181818C510101010101018181818181818181810181818181012101018
-% 18181816181218161210121218181818101810181300FF10181018101818
-% 181818101618181818181818181816181212101210121818181818181818
-% 181818181818181A18181618181818181818181818181610101210AF1210
-% 18FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D3A3A
-% 3A9D9D9D9D9D3A3A3A9D3A3A9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D3A3A
-% 9D9D3A3A3A3A9D3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A9D7F131313131313
-% 137F3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D
-% 3A9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A9D3A9D3AFF53535353535353FF3A
-% 3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A9D3A9D3A9D9D3A9D3A9D9D9D9D3A9D3A3A9D9D9D9D9D3A9D9D3A9D
-% 9D9D3A9D9D9D9DFF53535353535353FF9D3A9D9D9D9D9D9D9D9D9D3A3A9D
-% 3A3A9D9D3A3A3A3A3A9D3A3A9D3A3A3A3A3A9D3A9D9D9D9D9D9D9D3A9D9D
-% 9D3A9D3A9D9D9D9D9D3A3A9D3A9D9D9D9D3A3A9D9D9D3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3AFF53535353535353FF9D3A3A3A3A3A3A3A3A3A7F
-% 131313131313137F3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A9D3A3A3A3A3A
-% 3A9D9D9D9D9D3A3A3A3A9D9D9D3A3A9D3A3A3A9D9D3A3A3A9D9DFF535353
-% 53535353FF9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210010
-% 181018C51012101010121012101217181818101818181810121010101810
-% 181018101818181818101618181818181818181800FF1012121212101018
-% 181818181210121018121612161210101010101010101018181818181818
-% 181818AFAF181818181818181818181818181818181818131010AF101210
-% FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D3A3A3A
-% 9D9D9D9D9D3A3A3A9D3A3A9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D3A3A9D
-% 9D3A3A3A3A9D3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A9D3A7F7F1313137F7F
-% 3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A
-% 9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A9D3A9D3A3AFFFF535353FFFF3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A9D3A9D3A9D9D3A9D3A9D9D9D9D3A9D3A3A9D9D9D9D9D3A9D9D3A9D9D
-% 9D3A9D9D9D9D9DFFFF535353FFFF9D9D3A9D9D9D9D9D9D9D9D9D3A3A9D3A
-% 3A9D9D3A3A3A3A3A9D3A3A9D3A3A3A3A3A9D3A9D9D9D9D9D9D9D3A9D9D9D
-% 3A9D3A9D9D9D9D9D3A3A9D3A9D9D9D9D3A3A9D9D9D3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F9D3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3AFFFF535353FFFF3A9D3A3A3A3A3A3A3A3A3A3A7F
-% 7F1313137F7F3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A
-% 9D9D9D9D9D3A3A3A3A9D9D9D3A3A9D3A3A3A9D9D3A3A3A9D9D9DFFFF5353
-% 53FFFF3A9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A00000000000021001210
-% 1218C5101010101010101012181812181618101210121010101010121012
-% 1212121010181818181812101210181216121600FF121010101010121810
-% 181818161010121010101210121612101010101010101012101618181818
-% 1818AFAF20181A181818181818181818181818181818161810AF101010FF
-% 7D00000000000000003A3A3A3A3A3A3A3A9D3A9D3A9D9D9D9D3A9D3A9D9D
-% 9D9D9D9D9D3A3A3A9D3A9D3A9D3A9D3A9D3A3A3A3A9D9D9D9D9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D7F7F7F3A3A9D
-% 9D9D9D9D3A9D3A3A3A9D9D9D9D9D3A3A3A3A9D9D9D9D9D9D3A3A9D3A9D9D
-% 9D9D3A3A3A3A9D9D3A9D9D3A3A3A9D9D9D9D9D3A3AFFFFFF9D9D3A9D9D3A
-% 3A3A9D9D9D9D3A3A3A3A3A7F7F7F9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A9D3A9D9D9D3A3A9D3A3A3A9D3A9D9D9D9D9D9D3A3A9D9D9D9D3A
-% 9D9D9D9D9D9D9D9DFFFFFF9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A9D9D3A3A
-% 9D3A3A3A3A9D3A3A3A9D3A3A3A9D9D9D3A9D9D9D9D9D9D3A9D3A9D3A9D9D
-% 9D9D9D9D3A9D3A9D3A3A3A3A9D3A3A3A3A9D9D3A9D9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A9D3A7F7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3AFFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A9D9D3A
-% 9D9D9D9D3A9D3A3A3A9D9D9D9D9D9D9D9D9D9D3A3A9D9D9D9D9D3AFFFFFF
-% FF3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A0000000000002100101012
-% 10C512121012101012101012101817121210181618101210101010121010
-% 10101012181018181816101012101010121000FF10101012101210101218
-% 181810121012161218121612101010101008100E10101010121216181818
-% 18181A181818181818181818181818181818181818181810AF101010FF7D
-% 00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D3A9D9D9D9D3A3A9D3A
-% 9D9D9D3A9D9D3A3A9D9D9D9D3A9D9D3A3A3A3A3A9D9D9D9D3A3A9D3A3A9D
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D9D3A9D3A7F9D3A3A3A9D3A9D
-% 9D3A3A9D9D3A3A3A9D3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A9D3A9D3A3A3A
-% 3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A9D9DFF3A3A9D9D3A3A9D9D3A3A
-% 3A9D9D3A9D9D3A3A3A3A3A9D7F9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A9D9D9D3A3A9D3A3A9D3A3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D3A9D9D9D9D3A9DFF9D9D9D9D9D3A9D3A9D9D9D9D3A3A3A9D3A3A9D9D
-% 9D3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D9D9D3A9D9D9D9D9D9D9D3A9D
-% 9D9D3A9D9D9D9D3A3A9D3A9D3A9D9D3A9D3A9D3A9D3A9D9D3A3A3A3A3A3A
-% 3A9D3A3A3A3A9D3A3A3A3A3A7F3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3AFF3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D7F3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A
-% 9D9D9D3A3A9D9D3A3A9D9D9D9D9D9D9D3A3A3A3A3A3A9D9D9D3A9D9D3AFF
-% 9D3A9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210010101012
-% C51817181612101010121618181818101618181816181618181010101012
-% 101210101218181810121012161218121600FF1012101010101010101012
-% 181818181012101010101210121010101010101010101010101218181818
-% 1A18181A18181818181718181216181818181816181810AF101008FF7D00
-% 000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D3A9D9D9D9D3A3A9D3A9D
-% 9D9D3A9D9D3A3A9D9D9D9D3A9D9D3A3A3A3A3A9D9D9D9D3A3A9D3A3A9D3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D9D3A7F7F7F9D3A3A3A9D3A9D9D
-% 3A3A9D9D3A3A3A9D3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A9D3A9D3A3A3A3A
-% 3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3AFFFFFF3A3A9D9D3A3A9D9D3A3A3A
-% 9D9D3A9D9D3A3A3A3A3A9D3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A9D9D9D3A3A9D3A3A9D3A3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D3A9D9D9D9D3A9D9DFFFFFF9D9D3A9D3A9D9D9D9D3A3A3A9D3A3A9D9D9D
-% 3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D
-% 9D3A9D9D9D9D3A3A9D3A9D3A9D9D3A9D3A9D3A9D3A9D9D3A3A3A3A3A3A3A
-% 9D3A3A3A3A9D3A3A7F7F7F7F3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3AFFFFFF3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A7F7F7F3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A9D
-% 9D9D3A3A9D9D3A3A9D9D9D9D9D9D9D3A3A3A3A3A3A9D9D9D3A9D9D3AFFFF
-% FFFF9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210010081010C5
-% 181818181818181613181818181818121818181818181818101012101010
-% 1010101010121818181810121010101000FF121010121012101210121010
-% 121612161216121813181718101210101010101010101010101816181818
-% 181A1818181818181210121012181217181818121810AF100810FF7D0000
-% 0000000000003A3A3A3A3A3A3A3A9D3A9D9D3A9D9D3A9D9D3A9D3A9D9D3A
-% 3A9D9D3A9D3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D3A3A3A9D3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A9D7F7F1313137F7F3A3A3A3A3A3A3A
-% 3A3A9D3A3A9D9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A9D3A3A3A3AFFFF535353FFFF3A3A3A3A9D9D3A3A3A9D
-% 3A3A3A3A9D3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A9D9D9D9D3A9D3A3A9D3A9D3A9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D9D
-% 9D9D3A9D9D9DFFFF535353FFFF9D9D9D9D9D9D3A3A3A9D3A3A9D3A9D3A3A
-% 9D3A3A3A3A9D3A3A3A3A9D3A9D3A9D9D9D9D3A9D9D3A9D3A9D9D9D9D3A9D
-% 9D3A9D3A9D9D3A9D9D3A9D3A9D3A9D9D9D3A9D3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A7F7F1313137F7F9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3AFFFF535353FFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F
-% 1313137F7F3A9D3A9D3A3A3A9D3A3A3A3A3A9D3A9D3A3A3A3A9D3A3A3A9D
-% 9D3A3A3A9D9D3A3A3A3A3A3A3A3A3A9D9D3A3A9D9D3A3A3A9D3AFFFF5353
-% 53FFFF9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210008101010C518
-% 18181A18181A181818181A18181818181818181818181810121010121012
-% 10121012101012161216121612181300FF10101210101210181210121010
-% 1210181818181816181818181610101010100A0E10101212181218181818
-% 181818181818101012101010121618121612181610AF10080AFF7D000000
-% 00000000003A3A3A3A3A3A3A3A9D3A9D9D9D3A9D9D9D3A3A3A9D3A9D3A9D
-% 9D9D9D9D9D3A9D3A3A9D9D9D9D9D9D9D9D9D3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A
-% 3A9D3A3A3A9D3A3A3A9D9D3A3A3A3A3A9D3A3A3A3A3A3A9D9D3A3A3A3A3A
-% 3A9D3A3A3A3A9D9D3A3A3AFF53535353535353FF3A3A3A9D9D3A3A3A9D9D
-% 3A3A3A3A3A9D3A7F131313131313137F3A9D3A3A3A3A3A3A3A9D3A3A3A3A
-% 9D9D9D9D3A9D9D3A3A9D9D3A3A9D9D9D3A9D9D9D3A9D9D3A9D9D9D3A3A9D
-% 9D9D9D3AFF53535353535353FF3A9D9D9D9D9D3A9D3A9D3A9D3A3A3A9D3A
-% 3A3A3A9D3A3A9D3A3A3A3A9D9D9D9D9D9D3A9D3A3A9D9D9D3A9D9D9D9D3A
-% 9D9D9D9D9D3A3A9D3A9D3A3A3A3A9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F131313131313137F3A9D3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3AFF53535353535353FF3A9D3A3A9D3A3A3A9D3A3A3A3A3A3A9D7F131313
-% 131313137F3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A9D9D3A9D9D
-% 9D3A3A9D9D9D3A9D3A3A3A3A9D9D9D9D3A3A9D3A3A3A9D9DFF5353535353
-% 5353FF3A9D3A3A3A9D3A3A3A3A3A3A0000000000002100080A1010C51818
-% 181820181818181818181818181812101210181216181010101210101210
-% 181210121010121018181818181600FF12181018181818181A1818181810
-% 101818161216121012101218181818121010101010101010101818AF1818
-% 1818181010181218161216121012101210101218AF101010FF7D00000000
-% 000000003A3A3A3A3A3A3A3A9D3A9D9D9D3A9D9D9D3A3A3A9D3A9D3A9D9D
-% 9D9D9D9D3A9D3A3A9D9D9D9D9D9D9D9D9D3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A
-% 9D3A3A3A9D3A3A3A9D9D3A3A3A3A3A9D3A3A3A3A3A3A9D9D3A3A3A3A3A3A
-% 9D3A3A3A3A9D9D3A3A3AFF53535353535353FF3A3A3A9D9D3A3A3A9D9D3A
-% 3A3A3A3A9D3A7F131313131313137F3A9D3A3A3A3A3A3A3A9D3A3A3A3A9D
-% 9D9D9D3A9D9D3A3A9D9D3A3A9D9D9D3A9D9D9D3A9D9D3A9D9D9D3A3A9D9D
-% 9D9D3AFF53535353535353FF3A9D9D9D9D9D3A9D3A9D3A9D3A3A3A9D3A3A
-% 3A3A9D3A3A9D3A3A3A3A9D9D9D9D9D9D3A9D3A3A9D9D9D3A9D9D9D9D3A9D
-% 9D9D9D9D3A3A9D3A9D3A3A3A3A9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A7F131313131313137F3A9D3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% FF53535353535353FF3A9D3A3A9D3A3A3A9D3A3A3A3A3A3A9D7F13131313
-% 1313137F3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A9D9D3A9D9D9D
-% 3A3A9D9D9D3A9D3A3A3A3A9D9D9D9D3A3A9D3A3A3A9D9DFF535353535353
-% 53FF3A9D3A3A3A9D3A3A3A3A3A3A000000000000210010101010C5181618
-% 1A181A181A18181A181A1816121010121012101210181218101818181818
-% 1A18181818101018181612161200FF101012101818181818181A18181218
-% 1818181818121018101012181810101010101010AFAFAFAF121618AF1818
-% 16121012101810181818181018101210121012AF121010FF7D0000000000
-% 0000003A3A3A3A9D3A3A3A9D3A9D9D9D9D9D3A9D3A9D9D3A9D9D3A9D3A9D
-% 9D3A3A9D9D9D9D3A3A3A9D9D9D3A3A3A9D3A9D3A3A3A3A3A9D3A3A9D3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A9D9D9D3A
-% 3A3A3A9D9D9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A
-% 9D9D9D3A9D3A3A3AFF535353535353535353FF3A9D9D3A3A3A3A9D9D3A3A
-% 9D3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D
-% 9D3A3A9D3A3A3A9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9DFF535353535353535353FF9D9D9D3A3A3A3A3A9D3A3A9D9D3A9D3A3A9D
-% 3A3A3A3A3A3A3A9D9D3A9D9D9D9D3A9D9D3A9D3A9D9D9D9D9D3A3A9D3A9D
-% 9D9D3A9D3A9D3A9D9D3A3A9D9D9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 7F1313131313131313137F3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3AFF53
-% 5353535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313
-% 1313137F3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 9D9D3A9D9D9D9D9D9D9D9D9D3A9D3A3A3A3A9D3A9DFF5353535353535353
-% 53FF9D3A3A3A3A3A3A3A3A3A3A000000000000210010101010C518181818
-% 181A18181A181A1818181812101210121012101812101012101818181818
-% 181A1818121818181818181200FF10121010121012181818181818181818
-% 18181818171813101010101012101010101010AFAFAF12101012AF121012
-% 101010121012181818181818101210101010AF121818FF7D000000000000
-% 00003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D3A9D3A9D9D9D9D9D3A9D3A9D
-% 9D3A9D9D3A3A3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A9D3A3A3A7F1313131313131313137F3A3A3A3A3A9D9D3A3A
-% 3A3A9D3A9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D
-% 9D3A9D9D3A3A3AFF535353535353535353FF3A3A9D3A3A3A3A3A9D9D9D3A
-% 3A3A3A7F1313131313131313137F3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A9D
-% 3A3A9D3A9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A3A9D
-% FF535353535353535353FF9D9D3A9D3A3A3A9D3A3A9D3A3A3A3A9D3A3A3A
-% 3A9D3A3A9D3A9D9D9D9D9D9D3A9D9D3A9D3A9D9D3A3A9D3A9D9D9D9D9D9D
-% 9D9D9D3A3A9D9D9D3A3A3A9D9D3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A7F
-% 1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3AFF5353
-% 53535353535353FF3A3A3A3A3A3A3A3A3A3A9D3A3A3A7F13131313131313
-% 13137F3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A
-% 9D3A9D9D3A9D3A9D9D3A9D3A3A3A9D9D9D3A9D9DFF535353535353535353
-% FF3A3A3A3A3A3A3A3A3A3A3A000000000000210018181813C5181818181A
-% 181818181818181818181010101010101012101010121010121012181818
-% 181818181818181818181700FF1810101210101818181818181818181818
-% 181818181816101012101010101010101010AF12AF10121012AF10121010
-% 1010101012161818181818181010101010AF101018FF7D00000000000000
-% 003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D3A9D3A9D9D9D9D9D3A9D3A9D9D
-% 3A9D9D3A3A3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A9D3A3A3A7F1313131313131313137F3A3A3A3A3A9D9D3A3A3A
-% 3A9D3A9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D9D
-% 3A9D9D3A3A3AFF535353535353535353FF3A3A9D3A3A3A3A3A9D9D9D3A3A
-% 3A3A7F1313131313131313137F3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A9D3A
-% 3A9D3A9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A3A9DFF
-% 535353535353535353FF9D9D3A9D3A3A3A9D3A3A9D3A3A3A3A9D3A3A3A3A
-% 9D3A3A9D3A9D9D9D9D9D9D3A9D9D3A9D3A9D9D3A3A9D3A9D9D9D9D9D9D9D
-% 9D9D3A3A9D9D9D3A3A3A9D9D3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A7F13
-% 13131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3AFF535353
-% 535353535353FF3A3A3A3A3A3A3A3A3A3A9D3A3A3A7F1313131313131313
-% 137F3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A9D
-% 3A9D9D3A9D3A9D9D3A9D3A3A3A9D9D9D3A9D9DFF535353535353535353FF
-% 3A3A3A3A3A3A3A3A3A3A3A000000000000210010181816C5181818181818
-% 181818181818181810101010101010121010181810101210101818181818
-% 1818181818181818181800FF181818101612181018181818181818181818
-% 1818181818181810101210181810101012AF10AFAFAFAFAFAF1210101210
-% 10101010121818181818181012101010AF0A1010FF7D0000000000000000
-% 3A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D3A9D9D9D9D3A9D3A3A3A9D3A3A3A
-% 9D9D9D9D3A9D3A3A3A9D3A3A9D9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A7F131313131313137F9D3A3A3A3A3A3A9D9D3A3A3A
-% 9D9D3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A9D3A3A3A9DFF53535353535353FF3A3A3A9D9D3A3A3A9D3A3A3A9D3A3A
-% 3A3A7F131313131313137F3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D9D9D3A3A
-% 9D9D9D3A3A3A9D9D9D9D9D3A9D9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D9DFF
-% 53535353535353FF9D9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A
-% 9D9D3A9D3A9D9D9D9D3A9D3A9D9D3A3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D3A3A9D3A9D9D3A9D9D9D9D9D3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A7F13
-% 1313131313137F3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF535353
-% 53535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A
-% 3A9D9D9D3A9D9D9D3A9D3A3A9D3A9D9D9D3A9DFF53535353535353FF3A9D
-% 3A3A3A3A3A3A3A3A3A3A000000000000210010101012C518181818181818
-% 181718181818121012101010121010181818181818101612181018181818
-% 18181818181818181800FF1A181812121210181012121018181818181818
-% 18121618181810121018181810101810AF1818AFAFAFAF12101012161010
-% 101010121818181818181012101010AF100810FF7D00000000000000003A
-% 3A3A3A3A3A3A3A9D3A9D9D9D9D9D3A9D3A9D9D9D9D9D9D9D9D3A9D3A9D3A
-% 9D3A9D3A3A9D3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A7F131313131313137F3A3A3A9D9D3A3A3A9D3A3A3A9D
-% 3A3A3A9D3A3A3A3A3A3A9D3A3A9D3A3A3A9D3A3A3A9D3A3A3A3A9D3A3A3A
-% 9D3A3A3A9DFF53535353535353FF9D3A3A9D9D3A3A3A9D9D3A3A3A3A3A3A
-% 3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D9D
-% 3A9D3A3A3A9D9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9DFF53
-% 535353535353FF9D9D3A3A3A3A9D3A9D3A9D3A3A3A3A3A9D3A3A9D3A3A9D
-% 3A3A9D3A9D9D9D9D3A9D3A9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D3A3A3A9D9D3A3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D7F1313
-% 13131313137F3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353
-% 535353FF9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A7F131313131313137F9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D
-% 9D3A3A3A3A3A3A9D3A9D3A9D9D9D9D3A9D9DFF53535353535353FF3A9D3A
-% 3A3A3A3A3A3A3A3A3A000000000000210008101010C5C5C5C5C5C5C51818
-% 18181818161210101010101012181818181A181812121210181012121018
-% 181818181818181200FF1818121010101012101010121012181818171818
-% 1618121810121210121218181818181818181A1818181010181818101210
-% 1010101018181818181612171210AF101010FF7D00000000000000003A3A
-% 3A3A3A3A3A3A9D3A9D9D9D9D9D3A9D3A9D9D9D9D9D9D9D9D3A9D3A9D3A9D
-% 3A9D3A3A9D3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A9D7F7F1313137F7F3A3A3A3A9D9D3A3A3A9D3A3A3A9D3A
-% 3A3A9D3A3A3A3A3A3A9D3A3A9D3A3A3A9D3A3A3A9D3A3A3A3A9D3A3A3A9D
-% 3A3A3A9D3AFFFF535353FFFF3A9D3A3A9D9D3A3A3A9D9D3A3A3A3A3A3A3A
-% 3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D9D3A
-% 9D3A3A3A9D9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9DFFFF
-% 535353FFFF9D9D9D3A3A3A3A9D3A9D3A9D3A3A3A3A3A9D3A3A9D3A3A9D3A
-% 3A9D3A9D9D9D9D3A9D3A9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 3A3A3A9D9D3A3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A7F7F13
-% 13137F7F3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF535353
-% FFFF3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F7F1313137F7F3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D9D
-% 3A3A3A3A3A3A9D3A9D3A9D9D9D9D3A9D9D9DFFFF535353FFFF9D3A9D3A3A
-% 3A3A3A3A3A3A3A3A000000000000210010101010C5101218181818181818
-% 1118131810101010101012181818181A1818121010101012101010121012
-% 1818181718181600FF181810101010101210101010101216181818181012
-% 101210101010101010101818181818181818181818181818181818101010
-% 10101218181818181818181810AF181210FF7D00000000000000003A3A3A
-% 3A3A3A3A3A9D3A9D9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A7F7F7F9D3A3A3A3A3A9D3A3A3A3A9D3A3A3A9D9D3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A9D3A3A3A3A9D3A3A9D9D3A
-% 3A3A9D3A3A3AFFFFFF3A3A3A9D3A3A9D9D3A3A3A9D9D3A3A9D3A3A3A3A9D
-% 3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D
-% 3A3A3A9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9DFF
-% FFFF9D9D9D9D3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A9D3A9D3A9D9D3A
-% 9D9D9D9D9D9D9D9D9D9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A
-% 9D3A3A9D3A9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F
-% 7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3AFFFFFF3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D
-% 3A3A9D3A3A9D3A9D9D9D3A9D3A9D9D9D9D9D3AFFFFFF3A9D9D3A9D3A3A3A
-% 3A3A3A3A3A3A3A000000000000210012101010C510101818181818181818
-% 181810121010101012161818181A18181810101010101210101010101216
-% 18181818101200FF1818181010080810101010100B0E0A10101618181818
-% 181810181316121612161210121618181818181818161218101818181818
-% 161010101012101010121010AF121818FF7D00000000000000003A3A3A3A
-% 3A3A3A3A9D3A9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D3A3A3A
-% 3A3A9D9D9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A9D7F9D9D9D3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A9D9D9D9D
-% 9D3A3A3A3A9D3A9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A9D9D9D3A3A3A
-% 3A9D9D9DFF3A9D9D3A3A3A3A3A9D3A3A3A3A3A3A9D3A9D9D3A3A3A3A3A3A
-% 3A9D3A7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D9D3A9D3A3A3A
-% 3A9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A9D3A9D9D9D9D9D9D9D9D9D3A9D9D
-% FF9D9D9D9D3A9D3A9D3A9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A9D3A9D9D9D
-% 3A9D9D9D9D3A9D3A3A9D9D9D9D9D3A9D9D9D9D3A9D9D9D3A9D3A9D9D3A3A
-% 9D3A9D3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3AFF3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A3AFF9D9D9D3A9D3A3A3A3A
-% 3A3A3A3A3A3A000000000000210018181618C51010181618181A18181813
-% 10101810181012181818181A18181818181010080810101010100B0E0A10
-% 101618181800FF1818181612101010101010101010101010121818181818
-% 161018101612171218101210121818181818181818101810181818181818
-% 1818101210101210101010AF161818FF7D00000000000000003A3A3A3A3A
-% 3A3A3A9D3A9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D3A3A3A3A
-% 3A9D9D9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A7F7F7F9D9D9D3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A9D9D9D9D9D
-% 3A3A3A3A9D3A9D3A3A3A3A3A3A3A9D9D9D3A3A3A3A3A3A9D9D9D3A3A3A3A
-% 9DFFFFFF3A9D9D3A3A3A3A3A9D3A3A3A3A3A3A9D3A9D9D3A3A3A3A3A3A3A
-% 9D3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D9D3A9D3A3A3A3A
-% 9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A9D3A9D9D9D9D9D9D9D9D9D3A9D9D9D
-% FFFFFF9D3A9D3A9D3A9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A9D3A9D9D9D3A
-% 9D9D9D9D3A9D3A3A9D9D9D9D9D3A9D9D9D9D3A9D9D9D3A9D3A9D9D3A3A9D
-% 3A9D3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3AFFFFFF3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A3A9DFFFFFF3A9D3A3A3A3A3A
-% 3A3A3A3A3A000000000000210018181818C5181818181818181818181810
-% 12101218161216181818181A181818181612101010101010101010101010
-% 1218181800FF181618181818181012101010101010101010121618181818
-% 121812181218121012101210121018181816181810181210121018181818
-% 18121010121012101210AF121818FF7D00000000000000003A3A3A3A3A3A
-% 3A3A9D3A9D9D9D3A9D9D9D9D3A9D9D9D9D9D3A9D3A9D3A9D3A9D9D9D9D9D
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A9D9D9D3A3A3A3A3A9D3A3A3A9D3A3A3A3A9D3A3A9D3A3A9D3AFFFF
-% 535353FFFF3A3A3A3A9D3A9D3A3A3A3A3A9D3A9D9D3A3A3A3A3A3A3A3A9D
-% 7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D9D3A3A3A3A3A9D
-% 9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D3A3A9D9D9D9D9DFFFF53
-% 5353FFFF9D3A9D3A9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D
-% 9D9D9D9D3A9D9D9D3A9D9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D3A3A3A
-% 9D3A9D3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3AFFFF535353FFFF3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A7F7F1313137F7F3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A9D
-% 9D9D9D3A3A9D9D3A9D9D9D9D9D9D9D9D9DFFFF535353FFFF3A3A3A3A3A3A
-% 3A3A3A3A000000000000210018181818C518181818181818181818181813
-% 1618101218181818181A1818181618181818181012101010101010101010
-% 12161800FF1812121618181812161210101010100A0F1010121818181618
-% 171816181618101210101010121018181812161218101010181818181818
-% 121612181018101810AF101216FF7D00000000000000003A3A3A3A3A3A3A
-% 3A9D3A9D9D9D9D3A9D9D9D9D9D3A9D9D9D9D9D9D3A9D3A9D9D9D3A3A9D3A
-% 3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A7F
-% 131313131313137F3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3AFF535353
-% 53535353FF9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A7F13
-% 1313131313137F3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A9D9D3A3A9D9D9D
-% 9D3A9D9D9D9D3A9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D3A9DFF53535353
-% 535353FF3A9D3A9D3A9D3A3A3A3A9D3A9D3A3A3A3A9D3A9D3A9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D
-% 3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A7F131313131313137F9D3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A9D9D3A9D9D9D9D9D3A3A9D9D3AFF53535353535353FF3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A
-% 9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D9D9D3A3A9D
-% 9D9D9D9D3A9D9D9D3A9D9D3A9D9D9DFF53535353535353FF3A3A3A3A3A3A
-% 3A3A3A000000000000210012161818C518181A1818181A18181818181818
-% 18181816181818181818181812121618181812161210101010100A0F1010
-% 121800FF1810101012101216121810121010121010101010121618181818
-% 181818181810101010121010101210121612181018101818181818181816
-% 1218101810181210AF101212FF7D00000000000000003A3A3A3A3A3A3A3A
-% 9D3A9D9D9D9D3A9D9D9D9D9D3A9D9D9D9D9D9D3A9D3A9D9D9D3A3A9D3A3A
-% 3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A7F13
-% 1313131313137F3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353
-% 535353FF9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A7F1313
-% 13131313137F3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A9D9D3A3A9D9D9D9D
-% 3A9D9D9D9D3A9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D3A9DFF5353535353
-% 5353FF3A9D3A9D3A9D3A3A3A3A9D3A9D3A3A3A3A9D3A9D3A9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A
-% 3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A7F131313131313137F9D3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A9D9D3A9D9D9D9D9D3A3A9D9D3AFF53535353535353FF3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A9D
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D9D9D3A3A9D9D
-% 9D9D9D3A9D9D9D3A9D9D3A9D9D9DFF53535353535353FF3A3A3A3A3A3A3A
-% 3A3A000000000000210012121818C518181818181818181A181818181818
-% 181818181818181818181810101012101216121810121010121010101010
-% 1200FF181612101010101210121612101216101010101210121818181818
-% 181818181612101010101210121012101216121818181818181612101210
-% 12101210121010AF101010FF7D00000000000000003A3A3A3A3A3A3A3A9D
-% 3A9D9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A7F131313
-% 1313131313137F3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF535353535353
-% 535353FF3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A7F13131313
-% 13131313137F3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A9D3A3A9D9D9D9D9D
-% 9D9D3A9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9DFF53535353535353
-% 5353FF3A9D9D3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A9D9D3A9D9D9D3A
-% 9D9D3A9D3A9D9D9D3A9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D3A9D3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F1313131313131313137F3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9DFF535353535353535353FF3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D9D3A3A9D9D3A3A
-% 9D3A3A3A9D9D9D9D9D9D3A9DFF535353535353535353FF3A3A3A9D3A3A3A
-% 3A000000000000210010101218C518181818181818181818181A18181818
-% 181818181818181818181612101010101210121612101216101010101210
-% 00FF18181816101010101012101210181216121010101012161818181818
-% 181818121810101010101010121012101810181818181818181210101210
-% 121012101210AF100F10FF7D00000000000000003A3A3A3A3A9D3A3A9D3A
-% 9D9D9D3A3A9D9D9D9D9D9D3A9D9D3A9D9D9D9D3A9D9D9D3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A7F13131313
-% 13131313137F3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3AFF53535353535353
-% 5353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313
-% 131313137F3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D3A9D9D9D9D9D9D
-% 9D9D9D9D9D3A9D9D9D9D9D3A9D9D3A9D3A9D9D9D9DFF5353535353535353
-% 53FF3A9D3A3A9D3A9D3A3A3A3A3A3A3A9D3A3A9D3A9D9D9D9D9D9D9D3A9D
-% 9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D3A9D9D3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A9D7F1313131313131313137F3A3A3A9D3A
-% 3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A9D3A9D3A9D3A9D9D9D9D9D9D3A
-% 9D3A9D3A9D3A9D3A3A3A9D3AFF535353535353535353FF3A9D3A9D3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A7F1313131313131313137F9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D9D9D3A9D9D3A
-% 9D3A9D3A9D9D9D9D9D9D9DFF535353535353535353FF3A3A3A3A3A3A3A3A
-% 00000000000021000F101010C5101818181818181A18181A181A18181818
-% 181818181818181818181816101010101012101210181216121010101000
-% FF1818181818121010101010101818181810101010101012181818181818
-% 181818181012101010121010101012101818101818181818181612101010
-% 1210101010AF100A10FF7D00000000000000003A3A3A3A3A9D3A3A9D3A9D
-% 9D9D3A3A9D9D9D9D9D9D3A9D9D3A9D9D9D9D3A9D9D9D3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A7F1313131313
-% 131313137F3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3AFF5353535353535353
-% 53FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313
-% 1313137F3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D3A9D9D9D9D9D9D9D
-% 9D9D9D9D3A9D9D9D9D9D3A9D9D3A9D3A9D9D9D9DFF535353535353535353
-% FF3A9D3A3A9D3A9D3A3A3A3A3A3A3A9D3A3A9D3A9D9D9D9D9D9D9D3A9D9D
-% 9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D3A9D9D3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D7F1313131313131313137F3A3A3A9D3A3A
-% 3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A9D3A9D3A9D3A9D9D9D9D9D9D3A9D
-% 3A9D3A9D3A9D3A3A3A9D3AFF535353535353535353FF3A9D3A9D3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A7F1313131313131313137F9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D9D9D3A9D9D3A9D
-% 3A9D3A9D9D9D9D9D9D9DFF535353535353535353FF3A3A3A3A3A3A3A3A00
-% 000000000021000A101010C510121018181818181A181A18201818181818
-% 1818181818181818181818181210101010101018181818101010101000FF
-% 1818181810101010101012181816181818181818181818181A1818181810
-% 101816181818181216101210121018101210101018181810121010121010
-% 10121010AF100A08FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D
-% 9D9D9D3A9D9D3A3A9D9D9D9D3A9D9D9D9D9D3A9D9D9D3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313
-% 13137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3AFF53535353535353FF
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313
-% 137F3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D3A9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D3A3A9D9D9D9D9D9D9D9D9D9D3A9DFF53535353535353FF9D
-% 9D9D9D9D9D3A9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D3A9D9D3A
-% 9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D3A9D9D9D9D9D3A3A9D3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A9D3A9D3A3A3A3A9D3A3A9D3A9D3A9D9D9D3A3A9D9D9D3A
-% 9D9D9D9D3A9D3A9D9D9D3AFF53535353535353FF3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A9D3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D9D
-% 9D9D3A9D9D9D3A9D9D9DFF53535353535353FF3A3A3A3A3A3A3A3A3A0000
-% 0000000021000A081010C510101012161818181818181A18181818101012
-% 10181018161818181818101010101010121818161818181818181800FF16
-% 181818101012081010101012181818181818181818181A181A1818161212
-% 181818181818161210121010121216181010121010101212161218101210
-% 101012AF101010FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D
-% 3A9D3A9D9D3A9D3A3A3A9D9D9D3A9D9D9D9D3A9D9D3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A7F131313131313
-% 137F3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13131313131313
-% 7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D3A9D9D9D3A9D
-% 9D9D9D3A9D9D9D9D9D3A9D9D9D9D9D9D9D9D9DFF53535353535353FF3A9D
-% 9D3A9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D9D9D9D3A3A9D9D9D9D
-% 3A9D9D9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A9D9D9D9D3A3A9D9D3A9D9D9D
-% 9D3A9D9D9D3A9D9D9D3AFF53535353535353FF3A3A3A3A3A9D3A3A9D9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A9D9D9D3A3A
-% 3A9D3A9D3A3A9D3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D9D9D9D9D
-% 9D3A9D9D9D9D9D9D9DFF53535353535353FF3A3A9D3A3A3A3A3A3A000000
-% 000000210010101010C5101010101218181818181A181818181810121012
-% 101210121216181818101012081010101012181818181818181800FF1210
-% 18121612100E0A081010101818181A18181A181818181818181812101018
-% 181818181818181010181318161818121010101010101018181618181018
-% 1216AF101010FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D3A
-% 9D3A9D9D3A9D3A3A3A9D9D9D3A9D9D9D9D3A9D9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A7F7F1313137F7F
-% 3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF535353FFFF3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D3A9D9D9D3A9D9D
-% 9D9D3A9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9DFFFF535353FFFF3A3A9D9D
-% 3A9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D9D9D9D3A3A9D9D9D9D3A
-% 9D9D9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A9D9D9D9D3A3A9D9D3A9D9D9D9D
-% 3A9D9D9D3A9D9D9D3A3AFFFF535353FFFF9D3A3A3A3A3A9D3A3A9D9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A9D9D9D3A3A3A
-% 9D3A9D3A3A9D3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D9D9D9D9D9D
-% 3A9D9D9D9D9D9D9D9DFFFF535353FFFF3A3A3A9D3A3A3A3A3A3A00000000
-% 0000210010101010C5100E1010121018181818181A181818181012161210
-% 18101210121018121612100E0A081010101818181A18181A1800FF101210
-% 181818181010100A1010181818181818181818181A181818181010121012
-% 101818181810181218161818181816181010101010121818181816181216
-% 18AF121010FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D
-% 3A9D3A3A9D9D3A9D3A9D3A9D9D3A9D9D9D9D3A3A9D3A9D3A3A3A3A3A3A9D
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A7F7F7F7F3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFFFF3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A7F7F7F3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D3A9D9D9D9D9D9D9D9D9D9D3A
-% 9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D9DFFFFFF9D3A9D9D3A9D9D
-% 9D9D3A9D9D3A9D3A9D3A3A3A3A3A3A3A3A3A9D9D3A9D9D9D9D3A9D9D9D9D
-% 3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A9D3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D9D9D3A9D9D9D9D9D3A9D9D3A3A3A
-% 9D3A3A3A9D3A9D9D9D3AFFFFFFFF3A3A9D3A3A3A3A3A3A9D9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F7F3A3A3A9D3A3A3A9D3A3A3A9D3A9D
-% 3A9D3A9D3A9D3A9D3A3A3A9D3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D3A9D9D
-% 9D9D3A9D9D9D3A3A3A9DFFFFFF3A9D3A3A3A3A3A3A3A3A3A3A0000000000
-% 00210010101010C510101010101212101818181818181818181810181112
-% 101610101210181818181010100A1010181818181818181800FF10101010
-% 12101818181010101218181818181818181818181A181818101210101010
-% 121012101018101818181818181818181818181010181218101212101218
-% AF101810FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D
-% 3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F9D3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3AFF3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D9D9D3A9D3A
-% 9D9D3A9D3A9D3A9D9D3A3A9D3A9D9D9D9D9D9D9D9DFF9D9D9D3A9D3A9D3A
-% 9D9D3A9D9D3A9D3A3A3A3A3A3A3A3A9D3A3A9D9D9D3A9D9D9D9D9D3A9D9D
-% 9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A7F3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A9D3A3A9D9D3A9D9D9D9D9D9D3A9D3A9D9D9D9D
-% 9D9D9D9D9D9D9D9D9DFF3A9D9D9D3A9D3A3A3A3A3A3A9D3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A9D3A7F3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A
-% 9D3A9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D3A9D3A9D9D
-% 9D9D9D3A9D9D3A9D9D9D3AFF3A9D3A3A3A9D3A3A3A3A3A3A000000000000
-% 210018101210C51010101010101012181818181818181018101812181018
-% 121010101010121018181810101012181818181818181800FF1012101010
-% 101218181810121618181818181818181818181818181012101010101010
-% 1012101212101810181818181818181A18181812161216121010101012AF
-% 181012FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D3A
-% 3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F9D3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3AFF3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D9D9D3A9D3A9D
-% 9D3A9D3A9D3A9D9D3A3A9D3A9D9D9D9D9D9D9D9D9DFF9D9D3A9D3A9D3A9D
-% 9D3A9D9D3A9D3A3A3A3A3A3A3A3A9D3A3A9D9D9D3A9D9D9D9D9D3A9D9D9D
-% 3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A7F3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A9D3A3A9D9D3A9D9D9D9D9D9D3A9D3A9D9D9D9D9D
-% 9D9D9D9D9D9D9D9DFF3A9D9D9D3A9D3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A9D3A7F3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A9D
-% 3A9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D3A9D3A9D9D9D
-% 9D9D3A9D9D3A9D9D9D3A9DFF9D3A3A3A9D3A3A3A3A3A3A00000000000021
-% 0010121010C5101010101012101012121818161210101212161216181818
-% 1210121010101012181818101216181818181818181800FF181012101010
-% 0E1816121810181618161818161818181818181818121012101010101218
-% 18181210101212161218161818181818181818181818181018121010AF10
-% 1216FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D3A9D9D9D9D3A
-% 3A9D9D3A3A9D3A3A3A9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A9D3A3A3A3A9D
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A7F7F7F7F3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3AFFFFFF3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A9D3A3A7F7F7F9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D9D9D9D9D3A9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFFFFFF9D9D9D9D9D9D9D
-% 9D9D9D9D9D3A9D3A3A3A9D3A3A3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D3A9D9D9D9D3A9D9D3A9D9D9D9D9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A7F7F7F3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D9D3A9D9D9D3A9D9D3A9D9D3A3A3A9D3A9D3A9D
-% 3A9D9D9DFFFFFFFF3A9D3A9D3A9D3A3A3A3A3A9D3A3A9D9D3A3A3A9D3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A7F7F7F7F9D3A3A9D9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D9D9D9D3A9D9D3A9D3A9D
-% 3A9D9D3A9D9D9D9D9D9DFFFFFF3A3A3A3A3A3A3A3A3A0000000000002100
-% 12161210C510101010101012101210121012101010101012181818181818
-% 1810121010100E181612181018161816181816181800FF181810100A100A
-% 101010101812121218181818181818181818181810101010101216181818
-% 18181012101012161218181210101018181818181818181818180AAF1012
-% 16FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D3A3A3A
-% 9D9D9D3A9D3A9D3A3A9D3A9D9D9D3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A7F7F1313137F7F3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3AFFFF535353FFFF3A3A3A3A3A9D3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D9D9D3A9D9D9D9D9D9D9D3A3A9D9D
-% 3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFFFF535353FFFF3A9D3A9D9D9D
-% 3A9D3A9D9D3A9D3A3A3A3A3A9D3A9D9D9D9D9D9D3A9D9D3A9D3A9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A7F7F1313137F7F3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A9D3A3A3A3A3A3A9D9D3A9D9D9D9D9D3A9D3A3A9D9D9D9D9D9D9D9D3A
-% 3AFFFF535353FFFF9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A9D9D9D3A9D3A3A9D3A9D9D9D
-% 9D3A9D3A9D3A9DFFFF535353FFFF3A3A3A3A3A3A3A000000000000210012
-% 161210C5101010101010101010101012101010101010121018181A181A18
-% 1810100A100A101010101812121218181818181800FF181818101010100B
-% 101012101818181818181818181010181216121012101010101218181818
-% 181A181812161218181210181818181818181816121816181818AF101210
-% FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D3A3A3A9D
-% 9D9D3A9D3A9D3A3A9D3A9D9D9D3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A7F131313131313137F3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3AFF53535353535353FF3A3A3A3A9D3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D9D9D3A9D9D9D9D9D9D9D3A3A9D9D3A
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF53535353535353FF9D3A9D9D9D3A
-% 9D3A9D9D3A9D3A3A3A3A3A9D3A9D9D9D9D9D9D3A9D9D3A9D3A9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A7F131313131313137F3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A9D3A3A3A3A3A3A9D9D3A9D9D9D9D9D3A9D3A3A9D9D9D9D9D9D9D9D3AFF
-% 53535353535353FF9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A7F131313131313137F3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A9D9D9D3A9D3A3A9D3A9D9D9D9D
-% 3A9D3A9D3AFF53535353535353FF3A3A3A3A3A3A00000000000021001210
-% 1818C5101216121818181810101210101210101010101218181818181818
-% 18101010100B1010121018181818181818181800FF181818101210101010
-% 101012101210181818181818181211181012101012101010101818181818
-% 18181210121018181012101218101818181818121012121018AF181012FF
-% 7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D3A9D3A3A9D3A3A3A3A
-% 9D9D3A3A3A3A9D3A3A9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A9D9D3A3A9DFF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A9D
-% 3A9D3A3A3A3A3A3A9D3A9D3A3A9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D
-% 3A9D9D3A9D9D9D9D9D3A9D9D9D9DFF53535353535353FF9D9D9D3A9D9D9D
-% 9D9D9D9D9D9D9D3A3A3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D
-% 3A9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D9D9D9D3A9D9D3A9D9D9D3A9D9D9D9D3A9D9D3A3A9D3A9DFF53
-% 535353535353FF9D3A9D9D9D3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A7F131313131313137F3A9D9D9D9D3A3A3A3A9D3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D9D3A9D9D9D9D9D3A9D3A9D
-% 3A9D3A9DFF53535353535353FF3A3A3A3A3A3A0000000000002100101216
-% 12C518181818181818181218161812101010101010101012181818181818
-% 10121010101010101210121018181818181800FF16181216121012101010
-% 121010101018181818181818181812161216121012101218181818181A18
-% 181010101010101010101010121012101210101010101018AF121012FF7D
-% 00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D9D3A3A3A9D
-% 9D9D3A3A3A3A3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A9D9D9D9D9DFF535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F1313131313131313137F3A3A3A3A
-% 3A3A9D3A3A3A3A9D3A9D3A3A9D3A9D9D9D9D9D9D3A9D3A9D3A9D9D9D9D9D
-% 3A9D9D9D9D9D9D9D9D9D9D9DFF535353535353535353FF3A9D9D9D3A9D9D
-% 9D9D9D9D9D3A9D3A3A3A3A9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D3A9D9D9D
-% 9D3A9D9D9D3A9D9D9D9D9D9D9D3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A7F
-% 1313131313131313137F3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D3A3A9D9D9DFF535353
-% 535353535353FF9D9D9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A9D3A9D3A9D3A3A9D9D9D3A9D9D9D9D3A9D9D3A9D9D9D9D3A
-% 3A9DFF535353535353535353FF3A3A3A3A3A000000000000210010121018
-% C51316181818181818181818181618181818101010101010181816181216
-% 121012101010121010101018181818181800FF1812161218101012101210
-% 10101010101218181818181818101812101210101217181A18181A181818
-% 1810101010101010101010101010101818121810101012AF121010FF7D00
-% 000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D9D3A3A3A9D9D
-% 9D3A3A3A3A3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A9D9D9D9D9DFF535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F1313131313131313137F3A3A3A3A3A
-% 3A9D3A3A3A3A9D3A9D3A3A9D3A9D9D9D9D9D9D3A9D3A9D3A9D9D9D9D9D3A
-% 9D9D9D9D9D9D9D9D9D9D9DFF535353535353535353FF3A9D9D9D3A9D9D9D
-% 9D9D9D9D3A9D3A3A3A3A9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D3A9D9D9D9D
-% 3A9D9D9D3A9D9D9D9D9D9D9D3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A7F13
-% 13131313131313137F3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D3A3A9D9D9DFF53535353
-% 5353535353FF9D9D9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A9D3A9D3A9D3A3A9D9D9D3A9D9D9D9D3A9D9D3A9D9D9D9D3A3A
-% 9DFF535353535353535353FF3A3A3A3A3A000000000000210010101216C5
-% 18181818181818181A181818121818181818121010101012181812161218
-% 1010121012101010101010121818181800FF101018111818181818181818
-% 1818181818181818181818181818111810101218181818181A181A181818
-% 16101010101010101010101010181718181816121010AF101210FF7D0000
-% 0000000000003A3A3A3A3A3A3A3A9D3A9D9D9D3A9D9D9D9D3A9D9D3A9D9D
-% 3A9D3A9D3A9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A9D3A7F1313131313131313137F3A3A3A3A9D3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D
-% 9D9D9D9D9DFF535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D
-% 9D9D3A9D9D9D9D9D9D9DFF535353535353535353FF9D9D9D9D9D9D3A9D9D
-% 3A9D9D9D9D3A9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D
-% 9D3A9D9D9D9D9D9D9D9D9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A7F1313
-% 131313131313137F3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D
-% 3A9D9D3A3A3A9D9D9D9D9D3A9D3A9D9D3A9D3A3A9D3A9D3AFF5353535353
-% 53535353FF3A3A3A9D3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F1313131313131313137F3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A9D9D3A3A9D9D9D3A9D3A9D9D9D9D9D3A9D9D9D
-% FF535353535353535353FF3A3A3A3A3A000000000000210012101210C516
-% 181818181818181818181010121018181818181818101012101018111818
-% 18181818181818181818181818181800FF12181018101818101818181818
-% 1A1818181818181A18181818161818131810181818181A18181818181818
-% 181012101010101010101010181818AFAFAFAFAFAFAF161816FF7D000000
-% 00000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D9D9D9D3A9D9D3A9D
-% 9D3A3A3A3A9D9D9D3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 9D3A3A3A9D3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A9D9D9D9D9D9D9D9D9D
-% 9D9D9D3A3AFF53535353535353FF9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D9D9D3A3A9D9D9D9D9D9D9D3A9D9D9D3A9D9D9D3A9D9D9D3A9D
-% 9D9D9D9D3A9D9D9D9D9DFF53535353535353FF9D9D9D9D3A9D3A9D9D9D9D
-% 9D3A9D3A9D9D3A3A9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D9D3A9D9D
-% 9D9D9D9D9D9D3A9D9D9D3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A7F1313
-% 13131313137F3A3A3A3A3A9D3A3A9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 9D9D9D9D9D3A9D3A9D3A9D9D3A3A3A3A3A3A3A9D3A9D9D3AFF5353535353
-% 5353FF9D9D9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A7F131313131313137F3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D3A9D9D3A9D9D9D9D3A9D9D9D9D9D9D
-% FF53535353535353FF3A3A3A3A3A3A000000000000210018161216C51812
-% 18161818161818121012101012101818181A181810101012181018101818
-% 1018181818181A1818181818181A00FF1810121812161218101818181818
-% 181818181A18181818181818181810181018181818181818181818181818
-% 1018101210101010101010121210121818181810AF181818FF7D00000000
-% 000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D9D9D9D3A9D9D3A9D9D
-% 3A3A3A3A9D9D9D3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D
-% 3A3A3A9D3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A9D9D9D9D9D9D9D9D9D9D
-% 9D9D3A3AFF53535353535353FF9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D9D9D3A3A9D9D9D9D9D9D9D3A9D9D9D3A9D9D9D3A9D9D9D3A9D9D
-% 9D9D9D3A9D9D9D9D9DFF53535353535353FF9D9D9D9D3A9D3A9D9D9D9D9D
-% 3A9D3A9D9D3A3A9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D9D3A9D9D9D
-% 9D9D9D9D9D3A9D9D9D3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A7F131313
-% 131313137F3A3A3A3A3A9D3A3A9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A9D
-% 9D9D9D9D3A9D3A9D3A9D9D3A3A3A3A3A3A3A9D3A9D9D3AFF535353535353
-% 53FF9D9D9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A7F131313131313137F3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D9D9D9D9D3A9D9D3A9D9D9D9D3A9D9D9D9D9D9DFF
-% 53535353535353FF3A3A3A3A3A3A000000000000210018181812C5101210
-% 181218181810101810181010121218181818181810121810121812161218
-% 101818181818181818181A181800FF171816121610121612101818181818
-% 18181A18181818181818181818181018181818181A181818101812181810
-% 12101810121012101010101010101012181812AF181818FF7D0000000000
-% 0000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D9D9D3A9D9D3A9D9D3A9D
-% 3A3A3A3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D3A9D9D9D
-% 9D3A9D9DFFFF535353FFFF9D9D3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A3A3A9D3A3A
-% 3A9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D3A9D9D9D9DFFFF535353FFFF9D9D9D3A9D9D9D9D9D9D3A9D9D9D
-% 9D9D9D3A9D3A9D9D9D9D3A9D9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D3A
-% 9D9D3A9D9D9D9D9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313
-% 137F7F3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A9D3A9D9D9D3A
-% 9D9D9D3A9D3A9D9D9D3A9D9D9D9D3A9D3A9D3A9D3A9D9DFFFF535353FFFF
-% 9D9D9D3A9D3A9D9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A
-% 3A3A3A9D3A9D3A3A9D9D9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF
-% FF535353FFFF3A3A3A3A3A3A3A000000000000210018181816C510121012
-% 101216121818181818181010101012101818161818171816121610121612
-% 10181818181818181A18181800FF18181818121010101010121618181818
-% 181818181A1818181A181818181818181818181818181818181010101012
-% 101818181010101010101010101010181810AF181018FF7D000000000000
-% 00003A3A3A3A3A3A3A3A9D3A9D9D3A9D9D9D9D9D3A9D9D3A9D3A9D9D9D9D
-% 3A3A9D9D9D9D3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A7F7F7F3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D9D9D9D3A9D9D3A3A9D9D9D3A
-% 3A9D9D9D3AFFFFFF3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D3A9D
-% 9D9D9D9D9D3A9D3A9D9DFFFFFF9D9D3A9D9D9D9D9D3A3A9D9D9D9D9D9D9D
-% 9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D9D9D3A9D9D
-% 9D9D9D9D3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F
-% 3A3A3A3A9D3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D
-% 3A3A9D9D9D9D9D9D3A9D3A3A9D3A3A3A3A3A9D3A3A3A9D3AFFFFFF9D9D3A
-% 9D9D3A9D3A9D3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F7F7F3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A9D9D9D9D9D9D9D3A3A9D9D9D9D9D3A3A9D3A3A3A9D9D9D9D
-% FFFFFF3A3A3A3A3A3A3A3A3A000000000000210010181318C51010101012
-% 101210101210181818181818121012101018181818181818121010101010
-% 121618181818181818181A00FF1012181010101010101010101218181818
-% 1818181818181A181A181818181818181818181818181818101210101010
-% 1812101810121010101010121012181818AF181618FF7D00000000000000
-% 003A3A3A3A3A3A3A3A9D3A9D9D3A9D9D9D9D9D3A9D9D3A9D3A9D9D9D9D3A
-% 3A9D9D9D9D3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A7F3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D9D9D9D3A9D9D3A3A9D9D9D3A3A
-% 9D9D9D3AFF3A9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D3A9D9D
-% 9D9D9D9D3A9D3A9D9D3A9D9DFF9D3A9D9D9D9D9D3A3A9D9D9D9D9D9D9D9D
-% 9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D9D9D3A9D9D9D
-% 9D9D9D3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D3A
-% 3A9D9D9D9D9D9D3A9D3A3A9D3A3A3A3A3A9D3A3A3A9D3AFF3A9D9D9D3A9D
-% 9D3A9D3A9D3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A7F3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A9D9D9D9D9D9D9D3A3A9D9D9D9D9D3A3A9D3A3A3A9D9D9D9D3A
-% 9DFF3A3A3A3A3A3A3A3A3A000000000000210016181618C5121012101012
-% 101012101210121818181818101012121218121012181010101010101010
-% 1012181818181818181800FF121010101010081010101010101010121816
-% 1818181A181A181818181817181818181818181818181818101010101010
-% 10121012101018101010101012181818AF181818FF7D0000000000000000
-% 3A3A3A3A3A3A3A3A9D3A9D9D3A9D3A9D3A3A9D3A3A9D3A9D9D9D9D9D3A3A
-% 3A9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A7F3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D9D9D3A3A9D9D9D9D9D9D
-% 9D9DFF9D3A9D3A3A9D9D3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A
-% 9D9D3A9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D3A9D3A3A3A9D9DFF3A9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D
-% 9D9D9D3A9D9D9D9D9D9D3A9D9D3A3A9D9D9D3A9D9D9D9D9D9D9D9D3A9D9D
-% 3A9D9D9D9D9D3A3A9D3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A7F3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A9D3A3A3A3A9D3A9D9D3A3A
-% 9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D3A3A9DFF3A3A9D9D3A3A9D3A
-% 3A9D3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A9D3A7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A9D9D3A9D3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A9D9D9D3A9D
-% FF3A3A3A3A9D3A3A3A3A000000000000210018181818C518181810181010
-% 1210101210101012101818C5C5C5C51010101210C5C51010081010C5C5C5
-% C5C51012181618181800FF101012101010100A0F0A101010101010101216
-% 18181820181A181818181818121618181818181818181812101010101010
-% 101010181818181712101816181818AF181818FF7D00000000000000003A
-% 3A3A3A3A3A3A3A9D9D9D9D3A9D9D9D9D3A3A9D9D3A9D3A9D9D3A9D3A3A3A
-% 9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A9D9D9D9D9D3A3A9D3A9D9D9D9D9D9D3A9D9D9D
-% 3AFF3A9D3A9D9D3A3A9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A9D3A7F3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D
-% 3A3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D3A9D9D9D9D9D9D9D
-% 9D9D9D9D3A9D9D9D3A9DFF9D9D9D3A9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D
-% 9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D9D
-% 9D9D3A9D9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A9D3A
-% 3A3A3A9D3A3A3A3A3A3A9D9D3A3A9D3A3A3A3A3A9D3A9D9D9D3A9D9D9D9D
-% 3A9D3A9D9D3A3A3A3A3A3A9D9D9D3A9D9D3A3A3AFF9D9D3A9D9D9D9D9D3A
-% 9D9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D7F3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A9D9D3A9D3A9D9D9D3A9D3A3A3A3A9D3A3A3A3A9D3A3A9D3A9D3A
-% FF3A3A3A3A3A3A3A3A000000000000210018181818C51818181812101210
-% 101210121012101012C5C51618C5C510101010C5C51010100A0F0A10C5C5
-% 101010101216181800FF10121010101010100A1010080A10081010101818
-% 181A18181818181818101810181217181818181818181010101010101010
-% 1012181818181818181818181818AF181818FF7D00000000000000003A3A
-% 3A3A3A3A3A3A9D9D9D9D3A9D9D9D9D3A3A9D9D3A9D3A9D9D3A9D3A3A3A9D
-% 9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A9D9D9D9D9D3A3A9D3A9D9D9D9D9D9D3A9D9DFFFF
-% FF3A9D3A9D9D3A3A9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A9D3A7F7F7F3A3A3A3A3A3A9D3A3A3A3A9D3A9D3A
-% 3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D3A9D9D9D9D9D9D9D9D
-% 9D9D9D3A9D9D9D3A9D9DFFFFFF3A9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D9D
-% 3A9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D9D9D
-% 9D3A9D9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A9D3A3A
-% 3A3A9D3A3A3A3A3A3A9D9D3A3A9D3A3A3A3A3A9D3A9D9D9D3A9D9D9D9D3A
-% 9D3A9D9D3A3A3A3A3A3A9D9D9D3A9D9D3AFFFFFF9D9D3A9D9D9D9D9D3A9D
-% 9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D7F7F7F3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A9D9D3A9D3A9D9D9D3A9D3A3A3A3A9D3A3A3A3A9D3A3A9D3A9D3AFF
-% FFFF3A3A3A3A3A3A000000000000210018181816C5181818181612161012
-% 1010101010101010C5C51818C5C518181012101010101010C5C5C5C5C5C5
-% 0810101018181800FF181216121818181010101010081008101010121818
-% 18181A18181818181810121010181812181812161216121010100A101010
-% 12181818181818181818181A18AF181818FF7D00000000000000003A3A3A
-% 3A3A3A3A3A9D3A9D9D3A9D3A9D9D3A3A9D9D3A3A3A9D9D9D9D3A3A9D3A9D
-% 9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F13
-% 13137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D9D9D9D9D3A3A9D9D9D3A9D9D9D9D3AFFFF535353
-% FFFF9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A9D3A3A9D3A9D3A9D
-% 9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D3A
-% 9D3A9D9D9D3A9DFFFF535353FFFF9D9D9D3A9D9D9D9D9D9D9D3A9D3A3A9D
-% 3A9D3A9D9D9D9D9D3A9D3A9D9D3A9D9D9D3A9D9D9D9D3A9D9D9D9D3A9D9D
-% 9D9D9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D3A9D9D9D9D9D
-% 9D9D9D9D3A3A9D3A3A9D3A3A9D9DFFFF535353FFFF9D9D9D9D3A9D9D9D9D
-% 3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F
-% 7F1313137F7F3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A
-% 3A3A9D9D3A9D9D9D3A9D9D3A9D3A9D3A3A9D3A3A9D3A9D9D3A3AFFFF5353
-% 53FFFF3A3A3A3A000000000000210018181812C5C5C5C5C5C5C5C5C5C5C5
-% C5C51212161210C5C51818C5C518181812161218181810C51010C5C51008
-% 10101012181800FF18161210181618101210101010080A10101010101818
-% 181818181817121012161218101210101010121018121012101010101012
-% 181818181A18181818181818AF181818FF7D00000000000000003A3A3A3A
-% 3A3A3A3A9D9D9D9D9D9D9D9D3A9D9D3A9D9D3A9D9D9D9D9D3A3A3A3A9D9D
-% 3A9D3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A7F13131313
-% 1313137F3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A9D3A9D3A9D3A9D3A9D9D3A9D9D9D3A3A9D9D9D9DFF535353535353
-% 53FF9D9D9D9D9D3A9D9D9D3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A9D3A9D3A3A9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A
-% 9D9D3A9D3AFF53535353535353FF9D3A9D9D3A9D9D3A9D3A9D3A9D3A3A9D
-% 3A9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D
-% 9D9D3A3A3A9D3A3A3A9D3A3A3A9D3A7F131313131313137F3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A9D9D3A3A3A9D3A3A3A3A3A3A9D3A9D3A9D9D9D3A9D9D9D
-% 9D3A9D3A9D3A9D9D9D3A9D9DFF53535353535353FF9D3A9D9D9D3A9D9D3A
-% 9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F1313
-% 13131313137F3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D
-% 9D3A9D9D3A9D9D3A9D9D9D3A3A9D3A9D9D9D3A9D9D3A9D9DFF5353535353
-% 5353FF3A3A3A000000000000210018181010C51818171818101810181018
-% 181818181818C5C51012C5C51618181612101816181012C510C5C5080A10
-% 101010101800FF1012101012181818181012101010101010101218181818
-% 181818181812101218121012101210121010181216121010101010101018
-% 18181A181A18181A181A18AF181810FF7D00000000000000003A3A3A3A3A
-% 3A3A3A9D9D9D9D9D9D9D9D3A9D9D3A9D9D3A9D9D9D9D9D3A3A3A3A9D9D3A
-% 9D3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A7F1313131313
-% 13137F3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A9D3A9D3A9D3A9D3A9D9D3A9D9D9D3A3A9D9D9D9DFF53535353535353
-% FF9D9D9D9D9D3A9D9D9D3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A9D3A9D3A3A9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D
-% 9D3A9D3AFF53535353535353FF9D3A9D9D3A9D9D3A9D3A9D3A9D3A3A9D3A
-% 9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D
-% 9D3A3A3A9D3A3A3A9D3A3A3A9D3A7F131313131313137F3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A9D9D3A3A3A9D3A3A3A3A3A3A9D3A9D3A9D9D9D3A9D9D9D9D
-% 3A9D3A9D3A9D9D9D3A9D9DFF53535353535353FF9D3A9D9D9D3A9D9D3A9D
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F131313
-% 131313137F3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D9D
-% 3A9D9D3A9D9D3A9D9D9D3A3A9D3A9D9D9D3A9D9D3A9D9DFF535353535353
-% 53FF3A3A3A000000000000210018101210C5101812181012181818181818
-% 18181A1818C5C51210C5C5121810121010121818181810C5C5C510101010
-% 1012181800FF181012101210101012101210100A08101010101012101218
-% 101810121010101010181818181010101010101210121810181012121818
-% 181A1818181818181818AF181010FF7D00000000000000003A3A3A3A3A3A
-% 3A3A9D3A9D9D3A9D3A9D9D9D3A9D3A3A9D3A9D9D3A9D9D3A9D3A9D9D3A9D
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13131313131313
-% 13137F3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A9D9D9D9D9D9D9D3A9D9D9D9D3A3A9D9D9DFF535353535353535353
-% FF9D9D9D3A3A9D9D3A9D9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A9D3A3A3A9D3A9D9D
-% 3A9D9D9D9D3A9D9D9D3A9D3A9D9D3A9D9D9D9D3A9D9D9D9D9D3A9D9D3A3A
-% 9D9DFF535353535353535353FF9D9D9D9D9D9D3A9D3A9D3A3A3A3A3A9D3A
-% 9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D3A9D9D9D
-% 3A3A3A9D3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A
-% 3A3A9D3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A9D9D9D3A3A3A3A9D9D9D9D9D
-% 3A9D9D3A3A3A9D3A9DFF535353535353535353FF9D9D9D3A3A9D3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A7F1313131313
-% 131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A9D
-% 9D9D9D9D9D9D3A9D9D9D3A3A9D3A3A9D9D3A9D9D9DFF5353535353535353
-% 53FF3A3A000000000000210010101010C510101010121010101012101818
-% 18181818C5C51818C5C5101818101210121010101210C5C5C50A08101010
-% 10101200FF18181810101010121012161010101010101010101010121012
-% 121010101010101018181818181810181010101012101816121816181818
-% 181818181818181818AF181010FF7D00000000000000003A3A3A3A3A3A3A
-% 3A9D3A9D9D9D9D9D9D3A3A3A9D3A9D9D3A9D9D9D3A3A3A3A9D9D3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F1313131313131313
-% 137F3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A9D3A9D9D9D9D9D9D3A9D9D9D9DFF535353535353535353FF
-% 9D3A9D3A9D3A3A9D9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A9D3A9D3A9D9D9D9D9D
-% 9D9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D3A
-% 9DFF535353535353535353FF3A3A9D3A9D3A3A3A9D3A9D9D3A3A3A9D3A3A
-% 9D9D9D9D9D9D9D3A9D3A9D9D3A9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D9D3A
-% 3A3A9D3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A9D
-% 3A9D3A9D3A9D3A3A3A3A3A3A3A3A9D9D9D3A9D9D9D9D3A9D9D3A9D9D9D9D
-% 3A3A9D9D3A3A9D9DFF535353535353535353FF9D3A9D9D9D9D3A9D3A9D9D
-% 3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A7F131313131313
-% 1313137F3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D3A9D3A9D
-% 9D9D9D9D3A3A9D9D9D9D3A3A3A3A3A3A9D3A9D9DFF535353535353535353
-% FF3A3A000000000000210010101010C51010101012101210121018181718
-% 18161818C5C5C5C51818181818181010101012101216C5C5101010101010
-% 101000FF1818171818181810101210121010101010101010101010101010
-% 101010081010101218181818181818101010101010181212161818181A16
-% 1818181816181818AF101210FF7D00000000000000003A3A3A3A3A3A3A3A
-% 9D3A9D9D9D9D9D9D3A3A3A9D3A9D9D3A9D9D9D3A3A3A3A9D9D3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F131313131313131313
-% 7F3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A9D3A9D9D9D9D9D9D3A9D9D9D9DFF535353535353535353FF9D
-% 3A9D3A9D3A3A9D9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A7F1313131313131313137F3A3A3A3A3A3A3A9D3A9D3A9D9D9D9D9D9D
-% 9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D3A9D
-% FF535353535353535353FF3A3A9D3A9D3A3A3A9D3A9D9D3A3A3A9D3A3A9D
-% 9D9D9D9D9D9D3A9D3A9D9D3A9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D9D3A3A
-% 3A9D3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A9D3A
-% 9D3A9D3A9D3A3A3A3A3A3A3A3A9D9D9D3A9D9D9D9D3A9D9D3A9D9D9D9D3A
-% 3A9D9D3A3A9D9DFF535353535353535353FF9D3A9D9D9D9D3A9D3A9D9D3A
-% 3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A7F13131313131313
-% 13137F3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D3A9D3A9D9D
-% 9D9D9D3A3A9D9D9D9D3A3A3A3A3A3A9D3A9D9DFF535353535353535353FF
-% 3A3A000000000000210012101010C5101210181818101810181018121818
-% 181818181818181818181818171818181810101210121010101010101010
-% 1000FF121818181818181012101810181816121818181210101012101010
-% 10100A081010181818181818181818121010101012101012121818181818
-% 16181818181816AF101010FF7D00000000000000003A3A3A3A3A3A3A3A9D
-% 3A9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D3A3A9D9D9D3A9D3A3A
-% 3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A9D7F131313131313137F3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A9D9D9D9D3A9D9D3A9D9D9D9D9D3A3A3A3AFF53535353535353FF3A3A9D
-% 9D9D9D9D9D9D9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D7F131313131313137F3A3A3A3A3A9D3A3A9D3A9D3A9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D3A9D3A9D3A9D9D9D3A9D9D9D9D9D3A9D3A9D3A9D9D3A
-% FF53535353535353FF9D9D3A9D3A3A9D3A9D3A9D3A3A3A3A3A9D3A9D3A3A
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A9D9D9D3A9D9D9D9D9D3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A9D3A3A3A3A3A9D
-% 3A9D3A9D3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D3A9D9D9D9D3A3A9D9D9D
-% 3A9D9D9D3A9D9DFF53535353535353FF9D9D9D9D9D3A9D9D9D3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A7F13131313131313
-% 7F3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A9D9D3A3A3A9D9D9D9D9D3A9D
-% 3A9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9DFF53535353535353FF3A3A
-% 3A000000000000210010101010C512161818181818181210121012101810
-% 181818181818181818121818181818181012101810181816121818181210
-% 00FF10121012101212101012121618181818181818181818101818131610
-% 101010101210181818181818181010101010101010101010121018181818
-% 181818181818AF121010FF7D00000000000000003A3A3A3A3A3A3A3A9D3A
-% 9D9D3A9D9D9D3A9D3A3A3A9D9D3A9D3A9D9D9D3A3A9D9D3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D
-% 9D9D9D9D9D9D9D3A3A9D9D9D3A3A3A3A3AFF53535353535353FF9D3A9D9D
-% 3A9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A7F131313131313137F3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D3A9D9D3A9D
-% 9D9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D9D3A9D9D3A9D9DFF
-% 53535353535353FF9D9D3A3A3A9D3A9D3A3A3A3A9D3A3A3A3A9D3A9D9D3A
-% 9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A9D3A
-% 9D9D3A3A3A3A3A3A3A3A9D3A3A9D3A9D9D9D9D9D9D9D9D3A9D3A3A9D9D3A
-% 9D9D9D9D3A9DFF53535353535353FF9D9D9D9D9D3A9D9D9D3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A9D3A9D3A9D9D9D9D9D9D
-% 9D3A9D9D9D3A9D3A9D3A9D9D3A9D3A3A9D9DFF53535353535353FF3A3A3A
-% 000000000000210010101010C518181818181A1818181010101010121012
-% 101812161818181010121012101212101012121618181818181818181800
-% FF1210101210101010181010121818181818181A181A1818181718181218
-% 181810101810181218181012101210101818101010101010121218181818
-% 1818181818AF101210FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D
-% 9D3A9D9D9D3A9D3A3A3A9D9D3A9D3A9D9D9D3A3A9D9D3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D9D
-% 9D9D9D9D9D9D3A3A9D9D9D3A3A3A3A3A3AFFFF535353FFFF9D9D3A9D9D3A
-% 9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A7F7F1313137F7F9D3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D3A9D9D3A9D9D
-% 9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D9D3A9D9D3A9D9D9DFF
-% FF535353FFFF3A9D9D3A3A3A9D3A9D3A3A3A3A9D3A3A3A3A9D3A9D9D3A9D
-% 9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A9D3A9D
-% 9D3A3A3A3A3A3A3A3A9D3A3A9D3A9D9D9D9D9D9D9D9D3A9D3A3A9D9D3A9D
-% 9D9D9D3A9D9DFFFF535353FFFF3A9D9D9D9D9D3A9D9D9D3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A9D3A9D3A9D9D9D9D9D9D9D
-% 3A9D9D9D3A9D3A9D3A9D9D3A9D3A3A9D9D3AFFFF535353FFFF3A3A3A3A00
-% 0000000000210012101010C51818181A1818181818121010101010121010
-% 101012101818101210101210101010181010121818181818181A181A00FF
-% 1818121010121012121012101018181618181A1818181818181818171818
-% 181612121012101010181810101212181018181010101210101818181A18
-% 18181818AF161210FF7D00000000000000003A3A3A3A9D3A3A3A9D9D9D9D
-% 9D9D9D9D9D9D3A9D9D9D9D3A9D9D3A3A9D9D9D3A9D9D3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D
-% 9D9D9D3A9D9D9D9D9D3A3A3A3A3A3A3A3AFFFFFFFF3A3A9D3A9D3A3A3A9D
-% 9D9D9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D3A9D9D9D9D9D9D3A9D
-% 9D9D9D3A9D9D9D3A9D3A9D9D3A9D3A3A9D9D9D9D3A9D9D3A9D9D3A9D9D9D
-% FFFFFF9D9D9D9D3A3A9D3A9D3A3A9D3A3A9D3A9D3A9D3A9D3A9D3A9D3A9D
-% 9D9D9D9D9D9D3A9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D3A3A3A9D3A3A
-% 3A9D3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D3A9D9D9D9D9D3A3A9D3A9D9D3A
-% 9D9D9D9D9D3A9DFFFFFF3A3A3A9D9D9D3A9D3A9D3A9D9D9D9D9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A9D9D9D3A9D3A9D9D9D3A
-% 9D3A9D9D3A9D3A9D3A3A9D9D9D9D9D9D3A9D3AFFFFFF3A3A3A3A3A3A0000
-% 00000000210012101212C518181818181A18181810100B0E10101010100E
-% 1010101218181818121010121012121012101018181618181A181800FF18
-% 181818121010181010101012181810101818181818121012101818181818
-% 181810101010101018181012101010181818181816121612181818181818
-% 181818AF181018FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D
-% 9D9D3A9D9D3A3A9D3A9D9D3A9D3A3A3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A9D9D9D
-% 9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A3AFF3A3A3A3A3A3A9D9D9D3A9D9D9D
-% 9D3A9D3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D3A9D9D9D9D3A9D9D9D
-% 9DFF9D3A9D3A9D3A3A9D3A9D9D3A3A9D3A9D3A9D3A3A9D3A3A3A9D3A9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D3A3A3A9D3A3A3A
-% 3A3A3A3A9D3A3A3A3A7F3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A9D9D3A
-% 3A3A3A9D3A3A3A3A9D9D9D3A9D9D3A9D9D9D3A9D9D3A3A3A3A3A9D9D9D3A
-% 9D9D9D3A9D9DFF3A9D3A3A3A9D9D9D9D9D9D3A9D9D3A9D9D9D3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A7F3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A3A9D3A9D9D9D9D3A9D3A9D9D9D9D
-% 9D9D9D9D3A9D9D9D9D3A3A9D9D9D9D3A9D3A3A3AFF3A3A3A3A3A3A000000
-% 000000210010181316C5181818181A181A181812101010101010100A100A
-% 101012161818181818121010181010101012181810101818181800FF1618
-% 18181818101818181012101010181816181818161810101018131618181A
-% 181818121010101810181210181813181818181818181818181818181818
-% 1818AF181012FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D
-% 9D3A9D9D3A3A9D3A9D9D3A9D3A3A3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A9D9D9D9D
-% 9D3A9D9D9D9D3A3A3A3A3A3A3A3A3AFF3A3A3A3A3A3A9D9D9D3A9D9D9D9D
-% 3A9D3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D3A9D9D9D9D3A9D9D9D9D
-% 9DFF3A9D3A9D3A3A9D3A9D9D3A3A9D3A9D3A9D3A3A9D3A3A3A9D3A9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D3A3A3A9D3A3A3A3A
-% 3A3A3A9D3A3A3A7F3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A9D9D3A3A
-% 3A3A9D3A3A3A3A9D9D9D3A9D9D3A9D9D9D3A9D9D3A3A3A3A3A9D9D9D3A9D
-% 9D9D3A9DFF3A3A9D3A3A3A9D9D9D9D9D9D3A9D9D3A9D9D9D3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A7F3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A3A9D3A9D9D9D9D3A9D3A9D9D9D9D9D
-% 9D9D9D3A9D9D9D9D3A3A9D9D9D9D3A9D3A3A3A3AFF3A3A3A3A3A00000000
-% 0000210010121618C518181A181A181818181818181810100A1010101010
-% 1010121816181818181810181818101210101018181618181800FF121818
-% 181818181818171210101010121012181018121818181812161812161818
-% 1818181018101210121618181018181818181818181818181818181A1818
-% 18AF181818FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D
-% 9D9D9D3A9D3A3A9D9D3A9D3A3A9D3A9D9D9D3A3A9D9D3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A7F7F7F3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A9D3A3A3A3A9D3A3A3A3A9D3A3A3A3A9D9D9D9D3A9D3A9D
-% 9D9D3A9D3A3A9D9D9D9D9DFFFFFFFF3A3A3A3A3A3A9D9D9D9D9D3A3A9D9D
-% 9D9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A7F7F7F3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D9D9D3A9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D3A9D9D9D3A9D9D9D9D9D3A9D9D3A9D9D3A9D9D9D9D3A9D9D
-% FFFFFF3A9D3A3A3A9D3A3A9D9D3A9D3A3A3A3A9D3A3A9D3A3A3A9D3A9D3A
-% 9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D9D9D9D3A3A9D9D3A9D9D9D9D9D
-% 3AFFFFFF3A9D9D3A3A3A9D9D3A9D9D3A9D3A9D3A9D9D3A9D3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A7F7F7F3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A9D3A9D3A3A9D9D3A9D3A3A3A9D9D9D9D9D9D9D3A
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A3A3A3AFFFFFF3A3A3A0000000000
-% 00210018181818C518181818181818181216181812101010121010101010
-% 10101212181818181818181817121010101012101218101800FF10121612
-% 181610181818121612101012101210121618181818181818121018101216
-% 18161818181018101210121018161818181818181A181A18181818181818
-% AF181818FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D3A9D9D9D
-% 9D9D3A9D3A9D9D3A9D9D3A9D3A9D9D9D9D9D3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A9D3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D3A3A
-% 9D9D9D3A3A9D9D9DFFFF535353FFFF9D3A3A3A3A3A3A3A9D9D9D9D9D9D3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A7F
-% 7F1313137F7F3A3A9D3A3A3A9D3A9D3A9D9D3A9D9D9D9D9D9D3A9D9D9D9D
-% 3A9D9D3A9D9D9D3A9D9D3A9D9D3A9D9D3A9D3A9D9D9D3A9D3A9D9DFFFF53
-% 5353FFFF3A3A9D3A9D9D3A9D3A3A3A9D3A9D3A3A9D3A3A9D3A9D9D9D9D9D
-% 9D9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D9D3A9D9D3A3A3A9D3A3A3A3A3A3A
-% 3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A9D9D3A9D9D9D9D9D9D3A9D3A9D3A9D3A3A9D9DFFFF
-% 535353FFFF3A9D3A3A9D9D9D9D9D3A9D9D9D3A9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F9D3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D9D9D3A9D3A3A9D9D3A9D9D9D3A9D9D
-% 9D9D9D9D3A9D9D9D3A9D9D9D3A9D3A3AFFFF535353FFFF3A000000000000
-% 210018181818C51018181818181812101012161818121018101010101010
-% 101010121612181610181818121612101012101210121600FF1010121012
-% 181218161810121012101010101010121216181818161810181010121012
-% 18181818161210181012101212101818181818181818181A18181A1E18AF
-% 181818FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D3A9D9D9D9D
-% 9D3A9D3A9D9D3A9D9D3A9D3A9D9D9D9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A7F131313131313137F3A9D3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D3A3A9D
-% 9D9D3A3A9D9DFF53535353535353FF3A3A3A3A3A3A3A9D9D9D9D9D9D3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F1313
-% 13131313137F3A9D3A3A3A9D3A9D3A9D9D3A9D9D9D9D9D9D3A9D9D9D9D3A
-% 9D9D3A9D9D9D3A9D9D3A9D9D3A9D9D3A9D3A9D9D9D3A9D3A9DFF53535353
-% 535353FF3A9D3A9D9D3A9D3A3A3A9D3A9D3A3A9D3A3A9D3A9D9D9D9D9D9D
-% 9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D9D3A9D9D3A3A3A9D3A3A3A3A3A3A7F
-% 131313131313137F3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A9D9D3A9D9D9D9D9D9D3A9D3A9D3A9D3A3A9DFF535353
-% 53535353FF9D3A3A9D9D9D9D9D3A9D9D9D3A9D3A9D3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A9D9D9D3A9D3A3A9D9D3A9D9D9D3A9D9D9D
-% 9D9D9D3A9D9D9D3A9D9D9D3A9D3AFF53535353535353FF00000000000021
-% 0018181818C5181818181818181810101210181216181810121010121010
-% 1010101210121812181618101210121010101010101200FF101010101012
-% 161218101812161210101012101210101210181218181818181810181810
-% 1212101218101210101010101210121818181818181818181A181A18AF18
-% 1818FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D3A
-% 9D9D9D3A9D3A9D3A9D9D3A3A9D9D9D9D3A9D3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D9D9D9D9D9D
-% 3A3A3A3A3AFF53535353535353FF9D9D3A3A3A3A9D3A9D9D9D9D9D3A3A9D
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D7F131313
-% 131313137F3A3A3A3A3A9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D9D9D9D9DFF5353535353
-% 5353FF3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A9D3A3A9D3A9D9D3A9D9D
-% 9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D3A3A3A9D3A3A3A3A9D3A7F13
-% 1313131313137F3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D9D3A9D3A3A3A3A3A
-% 9D3A3A3A3A9D9D3A9D9D9D3A9D9D3A9D9D3A3A9D3A9D3A9D9DFF53535353
-% 535353FF9D3A3A9D9D9D9D9D9D9D3A9D3A9D9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A9D3A3A3A
-% 3A3A3A3A3A3A9D9D3A3A9D9D3A9D9D3A3A9D9D3A9D9D9D3A9D9D9D3A9D9D
-% 9D9D9D9D3A9D9D3A9D9D3A9D3AFF53535353535353FF0000000000002100
-% 18181818C51818181A181818181010121012101210121810121010101210
-% 10101010101216121810181216121010101210121000FF10101012181818
-% 161818181018161810101010101012101210101218161818181818101210
-% 101018161210121010101010101210121612181818181A18201E1AAF1A18
-% 18FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D3A9D9D3A3A3A
-% 9D3A9D9D3A9D9D9D9D3A3A3A9D9D3A3A3A9D3A3A3A3A3A3A9D3A3A3A9D3A
-% 3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D9D3A3A
-% 9D3A3AFF535353535353535353FF9D3A3A3A3A3A9D9D9D9D9D9D9D3A9D9D
-% 9D3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313
-% 131313137F3A3A9D3A9D3A9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D
-% 9D9D3A9D9D9D9D3A9D9D9D3A9D3A9D9D9D9D9D9D9D9DFF53535353535353
-% 5353FF3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D9D9D9D9D9D9D9D
-% 3A9D9D9D3A9D3A9D9D9D9D9D9D9D9D9D9D3A3A3A9D3A3A3A3A3A7F131313
-% 1313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A
-% 3A9D3A9D9D3A9D9D9D9D3A9D9D9D9D9D3A3A9D3A9D3A9DFF535353535353
-% 535353FF3A3A9D9D3A9D9D3A9D9D9D3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A9D7F1313131313131313137F3A3A9D3A3A
-% 3A3A3A3A9D3A3A3A9D9D3A9D9D3A3A3A9D9D9D3A9D3A3A9D9D9D9D9D3A9D
-% 3A3A3A9D3A9D3A9D9D3A9DFF535353535353535353FF0000000000210018
-% 181818C51818181818181818181812101010101018101818181812101010
-% 101012181818161818181018161810101010101000FF1810121018181818
-% 121810181818181810121012101010101012101012121018181018101010
-% 10181210101010101010101010101010101818181818181A181AAF181818
-% FF7D00000000000000003A3A3A3A3A3A3A3A9D3A9D9D9D3A9D9D3A3A3A9D
-% 3A9D9D3A9D9D9D9D3A3A3A9D9D3A3A3A9D3A3A3A3A3A3A9D3A3A3A9D3A3A
-% 3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D9D3A3A9D
-% 3A3AFF535353535353535353FF9D3A3A3A3A3A9D9D9D9D9D9D9D3A9D9D9D
-% 3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313
-% 1313137F3A3A9D3A9D3A9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D
-% 9D3A9D9D9D9D3A9D9D9D3A9D3A9D9D9D9D9D9D9D9DFF5353535353535353
-% 53FF3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D9D9D9D9D9D9D9D3A
-% 9D9D9D3A9D3A9D9D9D9D9D9D9D9D9D9D3A3A3A9D3A3A3A3A3A7F13131313
-% 13131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A
-% 9D3A9D9D3A9D9D9D9D3A9D9D9D9D9D3A3A9D3A9D3A9DFF53535353535353
-% 5353FF3A3A9D9D3A9D9D3A9D9D9D3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A9D7F1313131313131313137F3A3A9D3A3A3A
-% 3A3A3A9D3A3A3A9D9D3A9D9D3A3A3A9D9D9D3A9D3A3A9D9D9D9D9D3A9D3A
-% 3A3A9D3A9D3A9D9D3A9DFF535353535353535353FF000000000021001818
-% 1816C5181818181818181818121010101010101012101818181818181810
-% 1210181818181218101818181818101210121000FF1A1818181618181816
-% 181818181618181818101010101012121012101010101218101210121010
-% 18101612101010101010101010101010101818181818181820AF1A1818FF
-% 7D00000000000000003A3A3A3A3A3A3A9D9D3A9D9D9D9D9D9D3A9D3A9D9D
-% 3A9D9D3A9D3A9D3A3A3A9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A
-% 3A3A3A9D3A3A3A3A3A9D3A3A3A3A9D9D9D9D9D3A9D9D9D9D3A9D3A3A3A3A
-% 3AFF535353535353535353FF9D3A3A9D3A3A9D9D9D9D9D9D9D3A9D9D9D9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A7F13131313131313
-% 13137F3A3A3A3A9D3A9D3A9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D
-% 9D9D3A9D9D9D3A9D9D9D9D9D9D3A9D9D3A3A9D3AFF535353535353535353
-% FF3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A3A9D3A9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D3A9D9D9D9D3A9D9D3A3A3A3A3A3A3A3A3A7F1313131313
-% 131313137F3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A9D3A9D3A9D3A9D3A9D9D3A9D3A3A3A9D9D3A9DFF5353535353535353
-% 53FF9D3A9D9D9D9D3A9D3A9D3A3A9D9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A
-% 3A3A9D9D3A9D9D9D3A9D3A9D3A9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D9D
-% 9D9D9D9D9D9D9D3A9DFF535353535353535353FF00000000002100181818
-% 12C5121018181810121612161010101010121010181818181818181A1818
-% 18161818181618181818161818181810101000FF181818181A1818181810
-% 181018181816181216121018101010121010101010101012101216181812
-% 18181818181010101010101010101010121018181A202118AF181818FF7D
-% 00000000000000003A3A9D3A3A3A3A3A9D3A9D9D3A9D9D3A9D3A3A9D3A9D
-% 3A9D9D9D9D9D9D3A9D3A9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A7F131313131313137F3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D9D3A3A3A3A3A
-% 3AFF53535353535353FF9D9D3A3A3A3A3A3A3A9D9D9D9D9D9D9D3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A7F13131313131313
-% 7F3A3A3A3A3A9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D3A9D
-% 9D9D9D9D9D9D9D3A9D3A9D9D9D9D3A9D9D9D9D3AFF53535353535353FF3A
-% 3A9D3A3A9D3A3A9D3A3A3A3A3A3A9D3A9D3A3A3A9D9D9D9D3A9D9D9D9D9D
-% 9D9D9D3A3A9D9D9D9D3A9D9D9D9D3A3A9D9D3A3A3A3A3A3A7F1313131313
-% 13137F3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A9D3A9D3A9D3A9D9D9D9D3A3A9D3A3A9D9D9DFF53535353535353FF
-% 3A3A3A9D9D9D9D3A9D9D3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A
-% 9D3A3A9D9D3A9D3A9D3A3A3A3A3A3A9D9D9D3A9D9D9D3A9D9D9D3A3A3A3A
-% 9D9D9D9D9D9D3A9D3AFF53535353535353FF000000000000210018181016
-% C5101210101210181018181310100A08081010101216181A181818181818
-% 1A1818181810181018181816181216121000FF1818181818181A18101812
-% 121212181818181012101210101216181818181210121018101812181612
-% 1816181818181010101010101010101012181818201A18AF181212FF7D00
-% 000000000000003A3A9D3A3A3A3A3A9D3A9D9D3A9D9D3A9D3A3A9D3A9D3A
-% 9D9D9D9D9D9D3A9D3A9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F131313131313137F3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D9D3A3A3A3A3A3A
-% FF53535353535353FF9D9D3A3A3A3A3A3A3A9D9D9D9D9D9D9D3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F
-% 3A3A3A3A3A9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D3A9D9D
-% 9D9D9D9D9D9D3A9D3A9D9D9D9D3A9D9D9D9D3AFF53535353535353FF3A3A
-% 9D3A3A9D3A3A9D3A3A3A3A3A3A9D3A9D3A3A3A9D9D9D9D3A9D9D9D9D9D9D
-% 9D9D3A3A9D9D9D9D3A9D9D9D9D3A3A9D9D3A3A3A3A3A3A7F131313131313
-% 137F3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A9D3A9D3A9D3A9D9D9D9D3A3A9D3A3A9D9D9DFF53535353535353FF3A
-% 3A3A9D9D9D9D3A9D9D3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A9D
-% 3A3A9D9D3A9D3A9D3A3A3A3A3A3A9D9D9D3A9D9D9D3A9D9D9D3A3A3A3A9D
-% 9D9D9D9D9D3A9D3AFF53535353535353FF000000000000210012121812C5
-% 10181012101810121816181810101008101010181818181A181818181818
-% 181A181018121212121818181810121000FF1A181A181A18181818121010
-% 101010181210101012101216121818181818181818181812161812101210
-% 1212161818101010121010100E101010121818181818AF101010FF7D0000
-% 0000000000003A3A3A3A3A3A3A3A9D9D9D9D9D9D9D3A3A9D3A3A9D9D3A9D
-% 3A9D3A9D9D3A3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F7F1313137F7F3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D3A9D9D9D3A3A3A3A3A3A3A9D
-% FFFF535353FFFF9D9D9D3A3A3A3A3A3A9D9D9D3A9D9D9D9D3A9D3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D7F7F1313137F7F3A3A
-% 3A3A3A3A9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 3A9D3A9D9D9D9D9D3A9D9D9D9D9D3A9D9D9D9DFFFF535353FFFF3A9D3A3A
-% 3A9D3A3A9D3A3A3A3A3A9D9D3A9D3A9D3A9D3A9D9D9D9D9D9D9D9D3A9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 9D9D9D9D3A9D3A9D9D9D9D3A3A9D9D3A9D3A3A3AFFFF535353FFFF9D3A3A
-% 3A9D3A9D9D9D9D9D9D3A9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A9D3A3A3A3A3A3A3A3A9D
-% 9D9D9D9D9D9D3A3A3A3A9D9D9D3A9D9D9D3A9D3A3A9D9D9D9D3A3A3A9D3A
-% 9D3A9D9D3A9D3A3AFFFF535353FFFF3A000000000000210010101210C518
-% 1818181012101210181818181210101010121818181A18181A181A181A18
-% 18181812101010101018121010101200FF18181818181818181810101010
-% 101018181012101010121012161818181818181818181818131612101010
-% 101212181012101010101010101010101216181812AF121012FF7D000000
-% 00000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D3A9D3A3A9D3A3A9D9D3A
-% 9D9D9D3A3A9D3A3A9D3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D9D3A3A3A3A3A3A3A9D9D
-% 9DFFFFFF3A9D9D9D9D3A3A3A3A3A3A9D9D9D3A9D9D9D9D3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A
-% 3A3A3A3A9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D
-% 9D9D3A9D9D9D3A9D9D9D3A9D3A3A9D3A9D9D9D9DFFFFFF3A3A3A3A3A9D9D
-% 3A3A9D3A3A9D3A3A3A3A3A9D3A3A3A9D9D3A9D3A3A9D9D3A9D9D9D9D9D9D
-% 9D9D3A9D9D3A9D9D9D9D9D3A3A9D3A3A3A3A3A9D3A3A3A3A7F7F7F3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A9D9D
-% 9D9D9D3A3A9D9D9D9D3A3A3A3A9D9D9D9D9D9D9D9DFFFFFF9D3A3A9D3A3A
-% 9D9D9D3A9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 9D9D3A9D3A9D3A3A9D3A9D3A9D9D9D9D3A3A9D9D9D9D3A9D3A9D9D3A9D3A
-% 9D9D9D3A9D3A3A3A3AFFFFFF3A3A3A000000000000210010121012C51818
-% 18181812101010101218181818121012101818181A181818181818181818
-% 181810101010101018181012101000FF1818181818181818121010101010
-% 101818101010101218101012181818181818181818181816181818121010
-% 1010121612181010121010101010101210121010AF101010FF7D00000000
-% 000000003A3A3A3A3A3A3A3A9D3A9D9D9D9D9D3A9D3A3A9D3A3A9D9D3A9D
-% 9D9D3A3A9D3A3A9D3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D9D3A3A3A3A3A3A3A9D9D9D
-% FF3A3A3A9D9D9D9D3A3A3A3A3A3A9D9D9D3A9D9D9D9D3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A3A
-% 3A3A3A9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D
-% 9D3A9D9D9D3A9D9D9D3A9D3A3A9D3A9D9D9D9D3A9DFF3A3A3A3A3A9D9D3A
-% 3A9D3A3A9D3A3A3A3A3A9D3A3A3A9D9D3A9D3A3A9D9D3A9D9D9D9D9D9D9D
-% 9D3A9D9D3A9D9D9D9D9D3A3A9D3A3A3A3A3A9D3A3A3A7F3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A9D9D9D
-% 9D9D3A3A9D9D9D9D3A3A3A3A9D9D9D9D9D9D9D9DFF9D9D9D3A3A9D3A3A9D
-% 9D9D3A9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A7F3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D
-% 9D3A9D3A9D3A3A9D3A9D3A9D9D9D9D3A3A9D9D9D9D3A9D3A9D9D3A9D3A9D
-% 9D9D3A9D3A3A3A3A3A3A3AFF3A3A000000000000210010101012C5181818
-% 18181810121010101010121618121618181818181A181818181818181818
-% 1210101010101018181010101000FF181818181818181810121010101010
-% 181618181216121010101210181810121818181818181818181818161210
-% 10101812161210101010101012101012101012AF101010FF7D0000000000
-% 0000003A3A3A3A3A3A3A9D3A3A9D9D3A9D9D3A3A9D3A3A9D3A9D3A9D3A9D
-% 3A9D3A3A3A3A9D9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A
-% 3A7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A9D3A9D9D9D9D3A9D9D9D9D3A3A3A3A3A3A9D9DFF3A
-% 3A3A3A9D9D9D9D3A3A3A3A9D3A9D3A9D3A9D9D3A3A3A9D3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A7F3A3A3A9D3A3A
-% 9D3A9D9D9D3A9D9D9D9D3A9D9D9D3A9D9D9D9D3A9D9D3A9D9D9D3A9D3A9D
-% 9D9D9D3A9D9D9D9D3A9D3A3A9D9D9D3A9D3A9D9DFF9D9D3A3A9D3A3A3A9D
-% 3A3A3A3A3A3A3A9D3A3A9D3A9D3A3A9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D
-% 9D9D9D9D9D9D9D9D3A3A3A9D3A3A3A3A3A3A9D3A3A7F3A3A9D3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D3A3A3A3A9D3A3A3A3A3A3A9D9D3A9D
-% 9D9D9D3A3A9D9D9D3A3A9D3A3A9D3A9D9D9DFF9D9D3A3A3A3A3A3A3A9D9D
-% 3A9D9D3A3A9D9D3A3A9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D7F3A3A3A3A3A3A3A3A9D3A3A3A3A9D9D9D9D
-% 9D3A3A9D3A9D9D3A9D9D9D9D3A9D3A9D3A9D9D9D9D9D9D9D9D3A9D9D9D9D
-% 9D3A9D3A3A3A3A3A3A3AFF3A3A000000000000210010101010C51818181A
-% 181812101010100808101012101812171818181818181818181818181810
-% 12101010101018161818121600FF12161818101810181210121010101212
-% 181818181812101010121613101210181618181818181818181818181010
-% 101216121012101216181810181012101216AF101010FF7D000000000000
-% 00003A3A3A3A3A3A3A3A9D9D9D9D9D9D3A3A9D3A9D9D9D3A9D9D9D9D9D9D
-% 9D9D3A9D3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D9D9D9D9D9D3A3A9D3A9D9D9D3A3A3A9D3A3A3A9D9DFF9D9D
-% 9D9D9D3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D9D3A9D9D9D9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A7F3A3A3A3A3A3A3A
-% 3A9D3A9D3A3A9D9D9D9D9D3A9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D3A9D3AFF3A9D3A3A9D3A3A9D3A
-% 9D9D9D9D3A9D3A3A9D3A3A3A9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D
-% 9D9D3A9D9D9D9D9D3A3A9D3A9D3A3A3A3A3A3A9D7F3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A9D3A9D
-% 3A3A9D9D3A9D9D3A3A9D3A9D9D9D3A9D9DFF3A3A3A3A3A9D3A3A9D9D9D9D
-% 3A9D9D9D3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A3A9D3A3A3A3A3A3A9D9D3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A9D9D9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D
-% 3A9D3A3A3A9D3A3A3AFF3A3A000000000000210010101010C51818181818
-% 181818101010100A10101010121612181818181812161818101810181210
-% 121010101212181818181800FF1012101012161210101010121012161818
-% 181A18181210181218181818101218121216181818181218181818181012
-% 1018101810181012181818181812161218AF101010FF7D00000000000000
-% FFFFFF3A3A3A3A3A3A9D9D9D9D9D9D3A3A9D3A9D9D9D3A9D9D9D9D9D9D9D
-% 9D3A9D3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A7F7F7F
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D9D9D9D9D9D3A3A9D3A9D9D9D3A3A3A9D3A3A3AFFFFFF9D9D9D
-% 9D9D3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D9D3A9D9D9D9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A7F7F7F3A3A3A3A3A
-% 9D3A9D3A3A9D9D9D9D9D3A9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D3A9D3AFFFFFF3A3A9D3A3A9D3A9D
-% 9D9D9D3A9D3A3A9D3A3A3A9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D9D
-% 9D3A9D9D9D9D9D3A3A9D3A9D3A3A3A3A7F7F7F3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A9D3A9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A9D3A9D3A
-% 3A9D9D3A9D9D3A3A9D3A9D9D9D3AFFFFFF3A3A3A3A3A9D3A3A9D9D9D9D3A
-% 9D9D9D3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A9D3A3A3A3A3A3A9D9D3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A9D9D9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D3A
-% 9D3A3A3A9D3A3A3A3AFFFFFF0000000000210010101010C51818181A2018
-% 1818101210101010100A1012101818181818121012101012161210101010
-% 121012161818181A181800FF181818181810121612161216121818181818
-% 1A1818181010101010121018101010101218181818101210101010181810
-% 12101812181816181A18181818181618AF181818FF7D0000000000FFFF53
-% 5353FFFF3A9D3A3A9D3A9D9D9D9D9D3A3A9D9D3A3A9D9D9D3A9D3A9D9D9D
-% 9D3A3A3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F
-% 7F3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A9D9D9D9D9D3A9D9D9D9D9D3A3A3A3A3AFFFF535353FFFF9D9D
-% 9D3A3A3A3A3A3A3A3A3A9D3A9D3A9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A9D
-% 9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D3A9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D3A3A9D9D3A9D3A9D3A9D9D3AFFFF535353FFFF3A3A9D3A9D9D9D
-% 9D9D9D9D3A3A9D3A9D3A9D3A9D3A9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D9D
-% 9D9D9D9D9D3A9D3A9D3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A9D9D3A3A3A3A3A3A3A3A3A3A9D3A9D9D9D3A9D
-% 3A9D3A3A9D9D3A3A3A3A3AFFFF535353FFFF3A3A3A3A3A9D9D3A3A9D9D9D
-% 9D9D3A9D9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A
-% 3A3A9D3A9D9D9D9D3A9D3A9D9D3A9D9D3A9D9D9D9D9D3A9D3A9D9D9D3A9D
-% 3A3A3A3A3A3AFFFF535353FFFF000000210018181010C510101216181818
-% 181810121010101010101010101012101818181818181810121612161216
-% 1218181818181A181800FF1A1818181012101810121012AF181818181818
-% 181818181010101010101010101010101216181818101012101218181010
-% 1216121618181818181A1818181818AF181816FF7D00000000FF53535353
-% 535353FF3A3A3A9D3A9D3A9D9D9D3A3A3A3A9D3A3A9D9D3A3A9D9D3A9D9D
-% 9D9D3A9D9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A7F13131313131313
-% 7F3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D9D9D3A9D3A9D9D9D3A3A3A3AFF53535353535353FF3A9D
-% 9D9D9D3A3A3A3A3A3A9D9D9D3A9D9D9D3A9D9D3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A9D3A
-% 9D3A3A9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D3A
-% 9D3A9D9D9D9D3A9D9D9D9D9D9D3AFF53535353535353FF3A9D9D3A9D9D9D
-% 3A9D3A9D9D3A3A3A9D3A9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D3A9D3A9D3A3A3A7F131313131313137F3A3A9D3A3A3A3A3A3A3A
-% 3A9D3A3A9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D9D9D
-% 9D9D9D9D9D9D3A9D9DFF53535353535353FF9D9D3A9D9D9D9D9D3A9D9D3A
-% 9D9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D
-% 3A3A3A3A9D9D9D9D9D3A9D9D3A9D3A9D3A9D9D3A9D9D3A9D9D9D9D3A9D3A
-% 3A3A3A3AFF53535353535353FF0000210018161818C51010101218101810
-% 18121010101012101010101210121618181A181818101210181012101216
-% 181818181818181800FF18181818181118131612161218AFAF1818181A18
-% 181818101010101010100A1010101010AFAFAFAFAFAF1012161218101210
-% 1813181818181818181818181810AF161318FF7D00000000FF5353535353
-% 5353FF3A3A3A9D3A9D3A9D9D9D3A3A3A3A9D3A3A9D9D3A3A9D9D3A9D9D9D
-% 9D3A9D9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D9D9D3A9D3A9D9D9D3A3A3A3AFF53535353535353FF3A9D9D
-% 9D9D3A3A3A3A3A3A9D9D9D3A9D9D9D3A9D9D3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A9D3A9D
-% 3A3A9D9D3A9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D3A9D
-% 3A9D9D9D9D3A9D9D9D9D9D9D3AFF53535353535353FF3A9D9D3A9D9D9D3A
-% 9D3A9D9D3A3A3A9D3A9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D3A9D3A9D3A3A3A7F131313131313137F3A3A9D3A3A3A3A3A3A3A3A
-% 9D3A3A9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D9D9D9D
-% 9D9D9D9D9D3A9D9DFF53535353535353FF9D9D3A9D9D9D9D9D3A9D9D3A9D
-% 9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A
-% 3A3A3A9D9D9D9D9D3A9D9D3A9D3A9D3A9D9D3A9D9D3A9D9D9D9D3A9D3A3A
-% 3A3A3AFF53535353535353FF0000210013181818C5121010121010121018
-% 101012101216181618121618181818181818181818111813161216121818
-% 181818181A181800FF1A1818181818161818121012161818AFAF1A181818
-% 1818101010101010101010100810AFAFAFAFAFAFAFAF1018161216121810
-% 18101810181818181818181010AF121818FF7D000000FF53535353535353
-% 5353FF3A9D9D9D9D9D9D3A9D9D3A3A9D9D3A3A9D9D3A3A9D9D3A9D9D9D9D
-% 9D3A9D9D9D3A3A3A3A9D3A3A3A3A3A9D3A3A9D7F1313131313131313137F
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A9D9D3A9D9D3A9D9D9D3A3A3AFF535353535353535353FF9D9D9D
-% 9D3A3A3A3A3A3A9D9D9D3A9D9D9D9D3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F1313131313131313137F3A9D3A9D3A
-% 3A9D9D9D9D3A9D9D9D9D3A9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A
-% 9D9D3A9D3A9D9D9D9D3A3AFF535353535353535353FF9D9D9D9D9D9D9D9D
-% 3A9D3A9D3A9D3A9D3A9D3A9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D3A9D3A9D3A3A7F1313131313131313137F3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A9D3A3A9D9D3A3A3A3A9D3A3A3A3A3A9D3A9D9D3A3A9D3A3A9D
-% 9D3A9D9D9D9DFF535353535353535353FF9D9D9D9D3A9D9D3A3A9D3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F1313131313131313137F3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A9D9D9D9D3A9D9D3A3A3A9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D3A3A3A
-% 3AFF535353535353535353FF00210018181818C518181010101012101210
-% 1210121618181818181818181818181A1818181818161818121012161818
-% 1A181A18181800FF1818181818181818171216181818181818AFAFAFAFAF
-% 18111812101210101010101008AF101018181818AF181210121018101810
-% AFAFAFAFAFAFAFAFAFAFAFAFAF181618FF7D000000FF5353535353535353
-% 53FF3A3A9D3A9D9D3A9D9D3A3A9D3A3A3A9D9D3A3A9D9D9D9D3A3A9D9D9D
-% 9D3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A7F1313131313131313137F3A
-% 3A3A3A3A3A9D9D9D9D9D9D9D9D3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A
-% 3A3A9D3A9D9D3A9D3A9D9D3A9D3A3AFF535353535353535353FF9D9D9D9D
-% 3A3A3A3A3A3A3A9D9D9D9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D7F1313131313131313137F3A3A3A9D3A3A
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D3A3A9D
-% 9D9D3A9D3A3A9D3A9D9DFF535353535353535353FF3A9D9D3A9D9D3A3A3A
-% 9D3A3A9D3A9D3A9D9D3A9D3A9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D3A9D9D
-% 3A3A9D3A9D3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A9D9D9D9D9D9D3A9D
-% 9D9D3A9D9DFF535353535353535353FF9D9D3A3A9D9D3A9D9D9D3A9D9D3A
-% 3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D
-% 9D9D7F1313131313131313137F3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A
-% 9D9D9D3A3A9D9D9D9D3A9D9D3A9D9D3A9D9D3A9D9D3A9D9D3A9D3A3A3A3A
-% FF535353535353535353FF00210016181818C5C5C5C5C5C5C51018101810
-% 121018181818181818181818181818181818181818181712161818181818
-% 18181A181800FF18181818181A181818181218181818AFAF181818181618
-% 181612161810121012101010AF101010121816AF18181018181316131810
-% 1210101216121818121618AF181818FF7D000000FF535353535353535353
-% FF3A9D3A9D9D3A9D9D9D9D3A3A3A3A9D9D9D9D3A3A9D9D9D3A9D9D9D9D9D
-% 9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A
-% 3A9D3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 9D9D9D9D3A3A9D9D3A9D9D9D3A3AFF535353535353535353FF9D9D9D9D3A
-% 3A9D3A3A9D9D9D3A3A9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A9D3A3A3A3A9D
-% 9D9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D9D3A3A9D3A9D3A
-% 9D9D3A9D9D9D9D9D3AFF535353535353535353FF3A9D3A9D3A3A9D3A3A3A
-% 3A9D3A3A3A9D3A9D3A9D9D9D3A9D3A3A9D3A9D9D9D9D9D3A9D9D9D9D9D3A
-% 3A9D3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A9D3A9D9D9D9D3A3A9D3A9D9D
-% 3A9D3A9DFF535353535353535353FF3A3A9D9D9D3A9D3A9D9D9D9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D9D3A
-% 3A7F1313131313131313137F3A3A3A3A9D3A3A3A3A3A3A9D3A3A9D9D9D3A
-% 3A3A3A9D3A9D3A9D3A9D3A9D3A9D3A9D9D9D3A9D3A9D9D3A9D3A3A9D3AFF
-% 535353535353535353FF00210018181018C5181818181718181812101012
-% 1012121818181818181818181818181818181A1818181812181818181818
-% 1818181800FF18181A18181818181818171818AFAF121818181818121210
-% 1210121012161210121012AFAFAFAFAFAFAFAF1613101216181812161210
-% 12101012161818101818AF181818FF7D00000000FF53535353535353FF3A
-% 3A9D3A9D9D3A9D9D9D9D3A3A3A3A9D9D9D9D3A3A9D9D9D3A9D9D9D9D9D9D
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A
-% 9D3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D
-% 9D9D9D3A3A9D9D3A9D9D9D3A3A3AFF53535353535353FF3A9D9D9D9D3A3A
-% 9D3A3A9D9D9D3A3A9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A9D3A3A3A3A9D9D
-% 9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D3A9D9D3A3A9D3A9D3A9D
-% 9D3A9D9D9D9D9D3A9DFF53535353535353FF3A3A9D3A9D3A3A9D3A3A3A3A
-% 9D3A3A3A9D3A9D3A9D9D9D3A9D3A3A9D3A9D9D9D9D9D3A9D9D9D9D9D3A3A
-% 9D3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A9D3A9D9D9D9D3A3A9D3A9D9D3A
-% 9D3A9D9DFF53535353535353FF3A3A3A9D9D9D3A9D3A9D9D9D9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D9D3A3A
-% 3A7F131313131313137F3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A9D9D9D3A3A
-% 3A3A9D3A9D3A9D3A9D3A9D3A9D3A9D9D9D3A9D3A9D9D3A9D3A3A9D3A3AFF
-% 53535353535353FF0000210018181612C518181818181816121612101010
-% 10121018181818181A18181818181A181818181818181718181818121818
-% 18181800FF1818181818181A1818181818AF181818161818161810101010
-% 1010101210121816121010AFAFAFAFAFAF10181810121818181018101010
-% 101010121810181018AF161818FF7D00000000FF53535353535353FF3A3A
-% 3A9D3A9D9D9D3A9D9D3A9D3A9D9D9D9D3A9D3A9D9D9D3A9D3A9D9D3A9D9D
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A
-% 3A3A9D9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D
-% 9D3A9D9D3A9D9D9D9D3A3A3A3AFF53535353535353FF3A9D9D9D9D3A3A3A
-% 3A3A9D9D9D9D9D9D9D3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A9D3A9D9D9D
-% 9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D3A9D
-% 3A3A9D3A9D9D3A9DFF53535353535353FF9D3A3A9D3A9D9D3A3A3A3A9D3A
-% 3A9D3A9D3A9D3A9D9D9D9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D3A3A9D
-% 3A9D3A3A3A7F131313131313137F3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D9D3A9D9D9D3A9D3A
-% 9D9D3AFF53535353535353FF3A9D9D9D3A9D3A3A9D9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A3A
-% 7F131313131313137F3A3A9D3A3A3A3A3A9D3A3A3A3A3A9D9D3A3A3A3A3A
-% 9D9D3A9D3A9D3A3A9D9D9D3A9D3A9D3A9D9D9D9D9D3A9D3A3A3A3A3AFF53
-% 535353535353FF0000210018181818C51018181818161210181012101010
-% 1010181612181818181A181818181818181A181818181818181818161818
-% 161800FF181818181A181818181818181818181818181818181818101012
-% 101010101018121810181010101012161818181818161817181818181810
-% 1010101012181810AF121818FF7D0000000000FFFF535353FFFF9D3A3A9D
-% 3A9D9D9D9D9D9D9D3A3A3A9D3A3A9D9D3A3A3A9D9D3A3A9D9D3A9D3A9D9D
-% 9D9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F9D3A3A3A3A3A3A
-% 3A3A9D9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A9D
-% 9D9D3A9D9D9D9D9D9D9D3A3A3AFFFF535353FFFF3A3A9D9D9D9D3A3A3A3A
-% 9D3A9D9D9D9D9D3A9D9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A9D3A9D3A9D3A9D9D
-% 9D9D9D9D9D9D9D9D3A9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D3A9D3A9D
-% 3A3A9D9D3A9D9D3AFFFF535353FFFF3A3A3A9D3A9D3A9D3A3A3A3A3A9D3A
-% 3A3A9D3A9D3A9D9D9D3A9D3A3A9D3A9D9D9D3A9D9D9D9D9D9D9D3A3A9D3A
-% 3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A9D9D9D3A9D9D9D9D9D3A
-% 9D9D9DFFFF535353FFFF9D9D9D3A9D9D3A9D9D3A9D9D9D9D3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A9D9D3A3A3A
-% 7F7F1313137F7F3A3A3A3A3A3A9D3A3A3A3A3A9D9D3A9D3A9D3A3A9D9D3A
-% 3A9D9D9D9D3A3A3A9D9D3A9D3A3A9D9D9D3A9D9D3A9D3A3A9D3A3A3AFFFF
-% 535353FFFF000000210018181818C5101210121012101218161210101010
-% 10101010101216181810181818181A181818181818181818181818181818
-% 1800FF1818181A1E181A1818181612101218181818181818101810121010
-% 101010101218171818101210101018181818181818181818171818161012
-% 10121012101010AF101010FF7D00000000000000FFFFFF3A3A9D3A3A9D3A
-% 9D9D9D9D9D9D9D3A3A3A9D3A3A9D9D3A3A3A9D9D3A3A9D9D3A9D3A9D9D9D
-% 9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D7F7F7F3A3A9D3A3A3A3A3A3A3A
-% 3A9D9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A9D9D
-% 9D3A9D9D9D9D9D9D9D3A3A3A3A3AFFFFFF9D3A3A3A9D9D9D9D3A3A3A3A9D
-% 3A9D9D9D9D9D3A9D9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A3A9D3A9D3A9D3A9D9D9D
-% 9D9D9D9D9D9D9D3A9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D3A9D3A9D3A
-% 3A9D9D3A9D9D3A9D3AFFFFFF9D9D3A3A3A9D3A9D3A9D3A3A3A3A3A9D3A3A
-% 3A9D3A9D3A9D9D9D3A9D3A3A9D3A9D9D9D3A9D9D9D9D9D9D9D3A3A9D3A3A
-% 3A3A3A3A9D3A7F7F7F3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 9D9D9D3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A9D9D9D3A9D9D9D9D9D3A9D
-% 9D9D9D9DFFFFFF3A9D9D9D9D3A9D9D3A9D9D3A9D9D9D9D3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A9D9D3A3A3A3A
-% 3A7F7F7F9D3A3A3A3A3A3A3A9D3A3A3A3A3A9D9D3A9D3A9D3A3A9D9D3A3A
-% 9D9D9D9D3A3A3A9D9D3A9D3A3A9D9D9D3A9D9D3A9D3A3A9D3A3A3A3A3AFF
-% FFFF0000000000210010101012C512161216121810181012101010101010
-% 1010101010121810181818181A1E181A1818181612101218181818181818
-% 00FF1818181A181A18181812101210101012161218101818181010101010
-% 101010121612181818181812181818181818181818181818181818181816
-% 121010121012AF101010FF7D00000000000000003AFF3A3A3A3A3A3A9D3A
-% 9D9D9D9D9D3A3A3A3A9D3A9D9D9D3A3A9D9D9D3A9D9D9D9D3A9D9D9D9D9D
-% 9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A7F3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D
-% 9D9D9D9D9D9D9D9D3A3A3A9D9DFF9D9D9D3A3A9D9D9D9D3A3A3A3A3A9D9D
-% 9D9D9D9D9D9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A3A3A9D3A9D3A9D9D9D9D9D9D
-% 9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A9D9D9D3A9D3A9D9D
-% 9D9D9D9D3A9D3A9D3A3AFF3A3A3A3A9D3A3A3A9D9D3A3A3A9D3A9D3A9D3A
-% 3A3A9D3A9D3A9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A3A3A3A
-% 3A3A3A3A3A7F3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A
-% 3A3A9D3A3A9D3A3A3A9D3A3A3A9D3A3A9D3A9D9D9D9D3A3A9D9D3A9D9D3A
-% 3A9D3AFF3A9D9D9D3A9D9D9D9D9D3A9D3A9D9D3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D9D9D3A3A3A3A
-% 3A3A7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A9D3A9D3A9D
-% 3A9D9D3A9D3A9D3A3A9D3A9D9D3A9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 000000000000210010101010C51012101210101012101210101210100810
-% 100F1010101012181818181A181A18181812101210101012161218101800
-% FF1818181A18181A18181810101010121012101212161218101010100A10
-% 10101012181818181818181818181A181818181818161812181818181818
-% 1012101018AF101010FF7D00000000000000003AFF3A3A3A3A3A9D3A9D9D
-% 9D9D9D3A9D3A3A9D9D3A3A9D9D3A9D3A9D9D9D3A3A3A9D9D3A9D9D3A9D9D
-% 9D3A3A3A3A3A3A3A3A3A9D3A3A3A7F3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D9D9D3A
-% 3A9D9D9D9D9D9D9D3A3A3AFF3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D9D9D9D
-% 9D9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A9D3A3A9D3A3A3A3A3A3A7F3A3A3A9D3A3A9D3A9D3A9D9D9D9D9D3A9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A9D3A9D9D9D3A9D3A9D3A9D9D3A
-% 9D9D9D3A9D3A9D3A3AFF3A3A3A9D3A9D3A9D3A3A9D3A3A3A9D3A9D3A9D9D
-% 3A9D3A9D3A9D3A3A9D3A9D3A3A9D9D9D9D3A9D9D9D9D9D3A9D3A9D3A3A3A
-% 3A3A3A7F3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D3A3A3A9D9D9D3A9D9D3A9D9D9D
-% 3AFF9D9D9D9D3A3A9D9D9D9D9D3A9D9D9D9D3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A3A3A
-% 3A7F3A3A3A3A3A9D3A3A9D3A3A9D3A3A9D9D3A3A3A3A9D3A9D9D3A9D9D9D
-% 9D9D3A3A3A9D9D9D3A9D3A9D9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A00
-% 0000000000210010101010C51216131810181218161818181010100A100B
-% 101010101010181818181A18181A181818101010101210121012121600FF
-% 1818181A181A181818181210121010121010101012101218181010101008
-% 10121618181A181A181818181A1818181818181012121816181212181018
-% 16101018AF181818FF7D00000000000000003A3AFF3A3A3A3A9D3A9D9D9D
-% 9D9D3A9D3A3A9D9D3A3A9D9D3A9D3A9D9D9D3A3A3A9D9D3A9D9D3A9D9D9D
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A7F3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D9D9D3A3A
-% 9D9D9D9D9D9D9D3A3A3AFF3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D9D9D9D9D
-% 9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A9D3A3A9D3A3A3A3A3A3A9D7F3A3A9D3A3A9D3A9D3A9D9D9D9D9D3A9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A9D3A9D9D9D3A9D3A9D3A9D9D3A9D
-% 9D9D3A9D3A9D3A3A3AFF3A3A9D3A9D3A9D3A3A9D3A3A3A9D3A9D3A9D9D3A
-% 9D3A9D3A9D3A3A9D3A9D3A3A9D9D9D9D3A9D9D9D9D9D3A9D3A9D3A3A3A3A
-% 3A3A7F3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D3A3A3A9D9D9D3A9D9D3A9D9D9D3A
-% FF9D9D9D9D3A3A9D9D9D9D9D3A9D9D9D9D3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A3A3A3A
-% 3A7F3A3A3A3A9D3A3A9D3A3A9D3A3A9D9D3A3A3A3A9D3A9D9D3A9D9D9D9D
-% 9D3A3A3A9D9D9D3A9D3A9D9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A0000
-% 00000000210018181010C512161216101316101818181818181010100E10
-% 1010101010181818181A181A18181818121012101012101010101200FF10
-% 181818181818181818161216121810181018101210101818161010101008
-% 1012161818181818181A1818181818181810121010101218101010121012
-% 181818AF18181AFF7D00000000000000003A3AFFFFFF3A3A3A9D3A9D9D3A
-% 3A3A9D9D3A9D9D3A3A3A9D3A3A3A9D9D3A9D3A9D9D3A9D3A3A9D9D9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 9D9D9D9D3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A9D3A9D9D9D3A3A9D
-% 9D9D9D9D9D9D9DFFFFFF3A9D3A3A3A3A3A3A3A9D3A3A3A9D9D9D9D9D9D9D
-% 9D3A3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A9D3A9D3A9D9D9D9D9D9D9D3A9D
-% 9D9D9D9D9D9D3A9D3A9D9D3A9D3A9D3A9D9D9D3A9D9D3A9D3A9D9D9D9D3A
-% 3A9D3A3A3A3A9D3AFFFFFF3A3A3A3A9D3A9D3A3A3A9D3A3A3A3A3A3A3A3A
-% 9D3A3A3A9D9D9D9D3A9D9D9D3A9D9D9D9D3A9D9D9D3A9D3A3A3A3A3A3A7F
-% 7F7F3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A3A3A3A9D9D9D9D3A9D9D9D9DFFFFFF
-% 9D9D3A9D3A3A3A3A9D3A3A9D9D9D9D9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A3A3A3A
-% 7F7F7F3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A9D9D3A3A9D3A9D9D9D
-% 3A9D3A9D9D9D3A3A3A9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000
-% 0000002100181A1818C51818121818181218181818181818161210101010
-% 101010101210181818181818181818161216121810181018101200FF1012
-% 161818181818101210121018181818181312101010101212181810121012
-% 101818181818181818181A18181818101210101010121610101210121012
-% 1018AF181818FF7D0000000000000000FFFF535353FFFF9D3A3A9D9D9D9D
-% 9D9D3A9D9D9D3A3A9D9D3A9D3A9D9D3A3A3A3A9D3A3A3A9D3A3A9D9D9D9D
-% 3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D
-% 9D9D3A3AFFFF535353FFFF3A3A3A3A3A3A3A3A3A3A9D9D9D9D3A9D3A9D3A
-% 9D3A9D9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A7F7F1313137F7F3A3A9D9D3A9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D3A9D3A9D9D9D3A9D9D9D3A9D9D3A9D3A9D3A3A9D9D3A3A9D
-% 3A9D3A9D3AFFFF535353FFFF9D3A9D3A9D9D3A3A3A9D3A3A9D3A9D3A9D3A
-% 3A9D3A3A9D9D3A9D3A9D9D9D9D3A9D9D9D9D3A9D3A9D3A3A3A3A7F7F1313
-% 137F7F3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A
-% 3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A9D9D9D3AFFFF535353FF
-% FF9D9D9D9D9D3A3A9D9D9D3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A9D3A9D
-% 3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D3A7F7F13
-% 13137F7F3A3A3A3A9D3A3A9D3A9D3A3A3A9D3A9D9D3A9D9D9D3A9D3A9D3A
-% 3A3A9D9D3A9D3A3A3A9D3A9D9D9D3A9D3A3A9D3A3A9D3A3A3A3A00000000
-% 0000210018181818C5101816181018181612101010121818181010101010
-% 1010101010121618181818181012101210181818181813121000FF101218
-% 161818101010101010101818181818181010101010101618181816101018
-% 181818181818181818181818181012101010101010121010101210101210
-% 18AF121612FF7D00000000000000FF53535353535353FF3A3A9D9D9D9D9D
-% 9D3A9D9D9D3A3A9D9D3A9D3A9D9D3A3A3A3A9D3A3A3A9D3A3A9D9D9D9D3A
-% 3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D
-% 9D3AFF53535353535353FF3A3A3A3A3A3A3A3A3A9D9D9D9D3A9D3A9D3A9D
-% 3A9D9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D7F131313131313137F3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D3A9D3A9D9D9D3A9D9D9D3A9D9D3A9D3A9D3A3A9D9D3A3A9D3A
-% 9D3A9DFF53535353535353FF3A9D3A9D9D3A3A3A9D3A3A9D3A9D3A9D3A3A
-% 9D3A3A9D9D3A9D3A9D9D9D9D3A9D9D9D9D3A9D3A9D3A3A3A7F1313131313
-% 13137F3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A
-% 3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A9D9D9DFF53535353535353
-% FF9D9D9D9D3A3A9D9D9D3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A9D3A9D3A
-% 3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D7F13131313
-% 1313137F3A3A3A9D3A3A9D3A9D3A3A3A9D3A9D9D3A9D9D9D3A9D3A9D3A3A
-% 3A9D9D3A9D3A3A3A9D3A9D9D9D3A9D3A3A9D3A3A9D3A3A3A3A0000000000
-% 00210016121818C518181218181810181010101010101218101010121010
-% 10101010121816181810101010101010181818181818101000FF10101012
-% 101012101010101012181818181818181010080A10101012181818181818
-% 181818181218181818171812181010101010101012181810101012161818
-% AF181618FF7D00000000000000FF53535353535353FF9D9D9D9D3A9D3A9D
-% 9D9D3A9D3A3A9D9D3A3A9D9D9D3A3A9D9D3A3A9D3A3A3A3A9D3A3A9D3A3A
-% 3A9D3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A9D9D3A
-% 3AFF53535353535353FF3A3A3A3A3A3A3A3A3A9D9D3A3A9D9D9D9D9D9D9D
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A7F131313131313137F3A9D3A3A9D9D9D9D9D9D9D9D9D9D9D3A
-% 9D9D9D3A9D9D9D9D9D3A3A3A3A9D9D9D9D3A9D3A3A9D9D3A9D9D9D3A3A3A
-% 9D3AFF53535353535353FF3A9D3A9D3A3A3A3A9D3A3A3A9D3A3A3A9D3A9D
-% 3A9D3A3A9D3A9D9D9D9D9D9D9D3A9D9D9D3A3A9D3A3A3A7F131313131313
-% 137F9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D9D9DFF53535353535353FF
-% 3A9D3A9D9D9D9D9D9D3A3A9D3A9D3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D9D7F1313131313
-% 13137F9D3A3A3A3A3A9D3A3A3A3A3A9D3A9D9D9D3A9D9D3A9D9D3A3A9D3A
-% 9D9D9D9D3A9D3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000
-% 210016181618C51A18181810121818181812101010101018121610101210
-% 101010101012101012101010101012181818181818181000FF1210121018
-% 101810101010101012161818181A18181010101010101010101018181818
-% 1818181618181818181018101210101010101218181818161210121018AF
-% 181818FF7D000000000000FF535353535353535353FF3A9D9D3A9D9D9D9D
-% 9D9D9D3A3A9D9D3A3A9D9D9D3A9D3A9D9D9D9D3A3A3A3A9D9D9D9D3A3A3A
-% 3A3A7F1313131313131313137F3A9D3A3A3A3A9D3A3A9D9D9D3A3A3A9D9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A9D9D9D9D9D9DFF
-% 535353535353535353FF3A3A3A3A3A9D9D3A9D9D9D3A3A9D3A3A9D3A9D3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F1313131313131313137F3A3A3A9D9D9D9D9D9D9D9D9D3A9D3A9D
-% 9D3A9D3A9D3A3A3A3A3A3A9D3A3A9D3A9D9D3A9D3A9D9D3A3A9D3A3A3A9D
-% FF535353535353535353FF3A9D3A9D3A9D3A3A3A3A9D3A3A3A9D3A3A9D3A
-% 3A3A9D3A9D9D9D3A9D3A9D9D9D9D9D9D3A9D3A9D3A7F1313131313131313
-% 137F3A3A3A9D3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3AFF535353535353535353FF
-% 9D9D9D9D9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A3A9D9D7F13131313131313
-% 13137F3A3A3A3A9D9D3A9D3A3A3A9D9D3A3A3A3A9D9D9D3A9D9D3A3A3A9D
-% 9D9D3A3A3A3A9D9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A00000000000021
-% 0018181818C5181818181816181818181710101210121612101210101818
-% 101210121018101810101010101012161818181A181800FF181818181818
-% 181810121210121012181818181818181010101010101010101012161818
-% 18181818171812161210121010121012181818181818181810121018AF18
-% 1818FF7D000000000000FF535353535353535353FF3A9D9D3A9D9D9D9D9D
-% 9D9D3A3A9D9D3A3A9D9D9D3A9D3A9D9D9D9D3A3A3A3A9D9D9D9D3A3A3A3A
-% 3A7F1313131313131313137F3A9D3A3A3A3A9D3A3A9D9D9D3A3A3A9D9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A9D9D9D9D9D9DFF53
-% 5353535353535353FF3A3A3A3A3A9D9D3A9D9D9D3A3A9D3A3A9D3A9D3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A7F1313131313131313137F3A3A3A9D9D9D9D9D9D9D9D9D3A9D3A9D9D
-% 3A9D3A9D3A3A3A3A3A3A9D3A3A9D3A9D9D3A9D3A9D9D3A3A9D3A3A3A9DFF
-% 535353535353535353FF3A9D3A9D3A9D3A3A3A3A9D3A3A3A9D3A3A9D3A3A
-% 3A9D3A9D9D9D3A9D3A9D9D9D9D9D9D3A9D3A9D3A7F131313131313131313
-% 7F3A3A3A9D3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3AFF535353535353535353FF9D
-% 9D9D9D9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A3A9D9D7F1313131313131313
-% 137F3A3A3A3A9D9D3A9D3A3A3A9D9D3A3A3A3A9D9D9D3A9D9D3A3A3A9D9D
-% 9D3A3A3A3A9D9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A0000000000002100
-% 18181818C518181818181811181218181818161210181018101818181818
-% 18181818181818181012121012101218181818181800FF1A181818181818
-% 181818101010101012181818181818101810121010101010101210181218
-% 18181818161218101210101010101018181818181A181810101012AF1216
-% 12FF7D000000000000FF535353535353535353FF3A9D9D9D9D9D9D3A9D3A
-% 9D9D3A3A9D3A3A9D9D9D3A9D9D3A9D9D3A9D9D9D3A9D9D3A9D3A3A3A3A3A
-% 7F1313131313131313137F3A3A3A9D3A3A3A3A3A3A9D9D9D9D9D9D3A3A3A
-% 3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A9D3A3A9DFF5353
-% 53535353535353FF9D9D9D3A9D9D9D3A9D3A9D9D9D9D9D3A9D9D9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A9D3A
-% 3A7F1313131313131313137F3A9D3A3A9D9D9D9D9D9D9D9D9D3A9D3A9D9D
-% 9D3A9D3A9D9D9D9D9D3A3A9D3A3A9D9D9D3A3A3A3A9D9D3A9D3A9D3AFF53
-% 5353535353535353FF3A9D9D3A3A9D3A3A9D3A9D9D3A9D3A9D9D3A9D9D3A
-% 3A9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D3A9D3A7F1313131313131313137F
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A9D3A3A3A9D3A9DFF535353535353535353FF9D3A
-% 3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D9D9D9D3A7F131313131313131313
-% 7F3A9D3A9D3A3A9D3A3A3A9D3A3A9D3A9D9D9D9D3A9D3A3A3A3A9D9D9D9D
-% 9D3A9D3A9D9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210016
-% 121612C512101818181818101012101818181012101210121818181A181A
-% 181818181818181818101010101012181818181800FF1818181818181818
-% 181818121010101210121018101812101216181018121610101210181718
-% 181818181810181012101010121818181A181818181818101010AF101010
-% FF7D00000000000000FF53535353535353FF3A3A9D9D3A9D9D9D9D9D9D9D
-% 9D3A9D9D3A3A9D9D3A9D3A9D9D9D9D9D9D3A9D3A9D3A9D9D3A3A3A3A3A3A
-% 7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D3A9D9D3AFF5353
-% 5353535353FF9D9D9D9D9D9D9D9D3A9D3A9D9D9D3A9D9D9D3A9D9D3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A7F131313131313137F3A3A3A3A3A9D9D9D9D3A9D9D9D3A9D3A9D3A9D3A
-% 9D9D3A9D3A3A3A3A3A3A9D3A9D9D3A3A3A9D9D9D3A3A3A3A3A3A9D9DFF53
-% 535353535353FF3A9D9D9D3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A9D3A3A9D
-% 3A9D9D9D9D9D9D9D9D9D9D9D3A3A3A3A9D3A3A7F131313131313137F3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3AFF53535353535353FF3A3A3A9D
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A3A3A7F131313131313137F3A
-% 3A3A3A9D9D9D3A9D3A9D9D9D9D3A3A9D9D3A9D3A3A9D3A9D3A9D9D9D9D9D
-% 3A3A3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A00000000000021001010
-% 1010C5101012161818101210101018121210101810121018181818181818
-% 1818181818181818181210101012101210181000FF1A1818181818181818
-% 1818181812101010101010121010181012181818181A1810121018181818
-% 18181818181817181012101216181818181A18181812101010AF101010FF
-% 7D00000000000000FF53535353535353FF3A3A9D9D3A9D9D9D9D9D9D9D9D
-% 3A9D9D3A3A9D9D3A9D3A9D9D9D9D9D9D3A9D3A9D3A9D9D3A3A3A3A3A3A7F
-% 131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D3A9D9D3AFF535353
-% 53535353FF9D9D9D9D9D9D9D9D3A9D3A9D9D9D3A9D9D9D3A9D9D3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 7F131313131313137F3A3A3A3A3A9D9D9D9D3A9D9D9D3A9D3A9D3A9D3A9D
-% 9D3A9D3A3A3A3A3A3A9D3A9D9D3A3A3A9D9D9D3A3A3A3A3A3A9D9DFF5353
-% 5353535353FF3A9D9D9D3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A9D3A3A9D3A
-% 9D9D9D9D9D9D9D9D9D9D9D3A3A3A3A9D3A3A7F131313131313137F3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3AFF53535353535353FF3A3A3A9D3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D3A3A3A7F131313131313137F3A3A
-% 3A3A9D9D9D3A9D3A9D9D9D9D3A3A9D9D3A9D3A3A9D3A9D3A9D9D9D9D9D3A
-% 3A3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A0000000000002100101010
-% 10C5101010121816181810121012101010101210181018161818181A1818
-% 18181818181818181818121010101010101200FF18181818181012101817
-% 181818181810121010121010121012161818181818181818101818181818
-% 18181818181818181816181818181A181818181618181810AF101010FF7D
-% 0000000000000000FFFF535353FFFF9D9D9D9D9D9D3A3A9D9D9D9D9D9D9D
-% 3A9D9D3A9D9D3A3A9D9D9D3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A9D7F
-% 7F1313137F7F3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D3A9D9D3AFFFF5353
-% 53FFFF3A3A9D3A9D3A3A9D9D3A9D9D9D9D3A9D3A9D3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 7F7F1313137F7F3A3A3A9D3A3A3A9D9D9D9D9D9D9D9D3A9D9D9D3A9D3A9D
-% 3A9D3A9D3A9D3A3A3A3A3A9D9D3A9D3A3A9D3A9D9D9D3A9D3A9D3AFFFF53
-% 5353FFFF3A9D9D9D3A9D3A3A9D9D9D9D9D3A9D9D9D3A3A9D3A3A3A3A9D9D
-% 9D9D9D9D9D9D9D9D9D9D3A9D3A9D3A3A3A3A7F7F1313137F7F3A3A3A3A9D
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3AFFFF535353FFFF3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F7F1313137F7F3A3A3A3A
-% 3A9D3A9D3A3A3A9D3A3A3A3A9D9D9D3A9D3A9D3A3A3A3A9D9D9D9D9D3A3A
-% 3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210010101010
-% C51010101010121818181818181612161216121012101218181818181818
-% 181012101817181818181810121010121000FF1818111210101010121818
-% 181818181818181210101210101210121810121618181818181818181A18
-% 18181818181818181818181818181A1818181818181810AF101210FF7D00
-% 000000000000003A3AFFFFFF3A3A3A3A3A9D9D9D9D9D3A9D9D9D9D9D9D9D
-% 9D9D3A9D9D9D9D9D3A3A3A3A9D3A3A3A3A3A3A9D9D3A3A3A9D3A3A9D9D3A
-% 7F7F7F9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D3A3AFFFFFF
-% 3A3A3A9D9D3A3A9D3A9D9D9D9D3A9D3A3A9D9D9D9D3A3A3A9D3A3A3A3A3A
-% 9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A7F7F7F3A3A3A3A3A3A9D3A3A9D9D9D9D9D9D9D3A9D3A3A9D9D3A3A3A3A
-% 9D3A9D3A3A3A9D3A9D3A3A3A9D3A3A9D3A9D9D3A9D9D3A3A9D9D9D9DFFFF
-% FF9D9D3A9D9D3A9D3A3A9D3A9D9D9D9D9D9D3A9D3A3A3A3A3A9D9D9D9D9D
-% 9D9D3A9D9D9D9D9D3A3A9D3A9D3A3A3A3A3A3A7F7F7F3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3AFFFFFFFF9D3A3A9D3A3A9D3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F7F3A3A3A3A3A9D
-% 3A9D3A3A9D9D9D9D3A3A9D9D9D9D9D3A3A3A9D3A3A3A9D9D3A9D9D3A3A3A
-% 9D9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210012101012C5
-% 101010101018181820191818181818181818101010121012181818111210
-% 1010101218181818181818181812101000FF181818161812181612101212
-% 181818181018101813181818181612161818181818181818181A18181818
-% 1A181818181210131618181818181818181210121012AF121618FF7D0000
-% 0000000000003A3A3A3AFF3A3A3A3A3A9D9D9D9D9D3A9D9D9D9D9D9D9D9D
-% 9D3A9D9D9D9D9D3A3A3A3A9D3A3A3A3A3A3A9D9D3A3A3A9D3A3A9D9D3A7F
-% 3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D3A3AFF9D9D3A
-% 3A3A9D9D3A3A9D3A9D9D9D9D3A9D3A3A9D9D9D9D3A3A3A9D3A3A3A3A3A9D
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A7F3A3A3A3A3A3A9D3A3A9D9D9D9D9D9D9D3A9D3A3A9D9D3A3A3A3A9D
-% 3A9D3A3A3A9D3A9D3A3A3A9D3A3A9D3A9D9D3A9D9D3A3A9D9D9D9D3A3AFF
-% 9D9D3A9D9D3A9D3A3A9D3A9D9D9D9D9D9D3A9D3A3A3A3A3A9D9D9D9D9D9D
-% 9D3A9D9D9D9D9D3A3A9D3A9D3A3A3A3A3A3A7F3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A9D3A3A3AFF3A3A3A9D3A3A9D3A3A9D3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A3A9D3A
-% 9D3A3A9D9D9D9D3A3A9D9D9D9D9D3A3A3A9D3A3A3A9D9D3A9D9D3A3A3A9D
-% 9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210016181818C510
-% 101010101018181818181818181810181818181012101018181818161812
-% 18161210121218181818101810181300FF10181018101818181818101618
-% 181818181818181816181212101210121818181818181818181818181818
-% 181A18181618181818181818181818181610101210AF121018FF7D000000
-% 00000000003A3A3A3A3AFF3A3A9D9D9D9D9D3A9D3A3A9D3A9D9D9D3A9D9D
-% 9D3A9D3A3A9D3A9D3A3A3A3A3A9D3A3A3A9D9D3A3A3A3A3A3A9D3A7F3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D9D9D9D9D3A9DFF3A9D9D9D9D
-% 9D3A9D3A9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A7F3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D9D3A
-% 9D3A9D3A9D3A3A9D9D9D3A9D3A3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D9DFF
-% 9D9D9D9D3A9D3A3A9D9D9D3A9D9D3A9D9D3A9D3A9D3A3A3A9D9D9D9D9D9D
-% 9D9D9D9D9D9D3A3A9D3A9D3A3A3A3A3A7F3A3A9D9D3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A9D3A3A9D3A3A3A3AFF3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A
-% 3A9D3A9D9D3A9D3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A9D3A9D3A
-% 9D9D9D9D3A3A9D9D3A9D9D9D9D9D3A9D3A3A3A9D9D9D9D9D9D3A9D3A3A9D
-% 9D9D9D3A9D3A3A3A3A3A9D3A3A3A3A000000000000210010181018C51012
-% 101010121012101217181818101818181810121010101810181018101818
-% 181818101618181818181818181800FF1012121212101018181818181210
-% 121018121612161210101010101010101018181818181818181818181A18
-% 1818181818181818181818181818181818131010AF101210FF7D00000000
-% 000000003A3A3A3A9DFFFFFF9D3A9D9D9D9D9D9D3A9D3A9D3A9D3A9D9D9D
-% 9D9D9D3A3A9D3A3A9D3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A7F7F7F3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D9D9D9D3A9DFFFFFF9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D3A9D3A9D3A9D9D3A9D9D9D9D3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A7F7F7F3A3A3A3A9D3A9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A3A9D3A9D9D
-% 3A3A3A9D3A9D9D3A3A3A3A9D3A3A9D9D3A9D3A9D3A9D3A9D3A3A3A9DFFFF
-% FF9D9D9D3A3A3A9D9D3A9D3A3A3A3A9D3A9D3A9D3A9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D3A3A3A9D9D3A3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3AFFFFFFFF3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A7F7F7F7F9D9D9D9D9D9D
-% 9D9D9D3A9D9D3A9D3A9D9D9D9D9D3A9D3A3A3A9D9D9D9D3A9D3A3A3A9D9D
-% 9D9D3A9D3A3A9D3A3A3A3A3A3A3A000000000000210012101218C5101010
-% 101010101012181812181618101210121010101010121012121212101018
-% 1818181812101210181216121600FF121010101010121810181818161010
-% 12101010121012161210101010101010101210161818181818181A182018
-% 1A181818181818181818181818181818161810AF101010FF7D0000000000
-% 0000003A3A3AFFFF535353FFFF9D9D9D9D9D9D3A9D3A9D3A9D3A9D9D9D9D
-% 9D9D3A3A9D3A3A9D3A9D3A3A3A3A9D3A3A3A3A3A3A7F7F1313137F7F3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D9D9D9DFFFF535353FFFF9D9D9D9D9D
-% 9D9D9D9D9D9D3A9D3A9D3A9D9D3A9D9D9D9D3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F
-% 1313137F7F3A3A9D3A9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A3A9D3A9D9D3A
-% 3A3A9D3A9D9D3A3A3A3A9D3A3A9D9D3A9D3A9D3A9D3A9D3A3AFFFF535353
-% FFFF9D3A3A3A9D9D3A9D3A3A3A3A9D3A9D3A9D3A9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D3A3A3A9D9D3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A9DFFFF535353FFFF3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A7F7F1313137F7F9D9D9D9D9D
-% 9D9D3A9D9D3A9D3A9D9D9D9D9D3A9D3A3A3A9D9D9D9D3A9D3A3A3A9D9D9D
-% 9D3A9D3A3A9D3A3A3A3A3A3A3A000000000000210010101210C512121012
-% 101012101012101817121210181618101210101010121010101010121810
-% 18181816101012101010121000FF10101012101210101218181810121012
-% 161218121612101010101008100E1010101012121618181818181A181818
-% 181818181818181818181818181818181810AF101010FF7D000000000000
-% 00003A3AFF53535353535353FF9D9D9D9D3A9D3A3A9D9D9D3A9D3A9D9D9D
-% 3A3A3A9D3A9D9D9D3A9D9D9D9D3A3A9D3A3A3A7F131313131313137F3A3A
-% 3A3A3A3A3A9D3A3A9D3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A9D3A3A3A3A3A3A3A9D3AFF53535353535353FF9D9D3A3A9D
-% 9D9D3A3A3A9D9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D7F131313
-% 131313137F3A9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D3A9D3A9D
-% 3A9D9D3A9D3A9D9D3A3A3A9D9D3A9D3A9D9D9D9D9D9D3AFF535353535353
-% 53FF3A9D3A9D9D9D3A3A9D9D9D9D9D9D3A3A3A9D9D9D3A9D9D9D9D9D9D9D
-% 9D9D3A3A9D3A9D3A7F131313131313137F3A3A9D3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A
-% 9D9D3A9D3AFF53535353535353FF3A9D3A9D3A9D9D9D9D9D3A9D9D9D9D9D
-% 9D9D3A9D9D9D9D3A9D9D3A9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F9D9D9D9D9D
-% 9D3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A9D9D9D3A9D9D9D3A3A3A9D9D9D9D
-% 3A9D3A3A3A3A3A3A3A3A3A3A000000000000210010101012C51817181612
-% 101010121618181818101618181816181618181010101012101210101218
-% 181810121012161218121600FF1012101010101010101012181818181012
-% 1010101012101210101010101010101010101012181818181A18181A1818
-% 1818181718181216181818181816181810AF101008FF7D00000000000000
-% 003A3AFF53535353535353FF9D9D3A9D9D9D9D3A9D9D3A3A3A9D3A9D3A3A
-% 3A9D3A9D3A3A3A3A9D3A9D9D3A9D3A3A3A3A7F131313131313137F3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3AFF53535353535353FF9D9D3A3A9D9D
-% 9D3A3A9D3A3A9D9D3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A7F13131313
-% 1313137F3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D3A9D9D3A3A3A
-% 9D3A9D3A9D3A9D3A9D3A9D3A9D9D9D9D3A9D3A9D3A9DFF53535353535353
-% FF3A3A3A3A9D9D9D9D9D9D3A9D3A9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D3A9D9D3A9D3A7F131313131313137F3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A9D3AFF53535353535353FF3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A7F131313131313137F9D9D9D9D3A9D
-% 9D3A3A9D9D3A3A3A9D9D9D3A3A3A9D9D3A9D3A9D9D3A9D3A9D9D9D9D9D3A
-% 9D3A3A3A3A3A3A3A3A3A3A000000000000210010081010C5181818181818
-% 181613181818181818121818181818181818101012101010101010101012
-% 1818181810121010101000FF121010121012101210121010121612161216
-% 121813181718101210101010101010101010101816181818181A18181818
-% 18181210121012181217181818121810AF100810FF7D0000000000000000
-% 3AFF535353535353535353FF9D3A9D9D9D9D3A9D9D3A3A3A9D3A9D3A3A3A
-% 9D3A9D3A3A3A3A9D3A9D9D3A9D3A3A3A7F1313131313131313137F3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3AFF535353535353535353FF9D3A3A9D9D9D
-% 3A3A9D3A3A9D9D3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A7F131313131313
-% 1313137F9D9D3A9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D3A9D9D3A3A3A9D
-% 3A9D3A9D3A9D3A9D3A9D3A9D9D9D9D3A9D3A9D3AFF535353535353535353
-% FF3A3A3A9D9D9D9D9D9D3A9D3A9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 3A9D9D3A9D7F1313131313131313137F3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A9DFF535353535353535353FF3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D7F1313131313131313137F9D9D9D3A9D9D
-% 3A3A9D9D3A3A3A9D9D9D3A3A3A9D9D3A9D3A9D9D3A9D3A9D9D9D9D9D3A9D
-% 3A3A3A3A3A3A3A3A3A3A000000000000210008101010C51818181A18181A
-% 181818181A18181818181818181818181810121010121012101210121010
-% 12161216121612181300FF10101210101210181210121010121018181818
-% 1816181818181610101010100A0E10101212181218181818181818181818
-% 101012101010121618121612181610AF10080AFF7D00000000000000003A
-% FF535353535353535353FF9D9D3A9D9D9D3A3A9D3A9D9D9D9D3A3A3A3A3A
-% 3A9D9D9D3A9D9D9D3A3A9D9D9D3A9D7F1313131313131313137F9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3AFF535353535353535353FF9D9D3A9D9D9D9D
-% 9D9D9D9D3A9D9D9D9D3A3A9D3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A7F13131313131313
-% 13137F3A9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A3A9D9D9D9D
-% 9D3A9D3A9D3A9D3A3A9D9D9D3A3A9D9D3A9D3AFF535353535353535353FF
-% 9D3A9D3A3A9D9D9D9D9D3A9D3A3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A3A
-% 9D3A9D3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3AFF535353535353535353FF3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A7F1313131313131313137F9D9D9D9D3A3A9D
-% 9D9D9D9D9D3A3A3A3A9D3A9D9D9D9D9D9D3A9D9D9D3A3A9D9D9D9D3A9D3A
-% 3A9D3A3A3A3A3A3A3A0000000000002100080A1010C51818181820181818
-% 181818181818181812101210181216181010101210101210181210121010
-% 121018181818181600FF12181018181818181A1818181810101818161216
-% 121012101218181818121010101010101010101818181818181818101018
-% 1218161216121012101210101218AF101010FF7D00000000000000003AFF
-% 535353535353535353FF9D3A9D3A9D3A3A9D3A3A9D9D3A3A3A9D9D3A9D3A
-% 3A3A3A9D3A3A9D9D9D3A9D9D9D3A7F1313131313131313137F3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3AFF535353535353535353FF9D3A9D9D3A9D3A3A
-% 9D9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313131313
-% 137F3A3A9D3A9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A9D3A9D3A9D3A9D3A9D
-% 9D9D3A9D9D3A3A3A9D3A3A9D9D3A3A9D9D3AFF535353535353535353FF3A
-% 3A3A3A9D3A3A3A3A3A3A9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A
-% 3A9D3A7F1313131313131313137F3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% FF535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F1313131313131313137F9D3A3A3A3A9D3A9D
-% 3A9D3A3A9D9D3A3A9D9D9D9D9D3A3A9D9D3A9D3A3A9D9D9D3A9D3A9D3A3A
-% 3A3A3A3A3A3A3A3A000000000000210010101010C51816181A181A181A18
-% 181A181A1816121010C5C5C5C51210181218C5C5181818181AC5C5C5C510
-% 1018181612161200FF101012101818181818181A18181218181818181812
-% 101810101218181010101010101010101210121618181818161210121018
-% 10181818181018101210121012AF121010FF7D00000000000000003A3AFF
-% 53535353535353FF3A9D3A9D3A9D3A3A9D3A3A9D9D3A3A3A9D9D3A9D3A3A
-% 3A3A9D3A3A9D9D9D3A9D9D9D3A3A7F131313131313137F3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF9D9D3A9D9D3A9D3A3A9D
-% 9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F
-% 3A3A3A9D3A9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A9D3A9D3A9D3A9D3A9D9D
-% 9D3A9D9D3A3A3A9D3A3A9D9D3A3A9D9D3A9DFF53535353535353FF9D3A3A
-% 3A3A9D3A3A3A3A3A3A9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A3A
-% 9D3A3A7F131313131313137F3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% FF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F9D9D3A3A3A3A9D3A9D3A
-% 9D3A3A9D9D3A3A9D9D9D9D9D3A3A9D9D3A9D3A3A9D9D9D3A9D3A9D3A3A3A
-% 3A3A3A3A3A3A3A000000000000210010101010C518181818181A18181A18
-% 1A181818181210C5C51210C5C518121010C5C518181818C5C51A18C5C518
-% 18181818181200FF10121010121012181818181818181818181818181718
-% 131010101010121010101010101010101210101212121012101010121012
-% 181818181818101210101010AF121818FF7D00000000000000003A3AFF53
-% 535353535353FF9D9D9D9D9D9D9D3A9D3A9D9D9D3A3A9D9D3A3A3A9D9D9D
-% 9D9D3A9D3A9D9D9D3A9D9D9D3A7F131313131313137F3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3AFF53535353535353FF9D9D9D9D9D9D9D9D9D9D9D
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A7F131313131313137F3A
-% 9D3A9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D3A9D3A9D9D9D3A9D
-% 9D9D3A3A3A9D3A9D9D3A9D3A9D3A3A3A3AFF53535353535353FF3A3A3A3A
-% 3A3A3A9D3A3A9D3A9D3A3A3A9D9D9D9D3A9D9D9D3A9D9D9D9D3A9D3A3A9D
-% 9D3A7F131313131313137F3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF
-% 53535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A7F131313131313137F9D9D3A3A9D9D9D9D3A9D3A
-% 9D9D9D9D9D9D3A3A9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D3A9D3A3A3A3A
-% 3A3A3A3A3A3A000000000000210018181813C5181818181A181818181818
-% 181818181010C5C51010C5C510101012101012101218C5C51818C5C51818
-% 181818181700FF1810101210101818181818181818181818181818181816
-% 101012101010101010101010101210101210121010121010101010101216
-% 1818181818181010101010AF101018FF7D00000000000000003A3A3AFFFF
-% 535353FFFF9D9D9D3A9D9D3A9D3A9D3A9D3A3A9D3A9D3A3A9D9D3A9D9D9D
-% 9D3A9D3A9D3A9D9D9D9D3A9D9D7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3AFFFF535353FFFF3A3A3A9D9D3A3A3A9D9D3A3A3A
-% 9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A7F7F1313137F7F3A3A3A
-% 9D3A9D3A3A9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D3A3A9D3A9D3A9D3A9D
-% 3A9D9D9D3A9D3A9D9D3A9D3A3A9D3A3A3AFFFF535353FFFF9D3A3A3A9D3A
-% 3A9D3A3A9D3A9D3A3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A3A
-% 3A3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A9D3A9D9D3A9D9D9D9D3A3A3A9D3A9D9D3A9D3A3AFF
-% FF535353FFFF9D3A3A9D9D3A3A3A9D9D3A9D9D3A9D9D9D9D3A9D3A9D3A3A
-% 9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F9D3A3A9D9D9D9D9D9D9D3A3A9D
-% 9D3A9D9D9D9D3A3A9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D3A9D3A3A9D3A3A
-% 9D3A3A3A3A000000000000210010181816C5C5C5C5C5C5C5C5C5C5C5C5C5
-% 1818101010C5C51010C5C510181810101210101818C5C51818C5C5181818
-% 1818181800FF181818101612181018181818181818181818181818181818
-% 181010121018181010101210101012101010101210101210101010101218
-% 18181818181012101010AF0A1010FF7D00000000000000003A3A3A3A3AFF
-% FFFF3A9D9D9D9D3A9D9D3A9D3A9D3A9D3A3A9D3A9D3A3A9D9D3A9D9D9D9D
-% 3A9D3A9D3A9D9D9D9D3A9D9D3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3AFFFFFF3A9D3A3A3A9D9D3A3A3A9D9D3A3A3A9D
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A7F7F7F3A3A3A3A3A9D
-% 3A9D3A3A9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D3A3A9D3A9D3A9D3A9D3A
-% 9D9D9D3A9D3A9D9D3A9D3A3A9D3A3A3A9D3AFFFFFF3A3A9D3A3A3A9D3A3A
-% 9D3A3A9D3A9D3A3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A3A3A
-% 3A3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A9D3A9D9D3A9D9D9D9D3A3A3A9D3A9D9D3A9D3A3A9D9D
-% FFFFFF9D3A9D3A3A9D9D3A3A3A9D9D3A9D9D3A9D9D9D9D3A9D3A9D3A3A9D
-% 3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A9D9D3A3A9D9D9D9D9D9D9D3A3A9D9D
-% 3A9D9D9D9D3A3A9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D3A9D3A3A9D3A3A9D
-% 3A3A3A3A000000000000210010101012C518181818181818181718181818
-% 12101210C5C51210C5C518181818181016121810C5C5C5C5C51818181818
-% 18181800FF1A181812121210181012121018181818181818181216181818
-% 101210181818101018101818181816121012101012161010101010121818
-% 181818181012101010AF100810FF7D00000000000000003A3A3A3A3A3A3A
-% FF9D3A9D9D3A9D9D9D9D9D9D3A9D9D3A3A9D3A9D3A9D9D9D9D9D9D3A9D3A
-% 9D9D9D9D9D3A3A9D9D9D9D9D7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A9D3A3AFF3A3A3A3A3A3A3A9D9D3A3A9D9D3A3A3A3A3A3A
-% 9D3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A7F3A3A3A3A3A9D3A
-% 9D3A3A9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9D3A9D3A9D3A9D9D9D3A
-% 9D3A9D3A9D3A9D9D3A3A9D3A9D3A3A3A3A9D3A3AFF3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D3A3A9D9D3A9D3A3A3A3A
-% 3A3A7F3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A9D3A3A3A3A9D3A9D3A3A3A9D9D3A3A3A3A3A9D3A9D3AFF
-% 3A9D3A9D9D3A3A9D9D3A3A3A3A9D9D3A9D3A9D3A9D9D3A3A3A3A9D3A9D3A
-% 9D9D3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A9D
-% 3A3A9D3A3A9D3A3A3A3A3A3A7F3A3A9D3A3A9D9D9D9D3A9D9D3A9D9D9D9D
-% 9D3A9D9D9D3A3A9D9D9D9D3A9D3A3A3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A
-% 3A3A3A000000000000210008101010C51818171818181818181818181612
-% 101010C5C51012C5C518181A18181212121018C5C5121018181818181818
-% 181200FF1818121010101012101010121012181818171818161812181012
-% 1210121218181818181818181A1818181010181818101210101010101818
-% 1818181612171210AF101010FF7D00000000000000003A3A3A9D3A3A3AFF
-% 3A9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A9D9D9D9D3A9D9D9D9D9D9D3A9D
-% 9D9D9D9D9D9D3A9D9D9D9D7F9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3AFF9D3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D3A3A3A9D3A3A3A3A9D3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A3A3A3A3A9D
-% 9D3A9D9D9D9D9D9D9D9D9D3A9D3A9D9D3A3A9D3A9D9D3A9D9D9D3A9D3A9D
-% 3A3A3A9D3A9D3A3A9D3A3A3A3A3A3A9D3A3A9DFF3A3A9D3A9D3A3A9D3A3A
-% 3A9D3A9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A9D3A9D3A3A3A3A
-% 7F9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A9D9D3A9D3A3A3A3A9D3A9D9D9D9D3A9D9D9D9D3A9D9D3A3AFF9D3A
-% 9D3A3A3A3A3A3A9D3A3A3A3A9D9D3A9D9D3A9D3A3A3A3A3A9D9D3A9D3A9D
-% 3A3A3A9D3A3A3A9D3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A7F9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D
-% 9D9D9D3A9D3A3A9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A000000000000210010101010C5101218181818181818111813181010
-% 1010C5C51218C5C5181A181812101010101210C5C5121012181818171818
-% 1600FF181810101010101210101010101216181818181012101210101010
-% 101010101818181818181818181818181818181818101010101012181818
-% 18181818181810AF181210FF7D00000000000000003A3A3A9D3A3A3A9DFF
-% 9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A9D9D9D9D3A9D9D9D9D9D9D3A9D9D
-% 9D9D9D9D9D3A9D9D9D9D7F9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3AFF9D3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D3A3A3A9D3A3A3A3A9D3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D7F3A3A3A3A3A3A9D9D
-% 3A9D9D9D9D9D9D9D9D9D3A9D3A9D9D3A3A9D3A9D9D3A9D9D9D3A9D3A9D3A
-% 3A3A9D3A9D3A3A9D3A3A3A3A3A3A9D3A3A9DFF3A3A9D3A9D3A3A9D3A3A3A
-% 9D3A9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A9D3A9D3A3A3A3A7F
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A9D9D3A9D3A3A3A3A9D3A9D9D9D9D3A9D9D9D9D3A9D9D3A3AFF9D3A9D
-% 3A3A3A3A3A3A9D3A3A3A3A9D9D3A9D9D3A9D3A3A3A3A3A9D9D3A9D3A9D3A
-% 3A3A9D3A3A3A9D3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A9D7F9D3A9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D
-% 9D9D3A9D3A3A9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A
-% 3A000000000000210012101010C510101818181818181818181810121010
-% 1010C5C5C5C5181A1818181010101010121010C5C5C5C516181818181012
-% 00FF1818181010080810101010100B0E0A10101618181818181810181316
-% 121612161210121618181818181818161218101818181818161010101012
-% 101010121010AF121818FF7D00000000000000003A3A3A3A3A3A3A3AFFFF
-% FF3A9D3A9D3A9D3A9D9D9D3A3A9D3A3A9D9D3A9D9D9D9D9D9D9D9D3A9D9D
-% 9D3A9D9D9D3A7F7F7F9D9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3AFFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A9D3A
-% 9D9D9D9D9D9D9D9D9D9D3A9D3A9D3A9D3A9D3A9D9D3A3A9D9D9D9D3A3A3A
-% 9D3A9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A9DFFFFFF3A3A3A3A3A9D3A9D3A
-% 3A3A9D3A3A9D9D3A9D9D9D9D9D9D9D9D9D3A9D3A3A9D3A9D3A3A7F7F7F3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D9D3A3A3A3A9D9D3A3A9D9D3A3A3A9D3A3A9D3A3A3AFFFFFF3A3A9D3A
-% 3A3A3A9D3A9D3A9D3A3A9D9D3A9D9D3A3A3A3A3A3A3A3A9D3A3A3A9D9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D7F7F7F9D9D9D9D9D3A9D3A9D3A9D3A9D9D9D9D9D
-% 9D3A9D3A3A9D9D9D9D3A9D9D3A9D9D9D3A9D3A9D3A3A3A9D3A3A3A3A3A3A
-% 000000000000210018181618C51010181618181A18181813101018101810
-% 12181818181A18181818181010080810101010100B0E0A10101618181800
-% FF1818181612101010101010101010101010121818181818161018101612
-% 171218101210121818181818181818101810181818181818181810121010
-% 1210101010AF161818FF7D00000000000000003A3A3A3A3A3AFFFF535353
-% FFFF9D9D9D3A9D3A3A3A3A9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A9D9D3A9D
-% 9D9D9D7F7F1313137F7F9D3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 9DFFFF535353FFFF3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A7F7F1313137F7F3A9D3A9D9D3A
-% 3A9D9D9D9D9D9D9D9D3A9D9D3A9D3A3A3A9D3A3A9D9D3A9D3A3A3A3A3A9D
-% 3A3A3A9D3A3A3A3A9D3A3A9D3A3A3AFFFF535353FFFF9D3A9D3A9D3A3A9D
-% 9D3A3A9D9D9D9D9D9D3A9D9D9D9D9D3A9D9D3A9D3A3A3A7F7F1313137F7F
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A
-% 9D3A9D3A9D3A3A3A3A3A3A3A9D3A3A3A9D3A9D3AFFFF535353FFFF3A9D3A
-% 9D3A9D3A9D3A3A3A9D3A3A9D3A9D9D9D3A3A3A3A3A3A9D3A3A3A9D3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 9D3A3A3A3A3A3A7F7F1313137F7F9D9D9D9D3A9D9D3A9D9D3A9D3A9D9D9D
-% 9D9D9D3A3A9D9D3A9D9D3A9D9D3A9D9D9D3A9D3A3A3A3A3A9D3A3A3A3A00
-% 0000000000210018181818C5181818181818181818181810121012181612
-% 16181818181A1818181816121010101010101010101010101218181800FF
-% 181618181818181012101010101010101010121618181818121812181218
-% 121012101210121018181816181810181210121018181818181210101210
-% 12101210AF121818FF7D00000000000000003A3A3A3A3AFF535353535353
-% 53FF9D9D3A9D3A3A3A3A9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A9D9D3A9D9D
-% 9D7F131313131313137F3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3AFF
-% 53535353535353FF3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A7F131313131313137F9D3A9D9D3A3A
-% 9D9D9D9D9D9D9D9D3A9D9D3A9D3A3A3A9D3A3A9D9D3A9D3A3A3A3A3A9D3A
-% 3A3A9D3A3A3A3A9D3A3A9D3A3AFF53535353535353FF3A9D3A9D3A3A9D9D
-% 3A3A9D9D9D9D9D9D3A9D9D9D9D9D3A9D9D3A9D3A3A7F131313131313137F
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A9D
-% 3A9D3A9D3A3A3A3A3A3A3A9D3A3A3A9D3A9DFF53535353535353FF9D3A9D
-% 3A9D3A9D3A3A3A9D3A3A9D3A9D9D9D3A3A3A3A3A3A9D3A3A3A9D3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D
-% 3A3A3A3A3A7F131313131313137F9D9D9D3A9D9D3A9D9D3A9D3A9D9D9D9D
-% 9D9D3A3A9D9D3A9D9D3A9D9D3A9D9D9D3A9D3A3A3A3A3A9D3A3A3A3A0000
-% 00000000210018181818C518181818181818181818181813161810121818
-% 1818181A181818161818181818101210101010101010101012161800FF18
-% 12121618181812161210101010100A0F1010121818181618171816181618
-% 101210101010121018181812161218101010181818181818121612AFAFAF
-% AFAFAFAF101216FF7D00000000000000003A3A3A3A3AFF53535353535353
-% FF9D9D9D9D3A9D3A3A3A3A9D3A9D9D9D3A9D9D9D9D9D9D3A9D9D9D9D3A9D
-% 7F131313131313137F9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53
-% 535353535353FF3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A9D3A9D3A3A9D
-% 9D9D9D9D9D9D9D9D9D3A9D9D3A3A9D3A9D3A9D3A9D3A3A9D3A3A3A3A3A9D
-% 9D3A9D3A9D3A3A3A9D3A3A9DFF53535353535353FF3A3A3A3A3A3A3A3A9D
-% 3A3A9D9D9D9D9D9D9D9D9D9D3A3A9D9D3A9D3A9D7F131313131313137F3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D9D3A
-% 9D3A9D9D3A3A3A3A9D3A3A3A3A3A3A3A3AFF53535353535353FF3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D3A3A9D3A3A3A3A9D9D3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A7F131313131313137F9D9D3A9D9D3A9D9D3A9D9D9D9D3A9D3A9D
-% 3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000
-% 000000210012161818C518181A1818181A18181818181818181818161818
-% 18181818181812121618181812161210101010100A0F1010121800FF1810
-% 101012101216121810121010121010101010121618181818181818181810
-% 101010121010101210121612181018101818181818181816121810181018
-% 1210AF101212FF7D00000000000000003A3A3A3AFF535353535353535353
-% FF9D9D3A3A3A9D3A9D9D9D9D3A3A9D9D3A9D9D3A9D9D3A3A9D3A9D9D7F13
-% 13131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3AFF535353
-% 535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A7F1313131313131313137F3A3A9D9D3A3A9D
-% 9D9D9D9D9D9D3A9D9D3A3A3A3A9D3A3A9D9D3A9D3A3A3A3A3A3A3A3A9D3A
-% 9D3A3A3A3A9D3A3A3A9DFF535353535353535353FF3A3A9D3A9D3A9D3A3A
-% 9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A9D9D9D7F1313131313131313137F3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3AFF535353535353535353FF3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A7F1313131313131313137F9D9D9D3A9D3A9D3A9D9D3A9D9D9D3A9D9D
-% 9D3A9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A3A3A9D3A3A3A3A3A3A00000000
-% 0000210012121818C518181818181818181A181818181818181818181818
-% 1818181818101010121012161218101210101210101010101200FF181612
-% 101010101210121612101216101010101210121818181818181818181612
-% 101010101210121012101216121818181818181612101210121012101210
-% 10AF101010FF7D00000000000000003A3A3A3AFF535353535353535353FF
-% 9D9D3A3A3A9D3A9D9D9D9D3A3A9D9D3A9D9D3A9D9D3A3A9D3A9D9D7F1313
-% 131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3AFF53535353
-% 5353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A7F1313131313131313137F3A3A9D9D3A3A9D9D
-% 9D9D9D9D9D3A9D9D3A3A3A3A9D3A3A9D9D3A9D3A3A3A3A3A3A3A3A9D3A9D
-% 3A3A3A3A9D3A3A3A9DFF535353535353535353FF3A3A9D3A9D3A9D3A3A9D
-% 9D9D9D9D9D9D9D9D9D9D3A3A9D3A9D9D9D7F1313131313131313137F3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3AFF535353535353535353FF3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A7F1313131313131313137F9D9D9D3A9D3A9D3A9D9D3A9D9D9D3A9D9D9D
-% 3A9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A3A3A9D3A3A3A3A3A3A0000000000
-% 00210010101218C518181818181818181818181A18181818181818181818
-% 18181818161210101010121012161210121610101010121000FF18181816
-% 101010101012101210181216121010101012161818181818181818121810
-% 101010101010121012101810181818181818181210101210121012101210
-% AF100F10FF7D00000000000000003A3A3A3AFF535353535353535353FF3A
-% 9D9D3A3A3A3A9D9D3A9D9D3A9D3A9D9D9D9D9D3A3A9D9D9D9D3A7F131313
-% 1313131313137F3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9DFF5353535353
-% 53535353FF3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A7F1313131313131313137F3A3A3A9D9D3A9D9D9D
-% 9D9D9D9D9D9D3A3A9D3A3A3A9D9D9D3A9D3A3A9D9D9D3A3A3A3A9D3A9D3A
-% 9D3A9D3A3A3A3A3AFF535353535353535353FF3A9D3A3A3A3A3A3A9D9D9D
-% 9D9D9D9D9D9D9D9D9D3A9D3A3A9D3A9D7F1313131313131313137F3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 7F1313131313131313137F9D9D9D9D9D3A3A9D9D9D9D9D9D9D3A9D3A9D3A
-% 3A9D9D9D9D9D3A9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000
-% 21000F101010C5101818181818181A18181A181A18181818181818181818
-% 181818181816101010101012101210181216121010101000FF1818181818
-% 121010101010101818181810101010101012181818181818181818181012
-% 1010101210101010121018181018181818181816121010101210101010AF
-% 100A10FF7D00000000000000003A3A3A3A3AFF53535353535353FF9D9D9D
-% 9D3A3A9D3A9D9D9D9D3A3A9D9D3A9D9D9D9D9D3A9D3A9D9D9D9D7F131313
-% 131313137F9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3AFF5353535353
-% 5353FF3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A7F131313131313137F9D3A9D3A9D9D3A3A9D9D9D
-% 9D9D9D9D3A9D3A9D9D3A3A3A9D3A9D3A9D3A3A9D3A3A3A9D3A3A9D3A3A3A
-% 3A3A3A3A3A9D3A3AFF53535353535353FF3A3A3A3A9D3A9D3A3A9D9D9D9D
-% 9D9D9D9D9D9D9D9D3A9D3A9D3A3A9D3A7F131313131313137F3A3A3A3A3A
-% 3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 7F131313131313137F9D9D3A9D9D9D3A9D9D9D3A9D9D3A9D3A9D9D3A3A9D
-% 9D9D9D3A9D9D3A3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A00000000000021
-% 000A101010C510121018181818181A181A18201818181818181818181818
-% 1818181818181210101010101018181818101010101000FF181818181010
-% 1010101012181816181818181818181818181A1818181810101816181818
-% 18121610121012101810121010101818181012101012101010121010AF10
-% 0A08FF7D00000000000000003A3A3A3A3AFF53535353535353FF9D9D9D9D
-% 3A3A9D3A9D9D9D9D3A3A9D9D3A9D9D9D9D9D3A9D3A9D9D9D9D7F13131313
-% 1313137F9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3AFF535353535353
-% 53FF3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A7F131313131313137F9D3A9D3A9D9D3A3A9D9D9D9D
-% 9D9D9D3A9D3A9D9D3A3A3A9D3A9D3A9D3A3A9D3A3A3A9D3A3A9D3A3A3A3A
-% 3A3A3A3A9D3A3AFF53535353535353FF3A3A3A3A9D3A9D3A3A9D9D9D9D9D
-% 9D9D9D9D9D9D9D3A9D3A9D3A3A9D3A7F131313131313137F3A3A3A3A3A3A
-% 9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A7F
-% 131313131313137F9D9D3A9D9D9D3A9D9D9D3A9D9D3A9D3A9D9D3A3A9D9D
-% 9D9D3A9D9D3A3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A0000000000002100
-% 0A081010C510101012161818181818181A18181818101012101810181618
-% 18181818101010101010121818161818181818181800FF16181818101012
-% 081010101012181818181818181818181A181A1818161212181818181818
-% 161210121010121216181010121010101212161218101210101012AF1010
-% 10FF7D00000000000000003A3A3A3A3A3AFFFF535353FFFF9D9D9D9D9D3A
-% 3A3A9D9D9D9D3A9D9D3A3A9D3A9D3A9D9D3A9D9D9D9D3A9D3A7F7F131313
-% 7F7F9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF535353FFFF
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A9D3A9D3A9D9D3A3A9D9D9D9D
-% 9D9D9D3A9D9D3A3A3A9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D
-% 3A3A3A3A9D3A3AFFFF535353FFFF3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D
-% 9D9D9D9D3A3A3A9D3A9D3A9D3A3A3A7F7F1313137F7F3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3AFFFF535353FFFF3A3A3A3A9D3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D7F
-% 7F1313137F7F3A9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D3A3A9D3A9D9D3A9D
-% 9D9D9D3A9D9D9D9D9D3A9D3A3A9D3A3A9D3A3A3A3A000000000000210010
-% 101010C5101010101218181818181A181818181810121012101210121216
-% 181818101012081010101012181818181818181800FF121018121612100E
-% 0A081010101818181A18181A181818181818181812101018181818181818
-% 1810101813181618181210101010101010181816181810181216AF101010
-% FF7D00000000000000003A3A3A3A3A3A3A9DFFFFFF9D3A3A9D3A9D3A3A3A
-% 9D9D9D9D9D9D3A9D3A3A9D9D9D9D9D9D3A9D9D3A9D3A9D9D3A9D7F7F7F9D
-% 3A9D9D9D9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFFFF3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A9D3A3A9D3A9D9D3A3A9D9D9D9D9D
-% 3A9D3A9D3A9D3A3A3A3A3A9D3A9D3A3A3A9D3A3A3A9D3A9D9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3AFFFFFF3A3A3A3A9D3A3A9D3A3A9D9D9D9D3A9D9D9D9D
-% 9D9D9D3A3A9D3A9D9D3A9D3A3A3A3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3AFFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 7F7F7F3A9D3A9D9D9D3A9D9D3A3A9D9D9D9D9D9D9D3A9D9D3A3A9D3A3A9D
-% 9D9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A00000000000021001010
-% 1010C5100E1010121018181818181A181818181012161210181012101210
-% 18121612100E0A081010101818181A18181A1800FF101210181818181010
-% 100A1010181818181818181818181A181818181010121012101818181810
-% 18121816181818181618101010101012181818181618121618AF121010FF
-% 7D00000000000000003A3A3A3A3A3A3A9D3A9DFF9D3A3A9D3A9D3A3A3A9D
-% 9D9D9D9D9D3A9D3A3A9D9D9D9D9D9D3A9D9D3A9D3A9D9D3A9D7F9D9D9D3A
-% 9D9D9D9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F3A3A3A9D3A3A9D3A9D9D3A3A9D9D9D9D9D3A
-% 9D3A9D3A9D3A3A3A3A3A9D3A9D3A3A3A9D3A3A3A9D3A9D9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3AFF3A3A3A3A9D3A3A9D3A3A9D9D9D9D3A9D9D9D9D9D
-% 9D9D3A3A9D3A9D9D3A9D3A3A3A3A3A7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3AFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D
-% 3A7F3A9D3A9D9D9D3A9D9D3A3A9D9D9D9D9D9D9D3A9D9D3A3A9D3A3A9D9D
-% 9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A0000000000002100101010
-% 10C510101010101212101818181818181818181810181112101610101210
-% 181818181010100A1010181818181818181800FF10101010121018181810
-% 10101218181818181818181818181A181818101210101010121012101018
-% 101818181818181818181818181010181218101212101218AF101810FF7D
-% 00000000000000003A3A3A3A3A3A3A3A9D3A9DFF9D9D9D9D9D3A3A3A9D9D
-% 9D3A9D9D9D9D3A3A3A9D9D3A9D3A9D9D9D9D9D9D9D3A9D7F3A9D9D9D9D3A
-% 9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3AFF3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A7F3A3A9D9D3A3A3A3A9D9D3A3A9D9D9D9D9D9D
-% 9D9D3A3A3A9D3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A9D3A3A3A3A9D3A3AFF3A9D3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D9D9D9D
-% 3A3A9D3A3A9D3A9D3A3A3A3A3A7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A9D9D3A
-% 3A3A3A3A9D9D9D9D9D9DFF3A3A9D3A9D9D3A9D3A3A3A3A3A3A9D3A3A3A3A
-% 9D3A9D3A9D3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D3A9D3A3A9D
-% 9D7F9D3A9D3A9D9D3A9D9D9D9D3A9D9D3A9D3A9D3A9D9D3A3A3A3A3A3A9D
-% 9D9D9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210018101210
-% C51010101010101012181818181818181018101812181018121010101010
-% 121018181810101012181818181818181800FF1012101010101218181810
-% 121618181818181818181818181818181012101010101010101210121210
-% 1810181818181818181A18181812161216121010101012AF181012FF7D00
-% 000000000000003A9D3A3A3A3A3A9D3A9D9DFFFFFF9D3A9D3A3A9D9D9D9D
-% 9D9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D7F7F7F9D9D3A9D9D3A9D
-% 3A9D9D3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3AFFFFFF3A3A3A3A3A9D3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A7F7F7F3A9D3A3A9D3A9D9D9D3A9D9D9D9D9D9D9D
-% 3A9D3A9D3A9D3A9D9D3A3A9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A
-% 3A3A9D9D3A3A3A3AFFFFFF3A9D3A9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A
-% 3A9D3A3A9D3A9D9D3A3A7F7F7F3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D9D9D9D3A3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A3A9D9D9D9D9D
-% 3A3A9D9D9D3A9DFFFFFF3A3A3A9D9D9D9D9D3A3A3A3A9D9D9D3A3A3A3A3A
-% 9D9D9D9D3A3A3A3A3A9D9D9D9D3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A9D3A3A3A9D9D3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D9D
-% 7F7F7F3A9D9D9D9D9D3A9D9D9D9D9D9D9D9D3A9D9D9D3A3A9D9D3A3A3A9D
-% 9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210010121010C5
-% 101010101012101012121818161210101212161216181818121012101010
-% 1012181818101216181818181818181800FF1810121010100E1816121810
-% 181618161818161818181818181818121012101010101218181812101012
-% 12161218161818181818181818181818181018121010AF101216FF7D0000
-% 0000000000003A9D3A3A3A3A3A9D3AFFFF535353FFFF9D3A3A9D9D9D9D9D
-% 9D3A9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D7F7F1313137F7F3A9D9D3A9D3A
-% 9D9D3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3AFFFF535353FFFF3A3A3A9D3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A7F7F1313137F7F3A3A9D3A9D9D9D3A9D9D9D9D9D9D9D3A
-% 9D3A9D3A9D3A9D9D3A3A9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A
-% 3A9D9D3A3AFFFF535353FFFF3A9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A3A
-% 9D3A3A9D3A9D9D7F7F1313137F7F3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D9D9D9D3A3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A3A9D9D9D9D9D3A
-% 3A9D9D9DFFFF535353FFFF3A9D9D9D9D9D3A3A3A3A9D9D9D3A3A3A3A3A9D
-% 9D9D9D3A3A3A3A3A9D9D9D9D3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A9D3A3A3A9D9D3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A7F7F13
-% 13137F7F9D9D9D9D3A9D9D9D9D9D9D9D9D3A9D9D9D3A3A9D9D3A3A3A9D9D
-% 9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210012161210C510
-% 101010101012101210121012101010101012181818181818181012101010
-% 0E181612181018161816181816181800FF181810100A100A101010101812
-% 121218181818181818181818181810101010101216181818181810121010
-% 12161218181210101018181818181818181818180AAF101216FF7D000000
-% 00000000003A3A3A9D3A3A3A9DFF53535353535353FF3A3A9D9D9D9D9D9D
-% 9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D7F131313131313137F9D9D9D3A9D3A
-% 9D9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A7F131313131313137F3A9D3A9D9D9D3A3A9D9D9D9D9D9D9D9D
-% 9D3A9D9D3A3A3A9D9D3A9D3A9D3A3A3A3A3A9D3A9D3A3A3A9D3A3A3A3A9D
-% 3A3A3AFF53535353535353FF3A3A9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D9D
-% 3A3A3A3A9D7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D9D3A3A3A9D3A3A
-% 3A3AFF53535353535353FF3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D9D3A3A9D3A3A3A3A9D9D3A3A3A9D3A3A9D9D3A3A3A3A3A3A9D3A3A
-% 3A3A9D3A3A3A9D3A9D3A9D9D3A3A3A9D3A9D9D3A3A9D9D9D9D7F13131313
-% 1313137F3A9D3A9D3A9D3A9D3A9D3A9D9D3A9D9D9D9D9D9D9D9D3A3A9D9D
-% 9D9D9D3A9D3A3A9D3A3A3A3A3A3A3A000000000000210012161210C51010
-% 10101010101010101012101010101010121018181A181A181810100A100A
-% 101010101812121218181818181800FF181818101010100B101012101818
-% 181818181818181010181216121012101010101218181818181A18181216
-% 1218181210181818181818181816121816181818AF101210FF7D00000000
-% 000000003A3A3A3A3A3A3A3AFF53535353535353FF3A3A9D9D9D3A9D9D9D
-% 3A9D9D3A3A3A3A9D3A3A3A3A3A3A7F131313131313137F9D9D9D3A9D9D9D
-% 9D3A3A3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A7F131313131313137F3A3A9D3A9D3A9D3A9D9D9D9D9D9D9D9D3A
-% 9D3A9D3A9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9DFF53535353535353FF3A3A9D9D9D9D9D9D9D9D9D9D9D3A3A9D9D3A3A
-% 9D3A3A9D7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A
-% 3AFF53535353535353FF3A3A3A3A3A9D3A3A9D9D3A3A3A9D3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A9D3A3A3A
-% 3A9D3A3A3A9D9D3A3A3A9D9D3A3A3A3A9D3A3A9D9D3A9D9D7F1313131313
-% 13137F3A9D3A3A3A3A9D3A9D9D3A9D9D3A9D9D9D9D9D3A9D9D9D3A9D9D9D
-% 9D9D3A9D3A3A3A3A3A9D3A3A3A3A000000000000210012101818C5101216
-% 12181818181010121010121010101010121818181818181818101010100B
-% 1010121018181818181818181800FF181818101210101010101012101210
-% 181818181818181211181012101012101010101818181818181812101210
-% 18181012101218101818181818121012121018AF181012FF7D0000000000
-% 0000003A3A3A3A3A3A3AFF535353535353535353FF3A9D9D9D3A9D9D9D3A
-% 9D9D3A3A3A3A9D3A3A3A3A3A7F1313131313131313137F9D9D3A9D9D9D9D
-% 3A3A3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A7F1313131313131313137F3A9D3A9D3A9D3A9D9D9D9D9D9D9D9D3A9D
-% 3A9D3A9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% FF535353535353535353FF3A9D9D9D9D9D9D9D9D9D9D9D3A3A9D9D3A3A9D
-% 3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3AFF
-% 535353535353535353FF3A3A3A3A9D3A3A9D9D3A3A3A9D3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A
-% 9D3A3A3A9D9D3A3A3A9D9D3A3A3A3A9D3A3A9D9D3A9D7F13131313131313
-% 13137F9D3A3A3A3A9D3A9D9D3A9D9D3A9D9D9D9D9D3A9D9D9D3A9D9D9D9D
-% 9D3A9D3A3A3A3A3A9D3A3A3A3A000000000000210010121612C518181818
-% 181818181218161812101010101010101012181818181818101210101010
-% 10101210121018181818181800FF16181216121012101010121010101018
-% 181818181818181812161216121012101218181818181A18181010101010
-% 101010101010121012101210101010101018AF121012FF7D000000000000
-% 00003A3A3A3A3A3A3AFF535353535353535353FF3A9D3A9D9D9D9D9D3A9D
-% 3A3A3A9D3A3A3A9D3A9D3A7F1313131313131313137F9D9D9D3A9D9D9D3A
-% 3A3A9D3A3A3A3A3A9D3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A9D3A3AFF535353535353535353FF3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A7F1313131313131313137F3A9D3A9D9D9D3A3A9D9D9D9D9D9D9D9D3A9D
-% 3A9D9D3A9D3A9D3A9D3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A9D3A3A3A3AFF
-% 535353535353535353FF9D9D9D9D9D9D9D9D9D9D9D3A3A9D9D9D9D3A9D3A
-% 3A7F1313131313131313137F3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A9D9D3A3A3A9D3A3A3AFF53
-% 5353535353535353FF9D3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A9D9D3A3A3A9D3A3A3A9D3A9D3A3A3A3A9D3A3A3A3A9D
-% 3A3A3A9D3A3A3A3A3A9D9D9D3A9D3A9D3A9D9D9D9D7F1313131313131313
-% 137F9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A9D3A9D9D9D9D9D
-% 3A9D3A3A3A3A3A3A3A3A3A3A000000000000210010121018C51316181818
-% 181818181818181618181818101010101010181816181216121012101010
-% 121010101018181818181800FF1812161218101012101210101010101012
-% 18181818181818101812101210101217181A18181A181818181010101010
-% 1010101010101010101818121810101012AF121010FF7D00000000000000
-% 003A3A3A3A3A3A3AFF535353535353535353FF3A9D9D9D3A9D9D3A9D9D9D
-% 9D9D3A3A3A3A3A3A3A3A7F1313131313131313137F9D3A9D3A3A9D3A9D3A
-% 3A3A3A3A3A9D3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 7F1313131313131313137F3A9D3A9D3A3A9D9D3A3A9D9D9D9D9D9D9D9D3A
-% 9D3A9D9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3AFF53
-% 5353535353535353FF9D9D9D9D9D9D9D9D9D3A3A3A9D9D9D3A9D3A9D3A3A
-% 7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 9D9D9D3A3A9D3A3A3A3A3A3A9D9D3A3A3A3A3A9D9D3A9D9D3A3A3AFF5353
-% 53535353535353FF9D9D9D3A3A3A9D3A3A9D3A9D3A3A3A3A9D3A3A3A3A9D
-% 3A3A3A3A3A9D9D9D3A3A9D3A3A9D3A9D9D3A3A3A3A3A3A9D3A3A3A3A9D3A
-% 3A3A3A9D3A3A3A3A3A9D3A9D3A9D3A3A3A9D3A9D7F131313131313131313
-% 7F9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A9D9D3A3A9D9D9D9D9D3A
-% 9D3A3A3A3A3A9D3A3A3A3A000000000000210010101216C5181818181818
-% 18181A181818121818181818121010101012181812161218101012101210
-% 1010101010121818181800FF101018111818181818181818181818181818
-% 1818181818181818111810101218181818181A181A181818161010101010
-% 10101010101010181718181816121010AF101210FF7D0000000000000000
-% 3A3A3A3A3A3A3A9DFF53535353535353FF3A3A9D9D9D3A9D9D3A9D9D9D9D
-% 9D3A3A3A3A3A3A3A3A9D7F131313131313137F9D9D3A9D3A3A9D3A9D3A3A
-% 3A3A3A3A9D3A9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9DFF53535353535353FF3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 7F131313131313137F3A3A9D3A9D3A3A9D9D3A3A9D9D9D9D9D9D9D9D3A9D
-% 3A9D9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3AFF53
-% 535353535353FF9D9D9D9D9D9D9D9D9D9D3A3A3A9D9D9D3A9D3A9D3A3A3A
-% 7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D
-% 9D9D3A3A9D3A3A3A3A3A3A9D9D3A3A3A3A3A9D9D3A9D9D3A3A3A9DFF5353
-% 5353535353FF3A9D9D9D3A3A3A9D3A3A9D3A9D3A3A3A3A9D3A3A3A3A9D3A
-% 3A3A3A3A9D9D9D3A3A9D3A3A9D3A9D9D3A3A3A3A3A3A9D3A3A3A3A9D3A3A
-% 3A3A9D3A3A3A3A3A9D3A9D3A9D3A3A3A9D3A9D3A7F131313131313137F9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D3A9D9D3A3A9D9D9D9D9D3A9D
-% 3A3A3A3A3A9D3A3A3A3A000000000000210012101210C516181818181818
-% 181818181010121018181818181818101012101018111818181818181818
-% 18181818181818181800FF121810181018181018181818181A1818181818
-% 181A18181818161818131810181818181A18181818181818181012101010
-% 101010101010181818181818181810AF161816FF7D00000000000000003A
-% 3A3A3A3A3A3A3AFF53535353535353FF3A3A9D9D9D9D3A9D3A9D9D9D3A9D
-% 9D9D3A3A3A3A3A3A3A7F131313131313137F3A3A9D3A3A9D9D9D9D3A9D3A
-% 9D3A9D9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3AFF53535353535353FF9D3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F
-% 131313131313137F3A3A3A3A9D3A9D9D9D3A3A9D9D9D9D9D9D9D9D9D3A9D
-% 9D9D3A3A3A9D9D3A9D3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3AFF5353
-% 5353535353FF9D9D9D9D9D9D9D9D9D9D3A3A9D9D9D3A3A9D3A9D3A3A3A7F
-% 131313131313137F3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A9D3A
-% 9D3A3A3A3A9D3A3A3A3A9D9D3A3A3A3A3A3A9D9D9D9D3A3A3A3AFF535353
-% 53535353FF3A3A3A9D9D3A3A3A3A9D9D9D3A3A9D3A3A9D9D9D9D9D9D3A3A
-% 3A3A9D9D9D3A3A3A3A3A9D9D9D9D3A3A3A3A3A3A3A9D3A9D9D9D3A3A9D3A
-% 3A3A3A9D3A3A3A9D3A9D9D3A9D9D3A9D3A9D3A7F131313131313137F9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D3A9D3A3A9D9D3A9D9D3A9D3A
-% 3A3A3A3A3A3A3A3A3A000000000000210018161216C51812181618181618
-% 18121012101012101818181A181810101012181018101818101818181818
-% 1A1818181818181A00FF1810121812161218101818181818181818181A18
-% 181818181818181810181018181818181818181818181818101810121010
-% 1010101010121210121818181810AF181818FF7D00000000000000003A3A
-% 3A3A3A3A3A9D3AFFFF535353FFFF9D3A3A9D3A3A9D9D9D9D9D9D9D9D3A3A
-% 3A9D3A3A9D3A3A3A3A7F7F1313137F7F9D9D9D3A3A9D3A9D3A9D3A3A3A3A
-% 9D9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3AFFFF535353FFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A7F
-% 7F1313137F7F3A3A3A3A3A9D9D9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D9D3A
-% 3A9D3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A9D3A3A3A9DFFFF53
-% 5353FFFF9D9D9D9D9D9D9D9D9D9D3A3A9D9D9D9D9D9D9D3A3A3A3A9D3A7F
-% 7F1313137F7F3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D9D3A3A3A9D3A3A3A3A3AFFFF5353
-% 53FFFF3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A9D9D3A3A3A3A
-% 9D3A3A3A9D3A3A9D3A9D3A3A9D3A3A9D3A9D9D7F7F1313137F7F3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D3A9D9D3A3A9D9D9D9D9D9D3A9D3A3A
-% 9D3A3A3A3A3A3A3A000000000000210018181812C5101210181218181810
-% 101810181010121218181818181810121810121812161218101818181818
-% 181818181A181800FF17181612161012161210181818181818181A181818
-% 18181818181818181018181818181A181818101812181810121018101210
-% 12101010101010101012181812AF181818FF7D00000000000000003A3A3A
-% 3A3A3A3A9D3A9D9DFFFFFF9D3A9D3A3A9D3A3A9D9D9D9D9D9D9D9D3A3A3A
-% 9D3A3A9D3A3A3A3A3A9D7F7F7F9D9D9D9D9D3A3A9D3A9D3A9D3A3A3A3A9D
-% 9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3AFFFFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A
-% 7F7F7F7F3A3A3A3A3A3A9D9D9D3A9D9D9D3A9D9D9D9D9D9D9D9D9D9D3A3A
-% 9D3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A9D3A3A3A9D3A3AFFFF
-% FF9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D9D9D9D9D9D9D3A3A3A3A9D3A9D7F
-% 7F7F7F9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D9D3A3A3A9D3A3A3A3A3A3A9DFFFFFF
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A9D9D3A3A3A3A9D
-% 3A3A3A9D3A3A9D3A9D3A3A9D3A3A9D3A9D9D9D9D7F7F7F3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D9D9D9D3A9D9D3A3A9D9D9D9D9D9D3A9D3A3A9D
-% 3A3A3A3A3A3A3A000000000000210018181816C510121012101216121818
-% 181818181010101012101818161818171816121610121612101818181818
-% 18181A18181800FF18181818121010101010121618181818181818181A18
-% 18181A181818181818181818181818181818181010101012101818181010
-% 101010101010101010181810AF181018FF7D00000000000000003A3A3A3A
-% 3A9D3A9D3A3A9D9D3AFF9D9D3A3A3A9D3A3A9D9D9D3A9D3A9D3A9D9D3A3A
-% 3A3A3A3A3A3A3A3A7F9D9D9D3A9D9D9D3A9D3A9D9D3A9D9D9D3A9D3A9D3A
-% 9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3AFF3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 9D3A7F9D3A3A3A3A3A9D3A9D9D9D9D3A3A3A9D9D9D9D9D9D9D9D9D9D3A9D
-% 9D3A3A9D3A3A9D3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3AFF
-% 9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D3A9D3A9D9D3A9D3A3A9D3A9D7F3A
-% 9D3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A9D3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A9DFF3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D9D3A3A3A9D3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A9D3A
-% 3A3A3A3A3A3A9D9D3A9D3A3A3A9D3A9D3A9D3A9D9D7F3A3A3A3A9D3A9D9D
-% 3A9D3A9D3A3A3A9D9D9D9D3A3A9D9D9D3A3A9D3A9D9D9D9D3A9D3A3A3A3A
-% 3A3A3A3A3A3A000000000000210010181318C51010101012101210101210
-% 181818181818121012101018181818181818121010101010121618181818
-% 181818181A00FF1012181010101010101010101218181818181818181818
-% 1A181A181818181818181818181818181818101210101010181210181012
-% 1010101010121012181818AF181618FF7D00000000000000003A3A9D3A3A
-% 3A3A9D3A9D9D3A9D9DFFFFFF3A3A9D9D9D3A9D9D3A9D9D9D9D9D9D3A3A3A
-% 3A3A3A9D3A7F7F7F9D9D9D3A9D3A3A9D3A9D3A9D9D3A9D9D3A3A9D3A9D9D
-% 3A9D9D9D3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3AFFFFFFFF3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D
-% 3A7F7F7F7F3A9D3A9D9D3A3A9D9D9D9D3A3A3A9D9D9D9D9D9D9D9D3A9D3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D9DFF
-% FFFF9D9D9D9D9D9D9D3A3A9D9D3A3A9D9D9D9D9D3A9D3A3A7F7F7F7F3A9D
-% 9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A9D3A3A9D3A3A3A3A
-% 3A3A3A3A9D9D3A3A9D3A3A3A3A9D3A9D9D9D3A3A3A3AFFFFFF3A3A3A3A3A
-% 3A9D3A3A9D9D3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A
-% 3A9D3A3A3A9D3A3A3A9D9D3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A9D3A9D3A
-% 3A9D9D3A9D3A9D9D3A9D9D3A3A9D9D9D3A9D9D3A9D7F7F7F3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A9D9D3A9D9D3A9D9D3A9D9D9D3A9D9D9D3A9D3A3A3A3A3A
-% 3A3A3A3A3A000000000000210016181618C5121012101012101012101210
-% 121818181818101012121218121012181010101010101010101218181818
-% 1818181800FF1210101010100810101010101010101218161818181A181A
-% 181818181817181818181818181818181818101010101010101210121010
-% 18101010101012181818AF181818FF7D00000000000000003A3A9D3A3A3A
-% 3A9D3A9D9D3AFFFF535353FFFF9D9D9D3A9D9D3A9D9D9D9D9D9D3A3A3A3A
-% 3A3A7F7F1313137F7F9D3A9D3A3A9D3A9D3A9D9D3A9D9D3A3A9D3A9D9D3A
-% 9D9D9D3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF
-% FF535353FFFF3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D7F
-% 7F1313137F7F3A9D9D3A3A9D9D9D9D3A3A3A9D9D9D9D9D9D9D9D3A9D3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3AFFFF5353
-% 53FFFF9D9D9D9D9D3A3A9D9D3A3A9D9D9D9D9D3A9D7F7F1313137F7F9D9D
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A9D3A3A9D3A3A3A3A3A
-% 3A3A3A9D9D3A3A9D3A3A3A3A9D3A9D9D9D3A3AFFFF535353FFFF3A3A3A3A
-% 9D3A3A9D9D3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A
-% 9D3A3A3A9D3A3A3A9D9D3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A9D3A9D3A3A
-% 9D9D3A9D3A9D9D3A9D9D3A3A9D9D9D3A9D9D7F7F1313137F7F3A3A3A3A3A
-% 3A3A3A9D3A3A9D9D3A9D9D3A9D9D3A9D9D9D3A9D9D9D3A9D3A3A3A3A3A3A
-% 3A3A3A3A000000000000210018181818C518181810181010121010121010
-% 101210181818181810101010121010101010081010101010101010121816
-% 18181800FF101012101010100A0F0A10101010101010121618181820181A
-% 181818181818121618181818181818181812101010101010101010181818
-% 181712101816181818AF181818FF7D00000000000000003A3A3A3A3A3A3A
-% 9D3A9D9DFF53535353535353FF9D9D3A9D9D9D9D9D3A9D9D3A3A9D3A3A3A
-% 7F131313131313137F9D3A3A9D9D9D9D3A9D9D3A9D9D3A3A9D3A3A9D9D3A
-% 9D9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF5353
-% 5353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A7F1313
-% 13131313137F9D3A9D9D9D3A9D9D9D3A3A3A9D9D9D9D9D9D9D9D3A9D9D3A
-% 3A3A3A9D3A3A3A3A9D3A3A9D3A3A3A3A3A9D3A3A9D3A3A3AFF5353535353
-% 5353FF9D9D9D9D3A3A9D9D9D9D9D9D3A9D9D3A7F131313131313137F3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D9D9D9D3A3A3A3A3A
-% 3A3A9D9D9D9D3A3A3A9D3A9D9D9D9D9D3AFF53535353535353FF3A9D3A3A
-% 9D9D9D3A3A3A9D3A9D9D9D9D3A3A3A9D9D9D3A9D9D9D3A3A3A9D9D9D9D9D
-% 3A3A3A3A3A9D9D9D3A9D3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A9D
-% 3A9D3A9D9D9D9D3A9D3A3A9D3A9D9D3A7F131313131313137F3A3A3A3A3A
-% 9D3A9D9D9D9D3A9D9D9D9D9D3A3A9D9D3A9D3A9D9D3A9D3A3A3A3A3A9D3A
-% 3A3A3A000000000000210018181818C5C5C5C5C5C5C51210101210121012
-% 1010121018161816121010101012101010100A0F0A101010101010101216
-% 181800FF10121010101010100A1010080A10081010101818181A18181818
-% 181818101810181217181818181818181010101010101010101218181818
-% 1818181818181818AF181818FF7D00000000000000003A3A3A3A3A3A3A9D
-% 3A9D9DFF53535353535353FF9D3A3A3A9D9D3A3A9D3A9D9D3A3A3A3A3A7F
-% 131313131313137F9D9D9D9D9D9D9D3A9D3A9D9D9D3A3A9D9D3A3A3A9D3A
-% 9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3AFF535353
-% 53535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313
-% 131313137F9D9D3A9D3A9D3A9D9D3A9D3A3A3A9D9D9D9D9D9D9D9D3A9D3A
-% 9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9DFF535353535353
-% 53FF9D9D3A3A3A9D9D9D3A9D3A9D9D9D9D3A7F131313131313137F3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A9D9D3A3A9D
-% 9D3A9D3A9D9D3A9D9D3A9D9D3A9D3A7F131313131313137F3A3A9D3A3A9D
-% 3A9D9D3A9D9D3A9D3A9D3A3A9D9D9D9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A000000000000210018181816C5181818181612161012101010101010
-% 1010101218181818181810121010101010100A1010080A10081010101818
-% 1800FF18121612181818101010101008100810101012181818181A181818
-% 18181810121010181812181812161216121010100A101010121818181818
-% 18181818181A18AF181818FF7D00000000000000003A3A3A3A3A3A3A9D3A
-% 9DFF535353535353535353FF3A3A3A9D9D3A3A9D3A9D9D3A3A3A3A7F1313
-% 131313131313137F9D9D9D9D9D9D3A9D3A9D9D9D3A3A9D9D3A3A3A9D3A9D
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3AFF5353535353
-% 53535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313
-% 131313137F9D3A9D3A9D3A9D9D3A9D3A3A3A9D9D9D9D9D9D9D9D3A9D3A9D
-% 9D9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3AFF5353535353535353
-% 53FF9D3A3A3A9D9D9D3A9D3A9D9D9D9D7F1313131313131313137F3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A9D9D3A3A9D9D
-% 3A9D3A9D9D3A9D9D3A9D9D3A9D7F1313131313131313137F3A9D3A3A9D3A
-% 9D9D3A9D9D3A9D3A9D3A3A9D9D9D9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A
-% 3A000000000000210018181812C518181818181210121018101812121612
-% 101010181818181818181216121818181010101010081008101010121818
-% 00FF18161210181618101210101010080A10101010101818181818181817
-% 121012161218101210101010121018121012101010101012181818181A18
-% 181818181818AF181818FF7D00000000000000003A3A3A3A3A3A3A9D3A9D
-% FF535353535353535353FF3A9D3A9D9D9D9D3A9D9D9D3A9D3A3A7F131313
-% 1313131313137F9D3A9D3A3A3A3A9D3A9D3A9D9D3A9D3A3A9D9D9D9D9D3A
-% 3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3AFF535353535353
-% 535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A7F131313131313
-% 1313137F9D3A9D9D3A9D3A9D9D9D9D3A3A9D9D9D9D9D9D9D9D9D3A9D3A3A
-% 3A3A9D3A9D3A3A3A3A9D3A3A3A9D3A3A3A3A9D9DFF535353535353535353
-% FF3A3A3A3A9D9D3A9D9D9D9D3A9D9D7F1313131313131313137F3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A9D3A3A3A3A3A3AFF535353535353535353FF3A3A3A9D3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D9D
-% 3A9D9D9D9D9D9D3A9D9D9D9D7F1313131313131313137F3A3A3A3A3A3A9D
-% 9D3A3A9D9D9D9D9D3A3A9D9D3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 000000000000210018181010C51818171818101810181018181818181818
-% 181210121218161818161210181618101210101010080A10101010101800
-% FF1012101012181818181012101010101010101218181818181818181812
-% 10121812101210121012101018121612101010101010101818181A181A18
-% 181A181A18AF181810FF7D00000000000000003A3A3A3A3A3A3A9D3A9DFF
-% 535353535353535353FF3A3A3A9D9D9D9D3A3A3A9D3A3A3A3A7F13131313
-% 13131313137F9D9D3A9D9D9D3A9D3A9D9D9D3A3A9D3A9D3A3A9D3A9D9D3A
-% 3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A9D3A3A3AFF53535353535353
-% 5353FF9D3A9D3A3A9D9D3A3A3A3A9D9D3A3A9D3A3A9D9D3A3A9D9D3A3A9D
-% 9D3A3A9D3A3A3A9D3A3A9D3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A9D
-% 3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13131313131313
-% 13137F3A3A9D9D3A9D3A9D9D9D9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9DFF535353535353535353FF
-% 3A9D9D9D9D3A9D9D3A9D9D3A3A9D7F1313131313131313137F3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D3A9D9D
-% 9D3A9D9D9D9D3A9D9D9D9D7F1313131313131313137F3A3A9D3A9D3A9D3A
-% 3A9D9D9D9D9D9D3A3A9D9D9D9D9D3A9D9D3A9D3A9D3A3A3A3A3A3A3A3A00
-% 0000000000210018101210C510181218101218181818181818181A181818
-% 1812101010121810121010121818181810121010101010101012181800FF
-% 181012101210101012101210100A08101010101012101218101810121010
-% 101010181818AFAFAFAFAFAF101210121810181012121818181A18181818
-% 18181818AF181010FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9DFF
-% 53535353535353FF9D3A3A3A9D9D9D9D3A3A3A9D3A3A3A3A3A7F13131313
-% 1313137F3A9D9D3A9D9D9D3A9D3A9D9D9D3A3A9D3A9D3A3A9D3A9D9D3A3A
-% 3A3A3A3A3A3A9D9D3A3A3A3A3A3A3A3A3A9D3A3A3A9DFF53535353535353
-% FF3A9D3A9D3A3A9D9D3A3A3A3A9D9D3A3A9D3A3A9D9D3A3A9D9D3A3A9D9D
-% 3A3A9D3A3A3A9D3A3A9D3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A9D3A
-% 3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13131313131313
-% 7F9D3A3A9D9D3A9D3A9D9D9D9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9DFF53535353535353FF3A3A
-% 9D9D9D9D3A9D9D3A9D9D3A3A9D3A7F131313131313137F3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D3A9D9D9D
-% 3A9D9D9D9D3A9D9D9D9D9D7F131313131313137F3A3A3A9D3A9D3A9D3A3A
-% 9D9D9D9D9D9D3A3A9D9D9D9D9D3A9D9D3A9D3A9D3A3A3A3A3A3A3A3A0000
-% 00000000210010101010C510101010121010101012101818181818181818
-% 181818181018181012101210101012101210100A0810101010101200FF18
-% 181810101010121012161010101010101010101010121012121010101010
-% 10101818AFAFAFAFAFAFAFAF101012101816121816181818181818181818
-% 181818AF181010FF7D00000000000000003A3A3A3A9D3A3A3A3A9D9DFF53
-% 535353535353FF3A3A3A9D9D9D9D9D3A9D9D9D3A3A3A3A3A7F1313131313
-% 13137F9D9D9D9D9D9D9D3A3A9D3A9D9D3A9D3A3A3A3A9D9D9D9D3A3A3A9D
-% 9D9D3A9D3A9D9D9D3A3A3A3A3A9D3A3A9D3A9D3A9DFF53535353535353FF
-% 3A3A9D3A3A3A9D3A9D3A3A3A9D3A9D3A9D3A3A3A3A3A3A3A9D3A3A9D3A3A
-% 3A9D9D3A3A3A9D9D3A9D3A3A9D9D3A3A9D3A9D3A9D3A3A9D3A3A3A9D3A9D
-% 3A9D3A3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F
-% 9D9D3A9D9D9D9D9D9D3A9D9D9D3A9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D3A9D3A3A9D9D9D9D9D9D9D9D9DFF53535353535353FF9D9D3A
-% 9D3A9D3A9D9D9D3A9D3A9D3A9D7F131313131313137F3A3A3A3A3A9D3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3AFF53535353535353FF3A3A3A3A9D3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D
-% 9D9D9D9D3A9D9D3A9D9D7F131313131313137F9D3A3A3A3A3A9D9D9D3A9D
-% 9D9D3A9D3A3A3A9D3A9D3A9D9D9D9D3A9D3A3A3A9D3A3A3A3A3A3A000000
-% 000000210010101010C51010101012101210121018181718181618181818
-% 181818181818181810101010121012161010101010101010101000FF1818
-% 171818181810101210121010101010101010101010101010101010081010
-% 101218AF181818181810AF10101010181212161818181A16181818181618
-% 1818AF101210FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D3AFFFF
-% 535353FFFF9D3A3A9D9D9D9D9D9D9D3A9D9D3A9D3A3A9D3A7F7F1313137F
-% 7F9D3A9D9D9D9D3A9D3A9D3A9D9D9D9D3A9D9D3A3A9D3A9D3A3A9D9D9D9D
-% 3A9D3A9D3A9D3A3A3A3A3A3A3A3A3A9D9D9D3A3A3AFFFF535353FFFF3A3A
-% 3A9D3A3A3A9D9D9D3A9D3A9D9D9D3A9D3A3A9D9D3A3A9D9D9D9D3A3A9D3A
-% 9D3A3A3A9D3A9D3A3A3A3A9D3A3A9D9D3A9D3A9D3A3A3A9D9D9D9D3A9D3A
-% 9D9D3A9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A9D7F7F1313137F7F9D9D
-% 3A3A9D9D9D9D3A3A9D9D9D9D9D9D9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFFFF535353FFFF9D3A9D9D9D
-% 9D3A9D9D3A9D3A9D3A9D3A3A9D7F7F1313137F7F9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A9D3A3AFFFF535353FFFF3A9D3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A9D9D9D3A9D9D
-% 3A9D9D3A9D9D9D9D9D3A7F7F1313137F7F3A3A3A9D3A3A9D3A9D9D3A9D9D
-% 9D9D9D3A3A9D9D9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A00000000
-% 0000210012101010C5101210181818101810181018121818181818181818
-% 1818181818181718181818101012101210101010101010101000FF121818
-% 18181818101210181018181612181818121010101210101010100A081010
-% 1818AF181818181818AF1010101012101012121818181818161818181818
-% 16AF101010FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D3A9D9DFF
-% FFFFFF3A9D3A3A9D9D9D9D9D9D9D3A9D9D3A9D3A3A9D3A3A3A7F7F7F9D9D
-% 9D3A9D9D9D9D3A9D3A9D3A9D9D9D9D3A9D9D3A3A9D3A9D3A3A9D9D9D9D3A
-% 9D3A9D3A9D3A3A3A3A3A3A3A3A3A9D9D9D3A3A3A9D9DFFFFFF3A9D3A3A3A
-% 9D3A3A3A9D9D9D3A9D3A9D9D9D3A9D3A3A9D9D3A3A9D9D9D9D3A3A9D3A9D
-% 3A3A3A9D3A9D3A3A3A3A9D3A3A9D9D3A9D3A9D3A3A3A9D9D9D9D3A9D3A9D
-% 9D3A9D3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D9D7F7F7F3A3A9D9D3A
-% 3A9D9D9D9D3A3A9D9D9D9D9D9D9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFFFFFF3A3A9D3A9D9D9D9D
-% 3A9D9D3A9D3A9D3A9D3A3A9D9D9D7F7F7F9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A9D3A3A3A3AFFFFFF3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A9D9D9D3A9D9D3A
-% 9D9D3A9D9D9D9D9D3A9D9D7F7F7F3A3A3A3A3A9D3A3A9D3A9D9D3A9D9D9D
-% 9D9D3A3A9D9D9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A0000000000
-% 00210010101010C512161818181818181210121012101810181818181818
-% 18181812181818181818101210181018181612181818121000FF10121012
-% 101212101012121618181818181818181818101818131610101010101210
-% 18AFAFAFAFAFAFAFAF101010101010101010121018181818181818181818
-% AF121010FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D3A9D9D3A3A
-% 3AFF9D3A9D3A3A3A3A9D9D3A9D9D3A9D3A3A3A3A3A3A3A7F3A3A9D9D9D3A
-% 9D9D9D3A9D9D9D3A9D3A9D3A9D3A9D3A3A3A9D9D9D9D9D9D3A3A9D3A9D9D
-% 9D9D9D9D3A3A9D3A3A3A3A3A3A9D9D3A9D9D3A9DFF3A9D3A3A3A9D3A3A9D
-% 3A3A3A9D9D9D3A9D3A9D9D9D9D9D9D3A9D9D3A3A9D9D9D9D9D3A3A3A9D9D
-% 3A3A9D9D9D9D9D3A3A9D9D3A9D3A3A9D9D9D3A3A3A9D9D3A9D3A9D9D3A9D
-% 3A9D3A9D9D9D9D3A3A3A3A9D3A3A9D3A3A3A9D9D3A9D3A7F9D9D9D3A9D3A
-% 9D9D9D9D9D9D3A9D3A9D9D9D3A9D9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3AFF9D3A9D9D9D9D3A3A9D
-% 9D9D9D9D9D9D3A3A9D9D9D9D7F9D9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3AFF3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A9D9D3A9D9D9D3A9D3A
-% 9D3A3A9D9D9D3A9D9D9D3A9D7F3A3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D9D
-% 9D3A3A9D9D9D3A3A9D3A9D9D3A9D3A9D3A3A3A3A3A3A3A3A000000000000
-% 210010101010C518181818181A1818181010101010121012101812161818
-% 181010121012101212101012121618181818181818181800FF1210101210
-% 101010181010121818181818181A181A1818181718181218181810101810
-% 18AFAFAFAFAFAF12101018181010101010101212181818181818181818AF
-% 101210FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D9D9D9D3A3A
-% FFFFFFFF9D3A9D3A9D3A9D9D9D9D9D3A3A3A3A3A7F7F7F3A3A9D9D9D9D3A
-% 9D9D9D9D9D9D3A9D3A9D9D9D9D3A3A9D3A9D3A3A9D3A3A3A9D3A9D3A9D9D
-% 3A9D9D3A3A3A3A3A3A3A3A3A3A3A3A9D3AFFFFFF3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A9D3A3A3A3A9D3A3A3A3A9D3A3A3A3A9D3A9D3A3A3A9D3A3A9D3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A9D9D9D9D7F7F7F3A3A3A9D
-% 9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A3A9D9DFFFFFF9D9D9D3A3A3A9D
-% 9D9D9D9D3A3A9D3A3A7F7F7F9D9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3AFFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A9D9D3A9D9D9D3A9D9D9D9D
-% 3A3A9D9D9D9D9D3A9D9D9D9D7F7F7F3A3A3A3A3A3A9D9D3A3A9D3A9D9D9D
-% 3A3A9D3A3A9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A00000000000021
-% 0012101010C51818181A1818181818121010101010121010101012101818
-% 101210101210101010181010121818181818181A181A00FF181812101012
-% 1012121012101018181618181A1818181818181818171818181612121012
-% 101010181810101212181018181010101210101818181A1818181818AF16
-% 1210FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D9D9D9D3AFFFF
-% 535353FFFF9D3A9D3A9D9D9D9D9D3A3A3A7F7F1313137F7F9D9D9D9D3A9D
-% 9D9D9D9D9D3A9D3A9D9D9D9D3A3A9D3A9D3A3A9D3A3A3A9D3A9D3A9D9D3A
-% 9D9D3A3A3A3A3A3A3A3A3A3A3A3AFFFF535353FFFF3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A9D3A3A3A3A9D3A3A3A3A9D3A3A3A3A9D3A9D3A3A3A9D3A3A9D3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A9D9D7F7F1313137F7F3A9D9D
-% 9D9D9D9D3A9D9D3A9D9D9D9D9D9D9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A3AFFFF535353FFFF9D3A3A3A9D9D
-% 9D9D9D3A3A9D7F7F1313137F7F3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3AFFFF535353FFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A9D9D3A9D9D9D3A9D9D9D9D3A
-% 3A9D9D9D9D9D3A9D9D7F7F1313137F7F3A3A3A3A9D9D3A3A9D3A9D9D9D3A
-% 3A9D3A3A9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A0000000000002100
-% 12101212C518181818181A18181810100B0E10101010100E101010121818
-% 1818121010121012121012101018181618181A181800FF18181818121010
-% 181010101012181810101818181818121012101818181818181810101010
-% 101018181012101010181818181816121612181818181818181818AF1810
-% 18FF7D00000000000000003A3A3A3A3A3A3A3A3A9D9D3A9D9D3AFF535353
-% 53535353FF3A9D9D3A9D9D3A9D3A9D7F131313131313137F9D9D9D3A9D9D
-% 9D3A9D9D3A3A9D3A9D9D3A9D9D3A9D9D9D9D3A9D3A3A3A3A9D9D9D3A9D9D
-% 3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A7F131313131313137F3A3A3A
-% 3A3A9D3A9D9D3A3A9D3A9D3A9D9D9D9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D3A3A3A9DFF53535353535353FF9D9D3A9D3A9D
-% 3A9D9D9D7F131313131313137F9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A
-% 3A3AFF53535353535353FF3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A9D3A9D3A9D3A9D3A9D9D3A9D9D9D3A9D9D3A3A
-% 9D9D9D3A3A9D9D7F131313131313137F3A3A9D3A9D9D3A9D3A9D9D9D3A3A
-% 9D9D9D9D9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210010
-% 181316C5181818181A181A181812101010101010100A100A101012161818
-% 181818121010181010101012181810101818181800FF1618181818181018
-% 18181012101010181816181818161810101018131618181A181818121010
-% 1018101812101818131818181818181818181818181818181818AF181012
-% FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D3A3A9DFF53535353
-% 535353FF3A3A9D9D3A9D9D9D3A3A7F131313131313137F9D9D9D3A9D9D9D
-% 3A9D3A3A9D3A3A9D9D9D3A3A9D9D3A3A3A9D3A3A9D3A9D9D9D3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A9D3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D7F131313131313137F3A3A9D3A
-% 3A9D9D9D9D9D3A9D9D9D3A9D9D9D9D9D9D3A3A3A9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D3A3A3A9D9D9DFF53535353535353FF9D9D9D3A9D3A3A
-% 9D9D9D7F131313131313137F9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3AFF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D9D9D3A3A3A
-% 9D9D9D9D3A9D7F131313131313137F3A3A3A3A9D9D3A9D3A9D9D9D3A9D9D
-% 3A9D3A3A9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A00000000000021001012
-% 1618C518181A181A181818181818181810100A1010101010101012181618
-% 1818181810181818101210101018181618181800FF121818181818181818
-% 171210101010121012181018121818181812161812161818181818101810
-% 1210121618181018181818181818181818181818181A181818AF181818FF
-% 7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D3A3AFF535353535353
-% 535353FF3A9D9D3A9D9D9D3A7F1313131313131313137F9D9D3A9D9D9D3A
-% 9D3A3A9D3A3A9D9D9D3A3A9D9D3A3A3A9D3A3A9D3A9D9D9D3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A9D3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D7F1313131313131313137F3A9D3A3A
-% 9D9D9D9D9D3A9D9D9D3A9D9D9D9D9D9D3A3A3A9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D3A3A3A9D9DFF535353535353535353FF9D9D3A9D3A3A9D
-% 9D7F1313131313131313137F3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF
-% 535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A9D9D9D9D9D9D9D9D9D9D3A3A3A9D
-% 9D9D9D3A7F1313131313131313137F3A3A3A9D9D3A9D3A9D9D9D3A9D9D3A
-% 9D3A3A9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A0000000000002100181818
-% 18C518181818181818181216181812101010121010101010101012121818
-% 18181818181817121010101012101218101800FF10121612181610181818
-% 121612101012101210121618181818181818121018101216181618181810
-% 18AFAF101210181618181818AFAFAFAFAFAFAFAFAFAFAFAFAF181818FF7D
-% 00000000000000003A3A3A3A3A3A3A9D3A9D9D9D9D9DFF53535353535353
-% 5353FF9D3A9D3A3A3A9D3A7F1313131313131313137F3A3A3A9D9D3A9D3A
-% 9D3A9D3A9D3A9D9D9D9D3A9D9D3A3A3A3A3A3A9D3A9D3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3AFF535353535353535353FF9D3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A9D3A3A9D9D3A9D3A9D3A9D3A3A9D3A3A3A9D9D3A3A3A9D9D3A9D3A
-% 9D9D3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D3A3A9D9D9D3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A7F1313131313131313137F3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3AFF535353535353535353FF3A9D3A9D3A9D3A3A
-% 7F1313131313131313137F9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3AFF53
-% 5353535353535353FF3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A9D9D3A9D3A9D9D3A3A9D9D3A3A3A3A9D9D
-% 3A9D3A7F1313131313131313137F3A3A9D9D3A3A3A9D3A9D3A9D3A9D9D3A
-% 9D9D3A9D9D9D3A9D3A9D3A9D3A3A3A3A3A3A000000000000210018181818
-% C51018181818181812101012161818121018101010101010101010121612
-% 181610181818121612101012101210121600FF1010121012181218161810
-% 121012101010101010121216181818161810181010121012181818181612
-% AFAF1012101212101818181818181818181A18181A1E18AF181818FF7D00
-% 000000000000003A3A3A3A3A3A3A9D3A9D9D3A9D9DFF5353535353535353
-% 53FF3A9D3A3A9D3A9D3A7F1313131313131313137F9D3A9D3A9D3A9D3A9D
-% 3A9D3A3A9D9D3A3A9D9D9D9D3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A9D3A3A
-% 3A3A3A3A3A3A3AFF535353535353535353FF3A9D9D3A9D3A9D9D3A3A3A9D
-% 9D3A3A3A3A9D3A3A9D3A3A3A9D3A9D9D3A3A3A9D3A3A9D3A3A9D9D9D9D3A
-% 9D3A3A3A3A3A3A9D3A9D9D9D3A9D3A9D3A3A9D9D9D3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A9D7F1313131313131313137F3A9D9D9D9D3A
-% 9D3A9D3A3A3A9D3A3A3A3A3A9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A3A3A3A7F
-% 1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9DFF5353
-% 53535353535353FF3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D3A9D9D9D3A9D3A9D9D9D3A3A9D9D9D
-% 3A9D7F1313131313131313137F3A9D9D9D9D3A3A9D9D9D9D3A9D9D3A3A9D
-% 9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210018181818C5
-% 181818181818181810101210181216181810121010121010101010121012
-% 1812181618101210121010101010101200FF101010101012161218101812
-% 161210101012101210101210181218181818181810181810121210121810
-% 1210101010101210121818181818181818181A181A18AF181818FF7D0000
-% 0000000000003A3A3A3A3A3A3A9D3A9D9D3A9D9D9DFF53535353535353FF
-% 9D3A9D3A3A9D3A9D3A9D7F131313131313137F9D9D3A9D3A9D3A9D3A9D3A
-% 9D3A3A9D9D3A3A9D9D9D9D3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3AFF53535353535353FF3A3A9D9D3A9D3A9D9D3A3A3A9D9D
-% 3A3A3A3A9D3A3A9D3A3A3A9D3A9D9D3A3A3A9D3A3A9D3A3A9D9D9D9D3A9D
-% 3A3A3A3A3A3A9D3A9D9D9D3A9D3A9D3A3A9D9D9D3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A9D3A7F131313131313137F9D3A9D9D9D9D3A9D
-% 3A9D3A3A3A9D3A3A3A3A3A9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A3A3A3A3A3A7F
-% 131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3AFF5353
-% 5353535353FF3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D9D9D3A9D9D3A9D9D9D3A9D3A9D9D9D3A3A9D9D9D3A
-% 9D3A7F131313131313137F3A3A9D9D9D9D3A3A9D9D9D9D3A9D9D3A3A9D9D
-% 9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210018181818C518
-% 18181A181818181010121012101210121810121010101210101010101012
-% 16121810181216121010101210121000FF10101012181818161818181018
-% 161810101010101012101210101218161818181818101210101018161210
-% 121010101010101210121612181818181A18201E1AAF1A1818FF7D000000
-% 00000000003A3A3A3A3A3A3A9D3A9D9D9D3A3A9DFF53535353535353FF9D
-% 3A9D9D9D3A9D3A3A3A7F131313131313137F9D9D9D9D9D9D3A3A9D9D3A9D
-% 3A9D3A3A9D9D9D9D9D3A3A9D9D9D3A9D3A3A9D3A9D9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3AFF53535353535353FF9D3A3A9D3A9D3A9D3A3A3A3A3A3A3A
-% 9D9D3A9D9D9D9D9D3A3A9D9D9D9D9D3A3A9D3A3A9D9D9D9D9D3A9D3A9D3A
-% 3A3A9D9D3A9D3A3A9D9D3A9D9D9D9D3A9D9D9D9D3A3A3A3A9D3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3AFF53535353535353FF3A3A3A3A3A3A9D3A3A3A7F13
-% 1313131313137F3A9D3A3A9D3A3A3A3A9D3A3A9D3A3A9D3A3A3A9D3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3AFF535353
-% 53535353FF3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D9D9D3A9D3A9D9D3A9D9D3A9D3A9D9D9D3A3A3A3A9D9D3A9D3A
-% 9D7F131313131313137F3A3A3A3A9D3A9D3A9D3A9D3A9D3A9D9D9D3A9D9D
-% 3A9D9D3A9D3A9D3A3A3A3A3A3A3A3A000000000000210018181818C51818
-% 181818181818181812101010101018101818181812101010101012181818
-% 161818181018161810101010101000FF1810121018181818121810181818
-% 181810121012101010101012101012121018181018101010101812101010
-% 10101010101010101010101818181818181A181AAF181818FF7D00000000
-% 000000003A3A3A3A3A3A3A9D3A9D9D9D9D9D3A3AFFFF535353FFFF9D9D9D
-% 9D3A9D3A9D9D3A9D3A7F7F1313137F7F9D9D9D9D3A9D9D3A9D3A3A3A3A3A
-% 9D9D9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3AFFFF535353FFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3AFFFF535353FFFF3A9D3A3A9D3A3A3A3A3A3A3A7F7F
-% 1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3AFFFF5353
-% 53FFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A9D9D3A9D3A9D3A3A9D3A3A9D3A9D9D3A9D9D9D3A3A3A9D9D9D3A9D9D
-% 9D7F7F1313137F7F3A3A3A3A9D9D9D9D3A9D9D9D3A9D3A9D9D9D9D3A9D9D
-% 9D9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210018181816C5181818
-% 181818181818121010101010101012101818181818181810121018181818
-% 1218101818181818101210121000FF1A1818181618181816181818181618
-% 181818101010101012121012101010101218101210121010181016121010
-% 10101010101010101010101818181818181820AF1A1818FF7D0000000000
-% 0000003A3A3A3A3A3A3A9D3A9D9D9D9D9D3A3A3A9DFFFFFF3A9D9D9D9D9D
-% 3A9D3A9D9D3A9D3A3A3A7F7F7F3A3A9D9D9D9D3A9D9D3A9D3A3A3A3A3A9D
-% 9D9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3AFFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3AFFFFFF3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A7F
-% 7F7F3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3AFFFFFFFF
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A9D9D3A9D3A9D3A3A9D3A3A9D3A9D9D3A9D9D9D3A3A3A9D9D9D3A9D9D9D
-% 9D3A7F7F7F3A3A3A3A3A3A9D9D9D9D3A9D9D9D3A9D3A9D9D9D9D3A9D9D9D
-% 9D3A9D3A3A3A3A3A3A3A3A3A3A000000000000210018181812C512101818
-% 1810121612161010101010121010181818181818181A1818181618181816
-% 18181818161818181810101000FF181818181A1818181810181018181816
-% 18121612101810101012101010101010101210121618181218AF18181810
-% 10101010101010101010121018181A202118AF181818FF7D000000000000
-% 00003A3A3A3A3A3A3A9D3A9D9D9D3A9D9D3A3A3A3A9DFF3A9D9D3A9D9D9D
-% 9D9D9D9D3A3A3A3A7F3A3A3A3A3A9D9D9D9D3A9D9D9D9D9D3A3A9D3A9D9D
-% 3A9D9D3A3A3A9D3A3A9D3A9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3AFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A9D3A3A7F3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3AFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D9D
-% 9D3A9D9D9D9D3A3A3A9D9D9D3A9D9D3A9D9D9D3A3A9D9D9D9D3A9D9D3A9D
-% 9D3A3A7F3A3A3A3A3A9D3A9D9D3A9D9D3A9D3A3A3A9D9D9D9D9D3A9D9D9D
-% 3A9D3A3A3A9D3A3A3A3A3A3A000000000000210018181016C51012101012
-% 10181018181310100A08081010101216181A1818181818181A1818181810
-% 181018181816181216121000FF1818181818181A18101812121212181818
-% 181012101210101216181818181210121018AFAFAFAF161218AF18181818
-% 1010101010101010101012181818201A18AF181212FF7D00000000000000
-% 003A3A3A3A3A3A3A3A3A9D9D9D3A9D9D3A3A3A9D3A3AFFFFFF9D3A9D9D3A
-% 9D9D9D3A9D7F7F7F3A3A3A9D3A9D9D9D3A9D9D9D9D9D3A3A9D9D3A9D3A9D
-% 9D3A9D9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A9DFFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F9D3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3AFFFFFF3A3A3A3A3A3A3A3A3A3A7F7F7F3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFFFFFF3A3A9D3A3A
-% 3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A9D3A3A9D
-% 9D3A3A9D3A3A3A3A9D9D3A9D9D9D3A3A3A9D3A3A3A9D9D3A9D3A9D9D3A9D
-% 3A3A3A7F7F7F3A3A3A3A9D9D9D3A9D9D9D3A9D3A3A9D9D3A3A9D3A9D9D3A
-% 9D3A3A3A3A3A3A3A3A3A3A000000000000210012121812C5101810121018
-% 10121816181810101008101010181818181A181818181818181A18101812
-% 1212121818181810121000FF1A181A181A18181818121010101010181210
-% 1010121012161218181818181818181818AFAFAF12101210AF1216181810
-% 1010121010100E101010121818181818AF101010FF7D0000000000000000
-% 3A3A3A3A3A3A3A3A3A9D9D9D3A9D9D3A3A3A9DFFFF535353FFFF9D9D3A9D
-% 9D9D7F7F1313137F7F3A9D3A9D9D9D3A9D9D9D9D9D3A3A9D9D3A9D3A9D9D
-% 3A9D9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3AFF
-% FF535353FFFF3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F7F3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3AFFFF535353FFFF3A3A3A3A3A3A7F7F1313137F7F3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF535353FFFF3A9D3A3A3A
-% 3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A9D3A3A9D9D
-% 3A3A9D3A3A3A3A9D9D3A9D9D9D3A3A3A9D3A3A3A9D9D3A9D3A9D9D3A9D3A
-% 7F7F1313137F7F3A3A9D9D9D3A9D9D9D3A9D3A3A9D9D3A3A9D3A9D9D3A9D
-% 3A3A3A3A3A3A3A3A3A3A000000000000210010101210C518181818101210
-% 1210181818181210101010121818181A18181A181A181A18181818121010
-% 10101018121010101200FF18181818181818181810101010101018181012
-% 10101012101216181818181818181818AF18AF16121010AF101212181012
-% 101010101010101010101216181812AF121012FF7D00000000000000003A
-% 3A9D3A3A3A3A9D3A9D9D9D9D3A9D9D3A3AFF53535353535353FF9D3A9D3A
-% 7F131313131313137F3A3A9D9D9D3A9D3A9D9D3A3A3A3A3A9D3A9D9D3A3A
-% 9D3A9D3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3AFF5353
-% 5353535353FF3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3AFF53535353535353FF3A3A3A9D7F131313131313137F3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A9D3A3A9D3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D3A9D
-% 9D3A9D3A3A9D9D9D9D9D9D9D3A3A3A9D3A3A9D9D9D9D9D3A9D9D9D9D7F13
-% 1313131313137F9D9D3A3A9D9D3A9D3A3A9D3A9D9D9D9D9D9D9D9D3A9D3A
-% 9D3A3A3A3A3A3A3A3A000000000000210010121012C51818181818121010
-% 10101218181818121012101818181A181818181818181818181810101010
-% 101018181012101000FF1818181818181818121010101010101818101010
-% 101218101012181818181818181818AF18AFAFAFAFAFAF10101012161218
-% 1010121010101010101210121010AF101010FF7D00000000000000003A3A
-% 3A3A3A9D3A9D3A9D9D9D3A9D9D3A3A3AFF53535353535353FF9D3A9D3A7F
-% 131313131313137F3A9D9D9D9D3A9D9D9D3A3A3A3A3A3A9D9D9D9D3A9D9D
-% 9D9D9D3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3AFF535353
-% 53535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3AFF53535353535353FF3A3A3A3A7F131313131313137F9D3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3AFF53535353535353FF3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A
-% 3A3A9D3A9D9D3A3A9D9D3A9D9D9D9D3A3A9D9D9D9D9D3A9D3A9D9D7F1313
-% 13131313137F9D9D9D3A9D9D9D9D3A3A9D3A9D9D9D3A9D9D9D9D3A9D3A3A
-% 3A3A3A3A3A3A3A3A000000000000210010101012C5181818181818101210
-% 10101010121618121618181818181A181818181818181818121010101010
-% 1018181010101000FF181818181818181810121010101010181618181216
-% 1210101012101818101218181818AF1818AFAFAFAF161210101018121612
-% 10101010101012101012101012AF101010FF7D00000000000000003A3A3A
-% 3A3A9D3A9D3A9D9D9D3A9D9D3A3AFF535353535353535353FF3A9D7F1313
-% 131313131313137F9D9D9D9D3A9D9D9D3A3A3A3A3A3A9D9D9D9D3A9D9D9D
-% 9D9D3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9DFF5353535353
-% 53535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A9D3AFF535353535353535353FF3A3A7F1313131313131313137F3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3AFF535353535353535353FF3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A
-% 3A9D3A9D9D3A3A9D9D3A9D9D9D9D3A3A9D9D9D9D9D3A9D3A9D7F13131313
-% 13131313137F9D9D3A9D9D9D9D3A3A9D3A9D9D9D3A9D9D9D9D3A9D3A3A3A
-% 3A3A3A3A3A3A3A000000000000210010101010C51818181A181812101010
-% 100808101012101812171818181818181818181818181810121010101010
-% 18161818121600FF12161818101810181210121010101212181818181812
-% 101010121613101210181618181818181818181818181010101216121012
-% 101216181810181012101216AF101010FF7D00000000000000003A3A3A3A
-% 3A3A3A9D3A9D9D9D3A3A9D9D3AFF535353535353535353FF3A3A7F131313
-% 1313131313137F3A9D9D3A3A9D9D9D9D9D3A3A3A3A3A9D3A9D9D9D3A9D3A
-% 9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3AFF535353535353
-% 535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3AFF535353535353535353FF3A3A7F1313131313131313137F3A3A3A3A
-% 3A3A3A3A3A9D3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3AFF535353535353535353FF3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A3A3A3A9D3A
-% 3A3A9D3A9D3A9D9D9D9D9D9D3A3A3A9D9D9D9D3A3A3A3A9D7F1313131313
-% 131313137F9D3A3A9D9D9D9D3A3A9D3A3A9D9D9D3A9D9D9D3A9D3A3A3A3A
-% 3A3A3A3A3A3A000000000000210010101010C51818181818181818101010
-% 100A10101010121612181818181812161818101810181210121010101212
-% 181818181800FF1012101012161210101010121012161818181A18181210
-% 181218181818101218121216181818181218181818181012101810181018
-% 1012181818181812161218AF101010FF7D00000000000000003A3A3A3A3A
-% 3A3A9D3A9D9D9D9D9D3A9D3AFF535353535353535353FF3A9D7F13131313
-% 13131313137F3A9D9D9D3A3A9D3A3A3A3A9D3A3A9D3A9D9D3A9D3A9D9D9D
-% 3A9D9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3AFF53535353535353
-% 5353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3AFF535353535353535353FF3A3A7F1313131313131313137F3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A0000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 00000000000000000000000000000000000000000000007F131313131313
-% 1313137F0000000000000000000000000000000000000000000000000000
-% 0000000000000000000000210010101010C51818181A2018181810121010
-% 1010100A1012C5C5C5C51818121012C5C51216121010C5C5C5C512161818
-% 181A181800FF1818181818101216121612161218181818181A1818181010
-% 101010121018101010101218181818101210101010181810121018121818
-% 16181A18181818181618AF181818FF7D00000000000000003A3A3A3A3A3A
-% 3A9D3A9D9D9D9D9D3A9D3A3AFF53535353535353FF9D3A9D9D7F13131313
-% 1313137F3A3A9D9D9D3A3A9D3A3A3A3A9D3A3A9D3A9D9D3A9D3A9D9D9D3A
-% 9D9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353
-% FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3AFF53535353535353FF3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3AFF2121212121212121212121212121212121212121212121
-% 212121212121212121212121212121212121212121212121212121212121
-% 21212121212121212121212121212121212121212121217F131313131313
-% 137F21212121212121212121212121212121212121212121212121212121
-% 21212121212100000000210018181010C510101216181818181810121010
-% 10101010C5C51010C5C518181818C5C518101216C5C51216C5C518181818
-% 1A181800FF1A181818101210181012101216181818181818181818181010
-% 101010101010101010101216181818101012101218181010121612161818
-% 1818181A1818181818AF181816FF7D00000000000000003A3A3A3A3A3A3A
-% 9D3A9D9D3A9D3A9D9D3A3AFF53535353535353FF3A9D3A9D7F1313131313
-% 13137F3A9D9D9D9D9D3A3A9D3A9D3A3A9D9D3A9D9D9D9D3A9D9D3A9D3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3AFF53535353535353FF
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% FF53535353535353FF3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3AFF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D3A
-% 9D3A9D9D9D3A3A9D3A3A3A9D3A9D9D3A9D3A9D9D9D9D7F13131313131313
-% 7F9D9D3A3A9D3A9D9D3A9D3A9D9D3A3A9D9D3A9D9D3A9D3A3A3A3A3A3A3A
-% 3A3A3A002100000000210018161818C51010101218101810181210101010
-% 121010C5C51210C5C518181A18181810121018C5C51012C5C51818181818
-% 181800FF1818181818111813161216121818181818181A18181818101010
-% 101010100A10101010101218181818181012161218101210181318181818
-% 1818181818181810AF161318FF7D00000000000000003A3A3A3A3A3A3A9D
-% 3A9D9D9D9D9D9D9D3A3A3AFFFF535353FFFF9D9D3A9D9D9D7F7F1313137F
-% 7F3A3A3A9D9D9D9D3A9D3A9D3A9D9D3A9D9D3A9D9D9D3A3A9D3A9D9D3A9D
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A9D9D3A9D9D3A9D3AFFFF535353FFFF9D9D
-% 9D9D3A3A9D3A9D3A9D9D3A9D3A9D3A9D3A9D3A9D3A3A3A3A3A3A3A9D3A9D
-% 9D9D3A9D3A3A3A9D3A9D3A9D3A3A3A9D3A9D3A3A3A9D9D3A9D9D3A3A3A9D
-% 3A9D3A9D3A9D3A3A9D3A9D3A9D3A3A9D3A9D3A9D3A9D3A9D3A3A9D9D3A9D
-% 3A3A3A7F7F1313137F7F9D9D9D9D3A9D3A3A3A3A3A9D9D9D9D9D9D3A9D3A
-% 9D3A9D3A9D3A9D3A9D9D9D3A3A9D3A9D9D3A9D9D3A3A9D3A3A9D3A9D9D3A
-% FFFF535353FFFF9D3A9D3A9D3A7F7F1313137F7F3A3A3A9D3A9D3A9D3A3A
-% 3A3A3A3A9D3A9D3A9D3A3A3A3A3A3A3A3A9D3A9D3A9D3A3A3A9D3A9D3A9D
-% 3A9D3A9D3A3A3A9D3A9DFFFF535353FFFF9D3A9D3A9D3A3A9D3A9D3A3A9D
-% 3A9D3A9DFF7D3A3A3A9D3A3A3A9D3A9D3A9D3A9D3A3A3A3A9D3A3A3A3A3A
-% 3A9D9D3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A9D9D9D9D9D9D9D
-% 9D3A9D9D3A3A9D3A9D3A3A9D9D3A9D9D9D9D9D9D3A3A7F7F1313137F7F3A
-% 3A9D9D9D3A9D3A9D3A3A3A3A3A9D3A3A9D9D9D9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A002100000000210013181818C5C5C5C5C5C5C5C5C5C5C5C5C5101216
-% 1816C5C51618C5C518181818181818111813C5C51612C5C5181818181A18
-% 1800FF1A18181818181618181210121618181A181A181818181810101010
-% 101010101010081010101818181818181018161216121810181018101818
-% 18181818181010AF121818FF7D00000000000000003A3A3A3A3A3A3A9D3A
-% 9D9D9D9D9D9D9D3A3A3A9D3AFFFFFF3A3A9D9D3A9D9D9D9D7F7F7F7F3A3A
-% 3A3A3A9D9D9D9D3A9D3A9D3A9D9D3A9D9D3A9D9D9D3A3A9D3A9D9D3A9D3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A9D9D3A9D9D3A9D3A3A9DFFFFFF9D9D9D9D9D
-% 9D3A3A9D3A9D3A9D9D3A9D3A9D3A9D3A9D3A9D3A3A3A3A3A3A3A9D3A9D9D
-% 9D3A9D3A3A3A9D3A9D3A9D3A3A3A9D3A9D3A3A3A9D9D3A9D9D3A3A3A9D3A
-% 9D3A9D3A9D3A3A9D3A9D3A9D3A3A9D3A9D3A9D3A9D3A9D3A3A9D9D3A9D3A
-% 3A3A3A3A7F7F7F3A9D9D9D9D9D3A9D3A3A3A3A3A9D9D9D9D9D9D3A9D3A9D
-% 3A9D3A9D3A9D3A9D9D9D3A3A9D3A9D9D3A9D9D3A3A9D3A3A9D3A9D9D3A3A
-% 9DFFFFFFFF9D9D3A9D3A9D3A3A3A7F7F7F3A3A3A3A3A9D3A9D3A9D3A3A3A
-% 3A3A3A9D3A9D3A9D3A3A3A3A3A3A3A3A9D3A9D3A9D3A3A3A9D3A9D3A9D3A
-% 9D3A9D3A3A3A9D3A9D3A9DFFFFFF3A3A9D3A9D3A9D3A3A9D3A9D3A3A9D3A
-% 9D3A9DFF7D3A3A3A9D3A3A3A9D3A9D3A9D3A9D3A3A3A3A9D3A3A3A3A3A3A
-% 9D9D3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A9D9D9D9D9D9D9D9D
-% 3A9D9D3A3A9D3A9D3A3A9D9D3A9D9D9D9D9D9D3A3A3A3A7F7F7F7F3A3A3A
-% 9D9D9D3A9D3A9D3A3A3A3A3A9D3A3A9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A
-% 3A002100000000210018181818C518181010101012101210121012161818
-% 18C5C51818C5C518181A1818181818161818C5C5C5C518181A181A181818
-% 00FF1818181818181818171216181818181818181A181818181118121012
-% 101010101010080E10101818181818181210121018101810121812101818
-% 181817181218AF181618FF7D00000000000000003A3A3A3A3A3A3A9D3A9D
-% 9D9D9D9D9D3A9D3A3A3A3A9D9D3AFFFFFF9D9D9D7F7F7F7F3A3A3A3A3A3A
-% 3A3A9D9D9D9D9D9D9D3A3A3A9D3A9D3A9D9D3A9D9D9D3A9D3A3A9D3A9D3A
-% 3A3A3A3A3A3A9D3A3A9D3A9D3A9D3A3A9D3AFFFFFF9D3A9D3A3A3A3A3A3A
-% 3A3A9D3A9D3A9D3A9D3A9D3A3A3A9D3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 9D3A9D3A9D3A3A3A9D3A3A3A9D3A9D9D3A3A9D3A3A9D3A9D3A3A9D3A9D3A
-% 9D3A9D3A3A9D3A9D9D3A9D3A3A9D3A9D3A9D3A9D3A9D3A3A9D3A3A9D3A9D
-% 3A3A3A3A3A3A7F7F7F3A3A3A9D3A9D9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 9D3A3A9D3A3A9D3A3A9D3A9D3A9D3A9D9D3A9D3A9D3A3A9D9D9D3A9D9D9D
-% 9D3A9DFFFFFFFF3A9D9D7F7F7F3A3A3A3A3A3A9D3A3A9D3A3A9D9D3A3A3A
-% 9D9D9D3A9D3A9D3A9D3A3A3A3A3A9D9D9D9D3A3A3A3A9D3A9D3A9D3A9D3A
-% 9D3A3A3A9D9D3AFFFFFF3A9D3A9D3A9D3A9D3A9D9D9D3A9D3A3A3A9D3A9D
-% 9D3AFF7D9D9D9D3A3A9D9D3A9D9D3A9D9D3A3A9D3A9D3A9D3A3A3A9D3A9D
-% 3A9D3A9D3A9D3A9D3A9D3A9D9D3A3A3A3A3A3A3A9D9D3A3A9D3A9D3A3A3A
-% 9D9D3A3A3A9D3A3A9D3A9D9D3A9D9D9D3A9D9D3A3A3A3A3A3A7F7F7F7F9D
-% 3A9D9D9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 002100000000210016181818C51818181810121018101810121018181818
-% C5C51818C5C518181818181818181818C5C51618C5C5181818181A181800
-% FF18181818181A1818181812181818181818181818181618181612161810
-% 121012101010101010101218161818181018181316131810121010121612
-% 1818121618AF181818FF7D00000000000000003A3A3A9D3A3A3A9D3A9D9D
-% 3A9D3A9D9D9D3A3A3A3A9DFFFF535353FFFF7F1313137F7F3A3A3A3A3A9D
-% 3A9D9D9D3A9D9D9D9D9D9D9D3A3A9D9D9D9D9D3A9D3A9D3A9D9D3A9D3A3A
-% 9D3A3A3A3A3A3A9D3A3A3A3A3A3A3AFFFF535353FFFF3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 9D3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D9D3A9D3A
-% 3A3A3A7F7F1313137F7F3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9DFFFF535353FFFF7F1313137F7F3A3A3A3A9D3A3A3A3A3A3A3A3A9D9D3A
-% 3A3A9D3A9D3A3A9D3A3A3A9D9D3A3A3A3A3A9D3A3A9D3A9D3A9D3A9D3A3A
-% 9D9D9D9DFFFF535353FFFF9D3A3A9D3A9D9D9D3A9D3A9D9D9D3A3A9D9D3A
-% 9DFF7D3A3A9D3A9D3A9D9D3A9D9D3A9D9D3A3A3A3A9D9D9D9D9D9D3A9D9D
-% 3A3A9D9D3A9D9D9D3A9D9D3A3A3A3A3A3A3A9D3A3A9D3A9D3A9D3A9D9D9D
-% 9D9D3A3A9D9D3A9D3A9D9D9D9D3A9D9D9D9D3A3A3A3A3A7F7F1313137F7F
-% 9D9D3A9DB2FF8B9D3A9D9D9D9D9D3A9D9D3A9D3A8BFF603A3A3A3A3A3A00
-% 2100000000210018181018C51818181817181818121010121012121818C5
-% C51818C5C5181818181818181A1818C5C51218C5C51818181818181800FF
-% 18181A181818181818181718181818121818181818121210121012101216
-% 121012101210101010101012181613101216181812161210121010121618
-% 18101818AF181818FF7D00000000000000003A3A3A9D3A3A3A9D3A9D9D3A
-% 9D3A9D9D9D3A3A3A3AFF53535353535353FF13131313137F3A3A3A3A9D3A
-% 9D9D9D3A9D9D9D9D9D9D9D3A3A9D9D9D9D9D3A9D3A9D3A9D9D3A9D3A3A9D
-% 3A3A3A3A3A3A9D3A3A3A3A3A3AFF53535353535353FF3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D
-% 3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D9D3A9D3A3A
-% 3A7F131313131313137F3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3AFF
-% 53535353535353FF13131313137F3A3A3A9D3A3A3A3A3A3A3A3A9D9D3A3A
-% 3A9D3A9D3A3A9D3A3A3A9D9D3A3A3A3A3A9D3A3A9D3A9D3A9D3A9D3A3A9D
-% 9D9DFF53535353535353FF3A3A9D3A9D9D9D3A9D3A9D9D9D3A3A9D9D3A9D
-% FF7D3A3A9D3A9D3A9D9D3A9D9D3A9D9D3A3A3A3A9D9D9D9D9D9D3A9D9D3A
-% 3A9D9D3A9D9D9D3A9D9D3A3A3A3A3A3A3A9D3A3A9D3A9D3A9D3A9D9D9D9D
-% 9D3A3A9D9D3A9D3A9D9D9D9D3A9D9D9D9D3A3A3A3A7F131313131313137F
-% 9D3A9DE3E33A9D3A9D9D9D9D9D3A9D9D3A9D3A3AC8C83A3A3A3A3A3A0021
-% 00000000210018181612C5181818181818161216121010101012101818C5
-% C5C5C518181818181A181818181818C5C5C5C5181812181818181800FF18
-% 18181818181A181818181818181818161818161810101010101010121012
-% 181612101010100A10101210181810121818181018101010101010121810
-% 181018AF161818FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D3A9D
-% 9D9D3A9D9D3A3A3AFF53535353535353FF13131313137F9D3A3A3A3A3A9D
-% 9D9D9D9D3A9D9D3A9D3A9D9D3A3A9D3A3A9D3A3A3A9D3A9D3A9D3A3A3A3A
-% 9D3A3A3A3A9D3A9D9D9D9D9DFF53535353535353FF9D9D9D9D9D9D9D3A9D
-% 9D9D9D9D9D9D3A9D9D9D9D3A3A3A9D3A3A3A3A9D3A9D9D9D3A9D3A3A3A9D
-% 9D9D9D9D3A3A3A3A9D9D3A3A9D9D9D9D9D9D3A9D3A9D9D9D9D9D9D3A9D3A
-% 9D9D9D9D9D9D3A9D9D9D9D3A3A9D9D9D9D9D9D3A9D9D3A3A3A9D3A9D3A3A
-% 7F131313131313137F9D3A3A3A9D3A9D9D9D9D9D9D3A9D9D9D3A9D3A9D9D
-% 9D9D9D9D9D3A9D9D9D9D9D9D3A9D3A9D9D9D9D9D3A9D3A9D9D3A3A3AFF53
-% 535353535353FF13131313137F3A9D3A3A9D3A9D9D3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A9D9D3A3A
-% 3AFF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9DFF
-% 7D3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D9D3A3A9D3A9D3A3A9D9D3A9D9D9D
-% 9D9D3A3A9D3A9D9D3A9D9D3A9D9D3A9D3A3A3A3A7F131313131313137F9D
-% 9D82FF603A9D9D3A3A9D9D3A9D9D9D3A9D3A3A60FF823A3A3A3A3A002100
-% 000000210018181818C51018181818161210181012101010101018161218
-% 1818181A181818181818181A181818181818181818161818161800FF1818
-% 18181A181818181818181818181818181818181818101012101010101018
-% 121810181010101012161818181818161817181818181810101010101218
-% 1810AF121818FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D9D3A
-% 9D9D3A9D3A9DFF535353535353535353FF13131313137F3A3A3A3A3A9D9D
-% 9D3A9D9D9D3A9D3A9D9D3A9D9D9D9D3A9D3A3A3A9D3A9D9D9D3A3A3A3A3A
-% 3A3A3A3A9D3A9D9D9D9DFF535353535353535353FF3A9D9D9D9D3A3A9D3A
-% 9D9D9D9D3A3A3A9D9D9D3A3A9D3A3A3A3A3A3A9D9D9D3A3A9D3A3A3A3A9D
-% 9D9D3A3A9D3A9D9D3A3A9D3A9D9D9D9D3A9D9D3A9D9D9D9D9D3A3A9D3A9D
-% 3A9D9D9D3A9D3A3A9D9D9D3A3A3A9D9D9D9D3A3A9D9D3A3A3A9D3A9D7F13
-% 13131313131313137F9D9D3A3A3A9D9D9D9D9D3A3A9D3A9D3A3A3A9D3A9D
-% 9D9D3A3A9D9D9D9D9D3A3A3A9D3A3A9D9D9D3A3A9D9D9D9D9D3AFF535353
-% 535353535353FF13131313137F9D3A9D9D3A3A9D9D9D3A3A9D9D9D9D9D9D
-% 9D9D9D3A3A3A9D9D9D9D9D9D3A9D3A9D9D9D9D9D3A9D9D9D9D3A9D3A3AFF
-% 535353535353535353FF9D9D3A9D3A9D3A9D3A3A9D3A9D9D3A9D3A9DFF7D
-% 9D9D9D3A3A9D3A9D3A9D3A3A9D9D3A9D9D9D3A3A3A9D9D7F7F7F7F7F3A3A
-% 3A9D3A9D3A3A9D9D3A3A3A3A3A3A9D9D3A9D9D9D9D3A3A9D9D3A9D9D3A9D
-% 9D9D3A3A3A9D3A9D3A9D9D9D9D9D9D3A3A3A7F1313131313131313137FA3
-% FFB19D3A3A9D3A9D9D9D9D9D9D9D3A9D3A9D3AB1FF483A3A3A3A00210000
-% 0000210018181818C5101210121012101218161210101010101010101012
-% 16181810181818181A1818181818181818181818181818181800FF181818
-% 1A1E181A1818181612101218181818181818101810121010101010101218
-% 171818101210101018181818181818181818171818161012101210121010
-% 10AF101010FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D9D3A9D
-% 9D3A9D3A9DFF535353535353535353FF13131313137F3A3A3A3A3A9D9D9D
-% 3A9D9D9D3A9D3A9D9D3A9D9D9D9D3A9D3A3A3A9D3A9D9D9D3A3A3A3A3A3A
-% 3A3A3A9D3A9D9D9D9DFF535353535353535353FF3A9D9D9D9D3A3A9D3A9D
-% 9D9D9D3A3A3A9D9D9D3A3A9D3A3A3A3A3A3A9D9D9D3A3A9D3A3A3A3A9D9D
-% 9D3A3A9D3A9D9D3A3A9D3A9D9D9D9D3A9D9D3A9D9D9D9D9D3A3A9D3A9D3A
-% 9D9D9D3A9D3A3A9D9D9D3A3A3A9D9D9D9D3A3A9D9D3A3A3A9D3A9D7F1313
-% 131313131313137F9D9D3A3A3A9D9D9D9D9D3A3A9D3A9D3A3A3A9D3A9D9D
-% 9D3A3A9D9D9D9D9D3A3A3A9D3A3A9D9D9D3A3A9D9D9D9D9D3AFF53535353
-% 5353535353FF13131313137F9D3A9D9D3A3A9D9D9D3A3A9D9D9D9D9D9D9D
-% 9D9D3A3A3A9D9D9D9D9D9D3A9D3A9D9D9D9D9D3A9D9D9D9D3A9D3A3AFF53
-% 5353535353535353FF9D9D3A9D3A9D3A9D3A3A9D3A9D9D3A9D3A9DFF7D9D
-% 9D9D3A3A9D3A9D3A9D3A3A9D9D3A9D9D9D3A3A7F7F7F13131313137F7F7F
-% 9D3A9D3A3A9D9D3A3A3A3A3A3A9D9D3A9D9D9D9D3A3A9D9D3A9D9D3A9D9D
-% 9D3A3A3A9D3A9D3A9D9D9D9D9D9D3A3A3A7F1313131313131313137FC0FF
-% 609D3A3A9D3A9D9D9D9D9D9D9D3A9D3A9D3A60FF823A3A3A3A0021000000
-% 00210010101012C512161216121810181012101010101010101010101012
-% 1810181818181A1E181A181818161210121818181818181800FF1818181A
-% 181A18181812101210101012161218101818181010101010101010121612
-% 181818181812181818181818181818181818181818181816121010121012
-% AF101010FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D
-% 9D9D3A9DFF535353535353535353FF13131313137F3A3A3A3A3A9D9D9D9D
-% 9D3A9D9D9D9D9D3A9D3A9D9D9D3A9D3A9D3A3A3A3A9D3A9D3A9D3A3A9D3A
-% 9D3A3A3A9D9D9D9DFF535353535353535353FF9D3A9D9D9D3A3A3A9D3A9D
-% 9D9D9D3A9D3A9D9D3A3A9D3A3A3A3A3A9D9D9D3A3A9D3A3A9D3A3A9D9D3A
-% 3A9D3A9D9D9D3A3A9D3A9D9D9D3A3A9D3A3A3A9D9D9D9D3A9D9D3A3A9D9D
-% 9D9D3A3A9D9D9D9D3A3A9D3A9D9D9D9D3A3A9D9D9D9D3A3A9D9D7F131313
-% 1313131313137F9D9D3A3A9D3A9D9D9D9D3A3A9D3A9D3A9D9D3A9D9D9D9D
-% 3A3A9D3A9D9D9D3A3A9D9D3A9D3A9D9D3A3A9D9D9D9D3A3AFF5353535353
-% 53535353FF13131313137F9D9D9D9D3A3A9D9D9D9D3A3A9D3A9D9D9D3A3A
-% 3A9D3A3A3A3A9D3A9D3A9D9D9D3A9D9D9D3A3A3A9D3A3A9D3A9D3AFF5353
-% 53535353535353FF9D3A3A9D3A9D9D9D3A3A3A9D9D9D9D3A3A9DFF7D9D9D
-% 3A9D3A9D9D9D9D3A3A9D9D3A9D9D3A3A9D7F13131313131313131313137F
-% 9D3A3A9D3A3A3A3A3A3A3A9D9D3A3A9D3A9D3A9D9D54C6FFFFDAB73A3A9D
-% 3A3A9DA6C0E3FFC8C0A39D9D3A3A3A3A7F1313131313131313137FC8E39D
-% 9D9D3AC6FFBD3A9D3A9D9DBDFFC63A3A3A3AC8C83A3A3A3A002100000000
-% 210010101010C51012101210101012101210101210100810100F10101010
-% 12181818181A181A18181812101210101012161218101800FF1818181A18
-% 181A18181810101010121012101212161218101010100A10101010121818
-% 18181818181818181A1818181818181618121818181818181012101018AF
-% 101010FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D3A9D3A9D9D
-% 3A3A9D3AFF53535353535353FF13131313137F3A3A3A3A3A3A9D9D9D3A9D
-% 9D3A9D3A9D9D9D3A9D9D9D3A9D9D3A9D3A9D3A3A9D9D3A3A3A3A3A3A3A3A
-% 3A3A3A9D9D9D9D3AFF53535353535353FF3A9D3A9D9D9D3A3A9D3A9D9D9D
-% 9D3A3A9D3A9D9D3A3A9D3A3A3A3A3A9D9D9D9D3A9D9D3A3A3A9D3A9D3A3A
-% 3A3A9D9D9D3A9D3A9D3A9D9D9D3A9D3A3A3A9D9D9D9D3A9D3A3A3A3A9D9D
-% 9D3A3A9D3A9D9D9D3A3A9D9D9D9D9D3A3A9D9D9D9D3A3A9D3A3A7F131313
-% 131313137F9D9D9D3A3A3A9D9D9D9D3A3A9D3A9D9D3A3A3A3A9D9D9D9D3A
-% 9D3A3A9D9D9D3A9D9D3A3A3A3A9D9D3A3A9D3A9D9D9D3A9DFF5353535353
-% 5353FF13131313137F9D9D9D9D3A3A9D3A9D9D9D3A3A9D3A9D9D9D3A3A9D
-% 9D9D3A3A3A3A9D9D3A3A9D3A3A9D9D9D3A3A9D9D3A3A9D9D9D3A3AFF5353
-% 5353535353FF9D9D9D3A9D9D9D9D9D3A3A9D3A9D9D9D3A9D3AFF7D9D9D3A
-% 3A9D9D9D9D9D3A3A9D3A9D9D9D3A7F7F131313131313131313131313137F
-% 7F3A9D3A3A3A3A3A3A9D9D3A9D9D3A9D3A9D3AB2FFFFFFFFFFFFD13A9D3A
-% 9DB2FFFFFFFFFFFFFFB23A3A3A9DA3FF7F131313131313137F60FFC69D3A
-% 9D3A3ADAFF549D9D9DA9FFC89D3A3A3A3A8BFF603A3A3A00210000000021
-% 0010101010C51216131810181218161818181010100A100B101010101010
-% 181818181A18181A181818101010101210121012121600FF1818181A181A
-% 18181818121012101012101010101210121818101010100810121618181A
-% 181A181818181A181818181818101212181618121218101816101018AF18
-% 1818FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D3A9D3A9D9D3A
-% 3A9D3AFF53535353535353FF13131313137F3A3A3A3A3A3A9D9D9D3A9D9D
-% 3A9D3A9D9D9D3A9D9D9D3A9D9D3A9D3A9D3A3A9D9D3A3A3A3A3A3A3A3A3A
-% 3A3A9D9D9D9D3AFF53535353535353FF3A9D3A9D9D9D3A3A9D3A9D9D9D9D
-% 3A3A9D3A9D9D3A3A9D3A3A3A3A3A9D9D9D9D3A9D9D3A3A3A9D3A9D3A3A3A
-% 3A9D9D9D3A9D3A9D3A9D9D9D3A9D3A3A3A9D9D9D9D3A9D3A3A3A3A9D9D9D
-% 3A3A9D3A9D9D9D3A3A9D9D9D9D9D3A3A9D9D9D9D3A3A9D3A3A7F13131313
-% 1313137F9D9D9D3A3A3A9D9D9D9D3A3A9D3A9D9D3A3A3A3A9D9D9D9D3A9D
-% 3A3A9D9D9D3A9D9D3A3A3A3A9D9D3A3A9D3A9D9D9D3A9DFF535353535353
-% 53FF13131313137F9D9D9D9D3A3A9D3A9D9D9D3A3A9D3A9D9D9D3A3A9D9D
-% 9D3A3A3A3A9D9D3A3A9D3A3A9D9D9D3A3A9D9D3A3A9D9D9D3A3AFF535353
-% 53535353FF9D9D9D3A9D9D9D9D9D3A3A9D3A9D9D9D3A9D3AFF7D9D9D3A3A
-% 9D9D9D9D9D3A3A9D3A9D9D9D3A7F1313131313131313131313131313137F
-% 3A9D3A3A3A3A3A3A9D9D3A9D9D3A9D3A9D48FFFFB73A9DA9D1FF719D3AA3
-% E3FF8BA33AA3C6FFE3483A3AB7FFA37F131313131313137F82FFB49D3A9D
-% 3A3AA9FFC89D9D9DDAFF599D3A3A3A3A66FF823A3A3A0021000000002100
-% 18181010C512161216101316101818181818181010100E10101010101018
-% 1818181A181A18181818121012101012101010101200FF10181818181818
-% 181818161216121810181018101210101818161010101008101216181818
-% 1818181A1818181818181810121010101218101010121012181818AF1818
-% 1AFF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D9D9D3A
-% 3A9D3AFFFF535353FFFF7F1313137F7F9D9D9D9D3A9D3A9D9D3A9D3A9D9D
-% 9D9D9D9D3A3A9D9D3A3A9D9D3A3A9D3A3A9D3A9D9D3A3A3A3A9D3A3A3A3A
-% 3A9D9D9D9D3A3AFFFF535353FFFF9D3A3A9D9D9D9D3A3A9D3A3A9D9D9D9D
-% 3A3A3A3A9D3A3A3A3A3A9D3A3A9D9D9D3A3A9D3A3A9D3A3A9D3A3A3A9D9D
-% 9D9D9D3A3A9D3A9D9D9D9D3A3A9D3A9D3A9D9D9D3A9D9D3A3A9D9D9D9D3A
-% 3A3A3A3A9D3A3A3A3A9D9D9D9D3A3A3A9D9D9D3A3A3A9D3A3A7F7F131313
-% 7F7F9D9D9D9D3A3A3A3A9D9D9D9D3A3A9D3A3A3A9D3A9D9D9D9D3A9D3A3A
-% 9D9D9D3A3A3A3A9D3A3A9D9D9D3A3A3A3A3A3A3A3A3A3AFFFF535353FFFF
-% 7F1313137F7F3A3A9D9D9D9D3A3A9D9D9D9D3A3A9D3A9D9D9D3A3A9D3A3A
-% 9D3A3A3A3A9D3A3A3A3A9D9D9D3A3A9D9D3A3A9D9D9D9D9D3A9DFFFF5353
-% 53FFFF3A9D9D3A3A9D3A3A9D9D3A9D3A3A9D9D9D3A9D3AFF7D9D9D3A9D3A
-% 9D9D9D9D3A9D3A3A9D9D9D7F13131313131313131313131313131313137F
-% 9D3A3A3A3A3A9D3A9D3A3A9D9D9D9D3A77FFC03A9D9D3AA3FFB19D9D77FF
-% CB9D9D9D9D3A96FFBD3A3AB1FF483A7F7F1313137F7F3ACBFF549D9D9D3A
-% 3A3ABDFFC69DBDFFC63A9D3A3A3A3A54FF963A3A3A002100000000210018
-% 1A1818C51818121818181218181818181818161210101010101010101210
-% 181818181818181818161216121810181018101200FF1012161818181818
-% 101210121018181818181312101010101212181810121012101818181818
-% 181818181A181818181012101010101216101012101210121018AF181818
-% FF7D00000000000000003A3A3A9D3A3A3A9D3A9D9D3A9D3A9D3A9D9D3A3A
-% 9D3A3A9DFFFFFFFFFFFF7F7F7F9D3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D3A
-% 9D9D9D3A3A9D9D3A9D9D9D3A9D9D3A3A3A9D9D3A3A3A3A3A3A3A3A3A9D3A
-% 9D9D9D9D9DFFFFFFFFFFFF9D9D9D3A3A3A9D9D9D3A3A9D3A3A9D9D9D3A3A
-% 9D3A3A9D3A9D3A3A3A3A3A3A9D9D9D3A3A9D3A3A9D3A3A9D9D3A9D3A9D9D
-% 9D9D3A3A9D9D3A9D9D9D3A9D9D9D3A9D9D9D9D3A9D3A3A9D3A9D9D9D3A3A
-% 9D3A3A3A9D3A3A3A9D9D9D9D3A3A9D9D9D9D3A3A9D9D3A3A3A3A7F7F7F7F
-% 7F7F9D9D9D3A3A9D3A9D9D9D3A3A9D3A3A9D3A3A9D9D9D9D9D3A9D3A9D3A
-% 9D9D3A3A9D9D9D3A9D3A9D9D3A3A9D3A9D9D9D3A3A3A3A3AFFFFFFFFFFFF
-% 7F7F7F3A3A3A9D9D9D9D3A3A9D3A9D9D9D3A3A9D3A9D9D9D3A3A9D3A9D3A
-% 3A3A3A3A9D3A9D3A9D9D9D9D3A3A9D3A9D3A3A9D9D9D9D3AFFFFFFFFFFFF
-% 9D3A9D9D9D3A3A9D3A3A3A9D3A3A3A3A9D9D9D3A3A3AFF7D9D9D3A3A3A9D
-% 9D9D3A3A3A9D9D9D9D7F131313131313131313131313131313131313137F
-% 3A3A3A3A3A9D3A9D3A9D3A9D9D9D3AA3FF549D9D3A3A9D9D3A3A9DA3FFAF
-% 9D9D9D3A9DAFFFA33A3A3A3A3A3A3A3A7F7F7F7F7F7FFFFF9D9D9D9D9D3A
-% 9D3AD1FF77FFE39D3A9D3A3A9D3A3AFFFF3A3A3A00210000000021001818
-% 1818C5101816181018181612101010121818181010101010101010101012
-% 1618181818181012101210181818181813121000FF101218161818101010
-% 101010101818181818181010101010101618181816101018181818181818
-% 18181818181818101210101010101012101010121010121018AF121612FF
-% 7D00000000000000003A3A3A9D3A3A3A9D3A9D9D3A9D3A9D3A9D9D3A3A9D
-% 3A3A9D9DFFFF535353FFFF9D9D3A3A3A3A3A3A3A3A9D3A9D3A9D9D9D3A9D
-% 9D9D3A3A9D9D3A9D9D9D3A9D9D3A3A3A9D9D3A3A3A3A3A3A3A3A3A9D3A9D
-% 9D9DFFFF535353FFFF9D9D9D9D3A3A3A9D9D9D3A3A9D3A3A9D9D9D3A3A9D
-% 3A3A9D3A9D3A3A3A3A3A3A9D9D9D3A3A9D3A3A9D3A3A9D9D3A9D3A9D9D9D
-% 9D3A3A9D9D3A9D9D9D3A9D9D9D3A9D9D9D9D3A9D3A3A9D3A9D9D9D3A3A9D
-% 3A3A3A9D3A3A3A9D9D9D9D3A3A9D9D9D9D3A3A9D9D3A3A3A3A3A7F7F1313
-% 137F7F9D3A3A9D3A9D9D9D3A3A9D3A3A9D3A3A9D9D9D9D9D3A9D3A9D3A9D
-% 9D3A3A9D9D9D3A9D3A9D9D3A3A9D3A9D9D9D3A3A3A3A3A3AFFFF535353FF
-% FF3A3A3A3A9D9D9D9D3A3A9D3A9D9D9D3A3A9D3A9D9D9D3A3A9D3A9D3A3A
-% 3A3A3A9D3A9D3A9D9D9D9D3A3A9D3A9D3A3A9D9D9DFFFF535353FFFF9D9D
-% 3A9D9D9D3A3A9D3A3A3A9D3A3A3A3A9D9D9D3A3A3AFF7D9D9D3A3A3A9D9D
-% 9D3A3A3A9D9D9D9D7F131313131313131313131313131313131313137F3A
-% 3A3A3A3A9D3A9D3A9D3A9D9D9D3AFFFF3A9D9D3A3A9D9D3A3A9DFFFF9D9D
-% 9D9D3A9D9DFFFF3A3A3A3A3A486082B17F7F1313137F7F9D9D9D9D9D3A9D
-% 3AA6FFFFFFAF9D3A9D3A3A9D3A3AFFFF3A3A3A0021000000002100161218
-% 18C518181218181810181010101010101218101010121010101010101218
-% 16181810101010101010181818181818101000FF10101012101012101010
-% 101012181818181818181010080A10101012181818181818181818181218
-% 181818171812181010101010101012181810101012161818AF181618FF7D
-% 00000000000000003A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D9D3A9D3A3A9D
-% 3A3AFF53535353535353FF9D9D9D3A9D9D9D9D3A9D3A3A9D9D3A9D9D9D9D
-% 3A3A9D9D3A9D3A9D9D3A3A9D9D3A9D3A9D9D3A3A3A3A3A3A3A3A3A9D3A9D
-% FF53535353535353FF9D9D9D3A9D3A9D9D9D3A3A9D3A3A9D9D9D3A9D9D3A
-% 3A3A3A9D3A3A3A3A3A3A9D9D9D3A3A9D3A3A3A3A9D3A9D3A3A9D9D9D9D9D
-% 3A3A9D3A3A9D9D3A3A9D3A3A9D3A9D9D9D3A3A9D3A3A3A9D9D9D3A9D9D3A
-% 3A9D3A9D3A9D9D9D9D9D3A3A9D9D9D9D9D3A9D3A3A3A3A3A7F1313131313
-% 13137F9D3A9D3A9D9D9D9D3A9D3A9D3A3A3A3A9D9D9D3A3A9D3A9D3A9D9D
-% 3A3A3A9D3A3A9D3A9D9D3A9D9D3A3A9D3A9D9D3A9D9DFF53535353535353
-% FF3A3A3A9D9D9D9D3A3A9D3A9D9D9D9D3A3A9D9D9D9D3A9D9D3A3A9D9D3A
-% 9D3A9D9D3A3A3A9D9D9D9D3A9D9D3A3A3A9D9DFF53535353535353FF3A3A
-% 3A9D9D3A3A9D9D3A9D9D3A3A9D3A9D9D9D3A3A9DFF7D3A3A9D9D3A9D9D9D
-% 9D3A9D3A9D9D9D7F131313131313131313131313131313131313137F3A3A
-% 3A3A3A9D9D3A9D9D9D9D3A3A9DFFFF3A9D9D3A3A9D9D9D3A9DFFFF9D3A3A
-% 9D9D3A3AFFFF9D3A3A59A3FFFFFF7F131313131313137F9D3A9D9D9D3A3A
-% 9D96FFDA9D9D3A9D3A3A3A3A3AFFFF3A3A3A002100000000210016181618
-% C51A18181810121818181812101010101018121610101210101010101012
-% 101012101010101012181818181818181000FF1210121018101810101010
-% 101012161818181A18181010101010101010101018181818181818161818
-% 1818181018101210101010101218181818161210121018AF181818FF7D00
-% 000000000000003A3A3A3A3A3A3A9D3A9D9D9D3A9D9D9D3A9D3A9D3A3A9D
-% 3AFF53535353535353FF9D9D3A9D3A9D3A9D9D9D9D9D3A3A9D9D9D9D3A9D
-% 3A9D3A3A9D9D9D9D3A3A9D9D3A3A3A3A9D3A9D3A3A3A3A9D3A3A9D3A9DFF
-% 53535353535353FF9D9D9D3A3A3A9D9D9D3A3A9D3A3A9D9D9D3A9D9D3A3A
-% 9D3A9D9D3A3A3A3A3A9D9D9D3A9D9D9D3A9D3A3A9D3A3A3A9D9D9D3A3A3A
-% 3A9D3A9D9D9D9D3A3A9D3A3A9D9D9D9D3A9D9D3A3A9D9D9D9D3A3A9D3A9D
-% 3A3A9D3A9D9D9D9D9D3A3A9D9D9D9D3A3A3A9D3A3A3A9D7F131313131313
-% 137F3A3A3A9D9D9D9D3A3A9D3A9D3A3A3A9D9D9D9D3A3A9D3A3A9D9D9D9D
-% 3A9D9D3A3A3A9D9D9D3A9D9D3A3A3A3A3A9D9D9D9DFF53535353535353FF
-% 9D3A3A9D9D9D9D9D3A3A9D9D9D9D3A3A9D3A9D9D9D9D9D9D3A3A3A3A9D3A
-% 3A3A3A3A3A9D9D9D3A3A9D3A3A9D3A9D9D9DFF53535353535353FF9D3A9D
-% 9D9D9D9D9D9D3A3A3A9D9D3A9D9D9D9D3A9D9DFF7D9D3A3A9D3A9D9D9D9D
-% 3A3A3A9D9D7F1313131313131313131313131313131313131313137F3A3A
-% 3A9D3A9D3A9D9D3A9D3A9D9DFFFF3A3A9D3A3A3A9D9D3A3AFFFF9D9D9D9D
-% 3A3A9DFFFF9D3A60FFFFFFFFB17F131313131313137F9D9D9D3A9D3A3AAF
-% FFFFFFB49D3A9D3A3A3A3A3AFFFF3A3A3A002100000000210018181818C5
-% 181818181816181818181710101210121612101210101818101210121018
-% 101810101010101012161818181A181800FF181818181818181810121210
-% 121012181818181818181010101010101010101012161818181818181718
-% 12161210121010121012181818181818181810121018AF181818FF7D0000
-% 0000000000003A3A3A3A3A3A3A9D3A9D9D9D3A9D9D9D3A9D3A9D3A3A9DFF
-% 535353535353535353FF9D3A9D3A9D3A9D9D9D9D9D3A3A9D9D9D9D3A9D3A
-% 9D3A3A9D9D9D9D3A3A9D9D3A3A3A3A9D3A9D3A3A3A3A9D3A3A9D3AFF5353
-% 53535353535353FF9D9D3A3A3A9D9D9D3A3A9D3A3A9D9D9D3A9D9D3A3A9D
-% 3A9D9D3A3A3A3A3A9D9D9D3A9D9D9D3A9D3A3A9D3A3A3A9D9D9D3A3A3A3A
-% 9D3A9D9D9D9D3A3A9D3A3A9D9D9D9D3A9D9D3A3A9D9D9D9D3A3A9D3A9D3A
-% 3A9D3A9D9D9D9D9D3A3A9D9D9D9D3A3A3A9D3A3A3A7F1313131313131313
-% 137F3A3A9D9D9D9D3A3A9D3A9D3A3A3A9D9D9D9D3A3A9D3A3A9D9D9D9D3A
-% 9D9D3A3A3A9D9D9D3A9D9D3A3A3A3A3A9D9D9DFF535353535353535353FF
-% 3A3A9D9D9D9D9D3A3A9D9D9D9D3A3A9D3A9D9D9D9D9D9D3A3A3A3A9D3A3A
-% 3A3A3A3A9D9D9D3A3A9D3A3A9D3A9D9DFF535353535353535353FF3A9D9D
-% 9D9D9D9D9D3A3A3A9D9D3A9D9D9D9D3A9D9DFF7D9D3A3A9D7F7F7F7F7F7F
-% 7F7F7F7F7F1313131313131313131313131313131313131313137F7F7F7F
-% 7F7F7F7F7F7F3A9D3A9D9DA3FF543A9D3A3A3A9D9D3A3AA3FFAF9D9D9D3A
-% 3AAFFFA39D3AB1FF9660487F1313131313131313137F9D9D3A9D3A3AE3FF
-% B4E3E3A63A9D3A3A3A3A54FF963A3A3A002100000000210018181818C518
-% 181818181811181218181818161210181018101818181818181818181818
-% 18181012121012101218181818181800FF1A181818181818181818101010
-% 101012181818181818101810121010101010101210181218181818181612
-% 18101210101010101018181818181A181810101012AF121612FF7D000000
-% 00000000003A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D9D9D3A9D3A3A9DFF53
-% 5353535353535353FF3A9D9D3A9D9D9D3A9D3A3A9D3A9D3A9D9D9D3A3A9D
-% 3A3A9D3A9D9D3A3A9D9D3A9D3A9D3A3A3A3A3A9D3A3A9D3A3A9DFF535353
-% 535353535353FF9D9D3A9D9D9D9D9D3A3A9D3A9D9D9D9D3A3A9D3A9D3A3A
-% 9D3A3A3A3A3A3A9D9D9D3A3A9D9D3A3A3A9D3A9D3A9D9D9D9D3A3A3A3A9D
-% 9D3A9D9D9D3A9D9D3A3A9D9D9D9D3A9D9D3A3A9D9D9D9D3A3A9D3A9D3A3A
-% 3A9D3A9D9D9D9D3A3A9D9D9D9D3A3A9D9D3A3A9D7F131313131313131313
-% 7F3A3A3A9D9D9D9D3A9D9D9D3A3A9D9D9D9D3A3A9D9D9D3A9D9D9D3A3A9D
-% 3A9D3A3A3A9D9D3A3A9D3A9D3A3A3A3A9D9DFF535353535353535353FF3A
-% 3A9D9D9D9D3A3A9D9D9D9D9D9D3A3A3A9D9D9D3A3A9D3A9D3A3A9D9D3A3A
-% 9D3A3A9D9D9D3A9D9D3A3A9D3A9D9DFF535353535353535353FF3A3A9D9D
-% 3A3A9D9D3A9D3A3A3A3A9D9D9D9D3A9D3AFF7D9D9D3A3A7F7F7F7F7F7F7F
-% 7F7F7F7F1313131313131313131313131313131313131313137F7F7F7F7F
-% 7F7F7F7F7F9D3A9D9D9DBDFFC63A9D3A3A54FFDA9D9DBDFFCB9D3A9D3A3A
-% 96FFBD9D3AFFFF9D3A3A7F1313131313131313137F9D3A9D9D9D8BFFBD9D
-% 66FFD13A9D3A3A3A3A60FF823A3A3A002100000000210016121612C51210
-% 1818181818101012101818181012101210121818181A181A181818181818
-% 181818101010101012181818181800FF1818181818181818181818121010
-% 101210121018101812101216181018121610101210181718181818181810
-% 181012101010121818181A181818181818101010AF101010FF7D00000000
-% 000000003A3A9D3A3A3A3A9D3A9D9D3A9D3A9D3A9D3A3A3A3A3A3AFF5353
-% 53535353535353FF9D9D3A3A9D9D9D9D3A9D9D3A3A9D9D9D3A3A3A9D9D3A
-% 9D3A9D9D3A3A3A9D9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3AFF53535353
-% 5353535353FF9D9D3A3A3A9D9D9D3A3A9D3A3A9D9D9D3A3A9D3A9D3A3A9D
-% 3A9D3A3A3A3A9D9D9D3A3A9D3A9D9D3A3A9D3A9D9D9D9D3A3A3A9D3A9D3A
-% 3A9D9D3A3A9D9D3A3A9D9D9D9D3A9D9D3A3A3A9D9D9D3A3A3A3A9D9D3A9D
-% 3A9D9D9D9D9D3A3A9D9D9D9D3A3A9D3A3A3A3A7F1313131313131313137F
-% 9D3A3A9D9D9D3A3A3A9D9D3A3A9D9D9D9D3A3A3A9D9D3A3A9D9D9D3A3A9D
-% 9D3A3A9D9D9D3A3A3A3A9D9D3A3A3A9D9DFF535353535353535353FF3A3A
-% 3A9D9D9D3A3A3A9D9D9D9D3A3A9D3A9D9D9D3A3A3A9D3A3A3A9D3A3A3A3A
-% 9D9D9D9D9D3A9D3A3A3A9D9D9D9DFF535353535353535353FF3A9D9D9D3A
-% 3A9D9D3A9D9D3A3A9D9D9D9D9D3A3A9DFF7D9D9D3A3A3A9D9D9D3A3A3A9D
-% 9D9D7F1313131313131313131313131313131313131313137F3A3A3A9D3A
-% 9D9D9D9D3A9D9D3A9D48FFFFBD489D54A3FF719D9DA3E3FFC6A39D488BFF
-% E3A39D9DA3FF82A33A7F1313131313131313137F9D9D9D9DAFFFB19D9D9D
-% CBFF719D3A3A3A3A82FF603A3A3A002100000000210010101010C5101012
-% 161818101210101018121210101810121018181818181818181818181818
-% 1818181210101012101210181000FF1A1818181818181818181818181210
-% 1010101010121010181012181818181A1810121018181818181818181818
-% 17181012101216181818181A18181812101010AF101010FF7D0000000000
-% 0000003A3A9D3A3A3A3A9D3A9D9D3A9D3A9D3A9D3A3A3A3A3A3A9DFF5353
-% 5353535353FF9D9D9D3A3A9D9D9D9D3A9D9D3A3A9D9D9D3A3A3A9D9D3A9D
-% 3A9D9D3A3A3A9D9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A9DFF53535353
-% 535353FF9D9D9D3A3A3A9D9D9D3A3A9D3A3A9D9D9D3A3A9D3A9D3A3A9D3A
-% 9D3A3A3A3A9D9D9D3A3A9D3A9D9D3A3A9D3A9D9D9D9D3A3A3A9D3A9D3A3A
-% 9D9D3A3A9D9D3A3A9D9D9D9D3A9D9D3A3A3A9D9D9D3A3A3A3A9D9D3A9D3A
-% 9D9D9D9D9D3A3A9D9D9D9D3A3A9D3A3A3A3A9D7F131313131313137F3A9D
-% 3A3A9D9D9D3A3A3A9D9D3A3A9D9D9D9D3A3A3A9D9D3A3A9D9D9D3A3A9D9D
-% 3A3A9D9D9D3A3A3A3A9D9D3A3A3A9D9D9DFF53535353535353FF9D3A3A3A
-% 9D9D9D3A3A3A9D9D9D9D3A3A9D3A9D9D9D3A3A3A9D3A3A3A9D3A3A3A3A9D
-% 9D9D9D9D3A9D3A3A3A9D9D9D9D9DFF53535353535353FF9D3A9D9D9D3A3A
-% 9D9D3A9D9D3A3A9D9D9D9D9D3A3A9DFF7D9D9D3A3A3A9D9D9D3A3A3A9D9D
-% 9D7F1313131313131313131313131313131313131313137F3A3A3A9D3A9D
-% 9D9D9D3A9D9D3A9D3AB2FFFFFFFFFFFFD13A9D9D9DB2FFFFFFFFFFFFE3B2
-% 9D9D9D4EC8FFFFFFFF7F131313131313137F9D9D9D9D9DE3FF549D9D9D9D
-% E3FFA63A3A3A3AC8FF3A3A3A3A002100000000210010101010C510101012
-% 1816181810121012101010101210181018161818181A1818181818181818
-% 18181818121010101010101200FF18181818181012101817181818181810
-% 121010121010121012161818181818181818101818181818181818181818
-% 18181816181818181A181818181618181810AF101010FF7D000000000000
-% 00003A3A3A3A3A3A3A9D3A9D9D9D3A9D3A9D3A3A3A9D9D3A9D3AFF535353
-% 53535353FF9D9D3A9D3A3A9D3A3A9D9D9D9D3A9D9D3A3A9D3A9D9D3A3A3A
-% 3A9D9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A9D9D3A9D9DFF5353535353
-% 5353FF9D9D9D3A9D3A9D9D9D3A3A9D3A3A9D9D9D3A3A9D3A9D9D3A9D9D3A
-% 3A3A3A3A9D9D9D9D3A3A9D3A9D3A3A9D3A9D9D9D3A3A9D3A3A3A3A9D3A9D
-% 9D9D3A9D9D9D3A3A9D9D9D3A9D9D3A3A3A9D9D9D3A3A9D3A9D9D3A3A3A3A
-% 9D9D9D9D3A3A9D9D9D9D3A9D3A3A3A3A9D9D7F131313131313137F3A9D3A
-% 3A9D9D9D9D3A9D9D3A3A3A9D9D9D9D3A3A9D9D9D3A3A9D9D3A3A9D9D3A3A
-% 3A3A9D9D3A3A9D9D9D9D9D3A3A9D9D9DFF53535353535353FF9D3A3A3A9D
-% 9D9D3A3A9D3A9D9D9D3A9D3A9D9D9D9D3A3A9D3A9D3A3A9D3A3A3A3A9D9D
-% 9D9D9D3A3A9D3A3A3A9D9D9D9DFF53535353535353FF3A9D9D9D9D3A3A9D
-% 3A9D9D9D3A3A9D3A9D9D9D3A9D9DFF7D9D9D9D3A3A9D9D9D9D3A3A9D3A9D
-% 9D7F131313131313131313131313131313131313137F3A3A9D3A3A3A9D9D
-% 9D3A9D9D3A9D9D3A9D548BC8FFB1B79D3A3A9D9D9DA682E3FFC8C0A63A9D
-% 9D3A9DA3C0B1FFFF7F131313131313137FB29D9D9DC6FF773A9D9D3A9DAF
-% FFDA3A3A3A60FF823A3A3A3A002100000000210010101010C51010101010
-% 121818181818181612161216121012101218181818181818181012101817
-% 181818181810121010121000FF1818111210101010121818181818181818
-% 181210101210101210121810121618181818181818181A18181818181818
-% 18181818181818181A1818181818181810AF101210FF7D00000000000000
-% 003A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D3A9D3A9D9D3A3A3A7FFFFF5353
-% 53FFFFFF9D9D9D3A3A9D9D9D9D9D9D3A9D9D9D9D3A3A3A9D9D9D3A9D3A9D
-% 9D3A9D9D9D9D3A9D9D3A9D3A3A3A3A3A3A3A9D9D9D3AFFFFFFFF535353FF
-% FF9D9D9D9D3A3A3A9D9D9D3A3A3A3A9D9D9D9D9D3A3A9D9D3A3A3A3A3A3A
-% 3A3A9D9D9D9D3A3A3A3A3A9D9D3A3A9D9D9D9D3A9D3A9D9D3A3A3A3A9D9D
-% 9D3A9D9D9D9D9D9D9D9D3A9D9D3A3A3A9D9D9D3A3A3A3A9D9D3A9D3A3A9D
-% 9D9D9D3A3A9D9D3A9D3A3A3A3A3A3A3A3A9D7F7F1313137F7F7F7F9D9D3A
-% 9D9D9D3A9D9D9D9D3A3A9D9D9D3A9D3A3A9D9D9D3A9D9D9D3A9D9D9D3A3A
-% 3A9D9D3A3A3A9D9D9D3A3A9D9D9D9D7FFFFF535353FFFFFF3A3A3A3A9D9D
-% 9D9D3A3A3A9D9D9D3A3A9D3A9D9D9D3A3A3A9D9D3A3A3A3A9D3A3A3A3A9D
-% 9D3A3A3A3A3A9D9D9D9D9D9DFFFFFF535353FFFF3A9D9D3A9D9D3A3A9D3A
-% 9D9D9D3A3A9D3A9D9D9D3A3A3AFF7D9D9D3A3A3A9D9D9D9D3A3A9D3A9D9D
-% 7F131313131313131313131313131313131313137F3A3A3A3A3A9D9D3A9D
-% 9D3A9D9D9D9D9D3A3A9D9D3A3A9D3A3A3A3A3A9D9D9D3A3A9D3A3A9D3A9D
-% 3A9D3A3A9D9D9D9D7F7F1313137F7F7FDA3A9D3A3A3A3A3A9D9D3A9D9D3A
-% 9D9D3A3ADAFF483A3A3A3A002100000000210012101012C5101010101018
-% 181820191818181818181818101010121012181818111210101010121818
-% 1818181818181812101000FF181818161812181612101212181818181018
-% 101813181818181612161818181818181818181A181818181A1818181812
-% 10131618181818181818181210121012AF121618FF7D0000000000000000
-% 3A3A3A3A3A3A3A9D3A9D9D9D9D9D9D9D3A9D3A9D9D3A7F7F131313FFFFFF
-% 535353FFFF9D3A3A9D9D9D9D9D9D3A9D9D9D9D3A3A3A9D9D9D3A9D3A9D9D
-% 3A9D9D9D9D3A9D9D3A9D3A3A3A3A3A3A3A9D9DFFFF535353FFFFFFFF3A3A
-% 9D9D9D9D3A3A3A9D9D9D3A3A3A3A9D9D9D9D9D3A3A9D9D3A3A3A3A3A3A3A
-% 3A9D9D9D9D3A3A3A3A3A9D9D3A3A9D9D9D9D3A9D3A9D9D3A3A3A3A9D9D9D
-% 3A9D9D9D9D9D9D9D9D3A9D9D3A3A3A9D9D9D3A3A3A3A9D9D3A9D3A3A9D9D
-% 9D9D3A3A9D9D3A9D3A3A3A3A3A3A3A3A9D9D3A7F7F7F7F1313137F7F3A9D
-% 9D9D3A9D9D9D9D3A3A9D9D9D3A9D3A3A9D9D9D3A9D9D9D3A9D9D9D3A3A3A
-% 9D9D3A3A3A9D9D9D3A3A9D9D7F7F131313FFFFFF535353FFFF3A3A9D9D9D
-% 9D3A3A3A9D9D9D3A3A9D3A9D9D9D3A3A3A9D9D3A3A3A3A9D3A3A3A3A9D9D
-% 3A3A3A3A3A9D9D9D9DFFFF535353FFFFFF9D3A3A9D9D3A9D9D3A3A9D3A9D
-% 9D9D3A3A9D3A9D9D9D3A3A3AFF7D9D9D3A3A3A9D9D9D9D3A3A9D3A9D9D7F
-% 131313131313131313131313131313131313137F3A3A3A3A3A9D9D3A9D9D
-% 3A9D9D9D9D9D3A3A9D9D3A3A9D3A3A3A3A3A9D9D9D3A3A9D3A3A9D3A9D3A
-% 9D3A3A9D9D9D9D9D9D7F7F7F1313137F7F9D3A3A3A3A3A9D9D3A9D9D3A9D
-% 9D3A60FF823A3A3A3A3A002100000000210016181818C510101010101018
-% 181818181818181810181818181012101018181818161812181612101212
-% 18181818101810181300FF10181018101818181818101618181818181818
-% 181816181212101210121818181818181818181818181818181A18181618
-% 181818181818181818AFAFAFAFAFAFAF121018FF7D00000000000000003A
-% 3A3A9D3A3A3A9D3A9D9D3A9D3A9D3A9D3A9D3A3A7F1313131313FF535353
-% 53535353FF9D9D9D9D9D3A9D9D9D9D9D3A3A3A3A9D9D9D9D3A9D3A9D3A3A
-% 3A9D9D9D3A3A9D9D9D3A9D3A3A3A3A3A9DFF53535353535353FF9D9D9D9D
-% 9D9D9D3A3A9D9D9D9D9D3A3A9D9D9D9D9D9D3A3A9D9D3A9D3A3A3A3A3A3A
-% 3A9D9D9D9D3A3A9D9D9D9D3A3A9D9D9D3A9D3A9D9D9D9D3A3A9D9D9D9D3A
-% 9D9D9D9D9D9D9D9D9D9D9D3A3A9D9D9D9D3A9D3A9D9D9D3A3A9D9D9D9D9D
-% 9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A9D9D3A3A7F131313131313137F9D9D
-% 9D9D9D9D9D9D3A3A3A9D9D3A3A3A3A9D9D9D9D9D9D3A9D9D9D3A3A3A9D9D
-% 9D3A3A3A9D9D9D3A9D3A7F1313131313FF53535353535353FF3A9D3A9D9D
-% 3A3A3A9D9D3A3A3A3A3A9D9D9D3A3A3A9D9D3A9D3A3A3A3A3A3A9D9D9D3A
-% 3A3A9D9D3A9D9DFF53535353535353FF3A3A3A3A3A3A9D9D3A3A3A3A9D9D
-% 9D3A9D3A3A9D9D9D3A3A3AFF7D9D9D3A9D3A9D9D9D9D3A3A3A9D3A9D9D7F
-% 13131313131313131313131313131313137F3A3A3A3A3A3A9D3A3A9D9D9D
-% 9D9D9D9D9D9D9D3A9D3A3A3A9D9D9D9D3A9D9D9D9D3A9D9D9D9D9D3A9D3A
-% 3A9D9D3A3A9D9D9D7F131313131313137F3A3A9D9D9D9D9D9D9D9D3A9D3A
-% 3AC8C83A3A3A3A3A3A002100000000210010181018C51012101010121012
-% 101217181818101818181810121010101810181018101818181818101618
-% 181818181818181800FF1012121212101018181818181210121018121612
-% 161210101010101010101018181818181818181818181A18181818181818
-% 1818181818181818181818131010AF101210FF7D00000000000000003A3A
-% 3A3A3A9D3A9D3A9D9D9D9D9D9D3A9D3A3A3A9D7F1313131313FF53535353
-% 535353FF3A9D9D9D3A9D9D9D9D3A3A9D3A3A9D9D9D9D9D3A9D3A9D3A3A3A
-% 9D9D9D3A9D9D3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A3A9D3A9D
-% 3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A9D3A9D3A
-% 3A9D3A9D3A3A3A3A9D3A3A9D3A9D3A3A3A3A9D3A9D3A3A9D3A3A9D3A3A3A
-% 3A3A3A3A9D3A3A3A9D3A9D3A3A9D3A3A9D3A9D3A3A3A3A3A3A9D3A9D9D3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D7F131313131313137F3A9D3A
-% 9D3A3A9D3A3A3A9D3A9D3A3A3A3A3A9D3A9D3A3A9D9D3A9D9D3A9D9D9D9D
-% 9D9D9D9D3A9D3A3A3A7F1313131313FF53535353535353FF3A3A3A9D3A3A
-% 3A9D3A9D3A3A9D3A9D3A9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3AFF53535353535353FF9D3A9D3A9D3A9D3A3A3A3A9D3A9D9D
-% 3A9D3A9D3A9D9D3A9D3AFF7D3A9D3A9D3A9D9D9D9D9D3A3A3A9D3A3A9D7F
-% 1313131313131313131313131313137F3A3A3A3A3A3A9D3A9D9D3A9D9D9D
-% 3A9D9D9D9D3A9D3A9D3A3A9D9D9D3A3A3A9D3A9D3A9D9D9D9D9D9D9D9D9D
-% 3A3A9D9D3A9D9D7F131313131313137F3A9D3A9D9D9D3A9D9D9D3A9D3A8B
-% FF593A3A3A3A3A3A002100000000210012101218C5101010101010101012
-% 181812181618101210121010101010121012121212101018181818181210
-% 1210181216121600FF121010101010121810181818161010121010101210
-% 12161210101010101010101210161818181818181A1820181A1818181818
-% 18181818181818181818161810AF101010FF7D00000000000000003A3A3A
-% 3A3A9D3A9D3A9D9D9D9D9D9D3A9D3A3A3A7F1313131313FF535353535353
-% 535353FF9D9D9D3A9D9D9D9D3A3A9D3A3A9D9D9D9D9D3A9D3A9D3A3A3A9D
-% 9D9D3A9D9D3A3A3A3A3A3A3A3A3AFF535353535353535353FF3A9D3A9D3A
-% 3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A9D3A9D3A3A
-% 9D3A9D3A3A3A3A9D3A3A9D3A9D3A3A3A3A9D3A9D3A3A9D3A3A9D3A3A3A3A
-% 3A3A3A9D3A3A3A9D3A9D3A3A9D3A3A9D3A9D3A3A3A3A3A3A9D3A9D9D3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D7F1313131313131313137F9D3A9D
-% 3A3A9D3A3A3A9D3A9D3A3A3A3A3A9D3A9D3A3A9D9D3A9D9D3A9D9D9D9D9D
-% 9D9D9D3A9D3A3A7F1313131313FF535353535353535353FF3A3A9D3A3A3A
-% 9D3A9D3A3A9D3A9D3A9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3AFF535353535353535353FF3A9D3A9D3A9D3A3A3A3A9D3A9D9D3A
-% 9D3A9D3A9D9D3A9D3AFF7D3A9D3A9D3A9D9D9D9D9D3A3A3A9D3A3A9D7F7F
-% 131313131313131313131313137F7F3A3A3A3A3A3A9D3A9D9D3A9D9D9D3A
-% 9D9D9D9D3A9D3A9D3A3A9D9D9D3A3A3A9D3A9D3A9D9D9D9D9D9D9D9D9D3A
-% 3A9D9D3A9D7F1313131313131313137F9D3A9D9D9D3A9D9D9D3A9D3A3A3A
-% 3A3A3A3A3A3A3A002100000000210010101210C512121012101012101012
-% 101817121210181618101210101010121010101010121810181818161010
-% 12101010121000FF10101012101210101218181810121012161218121612
-% 101010101008100E1010101012121618181818181A181818181818181818
-% 181818181818181818181810AF101010FF7D00000000000000003A3A3A3A
-% 3A3A3A9D3A9D9D9D3A9D9D3A9D3A3A9D7F1313131313FF53535353535353
-% 5353FF9D9D9D9D9D9D9D9D3A3A9D3A9D9D9D9D9D9D3A9D9D9D3A3A3A9D9D
-% 9D3A3A9D3A9D3A3A3A3A3A3A3AFF535353535353535353FF3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A7F1313131313FF535353535353535353FF3A3A3A3A9D9D3A
-% 3A3A3A3A9D3A3A9D3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A
-% 3A9D3AFF535353535353535353FF9D3A9D3A9D9D9D9D9D9D9D9D9D3A3A9D
-% 3A9D3A9D3A9D9D3AFF7D3A3A3A9D3A3A9D3A9D9D9D3A3A3A3A9D3A3A9D7F
-% 13131313131313131313137F3A3A3A3A3A3A3A3A3A9D3A3A9D3A9D9D9D9D
-% 9D3A3A9D9D9D3A3A9D3A9D3A9D3A3A9D9D3A9D3A9D9D9D9D3A9D3A9D3A9D
-% 9D9D9D9D7F1313131313131313137F9D3A9D9D9D9D9D9D9D3A9D3A3A3A3A
-% 3A3A3A3A3A3A002100000000210010101012C51817181612101010121618
-% 181818101618181816181618181010101012101210101218181810121012
-% 161218121600FF1012101010101010101012181818181012101010101210
-% 1210101010101010101010101012181818181A18181A1818181818171818
-% 1216181818181816181810AF101008FF7D00000000000000003A3A3A3A3A
-% 3A3A9D3A9D9D3A9D9D9D3A3A9D3A9D7F1313131313FF5353535353535353
-% 53FF3A3A9D3A3A3A3A3A3A9D3A9D9D9D9D9D3A9D3A9D9D9D3A3A9D9D9D9D
-% 3A3A9D3A3A3A3A3A9D3A3A3AFF535353535353535353FF3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A7F1313131313131313137F3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A7F1313131313FF535353535353535353FF3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3AFF535353535353535353FF3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A9D3A3A3A9DFF7D3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A7F
-% 7F7F13131313137F7F7F3A3A3A3A9D3A3A3A3A3A3A9D3A9D3A9D9D3A9D9D
-% 3A3A9D9D3A9D3A3A9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D9D
-% 9D9D3A7F1313131313131313137F9D3A9D3A9D3A3A9D9D3A9D3A3A3A9D3A
-% 3A3A3A3A3A002100000000210010081010C5181818181818181613181818
-% 181818121818181818181818101012101010101010101012181818181012
-% 1010101000FF121010121012101210121010121612161216121813181718
-% 101210101010101010101010101816181818181A18181818181812101210
-% 12181217181818121810AF100810FF7D00000000000000003A3A3A3A3A3A
-% 3A9D3A9D9D3A9D9D9D3A3A9D3A9D3A7F1313131313FF53535353535353FF
-% 9D3A3A9D3A3A3A3A3A3A9D3A9D9D9D9D9D3A9D3A9D9D9D3A3A9D9D9D9D3A
-% 3A9D3A3A3A3A3A9D3A3A3A3AFF53535353535353FF3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A7F131313131313137F3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A7F1313131313FF53535353535353FF3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3AFF53535353535353FF3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A9D3A3A3A9DFF7D3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A7F7F7F7F7F3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A9D3A9D9D3A9D9D3A
-% 3A9D9D3A9D3A3A9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D3A9D9D9D
-% 9D3A9D7F131313131313137F9D9D3A9D3A9D3A3A9D9D3A9D3A3A3A9D3A3A
-% 3A3A3A3A002100000000210008101010C51818181A18181A181818181A18
-% 181818181818181818181810121010121012101210121010121612161216
-% 12181300FF10101210101210181210121010121018181818181618181818
-% 1610101010100A0E10101212181218181818181818181818101012101010
-% 121618121612181610AF10080AFF7D00000000000000003A3A3A3A3A3A3A
-% 9D3A9D9D9D9D9D9D3A9D9D3A3A3A7F1313131313FF535353535353FFFFFF
-% 9D9D3A9D3A9D9D3A9D3A9D9D9D3A9D9D9D9D9D9D9D3A9D9D3A9D3A9D3A9D
-% 3A9D3A9D3A3A3A3A9D3A3AFF53535353535353FF3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F13131313137F7F7F3A3A3A3A3A3A9D3A
-% 3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A7F7F1313131313FF5353535353FFFFFF3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A
-% 3AFF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3AFF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A9D9D3A9D9D9D9D3A3A9D
-% 3A9D9D9D3A3A9D3A9D9D9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D
-% 9D9D7F13131313137F7F7F9D9D3A3A3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A
-% 3A3A3A0021000000002100080A1010C51818181820181818181818181818
-% 181812101210181216181010101210101210181210121010121018181818
-% 181600FF12181018181818181A1818181810101818161216121012101218
-% 181818121010101010101010101818181818181818101018121816121612
-% 1012101210101218AF101010FF7D00000000000000003A3A3A9D3A3A3A9D
-% 3A9D9D3A9D9D9D3A9D3A3A7F7F137F7F1313137FFFFF5353FFFF535353FF
-% FF9D9D3A3A3A3A9D9D9D3A9D9D9D9D9D9D3A9D9D3A3A9D9D9D9D9D3A3A9D
-% 9D3A9D9D3A3A3A3AFFFF53FFFF535353FFFF3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F137F7F1313137F7F3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A9D3A3A
-% 7F7F13137F7F1313137FFFFF53FFFF535353FFFF3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF
-% 53FFFF535353FFFF3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3AFF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D9D3A9D3A3A9D3A
-% 9D9D9D3A9D9D9D9D9D9D3A3A9D3A9D9D3A9D9D3A9D3A3A9D9D9D9D9D9D9D
-% 9D3A7F7F137F7F1313137F7F9D9D3A9D9D9D9D9D3A9D3A3A3A3A3A9D3A3A
-% 3A3A002100000000210010101010C51816181A181A181A18181A181A1816
-% 1210101210121012101812181018181818181A1818181810101818161216
-% 1200FF101012101818181818181A18181218181818181812101810101218
-% 181010101010101010101210121618181818161210121018101818181810
-% 18101210121012AF121010FF7D00000000000000003A3A3A9D3A3A3A9D3A
-% 9D9D3A9D9D9D3A9D3A7F13131313137F7F7F9D9D3AFFFF53535353535353
-% FF9D3A3A3A3A9D9D9D3A9D9D9D9D9D9D3A9D9D3A3A9D9D9D9D9D3A3A9D9D
-% 3A9D9D3A3A3AFF5353535353FFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A7F131313131313137F3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A9D3A7F13
-% 13131313137F7F7F3A3A9DFF53535353535353FF3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3AFF535353
-% 5353FFFFFF3A9D3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3AFF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D9D3A9D3A3A9D3A9D
-% 9D9D3A9D9D9D9D9D9D3A3A9D3A9D9D3A9D9D3A9D3A3A9D9D9D9D9D9D9D9D
-% 3A9D3A7F131313131313137F9D3A9D9D9D9D9D3A9D3A3A3A3A3A9D3A3A3A
-% 3A002100000000210010101010C5C5C5C5C5C5C518181A181A1818181812
-% 101210121012101812101012101818181818181A18181218181818181812
-% 00FF10121010121012181818181818181818181818181718131010101010
-% 121010101010101010101210101212121012101010121012181818181818
-% 101210101010AF121818FF7D00000000000000003A3A3A3A3A3A3A9D3A9D
-% 9D9D9D9D9D3A9D9D7F131313131313137F9D3A9D3AFF53535353535353FF
-% 3A9D3A9D9D3A9D9D9D9D9D9D9D9D9D3A9D3A9D9D9D3A9D9D9D3A3A9D3A3A
-% 3A3A3A3A3AFF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313137F3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313
-% 13131313137F3A3A3A3AFF53535353535353FF3A3A3A3A3A3A3A9D3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353
-% 535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3AFF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A9D9D9D9D3A3A9D9D3A3A
-% 9D3A9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A7F131313131313137F3A3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A
-% 002100000000210018181813C5181818181A181818181818181818181010
-% 101010101012101010121010121012181818181818181818181818181700
-% FF1810101210101818181818181818181818181818181816101012101010
-% 101010101010101210101210121010121010101010101216181818181818
-% 1010101010AF101018FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D
-% 9D3A9D9D3A9D7F1313131313131313137F9D3AFF535353535353535353FF
-% 3A9D9D9D9D9D9D9D9D9D3A9D9D9D3A9D3A9D9D9D9D9D9D3A3A3A9D3A3A9D
-% 9D9D9DFF535353535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D3A9D9D3A9D3A9D9D9D9D3A9D3A9D9D3A9D9D3A9D3A9D
-% 3A9D3A9D9D3A3A9D9D3A9D3A9D9D3A9D3A3A9D3A9D3A9D3A9D9D3A9D3A3A
-% 9D3A3A9D3A9D3A9D3A9D3A3A9D3A9D3A9D3A3A9D3A9D3A9D9D3A9D3A9D3A
-% 9D3A9D3A3A9D3A9D3A9D3A7F1313131313131313137F9D3A3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13131313
-% 13131313137F3A3AFF535353535353535353FF3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3AFF535353535353
-% 535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3AFF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A9D9D9D3A3A3A9D9D9D3A9D
-% 9D9D9D9D9D9D3A9D3A3A9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A9D3A9D9D9D
-% 7F1313131313131313137F3A9D9D9D9D9D3A9D3A9D3A3A3A3A3A3A3A3A00
-% 2100000000210010181816C5181818181818181818181818181810101010
-% 1010101210101818101012101018181818181818181818181818181800FF
-% 181818101612181018181818181818181818181818181818181010121018
-% 181010101210101012101010101210101210101010101218181818181810
-% 12101010AF0A1010FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D
-% 3A9D9D3A9D7F1313131313131313137F9D3AFF535353535353535353FF3A
-% 9D9D9D9D9D9D9D9D9D3A9D9D9D3A9D3A9D9D9D9D9D9D3A3A3A9D3A3A9D9D
-% 9D9DFF535353535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D3A9D9D3A9D3A9D9D9D9D3A9D3A9D9D3A9D9D3A9D3A9D3A
-% 9D3A9D9D3A3A9D9D3A9D3A9D9D3A9D3A3A9D3A9D3A9D3A9D9D3A9D3A3A9D
-% 3A3A9D3A9D3A9D3A9D3A3A9D3A9D3A9D3A3A9D3A9D3A9D9D3A9D3A9D3A9D
-% 3A9D3A3A9D3A9D3A9D3A7F1313131313131313137F9D3A3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313131313
-% 131313137F3A3AFF535353535353535353FF3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3AFF53535353535353
-% 5353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% FF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A9D9D9D3A3A3A9D9D9D3A9D9D
-% 9D9D9D9D9D3A9D3A3A9D3A9D3A3A9D3A3A3A3A3A3A3A3A3A9D3A9D9D9D7F
-% 1313131313131313137F3A9D9D9D9D9D3A9D3A9D3A3A3A3A3A3A3A3A0021
-% 00000000210010101012C518181818181818181718181818121012101010
-% 12101018181818181810161218101818181818181818181818181800FF1A
-% 181812121210181012121018181818181818181216181818101210181818
-% 101018101818181816121012101012161010101010121818181818181012
-% 101010AF100810FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D9D
-% 9D9D3A9D7F1313131313131313137F3A3AFF535353535353535353FF3A9D
-% 3A3A3A9D9D9D9D9D9D9D9D9D3A3A9D9D3A9D3A3A9D9D3A3A9D9D3A3A3A3A
-% 3AFF535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A7F1313131313131313137F3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313
-% 1313137F3A9DFF535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A9D3A9D3A9D9D3A3A9DFF5353535353535353
-% 53FF3A9D3A9D3A9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D9DFF
-% 7D9D9D9D9D9D3A9D9D9D9D9D3A9D9D9D9D3A9D3A9D3A9D3A9D3A9D3A9D9D
-% 3A9D9D3A9D9D3A9D9D3A9D3A9D9D3A9D3A9D9D9D9D3A3A9D9D9D9D3A3A9D
-% 9D9D9D3A9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D3A3A3A9D9D9D9D3A9D7F13
-% 13131313131313137F3A9D9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A3A002100
-% 000000210008101010C51818171818181818181818181612101010101010
-% 12181818181A181812121210181012121018181818181818181200FF1818
-% 121010101012101010121012181818171818161812181012121012121818
-% 1818181818181A1818181010181818101210101010101818181818161217
-% 1210AF101010FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D3A3A9D
-% 9D3A9D9D7F131313131313137F9D3A3A9DFF53535353535353FF9D3A3A9D
-% 9D9D9D3A9D9D9D9D3A9D3A9D9D9D3A9D3A9D3A9D9D3A3A9D9D9D9D9D9D9D
-% 9DFF53535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D3A3A9D3A9D3A9D9D3A9D3A3A9D9D3A9D9D9D9D3A9D
-% 3A9D3A3A9D3A3A9D3A3A9D3A3A3A9D3A3A9D3A9D3A3A3A3A3A3A9D3A3A9D
-% 3A3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A9D3A9D3A3A
-% 9D3A3A9D3A3A9D3A9D7F131313131313137F3A3A3A9D3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F131313131313
-% 137F3A3A3A3AFF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF7D
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D3A3A9D9D3A9D9D3A9D3A
-% 9D9D9D9D9D3A9D9D9D9D9D9D3A3A9D9D9D3A3A3A9D3A3A9D9D60FF8B7F13
-% 1313131313137F9D3A9D9DC6FFB23A9D3A3A3A3A3A3A3A3A3A3A00210000
-% 0000210010101010C5101218181818181818111813181010101010101218
-% 1818181A18181210101010121010101210121818181718181600FF181810
-% 101010101210101010101216181818181012101210101010101010101818
-% 181818181818181818181818181818101010101012181818181818181818
-% 10AF181210FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D3A3A9D9D
-% 3A9D9D7F131313131313137F9D3A3A9DFF5353535353FFFFFF9D3A3A9D9D
-% 9D9D3A9D9D9D9D3A9D3A9D9D9D3A9D3A9D3A9D9D3A3A9D9D9D9D9D9D9D9D
-% FF53535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D3A3A9D3A9D3A9D9D3A9D3A3A9D9D3A9D9D9D9D3A9D3A
-% 9D3A3A9D3A3A9D3A3A9D3A3A3A9D3A3A9D3A9D3A3A3A3A3A3A9D3A3A9D3A
-% 3A3A9D3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A9D3A9D3A3A9D
-% 3A3A9D3A3A9D3A9D7F13131313137F7F7F3A3A3A9D3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F13131313131313
-% 7F3A3A3A3AFF5353535353FFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53535353535353FF3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF7D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D9D9D9D9D9D3A3A9D9D3A9D9D3A9D3A9D
-% 9D9D9D9D3A9D9D9D9D9D9D3A3A9D9D9D3A3A3A9D3A3A9D9DC8E33A7F1313
-% 1313137F7F7F9D3A9D9D9DE3E33A9D3A3A3A3A3A3A3A3A3A3A0021000000
-% 00210012101010C510101818181818181818181810121010101012161818
-% 181A1818181010101010121010101010121618181818101200FF18181810
-% 10080810101010100B0E0A10101618181818181810181316121612161210
-% 121618181818181818161218101818181818161010101012101010121010
-% AF121818FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D9D3A9D9D
-% 7F7F137F7F1313137F7F9D9D3A3A9D9DFFFF53FFFF535353FFFF9D9D3A9D
-% 9D9D9D3A9D9D9D3A9D9D3A9D9D9D3A9D3A9D9D3A9D9D9D9D3A9D9DFFFF53
-% FFFF535353FFFF9D9D9D3A9D3A9D9D3A9D9D9D9D9D9D3A9D3A9D9D3A9D9D
-% 9D9D9D9D3A9D9D3A3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D7F7F137F7F1313137F7F9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D7F7F137F7F1313137F7F9D
-% 9D9D9D9D9DFFFF53FFFF535353FFFF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFFFF53FFFF535353FFFF9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF7D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D3A3A9D3A9D3A9D9D3A9D9D3A
-% 9D9D9D9D9D9D9D3A9D3A9D9D9D3A9D9D9D9D9D9D9D9DC0FF609D3A7F7F13
-% 7F7F1313137F7F9D9D9DB2FF829D3A3A3A9D3A3A3A3A3A3A002100000000
-% 210018181618C51010181618181A1818181310101810181012181818181A
-% 18181818181010080810101010100B0E0A10101618181800FF1818181612
-% 101010101010101010101010121818181818161018101612171218101210
-% 1218181818181818181018101818181818181818101210101210101010AF
-% 161818FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D3A9D9D7F13
-% 131313137F7F7F3A9D3A9D3A3A9D9D9D3AFF53535353535353FF9D3A9D3A
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A9D9D9D9D9D9DFF53535353
-% 53FFFFFF9D9D3A3A9D9D3A9D9D9D3A9D9D9D3A9D9D3A9D9D9D3A9D9D3A9D
-% 9D3A9D9D9D9D3A3A9D9D3A3A3A3A3A9D3A3A3A9D9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A9D3A3A9D3A9D3A9D9D9D3A9D3A9D3A9D3A3A3A3A3A3A9D3A
-% 3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A9D3A3A9D9D3A9D3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A9D3A
-% 9D3A9D9D3A9D3A9D3A9D9D9D9D9D9D3A9D7F13131313137F7F7F9D9D9D9D
-% 9D9D9D9D9D9DFF53535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF5353535353FFFFFF9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF7D9D9D9D
-% 3A9D9D9D9D9D9D3A9D3A9D3A9D9D9D9D9D9D9D9DFFFFFFFFFF3A9D3A9D9D
-% 9D9D9D9D9D9D9D9D9D9D3A9D9D3A9D9D9D3A3A9D9D3A9D3A9D9D9D9D9D9D
-% 3A3A9D9D3A9D3A9D9D3A9D9D9D9D9D3A9D3A9D9DA3FFDA3A9D3A3A9D7F13
-% 1313131313137F9D3A9DDAFFA33A3A3A3A3A3A3A3A3A3A00210000000021
-% 0018181818C518181818181818181818181012101218161216181818181A
-% 1818181816121010101010101010101010101218181800FF181618181818
-% 181012101010101010101010121618181818121812181218121012101210
-% 12101818181618181018121012101818181818121010121012101210AF12
-% 1818FF7D00000000000000003A3A3A3A3A3A3A9D3A9D9D9D3A9D9D7F1313
-% 13131313137F3A9D3A9D3A3A9D9D9D3AFF53535353535353FF9D3A9D3A9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D3A9D9D9D9D9D9DFF5353535353
-% 5353FF9D9D3A3A9D9D3A9D9D9D3A9D9D9D3A9D9D3A9D9D9D3A9D9D3A9D9D
-% 3A9D9D9D9D3A3A9D9D3A3A3A3A3A9D3A3A3A9D9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A9D3A3A9D3A9D3A9D9D9D3A9D3A9D3A9D3A3A3A3A3A3A9D3A3A
-% 3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A
-% 9D3A3A9D9D3A9D3A7F131313131313137F3A3A3A3A3A3A3A3A3A3A9D3A9D
-% 3A9D9D3A9D3A9D3A9D9D9D9D9D9D3A9D7F131313131313137F9D9D9D9D9D
-% 9D9D9D9D9DFF53535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF53535353535353FF9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF7D9D9D9D3A
-% 9D9D9D9D9D9D3A9D3A9D3A9D9D9D9D9DFFFFFF5353535353FFFFFF9D9D9D
-% 9D9D9D9D9D9D9D9D9D3A9D9D3A9D9D9D3A3A9D9D3A9D3A9D9D9D9D9D9D3A
-% 3A9D9D3A9D3A9D9D3A9D9D9D9D9D3A9D3A9D9DC0FFB23A9D3A3A9D7F1313
-% 13131313137F9D3A9DB2FFC03A3A3A3A3A3A3A3A3A3A0021000000002100
-% 18181818C5181818181818181818181818131618101218181818181A1818
-% 18161818181818101210101010101010101012161800FF18121216181818
-% 12161210101010100A0F1010121818181618171816181618101210101010
-% 121018181812161218101010181818181818121612181018101810AF1012
-% 16FF7D00000000000000003A3A3A3A3A3A3A9D3A9D3A9D9D9D7F13131313
-% 13131313137F3A9D9D3A3A3A9D3AFF535353535353535353FF9D9D3A9D3A
-% 9D9D9D9D9D3A9D3A9D3A9D9D9D3A9D3A3A9D9D9D9D9DFF53535353535353
-% 5353FF9D9D9D9D9D9D3A9D9D9D9D9D9D9D9D3A9D3A9D3A9D9D9D9D9D9D3A
-% 9D3A9D3A3A3A9D9D9D3A3A3A3A3A3A9D9D9D9D9D9D3A3A3A3A3A9D9D3A3A
-% 3A9D9D3A3A3A3A3A9D3A3A3A3A3A9D9D3A3A3A3A3A9D9D3A3A3A9D9D9D3A
-% 3A3A3A9D9D3A3A3A3A9D9D3A3A9D9D3A3A3A3A3A3A9D9D9D3A3A3A9D9D3A
-% 3A3A9D9D9D9D7F1313131313131313137F3A9D3A3A3A3A3A9D9D3A3A3A3A
-% 9D3A3A9D9D9D9D3A3A3A3A9D9D3A7F1313131313131313137F3A3A3A3A3A
-% 3A9D3AFF535353535353535353FF3A9D9D9D3A3A3A3A3A3A9D3A3A3A3A3A
-% 9D9D9D3A3A3A3A9D9D3A3A3AFF535353535353535353FF3A3A9D9D9D9D9D
-% 3A3A3A3A3A3A9D9D3A3A3A3A9D3A3A9D3A3A3A3A9D9D9DFF7D9D3A9D9D3A
-% 9D9D3A9D9D3A9D9D3A9D9D3A3A9DFF5353535353535353535353FF9D9D9D
-% 9D3A9D3A9D9D9D9D9D9D9D3A9D9D9D3A3A9D71D1FFFFB1BD9D9D9D9D9DFF
-% FF3A9D9DFFFF9D9D9D9D3A9DFFFF9D9D3A9DE3E39D3A9D3AC67F13131313
-% 13131313137F9D9D9DC8E33A3A3A3A3A3A3A3A3A3A002100000000210012
-% 161818C518181A1818181A18181818181818181818161818181818181818
-% 12121618181812161210101010100A0F1010121800FF1810101012101216
-% 121810121010121010101010121618181818181818181810101010121010
-% 1012101216121810181018181818181818161218101810181210AF101212
-% FF7D00000000000000003A3A9D3A3A9D3A9D3A9D9D9D3A9D7F1313131313
-% 131313137F3A9D9D3A9D9D9D9DFF535353535353535353FF9D9D9D3A9D3A
-% 9D3A9D3A9D9D9D9D9D9D3A9D3A9D3A3A9D9D9D9D9DFF5353535353535353
-% 53FF9D3A9D9D3A9D9D3A9D9D9D9D3A9D9D9D9D9D9D3A9D3A9D9D9D9D3A9D
-% 9D9D9D3A3A9D9D9D9D3A3A3A3A3A9D3A9D9D9D9D3A3A9D3A3A9D3A9D9D3A
-% 9D9D9D3A3A3A3A9D3A3A3A3A3A9D9D9D3A3A3A3A9D3A9D9D3A9D9D9D3A3A
-% 3A3A9D3A3A3A3A3A9D9D9D3A9D3A3A3A3A3A3A9D9D9D9D3A3A3A9D9D9D9D
-% 9D9D9D9D9D7F1313131313131313137F9D9D9D3A3A3A3A9D9D3A9D9D3A9D
-% 9D3A9D3A3A3A3A3A3A3A3A9D3A7F1313131313131313137F9D3A3A3A3A9D
-% 9D3AFF535353535353535353FF3A3A9D9D9D3A3A3A3A3A9D9D9D9D3A3A9D
-% 9D9D9D9D3A9D9D3A3A3A3AFF535353535353535353FF3A3A3A9D9D9D9D3A
-% 3A3A3A3A3A9D9D9D9D3A3A3A3A3A9D9D9D3A3A9D9D9DFF7D9D9D9D3A9D9D
-% 9D9D9D9D9D9D3A9D9D3A9DFFFF53535353535353535353535353FFFF9D9D
-% 9D9D9D9D9D9D9D9D9D9D3A3A9D9D3A3AD1FFFFFFFFFFFFC8A39D9D9DFFFF
-% 9D9D9DFFFF9D3A9D9D9D3AFFFF3A9D9DB2FFC69D3A3A3A9D7F1313131313
-% 131313137F9D9D9D8BFF609D3A3A3A3A3A3A3A3A00210000000021001212
-% 1818C518181818181818181A181818181818181818181818181818181810
-% 1010121012161218101210101210101010101200FF181612101010101210
-% 121612101216101010101210121818181818181818181612101010101210
-% 12101210121612181818181818161210121012101210121010AF101010FF
-% 7D00000000000000003A3A9D3A3A9D3A9D3A9D9D9D3A9D7F131313131313
-% 1313137F3A9D9D3A9D9D9D9DFF535353535353FFFFFFFF9D9D9D3A9D3A9D
-% 3A9D3A9D9D9D9D9D9D3A9D3A9D3A3A9D9D9D9D9DFF535353535353535353
-% FF9D3A9D9D3A9D9D3A9D9D9D9D3A9D9D9D9D9D9D3A9D3A9D9D9D9D3A9D9D
-% 9D9D3A3A9D9D9D9D3A3A3A3A3A9D3A9D9D9D9D3A3A9D3A3A9D3A9D9D3A9D
-% 9D9D3A3A3A3A9D3A3A3A3A3A9D9D9D3A3A3A3A9D3A9D9D3A9D9D9D3A3A3A
-% 3A9D3A3A3A3A3A9D9D9D3A9D3A3A3A3A3A3A9D9D9D9D3A3A3A9D9D9D9D9D
-% 9D9D9D9D7F1313131313137F7F7F7F9D9D9D3A3A3A3A9D9D3A9D9D3A9D9D
-% 3A9D3A3A3A3A3A3A3A3A9D3A7F1313131313131313137F9D3A3A3A3A9D9D
-% 3AFF535353535353FFFFFFFF3A3A9D9D9D3A3A3A3A3A9D9D9D9D3A3A9D9D
-% 9D9D9D3A9D9D3A3A3A3AFF535353535353535353FF3A3A3A9D9D9D9D3A3A
-% 3A3A3A3A9D9D9D9D3A3A3A3A3A9D9D9D3A3A9D9D9DFF7D9D9D9D3A9D9D9D
-% 9D9D9D9D9D3A9D9D3A9DFF535353535353535353535353535353FF9D9D9D
-% 9D9D9D9D9D9D9D9D9D3A3A9D9D3A71FFD1AF9D9DA3C6FFC69D9D9DFFFF9D
-% 9D9DFFFF9D3A9D9D9D3AFFFF3A9D9DC0FFB49D3A3A3A9D7F131313131313
-% 137F7F7F9D9D9D66FF829D3A3A3A3A3A3A3A3A0021000000002100101012
-% 18C518181818181818181818181A18181818181818181818181818181612
-% 10101010121012161210121610101010121000FF18181816101010101012
-% 101210181216121010101012161818181818181818121810101010101010
-% 121012101810181818181818181210101210121012101210AF100F10FF7D
-% 00000000000000003A3A3A3A3A3A3A9D3A9D3A9D7F7F137F131313131313
-% 137F9D9D3A9D3A9D9D9D9D3AFF535353FFFF535353FFFF9D9D9D9D3A9D3A
-% 9D3A9D9D9D9D9D9D9D9D3A9D3A9D9D9D9D9DFFFFFF53535353535353FF9D
-% 9D9D9D9D9D9D3A9D9D9D3A3A9D3A9D9D9D3A9D9D3A9D9D9D9D3A9D9D9D9D
-% 3A3A3A9D9D9D9D3A3A3A3A3A3A3A9D9D9D9D3A3A3A3A9D3A3A9D9D9D9D9D
-% 9D3A3A3A3A9D9D3A3A3A3A9D9D9D3A3A3A3A3A3A9D9D9D9D9D9D3A3A3A3A
-% 3A3A3A3A9D9D9D9D9D9D3A9D3A3A3A3A3A9D9D9D9D3A3A3A9D9D9D9D9D9D
-% 9D9D9D9D7F1313137F7F1313137F7F9D9D3A3A3A3A9D3A3A9D9D9D9D3A3A
-% 3A3A3A3A3A3A3A3A3A9D7F7F7F131313131313137F9D9D9D3A3A3A9D3A3A
-% 3AFF535353FFFF535353FFFF9D3A9D9D9D3A3A3A3A3A9D3A9D9D3A9D9D9D
-% 9D9D9D9D3A3A3AFFFF53FF53535353535353FF9D3A3A3A9D9D9D9D9D3A3A
-% 3A3A9D9D9D9D9D3A3A3A3A3A9D9D3A9D3A9D9D9DFF7D9D9D9D9D3A9D9D3A
-% 9D3A9D9D9D9D9D9DFF5353535353535353535353535353535353FF9D3A9D
-% 3A9D9D3A9D9D9D9D3A3A9D9D3AB1FFA39D3A9D9D3AFFFF9D3A3AFFFF9D9D
-% 3AFFFF9D3A9D3A9D9DFFFF9D9D9DCBFFA93A9D3A3A9D9D7F131313137F7F
-% 1313137F7F9D54FF963A3A3A3A3A3A3A3A3A00210000000021000F101010
-% C5101818181818181A18181A181A18181818181818181818181818181816
-% 101010101012101210181216121010101000FF1818181818121010101010
-% 101818181810101010101012181818181818181818181012101010121010
-% 1010121018181018181818181816121010101210101010AF100A10FF7D00
-% 000000000000003A3A3A3A3A3A3A9D3A9D9D7F1313137F13131313131313
-% 7F9D9D3A9D3A9D9D9D9D9DFF5353FF53535353535353FF9D9D9D9D9D9D3A
-% 9D9D3A9D9D9D9D9D9D9D3A3A9D9D9D3AFF5353FF53535353535353FF9D9D
-% 9D9D9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D
-% 3A3A9D9D9D9D3A3A3A3A3A9D9D3A3A9D9D3A3A3A3A3A9D3A9D3A3A9D9D9D
-% 3A3A3A3A9D3A3A3A3A3A9D9D9D3A3A3A3A9D3A9D9D3A9D9D9D3A3A3A3A9D
-% 9D3A3A3A3A3A9D9D9D3A3A3A3A3A3A9D9D9D9D9D3A3A3A3A9D9D9D9D9D9D
-% 9D9D9D7F13137F131313131313137F9D3A3A3A3A9D9D3A9D9D3A9D3A3A3A
-% 3A3A3A3A3A3A3A9D7F13137F131313131313137F9D9D3A3A3A3A9D9D3A3A
-% FF5353FF53535353535353FF9D9D9D9D3A3A3A3A9D3A3A9D9D9D9D9D9D9D
-% 9D3A3A3A3AFF535353FF53535353535353FF9D3A3A3A9D9D3A9D9D3A9D3A
-% 3A9D9D3A9D9D3A3A9D3A3A3A3A9D9D9D9D9D9DFF7D9D9D9D3A9D9D9D9D9D
-% 9D9D3A9D9D9DFF53535353535353535353535353535353535353FF9D3A9D
-% 3A9D9D9D3A9D3A9D3A3A9D3A3A3A9D9D9D3A9DA6FFFF9D3A3AFFFF9D3A9D
-% FFFF9D9D9D9D3A9DFFFF9D9D3AFFFF9D9D9D3A9D9D3A7F1313137F131313
-% 131313137F3AFFFF3A3A3A3A3A3A3A3A3A00210000000021000A101010C5
-% 10121018181818181A181A18201818181818181818181818181818181818
-% 1210101010101018181818101010101000FF181818181010101010101218
-% 1816181818181818181818181A1818181810101816181818181216101210
-% 12101810121010101818181012101012101010121010AF100A08FF7D0000
-% 0000000000003A3A3A3A3A3A3A9D3A9D9D7F131313137F7F1313137F7F9D
-% 9D9D3A9D3A9D9D9D9D9D9DFFFFFF53535353535353FF9D9D9D9D9D9D3A9D
-% 9D3A9D9D9D9D9D9D9D3A3A9D9D9D3AFF535353FFFF535353FFFF9D9D9D9D
-% 9D9D9D3A9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D3A9D9D9D9D9D9D9D3A
-% 3A9D9D9D9D3A3A3A3A3A9D9D3A3A9D9D3A3A3A3A3A9D3A9D3A3A9D9D9D3A
-% 3A3A3A9D3A3A3A3A3A9D9D9D3A3A3A3A9D3A9D9D3A9D9D9D3A3A3A3A9D9D
-% 3A3A3A3A3A9D9D9D3A3A3A3A3A3A9D9D9D9D9D3A3A3A3A9D9D9D9D9D9D9D
-% 9D9D3A7F7F7F131313131313137F9D3A3A3A3A9D9D3A9D9D3A9D3A3A3A3A
-% 3A3A3A3A3A3A9D7F1313137F7F1313137F7F3A9D9D3A3A3A3A9D9D3A3A3A
-% FFFFFF53535353535353FF9D9D9D9D3A3A3A3A9D3A3A9D9D9D9D9D9D9D9D
-% 3A3A3A3AFF53535353FFFF535353FFFF9D9D3A3A3A9D9D3A9D9D3A9D3A3A
-% 9D9D3A9D9D3A3A9D3A3A3A3A9D9D9D9D9D9DFF7D9D9D9D3A9D9D9D9D9D9D
-% 9D3A9D9D9DFF53535353535353535353535353535353535353FF9D3A9D3A
-% 9D9D9D3A9D3A9D3A3A9D3A3A3A9DA3B282DAFFFF8B9D3A3AFFFF9D3A9DFF
-% FF9D9D9D9D3A9DFFFF9D9D3AFFFF9D9D9D3A9D9D3A9D7F7F137F13131313
-% 1313137F3AFFFF3A3A3A3A3A3A3A3A3A00210000000021000A081010C510
-% 101012161818181818181A18181818101012101810181618181818181010
-% 10101010121818161818181818181800FF16181818101012081010101012
-% 181818181818181818181A181A1818161212181818181818161210121010
-% 121216181010121010101212161218101210101012AF101010FF7D000000
-% 00000000003A3A3A3A3A3A3A9D3A9D7F131313131313137F7F7F3A9D9D9D
-% 9D9D3A3A9D9D9D9D9D3A9DFF535353535353535353FF9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D3A9D9D9D9DFF535353535353FFFFFFFF9D3A9D9D3A9D
-% 3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9D3A9D3A9D9D3A9D3A9D9D9D3A3A3A
-% 9D9D9D3A3A3A3A3A3A9D3A3A3A9D9D3A3A3A3A3A9D9D3A3A3A9D9D3A3A3A
-% 3A3A9D3A3A3A3A3A9D9D3A3A3A3A3A9D9D3A3A3A9D9D9D3A3A3A3A9D9D3A
-% 3A3A3A3A9D9D9D9D3A3A3A3A3A9D9D9D9D9D3A3A3A3A3A9D9D9D9D9D9D9D
-% 3A3A3A7F1313131313131313137F3A3A3A3A9D9D9D3A3A3A9D3A3A3A3A3A
-% 9D9D9D9D9D7F1313131313137F7F7F7F3A3A9D9D3A3A3A3A9D9D3A3A3A3A
-% FF535353535353535353FF3A9D9D3A3A3A3A9D9D9D9D3A3A9D9D9D9D3A3A
-% 9D3AFF53535353535353FFFFFF3A9D9D9D3A3A3A9D3A3A9D3A3A3A3A3A9D
-% 3A3A9D9D3A3A3A3A3A9D9D3A3A3A9D9D9DFF7D9D9D3A9D3A3A9D3A9D9D9D
-% 9D9D9D3AFF53535353535353535353535353535353535353FF9D3A9D9D9D
-% 9D9D9D9D9D9D9D3A9D3A3AAFD1FFFFFFFFFFDAA63A9D3AFFFF9D9D9DFFFF
-% 9D9D3A9D9D3AFFFF9D3A9DFFFF9D9D9D3A9D9D9D9D3ACB7F131313131313
-% 1313137FFFFF3A3A9D3A3A3A3A3A3A002100000000210010101010C51010
-% 10101218181818181A181818181810121012101210121216181818101012
-% 081010101012181818181818181800FF121018121612100E0A0810101018
-% 18181A18181A181818181818181812101018181818181818181010181318
-% 1618181210101010101010181816181810181216AF101010FF7D00000000
-% 000000003A3A3A3A3A3A3A9D3A9D7F1313131313131313137F9D3A9D9D9D
-% 9D9D9D9D9D9D9D9D9D3AFF535353535353FFFFFFFF9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9DFF535353535353535353FF9D9D9D9D9D9D9D
-% 3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D3A3A9D
-% 9D9D3A9D3A9D3A3A3A3A9D3A9D9D3A9D3A3A9D3A3A3A3A9D3A9D3A3A9D3A
-% 3A3A3A9D3A9D9D3A9D3A3A3A3A3A9D3A3A3A3A9D3A3A9D3A3A3A3A3A3A9D
-% 3A9D9D9D9D9D9D3A9D9D3A9D9D9D9D3A3A3A9D3A3A9D3A3A9D9D9D9D9D3A
-% 3A9D7F1313131313137F7F7F7F3A3A3A3A3A3A3A3A3A3A9D9D3A3A3A3A3A
-% 3A3A3A3A7F1313131313131313137F3A3A9D3A3A3A3A3A9D9D3A3A3A3AFF
-% 53535353535353FFFFFF3A3A3A3A3A3A3A9D3A3A3A3A3A9D9D9D3A3A3A3A
-% 3AFF535353535353535353FF3A9D9D3A3A3A9D9D9D3A3A9D3A3A3A3A3A3A
-% 3A9D3A3A3A3A3A9D9D9D3A3A3A9D9D9DFF7D9D9D9D9D9D9D9D9D3A9D3A9D
-% 9D9DFF535353535353535353535353535353535353535353FF9D9D3A9D3A
-% 9D9D3A9D9D9D3A9D3AB2FFFFFFFFDAC0AF9D3A9D9D9DFFFF3A9D3AFFFF9D
-% 9D9D9D3A9DFFFF9D9D9DFFFF3A9D9D3A9D9D9D3AAFFF7F1313131313137F
-% 7F7F7FFFFF3A3A3A3A3A3A3A3A3A002100000000210010101010C5100E10
-% 10121018181818181A18181818101216121018101210121018121612100E
-% 0A081010101818181A18181A1800FF101210181818181010100A10101818
-% 18181818181818181A181818181010121012101818181810181218161818
-% 18181618101010101012181818181618121618AF121010FF7D0000000000
-% 0000003A3A3A3A3A3A3A9D3A7F7F1313131313131313137F9D3A9D9D9D9D
-% 9D9D9D9D9D9D9D9D3AFF53535353FFFF535353FFFF9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9DFFFF535353535353535353FF9D9D9D9D9D9D9D3A
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A9D9D9D9D9D3A3A9D9D
-% 9D3A9D3A9D3A3A3A3A9D3A9D9D3A9D3A3A9D3A3A3A3A9D3A9D3A3A9D3A3A
-% 3A3A9D3A9D9D3A9D3A3A3A3A3A9D3A3A3A3A9D3A3A9D3A3A3A3A3A3A9D3A
-% 9D9D9D9D9D9D3A9D9D3A9D9D9D9D3A3A3A9D3A3A9D3A3A9D9D9D9D9D3A3A
-% 9D7F131313137F7F1313137F7F3A3A3A3A3A3A3A3A3A9D9D3A3A3A3A3A3A
-% 3A3A7F7F1313131313131313137F3A3A9D3A3A3A3A3A9D9D3A3A3A3AFF53
-% 53535353FFFF535353FFFF3A3A3A3A3A9D3A3A3A3A3A9D9D9D3A3A3A3AFF
-% FF535353535353535353FF3A9D9D3A3A3A9D9D9D3A3A9D3A3A3A3A3A3A3A
-% 9D3A3A3A3A3A9D9D9D3A3A3A9D9D9DFF7D9D9D9D9DFFFFFFFFFFFFFFFFFF
-% FFFF535353535353535353535353535353535353535353FFFFFFFFFFFFFF
-% FFFFFF9D9D3A9D3ADAFFCBB2489D9D9D9D3A9D9D9DFFFF3A9D3AFFFFA69D
-% 9D9D3A9DFFFF9D9D9DCBFF549D9D3A9D9D9D3AE3FF7F131313137F7F1313
-% 137F7F963A3A3A3A3A3A3A3A3A002100000000210010101010C510101010
-% 101212101818181818181818181810181112101610101210181818181010
-% 100A1010181818181818181800FF10101010121018181810101012181818
-% 18181818181818181A181818101210101010121012101018101818181818
-% 181818181818181010181218101212101218AF101810FF7D000000000000
-% 00003A3A3A3A9D3A3A9D7F13137F131313131313137F9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9DFF5353FF53535353535353FF9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9DFF5353FF53535353535353FF9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D7F13137F131313131313137F9D9D9D9D9D9D9D9D9D9D9D9D9D3A3A9D9D
-% 7F13137F131313131313137F9D3A3A3A3A3A3A9D3A3A9D3A3A3A3A3AFF53
-% 5353FF53535353535353FF3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3AFF5353
-% FF53535353535353FF3A3A3A3A3A3A3A9D9D3A3A3A9D3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A9D9D9D9DFF7D9D9D9D9DFFFFFFFFFFFFFFFFFFFF
-% FF535353535353535353535353535353535353535353FFFFFFFFFFFFFFFF
-% FFFF9D9D9D3A3AFFFF9D9D9D9D9DA3FFE39D9D9DFFFF9D9D9DFFFF719D9D
-% 9D3A54FFFF9D3A9DC0FFB29D9D3A9D9D9DC6FF779D7F13137F1313131313
-% 13137F3A3A3A3A3A3A3A3A3A002100000000210018101210C51010101010
-% 101012181818181818181018101812181018121010101010121018181810
-% 101012181818181818181800FF1012101010101218181810121618181818
-% 181818181818181818181012101010101010101210121210181018181818
-% 1818181A18181812161216121010101012AF181012FF7D00000000000000
-% 003A3A3A3A3A3A3A9D7F13137F131313131313137F3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3AFF5353FF53535353535353FF3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3AFF5353FF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A9D3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 7F13137F131313131313137F3A3A3A3A3A3A3A9D3A3A3A3A9D3A9D3A3A7F
-% 13137F131313131313137F3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF5353
-% 53FF53535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF5353FF
-% 53535353535353FF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9D9DFF7D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF
-% 535353535353535353535353535353535353535353FF9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9DD1FFC0A39D9DA9D1FFC09D9D9DFFFF9D9D9DFFFFDAC6A69D
-% A9D1FFC69D9D9DB2FFC09D9D9D9D9DAFFFDA9D9D7F13137F131313131313
-% 137F3A3A9D3A3A3A3A3A3A002100000000210010121010C5101010101012
-% 101012121818161210101212161216181818121012101010101218181810
-% 1216181818181818181800FF1810121010100E1816121810181618161818
-% 161818181818181818121012101010101218181812101012121612181618
-% 18181818181818181818181018121010AF101216FF7D0000000000000000
-% 3A3A3A3A3A3A3A7F131313137F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3AFFFF535353535353FFFFFFFF3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3AFF53535353FFFF535353FFFF3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A9D3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 7F7F1313131313137F7F7F7F3A3A3A3A3A3A9D3A3A3A3A9D3A9D3A7F1313
-% 13137F7F1313137F7F9D3A9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFFFFFF
-% 535353535353FFFFFFFF9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF53535353FF
-% FF535353FFFF9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9D9D9D9D9D9D9D9DFF7D9D9D9D9D9D9D9D9D9D9D9D9D9D9DFF53
-% 5353535353535353535353535353535353535353FF9D9D9D9D9D9D9D9D9D
-% 9D9D9D9D9DA6E3FFFFFFFFFFFFDA9D9D9D9DFFFF9D9D9DFFFFA6E3FFFFFF
-% FFFFA99D9D9D9DFFE39D9D9D9D9DE3FFA99D9D9D7F7F1313131313137F7F
-% 7F7F3A9D3A3A3A3A3A3A002100000000210012161210C510101010101012
-% 1012101210121010101010121818181818181810121010100E1816121810
-% 18161816181816181800FF181810100A100A101010101812121218181818
-% 181818181818181810101010101216181818181810121010121612181812
-% 10101018181818181818181818180AAF101216FF7D00000000000000003A
-% 3A3A3A3A3A7F7F1313131313137F7F7F7F3A9D3A9D9D9D3A3A9D3A9D9D3A
-% 9D3A9D3A3A9D9D9DFF53535353FFFF535353FFFF9D9D3A3A9D9D3A3A9D3A
-% 9D9DFFFFFF535353535353FFFFFFFF3A3A3A9D3A9D3A3A9D3A9D3A3A3A3A
-% 3A3A3A9D3A3A9D3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A
-% 3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 7F131313137F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F131313
-% 1313137F7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53
-% 535353FFFF535353FFFF3A3A3A3A3A3A3A3A3A3A3A3AFFFF535353535353
-% FFFFFFFF3A3A3A3A3A3A3A3A3A9D3A3A9D3A3A3A9D3A3A3A9D3A3A3A9D3A
-% 3A3A9D3A3A3A3A3A3A3A3AFF7D3A3A3A9D3A3A3A9D3A3A9D3A9D3A3AFF53
-% 535353535353535353535353535353535353FF3A9D3A3A3A9D3A9D3A9D3A
-% 9D3A3A9D3A48C0B1FFFFD1719D3A9D3A3AFFFF3A3A9DFFFF9DA6CBFFFFC6
-% A99D9D3A9D9D82FFB23A9D9DC6FFBD3A9D9D3A9D7F131313137F7F131313
-% 7F7F3A3A3A3A3A3A3A002100000000210012161210C51010101010101010
-% 10101012101010101010121018181A181A181810100A100A101010101812
-% 121218181818181800FF181818101010100B101012101818181818181818
-% 181010181216121012101010101218181818181A18181216121818121018
-% 1818181818181816121816181818AF101210FF7D00000000000000003A3A
-% 3A3A3A7F137F1313131313131313137F3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 9D3A3A9D3A3A3AFF535353FF53535353535353FF3A3A3A3A3A3A9D3A3A3A
-% FF5353FF535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A9D3A3A3A7F
-% 1313137F131313131313137F3A3A9D3A9D3A9D3A9D9D3A7F137F13131313
-% 13131313137F9D9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9DFF5353
-% 53FF53535353535353FF9D9D9D9D9D9D9D9D9D9DFF53FF53535353535353
-% 5353FF9D9D9D9D9D9D9D9D9D3A3A9D3A9D3A9D3A9D3A9D3A3A9D9D3A9D9D
-% 9D3A9D3A3A3A9D9D9D9DFF7D9D9D9D3A9D9D9D9D9D9D3A9D3A9D9DFF5353
-% 5353535353535353535353535353535353FF9D3A9D3A9D9D3A9D9D9D3A9D
-% 9D9D9D3A3A9D3A9D9D3A9D3A9D3A9D3A9D9D9D9D3A9D3A3A3A3A3A3A3A3A
-% 3A3A9D3A9D48FFB19D3A3A9D3A9D3A9D3A9D3A7F1313137F131313131313
-% 137F3A3A3A3A3A3A002100000000210012101818C5101216121818181810
-% 10121010121010101010121818181818181818101010100B101012101818
-% 1818181818181800FF181818101210101010101012101210181818181818
-% 181211181012101012101010101818181818181812101210181810121012
-% 18101818181818121012121018AF181012FF7D00000000000000003A3A3A
-% 3A3A7F13137F131313131313137F3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D
-% 3A3A9D3A3A3A3AFF5353FF535353535353FFFFFF3A3A3A3A3A9D3A3A3AFF
-% 535353FF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A9D3A3A3A9D3A3A3A9D7F
-% 13137F1313131313137F7F7F3A9D3A9D3A9D3A9D9D7F7F13137F13131313
-% 1313137F9D9D9D9D9D9D9D3A9D9D3A9D9D9D9D9D9D9D9D9D9D9D9DFF5353
-% FF5353535353FFFFFF9D9D9D9D9D9D9D9D9D9DFF5353FF53535353535353
-% FF9D9D9D9D9D9D9D9D9D9D3A3A9D3A9D3A9D3A9D3A9D3A3A9D9D3A9D9D9D
-% 3A9D3A3A3A9D9D9D9DFF7D9D9D9D3A9D9D9D9D9D9D3A9D3A9D9DFF535353
-% 53535353535353535353535353535353FF9D3A9D3A9D9D3A9D9D9D3A9D9D
-% 9D9D3A3A9D3A9D9D3A9D3A9D3A9D3A9D9D9D9D3A9D3A3A3A3A3A3A3A3A3A
-% 3A9D3A9D3AC0FFB23A3A9D3A9D3A9D3A9D3A3A7F13137F13131313137F7F
-% 7F3A3A3A3A3A3A002100000000210010121612C518181818181818181218
-% 161812101010101010101012181818181818101210101010101012101210
-% 18181818181800FF16181216121012101010121010101018181818181818
-% 181812161216121012101218181818181A18181010101010101010101010
-% 121012101210101010101018AF121012FF7D00000000000000003A3A3A7F
-% 7F1313137F131313131313137F3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3AFF53FF5353535353FFFF535353FFFF3A3A3A3A3AFFFF5353
-% 5353FF53535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A
-% 3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A9D3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A7F13
-% 7F13131313137F7F1313137F7F3A3A3A3A3A7F7F7F1313137F1313131313
-% 13137F3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3AFF53FF53
-% 535353FFFF535353FFFF3A3A3A3A3A3AFFFF535353FF53535353535353FF
-% 3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A9D3A9D3A3A3A3AFF7D3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3AFF535353
-% 5353535353535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF3A3A3A3A9D3A3A3A3A3A3A3A9D3A
-% 3A3A3A3A3AC8C83A3A3A3A3A3A3A3A3A3A9D7F137F131313137F7F131313
-% 7F7F3A3A3A3A002100000000210010121018C51316181818181818181818
-% 181618181818101010101010181816181216121012101010121010101018
-% 181818181800FF1812161218101012101210101010101012181818181818
-% 18101812101210101217181A18181A181818181010101010101010101010
-% 1010101818121810101012AF121010FF7D000000000000007F7F7F7F137F
-% 131313137F7F1313137F7F3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A
-% 3A3A3A3A3A3AFFFF53535353FF5353535353FFFFFFFFFFFFFF53FF535353
-% 5353FFFF535353FFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A7F7F
-% 131313137F13131313137F7F7F7F7F7F7F13137F131313137F7F1313137F
-% 7F3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3AFFFF5353
-% 53FF5353535353FFFFFFFFFFFF3AFF53FF53535353FFFF535353FFFF3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3AFF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF535353
-% 535353535353535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A59FF8B3A3A3A3A3A3A3A3A3A3A3A7F7F1313137F13131313137F
-% 7F7F3A7F7F7F2100000000210010101216C518181818181818181A181818
-% 121818181818121010101012181812161218101012101210101010101012
-% 1818181800FF101018111818181818181818181818181818181818181818
-% 1818111810101218181818181A181A181818161010101010101010101010
-% 10181718181816121010AF101210FF7D00000000007F7F137F7F7F137F13
-% 13131313137F7F7F7F3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A
-% 3A3A3A3A3A3AFF53535353FF535353FFFF53FFFF53FFFFFF53FF53535353
-% 535353FFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 9D3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A9D3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A7F13
-% 1313137F1313137F7F137F7F137F7F7F13137F1313131313137F7F7F7F3A
-% 3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3AFF535353
-% FF535353FFFF53FFFF5353FFFFFF53FF535353535353FFFFFFFF3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3AFF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF535353
-% 53535353535353535353FFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313137F1313137F7F1313
-% 7F7F1313137F7F000000210012101210C516181818181818181818181010
-% 121018181818181818101012101018111818181818181818181818181818
-% 18181800FF121810181018181018181818181A1818181818181A18181818
-% 161818131810181818181A18181818181818181012101010101010101010
-% 181818181818181810AF161816FF7D000000007F13137F137F1313137F13
-% 1313131313137F3A3A3A3A3AFFFFFFFFFFFF3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3AFF5353FF535353FF5353FF5353FF53FF535353FF53535353
-% 535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A9D3A3A3A9D3A3A9D3A3A9D3A3A3A3A3A3A3A9D3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A7F13
-% 137F1313137F13137F13137F137F131313137F131313131313137F3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53FF53
-% 5353FF5353FF535353FF53FF535353FF53535353535353FF3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3AFF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF535353
-% 5353535353535353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F137F1313137F1313137F13
-% 1313131313137F0000210018161216C51812181618181618181210121010
-% 121018C5C5C5C5C5C51010121810181018181018181818181A1818181818
-% 181A00FF1810121812161218101818181818181818181A18181818181818
-% 18181018101818181818AF1818181818AF18101810121010101010101012
-% 1210121818181810AF181818FF7D000000007F13137F137F1313137F1313
-% 13131313137F3A3A3A3A3A3A3AFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3AFF5353FF535353FF5353FF5353FF53FF535353FF5353535353
-% 5353FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A7F1313
-% 7F1313137F13137F13137F137F131313137F131313131313137F3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53FF5353
-% 53FF5353FF535353FF53FF535353FF53535353535353FF3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3AFF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFFFF53
-% 53535353FFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F137F1313137F1313137F1313
-% 13131313137F0000210018181812C5101210181218181810101810181010
-% 12121818C5C5181810121810121812161218101818181818181818181A18
-% 1800FF17181612161012161210181818181818181A181818181818181818
-% 18181018181818181AAF1818101812AF1810121018101210121010101010
-% 10101012181812AF181818FF7D0000007F13137F13137F131313137F7F13
-% 13137F7F3A3A3A3A3A3A3A3AFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3AFFFFFF5353FF5353FF5353FF5353FF53535353FFFF535353FF
-% FF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A9D3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F7F
-% 13137F13137F13137F13137F13131313137F7F1313137F7F3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF5353FF
-% 5353FF535353FF5353FF53535353FFFF535353FFFF3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3AFF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFFFF
-% FFFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F13137F1313137F13131313
-% 13131313137F00210018181816C510121012101216121818181818181010
-% 101012C5C51816181817181612161012161210181818181818181A181818
-% 00FF18181818121010101010121618181818181818181A1818181A181818
-% 18181818181818AFAFAFAFAFAFAFAF101012101818181010AFAFAFAFAFAF
-% AFAFAFAFAFAFAF181018FF7D0000007F13137F1313137F13131313137F7F
-% 7F3A3A3A3A3A3A3A3A3A3AFFFF3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3AFFFF53FF5353FF5353FF535353FF5353535353FFFFFF3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F7F
-% 137F13137F13137F1313137F1313131313137F7F7F3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3AFF53FF53
-% 53FF535353FF535353FF5353535353FFFFFF3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3AFF7D3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A
-% 3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A7F137F1313137F1313131313
-% 131313137F00210010181318C5C5C5C5C5C5C5C5C5C5C5C5C51818181818
-% 1210C5C51018181818181818121010101010121618181818181818181A00
-% FF10121810101010101010101012181818181818181818181A181A181818
-% 181818181818AFAFAFAFAFAFAFAF10101010181210181012101010101012
-% 101218181817181618FF7D0000007F13137F1313137F131313131313137F
-% 00000000000000000000FFFF000000000000000000000000000000000000
-% 000000000000FF53FF5353FF5353FF535353FF53535353535353FF000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000007F13
-% 7F13137F13137F1313137F131313131313137F0000000000000000000000
-% 00000000000000000000000000000000000000000000000000FF53FF5353
-% FF535353FF535353FF53535353535353FF00000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 00FF7D000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 00000000000000000000000000000000007F137F1313137F131313131313
-% 1313137F0021001618161816121012101012101012101210121818181818
-% 10C5C51212181210121810101010101010101012181818181818181800FF
-% 1210101010100810101010101010101218161818181A181A181818181817
-% 181818181818181818181818AF1010101010101210121010181010101010
-% 1218181818181818FF7D000000007F13137F1313137F7F1313137F7F0000
-% 000000000000000000FFFF00000000000000000000000000000000000000
-% 000000000000FFFFFF5353FF5353FF535353FFFF535353FFFF0000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000007F7F
-% 7F13137F13137F1313137F7F1313137F7F00000000000000000000000000
-% 00000000000000000000000000000000000000000000000000FFFFFF5353
-% FF535353FF535353FFFF535353FFFF000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% FF7D00000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 00000000000000000000000000000000007F7F7F1313137F131313131313
-% 137F00002100181818181818181810181010121010121010101210181818
-% C5C51010101012101010101008101010101010101012181618181800FF10
-% 1012101010100A0F0A10101010101010121618181820181A181818181818
-% 1216181818181818181818AF101010101010101010181818181712101816
-% 1818181A181818FF7D000000007F13137F13131313137F7F7F0000000000
-% 000000000000FFFFFFFF0000000000000000000000000000000000000000
-% 00000000000000FF5353FF5353FF5353535353FFFFFF0000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 00000000000000000000000000000000000000000000000000000000007F
-% 13137F13137F13131313137F7F7F00000000000000000000000000000000
-% 0000000000000000000000000000000000000000000000000000FF5353FF
-% 535353FF5353535353FFFFFF000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000000000000000000FF
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7F1313137F13131313131313
-% 7F0000210018181818181818181812101210101210121012101012C5C5C5
-% C516121010101012101010100A0F0A101010101010101216181800FF1012
-% 1010101010100A1010080A10081010101818181A18181818181818101810
-% 181217181818181818181010101010101010101218181818181818181818
-% 181818181818FF7D00000000007F7F137F7F1313137F7F00000000000000
-% 00000000000000FFFF000000000000000000000000000000000000000000
-% 00000000000000FFFF53FFFF53FFFF535353FFFF00000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 00000000000000000000000000000000000000000000000000000000007F
-% 7F137F7F137F7F1313137F7F000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000000000000FFFF53FF
-% FF5353FFFF535353FFFF0000000000000000000000000000000000000000
-% 00000000000000000000000000000000000000000000000000000000FFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7F7F13137F7F1313137F7F00
-% 00002100181818161818181818161216101210101010101010101012C5C5
-% 1818181810121010101010100A1010080A100810101018181800FF181216
-% 12181818101010101008100810101012181818181A181818181818101210
-% 10181812181812161216121010100A10101012181818181818181818181A
-% 1818181818FF7D000000000000007F7F7F7F7F7F00000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 0000000000000000FFFFFFFFFFFFFFFFFF00000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 7F7F7F7F7F7F7F7F7F000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000FFFFFF
-% FFFFFF00FFFFFF0000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000007F7F7F007F7F7F00000000
-% 002100181818121018181818181210121018101812121612101010181818
-% 18181818121612181818101010101008100810101012181800FF18161210
-% 181618101210101010080A10101010101818181818181817121012161218
-% 101210101010121018121012101010101012181818181A18181818181818
-% 18181818FF7D000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 210018181010121818171818101810181018181818181818181210121218
-% 161818161210181618101210101010080A10101010101800FF1012101012
-% 181818181012101010101010101218181818181818181812101218121012
-% 10121012101018121612101010101010101818181A181A18181A181A1818
-% 181810FF7D00000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000021
-% 00181012101010181218101218181818181818181A181818181210101012
-% 1810121010121818181810121010101010101012181800FF181012101210
-% 101012101210100A08101010101012101218101810121010101010181818
-% 181010101010101210121810181012121818181A18181818181818181818
-% 1010FF7D0000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000002100
-% 101010101010101010121010101012101818181818181818181818181018
-% 181012101210101012101210100A0810101010101200FF18181810101010
-% 121012161010101010101010101010121012121010101010101018181818
-% 181810181010101012101816121816181818181818181818181818181810
-% 10FF7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D
-% 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D210010
-% 101010101010101012101210121018181718181618181818181818181818
-% 181810101010121012161010101010101010101000FF1818171818181810
-% 101210121010101010101010101010101010101010081010101218181818
-% 181818101010101010181212161818181A16181818181618181818101210
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF001210
-% 101010101210181818101810181018121818181818181818181818181818
-% 1718181818101012101210101010101010101000FF121818181818181012
-% 10181018181612181818121010101210101010100A081010181818181818
-% 181818121010101012101012121818181818161818181818161310101010
-% 101012161818181818181210121012101810181818181818181818121818
-% 18181818101210181018181612181818121010101210101010100A081010
-% 181818181818181818121010101012101012121818181818161818181818
-% 161310101010101012161818181818181210121012101810181818181818
-% 181818121818181818181012101810181816121818181210101012101010
-% 10100A081010181818181818181818121010101012101012121818181818
-% 161818181818161310101010101012161818181818181210121012101810
-% 181818181818181818121818181818181012101810181816121818181210
-% 10101210101010100A081010181818181818181818121010101012101012
-% 121818181818161818181818161310101010101012161818181818181210
-% 121012101810181818181818181818121818181818181012101810181816
-% 12181818121010101210101010100A081010181818181818181818121010
-% 101012101012121818181818161818181818161310101010101012161818
-% 181818181210121012101810181818181818181818121818181818181012
-% 10181018181612181818121010101210101010100A081010181818181818
-% 181818121010101012101012121818181818161818181818161310101010
-% 101012161818181818181210121012101810181818181818181818121818
-% 18181818101210181018181612181818121000FF10121012101212101012
-% 121618181818181818181818101818131610101010101210181818181818
-% 181010101010101010101010121018181818181818181818101210101010
-% 1018181818181A1818181010101010121012101812161818181010121012
-% 101212101012121618181818181818181818101818131610101010101210
-% 181818181818181010101010101010101010121018181818181818181818
-% 1012101010101018181818181A1818181010101010121012101812161818
-% 181010121012101212101012121618181818181818181818101818131610
-% 101010101210181818181818181010101010101010101010121018181818
-% 1818181818181012101010101018181818181A1818181010101010121012
-% 101812161818181010121012101212101012121618181818181818181818
-% 101818131610101010101210181818181818181010101010101010101010
-% 1210181818181818181818181012101010101018181818181A1818181010
-% 101010121012101812161818181010121012101212101012121618181818
-% 181818181818101818131610101010101210181818181818181010101010
-% 101010101010121018181818181818181818101210101010101818181818
-% 1A1818181010101010121012101812161818181010121012101212101012
-% 121618181818181818181818101818131610101010101210181818181818
-% 181010101010101010101010121018181818181818181818101210101010
-% 1018181818181A1818181010101010121012101812161818181010121012
-% 101212101012121618181818181818181800FF1210101210101010181010
-% 121818181818181A181A1818181718181218181810101810181218181012
-% 101210101818101010101010121218181818181818181818101210101010
-% 1818181A1818181818121010101010121010101012101818101210101210
-% 101010181010121818181818181A181A1818181718181218181810101810
-% 181218181012101210101818101010101010121218181818181818181818
-% 1012101010101818181A1818181818121010101010121010101012101818
-% 101210101210101010181010121818181818181A181A1818181718181218
-% 181810101810181218181012101210101818101010101010121218181818
-% 1818181818181012101010101818181A1818181818121010101010121010
-% 101012101818101210101210101010181010121818181818181A181A1818
-% 181718181218181810101810181218181012101210101818101010101010
-% 1212181818181818181818181012101010101818181A1818181818121010
-% 101010121010101012101818101210101210101010181010121818181818
-% 181A181A1818181718181218181810101810181218181012101210101818
-% 1010101010101212181818181818181818181012101010101818181A1818
-% 181818121010101010121010101012101818101210101210101010181010
-% 121818181818181A181A1818181718181218181810101810181218181012
-% 101210101818101010101010121218181818181818181818101210101010
-% 1818181A1818181818121010101010121010101012101818101210101210
-% 101010181010121818181818181A181A00FF181812101012101212101210
-% 1018181618181A1818181818181818171818181612121012101010181810
-% 101212181018181010101210101818181A18181818181816121012121818
-% 181818181A18FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1A18181818181816121012121818
-% 181818181A18181810100B0E10101010100E101010121818181812101012
-% 1012121012101018181618181A181800FF18181818121010181010101012
-% 181810101818181818121012101818181818181810101010101018181012
-% 101010181818181816121612181818181818181818181810181316181818
-% 18181A181AFF1812101010101010100A100A101012161818181818121010
-% 1810101010121818101018181818181210121018FF181818181810101010
-% 101018181012101010181818181816121612181818181818181818181810
-% 181316181818FF181A181A181812101010101010100A100A101012161818
-% 18181812101018101010101218181010181818181812FF12101818181818
-% 181810101010101018181012101010181818181816121612181818181818
-% 1818181818101813FF18181818181A181A181812101010101010100A100A
-% 101012161818181818121010181010101012181810101818FF1818121012
-% 101818181818181810101010101018181012101010181818181816121612
-% 18181818181818181818FF1018131618181818181A181A18181210101010
-% 1010100A100A1010121618181818181210101810101010121818FF101818
-% 181818121012101818181818181810101010101018181012101010181818
-% 181816121612181818181818FF181818181018131618181818181A181A18
-% 1812101010101010100A100A10101216181818181812101018101010FF12
-% 181810101818181818121012101818181818181810101010101018181012
-% 1010101818181818161216121818FF181818181818181810181316181818
-% 18181A181A181812101010101010100A100A101012161818181818121010
-% 181010101012181810101818181800FF1618181818181018181810121010
-% 10181816181818161810101018131618181A181818121010101810181210
-% 18181318181818181818181818181818181818181018101216181818181A
-% 181A1818FF181818181810100A1010101010101012181618181818181018
-% 18181012101010181816181818161810101018FF1618181A181818121010
-% 101810181210181813181818181818181818181818181818181810181012
-% 1618181818FF181A181818181818181810100A1010101010101012181618
-% 181818181018181810121010101818161818181618FF101018131618181A
-% 181818121010101810181210181813181818181818181818181818181818
-% 18181018101216FF1818181A181A181818181818181810100A1010101010
-% 1010121816181818181810181818101210101018181618FF181618101010
-% 18131618181A181818121010101810181210181813181818181818181818
-% 181818181818181810FF101216181818181A181A18181818181818181010
-% 0A101010101010101218161818181818101818181012101010FF18161818
-% 18161810101018131618181A181818121010101810181210181813181818
-% 1818181818181818181818FF18181018101216181818181A181A18181818
-% 1818181810100A1010101010101012181618181818181018181810FF1010
-% 10181816181818161810101018131618181A181818121010101810181210
-% 18181318181818181818181818FF1818181818181018101216181818181A
-% 181A181818181818181810100A1010101010101012181618181818181018
-% 1818101210101018181618181800FF121818181818181818171210101010
-% 121012181018121818181812161812161818181818101810121012161818
-% 1018181818181818181818181818181A1818181818181818181818181818
-% 181818FF1216181812101010121010101010101012121818181818181818
-% 171210101010121012181018121818181812FF1812161818181818101810
-% 1210121618181018181818181818181818181818181A1818181818181818
-% 18181818FF18181818181216181812101010121010101010101012121818
-% 1818181818181712101010101210121810181218FF181812161812161818
-% 1818181018101210121618181018181818181818181818181818181A1818
-% 181818181818FF1818181818181818181216181812101010121010101010
-% 10101212181818181818181817121010101012101218FF18121818181812
-% 161812161818181818101810121012161818101818181818181818181818
-% 1818181A18181818FF181818181818181818181818181216181812101010
-% 121010101010101012121818181818181818171210101010FF1012181018
-% 121818181812161812161818181818101810121012161818101818181818
-% 1818181818181818181AFF18181818181818181818181818181818181216
-% 1818121010101210101010101010121218181818181818181712FF101010
-% 121012181018121818181812161812161818181818101810121012161818
-% 101818181818181818181818FF18181A1818181818181818181818181818
-% 181818181216181812101010121010101010101012121818181818181818
-% 17121010101012101218101800FF10121612181610181818121612101012
-% 101210121618181818181818121018101216181618181810181012101210
-% 18161818181818181A181A18181818181818181818181818181018181818
-% 1818FF101012161818121018101010101010101010121612181610181818
-% 1216121010121012101216181818181818FF121018101216181618181810
-% 18101210121018161818181818181A181A18181818181818181818181818
-% 181018FF1818181812101012161818121018101010101010101010121612
-% 18161018181812161210101210121012161818FF18181818121018101216
-% 18161818181018101210121018161818181818181A181A18181818181818
-% 1818181818FF181018181818181812101012161818121018101010101010
-% 101010121612181610181818121612101012101210FF1618181818181818
-% 12101810121618161818181018101210121018161818181818181A181A18
-% 18181818181818FF18181818181018181818181812101012161818121018
-% 1010101010101010101216121816101818181216121010FF101210121618
-% 181818181818121018101216181618181810181012101210181618181818
-% 18181A181A18181818FF1818181818181818181018181818181812101012
-% 16181812101810101010101010101012161218161018181812FF12101012
-% 101210121618181818181818121018101216181618181810181012101210
-% 18161818181818181A181AFF181818181818181818181818181018181818
-% 181812101012161818121018101010101010101010121612181610181818
-% 121612101012101210121600FF1010121012181218161810121012101010
-% 101010121216181818161810181010121012181818181612101810121012
-% 12101818181818181818181A18181A1E181A181818181818181818181818
-% 18FF10101210181216181810121010121010101010121012181218161810
-% 12101210101010101012121618181816FF10181010121012181818181612
-% 10181012101212101818181818181818181A18181A1E181A181818181818
-% 1818FF181818181810101210181216181810121010121010101010121012
-% 181218161810121012101010101010121216FF1818161810181010121012
-% 18181818161210181012101212101818181818181818181A18181A1E181A
-% 18181818FF18181818181818181810101210181216181810121010121010
-% 1010101210121812181618101210121010101010FF121216181818161810
-% 18101012101218181818161210181012101212101818181818181818181A
-% 18181A1E181AFF1818181818181818181818181810101210181216181810
-% 12101012101010101012101218121816181012101210FF10101010121216
-% 181818161810181010121012181818181612101810121012121018181818
-% 18181818181A1818FF1E181A181818181818181818181818181810101210
-% 181216181810121010121010101010121012181218161810FF1012101010
-% 101010121216181818161810181010121012181818181612101810121012
-% 12101818181818181818FF1A18181A1E181A181818181818181818181818
-% 181810101210181216181810121010121010101010121012181218161810
-% 1210121010101010101200FF101010101012161218101812161210101012
-% 101210101210181218181818181810181810121210121810121010101010
-% 1210121818181818181818181A181A18181818181818181818181A181818
-% FF1010121012101210121810121010101210101010101012161218101812
-% 161210101012101210101210181218FF1818181810181810121210121810
-% 1210101010101210121818181818181818181A181A181818181818181818
-% 18FF1A181818181010121012101210121810121010101210101010101012
-% 1612181018121612101010121012101012FF181218181818181810181810
-% 1212101218101210101010101210121818181818181818181A181A181818
-% 181818FF181818181A181818181010121012101210121810121010101210
-% 10101010101216121810181216121010101210FF10101210181218181818
-% 181810181810121210121810121010101010121012181818181818181818
-% 1A181A1818FF18181818181818181A181818181010121012101210121810
-% 121010101210101010101012161218101812161210FF1012101210101210
-% 181218181818181810181810121210121810121010101010121012181818
-% 1818181818181AFF1A18181818181818181818181A181818181010121012
-% 1012101218101210101012101010101010121612181018FF161210101012
-% 101210101210181218181818181810181810121210121810121010101010
-% 121012181818181818FF18181A181A18181818181818181818181A181818
-% 181010121012101210121810121010101210101010101012161218101812
-% 16121010101210121000FF10101012181818161818181018161810101010
-% 101012101210101218161818181818101210101018161210121010101010
-% 101210121612181818181A18201E1A181A181818181818181818181818FF
-% 181812101010101018101818181812101010101012181818161818181018
-% 161810101010101012101210101218161818181818101210101018161210
-% 121010101010101210121612181818181A18201E1A181A18181818181818
-% FF1818181818181812101010101018101818181812101010101012181818
-% 161818181018161810101010101012101210101218161818181818101210
-% 101018161210121010101010101210121612181818181A18201E1A181A18
-% 1818FF181818181818181818181812101010101018101818181812101010
-% 101012181818161818181018161810101010101012101210101218161818
-% 181818101210101018161210121010101010101210121612181818181A18
-% 201E1A18FF18181818181818181818181818181812101010101018101818
-% 181812101010101012181818161818181018161810101010101012101210
-% 101218161818181818101210101018161210121010101010101210121612
-% 181818181A18FF1E1A181A18181818181818181818181818181812101010
-% 101018101818181812101010101012181818161818181018161810101010
-% 101012101210101218161818181818101210101018161210121010101010
-% 1012101216121818FF181A18201E1A181A18181818181818181818181818
-% 181812101010101018101818181812101010101012181818161818181018
-% 161810101010101000FF1810121018181818121810181818181810121012
-% 101010101012101012121018181018101010101812101010101010101010
-% 10101010101818181818181A181A1818181818161318181818181818FF18
-% 121010101010101012101818181818181810121018181818121810181818
-% 181810121012101010101012101012121018181018101010101812101010
-% 10101010101010101010101818181818181A181A181818181816131818FF
-% 181818181818121010101010101012101818181818181810121018181818
-% 121810181818181810121012101010101012101012121018181018101010
-% 10181210101010101010101010101010101818181818181A181A18181818
-% 18FF13181818181818181818121010101010101012101818181818181810
-% 121018181818121810181818181810121012101010101012101012121018
-% 18101810101010181210101010101010101010101010101818181818181A
-% 181A18FF1818181613181818181818181818121010101010101012101818
-% 181818181810121018181818121810181818181810121012101010101012
-% 101012121018181018101010101812101010101010101010101010101018
-% 1818181818FF181A18181818181613181818181818181818121010101010
-% 101012101818181818181810121018181818121810181818181810121012
-% 101010101012101012121018181018101010101812101010101010101010
-% 10101010101818FF1818181A181A18181818181613181818181818181818
-% 121010101010101012101818181818181810121018181818121810181818
-% 1818101210121000FF1A1818181618181816181818181618181818101010
-% 101012121012101010101218101210121010181016121010101010101010
-% 10101010101818181818181820181A181818121612101818181012FF1216
-% 1010101010121010181818181818181A1818181618181816181818181618
-% 181818101010101012121012101010101218101210121010181016121010
-% 10101010101010101010101818181818181820181A18181812161210FF18
-% 1810121612161010101010121010181818181818181A1818181618181816
-% 181818181618181818101010101012121012101010101218101210121010
-% 18101612101010101010101010101010101818181818181820181A181818
-% FF16121018181810121612161010101010121010181818181818181A1818
-% 181618181816181818181618181818101010101012121012101010101218
-% 101210121010181016121010101010101010101010101018181818181818
-% 2018FF181818121612101818181012161216101010101012101018181818
-% 1818181A1818181618181816181818181618181818101010101012121012
-% 101010101218101210121010181016121010101010101010101010101018
-% 18181818FF1820181A181818121612101818181012161216101010101012
-% 1010181818181818181A1818181618181816181818181618181818101010
-% 101012121012101010101218101210121010181016121010101010101010
-% 101010101018FF181818181820181A181818121612101818181012161216
-% 1010101010121010181818181818181A1818181618181816181818181618
-% 18181810101000FF181818181A1818181810181018181816181216121018
-% 101010121010101010101012101216181812181818181810101010101010
-% 10101010121018181A2021181818181810161210121010121018FF181813
-% 10100A08081010101216181A1818181818181A1818181810181018181816
-% 181216121018101010121010101010101012101216181812181818181810
-% 10101010101010101010121018181A202118181818181016121012FF1012
-% 10181018181310100A08081010101216181A1818181818181A1818181810
-% 181018181816181216121018101010121010101010101012101216181812
-% 18181818181010101010101010101010121018181A2021181818181810FF
-% 12101210101210181018181310100A08081010101216181A181818181818
-% 1A1818181810181018181816181216121018101010121010101010101012
-% 10121618181218181818181010101010101010101010121018181A202118
-% 18FF1818101612101210101210181018181310100A08081010101216181A
-% 1818181818181A1818181810181018181816181216121018101010121010
-% 101010101012101216181812181818181810101010101010101010101210
-% 18181AFF211818181818101612101210101210181018181310100A080810
-% 10101216181A1818181818181A1818181810181018181816181216121018
-% 101010121010101010101012101216181812181818181810101010101010
-% 1010101012FF18181A202118181818181016121012101012101810181813
-% 10100A08081010101216181A1818181818181A1818181810181018181816
-% 181216121000FF1818181818181A18101812121212181818181012101210
-% 101216181818181210121018101812181612181618181818101010101010
-% 1010101012181818201A181818121218121810181012101810FF18161818
-% 10101008101010181818181A181818181818181A18101812121212181818
-% 181012101210101216181818181210121018101812181612181618181818
-% 1010101010101010101012181818201A18181812121812181018FF121018
-% 10121816181810101008101010181818181A181818181818181A18101812
-% 121212181818181012101210101216181818181210121018101812181612
-% 1816181818181010101010101010101012181818201A181818121218FF18
-% 10181012101810121816181810101008101010181818181A181818181818
-% 181A18101812121212181818181012101210101216181818181210121018
-% 1018121816121816181818181010101010101010101012181818201A1818
-% FF121218121810181012101810121816181810101008101010181818181A
-% 181818181818181A18101812121212181818181012101210101216181818
-% 181210121018101812181612181618181818101010101010101010101218
-% 1818FF1A1818181212181218101810121018101218161818101010081010
-% 10181818181A181818181818181A18101812121212181818181012101210
-% 101216181818181210121018101812181612181618181818101010101010
-% 10101010FF181818201A1818181212181218101810121018101218161818
-% 10101008101010181818181A181818181818181A18101812121212181818
-% 1810121000FF1A181A181A18181818121010101010181210101012101216
-% 121818181818181818181812161812101210121216181810101012101010
-% 0E1010101218181818181810101012101818181818101210FF1018181818
-% 1210101010121818181A18181A181A181A18181818121010101010181210
-% 101012101216121818181818181818181812161812101210121216181810
-% 1010121010100E101010121818181818181010101210181818FF18101210
-% 1210181818181210101010121818181A18181A181A181A18181818121010
-% 101010181210101012101216121818181818181818181812161812101210
-% 1212161818101010121010100E1010101218181818181810101012FF1818
-% 1818181012101210181818181210101010121818181A18181A181A181A18
-% 181818121010101010181210101012101216121818181818181818181812
-% 1618121012101212161818101010121010100E10101012181818181818FF
-% 1010121018181818181012101210181818181210101010121818181A1818
-% 1A181A181A18181818121010101010181210101012101216121818181818
-% 1818181818121618121012101212161818101010121010100E1010101218
-% 18FF18181810101012101818181818101210121018181818121010101012
-% 1818181A18181A181A181A18181818121010101010181210101012101216
-% 121818181818181818181812161812101210121216181810101012101010
-% 0E1010FF1218181818181810101012101818181818101210121018181818
-% 1210101010121818181A18181A181A181A18181818121010101010181210
-% 10101200FF18181818181818181810101010101018181012101010121012
-% 161818181818181818181818131612101010101212181012101010101010
-% 101010101216181812101210121012161818181818121010101012181818
-% 18121012101818181A181818181818181818181810101010101018181012
-% 101010121012161818181818181818181818131612101010101212181012
-% 101010101010101010101216181812101210121012161818181818121010
-% 10101218181818121012101818181A181818181818181818181810101010
-% 101018181012101010121012161818181818181818181818131612101010
-% 101212181012101010101010101010101216181812101210121012161818
-% 18181812101010101218181818121012101818181A181818181818181818
-% 181810101010101018181012101010121012161818181818181818181818
-% 131612101010101212181012101010101010101010101216181812101210
-% 12101216181818181812101010101218181818121012101818181A181818
-% 181818181818181810101010101018181012101010121012161818181818
-% 181818181818131612101010101212181012101010101010101010101216
-% 181812101210121012161818181818121010101012181818181210121018
-% 18181A181818181818181818181810101010101018181012101010121012
-% 161818181818181818181818131612101010101212181012101010101010
-% 101010101216181812101210121012161818181818121010101012181818
-% 18121012101818181A181818181818181818181810101010101018181012
-% 101000FF1818181818181818121010101010101818101010101218101012
-% 181818181818181818181816181818121010101012161218101012101010
-% 101010121012101010101010101212181818181818101210101010101216
-% 18121618181818181A181818181818181818121010101010101818101010
-% 101218101012181818181818181818181816181818121010101012161218
-% 101012101010101010121012101010101010101212181818181818101210
-% 10101010121618121618181818181A181818181818181818121010101010
-% 101818101010101218101012181818181818181818181816181818121010
-% 101012161218101012101010101010121012101010101010101212181818
-% 18181810121010101010121618121618181818181A181818181818181818
-% 121010101010101818101010101218101012181818181818181818181816
-% 181818121010101012161218101012101010101010121012101010101010
-% 10121218181818181810121010101010121618121618181818181A181818
-% 181818181818121010101010101818101010101218101012181818181818
-% 181818181816181818121010101012161218101012101010101010121012
-% 101010101010101212181818181818101210101010101216181216181818
-% 18181A181818181818181818121010101010101818101010101218101012
-% 181818181818181818181816181818121010101012161218101012101010
-% 101010121012101010101010101212181818181818101210101010101216
-% 18121618181818181A181818181818181818121010101010101818101010
-% 1000FF181818181818181810121010101010181618181216121010101210
-% 181810121818181818181818181818161210101018121612101010101010
-% 12101012101012101010101010101818181A181812101010100808101012
-% 101812171818181818181818181818181810121010101010181618181216
-% 121010101210181810121818181818181818181818161210101018121612
-% 10101010101012101012101012101010101010101818181A181812101010
-% 100808101012101812171818181818181818181818181810121010101010
-% 181618181216121010101210181810121818181818181818181818161210
-% 10101812161210101010101012101012101012101010101010101818181A
-% 181812101010100808101012101812171818181818181818181818181810
-% 121010101010181618181216121010101210181810121818181818181818
-% 181818161210101018121612101010101010121010121010121010101010
-% 10101818181A181812101010100808101012101812171818181818181818
-% 181818181810121010101010181618181216121010101210181810121818
-% 181818181818181818161210101018121612101010101010121010121010
-% 12101010101010101818181A181812101010100808101012101812171818
-% 181818181818181818181810121010101010181618181216121010101210
-% 181810121818181818181818181818161210101018121612101010101010
-% 12101012101012101010101010101818181A181812101010100808101012
-% 101812171818181818181818181818181810121010101010181618181216
-% 00FF12161818101810181210121010101212181818181812101010121613
-% 101210181618181818181818181818181010101216121012101216181810
-% 181012101216121010101010101818181818181818101010100A10101010
-% 121612181818181812161818101810181210121010101212181818181812
-% 101010121613101210181618181818181818181818181010101216121012
-% 101216181810181012101216121010101010101818181818181818101010
-% 100A10101010121612181818181812161818101810181210121010101212
-% 181818181812101010121613101210181618181818181818181818181010
-% 101216121012101216181810181012101216121010101010101818181818
-% 181818101010100A10101010121612181818181812161818101810181210
-% 121010101212181818181812101010121613101210181618181818181818
-% 181818181010101216121012101216181810181012101216121010101010
-% 101818181818181818101010100A10101010121612181818181812161818
-% 101810181210121010101212181818181812101010121613101210181618
-% 181818181818181818181010101216121012101216181810181012101216
-% 121010101010101818181818181818101010100A10101010121612181818
-% 181812161818101810181210121010101212181818181812101010121613
-% 101210181618181818181818181818181010101216121012101216181810
-% 181012101216121010101010101818181818181818101010100A10101010
-% 121612181818181812161818101810181210121010101212181818181800
-% FF1012101012161210101010121012161818181A18181210181218181818
-% 101218121216181818181218181818181012101810181018101218181818
-% 1812161218121010101010101818181A20181818101210101010100A1012
-% 101818181818121012101012161210101010121012161818181A18181210
-% 181218181818101218121216181818181218181818181012101810181018
-% 1012181818181812161218121010101010101818181A2018181810121010
-% 1010100A1012101818181818121012101012161210101010121012161818
-% 181A18181210181218181818101218121216181818181218181818181012
-% 1018101810181012181818181812161218121010101010101818181A2018
-% 1818101210101010100A1012101818181818121012101012161210101010
-% 121012161818181A18181210181218181818101218121216181818181218
-% 181818181012101810181018101218181818181216121812101010101010
-% 1818181A20181818101210101010100A1012101818181818121012101012
-% 161210101010121012161818181A18181210181218181818101218121216
-% 181818181218181818181012101810181018101218181818181216121812
-% 1010101010101818181A20181818101210101010100A1012101818181818
-% 121012101012161210101010121012161818181A18181210181218181818
-% 101218121216181818181218181818181012101810181018101218181818
-% 1812161218121010101010101818181A20181818101210101010100A1012
-% 101818181818121012101012161210101010121012161818181A181800FF
-% 1818181818101216121612161218181818181A1818181010101010121018
-% 10101010121818181810121010101018181012101812181816181A181818
-% 181816181818181810101010101216181818181810121010101010101010
-% 1010121018181818181818101216121612161218181818181A1818181010
-% 101010121018101010101218181818101210101010181810121018121818
-% 16181A181818181816181818181810101010101216181818181810121010
-% 101010101010101012101818181818181810121612161216121818181818
-% 1A1818181010101010121018101010101218181818101210101010181810
-% 12101812181816181A181818181816181818181810101010101216181818
-% 181810121010101010101010101012101818181818181810121612161216
-% 1218181818181A1818181010101010121018101010101218181818101210
-% 10101018181012101812181816181A181818181816181818181810101010
-% 101216181818181810121010101010101010101012101818181818181810
-% 1216121612161218181818181A1818181010101010121018101010101218
-% 18181810121010101018181012101812181816181A181818181816181818
-% 181810101010101216181818181810121010101010101010101012101818
-% 1818181818101216121612161218181818181A1818181010101010121018
-% 10101010121818181810121010101018181012101812181816181A181818
-% 181816181818181810101010101216181818181810121010101010101010
-% 1010121018181818181818101216121612161218181818181A181800FF1A
-% 181818101210181012101216181818181818181818181010101010101010
-% 1010101012161818181010121012181810101216121618181818181A1818
-% 181818181818161818181010101218101810181210101010121010101012
-% 10121618181A181818101210181012101216181818181818181818181010
-% 101010101010101010101216181818101012101218181010121612161818
-% 1818181A1818181818181818161818181010101218101810181210101010
-% 12101010101210121618181A181818101210181012101216181818181818
-% 181818181010101010101010101010101216181818101012101218181010
-% 1216121618181818181A1818181818181818161818181010101218101810
-% 18121010101012101010101210121618181A181818101210181012101216
-% 181818181818181818181010101010101010101010101216181818101012
-% 1012181810101216121618181818181A1818181818181818161818181010
-% 10121810181018121010101012101010101210121618181A181818101210
-% 181012101216181818181818181818181010101010101010101010101216
-% 1818181010121012181810101216121618181818181A1818181818181818
-% 16181818101010121810181018121010101012101010101210121618181A
-% 181818101210181012101216181818181818181818181010101010101010
-% 1010101012161818181010121012181810101216121618181818181A1818
-% 181818181818161818181010101218101810181210101010121010101012
-% 10121618181A181818101210181012101216181818181818181800FF1818
-% 181818111813161216121818181818181A18181818101010101010100A10
-% 101010101218181818181012161218101210181318181818181818181818
-% 181012161318181818121010121010121018101012101216181618121618
-% 181818181818181818111813161216121818181818181A18181818101010
-% 101010100A10101010101218181818181012161218101210181318181818
-% 181818181818181012161318181818121010121010121018101012101216
-% 181618121618181818181818181818111813161216121818181818181A18
-% 181818101010101010100A10101010101218181818181012161218101210
-% 181318181818181818181818181012161318181818121010121010121018
-% 101012101216181618121618181818181818181818111813161216121818
-% 181818181A18181818101010101010100A10101010101218181818181012
-% 161218101210181318181818181818181818181012161318181818121010
-% 121010121018101012101216181618121618181818181818181818111813
-% 161216121818181818181A18181818101010101010100A10101010101218
-% 181818181012161218101210181318181818181818181818181012161318
-% 181818121010121010121018101012101216181618121618181818181818
-% 181818111813161216121818181818181A18181818101010101010100A10
-% 101010101218181818181012161218101210181318181818181818181818
-% 181012161318181818121010121010121018101012101216181618121618
-% 181818181818181818111813161216121818181818181A181800FF1A1818
-% 1818181618181210121618181A181A181818181810101010101010101010
-% 081010101818181818181018161216121810181018101818181818181810
-% 101012181818181818181010101012101210121012161818181818181818
-% 1818181A18181818181618181210121618181A181A181818181810101010
-% 101010101010081010101818181818181018161216121810181018101818
-% 181818181810101012181818181818181010101012101210121012161818
-% 1818181818181818181A18181818181618181210121618181A181A181818
-% 181810101010101010101010081010101818181818181018161216121810
-% 181018101818181818181810101012181818181818181010101012101210
-% 1210121618181818181818181818181A1818181818161818121012161818
-% 1A181A181818181810101010101010101010081010101818181818181018
-% 161216121810181018101818181818181810101012181818181818181010
-% 1010121012101210121618181818181818181818181A1818181818161818
-% 1210121618181A181A181818181810101010101010101010081010101818
-% 181818181018161216121810181018101818181818181810101012181818
-% 1818181810101010121012101210121618181818181818181818181A1818
-% 1818181618181210121618181A181A181818181810101010101010101010
-% 081010101818181818181018161216121810181018101818181818181810
-% 101012181818181818181010101012101210121012161818181818181818
-% 1818181A18181818181618181210121618181A181A18181800FF18181818
-% 18181818171216181818181818181A181818181118121012101010101010
-% 080E10101818181818181210121018101810121812101818181817181218
-% 181816181818181818181810FFFFFFFF1810121018181818181818181818
-% 18181818181818181818171216181818181818181A181818181118121012
-% 101010101010080E10101818181818181210121018101810121812101818
-% 1818171812FFFFFFFF1818181818FFFF18101210FFFFFFFFFFFF18181818
-% 18181818181818181818181818181818171216181818181818181A181818
-% 181118121012101010101010080E10101818181818181210121018101810
-% 12181210181818FFFFFFFF1818181618FFFF1818181818FFFFFFFFFF1810
-% 121018181818181818181818181818181818181818181712161818181818
-% 18181A181818181118121012101010101010080E10101818181818181210
-% 121018101810121812FFFFFFFF1817181218FFFF1618181818FFFFFFFF10
-% 121018101810121018181818181818181818181818181818181818181712
-% 16181818181818181A181818181118121012101010101010080E10101818
-% 1818181812101210181018FFFFFFFF1018181818FFFF1218181816FFFFFF
-% FF1818181810121018101810121018181818181818181818181818181818
-% 18181818171216181818181818181A181818181118121012101010101010
-% 080E101018181818181812101210181018101218FFFFFFFFFFFF17181218
-% 181816181818181818181810121018101810121018181818181818181818
-% 18181818181818181818171216181818181818181A181800FF1818181818
-% 1A1818181812181818181818181818181618181612161810121012101010
-% 101010101218161818181018181316131810121010121612181812161818
-% 18181810181218181818FFFF1818FFFF1012101212181818181818181818
-% 1818181818181A1818181812181818181818181818181618181612161810
-% 121012101010101010101218161818181018181316131810121010121612
-% 181812FFFF1818FFFF10181218FFFF1817181818FFFF1012101212181818
-% 1818181818181818181818181A1818181812181818181818181818181618
-% 181612161810121012101010101010101218161818181018181316131810
-% 1210101216FFFF1812FFFF18181818FFFF12181818181718FFFF12101012
-% 1012121818181818181818181818181818181A1818181812181818181818
-% 181818181618181612161810121012101010101010101218161818181018
-% 18131613181012FFFF1216FFFF18121618FFFF18181018FFFF1818FFFF18
-% 1818121010121012121818181818181818181818181818181A1818181812
-% 181818181818181818181618181612161810121012101010101010101218
-% 161818181018181316FFFF1012FFFF12161218FFFF16181818FFFF1018FF
-% FF1818181718181812101012101212181818181818181818181818181818
-% 1A1818181812181818181818181818181618181612161810121012101010
-% 101010101218161818181018181316131810121010FFFF12181812161818
-% 181818101812181818181718181812101012101212181818181818181818
-% 1818181818181A18181818121818181818181818181800FF18181A181818
-% 181818181718181818121818181818121210121012101216121012101210
-% 101010101012181613101216181812161210121010121618181018181818
-% 181816121618181818FFFF1612FFFF10101010121018181818181A181818
-% 18181A181818181818181718181818121818181818121210121012101216
-% 121012101210101010101012181613101216181812161210121010121618
-% 1810FFFF1818FFFF161216181818181818161216FFFF1010101210181818
-% 18181A18181818181A181818181818181718181818121818181818121210
-% 121012101216121012101210101010101012181613101216181812161210
-% 12101012FFFF1810FFFF18181818161216181818FFFFFFFFFFFF12101010
-% 10121018181818181A18181818181A181818181818181718181818121818
-% 181818121210121012101216121012101210101010101012181613101216
-% 181812161210FFFF1012FFFF18101818181818181612FFFF1818FFFF1816
-% 12161210101010121018181818181A18181818181A181818181818181718
-% 181818121818181818121210121012101216121012101210101010101012
-% 1816131012161818FFFF1210FFFF10121618181018181818FFFF1612FFFF
-% 18181818181612161210101010121018181818181A18181818181A181818
-% 181818181718181818121818181818121210121012101216121012101210
-% 1010101010121816131012161818121612101210FFFF1618181018181818
-% 18181612161818181818181612161210101010121018181818181A181818
-% 18181A18181818181818171818181812181818181800FF1818181818181A
-% 181818181818181818161818161810101010101010121012181612101010
-% 100A10101210181810121818181018101010101010121810181018181618
-% 1818181810181818FFFF1210FFFF121010101010181612181818181A1818
-% 18181818181A181818181818181818161818161810101010101010121012
-% 181612101010100A10101210181810121818181018101010101010121810
-% 18FFFF1816FFFF18181810181818181612101810FFFF1010101018161218
-% 1818181A181818181818181A181818181818181818161818161810101010
-% 101010121012181612101010100A10101210181810121818181018101010
-% 101010FFFF1018FFFF18161818181818101818FF1816FFFF181012101010
-% 1010181612181818181A181818181818181A181818181818181818161818
-% 161810101010101010121012181612101010100A10101210181810121818
-% 1810181010FFFF1010FFFF10181018181618181818FFFF1818FFFF161210
-% 1810121010101010181612181818181A181818181818181A181818181818
-% 181818161818161810101010101010121012181612101010100A10101210
-% 18181012181818FFFF1010FFFF10101218101810181816FFFF1818FFFF18
-% 1818181612101810121010101010181612181818181A181818181818181A
-% 181818181818181818161818161810101010101010121012181612101010
-% 100A1010121018181012181818101810101010FFFF121810181018181618
-% 1818181810181818181612101810121010101010181612181818181A1818
-% 18181818181A181818181818181818161818161800FF181818181A181818
-% 181818181818181818181818181818101012101010101018121810181010
-% 101012161818181818161817181818181810101010101218181012121818
-% 18181210121012FFFF1012FFFF1210101010101010101012161818101818
-% 18181A181818181818181818181818181818181818101012101010101018
-% 121810181010101012161818181818161817181818181810101010101218
-% FFFF1212FFFF1818121012101210121012181612FFFF1010101010101012
-% 16181810181818181A181818181818181818181818181818181818101012
-% 101010101018121810181010101012161818181818161817181818181810
-% 1010FFFF1218FFFF1212181818181210121012FF12FFFF18161210101010
-% 10101010101216181810181818181A181818181818181818181818181818
-% 181818101012101010101018121810181010101012161818181818161817
-% 18181818FFFF1010FFFF12181810121218181818FFFFFFFFFF1012101218
-% 16121010101010101010101216181810181818181A181818181818181818
-% 181818181818181818101012101010101018121810181010101012161818
-% 181818161817FFFF1818FFFF1010101012181810121218FFFFFFFF101210
-% 12101210121816121010101010101010101216181810181818181A181818
-% 181818181818181818181818181818101012101010101018121810181010
-% 101012161818181818161817181818181810FFFF10101218181012121818
-% 181812101210121012101218161210101010101010101012161818101818
-% 18181A1818181818181818181818181818181800FF1818181A1E181A1818
-% 181612101218181818181818101810121010101010101218171818101210
-% 101018181818181818181818171818161012101210121010101010101010
-% 121612161216FFFF1018FFFF101010101010101010101012181018181818
-% 1A1E181A1818181612101218181818181818101810121010101010101218
-% 1718181012101010181818181818181818181718181610121012101210FF
-% FF1010FFFF10121612161216121810FFFF1210FFFF101010101010101012
-% 1810181818181A1E181A1818181612101218181818181818101810121010
-% 101010101218171818101210101018181818181818181818171818161012
-% 10FFFF1210FFFF101010101012161216121612FFFFFF1012101010101010
-% 1010101010121810181818181A1E181A1818181612101218181818181818
-% 101810121010101010101218171818101210101018181818181818181818
-% 171818FFFF1210FFFF12101010101010101012FFFF161216121810181012
-% 1010101010101010101010121810181818181A1E181A1818181612101218
-% 181818181818101810121010101010101218171818101210101018181818
-% 1818181818FFFF1818FFFF12101210121010101010FFFF1012FFFF161216
-% 1218101810121010101010101010101010121810181818181A1E181A1818
-% 181612101218181818181818101810121010101010101218171818101210
-% 1010181818181818181818181718181610FFFF1210121010101010101010
-% 121612161216121810181012101010101010101010101012181018181818
-% 1A1E181A181818161210121818181818181800FF1818181A181A18181812
-% 101210101012161218101818181010101010101010121612181818181812
-% 181818181818181818181818181818181816121010121012101010101010
-% 1210121012FFFF1012FFFF10101210100810100F1010101012181818181A
-% 181A18181812101210101012161218101818181010101010101010121612
-% 18181818181218181818181818181818181818181818181612101012FFFF
-% 1010FFFF10101210121012101010FFFF1210FFFF10100810100F10101010
-% 12181818181A181A18181812101210101012161218101818181010101010
-% 101010121612181818181812181818181818181818181818181818181816
-% FFFF1012FFFF101010101010121012101210FFFFFF101210101210100810
-% 100F1010101012181818181A181A18181812101210101012161218101818
-% 181010101010101010121612181818181812181818181818181818181818
-% 1818FFFF1816FFFF1012101210101010101012FFFF101210101012101210
-% 101210100810100F1010101012181818181A181A18181812101210101012
-% 161218101818181010101010101010121612181818181812181818181818
-% 18181818FFFF1818FFFF18161210101210121010FFFF1010FFFF12101210
-% 101012101210101210100810100F1010101012181818181A181A18181812
-% 101210101012161218101818181010101010101010121612181818181812
-% 1818181818181818181818181818FFFFFFFF121010121012101010101010
-% 121012101210101012101210101210100810100F1010101012181818181A
-% 181A18181812101210101012161218101800FF1818181A18181A18181810
-% 101010121012101212161218101010100A10101010121818181818181818
-% 18181A181818181818161812181818181818101210101810101010101010
-% 1216131810FFFFFFFF1818181010100A100B101010101010181818181A18
-% 181A18181810101010121012101212161218101010100A10101010121818
-% 18181818181818181A18181818181816181218181818181810121010FFFF
-% FFFF101010101216131810181218FFFFFFFF1010100A100B101010101010
-% 181818181A18181A18181810101010121012101212161218101010100A10
-% 10101012181818181818181818181A181818181818161812181818181818
-% FFFFFFFF1810101010101010121613181018FFFF161818181010100A100B
-% 101010101010181818181A18181A18181810101010121012101212161218
-% 101010100A1010101012181818181818181818181A181818181818161812
-% 1818FFFFFFFF10121010181010101010101012FFFFFFFF18121816181818
-% 1010100A100B101010101010181818181A18181A18181810101010121012
-% 101212161218101010100A1010101012181818181818181818181A181818
-% 18181816FFFFFFFF181818181012101018101010FFFFFFFF121613181018
-% 1218161818181010100A100B101010101010181818181A18181A18181810
-% 101010121012101212161218101010100A10101010121818181818181818
-% 18181A181818181818161812181818FFFF18101210101810101010101010
-% 1216131810181218161818181010100A100B101010101010181818181A18
-% 181A181818101010101210121012121600FF1818181A181A181818181210
-% 12101012101010101210121818101010100810121618181A181A18181818
-% 1A1818181818181012121816181212181018161010181818181810101012
-% 161216101316101818181818181010100E101010101010181818181A181A
-% 18181818121012101012101010101210121818101010100810121618181A
-% 181A181818181A1818181818181012121816181212181018161010181818
-% 181810101012161216101316101818181818181010100E10101010101018
-% 1818181A181A181818181210121010121010101012101218181010101008
-% 10121618181A181A181818181A1818181818181012121816181212181018
-% 161010181818181810101012161216101316101818181818181010100E10
-% 1010101010181818181A181A181818181210121010121010101012101218
-% 18101010100810121618181A181A181818181A1818181818181012121816
-% 181212181018161010181818181810101012161216101316101818181818
-% 181010100E101010101010181818181A181A181818181210121010121010
-% 10101210121818101010100810121618181A181A181818181A1818181818
-% 181012121816181212181018161010181818181810101012161216101316
-% 101818181818181010100E101010101010181818181A181A181818181210
-% 12101012101010101210121818101010100810121618181A181A18181818
-% 1A1818181818181012121816181212181018161010181818181810101012
-% 161216101316101818181818181010100E101010101010181818181A181A
-% 18181818121012101012101010101200FF10181818181818181818161216
-% 1218101810181012101018181610101010081012161818181818181A1818
-% 1818181818101210101012181010101210121818181818181A1818121818
-% 121818181218181818181818161210101010101010101210181818181818
-% 181818161216121810181018101210101818161010101008101216181818
-% 1818181A1818181818181810121010101218101010121012181818181818
-% 1A1818121818121818181218181818181818161210101010101010101210
-% 181818181818181818161216121810181018101210101818161010101008
-% 1012161818181818181A1818181818181810121010101218101010121012
-% 1818181818181A1818121818121818181218181818181818161210101010
-% 101010101210181818181818181818161216121810181018101210101818
-% 1610101010081012161818181818181A1818181818181810121010101218
-% 1010101210121818181818181A1818121818121818181218181818181818
-% 161210101010101010101210181818181818181818161216121810181018
-% 1012101018181610101010081012161818181818181A1818181818181810
-% 1210101012181010101210121818181818181A1818121818121818181218
-% 181818181818161210101010101010101210181818181818181818161216
-% 1218101810181012101018181610101010081012161818181818181A1818
-% 1818181818101210101012181010101210121818181818181A1818121818
-% 121818181218181818181818161210101010101010101210181818181818
-% 181818161216121810181018101200FF1012161818181818101210121018
-% 181818181312101010101212181810121012101818181818181818181A18
-% 181818101210101010121610101210121012101818181818181818101816
-% 181018181612101010121818181010101010101010101012161818181818
-% 101210121018181818181312101010101212181810121012101818181818
-% 181818181A18181818101210101010121610101210121012101818181818
-% 181818101816181018181612101010121818181010101010101010101012
-% 161818181818101210121018181818181312101010101212181810121012
-% 101818181818181818181A18181818101210101010121610101210121012
-% 101818181818181818101816181018181612101010121818181010101010
-% 101010101012161818181818101210121018181818181312101010101212
-% 181810121012101818181818181818181A18181818101210101010121610
-% 101210121012101818181818181818101816181018181612101010121818
-% 181010101010101010101012161818181818101210121018181818181312
-% 101010101212181810121012101818181818181818181A18181818101210
-% 101010121610101210121012101818181818181818101816181018181612
-% 101010121818181010101010101010101012161818181818101210121018
-% 181818181312101010101212181810121012101818181818181818181A18
-% 181818101210101010121610101210121012101818181818181818101816
-% 181018181612101010121818181010101010101010101012161818181818
-% 1012101210181818181813121000FF101218161818101010101010101818
-% 181818181010101010101618181816101018181818181818181818181818
-% 181012101010101010121010101210101210181812161218181A18181218
-% 181810181010101010101218101010121010101010101218161818101010
-% 101010101818181818181010101010101618181816101018181818181818
-% 181818181818181012101010101010121010101210101210181812161218
-% 181A18181218181810181010101010101218101010121010101010101218
-% 161818101010101010101818181818181010101010101618181816101018
-% 181818181818181818181818181012101010101010121010101210101210
-% 181812161218181A18181218181810181010101010101218101010121010
-% 101010101218161818101010101010101818181818181010101010101618
-% 181816101018181818181818181818181818181012101010101010121010
-% 101210101210181812161218181A18181218181810181010101010101218
-% 101010121010101010101218161818101010101010101818181818181010
-% 101010101618181816101018181818181818181818181818181012101010
-% 101010121010101210101210181812161218181A18181218181810181010
-% 101010101218101010121010101010101218161818101010101010101818
-% 181818181010101010101618181816101018181818181818181818181818
-% 181012101010101010121010101210101210181812161218181A18181218
-% 181810181010101010101218101010121010101010101218161818101010
-% 10101010181818181818101000FF10101012101012101010101012181818
-% 181818181010080A10101012181818181818181818181218181818171812
-% 181010101010101012181810101012161818161816181618171A18181810
-% 121818181812101010101018121610101210101010101012101012101010
-% 101012181818181818181010080A10101012181818181818181818181218
-% 181818171812181010101010101012181810101012161818161816181618
-% 171A18181810121818181812101010101018121610101210101010101012
-% 101012101010101012181818181818181010080A10101012181818181818
-% 181818181218181818171812181010101010101012181810101012161818
-% 161816181618171A18181810121818181812101010101018121610101210
-% 101010101012101012101010101012181818181818181010080A10101012
-% 181818181818181818181218181818171812181010101010101012181810
-% 101012161818161816181618171A18181810121818181812101010101018
-% 121610101210101010101012101012101010101012181818181818181010
-% 080A10101012181818181818181818181218181818171812181010101010
-% 101012181810101012161818161816181618171A18181810121818181812
-% 101010101018121610101210101010101012101012101010101012181818
-% 181818181010080A10101012181818181818181818181218181818171812
-% 181010101010101012181810101012161818161816181618171A18181810
-% 121818181812101010101018121610101210101010101012101012101010
-% 101012181818181818181000FF1210121018101810101010101012161818
-% 181A18181010101010101010101018181818181818161818181818101810
-% 121010101010121818181816121012101818181818181818181818181816
-% 181818181710101210121612101210101818101210121018101810101010
-% 101012161818181A18181010101010101010101018181818181818161818
-% 181818101810121010101010121818181816121012101818181818181818
-% 181818181816181818181710101210121612101210101818101210121018
-% 101810101010101012161818181A18181010101010101010101018181818
-% 181818161818181818101810121010101010121818181816121012101818
-% 181818181818181818181816181818181710101210121612101210101818
-% 101210121018101810101010101012161818181A18181010101010101010
-% 101018181818181818161818181818101810121010101010121818181816
-% 121012101818181818181818181818181816181818181710101210121612
-% 101210101818101210121018101810101010101012161818181A18181010
-% 101010101010101018181818181818161818181818101810121010101010
-% 121818181816121012101818181818181818181818181816181818181710
-% 101210121612101210101818101210121018101810101010101012161818
-% 181A18181010101010101010101018181818181818161818181818101810
-% 121010101010121818181816121012101818181818181818181818181816
-% 181818181710101210121612101210101818101210121018101810101010
-% 101012161818181A181800FF181818181818181810121210121012181818
-% 181818181010101010101010101012161818181818181718121612101210
-% 101210121818181818181818101210181818181818181818181818181811
-% 181218181818161210181018101818181818181818181818181810121210
-% 121012181818181818181010101010101010101012161818181818181718
-% 121612101210101210121818181818181818101210181818181818181818
-% 181818181811181218181818161210181018101818181818181818181818
-% 181810121210121012181818181818181010101010101010101012161818
-% 181818181718121612101210101210121818181818181818101210181818
-% 181818181818181818181811181218181818161210181018101818181818
-% 181818181818181810121210121012181818181818181010101010101010
-% 101012161818181818181718121612101210101210121818181818181818
-% 101210181818181818181818181818181811181218181818161210181018
-% 101818181818181818181818181810121210121012181818181818181010
-% 101010101010101012161818181818181718121612101210101210121818
-% 181818181818101210181818181818181818181818181811181218181818
-% 161210181018101818181818181818181818181810121210121012181818
-% 181818181010101010101010101012161818181818181718121612101210
-% 101210121818181818181818101210181818181818181818181818181811
-% 181218181818161210181018101818181818181818181818181810121210
-% 12101218181818181800FF1A181818181818181818101010101012181818
-% 181818101810121010101010101210181218181818181612181012101010
-% 10101018181818181A181810101012101216121612101210181818181810
-% 1012101818181012101210121818181A181A181818181818181818101010
-% 101012181818181818101810121010101010101210181218181818181612
-% 18101210101010101018181818181A181810101012101216121612101210
-% 1818181818101012101818181012101210121818181A181A181818181818
-% 181818101010101012181818181818101810121010101010101210181218
-% 18181818161218101210101010101018181818181A181810101012101216
-% 1216121012101818181818101012101818181012101210121818181A181A
-% 181818181818181818101010101012181818181818101810121010101010
-% 10121018121818181818161218101210101010101018181818181A181810
-% 101012101216121612101210181818181810101210181818101210121012
-% 1818181A181A181818181818181818101010101012181818181818101810
-% 121010101010101210181218181818181612181012101010101010181818
-% 18181A181810101012101216121612101210181818181810101210181818
-% 1012101210121818181A181A181818181818181818101010101012181818
-% 181818101810121010101010101210181218181818181612181012101010
-% 10101018181818181A181810101012101216121612101210181818181810
-% 1012101818181012101210121818181A181A181818181818181818101010
-% 101012181818181800FF1818181818181818181818121010101210121018
-% 101812101216181018121610101210181718181818181810181012101010
-% 121818181A18181818181810101010101010101010101012161818101210
-% 101018121210101810121018181818181818181818181818181818121010
-% 101210121018101812101216181018121610101210181718181818181810
-% 181012101010121818181A18181818181810101010101010101010101012
-% 161818101210101018121210101810121018181818181818181818181818
-% 181818121010101210121018101812101216181018121610101210181718
-% 181818181810181012101010121818181A18181818181810101010101010
-% 101010101012161818101210101018121210101810121018181818181818
-% 181818181818181818121010101210121018101812101216181018121610
-% 101210181718181818181810181012101010121818181A18181818181810
-% 101010101010101010101012161818101210101018121210101810121018
-% 181818181818181818181818181818121010101210121018101812101216
-% 181018121610101210181718181818181810181012101010121818181A18
-% 181818181810101010101010101010101012161818101210101018121210
-% 101810121018181818181818181818181818181818121010101210121018
-% 101812101216181018121610101210181718181818181810181012101010
-% 121818181A18181818181810101010101010101010101012161818101210
-% 101018121210101810121018181818181818181818181818181818121010
-% 1012101210181000FF1A1818181818181818181818181210101010101012
-% 1010181012181818181A1810121018181818181818181818171810121012
-% 16181818181A181818121010101010101010101010101012181618181012
-% 1012101010101210181018161818181A1818181818181818181818181210
-% 1010101010121010181012181818181A1810121018181818181818181818
-% 17181012101216181818181A181818121010101010101010101010101012
-% 1816181810121012101010101210181018161818181A1818181818181818
-% 1818181812101010101010121010181012181818181A1810121018181818
-% 18181818181817181012101216181818181A181818121010101010101010
-% 1010101010121816181810121012101010101210181018161818181A1818
-% 1818181818181818181812101010101010121010181012181818181A1810
-% 12101818181818181818181817181012101216181818181A181818121010
-% 101010101010101010101012181618181012101210101010121018101816
-% 1818181A1818181818181818181818181210101010101012101018101218
-% 1818181A181012101818181818181818181817181012101216181818181A
-% 181818121010101010101010101010101012181618181012101210101010
-% 1210181018161818181A1818181818181818181818181210101010101012
-% 1010181012181818181A1810121018181818181818181818171810121012
-% 16181818181A181818121010101010101010101010101012181618181012
-% 1012101010101210181018161818181A1818181818181818181818181210
-% 10101010101200FF18181818181012101817181818181810121010121010
-% 121012161818181818181818101818181818181818181818181818161818
-% 18181A181818181618181810101010101010101010101010121818181818
-% 181612161216121012101218181818181818181012101817181818181810
-% 121010121010121012161818181818181818101818181818181818181818
-% 18181816181818181A181818181618181810101010101010101010101010
-% 121818181818181612161216121012101218181818181818181012101817
-% 181818181810121010121010121012161818181818181818101818181818
-% 18181818181818181816181818181A181818181618181810101010101010
-% 101010101010121818181818181612161216121012101218181818181818
-% 181012101817181818181810121010121010121012161818181818181818
-% 10181818181818181818181818181816181818181A181818181618181810
-% 101010101010101010101010121818181818181612161216121012101218
-% 181818181818181012101817181818181810121010121010121012161818
-% 18181818181810181818181818181818181818181816181818181A181818
-% 181618181810101010101010101010101010121818181818181612161216
-% 121012101218181818181818181012101817181818181810121010121010
-% 121012161818181818181818101818181818181818181818181818161818
-% 18181A181818181618181810101010101010101010101010121818181818
-% 181612161216121012101218181818181818181012101817181818181810
-% 121010121000FF1818111210101010121818181818181818181210101210
-% 101210121810121618181818181818181A18181818181818181818181818
-% 18181A181818181818181012101210101210101010101018181820191818
-% 181818181818101010121012181818111210101010121818181818181818
-% 181210101210101210121810121618181818181818181A18181818181818
-% 18181818181818181A181818181818181012101210101210101010101018
-% 181820191818181818181818101010121012181818111210101010121818
-% 181818181818181210101210101210121810121618181818181818181A18
-% 18181818181818181818181818181A181818181818181012101210101210
-% 101010101018181820191818181818181818101010121012181818111210
-% 101010121818181818181818181210101210101210121810121618181818
-% 181818181A1818181818181818181818181818181A181818181818181012
-% 101210101210101010101018181820191818181818181818101010121012
-% 181818111210101010121818181818181818181210101210101210121810
-% 121618181818181818181A1818181818181818181818181818181A181818
-% 181818181012101210101210101010101018181820191818181818181818
-% 101010121012181818111210101010121818181818181818181210101210
-% 101210121810121618181818181818181A18181818181818181818181818
-% 18181A181818181818181012101210101210101010101018181820191818
-% 181818181818101010121012181818111210101010121818181818181818
-% 1812101000FF181818161812181612101212181818181018101813181818
-% 181612161818181818181818181A181818181A1818181812101316181818
-% 181818181812101210121012161818181010101010101018181818181818
-% 181810181818181012101018181818161812181612101212181818181018
-% 101813181818181612161818181818181818181A181818181A1818181812
-% 101316181818181818181812101210121012161818181010101010101018
-% 181818181818181810181818181012101018181818161812181612101212
-% 181818181018101813181818181612161818181818181818181A18181818
-% 1A1818181812101316181818181818181812101210121012161818181010
-% 101010101018181818181818181810181818181012101018181818161812
-% 181612101212181818181018101813181818181612161818181818181818
-% 181A181818181A1818181812101316181818181818181812101210121012
-% 161818181010101010101018181818181818181810181818181012101018
-% 181818161812181612101212181818181018101813181818181612161818
-% 181818181818181A181818181A1818181812101316181818181818181812
-% 101210121012161818181010101010101018181818181818181810181818
-% 181012101018181818161812181612101212181818181018101813181818
-% 181612161818181818181818181A181818181A1818181812101316181818
-% 181818181812101210121012161818181010101010101018181818181818
-% 181810181818181012101018181818161812181612101212181818181018
-% 10181300FF10181018101818181818101618181818181818181816181212
-% 101210121818181818181818181818181818181A18181618181818181818
-% 181818181610101210101210181018121012101010121012101217181818
-% 101818181810121010101810181018101818181818101618181818181818
-% 181816181212101210121818181818181818181818181818181A18181618
-% 181818181818181818181610101210101210181018121012101010121012
-% 101217181818101818181810121010101810181018101818181818101618
-% 181818181818181816181212101210121818181818181818181818181818
-% 181A18181618181818181818181818181610101210101210181018121012
-% 101010121012101217181818101818181810121010101810181018101818
-% 181818101618181818181818181816181212101210121818181818181818
-% 181818181818181A18181618181818181818181818181610101210101210
-% 181018121012101010121012101217181818101818181810121010101810
-% 181018101818181818101618181818181818181816181212101210121818
-% 181818181818181818181818181A18181618181818181818181818181610
-% 101210101210181018121012101010121012101217181818101818181810
-% 121010101810181018101818181818101618181818181818181816181212
-% 101210121818181818181818181818181818181A18181618181818181818
-% 181818181610101210101210181018121012101010121012101217181818
-% 101818181810121010101810181018101818181818101618181818181818
-% 181800FF1012121212101018181818181210121018121612161210101010
-% 101010101018181818181818181818181A18181818181818181818181818
-% 181818181813101012101210121810101010101010101012181812181618
-% 101210121010101010121012121212101018181818181210121018121612
-% 161210101010101010101018181818181818181818181A18181818181818
-% 181818181818181818181813101012101210121810101010101010101012
-% 181812181618101210121010101010121012121212101018181818181210
-% 121018121612161210101010101010101018181818181818181818181A18
-% 181818181818181818181818181818181813101012101210121810101010
-% 101010101012181812181618101210121010101010121012121212101018
-% 181818181210121018121612161210101010101010101018181818181818
-% 181818181A18181818181818181818181818181818181813101012101210
-% 121810101010101010101012181812181618101210121010101010121012
-% 121212101018181818181210121018121612161210101010101010101018
-% 181818181818181818181A18181818181818181818181818181818181813
-% 101012101210121810101010101010101012181812181618101210121010
-% 101010121012121212101018181818181210121018121612161210101010
-% 101010101018181818181818181818181A18181818181818181818181818
-% 181818181813101012101210121810101010101010101012181812181618
-% 101210121010101010121012121212101018181818181210121018121612
-% 1600FF121010101010121810181818161010121010101210121612101010
-% 10101010101210161818181818181A1820181A1818181818181818181818
-% 181818181618101010101012101812121012101012101012101817121210
-% 181618101210101010121010101010121810181818161010121010101210
-% 12161210101010101010101210161818181818181A1820181A1818181818
-% 181818181818181818181618101010101012101812121012101012101012
-% 101817121210181618101210101010121010101010121810181818161010
-% 12101010121012161210101010101010101210161818181818181A182018
-% 1A1818181818181818181818181818181618101010101012101812121012
-% 101012101012101817121210181618101210101010121010101010121810
-% 181818161010121010101210121612101010101010101012101618181818
-% 18181A1820181A1818181818181818181818181818181618101010101012
-% 101812121012101012101012101817121210181618101210101010121010
-% 101010121810181818161010121010101210121612101010101010101012
-% 10161818181818181A1820181A1818181818181818181818181818181618
-% 101010101012101812121012101012101012101817121210181618101210
-% 101010121010101010121810181818161010121010101210121612101010
-% 10101010101210161818181818181A1820181A1818181818181818181818
-% 181818181618101010101012101812121012101012101012101817121210
-% 181618101210101010121010101010121810181818161010121010101210
-% 00FF10101012101210101218181810121012161218121612101010101008
-% 100E1010101012121618181818181A181818181818181818181818181818
-% 181818181810101010101012101817181612101010121618181818101618
-% 181816181618181010101012101210101218181810121012161218121612
-% 101010101008100E1010101012121618181818181A181818181818181818
-% 181818181818181818181810101010101012101817181612101010121618
-% 181818101618181816181618181010101012101210101218181810121012
-% 161218121612101010101008100E1010101012121618181818181A181818
-% 181818181818181818181818181818181810101010101012101817181612
-% 101010121618181818101618181816181618181010101012101210101218
-% 181810121012161218121612101010101008100E10101010121216181818
-% 18181A181818181818181818181818181818181818181810101010101012
-% 101817181612101010121618181818101618181816181618181010101012
-% 101210101218181810121012161218121612101010101008100E10101010
-% 12121618181818181A181818181818181818181818181818181818181810
-% 101010101012101817181612101010121618181818101618181816181618
-% 181010101012101210101218181810121012161218121612101010101008
-% 100E1010101012121618181818181A181818181818181818181818181818
-% 181818181810101010101012101817181612101010121618181818101618
-% 181816181618181010101012101210101218181810121012161218121600
-% FF1012101010101010101012181818181012101010101210121010101010
-% 1010101010101012181818181A18181A1818181818171818121618181818
-% 181618181010101008101018181818181818181613181818181818121818
-% 181818181818101012101010101010101012181818181012101010101210
-% 1210101010101010101010101012181818181A18181A1818181818171818
-% 121618181818181618181010101008101018181818181818181613181818
-% 181818121818181818181818101012101010101010101012181818181012
-% 1010101012101210101010101010101010101012181818181A18181A1818
-% 181818171818121618181818181618181010101008101018181818181818
-% 181613181818181818121818181818181818101012101010101010101012
-% 181818181012101010101210121010101010101010101010101218181818
-% 1A18181A1818181818171818121618181818181618181010101008101018
-% 181818181818181613181818181818121818181818181818101012101010
-% 101010101012181818181012101010101210121010101010101010101010
-% 1012181818181A18181A1818181818171818121618181818181618181010
-% 101008101018181818181818181613181818181818121818181818181818
-% 101012101010101010101012181818181012101010101210121010101010
-% 1010101010101012181818181A18181A1818181818171818121618181818
-% 181618181010101008101018181818181818181613181818181818121818
-% 1818181818181010121010101010101010121818181810121010101000FF
-% 121010121012101210121010121612161216121813181718101210101010
-% 101010101010101816181818181A18181818181812101210121812171818
-% 18121810101008101010101818181A18181A181818181A18181818181818
-% 181818181810121010121012101210121010121612161216121813181718
-% 101210101010101010101010101816181818181A18181818181812101210
-% 1218121718184774BBFFFFFF7A59201010181818FFFFFF1A181818FFFFFF
-% 1818181818FFFFFF181818101210477FFFFF7F4010121010121612161216
-% 12183077FFFFBB742E28FFFF7F1010FFFFFF1018161818FFFFFF18181818
-% 182D74FFFF8E5318FFFFFF18181218101010081010101018184777BBFFFF
-% A37746181A1818181818184677BBFFFF773E121010121012104072FFFFFF
-% 90551216121612FFFFFF17181012FFFFFF1010101010FFFFFF1816181818
-% 184F83FFFF8346181210121012181217181818FFFFFF1010081010101018
-% 18181A18183877FFFF934F18FFFFFF18181818FFFFFF1810121010FFFFFF
-% 10121012102067BBFFFF7F451218131817187FFFFF71101010FFFFFF1010
-% 101816184677BBFFFF7747181818121012FFFFFF1217181818FFFFFF1010
-% 0810103E72FFFFFF9357181A181818181A18181818181818181818181810
-% 121010121012101210121010121612161216121813181718101210101010
-% 101010101010101816181818181A18181818181812101210121812171818
-% 18121810101008101010101818181A18181A181818181A18181818181818
-% 18181818181012101012101210121012101012161216121612181300FF10
-% 101210101210181210121010121018181818181618181818161010101010
-% 0A0E10101212181218181818181818181818101012101010121618121612
-% 1816101010080A1010121818181820181818181818181818181812101210
-% 181216181010101210101210181210121010121018181818181618181818
-% 1610101010100A0E10101212181218181818181818181818101012101010
-% 1216181291FFFFFFFFFFFFFFFFBB3E12181818FFFFFF18181818FFFFFF18
-% 18181210FFFFFF1216181029BBFFFFFFFFFFFF6710121010121018181818
-% 3EFFFFFFFFFFFFFFBBFFFF350A0EFFFFFF1218121818FFFFFF181818183E
-% FFFFFFFFFFFF7FFFFFFF16121816101010080A1010122893FFFFFFFFFFFF
-% FFFFA32D18181818128EFFFFFFFFFFFFFF72101210101265FFFFFFFFFFFF
-% FF8E18181818FFFFFF18181816FFFFFF10100A0E10FFFFFF181218182EBB
-% FFFFFFFFFFFF651012101010121618121612FFFFFF1010080A1010121818
-% 1818202EFFFFFFFFFFFF6AFFFFFF12101210FFFFFF1810101012FFFFFF10
-% 18121038BBFFFFFFFFFFFF6A1816181877FFFFFF8E101010FFFFFF101212
-% 181293FFFFFFFFFFFFFF771810101210FFFFFF1618121612FFFFFF101008
-% 0A65FFFFFFFFFFFFFF931818181818181818181812101210181216181010
-% 101210101210181210121010121018181818181618181818161010101010
-% 0A0E10101212181218181818181818181818101012101010121618121612
-% 1816101010080A1010121818181820181818181818181818181812101210
-% 181216181010101210101210181210121010121018181818181600FF1218
-% 1018181818181A1818181810101818161216121012101218181818121010
-% 101010101010101818181818181818101018121816121612101210121010
-% 1218181010101010101816181A181A181A18181A181A1816121010121012
-% 1012101812181018181818181A1818181810101818161216121012101218
-% 181818121010101010101010101818181818181818101018121816121612
-% 10127FFFFFFFFFFFFFFFFFFFFFFF29181618FFFFFF181A1818FFFFFF1816
-% 121010FFFFFF10121018BBFFFFFFFFFFFFFFFF3E18181810101818161291
-% FFFF67101246BBFFFFFF101010FFFFFF1010101818FFFFFF18181810BBFF
-% FFFFFFFFFFFFFFFFFF121010121818101010101021BBFFFFFFFFFFFFFFFF
-% FFFFBB301816128EFFFFFFFFFFFFFFFFFF7710181847FFFF932E181861FF
-% FF69181612FFFFFF12101218FFFFFF1210101010FFFFFF10101818BBFFFF
-% FFFFFFFFFFFF3818161216121012101210FFFFFF18101010101010181618
-% 1A1877FFFFFFFFFFFFFFFFFFFF10101210FFFFFF1018121810FFFFFF1818
-% 1A18BBFFFFFFFFFFFFFFFF55121012BBFFFFFF6A181210FFFFFF10101010
-% 8EFFFFFFFFFFFFFFFFFF7218121816FFFFFF1012101210FFFFFF1810103E
-% FFFF8E2D161864FFFF6A1A18181A181A1816121010121012101210181218
-% 1018181818181A1818181810101818161216121012101218181818121010
-% 101010101010101818181818181818101018121816121612101210121010
-% 1218181010101010101816181A181A181A18181A181A1816121010121012
-% 1012101812181018181818181A18181818101018181612161200FF101012
-% 101818181818181A18181218181818181812101810101218181010101010
-% 101010101210121618181818161210121018101818181810181012101210
-% 121612101010101018181818181A18181A181A1818181812101210121012
-% 101812101012101818181818181A18181218181818181812101810101218
-% 181010101010101010101210121618181818161210121018101818181810
-% 46FFFFFF74291216123EBBFFFF71181818FFFFFF18181A18FFFFFF181812
-% 1012FFFFFF12101849FFFFBB3618184FFFFF931A1818121818181818FFFF
-% FF1810101235FFFFFF101010FFFFFF1012101216FFFFFF18161252FFFFBB
-% 3E18184EBBFFFFFF12101210121612101010107FFFFFBB57291A182E64FF
-% FFFF83181840FFFFFF5321122161FFFFFF401018A3FFFF29181A1818FFFF
-% BB181818FFFFFF18101012FFFFFF1010101010FFFFFF1210124DFFFFBB3E
-% 161247FFFF9210181818181018101210FFFFFF1612101010101018181818
-% 18BBFFFF6C181A3EBBFFFFFF10121012FFFFFF1812101012FFFFFF181818
-% 57FFFFBB30182893FFFFA3121018FFFFFF1828101010FFFFFF10101040FF
-% FFFF5628182860FFFFFF3E181018FFFFFF1018101210FFFFFF161210A0FF
-% FF2018181818FFFFBB181A181A1818181812101210121012101812101012
-% 101818181818181A18181218181818181812101810101218181010101010
-% 101010101210121618181818161210121018101818181810181012101210
-% 121612101010101018181818181A18181A181A1818181812101210121012
-% 101812101012101818181818181A1818121818181818181200FF10121010
-% 121012181818181818181818181818181718131010101010121010101010
-% 101010101210101212121012101010121012181818181818101210101010
-% 10121818181316181818181A181818181818181818181010101010101012
-% 101010121010121012181818181818181818181818181718131010101010
-% 121010101010101010101210101212121012101010121012181818181877
-% FFFF721010101012182EFFFFFF181818FFFFFF18181818FFFFFF18181010
-% 10FFFFFF1012107FFFFF3E10121012181818181818181818181818A3FFFF
-% 4010101010FFFFFF101010FFFFFF1010121010FFFFFF1012107FFFFF3E12
-% 1818184EFFFFFF1210101010101218181838FFFFBB2D181A181818183EA3
-% 622E18187FFFFF51101010121065FFFF7210121012181818184777FFFFFF
-% 181818FFFFFF13101010FFFFFF1010101010FFFFFF1012107FFFFF401012
-% 101010121012181818181818101210FFFFFF10121818181316181818181A
-% FFFFFF281818183EFFFFFF10101010FFFFFF1010101210FFFFFF12181893
-% FFFF4618181828A3612D171813FFFFFF1010121010FFFFFF1010107FFFFF
-% 52121212101265FFFF74101218FFFFFF1818101210FFFFFF101218181813
-% 1618184677FFFFFF18181818181818181010101010101012101010121010
-% 121012181818181818181818181818181718131010101010121010101010
-% 101010101210101212121012101010121012181818181818101210101010
-% 10121818181316181818181A181818181818181818181010101010101012
-% 101010121010121012181818181818181818181818181700FF1810101210
-% 101818181818181818181818181818181816101012101010101010101010
-% 101210101210121010121010101010101216181818181818101010101010
-% 101018181612181818181818181818181818181810101010101010121010
-% 181810101210101818181818181818181818181818181816101012101010
-% 10101010101010121010121012101012101010101010121618181818BBFF
-% FF2110101010101018FFFFFF181818FFFFFF18181818FFFFFF1810101010
-% FFFFFF121010BBFFFF10121010181818181818181818181818184FFFFFFF
-% A072532DFFFFFF101010FFFFFF1210101210FFFFFF121010FFFFFF101216
-% 181818FFFFFF1010101010101010181868FFFF5618181818181818181818
-% 181810FFFFFF2010101210102DFFFFBB12101018284F92FFFFFFFFFF9318
-% 1818FFFFFF16101012FFFFFF1010101010FFFFFF101012BBFFFF10121010
-% 1010101012161818181818181010FFFFFF101010181816121818181818FF
-% FFFF1818181818FFFFFF10101010FFFFFF1018181010FFFFFF181818FFFF
-% FF1818181818181818181816FFFFFF1010101010FFFFFF101012FFFFFF21
-% 121010121029FFFFBB101216FFFFFF1818181010FFFFFF10101018182749
-% 93FFFFFFFFFF931818181818181810101010101010121010181810101210
-% 101818181818181818181818181818181816101012101010101010101010
-% 101210101210121010121010101010101216181818181818101010101010
-% 101018181612181818181818181818181818181810101010101010121010
-% 1818101012101018181818181818181818181818181800FF181818101612
-% 181018181818181818181818181818181818181010121018181010101210
-% 10101210101010121010121010101010121818181818181012101010100A
-% 101010121818181818181818181718181818121012101010121010181818
-% 181818101612181018181818181818181818181818181818181010121018
-% 181010101210101012101010101210101210101010101218181818181810
-% 12101010100A287FFFFFA3181818FFFFFF18181718FFFFFF1210121010FF
-% FFFF101818FFFFFFFFFFFFFFFFFFFFFF181818181818181818184EA3FFFF
-% FFFFFFFFFFFF181010FFFFFF1010121010FFFFFF101012FFFFFF10101218
-% 1818FFFFFF1012101010100A101010A0FFFF351818181818181718181818
-% 1210FFFFFF10121010181818FFFFFF10161269FFFFFFFFFFFFFFBB2D1818
-% 18FFFFFF18181810FFFFFF1818101010FFFFFF101210FFFFFFFFFFFFFFFF
-% FFFFFF10121818181818181012FFFFFF100A10101012181818181818FFFF
-% FF1718181818FFFFFF10101012FFFFFF1818181818FFFFFF181018FFFFFF
-% 1818181818181818181818FFFFFF1012101818FFFFFF121010FFFFFF1010
-% 1012101012FFFFFF101012FFFFFF1818181012FFFFFF100A101065FFFFFF
-% FFFFFFFFBB2D181718181818121012101010121010181818181818101612
-% 181018181818181818181818181818181818181010121018181010101210
-% 10101210101010121010121010101010121818181818181012101010100A
-% 101010121818181818181818181718181818121012101010121010181818
-% 18181810161218101818181818181818181818181800FF1A181812121210
-% 181012121018181818181818181216181818101210181818101018101818
-% 181816121012101012161010101010121818181818181012101010101008
-% 10101010181817181818181818181818161210101010101012181818181A
-% 181812121210181012121018181818181818181216181818101210181818
-% 101018101818181816121012101012161010101010121818181818181012
-% 10294671BBFFFFFFFF52181817FFFFFF18181818FFFFFF1210101010FFFF
-% FF181818BBFFFFFFFFFFFFFFFFFFBB1210181818181818181812162E4E69
-% 8EFFFFFFFF181010FFFFFF1818181612FFFFFF101216FFFFFF1010121818
-% 18FFFFFF10121010101010081010FFFFFF18171818181818181818181612
-% 10FFFFFF2010121818182EFFFFFF12125CFFFFFFFFFFFF77471818181818
-% FFFFFF18181810FFFFFF1818101018FFFFFF181816BBFFFFFFFFFFFFFFFF
-% FFBB10121818181818181012FFFFFFFFFFFFFFFFFFFFFF18171818FFFFFF
-% 1818181816FFFFFF10101010FFFFFF18181A1818FFFFFF101810FFFFFF18
-% 18181818181818121618FFFFFF1210181818FFFFFF101818FFFFFF221012
-% 1010122CFFFFFF101012FFFFFF1818181012FFFFFF10100859FFFFFFFFFF
-% FF774718181818181818161210101010101012181818181A181812121210
-% 181012121018181818181818181216181818101210181818101018101818
-% 181816121012101012161010101010121818181818181012101010101008
-% 10101010181817181818181818181818161210101010101012181818181A
-% 181812121210181012121018181818181818181200FF1818121010101012
-% 101010121012181818171818161812181012121012121818181818181818
-% 1A1818181010181818101210101010101818181818161217121010101010
-% 1010101012181818181818181118131810101010101012181818181A1818
-% 121010101012101010121012181818171818161812181012121012121818
-% 1818181818181A18181810101818181012101010101018181818181640A3
-% FFFFFFFFFFFFFF6510101218FFFFFF18181811FFFFFF3E10101020FFFFFF
-% 18181877FFFF2210101010FFFF7F10121012181818171818161812181012
-% 12FFFFFF181818FFFFFF46181A1829FFFFFF1818187FFFFF3E1010101847
-% FFFFFF16121712101010101010FFFFFF1218181818181818111813181010
-% 71FFFF5212181818186CFFFF741010BBFFFFFF723E1210121818181718FF
-% FFFF12181012FFFFFF4018181829FFFFFF181A1877FFFF2118181810FFFF
-% 7F10101018181818181612FFFFFFFFFFFFFFFFFFFFFF12181818FFFFFF18
-% 11181318FFFFFF10101012FFFFFF471A181822FFFFFF1012107FFFFF3E12
-% 181828A3612E161812FFFFFF1210121218FFFFFF18181877FFFF57181010
-% 18186AFFFF71101010FFFFFF4618181622FFFFFF101010BBFFFFFF724018
-% 1818181818181118131810101010101012181818181A1818121010101012
-% 101010121012181818171818161812181012121012121818181818181818
-% 1A1818181010181818101210101010101818181818161217121010101010
-% 1010101012181818181818181118131810101010101012181818181A1818
-% 1210101010121010101210121818181718181600FF181810101010101210
-% 101010101216181818181012101210101010101010101818181818181818
-% 181818181818181818101010101012181818181818181818101818121010
-% 100A10101818181818181818181810121010101012161818181A18181810
-% 101010101210101010101216181818181012101210101010101010101818
-% 181818181818181818181818181818101010101012181818181883FFFFFF
-% FFFFFFFFA03E100A101018FFFFFF18181818FFFFFFBB3E101072FFFFFF18
-% 181A47FFFF8E21102171FFFF47101010121618181818A0FFFF2A10101010
-% FFFFFF101818FFFFFFBB47181877FFFFFF1818184EFFFFBB3E101246BBFF
-% FFFF18181818101818121010FFFFFF10181818181818181818181012103E
-% FFFFFF5528182964FFFFFF3E1010FFFFFF2910101021FFFFA3181818FFFF
-% FF12101010FFFFFFBB3E181877FFFFFF18181846FFFF9229182977FFFF46
-% 10101218181818181818FFFFFFFFFFFFFFFFFFFFFF10181818FFFFFF1818
-% 181810FFFFFF10101216FFFFFFBB47181872FFFFFF10121052FFFFBB3016
-% 2892FFFFA0121012FFFFFF1010101010FFFFFF18181847FFFFFF57281829
-% 61FFFFFF3E101010FFFFFFBB46181877FFFFFF181812FFFFFF2210101828
-% FFFFA3181818181810121010101012161818181A18181810101010101210
-% 101010101216181818181012101210101010101010101818181818181818
-% 181818181818181818101010101012181818181818181818101818121010
-% 100A10101818181818181818181810121010101012161818181A18181810
-% 10101010121010101010121618181818101200FF18181810100808101010
-% 10100B0E0A10101618181818181810181316121612161210121618181818
-% 181818161218101818181818161010101012101010121010101218181618
-% 101010181618181A1818181310101810181012181818181A181818181810
-% 10080810101010100B0E0A10101618181818181810181316121612161210
-% 12161818181818181816121810181818181816101010101252FFFFFFFFBB
-% 72492D18161810101018FFFFFF1A181818FFFFFFFFFFFFFFFFFFFF77181A
-% 181892FFFFFFFFFFFFFFBB1010100B0E0A1010161857FFFF9328101867FF
-% FF83121612FFFFFFFFFFFFFFFFFFFF7512181018BBFFFFFFFFFFFFFFFFFF
-% FF1010121010101218181692FFFF29181618181A1818181310101810187F
-% FFFFFFFFFFFFFFFFFF831810106AFFFF461010208BFFFF52101618FFFFFF
-% 18181018FFFFFFFFFFFFFFFFFFFF771818181892FFFFFFFFFFFFFFBB1818
-% 161010101012101010FFFFFF101218181618101010181618FFFFFF181813
-% 1010FFFFFF10121818FFFFFFFFFFFFFFFFFFFF6A08101010BBFFFFFFFFFF
-% FFFFFF4718FFFFFFFFFFFFFF121612FFFFFF1216181883FFFFFFFFFFFFFF
-% FFFF8318181816FFFFFFFFFFFFFFFFFFFF7210121877FFFF4710102891FF
-% FF571818181310101810181012181818181A181818181810100808101010
-% 10100B0E0A10101618181818181810181316121612161210121618181818
-% 181818161218101818181818161010101012101010121010101218181618
-% 101010181618181A1818181310101810181012181818181A181818181810
-% 10080810101010100B0E0A10101618181800FF1818181612101010101010
-% 101010101010121818181818161018101612171218101210121818181818
-% 181818101810181818181818181810121010121010101012161818181818
-% 18181818181818181818181012101218161216181818181A181818181612
-% 101010101010101010101010121818181818161018101612171218101210
-% 1218181818181818181018101818181818181818101210A0FFFF7F361012
-% 161818181818181818FFFFFF18181818FFFFFF65FFFFFFFFFFFF3518181A
-% 181893FFFFFFFFFFFF36101010101010101012181892FFFFFFFFFFFFFFFF
-% 3C121810FFFFFF69FFFFFFFFFFFF35101810183EFFFFFFFFFFFF8EFFFFFF
-% 1210101010121618181869FFFF5718181818181818181810121012181690
-% FFFFFFFFFFFFFF831818161229BBFFFFFFFFFFFFFF8E10101218FFFFFF18
-% 161018FFFFFF68FFFFFFFFFFFF35181818181893FFFFFFFFFFFF3E181818
-% 1818101210101210FFFFFF121618181818181818181818FFFFFF18181810
-% 12FFFFFF16121618FFFFFF6CFFFFFFFFFFFF2E1010101029BBFFFFFFFFFF
-% FF691818FFFFFFFFFFFFFF121712FFFFFF101218181892FFFFFFFFFFFFFF
-% 831818181818FFFFFF67FFFFFFFFFFFF2E1216182EBBFFFFFFFFFFFFFF92
-% 18181818181012101218161216181818181A181818181612101010101010
-% 101010101010121818181818161018101612171218101210121818181818
-% 181818101810181818181818181810121010121010101012161818181818
-% 18181818181818181818181012101218161216181818181A181818181612
-% 1010101010101010101010101218181800FF181618181818181012101010
-% 101010101010121618181818121812181218121012101210121018181816
-% 181810181210121018181818181210101210121012101012181818181818
-% 1818181818181818181818131618101218181818181A1818181618181818
-% 181012101010101010101010121618181818121812181218121012101210
-% 12101818181618181018121012101818181818121010FFFFFF1012101012
-% 28FFFFFF18181818FFFFFF18181818FFFFFF16478EFFFF773518181A1818
-% 18164693FFBB6A29121010101010101010101216184F83FFFFFFA06A2A18
-% 121012FFFFFF123E92FFFF75351810181210122977BBFFA35612FFFFFF10
-% 12101210101218181835FFFFBB2D18181818181835A3612B161810121847
-% 77FFFFFF7746181618181818295A90FFFFFF7F471010101012FFFFFF1818
-% 1218FFFFFF18408EFFFF732E12101818181618478EFFBB652A1018181818
-% 18121010121012FFFFFF101218181818181818181818FFFFFF1818181813
-% FFFFFF12181818FFFFFF184692FFFF77351818101210102165A0FFFF8E3E
-% 121618FFFFFFFFFFFFFF121812FFFFFF1210121018184775FFFFFF774010
-% 1210181818FFFFFF103E90FFFF72301010121818296193FFFFFF834E1818
-% 1818181818131618101218181818181A1818181618181818181012101010
-% 101010101010121618181818121812181218121012101210121018181816
-% 181810181210121018181818181210101210121012101012181818181818
-% 1818181818181818181818131618101218181818181A1818181618181818
-% 18101210101010101010101012161800FF18121216181818121612101010
-% 10100A0F1010121818181618171816181618101210101010121018181812
-% 161218101010181818181818121612181018101810101012161818181818
-% 1A1818181A18181818181818181818161818181818181818121216181818
-% 12161210101010100A0F1010121818181618171816181618101210101010
-% 121018181812161218101010181818181818121612A3FFFF652810102990
-% FFFF831818181A1818181A18181818181818181818161818181818181818
-% 12121618181812161210101010100A0F1010121818181618171816181618
-% 10121010101012101818181216121810101018181818181812FFFFFF1018
-% 10181010101216181883FFFFBB5728181A2E56FFFFFF8318181818161818
-% 18181818181812121618181812161210101010100A0F1010121818181618
-% 171816181618101210101010121018181812161218101010181818181818
-% 121612181018FFFFFF1010121618181818181A1818181A18181818181818
-% 18181816181818181818181812121618181812161210101010100A0F1010
-% 12181818FFFFFF1816181618101210101010121018181812161218101010
-% 1818181818181216121810181018101010121618181818181A1818181A18
-% 181818181818181818161818181818181818121216181818121612101010
-% 10100A0F1010121818181618171816181618101210101010121018181812
-% 161218101010181818181818121612181018101810101012161818181818
-% 1A1818181A18181818181818181818161818181818181818121216181818
-% 12161210101010100A0F1010121800FF1810101012101216121810121010
-% 121010101010121618181818181818181810101010121010101210121612
-% 181018101818181818181816121810181018121010101212181818181818
-% 18181818181A181818181818181818181818181818181810101012101216
-% 121810121010121010101010121618181818181818181810101010121010
-% 101210121612181018101818181818181816121852FFFFFFFFFFFFFFFFFF
-% FF3E18181818FFFFFF18181A181818181818181818181818181818181810
-% 101012101216121810121010121010101010121618181818181818181810
-% 101010121010101210121612181018101818181818181816FFFFFF181018
-% 12101010121218181893FFFFFFFFFFFFFFFFFFFFFF361818181818181818
-% 1818181818101010121012161218101210101210101010FFFFFF18181818
-% 181818181810101010121010101210121612181018101818181818181816
-% 1218101810FFFFFFFFFFFFFFFFFFFFFFFF1818181818181A181818181818
-% 181818181818181818181810101012101216121810121010121010101010
-% 121618FFFFFF1818181818FFFFFF10121010101210121612181018101818
-% 18181818181612181018101812101010121218181818181818181818181A
-% 181818181818181818181818181818181810101012101216121810121010
-% 121010101010121618181818181818181810101010121010101210121612
-% 181018101818181818181816121810181018121010101212181818181818
-% 18181818181A181818181818181818181818181818181810101012101216
-% 1218101210101210101010101200FF181612101010101210121612101216
-% 101010101210121818181818181818181612101010101210121012101216
-% 121818181818181612101210121012101210101010101012181818181818
-% 181818181818181A18181818181818181818181818181612101010101210
-% 121612101216101010101210121818181818181818181612101010101210
-% 121012101216121818181818181612101210121067FFFFFFFFFFFFFFFF5C
-% 1818181818FFFFFF18181818181A18181818181818181818181818181612
-% 101010101210121612101216101010101210121818181818181818181612
-% 1010101012101210121012161218181818181816121012FFFFFF12101210
-% 10101010101218181883FFFFFFFFFFFFFFFFBB4018181818181818181818
-% 18181818161210101010121012161210121610101010FFFFFF1818181818
-% 181818181612101010101210121012101216121818181818181612101210
-% 12101210FFFFFFFFFFFFFFFFFFFFFFFF1818181818181818181A18181818
-% 181818181818181818181612101010101210121612101216101010101210
-% 12183EBBFF1818181818FFFFFF1010101210121012101216121818181818
-% 181612101210121012101210101010101012181818181818181818181818
-% 181A18181818181818181818181818181612101010101210121612101216
-% 101010101210121818181818181818181612101010101210121012101216
-% 121818181818181612101210121012101210101010101012181818181818
-% 181818181818181A18181818181818181818181818181612101010101210
-% 12161210121610101010121000FF18181816101010101012101210181216
-% 121010101012161818181818181818121810101010101010121012101810
-% 18181818181818121010121012101210121010100F101010121018181818
-% 18181A18181A181A18181818181818181818181818181816101010101012
-% 101210181216121010101012161818181818181818121810101010101010
-% 12101210181018181818181818121010121012104072BBFFFFA0652D1010
-% 12101818FFFFFF181A18181A181A18181818181818181818181818181816
-% 101010101012101210181216121010101012161818181818181818121810
-% 10101010101012101210181018181818181818121010FFFFFF1012101210
-% 10100F1010101210183E77A3FFFFBB834F1A181A18181818181818181818
-% 181818181816101010101012101210181216121010FFFFFF161818181818
-% 181818121810101010101010121012101810181818181818181210101210
-% 121012FFFFFFFFFFFFFFFFFFFFFFFF18181818181A18181A181A18181818
-% 181818181818181818181816101010101012101210181216121010101012
-% 161818771818181818FFFFFF101010101010121012101810181818181818
-% 18121010121012101210121010100F10101012101818181818181A18181A
-% 181A18181818181818181818181818181816101010101012101210181216
-% 121010101012161818181818181818121810101010101010121012101810
-% 18181818181818121010121012101210121010100F101010121018181818
-% 18181A18181A181A18181818181818181818181818181816101010101012
-% 101210181216121010101000FF1818181818121010101010101818181810
-% 101010101012181818181818181818181012101010121010101012101818
-% 101818181818181612101010121010101010100A10101010101210181818
-% 18181A181A18201818181818181818181818181818181818121010101010
-% 101818181810101010101012181818181818181818181012101010121010
-% 101012101818101818181818181612101010121010101010100A10101010
-% 10121018181818181A181A18201818181818181818181818181818181818
-% 121010101010101818181810101010101012181818181818181818181012
-% 101010121010101012101818101818181818181612101010121010101010
-% 100A1010101010121018181818181A181A18201818181818181818181818
-% 181818181818121010101010101818181810101010101012181818181818
-% 181818181012101010121010101012101818101818181818181612101010
-% 121010101010100A1010101010121018181818181A181A18201818181818
-% 181818181818181818181818121010101010101818181810101010101012
-% 181818181818181818181012101010121010101012101818101818181818
-% 181612101010121010101010100A1010101010121018181818181A181A18
-% 201818181818181818181818181818181818121010101010101818181810
-% 101010101012181818181818181818181012101010121010101012101818
-% 101818181818181612101010121010101010100A10101010101210181818
-% 18181A181A18201818181818181818181818181818181818121010101010
-% 1018181818101010101000FF181818181010101010101218181618181818
-% 1818181818181A1818181810101816181818181216101210121018101210
-% 1010181818101210101210101012101010100A0810101010101012161818
-% 181818181A18181818101012101810181618181818181010101010101218
-% 1816181818181818181818181A1818181810101816181818181216101210
-% 1210181012101010181818101210101210101012101010100A0810101010
-% 101012161818181818181A18181818101012101810181618181818181010
-% 1010101012181816181818181818181818181A1818181810101816181818
-% 181216101210121018101210101018181810121010121010101210101010
-% 0A0810101010101012161818181818181A18181818101012101810181618
-% 1818181810101010101012181816181818181818181818181A1818181810
-% 101816181818181216101210121018101210101018181810121010121010
-% 1012101010100A0810101010101012161818181818181A18181818101012
-% 101810181618181818181010101010101218181618181818181818181818
-% 1A1818181810101816181818181216101210121018101210101018181810
-% 1210101210101012101010100A0810101010101012161818181818181A18
-% 181818101012101810181618181818181010101010101218181618181818
-% 1818181818181A1818181810101816181818181216101210121018101210
-% 1010181818101210101210101012101010100A0810101010101012161818
-% 181818181A18181818101012101810181618181818181010101010101218
-% 18161818181818181800FF16181818101012081010101012181818181818
-% 181818181A181A1818161212181818181818161210121010121216181010
-% 121010101212161218101210101012101010101010101010101012181818
-% 18181A181818181810121012101210121216181818101012081010101012
-% 181818181818181818181A181A1818161212181818181818161210121010
-% 121216181010121010101212161218101210101012101010101010101010
-% 10101218181818181A181818181810121012101210121216181818101012
-% 081010101012181818181818181818181A181A1818161212181818181818
-% 161210121010121216181010121010101212161218101210101012101010
-% 10101010101010101218181818181A181818181810121012101210121216
-% 181818101012081010101012181818181818181818181A181A1818161212
-% 181818181818161210121010121216181010121010101212161218101210
-% 10101210101010101010101010101218181818181A181818181810121012
-% 101210121216181818101012081010101012181818181818181818181A18
-% 1A1818161212181818181818161210121010121216181010121010101212
-% 16121810121010101210101010101010101010101218181818181A181818
-% 181810121012101210121216181818101012081010101012181818181818
-% 181818181A181A1818161212181818181818161210121010121216181010
-% 121010101212161218101210101012101010101010101010101012181818
-% 18181A181818181810121012101210121216181818101012081010101012
-% 181818181818181800FF121018121612100E0A081010101818181A18181A
-% 181818181818181812101018181818181818181010181318161818121010
-% 101010101018181618181018121612101010101010100E10101210181818
-% 18181A18181818101216121018101210121018121612100E0A0810101018
-% 18181A18181A181818181818181812101018181818181818181010181318
-% 161818121010101010101018181618181018121612101010101010100E10
-% 10121018181818181A18181818101216121018101210121018121612100E
-% 0A081010101818181A18181A181818181818181812101018181818181818
-% 181010181318161818121010101010101018181618181018121612101010
-% 101010100E1010121018181818181A181818181012161210181012101210
-% 18121612100E0A081010101818181A18181A181818181818181812101018
-% 181818181818181010181318161818121010101010101018181618181018
-% 121612101010101010100E1010121018181818181A181818181012161210
-% 18101210121018121612100E0A081010101818181A18181A181818181818
-% 181812101018181818181818181010181318161818121010101010101018
-% 181618181018121612101010101010100E1010121018181818181A181818
-% 18101216121018101210121018121612100E0A081010101818181A18181A
-% 181818181818181812101018181818181818181010181318161818121010
-% 101010101018181618181018121612101010101010100E10101210181818
-% 18181A18181818101216121018101210121018121612100E0A0810101018
-% 18181A18181A1800FF101210181818181010100A10101818181818181818
-% 18181A181818181010121012101818181810181218161818181816181010
-% 101010121818181816181216181812101010101010101010101212101818
-% 181818181818181810181112101610101210181818181010100A10101818
-% 18181818181818181A181818181010121012101818181810181218161818
-% 181816181010101010121818181816181216181812101010101010101010
-% 101212101818181818181818181810181112101610101210181818181010
-% 100A1010181818181818181818181A181818181010121012101818181810
-% 181218161818181816181010101010121818181816181216181812101010
-% 101010101010101212101818181818181818181810181112101610101210
-% 181818181010100A1010181818181818181818181A181818181010121012
-% 101818181810181218161818181816181010101010121818181816181216
-% 181812101010101010101010101212101818181818181818181810181112
-% 101610101210181818181010100A1010181818181818181818181A181818
-% 181010121012101818181810181218161818181816181010101010121818
-% 181816181216181812101010101010101010101212101818181818181818
-% 181810181112101610101210181818181010100A10101818181818181818
-% 18181A181818181010121012101818181810181218161818181816181010
-% 101010121818181816181216181812101010101010101010101212101818
-% 181818181818181810181112101610101210181818181010100A10101818
-% 18181818181800FF10101010121018181810101012181818181818181818
-% 18181A181818101210101010121012101018101818181818181818181818
-% 181010181218101212101218181018101210101010101010101012181818
-% 181818181018101812181018121010101010121018181810101012181818
-% 18181818181818181A181818101210101010121012101018101818181818
-% 181818181818181010181218101212101218181018101210101010101010
-% 101012181818181818181018101812181018121010101010121018181810
-% 10101218181818181818181818181A181818101210101010121012101018
-% 101818181818181818181818181010181218101212101218181018101210
-% 101010101010101012181818181818181018101812181018121010101010
-% 12101818181010101218181818181818181818181A181818101210101010
-% 121012101018101818181818181818181818181010181218101212101218
-% 181018101210101010101010101012181818181818181018101812181018
-% 12101010101012101818181010101218181818181818181818181A181818
-% 101210101010121012101018101818181818181818181818181010181218
-% 101212101218181018101210101010101010101012181818181818181018
-% 101812181018121010101010121018181810101012181818181818181818
-% 18181A181818101210101010121012101018101818181818181818181818
-% 181010181218101212101218181018101210101010101010101012181818
-% 181818181018101812181018121010101010121018181810101012181818
-% 181818181800FF1012101010101218181810121618181818181818181818
-% 1818181810121010101010101012101212101810181818181818181A1818
-% 181216121612101010101210181012101010101010101012101012121818
-% 161210101212161216181818121012101010101218181810121618181818
-% 181818181818181818181012101010101010101210121210181018181818
-% 1818181A1818181216121612101010101210181012101010101010101012
-% 101012121818161210101212161216181818121012101010101218181810
-% 121618181818181818181818181818181012101010101010101210121210
-% 1810181818181818181A1818181216121612101010101210181012101010
-% 101010101012101012121818161210101212161216181818121012101010
-% 101218181810121618181818181818181818181818181012101010101010
-% 1012101212101810181818181818181A1818181216121612101010101210
-% 181012101010101010101012101012121818161210101212161216181818
-% 121012101010101218181810121618181818181818181818181818181012
-% 1010101010101012101212101810181818181818181A1818181216121612
-% 101010101210181012101010101010101012101012121818161210101212
-% 161216181818121012101010101218181810121618181818181818181818
-% 1818181810121010101010101012101212101810181818181818181A1818
-% 181216121612101010101210181012101010101010101012101012121818
-% 161210101212161216181818121012101010101218181810121618181818
-% 1818181800FF1810121010100E1816121810181618161818161818181818
-% 181818121012101010101218181812101012121612181618181818181818
-% 181818181810181210101010121612101010101010101012101210121012
-% 1010101010121818181818181810121010100E1816121810181618161818
-% 161818181818181818121012101010101218181812101012121612181618
-% 181818181818181818181810181210101010121612101010101010101012
-% 1012101210121010101010121818181818181810121010100E1816121810
-% 181618161818161818181818181818121012101010101218181812101012
-% 121612181618181818181818181818181810181210101010121612101010
-% 101010101012101210121012101010101012181818181818181012101010
-% 0E1816121810181618161818161818181818181818121012101010101218
-% 181812101012121612181618181818181818181818181810181210101010
-% 121612101010101010101012101210121012101010101012181818181818
-% 1810121010100E1816121810181618161818161818181818181818121012
-% 101010101218181812101012121612181618181818181818181818181810
-% 181210101010121612101010101010101012101210121012101010101012
-% 1818181818181810121010100E1816121810181618161818161818181818
-% 181818121012101010101218181812101012121612181618181818181818
-% 181818181810181210101010121612101010101010101012101210121012
-% 1010101010121818181818181810121010100E1816121810181618161818
-% 16181800FF181810100A100A101010101812121218181818181818181818
-% 181810101010101216181818181810121010121612181812101010181818
-% 18181818181818180A101012161210121010101010101010101010121010
-% 10101010121018181A181A181810100A100A101010101812121218181818
-% 181818181818181810101010101216181818181810121010121612181812
-% 10101018181818181818181818180A101012161210121010101010101010
-% 10101012101010101010121018181A181A181810100A100A101010101812
-% 121218181818181818181818181810101010101216181818181810121010
-% 12161218181210101018181818181818181818180A101012161210121010
-% 10101010101010101012101010101010121018181A181A181810100A100A
-% 101010101812121218181818181818181818181810101010101216181818
-% 18181012101012161218181210101018181818181818181818180A101012
-% 16121012101010101010101010101012101010101010121018181A181A18
-% 1810100A100A101010101812121218181818181818181818181810101010
-% 101216181818181810121010121612181812101010181818181818181818
-% 18180A101012161210121010101010101010101010121010101010101210
-% 18181A181A181810100A100A101010101812121218181818181818181818
-% 181810101010101216181818181810121010121612181812101010181818
-% 18181818181818180A101012161210121010101010101010101010121010
-% 10101010121018181A181A181810100A100A101010101812121218181818
-% 181800FF181818101010100B101012101818181818181818181010181216
-% 121012101010101218181818181A18181216121818121018181818181818
-% 181612181618181818101210181818101216121818181810101210101210
-% 10101010121818181818181818101010100B101012101818181818181818
-% 181010181216121012101010101218181818181A18181216121818121018
-% 181818181818181612181618181818101210181818101216121818181810
-% 10121010121010101010121818181818181818101010100B101012101818
-% 181818181818181010181216121012101010101218181818181A18181216
-% 121818121018181818181818181612181618181818101210181818101216
-% 12181818181010121010121010101010121818181818181818101010100B
-% 101012101818181818181818181010181216121012101010101218181818
-% 181A18181216121818121018181818181818181612181618181818101210
-% 181818101216121818181810101210101210101010101218181818181818
-% 18101010100B101012101818181818181818181010181216121012101010
-% 101218181818181A18181216121818121018181818181818181612181618
-% 181818101210181818101216121818181810101210101210101010101218
-% 18181818181818101010100B101012101818181818181818181010181216
-% 121012101010101218181818181A18181216121818121018181818181818
-% 181612181618181818101210181818101216121818181810101210101210
-% 10101010121818181818181818101010100B101012101818181818181818
-% 1800FF181818101210101010101012101210181818181818181211181012
-% 101012101010101818181818181812101210181810121012181018181818
-% 181210121210181818101216121818181818181818181218161812101010
-% 101010101012181818181818101210101010101012101210181818181818
-% 181211181012101012101010101818181818181812101210181810121012
-% 181018181818181210121210181818101216121818181818181818181218
-% 161812101010101010101012181818181818101210101010101012101210
-% 181818181818181211181012101012101010101818181818181812101210
-% 181810121012181018181818181210121210181818101216121818181818
-% 181818181218161812101010101010101012181818181818101210101010
-% 101012101210181818181818181211181012101012101010101818181818
-% 181812101210181810121012181018181818181210121210181818101216
-% 121818181818181818181218161812101010101010101012181818181818
-% 101210101010101012101210181818181818181211181012101012101010
-% 101818181818181812101210181810121012181018181818181210121210
-% 181818101216121818181818181818181218161812101010101010101012
-% 181818181818101210101010101012101210181818181818181211181012
-% 101012101010101818181818181812101210181810121012181018181818
-% 181210121210181818101216121818181818181818181218161812101010
-% 101010101012181818181818101210101010101012101210181818181818
-% 00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
-%%EndPreview
-
-
-% including file "../library/bltGraph.pro"
-
-%
-% PostScript prolog file of the BLT graph widget.
-%
-% Copyright 1989-1992 Regents of the University of California.
-% Permission to use, copy, modify, and distribute this
-% software and its documentation for any purpose and without
-% fee is hereby granted, provided that the above copyright
-% notice appear in all copies. The University of California
-% makes no representations about the suitability of this
-% software for any purpose. It is provided "as is" without
-% express or implied warranty.
-%
-% Copyright 1991-1997 Bell Labs Innovations for Lucent Technologies.
-%
-% Permission to use, copy, modify, and distribute this software and its
-% documentation for any purpose and without fee is hereby granted, provided
-% that the above copyright notice appear in all copies and that both that the
-% copyright notice and warranty disclaimer appear in supporting documentation,
-% and that the names of Lucent Technologies any of their entities not be used
-% in advertising or publicity pertaining to distribution of the software
-% without specific, written prior permission.
-%
-% Lucent Technologies disclaims all warranties with regard to this software,
-% including all implied warranties of merchantability and fitness. In no event
-% shall Lucent Technologies be liable for any special, indirect or
-% consequential damages or any damages whatsoever resulting from loss of use,
-% data or profits, whether in an action of contract, negligence or other
-% tortuous action, arising out of or in connection with the use or performance
-% of this software.
-%
-
-200 dict begin
-
-/BaseRatio 1.3467736870885982 def % Ratio triangle base / symbol size
-/BgColorProc 0 def % Background color routine (symbols)
-/DrawSymbolProc 0 def % Routine to draw symbol outline/fill
-/StippleProc 0 def % Stipple routine (bar segments)
-/DashesProc 0 def % Dashes routine (line segments)
-
-% Define the array ISOLatin1Encoding (which specifies how characters are
-% encoded for ISO-8859-1 fonts), if it isn't already present (Postscript
-% level 2 is supposed to define it, but level 1 doesn't).
-
-systemdict /ISOLatin1Encoding known not {
- /ISOLatin1Encoding [
- /space /space /space /space /space /space /space /space
- /space /space /space /space /space /space /space /space
- /space /space /space /space /space /space /space /space
- /space /space /space /space /space /space /space /space
- /space /exclam /quotedbl /numbersign /dollar /percent /ampersand
- /quoteright
- /parenleft /parenright /asterisk /plus /comma /minus /period /slash
- /zero /one /two /three /four /five /six /seven
- /eight /nine /colon /semicolon /less /equal /greater /question
- /at /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 /bracketleft /backslash /bracketright /asciicircum /underscore
- /quoteleft /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 /braceleft /bar /braceright /asciitilde /space
- /space /space /space /space /space /space /space /space
- /space /space /space /space /space /space /space /space
- /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent
- /dieresis /space /ring /cedilla /space /hungarumlaut /ogonek /caron
- /space /exclamdown /cent /sterling /currency /yen /brokenbar /section
- /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen
- /registered /macron
- /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph
- /periodcentered
- /cedillar /onesuperior /ordmasculine /guillemotright /onequarter
- /onehalf /threequarters /questiondown
- /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
- /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex
- /Idieresis
- /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply
- /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn
- /germandbls
- /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
- /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex
- /idieresis
- /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide
- /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn
- /ydieresis
- ] def
-} if
-
-% font ISOEncode font
-% This procedure changes the encoding of a font from the default
-% Postscript encoding to ISOLatin1. It's typically invoked just
-% before invoking "setfont". The body of this procedure comes from
-% Section 5.6.1 of the Postscript book.
-
-/ISOEncode {
- dup length dict
- begin
- {1 index /FID ne {def} {pop pop} ifelse} forall
- /Encoding ISOLatin1Encoding def
- currentdict
- end
-
- % I'm not sure why it's necessary to use "definefont" on this new
- % font, but it seems to be important; just use the name "Temporary"
- % for the font.
-
- /Temporary exch definefont
-} bind def
-
-/Stroke {
- gsave
- stroke
- grestore
-} def
-
-/Fill {
- gsave
- fill
- grestore
-} def
-
-/SetFont {
- % Stack: pointSize fontName
- findfont exch scalefont ISOEncode setfont
-} def
-
-/Box {
- % Stack: x y width height
- newpath
- exch 4 2 roll moveto
- dup 0 rlineto
- exch 0 exch rlineto
- neg 0 rlineto
- closepath
-} def
-
-/SetFgColor {
- % Stack: red green blue
- CL 0 eq {
- pop pop pop 0 0 0
- } if
- setrgbcolor
- CL 1 eq {
- currentgray setgray
- } if
-} def
-
-/SetBgColor {
- % Stack: red green blue
- CL 0 eq {
- pop pop pop 1 1 1
- } if
- setrgbcolor
- CL 1 eq {
- currentgray setgray
- } if
-} def
-
-% The next two definitions are taken from "$tk_library/prolog.ps"
-
-% desiredSize EvenPixels closestSize
-%
-% The procedure below is used for stippling. Given the optimal size
-% of a dot in a stipple pattern in the current user coordinate system,
-% compute the closest size that is an exact multiple of the device's
-% pixel size. This allows stipple patterns to be displayed without
-% aliasing effects.
-
-/EvenPixels {
- % Compute exact number of device pixels per stipple dot.
- dup 0 matrix currentmatrix dtransform
- dup mul exch dup mul add sqrt
-
- % Round to an integer, make sure the number is at least 1, and compute
- % user coord distance corresponding to this.
- dup round dup 1 lt {pop 1} if
- exch div mul
-} bind def
-
-% width height string filled StippleFill --
-%
-% Given a path and other graphics information already set up, this
-% procedure will fill the current path in a stippled fashion. "String"
-% contains a proper image description of the stipple pattern and
-% "width" and "height" give its dimensions. If "filled" is true then
-% it means that the area to be stippled is gotten by filling the
-% current path (e.g. the interior of a polygon); if it's false, the
-% area is gotten by stroking the current path (e.g. a wide line).
-% Each stipple dot is assumed to be about one unit across in the
-% current user coordinate system.
-
-% width height string StippleFill --
-%
-% Given a path already set up and a clipping region generated from
-% it, this procedure will fill the clipping region with a stipple
-% pattern. "String" contains a proper image description of the
-% stipple pattern and "width" and "height" give its dimensions. Each
-% stipple dot is assumed to be about one unit across in the current
-% user coordinate system. This procedure trashes the graphics state.
-
-/StippleFill {
- % The following code is needed to work around a NeWSprint bug.
-
- /tmpstip 1 index def
-
- % Change the scaling so that one user unit in user coordinates
- % corresponds to the size of one stipple dot.
- 1 EvenPixels dup scale
-
- % Compute the bounding box occupied by the path (which is now
- % the clipping region), and round the lower coordinates down
- % to the nearest starting point for the stipple pattern. Be
- % careful about negative numbers, since the rounding works
- % differently on them.
-
- pathbbox
- 4 2 roll
- 5 index div dup 0 lt {1 sub} if cvi 5 index mul 4 1 roll
- 6 index div dup 0 lt {1 sub} if cvi 6 index mul 3 2 roll
-
- % Stack now: width height string y1 y2 x1 x2
- % Below is a doubly-nested for loop to iterate across this area
- % in units of the stipple pattern size, going up columns then
- % across rows, blasting out a stipple-pattern-sized rectangle at
- % each position
-
- 6 index exch {
- 2 index 5 index 3 index {
- % Stack now: width height string y1 y2 x y
-
- gsave
- 1 index exch translate
- 5 index 5 index true matrix tmpstip imagemask
- grestore
- } for
- pop
- } for
- pop pop pop pop pop
-} bind def
-
-
-/LS { % Stack: x1 y1 x2 y2
- newpath 4 2 roll moveto lineto stroke
-} def
-
-/EndText {
- %Stack :
- grestore
-} def
-
-/BeginText {
- %Stack : w h theta centerX centerY
- gsave
- % Translate the origin to the center of bounding box and rotate
- translate neg rotate
- % Translate back to the origin of the text region
- -0.5 mul exch -0.5 mul exch translate
-} def
-
-/DrawAdjText {
- %Stack : str strWidth x y
- moveto % Go to the text position
- exch dup dup 4 2 roll
-
- % Adjust character widths to get desired overall string width
- % adjust X = (desired width - real width)/#chars
-
- stringwidth pop sub exch
- length div
- 0 3 -1 roll
-
- % Flip back the scale so that the string is not drawn in reverse
-
- gsave
- 1 -1 scale
- ashow
- grestore
-} def
-
-/DrawBitmap {
- % Stack: ?bgColorProc? boolean centerX centerY width height theta imageStr
- gsave
- 6 -2 roll translate % Translate to center of bounding box
- 4 1 roll neg rotate % Rotate by theta
-
- % Find upperleft corner of bounding box
-
- 2 copy -.5 mul exch -.5 mul exch translate
- 2 copy scale % Make pixel unit scale
- newpath
- 0 0 moveto 0 1 lineto 1 1 lineto 1 0 lineto
- closepath
-
- % Fill rectangle with background color
-
- 4 -1 roll {
- gsave
- 4 -1 roll exec fill
- grestore
- } if
-
- % Paint the image string into the unit rectangle
-
- 2 copy true 3 -1 roll 0 0 5 -1 roll 0 0 6 array astore 5 -1 roll
- imagemask
- grestore
-}def
-
-% Symbols:
-
-% Skinny-cross
-/Sc {
- % Stack: x y symbolSize
- gsave
- 3 -2 roll translate 45 rotate
- 0 0 3 -1 roll Sp
- grestore
-} def
-
-% Skinny-plus
-/Sp {
- % Stack: x y symbolSize
- gsave
- 3 -2 roll translate
- 2 idiv
- dup 2 copy
- newpath neg 0 moveto 0 lineto
- DrawSymbolProc
- newpath neg 0 exch moveto 0 exch lineto
- DrawSymbolProc
- grestore
-} def
-
-% Cross
-/Cr {
- % Stack: x y symbolSize
- gsave
- 3 -2 roll translate 45 rotate
- 0 0 3 -1 roll Pl
- grestore
-} def
-
-% Plus
-/Pl {
- % Stack: x y symbolSize
- gsave
- 3 -2 roll translate
- dup 2 idiv
- exch 6 idiv
-
- %
- % 2 3 The plus/cross symbol is a
- % closed polygon of 12 points.
- % 0 1 4 5 The diagram to the left
- % x,y represents the positions of
- % 11 10 7 6 the points which are computed
- % below.
- % 9 8
- %
-
- newpath
- 2 copy exch neg exch neg moveto dup neg dup lineto
- 2 copy neg exch neg lineto 2 copy exch neg lineto
- dup dup neg lineto 2 copy neg lineto 2 copy lineto
- dup dup lineto 2 copy exch lineto 2 copy neg exch lineto
- dup dup neg exch lineto exch neg exch lineto
- closepath
- DrawSymbolProc
- grestore
-} def
-
-% Circle
-/Ci {
- % Stack: x y symbolSize
- 3 copy pop
- moveto newpath
- 2 div 0 360 arc
- closepath DrawSymbolProc
-} def
-
-% Square
-/Sq {
- % Stack: x y symbolSize
- dup dup 2 div dup
- 6 -1 roll exch sub exch
- 5 -1 roll exch sub 4 -2 roll Box
- DrawSymbolProc
-} def
-
-% Line
-/Li {
- % Stack: x y symbolSize
- 3 1 roll exch 3 -1 roll 2 div 3 copy
- newpath
- sub exch moveto add exch lineto
- stroke
-} def
-
-% Diamond
-/Di {
- % Stack: x y symbolSize
- gsave
- 3 1 roll translate 45 rotate 0 0 3 -1 roll Sq
- grestore
-} def
-
-% Triangle
-/Tr {
- % Stack: x y symbolSize
- gsave
- 3 -2 roll translate
- BaseRatio mul 0.5 mul % Calculate 1/2 base
- dup 0 exch 30 cos mul % h1 = height above center point
- neg % b2 0 -h1
- newpath moveto % point 1; b2
- dup 30 sin 30 cos div mul % h2 = height below center point
- 2 copy lineto % point 2; b2 h2
- exch neg exch lineto %
- closepath
- DrawSymbolProc
- grestore
-} def
-% Bitmap
-/Bm {
- % Stack: x y symbolSize
- gsave
- 3 1 roll translate pop DrawSymbolProc
- grestore
-} def
-
-%%BeginSetup
-gsave % Save the graphics state
-
-% Default line/text style parameters
-
-1 setlinewidth % width
-1 setlinejoin % join
-0 setlinecap % cap
-[] 0 setdash % dashes
-
-/CL 0 def % Set color level mode
-0 0 0 setrgbcolor % color
-
-% Transform coordinate system to use X11 coordinates
-
-% Flip the y-axis by changing the origin and reversing the scale,
-% making the origin the upper left corner
-0.600000 -0.600000 scale
-0 -1319 translate
-
-% User defined page layout
-
-%% Set color level
-/CL 2 def
-
-% Set origin
-120 173 translate
-
-% Landscape orientation
-0 972.127 translate
--90 rotate
-
-%% Set max aspect ratio
- 1.62292 1.62292 scale
-
-%%EndSetup
-
-14 /Helvetica-Bold SetFont
-0.996109 0.996109 0.996109 SetBgColor
-69 80 479 333 Box Fill
-
-gsave clip
-
-
-% Marker "bg" is a bitmap
-0.304692 0.929702 0.578134 SetBgColor
-newpath 79 90 moveto
-539 90 lineto
-539 404 lineto
-79 404 lineto
-79 90 lineto closepath Fill
-0 0.542977 0 SetFgColor
- gsave
- 79 404 translate
- 460 -314 scale
- 460 314 true [460 0 0 -314 0 314] { <000000000000000000000000000000000000000000000000000000000000
- 000000000000000000000000000000000000000000000000000000000000
- 000000000000000000000000000000000000000000000040000000000000
- 000000000000000000000000000000000000000000000000000000000000
- 000000000000000000000000000000000000000000400000000000000000
- 000000000000000000000000000000000000000000000000000000000000
- 002410000000000000000449010000000000002000000000000000000000
- 000000000000000000000000000000002000000000000000000800004A00
- 000000000000000220002002010200000080000000000008020000000000
- 00002000000000200000000000008000000420000000000800004A000000
- 000000000002200020020102000000800000000000080200000000000000
- 2000000000200000000000008000000420000100000000A1000000000000
- 001011010020881020280000020004000000088040000000000000110201
- 411020000000000000020200004000000000804090040020800000200001
- 00000002010008800000005110912ADEEFFDBFFFFFFFFEFDFFCAA9BA3EEF
- D72DF36ADDE5AAF400AA5504C00000008040900400208000002000010000
- 0002010008800000005110912ADEEFFDBFFFFFFFFEFDFFCAA9BA3EEFD72D
- F36ADDE5AAF400AA5504C000016D572D4E95599695514A02420404200000
- 000000000001000000000000000000000000000000244444001129550524
- 5525544BEF6DD6DF40000100000000000000000000000000000008100844
- 400840000100020808529B5FFFFFFFFFFFFFFFFFFFFFFCFFFFFFFFFFFFFF
- FFFFFFFFFFFF440001000000000000000000000000000000081008444008
- 40000100020808529B5FFFFFFFFFFFFFFFFFFFFFFCFFFFFFFFFFFFFFFFFF
- FFFFFFFF4400097FFFFFFFFFFFFFFFFFFFFFFFFF9FFFFFFFFFFFFFFFFFFF
- FFFFFFFFFFCDDDE0480A20004050C03101003DFBEFFFFDDFFF9FFFFEE57E
- FBBF40000177F5FFEBFFFFFFFFFFFDFFFFEF9D42D21485A084817EDE24F9
- 018006000004182060107019C63901071CFF5F7BEEAEB756F7D7EFF6EEBF
- 40000177F5FFEBFFFFFFFFFFFDFFFFEF9D42D21485A084817EDE24F90180
- 06000004182060107019C63901071CFF5F7BEEAEB756F7D7EFF6EEBF400001
- 5F6BE7DFBFFFFEFF736B7FFAD71C08C18C1060C70C1E0F83F86041C41FC1
- E61820761E790B071209831CD2FD6575BBFF4F9ABBB75EF7D54400017BEF
- D7F6DBF6FE77FDFEFFBFBF9E0CC14E1070B70C1C0F87FC7061B400E0B618
- 307E13FC07071B4D90FCEFEEDDDFFAEA4774EFEBBEDFF74000017BEFD7F6
- DBF6FE77FDFEFFBFBF9E0CC14E1070B70C1C0F87FC7061B400E0B618307E
- 13FC07071B4D90FCEFEEDDDFFAEA4774EFEBBEDFF74000015EDBD7B3FFAB
- FD7F777F72EDEF1E03C27E18703F00FD078FFC01E13C00411F10782E0B7F
- 03071F0F835CF6BF7EF5B5BCCED4B75DFA6FAF40002575F5B7D5BEABF53F
- FBEDBDFAF79E0BC96E1070B7083A078FFC60E1B68048B618381C1E7D8307
- 1E07839DEFF6EFB7FFFCCFEF7B76EC6FAF50002575F5B7D5BEABF53FFBED
- BDFAF79E0BC96E1070B7083A078FFC60E1B68048B618381C1E7D83071E07
- 839DEFF6EFB7FFFCCFEF7B76EC6FAF5000015FBB316BAD7D5D3EEAFF7FAB
- F51C0FC18C1060C70C33038C78204184F0C184093C381070C3C63E06121C
- B6DB3FADF5FDCBBFDFEDBD7FDF400001767D53A7F5FFFCBFB766EEDDB798
- 2300092BAA042200002268980056AFDF7FFFFFFFFFFFFFFFFFFFFFFCEFD5
- FFE5FFEDCD7E6B7D753F1B400001767D53A7F5FFFCBFB766EEDDB7982300
- 092BAA042200002268980056AFDF7FFFFFFFFFFFFFFFFFFFFFFCEFD5FFE5
- FFEDCD7E6B7D753F1B4000017B3B736BB7BB75BDDBDD6FD6FD9FFFFFFFFF
- FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCFFFFFFFFFFFB
- CADBFAEFFD7D1F44000166DDB3AD9EF5D59FFFFFFFFFFF95A6F524894091
- 20082524A4010100000000000000000000000000000200000000000FCDAF
- BF389A9D5F40000166DDB3AD9EF5D59FFFFFFFFFFF95A6F5248940912008
- 2524A4010100000000000000000000000000000200000000000FCDAFBF38
- 9A9D5F4000017EDCF37AA3FE699800000000000000000000000000000000
- 080000000000402000004201592D2AFF7FFDFBEF555B6D6BCF3DFBFC7B3A
- DF40000176EFBB8D3FEEBF13FFFFFFFFFB5EB6AB35A55A4AA54AD54AA954
- 0201000100001080000400000000000000000000008B8EFE94802EDFDF50
- 000176EFBB8D3FEEBF13FFFFFFFFFB5EB6AB35A55A4AA54AD54AA9540201
- 000100001080000400000000000000000000008B8EFE94802EDFDF500001
- 7ECEF40B5BFEBB9000000000000000000000000000000000000000000000
- 040100080000000000000200000000000093CCBA000200009F4000116E96
- F895877ECF9B010000000000000000000000000000004000000420442010
- 0000101000111200100000000000000B4BBF2DA7FAD3DF4100116E96F895
- 877ECF9B0100000000000000000000000000000040000004204420100000
- 101000111200100000000000000B4BBF2DA7FAD3DF4100017EC6F20EB5DF
- DAAA10420000000000200000041100000000280110000400000004000000
- 40400000000000002080841BCB973FFEFFFB1F4000016E56C1F902FAE790
- 400000000000200010048000004000088000000000000080002000200100
- 0840104412010100102B669F6FFDEFEB534400016E56C1F902FAE7904000
- 000000002000100480000040000880000000000000800020002001000840
- 104412010100102B669F6FFDEFEB53440001769203F7F97EE39400000400
- 000000804100220001000200004200200001000001824200A05436BFE55B
- 12E12810004BE72A6BD5FE5B7F4000057E8B27B7793EA3B0011251400502
- 94250A4808A4A05A000311291414DBFD17780452A90010021550B56A57C4
- B40400B77A9C57FCDFC9774000057E8B27B7793EA3B00112514005029425
- 0A4808A4A05A000311291414DBFD17780452A90010021550B56A57C4B404
- 00B77A9C57FCDFC9774000116AA04EDFBE1EA39D07FFFCF9F9A03CF3AF3D
- FFCF5CFD200CFFFF8C3F71C74474163071A071BD381874E3D78B1D1A004F
- FD1EF7D33EBCFF4000017F589FF3F78EB7B407733C70F9807833D61DFEC7
- 0D3CD00C73779D3BB8C73C301E397184307EBCD972E3C7972918006DF320
- E4A9FAB41B6400017F589FF3F78EB7B407733C70F9807833D61DFEC70D3C
- D00C73779D3BB8C73C301E397184307EBCD972E3C7972918006DF320E4A9
- FAB41B640001751ABA693D961BA006FB3D7272D83CA5C85DCEC72C3CF439
- 1A7B1E7330CF9DDB1CBAF290F91E397972EFE79754BD823B6833DB6EDE7F
- 1BC000216A8133F3D9C6B18400737C7272943965E2999EC70D7CF21D7A71
- 9E3399C31CB91C797110FA3E39B9B3E7C71F69DC40BDAA97F9F1065FDF40
- 00216A8133F3D9C6B18400737C7272943965E2999EC70D7CF21D7A719E33
- 99C31CB91C797110FA3E39B9B3E7C71F69DC40BDAA97F9F1065FDF400001
- 7BD272DBA57259A824F33DF2F290398AF0DD9ECF28BCF33F407B9E7728CA
- 1FC23CFC72993B2F3D19A1EBCFAF410E40CEF51F686A56FBBB4000017752
- F36AF9EA7985097B7C7276583BA470BC9ECF297CF11FF0F28F27B1D83FF3
- 3E797E10392F39BF8DEF978F658E60AD6918F9A006BD3F4000017752F36A
- F9EA7985097B7C7276583BA470BC9ECF297CF11FF0F28F27B1D83FF33E79
- 7E10392F39BF8DEF978F658E60AD6918F9A006BD3F4000017BA4EAF7A6F3
- 59AC01713D727610390A7C992E47657CFA0FFD7A872B12D96FFA3CBCF66B
- 1EC7B919B2E737AF569E206F2B3BCCE00E772F4000116AC9F5C02BB9BB18
- 02FA7C7272503926BCDDDE97223CF303F9724FAB3ACB81783CB97282BCA7
- B9B910E3C71F4C072055CB32FB000CFEB74800116AC9F5C02BB9BB1802FA
- 7C7272503926BCDDDE97223CF303F9724FAB3ACB81783CB97282BCA7B9B9
- 10E3C71F4C072055CB32FB000CFEB74800017FC9CD5EB5F9992C20F13CF2
- 784139247CBCAECF043C7120787917A709C008791E7972421CCFBD9934EB
- D7A744C79053C5B6FC4086DC5F4000017597EC803B5DDA9800F37D72F2C8
- 3D8A1D5D1E872E7CF216B8F2C3D3B0CBB399BCB973864E67391DF2EBCF97
- 319F9036AAF5D7880F74DF4000017597EC803B5DDA9800F37D72F2C83D8A
- 1D5D1E872E7CF216B8F2C3D3B0CBB399BCB973864E67391DF2EBCF97319F
- 9036AAF5D7880F74DF4000017FD3AB003EFAEA1528F23D717AC839265CB9
- 1ECF3CBCF31299795BCB9ACF18B89E79710AEE253D5971E7D79B29879019
- 5B64FBC016BD574000017B5B7C803BADE8B802FB3CF2F1C81C872CBDBE57
- 4E3CC519B8F945CF89CFBCE31673FE3F5F7A7AFD52D5E54DC6B14C0DE6DC
- 57E00F697F5000017B5B7C803BADE8B802FB3CF2F1C81C872CBDBE574E3C
- C519B8F945CF89CFBCE31673FE3F5F7A7AFD52D5E54DC6B14C0DE6DC57E0
- 0F697F5000016EC75A083ED648A842FC7FFBFBC42E8F867EBF5FBCFD8A3E
- 62FDD7F7EBEB1F4512C0210120060000000400120000080CA6F96DA08ED3
- 374000116B85A920BBF9F569020100000008003020800010008034000900
- 08000400100A0403148C12A9EFA5D7352B6C3F66EC04ABE6BDE00FBAFB40
- 00116B85A920BBF9F5690201000000080030208000100080340009000800
- 0400100A0403148C12A9EFA5D7352B6C3F66EC04ABE6BDE00FBAFB400001
- 7E86FC003F8ADD2809525402AA28082A22C94AA5A55494082C0089255A9D
- E8B40498EA83C2AA3555745AE6D95155560328C4B7600DFBDF4000017F17
- 37803D5B72D4006D2BF2B55405D15146C552A554D007D07EAAB96C965350
- 01502A01515515A54A55115420612021FECA6FC007504F4000017F173780
- 3D5B72D4006D2BF2B55405D15146C552A554D007D07EAAB96C9653500150
- 2A01515515A54A55115420612021FECA6FC007504F4000016B2FCB027CA6
- F6A00200000000000000000000000000000000000000000000000000002A
- 00000000000000000000000035C8B5E11CB59B4000017D16F64039096BB0
- 100000000000000000000000000000000000000000000000200000000000
- 000000000000040008403AB2B76007169B4400017D16F64039096BB01000
- 000000000000000000000000000000000000000000002000000000000000
- 00000000040008403AB2B76007169B4400017317F30033E0BA8200900000
- 000000000000000480000000040000000042000000014200000020000020
- 0000000400308AFC786014F2774000057615B5427B81EF90400200000000
- 000004000400010000000000000080080800040800011000841000040000
- 000000122CDE7D604EF2EF4000057615B5427B81EF904002000000000000
- 040004000100000000000000800808000408000110008410000400000000
- 00122CDE7D604EF2EF4000217B17D5083AC1650500800881000000000020
- 00002800000000800000008041110080000402120000010080040820007B
- 4FE27DE10CD2FF5000007627B740BBE6B690020020000900200000048024
- 8000004840040000080000000000021000000022102000400004204C86E2
- 35A00774CB4000007627B740BBE6B6900200200009002000000480248000
- 004840040000080000000000021000000022102000400004204C86E235A0
- 0774CB40000176137F003DF2D89680020000000000240000000000040400
- 09000000200200000000000000000000000000000000023BC76E7B6016D1
- F74400017C4BEB403DA0E001201000000000000044000000008000000000
- 0080800004800200000000000800000042000000002D496E3BC00F75EF40
- 00017C4BEB403DA0E0012010000000000000440000000080000000000080
- 800004800200000000000800000042000000002D496E3BC00F75EF400001
- 722BBA083F9A9F3A58000019501BE7C9F51A6F7842000000000800000081
- 2011284849104010000080040001208000075B5C35E00555DB5000016E0C
- A5413AAA67820880000358C245893D02EA71000254ABD441480000080000
- 00000000004001220240000402004000EDD73AE11E7B3F4000016E0CA541
- 3AAA67820880000358C245893D02EA71000254ABD4414800000800000000
- 0000004001220240000402004000EDD73AE11E7B3F4000017C2CD10031AA
- BD81480000840093548C6B002A7200020000000000000202555129520002
- 0000800008000000000000081ACC35A00C55B7540001721637003DD27312
- E010080050002000002000002000E3F27DDF8FFFFC7D374FD3A000000000
- 0000000210000002008407FE3DC006BB4F400001721637003DD27312E010
- 080050002000002000002000E3F27DDF8FFFFC7D374FD3A0000000000000
- 000210000002008407FE3DC006BB4F4000006C636D443DD96DE876000000
- 02000000000000028000CCF0595E3FFFFF1DD6AF85D00000000410000010
- 004000200202AB76736096B9FF4000017E055F003DFAF2915B0008810042
- 900204210A240800BF0FDBF9FFFFFFC7F8F93E9001104010008000000100
- 00000000CDDE7DE00CB93F4000017E055F003DFAF2915B00088100429002
- 04210A240800BF0FDBF9FFFFFFC7F8F93E90011040100080000001000000
- 0000CDDE7DE00CB93F4000016C286D013BBAA8FCBF206DA2475FB3E33E69
- C6B57848D7AFD763FFFFFFF179FCFED00000008000008000000408000000
- 36EA77400779CB5000016C93FB483DEAF653D5007184475D33CA284D47AD
- 2800FCCF3F9FFFFFFFFC5ED53BA000040000102004008000000400008BB6
- FBE096F9FF4000016C93FB483DEAF653D5007184475D33CA284D47AD2800
- FCCF3F9FFFFFFFFC5ED53BA000040000102004008000000400008BB6FBE0
- 96F9FF4000087C11F7023FF96878EB82558C451501231A6548A9A000C36F
- DD1FFFF4FFFF357560C09000080001008048000001000010077EDAA20EE8
- AF4400017EA8F10075BAE52C03004410A61933322405008A00003CCD78FF
- FA001FFF8F6C9E20010420010000000024400800100055DEFB6054FCFB50
- 00017EA8F10075BAE52C03004410A61933322405008A00003CCD78FFFA00
- 1FFF8F6C9E20010420010000000024400800100055DEFB6054FCFB500001
- 6612F7443342B4F90080000000000000000000000100C2ED79FF428443FF
- E1BD808000100004080104420004004000010B7EFC60067CDF4000017E18
- CB003BFAE62C0008000000000000008000000000016AD1FEB80008FFF1D7
- A000000020110000400010280004021066B6D4E096D4F74000017E18CB00
- 3BFAE62C0008000000000000008000000000016AD1FEB80008FFF1D7A000
- 000020110000400010280004021066B6D4E096D4F74000016A2DF6403E7B
- 64D81000009000000000100000400008805DC7FB0848241FFCFDA1E00000
- BC078BE7C27178EE3E0E82100AF4B36417BE6B4100216E1DBF023D2B65B8
- 4080000100000400000010000400A1678FF48000203FFCCFA23004104806
- 42E040984040222302114D6CEDC004DB774000216E1DBF023D2B65B84080
- 000100000400000010000400A1678FF48000203FFCCFA2300410480642E0
- 40984040222302114D6CEDC004DB774000053313AB003DD6EAB400080000
- 00400022200100080002905E3FF64A10081FFF75A5A84001220406008008
- 80400311021080D1570B51E72F4000017E93FC483FE54374000001000000
- 000000080000201040777FE50101225FFF3F855900002000462050004840
- 0202023089497E00007B3F4800017E93FC483FE543740000010000000000
- 00080000201040777FE50101225FFF3F8559000020004620500048400202
- 023089497E00007B3F480000771EBB803F93D5A800410004110040000020
- 00000004105CFFB8D4400803FF9CA2580020542181E0C018727E1C1E02E4
- 22DAABFFFFEA9B4000017F1DBE01366940B8000000400008000001000000
- 0082114CFF5A80002005FF8EA24800003C818362427128420E4B021082A2
- BFFFFFB59F4100017F1DBE01366940B80000004000080000010000000082
- 114CFF5A80002005FF8EA24800003C818362427128420E4B021082A2BFFF
- FFB59F4100017F57D1140F7B882810040200400000000008104002011973
- FD6A80488081FFE7A43000804004462040C0C002031142110757D7FFFFEF
- 5F4000006B1DD84015F7803000100004000001020000400200001157FAA8
- 100004447FF326000000220004104004C404001102118C26F5085B7DDF41
- 00006B1DD84015F7803000100004000001020000400200001157FAA81000
- 04447FF326000000220004104004C404001102118C26F5085B7DDF410011
- 7D1FEFFFFFF58020008000000000800000000000000012E7FD8D41442110
- 7FF98400000220004620C40080064313021158B3DBEAAB7F9F480041769F
- AFFFFF6B2100020004000420002002400000000412EFEAB2804118053FFC
- 96010800780783E750F870783C0C0211A0085D7DFEE63F400041769FAFFF
- FF6B2100020004000420002002400000000412EFEAB2804118053FFC9601
- 0800780783E750F870783C0C0211A0085D7DFEE63F400000BF8EF1AFE9EA
- 0000200000400000000020000000001030CFF142001042101FFC94000020
- 28050183F16810A81402000140069AB7B5607B400001728FD3F6B5DE0400
- 0000000000000000000000000000259F5414458000049EFE5A0000008000
- 0000000000000040080480082AECFEC9FF400001728FD3F6B5DE04000000
- 000000000000000000000000259F5414458000049EFE5A00000080000000
- 000000000040080480082AECFEC9FF4000007FC7B2B7ABD4000000020000
- 04000210000820080000159FD8A80048414007FE2A000000004008000002
- 02010000001004014ABBFE5BDF4900016BCBCDF5F3282010802002002001
- 20010000800040406B3FAC5489008100A7FFA90000820000A01000204008
- 1000000040408DDDDACF674000016BCBCDF5F32820108020020020012001
- 0000800040406B3FAC5489008100A7FFA90000820000A010002040081000
- 000040408DDDDACF674000013EC36BE7B9BA000002002010800400000000
- 02000200437FC8E9C2A80A9207FFA5002008000004001200002041200000
- 0004497CFEA7D74000007D8BCDB2D9580002000000800000000811000000
- 0800467F61340284500153FF978880000002000400000000000110100000
- 4D756EEFFB4400007D8BCDB2D95800020000008000000008110000000800
- 467F61340284500153FF9788800000020004000000000001101000004D75
- 6EEFFB4400016BD0BBF7AAF800000012000000080080000000000000D4FF
- D95483512A8009FF9A800000008358400004008521A0000080088EDB7AAF
- FF4000017743FED6FDB011001000040400400000000000082004ACFF689A
- 0884801533F7DA000000020950115A5544B81110000002408FEDAFCDB741
- 00017743FED6FDB011001000040400400000000000082004ACFF689A0884
- 801533F7DA000000020950115A5544B81110000002408FEDAFCDB7410000
- EAB937FBBB60400040000000000000080000000100000BFF55678A500502
- 89BFE9400102000186624321536011800202000067D57E9EDD4400117FED
- 7BF7F7E20004002020001200400004A2104000101BFEB2DD452048A451FF
- E54100001001A17BD8A0436835110820000477FDFE9BFF4000117FED7BF7
- F7E20004002020001200400004A2104000101BFEB2DD452048A451FFE541
- 00001001A17BD8A0436835110820000477FDFE9BFF400000B7ECAFD7CF80
- 0000010000408019812020000000040053FF5F575594200008FFE6801008
- 0000A1460A2CC35615882008292009EDF73D1F4000017B54A6F57B100000
- 080800020118C40200000000200053FD7CAAEB48891250FFF68000004000
- ADE2D314C6DEA4A00000800059FCDE7F5F4900017B54A6F57B1000000808
- 00020118C40200000000200053FD7CAAEB48891250FFF68000004000ADE2
- D314C6DEA4A00000800059FCDE7F5F4900017FD731F5DC00040240000100
- 15FFF800000800020120A7FFAD7716A1500128F77A600201001000000000
- 00000000000000042E7AFCFFDF400008AA931A13B90000080000200001ED
- 3C000200000000042FFDD55D899BC48408FFF84000040000800000000000
- 100000840000461533E69D400008AA931A13B90000080000200001ED3C00
- 0200000000042FFDD55D899BC48408FFF840000400008000000000001000
- 00840000461533E69D4000016DCBC0EE74004000008000003EF7FBCA2000
- 248001004FFF79F54E68FE53E87FF9501000000200040448200200800200
- 02085BCFC2FDCF4800007BD8A285A000000000040010776726C000000000
- 4002DFFD6C5557AA7A0FD57FFDA040100008050010008080040080000020
- 2FB31C6B5F4000007BD8A285A000000000040010776726C0000000004002
- DFFD6C5557AA7A0FD57FFDA0401000080500100080800400800000202FB3
- 1C6B5F4000017E9D717791100124800042026F671BA0004000040408DFF6
- F56B1AFD3D5CFC77FCA1010080201080D5015F7F7B7800000000BFE03C3B
- 8F400008BF55F9284010040011000807BFFFEADE040000000020BFED2C58
- 4D544F1A157FFE30000000000040040001000090000201007FED7D1E8F48
- 0008BF55F9284010040011000807BFFFEADE040000000020BFED2C584D54
- 4F1A157FFE30000000000040040001000090000201007FED7D1E8F480000
- FA5DD2823020200000110043EDF577FC000202000100BFEDF54E97FFDE9D
- B51FFE500C02090000201210120B40A00020000015E6FA3F4F4100003EFF
- BE103131800040000003F38CBD3C4108000020013FA614512D9E3697E83F
- BE50000080002000810124020010100000020A79F11B1B4000003EFFBE10
- 3131800040000003F38CBD3C4108000020013FA614512D9E3697E83FBE50
- 000080002000810124020010100000020A79F11B1B400001F9FDB3805030
- 40110000200366E537AA0000101000023FDD55069755374FB90FFF500010
- 200481000A0002014050400002280510EA1F1F40000037FB35FAB0198000
- F000001EDE7FF5DD9000000000207BAAD02C703C8B804897FF0800000111
- 0000014CC402011000003880875E695F1F40000037FB35FAB0198000F000
- 001EDE7FF5DD9000000000207BAAD02C703C8B804897FF08000001110000
- 014CC402011000003880875E695F1F400000BF593B6ED0080103F084008A
- 7FFF75F70000028102027FD75F270D4A4D92D6CFF7A8080200000004454D
- 5041042000023C0014897A1F5B400000B7F33AF0F00004271800440FED40
- 3725020008000000FFAD4096B228055089175FA8000848008002027FFF02
- 00000000E70003461D8E1B400000B7F33AF0F00004271800440FED403725
- 020008000000FFAD4096B228055089175FA8000848008002027FFF020000
- 0000E70003461D8E1B400010F5D33990910240000A0000199F00067F0800
- 00040004FFEEF87A6E20AA84454BFB9080800002001003E2D7E540110000
- 83004105DB2F5F4000013F735844F00000020800007FCC0007AAC0200000
- 2006FFFF5DDA99502AC4A935EF50080020050210139FFCE1401404200300
- 0945BA8D174900013F735844F00000020800007FCC0007AAC02000002006
- FFFF5DDA99502AC4A935EF50080020050210139FFCE14014042003000945
- BA8D17490000B1B11AD38000001078220173FC2023FC60009000000AFEFE
- B576BC844288047BBDD000010020800C1EF7A13E020000800E040082CBAE
- 3F4000017D335C6DC0104100FA001073F80201FDE0080212044AFBFFEEBA
- B7502A456A94F7D40020000500151DBBE7DE400000001C0092616F8EB740
- 00017D335C6DC0104100FA001073F80201FDE0080212044AFBFFEEBAB750
- 2A456A94F7D40020000500151DBBE7DE400000001C0092616F8EB7400000
- BE173BDF80800003C000003FF1F9E0FF01000000000AFFDFFEEEBF50118A
- 8ADBFFC0000012009112F36577D6008000047000005055A96F4000097F13
- 19AF9001040300410277F078F0BED0200000000ABFF77F7D4DA98A822BA5
- DFC8110040070014EFBE9EDBC40010106010106A678D3B4800097F1319AF
- 9001040300410277F078F0BED0200000000ABFF77F7D4DA98A822BA5DFC8
- 110040070014EFBE9EDBC40010106010106A678D3B480000BB5EBAD80200
- 2006020001DBC070F07F700000000002F7EFFFD696A4A584ABDDFFCA0004
- 00208002DD6FF3A600000000C040820C1A9D5F4000016F0F3BF400000026
- 000011E6E074F273780090004090FF7EFD95BED24A422BA5F7C80400020A
- 801796BBD8EBC0000040C00010270AAAEB4800016F0F3BF4000000260000
- 11E6E074F273780090004090FF7EFD95BED24A422BA5F7C80400020A8017
- 96BBD8EBC0000040C00010270AAAEB480000B64679E108000007F81040B5
- A078F01E500400020404FFFFF7E74BD08D895AF7BECA0000000A0113F77E
- FF3764800000FF020108E7B6DB400001FB3337DC209042002081006DC470
- F03BD10000080014F7ABFFF6BCD41FEAABB7FFEA2000200984164DEF6FD9
- 20008800008080807B1BFF400000AE1337B08000000080000075C070F03B
- B02000002014DEFFDFD7BF685BAC56FFFFEA0004024A0012FFBF3EFB6100
- 0001000004087DAB6F400000AE1337B08000000080000075C070F03BB020
- 00002014DEFFDFD7BF685BAC56FFFFEA0004024A0012FFBF3EFB61000001
- 000004087DAB6F400004BE675E3800000810020801F7C07F802A50000000
- 001DFFEAFFFCD5B497F2AB7FDFEA08000005801753044067D88000040220
- 1042F5B7D7400000FCBBFD3000100000000007E5C47F803BBC0000110014
- FBBFBFFFDEAA4BD236FFBDF28100400A8045365D813DD800008000820600
- 8EEFFB440000FCBBFD3000100000000007E5C47F803BBC0000110014FBBF
- BFFFDEAA4BD236FFBDF28100400A8045365D813DD8000080008206008EEF
- FB440001364AA86804010000082020BDE070F0AB10800440025DEEF6EBDE
- 9D6C88094FFEFFE204110015081BCE4BF01B32810200020087CB7ABFDF40
- 0000BE93724900000800800200BFC070F03BD0001000001DBFFFDEEE97B0
- 648234DFEDF208000044801F3C3FFC9DBC000000080005A95E7AD7400000
- BE93724900000800800200BFC070F03BD0001000001DBFFFDEEE97B06482
- 34DFEDF208000044801F3C3FFC9DBC000000080005A95E7AD7400000FE4D
- 58C0000000020080007DC078703BD1000008002BFFFFF5F7DFD1120D57FB
- FFF000000012800F5E68C317EA801000000807F0EE9E2B400020B695FAC8
- 000010080000003FE070701FD0010000882DFFEB7FAF795849028F7F9EF3
- 0000400500155E4EC21EDC000000204009A81DDC3F400020B695FAC80000
- 10080000003FE070701FD0010000882DFFEB7FAF795849028F7F9EF30000
- 400500155E4EC21EDC000000204009A81DDC3F400001BF5B51F000400100
- 090821F7A078727F78000040002BFDFFEEFD97557FFF4BFFF7B004010012
- 80155A35875EA6810008000006EAFFBDFF440000BB16F188110000000001
- 005FE470F07F7108000200ABF7FFBDD7FFAD00081FEEBFF10004000480B7
- BE56C49B770002008002046C74FA2B400000BB16F188110000000001005F
- E470F07F7108000200ABF7FFBDD7FFAD00081FEEBFF10004000480B7BE56
- C49B770002008002046C74FA2B400000BFBAB3D10000400000000077F070
- F0BE60002010002BFFBFFFEF7ED4810296FFF5F108100026821BB657CD9F
- D6000000090803366EEFDB400000B7D6D7C8000004208008007F39FBC07E
- 80000040022B7EF6EDB5D7E8B4525FFBDFB1000000950016FD53769F7500
- 20000020400E9BBF77400000B7D6D7C8000004208008007F39FBC07E8000
- 0040022B7EF6EDB5D7E8B4525FFBDFB1000000950016FD53769F75002000
- 0020400E9BBF77400000BFD34B98200800080121087AE9FF03E781000400
- 002BEFFFBBEDBDB44D0915EF7FF1000000048017BE6FB31B569000022000
- 054D1FDFFF400000BECB47D0010000000000006FBC0003BD60000000002B
- FFF7FFD5EFD4B2A45FFFF6F1010010130876EC1DD91FB70102080000018B
- D7FBCF400000BECB47D0010000000000006FBC0003BD60000000002BFFF7
- FFD5EFD4B2A45FFFF6F1010010130876EC1DD91FB70102080000018BD7FB
- CF400008FFDECED0000000001000007FBE00051FE0008008002AFDEEB4F6
- DEF949555FDDBFF110000004801DBE5BEC1D5F0000200000008BAEB53F40
- 0000B746B990000001080000021FE7000EDF00001020402BB7BFEFDB7BAC
- 5085BEFFFFF10000000B0097FA6F775F740000000810006AFEEAD3400000
- B746B990000001080000021FE7000EDF00001020402BB7BFEFDB7BAC5085
- BEFFFFF10000000B0097FA6F775F740000000810006AFEEAD3400000BFF6
- FCE8084020000042100F6F8014FF01000080012BFFFABBEADFFD2A0A7FFD
- DDF10000420A801FBCEEF51F7400080040009063EBB7FF400000BF16E190
- 00010000220000057EFFFB5300210000002BFFB7EFFB56F94589FD6FB7F1
- 0082002A8077B7999DDBD62020000084010ABE7817400000BF16E1900001
- 0000220000057EFFFB5300210000002BFFB7EFFB56F94589FD6FB7F10082
- 002A8077B7999DDBD62020000084010ABE7817400000B5D2DAD100000100
- 8000011FDE7FE9CD880000002022DEEB7BECDBFFEA0BF7FEFF710008000A
- 020E1F62A57E44010080000000077F726F400000FF6DF0D4010004240000
- 20556E7BB3EE208010010029FFFBFFFB5FEB6A97BDFFEFF1110000058815
- DEAED7B76880000900008041B6E5DB440000FF6DF0D40100042400002055
- 6E7BB3EE208010010029FFFBFFFB5FEB6A97BDFFEFF1110000058815DEAE
- D7B76880000900008041B6E5DB440000B598F2D00000000000480003E77B
- 3FF400004000012BFFDFFAF5D6FDFD2BEB77BDF10000000A001EFF926CFD
- EC000000020808086ED496400000F79AD1D00020000001000203E5FBAB3C
- 000100200429FDFBEFFEEFBFB7DEFFFD7FB100001081905DEB03B1DF7E00
- 1000402001006BA109400000F79AD1D00020000001000203E5FBAB3C0001
- 00200429FDFBEFFEEFBFB7DEFFFD7FB100001081905DEB03B1DF7E001000
- 402001006BA109400000B525F1900200408020000003FF3FD4DC00000001
- 002DFFDEFFFD19EFFDEFD9DFEDF202200002810B2F7FF232501040090000
- 0008344047410000B7DAF3D010000401000000027B39D5A000080000000D
- DFFBF5FADEF9FFDFFF7BBF600000020280153F48223B5011000001008080
- FE7C8F400000B7DAF3D010000401000000027B39D5A000080000000DDFFB
- F5FADEF9FFDFFF7BBF600000020280153F48223B5011000001008080FE7C
- 8F400000BFEDA1D000020008000000003FBD96C140200004022DFFEFFFEF
- 4DDFBF5EDDFFDBF200008009005DD77AACF75804000800000A0A73FFFF40
- 0000BDF6C39800000000020442103FFCFFC004000200001CFEEEEFBFB7F5
- F59BF7EDFEE2080000250207D580B0C3F8000020000200007DBDFF400000
- BDF6C39800000000020442103FFCFFC004000200001CFEEEEFBFB7F5F59B
- F7EDFEE2080000250207D580B0C3F8000020000200007DBDFF400000BBDB
- 55D00040100108100000017FCC00000000000015EFFBFDFF4B7EDE9FFEFF
- BFEA0000000080163EB4AFDE2030000004200004675F7D400000BFC707D0
- 0000012000000000013FC800000020000214BF57DFFFDDBBFA1FDBDEEFE2
- 2008000200137F7E7B3FC04000008000102A77B797400000BFC707D00000
- 012000000000013FC800000020000214BF57DFFFDDBBFA1FDBDEEFE22008
- 000200137F7E7B3FC04000008000102A77B797400000B48613D000000000
- 008000000119C000000000202814FDFFB7DF9FEFFC1FFF7BFFCA00000001
- 0007B77B2E76E050020423C24000EEFAAD400000BD1D4B91000080084000
- 088000100005000000808004EFE6FFFFCABAD05FB5FFFDCA000080800440
- DF4FF3FF00000800020000805D2F57400000BD1D4B910000800840000880
- 00100005000000808004EFE6FFFFCABAD05FB5FFFDCA000080800440DF4F
- F3FF00000800020000805D2F57400000B7991FD021080200101000000200
- 00000020420800047DFFFFFFEFFFA20FFFF7B7CA000008011000DDB157B5
- 41312001260000057ED5BF400000BF3FFFD0000000044001000088002040
- 088000000002F7AD597FFAB6804EFBBFFFC800800004801137EBFFF74090
- 0048040A94007EBEDD440000BF3FFFD00000000440010000880020400880
- 00000002F7AD597FFAB6804EFBBFFFC800800004801137EBFFF740900048
- 040A94007EBEDD440000BE9AB79408201000020020200000020020010000
- 004AFFDFEFEFEDED401BDEFEFFC01000010020403BEC45C640C00000222A
- A880FF7B8F400000BAD1DED000810110080400000000000200000000000A
- EEF7DFFF6350085E7BF7BFD00000400000205E6F773D41300002038A4804
- 2FDFFF440000BAD1DED000810110080400000000000200000000000AEEF7
- DFFF6350085E7BF7BFD00000400000205E6F773D41300002038A48042FDF
- FF440000BECF7DD000000001200000000008000000000002010AFFFCFFDB
- FFEC801F6EDFEF90400100002142573BD736400420000000000077DDD740
- 0004B9FB7B9000002004002002044000800000000008004AFFEFB5FFE528
- 097F7DFDFDB080040008060157EAA2EA2A40040020000021DABFBB400004
- B9FB7B9000002004002002044000800000000008004AFFEFB5FFE528097F
- 7DFDFDB080040008060157EAA2EA2A40040020000021DABFBB400000BBDF
- F5D00008000010800000000000000080008000A4FEEDFFFDEDA020B76BBF
- B7A1001000200000007FFF000000004200000106647EEF410000BDF7EB90
- 0900022002020810040000080004040000CCF7B7BFDFEAA142BFFEFFFFB9
- 008000800800004DF30000000008040804073EEDF7400000BDF7EB900900
- 022002020810040000080004040000CCF7B7BFDFEAA142BFFEFFFFB90080
- 00800800004DF30000000008040804073EEDF7400000BBDF55F100110007
- C018081C110927614160100000B07FFBFCFFFAA800FFDDF7BF8A82000001
- 001000088002000080404000000A79BFFB400000BDFDFA0E20002002E03C
- 3E14070387B040B0100002687FEEBFEFEAA80177A7DEEB29800000000840
- 8000800000200000002008081FFECF400000BDFDFA0E20002002E03C3E14
- 070387B040B0100002687FEEBFEFEAA80177A7DEEB298000000008408000
- 800000200000002008081FFECF400000BBF7E10080400004304232000C84
- C4013190900000AE3FEFEFFFE1100ADFF8FFFF4B20000000000000000008
- 00800000008200AE4BAFAB400000BEBFD548410002043062220488844401
- 31801000011A3FDBFFF6F0A82497A9FFFF19A00040082000002800002400
- 12220000010C0AF76F400000BEBFD5484100020430622204888444013180
- 1000011A3FDBFFF6F0A82497A9FFFF19A000400820000028000024001222
- 0000010C0AF76F400000BD7A23D130020006220632040004440031101202
- 01CE3EEFDFDBF40202D7ACBFFE5BE0220020020000000000000000000008
- 088774BBDB400000BF5F5B1C00008082700C2A040086C5C020E01F08014A
- 3FFFB97EBA24212FDACBFE71A200000000000000804000008000220001AD
- 68ED5F000000BF5F5B1C00008082700C2A040086C5C020E01F08014A3FFF
- B97EBA24212FDACBFE71A200000000000000804000008000220001AD68ED
- 5F000008BEB6B3C714121007A01C3A04070746206190100008C8BFBFFFFE
- FC13480DED7CBAB3A4000881002008000202000000040010086FFA153F40
- 0000BB8AFD3FE1000004300223040C0860303182102021ECCEEDCF77DF54
- 4243F4EF7CA190002208208100020000024408400090373A1E4797440000
- BB8AFD3FE1000004300223040C0860303182102021ECCEEDCF77DF544243
- F4EF7CA190002208208100020000024408400090373A1E4797440000B6D6
- 6803F108012430026100080420303108100005E95FF7BDFF7E25210AF6BD
- ADABA800002004000000000000000002882846300662BB400000BBCBB3D8
- 3C902006B16622042804406331B0500001724DFFF7BFAF138015F7F7795A
- AC0420008001000000401000020801004E67F03B6F400000BBCBB3D83C90
- 2006B16622042804406331B0500001724DFFF7BFAF138015F7F7795AAC04
- 20008001000000401000020801004E67F03B6F400000AF5FC5543E000007
- 60FA3E1F9786C7C1B1E0100005722FCF7FDFFF19088EFD5FA84360008200
- 000000100000000010000050DE8FFCF99D000000BF8F89BFBE6120810008
- 08100A038500000000010AD7A7DBBF7F7FC982417F75F2F3880000221000
- 040020000080000022103E1C8C7CEB400000BF8F89BFBE61208100080810
- 0A038500000000010AD7A7DBBF7F7FC982417F75F2F38800002210000400
- 20000080000022103E1C8C7CEB400000BF5A3AAD17A00410000000000000
- 0000000000200252B37FFDF7DBD1494B7BAF66D320800080002010010204
- 0010421200A03E677A7EBF400000BD8223F48F9080000000000000000000
- 000000000074D3EFD7DFEF89CA08BB7EE5F3320020000000004000000401
- 0080890074CFED973B000000BD8223F48F90800000000000000000000000
- 00000074D3EFD7DFEF89CA08BB7EE5F33200200000000040000004010080
- 890074CFED973B000000AE3CF90545D08000000000010010000000004000
- 013A43FA7EBF7FA16B52B9DBE5B6A80800040404000000201000040000C0
- F9D8159D3B400000B73C9607B7680008000000000000000010010401088D
- C9EFADDF9FCD54942DEF49F54020BFFD800000040000000000122420E8E8
- 1BC397400000B73C9607B7680008000000000000000010010401088DC9EF
- ADDF9FCD54942DEF49F54020BFFD800000040000000000122420E8E81BC3
- 97400000BA79A80EB3601500208300805000401000800044017E74BFFFF7
- FFD4C094ADBF9373D2003DCD8000800000000100080002C2F3301D679308
- 0000AE69D807A9E00000800C0807F800008902000000409554FFF7BDFFEA
- 554A7FFB17FD55922968240000004004002020A08902B5E01FA757400000
- AE69D807A9E00000800C0807F800008902000000409554FFF7BDFFEA554A
- 7FFB17FD55922968240000004004002020A08902B5E01FA757400000BAF2
- F80DF179001000103009000C003E083C20006F2FB36EDDEFDBEBB6115CDF
- A6AB5E000000008001C000004C0000060285E6E01AB3DF000000BCF3780E
- B9F0010D00320002001C003B10360009AAA3FB7FFFFBFFF5534277F7AEF7
- 72800336804012500020480600102B05A7501EF2DF400000BCF3780EB9F0
- 010D00320002001C003B10360009AAA3FB7FFFFBFFF5534277F7AEF77280
- 0336804012500020480600102B05A7501EF2DF400000BCC2B44D55B8103F
- 8204001910181212042004204FF87CB76DDFD7FB54485DFF0FB3E88002C6
- 120024100020480400000F45CDE89DCB9B000000BCF7BC076CE80031C045
- 04113113C8656E68800125D43C9FF77F7EF4905076BE1EE1B10443A40000
- 04100028FE0000002FC546D01EBB5F480000BCF7BC076CE80031C0450411
- 3113C8656E68800125D43C9FF77F7EF4905076BE1EE1B10443A400000410
- 0028FE0000002FC546D01EBB5F480000B4C5680FF4D90020C0DD140257EE
- 50C9C1D9B08457F4EE8FFFFEFFDBAD41AFFA3D0FE7920324200004165678
- 69E1B10112418DD81DE9D7000004BCC5688D2CB82202C073D8027B30F103
- 4272E011BA7E774F7FF7FDF54C40DDFCB15D5FA800400004065AD4B0594A
- D2004553CF601C599F480004BCC5688D2CB82202C073D8027B30F1034272
- E011BA7E774F7FF7FDF54C40DDFCB15D5FA800400004065AD4B0594AD200
- 4553CF601C599F480000BDADF427F6E80029C00104100500000800000005
- E9D23F2FDDBFB7F9A288AD79BF2ED0DD10C004004393772C49F49DC02948
- 49A81AE98F000000BD8EEC0DBE78081F00030000120200000000022226BD
- 1D87FFFEFFFCB081AB726DD9FD0481E1100440000000000000054BCBCFE8
- 9FDD6F400000BD8EEC0DBE78081F00030000120200000000022226BD1D87
- FFFEFFFCB081AB726DD9FD0481E1100440000000000000054BCBCFE89FDD
- 6F400000BD6BD8273668203C10010100960000000000801D5AE5CFD3D7DF
- EFFF835696E67F72522B00A0004000008000040000002F8A5DA81EF5CB08
- 0000B9CCEC8FBA7080B0400400000800000831000021A42B7369FDF7FBFD
- 6D165DC9A9D571A8404406810000020100002000980A8FB81A596F400000
- B9CCEC8FBA7080B0400400000800000831000021A42B7369FDF7FBFD6D16
- 5DC9A9D571A8404406810000020100002000980A8FB81A596F4000083D4F
- EC0EEE5810240080082038040000480820008186FDE8FF7FCFFDAC8A5589
- EFAABCA90000296001020000201000142402DDA05EFDCF400000BDADEC0D
- B6F082380000000000000101040080057F7A6DACEFF77800030557CDF6DF
- BFF4109083E00010002000810040900A4F981CD54D000000BDADEC0DB6F0
- 82380000000000000101040080057F7A6DACEFF77800030557CDF6DFBFF4
- 109083E00010002000810040900A4F981CD54D000020BD4F6847FA7A003F
- C01040020000001070200225FFBEBEE8FFBFCE837C7255E6FFF6EB5BEFEF
- 7F5020402003100000022AC2CBE81FD9EF400000B5C5EC0DAED008011248
- 0100082062011C040000000000030DF0A2A970536C1100495495595AAB51
- 2200038204802200DFC94EB11EEB5B000000B5C5EC0DAED0080112480100
- 082062011C040000000000030DF0A2A970536C1100495495595AAB512200
- 038204802200DFC94EB11EEB5B000000AC86700E6CB800A4001004028401
- 42005F7BFDBFB7F6F7F367AB4E000494AF99FFBFBBBF77FFBC700A6F91D2
- B4F0000900024BD819B9DD48000034D7B806D5D2400020AE61532A3E19C1
- 200000000000000794843FFFFF8C117C000000009120A2A03150A2455300
- 000850850CE05FDB5B40000034D7B806D5D2400020AE61532A3E19C12000
- 00000000000794843FFFFF8C117C000000009120A2A03150A24553000008
- 50850CE05FDB5B400000AAD2F04DD9A80000005256A0C4124511BFFFFFFF
- FFFFFFFF2D07FFFFFFFC2CFFFFFFFFFFFFFFFF2400010000002022220215
- 67E81A731F400010BED37806E9D84404888000000000000E5FFFFFFFFFFF
- FFFF9C7FFDFFFFFFAC7FFFFFFFFFFFFFFED40200000000208004A0056660
- 1BB3DF400010BED37806E9D84404888000000000000E5FFFFFFFFFFFFFFF
- 9C7FFDFFFFFFAC7FFFFFFFFFFFFFFED40200000000208004A00566601BB3
- DF400000BBABD805B920108800100000000000053FFFFFFFFFFFFFFEBFFF
- D54800FFFFF9FFFFFFFFFFFFFD25844250840002846B10A237B10EE60300
- 0000AF494100A351400000000080000000450FFFFFFFFFFFFFFF55DFADAB
- FD0FFDE52DFFFFFFFFFFFD46302B56337B7428B4EE2A55C023A75F400000
- AF494100A351400000000080000000450FFFFFFFFFFFFFFF55DFADABFD0F
- FDE52DFFFFFFFFFFFD46302B56337B7428B4EE2A55C023A75F4000003F4C
- FFFFD6AB39B5BB9ABD735335A695792A001001000000F80006A040C001A0
- 038903400006890112AD50A92526955BA4B4B37FFEE5BF480000B334AFFF
- 164A952DA92C4654122AD2A516A41C1801C200008C0307A0E07007F007FE
- 03B00403AEA4A55D6AA41864B4F7CAB488DFFE4EAB400000B334AFFF164A
- 952DA92C4654122AD2A516A41C1801C200008C0307A0E07007F007FE03B0
- 0403AEA4A55D6AA41864B4F7CAB488DFFE4EAB400000B7A2736B8D365A0C
- 22D65DEB5AA537545B601E0600F700E0EA438180E01807F80FE801FC0603
- D276DF6BF77BEFA76AACAF4ADDE7FB9937400008BE971AE9CD5BFDFBFBBB
- 6EB3DDBEFB5B2FA01E07007700E0F4078980E0180F681FFA10DC0411ED65
- 000000000000000040115457461C4F000008BE971AE9CD5BFDFBFBBB6EB3
- DDBEFB5B2FA01E07007700E0F4078980E0180F681FFA10DC0411ED650000
- 00000000000040115457461C4F0000002FD1956F18200000000000000000
- 0008EEC01E074037008FF4038080E0100D901E8580F40C07CA98FFFFFFFF
- FFFFFFFFFFFF0E2DAA72DD410000BE52C7AE317FFFFFFFFFFFFFFFFFFFAF
- 55A21E076007208FDA038080E0380F181B598074004FE9FE3A6FB0D72BFF
- BBFFDFFFB18EACC4F7400000BE52C7AE317FFFFFFFFFFFFFFFFFFFAF55A2
- 1E076007208FDA038080E0380F181B598074004FE9FE3A6FB0D72BFFBBFF
- DFFFB18EACC4F7400000BA68E358627FF7FBDBDFFFFFED7DDF5D6BA01C07
- 620600CE75238080F0188E981F9B84781407ABA75FFFE55FBDFBEF7F4BF6
- CB8BB8E9AF400000AEE638018AF3FAAFFAFEF3AF6AEFF6B7E7C05E077007
- 00E8D4839384E0180E180E1B803C0C07AAFB3F7773BB5577BDFF4FF7A460
- 0313E7400000AEE638018AF3FAAFFAFEF3AF6AEFF6B7E7C05E07700700E8
- D4839384E0180E180E1B803C0C07AAFB3F7773BB5577BDFF4FF7A4600313
- E7400000BDF29C0785BB753EBBDBDF7B6D5D563EF5E01E46380700E0F603
- 81C0E0301C181E1BC0384483ADA55E3BF4F6FFACEB7EB6FFF5784EA7DB40
- 000025BD27FE1BF5FCDFD9F77BEFCAFB39776F401C1E2C0704C0E80303C0
- C0600810081180300403B3EB231BE75F5577DEBB676EA90F7A8FF7400000
- 25BD27FE1BF5FCDFD9F77BEFCAFB39776F401C1E2C0704C0E80303C0C060
- 0810081180300403B3EB231BE75F5577DEBB676EA90F7A8FF7400000BFFC
- 81F0177BDDB7FEEFD7B5B57E3AB5ABEC1C1C0A061000F00217F041C00000
- 0000010103045DF75A37B6BDFBF77EFCABDEE8A6B41DEF000000B3573202
- 8DB5F555ADBDFBE75E76D03157B7EBFFFDFFFFFFDFFFFFDFFFFFFFFFFFFF
- FFFFFFFFD2D54D9DEF7D6D77D79D7DEB9E004877B7440000B35732028DB5
- F555ADBDFBE75E76D03157B7EBFFFDFFFFFFDFFFFFDFFFFFFFFFFFFFFFFF
- FFFFD2D54D9DEF7D6D77D79D7DEB9E004877B7440000BDDD18009AEEF9AF
- F5FEF7F7B57B4D3D6FCFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFFFF
- FD76A335C74F7AF7DEEB66AFEF00A0DECB400000BB7BE3FC6EDF675B6F79
- DDDE9FAE24571EEBFFFFFF7FFFFFF7FFFFB7FF5FFFFFFFFFFFFFFFFFE5D7
- 8E7EB7B97FFBFDB6BDFEFFF057FEFF000000BB7BE3FC6EDF675B6F79DDDE
- 9FAE24571EEBFFFFFF7FFFFFF7FFFFB7FF5FFFFFFFFFFFFFFFFFE5D78E7E
- B7B97FFBFDB6BDFEFFF057FEFF0000009DEFF803BFBDBBBDFB7F7F77FFFF
- FFFEFBAAFFE9FBBFFFFFD9FFFEDB7DDFFFFFDDF7FFBDA9552502AA454292
- 45102050804000048800004000083FFFFF5FFFFFFFFFFFFFFDFEF6AAD2AB
- 2CA504142440000000000000000000000000000000000000000000000000
- 0000020000000000804800083FFFFF5FFFFFFFFFFFFFFDFEF6AAD2AB2CA5
- 041424400000000000000000000000000000000000000000000000000000
- 0200000000008048000080000000000000000000000000211224134AEAB7
- ABBEFFFFFFFFFFFFFFFBFFFFFFFFED77FFBFFFFFFFFFFFFFFFFFFFFFFFFF
- FFFFF08400000000A48D53EDB6EFFFFFFFFFFFF7FFDEFDB56D4AAA54A080
- 000000000000000000000000000000000000000000000000000000000000
- 020000900000A48D53EDB6EFFFFFFFFFFFF7FFDEFDB56D4AAA54A0800000
- 000000000000000000000000000000000000000000000000000000000200
- 009000000000000000000000000000000000000000000000001000000000
- 000000000000000000000000000000000000000000000800040000800000
- 000000000000000000000000000000000000000000000000100000000000
- 000000000000000000000000000000100000004400948000100200400000
- 000000000000000000000000000000000000000000001000000000000000
- 000000000000000000000000001000000044009480001002004000000100
- 800000000000000000000000000000000000040040880000000000000000
- 000000000010100000000000000000004000000040000200000004000000
- 000000008000000000000000000000000008000084200000000000000002
- 088401008000800004000002200004000020000040000000040000000000
- 000080000000000000000000000000080000842000000000000000020884
- 010080008000040000022000040000200000400000000000000004400000
- 000000000000000002080008000000000000000000000000000000000002
- 000004010000000000000000000100010000000010000000000000000001
- 444000020000000000002000002200000000000000000000000020200000
- 000400040010001080000000000400100000100000000000000000014440
- 000200000000000020000022000000000000000000000000202000000004
- 000400100010800000000004001000000008910800000000000000000000
- 000010002000002000800820880000000000020010080200000000000010
- 0080000000000400001000000024810000000000800A0084000042000001
- 008000800100420000020000000011000810802000480002010000400400
- 040020001000000004000024810000000000800A00840000420000010080
- 008001004200000200000000110008108020004800020100004004000400
- 200010000000040000000000000000000000000000000000000000000000
- 000000000000000000000000000000000000000000000000000000000000
- 000000000000000000000000000000000000000000000000000000000000
- 000000000000000000000000000000000000000000000000000000000000
- 000000000000000000000000000000000000000000000000000000000000
- 000000000000000000000000000000000000000000000000000000000000
- 000000000000000000000000000000000000000000000000000000000000
- 000000000000000000000000000000000000000000000000000000000000
- 00>
- } imagemask
-grestore
-0.500008 0.500008 0.500008 SetBgColor
-421 154 121 2 Box Fill
-
-540 86 2 70 Box Fill
-
-0.750011 0.750011 0.750011 SetBgColor
-newpath 421 156 moveto
-421 86 lineto
-542 86 lineto
-540 88 lineto
-423 88 lineto
-423 154 lineto
-421 156 lineto
-421 156 lineto closepath Fill
-0 setlinejoin
-0 setlinecap
-0 0 0 SetFgColor
-3 setlinewidth
-[ ] 0 setdash
-448 102 42 Li
-1 setlinewidth
-[ ] 0 setdash
-
-/DrawSymbolProc {
- gsave
- 0.996109 0.644541 0 SetBgColor
- Fill
- 0 0 0 SetFgColor
- stroke
- grestore
-} def
-
-448 102 21 Ci
-58 27 0 502 104 BeginText
-14 /Helvetica SetFont
-0 0 0 SetFgColor
-(sin\(x\)) 58 0 21 DrawAdjText
-EndText
-0 setlinejoin
-0 setlinecap
-0.542977 0.542977 0 SetFgColor
-3 setlinewidth
-[ ] 0 setdash
-448 135 42 Li
-1 setlinewidth
-[ ] 0 setdash
-
-/DrawSymbolProc {
- gsave
- 0.996109 0.996109 0 SetBgColor
- Fill
- 0.542977 0.542977 0 SetFgColor
- stroke
- grestore
-} def
-
-448 135 21 Ci
-64 27 0 505 137 BeginText
-14 /Helvetica SetFont
-0 0 0 SetFgColor
-(cos\(x\)) 64 0 21 DrawAdjText
-EndText
-24 16 90 537 388 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(360) 24 0 12 DrawAdjText
-EndText
-32 16 90 79 384 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(-360) 32 0 12 DrawAdjText
-EndText
-8 16 0 85 90 BeginText
-8 /CourierNewBold-Bold SetFont
-0.566415 0.171878 0.929702 SetFgColor
-(1) 8 0 12 DrawAdjText
-EndText
-16 16 0 89 402 BeginText
-8 /CourierNewBold-Bold SetFont
-0.566415 0.171878 0.929702 SetFgColor
-(-1) 16 0 12 DrawAdjText
-EndText
-8 16 90 537 364 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(1) 8 0 12 DrawAdjText
-EndText
-8 16 90 79 356 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(0) 8 0 12 DrawAdjText
-EndText
-8 16 0 101 90 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(1) 8 0 12 DrawAdjText
-EndText
-8 16 0 109 402 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(0) 8 0 12 DrawAdjText
-EndText
-
-% Element "line2"
-
-0 setlinejoin
-0 setlinecap
-0.542977 0.542977 0 SetFgColor
-1 setlinewidth
-[ ] 0 setdash
-/DashesProc {} def
- newpath 79 90 moveto
- 82 90 lineto
- 85 92 lineto
- 88 95 lineto
- 91 99 lineto
- 94 104 lineto
- 98 110 lineto
- 101 118 lineto
- 104 126 lineto
- 107 135 lineto
- 110 145 lineto
- 114 156 lineto
- 117 168 lineto
- 120 180 lineto
- 123 192 lineto
- 126 205 lineto
- 130 219 lineto
- 133 232 lineto
- 136 246 lineto
- 139 260 lineto
- 142 273 lineto
- 145 287 lineto
- 149 300 lineto
- 152 312 lineto
- 155 324 lineto
- 158 336 lineto
- 161 347 lineto
- 165 357 lineto
- 168 366 lineto
- 171 374 lineto
- 174 382 lineto
- 177 388 lineto
- 181 393 lineto
- 184 397 lineto
- 187 400 lineto
- 190 402 lineto
- 193 403 lineto
- 196 402 lineto
- 200 400 lineto
- 203 397 lineto
- 206 393 lineto
- 209 388 lineto
- 212 382 lineto
- 216 374 lineto
- 219 366 lineto
- 222 357 lineto
- 225 347 lineto
- 228 336 lineto
- 232 324 lineto
- 235 312 lineto
- 238 300 lineto
- 241 287 lineto
- 244 273 lineto
- 247 260 lineto
- 251 246 lineto
- 254 232 lineto
- 257 219 lineto
- 260 205 lineto
- 263 192 lineto
- 267 180 lineto
- 270 168 lineto
- 273 156 lineto
- 276 145 lineto
- 279 135 lineto
- 283 126 lineto
- 286 118 lineto
- 289 110 lineto
- 292 104 lineto
- 295 99 lineto
- 298 95 lineto
- 302 92 lineto
- 305 90 lineto
- 308 90 lineto
- 311 90 lineto
- 314 92 lineto
- 318 95 lineto
- 321 99 lineto
- 324 104 lineto
- 327 110 lineto
- 330 118 lineto
- 334 126 lineto
- 337 135 lineto
- 340 145 lineto
- 343 156 lineto
- 346 168 lineto
- 349 180 lineto
- 353 192 lineto
- 356 205 lineto
- 359 219 lineto
- 362 232 lineto
- 365 246 lineto
- 369 260 lineto
- 372 273 lineto
- 375 287 lineto
- 378 300 lineto
- 381 312 lineto
- 385 324 lineto
- 388 336 lineto
- 391 347 lineto
- 394 357 lineto
- 397 366 lineto
- 400 374 lineto
- 404 382 lineto
- 407 388 lineto
- 410 393 lineto
- 413 397 lineto
- 416 400 lineto
- 420 402 lineto
- 423 403 lineto
- 426 402 lineto
- 429 400 lineto
- 432 397 lineto
- 436 393 lineto
- 439 388 lineto
- 442 382 lineto
- 445 374 lineto
- 448 366 lineto
- 451 357 lineto
- 455 347 lineto
- 458 336 lineto
- 461 324 lineto
- 464 312 lineto
- 467 300 lineto
- 471 287 lineto
- 474 273 lineto
- 477 260 lineto
- 480 246 lineto
- 483 232 lineto
- 487 219 lineto
- 490 205 lineto
- 493 192 lineto
- 496 180 lineto
- 499 168 lineto
- 502 156 lineto
- 506 145 lineto
- 509 135 lineto
- 512 126 lineto
- 515 118 lineto
- 518 110 lineto
- 522 104 lineto
- 525 99 lineto
- 528 95 lineto
- 531 92 lineto
- 534 90 lineto
- 538 90 lineto
-DashesProc stroke
-1 setlinewidth
-[ ] 0 setdash
-
-/DrawSymbolProc {
- gsave
- 0.996109 0.996109 0 SetBgColor
- Fill
- 0.542977 0.542977 0 SetFgColor
- stroke
- grestore
-} def
-
-79 90 9 Ci
-82 90 9 Ci
-85 92 9 Ci
-88 95 9 Ci
-91 99 9 Ci
-94 104 9 Ci
-98 110 9 Ci
-101 118 9 Ci
-104 126 9 Ci
-107 135 9 Ci
-110 145 9 Ci
-114 156 9 Ci
-117 168 9 Ci
-120 180 9 Ci
-123 192 9 Ci
-126 205 9 Ci
-130 219 9 Ci
-133 232 9 Ci
-136 246 9 Ci
-139 260 9 Ci
-142 273 9 Ci
-145 287 9 Ci
-149 300 9 Ci
-152 312 9 Ci
-155 324 9 Ci
-158 336 9 Ci
-161 347 9 Ci
-165 357 9 Ci
-168 366 9 Ci
-171 374 9 Ci
-174 382 9 Ci
-177 388 9 Ci
-181 393 9 Ci
-184 397 9 Ci
-187 400 9 Ci
-190 402 9 Ci
-193 403 9 Ci
-196 402 9 Ci
-200 400 9 Ci
-203 397 9 Ci
-206 393 9 Ci
-209 388 9 Ci
-212 382 9 Ci
-216 374 9 Ci
-219 366 9 Ci
-222 357 9 Ci
-225 347 9 Ci
-228 336 9 Ci
-232 324 9 Ci
-235 312 9 Ci
-238 300 9 Ci
-241 287 9 Ci
-244 273 9 Ci
-247 260 9 Ci
-251 246 9 Ci
-254 232 9 Ci
-257 219 9 Ci
-260 205 9 Ci
-263 192 9 Ci
-267 180 9 Ci
-270 168 9 Ci
-273 156 9 Ci
-276 145 9 Ci
-279 135 9 Ci
-283 126 9 Ci
-286 118 9 Ci
-289 110 9 Ci
-292 104 9 Ci
-295 99 9 Ci
-298 95 9 Ci
-302 92 9 Ci
-305 90 9 Ci
-308 90 9 Ci
-311 90 9 Ci
-314 92 9 Ci
-318 95 9 Ci
-321 99 9 Ci
-324 104 9 Ci
-327 110 9 Ci
-330 118 9 Ci
-334 126 9 Ci
-337 135 9 Ci
-340 145 9 Ci
-343 156 9 Ci
-346 168 9 Ci
-349 180 9 Ci
-353 192 9 Ci
-356 205 9 Ci
-359 219 9 Ci
-362 232 9 Ci
-365 246 9 Ci
-369 260 9 Ci
-372 273 9 Ci
-375 287 9 Ci
-378 300 9 Ci
-381 312 9 Ci
-385 324 9 Ci
-388 336 9 Ci
-391 347 9 Ci
-394 357 9 Ci
-397 366 9 Ci
-400 374 9 Ci
-404 382 9 Ci
-407 388 9 Ci
-410 393 9 Ci
-413 397 9 Ci
-416 400 9 Ci
-420 402 9 Ci
-423 403 9 Ci
-426 402 9 Ci
-429 400 9 Ci
-432 397 9 Ci
-436 393 9 Ci
-439 388 9 Ci
-442 382 9 Ci
-445 374 9 Ci
-448 366 9 Ci
-451 357 9 Ci
-455 347 9 Ci
-458 336 9 Ci
-461 324 9 Ci
-464 312 9 Ci
-467 300 9 Ci
-471 287 9 Ci
-474 273 9 Ci
-477 260 9 Ci
-480 246 9 Ci
-483 232 9 Ci
-487 219 9 Ci
-490 205 9 Ci
-493 192 9 Ci
-496 180 9 Ci
-499 168 9 Ci
-502 156 9 Ci
-506 145 9 Ci
-509 135 9 Ci
-512 126 9 Ci
-515 118 9 Ci
-518 110 9 Ci
-522 104 9 Ci
-525 99 9 Ci
-528 95 9 Ci
-531 92 9 Ci
-534 90 9 Ci
-538 90 9 Ci
-
-% Element "line1"
-
-0 setlinejoin
-0 setlinecap
-0 0 0 SetFgColor
-1 setlinewidth
-[ ] 0 setdash
-/DashesProc {} def
- newpath 79 246 moveto
- 82 232 lineto
- 85 219 lineto
- 88 205 lineto
- 91 192 lineto
- 94 180 lineto
- 98 168 lineto
- 101 156 lineto
- 104 145 lineto
- 107 135 lineto
- 110 126 lineto
- 114 118 lineto
- 117 110 lineto
- 120 104 lineto
- 123 99 lineto
- 126 95 lineto
- 130 92 lineto
- 133 90 lineto
- 136 90 lineto
- 139 90 lineto
- 142 92 lineto
- 145 95 lineto
- 149 99 lineto
- 152 104 lineto
- 155 110 lineto
- 158 118 lineto
- 161 126 lineto
- 165 135 lineto
- 168 145 lineto
- 171 156 lineto
- 174 168 lineto
- 177 180 lineto
- 181 192 lineto
- 184 205 lineto
- 187 219 lineto
- 190 232 lineto
- 193 246 lineto
- 196 260 lineto
- 200 273 lineto
- 203 287 lineto
- 206 300 lineto
- 209 312 lineto
- 212 324 lineto
- 216 336 lineto
- 219 347 lineto
- 222 357 lineto
- 225 366 lineto
- 228 374 lineto
- 232 382 lineto
- 235 388 lineto
- 238 393 lineto
- 241 397 lineto
- 244 400 lineto
- 247 402 lineto
- 251 403 lineto
- 254 402 lineto
- 257 400 lineto
- 260 397 lineto
- 263 393 lineto
- 267 388 lineto
- 270 382 lineto
- 273 374 lineto
- 276 366 lineto
- 279 357 lineto
- 283 347 lineto
- 286 336 lineto
- 289 324 lineto
- 292 312 lineto
- 295 300 lineto
- 298 287 lineto
- 302 273 lineto
- 305 260 lineto
- 308 246 lineto
- 311 232 lineto
- 314 219 lineto
- 318 205 lineto
- 321 192 lineto
- 324 180 lineto
- 327 168 lineto
- 330 156 lineto
- 334 145 lineto
- 337 135 lineto
- 340 126 lineto
- 343 118 lineto
- 346 110 lineto
- 349 104 lineto
- 353 99 lineto
- 356 95 lineto
- 359 92 lineto
- 362 90 lineto
- 365 90 lineto
- 369 90 lineto
- 372 92 lineto
- 375 95 lineto
- 378 99 lineto
- 381 104 lineto
- 385 110 lineto
- 388 118 lineto
- 391 126 lineto
- 394 135 lineto
- 397 145 lineto
- 400 156 lineto
- 404 168 lineto
- 407 180 lineto
- 410 192 lineto
- 413 205 lineto
- 416 219 lineto
- 420 232 lineto
- 423 246 lineto
- 426 260 lineto
- 429 273 lineto
- 432 287 lineto
- 436 300 lineto
- 439 312 lineto
- 442 324 lineto
- 445 336 lineto
- 448 347 lineto
- 451 357 lineto
- 455 366 lineto
- 458 374 lineto
- 461 382 lineto
- 464 388 lineto
- 467 393 lineto
- 471 397 lineto
- 474 400 lineto
- 477 402 lineto
- 480 403 lineto
- 483 402 lineto
- 487 400 lineto
- 490 397 lineto
- 493 393 lineto
- 496 388 lineto
- 499 382 lineto
- 502 374 lineto
- 506 366 lineto
- 509 357 lineto
- 512 347 lineto
- 515 336 lineto
- 518 324 lineto
- 522 312 lineto
- 525 300 lineto
- 528 287 lineto
- 531 273 lineto
- 534 260 lineto
- 538 246 lineto
-DashesProc stroke
-1 setlinewidth
-[ ] 0 setdash
-
-/DrawSymbolProc {
- gsave
- 0.996109 0.644541 0 SetBgColor
- Fill
- 0 0 0 SetFgColor
- stroke
- grestore
-} def
-
-79 246 9 Ci
-82 232 9 Ci
-85 219 9 Ci
-88 205 9 Ci
-91 192 9 Ci
-94 180 9 Ci
-98 168 9 Ci
-101 156 9 Ci
-104 145 9 Ci
-107 135 9 Ci
-110 126 9 Ci
-114 118 9 Ci
-117 110 9 Ci
-120 104 9 Ci
-123 99 9 Ci
-126 95 9 Ci
-130 92 9 Ci
-133 90 9 Ci
-136 90 9 Ci
-139 90 9 Ci
-142 92 9 Ci
-145 95 9 Ci
-149 99 9 Ci
-152 104 9 Ci
-155 110 9 Ci
-158 118 9 Ci
-161 126 9 Ci
-165 135 9 Ci
-168 145 9 Ci
-171 156 9 Ci
-174 168 9 Ci
-177 180 9 Ci
-181 192 9 Ci
-184 205 9 Ci
-187 219 9 Ci
-190 232 9 Ci
-193 246 9 Ci
-196 260 9 Ci
-200 273 9 Ci
-203 287 9 Ci
-206 300 9 Ci
-209 312 9 Ci
-212 324 9 Ci
-216 336 9 Ci
-219 347 9 Ci
-222 357 9 Ci
-225 366 9 Ci
-228 374 9 Ci
-232 382 9 Ci
-235 388 9 Ci
-238 393 9 Ci
-241 397 9 Ci
-244 400 9 Ci
-247 402 9 Ci
-251 403 9 Ci
-254 402 9 Ci
-257 400 9 Ci
-260 397 9 Ci
-263 393 9 Ci
-267 388 9 Ci
-270 382 9 Ci
-273 374 9 Ci
-276 366 9 Ci
-279 357 9 Ci
-283 347 9 Ci
-286 336 9 Ci
-289 324 9 Ci
-292 312 9 Ci
-295 300 9 Ci
-298 287 9 Ci
-302 273 9 Ci
-305 260 9 Ci
-308 246 9 Ci
-311 232 9 Ci
-314 219 9 Ci
-318 205 9 Ci
-321 192 9 Ci
-324 180 9 Ci
-327 168 9 Ci
-330 156 9 Ci
-334 145 9 Ci
-337 135 9 Ci
-340 126 9 Ci
-343 118 9 Ci
-346 110 9 Ci
-349 104 9 Ci
-353 99 9 Ci
-356 95 9 Ci
-359 92 9 Ci
-362 90 9 Ci
-365 90 9 Ci
-369 90 9 Ci
-372 92 9 Ci
-375 95 9 Ci
-378 99 9 Ci
-381 104 9 Ci
-385 110 9 Ci
-388 118 9 Ci
-391 126 9 Ci
-394 135 9 Ci
-397 145 9 Ci
-400 156 9 Ci
-404 168 9 Ci
-407 180 9 Ci
-410 192 9 Ci
-413 205 9 Ci
-416 219 9 Ci
-420 232 9 Ci
-423 246 9 Ci
-426 260 9 Ci
-429 273 9 Ci
-432 287 9 Ci
-436 300 9 Ci
-439 312 9 Ci
-442 324 9 Ci
-445 336 9 Ci
-448 347 9 Ci
-451 357 9 Ci
-455 366 9 Ci
-458 374 9 Ci
-461 382 9 Ci
-464 388 9 Ci
-467 393 9 Ci
-471 397 9 Ci
-474 400 9 Ci
-477 402 9 Ci
-480 403 9 Ci
-483 402 9 Ci
-487 400 9 Ci
-490 397 9 Ci
-493 393 9 Ci
-496 388 9 Ci
-499 382 9 Ci
-502 374 9 Ci
-506 366 9 Ci
-509 357 9 Ci
-512 347 9 Ci
-515 336 9 Ci
-518 324 9 Ci
-522 312 9 Ci
-525 300 9 Ci
-528 287 9 Ci
-531 273 9 Ci
-534 260 9 Ci
-538 246 9 Ci
-
-% Unset clipping
-grestore
-
-0.750011 0.750011 0.750011 SetBgColor
-0 0 598 82 Box Fill
-
-0 82 70 329 Box Fill
-
-546 82 52 329 Box Fill
-
-0 411 598 68 Box Fill
-
-0.500008 0.500008 0.500008 SetBgColor
-69 410 478 2 Box Fill
-
-545 80 2 332 Box Fill
-
-0.750011 0.750011 0.750011 SetBgColor
-newpath 69 412 moveto
-69 80 lineto
-547 80 lineto
-545 82 lineto
-71 82 lineto
-71 410 lineto
-69 412 lineto
-69 412 lineto closepath Fill
-311 29 0 308 20 BeginText
-14 /Helvetica-Bold SetFont
-0 0 0 SetFgColor
-(Sine and Cosine Functions) 311 0 23 DrawAdjText
-EndText
-7 16 0 308 463 BeginText
-8 /Helvetica SetFont
-0 0 0 SetFgColor
-(X) 7 0 13 DrawAdjText
-EndText
-40 16 0 79 441 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(-360°) 40 0 12 DrawAdjText
-EndText
-40 16 0 136 441 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(-270°) 40 0 12 DrawAdjText
-EndText
-40 16 0 193 441 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(-180°) 40 0 12 DrawAdjText
-EndText
-32 16 0 251 441 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(-90°) 32 0 12 DrawAdjText
-EndText
-16 16 0 308 441 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(0°) 16 0 12 DrawAdjText
-EndText
-24 16 0 365 441 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(90°) 24 0 12 DrawAdjText
-EndText
-32 16 0 423 441 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(180°) 32 0 12 DrawAdjText
-EndText
-32 16 0 480 441 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(270°) 32 0 12 DrawAdjText
-EndText
-32 16 0 538 441 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(360°) 32 0 12 DrawAdjText
-EndText
-0 setlinejoin
-0 setlinecap
-0 0 0 SetFgColor
-1 setlinewidth
-[ ] 0 setdash
-79 416 538 416 LS
-79 416 79 428 LS
-136 416 136 428 LS
-193 416 193 428 LS
-251 416 251 428 LS
-308 416 308 428 LS
-365 416 365 428 LS
-423 416 423 428 LS
-480 416 480 428 LS
-538 416 538 428 LS
-9 16 90 18 246 BeginText
-8 /Helvetica SetFont
-0.566415 0.171878 0.929702 SetFgColor
-(Y) 9 0 13 DrawAdjText
-EndText
-16 16 90 40 403 BeginText
-8 /CourierNewBold-Bold SetFont
-0.566415 0.171878 0.929702 SetFgColor
-(-1) 16 0 12 DrawAdjText
-EndText
-32 16 90 40 324 BeginText
-8 /CourierNewBold-Bold SetFont
-0.566415 0.171878 0.929702 SetFgColor
-(-0.5) 32 0 12 DrawAdjText
-EndText
-8 16 90 40 246 BeginText
-8 /CourierNewBold-Bold SetFont
-0.566415 0.171878 0.929702 SetFgColor
-(0) 8 0 12 DrawAdjText
-EndText
-24 16 90 40 168 BeginText
-8 /CourierNewBold-Bold SetFont
-0.566415 0.171878 0.929702 SetFgColor
-(0.5) 24 0 12 DrawAdjText
-EndText
-8 16 90 40 90 BeginText
-8 /CourierNewBold-Bold SetFont
-0.566415 0.171878 0.929702 SetFgColor
-(1) 8 0 12 DrawAdjText
-EndText
-0 setlinejoin
-0 setlinecap
-0.566415 0.171878 0.929702 SetFgColor
-1 setlinewidth
-[ ] 0 setdash
-65 403 65 90 LS
-65 363 59 363 LS
-65 403 53 403 LS
-65 285 59 285 LS
-65 324 53 324 LS
-65 207 59 207 LS
-65 246 53 246 LS
-65 129 59 129 LS
-65 168 53 168 LS
-65 90 53 90 LS
-8 16 0 79 51 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(0) 8 0 12 DrawAdjText
-EndText
-24 16 0 170 51 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(0.2) 24 0 12 DrawAdjText
-EndText
-24 16 0 262 51 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(0.4) 24 0 12 DrawAdjText
-EndText
-24 16 0 354 51 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(0.6) 24 0 12 DrawAdjText
-EndText
-24 16 0 446 51 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(0.8) 24 0 12 DrawAdjText
-EndText
-8 16 0 538 51 BeginText
-8 /CourierNewBold-Bold SetFont
-0 0 0 SetFgColor
-(1) 8 0 12 DrawAdjText
-EndText
-0 setlinejoin
-0 setlinecap
-0 0 0 SetFgColor
-1 setlinewidth
-[ ] 0 setdash
-79 76 538 76 LS
-124 76 124 70 LS
-79 76 79 64 LS
-216 76 216 70 LS
-170 76 170 64 LS
-308 76 308 70 LS
-262 76 262 64 LS
-400 76 400 70 LS
-354 76 354 64 LS
-492 76 492 70 LS
-446 76 446 64 LS
-538 76 538 64 LS
-8 16 0 572 403 BeginText
-8 /CourierNewBold-Bold SetFont
-0.800793 0 0.800793 SetFgColor
-(0) 8 0 12 DrawAdjText
-EndText
-24 16 0 580 340 BeginText
-8 /CourierNewBold-Bold SetFont
-0.800793 0 0.800793 SetFgColor
-(0.2) 24 0 12 DrawAdjText
-EndText
-24 16 0 580 277 BeginText
-8 /CourierNewBold-Bold SetFont
-0.800793 0 0.800793 SetFgColor
-(0.4) 24 0 12 DrawAdjText
-EndText
-24 16 0 580 215 BeginText
-8 /CourierNewBold-Bold SetFont
-0.800793 0 0.800793 SetFgColor
-(0.6) 24 0 12 DrawAdjText
-EndText
-24 16 0 580 152 BeginText
-8 /CourierNewBold-Bold SetFont
-0.800793 0 0.800793 SetFgColor
-(0.8) 24 0 12 DrawAdjText
-EndText
-8 16 0 572 90 BeginText
-8 /CourierNewBold-Bold SetFont
-0.800793 0 0.800793 SetFgColor
-(1) 8 0 12 DrawAdjText
-EndText
-0 setlinejoin
-0 setlinecap
-0.800793 0 0.800793 SetFgColor
-1 setlinewidth
-[ ] 0 setdash
-551 403 551 90 LS
-551 371 557 371 LS
-551 403 563 403 LS
-551 309 557 309 LS
-551 340 563 340 LS
-551 246 557 246 LS
-551 277 563 277 LS
-551 183 557 183 LS
-551 215 563 215 LS
-551 121 557 121 LS
-551 152 563 152 LS
-551 90 563 90 LS
-showpage
-%Trailer
-grestore
-end
-%EOF
diff --git a/blt3.0.1/demos/images/qv100.t.gif b/blt3.0.1/demos/images/qv100.t.gif
deleted file mode 100644
index 1e738ee..0000000
Binary files a/blt3.0.1/demos/images/qv100.t.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/rain.gif b/blt3.0.1/demos/images/rain.gif
deleted file mode 100644
index d7bb417..0000000
Binary files a/blt3.0.1/demos/images/rain.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/sample.gif b/blt3.0.1/demos/images/sample.gif
deleted file mode 100644
index 1d8a401..0000000
Binary files a/blt3.0.1/demos/images/sample.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/smblue_rock.gif b/blt3.0.1/demos/images/smblue_rock.gif
deleted file mode 100644
index df1c8f5..0000000
Binary files a/blt3.0.1/demos/images/smblue_rock.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/stopsign.gif b/blt3.0.1/demos/images/stopsign.gif
deleted file mode 100644
index fe4d27e..0000000
Binary files a/blt3.0.1/demos/images/stopsign.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/tan_paper.gif b/blt3.0.1/demos/images/tan_paper.gif
deleted file mode 100644
index aca947d..0000000
Binary files a/blt3.0.1/demos/images/tan_paper.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/tan_paper2.gif b/blt3.0.1/demos/images/tan_paper2.gif
deleted file mode 100644
index 76d94ac..0000000
Binary files a/blt3.0.1/demos/images/tan_paper2.gif and /dev/null differ
diff --git a/blt3.0.1/demos/images/txtrflag.gif b/blt3.0.1/demos/images/txtrflag.gif
deleted file mode 100644
index 4017154..0000000
Binary files a/blt3.0.1/demos/images/txtrflag.gif and /dev/null differ
diff --git a/blt3.0.1/demos/listview1.tcl b/blt3.0.1/demos/listview1.tcl
deleted file mode 100644
index 95652a9..0000000
--- a/blt3.0.1/demos/listview1.tcl
+++ /dev/null
@@ -1,88 +0,0 @@
-
-package require BLT
-
-blt::tk::radiobutton .rowmode -text "Row Layout" \
- -variable layoutMode -value row \
- -command [list .ss.l configure -layoutmode row]
-
-blt::tk::radiobutton .colmode -text "Column Layout" \
- -variable layoutMode -value column \
- -command [list .ss.l configure -layoutmode column]
-
-blt::tk::radiobutton .iconsmode -text "Icons Layout" \
- -variable layoutMode -value icons \
- -command [list .ss.l configure -layoutmode icons]
-
-blt::scrollset .ss \
- -xscrollbar .ss.xs \
- -yscrollbar .ss.ys \
- -window .ss.l
-
-blt::listview .ss.l \
- -width 3i \
- -height 2i \
- -layoutmode column \
- -selectmode multiple \
- -activebackground grey95
-
-.ss.l sort configure \
- -decreasing 0 \
- -auto 1 \
- -by type
-
-image create picture closeIcon -data {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM1WBrM+rAEMigJ8c3Kb3OSII6kGABhp1JnaK1VGwjwKwtvHqNzzd263M3H4n2OH1QBwGw6
- nQkAOw==
-}
-
-proc debugselect {} {
- puts stderr selected=[.ss.l curselection]
-}
-
-proc icon { name } {
- global icons
- if { [info exists icons($name)] } {
- return $icons($name)
- }
- set file ""
- foreach dir {
- ~/neeshub/indeed/src/icons/filetype
- ~/neeshub/indeed/src/icons/misc
- } {
- if { [file exists $dir/$name.png] } {
- set file $dir/$name.png
- break
- }
- }
- if { $file == "" } {
- return closeIcon
- }
- set icons($name) [image create picture -file $file]
- return $icons($name)
-}
-
-foreach f [lsort [glob -nocomplain ~/*]] {
- set name [file tail $f]
- set ext [file ext $name]
- set ext [string trimleft $ext .]
- if { [file isdir $f] } {
- set ext .dir
- }
- .ss.l add -text $name -icon [icon $ext] -type $ext \
- -bigicon [icon folder-green]
-}
-
-blt::tk::scrollbar .ss.xs
-blt::tk::scrollbar .ss.ys
-
-blt::table . \
- 0,0 .rowmode \
- 0,1 .colmode \
- 0,2 .iconsmode \
- 1,0 .ss -fill both -cspan 3
-
-blt::table configure . r0 -resize none
-
-.colmode select
-
diff --git a/blt3.0.1/demos/mbar1.tcl b/blt3.0.1/demos/mbar1.tcl
deleted file mode 100644
index 97b6c4b..0000000
--- a/blt3.0.1/demos/mbar1.tcl
+++ /dev/null
@@ -1,276 +0,0 @@
-
-foreach {key file} {
-save_as /usr/share/gtk-doc/html/pygtk/icons/stock_save_as
-new_tab /usr/share/gtk-doc/html/pygtk/icons/stock_new
-new_window /usr/share/gtk-doc/html/pygtk/icons/stock_network
-open_file /usr/share/gtk-doc/html/pygtk/icons/stock_open
-quit /usr/share/gtk-doc/html/pygtk/icons/stock_exit
-print /usr/share/gtk-doc/html/pygtk/icons/stock_print
-print_preview /usr/share/gtk-doc/html/pygtk/icons/stock_print_preview
-undo /usr/share/gtk-doc/html/pygtk/icons/stock_undo
-redo /usr/share/gtk-doc/html/pygtk/icons/stock_redo
-cut /usr/share/gtk-doc/html/pygtk/icons/stock_cut
-paste /usr/share/gtk-doc/html/pygtk/icons/stock_paste
-copy /usr/share/gtk-doc/html/pygtk/icons/stock_copy
-delete /usr/share/gtk-doc/html/pygtk/icons/stock_trash
-select_all /usr/share/gtk-doc/html/pygtk/icons/stock_broken_image
-find /usr/share/gtk-doc/html/pygtk/icons/stock_search
-preferences /usr/share/gtk-doc/html/pygtk/icons/stock_preferences
-stop /usr/share/gtk-doc/html/pygtk/icons/stock_stop
-reload /usr/share/gtk-doc/html/pygtk/icons/stock_refresh
-back /usr/share/gtk-doc/html/pygtk/icons/stock_left_arrow
-forward /usr/share/gtk-doc/html/pygtk/icons/stock_right_arrow
-home /usr/share/gtk-doc/html/pygtk/icons/stock_home
-} {
- set icon($key) [image create picture -file ${file}_24.png]
-}
-
-if { [file exists ../library] } {
- set blt_library ../library
-}
-
-set imgData {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
- ZTKAsiCtWq0JADs=
-}
-
-#set image [image create picture -file ~/images.jpeg]
-set bg [blt::bgpattern create gradient -high grey70 -low grey95 \
- -jitter yes -log yes -relativeto self]
-
-set image ""
-
-blt::menubar .mbar \
- -relief flat \
- -activerelief raised \
- -bg $bg \
- -font { Arial 10 bold } -justify left \
-
-.mbar add \
- -text "File" \
- -underline 0 \
- -image $image \
- -menuanchor sw \
- -menu .mbar.file
-
-blt::combomenu .mbar.file \
- -width -400 -font "Arial 10 bold" -acceleratorfont "Arial 10 bold" \
- -bg grey85 -relief raised -bd 1
-.mbar.file.m add -text "New Window" -accelerator "Ctrl+N" -underline 0 \
- -icon $icon(new_window)
-.mbar.file add -text "New Tab" -accelerator "Ctrl+T" -underline 4 \
- -icon $icon(new_tab)
-.mbar.file add -text "Open Location..." -accelerator "Ctrl+L" -underline 5
-.mbar.file add -text "Open File..." -accelerator "Ctrl+O" -underline 0 \
- -icon $icon(open_file)
-.mbar.file add -text "Close Window" -accelerator "Ctrl+Shift+W" -underline 9
-.mbar.file add -text "Close Tab" -accelerator "Ctrl+W" -underline 0
-.mbar.file add -type separator
-.mbar.file add -text "Save Page As..." -accelerator "Ctrl+O" -underline 10 \
- -icon $icon(save_as)
-.mbar.file add -text "Save Page As PDF..." -accelerator "Ctrl+Shift+W" -underline 15
-.mbar.file add -text "Send Link..." -accelerator "Ctrl+W" -underline 1
-.mbar.file add -type separator
-.mbar.file add -text "Page Setup..." -underline 8
-.mbar.file add -text "Print Preview" -accelerator "Ctrl+Shift+W" -underline 9 \
- -icon $icon(print_preview)
-.mbar.file add -text "Print..." -accelerator "Ctrl+P" -underline 0 \
- -icon $icon(print)
-.mbar.file add -type separator
-.mbar.file add -text "Import..." -underline 0
-.mbar.file add -type separator
-.mbar.file add -text "Work Offline" -underline 0
-.mbar.file add -text "Quit" -accelerator "Ctrl+Q" -underline 0 \
- -icon $icon(quit)
-
-.mbar add \
- -text "Edit" \
- -underline 0 \
- -menuanchor nw \
- -menu .mbar.edit
-
-blt::combomenu .mbar.edit \
- -width -400 -font "Arial 10 bold" -acceleratorfont "Arial 10 bold" \
- -bg grey85 -relief raised -bd 1
-.mbar.edit add -text "Undo" -accelerator "Ctrl+Z" \
- -icon $icon(undo)
-.mbar.edit add -text "Redo" -accelerator "Ctrl+Shift+Z" \
- -icon $icon(redo)
-.mbar.edit add -type separator
-.mbar.edit add -text "Cut" -accelerator "Ctrl+X" \
- -icon $icon(cut)
-.mbar.edit add -text "Copy" -accelerator "Ctrl+C" \
- -icon $icon(copy)
-.mbar.edit add -text "Paste" -accelerator "Ctrl+V" \
- -icon $icon(paste)
-.mbar.edit add -text "Delete" -accelerator "Del" \
- -icon $icon(delete)
-.mbar.edit add -type separator
-.mbar.edit add -text "Select All" -accelerator "Ctrl+X" \
- -icon $icon(select_all)
-.mbar.edit add -type separator
-.mbar.edit add -text "Find" -accelerator "Ctrl+F" \
- -icon $icon(find)
-.mbar.edit add -text "Find Again" -accelerator "Ctrl+G"
-.mbar.edit add -type separator
-.mbar.edit add -text "Preferences" \
- -icon $icon(preferences)
-
-blt::combomenu .mbar.edit.m
-.mbar.edit.m add -type command -text "five" -accelerator "^A" -command "set t five"
-.mbar.edit.m add -type command -text "six" -accelerator "^B" -command "set t six"
-.mbar.edit.m add -type command -text "seven" -accelerator "^C" -command "set t seven"
-.mbar.edit.m add -type command -text "eight" -accelerator "^D" -command "set t eight"
-.mbar.edit.m add -type cascade -text "cascade" -accelerator "^E"
-
-
-.mbar add \
- -text "View" \
- -underline 0 \
- -menuanchor nw \
- -menu .mbar.view
-
-blt::combomenu .mbar.view \
- -width -600 -font "Arial 10 bold" -acceleratorfont "Arial 10 bold" \
- -bg grey85 -relief raised -bd 1
-.mbar.view add -type cascade -text "Toolbars" -underline 0
-.mbar.view add -type checkbutton -text "Status Bar" \
- -underline 4
-.mbar.view add -type checkbutton -text "Sidebar" \
- -underline 5 -variable sidebar
-.mbar.view add -type checkbutton -text "Adblock Plus: Blockable items" \
- -accelerator "Ctrl+Shift+V" -underline 0 -variable adblock
-.mbar.view add -type separator
-.mbar.view add -text "Stop" -accelerator "Esc" -underline 9 \
- -icon $icon(stop)
-.mbar.view add -text "Reload" -accelerator "Ctrl+R" -underline 0 \
- -icon $icon(reload)
-.mbar.view add -type separator
-.mbar.view add -type cascade -text "Zoom" -accelerator "Ctrl+O" -underline 10
-.mbar.view add -type cascade -text "Page Style" -accelerator "Ctrl+Shift+W" \
- -underline 15
-.mbar.view add -type cascade -text "Character Encoding" -accelerator "Ctrl+W" \
- -underline 1
-.mbar.view add -type separator
-.mbar.view add -text "Page Source" -underline 8 -accelerator "Ctrl+U"
-.mbar.view add -text "Full Screen" -accelerator "F11" -underline 9
-
-
-.mbar add \
- -text "History" \
- -underline 0 \
- -menuanchor nw \
- -menu .mbar.history
-
-blt::combomenu .mbar.history \
- -width -600 -font "Arial 10 bold" -acceleratorfont "Arial 10 bold" \
- -bg grey85 -relief raised -bd 1
-.mbar.history add -text "Back" -accelerator "Alt+Left Arrow" \
- -underline 0 -icon $icon(back)
-.mbar.history add -text "Forward" -accelerator "Alt+Right Arrow" \
- -underline 4 -icon $icon(forward)
-.mbar.history add -text "Home" -accelerator "Alt+Home" \
- -underline 5 -icon $icon(home)
-.mbar.history add -text "Show All History" -accelerator "Ctrl+Shift+H" \
- -underline 0
-.mbar.history add -type separator
-.mbar.history add -type cascade -text "Recently Closed Tabs" \
- -accelerator "Ctrl+O" -underline 10
-
-.mbar add \
- -text "Bookmarks" \
- -relief flat \
- -activerelief raised \
- -bg $bg \
- -font { Arial 10 bold } -justify left \
- -underline 0 \
- -menuanchor nw \
- -menu .mbar.bmarks
-
-blt::combomenu .mbar.bmarks \
- -width -600 -font "Arial 10 bold" -acceleratorfont "Arial 10 bold" \
- -bg grey85 -relief raised -bd 1
-.mbar.bmarks add -text "Bookmark This Page" -accelerator "Ctrl+D" \
- -underline 0 -icon $icon(back)
-.mbar.bmarks add -text "Subscribe to This Page..." \
- -underline 4 -icon $icon(forward)
-.mbar.bmarks add -text "Bookmark All Tabs" \
- -underline 5 -icon $icon(home)
-.mbar.bmarks add -text "Organize Bookmarks" \
- -underline 0
-.mbar.bmarks add -type separator
-.mbar.bmarks add -type cascade -text "Bookmarks Toolbar" \
- -underline 10
-.mbar.bmarks add -type separator
-.mbar.bmarks add -type cascade -text "Recently Bookmarked" \
- -underline 10
-.mbar.bmarks add -type cascade -text "Recent Tags" \
- -underline 10
-.mbar.bmarks add -type separator
-.mbar.bmarks add -text "Page 1" \
- -underline 10
-.mbar.bmarks add -text "Page 2" \
- -underline 10
-
-.mbar add \
- -text "Tools" \
- -underline 0 \
- -menuanchor nw \
- -menu .mbar.tools
-
-blt::combomenu .mbar.tools \
- -width -600 -font "Arial 10 bold" -acceleratorfont "Arial 10 bold" \
- -bg grey85 -relief raised -bd 1
-.mbar.tools add -text "Web Search" -accelerator "Ctrl+K" \
- -underline 0
-.mbar.tools add -type separator
-.mbar.tools add -text "Downloads" -accelerator "Ctrl+Y" \
- -underline 4 -icon $icon(forward)
-.mbar.tools add -text "Add-ons" -underline 0
-.mbar.tools add -type separator
-.mbar.tools add -text "PDF Download - Options" -underline 0
-.mbar.tools add -text "Save Images From Tabs" -underline 10
-.mbar.tools add -text "Error Console" \
- -accelerator "Ctrl+Shift+J" -underline 10
-.mbar.tools add -text "Adblock Plus Preferences..." \
- -accelerator "Ctrl+Shift+E" -underline 10
-.mbar.tools add -text "Page Info" \
- -accelerator "Ctrl+I" -underline 10
-.mbar.tools add -type separator
-.mbar.tools add -text "Clear Private Data" \
- -accelerator "Ctrl+Shift+Del" -underline 10
-.mbar.tools add -text "Batch Download Settings" \
- -underline 10
-
-.mbar add \
- -text "Help" \
- -underline 0 \
- -menuanchor nw \
- -menu .mbar.help
-
-blt::combomenu .mbar.help \
- -width -600 -font "Arial 10 bold" -acceleratorfont "Arial 10 bold" \
- -bg grey85 -relief raised -bd 1
-.mbar.help add -text "Help Contents" \
- -underline 0 -icon $icon(back)
-.mbar.help add -text "Release Notes" \
- -underline 4 -icon $icon(forward)
-.mbar.help add -text "Report Broken Website..." \
- -underline 5 -icon $icon(home)
-.mbar.help add -text "Report Web Forgery..." \
- -underline 0
-.mbar.help add -type separator
-.mbar.help add -text "Check For Updates..." \
- -underline 0
-.mbar.help add -text "About..." \
- -underline 0
-
-canvas .c
-
-blt::table . \
- 0,0 .mbar -fill x \
- 1,0 .c -fill both
-
-blt::table configure . r0 -resize none
-blt::table configure . r1 -resize expand
diff --git a/blt3.0.1/demos/paneset1.tcl b/blt3.0.1/demos/paneset1.tcl
deleted file mode 100644
index 5236b8b..0000000
--- a/blt3.0.1/demos/paneset1.tcl
+++ /dev/null
@@ -1,22 +0,0 @@
-package require BLT
-source scripts/demo.tcl
-
-blt::paneset .ps -bg grey -width 800 \
- -sashthickness 3 -background red \
- -sashborderwidth 1 -sashrelief sunken \
- -sashpad 1
-
-blt::graph .ps.g -bg \#CCCCFF ;#-width 300
-blt::barchart .ps.b -bg \#FFCCCC ;# -width 300
-blt::barchart .ps.b2 -bg \#CCFFCC ;#-width 300
-
-.ps add -window .ps.g -fill both
-.ps add -window .ps.b -fill both
-.ps add -window .ps.b2 -fill both
-
-focus .ps
-
-blt::table . \
- 0,0 .ps -fill both
-
-blt::table configure . r1 -resize none
diff --git a/blt3.0.1/demos/paneset2.tcl b/blt3.0.1/demos/paneset2.tcl
deleted file mode 100644
index 43b0bc1..0000000
--- a/blt3.0.1/demos/paneset2.tcl
+++ /dev/null
@@ -1,20 +0,0 @@
-package require BLT
-source scripts/demo.tcl
-
-blt::paneset .ps -height 900 \
- -orient vertical
-
-blt::graph .ps.g
-blt::barchart .ps.b
-blt::barchart .ps.b2
-
-.ps add -window .ps.g -fill both
-.ps add -window .ps.b -fill both
-.ps add -window .ps.b2 -fill both
-
-focus .ps
-
-blt::table . \
- 0,0 .ps -fill both
-
-blt::table configure . r1 -resize none
diff --git a/blt3.0.1/demos/paneset3.tcl b/blt3.0.1/demos/paneset3.tcl
deleted file mode 100644
index 99b4c40..0000000
--- a/blt3.0.1/demos/paneset3.tcl
+++ /dev/null
@@ -1,18 +0,0 @@
-
-package require BLT
-source scripts/demo.tcl
-
-blt::paneset .vps -orient vertical
-blt::paneset .vps.hps
-
-blt::graph .vps.g -height 400 -width 500
-blt::barchart .vps.hps.b -height 400 -width 400
-blt::barchart .vps.hps.b2 -height 400 -width 400
-
-.vps add -window .vps.g -fill both
-.vps add -window .vps.hps -fill both
-.vps.hps add -window .vps.hps.b -fill both
-.vps.hps add -window .vps.hps.b2 -fill both
-
-focus .vps
-pack .vps -fill both -expand yes
diff --git a/blt3.0.1/demos/paneset4.tcl b/blt3.0.1/demos/paneset4.tcl
deleted file mode 100644
index 22e2dbf..0000000
--- a/blt3.0.1/demos/paneset4.tcl
+++ /dev/null
@@ -1,20 +0,0 @@
-
-package require BLT
-source scripts/demo.tcl
-
-blt::paneset .ps -width 800 -mode spreadsheet
-
-blt::graph .ps.g
-blt::barchart .ps.b
-blt::barchart .ps.b2
-
-.ps add -window .ps.g -fill both
-.ps add -window .ps.b -fill both
-.ps add -window .ps.b2 -fill both
-
-focus .ps
-
-blt::table . \
- 0,0 .ps -fill both
-
-blt::table configure . r1 -resize none
diff --git a/blt3.0.1/demos/paneset5.tcl b/blt3.0.1/demos/paneset5.tcl
deleted file mode 100644
index 85cfa15..0000000
--- a/blt3.0.1/demos/paneset5.tcl
+++ /dev/null
@@ -1,18 +0,0 @@
-
-package require BLT
-source scripts/demo.tcl
-
-blt::paneset .ps -height 900 -orient vertical
-
-blt::graph .ps.g
-blt::barchart .ps.b
-blt::barchart .ps.b2
-
-.ps add -window .ps.g -fill both
-.ps add -window .ps.b -fill both
-.ps add -window .ps.b2 -fill both
-
-focus .ps
-blt::table . \
- 0,0 .ps -fill both
-blt::table configure . r1 -resize none
diff --git a/blt3.0.1/demos/paneset6.tcl b/blt3.0.1/demos/paneset6.tcl
deleted file mode 100644
index df7df60..0000000
--- a/blt3.0.1/demos/paneset6.tcl
+++ /dev/null
@@ -1,98 +0,0 @@
-
-package require BLT
-source scripts/demo.tcl
-
-set pictures [glob -nocomplain "*.jpg"]
-set autocolors {
-#0000cd
-#cd0000
-#00cd00
-#3a5fcd
-#cdcd00
-#cd1076
-#009acd
-#00c5cd
-#a2b5cd
-#7ac5cd
-#66cdaa
-#a2cd5a
-#cd9b9b
-#cdba96
-#cd3333
-#cd6600
-#cd8c95
-#cd00cd
-#9a32cd
-#6ca6cd
-#9ac0cd
-#9bcd9b
-#00cd66
-#cdc673
-#cdad00
-#cd5555
-#cd853f
-#cd7054
-#cd5b45
-#cd6889
-#cd69c9
-#551a8b
-}
-
-proc Move { w pane } {
-# puts stderr "w=$w pane=$pane"
- .ps see $pane
-}
-
-blt::filmstrip .ps -bg grey -width 600 -scrollcommand { .s set } \
- -sashthickness 3 -handlepad 1 -handleborderwidth 2 \
- -activehandlerelief raised -handlerelief flat
- #-scrolldelay 10 -scrollincrement 10
-
-for { set i 0 } { $i < 32 } { incr i } {
- set color [lindex $autocolors $i]
- blt::graph .ps.g$i -bg $color -width 500
- set pane [.ps add -window .ps.g$i -fill both]
- bind .ps.g$i <ButtonPress-1> [list Move %W $pane]
- bind .ps.g$i <ButtonPress-2> [list Move %W pane0]
- bind .ps.g$i <ButtonPress-3> [list Move %W pane35]
-}
-blt::tk::scrollbar .s -command { .ps view } -orient horizontal
-
-set pressed 0
-bind PanesetHandle <Enter> { %W activate }
-bind PanesetHandle <Leave> {
- if { !$pressed } { %W deactivate }
-}
-bind PanesetHandle <KeyPress-Left> { %W move -10 0 }
-bind PanesetHandle <KeyPress-Right> { %W move 10 0 }
-bind PanesetHandle <KeyPress-Up> { %W move 0 -10 }
-bind PanesetHandle <KeyPress-Down> { %W move 0 10 }
-bind PanesetHandle <Shift-KeyPress-Left> { %W move -100 0 }
-bind PanesetHandle <Shift-KeyPress-Right> { %W move 100 0 }
-bind PanesetHandle <Shift-KeyPress-Up> { %W move 0 -100 }
-bind PanesetHandle <Shift-KeyPress-Down> { %W move 0 100 }
-bind PanesetHandle <ButtonPress-1> {
- set pressed 1
- %W anchor %X %Y
- focus %W
-}
-bind PanesetHandle <B1-Motion> { %W mark %X %Y }
-bind PanesetHandle <ButtonRelease-1> {
- set pressed 0
- %W set %X %Y
-}
-
-blt::table . \
- 0,0 .ps -fill both \
- 1,0 .s -fill x
-
-blt::table configure . r1 -resize none
-
-focus .ps
-after 5000 {
- #.ps pane configure 1 -size { 0 10000 10 }
- focus .
- #.ps see pane2
- #.ps size pane2 1i
-}
-
diff --git a/blt3.0.1/demos/paneset7.tcl b/blt3.0.1/demos/paneset7.tcl
deleted file mode 100644
index 8460d97..0000000
--- a/blt3.0.1/demos/paneset7.tcl
+++ /dev/null
@@ -1,45 +0,0 @@
-
-package require BLT
-source scripts/demo.tcl
-
-blt::paneset .ps -bg grey -width 900 -scrollcommand { .s set }
-
-blt::graph .ps.g -bg \#CCCCFF -width 600 -height 800
-blt::barchart .ps.b -bg \#FFCCCC -width 700 -height 800
-blt::barchart .ps.b2 -bg \#CCFFCC -width 500 -height 800
-blt::tk::scrollbar .s -command { .ps view } -orient horizontal
-
-.ps add -window .ps.g -fill both
-.ps add -window .ps.b ;#-fill both
-.ps add -window .ps.b2 -fill both
-
-.ps bind Sash <Enter> { .ps sash activate current }
-.ps bind Sash <Leave> { .ps sash activate none }
-
-.ps bind Sash <ButtonPress-1> {
- %W sash anchor %x %y
-}
-.ps bind Sash <B1-Motion> {
- %W sash mark %x %y
-}
-.ps bind Sash <ButtonRelease-1> {
- %W sash set %x %y
-}
-
-blt::table . \
- 0,0 .ps -fill both \
- 1,0 .s -fill x
-
-blt::table configure . r1 -resize none
-
-focus .ps
-after 5000 {
- #.ps pane configure 1 -size { 0 10000 10 }
- focus .
- #.ps see pane2
- #.ps size pane2 1i
-}
-
-bind .ps.g <ButtonPress-1> ".ps see pane0"
-bind .ps.b <ButtonPress-1> ".ps see pane1"
-bind .ps.b2 <ButtonPress-1> ".ps see pane2"
\ No newline at end of file
diff --git a/blt3.0.1/demos/picture3.tcl b/blt3.0.1/demos/picture3.tcl
deleted file mode 100644
index 8363862..0000000
--- a/blt3.0.1/demos/picture3.tcl
+++ /dev/null
@@ -1,68 +0,0 @@
-package require BLT
-
-set dest [image create picture -width 800 -height 600]
-
-source usmap.tcl
-
-set count 0
-array set colors {
- 0 red
- 1 green
- 2 blue
- 3 cyan
- 4 orange
- 5 purple
- 6 brown
- 7 violet
- 8 seagreen
- 9 lightblue
- 10 yellow
- 11 pink
- 12 khaki
- 13 grey
-}
-
-blt::vector all
-blt::vector x
-blt::vector y
-set subset *
-label .l -image $dest
-$dest blank white
-set bg [image create picture -file images/blt98.gif]
-$dest copy $bg
-pack .l
-foreach region [array names us_regions $subset] {
- set coords $us_regions($region)
- set cnum [expr {int(rand()*14.0)}]
- all set $coords
-# all split x y
-# set min [blt::vector expr min(x)]
-# x expr { (x-$min)*3.0 + 10 }
-# set min [blt::vector expr min(y)]
-# y expr { (y-$min)*3.0 + 10 }
-# all merge x y
- all expr { all * 3.0 }
- set coords [all values]
- $dest draw polygon -coords $coords -color $colors($cnum) \
- -antialiased 1 -shadow 1 -alpha 155
- #$dest draw line -coords $coords -color black
-# foreach {rx ry} $coords {
-# $dest draw rectangle [expr int($rx-2)] [expr int($ry-2)] [expr int($rx+2)] [expr int($ry+2)] -color red
-# }
- incr count
-}
-
-#$dest draw rectangle 200 200 300 300 -color green -shadow 0 \
- -radius 10 -alpha 100
-#$dest draw rectangle 200 200 400 300 -color blue -linewidth 29 \
- -radius 19 -shadow 0 -antialiased 0 -alpha 180
-
-$dest draw circle 200 200 100 -alpha 055 -fill yellow -shadow 0 \
- -antialiased 1 -linewidth 10 -outline 0xA0FF00FF
-#$dest draw text "Hi George" 200 200 -anchor c -rotate 0.0 \
- -font "@/usr/share/fonts/100dpi/helvB24-ISO8859-1.pcf.gz" \
- -alpha 155 -color black
-
-#$dest draw line -coords "200 200 500 200" -color black
-
-
diff --git a/blt3.0.1/demos/picture4.tcl b/blt3.0.1/demos/picture4.tcl
deleted file mode 100644
index 96a33d4..0000000
--- a/blt3.0.1/demos/picture4.tcl
+++ /dev/null
@@ -1,26 +0,0 @@
-
-set s1 [image create picture -width 25 -height 25]
-$s1 blank 0x00000000
-$s1 draw circle 12 12 5 -shadow 0 -linewidth 1 \
- -fill 0x90FF0000 -antialias yes
-
-set bg [image create picture -width 600 -height 600]
-$bg blank white
-
-
-set n 500000
-puts stderr [time {
- blt::vector create points($n)
-
- points expr { round(random(points) * 512) + 30 }
-}]
-puts stderr [time {
- foreach {x y} [points print] {
- $bg copy $s1 -to "$x $y" -blend yes
- #$bg draw circle $x $y 30 -shadow 0 -linewidth 2 \
- -fill 0x90FF0000 -antialias no
- }
-}]
-label .l -image $bg
-pack .l
-
diff --git a/blt3.0.1/demos/picture5.tcl b/blt3.0.1/demos/picture5.tcl
deleted file mode 100644
index f89518c..0000000
--- a/blt3.0.1/demos/picture5.tcl
+++ /dev/null
@@ -1,4 +0,0 @@
-
-set img [image create picture]
-$img import ps -file sc.ps -dpi 600
-$img export png -file sc2.png
diff --git a/blt3.0.1/demos/pushbutton1.tcl b/blt3.0.1/demos/pushbutton1.tcl
deleted file mode 100644
index df108b2..0000000
--- a/blt3.0.1/demos/pushbutton1.tcl
+++ /dev/null
@@ -1,23 +0,0 @@
-
-package require BLT
-
-blt::tk::pushbutton .p -text "Push"
-pack .p -side top
-
-set onFile ~/r7/rappture/gui/scripts/images/zoom-in.png
-set offFile ~/r7/rappture/gui/scripts/images/zoom-out.png
-set on [image create picture -file $onFile]
-set off [image create picture -file $offFile]
-blt::tk::pushbutton .p1 -variable "test" -onvalue 1 \
- -onimage $on -offimage $off
-blt::tk::pushbutton .p2 -text "Push 2" -variable "test" -onvalue 2
-blt::tk::pushbutton .p3 -text "Push 3" -variable "test" -onvalue 3
-blt::tk::pushbutton .p4 -text "Push 4" -variable "test" -onvalue 4
-blt::tk::pushbutton .p5 -text "Push 5" -variable "test" -onvalue 5
-pack .p1 .p2 .p3 .p4 .p5 -side top
-blt::tk::button .b -text "Query" -command {
- puts stderr variable=[set [.p cget -variable]]
- puts stderr test=$test
-}
-pack .b
-puts stderr class=[winfo class .p1]
diff --git a/blt3.0.1/demos/scripts/barchart2.tcl b/blt3.0.1/demos/scripts/barchart2.tcl
deleted file mode 100644
index 3e06d7c..0000000
--- a/blt3.0.1/demos/scripts/barchart2.tcl
+++ /dev/null
@@ -1,132 +0,0 @@
-
-proc FormatXTicks { w value } {
-
- # Determine the element name from the value
-
- set index [expr round($value)]
- if { $index != $value } {
- return $value
- }
- incr index -1
-
- set name [lindex { A1 B1 A2 B2 C1 D1 C2 A3 E1 } $index]
- return $name
-}
-
-source scripts/patterns.tcl
-
-image create picture bgTexture -file ./images/chalk.gif
-
-set configOptions {
- Axis.TickFont -*-helvetica-medium-r-*-*-12-*-*
- Axis.TitleFont -*-helvetica-bold-r-*-*-12-*-*
- Element.Background white
- Element.Relief raised
- Grid.Dashes { 2 4 }
- Grid.Hide no
- Grid.MapX ""
- Legend.Font "-*-helvetica*-bold-r-*-*-12-*-*"
- Legend.ActiveBorderWidth 2
- Legend.ActiveRelief raised
- Legend.Anchor ne
- Legend.BorderWidth 0
- Legend.Position right
- TextMarker.Font *Helvetica-Bold-R*14*
- activeBar.Foreground black
- activeBar.Stipple pattern1
- BarMode stacked
- Font -*-helvetica-bold-r-*-*-14-*-*
- Tile bgTexture
- Title "Comparison of Simulators"
- x.Command FormatXTicks
- x.Title "Simulator"
- y.Title "Time (hrs)"
-}
-
-set resource [string trimleft $graph .]
-foreach { option value } $configOptions {
- option add *$resource.$option $value
-}
-$graph configure -barmode stacked
-
-set visual [winfo screenvisual .]
-if { $visual != "staticgray" && $visual != "grayscale" } {
- option add *print.background yellow
- option add *quit.background red
- option add *quit.activeBackground red2
-}
-
-blt::vector X Y0 Y1 Y2 Y3 Y4
-
-X set { 1 2 3 4 5 6 7 8 9 }
-Y0 set {
- 0.729111111 0.002250000 0.09108333 0.006416667 0.026509167
- 0.007027778 0.1628611 0.06405278 0.08786667
-}
-Y1 set {
- 0.003120278 0.004638889 0.01113889 0.048888889 0.001814722
- 0.291388889 0.0503500 0.13876389 0.04513333
-}
-Y2 set {
- 11.534444444 3.879722222 4.54444444 4.460277778 2.334055556
- 1.262194444 1.8009444 4.12194444 3.24527778
-}
-Y3 set {
- 1.015750000 0.462888889 0.49394444 0.429166667 1.053694444
- 0.466111111 1.4152500 2.17538889 2.55294444
-}
-Y4 set {
- 0.022018611 0.516333333 0.54772222 0.177638889 0.021703889
- 0.134305556 0.5189278 0.07957222 0.41155556
-}
-
-
-#
-# Element attributes:
-#
-# Label yData Color Stipple Pattern
-set attributes {
- "Load" Y2 lightblue pattern1
- "Other" Y4 lightpink pattern1 1
- "Read In" Y0 lightgoldenrod pattern1 1
- "Setup" Y1 lightyellow pattern2 1
-}
-set attributes {
- "Load" Y2 lightblue1 lightblue3 pattern1 1
- "Solve" Y3 cyan1 cyan3 pattern2 1
- "zOther" Y4 lightpink1 lightpink3 pattern1 1
- "Read In" Y0 lightgoldenrod1 lightgoldenrod3 pattern1 1
- "Setup" Y1 lightyellow1 lightyellow3 pattern2 1
-}
-
-foreach {label yData fg bg stipple bd} $attributes {
- $graph element create $yData \
- -label $label \
- -borderwidth $bd \
- -y $yData \
- -x X \
- -fg $fg \
- -bg $bg \
- -stipple $stipple
-}
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
-
-$graph marker bind all <B2-Motion> {
- set coords [%W invtransform %x %y]
- catch { %W marker configure [%W marker get current] -coords $coords }
-}
-
-$graph marker bind all <Enter> {
- set marker [%W marker get current]
- catch { %W marker configure $marker -bg green}
-}
-
-$graph marker bind all <Leave> {
- set marker [%W marker get current]
- catch { %W marker configure $marker -bg ""}
-}
-
diff --git a/blt3.0.1/demos/scripts/bgtest.tcl b/blt3.0.1/demos/scripts/bgtest.tcl
deleted file mode 100644
index 332d801..0000000
--- a/blt3.0.1/demos/scripts/bgtest.tcl
+++ /dev/null
@@ -1,35 +0,0 @@
-
-set fid [open "../README" "r"]
-set data [read $fid]
-close $fid
-
-regsub -all "\r|\n|\t" $data " " data
-set data [split $data " "]
-
-set count 0
-set maxWords 500
-foreach word $data {
- if { $word == "" } {
- continue
- }
- if { $count & 0x1 } {
- puts -nonewline stderr "($word)"
- flush stderr
- } else {
- puts -nonewline stdout "($word)"
- flush stdout
- }
- incr count
- if { ($count % 10) == 0 } {
- puts stdout ""
- puts stderr ""
- flush stdout
- flush stderr
- }
- if { $count > $maxWords } {
- break
- }
- after 500
-}
-exit 0
-
diff --git a/blt3.0.1/demos/scripts/clone.tcl b/blt3.0.1/demos/scripts/clone.tcl
deleted file mode 100644
index 874f55d..0000000
--- a/blt3.0.1/demos/scripts/clone.tcl
+++ /dev/null
@@ -1,88 +0,0 @@
-
-proc CopyOptions { cmd orig new } {
- set all [eval $orig $cmd]
- set configLine $new
- foreach arg $cmd {
- lappend configLine $arg
- }
- foreach option $all {
- if { [llength $option] != 5 } {
- continue
- }
- set switch [lindex $option 0]
- set initial [lindex $option 3]
- set current [lindex $option 4]
- if { [string compare $initial $current] == 0 } {
- continue
- }
- lappend configLine $switch $current
- }
- eval $configLine
-}
-
-proc CopyBindings { oper orig new args } {
- set tags [$orig $oper bind]
- if { [llength $args] > 0 } {
- lappend tags [lindex $args 0]
- }
- foreach tag $tags {
- foreach binding [$orig $oper bind $tag] {
- set cmd [$orig $oper bind $tag $binding]
- $new $oper bind $tag $binding $cmd
- }
- }
-}
-
-proc CloneGraph { orig new } {
- graph $new
- CopyOptions "configure" $orig $new
- # Axis component
- foreach axis [$orig axis names] {
- if { [$new axis name $axis] == "" } {
- $new axis create $axis
- }
- CopyOptions [list axis configure $axis] $orig $new
- }
- foreach axis { x y x2 y2 } {
- $new ${axis}axis use [$orig ${axis}axis use]
- }
- # Pen component
- foreach pen [$orig pen names] {
- if { [$new pen name $pen] == "" } {
- $new pen create $pen
- }
- CopyOptions [list pen configure $pen] $orig $new
- }
- # Marker component
- foreach marker [$orig marker names] {
- $new marker create [$orig marker type $marker] -name $marker
- CopyBindings marker $orig $new $marker
- CopyOptions [list marker configure $marker] $orig $new
- }
- # Element component
- foreach elem [$orig element names] {
- $new element create $elem
- CopyBindings element $orig $new $elem
- CopyOptions [list element configure $elem] $orig $new
- }
- # Fix element display list
- $new element show [$orig element show]
- # Legend component
- CopyOptions {legend configure} $orig $new
- CopyBindings legend $orig $new
- # Postscript component
- CopyOptions {postscript configure} $orig $new
- # Grid component
- CopyOptions {grid configure} $orig $new
- # Grid component
- CopyOptions {crosshairs configure} $orig $new
- # Graph bindings
- foreach binding [bind $orig] {
- set cmd [bind $orig $binding]
- bind $new $binding $cmd
- }
- return $new
-}
-
-toplevel .top
-pack [CloneGraph $graph .top.graph]
diff --git a/blt3.0.1/demos/scripts/demo.tcl b/blt3.0.1/demos/scripts/demo.tcl
deleted file mode 100644
index 81b0488..0000000
--- a/blt3.0.1/demos/scripts/demo.tcl
+++ /dev/null
@@ -1,28 +0,0 @@
-# ----------------------------------------------------------------------------
-#
-# The following code is solely a convenience so that you can test the
-# BLT distribution without first installing it.
-#
-# ----------------------------------------------------------------------------
-
-# If we're in the ./demos directory, we can simply specify
-# "../library" as the library directory without having to install the
-# files.
-
-if { [file exists ../library/bltGraph.pro] } {
- global blt_library
- set blt_library ../library
- set auto_path [linsert $auto_path 0 $blt_library]
- auto_reset
-}
-
-# Add a binding for convenience to let you exit with pressing the
-# "quit" button.
-
-wm protocol . WM_DELETE_WINDOW { DoExit 0 }
-bind all <Control-KeyPress-c> { DoExit 0 }
-
-proc DoExit { code } {
- #destroy .
- exit $code
-}
diff --git a/blt3.0.1/demos/scripts/globe.tcl b/blt3.0.1/demos/scripts/globe.tcl
deleted file mode 100644
index 9e7e17e..0000000
--- a/blt3.0.1/demos/scripts/globe.tcl
+++ /dev/null
@@ -1,509 +0,0 @@
-blt::bitmap define globe.0 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x40, 0x02, 0x00, 0x00, 0x1c, 0x3c, 0x00, 0x00, 0x01, 0xfe, 0x00,
- 0x80, 0x80, 0xfe, 0x03, 0x60, 0x00, 0xff, 0x07, 0x10, 0xc0, 0xf1, 0x0f,
- 0x00, 0x80, 0xc0, 0x1f, 0x00, 0xc0, 0x07, 0x3f, 0x00, 0xc0, 0xff, 0x3f,
- 0x00, 0xf0, 0xff, 0x4f, 0x02, 0xf0, 0xff, 0x5d, 0x00, 0xf0, 0xff, 0x1b,
- 0x00, 0xf0, 0xff, 0x8f, 0x02, 0xf0, 0xff, 0x0f, 0x06, 0xe0, 0xfc, 0x0f,
- 0x0e, 0x00, 0xf8, 0x0f, 0x0f, 0x00, 0xf8, 0x07, 0x3f, 0x00, 0xf8, 0x03,
- 0x7e, 0x00, 0xf0, 0x03, 0x7e, 0x00, 0xf0, 0x03, 0x3e, 0x00, 0xf0, 0x0b,
- 0x3c, 0x00, 0xf0, 0x09, 0x3c, 0x00, 0xf0, 0x01, 0x18, 0x00, 0xf0, 0x00,
- 0x18, 0x00, 0x70, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00};
-}
-
-blt::bitmap define globe.1 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0xc0, 0x00, 0x00, 0x00, 0x34, 0x38, 0x00, 0x00, 0x02, 0xe8, 0x00,
- 0x80, 0x01, 0xfa, 0x03, 0xe0, 0x00, 0xfc, 0x07, 0x30, 0x00, 0xe6, 0x0f,
- 0x10, 0x00, 0x86, 0x1f, 0x08, 0x00, 0x3e, 0x3c, 0x04, 0x00, 0xff, 0x3f,
- 0x04, 0x80, 0xff, 0x5f, 0x02, 0x80, 0xff, 0x3f, 0x00, 0x80, 0xff, 0x2f,
- 0x00, 0x80, 0xff, 0x3f, 0x0c, 0x00, 0xff, 0x3f, 0x1c, 0x00, 0xee, 0x3f,
- 0x3c, 0x00, 0xc0, 0x3f, 0x7e, 0x00, 0xc0, 0x1f, 0xfe, 0x01, 0x80, 0x1f,
- 0xfc, 0x03, 0x80, 0x1f, 0xfc, 0x01, 0x80, 0x1f, 0xfc, 0x01, 0x80, 0x2f,
- 0xf8, 0x01, 0x80, 0x0f, 0xf0, 0x00, 0x80, 0x17, 0xf0, 0x00, 0x80, 0x03,
- 0xf0, 0x00, 0x80, 0x03, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
- 0x40, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00};
-}
-
-blt::bitmap define globe.2 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0xc0, 0x01, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x04, 0xf0, 0x00,
- 0x80, 0x07, 0xe0, 0x03, 0xe0, 0x01, 0xf0, 0x07, 0xf0, 0x00, 0x38, 0x0f,
- 0x30, 0x00, 0x10, 0x1e, 0x18, 0x00, 0xf0, 0x30, 0x04, 0x00, 0xf8, 0x3f,
- 0x10, 0x00, 0xf8, 0x7f, 0x12, 0x00, 0xfc, 0x7f, 0x02, 0x00, 0xfc, 0x7f,
- 0x04, 0x00, 0xfc, 0x7f, 0x74, 0x00, 0xf8, 0x7f, 0xf0, 0x00, 0x70, 0x7f,
- 0xf8, 0x01, 0x00, 0x7e, 0xf8, 0x03, 0x00, 0x7e, 0xf8, 0x0f, 0x00, 0x7c,
- 0xf8, 0x1f, 0x00, 0x3c, 0xf0, 0x1f, 0x00, 0x3c, 0xf0, 0x0f, 0x00, 0x3e,
- 0xe0, 0x0f, 0x00, 0x5e, 0xc0, 0x07, 0x00, 0x1c, 0xc0, 0x03, 0x00, 0x0e,
- 0xc0, 0x03, 0x00, 0x04, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00,
- 0x80, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x1c, 0x00};
-}
-
-blt::bitmap define globe.3 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0xc0, 0x01, 0x00, 0x00, 0xdc, 0x20, 0x00, 0x00, 0x09, 0xc0, 0x00,
- 0x80, 0x1f, 0xa0, 0x03, 0xe0, 0x07, 0xc0, 0x07, 0xf0, 0x01, 0xc0, 0x0c,
- 0xf8, 0x00, 0x40, 0x18, 0x78, 0x00, 0xc0, 0x23, 0x08, 0x00, 0xc0, 0x3f,
- 0x04, 0x00, 0xe0, 0x7f, 0x54, 0x00, 0xe0, 0x7f, 0x0c, 0x00, 0xc0, 0x7f,
- 0x10, 0x00, 0xc0, 0xff, 0xd0, 0x01, 0xc0, 0xff, 0xc0, 0x03, 0x80, 0xfb,
- 0xe0, 0x0f, 0x00, 0xf0, 0xe0, 0x1f, 0x00, 0xf0, 0xe0, 0xff, 0x00, 0xf0,
- 0xe0, 0xff, 0x00, 0x70, 0xc0, 0xff, 0x00, 0x70, 0xc0, 0x7f, 0x00, 0x70,
- 0x00, 0x7f, 0x00, 0x70, 0x00, 0x3f, 0x00, 0x30, 0x00, 0x1f, 0x00, 0x38,
- 0x00, 0x1f, 0x00, 0x18, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
- 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x18, 0x00};
-}
-
-blt::bitmap define globe.4 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0xc0, 0x03, 0x00, 0x00, 0x7c, 0x03, 0x00, 0x00, 0x13, 0x00, 0x00,
- 0x80, 0x7f, 0xc0, 0x03, 0xc0, 0x1f, 0x00, 0x07, 0xe0, 0x0f, 0x00, 0x0d,
- 0xf0, 0x03, 0x00, 0x10, 0xf0, 0x01, 0x00, 0x0e, 0x38, 0x01, 0x00, 0x3e,
- 0x10, 0x00, 0x00, 0x7f, 0x50, 0x00, 0x00, 0x7f, 0x30, 0x00, 0x00, 0x7f,
- 0x40, 0x00, 0x00, 0xff, 0x00, 0x1e, 0x00, 0xfe, 0x00, 0x3f, 0x00, 0xec,
- 0x00, 0x7f, 0x00, 0xc0, 0x00, 0xff, 0x00, 0xc0, 0x00, 0xff, 0x07, 0xc0,
- 0x00, 0xff, 0x0f, 0xc0, 0x00, 0xfe, 0x07, 0xc0, 0x00, 0xfe, 0x07, 0xc0,
- 0x00, 0xf8, 0x03, 0x40, 0x00, 0xf8, 0x01, 0x60, 0x00, 0xf8, 0x00, 0x20,
- 0x00, 0xf8, 0x00, 0x20, 0x00, 0x38, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
- 0x00, 0x18, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x00};
-}
-
-blt::bitmap define globe.5 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0xc0, 0x03, 0x00, 0x00, 0xbc, 0x06, 0x00, 0x00, 0xcf, 0x00, 0x00,
- 0x80, 0xff, 0x01, 0x02, 0xc0, 0x7f, 0x00, 0x06, 0xc0, 0x3f, 0x00, 0x0e,
- 0xe0, 0x1f, 0x00, 0x14, 0xe0, 0x0f, 0x00, 0x18, 0xe0, 0x00, 0x00, 0x38,
- 0x60, 0x00, 0x00, 0x78, 0x40, 0x08, 0x00, 0x78, 0xc0, 0x01, 0x00, 0x78,
- 0x00, 0x02, 0x00, 0xf8, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x01, 0xb0,
- 0x00, 0xf8, 0x07, 0x80, 0x00, 0xf8, 0x0f, 0x80, 0x00, 0xf8, 0x3f, 0x00,
- 0x00, 0xf8, 0x7f, 0x00, 0x00, 0xf0, 0x3f, 0x80, 0x00, 0xf0, 0x3f, 0x80,
- 0x00, 0xc0, 0x1f, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0xc0, 0x07, 0x40,
- 0x00, 0xc0, 0x07, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00,
- 0x00, 0x60, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x10, 0x00};
-}
-
-blt::bitmap define globe.6 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x80, 0x07, 0x00, 0x00, 0x7c, 0x0d, 0x00, 0x00, 0x9f, 0x03, 0x00,
- 0x00, 0xff, 0x07, 0x02, 0x00, 0xff, 0x03, 0x04, 0x80, 0xff, 0x00, 0x08,
- 0xc0, 0x7f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x30, 0x80, 0x07, 0x00, 0x20,
- 0x00, 0x03, 0x00, 0x60, 0x00, 0x03, 0x00, 0x60, 0x00, 0x0e, 0x00, 0x60,
- 0x00, 0x10, 0x00, 0xe0, 0x00, 0x80, 0x07, 0xc0, 0x00, 0x80, 0x0f, 0xc0,
- 0x00, 0x80, 0x3f, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0xc0, 0xff, 0x01,
- 0x00, 0xc0, 0xff, 0x03, 0x00, 0x80, 0xff, 0x01, 0x00, 0x80, 0xff, 0x01,
- 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x3e, 0x00,
- 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x03, 0x00,
- 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00};
-}
-
-blt::bitmap define globe.7 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x80, 0x07, 0x00, 0x00, 0xfc, 0x1a, 0x00, 0x00, 0x7d, 0x02, 0x00,
- 0x00, 0xfe, 0x1f, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xfe, 0x07, 0x00,
- 0x00, 0xff, 0x03, 0x00, 0x00, 0xfe, 0x01, 0x20, 0x00, 0x1c, 0x01, 0x00,
- 0x00, 0x1c, 0x00, 0x40, 0x00, 0x18, 0x00, 0x40, 0x00, 0x70, 0x00, 0x00,
- 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x39, 0x80, 0x00, 0x00, 0x7c, 0x00,
- 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0xfe, 0x0f,
- 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0xf8, 0x07,
- 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x01,
- 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x18, 0x00,
- 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00};
-}
-
-blt::bitmap define globe.8 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x07, 0x00, 0x00, 0xfc, 0x25, 0x00, 0x00, 0xf8, 0x19, 0x00,
- 0x00, 0xf8, 0x7f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xf8, 0x1f, 0x00,
- 0x00, 0xf8, 0x1f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf0, 0x08, 0x00,
- 0x00, 0xf0, 0x00, 0x00, 0x00, 0xc0, 0x04, 0x00, 0x00, 0x80, 0x03, 0x00,
- 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0xe0, 0x03,
- 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xf0, 0x3f,
- 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0xc0, 0x1f,
- 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xc0, 0x07,
- 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x60, 0x00,
- 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00};
-}
-
-blt::bitmap define globe.9 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x03, 0x00, 0x00, 0xfc, 0x27, 0x00, 0x00, 0xf0, 0x13, 0x00,
- 0x00, 0xe0, 0xff, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0xe0, 0x7f, 0x00,
- 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x80, 0x47, 0x00,
- 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x1c, 0x00,
- 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x40, 0x0e, 0x00, 0x00, 0x00, 0x1f,
- 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x7f,
- 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x7e,
- 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x1e,
- 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x80, 0x01,
- 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00};
-}
-
-blt::bitmap define globe.10 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x06, 0x00, 0x00, 0xf4, 0x2f, 0x00, 0x00, 0xc8, 0x4f, 0x00,
- 0x00, 0x80, 0xff, 0x01, 0x00, 0x80, 0xff, 0x01, 0x00, 0x80, 0xff, 0x01,
- 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x3c, 0x00,
- 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x30, 0x04, 0x00, 0x00, 0xe0, 0x00,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x38,
- 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xfc,
- 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xf8,
- 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x38,
- 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x06,
- 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00};
-}
-
-blt::bitmap define globe.11 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x06, 0x00, 0x00, 0xec, 0x1f, 0x00, 0x00, 0x91, 0x9f, 0x00,
- 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0xfc, 0x07,
- 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0xf0, 0x01,
- 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x00, 0x07,
- 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xe0,
- 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xe0,
- 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xe0,
- 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60,
- 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x08,
- 0x40, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00};
-}
-
-blt::bitmap define globe.12 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x04, 0x00, 0x00, 0xdc, 0x3f, 0x00, 0x00, 0x42, 0x7e, 0x00,
- 0x00, 0x00, 0xf8, 0x03, 0x20, 0x00, 0xf0, 0x07, 0x10, 0x00, 0xf0, 0x0f,
- 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x07,
- 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x18,
- 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80,
- 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80,
- 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x80,
- 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x40,
- 0x08, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
- 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-}
-
-blt::bitmap define globe.13 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x04, 0x00, 0x00, 0xbc, 0x3f, 0x00, 0x00, 0x01, 0x79, 0x00,
- 0x80, 0x00, 0xe0, 0x03, 0x60, 0x00, 0xc0, 0x07, 0x10, 0x00, 0x80, 0x0f,
- 0x00, 0x00, 0x80, 0x1f, 0x08, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1c,
- 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x20,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00};
-}
-
-blt::bitmap define globe.14 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x03, 0xe6, 0x00,
- 0x80, 0x01, 0xc0, 0x03, 0x60, 0x00, 0x00, 0x07, 0x30, 0x00, 0x00, 0x0f,
- 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00, 0x30,
- 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
- 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
- 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00,
- 0x78, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00};
-}
-
-blt::bitmap define globe.15 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3d, 0x00, 0x00, 0x27, 0xc8, 0x00,
- 0x80, 0x13, 0x00, 0x03, 0xe0, 0x01, 0x00, 0x06, 0x70, 0x00, 0x00, 0x0c,
- 0x10, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x20,
- 0x0c, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
- 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
- 0xf8, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00,
- 0xf0, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
- 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00};
-}
-
-blt::bitmap define globe.16 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3b, 0x00, 0x00, 0x9f, 0xa0, 0x00,
- 0x80, 0x4f, 0x00, 0x02, 0xe0, 0x0f, 0x00, 0x04, 0xf0, 0x01, 0x00, 0x08,
- 0x70, 0x00, 0x00, 0x10, 0x38, 0x00, 0x00, 0x20, 0x3c, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
- 0x28, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00,
- 0xe0, 0x07, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00,
- 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00};
-}
-
-blt::bitmap define globe.17 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x37, 0x00, 0x00, 0x3f, 0x42, 0x00,
- 0x80, 0x3f, 0x01, 0x02, 0xe0, 0x1f, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00,
- 0xf0, 0x11, 0x00, 0x00, 0xf8, 0x04, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00,
- 0x7c, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x08, 0x18, 0x00, 0x00,
- 0x00, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00,
- 0x00, 0x3f, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00,
- 0x80, 0x7f, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00};
-}
-
-blt::bitmap define globe.18 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0x84, 0x00,
- 0x80, 0xff, 0x04, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xf0, 0x9f, 0x00, 0x00,
- 0xf0, 0x97, 0x00, 0x00, 0xf8, 0x27, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00,
- 0xfc, 0x03, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
- 0x60, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
- 0x20, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x00, 0xc0, 0x05, 0x00,
- 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x01, 0x00,
- 0x00, 0xfc, 0x01, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0xfe, 0x03, 0x00,
- 0x00, 0xfc, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00};
-}
-
-blt::bitmap define globe.19 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x40, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0x13, 0x00,
- 0x80, 0xff, 0x13, 0x00, 0xe0, 0xff, 0x03, 0x00, 0xf0, 0xff, 0x00, 0x00,
- 0xf0, 0x9f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00,
- 0xf8, 0x1f, 0x00, 0x00, 0xba, 0x07, 0x00, 0x00, 0x98, 0x23, 0x00, 0x00,
- 0x08, 0x03, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x80, 0x09, 0x00, 0x00, 0x00, 0x0d, 0x01, 0x00, 0x00, 0x21, 0x0e, 0x00,
- 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x09, 0x00,
- 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xf0, 0x1f, 0x00,
- 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00};
-}
-
-blt::bitmap define globe.20 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0x07, 0x00,
- 0x80, 0xff, 0x0f, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0x13, 0x00,
- 0xf0, 0xff, 0x10, 0x00, 0xf8, 0xff, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00,
- 0xf4, 0xff, 0x00, 0x00, 0xe6, 0x1e, 0x00, 0x00, 0x62, 0x1c, 0x01, 0x00,
- 0x20, 0x18, 0x00, 0x00, 0x20, 0x10, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00,
- 0x01, 0xcc, 0x00, 0x00, 0x01, 0x68, 0x08, 0x00, 0x00, 0x00, 0x60, 0x00,
- 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00,
- 0x00, 0x00, 0x7e, 0x00, 0x00, 0x80, 0xff, 0x00, 0x00, 0x80, 0xff, 0x00,
- 0x00, 0x80, 0xff, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x04,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00};
-}
-
-blt::bitmap define globe.21 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x80, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0x1f, 0x00,
- 0x80, 0xff, 0xbf, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0x1f, 0x00,
- 0xf8, 0xff, 0x17, 0x00, 0xf8, 0xff, 0x27, 0x00, 0xec, 0xff, 0x0f, 0x00,
- 0x8c, 0xff, 0x07, 0x00, 0x9e, 0xf7, 0x00, 0x00, 0x0e, 0xe3, 0x00, 0x00,
- 0x06, 0xc1, 0x00, 0x00, 0x06, 0x81, 0x10, 0x00, 0x03, 0x40, 0x04, 0x00,
- 0x03, 0x20, 0x06, 0x00, 0x03, 0x40, 0x06, 0x00, 0x01, 0x80, 0x00, 0x03,
- 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0xe0, 0x02,
- 0x02, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xfc, 0x03,
- 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00};
-}
-
-blt::bitmap define globe.22 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x01, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0x3f, 0x00,
- 0x80, 0xff, 0x7f, 0x00, 0xe0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0x7f, 0x00,
- 0xf0, 0xff, 0x1f, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0x3f, 0x00,
- 0x34, 0xfe, 0x3f, 0x00, 0x76, 0xbc, 0x07, 0x00, 0x36, 0x1c, 0x07, 0x00,
- 0x0e, 0x08, 0x0e, 0x00, 0x1e, 0x08, 0x80, 0x00, 0x0f, 0x00, 0x02, 0x00,
- 0x0f, 0x00, 0x20, 0x00, 0x07, 0x00, 0x36, 0x00, 0x07, 0x00, 0x04, 0x08,
- 0x07, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x0b,
- 0x16, 0x00, 0x80, 0x0f, 0x04, 0x00, 0xe0, 0x0f, 0x04, 0x00, 0xe0, 0x0f,
- 0x08, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00};
-}
-
-blt::bitmap define globe.23 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0x7f, 0x00,
- 0x80, 0xff, 0xff, 0x01, 0xe0, 0xff, 0xff, 0x01, 0xe0, 0xff, 0xff, 0x01,
- 0xe8, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0x00, 0xfc, 0xfe, 0xff, 0x01,
- 0xdc, 0xf2, 0xff, 0x01, 0xde, 0xe3, 0x3d, 0x00, 0xde, 0xe1, 0x38, 0x02,
- 0x7e, 0x40, 0x70, 0x00, 0xfe, 0x40, 0x00, 0x04, 0x7f, 0x00, 0x00, 0x00,
- 0x3e, 0x00, 0x30, 0x01, 0x3e, 0x00, 0xa0, 0x01, 0x1e, 0x00, 0x20, 0x20,
- 0x1e, 0x00, 0x00, 0x20, 0x1c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x3c,
- 0x1c, 0x00, 0x00, 0x3e, 0x1c, 0x00, 0x00, 0x3f, 0x18, 0x00, 0x80, 0x3f,
- 0x10, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00};
-}
-
-blt::bitmap define globe.24 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x02, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xfe, 0xff, 0x00,
- 0x80, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x03,
- 0xe0, 0xff, 0xff, 0x03, 0x18, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0x07,
- 0x7c, 0x87, 0xff, 0x07, 0xfe, 0x1f, 0xef, 0x01, 0xfe, 0x0e, 0xc6, 0x01,
- 0xfe, 0x01, 0x82, 0x03, 0xfe, 0x03, 0x02, 0x00, 0xff, 0x03, 0x00, 0x08,
- 0xfc, 0x01, 0x80, 0x09, 0xfc, 0x00, 0x00, 0x0d, 0xfc, 0x00, 0x00, 0x00,
- 0xf8, 0x00, 0x00, 0x80, 0xf8, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x20,
- 0x78, 0x02, 0x00, 0x70, 0x70, 0x02, 0x00, 0x7c, 0x70, 0x00, 0x00, 0x3c,
- 0x60, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00};
-}
-
-blt::bitmap define globe.25 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0xfc, 0xff, 0x00,
- 0x80, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x07, 0xa0, 0xff, 0xff, 0x07,
- 0x10, 0xff, 0xff, 0x07, 0x30, 0xf8, 0xff, 0x0f, 0xf8, 0xdf, 0xff, 0x1f,
- 0xfc, 0x3b, 0xfc, 0x1f, 0xfc, 0xfb, 0x78, 0x07, 0xfe, 0x77, 0x30, 0x0e,
- 0xfe, 0x1f, 0x30, 0x0c, 0xfe, 0x3f, 0x00, 0x48, 0xfe, 0x1f, 0x00, 0x00,
- 0xf0, 0x0f, 0x00, 0x24, 0xf0, 0x07, 0x00, 0xa0, 0xf0, 0x07, 0x00, 0x08,
- 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x27, 0x00, 0xc0,
- 0xe0, 0x13, 0x00, 0x40, 0xc0, 0x13, 0x00, 0x70, 0xc0, 0x03, 0x00, 0x70,
- 0x80, 0x01, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00};
-}
-
-blt::bitmap define globe.26 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x40, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0xe8, 0xff, 0x00,
- 0x00, 0xfc, 0xff, 0x03, 0x00, 0xff, 0xff, 0x07, 0xc0, 0xfe, 0xff, 0x0f,
- 0x40, 0xf0, 0xff, 0x1f, 0xe0, 0xe0, 0xff, 0x1f, 0xf0, 0xff, 0xfe, 0x3f,
- 0xf8, 0xdf, 0xe1, 0x3f, 0xf8, 0xdf, 0xc7, 0x1b, 0xfc, 0xbf, 0x83, 0x19,
- 0xfc, 0xff, 0x80, 0x30, 0xfc, 0xff, 0x01, 0x20, 0xf8, 0xff, 0x00, 0x00,
- 0xc0, 0xff, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0xe0, 0x80, 0x3f, 0x00, 0x20,
- 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x01, 0x80,
- 0x80, 0x9f, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x40, 0x00, 0x0f, 0x00, 0x60,
- 0x00, 0x0e, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00};
-}
-
-blt::bitmap define globe.27 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x80, 0x00, 0x00, 0x00, 0xc4, 0x3f, 0x00, 0x00, 0xf0, 0xff, 0x00,
- 0x00, 0xfe, 0xff, 0x03, 0x00, 0xfe, 0xff, 0x07, 0x00, 0xeb, 0xff, 0x0f,
- 0x80, 0xc9, 0xff, 0x1f, 0x80, 0x07, 0xff, 0x3f, 0xc0, 0xff, 0xf7, 0x3f,
- 0xe0, 0xff, 0x0e, 0x7f, 0xf0, 0xff, 0x3e, 0x6e, 0xf0, 0xff, 0x1d, 0x64,
- 0xf0, 0xff, 0x07, 0x44, 0xf0, 0xff, 0x0f, 0x00, 0x60, 0xff, 0x0f, 0x00,
- 0x00, 0xfe, 0x07, 0x40, 0x00, 0xfe, 0x03, 0x00, 0x01, 0xfc, 0x01, 0x00,
- 0x01, 0xfc, 0x01, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0xfc, 0x09, 0x00,
- 0x02, 0xfc, 0x08, 0x00, 0x00, 0xf8, 0x04, 0x00, 0x00, 0x78, 0x00, 0x40,
- 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00};
-}
-
-blt::bitmap define globe.28 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x3f, 0x00, 0x00, 0x40, 0xff, 0x00,
- 0x00, 0xe8, 0xff, 0x03, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x8c, 0xff, 0x0f,
- 0x00, 0x06, 0xfe, 0x1f, 0x00, 0x1e, 0xf8, 0x3f, 0x00, 0xff, 0xbf, 0x3f,
- 0x80, 0xff, 0x77, 0x7c, 0x80, 0xff, 0xff, 0x79, 0xc0, 0xff, 0xef, 0x10,
- 0xc0, 0xff, 0x3f, 0x90, 0xc0, 0xff, 0x7f, 0x00, 0x81, 0xfb, 0x7f, 0x00,
- 0x01, 0xf0, 0x3f, 0x00, 0x01, 0xf0, 0x1f, 0x00, 0x03, 0xe0, 0x1f, 0x00,
- 0x07, 0xe0, 0x0f, 0x00, 0x02, 0xc0, 0x1f, 0x00, 0x02, 0xe0, 0x5f, 0x00,
- 0x06, 0xe0, 0x47, 0x00, 0x04, 0xc0, 0x27, 0x00, 0x04, 0xc0, 0x03, 0x00,
- 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00};
-}
-
-blt::bitmap define globe.29 {
-#define globe_width 32
-#define globe_height 32
-static char globe_bits[] = {
- 0x00, 0x40, 0x01, 0x00, 0x00, 0x0c, 0x3f, 0x00, 0x00, 0x80, 0xfd, 0x00,
- 0x00, 0xa0, 0xff, 0x03, 0x20, 0xe0, 0xff, 0x07, 0x00, 0x30, 0xfd, 0x0f,
- 0x00, 0x10, 0xf4, 0x1f, 0x00, 0xf8, 0xc0, 0x3f, 0x00, 0xf8, 0xff, 0x3f,
- 0x00, 0xfc, 0xbf, 0x73, 0x00, 0xfe, 0xff, 0x67, 0x00, 0xfe, 0x7f, 0x47,
- 0x00, 0xfe, 0xff, 0x41, 0x00, 0xfe, 0xff, 0x03, 0x01, 0xdc, 0xff, 0x03,
- 0x03, 0x00, 0xff, 0x01, 0x07, 0x80, 0xff, 0x00, 0x0f, 0x00, 0xff, 0x00,
- 0x1f, 0x00, 0x7e, 0x00, 0x0e, 0x00, 0xfe, 0x00, 0x0e, 0x00, 0xff, 0x02,
- 0x0e, 0x00, 0x3f, 0x01, 0x0c, 0x00, 0x3e, 0x01, 0x0c, 0x00, 0x1e, 0x00,
- 0x08, 0x00, 0x1c, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00};
-}
diff --git a/blt3.0.1/demos/scripts/graph1.tcl b/blt3.0.1/demos/scripts/graph1.tcl
deleted file mode 100644
index c59f442..0000000
--- a/blt3.0.1/demos/scripts/graph1.tcl
+++ /dev/null
@@ -1,72 +0,0 @@
-
-set X {
- 2.00000e-01 4.00000e-01 6.00000e-01 8.00000e-01 1.00000e+00
- 1.20000e+00 1.40000e+00 1.60000e+00 1.80000e+00 2.00000e+00
- 2.20000e+00 2.40000e+00 2.60000e+00 2.80000e+00 3.00000e+00
- 3.20000e+00 3.40000e+00 3.60000e+00 3.80000e+00 4.00000e+00
- 4.20000e+00 4.40000e+00 4.60000e+00 4.80000e+00 5.00000e+00
-}
-
-set Y1 {
- 4.07008e+01 7.95658e+01 1.16585e+02 1.51750e+02 1.85051e+02
- 2.16479e+02 2.46024e+02 2.73676e+02 2.99427e+02 3.23267e+02
- 3.45187e+02 3.65177e+02 3.83228e+02 3.99331e+02 4.13476e+02
- 4.25655e+02 4.35856e+02 4.44073e+02 4.50294e+02 4.54512e+02
- 4.56716e+02 4.57596e+02 4.58448e+02 4.59299e+02 4.60151e+02
-}
-
-set Y2 {
- 5.14471e-00 2.09373e+01 2.84608e+01 3.40080e+01 3.75691e+01
- 3.91345e+01 3.92706e+01 3.93474e+01 3.94242e+01 3.95010e+01
- 3.95778e+01 3.96545e+01 3.97313e+01 3.98081e+01 3.98849e+01
- 3.99617e+01 4.00384e+01 4.01152e+01 4.01920e+01 4.02688e+01
- 4.03455e+01 4.04223e+01 4.04990e+01 4.05758e+01 4.06526e+01
-}
-
-set Y3 {
- 2.61825e+01 5.04696e+01 7.28517e+01 9.33192e+01 1.11863e+02
- 1.28473e+02 1.43140e+02 1.55854e+02 1.66606e+02 1.75386e+02
- 1.82185e+02 1.86994e+02 1.89802e+02 1.90683e+02 1.91047e+02
- 1.91411e+02 1.91775e+02 1.92139e+02 1.92503e+02 1.92867e+02
- 1.93231e+02 1.93595e+02 1.93958e+02 1.94322e+02 1.94686e+02
-}
-
-set configOptions {
- Element.Pixels 6
- Element.Smooth catrom
- Legend.ActiveBackground khaki2
- Legend.ActiveRelief sunken
- Legend.Background ""
- Legend.Position plotarea
- Title "A Simple X-Y Graph"
- activeLine.Color yellow4
- activeLine.Fill yellow
- background khaki3
- line1.Color red4
- line1.Fill red1
- line1.Symbol circle
- line2.Color purple4
- line2.Fill purple1
- line2.Symbol arrow
- line3.Color green4
- line3.Fill green1
- line3.Symbol triangle
- x.Descending no
- x.Loose no
- x.Title "X Axis Label"
- y.Rotate 90
- y.Title "Y Axis Label"
-}
-
-set resource [string trimleft $graph .]
-foreach { option value } $configOptions {
- option add *$resource.$option $value
-}
-$graph element create line1 -x $X -y $Y2
-$graph element create line2 -x $X -y $Y3
-$graph element create line3 -x $X -y $Y1
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
diff --git a/blt3.0.1/demos/scripts/graph2.tcl b/blt3.0.1/demos/scripts/graph2.tcl
deleted file mode 100644
index 5b09a3f..0000000
--- a/blt3.0.1/demos/scripts/graph2.tcl
+++ /dev/null
@@ -1,151 +0,0 @@
-option add *HighlightThickness 0
-option add *Tile bgTexture
-option add *Button.Tile ""
-
-image create picture bgTexture -file ./images/chalk.gif
-
-set configOptions [subst {
- InvertXY no
- Axis.TickFont { {Sans Serif} 14 bold }
- Axis.TitleFont { {Sans Serif} 12 bold }
- BorderWidth 2
- Element.Pixels 8
- Element.ScaleSymbols true
- Element.Smooth cubic
- Font { {Serif} 10 }
- Foreground white
- Legend.ActiveBorderWidth 2
- Legend.ActiveRelief raised
- Legend.Anchor ne
- Legend.BorderWidth 0
- Legend.Font { Serif 14 }
- Legend.Foreground orange
- #Legend.Position plotarea
- Legend.Hide yes
- Legend.Relief flat
- Postscript.Preview yes
- Relief raised
- Shadow { navyblue 2 }
- Title "Bitmap Symbols"
- degrees.Command [namespace current]::FormatAxisLabel
- degrees.LimitsFormat "Deg=%g"
- degrees.Subdivisions 0
- degrees.Title "Degrees"
- degrees.stepSize 90
- temp.LimitsFormat "Temp=%g"
- temp.Title "Temperature"
- y.Color purple2
- y.LimitsFormat "Y=%g"
- y.Rotate 90
- y.Title "Y"
- y.loose no
- y2.Color magenta3
- y2.Hide no
- xy2.Rotate 270
- y2.Rotate 0
- y2.Title "Y2"
- y2.LimitsFormat "Y2=%g"
- x2.LimitsFormat "x2=%g"
-}]
-
-set resource [string trimleft $graph .]
-foreach { option value } $configOptions {
- option add *$resource.$option $value
-}
-
-proc FormatAxisLabel {graph x} {
- format "%d%c" [expr int($x)] 0xB0
-}
-
-set max -1.0
-set step 0.2
-
-set letters { A B C D E F G H I J K L }
-set count 0
-for { set level 30 } { $level <= 100 } { incr level 10 } {
- set color [format "#dd0d%0.2x" [expr round($level*2.55)]]
- set pen "pen$count"
- set symbol "symbol$count"
- set im [image create picture -width 25 -height 35]
- $im blank 0x00000000
- if 0 {
- $im draw text [lindex $letters $count] 0 0 -color $color \
- -font "Arial 12" -anchor nw
- }
- $graph pen create $pen -symbol $im
- set min $max
- set max [expr $max + $step]
- lappend styles "$pen $min $max"
- incr count
-}
-
-$graph axis create temp \
- -color lightgreen \
- -title Temp
-$graph axis create degrees \
- -rotate 90
-$graph xaxis use degrees
-
-set tcl_precision 15
-set pi1_2 [expr 3.14159265358979323846/180.0]
-
-blt::vector create w x sinX cosX radians
-x seq -360.0 360.0 10.0
-#x seq -360.0 -180.0 30.0
-radians expr { x * $pi1_2 }
-sinX expr sin(radians)
-cosX expr cos(radians)
-cosX dup w
-blt::vector destroy radians
-
-blt::vector create xh xl yh yl
-set pct [expr ($cosX(max) - $cosX(min)) * 0.025]
-yh expr {cosX + $pct}
-yl expr {cosX - $pct}
-set pct [expr ($x(max) - $x(min)) * 0.025]
-xh expr {x + $pct}
-xl expr {x - $pct}
-
-set s1 [image create picture -width 25 -height 25]
-$s1 blank 0x00000000
-
-$s1 draw circle 11 11 7 -shadow 0 -linewidth 2 \
- -fill 0x90FF0000 -antialias yes
-
-$graph element create line3 \
- -color green4 \
- -fill green \
- -label "cos(x)" \
- -mapx degrees \
- -styles $styles \
- -symbol $s1 \
- -weights w \
- -x x \
- -y cosX \
- -yhigh yh -ylow yl
-
-set s2 [image create picture -width 25 -height 25]
-$s2 blank 0x00000000
-
-$s2 draw circle 12 12 7 -shadow 0 -linewidth 2 \
- -fill 0x9000FF00 -antialias yes \
- -outline orange
-
-$graph element create line1 \
- -color orange \
- -outline black \
- -fill orange \
- -fill yellow \
- -label "sin(x)" \
- -mapx degrees \
- -pixels 6m \
- -symbol $s2 \
- -x x \
- -y sinX
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-#Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
-Blt_PrintKey $graph
-
diff --git a/blt3.0.1/demos/scripts/graph3.tcl b/blt3.0.1/demos/scripts/graph3.tcl
deleted file mode 100644
index 57dd893..0000000
--- a/blt3.0.1/demos/scripts/graph3.tcl
+++ /dev/null
@@ -1,88 +0,0 @@
-proc FormatAxisLabel {graph x} {
- return "[expr int($x)]\260"
-}
-
-set configOptions [subst {
- Axis.Hide no
- Axis.Limits "%g"
- BorderWidth 1
- Element.Pixels 1.75m
- Element.ScaleSymbols no
- Legend.ActiveBorderWidth 2
- Legend.ActiveRelief raised
- Legend.Anchor ne
- Legend.BorderWidth 0
- Legend.Position plotarea
- Relief sunken
- Title "Sine and Cosine Functions"
- x.Command [namespace current]::FormatAxisLabel
- x.StepSize 90
- x.Subdivisions 0
- x.Title "X"
- y.Color purple2
- y.Loose no
- y.Title "Y"
- y.rotate 90
- y2.color magenta3
-}]
-
-set resName [string trimleft $graph .]
-foreach { option value } $configOptions {
- option add *$resName.$option $value
-}
-
-$graph configure -leftvar changed
-
-set tcl_precision 15
-set pi1_2 [expr 3.14159265358979323846/180.0]
-
-blt::vector create x sinX cosX -variable ""
-x seq -360 360 100
-sinX expr { sin(x*$pi1_2) }
-cosX expr { cos(x*$pi1_2) }
-set s1 [image create picture -width 25 -height 25]
-$s1 blank 0x00000000
-
-$s1 draw circle 12 12 5 -shadow 0 -linewidth 1 \
- -fill 0x90FF0000 -antialias yes
-$graph element create line1 \
- -label "sin(x)" \
- -fill orange \
- -color black \
- -x x \
- -y sinX \
- -symbol $s1
-
-set s2 [image create picture -width 25 -height 25]
-$s2 blank 0x00000000
-
-$s2 draw circle 12 12 5 -shadow 0 -linewidth 1 \
- -fill 0x900000F0 -antialias yes \
- -outline orange
-set s2 splus
-$graph element create line2 \
- -label "cos(x)" \
- -color yellow4 \
- -fill yellow \
- -x x \
- -y cosX \
- -symbol $s2
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
-#Blt_PrintKey $graph
-
-$graph marker create bitmap \
- -name bg \
- -coords "-360 -1 360 1" \
- -bitmap @bitmaps/greenback.xbm \
- -bg darkseagreen1 \
- -fg darkseagreen3 \
- -under yes \
- -rotate 45
-# -rotate 45
-$graph postscript configure \
- -landscape yes
-
diff --git a/blt3.0.1/demos/scripts/graph5.tcl b/blt3.0.1/demos/scripts/graph5.tcl
deleted file mode 100644
index 89b7903..0000000
--- a/blt3.0.1/demos/scripts/graph5.tcl
+++ /dev/null
@@ -1,65 +0,0 @@
-
-set configOptions {
- Element.LineWidth 0
- Element.Pixels 0.7c
- Element.ScaleSymbols true
- Font { Courier 18 bold}
- Height 4i
- Legend.ActiveRelief raised
- Legend.Font { Courier 14 }
- Legend.padY 0
- Title "Element Symbol Types"
- Width 5i
-}
-set resName [string trimleft $graph .]
-foreach { option value } $configOptions {
- option add *$resName.$option $value
-}
-
-blt::vector xValues
-xValues set {
- 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
-}
-
-for { set i 0 } { $i < 10 } { incr i } {
- set vecName "y${i}"
- blt::vector ${vecName}(10)
- $vecName variable x
- set x(:) [expr $i*50.0+10.0]
-}
-
-set attributes {
- none "None" red red4 y0
- circle "Circle" yellow yellow4 y2
- cross "Cross" cyan cyan4 y6
- diamond "Diamond" green green4 y3
- plus "Plus" magenta magenta4 y9
- splus "Splus" Purple purple4 y7
- scross "Scross" red red4 y8
- square "Square" orange orange4 y1
- triangle "Triangle" blue blue4 y4
- "@bitmaps/hobbes.xbm @bitmaps/hobbes_mask.xbm"
- "Bitmap" yellow black y5
-}
-
-set count 0
-foreach { symbol label fill color yVec } $attributes {
- $graph element create line${count} \
- -label $label \
- -symbol $symbol \
- -color $color \
- -fill $fill \
- -x xValues \
- -y $yVec
- incr count
-}
-$graph element configure line0 \
- -dashes { 2 4 2 } \
- -linewidth 2
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
-Blt_PrintKey $graph
-
diff --git a/blt3.0.1/demos/scripts/graph8.tcl b/blt3.0.1/demos/scripts/graph8.tcl
deleted file mode 100644
index 86f94d7..0000000
--- a/blt3.0.1/demos/scripts/graph8.tcl
+++ /dev/null
@@ -1,85 +0,0 @@
-
-set X {
- 2.00000e-01 4.00000e-01 6.00000e-01 8.00000e-01 1.00000e+00
- 1.20000e+00 1.40000e+00 1.60000e+00 1.80000e+00 2.00000e+00
- 2.20000e+00 2.40000e+00 2.60000e+00 2.80000e+00 3.00000e+00
- 3.20000e+00 3.40000e+00 3.60000e+00 3.80000e+00 4.00000e+00
- 4.20000e+00 4.40000e+00 4.60000e+00 4.80000e+00 5.00000e+00
-}
-
-set Y1 {
- 1.14471e+01 2.09373e+01 2.84608e+01 3.40080e+01 3.75691e+01
- 3.91345e+01 3.92706e+01 3.93474e+01 3.94242e+01 3.95010e+01
- 3.95778e+01 3.96545e+01 3.97313e+01 3.98081e+01 3.98849e+01
- 3.99617e+01 4.00384e+01 4.01152e+01 4.01920e+01 4.02688e+01
- 4.03455e+01 4.04223e+01 4.04990e+01 4.05758e+01 4.06526e+01
-}
-
-set Y2 {
- 2.61825e+01 5.04696e+01 7.28517e+01 9.33192e+01 1.11863e+02
- 1.28473e+02 1.43140e+02 1.55854e+02 1.66606e+02 1.75386e+02
- 1.82185e+02 1.86994e+02 1.89802e+02 1.90683e+02 1.91047e+02
- 1.91411e+02 1.91775e+02 1.92139e+02 1.92503e+02 1.92867e+02
- 1.93231e+02 1.93595e+02 1.93958e+02 1.94322e+02 1.94686e+02
-}
-
-set Y3 {
- 4.07008e+01 7.95658e+01 1.16585e+02 1.51750e+02 1.85051e+02
- 2.16479e+02 2.46024e+02 2.73676e+02 2.99427e+02 3.23267e+02
- 3.45187e+02 3.65177e+02 3.83228e+02 3.99331e+02 4.13476e+02
- 4.25655e+02 4.35856e+02 4.44073e+02 4.50294e+02 4.54512e+02
- 4.56716e+02 4.57596e+02 4.58448e+02 4.59299e+02 4.60151e+02
-}
-
-
-proc FormatLabel { w value } {
- return $value
-}
-
-#option add *Graph.aspect 1.25
-option add *Graph.title "A Simple X-Y Graph"
-option add *Graph.x.loose yes
-option add *Graph.x.title "X Axis Label"
-option add *Graph.y.title "Y Axis Label"
-option add *Graph.y.rotate 90
-option add *Graph.y.logScale yes
-option add *Graph.y.loose no
-option add *Graph.Axis.titleFont {Times 18 bold}
-
-option add *Legend.activeRelief sunken
-option add *Legend.background ""
-option add *Legend.activeBackground khaki2
-option add *Graph.background brown
-option add *Element.xData $X
-option add *activeLine.Color yellow4
-option add *activeLine.Fill yellow
-option add *Element.smooth natural
-option add *Element.pixels 6
-option add *Element.scaleSymbols yes
-
-option add *Graph.line1.symbol circle
-option add *Graph.line1.color red4
-option add *Graph.line1.fill red1
-
-option add *Graph.line2.symbol square
-option add *Graph.line2.color purple4
-option add *Graph.line2.fill purple1
-
-option add *Graph.line3.symbol triangle
-option add *Graph.line3.color green4
-option add *Graph.line3.fill green1
-
-$graph configure \
- -width 4i \
- -height 5i
-$graph element create line1 \
- -ydata $Y2
-$graph element create line2 \
- -ydata $Y3
-$graph element create line3 \
- -ydata $Y1
-
-Blt_ZoomStack $graph
-Blt_Crosshairs $graph
-Blt_ActiveLegend $graph
-Blt_ClosestPoint $graph
diff --git a/blt3.0.1/demos/scripts/page.tcl b/blt3.0.1/demos/scripts/page.tcl
deleted file mode 100755
index c00cbc0..0000000
--- a/blt3.0.1/demos/scripts/page.tcl
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/local/bin/tclsh
-
-array set page "
- rows 2
- columns 2
- padx 0.5
- pady 0.5
- width 8.5
- height 11
- gutter 0.25
-"
-
-proc Pica { dist } {
- expr $dist * 72.0
-}
-
-# ------------------------------------------------------------------
-#
-# TileFiles
-#
-# Tiles graph postscript files together in a pre-defined
-# grid.
-#
-# Arguments:
-# outFile -- Resulting tiled PostScript output file.
-# args -- Names of input graph PostScript files.
-#
-# ------------------------------------------------------------------
-
-proc TileFiles { outFile args } {
- global page
-
- set row 0
- set column 0
-
-
- set padx [Pica $page(padx)]
- set pady [Pica $page(padx)]
- set width [Pica $page(width)]
- set height [Pica $page(height)]
- set gutter [Pica $page(gutter)]
-
- set totalGutters [expr $gutter * ($page(columns) - 1)]
- set w [expr $width - (2 * $padx) - $totalGutters]
- set totalGutters [expr $gutter * ($page(rows) - 1)]
- set h [expr $height - (2 * $pady) - $totalGutters]
-
- set cellWidth [expr double($w) / $page(columns)]
- set cellHeight [expr double($h) / $page(rows)]
-
- set out [open $outFile "w"]
-
- puts $out "%!PS-Adobe-3.0 EPSF-3.0"
- puts $out "%%Pages: 1"
- puts $out "%%Title: (Graph tiler)"
- puts $out "%%DocumentNeededResources: font Helvetica Courier"
- puts $out "%%CreationDate: [clock format [clock seconds]]"
- puts $out "%%EndComments"
-
- puts $out "/showsheet { showpage } bind def"
- puts $out "/showpage { } def"
- puts $out "$padx $pady translate"
-
- set first {}
- foreach inFile $args {
- set in [open $inFile "r"]
-
- # Warning, this is assuming that the BoundingBox is in the first
- # twenty lines of the graph's PostScript.
-
- for { set count 0 } { $count < 20 } { incr count } {
- gets $in line
- if { [string match "%%BoundingBox:*" $line] } {
- set bbox $line
- break;
- }
- append first "$line\n"
- if { [eof $in] } {
- break
- }
- }
- if { ![info exists bbox] } {
- error "can't find \"%%BoundingBox:\" line"
- }
- set n [scan $bbox "%%%%BoundingBox: %d %d %d %d" x1 y1 x2 y2]
- if { $n != 4} {
- error "Bad bounding box line \"$bbox\""
- }
-
- set rest [read $in]
- close $in
-
- set x [expr ($cellWidth + $gutter) * $column]
- set y [expr ($cellHeight + $gutter) * $row]
-
- set w [expr abs($x2 - $x1)]
- set h [expr abs($y2 - $y1)]
-
- set scaleX [expr $cellWidth / $w]
- set scaleY [expr $cellHeight / $h]
- if { $scaleX > $scaleY } {
- set scale $scaleY
- } else {
- set scale $scaleX
- }
- puts $out "% "
- puts $out "% Tiling \"$inFile\" at ($row,$column)"
- puts $out "% "
- puts $out "gsave"
- puts $out "$x $y translate"
- puts $out "$scale $scale scale"
- puts $out "-$x1 -$y1 translate"
- puts $out $first
- puts $out $rest
- puts $out "grestore"
- incr column
- if { $column >= $page(columns) } {
- set column 0
- incr row
- }
- }
- puts $out "showsheet"
- close $out
-}
-
-eval TileFiles $argv
-
-
-
-
-
diff --git a/blt3.0.1/demos/scripts/patterns.tcl b/blt3.0.1/demos/scripts/patterns.tcl
deleted file mode 100644
index e7f281d..0000000
--- a/blt3.0.1/demos/scripts/patterns.tcl
+++ /dev/null
@@ -1,16 +0,0 @@
-blt::bitmap define pattern1 { {4 4} {01 02 04 08} }
-blt::bitmap define pattern2 { {4 4} {08 04 02 01} }
-blt::bitmap define pattern3 { {2 2} {01 02 } }
-blt::bitmap define pattern4 { {4 4} {0f 00 00 00} }
-blt::bitmap define pattern5 { {4 4} {01 01 01 01} }
-blt::bitmap define pattern6 { {2 2} {01 00 } }
-blt::bitmap define pattern7 { {4 4} {0f 01 01 01} }
-blt::bitmap define pattern8 { {8 8} {ff 00 ff 00 ff 00 ff 00 } }
-blt::bitmap define pattern9 { {4 4} {03 03 0c 0c} }
-blt::bitmap define hobbes { {25 25} {
- 00 00 00 00 00 00 00 00 00 c0 03 00 78 e0 07 00 fc f8 07 00 cc 07 04 00
- 0c f0 0b 00 7c 1c 06 00 38 00 00 00 e0 03 10 00 e0 41 11 00 20 40 11 00
- e0 07 10 00 e0 c1 17 00 10 e0 2f 00 20 e0 6f 00 18 e0 2f 00 20 c6 67 00
- 18 84 2b 00 20 08 64 00 70 f0 13 00 80 01 08 00 00 fe 07 00 00 00 00 00
- 00 00 00 00 }
-}
diff --git a/blt3.0.1/demos/scripts/ps.tcl b/blt3.0.1/demos/scripts/ps.tcl
deleted file mode 100644
index e74e737..0000000
--- a/blt3.0.1/demos/scripts/ps.tcl
+++ /dev/null
@@ -1,822 +0,0 @@
-#bltdebug 100
-
-array set cursors {
- w left_side
- e right_side
- n top_side
- s bottom_side
- sw bottom_left_corner
- ne top_right_corner
- se bottom_right_corner
- nw top_left_corner
-}
-
-set paperSizes {
- "Letter (8 1/2 x 11 in.)" "i 8.5i 11i"
- "A3 (29.7 x 42 cm.)" "c 28.7c 41c"
- "A4 (21 x 29.7 cm.)" "c 21c 29.7c"
- "A5 (14.85 x 21 cm.)" "c 14.85c 21c"
- "Legal (8 1/2 x 14 in.)" "i 8.5i 14i"
- "Large (11 x 17 in.)" "i 11i 17i"
-}
-
-array set paperSize $paperSizes
-
-array set pageInfo {
- gripSize 8
- scale 0.25
- radioFont -*-helvetica-medium-r-*-*-11-120-*-*-*-*-*-*
- labelFont "Arial 10 bold"
- printCmd "nlp -d2a211"
- printFile "out.ps"
- units "i"
- uscale 1.0
-}
-
-proc ApplyWhenIdle { } {
- global pageInfo
-
- set data [$pageInfo(graph) postscript output]
- puts stderr "landscape= [$pageInfo(graph) postscript cget -landscape]"
- $pageInfo(image) import ps -data $data -crop no
- puts stderr "writing out2.ps"
- $pageInfo(graph) postscript output -file out2.ps
- unset pageInfo(afterId)
-}
-
-proc SetUnits { units } {
- global pageInfo
- switch -glob $units {
- "i*" { set pageInfo(uscale) [winfo fpixels . 1i] }
- "c*" { set pageInfo(uscale) [winfo fpixels . 1c] }
- default { error "unknown unit \"$units\"" }
- }
- set pageInfo(units) [string index $units 0]
-}
-
-
-proc ConvertUnits { value } {
- global pageInfo
- set value [expr double($value) / $pageInfo(uscale)]
- return [format "%.1f%s" $value $pageInfo(units)]
-}
-
-
-proc SetPaperSize {} {
- global pageInfo
-
- set extents $pageInfo(paperExtents)
- foreach { unit w h } $extents break
- SetUnits $unit
- set pageInfo(-paperwidth) $w
- set pageInfo(-paperheight) $h
- ApplyPs
-}
-
-proc SetCanvasSize { canvas width height } {
- global pageInfo
-
- set width [winfo pixels . $width]
- set height [winfo pixels . $height]
- $canvas configure -width $width -height $height
-}
-
-proc SetCanvasOrientation { canvas } {
- global pageInfo
- set width $pageInfo(paperWidth)
- set height $pageInfo(paperHeight)
- SetCanvasSize $canvas $width $height
-}
-
-
-proc GetPsOptions { graph } {
- global pageInfo
-
- foreach opt [$graph postscript configure] {
- set pageInfo([lindex $opt 0]) [lindex $opt 4]
- }
-}
-
-proc SetOutline { canvas } {
- global pageInfo
- foreach var { gripSize xMin yMin xMax yMax } {
- set $var $pageInfo($var)
- }
- set xMid [expr ($xMax + $xMin - $gripSize) * 0.5]
- set yMid [expr ($yMax + $yMin - $gripSize) * 0.5]
- $canvas coords image $xMin $yMin
- $canvas itemconfigure image \
- -width [expr $xMax - $xMin] -height [expr $yMax - $yMin]
- $canvas coords nw \
- $xMin $yMin [expr $xMin + $gripSize] [expr $yMin + $gripSize]
- $canvas coords se \
- [expr $xMax - $gripSize] [expr $yMax - $gripSize] $xMax $yMax
- $canvas coords ne \
- [expr $xMax - $gripSize] [expr $yMin + $gripSize] $xMax $yMin
- $canvas coords sw \
- $xMin $yMax [expr $xMin + $gripSize] [expr $yMax - $gripSize]
- SetCanvasOrientation $canvas
- $canvas coords n \
- $xMid $yMin [expr $xMid + $gripSize] [expr $yMin + $gripSize]
- $canvas coords s \
- $xMid [expr $yMax - $gripSize] [expr $xMid + $gripSize] $yMax
- $canvas coords e \
- [expr $xMax - $gripSize] $yMid $xMax [expr $yMid + $gripSize]
- $canvas coords w \
- $xMin $yMid [expr $xMin + $gripSize] [expr $yMid + $gripSize]
-}
-
-proc CreateOutline { canvas } {
- global pageInfo
- foreach var { gripSize xMin yMin xMax yMax } {
- set $var $pageInfo($var)
- }
- if { ![blt::bitmap exists pattern8] } {
- blt::bitmap define pattern8 { {8 8} {ff 00 ff 00 ff 00 ff 00 } }
- }
- $canvas create eps $xMin $yMin \
- -tags "outline image" \
- -width [expr $xMax - $xMin] \
- -height [expr $yMax - $yMin]
-
- $canvas bind image <ButtonPress-1> "StartMove $canvas %x %y"
- $canvas bind image <B1-Motion> "MoveOutline $canvas %x %y"
- $canvas bind image <ButtonRelease-1> "EndMove $canvas"
-
- $canvas bind image <Shift-B1-Motion> "ConstrainMoveOutline $canvas %x %y"
- $canvas bind image <Enter> "EnterImage $canvas"
- $canvas bind image <Leave> "LeaveImage $canvas"
- focus $canvas
- $canvas create rectangle \
- $xMin $yMin [expr $xMin + $gripSize] [expr $yMin + $gripSize] \
- -tags "outline grip nw"
- $canvas create rectangle \
- [expr $xMax - $gripSize] [expr $yMax - $gripSize] $xMax $yMax \
- -tags "outline grip se"
- $canvas create rectangle \
- [expr $xMax - $gripSize] [expr $yMin + $gripSize] $xMax $yMin \
- -tags "outline grip ne"
- $canvas create rectangle \
- $xMin $yMax [expr $xMin + $gripSize] [expr $yMax - $gripSize] \
- -tags "outline grip sw"
-
- set xMid [expr ($xMax + $xMin - $gripSize) * 0.5]
- set yMid [expr ($yMax + $yMin - $gripSize) * 0.5]
- $canvas create rectangle \
- $xMid $yMin [expr $xMid + $gripSize] [expr $yMin + $gripSize] \
- -tags "outline grip n"
- $canvas create rectangle \
- $xMid [expr $yMax - $gripSize] [expr $xMid + $gripSize] $yMax \
- -tags "outline grip s"
- $canvas create rectangle \
- [expr $xMax - $gripSize] $yMid $xMax [expr $yMid + $gripSize] \
- -tags "outline grip e"
- $canvas create rectangle \
- $xMin $yMid [expr $xMin + $gripSize] [expr $yMid + $gripSize] \
- -tags "outline grip w"
- foreach grip { e w s n sw ne se nw } {
- $canvas bind $grip <ButtonPress-1> "StartResize %W $grip %x %y"
- $canvas bind $grip <B1-Motion> "ResizeOutline %W %x %y"
- $canvas bind $grip <ButtonRelease-1> "EndResize %W $grip %x %y"
- $canvas bind $grip <Enter> "EnterGrip %W $grip %x %y"
- $canvas bind $grip <Leave> "LeaveGrip %W $grip"
- }
- $canvas raise grip
- $canvas itemconfigure grip -fill red -outline black
-
- set pageInfo(image) [image create picture]
- set data [$pageInfo(graph) postscript output]
- $pageInfo(image) import ps -data $data -crop no
- $canvas itemconfigure image -image $pageInfo(image)
- $pageInfo(graph) postscript output out2.ps
-}
-
-
-proc EnterImage { canvas } {
- global cursors
- global pageInfo
- bind $canvas <KeyPress-Left> {
- MoveOutline %W [expr $pageInfo(lastX) - 1] $pageInfo(lastY)
- }
- bind $canvas <KeyPress-Right> {
- MoveOutline %W [expr $pageInfo(lastX) + 1] $pageInfo(lastY)
- }
- bind $canvas <KeyPress-Up> {
- MoveOutline %W $pageInfo(lastX) [expr $pageInfo(lastY) - 1]
- }
- bind $canvas <KeyPress-Down> {
- MoveOutline %W $pageInfo(lastX) [expr $pageInfo(lastY) + 1]
- }
- focus $canvas
- $canvas configure -cursor fleur
- set pageInfo(lastX) 0
- set pageInfo(lastY) 0
-}
-
-
-proc LeaveImage { canvas } {
- bind $canvas <KeyPress-Left> ""
- bind $canvas <KeyPress-Right> ""
- bind $canvas <KeyPress-Up> ""
- bind $canvas <KeyPress-Down> ""
- $canvas configure -cursor ""
-}
-
-proc EnterGrip { canvas grip x y } {
- global pageInfo
- $canvas itemconfigure $grip -fill blue -outline black
- set pageInfo(grip) $grip
- global cursors
- bind $canvas <KeyPress-Left> {
- ResizeOutline %W [expr $pageInfo(lastX) - 1] $pageInfo(lastY)
- }
- bind $canvas <KeyPress-Right> {
- ResizeOutline %W [expr $pageInfo(lastX) + 1] $pageInfo(lastY)
- }
- bind $canvas <KeyPress-Up> {
- ResizeOutline %W $pageInfo(lastX) [expr $pageInfo(lastY) - 1]
- }
- bind $canvas <KeyPress-Down> {
- ResizeOutline %W $pageInfo(lastX) [expr $pageInfo(lastY) + 1]
- }
- focus $canvas
- $canvas configure -cursor $cursors($grip)
- set pageInfo(lastX) $x
- set pageInfo(lastY) $y
-}
-
-proc LeaveGrip { canvas grip } {
- $canvas itemconfigure $grip -fill red -outline black
- bind $canvas <KeyPress-Left> ""
- bind $canvas <KeyPress-Right> ""
- bind $canvas <KeyPress-Up> ""
- bind $canvas <KeyPress-Down> ""
- $canvas configure -cursor ""
-}
-
-proc StartMove { canvas x y } {
- global pageInfo
- set pageInfo(lastX) $x
- set pageInfo(lastY) $y
- set pageInfo(direction) "undecided"
- $canvas configure -cursor fleur
-}
-
-proc MoveOutline { canvas x y } {
- global pageInfo
- $canvas move outline [expr $x - $pageInfo(lastX)] [expr $y - $pageInfo(lastY)]
- set pageInfo(lastX) $x
- set pageInfo(lastY) $y
-}
-
-proc ConstrainMoveOutline { canvas x y } {
- global pageInfo
-
- set dx [expr $x - $pageInfo(lastX)]
- set dy [expr $y - $pageInfo(lastY)]
-
- if { $pageInfo(direction) == "undecided" } {
- if { abs($dx) > abs($dy) } {
- set pageInfo(direction) x
- $canvas configure -cursor sb_h_double_arrow
- } else {
- set pageInfo(direction) y
- $canvas configure -cursor sb_v_double_arrow
- }
- }
- switch $pageInfo(direction) {
- x { set dy 0 ; set pageInfo(lastX) $x }
- y { set dx 0 ; set pageInfo(lastY) $y }
- }
- $canvas move outline $dx $dy
-}
-
-proc EndMove { canvas } {
- $canvas configure -cursor ""
-
- set coords [$canvas coords image]
- set x [lindex $coords 0]
- set y [lindex $coords 1]
- set w [$canvas itemcget image -width]
- set h [$canvas itemcget image -height]
-
- global pageInfo
- set pageInfo(xMin) $x
- set pageInfo(xMin) $y
- set pageInfo(xMax) [expr $x + $w]
- set pageInfo(yMax) [expr $y + $h]
-
- global pageInfo
- set pageInfo(-padx) [list $pageInfo(xMin) [expr $pageInfo(paperWidth) - $pageInfo(xMax)]]
- set pageInfo(-pady) [list $pageInfo(yMin) [expr $pageInfo(paperHeight) - $pageInfo(yMax)]]
-}
-
-proc StartResize { canvas grip x y } {
- global pageInfo
- $canvas itemconfigure image -quick yes
- set pageInfo(grip) $grip
- $canvas itemconfigure $grip -fill red -outline black
- $canvas raise grip
- global cursors
- $canvas configure -cursor $cursors($grip)
- set pageInfo(lastX) $x
- set pageInfo(lastY) $y
-}
-
-proc EndResize { canvas grip x y } {
- $canvas itemconfigure image -quick no
- ResizeOutline $canvas $x $y
- $canvas itemconfigure $grip -fill "" -outline ""
- $canvas configure -cursor ""
-}
-
-proc ResizeOutline { canvas x y } {
- global pageInfo
-
- foreach var { gripSize xMin yMin xMax yMax } {
- set $var $pageInfo($var)
- }
- switch $pageInfo(grip) {
- n {
- set yMin $y
- }
- s {
- set yMax $y
- }
- e {
- set xMax $x
- }
- w {
- set xMin $x
- }
- sw {
- set xMin $x ; set yMax $y
- }
- ne {
- set xMax $x ; set yMin $y
- }
- se {
- set xMax $x ; set yMax $y
- }
- nw {
- set xMin $x ; set yMin $y
- }
- }
- set width [expr $xMax - $xMin]
- set height [expr $yMax - $yMin]
- if { ($width < 1) || ($height < 1) } {
- return
- }
- SetOutline $canvas
- foreach var { xMin yMin xMax yMax } {
- set pageInfo($var) [set $var]
- }
-}
-
-proc ComputePlotGeometry { graph } {
- global pageInfo
-
- GetPsOptions $graph
- set width [winfo width $graph]
- set height [winfo height $graph]
- if { $pageInfo(-width) > 0 } {
- set width $pageInfo(-width)
- }
- if { $pageInfo(-height) > 0 } {
- set height $pageInfo(-height)
- }
-
- set left [lindex $pageInfo(-padx) 0]
- set right [lindex $pageInfo(-padx) 1]
- set top [lindex $pageInfo(-pady) 0]
- set bottom [lindex $pageInfo(-pady) 1]
- set padx [expr $left + $right]
- set pady [expr $top + $bottom]
-
- if { $pageInfo(-paperwidth) > 0 } {
- set paperWidth $pageInfo(-paperwidth)
- } else {
- set paperWidth [expr $width + $padx]
- }
- if { $pageInfo(-paperheight) > 0 } {
- set paperHeight $pageInfo(-paperheight)
- } else {
- set paperHeight [expr $height + $pady]
- }
- set scale 1.0
- if { $pageInfo(-maxpect) } {
- set xScale [expr ($paperWidth - $padx) / double($width)]
- set yScale [expr ($paperHeight - $pady) / double($height)]
- set scale [expr min($xScale,$yScale)]
- set bboxWidth [expr round($width * $scale)]
- set bboxHeight [expr round($height * $scale)]
- } else {
- if { ($width + $padx) > $paperWidth } {
- set width [expr $paperWidth - $padx]
- }
- if { ($height + $pady) > $paperHeight } {
- set height [expr $paperHeight - $pady]
- }
- set bboxWidth $width
- set bboxHeight $height
- }
- set x $left
- set y $top
- if { $pageInfo(-center) } {
- if { $paperWidth > $bboxWidth } {
- set x [expr ($paperWidth - $bboxWidth) / 2]
- }
- if { $paperHeight > $bboxHeight } {
- set y [expr ($paperHeight - $bboxHeight) / 2]
- }
- }
- set pageInfo(xMin) [expr $x * $pageInfo(scale)]
- set pageInfo(yMin) [expr $y * $pageInfo(scale)]
- set pageInfo(xMax) [expr ($x + $bboxWidth) * $pageInfo(scale)]
- set pageInfo(yMax) [expr ($y + $bboxHeight) * $pageInfo(scale)]
- set pageInfo(paperHeight) [expr $paperHeight * $pageInfo(scale)]
- set pageInfo(paperWidth) [expr $paperWidth * $pageInfo(scale)]
-}
-
-proc PsDialog { graph } {
- global pageInfo paperSizes
-
- set pageInfo(graph) $graph
- set top $graph.top
- toplevel $top
- option add *graph.top*Radiobutton.font $pageInfo(radioFont)
- GetPsOptions $graph
- ComputePlotGeometry $graph
- set canvas $top.layout
- canvas $canvas -confine yes \
- -width $pageInfo(paperWidth) -height $pageInfo(paperHeight) -bg gray \
- -bd 2 -relief sunken
- CreateOutline $canvas
- SetCanvasOrientation $canvas
- blt::tk::label $top.titleLabel -text "PostScript Options"
- blt::table $top \
- 0,0 $top.titleLabel -cspan 7 \
- 1,0 $canvas -cspan 7
-
- set row 2
- set col 0
-
- blt::tk::label $top.paperLabel -text "Paper" -font "Arial 10 bold"
- blt::combobutton $top.paper \
- -textvariable pageInfo(paperSize) \
- -font { Arial 10 } \
- -menu $top.paper.m
-
- set menu [blt::combomenu $top.paper.m -textvariable pageInfo(paperSize)]
- foreach { key value } $paperSizes {
- $menu add -type command -text $key -value $value
- }
- $menu item configure command -variable pageInfo(paperExtents) \
- -command "SetPaperSize"
- set pageInfo(paperSize) [lindex $paperSizes 0]
- blt::table $top \
- $row,$col $top.paperLabel -anchor e \
- $row,$col+1 $top.paper -anchor e -fill x
- incr row
-
- blt::tk::label $top.orientLabel -text "Orientation" -font "Arial 10 bold"
- blt::combobutton $top.orient \
- -textvariable pageInfo(orient) \
- -font { Arial 10 } \
- -menu $top.orient.m
-
- set menu [blt::combomenu $top.orient.m -textvariable pageInfo(orient)]
- $menu add -type command -text "Portrait" -value "0" \
- -variable pageInfo(-landscape) -command "ApplyPs"
- $menu add -type command -text "Landscape" -value "1" \
- -variable pageInfo(-landscape) -command "ApplyPs"
- set pageInfo(orient) "Landscape"
- set pageInfo(-landscape) 1
- blt::table $top \
- $row,$col $top.orientLabel -anchor e \
- $row,$col+1 $top.orient -anchor e -fill x
- incr row
-
- set col 0
- incr row
- blt::tk::label $top.sizeLabel -text "Plot Size" -font "Arial 10 bold"
- blt::combobutton $top.plotsize \
- -textvariable pageInfo(plotsize) \
- -font { Arial 10 } \
- -menu $top.plotsize.m
-
- set menu [blt::combomenu $top.plotsize.m -textvariable pageInfo(plotsize)]
- $menu add -type command -text "Default" -value "default" \
- -variable pageInfo(-plotsize) -command "SetPlotSize"
- $menu add -type command -text "Max Aspect" -value "maxpect" \
- -variable pageInfo(-plotsize) -command "SetPlotSize"
- $menu add -type command -text "Small (3.25 in x 3.25 in)" -value "small" \
- -variable pageInfo(-plotsize) -command "SetPlotSize"
- $menu add -type command -text "Large (6 in x 8 in)" -value "large" \
- -variable pageInfo(-plotsize) -command "SetPlotSize"
- $menu add -type command -text "Other" -value "other" \
- -variable pageInfo(-plotsize) \
- -command "SizeDialog $graph {Adjust Plot Size}"
- set pageInfo(plotsize) "Default"
- blt::table $top \
- $row,$col $top.sizeLabel -anchor e \
- $row,$col+1 $top.plotsize -anchor e -fill x
- incr row
-
- blt::tk::label $top.modeLabel -text "Color mode" -font "Arial 10 bold"
- blt::combobutton $top.colormode \
- -textvariable pageInfo(colormode) \
- -font { Arial 10 } \
- -menu $top.colormode.m
-
- set menu [blt::combomenu $top.colormode.m -textvariable pageInfo(colormode)]
- $menu add -type command -text "Full Color" -value "0" \
- -variable pageInfo(-greyscale) -command "ApplyPs"
- $menu add -type command -text "Greyscale" -value "1" \
- -variable pageInfo(-greyscale) -command "ApplyPs"
- set pageInfo(colormode) "Full Color"
- blt::table $top \
- $row,$col $top.modeLabel -anchor e \
- $row,$col+1 $top.colormode -anchor e -fill x
- incr row
-
- set pageInfo(oldPadX) $pageInfo(-padx)
- set pageInfo(oldPadY) $pageInfo(-pady)
-
- blt::tk::label $top.posLabel -text "Position" -font "Arial 10 bold"
- blt::combobutton $top.position \
- -textvariable pageInfo(position) \
- -font { Arial 10 } \
- -menu $top.position.m
-
- set menu [blt::combomenu $top.position.m -textvariable pageInfo(position)]
-
- $menu add -type command -text "Center" -value "1" \
- -variable pageInfo(-position) -command { CenterPlot }
- $menu add -type command -text "Origin" -value "0" \
- -variable pageInfo(-position) -command { ApplyPs }
- $menu add -type command -text "Move" -value "move" \
- -variable pageInfo(-position) -command { MoveDialog }
-
- set pageInfo(position) "Center"
- blt::table $top \
- $row,$col $top.posLabel -anchor e \
- $row,$col+1 $top.position -anchor e -fill x
- incr row
-
- blt::tk::label $top.previewLabel -text "Preview" -font "Arial 10 bold"
- blt::combobutton $top.preview \
- -textvariable pageInfo(preview) \
- -font { Arial 10 } \
- -menu $top.preview.m
-
- set pageInfo(preview) "No"
- set menu [blt::combomenu $top.preview.m -textvariable pageInfo(preview)]
- $menu add -type command -text "Yes" -value "1" \
- -variable pageInfo(-preview) -command "ApplyPs"
- $menu add -type command -text "No" -value "0" \
- -variable pageInfo(-preview) -command "ApplyPs"
-
- blt::table $top \
- $row,$col $top.previewLabel -anchor e \
- $row,$col+1 $top.preview -anchor e -fill x
- incr row
-
- blt::tk::label $top.printLabel -text "Print To" -font "Arial 10 bold"
- blt::combobutton $top.printer \
- -textvariable pageInfo(printer) \
- -font { Arial 10 } -justify left \
- -menu $top.printer.m
-
- set menu [blt::combomenu $top.printer.m -textvariable pageInfo(printer)]
- $menu add -type command -text "File" -value "printFile" \
- -command "$top.fileEntry configure -textvariable pageInfo(printCmd)" \
- -variable pageInfo(printTo)
-
- $menu add -type command -text "Command" -value "printCmd" \
- -command "$top.fileEntry configure -textvariable pageInfo(printCmd)" \
- -variable pageInfo(printTo)
-
- entry $top.fileEntry -textvariable pageInfo(printTo)
- $menu invoke "File"
-
- blt::table $top \
- $row,$col $top.printLabel -anchor e \
- $row,$col+1 $top.printer -anchor e -fill x \
- $row+1,1 $top.fileEntry -anchor w -fill x -cspan 3
- incr row 2
-
-
- #blt::table configure $top c4 -width .125i
- frame $top.frame
- button $top.frame.cancel -text "Cancel" -command "destroy $top"
- button $top.frame.print -text "Ok" -command "PrintPs $graph"
- blt::table $top.frame \
- 0,0 $top.frame.cancel -width 0.5i \
- 0,1 $top.frame.print -width 0.5i
-
- blt::table $top \
- $row,$col $top.frame -fill x -columnspan 2
-
- blt::table configure $top r* -resize none -pady { 0 2 }
- blt::table configure $top r1 -resize both
-}
-
-proc PrintPs { graph } {
- $graph postscript output "out.ps"
- puts stdout "wrote file \"out.ps\"."
- flush stdout
-}
-
-proc ApplyPs { } {
- global pageInfo
-
- set graph $pageInfo(graph)
- foreach option [$graph postscript configure] {
- set var [lindex $option 0]
- set old [lindex $option 4]
- if { [catch {$graph postscript configure $var $pageInfo($var)}] != 0 } {
- $graph postscript configure $var $old
- set pageInfo($var) $old
- }
- }
- ComputePlotGeometry $graph
- foreach var { -paperheight -paperwidth -width -height } {
- set pageInfo($var) [ConvertUnits $pageInfo($var)]
- }
- SetOutline $graph.top.layout
- if { ![info exists pageInfo(afterId)] } {
- set pageInfo(afterId) [after idle ApplyWhenIdle]
- }
-}
-
-proc StartChange { w delta } {
- ChangeSize $w $delta
- global pageInfo
- set pageInfo(afterId) [after 300 RepeatChange $w $delta]
-}
-
-proc RepeatChange { w delta } {
- ChangeSize $w $delta
- global pageInfo
- set pageInfo(afterId) [after 100 RepeatChange $w $delta]
-}
-
-proc EndChange { w } {
- global pageInfo
- after cancel $pageInfo(afterId)
-}
-
-proc ChangeSize { w delta } {
- set f [winfo parent $w]
- set value [$f.entry get]
- set value [expr $value + $delta]
- if { $value < 0 } {
- set value 1
- }
- $f.entry delete 0 end
- $f.entry insert 0 $value
-}
-
-proc MakeSizeAdjustor { w label var } {
- frame $w
- label $w.label -text $label
- button $w.plus -text "+" -padx 1 -pady 0 -font \*symbol\*
- entry $w.entry -width 6 -textvariable "pageInfo($var)"
- button $w.minus -text "-" -padx 1 -pady 0 -font \*symbol\*
- label $w.units -text "in"
- bind $w.plus <ButtonPress-1> { StartChange %W 0.1}
- bind $w.plus <ButtonRelease-1> { EndChange %W }
- bind $w.minus <ButtonPress-1> { StartChange %W -0.1}
- bind $w.minus <ButtonRelease-1> { EndChange %W }
- blt::table $w \
- 0,1 $w.label \
- 1,1 $w.entry -rspan 2 -fill y \
- 1,0 $w.minus -padx 2 -pady 2 \
- 2,0 $w.plus -padx 2 -pady { 0 2 } \
- 1,2 $w.units -rspan 2 -fill y
-
-}
-
-
-proc SizeDialog { graph title } {
- global pageInfo
- set top .plotSize
- if { [winfo exists $top] } {
- return
- }
- toplevel $top
- label $top.title -text $title
- button $top.cancel -text "Cancel" -command "destroy $top"
- button $top.ok -text "Ok" -command "ApplyPs; destroy $top"
- MakeSizeAdjustor $top.plotWidth "Width" -width
- MakeSizeAdjustor $top.plotHeight "Height" -height
- blt::table $top \
- 0,0 $top.title -cspan 2 \
- 1,0 $top.plotWidth \
- 1,1 $top.plotHeight \
- 2,0 $top.cancel -pady 4 -padx 4 -width 1i \
- 2,1 $top.ok -pady 4 -padx 4 -width 1i
- set width [winfo fpixels . $pageInfo(-width)]
- set height [winfo fpixels . $pageInfo(-height)]
- if { $width == 0 } {
- set width [expr ($pageInfo(xMax) - $pageInfo(xMin)) / $pageInfo(scale)]
- set pageInfo(-width) [ConvertUnits $width]
- }
- if { $height == 0 } {
- set height [expr ($pageInfo(yMax) - $pageInfo(yMin)) / $pageInfo(scale)]
- set pageInfo(-height) [ConvertUnits $height]
- }
- set pageInfo(-maxpect) 0
-}
-
-proc SetPlotSize { } {
- global pageInfo
- set graph $pageInfo(graph)
- switch $pageInfo(-plotsize) {
- default {
- set pageInfo(-width) 0
- set pageInfo(-height) 0
- set pageInfo(-maxpect) 0
- set pageInfo(-padx) $pageInfo(oldPadX)
- set pageInfo(-pady) $pageInfo(oldPadY)
- } maxpect {
- set pageInfo(-width) 0
- set pageInfo(-height) 0
- set pageInfo(-maxpect) 1
- set pageInfo(-padx) $pageInfo(oldPadX)
- set pageInfo(-pady) $pageInfo(oldPadY)
- } resize {
- set pageInfo(-maxpect) 0
- }
- }
- ApplyPs
-}
-
-
-proc PaperSizeDialog { title } {
- set top .paperSize
- if { [winfo exists $top] } {
- return
- }
- toplevel $top
- label $top.title -text $title
- MakeSizeAdjustor $top.width "Width" -paperwidth
- MakeSizeAdjustor $top.height "Height" -paperheight
- button $top.cancel -text "Cancel" -command "destroy $top"
- button $top.ok -text "Ok" -command "ApplyPs; destroy $top"
- blt::table $top \
- 0,0 $top.title -cspan 2 \
- 1,0 $top.width \
- 1,1 $top.height \
- 2,0 $top.cancel -pady 4 -padx 4 -width 1i \
- 2,1 $top.ok -pady 4 -padx 4 -width 1i
-}
-
-proc MarginDialog { graph } {
- set top $graph.top.options
- if { [winfo exists $top] } {
- return
- }
- toplevel $top
- set row 0
- set col 0
- label $top.modeLabel -text "Printer"
- radiobutton $top.color -text "Color" -value "color" \
- -variable pageInfo(-colormode) -command "ApplyPs"
- radiobutton $top.greyscale -text "Greyscale" -value "greyscale" \
- -variable pageInfo(-colormode) -command "ApplyPs"
- blt::table $top \
- $row,$col $top.modeLabel -anchor e \
- $row,$col+1 $top.color -anchor w \
- $row+1,$col+1 $top.greyscale -anchor w
-
- blt::table configure $top r$row -pady { 4 0 }
-
- label $top.previewLabel -text "Preview"
- radiobutton $top.previewYes -text "Yes" -value "1" \
- -variable pageInfo(-preview) -command "ApplyPs"
- radiobutton $top.previewNo -text "No" -value "0" \
- -variable pageInfo(-preview) -command "ApplyPs"
- set col 2
- blt::table $top \
- $row,$col $top.previewLabel -anchor e \
- $row,$col+1 $top.previewYes -anchor w \
- $row+1,$col+1 $top.previewNo -anchor w
- incr row 2
-
- button $top.cancel -text "Cancel" -command "destroy $top"
- button $top.ok -text "Done" -command "PrintPs $graph"
- blt::table $top \
- $row,0 $top.cancel -pady 4 -padx 4 -width 1i \
- $row,1 $top.ok -pady 4 -padx 4 -width 1i
-
-}
-
-proc CenterPlot { } {
- global pageInfo
-
- set pageInfo(-padx) $pageInfo(oldPadX)
- set pageInfo(-pady) $pageInfo(oldPadY)
- ApplyPs
-}
diff --git a/blt3.0.1/demos/scripts/send.tcl b/blt3.0.1/demos/scripts/send.tcl
deleted file mode 100644
index 7c57375..0000000
--- a/blt3.0.1/demos/scripts/send.tcl
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-# --------------------------------------------------------------------------
-#
-# SendInit --
-#
-# Creates a "send" proc to replace the former Tk send command.
-# Uses DDE services to simulate the transfer. This must be
-# called before any drag&drop targets are registered. Otherwise
-# they will pick up the wrong application name.
-#
-# The first trick is to determine a unique application name. This
-# is what other applications will use to send to us. Tk used to
-# do this for us.
-#
-# Note that we can generate the same name for two different Tk
-# applications. This can happen if two Tk applications picking
-# names at exactly the same time. [In the future, we should
-# probably generate a name based upon a global system value, such
-# as the handle of the main window ".".] The proc "SendVerify"
-# below will verify that you have only one DDE server registered
-# with this application's name.
-#
-# Arguments:
-# myInterp Sets the application name explicitly to this
-# string. If the argument isn't given, or is the
-# empty string, then the routine picks a name for
-# us.
-#
-# Results:
-# Returns the name of the application.
-#
-# Side Effects:
-# Sets the name of our application. You can call "tk appname" to
-# get the name. A DDE topic using the same name is also created.
-# A send proc is also automatically created. Be careful that you
-# don't overwrite an existing send command.
-#
-# --------------------------------------------------------------------------
-
-proc SendInit { {myInterp ""} } {
-
- # Load the DDE package.
- package require dde
-
- if { $myInterp == "" } {
-
- # Pick a unique application name, replicating what Tk used to do.
- # This is what other applications will use to "send" to us. We'll
- # use DDE topics to represent interpreters.
-
- set appName [tk appname]
- set count 0
- set suffix {}
-
- # Keep generating interpreter names by suffix-ing the original
- # application name with " #number". Sooner of later we'll find
- # one that's not currently use.
-
- while { 1 } {
- set myInterp "${appName}${suffix}"
- set myServer [list TclEval $myInterp]
- if { [lsearch [dde services TclEval {}] $myServer] < 0 } {
- break
- }
- incr count
- set suffix " \#$count"
- }
- }
- tk appname $myInterp
- dde servername $myInterp
- proc send { interp args } {
- dde eval $interp $args
- }
- return $myInterp
-}
-
-
-# --------------------------------------------------------------------------
-#
-# SendVerify --
-#
-# Verifies that application name picked is uniquely registered
-# as a DDE server. This checks that two Tk applications don't
-# accidently use the same name.
-#
-# Arguments:
-# None Used the current application name.
-#
-# Results:
-# Generates an error if either a server can't be found or more
-# than one server is registered.
-#
-# --------------------------------------------------------------------------
-
-proc SendVerify {} {
- # Load the DDE package.
- package require dde
-
- set count 0
- set appName [tk appname]
- foreach server [dde services TclEval {}] {
- set topic [lindex $server 1]
- if { [string compare $topic $appName] == 0 } {
- incr count
- }
- }
- if {$count == 0} {
- error "Service not found: wrong name registered???"
- }
- if { $count > 1 } {
- error "Duplicate names found for \"[tk appname]\""
- }
-}
-
diff --git a/blt3.0.1/demos/scripts/stipples.tcl b/blt3.0.1/demos/scripts/stipples.tcl
deleted file mode 100644
index 1845d09..0000000
--- a/blt3.0.1/demos/scripts/stipples.tcl
+++ /dev/null
@@ -1,153 +0,0 @@
-blt::bitmap define bdiagonal1 {
-#define bdiagonal1_width 8
-#define bdiagonal1_height 8
-static unsigned char bdiagonal1_bits[] = {
- 0x88, 0x44, 0x22, 0x11, 0x88, 0x44, 0x22, 0x11};
-}
-
-blt::bitmap define bdiagonal2 {
-#define bdiagonal2_width 8
-#define bdiagonal2_height 8
-static unsigned char bdiagonal2_bits[] = {
- 0x08, 0x04, 0x02, 0x01, 0x80, 0x40, 0x20, 0x10};
-}
-
-blt::bitmap define checker2 {
-#define checker2_width 8
-#define checker2_height 8
-static unsigned char checker2_bits[] = {
- 0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc};
-}
-
-blt::bitmap define checker3 {
-#define checker3_width 8
-#define checker3_height 8
-static unsigned char checker3_bits[] = {
- 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0};
-}
-
-blt::bitmap define cross1 {
-#define cross1_width 8
-#define cross1_height 8
-static unsigned char cross_bits[] = {
- 0xff, 0xaa, 0xff, 0xaa, 0xff, 0xaa, 0xff, 0xaa};
-}
-
-blt::bitmap define cross2 {
-#define cross2_width 8
-#define cross2_height 8
-static unsigned char cross2_bits[] = {
- 0xff, 0x88, 0x88, 0x88, 0xff, 0x88, 0x88, 0x88};
-}
-
-blt::bitmap define cross3 {
-#define cross3_width 8
-#define cross3_height 8
-static unsigned char cross3_bits[] = {
- 0xff, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
-}
-
-blt::bitmap define crossdiag {
-#define crossdiag_width 8
-#define crossdiag_height 8
-static unsigned char crossdiag2_bits[] = {
- 0x18, 0x24, 0x42, 0x81, 0x81, 0x42, 0x24, 0x18};
-}
-
-blt::bitmap define dot1 {
-#define dot1_width 8
-#define dot1_height 8
-static unsigned char dot1_bits[] = {
- 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa};
-}
-
-blt::bitmap define dot2 {
-#define dot2_width 8
-#define dot2_height 8
-static unsigned char dot2_bits[] = {
- 0x55, 0x00, 0x55, 0x00, 0x55, 0x00, 0x55, 0x00};
-}
-
-blt::bitmap define dot3 {
-#define dot3_width 8
-#define dot3_height 8
-static unsigned char dot3_bits[] = {
- 0x11, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00};
-}
-
-blt::bitmap define dot4 {
-#define dot4_width 8
-#define dot4_height 8
-static unsigned char dot4_bits[] = {
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-}
-
-blt::bitmap define fdiagonal1 {
-#define fdiagonal1_width 8
-#define fdiagonal1_height 8
-static unsigned char fdiagonal1_bits[] = {
- 0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44, 0x88};
-}
-
-blt::bitmap define fdiagonal2 {
-#define fdiagonal2_width 8
-#define fdiagonal2_height 8
-static unsigned char fdiagonal2_bits[] = {
- 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x04, 0x08};
-}
-
-blt::bitmap define hline1 {
-#define hline1_width 8
-#define hline1_height 8
-static unsigned char hline1_bits[] = {
- 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00};
-}
-
-blt::bitmap define hline2 {
-#define hline2_width 8
-#define hline2_height 8
-static unsigned char hline2_bits[] = {
- 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00};
-}
-
-blt::bitmap define lbottom {
-#define lbottom_width 8
-#define lbottom_height 8
-static unsigned char lbottom_bits[] = {
- 0x00, 0x11, 0x11, 0x77, 0x00, 0x11, 0x11, 0x77};
-}
-
-blt::bitmap define ltop {
-#define ltop_width 8
-#define ltop_height 8
-static unsigned char ltop_bits[] = {
- 0xee, 0x88, 0x88, 0x00, 0xee, 0x88, 0x88, 0x00};
-}
-
-blt::bitmap define rbottom {
-#define rbottom_width 8
-#define rbottom_height 8
-static unsigned char rbottom_bits[] = {
- 0x00, 0x88, 0x88, 0xee, 0x00, 0x88, 0x88, 0xee};
-}
-
-blt::bitmap define rtop {
-#define rtop_width 8
-#define rtop_height 8
-static unsigned char rtop_bits[] = {
- 0x77, 0x11, 0x11, 0x00, 0x77, 0x11, 0x11, 0x00};
-}
-
-blt::bitmap define vline1 {
-#define vline1_width 8
-#define vline1_height 8
-static unsigned char vline1_bits[] = {
- 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55};
-}
-
-blt::bitmap define vline2 {
-#define vline2_width 8
-#define vline2_height 8
-static unsigned char vline2_bits[] = {
- 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33};
-}
diff --git a/blt3.0.1/demos/scripts/xcolors.tcl b/blt3.0.1/demos/scripts/xcolors.tcl
deleted file mode 100755
index 80d3e39..0000000
--- a/blt3.0.1/demos/scripts/xcolors.tcl
+++ /dev/null
@@ -1,250 +0,0 @@
-#!../bltwish
-#
-# Tk version of xcolors
-#
-
-package require BLT
-source scripts/demo.tcl
-set numCols 0
-set numRows 0
-set maxCols 15
-set cellWidth 40
-set cellHeight 20
-set numCells 0
-set lastCount 0
-set beginInput(0) 0
-set map 0
-set entryCount 0
-set lastTagId {}
-
-scrollbar .xscroll -command { .canvas xview } -orient horizontal
-scrollbar .yscroll -command { .canvas yview }
-
-label .sample \
- -font -*-new*century*schoolbook*-bold-r-*-*-24-*-*-*-*-*-*-* \
- -text {"Bisque is Beautiful".}
-
-button .name -font -*-helvetica-medium-r-*-*-18-*-*-*-*-*-*-* \
- -command "AddSelection name"
-button .rgb -font -*-courier-medium-r-*-*-18-*-*-*-*-*-*-* \
- -command "AddSelection rgb"
-
-canvas .canvas \
- -confine 1 \
- -yscrollcommand { .yscroll set } \
- -width [expr 16*$cellWidth] -height 400 \
- -scrollregion [list 0 0 [expr 16*$cellWidth] 800]
-
-frame .border -bd 2 -relief raised
-
-label .status \
- -anchor w \
- -font -*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*
-
-button .quit -text "Quit" -command "exit"
-button .next -text "Next" -command "DisplayColors next"
-button .prev -text "Previous" -command "DisplayColors last"
-
-selection handle .name GetColor
-selection handle .rgb GetValue
-
-bind .name <Enter> {
- .status config -text \
- "Press button to write color name into primary selection"
-}
-
-bind .rgb <Enter> {
- .status config -text \
- "Press button to write RGB value into primary selection"
-}
-bind .name <Leave> {
- .status config -text ""
-}
-
-bind .rgb <Leave> {
- .status config -text ""
-}
-
-bind .canvas <Enter> {
- .status config -text \
- "Press button 1 to change background; Button 2 changes foreground"
-}
-
-
-blt::table . \
- .sample 0,0 -cspan 2 -fill both -reqheight 1i \
- .name 1,0 -fill both -anchor w \
- .rgb 1,1 -fill both -anchor w \
- .canvas 2,0 -cspan 2 -fill both \
- .yscroll 2,2 -fill y \
- .border 3,0 -cspan 2 -fill x -reqheight 8 \
- .status 4,0 -cspan 2 -fill both \
- .quit 4,1 -anchor e -reqwidth 1i -fill y -padx 10 -pady 4 \
- .prev 5,0 -anchor e -reqwidth 1i -fill y -padx 10 -pady 4 \
- .next 5,1 -anchor e -reqwidth 1i -fill y -padx 10 -pady 4
-
-proc AddSelection { what } {
- selection own .$what
- if {$what == "name" } {
- set mesg "Color name written into primary selection"
- } else {
- set mesg "RGB value written into primary selection"
- }
- .status config -text $mesg
-}
-
-proc GetColor { args } {
- return [lindex [.name config -text] 4]
-}
-
-proc GetValue { args } {
- return [lindex [.rgb config -text] 4]
-}
-
-proc ShowInfo { tagId what info } {
- global lastTagId
-
- if { $lastTagId != {} } {
- .canvas itemconfig $lastTagId -width 1
- }
- .canvas itemconfig $tagId -width 3
- set lastTagId $tagId
-
- set name [lindex $info 3]
- .name config -text $name
- set value [format "#%0.2x%0.2x%0.2x" \
- [lindex $info 0] [lindex $info 1] [lindex $info 2]]
- .rgb config -text $value
- .sample config $what $name
- .status config -bg $name
-}
-
-
-proc MakeCell { info } {
- global numCols numRows maxCols cellWidth cellHeight numCells
-
- set x [expr $numCols*$cellWidth]
- set y [expr $numRows*$cellHeight]
- set color [lindex $info 3]
-
- if [catch {winfo rgb . $color}] {
- return "ok"
- }
-# if { [tk colormodel .] != "color" } {
-# bind . <Leave> {
-# .status config -text "Color table full after $numCells entries."
-# }
-# .status config -text "Color table full after $numCells entries."
-# return "out of colors"
-# }
- set id [.canvas create rectangle \
- $x $y [expr $x+$cellWidth] [expr $y+$cellHeight] \
- -fill $color -outline black]
- if { $color == "white" } {
- global whiteTagId
- set whiteTagId $id
- }
-
- .canvas bind $id <1> [list ShowInfo $id -bg $info]
- .canvas bind $id <2> [list ShowInfo $id -fg $info]
-
- incr numCols
- if { $numCols > $maxCols } {
- set numCols 0
- incr numRows
- }
- return "ok"
-}
-
-proc DisplayColors { how } {
- global lastCount numCells cellHeight numRows numCols rgbText
- global map beginInput
-
-# tk colormodel . color
- set initialized no
-
- if { $how == "last" } {
- if { $map == 0 } {
- return
- }
- set map [expr $map-1]
- } else {
- incr map
- if ![info exists beginInput($map)] {
- set beginInput($map) $lastCount
- }
- }
-
- set start $beginInput($map)
-
- if { $numCells > 0 } {
- .canvas delete all
- set numRows 0
- set numCols 0
- set initialized yes
- }
-
- set input [lrange $rgbText $start end]
- set lineCount $start
- set entryCount 0
- foreach i $input {
- incr lineCount
- if { [llength $i] == 4 } {
- if { [MakeCell $i] == "out of colors" } {
- break
- }
- incr entryCount
- }
- }
- if { $entryCount == 0 } {
- bind . <Leave> {
- .status config -text "No more entries in RGB database"
- }
- .status config -text "No more entries in RGB database"
- }
- set lastCount $lineCount
- proc tkerror {args} {
- #dummy procedure
- }
-
- if { $initialized == "no" } {
- global cellWidth
-
- set height [expr $cellHeight*($numRows+1)]
- .canvas config -scrollregion [list 0 0 [expr 16*$cellWidth] $height]
- if { $height < 800 } {
- .canvas config -height $height
- }
- global whiteTagId
- if [info exists whiteTagId] {
- ShowInfo $whiteTagId -bg {255 255 255 white}
- }
- }
- update idletasks
- update
- rename tkerror {}
-}
-
-wm min . 0 0
-
-foreach location {
- /usr/X11R6/lib/X11
- /util/X11R6/lib/X11
- /usr/openwin/lib/X11
- /usr/dt/lib/X11
- /usr/lib/X11
- /usr/share/X11
-} {
- set file [file join $location rgb.txt]
- if { [file exists $file] } {
- break
- }
-}
-set in [open $file "r"]
-set rgbText [read $in]
-close $in
-set rgbText [split $rgbText \n]
-DisplayColors next
-wm min . 0 0
-
-
diff --git a/blt3.0.1/demos/scrollset1.tcl b/blt3.0.1/demos/scrollset1.tcl
deleted file mode 100644
index 6d69d44..0000000
--- a/blt3.0.1/demos/scrollset1.tcl
+++ /dev/null
@@ -1,14 +0,0 @@
-
-package require BLT
-source scripts/demo.tcl
-
-blt::scrollset .ss \
- -xscrollbar .ss.xsbar \
- -yscrollbar .ss.ysbar \
- -window .ss.g
-
-blt::tk::scrollbar .ss.ysbar -orient vertical
-blt::tk::scrollbar .ss.xsbar -orient horizontal
-blt::graph .ss.g
-
-pack .ss -fill both -expand yes
diff --git a/blt3.0.1/demos/scrollset2.tcl b/blt3.0.1/demos/scrollset2.tcl
deleted file mode 100644
index ed3fcd8..0000000
--- a/blt3.0.1/demos/scrollset2.tcl
+++ /dev/null
@@ -1,25 +0,0 @@
-
-package require BLT
-source scripts/demo.tcl
-
-blt::scrollset .ss \
- -xscrollbar .ss.xsbar \
- -yscrollbar .ss.ysbar \
- -window .ss.t
-
-blt::tk::scrollbar .ss.ysbar -orient vertical
-blt::tk::scrollbar .ss.xsbar -orient horizontal
-text .ss.t -wrap none
-
-.ss.t insert end "salsadkjlda s
-adslkjda lskjd
-asldkjda lskjd sa
-aslkj dlsakj lkdsa
-asdlkjdalskj ds
-aslkdj aldskjd ls
-asldkj dlskjd sl
-asldkj dlskjd l
-adlaldksjd ldkasj ldkjs ld"
-
-pack .ss -fill both -expand yes
-
diff --git a/blt3.0.1/demos/scrollset3.tcl b/blt3.0.1/demos/scrollset3.tcl
deleted file mode 100644
index 9818335..0000000
--- a/blt3.0.1/demos/scrollset3.tcl
+++ /dev/null
@@ -1,193 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-proc SortColumn { column } {
- set old [.ss.t sort cget -column]
- set decreasing 0
- if { "$old" == "$column" } {
- set decreasing [.ss.t sort cget -decreasing]
- set decreasing [expr !$decreasing]
- }
- .ss.t sort configure -decreasing $decreasing -column $column -mode integer
- if { ![.ss.t cget -flat] } {
- .ss.t configure -flat yes
- }
- .ss.t sort auto yes
-
- blt::busy hold .ss.t
- update
- blt::busy release .ss.t
-}
-
-proc FormatSize { size } {
- set string ""
- while { $size > 0 } {
- set rem [expr $size % 1000]
- set size [expr $size / 1000]
- if { $size > 0 } {
- set rem [format "%03d" $rem]
- }
- if { $string != "" } {
- set string "$rem,$string"
- } else {
- set string "$rem"
- }
- }
- return $string
-}
-
-array set modes {
- 0 ---
- 1 --x
- 2 -w-
- 3 -wx
- 4 r--
- 5 r-x
- 6 rw-
- 7 rwx
-}
-
-proc FormatMode { mode } {
- global modes
-
- set mode [format %o [expr $mode & 07777]]
- set owner $modes([string index $mode 0])
- set group $modes([string index $mode 1])
- set world $modes([string index $mode 2])
-
- return "${owner}${group}${world}"
-}
-
-proc Find { tree parent dir } {
- global count
- set saved [pwd]
-
- cd $dir
- foreach f [glob -nocomplain *] {
- set name [file tail $f]
- if { [catch { file stat $f info }] != 0 } {
- set node [$tree insert $parent -label $name]
- } else {
- if 0 {
- if { $info(type) == "file" } {
- set info(type) [list @::blt::TreeView::openIcon $name]
- } else {
- set info(type) "@::blt::TreeView::openIcon "
- }
- }
- set info(mtime) [clock format $info(mtime) -format "%b %d, %Y"]
- set info(atime) [clock format $info(atime) -format "%b %d, %Y"]
- set info(ctime) [clock format $info(ctime) -format "%b %d, %Y"]
- set info(size) [FormatSize $info(size)]
- set info(mode) [FormatMode $info(mode)]
- set node [$tree insert $parent -label $name -data [array get info]]
- }
- incr count
- if { [file type $f] == "directory" } {
- Find $tree $node $f
- }
- }
- cd $saved
-}
-
-
-proc GetAbsolutePath { dir } {
- set saved [pwd]
- cd $dir
- set path [pwd]
- cd $saved
- return $path
-}
-
-option add *TreeView.focusOutSelectForeground white
-option add *TreeView.focusOutSelectBackground grey80
-#option add *TreeView.Button.activeBackground pink
-option add *TreeView.Button.activeBackground grey90
-#option add *TreeView.Button.background grey95
-option add *TreeView.Column.background grey90
-option add *TreeView.CheckBoxStyle.activeBackground white
-if 0 {
-if 1 {
- option add *TreeView.Column.titleFont { Arial 10 }
- option add *TreeView.text.font { Monotype.com 10 Bold }
- option add *TreeView.CheckBoxStyle.font Courier-10
- option add *TreeView.ComboBoxStyle.font Helvetica-10
- option add *TreeView.TextBoxStyle.font {Arial 10 bold }
-} else {
- option add *TreeView.Column.titleFont { Arial 14 }
-}
-}
-button .b -font { Helvetica 11 bold }
-set top [GetAbsolutePath ..]
-#set top [GetAbsolutePath /home/gah]
-set trim "$top"
-
-set tree [blt::tree create]
-
-blt::scrollset .ss \
- -xscrollbar .ss.hs \
- -yscrollbar .ss.vs \
- -window .ss.t
-
-blt::tk::scrollbar .ss.vs -orient vertical
-blt::tk::scrollbar .ss.hs -orient horizontal
-
-blt::treeview .ss.t \
- -width 0 \
- -height 0 \
- -highlightthickness 0 \
- -borderwidth 0 \
- -selectmode multiple \
- -separator / \
- -tree $tree
-
-.ss.t column configure treeView -text "" -edit yes
-#file
-.ss.t column insert 0 mtime atime gid
-.ss.t column insert end nlink mode type ctime uid ino size dev
-.ss.t column configure uid -background \#eaeaff -relief raised
-.ss.t column configure mtime -hide no -bg \#ffeaea -relief raised
-.ss.t column configure size gid nlink uid ino dev -justify left -edit yes
-.ss.t column configure size type -justify left -edit yes
-.ss.t column configure treeView -hide no -edit yes \
- -icon ::blt::TreeView::openIcon
-focus .ss.t
-
-
-blt::table . \
- 0,0 .ss -fill both
-
-set count 0
-Find $tree root $top
-puts "$count entries"
-
-$tree find root -glob *.c -addtag "c_files"
-$tree find root -glob *.h -addtag "header_files"
-$tree find root -glob *.tcl -addtag "tcl_files"
-
-.ss.t entry configure "c_files" -foreground green4
-.ss.t entry configure "header_files" -foreground cyan4
-.ss.t entry configure "tcl_files" -foreground red4
-
-.ss.t column bind all <ButtonRelease-3> {
- %W configure -flat no
-}
-
-foreach column [.ss.t column names] {
- .ss.t column configure $column -command [list SortColumn $column]
-}
-
-#.ss.t style configure text -background #F8fbF8 -selectbackground #D8fbD8
-
-.ss.t style checkbox check \
- -onvalue 100 -offvalue "50" \
- -showvalue yes
-
-.ss.t style combobox combo -icon ::blt::TreeView::openIcon
-
-.ss.t column configure uid -style combo
-.ss.t column configure gid -style check
-
-
diff --git a/blt3.0.1/demos/scrollset4.tcl b/blt3.0.1/demos/scrollset4.tcl
deleted file mode 100644
index 2cd29c2..0000000
--- a/blt3.0.1/demos/scrollset4.tcl
+++ /dev/null
@@ -1,59 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-#blt::bltdebug 100
-
-image create picture label1 -file ./images/mini-book1.gif
-image create picture label2 -file ./images/mini-book2.gif
-image create picture testImage -file ./images/txtrflag.gif
-
-blt::scrollset .ss \
- -xviewcommand { .ss.t view } \
- -xscrollbar .ss.xsbar \
- -yscrollbar .ss.ysbar \
- -window .ss.t
-
-blt::tk::scrollbar .ss.ysbar -orient vertical
-blt::tk::scrollbar .ss.xsbar -orient horizontal
-
-blt::tabset .ss.t \
- -font { Arial 8 } \
- -textside right \
- -tabwidth same \
- -scrollcommand { .ss set x } \
- -scrollincrement 1
-
-blt::table . \
- .ss 0,0 -fill both
-
-focus .ss.t
-
-set attributes {
- graph1 "Graph \#1" pink
- graph2 "Graph \#2" lightblue
- graph3 "Graph \#3" orange
- graph5 "Graph \#5" yellow
- barchart2 "Barchart \#2" green
-}
-
-foreach { name label color } $attributes {
- .ss.t insert end $name -text $label
-}
-
-blt::tk::label .ss.t.l -image testImage
-.ss.t insert end Image -window .ss.t.l
-
-.ss.t focus 0
-
-foreach file { graph1 graph2 graph3 graph5 barchart2 } {
- namespace eval $file {
- if { [string match graph* $file] } {
- set graph [blt::graph .ss.t.$file]
- } else {
- set graph [blt::barchart .ss.t.$file]
- }
- source scripts/$file.tcl
- .ss.t tab configure $file -window $graph -fill both
- }
-}
diff --git a/blt3.0.1/demos/spline.tcl b/blt3.0.1/demos/spline.tcl
deleted file mode 100755
index 427c40f..0000000
--- a/blt3.0.1/demos/spline.tcl
+++ /dev/null
@@ -1,61 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-option add *graph.Element.ScaleSymbols true
-
-# test to show spline over-shooting
-
-set tcl_precision 15
-
-# Make and fill small vectors
-blt::vector x y
-x seq 10 0 -0.5
-y expr sin(x^3)
-x expr x*x
-x sort y
-blt::vector x2 y1 y2 y3
-
-# make and fill (x only) large vectors
-x populate x2 10
-
-# natural spline interpolation
-blt::spline natural x y x2 y1
-
-# quadratic spline interpolation
-blt::spline quadratic x y x2 y2
-
-# make plot
-blt::graph .graph
-.graph xaxis configure -title "x^2" -grid yes
-.graph yaxis configure -title "sin(y^3)" -grid yes
-
-.graph pen configure activeLine -pixels 5
-.graph element create Original \
- -x x -y y \
- -color red4 \
- -fill red \
- -pixels 5 \
- -symbol circle
-
-.graph element create Natural -x x2 -y y1 \
- -color green4 \
- -fill green \
- -pixels 3 \
- -symbol triangle
-
-.graph element create Quadratic -x x2 -y y2 \
- -color blue4 \
- -fill orange2 \
- -pixels 3 \
- -symbol arrow
-
-blt::table . .graph -fill both
-
-Blt_ZoomStack .graph
-Blt_Crosshairs .graph
-Blt_ActiveLegend .graph
-Blt_ClosestPoint .graph
-Blt_PrintKey .graph
-
diff --git a/blt3.0.1/demos/stripchart1.tcl b/blt3.0.1/demos/stripchart1.tcl
deleted file mode 100755
index 5cd4c30..0000000
--- a/blt3.0.1/demos/stripchart1.tcl
+++ /dev/null
@@ -1,407 +0,0 @@
-#!../src/bltwish
-
-lappend auto_path /usr/local/blt/lib/blt3.0
-package require BLT
-source scripts/demo.tcl
-
-# ----------------------------------------------------------------------
-# EXAMPLE: simple driver for stripchart widget
-# ----------------------------------------------------------------------
-# Michael J. McLennan
-# mmclennan at lucent.com
-# Bell Labs Innovations for Lucent Technologies
-# ======================================================================
-# Copyright (c) 1996 Lucent Technologies
-# ======================================================================
-
-option add *Axis.tickInterior yes
-option add *Axis.tickDefault 5
-option add *Axis.Grid yes
-option add *Axis.GridColor lightblue
-option add *Legend.Hide yes
-#option add *Axis.GridDashes 0
-option add *bufferElements no
-option add *bufferGraph yes
-option add *symbol triangle
-option add *symbol none
-option add *Axis.lineWidth 1
-#option add *Axis*Rotate 90
-option add *pixels 1.25m
-#option add *PlotPad 25
-option add *Stripchart.width 6i
-option add *Stripchart.height 6i
-#option add *Smooth quadratic
-#option add *x.descending yes
-
-# ----------------------------------------------------------------------
-# USAGE: random ?<max>? ?<min>?
-#
-# Returns a random number in the range <min> to <max>.
-# If <min> is not specified, the default is 0; if max is not
-# specified, the default is 1.
-# ----------------------------------------------------------------------
-
-proc random {{max 1.0} {min 0.0}} {
- global randomSeed
-
- set randomSeed [expr (7141*$randomSeed+54773) % 259200]
- set num [expr $randomSeed/259200.0*($max-$min)+$min]
- return $num
-}
-set randomSeed 14823
-
-# ----------------------------------------------------------------------
-
-toplevel .addSource
-wm title .addSource "Add Source"
-wm group .addSource .
-wm withdraw .addSource
-wm protocol .addSource WM_DELETE_WINDOW {.addSource.controls.cancel invoke}
-
-frame .addSource.info
-pack .addSource.info -expand yes -fill both -padx 4 -pady 4
-label .addSource.info.namel -text "Name:"
-entry .addSource.info.name
-label .addSource.info.maxl -text "Maximum:"
-entry .addSource.info.max
-label .addSource.info.minl -text "Minimum:"
-entry .addSource.info.min
-blt::table .addSource.info \
- .addSource.info.namel 0,0 -anchor e \
- .addSource.info.name 0,1 -fill x \
- .addSource.info.maxl 1,0 -anchor e \
- .addSource.info.max 1,1 -fill x \
- .addSource.info.minl 2,0 -anchor e \
- .addSource.info.min 2,1 -fill x
-
-frame .addSource.color
-pack .addSource.color -padx 8 -pady 4
-frame .addSource.color.sample \
- -width 30 -height 30 \
- -borderwidth 2 -relief raised
-pack .addSource.color.sample -side top -fill both
-scale .addSource.color.r -label "Red" -orient vertical \
- -from 100 -to 0 -command source_color
-pack .addSource.color.r -side left -fill y
-scale .addSource.color.g -label "Green" -orient vertical \
- -from 100 -to 0 -command source_color
-pack .addSource.color.g -side left -fill y
-scale .addSource.color.b -label "Blue" -orient vertical \
- -from 100 -to 0 -command source_color
-pack .addSource.color.b -side left -fill y
-
-proc source_color {args} {
- set r [expr round(2.55*[.addSource.color.r get])]
- set g [expr round(2.55*[.addSource.color.g get])]
- set b [expr round(2.55*[.addSource.color.b get])]
- set color [format "#%2.2x%2.2x%2.2x" $r $g $b]
- .addSource.color.sample configure -background $color
-}
-source_color
-
-frame .addSource.sep -borderwidth 1 -height 2 -relief sunken
-pack .addSource.sep -fill x -pady 4
-
-frame .addSource.controls
-pack .addSource.controls -fill x -padx 4 -pady 4
-button .addSource.controls.ok -text "OK" -command {
- wm withdraw .addSource
- set name [.addSource.info.name get]
- set color [.addSource.color.sample cget -background]
- set max [.addSource.info.max get]
- set min [.addSource.info.min get]
- if {[catch {source_create $name $color $min $max} err] != 0} {
- puts "error: $err"
- }
-}
-pack .addSource.controls.ok -side left -expand yes -padx 4
-button .addSource.controls.cancel -text "Cancel" -command {
- wm withdraw .addSource
-}
-pack .addSource.controls.cancel -side left -expand yes -padx 4
-
-set useAxes y
-blt::bitmap define pattern1 { {4 4} {01 02 04 08} }
-
-blt::bitmap define hobbes { {25 25} {
- 00 00 00 00 00 00 00 00 00 c0 03 00 78 e0 07 00 fc f8 07 00 cc 07 04 00
- 0c f0 0b 00 7c 1c 06 00 38 00 00 00 e0 03 10 00 e0 41 11 00 20 40 11 00
- e0 07 10 00 e0 c1 17 00 10 e0 2f 00 20 e0 6f 00 18 e0 2f 00 20 c6 67 00
- 18 84 2b 00 20 08 64 00 70 f0 13 00 80 01 08 00 00 fe 07 00 00 00 00 00
- 00 00 00 00 }
-}
-
-proc source_create {name color min max} {
- global sources
-
- if {[info exists sources($name-controls)]} {
- error "source \"$name\" already exists"
- }
- if {$max <= $min} {
- error "bad range: $min - $max"
- }
-
- set unique 0
- set win ".sources.nb.s[incr unique]"
- while {[winfo exists $win]} {
- set win ".sources.nb.s[incr unique]"
- }
-
- set xvname "xvector$unique"
- set yvname "yvector$unique"
- set wvname "wvector$unique"
- global $xvname $yvname $wvname
- blt::vector $xvname $yvname $wvname
-
- if {$xvname == "xvector1"} {
- $xvname append 0
- } else {
- xvector1 variable thisVec
- $xvname append $thisVec(end)
- }
- $yvname append [random $max $min]
- $wvname append 0
-
- catch {.sc element delete $name}
- set bg [blt::bgpattern create solid -opacity 50 -color $color]
- .sc element create $name \
- -areabackground $bg \
- -x $xvname \
- -y $yvname \
- -color $color
- if { $name != "default" } {
- .sc axis create $name \
- -loose no \
- -title $name \
- -grid yes \
- -rotate 0 \
- -limitscolor $color \
- -limitsformat "%4.4g" \
- -titlecolor ${color}
- .sc element configure $name -mapy $name
- global useAxes
- lappend useAxes $name
- set count 0
-if 0 {
- set yUse $useAxes
- set y2Use {}
- foreach axis $useAxes {
- if { $count & 1 } {
- lappend yUse $axis
- .sc axis configure $axis -rotate 90
- } else {
- lappend y2Use $axis
- .sc axis configure $axis -rotate -90
- }
- incr count
- }
- .sc y2axis use $y2Use
- .sc yaxis use $yUse
-} else {
- .sc y2axis use $useAxes
-}
- }
- set cwin .sources.choices.rb$unique
- radiobutton $cwin -text $name \
- -variable choices -value $win -command "
- foreach w \[pack slaves .sources.nb\] {
- pack forget \$w
- }
- pack $win -fill both
- "
- pack $cwin -anchor w
-
- frame $win
- pack $win -fill x
- label $win.limsl -text "Limits:"
- entry $win.lims
- bind $win.lims <KeyPress-Return> "
- .sc yaxis configure -limits {%%g}
- "
- label $win.smoothl -text "Smooth:"
- frame $win.smooth
- radiobutton $win.smooth.linear -text "Linear" \
- -variable smooth -value linear -command "
- .sc element configure $name -smooth linear
- "
- pack $win.smooth.linear -side left
- radiobutton $win.smooth.step -text "Step" \
- -variable smooth -value step -command "
- .sc element configure $name -smooth step
- "
- pack $win.smooth.step -side left
- radiobutton $win.smooth.natural -text "Natural" \
- -variable smooth -value natural -command "
- .sc element configure $name -smooth natural
- "
- pack $win.smooth.natural -side left
- label $win.ratel -text "Sampling Rate:"
- scale $win.rate -orient horizontal -from 10 -to 1000
-
- blt::table $win \
- $win.smoothl 0,0 -anchor e \
- $win.smooth 0,1 -fill x -padx 4 \
- $win.limsl 1,0 -anchor e \
- $win.lims 1,1 -fill x -padx 4 \
- $win.ratel 2,0 -anchor e \
- $win.rate 2,1 -fill x -padx 2
-
- if {$unique != 1} {
- button $win.del -text "Delete" -command [list source_delete $name]
- pack $win.del -anchor w
- blt::table $win $win.del 3,1 -anchor e -padx 4 -pady 4
- }
-
- $win.rate set 200
- catch {$win.smooth.[.sc element cget $name -smooth] invoke} mesg
-
- set sources($name-choice) $cwin
- set sources($name-controls) $win
- set sources($name-stream) [after 10 [list source_event $name 10]]
- set sources($name-x) $xvname
- set sources($name-y) $yvname
- set sources($name-w) $wvname
- set sources($name-max) $max
- set sources($name-min) $min
- set sources($name-steady) [random $max $min]
-
- $cwin invoke
-}
-
-proc source_delete {name} {
- global sources
-
- after cancel $sources($name-stream)
- destroy $sources($name-choice)
- destroy $sources($name-controls)
- unset sources($name-controls)
-
- set first [lindex [pack slaves .sources.choices] 0]
- $first invoke
-}
-
-proc source_event {name delay} {
- global sources
-
- set xv $sources($name-x)
- set yv $sources($name-y)
- set wv $sources($name-w)
- global $xv $yv $wv
-
- $xv variable x
- set x(++end) [expr $x(end) + 0.001 * $delay]
-
- $yv variable y
- if {[random] > 0.97} {
- set y(++end) [random $sources($name-max) $sources($name-min)]
- } else {
- set y(++end) [expr $y(end)+0.1*($sources($name-steady)-$y(end))]
- }
- set val [random]
- if {$val > 0.95} {
- $wv append 2
- } elseif {$val > 0.8} {
- $wv append 1
- } else {
- $wv append 0
- }
- #$wv notify now
- if { [$xv length] > 1000 } {
- $xv delete 0
- $yv delete 0
- $wv delete 0
- }
- update
- set win $sources($name-controls)
- set delay [$win.rate get]
- set sources($name-stream) [after $delay [list source_event $name $delay]]
-}
-
-# ----------------------------------------------------------------------
-frame .mbar -borderwidth 2 -relief raised
-pack .mbar -fill x
-
-menubutton .mbar.main -text "Main" -menu .mbar.main.m
-pack .mbar.main -side left -padx 4
-menu .mbar.main.m
-.mbar.main.m add command -label "Add Source..." -command {
- set x [expr [winfo rootx .]+50]
- set y [expr [winfo rooty .]+50]
- wm geometry .addSource +$x+$y
- wm deiconify .addSource
-}
-.mbar.main.m add separator
-.mbar.main.m add command -label "Quit" -command exit
-
-menubutton .mbar.prefs -text "Preferences" -menu .mbar.prefs.m
-pack .mbar.prefs -side left -padx 4
-
-menu .mbar.prefs.m
-.mbar.prefs.m add cascade -label "Warning Symbol" -menu .mbar.prefs.m.wm
-menu .mbar.prefs.m.wm
-.mbar.prefs.m add cascade -label "Error Symbol" -menu .mbar.prefs.m.em
-menu .mbar.prefs.m.em
-
-foreach sym {square circle diamond plus cross triangle} {
- .mbar.prefs.m.wm add radiobutton -label $sym \
- -variable warningsym -value $sym \
- -command {.sc pen configure "warning" -symbol $warningsym}
-
- .mbar.prefs.m.em add radiobutton -label $sym \
- -variable errorsym -value $sym \
- -command {.sc pen configure "error" -symbol $errorsym}
-}
-catch {.mbar.prefs.m.wm invoke "circle"}
-catch {.mbar.prefs.m.em invoke "cross"}
-
-# ----------------------------------------------------------------------
-blt::stripchart .sc -title "" -stackaxes yes -invert no \
- -bufferelements no
-pack .sc -expand yes -fill both
-
-.sc xaxis configure -title "Time (s)" -autorange 20.0 -shiftby 0.5
-.sc yaxis configure -title "Samples"
-
-frame .sources
-frame .sources.nb -borderwidth 2 -relief sunken
-label .sources.title -text "Sources:"
-frame .sources.choices -borderwidth 2 -relief groove
-
-if 0 {
-pack .sources -fill x -padx 10 -pady 4
-pack .sources.nb -side right -expand yes -fill both -padx 4 -pady 4
-pack .sources.title -side top -anchor w -padx 4
-pack .sources.choices -expand yes -fill both -padx 4 -pady 4
-}
-
-
-source_create default red 0 10
-source_create temp blue3 0 10
-source_create pressure green3 0 200
-source_create volume orange3 0 1020
-source_create power yellow3 0 0.01999
-source_create work magenta3 0 10
-
-Blt_ZoomStack .sc
-
-.sc axis bind all <Enter> {
- %W axis activate [%W axis get current]
-}
-.sc axis bind all <Leave> {
- %W axis deactivate [%W axis get current]
-}
-
-.sc axis bind Y <ButtonPress-1> {
- set axis [%W axis get current]
- %W axis configure $axis -logscale yes
-}
-
-.sc axis bind Y <ButtonPress-3> {
- set axis [%W axis get current]
- %W axis configure $axis -logscale no
-}
-
-after 5000 {
- puts stderr "printing stripchart"
- .sc postscript output sc.ps
-}
diff --git a/blt3.0.1/demos/stripchart2.tcl b/blt3.0.1/demos/stripchart2.tcl
deleted file mode 100755
index 586c9a8..0000000
--- a/blt3.0.1/demos/stripchart2.tcl
+++ /dev/null
@@ -1,397 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-# ----------------------------------------------------------------------
-# EXAMPLE: simple driver for stripchart widget
-# ----------------------------------------------------------------------
-# Michael J. McLennan
-# mmclennan at lucent.com
-# Bell Labs Innovations for Lucent Technologies
-# ======================================================================
-# Copyright (c) 1996 Lucent Technologies
-# ======================================================================
-
-#option add *x.range 20.0
-option add *Axis.tickDefault 4
-option add *Axis.tickLength 5
-option add *Axis.tickInterior yes
-option add *Axis.GridLines yes
-#option add *x.shiftBy 15.0
-option add *bufferElements no
-option add *bufferGraph no
-option add *symbol triangle
-option add *Axis.lineWidth 1
-#option add *Axis*Rotate 90
-option add *pixels 1.25m
-#option add *PlotPad 25
-option add *Stripchart.width 6i
-#option add *Smooth quadratic
-#option add *Stripchart.invertXY yes
-#option add *x.descending yes
-
-# ----------------------------------------------------------------------
-# USAGE: random ?<max>? ?<min>?
-#
-# Returns a random number in the range <min> to <max>.
-# If <min> is not specified, the default is 0; if max is not
-# specified, the default is 1.
-# ----------------------------------------------------------------------
-
-proc random {{max 1.0} {min 0.0}} {
- global randomSeed
-
- set randomSeed [expr (7141*$randomSeed+54773) % 259200]
- set num [expr $randomSeed/259200.0*($max-$min)+$min]
- return $num
-}
-set randomSeed 14823
-
-# ----------------------------------------------------------------------
-
-toplevel .addSource
-wm title .addSource "Add Source"
-wm group .addSource .
-wm withdraw .addSource
-wm protocol .addSource WM_DELETE_WINDOW {.addSource.controls.cancel invoke}
-
-frame .addSource.info
-pack .addSource.info -expand yes -fill both -padx 4 -pady 4
-label .addSource.info.namel -text "Name:"
-entry .addSource.info.name
-label .addSource.info.maxl -text "Maximum:"
-entry .addSource.info.max
-label .addSource.info.minl -text "Minimum:"
-entry .addSource.info.min
-blt::table .addSource.info \
- .addSource.info.namel 0,0 -anchor e \
- .addSource.info.name 0,1 -fill x \
- .addSource.info.maxl 1,0 -anchor e \
- .addSource.info.max 1,1 -fill x \
- .addSource.info.minl 2,0 -anchor e \
- .addSource.info.min 2,1 -fill x
-
-frame .addSource.color
-pack .addSource.color -padx 8 -pady 4
-frame .addSource.color.sample \
- -width 30 -height 30 \
- -borderwidth 2 -relief raised
-pack .addSource.color.sample -side top -fill both
-scale .addSource.color.r -label "Red" -orient vertical \
- -from 100 -to 0 -command source_color
-pack .addSource.color.r -side left -fill y
-scale .addSource.color.g -label "Green" -orient vertical \
- -from 100 -to 0 -command source_color
-pack .addSource.color.g -side left -fill y
-scale .addSource.color.b -label "Blue" -orient vertical \
- -from 100 -to 0 -command source_color
-pack .addSource.color.b -side left -fill y
-
-proc source_color {args} {
- set r [expr round(2.55*[.addSource.color.r get])]
- set g [expr round(2.55*[.addSource.color.g get])]
- set b [expr round(2.55*[.addSource.color.b get])]
- set color [format "#%2.2x%2.2x%2.2x" $r $g $b]
- .addSource.color.sample configure -background $color
-}
-source_color
-
-frame .addSource.sep -borderwidth 1 -height 2 -relief sunken
-pack .addSource.sep -fill x -pady 4
-
-frame .addSource.controls
-pack .addSource.controls -fill x -padx 4 -pady 4
-button .addSource.controls.ok -text "OK" -command {
- wm withdraw .addSource
- set name [.addSource.info.name get]
- set color [.addSource.color.sample cget -background]
- set max [.addSource.info.max get]
- set min [.addSource.info.min get]
- if {[catch {source_create $name $color $min $max} err] != 0} {
- puts "error: $err"
- }
-}
-pack .addSource.controls.ok -side left -expand yes -padx 4
-button .addSource.controls.cancel -text "Cancel" -command {
- wm withdraw .addSource
-}
-pack .addSource.controls.cancel -side left -expand yes -padx 4
-
-set useAxes y
-
-proc source_create {name color min max} {
- global sources
-
- if {[info exists sources($name-controls)]} {
- error "source \"$name\" already exists"
- }
- if {$max <= $min} {
- error "bad range: $min - $max"
- }
-
- set unique 0
- set win ".sources.nb.s[incr unique]"
- while {[winfo exists $win]} {
- set win ".sources.nb.s[incr unique]"
- }
-
- set xvname "xvector$unique"
- set yvname "yvector$unique"
- set wvname "wvector$unique"
- global $xvname $yvname $wvname
- blt::vector $xvname $yvname $wvname
-
- if {$xvname == "xvector1"} {
- $xvname append 0
- } else {
- xvector1 variable thisVec
- $xvname append $thisVec(end)
- }
- $yvname append [random $max $min]
- $wvname append 0
-
- blt::bitmap define pattern1 { {4 4} {01 02 04 08} }
- catch {.sc element delete $name}
- #set style [blt::bgpattern create solid -bg $color -opacity 90.0]
- .sc bar create $name \
- -x $xvname \
- -y $yvname \
- -outline $color -fill $color
- if { $name != "default" } {
- .sc axis create $name \
- -loose yes \
- -title $name \
- -grid yes \
- -rotate 0 \
- -limitscolor $color \
- -limitsformat "%4.4g" \
- -titlecolor ${color}
- .sc element configure $name -mapy $name
- global useAxes
- lappend useAxes $name
- set count 0
-if 0 {
- set yUse $useAxes
- set y2Use {}
- foreach axis $useAxes {
- if { $count & 1 } {
- lappend yUse $axis
- .sc axis configure $axis -rotate 90
- } else {
- lappend y2Use $axis
- .sc axis configure $axis -rotate -90
- }
- incr count
- }
- .sc y2axis use $y2Use
- .sc yaxis use $yUse
-} else {
- .sc yaxis use $useAxes
- #.sc yaxis use $useAxes
-}
- }
- set cwin .sources.choices.rb$unique
- radiobutton $cwin -text $name \
- -variable choices -value $win -command "
- foreach w \[pack slaves .sources.nb\] {
- pack forget \$w
- }
- pack $win -fill both
- "
- pack $cwin -anchor w
-
- frame $win
- pack $win -fill x
- label $win.limsl -text "Limits:"
- entry $win.lims
- bind $win.lims <KeyPress-Return> "
- .sc yaxis configure -limits {%%g}
- "
- label $win.smoothl -text "Smooth:"
- frame $win.smooth
- radiobutton $win.smooth.linear -text "Linear" \
- -variable smooth -value linear -command "
- .sc element configure $name -smooth linear
- "
- pack $win.smooth.linear -side left
- radiobutton $win.smooth.step -text "Step" \
- -variable smooth -value step -command "
- .sc element configure $name -smooth step
- "
- pack $win.smooth.step -side left
- radiobutton $win.smooth.natural -text "Natural" \
- -variable smooth -value natural -command "
- .sc element configure $name -smooth natural
- "
- pack $win.smooth.natural -side left
- label $win.ratel -text "Sampling Rate:"
- scale $win.rate -orient horizontal -from 10 -to 1000
-
- blt::table $win \
- $win.smoothl 0,0 -anchor e \
- $win.smooth 0,1 -fill x -padx 4 \
- $win.limsl 1,0 -anchor e \
- $win.lims 1,1 -fill x -padx 4 \
- $win.ratel 2,0 -anchor e \
- $win.rate 2,1 -fill x -padx 2
-
- if {$unique != 1} {
- button $win.del -text "Delete" -command [list source_delete $name]
- pack $win.del -anchor w
- blt::table $win $win.del 3,1 -anchor e -padx 4 -pady 4
- }
-
- $win.rate set 1000
- catch {$win.smooth.[.sc element cget $name -smooth] invoke} mesg
-
- set sources($name-choice) $cwin
- set sources($name-controls) $win
- set sources($name-stream) [after 100 [list source_event $name 10]]
- set sources($name-x) $xvname
- set sources($name-y) $yvname
- set sources($name-w) $wvname
- set sources($name-max) $max
- set sources($name-min) $min
- set sources($name-steady) [random $max $min]
-
- $cwin invoke
-}
-
-proc source_delete {name} {
- global sources
-
- after cancel $sources($name-stream)
- destroy $sources($name-choice)
- destroy $sources($name-controls)
- unset sources($name-controls)
-
- set first [lindex [pack slaves .sources.choices] 0]
- $first invoke
-}
-
-proc source_event {name delay} {
- global sources
-
- set xv $sources($name-x)
- set yv $sources($name-y)
- set wv $sources($name-w)
- global $xv $yv $wv
-
- $xv variable x
-# set x(++end) [expr $x(end) + 0.001 * $delay]
- set x(++end) [expr round($x(end) + 1)]
-
- $yv variable y
- if {[random] > 0.97} {
- set y(++end) [random $sources($name-max) $sources($name-min)]
- } else {
- set y(++end) [expr $y(end)+0.1*($sources($name-steady)-$y(end))]
- }
- set val [random]
- if {$val > 0.95} {
- $wv append 2
- } elseif {$val > 0.8} {
- $wv append 1
- } else {
- $wv append 0
- }
- #$wv notify now
- if { [$xv length] > 100 } {
- $xv delete 0
- $yv delete 0
- $wv delete 0
- }
- update
- set win $sources($name-controls)
- set delay [$win.rate get]
- set sources($name-stream) [after $delay [list source_event $name $delay]]
-}
-
-# ----------------------------------------------------------------------
-frame .mbar -borderwidth 2 -relief raised
-pack .mbar -fill x
-
-menubutton .mbar.main -text "Main" -menu .mbar.main.m
-pack .mbar.main -side left -padx 4
-menu .mbar.main.m
-.mbar.main.m add command -label "Add Source..." -command {
- set x [expr [winfo rootx .]+50]
- set y [expr [winfo rooty .]+50]
- wm geometry .addSource +$x+$y
- wm deiconify .addSource
-}
-.mbar.main.m add separator
-.mbar.main.m add command -label "Quit" -command exit
-
-menubutton .mbar.prefs -text "Preferences" -menu .mbar.prefs.m
-pack .mbar.prefs -side left -padx 4
-
-menu .mbar.prefs.m
-.mbar.prefs.m add cascade -label "Warning Symbol" -menu .mbar.prefs.m.wm
-menu .mbar.prefs.m.wm
-.mbar.prefs.m add cascade -label "Error Symbol" -menu .mbar.prefs.m.em
-menu .mbar.prefs.m.em
-
-foreach sym {square circle diamond plus cross triangle} {
- .mbar.prefs.m.wm add radiobutton -label $sym \
- -variable warningsym -value $sym \
- -command {.sc pen configure "warning" -symbol $warningsym}
-
- .mbar.prefs.m.em add radiobutton -label $sym \
- -variable errorsym -value $sym \
- -command {.sc pen configure "error" -symbol $errorsym}
-}
-catch {.mbar.prefs.m.wm invoke "circle"}
-catch {.mbar.prefs.m.em invoke "cross"}
-
-# ----------------------------------------------------------------------
-blt::stripchart .sc -title "Stripchart" -stackaxes yes -invert no \
- -bufferelements no -buffergraph no
-pack .sc -expand yes -fill both
-
-.sc xaxis configure -title "Time (s)" -autorange 20.0 -shiftby 15
-.sc yaxis configure -title "Samples"
-
-frame .sources
-frame .sources.nb -borderwidth 2 -relief sunken
-label .sources.title -text "Sources:"
-frame .sources.choices -borderwidth 2 -relief groove
-
-if 0 {
-pack .sources -fill x -padx 10 -pady 4
-pack .sources.nb -side right -expand yes -fill both -padx 4 -pady 4
-pack .sources.title -side top -anchor w -padx 4
-pack .sources.choices -expand yes -fill both -padx 4 -pady 4
-}
-
-source_create default red 0 10
-source_create temp blue3 0 10
-source_create pressure green3 0 200
-source_create volume orange3 0 1020
-source_create power purple 0 0.01999
-source_create work magenta3 0 10
-
-Blt_ZoomStack .sc
-
-.sc axis bind all <Enter> {
- %W axis activate [%W axis get current]
-}
-.sc axis bind all <Leave> {
- %W axis deactivate [%W axis get current]
-}
-
-.sc axis bind Y <ButtonPress-1> {
- set axis [%W axis get current]
- %W axis configure $axis -logscale yes
-}
-
-.sc axis bind Y <ButtonPress-3> {
- set axis [%W axis get current]
- %W axis configure $axis -logscale no
-}
-
-after 5000 {
- puts stderr "printing stripchart"
- .sc postscript output sc.ps
-}
diff --git a/blt3.0.1/demos/tabnotebook1.tcl b/blt3.0.1/demos/tabnotebook1.tcl
deleted file mode 100755
index 9cd1719..0000000
--- a/blt3.0.1/demos/tabnotebook1.tcl
+++ /dev/null
@@ -1,64 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-# Create a tabset widget.
-
-blt::tabset .ts -bg blue -outerpad 0 \
- -highlightthickness 0 -bd 0 -gap 2 -justify left -tabwidth same
-
-# The tabset is initially empty. Insert tabs (pages) into the tabset.
-
-foreach label { First Second Third Fourth } {
- .ts insert end -text $label
-}
-
-# Tabs are referred to by their index. Tab indices can be one of the
-# following:
-#
-# number Position of tab the tabset's list of tabs.
-# @x,y Tab closest to the specified X-Y screen coordinates.
-# "active" Tab currently under the mouse pointer.
-# "focus" Tab that has focus.
-# "select" The currently selected tab.
-# "right" Next tab from "focus".
-# "left" Previous tab from "focus".
-# "up" Next tab from "focus".
-# "down" Previous tab from "focus".
-# "end" Last tab in list.
-# string Tab identifier. The "insert" operation returns
-# a unique identifier for the new tab (e.g. "tab0").
-# This ID is valid for the life of the tab, even if
-# the tabs are moved or reordered.
-
-# Each tab has a text label and an optional Tk image.
-
-set image [image create picture -file ./images/mini-book1.gif]
-.ts tab configure 0 -image $image
-
-#
-# How to embed a widget into a page.
-#
-
-# 1. The widget must be a child of the tabset.
-
-set image [image create picture -file ./images/blt98.gif]
-label .ts.label -image $image -relief sunken -bd 2
-
-# 2. Use the -window option to embed the widget.
-
-#.ts tab configure 0 -window .ts.label
-
-# The tearoff perforation, displayed on the selected tab, is
-# controlled by the tabset's -tearoff option.
-#
-# If you don't want tearoff pages, configure -tearoff to "no".
-
-.ts configure -tearoff yes
-
-blt::table . \
- 0,0 .ts -fill both
-
-focus .ts
-
diff --git a/blt3.0.1/demos/tabnotebook2.tcl b/blt3.0.1/demos/tabnotebook2.tcl
deleted file mode 100755
index 9fca1e5..0000000
--- a/blt3.0.1/demos/tabnotebook2.tcl
+++ /dev/null
@@ -1,57 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-image create picture bgTile -file ./images/smblue_rock.gif
-image create picture label1 -file ./images/mini-book1.gif
-image create picture label2 -file ./images/mini-book2.gif
-image create picture testImage -file ./images/txtrflag.gif
-
-scrollbar .s -command { .t view } -orient horizontal
-blt::tabset .t \
- -outerborderwidth 2 \
- -outerrelief sunken \
- -tabwidth same \
- -scrollcommand { .s set } \
- -slant right \
- -textside right \
- -tiers 2
-
-label .t.l -image testImage
-
-set attributes {
- graph1 "Graph \#1" red .t.graph1
- graph2 "Graph \#2" green .t.graph2
- graph3 "Graph \#3" cyan .t.graph3
- graph5 "Graph \#5" yellow .t.graph5
- graph6 one orange .t.l
-}
-
-foreach { entry label color window } $attributes {
- .t insert end -text $label -fill both
-}
-
-foreach label { there bunky another test of a widget } {
- set id [.t insert end -text $label]
-}
-
-set img [image create picture -file ./images/blt98.gif]
-.t tab configure $id -image label2
-
-blt::table . \
- .t 0,0 -fill both \
- .s 1,0 -fill x
-
-blt::table configure . r1 -resize none
-
-set index 0
-foreach file { graph1 graph2 graph3 graph5 } {
- namespace eval $file {
- set graph [blt::graph .t.$file]
- source scripts/$file.tcl
- .t tab configure $index -window $graph
- incr index
- }
-}
-
diff --git a/blt3.0.1/demos/tabnotebook3.tcl b/blt3.0.1/demos/tabnotebook3.tcl
deleted file mode 100755
index 8ee5f24..0000000
--- a/blt3.0.1/demos/tabnotebook3.tcl
+++ /dev/null
@@ -1,609 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-#blt::bltdebug 100
-
-image create picture label1 -file user1.png
-image create picture label2 -file ./images/mini-book2.gif
-image create picture testImage -file ./images/txtrflag.gif
-
-blt::tabset .ts \
- -scrollcommand { .s set } \
- -scrollincrement 1 \
- -scrolltabs yes
-
-label .ts.l -image testImage
-
-set attributes {
- "Graph \#1" pink
- "Graph \#2" lightblue
- "Graph \#3" orange
- "Graph \#5" yellow
- "Barchart \#2" green
-}
-
-foreach { label color } $attributes {
- .ts insert end $label \
- -selectbackground ${color}3 \
- -background ${color}3 \
- -activebackground ${color}2
-}
-
-foreach item [.ts configure] {
- if { [llength $item] == 5 } {
- set switch [lindex $item 0]
- set config($switch) [lindex $item 4]
- }
-}
-.ts insert end -selectbackground salmon2 -background salmon3 \
- -selectbackground salmon3 -activebackground salmon2 -window .ts.l
-
-set tabLabels {
- Aarhus Aaron Ababa aback abaft abandon abandoned abandoning
- abandonment abandons abase abased abasement abasements abases
- abash abashed abashes abashing abasing abate abated abatement
- abatements abater abates abating Abba abbe abbey abbeys abbot
- abbots Abbott abbreviate abbreviated abbreviates abbreviating
- abbreviation abbreviations Abby abdomen abdomens abdominal
- abduct abducted abduction abductions abductor abductors abducts
- Abe abed Abel Abelian Abelson Aberdeen Abernathy aberrant
- aberration aberrations abet abets abetted abetter abetting
- abeyance abhor abhorred abhorrent abhorrer abhorring abhors
- abide abided abides abiding Abidjan Abigail Abilene abilities
- ability abject abjection abjections abjectly abjectness abjure
- abjured abjures abjuring ablate ablated ablates ablating
-}
-set extra {
- ablation ablative ablaze able abler ablest ably Abner abnormal
- abnormalities abnormality abnormally Abo aboard abode abodes
- abolish abolished abolisher abolishers abolishes abolishing
- abolishment abolishments abolition abolitionist abolitionists
- abominable abominate aboriginal aborigine aborigines abort
- aborted aborting abortion abortions abortive abortively aborts
- Abos abound abounded abounding abounds about above aboveboard
- aboveground abovementioned abrade abraded abrades abrading
- Abraham Abram Abrams Abramson abrasion abrasions abrasive
- abreaction abreactions abreast abridge abridged abridges
- abridging abridgment abroad abrogate abrogated abrogates
- abrogating abrupt abruptly abruptness abscess abscessed
- abscesses abscissa abscissas abscond absconded absconding
- absconds absence absences absent absented absentee
- absenteeism absentees absentia absenting absently absentminded
- absents absinthe absolute absolutely absoluteness absolutes
- absolution absolve absolved absolves absolving absorb
- absorbed absorbency absorbent absorber absorbing absorbs
- absorption absorptions absorptive abstain abstained abstainer
- abstaining abstains abstention abstentions abstinence
- abstract abstracted abstracting abstraction abstractionism
- abstractionist abstractions abstractly abstractness
- abstractor abstractors abstracts abstruse abstruseness
- absurd absurdities absurdity absurdly Abu abundance abundant
- abundantly abuse abused abuses abusing abusive abut abutment
- abuts abutted abutter abutters abutting abysmal abysmally
- abyss abysses Abyssinia Abyssinian Abyssinians acacia
- academia academic academically academics academies academy
- Acadia Acapulco accede acceded accedes accelerate accelerated
- accelerates accelerating acceleration accelerations
- accelerator accelerators accelerometer accelerometers accent
- accented accenting accents accentual accentuate accentuated
- accentuates accentuating accentuation accept acceptability
- acceptable acceptably acceptance acceptances accepted
- accepter accepters accepting acceptor acceptors accepts
- access accessed accesses accessibility accessible accessibly
- accessing accession accessions accessories accessors
- accessory accident accidental accidentally accidently
- accidents acclaim acclaimed acclaiming acclaims acclamation
- acclimate acclimated acclimates acclimating acclimatization
- acclimatized accolade accolades accommodate accommodated
- accommodates accommodating accommodation accommodations
- accompanied accompanies accompaniment accompaniments
- accompanist accompanists accompany accompanying accomplice
- accomplices accomplish accomplished accomplisher accomplishers
- accomplishes accomplishing accomplishment accomplishments
- accord accordance accorded accorder accorders according
- accordingly accordion accordions accords accost accosted
- accosting accosts account accountability accountable accountably
- accountancy accountant accountants accounted accounting
- accounts Accra accredit accreditation accreditations
- accredited accretion accretions accrue accrued accrues
- accruing acculturate acculturated acculturates acculturating
- acculturation accumulate accumulated accumulates accumulating
- accumulation accumulations accumulator accumulators
- accuracies accuracy accurate accurately accurateness accursed
- accusal accusation accusations accusative accuse accused
- accuser accuses accusing accusingly accustom accustomed
- accustoming accustoms ace aces acetate acetone acetylene
- Achaean Achaeans ache ached aches achievable achieve achieved
- achievement achievements achiever achievers achieves achieving
- Achilles aching acid acidic acidities acidity acidly acids
- acidulous Ackerman Ackley acknowledge acknowledgeable
- acknowledged acknowledgement acknowledgements acknowledger
- acknowledgers acknowledges acknowledging acknowledgment
- acknowledgments acme acne acolyte acolytes acorn acorns
- acoustic acoustical acoustically acoustician acoustics
- acquaint acquaintance acquaintances acquainted acquainting
- acquaints acquiesce acquiesced acquiescence acquiescent
- acquiesces acquiescing acquirable acquire acquired acquires
- acquiring acquisition acquisitions
-}
-
-foreach label $tabLabels {
- .ts insert end $label -image label1
-}
-
-blt::tk::scrollbar .s -command { .ts view } -orient horizontal -borderwidth 1
-blt::tk::label .side_l -text "-side"
-blt::combobutton .side -textvariable text(-side) -menu .side.m
-blt::combomenu .side.m -textvariable text(-side)
-array set side2rotate {
- top 0
- bottom 0
- left 90
- right 270
-}
-.side.m add -type radiobutton -text [.ts cget -side]
-.side.m add -type separator
-.side.m add -type radiobutton -text "top"
-.side.m add -type radiobutton -text "bottom"
-.side.m add -type radiobutton -text "left"
-.side.m add -type radiobutton -text "right"
-.side.m item configure all -variable config(-side) \
- -command { .ts configure -side $config(-side) -rotate $side2rotate($config(-side)) }
-.side.m select 0
-
-blt::tk::label .iconpos_l -text "-iconposition"
-blt::combobutton .iconpos -textvariable text(-iconposition) -menu .iconpos.m
-blt::combomenu .iconpos.m -textvariable text(-iconposition)
-.iconpos.m add -type radiobutton -text [.ts cget -iconposition]
-.iconpos.m add -type separator
-.iconpos.m add -type radiobutton -text "right"
-.iconpos.m add -type radiobutton -text "left"
-.iconpos.m add -type radiobutton -text "bottom"
-.iconpos.m add -type radiobutton -text "top"
-.iconpos.m item configure all -variable config(-iconposition) \
- -command { .ts configure -iconposition $config(-iconposition) }
-.iconpos.m select 0
-
-blt::tk::label .slant_l -text "-slant"
-blt::combobutton .slant -textvariable text(-slant) -menu .slant.m
-blt::combomenu .slant.m -textvariable text(-slant)
-.slant.m add -type radiobutton -text [.ts cget -slant]
-.slant.m add -type separator
-.slant.m add -type radiobutton -text "none"
-.slant.m add -type radiobutton -text "left"
-.slant.m add -type radiobutton -text "right"
-.slant.m add -type radiobutton -text "both"
-.slant.m item configure all -variable config(-slant) \
- -command { .ts configure -slant $config(-slant) }
-.slant.m select 0
-
-blt::tk::label .rotate_l -text "-rotate"
-blt::combobutton .rotate -textvariable rotatelabel -menu .rotate.m
-blt::combomenu .rotate.m -textvariable rotatelabel
-.rotate.m add -type radiobutton -text [.ts cget -rotate]
-.rotate.m add -type separator
-.rotate.m add -type radiobutton -text "0"
-.rotate.m add -type radiobutton -text "90"
-.rotate.m add -type radiobutton -text "180"
-.rotate.m add -type radiobutton -text "270"
-.rotate.m add -type radiobutton -text "30"
-.rotate.m item configure all -variable rotate \
- -command { .ts configure -rotate $rotate }
-.rotate.m select 0
-
-blt::tk::label .scrolltabs_l -text "-scrolltabs"
-blt::combobutton .scrolltabs -textvariable text(-scrolltabs) \
- -menu .scrolltabs.m
-blt::combomenu .scrolltabs.m -textvariable text(-scrolltabs)
-.scrolltabs.m add -type radiobutton -text [.ts cget -scrolltabs]
-.scrolltabs.m add -type separator
-.scrolltabs.m add -type radiobutton -text "No" -value "0"
-.scrolltabs.m add -type radiobutton -text "Yes" -value "1"
-.scrolltabs.m item configure all -variable config(-scrolltabs) \
- -command { .ts configure -scrolltabs $config(-scrolltabs) }
-.scrolltabs.m select 1
-
-blt::tk::label .closebutton_l -text "-closebutton"
-blt::combobutton .closebutton -textvariable text(-closebutton) \
- -menu .closebutton.m
-blt::combomenu .closebutton.m -textvariable text(-closebutton)
-.closebutton.m add -type radiobutton -text [.ts cget -closebutton]
-.closebutton.m add -type separator
-.closebutton.m add -type radiobutton -text "No" -value "0"
-.closebutton.m add -type radiobutton -text "Yes" -value "1"
-.closebutton.m item configure all -variable config(-closebutton) \
- -command { .ts configure -closebutton $config(-closebutton) }
-.closebutton.m select 0
-
-blt::tk::label .showsingletab_l -text "-showsingletab"
-blt::combobutton .showsingletab -textvariable text(-showsingletab) \
- -menu .showsingletab.m
-blt::combomenu .showsingletab.m -textvariable text(-showsingletab)
-.showsingletab.m add -type radiobutton -text [.ts cget -showsingletab]
-.showsingletab.m add -type separator
-.showsingletab.m add -type radiobutton -text "No" -value "0"
-.showsingletab.m add -type radiobutton -text "Yes" -value "1"
-.showsingletab.m item configure all -variable config(-showsingletab) \
- -command { .ts configure -showsingletab $config(-showsingletab) }
-.showsingletab.m select 0
-
-blt::tk::label .tiers_l -text "-tiers"
-blt::combobutton .tiers -textvariable text(-tiers) -menu .tiers.m
-blt::combomenu .tiers.m -textvariable text(-tiers)
-.tiers.m add -type radiobutton -text [.ts cget -tiers]
-.tiers.m add -type separator
-.tiers.m add -type radiobutton -text "1"
-.tiers.m add -type radiobutton -text "2"
-.tiers.m add -type radiobutton -text "3"
-.tiers.m add -type radiobutton -text "4"
-.tiers.m add -type radiobutton -text "5"
-.tiers.m add -type radiobutton -text "10"
-.tiers.m item configure all -variable tiers \
- -command { .ts configure -tiers $tiers }
-.tiers.m select 0
-
-blt::tk::label .tabwidth_l -text "-tabwidth"
-blt::combobutton .tabwidth -textvariable text(-tabwidth) -menu .tabwidth.m
-blt::combomenu .tabwidth.m -textvariable text(-tabwidth)
-.tabwidth.m add -type radiobutton -text [.ts cget -tabwidth]
-.tabwidth.m add -type separator
-.tabwidth.m add -type radiobutton -text "variable"
-.tabwidth.m add -type radiobutton -text "same"
-.tabwidth.m add -type radiobutton -text ".5 inch" -value "0.5i"
-.tabwidth.m add -type radiobutton -text "1 inch" -value "1i"
-.tabwidth.m add -type radiobutton -text "2 inch" -value "2i"
-.tabwidth.m item configure all -variable config(-tabwidth) \
- -command { .ts configure -tabwidth $config(-tabwidth) }
-.tabwidth.m select 0
-
-blt::tk::label .justify_l -text "-justify"
-blt::combobutton .justify -textvariable text(-justify) -menu .justify.m
-blt::combomenu .justify.m -textvariable text(-justify)
-.justify.m add -type radiobutton -text [.ts cget -justify]
-.justify.m add -type separator
-.justify.m add -type radiobutton -text "left"
-.justify.m add -type radiobutton -text "center"
-.justify.m add -type radiobutton -text "right"
-.justify.m item configure all -variable config(-justify) \
- -command { .ts configure -justify $config(-justify) }
-.justify.m select 0
-
-blt::tk::label .tearoff_l -text "-tearoff"
-blt::combobutton .tearoff -textvariable text(-tearoff) -menu .tearoff.m
-blt::combomenu .tearoff.m -textvariable text(-tearoff)
-.tearoff.m add -type radiobutton -text [.ts cget -tearoff]
-.tearoff.m add -type separator
-.tearoff.m add -type radiobutton -text "No" -value "0"
-.tearoff.m add -type radiobutton -text "Yes" -value "1"
-.tearoff.m item configure all -variable config(-tearoff) \
- -command { .ts configure -tearoff $config(-tearoff) }
-.tearoff.m select 0
-
-blt::tk::label .highlightthickness_l -text "-highlightthickness"
-blt::combobutton .highlightthickness -textvariable text(-highlightthickness) \
- -menu .highlightthickness.m
-blt::combomenu .highlightthickness.m -textvariable text(-highlightthickness)
-.highlightthickness.m add -type radiobutton -text [.ts cget -highlightthickness]
-.highlightthickness.m add -type separator
-.highlightthickness.m add -type radiobutton -text "0"
-.highlightthickness.m add -type radiobutton -text "1"
-.highlightthickness.m add -type radiobutton -text "2"
-.highlightthickness.m add -type radiobutton -text "3"
-.highlightthickness.m add -type radiobutton -text "10"
-.highlightthickness.m item configure all -variable config(-highlightthickness) \
- -command { .ts configure -highlightthickness $config(-highlightthickness) }
-.highlightthickness.m select 0
-
-blt::tk::label .outerpad_l -text "-outerpad"
-blt::combobutton .outerpad -textvariable text(-outerpad) -menu .outerpad.m
-blt::combomenu .outerpad.m -textvariable text(-outerpad)
-.outerpad.m add -type radiobutton -text [.ts cget -outerpad]
-.outerpad.m add -type separator
-.outerpad.m add -type radiobutton -text "0"
-.outerpad.m add -type radiobutton -text "1"
-.outerpad.m add -type radiobutton -text "2"
-.outerpad.m add -type radiobutton -text "3"
-.outerpad.m add -type radiobutton -text "10"
-.outerpad.m item configure all -variable config(-outerpad) \
- -command { .ts configure -outerpad $config(-outerpad) }
-.outerpad.m select 0
-
-blt::tk::label .borderwidth_l -text "-borderwidth"
-blt::combobutton .borderwidth -textvariable text(-borderwidth) \
- -menu .borderwidth.m
-blt::combomenu .borderwidth.m -textvariable text(-borderwidth)
-.borderwidth.m add -type radiobutton -text [.ts cget -borderwidth]
-.borderwidth.m add -type separator
-.borderwidth.m add -type radiobutton -text "0"
-.borderwidth.m add -type radiobutton -text "1"
-.borderwidth.m add -type radiobutton -text "2"
-.borderwidth.m add -type radiobutton -text "3"
-.borderwidth.m add -type radiobutton -text "10"
-.borderwidth.m item configure all -variable config(-borderwidth) \
- -command { .ts configure -borderwidth $config(-borderwidth) }
-.borderwidth.m select 0
-
-blt::tk::label .gap_l -text "-gap"
-blt::combobutton .gap -textvariable text(-gap) -menu .gap.m
-blt::combomenu .gap.m -textvariable text(-gap)
-.gap.m add -type radiobutton -text [.ts cget -gap]
-.gap.m add -type separator
-.gap.m add -type radiobutton -text "0"
-.gap.m add -type radiobutton -text "1"
-.gap.m add -type radiobutton -text "2"
-.gap.m add -type radiobutton -text "3"
-.gap.m add -type radiobutton -text "10"
-.gap.m item configure all -variable config(-gap) \
- -command { .ts configure -gap $config(-gap) }
-.gap.m select 0
-
-blt::tk::label .relief_l -text "-relief"
-blt::combobutton .relief -textvariable text(-relief) -menu .relief.m
-blt::combomenu .relief.m -textvariable text(-relief)
-.relief.m add -type radiobutton -text [.ts cget -relief]
-.relief.m add -type separator
-.relief.m add -type radiobutton -text "flat"
-.relief.m add -type radiobutton -text "sunken"
-.relief.m add -type radiobutton -text "raised"
-.relief.m add -type radiobutton -text "groove"
-.relief.m add -type radiobutton -text "ridge"
-.relief.m add -type radiobutton -text "solid"
-.relief.m item configure all -variable config(-relief) \
- -command { .ts configure -relief $config(-relief) }
-.relief.m select 0
-
-blt::tk::label .background_l -text "-background"
-blt::combobutton .background -textvariable text(-background) \
- -menu .background.m
-blt::combomenu .background.m -textvariable text(-background)
-.background.m add -type radiobutton -text [.ts cget -background]
-.background.m add -type separator
-.background.m add -type radiobutton -text "grey"
-.background.m add -type radiobutton -text "white"
-.background.m add -type radiobutton -text "black"
-.background.m add -type radiobutton -text "lightblue"
-.background.m item configure all -variable config(-background) \
- -command { .ts configure -background $config(-background) }
-.background.m select 0
-
-blt::tk::label .activebackground_l -text "-activebackground"
-blt::combobutton .activebackground -textvariable text(-activebackground) \
- -menu .activebackground.m
-blt::combomenu .activebackground.m -textvariable text(-activebackground)
-.activebackground.m add -type radiobutton -text [.ts cget -activebackground]
-.activebackground.m add -type separator
-.activebackground.m add -type radiobutton -text "grey"
-.activebackground.m add -type radiobutton -text "white"
-.activebackground.m add -type radiobutton -text "black"
-.activebackground.m add -type radiobutton -text "lightblue"
-.activebackground.m item configure all -variable config(-activebackground) \
- -command { .ts configure -activebackground $config(-activebackground) }
-.activebackground.m select 0
-
-blt::tk::label .activeforeground_l -text "-activeforeground"
-blt::combobutton .activeforeground -textvariable text(-activeforeground) \
- -menu .activeforeground.m
-blt::combomenu .activeforeground.m -textvariable text(-activeforeground)
-.activeforeground.m add -type radiobutton -text [.ts cget -activeforeground]
-.activeforeground.m add -type separator
-.activeforeground.m add -type radiobutton -text "grey"
-.activeforeground.m add -type radiobutton -text "white"
-.activeforeground.m add -type radiobutton -text "black"
-.activeforeground.m add -type radiobutton -text "lightblue"
-.activeforeground.m item configure all -variable config(-activeforeground) \
- -command { .ts configure -activeforeground $config(-activeforeground) }
-.activeforeground.m select 0
-
-blt::tk::label .selectbackground_l -text "-selectbackground"
-blt::combobutton .selectbackground -textvariable text(-selectbackground) \
- -menu .selectbackground.m
-blt::combomenu .selectbackground.m -textvariable text(-selectbackground)
-.selectbackground.m add -type radiobutton -text [.ts cget -selectbackground]
-.selectbackground.m add -type separator
-.selectbackground.m add -type radiobutton -text "grey"
-.selectbackground.m add -type radiobutton -text "white"
-.selectbackground.m add -type radiobutton -text "black"
-.selectbackground.m add -type radiobutton -text "lightblue"
-.selectbackground.m item configure all -variable config(-selectbackground) \
- -command { .ts configure -selectbackground $config(-selectbackground) }
-.selectbackground.m select 0
-
-blt::tk::label .troughcolor_l -text "-troughcolor"
-blt::combobutton .troughcolor -textvariable text(-troughcolor) \
- -menu .troughcolor.m
-blt::combomenu .troughcolor.m -textvariable text(-troughcolor)
-.troughcolor.m add -type radiobutton -text [.ts cget -troughcolor]
-.troughcolor.m add -type separator
-.troughcolor.m add -type radiobutton -text "grey"
-.troughcolor.m add -type radiobutton -text "white"
-.troughcolor.m add -type radiobutton -text "black"
-.troughcolor.m add -type radiobutton -text "lightblue"
-.troughcolor.m item configure all -variable config(-troughcolor) \
- -command { .ts configure -troughcolor $config(-troughcolor) }
-.troughcolor.m select 0
-
-blt::tk::label .foreground_l -text "-foreground"
-blt::combobutton .foreground -textvariable text(-foreground) \
- -menu .foreground.m
-blt::combomenu .foreground.m -textvariable text(-foreground)
-.foreground.m add -type radiobutton -text [.ts cget -foreground]
-.foreground.m add -type separator
-.foreground.m add -type radiobutton -text "grey"
-.foreground.m add -type radiobutton -text "white"
-.foreground.m add -type radiobutton -text "black"
-.foreground.m add -type radiobutton -text "lightblue"
-.foreground.m item configure all -variable config(-foreground) \
- -command { .ts configure -foreground $config(-foreground) }
-.foreground.m select 0
-
-blt::tk::label .outerborderwidth_l -text "-outerborderwidth"
-blt::combobutton .outerborderwidth -textvariable text(-outerborderwidth) \
- -menu .outerborderwidth.m
-blt::combomenu .outerborderwidth.m -textvariable text(-outerborderwidth)
-.outerborderwidth.m add -type radiobutton -text [.ts cget -outerborderwidth]
-.outerborderwidth.m add -type separator
-.outerborderwidth.m add -type radiobutton -text "0"
-.outerborderwidth.m add -type radiobutton -text "1"
-.outerborderwidth.m add -type radiobutton -text "2"
-.outerborderwidth.m add -type radiobutton -text "3"
-.outerborderwidth.m add -type radiobutton -text "10"
-.outerborderwidth.m item configure all -variable config(-outerborderwidth) \
- -command { .ts configure -outerborderwidth $config(-outerborderwidth) }
-.outerborderwidth.m select 0
-
-
-blt::tk::label .outerrelief_l -text "-outerrelief"
-blt::combobutton .outerrelief -textvariable text(-outerrelief) \
- -menu .outerrelief.m
-blt::combomenu .outerrelief.m -textvariable text(-outerrelief)
-.outerrelief.m add -type radiobutton -text [.ts cget -outerrelief]
-.outerrelief.m add -type separator
-.outerrelief.m add -type radiobutton -text "flat"
-.outerrelief.m add -type radiobutton -text "sunken"
-.outerrelief.m add -type radiobutton -text "raised"
-.outerrelief.m add -type radiobutton -text "groove"
-.outerrelief.m add -type radiobutton -text "ridge"
-.outerrelief.m add -type radiobutton -text "solid"
-.outerrelief.m item configure all -variable config(-outerrelief) \
- -command { .ts configure -outerrelief $config(-outerrelief) }
-.outerrelief.m select 0
-
-blt::tk::label .selectforeground_l -text "-selectforeground"
-blt::combobutton .selectforeground -textvariable text(-selectforeground) \
- -menu .selectforeground.m
-blt::combomenu .selectforeground.m -textvariable text(-selectforeground)
-.selectforeground.m add -type radiobutton -text [.ts cget -selectforeground]
-.selectforeground.m add -type separator
-.selectforeground.m add -type radiobutton -text "grey"
-.selectforeground.m add -type radiobutton -text "white"
-.selectforeground.m add -type radiobutton -text "black"
-.selectforeground.m add -type radiobutton -text "lightblue"
-.selectforeground.m item configure all -variable config(-selectforeground) \
- -command { .ts configure -selectforeground $config(-selectforeground) }
-.selectforeground.m select 0
-
-blt::tk::label .selectpadx_l -text "-selectpadx"
-blt::combobutton .selectpadx -textvariable text(-selectpadx) \
- -menu .selectpadx.m
-blt::combomenu .selectpadx.m -textvariable text(-selectpadx)
-.selectpadx.m add -type radiobutton -text [.ts cget -selectpadx]
-.selectpadx.m add -type separator
-.selectpadx.m add -type radiobutton -text "0"
-.selectpadx.m add -type radiobutton -text "1"
-.selectpadx.m add -type radiobutton -text "2"
-.selectpadx.m add -type radiobutton -text "3"
-.selectpadx.m add -type radiobutton -text "10"
-.selectpadx.m item configure all -variable config(-selectpadx) \
- -command { .ts configure -selectpadx $config(-selectpadx) }
-.selectpadx.m select 0
-
-blt::tk::label .selectpady_l -text "-selectpady"
-blt::combobutton .selectpady -textvariable text(-selectpady) \
- -menu .selectpady.m
-blt::combomenu .selectpady.m -textvariable text(-selectpady)
-.selectpady.m add -type radiobutton -text [.ts cget -selectpady]
-.selectpady.m add -type separator
-.selectpady.m add -type radiobutton -text "0"
-.selectpady.m add -type radiobutton -text "1"
-.selectpady.m add -type radiobutton -text "2"
-.selectpady.m add -type radiobutton -text "3"
-.selectpady.m add -type radiobutton -text "10"
-.selectpady.m item configure all -variable config(-selectpady) \
- -command { .ts configure -selectpady $config(-selectpady) }
-.selectpady.m select 0
-
-blt::table . \
- .ts 0,0 -fill both -rspan 25 \
- .activebackground_l 1,1 -anchor e \
- .activebackground 1,2 -fill x \
- .activeforeground_l 2,1 -anchor e \
- .activeforeground 2,2 -fill x \
- .background_l 3,1 -anchor e \
- .background 3,2 -fill x \
- .borderwidth_l 4,1 -anchor e \
- .borderwidth 4,2 -fill x \
- .gap_l 5,1 -anchor e \
- .gap 5,2 -fill x \
- .foreground_l 6,1 -anchor e \
- .foreground 6,2 -fill x \
- .highlightthickness_l 7,1 -anchor e \
- .highlightthickness 7,2 -fill x \
- .iconpos_l 8,1 -anchor e \
- .iconpos 8,2 -fill x \
- .justify_l 9,1 -anchor e \
- .justify 9,2 -fill x \
- .outerborderwidth_l 10,1 -anchor e \
- .outerborderwidth 10,2 -fill x \
- .outerpad_l 11,1 -anchor e \
- .outerpad 11,2 -fill x \
- .outerrelief_l 12,1 -anchor e \
- .outerrelief 12,2 -fill x \
- .relief_l 13,1 -anchor e \
- .relief 13,2 -fill x \
- .rotate_l 14,1 -anchor e \
- .rotate 14,2 -fill x \
- .scrolltabs_l 15,1 -anchor e \
- .scrolltabs 15,2 -fill x \
- .selectbackground_l 16,1 -anchor e \
- .selectbackground 16,2 -fill x \
- .selectforeground_l 17,1 -anchor e \
- .selectforeground 17,2 -fill x \
- .selectpadx_l 18,1 -anchor e \
- .selectpadx 18,2 -fill x \
- .selectpady_l 19,1 -anchor e \
- .selectpady 19,2 -fill x \
- .side_l 20,1 -anchor e \
- .side 20,2 -fill x \
- .closebutton_l 21,1 -anchor e \
- .closebutton 21,2 -fill x \
- .showsingletab_l 22,1 -anchor e \
- .showsingletab 22,2 -fill x \
- .slant_l 23,1 -anchor e \
- .slant 23,2 -fill x \
- .tabwidth_l 24,1 -anchor e \
- .tabwidth 24,2 -fill x \
- .tearoff_l 25,1 -anchor e \
- .tearoff 25,2 -fill x \
- .tiers_l 26,1 -anchor e \
- .tiers 26,2 -fill x \
- .troughcolor_l 27,1 -anchor e \
- .troughcolor 27,2 -fill x \
- .s 27,0 -fill x
-
-foreach option {
- borderwidth gap highlightthickness justify outerpad relief rotate
- side slant tabwidth tearoff tiers iconposition
-} {
- set $option [.ts cget -$option]
-}
-
-blt::table configure . r* c1 -resize none
-blt::table configure . r24 -resize expand
-focus .ts
-
-.ts focus 0
-
-if 1 {
-set filecount 0
-foreach file { graph1 graph2 graph3 graph5 barchart2 } {
- namespace eval $file {
- if { [string match graph* $file] } {
- set graph [blt::graph .ts.$file]
- } else {
- set graph [blt::barchart .ts.$file]
- }
- source scripts/$file.tcl
- .ts tab configure $filecount -window $graph -fill both
- incr filecount
- }
-}
-}
-
-
-.ts select 0
-.ts activate 0
-.ts focus 0
-after 5000 {
- .ts tab configure 0 -state disabled
-}
diff --git a/blt3.0.1/demos/tabset1.tcl b/blt3.0.1/demos/tabset1.tcl
deleted file mode 100755
index bf0215a..0000000
--- a/blt3.0.1/demos/tabset1.tcl
+++ /dev/null
@@ -1,63 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-option add *Tabset.Tab.padY 0
-#option add *Tabset.Tab.background green
-
-image create picture bgTile -file ./images/chalk.gif
-image create picture label1 -file ./images/mini-book1.gif
-image create picture label2 -file ./images/mini-book2.gif
-image create picture label3 -width 10 -height 10
-label3 blank white
-
-blt::tabset .t \
- -outerrelief raised \
- -tabwidth same \
- -outerborderwidth 0 \
- -highlightthickness 0 \
- -scrollcommand { .s set } \
- -closebutton yes \
- -width 3i
-
-.t add First \
- -image label1 \
- -anchor center \
- -selectbackground darkolivegreen2
-
-
-foreach page { Again Next another test of a widget } {
- .t add $page \
- -anchor center \
- -selectbackground darkolivegreen2 \
- -image label3
-}
-
-.t add -text Again -selectbackground lightblue
-
-set tabcount 0
-proc NewTab { args } {
- global tabcount
- set i [.t insert last "New Tab $tabcount"]
- .t select $i
- update
- .t focus $i
- .t see last
- incr tabcount
-}
-
-.t add "+" \
- -font "Arial 10" \
- -anchor center \
- -selectbackground yellow \
- -command NewTab
-
-
-blt::tk::scrollbar .s -command { .t view } -orient horizontal
-blt::table . \
- .t 0,0 -fill both \
- .s 1,0 -fill x
-
-blt::table configure . r1 -resize none
-focus .t
-
diff --git a/blt3.0.1/demos/tabset2.tcl b/blt3.0.1/demos/tabset2.tcl
deleted file mode 100755
index e4d74b0..0000000
--- a/blt3.0.1/demos/tabset2.tcl
+++ /dev/null
@@ -1,52 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-image create picture bgTile -file ./images/smblue_rock.gif
-image create picture label1 -file ./images/mini-book1.gif
-image create picture label2 -file page-zoom.png
-image create picture testImage -file ./images/txtrflag.gif
-blt::tk::scrollbar .s -command { .t view } -orient horizontal
-blt::tabset .t \
- -outerrelief flat \
- -font "Arial 8" \
- -outerborderwidth 2 \
- -textside right \
- -tabwidth same \
- -tiers 2 \
- -scrollcommand { .s set } \
- -scrollincrement 1 -selectforeground green2
-
-blt::tk::label .t.l -image testImage
-
-set attributes {
- graph1 "Graph \#1" red .t.graph1
- graph2 "Graph \#2" green .t.graph2
- graph3 "Graph \#3" cyan .t.graph3
- graph5 "Graph \#5" yellow .t.graph5
- graph6 one orange .t.l
-}
-
-foreach { entry label color window } $attributes {
- .t insert end $entry -text $label -fill both
-}
-
-foreach page { there bunky another test of a widget } {
- .t insert end $page -image label2
-}
-
-blt::table . \
- .t 0,0 -fill both \
- .s 1,0 -fill x
-
-blt::table configure . r1 -resize none
-
-foreach file { graph1 graph2 graph3 graph5 } {
- namespace eval $file {
- set graph [blt::graph .t.$file]
- source scripts/$file.tcl
- .t tab configure $file -window $graph
- }
-}
-
diff --git a/blt3.0.1/demos/tabset3.tcl b/blt3.0.1/demos/tabset3.tcl
deleted file mode 100755
index 1b63aeb..0000000
--- a/blt3.0.1/demos/tabset3.tcl
+++ /dev/null
@@ -1,180 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-#blt::bltdebug 100
-
-image create picture label1 -file ./images/mini-book1.gif
-image create picture label2 -file ./images/mini-book2.gif
-image create picture testImage -file ./images/txtrflag.gif
-
-blt::tabset .t \
- -textside right \
- -slant both \
- -side right \
- -tabwidth same \
- -highlightcolor yellow \
- -tiers 5 \
- -scrolltabs yes \
- -scrollcommand { .s set } \
- -scrollincrement 1
-
-label .t.l -image testImage
-
-set font [font create -family "Arial" -size 8 -weight bold]
-puts stderr [font configure $font]
-option add *Tabset.Tab.font $font
-#option add *Tabset.Tab.fill both
-
-set attributes {
- graph1 "Graph \#1" pink
- graph2 "Graph \#2" lightblue
- graph3 "Graph \#3" orange
- graph5 "Graph \#5" yellow
- barchart2 "Barchart \#2" green
-}
-
-foreach { name label color } $attributes {
- .t insert end $name -text $label \
- -selectbackground ${color}3 \
- -background ${color}3 \
- -activebackground ${color}2
-}
-
-.t insert end Image -selectbackground salmon2 -background salmon3 \
- -selectbackground salmon3 -activebackground salmon2 -window .t.l
-
-set tabLabels {
- Aarhus Aaron Ababa aback abaft abandon abandoned abandoning
- abandonment abandons abase abased abasement abasements abases
- abash abashed abashes abashing abasing abate abated abatement
- abatements abater abates abating Abba abbe abbey abbeys abbot
- abbots Abbott abbreviate abbreviated abbreviates abbreviating
- abbreviation abbreviations Abby abdomen abdomens abdominal
- abduct abducted abduction abductions abductor abductors abducts
- Abe abed Abel Abelian Abelson Aberdeen Abernathy aberrant
- aberration aberrations abet abets abetted abetter abetting
- abeyance abhor abhorred abhorrent abhorrer abhorring abhors
- abide abided abides abiding Abidjan Abigail Abilene abilities
- ability abject abjection abjections abjectly abjectness abjure
- abjured abjures abjuring ablate ablated ablates ablating
- ablation ablative ablaze able abler ablest ably Abner abnormal
- abnormalities abnormality abnormally Abo aboard abode abodes
- abolish abolished abolisher abolishers abolishes abolishing
- abolishment abolishments abolition abolitionist abolitionists
- abominable abominate aboriginal aborigine aborigines abort
- aborted aborting abortion abortions abortive abortively aborts
- Abos abound abounded abounding abounds about above aboveboard
- aboveground abovementioned abrade abraded abrades abrading
- Abraham Abram Abrams Abramson abrasion abrasions abrasive
- abreaction abreactions abreast abridge abridged abridges
- abridging abridgment abroad abrogate abrogated abrogates
- abrogating abrupt abruptly abruptness abscess abscessed
- abscesses abscissa abscissas abscond absconded absconding
- absconds absence absences absent absented absentee
- absenteeism absentees absentia absenting absently absentminded
- absents absinthe absolute absolutely absoluteness absolutes
- absolution absolve absolved absolves absolving absorb
- absorbed absorbency absorbent absorber absorbing absorbs
- absorption absorptions absorptive abstain abstained abstainer
- abstaining abstains abstention abstentions abstinence
- abstract abstracted abstracting abstraction abstractionism
- abstractionist abstractions abstractly abstractness
- abstractor abstractors abstracts abstruse abstruseness
- absurd absurdities absurdity absurdly Abu abundance abundant
- abundantly abuse abused abuses abusing abusive abut abutment
- abuts abutted abutter abutters abutting abysmal abysmally
- abyss abysses Abyssinia Abyssinian Abyssinians acacia
- academia academic academically academics academies academy
- Acadia Acapulco accede acceded accedes accelerate accelerated
- accelerates accelerating acceleration accelerations
- accelerator accelerators accelerometer accelerometers accent
- accented accenting accents accentual accentuate accentuated
- accentuates accentuating accentuation accept acceptability
- acceptable acceptably acceptance acceptances accepted
- accepter accepters accepting acceptor acceptors accepts
- access accessed accesses accessibility accessible accessibly
- accessing accession accessions accessories accessors
- accessory accident accidental accidentally accidently
- accidents acclaim acclaimed acclaiming acclaims acclamation
- acclimate acclimated acclimates acclimating acclimatization
- acclimatized accolade accolades accommodate accommodated
- accommodates accommodating accommodation accommodations
- accompanied accompanies accompaniment accompaniments
- accompanist accompanists accompany accompanying accomplice
- accomplices accomplish accomplished accomplisher accomplishers
- accomplishes accomplishing accomplishment accomplishments
- accord accordance accorded accorder accorders according
- accordingly accordion accordions accords accost accosted
- accosting accosts account accountability accountable accountably
- accountancy accountant accountants accounted accounting
- accounts Accra accredit accreditation accreditations
- accredited accretion accretions accrue accrued accrues
- accruing acculturate acculturated acculturates acculturating
- acculturation accumulate accumulated accumulates accumulating
- accumulation accumulations accumulator accumulators
- accuracies accuracy accurate accurately accurateness accursed
- accusal accusation accusations accusative accuse accused
- accuser accuses accusing accusingly accustom accustomed
- accustoming accustoms ace aces acetate acetone acetylene
- Achaean Achaeans ache ached aches achievable achieve achieved
- achievement achievements achiever achievers achieves achieving
- Achilles aching acid acidic acidities acidity acidly acids
- acidulous Ackerman Ackley acknowledge acknowledgeable
- acknowledged acknowledgement acknowledgements acknowledger
- acknowledgers acknowledges acknowledging acknowledgment
- acknowledgments acme acne acolyte acolytes acorn acorns
- acoustic acoustical acoustically acoustician acoustics
- acquaint acquaintance acquaintances acquainted acquainting
- acquaints acquiesce acquiesced acquiescence acquiescent
- acquiesces acquiescing acquirable acquire acquired acquires
- acquiring acquisition acquisitions
-}
-
-for { set i 0 } { $i < 500 } { incr i } {
- .t insert end [lindex $tabLabels $i] -state normal
-}
-
-blt::tk::scrollbar .s -command { .t view } -orient horizontal
-radiobutton .left -text "Left" -variable side -value "left" \
- -command { .t configure -side $side -rotate 90 }
-radiobutton .right -text "Right" -variable side -value "right" \
- -command { .t configure -side $side -rotate 270 }
-radiobutton .top -text "Top" -variable side -value "top" \
- -command { .t configure -side $side -rotate 0 }
-radiobutton .bottom -text "Bottom" -variable side -value "bottom" \
- -command { .t configure -side $side -rotate 0 }
-
-blt::table . \
- .t 0,0 -fill both -cspan 2 \
- .s 1,0 -fill x -cspan 2 \
- .top 2,0 -cspan 2 \
- .left 3,0 \
- .right 3,1 \
- .bottom 4,0 -cspan 2
-
-blt::table configure . r1 r3 r4 r2 -resize none
-focus .t
-
-.t focus 0
-
-if 0 {
-after 3000 {
- .t move 0 after 3
- .t tab configure 3 -state disabled
-}
-}
-foreach file { graph1 graph2 graph3 graph5 barchart2 } {
- namespace eval $file {
- if { [string match graph* $file] } {
- set graph [blt::graph .t.$file]
- } else {
- set graph [blt::barchart .t.$file]
- }
- source scripts/$file.tcl
- .t tab configure $file -window $graph -fill both
- }
-}
-
-.top invoke
-
diff --git a/blt3.0.1/demos/tabset4.tcl b/blt3.0.1/demos/tabset4.tcl
deleted file mode 100755
index 83b5333..0000000
--- a/blt3.0.1/demos/tabset4.tcl
+++ /dev/null
@@ -1,90 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-#blt::bltdebug 100
-
-source scripts/stipples.tcl
-
-blt::tabset .t \
- -tabwidth same \
- -side left \
- -textside bottom \
- -textside top \
- -tiers 1 \
- -scrollincrement 10 \
- -scrollcommand { .s set } \
- -rotate 0 \
- -selectcommand { MakePicture .t } \
--width 500 -height 500
-
-scrollbar .s -command { .t view } -orient horizontal
-
-option clear
-option add *Tabset.Tab.font -*-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
-
-set files [glob ./images/*.gif]
-set files [lsort $files]
-set vertFilter sinc
-set horzFilter sinc
-#set vertFilter none
-#set horzFilter none
-
-
-proc ResizePicture { src dest maxSize } {
- puts stderr "maxSize=$maxSize"
- set maxSize [winfo fpixels . $maxSize]
- set w [image width $src]
- set h [image height $src]
- puts stderr "width=$w, height=$h"
- set sw [expr double($maxSize) / $w]
- set sh [expr double($maxSize) / $h]
- puts stderr "sw=$sw,sh=$sh"
- set s [expr min($sw, $sh)]
- set w [expr round($s * $w)]
- set h [expr round($s * $h)]
- puts stderr "[$src configure]"
- $dest configure -width $w -height $h
-
- global horzFilter vertFilter
- $dest resample $src -filter $horzFilter
-}
-
-image create picture src
-image create picture dest
-
-label .t.label -image dest -width 500 -height 500
-
-proc MakePicture { w index } {
- set file [$w tab cget $index -text]
- src configure -file ./images/$file.gif
-
- set width [$w cget -pagewidth]
- set height [$w cget -pageheight]
- puts stderr "pagewidth=$width, pageheight=$height"
- if { $width < $height } {
- ResizePicture src dest $width
- } else {
- ResizePicture src dest $height
- }
- .t dockall
- .t tab configure $index -window .t.label -padx 4m -pady 4m -fill both
-}
-
-blt::table . \
- .t 0,0 -fill both \
- .s 1,0 -fill x
-
-blt::table configure . r1 -resize none
-focus .t
-
-foreach f $files {
- src configure -file $f
- set f [file tail [file root $f]]
- set thumb [image create picture]
- ResizePicture src $thumb .5i
- .t insert end $f -image $thumb -fill both
-}
-
-.t focus 0
-.t invoke 0
diff --git a/blt3.0.1/demos/tour.tcl b/blt3.0.1/demos/tour.tcl
deleted file mode 100755
index c1e5000..0000000
--- a/blt3.0.1/demos/tour.tcl
+++ /dev/null
@@ -1,141 +0,0 @@
-#!../src/bltwish
-
-#package require BLT
-source scripts/demo.tcl
-option add *Scrollbar.relief flat
-set oldLabel "dummy"
-
-proc RunDemo { program } {
- if { ![file executable $program] } {
- return
- }
- set cmd [list $program -name "demo:$program" -geom -4000-4000]
- global programInfo
- if { [info exists programInfo(lastProgram)] } {
- set programInfo($programInfo(lastProgram)) 0
- }
- eval bgexec programInfo($program) $cmd &
- set programInfo(lastProgram) $program
- puts stderr [.top.tab.f1 search -name demo:$program]
- .top.tab.f1 configure -name demo:$program
-}
-
-frame .top
-set tree [blt::tree create]
-blt::treeview .top.hier -separator "." -xscrollincrement 1 \
- -yscrollcommand { .top.yscroll set } -xscrollcommand { .top.xscroll set } \
- -separator . \
- -tree $tree \
- -selectcommand {
- set index [.top.hier curselection]
- if { $index != "" } {
- set label [.top.hier entry cget $index -label]
- .top.title configure -text $label
- .top.tab tab configure Example -window .top.tab.f1
- if { $label != $oldLabel } {
- RunDemo $label
- }
- }
- }
-
-
-blt::tk::scrollbar .top.yscroll -command { .top.hier yview }
-blt::tk::scrollbar .top.xscroll -command { .top.hier xview } -orient horizontal
-blt::tk::label .top.mesg -relief groove -borderwidth 2
-blt::tk::label .top.title -text "Synopsis" -highlightthickness 0
-blt::tabset .top.tab -side bottom -outerrelief flat -outerborderwidth 0 \
- -highlightthickness 0 -pageheight 4i
-
-foreach tab { "Example" "See Code" "Manual" } {
- .top.tab insert end $tab
-}
-
-set pics /DOS/f/gah/Pics
-set pics /home/gah/Pics
-image create picture dummy -file images/blt98.gif
-image create picture graph.img -width 50 -height 50
-graph.img resample dummy
-
-dummy configure -file images/blt98.gif
-image create picture barchart.img -width 50 -height 50
-barchart.img resample dummy
-
-.top.hier entry configure root -label "BLT"
-.top.hier insert end \
- "Plotting" \
- "Plotting.graph" \
- "Plotting.graph.graph" \
- "Plotting.graph.graph2" \
- "Plotting.graph.graph3" \
- "Plotting.graph.graph4" \
- "Plotting.graph.graph5" \
- "Plotting.graph.graph6" \
- "Plotting.barchart" \
- "Plotting.barchart.barchart1" \
- "Plotting.barchart.barchart2" \
- "Plotting.barchart.barchart3" \
- "Plotting.barchart.barchart4" \
- "Plotting.barchart.barchart5" \
- "Plotting.stripchart" \
- "Plotting.vector" \
- "Composition" \
- "Composition.htext" \
- "Composition.table" \
- "Composition.tabset" \
- "Composition.hierbox" \
- "Miscellaneous" \
- "Miscellaneous.busy" \
- "Miscellaneous.bgexec" \
- "Miscellaneous.watch" \
- "Miscellaneous.bltdebug"
-.top.hier open -r root
-.top.hier entry configure root -font *-helvetica*-bold-r-*-18-*
-puts stderr [$tree dump root]
-foreach item { "Plotting" "Composition" "Miscellaneous" } {
- set index [.top.hier index ".$item"]
- .top.hier entry configure $index -font *-helvetica*-bold-r-*-14-*
-}
-.top.hier entry configure [.top.hier index ".Plotting.graph"] \
- -font *-helvetica*-bold-r-*-14-* -label "X-Y Graph"
-.top.hier entry configure [.top.hier index ".Plotting.barchart"] \
- -font *-helvetica*-bold-r-*-14-* -label "Bar Chart"
-
-.top.hier entry configure [.top.hier index ".Plotting.stripchart"] \
- -font *-helvetica*-bold-r-*-14-* -label "X-Y Graph"
-.top.hier entry configure [.top.hier index ".Plotting.stripchart"] \
- -font *-helvetica*-bold-r-*-14-* -label "Strip Chart"
-
-.top.hier entry configure [.top.hier index ".Plotting.graph"] -icon graph.img
-.top.hier entry configure [.top.hier index ".Plotting.barchart"] \
- -icon barchart.img
-
-blt::table .top \
- 0,0 .top.hier -fill both -rspan 2 \
- 0,1 .top.yscroll -fill y -rspan 2 \
- 0,2 .top.mesg -padx 2 -pady { 8 2 } -fill both \
- 0,2 .top.title -anchor nw -padx { 8 8 } \
- 1,2 .top.tab -fill both -rspan 2 \
- 2,0 .top.xscroll -fill x
-
-blt::table configure .top c1 r2 -resize none
-blt::table configure .top c0 -width { 3i {} }
-blt::table configure .top c2 -width { 4i {} }
-blt::table . \
- .top -fill both
-
-proc DoExit { code } {
- global progStatus
- set progStatus 1
- exit $code
-}
-
-blt::container .top.tab.f1 -relief raised -bd 2 -takefocus 0
-.top.tab tab configure Example -window .top.tab.f1
-
-if 1 {
- set cmd "xterm -fn fixed -geom +4000+4000"
- eval blt::bgexec programInfo(xterm) $cmd &
- set programInfo(lastProgram) xterm
- .top.tab.f1 configure -command $cmd
-}
-wm protocol . WM_DELETE_WINDOW { destroy . }
diff --git a/blt3.0.1/demos/treeview1.tcl b/blt3.0.1/demos/treeview1.tcl
deleted file mode 100755
index 4aa5034..0000000
--- a/blt3.0.1/demos/treeview1.tcl
+++ /dev/null
@@ -1,183 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-proc SortColumn { column } {
- set old [.t sort cget -column]
- set decreasing 0
- if { "$old" == "$column" } {
- set decreasing [.t sort cget -decreasing]
- set decreasing [expr !$decreasing]
- }
- .t sort configure -decreasing $decreasing -column $column -mode integer
- if { ![.t cget -flat] } {
- .t configure -flat yes
- }
- .t sort auto yes
-
- blt::busy hold .t
- update
- blt::busy release .t
-}
-
-proc FormatSize { size } {
- set string ""
- while { $size > 0 } {
- set rem [expr $size % 1000]
- set size [expr $size / 1000]
- if { $size > 0 } {
- set rem [format "%03d" $rem]
- }
- if { $string != "" } {
- set string "$rem,$string"
- } else {
- set string "$rem"
- }
- }
- return $string
-}
-
-array set modes {
- 0 ---
- 1 --x
- 2 -w-
- 3 -wx
- 4 r--
- 5 r-x
- 6 rw-
- 7 rwx
-}
-
-proc FormatMode { mode } {
- global modes
-
- set mode [format %o [expr $mode & 07777]]
- set owner $modes([string index $mode 0])
- set group $modes([string index $mode 1])
- set world $modes([string index $mode 2])
-
- return "${owner}${group}${world}"
-}
-
-proc Find { tree parent dir } {
- global count
- set saved [pwd]
-
- cd $dir
- foreach f [glob -nocomplain *] {
- set name [file tail $f]
- if { [catch { file stat $f info }] != 0 } {
- set node [$tree insert $parent -label $name]
- } else {
- if 0 {
- if { $info(type) == "file" } {
- set info(type) [list @::blt::TreeView::openIcon $name]
- } else {
- set info(type) "@::blt::TreeView::openIcon "
- }
- }
- set info(mtime) [clock format $info(mtime) -format "%b %d, %Y"]
- set info(atime) [clock format $info(atime) -format "%b %d, %Y"]
- set info(ctime) [clock format $info(ctime) -format "%b %d, %Y"]
- set info(size) [FormatSize $info(size)]
- set info(mode) [FormatMode $info(mode)]
- set node [$tree insert $parent -label $name -data [array get info]]
- }
- incr count
- if { [file type $f] == "directory" } {
- Find $tree $node $f
- }
- }
- cd $saved
-}
-
-
-proc GetAbsolutePath { dir } {
- set saved [pwd]
- cd $dir
- set path [pwd]
- cd $saved
- return $path
-}
-
-button .b -font { Helvetica 11 bold }
-set top [GetAbsolutePath ..]
-set top [GetAbsolutePath "/home/gah/Azureus Downloads"]
-set trim "$top"
-
-set tree [blt::tree create]
-blt::tk::scrollbar .vs -orient vertical -command { .t yview }
-blt::tk::scrollbar .hs -orient horizontal -command { .t xview }
-
-blt::treeview .t \
- -width 0 \
- -yscrollcommand { .vs set } \
- -xscrollcommand { .hs set } \
- -selectmode multiple \
- -separator / \
- -tree $tree
-
-.t column configure treeView -text "" -edit yes
-#file
-.t column insert 0 mtime atime gid
-.t column insert end nlink mode type ctime uid ino size dev
-.t column configure uid -background \#eaeaff
-.t column configure mtime -hide no -bg \#ffeaea
-.t column configure size gid nlink uid ino dev -justify left -edit yes
-.t column configure size type -justify left -edit yes
-.t column configure treeView -hide no -edit yes \
- -icon ::blt::TreeView::openIcon
-focus .t
-
-
-blt::table . \
- 0,0 .t -fill both \
- 0,1 .vs -fill y \
- 1,0 .hs -fill x
-blt::table configure . c1 r1 -resize none
-
-set count 0
-Find $tree root $top
-puts "$count entries"
-
-if 0 {
-$tree find root -glob *.c -addtag "c_files"
-$tree find root -glob *.h -addtag "header_files"
-$tree find root -glob *.tcl -addtag "tcl_files"
-
-.t entry configure "c_files" -foreground green4
-.t entry configure "header_files" -foreground cyan4
-.t entry configure "tcl_files" -foreground red4
-}
-.t column bind all <ButtonRelease-3> {
- %W configure -flat no
-}
-
-foreach column [.t column names] {
- .t column configure $column -command [list SortColumn $column]
-}
-
-# Create a second treeview that shares the same tree.
-if 0 {
-toplevel .top
-blt::treeview .top.t2 -tree $tree -yscrollcommand { .top.sbar set }
-scrollbar .top.sbar -command { .top.t2 yview }
-pack .top.t2 -side left -expand yes -fill both
-pack .top.sbar -side right -fill y
-}
-
-#.t style configure text -background #F8fbF8 -selectbackground #D8fbD8
-
-.t style checkbox check \
- -onvalue 100 -offvalue "50" \
- -showvalue yes
-
-.t style combobox combo \
- -icon ::blt::TreeView::openIcon \
- -arrowrelief flat -arrowborderwidth 0
-
-.t column configure uid -style combo
-.t column configure gid -style check
-
-
diff --git a/blt3.0.1/demos/treeview2.tcl b/blt3.0.1/demos/treeview2.tcl
deleted file mode 100644
index 0a88ea1..0000000
--- a/blt3.0.1/demos/treeview2.tcl
+++ /dev/null
@@ -1,208 +0,0 @@
-#!../src/bltwish
-
-set count 0
-package require BLT
-#source scripts/demo.tcl
-
-proc SortColumn { column } {
- set old [.t sort cget -column]
- set decreasing 0
- if { "$old" == "$column" } {
- set decreasing [.t sort cget -decreasing]
- set decreasing [expr !$decreasing]
- }
- .t sort configure -decreasing $decreasing -column $column -mode integer
- if { ![.t cget -flat] } {
- .t configure -flat yes
- }
- .t sort auto yes
-
- blt::busy hold .t
- update
- blt::busy release .t
-}
-
-proc FormatSize { size } {
- set string ""
- while { $size > 0 } {
- set rem [expr $size % 1000]
- set size [expr $size / 1000]
- if { $size > 0 } {
- set rem [format "%03d" $rem]
- }
- if { $string != "" } {
- set string "$rem,$string"
- } else {
- set string "$rem"
- }
- }
- return $string
-}
-
-array set modes {
- 0 ---
- 1 --x
- 2 -w-
- 3 -wx
- 4 r--
- 5 r-x
- 6 rw-
- 7 rwx
-}
-
-proc FormatMode { mode } {
- global modes
-
- set mode [format %o [expr $mode & 07777]]
- set owner $modes([string index $mode 0])
- set group $modes([string index $mode 1])
- set world $modes([string index $mode 2])
-
- return "${owner}${group}${world}"
-}
-
-proc Find { tree parent dir } {
- global count
- set saved [pwd]
-
- cd $dir
- foreach f [lsort [glob -nocomplain *]] {
- set name [file tail $f]
-
- if { [catch { file lstat $f info }] != 0 } {
- if { ![$tree exists $parent->"$name"] } {
- set node [$tree insert $parent -label $name]
- }
- } else {
- if 0 {
- if { $info(type) == "file" } {
- set info(type) [list @blt::TreeView::openIcon $name]
- } else {
- set info(type) "@blt::TreeView::openIcon "
- }
- }
- set info(mtime) [clock format $info(mtime) -format "%b %d, %Y"]
- set info(atime) [clock format $info(atime) -format "%b %d, %Y"]
- set info(ctime) [clock format $info(ctime) -format "%b %d, %Y"]
- set info(owner) [file attributes $name -owner]
- set info(group) [file attributes $name -group]
- set info(size) [FormatSize $info(size)]
- set info(mode) [file attributes $name -permissions]
- if { ![$tree exists $parent->"$name"] } {
- set node [$tree insert $parent -label $name \
- -data [array get info]]
- } else {
- set node [$tree findchild $parent $name]
- puts "already found $f"
- }
- }
- incr count
- if { [file type $f] == "directory" } {
- .t entry configure $node -button yes
- }
- }
- cd $saved
-}
-
-proc GetAbsolutePath { dir } {
- set saved [pwd]
- cd $dir
- set path [pwd]
- cd $saved
- return $path
-}
-
-set top [GetAbsolutePath .]
-set trim "$top"
-
-set tree [blt::tree create]
-scrollbar .vs -orient vertical -command { .t yview }
-scrollbar .hs -orient horizontal -command { .t xview }
-
-proc OpenNode { tree node parent top } {
- if { [file type $parent] == "directory" } {
- blt::busy hold .t
- Find $tree $node $top/$parent
- update
- blt::busy release .t
- }
-}
-
-proc CloseNode { tree node } {
- eval $tree delete [$tree children $nodex]
-}
-
-
-blt::treeview .t \
- -width 0 \
- -yscrollcommand { .vs set } \
- -xscrollcommand { .hs set } \
- -selectmode multiple \
- -separator / \
- -tree $tree \
- -opencommand [list OpenNode $tree %\# %P $top] \
- -closecommand [list CloseNode $tree %\#]
-
-set img [image create picture -data {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM1WBrM+rAEMigJ8c3Kb3OSII6kGABhp1JnaK1VGwjwKwtvHqNzzd263M3H4n2OH1QBwGw6
- nQkAOw==
-}]
-
-update
-.t column configure treeView -text ""
-#file
-.t column insert 0 mtime atime ctime
-.t column insert end nlink mode type owner group ino size dev
-.t column configure owner
-.t column configure mtime -hide no
-.t column configure size group nlink owner ino dev -justify left -edit yes
-.t column configure size type -justify left -edit yes
-.t column configure treeView -hide no -edit no -icon $img
-focus .t
-
-
-blt::table . \
- 0,0 .t -fill both \
- 0,1 .vs -fill y \
- 1,0 .hs -fill x
-blt::table configure . c1 r1 -resize none
-
-puts "$count entries"
-
-#$tree find root -glob *.c -addtag "c_files"
-#$tree find root -glob *.h -addtag "header_files"
-#$tree find root -glob *.tcl -addtag "tcl_files"
-
-#.t entry configure "c_files" -foreground green4
-#.t entry configure "header_files" -foreground cyan4
-#.t entry configure "tcl_files" -foreground red4
-
-.t column bind all <ButtonRelease-3> {
- %W configure -flat no
-}
-
-foreach column [.t column names] {
- .t column configure $column -command [list SortColumn $column]
-}
-
-# Create a second treeview that shares the same tree.
-if 0 {
-toplevel .top
-blt::treeview .top.t2 -tree $tree -yscrollcommand { .top.sbar set }
-scrollbar .top.sbar -command { .top.t2 yview }
-pack .top.t2 -side left -expand yes -fill both
-pack .top.sbar -side right -fill y
-}
-
-#.t style configure text -background #F8fbF8 -selectbackground #D8fbD8
-
-.t style checkbox check \
- -onvalue 30 -offvalue "50" \
- -showvalue yes
-
-.t style combobox combo -icon $img
-
-#.t column configure owner -style combo
-#.t column configure group -style check
-
diff --git a/blt3.0.1/demos/treeview3.tcl b/blt3.0.1/demos/treeview3.tcl
deleted file mode 100644
index 2713cf6..0000000
--- a/blt3.0.1/demos/treeview3.tcl
+++ /dev/null
@@ -1,66 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-#source scripts/demo.tcl
-
-set saved [pwd]
-
-#blt::bltdebug 100
-
-blt::treeview .tv \
- -yscrollcommand { .vs set } \
- -xscrollcommand { .hs set }
-scrollbar .vs -orient vertical -command { .tv yview }
-scrollbar .hs -orient horizontal -command { .tv xview }
-blt::table . \
- 0,0 .tv -fill both \
- 0,1 .vs -fill y \
- 1,0 .hs -fill x
-
-blt::table configure . c1 r1 -resize none
-
-proc DoFind { entry } {
- global fileList
- lappend fileList $entry
- #puts "$entry"
- if { [file type $entry] == "directory" } {
- foreach f [lsort [glob -nocomplain $entry/*]] {
- DoFind $f
- }
- }
-}
-
-proc Find { dir } {
- global fileList
- set fileList {}
- DoFind $dir
- return $fileList
-}
-proc GetAbsolutePath { dir } {
- set saved [pwd]
- cd $dir
- set path [pwd]
- cd $saved
- return $path
-}
-
-set top [GetAbsolutePath .]
-set trim "$top"
-
-.tv configure -separator "/" -autocreate yes -trim $trim
-
-.tv entry configure root -label "$top"
-.tv configure -bg white -alternatebackground grey95
-set fileList [Find $top]
-eval .tv insert end $fileList
-
-#.tv insert 0 fred
-focus .tv
-
-set nodes [.tv find -glob -name *.tcl]
-set img [image create picture -file ~/lines.gif]
-eval .tv entry configure $nodes -foreground red -icons $img
-set img [image create picture -file ~/cartoon.png]
-.tv entry configure 1 -icon $img
-cd $saved
-
diff --git a/blt3.0.1/demos/tv1.tcl b/blt3.0.1/demos/tv1.tcl
deleted file mode 100644
index ad9df85..0000000
--- a/blt3.0.1/demos/tv1.tcl
+++ /dev/null
@@ -1,32 +0,0 @@
-package require BLT
-package require Tk
-set paned [panedwindow .panedwindow]
-
-set a [frame $paned.a -bg red]
-set tree [::blt::treeview $a.tree\
- -relief flat\
- -selectmode single\
- -exportselection false]
-$tree configure -yscrollcommand "$a.y set" -xscrollcommand "$a.x set"
-scrollbar $a.y -command "$tree yview"
-scrollbar $a.x -command "$tree xview" -orient horizontal
-grid $tree -row 0 -column 1 -sticky nsew
-grid $a.y -row 0 -column 2 -sticky ns
-grid $a.x -row 1 -column 1 -sticky we
-grid columnconfigure $a 1 -weight 1
-grid rowconfigure $a 0 -weight 1
-$tree column configure treeView -width 0
-$tree insert end hola -label hola
-pack $paned -fill both -expand true
-
-$tree configure -width 0
-set m [frame $paned.m -bg yellow]
-$paned add $a
-$paned add $m
-
-update
-::update idletasks
-$paned sash place 0 180 1
-puts [$tree configure -width]
-puts [winfo geometry $tree]
-puts [$paned configure]
diff --git a/blt3.0.1/demos/tv2.tcl b/blt3.0.1/demos/tv2.tcl
deleted file mode 100644
index 62f481d..0000000
--- a/blt3.0.1/demos/tv2.tcl
+++ /dev/null
@@ -1,24 +0,0 @@
-package require BLT
-package require Tk
-
-set a [frame .a -bg red]
-set tree [::blt::treeview $a.tree\
- -bg blue \
- -relief flat -bd 10 \
- -selectmode single\
- -exportselection false]
-$tree configure -yscrollcommand "$a.y set" -xscrollcommand "$a.x set"
-scrollbar $a.y -command "$tree yview"
-scrollbar $a.x -command "$tree xview" -orient horizontal
-grid $tree -row 0 -column 1 -sticky nsew
-grid $a.y -row 0 -column 2 -sticky ns
-grid $a.x -row 1 -column 1 -sticky we
-grid columnconfigure $a 1 -weight 1
-grid rowconfigure $a 0 -weight 1
-
-$tree configure -width 0
-$tree column configure treeView -width 0
-$tree insert end hello -label hello
-#$tree insert end a -label aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-
- pack $a -fill both -expand true
diff --git a/blt3.0.1/demos/tv3.tcl b/blt3.0.1/demos/tv3.tcl
deleted file mode 100644
index cf4dabb..0000000
--- a/blt3.0.1/demos/tv3.tcl
+++ /dev/null
@@ -1,31 +0,0 @@
-package require BLT
-package require Tk
-
-set a [frame .a -bg red]
-set tree [::blt::treeview $a.tree\
- -relief flat\
- -selectmode single\
- -exportselection false]
-$tree configure -yscrollcommand "$a.y set" -xscrollcommand "$a.x set"
-scrollbar $a.y -command "$tree yview"
-scrollbar $a.x -command "$tree xview" -orient horizontal
-grid $tree -row 0 -column 1 -sticky nsew
-grid $a.y -row 0 -column 2 -sticky ns
-grid $a.x -row 1 -column 1 -sticky we
-grid columnconfigure $a 1 -weight 1
-grid rowconfigure $a 0 -weight 1
-
-$tree configure -width 0
-$tree column configure treeView -width 0
-$tree insert end hola -label hola
-
-
-pack $a
-
-bind $tree Configure " puts \[winfo geometry $tree\] "
-puts [$tree configure -width]
-puts [winfo geometry $tree]
-update
-::update idletasks
-puts [$tree configure -width]
-puts [winfo geometry $tree]
diff --git a/blt3.0.1/demos/usmap.tcl b/blt3.0.1/demos/usmap.tcl
deleted file mode 100644
index 369914a..0000000
--- a/blt3.0.1/demos/usmap.tcl
+++ /dev/null
@@ -1,71 +0,0 @@
-# -------------------------------------------------------------------------
-# DATA: US Map
-# -------------------------------------------------------------------------
-# COURSE: Effective Tcl/Tk Programming
-# AUTHOR: Michael J. McLennan
-# =========================================================================
-# Copyright (c) 1997-1999 Cadence Design Systems, Inc.
-# =========================================================================
-
-#
-# Coordinates for each map region
-# -------------------------------------------------------------------------
-set us_regions(WV.60) {217.03 79.0715 220.0 85.2274 220.16 85.2624 220.16 85.2624 224.995 86.9429 229.995 82.059 235.0 76.154 235.0 76.1131 235.0 76.1015 239.965 73.289 241.405 72.7755 241.405 72.7755 241.4 72.7697 240.0 70.815 234.995 71.8186 232.615 69.9747 230.0 69.9747 227.405 63.5562 227.405 63.5446 225.0 71.0484 220.0 74.8353 217.035 79.0773 217.03 79.0715 }
-set us_regions(NV.35) {30.005 54.0568 30.0 59.0925 30.0 59.2675 30.0 69.0586 29.995 75.0278 34.995 79.9001 39.995 84.9123 44.995 90.0938 49.995 95.4387 54.995 100.947 56.825 103.007 56.835 103.012 59.745 89.026 59.79 54.0627 59.76 54.0627 54.995 54.0393 49.995 54.0277 44.995 54.0277 44.87 54.016 40.03 54.0277 35.15 54.0627 30.05 54.0452 30.005 54.0568 }
-set us_regions(IA.20) {176.795 50.4567 176.815 50.4216 175.0 49.0037 173.91 43.5072 170.02 43.5072 165.055 43.5188 160.045 43.513 155.03 43.5072 150.01 43.513 147.765 43.5072 147.735 43.513 147.785 50.5909 150.0 57.2369 150.01 57.482 150.0 57.7154 151.175 63.918 151.17 63.9238 151.18 63.9238 155.04 63.988 160.065 63.9997 165.07 63.9122 170.005 63.7896 172.905 65.3709 175.0 61.6657 175.01 59.8802 175.0 58.0188 176.785 50.4742 176.795 50.4567 }
-set us_regions(IA.21) {176.675 51.8687 176.675 51.8512 176.675 51.7812 176.675 51.8512 176.675 51.8687 }
-set us_regions(PA.49) {227.4 51.7228 227.405 63.5446 227.405 63.5562 230.0 69.9747 232.615 69.9747 232.625 69.9747 235.0 69.9631 240.0 69.9631 245.0 69.9806 250.0 69.9689 251.06 69.9689 252.925 69.4087 254.99 67.8274 255.0 65.1492 254.995 60.5104 256.525 58.5148 256.525 58.5148 255.0 57.4645 250.03 54.0218 245.0 54.0102 240.0 54.0218 235.0 54.0218 231.185 50.515 231.19 50.4041 230.0 51.0402 227.5 51.7053 227.4 51.7228 }
-set us_regions(IN.19) {205.97 56.1458 205.0 55.6965 200.005 55.6965 195.33 55.6906 194.375 55.6848 193.96 55.6906 193.895 55.6906 190.0 81.2713 190.015 81.4172 190.0 81.6564 189.86 83.4302 190.0 83.4361 194.985 82.5667 199.99 82.0298 204.99 76.6091 205.87 74.2926 205.9 74.281 205.97 56.1458 }
-set us_regions(KS.22) {156.91 89.0377 155.02 71.8828 155.0 70.284 155.01 68.726 153.46 68.0258 153.46 68.02 150.02 68.0142 145.035 68.0083 140.01 68.0025 135.0 68.0025 130.035 68.0083 125.0 68.0025 120.025 67.9967 119.815 67.9967 119.74 67.9967 119.79 89.0727 119.86 89.0727 120.04 89.0727 125.01 89.0377 130.01 89.0143 135.03 89.0318 140.015 89.0377 145.03 89.0318 150.02 89.0318 155.02 89.0318 156.91 89.0377 }
-set us_regions(ND.45) {143.825 4.99617 143.815 4.99617 143.81 4.99617 143.645 4.99617 143.535 4.99617 143.205 4.99617 143.05 4.99617 142.945 4.99617 142.875 4.99617 142.85 4.99617 142.75 4.99617 142.685 4.99617 142.215 4.99617 142.195 4.99617 141.89 4.99617 141.875 4.99617 141.805 4.99617 141.75 4.99617 141.69 4.99617 141.595 4.99617 141.57 4.99617 141.56 4.99617 141.5 4.99617 141.28 4.99617 141.25 4.99617 141.045 4.99617 140.985 4.99617 140.925 4.99617 140.905 4.99617 140.895 4.99617 14 [...]
-set us_regions(DC.13) {244.4 75.483 244.805 76.4808 244.82 76.4691 245.0 76.2707 244.995 75.2729 244.4 75.483 }
-set us_regions(UT.56) {59.79 54.0627 59.745 89.026 59.995 89.0202 64.995 89.026 69.995 89.0202 74.995 89.0085 79.995 89.0377 84.775 89.0318 84.775 89.0318 84.75 61.0122 80.0 61.0355 75.02 61.0355 74.765 54.016 74.765 54.0043 74.755 54.0043 70.0 54.0277 64.995 54.0277 59.995 54.0685 59.79 54.0627 }
-set us_regions(OR.48) {9.77 31.3237 9.745 31.3645 9.765 31.8955 9.765 31.8955 9.75 32.0122 9.72 32.1348 9.52 32.7007 9.545 32.9458 9.55 32.9458 9.56 33.01 9.56 33.0392 9.555 33.045 9.55 33.0917 9.55 33.1442 9.545 33.1734 9.545 33.1792 9.545 33.2317 9.535 33.2901 9.505 33.4185 9.505 33.5176 9.45 33.7977 9.43 33.8969 9.37 33.9961 9.365 33.9961 9.3 34.1303 9.295 34.3462 9.265 34.5621 9.29 35.0639 9.25 35.3965 9.3 35.5015 9.305 35.5366 9.275 35.5891 9.29 35.8808 9.3 36.0034 9.2 36.3476 9.175 [...]
-set us_regions(ID.17) {45.42 26.043 45.425 26.0488 45.0 34.7197 45.01 38.2965 44.995 40.9631 44.87 54.016 44.995 54.0277 49.995 54.0277 54.995 54.0393 59.76 54.0627 59.79 54.0627 59.995 54.0685 64.995 54.0277 70.0 54.0277 74.755 54.0043 74.765 54.0043 74.755 36.6919 70.025 36.2601 65.015 36.8786 60.0 28.1319 55.0 19.2336 50.0 12.43 49.755 5.002 49.755 4.99617 49.755 4.99617 49.695 4.99617 49.68 4.99617 49.235 4.99617 49.105 4.99617 49.095 4.99617 49.09 4.99617 48.935 4.99617 48.83 4.9961 [...]
-set us_regions(TX.55) {126.135 143.863 126.66 144.453 126.755 145.077 126.77 145.135 127.22 146.244 127.26 146.262 127.46 146.857 127.465 147.008 127.455 147.067 127.44 147.102 127.445 147.172 127.495 147.394 128.21 148.794 128.85 150.393 128.94 150.667 128.94 150.667 130.0 151.98 130.025 152.044 130.31 152.353 130.625 153.316 130.625 153.392 130.625 153.468 131.34 154.25 131.365 154.296 131.87 154.547 132.055 154.67 132.315 154.874 132.335 154.944 132.43 155.055 132.44 155.067 132.445 1 [...]
-set us_regions(WY.62) {84.75 61.0122 84.995 61.0122 89.995 61.0063 94.995 60.9947 99.995 61.0355 104.995 61.0297 109.735 61.0063 109.735 61.0063 109.735 47.0082 109.71 33.0275 109.7 33.0275 104.995 33.01 99.995 33.0567 94.995 33.0333 89.995 33.0042 84.995 33.01 79.995 32.9867 74.995 32.9983 74.755 36.6919 74.765 54.0043 74.765 54.016 75.02 61.0355 80.0 61.0355 84.75 61.0122 }
-set us_regions(MA.28) {271.005 53.9577 274.555 57.9955 274.74 58.1005 274.855 58.3923 274.87 58.4156 275.005 58.5381 275.52 58.4273 275.53 59.2208 276.755 58.9407 276.98 58.9232 277.535 59.0574 277.62 59.1275 280.005 59.6993 279.97 57.978 278.83 58.3339 277.55 57.7737 277.485 57.5112 277.485 57.5112 278.13 57.0969 279.53 56.7585 279.61 56.7293 279.66 56.7701 279.975 57.6162 280.02 53.5959 278.615 53.2166 278.385 53.1933 278.13 53.1641 276.88 52.9132 276.815 52.8198 276.62 52.2655 276.705 [...]
-set us_regions(RI.50) {274.555 57.9955 271.005 53.9577 270.465 58.8882 271.045 59.7285 271.355 59.0749 271.74 58.9291 271.875 58.8766 272.125 58.7715 272.455 58.8649 274.555 57.9955 }
-set us_regions(CT.11) {270.465 58.8882 271.005 53.9577 270.0 53.8293 265.0 53.7476 262.585 53.6659 262.565 53.6659 262.56 53.8059 265.0 60.4053 270.005 58.9466 270.465 58.8882 }
-set us_regions(OH.46) {227.405 63.5446 227.4 51.7228 227.35 51.7345 224.98 52.248 224.95 52.2538 224.465 52.353 224.045 52.4347 223.545 52.6448 222.525 53.3391 222.235 53.5492 221.875 53.8059 221.875 53.8001 221.67 53.946 221.57 54.016 221.455 54.016 221.06 54.2727 220.145 54.8737 220.0 54.9671 218.75 55.7957 218.335 56.0641 218.26 56.1166 216.37 56.1283 216.25 56.0466 215.97 55.854 215.965 55.854 215.84 55.7665 215.84 55.7665 215.02 55.2122 214.665 54.9788 214.665 54.9729 214.44 54.3019 [...]
-set us_regions(TN.54) {181.335 96.0222 180.005 99.103 178.45 103.03 178.455 103.059 179.99 103.065 185.0 103.065 189.0 103.059 189.0 103.059 190.0 102.989 195.0 103.065 199.965 103.106 201.945 103.135 201.975 103.135 201.98 103.135 205.0 103.118 208.39 103.112 210.0 100.054 214.995 97.6151 219.985 94.8727 221.61 91.9085 221.61 91.9085 221.61 91.9085 219.97 91.8676 214.975 91.8676 211.625 91.821 211.62 91.8326 209.975 91.8968 204.875 91.6926 199.985 91.6226 194.975 91.5175 190.0 91.2958 1 [...]
-set us_regions(CO.10) {114.99 89.026 115.0 89.026 119.775 89.0727 119.79 89.0727 119.74 67.9967 119.74 67.9208 115.0 61.0005 109.995 61.0063 109.735 61.0063 109.735 61.0063 104.995 61.0297 99.995 61.0355 94.995 60.9947 89.995 61.0063 84.995 61.0122 84.75 61.0122 84.775 89.0318 84.775 89.0318 85.195 89.0318 90.015 89.026 95.07 89.026 100.015 89.0552 105.495 89.0727 110.015 89.0552 114.99 89.026 }
-set us_regions(VA.58) {220.16 85.2624 220.0 85.4141 215.0 90.0413 211.625 91.821 211.625 91.821 214.975 91.8676 219.97 91.8676 221.61 91.9085 221.61 91.9085 221.655 91.9085 225.0 92.0835 230.0 92.2294 235.0 92.2294 240.0 92.2177 245.0 92.2177 250.015 92.1711 251.01 92.1711 250.9 91.6518 250.75 91.1908 250.685 91.0157 250.65 90.8874 250.625 90.8173 250.615 90.7473 250.605 90.7065 250.605 90.7006 250.495 90.1347 250.475 90.0296 250.455 89.9246 250.43 89.8021 250.365 89.4695 250.455 89.0902 [...]
-set us_regions(MS.31) {174.17 117.005 175.0 120.459 175.005 120.658 175.0 120.891 175.0 121.352 175.0 121.533 175.0 122.7 175.0 131.044 180.0 131.026 184.52 136.879 184.625 136.961 184.755 136.867 184.93 136.867 184.97 136.896 185.0 136.902 185.0 136.902 185.0 136.914 185.335 136.914 185.5 136.85 186.025 136.64 186.59 136.774 186.655 136.791 186.765 136.803 186.91 136.826 187.765 137.013 188.08 136.931 189.0 103.059 189.0 103.059 185.0 103.065 179.99 103.065 178.455 103.059 175.01 110.27 [...]
-set us_regions(NY.41) {235.345 48.0643 235.215 48.1868 235.015 48.3736 235.0 48.3852 234.78 48.5019 234.77 48.5019 233.44 49.208 233.31 49.278 233.17 49.348 232.94 49.4705 232.52 49.6923 232.34 49.7856 231.685 50.1357 231.19 50.4041 231.185 50.515 235.0 54.0218 240.0 54.0218 245.0 54.0102 250.03 54.0218 255.0 57.4645 256.525 58.5148 259.98 60.7204 260.0 62.5818 259.79 64.4548 260.28 64.3615 260.565 64.5832 260.585 64.5482 261.155 64.2798 261.47 64.2798 261.49 64.2798 261.86 64.2798 262.1 [...]
-set us_regions(IL.18) {184.335 89.1485 185.0 87.4564 189.85 83.4361 189.86 83.4302 190.0 81.6564 190.015 81.4172 190.0 81.2713 193.895 55.6906 193.96 55.6906 194.9 50.5617 194.375 50.5617 189.995 50.55 185.0 50.5442 180.0 50.4683 176.795 50.4567 176.785 50.4742 175.0 58.0188 175.01 59.8802 175.0 61.6657 172.905 65.3709 172.89 65.3884 175.0 72.0345 180.015 82.2807 184.335 89.1485 }
-set us_regions(MN.30) {173.91 43.5072 170.03 37.4096 169.99 21.0132 175.0 17.9557 180.0 16.9521 180.215 16.9696 182.585 11.9106 182.555 11.9048 182.5 11.9106 182.16 12.004 182.14 12.0215 182.085 12.0273 182.07 12.004 182.07 12.004 182.07 12.004 182.07 11.9982 182.06 11.9923 182.025 11.9748 182.01 11.969 181.985 11.969 181.97 11.9632 181.965 11.9573 181.955 11.9457 181.91 11.9281 181.885 11.9223 181.88 11.9281 181.875 11.9281 181.875 11.9281 181.875 11.9223 181.83 11.9398 181.81 11.9457 1 [...]
-set us_regions(MI.29) {193.96 55.6906 194.375 55.6848 195.33 55.6906 200.005 55.6965 205.0 55.6965 205.97 56.1458 209.91 55.9999 214.375 54.3603 214.44 54.3019 214.375 54.1094 214.345 54.016 214.34 53.9927 214.315 53.9226 214.31 53.9168 214.29 53.8468 214.28 53.8176 214.265 53.7709 214.255 53.7243 214.275 53.6367 214.275 53.6309 214.325 53.4267 214.33 53.3975 214.335 53.3858 214.335 53.38 214.355 53.3041 214.36 53.2808 214.36 53.275 214.365 53.2575 214.375 53.2108 214.38 53.1874 214.385 [...]
-set us_regions(MD.27) {232.615 69.9747 234.995 71.8186 240.0 70.815 241.4 72.7697 241.405 72.7755 244.4 75.483 244.995 75.2729 245.0 76.2707 244.82 76.4691 244.805 76.4808 244.805 76.4866 245.0 80.0693 250.0 82.3508 254.17 81.8314 254.375 81.3646 254.44 81.1488 254.71 80.2735 255.0 79.4216 255.0 79.3983 255.0 79.3399 255.07 78.8614 255.035 78.8614 254.755 78.8614 251.06 69.9689 250.0 69.9689 245.0 69.9806 240.0 69.9631 235.0 69.9631 232.625 69.9747 232.615 69.9747 }
-set us_regions(NE.34) {153.46 68.02 151.17 63.9238 151.175 63.918 150.0 57.7154 150.01 57.482 150.0 57.2369 147.785 50.5909 145.01 48.6945 140.03 48.6595 135.045 47.0257 130.185 47.0257 125.16 47.0257 120.025 47.0198 115.06 47.0082 110.04 47.0023 109.75 47.0082 109.735 47.0082 109.735 61.0063 109.995 61.0063 115.0 61.0005 119.74 67.9208 119.74 67.9967 119.815 67.9967 120.025 67.9967 125.0 68.0025 130.035 68.0083 135.0 68.0025 140.01 68.0025 145.035 68.0083 150.02 68.0142 153.46 68.02 }
-set us_regions(NJ.37) {259.42 70.6458 259.9 68.8953 259.96 68.4635 260.0 68.1834 260.02 68.0959 260.175 67.3373 260.195 67.1448 260.56 64.6299 260.565 64.5832 260.28 64.3615 259.79 64.4548 260.0 62.5818 259.98 60.7204 256.525 58.5148 256.525 58.5148 254.995 60.5104 255.0 65.1492 254.99 67.8274 252.925 69.4087 254.925 76.5041 255.0 76.4049 255.0 76.4049 255.445 75.8972 255.435 75.8972 256.25 75.3429 256.415 75.022 256.4 75.022 256.875 74.0184 256.875 74.0184 257.08 73.7091 257.085 73.7091 [...]
-set us_regions(SC.52) {228.115 121.912 228.125 121.883 228.125 121.638 228.31 121.41 228.315 121.369 228.315 121.369 228.43 121.299 228.43 121.299 228.43 121.299 228.47 121.253 228.695 121.008 228.825 120.698 228.88 120.658 229.075 120.588 229.26 120.576 229.4 120.535 229.66 120.162 230.0 120.15 230.3 119.916 230.61 119.66 230.625 119.648 230.825 119.461 231.1 119.199 231.25 118.837 231.36 118.785 231.705 118.516 231.875 118.3 231.92 118.283 232.355 117.909 232.8 117.326 233.125 117.407 [...]
-set us_regions(AR.2) {174.17 117.005 174.17 117.005 175.03 111.619 175.0 111.438 175.01 110.277 178.455 103.059 178.45 103.03 180.005 99.103 181.335 96.0222 180.02 96.0338 175.015 92.5387 170.015 92.5387 165.01 92.5445 160.005 92.5328 156.91 92.5328 156.91 92.5328 157.57 112.57 159.785 116.9 160.0 116.9 165.0 116.911 170.0 116.981 174.15 117.005 174.17 117.005 }
-set us_regions(OK.47) {114.99 89.026 114.99 92.527 115.0 92.527 115.085 92.527 120.035 92.527 125.025 92.5328 130.0 106.111 135.0 108.503 140.0 110.05 145.0 110.942 150.01 111.076 150.0 110.989 150.005 110.925 155.005 111.001 157.57 112.57 156.91 92.5328 156.91 89.0377 155.02 89.0318 150.02 89.0318 145.03 89.0318 140.015 89.0377 135.03 89.0318 130.01 89.0143 125.01 89.0377 120.04 89.0727 119.86 89.0727 119.79 89.0727 119.775 89.0727 115.0 89.026 114.99 89.026 }
-set us_regions(KY.23) {189.86 83.4302 189.85 83.4361 185.0 87.4564 184.335 89.1485 182.915 92.5328 185.0 92.5095 190.0 91.2958 194.975 91.5175 199.985 91.6226 204.875 91.6926 209.975 91.8968 211.62 91.8326 211.625 91.821 211.625 91.821 215.0 90.0413 220.0 85.4141 220.16 85.2624 220.16 85.2624 220.0 85.2274 217.03 79.0715 217.02 79.054 214.98 76.9125 209.99 76.5566 205.9 74.281 205.87 74.2926 204.99 76.6091 199.99 82.0298 194.985 82.5667 190.0 83.4361 189.86 83.4302 }
-set us_regions(KY.24) {182.305 92.5387 182.575 92.5445 182.305 92.5387 }
-set us_regions(AZ.1) {84.75 128.71 84.775 89.0318 84.775 89.0318 79.995 89.0377 74.995 89.0085 69.995 89.0202 64.995 89.026 59.995 89.0202 59.745 89.026 56.835 103.012 56.4 119.0 56.355 119.094 56.35 119.135 56.295 119.245 56.265 119.35 56.26 119.386 56.245 119.415 56.235 119.426 56.18 119.531 56.1 119.607 56.09 119.654 56.09 119.66 55.995 119.852 56.0 119.911 56.04 120.068 56.025 120.179 55.98 120.418 55.93 120.576 56.05 120.623 56.09 120.64 56.11 120.652 56.225 120.698 56.325 120.739 5 [...]
-set us_regions(NH.36) {267.705 48.9279 269.965 49.0154 274.98 47.9709 276.265 47.8893 276.325 47.8893 276.325 47.8893 276.525 47.3174 277.125 47.5917 275.0 39.5802 274.59 30.9911 274.58 30.8744 273.97 31.2362 273.27 31.1078 273.185 31.1486 273.1 31.3295 273.035 31.3412 272.94 31.3529 272.87 31.3762 272.785 31.3645 272.84 31.4054 272.96 31.6796 272.95 31.6971 272.825 31.9889 272.86 32.0939 272.66 32.4207 272.605 32.4207 272.52 32.5257 272.51 32.5432 272.49 32.9166 272.5 32.9166 269.995 37 [...]
-set us_regions(NM.40) {97.355 125.547 99.995 124.018 104.995 124.03 110.0 124.036 114.88 92.5212 114.99 92.527 114.99 89.026 110.015 89.0552 105.495 89.0727 100.015 89.0552 95.07 89.026 90.015 89.026 85.195 89.0318 84.775 89.0318 84.775 89.0318 84.75 128.71 84.82 128.71 84.86 128.71 84.995 128.71 85.015 128.71 85.565 128.71 85.695 128.71 85.745 128.71 85.89 128.71 86.205 128.71 86.22 128.71 86.405 128.704 86.715 128.704 86.825 128.704 86.91 128.704 87.31 128.704 87.35 128.704 87.35 128.7 [...]
-set us_regions(LA.25) {184.625 136.961 184.52 136.879 180.0 131.026 175.0 131.044 175.0 122.7 175.0 121.533 175.0 121.352 175.0 120.891 175.005 120.658 175.0 120.459 174.17 117.005 174.15 117.005 170.0 116.981 165.0 116.911 160.0 116.9 159.785 116.9 160.0 124.31 160.895 140.666 160.93 140.864 161.14 140.666 161.25 140.281 161.875 140.111 162.835 140.006 163.07 140.036 163.125 140.094 163.305 140.17 163.415 140.135 163.88 139.954 163.925 139.966 164.32 140.076 164.375 140.1 164.63 140.216 [...]
-set us_regions(VT.57) {269.21 32.9692 269.14 32.9692 269.095 32.9692 269.02 32.9692 268.945 32.975 268.765 32.975 268.725 32.9808 268.715 32.9808 268.71 32.9808 268.625 32.9808 268.62 32.9808 268.58 32.9808 268.355 32.975 268.165 32.9692 268.125 32.9633 268.03 32.9633 267.995 32.9633 267.94 32.9575 267.92 32.9575 267.91 32.9575 267.835 32.9517 267.785 32.9517 267.755 32.9517 267.48 32.9517 267.23 32.9517 267.105 32.9341 267.09 32.9283 267.075 32.9283 267.065 32.9283 267.06 32.9283 267.05 [...]
-set us_regions(CA.3) {24.25 99.424 24.34 99.529 24.37 99.5698 24.705 99.9725 24.715 99.99 24.85 100.124 24.89 100.142 24.995 100.159 25.035 100.153 25.08 100.177 25.345 100.381 25.355 100.463 25.36 100.503 25.37 100.55 25.36 100.696 25.295 100.883 25.235 101.034 25.2 101.192 25.195 101.279 25.62 101.91 26.135 102.254 26.245 102.266 26.405 102.26 26.41 102.266 26.46 102.295 26.49 102.312 26.525 102.324 26.55 102.336 26.555 102.394 26.53 102.791 26.52 102.855 26.485 103.03 26.44 103.228 26 [...]
-set us_regions(FL.14) {218.41 161.077 218.375 161.234 218.51 161.613 218.535 161.672 218.59 161.818 218.64 162.069 218.725 162.296 218.75 162.43 218.75 162.436 218.755 162.459 218.77 162.547 218.855 162.769 219.02 162.903 219.135 162.985 219.375 163.346 219.44 163.405 219.48 163.422 219.48 163.422 219.505 163.434 219.59 163.446 219.6 163.446 219.81 163.37 219.92 163.306 219.96 163.282 220.11 163.247 220.165 163.288 220.29 163.422 220.305 163.44 220.395 163.568 220.47 163.737 220.57 164.0 [...]
-set us_regions(MT.33) {60.2 5.00784 60.025 5.00784 59.995 5.00784 59.75 5.00784 59.71 5.00784 59.66 5.00784 59.485 5.00784 59.36 5.00784 58.895 5.002 58.885 5.002 58.875 5.002 58.87 5.002 58.635 4.99617 58.45 4.99617 58.45 4.99617 58.45 4.99617 58.18 4.99033 57.965 4.99617 57.96 4.99617 57.88 4.99617 57.805 4.99617 57.705 4.99617 57.62 4.99617 57.61 4.99617 57.51 4.99617 57.395 4.99617 57.31 4.99617 57.29 4.99617 57.255 4.99617 57.205 4.99617 57.16 4.99617 56.935 4.99617 56.84 4.99617 56 [...]
-set us_regions(CA.4) {14.995 84.533 14.995 84.5447 15.035 84.5389 15.31 84.0546 14.995 83.6228 14.37 83.2727 14.23 83.3777 14.13 83.5936 14.37 84.0079 14.995 84.533 }
-set us_regions(FL.15) {215.17 175.956 215.21 175.979 215.595 176.014 215.625 176.026 215.89 175.915 215.89 175.915 215.89 175.915 216.01 175.822 216.0 175.81 215.97 175.752 215.585 174.999 215.49 175.04 215.385 175.186 215.335 175.256 215.065 175.67 215.065 175.676 215.085 175.833 215.17 175.956 215.17 175.956 }
-set us_regions(CA.5) {33.52 110.032 32.66 109.589 30.655 109.157 30.26 109.157 30.04 109.577 28.735 109.624 28.3 109.157 28.505 110.254 28.745 110.674 29.0 110.907 29.92 110.907 29.995 110.837 30.475 110.458 32.54 110.149 33.52 110.032 }
-set us_regions(MO.32) {153.46 68.02 153.46 68.0258 155.01 68.726 155.0 70.284 155.02 71.8828 156.91 89.0377 156.91 92.5328 156.91 92.5328 160.005 92.5328 165.01 92.5445 170.015 92.5387 175.015 92.5387 180.02 96.0338 181.335 96.0222 182.305 92.5387 182.575 92.5445 182.915 92.5328 184.335 89.1485 180.015 82.2807 175.0 72.0345 172.89 65.3884 172.905 65.3709 170.005 63.7896 165.07 63.9122 160.065 63.9997 155.04 63.988 151.18 63.9238 151.17 63.9238 153.46 68.02 }
-set us_regions(NC.44) {251.01 92.1711 250.015 92.1711 245.0 92.2177 240.0 92.2177 235.0 92.2294 230.0 92.2294 225.0 92.0835 221.655 91.9085 221.61 91.9085 221.61 91.9085 219.985 94.8727 214.995 97.6151 210.0 100.054 208.39 103.112 209.975 103.118 214.395 103.024 214.455 103.024 214.985 102.826 219.995 101.711 225.0 102.546 229.995 104.372 235.0 108.357 237.5 111.339 237.505 111.345 238.125 111.088 238.16 111.076 238.835 110.995 239.935 111.403 240.0 111.66 240.285 111.753 240.51 111.537 [...]
-set us_regions(ME.26) {279.085 43.513 279.38 43.2504 280.555 42.5794 281.065 42.4043 281.66 42.0484 283.83 41.5933 284.72 40.9981 284.95 41.4241 285.005 41.4708 285.005 41.4708 286.285 40.4088 286.395 40.2804 287.59 39.8136 288.01 39.6619 289.145 38.6816 289.36 38.1623 289.395 38.1506 289.44 38.139 290.005 38.0514 290.17 37.8706 290.23 37.7597 290.565 37.7772 290.685 37.7947 290.88 37.7247 291.025 37.3863 291.03 37.2112 291.125 37.1353 291.25 37.252 291.255 37.252 291.285 37.2695 291.725 [...]
-set us_regions(CA.6) {37.76 113.533 36.87 114.128 36.87 114.134 37.255 114.408 37.25 114.408 37.495 115.044 38.12 115.213 38.28 115.284 38.295 115.284 38.455 115.284 38.45 115.284 38.745 115.062 38.745 115.068 38.745 114.572 37.76 113.533 }
-set us_regions(CA.7) {37.815 118.785 37.9 118.785 38.35 117.909 38.355 117.909 38.12 117.676 37.595 117.034 37.6 117.034 37.495 116.818 36.87 116.433 36.65 117.034 36.775 117.034 36.87 117.402 36.98 117.699 37.815 118.785 }
-set us_regions(CA.8) {33.12 115.178 32.885 114.963 32.855 114.933 32.85 114.928 31.87 114.898 31.87 115.394 32.495 115.861 33.12 115.686 33.12 115.19 33.12 115.178 }
-set us_regions(AL.0) {204.99 131.032 204.99 131.026 205.0 130.98 205.0 130.933 205.0 122.752 205.0 121.784 205.0 121.591 204.995 120.477 201.975 103.135 201.945 103.135 199.965 103.106 195.0 103.065 190.0 102.989 189.0 103.059 188.08 136.931 189.19 136.64 189.695 137.031 189.815 137.013 190.0 136.82 190.0 136.82 190.095 136.803 190.095 136.803 190.945 136.797 191.015 136.785 191.28 136.727 191.53 136.675 191.7 136.651 191.875 136.599 192.41 136.435 194.98 131.044 199.97 131.085 204.99 13 [...]
-set us_regions(CA.9) {34.995 113.282 34.995 113.282 35.01 113.294 34.995 114.105 34.995 113.282 }
-set us_regions(WA.59) {35.685 5.002 35.62 4.99617 35.545 5.002 35.485 5.002 35.225 5.002 34.995 5.002 34.97 5.002 34.905 5.002 34.895 5.002 34.535 5.002 34.34 5.002 34.315 5.002 34.1 5.002 34.095 5.002 34.075 5.002 33.845 5.002 33.74 5.002 33.66 5.002 33.575 5.002 33.565 5.002 33.56 5.002 33.485 5.002 33.02 5.002 32.865 5.002 32.855 5.002 32.815 5.002 32.785 5.002 32.71 5.002 32.69 5.002 32.655 5.002 32.635 5.002 32.495 5.002 32.455 5.002 32.445 5.002 32.415 5.002 32.355 5.002 32.34 5.00 [...]
-set us_regions(SD.53) {109.775 26.3931 109.71 33.0275 109.735 47.0082 109.75 47.0082 110.04 47.0023 115.06 47.0082 120.025 47.0198 125.16 47.0257 130.185 47.0257 135.045 47.0257 140.03 48.6595 145.01 48.6945 147.785 50.5909 147.735 43.513 147.185 26.4631 145.005 26.4573 140.005 26.4573 135.025 26.4281 130.07 26.4165 125.095 26.3989 120.005 26.3989 115.02 26.3931 110.05 26.3931 109.83 26.3931 109.775 26.3931 }
-set us_regions(DE.12) {252.925 69.4087 251.06 69.9689 254.755 78.8614 255.035 78.8614 255.07 78.8614 255.07 78.7564 255.075 78.6222 255.08 78.523 255.08 78.523 255.06 78.1554 255.03 77.7236 255.015 77.6478 255.0 77.6186 254.95 77.0059 254.935 76.615 254.925 76.5041 252.925 69.4087 }
-set us_regions(GA.16) {223.1 132.718 223.125 132.316 223.47 131.102 223.435 131.038 223.435 131.038 223.415 131.015 223.275 130.624 223.57 130.32 223.555 130.163 223.555 130.163 223.555 130.157 223.75 129.912 223.75 129.912 223.975 129.492 224.07 129.287 224.08 128.978 224.105 128.692 224.14 128.412 224.055 128.231 224.375 127.689 224.47 127.537 224.47 127.537 224.5 127.409 224.52 127.391 224.525 127.391 224.67 126.662 224.74 126.102 225.0 125.827 225.015 125.798 225.015 125.787 225.29 1 [...]
-set us_regions(WI.61) {180.215 16.9696 180.0 16.9521 175.0 17.9557 169.99 21.0132 170.03 37.4096 173.91 43.5072 175.0 49.0037 176.815 50.4216 176.795 50.4567 180.0 50.4683 185.0 50.5442 189.995 50.55 194.375 50.5617 194.9 50.5617 194.9 50.5558 195.005 38.915 195.0 29.8999 190.0 27.4492 185.0 25.302 180.0 23.814 180.215 16.9696 }
-
diff --git a/blt3.0.1/demos/winop1.tcl b/blt3.0.1/demos/winop1.tcl
deleted file mode 100755
index df97b08..0000000
--- a/blt3.0.1/demos/winop1.tcl
+++ /dev/null
@@ -1,57 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-#set imgfile ./images/sample.gif
-set imgfile ./images/blt98.gif
-set imgfile ~/dstrange.xpm
-set imgfile ~/8.jpg
-set imgfile ~/250px-KittyPryde+Wolverine4.jpg
-set imgfile ~/thunderbird.png
-set imgfile ~/testfile.png
-if { [llength $argv] > 0 } {
- set imgfile [lindex $argv 0]
-}
-if { [ file exists $imgfile] } {
- set src [image create picture -file $imgfile]
-} else {
- puts stderr "no image file"
- exit 0
-}
-set name [file root [file tail $imgfile]]
-set width [image width $src]
-set height [image height $src]
-
-option add *Label.font *helvetica*10*
-option add *Label.background white
-label .l0 -image $src
-label .header0 -text "$width x $height"
-label .footer0 -text "100%"
-. configure -bg white
-#$src quantize $src 150
-set type gif
-set i 0
-foreach scale { 0.8 0.6666666 0.5 0.4 0.3333333 0.3 0.25 0.2 0.15 0.1 } {
- incr i
- set iw [expr int($width * $scale)]
- set ih [expr int($height * $scale)]
- set r [format %6g [expr 100.0 * $scale]]
- image create picture r$i -width $iw -height $ih
- #puts stderr before=[r$i info]
- r$i resize $src -filter sinc
- #puts stderr after=[r$i info]
- r$i export $type -file ${name}-${scale}.$type
-#triangle
-#box
- label .header$i -text "$iw x $ih"
- label .footer$i -text "$r%"
- label .l$i -image r$i
- blt::table . \
- 0,$i .header$i \
- 1,$i .l$i \
- 2,$i .footer$i
- update
-}
-
-
diff --git a/blt3.0.1/demos/winop2.tcl b/blt3.0.1/demos/winop2.tcl
deleted file mode 100755
index 348725d..0000000
--- a/blt3.0.1/demos/winop2.tcl
+++ /dev/null
@@ -1,30 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-set file images/qv100.t.gif
-
-if { [file exists $file] } {
- set photo [image create picture -file $file]
-} else {
- puts stderr "no image file"
- exit 0
-}
-
-option add *Label.font *helvetica*10*
-option add *Label.background lightsteelblue
-
-set i 0
-foreach r { -45 0 45 90 135 180 225 270 315 360 -315 } {
- set dest [image create picture -rotate $r -image $photo]
- label .footer$i -text "$r degrees"
- label .l$i -image $dest
- blt::table . \
- 0,$i .l$i \
- 1,$i .footer$i
- update
- incr i
-}
-
-
diff --git a/blt3.0.1/demos/winop3.tcl b/blt3.0.1/demos/winop3.tcl
deleted file mode 100755
index 7a175bf..0000000
--- a/blt3.0.1/demos/winop3.tcl
+++ /dev/null
@@ -1,74 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-#set imgfile ./images/sample.gif
-set imgfile ./images/blt98.gif
-if { [llength $argv] > 0 } {
- set imgfile [lindex $argv 0]
-}
-if { [ file exists $imgfile] } {
- set src [image create picture -file $imgfile]
-} else {
- puts stderr "no image file"
- exit 0
-}
-set name [file root [file tail $imgfile]]
-set width [image width $src]
-set height [image height $src]
-set filter sinc
-
-option add *Label.font *helvetica*10*
-option add *Label.background white
-label .l0 -image $src
-label .header0 -text "$width x $height"
-label .footer0 -text "100%"
-. configure -bg white
-set iw $width
-set ih $height
-set dest [image create picture -width $iw -height $ih]
-$dest resize $src -filter $filter
-label .header -text "$iw x $ih"
-label .footer -text "$filter"
-label .l1 -image $dest
-set filters {
- "bell"
- "bessel"
- "box"
- "bspline"
- "catrom"
- "default"
- "dummy"
- "gauss8"
- "gaussian"
- "gi"
- "lanczos3"
- "mitchell"
- "none"
- "sinc"
- "tent"
- "triangle"
-}
-
-proc Doit { filter } {
- global dest src
- set time [time {$dest resize $src -filter $filter}]
- .footer configure -text $time
-}
-
-set i 0
-frame .f
-foreach f $filters {
- radiobutton .f.$f -variable filter -value $f -text $f \
- -command "Doit $f"
- blt::table .f $i,0 .f.$f -anchor w
- incr i
-}
-blt::table . \
- 0,0 .f -rspan 3 \
- 0,1 .header \
- 1,1 .l0 1,2 .l1 \
- 2,1 .footer
-
-
diff --git a/blt3.0.1/demos/winop4.tcl b/blt3.0.1/demos/winop4.tcl
deleted file mode 100644
index 0b81f71..0000000
--- a/blt3.0.1/demos/winop4.tcl
+++ /dev/null
@@ -1,86 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-set filter sinc
-set shadow 8
-#set imgfile ./images/sample.gif
-set imgfile ./images/blt98.gif
-#set imgfile ~/.icons/cd-player.xpm
-if { [llength $argv] > 0 } {
- set imgfile [lindex $argv 0]
-}
-if { [ file exists $imgfile] } {
- set src [image create picture -file $imgfile]
-} else {
- puts stderr "no image file"
- exit 0
-}
-set name [file root [file tail $imgfile]]
-set width [image width $src]
-set height [image height $src]
-set bg [image create picture \
- -width [expr $width + $shadow] \
- -height [expr $height + $shadow]]
-$bg blank white
-$bg draw rectangle 4 4 [expr $width - 4] [expr $height - 4] -thickness 0 -color grey60
-puts stderr "blur=[time {$bg blur $bg 8}]"
-#puts stderr "resample=[time {$bg resize $bg -filter gi8}]"
-#$bg copy $src
-set src $bg
-#$src blur $src 8
-option add *Label.font *helvetica*10*
-option add *Label.background white
-
-label .l0 -image $src
-label .header0 -text "$width x $height"
-label .footer0 -text "100%"
-. configure -bg white
-set iw $width
-set ih $height
-set dest [image create picture -width $iw -height $ih]
-$dest resize $src -filter $filter
-label .header -text "$iw x $ih"
-label .footer -text "$filter"
-label .l1 -image $dest
-set filters {
- "bell"
- "bessel"
- "box"
- "bspline"
- "catrom"
- "default"
- "dummy"
- "gauss8"
- "gaussian"
- "gi"
- "lanczos3"
- "mitchell"
- "none"
- "sinc"
- "tent"
- "triangle"
-}
-
-proc Doit { filter } {
- global dest src
- set time [time {$dest resize $src -filter $filter}]
- .footer configure -text $time
-}
-
-set i 0
-frame .f
-foreach f $filters {
- radiobutton .f.$f -variable filter -value $f -text $f \
- -command "Doit $f"
- blt::table .f $i,0 .f.$f -anchor w
- incr i
-}
-blt::table . \
- 0,0 .f -rspan 3 \
- 0,1 .header \
- 1,1 .l0 1,2 .l1 \
- 2,1 .footer
-
-
diff --git a/blt3.0.1/demos/winop5.tcl b/blt3.0.1/demos/winop5.tcl
deleted file mode 100644
index d8df6f8..0000000
--- a/blt3.0.1/demos/winop5.tcl
+++ /dev/null
@@ -1,81 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-set filter sinc
-set shadow 8
-#set imgfile ./images/sample.gif
-set imgfile ./images/blt98.gif
-#set imgfile ~/.icons/cd-player.xpm
-if { [llength $argv] > 0 } {
- set imgfile [lindex $argv 0]
-}
-if { [ file exists $imgfile] } {
- set src [image create picture -file $imgfile]
-} else {
- puts stderr "no image file"
- exit 0
-}
-set xoff 5
-set yoff 5
-set name [file root [file tail $imgfile]]
-set width 500
-set height 500
-set bg [image create picture -width $width -height $height]
-set bg2 [image create picture -width $width -height $height]
-set r 200
-set cx [expr $width / 2]
-set cy [expr $height / 2]
-set x [expr $cx + $xoff]
-set y [expr $cy + $yoff]
-#$bg draw circle $x $y $r -color blue -thickness 0
-set layer1 [image create picture -width $width -height $height]
-$layer1 blank 0x00000000
-$layer1 draw circle $x $y $r -color 0xFFFFFFFF -thickness 0
-$layer1 blur $layer1 10
-set layer2 [image create picture -width $width -height $height]
-set layer3 [image create picture -width $width -height $height]
-$layer2 select $layer1 0x01000000 0xFFFFFFFF
-$layer2 and 0xFF000000
-$layer2 and $layer1
-$layer3 copy $layer1
-$layer3 select $layer1 0x01000000 0xFFFFFFFF
-#$layer3 and 0x00FFFF00
-$bg2 gradient -low green2 -high green4 -jitter yes -log no
-puts bg2=[$bg2 get 200 200]
-#$bg2 and 0x00FFFFFF
-puts bg2=[$bg2 get 200 200]
-puts layer1=[$layer1 get 200 200]
-$layer1 and $bg2
-puts and=[$layer1 get 200 200]
-$bg gradient -low blue1 -high blue4 -jitter yes -log no
-#$layer1 or 0xFF000000
-#$layer1 blend $bg $layer1
-#-matte $layer3
-
-#$layer1 min $bg
-$bg blend $bg $layer2
-#-matte $layer1
-
-set src $layer1
-set src $bg
-set dest $layer1
-
-option add *Label.font *helvetica*10*
-option add *Label.background white
-
-label .l0 -image $src
-label .header0 -text "$width x $height"
-label .footer0 -text "100%"
-. configure -bg white
-set iw $width
-set ih $height
-label .header -text "$iw x $ih"
-label .footer -text "$filter"
-label .l1 -image $dest
-
-blt::table . \
- 0,1 .header \
- 1,1 .l0 1,2 .l1 \
- 2,1 .footer
diff --git a/blt3.0.1/demos/winop6.tcl b/blt3.0.1/demos/winop6.tcl
deleted file mode 100644
index dda19ce..0000000
--- a/blt3.0.1/demos/winop6.tcl
+++ /dev/null
@@ -1,40 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-
-set shadow 8
-set xoff 5
-set yoff 5
-set width 500
-set height 500
-set r 200
-set cx [expr $width / 2]
-set cy [expr $height / 2]
-set x [expr $cx + $xoff]
-set y [expr $cy + $yoff]
-
-set l1 [image create picture -width $width -height $height]
-set l2 [image create picture -width $width -height $height]
-set bg [image create picture -file images/blt98.gif -width 200 -height 200 -aspect no]
-$bg and 0x00FFFFFF
-$l1 blank 0x00000000
-$l1 draw rectangle 8 8 200 200 -color 0xFFFFFFFF -thickness 0
-$l1 blur $l1 8
-$l2 select $l1 0x01000000 0xFFFFFFFF
-$l1 and 0xFF000000 -mask $l2
-$l1 or $bg -mask $l2
-$l1 sub 0x0F000000 -mask $l2
-set bg [image create picture -width $width -height $height]
-$bg gradient -high yellow -low black -jitter yes -log no
-$bg blend $bg $l1
-
-option add *Label.font *helvetica*10*
-option add *Label.background white
-
-label .l0 -image $l1
-label .l1 -image $l2
-label .l3 -image $bg
-. configure -bg white
-
-blt::table . \
- 1,1 .l0 1,2 .l1 1,3 .l3
diff --git a/blt3.0.1/demos/winop7.tcl b/blt3.0.1/demos/winop7.tcl
deleted file mode 100644
index dad57ba..0000000
--- a/blt3.0.1/demos/winop7.tcl
+++ /dev/null
@@ -1,28 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-
-set imgfile ~/rc_logo_sm.gif
-
-set im1 [image create picture -width 50 -height 50]
-$im1 blank 0x00000000
-set x 6
-set y 30
-$im1 draw text $x $y \
- -text "048" \
- -font "arial 14 bold" \
- -color 0xFF000000
-$im1 blur $im1 2
-set im2 [image create picture]
-$im2 select $im1 0x01000000 0xFFFFFFFF
-$im1 and 0xFF000000 -mask $im2
-set im [image create picture -file $imgfile -width 50 -height 50 -filter sinc]
-$im blend $im $im1
-incr x -1
-incr y -1
-$im draw text $x $y \
- -text "048" \
- -font "arial 14 bold" \
- -color white
-label .show -image $im
-pack .show
diff --git a/blt3.0.1/demos/winop9.tcl b/blt3.0.1/demos/winop9.tcl
deleted file mode 100644
index c6b4ad4..0000000
--- a/blt3.0.1/demos/winop9.tcl
+++ /dev/null
@@ -1,19 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-source scripts/demo.tcl
-
-# -fontfile /usr/share/fonts/100dpi/helvR18.pcf.gz
-set img [image create picture -width 500 -height 500]
-$img draw rectangle 100 100 111 111 -color blue
-$img draw text "This is a test\nzxcVAbnm<//gqy" 100 100 \
- -rotate 0 \
- -kerning 1 \
- -font { "arial" 24 bold } \
- -color 0x7FFFFFFF
-
-label .l -image $img
-blt::table . \
- 0,0 .l
-
-
diff --git a/blt3.0.1/examples/calendar.tcl b/blt3.0.1/examples/calendar.tcl
deleted file mode 100755
index d680df7..0000000
--- a/blt3.0.1/examples/calendar.tcl
+++ /dev/null
@@ -1,141 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-
-# --------------------------------------------------------------------------
-# Starting with Tcl 8.x, the BLT commands are stored in their own
-# namespace called "blt". The idea is to prevent name clashes with
-# Tcl commands and variables from other packages, such as a "table"
-# command in two different packages.
-#
-# You can access the BLT commands in a couple of ways. You can prefix
-# all the BLT commands with the namespace qualifier "blt::"
-#
-# blt::graph .g
-# blt::table . .g -resize both
-#
-# or you can import all the command into the global namespace.
-#
-# namespace import blt::*
-# graph .g
-# table . .g -resize both
-#
-# --------------------------------------------------------------------------
-
-if { $tcl_version >= 8.0 } {
- namespace import blt::*
- namespace import -force blt::tile::*
-}
-
-#source scripts/demo.tcl
-
-set file ../demos/images/chalk.gif
-set active ../demos/images/rain.gif
-
-image create photo calendar.texture.1 -file $file
-image create photo calendar.texture.2 -file $active
-
-option add *Tile calendar.texture.1
-
-option add *HighlightThickness 0
-option add *calendar.weekframe*Tile calendar.texture.2
-option add *Calendar.Label.borderWidth 0
-option add *Calendar.Label.relief sunken
-option add *Calendar.Frame.borderWidth 2
-option add *Calendar.Frame.relief raised
-option add *Calendar.Label.font { Helvetica 11 }
-option add *Calendar.Label.foreground navyblue
-option add *button.foreground navyblue
-option add *background grey85
-#option add *button.activeForeground red
-#option add *button.activeBackground blue4
-option add *Label.ipadX 200
-
-array set monthInfo {
- Jan { January 31 }
- Feb { February 28 }
- Mar { March 31 }
- Apr { April 30 }
- May { May 31 }
- Jun { June 30 }
- Jul { July 31 }
- Aug { August 31 }
- Sep { September 30 }
- Oct { October 31 }
- Nov { November 30 }
- Dec { December 31 }
-}
-
-option add *tile calendar.texture.2
-set abbrDays { Sun Mon Tue Wed Thu Fri Sat }
-
-proc Calendar { weekday day month year } {
- global monthInfo abbrDays
-
- set wkdayOffset [lsearch $abbrDays $weekday]
- if { $wkdayOffset < 0 } {
- error "Invalid week day \"$weekday\""
- }
- set dayOffset [expr ($day-1)%7]
- if { $wkdayOffset < $dayOffset } {
- set wkdayOffset [expr $wkdayOffset+7]
- }
- set wkday [expr $wkdayOffset-$dayOffset-1]
- if { [info commands .calendar] == ".calendar" } {
- destroy .calendar
- }
- frame .calendar -class Calendar -width 3i -height 3i
-
- if ![info exists monthInfo($month)] {
- error "Invalid month \"$month\""
- }
-
- set info $monthInfo($month)
- label .calendar.month \
- -text "[lindex $info 0] $year" \
- -font { Courier 14 bold }
- table .calendar .calendar.month 1,0 -cspan 7 -pady 10
-
- set cnt 0
- frame .calendar.weekframe -relief sunken -bd 1
- table .calendar .calendar.weekframe 2,0 -columnspan 7 -fill both
- foreach dayName $abbrDays {
- set name [string tolower $dayName]
- label .calendar.$name \
- -text $dayName \
- -font { Helvetica 12 }
- table .calendar .calendar.$name 2,$cnt -pady 2 -padx 2
- incr cnt
- }
- table configure .calendar c* r2 -pad 4
- set week 0
- set numDays [lindex $info 1]
- for { set cnt 1 } { $cnt <= $numDays } { incr cnt } {
- label .calendar.day${cnt} -text $cnt
- if { $cnt == $day } {
- .calendar.day${cnt} configure -relief sunken -bd 1
- }
- incr wkday
- if { $wkday == 7 } {
- incr week
- set wkday 0
- }
- table .calendar .calendar.day${cnt} $week+3,$wkday \
- -fill both -ipadx 10 -ipady 4
- }
- frame .calendar.quit -bd 1 -relief sunken
- button .calendar.quit.button -command { exit } -text {Quit} -bd 2
- table .calendar.quit \
- .calendar.quit.button -padx 4 -pady 4
- table .calendar \
- .calendar.quit $week+4,5 -cspan 2 -pady 4
- table . \
- .calendar -fill both
- table configure .calendar r0 -resize none
- table configure .calendar c0 c6
-}
-
-set date [clock format [clock seconds] -format {%a %b %d %Y}]
-scan $date { %s %s %d %d } weekday month day year
-
-Calendar $weekday $day $month $year
diff --git a/blt3.0.1/examples/form.tcl b/blt3.0.1/examples/form.tcl
deleted file mode 100755
index 00737f9..0000000
--- a/blt3.0.1/examples/form.tcl
+++ /dev/null
@@ -1,1061 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-# --------------------------------------------------------------------------
-# Starting with Tcl 8.x, the BLT commands are stored in their own
-# namespace called "blt". The idea is to prevent name clashes with
-# Tcl commands and variables from other packages, such as a "table"
-# command in two different packages.
-#
-# You can access the BLT commands in a couple of ways. You can prefix
-# all the BLT commands with the namespace qualifier "blt::"
-#
-# blt::graph .g
-# blt::table . .g -resize both
-#
-# or you can import all the command into the global namespace.
-#
-# namespace import blt::*
-# graph .g
-# table . .g -resize both
-#
-# --------------------------------------------------------------------------
-
-#source scripts/demo.tcl
-
-option add *takeFocus 0
-
-set file1 ../demos/images/chalk.gif
-#set file1 /home/gah/titanium.jpg
-set file2 ../demos/images/tan_paper.gif
-image create picture texture1 -file $file1
-image create photo texture2 -file $file2
-option add *Frame.Tile texture1
-option add *Toplevel.Tile texture1
-option add *Label.Tile texture1
-#option add *Scrollbar.tile texture1
-#option add *Scrollbar.activeTile texture2
-#option add *Button.tile texture1
-#option add *Button.activeTile texture2
-option add *HighlightThickness 0
-option add *Entry.highlightThickness 2
-
-#
-# Initialization of global variables and Tk resource database
-#
-#
-# Resources available
-#
-# Tk.normalBgColor:
-# Tk.normalFgColor:
-# Tk.focusHighlightColor:
-# Tk.statusFont:
-# Tk.titleFont:
-# Tk.headingFont:
-# Tk.subheadingFont:
-# Tk.entryFont:
-# Tk.textFont:
-#
-
-#debug 50
-blt::bitmap define attlogo { { 60 30 } {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x7e, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xf8, 0x03,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x83, 0xf9, 0x87, 0x7f, 0x00,
- 0x00, 0x00, 0x00, 0x80, 0xf9, 0x87, 0x7f, 0x00, 0x40, 0x00, 0xf0, 0xc7,
- 0xc3, 0x38, 0x0c, 0x00, 0xc0, 0xff, 0xff, 0xc7, 0xc3, 0x7c, 0x0c, 0x00,
- 0x00, 0x00, 0x00, 0x40, 0xc2, 0x6c, 0x0c, 0x00, 0x40, 0x00, 0xf8, 0x67,
- 0xc6, 0x9c, 0x0d, 0x00, 0xc0, 0xff, 0xff, 0xe7, 0xc7, 0xf8, 0x0d, 0x00,
- 0x00, 0x00, 0x00, 0xe0, 0xc7, 0xec, 0x0c, 0x00, 0x80, 0x01, 0xfe, 0x33,
- 0xcc, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x33, 0xcc, 0xb8, 0x0d, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
-}
-
-blt::bitmap define globe_00 { { 32 32 } {
- 00 40 02 00 00 1c 3c 00 00 01 fe 00 80 80 fe 03 60 00 ff 07 10 c0 f1 0f
- 00 80 c0 1f 00 c0 07 3f 00 c0 ff 3f 00 f0 ff 4f 02 f0 ff 5d 00 f0 ff 1b
- 00 f0 ff 8f 02 f0 ff 0f 06 e0 fc 0f 0e 00 f8 0f 0f 00 f8 07 3f 00 f8 03
- 7e 00 f0 03 7e 00 f0 03 3e 00 f0 0b 3c 00 f0 09 3c 00 f0 01 18 00 f0 00
- 18 00 70 00 10 00 00 00 10 00 00 00 20 00 00 00 40 00 00 00 00 00 00 00
- 00 00 00 00 00 00 1f 00 }
-}
-
-blt::bitmap define globe_01 { { 32 32 } {
- 00 c0 00 00 00 34 38 00 00 02 e8 00 80 01 fa 03 e0 00 fc 07 30 00 e6 0f
- 10 00 86 1f 08 00 3e 3c 04 00 ff 3f 04 80 ff 5f 02 80 ff 3f 00 80 ff 2f
- 00 80 ff 3f 0c 00 ff 3f 1c 00 ee 3f 3c 00 c0 3f 7e 00 c0 1f fe 01 80 1f
- fc 03 80 1f fc 01 80 1f fc 01 80 2f f8 01 80 0f f0 00 80 17 f0 00 80 03
- f0 00 80 03 60 00 00 00 60 00 00 00 40 00 00 00 80 00 00 00 00 00 00 00
- 00 00 00 00 00 00 1e 00 }
-}
-
-blt::bitmap define globe_02 { { 32 32 } {
- 00 c0 01 00 00 60 30 00 00 04 f0 00 80 07 e0 03 e0 01 f0 07 f0 00 38 0f
- 30 00 10 1e 18 00 f0 30 04 00 f8 3f 10 00 f8 7f 12 00 fc 7f 02 00 fc 7f
- 04 00 fc 7f 74 00 f8 7f f0 00 70 7f f8 01 00 7e f8 03 00 7e f8 0f 00 7c
- f8 1f 00 3c f0 1f 00 3c f0 0f 00 3e e0 0f 00 5e c0 07 00 1c c0 03 00 0e
- c0 03 00 04 80 01 00 00 80 01 00 00 80 01 00 00 00 01 00 00 00 00 00 00
- 00 00 00 00 00 10 1c 00 }
-}
-
-blt::bitmap define globe_03 { { 32 32 } {
- 00 c0 01 00 00 dc 20 00 00 09 c0 00 80 1f a0 03 e0 07 c0 07 f0 01 c0 0c
- f8 00 40 18 78 00 c0 23 08 00 c0 3f 04 00 e0 7f 54 00 e0 7f 0c 00 c0 7f
- 10 00 c0 ff d0 01 c0 ff c0 03 80 fb e0 0f 00 f0 e0 1f 00 f0 e0 ff 00 f0
- e0 ff 00 70 c0 ff 00 70 c0 7f 00 70 00 7f 00 70 00 3f 00 30 00 1f 00 38
- 00 1f 00 18 00 0e 00 00 00 06 00 00 00 02 00 00 00 04 00 00 00 00 00 00
- 00 00 00 00 00 20 18 00 }
-}
-
-blt::bitmap define globe_04 { { 32 32 } {
- 00 c0 03 00 00 7c 03 00 00 13 00 00 80 7f c0 03 c0 1f 00 07 e0 0f 00 0d
- f0 03 00 10 f0 01 00 0e 38 01 00 3e 10 00 00 7f 50 00 00 7f 30 00 00 7f
- 40 00 00 ff 00 1e 00 fe 00 3f 00 ec 00 7f 00 c0 00 ff 00 c0 00 ff 07 c0
- 00 ff 0f c0 00 fe 07 c0 00 fe 07 c0 00 f8 03 40 00 f8 01 60 00 f8 00 20
- 00 f8 00 20 00 38 00 00 00 18 00 00 00 18 00 00 00 18 00 00 00 00 00 00
- 00 00 00 00 00 40 10 00 }
-}
-
-blt::bitmap define globe_05 { { 32 32 } {
- 00 c0 03 00 00 bc 06 00 00 cf 00 00 80 ff 01 02 c0 7f 00 06 c0 3f 00 0e
- e0 1f 00 14 e0 0f 00 18 e0 00 00 38 60 00 00 78 40 08 00 78 c0 01 00 78
- 00 02 00 f8 00 f0 00 f0 00 f0 01 b0 00 f8 07 80 00 f8 0f 80 00 f8 3f 00
- 00 f8 7f 00 00 f0 3f 80 00 f0 3f 80 00 c0 1f 00 00 c0 0f 00 00 c0 07 40
- 00 c0 07 00 00 c0 01 00 00 e0 00 00 00 60 00 00 00 40 00 00 00 00 00 00
- 00 00 00 00 00 80 10 00 }
-}
-
-blt::bitmap define globe_06 { { 32 32 } {
- 00 80 07 00 00 7c 0d 00 00 9f 03 00 00 ff 07 02 00 ff 03 04 80 ff 00 08
- c0 7f 00 00 80 3f 00 30 80 07 00 20 00 03 00 60 00 03 00 60 00 0e 00 60
- 00 10 00 e0 00 80 07 c0 00 80 0f c0 00 80 3f 00 00 c0 7f 00 00 c0 ff 01
- 00 c0 ff 03 00 80 ff 01 00 80 ff 01 00 00 fe 00 00 00 7e 00 00 00 3e 00
- 00 00 1f 00 00 00 0f 00 00 00 03 00 00 00 03 00 00 00 01 00 00 00 00 00
- 00 00 00 00 00 00 01 00 }
-}
-
-blt::bitmap define globe_07 { { 32 32 } {
- 00 80 07 00 00 fc 1a 00 00 7d 02 00 00 fe 1f 00 00 fe 0f 00 00 fe 07 00
- 00 ff 03 00 00 fe 01 20 00 1c 01 00 00 1c 00 40 00 18 00 40 00 70 00 00
- 00 80 00 80 00 00 39 80 00 00 7c 00 00 00 fc 01 00 00 fe 03 00 00 fe 0f
- 00 00 fc 0f 00 00 fc 0f 00 00 f8 07 00 00 f0 07 00 00 f0 03 00 00 f0 01
- 00 00 f8 00 00 00 38 00 00 00 18 00 00 00 0c 00 00 00 04 00 00 00 00 00
- 00 00 00 00 00 00 02 00 }
-}
-
-blt::bitmap define globe_08 { { 32 32 } {
- 00 00 07 00 00 fc 25 00 00 f8 19 00 00 f8 7f 00 00 f8 3f 00 00 f8 1f 00
- 00 f8 1f 00 00 f8 0f 00 00 f0 08 00 00 f0 00 00 00 c0 04 00 00 80 03 00
- 00 00 0c 00 00 00 c8 01 00 00 e0 03 00 00 e0 0f 00 00 e0 0f 00 00 f0 3f
- 00 00 e0 3f 00 00 e0 3f 00 00 c0 1f 00 00 80 1f 00 00 80 0f 00 00 c0 07
- 00 00 c0 03 00 00 c0 01 00 00 60 00 00 00 30 00 00 00 10 00 00 00 00 00
- 00 00 00 00 00 00 04 00 }
-}
-
-blt::bitmap define globe_09 { { 32 32 } {
- 00 00 03 00 00 fc 27 00 00 f0 13 00 00 e0 ff 00 00 e0 ff 01 00 e0 7f 00
- 00 e0 7f 00 00 c0 7f 00 00 80 47 00 00 80 07 00 00 00 26 00 00 00 1c 00
- 00 00 60 00 00 00 40 0e 00 00 00 1f 00 00 00 3f 00 00 00 3f 00 00 00 7f
- 00 00 00 7f 00 00 00 7f 00 00 00 7e 00 00 00 3c 00 00 00 3e 00 00 00 1e
- 00 00 00 0f 00 00 00 07 00 00 80 01 00 00 80 00 00 00 40 00 00 00 00 00
- 00 00 00 00 00 00 08 00 }
-}
-
-blt::bitmap define globe_10 { { 32 32 } {
- 00 00 06 00 00 f4 2f 00 00 c8 4f 00 00 80 ff 01 00 80 ff 01 00 80 ff 01
- 00 00 ff 01 00 00 fe 01 00 00 3c 00 00 00 3c 00 00 00 30 04 00 00 e0 00
- 00 00 00 01 00 00 00 3a 00 00 00 38 00 00 00 78 00 00 00 f8 00 00 00 fc
- 00 00 00 f8 00 00 00 f8 00 00 00 f8 00 00 00 70 00 00 00 70 00 00 00 38
- 00 00 00 18 00 00 00 0c 00 00 00 06 00 00 00 03 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 10 00 }
-}
-
-blt::bitmap define globe_11 { { 32 32 } {
- 00 00 06 00 00 ec 1f 00 00 91 9f 00 00 00 fe 03 00 00 fc 07 00 00 fc 07
- 00 00 fc 07 00 00 f0 07 00 00 f0 01 00 00 e0 00 00 00 80 05 00 00 00 07
- 00 00 00 08 00 00 00 60 00 00 00 e0 00 00 00 e0 00 00 00 e0 00 00 00 e0
- 01 00 00 e0 00 00 00 e0 00 00 00 e0 00 00 00 40 00 00 00 60 00 00 00 60
- 00 00 00 30 00 00 00 10 40 00 00 08 40 00 00 04 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 10 00 }
-}
-
-blt::bitmap define globe_12 { { 32 32 } {
- 00 00 04 00 00 dc 3f 00 00 42 7e 00 00 00 f8 03 20 00 f0 07 10 00 f0 0f
- 00 00 e0 0f 00 00 c0 0f 00 00 00 07 00 00 00 06 00 00 00 14 00 00 00 18
- 00 00 00 20 00 00 00 80 00 00 00 80 00 00 00 80 00 00 00 80 01 00 00 80
- 00 00 00 80 00 00 00 80 02 00 00 80 02 00 00 00 04 00 00 40 04 00 00 40
- 08 00 00 20 08 00 00 00 00 00 00 10 00 00 00 08 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 }
-}
-
-blt::bitmap define globe_13 { { 32 32 } {
- 00 00 04 00 00 bc 3f 00 00 01 79 00 80 00 e0 03 60 00 c0 07 10 00 80 0f
- 00 00 80 1f 08 00 00 1e 00 00 00 1c 00 00 00 58 00 00 00 10 00 00 00 20
- 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 06 00 00 00
- 04 00 00 00 00 00 00 00 02 00 00 00 0e 00 00 00 0c 00 00 00 1c 00 00 00
- 18 00 00 00 30 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 10 00 00 }
-}
-
-blt::bitmap define globe_14 { { 32 32 } {
- 00 00 00 00 00 fc 3f 00 00 03 e6 00 80 01 c0 03 60 00 00 07 30 00 00 0f
- 00 00 00 1e 00 00 00 38 04 00 00 30 00 00 00 30 02 00 00 00 00 00 00 40
- 00 00 00 80 00 00 00 00 02 00 00 00 01 00 00 00 01 00 00 00 18 00 00 00
- 00 00 00 00 00 00 00 00 14 00 00 00 3c 00 00 00 3c 00 00 00 7c 00 00 00
- 78 00 00 00 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 30 00 00 }
-}
-
-blt::bitmap define globe_15 { { 32 32 } {
- 00 00 00 00 00 fc 3d 00 00 27 c8 00 80 13 00 03 e0 01 00 06 70 00 00 0c
- 10 00 00 18 18 00 00 30 0c 00 00 20 0c 00 00 40 02 00 00 00 02 00 00 00
- 00 00 00 00 00 00 00 00 01 00 00 00 03 00 00 00 13 00 00 00 64 00 00 00
- c0 00 00 00 00 00 00 00 30 00 00 00 f8 00 00 00 f8 01 00 00 f8 03 00 00
- f0 03 00 00 80 03 00 00 00 80 00 00 00 40 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 70 00 00
- }
-}
-
-blt::bitmap define globe_16 { { 32 32 } {
- 00 00 00 00 00 fc 3b 00 00 9f a0 00 80 4f 00 02 e0 0f 00 04 f0 01 00 08
- 70 00 00 10 38 00 00 20 3c 00 00 00 1c 00 00 00 06 00 00 00 04 00 00 00
- 04 00 00 00 00 00 00 00 20 00 00 00 0a 00 00 00 0a 00 00 00 00 03 00 00
- 28 06 00 00 00 00 00 00 c0 02 00 00 e0 07 00 00 f0 0f 00 00 e0 1f 00 00
- e0 1f 00 00 00 0c 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 f0 00 00 }
-}
-
-blt::bitmap define globe_17 { { 32 32 } {
- 00 00 00 00 00 fc 37 00 00 3f 42 00 80 3f 01 02 e0 1f 00 00 f0 07 00 00
- f0 11 00 00 f8 04 00 00 fc 00 00 00 7c 00 00 00 1a 00 00 00 9a 00 00 00
- 18 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 28 00 00 00 08 18 00 00
- 00 30 00 00 00 10 00 00 00 17 00 00 00 3f 00 00 c0 7f 00 00 80 7f 00 00
- 80 7f 00 00 00 70 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 f0 01 00
- }
-}
-
-blt::bitmap define globe_18 { { 32 32 } {
- 00 00 00 00 00 fc 2f 00 00 ff 84 00 80 ff 04 00 e0 7f 00 00 f0 9f 00 00
- f0 97 00 00 f8 27 00 00 fc 07 00 00 fc 03 00 00 6c 00 00 00 64 00 00 00
- 60 04 00 00 40 00 00 00 20 00 00 00 20 01 00 00 a0 01 00 00 00 c0 05 00
- 00 88 00 00 00 00 00 00 00 38 01 00 00 fc 01 00 00 fe 03 00 00 fe 03 00
- 00 fc 03 00 00 80 03 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 f0 03 00
- }
-}
-
-blt::bitmap define globe_19 { { 32 32 } {
- 00 40 00 00 00 fc 3f 00 00 ff 13 00 80 ff 13 00 e0 ff 03 00 f0 ff 00 00
- f0 9f 00 00 f8 3f 00 00 fc 3f 00 00 f8 1f 00 00 ba 07 00 00 98 23 00 00
- 08 03 00 00 08 00 00 00 00 00 00 00 80 09 00 00 00 0d 01 00 00 21 0e 00
- 00 00 1c 00 00 00 00 00 00 c0 09 00 00 e0 0f 00 00 f0 1f 00 00 f0 1f 00
- 00 f0 1f 00 00 00 0e 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 f0 07 00
- }
-}
-
-blt::bitmap define globe_20 { { 32 32 } {
- 00 00 00 00 00 fc 3f 00 00 ff 07 00 80 ff 0f 00 e0 ff 0f 00 f0 ff 13 00
- f0 ff 10 00 f8 ff 00 00 fc ff 01 00 f4 ff 00 00 e6 1e 00 00 62 1c 01 00
- 20 18 00 00 20 10 00 00 01 80 00 00 01 cc 00 00 01 68 08 00 00 00 60 00
- 00 00 c0 00 00 00 00 00 00 00 5c 00 00 00 7e 00 00 80 ff 00 00 80 ff 00
- 00 80 ff 00 00 00 70 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 f0 0f 00
- }
-}
-
-blt::bitmap define globe_21 { { 32 32 } {
- 00 80 00 00 00 fc 3f 00 00 ff 1f 00 80 ff bf 00 e0 ff 3f 00 f0 ff 1f 00
- f8 ff 17 00 f8 ff 27 00 ec ff 0f 00 8c ff 07 00 9e f7 00 00 0e e3 00 00
- 06 c1 00 00 06 81 10 00 03 40 04 00 03 20 06 00 03 40 06 00 01 80 00 03
- 01 00 00 02 02 00 00 00 02 00 e0 02 02 00 f0 03 00 00 fc 03 00 00 fc 03
- 00 00 fc 03 00 00 c0 01 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00
- 00 00 00 00 00 f0 1f 00 }
-}
-
-blt::bitmap define globe_22 { { 32 32 } {
- 00 00 01 00 00 fc 3f 00 00 ff 3f 00 80 ff 7f 00 e0 ff ff 00 f0 ff 7f 00
- f0 ff 1f 00 e0 ff 3f 00 fc ff 3f 00 34 fe 3f 00 76 bc 07 00 36 1c 07 00
- 0e 08 0e 00 1e 08 80 00 0f 00 02 00 0f 00 20 00 07 00 36 00 07 00 04 08
- 07 00 00 18 06 00 00 00 16 00 00 0b 16 00 80 0f 04 00 e0 0f 04 00 e0 0f
- 08 00 e0 0f 00 00 00 06 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 f0 1f 00 }
-}
-
-blt::bitmap define globe_23 { { 32 32 } {
- 00 00 00 00 00 fc 3f 00 00 ff 7f 00 80 ff ff 01 e0 ff ff 01 e0 ff ff 01
- e8 ff ff 00 c0 ff ff 00 fc fe ff 01 dc f2 ff 01 de e3 3d 00 de e1 38 02
- 7e 40 70 00 fe 40 00 04 7f 00 00 00 3e 00 30 01 3e 00 a0 01 1e 00 20 20
- 1e 00 00 20 1c 00 00 00 9c 00 00 3c 1c 00 00 3e 1c 00 00 3f 18 00 80 3f
- 10 00 00 1f 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 f0 1f 00 }
-}
-
-blt::bitmap define globe_24 { { 32 32 } {
- 00 00 02 00 00 fc 3f 00 00 fe ff 00 80 ff ff 01 c0 ff ff 03 80 ff ff 03
- e0 ff ff 03 18 ff ff 03 fc ff ff 07 7c 87 ff 07 fe 1f ef 01 fe 0e c6 01
- fe 01 82 03 fe 03 02 00 ff 03 00 08 fc 01 80 09 fc 00 00 0d fc 00 00 00
- f8 00 00 80 f8 00 00 00 f8 00 00 20 78 02 00 70 70 02 00 7c 70 00 00 3c
- 60 00 00 3c 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 f0 1f 00 }
-}
-
-blt::bitmap define globe_25 { { 32 32 } {
- 00 00 00 00 00 f0 3f 00 00 fc ff 00 80 ff ff 03 80 ff ff 07 a0 ff ff 07
- 10 ff ff 07 30 f8 ff 0f f8 df ff 1f fc 3b fc 1f fc fb 78 07 fe 77 30 0e
- fe 1f 30 0c fe 3f 00 48 fe 1f 00 00 f0 0f 00 24 f0 07 00 a0 f0 07 00 08
- e0 07 00 00 e0 07 00 00 e0 27 00 c0 e0 13 00 40 c0 13 00 70 c0 03 00 70
- 80 01 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 f0 1f 00 }
-}
-
-blt::bitmap define globe_26 { { 32 32 } {
- 00 40 00 00 00 e0 3f 00 00 e8 ff 00 00 fc ff 03 00 ff ff 07 c0 fe ff 0f
- 40 f0 ff 1f e0 e0 ff 1f f0 ff fe 3f f8 df e1 3f f8 df c7 1b fc bf 83 19
- fc ff 80 30 fc ff 01 20 f8 ff 00 00 c0 ff 00 00 c0 7f 00 e0 80 3f 00 20
- 80 3f 00 00 80 3f 00 00 80 3f 01 80 80 9f 00 00 00 9f 00 40 00 0f 00 60
- 00 0e 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 f0 1f 00 }
-}
-
-blt::bitmap define globe_27 { { 32 32 } {
- 00 80 00 00 00 c4 3f 00 00 f0 ff 00 00 fe ff 03 00 fe ff 07 00 eb ff 0f
- 80 c9 ff 1f 80 07 ff 3f c0 ff f7 3f e0 ff 0e 7f f0 ff 3e 6e f0 ff 1d 64
- f0 ff 07 44 f0 ff 0f 00 60 ff 0f 00 00 fe 07 40 00 fe 03 00 01 fc 01 00
- 01 fc 01 00 00 fc 01 00 00 fc 09 00 02 fc 08 00 00 f8 04 00 00 78 00 40
- 00 70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 e0 1f 00 }
-}
-
-blt::bitmap define globe_28 { { 32 32 } {
- 00 00 00 00 00 88 3f 00 00 40 ff 00 00 e8 ff 03 00 f8 ff 07 00 8c ff 0f
- 00 06 fe 1f 00 1e f8 3f 00 ff bf 3f 80 ff 77 7c 80 ff ff 79 c0 ff ef 10
- c0 ff 3f 90 c0 ff 7f 00 81 fb 7f 00 01 f0 3f 00 01 f0 1f 00 03 e0 1f 00
- 07 e0 0f 00 02 c0 1f 00 02 e0 5f 00 06 e0 47 00 04 c0 27 00 04 c0 03 00
- 00 80 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 c0 1f 00 }
-}
-
-blt::bitmap define globe_29 { { 32 32 } {
- 00 40 01 00 00 0c 3f 00 00 80 fd 00 00 a0 ff 03 20 e0 ff 07 00 30 fd 0f
- 00 10 f4 1f 00 f8 c0 3f 00 f8 ff 3f 00 fc bf 73 00 fe ff 67 00 fe 7f 47
- 00 fe ff 41 00 fe ff 03 01 dc ff 03 03 00 ff 01 07 80 ff 00 0f 00 ff 00
- 1f 00 7e 00 0e 00 fe 00 0e 00 ff 02 0e 00 3f 01 0c 00 3e 01 0c 00 1e 00
- 08 00 1c 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 80 1f 00 }
-}
-
-# ----------------------------------------------------------------
-#
-# SetOption --
-#
-# Sets the option array associated with the resource. It
-# first check to see if the resource exists in the option
-# data base, otherwise it uses the default value given.
-#
-#
-# Arguments
-# name -- Name of the resource. Used as index into
-# the option array.
-# value -- default value given.
-# Globals
-# pq_dict -- Associative array where the option resources
-# are stored.
-#
-# ----------------------------------------------------------------
-
-proc SetOption { name value } {
- global pq_dict
- set widgetOption [option get . $name Tk]
- if { $widgetOption != "" } {
- set value $widgetOption
- }
- set pq_dict($name) $value
-}
-
-set pq_dict(textIndex) {}
-
-set pq_dict(entryNames) {
- last first middle
- area exch ext
- com org tl
- room oldloc loc
- street
- city state zip
- ema
-}
-
-set pq_dict(numEntries) [llength $pq_dict(entryNames)]
-set pq_dict(index) 0
-set pq_dict(defaults) {}
-
-set cnt 0
-foreach name $pq_dict(entryNames) {
- if { $cnt > 0 } {
- set pq_dict(format) $pq_dict(format):%$name
- } else {
- set pq_dict(format) %$name
- }
- incr cnt
-}
-
-set visual [winfo screenvisual .]
-if { ($visual == "staticgray") || ($visual == "grayscale") } {
- option add *Entry.background white
- option add *Text.background white
- set pq_dict(visual) mono
-} else {
- set depth [winfo screendepth .]
- if { $depth < 8 } {
- SetOption normalBgColor grey
- SetOption normalFgColor black
- SetOption focusHighlightColor white
- } else {
-#fff4de
- SetOption normalBgColor grey90
- SetOption normalFgColor #da5f5f
- SetOption normalFgColor black
-#navyblue
- SetOption focusHighlightColor #fffdf8
- }
- option add *Entry.background $pq_dict(normalBgColor) widgetDefault
- option add *Text.background $pq_dict(normalBgColor) widgetDefault
- option add *Label.foreground $pq_dict(normalFgColor) widgetDefault
- option add *Button.foreground $pq_dict(normalFgColor) widgetDefault
- option add *Scrollbar.background $pq_dict(normalBgColor)
- set pq_dict(visual) color
-}
-
-SetOption statusFont -*-Helvetica-Medium-R-*-*-14-*-*-*-*-*-*-*
-SetOption titleFont -*-Helvetica-Bold-R-*-*-14-*-*-*-*-*-*-*
-SetOption headingFont -*-Helvetica-Medium-R-*-*-14-*-*-*-*-*-*-*
-SetOption subheadingFont -*-Helvetica-Medium-R-*-*-12-*-*-*-*-*-*-*
-SetOption entryFont -*-Courier-Medium-R-*-*-18-*-*-*-*-*-*-*
-SetOption textFont -*-Courier-Bold-R-*-*-18-*-*-*-*-*-*-*
-#SetOption entryFont fixed
-#SetOption textFont fixed
-
-option add *Label.borderWidth 0 widgetDefault
-option add *Entry.relief sunken widgetDefault
-option add *Entry.width 11 widgetDefault
-option add *Entry.borderWidth 2 widgetDefault
-option add *Entry.font $pq_dict(entryFont) widgetDefault
-option add *Text.font $pq_dict(textFont) widgetDefault
-option add *Text.width 35 widgetDefault
-option add *Text.height 10 widgetDefault
-option add *Scrollbar.relief flat widgetDefault
-option add *Scrollbar.minSlider 10 widgetDefault
-option add *Button.padY 4
-option add *Text.relief sunken widgetDefault
-option add *Text.borderWidth 2 widgetDefault
-
-foreach name $pq_dict(entryNames) {
- option add *${name}_label.font $pq_dict(subheadingFont) widgetDefault
-}
-
-option add *Label.Font $pq_dict(subheadingFont)
-option add *status_label.font $pq_dict(statusFont) widgetDefault
-option add *name_label.font $pq_dict(headingFont) widgetDefault
-option add *tel_label.font $pq_dict(headingFont) widgetDefault
-option add *office_label.font $pq_dict(headingFont) widgetDefault
-option add *addr_label.font $pq_dict(headingFont) widgetDefault
-option add *loc_title.font $pq_dict(headingFont) widgetDefault
-option add *org_title.font $pq_dict(headingFont) widgetDefault
-
-option add *overall_label.text "Customer Database"
-option add *name_label.text "Name"
-option add *tel_label.text "Telephone"
-option add *addr_label.text "Address"
-option add *last_label.text "last"
-option add *first_label.text "first"
-option add *middle_label.text "middle"
-option add *com_label.text "company"
-option add *org_label.text "organization"
-option add *tl_label.text "title"
-option add *ext_label.text "extension"
-option add *exch_label.text "exchange"
-option add *area_label.text "area code"
-option add *loc_label.text "extension"
-option add *oldloc_label.text "exchange"
-option add *room_label.text "area code"
-option add *street_label.text "street address"
-option add *ema_label.text "e-mail"
-option add *city_label.text "city"
-option add *state_label.text "state"
-option add *zip_label.text "zip code"
-option add *org_title.text "Organization"
-option add *loc_title.text "Fax"
-
-option add *clear_button.text "Clear"
-option add *quit_button.text "Quit"
-option add *cancel_button.text "Cancel"
-
-# --------------------------------------------------------------------------
-#
-# Procedures to perform post queries
-#
-
-# ----------------------------------------------------------------
-#
-# StopQuery --
-#
-# Stops any current "pq" request by setting the variable
-# associated with the background subprocesses.
-#
-# Arguments
-# None.
-#
-# Globals
-# postOutput -- variable where collected output from
-# pq command will be stored
-#
-# ----------------------------------------------------------------
-
-proc StopQuery {} {
- global postOutput
- set postOutput {}
-}
-
-
-# ----------------------------------------------------------------
-#
-# PostQuery --
-#
-# Collects the data from the entry widget fields and
-# executes a "pq" request. The "pq" command is executed
-# in the background and a "wait" is setup to wait for the
-# command to finish. This allows the animation routine
-# to operate and exposure events to be handled properly.
-#
-# Arguments
-# None.
-#
-# Globals
-# postOutput -- variable where collected output from
-# pq command will be stored
-# pq_dict(entryNames) -- list of entry widget names
-# pq_dict(textIndex) -- starting index of highlighted information
-# (a line in the text widget)
-#
-# ----------------------------------------------------------------
-
-proc PostQuery {} {
- global pq_dict
-
- .status_label configure -text {}
- set cnt 0
- foreach name $pq_dict(entryNames) {
- set value [.${name}_entry get]
- if { $value != "" } {
- set value [split $value "|"]
- foreach i $value {
- if { $cnt > 0 } {
- set query $query/$name=[list $i]
- } else {
- set query $name=[list $i]
- }
- incr cnt
- }
- }
- }
- if { $cnt == 0 } {
- return
- }
- set fmt {%^24pn\t%10org\t%6loc\t%area-%exch-%ext\t%ema}
- global postOutput postError
- set postOutput {}
- set postError {}
- bgexec postStatus -error postError -output postOutput \
- pq -o $fmt $query &
- Animate on
- tkwait variable postStatus
- if { $postOutput != "" } {
- .text configure -state normal
- .text delete 0.0 end
- .text insert 0.0 $postOutput
- .text configure -state disabled
- .status_label configure -text "Post query successful"
- } else {
- .status_label configure -text "Post query failed"
- }
- set pq_dict(textIndex) {}
- Animate off
- if { $postError != "" } {
- tkerror $postError
- }
-}
-
-
-# ----------------------------------------------------------------
-#
-# ClearFields --
-#
-# Clears the all the entry fields.
-#
-# Arguments
-# None.
-#
-# Globals
-# pq_dict(entryNames) -- list of entry widget names
-# pq_dict(textIndex) -- starting index of highlighted information
-# (a line in the text widget)
-#
-# ----------------------------------------------------------------
-
-proc ClearFields {} {
- global pq_dict
-
- blt::busy hold . ; update
- foreach name $pq_dict(entryNames) {
- .${name}_entry delete 0 end
- }
- set pq_dict(textIndex) {}
- .status_label configure -text "Cleared query fields"
- blt::busy release .
-}
-
-
-# ----------------------------------------------------------------
-#
-# FillFields --
-#
-# Makes a post query based upon the highlighted line in
-# the text widget to fill in all post entry fields.
-#
-# Arguments
-# x x screen coordinate
-# y y screen coordinate
-#
-# Globals
-# postOutput variable where collected output from pq
-# command will be stored
-# pq_dict(format) standard query format to collect data for
-# all entry fields
-# pq_dict(entryNames) list of entry widget names
-#
-# ----------------------------------------------------------------
-
-proc FillFields { x y } {
- global pq_dict
-
- set info [.text get [list @$x,$y linestart] [list @$x,$y lineend]]
- set info [split $info \t]
- if { [llength $info] == 0 } {
- return
- }
- set name [string trim [lindex $info 0]]
- set name [split $name ,]
- set last [lindex $name 0]
- set name [split [lindex $name 1]]
- set first [lindex $name 0]
- set middle [lindex $name 1]
- set org [string trim [lindex $info 1]]
- set loc [string trim [lindex $info 2]]
- set tel [string trim [lindex $info 3]]
- set query last=$last/first=$first/middle=$middle/org=$org/loc=$loc/tel=[list $tel]
- global postOutput
- set postOutput {}
- bgexec postStatus -output postOutput \
- pq -o $pq_dict(format) $query &
- Animate on
- tkwait variable postStatus
-
- if { $postOutput == "" } {
- # Try again with out the telephone number
- set query last=$last/first=$first/middle=$middle/org=$org/loc=$loc
- set postStatus {}
- bgexec postStatus -output postOutput \
- pq -o $pq_dict(format) $query &
- tkwait variable postStatus
- }
- Animate off
- if { $postOutput == "" } {
- .status_label configure -text "Post query failed"
- } else {
- .status_label configure -text "Post database fields found"
- set postOutput [split $postOutput : ]
- set cnt 0
- foreach name $pq_dict(entryNames) {
- .${name}_entry delete 0 end
- .${name}_entry insert 0 [lindex $postOutput $cnt]
- incr cnt
- }
- }
-}
-
-
-# ----------------------------------------------------------------
-#
-# HighlightText --
-#
-# Highlight the text under the current line (as based upon
-# the given screen coordinates. Only highlight the line if
-# pointer has been moved to the another line.
-#
-# Arguments
-# x x screen coordinate
-# y y screen coordinate
-#
-# Globals
-# pq_dict(visual) either "mono" or "color"; indicates if
-# color screen features can be used
-# pq_dict(textIndex) starting index of highlighted information
-# pq_dict(normalFgColor) color to use for highlighted region
-#
-# ----------------------------------------------------------------
-
-proc HighlightText { x y } {
- global pq_dict
-
- set newIndex [.text index [list @$x,$y linestart]]
- if { $newIndex != $pq_dict(textIndex) } {
- catch { .text tag delete highlight }
- .text tag add highlight $newIndex [list $newIndex lineend]
- if { $pq_dict(visual) == "color" } {
- .text tag configure highlight \
- -foreground $pq_dict(normalFgColor) -underline on
- } else {
- .text tag configure highlight -underline on
- }
- set pq_dict(textIndex) $newIndex
- }
-}
-
-
-# ----------------------------------------------------------------
-#
-# ChangeFocus --
-#
-# Change the keyboard focus to the next/last entry widget.
-#
-# Arguments
-# direction either "next" or "last"; indicates in
-# which direction to change focus
-#
-# Globals
-# pq_dict(entryNames) list of entry widget names
-# pq_dict(index) current index in list of entry widget
-# names of the keyboard focus. An index
-# of -1 indicates there is no focus.
-# pq_dict(numEntries) number of names in entry widget list
-#
-# ----------------------------------------------------------------
-
-proc ChangeFocus direction {
- global pq_dict
-
- case $direction {
- next {
- incr pq_dict(index)
- if { $pq_dict(index) == $pq_dict(numEntries) } {
- set pq_dict(index) 0
- }
- }
- last {
- set pq_dict(index) [expr $pq_dict(index)-1]
- if { $pq_dict(index) < 0 } {
- set pq_dict(index) [expr $pq_dict(numEntries)-1]
- }
- }
- }
- focus .[lindex $pq_dict(entryNames) $pq_dict(index)]_entry
- update idletasks
- update
-}
-
-
-# ----------------------------------------------------------------
-#
-# ColorFocus --
-#
-# Change background color of entry widget with active
-# keyboard focus
-#
-# Arguments
-# w name of entry widget to change
-# bool either "on" or "off"; indicates if
-# the focus highlight should turned on
-# or off.
-#
-# Globals
-# pq_dict(entryNames) list of entry widget names
-# pq_dict(index) current index in list of entry widget
-# names of the keyboard focus. An index
-# of -1 indicates there is no focus.
-# pq_dict(visual) either "mono" or "color"; indicates if
-# color screen features can be used
-#
-# ----------------------------------------------------------------
-
-proc ColorFocus { w bool } {
- global pq_dict
-
- regexp {\.([a-z]+)_entry} $w dummy name
- if { $pq_dict(visual) == "color" && [info commands $w] == $w } {
- if { $bool == "on" } {
- set pq_dict(index) [lsearch $pq_dict(entryNames) $name]
- $w configure -background $pq_dict(focusHighlightColor)
- } else {
- $w configure -background $pq_dict(normalBgColor)
- }
- }
-}
-
-# ----------------------------------------------------------------
-#
-# Animate --
-#
-# Activates/deactivates an animated bitmap and busy window.
-# A cancel button is mapped and raised so that it is unaffected
-# by the busy window.
-#
-# Arguments
-# option either "on", "off", or "continue";
-# indicates whether animation should
-# be started, stoped or continued.
-#
-# Globals
-# pq_dict(entryNames) list of entry widget names
-# pq_dict(index) current index in list of entry widget
-# names of the keyboard focus. An index
-# of -1 indicates there is no focus.
-# pq_dict(visual) either "mono" or "color"; indicates if
-# color screen features can be used
-#
-# ----------------------------------------------------------------
-
-set pq_dict(curBitmap) 0
-set pq_dict(lastBitmap) 0
-
-proc Animate option {
- global pq_dict
-
- case $option {
- on {
- blt::busy hold .
- .status_label configure -text "Searching..."
- global topLevel
- blt::table $topLevel .cancel_button 18,8 -anchor e -reqwidth .70i
- winop raise .cancel_button
- .quit_button configure -state disabled
- .clear_button configure -state disabled
- winop raise .cancel_button
- set pq_dict(lastFocus) [focus]
- focus -force .
- set pq_dict(curBitmap) $pq_dict(lastBitmap)
- update
- }
- off {
- blt::table forget .cancel_button
- .quit_button configure -state normal
- .clear_button configure -state normal
- .trademark configure -bitmap attlogo
- set pq_dict(lastBitmap) $pq_dict(curBitmap)
- set pq_dict(curBitmap) -1
- focus $pq_dict(lastFocus)
- blt::busy release .
- }
- }
- #
- # Continue with next bitmap
- #
- if { $pq_dict(curBitmap) >= 0 } {
- set bmap [format globe_%0.2d $pq_dict(curBitmap)]
- .trademark configure -bitmap $bmap
- incr pq_dict(curBitmap)
- if { $pq_dict(curBitmap) >= 29 } {
- set pq_dict(curBitmap) 0
- }
- after 100 Animate continue
- }
-}
-
-
-# --------------------------------------------------------------------------
-#
-# main body of program
-#
-
-blt::tile::frame .frame
-set topLevel .frame
-
-blt::tile::label .overall_label -font -*-Helvetica-Bold-R-*-*-18-*-*-*-*-*-*-*
-blt::tile::label .name_label -font $pq_dict(titleFont)
-blt::tile::label .tel_label -font $pq_dict(titleFont)
-blt::tile::label .addr_label -font $pq_dict(titleFont)
-blt::tile::label .org_title -font $pq_dict(titleFont)
-blt::tile::label .loc_title -font $pq_dict(titleFont)
-
-foreach name $pq_dict(entryNames) {
- blt::tile::label .${name}_label
- entry .${name}_entry
-}
-if [info exists env(POST_DEFAULTS)] {
- set pq_dict(defaults) [split $env(POST_DEFAULTS) ":"]
-}
-foreach i $pq_dict(defaults) {
- set i [split $i "="]
- if { [llength $i] == 2 } {
- set name [lindex $i 0]
- if { [lsearch $pq_dict(entryNames) $name] >= 0 } {
- .${name}_entry insert 0 [lindex $i 1]
- }
- }
-}
-blt::tile::label .orders_title -text "Current Orders" \
- -font -*-Helvetica-Bold-R-*-*-16-*-*-*-*-*-*-*
-
-set font -*-Helvetica-Bold-R-*-*-12-*-*-*-*-*-*-*
-button .clear_button -command ClearFields -font $font
-button .quit_button -command { exit } -font $font
-button .search_button -text "Search" -font $font
-
-blt::tile::label .status_label
-button .cancel_button -command StopQuery
-#-relief raised
-blt::tile::label .trademark -bitmap attlogo
-text .text -yscrollcommand { .vscroll set } -state disabled
-scrollbar .vscroll -command { .text yview }
-
-blt::table $topLevel \
- .overall_label 0,1 -cspan 10 -pady 5 \
- .name_label 1,2 \
- .last_entry 2,2 -cspan 2 \
- .first_entry 2,4 \
- .middle_entry 2,5 \
- .last_label 3,2 \
- .first_label 3,4 \
- .middle_label 3,5 \
- .tel_label 1,7 \
- .area_entry 2,7 \
- .exch_entry 2,8 \
- .ext_entry 2,9 \
- .area_label 3,7 \
- .exch_label 3,8 \
- .ext_label 3,9 \
- .org_title 4,2 \
- .com_entry 5,2 \
- .org_entry 5,3 \
- .tl_entry 5,4 \
- .com_label 6,2 \
- .org_label 6,3 \
- .tl_label 6,4 \
- .loc_title 4,7 \
- .room_entry 5,7 \
- .oldloc_entry 5,8 \
- .loc_entry 5,9 \
- .room_label 6,7 \
- .oldloc_label 6,8 \
- .loc_label 6,9 \
- .addr_label 8,2 \
- .street_entry 9,2 \
- .ema_entry 9,7 -cspan 2 \
- .street_label 10,2 \
- .city_entry 11,2 -cspan 2 \
- .state_entry 11,4 \
- .zip_entry 11,5 \
- .ema_label 10,7 -cspan 2 \
- .city_label 12,2 -cspan 2 \
- .state_label 12,4 \
- .zip_label 12,5 \
- .orders_title 16,2 -pady { 4 0 } \
- .text 17,2 -cspan 8 -fill both -padx 2 \
- .vscroll 17,10 -anchor center -fill both \
- .status_label 18,4 -cspan 6 -reqwidth {0 4i} \
- .search_button 18,3 -reqwidth .6i -anchor center -pady 8\
- .clear_button 18,5 -reqwidth .6i -anchor center \
- .quit_button 18,8 -reqwidth .6i -anchor center
-
-eval blt::table configure $topLevel \
- [info command .*_label] [info commands .*_title] \
- -anchor w -padx 2 -ipadx 2
-eval blt::table configure $topLevel [info command .*_entry] \
- -fill both -padx 2
-eval blt::table configure $topLevel .name_label .tel_label .org_title \
- .com_label .addr_label .street_entry .street_label \
- -cspan 3
-eval blt::table configure $topLevel .last_entry .ema_entry .city_entry \
- .ema_label .city_label -cspan 2
-
-blt::table configure $topLevel .overall_label -anchor center
-blt::table configure $topLevel r16 -pady { 5 5 } -resize both
-blt::table configure $topLevel c0 -width .vscroll
-blt::table configure $topLevel c0 c10 -resize none
-blt::table configure $topLevel r3 r6 r10 r12 -resize none
-blt::table configure $topLevel r17 -height { 40 {} }
-blt::table configure $topLevel r16 r18 -resize none
-blt::table configure $topLevel c6 -pad { 5 5 }
-
-if { $topLevel == ".frame" } {
- blt::table . \
- $topLevel 0,0 -fill both
-}
-
-bind .text <Button-2> {
- FillFields %x %y
- continue
-}
-
-bind .text <Motion> {
- HighlightText %x %y
- continue
-}
-
-bind .text <Enter> {
- set pq_dict(textIndex) {}
- HighlightText %x %y
- set info [.text get [list 0.0 linestart] [list 0.0 lineend]]
- if { $info != "" } {
- .status_label configure -text "Query individual with button-2"
- }
- continue
-}
-
-bind .text <Leave> {
- if { [blt::busy isbusy .] != "." } {
- .text tag delete highlight
- .status_label configure -text ""
- }
- continue
-}
-
-
-bind EntryFocus <Tab> {
- ChangeFocus next
- break
-}
-
-bind EntryFocus <Shift-Tab> {
- ChangeFocus last
- break
-}
-
-if { $pq_dict(visual) == "color" } {
- bind EntryFocus <FocusIn> {
- ColorFocus %W on
- }
- bind EntryFocus <FocusOut> {
- ColorFocus %W off
- }
-}
-
-bind Entry <Return> PostQuery
-
-foreach name $pq_dict(entryNames) {
- set w .${name}_entry
- bindtags $w [list EntryFocus $w Entry all]
-}
-
-focus .last_entry
-
diff --git a/blt3.0.1/examples/pareto.tcl b/blt3.0.1/examples/pareto.tcl
deleted file mode 100755
index 4868785..0000000
--- a/blt3.0.1/examples/pareto.tcl
+++ /dev/null
@@ -1,144 +0,0 @@
-#!../src/bltwish
-
-package require BLT
-
-# --------------------------------------------------------------------------
-# Starting with Tcl 8.x, the BLT commands are stored in their own
-# namespace called "blt". The idea is to prevent name clashes with
-# Tcl commands and variables from other packages, such as a "table"
-# command in two different packages.
-#
-# You can access the BLT commands in a couple of ways. You can prefix
-# all the BLT commands with the namespace qualifier "blt::"
-#
-# blt::graph .g
-# blt::table . .g -resize both
-#
-# or you can import all the command into the global namespace.
-#
-# namespace import blt::*
-# graph .g
-# table . .g -resize both
-#
-# --------------------------------------------------------------------------
-
-# Example of a pareto chart.
-#
-# The pareto chart mixes line and bar elements in the same graph.
-# Each processing operating is represented by a bar element. The
-# total accumulated defects is displayed with a single line element.
-
-blt::barchart .b \
- -title "Defects Found During Inspection" \
- -font {{Sans Serif} 12 Bold} \
- -width 6i \
- -height 5i \
- -bg white \
- -plotborderwidth 1 \
- -plotrelief solid
-
-blt::table . .b -fill both
-
-set data {
- "Spot Weld" 82 yellow
- "Lathe" 49 orange
- "Gear Cut" 38 green
- "Drill" 24 blue
- "Grind" 17 red
- "Lapping" 12 brown
- "Press" 8 purple
- "De-burr" 4 pink
- "Packaging" 3 cyan
- "Other" 12 magenta
-}
-
-# Create an X-Y graph line element to trace the accumulated defects.
-.b line create accum -label "" -symbol none -color red
-
-# Define a bitmap to be used to stipple the background of each bar.
-blt::bitmap define pattern1 { {4 4} {01 02 04 08} }
-
-# For each process, create a bar element to display the magnitude.
-set count 0
-set sum 0
-set ydata 0
-set xdata 0
-set bg [blt::bgpattern create solid -color orange -opacity 70]
-set areabg [blt::bgpattern create solid -color blue -opacity 20]
-foreach { label value color } $data {
- incr count
- .b element create $label \
- -xdata $count \
- -ydata $value \
- -fg $color \
- -relief raised \
- -borderwidth 1 \
- -bg $bg
-
- set labels($count) $label
- # Get the total number of defects.
- set sum [expr $value + $sum]
- lappend ydata $sum
- lappend xdata $count
-}
-
-# Configure the coordinates of the accumulated defects,
-# now that we know what they are.
-.b line configure accum -xdata $xdata -ydata $ydata \
- -areabackground $areabg
-.b element lower accum
-# Add text markers to label the percentage of total at each point.
-foreach x $xdata y $ydata {
- set percent [expr ($y * 100.0) / $sum]
- if { $x == 0 } {
- set text " 0%"
- } else {
- set text [format %.1f $percent]
- }
- .b marker create text \
- -coords "$x $y" \
- -text $text \
- -font {Math 9} \
- -fg red4 \
- -anchor c \
- -yoffset -5
-}
-
-# Display an auxillary y-axis for percentages.
-.b axis configure y2 \
- -hide no \
- -min 0.0 \
- -max 100.0 \
- -tickinterior yes \
- -title "Percentage" -grid no
-
-# Title the y-axis
-.b axis configure y -title "Defects" -grid no \
- -tickinterior yes \
-
-# Configure the x-axis to display the process names, instead of numbers.
-.b axis configure x \
- -title "Process" \
- -command FormatLabels \
- -rotate 290 \
- -tickanchor nw \
- -tickfont {{Sans Serif} 9} \
- -tickinterior yes \
- -ticklength 5 \
- -subdivisions 0
-
-proc FormatLabels { widget value } {
- global labels
- set value [expr round($value)]
- if {[info exists labels($value)] } {
- return $labels($value)
- }
- return ""
-}
-
-# No legend needed.
-.b legend configure -hide yes
-
-# Configure the grid lines.
-.b axis configure x -gridcolor lightblue -grid yes
-
diff --git a/blt3.0.1/html/BLT.html b/blt3.0.1/html/BLT.html
deleted file mode 100644
index 03317c2..0000000
--- a/blt3.0.1/html/BLT.html
+++ /dev/null
@@ -1,161 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>graph(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-BLT - Introduction to the BLT library
-<H2><A NAME="sect1" HREF="#toc1">Description</A></H2>
-BLT
-is a library of extensions to the Tk library. It adds new commands and
-variables to the application's interpreter. <P>
-
-<H2><A NAME="sect2" HREF="#toc2">Commands</A></H2>
-The following commands
-are added to the interpreter from the BLT library:
-<DL>
-
-<DT><B>table</B> </DT>
-<DD>A table geometry
-manager for Tk. You specify window placements as table row,column positions
-and windows can also span multiple rows or columns. It also has many options
-for setting and/or bounding window sizes. </DD>
-
-<DT><B>graph</B> </DT>
-<DD>A 2D plotting widget. Plots
-two variable data in a window with an optional legend and annotations.
- It has of several components; coordinate axes, crosshairs, a legend,
-and a collection of elements and tags. </DD>
-
-<DT><B>barchart</B> </DT>
-<DD>A barchart widget. Plots
-two-variable data as rectangular bars in a window. The x-coordinate values
-designate the position of the bar along the x-axis, while the y-coordinate
-values designate the magnitude. The <B>barchart</B> widget has of several components;
-coordinate axes, crosshairs, a legend, and a collection of elements and
-tags. </DD>
-
-<DT><B>vector</B> </DT>
-<DD>Creates a vector of floating point values. The vector's components
-can be manipulated in three ways: through a Tcl array variable, a Tcl command,
-or the C API. </DD>
-
-<DT><B>spline</B> </DT>
-<DD>Computes a spline fitting a set of data points (x and
-y vectors) and produces a vector of the interpolated images (y-coordinates)
-at a given set of x-coordinates. </DD>
-
-<DT><B>bgexec</B> </DT>
-<DD>Like Tcl's <B>exec</B> command, <B>bgexec</B> runs
-a pipeline of Unix commands in the background. Unlike <B>exec</B>, the output
-of the last process is collected and a global Tcl variable is set upon
-its completion. <B>bgexec</B> can be used with <B>tkwait</B> to wait for Unix commands
-to finish while still handling expose events. Intermediate output is also
-available while the pipeline is active. </DD>
-
-<DT><B>busy</B> </DT>
-<DD>Creates a "busy window" which
-prevents user-interaction when an application is busy. The busy window also
-provides an easy way to have temporary busy cursors (such as a watch or
-hourglass). </DD>
-
-<DT><B>bitmap</B> </DT>
-<DD>Reads and writes bitmaps from Tcl. New X bitmaps can
-be defined on-the-fly from Tcl, obviating the need to copy around bitmap
-files. Other options query loaded X bitmap's dimensions and data. </DD>
-
-<DT><B>drag&drop</B>
- </DT>
-<DD>Provides a drag-and-drop facility for Tk. Information (represented by a
-token window) can be dragged to and from any Tk window, including those
-of another Tk application. <B>drag&drop</B> acts as a coordinator, directing Tk
-<B>send</B> commands between (or within) TCL/Tk applications. </DD>
-
-<DT><B>htext</B> </DT>
-<DD>A simple
-hypertext widget. Combines text and Tk widgets into a single scroll-able
-window. Tcl commands can be embedded into text, which are invoked as the
-text is parsed. In addition, Tk widgets can be appended to the window at
-the current point in the text. <B>Htext</B> can be also used to create scrolled
-windows of Tk widgets. </DD>
-
-<DT><B>winop</B> </DT>
-<DD>Raise, lower, map, or, unmap any window. The
-raise and lower functions are useful for stacking windows above or below
-"busy windows". </DD>
-
-<DT><B>watch</B> </DT>
-<DD>Arranges for Tcl procedures to be called before and/or
-after the execution of every Tcl command. This command may be used in the
-logging, profiling, or tracing of Tcl code. </DD>
-
-<DT><B>bltdebug</B> </DT>
-<DD>A simple Tcl command
-tracing facility useful for debugging Tcl code. Displays each Tcl command
-before and after substitution along its level in the interpreter on standard
-error. </DD>
-</DL>
-
-<H2><A NAME="sect3" HREF="#toc3">Variables</A></H2>
-<P>
-The following Tcl variables are either set or used by BLT
-at various times in its execution:
-<DL>
-
-<DT><B>blt_library</B> </DT>
-<DD>This variable contains the
-name of a directory containing a library of Tcl scripts and other files
-related to BLT. Currently, this directory contains the <B>drag&drop</B> protocol
-scripts and the PostScript prolog used by <B>graph</B> and <B>barchart</B>. The value
-of this variable is taken from the BLT_LIBRARY environment variable, if
-one exists, or else from a default value compiled into the <B>BLT</B> library.
-</DD>
-
-<DT><B>blt_versions</B> </DT>
-<DD>This variable is set in the interpreter for each application.
-It is an array of the current version numbers for each of the BLT commands
-in the form <I>major</I>.<I>minor</I>. <I>Major</I> and <I>minor</I> are integers. The major version
-number increases in any command that includes changes that are not backward
-compatible (i.e. whenever existing applications and scripts may have to change
-to work with the new release). The minor version number increases with
-each new release of a command, except that it resets to zero whenever the
-major version number changes. The array is indexed by the individual command
-name. </DD>
-</DL>
-
-<H2><A NAME="sect4" HREF="#toc4">Adding Blt to Your Applications</A></H2>
-It's easy to add BLT to an existing
-Tk application. BLT requires no patches or edits to the Tcl or Tk libraries.
- To add BLT, simply add the following code snippet to your application's
-tkAppInit.c file. <BR>
-<CODE>if (Blt_Init(interp) != TCL_OK) {<BR>
- return TCL_ERROR;<BR>
-}<BR>
-</CODE><P>Recompile and link with the BLT library (libBLT.a) and that's it. <P>
-Alternately,
-you can dynamically load BLT, simply by invoking the command <BR>
-<CODE>package require BLT<BR>
-</CODE><P>from your Tcl script.
-<H2><A NAME="sect5" HREF="#toc5">Bugs</A></H2>
-Send bug reports, requests, suggestions, etc. to
- gah at siliconmetrics.com or gah at myfirstlink.net
-<H2><A NAME="sect6" HREF="#toc6">Keywords</A></H2>
-BLT <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Description</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Commands</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Variables</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Adding Blt to Your Applications</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Bugs</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/Makefile.vc b/blt3.0.1/html/Makefile.vc
deleted file mode 100644
index 8244f42..0000000
--- a/blt3.0.1/html/Makefile.vc
+++ /dev/null
@@ -1,32 +0,0 @@
-
-# ------------------------------------------------------------------------
-# Makefile for HTML files
-# ------------------------------------------------------------------------
-
-include ../vc.config
-srcdir = ../$(TOP)/html
-
-instdirs = $(prefix) $(libdir) $(scriptdir) $(scriptdir)/html
-
-all:
-
-install: install-dirs install-html
-
-install-dirs:
- @for i in $(instdirs) ; do \
- if test -d "$$i" ; then : ; else \
- echo "mkdir $$i" ; \
- mkdir "$$i" ; \
- fi ; \
- done
-
-install-html: install-dirs
- for i in $(srcdir)/*.html ; do \
- $(INSTALL_DATA) $$i $(scriptdir)/html ; \
- done
-
-clean:
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"*
-
-distclean: clean
- $(RM) Makefile
diff --git a/blt3.0.1/html/barchart.html b/blt3.0.1/html/barchart.html
deleted file mode 100644
index fd58741..0000000
--- a/blt3.0.1/html/barchart.html
+++ /dev/null
@@ -1,2240 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>barchat(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-barchart - Bar chart for plotting X-Y coordinate
-data.
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>barchart<I> <I>pathName </I></I></B>?<I>option value</I>?...
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>barchart</B> command
-creates a bar chart for plotting two-dimensional data (X-Y coordinates). A
-bar chart is a graphic means of comparing numbers by displaying bars of
-lengths proportional to the y-coordinates of the points they represented.
- The bar chart has many configurable components: coordinate axes, elements,
-legend, grid lines, cross hairs, etc. They allow you to customize the look
-and feel of the graph.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-The <B>barchart</B> command creates a new window
-for plotting two-dimensional data (X-Y coordinates), using bars of various
-lengths to represent the data points. The bars are drawn in a rectangular
-area displayed in the center of the new window. This is the <I>plotting area</I>.
- The coordinate axes are drawn in the margins surrounding the plotting
-area. By default, the legend is drawn in the right margin. The title is
-displayed in top margin. <P>
-A <B>barchart</B> widget has several configurable components:
-coordinate axes, data elements, legend, grid, cross hairs, pens, postscript,
-and annotation markers. Each component can be queried or modified.
-<DL>
-
-<DT><I>axis</I>
- </DT>
-<DD><P>
- Up to four coordinate axes (two X-coordinate and two Y-coordinate axes)
-can be displayed, but you can create and use any number of axes. Axes control
-what region of data is displayed and how the data is scaled. Each axis consists
-of the axis line, title, major and minor ticks, and tick labels. Tick labels
-display the value at each major tick. </DD>
-
-<DT><I>crosshairs</I> </DT>
-<DD>Cross hairs are used to
-position the mouse pointer relative to the X and Y coordinate axes. Two
-perpendicular lines, intersecting at the current location of the mouse,
-extend across the plotting area to the coordinate axes. </DD>
-
-<DT><I>element</I> </DT>
-<DD>An element
-represents a set of data to be plotted. It contains an x and y vector of
-values representing the data points. Each data point is displayed as a
-bar where the length of the bar is proportional to the ordinate (Y-coordinate)
-of the data point. The appearance of the bar, such as its color, stipple,
-or relief is configurable. <P>
-A special case exists when two or more data points
-have the same abscissa (X-coordinate). By default, the bars are overlayed,
-one on top of the other. The bars are drawn in the order of the element
-display list. But you can also configure the bars to be displayed in two
-other ways. They may be displayed as a stack, where each bar (with the
-same abscissa) is stacked on the previous. Or they can be drawn side-by-side
-as thin bars. The width of each bar is a function of the number of data
-points with the same abscissa. </DD>
-
-<DT><I>grid</I> </DT>
-<DD>Extends the major and minor ticks of
-the X-axis and/or Y-axis across the plotting area. </DD>
-
-<DT><I>legend</I> </DT>
-<DD>The legend displays
-the name and symbol of each data element. The legend can be drawn in any
-margin or in the plotting area. </DD>
-
-<DT><I>marker</I> </DT>
-<DD>Markers are used annotate or highlight
-areas of the graph. For example, you could use a text marker to label a
-particular data point. Markers come in various forms: text strings, bitmaps,
-connected line segments, images, polygons, or embedded widgets. </DD>
-
-<DT><I>pen</I> </DT>
-<DD>Pens
-define attributes for elements. Data elements use pens to specify how they
-should be drawn. A data element may use many pens at once. Here the particular
-pen used for a data point is determined from each element's weight vector
-(see the element's <B>-weight</B> and <B>-style</B> options). </DD>
-
-<DT><I>postscript</I> </DT>
-<DD>The widget can generate
-encapsulated PostScript output. This component has several options to configure
-how the PostScript is generated. </DD>
-</DL>
-
-<H2><A NAME="sect4" HREF="#toc4">Syntax</A></H2>
-<BR>
-<P>
-<CODE><B>barchart <I>pathName </I></B>?<I>option value</I>?...<BR>
-</CODE><P>The <B>barchart</B> command creates a new window <I>pathName</I> and makes it into a
-<B>barchart</B> widget. At the time this command is invoked, there must not exist
-a window named <I>pathName</I>, but <I>pathName</I>'s parent must exist. Additional options
-may be specified on the command line or in the option database to configure
-aspects of the graph such as its colors and font. See the <B>configure</B> operation
-below for the exact details about what <I>option</I> and <I>value</I> pairs are valid.
-<P>
-If successful, <B>barchart</B> returns the path name of the widget. It also creates
-a new Tcl command by the same name. You can use this command to invoke
-various operations that query or modify the graph. The general form is:
-<BR>
-<P>
-<CODE><I>pathName <I>operation</I></I> ?<I>arg</I>?...<BR>
-</CODE><P>Both <I>operation</I> and its arguments determine the exact behavior of the command.
- The operations available for the graph are described in the <FONT SIZE=-1><B>BARCHART
-OPERATIONS</B></FONT>
- section. <P>
-The command can also be used to access components of
-the graph. <BR>
-<P>
-<CODE><I>pathName component operation</I> ?<I>arg</I>?...<BR>
-</CODE><P>The operation, now located after the name of the component, is the function
-to be performed on that component. Each component has its own set of operations
-that manipulate that component. They will be described below in their own
-sections.
-<H2><A NAME="sect5" HREF="#toc5">Example</A></H2>
-The <B>barchart</B> command creates a new bar chart. <BR>
-<CODE># Create a new bar chart. Plotting area is black.<BR>
-barchart .b -plotbackground black<BR>
-</CODE><P>A new Tcl command <I>.b</I> is created. This command can be used to query and modify
-the bar chart. For example, to change the title of the graph to "My Plot",
-you use the new command and the <B>configure</B> operation. <BR>
-<CODE># Change the title.<BR>
-.b configure -title "My Plot"<BR>
-</CODE><P>To add data elements, you use the command and the <B>element</B> component. <BR>
-<CODE># Create a new element named "e1"<BR>
-.b element create e1 \<BR>
-<tt> </tt> <tt> </tt> -xdata { 1 2 3 4 5 6 7 8 9 10 } \<BR>
-<tt> </tt> <tt> </tt> -ydata { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 <BR>
-<tt> </tt> <tt> </tt> <tt> </tt> <tt> </tt> 155.85 166.60 175.38 }<BR>
-</CODE><P>The element's X-Y coordinates are specified using lists of numbers. Alternately,
-BLT vectors could be used to hold the X-Y coordinates. <BR>
-<CODE># Create two vectors and add them to the barchart.<BR>
-vector xVector yVector<BR>
-xVector set { 1 2 3 4 5 6 7 8 9 10 }<BR>
-yVector set { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 155.85 <BR>
-<tt> </tt> <tt> </tt> 166.60 175.38 }<BR>
-n.b element create e1 -xdata xVector -ydata yVector<BR>
-</CODE><P>The advantage of using vectors is that when you modify one, the graph is
-automatically redrawn to reflect the new values. <BR>
-<CODE># Change the y coordinate of the first point.<BR>
-set yVector(0) 25.18<BR>
-</CODE><P>An element named <I>e1</I> is now created in <I>.b</I>. It is automatically added to
-the display list of elements. You can use this list to control in what
-order elements are displayed. To query or reset the element display list,
-you use the element's <B>show</B> operation. <BR>
-<CODE># Get the current display list <BR>
-set elemList [.b element show]<BR>
-# Remove the first element so it won't be displayed.<BR>
-.b element show [lrange $elemList 0 end]<BR>
-</CODE><P>The element will be displayed by as many bars as there are data points
-(in this case there are ten). The bars will be drawn centered at the x-coordinate
-of the data point. All the bars will have the same attributes (colors,
-stipple, etc). The width of each bar is by default one unit. You can change
-this with using the <B>-barwidth</B> option. <BR>
-<CODE># Change the scale of the x-coordinate data <BR>
-xVector set { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 }<BR>
-# Make sure we change the bar width too.<BR>
-.b configure -barwidth 0.2<BR>
-</CODE><P>The height of each bar is proportional to the ordinate (Y-coordinate) of
-the data point. <P>
-If two or more data points have the same abscissa (X-coordinate
-value), the bars representing those data points may be drawn in various
-ways. The default is to overlay the bars, one on top of the other. The ordering
-is determined from the of element display list. If the stacked mode is
-selected (using the <B>-barmode</B> configuration option), the bars are stacked,
-each bar above the previous. <BR>
-<CODE># Display the elements as stacked.<BR>
-.b configure -barmode stacked<BR>
-</CODE><P>If the aligned mode is selected, the bars having the same x-coordinates
-are displayed side by side. The width of each bar is a fraction of its
-normal width, based upon the number of bars with the same x-coordinate. <BR>
-<CODE># Display the elements side-by-side.<BR>
-.b configure -barmode aligned<BR>
-</CODE><P>By default, the element's label in the legend will be also <I>e1</I>. You can change
-the label, or specify no legend entry, again using the element's <B>configure</B>
-operation. <BR>
-<CODE># Don't display "e1" in the legend.<BR>
-.b element configure e1 -label ""<BR>
-</CODE><P>You can configure more than just the element's label. An element has many
-attributes such as stipple, foreground and background colors, relief, etc.
-<BR>
-<CODE>.b element configure e1 -fg red -bg pink \<BR>
-<tt> </tt> <tt> </tt> -stipple gray50<BR>
-</CODE><P>Four coordinate axes are automatically created: <I>x</I>, <I>x2</I>, <I>y</I>, and <I>y2</I>. And by
-default, elements are mapped onto the axes <I>x</I> and <I>y</I>. This can be changed
-with the <B>-mapx</B> and <B>-mapy</B> options. <BR>
-<CODE># Map "e1" on the alternate y axis "y2".<BR>
-.b element configure e1 -mapy y2<BR>
-</CODE><P>Axes can be configured in many ways too. For example, you change the scale
-of the Y-axis from linear to log using the <B>axis</B> component. <BR>
-<CODE># Y-axis is log scale.<BR>
-.b axis configure y -logscale yes<BR>
-</CODE><P>One important way axes are used is to zoom in on a particular data region.
- Zooming is done by simply specifying new axis limits using the <B>-min</B> and
-<B>-max</B> configuration options. <BR>
-<CODE>.b axis configure x -min 1.0 -max 1.5<BR>
-.b axis configure y -min 12.0 -max 55.15<BR>
-</CODE><P>To zoom interactively, you link the<B>axis configure</B> operations with some
-user interaction (such as pressing the mouse button), using the <B>bind</B> command.
- To convert between screen and graph coordinates, use the <B>invtransform</B>
-operation. <BR>
-<CODE># Click the button to set a new minimum <BR>
-bind .b <ButtonPress-1> { <BR>
- %W axis configure x -min [%W axis invtransform x %x]<BR>
- %W axis configure x -min [%W axis invtransform x %y]<BR>
-}<BR>
-</CODE><P>By default, the limits of the axis are determined from data values. To reset
-back to the default limits, set the <B>-min</B> and <B>-max</B> options to the empty value.
-<BR>
-<CODE># Reset the axes to autoscale again.<BR>
-.b axis configure x -min {} -max {}<BR>
-.b axis configure y -min {} -max {}<BR>
-</CODE><P>By default, the legend is drawn in the right margin. You can change this
-or any legend configuration options using the <B>legend</B> component. <BR>
-<CODE># Configure the legend font, color, and relief<BR>
-.b legend configure -position left -relief raised \<BR>
-<tt> </tt> <tt> </tt> -font fixed -fg blue<BR>
-</CODE><P>To prevent the legend from being displayed, turn on the <B>-hide</B> option. <BR>
-<CODE># Don't display the legend.<BR>
-.b legend configure -hide yes<BR>
-</CODE><P>The <B>barchart</B> has simple drawing procedures called markers. They can be
-used to highlight or annotate data in the graph. The types of markers available
-are bitmaps, polygons, lines, or windows. Markers can be used, for example,
-to mark or brush points. For example there may be a line marker which indicates
-some low-water value. Markers are created using the <B>marker</B> operation. <BR>
-<CODE># Create a line represent the low water mark at 10.0<BR>
-.b marker create line -name "low_water" \<BR>
-<tt> </tt> <tt> </tt> -coords { -Inf 10.0 Inf 10.0 } \<BR>
-<tt> </tt> <tt> </tt> -dashes { 2 4 2 } -fg red -bg blue <BR>
-</CODE><P>This creates a line marker named <I>low_water</I>. It will display a horizontal
-line stretching across the plotting area at the y-coordinate 10.0. The coordinates
-"-Inf" and "Inf" indicate the relative minimum and maximum of the axis (in
-this case the x-axis). By default, markers are drawn last, on top of the
-bars. You can change this with the <B>-under</B> option. <BR>
-<CODE># Draw the marker before elements are drawn.<BR>
-.b marker configure low_water -under yes<BR>
-</CODE><P>You can add cross hairs or grid lines using the <B>crosshairs</B> and <B>grid</B> components.
-<BR>
-<CODE># Display both cross hairs and grid lines.<BR>
-.b crosshairs configure -hide no -color red<BR>
-.b grid configure -hide no -dashes { 2 2 }<BR>
-</CODE><P>Finally, to get hardcopy of the graph, use the <B>postscript</B> component. <BR>
-<CODE># Print the bar chart into file "file.ps"<BR>
-.b postscript output file.ps -maxpect yes -decorations no<BR>
-</CODE><P>This generates a file <I>file.ps</I> containing the encapsulated PostScript of
-the graph. The option <B>-maxpect</B> says to scale the plot to the size of the
-page. Turning off the <B>-decorations</B> option denotes that no borders or color
-backgrounds should be drawn (i.e. the background of the margins, legend,
-and plotting area will be white).
-<H2><A NAME="sect6" HREF="#toc6">Syntax</A></H2>
-<BR>
-<P>
-<CODE><B>barchart <I>pathName </I></B>?<I>option value</I>?...<BR>
-</CODE><P>The <B>barchart</B> command creates a new window <I>pathName</I> and makes it into a
-barchart widget. At the time this command is invoked, there must not exist
-a window named <I>pathName</I>, but <I>pathName</I>'s parent must exist. Additional options
-may may be specified on the command line or in the option database to configure
-aspects of the bar chart such as its colors and font. See the <B>configure</B>
-operation below for the exact details as to what <I>option</I> and <I>value</I> pairs
-are valid. <P>
-If successful, <B>barchart</B> returns <I>pathName</I>. It also creates a new
-Tcl command <I>pathName</I>. This command may be used to invoke various operations
-to query or modify the bar chart. It has the general form: <BR>
-<P>
-<CODE><I>pathName <I>operation</I></I> ?<I>arg</I>?...<BR>
-</CODE><P>Both <I>operation</I> and its arguments determine the exact behavior of the command.
- The operations available for the bar chart are described in the following
-section.
-<H2><A NAME="sect7" HREF="#toc7">Barchart Operations</A></H2>
-
-<DL>
-
-<DT><I>pathName <B>bar <I>elemName </I></B></I>?<I>option value</I>?... </DT>
-<DD>Creates
-a new barchart element <I>elemName</I>. It's an error if an element <I>elemName</I> already
-exists. See the manual for <B>barchart</B> for details about what <I>option</I> and
-<I>value</I> pairs are valid. </DD>
-
-<DT><I>pathName <B>cget</B></I> <I>option</I> </DT>
-<DD>Returns the current value of
-the configuration option given by <I>option</I>. <I>Option</I> may be any option described
-below for the <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>configure </B></I>?<I>option value</I>?... </DT>
-<DD>Queries
-or modifies the configuration options of the graph. If <I>option</I> isn't specified,
-a list describing the current options for <I>pathName</I> is returned. If <I>option</I>
-is specified, but not <I>value</I>, then a list describing <I>option</I> is returned.
-If one or more <I>option</I> and <I>value</I> pairs are specified, then for each pair,
-the option <I>option</I> is set to <I>value</I>. The following options are valid. <blockquote></DD>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Sets the background color. This includes the margins and legend, but
-not the plotting area. </DD>
-
-<DT><B>-barmode <I>mode</I></B> </DT>
-<DD>Indicates how related bar elements
-will be drawn. Related elements have data points with the same abscissas
-(X-coordinates). <I>Mode</I> indicates how those segments should be drawn. <I>Mode</I> can
-be <I>infront</I>, <I>aligned</I>, <I>overlap</I>, or <I>stacked</I>. The default mode is <I>infront</I>. <blockquote></DD>
-
-<DT><I>infront</I>
-</DT>
-<DD>Each successive segment is drawn in front of the previous. </DD>
-
-<DT><I>stacked</I> </DT>
-<DD>Each
-successive segment is stacked vertically on top of the previous. </DD>
-
-<DT><I>aligned</I>
-</DT>
-<DD>Segments is displayed aligned from right-to-left. </DD>
-
-<DT><I>overlap</I> </DT>
-<DD>Like <I>aligned</I> but
-segments slightly overlap each other. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-barwidth <I>value</I></B> </DT>
-<DD>Specifies the width
-of the bars. This value can be overrided by the individual elements using
-their <B>-barwidth</B> configuration option. <I>Value</I> is the width in terms of graph
-coordinates. The default width is <I>1.0</I>. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of the 3-D border around the outside edge of the widget. The <B>-relief</B> option
-determines if the border is to be drawn. The default is <I>2</I>. </DD>
-
-<DT><B>-bottommargin
-<I>pixels</I></B> </DT>
-<DD>Specifies the size of the margin below the X-coordinate axis. If
-<I>pixels</I> is <I>0</I>, the size of the margin is selected automatically. The default
-is <I>0</I>. </DD>
-
-<DT><B>-bufferelements <I>boolean</I></B> </DT>
-<DD>Indicates whether an internal pixmap to buffer
-the display of data elements should be used. If <I>boolean</I> is true, data elements
-are drawn to an internal pixmap. This option is especially useful when
-the graph is redrawn frequently while the remains data unchanged (for example,
-moving a marker across the plot). See the <FONT SIZE=-1><B>SPEED TIPS</B></FONT>
- section. The default
-is <I>1</I>. </DD>
-
-<DT><B>-cursor <I>cursor</I></B> </DT>
-<DD>Specifies the widget's cursor. The default cursor is
-<I>crosshair</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Specifies the font of the graph title. The default
-is <I>*-Helvetica-Bold-R-Normal-*-18-180-*</I>. </DD>
-
-<DT><B>-halo <I>pixels</I></B> </DT>
-<DD>Specifies a maximum distance
-to consider when searching for the closest data point (see the element's
-<B>closest</B> operation below). Data points further than <I>pixels</I> away are ignored.
- The default is <I>0.5i</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B> </DT>
-<DD>Specifies the requested height of widget.
- The default is <I>4i</I>. </DD>
-
-<DT><B>-invertxy <I>boolean</I></B> </DT>
-<DD>Indicates whether the placement X-axis
-and Y-axis should be inverted. If <I>boolean</I> is true, the X and Y axes are
-swapped. The default is <I>0</I>. </DD>
-
-<DT><B>-justify <I>justify</I></B> </DT>
-<DD>Specifies how the title should
-be justified. This matters only when the title contains more than one line
-of text. <I>Justify</I> must be <I>left</I>, <I>right</I>, or <I>center</I>. The default is <I>center</I>. </DD>
-
-<DT><B>-leftmargin
-<I>pixels</I></B> </DT>
-<DD>Sets the size of the margin from the left edge of the window to
- the Y-coordinate axis. If <I>pixels</I> is <I>0</I>, the size is calculated automatically.
- The default is <I>0</I>. </DD>
-
-<DT><B>-plotbackground <I>color</I></B> </DT>
-<DD>Specifies the background color of
-the plotting area. The default is <I>white</I>. </DD>
-
-<DT><B>-plotborderwidth <I>pixels</I></B> </DT>
-<DD>Sets the
-width of the 3-D border around the plotting area. The <B>-plotrelief</B> option
-determines if a border is drawn. The default is <I>2</I>. </DD>
-
-<DT><B>-plotpadx <I>pad</I></B> </DT>
-<DD>Sets the
-amount of padding to be added to the left and right sides of the plotting
-area. <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I> has two
-elements, the left side of the plotting area entry is padded by the first
-distance and the right side by the second. If <I>pad</I> is just one distance,
-both the left and right sides are padded evenly. The default is <I>8</I>. </DD>
-
-<DT><B>-plotpady
-<I>pad</I></B> </DT>
-<DD>Sets the amount of padding to be added to the top and bottom of the
-plotting area. <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I>
-has two elements, the top of the plotting area is padded by the first distance
-and the bottom by the second. If <I>pad</I> is just one distance, both the top
-and bottom are padded evenly. The default is <I>8</I>. </DD>
-
-<DT><B>-plotrelief <I>relief</I></B> </DT>
-<DD>Specifies
-the 3-D effect for the plotting area. <I>Relief</I> specifies how the interior
-of the plotting area should appear relative to rest of the graph; for example,
-<I>raised</I> means the plot should appear to protrude from the graph, relative
-to the surface of the graph. The default is <I>sunken</I>. </DD>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies
-the 3-D effect for the barchart widget. <I>Relief</I> specifies how the graph should
-appear relative to widget it is packed into; for example, <I>raised</I> means
-the graph should appear to protrude. The default is <I>flat</I>. </DD>
-
-<DT><B>-rightmargin <I>pixels</I></B>
-</DT>
-<DD>Sets the size of margin from the plotting area to the right edge of the
-window. By default, the legend is drawn in this margin. If <I>pixels</I> is than
-1, the margin size is selected automatically. </DD>
-
-<DT><B>-takefocus</B> <I>focus</I> </DT>
-<DD>Provides
-information used when moving the focus from window to window via keyboard
-traversal (e.g., Tab and Shift-Tab). If <I>focus</I> is <I>0</I>, this means that this window
-should be skipped entirely during keyboard traversal. <I>1</I> means that the
-this window should always receive the input focus. An empty value means
-that the traversal scripts make the decision whether to focus on the window.
-The default is <I>""</I>. </DD>
-
-<DT><B>-tile <I>image</I></B> </DT>
-<DD>Specifies a tiled background for the widget.
- If <I>image</I> isn't <I>""</I>, the background is tiled using <I>image</I>. Otherwise, the normal
-background color is drawn (see the <B>-background</B> option). <I>Image</I> must be an
-image created using the Tk <B>image</B> command. The default is <I>""</I>. </DD>
-
-<DT><B>-title <I>text</I></B>
- </DT>
-<DD>Sets the title to <I>text</I>. If <I>text</I> is <I>""</I>, no title will be displayed. </DD>
-
-<DT><B>-topmargin
-<I>pixels</I></B> </DT>
-<DD>Specifies the size of the margin above the x2 axis. If <I>pixels</I> is
-<I>0</I>, the margin size is calculated automatically. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Specifies the
-requested width of the widget. The default is <I>5i</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>crosshairs <I>operation
-</I></B></I>?<I>arg</I>? </DT>
-<DD>See the <FONT SIZE=-1><B>CROSSHAIRS COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>element <I>operation
-</I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>ELEMENT COMPONENTS</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>extents <I>item</I></B></I> </DT>
-<DD>Returns
-the size of a particular item in the graph. <I>Item</I> must be either <I>leftmargin</I>,
-<I>rightmargin</I>, <I>topmargin</I>, <I>bottommargin</I>, <I>plotwidth</I>, or <I>plotheight</I>. </DD>
-
-<DT><I>pathName
-<B>grid <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>GRID COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>invtransform
-<I>winX winY</I></B></I> </DT>
-<DD>Performs an inverse coordinate transformation, mapping window
-coordinates back to graph coordinates, using the standard X-axis and Y-axis.
-Returns a list of containing the X-Y graph coordinates. </DD>
-
-<DT><I>pathName <B>inside <I>x
-y</I></B></I> </DT>
-<DD>Returns <I>1</I> is the designated screen coordinate (<I>x</I> and <I>y</I>) is inside the
-plotting area and <I>0</I> otherwise. </DD>
-
-<DT><I>pathName <B>legend <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the
-<FONT SIZE=-1><B>LEGEND COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>line<B> operation arg</B></B></I>... </DT>
-<DD>The operation is
-the same as <B>element</B>. </DD>
-
-<DT><I>pathName <B>marker <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>MARKER COMPONENTS</B></FONT>
-
- section. </DD>
-
-<DT><I>pathName</I> <B>metafile</B> ?<I>fileName</I>? </DT>
-<DD><I>This operation is for Window platforms
-only</I>. Creates a Windows enhanced metafile of the barchart. If present,
-<I>fileName</I> is the file name of the new metafile. Otherwise, the metafile is
-automatically added to the clipboard. </DD>
-
-<DT><I>pathName <B>postscript <I>operation </I></B></I>?<I>arg</I>?...
-</DT>
-<DD>See the <FONT SIZE=-1><B>POSTSCRIPT COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>snap <I>photoName</I></B></I> </DT>
-<DD>Takes a
-snapshot of the graph and stores the contents in the photo image <I>photoName</I>.
- <I>PhotoName</I> is the name of a Tk photo image that must already exist. </DD>
-
-<DT><I>pathName
-<B>transform <I>x y</I></B></I> </DT>
-<DD>Performs a coordinate transformation, mapping graph coordinates
-to window coordinates, using the standard X-axis and Y-axis. Returns a list
-containing the X-Y screen coordinates. </DD>
-
-<DT><I>pathName <B>xaxis <I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName
-<B>x2axis <I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <B>yaxis <I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <B>y2axis
-<I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>AXIS COMPONENTS</B></FONT>
- section. </DD>
-</DL>
-
-<H2><A NAME="sect8" HREF="#toc8">Barchart Components</A></H2>
-A
-graph is composed of several components: coordinate axes, data elements,
-legend, grid, cross hairs, postscript, and annotation markers. Instead of
-one big set of configuration options and operations, the graph is partitioned,
-where each component has its own configuration options and operations that
-specifically control that aspect or part of the graph.
-<H3><A NAME="sect9" HREF="#toc9">Axis Components</A></H3>
-Four
-coordinate axes are automatically created: two X-coordinate axes (<I>x</I> and
-<I>x2</I>) and two Y-coordinate axes (<I>y</I>, and <I>y2</I>). By default, the axis <I>x</I> is located
-in the bottom margin, <I>y</I> in the left margin, <I>x2</I> in the top margin, and <I>y2</I>
-in the right margin. <P>
-An axis consists of the axis line, title, major and
-minor ticks, and tick labels. Major ticks are drawn at uniform intervals
-along the axis. Each tick is labeled with its coordinate value. Minor ticks
-are drawn at uniform intervals within major ticks. <P>
-The range of the axis
-controls what region of data is plotted. Data points outside the minimum
-and maximum limits of the axis are not plotted. By default, the minimum
-and maximum limits are determined from the data, but you can reset either
-limit. <P>
-You can create and use several axes. To create an axis, invoke the
-axis component and its create operation. <BR>
-<CODE># Create a new axis called "temperature"<BR>
-.b axis create temperature<BR>
-</CODE><P>You map data elements to an axis using the element's -mapy and -mapx configuration
-options. They specify the coordinate axes an element is mapped onto. <BR>
-<CODE># Now map the temperature data to this axis.<BR>
-.b element create "temp" -xdata $x -ydata $tempData \<BR>
- -mapy temperature<BR>
-</CODE><P>While you can have many axes, only four axes can be displayed simultaneously.
- They are drawn in each of the margins surrounding the plotting area. The
-axes <I>x</I> and <I>y</I> are drawn in the bottom and left margins. The axes <I>x2</I> and <I>y2</I>
-are drawn in top and right margins. Only <I>x</I> and <I>y</I> are shown by default. Note
-that the axes can have different scales. <P>
-To display a different axis, you
-invoke one of the following components: <B>xaxis</B>, <B>yaxis</B>, <B>x2axis</B>, and <B>y2axis</B>.
-The <B>use</B> operation designates the axis to be drawn in the corresponding
-margin: <B>xaxis</B> in the bottom, <B>yaxis</B> in the left, <B>x2axis</B> in the top, and
-<B>y2axis</B> in the right. <BR>
-<CODE># Display the axis temperature in the left margin.<BR>
-.b yaxis use temperature<BR>
-<P>
-</CODE><P>You can configure axes in many ways. The axis scale can be linear or logarithmic.
- The values along the axis can either monotonically increase or decrease.
- If you need custom tick labels, you can specify a Tcl procedure to format
-the label any way you wish. You can control how ticks are drawn, by changing
-the major tick interval or the number of minor ticks. You can define non-uniform
-tick intervals, such as for time-series plots. <P>
-
-<DL>
-
-<DT><I>pathName <B>axis <B>cget <I>axisName
-<I>option</I></I></B></B></I> </DT>
-<DD>Returns the current value of the option given by <I>option</I> for <I>axisName</I>.
- <I>Option</I> may be any option described below for the axis <B>configure</B> operation.
-</DD>
-
-<DT><I>pathName <B>axis <B>configure <I>axisName </I></B></B></I>?<I>axisName</I>?... ?<I>option value</I>?... </DT>
-<DD>Queries or modifies
-the configuration options of <I>axisName</I>. Several axes can be changed. If <I>option</I>
-isn't specified, a list describing all the current options for <I>axisName</I>
-is returned. If <I>option</I> is specified, but not <I>value</I>, then a list describing
-<I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs are specified,
-then for each pair, the axis option <I>option</I> is set to <I>value</I>. The following
-options are valid for axes. <blockquote></DD>
-
-<DT><B>-autorange <I>range</I></B> </DT>
-<DD>Sets the range of values for
-the axis to <I>range</I>. The axis limits are automatically reset to display the
-most recent data points in this range. If <I>range</I> is 0.0, the range is determined
-from the limits of the data. If <B>-min</B> or <B>-max</B> are specified, they override
-this option. The default is <I>0.0</I>. </DD>
-
-<DT><B>-color <I>color</I></B> </DT>
-<DD>Sets the color of the axis and
-tick labels. The default is <I>black</I>. </DD>
-
-<DT><B>-command <I>prefix</I></B> </DT>
-<DD>Specifies a Tcl command
-to be invoked when formatting the axis tick labels. <I>Prefix</I> is a string containing
-the name of a Tcl proc and any extra arguments for the procedure. This
-command is invoked for each major tick on the axis. Two additional arguments
-are passed to the procedure: the pathname of the widget and the current
-the numeric value of the tick. The procedure returns the formatted tick
-label. If <I>""</I> is returned, no label will appear next to the tick. You can
-get the standard tick labels again by setting <I>prefix</I> to <I>""</I>. The default
-is <I>""</I>. <P>
-Please note that this procedure is invoked while the bar chart is
-redrawn. You may query the widget's configuration options. But do not reset
-options, because this can have unexpected results. </DD>
-
-<DT><B>-descending <I>boolean</I></B> </DT>
-<DD>Indicates
-whether the values along the axis are monotonically increasing or decreasing.
- If <I>boolean</I> is true, the axis values will be decreasing. The default is
-<I>0</I>. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether the axis is displayed. </DD>
-
-<DT><B>-justify <I>justify</I></B>
-</DT>
-<DD>Specifies how the axis title should be justified. This matters only when
-the axis title contains more than one line of text. <I>Justify</I> must be <I>left</I>,
-<I>right</I>, or <I>center</I>. The default is <I>center</I>. </DD>
-
-<DT><B>-limits <I>formatStr</I></B> </DT>
-<DD>Specifies a printf-like
-description to format the minimum and maximum limits of the axis. The limits
-are displayed at the top/bottom or left/right sides of the plotting area.
- <I>FormatStr</I> is a list of one or two format descriptions. If one description
-is supplied, both the minimum and maximum limits are formatted in the same
-way. If two, the first designates the format for the minimum limit, the
-second for the maximum. If <I>""</I> is given as either description, then the
-that limit will not be displayed. The default is <I>""</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets
-the width of the axis and tick lines. The default is <I>1</I> pixel. </DD>
-
-<DT><B>-logscale <I>boolean</I></B>
-</DT>
-<DD>Indicates whether the scale of the axis is logarithmic or linear. If <I>boolean</I>
-is true, the axis is logarithmic. The default scale is linear. </DD>
-
-<DT><B>-loose <I>boolean</I></B>
-</DT>
-<DD>Indicates whether the limits of the axis should fit the data points tightly,
-at the outermost data points, or loosely, at the outer tick intervals. This
-is relevant only when the axis limit is automatically calculated. If <I>boolean</I>
-is true, the axis range is "loose". The default is <I>0</I>. </DD>
-
-<DT><B>-majorticks <I>majorList</I></B>
-</DT>
-<DD>Specifies where to display major axis ticks. You can use this option to
-display ticks at non-uniform intervals. <I>MajorList</I> is a list of axis coordinates
-designating the location of major ticks. No minor ticks are drawn. If <I>majorList</I>
-is <I>""</I>, major ticks will be automatically computed. The default is <I>""</I>. </DD>
-
-<DT><B>-max
-<I>value</I></B> </DT>
-<DD>Sets the maximum limit of <I>axisName</I>. Any data point greater than
-<I>value</I> is not displayed. If <I>value</I> is <I>""</I>, the maximum limit is calculated
-using the largest data value. The default is <I>""</I>. </DD>
-
-<DT><B>-min <I>value</I></B> </DT>
-<DD>Sets the minimum
-limit of <I>axisName</I>. Any data point less than <I>value</I> is not displayed. If
-<I>value</I> is <I>""</I>, the minimum limit is calculated using the smallest data value.
-The default is <I>""</I>. </DD>
-
-<DT><B>-minorticks <I>minorList</I></B> </DT>
-<DD>Specifies where to display minor
-axis ticks. You can use this option to display minor ticks at non-uniform
-intervals. <I>MinorList</I> is a list of real values, ranging from 0.0 to 1.0, designating
-the placement of a minor tick. No minor ticks are drawn if the <B>-majortick</B>
-option is also set. If <I>minorList</I> is <I>""</I>, minor ticks will be automatically
-computed. The default is <I>""</I>. </DD>
-
-<DT><B>-rotate <I>theta</I></B> </DT>
-<DD>Specifies the how many degrees
-to rotate the axis tick labels. <I>Theta</I> is a real value representing the number
-of degrees to rotate the tick labels. The default is <I>0.0</I> degrees. </DD>
-
-<DT><B>-shiftby
-<I>value</I></B> </DT>
-<DD>Specifies how much to automatically shift the range of the axis. When
-the new data exceeds the current axis maximum, the maximum is increased
-in increments of <I>value</I>. You can use this option to prevent the axis limits
-from being recomputed at each new time point. If <I>value</I> is 0.0, then no automatic
-shifting is down. The default is <I>0.0</I>. </DD>
-
-<DT><B>-showticks <I>boolean</I></B> </DT>
-<DD>Indicates whether
-axis ticks should be drawn. If <I>boolean</I> is true, ticks are drawn. If false,
-only the axis line is drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-stepsize <I>value</I></B> </DT>
-<DD>Specifies the
-interval between major axis ticks. If <I>value</I> isn't a valid interval (must
-be less than the axis range), the request is ignored and the step size
-is automatically calculated. </DD>
-
-<DT><B>-subdivisions <I>number</I></B> </DT>
-<DD>Indicates how many minor
-axis ticks are to be drawn. For example, if <I>number</I> is two, only one minor
-tick is drawn. If <I>number</I> is one, no minor ticks are displayed. The default
-is <I>2</I>. </DD>
-
-<DT><B>-tickfont <I>fontName</I></B> </DT>
-<DD>Specifies the font for axis tick labels. The default
-is <I>*-Courier-Bold-R-Normal-*-100-*</I>. </DD>
-
-<DT><B>-ticklength <I>pixels</I></B> </DT>
-<DD>Sets the length of major
-and minor ticks (minor ticks are half the length of major ticks). If <I>pixels</I>
-is less than zero, the axis will be inverted with ticks drawn pointing
-towards the plot. The default is <I>0.1i</I>. </DD>
-
-<DT><B>-title <I>text</I></B> </DT>
-<DD>Sets the title of the axis.
-If <I>text</I> is <I>""</I>, no axis title will be displayed. </DD>
-
-<DT><B>-titlecolor <I>color</I></B> </DT>
-<DD>Sets
-the color of the axis title. The default is <I>black</I>. </DD>
-
-<DT><B>-titlefont <I>fontName</I></B> </DT>
-<DD>Specifies
-the font for axis title. The default is <I>*-Helvetica-Bold-R-Normal-*-14-140-*</I>. </DD>
-</DL>
-<P>
-Axis
-configuration options may be also be set by the <B>option</B> command. The resource
-class is <I>Axis</I>. The resource names are the names of the axes (such as <I>x</I>
-or <I>x2</I>). <BR>
-<CODE>option add *Barchart.Axis.Color blue<BR>
-option add *Barchart.x.LogScale true<BR>
-option add *Barchart.x2.LogScale false<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>axis <B>create <I>axisName </I></B></B></I>?<I>option value</I>?... </DT>
-<DD>Creates a new axis by the
-name <I>axisName</I>. No axis by the same name can already exist. <I>Option</I> and <I>value</I>
-are described in above in the axis <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>axis <B>delete
-</B></B></I>?<I>axisName</I>?... </DT>
-<DD>Deletes the named axes. An axis is not really deleted until it
-is not longer in use, so it's safe to delete axes mapped to elements. </DD>
-
-<DT><I>pathName
-<B>axis invtransform <I>axisName value</I></B></I> </DT>
-<DD>Performs the inverse transformation, changing
-the screen coordinate <I>value</I> to a graph coordinate, mapping the value mapped
-to <I>axisName</I>. Returns the graph coordinate. </DD>
-
-<DT><I>pathName <B>axis limits <I>axisName</I></B></I>
-</DT>
-<DD>Returns a list of the minimum and maximum limits for <I>axisName</I>. The order
-of the list is <I>min max</I>. </DD>
-
-<DT><I>pathName <B>axis names </B></I>?<I>pattern</I>?... </DT>
-<DD>Returns a list of
-axes matching zero or more patterns. If no <I>pattern</I> argument is give, the
-names of all axes are returned. </DD>
-
-<DT><I>pathName <B>axis transform <I>axisName value</I></B></I> </DT>
-<DD>Transforms
-the coordinate <I>value</I> to a screen coordinate by mapping the it to <I>axisName</I>.
- Returns the transformed screen coordinate. </DD>
-</DL>
-<P>
-Only four axes can be displayed
-simultaneously. By default, they are <I>x</I>, <I>y</I>, <I>x2</I>, and <I>y2</I>. You can swap in
-a different axis with <B>use</B> operation of the special axis components: <B>xaxis</B>,
-<B>x2axis</B>, <B>yaxis</B>, and <B>y2axis</B>. <BR>
-<CODE>.g create axis temp<BR>
-.g create axis time<BR>
-...<BR>
-.g xaxis use temp<BR>
-.g yaxis use time<BR>
-</CODE><P>Only the axes specified for use are displayed on the screen. <P>
-The <B>xaxis</B>,
-<B>x2axis</B>, <B>yaxis</B>, and <B>y2axis</B> components operate on an axis location rather
-than a specific axis like the more general <B>axis</B> component does. The <B>xaxis</B>
-component manages the X-axis located in the bottom margin (whatever axis
-that happens to be). Likewise, <B>yaxis</B> uses the Y-axis in the left margin,
-<B>x2axis</B> the top X-axis, and <B>y2axis</B> the right Y-axis. <P>
-They implicitly control
-the axis that is currently using to that location. By default, <B>xaxis</B> uses
-the <I>x</I> axis, <B>yaxis</B> uses <I>y</I>, <B>x2axis</B> uses <I>x2</I>, and <B>y2axis</B> uses <I>y2</I>. These components
-can be more convenient to use than always determining what axes are current
-being displayed by the graph. <P>
-The following operations are available for
-axes. They mirror exactly the operations of the <B>axis</B> component. The <I>axis</I>
-argument must be <B>xaxis</B>, <B>x2axis</B>, <B>yaxis</B>, or <B>y2axis</B>.
-<DL>
-
-<DT><I>pathName <I>axis <B>cget <I>option</I></B></I></I>
-</DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis <B>configure </B></I></I>?<I>option value</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis<B> invtransform <I>value</I></B></I></I>
-</DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis <B>limits</B></I></I> </DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis<B> transform <I>value</I></B></I></I> </DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis<B> use </B></I></I>?<I>axisName</I>?
- </DT>
-<DD>Designates the axis <I>axisName</I> is to be displayed at this location. <I>AxisName</I>
-can not be already in use at another location. This command returns the
-name of the axis currently using this location. </DD>
-</DL>
-
-<H3><A NAME="sect10" HREF="#toc10">Crosshairs Component</A></H3>
-Cross
-hairs consist of two intersecting lines (one vertical and one horizontal)
-drawn completely across the plotting area. They are used to position the
-mouse in relation to the coordinate axes. Cross hairs differ from line
-markers in that they are implemented using XOR drawing primitives. This
-means that they can be quickly drawn and erased without redrawing the entire
-widget. <P>
-The following operations are available for cross hairs:
-<DL>
-
-<DT><I>pathName
-<B>crosshairs cget <I>option</I></B></I> </DT>
-<DD>Returns the current value of the cross hairs configuration
-option given by <I>option</I>. <I>Option</I> may be any option described below for the
-cross hairs <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>crosshairs configure </B></I>?<I>option value</I>?...
- </DT>
-<DD>Queries or modifies the configuration options of the cross hairs. If
-<I>option</I> isn't specified, a list describing all the current options for the
-cross hairs is returned. If <I>option</I> is specified, but not <I>value</I>, then a
-list describing <I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs
-are specified, then for each pair, the cross hairs option <I>option</I> is set
-to <I>value</I>. The following options are available for cross hairs. <blockquote></DD>
-
-<DT><B>-color <I>color</I></B>
- </DT>
-<DD>Sets the color of the cross hairs. The default is <I>black</I>. </DD>
-
-<DT><B>-dashes <I>dashList</I></B>
-</DT>
-<DD>Sets the dash style of the cross hairs. <I>DashList</I> is a list of up to 11 numbers
-that alternately represent the lengths of the dashes and gaps on the cross
-hair lines. Each number must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the
-cross hairs will be solid lines. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether cross hairs
-are drawn. If <I>boolean</I> is true, cross hairs are not drawn. The default is
-<I>yes</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Set the width of the cross hair lines. The default
-is <I>1</I>. </DD>
-
-<DT><B>-position <I>pos</I></B> </DT>
-<DD>Specifies the screen position where the cross hairs
-intersect. <I>Pos</I> must be in the form "<I>@x,y</I>", where <I>x</I> and <I>y</I> are the window
-coordinates of the intersection. </DD>
-</DL>
-<P>
-Cross hairs configuration options may be
-also be set by the <B>option</B> command. The resource name and class are <I>crosshairs</I>
-and <I>Crosshairs</I> respectively. <BR>
-<CODE>option add *Barchart.Crosshairs.LineWidth 2<BR>
-option add *Barchart.Crosshairs.Color red<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>crosshairs off</B></I> </DT>
-<DD>Turns off the cross hairs. </DD>
-
-<DT><I>pathName <B>crosshairs
-on</B></I> </DT>
-<DD>Turns on the display of the cross hairs. </DD>
-
-<DT><I>pathName <B>crosshairs toggle</B></I>
-</DT>
-<DD>Toggles the current state of the cross hairs, alternately mapping and unmapping
-the cross hairs. </DD>
-</DL>
-
-<H2><A NAME="sect11" HREF="#toc11">Elements</A></H2>
-A data element represents a set of data. It contains
-x and y vectors which are the coordinates of the data points. Elements
-are displayed as bars where the length of the bar is proportional to the
-ordinate of the data point. Elements also control the appearance of the
-data, such as the color, stipple, relief, etc. <P>
-When new data elements are
-created, they are automatically added to a list of displayed elements.
- The display list controls what elements are drawn and in what order.
-<P>
-The following operations are available for elements.
-<DL>
-
-<DT><I>pathName <B>element activate
-<I>elemName </I></B></I>?<I>index</I>?... </DT>
-<DD>Specifies the data points of element <I>elemName</I> to be drawn
-using active foreground and background colors. <I>ElemName</I> is the name of
-the element and <I>index</I> is a number representing the index of the data point.
-If no indices are present then all data points become active. </DD>
-
-<DT><I>pathName <B>element
-bind <I>tagName</I></B></I> ?<I>sequence</I>? ?<I>command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I> such
-that whenever the event sequence given by <I>sequence</I> occurs for an element
-with this tag, <I>command</I> will be invoked. The syntax is similar to the <B>bind</B>
-command except that it operates on graph elements, rather than widgets.
-See the <B>bind</B> manual entry for complete details on <I>sequence</I> and the substitutions
-performed on <I>command</I> before invoking it. <P>
-If all arguments are specified
-then a new binding is created, replacing any existing binding for the
-same <I>sequence</I> and <I>tagName</I>. If the first character of <I>command</I> is <I>+</I> then <I>command</I>
- augments an existing binding rather than replacing it. If no <I>command</I> argument
-is provided then the command currently associated with <I>tagName</I> and <I>sequence</I>
-(it's an error occurs if there's no such binding) is returned. If both <I>command</I>
-and <I>sequence</I> are missing then a list of all the event sequences for which
-bindings have been defined for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>element cget <I>elemName
-<I>option</I></I></B></I> </DT>
-<DD>Returns the current value of the element configuration option given
-by <I>option</I>. <I>Option</I> may be any of the options described below for the element
-<B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>element closest <I>x y</I></B></I> ?<I>option value</I>?... ?<I>elemName</I>?...
-</DT>
-<DD>Finds the data point representing the bar closest to the window coordinates
-<I>x</I> and <I>y</I> in the element <I>elemName</I>. <I>ElemName</I> is the name of an element, which
-must be displayed. If no elements are specified, then all displayed elements
-are searched. It returns a list containing the name of the closest element,
-the index of its closest point, and the graph coordinates of the point.
-If no data point within the threshold distance can be found, <I>""</I> is returned.
- The following <I>option</I>-<I>value</I> pairs are available. <blockquote></DD>
-
-<DT><B>-halo <I>pixels</I></B> </DT>
-<DD>Specifies a
-threshold distance where selected data points are ignored. <I>Pixels</I> is a valid
-screen distance, such as <I>2</I> or <I>1.2i</I>. If this option isn't specified, then it
-defaults to the value of the <B>barchart</B>'s <B>-halo</B> option. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>element configure
-<I>elemName </I></B></I>?<I>elemName</I>... ?<I>option value</I>?... </DT>
-<DD>Queries or modifies the configuration
-options for elements. Several elements can be modified at the same time.
-If <I>option</I> isn't specified, a list describing all the current options for
-<I>elemName</I> is returned. If <I>option</I> is specified, but not <I>value</I>, then a list
-describing the option <I>option</I> is returned. If one or more <I>option</I> and <I>value</I>
-pairs are specified, then for each pair, the element option <I>option</I> is set
-to <I>value</I>. The following options are valid for elements. <blockquote></DD>
-
-<DT><B>-activepen <I>penName</I></B>
-</DT>
-<DD>Specifies pen to use to draw active element. If <I>penName</I> is <I>""</I>, no active
-elements will be drawn. The default is <I>activeLine</I>. </DD>
-
-<DT><B>-bindtags <I>tagList</I></B> </DT>
-<DD>Specifies
-the binding tags for the element. <I>TagList</I> is a list of binding tag names.
- The tags and their order will determine how events for elements. Each
-tag in the list matching the current event sequence will have its Tcl command
-executed. Implicitly the name of the element is always the first tag in
-the list. The default value is <I>all</I>. </DD>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets the the color
-of the border around each bar. The default is <I>white</I>. </DD>
-
-<DT><B>-barwidth <I>value</I></B> </DT>
-<DD>Specifies
-the width the bars drawn for the element. <I>Value</I> is the width in X-coordinates.
- If this option isn't specified, the width of each bar is the value of the
-widget's <B>-barwidth</B> option. </DD>
-
-<DT><B>-baseline <I>value</I></B> </DT>
-<DD>Specifies the baseline of the bar
-segments. This affects how bars are drawn since bars are drawn from their
-respective y-coordinate the baseline. By default the baseline is <I>0.0</I>. </DD>
-
-<DT><B>-borderwidth
-<I>pixels</I></B> </DT>
-<DD>Sets the border width of the 3-D border drawn around the outside
-of each bar. The <B>-relief</B> option determines if such a border is drawn. <I>Pixels</I>
-must be a valid screen distance like <I>2</I> or <I>0.25i</I>. The default is <I>2</I>. </DD>
-
-<DT><B>-data <I>coordList</I></B>
-</DT>
-<DD>Specifies the X-Y coordinates of the data. <I>CoordList</I> is a list of numeric
-expressions representing the X-Y coordinate pairs of each data point. </DD>
-
-<DT><B>-foreground
-<I>color</I></B> </DT>
-<DD>Sets the color of the interior of the bars. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates
-whether the element is displayed. The default is <I>no</I>. </DD>
-
-<DT><B>-label <I>text</I></B> </DT>
-<DD>Sets the
-element's label in the legend. If <I>text</I> is <I>""</I>, the element will have no entry
-in the legend. The default label is the element's name. </DD>
-
-<DT><B>-mapx <I>xAxis</I></B> </DT>
-<DD>Selects
-the X-axis to map the element's X-coordinates onto. <I>XAxis</I> must be the name
-of an axis. The default is <I>x</I>. </DD>
-
-<DT><B>-mapy <I>yAxis</I></B> </DT>
-<DD>Selects the Y-axis to map the element's
-Y-coordinates onto. <I>YAxis</I> must be the name of an axis. The default is <I>y</I>. </DD>
-
-<DT><B>-relief
-<I>string</I></B> </DT>
-<DD>Specifies the 3-D effect desired for bars. <I>Relief</I> indicates how the
-interior of the bar should appear relative to the surface of the chart;
-for example, <I>raised</I> means the bar should appear to protrude from the surface
-of the plotting area. The default is <I>raised</I>. </DD>
-
-<DT><B>-stipple <I>bitmap</I></B> </DT>
-<DD>Specifies a
-stipple pattern with which to draw the bars. If <I>bitmap</I> is <I>""</I>, then the
-bar is drawn in a solid fashion. </DD>
-
-<DT><B>-xdata <I>xVector</I></B> </DT>
-<DD>Specifies the x-coordinate
-vector of the data. <I>XVector</I> is the name of a BLT vector or a list of numeric
-expressions. </DD>
-
-<DT><B>-ydata <I>yVector</I></B> </DT>
-<DD>Specifies the y-coordinate vector of the data.
-<I>YVector</I> is the name of a BLT vector or a list of numeric expressions.
-</DD>
-</DL>
-<P>
-Element configuration options may also be set by the <B>option</B> command. The
-resource names in the option database are prefixed by <I>elem</I>. <BR>
-<CODE>option add *Barchart.Element.background blue<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>element create <I>elemName</I></B></I> ?<I>option value</I>?... </DT>
-<DD>Creates a new element <I>elemName</I>.
- Element names must be unique, so an element <I>elemName</I> may not already exist.
- If additional arguments are present, they specify any of the element options
-valid for element <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>element deactivate <I>pattern</I></B></I>...
-</DT>
-<DD>Deactivates all the elements matching <I>pattern</I> for the graph. Elements
-whose names match any of the patterns given are redrawn using their normal
-colors. </DD>
-
-<DT><I>pathName <B>element delete</B></I> ?<I>pattern</I>?... </DT>
-<DD>Deletes all the elements matching
-<I>pattern</I> for the graph. Elements whose names match any of the patterns
-given are deleted. The graph will be redrawn without the deleted elements.
- </DD>
-
-<DT><I>pathName <B>element exists <I>elemName</I></B></I> </DT>
-<DD>Returns <I>1</I> if an element <I>elemName</I> currently
-exists and <I>0</I> otherwise. </DD>
-
-<DT><I>pathName <B>element names </B></I>?<I>pattern</I>?... </DT>
-<DD>Returns the elements
-matching one or more pattern. If no <I>pattern</I> is given, the names of all
-elements is returned. </DD>
-
-<DT><I>pathName <B>element show</B></I> ?<I>nameList</I>? </DT>
-<DD>Queries or modifies
-the element display list. The element display list designates the elements
-drawn and in what order. <I>NameList</I> is a list of elements to be displayed
-in the order they are named. If there is no <I>nameList</I> argument, the current
-display list is returned. </DD>
-
-<DT><I>pathName <B>element type</B></I> <I>elemName</I> </DT>
-<DD>Returns the type
-of <I>elemName</I>. If the element is a bar element, the commands returns the
-string <I>"bar"</I>, otherwise it returns <I>"line"</I>. </DD>
-</DL>
-
-<H3><A NAME="sect12" HREF="#toc12"></CODE><P>Grid Component</A></H3>
-Grid lines extend
-from the major and minor ticks of each axis horizontally or vertically
-across the plotting area. The following operations are available for grid
-lines.
-<DL>
-
-<DT><I>pathName <B>grid cget <I>option</I></B></I> </DT>
-<DD>Returns the current value of the grid line
-configuration option given by <I>option</I>. <I>Option</I> may be any option described
-below for the grid <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>grid configure</B></I> ?<I>option
-value</I>?... </DT>
-<DD>Queries or modifies the configuration options for grid lines. If
-<I>option</I> isn't specified, a list describing all the current grid options for
-<I>pathName</I> is returned. If <I>option</I> is specified, but not <I>value</I>, then a list
-describing <I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs are
-specified, then for each pair, the grid line option <I>option</I> is set to <I>value</I>.
- The following options are valid for grid lines. <blockquote></DD>
-
-<DT><B>-color <I>color</I></B> </DT>
-<DD>Sets the color
-of the grid lines. The default is <I>black</I>. </DD>
-
-<DT><B>-dashes <I>dashList</I></B> </DT>
-<DD>Sets the dash style
-of the grid lines. <I>DashList</I> is a list of up to 11 numbers that alternately
-represent the lengths of the dashes and gaps on the grid lines. Each number
-must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the grid will be solid lines.
-</DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether the grid should be drawn. If <I>boolean</I> is true,
-grid lines are not shown. The default is <I>yes</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of grid lines. The default width is <I>1</I>. </DD>
-
-<DT><B>-mapx <I>xAxis</I></B> </DT>
-<DD>Specifies the X-axis to
-display grid lines. <I>XAxis</I> must be the name of an axis or <I>""</I> for no grid
-lines. The default is <I>""</I>. </DD>
-
-<DT><B>-mapy <I>yAxis</I></B> </DT>
-<DD>Specifies the Y-axis to display grid
-lines. <I>YAxis</I> must be the name of an axis or <I>""</I> for no grid lines. The default
-is <I>y</I>. </DD>
-
-<DT><B>-minor <I>boolean</I></B> </DT>
-<DD>Indicates whether the grid lines should be drawn for
-minor ticks. If <I>boolean</I> is true, the lines will appear at minor tick intervals.
- The default is <I>1</I>. </DD>
-</DL>
-<P>
-Grid configuration options may also be set by the <B>option</B>
-command. The resource name and class are <I>grid</I> and <I>Grid</I> respectively. <BR>
-<CODE>option add *Barchart.grid.LineWidth 2<BR>
-option add *Barchart.Grid.Color black<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>grid off</B></I> </DT>
-<DD>Turns off the display the grid lines. </DD>
-
-<DT><I>pathName <B>grid on</B></I>
-</DT>
-<DD>Turns on the display the grid lines. </DD>
-
-<DT><I>pathName <B>grid toggle</B></I> </DT>
-<DD>Toggles the display
-of the grid. </DD>
-</DL>
-
-<H3><A NAME="sect13" HREF="#toc13">Legend Component</A></H3>
-The legend displays a list of the data elements.
- Each entry consists of the element's symbol and label. The legend can appear
-in any margin (the default location is in the right margin). It can also
-be positioned anywhere within the plotting area. <P>
-The following operations
-are valid for the legend.
-<DL>
-
-<DT><I>pathName <B>legend activate <I>pattern</I></B></I>... </DT>
-<DD>Selects legend
-entries to be drawn using the active legend colors and relief. All entries
-whose element names match <I>pattern</I> are selected. To be selected, the element
-name must match only one <I>pattern</I>. </DD>
-
-<DT><I>pathName <B>legend bind <I>tagName</I></B></I> ?<I>sequence</I>?
- ?<I>command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I> such that whenever the event
-sequence given by <I>sequence</I> occurs for a legend entry with this tag, <I>command</I>
-will be invoked. Implicitly the element names in the entry are tags. The
-syntax is similar to the <B>bind</B> command except that it operates on legend
-entries, rather than widgets. See the <B>bind</B> manual entry for complete details
-on <I>sequence</I> and the substitutions performed on <I>command</I> before invoking
-it. <P>
-If all arguments are specified then a new binding is created, replacing
- any existing binding for the same <I>sequence</I> and <I>tagName</I>. If the first character
-of <I>command</I> is <I>+</I> then <I>command</I> augments an existing binding rather than
-replacing it. If no <I>command</I> argument is provided then the command currently
-associated with <I>tagName</I> and <I>sequence</I> (it's an error occurs if there's no
-such binding) is returned. If both <I>command</I> and <I>sequence</I> are missing then
-a list of all the event sequences for which bindings have been defined
-for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>legend cget <I>option</I></B></I> </DT>
-<DD>Returns the current value of a
-legend configuration option. <I>Option</I> may be any option described below in
-the legend <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>legend configure </B></I>?<I>option value</I>?...
-</DT>
-<DD>Queries or modifies the configuration options for the legend. If <I>option</I>
-isn't specified, a list describing the current legend options for <I>pathName</I>
-is returned. If <I>option</I> is specified, but not <I>value</I>, then a list describing
-<I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs are specified,
-then for each pair, the legend option <I>option</I> is set to <I>value</I>. The following
-options are valid for the legend. <blockquote></DD>
-
-<DT><B>-activebackground <I>color</I></B> </DT>
-<DD>Sets the background
-color for active legend entries. All legend entries marked active (see
-the legend <B>activate</B> operation) are drawn using this background color. </DD>
-
-<DT><B>-activeborderwidth
-<I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around the outside edge of the active
-legend entries. The default is <I>2</I>. </DD>
-
-<DT><B>-activeforeground <I>color</I></B> </DT>
-<DD>Sets the foreground
-color for active legend entries. All legend entries marked as active (see
-the legend <B>activate</B> operation) are drawn using this foreground color. </DD>
-
-<DT><B>-activerelief
-<I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect desired for active legend entries. <I>Relief</I>
-denotes how the interior of the entry should appear relative to the legend;
-for example, <I>raised</I> means the entry should appear to protrude from the
-legend, relative to the surface of the legend. The default is <I>flat</I>. </DD>
-
-<DT><B>-anchor
-<I>anchor</I></B> </DT>
-<DD>Tells how to position the legend relative to the positioning point
-for the legend. This is dependent on the value of the <B>-position</B> option.
-The default is <I>center</I>. <blockquote></DD>
-
-<DT><I>left</I> or <I>right</I> </DT>
-<DD>The anchor describes how to position
-the legend vertically. </DD>
-
-<DT><I>top</I> or <I>bottom</I> </DT>
-<DD>The anchor describes how to position
-the legend horizontally. </DD>
-
-<DT><I>@x,y</I> </DT>
-<DD>The anchor specifies how to position the
-legend relative to the positioning point. For example, if <I>anchor</I> is <I>center</I>
-then the legend is centered on the point; if <I>anchor</I> is <I>n</I> then the legend
-will be drawn such that the top center point of the rectangular region
-occupied by the legend will be at the positioning point. </DD>
-
-<DT><I>plotarea</I> </DT>
-<DD>The anchor
-specifies how to position the legend relative to the plotting area. For
-example, if <I>anchor</I> is <I>center</I> then the legend is centered in the plotting
-area; if <I>anchor</I> is <I>ne</I> then the legend will be drawn such that occupies
-the upper right corner of the plotting area. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets the background
-color of the legend. If <I>color</I> is <I>""</I>, the legend background with be transparent.
-</DD>
-
-<DT><B>-bindtags <I>tagList</I></B> </DT>
-<DD>Specifies the binding tags for legend entries. <I>TagList</I>
-is a list of binding tag names. The tags and their order will determine
-how events for legend entries. Each tag in the list matching the current
- event sequence will have its Tcl command executed. The default value is
-<I>all</I>. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around the outside
-edge of the legend (if such border is being drawn; the <B>relief</B> option determines
-this). The default is <I>2</I> pixels. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD><I>FontName</I> specifies a font
-to use when drawing the labels of each element into the legend. The default
-is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets the foreground color
-of the text drawn for the element's label. The default is <I>black</I>. </DD>
-
-<DT><B>-hide <I>boolean</I></B>
-</DT>
-<DD>Indicates whether the legend should be displayed. If <I>boolean</I> is true, the
-legend will not be draw. The default is <I>no</I>. </DD>
-
-<DT><B>-ipadx <I>pad</I></B> </DT>
-<DD>Sets the amount of
-internal padding to be added to the width of each legend entry. <I>Pad</I> can
-be a list of one or two screen distances. If <I>pad</I> has two elements, the
-left side of the legend entry is padded by the first distance and the right
-side by the second. If <I>pad</I> is just one distance, both the left and right
-sides are padded evenly. The default is <I>2</I>. </DD>
-
-<DT><B>-ipady <I>pad</I></B> </DT>
-<DD>Sets an amount of internal
-padding to be added to the height of each legend entry. <I>Pad</I> can be a list
-of one or two screen distances. If <I>pad</I> has two elements, the top of the
-entry is padded by the first distance and the bottom by the second. If
-<I>pad</I> is just one distance, both the top and bottom of the entry are padded
-evenly. The default is <I>2</I>. </DD>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets the padding to the left and right
-exteriors of the legend. <I>Pad</I> can be a list of one or two screen distances.
- If <I>pad</I> has two elements, the left side of the legend is padded by the
-first distance and the right side by the second. If <I>pad</I> has just one distance,
-both the left and right sides are padded evenly. The default is <I>4</I>. </DD>
-
-<DT><B>-pady
-<I>pad</I></B> </DT>
-<DD>Sets the padding above and below the legend. <I>Pad</I> can be a list of one
-or two screen distances. If <I>pad</I> has two elements, the area above the legend
-is padded by the first distance and the area below by the second. If <I>pad</I>
-is just one distance, both the top and bottom areas are padded evenly.
-The default is <I>0</I>. </DD>
-
-<DT><B>-position <I>pos</I></B> </DT>
-<DD>Specifies where the legend is drawn. The <B>-anchor</B>
-option also affects where the legend is positioned. If <I>pos</I> is <I>left</I>, <I>left</I>,
-<I>top</I>, or <I>bottom</I>, the legend is drawn in the specified margin. If <I>pos</I> is
-<I>plotarea</I>, then the legend is drawn inside the plotting area at a particular
-anchor. If <I>pos</I> is in the form "<I>@x,y</I>", where <I>x</I> and <I>y</I> are the window coordinates,
-the legend is drawn in the plotting area at the specified coordinates.
-The default is <I>right</I>. </DD>
-
-<DT><B>-raised <I>boolean</I></B> </DT>
-<DD>Indicates whether the legend is above
-or below the data elements. This matters only if the legend is in the plotting
-area. If <I>boolean</I> is true, the legend will be drawn on top of any elements
-that may overlap it. The default is <I>no</I>. </DD>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect
-for the border around the legend. <I>Relief</I> specifies how the interior of the
-legend should appear relative to the bar chart; for example, <I>raised</I> means
-the legend should appear to protrude from the bar chart, relative to the
-surface of the bar chart. The default is <I>sunken</I>. </DD>
-</DL>
-<P>
-Legend configuration options
-may also be set by the <B>option</B> command. The resource name and class are
-<I>legend</I> and <I>Legend</I> respectively. <BR>
-<CODE>option add *Barchart.legend.Foreground blue<BR>
-option add *Barchart.Legend.Relief raised<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>legend deactivate <I>pattern</I></B></I>... </DT>
-<DD>Selects legend entries to be drawn using
-the normal legend colors and relief. All entries whose element names match
-<I>pattern</I> are selected. To be selected, the element name must match only
-one <I>pattern</I>. </DD>
-
-<DT><I>pathName <B>legend get <I>pos</I></B></I> </DT>
-<DD>Returns the name of the element whose
-entry is at the screen position <I>pos</I> in the legend. <I>Pos</I> must be in the form
-"<I>@x,y</I>", where <I>x</I> and <I>y</I> are window coordinates. If the given coordinates
-do not lie over a legend entry, <I>""</I> is returned. </DD>
-</DL>
-
-<H3><A NAME="sect14" HREF="#toc14">Pen Components</A></H3>
-Pens define
-attributes for elements. Pens mirror the configuration options of data elements
-that pertain to how symbols and lines are drawn. Data elements use pens
-to determine how they are drawn. A data element may use several pens at
-once. In this case, the pen used for a particular data point is determined
-from each element's weight vector (see the element's <B>-weight</B> and <B>-style</B> options).
-<P>
-One pen, called <I>activeBar</I>, is automatically created. It's used as the default
-active pen for elements. So you can change the active attributes for all
-elements by simply reconfiguring this pen. <BR>
-<CODE>.g pen configure "activeBar" -fg green -bg green4<BR>
-</CODE><P>You can create and use several pens. To create a pen, invoke the pen component
-and its create operation. <BR>
-<CODE>.g pen create myPen<BR>
-</CODE><P>You map pens to a data element using either the element's <B>-pen</B> or <B>-activepen</B>
-options. <BR>
-<CODE>.g element create "e1" -xdata $x -ydata $tempData \<BR>
- -pen myPen<BR>
-</CODE><P>An element can use several pens at once. This is done by specifying the
-name of the pen in the element's style list (see the <B>-styles</B> option). <BR>
-<CODE>.g element configure "e1" -styles { myPen 2.0 3.0 }<BR>
-</CODE><P>This says that any data point with a weight between 2.0 and 3.0 is to be
-drawn using the pen <I>myPen</I>. All other points are drawn with the element's
-default attributes. <P>
-The following operations are available for pen components.
-<P>
-
-<DL>
-
-<DT><I>pathName <B>pen <B>cget <I>penName <I>option</I></I></B></B></I> </DT>
-<DD>Returns the current value of the option
-given by <I>option</I> for <I>penName</I>. <I>Option</I> may be any option described below for
-the pen <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>pen <B>configure <I>penName </I></B></B></I>?<I>penName</I>... ?<I>option
-value</I>?... </DT>
-<DD>Queries or modifies the configuration options of <I>penName</I>. Several
-pens can be modified at once. If <I>option</I> isn't specified, a list describing
-the current options for <I>penName</I> is returned. If <I>option</I> is specified, but
-not <I>value</I>, then a list describing <I>option</I> is returned. If one or more <I>option</I>
-and <I>value</I> pairs are specified, then for each pair, the pen option <I>option</I>
-is set to <I>value</I>. The following options are valid for pens. <blockquote></DD>
-
-<DT><B>-background <I>color</I></B>
-</DT>
-<DD>Sets the the color of the border around each bar. The default is <I>white</I>.
-</DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the border width of the 3-D border drawn around
-the outside of each bar. The <B>-relief</B> option determines if such a border
-is drawn. <I>Pixels</I> must be a valid screen distance like <I>2</I> or <I>0.25i</I>. The default
-is <I>2</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets the color of the interior of the bars. </DD>
-
-<DT><B>-relief
-<I>string</I></B> </DT>
-<DD>Specifies the 3-D effect desired for bars. <I>Relief</I> indicates how the
-interior of the bar should appear relative to the surface of the chart;
-for example, <I>raised</I> means the bar should appear to protrude from the bar
-chart, relative to the surface of the plotting area. The default is <I>raised</I>.
-</DD>
-
-<DT><B>-stipple <I>bitmap</I></B> </DT>
-<DD>Specifies a stipple pattern with which to draw the bars.
- If <I>bitmap</I> is <I>""</I>, then the bar is drawn in a solid fashion. </DD>
-
-<DT><B>-type <I>elemType</I></B>
- </DT>
-<DD>Specifies the type of element the pen is to be used with. This option should
-only be employed when creating the pen. This is for those that wish to
-mix different types of elements (bars and lines) on the same graph. The
-default type is "bar". </DD>
-</DL>
-<P>
-Pen configuration options may be also be set by the
-<B>option</B> command. The resource class is <I>Pen</I>. The resource names are the names
-of the pens. <BR>
-<CODE>option add *Barchart.Pen.Foreground<tt> </tt> <tt> </tt> blue<BR>
-option add *Barchart.activeBar.foreground green<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>pen <B>create <I>penName </I></B></B></I>?<I>option value</I>?... </DT>
-<DD>Creates a new pen by the name
-<I>penName</I>. No pen by the same name can already exist. <I>Option</I> and <I>value</I> are
-described in above in the pen <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>pen <B>delete
-</B></B></I>?<I>penName</I>?... </DT>
-<DD>Deletes the named pens. A pen is not really deleted until it is
-not longer in use, so it's safe to delete pens mapped to elements. </DD>
-
-<DT><I>pathName
-<B>pen names </B></I>?<I>pattern</I>?... </DT>
-<DD>Returns a list of pens matching zero or more patterns.
- If no <I>pattern</I> argument is give, the names of all pens are returned. </DD>
-</DL>
-
-<H3><A NAME="sect15" HREF="#toc15">PostScript
-Component</A></H3>
-The barchart can generate encapsulated PostScript output. There
-are several configuration options you can specify to control how the plot
-will be generated. You can change the page dimensions and borders. The
-plot itself can be scaled, centered, or rotated to landscape. The PostScript
-output can be written directly to a file or returned through the interpreter.
-<P>
-The following postscript operations are available.
-<DL>
-
-<DT><I>pathName <B>postscript cget
-<I>option</I></B></I> </DT>
-<DD>Returns the current value of the postscript option given by <I>option</I>.
- <I>Option</I> may be any option described below for the postscript <B>configure</B>
-operation. </DD>
-
-<DT><I>pathName <B>postscript configure </B></I>?<I>option value</I>?... </DT>
-<DD>Queries or modifies
-the configuration options for PostScript generation. If <I>option</I> isn't specified,
-a list describing the current postscript options for <I>pathName</I> is returned.
- If <I>option</I> is specified, but not <I>value</I>, then a list describing <I>option</I> is
-returned. If one or more <I>option</I> and <I>value</I> pairs are specified, then for
-each pair, the postscript option <I>option</I> is set to <I>value</I>. The following
-postscript options are available. <blockquote></DD>
-
-<DT><B>-center <I>boolean</I></B> </DT>
-<DD>Indicates whether the plot
-should be centered on the PostScript page. If <I>boolean</I> is false, the plot
-will be placed in the upper left corner of the page. The default is <I>1</I>. </DD>
-
-<DT><B>-colormap
-<I>varName</I></B> </DT>
-<DD><I>VarName</I> must be the name of a global array variable that specifies
-a color mapping from the X color name to PostScript. Each element of <I>varName</I>
-must consist of PostScript code to set a particular color value (e.g. ``<I>1.0
-1.0 0.0 setrgbcolor</I>''). When generating color information in PostScript, the
-array variable <I>varName</I> is checked if an element of the name as the color
-exists. If so, it uses its value as the PostScript command to set the color.
- If this option hasn't been specified, or if there isn't an entry in <I>varName</I>
-for a given color, then it uses the red, green, and blue intensities from
-the X color. </DD>
-
-<DT><B>-colormode <I>mode</I></B> </DT>
-<DD>Specifies how to output color information. <I>Mode</I>
-must be either <I>color</I> (for full color output), <I>gray</I> (convert all colors
-to their gray-scale equivalents) or <I>mono</I> (convert foreground colors to black
-and background colors to white). The default mode is <I>color</I>. </DD>
-
-<DT><B>-fontmap <I>varName</I></B>
-</DT>
-<DD><I>VarName</I> must be the name of a global array variable that specifies a font
-mapping from the X font name to PostScript. Each element of <I>varName</I> must
-consist of a Tcl list with one or two elements; the name and point size
-of a PostScript font. When outputting PostScript commands for a particular
-font, the array variable <I>varName</I> is checked to see if an element by the
- specified font exists. If there is such an element, then the font information
-contained in that element is used in the PostScript output. (If the point
-size is omitted from the list, the point size of the X font is used). Otherwise
-the X font is examined in an attempt to guess what PostScript font to use.
- This works only for fonts whose foundry property is <I>Adobe</I> (such as Times,
-Helvetica, Courier, etc.). If all of this fails then the font defaults to
-<I>Helvetica-Bold</I>. </DD>
-
-<DT><B>-decorations <I>boolean</I></B> </DT>
-<DD>Indicates whether PostScript commands
-to generate color backgrounds and 3-D borders will be output. If <I>boolean</I>
-is false, the graph will background will be white and no 3-D borders will
-be generated. The default is <I>1</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B> </DT>
-<DD>Sets the height of the plot.
- This lets you print the bar chart with a height different from the one
-drawn on the screen. If <I>pixels</I> is 0, the height is the same as the widget's
-height. The default is <I>0</I>. </DD>
-
-<DT><B>-landscape <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, this specifies
-the printed area is to be rotated 90 degrees. In non-rotated output the
-X-axis of the printed area runs along the short dimension of the page (``portrait''
-orientation); in rotated output the X-axis runs along the long dimension
-of the page (``landscape'' orientation). Defaults to <I>0</I>. </DD>
-
-<DT><B>-maxpect <I>boolean</I></B> </DT>
-<DD>Indicates
-to scale the plot so that it fills the PostScript page. The aspect ratio
-of the barchart is still retained. The default is <I>0</I>. </DD>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets the horizontal
-padding for the left and right page borders. The borders are exterior to
-the plot. <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I> has
-two elements, the left border is padded by the first distance and the right
-border by the second. If <I>pad</I> has just one distance, both the left and right
-borders are padded evenly. The default is <I>1i</I>. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets the vertical
-padding for the top and bottom page borders. The borders are exterior to
-the plot. <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I> has
-two elements, the top border is padded by the first distance and the bottom
-border by the second. If <I>pad</I> has just one distance, both the top and bottom
-borders are padded evenly. The default is <I>1i</I>. </DD>
-
-<DT><B>-paperheight <I>pixels</I></B> </DT>
-<DD>Sets the
-height of the postscript page. This can be used to select between different
-page sizes (letter, A4, etc). The default height is <I>11.0i</I>. </DD>
-
-<DT><B>-paperwidth <I>pixels</I></B>
-</DT>
-<DD>Sets the width of the postscript page. This can be used to select between
-different page sizes (letter, A4, etc). The default width is <I>8.5i</I>. </DD>
-
-<DT><B>-width
-<I>pixels</I></B> </DT>
-<DD>Sets the width of the plot. This lets you generate a plot of a width
-different from that of the widget. If <I>pixels</I> is 0, the width is the same
-as the widget's width. The default is <I>0</I>. </DD>
-</DL>
-<P>
-Postscript configuration options
-may be also be set by the <B>option</B> command. The resource name and class are
-<I>postscript</I> and <I>Postscript</I> respectively. <BR>
-<CODE>option add *Barchart.postscript.Decorations false<BR>
-option add *Barchart.Postscript.Landscape true<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>postscript output </B></I>?<I>fileName</I>? ?<I>option value</I>?... </DT>
-<DD>Outputs a file of
-encapsulated PostScript. If a <I>fileName</I> argument isn't present, the command
-returns the PostScript. If any <I>option-value</I> pairs are present, they set configuration
-options controlling how the PostScript is generated. <I>Option</I> and <I>value</I> can
-be anything accepted by the postscript <B>configure</B> operation above. </DD>
-</DL>
-
-<H3><A NAME="sect16" HREF="#toc16">Marker
-Components</A></H3>
-Markers are simple drawing procedures used to annotate or highlight
-areas of the graph. Markers have various types: text strings, bitmaps,
-images, connected lines, windows, or polygons. They can be associated with
-a particular element, so that when the element is hidden or un-hidden, so
-is the marker. By default, markers are the last items drawn, so that data
-elements will appear in behind them. You can change this by configuring
-the <B>-under</B> option. <P>
-Markers, in contrast to elements, don't affect the scaling
-of the coordinate axes. They can also have <I>elastic</I> coordinates (specified
-by <I>-Inf</I> and <I>Inf</I> respectively) that translate into the minimum or maximum
-limit of the axis. For example, you can place a marker so it always remains
-in the lower left corner of the plotting area, by using the coordinates
-<I>-Inf</I>,<I>-Inf</I>. <P>
-The following operations are available for markers.
-<DL>
-
-<DT><I>pathName <B>marker
-after <I>markerId</I></B></I> ?<I>afterId</I>? </DT>
-<DD>Changes the order of the markers, drawing the
-first marker after the second. If no second <I>afterId</I> argument is specified,
-the marker is placed at the end of the display list. This command can be
-used to control how markers are displayed since markers are drawn in the
-order of this display list. </DD>
-
-<DT><I>pathName <B>marker before <I>markerId</I></B></I> ?<I>beforeId</I>? </DT>
-<DD>Changes
-the order of the markers, drawing the first marker before the second. If
-no second <I>beforeId</I> argument is specified, the marker is placed at the beginning
-of the display list. This command can be used to control how markers are
-displayed since markers are drawn in the order of this display list. </DD>
-
-<DT><I>pathName
-<B>marker bind <I>tagName</I></B></I> ?<I>sequence</I>? ?<I>command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I>
-such that whenever the event sequence given by <I>sequence</I> occurs for a marker
-with this tag, <I>command</I> will be invoked. The syntax is similar to the <B>bind</B>
-command except that it operates on graph markers, rather than widgets.
-See the <B>bind</B> manual entry for complete details on <I>sequence</I> and the substitutions
-performed on <I>command</I> before invoking it. <P>
-If all arguments are specified
-then a new binding is created, replacing any existing binding for the
-same <I>sequence</I> and <I>tagName</I>. If the first character of <I>command</I> is <I>+</I> then <I>command</I>
- augments an existing binding rather than replacing it. If no <I>command</I> argument
-is provided then the command currently associated with <I>tagName</I> and <I>sequence</I>
-(it's an error occurs if there's no such binding) is returned. If both <I>command</I>
-and <I>sequence</I> are missing then a list of all the event sequences for which
-bindings have been defined for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>marker cget <I>option</I></B></I> </DT>
-<DD>Returns
-the current value of the marker configuration option given by <I>option</I>. <I>Option</I>
-may be any option described below in the <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>marker
-configure <I>markerId</I></B></I> ?<I>option value</I>?... </DT>
-<DD>Queries or modifies the configuration
-options for markers. If <I>option</I> isn't specified, a list describing the current
-options for <I>markerId</I> is returned. If <I>option</I> is specified, but not <I>value</I>,
-then a list describing <I>option</I> is returned. If one or more <I>option</I> and <I>value</I>
-pairs are specified, then for each pair, the marker option <I>option</I> is set
-to <I>value</I>. <P>
-The following options are valid for all markers. Each type of marker
-also has its own type-specific options. They are described in the sections
-below. <blockquote></DD>
-
-<DT><B>-bindtags <I>tagList</I></B> </DT>
-<DD>Specifies the binding tags for the marker. <I>TagList</I>
-is a list of binding tag names. The tags and their order will determine
-how events for markers are handled. Each tag in the list matching the
-current event sequence will have its Tcl command executed. Implicitly
-the name of the marker is always the first tag in the list. The default
-value is <I>all</I>. </DD>
-
-<DT><B>-coords <I>coordList</I></B> </DT>
-<DD>Specifies the coordinates of the marker.
-<I>CoordList</I> is a list of graph coordinates. The number of coordinates required
-is dependent on the type of marker. Text, image, and window markers need
-only two coordinates (an X-Y coordinate). Bitmap markers can take either
-two or four coordinates (if four, they represent the corners of the bitmap).
-Line markers need at least four coordinates, polygons at least six. If <I>coordList</I>
-is <I>""</I>, the marker will not be displayed. The default is <I>""</I>. </DD>
-
-<DT><B>-element <I>elemName</I></B>
-</DT>
-<DD>Links the marker with the element <I>elemName</I>. The marker is drawn only if
-the element is also currently displayed (see the element's <B>show</B> operation).
- If <I>elemName</I> is <I>""</I>, the marker is always drawn. The default is <I>""</I>. </DD>
-
-<DT><B>-hide
-<I>boolean</I></B> </DT>
-<DD>Indicates whether the marker is drawn. If <I>boolean</I> is true, the
-marker is not drawn. The default is <I>no</I>. </DD>
-
-<DT><B>-mapx <I>xAxis</I></B> </DT>
-<DD>Specifies the X-axis
-to map the marker's X-coordinates onto. <I>XAxis</I> must the name of an axis. The
-default is <I>x</I>. </DD>
-
-<DT><B>-mapy <I>yAxis</I></B> </DT>
-<DD>Specifies the Y-axis to map the marker's Y-coordinates
-onto. <I>YAxis</I> must the name of an axis. The default is <I>y</I>. </DD>
-
-<DT><B>-name <I>markerId</I></B> </DT>
-<DD>Changes
-the identifier for the marker. The identifier <I>markerId</I> can not already
-be used by another marker. If this option isn't specified, the marker's name
-is uniquely generated. </DD>
-
-<DT><B>-under <I>boolean</I></B> </DT>
-<DD>Indicates whether the marker is drawn
-below/above data elements. If <I>boolean</I> is true, the marker is be drawn underneath
-the data elements. Otherwise, the marker is drawn on top of the element.
- The default is <I>0</I>. </DD>
-
-<DT><B>-xoffset <I>pixels</I></B> </DT>
-<DD>Specifies a screen distance to offset
-the marker horizontally. <I>Pixels</I> is a valid screen distance, such as <I>2</I> or
-<I>1.2i</I>. The default is <I>0</I>. </DD>
-
-<DT><B>-yoffset <I>pixels</I></B> </DT>
-<DD>Specifies a screen distance to offset
-the markers vertically. <I>Pixels</I> is a valid screen distance, such as <I>2</I> or
-<I>1.2i</I>. The default is <I>0</I>. </DD>
-</DL>
-<P>
-Marker configuration options may also be set by the
-<B>option</B> command. The resource class is either <I>BitmapMarker</I>, <I>ImageMarker</I>,
- <I>LineMarker</I>, <I>PolygonMarker</I>, <I>TextMarker</I>, or <I>WindowMarker</I>, depending on the
-type of marker. The resource name is the name of the marker. <BR>
-<CODE>option add *Barchart.TextMarker.Foreground white<BR>
-option add *Barchart.BitmapMarker.Foreground white<BR>
-option add *Barchart.m1.Background blue<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>marker create <I>type</I></B></I> ?<I>option value</I>?... </DT>
-<DD>Creates a marker of the selected
-type. <I>Type</I> may be either <I>text</I>, <I>line</I>, <I>bitmap</I>, <I>image</I>, <I>polygon</I>, or <I>window</I>.
-This command returns the marker identifier, used as the <I>markerId</I> argument
-in the other marker-related commands. If the <B>-name</B> option is used, this overrides
-the normal marker identifier. If the name provided is already used for
-another marker, the new marker will replace the old. </DD>
-
-<DT><I>pathName <B>marker delete</B></I>
-?<I>name</I>?... </DT>
-<DD>Removes one of more markers. The graph will automatically be redrawn
-without the marker.. </DD>
-
-<DT><I>pathName <B>marker exists <I>markerId</I></B></I> </DT>
-<DD>Returns <I>1</I> if the
-marker <I>markerId</I> exists and <I>0</I> otherwise. </DD>
-
-<DT><I>pathName <B>marker names</B></I> ?<I>pattern</I>?
- </DT>
-<DD>Returns the names of all the markers that currently exist. If <I>pattern</I>
-is supplied, only those markers whose names match it will be returned. </DD>
-
-<DT><I>pathName
-<B>marker type <I>markerId</I></B></I> </DT>
-<DD>Returns the type of the marker given by <I>markerId</I>,
-such as <I>line</I> or <I>text</I>. If <I>markerId</I> is not a valid a marker identifier, <I>""</I>
-is returned. </DD>
-</DL>
-
-<H3><A NAME="sect17" HREF="#toc17">Bitmap Markers</A></H3>
-A bitmap marker displays a bitmap. The size of
-the bitmap is controlled by the number of coordinates specified. If two
-coordinates, they specify the position of the top-left corner of the bitmap.
- The bitmap retains its normal width and height. If four coordinates, the
-first and second pairs of coordinates represent the corners of the bitmap.
- The bitmap will be stretched or reduced as necessary to fit into the bounding
-rectangle. <P>
-Bitmap markers are created with the marker's <B>create</B> operation
-in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create bitmap </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration options
-for the marker. These same <I>option</I>-<I>value</I> pairs may be used with the marker's
-<B>configure</B> operation. <P>
-The following options are specific to bitmap markers:
-
-<DL>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Same as the <B>-fill</B> option. </DD>
-
-<DT><B>-bitmap <I>bitmap</I></B> </DT>
-<DD>Specifies the bitmap
-to be displayed. If <I>bitmap</I> is <I>""</I>, the marker will not be displayed. The
-default is <I>""</I>. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the background color of the bitmap. If <I>color</I>
-is the empty string, no background will be transparent. The default background
-color is <I>""</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Same as the <B>-outline</B> option. </DD>
-
-<DT><B>-mask <I>mask</I></B> </DT>
-<DD>Specifies
-a mask for the bitmap to be displayed. This mask is a bitmap itself, denoting
-the pixels that are transparent. If <I>mask</I> is <I>""</I>, all pixels of the bitmap
-will be drawn. The default is <I>""</I>. </DD>
-
-<DT><B>-outline <I>color</I></B> </DT>
-<DD>Sets the foreground color
-of the bitmap. The default value is <I>black</I>. </DD>
-
-<DT><B>-rotate <I>theta</I></B> </DT>
-<DD>Sets the rotation
-of the bitmap. <I>Theta</I> is a real number representing the angle of rotation
-in degrees. The marker is first rotated and then placed according to its
-anchor position. The default rotation is <I>0.0</I>. </DD>
-</DL>
-
-<H3><A NAME="sect18" HREF="#toc18">Image Markers</A></H3>
-A image marker
-displays an image. Image markers are created with the marker's <B>create</B> operation
-in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create image </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option for
-the marker. These same <I>option</I>-<I>value</I> pairs may be used with the marker's <B>configure</B>
-operation. <P>
-The following options are specific to image markers:
-<DL>
-
-<DT><B>-anchor <I>anchor</I></B>
-</DT>
-<DD><I>Anchor</I> tells how to position the image relative to the positioning point
-for the image. For example, if <I>anchor</I> is <I>center</I> then the image is centered
-on the point; if <I>anchor</I> is <I>n</I> then the image will be drawn such that the
-top center point of the rectangular region occupied by the image will be
-at the positioning point. This option defaults to <I>center</I>. </DD>
-
-<DT><B>-image <I>image</I></B> </DT>
-<DD>Specifies
-the image to be drawn. If <I>image</I> is <I>""</I>, the marker will not be drawn. The
-default is <I>""</I>. </DD>
-</DL>
-
-<H3><A NAME="sect19" HREF="#toc19">Line Markers</A></H3>
-A line marker displays one or more connected
-line segments. Line markers are created with marker's <B>create</B> operation in
-the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create line </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option for
-the marker. These same <I>option</I>-<I>value</I> pairs may be used with the marker's <B>configure</B>
-operation. <P>
-The following options are specific to line markers:
-<DL>
-
-<DT><B>-dashes <I>dashList</I></B>
-</DT>
-<DD>Sets the dash style of the line. <I>DashList</I> is a list of up to 11 numbers
-that alternately represent the lengths of the dashes and gaps on the line.
- Each number must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the marker line
-will be solid. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the background color of the line. This color
-is used with striped lines (see the <B>-fdashesR option). If <I>color</I></B> is the empty
-string, no background color is drawn (the line will be dashed, not striped).
- The default background color is <I>""</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width of
-the lines. The default width is <I>0</I>. </DD>
-
-<DT><B>-outline <I>color</I></B> </DT>
-<DD>Sets the foreground color
-of the line. The default value is <I>black</I>. </DD>
-
-<DT><B>-stipple <I>bitmap</I></B> </DT>
-<DD>Specifies a stipple
-pattern used to draw the line, rather than a solid line. <I>Bitmap</I> specifies
-a bitmap to use as the stipple pattern. If <I>bitmap</I> is <I>""</I>, then the line
-is drawn in a solid fashion. The default is <I>""</I>. </DD>
-</DL>
-
-<H3><A NAME="sect20" HREF="#toc20">Polygon Markers</A></H3>
-A polygon
-marker displays a closed region described as two or more connected line
-segments. It is assumed the first and last points are connected. Polygon
-markers are created using the marker <B>create</B> operation in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create polygon </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option for
-the marker. These same <I>option</I>-<I>value</I> pairs may be used with the <B>marker configure</B>
-command to change the marker's configuration. The following options are supported
-for polygon markers:
-<DL>
-
-<DT><B>-dashes <I>dashList</I></B> </DT>
-<DD>Sets the dash style of the outline
-of the polygon. <I>DashList</I> is a list of up to 11 numbers that alternately
-represent the lengths of the dashes and gaps on the outline. Each number
-must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the outline will be a solid
-line. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the fill color of the polygon. If <I>color</I> is <I>""</I>, then
-the interior of the polygon is transparent. The default is <I>white</I>. </DD>
-
-<DT><B>-linewidth
-<I>pixels</I></B> </DT>
-<DD>Sets the width of the outline of the polygon. If <I>pixels</I> is zero,
- no outline is drawn. The default is <I>0</I>. </DD>
-
-<DT><B>-outline <I>color</I></B> </DT>
-<DD>Sets the color of the
-outline of the polygon. If the polygon is stippled (see the <B>-stipple</B> option),
-then this represents the foreground color of the stipple. The default is
-<I>black</I>. </DD>
-
-<DT><B>-stipple <I>bitmap</I></B> </DT>
-<DD>Specifies that the polygon should be drawn with a
-stippled pattern rather than a solid color. <I>Bitmap</I> specifies a bitmap to
-use as the stipple pattern. If <I>bitmap</I> is <I>""</I>, then the polygon is filled
-with a solid color (if the <B>-fill</B> option is set). The default is <I>""</I>. </DD>
-</DL>
-
-<H3><A NAME="sect21" HREF="#toc21">Text
-Markers</A></H3>
-A text marker displays a string of characters on one or more lines
-of text. Embedded newlines cause line breaks. They may be used to annotate
-regions of the graph. Text markers are created with the <B>create</B> operation
-in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create text </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option
-for the text marker. These same <I>option</I>-<I>value</I> pairs may be used with the
- marker's <B>configure</B> operation. <P>
-The following options are specific to text
-markers:
-<DL>
-
-<DT><B>-anchor <I>anchor</I></B> </DT>
-<DD><I>Anchor</I> tells how to position the text relative to
-the positioning point for the text. For example, if <I>anchor</I> is <I>center</I> then
-the text is centered on the point; if <I>anchor</I> is <I>n</I> then the text will be
-drawn such that the top center point of the rectangular region occupied
-by the text will be at the positioning point. This default is <I>center</I>. </DD>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Same as the <B>-fill</B> option. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Specifies the font of the text.
- The default is <I>*-Helvetica-Bold-R-Normal-*-120-*</I>. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the background
-color of the text. If <I>color</I> is the empty string, no background will be
-transparent. The default background color is <I>""</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Same as
-the <B>-outline</B> option. </DD>
-
-<DT><B>-justify <I>justify</I></B> </DT>
-<DD>Specifies how the text should be justified.
- This matters only when the marker contains more than one line of text.
-<I>Justify</I> must be <I>left</I>, <I>right</I>, or <I>center</I>. The default is <I>center</I>. </DD>
-
-<DT><B>-outline <I>color</I></B>
-</DT>
-<DD>Sets the color of the text. The default value is <I>black</I>. </DD>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets the
-padding to the left and right exteriors of the text. <I>Pad</I> can be a list of
-one or two screen distances. If <I>pad</I> has two elements, the left side of
-the text is padded by the first distance and the right side by the second.
- If <I>pad</I> has just one distance, both the left and right sides are padded
-evenly. The default is <I>4</I>. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets the padding above and below the
-text. <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I> has two
-elements, the area above the text is padded by the first distance and the
-area below by the second. If <I>pad</I> is just one distance, both the top and
-bottom areas are padded evenly. The default is <I>4</I>. </DD>
-
-<DT><B>-rotate <I>theta</I></B> </DT>
-<DD>Specifies
-the number of degrees to rotate the text. <I>Theta</I> is a real number representing
-the angle of rotation. The marker is first rotated along its center and
-is then drawn according to its anchor position. The default is <I>0.0</I>. </DD>
-
-<DT><B>-text <I>text</I></B>
-</DT>
-<DD>Specifies the text of the marker. The exact way the text is displayed may
-be affected by other options such as <B>-anchor</B> or <B>-rotate</B>. </DD>
-</DL>
-
-<H3><A NAME="sect22" HREF="#toc22">Window Markers</A></H3>
-A window
-marker displays a widget at a given position. Window markers are created
-with the marker's <B>create</B> operation in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create window </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option for
-the marker. These same <I>option</I>-<I>value</I> pairs may be used with the marker's <B>configure</B>
-command. <P>
-The following options are specific to window markers:
-<DL>
-
-<DT><B>-anchor <I>anchor</I></B>
-</DT>
-<DD><I>Anchor</I> tells how to position the widget relative to the positioning point
-for the widget. For example, if <I>anchor</I> is <I>center</I> then the widget is centered
-on the point; if <I>anchor</I> is <I>n</I> then the widget will be displayed such that
-the top center point of the rectangular region occupied by the widget will
-be at the positioning point. This option defaults to <I>center</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B>
-</DT>
-<DD>Specifies the height to assign to the marker's window. If this option isn't
-specified, or if it is specified as <I>""</I>, then the window is given whatever
-height the widget requests internally. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Specifies the width
-to assign to the marker's window. If this option isn't specified, or if it
-is specified as <I>""</I>, then the window is given whatever width the widget
-requests internally. </DD>
-
-<DT><B>-window <I>pathName</I></B> </DT>
-<DD>Specifies the widget to be managed
-by the barchart. <I>PathName</I> must be a child of the <B>barchart</B> widget. </DD>
-</DL>
-
-<H2><A NAME="sect23" HREF="#toc23">Graph
-Component Bindings</A></H2>
-Specific barchart components, such as elements, markers
-and legend entries, can have a command trigger when event occurs in them,
-much like canvas items in Tk's canvas widget. Not all event sequences are
-valid. The only binding events that may be specified are those related
-to the mouse and keyboard (such as <B>Enter</B>, <B>Leave</B>, <B>ButtonPress</B>, <B>Motion</B>, and
-<B>KeyPress</B>). <P>
-Only one element or marker can be picked during an event. This
-means, that if the mouse is directly over both an element and a marker,
-only the uppermost component is selected. This isn't true for legend entries.
- Both a legend entry and an element (or marker) binding commands will
-be invoked if both items are picked. <P>
-It is possible for multiple bindings
-to match a particular event. This could occur, for example, if one binding
-is associated with the element name and another is associated with one
-of the element's tags (see the <B>-bindtags</B> option). When this occurs, all of
-the matching bindings are invoked. A binding associated with the element
-name is invoked first, followed by one binding for each of the element's
- bindtags. If there are multiple matching bindings for a single tag, then
-only the most specific binding is invoked. A continue command in a binding
-script terminates that script, and a break command terminates that script
-and skips any remaining scripts for the event, just as for the bind command.
-<P>
-The <B>-bindtags</B> option for these components controls addition tag names which
-can be matched. Implicitly elements and markers always have tags matching
-their names. Setting the value of the <B>-bindtags</B> option doesn't change this.
-
-<H2><A NAME="sect24" HREF="#toc24">C Language API</A></H2>
-You can manipulate data elements from the C language. There
-may be situations where it is too expensive to translate the data values
-from ASCII strings. Or you might want to read data in a special file format.
-<P>
-Data can manipulated from the C language using BLT vectors. You specify
-the X-Y data coordinates of an element as vectors and manipulate the vector
-from C. The barchart will be redrawn automatically after the vectors are
-updated. <P>
-From Tcl, create the vectors and configure the element to use them.
-<BR>
-<CODE>vector X Y<BR>
-.g element configure line1 -xdata X -ydata Y<BR>
-</CODE><P>To set data points from C, you pass the values as arrays of doubles using
-the <B>Blt_ResetVector</B> call. The vector is reset with the new data and at
-the next idle point (when Tk re-enters its event loop), the graph will be
-redrawn automatically. <BR>
-<CODE>#include <tcl.h><BR>
-#include <blt.h><BR>
-<P>
-register int i;<BR>
-Blt_Vector *xVec, *yVec;<BR>
-double x[50], y[50];<BR>
-<P>
-/* Get the BLT vectors "X" and "Y" (created above from Tcl) */<BR>
-if ((Blt_GetVector(interp, "X", 50, &xVec) != TCL_OK) ||<BR>
- (Blt_GetVector(interp, "Y", 50, &yVec) != TCL_OK)) {<BR>
- return TCL_ERROR;<BR>
-}<BR>
-<P>
-for (i = 0; i < 50; i++) {<BR>
- x[i] = i * 0.02;<BR>
- y[i] = sin(x[i]);<BR>
-}<tt> </tt> <tt> </tt> <BR>
-<P>
-/* Put the data into BLT vectors */<BR>
-if ((Blt_ResetVector(xVec, x, 50, 50, TCL_VOLATILE) != TCL_OK) ||<BR>
- (Blt_ResetVector(yVec, y, 50, 50, TCL_VOLATILE) != TCL_OK)) {<BR>
- return TCL_ERROR;<BR>
-}<BR>
-</CODE><P>See the <B>vector</B> manual page for more details.
-<H2><A NAME="sect25" HREF="#toc25">Speed Tips</A></H2>
-There may be cases
-where the bar chart needs to be drawn and updated as quickly as possible.
- If drawing speed becomes a big problem, here are a few tips to speed up
-displays.
-<UL>
-·<LI>Try to minimize the number of data points. The more data points
- looked at, the more work the bar chart must do. </LI>·<LI>If your data is generated
-as floating point values, the time required to convert the data values
-to and from ASCII strings can be significant, especially when there any
-many data points. You can avoid the redundant string-to-decimal conversions
-using the C API to BLT vectors. </LI>·<LI>Don't stipple or dash the element. Solid
-bars are much faster. </LI>·<LI>If you update data elements frequently, try turning
-off the widget's <B>-bufferelements</B> option. When the bar chart is first displayed,
-it draws data elements into an internal pixmap. The pixmap acts as a cache,
-so that when the bar chart needs to be redrawn again, and the data elements
-or coordinate axes haven't changed, the pixmap is simply copied to the screen.
- This is especially useful when you are using markers to highlight points
-and regions on the bar chart. But if the bar chart is updated frequently,
-changing either the element data or coordinate axes, the buffering becomes
-redundant. </LI>
-</UL>
-
-<H2><A NAME="sect26" HREF="#toc26">Limitations</A></H2>
-Auto-scale routines do not use requested min/max limits
-as boundaries when the axis is logarithmically scaled. <P>
-The PostScript
-output generated for polygons with more than 1500 points may exceed the
-limits of some printers (See PostScript Language Reference Manual, page
-568). The work-around is to break the polygon into separate pieces.
-<H2><A NAME="sect27" HREF="#toc27">Keywords</A></H2>
-bar
-chart, widget <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Syntax</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Example</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Syntax</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Barchart Operations</A></LI>
-<LI><A NAME="toc8" HREF="#sect8">Barchart Components</A></LI>
-<UL>
-<LI><A NAME="toc9" HREF="#sect9">Axis Components</A></LI>
-<LI><A NAME="toc10" HREF="#sect10">Crosshairs Component</A></LI>
-</UL>
-<LI><A NAME="toc11" HREF="#sect11">Elements</A></LI>
-<UL>
-<LI><A NAME="toc12" HREF="#sect12">Grid Component</A></LI>
-<LI><A NAME="toc13" HREF="#sect13">Legend Component</A></LI>
-<LI><A NAME="toc14" HREF="#sect14">Pen Components</A></LI>
-<LI><A NAME="toc15" HREF="#sect15">PostScript Component</A></LI>
-<LI><A NAME="toc16" HREF="#sect16">Marker Components</A></LI>
-<LI><A NAME="toc17" HREF="#sect17">Bitmap Markers</A></LI>
-<LI><A NAME="toc18" HREF="#sect18">Image Markers</A></LI>
-<LI><A NAME="toc19" HREF="#sect19">Line Markers</A></LI>
-<LI><A NAME="toc20" HREF="#sect20">Polygon Markers</A></LI>
-<LI><A NAME="toc21" HREF="#sect21">Text Markers</A></LI>
-<LI><A NAME="toc22" HREF="#sect22">Window Markers</A></LI>
-</UL>
-<LI><A NAME="toc23" HREF="#sect23">Graph Component Bindings</A></LI>
-<LI><A NAME="toc24" HREF="#sect24">C Language API</A></LI>
-<LI><A NAME="toc25" HREF="#sect25">Speed Tips</A></LI>
-<LI><A NAME="toc26" HREF="#sect26">Limitations</A></LI>
-<LI><A NAME="toc27" HREF="#sect27">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/beep.html b/blt3.0.1/html/beep.html
deleted file mode 100644
index a3544c6..0000000
--- a/blt3.0.1/html/beep.html
+++ /dev/null
@@ -1,41 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>beep(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-beep - ring the bell
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>beep</B> ?<I>percent</I>?
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The
-<B>beep</B> command rings the keyboard bell. <I>Percent</I> is relative to the base volume
-of the keyboard bell and can range from -100 to 100 inclusive. <P>
-If <I>percent</I>
-is nonnegative then the bell volume is: <BR>
-<CODE>base - [(base * <I>percent</I>) / 100] + <I>percent</I><BR>
-</CODE><P>If <I>percent</I> is negative then the bell volume is: <BR>
-<CODE>base + [(base * <I>percent</I>) / 100]<BR>
-</CODE><P>The default <I>percent</I> is 50.
-<H2><A NAME="sect3" HREF="#toc3">Example</A></H2>
-<BR>
-<CODE>beep<BR>
-
-<H2><A NAME="sect4" HREF="#toc4"></CODE><P>Keywords</A></H2>
-bell, beep <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Example</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/bgexec.html b/blt3.0.1/html/bgexec.html
deleted file mode 100644
index efceca8..0000000
--- a/blt3.0.1/html/bgexec.html
+++ /dev/null
@@ -1,271 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>bgexec(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-bgexec - Run programs in the background while
-handling Tk events.
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>blt::bgexec <I>varName</I></B> ?<I>option value</I>?... <I>program</I> ?<I>arg</I>?...
-
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-<P>
-The <B>bgexec</B> command executes programs in the background, allowing
-Tk to handle events. A global Tcl variable <I>varName</I> is set when the program
-has completed.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-Tcl's <B>exec</B> command is very useful for gathering
-information from the operating system. It runs a program and returns the
-output as its result. This works well for Tcl-only applications. But for
-Tk applications, a problem occurs when the program takes time to process.
- Let's say we want the get the disk usage of a directory. We'll use the Unix
-program <I>du</I> to get the summary. <BR>
-<CODE>set out [exec du -s $dir]<BR>
-puts "Disk usage for $dir is $out"<BR>
-</CODE><P>While <I>du</I> is running, scrollbars won't respond. None of the Tk widgets will
-be redrawn properly. The <B>send</B> command won't work. And the worst part is that
-the application appears hung up or dead. The problem is that while <B>exec</B>
-is waiting for <I>du</I> to finish, Tk is not able to handle X events. <P>
-The <B>bgexec</B>
-command performs the same functions as <B>exec</B>, but also allows Tk to handle
-events. You can execute a long-running program and the Tk widgets will behave
-normally. When the program finishes, its output and the exit status are
-written to Tcl variables. This makes it easy to monitor and save the output
-of a program.
-<H2><A NAME="sect4" HREF="#toc4">Example</A></H2>
-Here is the disk usage example again, this time using
-<B>bgexec</B>. The syntax to invoke "du" is exactly the same as the previous example,
-when we used <B>exec</B>. <BR>
-<CODE>global myStatus myOutput<BR>
-blt::bgexec myStatus -output myOutput du -s $dir<BR>
-puts "Disk usage for $dir is $myOutput"<BR>
-</CODE><P>Two global variables, <I>myStatus</I> and <I>myOutput</I>, will be set by <B>bgexec</B> when
-<I>du</I> has completed. <I>MyStatus</I> will contain the program's exit status. <I>MyOutput</I>,
-specified by the <B>-output</B> option, will store the output of the program. <P>
-You
-can also terminate the program by setting the variable <I>myStatus</I>. If <I>myStatus</I>
-is set before <I>du</I> has completed, the process is killed. Under Unix, this
-is done sending by a configurable signal (by default it's SIGKILL). Under
-Win32, this is done by calling <B>TerminateProcess</B>. It makes no difference
-what <I>myStatus</I> is set to. <BR>
-<CODE>set myStatus {}<BR>
-</CODE><P>There are several <B>bgexec</B> options to collect different types of information.
-<BR>
-<CODE>global myStatus myOutput myErrs<BR>
-blt::bgexec myStatus -output myOutput -error myErrs du -s $dir<BR>
-</CODE><P>The <B>-error</B> option is similar to <B>-output</B>. It sets a global variable when the
-program completes. The variable will contain any data written to stderr
-by the program. <P>
-The <B>-output</B> and <B>-error</B> variables are set only after the program
-completes. But if the program takes a long time, to run you may want to
-receive its partial output. You can gather data as it becomes available
-using the <B>-onoutput</B> option. It specifies a Tcl command prefix. Whenever
-new data is available, this command is executed, with the data appended
-as an argument to the command. <BR>
-<CODE>proc GetInfo { data } {<BR>
- puts $data<BR>
-}<BR>
-blt::bgexec myStatus -onoutput GetInfo du -s $dir<BR>
-</CODE><P>When output is available, the procedure <I>GetInfo</I> is called. The <B>-onerror</B> option
-performs a similar function for the stderr data stream. <P>
-Like <B>exec</B>, <B>bgexec</B>
-returns an error if the exit code of the program is not zero. If you think
-you may get a non-zero exit code, you might want to invoke <B>bgexec</B> from within
-a <B>catch</B>. <BR>
-<CODE>catch { blt::bgexec myStatus -output myOutput du -s $dir }<BR>
-</CODE><P>By default, <B>bgexec</B> will wait for the program to finish. But you can detach
-the program making ampersand (&) the last argument on the command line. <BR>
-<CODE>global myStatus myOutput<BR>
-blt::bgexec myStatus -output myOutput du -s $dir &<BR>
-</CODE><P><B>Bgexec</B> will return immediately and its result will be a list of the spawned
-process ids. If at some point you need to wait for the program to finish
-up, you can use <B>tkwait</B>. When the program finishes, the variable <I>myStatus</I>
-will be written to, breaking out the <B>tkwait</B> command. <BR>
-<CODE>global myStatus myOutput<BR>
-blt::bgexec myStatus -output myOutput du -s $dir &<BR>
-<tt> </tt> <tt> </tt> ...<BR>
-tkwait variable myStatus<BR>
-
-<H2><A NAME="sect5" HREF="#toc5"></CODE><P>Syntax</A></H2>
-The <B>bgexec</B> command takes the following form: <P>
-<B><tt> </tt> <tt> </tt> blt::bgexec <I>varName</I></B>
-?<I>option value</I>?... <I>program</I> ?<I>arg</I>?... <P>
-<I>VarName</I> is the name of a global variable which
-is set when <I>program</I> has finished executing. The exit status of will be
-stored in <I>varName</I>. The exit status is a list of a status token, the process-id
-of the program, the exit code, and a status message. You can also prematurely
-terminate the program by setting <I>varName</I>. Under Unix, the program will
-be sent a signal to terminate it (by default the signal is a SIGKILL; see
-the <B>-killsignal</B> option). <P>
-<I>Program</I> is the name of the program to be executed
-and <I>args</I> are any extra arguments for <I>program</I>. The syntax of <I>program</I> and
-<I>args</I> is the same as the <B>exec</B> command. So you can redirect I/O, execute pipelines,
-etc. (see the <B>exec</B> manual for further information) just like <B>exec</B>. If the
-last argument is an ampersand (&), the program will be run detached, and
-<B>bgexec</B> will return immediately. <I>VarName</I> will still be set with the return
-status when <I>program</I> completes.
-<H2><A NAME="sect6" HREF="#toc6">Options</A></H2>
-<I>Option</I> refers to the switch name always
-beginning with a dash (-). <I>Value</I> is the value of the option. Option-value
-pairs are terminated either by the program name, or double dashes (--). The
-following options are available for <B>bgexec</B>:
-<DL>
-
-<DT><B>-decodeerror <I>encodingName</I></B> </DT>
-<DD><BR>
-Specifies the encoding of the stderr channel. This affects only data returned
-to the Tcl interpreter. No translation is done on file redirection. <BR>
-For example if data is to be converted from Unicode for use in Tcl, you
-would use the "unicode" encoding. The default is that no tranlation is
-performed. </DD>
-
-<DT><B>-decodeoutput <I>encodingName</I></B> </DT>
-<DD><BR>
-Specifies the encoding of the stdout channels. This affects only data returned
-to the Tcl interpreter. No translation is done on file redirection. <BR>
-For example if data is to be converted from Unicode for use in Tcl, you
-would use the "unicode" encoding. The default is that no tranlation is
-performed. </DD>
-
-<DT><B>-error <I>varName</I></B> </DT>
-<DD><BR>
-Specifies that a global variable <I>varName</I> is to be set with the contents
-of stderr after the program has completed. </DD>
-
-<DT><B>-keepnewline <I>boolean</I></B> </DT>
-<DD>Specifies
-that a trailing newline should be retained in the output. If <I>boolean</I> is
-true, the trailing newline is truncated from the output of the <B>-onoutput</B>
-and <B>-output</B> variables. The default value is <I>true</I>. </DD>
-
-<DT><B>-killsignal <I>signal</I></B> </DT>
-<DD>Specifies
-the signal to be sent to the program when terminating. This is available
-only under Unix. <I>Signal</I> can either be a number (typically 1-32) or a mnemonic
-(such as SIGINT). If <I>signal</I> is the empty string, then no signal is sent.
- The default signal is <I>9</I> (SIGKILL). </DD>
-
-<DT><B>-lasterror <I>varName</I></B> </DT>
-<DD>Specifies a variable
-<I>varName</I> that is updated whenever data becomes available from standard error
-of the program. <I>VarName</I> is a global variable. Unlike the <B>-error</B> option, data
-is available as soon as it arrives. </DD>
-
-<DT><B>-lastoutput <I>varName</I></B> </DT>
-<DD>Specifies a variable
-<I>varName</I> that is updated whenever data becomes available from standard output
-of the program. <I>VarName</I> is a global variable. Unlike the <B>-output</B> option, data
-is available as soon as it arrives. </DD>
-
-<DT><B>-linebuffered <I>boolean</I></B> </DT>
-<DD>Specifies that
-updates should be made on a line-by-line basis. Normally when new data is
-available <B>bgexec</B> will set the variable (<B>-lastoutput</B> and <B>-lasterror</B> options)
-or invoke the command (<B>-onoutput</B> and <B>-onerror</B> options) delivering all the
-new data currently available. If <I>boolean</I> is true, only one line at a time
-will be delivered. This can be useful when you want to process the output
-on a line-by-line basis. The default value is <I>false</I>. </DD>
-
-<DT><B>-output <I>varName</I></B> </DT>
-<DD><BR>
-Specifies that a global variable <I>varName</I> is to be set with the output of
-the program, once it has completed. If this option is not set, no output
-will be accumulated. </DD>
-
-<DT><B>-onerror <I>command</I></B> </DT>
-<DD>Specifies the start of a Tcl command
-that will be executed whenever new data is available from standard error.
-The data is appended to the command as an extra argument before it is executed.
-</DD>
-
-<DT><B>-onoutput <I>command</I></B> </DT>
-<DD>Specifies the start of a Tcl command that will be executed
-whenever new data is available from standard output. The data is appended
-to the command as an extra argument before it is executed. </DD>
-
-<DT><B>-update <I>varName</I></B>
- </DT>
-<DD>Deprecated. This option is replaced by <B>-lasterror</B>. </DD>
-
-<DT><B>--</B> </DT>
-<DD>This marks the end of
-the options. The following argument will be considered the name of a program
-even if it starts with a dash (<B>-</B>). </DD>
-</DL>
-
-<H2><A NAME="sect7" HREF="#toc7">Preemption</A></H2>
-Because <B>bgexec</B> allows Tk to
-handle events while a program is running, it's possible for an application
-to preempt itself with further user-interactions. Let's say your application
-has a button that runs the disk usage example. And while the <I>du</I> program
-is running, the user accidently presses the button again. A second <B>bgexec</B>
-program will preempt the first. What this means is that the first program
-can not finish until the second program has completed. <P>
-Care must be taken
-to prevent an application from preempting itself by blocking further user-interactions
-(such as button clicks). The BLT <B>busy</B> command is very useful for just these
-situations. See the <B>busy</B> manual for details.
-<H2><A NAME="sect8" HREF="#toc8">Differences with Fileevent</A></H2>
-Since
-Tk 4.0, a subset of <B>bgexec</B> can be also achieved using the <B>fileevent</B> command.
- The steps for running a program in the background are: <P>
-Execute the program
-with the <B>open</B> command (using the "|" syntax) and save the file handle. <BR>
-<CODE>global fileId <BR>
-set fileId [open "|du -s $dir" r]<BR>
-</CODE><P>Next register a Tcl code snippet with <B>fileevent</B> to be run whenever output
-is available on the file handle. The code snippet will read from the file
-handle and save the output in a variable. <BR>
-<CODE>fileevent fileId readable { <BR>
- if { [gets $fileId line] < 0 } {<BR>
-<tt> </tt> <tt> </tt> close $fileId<BR>
-<tt> </tt> <tt> </tt> set output $temp<BR>
-<tt> </tt> <tt> </tt> unset fileId temp<BR>
- } else {<BR>
-<tt> </tt> <tt> </tt> append temp $line<BR>
- }<BR>
-}<BR>
-<P>
-</CODE><P>The biggest advantage of <B>bgexec</B> is that, unlike <B>fileevent</B>, it requires
-no additional Tcl code to run a program. It's simpler and less error prone.
- You don't have to worry about non-blocking I/O. It's handled tranparently
-for you. <P>
-<B>Bgexec</B> runs programs that <B>fileevent</B> can not. <B>Fileevent</B> assumes that
-the when stdout is closed the program has completed. But some programs,
-like the Unix <I>compress</I> program, reopen stdout, fooling <B>fileevent</B> into thinking
-the program has terminated. In the example above, we assume that the program
-will write and flush its output line-by-line. However running another program,
-your application may block in the <B>gets</B> command reading a partial line. <P>
-<B>Bgexec</B>
-lets you get back the exit status of the program. It also allows you to
-collect data from both stdout and stderr simultaneously. Finally, since
-data collection is handled in C code, <B>bgexec</B> is faster. You get back to
-the Tk event loop more quickly, making your application seem more responsive.
-
-<H2><A NAME="sect9" HREF="#toc9">See Also</A></H2>
-busy, exec, tkwait
-<H2><A NAME="sect10" HREF="#toc10">Keywords</A></H2>
-exec, background, busy <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Example</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Syntax</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Options</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Preemption</A></LI>
-<LI><A NAME="toc8" HREF="#sect8">Differences with Fileevent</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">See Also</A></LI>
-<LI><A NAME="toc10" HREF="#sect10">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/bitmap.html b/blt3.0.1/html/bitmap.html
deleted file mode 100644
index d23c738..0000000
--- a/blt3.0.1/html/bitmap.html
+++ /dev/null
@@ -1,208 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>bitmap(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-bitmap - Define a new bitmap from a Tcl script
-
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>bitmap define <I>bitmapName data</I></B> ?<I>option value</I>?... <P>
-<B>bitmap compose <I>bitmapName
-text</I></B> ?<I>option value</I>?... <P>
-<B>bitmap exists <I>bitmapName</I></B> <P>
-<B>bitmap source <I>bitmapName</I></B> <P>
-<B>bitmap
-data <I>bitmapName</I></B> <P>
-<B>bitmap height <I>bitmapName</I></B> <P>
-<B>bitmap width <I>bitmapName</I></B>
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The
-<B>bitmap</B> command lets you create new bitmaps directly from your Tcl script.
- The bitmap can be specified as a list of data or a text string which is
-converted into a bitmap. You can arbitrarily scale or rotate the bitmap
-too.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-Bitmaps are commonly used within Tk. In label and button
-widgets, you display bitmaps them instead of text strings and in the canvas
-and text widgets, they're used for stippling. But Tk let's you can create
-new bitmaps only by reading the bitmap data from a file. This makes bitmaps
-cumbersome to manage, especially in packaging the program as a <B>wish</B> script,
-since each bitmap must be its own file. It would be nicer if you could
-create new bitmaps directly from your Tcl script. <P>
-The <B>bitmap</B> command lets
-you do just that. You can specify the bitmap as in various formats (such
-as the X11 bitmap format). You can also compose a bitmap from a text string.
- The <B>bitmap</B> command also lets you and arbitrarily rotate or scale the bitmap.
- For example, you could use this to create button widgets with the text
-label rotated 90 degrees.
-<H2><A NAME="sect4" HREF="#toc4">Example</A></H2>
-<<<<<<< bitmap.mann You can define a new bitmap
-with the <B>define</B> operation. For example, let's say you are using the X11
-bitmap "gray1". Normally to use it, you would specify the location of the
-file. <BR>
-<CODE>label .l -bitmap @/usr/X11R6/include/X11/bitmaps/gray1<BR>
-</CODE><P>But you can simply cut and paste the contents of "gray1" into the <B>bitmap</B>
-command. <BR>
-<CODE>bitmap define gray1 {<BR>
- #define gray1_width 2<BR>
- #define gray1_height 2<BR>
- static char gray1_bits[] = {<BR>
- 0x01, 0x02};<BR>
-}<BR>
-label .l -bitmap gray1<BR>
-</CODE><P>Tk will recognize "gray1" as a bitmap which can now be used with any widget
-that accepts bitmaps. <BR>
-<CODE></CODE><P>The bitmap data can be specified in a mulitude of forms. The following commands
-are all equivalent. <BR>
-<CODE>bitmap define gray1 {<BR>
- #define gray1_width 2<BR>
- #define gray1_height 2<BR>
- static char gray1_bits[] = {<BR>
- 0x01, 0x02};<BR>
-}<BR>
-bitmap define gray1 { { 2 2 } { 0x01, 0x02 } }<BR>
-bitmap define gray1 { { 2 2 } { 0x01 0x02 } }<BR>
-bitmap define gray1 { { 2 2 } { 1 2 } }<BR>
-</CODE><P>Either the data is in the standard X11 bitmap form, or it's a list of two
-lists. The first list contains the height and width of the bitmap. The second
-list is the bitmap source data. Each element of that list is an hexadecimal
-number specifying which pixels are <A HREF="foreground.1.html">foreground (1)</A>
- and which are background
-(0) of the bitmap. Note that the format of the source data is exactly that
-of the XBM format. <P>
-You can scale or rotate the bitmap as you create it,
-by using the <B>-scale</B> or<B>-rotate</B> options. <BR>
-<CODE>bitmap define gray1 {<BR>
- #define gray1_width 2<BR>
- #define gray1_height 2<BR>
- static char gray1_bits[] = {<BR>
- 0x01, 0x02};<BR>
-} -scale 2.0 -rotate 90.0<BR>
-</CODE><P>In addition, you can compose bitmaps from text strings. This makes it easy
-to create rotated buttons or labels. The text string can have multi-line.
- <BR>
-<CODE>bitmap compose rot_text "This is rotated\ntext" \<BR>
-<tt> </tt> <tt> </tt> -rotate 90.0 -font fixed<BR>
-</CODE><P>There are also a number of ways to query bitmaps. This isn't limited to
-bitmaps that you create, but any bitmap. <BR>
-<CODE>bitmap exists rot_text<BR>
-bitmap width rot_text<BR>
-bitmap height rot_text<BR>
-bitmap data rot_text<BR>
-bitmap source rot_text<BR>
-</CODE><P>The <B>exists</B> operation indicates if a bitmap by that name is defined. You
-can query the dimensions of the bitmap using the <B>width</B> and <B>height</B> operations.
-The <B>data</B> operation returns the list of the data used to create the bitmap.
- For example, you could query the data of a bitmap and <B>send</B> it across
-the network to another Tk application. <BR>
-<CODE>set data [bitmap data @/usr/X11R6/include/X11/bitmaps/ghost.xbm]<BR>
-send {wish #2} bitmap define ghost $data<BR>
-
-<H2><A NAME="sect5" HREF="#toc5"></CODE><P>Operations</A></H2>
-The following operations are available for <B>bitmap</B>:
-<DL>
-
-<DT><B>bitmap compose
-<I>bitmapName text </I></B>?<I>option value</I>?... </DT>
-<DD>Creates a bitmap <I>bitmapName</I> from the text
-string <I>text</I>. A bitmap <I>bitmapName</I> can not already exist. The following options
-are available. <blockquote></DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Specifies a font to use when drawing text
-into the bitmap. If this option isn't specified then <I>fontName</I> defaults to
- <I>*-Helvetica-Bold-R-Normal-*-140-*</I>. </DD>
-
-<DT><B>-rotate <I>theta</I></B> </DT>
-<DD>Specifies the angle of rotation
-of the text in the bitmap. <I>Theta</I> is a real number representing the angle
-in degrees. It defaults to <I>0.0</I> degrees. </DD>
-
-<DT><B>-scale <I>value</I></B> </DT>
-<DD>Specifies the scale of
-the bitmap. <I>Value</I> is a real number representing the scale. A scale of 1.0
-indicates no scaling is necessary, while 2.0 would double the size of the
-bitmap. There is no way to specify differents scales for the width and
-height of the bitmap. The default scale is <I>1.0</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>bitmap data <I>bitmapName</I></B> </DT>
-<DD>Returns
-a list of both the dimensions of the bitmap <I>bitmapName</I> and its source data.
-</DD>
-
-<DT><B>bitmap define <I>bitmapName data</I></B> ?<I>option value</I>?... </DT>
-<DD>Associates <I>bitmapName</I> with
-in-memory bitmap data so that <I>bitmapName</I> can be used in later calls to <B>Tk_GetBitmap</B>.
-The <I>bitmapName</I> argument is the name of the bitmap; it must not previously
-have been defined in either a call to Tk_DefineBitmap or <B>bitmap</B>. The argument
-<I>data</I> describes the bitmap to be created. It is either the X11 bitmap format
-(a C structure) or a list of two lists: the dimensions and source data.
- The dimensions are a list of two numbers which are the width and height
-of the bitmap. The source data is a list of hexadecimal values in a format
-similar to the X11 or X10 bitmap format. The values may be optionally separated
-by commas and do not need to be prefixed with "0x". The following options
-are available. <blockquote></DD>
-
-<DT><B>-rotate <I>theta</I></B> </DT>
-<DD>Specifies how many degrees to rotate the bitmap.
-<I>Theta</I> is a real number representing the angle. The default is <I>0.0</I> degrees.
-</DD>
-
-<DT><B>-scale <I>value</I></B> </DT>
-<DD>Specifies how to scale the bitmap. <I>Value</I> is a real number representing
-the scale. A scale of 1.0 indicates no scaling is necessary, while 2.0 would
-double the size of the bitmap. There is no way to specify differents scales
-for the width and height of the bitmap. The default scale is <I>1.0</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>bitmap exists
-<I>bitmapName</I></B> </DT>
-<DD>Returns <I>1</I> if a bitmap <I>bitmapName</I> exists, otherwise <I>0</I>. </DD>
-
-<DT><B>bitmap
-height <I>bitmapName</I></B> </DT>
-<DD>Returns the height in pixels of the bitmap <I>bitmapName</I>.
-</DD>
-
-<DT><B>bitmap source <I>bitmapName</I></B> </DT>
-<DD>Returns the source data of the bitmap <I>bitmapName</I>.
-The source data is a list of the hexadecimal values. </DD>
-
-<DT><B>bitmap width <I>bitmapName</I></B>
- </DT>
-<DD>Returns the width in pixels of the bitmap <I>bitmapName</I>. </DD>
-</DL>
-
-<H2><A NAME="sect6" HREF="#toc6">Limitations</A></H2>
-Tk currently
-offers no way of destroying bitmaps. Once a bitmap is created, it exists
-until the application terminates.
-<H2><A NAME="sect7" HREF="#toc7">Keywords</A></H2>
-bitmap <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Example</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Operations</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Limitations</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/bltdebug.html b/blt3.0.1/html/bltdebug.html
deleted file mode 100644
index 6ff3953..0000000
--- a/blt3.0.1/html/bltdebug.html
+++ /dev/null
@@ -1,34 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>bltdebug(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-bltdebug - print Tcl commands before execution
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>bltdebug</B>
-?<I>level</I>?
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>bltdebug</B> command is a simple tracing facility for
-Tcl commands. Each command line is printed before it is executed on standard
-error. The output consists of the command line both before and after substitutions
-have occurred. <I>Level</I> indicates at what level to stop tracing commands.
-If <I>level</I> is <I>0</I>, no tracing is performed. This is the default. If no <I>level</I>
-argument is given, the current level is printed.
-<H2><A NAME="sect3" HREF="#toc3">Keywords</A></H2>
-debug <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/busy.html b/blt3.0.1/html/busy.html
deleted file mode 100644
index c588faf..0000000
--- a/blt3.0.1/html/busy.html
+++ /dev/null
@@ -1,218 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>busy(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-busy - Make Tk widgets busy, temporarily blocking
-user interactions.
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>busy hold <I>window</I></B> ?<I>option value</I>?... <P>
-<B>busy release
-<I>window</I></B> ?<I>window</I>?... <P>
-<B>busy configure <I>window</I></B> ?<I>option value</I>?... <P>
-<B>busy forget <I>window</I></B>
-?<I>window</I>?... <P>
-<B>busy isbusy </B>?<I>pattern</I>? <P>
-<B>busy names </B>?<I>pattern</I>? <P>
-<B>busy status <I>window</I></B>
-
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-<P>
-The <B>busy</B> command provides a simple means to block keyboard,
-button, and pointer events from Tk widgets, while overriding the widget's
-cursor with a configurable busy cursor.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-<P>
-There are many times
-in applications where you want to temporarily restrict what actions the
-user can take. For example, an application could have a "run" button that
-when pressed causes some processing to occur. But while the application
-is busy processing, you probably don't want the the user to be able to click
-the "run" button again. You may also want restrict the user from other
-tasks such as clicking a "print" button. <P>
-The <B>busy</B> command lets you make
-Tk widgets busy. This means that user interactions such as button clicks,
-moving the mouse, typing at the keyboard, etc. are ignored by the widget.
- You can set a special cursor (like a watch) that overrides the widget's
-normal cursor, providing feedback that the application (widget) is temporarily
-busy. <P>
-When a widget is made busy, the widget and all of its descendents
-will ignore events. It's easy to make an entire panel of widgets busy. You
-can simply make the toplevel widget (such as ".") busy. This is easier and
-far much more efficient than recursively traversing the widget hierarchy,
-disabling each widget and re-configuring its cursor. <P>
-Often, the busy command
-can be used instead of Tk's <B>grab</B> command. Unlike <B>grab</B> which restricts all
-user interactions to one widget, with the busy command you can have more
-than one widget active (for example, a "cancel" dialog and a "help" button).
-
-<H2><A NAME="sect4" HREF="#toc4">Example</A></H2>
-You can make several widgets busy by simply making its ancestor
-widget busy using the <B>hold</B> operation. <BR>
-<CODE>frame .top<BR>
-button .top.button; canvas .top.canvas<BR>
-pack .top.button .top.canvas<BR>
-pack .top<BR>
- . . .<BR>
-busy hold .top<BR>
-update<BR>
-</CODE><P>All the widgets within <I>.top</I> (including <I>.top</I>) are now busy. Using <B>update</B>
-insures that <B>busy</B> command will take effect before any other user events
-can occur. <P>
-When the application is no longer busy processing, you can allow
-user interactions again by the <B>release</B> operation. <BR>
-<PRE><I><tt> </tt> <tt> </tt> busy release .top </I>
-</PRE>The busy window has a configurable cursor. You can change the busy cursor
-using the <B>configure</B> operation. <BR>
-<PRE><I><tt> </tt> <tt> </tt> busy configure .top -cursor "watch"</I>
-</PRE>Finally, when you no longer need to the busy window, invoke the <B>forget</B>
-operation to free any resources it allocated. <BR>
-<PRE><I><tt> </tt> <tt> </tt> busy forget .top </I>
-</PRE>Destroying the widget will also clean up any resources allocated by the
-busy command. <P>
-
-<H2><A NAME="sect5" HREF="#toc5">Operations</A></H2>
-The following operations are available for the <B>busy</B>
-command:
-<DL>
-
-<DT><B>busy hold <I>window</I></B> ?<I>option value</I>?... </DT>
-<DD>Makes the widget <I>window</I> (and its
-descendants in the Tk window hierarchy) busy. <I>Window</I> must be a valid path
-name of a Tk widget. The busy window is mapped the next time idle tasks
-are processed, and the widget and its descendants will be blocked from
-user interactions. All events in the widget window and its descendants are
-ignored. Normally <B>update</B> should be called immediately afterward to insure
-that the <B>hold</B> operation is in effect <I>before</I> the application starts its
-processing. The following configuration options are valid: <blockquote></DD>
-
-<DT><B>-cursor <I>cursorName</I></B>
-</DT>
-<DD>Specifies the cursor to be displayed when the widget is made busy. <I>CursorName</I>
-can be in any form accepted by <B>Tk_GetCursor</B>. The default cursor is <I>watch</I>.
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>busy configure <I>window</I></B> ?<I>option value</I>?... </DT>
-<DD>Queries or modifies the <B>busy</B> command
-configuration options for <I>window</I>. <I>Window</I> must be the path name of a widget
-previously made busy by the <B>hold</B> operation. If no options are specified,
-a list describing all of the available options for <I>window</I> (see <B>Tk_ConfigureInfo</B>
-for information on the format of this list) is returned. If <I>option</I> is specified
-with no <I>value</I>, then the command returns a list describing the one named
-option (this list will be identical to the corresponding sublist of the
-value returned if no <I>option</I> is specified). If one or more <I>option-value</I> pairs
-are specified, then the command modifies the given widget option(s) to
-have the given value(s); in this case the command returns the empty string.
- <I>Option</I> may have any of the values accepted by the <B>hold</B> operation. <P>
-Please
-note that the option database is referenced through <I>window</I>. For example,
-if the widget <I>.frame</I> is to be made busy, the busy cursor can be specified
-for it by either <B>option</B> command: <BR>
-<PRE><tt> </tt> <tt> </tt> <I>option add *frame.busyCursor gumby</I>
-<tt> </tt> <tt> </tt> <I>option add *Frame.BusyCursor gumby</I>
-</PRE></DD>
-
-<DT><B>busy forget <I>window</I></B> ?<I>window</I>?... </DT>
-<DD>Releases resources allocated by the busy command
-for <I>window</I>, including the busy window. User events will again be received
-again by <I>window</I>. Resources are also released when <I>window</I> is destroyed.
-<I>Window</I> must be the name of a widget specified in the <B>hold</B> operation, otherwise
-an error is reported. </DD>
-
-<DT><B>busy isbusy </B>?<I>pattern</I>? </DT>
-<DD>Returns the pathnames of all
-widgets that are currently busy. If a <I>pattern</I> is given, the path names of
-busy widgets matching <I>pattern</I> are returned. </DD>
-
-<DT><B>busy names </B>?<I>pattern</I>? </DT>
-<DD>Returns
-the pathnames of all widgets that have previously been made busy (i.e. a
-busy window is allocated and associated with the widget). It makes no difference
-if the window is currently busy or not. If a <I>pattern</I> is given, the path
-names of busy widgets matching <I>pattern</I> are returned. </DD>
-
-<DT><B>busy release <I>window</I></B>
-?<I>window</I>?... </DT>
-<DD>Restores user interactions to the widget <I>window</I> again. This differs
-from the <B>forget</B> operation in that the busy window is not destroyed, but
-simply unmapped. <I>Window</I> must be the name of a widget specified in a <B>hold</B>
-operation, otherwise an error is reported. </DD>
-
-<DT><B>busy status <I>window</I></B> </DT>
-<DD>Returns the
-status of a widget <I>window</I> previously made busy. An error is reported if
-<I>window</I> was never made busy, or the <B>forget</B> operation was invoked (i.e. does
-not currently have a busy window associated with it). If <I>window</I> is presently
-can not receive user interactions, <I>1</I> is returned, otherwise <I>0</I>. <P>
-</DD>
-</DL>
-
-<H2><A NAME="sect6" HREF="#toc6">Bindings</A></H2>
-The
-event blocking feature is implemented by creating and mapping a transparent
-window that completely covers the widget. When the busy window is mapped,
-it invisibly shields the widget and its hierarchy from all events that
-may be sent. Like Tk widgets, busy windows have widget names in the Tk
-window hierarchy. This means that you can use the <B>bind</B> command, to handle
-events in the busy window. <BR>
-<CODE>busy hold .frame.canvas<BR>
-bind .frame.canvas_Busy <Enter> { ... } <BR>
-<P>
-</CODE><P>Normally the busy window is a sibling of the widget. The name of the busy
-window is "<I>widget<I>_Busy</I></I>" where <I>widget</I> is the name of the widget to be made
-busy. In the previous example, the pathname of the busy window is "<I>.frame.canvas_Busy</I>"
-The exception is when the widget is a toplevel widget (such as ".") where
-the busy window can't be made a sibling. The busy window is then a child
-of the widget named "<I>widget<I>._Busy</I></I>" where <I>widget</I> is the name of the toplevel
-widget. In the following example, the pathname of the busy window is "<I>._Busy</I>"
-<BR>
-<CODE>busy hold .<BR>
-bind ._Busy <Enter> { ... } <BR>
-
-<H2><A NAME="sect7" HREF="#toc7"></CODE><P>Enter/Leave Events</A></H2>
-Mapping and unmapping busy windows generates Enter/Leave
-events for all widgets they cover. Please note this if you are tracking
-Enter/Leave events in widgets.
-<H2><A NAME="sect8" HREF="#toc8">Keyboard Events</A></H2>
-When a widget is made busy,
-the widget is prevented from gaining the keyboard focus by the busy window.
-But if the widget already had focus, it still may received keyboard events.
- To prevent this, you must move focus to another window. <BR>
-<CODE>busy hold .frame<BR>
-label .dummy<BR>
-focus .dummy<BR>
-update<BR>
-</CODE><P>The above example moves the focus from .frame immediately after invoking
-the <B>hold</B> so that no keyboard events will be sent to <I>.frame</I> or any of its
-descendants.
-<H2><A NAME="sect9" HREF="#toc9">Keywords</A></H2>
-busy, keyboard events, pointer events, window, cursor
-<P>
- <P>
- <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Example</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Operations</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Bindings</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Enter/Leave Events</A></LI>
-<LI><A NAME="toc8" HREF="#sect8">Keyboard Events</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/container.html b/blt3.0.1/html/container.html
deleted file mode 100644
index 40cb470..0000000
--- a/blt3.0.1/html/container.html
+++ /dev/null
@@ -1,272 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>container(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-container - Widget to contain a foreign window.
-
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>container</B> <I>pathName </I>?<I>options</I>?
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>container</B> widget lets
-you embed an X11 window from a foreign application into your Tk application.
- The foreign window is reparented inside of the widget. You can then place
-and arrange the container just as you would any Tk widget.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-Notebooks
-are a popular graphical paradigm. They allow you to organize many windows
-in a single widget. For example, you might have an application the displays
-several X-Y graphs at the same time. Typically, you can't pack the graphs
-into the same <B>frame</B> because they are too large. The other alternative is
-to pack the graphs into several <B>toplevel</B> widgets, allowing them to overlap
-on the screen. The problem is that all the different toplevel windows clutter
-the screen and are difficult to manage. <P>
-The <B>container</B> widget lets organize
-your application by displaying each graph as a page in a folder of a notebook.
- Only one page is visible at a time. When you click on a tab, the folder
-(graph) corresponding to the tab is displayed in the <B>container</B> widget.
-The container also lets you temporarily tear pages out of the notebook
-into a separate toplevel widget, and put them back in the container later.
- For example, you could compare two graphs side-by-side by tearing them out,
-and then replace them when you are finished. <P>
-A container may contain an
-unlimited number of folders. If there are too many tabs to view, you can
-arrange them as multiple tiers or scroll the tabs. The container uses the
-conventional Tk scrollbar syntax, so you can attach a scrollbar too.
-<H2><A NAME="sect4" HREF="#toc4">Example</A></H2>
-You
-create a container widget with the <B>container</B> command. <BR>
-<CODE># Create a new container<BR>
-container .c<BR>
-</CODE><P>A new Tcl command <I>.c</I> is also created. This command can be used to query
-and modify the container. For example, to change the default borderwidth,
-you use the new command and the container's <B>configure</B> operation. <BR>
-<CODE># Change the default font.<BR>
-.c configure -borderwidth 2<BR>
-</CODE><P>You can then add folders using the <B>insert</B> operation. <BR>
-<CODE># Create a new folder "f1"<BR>
-.c coinsert 0 "f1"<BR>
-</CODE><P>This inserts the new tab named "f1" into the container. The index <I>0</I> indicates
-location to insert the new tab. You can also use the index <I>end</I> to append
-a tab to the end of the container. By default, the text of the tab is the
-name of the tab. You can change this by configuring the <B>-text</B> option. <BR>
-<CODE># Change the label of "f1"<BR>
-.ts tab configure "f1" -label "Tab #1" <BR>
-</CODE><P>The <B>insert</B> operation lets you add one or more folders at a time. <BR>
-<CODE>.ts insert end "f2" -label "Tab #2" "f3" "f4" <BR>
-</CODE><P>The tab on each folder contains a label. A label may display both an image
-and a text string. You can reconfigure the tab's attributes (foreground/background
-colors, font, rotation, etc) using the <B>tab configure</B> operation. <BR>
-<CODE># Add an image to the label of "f1"<BR>
-set image [image create photo -file stopsign.gif]<BR>
-.ts tab configure "f1" -image $image<BR>
-.ts tab configure "f2" -rotate 90<BR>
-</CODE><P>Each folder may contain an embedded widget to represent its contents. The
-widget to be embedded must be a child of the container widget. Using the
-<B>-window</B> option, you specify the name of widget to be embedded. But don't
-pack the widget, the container takes care of placing and arranging the
-widget for you. <BR>
-<CODE>graph .ts.graph<BR>
-.ts tab configure "f1" -window ".ts.graph" \<BR>
- -fill both -padx 0.25i -pady 0.25i<BR>
-</CODE><P>The size of the folder is determined the sizes of the Tk widgets embedded
-inside each folder. The folder will be as wide as the widest widget in
-any folder. The tallest determines the height. You can use the tab's <B>-pagewidth</B>
-and <B>-pageheight</B> options override this. <P>
-Other options control how the widget
-appears in the folder. The <B>-fill</B> option says that you wish to have the widget
-stretch to fill the available space in the folder. <BR>
-<CODE>.ts tab configure "f1" -fill both -padx 0.25i -pady 0.25i<BR>
-<P>
-</CODE><P>Now when you click the left mouse button on "f1", the graph will be displayed
-in the folder. It will be automatically hidden when another folder is selected.
- If you click on the right mouse button, the embedded widget will be moved
-into a toplevel widget of its own. Clicking again on the right mouse button
-puts it back into the folder. <P>
-If you want to share a page between two different
-folders, the <B>-command</B> option lets you specify a Tcl command to be invoked
-whenever the folder is selected. You can reset the <B>-window</B> option for the
-tab whenever it's clicked. <BR>
-<CODE>.ts tab configure "f2" -command { <BR>
- .ts tab configure "f2" -window ".ts.graph"<BR>
-}<BR>
-.ts tab configure "f1" -command { <BR>
- .ts tab configure "f1" -window ".ts.graph"<BR>
-}<BR>
-</CODE><P>If you have many folders, you may wish to stack tabs in multiple tiers.
- The container's <B>-tiers</B> option requests a maximum number of tiers. The default
-is one tier. <BR>
-<CODE>.ts configure -tiers 2<BR>
-</CODE><P>If the tabs can fit in less tiers, the widget will use that many. Whenever
-there are more tabs than can be displayed in the maximum number of tiers,
-the container will automatically let you scroll the tabs. You can even
-attach a scrollbar to the container. <BR>
-<CODE>.ts configure -scrollcommand { .sbar set } -scrollincrement 20<BR>
-.sbar configure -orient horizontal -command { .ts view }<BR>
-</CODE><P>By default tabs are along the top of the container from left to right.
- But tabs can be placed on any side of the container using the <B>-side</B> option.
-<BR>
-<CODE># Arrange tabs along the right side of the container. <BR>
-.ts configure -side right -rotate 270<BR>
-
-<H2><A NAME="sect5" HREF="#toc5"></CODE><P>Syntax</A></H2>
-The <B>container</B> command creates a new window using the <I>pathName</I> argument
-and makes it into a container widget. <BR>
-<CODE><B>container <I>pathName </I></B>?<I>option value</I>?...<BR>
-</CODE><P>Additional options may be specified on the command line or in the option
-database to configure aspects of the container such as its colors, font,
-text, and relief. The <B>container</B> command returns its <I>pathName</I> argument.
-At the time this command is invoked, there must not exist a window named
-<I>pathName</I>, but <I>pathName</I>'s parent must exist. <P>
-When first created, a new container
-contains no tabs. Tabs are added or deleted using widget operations described
-below. It is not necessary for all the tabs to be displayed in the container
-window at once; commands described below may be used to change the view
-in the window. Containers allow scrolling of tabs using the <B>-scrollcommand</B>
-option. They also support scanning (see the <B>scan</B> operation). Tabs may be
-arranged along any side of the container window using the <B>-side</B> option. <P>
-The
-size of the container window is determined the number of tiers of tabs
-and the sizes of the Tk widgets embedded inside each folder. The widest
-widget determines the width of the folder. The tallest determines the height.
- If no folders contain an embedded widget, the size is detemined solely
-by the size of the tabs. <P>
-You can override either dimension with the container's
-<B>-width</B> and <B>-height</B> options.
-<H2><A NAME="sect6" HREF="#toc6">Container Operations</A></H2>
-All <B>container</B> operations are
-invoked by specifying the widget's pathname, the operation, and any arguments
-that pertain to that operation. The general form is: <P>
-<BR>
-<CODE><tt> </tt> <tt> </tt> <I>pathName operation </I>?<I>arg arg ...</I>?<BR>
-<P>
-</CODE><P><I>Operation</I> and the <I>arg</I>s determine the exact behavior of the command. The
-following operations are available for container widgets:
-<DL>
-
-<DT><I>pathName <B>cget</B></I>
-<I>option</I> </DT>
-<DD>Returns the current value of the configuration option given by <I>option</I>.
-<I>Option</I> may have any of the values accepted by the <B>configure</B> operation described
-below. </DD>
-
-<DT><I>pathName <B>configure</B></I> ?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify
-the configuration options of the widget. If no <I>option</I> is specified, returns
-a list describing all the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B>
-for information on the format of this list). If <I>option</I> is specified with
-no <I>value</I>, then the command returns a list describing the one named option
-(this list will be identical to the corresponding sublist of the value
-returned if no <I>option</I> is specified). If one or more <I>option-value</I> pairs are
-specified, then the command modifies the given widget option(s) to have
-the given value(s); in this case the command returns an empty string. <I>Option</I>
-and <I>value</I> are described below: <blockquote></DD>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets the border color of
-the container. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around
-the outside edge of the widget. The <B>-relief</B> option determines how the border
-is to be drawn. The default is <I>2</I>. </DD>
-
-<DT><B>-command <I>pattern</I></B> </DT>
-<DD>Specifies to search for
-a window whose <I>WM_COMMAND</I> property matches the given pattern. If no windows,
-or more than one window, matches the pattern, an error is generated. If
-<I>pattern</I> is the empty string, then no command search is performed. The default
-is <I>""</I>. </DD>
-
-<DT><B>-cursor <I>cursor</I></B> </DT>
-<DD>Specifies the widget's cursor. The default cursor is
-<I>""</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B> </DT>
-<DD>Specifies the requested height of widget. If <I>pixels</I> is
-0, then the height is height the embedded window plus the specified borderwidth.
-The default is <I>0</I>. </DD>
-
-<DT><B>-highlightbackground <I>color</I></B> </DT>
-<DD>Sets the color to display in
-the traversal highlight region when the container does not have the input
-focus. </DD>
-
-<DT><B>-highlightcolor <I>color</I></B> </DT>
-<DD>Sets the color to use for the traversal highlight
-rectangle that is drawn around the widget when it has the input focus.
-The default is <I>black</I>. </DD>
-
-<DT><B>-highlightthickness <I>pixels</I></B> </DT>
-<DD>Sets the width of the highlight
-rectangle to draw around the outside of the widget when it has the input
-focus. <I>Pixels</I> is a non-negative value and may have any of the forms acceptable
-to <B>Tk_GetPixels</B>. If the value is zero, no focus highlight is drawn around
-the widget. The default is <I>2</I>. </DD>
-
-<DT><B>-name <I>pattern</I></B> </DT>
-<DD>Specifies to search for a window
-whose <I>WM_NAME</I> property matches the given pattern. If no windows, or more
-than one window, matches the pattern, an error is generated. If <I>pattern</I>
-is the empty string, then no name search is performed. The default is <I>""</I>.
-</DD>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect for the container widget. <I>Relief</I>
-specifies how the container should appear relative to widget that it is
-packed into; for example, <I>raised</I> means the container should appear to protrude.
- The default is <I>sunken</I>. </DD>
-
-<DT><B>-takefocus</B> <I>focus</I> </DT>
-<DD>Provides information used when
-moving the focus from window to window via keyboard traversal (e.g., Tab
-and Shift-Tab). If <I>focus</I> is <I>0</I>, this means that this window should be skipped
-entirely during keyboard traversal. <I>1</I> means that the this window should
-always receive the input focus. An empty value means that the traversal
-scripts decide whether to focus on the window. The default is <I>1</I>. </DD>
-
-<DT><B>-width <I>pixels</I></B>
- </DT>
-<DD>Specifies the requested width of the widget. If <I>pixels</I> is 0, then the
-width is the width the embedded window and the specified borderwidth. The
-default is <I>0</I>. </DD>
-
-<DT><B>-window <I>id</I></B> </DT>
-<DD>Specifies the foreign embedded using its X window
-id. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>find <B>-command</B></B></I>|<B>-name</B> <I>pattern</I> </DT>
-<DD>Searches for all windows that match
-the given pattern. If the <B>-command</B> switch is given, all windows whose WWM_COMMAND
-property match <I>pattern</I> are returned in a list. If the <B>-name</B> switch is given,
-all windows whose WWM_NAME property match <I>pattern</I> are returned in a list.
- The list returned will contains pairs of the window id and the matching
-property. </DD>
-</DL>
-
-<H2><A NAME="sect7" HREF="#toc7">Keywords</A></H2>
-container, widget <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Example</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Syntax</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Container Operations</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/cutbuffer.html b/blt3.0.1/html/cutbuffer.html
deleted file mode 100644
index 9661d80..0000000
--- a/blt3.0.1/html/cutbuffer.html
+++ /dev/null
@@ -1,57 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>cutbuffer(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-cutbuffer - Manipulate X cut buffer properties
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>cutbuffer<I>
-get ?number?</I></B> <BR>
-<B>cutbuffer<I> rotate ?count?</I></B> <BR>
-<B>cutbuffer<I> set value ?number?</I></B>
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-<P>
-The <B>cutbuffer</B> command allows you
-to read or modify the eight X cut buffer properties. You can also rotate
-the buffers properties.
-<H2><A NAME="sect3" HREF="#toc3">Operations</A></H2>
-The following operations are available
-for the <B>cutbuffer</B> command:
-<DL>
-
-<DT><B>cutbuffer get <I>?number?</I></B> </DT>
-<DD>Returns the value of
-a cutbuffer <I>number</I>. <I>Number</I> must be a number between 0 and 7. The default
-is 0. The cutbuffer is returned exactly, except that NUL bytes are converted
-to '@' characters. If a cut buffer <I>number</I> does not exist, then <I>""</I> is returned.
-</DD>
-
-<DT><B>cutbuffer rotate <I>?count?</I></B> </DT>
-<DD>Rotates the cut buffers by <I>count</I>. <I>Count</I> must be
-a number between -7 and 7. The default is 1. </DD>
-
-<DT><B>cutbuffer set <I>value</I></B> ?<I>number</I>?
- </DT>
-<DD>Sets the cutbuffer <I>number</I> to <I>value</I>. <I>Number</I> must be a number between 0
-and 7. The default is 0. </DD>
-</DL>
-
-<H2><A NAME="sect4" HREF="#toc4">Keywords</A></H2>
-cut buffer, property <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Operations</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/dragdrop.html b/blt3.0.1/html/dragdrop.html
deleted file mode 100644
index 9773d9b..0000000
--- a/blt3.0.1/html/dragdrop.html
+++ /dev/null
@@ -1,479 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>drag&drop(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-drag&drop - facilities for handling drag&drop data
-transfers
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>drag&drop source </B><BR>
-<B>drag&drop source <I>window </I></B>?<I>options</I>? <BR>
-<B>drag&drop source <I>window <B>handler </B></I></B>?<I>dataType</I>? ?<I>command arg arg...</I>? <P>
-<B>drag&drop target
-</B><BR>
-<B>drag&drop target <I>window <B>handler </B></I></B>?<I>dataType command arg arg...</I>? <P>
-<B>drag&drop target
-<I>window <B>handle <I>dataType</I></B></I></B> ?<I>value</I>? <P>
-<B>drag&drop token <I>window </I></B><P>
-<B>drag&drop drag <I>window
-x y </I></B><BR>
-<B>drag&drop drop <I>window x y </I></B><BR>
-<B>drag&drop active </B><BR>
-<B>drag&drop errors </B>?<I>proc</I>? <BR>
-<B>drag&drop location </B>?<I>x y</I>? <P>
-
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-<P>
-The <B>drag&drop</B> command provides access
-to a set of facilities for managing drag-and-drop data transfers. Any of
-the usual Tk widgets can be registered to participate in the drag-and-drop
-process. Widgets registered as a drag&drop <I>source</I> can export data to other
-widgets registered as a drag&drop <I>target</I>. Note that a particular widget
-can be registered as a source, as a target, or as both. <P>
-The drag-and-drop
-process begins when the user clicks and holds a mouse button in a source
-window; a token window appears with an icon or message to represent the
-data being transferred. As the user moves the mouse pointer, the token
-window follows along, acting as a movable packet of data. Whenever the mouse
-pointer falls on a valid target window, the border of the token window
-is changed to a raised (active) state. When the mouse button is released
-over the target window, a Tcl routine is invoked to send the data to the
-desired application, and the target window is asked to "handle" the data.
- If this communication process fails, a rejection symbol (a circle with
-a line through it) is displayed on the token window to indicate failure.
-<P>
-The details of the communication process are fully configurable by the
-application developer. In the simplest case, the value that is sent to
-the target window is a simple string. The target window is simply asked
-to "handle" that string value. In general, the source window can have a
-special "handler" procedure to transfer a particular data type by issuing
-a series of "send" commands. After this, the target window is again asked
-to "handle" the result. <P>
-Both sources and targets can have a list of "handlers"
-for different data types. As a token window is dragged from its source
-to various targets, each target is checked to see if it recognizes a handler
-offered by the source. If it does, it is treated as a valid target. Otherwise,
-it is ignored. This scheme allows the same source to interact with many
-different kinds of targets. For example, a source for RGB color samples
-might have "color" and "string" handlers. This would allow it to communicate
-with "color" targets (sending RGB data) as well as entry widgets (sending
-strings of the form "#rrggbb"). <P>
-This introduction was presented as a brief
-overview of the communication process; further details are presented below:
-
-<DL>
-
-<DT><B>drag&drop source</B> </DT>
-<DD>Returns a list of path names for widgets registered as
-drag&drop sources. Returns an empty string if no widgets have been registered.
-</DD>
-
-<DT><B>drag&drop source <I>window </I></B>?<I>options</I>? </DT>
-<DD>Registers a new drag&drop source window
-with the given options, or modifies the options for an existing window:
-<blockquote></DD>
-</DL>
-<P>
-<BR>
-<PRE>Name:<tt> </tt> <tt> </tt> <B>buttonBinding</B>
-Class:<tt> </tt> <tt> </tt> <B>ButtonBinding</B>
-Switch:<tt> </tt> <tt> </tt> <B>-button</B> <I>n</I>
-</PRE>
-<DL>
-
-<DT>Specifies the mouse button (integer 1-5) that will invoke the drag&drop </DT>
-<DD>operation
-on the source window. This causes the following bindings to be added to
-the widget: <P>
-<BR>
-<PRE><I>bind <I>win</I></I> <ButtonPress-<I>n</I>> {drag&drop drag %W %X %Y}
-<I>bind <I>win</I></I> <B<I>n</I>-Motion> {drag&drop drag %W %X %Y}
-<I>bind <I>win</I></I> <ButtonRelease-<I>n</I>> {drag&drop drop %W %X %Y}
-</PRE><P>
-The default value is button 3. If the value "0" is specified, then no bindings
-are added; this enables the user to establish bindings manually. <P>
-<BR>
-<PRE>Name:<tt> </tt> <tt> </tt> <B>packageCommand</B>
-Class:<tt> </tt> <tt> </tt> <B>Command</B>
-Switch:<tt> </tt> <tt> </tt> <B>-packagecmd <I>command</I></B>
-</PRE>
-<DL>
-
-<DT>Specifies a Tcl command used to establish the appearance of the token </DT>
-<DD>window
-at the start of each drag&drop operation. This command is automatically
-invoked by the <B>drag&drop drag</B> command whenever the token window is about
-to be mapped for a drag operation. It should update the appearance of the
-token window to represent the data that is being moved. </DD>
-</DL>
-<P>
-The following substitutions
-are made in the <I>command</I> string before it is executed: <blockquote>
-<DL>
-
-<DT><B>%t</B> </DT>
-<DD>Replaced with
-the window path name for the token which represents the data being dragged.
-</DD>
-
-<DT><B>%W</B> </DT>
-<DD>Replaced with the window path name for the drag&drop source. </DD>
-</DL>
-</blockquote>
-<P>
-The return
-value from the package command represents the data being transferred. If
-the package command returns an empty string, the drag operation is quietly
-aborted. This can be used to disallow drag&drop operations from certain
-parts of a widget, if the drag position is inappropriate. <P>
-For example, the
-following package routine will select an item from a listbox and configure
-the token window to display the selected string. It uses the <B>drag&drop location</B>
-command to determine the entry in the listbox that the user has selected
-and it returns this as the data value: <P>
-<BR>
-<PRE><I>proc package_list_item {lbox token} {</I>
- set xy [drag&drop location]
- set y [expr [lindex $xy 1]-[winfo rooty $lbox]]
- set str [$lbox get [$lbox nearest $y]]
- $token.value configure -text $str
- return $str
-}
-</PRE><P>
-The return value is available later when the source and target communicate.
- If the source has a command associated with its data handler, then this
-value is substituted in place of "%v" in the source handler. Otherwise,
-it is substituted in place of "%v" in the target handler. <P>
-<BR>
-<PRE>Name:<tt> </tt> <tt> </tt> <B>rejectBackground</B>
-Class:<tt> </tt> <tt> </tt> <B>Background</B>
-Switch:<tt> </tt> <tt> </tt> <B>-rejectbg <I>color</I></B>
-</PRE>
-<DL>
-
-<DT>Specifies the color used to draw the background of the rejection symbol
-</DT>
-<DD>on the token window. The rejection symbol (a circle with a line through
-it--the international "no") appears whenever communication fails. </DD>
-</DL>
-<P>
-<BR>
-<PRE>Name:<tt> </tt> <tt> </tt> <B>rejectForeground</B>
-Class:<tt> </tt> <tt> </tt> <B>Foreground</B>
-Switch:<tt> </tt> <tt> </tt> <B>-rejectfg <I>color</I></B>
-</PRE>
-<DL>
-
-<DT>Specifies the color used to draw the foreground of the rejection symbol
-</DT>
-<DD>on the token window. </DD>
-</DL>
-<P>
-<BR>
-<PRE>Name:<tt> </tt> <tt> </tt> <B>rejectStipple</B>
-Class:<tt> </tt> <tt> </tt> <B>Stipple</B>
-Switch:<tt> </tt> <tt> </tt> <B>-rejectstipple <I>pattern</I></B>
-</PRE>
-<DL>
-
-<DT>Specifies a stipple pattern used to draw the foreground of the rejection
-</DT>
-<DD>symbol on the token window. Any of the forms acceptable to Tk_GetBitmap
-can be used. </DD>
-</DL>
-<P>
-<BR>
-<PRE>Name:<tt> </tt> <tt> </tt> <B>selfTarget</B>
-Class:<tt> </tt> <tt> </tt> <B>SelfTarget</B>
-Switch:<tt> </tt> <tt> </tt> <B>-selftarget <I>boolean</I></B>
-</PRE>
-<DL>
-
-<DT>If the <I>boolean</I> value is true, and if a source widget is also </DT>
-<DD>registered
-as a compatible target, then the source will be able to transmit to itself
-during drag&drop operations. This is primarily useful for complex sources
-such as a canvas widget, where items may be moved from place to place within
-the same widget. By default, this option is disabled. </DD>
-</DL>
-<P>
-<BR>
-<PRE>Name:<tt> </tt> <tt> </tt> <B>send</B>
-Class:<tt> </tt> <tt> </tt> <B>Send</B>
-Switch:<tt> </tt> <tt> </tt> <B>-send <I>list</I></B>
-</PRE>
-<DL>
-
-<DT>Specifies a <I>list</I> of <I>dataTypes</I> enabled for communication. Only </DT>
-<DD><I>dataTypes</I>
-defined by commands of the form "<B>drag&drop source <I>window <B>handler </B></I></B>?<I>dataType</I>
-?<I>command arg arg...</I>?" are allowed. This list also determines the priority
-of the various <I>dataTypes</I>. When a token window is over a potential drag&drop
-target, this list is searched from start to finish for a <I>dataType</I> that
-is also recognized by the target. The first matching <I>dataType</I> found determines
-the value that will be sent if the token is dropped. If no matching <I>dataType</I>
-is found, then the target is incompatible, and is ignored. By default,
-this option has the value "all", indicating that all <I>dataTypes</I> should be
-considered in the order that they were defined for the source. </DD>
-</DL>
-<P>
-Note that
-this option makes it easy to control a drag&drop source. Setting the value
-to an empty string disables the source; setting the value back to "all"
-restores communication. <P>
-<BR>
-<PRE>Name:<tt> </tt> <tt> </tt> <B>siteCommand</B>
-Class:<tt> </tt> <tt> </tt> <B>Command</B>
-Switch:<tt> </tt> <tt> </tt> <B>-sitecmd <I>command</I></B>
-</PRE>
-<DL>
-
-<DT>Specifies a Tcl command used to update the appearance of the token window.
-</DT>
-<DD>If specified, this command is automatically invoked by the <B>drag&drop drag</B>
-command whenever the token window is over a compatible drag&drop target.
-</DD>
-</DL>
-<P>
-The following substitutions are made in the <I>command</I> string before it is
-executed: <blockquote>
-<DL>
-
-<DT><B>%s</B> </DT>
-<DD>Replaced with "1" if the token window is over a compatible
-target, and "0" otherwise. </DD>
-
-<DT><B>%t</B> </DT>
-<DD>Replaced with the window path name for the
-token which represents the data being dragged. </DD>
-</DL>
-</blockquote>
-<P>
-Regardless of this command,
-border of the token window will become raised whenever the token is over
-a valid target. This command can be used to display other visual cues. <P>
-<BR>
-<PRE>Name:<tt> </tt> <tt> </tt> <B>tokenAnchor</B>
-Class:<tt> </tt> <tt> </tt> <B>Anchor</B>
-Switch:<tt> </tt> <tt> </tt> <B>-tokenanchor <I>anchor</I></B>
-</PRE>
-<DL>
-
-<DT>Specifies how the token window is positioned relative to the mouse </DT>
-<DD>pointer
-coordinates passed to the <B>drag&drop drag</B> command. Must be one of the values
-n, s, e, w, center, nw, ne, sw or se. For example, "nw" means to position
-the token such that its upper-left corner is at the mouse pointer. The default
-value is "center". </DD>
-</DL>
-<P>
-<BR>
-<PRE>Name:<tt> </tt> <tt> </tt> <B>tokenBackground</B>
-Class:<tt> </tt> <tt> </tt> <B>Background</B>
-Switch:<tt> </tt> <tt> </tt> <B>-tokenbg <I>color</I></B>
-</PRE>
-<DL>
-
-<DT>Specifies the color used to draw the background of the token window. </DT>
-<DD></DD>
-</DL>
-<P>
-<BR>
-<PRE>Name:<tt> </tt> <tt> </tt> <B>tokenBorderWidth</B>
-Class:<tt> </tt> <tt> </tt> <B>BorderWidth</B>
-Switch:<tt> </tt> <tt> </tt> <B>-tokenborderwidth <I>size</I></B>
-</PRE>
-<DL>
-
-<DT>Specifies the width in pixels of the border around the token window. </DT>
-<DD>This
-border becomes raised to indicate when the token is over a compatible drag&drop
-target site. The value may have any of the forms acceptable to Tk_GetPixels.
- The default value is "3". </DD>
-</DL>
-<P>
-<BR>
-<PRE>Name:<tt> </tt> <tt> </tt> <B>tokenCursor</B>
-Class:<tt> </tt> <tt> </tt> <B>Cursor</B>
-Switch:<tt> </tt> <tt> </tt> <B>-tokencursor <I>cursor</I></B>
-</PRE>
-<DL>
-
-<DT>Specifies the cursor used when a token window is active. The value </DT>
-<DD>may
-have any of the forms acceptable to Tk_GetCursor. The default value is
-"center_ptr". </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>drag&drop source <I>window <B>handler </B></I></B>?<I>dataType</I>? ?<I>command arg arg...</I>?
-</DT>
-<DD>With no extra arguments, this command returns a list of all <I>dataType</I> names
-that have been registered for the source <I>window</I>. If only the <I>dataType</I> is
-specified, then the <I>dataType</I> is created if necessary, and the command associated
-with the <I>dataType</I> is returned. Otherwise, it concatenates the <I>command</I> and
-any extra <I>arg</I> strings, and registers a new <I>dataType</I> with this command. </DD>
-</DL>
-<P>
-The
-following substitutions are made in the <I>command</I> string before it is executed:
-<blockquote>
-<DL>
-
-<DT><B>%i</B> </DT>
-<DD>Replaced with the name of the interpreter for the target application.
-</DD>
-
-<DT><B>%v</B> </DT>
-<DD>Replaced with the value returned from the "-packagecmd" command. </DD>
-
-<DT><B>%w</B> </DT>
-<DD>Replaced
-with the window path name for the target window. </DD>
-</DL>
-</blockquote>
-<P>
-A typical source handler
-contains one or more "send" commands which transfer data to the remote
-application. The target window is then asked to handle the new data. Whatever
-value is returned by the source <I>command</I> handler is automatically substituted
-into the "%v" fields of the target handler. <P>
-This separation between the
-transfer and the handling of the data is important. It allows the same
-source handler to transfer data for many different targets, and it allows
-each of the targets to handle the incoming data differently. If an error
-is encountered during the communication process, the rejection symbol is
-posted on the token window to indicate failure. </blockquote>
-<P>
-
-<DL>
-
-<DT><B>drag&drop target</B> </DT>
-<DD>Returns
-a list of path names for widgets registered as drag&drop targets. Returns
-an empty string if no widgets have been registered. </DD>
-
-<DT><B>drag&drop target <I>window
-<B>handler </B></I></B>?<I>dataType command arg arg...</I>? </DT>
-<DD>Registers a new drag&drop target window
-with a given handler, or modifies the handlers for an existing window.
-If no <I>dataType</I> is specified, this command returns the current list of recognized
-<I>dataType</I> strings. Each <I>dataType</I> is a symbolic name representing a form
-of data, and the corresponding <I>command</I> is a Tcl command that specifies
-how the target will make use of the data. This command is invoked indirectly
-after a source has transferred data to a target application. </DD>
-</DL>
-<P>
-The following
-substitutions are made in the <I>command</I> string before it is executed: <blockquote>
-<DL>
-
-<DT><B>%v</B>
-</DT>
-<DD>In the simplest case, the source window does not have a handler command
-for the selected <I>dataType</I>, and this field is replaced with the result from
-the "-packagecmd" command. When the source does have a handler command,
-the result from the "-packagecmd" command is substituted into its "%v" field,
-and the result from this command is substituted into this field in the
-target command. </DD>
-
-<DT><B>%W</B> </DT>
-<DD>Replaced with the window path name for the target window.
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>drag&drop target <I>window </I></B>handle <I>dataType</I> ?<I>value</I>? </DT>
-<DD>Searches for the given <I>dataType</I>
-name among the handlers registered for the target <I>window</I>, and invokes the
-appropriate <I>command</I>. If a <I>value</I> is specified, it is substituted into any
-"%v" fields in the handler command associated with the <I>dataType</I>. If the
-<I>dataType</I> name is not recognized, this command returns an error. This command
-is invoked automatically by the drag&drop facility when data is being transferred
-from a source to a target. </DD>
-
-<DT><B>drag&drop token <I>window</I></B> </DT>
-<DD>Returns the token window
-associated with a drag&drop source <I>window</I>. The token window is used to represent
-data as it is being dragged from the source to a target. When a source
-is first established, its token window must be filled with widgets to display
-the source data. For example, <P>
-<BR>
-<PRE><I>drag&drop source .foo</I>
-set win [drag&drop token .foo]
-label $win.label -text "Data"
-pack $win.label
-</PRE><P>
-
-<DL>
-
-<DT><B>drag&drop drag <I>window x y</I></B> </DT>
-<DD>Marks the start of (or movement during) a drag&drop
-operation. If the token window is unmapped when this command is invoked,
-then the <B>-packagecmd</B> for the source <I>window</I> is executed. If this command
-is successful and returns a non-null string, the token window is mapped.
- On subsequent calls, the token window is moved to the new <I>x y</I> location.
- Unless the "<B>-button 0</B>" option is specified for the source, this command
-is automatically bound to <ButtonPress-<I>n</I>> and <B<I>n</I>-Motion> events for "<B>-button
-<I>n</I></B>" of the source widget. </DD>
-
-<DT><B>drag&drop drop <I>window x y</I></B> </DT>
-<DD>Marks the end of a drag&drop
-operation. If the mouse pointer is over a compatible target window, then
-the appropriate send handler for the first compatible <I>dataType</I> is invoked
-to handle the data transfer. If the data transfer is successful, then the
-token window is unmapped; otherwise, a rejection symbol is drawn on the
-token window, and the window is unmapped after a small delay. Unless the
-"<B>-button 0</B>" option is specified for the source, this command is automatically
-bound to the <ButtonRelease-<I>n</I>> event for "<B>-button <I>n</I></B>" of the source widget. </DD>
-
-<DT><B>drag&drop
-active</B> </DT>
-<DD>Returns "1" if a drag&drop operation is in progress, and "0" otherwise.
-A drag&drop operation officially starts after the package command has been
-executed successfully, and ends after the send handler has been executed
-(successfully or otherwise). </DD>
-
-<DT><B>drag&drop errors </B>?<I>proc</I>? </DT>
-<DD>Specifies a Tcl <I>proc</I>
-used to handle errors encountered during drag&drop operations. If a <I>proc</I>
-is not specified, this command returns the current error handler. By default,
-all errors are sent to the usual <B>tkerror</B> command, and therefore appear
-in a dialog box to the user. This behavior is quite useful when debugging
-communication protocols, but may not be desirable in a finished application.
- Errors can be suppressed entirely (leaving the rejection symbol as the
-only error indicator) by specifying a null string in place of the <I>proc</I>
-name. </DD>
-
-<DT><B>drag&drop location </B>?<I>x y</I>? </DT>
-<DD>Used to set or query the pointer location
-during a drag&drop operation. The <I>x y</I> arguments specify the current location;
-if these arguments are missing, then the last reported (x,y) location is
-returned as a list with two elements. This command is issued automatically
-within the <B>drag&drop drag</B> and <B>drag&drop drop</B> commands, to keep track of pointer
-movement. <P>
- </DD>
-</DL>
-
-<H2><A NAME="sect3" HREF="#toc3">Keywords</A></H2>
-drag&drop, send, bind, widget <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/eps.html b/blt3.0.1/html/eps.html
deleted file mode 100644
index 58d5c70..0000000
--- a/blt3.0.1/html/eps.html
+++ /dev/null
@@ -1,1231 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>graph(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-eps - Encapsulated PostScript canvas item.
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<I>canvas<B>
-create eps <I>x y </I></B></I>?<I>option value</I>?...
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>eps</B> canvas item lets you place
-encapulated PostScript (EPS) on a canvas, controlling its size and placement.
- The EPS item is displayed either as a solid rectangle or a preview image.
- The preview image is designated in one of two ways: 1) the EPS file contains
-an ASCII hexidecimal preview, or 2) a Tk photo image. When the canvas generates
-PostScript output, the EPS will be inserted with the proper translation
-and scaling to match that of the EPS item. So can use the canvas widget
-as a page layout tool.
-<H2><A NAME="sect3" HREF="#toc3">Example</A></H2>
-Let's say you have for PostScript files of
-four graphs which you want to tile two-by-two on a single page. Maybe you'd
-like to annotate the graphs by putting a caption at the bottom of each
-graph. <P>
-Normally, you would have to resort to an external tool or write your
-own PostScript program. The <B>eps</B> canvas item lets you do this through Tk's
-canvas widget. An <B>eps</B> item displays an image (or rectangle) representing
-the encapsulated PostScript file. It also scales and translates the EPS
-file when the canvas is printed. <P>
-
-<H2><A NAME="sect4" HREF="#toc4">Syntax</A></H2>
-<BR>
-<P>
-<CODE><I>canvas <B>create eps <I>x y </I></B></I>?<I>option value</I>?...<BR>
-</CODE><P>The <B>eps</B> item creates a new canvas item. <I>Canvas</I> is the name of a <B>canvas</B> widget.
- You must supply the X-Y coordinate of the new eps item. How the coordinate
-is exactly interpretered is controlled by the <B>-anchor</B> option (see below).
-<P>
-Additional options may be specified on the command line to configure aspects
-of the eps item such as its color, stipple, and font. The following <I>option</I>
-and <I>value</I> pairs are valid.
-<DL>
-
-<DT><B>-anchor <I>anchor</I></B> </DT>
-<DD>Tells how to position the EPS item
-relative to its X-Y coordinate. The default is <I>center</I>. </DD>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets
-the background color of the EPS rectangle. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of the 3-D border around the outside edge of the item. The <B>-relief</B> option
-determines if the border is to be drawn. The default is <I>0</I>. </DD>
-
-<DT><B>-file <I>fileName</I></B>
-</DT>
-<DD>Specifies the name of the EPS file. The first line of an EPS file must
-start with "%!PS" and contain a "EPS" version specification. The other
-requirement is that there be a "%%BoundingBox:" entry which contains four
-integers representing the lower-left and upper-right coordinates of the area
-bounding the EPS. The default is <I>""</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Specifies the font of
-the title. The default is <I>*-Helvetica-Bold-R-Normal-*-18-180-*</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B>
-</DT>
-<DD>Specifies the foreground color of the EPS rectangle. The option matters
-only when the <B>-stipple</B> option is set. The default is <I>white</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B>
-</DT>
-<DD>Specifies the height EPS item. If <I>pixels</I> is <I>0</I>, then the height is determined
-from the PostScript "BoundingBox:" entry in the EPS file. The default is
-<I>0</I>. </DD>
-
-<DT><B>-image <I>photo</I></B> </DT>
-<DD>Specifies the name of a Tk photo image to be displayed as
-in the item as a preview image. This option overrides any preview specification
-found in the EPS file. The default is <I>""</I>. </DD>
-
-<DT><B>-justify <I>justify</I></B> </DT>
-<DD>Specifies how the
-title should be justified. This matters only when the title contains more
-than one line of text. <I>Justify</I> must be <I>left</I>, <I>right</I>, or <I>center</I>. The default
-is <I>center</I>. </DD>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect for the EPS item. <I>Relief</I>
-specifies how the item should appear relative to canvas; for example,
-<I>raised</I> means the item should appear to protrude. The default is <I>flat</I>. </DD>
-
-<DT><B>-shadowcolor
-<I>color</I></B> </DT>
-<DD>Specifies the color of the drop shadow used for the title. The option
-with the <B>-shadowoffset</B> option control how the title's drop shadow appears.
-The default is <I>grey</I>. </DD>
-
-<DT><B>-shadowoffset <I>pixels</I></B> </DT>
-<DD>Specifies the offset of the drop
-shadow from the title's text. If <I>pixels</I> is <I>0</I>, no shadow will be seen. The
-default is <I>0</I>. </DD>
-
-<DT><B>-showimage <I>boolean</I></B> </DT>
-<DD>Indicates whether to display the image preview
-(if one exists), or a simple rectangle. The default is <I>yes</I>. </DD>
-
-<DT><B>-stipple <I>bitmap</I></B>
-</DT>
-<DD>Specifies a bitmap to used to stipple the rectangle representing the EPS
-item. The default is <I>""</I>. </DD>
-
-<DT><B>-title <I>string</I></B> </DT>
-<DD>Sets the title of the EPS item. If
-<I>string</I> is <I>""</I>, then the title specified by the PostScript "Title:" entry
-is used. You can set the string a single space to display no title. The
-default is <I>""</I>. </DD>
-
-<DT><B>-titleanchor <I>anchor</I></B> </DT>
-<DD>Tells how to position the title within
-EPS item. The default is <I>n</I>. </DD>
-
-<DT><B>-titlecolor <I>color</I></B> </DT>
-<DD>Specifies the color of the title.
- The default is <I>white</I>. </DD>
-
-<DT><B>-titlerotate <I>degrees</I></B> </DT>
-<DD>Sets the rotation of the title.
- <I>Degrees</I> is a real number representing the angle of rotation. The title
-is first rotated in space and then placed according to the <B>-titleanchor</B>
-position. The default rotation is <I>0.0</I>. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Specifies the width EPS
-item. If <I>pixels</I> is <I>0</I>, then the width is determined from the PostScript
-"BoundingBox:" entry in the EPS file. The default is <I>0</I>. <I>5i</I>. </DD>
-</DL>
-
-<H2><A NAME="sect5" HREF="#toc5">Example</A></H2>
-The <B>graph</B>
-command creates a new graph. <BR>
-<CODE># Create a new graph. Plotting area is black.<BR>
-graph .g -plotbackground black<BR>
-</CODE><P>A new Tcl command <I>.g</I> is also created. This command can be used to query
-and modify the graph. For example, to change the title of the graph to
-"My Plot", you use the new command and the graph's <B>configure</B> operation. <BR>
-<CODE># Change the title.<BR>
-.g configure -title "My Plot"<BR>
-</CODE><P>A graph has several components. To access a particular component you use
-the component's name. For example, to add data elements, you use the new
-command and the <B>element</B> component. <BR>
-<CODE># Create a new element named "line1"<BR>
-.g element create line1 \<BR>
-<tt> </tt> <tt> </tt> -xdata { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 } \<BR>
-<tt> </tt> <tt> </tt> -ydata { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 <BR>
-<tt> </tt> <tt> </tt> <tt> </tt> <tt> </tt> 155.85 166.60 175.38 }<BR>
-</CODE><P>The element's X and Y coordinates are specified using lists of numbers.
-Alternately, BLT vectors could be used to hold the X-Y coordinates. <BR>
-<CODE># Create two vectors and add them to the graph.<BR>
-vector xVec yVec<BR>
-xVec set { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 }<BR>
-yVec set { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 155.85 <BR>
-<tt> </tt> <tt> </tt> 166.60 175.38 }<BR>
-.g element create line1 -xdata xVec -ydata yVec<BR>
-</CODE><P>The advantage of using vectors is that when you modify one, the graph is
-automatically redrawn to display the new values. <BR>
-<CODE># Change the X-Y coordinates of the first point.<BR>
-set xVec(0) 0.18<BR>
-set yVec(0) 25.18<BR>
-</CODE><P>An element named <I>line1</I> is now created in <I>.g</I>. By default, the element's label
-in the legend will be also <I>line1</I>. You can change the label, or specify no
-legend entry, again using the element's <B>configure</B> operation. <BR>
-<CODE># Don't display "line1" in the legend.<BR>
-.g element configure line1 -label ""<BR>
-</CODE><P>You can configure more than just the element's label. An element has many
-attributes such as symbol type and size, dashed or solid lines, colors,
-line width, etc. <BR>
-<CODE>.g element configure line1 -symbol square -color red \<BR>
-<tt> </tt> <tt> </tt> -dashes { 2 4 2 } -linewidth 2 -pixels 2c<BR>
-</CODE><P>Four coordinate axes are automatically created: <I>x</I>, <I>x2</I>, <I>y</I>, and <I>y2</I>. And by
-default, elements are mapped onto the axes <I>x</I> and <I>y</I>. This can be changed
-with the <B>-mapx</B> and <B>-mapy</B> options. <BR>
-<CODE># Map "line1" on the alternate Y-axis "y2".<BR>
-.g element configure line1 -mapy y2<BR>
-</CODE><P>Axes can be configured in many ways too. For example, you change the scale
-of the Y-axis from linear to log using the <B>axis</B> component. <BR>
-<CODE># Y-axis is log scale.<BR>
-.g axis configure y -logscale yes<BR>
-</CODE><P>One important way axes are used is to zoom in on a particular data region.
- Zooming is done by simply specifying new axis limits using the <B>-min</B> and
-<B>-max</B> configuration options. <BR>
-<CODE>.g axis configure x -min 1.0 -max 1.5<BR>
-.g axis configure y -min 12.0 -max 55.15<BR>
-</CODE><P>To zoom interactively, you link the axis <B>configure</B> operations with some
-user interaction (such as pressing the mouse button), using the <B>bind</B> command.
- To convert between screen and graph coordinates, use the <B>invtransform</B>
-operation. <BR>
-<CODE># Click the button to set a new minimum <BR>
-bind .g <ButtonPress-1> { <BR>
- %W axis configure x -min [%W axis invtransform x %x]<BR>
- %W axis configure x -min [%W axis invtransform x %y]<BR>
-}<BR>
-</CODE><P>By default, the limits of the axis are determined from data values. To reset
-back to the default limits, set the <B>-min</B> and <B>-max</B> options to the empty value.
-<BR>
-<CODE># Reset the axes to autoscale again.<BR>
-.g axis configure x -min {} -max {}<BR>
-.g axis configure y -min {} -max {}<BR>
-</CODE><P>By default, the legend is drawn in the right margin. You can change this
-or any legend configuration options using the <B>legend</B> component. <BR>
-<CODE># Configure the legend font, color, and relief<BR>
-.g legend configure -position left -relief raised \<BR>
-<tt> </tt> <tt> </tt> -font fixed -fg blue<BR>
-</CODE><P>To prevent the legend from being displayed, turn on the <B>-hide</B> option. <BR>
-<CODE># Don't display the legend.<BR>
-.g legend configure -hide yes<BR>
-</CODE><P>The <B>graph</B> widget has simple drawing procedures called markers. They can
-be used to highlight or annotate data in the graph. The types of markers
-available are bitmaps, images, polygons, lines, or windows. Markers can
-be used, for example, to mark or brush points. In this example, is a text
-marker that labels the data first point. Markers are created using the
-<B>marker</B> component. <BR>
-<CODE># Create a label for the first data point of "line1".<BR>
-.g marker create text -name first_marker -coords { 0.2 26.18 } \<BR>
-<tt> </tt> <tt> </tt> -text "start" -anchor se -xoffset -10 -yoffset -10<BR>
-</CODE><P>This creates a text marker named <I>first_marker</I>. It will display the text
-"start" near the coordinates of the first data point. The <B>-anchor</B>, <B>-xoffset</B>,
-and <B>-yoffset</B> options are used to display the marker above and to the left
-of the data point, so that the data point isn't covered by the marker. By
-default, markers are drawn last, on top of data. You can change this with
-the <B>-under</B> option. <BR>
-<CODE># Draw the label before elements are drawn.<BR>
-.g marker configure first_marker -under yes<BR>
-</CODE><P>You can add cross hairs or grid lines using the <B>crosshairs</B> and <B>grid</B> components.
-<BR>
-<CODE># Display both cross hairs and grid lines.<BR>
-.g crosshairs configure -hide no -color red<BR>
-.g grid configure -hide no -dashes { 2 2 }<BR>
-</CODE><P>Finally, to get hardcopy of the graph, use the <B>postscript</B> component. <BR>
-<CODE># Print the graph into file "file.ps"<BR>
-.g postscript output file.ps -maxpect yes -decorations no<BR>
-</CODE><P>This generates a file <I>file.ps</I> containing the encapsulated PostScript of
-the graph. The option <B>-maxpect</B> says to scale the plot to the size of the
-page. Turning off the <B>-decorations</B> option denotes that no borders or color
-backgrounds should be drawn (i.e. the background of the margins, legend,
-and plotting area will be white).
-<H2><A NAME="sect6" HREF="#toc6">Graph Operations</A></H2>
-
-<DL>
-
-<DT><I>pathName <B>axis <I>operation
-</I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>AXIS COMPONENTS</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>bar <I>elemName </I></B></I>?<I>option value</I>?...
-</DT>
-<DD>Creates a new barchart element <I>elemName</I>. It's an error if an element <I>elemName</I>
-already exists. See the manual for <B>barchart</B> for details about what <I>option</I>
-and <I>value</I> pairs are valid. </DD>
-
-<DT><I>pathName <B>cget</B></I> <I>option</I> </DT>
-<DD>Returns the current value
-of the configuration option given by <I>option</I>. <I>Option</I> may be any option described
-below for the <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>configure </B></I>?<I>option value</I>?... </DT>
-<DD>Queries
-or modifies the configuration options of the graph. If <I>option</I> isn't specified,
-a list describing the current options for <I>pathName</I> is returned. If <I>option</I>
-is specified, but not <I>value</I>, then a list describing <I>option</I> is returned.
-If one or more <I>option</I> and <I>value</I> pairs are specified, then for each pair,
-the option <I>option</I> is set to <I>value</I>. The following options are valid. <blockquote></DD>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Sets the background color. This includes the margins and legend, but
-not the plotting area. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border
-around the outside edge of the widget. The <B>-relief</B> option determines if
-the border is to be drawn. The default is <I>2</I>. </DD>
-
-<DT><B>-bottommargin <I>pixels</I></B> </DT>
-<DD>Specifies
-the size of the margin below the X-coordinate axis. If <I>pixels</I> is <I>0</I>, the
-size of the margin is selected automatically. The default is <I>0</I>. </DD>
-
-<DT><B>-bufferelements
-<I>boolean</I></B> </DT>
-<DD>Indicates whether an internal pixmap to buffer the display of data
-elements should be used. If <I>boolean</I> is true, data elements are drawn to
-an internal pixmap. This option is especially useful when the graph is
-redrawn frequently while the remains data unchanged (for example, moving
-a marker across the plot). See the <FONT SIZE=-1><B>SPEED TIPS</B></FONT>
- section. The default is <I>1</I>.
-</DD>
-
-<DT><B>-cursor <I>cursor</I></B> </DT>
-<DD>Specifies the widget's cursor. The default cursor is <I>crosshair</I>.
-</DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Specifies the font of the graph title. The default is <I>*-Helvetica-Bold-R-Normal-*-18-180-*</I>.
-</DD>
-
-<DT><B>-halo <I>pixels</I></B> </DT>
-<DD>Specifies a maximum distance to consider when searching for
-the closest data point (see the element's <B>closest</B> operation below). Data
-points further than <I>pixels</I> away are ignored. The default is <I>0.5i</I>. </DD>
-
-<DT><B>-height
-<I>pixels</I></B> </DT>
-<DD>Specifies the requested height of widget. The default is <I>4i</I>. </DD>
-
-<DT><B>-invertxy
-<I>boolean</I></B> </DT>
-<DD>Indicates whether the placement X-axis and Y-axis should be inverted.
- If <I>boolean</I> is true, the X and Y axes are swapped. The default is <I>0</I>. </DD>
-
-<DT><B>-justify
-<I>justify</I></B> </DT>
-<DD>Specifies how the title should be justified. This matters only
-when the title contains more than one line of text. <I>Justify</I> must be <I>left</I>,
-<I>right</I>, or <I>center</I>. The default is <I>center</I>. </DD>
-
-<DT><B>-leftmargin <I>pixels</I></B> </DT>
-<DD>Sets the size
-of the margin from the left edge of the window to the Y-coordinate axis.
- If <I>pixels</I> is <I>0</I>, the size is calculated automatically. The default is <I>0</I>.
-</DD>
-
-<DT><B>-plotbackground <I>color</I></B> </DT>
-<DD>Specifies the background color of the plotting area.
- The default is <I>white</I>. </DD>
-
-<DT><B>-plotborderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border
-around the plotting area. The <B>-plotrelief</B> option determines if a border
-is drawn. The default is <I>2</I>. </DD>
-
-<DT><B>-plotpadx <I>pad</I></B> </DT>
-<DD>Sets the amount of padding to be
-added to the left and right sides of the plotting area. <I>Pad</I> can be a list
-of one or two screen distances. If <I>pad</I> has two elements, the left side
-of the plotting area entry is padded by the first distance and the right
-side by the second. If <I>pad</I> is just one distance, both the left and right
-sides are padded evenly. The default is <I>8</I>. </DD>
-
-<DT><B>-plotpady <I>pad</I></B> </DT>
-<DD>Sets the amount
-of padding to be added to the top and bottom of the plotting area. <I>Pad</I>
-can be a list of one or two screen distances. If <I>pad</I> has two elements,
-the top of the plotting area is padded by the first distance and the bottom
-by the second. If <I>pad</I> is just one distance, both the top and bottom are
-padded evenly. The default is <I>8</I>. </DD>
-
-<DT><B>-plotrelief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect
-for the plotting area. <I>Relief</I> specifies how the interior of the plotting
-area should appear relative to rest of the graph; for example, <I>raised</I> means
-the plot should appear to protrude from the graph, relative to the surface
-of the graph. The default is <I>sunken</I>. </DD>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect
-for the graph widget. <I>Relief</I> specifies how the graph should appear relative
-to widget it is packed into; for example, <I>raised</I> means the graph should
-appear to protrude. The default is <I>flat</I>. </DD>
-
-<DT><B>-rightmargin <I>pixels</I></B> </DT>
-<DD>Sets the size
-of margin from the plotting area to the right edge of the window. By default,
-the legend is drawn in this margin. If <I>pixels</I> is than 1, the margin size
-is selected automatically. </DD>
-
-<DT><B>-takefocus</B> <I>focus</I> </DT>
-<DD>Provides information used when
-moving the focus from window to window via keyboard traversal (e.g., Tab
-and Shift-Tab). If <I>focus</I> is <I>0</I>, this means that this window should be skipped
-entirely during keyboard traversal. <I>1</I> means that the this window should
-always receive the input focus. An empty value means that the traversal
-scripts make the decision whether to focus on the window. The default is
-<I>""</I>. </DD>
-
-<DT><B>-tile <I>image</I></B> </DT>
-<DD>Specifies a tiled background for the widget. If <I>image</I> isn't
-<I>""</I>, the background is tiled using <I>image</I>. Otherwise, the normal background
-color is drawn (see the <B>-background</B> option). <I>Image</I> must be an image created
-using the Tk <B>image</B> command. The default is <I>""</I>. </DD>
-
-<DT><B>-title <I>text</I></B> </DT>
-<DD>Sets the title
-to <I>text</I>. If <I>text</I> is <I>""</I>, no title will be displayed. </DD>
-
-<DT><B>-topmargin <I>pixels</I></B> </DT>
-<DD>Specifies
-the size of the margin above the x2 axis. If <I>pixels</I> is <I>0</I>, the margin size
-is calculated automatically. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Specifies the requested width
-of the widget. The default is <I>5i</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>crosshairs <I>operation </I></B></I>?<I>arg</I>? </DT>
-<DD>See
-the <FONT SIZE=-1><B>CROSSHAIRS COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>element <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See
-the <FONT SIZE=-1><B>ELEMENT COMPONENTS</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>extents <I>item</I></B></I> </DT>
-<DD>Reports the size
-of a particular items in the graph. <I>Item</I> must be either <I>leftmargin</I>, <I>rightmargin</I>,
-<I>topmargin</I>, <I>bottommargin</I>, <I>plotwidth</I>, or <I>plotheight</I>. </DD>
-
-<DT><I>pathName <B>grid <I>operation
-</I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>GRID COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>invtransform <I>winX winY</I></B></I>
- </DT>
-<DD>Performs an inverse coordinate transformation, mapping window coordinates
-back to graph coordinates, using the standard X-axis and Y-axis. Returns a
-list of containing the X-Y y graph coordinates. </DD>
-
-<DT><I>pathName <B>inside <I>x y</I></B></I> </DT>
-<DD>Returns
-<I>1</I> is the designated screen coordinate (<I>x</I> and <I>y</I>) is inside the plotting
-area and <I>0</I> otherwise. </DD>
-
-<DT><I>pathName <B>legend <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>LEGEND COMPONENT</B></FONT>
-
- section. </DD>
-
-<DT><I>pathName <B>line<B> operation arg</B></B></I>... </DT>
-<DD>The operation is the same as <B>element</B>.
-</DD>
-
-<DT><I>pathName <B>marker <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>MARKER COMPONENTS</B></FONT>
- section. </DD>
-
-<DT><I>pathName
-<B>postscript <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>POSTSCRIPT COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName
-<B>snap <I>photoName</I></B></I> </DT>
-<DD>Takes a snapshot of the graph and stores the contents in
-the photo image <I>photoName</I>. <I>PhotoName</I> is the name of a Tk photo image that
-must already exist. </DD>
-
-<DT><I>pathName <B>transform <I>x y</I></B></I> </DT>
-<DD>Performs a coordinate transformation,
-mapping graph coordinates to window coordinates, using the standard X-axis
-and Y-axis. Returns a list containing the X-Y screen coordinates. </DD>
-
-<DT><I>pathName
-<B>xaxis <I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <B>x2axis <I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <B>yaxis <I>operation</I></B></I>
-?<I>arg</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <B>y2axis <I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>AXIS COMPONENTS</B></FONT>
- section.
-</DD>
-</DL>
-
-<H2><A NAME="sect7" HREF="#toc7">Graph Components</A></H2>
-A graph is composed of several components: coordinate axes,
-data elements, legend, grid, cross hairs, postscript, and annotation markers.
-Instead of one big set of configuration options and operations, the graph
-is partitioned, where each component has its own configuration options
-and operations that specifically control that aspect or part of the graph.
-
-<H3><A NAME="sect8" HREF="#toc8">Axis Components</A></H3>
-Four coordinate axes are automatically created: two X-coordinate
-axes (<I>x</I> and <I>x2</I>) and two Y-coordinate axes (<I>y</I>, and <I>y2</I>). By default, the axis
-<I>x</I> is located in the bottom margin, <I>y</I> in the left margin, <I>x2</I> in the top
-margin, and <I>y2</I> in the right margin. <P>
-An axis consists of the axis line, title,
-major and minor ticks, and tick labels. Major ticks are drawn at uniform
-intervals along the axis. Each tick is labeled with its coordinate value.
- Minor ticks are drawn at uniform intervals within major ticks. <P>
-The range
-of the axis controls what region of data is plotted. Data points outside
-the minimum and maximum limits of the axis are not plotted. By default,
-the minimum and maximum limits are determined from the data, but you can
-reset either limit. <P>
-You can create and use several axes. To create an axis,
-invoke the axis component and its create operation. <BR>
-<CODE># Create a new axis called "tempAxis"<BR>
-.g axis create tempAxis<BR>
-</CODE><P>You map data elements to an axis using the element's -mapy and -mapx configuration
-options. They specify the coordinate axes an element is mapped onto. <BR>
-<CODE># Now map the tempAxis data to this axis.<BR>
-.g element create "e1" -xdata $x -ydata $y -mapy tempAxis<BR>
-</CODE><P>While you can create many axes, only four can be displayed simultaneously.
-They are drawn in each of the margins surrounding the plotting area. The
-axes <I>x</I> and <I>y</I> are drawn in the bottom and left margins. The axes <I>x2</I> and <I>y2</I>
-are drawn in top and right margins. Only <I>x</I> and <I>y</I> are shown by default. Note
-that the axes can have different scales. <P>
-To display a different axis, you
-invoke one of the following components: <B>xaxis</B>, <B>yaxis</B>, <B>x2axis</B>, and <B>y2axis</B>.
-The <B>use</B> operation designates the axis to be drawn in the corresponding
-margin: <B>xaxis</B> in the bottom, <B>yaxis</B> in the left, <B>x2axis</B> in the top, and
-<B>y2axis</B> in the right. <BR>
-<CODE># Display the axis tempAxis in the left margin.<BR>
-.g yaxis use tempAxis<BR>
-<P>
-</CODE><P>You can configure axes in many ways. The axis scale can be linear or logarithmic.
- The values along the axis can either monotonically increase or decrease.
- If you need custom tick labels, you can specify a Tcl procedure to format
-the label any way you wish. You can control how ticks are drawn, by changing
-the major tick interval or the number of minor ticks. You can define non-uniform
-tick intervals, such as for time-series plots. <P>
-
-<DL>
-
-<DT><I>pathName <B>axis <B>cget <I>axisName
-<I>option</I></I></B></B></I> </DT>
-<DD>Returns the current value of the option given by <I>option</I> for <I>axisName</I>.
- <I>Option</I> may be any option described below for the axis <B>configure</B> operation.
-</DD>
-
-<DT><I>pathName <B>axis <B>configure <I>axisName </I></B></B></I>?<I>axisName</I>?... ?<I>option value</I>?... </DT>
-<DD>Queries or modifies
-the configuration options of <I>axisName</I>. Several axes can be changed. If <I>option</I>
-isn't specified, a list describing all the current options for <I>axisName</I>
-is returned. If <I>option</I> is specified, but not <I>value</I>, then a list describing
-<I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs are specified,
-then for each pair, the axis option <I>option</I> is set to <I>value</I>. The following
-options are valid for axes. <blockquote></DD>
-
-<DT><B>-color <I>color</I></B> </DT>
-<DD>Sets the color of the axis and tick
-labels. The default is <I>black</I>. </DD>
-
-<DT><B>-command <I>prefix</I></B> </DT>
-<DD>Specifies a Tcl command to be
-invoked when formatting the axis tick labels. <I>Prefix</I> is a string containing
-the name of a Tcl proc and any extra arguments for the procedure. This
-command is invoked for each major tick on the axis. Two additional arguments
-are passed to the procedure: the pathname of the widget and the current
-the numeric value of the tick. The procedure returns the formatted tick
-label. If <I>""</I> is returned, no label will appear next to the tick. You can
-get the standard tick labels again by setting <I>prefix</I> to <I>""</I>. The default
-is <I>""</I>. <P>
-Please note that this procedure is invoked while the graph is redrawn.
-You may query configuration options. But do not them, because this can
-have unexpected results. </DD>
-
-<DT><B>-descending <I>boolean</I></B> </DT>
-<DD>Indicates whether the values
-along the axis are monotonically increasing or decreasing. If <I>boolean</I> is
-true, the axis values will be decreasing. The default is <I>0</I>. </DD>
-
-<DT><B>-hide <I>boolean</I></B>
-</DT>
-<DD>Indicates whether the axis is displayed. </DD>
-
-<DT><B>-justify <I>justify</I></B> </DT>
-<DD>Specifies how
-the axis title should be justified. This matters only when the axis title
-contains more than one line of text. <I>Justify</I> must be <I>left</I>, <I>right</I>, or <I>center</I>.
- The default is <I>center</I>. </DD>
-
-<DT><B>-limits <I>formatStr</I></B> </DT>
-<DD>Specifies a printf-like description
-to format the minimum and maximum limits of the axis. The limits are displayed
-at the top/bottom or left/right sides of the plotting area. <I>FormatStr</I> is
-a list of one or two format descriptions. If one description is supplied,
-both the minimum and maximum limits are formatted in the same way. If two,
-the first designates the format for the minimum limit, the second for the
-maximum. If <I>""</I> is given as either description, then the that limit will
-not be displayed. The default is <I>""</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width of
-the axis and tick lines. The default is <I>1</I> pixel. </DD>
-
-<DT><B>-logscale <I>boolean</I></B> </DT>
-<DD>Indicates
-whether the scale of the axis is logarithmic or linear. If <I>boolean</I> is true,
-the axis is logarithmic. The default scale is linear. </DD>
-
-<DT><B>-loose <I>boolean</I></B> </DT>
-<DD>Indicates
-whether the limits of the axis should fit the data points tightly, at the
-outermost data points, or loosely, at the outer tick intervals. This is
-relevant only when the axis limit is automatically calculated. If <I>boolean</I>
-is true, the axis range is "loose". The default is <I>0</I>. </DD>
-
-<DT><B>-majorticks <I>majorList</I></B>
-</DT>
-<DD>Specifies where to display major axis ticks. You can use this option to
-display ticks at non-uniform intervals. <I>MajorList</I> is a list of axis coordinates
-designating the location of major ticks. No minor ticks are drawn. If <I>majorList</I>
-is <I>""</I>, major ticks will be automatically computed. The default is <I>""</I>. </DD>
-
-<DT><B>-max
-<I>value</I></B> </DT>
-<DD>Sets the maximum limit of <I>axisName</I>. Any data point greater than
-<I>value</I> is not displayed. If <I>value</I> is <I>""</I>, the maximum limit is calculated
-using the largest data value. The default is <I>""</I>. </DD>
-
-<DT><B>-min <I>value</I></B> </DT>
-<DD>Sets the minimum
-limit of <I>axisName</I>. Any data point less than <I>value</I> is not displayed. If
-<I>value</I> is <I>""</I>, the minimum limit is calculated using the smallest data value.
-The default is <I>""</I>. </DD>
-
-<DT><B>-minorticks <I>minorList</I></B> </DT>
-<DD>Specifies where to display minor
-axis ticks. You can use this option to display minor ticks at non-uniform
-intervals. <I>MinorList</I> is a list of real values, ranging from 0.0 to 1.0, designating
-the placement of a minor tick. No minor ticks are drawn if the <B>-majortick</B>
-option is also set. If <I>minorList</I> is <I>""</I>, minor ticks will be automatically
-computed. The default is <I>""</I>. </DD>
-
-<DT><B>-rotate <I>theta</I></B> </DT>
-<DD>Specifies the how many degrees
-to rotate the axis tick labels. <I>Theta</I> is a real value representing the number
-of degrees to rotate the tick labels. The default is <I>0.0</I> degrees. </DD>
-
-<DT><B>-showticks
-<I>boolean</I></B> </DT>
-<DD>Indicates whether axis ticks should be drawn. If <I>boolean</I> is true,
-ticks are drawn. If false, only the axis line is drawn. The default is <I>1</I>.
-</DD>
-
-<DT><B>-stepsize <I>value</I></B> </DT>
-<DD>Specifies the interval between major axis ticks. If <I>value</I>
-isn't a valid interval (must be less than the axis range), the request
-is ignored and the step size is automatically calculated. </DD>
-
-<DT><B>-subdivisions <I>number</I></B>
- </DT>
-<DD>Indicates how many minor axis ticks are to be drawn. For example, if <I>number</I>
-is two, only one minor tick is drawn. If <I>number</I> is one, no minor ticks
-are displayed. The default is <I>2</I>. </DD>
-
-<DT><B>-tickfont <I>fontName</I></B> </DT>
-<DD>Specifies the font for
-axis tick labels. The default is <I>*-Courier-Bold-R-Normal-*-100-*</I>. </DD>
-
-<DT><B>-ticklength <I>pixels</I></B>
-</DT>
-<DD>Sets the length of major and minor ticks (minor ticks are half the length
-of major ticks). If <I>pixels</I> is less than zero, the axis will be inverted
-with ticks drawn pointing towards the plot. The default is <I>0.1i</I>. </DD>
-
-<DT><B>-title <I>text</I></B>
-</DT>
-<DD>Sets the title of the axis. If <I>text</I> is <I>""</I>, no axis title will be displayed.
- </DD>
-
-<DT><B>-titlecolor <I>color</I></B> </DT>
-<DD>Sets the color of the axis title. The default is <I>black</I>.
-</DD>
-
-<DT><B>-titlefont <I>fontName</I></B> </DT>
-<DD>Specifies the font for axis title. The default is <I>*-Helvetica-Bold-R-Normal-*-14-140-*</I>.
-</DD>
-</DL>
-<P>
-Axis configuration options may be also be set by the <B>option</B> command. The
-resource class is <I>Axis</I>. The resource names are the names of the axes (such
-as <I>x</I> or <I>x2</I>). <BR>
-<CODE>option add *Graph.Axis.Color blue<BR>
-option add *Graph.x.LogScale true<BR>
-option add *Graph.x2.LogScale false<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>axis <B>create <I>axisName </I></B></B></I>?<I>option value</I>?... </DT>
-<DD>Creates a new axis by the
-name <I>axisName</I>. No axis by the same name can already exist. <I>Option</I> and <I>value</I>
-are described in above in the axis <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>axis <B>delete
-</B></B></I>?<I>axisName</I>?... </DT>
-<DD>Deletes the named axes. An axis is not really deleted until it
-is not longer in use, so it's safe to delete axes mapped to elements. </DD>
-
-<DT><I>pathName
-<B>axis invtransform <I>axisName value</I></B></I> </DT>
-<DD>Performs the inverse transformation, changing
-the screen coordinate <I>value</I> to a graph coordinate, mapping the value mapped
-to <I>axisName</I>. Returns the graph coordinate. </DD>
-
-<DT><I>pathName <B>axis limits <I>axisName</I></B></I>
-</DT>
-<DD>Returns a list of the minimum and maximum limits for <I>axisName</I>. The order
-of the list is <I>min max</I>. </DD>
-
-<DT><I>pathName <B>axis names </B></I>?<I>pattern</I>?... </DT>
-<DD>Returns a list of
-axes matching zero or more patterns. If no <I>pattern</I> argument is give, the
-names of all axes are returned. </DD>
-
-<DT><I>pathName <B>axis transform <I>axisName value</I></B></I> </DT>
-<DD>Transforms
-the coordinate <I>value</I> to a screen coordinate by mapping the it to <I>axisName</I>.
- Returns the transformed screen coordinate. </DD>
-</DL>
-<P>
-Only four axes can be displayed
-simultaneously. By default, they are <I>x</I>, <I>y</I>, <I>x2</I>, and <I>y2</I>. You can swap in
-a different axis with <B>use</B> operation of the special axis components: <B>xaxis</B>,
-<B>x2axis</B>, <B>yaxis</B>, and <B>y2axis</B>. <BR>
-<CODE>.g create axis temp<BR>
-.g create axis time<BR>
-...<BR>
-.g xaxis use temp<BR>
-.g yaxis use time<BR>
-</CODE><P>Only the axes specified for use are displayed on the screen. <P>
-The <B>xaxis</B>,
-<B>x2axis</B>, <B>yaxis</B>, and <B>y2axis</B> components operate on an axis location rather
-than a specific axis like the more general <B>axis</B> component does. The <B>xaxis</B>
-component manages the X-axis located in the bottom margin (whatever axis
-that happens to be). Likewise, <B>yaxis</B> uses the Y-axis in the left margin,
-<B>x2axis</B> the top X-axis, and <B>y2axis</B> the right Y-axis. <P>
-They implicitly control
-the axis that is currently using to that location. By default, <B>xaxis</B> uses
-the <I>x</I> axis, <B>yaxis</B> uses <I>y</I>, <B>x2axis</B> uses <I>x2</I>, and <B>y2axis</B> uses <I>y2</I>. These components
-can be more convenient to use than always determining what axes are current
-being displayed by the graph. <P>
-The following operations are available for
-axes. They mirror exactly the operations of the <B>axis</B> component. The <I>axis</I>
-argument must be <B>xaxis</B>, <B>x2axis</B>, <B>yaxis</B>, or <B>y2axis</B>.
-<DL>
-
-<DT><I>pathName <I>axis <B>cget <I>option</I></B></I></I>
-</DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis <B>configure </B></I></I>?<I>option value</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis<B> invtransform <I>value</I></B></I></I>
-</DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis <B>limits</B></I></I> </DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis<B> transform <I>value</I></B></I></I> </DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis<B> use </B></I></I>?<I>axisName</I>?
- </DT>
-<DD>Designates the axis <I>axisName</I> is to be displayed at this location. <I>AxisName</I>
-can not be already in use at another location. This command returns the
-name of the axis currently using this location. </DD>
-</DL>
-
-<H3><A NAME="sect9" HREF="#toc9">Crosshairs Component</A></H3>
-Cross
-hairs consist of two intersecting lines (one vertical and one horizontal)
-drawn completely across the plotting area. They are used to position the
-mouse in relation to the coordinate axes. Cross hairs differ from line
-markers in that they are implemented using XOR drawing primitives. This
-means that they can be quickly drawn and erased without redrawing the entire
-graph. <P>
-The following operations are available for cross hairs:
-<DL>
-
-<DT><I>pathName
-<B>crosshairs cget <I>option</I></B></I> </DT>
-<DD>Returns the current value of the cross hairs configuration
-option given by <I>option</I>. <I>Option</I> may be any option described below for the
-cross hairs <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>crosshairs configure </B></I>?<I>option value</I>?...
- </DT>
-<DD>Queries or modifies the configuration options of the cross hairs. If
-<I>option</I> isn't specified, a list describing all the current options for the
-cross hairs is returned. If <I>option</I> is specified, but not <I>value</I>, then a
-list describing <I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs
-are specified, then for each pair, the cross hairs option <I>option</I> is set
-to <I>value</I>. The following options are available for cross hairs. <blockquote></DD>
-
-<DT><B>-color <I>color</I></B>
- </DT>
-<DD>Sets the color of the cross hairs. The default is <I>black</I>. </DD>
-
-<DT><B>-dashes <I>dashList</I></B>
-</DT>
-<DD>Sets the dash style of the cross hairs. <I>DashList</I> is a list of up to 11 numbers
-that alternately represent the lengths of the dashes and gaps on the cross
-hair lines. Each number must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the
-cross hairs will be solid lines. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether cross hairs
-are drawn. If <I>boolean</I> is true, cross hairs are not drawn. The default is
-<I>yes</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Set the width of the cross hair lines. The default
-is <I>1</I>. </DD>
-
-<DT><B>-position <I>pos</I></B> </DT>
-<DD>Specifies the screen position where the cross hairs
-intersect. <I>Pos</I> must be in the form "<I>@x,y</I>", where <I>x</I> and <I>y</I> are the window
-coordinates of the intersection. </DD>
-</DL>
-<P>
-Cross hairs configuration options may be
-also be set by the <B>option</B> command. The resource name and class are <I>crosshairs</I>
-and <I>Crosshairs</I> respectively. <BR>
-<CODE>option add *Graph.Crosshairs.LineWidth 2<BR>
-option add *Graph.Crosshairs.Color red<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>crosshairs off</B></I> </DT>
-<DD>Turns off the cross hairs. </DD>
-
-<DT><I>pathName <B>crosshairs
-on</B></I> </DT>
-<DD>Turns on the display of the cross hairs. </DD>
-
-<DT><I>pathName <B>crosshairs toggle</B></I>
-</DT>
-<DD>Toggles the current state of the cross hairs, alternately mapping and unmapping
-the cross hairs. </DD>
-</DL>
-
-<H3><A NAME="sect10" HREF="#toc10">Element Components</A></H3>
-A data element represents a set of data.
- It contains x and y vectors containing the coordinates of the data points.
- Elements can be displayed with a symbol at each data point and lines connecting
-the points. Elements also control the appearance of the data, such as the
-symbol type, line width, color etc. <P>
-When new data elements are created,
-they are automatically added to a list of displayed elements. The display
-list controls what elements are drawn and in what order. <P>
-The following
-operations are available for elements.
-<DL>
-
-<DT><I>pathName <B>element activate <I>elemName
-</I></B></I>?<I>index</I>?... </DT>
-<DD>Specifies the data points of element <I>elemName</I> to be drawn using
-active foreground and background colors. <I>ElemName</I> is the name of the element
-and <I>index</I> is a number representing the index of the data point. If no indices
-are present then all data points become active. </DD>
-
-<DT><I>pathName <B>element cget <I>elemName
-<I>option</I></I></B></I> </DT>
-<DD>Returns the current value of the element configuration option given
-by <I>option</I>. <I>Option</I> may be any of the options described below for the element
-<B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>element closest <I>x y</I></B></I> <I>varName</I> ?<I>option value</I>?...
-?<I>elemName</I>?... </DT>
-<DD>Finds the data point closest to the window coordinates <I>x</I> and
-<I>y</I> in the element <I>elemName</I>. <I>ElemName</I> is the name of an element, that must
-not be hidden. If no elements are specified, then all visible elements
-are searched. It returns via the array variable <I>varName</I> the name of the
-closest element, the index of its closest point, and the graph coordinates
-of the point. Returns <I>0</I>, if no data point within the threshold distance
-can be found, otherwise <I>1</I> is returned. The following <I>option</I>-<I>value</I> pairs
-are available. <blockquote></DD>
-
-<DT><B>-halo <I>pixels</I></B> </DT>
-<DD>Specifies a threshold distance where selected
-data points are ignored. <I>Pixels</I> is a valid screen distance, such as <I>2</I> or
-<I>1.2i</I>. If this option isn't specified, then it defaults to the value of the
-graph's <B>-halo</B> option. </DD>
-
-<DT><B>-interpolate <I>boolean</I></B> </DT>
-<DD>Indicates that both the data points
-and interpolated points along the line segment formed should be considered.
- If <I>boolean</I> is true, the closest line segment will be selected instead
-of the closest point. If this option isn't specified, <I>boolean</I> defaults to
-<I>0</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>element configure <I>elemName </I></B></I>?<I>elemName</I>... ?<I>option value</I>?... </DT>
-<DD>Queries
-or modifies the configuration options for elements. Several elements can
-be modified at the same time. If <I>option</I> isn't specified, a list describing
-all the current options for <I>elemName</I> is returned. If <I>option</I> is specified,
-but not <I>value</I>, then a list describing the option <I>option</I> is returned. If
-one or more <I>option</I> and <I>value</I> pairs are specified, then for each pair, the
-element option <I>option</I> is set to <I>value</I>. The following options are valid
-for elements. <blockquote></DD>
-
-<DT><B>-activepen <I>penName</I></B> </DT>
-<DD>Specifies pen to use to draw active element.
- If <I>penName</I> is <I>""</I>, no active elements will be drawn. The default is <I>activeLine</I>.
-</DD>
-
-<DT><B>-color <I>color</I></B> </DT>
-<DD>Sets the color of the traces connecting the data points.
-</DD>
-
-<DT><B>-dashes <I>dashList</I></B> </DT>
-<DD>Sets the dash style of element line. <I>DashList</I> is a list
-of up to 11 numbers that alternately represent the lengths of the dashes
-and gaps on the element line. Each number must be between 1 and 255. If
-<I>dashList</I> is <I>""</I>, the lines will be solid. </DD>
-
-<DT><B>-data <I>coordList</I></B> </DT>
-<DD>Specifies the X-Y
-coordinates of the data. <I>CoordList</I> is a list of numeric expressions representing
-the X-Y coordinate pairs of each data point. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the interior
-color of symbols. If <I>color</I> is <I>""</I>, then the interior of the symbol is transparent.
- If <I>color</I> is <I>defcolor</I>, then the color will be the same as the <B>-color</B> option.
- The default is <I>defcolor</I>. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether the element is
-displayed. The default is <I>no</I>. </DD>
-
-<DT><B>-label <I>text</I></B> </DT>
-<DD>Sets the element's label in the
-legend. If <I>text</I> is <I>""</I>, the element will have no entry in the legend. The
-default label is the element's name. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width of
-the connecting lines between data points. If <I>pixels</I> is <I>0</I>, no connecting
-lines will be drawn between symbols. The default is <I>0</I>. </DD>
-
-<DT><B>-mapx <I>xAxis</I></B> </DT>
-<DD>Selects
-the X-axis to map the element's X-coordinates onto. <I>XAxis</I> must be the name
-of an axis. The default is <I>x</I>. </DD>
-
-<DT><B>-mapy <I>yAxis</I></B> </DT>
-<DD>Selects the Y-axis to map the element's
-Y-coordinates onto. <I>YAxis</I> must be the name of an axis. The default is <I>y</I>. </DD>
-
-<DT><B>-offdash
-<I>color</I></B> </DT>
-<DD>Sets the color of the stripes when traces are dashed (see the <B>-dashes</B>
-option). If <I>color</I> is <I>""</I>, then the "off" pixels will represent gaps instead
-of stripes. If <I>color</I> is <I>defcolor</I>, then the color will be the same as the
-<B>-color</B> option. The default is <I>defcolor</I>. </DD>
-
-<DT><B>-outline <I>color</I></B> </DT>
-<DD>Sets the color or
-the outline around each symbol. If <I>color</I> is <I>""</I>, then no outline is drawn.
-If <I>color</I> is <I>defcolor</I>, then the color will be the same as the <B>-color</B> option.
- The default is <I>defcolor</I>. </DD>
-
-<DT><B>-outlinewidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the outline
-bordering each symbol. If <I>pixels</I> is <I>0</I>, no outline will be drawn. The default
-is <I>1</I>. </DD>
-
-<DT><B>-pixels <I>pixels</I></B> </DT>
-<DD>Sets the size of symbols. If <I>pixels</I> is <I>0</I>, no symbols
-will be drawn. The default is <I>0.125i</I>. </DD>
-
-<DT><B>-scalesymbols <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is
-true, the size of the symbols drawn for <I>elemName</I> will change with scale
-of the X-axis and Y-axis. At the time this option is set, the current ranges
-of the axes are saved as the normalized scales (i.e scale factor is 1.0)
-and the element is drawn at its designated size (see the <B>-pixels</B> option).
- As the scale of the axes change, the symbol will be scaled according to
-the smaller of the X-axis and Y-axis scales. If <I>boolean</I> is false, the element's
-symbols are drawn at the designated size, regardless of axis scales. The
-default is <I>0</I>. </DD>
-
-<DT><B>-smooth <I>smooth</I></B> </DT>
-<DD>Specifies how connecting line segments are
-drawn between data points. <I>Smooth</I> can be either <I>linear</I>, <I>step</I>, <I>natural</I>, or
-<I>quadratic</I>. If <I>smooth</I> is <I>linear</I>, a single line segment is drawn, connecting
-both data points. When <I>smooth</I> is <I>step</I>, two line segments are drawn. The first
-is a horizontal line segment that steps the next X-coordinate. The second
-is a vertical line, moving to the next Y-coordinate. Both <I>natural</I> and <I>quadratic</I>
-generate multiple segments between data points. If <I>natural</I>, the segments
-are generated using a cubic spline. If <I>quadratic</I>, a quadratic spline is
-used. The default is <I>linear</I>. </DD>
-
-<DT><B>-styles <I>styleList</I></B> </DT>
-<DD>Specifies what pen to use
-based on the range of weights given. <I>StyleList</I> is a list of style specifications.
-Each style specification, in turn, is a list consisting of a pen name,
-and optionally a minimum and maximum range. Data points whose weight (see
-the <B>-weight</B> option) falls in this range, are drawn with this pen. If no
-range is specified it defaults to the index of the pen in the list. Note
-that this affects only symbol attributes. Line attributes, such as line
-width, dashes, etc. are ignored. </DD>
-
-<DT><B>-symbol <I>symbol</I></B> </DT>
-<DD>Specifies the symbol for
-data points. <I>Symbol</I> can be either <I>square</I>, <I>circle</I>, <I>diamond</I>, <I>plus</I>, <I>cross</I>,
-<I>splus</I>, <I>scross</I>, <I>triangle</I>, <I>""</I> (where no symbol is drawn), or a bitmap. Bitmaps
-are specified as "<I>source</I> ?<I>mask</I>?", where <I>source</I> is the name of the bitmap,
-and <I>mask</I> is the bitmap's optional mask. The default is <I>circle</I>. </DD>
-
-<DT><B>-trace <I>direction</I></B>
- </DT>
-<DD>Indicates whether connecting lines between data points (whose X-coordinate
-values are either increasing or decreasing) are drawn. <I>Direction</I> must
-be <I>increasing</I>, <I>decreasing</I>, or <I>both</I>. For example, if <I>direction</I> is <I>increasing</I>,
-connecting lines will be drawn only between those data points where X-coordinate
-values are monotonically increasing. If <I>direction</I> is <I>both</I>, connecting lines
-will be draw between all data points. The default is <I>both</I>. </DD>
-
-<DT><B>-weights <I>wVec</I></B>
- </DT>
-<DD>Specifies the weights of the individual data points. This, with the list
-pen styles (see the <B>-styles</B> option), controls how data points are drawn.
- <I>WVec</I> is the name of a BLT vector or a list of numeric expressions representing
-the weights for each data point. </DD>
-
-<DT><B>-xdata <I>xVec</I></B> </DT>
-<DD>Specifies the X-coordinates
-of the data. <I>XVec</I> is the name of a BLT vector or a list of numeric expressions.
-</DD>
-
-<DT><B>-ydata <I>yVec</I></B> </DT>
-<DD>Specifies the Y-coordinates of the data. <I>YVec</I> is the name of
-a BLT vector or a list of numeric expressions. </DD>
-</DL>
-<P>
-Element configuration options
-may also be set by the <B>option</B> command. The resource class is <I>Element</I>. The
-resource name is the name of the element. <BR>
-<CODE>option add *Graph.Element.symbol line<BR>
-option add *Graph.e1.symbol line<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>element create <I>elemName</I></B></I> ?<I>option value</I>?... </DT>
-<DD>Creates a new element <I>elemName</I>.
- It's an error is an element <I>elemName</I> already exists. If additional arguments
-are present, they specify options valid for the element <B>configure</B> operation.
-</DD>
-
-<DT><I>pathName <B>element deactivate <I>elemName</I></B></I> ?<I>elemName</I>?... </DT>
-<DD>Deactivates all the elements
-matching <I>pattern</I>. Elements whose names match any of the patterns given are
-redrawn using their normal colors. </DD>
-
-<DT><I>pathName <B>element delete</B></I> ?<I>elemName</I>?... </DT>
-<DD>Deletes
-all the named elements. The graph is automatically redrawn. </DD>
-
-<DT><I>pathName <B>element
-exists <I>elemName</I></B></I> </DT>
-<DD>Returns <I>1</I> if an element <I>elemName</I> currently exists and <I>0</I>
-otherwise. </DD>
-
-<DT><I>pathName <B>element names </B></I>?<I>pattern</I>?... </DT>
-<DD>Returns the elements matching
-one or more pattern. If no <I>pattern</I> is given, the names of all elements
-is returned. </DD>
-
-<DT><I>pathName <B>element show</B></I> ?<I>nameList</I>? </DT>
-<DD>Queries or modifies the
-element display list. The element display list designates the elements
-drawn and in what order. <I>NameList</I> is a list of elements to be displayed
-in the order they are named. If there is no <I>nameList</I> argument, the current
-display list is returned. </DD>
-
-<DT><I>pathName <B>element type</B></I> <I>elemName</I> </DT>
-<DD>Returns the type
-of <I>elemName</I>. If the element is a bar element, the commands returns the
-string <I>"bar"</I>, otherwise it returns <I>"line"</I>. </DD>
-</DL>
-
-<H3><A NAME="sect11" HREF="#toc11"></CODE><P>Grid Component</A></H3>
-Grid lines extend
-from the major and minor ticks of each axis horizontally or vertically
-across the plotting area. The following operations are available for grid
-lines.
-<DL>
-
-<DT><I>pathName <B>grid cget <I>option</I></B></I> </DT>
-<DD>Returns the current value of the grid line
-configuration option given by <I>option</I>. <I>Option</I> may be any option described
-below for the grid <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>grid configure</B></I> ?<I>option
-value</I>?... </DT>
-<DD>Queries or modifies the configuration options for grid lines. If
-<I>option</I> isn't specified, a list describing all the current grid options for
-<I>pathName</I> is returned. If <I>option</I> is specified, but not <I>value</I>, then a list
-describing <I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs are
-specified, then for each pair, the grid line option <I>option</I> is set to <I>value</I>.
- The following options are valid for grid lines. <blockquote></DD>
-
-<DT><B>-color <I>color</I></B> </DT>
-<DD>Sets the color
-of the grid lines. The default is <I>black</I>. </DD>
-
-<DT><B>-dashes <I>dashList</I></B> </DT>
-<DD>Sets the dash style
-of the grid lines. <I>DashList</I> is a list of up to 11 numbers that alternately
-represent the lengths of the dashes and gaps on the grid lines. Each number
-must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the grid will be solid lines.
-</DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether the grid should be drawn. If <I>boolean</I> is true,
-grid lines are not shown. The default is <I>yes</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of grid lines. The default width is <I>1</I>. </DD>
-
-<DT><B>-mapx <I>xAxis</I></B> </DT>
-<DD>Specifies the X-axis to
-display grid lines. <I>XAxis</I> must be the name of an axis. The default is <I>x</I>.
-</DD>
-
-<DT><B>-mapy <I>yAxis</I></B> </DT>
-<DD>Specifies the Y-axis to display grid lines. <I>YAxis</I> must be the
-name of an axis. The default is <I>y</I>. </DD>
-
-<DT><B>-minor <I>boolean</I></B> </DT>
-<DD>Indicates whether the grid
-lines should be drawn for minor ticks. If <I>boolean</I> is true, the lines will
-appear at minor tick intervals. The default is <I>1</I>. </DD>
-</DL>
-<P>
-</blockquote>
-
-<H2><A NAME="sect12" HREF="#toc12">Speed Tips</A></H2>
-There may be
-cases where the graph needs to be drawn and updated as quickly as possible.
- If drawing speed becomes a big problem, here are a few tips to speed up
-displays.
-<UL>
-·<LI>Try to minimize the number of data points. The more data points
-the looked at, the more work the graph must do. </LI>·<LI>If your data is generated
-as floating point values, the time required to convert the data values
-to and from ASCII strings can be significant, especially when there any
-many data points. You can avoid the redundant string-to-decimal conversions
-using the C API to BLT vectors. </LI>·<LI>Data elements without symbols are drawn
-faster than with symbols. Set the data element's <B>-symbol</B> option to <I>none</I>. If
-you need to draw symbols, try using the simple symbols such as <I>splus</I> and
-<I>scross</I>. </LI>·<LI>Don't stipple or dash the element. Solid lines are much faster. </LI>·<LI>If
-you update data elements frequently, try turning off the widget's <B>-bufferelements</B>
-option. When the graph is first displayed, it draws data elements into
-an internal pixmap. The pixmap acts as a cache, so that when the graph
-needs to be redrawn again, and the data elements or coordinate axes haven't
-changed, the pixmap is simply copied to the screen. This is especially
-useful when you are using markers to highlight points and regions on the
-graph. But if the graph is updated frequently, changing either the element
-data or coordinate axes, the buffering becomes redundant. </LI>
-</UL>
-
-<H2><A NAME="sect13" HREF="#toc13">Limitations</A></H2>
-Auto-scale
-routines do not use requested min/max limits as boundaries when the axis
-is logarithmically scaled. <P>
-The PostScript output generated for polygons
-with more than 1500 points may exceed the limits of some printers (See
-PostScript Language Reference Manual, page 568). The work-around is to break
-the polygon into separate pieces.
-<H2><A NAME="sect14" HREF="#toc14">Future Incompatibility</A></H2>
-The <B>-mapped</B> options
-are obsoleted and will be removed. You can achieve the same results using
-the <B>-hide</B> option instead. <BR>
-<CODE># Works for now.<BR>
-.g legend configure -mapped no<BR>
-<P>
-# Instead use this.<BR>
-.g legend configure -hide yes <BR>
-
-<H2><A NAME="sect15" HREF="#toc15"></CODE><P>Keywords</A></H2>
-graph, widget <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Example</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Syntax</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Example</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Graph Operations</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Graph Components</A></LI>
-<UL>
-<LI><A NAME="toc8" HREF="#sect8">Axis Components</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">Crosshairs Component</A></LI>
-<LI><A NAME="toc10" HREF="#sect10">Element Components</A></LI>
-<LI><A NAME="toc11" HREF="#sect11">Grid Component</A></LI>
-</UL>
-<LI><A NAME="toc12" HREF="#sect12">Speed Tips</A></LI>
-<LI><A NAME="toc13" HREF="#sect13">Limitations</A></LI>
-<LI><A NAME="toc14" HREF="#sect14">Future Incompatibility</A></LI>
-<LI><A NAME="toc15" HREF="#sect15">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/graph.html b/blt3.0.1/html/graph.html
deleted file mode 100644
index 3d40e3a..0000000
--- a/blt3.0.1/html/graph.html
+++ /dev/null
@@ -1,2311 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>graph(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-graph - 2D graph for plotting X-Y coordinate data.
-
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>graph<I> <I>pathName </I></I></B>?<I>option value</I>?...
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>graph</B> command creates
-a graph for plotting two-dimensional data (X-Y coordinates). It has many configurable
-components: coordinate axes, elements, legend, grid lines, cross hairs,
-etc. They allow you to customize the look and feel of the graph.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-The
-<B>graph</B> command creates a new window for plotting two-dimensional data (X-Y
-coordinates). Data points are plotted in a rectangular area displayed in
-the center of the new window. This is the <I>plotting area</I>. The coordinate
-axes are drawn in the margins around the plotting area. By default, the
-legend is displayed in the right margin. The title is displayed in top
-margin. <P>
-The <B>graph</B> widget is composed of several components: coordinate axes,
-data elements, legend, grid, cross hairs, pens, postscript, and annotation
-markers.
-<DL>
-
-<DT><I>axis</I> </DT>
-<DD>The graph has four standard axes (<I>x</I>, <I>x2</I>, <I>y</I>, and <I>y2</I>), but
-you can create and display any number of axes. Axes control what region
-of data is displayed and how the data is scaled. Each axis consists of the
-axis line, title, major and minor ticks, and tick labels. Tick labels display
-the value at each major tick. </DD>
-
-<DT><I>crosshairs</I> </DT>
-<DD>Cross hairs are used to position
-the mouse pointer relative to the X and Y coordinate axes. Two perpendicular
-lines, intersecting at the current location of the mouse, extend across
-the plotting area to the coordinate axes. </DD>
-
-<DT><I>element</I> </DT>
-<DD>An element represents
-a set of data points. Elements can be plotted with a symbol at each data
-point and lines connecting the points. The appearance of the element, such
-as its symbol, line width, and color is configurable. </DD>
-
-<DT><I>grid</I> </DT>
-<DD>Extends the
-major and minor ticks of the X-axis and/or Y-axis across the plotting area.
- </DD>
-
-<DT><I>legend</I> </DT>
-<DD>The legend displays the name and symbol of each data element.
-The legend can be drawn in any margin or in the plotting area. </DD>
-
-<DT><I>marker</I> </DT>
-<DD>Markers
-are used annotate or highlight areas of the graph. For example, you could
-use a polygon marker to fill an area under a curve, or a text marker to
-label a particular data point. Markers come in various forms: text strings,
-bitmaps, connected line segments, images, polygons, or embedded widgets.
-</DD>
-
-<DT><I>pen</I> </DT>
-<DD>Pens define attributes (both symbol and line style) for elements.
-Data elements use pens to specify how they should be drawn. A data element
-may use many pens at once. Here, the particular pen used for a data point
-is determined from each element's weight vector (see the element's <B>-weight</B>
-and <B>-style</B> options). </DD>
-
-<DT><I>postscript</I> </DT>
-<DD>The widget can generate encapsulated PostScript
-output. This component has several options to configure how the PostScript
-is generated. </DD>
-</DL>
-
-<H2><A NAME="sect4" HREF="#toc4">Syntax</A></H2>
-<BR>
-<P>
-<CODE><B>graph <I>pathName </I></B>?<I>option value</I>?...<BR>
-</CODE><P>The <B>graph</B> command creates a new window <I>pathName</I> and makes it into a <B>graph</B>
-widget. At the time this command is invoked, there must not exist a window
-named <I>pathName</I>, but <I>pathName</I>'s parent must exist. Additional options may
-be specified on the command line or in the option database to configure
-aspects of the graph such as its colors and font. See the <B>configure</B> operation
-below for the exact details about what <I>option</I> and <I>value</I> pairs are valid.
-<P>
-If successful, <B>graph</B> returns the path name of the widget. It also creates
-a new Tcl command by the same name. You can use this command to invoke
-various operations that query or modify the graph. The general form is:
-<BR>
-<P>
-<CODE><I>pathName <I>operation</I></I> ?<I>arg</I>?...<BR>
-</CODE><P>Both <I>operation</I> and its arguments determine the exact behavior of the command.
- The operations available for the graph are described in the <FONT SIZE=-1><B>GRAPH OPERATIONS</B></FONT>
-
- section. <P>
-The command can also be used to access components of the graph.
-<BR>
-<P>
-<CODE><I>pathName component operation</I> ?<I>arg</I>?...<BR>
-</CODE><P>The operation, now located after the name of the component, is the function
-to be performed on that component. Each component has its own set of operations
-that manipulate that component. They will be described below in their own
-sections.
-<H2><A NAME="sect5" HREF="#toc5">Example</A></H2>
-The <B>graph</B> command creates a new graph. <BR>
-<CODE># Create a new graph. Plotting area is black.<BR>
-graph .g -plotbackground black<BR>
-</CODE><P>A new Tcl command <I>.g</I> is also created. This command can be used to query
-and modify the graph. For example, to change the title of the graph to
-"My Plot", you use the new command and the graph's <B>configure</B> operation. <BR>
-<CODE># Change the title.<BR>
-.g configure -title "My Plot"<BR>
-</CODE><P>A graph has several components. To access a particular component you use
-the component's name. For example, to add data elements, you use the new
-command and the <B>element</B> component. <BR>
-<CODE># Create a new element named "line1"<BR>
-.g element create line1 \<BR>
-<tt> </tt> <tt> </tt> -xdata { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 } \<BR>
-<tt> </tt> <tt> </tt> -ydata { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 <BR>
-<tt> </tt> <tt> </tt> <tt> </tt> <tt> </tt> 155.85 166.60 175.38 }<BR>
-</CODE><P>The element's X-Y coordinates are specified using lists of numbers. Alternately,
-BLT vectors could be used to hold the X-Y coordinates. <BR>
-<CODE># Create two vectors and add them to the graph.<BR>
-vector xVec yVec<BR>
-xVec set { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 }<BR>
-yVec set { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 155.85 <BR>
-<tt> </tt> <tt> </tt> 166.60 175.38 }<BR>
-.g element create line1 -xdata xVec -ydata yVec<BR>
-</CODE><P>The advantage of using vectors is that when you modify one, the graph is
-automatically redrawn to reflect the new values. <BR>
-<CODE># Change the y coordinate of the first point.<BR>
-set yVector(0) 25.18<BR>
-</CODE><P>An element named <I>e1</I> is now created in <I>.b</I>. It is automatically added to
-the display list of elements. You can use this list to control in what
-order elements are displayed. To query or reset the element display list,
-you use the element's <B>show</B> operation. <BR>
-<CODE># Get the current display list <BR>
-set elemList [.b element show]<BR>
-# Remove the first element so it won't be displayed.<BR>
-.b element show [lrange $elemList 0 end]<BR>
-</CODE><P>The element will be displayed by as many bars as there are data points
-(in this case there are ten). The bars will be drawn centered at the x-coordinate
-of the data point. All the bars will have the same attributes (colors,
-stipple, etc). The width of each bar is by default one unit. You can change
-this with using the <B>-barwidth</B> option. <BR>
-<CODE># Change the X-Y coordinates of the first point.<BR>
-set xVec(0) 0.18<BR>
-set yVec(0) 25.18<BR>
-</CODE><P>An element named <I>line1</I> is now created in <I>.g</I>. By default, the element's label
-in the legend will be also <I>line1</I>. You can change the label, or specify no
-legend entry, again using the element's <B>configure</B> operation. <BR>
-<CODE># Don't display "line1" in the legend.<BR>
-.g element configure line1 -label ""<BR>
-</CODE><P>You can configure more than just the element's label. An element has many
-attributes such as symbol type and size, dashed or solid lines, colors,
-line width, etc. <BR>
-<CODE>.g element configure line1 -symbol square -color red \<BR>
-<tt> </tt> <tt> </tt> -dashes { 2 4 2 } -linewidth 2 -pixels 2c<BR>
-</CODE><P>Four coordinate axes are automatically created: <I>x</I>, <I>x2</I>, <I>y</I>, and <I>y2</I>. And by
-default, elements are mapped onto the axes <I>x</I> and <I>y</I>. This can be changed
-with the <B>-mapx</B> and <B>-mapy</B> options. <BR>
-<CODE># Map "line1" on the alternate Y-axis "y2".<BR>
-.g element configure line1 -mapy y2<BR>
-</CODE><P>Axes can be configured in many ways too. For example, you change the scale
-of the Y-axis from linear to log using the <B>axis</B> component. <BR>
-<CODE># Y-axis is log scale.<BR>
-.g axis configure y -logscale yes<BR>
-</CODE><P>One important way axes are used is to zoom in on a particular data region.
- Zooming is done by simply specifying new axis limits using the <B>-min</B> and
-<B>-max</B> configuration options. <BR>
-<CODE>.g axis configure x -min 1.0 -max 1.5<BR>
-.g axis configure y -min 12.0 -max 55.15<BR>
-</CODE><P>To zoom interactively, you link the <B>axis configure</B> operations with some
-user interaction (such as pressing the mouse button), using the <B>bind</B> command.
- To convert between screen and graph coordinates, use the <B>invtransform</B>
-operation. <BR>
-<CODE># Click the button to set a new minimum <BR>
-bind .g <ButtonPress-1> { <BR>
- %W axis configure x -min [%W axis invtransform x %x]<BR>
- %W axis configure x -min [%W axis invtransform x %y]<BR>
-}<BR>
-</CODE><P>By default, the limits of the axis are determined from data values. To reset
-back to the default limits, set the <B>-min</B> and <B>-max</B> options to the empty value.
-<BR>
-<CODE># Reset the axes to autoscale again.<BR>
-.g axis configure x -min {} -max {}<BR>
-.g axis configure y -min {} -max {}<BR>
-</CODE><P>By default, the legend is drawn in the right margin. You can change this
-or any legend configuration options using the <B>legend</B> component. <BR>
-<CODE># Configure the legend font, color, and relief<BR>
-.g legend configure -position left -relief raised \<BR>
-<tt> </tt> <tt> </tt> -font fixed -fg blue<BR>
-</CODE><P>To prevent the legend from being displayed, turn on the <B>-hide</B> option. <BR>
-<CODE># Don't display the legend.<BR>
-.g legend configure -hide yes<BR>
-</CODE><P>The <B>graph</B> widget has simple drawing procedures called markers. They can
-be used to highlight or annotate data in the graph. The types of markers
-available are bitmaps, images, polygons, lines, or windows. Markers can
-be used, for example, to mark or brush points. In this example, is a text
-marker that labels the data first point. Markers are created using the
-<B>marker</B> component. <BR>
-<CODE># Create a label for the first data point of "line1".<BR>
-.g marker create text -name first_marker -coords { 0.2 26.18 } \<BR>
-<tt> </tt> <tt> </tt> -text "start" -anchor se -xoffset -10 -yoffset -10<BR>
-</CODE><P>This creates a text marker named <I>first_marker</I>. It will display the text
-"start" near the coordinates of the first data point. The <B>-anchor</B>, <B>-xoffset</B>,
-and <B>-yoffset</B> options are used to display the marker above and to the left
-of the data point, so that the data point isn't covered by the marker. By
-default, markers are drawn last, on top of data. You can change this with
-the <B>-under</B> option. <BR>
-<CODE># Draw the label before elements are drawn.<BR>
-.g marker configure first_marker -under yes<BR>
-</CODE><P>You can add cross hairs or grid lines using the <B>crosshairs</B> and <B>grid</B> components.
-<BR>
-<CODE># Display both cross hairs and grid lines.<BR>
-.g crosshairs configure -hide no -color red<BR>
-.g grid configure -hide no -dashes { 2 2 }<BR>
-# Set up a binding to reposition the crosshairs.<BR>
-bind .g <Motion> {<BR>
- .g crosshairs configure -position @%x,%y<BR>
-}<BR>
-</CODE><P>The crosshairs are repositioned as the mouse pointer is moved in the graph.
- The pointer X-Y coordinates define the center of the crosshairs. <P>
-Finally,
-to get hardcopy of the graph, use the <B>postscript</B> component. <BR>
-<CODE># Print the graph into file "file.ps"<BR>
-.g postscript output file.ps -maxpect yes -decorations no<BR>
-</CODE><P>This generates a file <I>file.ps</I> containing the encapsulated PostScript of
-the graph. The option <B>-maxpect</B> says to scale the plot to the size of the
-page. Turning off the <B>-decorations</B> option denotes that no borders or color
-backgrounds should be drawn (i.e. the background of the margins, legend,
-and plotting area will be white).
-<H2><A NAME="sect6" HREF="#toc6">Graph Operations</A></H2>
-
-<DL>
-
-<DT><I>pathName <B>axis <I>operation
-</I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>AXIS COMPONENTS</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>bar <I>elemName </I></B></I>?<I>option value</I>?...
-</DT>
-<DD>Creates a new barchart element <I>elemName</I>. It's an error if an element <I>elemName</I>
-already exists. See the manual for <B>barchart</B> for details about what <I>option</I>
-and <I>value</I> pairs are valid. </DD>
-
-<DT><I>pathName <B>cget</B></I> <I>option</I> </DT>
-<DD>Returns the current value
-of the configuration option given by <I>option</I>. <I>Option</I> may be any option described
-below for the <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>configure </B></I>?<I>option value</I>?... </DT>
-<DD>Queries
-or modifies the configuration options of the graph. If <I>option</I> isn't specified,
-a list describing the current options for <I>pathName</I> is returned. If <I>option</I>
-is specified, but not <I>value</I>, then a list describing <I>option</I> is returned.
-If one or more <I>option</I> and <I>value</I> pairs are specified, then for each pair,
-the option <I>option</I> is set to <I>value</I>. The following options are valid. <blockquote></DD>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Sets the background color. This includes the margins and legend, but
-not the plotting area. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border
-around the outside edge of the widget. The <B>-relief</B> option determines if
-the border is to be drawn. The default is <I>2</I>. </DD>
-
-<DT><B>-bottommargin <I>pixels</I></B> </DT>
-<DD>If non-zero,
-overrides the computed size of the margin extending below the X-coordinate
-axis. If <I>pixels</I> is <I>0</I>, the automatically computed size is used. The default
-is <I>0</I>. </DD>
-
-<DT><B>-bufferelements <I>boolean</I></B> </DT>
-<DD>Indicates whether an internal pixmap to buffer
-the display of data elements should be used. If <I>boolean</I> is true, data elements
-are drawn to an internal pixmap. This option is especially useful when
-the graph is redrawn frequently while the remains data unchanged (for example,
-moving a marker across the plot). See the <FONT SIZE=-1><B>SPEED TIPS</B></FONT>
- section. The default
-is <I>1</I>. </DD>
-
-<DT><B>-cursor <I>cursor</I></B> </DT>
-<DD>Specifies the widget's cursor. The default cursor is
-<I>crosshair</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Specifies the font of the graph title. The default
-is <I>*-Helvetica-Bold-R-Normal-*-18-180-*</I>. </DD>
-
-<DT><B>-halo <I>pixels</I></B> </DT>
-<DD>Specifies a maximum distance
-to consider when searching for the closest data point (see the element's
-<B>closest</B> operation below). Data points further than <I>pixels</I> away are ignored.
- The default is <I>0.5i</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B> </DT>
-<DD>Specifies the requested height of widget.
- The default is <I>4i</I>. </DD>
-
-<DT><B>-invertxy <I>boolean</I></B> </DT>
-<DD>Indicates whether the placement X-axis
-and Y-axis should be inverted. If <I>boolean</I> is true, the X and Y axes are
-swapped. The default is <I>0</I>. </DD>
-
-<DT><B>-justify <I>justify</I></B> </DT>
-<DD>Specifies how the title should
-be justified. This matters only when the title contains more than one line
-of text. <I>Justify</I> must be <I>left</I>, <I>right</I>, or <I>center</I>. The default is <I>center</I>. </DD>
-
-<DT><B>-leftmargin
-<I>pixels</I></B> </DT>
-<DD>If non-zero, overrides the computed size of the margin extending
- from the left edge of the window to the Y-coordinate axis. If <I>pixels</I> is
-<I>0</I>, the automatically computed size is used. The default is <I>0</I>. </DD>
-
-<DT><B>-plotbackground
-<I>color</I></B> </DT>
-<DD>Specifies the background color of the plotting area. The default
-is <I>white</I>. </DD>
-
-<DT><B>-plotborderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around
-the plotting area. The <B>-plotrelief</B> option determines if a border is drawn.
- The default is <I>2</I>. </DD>
-
-<DT><B>-plotpadx <I>pad</I></B> </DT>
-<DD>Sets the amount of padding to be added to
-the left and right sides of the plotting area. <I>Pad</I> can be a list of one
-or two screen distances. If <I>pad</I> has two elements, the left side of the
-plotting area entry is padded by the first distance and the right side
-by the second. If <I>pad</I> is just one distance, both the left and right sides
-are padded evenly. The default is <I>8</I>. </DD>
-
-<DT><B>-plotpady <I>pad</I></B> </DT>
-<DD>Sets the amount of padding
-to be added to the top and bottom of the plotting area. <I>Pad</I> can be a list
-of one or two screen distances. If <I>pad</I> has two elements, the top of the
-plotting area is padded by the first distance and the bottom by the second.
- If <I>pad</I> is just one distance, both the top and bottom are padded evenly.
- The default is <I>8</I>. </DD>
-
-<DT><B>-plotrelief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect for the plotting
-area. <I>Relief</I> specifies how the interior of the plotting area should appear
-relative to rest of the graph; for example, <I>raised</I> means the plot should
-appear to protrude from the graph, relative to the surface of the graph.
- The default is <I>sunken</I>. </DD>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect for the graph
-widget. <I>Relief</I> specifies how the graph should appear relative to widget
-it is packed into; for example, <I>raised</I> means the graph should appear to
-protrude. The default is <I>flat</I>. </DD>
-
-<DT><B>-rightmargin <I>pixels</I></B> </DT>
-<DD>If non-zero, overrides
-the computed size of the margin extending from the plotting area to the
-right edge of the window. By default, the legend is drawn in this margin.
- If <I>pixels</I> is <I>0</I>, the automatically computed size is used. The default
-is <I>0</I>. </DD>
-
-<DT><B>-takefocus</B> <I>focus</I> </DT>
-<DD>Provides information used when moving the focus from
-window to window via keyboard traversal (e.g., Tab and Shift-Tab). If <I>focus</I>
-is <I>0</I>, this means that this window should be skipped entirely during keyboard
-traversal. <I>1</I> means that the this window should always receive the input
-focus. An empty value means that the traversal scripts make the decision
-whether to focus on the window. The default is <I>""</I>. </DD>
-
-<DT><B>-tile <I>image</I></B> </DT>
-<DD>Specifies
-a tiled background for the widget. If <I>image</I> isn't <I>""</I>, the background is
-tiled using <I>image</I>. Otherwise, the normal background color is drawn (see
-the <B>-background</B> option). <I>Image</I> must be an image created using the Tk <B>image</B>
-command. The default is <I>""</I>. </DD>
-
-<DT><B>-title <I>text</I></B> </DT>
-<DD>Sets the title to <I>text</I>. If <I>text</I> is
-<I>""</I>, no title will be displayed. </DD>
-
-<DT><B>-topmargin <I>pixels</I></B> </DT>
-<DD>If non-zero, overrides
-the computed size of the margin above the x2 axis. If <I>pixels</I> is <I>0</I>, the
-automatically computed size is used. The default is <I>0</I>. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Specifies
-the requested width of the widget. The default is <I>5i</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>crosshairs
-<I>operation </I></B></I>?<I>arg</I>? </DT>
-<DD>See the <FONT SIZE=-1><B>CROSSHAIRS COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>element
-<I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>ELEMENT COMPONENTS</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>extents <I>item</I></B></I>
- </DT>
-<DD>Returns the size of a particular item in the graph. <I>Item</I> must be either
-<I>leftmargin</I>, <I>rightmargin</I>, <I>topmargin</I>, <I>bottommargin</I>, <I>plotwidth</I>, or <I>plotheight</I>.
-</DD>
-
-<DT><I>pathName <B>grid <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>GRID COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName
-<B>invtransform <I>winX winY</I></B></I> </DT>
-<DD>Performs an inverse coordinate transformation,
-mapping window coordinates back to graph coordinates, using the standard
-X-axis and Y-axis. Returns a list of containing the X-Y graph coordinates. </DD>
-
-<DT><I>pathName
-<B>inside <I>x y</I></B></I> </DT>
-<DD>Returns <I>1</I> is the designated screen coordinate (<I>x</I> and <I>y</I>) is inside
-the plotting area and <I>0</I> otherwise. </DD>
-
-<DT><I>pathName <B>legend <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the
- <FONT SIZE=-1><B>LEGEND COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>line<B> operation arg</B></B></I>... </DT>
-<DD>The operation is
-the same as <B>element</B>. </DD>
-
-<DT><I>pathName <B>marker <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>MARKER COMPONENTS</B></FONT>
-
- section. </DD>
-
-<DT><I>pathName</I> <B>metafile</B> ?<I>fileName</I>? </DT>
-<DD><I>This operation is for Window platforms
-only</I>. Creates a Windows enhanced metafile of the graph. If present, <I>fileName</I>
-is the file name of the new metafile. Otherwise, the metafile is automatically
-added to the clipboard. </DD>
-
-<DT><I>pathName <B>postscript <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>POSTSCRIPT
-COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>snap <I>photoName</I></B></I> </DT>
-<DD>Takes a snapshot of the graph
-and stores the contents in the photo image <I>photoName</I>. <I>PhotoName</I> is the
-name of a Tk photo image that must already exist. </DD>
-
-<DT><I>pathName <B>transform <I>x y</I></B></I>
- </DT>
-<DD>Performs a coordinate transformation, mapping graph coordinates to window
-coordinates, using the standard X-axis and Y-axis. Returns a list containing
-the X-Y screen coordinates. </DD>
-
-<DT><I>pathName <B>xaxis <I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <B>x2axis
-<I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <B>yaxis <I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <B>y2axis <I>operation</I></B></I>
-?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>AXIS COMPONENTS</B></FONT>
- section. </DD>
-</DL>
-
-<H2><A NAME="sect7" HREF="#toc7">Graph Components</A></H2>
-A graph is composed
-of several components: coordinate axes, data elements, legend, grid, cross
-hairs, postscript, and annotation markers. Instead of one big set of configuration
-options and operations, the graph is partitioned, where each component
-has its own configuration options and operations that specifically control
-that aspect or part of the graph.
-<H3><A NAME="sect8" HREF="#toc8">Axis Components</A></H3>
-Four coordinate axes are
-automatically created: two X-coordinate axes (<I>x</I> and <I>x2</I>) and two Y-coordinate
-axes (<I>y</I>, and <I>y2</I>). By default, the axis <I>x</I> is located in the bottom margin,
-<I>y</I> in the left margin, <I>x2</I> in the top margin, and <I>y2</I> in the right margin.
-<P>
-An axis consists of the axis line, title, major and minor ticks, and tick
-labels. Major ticks are drawn at uniform intervals along the axis. Each
-tick is labeled with its coordinate value. Minor ticks are drawn at uniform
-intervals within major ticks. <P>
-The range of the axis controls what region
-of data is plotted. Data points outside the minimum and maximum limits of
-the axis are not plotted. By default, the minimum and maximum limits are
-determined from the data, but you can reset either limit. <P>
-You can have several
-axes. To create an axis, invoke the axis component and its create operation.
-<BR>
-<CODE># Create a new axis called "tempAxis"<BR>
-.g axis create tempAxis<BR>
-</CODE><P>You map data elements to an axis using the element's -mapy and -mapx configuration
-options. They specify the coordinate axes an element is mapped onto. <BR>
-<CODE># Now map the tempAxis data to this axis.<BR>
-.g element create "e1" -xdata $x -ydata $y -mapy tempAxis<BR>
-</CODE><P>Any number of axes can be displayed simultaneously. They are drawn in the
-margins surrounding the plotting area. The default axes <I>x</I> and <I>y</I> are drawn
-in the bottom and left margins. The axes <I>x2</I> and <I>y2</I> are drawn in top and
-right margins. By default, only <I>x</I> and <I>y</I> are shown. Note that the axes can
-have different scales. <P>
-To display a different axis or more than one axis,
-you invoke one of the following components: <B>xaxis</B>, <B>yaxis</B>, <B>x2axis</B>, and <B>y2axis</B>.
- Each component has a <B>use</B> operation that designates the axis (or axes)
-to be drawn in that corresponding margin: <B>xaxis</B> in the bottom, <B>yaxis</B> in
-the left, <B>x2axis</B> in the top, and <B>y2axis</B> in the right. <BR>
-<CODE># Display the axis tempAxis in the left margin.<BR>
-.g yaxis use tempAxis<BR>
-</CODE><P>The <B>use</B> operation takes a list of axis names as its last argument. This
-is the list of axes to be drawn in this margin. <P>
-You can configure axes in
-many ways. The axis scale can be linear or logarithmic. The values along
-the axis can either monotonically increase or decrease. If you need custom
-tick labels, you can specify a Tcl procedure to format the label any way
-you wish. You can control how ticks are drawn, by changing the major tick
-interval or the number of minor ticks. You can define non-uniform tick intervals,
-such as for time-series plots. <P>
-
-<DL>
-
-<DT><I>pathName <B>axis bind <I>tagName</I></B></I> ?<I>sequence</I>? ?<I>command</I>?
- </DT>
-<DD>Associates <I>command</I> with <I>tagName</I> such that whenever the event sequence
-given by <I>sequence</I> occurs for an axis with this tag, <I>command</I> will be invoked.
- The syntax is similar to the <B>bind</B> command except that it operates on
-graph axes, rather than widgets. See the <B>bind</B> manual entry for complete
-details on <I>sequence</I> and the substitutions performed on <I>command</I> before
-invoking it. <P>
-If all arguments are specified then a new binding is created,
-replacing any existing binding for the same <I>sequence</I> and <I>tagName</I>. If the
-first character of <I>command</I> is <I>+</I> then <I>command</I> augments an existing binding
-rather than replacing it. If no <I>command</I> argument is provided then the command
-currently associated with <I>tagName</I> and <I>sequence</I> (it's an error occurs if
-there's no such binding) is returned. If both <I>command</I> and <I>sequence</I> are
-missing then a list of all the event sequences for which bindings have
-been defined for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>axis <B>cget <I>axisName <I>option</I></I></B></B></I> </DT>
-<DD>Returns the
-current value of the option given by <I>option</I> for <I>axisName</I>. <I>Option</I> may be
-any option described below for the axis <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>axis
-<B>configure <I>axisName </I></B></B></I>?<I>axisName</I>?... ?<I>option value</I>?... </DT>
-<DD>Queries or modifies the configuration
-options of <I>axisName</I>. Several axes can be changed. If <I>option</I> isn't specified,
-a list describing all the current options for <I>axisName</I> is returned. If
-<I>option</I> is specified, but not <I>value</I>, then a list describing <I>option</I> is returned.
- If one or more <I>option</I> and <I>value</I> pairs are specified, then for each pair,
-the axis option <I>option</I> is set to <I>value</I>. The following options are valid
-for axes. <blockquote></DD>
-
-<DT><B>-bindtags <I>tagList</I></B> </DT>
-<DD>Specifies the binding tags for the axis. <I>TagList</I>
-is a list of binding tag names. The tags and their order will determine
-how events for axes are handled. Each tag in the list matching the current
-event sequence will have its Tcl command executed. Implicitly the name
-of the element is always the first tag in the list. The default value is
-<I>all</I>. </DD>
-
-<DT><B>-color <I>color</I></B> </DT>
-<DD>Sets the color of the axis and tick labels. The default
-is <I>black</I>. </DD>
-
-<DT><B>-command <I>prefix</I></B> </DT>
-<DD>Specifies a Tcl command to be invoked when formatting
-the axis tick labels. <I>Prefix</I> is a string containing the name of a Tcl proc
-and any extra arguments for the procedure. This command is invoked for
-each major tick on the axis. Two additional arguments are passed to the
-procedure: the pathname of the widget and the current the numeric value
-of the tick. The procedure returns the formatted tick label. If <I>""</I> is returned,
-no label will appear next to the tick. You can get the standard tick labels
-again by setting <I>prefix</I> to <I>""</I>. The default is <I>""</I>. <P>
-Please note that this
-procedure is invoked while the graph is redrawn. You may query configuration
-options. But do not them, because this can have unexpected results. </DD>
-
-<DT><B>-descending
-<I>boolean</I></B> </DT>
-<DD>Indicates whether the values along the axis are monotonically
-increasing or decreasing. If <I>boolean</I> is true, the axis values will be decreasing.
- The default is <I>0</I>. </DD>
-
-<DT><B>-hide <I>string</I></B> </DT>
-<DD>Indicates if the axis and all the elements
-mapped to it will be displayed. The valid values for <I>string</I> are shown
-below. The default value is <I>0</I>. <blockquote></DD>
-
-<DT><I>false</I> </DT>
-<DD>The axis and its data elements are
-displayed. </DD>
-
-<DT><I>true</I> </DT>
-<DD>The axis is hidden, but the data elements mapped to it are
-displayed. </DD>
-
-<DT><I>all</I> </DT>
-<DD>The axis and its data elements are hidden. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-justify <I>justify</I></B>
-</DT>
-<DD>Specifies how the axis title should be justified. This matters only when
-the axis title contains more than one line of text. <I>Justify</I> must be <I>left</I>,
-<I>right</I>, or <I>center</I>. The default is <I>center</I>. </DD>
-
-<DT><B>-limits <I>formatStr</I></B> </DT>
-<DD>Specifies a printf-like
-description to format the minimum and maximum limits of the axis. The limits
-are displayed at the top/bottom or left/right sides of the plotting area.
- <I>FormatStr</I> is a list of one or two format descriptions. If one description
-is supplied, both the minimum and maximum limits are formatted in the same
-way. If two, the first designates the format for the minimum limit, the
-second for the maximum. If <I>""</I> is given as either description, then the
-that limit will not be displayed. The default is <I>""</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets
-the width of the axis and tick lines. The default is <I>1</I> pixel. </DD>
-
-<DT><B>-logscale <I>boolean</I></B>
-</DT>
-<DD>Indicates whether the scale of the axis is logarithmic or linear. If <I>boolean</I>
-is true, the axis is logarithmic. The default scale is linear. </DD>
-
-<DT><B>-loose <I>boolean</I></B>
-</DT>
-<DD>Indicates whether the limits of the axis should fit the data points tightly,
-at the outermost data points, or loosely, at the outer tick intervals. If
-the axis limit is set with the -min or -max option, the axes are displayed
-tightly. If <I>boolean</I> is true, the axis range is "loose". The default is <I>0</I>.
-</DD>
-
-<DT><B>-majorticks <I>majorList</I></B> </DT>
-<DD>Specifies where to display major axis ticks. You can
-use this option to display ticks at non-uniform intervals. <I>MajorList</I> is
-a list of axis coordinates designating the location of major ticks. No
-minor ticks are drawn. If <I>majorList</I> is <I>""</I>, major ticks will be automatically
-computed. The default is <I>""</I>. </DD>
-
-<DT><B>-max <I>value</I></B> </DT>
-<DD>Sets the maximum limit of <I>axisName</I>.
- Any data point greater than <I>value</I> is not displayed. If <I>value</I> is <I>""</I>,
-the maximum limit is calculated using the largest data value. The default
-is <I>""</I>. </DD>
-
-<DT><B>-min <I>value</I></B> </DT>
-<DD>Sets the minimum limit of <I>axisName</I>. Any data point less
-than <I>value</I> is not displayed. If <I>value</I> is <I>""</I>, the minimum limit is calculated
-using the smallest data value. The default is <I>""</I>. </DD>
-
-<DT><B>-minorticks <I>minorList</I></B> </DT>
-<DD>Specifies
-where to display minor axis ticks. You can use this option to display minor
-ticks at non-uniform intervals. <I>MinorList</I> is a list of real values, ranging
-from 0.0 to 1.0, designating the placement of a minor tick. No minor ticks
-are drawn if the <B>-majortick</B> option is also set. If <I>minorList</I> is <I>""</I>, minor
-ticks will be automatically computed. The default is <I>""</I>. </DD>
-
-<DT><B>-rotate <I>theta</I></B> </DT>
-<DD>Specifies
-the how many degrees to rotate the axis tick labels. <I>Theta</I> is a real value
-representing the number of degrees to rotate the tick labels. The default
-is <I>0.0</I> degrees. </DD>
-
-<DT><B>-showticks <I>boolean</I></B> </DT>
-<DD>Indicates whether axis ticks should be
-drawn. If <I>boolean</I> is true, ticks are drawn. If false, only the axis line
-is drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-stepsize <I>value</I></B> </DT>
-<DD>Specifies the interval between
-major axis ticks. If <I>value</I> isn't a valid interval (must be less than the
-axis range), the request is ignored and the step size is automatically
-calculated. </DD>
-
-<DT><B>-subdivisions <I>number</I></B> </DT>
-<DD>Indicates how many minor axis ticks are
-to be drawn. For example, if <I>number</I> is two, only one minor tick is drawn.
- If <I>number</I> is one, no minor ticks are displayed. The default is <I>2</I>. </DD>
-
-<DT><B>-tickfont
-<I>fontName</I></B> </DT>
-<DD>Specifies the font for axis tick labels. The default is <I>*-Courier-Bold-R-Normal-*-100-*</I>.
-</DD>
-
-<DT><B>-ticklength <I>pixels</I></B> </DT>
-<DD>Sets the length of major and minor ticks (minor ticks
-are half the length of major ticks). If <I>pixels</I> is less than zero, the axis
-will be inverted with ticks drawn pointing towards the plot. The default
-is <I>0.1i</I>. </DD>
-
-<DT><B>-title <I>text</I></B> </DT>
-<DD>Sets the title of the axis. If <I>text</I> is <I>""</I>, no axis title
-will be displayed. </DD>
-
-<DT><B>-titlecolor <I>color</I></B> </DT>
-<DD>Sets the color of the axis title. The
-default is <I>black</I>. </DD>
-
-<DT><B>-titlefont <I>fontName</I></B> </DT>
-<DD>Specifies the font for axis title.
-The default is <I>*-Helvetica-Bold-R-Normal-*-14-140-*</I>. </DD>
-</DL>
-<P>
-Axis configuration options
-may be also be set by the <B>option</B> command. The resource class is <I>Axis</I>. The
-resource names are the names of the axes (such as <I>x</I> or <I>x2</I>). <BR>
-<CODE>option add *Graph.Axis.Color blue<BR>
-option add *Graph.x.LogScale true<BR>
-option add *Graph.x2.LogScale false<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>axis <B>create <I>axisName </I></B></B></I>?<I>option value</I>?... </DT>
-<DD>Creates a new axis by the
-name <I>axisName</I>. No axis by the same name can already exist. <I>Option</I> and <I>value</I>
-are described in above in the axis <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>axis <B>delete
-</B></B></I>?<I>axisName</I>?... </DT>
-<DD>Deletes the named axes. An axis is not really deleted until it
-is not longer in use, so it's safe to delete axes mapped to elements. </DD>
-
-<DT><I>pathName
-<B>axis invtransform <I>axisName value</I></B></I> </DT>
-<DD>Performs the inverse transformation, changing
-the screen coordinate <I>value</I> to a graph coordinate, mapping the value mapped
-to <I>axisName</I>. Returns the graph coordinate. </DD>
-
-<DT><I>pathName <B>axis limits <I>axisName</I></B></I>
-</DT>
-<DD>Returns a list of the minimum and maximum limits for <I>axisName</I>. The order
-of the list is <I>min max</I>. </DD>
-
-<DT><I>pathName <B>axis names </B></I>?<I>pattern</I>?... </DT>
-<DD>Returns a list of
-axes matching zero or more patterns. If no <I>pattern</I> argument is give, the
-names of all axes are returned. </DD>
-
-<DT><I>pathName <B>axis transform <I>axisName value</I></B></I> </DT>
-<DD>Transforms
-the coordinate <I>value</I> to a screen coordinate by mapping the it to <I>axisName</I>.
- Returns the transformed screen coordinate. </DD>
-</DL>
-<P>
-The default axes are <I>x</I>, <I>y</I>, <I>x2</I>,
-and <I>y2</I>. But you can display more than four axes simultaneously. You can
-also swap in a different axis with <B>use</B> operation of the special axis components:
-<B>xaxis</B>, <B>x2axis</B>, <B>yaxis</B>, and <B>y2axis</B>. <BR>
-<CODE>.g create axis temp<BR>
-.g create axis time<BR>
-...<BR>
-.g xaxis use temp<BR>
-.g yaxis use time<BR>
-</CODE><P>Only the axes specified for use are displayed on the screen. <P>
-The <B>xaxis</B>,
-<B>x2axis</B>, <B>yaxis</B>, and <B>y2axis</B> components operate on an axis location rather
-than a specific axis like the more general <B>axis</B> component does. They implicitly
-control the axis that is currently using to that location. By default,
-<B>xaxis</B> uses the <I>x</I> axis, <B>yaxis</B> uses <I>y</I>, <B>x2axis</B> uses <I>x2</I>, and <B>y2axis</B> uses <I>y2</I>.
- When more than one axis is displayed in a margin, it represents the first
-axis displayed. <P>
-The following operations are available for axes. They mirror
-exactly the operations of the <B>axis</B> component. The <I>axis</I> argument must be
-<B>xaxis</B>, <B>x2axis</B>, <B>yaxis</B>, or <B>y2axis</B>. This feature is deprecated since more
-than one axis can now be used a margin. You should only use the <B>xaxis</B>,
-<B>x2axis</B>, <B>yaxis</B>, and <B>y2axis</B> components with the <B>use</B> operation. For all other
-operations, use the general <B>axis</B> component instead.
-<DL>
-
-<DT><I>pathName <I>axis <B>cget <I>option</I></B></I></I>
-</DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis <B>configure </B></I></I>?<I>option value</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis<B> invtransform <I>value</I></B></I></I>
-</DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis <B>limits</B></I></I> </DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis<B> transform <I>value</I></B></I></I> </DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis<B> use </B></I></I>?<I>axisName</I>?
- </DT>
-<DD>Designates the axis <I>axisName</I> is to be displayed at this location. <I>AxisName</I>
-can not be already in use at another location. This command returns the
-name of the axis currently using this location. </DD>
-</DL>
-
-<H3><A NAME="sect9" HREF="#toc9">Crosshairs Component</A></H3>
-Cross
-hairs consist of two intersecting lines (one vertical and one horizontal)
-drawn completely across the plotting area. They are used to position the
-mouse in relation to the coordinate axes. Cross hairs differ from line
-markers in that they are implemented using XOR drawing primitives. This
-means that they can be quickly drawn and erased without redrawing the entire
-graph. <P>
-The following operations are available for cross hairs:
-<DL>
-
-<DT><I>pathName
-<B>crosshairs cget <I>option</I></B></I> </DT>
-<DD>Returns the current value of the cross hairs configuration
-option given by <I>option</I>. <I>Option</I> may be any option described below for the
-cross hairs <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>crosshairs configure </B></I>?<I>option value</I>?...
- </DT>
-<DD>Queries or modifies the configuration options of the cross hairs. If
-<I>option</I> isn't specified, a list describing all the current options for the
-cross hairs is returned. If <I>option</I> is specified, but not <I>value</I>, then a
-list describing <I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs
-are specified, then for each pair, the cross hairs option <I>option</I> is set
-to <I>value</I>. The following options are available for cross hairs. <blockquote></DD>
-
-<DT><B>-color <I>color</I></B>
- </DT>
-<DD>Sets the color of the cross hairs. The default is <I>black</I>. </DD>
-
-<DT><B>-dashes <I>dashList</I></B>
-</DT>
-<DD>Sets the dash style of the cross hairs. <I>DashList</I> is a list of up to 11 numbers
-that alternately represent the lengths of the dashes and gaps on the cross
-hair lines. Each number must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the
-cross hairs will be solid lines. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether cross hairs
-are drawn. If <I>boolean</I> is true, cross hairs are not drawn. The default is
-<I>yes</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Set the width of the cross hair lines. The default
-is <I>1</I>. </DD>
-
-<DT><B>-position <I>pos</I></B> </DT>
-<DD>Specifies the screen position where the cross hairs
-intersect. <I>Pos</I> must be in the form "<I>@x,y</I>", where <I>x</I> and <I>y</I> are the window
-coordinates of the intersection. </DD>
-</DL>
-<P>
-Cross hairs configuration options may be
-also be set by the <B>option</B> command. The resource name and class are <I>crosshairs</I>
-and <I>Crosshairs</I> respectively. <BR>
-<CODE>option add *Graph.Crosshairs.LineWidth 2<BR>
-option add *Graph.Crosshairs.Color red<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>crosshairs off</B></I> </DT>
-<DD>Turns off the cross hairs. </DD>
-
-<DT><I>pathName <B>crosshairs
-on</B></I> </DT>
-<DD>Turns on the display of the cross hairs. </DD>
-
-<DT><I>pathName <B>crosshairs toggle</B></I>
-</DT>
-<DD>Toggles the current state of the cross hairs, alternately mapping and unmapping
-the cross hairs. </DD>
-</DL>
-
-<H3><A NAME="sect10" HREF="#toc10">Element Components</A></H3>
-A data element represents a set of data.
- It contains x and y vectors containing the coordinates of the data points.
- Elements can be displayed with a symbol at each data point and lines connecting
-the points. Elements also control the appearance of the data, such as the
-symbol type, line width, color etc. <P>
-When new data elements are created,
-they are automatically added to a list of displayed elements. The display
-list controls what elements are drawn and in what order. <P>
-The following
-operations are available for elements.
-<DL>
-
-<DT><I>pathName <B>element activate <I>elemName
-</I></B></I>?<I>index</I>?... </DT>
-<DD>Specifies the data points of element <I>elemName</I> to be drawn using
-active foreground and background colors. <I>ElemName</I> is the name of the element
-and <I>index</I> is a number representing the index of the data point. If no indices
-are present then all data points become active. </DD>
-
-<DT><I>pathName <B>element bind <I>tagName</I></B></I>
-?<I>sequence</I>? ?<I>command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I> such that whenever
-the event sequence given by <I>sequence</I> occurs for an element with this tag,
-<I>command</I> will be invoked. The syntax is similar to the <B>bind</B> command except
-that it operates on graph elements, rather than widgets. See the <B>bind</B> manual
-entry for complete details on <I>sequence</I> and the substitutions performed
-on <I>command</I> before invoking it. <P>
-If all arguments are specified then a
-new binding is created, replacing any existing binding for the same <I>sequence</I>
-and <I>tagName</I>. If the first character of <I>command</I> is <I>+</I> then <I>command</I> augments
-an existing binding rather than replacing it. If no <I>command</I> argument is
-provided then the command currently associated with <I>tagName</I> and <I>sequence</I>
-(it's an error occurs if there's no such binding) is returned. If both <I>command</I>
-and <I>sequence</I> are missing then a list of all the event sequences for which
-bindings have been defined for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>element cget <I>elemName
-<I>option</I></I></B></I> </DT>
-<DD>Returns the current value of the element configuration option given
-by <I>option</I>. <I>Option</I> may be any of the options described below for the element
-<B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>element closest <I>x y</I></B></I> <I>varName</I> ?<I>option value</I>?...
-?<I>elemName</I>?... </DT>
-<DD>Finds the data point closest to the window coordinates <I>x</I> and
-<I>y</I> in the element <I>elemName</I>. <I>ElemName</I> is the name of an element, that must
-not be hidden. If no elements are specified, then all visible elements
-are searched. It returns via the array variable <I>varName</I> the name of the
-closest element, the index of its closest point, and the graph coordinates
-of the point. Returns <I>0</I>, if no data point within the threshold distance
-can be found, otherwise <I>1</I> is returned. The following <I>option</I>-<I>value</I> pairs
-are available. <blockquote></DD>
-
-<DT><B>-halo <I>pixels</I></B> </DT>
-<DD>Specifies a threshold distance where selected
-data points are ignored. <I>Pixels</I> is a valid screen distance, such as <I>2</I> or
-<I>1.2i</I>. If this option isn't specified, then it defaults to the value of the
-graph's <B>-halo</B> option. </DD>
-
-<DT><B>-interpolate <I>string</I></B> </DT>
-<DD>Indicates whether to consider projections
-that lie along the line segments connecting data points when searching
-for the closest point. The default value is <I>0</I>. The values for <I>string</I> are
-described below. <blockquote></DD>
-
-<DT><I>no</I> </DT>
-<DD>Search only for the closest data point. </DD>
-
-<DT><I>yes</I> </DT>
-<DD>Search includes
-projections that lie along the line segments connecting the data points.
- </DD>
-
-<DT><I>x</I> </DT>
-<DD>Search includes vertical projections from the given X-coordinate. </DD>
-
-<DT><I>y</I>
-</DT>
-<DD>Search includes horizontal projections from the given Y-coordinate. </DD>
-</DL>
-</blockquote>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>element configure <I>elemName </I></B></I>?<I>elemName</I>... ?<I>option value</I>?... </DT>
-<DD>Queries or modifies
-the configuration options for elements. Several elements can be modified
-at the same time. If <I>option</I> isn't specified, a list describing all the current
-options for <I>elemName</I> is returned. If <I>option</I> is specified, but not <I>value</I>,
-then a list describing the option <I>option</I> is returned. If one or more <I>option</I>
-and <I>value</I> pairs are specified, then for each pair, the element option <I>option</I>
-is set to <I>value</I>. The following options are valid for elements. <blockquote></DD>
-
-<DT><B>-activepen
-<I>penName</I></B> </DT>
-<DD>Specifies pen to use to draw active element. If <I>penName</I> is <I>""</I>,
-no active elements will be drawn. The default is <I>activeLine</I>. </DD>
-
-<DT><B>-bindtags <I>tagList</I></B>
-</DT>
-<DD>Specifies the binding tags for the element. <I>TagList</I> is a list of binding
-tag names. The tags and their order will determine how events are handled
-for elements. Each tag in the list matching the current event sequence
-will have its Tcl command executed. Implicitly the name of the element
-is always the first tag in the list. The default value is <I>all</I>. </DD>
-
-<DT><B>-color <I>color</I></B>
- </DT>
-<DD>Sets the color of the traces connecting the data points. </DD>
-
-<DT><B>-dashes <I>dashList</I></B>
-</DT>
-<DD>Sets the dash style of element line. <I>DashList</I> is a list of up to 11 numbers
-that alternately represent the lengths of the dashes and gaps on the element
-line. Each number must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the lines
-will be solid. </DD>
-
-<DT><B>-data <I>coordList</I></B> </DT>
-<DD>Specifies the X-Y coordinates of the data.
-<I>CoordList</I> is a list of numeric expressions representing the X-Y coordinate
-pairs of each data point. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the interior color of symbols.
- If <I>color</I> is <I>""</I>, then the interior of the symbol is transparent. If <I>color</I>
-is <I>defcolor</I>, then the color will be the same as the <B>-color</B> option. The default
-is <I>defcolor</I>. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether the element is displayed. The
-default is <I>no</I>. </DD>
-
-<DT><B>-label <I>text</I></B> </DT>
-<DD>Sets the element's label in the legend. If <I>text</I>
-is <I>""</I>, the element will have no entry in the legend. The default label is
-the element's name. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the connecting lines
-between data points. If <I>pixels</I> is <I>0</I>, no connecting lines will be drawn
-between symbols. The default is <I>0</I>. </DD>
-
-<DT><B>-mapx <I>xAxis</I></B> </DT>
-<DD>Selects the X-axis to map the
-element's X-coordinates onto. <I>XAxis</I> must be the name of an axis. The default
-is <I>x</I>. </DD>
-
-<DT><B>-mapy <I>yAxis</I></B> </DT>
-<DD>Selects the Y-axis to map the element's Y-coordinates onto.
-<I>YAxis</I> must be the name of an axis. The default is <I>y</I>. </DD>
-
-<DT><B>-offdash <I>color</I></B> </DT>
-<DD>Sets the
-color of the stripes when traces are dashed (see the <B>-dashes</B> option). If
-<I>color</I> is <I>""</I>, then the "off" pixels will represent gaps instead of stripes.
- If <I>color</I> is <I>defcolor</I>, then the color will be the same as the <B>-color</B> option.
- The default is <I>defcolor</I>. </DD>
-
-<DT><B>-outline <I>color</I></B> </DT>
-<DD>Sets the color or the outline around
-each symbol. If <I>color</I> is <I>""</I>, then no outline is drawn. If <I>color</I> is <I>defcolor</I>,
-then the color will be the same as the <B>-color</B> option. The default is <I>defcolor</I>.
-</DD>
-
-<DT><B>-outlinewidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the outline bordering each symbol.
- If <I>pixels</I> is <I>0</I>, no outline will be drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-pixels <I>pixels</I></B>
-</DT>
-<DD>Sets the size of symbols. If <I>pixels</I> is <I>0</I>, no symbols will be drawn. The
-default is <I>0.125i</I>. </DD>
-
-<DT><B>-scalesymbols <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, the size of
-the symbols drawn for <I>elemName</I> will change with scale of the X-axis and
-Y-axis. At the time this option is set, the current ranges of the axes are
-saved as the normalized scales (i.e scale factor is 1.0) and the element
-is drawn at its designated size (see the <B>-pixels</B> option). As the scale of
-the axes change, the symbol will be scaled according to the smaller of
-the X-axis and Y-axis scales. If <I>boolean</I> is false, the element's symbols are
-drawn at the designated size, regardless of axis scales. The default is
-<I>0</I>. </DD>
-
-<DT><B>-smooth <I>smooth</I></B> </DT>
-<DD>Specifies how connecting line segments are drawn between
-data points. <I>Smooth</I> can be either <I>linear</I>, <I>step</I>, <I>natural</I>, or <I>quadratic</I>. If
-<I>smooth</I> is <I>linear</I>, a single line segment is drawn, connecting both data
-points. When <I>smooth</I> is <I>step</I>, two line segments are drawn. The first is a
-horizontal line segment that steps the next X-coordinate. The second is
-a vertical line, moving to the next Y-coordinate. Both <I>natural</I> and <I>quadratic</I>
-generate multiple segments between data points. If <I>natural</I>, the segments
-are generated using a cubic spline. If <I>quadratic</I>, a quadratic spline is
-used. The default is <I>linear</I>. </DD>
-
-<DT><B>-styles <I>styleList</I></B> </DT>
-<DD>Specifies what pen to use
-based on the range of weights given. <I>StyleList</I> is a list of style specifications.
-Each style specification, in turn, is a list consisting of a pen name,
-and optionally a minimum and maximum range. Data points whose weight (see
-the <B>-weight</B> option) falls in this range, are drawn with this pen. If no
-range is specified it defaults to the index of the pen in the list. Note
-that this affects only symbol attributes. Line attributes, such as line
-width, dashes, etc. are ignored. </DD>
-
-<DT><B>-symbol <I>symbol</I></B> </DT>
-<DD>Specifies the symbol for
-data points. <I>Symbol</I> can be either <I>square</I>, <I>circle</I>, <I>diamond</I>, <I>plus</I>, <I>cross</I>,
-<I>splus</I>, <I>scross</I>, <I>triangle</I>, <I>""</I> (where no symbol is drawn), or a bitmap. Bitmaps
-are specified as "<I>source</I> ?<I>mask</I>?", where <I>source</I> is the name of the bitmap,
-and <I>mask</I> is the bitmap's optional mask. The default is <I>circle</I>. </DD>
-
-<DT><B>-trace <I>direction</I></B>
- </DT>
-<DD>Indicates whether connecting lines between data points (whose X-coordinate
-values are either increasing or decreasing) are drawn. <I>Direction</I> must
-be <I>increasing</I>, <I>decreasing</I>, or <I>both</I>. For example, if <I>direction</I> is <I>increasing</I>,
-connecting lines will be drawn only between those data points where X-coordinate
-values are monotonically increasing. If <I>direction</I> is <I>both</I>, connecting lines
-will be draw between all data points. The default is <I>both</I>. </DD>
-
-<DT><B>-weights <I>wVec</I></B>
- </DT>
-<DD>Specifies the weights of the individual data points. This, with the list
-pen styles (see the <B>-styles</B> option), controls how data points are drawn.
- <I>WVec</I> is the name of a BLT vector or a list of numeric expressions representing
-the weights for each data point. </DD>
-
-<DT><B>-xdata <I>xVec</I></B> </DT>
-<DD>Specifies the X-coordinates
-of the data. <I>XVec</I> is the name of a BLT vector or a list of numeric expressions.
-</DD>
-
-<DT><B>-ydata <I>yVec</I></B> </DT>
-<DD>Specifies the Y-coordinates of the data. <I>YVec</I> is the name of
-a BLT vector or a list of numeric expressions. </DD>
-</DL>
-<P>
-Element configuration options
-may also be set by the <B>option</B> command. The resource class is <I>Element</I>. The
-resource name is the name of the element. <BR>
-<CODE>option add *Graph.Element.symbol line<BR>
-option add *Graph.e1.symbol line<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>element create <I>elemName</I></B></I> ?<I>option value</I>?... </DT>
-<DD>Creates a new element <I>elemName</I>.
- It's an error is an element <I>elemName</I> already exists. If additional arguments
-are present, they specify options valid for the element <B>configure</B> operation.
-</DD>
-
-<DT><I>pathName <B>element deactivate <I>elemName</I></B></I> ?<I>elemName</I>?... </DT>
-<DD>Deactivates all the elements
-matching <I>pattern</I>. Elements whose names match any of the patterns given are
-redrawn using their normal colors. </DD>
-
-<DT><I>pathName <B>element delete</B></I> ?<I>elemName</I>?... </DT>
-<DD>Deletes
-all the named elements. The graph is automatically redrawn. </DD>
-
-<DT><I>pathName <B>element
-exists <I>elemName</I></B></I> </DT>
-<DD>Returns <I>1</I> if an element <I>elemName</I> currently exists and <I>0</I>
-otherwise. </DD>
-
-<DT><I>pathName <B>element names </B></I>?<I>pattern</I>?... </DT>
-<DD>Returns the elements matching
-one or more pattern. If no <I>pattern</I> is given, the names of all elements
-is returned. </DD>
-
-<DT><I>pathName <B>element show</B></I> ?<I>nameList</I>? </DT>
-<DD>Queries or modifies the
-element display list. The element display list designates the elements
-drawn and in what order. <I>NameList</I> is a list of elements to be displayed
-in the order they are named. If there is no <I>nameList</I> argument, the current
-display list is returned. </DD>
-
-<DT><I>pathName <B>element type</B></I> <I>elemName</I> </DT>
-<DD>Returns the type
-of <I>elemName</I>. If the element is a bar element, the commands returns the
-string <I>"bar"</I>, otherwise it returns <I>"line"</I>. </DD>
-</DL>
-
-<H3><A NAME="sect11" HREF="#toc11"></CODE><P>Grid Component</A></H3>
-Grid lines extend
-from the major and minor ticks of each axis horizontally or vertically
-across the plotting area. The following operations are available for grid
-lines.
-<DL>
-
-<DT><I>pathName <B>grid cget <I>option</I></B></I> </DT>
-<DD>Returns the current value of the grid line
-configuration option given by <I>option</I>. <I>Option</I> may be any option described
-below for the grid <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>grid configure</B></I> ?<I>option
-value</I>?... </DT>
-<DD>Queries or modifies the configuration options for grid lines. If
-<I>option</I> isn't specified, a list describing all the current grid options for
-<I>pathName</I> is returned. If <I>option</I> is specified, but not <I>value</I>, then a list
-describing <I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs are
-specified, then for each pair, the grid line option <I>option</I> is set to <I>value</I>.
- The following options are valid for grid lines. <blockquote></DD>
-
-<DT><B>-color <I>color</I></B> </DT>
-<DD>Sets the color
-of the grid lines. The default is <I>black</I>. </DD>
-
-<DT><B>-dashes <I>dashList</I></B> </DT>
-<DD>Sets the dash style
-of the grid lines. <I>DashList</I> is a list of up to 11 numbers that alternately
-represent the lengths of the dashes and gaps on the grid lines. Each number
-must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the grid will be solid lines.
-</DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether the grid should be drawn. If <I>boolean</I> is true,
-grid lines are not shown. The default is <I>yes</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of grid lines. The default width is <I>1</I>. </DD>
-
-<DT><B>-mapx <I>xAxis</I></B> </DT>
-<DD>Specifies the X-axis to
-display grid lines. <I>XAxis</I> must be the name of an axis or <I>""</I> for no grid
-lines. The default is <I>""</I>. </DD>
-
-<DT><B>-mapy <I>yAxis</I></B> </DT>
-<DD>Specifies the Y-axis to display grid
-lines. <I>YAxis</I> must be the name of an axis or <I>""</I> for no grid lines. The default
-is <I>y</I>. </DD>
-
-<DT><B>-minor <I>boolean</I></B> </DT>
-<DD>Indicates whether the grid lines should be drawn for
-minor ticks. If <I>boolean</I> is true, the lines will appear at minor tick intervals.
- The default is <I>1</I>. </DD>
-</DL>
-<P>
-Grid configuration options may also be set by the <B>option</B>
-command. The resource name and class are <I>grid</I> and <I>Grid</I> respectively. <BR>
-<CODE>option add *Graph.grid.LineWidth 2<BR>
-option add *Graph.Grid.Color black<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>grid off</B></I> </DT>
-<DD>Turns off the display the grid lines. </DD>
-
-<DT><I>pathName <B>grid on</B></I>
-</DT>
-<DD>Turns on the display the grid lines. </DD>
-
-<DT><I>pathName <B>grid toggle</B></I> </DT>
-<DD>Toggles the display
-of the grid. </DD>
-</DL>
-
-<H3><A NAME="sect12" HREF="#toc12">Legend Component</A></H3>
-The legend displays a list of the data elements.
- Each entry consists of the element's symbol and label. The legend can appear
-in any margin (the default location is in the right margin). It can also
-be positioned anywhere within the plotting area. <P>
-The following operations
-are valid for the legend.
-<DL>
-
-<DT><I>pathName <B>legend activate <I>pattern</I></B></I>... </DT>
-<DD>Selects legend
-entries to be drawn using the active legend colors and relief. All entries
-whose element names match <I>pattern</I> are selected. To be selected, the element
-name must match only one <I>pattern</I>. </DD>
-
-<DT><I>pathName <B>legend bind <I>tagName</I></B></I> ?<I>sequence</I>?
- ?<I>command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I> such that whenever the event
-sequence given by <I>sequence</I> occurs for a legend entry with this tag, <I>command</I>
-will be invoked. Implicitly the element names in the entry are tags. The
-syntax is similar to the <B>bind</B> command except that it operates on legend
-entries, rather than widgets. See the <B>bind</B> manual entry for complete details
-on <I>sequence</I> and the substitutions performed on <I>command</I> before invoking
-it. <P>
-If all arguments are specified then a new binding is created, replacing
- any existing binding for the same <I>sequence</I> and <I>tagName</I>. If the first character
-of <I>command</I> is <I>+</I> then <I>command</I> augments an existing binding rather than
-replacing it. If no <I>command</I> argument is provided then the command currently
-associated with <I>tagName</I> and <I>sequence</I> (it's an error occurs if there's no
-such binding) is returned. If both <I>command</I> and <I>sequence</I> are missing then
-a list of all the event sequences for which bindings have been defined
-for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>legend cget <I>option</I></B></I> </DT>
-<DD>Returns the current value of a
-legend configuration option. <I>Option</I> may be any option described below in
-the legend <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>legend configure </B></I>?<I>option value</I>?...
-</DT>
-<DD>Queries or modifies the configuration options for the legend. If <I>option</I>
-isn't specified, a list describing the current legend options for <I>pathName</I>
-is returned. If <I>option</I> is specified, but not <I>value</I>, then a list describing
-<I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs are specified,
-then for each pair, the legend option <I>option</I> is set to <I>value</I>. The following
-options are valid for the legend. <blockquote></DD>
-
-<DT><B>-activebackground <I>color</I></B> </DT>
-<DD>Sets the background
-color for active legend entries. All legend entries marked active (see
-the legend <B>activate</B> operation) are drawn using this background color. </DD>
-
-<DT><B>-activeborderwidth
-<I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around the outside edge of the active
-legend entries. The default is <I>2</I>. </DD>
-
-<DT><B>-activeforeground <I>color</I></B> </DT>
-<DD>Sets the foreground
-color for active legend entries. All legend entries marked as active (see
-the legend <B>activate</B> operation) are drawn using this foreground color. </DD>
-
-<DT><B>-activerelief
-<I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect desired for active legend entries. <I>Relief</I>
-denotes how the interior of the entry should appear relative to the legend;
-for example, <I>raised</I> means the entry should appear to protrude from the
-legend, relative to the surface of the legend. The default is <I>flat</I>. </DD>
-
-<DT><B>-anchor
-<I>anchor</I></B> </DT>
-<DD>Tells how to position the legend relative to the positioning point
-for the legend. This is dependent on the value of the <B>-position</B> option.
-The default is <I>center</I>. <blockquote></DD>
-
-<DT><I>left</I> or <I>right</I> </DT>
-<DD>The anchor describes how to position
-the legend vertically. </DD>
-
-<DT><I>top</I> or <I>bottom</I> </DT>
-<DD>The anchor describes how to position
-the legend horizontally. </DD>
-
-<DT><I>@x,y</I> </DT>
-<DD>The anchor specifies how to position the
-legend relative to the positioning point. For example, if <I>anchor</I> is <I>center</I>
-then the legend is centered on the point; if <I>anchor</I> is <I>n</I> then the legend
-will be drawn such that the top center point of the rectangular region
-occupied by the legend will be at the positioning point. </DD>
-
-<DT><I>plotarea</I> </DT>
-<DD>The anchor
-specifies how to position the legend relative to the plotting area. For
-example, if <I>anchor</I> is <I>center</I> then the legend is centered in the plotting
-area; if <I>anchor</I> is <I>ne</I> then the legend will be drawn such that occupies
-the upper right corner of the plotting area. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets the background
-color of the legend. If <I>color</I> is <I>""</I>, the legend background with be transparent.
-</DD>
-
-<DT><B>-bindtags <I>tagList</I></B> </DT>
-<DD>Specifies the binding tags for legend entries. <I>TagList</I>
-is a list of binding tag names. The tags and their order will determine
-how events are handled for legend entries. Each tag in the list matching
- the current event sequence will have its Tcl command executed. The default
-value is <I>all</I>. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around
-the outside edge of the legend (if such border is being drawn; the <B>relief</B>
-option determines this). The default is <I>2</I> pixels. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD><I>FontName</I>
-specifies a font to use when drawing the labels of each element into the
-legend. The default is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets
-the foreground color of the text drawn for the element's label. The default
-is <I>black</I>. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether the legend should be displayed.
-If <I>boolean</I> is true, the legend will not be draw. The default is <I>no</I>. </DD>
-
-<DT><B>-ipadx
-<I>pad</I></B> </DT>
-<DD>Sets the amount of internal padding to be added to the width of each
-legend entry. <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I>
-has two elements, the left side of the legend entry is padded by the first
-distance and the right side by the second. If <I>pad</I> is just one distance,
-both the left and right sides are padded evenly. The default is <I>2</I>. </DD>
-
-<DT><B>-ipady
-<I>pad</I></B> </DT>
-<DD>Sets an amount of internal padding to be added to the height of each
-legend entry. <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I>
-has two elements, the top of the entry is padded by the first distance
-and the bottom by the second. If <I>pad</I> is just one distance, both the top
-and bottom of the entry are padded evenly. The default is <I>2</I>. </DD>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets
-the padding to the left and right exteriors of the legend. <I>Pad</I> can be a
-list of one or two screen distances. If <I>pad</I> has two elements, the left
-side of the legend is padded by the first distance and the right side by
-the second. If <I>pad</I> has just one distance, both the left and right sides
-are padded evenly. The default is <I>4</I>. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets the padding above and
-below the legend. <I>Pad</I> can be a list of one or two screen distances. If
-<I>pad</I> has two elements, the area above the legend is padded by the first
-distance and the area below by the second. If <I>pad</I> is just one distance,
-both the top and bottom areas are padded evenly. The default is <I>0</I>. </DD>
-
-<DT><B>-position
-<I>pos</I></B> </DT>
-<DD>Specifies where the legend is drawn. The <B>-anchor</B> option also affects
-where the legend is positioned. If <I>pos</I> is <I>left</I>, <I>left</I>, <I>top</I>, or <I>bottom</I>, the
-legend is drawn in the specified margin. If <I>pos</I> is <I>plotarea</I>, then the legend
-is drawn inside the plotting area at a particular anchor. If <I>pos</I> is in
-the form "<I>@x,y</I>", where <I>x</I> and <I>y</I> are the window coordinates, the legend is
-drawn in the plotting area at the specified coordinates. The default is
-<I>right</I>. </DD>
-
-<DT><B>-raised <I>boolean</I></B> </DT>
-<DD>Indicates whether the legend is above or below the
-data elements. This matters only if the legend is in the plotting area.
- If <I>boolean</I> is true, the legend will be drawn on top of any elements that
-may overlap it. The default is <I>no</I>. </DD>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect
-for the border around the legend. <I>Relief</I> specifies how the interior of the
-legend should appear relative to the graph; for example, <I>raised</I> means the
-legend should appear to protrude from the graph, relative to the surface
-of the graph. The default is <I>sunken</I>. </DD>
-</DL>
-<P>
-Legend configuration options may also
-be set by the <B>option</B> command. The resource name and class are <I>legend</I> and
-<I>Legend</I> respectively. <BR>
-<CODE>option add *Graph.legend.Foreground blue<BR>
-option add *Graph.Legend.Relief raised<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>legend deactivate <I>pattern</I></B></I>... </DT>
-<DD>Selects legend entries to be drawn using
-the normal legend colors and relief. All entries whose element names match
-<I>pattern</I> are selected. To be selected, the element name must match only
-one <I>pattern</I>. </DD>
-
-<DT><I>pathName <B>legend get <I>pos</I></B></I> </DT>
-<DD>Returns the name of the element whose
-entry is at the screen position <I>pos</I> in the legend. <I>Pos</I> must be in the form
-"<I>@x,y</I>", where <I>x</I> and <I>y</I> are window coordinates. If the given coordinates
-do not lie over a legend entry, <I>""</I> is returned. </DD>
-</DL>
-
-<H3><A NAME="sect13" HREF="#toc13">Pen Components</A></H3>
-Pens define
-attributes (both symbol and line style) for elements. Pens mirror the configuration
-options of data elements that pertain to how symbols and lines are drawn.
- Data elements use pens to determine how they are drawn. A data element
-may use several pens at once. In this case, the pen used for a particular
-data point is determined from each element's weight vector (see the element's
-<B>-weight</B> and <B>-style</B> options). <P>
-One pen, called <I>activeLine</I>, is automatically
-created. It's used as the default active pen for elements. So you can change
-the active attributes for all elements by simply reconfiguring this pen.
-<BR>
-<CODE>.g pen configure "activeLine" -color green<BR>
-</CODE><P>You can create and use several pens. To create a pen, invoke the pen component
-and its create operation. <BR>
-<CODE>.g pen create myPen<BR>
-</CODE><P>You map pens to a data element using either the element's <B>-pen</B> or <B>-activepen</B>
-options. <BR>
-<CODE>.g element create "line1" -xdata $x -ydata $tempData \<BR>
- -pen myPen<BR>
-</CODE><P>An element can use several pens at once. This is done by specifying the
-name of the pen in the element's style list (see the <B>-styles</B> option). <BR>
-<CODE>.g element configure "line1" -styles { myPen 2.0 3.0 }<BR>
-</CODE><P>This says that any data point with a weight between 2.0 and 3.0 is to be
-drawn using the pen <I>myPen</I>. All other points are drawn with the element's
-default attributes. <P>
-The following operations are available for pen components.
-<P>
-
-<DL>
-
-<DT><I>pathName <B>pen <B>cget <I>penName <I>option</I></I></B></B></I> </DT>
-<DD>Returns the current value of the option
-given by <I>option</I> for <I>penName</I>. <I>Option</I> may be any option described below for
-the pen <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>pen <B>configure <I>penName </I></B></B></I>?<I>penName</I>... ?<I>option
-value</I>?... </DT>
-<DD>Queries or modifies the configuration options of <I>penName</I>. Several
-pens can be modified at once. If <I>option</I> isn't specified, a list describing
-the current options for <I>penName</I> is returned. If <I>option</I> is specified, but
-not <I>value</I>, then a list describing <I>option</I> is returned. If one or more <I>option</I>
-and <I>value</I> pairs are specified, then for each pair, the pen option <I>option</I>
-is set to <I>value</I>. The following options are valid for pens. <blockquote></DD>
-
-<DT><B>-color <I>color</I></B>
-</DT>
-<DD>Sets the color of the traces connecting the data points. </DD>
-
-<DT><B>-dashes <I>dashList</I></B>
-</DT>
-<DD>Sets the dash style of element line. <I>DashList</I> is a list of up to 11 numbers
-that alternately represent the lengths of the dashes and gaps on the element
-line. Each number must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the lines
-will be solid. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the interior color of symbols. If <I>color</I>
-is <I>""</I>, then the interior of the symbol is transparent. If <I>color</I> is <I>defcolor</I>,
-then the color will be the same as the <B>-color</B> option. The default is <I>defcolor</I>.
-</DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the connecting lines between data points.
- If <I>pixels</I> is <I>0</I>, no connecting lines will be drawn between symbols. The
-default is <I>0</I>. </DD>
-
-<DT><B>-offdash <I>color</I></B> </DT>
-<DD>Sets the color of the stripes when traces are
-dashed (see the <B>-dashes</B> option). If <I>color</I> is <I>""</I>, then the "off" pixels will
-represent gaps instead of stripes. If <I>color</I> is <I>defcolor</I>, then the color
-will be the same as the <B>-color</B> option. The default is <I>defcolor</I>. </DD>
-
-<DT><B>-outline <I>color</I></B>
- </DT>
-<DD>Sets the color or the outline around each symbol. If <I>color</I> is <I>""</I>, then
-no outline is drawn. If <I>color</I> is <I>defcolor</I>, then the color will be the same
-as the <B>-color</B> option. The default is <I>defcolor</I>. </DD>
-
-<DT><B>-outlinewidth <I>pixels</I></B> </DT>
-<DD>Sets
-the width of the outline bordering each symbol. If <I>pixels</I> is <I>0</I>, no outline
-will be drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-pixels <I>pixels</I></B> </DT>
-<DD>Sets the size of symbols.
-If <I>pixels</I> is <I>0</I>, no symbols will be drawn. The default is <I>0.125i</I>. </DD>
-
-<DT><B>-symbol <I>symbol</I></B>
- </DT>
-<DD>Specifies the symbol for data points. <I>Symbol</I> can be either <I>square</I>, <I>circle</I>,
-<I>diamond</I>, <I>plus</I>, <I>cross</I>, <I>splus</I>, <I>scross</I>, <I>triangle</I>, <I>""</I> (where no symbol is drawn),
-or a bitmap. Bitmaps are specified as "<I>source</I> ?<I>mask</I>?", where <I>source</I> is
-the name of the bitmap, and <I>mask</I> is the bitmap's optional mask. The default
-is <I>circle</I>. </DD>
-
-<DT><B>-type <I>elemType</I></B> </DT>
-<DD>Specifies the type of element the pen is to be
-used with. This option should only be employed when creating the pen. This
-is for those that wish to mix different types of elements (bars and lines)
-on the same graph. The default type is "line". </DD>
-</DL>
-<P>
-Pen configuration options
-may be also be set by the <B>option</B> command. The resource class is <I>Pen</I>. The
-resource names are the names of the pens. <BR>
-<CODE>option add *Graph.Pen.Color blue<BR>
-option add *Graph.activeLine.color green<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>pen <B>create <I>penName </I></B></B></I>?<I>option value</I>?... </DT>
-<DD>Creates a new pen by the name
-<I>penName</I>. No pen by the same name can already exist. <I>Option</I> and <I>value</I> are
-described in above in the pen <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>pen <B>delete
-</B></B></I>?<I>penName</I>?... </DT>
-<DD>Deletes the named pens. A pen is not really deleted until it is
-not longer in use, so it's safe to delete pens mapped to elements. </DD>
-
-<DT><I>pathName
-<B>pen names </B></I>?<I>pattern</I>?... </DT>
-<DD>Returns a list of pens matching zero or more patterns.
- If no <I>pattern</I> argument is give, the names of all pens are returned. </DD>
-</DL>
-
-<H3><A NAME="sect14" HREF="#toc14">PostScript
-Component</A></H3>
-The graph can generate encapsulated PostScript output. There are
-several configuration options you can specify to control how the plot will
-be generated. You can change the page dimensions and borders. The plot
-itself can be scaled, centered, or rotated to landscape. The PostScript
-output can be written directly to a file or returned through the interpreter.
-<P>
-The following postscript operations are available.
-<DL>
-
-<DT><I>pathName <B>postscript cget
-<I>option</I></B></I> </DT>
-<DD>Returns the current value of the postscript option given by <I>option</I>.
- <I>Option</I> may be any option described below for the postscript <B>configure</B>
-operation. </DD>
-
-<DT><I>pathName <B>postscript configure </B></I>?<I>option value</I>?... </DT>
-<DD>Queries or modifies
-the configuration options for PostScript generation. If <I>option</I> isn't specified,
-a list describing the current postscript options for <I>pathName</I> is returned.
- If <I>option</I> is specified, but not <I>value</I>, then a list describing <I>option</I> is
-returned. If one or more <I>option</I> and <I>value</I> pairs are specified, then for
-each pair, the postscript option <I>option</I> is set to <I>value</I>. The following
-postscript options are available. <blockquote></DD>
-
-<DT><B>-center <I>boolean</I></B> </DT>
-<DD>Indicates whether the plot
-should be centered on the PostScript page. If <I>boolean</I> is false, the plot
-will be placed in the upper left corner of the page. The default is <I>1</I>. </DD>
-
-<DT><B>-colormap
-<I>varName</I></B> </DT>
-<DD><I>VarName</I> must be the name of a global array variable that specifies
-a color mapping from the X color name to PostScript. Each element of <I>varName</I>
-must consist of PostScript code to set a particular color value (e.g. ``<I>1.0
-1.0 0.0 setrgbcolor</I>''). When generating color information in PostScript, the
-array variable <I>varName</I> is checked if an element of the name as the color
-exists. If so, it uses its value as the PostScript command to set the color.
- If this option hasn't been specified, or if there isn't an entry in <I>varName</I>
-for a given color, then it uses the red, green, and blue intensities from
-the X color. </DD>
-
-<DT><B>-colormode <I>mode</I></B> </DT>
-<DD>Specifies how to output color information. <I>Mode</I>
-must be either <I>color</I> (for full color output), <I>gray</I> (convert all colors
-to their gray-scale equivalents) or <I>mono</I> (convert foreground colors to black
-and background colors to white). The default mode is <I>color</I>. </DD>
-
-<DT><B>-fontmap <I>varName</I></B>
-</DT>
-<DD><I>VarName</I> must be the name of a global array variable that specifies a font
-mapping from the X font name to PostScript. Each element of <I>varName</I> must
-consist of a Tcl list with one or two elements; the name and point size
-of a PostScript font. When outputting PostScript commands for a particular
-font, the array variable <I>varName</I> is checked to see if an element by the
- specified font exists. If there is such an element, then the font information
-contained in that element is used in the PostScript output. (If the point
-size is omitted from the list, the point size of the X font is used). Otherwise
-the X font is examined in an attempt to guess what PostScript font to use.
- This works only for fonts whose foundry property is <I>Adobe</I> (such as Times,
-Helvetica, Courier, etc.). If all of this fails then the font defaults to
-<I>Helvetica-Bold</I>. </DD>
-
-<DT><B>-decorations <I>boolean</I></B> </DT>
-<DD>Indicates whether PostScript commands
-to generate color backgrounds and 3-D borders will be output. If <I>boolean</I>
-is false, the background will be white and no 3-D borders will be generated.
-The default is <I>1</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B> </DT>
-<DD>Sets the height of the plot. This lets you
-print the graph with a height different from the one drawn on the screen.
- If <I>pixels</I> is 0, the height is the same as the widget's height. The default
-is <I>0</I>. </DD>
-
-<DT><B>-landscape <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, this specifies the printed area
-is to be rotated 90 degrees. In non-rotated output the X-axis of the printed
-area runs along the short dimension of the page (``portrait'' orientation);
-in rotated output the X-axis runs along the long dimension of the page (``landscape''
-orientation). Defaults to <I>0</I>. </DD>
-
-<DT><B>-maxpect <I>boolean</I></B> </DT>
-<DD>Indicates to scale the plot
-so that it fills the PostScript page. The aspect ratio of the graph is still
-retained. The default is <I>0</I>. </DD>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets the horizontal padding for the
-left and right page borders. The borders are exterior to the plot. <I>Pad</I>
-can be a list of one or two screen distances. If <I>pad</I> has two elements,
-the left border is padded by the first distance and the right border by
-the second. If <I>pad</I> has just one distance, both the left and right borders
-are padded evenly. The default is <I>1i</I>. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets the vertical padding
-for the top and bottom page borders. The borders are exterior to the plot.
- <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I> has two elements,
-the top border is padded by the first distance and the bottom border by
-the second. If <I>pad</I> has just one distance, both the top and bottom borders
-are padded evenly. The default is <I>1i</I>. </DD>
-
-<DT><B>-paperheight <I>pixels</I></B> </DT>
-<DD>Sets the height
-of the postscript page. This can be used to select between different page
-sizes (letter, A4, etc). The default height is <I>11.0i</I>. </DD>
-
-<DT><B>-paperwidth <I>pixels</I></B> </DT>
-<DD>Sets
-the width of the postscript page. This can be used to select between different
-page sizes (letter, A4, etc). The default width is <I>8.5i</I>. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Sets
-the width of the plot. This lets you generate a plot of a width different
-from that of the widget. If <I>pixels</I> is 0, the width is the same as the widget's
-width. The default is <I>0</I>. </DD>
-</DL>
-<P>
-Postscript configuration options may be also be
-set by the <B>option</B> command. The resource name and class are <I>postscript</I> and
-<I>Postscript</I> respectively. <BR>
-<CODE>option add *Graph.postscript.Decorations false<BR>
-option add *Graph.Postscript.Landscape true<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>postscript output </B></I>?<I>fileName</I>? ?<I>option value</I>?... </DT>
-<DD>Outputs a file of
-encapsulated PostScript. If a <I>fileName</I> argument isn't present, the command
-returns the PostScript. If any <I>option-value</I> pairs are present, they set configuration
-options controlling how the PostScript is generated. <I>Option</I> and <I>value</I> can
-be anything accepted by the postscript <B>configure</B> operation above. </DD>
-</DL>
-
-<H3><A NAME="sect15" HREF="#toc15">Marker
-Components</A></H3>
-Markers are simple drawing procedures used to annotate or highlight
-areas of the graph. Markers have various types: text strings, bitmaps,
-images, connected lines, windows, or polygons. They can be associated with
-a particular element, so that when the element is hidden or un-hidden, so
-is the marker. By default, markers are the last items drawn, so that data
-elements will appear in behind them. You can change this by configuring
-the <B>-under</B> option. <P>
-Markers, in contrast to elements, don't affect the scaling
-of the coordinate axes. They can also have <I>elastic</I> coordinates (specified
-by <I>-Inf</I> and <I>Inf</I> respectively) that translate into the minimum or maximum
-limit of the axis. For example, you can place a marker so it always remains
-in the lower left corner of the plotting area, by using the coordinates
-<I>-Inf</I>,<I>-Inf</I>. <P>
-The following operations are available for markers.
-<DL>
-
-<DT><I>pathName <B>marker
-after <I>markerId</I></B></I> ?<I>afterId</I>? </DT>
-<DD>Changes the order of the markers, drawing the
-first marker after the second. If no second <I>afterId</I> argument is specified,
-the marker is placed at the end of the display list. This command can be
-used to control how markers are displayed since markers are drawn in the
-order of this display list. </DD>
-
-<DT><I>pathName <B>marker before <I>markerId</I></B></I> ?<I>beforeId</I>? </DT>
-<DD>Changes
-the order of the markers, drawing the first marker before the second. If
-no second <I>beforeId</I> argument is specified, the marker is placed at the beginning
-of the display list. This command can be used to control how markers are
-displayed since markers are drawn in the order of this display list. </DD>
-
-<DT><I>pathName
-<B>marker bind <I>tagName</I></B></I> ?<I>sequence</I>? ?<I>command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I>
-such that whenever the event sequence given by <I>sequence</I> occurs for a marker
-with this tag, <I>command</I> will be invoked. The syntax is similar to the <B>bind</B>
-command except that it operates on graph markers, rather than widgets.
-See the <B>bind</B> manual entry for complete details on <I>sequence</I> and the substitutions
-performed on <I>command</I> before invoking it. <P>
-If all arguments are specified
-then a new binding is created, replacing any existing binding for the
-same <I>sequence</I> and <I>tagName</I>. If the first character of <I>command</I> is <I>+</I> then <I>command</I>
- augments an existing binding rather than replacing it. If no <I>command</I> argument
-is provided then the command currently associated with <I>tagName</I> and <I>sequence</I>
-(it's an error occurs if there's no such binding) is returned. If both <I>command</I>
-and <I>sequence</I> are missing then a list of all the event sequences for which
-bindings have been defined for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>marker cget <I>option</I></B></I> </DT>
-<DD>Returns
-the current value of the marker configuration option given by <I>option</I>. <I>Option</I>
-may be any option described below in the <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>marker
-configure <I>markerId</I></B></I> ?<I>option value</I>?... </DT>
-<DD>Queries or modifies the configuration
-options for markers. If <I>option</I> isn't specified, a list describing the current
-options for <I>markerId</I> is returned. If <I>option</I> is specified, but not <I>value</I>,
-then a list describing <I>option</I> is returned. If one or more <I>option</I> and <I>value</I>
-pairs are specified, then for each pair, the marker option <I>option</I> is set
-to <I>value</I>. <P>
-The following options are valid for all markers. Each type of marker
-also has its own type-specific options. They are described in the sections
-below. <blockquote></DD>
-
-<DT><B>-bindtags <I>tagList</I></B> </DT>
-<DD>Specifies the binding tags for the marker. <I>TagList</I>
-is a list of binding tag names. The tags and their order will determine
-how events for markers are handled. Each tag in the list matching the
-current event sequence will have its Tcl command executed. Implicitly
-the name of the marker is always the first tag in the list. The default
-value is <I>all</I>. </DD>
-
-<DT><B>-coords <I>coordList</I></B> </DT>
-<DD>Specifies the coordinates of the marker.
-<I>CoordList</I> is a list of graph coordinates. The number of coordinates required
-is dependent on the type of marker. Text, image, and window markers need
-only two coordinates (an X-Y coordinate). Bitmap markers can take either
-two or four coordinates (if four, they represent the corners of the bitmap).
-Line markers need at least four coordinates, polygons at least six. If <I>coordList</I>
-is <I>""</I>, the marker will not be displayed. The default is <I>""</I>. </DD>
-
-<DT><B>-element <I>elemName</I></B>
-</DT>
-<DD>Links the marker with the element <I>elemName</I>. The marker is drawn only if
-the element is also currently displayed (see the element's <B>show</B> operation).
- If <I>elemName</I> is <I>""</I>, the marker is always drawn. The default is <I>""</I>. </DD>
-
-<DT><B>-hide
-<I>boolean</I></B> </DT>
-<DD>Indicates whether the marker is drawn. If <I>boolean</I> is true, the
-marker is not drawn. The default is <I>no</I>. </DD>
-
-<DT><B>-mapx <I>xAxis</I></B> </DT>
-<DD>Specifies the X-axis
-to map the marker's X-coordinates onto. <I>XAxis</I> must the name of an axis. The
-default is <I>x</I>. </DD>
-
-<DT><B>-mapy <I>yAxis</I></B> </DT>
-<DD>Specifies the Y-axis to map the marker's Y-coordinates
-onto. <I>YAxis</I> must the name of an axis. The default is <I>y</I>. </DD>
-
-<DT><B>-name <I>markerId</I></B> </DT>
-<DD>Changes
-the identifier for the marker. The identifier <I>markerId</I> can not already
-be used by another marker. If this option isn't specified, the marker's name
-is uniquely generated. </DD>
-
-<DT><B>-under <I>boolean</I></B> </DT>
-<DD>Indicates whether the marker is drawn
-below/above data elements. If <I>boolean</I> is true, the marker is be drawn underneath
-the data element symbols and lines. Otherwise, the marker is drawn on top
-of the element. The default is <I>0</I>. </DD>
-
-<DT><B>-xoffset <I>pixels</I></B> </DT>
-<DD>Specifies a screen distance
-to offset the marker horizontally. <I>Pixels</I> is a valid screen distance, such
-as <I>2</I> or <I>1.2i</I>. The default is <I>0</I>. </DD>
-
-<DT><B>-yoffset <I>pixels</I></B> </DT>
-<DD>Specifies a screen distance
-to offset the markers vertically. <I>Pixels</I> is a valid screen distance, such
-as <I>2</I> or <I>1.2i</I>. The default is <I>0</I>. </DD>
-</DL>
-<P>
-Marker configuration options may also be set
-by the <B>option</B> command. The resource class is either <I>BitmapMarker</I>, <I>ImageMarker</I>,
- <I>LineMarker</I>, <I>PolygonMarker</I>, <I>TextMarker</I>, or <I>WindowMarker</I>, depending on the
-type of marker. The resource name is the name of the marker. <BR>
-<CODE>option add *Graph.TextMarker.Foreground white<BR>
-option add *Graph.BitmapMarker.Foreground white<BR>
-option add *Graph.m1.Background blue<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>marker create <I>type</I></B></I> ?<I>option value</I>?... </DT>
-<DD>Creates a marker of the selected
-type. <I>Type</I> may be either <I>text</I>, <I>line</I>, <I>bitmap</I>, <I>image</I>, <I>polygon</I>, or <I>window</I>.
-This command returns the marker identifier, used as the <I>markerId</I> argument
-in the other marker-related commands. If the <B>-name</B> option is used, this overrides
-the normal marker identifier. If the name provided is already used for
-another marker, the new marker will replace the old. </DD>
-
-<DT><I>pathName <B>marker delete</B></I>
-?<I>name</I>?... </DT>
-<DD>Removes one of more markers. The graph will automatically be redrawn
-without the marker.. </DD>
-
-<DT><I>pathName <B>marker exists <I>markerId</I></B></I> </DT>
-<DD>Returns <I>1</I> if the
-marker <I>markerId</I> exists and <I>0</I> otherwise. </DD>
-
-<DT><I>pathName <B>marker names</B></I> ?<I>pattern</I>?
- </DT>
-<DD>Returns the names of all the markers that currently exist. If <I>pattern</I>
-is supplied, only those markers whose names match it will be returned. </DD>
-
-<DT><I>pathName
-<B>marker type <I>markerId</I></B></I> </DT>
-<DD>Returns the type of the marker given by <I>markerId</I>,
-such as <I>line</I> or <I>text</I>. If <I>markerId</I> is not a valid a marker identifier, <I>""</I>
-is returned. </DD>
-</DL>
-
-<H3><A NAME="sect16" HREF="#toc16">Bitmap Markers</A></H3>
-A bitmap marker displays a bitmap. The size of
-the bitmap is controlled by the number of coordinates specified. If two
-coordinates, they specify the position of the top-left corner of the bitmap.
- The bitmap retains its normal width and height. If four coordinates, the
-first and second pairs of coordinates represent the corners of the bitmap.
- The bitmap will be stretched or reduced as necessary to fit into the bounding
-rectangle. <P>
-Bitmap markers are created with the marker's <B>create</B> operation
-in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create bitmap </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration options
-for the marker. These same <I>option</I>-<I>value</I> pairs may be used with the marker's
-<B>configure</B> operation. <P>
-The following options are specific to bitmap markers:
-
-<DL>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Same as the <B>-fill</B> option. </DD>
-
-<DT><B>-bitmap <I>bitmap</I></B> </DT>
-<DD>Specifies the bitmap
-to be displayed. If <I>bitmap</I> is <I>""</I>, the marker will not be displayed. The
-default is <I>""</I>. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the background color of the bitmap. If <I>color</I>
-is the empty string, no background will be transparent. The default background
-color is <I>""</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Same as the <B>-outline</B> option. </DD>
-
-<DT><B>-mask <I>mask</I></B> </DT>
-<DD>Specifies
-a mask for the bitmap to be displayed. This mask is a bitmap itself, denoting
-the pixels that are transparent. If <I>mask</I> is <I>""</I>, all pixels of the bitmap
-will be drawn. The default is <I>""</I>. </DD>
-
-<DT><B>-outline <I>color</I></B> </DT>
-<DD>Sets the foreground color
-of the bitmap. The default value is <I>black</I>. </DD>
-
-<DT><B>-rotate <I>theta</I></B> </DT>
-<DD>Sets the rotation
-of the bitmap. <I>Theta</I> is a real number representing the angle of rotation
-in degrees. The marker is first rotated and then placed according to its
-anchor position. The default rotation is <I>0.0</I>. </DD>
-</DL>
-
-<H3><A NAME="sect17" HREF="#toc17">Image Markers</A></H3>
-A image marker
-displays an image. Image markers are created with the marker's <B>create</B> operation
-in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create image </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option for
-the marker. These same <I>option</I>-<I>value</I> pairs may be used with the marker's <B>configure</B>
-operation. <P>
-The following options are specific to image markers:
-<DL>
-
-<DT><B>-anchor <I>anchor</I></B>
-</DT>
-<DD><I>Anchor</I> tells how to position the image relative to the positioning point
-for the image. For example, if <I>anchor</I> is <I>center</I> then the image is centered
-on the point; if <I>anchor</I> is <I>n</I> then the image will be drawn such that the
-top center point of the rectangular region occupied by the image will be
-at the positioning point. This option defaults to <I>center</I>. </DD>
-
-<DT><B>-image <I>image</I></B> </DT>
-<DD>Specifies
-the image to be drawn. If <I>image</I> is <I>""</I>, the marker will not be drawn. The
-default is <I>""</I>. </DD>
-</DL>
-
-<H3><A NAME="sect18" HREF="#toc18">Line Markers</A></H3>
-A line marker displays one or more connected
-line segments. Line markers are created with marker's <B>create</B> operation in
-the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create line </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option for
-the marker. These same <I>option</I>-<I>value</I> pairs may be used with the marker's <B>configure</B>
-operation. <P>
-The following options are specific to line markers:
-<DL>
-
-<DT><B>-dashes <I>dashList</I></B>
-</DT>
-<DD>Sets the dash style of the line. <I>DashList</I> is a list of up to 11 numbers
-that alternately represent the lengths of the dashes and gaps on the line.
- Each number must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the marker line
-will be solid. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the background color of the line. This color
-is used with striped lines (see the <B>-fdashes</B> option). If <I>color</I> is the empty
-string, no background color is drawn (the line will be dashed, not striped).
- The default background color is <I>""</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width of
-the lines. The default width is <I>0</I>. </DD>
-
-<DT><B>-outline <I>color</I></B> </DT>
-<DD>Sets the foreground color
-of the line. The default value is <I>black</I>. </DD>
-
-<DT><B>-stipple <I>bitmap</I></B> </DT>
-<DD>Specifies a stipple
-pattern used to draw the line, rather than a solid line. <I>Bitmap</I> specifies
-a bitmap to use as the stipple pattern. If <I>bitmap</I> is <I>""</I>, then the line
-is drawn in a solid fashion. The default is <I>""</I>. </DD>
-</DL>
-
-<H3><A NAME="sect19" HREF="#toc19">Polygon Markers</A></H3>
-A polygon
-marker displays a closed region described as two or more connected line
-segments. It is assumed the first and last points are connected. Polygon
-markers are created using the marker <B>create</B> operation in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create polygon </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option for
-the marker. These same <I>option</I>-<I>value</I> pairs may be used with the <B>marker configure</B>
-command to change the marker's configuration. The following options are supported
-for polygon markers:
-<DL>
-
-<DT><B>-dashes <I>dashList</I></B> </DT>
-<DD>Sets the dash style of the outline
-of the polygon. <I>DashList</I> is a list of up to 11 numbers that alternately
-represent the lengths of the dashes and gaps on the outline. Each number
-must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the outline will be a solid
-line. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the fill color of the polygon. If <I>color</I> is <I>""</I>, then
-the interior of the polygon is transparent. The default is <I>white</I>. </DD>
-
-<DT><B>-linewidth
-<I>pixels</I></B> </DT>
-<DD>Sets the width of the outline of the polygon. If <I>pixels</I> is zero,
- no outline is drawn. The default is <I>0</I>. </DD>
-
-<DT><B>-outline <I>color</I></B> </DT>
-<DD>Sets the color of the
-outline of the polygon. If the polygon is stippled (see the <B>-stipple</B> option),
-then this represents the foreground color of the stipple. The default is
-<I>black</I>. </DD>
-
-<DT><B>-stipple <I>bitmap</I></B> </DT>
-<DD>Specifies that the polygon should be drawn with a
-stippled pattern rather than a solid color. <I>Bitmap</I> specifies a bitmap to
-use as the stipple pattern. If <I>bitmap</I> is <I>""</I>, then the polygon is filled
-with a solid color (if the <B>-fill</B> option is set). The default is <I>""</I>. </DD>
-</DL>
-
-<H3><A NAME="sect20" HREF="#toc20">Text
-Markers</A></H3>
-A text marker displays a string of characters on one or more lines
-of text. Embedded newlines cause line breaks. They may be used to annotate
-regions of the graph. Text markers are created with the <B>create</B> operation
-in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create text </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option
-for the text marker. These same <I>option</I>-<I>value</I> pairs may be used with the
- marker's <B>configure</B> operation. <P>
-The following options are specific to text
-markers:
-<DL>
-
-<DT><B>-anchor <I>anchor</I></B> </DT>
-<DD><I>Anchor</I> tells how to position the text relative to
-the positioning point for the text. For example, if <I>anchor</I> is <I>center</I> then
-the text is centered on the point; if <I>anchor</I> is <I>n</I> then the text will be
-drawn such that the top center point of the rectangular region occupied
-by the text will be at the positioning point. This default is <I>center</I>. </DD>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Same as the <B>-fill</B> option. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Specifies the font of the text.
- The default is <I>*-Helvetica-Bold-R-Normal-*-120-*</I>. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the background
-color of the text. If <I>color</I> is the empty string, no background will be
-transparent. The default background color is <I>""</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Same as
-the <B>-outline</B> option. </DD>
-
-<DT><B>-justify <I>justify</I></B> </DT>
-<DD>Specifies how the text should be justified.
- This matters only when the marker contains more than one line of text.
-<I>Justify</I> must be <I>left</I>, <I>right</I>, or <I>center</I>. The default is <I>center</I>. </DD>
-
-<DT><B>-outline <I>color</I></B>
-</DT>
-<DD>Sets the color of the text. The default value is <I>black</I>. </DD>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets the
-padding to the left and right exteriors of the text. <I>Pad</I> can be a list of
-one or two screen distances. If <I>pad</I> has two elements, the left side of
-the text is padded by the first distance and the right side by the second.
- If <I>pad</I> has just one distance, both the left and right sides are padded
-evenly. The default is <I>4</I>. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets the padding above and below the
-text. <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I> has two
-elements, the area above the text is padded by the first distance and the
-area below by the second. If <I>pad</I> is just one distance, both the top and
-bottom areas are padded evenly. The default is <I>4</I>. </DD>
-
-<DT><B>-rotate <I>theta</I></B> </DT>
-<DD>Specifies
-the number of degrees to rotate the text. <I>Theta</I> is a real number representing
-the angle of rotation. The marker is first rotated along its center and
-is then drawn according to its anchor position. The default is <I>0.0</I>. </DD>
-
-<DT><B>-text <I>text</I></B>
-</DT>
-<DD>Specifies the text of the marker. The exact way the text is displayed may
-be affected by other options such as <B>-anchor</B> or <B>-rotate</B>. </DD>
-</DL>
-
-<H3><A NAME="sect21" HREF="#toc21">Window Markers</A></H3>
-A window
-marker displays a widget at a given position. Window markers are created
-with the marker's <B>create</B> operation in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create window </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option for
-the marker. These same <I>option</I>-<I>value</I> pairs may be used with the marker's <B>configure</B>
-command. <P>
-The following options are specific to window markers:
-<DL>
-
-<DT><B>-anchor <I>anchor</I></B>
-</DT>
-<DD><I>Anchor</I> tells how to position the widget relative to the positioning point
-for the widget. For example, if <I>anchor</I> is <I>center</I> then the widget is centered
-on the point; if <I>anchor</I> is <I>n</I> then the widget will be displayed such that
-the top center point of the rectangular region occupied by the widget will
-be at the positioning point. This option defaults to <I>center</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B>
-</DT>
-<DD>Specifies the height to assign to the marker's window. If this option isn't
-specified, or if it is specified as <I>""</I>, then the window is given whatever
-height the widget requests internally. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Specifies the width
-to assign to the marker's window. If this option isn't specified, or if it
-is specified as <I>""</I>, then the window is given whatever width the widget
-requests internally. </DD>
-
-<DT><B>-window <I>pathName</I></B> </DT>
-<DD>Specifies the widget to be managed
-by the graph. <I>PathName</I> must be a child of the <B>graph</B> widget. </DD>
-</DL>
-
-<H2><A NAME="sect22" HREF="#toc22">Graph Component
-Bindings</A></H2>
-Specific graph components, such as elements, markers and legend
-entries, can have a command trigger when event occurs in them, much like
-canvas items in Tk's canvas widget. Not all event sequences are valid. The
-only binding events that may be specified are those related to the mouse
-and keyboard (such as <B>Enter</B>, <B>Leave</B>, <B>ButtonPress</B>, <B>Motion</B>, and <B>KeyPress</B>).
-<P>
-Only one element or marker can be picked during an event. This means, that
-if the mouse is directly over both an element and a marker, only the uppermost
-component is selected. This isn't true for legend entries. Both a legend
-entry and an element (or marker) binding commands will be invoked if both
-items are picked. <P>
-It is possible for multiple bindings to match a particular
-event. This could occur, for example, if one binding is associated with
-the element name and another is associated with one of the element's tags
-(see the <B>-bindtags</B> option). When this occurs, all of the matching bindings
-are invoked. A binding associated with the element name is invoked first,
-followed by one binding for each of the element's bindtags. If there are
-multiple matching bindings for a single tag, then only the most specific
-binding is invoked. A continue command in a binding script terminates
-that script, and a break command terminates that script and skips any
-remaining scripts for the event, just as for the bind command. <P>
-The <B>-bindtags</B>
-option for these components controls addition tag names which can be matched.
- Implicitly elements and markers always have tags matching their names.
- Setting the value of the <B>-bindtags</B> option doesn't change this.
-<H2><A NAME="sect23" HREF="#toc23">C Language
-API</A></H2>
-You can manipulate data elements from the C language. There may be situations
-where it is too expensive to translate the data values from ASCII strings.
- Or you might want to read data in a special file format. <P>
-Data can manipulated
-from the C language using BLT vectors. You specify the X-Y data coordinates
-of an element as vectors and manipulate the vector from C. The graph will
-be redrawn automatically after the vectors are updated. <P>
-From Tcl, create
-the vectors and configure the element to use them. <BR>
-<CODE>vector X Y<BR>
-.g element configure line1 -xdata X -ydata Y<BR>
-</CODE><P>To set data points from C, you pass the values as arrays of doubles using
-the <B>Blt_ResetVector</B> call. The vector is reset with the new data and at
-the next idle point (when Tk re-enters its event loop), the graph will be
-redrawn automatically. <BR>
-<CODE>#include <tcl.h><BR>
-#include <blt.h><BR>
-<P>
-register int i;<BR>
-Blt_Vector *xVec, *yVec;<BR>
-double x[50], y[50];<BR>
-<P>
-/* Get the BLT vectors "X" and "Y" (created above from Tcl) */<BR>
-if ((Blt_GetVector(interp, "X", &xVec) != TCL_OK) ||<BR>
- (Blt_GetVector(interp, "Y", &yVec) != TCL_OK)) {<BR>
- return TCL_ERROR;<BR>
-}<BR>
-<P>
-for (i = 0; i < 50; i++) {<BR>
- x[i] = i * 0.02;<BR>
- y[i] = sin(x[i]);<BR>
-}<tt> </tt> <tt> </tt> <BR>
-<P>
-/* Put the data into BLT vectors */<BR>
-if ((Blt_ResetVector(xVec, x, 50, 50, TCL_VOLATILE) != TCL_OK) ||<BR>
- (Blt_ResetVector(yVec, y, 50, 50, TCL_VOLATILE) != TCL_OK)) {<BR>
- return TCL_ERROR;<BR>
-}<BR>
-</CODE><P>See the <B>vector</B> manual page for more details.
-<H2><A NAME="sect24" HREF="#toc24">Speed Tips</A></H2>
-There may be cases
-where the graph needs to be drawn and updated as quickly as possible. If
-drawing speed becomes a big problem, here are a few tips to speed up displays.
-
-<UL>
-·<LI>Try to minimize the number of data points. The more data points the looked
-at, the more work the graph must do. </LI>·<LI>If your data is generated as floating
-point values, the time required to convert the data values to and from
-ASCII strings can be significant, especially when there any many data points.
- You can avoid the redundant string-to-decimal conversions using the C API
-to BLT vectors. </LI>·<LI>Data elements without symbols are drawn faster than with
-symbols. Set the data element's <B>-symbol</B> option to <I>none</I>. If you need to draw
-symbols, try using the simple symbols such as <I>splus</I> and <I>scross</I>. </LI>·<LI>Don't stipple
-or dash the element. Solid lines are much faster. </LI>·<LI>If you update data elements
-frequently, try turning off the widget's <B>-bufferelements</B> option. When the
-graph is first displayed, it draws data elements into an internal pixmap.
- The pixmap acts as a cache, so that when the graph needs to be redrawn
-again, and the data elements or coordinate axes haven't changed, the pixmap
-is simply copied to the screen. This is especially useful when you are
-using markers to highlight points and regions on the graph. But if the
-graph is updated frequently, changing either the element data or coordinate
-axes, the buffering becomes redundant. </LI>
-</UL>
-
-<H2><A NAME="sect25" HREF="#toc25">Limitations</A></H2>
-Auto-scale routines do
-not use requested min/max limits as boundaries when the axis is logarithmically
-scaled. <P>
-The PostScript output generated for polygons with more than 1500
-points may exceed the limits of some printers (See PostScript Language
-Reference Manual, page 568). The work-around is to break the polygon into
-separate pieces.
-<H2><A NAME="sect26" HREF="#toc26">Keywords</A></H2>
-graph, widget <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Syntax</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Example</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Graph Operations</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Graph Components</A></LI>
-<UL>
-<LI><A NAME="toc8" HREF="#sect8">Axis Components</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">Crosshairs Component</A></LI>
-<LI><A NAME="toc10" HREF="#sect10">Element Components</A></LI>
-<LI><A NAME="toc11" HREF="#sect11">Grid Component</A></LI>
-<LI><A NAME="toc12" HREF="#sect12">Legend Component</A></LI>
-<LI><A NAME="toc13" HREF="#sect13">Pen Components</A></LI>
-<LI><A NAME="toc14" HREF="#sect14">PostScript Component</A></LI>
-<LI><A NAME="toc15" HREF="#sect15">Marker Components</A></LI>
-<LI><A NAME="toc16" HREF="#sect16">Bitmap Markers</A></LI>
-<LI><A NAME="toc17" HREF="#sect17">Image Markers</A></LI>
-<LI><A NAME="toc18" HREF="#sect18">Line Markers</A></LI>
-<LI><A NAME="toc19" HREF="#sect19">Polygon Markers</A></LI>
-<LI><A NAME="toc20" HREF="#sect20">Text Markers</A></LI>
-<LI><A NAME="toc21" HREF="#sect21">Window Markers</A></LI>
-</UL>
-<LI><A NAME="toc22" HREF="#sect22">Graph Component Bindings</A></LI>
-<LI><A NAME="toc23" HREF="#sect23">C Language API</A></LI>
-<LI><A NAME="toc24" HREF="#sect24">Speed Tips</A></LI>
-<LI><A NAME="toc25" HREF="#sect25">Limitations</A></LI>
-<LI><A NAME="toc26" HREF="#sect26">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/hierbox.html b/blt3.0.1/html/hierbox.html
deleted file mode 100644
index 7f56d0e..0000000
--- a/blt3.0.1/html/hierbox.html
+++ /dev/null
@@ -1,2331 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>treeview(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-treeview - Create and manipulate hierarchical
-table widgets
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>treeview</B> <I>pathName </I>?<I>options</I>?
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>treeview</B>
-widget displays a tree of data. It replaces both the <B>hiertable</B> and <B>hierbox</B>
-widgets. The <B>treeview</B> is 100% syntax compatible with the <B>hiertable</B> widget.
- The <B>hiertable</B> command is retained for sake of script-level compatibility.
- This widget obsoletes the <B>hierbox</B> widget. It does everything the old <B>hierbox</B>
-widget did, but also provides data sharing (via <I>tree data objects</I>) and
-the ability to tag nodes.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-The <B>treeview</B> widget displays hierarchical
-data. Data is represented as nodes in a general-ordered tree. Each node
-may have sub-nodes and these nodes can in turn has their own children. <P>
-A
-node is displayed as a row entry in the widget. Each entry has a text label
-and icon. When a node has children, its entry is drawn with a small button
-to the left of the label. Clicking the mouse over this button opens or
-closes the node. When a node is <I>open</I>, its children are exposed. When it
-is <I>closed</I>, the children and their descedants are hidden. The button is
-normally a <I>+</I> or <I>-</I> symbol (ala Windows Explorer), but can be replaced with
-a pair of Tk images (open and closed images). <P>
-If the node has data associated
-with it, they can be displayed in columns running vertically on either
-side the tree. You can control the color, font, etc of each entry. Any
-entry label or data field can be edited in-place.
-<H2><A NAME="sect4" HREF="#toc4">Tree Data Object</A></H2>
-The tree
-is not stored inside the widget but in a tree data object (see the <B>tree</B>
-command for a further explanation). Tree data objects can be shared among
-different clients, such as a <B>treeview</B> widget or the <B>tree</B> command. You can
-walk the tree and manage its data with the <B>tree</B> command tree, while displaying
-it with the <B>treeview</B> widget. Whenever the tree is updated, the <B>treeview</B>
-widget is automatically redrawn. <P>
-By default, the <B>treeview</B> widget creates
-its own tree object. The tree initially contains just a root node. But you
-can also display trees created by the <B>tree</B> command using the <B>-tree</B> configuration
-option. <B>Treeview</B> widgets can share the same tree object, possibly displaying
-different views of the same data. <P>
-A tree object has both a Tcl and C API.
- You can insert or delete nodes using <B>treeview</B> widget or <B>tree</B> command operations,
-but also from C code. For example, you can load the tree from your C code
-while still managing and displaying the tree from Tcl. The widget is automatically
-notified whenever the tree is modified via C or Tcl.
-<H2><A NAME="sect5" HREF="#toc5">Syntax</A></H2>
-<BR>
-<P>
-<CODE><B>treeview <I>pathName </I></B>?<I>option value</I>?...<BR>
-</CODE><P>The <B>treeview</B> command creates a new window <I>pathName</I> and makes it into a
-<B>treeview</B> widget. At the time this command is invoked, there must not exist
-a window named <I>pathName</I>, but <I>pathName</I>'s parent must exist. Additional options
-may be specified on the command line or in the option database to configure
-aspects of the widget such as its colors and font. See the <B>configure</B> operation
-below for the exact details about what <I>option</I> and <I>value</I> pairs are valid.
-<P>
-If successful, <B>treeview</B> returns the path name of the widget. It also creates
-a new Tcl command by the same name. You can use this command to invoke
-various operations that query or modify the widget. The general form is:
-<BR>
-<P>
-<CODE><I>pathName <I>operation</I></I> ?<I>arg</I>?...<BR>
-</CODE><P>Both <I>operation</I> and its arguments determine the exact behavior of the command.
- The operations available are described in the <FONT SIZE=-1><B>TREEVIEW OPERATIONS</B></FONT>
- section.
-
-<H2><A NAME="sect6" HREF="#toc6">IDs and Tags</A></H2>
-Nodes can be inserted into a tree using the <B>treeview</B> widget
- <BR>
-<CODE>blt::treeview .t<BR>
-set node [.t insert end root "one"]<BR>
-</CODE><P>or <B>tree</B> command. <BR>
-<CODE>set tree [blt::tree create]<BR>
-set node [$tree insert root "one"]<BR>
-</CODE><P>In both cases, a number identifying the node is returned (the value of
-<I>$node</I>). This serial number or <I>id</I> uniquely identifies the node. Please note
-that you can't infer a location or position of a node from its id. The only
-exception is that the root node is always id <I>0</I>. Since nodes may have the
-same labels or be moved within the tree, ids provide an convenient way
-to identify nodes. If a tree is shared, the ids will be the same regardless
-if you are using by the <B>treeview</B> widget or the <B>tree</B> command. Ids are recycled
-when the node deleted. <P>
-A node may also have any number of <I>tags</I> associated
-with it. A tag is just a string of characters, and it may take any form
-except that of an integer. For example, "<I>x123</I>" is valid, but "<I>123</I>" isn't.
- The same tag may be associated with many different nodes. This is typically
-done to associate a group of nodes. Many operations in the <B>treeview</B> widget
-take either node ids or tag names as arguments. Using a tag says to apply
-the operation to all nodes with that tag. <P>
-The tag <B>all</B> is implicitly associated
-with every node in the tree. It may be used to invoke operations on all
-the nodes in the tree. <P>
-Tags may be shared, just like trees, between clients.
- For example, you can use the tags created by the <B>tree</B> command with <B>treeview</B>
-widgets.
-<H2><A NAME="sect7" HREF="#toc7">Special Node IDs</A></H2>
-There are also several special non-numeric ids.
-Special ids differ from tags in that they are always translated to their
-numeric equivalent. They also take precedence over tags. For example, you
-can't use a tag name that is a special id. These ids are specific to the
-<B>treeview</B> widget.
-<DL>
-
-<DT><B>active</B> </DT>
-<DD>The node where the mouse pointer is currently located.
-When a node is active, it is drawn using its active icon (see the <B>-activeicon</B>
-option). The <B>active</B> id is changed automatically by moving the mouse pointer
-over another node or by using the <B>entry activate</B> operation. Note that there
-can be only one active node at a time. </DD>
-
-<DT><B>anchor</B> </DT>
-<DD>The node representing the
-fixed end of the current selection. The anchor is set by the <B>selection
-anchor</B> operation. </DD>
-
-<DT><B>current</B> </DT>
-<DD>The node where the mouse pointer is currently
-located. But unlike <B>active</B>, this id changes while the selection is dragged.
- It is used to determine the current node during button drags. </DD>
-
-<DT><B>down</B> </DT>
-<DD>The
-next open node from the current focus. The <B>down</B> of the last open node is
-the same. </DD>
-
-<DT><B>end</B> </DT>
-<DD>The last open node (in depth-first order) on the tree. </DD>
-
-<DT><B>focus</B>
-</DT>
-<DD>The node that currently has focus. When a node has focus, it receives key
-events. To indicate focus, the node is drawn with a dotted line around
-its label. You can change the focus using the <B>focus</B> operation. </DD>
-
-<DT><B>last</B> </DT>
-<DD>The
-last open node from the current focus. But unlike <B>up</B>, when the focus is
-at root, <B>last</B> wraps around to the last open node in the tree. </DD>
-
-<DT><B>mark</B> </DT>
-<DD>The node
-representing the non-fixed end of the current selection. The mark is set
-by the <B>selection mark</B> operation. </DD>
-
-<DT><B>next</B> </DT>
-<DD>The next open node from the current
-focus. But unlike <B>down</B>, when the focus is on last open node, <B>next</B> wraps
-around to the root node. </DD>
-
-<DT><B>nextsibling</B> </DT>
-<DD>The next sibling from the node with
-the current focus. If the node is already the last sibling then it is the
-<B>nextsibling<B>. </DD>
-
-<DT><B>parent</B></B></B> </DT>
-<DD>The parent of the node with the current focus. The <B>parent</B>
-of the root is also the root. </DD>
-
-<DT><B>prevsibling</B> </DT>
-<DD>The previous sibling from the
-node with the current focus. If the node is already the first sibling then
-it is the <B>prevsibling<B>. </DD>
-
-<DT><B>root</B></B></B> </DT>
-<DD>The root node. You can also use id <I>0</I> to indicate
-the root. </DD>
-
-<DT><B>up</B> </DT>
-<DD>The last open node (in depth-first order) from the current focus.
-The <B>up</B> of the root node (i.e. the root has focus) is also the root. </DD>
-
-<DT><B>view.top</B>
-</DT>
-<DD>First node that's current visible in the widget. </DD>
-
-<DT><B>view.bottom</B> </DT>
-<DD>Last node that's
-current visible in the widget. </DD>
-
-<DT><I>path</I> </DT>
-<DD>Absolute path of a node. Path names
-refer to the node name, not their entry labels. Paths don't have to start
-with a separator (see the <B>-separator</B> configuration option), but component
-names must be separated by the designated separator. </DD>
-
-<DT><B>@<I>x<B>,<I>y</I></B></I></B> </DT>
-<DD>Indicates the
-node that covers the point in the treeview window specified by <I>x</I> and <I>y</I>
-(in pixel coordinates). If no part of the entryd covers that point, then
-the closest node to that point is used. </DD>
-</DL>
-<P>
-A node may be specified as an id
-or tag. If the specifier is an integer then it is assumed to refer to the
-single node with that id. If the specifier is not an integer, it's checked
-to see if it's a special id (such as focus). Otherwise, it's assumed to be
-tag. Some operations only operate on a single node at a time; if a tag
-refers to more than one node, then an error is generated.
-<H2><A NAME="sect8" HREF="#toc8">Data Fields</A></H2>
-A node
-in the tree can have <I>data fields</I>. A data field is a name-value pair, used
-to represent arbitrary data in the node. Nodes can contain different fields
-(they aren't required to contain the same fields). You can optionally display
-these fields in the <B>treeview</B> widget in columns running on either side of
-the displayed tree. A node's value for the field is drawn in the column
-along side its node in the hierarchy. Any node that doesn't have a specific
-field is left blank. Columns can be interactively resized, hidden, or,
-moved.
-<H2><A NAME="sect9" HREF="#toc9">Entry Bindings</A></H2>
-You can bind Tcl commands to be invoked when events
-occur on nodes (much like Tk canvas items). You can bind a node using its
-id or its <I>bindtags</I>. Bindtags are simply names that associate a binding
-with one or more nodes. There is a built-in tag <I>all</I> that all node entries
-automatically have.
-<H2><A NAME="sect10" HREF="#toc10">Treeview Operations</A></H2>
-The <B>treeview</B> operations are the invoked
-by specifying the widget's pathname, the operation, and any arguments that
-pertain to that operation. The general form is: <P>
-<BR>
-<CODE><I>pathName operation </I>?<I>arg arg ...</I>?<BR>
-<P>
-</CODE><P><I>Operation</I> and the <I>arg</I>s determine the exact behavior of the command. The
-following operation are available for <B>treeview</B> widgets:
-<DL>
-
-<DT><I>pathName <B>bbox</B></I> ?<B>-screen</B>?
-<I>tagOrId...</I> </DT>
-<DD>Returns a list of 4 numbers, representing a bounding box of around
-the specified entries. The entries is given by one or more <I>tagOrId</I> arguments.
- If the <B>-screen</B> flag is given, then the x-y coordinates of the bounding
-box are returned as screen coordinates, not virtual coordinates. Virtual
-coordinates start from <I>0</I> from the root node. The returned list contains
-the following values. <blockquote></DD>
-
-<DT><I>x</I> </DT>
-<DD>X-coordinate of the upper-left corner of the bounding
-box. </DD>
-
-<DT><I>y</I> </DT>
-<DD>Y-coordinate of the upper-left corner of the bounding box. </DD>
-
-<DT><I>width</I> </DT>
-<DD>Width
-of the bounding box. </DD>
-
-<DT><I>height</I> </DT>
-<DD>Height of the bounding box. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>bind</B></I> <I>tagName</I>
-?<I>sequence command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I> such that whenever the
-event sequence given by <I>sequence</I> occurs for a node with this tag, <I>command</I>
-will be invoked. The syntax is similar to the <B>bind</B> command except that
-it operates on <B>treeview</B> entries, rather than widgets. See the <B>bind</B> manual
-entry for complete details on <I>sequence</I> and the substitutions performed
-on <I>command</I> before invoking it. <P>
-If all arguments are specified then a
-new binding is created, replacing any existing binding for the same <I>sequence</I>
-and <I>tagName</I>. If the first character of <I>command</I> is <I>+</I> then <I>command</I> augments
-an existing binding rather than replacing it. If no <I>command</I> argument is
-provided then the command currently associated with <I>tagName</I> and <I>sequence</I>
-(it's an error occurs if there's no such binding) is returned. If both <I>command</I>
-and <I>sequence</I> are missing then a list of all the event sequences for which
-bindings have been defined for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>button <I>operation</I></B></I> ?<I>args</I>?
-</DT>
-<DD>This command is used to control the button selectors within a <B>treeview</B>
-widget. It has several forms, depending on <I>operation</I>: <blockquote></DD>
-
-<DT><I>pathName <B>button
-activate</B></I> <I>tagOrId</I> </DT>
-<DD>Designates the node given by <I>tagOrId</I> as active. When
-a node is active it's entry is drawn using its active icon (see the <B>-activeicon</B>
-option). Note that there can be only one active entry at a time. The special
-id <B>active</B> indicates the currently active node. </DD>
-
-<DT><I>pathName <B>button bind</B></I> <I>tagName</I>
-?<I>sequence command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I> such that whenever the
-event sequence given by <I>sequence</I> occurs for an button of a node entry with
-this tag, <I>command</I> will be invoked. The syntax is similar to the <B>bind</B> command
-except that it operates on <B>treeview</B> buttons, rather than widgets. See the
-<B>bind</B> manual entry for complete details on <I>sequence</I> and the substitutions
-performed on <I>command</I> before invoking it. <P>
-If all arguments are specified
-then a new binding is created, replacing any existing binding for the
-same <I>sequence</I> and <I>tagName</I>. If the first character of <I>command</I> is <I>+</I> then <I>command</I>
- augments an existing binding rather than replacing it. If no <I>command</I> argument
-is provided then the command currently associated with <I>tagName</I> and <I>sequence</I>
-(it's an error occurs if there's no such binding) is returned. If both <I>command</I>
-and <I>sequence</I> are missing then a list of all the event sequences for which
-bindings have been defined for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>button cget</B></I> <I>option</I> </DT>
-<DD>Returns
-the current value of the configuration option given by <I>option</I>. <I>Option</I> may
-have any of the values accepted by the <B>configure</B> operation described below.
-</DD>
-
-<DT><I>pathName <B>button configure</B></I> ?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify
-the configuration options of the widget. If no <I>option</I> is specified, returns
-a list describing all of the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B>
-for information on the format of this list). If <I>option</I> is specified with
-no <I>value</I>, then the command returns a list describing the one named option
-(this list will be identical to the corresponding sublist of the value
-returned if no <I>option</I> is specified). If one or more <I>option-value</I> pairs are
-specified, then the command modifies the given widget option(s) to have
-the given value(s); in this case the command returns an empty string. <I>Option</I>
-and <I>value</I> are described in the section <FONT SIZE=-1><B>BUTTON OPTIONS</B></FONT>
- below. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>cget</B></I> <I>option</I> </DT>
-<DD>Returns the current value of the configuration option given
-by <I>option</I>. <I>Option</I> may have any of the values accepted by the <B>configure</B> operation
-described below. </DD>
-
-<DT><I>pathName <B>close </B></I>?<B>-recurse</B>? <I>tagOrId...</I> </DT>
-<DD>Closes the node specified
-by <I>tagOrId</I>. In addition, if a Tcl script was specified by the <B>-closecommand</B>
-option, it is invoked. If the node is already closed, this command has
-no effect. If the <B>-recurse</B> flag is present, each child node is recursively
-closed. </DD>
-
-<DT><I>pathName <B>column <I>operation</I></B></I> ?<I>args</I>? </DT>
-<DD>The following operations are available
-for treeview columns. <blockquote></DD>
-
-<DT><I>pathName <B>column activate</B></I> <I>column</I> </DT>
-<DD>Sets the active column
-to <I>column</I>. <I>Column</I> is the name of a column in the widget. When a column is
-active, it's drawn using its <B>-activetitlebackground</B> and <B>-activetitleforeground</B>
-options. If <I>column</I> is the <I>""</I>, then no column will be active. If no column
-argument is provided, then the name of the currently active column is returned.
-</DD>
-
-<DT><I>pathName <B>column cget</B></I> <I>name</I> <I>option</I> </DT>
-<DD>Returns the current value of the column
-configuration option given by <I>option</I> for <I>name</I>. <I>Name</I> is the name of column
-that corresponds to a data field. <I>Option</I> may have any of the values accepted
-by the <B>configure</B> operation described below. </DD>
-
-<DT><I>pathName <B>column configure</B></I> <I>name</I>
-?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify the configuration options
-of the column designated by <I>name</I>. <I>Name</I> is the name of the column corresponding
-to a data field. If no <I>option</I> is specified, returns a list describing all
-of the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for information
-on the format of this list). If <I>option</I> is specified with no <I>value</I>, then
-the command returns a list describing the one named option (this list will
-be identical to the corresponding sublist of the value returned if no <I>option</I>
-is specified). If one or more <I>option-value</I> pairs are specified, then the
-command modifies the given widget option(s) to have the given value(s);
- in this case the command returns an empty string. <I>Option</I> and <I>value</I> are
-described in the section <FONT SIZE=-1><B>COLUMN OPTIONS</B></FONT>
- below. </DD>
-
-<DT><I>pathName <B>column delete</B></I> <I>field</I>
-?<I>field</I>...? </DT>
-<DD>Deletes one of more columns designated by <I>field</I>. Note that this
-does not delete the data fields themselves. </DD>
-
-<DT><I>pathName <B>column insert</B></I> <I>position</I>
-<I>field</I> ?<I>options</I>...? </DT>
-<DD>Inserts one of more columns designated by <I>field</I>. A column
-displays each node's data field by the same name. If the node doesn't have
-the given field, the cell is left blank. <I>Position</I> indicates where in the
-list of columns to add the new column. It may be either a number or <I>end</I>.
- </DD>
-
-<DT><I>pathName <B>column invoke</B></I> <I>field</I> </DT>
-<DD>Invokes the Tcl command associated with the
-column <I>field</I>, if there is one (using the column's <B>-command</B> option). The
-command is ignored if the column's <B>-state</B> option set to <I>disabled</I>. </DD>
-
-<DT><I>pathName
-<B>column move <I>name</I></B></I> <I>dest</I> </DT>
-<DD>Moves the column <I>name</I> to the destination position.
- <I>Dest</I> is the name of another column or a screen position in the form <I>@<I>x<I>,<I>y</I></I></I></I>.
-</DD>
-
-<DT><I>pathName <B>column names</B></I> </DT>
-<DD>Returns a list of the names of all columns in the
-widget. The list is ordered as the columns are drawn from left-to-right. </DD>
-
-<DT><I>pathName
-<B>column nearest</B></I> <I>x</I> ?<I>y</I>? </DT>
-<DD>Returns the name of the column closest to the given
-X-Y screen coordinate. If you provide a <I>y</I> argument (it's optional), a name
-is returned only when if the point is over a column's title. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>configure</B></I>
-?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify the configuration options
-of the widget. If no <I>option</I> is specified, returns a list describing all
-of the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for information
-on the format of this list). If <I>option</I> is specified with no <I>value</I>, then
-the command returns a list describing the one named option (this list will
-be identical to the corresponding sublist of the value returned if no <I>option</I>
-is specified). If one or more <I>option-value</I> pairs are specified, then the
-command modifies the given widget option(s) to have the given value(s);
- in this case the command returns an empty string. <I>Option</I> and <I>value</I> are
-described in the section <FONT SIZE=-1><B>TREEVIEW OPTIONS</B></FONT>
- below. </DD>
-
-<DT><I>pathName <B>curselection</B></I>
-</DT>
-<DD>Returns a list containing the ids of all of the entries that are currently
-selected. If there are no entries selected, then the empty string is returned.
-</DD>
-
-<DT><I>pathName <B>delete <I>tagOrId</I></B></I>... </DT>
-<DD>Deletes one or more entries given by <I>tagOrId</I> and
-its children. </DD>
-
-<DT><I>pathName <B>entry <I>operation</I></B></I> ?<I>args</I>? </DT>
-<DD>The following operations are
-available for treeview entries. <blockquote></DD>
-
-<DT><I>pathName <B>entry activate</B></I> <I>tagOrId</I> </DT>
-<DD>Sets the
-active entry to the one specified by <I>tagOrId</I>. When an entry is active
-it is drawn using its active icon (see the <B>-activeicon</B> option). Note that
-there can be only one active node at a time. The special id of the currently
-active node is <B>active</B>. </DD>
-
-<DT><I>pathName <B>entry cget</B></I> <I>option</I> </DT>
-<DD>Returns the current value
-of the configuration option given by <I>option</I>. <I>Option</I> may have any of the
-values accepted by the <B>configure</B> operation described below. </DD>
-
-<DT><I>pathName <B>entry
-children</B></I> <I>tagOrId</I> ?<I>first</I>? ?<I>last</I>? </DT>
-<DD>Returns a list of ids for the given range
-of children of <I>tagOrId</I>. <I>TagOrId</I> is the id or tag of the node to be examined.
-If only a <I>first</I> argument is present, then the id of the that child at
-that numeric position is returned. If both <I>first</I> and <I>last</I> arguments are
-given, then the ids of all the children in that range are returned. Otherwise
-the ids of all children are returned. </DD>
-
-<DT><I>pathName <B>entry configure</B></I> ?<I>option</I>?
-?<I>value option value ...</I>? </DT>
-<DD>Query or modify the configuration options of the
-widget. If no <I>option</I> is specified, returns a list describing all of the
-available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for information on
-the format of this list). If <I>option</I> is specified with no <I>value</I>, then the
-command returns a list describing the one named option (this list will
-be identical to the corresponding sublist of the value returned if no <I>option</I>
-is specified). If one or more <I>option-value</I> pairs are specified, then the
-command modifies the given widget option(s) to have the given value(s);
- in this case the command returns an empty string. <I>Option</I> and <I>value</I> are
-described below: </DD>
-
-<DT><I>pathName <B>entry delete</B></I> <I>tagOrId</I> ?<I>first</I> ?<I>last</I>? </DT>
-<DD>Deletes the
-one or more children nodes of the parent <I>tagOrId</I>. If <I>first</I> and <I>last</I> arguments
-are present, they are positions designating a range of children nodes to
-be deleted. </DD>
-
-<DT><I>pathName <B>entry isbefore <I>tagOrId1</I></B></I> <I>tagOrId2</I> </DT>
-<DD>Returns 1 if <I>tagOrId1</I>
-is before <I>tagOrId2</I> and 0 otherwise. </DD>
-
-<DT><I>pathName <B>entry ishidden <I>tagOrId</I></B></I> </DT>
-<DD>Returns
-1 if the node is currently hidden and 0 otherwise. A node is also hidden
-if any of its ancestor nodes are closed or hidden. </DD>
-
-<DT><I>pathName <B>entry isopen
-<I>tagOrId</I></B></I> </DT>
-<DD>Returns 1 if the node is currently open and 0 otherwise. </DD>
-
-<DT><I>pathName
-<B>entry size</B></I> <B>-recurse</B> <I>tagOrId</I> </DT>
-<DD>Returns the number of children for parent node
-<I>tagOrId</I>. If the <B>-recurse</B> flag is set, the number of all its descendants
-is returned. The node itself is not counted. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>find </B></I>?<I>flags</I>? <I>first</I>
-<I>last</I> </DT>
-<DD>Finds for all entries matching the criteria given by <I>flags</I>. A list
-of ids for all matching nodes is returned. <I>First</I> and <I>last</I> are ids designating
-the range of the search in depth-first order. If <I>last</I> is before <I>first</I>, then
-nodes are searched in reverse order. The valid flags are: <blockquote></DD>
-
-<DT><B>-name<I> pattern</I></B>
-</DT>
-<DD>Specifies pattern to match against node names. </DD>
-
-<DT><B>-full<I> pattern</I></B> </DT>
-<DD>Specifies pattern
-to match against node pathnames. </DD>
-
-<DT><B>-<I>option<I> pattern</I></I></B> </DT>
-<DD>Specifies pattern to match
-against the node entry's configuration option. </DD>
-
-<DT><B>-exact</B> </DT>
-<DD>Patterns must match
-exactly. The is the default. </DD>
-
-<DT><B>-glob</B> </DT>
-<DD>Use global pattern matching. Matching
-is done in a fashion similar to that used by the C-shell. For the two
-strings to match, their contents must be identical except that the following
- special sequences may appear in pattern: <blockquote></DD>
-
-<DT><I>*</I> </DT>
-<DD>Matches any sequence of
- characters in string, including a null string. </DD>
-
-<DT><I>?</I> </DT>
-<DD>Matches any single character
-in string. </DD>
-
-<DT><I>[<I>chars<I>]</I></I></I> </DT>
-<DD>Matches any character in the set given by <I>chars</I>. If a
-sequence of the form <I>x</I>-<I>y</I> appears in <I>chars</I>, then any character between <I>x</I>
-and <I>y</I>, inclusive, will match. </DD>
-
-<DT><I>\<I>x</I></I> </DT>
-<DD>Matches the single character <I>x</I>. This
-provides a way of avoiding the special interpretation of the characters
-<I>*?[]\</I> in the pattern. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-regexp</B> </DT>
-<DD>Use regular expression pattern matching (i.e.
-the same as implemented by the <B>regexp</B> command). </DD>
-
-<DT><B>-nonmatching</B> </DT>
-<DD>Pick entries
-that don't match. </DD>
-
-<DT><B>-exec<I> string</I></B> </DT>
-<DD>Specifies a Tcl script to be invoked for
-each matching node. Percent substitutions are performed on <I>string</I> before
- it is executed. The following substitutions are valid: <blockquote></DD>
-
-<DT><I>%W</I> </DT>
-<DD>The pathname
-of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The full pathname of the node.
-</DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single percent. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-count<I> number</I></B> </DT>
-<DD>Stop
-searching after <I>number</I> matches. </DD>
-
-<DT><B>--</B> </DT>
-<DD>Indicates the end of flags. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>focus
-</B></I> <I>tagOrId</I> </DT>
-<DD>Sets the focus to the node given by <I>tagOrId</I>. When a node has focus,
-it can receive keyboard events. The special id <B>focus</B> designates the node
-that currently has focus. </DD>
-
-<DT><I>pathName <B>get </B></I>?<B>-full</B>? <I>tagOrId</I> <I>tagOrId</I>... </DT>
-<DD>Translates
-one or more ids to their node entry names. It returns a list of names
-for all the ids specified. If the <B>-full</B> flag is set, then the full pathnames
-are returned. </DD>
-
-<DT><I>pathName <B>hide </B></I>?<B>flags</B>? <I>tagOrId</I>... </DT>
-<DD>Hides all nodes matching the
-criteria given by <I>flags</I>. The search is performed recursively for each node
-given by <I>tagOrId</I>. The valid flags are described below: <blockquote></DD>
-
-<DT><B>-name<I> pattern</I></B> </DT>
-<DD>Specifies
-pattern to match against node names. </DD>
-
-<DT><B>-full<I> pattern</I></B> </DT>
-<DD>Specifies pattern to match
-against node pathnames. </DD>
-
-<DT><B>-<I>option<I> pattern</I></I></B> </DT>
-<DD>Specifies pattern to match against
-the node entry's configuration option. </DD>
-
-<DT><B>-exact</B> </DT>
-<DD>Match patterns exactly. The
-is the default. </DD>
-
-<DT><B>-glob</B> </DT>
-<DD>Use global pattern matching. Matching is done in a
-fashion similar to that used by the C-shell. For the two strings to match,
-their contents must be identical except that the following special sequences
- may appear in pattern: <blockquote></DD>
-
-<DT><I>*</I> </DT>
-<DD>Matches any sequence of characters in string,
-including a null string. </DD>
-
-<DT><I>?</I> </DT>
-<DD>Matches any single character in string. </DD>
-
-<DT><I>[<I>chars<I>]</I></I></I>
-</DT>
-<DD>Matches any character in the set given by <I>chars</I>. If a sequence of the form
-<I>x</I>-<I>y</I> appears in <I>chars</I>, then any character between <I>x</I> and <I>y</I>, inclusive, will
-match. </DD>
-
-<DT><I>\<I>x</I></I> </DT>
-<DD>Matches the single character <I>x</I>. This provides a way of avoiding
- the special interpretation of the characters <I>*?[]\</I> in the pattern. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-regexp</B>
-</DT>
-<DD>Use regular expression pattern matching (i.e. the same as implemented by
-the <B>regexp</B> command). </DD>
-
-<DT><B>-nonmatching</B> </DT>
-<DD>Hide nodes that don't match. </DD>
-
-<DT><B>--</B> </DT>
-<DD>Indicates
-the end of flags. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>index </B></I>?<B>-at</B> <I>tagOrId</I>? <I>string</I> </DT>
-<DD>Returns the id of
-the node specified by <I>string</I>. <I>String</I> may be a tag or node id. Some special
-ids are normally relative to the node that has focus. The <B>-at</B> flag lets
-you select another node. </DD>
-
-<DT><I>pathName <B>insert </B></I>?<B>-at <I>tagOrId</I></B>? <I>position</I> <I>path</I> ?<I>options...</I>?
-?<I>path</I>? ?<I>options...</I>? </DT>
-<DD>Inserts one or more nodes at <I>position</I>. <I>Position</I> is the
-location (number or <I>end</I>) where the new nodes are added to the parent node.
- <I>Path</I> is the pathname of the new node. Pathnames can be formated either
-as a Tcl list (each element is a path component) or as a string separated
-by a special character sequence (using the <B>-separator</B> option). Pathnames
-are normally absolute, but the <B>-at</B> switch lets you select a relative starting
-point. Its value is the id of the starting node. <P>
-All ancestors of the
-new node must already exist, unless the <B>-autocreate</B> option is set. It is
-also an error if a node already exists, unless the <B>-allowduplicates</B> option
-is set. <P>
-<I>Option</I> and <I>value</I> may have any of the values accepted by the <B>entry
-configure</B> operation described in the <FONT SIZE=-1><B>ENTRY OPERATIONS</B></FONT>
- section below. This
-command returns a list of the ids of the new entries. </DD>
-
-<DT><I>pathName <B>move <I>tagOrId</I></B></I>
-<I>how</I> <I>destId</I> </DT>
-<DD>Moves the node given by <I>tagOrId</I> to the destination node. The
-node can not be an ancestor of the destination. <I>DestId</I> is the id of the
-destination node and can not be the root of the tree. In conjunction with
-<I>how</I>, it describes how the move is performed. <blockquote></DD>
-
-<DT><I>before</I> </DT>
-<DD>Moves the node before
-the destination node. </DD>
-
-<DT><I>after</I> </DT>
-<DD>Moves the node after the destination node. </DD>
-
-<DT><I>into</I>
-</DT>
-<DD>Moves the node to the end of the destination's list of children. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>nearest <I>x y</I></B></I> ?<I>varName</I>? </DT>
-<DD>Returns the id of the node entry closest to the given
-X-Y screen coordinate. The optional argument <I>varName</I> is the name of variable
-which is set to either <I>button</I> or <I>select</I> to indicate over what part of the
-node the coordinate lies. If the coordinate is not directly over any node,
-then <I>varName</I> will contain the empty string. </DD>
-
-<DT><I>pathName <B>open </B></I>?<B>-recurse</B>? <I>tagOrId...</I>
-</DT>
-<DD>Opens the one or more nodes specified by <I>tagOrId</I>. If a node is not already
-open, the Tcl script specified by the <B>-opencommand</B> option is invoked. If
-the <B>-recurse</B> flag is present, then each descendant is recursively opened.
- </DD>
-
-<DT><I>pathName <B>range</B></I> ?<B>-open</B>? <I>first last</I> </DT>
-<DD>Returns the ids in depth-first order
-of the nodes between the <I>first</I> and <I>last</I> ids. If the <B>-open</B> flag is present,
-it indicates to consider only open nodes. If <I>last</I> is before <I>first</I>, then
-the ids are returned in reverse order. </DD>
-
-<DT><I>pathName <B>scan</B></I> <I>option args</I> </DT>
-<DD>This command
-implements scanning. It has two forms, depending on <I>option</I>: <blockquote></DD>
-
-<DT><I>pathName <B>scan
-mark <I>x y</I></B></I> </DT>
-<DD>Records <I>x</I> and <I>y</I> and the current view in the treeview window;
-used in conjunction with later <B>scan dragto</B> commands. Typically this command
-is associated with a mouse button press in the widget. It returns an empty
-string. </DD>
-
-<DT><I>pathName <B>scan dragto <I>x y</I></B></I>. </DT>
-<DD>Computes the difference between its <I>x</I> and
-<I>y</I> arguments and the <I>x</I> and <I>y</I> arguments to the last <B>scan mark</B> command for
-the widget. It then adjusts the view by 10 times the difference in coordinates.
- This command is typically associated with mouse motion events in the widget,
-to produce the effect of dragging the list at high speed through the window.
- The return value is an empty string. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>see</B></I> ?<B>-anchor <I>anchor</I></B>? <I>tagOrId</I>
-</DT>
-<DD>Adjusts the view of entries so that the node given by <I>tagOrId</I> is visible
-in the widget window. It is an error if <B>tagOrId</B> is a tag that refers to
-more than one node. By default the node's entry is displayed in the middle
-of the window. This can changed using the <B>-anchor</B> flag. Its value is a Tk
-anchor position. </DD>
-
-<DT><I>pathName <B>selection <I>option arg</I></B></I> </DT>
-<DD>This command is used to adjust
-the selection within a <B>treeview</B> widget. It has several forms, depending
-on <I>option</I>: <blockquote></DD>
-
-<DT><I>pathName <B>selection anchor <I>tagOrId</I></B></I> </DT>
-<DD>Sets the selection anchor
-to the node given by <I>tagOrId</I>. If <I>tagOrId</I> refers to a non-existent node, then
-the closest node is used. The selection anchor is the end of the selection
-that is fixed while dragging out a selection with the mouse. The special
-id <B>anchor</B> may be used to refer to the anchor node. </DD>
-
-<DT><I>pathName <B>selection cancel</B></I>
-</DT>
-<DD>Clears the temporary selection of entries back to the current anchor. Temporary
-selections are created by the <B>selection mark</B> operation. </DD>
-
-<DT><I>pathName <B>selection
-clear <I>first </I></B></I>?<I>last</I>? </DT>
-<DD>Removes the entries between <I>first</I> and <I>last</I> (inclusive)
-from the selection. Both <I>first</I> and <I>last</I> are ids representing a range of
-entries. If <I>last</I> isn't given, then only <I>first</I> is deselected. Entries outside
-the selection are not affected. </DD>
-
-<DT><I>pathName <B>selection clearall</B></I> </DT>
-<DD>Clears the entire
-selection. </DD>
-
-<DT><I>pathName <B>selection mark <I>tagOrId</I></B></I> </DT>
-<DD>Sets the selection mark to
-the node given by <I>tagOrId</I>. This causes the range of entries between the
-anchor and the mark to be temporarily added to the selection. The selection
-mark is the end of the selection that is fixed while dragging out a selection
-with the mouse. The special id <B>mark</B> may be used to refer to the current
- mark node. If <I>tagOrId</I> refers to a non-existent node, then the mark is ignored.
-Resetting the mark will unselect the previous range. Setting the anchor
-finalizes the range. </DD>
-
-<DT><I>pathName <B>selection includes <I>tagOrId</I></B></I> </DT>
-<DD>Returns 1 if the
-node given by <I>tagOrId</I> is currently selected, 0 if it isn't. </DD>
-
-<DT><I>pathName <B>selection
-present</B></I> </DT>
-<DD>Returns 1 if any nodes are currently selected and 0 otherwise. </DD>
-
-<DT><I>pathName
-<B>selection set <I>first </I></B></I>?<I>last</I>? </DT>
-<DD>Selects all of the nodes in the range between
-<I>first</I> and <I>last</I>, inclusive, without affecting the selection state of nodes
-outside that range. </DD>
-
-<DT><I>pathName <B>selection toggle <I>first </I></B></I>?<I>last</I>? </DT>
-<DD>Selects/deselects
-nodes in the range between <I>first</I> and <I>last</I>, inclusive, from the selection.
-If a node is currently selected, it becomes deselected, and visa versa.
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>show </B></I>?<B>flags</B>? <I>tagOrId</I>... </DT>
-<DD>Exposes all nodes matching the criteria given
-by <I>flags</I>. This is the inverse of the <B>hide</B> operation. The search is performed
-recursively for each node given by <I>tagOrId</I>. The valid flags are described
-below: <blockquote></DD>
-
-<DT><B>-name<I> pattern</I></B> </DT>
-<DD>Specifies pattern to match against node names. </DD>
-
-<DT><B>-full<I>
-pattern</I></B> </DT>
-<DD>Specifies pattern to match against node pathnames. </DD>
-
-<DT><B>-<I>option<I> pattern</I></I></B>
-</DT>
-<DD>Specifies pattern to match against the entry's configuration option. </DD>
-
-<DT><B>-exact</B>
-</DT>
-<DD>Match patterns exactly. The is the default. </DD>
-
-<DT><B>-glob</B> </DT>
-<DD><B>-glob</B> Use global pattern
-matching. Matching is done in a fashion similar to that used by the C-shell.
- For the two strings to match, their contents must be identical except
-that the following special sequences may appear in pattern: <blockquote></DD>
-
-<DT><I>*</I> </DT>
-<DD>Matches
- any sequence of characters in string, including a null string. </DD>
-
-<DT><I>?</I> </DT>
-<DD>Matches
-any single character in string. </DD>
-
-<DT><I>[<I>chars<I>]</I></I></I> </DT>
-<DD>Matches any character in the set
-given by <I>chars</I>. If a sequence of the form <I>x</I>-<I>y</I> appears in <I>chars</I>, then any
-character between <I>x</I> and <I>y</I>, inclusive, will match. </DD>
-
-<DT><I>\<I>x</I></I> </DT>
-<DD>Matches the single
- character <I>x</I>. This provides a way of avoiding the special interpretation
-of the characters <I>*?[]\</I> in the pattern. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-regexp</B> </DT>
-<DD>Use regular expression pattern
-matching (i.e. the same as implemented by the <B>regexp</B> command). </DD>
-
-<DT><B>-nonmatching</B>
-</DT>
-<DD>Expose nodes that don't match. </DD>
-
-<DT><B>--</B> </DT>
-<DD>Indicates the end of flags. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>sort</B></I>
-?<I>operation</I>? <I>args...</I> </DT>
-<DD><blockquote></DD>
-
-<DT><I>pathName <B>sort auto</B></I> ?<I>boolean</I> </DT>
-<DD>Turns on/off automatic sorting
-of node entries. If <I>boolean</I> is true, entries will be automatically sorted
-as they are opened, closed, inserted, or deleted. If no <I>boolean</I> argument
-is provided, the current state is returned. </DD>
-
-<DT><I>pathName <B>sort cget</B></I> <I>option</I> </DT>
-<DD>Returns
-the current value of the configuration option given by <I>option</I>. <I>Option</I> may
-have any of the values accepted by the <B>configure</B> operation described below.
-</DD>
-
-<DT><I>pathName <B>sort configure</B></I> ?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify
-the sorting configuration options of the widget. If no <I>option</I> is specified,
-returns a list describing all of the available options for <I>pathName</I> (see
-<B>Tk_ConfigureInfo</B> for information on the format of this list). If <I>option</I>
-is specified with no <I>value</I>, then the command returns a list describing
-the one named option (this list will be identical to the corresponding
-sublist of the value returned if no <I>option</I> is specified). If one or more
-<I>option-value</I> pairs are specified, then the command modifies the given sorting
-option(s) to have the given value(s); in this case the command returns
-an empty string. <I>Option</I> and <I>value</I> are described below: <blockquote></DD>
-
-<DT><B>-column<I> string</I></B> </DT>
-<DD>Specifies
-the column to sort. Entries in the widget are rearranged according to this
-column. If <I>column</I> is <I>""</I> then no sort is performed. </DD>
-
-<DT><B>-command<I> string</I></B> </DT>
-<DD>Specifies
-a Tcl procedure to be called when sorting nodes. The procedure is called
-with three arguments: the pathname of the widget and the fields of two
-entries. The procedure returns 1 if the first node is greater than the
-second, -1 is the second is greater, and 0 if equal. </DD>
-
-<DT><B>-decreasing<I> boolean</I></B>
-</DT>
-<DD>Indicates to sort in ascending/descending order. If <I>boolean</I> is true, then
-the entries as in descending order. The default is <I>no</I>. </DD>
-
-<DT><B>-mode<I> string</I></B> </DT>
-<DD>Specifies
-how to compare entries when sorting. <I>String</I> may be one of the following:
-<blockquote></DD>
-
-<DT><I>ascii</I> </DT>
-<DD>Use string comparison based upon the ASCII collation order. </DD>
-
-<DT><I>dictionary</I>
- </DT>
-<DD>Use dictionary-style comparison. This is the same as <I>ascii</I> except (a) case
-is ignored except as a tie-breaker and (b) if two strings contain embedded
-numbers, the numbers compare as integers, not characters. For example,
-"bigBoy" sorts between "bigbang" and "bigboy", and "x10y" sorts between
-"x9y" and "x11y". </DD>
-
-<DT><I>integer</I> </DT>
-<DD>Compares fields as integers. </DD>
-
-<DT><I>real</I> </DT>
-<DD>Compares fields
-as floating point numbers. </DD>
-
-<DT><I>command</I> </DT>
-<DD>Use the Tcl proc specified by the <B>-command</B>
-option to compare entries when sorting. If no command is specified, the
-sort reverts to <I>ascii</I> sorting. </DD>
-</DL>
-</blockquote>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>sort once</B></I> ?<I>flags</I>? <I>tagOrId...</I> </DT>
-<DD>Sorts
-the children for each entries specified by <I>tagOrId</I>. By default, entries
-are sorted by name, but you can specify a Tcl proc to do your own comparisons.
-<blockquote></DD>
-
-<DT><B>-recurse</B> </DT>
-<DD>Recursively sort the entire branch, not just the children. </DD>
-</DL>
-</blockquote>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>tag <I>operation args</I></B></I> </DT>
-<DD>Tags are a general means of selecting and marking nodes
-in the tree. A tag is just a string of characters, and it may take any form
-except that of an integer. The same tag may be associated with many different
-nodes. <P>
-Both <I>operation</I> and its arguments determine the exact behavior of
-the command. The operations available for tags are listed below. <blockquote></DD>
-
-<DT><I>pathName</I>
-<B>tag add</B> <I>string</I> <I>id</I>... </DT>
-<DD>Adds the tag <I>string</I> to one of more entries. </DD>
-
-<DT><I>pathName</I> <B>tag
-delete</B> <I>string</I> <I>id</I>... </DT>
-<DD>Deletes the tag <I>string</I> from one or more entries. </DD>
-
-<DT><I>pathName</I>
-<B>tag forget</B> <I>string</I> </DT>
-<DD>Removes the tag <I>string</I> from all entries. It's not an error
-if no entries are tagged as <I>string</I>. </DD>
-
-<DT><I>pathName</I> <B>tag names</B> ?<I>id</I>? </DT>
-<DD>Returns a list
-of tags used. If an <I>id</I> argument is present, only those tags used by the
-node designated by <I>id</I> are returned. </DD>
-
-<DT><I>pathName</I> <B>tag nodes</B> <I>string</I> </DT>
-<DD>Returns a
-list of ids that have the tag <I>string</I>. If no node is tagged as <I>string</I>, then
-an empty string is returned. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>text <I>operation</I></B></I> ?<I>args</I>? </DT>
-<DD>This operation
-is used to provide text editing for cells (data fields in a column) or
-entry labels. It has several forms, depending on <I>operation</I>: <blockquote></DD>
-
-<DT><I>pathName <B>text
-apply</B></I> </DT>
-<DD>Applies the edited buffer, replacing the entry label or data field.
-The edit window is hidden. </DD>
-
-<DT><I>pathName <B>text cancel</B></I> </DT>
-<DD>Cancels the editing operation,
-reverting the entry label or data value back to the previous value. The
-edit window is hidden. </DD>
-
-<DT><I>pathName <B>text cget<I> value</I></B></I> </DT>
-<DD>Returns the current value
-of the configuration option given by <I>option</I>. <I>Option</I> may have any of the
-values accepted by the <B>configure</B> operation described below. </DD>
-
-<DT><I>pathName <B>text
-configure</B></I> ?<I>option value</I>? </DT>
-<DD>Query or modify the configuration options of the
-edit window. If no <I>option</I> is specified, returns a list describing all of
-the available options (see <B>Tk_ConfigureInfo</B> for information on the format
-of this list). If <I>option</I> is specified with no <I>value</I>, then the command returns
-a list describing the one named option (this list will be identical to
-the corresponding sublist of the value returned if no <I>option</I> is specified).
- If one or more <I>option-value</I> pairs are specified, then the command modifies
-the given widget option(s) to have the given value(s); in this case the
-command returns an empty string. <I>Option</I> and <I>value</I> are described in the section
- <FONT SIZE=-1><B>TEXT EDITING OPTIONS</B></FONT>
- below. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>text delete<I> first last</I></B></I> </DT>
-<DD>Deletes the
-characters in the edit buffer between the two given character positions.
- </DD>
-
-<DT><I>pathName <B>text get</B></I> ?<I>-root</I>? <I>x y</I> </DT>
-<DD></DD>
-
-<DT><I>pathName <B>text icursor<I> index</I></B></I> </DT>
-<DD></DD>
-
-<DT><I>pathName <B>text
-index<I> index</I></B></I> </DT>
-<DD>Returns the text index of given <I>index</I>. </DD>
-
-<DT><I>pathName <B>text insert<I>
-index string</I></B></I> </DT>
-<DD>Insert the text string <I>string</I> into the edit buffer at the
-index <I>index</I>. For example, the index 0 will prepend the buffer. </DD>
-
-<DT><I>pathName
-<B>text selection<I> args</I></B></I> </DT>
-<DD>This operation controls the selection of the editing
-window. Note that this differs from the selection of entries. It has the
-following forms: <blockquote></DD>
-
-<DT><I>pathName <B>text selection adjust<I> index</I></B></I> </DT>
-<DD>Adjusts either the
-first or last index of the selection. </DD>
-
-<DT><I>pathName <B>text selection clear</B></I> </DT>
-<DD>Clears
-the selection. </DD>
-
-<DT><I>pathName <B>text selection from<I> index</I></B></I> </DT>
-<DD>Sets the anchor of the
-selection. </DD>
-
-<DT><I>pathName <B>text selection present</B></I> </DT>
-<DD>Indicates if a selection is present.
-</DD>
-
-<DT><I>pathName <B>text selection range<I> start end</I></B></I> </DT>
-<DD>Sets both the anchor and mark of
-the selection. </DD>
-
-<DT><I>pathName <B>text selection to<I> index</I></B></I> </DT>
-<DD>Sets the unanchored end
-(mark) of the selection. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>toggle <I>tagOrId</I></B></I> </DT>
-<DD>Opens or closes the node
-given by <I>tagOrId</I>. If the corresponding <B>-opencommand</B> or <B>-closecommand</B> option
-is set, then that command is also invoked. </DD>
-
-<DT><I>pathName <B>xview <I>args</I></B></I> </DT>
-<DD>This command
-is used to query and change the horizontal position of the information
-in the widget's window. It can take any of the following forms: <blockquote></DD>
-
-<DT><I>pathName
-<B>xview</B></I> </DT>
-<DD>Returns a list containing two elements. Each element is a real fraction
-between 0 and 1; together they describe the horizontal span that is visible
-in the window. For example, if the first element is .2 and the second element
-is .6, 20% of the <B>treeview</B> widget's text is off-screen to the left, the middle
-40% is visible in the window, and 40% of the text is off-screen to the right.
-These are the same values passed to scrollbars via the <B>-xscrollcommand</B> option.
-</DD>
-
-<DT><I>pathName <B>xview</B></I> <I>tagOrId</I> </DT>
-<DD>Adjusts the view in the window so that the character
-position given by <I>tagOrId</I> is displayed at the left edge of the window. Character
-positions are defined by the width of the character <B>0</B>. </DD>
-
-<DT><I>pathName <B>xview moveto<I>
-fraction</I></B></I> </DT>
-<DD>Adjusts the view in the window so that <I>fraction</I> of the total width
-of the <B>treeview</B> widget's text is off-screen to the left. <I>fraction</I> must be
-a fraction between 0 and 1. </DD>
-
-<DT><I>pathName <B>xview scroll <I>number what</I></B></I> </DT>
-<DD>This command
-shifts the view in the window left or right according to <I>number</I> and <I>what</I>.
-<I>Number</I> must be an integer. <I>What</I> must be either <B>units</B> or <B>pages</B> or an abbreviation
-of one of these. If <I>what</I> is <B>units</B>, the view adjusts left or right by <I>number</I>
-character units (the width of the <B>0</B> character) on the display; if it is
-<B>pages</B> then the view adjusts by <I>number</I> screenfuls. If <I>number</I> is negative
-then characters farther to the left become visible; if it is positive
-then characters farther to the right become visible. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>yview <I>?args</I></B></I>?
-</DT>
-<DD>This command is used to query and change the vertical position of the text
-in the widget's window. It can take any of the following forms: <blockquote></DD>
-
-<DT><I>pathName
-<B>yview</B></I> </DT>
-<DD>Returns a list containing two elements, both of which are real fractions
-between 0 and 1. The first element gives the position of the node at the
-top of the window, relative to the widget as a whole (0.5 means it is halfway
-through the treeview window, for example). The second element gives the
-position of the node just after the last one in the window, relative to
-the widget as a whole. These are the same values passed to scrollbars via
-the <B>-yscrollcommand</B> option. </DD>
-
-<DT><I>pathName <B>yview</B></I> <I>tagOrId</I> </DT>
-<DD>Adjusts the view in the
-window so that the node given by <I>tagOrId</I> is displayed at the top of the
-window. </DD>
-
-<DT><I>pathName <B>yview moveto<I> fraction</I></B></I> </DT>
-<DD>Adjusts the view in the window so
-that the node given by <I>fraction</I> appears at the top of the window. <I>Fraction</I>
-is a fraction between 0 and 1; 0 indicates the first node, 0.33 indicates
-the node one-third the way through the <B>treeview</B> widget, and so on. </DD>
-
-<DT><I>pathName
-<B>yview scroll <I>number what</I></B></I> </DT>
-<DD>This command adjusts the view in the window up
-or down according to <I>number</I> and <I>what</I>. <I>Number</I> must be an integer. <I>What</I> must
-be either <B>units</B> or <B>pages</B>. If <I>what</I> is <B>units</B>, the view adjusts up or down
-by <I>number</I> lines; if it is <B>pages</B> then the view adjusts by <I>number</I> screenfuls.
-If <I>number</I> is negative then earlier nodes become visible; if it is positive
-then later nodes become visible. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect11" HREF="#toc11">Treeview Options</A></H2>
-In addition to the <B>configure</B>
-operation, widget configuration options may also be set by the Tk <B>option</B>
-command. The class resource name is <I>TreeView</I>. <BR>
-<CODE>option add *TreeView.Foreground white<BR>
-option add *TreeView.Background blue<BR>
-</CODE><P>The following widget options are available:
-<DL>
-
-<DT><B>-activebackground <I>color</I></B> </DT>
-<DD>Sets
-the background color for active entries. A node is active when the mouse
-passes over it's entry or using the <B>activate</B> operation. </DD>
-
-<DT><B>-activeforeground
-<I>color</I></B> </DT>
-<DD>Sets the foreground color of the active node. A node is active when
-the mouse passes over it's entry or using the <B>activate</B> operation. </DD>
-
-<DT><B>-activeicons
-<I>images</I></B> </DT>
-<DD>Specifies images to be displayed for an entry's icon when it is active.
-<I>Images</I> is a list of two Tk images: the first image is displayed when the
-node is open, the second when it is closed. </DD>
-
-<DT><B>-autocreate <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I>
-is true, automatically create missing ancestor nodes when inserting new
-nodes. Otherwise flag an error. The default is <I>no</I>. </DD>
-
-<DT><B>-allowduplicates <I>boolean</I></B>
-</DT>
-<DD>If <I>boolean</I> is true, allow nodes with duplicate pathnames when inserting
-new nodes. Otherwise flag an error. The default is <I>no</I>. </DD>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets
-the background color of the widget. The default is <I>white</I>. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B>
-</DT>
-<DD>Sets the width of the 3-D border around the outside edge of the widget.
-The <B>-relief</B> option determines if the border is to be drawn. The default
-is <I>2</I>. </DD>
-
-<DT><B>-closecommand <I>string</I></B> </DT>
-<DD>Specifies a Tcl script to be invoked when a node
-is closed. You can overrider this for individual entries using the entry's
-<B>-closecommand</B> option. The default is <I>""</I>. Percent substitutions are performed
-on <I>string</I> before it is executed. The following substitutions are valid:
-<blockquote></DD>
-
-<DT><I>%W</I> </DT>
-<DD>The pathname of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The full pathname
-of the node. </DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single percent. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-cursor
-<I>cursor</I></B> </DT>
-<DD>Specifies the widget's cursor. The default cursor is <I>""</I>. </DD>
-
-<DT><B>-dashes <I>number</I></B>
-</DT>
-<DD>Sets the dash style of the horizontal and vertical lines drawn connecting
- entries. <I>Number</I> is the length in pixels of the dashes and gaps in the line.
-If <I>number</I> is <I>0</I>, solid lines will be drawn. The default is <I>1</I> (dotted). </DD>
-
-<DT><B>-exportselection
-<I>boolean</I></B> </DT>
-<DD>Indicates if the selection is exported. If the widget is exporting
-its selection then it will observe the standard X11 protocols for handling
-the selection. Selections are available as type <B>STRING</B>; the value of the
-selection will be the label of the selected nodes, separated by newlines.
- The default is <I>no</I>. </DD>
-
-<DT><B>-flat <I>boolean</I></B> </DT>
-<DD>Indicates whether to display the tree as
-a flattened list. If <I>boolean</I> is true, then the hierarchy will be a list
-of full paths for the nodes. This option also has affect on sorting. See
-the <FONT SIZE=-1><B>SORT OPERATIONS</B></FONT>
- section for more information. The default is <I>no</I>. </DD>
-
-<DT><B>-focusdashes
-<I>dashList</I></B> </DT>
-<DD>Sets the dash style of the outline rectangle drawn around the
-entry label of the node that current has focus. <I>Number</I> is the length in
-pixels of the dashes and gaps in the line. If <I>number</I> is <I>0</I>, a solid line
-will be drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-focusforeground <I>color</I></B> </DT>
-<DD>Sets the color of
-the focus rectangle. The default is <I>black</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Specifies the
-font for entry labels. You can override this for individual entries with
-the entry's <B>-font</B> configuration option. The default is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>.
-</DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets the text color of entry labels. You can override
-this for individual entries with the entry's <B>-foreground</B> configuration option.
- The default is <I>black</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B> </DT>
-<DD>Specifies the requested height of
-widget. The default is <I>400</I>. </DD>
-
-<DT><B>-hideroot <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, it indicates
-that no entry for the root node should be displayed. The default is <I>no</I>.
-</DD>
-
-<DT><B>-highlightbackground <I>color</I></B> </DT>
-<DD>Specifies the normal color of the traversal
-highlight region when the widget does not have the input focus. </DD>
-
-<DT><B>-highlightcolor
-<I>color</I></B> </DT>
-<DD>Specifies the color of the traversal highlight rectangle when the
-widget has the input focus. The default is <I>black</I>. </DD>
-
-<DT><B>-highlightthickness <I>pixels</I></B>
-</DT>
-<DD>Specifies the width of the highlight rectangle indicating when the widget
-has input focus. The value may have any of the forms acceptable to <B>Tk_GetPixels</B>.
- If the value is zero, no focus highlight will be displayed. The default
-is <I>2</I>. </DD>
-
-<DT><B>-icons <I>images</I></B> </DT>
-<DD>Specifies images for the entry's icon. <I>Images</I> is a list
-of two Tk images: the first image is displayed when the node is open,
-the second when it is closed. </DD>
-
-<DT><B>-linecolor <I>color</I></B> </DT>
-<DD>Sets the color of the connecting
-lines drawn between entries. The default is <I>black</I>. </DD>
-
-<DT><B>-linespacing <I>pixels</I></B> </DT>
-<DD>Sets
-the number of pixels spacing between entries. The default is <I>0</I>. </DD>
-
-<DT><B>-linewidth
-<I>pixels</I></B> </DT>
-<DD>Set the width of the lines drawn connecting entries. If <I>pixels</I> is
-<I>0</I>, no vertical or horizontal lines are drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-opencommand
-<I>string</I></B> </DT>
-<DD>Specifies a Tcl script to be invoked when a node is open. You can
-override this for individual entries with the entry's <B>-opencommand</B> configuration
-option. The default is <I>""</I>. Percent substitutions are performed on <I>string</I>
-before it is executed. The following substitutions are valid: <blockquote></DD>
-
-<DT><I>%W</I> </DT>
-<DD>The pathname
-of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The full pathname of the node.
-</DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single percent. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies
-the 3-D effect for the widget. <I>Relief</I> specifies how the <B>treeview</B> widget
-should appear relative to widget it is packed into; for example, <I>raised</I>
-means the <B>treeview</B> widget should appear to protrude. The default is <I>sunken</I>.
-</DD>
-
-<DT><B>-scrollmode <I>mode</I></B> </DT>
-<DD>Specifies the style of scrolling to be used. The following
-styles are valid. This is the default is <I>hierbox</I>. <blockquote></DD>
-
-<DT><I>listbox</I> </DT>
-<DD>Like the <B>listbox</B>
-widget, the last entry can always be scrolled to the top of the widget
-window. This allows the scrollbar thumb to shrink as the last entry is
-scrolled upward. </DD>
-
-<DT><I>hierbox</I> </DT>
-<DD>Like the <B>hierbox</B> widget, the last entry can only
-be viewed at the bottom of the widget window. The scrollbar stays a constant
-size. </DD>
-
-<DT><I>canvas</I> </DT>
-<DD>Like the <B>canvas</B> widget, the entries are bound within the
-scrolling area. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-selectbackground <I>color</I></B> </DT>
-<DD>Sets the background color selected
-node entries. The default is <I>#ffffea</I>. </DD>
-
-<DT><B>-selectborderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of the raised 3-D border drawn around the labels of selected entries. The
-default is <I>0</I>. <B>-selectcommand <I>string</I></B> Specifies a Tcl script to invoked when
-the set of selected nodes changes. The default is <I>""</I>. </DD>
-
-<DT><B>-selectforeground <I>color<B>
-</B></I></B></DT>
-<DD>Sets the color of the labels of selected node entries. The default is <I>black</I>.
-</DD>
-
-<DT><B>-selectmode <I>mode</I></B> </DT>
-<DD>Specifies the selection mode. If <I>mode</I> is <I>single</I>, only one
-node can be selected at a time. If <I>multiple</I> more than one node can be selected.
-The default is <I>single</I>. </DD>
-
-<DT><B>-separator <I>string</I></B> </DT>
-<DD>Specifies the character sequence
-to use when spliting the path components. The separator may be several
-characters wide (such as "::") Consecutive separators in a pathname are
-treated as one. If <I>string</I> is the empty string, the pathnames are Tcl lists.
- Each element is a path component. The default is <I>""</I>. </DD>
-
-<DT><B>-showtitles <I>boolean</I></B>
-</DT>
-<DD>If <I>boolean</I> is false, column titles are not be displayed. The default is
-<I>yes</I>. </DD>
-
-<DT><B>-sortselection <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, nodes in the selection are
-ordered as they are currently displayed (depth-first or sorted), not in
-the order they were selected. The default is <I>no</I>. </DD>
-
-<DT><B>-takefocus</B> <I>focus</I> </DT>
-<DD>Provides
-information used when moving the focus from window to window via keyboard
-traversal (e.g., Tab and Shift-Tab). If <I>focus</I> is <I>0</I>, this means that this window
-should be skipped entirely during keyboard traversal. <I>1</I> means that the
-this window should always receive the input focus. An empty value means
-that the traversal scripts make the decision whether to focus on the window.
-The default is <I>"1"</I>. </DD>
-
-<DT><B>-trim <I>string</I></B> </DT>
-<DD>Specifies a string leading characters to
-trim from entry pathnames before parsing. This only makes sense if the
-<B>-separator</B> is also set. The default is <I>""</I>. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Sets the requested
-width of the widget. If <I>pixels</I> is 0, then the with is computed from the
-contents of the <B>treeview</B> widget. The default is <I>200</I>. </DD>
-
-<DT><B>-xscrollcommand <I>string</I></B>
-</DT>
-<DD>Specifies the prefix for a command used to communicate with horizontal
-scrollbars. Whenever the horizontal view in the widget's window changes,
-the widget will generate a Tcl command by concatenating the scroll command
-and two numbers. If this option is not specified, then no command will
-be executed. </DD>
-
-<DT><B>-xscrollincrement</B> <I>pixels</I> </DT>
-<DD>Sets the horizontal scrolling distance.
-The default is 20 pixels. </DD>
-
-<DT><B>-yscrollcommand <I>string</I></B> </DT>
-<DD>Specifies the prefix for
-a command used to communicate with vertical scrollbars. Whenever the vertical
-view in the widget's window changes, the widget will generate a Tcl command
-by concatenating the scroll command and two numbers. If this option is
-not specified, then no command will be executed. </DD>
-
-<DT><B>-yscrollincrement</B> <I>pixels</I>
-</DT>
-<DD>Sets the vertical scrolling distance. The default is 20 pixels. </DD>
-</DL>
-
-<H2><A NAME="sect12" HREF="#toc12">Entry Options</A></H2>
-Many
-widget configuration options have counterparts in entries. For example,
-there is a <B>-closecommand</B> configuration option for both widget itself and
-for individual entries. Options set at the widget level are global for
-all entries. If the entry configuration option is set, then it overrides
-the widget option. This is done to avoid wasting memory by replicated options.
- Most entries will have redundant options. <P>
-There is no resource class or
-name for entries.
-<DL>
-
-<DT><B>-activeicons <I>images</I></B> </DT>
-<DD>Specifies images to be displayed as
-the entry's icon when it is active. This overrides the global <B>-activeicons</B>
-configuration option for the specific entry. <I>Images</I> is a list of two Tk
-images: the first image is displayed when the node is open, the second
-when it is closed. </DD>
-
-<DT><B>-bindtags <I>tagList</I></B> </DT>
-<DD>Specifies the binding tags for nodes.
- <I>TagList</I> is a list of binding tag names. The tags and their order will
-determine how events are handled for nodes. Each tag in the list matching
-the current event sequence will have its Tcl command executed. The default
-value is <I>all</I>. </DD>
-
-<DT><B>-button <I>string</I></B> </DT>
-<DD>Indicates whether a button should be displayed
-on the left side of the node entry. <I>String</I> can be <I>yes</I>, <I>no</I>, or <I>auto</I>. If
-<I>auto</I>, then a button is automatically displayed if the node has children.
- This is the default. </DD>
-
-<DT><B>-closecommand <I>string</I></B> </DT>
-<DD>Specifies a Tcl script to be invoked
-when the node is closed. This overrides the global <B>-closecommand</B> option
-for this entry. The default is <I>""</I>. Percent substitutions are performed on
-<I>string</I> before it is executed. The following substitutions are valid: <blockquote></DD>
-
-<DT><I>%W</I>
-</DT>
-<DD>The pathname of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The full pathname
-of the node. </DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single percent. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-data
-<I>string</I></B> </DT>
-<DD>Sets data fields for the node. <I>String</I> is a list of name-value pairs
-to be set. The default is <I>""</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Sets the font for entry labels.
- This overrides the widget's <B>-font</B> option for this node. The default is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>.
-</DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets the text color of the entry label. This overrides
-the widget's <B>-foreground</B> configuration option. The default is <I>""</I>. </DD>
-
-<DT><B>-icons <I>images</I></B>
-</DT>
-<DD>Specifies images to be displayed for the entry's icon. This overrides the
-global <B>-icons</B> configuration option. <I>Images</I> is a list of two Tk images: the
-first image is displayed when the node is open, the second when it is closed.
-</DD>
-
-<DT><B>-label <I>string</I></B> </DT>
-<DD>Sets the text for the entry's label. If not set, this defaults
-to the name of the node. The default is <I>""</I>. </DD>
-
-<DT><B>-opencommand <I>string</I></B> </DT>
-<DD>Specifies
-a Tcl script to be invoked when the entry is opened. This overrides the
-widget's <B>-opencommand</B> option for this node. The default is <I>""</I>. Percent substitutions
-are performed on <I>string</I> before it is executed. The following substitutions
-are valid: <blockquote></DD>
-
-<DT><I>%W</I> </DT>
-<DD>The pathname of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The
-full pathname of the node. </DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single
-percent. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect13" HREF="#toc13">Button Options</A></H2>
-Button configuration options may also be set by the
-<B>option</B> command. The resource subclass is <I>Button</I>. The resource name is always
-<I>button</I>. <BR>
-<CODE>option add *TreeView.Button.Foreground white<BR>
-option add *TreeView.button.Background blue<BR>
-</CODE><P>The following are the configuration options available for buttons.
-<DL>
-
-<DT><B>-activebackground
-<I>color</I></B> </DT>
-<DD>Sets the background color of active buttons. A button is made active
-when the mouse passes over it or by the <B>button activate</B> operation. </DD>
-
-<DT><B>-activeforeground
-<I>color</I></B> </DT>
-<DD>Sets the foreground color of active buttons. A button is made active
-when the mouse passes over it or by the <B>button activate</B> operation. </DD>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Sets the background of the button. The default is <I>white</I>. </DD>
-
-<DT><B>-borderwidth
-<I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around the button. The <B>-relief</B> option
-determines if a border is to be drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-closerelief <I>relief</I></B>
-</DT>
-<DD>Specifies the 3-D effect for the closed button. <I>Relief</I> indicates how the
-button should appear relative to the widget; for example, <I>raised</I> means
-the button should appear to protrude. The default is <I>solid</I>. </DD>
-
-<DT><B>-cursor <I>cursor</I></B>
-</DT>
-<DD>Sets the widget's cursor. The default cursor is <I>""</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets
-the foreground color of buttons. The default is <I>black</I>. </DD>
-
-<DT><B>-images <I>images</I></B> </DT>
-<DD>Specifies
-images to be displayed for the button. <I>Images</I> is a list of two Tk images:
- the first image is displayed when the button is open, the second when
-it is closed. If the <I>images</I> is the empty string, then a plus/minus gadget
-is drawn. The default is <I>""</I>. </DD>
-
-<DT><B>-openrelief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect of
-the open button. <I>Relief</I> indicates how the button should appear relative
-to the widget; for example, <I>raised</I> means the button should appear to protrude.
- The default is <I>flat</I>. </DD>
-
-<DT><B>-size <I>pixels</I></B> </DT>
-<DD>Sets the requested size of the button.
- The default is <I>0</I>. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect14" HREF="#toc14">Column Options</A></H2>
-Column configuration options may also
-be set by the <B>option</B> command. The resource subclass is <I>Column</I>. The resource
-name is the name of the column. <BR>
-<CODE>option add *TreeView.Column.Foreground white<BR>
-option add *TreeView.treeView.Background blue<BR>
-</CODE><P>The following configuration options are available for columns.
-<DL>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Sets the background color of the column. This overrides the widget's
-<B>-background</B> option. The default is <I>white</I>. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of the 3-D border of the column. The <B>-relief</B> option determines if a border
-is to be drawn. The default is <I>0</I>. </DD>
-
-<DT><B>-edit <I>boolean</I></B> </DT>
-<DD>Indicates if the column's
-data fields can be edited. If <I>boolean</I> is false, the data fields in the
-column may not be edited. The default is <I>yes</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Specifies
-the foreground color of the column. You can override this for individual
-entries with the entry's <B>-foreground</B> option. The default is <I>black</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B>
- </DT>
-<DD>Sets the font for a column. You can override this for individual entries
-with the entry's <B>-font</B> option. The default is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>.
-</DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, the column is not displayed. The default
-is <I>yes</I>. </DD>
-
-<DT><B>-justify <I>justify</I></B> </DT>
-<DD>Specifies how the column data fields title should
-be justified within the column. This matters only when the column is wider
-than the data field to be display. <I>Justify</I> must be <I>left</I>, <I>right</I>, or <I>center</I>.
- The default is <I>left</I>. </DD>
-
-<DT><B>-pad <I>pad</I></B> </DT>
-<DD>Specifies how much padding for the left and
-right sides of the column. <I>Pad</I> is a list of one or two screen distances.
- If <I>pad</I> has two elements, the left side of the column is padded by the
-first distance and the right side by the second. If <I>pad</I> has just one distance,
-both the left and right sides are padded evenly. The default is <I>2</I>. </DD>
-
-<DT><B>-relief
-<I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect of the column. <I>Relief</I> specifies how the
-column should appear relative to the widget; for example, <I>raised</I> means
-the column should appear to protrude. The default is <I>flat</I>. </DD>
-
-<DT><B>-state <I>state</I></B> </DT>
-<DD>Sets
-the state of the column. If <I>state</I> is <I>disable</I> then the column title can not
-be activated nor invoked. The default is <I>normal</I>. </DD>
-
-<DT><B>-text <I>string</I></B> </DT>
-<DD>Sets the title
-for the column. The default is <I>""</I>. </DD>
-
-<DT><B>-titleforeground <I>color</I></B> </DT>
-<DD>Sets the foreground
-color of the column title. The default is <I>black</I>. </DD>
-
-<DT><B>-titleshadow <I>color</I></B> </DT>
-<DD>Sets
-the color of the drop shadow of the column title. The default is <I>""</I>. </DD>
-
-<DT><B>-width
-<I>pixels</I></B> </DT>
-<DD>Sets the requested width of the column. This overrides the computed
-with of the column. If <I>pixels</I> is 0, the width is computed as from the contents
-of the column. The default is <I>0</I>. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect15" HREF="#toc15">Text Editing Options</A></H2>
-Text edit window configuration
-options may also be set by the <B>option</B> command. The resource class is <I>TreeViewEditor</I>.
-The resource name is always <I>edit</I>. <BR>
-<CODE>option add *TreeViewEditor.Foreground white<BR>
-option add *edit.Background blue<BR>
-</CODE><P>The following are the configuration options available for the text editing
-window.
-<DL>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets the background of the text edit window. The
-default is <I>white</I>. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around
-the edit window. The <B>-relief</B> option determines if a border is to be drawn.
- The default is <I>1</I>. </DD>
-
-<DT><B>-exportselection <I>boolean</I></B> </DT>
-<DD>Indicates if the text selection
-is exported. If the edit window is exporting its selection then it will
-observe the standard X11 protocols for handling the selection. Selections
-are available as type <B>STRING</B>. The default is <I>no</I>. </DD>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies
-the 3-D effect of the edit window. <I>Relief</I> indicates how the background should
-appear relative to the edit window; for example, <I>raised</I> means the background
-should appear to protrude. The default is <I>solid</I>. </DD>
-
-<DT><B>-selectbackground <I>color</I></B>
-</DT>
-<DD>Sets the background of the selected text in the edit window. The default
-is <I>white</I>. </DD>
-
-<DT><B>-selectborderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around
-the selected text in the edit window. The <B>-selectrelief</B> option determines
-if a border is to be drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-selectforeground <I>color</I></B> </DT>
-<DD>Sets
-the foreground of the selected text in the edit window. The default is
-<I>white</I>. </DD>
-
-<DT><B>-selectrelief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect of the selected text
-in the edit window. <I>Relief</I> indicates how the text should appear relative
-to the edit window; for example, <I>raised</I> means the text should appear to
-protrude. The default is <I>flat</I>. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect16" HREF="#toc16">Default Bindings</A></H2>
-Tk automatically creates
-class bindings for treeviews that give them Motif-like behavior. Much of
-the behavior of a <B>treeview</B> widget is determined by its <B>-selectmode</B> option,
-which selects one of two ways of dealing with the selection. <P>
-If the selection
-mode is <B>single</B>, only one node can be selected at a time. Clicking button
-1 on an node selects it and deselects any other selected item. <P>
-If the selection
-mode is <B>multiple</B>, any number of entries may be selected at once, including
-discontiguous ranges. Clicking Control-Button-1 on a node entry toggles its
-selection state without affecting any other entries. Pressing Shift-Button-1
-on a node entry selects it, extends the selection.
-<OL>
-<LI>In <B>extended</B> mode, the
-selected range can be adjusted by pressing button 1 with the Shift key
-down: this modifies the selection to consist of the entries between the
-anchor and the entry under the mouse, inclusive. The un-anchored end of this
-new selection can also be dragged with the button down. </LI><LI>In <B>extended</B> mode,
-pressing button 1 with the Control key down starts a toggle operation:
-the anchor is set to the entry under the mouse, and its selection state
-is reversed. The selection state of other entries isn't changed. If the mouse
-is dragged with button 1 down, then the selection state of all entries
-between the anchor and the entry under the mouse is set to match that of
-the anchor entry; the selection state of all other entries remains what
-it was before the toggle operation began. </LI><LI>If the mouse leaves the treeview
-window with button 1 down, the window scrolls away from the mouse, making
-information visible that used to be off-screen on the side of the mouse.
-The scrolling continues until the mouse re-enters the window, the button
-is released, or the end of the hierarchy is reached. </LI><LI>Mouse button 2 may
-be used for scanning. If it is pressed and dragged over the <B>treeview</B> widget,
-the contents of the hierarchy drag at high speed in the direction the mouse
-moves. </LI><LI>If the Up or Down key is pressed, the location cursor (active entry)
-moves up or down one entry. If the selection mode is <B>browse</B> or <B>extended</B>
-then the new active entry is also selected and all other entries are deselected.
-In <B>extended</B> mode the new active entry becomes the selection anchor. </LI><LI>In <B>extended</B>
-mode, Shift-Up and Shift-Down move the location cursor (active entry) up
-or down one entry and also extend the selection to that entry in a fashion
-similar to dragging with mouse button 1. </LI><LI>The Left and Right keys scroll
-the <B>treeview</B> widget view left and right by the width of the character <B>0</B>.
-Control-Left and Control-Right scroll the <B>treeview</B> widget view left and right
-by the width of the window. Control-Prior and Control-Next also scroll left
-and right by the width of the window. </LI><LI>The Prior and Next keys scroll the
-<B>treeview</B> widget view up and down by one page (the height of the window).
-</LI><LI>The Home and End keys scroll the <B>treeview</B> widget horizontally to the left
-and right edges, respectively. </LI><LI>Control-Home sets the location cursor to the
-the first entry, selects that entry, and deselects everything else in
-the widget. </LI><LI>Control-End sets the location cursor to the the last entry,
-selects that entry, and deselects everything else in the widget. </LI><LI>In <B>extended</B>
-mode, Control-Shift-Home extends the selection to the first entry and Control-Shift-End
-extends the selection to the last entry. </LI><LI>In <B>multiple</B> mode, Control-Shift-Home
-moves the location cursor to the first entry and Control-Shift-End moves
-the location cursor to the last entry. </LI><LI>The space and Select keys make a
-selection at the location cursor (active entry) just as if mouse button
-1 had been pressed over this entry. </LI><LI>In <B>extended</B> mode, Control-Shift-space
-and Shift-Select extend the selection to the active entry just as if button
-1 had been pressed with the Shift key down. </LI><LI>In <B>extended</B> mode, the Escape
-key cancels the most recent selection and restores all the entries in the
-selected range to their previous selection state. </LI><LI>Control-slash selects everything
-in the widget, except in <B>single</B> and <B>browse</B> modes, in which case it selects
-the active entry and deselects everything else. </LI><LI>Control-backslash deselects
-everything in the widget, except in <B>browse</B> mode where it has no effect.
-</LI><LI>The F16 key (labelled Copy on many Sun workstations) or Meta-w copies the
-selection in the widget to the clipboard, if there is a selection. </LI>
-</OL>
-<P>
-The behavior
-of <B>treeview</B> widgets can be changed by defining new bindings for individual
-widgets or by redefining the class bindings.
-<H3><A NAME="sect17" HREF="#toc17">Widget Bindings</A></H3>
-In addition
-to the above behavior, the following additional behavior is defined by
-the default widget class (TreeView) bindings.
-<DL>
-
-<DT><I><ButtonPress-2></I></DT>
-<DD>Starts scanning.
- </DD>
-
-<DT><I><B2-Motion></I></DT>
-<DD>Adjusts the scan. </DD>
-
-<DT><I><ButtonRelease-2></I></DT>
-<DD>Stops scanning. </DD>
-
-<DT><I><B1-Leave></I></DT>
-<DD>Starts auto-scrolling.
-</DD>
-
-<DT><I><B1-Enter></I></DT>
-<DD>Starts auto-scrolling </DD>
-
-<DT><I><KeyPress-Up></I></DT>
-<DD>Moves the focus to the previous
-entry. </DD>
-
-<DT><I><KeyPress-Down></I></DT>
-<DD>Moves the focus to the next entry. </DD>
-
-<DT><I><Shift-KeyPress-Up></I></DT>
-<DD>Moves
-the focus to the previous sibling. </DD>
-
-<DT><I><Shift-KeyPress-Down></I></DT>
-<DD>Moves the focus to the
-next sibling. </DD>
-
-<DT><I><KeyPress-Prior></I></DT>
-<DD>Moves the focus to first entry. Closed or hidden
-entries are ignored. </DD>
-
-<DT><I><KeyPress-Next></I></DT>
-<DD>Move the focus to the last entry. Closed
-or hidden entries are ignored. </DD>
-
-<DT><I><KeyPress-Left></I></DT>
-<DD>Closes the entry. It is not an
-error if the entry has no children. </DD>
-
-<DT><I><KeyPress-Right></I></DT>
-<DD>Opens the entry, displaying
-its children. It is not an error if the entry has no children. </DD>
-
-<DT><I><KeyPress-space></I></DT>
-<DD>In
-"single" select mode this selects the entry. In "multiple" mode, it toggles
-the entry (if it was previous selected, it is not deselected). </DD>
-
-<DT><I><KeyRelease-space></I></DT>
-<DD>Turns
-off select mode. </DD>
-
-<DT><I><KeyPress-Return></I></DT>
-<DD>Sets the focus to the current entry. </DD>
-
-<DT><I><KeyRelease-Return></I></DT>
-<DD>Turns
-off select mode. </DD>
-
-<DT><I><KeyPress></I></DT>
-<DD>Moves to the next entry whose label starts with
-the letter typed. </DD>
-
-<DT><I><KeyPress-Home></I></DT>
-<DD>Moves the focus to first entry. Closed or
-hidden entries are ignored. </DD>
-
-<DT><I><KeyPress-End></I></DT>
-<DD>Move the focus to the last entry.
-Closed or hidden entries are ignored. </DD>
-
-<DT><I><KeyPress-F1></I></DT>
-<DD>Opens all entries. </DD>
-
-<DT><I><KeyPress-F2></I></DT>
-<DD>Closes
-all entries (except root). </DD>
-</DL>
-
-<H3><A NAME="sect18" HREF="#toc18">Button Bindings</A></H3>
-Buttons have bindings. There are
-associated with the "all" bindtag (see the entry's -bindtag option). You
-can use the <B>bind</B> operation to change them.
-<DL>
-
-<DT><I><Enter></I></DT>
-<DD>Highlights the button of
-the current entry. </DD>
-
-<DT><I><Leave></I></DT>
-<DD>Returns the button back to its normal state. </DD>
-
-<DT><I><ButtonRelease-1></I></DT>
-<DD>Adjust
-the view so that the current entry is visible. </DD>
-</DL>
-
-<H3><A NAME="sect19" HREF="#toc19">Entry Bindings</A></H3>
-Entries have
-default bindings. There are associated with the "all" bindtag (see the
-entry's -bindtag option). You can use the <B>bind</B> operation to modify them.
-<DL>
-
-<DT><I><Enter></I></DT>
-<DD>Highlights
-the current entry. </DD>
-
-<DT><I><Leave></I></DT>
-<DD>Returns the entry back to its normal state. </DD>
-
-<DT><I><ButtonPress-1></I></DT>
-<DD>Sets
-the selection anchor the current entry. </DD>
-
-<DT><I><Double-ButtonPress-1></I></DT>
-<DD>Toggles the selection
-of the current entry. </DD>
-
-<DT><I><B1-Motion></I></DT>
-<DD>For "multiple" mode only. Saves the current
-location of the pointer for auto-scrolling. Resets the selection mark.
-</DD>
-
-<DT><I><ButtonRelease-1></I></DT>
-<DD>For "multiple" mode only. Sets the selection anchor to the
- current entry. </DD>
-
-<DT><I><Shift-ButtonPress-1></I></DT>
-<DD>For "multiple" mode only. Extends the selection.
-</DD>
-
-<DT><I><Shift-Double-ButtonPress-1></I></DT>
-<DD>Place holder. Does nothing. </DD>
-
-<DT><I><Shift-B1-Motion></I></DT>
-<DD>Place holder.
-Does nothing. </DD>
-
-<DT><I><Shift-ButtonRelease-1></I></DT>
-<DD>Stop auto-scrolling. </DD>
-
-<DT><I><Control-ButtonPress-1></I></DT>
-<DD>For
-"multiple" mode only. Toggles and extends the selection. </DD>
-
-<DT><I><Control-Double-ButtonPress-1></I></DT>
-<DD>Place
-holder. Does nothing. </DD>
-
-<DT><I><Control-B1-Motion></I></DT>
-<DD>Place holder. Does nothing. </DD>
-
-<DT><I><Control-ButtonRelease-1></I></DT>
-<DD>Stops
-auto-scrolling. </DD>
-
-<DT><I><Control-Shift-ButtonPress-1></I></DT>
-<DD>??? </DD>
-
-<DT><I><Control-Shift-Double-ButtonPress-1></I></DT>
-<DD>Place
-holder. Does nothing. </DD>
-
-<DT><I><Control-Shift-B1-Motion></I></DT>
-<DD>Place holder. Does nothing. </DD>
-</DL>
-
-<H3><A NAME="sect20" HREF="#toc20">Column
-Bindings</A></H3>
-Columns have bindings too. They are associated with the column's
-"all" bindtag (see the column -bindtag option). You can use the <B>column bind</B>
-operation to change them.
-<DL>
-
-<DT><I><Enter></I></DT>
-<DD>Highlights the current column title. </DD>
-
-<DT><I><Leave></I></DT>
-<DD>Returns
-the column back to its normal state. </DD>
-
-<DT><I><ButtonRelease-1></I></DT>
-<DD>Invokes the command (see
-the column's -command option) if one if specified. </DD>
-</DL>
-
-<H3><A NAME="sect21" HREF="#toc21">Column Rule Bindings</A></H3>
-
-<DL>
-
-<DT><I><Enter></I></DT>
-<DD>Highlights
-the current and activates the ruler. </DD>
-
-<DT><I><Leave></I></DT>
-<DD>Returns the column back to its
-normal state. Deactivates the ruler. </DD>
-
-<DT><I><ButtonPress-1></I></DT>
-<DD>Sets the resize anchor for
-the column. </DD>
-
-<DT><I><B1-Motion></I></DT>
-<DD>Sets the resize mark for the column. </DD>
-
-<DT><I><ButtonRelease-1></I></DT>
-<DD>Adjust
-the size of the column, based upon the resize anchor and mark positions.
-</DD>
-</DL>
-
-<H2><A NAME="sect22" HREF="#toc22">Example</A></H2>
-The <B>treeview</B> command creates a new widget. <BR>
-<CODE>treeview .h -bg white<BR>
-</CODE><P>A new Tcl command <I>.h</I> is also created. This command can be used to query
-and modify the <B>treeview</B> widget. For example, to change the background
-color of the table to "green", you use the new command and the widget's
-<B>configure</B> operation. <BR>
-<CODE># Change the background color.<BR>
-.h configure -background "green"<BR>
-</CODE><P>By default, the <B>treeview</B> widget will automatically create a new tree object
-to contain the data. The name of the new tree is the pathname of the widget.
- Above, the new tree object name is ".h". But you can use the <B>-tree</B> option
-to specify the name of another tree. <BR>
-<CODE># View the tree "myTree".<BR>
-.h configure -tree "myTree"<BR>
-</CODE><P>When a new tree is created, it contains only a root node. The node is automatically
-opened. The id of the root node is always <I>0</I> (you can use also use the special
-id <I>root</I>). The <B>insert</B> operation lets you insert one or more new entries into
-the tree. The last argument is the node's <I>pathname</I>. <BR>
-<CODE># Create a new entry named "myEntry"<BR>
-set id [.h insert end "myEntry"]<BR>
-</CODE><P>This appends a new node named "myEntry". It will positioned as the last
-child of the root of the tree (using the position "end"). You can supply
-another position to order the node within its siblings. <BR>
-<CODE># Prepend "fred".<BR>
-set id [.h insert 0 "fred"]<BR>
-</CODE><P>Entry names do not need to be unique. By default, the node's label is its
-name. To supply a different text label, add the <B>-label</B> option. <BR>
-<CODE># Create a new node named "fred"<BR>
-set id [.h insert end "fred" -label "Fred Flintstone"]<BR>
-</CODE><P>The <B>insert</B> operation returns the id of the new node. You can also use the
-<B>index</B> operation to get this information. <BR>
-<CODE># Get the id of "fred"<BR>
-.h index "fred"<BR>
-</CODE><P>To insert a node somewhere other than root, use the <B>-at</B> switch. It takes
-the id of the node where the new child will be added. <BR>
-<CODE># Create a new node "barney" in "fred".<BR>
-.h insert -at $id end "barney" <BR>
-</CODE><P>A pathname describes the path to an entry in the hierarchy. It's a list
-of entry names that compose the path in the tree. Therefore, you can also
-add "barney" to "fred" as follows. <BR>
-<CODE># Create a new sub-entry of "fred"<BR>
-.h insert end "fred barney" <BR>
-</CODE><P>Every name in the list is ancestor of the next. All ancestors must already
-exist. That means that an entry "fred" is an ancestor of "barney" and must
-already exist. But you can use the <B>-autocreate</B> configuration option to force
-the creation of ancestor nodes. <BR>
-<CODE># Force the creation of ancestors.<BR>
-.h configure -autocreate yes <BR>
-.h insert end "fred barney wilma betty" <BR>
-</CODE><P>Sometimes the pathname is already separated by a character sequence rather
-than formed as a list. A file name is a good example of this. You can use
-the <B>-separator</B> option to specify a separator string to split the path into
-its components. Each pathname inserted is automatically split using the
-separator string as a separator. Multiple separators are treated as one.
-<BR>
-<CODE>.h configure -separator /<BR>
-.h insert end "/usr/local/tcl/bin" <BR>
-</CODE><P>If the path is prefixed by extraneous characters, you can automatically
-trim it off using the <B>-trim</B> option. It removed the string from the path
-before it is parsed. <BR>
-<CODE>.h configure -trim C:/windows -separator /<BR>
-.h insert end "C:/window/system" <BR>
-</CODE><P>You can insert more than one entry at a time with the <B>insert</B> operation.
- This can be much faster than looping over a list of names. <BR>
-<CODE># The slow way<BR>
-foreach f [glob $dir/*] {<BR>
- .h insert end $f<BR>
-}<BR>
-# The fast way<BR>
-eval .h insert end [glob $dir/*]<BR>
-</CODE><P>In this case, the <B>insert</B> operation will return a list of ids of the new
-entries. <P>
-You can delete entries with the <B>delete</B> operation. It takes one
-or more tags of ids as its argument. It deletes the entry and all its children.
-<BR>
-<CODE>.h delete $id<BR>
-</CODE><P>Entries have several configuration options. They control the appearance
-of the entry's icon and label. We have already seen the <B>-label</B> option that
-sets the entry's text label. The <B>entry configure</B> operation lets you set
-or modify an entry's configuration options. <BR>
-<CODE>.h entry configure $id -color red -font fixed<BR>
-</CODE><P>You can hide an entry and its children using the <B>-hide</B> option. <BR>
-<CODE>.h entry configure $id -hide yes<BR>
-</CODE><P>More that one entry can be configured at once. All entries specified are
-configured with the same options. <BR>
-<CODE>.h entry configure $i1 $i2 $i3 $i4 -color brown <BR>
-</CODE><P>An icon is displayed for each entry. It's a Tk image drawn to the left of
-the label. You can set the icon with the entry's <B>-icons</B> option. It takes
-a list of two image names: one to represent the open entry, another when
-it is closed. <BR>
-<CODE>set im1 [image create photo -file openfolder.gif]<BR>
-set im2 [image create photo -file closefolder.gif]<BR>
-.h entry configure $id -icons "$im1 $im2"<BR>
-</CODE><P>If <B>-icons</B> is set to the empty string, no icons are display. <P>
-If an entry has
-children, a button is displayed to the left of the icon. Clicking the mouse
-on this button opens or closes the sub-hierarchy. The button is normally
-a <I>+</I> or <I>-</I> symbol, but can be configured in a variety of ways using the <B>button
-configure</B> operation. For example, the <I>+</I> and <I>-</I> symbols can be replaced with
-Tk images. <BR>
-<CODE>set im1 [image create photo -file closefolder.gif]<BR>
-set im2 [image create photo -file downarrow.gif]<BR>
-.h button configure $id -images "$im1 $im2" \<BR>
- -openrelief raised -closerelief raised<BR>
-</CODE><P>Entries can contain an arbitrary number of <I>data fields</I>. Data fields are
-name-value pairs. Both the value and name are strings. The entry's <B>-data</B> option
-lets you set data fields. <BR>
-<CODE>.h entry configure $id -data {mode 0666 group users}<BR>
-</CODE><P>The <B>-data</B> takes a list of name-value pairs. <P>
-You can display these data fields
-as <I>columns</I> in the <B>treeview</B> widget. You can create and configure columns
-with the <B>column</B> operation. For example, to add a new column to the widget,
-use the <B>column insert</B> operation. The last argument is the name of the data
-field that you want to display. <BR>
-<CODE>.h column insert end "mode"<BR>
-</CODE><P>The column title is displayed at the top of the column. By default, it's
-is the field name. You can override this using the column's <B>-text</B> option.
-<BR>
-<CODE>.h column insert end "mode" -text "File Permissions"<BR>
-</CODE><P>Columns have several configuration options. The <B>column configure</B> operation
-lets you query or modify column options. <BR>
-<CODE>.h column configure "mode" -justify left<BR>
-</CODE><P>The <B>-justify</B> option says how the data is justified within in the column.
- The <B>-hide</B> option indicates whether the column is displayed. <BR>
-<CODE>.h column configure "mode" -hide yes<BR>
-</CODE><P>Entries can be selected by clicking on the mouse. Selected entries are
-drawn using the colors specified by the <B>-selectforeground</B> and <B>-selectbackground</B>
-configuration options. The selection itself is managed by the <B>selection</B>
-operation. <BR>
-<CODE># Clear all selections<BR>
-.h selection clear 0 end<BR>
-# Select the root node<BR>
-.h selection set 0 <BR>
-</CODE><P>The <B>curselection</B> operation returns a list of ids of all the selected entries.
-<BR>
-<CODE>set ids [.h curselection]<BR>
-</CODE><P>You can use the <B>get</B> operation to convert the ids to their pathnames. <BR>
-<CODE>set names [eval .h get -full $ids]<BR>
-</CODE><P>If a treeview is exporting its selection (using the <B>-exportselection</B> option),
-then it will observe the standard X11 protocols for handling the selection.
- Treeview selections are available as type <B>STRING</B>; the value of the selection
-will be the pathnames of the selected entries, separated by newlines. <P>
-The
-<B>treeview</B> supports two modes of selection: <I>single</I> and <I>multiple</I>. In single
-select mode, only one entry can be selected at a time, while multiple select
-mode allows several entries to be selected. The mode is set by the widget's
-<B>-selectmode</B> option. <BR>
-<CODE>.h configure -selectmode "multiple"<BR>
-</CODE><P>You can be notified when the list of selected entries changes. The widget's
-<B>-selectcommand</B> specifies a Tcl procedure that is called whenever the selection
-changes. <BR>
-<CODE>proc SelectNotify { widget } {<BR>
- set ids [$widget curselection]<BR>
-}<BR>
-.h configure -selectcommand "SelectNotify .h"<BR>
-</CODE><P>The widget supports the standard Tk scrolling and scanning operations. The
-<B>treeview</B> can be both horizontally and vertically. You can attach scrollbars
-to the <B>treeview</B> the same way as the listbox or canvas widgets. <BR>
-<CODE>scrollbar .xbar -orient horizontal -command ".h xview"<BR>
-scrollbar .ybar -orient vertical -command ".h yview"<BR>
-.h configure -xscrollcommand ".xbar set" \<BR>
- -yscrollcommand ".ybar set"<BR>
-</CODE><P>There are three different modes of scrolling: <I>listbox</I>, <I>canvas</I>, and <I>hierbox</I>.
- In <I>listbox</I> mode, the last entry can always be scrolled to the top of the
-widget. In <I>hierbox</I> mode, the last entry is always drawn at the bottom of
-the widget. The scroll mode is set by the widget's <B>-selectmode</B> option. <BR>
-<CODE>.h configure -scrollmode "listbox"<BR>
-</CODE><P>Entries can be programmatically opened or closed using the <B>open</B> and <B>close</B>
-operations respectively. <BR>
-<CODE>.h open $id<BR>
-.h close $id<BR>
-</CODE><P>When an entry is opened, a Tcl procedure can be automatically invoked. The
-<B>-opencommand</B> option specifies this procedure. This procedure can lazily
-insert entries as needed. <BR>
-<CODE>proc AddEntries { dir } {<BR>
- eval .h insert end [glob -nocomplain $dir/*] <BR>
-}<BR>
-.h configure -opencommand "AddEntries %P"<BR>
-</CODE><P>Now when an entry is opened, the procedure <I>AddEntries</I> is called and adds
-children to the entry. Before the command is invoked, special "%" substitutions
-(like <B>bind</B>) are performed. Above, <I>%P</I> is translated to the pathname of the
-entry. <P>
-The same feature exists when an entry is closed. The <B>-closecommand</B>
-option specifies the procedure. <BR>
-<CODE>proc DeleteEntries { id } {<BR>
- .h entry delete $id 0 end<BR>
-}<BR>
-.h configure -closecommand "DeleteEntries %#"<BR>
-</CODE><P>When an entry is closed, the procedure <I>DeleteEntries</I> is called and deletes
-the entry's children using the <B>entry delete</B> operation (<I>%#</I> is the id of entry).
-
-<H2><A NAME="sect23" HREF="#toc23">Keywords</A></H2>
-treeview, widget <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Tree Data Object</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Syntax</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">IDs and Tags</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Special Node IDs</A></LI>
-<LI><A NAME="toc8" HREF="#sect8">Data Fields</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">Entry Bindings</A></LI>
-<LI><A NAME="toc10" HREF="#sect10">Treeview Operations</A></LI>
-<LI><A NAME="toc11" HREF="#sect11">Treeview Options</A></LI>
-<LI><A NAME="toc12" HREF="#sect12">Entry Options</A></LI>
-<LI><A NAME="toc13" HREF="#sect13">Button Options</A></LI>
-<LI><A NAME="toc14" HREF="#sect14">Column Options</A></LI>
-<LI><A NAME="toc15" HREF="#sect15">Text Editing Options</A></LI>
-<LI><A NAME="toc16" HREF="#sect16">Default Bindings</A></LI>
-<UL>
-<LI><A NAME="toc17" HREF="#sect17">Widget Bindings</A></LI>
-<LI><A NAME="toc18" HREF="#sect18">Button Bindings</A></LI>
-<LI><A NAME="toc19" HREF="#sect19">Entry Bindings</A></LI>
-<LI><A NAME="toc20" HREF="#sect20">Column Bindings</A></LI>
-<LI><A NAME="toc21" HREF="#sect21">Column Rule Bindings</A></LI>
-</UL>
-<LI><A NAME="toc22" HREF="#sect22">Example</A></LI>
-<LI><A NAME="toc23" HREF="#sect23">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/hiertable.html b/blt3.0.1/html/hiertable.html
deleted file mode 100644
index 7f56d0e..0000000
--- a/blt3.0.1/html/hiertable.html
+++ /dev/null
@@ -1,2331 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>treeview(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-treeview - Create and manipulate hierarchical
-table widgets
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>treeview</B> <I>pathName </I>?<I>options</I>?
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>treeview</B>
-widget displays a tree of data. It replaces both the <B>hiertable</B> and <B>hierbox</B>
-widgets. The <B>treeview</B> is 100% syntax compatible with the <B>hiertable</B> widget.
- The <B>hiertable</B> command is retained for sake of script-level compatibility.
- This widget obsoletes the <B>hierbox</B> widget. It does everything the old <B>hierbox</B>
-widget did, but also provides data sharing (via <I>tree data objects</I>) and
-the ability to tag nodes.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-The <B>treeview</B> widget displays hierarchical
-data. Data is represented as nodes in a general-ordered tree. Each node
-may have sub-nodes and these nodes can in turn has their own children. <P>
-A
-node is displayed as a row entry in the widget. Each entry has a text label
-and icon. When a node has children, its entry is drawn with a small button
-to the left of the label. Clicking the mouse over this button opens or
-closes the node. When a node is <I>open</I>, its children are exposed. When it
-is <I>closed</I>, the children and their descedants are hidden. The button is
-normally a <I>+</I> or <I>-</I> symbol (ala Windows Explorer), but can be replaced with
-a pair of Tk images (open and closed images). <P>
-If the node has data associated
-with it, they can be displayed in columns running vertically on either
-side the tree. You can control the color, font, etc of each entry. Any
-entry label or data field can be edited in-place.
-<H2><A NAME="sect4" HREF="#toc4">Tree Data Object</A></H2>
-The tree
-is not stored inside the widget but in a tree data object (see the <B>tree</B>
-command for a further explanation). Tree data objects can be shared among
-different clients, such as a <B>treeview</B> widget or the <B>tree</B> command. You can
-walk the tree and manage its data with the <B>tree</B> command tree, while displaying
-it with the <B>treeview</B> widget. Whenever the tree is updated, the <B>treeview</B>
-widget is automatically redrawn. <P>
-By default, the <B>treeview</B> widget creates
-its own tree object. The tree initially contains just a root node. But you
-can also display trees created by the <B>tree</B> command using the <B>-tree</B> configuration
-option. <B>Treeview</B> widgets can share the same tree object, possibly displaying
-different views of the same data. <P>
-A tree object has both a Tcl and C API.
- You can insert or delete nodes using <B>treeview</B> widget or <B>tree</B> command operations,
-but also from C code. For example, you can load the tree from your C code
-while still managing and displaying the tree from Tcl. The widget is automatically
-notified whenever the tree is modified via C or Tcl.
-<H2><A NAME="sect5" HREF="#toc5">Syntax</A></H2>
-<BR>
-<P>
-<CODE><B>treeview <I>pathName </I></B>?<I>option value</I>?...<BR>
-</CODE><P>The <B>treeview</B> command creates a new window <I>pathName</I> and makes it into a
-<B>treeview</B> widget. At the time this command is invoked, there must not exist
-a window named <I>pathName</I>, but <I>pathName</I>'s parent must exist. Additional options
-may be specified on the command line or in the option database to configure
-aspects of the widget such as its colors and font. See the <B>configure</B> operation
-below for the exact details about what <I>option</I> and <I>value</I> pairs are valid.
-<P>
-If successful, <B>treeview</B> returns the path name of the widget. It also creates
-a new Tcl command by the same name. You can use this command to invoke
-various operations that query or modify the widget. The general form is:
-<BR>
-<P>
-<CODE><I>pathName <I>operation</I></I> ?<I>arg</I>?...<BR>
-</CODE><P>Both <I>operation</I> and its arguments determine the exact behavior of the command.
- The operations available are described in the <FONT SIZE=-1><B>TREEVIEW OPERATIONS</B></FONT>
- section.
-
-<H2><A NAME="sect6" HREF="#toc6">IDs and Tags</A></H2>
-Nodes can be inserted into a tree using the <B>treeview</B> widget
- <BR>
-<CODE>blt::treeview .t<BR>
-set node [.t insert end root "one"]<BR>
-</CODE><P>or <B>tree</B> command. <BR>
-<CODE>set tree [blt::tree create]<BR>
-set node [$tree insert root "one"]<BR>
-</CODE><P>In both cases, a number identifying the node is returned (the value of
-<I>$node</I>). This serial number or <I>id</I> uniquely identifies the node. Please note
-that you can't infer a location or position of a node from its id. The only
-exception is that the root node is always id <I>0</I>. Since nodes may have the
-same labels or be moved within the tree, ids provide an convenient way
-to identify nodes. If a tree is shared, the ids will be the same regardless
-if you are using by the <B>treeview</B> widget or the <B>tree</B> command. Ids are recycled
-when the node deleted. <P>
-A node may also have any number of <I>tags</I> associated
-with it. A tag is just a string of characters, and it may take any form
-except that of an integer. For example, "<I>x123</I>" is valid, but "<I>123</I>" isn't.
- The same tag may be associated with many different nodes. This is typically
-done to associate a group of nodes. Many operations in the <B>treeview</B> widget
-take either node ids or tag names as arguments. Using a tag says to apply
-the operation to all nodes with that tag. <P>
-The tag <B>all</B> is implicitly associated
-with every node in the tree. It may be used to invoke operations on all
-the nodes in the tree. <P>
-Tags may be shared, just like trees, between clients.
- For example, you can use the tags created by the <B>tree</B> command with <B>treeview</B>
-widgets.
-<H2><A NAME="sect7" HREF="#toc7">Special Node IDs</A></H2>
-There are also several special non-numeric ids.
-Special ids differ from tags in that they are always translated to their
-numeric equivalent. They also take precedence over tags. For example, you
-can't use a tag name that is a special id. These ids are specific to the
-<B>treeview</B> widget.
-<DL>
-
-<DT><B>active</B> </DT>
-<DD>The node where the mouse pointer is currently located.
-When a node is active, it is drawn using its active icon (see the <B>-activeicon</B>
-option). The <B>active</B> id is changed automatically by moving the mouse pointer
-over another node or by using the <B>entry activate</B> operation. Note that there
-can be only one active node at a time. </DD>
-
-<DT><B>anchor</B> </DT>
-<DD>The node representing the
-fixed end of the current selection. The anchor is set by the <B>selection
-anchor</B> operation. </DD>
-
-<DT><B>current</B> </DT>
-<DD>The node where the mouse pointer is currently
-located. But unlike <B>active</B>, this id changes while the selection is dragged.
- It is used to determine the current node during button drags. </DD>
-
-<DT><B>down</B> </DT>
-<DD>The
-next open node from the current focus. The <B>down</B> of the last open node is
-the same. </DD>
-
-<DT><B>end</B> </DT>
-<DD>The last open node (in depth-first order) on the tree. </DD>
-
-<DT><B>focus</B>
-</DT>
-<DD>The node that currently has focus. When a node has focus, it receives key
-events. To indicate focus, the node is drawn with a dotted line around
-its label. You can change the focus using the <B>focus</B> operation. </DD>
-
-<DT><B>last</B> </DT>
-<DD>The
-last open node from the current focus. But unlike <B>up</B>, when the focus is
-at root, <B>last</B> wraps around to the last open node in the tree. </DD>
-
-<DT><B>mark</B> </DT>
-<DD>The node
-representing the non-fixed end of the current selection. The mark is set
-by the <B>selection mark</B> operation. </DD>
-
-<DT><B>next</B> </DT>
-<DD>The next open node from the current
-focus. But unlike <B>down</B>, when the focus is on last open node, <B>next</B> wraps
-around to the root node. </DD>
-
-<DT><B>nextsibling</B> </DT>
-<DD>The next sibling from the node with
-the current focus. If the node is already the last sibling then it is the
-<B>nextsibling<B>. </DD>
-
-<DT><B>parent</B></B></B> </DT>
-<DD>The parent of the node with the current focus. The <B>parent</B>
-of the root is also the root. </DD>
-
-<DT><B>prevsibling</B> </DT>
-<DD>The previous sibling from the
-node with the current focus. If the node is already the first sibling then
-it is the <B>prevsibling<B>. </DD>
-
-<DT><B>root</B></B></B> </DT>
-<DD>The root node. You can also use id <I>0</I> to indicate
-the root. </DD>
-
-<DT><B>up</B> </DT>
-<DD>The last open node (in depth-first order) from the current focus.
-The <B>up</B> of the root node (i.e. the root has focus) is also the root. </DD>
-
-<DT><B>view.top</B>
-</DT>
-<DD>First node that's current visible in the widget. </DD>
-
-<DT><B>view.bottom</B> </DT>
-<DD>Last node that's
-current visible in the widget. </DD>
-
-<DT><I>path</I> </DT>
-<DD>Absolute path of a node. Path names
-refer to the node name, not their entry labels. Paths don't have to start
-with a separator (see the <B>-separator</B> configuration option), but component
-names must be separated by the designated separator. </DD>
-
-<DT><B>@<I>x<B>,<I>y</I></B></I></B> </DT>
-<DD>Indicates the
-node that covers the point in the treeview window specified by <I>x</I> and <I>y</I>
-(in pixel coordinates). If no part of the entryd covers that point, then
-the closest node to that point is used. </DD>
-</DL>
-<P>
-A node may be specified as an id
-or tag. If the specifier is an integer then it is assumed to refer to the
-single node with that id. If the specifier is not an integer, it's checked
-to see if it's a special id (such as focus). Otherwise, it's assumed to be
-tag. Some operations only operate on a single node at a time; if a tag
-refers to more than one node, then an error is generated.
-<H2><A NAME="sect8" HREF="#toc8">Data Fields</A></H2>
-A node
-in the tree can have <I>data fields</I>. A data field is a name-value pair, used
-to represent arbitrary data in the node. Nodes can contain different fields
-(they aren't required to contain the same fields). You can optionally display
-these fields in the <B>treeview</B> widget in columns running on either side of
-the displayed tree. A node's value for the field is drawn in the column
-along side its node in the hierarchy. Any node that doesn't have a specific
-field is left blank. Columns can be interactively resized, hidden, or,
-moved.
-<H2><A NAME="sect9" HREF="#toc9">Entry Bindings</A></H2>
-You can bind Tcl commands to be invoked when events
-occur on nodes (much like Tk canvas items). You can bind a node using its
-id or its <I>bindtags</I>. Bindtags are simply names that associate a binding
-with one or more nodes. There is a built-in tag <I>all</I> that all node entries
-automatically have.
-<H2><A NAME="sect10" HREF="#toc10">Treeview Operations</A></H2>
-The <B>treeview</B> operations are the invoked
-by specifying the widget's pathname, the operation, and any arguments that
-pertain to that operation. The general form is: <P>
-<BR>
-<CODE><I>pathName operation </I>?<I>arg arg ...</I>?<BR>
-<P>
-</CODE><P><I>Operation</I> and the <I>arg</I>s determine the exact behavior of the command. The
-following operation are available for <B>treeview</B> widgets:
-<DL>
-
-<DT><I>pathName <B>bbox</B></I> ?<B>-screen</B>?
-<I>tagOrId...</I> </DT>
-<DD>Returns a list of 4 numbers, representing a bounding box of around
-the specified entries. The entries is given by one or more <I>tagOrId</I> arguments.
- If the <B>-screen</B> flag is given, then the x-y coordinates of the bounding
-box are returned as screen coordinates, not virtual coordinates. Virtual
-coordinates start from <I>0</I> from the root node. The returned list contains
-the following values. <blockquote></DD>
-
-<DT><I>x</I> </DT>
-<DD>X-coordinate of the upper-left corner of the bounding
-box. </DD>
-
-<DT><I>y</I> </DT>
-<DD>Y-coordinate of the upper-left corner of the bounding box. </DD>
-
-<DT><I>width</I> </DT>
-<DD>Width
-of the bounding box. </DD>
-
-<DT><I>height</I> </DT>
-<DD>Height of the bounding box. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>bind</B></I> <I>tagName</I>
-?<I>sequence command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I> such that whenever the
-event sequence given by <I>sequence</I> occurs for a node with this tag, <I>command</I>
-will be invoked. The syntax is similar to the <B>bind</B> command except that
-it operates on <B>treeview</B> entries, rather than widgets. See the <B>bind</B> manual
-entry for complete details on <I>sequence</I> and the substitutions performed
-on <I>command</I> before invoking it. <P>
-If all arguments are specified then a
-new binding is created, replacing any existing binding for the same <I>sequence</I>
-and <I>tagName</I>. If the first character of <I>command</I> is <I>+</I> then <I>command</I> augments
-an existing binding rather than replacing it. If no <I>command</I> argument is
-provided then the command currently associated with <I>tagName</I> and <I>sequence</I>
-(it's an error occurs if there's no such binding) is returned. If both <I>command</I>
-and <I>sequence</I> are missing then a list of all the event sequences for which
-bindings have been defined for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>button <I>operation</I></B></I> ?<I>args</I>?
-</DT>
-<DD>This command is used to control the button selectors within a <B>treeview</B>
-widget. It has several forms, depending on <I>operation</I>: <blockquote></DD>
-
-<DT><I>pathName <B>button
-activate</B></I> <I>tagOrId</I> </DT>
-<DD>Designates the node given by <I>tagOrId</I> as active. When
-a node is active it's entry is drawn using its active icon (see the <B>-activeicon</B>
-option). Note that there can be only one active entry at a time. The special
-id <B>active</B> indicates the currently active node. </DD>
-
-<DT><I>pathName <B>button bind</B></I> <I>tagName</I>
-?<I>sequence command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I> such that whenever the
-event sequence given by <I>sequence</I> occurs for an button of a node entry with
-this tag, <I>command</I> will be invoked. The syntax is similar to the <B>bind</B> command
-except that it operates on <B>treeview</B> buttons, rather than widgets. See the
-<B>bind</B> manual entry for complete details on <I>sequence</I> and the substitutions
-performed on <I>command</I> before invoking it. <P>
-If all arguments are specified
-then a new binding is created, replacing any existing binding for the
-same <I>sequence</I> and <I>tagName</I>. If the first character of <I>command</I> is <I>+</I> then <I>command</I>
- augments an existing binding rather than replacing it. If no <I>command</I> argument
-is provided then the command currently associated with <I>tagName</I> and <I>sequence</I>
-(it's an error occurs if there's no such binding) is returned. If both <I>command</I>
-and <I>sequence</I> are missing then a list of all the event sequences for which
-bindings have been defined for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>button cget</B></I> <I>option</I> </DT>
-<DD>Returns
-the current value of the configuration option given by <I>option</I>. <I>Option</I> may
-have any of the values accepted by the <B>configure</B> operation described below.
-</DD>
-
-<DT><I>pathName <B>button configure</B></I> ?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify
-the configuration options of the widget. If no <I>option</I> is specified, returns
-a list describing all of the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B>
-for information on the format of this list). If <I>option</I> is specified with
-no <I>value</I>, then the command returns a list describing the one named option
-(this list will be identical to the corresponding sublist of the value
-returned if no <I>option</I> is specified). If one or more <I>option-value</I> pairs are
-specified, then the command modifies the given widget option(s) to have
-the given value(s); in this case the command returns an empty string. <I>Option</I>
-and <I>value</I> are described in the section <FONT SIZE=-1><B>BUTTON OPTIONS</B></FONT>
- below. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>cget</B></I> <I>option</I> </DT>
-<DD>Returns the current value of the configuration option given
-by <I>option</I>. <I>Option</I> may have any of the values accepted by the <B>configure</B> operation
-described below. </DD>
-
-<DT><I>pathName <B>close </B></I>?<B>-recurse</B>? <I>tagOrId...</I> </DT>
-<DD>Closes the node specified
-by <I>tagOrId</I>. In addition, if a Tcl script was specified by the <B>-closecommand</B>
-option, it is invoked. If the node is already closed, this command has
-no effect. If the <B>-recurse</B> flag is present, each child node is recursively
-closed. </DD>
-
-<DT><I>pathName <B>column <I>operation</I></B></I> ?<I>args</I>? </DT>
-<DD>The following operations are available
-for treeview columns. <blockquote></DD>
-
-<DT><I>pathName <B>column activate</B></I> <I>column</I> </DT>
-<DD>Sets the active column
-to <I>column</I>. <I>Column</I> is the name of a column in the widget. When a column is
-active, it's drawn using its <B>-activetitlebackground</B> and <B>-activetitleforeground</B>
-options. If <I>column</I> is the <I>""</I>, then no column will be active. If no column
-argument is provided, then the name of the currently active column is returned.
-</DD>
-
-<DT><I>pathName <B>column cget</B></I> <I>name</I> <I>option</I> </DT>
-<DD>Returns the current value of the column
-configuration option given by <I>option</I> for <I>name</I>. <I>Name</I> is the name of column
-that corresponds to a data field. <I>Option</I> may have any of the values accepted
-by the <B>configure</B> operation described below. </DD>
-
-<DT><I>pathName <B>column configure</B></I> <I>name</I>
-?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify the configuration options
-of the column designated by <I>name</I>. <I>Name</I> is the name of the column corresponding
-to a data field. If no <I>option</I> is specified, returns a list describing all
-of the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for information
-on the format of this list). If <I>option</I> is specified with no <I>value</I>, then
-the command returns a list describing the one named option (this list will
-be identical to the corresponding sublist of the value returned if no <I>option</I>
-is specified). If one or more <I>option-value</I> pairs are specified, then the
-command modifies the given widget option(s) to have the given value(s);
- in this case the command returns an empty string. <I>Option</I> and <I>value</I> are
-described in the section <FONT SIZE=-1><B>COLUMN OPTIONS</B></FONT>
- below. </DD>
-
-<DT><I>pathName <B>column delete</B></I> <I>field</I>
-?<I>field</I>...? </DT>
-<DD>Deletes one of more columns designated by <I>field</I>. Note that this
-does not delete the data fields themselves. </DD>
-
-<DT><I>pathName <B>column insert</B></I> <I>position</I>
-<I>field</I> ?<I>options</I>...? </DT>
-<DD>Inserts one of more columns designated by <I>field</I>. A column
-displays each node's data field by the same name. If the node doesn't have
-the given field, the cell is left blank. <I>Position</I> indicates where in the
-list of columns to add the new column. It may be either a number or <I>end</I>.
- </DD>
-
-<DT><I>pathName <B>column invoke</B></I> <I>field</I> </DT>
-<DD>Invokes the Tcl command associated with the
-column <I>field</I>, if there is one (using the column's <B>-command</B> option). The
-command is ignored if the column's <B>-state</B> option set to <I>disabled</I>. </DD>
-
-<DT><I>pathName
-<B>column move <I>name</I></B></I> <I>dest</I> </DT>
-<DD>Moves the column <I>name</I> to the destination position.
- <I>Dest</I> is the name of another column or a screen position in the form <I>@<I>x<I>,<I>y</I></I></I></I>.
-</DD>
-
-<DT><I>pathName <B>column names</B></I> </DT>
-<DD>Returns a list of the names of all columns in the
-widget. The list is ordered as the columns are drawn from left-to-right. </DD>
-
-<DT><I>pathName
-<B>column nearest</B></I> <I>x</I> ?<I>y</I>? </DT>
-<DD>Returns the name of the column closest to the given
-X-Y screen coordinate. If you provide a <I>y</I> argument (it's optional), a name
-is returned only when if the point is over a column's title. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>configure</B></I>
-?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify the configuration options
-of the widget. If no <I>option</I> is specified, returns a list describing all
-of the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for information
-on the format of this list). If <I>option</I> is specified with no <I>value</I>, then
-the command returns a list describing the one named option (this list will
-be identical to the corresponding sublist of the value returned if no <I>option</I>
-is specified). If one or more <I>option-value</I> pairs are specified, then the
-command modifies the given widget option(s) to have the given value(s);
- in this case the command returns an empty string. <I>Option</I> and <I>value</I> are
-described in the section <FONT SIZE=-1><B>TREEVIEW OPTIONS</B></FONT>
- below. </DD>
-
-<DT><I>pathName <B>curselection</B></I>
-</DT>
-<DD>Returns a list containing the ids of all of the entries that are currently
-selected. If there are no entries selected, then the empty string is returned.
-</DD>
-
-<DT><I>pathName <B>delete <I>tagOrId</I></B></I>... </DT>
-<DD>Deletes one or more entries given by <I>tagOrId</I> and
-its children. </DD>
-
-<DT><I>pathName <B>entry <I>operation</I></B></I> ?<I>args</I>? </DT>
-<DD>The following operations are
-available for treeview entries. <blockquote></DD>
-
-<DT><I>pathName <B>entry activate</B></I> <I>tagOrId</I> </DT>
-<DD>Sets the
-active entry to the one specified by <I>tagOrId</I>. When an entry is active
-it is drawn using its active icon (see the <B>-activeicon</B> option). Note that
-there can be only one active node at a time. The special id of the currently
-active node is <B>active</B>. </DD>
-
-<DT><I>pathName <B>entry cget</B></I> <I>option</I> </DT>
-<DD>Returns the current value
-of the configuration option given by <I>option</I>. <I>Option</I> may have any of the
-values accepted by the <B>configure</B> operation described below. </DD>
-
-<DT><I>pathName <B>entry
-children</B></I> <I>tagOrId</I> ?<I>first</I>? ?<I>last</I>? </DT>
-<DD>Returns a list of ids for the given range
-of children of <I>tagOrId</I>. <I>TagOrId</I> is the id or tag of the node to be examined.
-If only a <I>first</I> argument is present, then the id of the that child at
-that numeric position is returned. If both <I>first</I> and <I>last</I> arguments are
-given, then the ids of all the children in that range are returned. Otherwise
-the ids of all children are returned. </DD>
-
-<DT><I>pathName <B>entry configure</B></I> ?<I>option</I>?
-?<I>value option value ...</I>? </DT>
-<DD>Query or modify the configuration options of the
-widget. If no <I>option</I> is specified, returns a list describing all of the
-available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for information on
-the format of this list). If <I>option</I> is specified with no <I>value</I>, then the
-command returns a list describing the one named option (this list will
-be identical to the corresponding sublist of the value returned if no <I>option</I>
-is specified). If one or more <I>option-value</I> pairs are specified, then the
-command modifies the given widget option(s) to have the given value(s);
- in this case the command returns an empty string. <I>Option</I> and <I>value</I> are
-described below: </DD>
-
-<DT><I>pathName <B>entry delete</B></I> <I>tagOrId</I> ?<I>first</I> ?<I>last</I>? </DT>
-<DD>Deletes the
-one or more children nodes of the parent <I>tagOrId</I>. If <I>first</I> and <I>last</I> arguments
-are present, they are positions designating a range of children nodes to
-be deleted. </DD>
-
-<DT><I>pathName <B>entry isbefore <I>tagOrId1</I></B></I> <I>tagOrId2</I> </DT>
-<DD>Returns 1 if <I>tagOrId1</I>
-is before <I>tagOrId2</I> and 0 otherwise. </DD>
-
-<DT><I>pathName <B>entry ishidden <I>tagOrId</I></B></I> </DT>
-<DD>Returns
-1 if the node is currently hidden and 0 otherwise. A node is also hidden
-if any of its ancestor nodes are closed or hidden. </DD>
-
-<DT><I>pathName <B>entry isopen
-<I>tagOrId</I></B></I> </DT>
-<DD>Returns 1 if the node is currently open and 0 otherwise. </DD>
-
-<DT><I>pathName
-<B>entry size</B></I> <B>-recurse</B> <I>tagOrId</I> </DT>
-<DD>Returns the number of children for parent node
-<I>tagOrId</I>. If the <B>-recurse</B> flag is set, the number of all its descendants
-is returned. The node itself is not counted. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>find </B></I>?<I>flags</I>? <I>first</I>
-<I>last</I> </DT>
-<DD>Finds for all entries matching the criteria given by <I>flags</I>. A list
-of ids for all matching nodes is returned. <I>First</I> and <I>last</I> are ids designating
-the range of the search in depth-first order. If <I>last</I> is before <I>first</I>, then
-nodes are searched in reverse order. The valid flags are: <blockquote></DD>
-
-<DT><B>-name<I> pattern</I></B>
-</DT>
-<DD>Specifies pattern to match against node names. </DD>
-
-<DT><B>-full<I> pattern</I></B> </DT>
-<DD>Specifies pattern
-to match against node pathnames. </DD>
-
-<DT><B>-<I>option<I> pattern</I></I></B> </DT>
-<DD>Specifies pattern to match
-against the node entry's configuration option. </DD>
-
-<DT><B>-exact</B> </DT>
-<DD>Patterns must match
-exactly. The is the default. </DD>
-
-<DT><B>-glob</B> </DT>
-<DD>Use global pattern matching. Matching
-is done in a fashion similar to that used by the C-shell. For the two
-strings to match, their contents must be identical except that the following
- special sequences may appear in pattern: <blockquote></DD>
-
-<DT><I>*</I> </DT>
-<DD>Matches any sequence of
- characters in string, including a null string. </DD>
-
-<DT><I>?</I> </DT>
-<DD>Matches any single character
-in string. </DD>
-
-<DT><I>[<I>chars<I>]</I></I></I> </DT>
-<DD>Matches any character in the set given by <I>chars</I>. If a
-sequence of the form <I>x</I>-<I>y</I> appears in <I>chars</I>, then any character between <I>x</I>
-and <I>y</I>, inclusive, will match. </DD>
-
-<DT><I>\<I>x</I></I> </DT>
-<DD>Matches the single character <I>x</I>. This
-provides a way of avoiding the special interpretation of the characters
-<I>*?[]\</I> in the pattern. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-regexp</B> </DT>
-<DD>Use regular expression pattern matching (i.e.
-the same as implemented by the <B>regexp</B> command). </DD>
-
-<DT><B>-nonmatching</B> </DT>
-<DD>Pick entries
-that don't match. </DD>
-
-<DT><B>-exec<I> string</I></B> </DT>
-<DD>Specifies a Tcl script to be invoked for
-each matching node. Percent substitutions are performed on <I>string</I> before
- it is executed. The following substitutions are valid: <blockquote></DD>
-
-<DT><I>%W</I> </DT>
-<DD>The pathname
-of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The full pathname of the node.
-</DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single percent. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-count<I> number</I></B> </DT>
-<DD>Stop
-searching after <I>number</I> matches. </DD>
-
-<DT><B>--</B> </DT>
-<DD>Indicates the end of flags. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>focus
-</B></I> <I>tagOrId</I> </DT>
-<DD>Sets the focus to the node given by <I>tagOrId</I>. When a node has focus,
-it can receive keyboard events. The special id <B>focus</B> designates the node
-that currently has focus. </DD>
-
-<DT><I>pathName <B>get </B></I>?<B>-full</B>? <I>tagOrId</I> <I>tagOrId</I>... </DT>
-<DD>Translates
-one or more ids to their node entry names. It returns a list of names
-for all the ids specified. If the <B>-full</B> flag is set, then the full pathnames
-are returned. </DD>
-
-<DT><I>pathName <B>hide </B></I>?<B>flags</B>? <I>tagOrId</I>... </DT>
-<DD>Hides all nodes matching the
-criteria given by <I>flags</I>. The search is performed recursively for each node
-given by <I>tagOrId</I>. The valid flags are described below: <blockquote></DD>
-
-<DT><B>-name<I> pattern</I></B> </DT>
-<DD>Specifies
-pattern to match against node names. </DD>
-
-<DT><B>-full<I> pattern</I></B> </DT>
-<DD>Specifies pattern to match
-against node pathnames. </DD>
-
-<DT><B>-<I>option<I> pattern</I></I></B> </DT>
-<DD>Specifies pattern to match against
-the node entry's configuration option. </DD>
-
-<DT><B>-exact</B> </DT>
-<DD>Match patterns exactly. The
-is the default. </DD>
-
-<DT><B>-glob</B> </DT>
-<DD>Use global pattern matching. Matching is done in a
-fashion similar to that used by the C-shell. For the two strings to match,
-their contents must be identical except that the following special sequences
- may appear in pattern: <blockquote></DD>
-
-<DT><I>*</I> </DT>
-<DD>Matches any sequence of characters in string,
-including a null string. </DD>
-
-<DT><I>?</I> </DT>
-<DD>Matches any single character in string. </DD>
-
-<DT><I>[<I>chars<I>]</I></I></I>
-</DT>
-<DD>Matches any character in the set given by <I>chars</I>. If a sequence of the form
-<I>x</I>-<I>y</I> appears in <I>chars</I>, then any character between <I>x</I> and <I>y</I>, inclusive, will
-match. </DD>
-
-<DT><I>\<I>x</I></I> </DT>
-<DD>Matches the single character <I>x</I>. This provides a way of avoiding
- the special interpretation of the characters <I>*?[]\</I> in the pattern. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-regexp</B>
-</DT>
-<DD>Use regular expression pattern matching (i.e. the same as implemented by
-the <B>regexp</B> command). </DD>
-
-<DT><B>-nonmatching</B> </DT>
-<DD>Hide nodes that don't match. </DD>
-
-<DT><B>--</B> </DT>
-<DD>Indicates
-the end of flags. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>index </B></I>?<B>-at</B> <I>tagOrId</I>? <I>string</I> </DT>
-<DD>Returns the id of
-the node specified by <I>string</I>. <I>String</I> may be a tag or node id. Some special
-ids are normally relative to the node that has focus. The <B>-at</B> flag lets
-you select another node. </DD>
-
-<DT><I>pathName <B>insert </B></I>?<B>-at <I>tagOrId</I></B>? <I>position</I> <I>path</I> ?<I>options...</I>?
-?<I>path</I>? ?<I>options...</I>? </DT>
-<DD>Inserts one or more nodes at <I>position</I>. <I>Position</I> is the
-location (number or <I>end</I>) where the new nodes are added to the parent node.
- <I>Path</I> is the pathname of the new node. Pathnames can be formated either
-as a Tcl list (each element is a path component) or as a string separated
-by a special character sequence (using the <B>-separator</B> option). Pathnames
-are normally absolute, but the <B>-at</B> switch lets you select a relative starting
-point. Its value is the id of the starting node. <P>
-All ancestors of the
-new node must already exist, unless the <B>-autocreate</B> option is set. It is
-also an error if a node already exists, unless the <B>-allowduplicates</B> option
-is set. <P>
-<I>Option</I> and <I>value</I> may have any of the values accepted by the <B>entry
-configure</B> operation described in the <FONT SIZE=-1><B>ENTRY OPERATIONS</B></FONT>
- section below. This
-command returns a list of the ids of the new entries. </DD>
-
-<DT><I>pathName <B>move <I>tagOrId</I></B></I>
-<I>how</I> <I>destId</I> </DT>
-<DD>Moves the node given by <I>tagOrId</I> to the destination node. The
-node can not be an ancestor of the destination. <I>DestId</I> is the id of the
-destination node and can not be the root of the tree. In conjunction with
-<I>how</I>, it describes how the move is performed. <blockquote></DD>
-
-<DT><I>before</I> </DT>
-<DD>Moves the node before
-the destination node. </DD>
-
-<DT><I>after</I> </DT>
-<DD>Moves the node after the destination node. </DD>
-
-<DT><I>into</I>
-</DT>
-<DD>Moves the node to the end of the destination's list of children. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>nearest <I>x y</I></B></I> ?<I>varName</I>? </DT>
-<DD>Returns the id of the node entry closest to the given
-X-Y screen coordinate. The optional argument <I>varName</I> is the name of variable
-which is set to either <I>button</I> or <I>select</I> to indicate over what part of the
-node the coordinate lies. If the coordinate is not directly over any node,
-then <I>varName</I> will contain the empty string. </DD>
-
-<DT><I>pathName <B>open </B></I>?<B>-recurse</B>? <I>tagOrId...</I>
-</DT>
-<DD>Opens the one or more nodes specified by <I>tagOrId</I>. If a node is not already
-open, the Tcl script specified by the <B>-opencommand</B> option is invoked. If
-the <B>-recurse</B> flag is present, then each descendant is recursively opened.
- </DD>
-
-<DT><I>pathName <B>range</B></I> ?<B>-open</B>? <I>first last</I> </DT>
-<DD>Returns the ids in depth-first order
-of the nodes between the <I>first</I> and <I>last</I> ids. If the <B>-open</B> flag is present,
-it indicates to consider only open nodes. If <I>last</I> is before <I>first</I>, then
-the ids are returned in reverse order. </DD>
-
-<DT><I>pathName <B>scan</B></I> <I>option args</I> </DT>
-<DD>This command
-implements scanning. It has two forms, depending on <I>option</I>: <blockquote></DD>
-
-<DT><I>pathName <B>scan
-mark <I>x y</I></B></I> </DT>
-<DD>Records <I>x</I> and <I>y</I> and the current view in the treeview window;
-used in conjunction with later <B>scan dragto</B> commands. Typically this command
-is associated with a mouse button press in the widget. It returns an empty
-string. </DD>
-
-<DT><I>pathName <B>scan dragto <I>x y</I></B></I>. </DT>
-<DD>Computes the difference between its <I>x</I> and
-<I>y</I> arguments and the <I>x</I> and <I>y</I> arguments to the last <B>scan mark</B> command for
-the widget. It then adjusts the view by 10 times the difference in coordinates.
- This command is typically associated with mouse motion events in the widget,
-to produce the effect of dragging the list at high speed through the window.
- The return value is an empty string. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>see</B></I> ?<B>-anchor <I>anchor</I></B>? <I>tagOrId</I>
-</DT>
-<DD>Adjusts the view of entries so that the node given by <I>tagOrId</I> is visible
-in the widget window. It is an error if <B>tagOrId</B> is a tag that refers to
-more than one node. By default the node's entry is displayed in the middle
-of the window. This can changed using the <B>-anchor</B> flag. Its value is a Tk
-anchor position. </DD>
-
-<DT><I>pathName <B>selection <I>option arg</I></B></I> </DT>
-<DD>This command is used to adjust
-the selection within a <B>treeview</B> widget. It has several forms, depending
-on <I>option</I>: <blockquote></DD>
-
-<DT><I>pathName <B>selection anchor <I>tagOrId</I></B></I> </DT>
-<DD>Sets the selection anchor
-to the node given by <I>tagOrId</I>. If <I>tagOrId</I> refers to a non-existent node, then
-the closest node is used. The selection anchor is the end of the selection
-that is fixed while dragging out a selection with the mouse. The special
-id <B>anchor</B> may be used to refer to the anchor node. </DD>
-
-<DT><I>pathName <B>selection cancel</B></I>
-</DT>
-<DD>Clears the temporary selection of entries back to the current anchor. Temporary
-selections are created by the <B>selection mark</B> operation. </DD>
-
-<DT><I>pathName <B>selection
-clear <I>first </I></B></I>?<I>last</I>? </DT>
-<DD>Removes the entries between <I>first</I> and <I>last</I> (inclusive)
-from the selection. Both <I>first</I> and <I>last</I> are ids representing a range of
-entries. If <I>last</I> isn't given, then only <I>first</I> is deselected. Entries outside
-the selection are not affected. </DD>
-
-<DT><I>pathName <B>selection clearall</B></I> </DT>
-<DD>Clears the entire
-selection. </DD>
-
-<DT><I>pathName <B>selection mark <I>tagOrId</I></B></I> </DT>
-<DD>Sets the selection mark to
-the node given by <I>tagOrId</I>. This causes the range of entries between the
-anchor and the mark to be temporarily added to the selection. The selection
-mark is the end of the selection that is fixed while dragging out a selection
-with the mouse. The special id <B>mark</B> may be used to refer to the current
- mark node. If <I>tagOrId</I> refers to a non-existent node, then the mark is ignored.
-Resetting the mark will unselect the previous range. Setting the anchor
-finalizes the range. </DD>
-
-<DT><I>pathName <B>selection includes <I>tagOrId</I></B></I> </DT>
-<DD>Returns 1 if the
-node given by <I>tagOrId</I> is currently selected, 0 if it isn't. </DD>
-
-<DT><I>pathName <B>selection
-present</B></I> </DT>
-<DD>Returns 1 if any nodes are currently selected and 0 otherwise. </DD>
-
-<DT><I>pathName
-<B>selection set <I>first </I></B></I>?<I>last</I>? </DT>
-<DD>Selects all of the nodes in the range between
-<I>first</I> and <I>last</I>, inclusive, without affecting the selection state of nodes
-outside that range. </DD>
-
-<DT><I>pathName <B>selection toggle <I>first </I></B></I>?<I>last</I>? </DT>
-<DD>Selects/deselects
-nodes in the range between <I>first</I> and <I>last</I>, inclusive, from the selection.
-If a node is currently selected, it becomes deselected, and visa versa.
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>show </B></I>?<B>flags</B>? <I>tagOrId</I>... </DT>
-<DD>Exposes all nodes matching the criteria given
-by <I>flags</I>. This is the inverse of the <B>hide</B> operation. The search is performed
-recursively for each node given by <I>tagOrId</I>. The valid flags are described
-below: <blockquote></DD>
-
-<DT><B>-name<I> pattern</I></B> </DT>
-<DD>Specifies pattern to match against node names. </DD>
-
-<DT><B>-full<I>
-pattern</I></B> </DT>
-<DD>Specifies pattern to match against node pathnames. </DD>
-
-<DT><B>-<I>option<I> pattern</I></I></B>
-</DT>
-<DD>Specifies pattern to match against the entry's configuration option. </DD>
-
-<DT><B>-exact</B>
-</DT>
-<DD>Match patterns exactly. The is the default. </DD>
-
-<DT><B>-glob</B> </DT>
-<DD><B>-glob</B> Use global pattern
-matching. Matching is done in a fashion similar to that used by the C-shell.
- For the two strings to match, their contents must be identical except
-that the following special sequences may appear in pattern: <blockquote></DD>
-
-<DT><I>*</I> </DT>
-<DD>Matches
- any sequence of characters in string, including a null string. </DD>
-
-<DT><I>?</I> </DT>
-<DD>Matches
-any single character in string. </DD>
-
-<DT><I>[<I>chars<I>]</I></I></I> </DT>
-<DD>Matches any character in the set
-given by <I>chars</I>. If a sequence of the form <I>x</I>-<I>y</I> appears in <I>chars</I>, then any
-character between <I>x</I> and <I>y</I>, inclusive, will match. </DD>
-
-<DT><I>\<I>x</I></I> </DT>
-<DD>Matches the single
- character <I>x</I>. This provides a way of avoiding the special interpretation
-of the characters <I>*?[]\</I> in the pattern. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-regexp</B> </DT>
-<DD>Use regular expression pattern
-matching (i.e. the same as implemented by the <B>regexp</B> command). </DD>
-
-<DT><B>-nonmatching</B>
-</DT>
-<DD>Expose nodes that don't match. </DD>
-
-<DT><B>--</B> </DT>
-<DD>Indicates the end of flags. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>sort</B></I>
-?<I>operation</I>? <I>args...</I> </DT>
-<DD><blockquote></DD>
-
-<DT><I>pathName <B>sort auto</B></I> ?<I>boolean</I> </DT>
-<DD>Turns on/off automatic sorting
-of node entries. If <I>boolean</I> is true, entries will be automatically sorted
-as they are opened, closed, inserted, or deleted. If no <I>boolean</I> argument
-is provided, the current state is returned. </DD>
-
-<DT><I>pathName <B>sort cget</B></I> <I>option</I> </DT>
-<DD>Returns
-the current value of the configuration option given by <I>option</I>. <I>Option</I> may
-have any of the values accepted by the <B>configure</B> operation described below.
-</DD>
-
-<DT><I>pathName <B>sort configure</B></I> ?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify
-the sorting configuration options of the widget. If no <I>option</I> is specified,
-returns a list describing all of the available options for <I>pathName</I> (see
-<B>Tk_ConfigureInfo</B> for information on the format of this list). If <I>option</I>
-is specified with no <I>value</I>, then the command returns a list describing
-the one named option (this list will be identical to the corresponding
-sublist of the value returned if no <I>option</I> is specified). If one or more
-<I>option-value</I> pairs are specified, then the command modifies the given sorting
-option(s) to have the given value(s); in this case the command returns
-an empty string. <I>Option</I> and <I>value</I> are described below: <blockquote></DD>
-
-<DT><B>-column<I> string</I></B> </DT>
-<DD>Specifies
-the column to sort. Entries in the widget are rearranged according to this
-column. If <I>column</I> is <I>""</I> then no sort is performed. </DD>
-
-<DT><B>-command<I> string</I></B> </DT>
-<DD>Specifies
-a Tcl procedure to be called when sorting nodes. The procedure is called
-with three arguments: the pathname of the widget and the fields of two
-entries. The procedure returns 1 if the first node is greater than the
-second, -1 is the second is greater, and 0 if equal. </DD>
-
-<DT><B>-decreasing<I> boolean</I></B>
-</DT>
-<DD>Indicates to sort in ascending/descending order. If <I>boolean</I> is true, then
-the entries as in descending order. The default is <I>no</I>. </DD>
-
-<DT><B>-mode<I> string</I></B> </DT>
-<DD>Specifies
-how to compare entries when sorting. <I>String</I> may be one of the following:
-<blockquote></DD>
-
-<DT><I>ascii</I> </DT>
-<DD>Use string comparison based upon the ASCII collation order. </DD>
-
-<DT><I>dictionary</I>
- </DT>
-<DD>Use dictionary-style comparison. This is the same as <I>ascii</I> except (a) case
-is ignored except as a tie-breaker and (b) if two strings contain embedded
-numbers, the numbers compare as integers, not characters. For example,
-"bigBoy" sorts between "bigbang" and "bigboy", and "x10y" sorts between
-"x9y" and "x11y". </DD>
-
-<DT><I>integer</I> </DT>
-<DD>Compares fields as integers. </DD>
-
-<DT><I>real</I> </DT>
-<DD>Compares fields
-as floating point numbers. </DD>
-
-<DT><I>command</I> </DT>
-<DD>Use the Tcl proc specified by the <B>-command</B>
-option to compare entries when sorting. If no command is specified, the
-sort reverts to <I>ascii</I> sorting. </DD>
-</DL>
-</blockquote>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>sort once</B></I> ?<I>flags</I>? <I>tagOrId...</I> </DT>
-<DD>Sorts
-the children for each entries specified by <I>tagOrId</I>. By default, entries
-are sorted by name, but you can specify a Tcl proc to do your own comparisons.
-<blockquote></DD>
-
-<DT><B>-recurse</B> </DT>
-<DD>Recursively sort the entire branch, not just the children. </DD>
-</DL>
-</blockquote>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>tag <I>operation args</I></B></I> </DT>
-<DD>Tags are a general means of selecting and marking nodes
-in the tree. A tag is just a string of characters, and it may take any form
-except that of an integer. The same tag may be associated with many different
-nodes. <P>
-Both <I>operation</I> and its arguments determine the exact behavior of
-the command. The operations available for tags are listed below. <blockquote></DD>
-
-<DT><I>pathName</I>
-<B>tag add</B> <I>string</I> <I>id</I>... </DT>
-<DD>Adds the tag <I>string</I> to one of more entries. </DD>
-
-<DT><I>pathName</I> <B>tag
-delete</B> <I>string</I> <I>id</I>... </DT>
-<DD>Deletes the tag <I>string</I> from one or more entries. </DD>
-
-<DT><I>pathName</I>
-<B>tag forget</B> <I>string</I> </DT>
-<DD>Removes the tag <I>string</I> from all entries. It's not an error
-if no entries are tagged as <I>string</I>. </DD>
-
-<DT><I>pathName</I> <B>tag names</B> ?<I>id</I>? </DT>
-<DD>Returns a list
-of tags used. If an <I>id</I> argument is present, only those tags used by the
-node designated by <I>id</I> are returned. </DD>
-
-<DT><I>pathName</I> <B>tag nodes</B> <I>string</I> </DT>
-<DD>Returns a
-list of ids that have the tag <I>string</I>. If no node is tagged as <I>string</I>, then
-an empty string is returned. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>text <I>operation</I></B></I> ?<I>args</I>? </DT>
-<DD>This operation
-is used to provide text editing for cells (data fields in a column) or
-entry labels. It has several forms, depending on <I>operation</I>: <blockquote></DD>
-
-<DT><I>pathName <B>text
-apply</B></I> </DT>
-<DD>Applies the edited buffer, replacing the entry label or data field.
-The edit window is hidden. </DD>
-
-<DT><I>pathName <B>text cancel</B></I> </DT>
-<DD>Cancels the editing operation,
-reverting the entry label or data value back to the previous value. The
-edit window is hidden. </DD>
-
-<DT><I>pathName <B>text cget<I> value</I></B></I> </DT>
-<DD>Returns the current value
-of the configuration option given by <I>option</I>. <I>Option</I> may have any of the
-values accepted by the <B>configure</B> operation described below. </DD>
-
-<DT><I>pathName <B>text
-configure</B></I> ?<I>option value</I>? </DT>
-<DD>Query or modify the configuration options of the
-edit window. If no <I>option</I> is specified, returns a list describing all of
-the available options (see <B>Tk_ConfigureInfo</B> for information on the format
-of this list). If <I>option</I> is specified with no <I>value</I>, then the command returns
-a list describing the one named option (this list will be identical to
-the corresponding sublist of the value returned if no <I>option</I> is specified).
- If one or more <I>option-value</I> pairs are specified, then the command modifies
-the given widget option(s) to have the given value(s); in this case the
-command returns an empty string. <I>Option</I> and <I>value</I> are described in the section
- <FONT SIZE=-1><B>TEXT EDITING OPTIONS</B></FONT>
- below. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>text delete<I> first last</I></B></I> </DT>
-<DD>Deletes the
-characters in the edit buffer between the two given character positions.
- </DD>
-
-<DT><I>pathName <B>text get</B></I> ?<I>-root</I>? <I>x y</I> </DT>
-<DD></DD>
-
-<DT><I>pathName <B>text icursor<I> index</I></B></I> </DT>
-<DD></DD>
-
-<DT><I>pathName <B>text
-index<I> index</I></B></I> </DT>
-<DD>Returns the text index of given <I>index</I>. </DD>
-
-<DT><I>pathName <B>text insert<I>
-index string</I></B></I> </DT>
-<DD>Insert the text string <I>string</I> into the edit buffer at the
-index <I>index</I>. For example, the index 0 will prepend the buffer. </DD>
-
-<DT><I>pathName
-<B>text selection<I> args</I></B></I> </DT>
-<DD>This operation controls the selection of the editing
-window. Note that this differs from the selection of entries. It has the
-following forms: <blockquote></DD>
-
-<DT><I>pathName <B>text selection adjust<I> index</I></B></I> </DT>
-<DD>Adjusts either the
-first or last index of the selection. </DD>
-
-<DT><I>pathName <B>text selection clear</B></I> </DT>
-<DD>Clears
-the selection. </DD>
-
-<DT><I>pathName <B>text selection from<I> index</I></B></I> </DT>
-<DD>Sets the anchor of the
-selection. </DD>
-
-<DT><I>pathName <B>text selection present</B></I> </DT>
-<DD>Indicates if a selection is present.
-</DD>
-
-<DT><I>pathName <B>text selection range<I> start end</I></B></I> </DT>
-<DD>Sets both the anchor and mark of
-the selection. </DD>
-
-<DT><I>pathName <B>text selection to<I> index</I></B></I> </DT>
-<DD>Sets the unanchored end
-(mark) of the selection. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>toggle <I>tagOrId</I></B></I> </DT>
-<DD>Opens or closes the node
-given by <I>tagOrId</I>. If the corresponding <B>-opencommand</B> or <B>-closecommand</B> option
-is set, then that command is also invoked. </DD>
-
-<DT><I>pathName <B>xview <I>args</I></B></I> </DT>
-<DD>This command
-is used to query and change the horizontal position of the information
-in the widget's window. It can take any of the following forms: <blockquote></DD>
-
-<DT><I>pathName
-<B>xview</B></I> </DT>
-<DD>Returns a list containing two elements. Each element is a real fraction
-between 0 and 1; together they describe the horizontal span that is visible
-in the window. For example, if the first element is .2 and the second element
-is .6, 20% of the <B>treeview</B> widget's text is off-screen to the left, the middle
-40% is visible in the window, and 40% of the text is off-screen to the right.
-These are the same values passed to scrollbars via the <B>-xscrollcommand</B> option.
-</DD>
-
-<DT><I>pathName <B>xview</B></I> <I>tagOrId</I> </DT>
-<DD>Adjusts the view in the window so that the character
-position given by <I>tagOrId</I> is displayed at the left edge of the window. Character
-positions are defined by the width of the character <B>0</B>. </DD>
-
-<DT><I>pathName <B>xview moveto<I>
-fraction</I></B></I> </DT>
-<DD>Adjusts the view in the window so that <I>fraction</I> of the total width
-of the <B>treeview</B> widget's text is off-screen to the left. <I>fraction</I> must be
-a fraction between 0 and 1. </DD>
-
-<DT><I>pathName <B>xview scroll <I>number what</I></B></I> </DT>
-<DD>This command
-shifts the view in the window left or right according to <I>number</I> and <I>what</I>.
-<I>Number</I> must be an integer. <I>What</I> must be either <B>units</B> or <B>pages</B> or an abbreviation
-of one of these. If <I>what</I> is <B>units</B>, the view adjusts left or right by <I>number</I>
-character units (the width of the <B>0</B> character) on the display; if it is
-<B>pages</B> then the view adjusts by <I>number</I> screenfuls. If <I>number</I> is negative
-then characters farther to the left become visible; if it is positive
-then characters farther to the right become visible. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>yview <I>?args</I></B></I>?
-</DT>
-<DD>This command is used to query and change the vertical position of the text
-in the widget's window. It can take any of the following forms: <blockquote></DD>
-
-<DT><I>pathName
-<B>yview</B></I> </DT>
-<DD>Returns a list containing two elements, both of which are real fractions
-between 0 and 1. The first element gives the position of the node at the
-top of the window, relative to the widget as a whole (0.5 means it is halfway
-through the treeview window, for example). The second element gives the
-position of the node just after the last one in the window, relative to
-the widget as a whole. These are the same values passed to scrollbars via
-the <B>-yscrollcommand</B> option. </DD>
-
-<DT><I>pathName <B>yview</B></I> <I>tagOrId</I> </DT>
-<DD>Adjusts the view in the
-window so that the node given by <I>tagOrId</I> is displayed at the top of the
-window. </DD>
-
-<DT><I>pathName <B>yview moveto<I> fraction</I></B></I> </DT>
-<DD>Adjusts the view in the window so
-that the node given by <I>fraction</I> appears at the top of the window. <I>Fraction</I>
-is a fraction between 0 and 1; 0 indicates the first node, 0.33 indicates
-the node one-third the way through the <B>treeview</B> widget, and so on. </DD>
-
-<DT><I>pathName
-<B>yview scroll <I>number what</I></B></I> </DT>
-<DD>This command adjusts the view in the window up
-or down according to <I>number</I> and <I>what</I>. <I>Number</I> must be an integer. <I>What</I> must
-be either <B>units</B> or <B>pages</B>. If <I>what</I> is <B>units</B>, the view adjusts up or down
-by <I>number</I> lines; if it is <B>pages</B> then the view adjusts by <I>number</I> screenfuls.
-If <I>number</I> is negative then earlier nodes become visible; if it is positive
-then later nodes become visible. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect11" HREF="#toc11">Treeview Options</A></H2>
-In addition to the <B>configure</B>
-operation, widget configuration options may also be set by the Tk <B>option</B>
-command. The class resource name is <I>TreeView</I>. <BR>
-<CODE>option add *TreeView.Foreground white<BR>
-option add *TreeView.Background blue<BR>
-</CODE><P>The following widget options are available:
-<DL>
-
-<DT><B>-activebackground <I>color</I></B> </DT>
-<DD>Sets
-the background color for active entries. A node is active when the mouse
-passes over it's entry or using the <B>activate</B> operation. </DD>
-
-<DT><B>-activeforeground
-<I>color</I></B> </DT>
-<DD>Sets the foreground color of the active node. A node is active when
-the mouse passes over it's entry or using the <B>activate</B> operation. </DD>
-
-<DT><B>-activeicons
-<I>images</I></B> </DT>
-<DD>Specifies images to be displayed for an entry's icon when it is active.
-<I>Images</I> is a list of two Tk images: the first image is displayed when the
-node is open, the second when it is closed. </DD>
-
-<DT><B>-autocreate <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I>
-is true, automatically create missing ancestor nodes when inserting new
-nodes. Otherwise flag an error. The default is <I>no</I>. </DD>
-
-<DT><B>-allowduplicates <I>boolean</I></B>
-</DT>
-<DD>If <I>boolean</I> is true, allow nodes with duplicate pathnames when inserting
-new nodes. Otherwise flag an error. The default is <I>no</I>. </DD>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets
-the background color of the widget. The default is <I>white</I>. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B>
-</DT>
-<DD>Sets the width of the 3-D border around the outside edge of the widget.
-The <B>-relief</B> option determines if the border is to be drawn. The default
-is <I>2</I>. </DD>
-
-<DT><B>-closecommand <I>string</I></B> </DT>
-<DD>Specifies a Tcl script to be invoked when a node
-is closed. You can overrider this for individual entries using the entry's
-<B>-closecommand</B> option. The default is <I>""</I>. Percent substitutions are performed
-on <I>string</I> before it is executed. The following substitutions are valid:
-<blockquote></DD>
-
-<DT><I>%W</I> </DT>
-<DD>The pathname of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The full pathname
-of the node. </DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single percent. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-cursor
-<I>cursor</I></B> </DT>
-<DD>Specifies the widget's cursor. The default cursor is <I>""</I>. </DD>
-
-<DT><B>-dashes <I>number</I></B>
-</DT>
-<DD>Sets the dash style of the horizontal and vertical lines drawn connecting
- entries. <I>Number</I> is the length in pixels of the dashes and gaps in the line.
-If <I>number</I> is <I>0</I>, solid lines will be drawn. The default is <I>1</I> (dotted). </DD>
-
-<DT><B>-exportselection
-<I>boolean</I></B> </DT>
-<DD>Indicates if the selection is exported. If the widget is exporting
-its selection then it will observe the standard X11 protocols for handling
-the selection. Selections are available as type <B>STRING</B>; the value of the
-selection will be the label of the selected nodes, separated by newlines.
- The default is <I>no</I>. </DD>
-
-<DT><B>-flat <I>boolean</I></B> </DT>
-<DD>Indicates whether to display the tree as
-a flattened list. If <I>boolean</I> is true, then the hierarchy will be a list
-of full paths for the nodes. This option also has affect on sorting. See
-the <FONT SIZE=-1><B>SORT OPERATIONS</B></FONT>
- section for more information. The default is <I>no</I>. </DD>
-
-<DT><B>-focusdashes
-<I>dashList</I></B> </DT>
-<DD>Sets the dash style of the outline rectangle drawn around the
-entry label of the node that current has focus. <I>Number</I> is the length in
-pixels of the dashes and gaps in the line. If <I>number</I> is <I>0</I>, a solid line
-will be drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-focusforeground <I>color</I></B> </DT>
-<DD>Sets the color of
-the focus rectangle. The default is <I>black</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Specifies the
-font for entry labels. You can override this for individual entries with
-the entry's <B>-font</B> configuration option. The default is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>.
-</DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets the text color of entry labels. You can override
-this for individual entries with the entry's <B>-foreground</B> configuration option.
- The default is <I>black</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B> </DT>
-<DD>Specifies the requested height of
-widget. The default is <I>400</I>. </DD>
-
-<DT><B>-hideroot <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, it indicates
-that no entry for the root node should be displayed. The default is <I>no</I>.
-</DD>
-
-<DT><B>-highlightbackground <I>color</I></B> </DT>
-<DD>Specifies the normal color of the traversal
-highlight region when the widget does not have the input focus. </DD>
-
-<DT><B>-highlightcolor
-<I>color</I></B> </DT>
-<DD>Specifies the color of the traversal highlight rectangle when the
-widget has the input focus. The default is <I>black</I>. </DD>
-
-<DT><B>-highlightthickness <I>pixels</I></B>
-</DT>
-<DD>Specifies the width of the highlight rectangle indicating when the widget
-has input focus. The value may have any of the forms acceptable to <B>Tk_GetPixels</B>.
- If the value is zero, no focus highlight will be displayed. The default
-is <I>2</I>. </DD>
-
-<DT><B>-icons <I>images</I></B> </DT>
-<DD>Specifies images for the entry's icon. <I>Images</I> is a list
-of two Tk images: the first image is displayed when the node is open,
-the second when it is closed. </DD>
-
-<DT><B>-linecolor <I>color</I></B> </DT>
-<DD>Sets the color of the connecting
-lines drawn between entries. The default is <I>black</I>. </DD>
-
-<DT><B>-linespacing <I>pixels</I></B> </DT>
-<DD>Sets
-the number of pixels spacing between entries. The default is <I>0</I>. </DD>
-
-<DT><B>-linewidth
-<I>pixels</I></B> </DT>
-<DD>Set the width of the lines drawn connecting entries. If <I>pixels</I> is
-<I>0</I>, no vertical or horizontal lines are drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-opencommand
-<I>string</I></B> </DT>
-<DD>Specifies a Tcl script to be invoked when a node is open. You can
-override this for individual entries with the entry's <B>-opencommand</B> configuration
-option. The default is <I>""</I>. Percent substitutions are performed on <I>string</I>
-before it is executed. The following substitutions are valid: <blockquote></DD>
-
-<DT><I>%W</I> </DT>
-<DD>The pathname
-of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The full pathname of the node.
-</DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single percent. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies
-the 3-D effect for the widget. <I>Relief</I> specifies how the <B>treeview</B> widget
-should appear relative to widget it is packed into; for example, <I>raised</I>
-means the <B>treeview</B> widget should appear to protrude. The default is <I>sunken</I>.
-</DD>
-
-<DT><B>-scrollmode <I>mode</I></B> </DT>
-<DD>Specifies the style of scrolling to be used. The following
-styles are valid. This is the default is <I>hierbox</I>. <blockquote></DD>
-
-<DT><I>listbox</I> </DT>
-<DD>Like the <B>listbox</B>
-widget, the last entry can always be scrolled to the top of the widget
-window. This allows the scrollbar thumb to shrink as the last entry is
-scrolled upward. </DD>
-
-<DT><I>hierbox</I> </DT>
-<DD>Like the <B>hierbox</B> widget, the last entry can only
-be viewed at the bottom of the widget window. The scrollbar stays a constant
-size. </DD>
-
-<DT><I>canvas</I> </DT>
-<DD>Like the <B>canvas</B> widget, the entries are bound within the
-scrolling area. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-selectbackground <I>color</I></B> </DT>
-<DD>Sets the background color selected
-node entries. The default is <I>#ffffea</I>. </DD>
-
-<DT><B>-selectborderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of the raised 3-D border drawn around the labels of selected entries. The
-default is <I>0</I>. <B>-selectcommand <I>string</I></B> Specifies a Tcl script to invoked when
-the set of selected nodes changes. The default is <I>""</I>. </DD>
-
-<DT><B>-selectforeground <I>color<B>
-</B></I></B></DT>
-<DD>Sets the color of the labels of selected node entries. The default is <I>black</I>.
-</DD>
-
-<DT><B>-selectmode <I>mode</I></B> </DT>
-<DD>Specifies the selection mode. If <I>mode</I> is <I>single</I>, only one
-node can be selected at a time. If <I>multiple</I> more than one node can be selected.
-The default is <I>single</I>. </DD>
-
-<DT><B>-separator <I>string</I></B> </DT>
-<DD>Specifies the character sequence
-to use when spliting the path components. The separator may be several
-characters wide (such as "::") Consecutive separators in a pathname are
-treated as one. If <I>string</I> is the empty string, the pathnames are Tcl lists.
- Each element is a path component. The default is <I>""</I>. </DD>
-
-<DT><B>-showtitles <I>boolean</I></B>
-</DT>
-<DD>If <I>boolean</I> is false, column titles are not be displayed. The default is
-<I>yes</I>. </DD>
-
-<DT><B>-sortselection <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, nodes in the selection are
-ordered as they are currently displayed (depth-first or sorted), not in
-the order they were selected. The default is <I>no</I>. </DD>
-
-<DT><B>-takefocus</B> <I>focus</I> </DT>
-<DD>Provides
-information used when moving the focus from window to window via keyboard
-traversal (e.g., Tab and Shift-Tab). If <I>focus</I> is <I>0</I>, this means that this window
-should be skipped entirely during keyboard traversal. <I>1</I> means that the
-this window should always receive the input focus. An empty value means
-that the traversal scripts make the decision whether to focus on the window.
-The default is <I>"1"</I>. </DD>
-
-<DT><B>-trim <I>string</I></B> </DT>
-<DD>Specifies a string leading characters to
-trim from entry pathnames before parsing. This only makes sense if the
-<B>-separator</B> is also set. The default is <I>""</I>. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Sets the requested
-width of the widget. If <I>pixels</I> is 0, then the with is computed from the
-contents of the <B>treeview</B> widget. The default is <I>200</I>. </DD>
-
-<DT><B>-xscrollcommand <I>string</I></B>
-</DT>
-<DD>Specifies the prefix for a command used to communicate with horizontal
-scrollbars. Whenever the horizontal view in the widget's window changes,
-the widget will generate a Tcl command by concatenating the scroll command
-and two numbers. If this option is not specified, then no command will
-be executed. </DD>
-
-<DT><B>-xscrollincrement</B> <I>pixels</I> </DT>
-<DD>Sets the horizontal scrolling distance.
-The default is 20 pixels. </DD>
-
-<DT><B>-yscrollcommand <I>string</I></B> </DT>
-<DD>Specifies the prefix for
-a command used to communicate with vertical scrollbars. Whenever the vertical
-view in the widget's window changes, the widget will generate a Tcl command
-by concatenating the scroll command and two numbers. If this option is
-not specified, then no command will be executed. </DD>
-
-<DT><B>-yscrollincrement</B> <I>pixels</I>
-</DT>
-<DD>Sets the vertical scrolling distance. The default is 20 pixels. </DD>
-</DL>
-
-<H2><A NAME="sect12" HREF="#toc12">Entry Options</A></H2>
-Many
-widget configuration options have counterparts in entries. For example,
-there is a <B>-closecommand</B> configuration option for both widget itself and
-for individual entries. Options set at the widget level are global for
-all entries. If the entry configuration option is set, then it overrides
-the widget option. This is done to avoid wasting memory by replicated options.
- Most entries will have redundant options. <P>
-There is no resource class or
-name for entries.
-<DL>
-
-<DT><B>-activeicons <I>images</I></B> </DT>
-<DD>Specifies images to be displayed as
-the entry's icon when it is active. This overrides the global <B>-activeicons</B>
-configuration option for the specific entry. <I>Images</I> is a list of two Tk
-images: the first image is displayed when the node is open, the second
-when it is closed. </DD>
-
-<DT><B>-bindtags <I>tagList</I></B> </DT>
-<DD>Specifies the binding tags for nodes.
- <I>TagList</I> is a list of binding tag names. The tags and their order will
-determine how events are handled for nodes. Each tag in the list matching
-the current event sequence will have its Tcl command executed. The default
-value is <I>all</I>. </DD>
-
-<DT><B>-button <I>string</I></B> </DT>
-<DD>Indicates whether a button should be displayed
-on the left side of the node entry. <I>String</I> can be <I>yes</I>, <I>no</I>, or <I>auto</I>. If
-<I>auto</I>, then a button is automatically displayed if the node has children.
- This is the default. </DD>
-
-<DT><B>-closecommand <I>string</I></B> </DT>
-<DD>Specifies a Tcl script to be invoked
-when the node is closed. This overrides the global <B>-closecommand</B> option
-for this entry. The default is <I>""</I>. Percent substitutions are performed on
-<I>string</I> before it is executed. The following substitutions are valid: <blockquote></DD>
-
-<DT><I>%W</I>
-</DT>
-<DD>The pathname of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The full pathname
-of the node. </DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single percent. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-data
-<I>string</I></B> </DT>
-<DD>Sets data fields for the node. <I>String</I> is a list of name-value pairs
-to be set. The default is <I>""</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Sets the font for entry labels.
- This overrides the widget's <B>-font</B> option for this node. The default is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>.
-</DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets the text color of the entry label. This overrides
-the widget's <B>-foreground</B> configuration option. The default is <I>""</I>. </DD>
-
-<DT><B>-icons <I>images</I></B>
-</DT>
-<DD>Specifies images to be displayed for the entry's icon. This overrides the
-global <B>-icons</B> configuration option. <I>Images</I> is a list of two Tk images: the
-first image is displayed when the node is open, the second when it is closed.
-</DD>
-
-<DT><B>-label <I>string</I></B> </DT>
-<DD>Sets the text for the entry's label. If not set, this defaults
-to the name of the node. The default is <I>""</I>. </DD>
-
-<DT><B>-opencommand <I>string</I></B> </DT>
-<DD>Specifies
-a Tcl script to be invoked when the entry is opened. This overrides the
-widget's <B>-opencommand</B> option for this node. The default is <I>""</I>. Percent substitutions
-are performed on <I>string</I> before it is executed. The following substitutions
-are valid: <blockquote></DD>
-
-<DT><I>%W</I> </DT>
-<DD>The pathname of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The
-full pathname of the node. </DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single
-percent. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect13" HREF="#toc13">Button Options</A></H2>
-Button configuration options may also be set by the
-<B>option</B> command. The resource subclass is <I>Button</I>. The resource name is always
-<I>button</I>. <BR>
-<CODE>option add *TreeView.Button.Foreground white<BR>
-option add *TreeView.button.Background blue<BR>
-</CODE><P>The following are the configuration options available for buttons.
-<DL>
-
-<DT><B>-activebackground
-<I>color</I></B> </DT>
-<DD>Sets the background color of active buttons. A button is made active
-when the mouse passes over it or by the <B>button activate</B> operation. </DD>
-
-<DT><B>-activeforeground
-<I>color</I></B> </DT>
-<DD>Sets the foreground color of active buttons. A button is made active
-when the mouse passes over it or by the <B>button activate</B> operation. </DD>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Sets the background of the button. The default is <I>white</I>. </DD>
-
-<DT><B>-borderwidth
-<I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around the button. The <B>-relief</B> option
-determines if a border is to be drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-closerelief <I>relief</I></B>
-</DT>
-<DD>Specifies the 3-D effect for the closed button. <I>Relief</I> indicates how the
-button should appear relative to the widget; for example, <I>raised</I> means
-the button should appear to protrude. The default is <I>solid</I>. </DD>
-
-<DT><B>-cursor <I>cursor</I></B>
-</DT>
-<DD>Sets the widget's cursor. The default cursor is <I>""</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets
-the foreground color of buttons. The default is <I>black</I>. </DD>
-
-<DT><B>-images <I>images</I></B> </DT>
-<DD>Specifies
-images to be displayed for the button. <I>Images</I> is a list of two Tk images:
- the first image is displayed when the button is open, the second when
-it is closed. If the <I>images</I> is the empty string, then a plus/minus gadget
-is drawn. The default is <I>""</I>. </DD>
-
-<DT><B>-openrelief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect of
-the open button. <I>Relief</I> indicates how the button should appear relative
-to the widget; for example, <I>raised</I> means the button should appear to protrude.
- The default is <I>flat</I>. </DD>
-
-<DT><B>-size <I>pixels</I></B> </DT>
-<DD>Sets the requested size of the button.
- The default is <I>0</I>. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect14" HREF="#toc14">Column Options</A></H2>
-Column configuration options may also
-be set by the <B>option</B> command. The resource subclass is <I>Column</I>. The resource
-name is the name of the column. <BR>
-<CODE>option add *TreeView.Column.Foreground white<BR>
-option add *TreeView.treeView.Background blue<BR>
-</CODE><P>The following configuration options are available for columns.
-<DL>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Sets the background color of the column. This overrides the widget's
-<B>-background</B> option. The default is <I>white</I>. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of the 3-D border of the column. The <B>-relief</B> option determines if a border
-is to be drawn. The default is <I>0</I>. </DD>
-
-<DT><B>-edit <I>boolean</I></B> </DT>
-<DD>Indicates if the column's
-data fields can be edited. If <I>boolean</I> is false, the data fields in the
-column may not be edited. The default is <I>yes</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Specifies
-the foreground color of the column. You can override this for individual
-entries with the entry's <B>-foreground</B> option. The default is <I>black</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B>
- </DT>
-<DD>Sets the font for a column. You can override this for individual entries
-with the entry's <B>-font</B> option. The default is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>.
-</DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, the column is not displayed. The default
-is <I>yes</I>. </DD>
-
-<DT><B>-justify <I>justify</I></B> </DT>
-<DD>Specifies how the column data fields title should
-be justified within the column. This matters only when the column is wider
-than the data field to be display. <I>Justify</I> must be <I>left</I>, <I>right</I>, or <I>center</I>.
- The default is <I>left</I>. </DD>
-
-<DT><B>-pad <I>pad</I></B> </DT>
-<DD>Specifies how much padding for the left and
-right sides of the column. <I>Pad</I> is a list of one or two screen distances.
- If <I>pad</I> has two elements, the left side of the column is padded by the
-first distance and the right side by the second. If <I>pad</I> has just one distance,
-both the left and right sides are padded evenly. The default is <I>2</I>. </DD>
-
-<DT><B>-relief
-<I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect of the column. <I>Relief</I> specifies how the
-column should appear relative to the widget; for example, <I>raised</I> means
-the column should appear to protrude. The default is <I>flat</I>. </DD>
-
-<DT><B>-state <I>state</I></B> </DT>
-<DD>Sets
-the state of the column. If <I>state</I> is <I>disable</I> then the column title can not
-be activated nor invoked. The default is <I>normal</I>. </DD>
-
-<DT><B>-text <I>string</I></B> </DT>
-<DD>Sets the title
-for the column. The default is <I>""</I>. </DD>
-
-<DT><B>-titleforeground <I>color</I></B> </DT>
-<DD>Sets the foreground
-color of the column title. The default is <I>black</I>. </DD>
-
-<DT><B>-titleshadow <I>color</I></B> </DT>
-<DD>Sets
-the color of the drop shadow of the column title. The default is <I>""</I>. </DD>
-
-<DT><B>-width
-<I>pixels</I></B> </DT>
-<DD>Sets the requested width of the column. This overrides the computed
-with of the column. If <I>pixels</I> is 0, the width is computed as from the contents
-of the column. The default is <I>0</I>. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect15" HREF="#toc15">Text Editing Options</A></H2>
-Text edit window configuration
-options may also be set by the <B>option</B> command. The resource class is <I>TreeViewEditor</I>.
-The resource name is always <I>edit</I>. <BR>
-<CODE>option add *TreeViewEditor.Foreground white<BR>
-option add *edit.Background blue<BR>
-</CODE><P>The following are the configuration options available for the text editing
-window.
-<DL>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets the background of the text edit window. The
-default is <I>white</I>. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around
-the edit window. The <B>-relief</B> option determines if a border is to be drawn.
- The default is <I>1</I>. </DD>
-
-<DT><B>-exportselection <I>boolean</I></B> </DT>
-<DD>Indicates if the text selection
-is exported. If the edit window is exporting its selection then it will
-observe the standard X11 protocols for handling the selection. Selections
-are available as type <B>STRING</B>. The default is <I>no</I>. </DD>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies
-the 3-D effect of the edit window. <I>Relief</I> indicates how the background should
-appear relative to the edit window; for example, <I>raised</I> means the background
-should appear to protrude. The default is <I>solid</I>. </DD>
-
-<DT><B>-selectbackground <I>color</I></B>
-</DT>
-<DD>Sets the background of the selected text in the edit window. The default
-is <I>white</I>. </DD>
-
-<DT><B>-selectborderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around
-the selected text in the edit window. The <B>-selectrelief</B> option determines
-if a border is to be drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-selectforeground <I>color</I></B> </DT>
-<DD>Sets
-the foreground of the selected text in the edit window. The default is
-<I>white</I>. </DD>
-
-<DT><B>-selectrelief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect of the selected text
-in the edit window. <I>Relief</I> indicates how the text should appear relative
-to the edit window; for example, <I>raised</I> means the text should appear to
-protrude. The default is <I>flat</I>. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect16" HREF="#toc16">Default Bindings</A></H2>
-Tk automatically creates
-class bindings for treeviews that give them Motif-like behavior. Much of
-the behavior of a <B>treeview</B> widget is determined by its <B>-selectmode</B> option,
-which selects one of two ways of dealing with the selection. <P>
-If the selection
-mode is <B>single</B>, only one node can be selected at a time. Clicking button
-1 on an node selects it and deselects any other selected item. <P>
-If the selection
-mode is <B>multiple</B>, any number of entries may be selected at once, including
-discontiguous ranges. Clicking Control-Button-1 on a node entry toggles its
-selection state without affecting any other entries. Pressing Shift-Button-1
-on a node entry selects it, extends the selection.
-<OL>
-<LI>In <B>extended</B> mode, the
-selected range can be adjusted by pressing button 1 with the Shift key
-down: this modifies the selection to consist of the entries between the
-anchor and the entry under the mouse, inclusive. The un-anchored end of this
-new selection can also be dragged with the button down. </LI><LI>In <B>extended</B> mode,
-pressing button 1 with the Control key down starts a toggle operation:
-the anchor is set to the entry under the mouse, and its selection state
-is reversed. The selection state of other entries isn't changed. If the mouse
-is dragged with button 1 down, then the selection state of all entries
-between the anchor and the entry under the mouse is set to match that of
-the anchor entry; the selection state of all other entries remains what
-it was before the toggle operation began. </LI><LI>If the mouse leaves the treeview
-window with button 1 down, the window scrolls away from the mouse, making
-information visible that used to be off-screen on the side of the mouse.
-The scrolling continues until the mouse re-enters the window, the button
-is released, or the end of the hierarchy is reached. </LI><LI>Mouse button 2 may
-be used for scanning. If it is pressed and dragged over the <B>treeview</B> widget,
-the contents of the hierarchy drag at high speed in the direction the mouse
-moves. </LI><LI>If the Up or Down key is pressed, the location cursor (active entry)
-moves up or down one entry. If the selection mode is <B>browse</B> or <B>extended</B>
-then the new active entry is also selected and all other entries are deselected.
-In <B>extended</B> mode the new active entry becomes the selection anchor. </LI><LI>In <B>extended</B>
-mode, Shift-Up and Shift-Down move the location cursor (active entry) up
-or down one entry and also extend the selection to that entry in a fashion
-similar to dragging with mouse button 1. </LI><LI>The Left and Right keys scroll
-the <B>treeview</B> widget view left and right by the width of the character <B>0</B>.
-Control-Left and Control-Right scroll the <B>treeview</B> widget view left and right
-by the width of the window. Control-Prior and Control-Next also scroll left
-and right by the width of the window. </LI><LI>The Prior and Next keys scroll the
-<B>treeview</B> widget view up and down by one page (the height of the window).
-</LI><LI>The Home and End keys scroll the <B>treeview</B> widget horizontally to the left
-and right edges, respectively. </LI><LI>Control-Home sets the location cursor to the
-the first entry, selects that entry, and deselects everything else in
-the widget. </LI><LI>Control-End sets the location cursor to the the last entry,
-selects that entry, and deselects everything else in the widget. </LI><LI>In <B>extended</B>
-mode, Control-Shift-Home extends the selection to the first entry and Control-Shift-End
-extends the selection to the last entry. </LI><LI>In <B>multiple</B> mode, Control-Shift-Home
-moves the location cursor to the first entry and Control-Shift-End moves
-the location cursor to the last entry. </LI><LI>The space and Select keys make a
-selection at the location cursor (active entry) just as if mouse button
-1 had been pressed over this entry. </LI><LI>In <B>extended</B> mode, Control-Shift-space
-and Shift-Select extend the selection to the active entry just as if button
-1 had been pressed with the Shift key down. </LI><LI>In <B>extended</B> mode, the Escape
-key cancels the most recent selection and restores all the entries in the
-selected range to their previous selection state. </LI><LI>Control-slash selects everything
-in the widget, except in <B>single</B> and <B>browse</B> modes, in which case it selects
-the active entry and deselects everything else. </LI><LI>Control-backslash deselects
-everything in the widget, except in <B>browse</B> mode where it has no effect.
-</LI><LI>The F16 key (labelled Copy on many Sun workstations) or Meta-w copies the
-selection in the widget to the clipboard, if there is a selection. </LI>
-</OL>
-<P>
-The behavior
-of <B>treeview</B> widgets can be changed by defining new bindings for individual
-widgets or by redefining the class bindings.
-<H3><A NAME="sect17" HREF="#toc17">Widget Bindings</A></H3>
-In addition
-to the above behavior, the following additional behavior is defined by
-the default widget class (TreeView) bindings.
-<DL>
-
-<DT><I><ButtonPress-2></I></DT>
-<DD>Starts scanning.
- </DD>
-
-<DT><I><B2-Motion></I></DT>
-<DD>Adjusts the scan. </DD>
-
-<DT><I><ButtonRelease-2></I></DT>
-<DD>Stops scanning. </DD>
-
-<DT><I><B1-Leave></I></DT>
-<DD>Starts auto-scrolling.
-</DD>
-
-<DT><I><B1-Enter></I></DT>
-<DD>Starts auto-scrolling </DD>
-
-<DT><I><KeyPress-Up></I></DT>
-<DD>Moves the focus to the previous
-entry. </DD>
-
-<DT><I><KeyPress-Down></I></DT>
-<DD>Moves the focus to the next entry. </DD>
-
-<DT><I><Shift-KeyPress-Up></I></DT>
-<DD>Moves
-the focus to the previous sibling. </DD>
-
-<DT><I><Shift-KeyPress-Down></I></DT>
-<DD>Moves the focus to the
-next sibling. </DD>
-
-<DT><I><KeyPress-Prior></I></DT>
-<DD>Moves the focus to first entry. Closed or hidden
-entries are ignored. </DD>
-
-<DT><I><KeyPress-Next></I></DT>
-<DD>Move the focus to the last entry. Closed
-or hidden entries are ignored. </DD>
-
-<DT><I><KeyPress-Left></I></DT>
-<DD>Closes the entry. It is not an
-error if the entry has no children. </DD>
-
-<DT><I><KeyPress-Right></I></DT>
-<DD>Opens the entry, displaying
-its children. It is not an error if the entry has no children. </DD>
-
-<DT><I><KeyPress-space></I></DT>
-<DD>In
-"single" select mode this selects the entry. In "multiple" mode, it toggles
-the entry (if it was previous selected, it is not deselected). </DD>
-
-<DT><I><KeyRelease-space></I></DT>
-<DD>Turns
-off select mode. </DD>
-
-<DT><I><KeyPress-Return></I></DT>
-<DD>Sets the focus to the current entry. </DD>
-
-<DT><I><KeyRelease-Return></I></DT>
-<DD>Turns
-off select mode. </DD>
-
-<DT><I><KeyPress></I></DT>
-<DD>Moves to the next entry whose label starts with
-the letter typed. </DD>
-
-<DT><I><KeyPress-Home></I></DT>
-<DD>Moves the focus to first entry. Closed or
-hidden entries are ignored. </DD>
-
-<DT><I><KeyPress-End></I></DT>
-<DD>Move the focus to the last entry.
-Closed or hidden entries are ignored. </DD>
-
-<DT><I><KeyPress-F1></I></DT>
-<DD>Opens all entries. </DD>
-
-<DT><I><KeyPress-F2></I></DT>
-<DD>Closes
-all entries (except root). </DD>
-</DL>
-
-<H3><A NAME="sect18" HREF="#toc18">Button Bindings</A></H3>
-Buttons have bindings. There are
-associated with the "all" bindtag (see the entry's -bindtag option). You
-can use the <B>bind</B> operation to change them.
-<DL>
-
-<DT><I><Enter></I></DT>
-<DD>Highlights the button of
-the current entry. </DD>
-
-<DT><I><Leave></I></DT>
-<DD>Returns the button back to its normal state. </DD>
-
-<DT><I><ButtonRelease-1></I></DT>
-<DD>Adjust
-the view so that the current entry is visible. </DD>
-</DL>
-
-<H3><A NAME="sect19" HREF="#toc19">Entry Bindings</A></H3>
-Entries have
-default bindings. There are associated with the "all" bindtag (see the
-entry's -bindtag option). You can use the <B>bind</B> operation to modify them.
-<DL>
-
-<DT><I><Enter></I></DT>
-<DD>Highlights
-the current entry. </DD>
-
-<DT><I><Leave></I></DT>
-<DD>Returns the entry back to its normal state. </DD>
-
-<DT><I><ButtonPress-1></I></DT>
-<DD>Sets
-the selection anchor the current entry. </DD>
-
-<DT><I><Double-ButtonPress-1></I></DT>
-<DD>Toggles the selection
-of the current entry. </DD>
-
-<DT><I><B1-Motion></I></DT>
-<DD>For "multiple" mode only. Saves the current
-location of the pointer for auto-scrolling. Resets the selection mark.
-</DD>
-
-<DT><I><ButtonRelease-1></I></DT>
-<DD>For "multiple" mode only. Sets the selection anchor to the
- current entry. </DD>
-
-<DT><I><Shift-ButtonPress-1></I></DT>
-<DD>For "multiple" mode only. Extends the selection.
-</DD>
-
-<DT><I><Shift-Double-ButtonPress-1></I></DT>
-<DD>Place holder. Does nothing. </DD>
-
-<DT><I><Shift-B1-Motion></I></DT>
-<DD>Place holder.
-Does nothing. </DD>
-
-<DT><I><Shift-ButtonRelease-1></I></DT>
-<DD>Stop auto-scrolling. </DD>
-
-<DT><I><Control-ButtonPress-1></I></DT>
-<DD>For
-"multiple" mode only. Toggles and extends the selection. </DD>
-
-<DT><I><Control-Double-ButtonPress-1></I></DT>
-<DD>Place
-holder. Does nothing. </DD>
-
-<DT><I><Control-B1-Motion></I></DT>
-<DD>Place holder. Does nothing. </DD>
-
-<DT><I><Control-ButtonRelease-1></I></DT>
-<DD>Stops
-auto-scrolling. </DD>
-
-<DT><I><Control-Shift-ButtonPress-1></I></DT>
-<DD>??? </DD>
-
-<DT><I><Control-Shift-Double-ButtonPress-1></I></DT>
-<DD>Place
-holder. Does nothing. </DD>
-
-<DT><I><Control-Shift-B1-Motion></I></DT>
-<DD>Place holder. Does nothing. </DD>
-</DL>
-
-<H3><A NAME="sect20" HREF="#toc20">Column
-Bindings</A></H3>
-Columns have bindings too. They are associated with the column's
-"all" bindtag (see the column -bindtag option). You can use the <B>column bind</B>
-operation to change them.
-<DL>
-
-<DT><I><Enter></I></DT>
-<DD>Highlights the current column title. </DD>
-
-<DT><I><Leave></I></DT>
-<DD>Returns
-the column back to its normal state. </DD>
-
-<DT><I><ButtonRelease-1></I></DT>
-<DD>Invokes the command (see
-the column's -command option) if one if specified. </DD>
-</DL>
-
-<H3><A NAME="sect21" HREF="#toc21">Column Rule Bindings</A></H3>
-
-<DL>
-
-<DT><I><Enter></I></DT>
-<DD>Highlights
-the current and activates the ruler. </DD>
-
-<DT><I><Leave></I></DT>
-<DD>Returns the column back to its
-normal state. Deactivates the ruler. </DD>
-
-<DT><I><ButtonPress-1></I></DT>
-<DD>Sets the resize anchor for
-the column. </DD>
-
-<DT><I><B1-Motion></I></DT>
-<DD>Sets the resize mark for the column. </DD>
-
-<DT><I><ButtonRelease-1></I></DT>
-<DD>Adjust
-the size of the column, based upon the resize anchor and mark positions.
-</DD>
-</DL>
-
-<H2><A NAME="sect22" HREF="#toc22">Example</A></H2>
-The <B>treeview</B> command creates a new widget. <BR>
-<CODE>treeview .h -bg white<BR>
-</CODE><P>A new Tcl command <I>.h</I> is also created. This command can be used to query
-and modify the <B>treeview</B> widget. For example, to change the background
-color of the table to "green", you use the new command and the widget's
-<B>configure</B> operation. <BR>
-<CODE># Change the background color.<BR>
-.h configure -background "green"<BR>
-</CODE><P>By default, the <B>treeview</B> widget will automatically create a new tree object
-to contain the data. The name of the new tree is the pathname of the widget.
- Above, the new tree object name is ".h". But you can use the <B>-tree</B> option
-to specify the name of another tree. <BR>
-<CODE># View the tree "myTree".<BR>
-.h configure -tree "myTree"<BR>
-</CODE><P>When a new tree is created, it contains only a root node. The node is automatically
-opened. The id of the root node is always <I>0</I> (you can use also use the special
-id <I>root</I>). The <B>insert</B> operation lets you insert one or more new entries into
-the tree. The last argument is the node's <I>pathname</I>. <BR>
-<CODE># Create a new entry named "myEntry"<BR>
-set id [.h insert end "myEntry"]<BR>
-</CODE><P>This appends a new node named "myEntry". It will positioned as the last
-child of the root of the tree (using the position "end"). You can supply
-another position to order the node within its siblings. <BR>
-<CODE># Prepend "fred".<BR>
-set id [.h insert 0 "fred"]<BR>
-</CODE><P>Entry names do not need to be unique. By default, the node's label is its
-name. To supply a different text label, add the <B>-label</B> option. <BR>
-<CODE># Create a new node named "fred"<BR>
-set id [.h insert end "fred" -label "Fred Flintstone"]<BR>
-</CODE><P>The <B>insert</B> operation returns the id of the new node. You can also use the
-<B>index</B> operation to get this information. <BR>
-<CODE># Get the id of "fred"<BR>
-.h index "fred"<BR>
-</CODE><P>To insert a node somewhere other than root, use the <B>-at</B> switch. It takes
-the id of the node where the new child will be added. <BR>
-<CODE># Create a new node "barney" in "fred".<BR>
-.h insert -at $id end "barney" <BR>
-</CODE><P>A pathname describes the path to an entry in the hierarchy. It's a list
-of entry names that compose the path in the tree. Therefore, you can also
-add "barney" to "fred" as follows. <BR>
-<CODE># Create a new sub-entry of "fred"<BR>
-.h insert end "fred barney" <BR>
-</CODE><P>Every name in the list is ancestor of the next. All ancestors must already
-exist. That means that an entry "fred" is an ancestor of "barney" and must
-already exist. But you can use the <B>-autocreate</B> configuration option to force
-the creation of ancestor nodes. <BR>
-<CODE># Force the creation of ancestors.<BR>
-.h configure -autocreate yes <BR>
-.h insert end "fred barney wilma betty" <BR>
-</CODE><P>Sometimes the pathname is already separated by a character sequence rather
-than formed as a list. A file name is a good example of this. You can use
-the <B>-separator</B> option to specify a separator string to split the path into
-its components. Each pathname inserted is automatically split using the
-separator string as a separator. Multiple separators are treated as one.
-<BR>
-<CODE>.h configure -separator /<BR>
-.h insert end "/usr/local/tcl/bin" <BR>
-</CODE><P>If the path is prefixed by extraneous characters, you can automatically
-trim it off using the <B>-trim</B> option. It removed the string from the path
-before it is parsed. <BR>
-<CODE>.h configure -trim C:/windows -separator /<BR>
-.h insert end "C:/window/system" <BR>
-</CODE><P>You can insert more than one entry at a time with the <B>insert</B> operation.
- This can be much faster than looping over a list of names. <BR>
-<CODE># The slow way<BR>
-foreach f [glob $dir/*] {<BR>
- .h insert end $f<BR>
-}<BR>
-# The fast way<BR>
-eval .h insert end [glob $dir/*]<BR>
-</CODE><P>In this case, the <B>insert</B> operation will return a list of ids of the new
-entries. <P>
-You can delete entries with the <B>delete</B> operation. It takes one
-or more tags of ids as its argument. It deletes the entry and all its children.
-<BR>
-<CODE>.h delete $id<BR>
-</CODE><P>Entries have several configuration options. They control the appearance
-of the entry's icon and label. We have already seen the <B>-label</B> option that
-sets the entry's text label. The <B>entry configure</B> operation lets you set
-or modify an entry's configuration options. <BR>
-<CODE>.h entry configure $id -color red -font fixed<BR>
-</CODE><P>You can hide an entry and its children using the <B>-hide</B> option. <BR>
-<CODE>.h entry configure $id -hide yes<BR>
-</CODE><P>More that one entry can be configured at once. All entries specified are
-configured with the same options. <BR>
-<CODE>.h entry configure $i1 $i2 $i3 $i4 -color brown <BR>
-</CODE><P>An icon is displayed for each entry. It's a Tk image drawn to the left of
-the label. You can set the icon with the entry's <B>-icons</B> option. It takes
-a list of two image names: one to represent the open entry, another when
-it is closed. <BR>
-<CODE>set im1 [image create photo -file openfolder.gif]<BR>
-set im2 [image create photo -file closefolder.gif]<BR>
-.h entry configure $id -icons "$im1 $im2"<BR>
-</CODE><P>If <B>-icons</B> is set to the empty string, no icons are display. <P>
-If an entry has
-children, a button is displayed to the left of the icon. Clicking the mouse
-on this button opens or closes the sub-hierarchy. The button is normally
-a <I>+</I> or <I>-</I> symbol, but can be configured in a variety of ways using the <B>button
-configure</B> operation. For example, the <I>+</I> and <I>-</I> symbols can be replaced with
-Tk images. <BR>
-<CODE>set im1 [image create photo -file closefolder.gif]<BR>
-set im2 [image create photo -file downarrow.gif]<BR>
-.h button configure $id -images "$im1 $im2" \<BR>
- -openrelief raised -closerelief raised<BR>
-</CODE><P>Entries can contain an arbitrary number of <I>data fields</I>. Data fields are
-name-value pairs. Both the value and name are strings. The entry's <B>-data</B> option
-lets you set data fields. <BR>
-<CODE>.h entry configure $id -data {mode 0666 group users}<BR>
-</CODE><P>The <B>-data</B> takes a list of name-value pairs. <P>
-You can display these data fields
-as <I>columns</I> in the <B>treeview</B> widget. You can create and configure columns
-with the <B>column</B> operation. For example, to add a new column to the widget,
-use the <B>column insert</B> operation. The last argument is the name of the data
-field that you want to display. <BR>
-<CODE>.h column insert end "mode"<BR>
-</CODE><P>The column title is displayed at the top of the column. By default, it's
-is the field name. You can override this using the column's <B>-text</B> option.
-<BR>
-<CODE>.h column insert end "mode" -text "File Permissions"<BR>
-</CODE><P>Columns have several configuration options. The <B>column configure</B> operation
-lets you query or modify column options. <BR>
-<CODE>.h column configure "mode" -justify left<BR>
-</CODE><P>The <B>-justify</B> option says how the data is justified within in the column.
- The <B>-hide</B> option indicates whether the column is displayed. <BR>
-<CODE>.h column configure "mode" -hide yes<BR>
-</CODE><P>Entries can be selected by clicking on the mouse. Selected entries are
-drawn using the colors specified by the <B>-selectforeground</B> and <B>-selectbackground</B>
-configuration options. The selection itself is managed by the <B>selection</B>
-operation. <BR>
-<CODE># Clear all selections<BR>
-.h selection clear 0 end<BR>
-# Select the root node<BR>
-.h selection set 0 <BR>
-</CODE><P>The <B>curselection</B> operation returns a list of ids of all the selected entries.
-<BR>
-<CODE>set ids [.h curselection]<BR>
-</CODE><P>You can use the <B>get</B> operation to convert the ids to their pathnames. <BR>
-<CODE>set names [eval .h get -full $ids]<BR>
-</CODE><P>If a treeview is exporting its selection (using the <B>-exportselection</B> option),
-then it will observe the standard X11 protocols for handling the selection.
- Treeview selections are available as type <B>STRING</B>; the value of the selection
-will be the pathnames of the selected entries, separated by newlines. <P>
-The
-<B>treeview</B> supports two modes of selection: <I>single</I> and <I>multiple</I>. In single
-select mode, only one entry can be selected at a time, while multiple select
-mode allows several entries to be selected. The mode is set by the widget's
-<B>-selectmode</B> option. <BR>
-<CODE>.h configure -selectmode "multiple"<BR>
-</CODE><P>You can be notified when the list of selected entries changes. The widget's
-<B>-selectcommand</B> specifies a Tcl procedure that is called whenever the selection
-changes. <BR>
-<CODE>proc SelectNotify { widget } {<BR>
- set ids [$widget curselection]<BR>
-}<BR>
-.h configure -selectcommand "SelectNotify .h"<BR>
-</CODE><P>The widget supports the standard Tk scrolling and scanning operations. The
-<B>treeview</B> can be both horizontally and vertically. You can attach scrollbars
-to the <B>treeview</B> the same way as the listbox or canvas widgets. <BR>
-<CODE>scrollbar .xbar -orient horizontal -command ".h xview"<BR>
-scrollbar .ybar -orient vertical -command ".h yview"<BR>
-.h configure -xscrollcommand ".xbar set" \<BR>
- -yscrollcommand ".ybar set"<BR>
-</CODE><P>There are three different modes of scrolling: <I>listbox</I>, <I>canvas</I>, and <I>hierbox</I>.
- In <I>listbox</I> mode, the last entry can always be scrolled to the top of the
-widget. In <I>hierbox</I> mode, the last entry is always drawn at the bottom of
-the widget. The scroll mode is set by the widget's <B>-selectmode</B> option. <BR>
-<CODE>.h configure -scrollmode "listbox"<BR>
-</CODE><P>Entries can be programmatically opened or closed using the <B>open</B> and <B>close</B>
-operations respectively. <BR>
-<CODE>.h open $id<BR>
-.h close $id<BR>
-</CODE><P>When an entry is opened, a Tcl procedure can be automatically invoked. The
-<B>-opencommand</B> option specifies this procedure. This procedure can lazily
-insert entries as needed. <BR>
-<CODE>proc AddEntries { dir } {<BR>
- eval .h insert end [glob -nocomplain $dir/*] <BR>
-}<BR>
-.h configure -opencommand "AddEntries %P"<BR>
-</CODE><P>Now when an entry is opened, the procedure <I>AddEntries</I> is called and adds
-children to the entry. Before the command is invoked, special "%" substitutions
-(like <B>bind</B>) are performed. Above, <I>%P</I> is translated to the pathname of the
-entry. <P>
-The same feature exists when an entry is closed. The <B>-closecommand</B>
-option specifies the procedure. <BR>
-<CODE>proc DeleteEntries { id } {<BR>
- .h entry delete $id 0 end<BR>
-}<BR>
-.h configure -closecommand "DeleteEntries %#"<BR>
-</CODE><P>When an entry is closed, the procedure <I>DeleteEntries</I> is called and deletes
-the entry's children using the <B>entry delete</B> operation (<I>%#</I> is the id of entry).
-
-<H2><A NAME="sect23" HREF="#toc23">Keywords</A></H2>
-treeview, widget <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Tree Data Object</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Syntax</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">IDs and Tags</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Special Node IDs</A></LI>
-<LI><A NAME="toc8" HREF="#sect8">Data Fields</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">Entry Bindings</A></LI>
-<LI><A NAME="toc10" HREF="#sect10">Treeview Operations</A></LI>
-<LI><A NAME="toc11" HREF="#sect11">Treeview Options</A></LI>
-<LI><A NAME="toc12" HREF="#sect12">Entry Options</A></LI>
-<LI><A NAME="toc13" HREF="#sect13">Button Options</A></LI>
-<LI><A NAME="toc14" HREF="#sect14">Column Options</A></LI>
-<LI><A NAME="toc15" HREF="#sect15">Text Editing Options</A></LI>
-<LI><A NAME="toc16" HREF="#sect16">Default Bindings</A></LI>
-<UL>
-<LI><A NAME="toc17" HREF="#sect17">Widget Bindings</A></LI>
-<LI><A NAME="toc18" HREF="#sect18">Button Bindings</A></LI>
-<LI><A NAME="toc19" HREF="#sect19">Entry Bindings</A></LI>
-<LI><A NAME="toc20" HREF="#sect20">Column Bindings</A></LI>
-<LI><A NAME="toc21" HREF="#sect21">Column Rule Bindings</A></LI>
-</UL>
-<LI><A NAME="toc22" HREF="#sect22">Example</A></LI>
-<LI><A NAME="toc23" HREF="#sect23">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/htext.html b/blt3.0.1/html/htext.html
deleted file mode 100644
index 67cc439..0000000
--- a/blt3.0.1/html/htext.html
+++ /dev/null
@@ -1,397 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>htext(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-htext - Create and manipulate hypertext widgets
-
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>htext</B> <I>pathName </I>?<I>option value</I>?...
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-<P>
-The <B>htext</B> command creates
-a new window (given by the <I>pathName</I> argument) and makes it into a <B>htext</B>
-widget. Additional options, described above, may be specified on the command
-line or in the option database to configure aspects of the widget such
-as its color and font. At the time this command is invoked, there must
-not exist a window named <I>pathName</I>, but <I>pathName</I>'s parent must exist. The
-<B>htext</B> command returns its <I>pathName</I>. <P>
-The <B>htext</B> widget is hybrid of a non-editable
-text widget and a geometry manager (e.g. the packer). It displays text (optionally
-read from file) in a window. Text can be scrolled either horizontally or
-vertically using the <B>htext</B> window as a viewport. In addition, Tcl commands
-can be embedded into the text which are evaluated as the text is parsed.
- Text between special double characters (percent signs "%%") is immediately
-passed to the Tcl interpreter for evaluation. <P>
-Furthermore, any widget
-or widget hierarchy can be packed in-line and made to appear on the current
-line of the text. Widgets are packed using the <B>htext append</B> command. All
-widgets must be children of the <B>htext</B> window and must already exist before
-packing. Once a widget has been packed it cannot be moved to a different
-position within the text. Widgets can be resized but they will remain
-at the same position within the text. <P>
-Before a file or text string is parsed
-by the <B>htext</B> widget, all the widget's current children are destroyed. You
-can reload files or text without worrying about unmapping or destroying
-each child window beforehand. <P>
-Setting the either the <B>-filename</B> or <B>-text</B> configuration
-option will adjust the value of the other. If both options are set, the
-file takes precedence. When a new file is read using the <B>-filename</B> option,
-the value of the <B>-text</B> option is reset to the empty string. Likewise, when
-the <B>-text</B> option is set, the string representing the <B>-filename</B> option is
-cleared.
-<H2><A NAME="sect3" HREF="#toc3">File Format</A></H2>
-The format of <B>htext</B> text file is typically ASCII text.
- Text enclosed by special double characters (by default, percent signs
-'%%') is interpreted and executed as Tcl commands. The special character
- may be specified by the <B>-specialchar</B> option. In the following example of
-a <B>htext</B> file, a button widget is appended to the text between the words
-"<I>a</I>" and "<I>which</I>". The <I>pathName</I> of the <B>htext</B> widget is "<I>.ht</I>". <BR>
-<CODE><I>This will be displayed as normal text. <BR>
-</I>But this will become a %% <BR>
- button .ht.button -text "button" -fg red<BR>
- .ht append .ht.button <BR>
-%% which can invoke a Tcl command.<BR>
-<P>
-
-<H2><A NAME="sect4" HREF="#toc4"></CODE><P>Indices</A></H2>
-<P>
-Some of the widget operations (<B>selection</B>, gotoline, <B>search</B>, etc.)
-take one or more indices as arguments. An index is a string used to indicate
-a particular place within the text, such as the first and last characters
-in a range to be selected. <P>
-An index must have one of the following forms:
-
-<DL>
-
-<DT><I>line<B>.<I>char</I></B></I> </DT>
-<DD>Indicates <I>char</I>'th character on line <I>line</I>. Both lines and characters
-are number from 0, so "0.0" is the first beginning of the text. <I>Char</I> may
-be undesignated. In this case a character position of 0 is assumed. </DD>
-
-<DT><B>@<I>x<B>,<I>y</I></B></I></B>
-</DT>
-<DD>Indicates the character that covers the pixel whose x and y coordinates
-within the text's window are <I>x</I> and <I>y</I>. </DD>
-
-<DT><B>end</B> </DT>
-<DD>Indicates the end of the text. </DD>
-
-<DT><B>anchor</B>
-</DT>
-<DD>Indicates the anchor point for the selection, which is set with the <B>selection</B>
-operation. </DD>
-
-<DT><B>sel.first</B> </DT>
-<DD>Indicates the first character in the selection. It is
-an error to use this form if the selection isn't in the entry window. </DD>
-
-<DT><B>sel.last</B>
-</DT>
-<DD>Indicates the character just after the last one in the selection. It is
-an error to use this form if the selection isn't in the entry window. </DD>
-</DL>
-
-<H2><A NAME="sect5" HREF="#toc5">Variables</A></H2>
-<P>
-The
-following global Tcl variables are maintained when an <B>htext</B> file is parsed.
-
-<DL>
-
-<DT><B>htext(widget)</B> </DT>
-<DD>is the pathname of the <B>htext</B> widget. </DD>
-
-<DT><B>htext(file)</B> </DT>
-<DD>is the
-name of the file the <B>htext</B> widget is currently parsing. It is the empty
-string when the <B>-text</B> option is used. </DD>
-
-<DT><B><A HREF="htext.l.html">htext(line)</B></A>
- </DT>
-<DD>is the current line number
-in the text. </DD>
-</DL>
-<P>
-This information might be used to construct hyper links
-between different files and/or lines. <P>
-
-<H2><A NAME="sect6" HREF="#toc6">Syntax</A></H2>
-The <B>htext</B> command creates a
-new Tcl command whose name is <I>pathName</I>. This command may be used to invoke
-various operations on the widget. It has the following general form: <BR>
-<P>
-<CODE><I>pathName oper </I>?<I>args</I>?<BR>
-</CODE><P><I>Oper</I> and <I>args</I> determine the exact behavior of the command. <P>
-
-<H2><A NAME="sect7" HREF="#toc7">Operations</A></H2>
-The
-following operations are available for <B>htext</B> widgets:
-<DL>
-
-<DT><I>pathName <B>append <I>window
-</I></B></I>?<I>option value</I>?... </DT>
-<DD>Embeds the widget <I>window</I> into the htext widget. <I>Window</I>
-is the pathname of the widget to be embedded which must be a child of <I>pathName</I>.
- <I>Window</I> will be positioned in the htext widget at the current location
-of the text. If <I>option</I> and <I>value</I> pairs are present, they configure various
-aspects how <I>window</I> appears in <I>pathName</I>. The following options are available.
-<blockquote></DD>
-
-<DT><B>-anchor <I>anchorPos</I></B> </DT>
-<DD>Specifies how <I>window</I> will be arranged if there is any
-extra space in the cavity surrounding the window. For example, if <I>anchorPos</I>
-is <B>center</B> then the window is centered in the cavity; if <I>anchorPos</I> is <B>w</B>
-then the window will be drawn such it touches the leftmost edge of the
-cavity. The default is <I>center</I>. </DD>
-
-<DT><B>-fill <I>style</I></B> </DT>
-<DD>Specifies how the <I>window</I> should
-be stretched to occupy the extra space in the cavity surrounding it (if
-any exists). <I>Style</I> is <I>none</I>, <I>x</I>, <I>y</I>, <I>both</I>. If <I>style</I> is <I>x</I>, the width of <I>window</I>
-is expanded to fill the cavity. If <I>style</I> is <B>y</B>, the height is expanded.
-The default is <I>none</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B> </DT>
-<DD>Sets the height of the cavity surrounding
-<I>window</I>. If <I>pixels</I> is zero, the height of the cavity will be the same as
-the requested height of <I>window</I>. If <I>pixels</I> is less than the requested height
-of <I>window</I>, <I>window</I> will be reduced to fit the cavity. The default is <I>0</I>. </DD>
-
-<DT><B>-ipadx
-<I>pad</I></B> </DT>
-<DD>Sets the amount of internal padding to be added to the width <I>window</I>.
- <I>Pad</I> can be a list of one or two numbers. If <I>pad</I> has two elements, the
-left side of <I>window</I> is extended by the first value and the right side by
-the second value. If <I>pad</I> is just one value, both the left and right sides
-are padded by evenly by the value. The default is <I>0</I>. </DD>
-
-<DT><B>-ipady <I>pad</I></B> </DT>
-<DD>Sets an amount
-of internal padding to be added to the height of <I>window</I>. <I>Pad</I> can be a list
-of one or two numbers. If <I>pad</I> has two elements, the top of <I>window</I> is padded
-by the first value and the bottom by the second value. If <I>pad</I> is just one
-number, both the top and bottom are padded evenly by the value. The default
-is <I>0</I>. </DD>
-
-<DT><B>-justify <I>justify</I></B> </DT>
-<DD>Justifies <I>window</I> vertically within the cavity containing
-it in relation to the line of text. <I>Justify</I> is <B>top</B>, <B>bottom</B>, or <B>center</B>.
- If <I>justify</I> is <I>center</I> the widget is centered along the baseline of the
-line of text. The default is <I>center</I>. </DD>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets the padding on the left
-and right sides of <I>window</I>. <I>Pad</I> can be a list of one or two numbers. If <I>pad</I>
-has two elements, the left side of <I>window</I> is padded by the first value
-and the right side by the second value. If <I>pad</I> has just one value, both
-the left and right sides are padded evenly by the value. The default is
-<I>0</I>. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets the padding above and below <I>window</I>. <I>Pad</I> can be a list of
-one or two numbers. If <I>pad</I> has two elements, the area above <I>window</I> is padded
-by the first value and the area below by the second value. If <I>pad</I> is just
-one number, both the top and bottom are padded by the value. The default
-is <I>0</I>. </DD>
-
-<DT><B>-relheight <I>value</I></B> </DT>
-<DD>Specifies the height of the cavity containing <I>window</I>
-relative to the height of <I>pathName</I>. <I>Value</I> is real number indicating the
-ratio of the height of the cavity to the height of <I>pathName</I>. As the height
-of <I>pathName</I> changes, so will the height of <I>window</I>. If <I>value</I> is 0.0 or less,
-the height of the cavity is the requested height <I>window</I>. The default is
-<I>0.0</I>. </DD>
-
-<DT><B>-relwidth <I>value</I></B> </DT>
-<DD>Specifies the width of the cavity containing <I>window</I> relative
-to the width of <I>pathName</I>. <I>Value</I> is real number indicating the ratio of
-the width of the cavity to the width of IpathName. As the height of <I>pathName</I>
-changes, so will the height of <I>window</I>. If <I>value</I> is 0.0 or less, the width
-of the cavity is the requested width of <I>window</I>. The default is <I>0.0</I>. </DD>
-
-<DT><B>-width
-<I>value</I></B> </DT>
-<DD>Species the width of the cavity containing the child window. <I>Value</I>
-must be in a form accepted by <B>Tk_GetPixels</B>. If <I>value</I> is greater than zero,
-the cavity is resized to that width. If the requested window width is
-greater than the cavity's width, the window will be reduced to fit the cavity.
-By default, the cavity is requested width of the child window. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>configure</B></I> ?<I>window</I>? ?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Queries or modifies the
-configuration options of the text widget or one of its embedded widgets.
- If no <I>window</I> argument is present, the htext widget itself is configured.
- Otherwise <I>window</I> is the pathname of a widget already embedded into the
-htext widget. Then this command configure the options for the embedded widget.
-</DD>
-</DL>
-<P>
-If <I>option</I> isn't specified, a list describing all of the current options
-for <I>pathName</I> or <I>window</I> is returned. If <I>option</I> is specified, but not <I>value</I>,
-then a list describing the option <I>option</I> is returned. If one or more <I>option</I>
-and <I>value</I> pairs are specified, then for each pair, the htext or embedded
- window option <I>option</I> is set to <I>value</I>. <P>
-The following options are valid for
-the htext widget. <blockquote>
-<DL>
-
-<DT><B>-background</B> <I>color<I> </I></I></DT>
-<DD>Sets the background of the htext widget
-to <I>color</I>. This default is <I>white</I>. </DD>
-
-<DT><B>-cursor</B> <I>cursor</I> </DT>
-<DD>Specifies the cursor for
-the htext widget. The default cursor is <I>pencil</I>. </DD>
-
-<DT><B>-filename</B> <I>fileName</I> </DT>
-<DD>Specifies
-a <B>htext</B> file to be displayed in the window. If the value is the empty string,
-the <B>-text</B> option is used instead. See the section <FONT SIZE=-1><B>FILE</B></FONT>
- for a description
-of the <B>htext</B> file format. </DD>
-
-<DT><B>-font</B> <I>fontName</I> </DT>
-<DD>Sets the font of the text in the
-htext widget to <I>fontName</I>. The default is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>. </DD>
-
-<DT><B>-foreground</B>
-<I>color</I> </DT>
-<DD>Sets the foreground of the htext widget to <I>color</I>. This is the color
-of the text. This default is <I>black</I>. </DD>
-
-<DT><B>-height</B> <I>pixels</I> </DT>
-<DD>Specifies the height of
-the htext widget window. </DD>
-
-<DT><B>-linespacing</B> <I>pixels</I> </DT>
-<DD>Specifies the spacing between
-each line of text. The value must be in a form accepted by <B>Tk_GetPixels</B>.
-The default value is 1 pixel. </DD>
-
-<DT><B>-specialchar</B> <I>number</I> </DT>
-<DD>Specifies the ASCII value
-of the special double character delimiters. In <B>htext</B> files, the text between
-these special characters is evaluated as a block of Tcl commands. The default
-special character is the <I>0x25</I> (percent sign). </DD>
-
-<DT><B>-text</B> <I>text</I> </DT>
-<DD>Specifies the
-text to be displayed in the htext widget. <I>Text</I> can be any valid string
-of characters. See <FONT SIZE=-1><B>FILE FORMAT</B></FONT>
- for a description. </DD>
-
-<DT><B>-xscrollcommand</B> <I>string</I>
- </DT>
-<DD>Specifies the prefix for a command used to communicate with horizontal
-scrollbars. When the view in the htext widget's window changes (or whenever
-anything else occurs that could change the display in a scrollbar, such
-as a change in the total size of the widget's contents), the widget invoke
-<I>string</I> concatenated by two numbers. Each of the numbers is a fraction between
-0 and 1, which indicates a position in the document. If this option is
-not specified, then no command will be executed. </DD>
-
-<DT><B>-yscrollcommand</B> <I>string</I> </DT>
-<DD>Specifies
-the prefix for a command used to communicate with vertical scrollbars.
-When the view in the htext widget's window changes (or whenever anything
-else occurs that could change the display in a scrollbar, such as a change
-in the total size of the widget's contents), the widget invoke <I>string</I> concatenated
-by two numbers. Each of the numbers is a fraction between 0 and 1, which
-indicates a position in the document. If this option is not specified,
-then no command will be executed. </DD>
-
-<DT><B>-width</B> <I>pixels</I> </DT>
-<DD>Specifies the desired width
-of the viewport window. If the <I>pixels</I> is less than one, the window will
-grow to accommodate the widest line of text. </DD>
-
-<DT><B>-xscrollunits</B> <I>pixels</I> </DT>
-<DD>Specifies
-the horizontal scrolling distance. The default is 10 pixels. </DD>
-
-<DT><B>-yscrollunits</B>
-<I>pixels</I> </DT>
-<DD>Specifies the vertical scrolling distance. The default is 10 pixels.
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>gotoline </B></I>?<I>index</I>? </DT>
-<DD>Sets the top line of the text to <I>index</I>. <I>Index</I>
-must be a valid text index (the character offset is ignored). If an <I>index</I>
-isn't provided, the current line number is returned. </DD>
-
-<DT><I>pathName <B>scan mark
-<I>position</I></B></I> </DT>
-<DD>Records <I>position</I> and the current view in the text window; used
-in conjunction with later <B>scan dragto</B> commands. <I>Position</I> must be in the
-form "<I>@x,y</I>, where <I>x</I> and <I>y</I> are window coordinates. Typically this command
-is associated with a mouse button press in the widget. It returns an empty
-string. </DD>
-
-<DT><I>pathName <B>scan dragto <I>position</I></B></I> </DT>
-<DD>Computes the difference between <I>position</I>
-and the position registered in the last <B>scan mark</B> command for the widget.
- The view is then adjusted up or down by 10 times the difference in coordinates.
- This command is can be associated with mouse motion events to produce
-the effect of dragging the text at high speed through the window. <I>Position</I>
-must be in the form "<I>@x,y</I>, where <I>x</I> and <I>y</I> are window coordinates. The command
-returns an empty string. </DD>
-
-<DT><I>pathName <B>search <I>pattern</I></B></I> ?<I>from</I>? ?<I>to</I>? </DT>
-<DD>Returns the
-number of the next line matching <I>pattern</I>. <I>Pattern</I> is a string which obeys
-the matching rules of <B>Tcl_StringMatch</B>. <I>From</I> and <I>to</I> are text line numbers
-(inclusive) which bound the search. If no match for <I>pattern</I> can be found,
-<B>-1</B> is returned. </DD>
-
-<DT><I>pathName <B>xview </B></I>?<I>position</I>? </DT>
-<DD>Moves the viewport horizontally
-to the new text x-coordinate position. <I>Position</I> is the offset from the
-left side of the text to the current position and must be in a form accepted
-by <B>Tk_GetPixels</B>. If <I>position</I> is not present, the current text position is
-returned. </DD>
-
-<DT><I>pathName <B>yview </B></I>?<I>position</I>? </DT>
-<DD>Moves the viewport vertically to the
-new text y-coordinate position. <I>Position</I> is the offset from the top of
-the text to the current position and must be in a form accepted by <B>Tk_GetPixels</B>.
-If <I>position</I> is not present, the current text position is returned. </DD>
-</DL>
-
-<H2><A NAME="sect8" HREF="#toc8">Bugs</A></H2>
-Text
-with embedded tabs can be obscured by child windows when scrolled horizontally.
-
-<H2><A NAME="sect9" HREF="#toc9">Keywords</A></H2>
-hypertext, widget <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">File Format</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Indices</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Variables</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Syntax</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Operations</A></LI>
-<LI><A NAME="toc8" HREF="#sect8">Bugs</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/spline.html b/blt3.0.1/html/spline.html
deleted file mode 100644
index 368746c..0000000
--- a/blt3.0.1/html/spline.html
+++ /dev/null
@@ -1,160 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>spline(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-spline - Fit curves with spline interpolation
-
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<P>
-<B>spline natural <I>x y sx sy</I></B> <P>
-<B>spline quadratic <I>x y sx sy</I></B>
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The
-<B>spline</B> command computes a spline fitting a set of data points (x and y
-vectors) and produces a vector of the interpolated images (y-coordinates)
-at a given set of x-coordinates.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-Curve fitting has many applications.
- In graphs, curve fitting can be useful for displaying curves which are
-aesthetically pleasing to the eye. Another advantage is that you can quickly
-generate arbitrary points on the curve from a small set of data points.
-<P>
-A spline is a device used in drafting to produce smoothed curves. The points
-of the curve, known as <I>knots</I>, are fixed and the <I>spline</I>, typically a thin
-strip of wood or metal, is bent around the knots to create the smoothed
-curve. Spline interpolation is the mathematical equivalent. The curves
-between adjacent knots are piecewise functions such that the resulting
-spline runs exactly through all the knots. The order and coefficients of
-the polynominal determine the "looseness" or "tightness" of the curve fit
-from the line segments formed by the knots. <P>
-The <B>spline</B> command performs
-spline interpolation using cubic ("natural") or quadratic polynomial functions.
- It computes the spline based upon the knots, which are given as x and
-y vectors. The interpolated new points are determined by another vector
-which represents the abscissas (x-coordinates) or the new points. The ordinates
-(y-coordinates) are interpolated using the spline and written to another
-vector.
-<H2><A NAME="sect4" HREF="#toc4">Example</A></H2>
-Before we can use the <B>spline</B> command, we need to create two
-BLT vectors which will represent the knots (x and y coordinates) of the
-data that we're going to fit. Obviously, both vectors must be the same length.
-<BR>
-<CODE># Create sample data of ten points. <BR>
-vector x(10) y(10)<BR>
-<P>
-for {set i 10} {$i > 0} {incr i -1} {<BR>
- set x($i-1) [expr $i*$i]<BR>
- set y($i-1) [expr sin($i*$i*$i)]<BR>
-}<BR>
-</CODE><P>We now have two vectors <I>x</I> and <I>y</I> representing the ten data points we're trying
-to fit. The order of the values of <I>x</I> must be monotonically increasing.
-We can use the vector's <B>sort</B> operation to sort the vectors. <BR>
-<CODE>x sort y<BR>
-</CODE><P>The components of <I>x</I> are sorted in increasing order. The components of <I>y</I>
-are rearranged so that the original x,y coordinate pairings are retained.
-<P>
-A third vector is needed to indicate the abscissas (x-coordinates) of the
-new points to be interpolated by the spline. Like the x vector, the vector
-of abscissas must be monotonically increasing. All the abscissas must lie
-between the first and last knots (x vector) forming the spline. <P>
-How the
-abscissas are picked is arbitrary. But if we are going to plot the spline,
-we will want to include the knots too. Since both the quadratic and natural
-splines preserve the knots (an abscissa from the x vector will always produce
-the corresponding ordinate from the y vector), we can simply make the new
-vector a superset of <I>x</I>. It will contain the same coordinates as <I>x</I>, but also
-the abscissas of the new points we want interpolated. A simple way is to
-use the vector's <B>populate</B> operation. <BR>
-<CODE>x populate sx 10<BR>
-</CODE><P>This creates a new vector <I>sx</I>. It contains the abscissas of <I>x</I>, but in addition
-<I>sx</I> will have ten evenly distributed values between each abscissa. You can
-interpolate any points you wish, simply by setting the vector values. <P>
-Finally,
-we generate the ordinates (the images of the spline) using the <B>spline</B> command.
- The ordinates are stored in a fourth vector. <BR>
-<CODE>spline natural x y sx sy<BR>
-</CODE><P>This creates a new vector <I>sy</I>. It will have the same length as <I>sx</I>. The vectors
-<I>sx</I> and <I>sy</I> represent the smoothed curve which we can now plot. <BR>
-<CODE>graph .graph<BR>
-.graph element create original -x x -y x -color blue<BR>
-.graph element create spline -x sx -y sy -color red<BR>
-table . .graph<BR>
-</CODE><P>The <B>natural</B> operation employs a cubic interpolant when forming the spline.
- In terms of the draftmen's spline, a <I>natural spline</I> requires the least
-amount of energy to bend the spline (strip of wood), while still passing
-through each knot. In mathematical terms, the second derivatives of the
-first and last points are zero. <P>
-Alternatively, you can generate a spline
-using the <B>quadratic</B> operation. Quadratic interpolation produces a spline
-which follows the line segments of the data points much more closely.
- <BR>
-<CODE>spline quadratic x y sx sy <BR>
-
-<H2><A NAME="sect5" HREF="#toc5"></CODE><P>Operations</A></H2>
-
-<DL>
-
-<DT><B>spline natural <I>x y sx sy</I></B> </DT>
-<DD>Computes a cubic spline from the data
-points represented by the vectors <I>x</I> and <I>y</I> and interpolates new points using
-vector <I>sx</I> as the x-coordinates. The resulting y-coordinates are written to
-a new vector <I>sy</I>. The vectors <I>x</I> and <I>y</I> must be the same length and contain
-at least three components. The order of the components of <I>x</I> must be monotonically
-increasing. <I>Sx</I> is the vector containing the x-coordinates of the points to
-be interpolated. No component of <I>sx</I> can be less than first component of
-<I>x</I> or greater than the last component. The order of the components of <I>sx</I>
-must be monotonically increasing. <I>Sy</I> is the name of the vector where the
-calculated y-coordinates will be stored. If <I>sy</I> does not already exist, a
-new vector will be created. </DD>
-
-<DT><B>spline quadratic <I>x y sx sy</I></B> </DT>
-<DD>Computes a quadratic
-spline from the data points represented by the vectors <I>x</I> and <I>y</I> and interpolates
-new points using vector <I>sx</I> as the x-coordinates. The resulting y-coordinates
-are written to a new vector <I>sy</I>. The vectors <I>x</I> and <I>y</I> must be the same length
-and contain at least three components. The order of the components of <I>x</I>
-must be monotonically increasing. <I>Sx</I> is the vector containing the x-coordinates
-of the points to be interpolated. No component of <I>sx</I> can be less than first
-component of <I>x</I> or greater than the last component. The order of the components
-of <I>sx</I> must be monotonically increasing. <I>Sy</I> is the name of the vector where
-the calculated y-coordinates are stored. If <I>sy</I> does not already exist, a
-new vector will be created. </DD>
-</DL>
-
-<H2><A NAME="sect6" HREF="#toc6">References</A></H2>
-<BR>
-<PRE>
-Numerical Analysis
-by R. Burden, J. Faires and A. Reynolds.<tt> </tt> <tt> </tt>
-Prindle, Weber & Schmidt, 1981, pp. 112
-
-Shape Preserving Quadratic Splines
-by D.F.Mcallister & J.A.Roulier
-Coded by S.L.Dodd & M.Roulier N.C.State University.
-
-</PRE>The original code for the quadratric spline can be found in TOMS #574.
-<H2><A NAME="sect7" HREF="#toc7">Keywords</A></H2>
-spline,
-vector, graph <P>
- <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Example</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Operations</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">References</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/stripchart.html b/blt3.0.1/html/stripchart.html
deleted file mode 100644
index 9a9fe82..0000000
--- a/blt3.0.1/html/stripchart.html
+++ /dev/null
@@ -1,2179 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>stripchart(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-stripchart - 2D strip chart for plotting x and
-y coordinate data.
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>stripchart<I> <I>pathName </I></I></B>?<I>option value</I>?...
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The
-<B>stripchart</B> command creates a strip chart for plotting two-dimensional data
-(x,y coordinates). It has many configurable components: coordinate axes,
-elements, legend, grid lines, cross hairs, etc. They allow you to customize
-the look and feel of the strip chart. <P>
-The <B>stripchart</B> is essentially the
-same as the <B>graph</B> widget. It works almost exactly the very same way. <P>
-The
-use of a strip chart differs in that the X-axis typically refers to time
-points. Data values are added at intervals. The strip chart lets you automatically
-maintain a view of the most recent time points. The axis options <B>-shiftby</B>
-and <B>-autorange</B> control this. You can specify different line styles for data
-points (see the <B>-styles</B> option).
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-The <B>stripchart</B> command creates
-a new window for plotting two-dimensional data (x,y coordinates). Data points
-are plotted in a box displayed in the center of the new window. This is
-the <I>plotting area</I>. The coordinate axes are displayed in the margins around
-the plotting area. By default, the legend is displayed in the right margin.
- The title is displayed in top margin. <P>
-A strip chart is composed of several
-components: coordinate axes, data elements, legend, grid, cross hairs,
-pens, postscript, and annotation markers.
-<DL>
-
-<DT><I>axis</I> </DT>
-<DD>The stripchart widget can
-display up to four coordinate axes (two X-coordinate and two Y-coordinate
-axes), but you can create and use any number of axes. Axes control what
-region of data is displayed and how the data is scaled. Each axis consists
-of the axis line, title, major and minor ticks, and tick labels. Tick labels
-display the value of each major tick. </DD>
-
-<DT><I>crosshairs</I> </DT>
-<DD>Cross hairs are used to
-finely position the mouse pointer in relation to the coordinate axes. Two
-perpendicular lines are drawn across the plotting area, intersecting at
-the current location of the mouse pointer. </DD>
-
-<DT><I>element</I> </DT>
-<DD>An element represents
-a set of data points. Elements can be plotted with a symbol at each data
-point and lines connecting the points. The appearance of the element, such
-as its symbol, line width, and color is configurable. </DD>
-
-<DT><I>grid</I> </DT>
-<DD>Extends the
-major and minor ticks of the X-axis and/or Y-axis across the plotting area.
- </DD>
-
-<DT><I>legend</I> </DT>
-<DD>The legend displays the name and symbol of each data element.
-The legend can be drawn in any margin or in the plotting area. </DD>
-
-<DT><I>marker</I> </DT>
-<DD>Markers
-are used annotate or highlight areas of the graph. For example, you could
-use a polygon marker to fill an area under a curve, or a text marker to
-label a particular data point. Markers come in various forms: text strings,
-bitmaps, connected line segments, images, polygons, or embedded widgets.
-</DD>
-
-<DT><I>pen</I> </DT>
-<DD>Pens define attributes (both symbol and line style) for elements.
-Data elements use pens to specify how they should be drawn. A data element
-may use many pens at once. Here, the particular pen used for a data point
-is determined from each element's weight vector (see the element's <B>-weight</B>
-and <B>-style</B> options). </DD>
-
-<DT><I>postscript</I> </DT>
-<DD>The widget can generate encapsulated PostScript
-output. This component has several options to configure how the PostScript
-is generated. </DD>
-</DL>
-
-<H2><A NAME="sect4" HREF="#toc4">Syntax</A></H2>
-<BR>
-<P>
-<CODE><B>stripchart <I>pathName </I></B>?<I>option value</I>?...<BR>
-</CODE><P>The <B>stripchart</B> command creates a new window <I>pathName</I> and makes it into
-a <B>stripchart</B> widget. At the time this command is invoked, there must not
-exist a window named <I>pathName</I>, but <I>pathName</I>'s parent must exist. Additional
-options may may be specified on the command line or in the option database
-to configure aspects of the strip chart such as its colors and font. See
-the <B>configure</B> operation below for the exact details as to what <I>option</I> and
-<I>value</I> pairs are valid. <P>
-If successful, <B>stripchart</B> returns the path name of
-the widget. It also creates a new Tcl command by the same name. You can
-use this command to perform various operations that query or modify the
-graph. The general form is: <BR>
-<P>
-<CODE><I>pathName <I>operation</I></I> ?<I>arg</I>?...<BR>
-</CODE><P>Both <I>operation</I> and its arguments determine the exact behavior of the command.
- The operations available for the strip chart are described in the <FONT SIZE=-1><B>STRIPCHART
-OPERATIONS</B></FONT>
- section. <P>
-The command can also be used to access components of
-the strip chart. <BR>
-<P>
-<CODE><I>pathName component operation</I> ?<I>arg</I>?...<BR>
-</CODE><P>The operation, now located after the name of the component, is the function
-to be performed on that component. Each component has its own set of operations
-that manipulate that component. They will be described below in their own
-sections.
-<H2><A NAME="sect5" HREF="#toc5">Example</A></H2>
-The <B>stripchart</B> command creates a new strip chart. <BR>
-<CODE># Create a new strip chart. Plotting area is black.<BR>
-stripchart .s -plotbackground black<BR>
-</CODE><P>A new Tcl command <I>.s</I> is also created. This command can be used to query
-and modify the strip chart. For example, to change the title of the strip
-chart to "My Plot", you use the new command and the widget's <B>configure</B> operation.
-<BR>
-<CODE># Change the title.<BR>
-.s configure -title "My Plot"<BR>
-</CODE><P>A strip chart has several components. To access a particular component you
-use the component's name. For example, to add data elements, you use the
-new command and the <B>element</B> component. <BR>
-<CODE># Create a new element named "line1"<BR>
-.s element create line1 \<BR>
-<tt> </tt> <tt> </tt> -xdata { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 } \<BR>
-<tt> </tt> <tt> </tt> -ydata { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 <BR>
-<tt> </tt> <tt> </tt> <tt> </tt> <tt> </tt> 155.85 166.60 175.38 }<BR>
-</CODE><P>The element's X and Y coordinates are specified using lists of numbers.
-Alternately, BLT vectors could be used to hold the X-Y coordinates. <BR>
-<CODE># Create two vectors and add them to the strip chart.<BR>
-vector xVec yVec<BR>
-xVec set { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 }<BR>
-yVec set { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 155.85 <BR>
-<tt> </tt> <tt> </tt> 166.60 175.38 }<BR>
-.s element create line1 -xdata xVec -ydata yVec<BR>
-</CODE><P>The advantage of using vectors is that when you modify one, the graph is
-automatically redrawn to display the new values. <BR>
-<CODE># Change the X-Y coordinates of the first point.<BR>
-set xVec(0) 0.18<BR>
-set yVec(0) 25.18<BR>
-</CODE><P>An element named <I>line1</I> is now created in <I>.s</I>. By default, the element's label
-in the legend will be also <I>line1</I>. You can change the label, or specify no
-legend entry, again using the element's <B>configure</B> operation. <BR>
-<CODE># Don't display "line1" in the legend.<BR>
-.s element configure line1 -label ""<BR>
-</CODE><P>You can configure more than just the element's label. An element has many
-attributes such as symbol type and size, dashed or solid lines, colors,
-line width, etc. <BR>
-<CODE>.s element configure line1 -symbol square -color red \<BR>
-<tt> </tt> <tt> </tt> -dashes { 2 4 2 } -linewidth 2 -pixels 2c<BR>
-</CODE><P>Four coordinate axes are automatically created: <I>x</I>, <I>x2</I>, <I>y</I>, and <I>y2</I>. And by
-default, elements are mapped onto the axes <I>x</I> and <I>y</I>. This can be changed
-with the <B>-mapx</B> and <B>-mapy</B> options. <BR>
-<CODE># Map "line1" on the alternate Y-axis "y2".<BR>
-.s element configure line1 -mapy y2<BR>
-</CODE><P>Axes can be configured in many ways too. For example, you change the scale
-of the Y-axis from linear to log using the <B>axis</B> operation. <BR>
-<CODE># Y-axis is log scale.<BR>
-.s axis configure y -logscale yes<BR>
-</CODE><P>Axis limits are reset by simply specifying new axis limits using the <B>-min</B>
-and <B>-max</B> configuration options. <BR>
-<CODE>.s axis configure x -min 1.0 -max 1.5<BR>
-.s axis configure y -min 12.0 -max 55.15<BR>
-</CODE><P>By default, the limits of the axis are determined from data values. To reset
-back to the default limits, set the <B>-min</B> and <B>-max</B> options to the empty value.
-<BR>
-<CODE># Reset the axes to autoscale again.<BR>
-.s axis configure x -min {} -max {}<BR>
-.s axis configure y -min {} -max {}<BR>
-</CODE><P>It's common with strip charts to automatically maintain a view of the most
-recent time points. You can do this my setting the <B>-autorange</B> option. <BR>
-<CODE>.s axis configure x -autorange 20.0<BR>
-</CODE><P>If the time points are added in X-coordinates 1.0 unit, only the last twenty
-time points will be displayed. As more data is added, the view will march
-along. <P>
-Sometimes the rate of data is so high that changing the axis limits
-with each additional time point is prohibitive. You can use the <B>-shiftby</B>
-option to define an increment to shift the view when needed. <BR>
-<CODE>.s axis configure x -shiftby 15.0<BR>
-</CODE><P>When the view is shifted, it will allow a range of 15 new time points to
-be added until the axis limits are recomputed. <P>
-By default, the legend is
-displayed in the right margin. You can change this or any other legend
-configuration options using the <B>legend</B> component. <BR>
-<CODE># Configure the legend font, color, and relief<BR>
-.s legend configure -position left -relief raised \<BR>
-<tt> </tt> <tt> </tt> -font fixed -fg blue<BR>
-</CODE><P>To prevent the legend from being displayed, turn on the <B>-hide</B> option. <BR>
-<CODE># Don't display the legend.<BR>
-.s legend configure -hide yes<BR>
-</CODE><P>The <B>stripchart</B> widget has simple drawing procedures called markers. They
-can be used to highlight or annotate data in the strip chart. The types
-of markers available are bitmaps, images, polygons, lines, or windows. Markers
-can be used, for example, to mark or brush points. Here is a text marker
-which labels the data first point. Markers are created using the <B>marker</B>
-operation. <BR>
-<CODE># Create a label for the first data point of "line1".<BR>
-.s marker create text -name first_marker -coords { 0.2 26.18 } \<BR>
-<tt> </tt> <tt> </tt> -text "start" -anchor se -xoffset -10 -yoffset -10<BR>
-</CODE><P>This creates a text marker named <I>first_marker</I>. It will display the text
-"start" near the coordinates of the first data point. The <B>-anchor</B>, <B>-xoffset</B>,
-and <B>-yoffset</B> options are used to display the marker above and to the left
-of the data point, so that the actual data point isn't covered by the marker.
- By default, markers are drawn last, on top of data. You can change this
-with the <B>-under</B> option. <BR>
-<CODE># Draw the label before elements are drawn.<BR>
-.s marker configure first_marker -under yes<BR>
-</CODE><P>You can add cross hairs or grid lines using the <B>crosshairs</B> and <B>grid</B> operations.
-<BR>
-<CODE># Display both cross hairs and grid lines.<BR>
-.s crosshairs configure -hide no -color red<BR>
-.s grid configure -hide no -dashes { 2 2 }<BR>
-</CODE><P>Finally, to get hardcopy of the strip chart, use the <B>postscript</B> operation.
-<BR>
-<CODE># Print the strip chart into file "file.ps"<BR>
-.s postscript output file.ps -maxpect yes -decorations no<BR>
-</CODE><P>This generates a file <I>file.ps</I> containing the encapsulated PostScript of
-the strip chart. The option <B>-maxpect</B> says to scale the plot to the size
-of the page. Turning off the <B>-decorations</B> option indicates that no borders
-or color backgrounds should be displayed (i.e. the background of the margins,
-legend, and plotting area will be white).
-<H2><A NAME="sect6" HREF="#toc6">Stripchart Operations</A></H2>
-
-<DL>
-
-<DT><I>pathName
-<B>axis <I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>AXIS COMPONENTS</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>bar <I>elemName
-</I></B></I>?<I>option value</I>?... </DT>
-<DD>Creates a new barchart element <I>elemName</I>. It's an error if
-an element <I>elemName</I> already exists. See the manual for <B>barchart</B> for details
-about what <I>option</I> and <I>value</I> pairs are valid. </DD>
-
-<DT><I>pathName <B>cget</B></I> <I>option</I> </DT>
-<DD>Returns
-the current value of the stripchart configuration option given by <I>option</I>.
- <I>Option</I> may be any option described below for the <B>configure</B> operation. </DD>
-
-<DT><I>pathName
-<B>configure </B></I>?<I>option value</I>?... </DT>
-<DD>Queries or modifies the configuration options
-of the strip chart. If <I>option</I> isn't specified, a list describing all of
-the current options for <I>pathName</I> is returned. If <I>option</I> is specified, but
-not <I>value</I>, then a list describing <I>option</I> is returned. If one or more <I>option</I>
-and <I>value</I> pairs are specified, then for each pair, the stripchart option
-<I>option</I> is set to <I>value</I>. The following options are valid for the stripchart.
-<blockquote></DD>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets the background color. This includes the margins and
-legend, but not the plotting area. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of
-the 3-D border around the outside edge of the widget. The <B>-relief</B> option
-determines if the border is to be drawn. The default is <I>2</I>. </DD>
-
-<DT><B>-bottommargin
-<I>pixels</I></B> </DT>
-<DD>Specifies the size of the margin below the X-coordinate axis. If
-<I>pixels</I> is <I>0</I>, the size of the margin is selected automatically. The default
-is <I>0</I>. </DD>
-
-<DT><B>-bufferelements <I>boolean</I></B> </DT>
-<DD>Indicates whether to draw elements into a pixmap
-before displaying them on the screen. The advantage of buffering elements
-is when markers are used heavily. Markers can be moved and redrawn without
-requiring every element to be redrawn again. The disadvantage is that it
-takes slightly longer to draw the graph. If <I>boolean</I> is true, data elements
-are drawn to an internal pixmap. The option should be turned off if the
-plot is updated frequently. See the <FONT SIZE=-1><B>SPEED TIPS</B></FONT>
- section. The default is <I>1</I>.
-</DD>
-
-<DT><B>-buffergraph <I>boolean</I></B> </DT>
-<DD>Indicates whether to draw the graph into a pixmap first.
-If <I>boolean</I> is true, the entire graph is drawn into a pixmap and then copied
-onto the screen. This reduces flashing. If false, the graph is drawn directly
-into the window. Especially under Windows, turning off the option can
-be helpful when the stripchart is updated frequently. Turning off this
-option also turns <B>-bufferelements</B> off. See the <FONT SIZE=-1><B>SPEED TIPS</B></FONT>
- section. The default
-is <I>1</I>. </DD>
-
-<DT><B>-cursor <I>cursor</I></B> </DT>
-<DD>Specifies the widget's cursor. The default cursor is
-<I>crosshair</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Specifies the title font. The default is <I>*-Helvetica-Bold-R-Normal-*-18-180-*</I>.
-</DD>
-
-<DT><B>-halo <I>pixels</I></B> </DT>
-<DD>Specifies a maximum distance to consider when searching for
-the closest data point (see the element's <B>closest</B> operation below). Data
-points further than <I>pixels</I> away are ignored. The default is <I>0.5i</I>. </DD>
-
-<DT><B>-height
-<I>pixels</I></B> </DT>
-<DD>Specifies the requested height of widget. The default is <I>4i</I>. </DD>
-
-<DT><B>-invertxy
-<I>boolean</I></B> </DT>
-<DD>Indicates whether the placement X-axis and Y-axis should be inverted.
- If <I>boolean</I> is true, the X and Y axes are swapped. The default is <I>0</I>. </DD>
-
-<DT><B>-justify
-<I>justify</I></B> </DT>
-<DD>Specifies how the title should be justified. This matters only
-when the title contains more than one line of text. <I>Justify</I> must be <I>left</I>,
-<I>right</I>, or <I>center</I>. The default is <I>center</I>. </DD>
-
-<DT><B>-leftmargin <I>pixels</I></B> </DT>
-<DD>Sets the size
-of the margin from the left edge of the window to the Y-coordinate axis.
- If <I>pixels</I> is <I>0</I>, the size is calculated automatically. The default is <I>0</I>.
-</DD>
-
-<DT><B>-plotbackground <I>color</I></B> </DT>
-<DD>Specifies the background color of the plotting area.
- The default is <I>white</I>. </DD>
-
-<DT><B>-plotborderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border
-around the plotting area. The <B>-plotrelief</B> option determines if a border
-is drawn. The default is <I>2</I>. </DD>
-
-<DT><B>-plotpadx <I>pad</I></B> </DT>
-<DD>Sets the amount of padding to be
-added to the left and right sides of the plotting area. <I>Pad</I> can be a list
-of one or two screen distances. If <I>pad</I> has two elements, the left side
-of the plotting area entry is padded by the first distance and the right
-side by the second. If <I>pad</I> is just one distance, both the left and right
-sides are padded evenly. The default is <I>8</I>. </DD>
-
-<DT><B>-plotpady <I>pad</I></B> </DT>
-<DD>Sets the amount
-of padding to be added to the top and bottom of the plotting area. <I>Pad</I>
-can be a list of one or two screen distances. If <I>pad</I> has two elements,
-the top of the plotting area is padded by the first distance and the bottom
-by the second. If <I>pad</I> is just one distance, both the top and bottom are
-padded evenly. The default is <I>8</I>. </DD>
-
-<DT><B>-plotrelief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect
-for the plotting area. <I>Relief</I> indicates how the interior of the plotting
-area should appear relative to rest of the strip chart; for example, <I>raised</I>
-means the plot should appear to protrude from the strip chart, relative
-to the surface of the strip chart. The default is <I>sunken</I>. </DD>
-
-<DT><B>-relief <I>relief</I></B>
-</DT>
-<DD>Specifies the 3-D effect for the widget. <I>Relief</I> indicates how the strip
-chart should appear relative to widget it is packed into; for example,
-<I>raised</I> means the strip chart should appear to protrude. The default is
-<I>flat</I>. </DD>
-
-<DT><B>-rightmargin <I>pixels</I></B> </DT>
-<DD>Sets the size of margin from the plotting area
-to the right edge of the window. By default, the legend is displayed in
-this margin. If <I>pixels</I> is than 1, the margin size is selected automatically.
-</DD>
-
-<DT><B>-takefocus</B> <I>focus</I> </DT>
-<DD>Provides information used when moving the focus from window
-to window via keyboard traversal (e.g., Tab and Shift-Tab). If <I>focus</I> is <I>0</I>,
-this means that this window should be skipped entirely during keyboard
-traversal. <I>1</I> means that the this window should always receive the input
-focus. An empty value means that the traversal scripts make the decision
-whether to focus on the window. The default is <I>""</I>. </DD>
-
-<DT><B>-tile <I>image</I></B> </DT>
-<DD>Specifies
-a tiled background. If <I>image</I> isn't <I>""</I>, the background is tiled using <I>image</I>.
-Otherwise, the normal background color is drawn (see the <B>-background</B> option).
- <I>Image</I> must be an image created using the Tk <B>image</B> command. The default
-is <I>""</I>. </DD>
-
-<DT><B>-title <I>text</I></B> </DT>
-<DD>Sets the title to <I>text</I>. If <I>text</I> is <I>""</I>, no title will be
-displayed. </DD>
-
-<DT><B>-topmargin <I>pixels</I></B> </DT>
-<DD>Specifies the size of the margin above the x2
-axis. If <I>pixels</I> is <I>0</I>, the margin size is calculated automatically. </DD>
-
-<DT><B>-width
-<I>pixels</I></B> </DT>
-<DD>Specifies the requested width of the widget. The default is <I>5i</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>crosshairs <I>operation </I></B></I>?<I>arg</I>? </DT>
-<DD>See the <FONT SIZE=-1><B>CROSSHAIRS COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName
-<B>element <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>ELEMENT COMPONENTS</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>extents
-<I>item</I></B></I> </DT>
-<DD>Returns the size of a particular item in the strip chart. <I>Item</I> must
-be either <I>leftmargin</I>, <I>rightmargin</I>, <I>topmargin</I>, <I>bottommargin</I>, <I>plotwidth</I>,
-or <I>plotheight</I>. </DD>
-
-<DT><I>pathName <B>grid <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>GRID COMPONENT</B></FONT>
- section.
-</DD>
-
-<DT><I>pathName <B>invtransform <I>winX winY</I></B></I> </DT>
-<DD>Performs an inverse coordinate transformation,
-mapping window coordinates back to graph coordinates, using the standard
-X-axis and Y-axis. Returns a list of containing the graph coordinates. </DD>
-
-<DT><I>pathName
-<B>legend <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>LEGEND COMPONENT</B></FONT>
- section. </DD>
-
-<DT><I>pathName <B>line
-<I>elemName</I></B></I> ?<I>option value</I>?... </DT>
-<DD>The operation is the same as <B>element</B>. </DD>
-
-<DT><I>pathName <B>marker
-<I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>MARKER COMPONENTS</B></FONT>
- section. </DD>
-
-<DT><I>pathName</I> <B>metafile</B> ?<I>fileName</I>?
-</DT>
-<DD><I>This operation is for Window platforms only</I>. Creates a Windows enhanced
-metafile of the stripchart. If present, <I>fileName</I> is the file name of the
-new metafile. Otherwise, the metafile is automatically added to the clipboard.
-</DD>
-
-<DT><I>pathName <B>postscript <I>operation </I></B></I>?<I>arg</I>?... </DT>
-<DD>See the <FONT SIZE=-1><B>POSTSCRIPT COMPONENT</B></FONT>
- section.
-</DD>
-
-<DT><I>pathName <B>snap <I>photoName</I></B></I> </DT>
-<DD>Takes a snapshot of the strip chart and stores
-the contents in the photo image <I>photoName</I>. <I>PhotoName</I> is the name of a Tk
-photo image that must already exist. </DD>
-
-<DT><I>pathName <B>transform <I>x y</I></B></I> </DT>
-<DD>Performs a
-coordinate transformation, mapping graph coordinates to window coordinates,
-using the standard X-axis and Y-axis. Returns a list containing the X-Y screen
-coordinates. </DD>
-
-<DT><I>pathName <B>xaxis <I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <B>x2axis <I>operation</I></B></I> ?<I>arg</I>?...
- </DT>
-<DD></DD>
-
-<DT><I>pathName <B>yaxis <I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <B>y2axis <I>operation</I></B></I> ?<I>arg</I>?... </DT>
-<DD>See the
- <FONT SIZE=-1><B>AXIS COMPONENTS</B></FONT>
- section. </DD>
-</DL>
-
-<H2><A NAME="sect7" HREF="#toc7">Stripchart Components</A></H2>
-A strip chart is composed
-of several components: coordinate axes, data elements, legend, grid, cross
-hairs, postscript, and annotation markers. Instead of one big set of configuration
-options and operations, the strip chart is partitioned, where each component
-has its own configuration options and operations that specifically control
-that aspect or part of the strip chart.
-<H3><A NAME="sect8" HREF="#toc8">Axis Components</A></H3>
-Four coordinate
-axes are automatically created: two X-coordinate axes (<I>x</I> and <I>x2</I>) and two
-Y-coordinate axes (<I>y</I>, and <I>y2</I>). By default, the axis <I>x</I> is located in the
-bottom margin, <I>y</I> in the left margin, <I>x2</I> in the top margin, and <I>y2</I> in the
-right margin. <P>
-An axis consists of the axis line, title, major and minor
-ticks, and tick labels. Major ticks are drawn at uniform intervals along
-the axis. Each tick is labeled with its coordinate value. Minor ticks are
-drawn at uniform intervals within major ticks. <P>
-The range of the axis controls
-what region of data is plotted. Data points outside the minimum and maximum
-limits of the axis are not plotted. By default, the minimum and maximum
-limits are determined from the data, but you can reset either limit. <P>
-You
-can create and use several axes. To create an axis, invoke the axis component
-and its create operation. <BR>
-<CODE># Create a new axis called "temperature"<BR>
-.s axis create temperature<BR>
-</CODE><P>You map data elements to an axis using the element's -mapy and -mapx configuration
-options. They specify the coordinate axes an element is mapped onto. <BR>
-<CODE># Now map the temperature data to this axis.<BR>
-.s element create "temp" -xdata $x -ydata $tempData \<BR>
- -mapy temperature<BR>
-</CODE><P>While you can have many axes, only four axes can be displayed simultaneously.
- They are drawn in each of the margins surrounding the plotting area. The
-axes x and y are drawn in the bottom and left margins. The axes x2 and y2
-are drawn in top and right margins. Only x and y are shown by default. Note
-that the axes can have different scales. <P>
-To display a different axis, you
-invoke one of the following components: <B>xaxis</B>, <B>yaxis</B>, <B>x2axis</B>, and <B>y2axis</B>.
-The <B>use</B> operation designates the axis to be drawn in the corresponding
-margin: <B>xaxis</B> in the bottom, <B>yaxis</B> in the left, <B>x2axis</B> in the top, and
-<B>y2axis</B> in the right. <BR>
-<CODE># Display the axis temperature in the left margin.<BR>
-.s yaxis use temperature<BR>
-<P>
-</CODE><P>You can configure axes in many ways. The axis scale can be linear or logarithmic.
- The values along the axis can either monotonically increase or decrease.
- If you need custom tick labels, you can specify a Tcl procedure to format
-the label as you wish. You can control how ticks are drawn, by changing
-the major tick interval or the number of minor ticks. You can define non-uniform
-tick intervals, such as for time-series plots. <P>
-
-<DL>
-
-<DT><I>pathName <B>axis <B>cget <I>axisName
-<I>option</I></I></B></B></I> </DT>
-<DD>Returns the current value of the option given by <I>option</I> for <I>axisName</I>.
- <I>Option</I> may be any option described below for the axis <B>configure</B> operation.
-</DD>
-
-<DT><I>pathName <B>axis <B>configure <I>axisName </I></B></B></I>?<I>option value</I>?... </DT>
-<DD>Queries or modifies the
-configuration options of <I>axisName</I>. If <I>option</I> isn't specified, a list describing
-all the current options for <I>axisName</I> is returned. If <I>option</I> is specified,
-but not <I>value</I>, then a list describing <I>option</I> is returned. If one or more
-<I>option</I> and <I>value</I> pairs are specified, then for each pair, the axis option
-<I>option</I> is set to <I>value</I>. The following options are valid for axes. <blockquote></DD>
-
-<DT><B>-autorange
-<I>range</I></B> </DT>
-<DD>Sets the range of values for the axis to <I>range</I>. The axis limits
-are automatically reset to display the most recent data points in this
-range. If <I>range</I> is 0.0, the range is determined from the limits of the
-data. If <B>-min</B> or <B>-max</B> are specified, they override this option. The default
-is <I>0.0</I>. </DD>
-
-<DT><B>-color <I>color</I></B> </DT>
-<DD>Sets the color of the axis and tick labels. The default
-is <I>black</I>. </DD>
-
-<DT><B>-command <I>prefix</I></B> </DT>
-<DD>Specifies a Tcl command to be invoked when formatting
-the axis tick labels. <I>Prefix</I> is a string containing the name of a Tcl proc
-and any extra arguments for the procedure. This command is invoked for
-each major tick on the axis. Two additional arguments are passed to the
-procedure: the pathname of the widget and the current the numeric value
-of the tick. The procedure returns the formatted tick label. If <I>""</I> is returned,
-no label will appear next to the tick. You can get the standard tick labels
-again by setting <I>prefix</I> to <I>""</I>. The default is <I>""</I>. <P>
-Please note that this
-procedure is invoked while the strip chart is redrawn. You may query the
-configuration options. But do not reset them, because this can have unexpected
-results. </DD>
-
-<DT><B>-descending <I>boolean</I></B> </DT>
-<DD>Indicates whether the values along the axis
-are monotonically increasing or decreasing. If <I>boolean</I> is true, the axis
-values will be decreasing. The default is <I>0</I>. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether
-the axis is displayed. </DD>
-
-<DT><B>-justify <I>justify</I></B> </DT>
-<DD>Specifies how the axis title should
-be justified. This matters only when the axis title contains more than
-one line of text. <I>Justify</I> must be <I>left</I>, <I>right</I>, or <I>center</I>. The default is
-<I>center</I>. </DD>
-
-<DT><B>-limits <I>formatStr</I></B> </DT>
-<DD>Specifies a printf-like description to format the
-minimum and maximum limits of the axis. The limits are displayed at the
-top/bottom or left/right sides of the plotting area. <I>FormatStr</I> is a list
-of one or two format descriptions. If one description is supplied, both
-the minimum and maximum limits are formatted in the same way. If two, the
-first designates the format for the minimum limit, the second for the maximum.
- If <I>""</I> is given as either description, then the that limit will not be
-displayed. The default is <I>""</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the axis
-and tick lines. The default is <I>1</I> pixel. </DD>
-
-<DT><B>-logscale <I>boolean</I></B> </DT>
-<DD>Indicates whether
-the scale of the axis is logarithmic or linear. If <I>boolean</I> is true, the
-axis is logarithmic. The default scale is linear. </DD>
-
-<DT><B>-loose <I>boolean</I></B> </DT>
-<DD>Indicates
-whether the limits of the axis should fit the data points tightly, at the
-outermost data points, or loosely, at the outer tick intervals. This is
-relevant only when the axis limit is automatically calculated. If <I>boolean</I>
-is true, the axis range is "loose". The default is <I>0</I>. </DD>
-
-<DT><B>-majorticks <I>majorList</I></B>
-</DT>
-<DD>Specifies where to display major axis ticks. You can use this option to
-display ticks at non-uniform intervals. <I>MajorList</I> is a list of axis coordinates
-designating the location of major ticks. No minor ticks are drawn. If <I>majorList</I>
-is <I>""</I>, major ticks will be automatically computed. The default is <I>""</I>. </DD>
-
-<DT><B>-max
-<I>value</I></B> </DT>
-<DD>Sets the maximum limit of <I>axisName</I>. Any data point greater than
-<I>value</I> is not displayed. If <I>value</I> is <I>""</I>, the maximum limit is calculated
-using the largest data value. The default is <I>""</I>. </DD>
-
-<DT><B>-min <I>value</I></B> </DT>
-<DD>Sets the minimum
-limit of <I>axisName</I>. Any data point less than <I>value</I> is not displayed. If
-<I>value</I> is <I>""</I>, the minimum limit is calculated using the smallest data value.
-The default is <I>""</I>. </DD>
-
-<DT><B>-minorticks <I>minorList</I></B> </DT>
-<DD>Specifies where to display minor
-axis ticks. You can use this option to display minor ticks at non-uniform
-intervals. <I>MinorList</I> is a list of real values, ranging from 0.0 to 1.0, designating
-the placement of a minor tick. No minor ticks are drawn if the <B>-majortick</B>
-option is also set. If <I>minorList</I> is <I>""</I>, minor ticks will be automatically
-computed. The default is <I>""</I>. </DD>
-
-<DT><B>-rotate <I>theta</I></B> </DT>
-<DD>Specifies the how many degrees
-to rotate the axis tick labels. <I>Theta</I> is a real value representing the number
-of degrees to rotate the tick labels. The default is <I>0.0</I> degrees. </DD>
-
-<DT><B>-shiftby
-<I>value</I></B> </DT>
-<DD>Specifies how much to automatically shift the range of the axis. When
-the new data exceeds the current axis maximum, the maximum is increased
-in increments of <I>value</I>. You can use this option to prevent the axis limits
-from being recomputed at each new time point. If <I>value</I> is 0.0, then no automatic
-shifting is done. The default is <I>0.0</I>. </DD>
-
-<DT><B>-showticks <I>boolean</I></B> </DT>
-<DD>Indicates whether
-axis ticks should be drawn. If <I>boolean</I> is true, ticks are drawn. If false,
-only the axis line is drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-stepsize <I>value</I></B> </DT>
-<DD>Specifies the
-interval between major axis ticks. If <I>value</I> isn't a valid interval (must
-be less than the axis range), the request is ignored and the step size
-is automatically calculated. </DD>
-
-<DT><B>-subdivisions <I>number</I></B> </DT>
-<DD>Indicates how many minor
-axis ticks are to be drawn. For example, if <I>number</I> is two, only one minor
-tick is drawn. If <I>number</I> is one, no minor ticks are displayed. The default
-is <I>2</I>. </DD>
-
-<DT><B>-tickfont <I>fontName</I></B> </DT>
-<DD>Specifies the font for axis tick labels. The default
-is <I>*-Courier-Bold-R-Normal-*-100-*</I>. </DD>
-
-<DT><B>-ticklength <I>pixels</I></B> </DT>
-<DD>Sets the length of major
-and minor ticks (minor ticks are half the length of major ticks). If <I>pixels</I>
-is less than zero, the axis will be inverted with ticks drawn pointing
-towards the plot. The default is <I>0.1i</I>. </DD>
-
-<DT><B>-title <I>text</I></B> </DT>
-<DD>Sets the title of the axis.
-If <I>text</I> is <I>""</I>, no axis title will be displayed. </DD>
-
-<DT><B>-titlecolor <I>color</I></B> </DT>
-<DD>Sets
-the color of the axis title. The default is <I>black</I>. </DD>
-
-<DT><B>-titlefont <I>fontName</I></B> </DT>
-<DD>Specifies
-the font for axis title. The default is <I>*-Helvetica-Bold-R-Normal-*-14-140-*</I>. </DD>
-</DL>
-<P>
-Axis
-configuration options may be also be set by the <B>option</B> command. The resource
-class is <I>Axis</I>. The resource names are the names of the axes (such as <I>x</I>
-or <I>x2</I>). <BR>
-<CODE>option add *Stripchart.Axis.Color blue<BR>
-option add *Stripchart.x.LogScale true<BR>
-option add *Stripchart.x2.LogScale false<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>axis <B>create <I>axisName </I></B></B></I>?<I>option value</I>?... </DT>
-<DD>Creates a new axis by the
-name <I>axisName</I>. No axis by the same name can already exist. <I>Option</I> and <I>value</I>
-are described in above in the axis <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>axis <B>delete
-</B></B></I>?<I>axisName</I>?... </DT>
-<DD>Deletes the named axes. An axis is not really deleted until it
-is not longer in use, so it's safe to delete axes mapped to elements. </DD>
-
-<DT><I>pathName
-<B>axis invtransform <I>axisName value</I></B></I> </DT>
-<DD>Performs the inverse transformation, changing
-the screen coordinate <I>value</I> to a graph coordinate, mapping the value mapped
-to <I>axisName</I>. Returns the graph coordinate. </DD>
-
-<DT><I>pathName <B>axis limits <I>axisName</I></B></I>
-</DT>
-<DD>Returns a list of the minimum and maximum limits for <I>axisName</I>. The order
-of the list is <I>min max</I>. </DD>
-
-<DT><I>pathName <B>axis names </B></I>?<I>pattern</I>?... </DT>
-<DD>Returns a list of
-axes matching zero or more patterns. If no <I>pattern</I> argument is give, the
-names of all axes are returned. </DD>
-
-<DT><I>pathName <B>axis transform <I>axisName value</I></B></I> </DT>
-<DD>Transforms
-the coordinate <I>value</I> to a screen coordinate by mapping the it to <I>axisName</I>.
- Returns the transformed screen coordinate. </DD>
-</DL>
-<P>
-Only four axes can be displayed
-simultaneously. By default, they are <I>x</I>, <I>y</I>, <I>x2</I>, and <I>y2</I>. You can swap in
-a different axis with <B>use</B> operation of the special axis components: <B>xaxis</B>,
-<B>x2axis</B>, <B>yaxis</B>, and <B>y2axis</B>. <BR>
-<CODE>.g create axis temp<BR>
-.g create axis time<BR>
-...<BR>
-.g xaxis use temp<BR>
-.g yaxis use time<BR>
-</CODE><P>Only the axes specified for use are displayed on the screen. <P>
-The <B>xaxis</B>,
-<B>x2axis</B>, <B>yaxis</B>, and <B>y2axis</B> components operate on an axis location rather
-than a specific axis like the more general <B>axis</B> component does. The <B>xaxis</B>
-component manages the X-axis located in the bottom margin (whatever axis
-that happens to be). Likewise, <B>yaxis</B> uses the Y-axis in the left margin,
-<B>x2axis</B> the top X-axis, and <B>y2axis</B> the right Y-axis. <P>
-They implicitly control
-the axis that is currently using to that location. By default, <B>xaxis</B> uses
-the <I>x</I> axis, <B>yaxis</B> uses <I>y</I>, <B>x2axis</B> uses <I>x2</I>, and <B>y2axis</B> uses <I>y2</I>. These components
-can be more convenient to use than always determining what axes are current
-being displayed by the graph. <P>
-The following operations are available for
-axes. They mirror exactly the operations of the <B>axis</B> component. The <I>axis</I>
-argument must be <B>xaxis</B>, <B>x2axis</B>, <B>yaxis</B>, or <B>y2axis</B>.
-<DL>
-
-<DT><I>pathName <I>axis <B>cget <I>option</I></B></I></I>
-</DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis <B>configure </B></I></I>?<I>option value</I>?... </DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis<B> invtransform <I>value</I></B></I></I>
-</DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis <B>limits</B></I></I> </DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis<B> transform <I>value</I></B></I></I> </DT>
-<DD></DD>
-
-<DT><I>pathName <I>axis<B> use </B></I></I>?<I>axisName</I>?
- </DT>
-<DD>Designates the axis <I>axisName</I> is to be displayed at this location. <I>AxisName</I>
-can not be already in use at another location. This command returns the
-name of the axis currently using this location. </DD>
-</DL>
-
-<H3><A NAME="sect9" HREF="#toc9">Crosshairs Component</A></H3>
-Cross
-hairs consist of two intersecting lines (one vertical and one horizontal)
-drawn completely across the plotting area. They are used to position the
-mouse in relation to the coordinate axes. Cross hairs differ from line
-markers in that they are implemented using XOR drawing primitives. This
-means that they can be quickly drawn and erased without redrawing the entire
-strip chart. <P>
-The following operations are available for cross hairs:
-<DL>
-
-<DT><I>pathName
-<B>crosshairs cget <I>option</I></B></I> </DT>
-<DD>Returns the current value of the cross hairs configuration
-option given by <I>option</I>. <I>Option</I> may be any option described below for the
-cross hairs <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>crosshairs configure </B></I>?<I>option value</I>?...
- </DT>
-<DD>Queries or modifies the configuration options of the cross hairs. If
-<I>option</I> isn't specified, a list describing all the current options for the
-cross hairs is returned. If <I>option</I> is specified, but not <I>value</I>, then a
-list describing <I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs
-are specified, then for each pair, the cross hairs option <I>option</I> is set
-to <I>value</I>. The following options are available for cross hairs. <blockquote></DD>
-
-<DT><B>-color <I>color</I></B>
- </DT>
-<DD>Sets the color of the cross hairs. The default is <I>black</I>. </DD>
-
-<DT><B>-dashes <I>dashList</I></B>
-</DT>
-<DD>Sets the dash style of the cross hairs. <I>DashList</I> is a list of up to 11 numbers
-that alternately represent the lengths of the dashes and gaps on the cross
-hair lines. Each number must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the
-cross hairs will be solid lines. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether cross hairs
-are drawn. If <I>boolean</I> is true, cross hairs are not drawn. The default is
-<I>yes</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Set the width of the cross hair lines. The default
-is <I>1</I>. </DD>
-
-<DT><B>-position <I>pos</I></B> </DT>
-<DD>Specifies the screen position where the cross hairs
-intersect. <I>Pos</I> must be in the form "<I>@x,y</I>", where <I>x</I> and <I>y</I> are the window
-coordinates of the intersection. </DD>
-</DL>
-<P>
-Cross hairs configuration options may be
-also be set by the <B>option</B> command. The resource name and class are <I>crosshairs</I>
-and <I>Crosshairs</I> respectively. <BR>
-<CODE>option add *Stripchart.Crosshairs.LineWidth 2<BR>
-option add *Stripchart.Crosshairs.Color red<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>crosshairs off</B></I> </DT>
-<DD>Turns of the cross hairs. </DD>
-
-<DT><I>pathName <B>crosshairs on</B></I>
-</DT>
-<DD>Turns on the display of the cross hairs. </DD>
-
-<DT><I>pathName <B>crosshairs toggle</B></I> </DT>
-<DD>Toggles
-the current state of the cross hairs, alternately mapping and unmapping
-the cross hairs. </DD>
-</DL>
-
-<H3><A NAME="sect10" HREF="#toc10">Element Components</A></H3>
-A data element represents a set of data.
- It contains x and y vectors containing the coordinates of the data points.
- Elements can be displayed with a symbol at each data point and lines connecting
-the points. Elements also control the appearance of the data, such as the
-symbol type, line width, color etc. <P>
-When new data elements are created,
-they are automatically added to a list of displayed elements. The display
-list controls what elements are drawn and in what order. <P>
-The following
-operations are available for elements.
-<DL>
-
-<DT><I>pathName <B>element activate <I>elemName
-</I></B></I>?<I>index</I>?... </DT>
-<DD>Specifies the data points of element <I>elemName</I> to be drawn using
-active foreground and background colors. <I>ElemName</I> is the name of the element
-and <I>index</I> is a number representing the index of the data point. If no indices
-are present then all data points become active. </DD>
-
-<DT><I>pathName <B>element cget <I>elemName
-<I>option</I></I></B></I> </DT>
-<DD>Returns the current value of the element configuration option given
-by <I>option</I>. <I>Option</I> may be any option described below for the element <B>configure</B>
-operation. </DD>
-
-<DT><I>pathName <B>element closest <I>x y</I></B></I> <I>varName</I> ?<I>option value</I>?... ?<I>elemName</I>?...
-</DT>
-<DD>Finds the data point closest to the window coordinates <I>x</I> and <I>y</I> in the element
-<I>elemName</I>. <I>ElemName</I> is the name of an element, that must not be hidden.
-If no elements are specified, then all visible elements are searched. It
-returns via the array variable <I>varName</I> the name of the closest element,
-the index of its closest point, and the graph coordinates of the point.
-Returns <I>0</I>, if no data point within the threshold distance can be found,
-otherwise <I>1</I> is returned. The following <I>option</I>-<I>value</I> pairs are available.
-<blockquote></DD>
-
-<DT><B>-halo <I>pixels</I></B> </DT>
-<DD>Specifies a threshold distance where selected data points are
-ignored. <I>Pixels</I> is a valid screen distance, such as <I>2</I> or <I>1.2i</I>. If this option
-isn't specified, then it defaults to the value of the stripchart's <B>-halo</B> option.
-</DD>
-
-<DT><B>-interpolate <I>boolean</I></B> </DT>
-<DD>Indicates that both the data points and interpolated
-points along the line segment formed should be considered. If <I>boolean</I>
-is true, the closest line segment will be selected instead of the closest
-point. If this option isn't specified, <I>boolean</I> defaults to <I>0</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>element
-configure <I>elemName </I></B></I>?<I>option value</I>?... </DT>
-<DD>Queries or modifies the configuration
-options for elements. If <I>option</I> isn't specified, a list describing all the
-current options for <I>elemName</I> is returned. If <I>option</I> is specified, but not
-<I>value</I>, then a list describing the option <I>option</I> is returned. If one or
-more <I>option</I> and <I>value</I> pairs are specified, then for each pair, the element
-option <I>option</I> is set to <I>value</I>. The following options are valid for elements.
-<blockquote></DD>
-
-<DT><B>-activepen <I>penName</I></B> </DT>
-<DD>Specifies pen to use to draw active element. If <I>penName</I>
-is <I>""</I>, no active elements will be drawn. The default is <I>activeLine</I>. </DD>
-
-<DT><B>-color
-<I>color</I></B> </DT>
-<DD>Sets the color of the traces connecting the data points. </DD>
-
-<DT><B>-dashes
-<I>dashList</I></B> </DT>
-<DD>Sets the dash style of element line. <I>DashList</I> is a list of up to
-11 numbers that alternately represent the lengths of the dashes and gaps
-on the element line. Each number must be between 1 and 255. If <I>dashList</I>
-is <I>""</I>, the lines will be solid. </DD>
-
-<DT><B>-data <I>coordList</I></B> </DT>
-<DD>Specifies the X-Y coordinates
-of the data. <I>CoordList</I> is a list of numeric expressions representing the
-X-Y coordinate pairs of each data point. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the interior color
-of symbols. If <I>color</I> is <I>""</I>, then the interior of the symbol is transparent.
- If <I>color</I> is <I>defcolor</I>, then the color will be the same as the <B>-color</B> option.
- The default is <I>defcolor</I>. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether the element is
-displayed. The default is <I>no</I>. </DD>
-
-<DT><B>-label <I>text</I></B> </DT>
-<DD>Sets the element's label in the
-legend. If <I>text</I> is <I>""</I>, the element will have no entry in the legend. The
-default label is the element's name. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width of
-the connecting lines between data points. If <I>pixels</I> is <I>0</I>, no connecting
-lines will be drawn between symbols. The default is <I>0</I>. </DD>
-
-<DT><B>-mapx <I>xAxis</I></B> </DT>
-<DD>Selects
-the X-axis to map the element's X-coordinates onto. <I>XAxis</I> must be the name
-of an axis. The default is <I>x</I>. </DD>
-
-<DT><B>-mapy <I>yAxis</I></B> </DT>
-<DD>Selects the Y-axis to map the element's
-Y-coordinates onto. <I>YAxis</I> must be the name of an axis. The default is <I>y</I>. </DD>
-
-<DT><B>-offdash
-<I>color</I></B> </DT>
-<DD>Sets the color of the stripes when traces are dashed (see the <B>-dashes</B>
-option). If <I>color</I> is <I>""</I>, then the "off" pixels will represent gaps instead
-of stripes. If <I>color</I> is <I>defcolor</I>, then the color will be the same as the
-<B>-color</B> option. The default is <I>defcolor</I>. </DD>
-
-<DT><B>-outline <I>color</I></B> </DT>
-<DD>Sets the color or
-the outline around each symbol. If <I>color</I> is <I>""</I>, then no outline is drawn.
-If <I>color</I> is <I>defcolor</I>, then the color will be the same as the <B>-color</B> option.
- The default is <I>defcolor</I>. </DD>
-
-<DT><B>-outlinewidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the outline
-bordering each symbol. If <I>pixels</I> is <I>0</I>, no outline will be drawn. The default
-is <I>1</I>. </DD>
-
-<DT><B>-pixels <I>pixels</I></B> </DT>
-<DD>Sets the size of symbols. If <I>pixels</I> is <I>0</I>, no symbols
-will be drawn. The default is <I>0.125i</I>. </DD>
-
-<DT><B>-scalesymbols <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is
-true, the size of the symbols drawn for <I>elemName</I> will change with scale
-of the X-axis and Y-axis. At the time this option is set, the current ranges
-of the axes are saved as the normalized scales (i.e scale factor is 1.0)
-and the element is drawn at its designated size (see the <B>-pixels</B> option).
- As the scale of the axes change, the symbol will be scaled according to
-the smaller of the X-axis and Y-axis scales. If <I>boolean</I> is false, the element's
-symbols are drawn at the designated size, regardless of axis scales. The
-default is <I>0</I>. </DD>
-
-<DT><B>-smooth <I>smooth</I></B> </DT>
-<DD>Specifies how connecting line segments are
-drawn between data points. <I>Smooth</I> can be either <I>linear</I>, <I>step</I>, <I>natural</I>, or
-<I>quadratic</I>. If <I>smooth</I> is <I>linear</I>, a single line segment is drawn, connecting
-both data points. When <I>smooth</I> is <I>step</I>, two line segments are drawn. The first
-is a horizontal line segment which steps the next x-coordinate. The second
-is a vertical line, moving to the next y-coordinate. Both <I>natural</I> and <I>quadratic</I>
-generate multiple segments between data points. If <I>natural</I>, the segments
-are generated using a cubic spline. If <I>quadratic</I>, a quadratic spline is
-used. The default is <I>linear</I>. </DD>
-
-<DT><B>-styles <I>styleList</I></B> </DT>
-<DD>Specifies what pen to use
-based upon the range of weights given. <I>StyleList</I> is a list of style specifications.
-Each style specification, in turn, is a list consisting of a pen name,
-and optionally a minimum and maximum range. Data points whose weight (see
-the <B>-weight</B> option) falls in this range, are drawn with this pen. If no
-range is specified it defaults to the number of the pen in the list. </DD>
-
-<DT><B>-symbol
-<I>symbol</I></B> </DT>
-<DD>Specifies the symbol for data points. <I>Symbol</I> can be either <I>square</I>,
-<I>circle</I>, <I>diamond</I>, <I>plus</I>, <I>cross</I>, <I>splus</I>, <I>scross</I>, <I>triangle</I>, <I>""</I> (where no symbol
-is drawn), or a bitmap. Bitmaps are specified as "<I>source</I> ?<I>mask</I>?", where
-<I>source</I> is the name of the bitmap, and <I>mask</I> is the bitmap's optional mask.
- The default is <I>circle</I>. </DD>
-
-<DT><B>-weights <I>wVec</I></B> </DT>
-<DD>Specifies the weights of the individual
-data points. This, in conjunction with the list pen styles (see the <B>-styles</B>
-option) controls how data points are drawn. <I>WVec</I> is the name of a BLT vector
-or a list of numeric expressions representing the weights for each data
-point. </DD>
-
-<DT><B>-xdata <I>xVec</I></B> </DT>
-<DD>Specifies the x-coordinates of the data. <I>XVec</I> is the name
-of a BLT vector or a list of numeric expressions. </DD>
-
-<DT><B>-ydata <I>yVec</I></B> </DT>
-<DD>Specifies
-the y-coordinates of the data. <I>YVec</I> is the name of a BLT vector or a list
-of numeric expressions. </DD>
-</DL>
-<P>
-Element configuration options may also be set by
-the <B>option</B> command. The resource class is <I>Element</I>. The resource name is
-the name of the element. <BR>
-<CODE>option add *Stripchart.Element.symbol line<BR>
-option add *Stripchart.e1.symbol line<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>element create <I>elemName</I></B></I> ?<I>option value</I>?... </DT>
-<DD>Creates a new element <I>elemName</I>.
- It's an error is an element <I>elemName</I> already exists. If additional arguments
-are present, they specify options valid for element <B>configure</B> operation.
-</DD>
-
-<DT><I>pathName <B>element deactivate <I>elemName</I></B></I> ?<I>elemName</I>?... </DT>
-<DD>Deactivates all the elements
-matching <I>pattern</I>. Elements whose names match any of the patterns given are
-redrawn using their normal colors. </DD>
-
-<DT><I>pathName <B>element delete</B></I> ?<I>elemName</I>?... </DT>
-<DD>Deletes
-all the named elements. The graph is automatically redrawn. </DD>
-
-<DT><I>pathName <B>element
-exists <I>elemName</I></B></I> </DT>
-<DD>Returns <I>1</I> if an element <I>elemName</I> currently exists and <I>0</I>
-otherwise. </DD>
-
-<DT><I>pathName <B>element names </B></I>?<I>pattern</I>?... </DT>
-<DD>Returns the elements matching
-one or more pattern. If no <I>pattern</I> is given, the names of all elements
-is returned. </DD>
-
-<DT><I>pathName <B>element show</B></I> ?<I>nameList</I>? </DT>
-<DD>Queries or modifies the
-element display list. The element display list designates the elements
-drawn and in what order. <I>NameList</I> is a list of elements to be displayed
-in the order they are named. If there is no <I>nameList</I> argument, the current
-display list is returned. </DD>
-
-<DT><I>pathName <B>element type</B></I> <I>elemName</I> </DT>
-<DD>Returns the type
-of <I>elemName</I>. If the element is a bar element, the commands returns the
-string <I>"bar"</I>, otherwise it returns <I>"line"</I>. </DD>
-</DL>
-
-<H3><A NAME="sect11" HREF="#toc11"></CODE><P>Grid Component</A></H3>
-Grid lines extend
-from the major and minor ticks of each axis horizontally or vertically
-across the plotting area. The following operations are available for grid
-lines.
-<DL>
-
-<DT><I>pathName <B>grid cget <I>option</I></B></I> </DT>
-<DD>Returns the current value of the grid line
-configuration option given by <I>option</I>. <I>Option</I> may be any option described
-below for the grid <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>grid configure</B></I> ?<I>option
-value</I>?... </DT>
-<DD>Queries or modifies the configuration options for grid lines. If
-<I>option</I> isn't specified, a list describing all the current grid options for
-<I>pathName</I> is returned. If <I>option</I> is specified, but not <I>value</I>, then a list
-describing <I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs are
-specified, then for each pair, the grid line option <I>option</I> is set to <I>value</I>.
- The following options are valid for grid lines. <blockquote></DD>
-
-<DT><B>-color <I>color</I></B> </DT>
-<DD>Sets the color
-of the grid lines. The default is <I>black</I>. </DD>
-
-<DT><B>-dashes <I>dashList</I></B> </DT>
-<DD>Sets the dash style
-of the grid lines. <I>DashList</I> is a list of up to 11 numbers that alternately
-represent the lengths of the dashes and gaps on the grid lines. Each number
-must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the grid will be solid lines.
-</DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether the grid should be drawn. If <I>boolean</I> is true,
-grid lines are not shown. The default is <I>yes</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of grid lines. The default width is <I>1</I>. </DD>
-
-<DT><B>-mapx <I>xAxis</I></B> </DT>
-<DD>Specifies the X-axis to
-display grid lines. <I>XAxis</I> must be the name of an axis. The default is <I>x</I>.
-</DD>
-
-<DT><B>-mapy <I>yAxis</I></B> </DT>
-<DD>Specifies the Y-axis to display grid lines. <I>YAxis</I> must be the
-name of an axis. The default is <I>y</I>. </DD>
-
-<DT><B>-minor <I>boolean</I></B> </DT>
-<DD>Indicates whether the grid
-lines should be drawn for minor ticks. If <I>boolean</I> is true, the lines will
-appear at minor tick intervals. The default is <I>1</I>. </DD>
-</DL>
-<P>
-Grid configuration options
-may also be set by the <B>option</B> command. The resource name and class are
-<I>grid</I> and <I>Grid</I> respectively. <BR>
-<CODE>option add *Stripchart.grid.LineWidth 2<BR>
-option add *Stripchart.Grid.Color black<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>grid off</B></I> </DT>
-<DD>Turns off the display the grid lines. </DD>
-
-<DT><I>pathName <B>grid on</B></I>
-</DT>
-<DD>Turns on the display the grid lines. </DD>
-
-<DT><I>pathName <B>grid toggle</B></I> </DT>
-<DD>Toggles the display
-of the grid. </DD>
-</DL>
-
-<H3><A NAME="sect12" HREF="#toc12">Legend Component</A></H3>
-The legend displays a list of the data elements.
- Each entry consists of the element's symbol and label. The legend can appear
-in any margin (the default location is in the right margin). It can also
-be positioned anywhere within the plotting area. <P>
-The following operations
-are valid for the legend.
-<DL>
-
-<DT><I>pathName <B>legend activate <I>pattern</I></B></I>... </DT>
-<DD>Selects legend
-entries to be drawn using the active legend colors and relief. All entries
-whose element names match <I>pattern</I> are selected. To be selected, the element
-name must match only one <I>pattern</I>. </DD>
-
-<DT><I>pathName <B>legend cget <I>option</I></B></I> </DT>
-<DD>Returns the
-current value of a legend configuration option. <I>Option</I> may be any option
-described below in the legend <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>legend configure
-</B></I>?<I>option value</I>?... </DT>
-<DD>Queries or modifies the configuration options for the legend.
- If <I>option</I> isn't specified, a list describing the current legend options
-for <I>pathName</I> is returned. If <I>option</I> is specified, but not <I>value</I>, then a
-list describing <I>option</I> is returned. If one or more <I>option</I> and <I>value</I> pairs
-are specified, then for each pair, the legend option <I>option</I> is set to <I>value</I>.
- The following options are valid for the legend. <blockquote></DD>
-
-<DT><B>-activebackground <I>color</I></B>
-</DT>
-<DD>Sets the background color for active legend entries. All legend entries
-marked active (see the legend <B>activate</B> operation) are drawn using this
-background color. </DD>
-
-<DT><B>-activeborderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border
-around the outside edge of the active legend entries. The default is <I>2</I>.
-</DD>
-
-<DT><B>-activeforeground <I>color</I></B> </DT>
-<DD>Sets the foreground color for active legend entries.
- All legend entries marked as active (see the legend <B>activate</B> operation)
-are drawn using this foreground color. </DD>
-
-<DT><B>-activerelief <I>relief</I></B> </DT>
-<DD>Specifies the
-3-D effect desired for active legend entries. <I>Relief</I> denotes how the interior
-of the entry should appear relative to the legend; for example, <I>raised</I>
-means the entry should appear to protrude from the legend, relative to
-the surface of the legend. The default is <I>flat</I>. </DD>
-
-<DT><B>-anchor <I>anchor</I></B> </DT>
-<DD>Tells how
-to position the legend relative to the positioning point for the legend.
- This is dependent on the value of the <B>-position</B> option. The default is
-<I>center</I>. <blockquote></DD>
-
-<DT><I>left</I> or <I>right</I> </DT>
-<DD>The anchor describes how to position the legend vertically.
- </DD>
-
-<DT><I>top</I> or <I>bottom</I> </DT>
-<DD>The anchor describes how to position the legend horizontally.
- </DD>
-
-<DT><I>@x,y</I> </DT>
-<DD>The anchor specifies how to position the legend relative to the
-positioning point. For example, if <I>anchor</I> is <I>center</I> then the legend is centered
-on the point; if <I>anchor</I> is <I>n</I> then the legend will be drawn such that the
-top center point of the rectangular region occupied by the legend will
-be at the positioning point. </DD>
-
-<DT><I>plotarea</I> </DT>
-<DD>The anchor specifies how to position
-the legend relative to the plotting area. For example, if <I>anchor</I> is <I>center</I>
-then the legend is centered in the plotting area; if <I>anchor</I> is <I>ne</I> then
-the legend will be drawn such that occupies the upper right corner of the
-plotting area. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets the background color of the legend.
-If <I>color</I> is <I>""</I>, the legend background with be transparent. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B>
-</DT>
-<DD>Sets the width of the 3-D border around the outside edge of the legend (if
-such border is being drawn; the <B>relief</B> option determines this). The default
-is <I>2</I> pixels. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD><I>FontName</I> specifies a font to use when drawing
-the labels of each element into the legend. The default is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>.
-</DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets the foreground color of the text drawn for the element's
-label. The default is <I>black</I>. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether the legend should
-be displayed. If <I>boolean</I> is true, the legend will not be draw. The default
-is <I>no</I>. </DD>
-
-<DT><B>-ipadx <I>pad</I></B> </DT>
-<DD>Sets the amount of internal padding to be added to the
-width of each legend entry. <I>Pad</I> can be a list of one or two screen distances.
- If <I>pad</I> has two elements, the left side of the legend entry is padded by
-the first distance and the right side by the second. If <I>pad</I> is just one
-distance, both the left and right sides are padded evenly. The default
-is <I>2</I>. </DD>
-
-<DT><B>-ipady <I>pad</I></B> </DT>
-<DD>Sets an amount of internal padding to be added to the height
-of each legend entry. <I>Pad</I> can be a list of one or two screen distances.
- If <I>pad</I> has two elements, the top of the entry is padded by the first distance
-and the bottom by the second. If <I>pad</I> is just one distance, both the top
-and bottom of the entry are padded evenly. The default is <I>2</I>. </DD>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets
-the padding to the left and right exteriors of the legend. <I>Pad</I> can be a
-list of one or two screen distances. If <I>pad</I> has two elements, the left
-side of the legend is padded by the first distance and the right side by
-the second. If <I>pad</I> has just one distance, both the left and right sides
-are padded evenly. The default is <I>4</I>. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets the padding above and
-below the legend. <I>Pad</I> can be a list of one or two screen distances. If
-<I>pad</I> has two elements, the area above the legend is padded by the first
-distance and the area below by the second. If <I>pad</I> is just one distance,
-both the top and bottom areas are padded evenly. The default is <I>0</I>. </DD>
-
-<DT><B>-position
-<I>pos</I></B> </DT>
-<DD>Specifies where the legend is drawn. The <B>-anchor</B> option also affects
-where the legend is positioned. If <I>pos</I> is <I>left</I>, <I>left</I>, <I>top</I>, or <I>bottom</I>, the
-legend is drawn in the specified margin. If <I>pos</I> is <I>plotarea</I>, then the legend
-is drawn inside the plotting area at a particular anchor. If <I>pos</I> is in
-the form "<I>@x,y</I>", where <I>x</I> and <I>y</I> are the window coordinates, the legend is
-drawn in the plotting area at the specified coordinates. The default is
-<I>right</I>. </DD>
-
-<DT><B>-raised <I>boolean</I></B> </DT>
-<DD>Indicates whether the legend is above or below the
-data elements. This matters only if the legend is in the plotting area.
- If <I>boolean</I> is true, the legend will be drawn on top of any elements that
-may overlap it. The default is <I>no</I>. </DD>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect
-for the border around the legend. <I>Relief</I> specifies how the interior of the
-legend should appear relative to the strip chart; for example, <I>raised</I> means
-the legend should appear to protrude from the strip chart, relative to
-the surface of the strip chart. The default is <I>sunken</I>. </DD>
-</DL>
-<P>
-Legend configuration
-options may also be set by the <B>option</B> command. The resource name and class
-are <I>legend</I> and <I>Legend</I> respectively. <BR>
-<CODE>option add *Stripchart.legend.Foreground blue<BR>
-option add *Stripchart.Legend.Relief raised<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>legend deactivate <I>pattern</I></B></I>... </DT>
-<DD>Selects legend entries to be drawn using
-the normal legend colors and relief. All entries whose element names match
-<I>pattern</I> are selected. To be selected, the element name must match only
-one <I>pattern</I>. </DD>
-
-<DT><I>pathName <B>legend get <I>pos</I></B></I> </DT>
-<DD>Returns the name of the element whose
-entry is at the screen position <I>pos</I> in the legend. <I>Pos</I> must be in the form
-"<I>@x,y</I>", where <I>x</I> and <I>y</I> are window coordinates. If the given coordinates
-do not lie over a legend entry, <I>""</I> is returned. </DD>
-</DL>
-
-<H3><A NAME="sect13" HREF="#toc13">Pen Components</A></H3>
-Pens define
-attributes (both symbol and line style) for elements. Pens mirror the configuration
-options of data elements that pertain to how symbols and lines are drawn.
- Data elements use pens to determine how they are drawn. A data element
-may use several pens at once. In this case, the pen used for a particular
-data point is determined from each element's weight vector (see the element's
-<B>-weight</B> and <B>-style</B> options). <P>
-One pen, called <I>activeLine</I>, is automatically
-created. It's used as the default active pen for elements. So you can change
-the active attributes for all elements by simply reconfiguring this pen.
-<BR>
-<CODE>.s pen configure "activeLine" -color green<BR>
-</CODE><P>You can create and use any number of pens. To create a pen, invoke the pen
-component and its create operation. <BR>
-<CODE>.s pen create myPen<BR>
-</CODE><P>You map pens to a data element using either the element's <B>-pen</B> or <B>-activepen</B>
-options. <BR>
-<CODE>.s element create "line1" -xdata $x -ydata $tempData \<BR>
- -pen myPen<BR>
-</CODE><P>An element can use several pens at once. This is done by specifying the
-name of the pen in the element's style list (see the <B>-styles</B> option). <BR>
-<CODE>.s element configure "line1" -styles { myPen 2.0 3.0 }<BR>
-</CODE><P>This says that any data point with a weight between 2.0 and 3.0 is to be
-drawn using the pen <I>myPen</I>. All other points are drawn with the element's
-default attributes. <P>
-The following operations are available for pen components.
-<P>
-
-<DL>
-
-<DT><I>pathName <B>pen <B>cget <I>penName <I>option</I></I></B></B></I> </DT>
-<DD>Returns the current value of the option
-given by <I>option</I> for <I>penName</I>. <I>Option</I> may be any option described below for
-the pen <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>pen <B>configure <I>penName </I></B></B></I>?<I>option value</I>?...
-</DT>
-<DD>Queries or modifies the configuration options of <I>penName</I>. If <I>option</I> isn't
-specified, a list describing the current options for <I>penName</I> is returned.
- If <I>option</I> is specified, but not <I>value</I>, then a list describing <I>option</I> is
-returned. If one or more <I>option</I> and <I>value</I> pairs are specified, then for
-each pair, the pen option <I>option</I> is set to <I>value</I>. The following options
-are valid for pens. <blockquote></DD>
-
-<DT><B>-color <I>color</I></B> </DT>
-<DD>Sets the color of the traces connecting
-the data points. </DD>
-
-<DT><B>-dashes <I>dashList</I></B> </DT>
-<DD>Sets the dash style of element line. <I>DashList</I>
-is a list of up to 11 numbers that alternately represent the lengths of
-the dashes and gaps on the element line. Each number must be between 1
-and 255. If <I>dashList</I> is <I>""</I>, the lines will be solid. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the
-interior color of symbols. If <I>color</I> is <I>""</I>, then the interior of the symbol
-is transparent. If <I>color</I> is <I>defcolor</I>, then the color will be the same as
-the <B>-color</B> option. The default is <I>defcolor</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of the connecting lines between data points. If <I>pixels</I> is <I>0</I>, no connecting
-lines will be drawn between symbols. The default is <I>0</I>. </DD>
-
-<DT><B>-offdash <I>color</I></B> </DT>
-<DD>Sets
-the color of the stripes when traces are dashed (see the <B>-dashes</B> option).
- If <I>color</I> is <I>""</I>, then the "off" pixels will represent gaps instead of stripes.
- If <I>color</I> is <I>defcolor</I>, then the color will be the same as the <B>-color</B> option.
- The default is <I>defcolor</I>. </DD>
-
-<DT><B>-outline <I>color</I></B> </DT>
-<DD>Sets the color or the outline around
-each symbol. If <I>color</I> is <I>""</I>, then no outline is drawn. If <I>color</I> is <I>defcolor</I>,
-then the color will be the same as the <B>-color</B> option. The default is <I>defcolor</I>.
-</DD>
-
-<DT><B>-outlinewidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the outline bordering each symbol.
- If <I>pixels</I> is <I>0</I>, no outline will be drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-pixels <I>pixels</I></B>
-</DT>
-<DD>Sets the size of symbols. If <I>pixels</I> is <I>0</I>, no symbols will be drawn. The
-default is <I>0.125i</I>. </DD>
-
-<DT><B>-symbol <I>symbol</I></B> </DT>
-<DD>Specifies the symbol for data points. <I>Symbol</I>
-can be either <I>square</I>, <I>circle</I>, <I>diamond</I>, <I>plus</I>, <I>cross</I>, <I>splus</I>, <I>scross</I>, <I>triangle</I>,
-<I>""</I> (where no symbol is drawn), or a bitmap. Bitmaps are specified as "<I>source</I>
-?<I>mask</I>?", where <I>source</I> is the name of the bitmap, and <I>mask</I> is the bitmap's
-optional mask. The default is <I>circle</I>. </DD>
-
-<DT><B>-type <I>elemType</I></B> </DT>
-<DD>Specifies the type
-of element the pen is to be used with. This option should only be employed
-when creating the pen. This is for those that wish to mix different types
-of elements (bars and lines) on the same graph. The default type is "line".
-</DD>
-</DL>
-<P>
-Pen configuration options may be also be set by the <B>option</B> command. The
-resource class is <I>Pen</I>. The resource names are the names of the pens. <BR>
-<CODE>option add *Stripchart.Pen.Color blue<BR>
-option add *Stripchart.activeLine.color green<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>pen <B>create <I>penName </I></B></B></I>?<I>option value</I>?... </DT>
-<DD>Creates a new pen by the name
-<I>penName</I>. No pen by the same name can already exist. <I>Option</I> and <I>value</I> are
-described in above in the pen <B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>pen <B>delete
-</B></B></I>?<I>penName</I>?... </DT>
-<DD>Deletes the named pens. A pen is not really deleted until it is
-not longer in use, so it's safe to delete pens mapped to elements. </DD>
-
-<DT><I>pathName
-<B>pen names </B></I>?<I>pattern</I>?... </DT>
-<DD>Returns a list of pens matching zero or more patterns.
- If no <I>pattern</I> argument is give, the names of all pens are returned. </DD>
-</DL>
-
-<H3><A NAME="sect14" HREF="#toc14">PostScript
-Component</A></H3>
-The strip chart can generate encapsulated PostScript output. There
-are several configuration options you can specify to control how the plot
-is generated. You can change the page dimensions and borders. The plot
-itself can be scaled, centered, or rotated to landscape. The PostScript
-output can be written directly to a file or returned through the interpreter.
-<P>
-The following postscript operations are available.
-<DL>
-
-<DT><I>pathName <B>postscript cget
-<I>option</I></B></I> </DT>
-<DD>Returns the current value of the postscript option given by <I>option</I>.
- <I>Option</I> may be any option described below for the postscript <B>configure</B>
-operation. </DD>
-
-<DT><I>pathName <B>postscript configure </B></I>?<I>option value</I>?... </DT>
-<DD>Queries or modifies
-the configuration options for PostScript generation. If <I>option</I> isn't specified,
-a list describing the current postscript options for <I>pathName</I> is returned.
- If <I>option</I> is specified, but not <I>value</I>, then a list describing <I>option</I> is
-returned. If one or more <I>option</I> and <I>value</I> pairs are specified, then for
-each pair, the postscript option <I>option</I> is set to <I>value</I>. The following
-postscript options are available. <blockquote></DD>
-
-<DT><B>-center <I>boolean</I></B> </DT>
-<DD>Indicates whether the plot
-should be centered on the PostScript page. If <I>boolean</I> is false, the plot
-will be placed in the upper left corner of the page. The default is <I>1</I>. </DD>
-
-<DT><B>-colormap
-<I>varName</I></B> </DT>
-<DD><I>VarName</I> must be the name of a global array variable that specifies
-a color mapping from the X color name to PostScript. Each element of <I>varName</I>
-must consist of PostScript code to set a particular color value (e.g. ``<I>1.0
-1.0 0.0 setrgbcolor</I>''). When outputting color information in PostScript, the
-array variable <I>varName</I> is checked to see if an element of the name of
-the color exists. If so, it uses the value of the element as the PostScript
-command to set the color. If this option hasn't been specified, or if there
-isn't an entry in <I>varName</I> for a given color, then it uses the red, green,
-and blue intensities from the X color. </DD>
-
-<DT><B>-colormode <I>mode</I></B> </DT>
-<DD>Specifies how to output
-color information. <I>Mode</I> must be either <I>color</I> (for full color output), <I>gray</I>
-(convert all colors to their gray-scale equivalents) or <I>mono</I> (convert foreground
-colors to black and background colors to white). The default mode is <I>color</I>.
- </DD>
-
-<DT><B>-fontmap <I>varName</I></B> </DT>
-<DD><I>VarName</I> must be the name of a global array variable that
-specifies a font mapping from the X font name to PostScript. Each element
-of <I>varName</I> must consist of a Tcl list with one or two elements, which are
-the name and point size of a PostScript font. When outputting PostScript
-commands for a particular font, the array variable <I>varName</I> is checked
-to see an element of the specified font exists. If there is such an element,
-then the font information contained in that element is used in the PostScript
-output. (If the point size is omitted from the list, the point size of
-the X font is used). Otherwise the X font is examined in an attempt to
-guess what PostScript font to use. This works only for fonts whose foundry
-property is <I>Adobe</I> (such as Times, Helvetica, Courier, etc.). If all of this
-fails then the font defaults to <I>Helvetica-Bold</I>. </DD>
-
-<DT><B>-decorations <I>boolean</I></B> </DT>
-<DD>Indicates
-if PostScript commands to generate color backgrounds and 3-D borders should
-be output. If <I>boolean</I> is false, the background will be white and no 3-D
-borders will be generated. The default is <I>1</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B> </DT>
-<DD>Sets the height
-of the plot. This lets you plot the stripchart with a height different
-from the one displayed on the screen. If <I>pixels</I> is 0, the height is the
-same as the displayed height. The default is <I>0</I>. </DD>
-
-<DT><B>-landscape <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I>
-is true, this specifies the printed area is to be rotated 90 degrees. In
-non-rotated output the X-axis of the printed area runs along the short dimension
-of the page (``portrait'' orientation); in rotated output the X-axis runs along
-the long dimension of the page (``landscape'' orientation). Defaults to <I>0</I>. </DD>
-
-<DT><B>-maxpect
-<I>boolean</I></B> </DT>
-<DD>Indicates to scale the the plot so that it fills the PostScript
-page. The aspect ratio of the strip chart is still retained. The default
-is <I>0</I>. </DD>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets the horizontal padding for the left and right page borders.
- The borders are exterior to the plot. <I>Pad</I> can be a list of one or two
-screen distances. If <I>pad</I> has two elements, the left border is padded by
-the first distance and the right border by the second. If <I>pad</I> has just
-one distance, both the left and right borders are padded evenly. The default
-is <I>1i</I>. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets the vertical padding for the top and bottom page borders.
-The borders are exterior to the plot. <I>Pad</I> can be a list of one or two screen
-distances. If <I>pad</I> has two elements, the top border is padded by the first
-distance and the bottom border by the second. If <I>pad</I> has just one distance,
-both the top and bottom borders are padded evenly. The default is <I>1i</I>. </DD>
-
-<DT><B>-paperheight
-<I>pixels</I></B> </DT>
-<DD>Sets the height of the postscript page. This can be used to select
-between different page sizes (letter, A4, etc). The default height is <I>11.0i</I>.
-</DD>
-
-<DT><B>-paperwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the postscript page. This can be used
-to select between different page sizes (letter, A4, etc). The default width
-is <I>8.5i</I>. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Sets the width of the plot. This lets you plot the
-strip chart with a width different from the one drawn on the screen. If
-<I>pixels</I> is 0, the width is the same as the widget's width. The default is
-<I>0</I>. </DD>
-</DL>
-<P>
-Postscript configuration options may be also be set by the <B>option</B> command.
- The resource name and class are <I>postscript</I> and <I>Postscript</I> respectively.
-<BR>
-<CODE>option add *Stripchart.postscript.Decorations false<BR>
-option add *Stripchart.Postscript.Landscape true<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>postscript output </B></I>?<I>fileName</I>? ?<I>option value</I>?... </DT>
-<DD>Outputs a file of
-encapsulated PostScript. If a <I>fileName</I> argument isn't present, the command
-returns the PostScript. If any <I>option-value</I> pairs are present, they set configuration
-options controlling how the PostScript is generated. <I>Option</I> and <I>value</I> can
-be anything accepted by the postscript <B>configure</B> operation above. </DD>
-</DL>
-
-<H3><A NAME="sect15" HREF="#toc15">Marker
-Components</A></H3>
-Markers are simple drawing procedures used to annotate or highlight
-areas of the strip chart. Markers have various types: text strings, bitmaps,
-images, connected lines, windows, or polygons. They can be associated with
-a particular element, so that when the element is hidden or un-hidden, so
-is the marker. By default, markers are the last items drawn, so that data
-elements will appear in behind them. You can change this by configuring
-the <B>-under</B> option. <P>
-Markers, in contrast to elements, don't affect the scaling
-of the coordinate axes. They can also have <I>elastic</I> coordinates (specified
-by <I>-Inf</I> and <I>Inf</I> respectively) that translate into the minimum or maximum
-limit of the axis. For example, you can place a marker so it always remains
-in the lower left corner of the plotting area, by using the coordinates
-<I>-Inf</I>,<I>-Inf</I>. <P>
-The following operations are available for markers.
-<DL>
-
-<DT><I>pathName <B>marker
-after <I>markerId</I></B></I> ?<I>afterId</I>? </DT>
-<DD>Changes the order of the markers, drawing the
-first marker after the second. If no second <I>afterId</I> argument is specified,
-the marker is placed at the end of the display list. This command can be
-used to control how markers are displayed since markers are drawn in the
-order of this display list. </DD>
-
-<DT><I>pathName <B>marker before <I>markerId</I></B></I> ?<I>beforeId</I>? </DT>
-<DD>Changes
-the order of the markers, drawing the first marker before the second. If
-no second <I>beforeId</I> argument is specified, the marker is placed at the beginning
-of the display list. This command can be used to control how markers are
-displayed since markers are drawn in the order of this display list. </DD>
-
-<DT><I>pathName
-<B>marker cget <I>option</I></B></I> </DT>
-<DD>Returns the current value of the marker configuration
-option given by <I>option</I>. <I>Option</I> may be any option described below in the
-<B>configure</B> operation. </DD>
-
-<DT><I>pathName <B>marker configure <I>markerId</I></B></I> ?<I>option value</I>?... </DT>
-<DD>Queries
-or modifies the configuration options for markers. If <I>option</I> isn't specified,
-a list describing the current options for <I>markerId</I> is returned. If <I>option</I>
-is specified, but not <I>value</I>, then a list describing <I>option</I> is returned.
-If one or more <I>option</I> and <I>value</I> pairs are specified, then for each pair,
-the marker option <I>option</I> is set to <I>value</I>. <P>
-The following options are valid
-for all markers. Each type of marker also has its own type-specific options.
- They are described in the sections below. <blockquote></DD>
-
-<DT><B>-coords <I>coordList</I></B> </DT>
-<DD>Specifies the
-coordinates of the marker. <I>CoordList</I> is a list of graph coordinates. The
-number of coordinates required is dependent on the type of marker. Text,
-image, and window markers need only two coordinates (an X-Y coordinate).
- Bitmap markers can take either two or four coordinates (if four, they
-represent the corners of the bitmap). Line markers need at least four coordinates,
-polygons at least six. If <I>coordList</I> is <I>""</I>, the marker will not be displayed.
-The default is <I>""</I>. </DD>
-
-<DT><B>-element <I>elemName</I></B> </DT>
-<DD>Links the marker with the element <I>elemName</I>.
- The marker is drawn only if the element is also currently displayed (see
-the element's <B>show</B> operation). If <I>elemName</I> is <I>""</I>, the marker is always drawn.
- The default is <I>""</I>. </DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>Indicates whether the marker is drawn.
-If <I>boolean</I> is true, the marker is not drawn. The default is <I>no</I>. </DD>
-
-<DT><B>-mapx <I>xAxis</I></B>
- </DT>
-<DD>Specifies the X-axis to map the marker's X-coordinates onto. <I>XAxis</I> must the
-name of an axis. The default is <I>x</I>. </DD>
-
-<DT><B>-mapy <I>yAxis</I></B> </DT>
-<DD>Specifies the Y-axis to map
-the marker's Y-coordinates onto. <I>YAxis</I> must the name of an axis. The default
-is <I>y</I>. </DD>
-
-<DT><B>-name <I>markerId</I></B> </DT>
-<DD>Changes the identifier for the marker. The identifier
-<I>markerId</I> can not already be used by another marker. If this option isn't
-specified, the marker's name is uniquely generated. </DD>
-
-<DT><B>-under <I>boolean</I></B> </DT>
-<DD>Indicates
-whether the marker is drawn below/above data elements. If <I>boolean</I> is true,
-the marker is be drawn underneath the data element symbols and lines. Otherwise,
-the marker is drawn on top of the element. The default is <I>0</I>. </DD>
-
-<DT><B>-xoffset <I>pixels</I></B>
-</DT>
-<DD>Specifies a screen distance to offset the marker horizontally. <I>Pixels</I> is
-a valid screen distance, such as <I>2</I> or <I>1.2i</I>. The default is <I>0</I>. </DD>
-
-<DT><B>-yoffset <I>pixels</I></B>
-</DT>
-<DD>Specifies a screen distance to offset the markers vertically. <I>Pixels</I> is
-a valid screen distance, such as <I>2</I> or <I>1.2i</I>. The default is <I>0</I>. </DD>
-</DL>
-<P>
-Marker configuration
-options may also be set by the <B>option</B> command. The resource class is either
-<I>BitmapMarker</I>, <I>ImageMarker</I>, <I>LineMarker</I>, <I>PolygonMarker</I>, <I>TextMarker</I>, or
-<I>WindowMarker</I>, depending on the type of marker. The resource name is the
-name of the marker. <BR>
-<CODE>option add *Stripchart.TextMarker.Foreground white<BR>
-option add *Stripchart.BitmapMarker.Foreground white<BR>
-option add *Stripchart.m1.Background blue<BR>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P><I>pathName <B>marker create <I>type</I></B></I> ?<I>option value</I>?... </DT>
-<DD>Creates a marker of the selected
-type. <I>Type</I> may be either <I>text</I>, <I>line</I>, <I>bitmap</I>, <I>image</I>, <I>polygon</I>, or <I>window</I>.
-This command returns the marker identifier, used as the <I>markerId</I> argument
-in the other marker-related commands. If the <B>-name</B> option is used, this overrides
-the normal marker identifier. If the name provided is already used for
-another marker, the new marker will replace the old. </DD>
-
-<DT><I>pathName <B>marker delete</B></I>
-?<I>name</I>?... </DT>
-<DD>Removes one of more markers. The graph will automatically be redrawn
-without the marker.. </DD>
-
-<DT><I>pathName <B>marker exists <I>markerId</I></B></I> </DT>
-<DD>Returns <I>1</I> if the
-marker <I>markerId</I> exists and <I>0</I> otherwise. </DD>
-
-<DT><I>pathName <B>marker names</B></I> ?<I>pattern</I>?
- </DT>
-<DD>Returns the names of all the markers that currently exist. If <I>pattern</I>
-is supplied, only those markers whose names match it will be returned. </DD>
-
-<DT><I>pathName
-<B>marker type <I>markerId</I></B></I> </DT>
-<DD>Returns the type of the marker given by <I>markerId</I>,
-such as <I>line</I> or <I>text</I>. If <I>markerId</I> is not a valid a marker identifier, <I>""</I>
-is returned. </DD>
-</DL>
-
-<H3><A NAME="sect16" HREF="#toc16">Bitmap Markers</A></H3>
-A bitmap marker displays a bitmap. The size of
-the bitmap is controlled by the number of coordinates specified. If two
-coordinates, they specify the position of the top-left corner of the bitmap.
- The bitmap retains its normal width and height. If four coordinates, the
-first and second pairs of coordinates represent the corners of the bitmap.
- The bitmap will be stretched or reduced as necessary to fit into the bounding
-rectangle. <P>
-Bitmap markers are created with the marker's <B>create</B> operation
-in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create bitmap </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration options
-for the marker. These same <I>option</I>-<I>value</I> pairs may be used with the marker's
-<B>configure</B> operation. <P>
-The following options are specific to bitmap markers:
-
-<DL>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets the background color of the bitmap. If <I>color</I> is <I>""</I>,
-the background color will be transparent. The default background color
-is <I>white</I>. </DD>
-
-<DT><B>-bitmap <I>bitmap</I></B> </DT>
-<DD>Specifies the bitmap to be displayed. If <I>bitmap</I>
-is <I>""</I>, the marker will not be displayed. The default is <I>""</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B>
- </DT>
-<DD>Sets the foreground color of the bitmap. The default foreground color
-is <I>black</I>. </DD>
-
-<DT><B>-mask <I>mask</I></B> </DT>
-<DD>Specifies a mask for the bitmap to be displayed. This
-mask is a bitmap itself, denoting the pixels that are transparent. If <I>mask</I>
-is <I>""</I>, all pixels of the bitmap will be drawn. The default is <I>""</I>. </DD>
-
-<DT><B>-rotate
-<I>theta</I></B> </DT>
-<DD>Sets the rotation of the bitmap. <I>Theta</I> is a real number representing
-the angle of rotation in degrees. The marker is first rotated and then
-placed according to its anchor position. The default rotation is <I>0.0</I>. </DD>
-</DL>
-
-<H3><A NAME="sect17" HREF="#toc17">Image
-Markers</A></H3>
-A image marker displays an image. Image markers are created with
-the marker's <B>create</B> operation in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create image </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option for
-the marker. These same <I>option</I>-<I>value</I> pairs may be used with the marker's <B>configure</B>
-operation. <P>
-The following options are specific to image markers:
-<DL>
-
-<DT><B>-anchor <I>anchor</I></B>
-</DT>
-<DD><I>Anchor</I> tells how to position the image relative to the positioning point
-for the image. For example, if <I>anchor</I> is <I>center</I> then the image is centered
-on the point; if <I>anchor</I> is <I>n</I> then the image will be drawn such that the
-top center point of the rectangular region occupied by the image will be
-at the positioning point. This option defaults to <I>center</I>. </DD>
-
-<DT><B>-image <I>image</I></B> </DT>
-<DD>Specifies
-the image to be drawn. If <I>image</I> is <I>""</I>, the marker will not be drawn. The
-default is <I>""</I>. </DD>
-</DL>
-
-<H3><A NAME="sect18" HREF="#toc18">Line Markers</A></H3>
-A line marker displays one or more connected
-line segments. Line markers are created with marker's <B>create</B> operation in
-the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create line </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option for
-the marker. These same <I>option</I>-<I>value</I> pairs may be used with the marker's <B>configure</B>
-operation. <P>
-The following options are specific to line markers:
-<DL>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Sets the background color of the line. The option is affects the line
-color only when the <B>-stipple</B> option is set. If this option isn't specified
-then it defaults to <I>white</I>. </DD>
-
-<DT><B>-dashes <I>dashList</I></B> </DT>
-<DD>Sets the dash style of the line.
-<I>DashList</I> is a list of up to 11 numbers that alternately represent the lengths
-of the dashes and gaps on the line. Each number must be between 1 and 255.
- If <I>dashList</I> is <I>""</I>, the marker line will be solid. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets
-the foreground color. The default foreground color is <I>black</I>. </DD>
-
-<DT><B>-linewidth <I>pixels</I></B>
-</DT>
-<DD>Sets the width of the lines. The default width is <I>0</I>. </DD>
-
-<DT><B>-stipple <I>bitmap</I></B> </DT>
-<DD>Specifies
-a stipple pattern used to draw the line, rather than a solid line. <I>Bitmap</I>
-specifies a bitmap to use as the stipple pattern. If <I>bitmap</I> is <I>""</I>, then
-the line is drawn in a solid fashion. The default is <I>""</I>. </DD>
-</DL>
-
-<H3><A NAME="sect19" HREF="#toc19">Polygon Markers</A></H3>
-A
-polygon marker displays a closed region described as two or more connected
-line segments. It is assumed the first and last points are connected. Polygon
-markers are created using the marker <B>create</B> operation in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create polygon </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option for
-the marker. These same <I>option</I>-<I>value</I> pairs may be used with the <B>marker configure</B>
-command to change the marker's configuration. The following options are supported
-for polygon markers:
-<DL>
-
-<DT><B>-dashes <I>dashList</I></B> </DT>
-<DD>Sets the dash style of the outline
-of the polygon. <I>DashList</I> is a list of up to 11 numbers that alternately
-represent the lengths of the dashes and gaps on the outline. Each number
-must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the outline will be a solid
-line. </DD>
-
-<DT><B>-fill <I>color</I></B> </DT>
-<DD>Sets the fill color of the polygon. If <I>color</I> is <I>""</I>, then
-the interior of the polygon is transparent. The default is <I>white</I>. </DD>
-
-<DT><B>-linewidth
-<I>pixels</I></B> </DT>
-<DD>Sets the width of the outline of the polygon. If <I>pixels</I> is zero,
- no outline is drawn. The default is <I>0</I>. </DD>
-
-<DT><B>-outline <I>color</I></B> </DT>
-<DD>Sets the color of the
-outline of the polygon. If the polygon is stippled (see the <B>-stipple</B> option),
-then this represents the foreground color of the stipple. The default is
-<I>black</I>. </DD>
-
-<DT><B>-stipple <I>bitmap</I></B> </DT>
-<DD>Specifies that the polygon should be drawn with a
-stippled pattern rather than a solid color. <I>Bitmap</I> specifies a bitmap to
-use as the stipple pattern. If <I>bitmap</I> is <I>""</I>, then the polygon is filled
-with a solid color (if the <B>-fill</B> option is set). The default is <I>""</I>. </DD>
-</DL>
-
-<H3><A NAME="sect20" HREF="#toc20">Text
-Markers</A></H3>
-A text marker displays a string of characters on one or more lines
-of text. Embedded newlines cause line breaks. They may be used to annotate
-regions of the strip chart. Text markers are created with the <B>create</B> operation
-in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create text </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option
-for the text marker. These same <I>option</I>-<I>value</I> pairs may be used with the
- marker's <B>configure</B> operation. <P>
-The following options are specific to text
-markers:
-<DL>
-
-<DT><B>-anchor <I>anchor</I></B> </DT>
-<DD><I>Anchor</I> tells how to position the text relative to
-the positioning point for the text. For example, if <I>anchor</I> is <I>center</I> then
-the text is centered on the point; if <I>anchor</I> is <I>n</I> then the text will be
-drawn such that the top center point of the rectangular region occupied
-by the text will be at the positioning point. This default is <I>center</I>. </DD>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Sets the background color of the text string. If <I>color</I> is <I>""</I>, the
-background will be transparent. The default is <I>white</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Specifies
-the font of the text. The default is <I>*-Helvetica-Bold-R-Normal-*-120-*</I>. </DD>
-
-<DT><B>-foreground
-<I>color</I></B> </DT>
-<DD>Sets the foreground color of the text. The default is <I>black</I>. </DD>
-
-<DT><B>-justify
-<I>justify</I></B> </DT>
-<DD>Specifies how the text should be justified. This matters only when
-the marker contains more than one line of text. <I>Justify</I> must be <I>left</I>, <I>right</I>,
-or <I>center</I>. The default is <I>center</I>. </DD>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets the padding to the left
-and right exteriors of the text. <I>Pad</I> can be a list of one or two screen
-distances. If <I>pad</I> has two elements, the left side of the text is padded
-by the first distance and the right side by the second. If <I>pad</I> has just
-one distance, both the left and right sides are padded evenly. The default
-is <I>4</I>. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets the padding above and below the text. <I>Pad</I> can be a list
-of one or two screen distances. If <I>pad</I> has two elements, the area above
-the text is padded by the first distance and the area below by the second.
-If <I>pad</I> is just one distance, both the top and bottom areas are padded evenly.
- The default is <I>4</I>. </DD>
-
-<DT><B>-rotate <I>theta</I></B> </DT>
-<DD>Specifies the number of degrees to rotate
-the text. <I>Theta</I> is a real number representing the angle of rotation. The
-marker is first rotated along its center and is then drawn according to
-its anchor position. The default is <I>0.0</I>. </DD>
-
-<DT><B>-text <I>text</I></B> </DT>
-<DD>Specifies the text of the
-marker. The exact way the text is displayed may be affected by other options
-such as <B>-anchor</B> or <B>-rotate</B>. </DD>
-</DL>
-
-<H3><A NAME="sect21" HREF="#toc21">Window Markers</A></H3>
-A window marker displays a widget
-at a given position. Window markers are created with the marker's <B>create</B>
-operation in the form: <BR>
-<P>
-<CODE><I>pathName <B>marker create window </B></I>?<I>option value</I>?...<BR>
-</CODE><P>There may be many <I>option</I>-<I>value</I> pairs, each sets a configuration option for
-the marker. These same <I>option</I>-<I>value</I> pairs may be used with the marker's <B>configure</B>
-command. <P>
-The following options are specific to window markers:
-<DL>
-
-<DT><B>-anchor <I>anchor</I></B>
-</DT>
-<DD><I>Anchor</I> tells how to position the widget relative to the positioning point
-for the widget. For example, if <I>anchor</I> is <I>center</I> then the widget is centered
-on the point; if <I>anchor</I> is <I>n</I> then the widget will be displayed such that
-the top center point of the rectangular region occupied by the widget will
-be at the positioning point. This option defaults to <I>center</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B>
-</DT>
-<DD>Specifies the height to assign to the marker's window. If this option isn't
-specified, or if it is specified as <I>""</I>, then the window is given whatever
-height the widget requests internally. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Specifies the width
-to assign to the marker's window. If this option isn't specified, or if it
-is specified as <I>""</I>, then the window is given whatever width the widget
-requests internally. </DD>
-
-<DT><B>-window <I>pathName</I></B> </DT>
-<DD>Specifies the widget to be managed.
- <I>PathName</I> must be a child of the <B>stripchart</B> widget. </DD>
-</DL>
-
-<H2><A NAME="sect22" HREF="#toc22">Graph Component Bindings</A></H2>
-Specific
-stripchart components, such as elements, markers and legend entries, can
-have a command trigger when event occurs in them, much like canvas items
-in Tk's canvas widget. Not all event sequences are valid. The only binding
-events that may be specified are those related to the mouse and keyboard
-(such as <B>Enter</B>, <B>Leave</B>, <B>ButtonPress</B>, <B>Motion</B>, and <B>KeyPress</B>). <P>
-Only one element
-or marker can be picked during an event. This means, that if the mouse
-is directly over both an element and a marker, only the uppermost component
-is selected. This isn't true for legend entries. Both a legend entry and
-an element (or marker) binding commands will be invoked if both items
-are picked. <P>
-It is possible for multiple bindings to match a particular event.
-This could occur, for example, if one binding is associated with the element
-name and another is associated with one of the element's tags (see the <B>-bindtags</B>
-option). When this occurs, all of the matching bindings are invoked. A
-binding associated with the element name is invoked first, followed by
-one binding for each of the element's bindtags. If there are multiple matching
-bindings for a single tag, then only the most specific binding is invoked.
- A continue command in a binding script terminates that script, and a
-break command terminates that script and skips any remaining scripts for
-the event, just as for the bind command. <P>
-The <B>-bindtagsR option for these
-components controls addition tag names which can be matched. Implicitly
-elements and markers always have tags matching their names. Setting the
-value of the <B>-bindtags</B></B> option doesn't change this.
-<H2><A NAME="sect23" HREF="#toc23">C Language API</A></H2>
-You can manipulate
-data elements from the C language. There may be situations where it is
-too expensive to translate the data values from ASCII strings. Or you might
-want to read data in a special file format. <P>
-Data can manipulated from the
-C language using BLT vectors. You specify the x and y data coordinates of
-an element as vectors and manipulate the vector from C. The strip chart
-will be redrawn automatically after the vectors are updated. <P>
-From Tcl, create
-the vectors and configure the element to use them. <BR>
-<CODE>vector X Y<BR>
-.s element configure line1 -xdata X -ydata Y<BR>
-</CODE><P>To set data points from C, you pass the values as arrays of doubles using
-the <B>Blt_ResetVector</B> call. The vector is reset with the new data and at
-the next idle point (when Tk re-enters its event loop), the strip chart
-will be redrawn automatically. <BR>
-<CODE>#include <tcl.h><BR>
-#include <blt.h><BR>
-<P>
-register int i;<BR>
-Blt_Vector *xVec, *yVec;<BR>
-double x[50], y[50];<BR>
-<P>
-/* Get the BLT vectors "X" and "Y" (created above from Tcl) */<BR>
-if ((Blt_GetVector(interp, "X", 50, &xVec) != TCL_OK) ||<BR>
- (Blt_GetVector(interp, "Y", 50, &yVec) != TCL_OK)) {<BR>
- return TCL_ERROR;<BR>
-}<BR>
-<P>
-for (i = 0; i < 50; i++) {<BR>
- x[i] = i * 0.02;<BR>
- y[i] = sin(x[i]);<BR>
-}<tt> </tt> <tt> </tt> <BR>
-<P>
-/* Put the data into BLT vectors */<BR>
-if ((Blt_ResetVector(xVec, x, 50, 50, TCL_VOLATILE) != TCL_OK) ||<BR>
- (Blt_ResetVector(yVec, y, 50, 50, TCL_VOLATILE) != TCL_OK)) {<BR>
- return TCL_ERROR;<BR>
-}<BR>
-</CODE><P>See the <B>vector</B> manual page for more details.
-<H2><A NAME="sect24" HREF="#toc24">Speed Tips</A></H2>
-There may be cases
-where the strip chart needs to be drawn and updated as quickly as possible.
- If drawing speed becomes a big problem, here are a few tips to speed up
-displays.
-<UL>
-·<LI>Try to minimize the number of data points. The more data points
-the looked at, the more work the strip chart must do. </LI>·<LI>If your data is generated
-as floating point values, the time required to convert the data values
-to and from ASCII strings can be significant, especially when there any
-many data points. You can avoid the redundant string-to-decimal conversions
-using the C API to BLT vectors. </LI>·<LI>Data elements without symbols are drawn
-faster than with symbols. Set the data element's <B>-symbol</B> option to <I>none</I>. If
-you need to draw symbols, try using the simple symbols such as <I>splus</I> and
-<I>scross</I>. </LI>·<LI>Don't stipple or dash the element. Solid lines are much faster. </LI>·<LI>If
-you update data elements frequently, try turning off the widget's <B>-bufferelements</B>
-option. When the strip chart is first displayed, it draws data elements
-into an internal pixmap. The pixmap acts as a cache, so that when the strip
-chart needs to be redrawn again, and the data elements or coordinate axes
-haven't changed, the pixmap is simply copied to the screen. This is especially
-useful when you are using markers to highlight points and regions on the
-strip chart. But if the strip chart is updated frequently, changing either
-the element data or coordinate axes, the buffering becomes redundant. </LI>
-</UL>
-
-<H2><A NAME="sect25" HREF="#toc25">Limitations</A></H2>
-Auto-scale
-routines do not use requested min/max limits as boundaries when the axis
-is logarithmically scaled. <P>
-The PostScript output generated for polygons
-with more than 1500 points may exceed the limits of some printers (See
-PostScript Language Reference Manual, page 568). The work-around is to break
-the polygon into separate pieces.
-<H2><A NAME="sect26" HREF="#toc26">Future Incompatibility</A></H2>
-The <B>-mapped</B> options
-are obsoleted and will be removed. You can achieve the same results using
-the <B>-hide</B> option instead. <BR>
-<CODE># Works for now.<BR>
-.s legend configure -mapped no<BR>
-<P>
-# Instead use this.<BR>
-.s legend configure -hide yes <BR>
-
-<H2><A NAME="sect27" HREF="#toc27"></CODE><P>Keywords</A></H2>
-stripchart, graph, widget <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Syntax</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Example</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Stripchart Operations</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Stripchart Components</A></LI>
-<UL>
-<LI><A NAME="toc8" HREF="#sect8">Axis Components</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">Crosshairs Component</A></LI>
-<LI><A NAME="toc10" HREF="#sect10">Element Components</A></LI>
-<LI><A NAME="toc11" HREF="#sect11">Grid Component</A></LI>
-<LI><A NAME="toc12" HREF="#sect12">Legend Component</A></LI>
-<LI><A NAME="toc13" HREF="#sect13">Pen Components</A></LI>
-<LI><A NAME="toc14" HREF="#sect14">PostScript Component</A></LI>
-<LI><A NAME="toc15" HREF="#sect15">Marker Components</A></LI>
-<LI><A NAME="toc16" HREF="#sect16">Bitmap Markers</A></LI>
-<LI><A NAME="toc17" HREF="#sect17">Image Markers</A></LI>
-<LI><A NAME="toc18" HREF="#sect18">Line Markers</A></LI>
-<LI><A NAME="toc19" HREF="#sect19">Polygon Markers</A></LI>
-<LI><A NAME="toc20" HREF="#sect20">Text Markers</A></LI>
-<LI><A NAME="toc21" HREF="#sect21">Window Markers</A></LI>
-</UL>
-<LI><A NAME="toc22" HREF="#sect22">Graph Component Bindings</A></LI>
-<LI><A NAME="toc23" HREF="#sect23">C Language API</A></LI>
-<LI><A NAME="toc24" HREF="#sect24">Speed Tips</A></LI>
-<LI><A NAME="toc25" HREF="#sect25">Limitations</A></LI>
-<LI><A NAME="toc26" HREF="#sect26">Future Incompatibility</A></LI>
-<LI><A NAME="toc27" HREF="#sect27">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/table.html b/blt3.0.1/html/table.html
deleted file mode 100644
index 178075b..0000000
--- a/blt3.0.1/html/table.html
+++ /dev/null
@@ -1,721 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>table(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-table - Arranges widgets in a table
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>table
-<I>container</I></B> ?<I>widget index option value</I>?... <P>
-<B>table arrange</B> <I>container</I> <P>
-<B>table cget
-<I>container</I></B> ?<I>item</I>? <I>option</I> <P>
-<B>table configure <I>container</I></B> ?<I>item</I>?... ?<I>option value</I>?...
-<P>
-<B>table extents <I>container</I></B> <I>item</I> <P>
-<B>table forget <I>widget</I></B> ?<I>widget</I>?... <P>
-<B>table info <I>container</I></B>
-<I>item</I> <P>
-<B>table locate <I>container</I></B> <I>x y</I> <P>
-<B>table containers </B>?<I>switch</I>? ?<I>arg</I>? <P>
-<B>table save
-<I>container</I></B> <P>
-<B>table search <I>container</I></B> ?<I>switch arg</I>?...
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>table</B> command
-arranges widgets in a table. The alignment of widgets is detemined by their
-row and column positions and the number of rows or columns that they span.
-
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-Probably the most painstaking aspect of building a graphical
-application is getting the placement and size of the widgets just right.
-It usually takes many iterations to align widgets and adjust their spacing.
-That's because managing the geometry of widgets is simply not a packing
-problem, but also graphical design problem. Attributes such as alignment,
-symmetry, and balance are more important than minimizing the amount of
-space used for packing. <P>
-The <B>table</B> geometry manager arranges widgets in a
-table. It's easy to align widgets (horizontally and vertically) or to create
-empty space to balance the arrangement of the widgets. Widgets (called
-<I>slaves</I> in the Tk parlance) are arranged inside a containing widget (called
-the <I>master</I>). Widgets are positioned at row,column locations and may span
-any number of rows or columns. More than one widget can occupy a single
-location. <P>
-The placement of widget windows determines both the size and arrangement
-of the table. The table queries the requested size of each widget. The
-<I>requested size</I> of a widget is the natural size of the widget (before the
-widget is shrunk or expanded). The height of each row and the width of
-each column is the largest widget spanning that row or column. The size
-of the table is in turn the sum of the row and column sizes. This is the
-table's <I>normal size</I>. <P>
-The total number of rows and columns in a table is determined
-from the indices specified. The table grows dynamically as windows are
-added at larger indices.
-<H2><A NAME="sect4" HREF="#toc4">Example</A></H2>
-The table geometry manager is created by
-invoking the <B>table</B> command. <BR>
-<CODE># Create a table in the root window<BR>
-table .<BR>
-</CODE><P>The window <I>.</I> is now the <I>container</I> of the table. Widgets are packed into
-the table and displayed within the confines of the container. <P>
-You add widgets
-to the table by row and column location. Row and column indices start from
-zero. <BR>
-<CODE>label .title -text "This is a title"<BR>
-<P>
-# Add a label to the table<BR>
-table . .title 0,0 <BR>
-</CODE><P>The label <I>.title</I> is added to the table. We can add more widgets in the same
-way. <BR>
-<CODE>button .ok -text "Ok"<BR>
-button .cancel -text "Cancel"<BR>
-<P>
-# Add two buttons<BR>
-table . .ok 1,0<BR>
-table . .cancel 1,1<BR>
-</CODE><P>Two buttons <I>.ok</I> and <I>.cancel</I> are now packed into the second row of the table.
- They each occupy one cell of the table. By default, widgets span only
-a single row and column. <P>
-The first column contains two widgets, <I>.title</I> and
-<I>.ok</I>. By default, the widest of the two widgets will define the width of
-the column. However, we want <I>.title</I> to be centered horizontally along the
-top of the table. We can make <I>.title</I> span two columns using the <B>configure</B>
-operation. <BR>
-<CODE># Make the label span both columns<BR>
-table configure . .title -cspan 2<BR>
-</CODE><P>The label <I>.title</I> will now be centered along the top row of the table. <P>
-In
-the above example, we've create and arranged the layout for the table invoking
-the <B>table</B> command several times. Alternately, we could have used a single
-<B>table</B> command. <BR>
-<CODE>label .title -text "This is a title"<BR>
-button .ok -text "Ok"<BR>
-button .cancel -text "Cancel"<BR>
-<P>
-# Create and pack the table<BR>
-table . \<BR>
- .title 0,0 -cspan 2 \<BR>
- .ok 1,0 \<BR>
- .cancel 1,1<BR>
-</CODE><P>The table will override the requested width and height of the container
-so that the window fits the table exactly. This also means that any change
-to the size of table will be propagated up through the Tk window hierarchy.
- This feature can be turned off using the <B>configure</B> operation again. <BR>
-<CODE>table configure . -propagate no<BR>
-</CODE><P>You can also set the width of height of the table to a specific value. This
-supersedes the calculated table size. <BR>
-<CODE># Make the container 4 inches wide, 3 inches high<BR>
-table configure . -reqwidth 4i -reqheight 3i<BR>
-</CODE><P>If a widget is smaller than the cell(s) it occupies, the widget will float
-within the extra space. By default, the widget will be centered within
-the space, but you can anchor the widget to any side of cell using the
-<B>-anchor</B> configuration option. <BR>
-<CODE>table configure . .ok -anchor w<BR>
-</CODE><P>The <B>-fill</B> option expands the widget to fill the extra space either vertically
-or horizontally (or both). <BR>
-<CODE># Make the title label fill the entire top row<BR>
-table configure . .title -cspan 2 -fill x <BR>
-<P>
-# Each button will be as height of the 2nd row.<BR>
-table configure . .ok .cancel -fill y<BR>
-</CODE><P>The width of <I>.title</I> will be the combined widths of both columns. Both <I>.ok</I>
-and <I>.cancel</I> will become as tall as the second row. <P>
-The <B>-padx</B> and <B>-pady</B> options
-control the amount of padding around the widget. Both options take a list
-of one or two values. <BR>
-<CODE># Pad the title by two pixels above and below.<BR>
-table configure . .title -pady 2<BR>
-<P>
-# Pad each button 2 pixels on the left, and 4 on the right.<BR>
-table configure . .ok .cancel -padx { 2 4 }<BR>
-</CODE><P>If the list has only one value, then both exterior sides (top and bottom
-or left and right) of the widget are padded by that amount. If the list
-has two elements, the first specifies padding for the top or left side
-and the second for the bottom or right side. <P>
-Like the container, you can
-also override the requested widths and heights of widgets using the <B>-reqwidth</B>
-and <B>-reqheight</B> options. This is especially useful with character-based widgets
-(such as buttons, labels, text, listbox, etc) that let you specify their
-size only in units of characters and lines, instead of pixels. <BR>
-<CODE># Make all buttons one inch wide<BR>
-table configure . .ok .cancel -reqwidth 1i<BR>
-<P>
-</CODE><P>Each row and column of the table can be configured, again using the <B>configure</B>
-operation. Rows are and columns are designated by <I>R<I>i</I></I> and <I>C<I>i</I></I> respectively,
-where <I>i</I> is the index of the row or column. <P>
-For example, you can set the
-size of a row or column. <BR>
-<CODE># Make the 1st column 2 inches wide<BR>
-table configure . c0 -width 2.0i<BR>
-<P>
-# Make the 2nd row 1/2 inch high.<BR>
-table configure . r1 -height 0.5i<BR>
-</CODE><P>The new size for the row or column overrides its calculated size. If no
-widgets span the row or column, its height or width is zero. So you can
-use the <B>-width</B> and <B>-height</B> options to create empty spaces in the table. <BR>
-<CODE># Create an empty row and column<BR>
-table configure . r2 c2 -width 1i<BR>
-</CODE><P>The <B>-pady</B> option lets you add padding to the top and bottom sides of rows.
- The <B>-padx</B> option adds padding to the left and right sides of columns. Both
-options take a list of one or two values. <BR>
-<CODE># Pad above the title by two pixels <BR>
-table configure . r0 -pady { 2 0 }<BR>
-<P>
-# Pad each column 4 pixels on the left, and 2 on the right.<BR>
-table configure . c* -padx { 2 4 }<BR>
-<P>
-</CODE><P>Notice that you can configure all the rows and columns using either <I>R*</I>
-or <I>C*</I>. <P>
-When the container is resized, the rows and columns of the table
-are also resized. Only the rows or columns that contain widgets (a widget
-spans the row or column) grow or shrink. The <B>-resize</B> option indicates whether
-the row or column can be shrunk or stretched. If the value is <I>shrink</I>, the
-row or column can only be resized smaller. If <I>expand</I>, it can only be resized
-larger. If <I>none</I>, the row or column is frozen at its requested size. <BR>
-<CODE># Let the 1st column get smaller, but not bigger<BR>
-table configure . c0 -resize shrink<BR>
-<P>
-# Let the 2nd column get bigger, not smaller<BR>
-table configure . c1 -resize expand<BR>
-<P>
-# Don't resize the first row <BR>
-table configure . r0 -resize none<BR>
-</CODE><P>The following example packs a canvas, two scrollbars, and a title. The rows
-and columns containing the scrollbars are frozen at their requested size,
-so that even if the frame is resized, the scrollbars will remain the same
-width. <BR>
-<CODE>table . \<BR>
- .title 0,0 -cspan 3 \<BR>
- .canvas 1,1 -fill both \<BR>
- .vscroll 1,2 -fill y \<BR>
- .hscroll 2,1 -fill x<BR>
-<P>
-# Don't let the scrollbars resize<BR>
-table configure . c2 r2 -resize none<BR>
-<P>
-# Create an empty space to balance the scrollbar<BR>
-table configure . c0 -width .vscroll<BR>
-</CODE><P>Note that the value of the <B>-width</B> option is the name of a widget window.
- This indicates that the width of the column should be the same as the
-requested width of <I>.vscroll</I>. <P>
-Finally, the <B>forget</B> operation removes widgets
-from the table. <BR>
-<CODE># Remove the windows from the table<BR>
-table forget .quit .frame<BR>
-</CODE><P>It's not necessary to specify the container. The <B>table</B> command determines
-the container from the widget name.
-<H2><A NAME="sect5" HREF="#toc5">Operations</A></H2>
-The following operations are
-available for the <B>table</B>:
-<DL>
-
-<DT><B>table <I>container</I></B> ?<I>widget index option value</I>?...
-</DT>
-<DD>Adds the widget <I>widget</I> to the table at <I>index</I>. <I>Index</I> is a row,column position
-in the table. It must be in the form <I>row</I>,<I>column</I> where <I>row</I> and <I>column</I> are
-the respective row and column numbers, starting from zero (0,0 is the upper
-leftmost position). <I>Row</I> and <I>column</I> may also be numeric expressions that
-are recursively evaluated. If a table doesn't exist for <I>container</I>, one is
-created. <I>Widget</I> is the path name of the window, that must already exist,
-to be arranged inside of <I>container</I>. <I>Option</I> and <I>value</I> are described in the
- <FONT SIZE=-1><B>WIDGET</B></FONT>
- section. </DD>
-
-<DT><B>table arrange</B> <I>container</I> </DT>
-<DD>Forces the table to compute its
-layout immediately. Normally, the table geometry manager will wait until
-the next idle point, before calculating the size of its rows and columns.
- This is useful for collecting the <I>normal</I> sizes of rows and columns, that
-are based upon the requested widget sizes. </DD>
-
-<DT><B>table cget</B> <I>container </I>?<I>item</I>?<I> option</I>
-</DT>
-<DD>Returns the current value of the configuration option specific to <I>item</I>
-given by <I>option</I>. <I>Item</I> is either a row or column index, or the path name
-of a widget. <I>Item</I> can be in any form describe in the <B>configure</B> operation
-below. If no <I>item</I> argument is provided, then the configuration option is
-for the table itself. <I>Option</I> may be any one of the options described in
-the appropiate section for <I>item</I>. </DD>
-
-<DT><B>table configure</B> <I>container item</I>... ?<I>option
-value</I>?... </DT>
-<DD>Queries or modifies the configuration options specific to <I>item</I>.
-If no <I>option</I> is specified, this command returns a list describing all of
-the available options for <I>item</I> If the argument <I>item</I> is omitted, then the
-specified configuration options are for the table itself. Otherwise <I>item</I>
-must be either a row or column specification, or the path name of a widget.
- The following <I>item</I> types are available. <blockquote></DD>
-
-<DT><I>C<I>i</I></I> </DT>
-<DD>Specifies the column of <I>container</I>
-to be configured. <I>Item</I> must be in the form <I>C<I>n</I></I>, where <I>i</I> is the index of
- the column. See the <FONT SIZE=-1><B>COLUMN</B></FONT>
- section. </DD>
-
-<DT><I>R<I>i</I></I> </DT>
-<DD>Specifies the row of <I>container</I>
-to be configured. <I>Item</I> must be in the form <I>R<I>i</I></I>, where <I>i</I> is the index of the
-row. See the <FONT SIZE=-1><B>ROW</B></FONT>
- section. </DD>
-
-<DT><I>widget</I> </DT>
-<DD>Specifies a widget of <I>container</I> to be
-queried. <I>Widget</I> is the path name of a widget packed in <I>container</I>. See the
-<FONT SIZE=-1><B>WIDGET</B></FONT>
- section. </DD>
-
-<DT>No argument </DT>
-<DD>Specifies that the table itself is to be queried.
- See the <FONT SIZE=-1><B>TABLE</B></FONT>
- section for a description of the option-value pairs for
-the table. </DD>
-</DL>
-</blockquote>
-<blockquote><P>
-The <I>option<I> and <I>value</I></I></I> pairs are specific to <I>item</I>. If <I>option</I> is
-specified with no <I>value</I>, then the command returns a list describing the
-one named option (this list will be identical to the corresponding sublist
-of the value returned if no <I>option</I> is specified). If one or more <I>option-value</I>
-pairs are specified, then the command modifies the given option(s) to have
-the given value(s); in this case the command returns the empty string. </blockquote>
-
-<DL>
-
-<DT><B>table
-extents <I>container</I></B> <I>index</I> </DT>
-<DD>Queries the location and dimensions of row and
-columns in the table. <I>Index</I> can be either a row or column index or a table
-index. Returns a list of the x,y coordinates (upperleft corner) and dimensions
-(width and height) of the cell, row, or column. </DD>
-
-<DT><B>table forget <I>widget</I></B> ?<I>widget</I>?...
-</DT>
-<DD>Requests that <I>widget</I> no longer have its geometry managed. <I>Widget</I> is the
-pathname of the window currently managed by some table. The window will
-be unmapped so that it no longer appears on the screen. If <I>widget</I> is not
-currently managed by any table, an error message is returned, otherwise
-the empty string. </DD>
-
-<DT><B>table info <I>container</I></B> <I>item</I> </DT>
-<DD>Returns a list of the current
-configuration options for <I>item</I>. The list returned is exactly in the form
-that might be specified to the <B>table</B> command. It can be used to save and
-reset table configurations. <I>Item</I> must be one of the following. <blockquote></DD>
-
-<DT><I>C<I>i</I></I> </DT>
-<DD>Specifies
-the column of <I>container</I> to be queried. <I>Item</I> must be in the form <I>C<I>n</I></I>, where
-<I>n</I> is the index of the column. </DD>
-
-<DT><I>R<I>i</I></I> </DT>
-<DD>Specifies the row of <I>container</I> to be
-queried. <I>Item</I> must be in the form <I>R<I>i</I></I>, where <I>i</I> is the index of the row.
-</DD>
-
-<DT><I>widget</I> </DT>
-<DD>Specifies a widget of <I>container</I> to be queried. <I>Widget</I> is the path
-name of a widget packed in <I>container</I>. </DD>
-
-<DT>No argument </DT>
-<DD>Specifies that the table
-itself is to be queried. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>table locate <I>container</I></B> <I>x y</I> </DT>
-<DD>Returns the table index
-(row,column) of the cell containing the given screen coordinates. The <I>x</I>
-and <I>y</I> arguments represent the x and y coordinates of the sample point to
-be tested. </DD>
-
-<DT><B>table containers </B>?<I>switch arg</I>? </DT>
-<DD>Returns a list of all container
-windows matching a given criteria (using <I>switch</I> and <I>arg</I>). If no <I>switch</I>
-and <I>arg</I> arguments are given, the names of all container windows (only those
-using the <B>table</B> command) are returned. The following are valid switches:
-<blockquote></DD>
-
-<DT><B>-pattern</B> <I>pattern</I> </DT>
-<DD>Returns a list of pathnames of all container windows matching
-<I>pattern</I>. </DD>
-
-<DT><B>-slave</B> <I>window</I> </DT>
-<DD>Returns the name of the container window of table
-managing <I>window</I>. <I>Window</I> must be the path name of widget. If <I>window</I> is not
-managed by any table, the empty string is returned. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>table search <I>container</I></B>
-?<I>switch arg</I>?... </DT>
-<DD>Returns the names of all the widgets in <I>container</I> matching
-the criteria given by <I>switch</I> and <I>arg</I>. <I>Container</I> is name of the container
-window associated with the table to be searched. The name of the widget
-is returned if any one <I>switch</I>-<I>arg</I> criteria matches. If no <I>switch</I>-<I>arg</I> arguments
-are given, the names of all widgets managed by <I>container</I> are returned.
-The following are switches are available: <blockquote></DD>
-
-<DT><B>-pattern</B> <I>pattern</I> </DT>
-<DD>Returns the names
-of any names of the widgets matching <I>pattern</I>. </DD>
-
-<DT><B>-span</B> <I>index</I> </DT>
-<DD>Returns the
-names of widgets that span <I>index</I>. A widget does not need to start at <I>index</I>
-to be included. <I>Index</I> must be in the form <I>row</I>,<I>column</I>, where <I>row</I> and <I>column</I>
-are valid row and column numbers. </DD>
-
-<DT><B>-start</B> <I>index</I> </DT>
-<DD>Returns the names of widgets
-that start at <I>index</I>. <I>Index</I> must be in the form <I>row</I>,<I>column</I>, where <I>row</I> and
-<I>column</I> are valid row and column numbers. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect6" HREF="#toc6">Table Options</A></H2>
-To configure the table
-itself, you omit the <I>item</I> argument when invoking the <B>configure</B> operation.
-<BR>
-<CODE><B>table configure</B> <I>container</I> ?<I>option value</I>?...<BR>
-</CODE><P>The following options are available for the table: <blockquote>
-<DL>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets how much
-padding to add to the left and right exteriors of the table. <I>Pad</I> can be
-a list of one or two numbers. If <I>pad</I> has two elements, the left side of
-the table is padded by the first value and the right side by the second
-value. If <I>pad</I> has just one value, both the left and right sides are padded
-evenly by the value. The default is <I>0</I>. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets how much padding to
-add to the top and bottom exteriors of the table. <I>Pad</I> can be a list of one
-or two numbers. If <I>pad</I> has two elements, the area above the table is padded
-by the first value and the area below by the second value. If <I>pad</I> is just
-one number, both the top and bottom areas are padded by the value. The
-default is <I>0</I>. </DD>
-
-<DT><B>-propagate <I>boolean</I></B> </DT>
-<DD>Indicates if the table should override
-the requested width and height of the <I>container</I> window. If <I>boolean</I> is false,
-<I>container</I> will not be resized. <I>Container</I> will be its requested size. The
-default is <I>1</I>. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect7" HREF="#toc7">Widget Options</A></H2>
-widgets are configured by specifying the name
-of the widget when invoking the <B>configure</B> operation. <BR>
-<P>
-<CODE><B>table configure</B> <I>container <I>widget</I></I> ?<I>option value</I>?...<BR>
-</CODE><P><I>Widget</I> must be the path name of a window already packed in the table associated
-with <I>container</I>. The following options are available for widgets: <blockquote>
-<DL>
-
-<DT><B>-anchor
-<I>anchor</I></B> </DT>
-<DD>Anchors <I>widget</I> to a particular edge of the cell(s) it resides. This
-option has effect only if the space of the spans surrounding <I>widget</I> is
-larger than <I>widget</I>. <I>Anchor</I> specifies how <I>widget</I> will be positioned in the
-space. For example, if <I>anchor</I> is <I>center</I> then the window is centered in
-the rows and columns it spans; if <I>anchor</I> is <I>w</I> then the window will be aligned
-with the leftmost edge of the span. The default is <I>center</I>. </DD>
-
-<DT><B>-columnspan <I>number</I></B>
-</DT>
-<DD>Sets the number of columns <I>widget</I> will span. The default is <I>1</I>. </DD>
-
-<DT><B>-columncontrol
-<I>control</I></B> </DT>
-<DD>Specifies how the width of <I>widget</I> should control the width of the
-columns it spans. <I>Control</I> is either <I>normal</I>, <I>none</I>, or <I>full</I>. The default
-is <I>normal</I>. <blockquote></DD>
-
-<DT><I>none</I> </DT>
-<DD>The width of <I>widget</I> is not considered. </DD>
-
-<DT><I>full</I> </DT>
-<DD>Only the width
-of <I>widget</I> will be considered when computing the widths of the columns.
-</DD>
-
-<DT><I>normal</I> </DT>
-<DD>Indicates that the widest widget spanning the column will determine
- the width of the span. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-fill <I>fill</I></B> </DT>
-<DD>Specifies if <I>widget</I> should be stretched
-to fill any free space in the span surrounding <I>widget</I>. <I>Fill</I> is either <I>none</I>,
-<I>x</I>, <I>y</I>, <I>both</I>. The default is <I>none</I>. <blockquote></DD>
-
-<DT><I>x</I> </DT>
-<DD>The widget can grow horizontally. </DD>
-
-<DT><I>y</I>
-</DT>
-<DD>The widget can grow vertically. </DD>
-
-<DT><I>both</I> </DT>
-<DD>The widget can grow both vertically
-and horizontally. </DD>
-
-<DT><I>none</I> </DT>
-<DD>The widget does not grow along with the span.
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-ipadx <I>pixels</I></B> </DT>
-<DD>Sets how much horizontal padding to add internally on the
-left and right sides of <I>widget</I>. <I>Pixels</I> must be a valid screen distance
-like <I>2</I> or <I>0.3i</I>. The default is <I>0</I>. </DD>
-
-<DT><B>-ipady <I>pixels</I></B> </DT>
-<DD>Sets how much vertical padding
-to add internally on the top and bottom of <I>widget</I>. <I>Pixels</I> must be a valid
-screen distance like <I>2</I> or <I>0.3i</I>. The default is <I>0</I>. </DD>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets how much
-padding to add to the left and right exteriors of <I>widget</I>. <I>Pad</I> can be a list
-of one or two numbers. If <I>pad</I> has two elements, the left side of <I>widget</I>
-is padded by the first value and the right side by the second value. If
-<I>pad</I> has just one value, both the left and right sides are padded evenly
-by the value. The default is <I>0</I>. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets how much padding to add to
-the top and bottom exteriors of <I>widget</I>. <I>Pad</I> can be a list of one or two
-numbers. If <I>pad</I> has two elements, the area above <I>widget</I> is padded by the
-first value and the area below by the second value. If <I>pad</I> is just one
-number, both the top and bottom areas are padded by the value. The default
-is <I>0</I>. </DD>
-
-<DT><B>-reqheight <I>height</I></B> </DT>
-<DD>Specifies the limits of the requested height for
-<I>widget</I>. <I>Height</I> is a list of bounding values. See the <FONT SIZE=-1><B>BOUNDING</B></FONT>
- section
-for a description of this list. By default, the height of <I>widget</I> is its
-requested height with its internal padding (see the <B>-ipady</B> option). The
-bounds specified by <I>height</I> either override the height completely, or bound
-the height between two sizes. The default is <I>""</I>. </DD>
-
-<DT><B>-reqwidth <I>width</I></B> </DT>
-<DD>Specifies
-the limits of the requested width for <I>widget</I>. <I>Width</I> is a list of bounding
-values. See the <FONT SIZE=-1><B>BOUNDING</B></FONT>
- section for a description of this list. By default,
-the width of <I>widget</I> is its requested width with its internal padding (set
-the <B>-ipadx</B> option). The bounds specified by <I>width</I> either override the width
-completely, or bound the height between two sizes. The default is <I>""</I>. </DD>
-
-<DT><B>-rowspan
-<I>number</I></B> </DT>
-<DD>Sets the number of rows <I>widget</I> will span. The default is <I>1</I>. </DD>
-
-<DT><B>-rowcontrol
-<I>control</I></B> </DT>
-<DD>Specifies how the height of <I>widget</I> should control the height of
-the rows it spans. <I>Control</I> is either <I>normal</I>, <I>none</I>, or <I>full</I>. The default
-is <I>normal</I>. <blockquote></DD>
-
-<DT><I>none</I> </DT>
-<DD>The height of <I>widget</I> is not considered. </DD>
-
-<DT><I>full</I> </DT>
-<DD>Only the
-height of <I>widget</I> will be considered when computing the heights of the rows.
- </DD>
-
-<DT><I>normal</I> </DT>
-<DD>Indicates that the tallest widget spanning the row will determine
- the height of the span. </DD>
-</DL>
-</blockquote>
-</blockquote>
-
-<H2><A NAME="sect8" HREF="#toc8">Column Options</A></H2>
-To configure a column in the table,
-specify the column index as <I>C<I>i</I></I>, where <I>i</I> is the index of the column to be
-configured. <BR>
-<P>
-<CODE><B>table configure</B> <I>container <I>C<I>i</I></I></I> ?<I>option value</I>?...<BR>
-</CODE><P>If the index is specified as <I>C*</I>, then all columns of the table will be
-configured. The following options are available for table columns. <blockquote>
-<DL>
-
-<DT><B>-padx
-<I>pad</I></B> </DT>
-<DD>Sets the padding to the left and right of the column. <I>Pad</I> can be a list
-of one or two numbers. If <I>pad</I> has two elements, the left side of the column
-is padded by the first value and the right side by the second value. If
-<I>pad</I> has just one value, both the left and right sides are padded evenly
-by the value. The default is <I>0</I>. </DD>
-
-<DT><B>-resize <I>mode</I></B> </DT>
-<DD>Indicates that the column can
-expand or shrink from its requested width when the table is resized. <I>Mode</I>
-must be one of the following: <I>none</I>, <I>expand</I>, <I>shrink</I>, or <I>both</I>. If <I>mode</I> is
- <I>expand</I> the width of the column is expanded if there is extra space in
-the container window. If <I>mode</I> is <I>shrink</I> its width may be reduced beyond
-its requested width if there is not enough space in the container. The default
-is <I>none</I>. </DD>
-
-<DT><B>-width <I>width</I></B> </DT>
-<DD>Specifies the limits within that the width of the column
-may expand or shrink. <I>Width</I> is a list of bounding values. See the section
-<FONT SIZE=-1><B>BOUNDING</B></FONT>
- for a description of this list. By default there are no constraints.
-</DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect9" HREF="#toc9">Row Options</A></H2>
-To configure a row in the table, specify the row index as <I>R<I>i</I></I>,
-where <I>i</I> is the index of the row to be configured. <BR>
-<P>
-<CODE><B>table configure</B> <I>container <I>R<I>i</I></I></I> ?<I>option value</I>?...<BR>
-</CODE><P>If the index is specified as <I>R*</I>, then all rows of the table will be configured.
- The following options are available for table rows. <blockquote>
-<DL>
-
-<DT><B>-height <I>height</I></B> </DT>
-<DD>Specifies
-the limits of the height that the row may expand or shrink to. <I>Height</I> is
-a list of bounding values. See the section <FONT SIZE=-1><B>BOUNDING</B></FONT>
- for a description
-of this list. By default there are no constraints. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets the padding
-above and below the row. <I>Pad</I> can be a list of one or two numbers. If <I>pad</I>
-has two elements, the area above the row is padded by the first value and
-the area below by the second value. If <I>pad</I> is just one number, both the
-top and bottom areas are padded by the value. The default is <I>0</I>. </DD>
-
-<DT><B>-resize <I>mode</I></B>
-</DT>
-<DD>Indicates that the row can expand or shrink from its requested height
-when the table is resized. <I>Mode</I> must be one of the following: <I>none</I>, <I>expand</I>,
-<I>shrink</I>, or <I>both</I>. If <I>mode</I> is <I>expand</I> the height of the row is expanded if
-there is extra space in the container. If <I>mode</I> is <I>shrink</I> its height may
-be reduced beyond its requested height if there is not enough space in
- the container. The default is <I>none</I>. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect10" HREF="#toc10">Bounding Sizes</A></H2>
-Sometimes it's more useful
-to limit resizes to an acceptable range, than to fix the size to a particular
-value or disallow resizing altogether. Similar to the way the <B>wm</B> command
-lets you specify a <B>minsize</B> and <B>maxsize</B> for a toplevel window, you can bound
-the sizes the container, a widget, row, or column may take. The <B>-width</B>, <B>-height</B>,
-<B>-reqwidth</B>, and <B>-reqheight</B> options, take a list of one, two, or three values.
-We can take a previous example and instead preventing resizing, bound the
-size of the scrollbars between two values. <BR>
-<CODE>table . \<BR>
- .title 0,0 -cspan 3 \<BR>
- .canvas 1,1 -fill both \<BR>
- .vscroll 1,2 -fill y \<BR>
- .hscroll 2,1 -fill x<BR>
-<P>
-# Bound the scrollbars between 1/8 and 1/2 inch<BR>
-table configure . c2 -width { 0.125 0.5 }<BR>
-table configure . r2 -height { 0.125 0.5 }<BR>
-table configure . vscroll .hscroll -fill both<BR>
-</CODE><P>The scrollbars will get no smaller than 1/8 of an inch, or bigger than
-1/2 inch. The initial size will be their requested size, so long as it
-is within the specified bounds. <P>
-How the elements of the list are interpreted
-is dependent upon the number of elements in the list. <blockquote>
-<DL>
-
-<DT>{<I></I>} </DT>
-<DD>Empty list. No
-bounds are set. The default sizing is performed. </DD>
-
-<DT>{<I> x </I>} </DT>
-<DD>Fixes the size to
-<I>x</I>. The window or partition cannot grow or shrink. </DD>
-
-<DT>{<I> min max </I>} </DT>
-<DD>Sets up minimum
-and maximum limits for the size of the window or partition. The window
-or partition can be reduced less than <I>min</I>, nor can it be stretched beyond
-<I>max</I>. </DD>
-
-<DT>{<I> min max nom </I>} </DT>
-<DD>Specifies minimum and maximum size limits, but also
-specifies a nominal size <I>nom</I>. This overrides the calculated size of the
-window or partition. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect11" HREF="#toc11">Miscellaneous</A></H2>
-Another feature is that you can put two
-widgets in the same cell of the table. This is useful when you want to
-add decorations around a widget. <BR>
-<CODE>frame .frame -bd 1 -relief sunken<BR>
-button .quit -text "Quit"<BR>
-<P>
-# Put both the frame and the button in the same cell.<BR>
-table . \<BR>
- .quit 1,0 -padx 2 -pady 2 \<BR>
- .frame 1,0 -fill both<BR>
-
-<H2><A NAME="sect12" HREF="#toc12"></CODE><P>Limitations</A></H2>
-A long standing bug in Tk (circa 1993), there is no way to detect
-if a window is already a container of a different geometry manager. This
-is usually done by accident, such as the following where all three widgets
-are arranged in the same container ".", but using different geometry managers.
-<BR>
-<CODE> table .f1<BR>
-<tt> </tt> <tt> </tt> ...<BR>
- pack .f2<BR>
-<tt> </tt> <tt> </tt> ...<BR>
- grid .f3<BR>
-</CODE><P>This leads to bizarre window resizing, as each geometry manager applies
-its own brand of layout policies. When the container is a top level window
-(such as "."), your window manager may become locked as it responds to the
-never-ending stream of resize requests.
-<H2><A NAME="sect13" HREF="#toc13">Keywords</A></H2>
-frame, geometry manager,
-location, table, size <P>
- <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Example</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Operations</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Table Options</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Widget Options</A></LI>
-<LI><A NAME="toc8" HREF="#sect8">Column Options</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">Row Options</A></LI>
-<LI><A NAME="toc10" HREF="#sect10">Bounding Sizes</A></LI>
-<LI><A NAME="toc11" HREF="#sect11">Miscellaneous</A></LI>
-<LI><A NAME="toc12" HREF="#sect12">Limitations</A></LI>
-<LI><A NAME="toc13" HREF="#sect13">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/tabset.html b/blt3.0.1/html/tabset.html
deleted file mode 100644
index 265ebb3..0000000
--- a/blt3.0.1/html/tabset.html
+++ /dev/null
@@ -1,936 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>tabset(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-tabset - Create and manipulate tabset widgets
-
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>tabset</B> <I>pathName </I>?<I>options</I>?
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>tabset</B> widget displays
-a series of overlapping folders. Only the contents of one folder at a time
-is displayed. By clicking on the tab's of a folder, you can view other folders.
- Each folder may contain any Tk widget that can be automatically positioned
-and resized in the folder. <P>
-There's no limit to the number of folders. Tabs
-can be tiered or scrolled. Pages (i.e. embedded widgets) can be torn off
-and displayed in another toplevel widget, and also restored. A tabset can
-also be used as just a set of tabs, without a displaying any pages. You
-can bind events to individual tabs, so it's easy to add features like "balloon
-help".
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-Notebooks are a popular graphical paradigm. They allow
-you to organize many windows in a single widget. For example, you might
-have an application the displays several X-Y graphs at the same time. Typically,
-you can't pack the graphs into the same <B>frame</B> because they are too large.
- The other alternative is to pack the graphs into several <B>toplevel</B> widgets,
-allowing them to overlap on the screen. The problem is that all the different
-toplevel windows clutter the screen and are difficult to manage. <P>
-The <B>tabset</B>
-widget lets organize your application by displaying each graph as a page
-in a folder of a notebook. Only one page is visible at a time. When you
-click on a tab, the folder (graph) corresponding to the tab is displayed
-in the <B>tabset</B> widget. The tabset also lets you temporarily tear pages out
-of the notebook into a separate toplevel widget, and put them back in the
-tabset later. For example, you could compare two graphs side-by-side by tearing
-them out, and then replace them when you are finished. <P>
-A tabset may contain
-an unlimited number of folders. If there are too many tabs to view, you
-can arrange them as multiple tiers or scroll the tabs. The tabset uses the
-conventional Tk scrollbar syntax, so you can attach a scrollbar too.
-<H2><A NAME="sect4" HREF="#toc4">Example</A></H2>
-You
-create a tabset widget with the <B>tabset</B> command. <BR>
-<CODE># Create a new tabset<BR>
-tabset .ts -relief sunken -borderwidth 2 <BR>
-</CODE><P>A new Tcl command <I>.ts</I> is also created. This command can be used to query
-and modify the tabset. For example, to change the default font used by
-all the tab labels, you use the new command and the tabset's <B>configure</B> operation.
-<BR>
-<CODE># Change the default font.<BR>
-.ts configure -font "fixed"<BR>
-</CODE><P>You can then add folders using the <B>insert</B> operation. <BR>
-<CODE># Create a new folder "f1"<BR>
-.ts insert 0 "f1"<BR>
-</CODE><P>This inserts the new tab named "f1" into the tabset. The index <I>0</I> indicates
-location to insert the new tab. You can also use the index <I>end</I> to append
-a tab to the end of the tabset. By default, the text of the tab is the
-name of the tab. You can change this by configuring the <B>-text</B> option. <BR>
-<CODE># Change the label of "f1"<BR>
-.ts tab configure "f1" -label "Tab #1" <BR>
-</CODE><P>The <B>insert</B> operation lets you add one or more folders at a time. <BR>
-<CODE>.ts insert end "f2" -label "Tab #2" "f3" "f4" <BR>
-</CODE><P>The tab on each folder contains a label. A label may display both an image
-and a text string. You can reconfigure the tab's attributes (foreground/background
-colors, font, rotation, etc) using the <B>tab configure</B> operation. <BR>
-<CODE># Add an image to the label of "f1"<BR>
-set image [image create photo -file stopsign.gif]<BR>
-.ts tab configure "f1" -image $image<BR>
-.ts tab configure "f2" -rotate 90<BR>
-</CODE><P>Each folder may contain an embedded widget to represent its contents. The
-widget to be embedded must be a child of the tabset widget. Using the <B>-window</B>
-option, you specify the name of widget to be embedded. But don't pack the
-widget, the tabset takes care of placing and arranging the widget for you.
-<BR>
-<CODE>graph .ts.graph<BR>
-.ts tab configure "f1" -window ".ts.graph" \<BR>
- -fill both -padx 0.25i -pady 0.25i<BR>
-</CODE><P>The size of the folder is determined the sizes of the Tk widgets embedded
-inside each folder. The folder will be as wide as the widest widget in
-any folder. The tallest determines the height. You can use the tab's <B>-pagewidth</B>
-and <B>-pageheight</B> options override this. <P>
-Other options control how the widget
-appears in the folder. The <B>-fill</B> option says that you wish to have the widget
-stretch to fill the available space in the folder. <BR>
-<CODE>.ts tab configure "f1" -fill both -padx 0.25i -pady 0.25i<BR>
-<P>
-</CODE><P>Now when you click the left mouse button on "f1", the graph will be displayed
-in the folder. It will be automatically hidden when another folder is selected.
- If you click on the right mouse button, the embedded widget will be moved
-into a toplevel widget of its own. Clicking again on the right mouse button
-puts it back into the folder. <P>
-If you want to share a page between two different
-folders, the <B>-command</B> option lets you specify a Tcl command to be invoked
-whenever the folder is selected. You can reset the <B>-window</B> option for the
-tab whenever it's clicked. <BR>
-<CODE>.ts tab configure "f2" -command { <BR>
- .ts tab configure "f2" -window ".ts.graph"<BR>
-}<BR>
-.ts tab configure "f1" -command { <BR>
- .ts tab configure "f1" -window ".ts.graph"<BR>
-}<BR>
-</CODE><P>If you have many folders, you may wish to stack tabs in multiple tiers.
- The tabset's <B>-tiers</B> option requests a maximum number of tiers. The default
-is one tier. <BR>
-<CODE>.ts configure -tiers 2<BR>
-</CODE><P>If the tabs can fit in less tiers, the widget will use that many. Whenever
-there are more tabs than can be displayed in the maximum number of tiers,
-the tabset will automatically let you scroll the tabs. You can even attach
-a scrollbar to the tabset. <BR>
-<CODE>.ts configure -scrollcommand { .sbar set } -scrollincrement 20<BR>
-.sbar configure -orient horizontal -command { .ts view }<BR>
-</CODE><P>By default tabs are along the top of the tabset from left to right. But
-tabs can be placed on any side of the tabset using the <B>-side</B> option. <BR>
-<CODE># Arrange tabs along the right side of the tabset. <BR>
-.ts configure -side right -rotate 270<BR>
-
-<H2><A NAME="sect5" HREF="#toc5"></CODE><P>Syntax</A></H2>
-The <B>tabset</B> command creates a new window using the <I>pathName</I> argument
-and makes it into a tabset widget. <BR>
-<P>
-<CODE><B>tabset <I>pathName </I></B>?<I>option value</I>?...<BR>
-</CODE><P>Additional options may be specified on the command line or in the option
-database to configure aspects of the tabset such as its colors, font, text,
-and relief. The <B>tabset</B> command returns its <I>pathName</I> argument. At the time
-this command is invoked, there must not exist a window named <I>pathName</I>,
-but <I>pathName</I>'s parent must exist. <P>
-When first created, a new tabset contains
-no tabs. Tabs are added or deleted using widget operations described below.
-It is not necessary for all the tabs to be displayed in the tabset window
-at once; commands described below may be used to change the view in the
-window. Tabsets allow scrolling of tabs using the <B>-scrollcommand</B> option.
-They also support scanning (see the <B>scan</B> operation). Tabs may be arranged
-along any side of the tabset window using the <B>-side</B> option. <P>
-The size of the
-tabset window is determined the number of tiers of tabs and the sizes of
-the Tk widgets embedded inside each folder. The widest widget determines
-the width of the folder. The tallest determines the height. If no folders
-contain an embedded widget, the size is detemined solely by the size of
-the tabs. <P>
-You can override either dimension with the tabset's <B>-width</B> and
-<B>-height</B> options.
-<H2><A NAME="sect6" HREF="#toc6">Tabset Indices</A></H2>
-Indices refer to individual tabs/folders in
-the tabset. Many of the operations for tabset widgets take one or more
-indices as arguments. An index may take several forms:
-<DL>
-
-<DT><I>number</I> </DT>
-<DD>Unique node
-id of the tab. </DD>
-
-<DT><B>@<I>x<B>,<I>y</I></B></I></B> </DT>
-<DD>Tab that covers the point in the tabset window specified
-by <I>x</I> and <I>y</I> (in screen coordinates). If no tab covers that point, then the
-index is ignored. </DD>
-
-<DT><B>select</B> </DT>
-<DD>The currently selected tab. The <B>select</B> index is
- typically changed by either clicking on the tab with the left mouse button
-or using the widget's <B>invoke</B> operation. </DD>
-
-<DT><B>active</B> </DT>
-<DD>The tab where the mouse pointer
-is currently located. The label is drawn using its active colors (see
-the <B>-activebackground</B> and <B>-activeforeground</B> options). The <B>active</B> index is
-typically changed by moving the mouse pointer over a tab or using the widget's
-<B>activate</B> operation. There can be only one active tab at a time. If there
-is no tab located under the mouse pointer, the index is ignored. </DD>
-
-<DT><B>focus</B>
-</DT>
-<DD>Tab that currently has the widget's focus. This tab is displayed with a dashed
-line around its label. You can change this using the <B>focus</B> operation. If
-no tab has focus, then the index is ignored. </DD>
-
-<DT><B>down</B> </DT>
-<DD>Tab immediately below
-the tab that currently has focus, if there is one. If there is no tab below,
-the current tab is returned. </DD>
-
-<DT><B>left</B> </DT>
-<DD>Tab immediately to the left the tab that
-currently has focus, if there is one. If there is no tab to the left, the
-current tab is returned. </DD>
-
-<DT><B>right</B> </DT>
-<DD>Tab immediately to the right the tab that
-currently has focus, if there is one. If there is no tab to the right, the
-current tab is returned. </DD>
-
-<DT><B>up</B> </DT>
-<DD>Tab immediately above, if there is one, to
-the tab that currently has focus. If there is no tab above, the current
-tab is returned. </DD>
-
-<DT><B>end</B> </DT>
-<DD>Last tab in the tabset. If there are no tabs in the
-tabset then the index is ignored. </DD>
-</DL>
-<P>
-Some indices may not always be available.
- For example, if the mouse is not over any tab, "active" does not have
-an index. For most tabset operations this is harmless and ignored.
-<H2><A NAME="sect7" HREF="#toc7">Tabset
-Operations</A></H2>
-All <B>tabset</B> operations are invoked by specifying the widget's pathname,
-the operation, and any arguments that pertain to that operation. The general
-form is: <P>
-<BR>
-<P>
-<CODE><tt> </tt> <tt> </tt> <I>pathName operation </I>?<I>arg arg ...</I>?<BR>
-<P>
-</CODE><P><I>Operation</I> and the <I>arg</I>s determine the exact behavior of the command. The
-following operations are available for tabset widgets:
-<DL>
-
-<DT><I>pathName <B>activate</B></I>
-<I>index</I> </DT>
-<DD>Sets the active tab to the one indicated by <I>index</I>. The active tab
-is drawn with its <I>active</I> colors (see the <B>-activebackground</B> and <B>-activeforeground</B>
-options) and may be retrieved with the index <B>active</B>. Only one tab may be
-active at a time. If <I>index</I> is the empty string, then all tabs will be drawn
-with their normal foreground and background colors. </DD>
-
-<DT><I>pathName <B>bind</B></I> <I>tagName</I>
-?<I>sequence</I>? ?<I>command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I> such that whenever
-the event sequence given by <I>sequence</I> occurs for a tab with this tag, <I>command</I>
-will be invoked. The syntax is similar to the <B>bind</B> command except that
-it operates on tabs, rather than widgets. See the <B>bind</B> manual entry for
-complete details on <I>sequence</I> and the substitutions performed on <I>command</I>.
- <P>
-If all arguments are specified then a new binding is created, replacing
- any existing binding for the same <I>sequence</I> and <I>tagName</I>. If the first character
-of <I>command</I> is <I>+</I> then <I>command</I> augments an existing binding rather than
-replacing it. If no <I>command</I> argument is provided then the command currently
-associated with <I>tagName</I> and <I>sequence</I> (it's an error occurs if there's no
-such binding) is returned. If both <I>command</I> and <I>sequence</I> are missing then
-a list of all the event sequences for which bindings have been defined
-for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>cget</B></I> <I>option</I> </DT>
-<DD>Returns the current value of the configuration
-option given by <I>option</I>. <I>Option</I> may have any of the values accepted by the
-<B>configure</B> operation described below. </DD>
-
-<DT><I>pathName <B>configure</B></I> ?<I>option</I>? ?<I>value
-option value ...</I>? </DT>
-<DD>Query or modify the configuration options of the widget.
-If no <I>option</I> is specified, returns a list describing all the available
-options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for information on the format
-of this list). If <I>option</I> is specified with no <I>value</I>, then the command returns
-a list describing the one named option (this list will be identical to
-the corresponding sublist of the value returned if no <I>option</I> is specified).
- If one or more <I>option-value</I> pairs are specified, then the command modifies
-the given widget option(s) to have the given value(s); in this case the
-command returns an empty string. <I>Option</I> and <I>value</I> are described below: <blockquote></DD>
-
-<DT><B>-activebackground
-<I>color</I></B> </DT>
-<DD>Sets the default active background color for tabs. A tab is active
-when the mouse is positioned over it or set by the <B>activate</B> operation.
-Individual tabs may override this option by setting the tab's <B>-activebackground</B>
-option. </DD>
-
-<DT><B>-activeforeground <I>color</I></B> </DT>
-<DD>Sets the default active foreground color
-for tabs. A tab is active when the mouse is positioned over it or set by
-the <B>activate</B> operation. Individual tabs may override this option by setting
-the tab's <B>-activeforeground</B> option. </DD>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets the background color
-of the tabset. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around
-the outside edge of the widget. The <B>-relief</B> option determines how the border
-is to be drawn. The default is <I>2</I>. </DD>
-
-<DT><B>-cursor <I>cursor</I></B> </DT>
-<DD>Specifies the widget's cursor.
- The default cursor is <I>""</I>. </DD>
-
-<DT><B>-dashes <I>dashList</I></B> </DT>
-<DD>Sets the dash style of the focus
-outline. When a tab has the widget's focus, it is drawn with a dashed outline
-around its label. <I>DashList</I> is a list of up to 11 numbers that alternately
-represent the lengths of the dashes and gaps on the cross hair lines. Each
-number must be between 1 and 255. If <I>dashList</I> is <I>""</I>, the outline will be
-a solid line. The default value is <I>5 2</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Sets the default
-font for the text in tab labels. Individual tabs may override this by setting
-the tab's <B>-font</B> option. The default value is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>.
-</DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets the default color of tab labels. Individual tabs
-may override this option by setting the tab's <B>-foreground</B> option. The default
-value is <I>black</I>. </DD>
-
-<DT><B>-gap <I>size</I></B> </DT>
-<DD>Sets the gap (in pixels) between tabs. The default
-value is <I>2</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B> </DT>
-<DD>Specifies the requested height of widget. If <I>pixels</I>
-is 0, then the height of the widget will be calculated based on the size
-the tabs and their pages. The default is <I>0</I>. </DD>
-
-<DT><B>-highlightbackground <I>color</I></B> </DT>
-<DD>Sets
-the color to display in the traversal highlight region when the tabset
-does not have the input focus. </DD>
-
-<DT><B>-highlightcolor <I>color</I></B> </DT>
-<DD>Sets the color to
-use for the traversal highlight rectangle that is drawn around the widget
-when it has the input focus. The default is <I>black</I>. </DD>
-
-<DT><B>-highlightthickness <I>pixels</I></B>
-</DT>
-<DD>Sets the width of the highlight rectangle to draw around the outside of
- the widget when it has the input focus. <I>Pixels</I> is a non-negative value
-and may have any of the forms acceptable to <B>Tk_GetPixels</B>. If the value is
-zero, no focus highlight is drawn around the widget. The default is <I>2</I>. </DD>
-
-<DT><B>-pageheight
-<I>pixels</I></B> </DT>
-<DD>Sets the requested height of the page. The page is the area under
-the tab used to display the page contents. If <I>pixels</I> is <I>0</I>, the maximum
-height of all embedded tab windows is used. The default is <I>0</I>. </DD>
-
-<DT><B>-pagewidth
-<I>pixels</I></B> </DT>
-<DD>Sets the requested width of the page. The page is the area under
-the tab used to display the page contents. If <I>pixels</I> is <I>0</I>, the maximum
-width of all embedded tab windows is used. The default is <I>0</I>. </DD>
-
-<DT><B>-relief <I>relief</I></B>
-</DT>
-<DD>Specifies the 3-D effect for the tabset widget. <I>Relief</I> specifies how the
-tabset should appear relative to widget that it is packed into; for example,
-<I>raised</I> means the tabset should appear to protrude. The default is <I>sunken</I>.
-</DD>
-
-<DT><B>-rotate <I>theta</I></B> </DT>
-<DD>Specifies the degrees to rotate text in tab labels. <I>Theta</I> is
-a real value representing the number of degrees to rotate the tick labels.
- The default is <I>0.0</I> degrees. </DD>
-
-<DT><B>-samewidth <I>boolean</I></B> </DT>
-<DD>Indicates if each tab should
-be the same width. If true, each tab will be as wide as the widest tab.
- The default is <I>no</I>. </DD>
-
-<DT><B>-scrollcommand <I>string</I></B> </DT>
-<DD>Specifies the prefix for a command
-for communicating with scrollbars. Whenever the view in the widget's window
- changes, the widget will generate a Tcl command by concatenating the
-scroll command and two numbers. If this option is not specified, then
-no command will be executed. </DD>
-
-<DT><B>-scrollincrement <I>pixels</I></B> </DT>
-<DD>Sets the smallest number
-of pixels to scroll the tabs. If <I>pixels</I> is greater than 0, this sets the
-units for scrolling (e.g., when you the change the view by clicking on
-the left and right arrows of a scrollbar). </DD>
-
-<DT><B>-selectbackground <I>color</I></B> </DT>
-<DD>Sets the
-color to use when displaying background of the selected tab. Individual
-tabs can override this option by setting the tab's <B>-selectbackground</B> option.
-</DD>
-
-<DT><B>-selectborderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the raised 3-D border to draw
-around the label of the selected tab. <I>Pixels</I> must be a non-negative value.
-The default value is <I>1</I>. </DD>
-
-<DT><B>-selectcommand <I>string</I></B> </DT>
-<DD>Specifies a default Tcl script
-to be associated with tabs. This command is typically invoked when left
-mouse button is released over the tab. Individual tabs may override this
-with the tab's <B>-command</B> option. The default value is <I>""</I>. </DD>
-
-<DT><B>-selectforeground <I>color<B>
-</B></I></B></DT>
-<DD>Sets the default color of the selected tab's text label. Individual tabs
-can override this option by setting the tab's <B>-selectforeground</B> option. The
-default value is <I>black</I>. </DD>
-
-<DT><B>-selectpad <I>pixels<B> </B></I></B></DT>
-<DD>Specifies extra padding to be displayed
-around the selected tab. The default value is <I>3</I>. </DD>
-
-<DT><B>-side <I>side<B> </B></I></B></DT>
-<DD>Specifies the
-side of the widget to place tabs. The following values are valid for <I>side</I>.
-The default value is <I>top</I>. <blockquote></DD>
-
-<DT><I>top</I> </DT>
-<DD>Tabs are drawn along the top. </DD>
-
-<DT><I>left</I> </DT>
-<DD>Tabs are
-drawn along the left side. </DD>
-
-<DT><I>right</I> </DT>
-<DD>Tabs are drawn along the right side. </DD>
-
-<DT><I>both</I>
-</DT>
-<DD>Tabs are drawn along the bottom side. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-slant <I>slant</I></B> </DT>
-<DD>Specifies if the tabs
-should be slanted 45 degrees on the left and/or right sides. The following
-values are valid for <I>slant</I>. The default is <I>none</I>. <blockquote></DD>
-
-<DT><I>none</I> </DT>
-<DD>Tabs are drawn as
-a rectangle. </DD>
-
-<DT><I>left</I> </DT>
-<DD>The left side of the tab is slanted. </DD>
-
-<DT><I>right</I> </DT>
-<DD>The right
-side of the tab is slanted. </DD>
-
-<DT><I>both</I> </DT>
-<DD>Boths sides of the tab are slanted. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-tabbackground
-<I>color</I></B> </DT>
-<DD>Sets the default background color of tabs. Individual tabs can override
-this option by setting the tab's <B>-background</B> option. </DD>
-
-<DT><B>-tabborderwidth <I>pixels</I></B>
-</DT>
-<DD>Sets the width of the 3-D border around the outside edge of the tab. The
-<B>-tabrelief</B> option determines how the border is to be drawn. The default
-is <I>2</I>. </DD>
-
-<DT><B>-tabforeground <I>color</I></B> </DT>
-<DD>Specifies the color to use when displaying a tab's
-label. Individual tabs can override this option by setting the tab's <B>-foreground</B>
-option. </DD>
-
-<DT><B>-tabrelief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect for both tabs and folders.
- <I>Relief</I> specifies how the tabs should appear relative to background of
-the widget; for example, <I>raised</I> means the tab should appear to protrude.
- The default is <I>raised</I>. </DD>
-
-<DT><B>-takefocus</B> <I>focus</I> </DT>
-<DD>Provides information used when
-moving the focus from window to window via keyboard traversal (e.g., Tab
-and Shift-Tab). If <I>focus</I> is <I>0</I>, this means that this window should be skipped
-entirely during keyboard traversal. <I>1</I> means that the this window should
-always receive the input focus. An empty value means that the traversal
-scripts decide whether to focus on the window. The default is <I>1</I>. </DD>
-
-<DT><B>-textside
-<I>side<B> </B></I></B></DT>
-<DD>If both images and text are specified for a tab, this option determines
-on which side of the tab the text is to be displayed. The valid sides are
-<I>left</I>, <I>right</I>, <I>top</I>, and <I>bottom</I>. The default value is <I>left</I>. </DD>
-
-<DT><B>-tiers <I>number<B> </B></I></B></DT>
-<DD>Specifies
-the maximum number of tiers to use to display the tabs. The default value
-is <I>1</I>. </DD>
-
-<DT><B>-tile <I>image</I></B> </DT>
-<DD>Specifies a tiled background for the widget. If <I>image</I>
-isn't <I>""</I>, the background is tiled using <I>image</I>. Otherwise, the normal background
-color is drawn (see the <B>-background</B> option). <I>Image</I> must be an image created
-using the Tk <B>image</B> command. The default is <I>""</I>. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Specifies the
-requested width of the widget. If <I>pixels</I> is 0, then the width of the widget
-will be calculated based on the size the tabs and their pages. The default
-is <I>0</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>delete <I>first </I></B></I>?<I>last</I>? </DT>
-<DD>Deletes one or more tabs from the tabset.
- <I>First</I> and <I>last</I> are the first and last indices, defining a range of tabs
-to be deleted. If <I>last</I> isn't specified, then only the tab at <I>first</I> is
-deleted. </DD>
-
-<DT><I>pathName <B>focus <I>index</I></B></I> </DT>
-<DD>Designates a tab to get the widget's focus.
- This tab is displayed with a dashed line around its label. </DD>
-
-<DT><I>pathName <B>get</B></I>
-<I>index</I> </DT>
-<DD>Returns the name of the tab. The value of <I>index</I> may be in any form
-described in the section <FONT SIZE=-1><B>TABSET INDICES</B></FONT>
- </DD>
-
-<DT><I>pathName <B>index</B></I> ?<I>flag</I>? <I>string</I>
-</DT>
-<DD>Returns the node id of the tab specified by <I>string</I>. If <I>flag</I> is <B>-name</B>, then
-<I>string</I> is the name of a tab. If <I>flag</I> is <B>-index</B>, <I>string</I> is an index such as
-"active" or "focus". If <I>flag</I> isn't specified, it defaults to <B>-index</B>. </DD>
-
-<DT><I>pathName
-<B>insert</B></I> <I>position <I>name</I></I> ?<I>option value</I>?... </DT>
-<DD>Inserts new tabs into the tabset. Tabs
-are inserted just before the tab given by <I>position</I>. <I>Position</I> may be either
-a number, indicating where in the list the new tab should be added, or
-<B>end</B>, indicating that the new tab is to be added the end of the list. <I>Name</I>
-is the symbolic name of the tab. <I>Be careful not to use a number. Otherwise
-the tabset will confuse it with tab indices</I>. Returns a list of indices
-for all the new tabs. </DD>
-
-<DT><I>pathName <B>invoke <I>index</I></B></I> </DT>
-<DD>Selects the tab given by <I>index</I>,
-maps the tab's embedded widget, and invokes the Tcl command associated
-with the tab, if there is one. The return value is the return value
-from the Tcl command, or an empty string if there is no command associated
-with the tab. This command is ignored if the tab's state (see the <B>-state</B>
-option) is disabled. </DD>
-
-<DT><I>pathName <B>move</B></I> <I>index</I> <B>before</B>|<B>after</B> <I>index</I> </DT>
-<DD>Moves the tab
-<I>index</I> to a new position in the tabset. </DD>
-
-<DT><I>pathName <B>nearest</B></I> <I>x</I> <I>y</I> </DT>
-<DD>Returns the
-name of the tab nearest to given X-Y screen coordinate. </DD>
-
-<DT><I>pathName <B>scan</B></I> <I>option
-args</I> </DT>
-<DD>This command implements scanning on tabsets. It has two forms, depending
-on <I>option</I>: <blockquote></DD>
-
-<DT><I>pathName <B>scan mark <I>x y</I></B></I> </DT>
-<DD>Records <I>x</I> and <I>y</I> and the current view
-in the tabset window; used with later <B>scan dragto</B> commands. Typically this
-command is associated with a mouse button press in the widget. It returns
-an empty string. </DD>
-
-<DT><I>pathName <B>scan dragto <I>x y</I></B></I>. </DT>
-<DD>This command computes the difference
-between its <I>x</I> and <I>y</I> arguments and the <I>x</I> and <I>y</I> arguments to the last <B>scan
-mark</B> command for the widget. It then adjusts the view by 10 times the difference
-in coordinates. This command is typically associated with mouse motion
-events in the widget, to produce the effect of dragging the list at high
-speed through the window. The return value is an empty string. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>see <I>index</I></B></I> </DT>
-<DD>Scrolls the tabset so that the tab <I>index</I> is visible in the widget's
-window. </DD>
-
-<DT><I>pathName <B>size</B></I> </DT>
-<DD>Returns the number of tabs in the tabset. </DD>
-
-<DT><I>pathName
-<B>tab <I>operation</I></B></I> ?<I>args</I>? </DT>
-<DD>See the <FONT SIZE=-1><B>TAB OPERATIONS</B></FONT>
- section below. </DD>
-
-<DT><I>pathName <B>view
-<I>args</I></B></I> </DT>
-<DD>This command queries or changes the position of the tabset in the
-widget's window. It can take any of the following forms: <blockquote></DD>
-
-<DT><I>pathName <B>view</B></I>
-</DT>
-<DD>Returns a list of two numbers between 0.0 and 1.0 that describe the amount
-and position of the tabset that is visible in the window. For example,
-if <I>view</I> is "0.2 0.6", 20% of the tabset's text is off-screen to the left, 40%
-is visible in the window, and 40% of the tabset is off-screen to the right.
- These are the same values passed to scrollbars via the <B>-scrollcommand</B> option.
-</DD>
-
-<DT><I>pathName <B>view moveto<I> fraction</I></B></I> </DT>
-<DD>Adjusts the view in the window so that <I>fraction</I>
-of the total width of the tabset text is off-screen to the left. <I>fraction</I>
-must be a number between 0.0 and 1.0. </DD>
-
-<DT><I>pathName <B>view scroll <I>number what</I></B></I> </DT>
-<DD>This
-command shifts the view in the window (left/top or right/bottom) according
-to <I>number</I> and <I>what</I>. <I>Number</I> must be an integer. <I>What</I> must be either <B>units</B>
-or <B>pages</B> or an abbreviation of these. If <I>what</I> is <B>units</B>, the view adjusts
-left or right by <I>number</I> scroll units (see the <B>-scrollincrement</B> option).
-; if it is <B>pages</B> then the view adjusts by <I>number</I> widget windows. If <I>number</I>
-is negative then tabs farther to the left become visible; if it is positive
-then tabs farther to the right become visible. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect8" HREF="#toc8">Tab Operations</A></H2>
-
-<DL>
-
-<DT><I>pathName <B>tab
-cget</B></I> <I>nameOrIndex</I> <I>option</I> </DT>
-<DD>Returns the current value of the configuration
-option given by <I>option</I>. <I>Option</I> may have any of the values accepted by the
-<B>tab configure</B> operation described below. </DD>
-
-<DT><I>pathName <B>tab configure</B></I> <I>nameOrIndex</I>
-?<I>nameOrIndex</I>...? <I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify the configuration
-options of one or more tabs. If no <I>option</I> is specified, this operation returns
-a list describing all the available options for <I>nameOrIndex</I>. <I>NameOrIndex</I>
-can be either the name of a tab or its index. Names of tabs take precedence
-over their indices. That means a tab named <I>focus</I> is picked over the "focus"
-tab. </DD>
-</DL>
-<P>
-If <I>option</I> is specified, but not <I>value</I>, then a list describing the one
-named option is returned. If one or more <I>option-value</I> pairs are specified,
-then each named tab (specified by <I>nameOrIndex</I>) will have its configurations
-option(s) set the given value(s). In this last case, the empty string is
-returned. <I>Option</I> and <I>value</I> are described below: <blockquote>
-<DL>
-
-<DT><B>-activebackground <I>color</I></B> </DT>
-<DD>Sets
-the active background color for <I>nameOrIndex</I>. A tab is active when the mouse
-is positioned over it or set by the <B>activate</B> operation. This overrides
-the widget's <B>-activebackground</B> option. </DD>
-
-<DT><B>-activeforeground <I>color</I></B> </DT>
-<DD>Sets the default
-active foreground color <I>nameOrIndex</I>. A tab is "active" when the mouse is
-positioned over it or set by the <B>activate</B> operation. Individual tabs may
-override this option by setting the tab's <B>-activeforeground</B> option. </DD>
-
-<DT><B>-anchor
-<I>anchor</I></B> </DT>
-<DD>Anchors the tab's embedded widget to a particular edge of the folder.
-This option has effect only if the space in the folder surrounding the
- embedded widget is larger than the widget itself. <I>Anchor</I> specifies how
-the widget will be positioned in the extra space. For example, if <I>anchor</I>
-is <I>center</I> then the window is centered in the folder ; if <I>anchor</I> is <I>w</I> then
-the window will be aligned with the leftmost edge of the folder. The default
-value is <I>center</I>. </DD>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets the background color for <I>nameOrIndex</I>.
- Setting this option overides the widget's <B>-tabbackground</B> option. </DD>
-
-<DT><B>-bindtags
-<I>tagList</I></B> </DT>
-<DD>Specifies the binding tags for this tab. <I>TagList</I> is a list of binding
-tag names. The tags and their order will determine how commands for events
-in tabs are invoked. Each tag in the list matching the event sequence
-will have its Tcl command executed. Implicitly the name of the tab is
-always the first tag in the list. The default value is <I>all</I>. </DD>
-
-<DT><B>-command <I>string</I></B>
-</DT>
-<DD>Specifies a Tcl script to be associated with <I>nameOrIndex</I>. This command
-is typically invoked when left mouse button is released over the tab.
-Setting this option overrides the widget's <B>-selectcommand</B> option. </DD>
-
-<DT><B>-data <I>string</I></B>
-</DT>
-<DD>Specifies a string to be associated with <I>nameOrIndex</I>. This value isn't used
-in the widget code. It may be used in Tcl bindings to associate extra
-data (other than the image or text) with the tab. The default value is <I>""</I>.
-</DD>
-
-<DT><B>-fill <I>fill</I></B> </DT>
-<DD>If the space in the folder surrounding the tab's embedded widget
-is larger than the widget, then <I>fill</I> indicates if the embedded widget
- should be stretched to occupy the extra space. <I>Fill</I> is either <I>none</I>, <I>x</I>,
-<I>y</I>, <I>both</I>. For example, if <I>fill</I> is <I>x</I>, then the widget is stretched horizontally.
- If <I>fill</I> is <I>y</I>, the widget is stretched vertically. The default is <I>none</I>.
-</DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Sets the font for the text in tab labels. If <I>fontName</I> is
-not the empty string, this overrides the tabset's <B>-font</B> option. The default
-value is <I>""</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets the color of the label for <I>nameOrIndex</I>.
- If <I>color</I> is not the empty string, this overrides the widget's <B>-tabforeground</B>
- option. The default value is <I>""</I>. </DD>
-
-<DT><B>-image <I>imageName</I></B> </DT>
-<DD>Specifies the image to
-be drawn in label for <I>nameOrIndex</I>. If <I>image</I> is <I>""</I>, no image will be drawn.
- Both text and images may be displayed at the same time in tab labels. The
-default value is <I>""</I>. </DD>
-
-<DT><B>-ipadx <I>pad</I></B> </DT>
-<DD>Sets the padding to the left and right of
-the label. <I>Pad</I> can be a list of one or two screen distances. If <I>pad</I> has
-two elements, the left side of the label is padded by the first distance
-and the right side by the second. If <I>pad</I> has just one distance, both the
-left and right sides are padded evenly. The default value is <I>0</I>. </DD>
-
-<DT><B>-ipady <I>pad</I></B>
-</DT>
-<DD>Sets the padding to the top and bottom of the label. <I>Pad</I> can be a list of
-one or two screen distances. If <I>pad</I> has two elements, the top of the label
-is padded by the first distance and the bottom by the second. If <I>pad</I> has
-just one distance, both the top and bottom sides are padded evenly. The
-default value is <I>0</I>. </DD>
-
-<DT><B>-padx <I>pad</I></B> </DT>
-<DD>Sets the padding around the left and right
-of the embedded widget, if one exists. <I>Pad</I> can be a list of one or two
-screen distances. If <I>pad</I> has two elements, the left side of the widget
-is padded by the first distance and the right side by the second. If <I>pad</I>
-has just one distance, both the left and right sides are padded evenly.
- The default value is <I>0</I>. </DD>
-
-<DT><B>-pady <I>pad</I></B> </DT>
-<DD>Sets the padding around the top and bottom
-of the embedded widget, if one exists. <I>Pad</I> can be a list of one or two screen
-distances. If <I>pad</I> has two elements, the top of the widget is padded by
-the first distance and the bottom by the second. If <I>pad</I> has just one distance,
-both the top and bottom sides are padded evenly. The default value is <I>0</I>.
-</DD>
-
-<DT><B>-selectbackground <I>color</I></B> </DT>
-<DD>Sets the color to use when displaying background
-of the selected tab. If <I>color</I> is not the empty string, this overrides the
-widget's <B>-selectbackground</B> option. The default value is <I>""</I>. </DD>
-
-<DT><B>-shadow <I>color</I></B> </DT>
-<DD>Sets
-the shadow color for the text in the tab's label. Drop shadows are useful
-when both the foreground and background of the tab have similar color intensities.
-If <I>color</I> is the empty string, no shadow is drawn. The default value is <I>""</I>.
-</DD>
-
-<DT><B>-state <I>state</I></B> </DT>
-<DD>Sets the state of the tab. If <I>state</I> is <I>disable</I> the text of the
-tab is drawn as engraved and operations on the tab (such as <B>invoke</B> and
-<B>tab tearoff</B>) are ignored. The default is <I>normal</I>. </DD>
-
-<DT><B>-stipple <I>bitmap</I></B> </DT>
-<DD>Specifies
-a stipple pattern to use for the background of the folder when the window
-is torn off. <I>Bitmap</I> specifies a bitmap to use as the stipple pattern. The
-default is <I>BLT</I>. </DD>
-
-<DT><B>-text <I>text</I></B> </DT>
-<DD>Specifies the text of the tab's label. The exact
-way the text is drawn may be affected by other options such as <B>-state</B> or
-<B>-rotate</B>. </DD>
-
-<DT><B>-window <I>pathName</I></B> </DT>
-<DD>Specifies the widget to be embedded into the tab.
- <I>PathName</I> must be a child of the <B>tabset</B> widget. The tabset will "pack"
-and manage the size and placement of <I>pathName</I>. The default value is <I>""</I>.
-</DD>
-
-<DT><B>-windowheight <I>pixels</I></B> </DT>
-<DD>Sets the requested height of the page. The page is
-the area under the tab used to display the page contents. If <I>pixels</I> is
-<I>0</I>, the maximum height of all embedded tab windows is used. The default
-is <I>0</I>. </DD>
-
-<DT><B>-windowwidth <I>pixels</I></B> </DT>
-<DD>Sets the requested width of the page. The page
-is the area under the tab used to display the page contents. If <I>pixels</I>
-is <I>0</I>, the maximum width of all embedded tab windows is used. The default
-is <I>0</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>tab names</B></I> ?<I>pattern</I>? </DT>
-<DD>Returns the names of all the tabs matching
-the given pattern. If no <I>pattern</I> argument is provided, then all tab names
-are returned. </DD>
-
-<DT><I>pathName <B>tab tearoff <I>index</I></B></I> ?<I>newName</I>? </DT>
-<DD>Reparents the widget
-embedded into <I>index</I>, placing it inside of <I>newName</I>. <I>NewName</I> is either the
-name of an new widget that will contain the embedded widget or the name
-of the <B>tabset</B> widget. It the last case, the embedded widget is put back
-into the folder. <P>
-If no <I>newName</I> argument is provided, then the name of the
-current parent of the embedded widget is returned. </DD>
-</DL>
-
-<H2><A NAME="sect9" HREF="#toc9">Default Bindings</A></H2>
-<P>
-BLT automatically
-generates class bindings that supply tabsets their default behaviors. The
-following event sequences are set by default for tabsets (via the class
-bind tag <I>Tabset</I>):
-<DL>
-
-<DT><B><ButtonPress-2></B></DT>
-<DD></DD>
-
-<DT><B><B2-Motion></B></DT>
-<DD></DD>
-
-<DT><B><ButtonRelease-2></B></DT>
-<DD>Mouse button 2 may
-be used for scanning. If it is pressed and dragged over the tabset, the
-contents of the tabset drag at high speed in the direction the mouse moves.
-</DD>
-
-<DT><B><KeyPress-Up></B></DT>
-<DD></DD>
-
-<DT><B><KeyPress-Down></B></DT>
-<DD>The up and down arrow keys move the focus to the
-tab immediately above or below the current focus tab. The tab with focus
-is drawn with the a dashed outline around the tab label. </DD>
-
-<DT><B><KeyPress-Left></B></DT>
-<DD></DD>
-
-<DT><B><KeyPress-Right></B></DT>
-<DD>The
-left and right arrow keys move the focus to the tab immediately to the
-left or right of the current focus tab. The tab with focus is drawn with
-the a dashed outline around the tab label. </DD>
-
-<DT><B><KeyPress-space></B></DT>
-<DD></DD>
-
-<DT><B><KeyPress-Return></B></DT>
-<DD>The
-space and return keys select the current tab given focus. When a folder
-is selected, it's command is invoked and the embedded widget is mapped.
-</DD>
-</DL>
-<P>
-Each tab, by default, also has a set of bindings (via the tag <I>all</I>). These
-bindings may be reset using the tabset's <B>bind</B> operation.
-<DL>
-
-<DT><B><Enter></B></DT>
-<DD></DD>
-
-<DT><B><Leave></B></DT>
-<DD>When
-the mouse pointer enters a tab, it is activated (i.e. drawn in its active
-colors) and when the pointer leaves, it is redrawn in its normal colors.
-</DD>
-
-<DT><B><ButtonRelease-1></B></DT>
-<DD>Clicking with the left mouse button on a tab causes the tab
-to be selected and its Tcl script (see the <B>-command</B> or <B>-selectcommand</B> options)
-to be invoked. The folder and any embedded widget (if one is specified)
-is automatically mapped. </DD>
-
-<DT><B><ButtonRelease-3></B></DT>
-<DD></DD>
-
-<DT><B><Control-ButtonRelease-1></B></DT>
-<DD>Clicking on
-the right mouse button (or the left mouse button with the Control key held
-down) tears off the current page into its own toplevel widget. The embedded
-widget is re-packed into a new toplevel and an outline of the widget is
-drawn in the folder. Clicking again (toggling) will reverse this operation
-and replace the page back in the folder. </DD>
-</DL>
-
-<H2><A NAME="sect10" HREF="#toc10">Bind Tags</A></H2>
-You can bind commands
-to tabs that are triggered when a particular event sequence occurs in them,
-much like canvas items in Tk's canvas widget. Not all event sequences are
-valid. The only binding events that may be specified are those related
-to the mouse and keyboard (such as <B>Enter</B>, <B>Leave</B>, <B>ButtonPress</B>, <B>Motion</B>,
-and <B>KeyPress</B>). <P>
-It is possible for multiple bindings to match a particular
-event. This could occur, for example, if one binding is associated with
-the tab name and another is associated with the tab's tags (see the <B>-bindtags</B>
-option). When this occurs, all the matching bindings are invoked. A binding
-associated with the tab name is invoked first, followed by one binding
-for each of the tab's bindtags. If there are multiple matching bindings
-for a single tag, then only the most specific binding is invoked. A continue
-command in a binding script terminates that script, and a break command
- terminates that script and skips any remaining scripts for the event,
- just as for the bind command. <P>
-The <B>-bindtags</B> option for tabs controls addition
-tag names that can be matched. Implicitly the first tag for each tab is
-its name. Setting the value of the <B>-bindtags</B> option doesn't change this.
-<H2><A NAME="sect11" HREF="#toc11">Keywords</A></H2>
-tabset,
-widget <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Example</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Syntax</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Tabset Indices</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Tabset Operations</A></LI>
-<LI><A NAME="toc8" HREF="#sect8">Tab Operations</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">Default Bindings</A></LI>
-<LI><A NAME="toc10" HREF="#sect10">Bind Tags</A></LI>
-<LI><A NAME="toc11" HREF="#sect11">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/tile.html b/blt3.0.1/html/tile.html
deleted file mode 100644
index 48f79e7..0000000
--- a/blt3.0.1/html/tile.html
+++ /dev/null
@@ -1,100 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>tile(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-tile - Tiling versions of Tk widgets
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<P>
-<B>tile::button
-<I>pathName</I></B> <I>option value</I>... <P>
-<B>tile::checkbutton <I>pathName</I></B> <I>option value</I>... <P>
-<B>tile::frame
-<I>pathName</I></B> <I>option value</I>... <P>
-<B>tile::label <I>pathName</I></B> <I>option value</I>... <P>
-<B>tile::radiobutton
-<I>pathName</I></B> <I>option value</I>... <P>
-<B>tile::scrollbar <I>pathName</I></B> <I>option value</I>... <P>
-<B>tile::toplevel
-<I>pathName</I></B> <I>option value</I>... <P>
-
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The tile widgets let you create textured
-backgrounds. The texture is a Tk image which is tiled over the entire background
-of the widget.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-With the advent of Tk 4.0, images are now easy
-to create and use in applications. Images add interest to applications
-and they convey more information. But one area where Tk hasn't taken advantage
-of images is using images as textures for widgets. Since tiling is a standard
-feature of windowing systems, it's very easy to use images as textures.
-<P>
-The tile widgets take the standard Tk 4.0 widgets and add tiling configuration
-options to them. Textures are specified by the name of the image you wish
-to be tiled across the background of the widget.
-<H2><A NAME="sect4" HREF="#toc4">Example</A></H2>
-To add tiling
-to a widget, you simply create an image using Tk's <B>image</B> command and use
-the image name as the value for the <B>-tile</B> configuration option of the widget.
-<BR>
-<CODE>image create photo my_texture -file tan_paper.gif<BR>
-blt::tile::frame .f -tile my_texture<BR>
-</CODE><P>The image <I>my_texture</I> is added to the frame. If <I>my_texture</I> is updated,
-so will the widget background. <BR>
-<CODE>image create photo my_texture -file rain.gif<BR>
-</CODE><P>The tile widget commands reside in the "blt::tile" namespace, so as not
-to collide with the normal Tk widgets. An easy way to add tiling to existing
-programs is to import the tile widget commands into the global namespace.
-<BR>
-<CODE>image create photo my_texture -file tan_paper.gif<BR>
-namespace import -force blt::tile::*<BR>
-frame .f -tile my_texture<BR>
-</CODE><P>To use one image for all texturing, you can use the "Tile" option class
-name to specify the same image for all tile widgets. <BR>
-<CODE>image create photo my_texture -file tan_paper.gif<BR>
-option add *Tile my_texture<BR>
-
-<H2><A NAME="sect5" HREF="#toc5"></CODE><P>Options</A></H2>
-The following configurations options are added to the widgets. If
-a <B>-tile<B> or <B>-activetile</B></B></B> option is specified, it overrides the background color
-of the widget.
-<DL>
-
-<DT><B>-activetile <I>image</I></B> </DT>
-<DD>Specifies a textured background to display
-when the widget is active. This option is available for the <B>tilebutton</B>,
-<B>tilecheckbutton</B>, <B>tileradiobutton</B>, and <B>tilescrollbar</B> widgets. <I>Image</I> is the
-name an image created using Tk's <B>image</B> command. The background of the widget
-is tiled with <I>image</I>. If <I>image</I> is <I>""</I>, then the active background color is
-displayed. The default is <I>""</I>. </DD>
-
-<DT><B>-tile <I>image</I></B> </DT>
-<DD>Specifies a textured background
-to display for the widget. <I>Image</I> is the name an image created using Tk's
-<B>image</B> command. The background of the widget is tiled with <I>image</I>. If <I>image</I>
-is <I>""</I>, then the normal background color is displayed. The default is <I>""</I>.
-</DD>
-</DL>
-
-<H2><A NAME="sect6" HREF="#toc6">Keywords</A></H2>
-tile, texture, button, label, radiobutton, checkbutton, scrollbar,
-frame, toplevel <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Example</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Options</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/tree.html b/blt3.0.1/html/tree.html
deleted file mode 100644
index 0d4e020..0000000
--- a/blt3.0.1/html/tree.html
+++ /dev/null
@@ -1,930 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>tree(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-tree - Create and manage tree data objects.
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>blt::tree
-create </B>?<I>treeName</I>? <P>
-<B>blt::tree destroy</B> <I>treeName</I>... <P>
-<B>blt::tree names</B> ?<I>pattern</I>?
-
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>tree</B> command creates tree data objects. A <I>tree object</I> is
-general ordered tree of nodes. Each node has both a label and a key-value
-list of data. Data can be heterogeneous, since nodes do not have to contain
-the same data keys. It is associated with a Tcl command that you can use
-to access and modify the its structure and data. Tree objects can also be
-managed via a C API.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-<P>
-
-<H2><A NAME="sect4" HREF="#toc4">Example</A></H2>
-<P>
-
-<H2><A NAME="sect5" HREF="#toc5">Syntax</A></H2>
-
-<DL>
-
-<DT><B>tree create</B> ?<I>treeName</I>?
- </DT>
-<DD>Creates a new tree object. The name of the new tree is returned. If no
-<I>treeName</I> argument is present, then the name of the tree is automatically
-generated in the form "<I>tree0</I>", "<I>tree1</I>", etc. If the substring "<I>#auto</I>" is
-found in <I>treeName</I>, it is automatically substituted by a generated name.
- For example, the name <I>.foo.#auto.bar</I> will be translated to <I>.foo.tree0.bar</I>. <P>
-A
-new Tcl command (by the same name as the tree) is also created. Another
-Tcl command or tree object can not already exist as <I>treeName</I>. If the Tcl
-command is deleted, the tree will also be freed. The new tree will contain
-just the root node. Trees are by default, created in the current namespace,
-not the global namespace, unless <I>treeName</I> contains a namespace qualifier,
-such as "<I>fred::myTree</I>". </DD>
-
-<DT><B>tree destroy</B> <I>treeName</I>... </DT>
-<DD>Releases one of more trees.
- The Tcl command associated with <I>treeName</I> is also removed. Trees are reference
-counted. The internal tree data object isn't destroyed until no one else
-is using the tree. </DD>
-
-<DT><B>tree names </B>?<I>pattern</I>? </DT>
-<DD>Returns the names of all tree objects.
- if a <I>pattern</I> argument is given, then the only those trees whose name matches
-pattern will be listed. </DD>
-</DL>
-
-<H2><A NAME="sect6" HREF="#toc6">Node IDs and Tags</A></H2>
-Nodes in a tree object may be referred
-in either of two ways: by id or by tag. Each node has a unique serial number
-or id that is assigned to that node when it's created. The id of an node
-never changes and id numbers are not re-used. <P>
-A node may also have any number
-of tags associated with it. A tag is just a string of characters, and it
-may take any form except that of an integer. For example, "<I>x123</I>" is valid,
-but "<I>123</I>" isn't. The same tag may be associated with many different nodes.
-This is commonly done to group nodes in various interesting ways. <P>
-There
-are two built-in tags: The tag <B>all</B> is implicitly associated with every node
-in the tree. It may be used to invoke operations on all the nodes in the
-tree. The tag <B>root</B> is managed automatically by the tree object. It applies
-to the node current set as root. <P>
-When specifying nodes in tree object commands,
-if the specifier is an integer then it is assumed to refer to the single
-node with that id. If the specifier is not an integer, then it is assumed
-to refer to all of the nodes in the tree that have a tag matching the specifier.
- The symbol <I>node</I> is used below to indicate that an argument specifies either
-an id that selects a single node or a tag that selects zero or more nodes.
- Many tree commands only operate on a single node at a time; if <I>node</I> is
-specified in a way that names multiple items, then an error "refers to
-more than one node" is generated.
-<H2><A NAME="sect7" HREF="#toc7">Node Modifiers</A></H2>
-You can also specify node
-in relation to another node by appending one or more modifiers to the node
-id or tag. A modifier refers to a node in relation to the specified node.
- For example, "<I>root->firstchild</I>" selects the first subtree of the root node.
-<P>
-The following modifiers are available: <blockquote>
-<DL>
-
-<DT><B>firstchild</B> </DT>
-<DD>Selects the first child
-of the node. </DD>
-
-<DT><B>lastchild</B> </DT>
-<DD>Selects the last child of the node. </DD>
-
-<DT><B>next</B> </DT>
-<DD>Selects
-the next node in preorder to the node. </DD>
-
-<DT><B>nextsibling</B> </DT>
-<DD>Selects the next sibling
-of the node. </DD>
-
-<DT><B>parent</B> </DT>
-<DD>Selects the parent of the node. </DD>
-
-<DT><B>previous</B> </DT>
-<DD>Selects
-the previous node in preorder to the node. </DD>
-
-<DT><B>prevsibling</B> </DT>
-<DD>Selects the previous
-sibling of the node. </DD>
-
-<DT>"<I>label</I>" </DT>
-<DD>Selects the node whose label is <I>label</I>. Enclosing
-<I>label</I> in quotes indicates to always search for a node by its label (for
-example, even if the node is labeled "parent"). </DD>
-</DL>
-</blockquote>
-<P>
-It's an error the node can't
-be found. For example, <B>lastchild</B> and <B>firstchild</B> will generate errors if
-the node has no children. The exception to this is the <B>index</B> operation.
-You can use <B>index</B> to test if a modifier is valid.
-<H2><A NAME="sect8" HREF="#toc8">Tree Operations</A></H2>
-Once you
-create a tree object, you can use its Tcl command to query or modify it.
- The general form is <BR>
-<P>
-<CODE><I>treeName</I> <I>operation</I> ?<I>arg</I>?...<BR>
-</CODE><P>Both <I>operation</I> and its arguments determine the exact behavior of the command.
- The operations available for trees are listed below.
-<DL>
-
-<DT><I>treeName</I> <B>ancestor</B>
-<I>node1</I> <I>node2</I> </DT>
-<DD>Returns the mutual ancestor of the two nodes <I>node1</I> and <I>node2</I>.
- The ancestor can be one of the two nodes. For example, if <I>node1</I> and <I>node2</I>
-are the same nodes, their ancestor is <I>node1</I>. </DD>
-
-<DT><I>treeName</I> <B>apply</B> <I>node</I> ?<I>switches</I>?
-</DT>
-<DD>Runs commands for all nodes matching the criteria given by <I>switches</I> for
-the subtree designated by <I>node</I>. By default all nodes match, but you can
-set switches to narrow the match. This operation differs from <B>find</B> in two
-ways: 1) Tcl commands can be invoked both pre- and post-traversal of a node
-and 2) the tree is always traversed in depth first order. <P>
-The <B>-exact</B>, <B>-glob</B>,
- and <B>-regexp</B> switches indicate both what kind of pattern matching to perform
-and the pattern. Pattern matching is done, by default, against each node's
-label. But if the <B>-path</B> switch is present, it will match the full path of
-the node (a list containing the labels of the node's ancestors too). If
-the <B>-key</B> switch is used, it designates the data field to be matched. <P>
-The
-valid switches are listed below: <blockquote></DD>
-
-<DT><B>-depth</B> <I>number</I> </DT>
-<DD>Descend at most <I>number</I> (a
-non-negative integer) levels If <I>number</I> is <I>1</I> this means only apply the tests
-to the children of <I>node</I>. </DD>
-
-<DT><B>-exact</B> <I>string</I> </DT>
-<DD>Matches each node using <I>string</I>. The
-node must match <I>string</I> exactly. </DD>
-
-<DT><B>-glob</B> <I>string</I> </DT>
-<DD>Test each node to <I>string</I> using
-global pattern matching. Matching is done in a fashion similar to that
-used by the C-shell. </DD>
-
-<DT><B>-invert</B> </DT>
-<DD>Select non-matching nodes. Any node that <I>doesn't</I>
-match the given criteria will be selected. </DD>
-
-<DT><B>-key</B> <I>key</I> </DT>
-<DD>If pattern matching is
-selected (using the <B>-exact</B>, <B>-glob</B>, or <B>-regexp</B> switches), compare the values
-of the data field keyed by <I>key</I> instead of the node's label. If no pattern
-matching switches are set, then any node with this data key will match.
-</DD>
-
-<DT><B>-leafonly</B> </DT>
-<DD>Only test nodes with no children. </DD>
-
-<DT><B>-nocase</B> </DT>
-<DD>Ignore case when matching
-patterns. </DD>
-
-<DT><B>-path</B> </DT>
-<DD>Use the node's full path when comparing nodes. </DD>
-
-<DT><B>-precommand</B> <I>command</I>
-</DT>
-<DD>Invoke <I>command</I> for each matching node. Before <I>command</I> is invoked, the id
-of the node is appended. You can control processing by the return value
-of <I>command</I>. If <I>command</I> generates an error, processing stops and the <B>find</B>
-operation returns an error. But if <I>command</I> returns <B>break</B>, then processing
-stops, no error is generated. If <I>command</I> returns <B>continue</B>, then processing
-stops on that subtree and continues on the next. </DD>
-
-<DT><B>-postcommand</B> <I>command</I> </DT>
-<DD>Invoke
-<I>command</I> for each matching node. Before <I>command</I> is invoked, the id of the
-node is appended. You can control processing by the return value of <I>command</I>.
- If <I>command</I> generates an error, processing stops and the <B>find</B> operation
- returns an error. But if <I>command</I> returns <B>break</B>, then processing stops,
-no error is generated. If <I>command</I> returns <B>continue</B>, then processing stops
-on that subtree and continues on the next. </DD>
-
-<DT><B>-regexp</B> <I>string</I> </DT>
-<DD>Test each node
-using <I>string</I> as a regular expression pattern. </DD>
-
-<DT><B>-tag</B> <I>string</I> </DT>
-<DD>Only test nodes
-that have the tag <I>string</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>treeName</I> <B>attach</B> <I>treeObject</I> </DT>
-<DD>Attaches to an existing
-tree object <I>treeObject</I>. This is for cases where the tree object was previously
-created via the C API. The current tree associated with <I>treeName</I> is discarded.
- In addition, the current set of tags, notifier events, and traces are
-removed. </DD>
-
-<DT><I>treeName</I> <B>children</B> <I>node</I> </DT>
-<DD>Returns a list of children for <I>node</I>. If
-<I>node</I> is a leaf, then an empty string is returned. </DD>
-
-<DT><I>treeName</I> <B>copy</B> <I>srcNode</I>
-?<I>destTree</I>? <I>destNode</I> ?<I>switches</I>? </DT>
-<DD>Copies <I>srcNode</I> into <I>destNode</I>. Both nodes
-<I>srcNode</I> and <I>destNode</I> must already exist. If <I>destTree</I> argument is present,
-it indicates the name of the destination tree. By default both the source
-and destination trees are the same. The valid <I>switches</I> are listed below:
-<blockquote></DD>
-
-<DT><B>-overwrite</B> </DT>
-<DD>Overwrite nodes that already exist. Normally nodes are always
-created, even if there already exists a node by the same name. This switch
-indicates to add or overwrite the node's data fields. </DD>
-
-<DT><B>-recurse</B> </DT>
-<DD>Recursively
-copy all the subtrees of <I>srcNode</I> as well. In this case, <I>srcNode</I> can't be
-an ancestor of <I>destNode</I> as it would result in a cyclic copy. </DD>
-
-<DT><B>-tags</B> </DT>
-<DD>Copy tag
-inforation. Normally the following node is copied: its label and data
-fields. This indicates to copy tags as well. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>treeName</I> <B>degree</B> <I>node</I> </DT>
-<DD>Returns
-the number of children of <I>node</I>. </DD>
-
-<DT><I>treeName</I> <B>delete</B> <I>node</I>... </DT>
-<DD>Recursively deletes
-one or more nodes from the tree. The node and all its descendants are
-removed. The one exception is the root node. In this case, only its descendants
-are removed. The root node will remain. Any tags or traces on the nodes
-are released. </DD>
-
-<DT><I>treeName</I> <B>depth</B> <I>node</I> </DT>
-<DD>Returns the depth of the node. The depth
-is the number of steps from the node to the root of the tree. The depth
-of the root node is <I>0</I>. </DD>
-
-<DT><I>treeName</I> <B>dump</B> <I>node</I> </DT>
-<DD>Returns a list of the paths and
-respective data for <I>node</I> and its descendants. The subtree designated by
-<I>node</I> is traversed returning the following information for each node: 1)
-the node's path relative to <I>node</I>, 2) a sublist key value pairs representing
-the node's data fields, and 3) a sublist of tags. This list returned can
-be used later to copy or restore the tree with the <B>restore</B> operation. </DD>
-
-<DT><I>treeName</I>
-<B>dumpfile</B> <I>node</I> <I>fileName</I> </DT>
-<DD>Writes a list of the paths and respective data for
-<I>node</I> and its descendants to the given file <I>fileName</I>. The subtree designated
-by <I>node</I> is traversed returning the following information for each node:
-1) the node's path relative to <I>node</I>, 2) a sublist key value pairs representing
-the node's data fields, and 3) a sublist of tags. This list returned can
-be used later to copy or restore the tree with the <B>restore</B> operation. </DD>
-
-<DT><I>treeName</I>
-<B>exists</B> <I>node</I> ?<I>key</I>? </DT>
-<DD>Indicates if <I>node</I> exists in the tree. If a <I>key</I> argument
-is present then the command also indicates if the named data field exists.
-</DD>
-
-<DT><I>treeName</I> <B>find</B> <I>node</I> ?<I>switches</I>? </DT>
-<DD>Finds for all nodes matching the criteria
-given by <I>switches</I> for the subtree designated by <I>node</I>. A list of the selected
- nodes is returned. By default all nodes match, but you can set switches
-to narrow the match. <P>
-The <B>-exact</B>, <B>-glob</B>, and <B>-regexp</B> switches indicate both
-what kind of pattern matching to perform and the pattern. Pattern matching
-is done, by default, against each node's label. But if the <B>-path</B> switch is
-present, it will match the full path of the node. If the <B>-key</B> switch is
-used, it designates the data field to be matched. <P>
-The order in which
-the nodes are traversed is controlled by the <B>-order</B> switch. The possible
-orderings are <B>preorder</B>, <B>postorder</B>, <B>inorder</B>, and <B>breadthfirst</B>. The default
-is <B>postorder</B>. <P>
-The valid switches are listed below: <blockquote></DD>
-
-<DT><B>-addtag</B> <I>string</I> </DT>
-<DD>Add the
-tag <I>string</I> to each selected node. </DD>
-
-<DT><B>-count</B> <I>number</I> </DT>
-<DD>Stop processing after <I>number</I>
-(a positive integer) matches. </DD>
-
-<DT><B>-depth</B> <I>number</I> </DT>
-<DD>Descend at most <I>number</I> (a non-negative
-integer) levels If <I>number</I> is <I>1</I> this means only apply the tests to the children
-of <I>node</I>. </DD>
-
-<DT><B>-exact</B> <I>string</I> </DT>
-<DD>Matches each node using <I>string</I>. The node must match
-<I>string</I> exactly. </DD>
-
-<DT><B>-exec</B> <I>command</I> </DT>
-<DD>Invoke <I>command</I> for each matching node. Before
-<I>command</I> is invoked, the id of the node is appended. You can control processing
-by the return value of <I>command</I>. If <I>command</I> generates an error, processing
-stops and the <B>find</B> operation returns an error. But if <I>command</I> returns
-<B>break</B>, then processing stops, no error is generated. If <I>command</I> returns
- <B>continue</B>, then processing stops on that subtree and continues on the next.
-</DD>
-
-<DT><B>-glob</B> <I>string</I> </DT>
-<DD>Test each node to <I>string</I> using global pattern matching. Matching
-is done in a fashion similar to that used by the C-shell. </DD>
-
-<DT><B>-invert</B> </DT>
-<DD>Select non-matching
-nodes. Any node that <I>doesn't</I> match the given criteria will be selected. </DD>
-
-<DT><B>-key</B>
-<I>key</I> </DT>
-<DD>If pattern matching is selected (using the <B>-exact</B>, <B>-glob</B>, or <B>-regexp</B> switches),
-compare the values of the data field keyed by <I>key</I> instead of the node's
-label. If no pattern matching switches are set, then any node with this
-data key will match. </DD>
-
-<DT><B>-leafonly</B> </DT>
-<DD>Only test nodes with no children. </DD>
-
-<DT><B>-nocase</B> </DT>
-<DD>Ignore
-case when matching patterns. </DD>
-
-<DT><B>-order</B> <I>string</I> </DT>
-<DD>Traverse the tree and process
-nodes according to <I>string</I>. <I>String</I> can be one of the following: <blockquote></DD>
-
-<DT><B>breadthfirst</B>
- </DT>
-<DD>Process the node and the subtrees at each sucessive level. Each node on
-a level is processed before going to the next level. </DD>
-
-<DT><B>inorder</B> </DT>
-<DD>Recursively
-process the nodes of the first subtree, the node itself, and any the remaining
-subtrees. </DD>
-
-<DT><B>postorder</B> </DT>
-<DD>Recursively process all subtrees before the node. </DD>
-
-<DT><B>preorder</B>
- </DT>
-<DD>Recursively process the node first, then any subtrees. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-path</B> </DT>
-<DD>Use the node's
-full path when comparing nodes. </DD>
-
-<DT><B>-regexp</B> <I>string</I> </DT>
-<DD>Test each node using <I>string</I>
-as a regular expression pattern. </DD>
-
-<DT><B>-tag</B> <I>string</I> </DT>
-<DD>Only test nodes that have the
-tag <I>string</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>treeName</I> <B>findchild</B> <I>node</I> <I>label</I> </DT>
-<DD>Searches for a child node Ilabel
-in <I>node</I>. The id of the child node is returned if found. Otherwise <I>-1</I> is
-returned. </DD>
-
-<DT><I>treeName</I> <B>firstchild</B> <I>node</I> </DT>
-<DD>Returns the id of the first child in
-the <I>node</I>'s list of subtrees. If <I>node</I> is a leaf (has no children), then
-<I>-1</I> is returned. </DD>
-
-<DT><I>treeName</I> <B>get</B> <I>node</I> ?<I>key</I>? ?<I>defaultValue</I>? </DT>
-<DD>Returns a list of
-key-value pairs of data for the node. If <I>key</I> is present, then onlyx the
-value for that particular data field is returned. It's normally an error
-if <I>node</I> does not contain the data field <I>key</I>. But if you provide a <I>defaultValue</I>
-argument, this value is returned instead (<I>node</I> will still not contain <I>key</I>).
- This feature can be used to access a data field of <I>node</I> without first
-testing if it exists. This operation may trigger <B>read</B> data traces. </DD>
-
-<DT><I>treeName</I>
-<B>index</B> <I>node</I> </DT>
-<DD>Returns the id of <I>node</I>. If <I>node</I> is a tag, it can only specify
-one node. If <I>node</I> does not represent a valid node id or tag, or has modifiers
-that are invalid, then <I>-1</I> is returned. </DD>
-
-<DT><I>treeName</I> <B>insert</B> <I>parent</I> ?<I>switches</I>?
- </DT>
-<DD>Inserts a new node into parent node <I>parent</I>. The id of the new node is
-returned. The following switches are available: <blockquote></DD>
-
-<DT><B>-at</B> <I>number</I> </DT>
-<DD>Inserts the
-node into <I>parent</I>'s list of children at position <I>number</I>. The default is
-to append <I>node</I>. </DD>
-
-<DT><B>-data</B> <I>dataList</I> </DT>
-<DD>Sets the value for each data field in <I>dataList</I>
-for the new node. <I>DataList</I> is a list of key-value pairs. </DD>
-
-<DT><B>-label</B> <I>string</I> </DT>
-<DD>Designates
-the labels of the node as <I>string</I>. By default, nodes are labeled as <I>node0</I>,
-<I>node1</I>, etc. </DD>
-
-<DT><B>-tags</B> <I>tagList</I> </DT>
-<DD>Adds each tag in <I>tagList</I> to the new node. <I>TagList</I>
-is a list of tags, so be careful if a tag has embedded space. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>treeName</I> <B>is</B>
-<I>property</I> <I>args</I> </DT>
-<DD>Indicates the property of a node. Both <I>property</I> and <I>args</I>
-determine the property being tested. Returns <I>1</I> if true and <I>0</I> otherwise.
- The following <I>property</I> and <I>args</I> are valid: <blockquote></DD>
-
-<DT><B>ancestor</B> <I>node1</I> <I>node2</I> </DT>
-<DD>Indicates
-if <I>node1</I> is an ancestor of <I>node2</I>. </DD>
-
-<DT><B>before</B> <I>node1</I> <I>node2</I> </DT>
-<DD>Indicates if <I>node1</I>
-is before <I>node2</I> in depth first traversal. </DD>
-
-<DT><B>leaf</B> <I>node</I> </DT>
-<DD>Indicates if <I>node</I> is
-a leaf (it has no subtrees). </DD>
-
-<DT><B>root</B> <I>node</I> </DT>
-<DD>Indicates if <I>node</I> is the designated
-root. This can be changed by the <B>root</B> operation. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>treeName</I> <B>label</B> <I>node</I> ?<I>newLabel</I>?
-</DT>
-<DD>Returns the label of the node designated by <I>node</I>. If <I>newLabel</I> is present,
-the node is relabeled using it as the new label. </DD>
-
-<DT><I>treeName</I> <B>lastchild</B> <I>node</I>
-</DT>
-<DD>Returns the id of the last child in the <I>node</I>'s list of subtrees. If <I>node</I>
-is a leaf (has no children), then <I>-1</I> is returned. </DD>
-
-<DT><I>treeName</I> <B>move</B> <I>node</I> <I>newParent</I>
-?<I>switches</I>? </DT>
-<DD>Moves <I>node</I> into <I>newParent</I>. <I>Node</I> is appended to the list children
-of <I>newParent</I>. <I>Node</I> can not be an ancestor of <I>newParent</I>. The valid flags
-for <I>switches</I> are described below. <blockquote></DD>
-
-<DT><B>-after</B> <I>child</I> </DT>
-<DD>Position <I>node</I> after <I>child</I>.
- The node <I>child</I> must be a child of <I>newParent</I>. </DD>
-
-<DT><B>-at</B> <I>number</I> </DT>
-<DD>Inserts <I>node</I> into
-<I>parent</I>'s list of children at position <I>number</I>. The default is to append the
-node. </DD>
-
-<DT><B>-before</B> <I>child</I> </DT>
-<DD>Position <I>node</I> before <I>child</I>. The node <I>child</I> must be a
- child of <I>newParent</I>. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>treeName</I> <B>next</B> <I>node</I> </DT>
-<DD>Returns the next node from <I>node</I>
-in a preorder traversal. If <I>node</I> is the last node in the tree, then <I>-1</I> is
-returned. </DD>
-
-<DT><I>treeName</I> <B>nextsibling</B> <I>node</I> </DT>
-<DD>Returns the node representing the next
-subtree from <I>node</I> in its parent's list of children. If <I>node</I> is the last
-child, then <I>-1</I> is returned. </DD>
-
-<DT><I>treeName</I> <B>notify</B> <I>args</I> </DT>
-<DD>Manages notification events
-that indicate that the tree structure has been changed. See the <FONT SIZE=-1><B>NOTIFY
-OPERATIONS</B></FONT>
- section below. </DD>
-
-<DT><I>treeName</I> <B>parent</B> <I>node</I> </DT>
-<DD>Returns the parent node
-of <I>node</I>. If <I>node</I> is the root of the tree, then <I>-1</I> is returned. </DD>
-
-<DT><I>treeName</I>
-<B>path</B> <I>node</I> </DT>
-<DD>Returns the full path (from root) of <I>node</I>. </DD>
-
-<DT><I>treeName</I> <B>position</B> <I>node</I>
-</DT>
-<DD>Returns the position of the node in its parent's list of children. Positions
-are numbered from 0. The position of the root node is always 0. </DD>
-
-<DT><I>treeName</I>
-<B>previous</B> <I>node</I> </DT>
-<DD>Returns the previous node from <I>node</I> in a preorder traversal.
-If <I>node</I> is the root of the tree, then <I>-1</I> is returned. </DD>
-
-<DT><I>treeName</I> <B>prevsibling</B>
-<I>node</I> </DT>
-<DD>Returns the node representing the previous subtree from <I>node</I> in its
-parent's list of children. If <I>node</I> is the first child, then <I>-1</I> is returned.
-</DD>
-
-<DT><I>treeName</I> <B>restore</B> <I>node</I> <I>dataString</I> <I>switches</I> </DT>
-<DD>Performs the inverse function
-of the <B>dump</B> operation, restoring nodes to the tree. The format of <I>dataString</I>
-is exactly what is returned by the <B>dump</B> operation. It's a list containing
-information for each node to be restored. The information consists of 1)
-the relative path of the node, 2) a sublist of key value pairs representing
-the node's data, and 3) a list of tags for the node. Nodes are created
- starting from <I>node</I>. Nodes can be listed in any order. If a node's path
-describes ancestor nodes that do not already exist, they are automatically
-created. The valid <I>switches</I> are listed below: <blockquote></DD>
-
-<DT><B>-overwrite</B> </DT>
-<DD>Overwrite nodes
-that already exist. Normally nodes are always created, even if there already
-exists a node by the same name. This switch indicates to add or overwrite
-the node's data fields. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>treeName</I> <B>restorefile</B> <I>node</I> <I>fileName</I> <I>switches</I> </DT>
-<DD>Performs
-the inverse function of the <B>dumpfile</B> operation, restoring nodes to the
-tree from the file <I>fileName</I>. The format of <I>fileName</I> is exactly what is
-returned by the <B>dumpfile</B> operation. It's a list containing information
-for each node to be restored. The information consists of 1) the relative
-path of the node, 2) a sublist of key value pairs representing the node's
-data, and 3) a list of tags for the node. Nodes are created starting
-from <I>node</I>. Nodes can be listed in any order. If a node's path describes
-ancestor nodes that do not already exist, they are automatically created.
- The valid <I>switches</I> are listed below: <blockquote></DD>
-
-<DT><B>-overwrite</B> </DT>
-<DD>Overwrite nodes that already
-exist. Normally nodes are always created, even if there already exists
-a node by the same name. This switch indicates to add or overwrite the
-node's data fields. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>treeName</I> <B>root</B> ?<I>node</I>? </DT>
-<DD>Returns the id of the root node.
- Normally this is node <I>0</I>. If a <I>node</I> argument is provided, it will become
-the new root of the tree. This lets you temporarily work within a subset
-of the tree. Changing root affects operations such as <B>next</B>, <B>path</B>, <B>previous</B>,
-etc. </DD>
-
-<DT><I>treeName</I> <B>set</B> <I>node</I> <I>key value</I> ?<I>key value</I>...? </DT>
-<DD>Sets one or more data fields
-in <I>node</I>. <I>Node</I> may be a tag that represents several nodes. <I>Key</I> is the name
-of the data field to be set and <I>value</I> is its respective value. This operation
-may trigger <B>write</B> and <B>create</B> data traces. </DD>
-
-<DT><I>treeName</I> <B>size</B> <I>node</I> </DT>
-<DD>Returns the
-number of nodes in the subtree. This includes the node and all its descendants.
- The size of a leaf node is 1. </DD>
-
-<DT><I>treeName</I> <B>sort</B> <I>node</I> ?<I>switches</I>? </DT>
-<DD><blockquote></DD>
-
-<DT><B>-ascii</B> </DT>
-<DD>Compare
-strings using the ASCII collation order. </DD>
-
-<DT><B>-command</B> <I>string</I> </DT>
-<DD>Use command <I>string</I>
-as a comparison command. To compare two elements, evaluate a Tcl script
-consisting of command with the two elements appended as additional arguments.
- The script should return an integer less than, equal to, or greater than
-zero if the first element is to be considered less than, equal to, or greater
-than the second, respectively. </DD>
-
-<DT><B>-decreasing</B> </DT>
-<DD>Sort in decreasing order (largest
-items come first). </DD>
-
-<DT><B>-dictionary</B> </DT>
-<DD>Compare strings using a dictionary-style comparison.
- This is the same as <B>-ascii</B> except (a) case is ignored except as a tie-breaker
-and (b) if two strings contain embedded numbers, the numbers compare as
-integers, not characters. For example, in <B>-dictionary</B> mode, bigBoy sorts
-between bigbang and bigboy, and x10y sorts between x9y and x11y. </DD>
-
-<DT><B>-integer</B>
-</DT>
-<DD>Compare the nodes as integers. </DD>
-
-<DT><B>-key</B> <I>string</I> </DT>
-<DD>Sort based upon the node's data
-field keyed by <I>string</I>. Normally nodes are sorted according to their label.
- </DD>
-
-<DT><B>-path</B> </DT>
-<DD>Compare the full path of each node. The default is to compare only
-its label. </DD>
-
-<DT><B>-real</B> </DT>
-<DD>Compare the nodes as real numbers. </DD>
-
-<DT><B>-recurse</B> </DT>
-<DD>Recursively sort
-the entire subtree rooted at <I>node</I>. </DD>
-
-<DT><B>-reorder</B> </DT>
-<DD>Recursively sort subtrees for
-each node. <B>Warning</B>. Unlike the normal flat sort, where a list of nodes
-is returned, this will reorder the tree. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>treeName</I> <B>tag</B> <I>args</I> </DT>
-<DD>Manages tags
-for the tree object. See the <FONT SIZE=-1><B>TAG OPERATIONS</B></FONT>
- section below. </DD>
-
-<DT><I>treeName</I> <B>trace</B>
-<I>args</I> </DT>
-<DD>Manages traces for data fields in the tree object. Traces cause Tcl
-commands to be executed whenever a data field of a node is created, read,
-written, or unset. Traces can be set for a specific node or a tag, representing
-possibly many nodes. See the <FONT SIZE=-1><B>TRACE OPERATIONS</B></FONT>
- section below. </DD>
-
-<DT><I>treeName</I> <B>unset</B>
-<I>node</I> <I>key</I>... </DT>
-<DD>Removes one or more data fields from <I>node</I>. <I>Node</I> may be a tag that
-represents several nodes. <I>Key</I> is the name of the data field to be removed.
- It's not an error is <I>node</I> does not contain <I>key</I>. This operation may trigger
-<B>unset</B> data traces. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect9" HREF="#toc9">Tag Operations</A></H2>
-Tags are a general means of selecting and
-marking nodes in the tree. A tag is just a string of characters, and it
-may take any form except that of an integer. The same tag may be associated
-with many different nodes. <P>
-There are two built-in tags: The tag <B>all</B> is
-implicitly associated with every node in the tree. It may be used to invoke
-operations on all the nodes in the tree. The tag <B>root</B> is managed automatically
-by the tree object. It specifies the node that is currently set as the
-root of the tree. <P>
-Most tree operations use tags. And several operations
-let you operate on multiple nodes at once. For example, you can use the
-<B>set</B> operation with the tag <B>all</B> to set a data field in for all nodes in
-the tree. <P>
-Tags are invoked by the <B>tag</B> operation. The general form is <BR>
-<P>
-<CODE><I>treeName</I> <B>tag</B> <I>operation</I> ?<I>arg</I>?...<BR>
-</CODE><P>Both <I>operation</I> and its arguments determine the exact behavior of the command.
- The operations available for tags are listed below.
-<DL>
-
-<DT><I>treeName</I> <B>tag add</B> <I>string</I>
-<I>node</I>... </DT>
-<DD>Adds the tag <I>string</I> to one of more nodes. </DD>
-
-<DT><I>treeName</I> <B>tag delete</B> <I>string</I>
-<I>node</I>... </DT>
-<DD>Deletes the tag <I>string</I> from one or more nodes. </DD>
-
-<DT><I>treeName</I> <B>tag forget</B>
-<I>string</I> </DT>
-<DD>Removes the tag <I>string</I> from all nodes. It's not an error if no nodes
-are tagged as <I>string</I>. </DD>
-
-<DT><I>treeName</I> <B>tag names</B> ?<I>node</I>? </DT>
-<DD>Returns a list of tags used
-by the tree. If a <I>node</I> argument is present, only those tags used by <I>node</I>
-are returned. </DD>
-
-<DT><I>treeName</I> <B>tag nodes</B> <I>string</I> </DT>
-<DD>Returns a list of nodes that have
-the tag <I>string</I>. If no node is tagged as <I>string</I>, then an empty string is
-returned. </DD>
-</DL>
-
-<H2><A NAME="sect10" HREF="#toc10">Trace Operations</A></H2>
-Data fields can be traced much in the same way
-that you can trace Tcl variables. Data traces cause Tcl commands to be
-executed whenever a particular data field of a node is created, read, written,
-or unset. A trace can apply to one or more nodes. You can trace a specific
-node by using its id, or a group of nodes by a their tag. <P>
-The tree's <B>get</B>,
-<B>set</B>, and <B>unset</B> operations can trigger various traces. The <B>get</B> operation
-can cause a <I>read</I> trace to fire. The <B>set</B> operation causes a <I>write</I> trace
-to fire. And if the data field is written for the first time, you will
-also get a <I>create</I> trace. The <B>unset</B> operation triggers <I>unset</I> traces. <P>
-Data
-traces are invoked by the <B>trace</B> operation. The general form is <BR>
-<P>
-<CODE><I>treeName</I> <B>trace</B> <I>operation</I> ?<I>arg</I>?...<BR>
-</CODE><P>Both <I>operation</I> and its arguments determine the exact behavior of the command.
- The operations available for traces are listed below.
-<DL>
-
-<DT><I>treeName</I> <B>trace create</B>
-<I>node</I> <I>key</I> <I>ops</I> <I>command</I> </DT>
-<DD>Creates a trace for <I>node</I> on data field <I>key</I>. <I>Node</I> can
-refer to more than one node (for example, the tag <B>all</B>). If <I>node</I> is a tag,
-any node with that tag can possibly trigger a trace, invoking <I>command</I>.
- <I>Command</I> is command prefix, typically a procedure name. Whenever a trace
-is triggered, four arguments are appended to <I>command</I> before it is invoked:
-<I>treeName</I>, id of the node, <I>key</I> and, <I>ops</I>. Note that no nodes need have the
-field <I>key</I>. A trace identifier in the form "<I>trace0</I>", "<I>trace1</I>", etc. is returned.
- <P>
-<I>Ops</I> indicates which operations are of interest, and consists of one or
-more of the following letters: <blockquote></DD>
-
-<DT><B>r</B> </DT>
-<DD>Invoke <I>command</I> whenever <I>key</I> is read. Both
-read and write traces are temporarily disabled when <I>command</I> is executed.
-</DD>
-
-<DT><B>w</B> </DT>
-<DD>Invoke <I>command</I> whenever <I>key</I> is written. Both read and write traces are
-temporarily disabled when <I>command</I> is executed. </DD>
-
-<DT><B>c</B> </DT>
-<DD>Invoke <I>command</I> whenever
-<I>key</I> is created. </DD>
-
-<DT><B>u</B> </DT>
-<DD>Invoke <I>command</I> whenever <I>key</I> is unset. Data fields are
-typically unset with the <B>unset</B> command. Data fields are also unset when
-the tree is released, but all traces are disabled prior to that. <P>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>treeName</I>
-<B>trace delete</B> <I>traceId</I>... </DT>
-<DD>Deletes one of more traces. <I>TraceId</I> is the trace identifier
-returned by the <B>trace create</B> operation. </DD>
-
-<DT><I>treeName</I> <B>trace info</B> <I>traceId</I> </DT>
-<DD>Returns
-information about the trace <I>traceId</I>. <I>TraceId</I> is a trace identifier previously
-returned by the <B>trace create</B> operation. It's the same information specified
-for the <B>trace create</B> operation. It consists of the node id or tag, data
-field key, a string of letters indicating the operations that are traced
-(it's in the same form as <I>ops</I>) and, the command prefix. </DD>
-
-<DT><I>treeName</I> <B>trace names</B>
-</DT>
-<DD>Returns a list of identifers for all the current traces. </DD>
-</DL>
-
-<H2><A NAME="sect11" HREF="#toc11">Notify Operations</A></H2>
-Tree
-objects can be shared among many clients, such as a <B>hiertable</B> widget. Any
-client can create or delete nodes, sorting the tree, etc. You can request
-to be notified whenever these events occur. Notify events cause Tcl commands
-to be executed whenever the tree structure is changed. <P>
-Notifications are
-handled by the <B>notify</B> operation. The general form is <BR>
-<P>
-<CODE><I>treeName</I> <B>notify</B> <I>operation</I> ?<I>arg</I>?...<BR>
-</CODE><P>Both <I>operation</I> and its arguments determine the exact behavior of the command.
- The operations available for events are listed below.
-<DL>
-
-<DT><I>treeName</I> <B>notify create</B>
-?<I>switches</I>? <I>command</I> ?<I>args</I>?... </DT>
-<DD>Creates a notifier for the tree. A notify identifier
-in the form "<I>notify0</I>", "<I>notify1</I>", etc. is returned. <P>
-<I>Command</I> and <I>args</I> are
-saved and invoked whenever the tree structure is changed (according to
-<I>switches</I>). Two arguments are appended to <I>command</I> and <I>args</I> before it's invoked:
-the id of the node and a string representing the type of event that occured.
-One of more switches can be set to indicate the events that are of interest.
- The valid switches are as follows: <blockquote></DD>
-
-<DT><B>-create</B> </DT>
-<DD>Invoke <I>command</I> whenever a new
-node has been added. </DD>
-
-<DT><B>-delete</B> </DT>
-<DD>Invoke <I>command</I> whenever a node has been deleted.
-</DD>
-
-<DT><B>-move</B> </DT>
-<DD>Invoke <I>command</I> whenever a node has been moved. </DD>
-
-<DT><B>-sort</B> </DT>
-<DD>Invoke <I>command</I>
-whenever the tree has been sorted and reordered. </DD>
-
-<DT><B>-relabel</B> </DT>
-<DD>Invoke <I>command</I>
-whenever a node has been relabeled. </DD>
-
-<DT><B>-allevents</B> </DT>
-<DD>Invoke <I>command</I> whenever any
-of the above events occur. </DD>
-
-<DT><B>-whenidle</B> </DT>
-<DD>When an event occurs don't invoke <I>command</I>
-immediately, but queue it to be run the next time the event loop is entered
-and there are no events to process. If subsequent events occur before
- the event loop is entered, <I>command</I> will still be invoked only once. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>treeName</I>
-<B>notify delete</B> <I>notifyId</I> </DT>
-<DD>Deletes one or more notifiers from the tree. <I>NotifyId</I>
-is the notifier identifier returned by the <B>notify create</B> operation. </DD>
-
-<DT><I>treeName</I>
-<B>notify info</B> <I>notifyId</I> </DT>
-<DD>Returns information about the notify event <I>notifyId</I>.
- <I>NotifyId</I> is a notify identifier previously returned by the <B>notify create</B>
-operation. It's the same information specified for the <B>notify create</B> operation.
-It consists of the notify id, a sublist of event flags (it's in the same
-form as <I>flags</I>) and, the command prefix. </DD>
-
-<DT><I>treeName</I> <B>notify names</B> </DT>
-<DD>Returns a
-list of identifers for all the current notifiers. </DD>
-</DL>
-
-<H2><A NAME="sect12" HREF="#toc12">C Language API</A></H2>
-Blt_TreeApply,
- Blt_TreeApplyBFS, Blt_TreeApplyDFS, Blt_TreeChangeRoot, Blt_TreeCreate,
- Blt_TreeCreateEventHandler, Blt_TreeCreateNode, Blt_TreeCreateTrace,
- Blt_TreeDeleteEventHandler, Blt_TreeDeleteNode, Blt_TreeDeleteTrace,
- Blt_TreeExists, Blt_TreeFindChild, Blt_TreeFirstChild, Blt_TreeFirstKey,
- Blt_TreeGetNode, Blt_TreeGetToken, Blt_TreeGetValue, Blt_TreeIsAncestor,
- Blt_TreeIsBefore, Blt_TreeIsLeaf, Blt_TreeLastChild, Blt_TreeMoveNode,
- Blt_TreeName, Blt_TreeNextKey, Blt_TreeNextNode, Blt_TreeNextSibling,
- Blt_TreeNodeDegree, Blt_TreeNodeDepth, Blt_TreeNodeId, Blt_TreeNodeLabel,
- Blt_TreeNodeParent, Blt_TreePrevNode, Blt_TreePrevSibling, Blt_TreeRelabelNode,
- Blt_TreeReleaseToken, Blt_TreeRootNode, Blt_TreeSetValue, Blt_TreeSize,
- Blt_TreeSortNode, and Blt_TreeUnsetValue.
-<H2><A NAME="sect13" HREF="#toc13">Keywords</A></H2>
-tree, hiertable, widget
-<P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Example</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Syntax</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Node IDs and Tags</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Node Modifiers</A></LI>
-<LI><A NAME="toc8" HREF="#sect8">Tree Operations</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">Tag Operations</A></LI>
-<LI><A NAME="toc10" HREF="#sect10">Trace Operations</A></LI>
-<LI><A NAME="toc11" HREF="#sect11">Notify Operations</A></LI>
-<LI><A NAME="toc12" HREF="#sect12">C Language API</A></LI>
-<LI><A NAME="toc13" HREF="#sect13">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/treeview.html b/blt3.0.1/html/treeview.html
deleted file mode 100644
index 6db1969..0000000
--- a/blt3.0.1/html/treeview.html
+++ /dev/null
@@ -1,2336 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>treeview(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-treeview - Create and manipulate hierarchical
-table widgets
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>treeview</B> <I>pathName </I>?<I>options</I>?
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>treeview</B>
-widget displays a tree of data. It replaces both the <B>hiertable</B> and <B>hierbox</B>
-widgets. The <B>treeview</B> is 100% syntax compatible with the <B>hiertable</B> widget.
- The <B>hiertable</B> command is retained for sake of script-level compatibility.
- This widget obsoletes the <B>hierbox</B> widget. It does everything the old <B>hierbox</B>
-widget did, but also provides data sharing (via <I>tree data objects</I>) and
-the ability to tag nodes.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-The <B>treeview</B> widget displays hierarchical
-data. Data is represented as nodes in a general-ordered tree. Each node
-may have sub-nodes and these nodes can in turn has their own children. <P>
-A
-node is displayed as a row entry in the widget. Each entry has a text label
-and icon. When a node has children, its entry is drawn with a small button
-to the left of the label. Clicking the mouse over this button opens or
-closes the node. When a node is <I>open</I>, its children are exposed. When it
-is <I>closed</I>, the children and their descedants are hidden. The button is
-normally a <I>+</I> or <I>-</I> symbol (ala Windows Explorer), but can be replaced with
-a pair of Tk images (open and closed images). <P>
-If the node has data associated
-with it, they can be displayed in columns running vertically on either
-side the tree. You can control the color, font, etc of each entry. Any
-entry label or data field can be edited in-place.
-<H2><A NAME="sect4" HREF="#toc4">Tree Data Object</A></H2>
-The tree
-is not stored inside the widget but in a tree data object (see the <B>tree</B>
-command for a further explanation). Tree data objects can be shared among
-different clients, such as a <B>treeview</B> widget or the <B>tree</B> command. You can
-walk the tree and manage its data with the <B>tree</B> command tree, while displaying
-it with the <B>treeview</B> widget. Whenever the tree is updated, the <B>treeview</B>
-widget is automatically redrawn. <P>
-By default, the <B>treeview</B> widget creates
-its own tree object. The tree initially contains just a root node. But you
-can also display trees created by the <B>tree</B> command using the <B>-tree</B> configuration
-option. <B>Treeview</B> widgets can share the same tree object, possibly displaying
-different views of the same data. <P>
-A tree object has both a Tcl and C API.
- You can insert or delete nodes using <B>treeview</B> widget or <B>tree</B> command operations,
-but also from C code. For example, you can load the tree from your C code
-while still managing and displaying the tree from Tcl. The widget is automatically
-notified whenever the tree is modified via C or Tcl.
-<H2><A NAME="sect5" HREF="#toc5">Syntax</A></H2>
-<BR>
-<P>
-<CODE><B>treeview <I>pathName </I></B>?<I>option value</I>?...<BR>
-</CODE><P>The <B>treeview</B> command creates a new window <I>pathName</I> and makes it into a
-<B>treeview</B> widget. At the time this command is invoked, there must not exist
-a window named <I>pathName</I>, but <I>pathName</I>'s parent must exist. Additional options
-may be specified on the command line or in the option database to configure
-aspects of the widget such as its colors and font. See the <B>configure</B> operation
-below for the exact details about what <I>option</I> and <I>value</I> pairs are valid.
-<P>
-If successful, <B>treeview</B> returns the path name of the widget. It also creates
-a new Tcl command by the same name. You can use this command to invoke
-various operations that query or modify the widget. The general form is:
-<BR>
-<P>
-<CODE><I>pathName <I>operation</I></I> ?<I>arg</I>?...<BR>
-</CODE><P>Both <I>operation</I> and its arguments determine the exact behavior of the command.
- The operations available are described in the <FONT SIZE=-1><B>TREEVIEW OPERATIONS</B></FONT>
- section.
-
-<H2><A NAME="sect6" HREF="#toc6">IDs and Tags</A></H2>
-Nodes can be inserted into a tree using the <B>treeview</B> widget
- <BR>
-<CODE>blt::treeview .t<BR>
-set node [.t insert end root "one"]<BR>
-</CODE><P>or <B>tree</B> command. <BR>
-<CODE>set tree [blt::tree create]<BR>
-set node [$tree insert root "one"]<BR>
-</CODE><P>In both cases, a number identifying the node is returned (the value of
-<I>$node</I>). This serial number or <I>id</I> uniquely identifies the node. Please note
-that you can't infer a location or position of a node from its id. The only
-exception is that the root node is always id <I>0</I>. Since nodes may have the
-same labels or be moved within the tree, ids provide an convenient way
-to identify nodes. If a tree is shared, the ids will be the same regardless
-if you are using by the <B>treeview</B> widget or the <B>tree</B> command. Ids are recycled
-when the node deleted. <P>
-A node may also have any number of <I>tags</I> associated
-with it. A tag is just a string of characters, and it may take any form
-except that of an integer. For example, "<I>x123</I>" is valid, but "<I>123</I>" isn't.
- The same tag may be associated with many different nodes. This is typically
-done to associate a group of nodes. Many operations in the <B>treeview</B> widget
-take either node ids or tag names as arguments. Using a tag says to apply
-the operation to all nodes with that tag. <P>
-The tag <B>all</B> is implicitly associated
-with every node in the tree. It may be used to invoke operations on all
-the nodes in the tree. <P>
-Tags may be shared, just like trees, between clients.
- For example, you can use the tags created by the <B>tree</B> command with <B>treeview</B>
-widgets.
-<H2><A NAME="sect7" HREF="#toc7">Special Node IDs</A></H2>
-There are also several special non-numeric ids.
-Special ids differ from tags in that they are always translated to their
-numeric equivalent. They also take precedence over tags. For example, you
-can't use a tag name that is a special id. These ids are specific to the
-<B>treeview</B> widget.
-<DL>
-
-<DT><B>active</B> </DT>
-<DD>The node where the mouse pointer is currently located.
-When a node is active, it is drawn using its active icon (see the <B>-activeicon</B>
-option). The <B>active</B> id is changed automatically by moving the mouse pointer
-over another node or by using the <B>entry activate</B> operation. Note that there
-can be only one active node at a time. </DD>
-
-<DT><B>anchor</B> </DT>
-<DD>The node representing the
-fixed end of the current selection. The anchor is set by the <B>selection
-anchor</B> operation. </DD>
-
-<DT><B>current</B> </DT>
-<DD>The node where the mouse pointer is currently
-located. But unlike <B>active</B>, this id changes while the selection is dragged.
- It is used to determine the current node during button drags. </DD>
-
-<DT><B>down</B> </DT>
-<DD>The
-next open node from the current focus. The <B>down</B> of the last open node is
-the same. </DD>
-
-<DT><B>end</B> </DT>
-<DD>The last open node (in depth-first order) on the tree. </DD>
-
-<DT><B>focus</B>
-</DT>
-<DD>The node that currently has focus. When a node has focus, it receives key
-events. To indicate focus, the node is drawn with a dotted line around
-its label. You can change the focus using the <B>focus</B> operation. </DD>
-
-<DT><B>last</B> </DT>
-<DD>The
-last open node from the current focus. But unlike <B>up</B>, when the focus is
-at root, <B>last</B> wraps around to the last open node in the tree. </DD>
-
-<DT><B>mark</B> </DT>
-<DD>The node
-representing the non-fixed end of the current selection. The mark is set
-by the <B>selection mark</B> operation. </DD>
-
-<DT><B>next</B> </DT>
-<DD>The next open node from the current
-focus. But unlike <B>down</B>, when the focus is on last open node, <B>next</B> wraps
-around to the root node. </DD>
-
-<DT><B>nextsibling</B> </DT>
-<DD>The next sibling from the node with
-the current focus. If the node is already the last sibling then it is the
-<B>nextsibling<B>. </DD>
-
-<DT><B>parent</B></B></B> </DT>
-<DD>The parent of the node with the current focus. The <B>parent</B>
-of the root is also the root. </DD>
-
-<DT><B>prevsibling</B> </DT>
-<DD>The previous sibling from the
-node with the current focus. If the node is already the first sibling then
-it is the <B>prevsibling<B>. </DD>
-
-<DT><B>root</B></B></B> </DT>
-<DD>The root node. You can also use id <I>0</I> to indicate
-the root. </DD>
-
-<DT><B>up</B> </DT>
-<DD>The last open node (in depth-first order) from the current focus.
-The <B>up</B> of the root node (i.e. the root has focus) is also the root. </DD>
-
-<DT><B>view.top</B>
-</DT>
-<DD>First node that's current visible in the widget. </DD>
-
-<DT><B>view.bottom</B> </DT>
-<DD>Last node that's
-current visible in the widget. </DD>
-
-<DT><I>path</I> </DT>
-<DD>Absolute path of a node. Path names
-refer to the node name, not their entry labels. Paths don't have to start
-with a separator (see the <B>-separator</B> configuration option), but component
-names must be separated by the designated separator. </DD>
-
-<DT><B>@<I>x<B>,<I>y</I></B></I></B> </DT>
-<DD>Indicates the
-node that covers the point in the treeview window specified by <I>x</I> and <I>y</I>
-(in pixel coordinates). If no part of the entryd covers that point, then
-the closest node to that point is used. </DD>
-</DL>
-<P>
-A node may be specified as an id
-or tag. If the specifier is an integer then it is assumed to refer to the
-single node with that id. If the specifier is not an integer, it's checked
-to see if it's a special id (such as focus). Otherwise, it's assumed to be
-tag. Some operations only operate on a single node at a time; if a tag
-refers to more than one node, then an error is generated.
-<H2><A NAME="sect8" HREF="#toc8">Data Fields</A></H2>
-A node
-in the tree can have <I>data fields</I>. A data field is a name-value pair, used
-to represent arbitrary data in the node. Nodes can contain different fields
-(they aren't required to contain the same fields). You can optionally display
-these fields in the <B>treeview</B> widget in columns running on either side of
-the displayed tree. A node's value for the field is drawn in the column
-along side its node in the hierarchy. Any node that doesn't have a specific
-field is left blank. Columns can be interactively resized, hidden, or,
-moved.
-<H2><A NAME="sect9" HREF="#toc9">Entry Bindings</A></H2>
-You can bind Tcl commands to be invoked when events
-occur on nodes (much like Tk canvas items). You can bind a node using its
-id or its <I>bindtags</I>. Bindtags are simply names that associate a binding
-with one or more nodes. There is a built-in tag <I>all</I> that all node entries
-automatically have.
-<H2><A NAME="sect10" HREF="#toc10">Treeview Operations</A></H2>
-The <B>treeview</B> operations are the invoked
-by specifying the widget's pathname, the operation, and any arguments that
-pertain to that operation. The general form is: <P>
-<BR>
-<CODE><I>pathName operation </I>?<I>arg arg ...</I>?<BR>
-<P>
-</CODE><P><I>Operation</I> and the <I>arg</I>s determine the exact behavior of the command. The
-following operation are available for <B>treeview</B> widgets:
-<DL>
-
-<DT><I>pathName <B>bbox</B></I> ?<B>-screen</B>?
-<I>tagOrId...</I> </DT>
-<DD>Returns a list of 4 numbers, representing a bounding box of around
-the specified entries. The entries is given by one or more <I>tagOrId</I> arguments.
- If the <B>-screen</B> flag is given, then the x-y coordinates of the bounding
-box are returned as screen coordinates, not virtual coordinates. Virtual
-coordinates start from <I>0</I> from the root node. The returned list contains
-the following values. <blockquote></DD>
-
-<DT><I>x</I> </DT>
-<DD>X-coordinate of the upper-left corner of the bounding
-box. </DD>
-
-<DT><I>y</I> </DT>
-<DD>Y-coordinate of the upper-left corner of the bounding box. </DD>
-
-<DT><I>width</I> </DT>
-<DD>Width
-of the bounding box. </DD>
-
-<DT><I>height</I> </DT>
-<DD>Height of the bounding box. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>bind</B></I> <I>tagName</I>
-?<I>sequence command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I> such that whenever the
-event sequence given by <I>sequence</I> occurs for a node with this tag, <I>command</I>
-will be invoked. The syntax is similar to the <B>bind</B> command except that
-it operates on <B>treeview</B> entries, rather than widgets. See the <B>bind</B> manual
-entry for complete details on <I>sequence</I> and the substitutions performed
-on <I>command</I> before invoking it. <P>
-If all arguments are specified then a
-new binding is created, replacing any existing binding for the same <I>sequence</I>
-and <I>tagName</I>. If the first character of <I>command</I> is <I>+</I> then <I>command</I> augments
-an existing binding rather than replacing it. If no <I>command</I> argument is
-provided then the command currently associated with <I>tagName</I> and <I>sequence</I>
-(it's an error occurs if there's no such binding) is returned. If both <I>command</I>
-and <I>sequence</I> are missing then a list of all the event sequences for which
-bindings have been defined for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>button <I>operation</I></B></I> ?<I>args</I>?
-</DT>
-<DD>This command is used to control the button selectors within a <B>treeview</B>
-widget. It has several forms, depending on <I>operation</I>: <blockquote></DD>
-
-<DT><I>pathName <B>button
-activate</B></I> <I>tagOrId</I> </DT>
-<DD>Designates the node given by <I>tagOrId</I> as active. When
-a node is active it's entry is drawn using its active icon (see the <B>-activeicon</B>
-option). Note that there can be only one active entry at a time. The special
-id <B>active</B> indicates the currently active node. </DD>
-
-<DT><I>pathName <B>button bind</B></I> <I>tagName</I>
-?<I>sequence command</I>? </DT>
-<DD>Associates <I>command</I> with <I>tagName</I> such that whenever the
-event sequence given by <I>sequence</I> occurs for an button of a node entry with
-this tag, <I>command</I> will be invoked. The syntax is similar to the <B>bind</B> command
-except that it operates on <B>treeview</B> buttons, rather than widgets. See the
-<B>bind</B> manual entry for complete details on <I>sequence</I> and the substitutions
-performed on <I>command</I> before invoking it. <P>
-If all arguments are specified
-then a new binding is created, replacing any existing binding for the
-same <I>sequence</I> and <I>tagName</I>. If the first character of <I>command</I> is <I>+</I> then <I>command</I>
- augments an existing binding rather than replacing it. If no <I>command</I> argument
-is provided then the command currently associated with <I>tagName</I> and <I>sequence</I>
-(it's an error occurs if there's no such binding) is returned. If both <I>command</I>
-and <I>sequence</I> are missing then a list of all the event sequences for which
-bindings have been defined for <I>tagName</I>. </DD>
-
-<DT><I>pathName <B>button cget</B></I> <I>option</I> </DT>
-<DD>Returns
-the current value of the configuration option given by <I>option</I>. <I>Option</I> may
-have any of the values accepted by the <B>configure</B> operation described below.
-</DD>
-
-<DT><I>pathName <B>button configure</B></I> ?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify
-the configuration options of the widget. If no <I>option</I> is specified, returns
-a list describing all of the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B>
-for information on the format of this list). If <I>option</I> is specified with
-no <I>value</I>, then the command returns a list describing the one named option
-(this list will be identical to the corresponding sublist of the value
-returned if no <I>option</I> is specified). If one or more <I>option-value</I> pairs are
-specified, then the command modifies the given widget option(s) to have
-the given value(s); in this case the command returns an empty string. <I>Option</I>
-and <I>value</I> are described in the section <FONT SIZE=-1><B>BUTTON OPTIONS</B></FONT>
- below. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>cget</B></I> <I>option</I> </DT>
-<DD>Returns the current value of the configuration option given
-by <I>option</I>. <I>Option</I> may have any of the values accepted by the <B>configure</B> operation
-described below. </DD>
-
-<DT><I>pathName <B>close </B></I>?<B>-recurse</B>? <I>tagOrId...</I> </DT>
-<DD>Closes the node specified
-by <I>tagOrId</I>. In addition, if a Tcl script was specified by the <B>-closecommand</B>
-option, it is invoked. If the node is already closed, this command has
-no effect. If the <B>-recurse</B> flag is present, each child node is recursively
-closed. </DD>
-
-<DT><I>pathName <B>column <I>operation</I></B></I> ?<I>args</I>? </DT>
-<DD>The following operations are available
-for treeview columns. <blockquote></DD>
-
-<DT><I>pathName <B>column activate</B></I> <I>column</I> </DT>
-<DD>Sets the active column
-to <I>column</I>. <I>Column</I> is the name of a column in the widget. When a column is
-active, it's drawn using its <B>-activetitlebackground</B> and <B>-activetitleforeground</B>
-options. If <I>column</I> is the <I>""</I>, then no column will be active. If no column
-argument is provided, then the name of the currently active column is returned.
-</DD>
-
-<DT><I>pathName <B>column cget</B></I> <I>name</I> <I>option</I> </DT>
-<DD>Returns the current value of the column
-configuration option given by <I>option</I> for <I>name</I>. <I>Name</I> is the name of column
-that corresponds to a data field. <I>Option</I> may have any of the values accepted
-by the <B>configure</B> operation described below. </DD>
-
-<DT><I>pathName <B>column configure</B></I> <I>name</I>
-?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify the configuration options
-of the column designated by <I>name</I>. <I>Name</I> is the name of the column corresponding
-to a data field. If no <I>option</I> is specified, returns a list describing all
-of the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for information
-on the format of this list). If <I>option</I> is specified with no <I>value</I>, then
-the command returns a list describing the one named option (this list will
-be identical to the corresponding sublist of the value returned if no <I>option</I>
-is specified). If one or more <I>option-value</I> pairs are specified, then the
-command modifies the given widget option(s) to have the given value(s);
- in this case the command returns an empty string. <I>Option</I> and <I>value</I> are
-described in the section <FONT SIZE=-1><B>COLUMN OPTIONS</B></FONT>
- below. </DD>
-
-<DT><I>pathName <B>column delete</B></I> <I>field</I>
-?<I>field</I>...? </DT>
-<DD>Deletes one of more columns designated by <I>field</I>. Note that this
-does not delete the data fields themselves. </DD>
-
-<DT><I>pathName <B>column insert</B></I> <I>position</I>
-<I>field</I> ?<I>options</I>...? </DT>
-<DD>Inserts one of more columns designated by <I>field</I>. A column
-displays each node's data field by the same name. If the node doesn't have
-the given field, the cell is left blank. <I>Position</I> indicates where in the
-list of columns to add the new column. It may be either a number or <I>end</I>.
- </DD>
-
-<DT><I>pathName <B>column invoke</B></I> <I>field</I> </DT>
-<DD>Invokes the Tcl command associated with the
-column <I>field</I>, if there is one (using the column's <B>-command</B> option). The
-command is ignored if the column's <B>-state</B> option set to <I>disabled</I>. </DD>
-
-<DT><I>pathName
-<B>column move <I>name</I></B></I> <I>dest</I> </DT>
-<DD>Moves the column <I>name</I> to the destination position.
- <I>Dest</I> is the name of another column or a screen position in the form <I>@<I>x<I>,<I>y</I></I></I></I>.
-</DD>
-
-<DT><I>pathName <B>column names</B></I> </DT>
-<DD>Returns a list of the names of all columns in the
-widget. The list is ordered as the columns are drawn from left-to-right. </DD>
-
-<DT><I>pathName
-<B>column nearest</B></I> <I>x</I> ?<I>y</I>? </DT>
-<DD>Returns the name of the column closest to the given
-X-Y screen coordinate. If you provide a <I>y</I> argument (it's optional), a name
-is returned only when if the point is over a column's title. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>configure</B></I>
-?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify the configuration options
-of the widget. If no <I>option</I> is specified, returns a list describing all
-of the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for information
-on the format of this list). If <I>option</I> is specified with no <I>value</I>, then
-the command returns a list describing the one named option (this list will
-be identical to the corresponding sublist of the value returned if no <I>option</I>
-is specified). If one or more <I>option-value</I> pairs are specified, then the
-command modifies the given widget option(s) to have the given value(s);
- in this case the command returns an empty string. <I>Option</I> and <I>value</I> are
-described in the section <FONT SIZE=-1><B>TREEVIEW OPTIONS</B></FONT>
- below. </DD>
-
-<DT><I>pathName <B>curselection</B></I>
-</DT>
-<DD>Returns a list containing the ids of all of the entries that are currently
-selected. If there are no entries selected, then the empty string is returned.
-</DD>
-
-<DT><I>pathName <B>delete <I>tagOrId</I></B></I>... </DT>
-<DD>Deletes one or more entries given by <I>tagOrId</I> and
-its children. </DD>
-
-<DT><I>pathName <B>entry <I>operation</I></B></I> ?<I>args</I>? </DT>
-<DD>The following operations are
-available for treeview entries. <blockquote></DD>
-
-<DT><I>pathName <B>entry activate</B></I> <I>tagOrId</I> </DT>
-<DD>Sets the
-active entry to the one specified by <I>tagOrId</I>. When an entry is active
-it is drawn using its active icon (see the <B>-activeicon</B> option). Note that
-there can be only one active node at a time. The special id of the currently
-active node is <B>active</B>. </DD>
-
-<DT><I>pathName <B>entry cget</B></I> <I>option</I> </DT>
-<DD>Returns the current value
-of the configuration option given by <I>option</I>. <I>Option</I> may have any of the
-values accepted by the <B>configure</B> operation described below. </DD>
-
-<DT><I>pathName <B>entry
-children</B></I> <I>tagOrId</I> ?<I>first</I>? ?<I>last</I>? </DT>
-<DD>Returns a list of ids for the given range
-of children of <I>tagOrId</I>. <I>TagOrId</I> is the id or tag of the node to be examined.
-If only a <I>first</I> argument is present, then the id of the that child at
-that numeric position is returned. If both <I>first</I> and <I>last</I> arguments are
-given, then the ids of all the children in that range are returned. Otherwise
-the ids of all children are returned. </DD>
-
-<DT><I>pathName <B>entry configure</B></I> ?<I>option</I>?
-?<I>value option value ...</I>? </DT>
-<DD>Query or modify the configuration options of the
-widget. If no <I>option</I> is specified, returns a list describing all of the
-available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for information on
-the format of this list). If <I>option</I> is specified with no <I>value</I>, then the
-command returns a list describing the one named option (this list will
-be identical to the corresponding sublist of the value returned if no <I>option</I>
-is specified). If one or more <I>option-value</I> pairs are specified, then the
-command modifies the given widget option(s) to have the given value(s);
- in this case the command returns an empty string. <I>Option</I> and <I>value</I> are
-described below: </DD>
-
-<DT><I>pathName <B>entry delete</B></I> <I>tagOrId</I> ?<I>first</I> ?<I>last</I>? </DT>
-<DD>Deletes the
-one or more children nodes of the parent <I>tagOrId</I>. If <I>first</I> and <I>last</I> arguments
-are present, they are positions designating a range of children nodes to
-be deleted. </DD>
-
-<DT><I>pathName <B>entry isbefore <I>tagOrId1</I></B></I> <I>tagOrId2</I> </DT>
-<DD>Returns 1 if <I>tagOrId1</I>
-is before <I>tagOrId2</I> and 0 otherwise. </DD>
-
-<DT><I>pathName <B>entry ishidden <I>tagOrId</I></B></I> </DT>
-<DD>Returns
-1 if the node is currently hidden and 0 otherwise. A node is also hidden
-if any of its ancestor nodes are closed or hidden. </DD>
-
-<DT><I>pathName <B>entry isopen
-<I>tagOrId</I></B></I> </DT>
-<DD>Returns 1 if the node is currently open and 0 otherwise. </DD>
-
-<DT><I>pathName
-<B>entry size</B></I> <B>-recurse</B> <I>tagOrId</I> </DT>
-<DD>Returns the number of children for parent node
-<I>tagOrId</I>. If the <B>-recurse</B> flag is set, the number of all its descendants
-is returned. The node itself is not counted. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>find </B></I>?<I>flags</I>? <I>first</I>
-<I>last</I> </DT>
-<DD>Finds for all entries matching the criteria given by <I>flags</I>. A list
-of ids for all matching nodes is returned. <I>First</I> and <I>last</I> are ids designating
-the range of the search in depth-first order. If <I>last</I> is before <I>first</I>, then
-nodes are searched in reverse order. The valid flags are: <blockquote></DD>
-
-<DT><B>-name<I> pattern</I></B>
-</DT>
-<DD>Specifies pattern to match against node names. </DD>
-
-<DT><B>-full<I> pattern</I></B> </DT>
-<DD>Specifies pattern
-to match against node pathnames. </DD>
-
-<DT><B>-<I>option<I> pattern</I></I></B> </DT>
-<DD>Specifies pattern to match
-against the node entry's configuration option. </DD>
-
-<DT><B>-exact</B> </DT>
-<DD>Patterns must match
-exactly. The is the default. </DD>
-
-<DT><B>-glob</B> </DT>
-<DD>Use global pattern matching. Matching
-is done in a fashion similar to that used by the C-shell. For the two
-strings to match, their contents must be identical except that the following
- special sequences may appear in pattern: <blockquote></DD>
-
-<DT><I>*</I> </DT>
-<DD>Matches any sequence of
- characters in string, including a null string. </DD>
-
-<DT><I>?</I> </DT>
-<DD>Matches any single character
-in string. </DD>
-
-<DT><I>[<I>chars<I>]</I></I></I> </DT>
-<DD>Matches any character in the set given by <I>chars</I>. If a
-sequence of the form <I>x</I>-<I>y</I> appears in <I>chars</I>, then any character between <I>x</I>
-and <I>y</I>, inclusive, will match. </DD>
-
-<DT><I>\<I>x</I></I> </DT>
-<DD>Matches the single character <I>x</I>. This
-provides a way of avoiding the special interpretation of the characters
-<I>*?[]\</I> in the pattern. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-regexp</B> </DT>
-<DD>Use regular expression pattern matching (i.e.
-the same as implemented by the <B>regexp</B> command). </DD>
-
-<DT><B>-nonmatching</B> </DT>
-<DD>Pick entries
-that don't match. </DD>
-
-<DT><B>-exec<I> string</I></B> </DT>
-<DD>Specifies a Tcl script to be invoked for
-each matching node. Percent substitutions are performed on <I>string</I> before
- it is executed. The following substitutions are valid: <blockquote></DD>
-
-<DT><I>%W</I> </DT>
-<DD>The pathname
-of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The full pathname of the node.
-</DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single percent. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-count<I> number</I></B> </DT>
-<DD>Stop
-searching after <I>number</I> matches. </DD>
-
-<DT><B>--</B> </DT>
-<DD>Indicates the end of flags. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>focus
-</B></I> <I>tagOrId</I> </DT>
-<DD>Sets the focus to the node given by <I>tagOrId</I>. When a node has focus,
-it can receive keyboard events. The special id <B>focus</B> designates the node
-that currently has focus. </DD>
-
-<DT><I>pathName <B>get </B></I>?<B>-full</B>? <I>tagOrId</I> <I>tagOrId</I>... </DT>
-<DD>Translates
-one or more ids to their node entry names. It returns a list of names
-for all the ids specified. If the <B>-full</B> flag is set, then the full pathnames
-are returned. </DD>
-
-<DT><I>pathName <B>hide </B></I>?<B>flags</B>? <I>tagOrId</I>... </DT>
-<DD>Hides all nodes matching the
-criteria given by <I>flags</I>. The search is performed recursively for each node
-given by <I>tagOrId</I>. The valid flags are described below: <blockquote></DD>
-
-<DT><B>-name<I> pattern</I></B> </DT>
-<DD>Specifies
-pattern to match against node names. </DD>
-
-<DT><B>-full<I> pattern</I></B> </DT>
-<DD>Specifies pattern to match
-against node pathnames. </DD>
-
-<DT><B>-<I>option<I> pattern</I></I></B> </DT>
-<DD>Specifies pattern to match against
-the node entry's configuration option. </DD>
-
-<DT><B>-exact</B> </DT>
-<DD>Match patterns exactly. The
-is the default. </DD>
-
-<DT><B>-glob</B> </DT>
-<DD>Use global pattern matching. Matching is done in a
-fashion similar to that used by the C-shell. For the two strings to match,
-their contents must be identical except that the following special sequences
- may appear in pattern: <blockquote></DD>
-
-<DT><I>*</I> </DT>
-<DD>Matches any sequence of characters in string,
-including a null string. </DD>
-
-<DT><I>?</I> </DT>
-<DD>Matches any single character in string. </DD>
-
-<DT><I>[<I>chars<I>]</I></I></I>
-</DT>
-<DD>Matches any character in the set given by <I>chars</I>. If a sequence of the form
-<I>x</I>-<I>y</I> appears in <I>chars</I>, then any character between <I>x</I> and <I>y</I>, inclusive, will
-match. </DD>
-
-<DT><I>\<I>x</I></I> </DT>
-<DD>Matches the single character <I>x</I>. This provides a way of avoiding
- the special interpretation of the characters <I>*?[]\</I> in the pattern. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-regexp</B>
-</DT>
-<DD>Use regular expression pattern matching (i.e. the same as implemented by
-the <B>regexp</B> command). </DD>
-
-<DT><B>-nonmatching</B> </DT>
-<DD>Hide nodes that don't match. </DD>
-
-<DT><B>--</B> </DT>
-<DD>Indicates
-the end of flags. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>index </B></I>?<B>-at</B> <I>tagOrId</I>? <I>string</I> </DT>
-<DD>Returns the id of
-the node specified by <I>string</I>. <I>String</I> may be a tag or node id. Some special
-ids are normally relative to the node that has focus. The <B>-at</B> flag lets
-you select another node. </DD>
-
-<DT><I>pathName <B>insert </B></I>?<B>-at <I>tagOrId</I></B>? <I>position</I> <I>path</I> ?<I>options...</I>?
-?<I>path</I>? ?<I>options...</I>? </DT>
-<DD>Inserts one or more nodes at <I>position</I>. <I>Position</I> is the
-location (number or <I>end</I>) where the new nodes are added to the parent node.
- <I>Path</I> is the pathname of the new node. Pathnames can be formated either
-as a Tcl list (each element is a path component) or as a string separated
-by a special character sequence (using the <B>-separator</B> option). Pathnames
-are normally absolute, but the <B>-at</B> switch lets you select a relative starting
-point. Its value is the id of the starting node. <P>
-All ancestors of the
-new node must already exist, unless the <B>-autocreate</B> option is set. It is
-also an error if a node already exists, unless the <B>-allowduplicates</B> option
-is set. <P>
-<I>Option</I> and <I>value</I> may have any of the values accepted by the <B>entry
-configure</B> operation described in the <FONT SIZE=-1><B>ENTRY OPERATIONS</B></FONT>
- section below. This
-command returns a list of the ids of the new entries. </DD>
-
-<DT><I>pathName <B>move <I>tagOrId</I></B></I>
-<I>how</I> <I>destId</I> </DT>
-<DD>Moves the node given by <I>tagOrId</I> to the destination node. The
-node can not be an ancestor of the destination. <I>DestId</I> is the id of the
-destination node and can not be the root of the tree. In conjunction with
-<I>how</I>, it describes how the move is performed. <blockquote></DD>
-
-<DT><I>before</I> </DT>
-<DD>Moves the node before
-the destination node. </DD>
-
-<DT><I>after</I> </DT>
-<DD>Moves the node after the destination node. </DD>
-
-<DT><I>into</I>
-</DT>
-<DD>Moves the node to the end of the destination's list of children. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>nearest <I>x y</I></B></I> ?<I>varName</I>? </DT>
-<DD>Returns the id of the node entry closest to the given
-X-Y screen coordinate. The optional argument <I>varName</I> is the name of variable
-which is set to either <I>button</I> or <I>select</I> to indicate over what part of the
-node the coordinate lies. If the coordinate is not directly over any node,
-then <I>varName</I> will contain the empty string. </DD>
-
-<DT><I>pathName <B>open </B></I>?<B>-recurse</B>? <I>tagOrId...</I>
-</DT>
-<DD>Opens the one or more nodes specified by <I>tagOrId</I>. If a node is not already
-open, the Tcl script specified by the <B>-opencommand</B> option is invoked. If
-the <B>-recurse</B> flag is present, then each descendant is recursively opened.
- </DD>
-
-<DT><I>pathName <B>range</B></I> ?<B>-open</B>? <I>first last</I> </DT>
-<DD>Returns the ids in depth-first order
-of the nodes between the <I>first</I> and <I>last</I> ids. If the <B>-open</B> flag is present,
-it indicates to consider only open nodes. If <I>last</I> is before <I>first</I>, then
-the ids are returned in reverse order. </DD>
-
-<DT><I>pathName <B>scan</B></I> <I>option args</I> </DT>
-<DD>This command
-implements scanning. It has two forms, depending on <I>option</I>: <blockquote></DD>
-
-<DT><I>pathName <B>scan
-mark <I>x y</I></B></I> </DT>
-<DD>Records <I>x</I> and <I>y</I> and the current view in the treeview window;
-used in conjunction with later <B>scan dragto</B> commands. Typically this command
-is associated with a mouse button press in the widget. It returns an empty
-string. </DD>
-
-<DT><I>pathName <B>scan dragto <I>x y</I></B></I>. </DT>
-<DD>Computes the difference between its <I>x</I> and
-<I>y</I> arguments and the <I>x</I> and <I>y</I> arguments to the last <B>scan mark</B> command for
-the widget. It then adjusts the view by 10 times the difference in coordinates.
- This command is typically associated with mouse motion events in the widget,
-to produce the effect of dragging the list at high speed through the window.
- The return value is an empty string. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>see</B></I> ?<B>-anchor <I>anchor</I></B>? <I>tagOrId</I>
-</DT>
-<DD>Adjusts the view of entries so that the node given by <I>tagOrId</I> is visible
-in the widget window. It is an error if <B>tagOrId</B> is a tag that refers to
-more than one node. By default the node's entry is displayed in the middle
-of the window. This can changed using the <B>-anchor</B> flag. Its value is a Tk
-anchor position. </DD>
-
-<DT><I>pathName <B>selection <I>option arg</I></B></I> </DT>
-<DD>This command is used to adjust
-the selection within a <B>treeview</B> widget. It has several forms, depending
-on <I>option</I>: <blockquote></DD>
-
-<DT><I>pathName <B>selection anchor <I>tagOrId</I></B></I> </DT>
-<DD>Sets the selection anchor
-to the node given by <I>tagOrId</I>. If <I>tagOrId</I> refers to a non-existent node, then
-the closest node is used. The selection anchor is the end of the selection
-that is fixed while dragging out a selection with the mouse. The special
-id <B>anchor</B> may be used to refer to the anchor node. </DD>
-
-<DT><I>pathName <B>selection cancel</B></I>
-</DT>
-<DD>Clears the temporary selection of entries back to the current anchor. Temporary
-selections are created by the <B>selection mark</B> operation. </DD>
-
-<DT><I>pathName <B>selection
-clear <I>first </I></B></I>?<I>last</I>? </DT>
-<DD>Removes the entries between <I>first</I> and <I>last</I> (inclusive)
-from the selection. Both <I>first</I> and <I>last</I> are ids representing a range of
-entries. If <I>last</I> isn't given, then only <I>first</I> is deselected. Entries outside
-the selection are not affected. </DD>
-
-<DT><I>pathName <B>selection clearall</B></I> </DT>
-<DD>Clears the entire
-selection. </DD>
-
-<DT><I>pathName <B>selection mark <I>tagOrId</I></B></I> </DT>
-<DD>Sets the selection mark to
-the node given by <I>tagOrId</I>. This causes the range of entries between the
-anchor and the mark to be temporarily added to the selection. The selection
-mark is the end of the selection that is fixed while dragging out a selection
-with the mouse. The special id <B>mark</B> may be used to refer to the current
- mark node. If <I>tagOrId</I> refers to a non-existent node, then the mark is ignored.
-Resetting the mark will unselect the previous range. Setting the anchor
-finalizes the range. </DD>
-
-<DT><I>pathName <B>selection includes <I>tagOrId</I></B></I> </DT>
-<DD>Returns 1 if the
-node given by <I>tagOrId</I> is currently selected, 0 if it isn't. </DD>
-
-<DT><I>pathName <B>selection
-present</B></I> </DT>
-<DD>Returns 1 if any nodes are currently selected and 0 otherwise. </DD>
-
-<DT><I>pathName
-<B>selection set <I>first </I></B></I>?<I>last</I>? </DT>
-<DD>Selects all of the nodes in the range between
-<I>first</I> and <I>last</I>, inclusive, without affecting the selection state of nodes
-outside that range. </DD>
-
-<DT><I>pathName <B>selection toggle <I>first </I></B></I>?<I>last</I>? </DT>
-<DD>Selects/deselects
-nodes in the range between <I>first</I> and <I>last</I>, inclusive, from the selection.
-If a node is currently selected, it becomes deselected, and visa versa.
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>show </B></I>?<B>flags</B>? <I>tagOrId</I>... </DT>
-<DD>Exposes all nodes matching the criteria given
-by <I>flags</I>. This is the inverse of the <B>hide</B> operation. The search is performed
-recursively for each node given by <I>tagOrId</I>. The valid flags are described
-below: <blockquote></DD>
-
-<DT><B>-name<I> pattern</I></B> </DT>
-<DD>Specifies pattern to match against node names. </DD>
-
-<DT><B>-full<I>
-pattern</I></B> </DT>
-<DD>Specifies pattern to match against node pathnames. </DD>
-
-<DT><B>-<I>option<I> pattern</I></I></B>
-</DT>
-<DD>Specifies pattern to match against the entry's configuration option. </DD>
-
-<DT><B>-exact</B>
-</DT>
-<DD>Match patterns exactly. The is the default. </DD>
-
-<DT><B>-glob</B> </DT>
-<DD><B>-glob</B> Use global pattern
-matching. Matching is done in a fashion similar to that used by the C-shell.
- For the two strings to match, their contents must be identical except
-that the following special sequences may appear in pattern: <blockquote></DD>
-
-<DT><I>*</I> </DT>
-<DD>Matches
- any sequence of characters in string, including a null string. </DD>
-
-<DT><I>?</I> </DT>
-<DD>Matches
-any single character in string. </DD>
-
-<DT><I>[<I>chars<I>]</I></I></I> </DT>
-<DD>Matches any character in the set
-given by <I>chars</I>. If a sequence of the form <I>x</I>-<I>y</I> appears in <I>chars</I>, then any
-character between <I>x</I> and <I>y</I>, inclusive, will match. </DD>
-
-<DT><I>\<I>x</I></I> </DT>
-<DD>Matches the single
- character <I>x</I>. This provides a way of avoiding the special interpretation
-of the characters <I>*?[]\</I> in the pattern. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-regexp</B> </DT>
-<DD>Use regular expression pattern
-matching (i.e. the same as implemented by the <B>regexp</B> command). </DD>
-
-<DT><B>-nonmatching</B>
-</DT>
-<DD>Expose nodes that don't match. </DD>
-
-<DT><B>--</B> </DT>
-<DD>Indicates the end of flags. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>sort</B></I>
-?<I>operation</I>? <I>args...</I> </DT>
-<DD><blockquote></DD>
-
-<DT><I>pathName <B>sort auto</B></I> ?<I>boolean</I> </DT>
-<DD>Turns on/off automatic sorting
-of node entries. If <I>boolean</I> is true, entries will be automatically sorted
-as they are opened, closed, inserted, or deleted. If no <I>boolean</I> argument
-is provided, the current state is returned. </DD>
-
-<DT><I>pathName <B>sort cget</B></I> <I>option</I> </DT>
-<DD>Returns
-the current value of the configuration option given by <I>option</I>. <I>Option</I> may
-have any of the values accepted by the <B>configure</B> operation described below.
-</DD>
-
-<DT><I>pathName <B>sort configure</B></I> ?<I>option</I>? ?<I>value option value ...</I>? </DT>
-<DD>Query or modify
-the sorting configuration options of the widget. If no <I>option</I> is specified,
-returns a list describing all of the available options for <I>pathName</I> (see
-<B>Tk_ConfigureInfo</B> for information on the format of this list). If <I>option</I>
-is specified with no <I>value</I>, then the command returns a list describing
-the one named option (this list will be identical to the corresponding
-sublist of the value returned if no <I>option</I> is specified). If one or more
-<I>option-value</I> pairs are specified, then the command modifies the given sorting
-option(s) to have the given value(s); in this case the command returns
-an empty string. <I>Option</I> and <I>value</I> are described below: <blockquote></DD>
-
-<DT><B>-column<I> string</I></B> </DT>
-<DD>Specifies
-the column to sort. Entries in the widget are rearranged according to this
-column. If <I>column</I> is <I>""</I> then no sort is performed. </DD>
-
-<DT><B>-command<I> string</I></B> </DT>
-<DD>Specifies
-a Tcl procedure to be called when sorting nodes. The procedure is called
-with three arguments: the pathname of the widget and the fields of two
-entries. The procedure returns 1 if the first node is greater than the
-second, -1 is the second is greater, and 0 if equal. </DD>
-
-<DT><B>-decreasing<I> boolean</I></B>
-</DT>
-<DD>Indicates to sort in ascending/descending order. If <I>boolean</I> is true, then
-the entries as in descending order. The default is <I>no</I>. </DD>
-
-<DT><B>-mode<I> string</I></B> </DT>
-<DD>Specifies
-how to compare entries when sorting. <I>String</I> may be one of the following:
-<blockquote></DD>
-
-<DT><I>ascii</I> </DT>
-<DD>Use string comparison based upon the ASCII collation order. </DD>
-
-<DT><I>dictionary</I>
- </DT>
-<DD>Use dictionary-style comparison. This is the same as <I>ascii</I> except (a) case
-is ignored except as a tie-breaker and (b) if two strings contain embedded
-numbers, the numbers compare as integers, not characters. For example,
-"bigBoy" sorts between "bigbang" and "bigboy", and "x10y" sorts between
-"x9y" and "x11y". </DD>
-
-<DT><I>integer</I> </DT>
-<DD>Compares fields as integers. </DD>
-
-<DT><I>real</I> </DT>
-<DD>Compares fields
-as floating point numbers. </DD>
-
-<DT><I>command</I> </DT>
-<DD>Use the Tcl proc specified by the <B>-command</B>
-option to compare entries when sorting. If no command is specified, the
-sort reverts to <I>ascii</I> sorting. </DD>
-</DL>
-</blockquote>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>sort once</B></I> ?<I>flags</I>? <I>tagOrId...</I> </DT>
-<DD>Sorts
-the children for each entries specified by <I>tagOrId</I>. By default, entries
-are sorted by name, but you can specify a Tcl proc to do your own comparisons.
-<blockquote></DD>
-
-<DT><B>-recurse</B> </DT>
-<DD>Recursively sort the entire branch, not just the children. </DD>
-</DL>
-</blockquote>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName
-<B>tag <I>operation args</I></B></I> </DT>
-<DD>Tags are a general means of selecting and marking nodes
-in the tree. A tag is just a string of characters, and it may take any form
-except that of an integer. The same tag may be associated with many different
-nodes. <P>
-Both <I>operation</I> and its arguments determine the exact behavior of
-the command. The operations available for tags are listed below. <blockquote></DD>
-
-<DT><I>pathName</I>
-<B>tag add</B> <I>string</I> <I>id</I>... </DT>
-<DD>Adds the tag <I>string</I> to one of more entries. </DD>
-
-<DT><I>pathName</I> <B>tag
-delete</B> <I>string</I> <I>id</I>... </DT>
-<DD>Deletes the tag <I>string</I> from one or more entries. </DD>
-
-<DT><I>pathName</I>
-<B>tag forget</B> <I>string</I> </DT>
-<DD>Removes the tag <I>string</I> from all entries. It's not an error
-if no entries are tagged as <I>string</I>. </DD>
-
-<DT><I>pathName</I> <B>tag names</B> ?<I>id</I>? </DT>
-<DD>Returns a list
-of tags used. If an <I>id</I> argument is present, only those tags used by the
-node designated by <I>id</I> are returned. </DD>
-
-<DT><I>pathName</I> <B>tag nodes</B> <I>string</I> </DT>
-<DD>Returns a
-list of ids that have the tag <I>string</I>. If no node is tagged as <I>string</I>, then
-an empty string is returned. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>text <I>operation</I></B></I> ?<I>args</I>? </DT>
-<DD>This operation
-is used to provide text editing for cells (data fields in a column) or
-entry labels. It has several forms, depending on <I>operation</I>: <blockquote></DD>
-
-<DT><I>pathName <B>text
-apply</B></I> </DT>
-<DD>Applies the edited buffer, replacing the entry label or data field.
-The edit window is hidden. </DD>
-
-<DT><I>pathName <B>text cancel</B></I> </DT>
-<DD>Cancels the editing operation,
-reverting the entry label or data value back to the previous value. The
-edit window is hidden. </DD>
-
-<DT><I>pathName <B>text cget<I> value</I></B></I> </DT>
-<DD>Returns the current value
-of the configuration option given by <I>option</I>. <I>Option</I> may have any of the
-values accepted by the <B>configure</B> operation described below. </DD>
-
-<DT><I>pathName <B>text
-configure</B></I> ?<I>option value</I>? </DT>
-<DD>Query or modify the configuration options of the
-edit window. If no <I>option</I> is specified, returns a list describing all of
-the available options (see <B>Tk_ConfigureInfo</B> for information on the format
-of this list). If <I>option</I> is specified with no <I>value</I>, then the command returns
-a list describing the one named option (this list will be identical to
-the corresponding sublist of the value returned if no <I>option</I> is specified).
- If one or more <I>option-value</I> pairs are specified, then the command modifies
-the given widget option(s) to have the given value(s); in this case the
-command returns an empty string. <I>Option</I> and <I>value</I> are described in the section
- <FONT SIZE=-1><B>TEXT EDITING OPTIONS</B></FONT>
- below. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>text delete<I> first last</I></B></I> </DT>
-<DD>Deletes the
-characters in the edit buffer between the two given character positions.
- </DD>
-
-<DT><I>pathName <B>text get</B></I> ?<I>-root</I>? <I>x y</I> </DT>
-<DD></DD>
-
-<DT><I>pathName <B>text icursor<I> index</I></B></I> </DT>
-<DD></DD>
-
-<DT><I>pathName <B>text
-index<I> index</I></B></I> </DT>
-<DD>Returns the text index of given <I>index</I>. </DD>
-
-<DT><I>pathName <B>text insert<I>
-index string</I></B></I> </DT>
-<DD>Insert the text string <I>string</I> into the edit buffer at the
-index <I>index</I>. For example, the index 0 will prepend the buffer. </DD>
-
-<DT><I>pathName
-<B>text selection<I> args</I></B></I> </DT>
-<DD>This operation controls the selection of the editing
-window. Note that this differs from the selection of entries. It has the
-following forms: <blockquote></DD>
-
-<DT><I>pathName <B>text selection adjust<I> index</I></B></I> </DT>
-<DD>Adjusts either the
-first or last index of the selection. </DD>
-
-<DT><I>pathName <B>text selection clear</B></I> </DT>
-<DD>Clears
-the selection. </DD>
-
-<DT><I>pathName <B>text selection from<I> index</I></B></I> </DT>
-<DD>Sets the anchor of the
-selection. </DD>
-
-<DT><I>pathName <B>text selection present</B></I> </DT>
-<DD>Indicates if a selection is present.
-</DD>
-
-<DT><I>pathName <B>text selection range<I> start end</I></B></I> </DT>
-<DD>Sets both the anchor and mark of
-the selection. </DD>
-
-<DT><I>pathName <B>text selection to<I> index</I></B></I> </DT>
-<DD>Sets the unanchored end
-(mark) of the selection. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>toggle <I>tagOrId</I></B></I> </DT>
-<DD>Opens or closes the node
-given by <I>tagOrId</I>. If the corresponding <B>-opencommand</B> or <B>-closecommand</B> option
-is set, then that command is also invoked. </DD>
-
-<DT><I>pathName <B>xview <I>args</I></B></I> </DT>
-<DD>This command
-is used to query and change the horizontal position of the information
-in the widget's window. It can take any of the following forms: <blockquote></DD>
-
-<DT><I>pathName
-<B>xview</B></I> </DT>
-<DD>Returns a list containing two elements. Each element is a real fraction
-between 0 and 1; together they describe the horizontal span that is visible
-in the window. For example, if the first element is .2 and the second element
-is .6, 20% of the <B>treeview</B> widget's text is off-screen to the left, the middle
-40% is visible in the window, and 40% of the text is off-screen to the right.
-These are the same values passed to scrollbars via the <B>-xscrollcommand</B> option.
-</DD>
-
-<DT><I>pathName <B>xview</B></I> <I>tagOrId</I> </DT>
-<DD>Adjusts the view in the window so that the character
-position given by <I>tagOrId</I> is displayed at the left edge of the window. Character
-positions are defined by the width of the character <B>0</B>. </DD>
-
-<DT><I>pathName <B>xview moveto<I>
-fraction</I></B></I> </DT>
-<DD>Adjusts the view in the window so that <I>fraction</I> of the total width
-of the <B>treeview</B> widget's text is off-screen to the left. <I>fraction</I> must be
-a fraction between 0 and 1. </DD>
-
-<DT><I>pathName <B>xview scroll <I>number what</I></B></I> </DT>
-<DD>This command
-shifts the view in the window left or right according to <I>number</I> and <I>what</I>.
-<I>Number</I> must be an integer. <I>What</I> must be either <B>units</B> or <B>pages</B> or an abbreviation
-of one of these. If <I>what</I> is <B>units</B>, the view adjusts left or right by <I>number</I>
-character units (the width of the <B>0</B> character) on the display; if it is
-<B>pages</B> then the view adjusts by <I>number</I> screenfuls. If <I>number</I> is negative
-then characters farther to the left become visible; if it is positive
-then characters farther to the right become visible. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>pathName <B>yview <I>?args</I></B></I>?
-</DT>
-<DD>This command is used to query and change the vertical position of the text
-in the widget's window. It can take any of the following forms: <blockquote></DD>
-
-<DT><I>pathName
-<B>yview</B></I> </DT>
-<DD>Returns a list containing two elements, both of which are real fractions
-between 0 and 1. The first element gives the position of the node at the
-top of the window, relative to the widget as a whole (0.5 means it is halfway
-through the treeview window, for example). The second element gives the
-position of the node just after the last one in the window, relative to
-the widget as a whole. These are the same values passed to scrollbars via
-the <B>-yscrollcommand</B> option. </DD>
-
-<DT><I>pathName <B>yview</B></I> <I>tagOrId</I> </DT>
-<DD>Adjusts the view in the
-window so that the node given by <I>tagOrId</I> is displayed at the top of the
-window. </DD>
-
-<DT><I>pathName <B>yview moveto<I> fraction</I></B></I> </DT>
-<DD>Adjusts the view in the window so
-that the node given by <I>fraction</I> appears at the top of the window. <I>Fraction</I>
-is a fraction between 0 and 1; 0 indicates the first node, 0.33 indicates
-the node one-third the way through the <B>treeview</B> widget, and so on. </DD>
-
-<DT><I>pathName
-<B>yview scroll <I>number what</I></B></I> </DT>
-<DD>This command adjusts the view in the window up
-or down according to <I>number</I> and <I>what</I>. <I>Number</I> must be an integer. <I>What</I> must
-be either <B>units</B> or <B>pages</B>. If <I>what</I> is <B>units</B>, the view adjusts up or down
-by <I>number</I> lines; if it is <B>pages</B> then the view adjusts by <I>number</I> screenfuls.
-If <I>number</I> is negative then earlier nodes become visible; if it is positive
-then later nodes become visible. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect11" HREF="#toc11">Treeview Options</A></H2>
-In addition to the <B>configure</B>
-operation, widget configuration options may also be set by the Tk <B>option</B>
-command. The class resource name is <I>TreeView</I>. <BR>
-<CODE>option add *TreeView.Foreground white<BR>
-option add *TreeView.Background blue<BR>
-</CODE><P>The following widget options are available:
-<DL>
-
-<DT><B>-activebackground <I>color</I></B> </DT>
-<DD>Sets
-the background color for active entries. A node is active when the mouse
-passes over it's entry or using the <B>activate</B> operation. </DD>
-
-<DT><B>-activeforeground
-<I>color</I></B> </DT>
-<DD>Sets the foreground color of the active node. A node is active when
-the mouse passes over it's entry or using the <B>activate</B> operation. </DD>
-
-<DT><B>-activeicons
-<I>images</I></B> </DT>
-<DD>Specifies images to be displayed for an entry's icon when it is active.
-<I>Images</I> is a list of two Tk images: the first image is displayed when the
-node is open, the second when it is closed. </DD>
-
-<DT><B>-autocreate <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I>
-is true, automatically create missing ancestor nodes when inserting new
-nodes. Otherwise flag an error. The default is <I>no</I>. </DD>
-
-<DT><B>-allowduplicates <I>boolean</I></B>
-</DT>
-<DD>If <I>boolean</I> is true, allow nodes with duplicate pathnames when inserting
-new nodes. Otherwise flag an error. The default is <I>no</I>. </DD>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets
-the background color of the widget. The default is <I>white</I>. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B>
-</DT>
-<DD>Sets the width of the 3-D border around the outside edge of the widget.
-The <B>-relief</B> option determines if the border is to be drawn. The default
-is <I>2</I>. </DD>
-
-<DT><B>-closecommand <I>string</I></B> </DT>
-<DD>Specifies a Tcl script to be invoked when a node
-is closed. You can overrider this for individual entries using the entry's
-<B>-closecommand</B> option. The default is <I>""</I>. Percent substitutions are performed
-on <I>string</I> before it is executed. The following substitutions are valid:
-<blockquote></DD>
-
-<DT><I>%W</I> </DT>
-<DD>The pathname of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The full pathname
-of the node. </DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single percent. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-cursor
-<I>cursor</I></B> </DT>
-<DD>Specifies the widget's cursor. The default cursor is <I>""</I>. </DD>
-
-<DT><B>-dashes <I>number</I></B>
-</DT>
-<DD>Sets the dash style of the horizontal and vertical lines drawn connecting
- entries. <I>Number</I> is the length in pixels of the dashes and gaps in the line.
-If <I>number</I> is <I>0</I>, solid lines will be drawn. The default is <I>1</I> (dotted). </DD>
-
-<DT><B>-exportselection
-<I>boolean</I></B> </DT>
-<DD>Indicates if the selection is exported. If the widget is exporting
-its selection then it will observe the standard X11 protocols for handling
-the selection. Selections are available as type <B>STRING</B>; the value of the
-selection will be the label of the selected nodes, separated by newlines.
- The default is <I>no</I>. </DD>
-
-<DT><B>-flat <I>boolean</I></B> </DT>
-<DD>Indicates whether to display the tree as
-a flattened list. If <I>boolean</I> is true, then the hierarchy will be a list
-of full paths for the nodes. This option also has affect on sorting. See
-the <FONT SIZE=-1><B>SORT OPERATIONS</B></FONT>
- section for more information. The default is <I>no</I>. </DD>
-
-<DT><B>-focusdashes
-<I>dashList</I></B> </DT>
-<DD>Sets the dash style of the outline rectangle drawn around the
-entry label of the node that current has focus. <I>Number</I> is the length in
-pixels of the dashes and gaps in the line. If <I>number</I> is <I>0</I>, a solid line
-will be drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-focusforeground <I>color</I></B> </DT>
-<DD>Sets the color of
-the focus rectangle. The default is <I>black</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Specifies the
-font for entry labels. You can override this for individual entries with
-the entry's <B>-font</B> configuration option. The default is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>.
-</DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets the text color of entry labels. You can override
-this for individual entries with the entry's <B>-foreground</B> configuration option.
- The default is <I>black</I>. </DD>
-
-<DT><B>-height <I>pixels</I></B> </DT>
-<DD>Specifies the requested height of
-widget. The default is <I>400</I>. </DD>
-
-<DT><B>-hideroot <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, it indicates
-that no entry for the root node should be displayed. The default is <I>no</I>.
-</DD>
-
-<DT><B>-highlightbackground <I>color</I></B> </DT>
-<DD>Specifies the normal color of the traversal
-highlight region when the widget does not have the input focus. </DD>
-
-<DT><B>-highlightcolor
-<I>color</I></B> </DT>
-<DD>Specifies the color of the traversal highlight rectangle when the
-widget has the input focus. The default is <I>black</I>. </DD>
-
-<DT><B>-highlightthickness <I>pixels</I></B>
-</DT>
-<DD>Specifies the width of the highlight rectangle indicating when the widget
-has input focus. The value may have any of the forms acceptable to <B>Tk_GetPixels</B>.
- If the value is zero, no focus highlight will be displayed. The default
-is <I>2</I>. </DD>
-
-<DT><B>-icons <I>images</I></B> </DT>
-<DD>Specifies images for the entry's icon. <I>Images</I> is a list
-of two Tk images: the first image is displayed when the node is open,
-the second when it is closed. </DD>
-
-<DT><B>-linecolor <I>color</I></B> </DT>
-<DD>Sets the color of the connecting
-lines drawn between entries. The default is <I>black</I>. </DD>
-
-<DT><B>-linespacing <I>pixels</I></B> </DT>
-<DD>Sets
-the number of pixels spacing between entries. The default is <I>0</I>. </DD>
-
-<DT><B>-linewidth
-<I>pixels</I></B> </DT>
-<DD>Set the width of the lines drawn connecting entries. If <I>pixels</I> is
-<I>0</I>, no vertical or horizontal lines are drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-newtags
-<I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, when sharing a tree object (see the <B>-tree</B> option),
-don't share its tags too. The default is <I>0</I>. </DD>
-
-<DT><B>-opencommand <I>string</I></B> </DT>
-<DD>Specifies
-a Tcl script to be invoked when a node is open. You can override this
-for individual entries with the entry's <B>-opencommand</B> configuration option.
- The default is <I>""</I>. Percent substitutions are performed on <I>string</I> before
- it is executed. The following substitutions are valid: <blockquote></DD>
-
-<DT><I>%W</I> </DT>
-<DD>The pathname
-of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The full pathname of the node.
-</DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single percent. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies
-the 3-D effect for the widget. <I>Relief</I> specifies how the <B>treeview</B> widget
-should appear relative to widget it is packed into; for example, <I>raised</I>
-means the <B>treeview</B> widget should appear to protrude. The default is <I>sunken</I>.
-</DD>
-
-<DT><B>-scrollmode <I>mode</I></B> </DT>
-<DD>Specifies the style of scrolling to be used. The following
-styles are valid. This is the default is <I>hierbox</I>. <blockquote></DD>
-
-<DT><I>listbox</I> </DT>
-<DD>Like the <B>listbox</B>
-widget, the last entry can always be scrolled to the top of the widget
-window. This allows the scrollbar thumb to shrink as the last entry is
-scrolled upward. </DD>
-
-<DT><I>hierbox</I> </DT>
-<DD>Like the <B>hierbox</B> widget, the last entry can only
-be viewed at the bottom of the widget window. The scrollbar stays a constant
-size. </DD>
-
-<DT><I>canvas</I> </DT>
-<DD>Like the <B>canvas</B> widget, the entries are bound within the
-scrolling area. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-selectbackground <I>color</I></B> </DT>
-<DD>Sets the background color selected
-node entries. The default is <I>#ffffea</I>. </DD>
-
-<DT><B>-selectborderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of the raised 3-D border drawn around the labels of selected entries. The
-default is <I>0</I>. <B>-selectcommand <I>string</I></B> Specifies a Tcl script to invoked when
-the set of selected nodes changes. The default is <I>""</I>. </DD>
-
-<DT><B>-selectforeground <I>color<B>
-</B></I></B></DT>
-<DD>Sets the color of the labels of selected node entries. The default is <I>black</I>.
-</DD>
-
-<DT><B>-selectmode <I>mode</I></B> </DT>
-<DD>Specifies the selection mode. If <I>mode</I> is <I>single</I>, only one
-node can be selected at a time. If <I>multiple</I> more than one node can be selected.
-The default is <I>single</I>. </DD>
-
-<DT><B>-separator <I>string</I></B> </DT>
-<DD>Specifies the character sequence
-to use when spliting the path components. The separator may be several
-characters wide (such as "::") Consecutive separators in a pathname are
-treated as one. If <I>string</I> is the empty string, the pathnames are Tcl lists.
- Each element is a path component. The default is <I>""</I>. </DD>
-
-<DT><B>-showtitles <I>boolean</I></B>
-</DT>
-<DD>If <I>boolean</I> is false, column titles are not be displayed. The default is
-<I>yes</I>. </DD>
-
-<DT><B>-sortselection <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, nodes in the selection are
-ordered as they are currently displayed (depth-first or sorted), not in
-the order they were selected. The default is <I>no</I>. </DD>
-
-<DT><B>-takefocus</B> <I>focus</I> </DT>
-<DD>Provides
-information used when moving the focus from window to window via keyboard
-traversal (e.g., Tab and Shift-Tab). If <I>focus</I> is <I>0</I>, this means that this window
-should be skipped entirely during keyboard traversal. <I>1</I> means that the
-this window should always receive the input focus. An empty value means
-that the traversal scripts make the decision whether to focus on the window.
-The default is <I>"1"</I>. </DD>
-
-<DT><B>-trim <I>string</I></B> </DT>
-<DD>Specifies a string leading characters to
-trim from entry pathnames before parsing. This only makes sense if the
-<B>-separator</B> is also set. The default is <I>""</I>. </DD>
-
-<DT><B>-width <I>pixels</I></B> </DT>
-<DD>Sets the requested
-width of the widget. If <I>pixels</I> is 0, then the with is computed from the
-contents of the <B>treeview</B> widget. The default is <I>200</I>. </DD>
-
-<DT><B>-xscrollcommand <I>string</I></B>
-</DT>
-<DD>Specifies the prefix for a command used to communicate with horizontal
-scrollbars. Whenever the horizontal view in the widget's window changes,
-the widget will generate a Tcl command by concatenating the scroll command
-and two numbers. If this option is not specified, then no command will
-be executed. </DD>
-
-<DT><B>-xscrollincrement</B> <I>pixels</I> </DT>
-<DD>Sets the horizontal scrolling distance.
-The default is 20 pixels. </DD>
-
-<DT><B>-yscrollcommand <I>string</I></B> </DT>
-<DD>Specifies the prefix for
-a command used to communicate with vertical scrollbars. Whenever the vertical
-view in the widget's window changes, the widget will generate a Tcl command
-by concatenating the scroll command and two numbers. If this option is
-not specified, then no command will be executed. </DD>
-
-<DT><B>-yscrollincrement</B> <I>pixels</I>
-</DT>
-<DD>Sets the vertical scrolling distance. The default is 20 pixels. </DD>
-</DL>
-
-<H2><A NAME="sect12" HREF="#toc12">Entry Options</A></H2>
-Many
-widget configuration options have counterparts in entries. For example,
-there is a <B>-closecommand</B> configuration option for both widget itself and
-for individual entries. Options set at the widget level are global for
-all entries. If the entry configuration option is set, then it overrides
-the widget option. This is done to avoid wasting memory by replicated options.
- Most entries will have redundant options. <P>
-There is no resource class or
-name for entries.
-<DL>
-
-<DT><B>-activeicons <I>images</I></B> </DT>
-<DD>Specifies images to be displayed as
-the entry's icon when it is active. This overrides the global <B>-activeicons</B>
-configuration option for the specific entry. <I>Images</I> is a list of two Tk
-images: the first image is displayed when the node is open, the second
-when it is closed. </DD>
-
-<DT><B>-bindtags <I>tagList</I></B> </DT>
-<DD>Specifies the binding tags for nodes.
- <I>TagList</I> is a list of binding tag names. The tags and their order will
-determine how events are handled for nodes. Each tag in the list matching
-the current event sequence will have its Tcl command executed. The default
-value is <I>all</I>. </DD>
-
-<DT><B>-button <I>string</I></B> </DT>
-<DD>Indicates whether a button should be displayed
-on the left side of the node entry. <I>String</I> can be <I>yes</I>, <I>no</I>, or <I>auto</I>. If
-<I>auto</I>, then a button is automatically displayed if the node has children.
- This is the default. </DD>
-
-<DT><B>-closecommand <I>string</I></B> </DT>
-<DD>Specifies a Tcl script to be invoked
-when the node is closed. This overrides the global <B>-closecommand</B> option
-for this entry. The default is <I>""</I>. Percent substitutions are performed on
-<I>string</I> before it is executed. The following substitutions are valid: <blockquote></DD>
-
-<DT><I>%W</I>
-</DT>
-<DD>The pathname of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The full pathname
-of the node. </DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single percent. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>-data
-<I>string</I></B> </DT>
-<DD>Sets data fields for the node. <I>String</I> is a list of name-value pairs
-to be set. The default is <I>""</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B> </DT>
-<DD>Sets the font for entry labels.
- This overrides the widget's <B>-font</B> option for this node. The default is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>.
-</DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets the text color of the entry label. This overrides
-the widget's <B>-foreground</B> configuration option. The default is <I>""</I>. </DD>
-
-<DT><B>-icons <I>images</I></B>
-</DT>
-<DD>Specifies images to be displayed for the entry's icon. This overrides the
-global <B>-icons</B> configuration option. <I>Images</I> is a list of two Tk images: the
-first image is displayed when the node is open, the second when it is closed.
-</DD>
-
-<DT><B>-label <I>string</I></B> </DT>
-<DD>Sets the text for the entry's label. If not set, this defaults
-to the name of the node. The default is <I>""</I>. </DD>
-
-<DT><B>-opencommand <I>string</I></B> </DT>
-<DD>Specifies
-a Tcl script to be invoked when the entry is opened. This overrides the
-widget's <B>-opencommand</B> option for this node. The default is <I>""</I>. Percent substitutions
-are performed on <I>string</I> before it is executed. The following substitutions
-are valid: <blockquote></DD>
-
-<DT><I>%W</I> </DT>
-<DD>The pathname of the widget. </DD>
-
-<DT><I>%p</I> </DT>
-<DD>The name of the node. </DD>
-
-<DT><I>%P</I> </DT>
-<DD>The
-full pathname of the node. </DD>
-
-<DT><I>%#</I> </DT>
-<DD>The id of the node. </DD>
-
-<DT><I>%%</I> </DT>
-<DD>Translates to a single
-percent. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect13" HREF="#toc13">Button Options</A></H2>
-Button configuration options may also be set by the
-<B>option</B> command. The resource subclass is <I>Button</I>. The resource name is always
-<I>button</I>. <BR>
-<CODE>option add *TreeView.Button.Foreground white<BR>
-option add *TreeView.button.Background blue<BR>
-</CODE><P>The following are the configuration options available for buttons.
-<DL>
-
-<DT><B>-activebackground
-<I>color</I></B> </DT>
-<DD>Sets the background color of active buttons. A button is made active
-when the mouse passes over it or by the <B>button activate</B> operation. </DD>
-
-<DT><B>-activeforeground
-<I>color</I></B> </DT>
-<DD>Sets the foreground color of active buttons. A button is made active
-when the mouse passes over it or by the <B>button activate</B> operation. </DD>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Sets the background of the button. The default is <I>white</I>. </DD>
-
-<DT><B>-borderwidth
-<I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around the button. The <B>-relief</B> option
-determines if a border is to be drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-closerelief <I>relief</I></B>
-</DT>
-<DD>Specifies the 3-D effect for the closed button. <I>Relief</I> indicates how the
-button should appear relative to the widget; for example, <I>raised</I> means
-the button should appear to protrude. The default is <I>solid</I>. </DD>
-
-<DT><B>-cursor <I>cursor</I></B>
-</DT>
-<DD>Sets the widget's cursor. The default cursor is <I>""</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Sets
-the foreground color of buttons. The default is <I>black</I>. </DD>
-
-<DT><B>-images <I>images</I></B> </DT>
-<DD>Specifies
-images to be displayed for the button. <I>Images</I> is a list of two Tk images:
- the first image is displayed when the button is open, the second when
-it is closed. If the <I>images</I> is the empty string, then a plus/minus gadget
-is drawn. The default is <I>""</I>. </DD>
-
-<DT><B>-openrelief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect of
-the open button. <I>Relief</I> indicates how the button should appear relative
-to the widget; for example, <I>raised</I> means the button should appear to protrude.
- The default is <I>flat</I>. </DD>
-
-<DT><B>-size <I>pixels</I></B> </DT>
-<DD>Sets the requested size of the button.
- The default is <I>0</I>. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect14" HREF="#toc14">Column Options</A></H2>
-Column configuration options may also
-be set by the <B>option</B> command. The resource subclass is <I>Column</I>. The resource
-name is the name of the column. <BR>
-<CODE>option add *TreeView.Column.Foreground white<BR>
-option add *TreeView.treeView.Background blue<BR>
-</CODE><P>The following configuration options are available for columns.
-<DL>
-
-<DT><B>-background
-<I>color</I></B> </DT>
-<DD>Sets the background color of the column. This overrides the widget's
-<B>-background</B> option. The default is <I>white</I>. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width
-of the 3-D border of the column. The <B>-relief</B> option determines if a border
-is to be drawn. The default is <I>0</I>. </DD>
-
-<DT><B>-edit <I>boolean</I></B> </DT>
-<DD>Indicates if the column's
-data fields can be edited. If <I>boolean</I> is false, the data fields in the
-column may not be edited. The default is <I>yes</I>. </DD>
-
-<DT><B>-foreground <I>color</I></B> </DT>
-<DD>Specifies
-the foreground color of the column. You can override this for individual
-entries with the entry's <B>-foreground</B> option. The default is <I>black</I>. </DD>
-
-<DT><B>-font <I>fontName</I></B>
- </DT>
-<DD>Sets the font for a column. You can override this for individual entries
-with the entry's <B>-font</B> option. The default is <I>*-Helvetica-Bold-R-Normal-*-12-120-*</I>.
-</DD>
-
-<DT><B>-hide <I>boolean</I></B> </DT>
-<DD>If <I>boolean</I> is true, the column is not displayed. The default
-is <I>yes</I>. </DD>
-
-<DT><B>-justify <I>justify</I></B> </DT>
-<DD>Specifies how the column data fields title should
-be justified within the column. This matters only when the column is wider
-than the data field to be display. <I>Justify</I> must be <I>left</I>, <I>right</I>, or <I>center</I>.
- The default is <I>left</I>. </DD>
-
-<DT><B>-pad <I>pad</I></B> </DT>
-<DD>Specifies how much padding for the left and
-right sides of the column. <I>Pad</I> is a list of one or two screen distances.
- If <I>pad</I> has two elements, the left side of the column is padded by the
-first distance and the right side by the second. If <I>pad</I> has just one distance,
-both the left and right sides are padded evenly. The default is <I>2</I>. </DD>
-
-<DT><B>-relief
-<I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect of the column. <I>Relief</I> specifies how the
-column should appear relative to the widget; for example, <I>raised</I> means
-the column should appear to protrude. The default is <I>flat</I>. </DD>
-
-<DT><B>-state <I>state</I></B> </DT>
-<DD>Sets
-the state of the column. If <I>state</I> is <I>disable</I> then the column title can not
-be activated nor invoked. The default is <I>normal</I>. </DD>
-
-<DT><B>-text <I>string</I></B> </DT>
-<DD>Sets the title
-for the column. The default is <I>""</I>. </DD>
-
-<DT><B>-titleforeground <I>color</I></B> </DT>
-<DD>Sets the foreground
-color of the column title. The default is <I>black</I>. </DD>
-
-<DT><B>-titleshadow <I>color</I></B> </DT>
-<DD>Sets
-the color of the drop shadow of the column title. The default is <I>""</I>. </DD>
-
-<DT><B>-width
-<I>pixels</I></B> </DT>
-<DD>Sets the requested width of the column. This overrides the computed
-with of the column. If <I>pixels</I> is 0, the width is computed as from the contents
-of the column. The default is <I>0</I>. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect15" HREF="#toc15">Text Editing Options</A></H2>
-Text edit window configuration
-options may also be set by the <B>option</B> command. The resource class is <I>TreeViewEditor</I>.
-The resource name is always <I>edit</I>. <BR>
-<CODE>option add *TreeViewEditor.Foreground white<BR>
-option add *edit.Background blue<BR>
-</CODE><P>The following are the configuration options available for the text editing
-window.
-<DL>
-
-<DT><B>-background <I>color</I></B> </DT>
-<DD>Sets the background of the text edit window. The
-default is <I>white</I>. </DD>
-
-<DT><B>-borderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around
-the edit window. The <B>-relief</B> option determines if a border is to be drawn.
- The default is <I>1</I>. </DD>
-
-<DT><B>-exportselection <I>boolean</I></B> </DT>
-<DD>Indicates if the text selection
-is exported. If the edit window is exporting its selection then it will
-observe the standard X11 protocols for handling the selection. Selections
-are available as type <B>STRING</B>. The default is <I>no</I>. </DD>
-
-<DT><B>-relief <I>relief</I></B> </DT>
-<DD>Specifies
-the 3-D effect of the edit window. <I>Relief</I> indicates how the background should
-appear relative to the edit window; for example, <I>raised</I> means the background
-should appear to protrude. The default is <I>solid</I>. </DD>
-
-<DT><B>-selectbackground <I>color</I></B>
-</DT>
-<DD>Sets the background of the selected text in the edit window. The default
-is <I>white</I>. </DD>
-
-<DT><B>-selectborderwidth <I>pixels</I></B> </DT>
-<DD>Sets the width of the 3-D border around
-the selected text in the edit window. The <B>-selectrelief</B> option determines
-if a border is to be drawn. The default is <I>1</I>. </DD>
-
-<DT><B>-selectforeground <I>color</I></B> </DT>
-<DD>Sets
-the foreground of the selected text in the edit window. The default is
-<I>white</I>. </DD>
-
-<DT><B>-selectrelief <I>relief</I></B> </DT>
-<DD>Specifies the 3-D effect of the selected text
-in the edit window. <I>Relief</I> indicates how the text should appear relative
-to the edit window; for example, <I>raised</I> means the text should appear to
-protrude. The default is <I>flat</I>. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect16" HREF="#toc16">Default Bindings</A></H2>
-Tk automatically creates
-class bindings for treeviews that give them Motif-like behavior. Much of
-the behavior of a <B>treeview</B> widget is determined by its <B>-selectmode</B> option,
-which selects one of two ways of dealing with the selection. <P>
-If the selection
-mode is <B>single</B>, only one node can be selected at a time. Clicking button
-1 on an node selects it and deselects any other selected item. <P>
-If the selection
-mode is <B>multiple</B>, any number of entries may be selected at once, including
-discontiguous ranges. Clicking Control-Button-1 on a node entry toggles its
-selection state without affecting any other entries. Pressing Shift-Button-1
-on a node entry selects it, extends the selection.
-<OL>
-<LI>In <B>extended</B> mode, the
-selected range can be adjusted by pressing button 1 with the Shift key
-down: this modifies the selection to consist of the entries between the
-anchor and the entry under the mouse, inclusive. The un-anchored end of this
-new selection can also be dragged with the button down. </LI><LI>In <B>extended</B> mode,
-pressing button 1 with the Control key down starts a toggle operation:
-the anchor is set to the entry under the mouse, and its selection state
-is reversed. The selection state of other entries isn't changed. If the mouse
-is dragged with button 1 down, then the selection state of all entries
-between the anchor and the entry under the mouse is set to match that of
-the anchor entry; the selection state of all other entries remains what
-it was before the toggle operation began. </LI><LI>If the mouse leaves the treeview
-window with button 1 down, the window scrolls away from the mouse, making
-information visible that used to be off-screen on the side of the mouse.
-The scrolling continues until the mouse re-enters the window, the button
-is released, or the end of the hierarchy is reached. </LI><LI>Mouse button 2 may
-be used for scanning. If it is pressed and dragged over the <B>treeview</B> widget,
-the contents of the hierarchy drag at high speed in the direction the mouse
-moves. </LI><LI>If the Up or Down key is pressed, the location cursor (active entry)
-moves up or down one entry. If the selection mode is <B>browse</B> or <B>extended</B>
-then the new active entry is also selected and all other entries are deselected.
-In <B>extended</B> mode the new active entry becomes the selection anchor. </LI><LI>In <B>extended</B>
-mode, Shift-Up and Shift-Down move the location cursor (active entry) up
-or down one entry and also extend the selection to that entry in a fashion
-similar to dragging with mouse button 1. </LI><LI>The Left and Right keys scroll
-the <B>treeview</B> widget view left and right by the width of the character <B>0</B>.
-Control-Left and Control-Right scroll the <B>treeview</B> widget view left and right
-by the width of the window. Control-Prior and Control-Next also scroll left
-and right by the width of the window. </LI><LI>The Prior and Next keys scroll the
-<B>treeview</B> widget view up and down by one page (the height of the window).
-</LI><LI>The Home and End keys scroll the <B>treeview</B> widget horizontally to the left
-and right edges, respectively. </LI><LI>Control-Home sets the location cursor to the
-the first entry, selects that entry, and deselects everything else in
-the widget. </LI><LI>Control-End sets the location cursor to the the last entry,
-selects that entry, and deselects everything else in the widget. </LI><LI>In <B>extended</B>
-mode, Control-Shift-Home extends the selection to the first entry and Control-Shift-End
-extends the selection to the last entry. </LI><LI>In <B>multiple</B> mode, Control-Shift-Home
-moves the location cursor to the first entry and Control-Shift-End moves
-the location cursor to the last entry. </LI><LI>The space and Select keys make a
-selection at the location cursor (active entry) just as if mouse button
-1 had been pressed over this entry. </LI><LI>In <B>extended</B> mode, Control-Shift-space
-and Shift-Select extend the selection to the active entry just as if button
-1 had been pressed with the Shift key down. </LI><LI>In <B>extended</B> mode, the Escape
-key cancels the most recent selection and restores all the entries in the
-selected range to their previous selection state. </LI><LI>Control-slash selects everything
-in the widget, except in <B>single</B> and <B>browse</B> modes, in which case it selects
-the active entry and deselects everything else. </LI><LI>Control-backslash deselects
-everything in the widget, except in <B>browse</B> mode where it has no effect.
-</LI><LI>The F16 key (labelled Copy on many Sun workstations) or Meta-w copies the
-selection in the widget to the clipboard, if there is a selection. </LI>
-</OL>
-<P>
-The behavior
-of <B>treeview</B> widgets can be changed by defining new bindings for individual
-widgets or by redefining the class bindings.
-<H3><A NAME="sect17" HREF="#toc17">Widget Bindings</A></H3>
-In addition
-to the above behavior, the following additional behavior is defined by
-the default widget class (TreeView) bindings.
-<DL>
-
-<DT><I><ButtonPress-2></I></DT>
-<DD>Starts scanning.
- </DD>
-
-<DT><I><B2-Motion></I></DT>
-<DD>Adjusts the scan. </DD>
-
-<DT><I><ButtonRelease-2></I></DT>
-<DD>Stops scanning. </DD>
-
-<DT><I><B1-Leave></I></DT>
-<DD>Starts auto-scrolling.
-</DD>
-
-<DT><I><B1-Enter></I></DT>
-<DD>Starts auto-scrolling </DD>
-
-<DT><I><KeyPress-Up></I></DT>
-<DD>Moves the focus to the previous
-entry. </DD>
-
-<DT><I><KeyPress-Down></I></DT>
-<DD>Moves the focus to the next entry. </DD>
-
-<DT><I><Shift-KeyPress-Up></I></DT>
-<DD>Moves
-the focus to the previous sibling. </DD>
-
-<DT><I><Shift-KeyPress-Down></I></DT>
-<DD>Moves the focus to the
-next sibling. </DD>
-
-<DT><I><KeyPress-Prior></I></DT>
-<DD>Moves the focus to first entry. Closed or hidden
-entries are ignored. </DD>
-
-<DT><I><KeyPress-Next></I></DT>
-<DD>Move the focus to the last entry. Closed
-or hidden entries are ignored. </DD>
-
-<DT><I><KeyPress-Left></I></DT>
-<DD>Closes the entry. It is not an
-error if the entry has no children. </DD>
-
-<DT><I><KeyPress-Right></I></DT>
-<DD>Opens the entry, displaying
-its children. It is not an error if the entry has no children. </DD>
-
-<DT><I><KeyPress-space></I></DT>
-<DD>In
-"single" select mode this selects the entry. In "multiple" mode, it toggles
-the entry (if it was previous selected, it is not deselected). </DD>
-
-<DT><I><KeyRelease-space></I></DT>
-<DD>Turns
-off select mode. </DD>
-
-<DT><I><KeyPress-Return></I></DT>
-<DD>Sets the focus to the current entry. </DD>
-
-<DT><I><KeyRelease-Return></I></DT>
-<DD>Turns
-off select mode. </DD>
-
-<DT><I><KeyPress></I></DT>
-<DD>Moves to the next entry whose label starts with
-the letter typed. </DD>
-
-<DT><I><KeyPress-Home></I></DT>
-<DD>Moves the focus to first entry. Closed or
-hidden entries are ignored. </DD>
-
-<DT><I><KeyPress-End></I></DT>
-<DD>Move the focus to the last entry.
-Closed or hidden entries are ignored. </DD>
-
-<DT><I><KeyPress-F1></I></DT>
-<DD>Opens all entries. </DD>
-
-<DT><I><KeyPress-F2></I></DT>
-<DD>Closes
-all entries (except root). </DD>
-</DL>
-
-<H3><A NAME="sect18" HREF="#toc18">Button Bindings</A></H3>
-Buttons have bindings. There are
-associated with the "all" bindtag (see the entry's -bindtag option). You
-can use the <B>bind</B> operation to change them.
-<DL>
-
-<DT><I><Enter></I></DT>
-<DD>Highlights the button of
-the current entry. </DD>
-
-<DT><I><Leave></I></DT>
-<DD>Returns the button back to its normal state. </DD>
-
-<DT><I><ButtonRelease-1></I></DT>
-<DD>Adjust
-the view so that the current entry is visible. </DD>
-</DL>
-
-<H3><A NAME="sect19" HREF="#toc19">Entry Bindings</A></H3>
-Entries have
-default bindings. There are associated with the "all" bindtag (see the
-entry's -bindtag option). You can use the <B>bind</B> operation to modify them.
-<DL>
-
-<DT><I><Enter></I></DT>
-<DD>Highlights
-the current entry. </DD>
-
-<DT><I><Leave></I></DT>
-<DD>Returns the entry back to its normal state. </DD>
-
-<DT><I><ButtonPress-1></I></DT>
-<DD>Sets
-the selection anchor the current entry. </DD>
-
-<DT><I><Double-ButtonPress-1></I></DT>
-<DD>Toggles the selection
-of the current entry. </DD>
-
-<DT><I><B1-Motion></I></DT>
-<DD>For "multiple" mode only. Saves the current
-location of the pointer for auto-scrolling. Resets the selection mark.
-</DD>
-
-<DT><I><ButtonRelease-1></I></DT>
-<DD>For "multiple" mode only. Sets the selection anchor to the
- current entry. </DD>
-
-<DT><I><Shift-ButtonPress-1></I></DT>
-<DD>For "multiple" mode only. Extends the selection.
-</DD>
-
-<DT><I><Shift-Double-ButtonPress-1></I></DT>
-<DD>Place holder. Does nothing. </DD>
-
-<DT><I><Shift-B1-Motion></I></DT>
-<DD>Place holder.
-Does nothing. </DD>
-
-<DT><I><Shift-ButtonRelease-1></I></DT>
-<DD>Stop auto-scrolling. </DD>
-
-<DT><I><Control-ButtonPress-1></I></DT>
-<DD>For
-"multiple" mode only. Toggles and extends the selection. </DD>
-
-<DT><I><Control-Double-ButtonPress-1></I></DT>
-<DD>Place
-holder. Does nothing. </DD>
-
-<DT><I><Control-B1-Motion></I></DT>
-<DD>Place holder. Does nothing. </DD>
-
-<DT><I><Control-ButtonRelease-1></I></DT>
-<DD>Stops
-auto-scrolling. </DD>
-
-<DT><I><Control-Shift-ButtonPress-1></I></DT>
-<DD>??? </DD>
-
-<DT><I><Control-Shift-Double-ButtonPress-1></I></DT>
-<DD>Place
-holder. Does nothing. </DD>
-
-<DT><I><Control-Shift-B1-Motion></I></DT>
-<DD>Place holder. Does nothing. </DD>
-</DL>
-
-<H3><A NAME="sect20" HREF="#toc20">Column
-Bindings</A></H3>
-Columns have bindings too. They are associated with the column's
-"all" bindtag (see the column -bindtag option). You can use the <B>column bind</B>
-operation to change them.
-<DL>
-
-<DT><I><Enter></I></DT>
-<DD>Highlights the current column title. </DD>
-
-<DT><I><Leave></I></DT>
-<DD>Returns
-the column back to its normal state. </DD>
-
-<DT><I><ButtonRelease-1></I></DT>
-<DD>Invokes the command (see
-the column's -command option) if one if specified. </DD>
-</DL>
-
-<H3><A NAME="sect21" HREF="#toc21">Column Rule Bindings</A></H3>
-
-<DL>
-
-<DT><I><Enter></I></DT>
-<DD>Highlights
-the current and activates the ruler. </DD>
-
-<DT><I><Leave></I></DT>
-<DD>Returns the column back to its
-normal state. Deactivates the ruler. </DD>
-
-<DT><I><ButtonPress-1></I></DT>
-<DD>Sets the resize anchor for
-the column. </DD>
-
-<DT><I><B1-Motion></I></DT>
-<DD>Sets the resize mark for the column. </DD>
-
-<DT><I><ButtonRelease-1></I></DT>
-<DD>Adjust
-the size of the column, based upon the resize anchor and mark positions.
-</DD>
-</DL>
-
-<H2><A NAME="sect22" HREF="#toc22">Example</A></H2>
-The <B>treeview</B> command creates a new widget. <BR>
-<CODE>treeview .h -bg white<BR>
-</CODE><P>A new Tcl command <I>.h</I> is also created. This command can be used to query
-and modify the <B>treeview</B> widget. For example, to change the background
-color of the table to "green", you use the new command and the widget's
-<B>configure</B> operation. <BR>
-<CODE># Change the background color.<BR>
-.h configure -background "green"<BR>
-</CODE><P>By default, the <B>treeview</B> widget will automatically create a new tree object
-to contain the data. The name of the new tree is the pathname of the widget.
- Above, the new tree object name is ".h". But you can use the <B>-tree</B> option
-to specify the name of another tree. <BR>
-<CODE># View the tree "myTree".<BR>
-.h configure -tree "myTree"<BR>
-</CODE><P>When a new tree is created, it contains only a root node. The node is automatically
-opened. The id of the root node is always <I>0</I> (you can use also use the special
-id <I>root</I>). The <B>insert</B> operation lets you insert one or more new entries into
-the tree. The last argument is the node's <I>pathname</I>. <BR>
-<CODE># Create a new entry named "myEntry"<BR>
-set id [.h insert end "myEntry"]<BR>
-</CODE><P>This appends a new node named "myEntry". It will positioned as the last
-child of the root of the tree (using the position "end"). You can supply
-another position to order the node within its siblings. <BR>
-<CODE># Prepend "fred".<BR>
-set id [.h insert 0 "fred"]<BR>
-</CODE><P>Entry names do not need to be unique. By default, the node's label is its
-name. To supply a different text label, add the <B>-label</B> option. <BR>
-<CODE># Create a new node named "fred"<BR>
-set id [.h insert end "fred" -label "Fred Flintstone"]<BR>
-</CODE><P>The <B>insert</B> operation returns the id of the new node. You can also use the
-<B>index</B> operation to get this information. <BR>
-<CODE># Get the id of "fred"<BR>
-.h index "fred"<BR>
-</CODE><P>To insert a node somewhere other than root, use the <B>-at</B> switch. It takes
-the id of the node where the new child will be added. <BR>
-<CODE># Create a new node "barney" in "fred".<BR>
-.h insert -at $id end "barney" <BR>
-</CODE><P>A pathname describes the path to an entry in the hierarchy. It's a list
-of entry names that compose the path in the tree. Therefore, you can also
-add "barney" to "fred" as follows. <BR>
-<CODE># Create a new sub-entry of "fred"<BR>
-.h insert end "fred barney" <BR>
-</CODE><P>Every name in the list is ancestor of the next. All ancestors must already
-exist. That means that an entry "fred" is an ancestor of "barney" and must
-already exist. But you can use the <B>-autocreate</B> configuration option to force
-the creation of ancestor nodes. <BR>
-<CODE># Force the creation of ancestors.<BR>
-.h configure -autocreate yes <BR>
-.h insert end "fred barney wilma betty" <BR>
-</CODE><P>Sometimes the pathname is already separated by a character sequence rather
-than formed as a list. A file name is a good example of this. You can use
-the <B>-separator</B> option to specify a separator string to split the path into
-its components. Each pathname inserted is automatically split using the
-separator string as a separator. Multiple separators are treated as one.
-<BR>
-<CODE>.h configure -separator /<BR>
-.h insert end "/usr/local/tcl/bin" <BR>
-</CODE><P>If the path is prefixed by extraneous characters, you can automatically
-trim it off using the <B>-trim</B> option. It removed the string from the path
-before it is parsed. <BR>
-<CODE>.h configure -trim C:/windows -separator /<BR>
-.h insert end "C:/window/system" <BR>
-</CODE><P>You can insert more than one entry at a time with the <B>insert</B> operation.
- This can be much faster than looping over a list of names. <BR>
-<CODE># The slow way<BR>
-foreach f [glob $dir/*] {<BR>
- .h insert end $f<BR>
-}<BR>
-# The fast way<BR>
-eval .h insert end [glob $dir/*]<BR>
-</CODE><P>In this case, the <B>insert</B> operation will return a list of ids of the new
-entries. <P>
-You can delete entries with the <B>delete</B> operation. It takes one
-or more tags of ids as its argument. It deletes the entry and all its children.
-<BR>
-<CODE>.h delete $id<BR>
-</CODE><P>Entries have several configuration options. They control the appearance
-of the entry's icon and label. We have already seen the <B>-label</B> option that
-sets the entry's text label. The <B>entry configure</B> operation lets you set
-or modify an entry's configuration options. <BR>
-<CODE>.h entry configure $id -color red -font fixed<BR>
-</CODE><P>You can hide an entry and its children using the <B>-hide</B> option. <BR>
-<CODE>.h entry configure $id -hide yes<BR>
-</CODE><P>More that one entry can be configured at once. All entries specified are
-configured with the same options. <BR>
-<CODE>.h entry configure $i1 $i2 $i3 $i4 -color brown <BR>
-</CODE><P>An icon is displayed for each entry. It's a Tk image drawn to the left of
-the label. You can set the icon with the entry's <B>-icons</B> option. It takes
-a list of two image names: one to represent the open entry, another when
-it is closed. <BR>
-<CODE>set im1 [image create photo -file openfolder.gif]<BR>
-set im2 [image create photo -file closefolder.gif]<BR>
-.h entry configure $id -icons "$im1 $im2"<BR>
-</CODE><P>If <B>-icons</B> is set to the empty string, no icons are display. <P>
-If an entry has
-children, a button is displayed to the left of the icon. Clicking the mouse
-on this button opens or closes the sub-hierarchy. The button is normally
-a <I>+</I> or <I>-</I> symbol, but can be configured in a variety of ways using the <B>button
-configure</B> operation. For example, the <I>+</I> and <I>-</I> symbols can be replaced with
-Tk images. <BR>
-<CODE>set im1 [image create photo -file closefolder.gif]<BR>
-set im2 [image create photo -file downarrow.gif]<BR>
-.h button configure $id -images "$im1 $im2" \<BR>
- -openrelief raised -closerelief raised<BR>
-</CODE><P>Entries can contain an arbitrary number of <I>data fields</I>. Data fields are
-name-value pairs. Both the value and name are strings. The entry's <B>-data</B> option
-lets you set data fields. <BR>
-<CODE>.h entry configure $id -data {mode 0666 group users}<BR>
-</CODE><P>The <B>-data</B> takes a list of name-value pairs. <P>
-You can display these data fields
-as <I>columns</I> in the <B>treeview</B> widget. You can create and configure columns
-with the <B>column</B> operation. For example, to add a new column to the widget,
-use the <B>column insert</B> operation. The last argument is the name of the data
-field that you want to display. <BR>
-<CODE>.h column insert end "mode"<BR>
-</CODE><P>The column title is displayed at the top of the column. By default, it's
-is the field name. You can override this using the column's <B>-text</B> option.
-<BR>
-<CODE>.h column insert end "mode" -text "File Permissions"<BR>
-</CODE><P>Columns have several configuration options. The <B>column configure</B> operation
-lets you query or modify column options. <BR>
-<CODE>.h column configure "mode" -justify left<BR>
-</CODE><P>The <B>-justify</B> option says how the data is justified within in the column.
- The <B>-hide</B> option indicates whether the column is displayed. <BR>
-<CODE>.h column configure "mode" -hide yes<BR>
-</CODE><P>Entries can be selected by clicking on the mouse. Selected entries are
-drawn using the colors specified by the <B>-selectforeground</B> and <B>-selectbackground</B>
-configuration options. The selection itself is managed by the <B>selection</B>
-operation. <BR>
-<CODE># Clear all selections<BR>
-.h selection clear 0 end<BR>
-# Select the root node<BR>
-.h selection set 0 <BR>
-</CODE><P>The <B>curselection</B> operation returns a list of ids of all the selected entries.
-<BR>
-<CODE>set ids [.h curselection]<BR>
-</CODE><P>You can use the <B>get</B> operation to convert the ids to their pathnames. <BR>
-<CODE>set names [eval .h get -full $ids]<BR>
-</CODE><P>If a treeview is exporting its selection (using the <B>-exportselection</B> option),
-then it will observe the standard X11 protocols for handling the selection.
- Treeview selections are available as type <B>STRING</B>; the value of the selection
-will be the pathnames of the selected entries, separated by newlines. <P>
-The
-<B>treeview</B> supports two modes of selection: <I>single</I> and <I>multiple</I>. In single
-select mode, only one entry can be selected at a time, while multiple select
-mode allows several entries to be selected. The mode is set by the widget's
-<B>-selectmode</B> option. <BR>
-<CODE>.h configure -selectmode "multiple"<BR>
-</CODE><P>You can be notified when the list of selected entries changes. The widget's
-<B>-selectcommand</B> specifies a Tcl procedure that is called whenever the selection
-changes. <BR>
-<CODE>proc SelectNotify { widget } {<BR>
- set ids [$widget curselection]<BR>
-}<BR>
-.h configure -selectcommand "SelectNotify .h"<BR>
-</CODE><P>The widget supports the standard Tk scrolling and scanning operations. The
-<B>treeview</B> can be both horizontally and vertically. You can attach scrollbars
-to the <B>treeview</B> the same way as the listbox or canvas widgets. <BR>
-<CODE>scrollbar .xbar -orient horizontal -command ".h xview"<BR>
-scrollbar .ybar -orient vertical -command ".h yview"<BR>
-.h configure -xscrollcommand ".xbar set" \<BR>
- -yscrollcommand ".ybar set"<BR>
-</CODE><P>There are three different modes of scrolling: <I>listbox</I>, <I>canvas</I>, and <I>hierbox</I>.
- In <I>listbox</I> mode, the last entry can always be scrolled to the top of the
-widget. In <I>hierbox</I> mode, the last entry is always drawn at the bottom of
-the widget. The scroll mode is set by the widget's <B>-selectmode</B> option. <BR>
-<CODE>.h configure -scrollmode "listbox"<BR>
-</CODE><P>Entries can be programmatically opened or closed using the <B>open</B> and <B>close</B>
-operations respectively. <BR>
-<CODE>.h open $id<BR>
-.h close $id<BR>
-</CODE><P>When an entry is opened, a Tcl procedure can be automatically invoked. The
-<B>-opencommand</B> option specifies this procedure. This procedure can lazily
-insert entries as needed. <BR>
-<CODE>proc AddEntries { dir } {<BR>
- eval .h insert end [glob -nocomplain $dir/*] <BR>
-}<BR>
-.h configure -opencommand "AddEntries %P"<BR>
-</CODE><P>Now when an entry is opened, the procedure <I>AddEntries</I> is called and adds
-children to the entry. Before the command is invoked, special "%" substitutions
-(like <B>bind</B>) are performed. Above, <I>%P</I> is translated to the pathname of the
-entry. <P>
-The same feature exists when an entry is closed. The <B>-closecommand</B>
-option specifies the procedure. <BR>
-<CODE>proc DeleteEntries { id } {<BR>
- .h entry delete $id 0 end<BR>
-}<BR>
-.h configure -closecommand "DeleteEntries %#"<BR>
-</CODE><P>When an entry is closed, the procedure <I>DeleteEntries</I> is called and deletes
-the entry's children using the <B>entry delete</B> operation (<I>%#</I> is the id of entry).
-
-<H2><A NAME="sect23" HREF="#toc23">Keywords</A></H2>
-treeview, widget <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Tree Data Object</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Syntax</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">IDs and Tags</A></LI>
-<LI><A NAME="toc7" HREF="#sect7">Special Node IDs</A></LI>
-<LI><A NAME="toc8" HREF="#sect8">Data Fields</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">Entry Bindings</A></LI>
-<LI><A NAME="toc10" HREF="#sect10">Treeview Operations</A></LI>
-<LI><A NAME="toc11" HREF="#sect11">Treeview Options</A></LI>
-<LI><A NAME="toc12" HREF="#sect12">Entry Options</A></LI>
-<LI><A NAME="toc13" HREF="#sect13">Button Options</A></LI>
-<LI><A NAME="toc14" HREF="#sect14">Column Options</A></LI>
-<LI><A NAME="toc15" HREF="#sect15">Text Editing Options</A></LI>
-<LI><A NAME="toc16" HREF="#sect16">Default Bindings</A></LI>
-<UL>
-<LI><A NAME="toc17" HREF="#sect17">Widget Bindings</A></LI>
-<LI><A NAME="toc18" HREF="#sect18">Button Bindings</A></LI>
-<LI><A NAME="toc19" HREF="#sect19">Entry Bindings</A></LI>
-<LI><A NAME="toc20" HREF="#sect20">Column Bindings</A></LI>
-<LI><A NAME="toc21" HREF="#sect21">Column Rule Bindings</A></LI>
-</UL>
-<LI><A NAME="toc22" HREF="#sect22">Example</A></LI>
-<LI><A NAME="toc23" HREF="#sect23">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/vector.html b/blt3.0.1/html/vector.html
deleted file mode 100644
index c89a044..0000000
--- a/blt3.0.1/html/vector.html
+++ /dev/null
@@ -1,1124 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>vector(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-vector - Vector data type for Tcl
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>vector
-create <I>vecName </I></B>?<I>vecName</I>...? ?<I>switches</I>? <P>
-<B>vector destroy <I>vecName </I></B>?<I>vecName</I>...? <P>
-<B>vector
-expr <I>expression</I></B> <P>
-<B>vector names </B>?<I>pattern</I>...?
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>vector</B> command creates
-a vector of floating point values. The vector's components can be manipulated
-in three ways: through a Tcl array variable, a Tcl command, or the C API.
-
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-A vector is simply an ordered set of numbers. The components
-of a vector are real numbers, indexed by counting numbers. <P>
-Vectors are common
-data structures for many applications. For example, a graph may use two
-vectors to represent the X-Y coordinates of the data plotted. The graph
-will automatically be redrawn when the vectors are updated or changed. By
-using vectors, you can separate data analysis from the graph widget. This
-makes it easier, for example, to add data transformations, such as splines.
- It's possible to plot the same data to in multiple graphs, where each graph
-presents a different view or scale of the data. <P>
-You could try to use Tcl's
-associative arrays as vectors. Tcl arrays are easy to use. You can access
-individual elements randomly by specifying the index, or the set the entire
-array by providing a list of index and value pairs for each element. The
-disadvantages of associative arrays as vectors lie in the fact they are
-implemented as hash tables.
-<UL>
-·<LI>There's no implied ordering to the associative
-arrays. If you used vectors for plotting, you would want to insure the
-second component comes after the first, an so on. This isn't possible since
-arrays are actually hash tables. For example, you can't get a range of values
-between two indices. Nor can you sort an array. </LI>·<LI>Arrays consume lots of memory
-when the number of elements becomes large (tens of thousands). This is
-because each element's index and value are stored as strings in the hash
-table. </LI>·<LI>The C programming interface is unwieldy. Normally with vectors, you
-would like to view the Tcl array as you do a C array, as an array of floats
-or doubles. But with hash tables, you must convert both the index and value
-to and from decimal strings, just to access an element in the array. This
-makes it cumbersome to perform operations on the array as a whole. </LI>
-</UL>
-<P>
-The <B>vector</B>
-command tries to overcome these disadvantages while still retaining the
-ease of use of Tcl arrays. The <B>vector</B> command creates both a new Tcl command
-and associate array which are linked to the vector components. You can
-randomly access vector components though the elements of array. Not have
-all indices are generated for the array, so printing the array (using the
-<B>parray</B> procedure) does not print out all the component values. You can
-use the Tcl command to access the array as a whole. You can copy, append,
-or sort vector using its command. If you need greater performance, or customized
-behavior, you can write your own C code to manage vectors.
-<H2><A NAME="sect4" HREF="#toc4">Example</A></H2>
-You create
-vectors using the <B>vector</B> command and its <B>create</B> operation. <BR>
-<CODE># Create a new vector. <BR>
-vector create y(50)<BR>
-</CODE><P>This creates a new vector named <I>y</I>. It has fifty components, by default,
-initialized to <I>0.0</I>. In addition, both a Tcl command and array variable,
-both named <I>y</I>, are created. You can use either the command or variable to
-query or modify components of the vector. <BR>
-<CODE># Set the first value. <BR>
-set y(0) 9.25<BR>
-puts "y has [y length] components"<BR>
-</CODE><P>The array <I>y</I> can be used to read or set individual components of the vector.
- Vector components are indexed from zero. The array index must be a number
-less than the number of components. For example, it's an error if you try
-to set the 51st element of <I>y</I>. <BR>
-<CODE># This is an error. The vector only has 50 components.<BR>
-set y(50) 0.02<BR>
-</CODE><P>You can also specify a range of indices using a colon (:) to separate the
-first and last indices of the range. <BR>
-<CODE># Set the first six components of y <BR>
-set y(0:5) 25.2<BR>
-</CODE><P>If you don't include an index, then it will default to the first and/or
-last component of the vector. <BR>
-<CODE># Print out all the components of y <BR>
-puts "y = $y(:)"<BR>
-</CODE><P>There are special non-numeric indices. The index <I>end</I>, specifies the last
-component of the vector. It's an error to use this index if the vector is
-empty (length is zero). The index <I>++end</I> can be used to extend the vector
-by one component and initialize it to a specific value. You can't read
-from the array using this index, though. <BR>
-<CODE># Extend the vector by one component.<BR>
-set y(++end) 0.02<BR>
-</CODE><P>The other special indices are <I>min</I> and <I>max</I>. They return the current smallest
-and largest components of the vector. <BR>
-<CODE># Print the bounds of the vector<BR>
-puts "min=$y(min) max=$y(max)"<BR>
-</CODE><P>To delete components from a vector, simply unset the corresponding array
-element. In the following example, the first component of <I>y</I> is deleted.
-All the remaining components of <I>y</I> will be moved down by one index as the
-length of the vector is reduced by one. <BR>
-<CODE># Delete the first component<BR>
-unset y(0)<BR>
-puts "new first element is $y(0)"<BR>
-</CODE><P>The vector's Tcl command can also be used to query or set the vector. <BR>
-<CODE># Create and set the components of a new vector<BR>
-vector create x<BR>
-x set { 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 }<BR>
-</CODE><P>Here we've created a vector <I>x</I> without a initial length specification. In
-this case, the length is zero. The <B>set</B> operation resets the vector, extending
-it and setting values for each new component. <P>
-There are several operations
-for vectors. The <B>range</B> operation lists the components of a vector between
-two indices. <BR>
-<CODE># List the components <BR>
-puts "x = [x range 0 end]"<BR>
-</CODE><P>You can search for a particular value using the <B>search</B> operation. It returns
-a list of indices of the components with the same value. If no component
-has the same value, it returns <I>""</I>. <BR>
-<CODE># Find the index of the biggest component<BR>
-set indices [x search $x(max)]<BR>
-</CODE><P>Other operations copy, append, or sort vectors. You can append vectors
-or new values onto an existing vector with the <B>append</B> operation. <BR>
-<CODE># Append assorted vectors and values to x<BR>
-x append x2 x3 { 2.3 4.5 } x4<BR>
-</CODE><P>The <B>sort</B> operation sorts the vector. If any additional vectors are specified,
-they are rearranged in the same order as the vector. For example, you could
-use it to sort data points represented by x and y vectors. <BR>
-<CODE># Sort the data points<BR>
-x sort y<BR>
-</CODE><P>The vector <I>x</I> is sorted while the components of <I>y</I> are rearranged so that
-the original x,y coordinate pairs are retained. <P>
-The <B>expr</B> operation lets
-you perform arithmetic on vectors. The result is stored in the vector.
-<BR>
-<CODE># Add the two vectors and a scalar<BR>
-x expr { x + y }<BR>
-x expr { x * 2 }<BR>
-</CODE><P>When a vector is modified, resized, or deleted, it may trigger call-backs
-to notify the clients of the vector. For example, when a vector used in
-the <B>graph</B> widget is updated, the vector automatically notifies the widget
-that it has changed. The graph can then redrawn itself at the next idle
-point. By default, the notification occurs when Tk is next idle. This way
-you can modify the vector many times without incurring the penalty of the
-graph redrawing itself for each change. You can change this behavior using
-the <B>notify</B> operation. <BR>
-<CODE># Make vector x notify after every change<BR>
-x notify always<BR>
-<tt> </tt> <tt> </tt> ...<BR>
-# Never notify<BR>
-x notify never<BR>
-<tt> </tt> <tt> </tt> ...<BR>
-# Force notification now<BR>
-x notify now<BR>
-</CODE><P>To delete a vector, use the <B>vector delete</B> command. Both the vector and
-its corresponding Tcl command are destroyed. <BR>
-<CODE># Remove vector x<BR>
-vector destroy x<BR>
-
-<H2><A NAME="sect5" HREF="#toc5"></CODE><P>Syntax</A></H2>
-Vectors are created using the <B>vector create</B> operation. Th <B>create</B>
-operation can be invoked in one of three forms:
-<DL>
-
-<DT><B>vector create <I>vecName</I></B> </DT>
-<DD>This
-creates a new vector <I>vecName</I> which initially has no components. </DD>
-
-<DT><B>vector create
-<I>vecName</I></B>(<I>size</I>) </DT>
-<DD>This second form creates a new vector which will contain
-<I>size</I> number of components. The components will be indexed starting from
-zero (0). The default value for the components is <I>0.0</I>. </DD>
-
-<DT><B>vector create <I>vecName</I></B>(<I>first</I>:<I>last</I>)
-</DT>
-<DD>The last form creates a new vector of indexed <I>first</I> through <I>last</I>. <I>First</I>
-and <I>last</I> can be any integer value so long as <I>first</I> is less than <I>last</I>. </DD>
-</DL>
-<P>
-Vector
-names must start with a letter and consist of letters, digits, or underscores.
- <BR>
-<CODE># Error: must start with letter<BR>
-vector create 1abc<BR>
-</CODE><P>You can automatically generate vector names using the "<I>#auto</I>" vector name.
- The <B>create</B> operation will generate a unique vector name. <BR>
-<CODE>set vec [vector create #auto]<BR>
-puts "$vec has [$vec length] components"<BR>
-
-<H3><A NAME="sect6" HREF="#toc6"></CODE><P>Vector Indices</A></H3>
-Vectors are indexed by integers. You can access the individual
-vector components via its array variable or Tcl command. The string representing
-the index can be an integer, a numeric expression, a range, or a special
-keyword. <P>
-The index must lie within the current range of the vector, otherwise
-an an error message is returned. Normally the indices of a vector are start
-from 0. But you can use the <B>offset</B> operation to change a vector's indices
-on-the-fly. <BR>
-<CODE>puts $vecName(0)<BR>
-vecName offset -5<BR>
-puts $vecName(-5)<BR>
-</CODE><P>You can also use numeric expressions as indices. The result of the expression
-must be an integer value. <BR>
-<CODE>set n 21<BR>
-set vecName($n+3) 50.2<BR>
-</CODE><P>The following special non-numeric indices are available: <I>min</I>, <I>max</I>, <I>end</I>,
-and <I>++end</I>. <BR>
-<CODE>puts "min = $vecName($min)"<BR>
-set vecName(end) -1.2<BR>
-</CODE><P>The indices <I>min</I> and <I>max</I> will return the minimum and maximum values of the
-vector. The index <I>end</I> returns the value of the last component in the vector.
- The index <I>++end</I> is used to append new value onto the vector. It automatically
-extends the vector by one component and sets its value. <BR>
-<CODE># Append an new component to the end<BR>
-set vecName(++end) 3.2<BR>
-</CODE><P>A range of indices can be indicated by a colon (:). <BR>
-<CODE># Set the first six components to 1.0<BR>
-set vecName(0:5) 1.0<BR>
-</CODE><P>If no index is supplied the first or last component is assumed. <BR>
-<CODE># Print the values of all the components<BR>
-puts $vecName(:)<BR>
-
-<H2><A NAME="sect7" HREF="#toc7"></CODE><P>Vector Operations</A></H2>
-
-<DL>
-
-<DT><B>vector create <I>vecName</I></B>?(<I>size</I>)?... ?<I>switches</I>? </DT>
-<DD>The <B>create</B> operation
-creates a new vector <I>vecName</I>. Both a Tcl command and array variable <I>vecName</I>
-are also created. The name <I>vecName</I> must be unique, so another Tcl command
-or array variable can not already exist in that scope. You can access the
-components of the vector using its variable. If you change a value in the
-array, or unset an array element, the vector is updated to reflect the
-changes. When the variable <I>vecName</I> is unset, the vector and its Tcl command
-are also destroyed. <P>
-The vector has optional switches that affect how the
-vector is created. They are as follows: <blockquote></DD>
-
-<DT><B>-variable <I>varName</I></B> </DT>
-<DD>Specifies the name
-of a Tcl variable to be mapped to the vector. If the variable already exists,
-it is first deleted, then recreated. If <I>varName</I> is the empty string, then
-no variable will be mapped. You can always map a variable back to the vector
-using the vector's <B>variable</B> operation. </DD>
-
-<DT><B>-command <I>cmdName</I></B> </DT>
-<DD>Maps a Tcl command
-to the vector. The vector can be accessed using <I>cmdName</I> and one of the
-vector instance operations. A Tcl command by that name cannot already
-exist. If <I>cmdName</I> is the empty string, no command mapping will be made. </DD>
-
-<DT><B>-watchunset
-<I>boolean</I></B> </DT>
-<DD>Indicates that the vector should automatically delete itself if
-the variable associated with the vector is unset. By default, the vector
-will not be deleted. This is different from previous releases. Set <I>boolean</I>
-to "true" to get the old behavior. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>vector destroy <I>vecName</I></B> ?<I>vecName...</I>? </DT>
-<DD></DD>
-
-<DT><B>vector
-expr <I>expression</I></B> </DT>
-<DD><blockquote>All binary operators take vectors as operands (remember
-that numbers are treated as one-component vectors). The exact action of
-binary operators depends upon the length of the second operand. If the
-second operand has only one component, then each element of the first vector
-operand is computed by that value. For example, the expression "x * 2"
-multiples all elements of the vector x by 2. If the second operand has
-more than one component, both operands must be the same length. Each pair
-of corresponding elements are computed. So "x + y" adds the the first components
-of x and y together, the second, and so on. <P>
-The valid operators are listed
-below, grouped in decreasing order of precedence: </DD>
-
-<DT><B>- !</B> </DT>
-<DD>Unary minus and logical
-NOT. The unary minus flips the sign of each component in the vector. The
-logical not operator returns a vector of whose values are 0.0 or 1.0. For
-each non-zero component 1.0 is returned, 0.0 otherwise. </DD>
-
-<DT><B>^</B> </DT>
-<DD>Exponentiation. </DD>
-
-<DT><B>*
- / %</B> </DT>
-<DD>Multiply, divide, remainder. </DD>
-
-<DT><B>+ -</B> </DT>
-<DD>Add and subtract. </DD>
-
-<DT><B><< >></B> </DT>
-<DD>Left and
-right shift. Circularly shifts the values of the vector (not implemented
-yet). </DD>
-
-<DT><B>< > <= >=</B> </DT>
-<DD>Boolean less, greater, less than or equal, and greater than
-or equal. Each operator returns a vector of ones and zeros. If the condition
-is true, 1.0 is the component value, 0.0 otherwise. </DD>
-
-<DT><B>== !=</B> </DT>
-<DD>Boolean equal
-and not equal. Each operator returns a vector of ones and zeros. If the
-condition is true, 1.0 is the component value, 0.0 otherwise. </DD>
-
-<DT><B>|</B> </DT>
-<DD>Bit-wise OR.
- (Not implemented). </DD>
-
-<DT><B>&&</B> </DT>
-<DD>Logical AND. Produces a 1 result if both operands are
-non-zero, 0 otherwise. </DD>
-
-<DT><B>||</B> </DT>
-<DD>Logical OR. Produces a 0 result if both operands
-are zero, 1 otherwise. </DD>
-
-<DT><I>x<B>?<I>y<B>:<I>z</I></B></I></B></I> </DT>
-<DD>If-then-else, as in C. (Not implemented yet).
-</DD>
-</DL>
-<P>
-See the C manual for more details on the results produced by each operator.
- All of the binary operators group left-to-right within the same precedence
-level. <P>
-Several mathematical functions are supported for vectors. Each
-of the following functions invokes the math library function of the same
-name; see the manual entries for the library functions for details on what
-they do. The operation is applied to all elements of the vector returning
-the results. <BR>
-<CODE><P>
-<B>acos</B><tt> </tt> <tt> </tt> <B>cos</B><tt> </tt> <tt> </tt> <B>hypot</B><tt> </tt> <tt> </tt> <B>sinh</B> <BR>
-<B>asin</B><tt> </tt> <tt> </tt> <B>cosh</B><tt> </tt> <tt> </tt> <B>log</B><tt> </tt> <tt> </tt> <B>sqrt</B> <BR>
-<B>atan</B><tt> </tt> <tt> </tt> <B>exp</B><tt> </tt> <tt> </tt> <B>log10</B><tt> </tt> <tt> </tt> <B>tan</B> <BR>
-<B>ceil</B><tt> </tt> <tt> </tt> <B>floor</B><tt> </tt> <tt> </tt> <B>sin</B><tt> </tt> <tt> </tt> <B>tanh</B> <BR>
-</CODE><P>Additional functions are:
-<DL>
-
-<DT><B>abs</B> </DT>
-<DD>Returns the absolute value of each component.
-</DD>
-
-<DT><B>random</B> </DT>
-<DD>Returns a vector of non-negative values uniformly distributed between
-[0.0, 1.0) using <I>drand48</I>. The seed comes from the internal clock of the machine
-or may be set manual with the srandom function. </DD>
-
-<DT><B>round</B> </DT>
-<DD>Rounds each component
-of the vector. </DD>
-
-<DT><B>srandom</B> </DT>
-<DD>Initializes the random number generator using <I>srand48</I>.
-The high order 32-bits are set using the integral portion of the first
-vector component. All other components are ignored. The low order 16-bits
- are set to an arbitrary value. </DD>
-</DL>
-<P>
-The following functions return a single
-value.
-<DL>
-
-<DT><B>adev</B> </DT>
-<DD>Returns the average deviation (defined as the sum of the absolute
-values of the differences between component and the mean, divided by the
-length of the vector). </DD>
-
-<DT><B>kurtosis</B> </DT>
-<DD>Returns the degree of peakedness (fourth
-moment) of the vector. </DD>
-
-<DT><B>length</B> </DT>
-<DD>Returns the number of components in the vector.
-</DD>
-
-<DT><B>max</B> </DT>
-<DD>Returns the vector's maximum value. </DD>
-
-<DT><B>mean</B> </DT>
-<DD>Returns the mean value of the
-vector. </DD>
-
-<DT><B>median</B> </DT>
-<DD>Returns the median of the vector. </DD>
-
-<DT><B>min</B> </DT>
-<DD>Returns the vector's
-minimum value. </DD>
-
-<DT><B>q1</B> </DT>
-<DD>Returns the first quartile of the vector. </DD>
-
-<DT><B>q3</B> </DT>
-<DD>Returns the
-third quartile of the vector. </DD>
-
-<DT><B>prod</B> </DT>
-<DD>Returns the product of the components.
-</DD>
-
-<DT><B>sdev</B> </DT>
-<DD>Returns the standard deviation (defined as the square root of the
-variance) of the vector. </DD>
-
-<DT><B>skew</B> </DT>
-<DD>Returns the skewness (or third moment) of
-the vector. This characterizes the degree of asymmetry of the vector about
-the mean. </DD>
-
-<DT><B>sum</B> </DT>
-<DD>Returns the sum of the components. </DD>
-
-<DT><B>var</B> </DT>
-<DD>Returns the variance
-of the vector. The sum of the squared differences between each component
-and the mean is computed. The variance is the sum divided by the length
-of the vector minus 1. </DD>
-</DL>
-<P>
-The last set returns a vector of the same length
-as the argument.
-<DL>
-
-<DT><B>norm</B> </DT>
-<DD>Scales the values of the vector to lie in the range
-[0.0..1.0]. </DD>
-
-<DT><B>sort</B> </DT>
-<DD>Returns the vector components sorted in ascending order. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>vector
-names </B>?<I>pattern</I>? </DT>
-<DD></DD>
-</DL>
-
-<H2><A NAME="sect8" HREF="#toc8">Instance Operations</A></H2>
-You can also use the vector's Tcl command
-to query or modify it. The general form is <BR>
-<P>
-<CODE><I>vecName <I>operation</I></I> ?<I>arg</I>?...<BR>
-</CODE><P>Both <I>operation</I> and its arguments determine the exact behavior of the command.
- The operations available for vectors are listed below.
-<DL>
-
-<DT><I>vecName <B>append</B></I> <I>item</I>
-?<I>item</I>?... </DT>
-<DD>Appends the component values from <I>item</I> to <I>vecName</I>. <I>Item</I> can be either
-the name of a vector or a list of numeric values. </DD>
-
-<DT><I>vecName <B>clear</B></I> </DT>
-<DD>Clears
-the element indices from the array variable associated with <I>vecName</I>. This
-doesn't affect the components of the vector. By default, the number of entries
-in the Tcl array doesn't match the number of components in the vector. This
-is because its too expensive to maintain decimal strings for both the index
-and value for each component. Instead, the index and value are saved only
-when you read or write an element with a new index. This command removes
-the index and value strings from the array. This is useful when the vector
-is large. </DD>
-
-<DT><I>vecName <B>delete</B></I> <I>index</I> ?<I>index</I>?... </DT>
-<DD>Deletes the <I>index</I>th component from
-the vector <I>vecName</I>. <I>Index</I> is the index of the element to be deleted. This
-is the same as unsetting the array variable element <I>index</I>. The vector is
-compacted after all the indices have been deleted. </DD>
-
-<DT><I>vecName <B>dup</B></I> <I>destName</I>
- </DT>
-<DD>Copies <I>vecName</I> to <I>destName</I>. <I>DestName</I> is the name of a destination vector.
- If a vector <I>destName</I> already exists, it is overwritten with the components
-of <I>vecName</I>. Otherwise a new vector is created. </DD>
-
-<DT><I>vecName <B>expr</B></I> <I>expression</I>
-</DT>
-<DD>Computes the expression and resets the values of the vector accordingly.
-Both scalar and vector math operations are allowed. All values in expressions
-are either real numbers or names of vectors. All numbers are treated as
-one component vectors. </DD>
-
-<DT><I>vecName <B>length</B></I> ?<I>newSize</I>? </DT>
-<DD>Queries or resets the number
-of components in <I>vecName</I>. <I>NewSize</I> is a number specifying the new size of
-the vector. If <I>newSize</I> is smaller than the current size of <I>vecName</I>, <I>vecName</I>
-is truncated. If <I>newSize</I> is greater, the vector is extended and the new
-components are initialized to <I>0.0</I>. If no <I>newSize</I> argument is present, the
-current length of the vector is returned. </DD>
-
-<DT><I>vecName <B>merge</B></I> <I>srcName</I> ?<I>srcName</I>?...
-</DT>
-<DD>Merges the named vectors into a single vector. The resulting vector is
-formed by merging the components of each source vector one index at a
-time. </DD>
-
-<DT><I>vecName <B>notify</B></I> <I>keyword</I> </DT>
-<DD>Controls how vector clients are notified of
-changes to the vector. The exact behavior is determined by <I>keyword</I>. <blockquote></DD>
-
-<DT><I>always</I>
- </DT>
-<DD>Indicates that clients are to be notified immediately whenever the vector
-is updated. </DD>
-
-<DT><I>never</I> </DT>
-<DD>Indicates that no clients are to be notified. </DD>
-
-<DT><I>whenidle</I>
-</DT>
-<DD>Indicates that clients are to be notified at the next idle point whenever
-the vector is updated. </DD>
-
-<DT><I>now</I> </DT>
-<DD>If any client notifications is currently pending,
-they are notified immediately. </DD>
-
-<DT><I>cancel</I> </DT>
-<DD>Cancels pending notifications of clients
-using the vector. </DD>
-
-<DT><I>pending</I> </DT>
-<DD>Returns <I>1</I> if a client notification is pending,
-and <I>0</I> otherwise. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><I>vecName <B>offset</B></I> ?<I>value</I>? </DT>
-<DD>Shifts the indices of the vector
-by the amount specified by <I>value</I>. <I>Value</I> is an integer number. If no <I>value</I>
-argument is given, the current offset is returned. </DD>
-
-<DT><I>vecName <B>populate</B></I> <I>destName</I>
-?<I>density</I>? </DT>
-<DD>Creates a vector <I>destName</I> which is a superset of <I>vecName</I>. <I>DestName</I>
-will include all the components of <I>vecName</I>, in addition the interval between
-each of the original components will contain a <I>density</I> number of new components,
-whose values are evenly distributed between the original components values.
- This is useful for generating abscissas to be interpolated along a spline.
-</DD>
-
-<DT><I>vecName <B>range</B></I> <I>firstIndex</I> ?<I>lastIndex</I>?... </DT>
-<DD>Returns a list of numeric values representing
-the vector components between two indices. Both <I>firstIndex</I> and <I>lastIndex</I>
-are indices representing the range of components to be returned. If <I>lastIndex</I>
-is less than <I>firstIndex</I>, the components are listed in reverse order. </DD>
-
-<DT><I>vecName
-<B>search</B></I> <I>value</I> ?<I>value</I>? </DT>
-<DD>Searches for a value or range of values among the
-components of <I>vecName</I>. If one <I>value</I> argument is given, a list of indices
-of the components which equal <I>value</I> is returned. If a second <I>value</I> is also
-provided, then the indices of all components which lie within the range
-of the two values are returned. If no components are found, then <I>""</I> is returned.
-</DD>
-
-<DT><I>vecName <B>set</B></I> <I>item</I> </DT>
-<DD>Resets the components of the vector to <I>item</I>. <I>Item</I> can be
-either a list of numeric expressions or another vector. </DD>
-
-<DT><I>vecName <B>seq</B></I> <I>start</I>
-?<I>finish</I>? ?<I>step</I>? </DT>
-<DD>Generates a sequence of values starting with the value
-<I>start</I>. <I>Finish</I> indicates the terminating value of the sequence. The vector
-is automatically resized to contain just the sequence. If three arguments
-are present, <I>step</I> designates the interval. <P>
-With only two arguments (no
-<I>finish</I> argument), the sequence will continue until the vector is filled.
- With one argument, the interval defaults to 1.0. </DD>
-
-<DT><I>vecName <B>sort</B></I> ?<B>-reverse</B>?
-?<I>argName</I>?... </DT>
-<DD>Sorts the vector <I>vecName</I> in increasing order. If the <B>-reverse</B>
-flag is present, the vector is sorted in decreasing order. If other arguments
-<I>argName</I> are present, they are the names of vectors which will be rearranged
-in the same manner as <I>vecName</I>. Each vector must be the same length as <I>vecName</I>.
-You could use this to sort the x vector of a graph, while still retaining
-the same x,y coordinate pairs in a y vector. </DD>
-
-<DT><I>vecName <B>variable</B></I> <I>varName</I> </DT>
-<DD>Maps
-a Tcl variable to the vector, creating another means for accessing the
-vector. The variable <I>varName</I> can't already exist. This overrides any current
-variable mapping the vector may have. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect9" HREF="#toc9">C Language API</A></H2>
-You can create, modify,
-and destroy vectors from C code, using library routines. You need to
-include the header file <I>blt.h</I>. It contains the definition of the structure
-<B>Blt_Vector</B>, which represents the vector. It appears below. <BR>
-<CODE>typedef struct {<BR>
- double *<I>valueArr</I>; <BR>
- int <I>numValues</I>; <BR>
- int <I>arraySize</I>; <BR>
- double <I>min</I>, <I>max</I>; <BR>
-} <B>Blt_Vector</B>;<BR>
-</CODE><P>The field <I>valueArr</I> points to memory holding the vector components. The
-components are stored in a double precision array, whose size size is represented
-by <I>arraySize</I>. <I>NumValues</I> is the length of vector. The size of the array
-is always equal to or larger than the length of the vector. <I>Min</I> and <I>max</I>
-are minimum and maximum component values.
-<H2><A NAME="sect10" HREF="#toc10">Library Routines</A></H2>
-The following
-routines are available from C to manage vectors. Vectors are identified
-by the vector name. <P>
-<B>Blt_CreateVector</B> <blockquote>
-<DL>
-
-<DT>Synopsis: </DT>
-<DD><BR>
-<CODE>int <B>Blt_CreateVector</B> (<I>interp</I>, <I>vecName</I>, <I>length</I>, <I>vecPtrPtr</I>)<BR>
-<blockquote>Tcl_Interp *<I>interp</I>;<BR>
-char *<I>vecName</I>;<BR>
-int <I>length</I>;<BR>
-Blt_Vector **<I>vecPtrPtr</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Creates a new vector <I>vecName</I> with a length of <I>length</I>. <B>Blt_CreateVector</B>
-creates both a new Tcl command and array variable <I>vecName</I>. Neither a command
-nor variable named <I>vecName</I> can already exist. A pointer to the vector
-is placed into <I>vecPtrPtr</I>. </DD>
-
-<DT>Results: </DT>
-<DD>Returns <I>TCL_OK</I> if the vector is successfully
-created. If <I>length</I> is negative, a Tcl variable or command <I>vecName</I> already
-exists, or memory cannot be allocated for the vector, then <I>TCL_ERROR</I> is
-returned and <I>interp->result</I> will contain an error message. </DD>
-</DL>
-</blockquote>
-<P>
-<P>
-<B>Blt_DeleteVectorByName</B>
- <blockquote>
-<DL>
-
-<DT>Synopsis: </DT>
-<DD><BR>
-<CODE>int <B>Blt_DeleteVectorByName</B> (<I>interp</I>, <I>vecName</I>)<BR>
-<blockquote>Tcl_Interp *<I>interp</I>;<BR>
-char *<I>vecName</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Removes the vector <I>vecName</I>. <I>VecName</I> is the name of a vector
-which must already exist. Both the Tcl command and array variable <I>vecName</I>
-are destroyed. All clients of the vector will be notified immediately that
-the vector has been destroyed. </DD>
-
-<DT>Results: </DT>
-<DD>Returns <I>TCL_OK</I> if the vector is
-successfully deleted. If <I>vecName</I> is not the name a vector, then <I>TCL_ERROR</I>
-is returned and <I>interp->result</I> will contain an error message. </DD>
-</DL>
-</blockquote>
-<P>
-<P>
-<B>Blt_DeleteVector</B>
- <blockquote>
-<DL>
-
-<DT>Synopsis: </DT>
-<DD><BR>
-<CODE>int <B>Blt_DeleteVector</B> (<I>vecPtr</I>)<BR>
-<blockquote>Blt_Vector *<I>vecPtr</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Removes the vector pointed to by <I>vecPtr</I>. <I>VecPtr</I> is a pointer
-to a vector, typically set by <B>Blt_GetVector</B> or <B>Blt_CreateVector</B>. Both the
-Tcl command and array variable of the vector are destroyed. All clients
-of the vector will be notified immediately that the vector has been destroyed.
-</DD>
-
-<DT>Results: </DT>
-<DD>Returns <I>TCL_OK</I> if the vector is successfully deleted. If <I>vecName</I>
-is not the name a vector, then <I>TCL_ERROR</I> is returned and <I>interp->result</I> will
-contain an error message. </DD>
-</DL>
-</blockquote>
-<P>
-<P>
-<B>Blt_GetVector</B> <blockquote>
-<DL>
-
-<DT>Synopsis: </DT>
-<DD><BR>
-<CODE>int <B>Blt_GetVector</B> (<I>interp</I>, <I>vecName</I>, <I>vecPtrPtr</I>)<BR>
-<blockquote>Tcl_Interp *<I>interp</I>;<BR>
-char *<I>vecName</I>;<BR>
-Blt_Vector **<I>vecPtrPtr</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Retrieves the vector <I>vecName</I>. <I>VecName</I> is the name of a vector
-which must already exist. <I>VecPtrPtr</I> will point be set to the address of
-the vector. </DD>
-
-<DT>Results: </DT>
-<DD>Returns <I>TCL_OK</I> if the vector is successfully retrieved.
- If <I>vecName</I> is not the name of a vector, then <I>TCL_ERROR</I> is returned and
-<I>interp->result</I> will contain an error message. </DD>
-</DL>
-</blockquote>
-<P>
-<P>
-<B>Blt_ResetVector</B> <P>
-<blockquote>
-<DL>
-
-<DT>Synopsis: </DT>
-<DD><BR>
-<CODE>int <B>Blt_ResetVector</B> (<I>vecPtr</I>, <I>dataArr</I>, <BR>
-<tt> </tt> <tt> </tt> <I>numValues</I>, <I>arraySize</I>, <I>freeProc</I>)<BR>
-<blockquote>Blt_Vector *<I>vecPtr</I>;<BR>
-double *<I>dataArr</I>;<BR>
-int *<I>numValues</I>;<BR>
-int *<I>arraySize</I>;<BR>
-Tcl_FreeProc *<I>freeProc</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Resets the components of the vector pointed to by <I>vecPtr</I>.
-Calling <B>Blt_ResetVector</B> will trigger the vector to dispatch notifications
-to its clients. <I>DataArr</I> is the array of doubles which represents the vector
-data. <I>NumValues</I> is the number of elements in the array. <I>ArraySize</I> is the
-actual size of the array (the array may be bigger than the number of values
-stored in it). <I>FreeProc</I> indicates how the storage for the vector component
-array (<I>dataArr</I>) was allocated. It is used to determine how to reallocate
-memory when the vector is resized or destroyed. It must be <I>TCL_DYNAMIC</I>,
-<I>TCL_STATIC</I>, <I>TCL_VOLATILE</I>, or a pointer to a function to free the memory
-allocated for the vector array. If <I>freeProc</I> is <I>TCL_VOLATILE</I>, it indicates
-that <I>dataArr</I> must be copied and saved. If <I>freeProc</I> is <I>TCL_DYNAMIC</I>, it indicates
-that <I>dataArr</I> was dynamically allocated and that Tcl should free <I>dataArr</I>
-if necessary. <I>Static</I> indicates that nothing should be done to release storage
-for <I>dataArr</I>. </DD>
-
-<DT>Results: </DT>
-<DD>Returns <I>TCL_OK</I> if the vector is successfully resized.
- If <I>newSize</I> is negative, a vector <I>vecName</I> does not exist, or memory cannot
-be allocated for the vector, then <I>TCL_ERROR</I> is returned and <I>interp->result</I>
-will contain an error message. </DD>
-</DL>
-</blockquote>
-<P>
-<P>
-<B>Blt_ResizeVector</B> <blockquote>
-<DL>
-
-<DT>Synopsis: </DT>
-<DD><BR>
-<CODE>int <B>Blt_ResizeVector</B> (<I>vecPtr</I>, <I>newSize</I>)<BR>
-<blockquote>Blt_Vector *<I>vecPtr</I>;<BR>
-int <I>newSize</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Resets the length of the vector pointed to by <I>vecPtr</I> to <I>newSize</I>.
- If <I>newSize</I> is smaller than the current size of the vector, it is truncated.
- If <I>newSize</I> is greater, the vector is extended and the new components are
-initialized to <I>0.0</I>. Calling <B>Blt_ResetVector</B> will trigger the vector to dispatch
-notifications. </DD>
-
-<DT>Results: </DT>
-<DD>Returns <I>TCL_OK</I> if the vector is successfully resized.
- If <I>newSize</I> is negative or memory can not be allocated for the vector,
- then <I>TCL_ERROR</I> is returned and <I>interp->result</I> will contain an error message.
-<P>
-</DD>
-</DL>
-<P>
-<B>Blt_VectorExists</B> <blockquote>
-<DL>
-
-<DT>Synopsis: </DT>
-<DD><BR>
-<CODE>int <B>Blt_VectorExists</B> (<I>interp</I>, <I>vecName</I>)<BR>
-<blockquote>Tcl_Interp *<I>interp</I>;<BR>
-char *<I>vecName</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Indicates if a vector named <I>vecName</I> exists in <I>interp</I>. </DD>
-
-<DT>Results:
-</DT>
-<DD>Returns <I>1</I> if a vector <I>vecName</I> exists and <I>0</I> otherwise. </DD>
-</DL>
-</blockquote>
-<P>
-<P>
-If your application
-needs to be notified when a vector changes, it can allocate a unique <I>client
-identifier</I> for itself. Using this identifier, you can then register a call-back
-to be made whenever the vector is updated or destroyed. By default, the
-call-backs are made at the next idle point. This can be changed to occur
-at the time the vector is modified. An application can allocate more than
-one identifier for any vector. When the client application is done with
-the vector, it should free the identifier. <P>
-The call-back routine must of
-the following type. <BR>
-<blockquote><BR>
-<CODE>typedef void (<B>Blt_VectorChangedProc</B>) (Tcl_Interp *<I>interp</I>, <BR>
-<blockquote>ClientData <I>clientData</I>, Blt_VectorNotify <I>notify</I>);<BR>
-</blockquote>
-<BR>
-</blockquote>
-</PRE></CODE><P><I>ClientData</I> is passed to this routine whenever it is called. You can use
-this to pass information to the call-back. The <I>notify</I> argument indicates
-whether the vector has been updated of destroyed. It is an enumerated type.
-<BR>
-<blockquote><BR>
-<CODE>typedef enum {<BR>
- <I>BLT_VECTOR_NOTIFY_UPDATE</I>=1,<BR>
- <I>BLT_VECTOR_NOTIFY_DESTROY</I>=2<BR>
-} <B>Blt_VectorNotify</B>;<BR>
-<BR>
-</blockquote>
-<P>
-</CODE><P><B>Blt_AllocVectorId</B> <blockquote>
-<DL>
-
-<DT>Synopsis: </DT>
-<DD><BR>
-<CODE>Blt_VectorId <B>Blt_AllocVectorId</B> (<I>interp</I>, <I>vecName</I>)<BR>
-<blockquote>Tcl_Interp *<I>interp</I>;<BR>
-char *<I>vecName</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Allocates an client identifier for with the vector <I>vecName</I>.
-This identifier can be used to specify a call-back which is triggered when
-the vector is updated or destroyed. </DD>
-
-<DT>Results: </DT>
-<DD>Returns a client identifier
-if successful. If <I>vecName</I> is not the name of a vector, then <I>NULL</I> is returned
-and <I>interp->result</I> will contain an error message. </DD>
-</DL>
-</blockquote>
-<P>
-<P>
-<B>Blt_GetVectorById</B> <blockquote>
-<DL>
-
-<DT>Synopsis:
-</DT>
-<DD><BR>
-<CODE>int <B>Blt_GetVector</B> (<I>interp</I>, <I>clientId</I>, <I>vecPtrPtr</I>)<BR>
-<blockquote>Tcl_Interp *<I>interp</I>;<BR>
-Blt_VectorId <I>clientId</I>;<BR>
-Blt_Vector **<I>vecPtrPtr</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Retrieves the vector used by <I>clientId</I>. <I>ClientId</I> is a valid
-vector client identifier allocated by <B>Blt_AllocVectorId</B>. <I>VecPtrPtr</I> will
-point be set to the address of the vector. </DD>
-
-<DT>Results: </DT>
-<DD>Returns <I>TCL_OK</I> if the
-vector is successfully retrieved. </DD>
-</DL>
-</blockquote>
-<P>
-<P>
-<B>Blt_SetVectorChangedProc</B> <blockquote>
-<DL>
-
-<DT>Synopsis: </DT>
-<DD><BR>
-<CODE>void <B>Blt_SetVectorChangedProc</B> (<I>clientId</I>, <I>proc</I>, <I>clientData</I>);<BR>
-<blockquote>Blt_VectorId <I>clientId</I>;<BR>
-Blt_VectorChangedProc *<I>proc</I>;<BR>
-ClientData *<I>clientData</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Specifies a call-back routine to be called whenever the vector
-associated with <I>clientId</I> is updated or deleted. <I>Proc</I> is a pointer to call-back
-routine and must be of the type <B>Blt_VectorChangedProc</B>. <I>ClientData</I> is a
-one-word value to be passed to the routine when it is invoked. If <I>proc</I> is
-<I>NULL</I>, then the client is not notified. </DD>
-
-<DT>Results: </DT>
-<DD>The designated call-back
-procedure will be invoked when the vector is updated or destroyed. </DD>
-</DL>
-</blockquote>
-<P>
-<P>
-<B>Blt_FreeVectorId</B>
-<blockquote>
-<DL>
-
-<DT>Synopsis: </DT>
-<DD><BR>
-<CODE>void <B>Blt_FreeVectorId</B> (<I>clientId</I>);<BR>
-<blockquote>Blt_VectorId <I>clientId</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Frees the client identifier. Memory allocated for the identifier
- is released. The client will no longer be notified when the vector is
-modified. </DD>
-
-<DT>Results: </DT>
-<DD>The designated call-back procedure will be no longer be
-invoked when the vector is updated or destroyed. </DD>
-</DL>
-</blockquote>
-<P>
-<P>
-<B>Blt_NameOfVectorId</B> <blockquote>
-<DL>
-
-<DT>Synopsis:
-</DT>
-<DD><BR>
-<CODE>char *<B>Blt_NameOfVectorId</B> (<I>clientId</I>);<BR>
-<blockquote>Blt_VectorId <I>clientId</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Retrieves the name of the vector associated with the client
-identifier <I>clientId</I>. </DD>
-
-<DT>Results: </DT>
-<DD>Returns the name of the vector associated
-with <I>clientId</I>. If <I>clientId</I> is not an identifier or the vector has been
-destroyed, <I>NULL</I> is returned. </DD>
-</DL>
-</blockquote>
-<P>
-<P>
-<B>Blt_InstallIndexProc</B> <blockquote>
-<DL>
-
-<DT>Synopsis: </DT>
-<DD><BR>
-<CODE>void <B>Blt_InstallIndexProc</B> (<I>indexName</I>, <I>procPtr</I>)<BR>
-<blockquote>char *<I>indexName</I>;<BR>
-Blt_VectorIndexProc *<I>procPtr</I>;<BR>
-</DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT></CODE><P>Description: </DT>
-<DD>Registers a function to be called to retrieved the index
-<I>indexName</I> from the vector's array variable. <P>
-typedef double Blt_VectorIndexProc(Vector
-*vecPtr); <P>
-The function will be passed a pointer to the vector. The function
-must return a double representing the value at the index. </DD>
-
-<DT>Results: </DT>
-<DD>The new
-index is installed into the vector. </DD>
-</DL>
-</blockquote>
-</blockquote>
-
-<H2><A NAME="sect11" HREF="#toc11">C API Example</A></H2>
-The following example opens
-a file of binary data and stores it in an array of doubles. The array size
-is computed from the size of the file. If the vector "data" exists, calling
-<B>Blt_VectorExists</B>, <B>Blt_GetVector</B> is called to get the pointer to the vector.
-Otherwise the routine <B>Blt_CreateVector</B> is called to create a new vector
-and returns a pointer to it. Just like the Tcl interface, both a new Tcl
-command and array variable are created when a new vector is created. It
-doesn't make any difference what the initial size of the vector is since
-it will be reset shortly. The vector is updated when <B>lt_ResetVector</B> is called.
- Blt_ResetVector makes the changes visible to the Tcl interface and other
-vector clients (such as a graph widget). <P>
-<BR>
-<CODE>#include <tcl.h><BR>
-#include <blt.h><tt> </tt> <tt> </tt> <tt> </tt> <tt> </tt> <tt> </tt> <tt> </tt> <tt> </tt> <tt> </tt> <BR>
-
-<!--
-
-Blt_Vector *vecPtr;<BR>
-double *newArr;<BR>
-FILE *f;<BR>
-struct stat statBuf;<BR>
-int numBytes, numValues;<BR>
-<P>
-f = fopen("binary.dat", "r");<BR>
-fstat(fileno(f), &statBuf);<BR>
-numBytes = (int)statBuf.st_size;<BR>
-<P>
-/* Allocate an array big enough to hold all the data */<BR>
-newArr = (double *)m<A HREF="alloc.n.html">alloc(numBytes)</A>
-;<BR>
-numValues = numBytes / sizeof(double);<BR>
-fread((void *)newArr, numValues, sizeof(double), f);<BR>
-fclose(f);<BR>
-<P>
-if (Blt_VectorExists(interp, "data")) {<BR>
- if (Blt_GetVector(interp, "data", &vecPtr) != TCL_OK) {<BR>
-<tt> </tt> <tt> </tt> return TCL_ERROR;<BR>
- }<BR>
-} else {<BR>
- if (Blt_CreateVector(interp, "data", 0, &vecPtr) != TCL_OK) {<BR>
-<tt> </tt> <tt> </tt> return TCL_ERROR;<BR>
- }<BR>
-}<BR>
-/* <BR>
- * Reset the vector. Clients will be notified when Tk is idle. <BR>
- * TCL_DYNAMIC tells the vector to free the memory allocated <BR>
- * if it needs to reallocate or destroy the vector.<BR>
- */<BR>
-if (Blt_ResetVector(vecPtr, newArr, numValues, numValues, <BR>
-<tt> </tt> <tt> </tt> TCL_DYNAMIC) != TCL_OK) {<BR>
- return TCL_ERROR;<BR>
-}<BR>
-
--->
-
-<H2><A NAME="sect12" HREF="#toc12"></CODE><P>Incompatibilities</A></H2>
-In previous versions, if the array variable isn't global
- (i.e. local to a Tcl procedure), the vector is automatically destroyed
-when the procedure returns. <BR>
-<CODE>proc doit {} {<BR>
- # Temporary vector x<BR>
- vector x(10)<BR>
- set <A HREF="x.9.html">x(9)</A>
- 2.0<BR>
- ...<BR>
-}<BR>
-<P>
-</CODE><P>This has changed. Variables are not automatically destroyed when their
-variable is unset. You can restore the old behavior by setting the "-watchunset"
-switch.
-<H2><A NAME="sect13" HREF="#toc13"></CODE><P>Keywords</A></H2>
-vector, graph, widget <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Example</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Syntax</A></LI>
-<UL>
-<LI><A NAME="toc6" HREF="#sect6">Vector Indices</A></LI>
-</UL>
-<LI><A NAME="toc7" HREF="#sect7">Vector Operations</A></LI>
-<LI><A NAME="toc8" HREF="#sect8">Instance Operations</A></LI>
-<LI><A NAME="toc9" HREF="#sect9">C Language API</A></LI>
-<LI><A NAME="toc10" HREF="#sect10">Library Routines</A></LI>
-<LI><A NAME="toc11" HREF="#sect11">C API Example</A></LI>
-<LI><A NAME="toc12" HREF="#sect12">Incompatibilities</A></LI>
-<LI><A NAME="toc13" HREF="#sect13">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/watch.html b/blt3.0.1/html/watch.html
deleted file mode 100644
index 2059c07..0000000
--- a/blt3.0.1/html/watch.html
+++ /dev/null
@@ -1,140 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>watch(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-watch - call Tcl procedures before and after each
-command
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>watch create</B> <I>watchName</I> ?<I>options</I>? <P>
-<B>watch activate</B> <I>watchName</I>
-<P>
-<B>watch deactivate</B> <I>watchName</I> <P>
-<B>watch delete</B> <I>watchName</I> <P>
-<B>watch configure</B> <I>watchName</I>
-?<I>options</I> <P>
-<B>watch info</B> <I>watchName</I> <P>
-<B>watch names</B>
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>watch</B> command
-arranges for Tcl procedures to be invoked before and after the execution
-of each Tcl command.
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-When an error occurs in Tcl, the global
-variable <I>errorInfo</I> will contain a stack-trace of the active procedures when
-the error occured. Sometimes, however, the stack trace is insufficient.
-You may need to know exactly where in the program's execution the error
-occured. In cases like this, a more general tracing facility would be useful.
-<P>
-The <B>watch</B> command lets you designate Tcl procedures to be invoked before
-and after the execution of each Tcl command. This means you can display
-the command line and its results for each command as it executes. Another
-use is to profile your Tcl commands. You can profile any Tcl command (like
-<B>if</B> and <B>set</B>), not just Tcl procedures.
-<H2><A NAME="sect4" HREF="#toc4">Example</A></H2>
-The following example use <B>watch</B>
-to trace Tcl commands (printing to standard error) both before and after
-they are executed. <BR>
-<CODE>proc preCmd { level command argv } {<BR>
- set name [lindex $argv 0]<BR>
- puts stderr "$level $name => $command"<BR>
-}<BR>
-<P>
-proc postCmd { level command argv retcode results } {<BR>
- set name [lindex $argv 0]<BR>
- puts stderr "$level $name => $argv0= ($retcode) $results"<BR>
-}<BR>
-watch create trace \<BR>
-<tt> </tt> <tt> </tt> -postcmd postCmd -precmd preCmd<BR>
-
-<H2><A NAME="sect5" HREF="#toc5"></CODE><P>Operations</A></H2>
-The following operations are available for the <B>watch</B> command:
-
-<DL>
-
-<DT><B>watch activate <I>watchName</I></B> </DT>
-<DD>Activates the watch, causing Tcl commands the
-be traced to the maximum depth selected. </DD>
-
-<DT><B>watch create <I>watchName</I></B> ?<I>options</I>?...
-</DT>
-<DD>Creates a new watch <I>watchName</I>. It's an error if another watch <I>watchName</I>
-already exists and an error message will be returned. <I>Options</I> may have any
-of the values accepted by the <B>watch configure</B> command. This command returns
-the empty string. </DD>
-
-<DT><B>watch configure <I>watchName</I></B> ?<I>options...</I>? </DT>
-<DD>Queries or modifies
-the configuration options of the watch <I>watchName</I>. <I>WatchName</I> is the name
-of a watch. <I>Options</I> may have any of the following values: <blockquote></DD>
-
-<DT><B>-active <I>boolean</I></B>
-</DT>
-<DD>Specifies if the watch is active. By default, watches are active when created.
-</DD>
-
-<DT><B>-postcmd <I>string</I></B> </DT>
-<DD>Specifies a Tcl procedure to be called immediately after
-each Tcl command. <I>String</I> is name of a Tcl procedure and any extra arguments
-to be passed to it. Before <I>string</I> is invoked, five more arguments are appended:
-1) the current level 2) the current command line 3) a list containing the
-command after substitutions and split into words 4) the return code of
-the command, and 5) the results of the command. The return status of the
-postcmd procedure is always ignored. </DD>
-
-<DT><B>-precmd <I>string</I></B> </DT>
-<DD>Specifies a Tcl procedure
-to be called immediately before each Tcl command. <I>String</I> is name of a Tcl
-procedure and any extra arguments to be passed to it. Before <I>string</I> is
-invoked, three arguments are appended: 1) the current level 2) the current
-command line, and 3) a list containing the command after substitutions
-and split into words. The return status of the <B>-precmd</B> procedure is always
-ignored. </DD>
-
-<DT><B>-maxlevel <I>number</I></B> </DT>
-<DD>Specifies the maximum evaluation depth to watch
-Tcl commands. The default maximum level is 10000. </DD>
-</DL>
-</blockquote>
-
-<DL>
-
-<DT><B>watch deactivate <I>watchName</I></B>
- </DT>
-<DD>Deactivates the watch. The <B>-precmd</B> and <B>-postcmd</B> procedures will no longer
-be invoked. </DD>
-
-<DT><B>watch info <I>watchName</I></B> </DT>
-<DD>Returns the configuration information
-associated with the watch <I>watchName</I>. <I>WatchName</I> is the name of a watch.
-</DD>
-
-<DT><B>watch names</B> ?<I>state</I>? </DT>
-<DD>Lists the names of the watches for a given state. <I>State</I>
-may be one of the following: <I>active</I>, <I>idle</I>, or <I>ignore</I>. If a <I>state</I> argument
-isn't specified, all watches are<BR>
- listed. </DD>
-</DL>
-</blockquote>
-
-<H2><A NAME="sect6" HREF="#toc6">Keywords</A></H2>
-debug, profile <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Example</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Operations</A></LI>
-<LI><A NAME="toc6" HREF="#sect6">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/html/winop.html b/blt3.0.1/html/winop.html
deleted file mode 100644
index 396a41f..0000000
--- a/blt3.0.1/html/winop.html
+++ /dev/null
@@ -1,124 +0,0 @@
- <!-- manual page source format generated by PolyglotMan v3.0.8+XFree86, -->
-<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
-
-<HTML>
-<HEAD>
-<TITLE>winop(n) manual page</TITLE>
-</HEAD>
-<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
-<A HREF="#toc">Table of Contents</A><P>
-
-<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
-winop - Perform assorted window operations
-<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
-<B>winop
-lower</B> ?<I>window</I>?... <P>
-<B>winop map</B> ?<I>window</I>?... <P>
-<B>winop move <I>window x y</I></B> <P>
-<B>winop raise</B> ?<I>window</I>?...
-<P>
-<B>winop snap <I>window photoName</I></B> <P>
-<B>winop unmap</B> ?<I>window</I>?... <P>
-<B>winop warpto</B> ?<I>window</I>?
-
-<H2><A NAME="sect2" HREF="#toc2">Description</A></H2>
-The <B>winop</B> command performs various window operations on Tk windows
-using low-level Xlib function calls to work around window manager pecularities.
-
-<H2><A NAME="sect3" HREF="#toc3">Introduction</A></H2>
-Tk has several commands for manipulating its windows: <B>raise</B>,
-<B>lower</B>, <B>wm</B>, etc. These commands ask the window manager to perform operations
-on Tk windows. In some cases, a particular window manager won't perform
-the operation as expected. <P>
-For example, if you positioned a toplevel window
-using <B>wm geometry</B>, the window may not actually be at those particular coordinates.
- The position of the window may be offset by dimensions of the title bar
-added by the window manager. <P>
-In situations like these, the <B>winop</B> command
-can be used to workaround these difficulties. Instead, it makes low-level
-Xlib (such <B>XRaiseWindow</B> and <B>XMapWindow</B>) calls to perform these operations.
-<BR>
-<CODE>toplevel .top<BR>
-wm withdraw .top<BR>
-<P>
-# Set the geometry to make the window manager <BR>
-# place the window.<BR>
-wm geometry .top +100+100<BR>
-<P>
-# Move the window to the desired location<BR>
-# and "update" to force the window manager<BR>
-# to recognize it.<BR>
-winop move .top 100 100<BR>
-update <BR>
-<P>
-wm deiconify .top<BR>
-winop move .top 100 100<BR>
-
-<H2><A NAME="sect4" HREF="#toc4"></CODE><P>Operations</A></H2>
-The following operations are available for the <B>winop</B> command:
-
-<DL>
-
-<DT><B>winop lower</B> ?<I>window</I>?... </DT>
-<DD>Lowers <I>window</I> to the bottom of the X window stack.
- <I>Window</I> is the path name of a Tk window. </DD>
-
-<DT><B>winop map</B> ?<I>window</I>?... </DT>
-<DD>Maps <I>window</I>
-on the screen. <I>Window</I> is the path name of a Tk window. If <I>window</I> is already
-mapped, this command has no effect. </DD>
-
-<DT><B>winop move <I>window x y</I></B> </DT>
-<DD>Move <I>window</I>
-to the screen location specified by <I>x</I> and <I>y</I>. <I>Window</I> is the path name of
-a Tk window, while <I>x</I> and <I>y</I> are screen coordinates. This command returns
- the empty string. </DD>
-
-<DT><B>winop raise</B> ?<I>window</I>?... </DT>
-<DD>Raises <I>window</I> to the top of the
-X window stack. <I>Window</I> must be a valid path name of a Tk window. This command
-returns the empty string. </DD>
-
-<DT><B>winop snap <I>window photoName</I></B> </DT>
-<DD>Takes a snapshot of
-the <I>window</I> and stores the contents in the photo image <I>photoName</I>. <I>Window</I>
-is the valid path name of a Tk window which must be totally visible (unobscured).
- <I>PhotoName</I> is the name of a Tk photo image which must already exist. This
-command can fail if the window is obscured in any fashion, such as covered
-by another window or partially offscreen. In that case, an error message
-is returned. </DD>
-
-<DT><B>winop unmap</B> ?<I>window</I>?... </DT>
-<DD>Unmaps <I>window</I> from the screen. <I>Window</I> is
-the path name of a Tk window. </DD>
-
-<DT><B>winop warpto</B> ?<I>window</I>? </DT>
-<DD>Warps the pointer to
-<I>window</I>. <I>Window</I> is the path name of a Tk window which must be mapped. If <I>window</I>
-is in the form <I>@x,y</I>, where <I>x</I> and <I>y</I> are root screen coordinates, the pointer
-is warped to that location on the screen. <P>
-[<I>I've never heard a good case for
-warping the pointer in an application. It can be useful for testing, but
-in applications, it's always a bad idea. Simply stated, the user owns the
-pointer, not the application. If you have an application that needs it,
-I'd like to hear about it.</I>] <P>
-If no <I>window</I> argument is present the current
-location of the pointer is returned. The location is returned as a list
-in the form "<I>x y</I>", where <I>x</I> and <I>y</I> are the current coordinates of the pointer.
-</DD>
-</DL>
-
-<H2><A NAME="sect5" HREF="#toc5">Keywords</A></H2>
-window, map, raise, lower, pointer, warp <P>
-
-<HR><P>
-<A NAME="toc"><B>Table of Contents</B></A><P>
-<UL>
-<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
-<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
-<LI><A NAME="toc2" HREF="#sect2">Description</A></LI>
-<LI><A NAME="toc3" HREF="#sect3">Introduction</A></LI>
-<LI><A NAME="toc4" HREF="#sect4">Operations</A></LI>
-<LI><A NAME="toc5" HREF="#sect5">Keywords</A></LI>
-</UL>
-</BODY></HTML>
diff --git a/blt3.0.1/library/Makefile.in b/blt3.0.1/library/Makefile.in
deleted file mode 100644
index bfe1131..0000000
--- a/blt3.0.1/library/Makefile.in
+++ /dev/null
@@ -1,93 +0,0 @@
-# ------------------------------------------------------------------------
-# Makefile for library files and directories of BLT library
-# ------------------------------------------------------------------------
-
-datadir = @datadir@
-datarootdir = @datarootdir@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-prefix = @prefix@
-srcdir = @srcdir@
-
-version = @BLT_VERSION@
-so_prefix = @BLT_SO_PREFIX@
-so_ext = @BLT_SO_EXT@
-lib_suffix = @BLT_LIB_SUFFIX@
-pkgdir = @BLT_LIBRARY@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-RM = rm -f
-SHELL = /bin/sh
-MKDIR_P = @MKDIR_P@
-
-cursors = treeview.xbm \
- treeview_m.xbm
-
-WIN32 = @WIN32@
-ifneq ("$(WIN32)", "")
-cursors += treeview.cur
-endif
-
-libraryFiles = \
- bltCanvEps.pro \
- bltGraph.pro \
- combobutton.tcl \
- comboentry.tcl \
- combomenu.tcl \
- combotree.tcl \
- dnd.tcl \
- dragdrop.tcl \
- drawer.tcl \
- filmstrip.tcl \
- graph.tcl \
- listview.tcl \
- paneset.tcl \
- pushbutton.tcl \
- unixButton.tcl \
- macButton.tcl \
- winButton.tcl \
- scrollbar.tcl \
- scrollset.tcl \
- tabset.tcl \
- treeview.tcl \
- tclIndex \
- $(cursors)
-
-ddFiles = dd-color.tcl \
- dd-file.tcl \
- dd-number.tcl \
- dd-text.tcl \
- tclIndex
-
-all: pkgIndex
-
-pkgIndex:
- rm -f pkgIndex.tcl
- sed -e 's/%VERSION%/$(version)/' $(srcdir)/pkgIndex.tcl.in | \
- sed -e 's/%SO_PREFIX%/$(so_prefix)/' | \
- sed -e 's/%LIB_SUFFIX%/$(lib_suffix)/' | \
- sed -e 's/%SO_EXT%/$(so_ext)/' | \
- sed -e 's;%LIB_DIR%;$(libdir);' > pkgIndex.tcl
-
-
-install: mkdirs pkgIndex
- for i in $(ddFiles) ; do \
- $(INSTALL_DATA) $(srcdir)/dd_protocols/$$i \
- $(DESTDIR)$(pkgdir)/dd_protocols ; \
- done
- for i in $(libraryFiles) ; do \
- $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(pkgdir) ; \
- done
- $(INSTALL_DATA) pkgIndex.tcl $(pkgdir)
- $(MAKE) -C afm install
-
-mkdirs:
- $(MKDIR_P) $(DESTDIR)/$(pkgdir)
- $(MKDIR_P) $(DESTDIR)/$(pkgdir)/dd_protocols
-
-clean:
- $(RM) pkgIndex.tcl
-
-distclean: clean
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"* Makefile
diff --git a/blt3.0.1/library/Makefile.vc b/blt3.0.1/library/Makefile.vc
deleted file mode 100644
index 0034233..0000000
--- a/blt3.0.1/library/Makefile.vc
+++ /dev/null
@@ -1,71 +0,0 @@
-
-# ------------------------------------------------------------------------
-# Makefile for library files and directories of BLT library
-# ------------------------------------------------------------------------
-
-include ../vc.config
-srcdir = ../$(TOP)/library
-
-version = $(BLT_MAJOR_VERSION).$(BLT_MINOR_VERSION)
-pkgdir = $(libdir)/tcl$(v1)/blt$(version)
-
-cursors = treeview.cur
-
-miscFiles = bltCanvEps.pro \
- bltGraph.pro \
- dnd.tcl \
- dragdrop.tcl \
- graph.tcl \
- hierbox.tcl \
- tabnotebook.tcl \
- tabset.tcl \
- treeview.tcl \
- tclIndex \
- $(cursors)
-
-ddFiles = dd-color.tcl \
- dd-file.tcl \
- dd-number.tcl \
- dd-text.tcl \
- tclIndex
-
-instdirs = $(prefix) $(exec_prefix) $(libdir) \
- $(scriptdir) $(scriptdir)/dd_protocols $(libdir)/tcl$(v1) \
- $(pkgdir)
-
-all: pkgIndex.tcl
-
-install: install-dirs install-ddfiles install-files install-pkgindex
-
-install-dirs:
- @for i in $(instdirs) ; do \
- if test -d "$$i" ; then : ; else mkdir "$$i" ; fi ; \
- done
-
-install-ddfiles: install-dirs
- for i in $(ddFiles) ; do \
- $(INSTALL_DATA) $(srcdir)/dd_protocols/$$i $(scriptdir)/dd_protocols ; \
- done
-
-install-files: install-dirs
- for i in $(miscFiles) ; do \
- $(INSTALL_DATA) $(srcdir)/$$i $(scriptdir) ; \
- done
-
-
-pkgIndex.tcl: $(srcdir)/pkgIndex.tcl.in
- rm -f pkgIndex.tcl
- sed -e 's/%VERSION%/$(version)/' $(srcdir)/pkgIndex.tcl.in | \
- sed -e 's/%LIB_PREFIX%//' | \
- sed -e 's;%LIB_DIR%;$(libdir);' > pkgIndex.tcl
-
-install-pkgindex: pkgIndex.tcl
- $(INSTALL_DATA) pkgIndex.tcl $(scriptdir)
- $(INSTALL_DATA) pkgIndex.tcl $(pkgdir)
-
-clean:
- $(RM) pkgIndex.tcl
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"*
-
-distclean: clean
- $(RM) Makefile
diff --git a/blt3.0.1/library/ZoomStack.itcl b/blt3.0.1/library/ZoomStack.itcl
deleted file mode 100644
index 09601d7..0000000
--- a/blt3.0.1/library/ZoomStack.itcl
+++ /dev/null
@@ -1,359 +0,0 @@
-import add itcl
-
-class ZoomStackGraph {
-
- # The name of graph (nee the namespace path)
- variable graph ""
-
- # Indicates which corner of the rectangular zoom region
- # is currently being choosen.
- variable corner "first"
-
- # Coordinates of the current zoom region. They represent the
- # two corners of a rectangular area. The two points are order
- # independent.
- variable x1
- variable y1
- variable x2
- variable y2
-
- # A list of axis configuration commmands. Acts as a stack to
- # unzoom the graph back to previous axis limits.
- variable stack {}
-
- constructor { args } {
- # This will need to change when we start using inheritance.
- set graph [info namespace tail $this]
-
- # What about collisions between the blt::graph instance
- # command and the ZoomStackGraph instance command?
- blt::graph $graph
-
- if { [llength $args] > 0 } {
- $graph configure $args
- }
- # Set up the bindings to select/deselect the zoom region
- bind $graph <1> [code $this SelectPoint %x %y]
- bind $graph <3> [code $this ClearZoom]
- # The particular mouse buttons should be configurable.
- }
- destructor {
- if { [winfo exists $graph] } {
- destroy $graph
- }
- }
-
- # These methods are used internally, within this class, to manage the
- # zoom stack.
- private method SaveCoords { x y }
- private method Zoom {}
- private method Unzoom {}
- private method Push { cmd }
- private method Pop {}
- private method MarkPoint { x y }
- private method SetTitle { title }
- private method DrawBox { }
-
- # These methods are called by "bind" and "after" from the Tk
- # event loop. Is there any way of hiding them, so that it
- # doesn't look to the user as part of the public interface?
- method ClearZoom {}
- method ClearTitle {}
- method UpdateOutline { x y }
- method SelectPoint { x y }
-}
-
-# ----------------------------------------------------------------------
-#
-# SaveCoords --
-#
-# Given a point on the screen, transforms the point into graph
-# coordinates and saves it as one of the points representing a
-# corner of the zoom region.
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::SaveCoords { x y } {
-
- set coords [$graph invtransform $x $y]
- set x [lindex $coords 0]
- set y [lindex $coords 1]
-
- scan [$graph xaxis limits] "%s %s" min max
- if { $x > $max } {
- set x $max
- } elseif { $x < $min } {
- set x $min
- }
-
- scan [$graph yaxis limits] "%s %s" min max
- if { $y > $max } {
- set y $max
- } elseif { $y < $min } {
- set y $min
- }
-
- if { $corner == "first" } {
- set x1 $x ; set y1 $y
- } else {
- set x2 $x ; set y2 $y
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# MarkPoint --
-#
-# Adds text around one of the corners of the zoom region.
-# The text consists of the x,y graph coordinates of the
-# corner.
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::MarkPoint { x y } {
-
- set marker "bltZoom_text_$corner"
- set text [format "x=%.4g\ny=%.4g" $x $y]
-
- if [$graph marker exists $marker] {
- $graph marker configure $marker -coords { $x $y } -text $text
- } else {
- $graph marker create text -coords { $x $y } -name $marker \
- -font *lucida*-r-*-10-* \
- -text $text -anchor center -bg {} -justify left
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# Empty --
-#
-# Indicates if the stack of axis configuration commands is
-# empty.
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::Empty { } {
- return [llength $stack]
-}
-
-
-# ----------------------------------------------------------------------
-#
-# Push --
-#
-# Appends a command on the list "stack" which can be used
-# to return to previous graph x and y axis ranges.
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::Push { cmd } {
- lappend stack $cmd
-}
-
-# ----------------------------------------------------------------------
-#
-# Pop --
-#
-# Remove the last item pushed onto the stack and returns it.
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::Pop { } {
- set cmd [lindex $stack end]
- set stack [lreplace $stack end end]
- return $cmd
-}
-
-# ----------------------------------------------------------------------
-#
-# ClearTitle --
-#
-# Clears the zoom title (displayed in the upper left corner
-# of the graph). This routine is called from the event queue
-# using "after".
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::ClearTitle {} {
- $graph marker delete "bltZoom_title"
-}
-
-# ----------------------------------------------------------------------
-#
-# Unzoom --
-#
-# Reverts to a previous zoom. Resets the x and y axis limits
-# back to a previous setting. First checks if there's anything
-# to pop back to. In addition, displays a title in the upper
-# left corner showing the current zoom level.
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::Unzoom { } {
-
- if ![Empty] {
-
- # Reset the x and y axis limits, by invoking the saved graph
- # command.
- eval [Pop]
-
- # Cheat: Using "Empty" to get the number of entries on the stack.
- set level [Empty]
- if { $level > 0 } {
- SetTitle "Zoom #$level"
- }
-
- blt::busy hold $graph
- update
- if { $corner == "first" } {
- # Remember to remove the zoom title in a couple of seconds
- after 2000 [code $this ClearTitle]
- }
- blt::busy release $graph
- } else {
- $graph marker delete "bltZoom_title"
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# Zoom --
-#
-# Push the old axis limits on the stack and set them to the
-# zoom region.
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::Zoom { } {
- $graph marker delete "bltZoom_*"
-
- if { ($x1 == $x2) && ($y1 == $y2) } {
- # The first and last points of the zoom region are the same.
- # Revert back to the start.
- return
- }
-
- # Put a command on the stack that lets us revert back to the current
- # axis limits.
- set cmd [format {
- %s xaxis configure -min "%s" -max "%s"
- %s yaxis configure -min "%s" -max "%s"
- } $graph [$graph xaxis cget -min] [$graph xaxis cget -max] \
- $graph [$graph yaxis cget -min] [$graph yaxis cget -max] ]
- Push $cmd
-
- # The first and last corners of the zoom region don't have to be
- # selected in ascending order. So consider their relative positions
- # when setting min and max axis limits.
-
- if { $x1 > $x2 } {
- $graph xaxis configure -min $x2 -max $x1
- } elseif { $x1 < $x2 } {
- $graph xaxis configure -min $x1 -max $x2
- }
- if { $y1 > $y2 } {
- $graph yaxis configure -min $y2 -max $y1
- } elseif { $y1 < $y2 } {
- $graph yaxis configure -min $y1 -max $y2
- }
-
- # Call "update" explicitly here after the graph is made busy.
- # This prevents the user from inadvertantly selecting another zoom
- # region when the graph is recalculating and redrawing itself.
-
- blt::busy hold $graph
- update
- blt::busy release $graph
-}
-
-# ----------------------------------------------------------------------
-#
-# ClearZoom --
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::ClearZoom { } {
-
- $graph marker delete "bltZoom_*"
- if { $corner == "first" } {
- # We're haven't started to select a zoom region, so assume
- # that we want to revert back to a previous zoom level.
- Unzoom
- } else {
- # Let the user re-pick the first corner again. So reset the
- # indicator "corner" and turn off the <Motion> binding.
- set corner "first"
- bind $graph <Motion> {}
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# SetTitle --
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::SetTitle { title } {
-
- $graph marker create text -name "bltZoom_title" -text $title \
- -coords {-Inf Inf} -anchor nw -bg {}
-}
-
-# ----------------------------------------------------------------------
-#
-# UpdateOutline --
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::UpdateOutline { x y } {
- SaveCoords $x $y
- MarkPoint $x2 $y2
- DrawBox
-}
-
-# ----------------------------------------------------------------------
-#
-# SelectPoint --
-#
-# Invoked from the binding to ButtonPress-1 events. Saves
-# a corner of zoom region.
-#
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::SelectPoint { x y } {
-
- SaveCoords $x $y
- if { $corner == "first" } {
- MarkPoint $x1 $y1
-
- # Display a new title indicating zoom pick is active
- set level [expr [llength $stack] + 1]
- SetTitle "Zoom #$level"
-
- # Start watching now for motion events, drawing an outline
- bind $graph <Any-Motion> [code $this UpdateOutline %x %y]
-
- # Indicate the next corner is the last
- set corner last
- } else {
-
- # Stop watching motion events
- bind $graph <Any-Motion> {}
-
- # Zoom into the new region defined by the outline
- Zoom
-
- # Reset to select the first corner, again
- set corner first
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# DrawBox --
-#
-# ----------------------------------------------------------------------
-body ZoomStackGraph::DrawBox { } {
-
- set coords {
- $x1 $y1 $x2 $y1 $x2 $y2 $x1 $y2 $x1 $y1
- }
- if [$graph marker exists "bltZoom_outline"] {
- $graph marker configure "bltZoom_outline" -coords $coords
- } else {
- $graph marker create line -coords $coords -name "bltZoom_outline" \
- -dashes { 4 2 }
- }
- $graph marker before "bltZoom_outline"
-}
-
diff --git a/blt3.0.1/library/afm/AvantGarde-Book.afm b/blt3.0.1/library/afm/AvantGarde-Book.afm
deleted file mode 100644
index 1e60fee..0000000
--- a/blt3.0.1/library/afm/AvantGarde-Book.afm
+++ /dev/null
@@ -1,574 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Mon Mar 4 13:37:31 1991
-Comment UniqueID 34364
-Comment VMusage 24225 31117
-FontName AvantGarde-Book
-FullName ITC Avant Garde Gothic Book
-FamilyName ITC Avant Garde Gothic
-Weight Book
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -113 -222 1148 955
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.006
-Notice Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.ITC Avant Garde Gothic is a registered trademark of International Typeface Corporation.
-EncodingScheme AdobeStandardEncoding
-CapHeight 740
-XHeight 547
-Ascender 740
-Descender -192
-StartCharMetrics 228
-C 32 ; WX 277 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 295 ; N exclam ; B 111 0 185 740 ;
-C 34 ; WX 309 ; N quotedbl ; B 36 444 273 740 ;
-C 35 ; WX 554 ; N numbersign ; B 33 0 521 740 ;
-C 36 ; WX 554 ; N dollar ; B 70 -70 485 811 ;
-C 37 ; WX 775 ; N percent ; B 21 -13 753 751 ;
-C 38 ; WX 757 ; N ampersand ; B 56 -12 736 753 ;
-C 39 ; WX 351 ; N quoteright ; B 94 546 256 740 ;
-C 40 ; WX 369 ; N parenleft ; B 47 -205 355 757 ;
-C 41 ; WX 369 ; N parenright ; B 14 -205 322 757 ;
-C 42 ; WX 425 ; N asterisk ; B 58 446 367 740 ;
-C 43 ; WX 606 ; N plus ; B 51 0 555 506 ;
-C 44 ; WX 277 ; N comma ; B 14 -67 176 126 ;
-C 45 ; WX 332 ; N hyphen ; B 30 248 302 315 ;
-C 46 ; WX 277 ; N period ; B 102 0 176 126 ;
-C 47 ; WX 437 ; N slash ; B 44 -100 403 740 ;
-C 48 ; WX 554 ; N zero ; B 29 -13 525 753 ;
-C 49 ; WX 554 ; N one ; B 135 0 336 740 ;
-C 50 ; WX 554 ; N two ; B 40 0 514 753 ;
-C 51 ; WX 554 ; N three ; B 34 -13 506 753 ;
-C 52 ; WX 554 ; N four ; B 14 0 528 740 ;
-C 53 ; WX 554 ; N five ; B 26 -13 530 740 ;
-C 54 ; WX 554 ; N six ; B 24 -13 530 739 ;
-C 55 ; WX 554 ; N seven ; B 63 0 491 740 ;
-C 56 ; WX 554 ; N eight ; B 41 -13 513 753 ;
-C 57 ; WX 554 ; N nine ; B 24 0 530 752 ;
-C 58 ; WX 277 ; N colon ; B 102 0 176 548 ;
-C 59 ; WX 277 ; N semicolon ; B 14 -67 176 548 ;
-C 60 ; WX 606 ; N less ; B 46 -8 554 514 ;
-C 61 ; WX 606 ; N equal ; B 51 118 555 388 ;
-C 62 ; WX 606 ; N greater ; B 52 -8 560 514 ;
-C 63 ; WX 591 ; N question ; B 64 0 526 752 ;
-C 64 ; WX 867 ; N at ; B 65 -13 803 753 ;
-C 65 ; WX 740 ; N A ; B 12 0 729 740 ;
-C 66 ; WX 574 ; N B ; B 74 0 544 740 ;
-C 67 ; WX 813 ; N C ; B 43 -13 771 752 ;
-C 68 ; WX 744 ; N D ; B 74 0 699 740 ;
-C 69 ; WX 536 ; N E ; B 70 0 475 740 ;
-C 70 ; WX 485 ; N F ; B 70 0 444 740 ;
-C 71 ; WX 872 ; N G ; B 40 -13 828 753 ;
-C 72 ; WX 683 ; N H ; B 76 0 607 740 ;
-C 73 ; WX 226 ; N I ; B 76 0 150 740 ;
-C 74 ; WX 482 ; N J ; B 6 -13 402 740 ;
-C 75 ; WX 591 ; N K ; B 81 0 591 740 ;
-C 76 ; WX 462 ; N L ; B 82 0 462 740 ;
-C 77 ; WX 919 ; N M ; B 76 0 843 740 ;
-C 78 ; WX 740 ; N N ; B 75 0 664 740 ;
-C 79 ; WX 869 ; N O ; B 43 -13 826 753 ;
-C 80 ; WX 592 ; N P ; B 75 0 564 740 ;
-C 81 ; WX 871 ; N Q ; B 40 -13 837 753 ;
-C 82 ; WX 607 ; N R ; B 70 0 572 740 ;
-C 83 ; WX 498 ; N S ; B 22 -13 473 753 ;
-C 84 ; WX 426 ; N T ; B 6 0 419 740 ;
-C 85 ; WX 655 ; N U ; B 75 -13 579 740 ;
-C 86 ; WX 702 ; N V ; B 8 0 693 740 ;
-C 87 ; WX 960 ; N W ; B 11 0 950 740 ;
-C 88 ; WX 609 ; N X ; B 8 0 602 740 ;
-C 89 ; WX 592 ; N Y ; B 1 0 592 740 ;
-C 90 ; WX 480 ; N Z ; B 12 0 470 740 ;
-C 91 ; WX 351 ; N bracketleft ; B 133 -179 337 753 ;
-C 92 ; WX 605 ; N backslash ; B 118 -100 477 740 ;
-C 93 ; WX 351 ; N bracketright ; B 14 -179 218 753 ;
-C 94 ; WX 606 ; N asciicircum ; B 53 307 553 740 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 351 ; N quoteleft ; B 95 546 257 740 ;
-C 97 ; WX 683 ; N a ; B 42 -13 621 561 ;
-C 98 ; WX 682 ; N b ; B 68 -13 647 740 ;
-C 99 ; WX 647 ; N c ; B 41 -13 607 561 ;
-C 100 ; WX 685 ; N d ; B 39 -13 618 740 ;
-C 101 ; WX 650 ; N e ; B 38 -13 608 561 ;
-C 102 ; WX 314 ; N f ; B 19 0 314 753 ; L i fi ; L l fl ;
-C 103 ; WX 673 ; N g ; B 37 -215 606 561 ;
-C 104 ; WX 610 ; N h ; B 62 0 543 740 ;
-C 105 ; WX 200 ; N i ; B 65 0 135 740 ;
-C 106 ; WX 203 ; N j ; B -44 -192 137 740 ;
-C 107 ; WX 502 ; N k ; B 70 0 498 740 ;
-C 108 ; WX 200 ; N l ; B 65 0 135 740 ;
-C 109 ; WX 938 ; N m ; B 66 0 872 561 ;
-C 110 ; WX 610 ; N n ; B 65 0 546 561 ;
-C 111 ; WX 655 ; N o ; B 42 -13 614 561 ;
-C 112 ; WX 682 ; N p ; B 64 -192 643 561 ;
-C 113 ; WX 682 ; N q ; B 37 -192 616 561 ;
-C 114 ; WX 301 ; N r ; B 65 0 291 561 ;
-C 115 ; WX 388 ; N s ; B 24 -13 364 561 ;
-C 116 ; WX 339 ; N t ; B 14 0 330 740 ;
-C 117 ; WX 608 ; N u ; B 62 -13 541 547 ;
-C 118 ; WX 554 ; N v ; B 7 0 546 547 ;
-C 119 ; WX 831 ; N w ; B 13 0 820 547 ;
-C 120 ; WX 480 ; N x ; B 12 0 468 547 ;
-C 121 ; WX 536 ; N y ; B 15 -192 523 547 ;
-C 122 ; WX 425 ; N z ; B 10 0 415 547 ;
-C 123 ; WX 351 ; N braceleft ; B 70 -189 331 740 ;
-C 124 ; WX 672 ; N bar ; B 299 -100 373 740 ;
-C 125 ; WX 351 ; N braceright ; B 20 -189 281 740 ;
-C 126 ; WX 606 ; N asciitilde ; B 72 179 534 319 ;
-C 161 ; WX 295 ; N exclamdown ; B 110 -192 184 548 ;
-C 162 ; WX 554 ; N cent ; B 48 62 510 707 ;
-C 163 ; WX 554 ; N sterling ; B 4 0 552 753 ;
-C 164 ; WX 166 ; N fraction ; B -113 0 280 740 ;
-C 165 ; WX 554 ; N yen ; B 4 0 550 740 ;
-C 166 ; WX 554 ; N florin ; B -12 -153 518 818 ;
-C 167 ; WX 615 ; N section ; B 85 -141 529 753 ;
-C 168 ; WX 554 ; N currency ; B 8 42 546 580 ;
-C 169 ; WX 198 ; N quotesingle ; B 59 444 140 740 ;
-C 170 ; WX 502 ; N quotedblleft ; B 97 546 406 740 ;
-C 171 ; WX 425 ; N guillemotleft ; B 40 81 386 481 ;
-C 172 ; WX 251 ; N guilsinglleft ; B 40 81 212 481 ;
-C 173 ; WX 251 ; N guilsinglright ; B 39 81 211 481 ;
-C 174 ; WX 487 ; N fi ; B 19 0 422 753 ;
-C 175 ; WX 485 ; N fl ; B 19 0 420 753 ;
-C 177 ; WX 500 ; N endash ; B 35 248 465 315 ;
-C 178 ; WX 553 ; N dagger ; B 59 -133 493 740 ;
-C 179 ; WX 553 ; N daggerdbl ; B 59 -133 493 740 ;
-C 180 ; WX 277 ; N periodcentered ; B 102 190 176 316 ;
-C 182 ; WX 564 ; N paragraph ; B 22 -110 551 740 ;
-C 183 ; WX 606 ; N bullet ; B 150 222 455 532 ;
-C 184 ; WX 354 ; N quotesinglbase ; B 89 -68 251 126 ;
-C 185 ; WX 502 ; N quotedblbase ; B 89 -68 399 126 ;
-C 186 ; WX 484 ; N quotedblright ; B 96 546 405 740 ;
-C 187 ; WX 425 ; N guillemotright ; B 39 81 385 481 ;
-C 188 ; WX 1000 ; N ellipsis ; B 130 0 870 126 ;
-C 189 ; WX 1174 ; N perthousand ; B 25 -13 1148 751 ;
-C 191 ; WX 591 ; N questiondown ; B 65 -205 527 548 ;
-C 193 ; WX 378 ; N grave ; B 69 619 300 786 ;
-C 194 ; WX 375 ; N acute ; B 78 619 309 786 ;
-C 195 ; WX 502 ; N circumflex ; B 74 639 428 764 ;
-C 196 ; WX 439 ; N tilde ; B 47 651 392 754 ;
-C 197 ; WX 485 ; N macron ; B 73 669 411 736 ;
-C 198 ; WX 453 ; N breve ; B 52 651 401 754 ;
-C 199 ; WX 222 ; N dotaccent ; B 74 639 148 765 ;
-C 200 ; WX 369 ; N dieresis ; B 73 639 295 765 ;
-C 202 ; WX 332 ; N ring ; B 62 600 269 807 ;
-C 203 ; WX 324 ; N cedilla ; B 80 -222 254 0 ;
-C 205 ; WX 552 ; N hungarumlaut ; B 119 605 453 800 ;
-C 206 ; WX 302 ; N ogonek ; B 73 -191 228 0 ;
-C 207 ; WX 502 ; N caron ; B 68 639 423 764 ;
-C 208 ; WX 1000 ; N emdash ; B 35 248 965 315 ;
-C 225 ; WX 992 ; N AE ; B -20 0 907 740 ;
-C 227 ; WX 369 ; N ordfeminine ; B -3 407 356 753 ;
-C 232 ; WX 517 ; N Lslash ; B 59 0 517 740 ;
-C 233 ; WX 868 ; N Oslash ; B 43 -83 826 819 ;
-C 234 ; WX 1194 ; N OE ; B 45 -13 1142 753 ;
-C 235 ; WX 369 ; N ordmasculine ; B 12 407 356 753 ;
-C 241 ; WX 1157 ; N ae ; B 34 -13 1113 561 ;
-C 245 ; WX 200 ; N dotlessi ; B 65 0 135 547 ;
-C 248 ; WX 300 ; N lslash ; B 43 0 259 740 ;
-C 249 ; WX 653 ; N oslash ; B 41 -64 613 614 ;
-C 250 ; WX 1137 ; N oe ; B 34 -13 1104 561 ;
-C 251 ; WX 554 ; N germandbls ; B 61 -13 525 753 ;
-C -1 ; WX 650 ; N ecircumflex ; B 38 -13 608 764 ;
-C -1 ; WX 650 ; N edieresis ; B 38 -13 608 765 ;
-C -1 ; WX 683 ; N aacute ; B 42 -13 621 786 ;
-C -1 ; WX 747 ; N registered ; B -9 -12 755 752 ;
-C -1 ; WX 200 ; N icircumflex ; B -77 0 277 764 ;
-C -1 ; WX 608 ; N udieresis ; B 62 -13 541 765 ;
-C -1 ; WX 655 ; N ograve ; B 42 -13 614 786 ;
-C -1 ; WX 608 ; N uacute ; B 62 -13 541 786 ;
-C -1 ; WX 608 ; N ucircumflex ; B 62 -13 541 764 ;
-C -1 ; WX 740 ; N Aacute ; B 12 0 729 949 ;
-C -1 ; WX 200 ; N igrave ; B -60 0 171 786 ;
-C -1 ; WX 226 ; N Icircumflex ; B -64 0 290 927 ;
-C -1 ; WX 647 ; N ccedilla ; B 41 -222 607 561 ;
-C -1 ; WX 683 ; N adieresis ; B 42 -13 621 765 ;
-C -1 ; WX 536 ; N Ecircumflex ; B 70 0 475 927 ;
-C -1 ; WX 388 ; N scaron ; B 11 -13 366 764 ;
-C -1 ; WX 682 ; N thorn ; B 64 -192 643 740 ;
-C -1 ; WX 1000 ; N trademark ; B 9 296 816 740 ;
-C -1 ; WX 650 ; N egrave ; B 38 -13 608 786 ;
-C -1 ; WX 332 ; N threesuperior ; B 18 289 318 747 ;
-C -1 ; WX 425 ; N zcaron ; B 10 0 415 764 ;
-C -1 ; WX 683 ; N atilde ; B 42 -13 621 754 ;
-C -1 ; WX 683 ; N aring ; B 42 -13 621 807 ;
-C -1 ; WX 655 ; N ocircumflex ; B 42 -13 614 764 ;
-C -1 ; WX 536 ; N Edieresis ; B 70 0 475 928 ;
-C -1 ; WX 831 ; N threequarters ; B 46 0 784 747 ;
-C -1 ; WX 536 ; N ydieresis ; B 15 -192 523 765 ;
-C -1 ; WX 536 ; N yacute ; B 15 -192 523 786 ;
-C -1 ; WX 200 ; N iacute ; B 31 0 262 786 ;
-C -1 ; WX 740 ; N Acircumflex ; B 12 0 729 927 ;
-C -1 ; WX 655 ; N Uacute ; B 75 -13 579 949 ;
-C -1 ; WX 650 ; N eacute ; B 38 -13 608 786 ;
-C -1 ; WX 869 ; N Ograve ; B 43 -13 826 949 ;
-C -1 ; WX 683 ; N agrave ; B 42 -13 621 786 ;
-C -1 ; WX 655 ; N Udieresis ; B 75 -13 579 928 ;
-C -1 ; WX 683 ; N acircumflex ; B 42 -13 621 764 ;
-C -1 ; WX 226 ; N Igrave ; B -47 0 184 949 ;
-C -1 ; WX 332 ; N twosuperior ; B 19 296 318 747 ;
-C -1 ; WX 655 ; N Ugrave ; B 75 -13 579 949 ;
-C -1 ; WX 831 ; N onequarter ; B 100 0 729 740 ;
-C -1 ; WX 655 ; N Ucircumflex ; B 75 -13 579 927 ;
-C -1 ; WX 498 ; N Scaron ; B 22 -13 473 927 ;
-C -1 ; WX 226 ; N Idieresis ; B 2 0 224 928 ;
-C -1 ; WX 200 ; N idieresis ; B -11 0 211 765 ;
-C -1 ; WX 536 ; N Egrave ; B 70 0 475 949 ;
-C -1 ; WX 869 ; N Oacute ; B 43 -13 826 949 ;
-C -1 ; WX 606 ; N divide ; B 51 -13 555 519 ;
-C -1 ; WX 740 ; N Atilde ; B 12 0 729 917 ;
-C -1 ; WX 740 ; N Aring ; B 12 0 729 955 ;
-C -1 ; WX 869 ; N Odieresis ; B 43 -13 826 928 ;
-C -1 ; WX 740 ; N Adieresis ; B 12 0 729 928 ;
-C -1 ; WX 740 ; N Ntilde ; B 75 0 664 917 ;
-C -1 ; WX 480 ; N Zcaron ; B 12 0 470 927 ;
-C -1 ; WX 592 ; N Thorn ; B 60 0 549 740 ;
-C -1 ; WX 226 ; N Iacute ; B 44 0 275 949 ;
-C -1 ; WX 606 ; N plusminus ; B 51 -24 555 518 ;
-C -1 ; WX 606 ; N multiply ; B 74 24 533 482 ;
-C -1 ; WX 536 ; N Eacute ; B 70 0 475 949 ;
-C -1 ; WX 592 ; N Ydieresis ; B 1 0 592 928 ;
-C -1 ; WX 332 ; N onesuperior ; B 63 296 198 740 ;
-C -1 ; WX 608 ; N ugrave ; B 62 -13 541 786 ;
-C -1 ; WX 606 ; N logicalnot ; B 51 109 555 388 ;
-C -1 ; WX 610 ; N ntilde ; B 65 0 546 754 ;
-C -1 ; WX 869 ; N Otilde ; B 43 -13 826 917 ;
-C -1 ; WX 655 ; N otilde ; B 42 -13 614 754 ;
-C -1 ; WX 813 ; N Ccedilla ; B 43 -222 771 752 ;
-C -1 ; WX 740 ; N Agrave ; B 12 0 729 949 ;
-C -1 ; WX 831 ; N onehalf ; B 81 0 750 740 ;
-C -1 ; WX 790 ; N Eth ; B 40 0 739 740 ;
-C -1 ; WX 400 ; N degree ; B 56 421 344 709 ;
-C -1 ; WX 592 ; N Yacute ; B 1 0 592 949 ;
-C -1 ; WX 869 ; N Ocircumflex ; B 43 -13 826 927 ;
-C -1 ; WX 655 ; N oacute ; B 42 -13 614 786 ;
-C -1 ; WX 608 ; N mu ; B 80 -184 527 547 ;
-C -1 ; WX 606 ; N minus ; B 51 219 555 287 ;
-C -1 ; WX 655 ; N eth ; B 42 -12 614 753 ;
-C -1 ; WX 655 ; N odieresis ; B 42 -13 614 765 ;
-C -1 ; WX 747 ; N copyright ; B -9 -12 755 752 ;
-C -1 ; WX 672 ; N brokenbar ; B 299 -100 373 740 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 216
-
-KPX A y -62
-KPX A w -65
-KPX A v -70
-KPX A u -20
-KPX A quoteright -100
-KPX A quotedblright -100
-KPX A Y -92
-KPX A W -60
-KPX A V -102
-KPX A U -40
-KPX A T -45
-KPX A Q -40
-KPX A O -50
-KPX A G -40
-KPX A C -40
-
-KPX B A -10
-
-KPX C A -40
-
-KPX D period -20
-KPX D comma -20
-KPX D Y -30
-KPX D W -10
-KPX D V -50
-KPX D A -50
-
-KPX F period -160
-KPX F e -20
-KPX F comma -180
-KPX F a -20
-KPX F A -75
-
-KPX G period -20
-KPX G comma -20
-KPX G Y -20
-
-KPX J period -15
-KPX J a -20
-KPX J A -30
-
-KPX K o -15
-KPX K e -20
-KPX K O -20
-
-KPX L y -23
-KPX L quoteright -130
-KPX L quotedblright -130
-KPX L Y -91
-KPX L W -67
-KPX L V -113
-KPX L T -46
-
-KPX O period -30
-KPX O comma -30
-KPX O Y -30
-KPX O X -30
-KPX O W -20
-KPX O V -60
-KPX O T -30
-KPX O A -60
-
-KPX P period -300
-KPX P o -60
-KPX P e -20
-KPX P comma -280
-KPX P a -20
-KPX P A -114
-
-KPX Q comma 20
-
-KPX R Y -10
-KPX R W 10
-KPX R V -10
-KPX R T 6
-
-KPX S comma 20
-
-KPX T y -50
-KPX T w -55
-KPX T u -46
-KPX T semicolon -29
-KPX T r -30
-KPX T period -91
-KPX T o -70
-KPX T i 10
-KPX T hyphen -75
-KPX T e -49
-KPX T comma -82
-KPX T colon -15
-KPX T a -90
-KPX T O -30
-KPX T A -45
-
-KPX U period -20
-KPX U comma -20
-KPX U A -40
-
-KPX V u -40
-KPX V semicolon -33
-KPX V period -165
-KPX V o -101
-KPX V i -5
-KPX V hyphen -75
-KPX V e -101
-KPX V comma -145
-KPX V colon -18
-KPX V a -104
-KPX V O -60
-KPX V G -20
-KPX V A -102
-
-KPX W y -2
-KPX W u -30
-KPX W semicolon -33
-KPX W period -106
-KPX W o -46
-KPX W i 6
-KPX W hyphen -35
-KPX W e -47
-KPX W comma -106
-KPX W colon -15
-KPX W a -50
-KPX W O -20
-KPX W A -58
-
-KPX Y u -52
-KPX Y semicolon -23
-KPX Y period -175
-KPX Y o -89
-KPX Y hyphen -85
-KPX Y e -89
-KPX Y comma -145
-KPX Y colon -10
-KPX Y a -93
-KPX Y O -30
-KPX Y A -92
-
-KPX a p 20
-KPX a b 20
-
-KPX b y -20
-KPX b v -20
-
-KPX c y -20
-KPX c k -15
-
-KPX comma space -110
-KPX comma quoteright -120
-KPX comma quotedblright -120
-
-KPX e y -20
-KPX e w -20
-KPX e v -20
-
-KPX f period -50
-KPX f o -40
-KPX f l -30
-KPX f i -34
-KPX f f -60
-KPX f e -20
-KPX f dotlessi -34
-KPX f comma -50
-KPX f a -40
-
-KPX g a -15
-
-KPX h y -30
-
-KPX k y -5
-KPX k e -15
-
-KPX m y -20
-KPX m u -20
-KPX m a -20
-
-KPX n y -15
-KPX n v -20
-
-KPX o y -20
-KPX o x -15
-KPX o w -20
-KPX o v -30
-
-KPX p y -20
-
-KPX period space -110
-KPX period quoteright -120
-KPX period quotedblright -120
-
-KPX quotedblleft quoteleft -35
-KPX quotedblleft A -100
-
-KPX quotedblright space -110
-
-KPX quoteleft quoteleft -203
-KPX quoteleft A -100
-
-KPX quoteright v -30
-KPX quoteright t 10
-KPX quoteright space -110
-KPX quoteright s -15
-KPX quoteright r -20
-KPX quoteright quoteright -203
-KPX quoteright quotedblright -35
-KPX quoteright d -110
-
-KPX r y 40
-KPX r v 40
-KPX r u 20
-KPX r t 20
-KPX r s 20
-KPX r q -8
-KPX r period -73
-KPX r p 20
-KPX r o -20
-KPX r n 21
-KPX r m 28
-KPX r l 20
-KPX r k 20
-KPX r i 20
-KPX r hyphen -60
-KPX r g -15
-KPX r e -4
-KPX r d -6
-KPX r comma -75
-KPX r c -20
-KPX r a -20
-
-KPX s period 20
-KPX s comma 20
-
-KPX space quoteleft -110
-KPX space quotedblleft -110
-KPX space Y -60
-KPX space W -25
-KPX space V -50
-KPX space T -25
-KPX space A -20
-
-KPX v period -130
-KPX v o -30
-KPX v e -20
-KPX v comma -100
-KPX v a -30
-
-KPX w period -100
-KPX w o -30
-KPX w h 15
-KPX w e -20
-KPX w comma -90
-KPX w a -30
-
-KPX y period -125
-KPX y o -30
-KPX y e -20
-KPX y comma -110
-KPX y a -30
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 183 163 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 119 163 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 186 163 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 181 163 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 204 148 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 151 163 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 81 163 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 17 163 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 84 163 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 79 163 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute -34 163 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -138 163 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -71 163 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave -116 163 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 151 163 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 247 163 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 184 163 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 250 163 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 246 163 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 215 163 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron -2 163 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 160 163 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 77 163 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 143 163 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 119 163 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 129 163 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 112 163 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron -11 163 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 154 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 91 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 157 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 153 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 176 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 122 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 138 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 74 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 141 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 136 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -47 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -151 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -84 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -129 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 86 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 140 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 77 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 143 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 139 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 108 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron -57 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 137 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 53 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 120 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 95 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 101 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron -38 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/AvantGarde-BookOblique.afm b/blt3.0.1/library/afm/AvantGarde-BookOblique.afm
deleted file mode 100644
index ca315b5..0000000
--- a/blt3.0.1/library/afm/AvantGarde-BookOblique.afm
+++ /dev/null
@@ -1,574 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Mon Mar 4 13:41:11 1991
-Comment UniqueID 34367
-Comment VMusage 6555 39267
-FontName AvantGarde-BookOblique
-FullName ITC Avant Garde Gothic Book Oblique
-FamilyName ITC Avant Garde Gothic
-Weight Book
-ItalicAngle -10.5
-IsFixedPitch false
-FontBBox -113 -222 1279 955
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.006
-Notice Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.ITC Avant Garde Gothic is a registered trademark of International Typeface Corporation.
-EncodingScheme AdobeStandardEncoding
-CapHeight 740
-XHeight 547
-Ascender 740
-Descender -192
-StartCharMetrics 228
-C 32 ; WX 277 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 295 ; N exclam ; B 111 0 322 740 ;
-C 34 ; WX 309 ; N quotedbl ; B 130 444 410 740 ;
-C 35 ; WX 554 ; N numbersign ; B 71 0 620 740 ;
-C 36 ; WX 554 ; N dollar ; B 107 -70 581 811 ;
-C 37 ; WX 775 ; N percent ; B 124 -13 787 751 ;
-C 38 ; WX 757 ; N ampersand ; B 92 -12 775 753 ;
-C 39 ; WX 351 ; N quoteright ; B 195 546 393 740 ;
-C 40 ; WX 369 ; N parenleft ; B 89 -205 495 757 ;
-C 41 ; WX 369 ; N parenright ; B -24 -205 382 757 ;
-C 42 ; WX 425 ; N asterisk ; B 170 446 479 740 ;
-C 43 ; WX 606 ; N plus ; B 92 0 608 506 ;
-C 44 ; WX 277 ; N comma ; B 2 -67 199 126 ;
-C 45 ; WX 332 ; N hyphen ; B 76 248 360 315 ;
-C 46 ; WX 277 ; N period ; B 102 0 199 126 ;
-C 47 ; WX 437 ; N slash ; B 25 -100 540 740 ;
-C 48 ; WX 554 ; N zero ; B 71 -13 622 753 ;
-C 49 ; WX 554 ; N one ; B 260 0 473 740 ;
-C 50 ; WX 554 ; N two ; B 40 0 615 753 ;
-C 51 ; WX 554 ; N three ; B 73 -13 565 753 ;
-C 52 ; WX 554 ; N four ; B 39 0 598 740 ;
-C 53 ; WX 554 ; N five ; B 69 -13 605 740 ;
-C 54 ; WX 554 ; N six ; B 65 -13 580 739 ;
-C 55 ; WX 554 ; N seven ; B 110 0 628 740 ;
-C 56 ; WX 554 ; N eight ; B 77 -13 580 753 ;
-C 57 ; WX 554 ; N nine ; B 111 0 626 752 ;
-C 58 ; WX 277 ; N colon ; B 102 0 278 548 ;
-C 59 ; WX 277 ; N semicolon ; B 2 -67 278 548 ;
-C 60 ; WX 606 ; N less ; B 87 -8 649 514 ;
-C 61 ; WX 606 ; N equal ; B 73 118 627 388 ;
-C 62 ; WX 606 ; N greater ; B 51 -8 613 514 ;
-C 63 ; WX 591 ; N question ; B 158 0 628 752 ;
-C 64 ; WX 867 ; N at ; B 126 -13 888 753 ;
-C 65 ; WX 740 ; N A ; B 12 0 729 740 ;
-C 66 ; WX 574 ; N B ; B 74 0 606 740 ;
-C 67 ; WX 813 ; N C ; B 105 -13 870 752 ;
-C 68 ; WX 744 ; N D ; B 74 0 773 740 ;
-C 69 ; WX 536 ; N E ; B 70 0 612 740 ;
-C 70 ; WX 485 ; N F ; B 70 0 581 740 ;
-C 71 ; WX 872 ; N G ; B 103 -13 891 753 ;
-C 72 ; WX 683 ; N H ; B 76 0 744 740 ;
-C 73 ; WX 226 ; N I ; B 76 0 287 740 ;
-C 74 ; WX 482 ; N J ; B 37 -13 539 740 ;
-C 75 ; WX 591 ; N K ; B 81 0 728 740 ;
-C 76 ; WX 462 ; N L ; B 82 0 474 740 ;
-C 77 ; WX 919 ; N M ; B 76 0 980 740 ;
-C 78 ; WX 740 ; N N ; B 75 0 801 740 ;
-C 79 ; WX 869 ; N O ; B 105 -13 901 753 ;
-C 80 ; WX 592 ; N P ; B 75 0 664 740 ;
-C 81 ; WX 871 ; N Q ; B 102 -13 912 753 ;
-C 82 ; WX 607 ; N R ; B 70 0 669 740 ;
-C 83 ; WX 498 ; N S ; B 57 -13 561 753 ;
-C 84 ; WX 426 ; N T ; B 131 0 556 740 ;
-C 85 ; WX 655 ; N U ; B 118 -13 716 740 ;
-C 86 ; WX 702 ; N V ; B 145 0 830 740 ;
-C 87 ; WX 960 ; N W ; B 148 0 1087 740 ;
-C 88 ; WX 609 ; N X ; B 8 0 724 740 ;
-C 89 ; WX 592 ; N Y ; B 138 0 729 740 ;
-C 90 ; WX 480 ; N Z ; B 12 0 596 740 ;
-C 91 ; WX 351 ; N bracketleft ; B 145 -179 477 753 ;
-C 92 ; WX 605 ; N backslash ; B 255 -100 458 740 ;
-C 93 ; WX 351 ; N bracketright ; B -19 -179 312 753 ;
-C 94 ; WX 606 ; N asciicircum ; B 110 307 610 740 ;
-C 95 ; WX 500 ; N underscore ; B -23 -125 486 -75 ;
-C 96 ; WX 351 ; N quoteleft ; B 232 546 358 740 ;
-C 97 ; WX 683 ; N a ; B 88 -13 722 561 ;
-C 98 ; WX 682 ; N b ; B 68 -13 703 740 ;
-C 99 ; WX 647 ; N c ; B 87 -13 678 561 ;
-C 100 ; WX 685 ; N d ; B 85 -13 755 740 ;
-C 101 ; WX 650 ; N e ; B 84 -13 664 561 ;
-C 102 ; WX 314 ; N f ; B 104 0 454 753 ; L i fi ; L l fl ;
-C 103 ; WX 673 ; N g ; B 56 -215 707 561 ;
-C 104 ; WX 610 ; N h ; B 62 0 606 740 ;
-C 105 ; WX 200 ; N i ; B 65 0 272 740 ;
-C 106 ; WX 203 ; N j ; B -80 -192 274 740 ;
-C 107 ; WX 502 ; N k ; B 70 0 588 740 ;
-C 108 ; WX 200 ; N l ; B 65 0 272 740 ;
-C 109 ; WX 938 ; N m ; B 66 0 938 561 ;
-C 110 ; WX 610 ; N n ; B 65 0 609 561 ;
-C 111 ; WX 655 ; N o ; B 88 -13 669 561 ;
-C 112 ; WX 682 ; N p ; B 28 -192 699 561 ;
-C 113 ; WX 682 ; N q ; B 83 -192 717 561 ;
-C 114 ; WX 301 ; N r ; B 65 0 395 561 ;
-C 115 ; WX 388 ; N s ; B 49 -13 424 561 ;
-C 116 ; WX 339 ; N t ; B 104 0 431 740 ;
-C 117 ; WX 608 ; N u ; B 100 -13 642 547 ;
-C 118 ; WX 554 ; N v ; B 108 0 647 547 ;
-C 119 ; WX 831 ; N w ; B 114 0 921 547 ;
-C 120 ; WX 480 ; N x ; B 12 0 569 547 ;
-C 121 ; WX 536 ; N y ; B 97 -192 624 547 ;
-C 122 ; WX 425 ; N z ; B 10 0 498 547 ;
-C 123 ; WX 351 ; N braceleft ; B 115 -189 468 740 ;
-C 124 ; WX 672 ; N bar ; B 280 -100 510 740 ;
-C 125 ; WX 351 ; N braceright ; B -15 -189 338 740 ;
-C 126 ; WX 606 ; N asciitilde ; B 114 179 584 319 ;
-C 161 ; WX 295 ; N exclamdown ; B 74 -192 286 548 ;
-C 162 ; WX 554 ; N cent ; B 115 62 596 707 ;
-C 163 ; WX 554 ; N sterling ; B 29 0 614 753 ;
-C 164 ; WX 166 ; N fraction ; B -113 0 417 740 ;
-C 165 ; WX 554 ; N yen ; B 75 0 687 740 ;
-C 166 ; WX 554 ; N florin ; B -39 -153 669 818 ;
-C 167 ; WX 615 ; N section ; B 118 -141 597 753 ;
-C 168 ; WX 554 ; N currency ; B 24 42 645 580 ;
-C 169 ; WX 198 ; N quotesingle ; B 153 444 277 740 ;
-C 170 ; WX 502 ; N quotedblleft ; B 234 546 507 740 ;
-C 171 ; WX 425 ; N guillemotleft ; B 92 81 469 481 ;
-C 172 ; WX 251 ; N guilsinglleft ; B 92 81 295 481 ;
-C 173 ; WX 251 ; N guilsinglright ; B 60 81 263 481 ;
-C 174 ; WX 487 ; N fi ; B 104 0 559 753 ;
-C 175 ; WX 485 ; N fl ; B 104 0 557 753 ;
-C 177 ; WX 500 ; N endash ; B 81 248 523 315 ;
-C 178 ; WX 553 ; N dagger ; B 146 -133 593 740 ;
-C 179 ; WX 553 ; N daggerdbl ; B 72 -133 593 740 ;
-C 180 ; WX 277 ; N periodcentered ; B 137 190 235 316 ;
-C 182 ; WX 564 ; N paragraph ; B 119 -110 688 740 ;
-C 183 ; WX 606 ; N bullet ; B 217 222 528 532 ;
-C 184 ; WX 354 ; N quotesinglbase ; B 76 -68 274 126 ;
-C 185 ; WX 502 ; N quotedblbase ; B 76 -68 422 126 ;
-C 186 ; WX 484 ; N quotedblright ; B 197 546 542 740 ;
-C 187 ; WX 425 ; N guillemotright ; B 60 81 437 481 ;
-C 188 ; WX 1000 ; N ellipsis ; B 130 0 893 126 ;
-C 189 ; WX 1174 ; N perthousand ; B 128 -13 1182 751 ;
-C 191 ; WX 591 ; N questiondown ; B 64 -205 534 548 ;
-C 193 ; WX 378 ; N grave ; B 204 619 425 786 ;
-C 194 ; WX 375 ; N acute ; B 203 619 444 786 ;
-C 195 ; WX 502 ; N circumflex ; B 192 639 546 764 ;
-C 196 ; WX 439 ; N tilde ; B 179 651 520 754 ;
-C 197 ; WX 485 ; N macron ; B 197 669 547 736 ;
-C 198 ; WX 453 ; N breve ; B 192 651 541 754 ;
-C 199 ; WX 222 ; N dotaccent ; B 192 639 290 765 ;
-C 200 ; WX 369 ; N dieresis ; B 191 639 437 765 ;
-C 202 ; WX 332 ; N ring ; B 191 600 401 807 ;
-C 203 ; WX 324 ; N cedilla ; B 52 -222 231 0 ;
-C 205 ; WX 552 ; N hungarumlaut ; B 239 605 594 800 ;
-C 206 ; WX 302 ; N ogonek ; B 53 -191 202 0 ;
-C 207 ; WX 502 ; N caron ; B 210 639 565 764 ;
-C 208 ; WX 1000 ; N emdash ; B 81 248 1023 315 ;
-C 225 ; WX 992 ; N AE ; B -20 0 1044 740 ;
-C 227 ; WX 369 ; N ordfeminine ; B 102 407 494 753 ;
-C 232 ; WX 517 ; N Lslash ; B 107 0 529 740 ;
-C 233 ; WX 868 ; N Oslash ; B 76 -83 929 819 ;
-C 234 ; WX 1194 ; N OE ; B 107 -13 1279 753 ;
-C 235 ; WX 369 ; N ordmasculine ; B 116 407 466 753 ;
-C 241 ; WX 1157 ; N ae ; B 80 -13 1169 561 ;
-C 245 ; WX 200 ; N dotlessi ; B 65 0 236 547 ;
-C 248 ; WX 300 ; N lslash ; B 95 0 354 740 ;
-C 249 ; WX 653 ; N oslash ; B 51 -64 703 614 ;
-C 250 ; WX 1137 ; N oe ; B 80 -13 1160 561 ;
-C 251 ; WX 554 ; N germandbls ; B 61 -13 578 753 ;
-C -1 ; WX 650 ; N ecircumflex ; B 84 -13 664 764 ;
-C -1 ; WX 650 ; N edieresis ; B 84 -13 664 765 ;
-C -1 ; WX 683 ; N aacute ; B 88 -13 722 786 ;
-C -1 ; WX 747 ; N registered ; B 53 -12 830 752 ;
-C -1 ; WX 200 ; N icircumflex ; B 41 0 395 764 ;
-C -1 ; WX 608 ; N udieresis ; B 100 -13 642 765 ;
-C -1 ; WX 655 ; N ograve ; B 88 -13 669 786 ;
-C -1 ; WX 608 ; N uacute ; B 100 -13 642 786 ;
-C -1 ; WX 608 ; N ucircumflex ; B 100 -13 642 764 ;
-C -1 ; WX 740 ; N Aacute ; B 12 0 729 949 ;
-C -1 ; WX 200 ; N igrave ; B 65 0 296 786 ;
-C -1 ; WX 226 ; N Icircumflex ; B 76 0 439 927 ;
-C -1 ; WX 647 ; N ccedilla ; B 87 -222 678 561 ;
-C -1 ; WX 683 ; N adieresis ; B 88 -13 722 765 ;
-C -1 ; WX 536 ; N Ecircumflex ; B 70 0 612 927 ;
-C -1 ; WX 388 ; N scaron ; B 49 -13 508 764 ;
-C -1 ; WX 682 ; N thorn ; B 28 -192 699 740 ;
-C -1 ; WX 1000 ; N trademark ; B 137 296 953 740 ;
-C -1 ; WX 650 ; N egrave ; B 84 -13 664 786 ;
-C -1 ; WX 332 ; N threesuperior ; B 98 289 408 747 ;
-C -1 ; WX 425 ; N zcaron ; B 10 0 527 764 ;
-C -1 ; WX 683 ; N atilde ; B 88 -13 722 754 ;
-C -1 ; WX 683 ; N aring ; B 88 -13 722 807 ;
-C -1 ; WX 655 ; N ocircumflex ; B 88 -13 669 764 ;
-C -1 ; WX 536 ; N Edieresis ; B 70 0 612 928 ;
-C -1 ; WX 831 ; N threequarters ; B 126 0 825 747 ;
-C -1 ; WX 536 ; N ydieresis ; B 97 -192 624 765 ;
-C -1 ; WX 536 ; N yacute ; B 97 -192 624 786 ;
-C -1 ; WX 200 ; N iacute ; B 65 0 397 786 ;
-C -1 ; WX 740 ; N Acircumflex ; B 12 0 729 927 ;
-C -1 ; WX 655 ; N Uacute ; B 118 -13 716 949 ;
-C -1 ; WX 650 ; N eacute ; B 84 -13 664 786 ;
-C -1 ; WX 869 ; N Ograve ; B 105 -13 901 949 ;
-C -1 ; WX 683 ; N agrave ; B 88 -13 722 786 ;
-C -1 ; WX 655 ; N Udieresis ; B 118 -13 716 928 ;
-C -1 ; WX 683 ; N acircumflex ; B 88 -13 722 764 ;
-C -1 ; WX 226 ; N Igrave ; B 76 0 340 949 ;
-C -1 ; WX 332 ; N twosuperior ; B 74 296 433 747 ;
-C -1 ; WX 655 ; N Ugrave ; B 118 -13 716 949 ;
-C -1 ; WX 831 ; N onequarter ; B 183 0 770 740 ;
-C -1 ; WX 655 ; N Ucircumflex ; B 118 -13 716 927 ;
-C -1 ; WX 498 ; N Scaron ; B 57 -13 593 927 ;
-C -1 ; WX 226 ; N Idieresis ; B 76 0 396 928 ;
-C -1 ; WX 200 ; N idieresis ; B 65 0 353 765 ;
-C -1 ; WX 536 ; N Egrave ; B 70 0 612 949 ;
-C -1 ; WX 869 ; N Oacute ; B 105 -13 901 949 ;
-C -1 ; WX 606 ; N divide ; B 92 -13 608 519 ;
-C -1 ; WX 740 ; N Atilde ; B 12 0 729 917 ;
-C -1 ; WX 740 ; N Aring ; B 12 0 729 955 ;
-C -1 ; WX 869 ; N Odieresis ; B 105 -13 901 928 ;
-C -1 ; WX 740 ; N Adieresis ; B 12 0 729 928 ;
-C -1 ; WX 740 ; N Ntilde ; B 75 0 801 917 ;
-C -1 ; WX 480 ; N Zcaron ; B 12 0 596 927 ;
-C -1 ; WX 592 ; N Thorn ; B 60 0 621 740 ;
-C -1 ; WX 226 ; N Iacute ; B 76 0 440 949 ;
-C -1 ; WX 606 ; N plusminus ; B 47 -24 618 518 ;
-C -1 ; WX 606 ; N multiply ; B 87 24 612 482 ;
-C -1 ; WX 536 ; N Eacute ; B 70 0 612 949 ;
-C -1 ; WX 592 ; N Ydieresis ; B 138 0 729 928 ;
-C -1 ; WX 332 ; N onesuperior ; B 190 296 335 740 ;
-C -1 ; WX 608 ; N ugrave ; B 100 -13 642 786 ;
-C -1 ; WX 606 ; N logicalnot ; B 110 109 627 388 ;
-C -1 ; WX 610 ; N ntilde ; B 65 0 609 754 ;
-C -1 ; WX 869 ; N Otilde ; B 105 -13 901 917 ;
-C -1 ; WX 655 ; N otilde ; B 88 -13 669 754 ;
-C -1 ; WX 813 ; N Ccedilla ; B 105 -222 870 752 ;
-C -1 ; WX 740 ; N Agrave ; B 12 0 729 949 ;
-C -1 ; WX 831 ; N onehalf ; B 164 0 810 740 ;
-C -1 ; WX 790 ; N Eth ; B 104 0 813 740 ;
-C -1 ; WX 400 ; N degree ; B 158 421 451 709 ;
-C -1 ; WX 592 ; N Yacute ; B 138 0 729 949 ;
-C -1 ; WX 869 ; N Ocircumflex ; B 105 -13 901 927 ;
-C -1 ; WX 655 ; N oacute ; B 88 -13 669 786 ;
-C -1 ; WX 608 ; N mu ; B 46 -184 628 547 ;
-C -1 ; WX 606 ; N minus ; B 92 219 608 287 ;
-C -1 ; WX 655 ; N eth ; B 88 -12 675 753 ;
-C -1 ; WX 655 ; N odieresis ; B 88 -13 669 765 ;
-C -1 ; WX 747 ; N copyright ; B 53 -12 830 752 ;
-C -1 ; WX 672 ; N brokenbar ; B 280 -100 510 740 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 216
-
-KPX A y -62
-KPX A w -65
-KPX A v -70
-KPX A u -20
-KPX A quoteright -100
-KPX A quotedblright -100
-KPX A Y -92
-KPX A W -60
-KPX A V -102
-KPX A U -40
-KPX A T -45
-KPX A Q -40
-KPX A O -50
-KPX A G -40
-KPX A C -40
-
-KPX B A -10
-
-KPX C A -40
-
-KPX D period -20
-KPX D comma -20
-KPX D Y -30
-KPX D W -10
-KPX D V -50
-KPX D A -50
-
-KPX F period -160
-KPX F e -20
-KPX F comma -180
-KPX F a -20
-KPX F A -75
-
-KPX G period -20
-KPX G comma -20
-KPX G Y -20
-
-KPX J period -15
-KPX J a -20
-KPX J A -30
-
-KPX K o -15
-KPX K e -20
-KPX K O -20
-
-KPX L y -23
-KPX L quoteright -130
-KPX L quotedblright -130
-KPX L Y -91
-KPX L W -67
-KPX L V -113
-KPX L T -46
-
-KPX O period -30
-KPX O comma -30
-KPX O Y -30
-KPX O X -30
-KPX O W -20
-KPX O V -60
-KPX O T -30
-KPX O A -60
-
-KPX P period -300
-KPX P o -60
-KPX P e -20
-KPX P comma -280
-KPX P a -20
-KPX P A -114
-
-KPX Q comma 20
-
-KPX R Y -10
-KPX R W 10
-KPX R V -10
-KPX R T 6
-
-KPX S comma 20
-
-KPX T y -50
-KPX T w -55
-KPX T u -46
-KPX T semicolon -29
-KPX T r -30
-KPX T period -91
-KPX T o -70
-KPX T i 10
-KPX T hyphen -75
-KPX T e -49
-KPX T comma -82
-KPX T colon -15
-KPX T a -90
-KPX T O -30
-KPX T A -45
-
-KPX U period -20
-KPX U comma -20
-KPX U A -40
-
-KPX V u -40
-KPX V semicolon -33
-KPX V period -165
-KPX V o -101
-KPX V i -5
-KPX V hyphen -75
-KPX V e -101
-KPX V comma -145
-KPX V colon -18
-KPX V a -104
-KPX V O -60
-KPX V G -20
-KPX V A -102
-
-KPX W y -2
-KPX W u -30
-KPX W semicolon -33
-KPX W period -106
-KPX W o -46
-KPX W i 6
-KPX W hyphen -35
-KPX W e -47
-KPX W comma -106
-KPX W colon -15
-KPX W a -50
-KPX W O -20
-KPX W A -58
-
-KPX Y u -52
-KPX Y semicolon -23
-KPX Y period -175
-KPX Y o -89
-KPX Y hyphen -85
-KPX Y e -89
-KPX Y comma -145
-KPX Y colon -10
-KPX Y a -93
-KPX Y O -30
-KPX Y A -92
-
-KPX a p 20
-KPX a b 20
-
-KPX b y -20
-KPX b v -20
-
-KPX c y -20
-KPX c k -15
-
-KPX comma space -110
-KPX comma quoteright -120
-KPX comma quotedblright -120
-
-KPX e y -20
-KPX e w -20
-KPX e v -20
-
-KPX f period -50
-KPX f o -40
-KPX f l -30
-KPX f i -34
-KPX f f -60
-KPX f e -20
-KPX f dotlessi -34
-KPX f comma -50
-KPX f a -40
-
-KPX g a -15
-
-KPX h y -30
-
-KPX k y -5
-KPX k e -15
-
-KPX m y -20
-KPX m u -20
-KPX m a -20
-
-KPX n y -15
-KPX n v -20
-
-KPX o y -20
-KPX o x -15
-KPX o w -20
-KPX o v -30
-
-KPX p y -20
-
-KPX period space -110
-KPX period quoteright -120
-KPX period quotedblright -120
-
-KPX quotedblleft quoteleft -35
-KPX quotedblleft A -100
-
-KPX quotedblright space -110
-
-KPX quoteleft quoteleft -203
-KPX quoteleft A -100
-
-KPX quoteright v -30
-KPX quoteright t 10
-KPX quoteright space -110
-KPX quoteright s -15
-KPX quoteright r -20
-KPX quoteright quoteright -203
-KPX quoteright quotedblright -35
-KPX quoteright d -110
-
-KPX r y 40
-KPX r v 40
-KPX r u 20
-KPX r t 20
-KPX r s 20
-KPX r q -8
-KPX r period -73
-KPX r p 20
-KPX r o -20
-KPX r n 21
-KPX r m 28
-KPX r l 20
-KPX r k 20
-KPX r i 20
-KPX r hyphen -60
-KPX r g -15
-KPX r e -4
-KPX r d -6
-KPX r comma -75
-KPX r c -20
-KPX r a -20
-
-KPX s period 20
-KPX s comma 20
-
-KPX space quoteleft -110
-KPX space quotedblleft -110
-KPX space Y -60
-KPX space W -25
-KPX space V -50
-KPX space T -25
-KPX space A -20
-
-KPX v period -130
-KPX v o -30
-KPX v e -20
-KPX v comma -100
-KPX v a -30
-
-KPX w period -100
-KPX w o -30
-KPX w h 15
-KPX w e -20
-KPX w comma -90
-KPX w a -30
-
-KPX y period -125
-KPX y o -30
-KPX y e -20
-KPX y comma -110
-KPX y a -30
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 213 163 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 149 163 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 216 163 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 211 163 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 231 148 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 181 163 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 111 163 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 47 163 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 114 163 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 109 163 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute -4 163 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -108 163 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -41 163 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave -86 163 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 181 163 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 277 163 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 214 163 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 280 163 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 276 163 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 245 163 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 28 163 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 190 163 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 107 163 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 173 163 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 149 163 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 159 163 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 142 163 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 19 163 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 154 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 91 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 157 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 153 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 176 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 122 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 138 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 74 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 141 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 136 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -47 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -151 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -84 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -129 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 86 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 140 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 77 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 143 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 139 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 108 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron -57 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 137 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 53 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 120 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 95 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 101 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron -38 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/AvantGarde-Demi.afm b/blt3.0.1/library/afm/AvantGarde-Demi.afm
deleted file mode 100644
index 6f96912..0000000
--- a/blt3.0.1/library/afm/AvantGarde-Demi.afm
+++ /dev/null
@@ -1,577 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Mon Mar 4 13:46:34 1991
-Comment UniqueID 34370
-Comment VMusage 24954 31846
-FontName AvantGarde-Demi
-FullName ITC Avant Garde Gothic Demi
-FamilyName ITC Avant Garde Gothic
-Weight Demi
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -123 -251 1222 1021
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.ITC Avant Garde Gothic is a registered trademark of International Typeface Corporation.
-EncodingScheme AdobeStandardEncoding
-CapHeight 740
-XHeight 555
-Ascender 740
-Descender -185
-StartCharMetrics 228
-C 32 ; WX 280 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 280 ; N exclam ; B 73 0 206 740 ;
-C 34 ; WX 360 ; N quotedbl ; B 19 444 341 740 ;
-C 35 ; WX 560 ; N numbersign ; B 29 0 525 700 ;
-C 36 ; WX 560 ; N dollar ; B 58 -86 501 857 ;
-C 37 ; WX 860 ; N percent ; B 36 -15 822 755 ;
-C 38 ; WX 680 ; N ampersand ; B 34 -15 665 755 ;
-C 39 ; WX 280 ; N quoteright ; B 72 466 205 740 ;
-C 40 ; WX 380 ; N parenleft ; B 74 -157 350 754 ;
-C 41 ; WX 380 ; N parenright ; B 37 -157 313 754 ;
-C 42 ; WX 440 ; N asterisk ; B 67 457 374 755 ;
-C 43 ; WX 600 ; N plus ; B 48 0 552 506 ;
-C 44 ; WX 280 ; N comma ; B 73 -141 206 133 ;
-C 45 ; WX 420 ; N hyphen ; B 71 230 349 348 ;
-C 46 ; WX 280 ; N period ; B 73 0 206 133 ;
-C 47 ; WX 460 ; N slash ; B 6 -100 454 740 ;
-C 48 ; WX 560 ; N zero ; B 32 -15 529 755 ;
-C 49 ; WX 560 ; N one ; B 137 0 363 740 ;
-C 50 ; WX 560 ; N two ; B 36 0 523 755 ;
-C 51 ; WX 560 ; N three ; B 28 -15 532 755 ;
-C 52 ; WX 560 ; N four ; B 15 0 545 740 ;
-C 53 ; WX 560 ; N five ; B 25 -15 535 740 ;
-C 54 ; WX 560 ; N six ; B 23 -15 536 739 ;
-C 55 ; WX 560 ; N seven ; B 62 0 498 740 ;
-C 56 ; WX 560 ; N eight ; B 33 -15 527 755 ;
-C 57 ; WX 560 ; N nine ; B 24 0 537 754 ;
-C 58 ; WX 280 ; N colon ; B 73 0 206 555 ;
-C 59 ; WX 280 ; N semicolon ; B 73 -141 206 555 ;
-C 60 ; WX 600 ; N less ; B 46 -8 554 514 ;
-C 61 ; WX 600 ; N equal ; B 48 81 552 425 ;
-C 62 ; WX 600 ; N greater ; B 46 -8 554 514 ;
-C 63 ; WX 560 ; N question ; B 38 0 491 755 ;
-C 64 ; WX 740 ; N at ; B 50 -12 750 712 ;
-C 65 ; WX 740 ; N A ; B 7 0 732 740 ;
-C 66 ; WX 580 ; N B ; B 70 0 551 740 ;
-C 67 ; WX 780 ; N C ; B 34 -15 766 755 ;
-C 68 ; WX 700 ; N D ; B 63 0 657 740 ;
-C 69 ; WX 520 ; N E ; B 61 0 459 740 ;
-C 70 ; WX 480 ; N F ; B 61 0 438 740 ;
-C 71 ; WX 840 ; N G ; B 27 -15 817 755 ;
-C 72 ; WX 680 ; N H ; B 71 0 610 740 ;
-C 73 ; WX 280 ; N I ; B 72 0 209 740 ;
-C 74 ; WX 480 ; N J ; B 2 -15 409 740 ;
-C 75 ; WX 620 ; N K ; B 89 0 620 740 ;
-C 76 ; WX 440 ; N L ; B 72 0 435 740 ;
-C 77 ; WX 900 ; N M ; B 63 0 837 740 ;
-C 78 ; WX 740 ; N N ; B 70 0 671 740 ;
-C 79 ; WX 840 ; N O ; B 33 -15 807 755 ;
-C 80 ; WX 560 ; N P ; B 72 0 545 740 ;
-C 81 ; WX 840 ; N Q ; B 32 -15 824 755 ;
-C 82 ; WX 580 ; N R ; B 64 0 565 740 ;
-C 83 ; WX 520 ; N S ; B 12 -15 493 755 ;
-C 84 ; WX 420 ; N T ; B 6 0 418 740 ;
-C 85 ; WX 640 ; N U ; B 55 -15 585 740 ;
-C 86 ; WX 700 ; N V ; B 8 0 695 740 ;
-C 87 ; WX 900 ; N W ; B 7 0 899 740 ;
-C 88 ; WX 680 ; N X ; B 4 0 676 740 ;
-C 89 ; WX 620 ; N Y ; B -2 0 622 740 ;
-C 90 ; WX 500 ; N Z ; B 19 0 481 740 ;
-C 91 ; WX 320 ; N bracketleft ; B 66 -157 284 754 ;
-C 92 ; WX 640 ; N backslash ; B 96 -100 544 740 ;
-C 93 ; WX 320 ; N bracketright ; B 36 -157 254 754 ;
-C 94 ; WX 600 ; N asciicircum ; B 73 375 527 740 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 280 ; N quoteleft ; B 72 466 205 740 ;
-C 97 ; WX 660 ; N a ; B 27 -18 613 574 ;
-C 98 ; WX 660 ; N b ; B 47 -18 632 740 ;
-C 99 ; WX 640 ; N c ; B 37 -18 610 574 ;
-C 100 ; WX 660 ; N d ; B 34 -18 618 740 ;
-C 101 ; WX 640 ; N e ; B 31 -18 610 577 ;
-C 102 ; WX 280 ; N f ; B 15 0 280 755 ; L i fi ; L l fl ;
-C 103 ; WX 660 ; N g ; B 32 -226 623 574 ;
-C 104 ; WX 600 ; N h ; B 54 0 546 740 ;
-C 105 ; WX 240 ; N i ; B 53 0 186 740 ;
-C 106 ; WX 260 ; N j ; B 16 -185 205 740 ;
-C 107 ; WX 580 ; N k ; B 80 0 571 740 ;
-C 108 ; WX 240 ; N l ; B 54 0 187 740 ;
-C 109 ; WX 940 ; N m ; B 54 0 887 574 ;
-C 110 ; WX 600 ; N n ; B 54 0 547 574 ;
-C 111 ; WX 640 ; N o ; B 25 -18 615 574 ;
-C 112 ; WX 660 ; N p ; B 47 -185 629 574 ;
-C 113 ; WX 660 ; N q ; B 31 -185 613 574 ;
-C 114 ; WX 320 ; N r ; B 63 0 317 574 ;
-C 115 ; WX 440 ; N s ; B 19 -18 421 574 ;
-C 116 ; WX 300 ; N t ; B 21 0 299 740 ;
-C 117 ; WX 600 ; N u ; B 50 -18 544 555 ;
-C 118 ; WX 560 ; N v ; B 3 0 556 555 ;
-C 119 ; WX 800 ; N w ; B 11 0 789 555 ;
-C 120 ; WX 560 ; N x ; B 3 0 556 555 ;
-C 121 ; WX 580 ; N y ; B 8 -185 571 555 ;
-C 122 ; WX 460 ; N z ; B 20 0 442 555 ;
-C 123 ; WX 340 ; N braceleft ; B -3 -191 317 747 ;
-C 124 ; WX 600 ; N bar ; B 233 -100 366 740 ;
-C 125 ; WX 340 ; N braceright ; B 23 -191 343 747 ;
-C 126 ; WX 600 ; N asciitilde ; B 67 160 533 347 ;
-C 161 ; WX 280 ; N exclamdown ; B 74 -185 207 555 ;
-C 162 ; WX 560 ; N cent ; B 43 39 517 715 ;
-C 163 ; WX 560 ; N sterling ; B -2 0 562 755 ;
-C 164 ; WX 160 ; N fraction ; B -123 0 282 740 ;
-C 165 ; WX 560 ; N yen ; B -10 0 570 740 ;
-C 166 ; WX 560 ; N florin ; B 0 -151 512 824 ;
-C 167 ; WX 560 ; N section ; B 28 -158 530 755 ;
-C 168 ; WX 560 ; N currency ; B 27 69 534 577 ;
-C 169 ; WX 220 ; N quotesingle ; B 44 444 177 740 ;
-C 170 ; WX 480 ; N quotedblleft ; B 70 466 410 740 ;
-C 171 ; WX 460 ; N guillemotleft ; B 61 108 400 469 ;
-C 172 ; WX 240 ; N guilsinglleft ; B 50 108 190 469 ;
-C 173 ; WX 240 ; N guilsinglright ; B 50 108 190 469 ;
-C 174 ; WX 520 ; N fi ; B 25 0 461 755 ;
-C 175 ; WX 520 ; N fl ; B 25 0 461 755 ;
-C 177 ; WX 500 ; N endash ; B 35 230 465 348 ;
-C 178 ; WX 560 ; N dagger ; B 51 -142 509 740 ;
-C 179 ; WX 560 ; N daggerdbl ; B 51 -142 509 740 ;
-C 180 ; WX 280 ; N periodcentered ; B 73 187 206 320 ;
-C 182 ; WX 600 ; N paragraph ; B -7 -103 607 740 ;
-C 183 ; WX 600 ; N bullet ; B 148 222 453 532 ;
-C 184 ; WX 280 ; N quotesinglbase ; B 72 -141 205 133 ;
-C 185 ; WX 480 ; N quotedblbase ; B 70 -141 410 133 ;
-C 186 ; WX 480 ; N quotedblright ; B 70 466 410 740 ;
-C 187 ; WX 460 ; N guillemotright ; B 61 108 400 469 ;
-C 188 ; WX 1000 ; N ellipsis ; B 100 0 899 133 ;
-C 189 ; WX 1280 ; N perthousand ; B 36 -15 1222 755 ;
-C 191 ; WX 560 ; N questiondown ; B 68 -200 521 555 ;
-C 193 ; WX 420 ; N grave ; B 50 624 329 851 ;
-C 194 ; WX 420 ; N acute ; B 91 624 370 849 ;
-C 195 ; WX 540 ; N circumflex ; B 71 636 470 774 ;
-C 196 ; WX 480 ; N tilde ; B 44 636 437 767 ;
-C 197 ; WX 420 ; N macron ; B 72 648 349 759 ;
-C 198 ; WX 480 ; N breve ; B 42 633 439 770 ;
-C 199 ; WX 280 ; N dotaccent ; B 74 636 207 769 ;
-C 200 ; WX 500 ; N dieresis ; B 78 636 422 769 ;
-C 202 ; WX 360 ; N ring ; B 73 619 288 834 ;
-C 203 ; WX 340 ; N cedilla ; B 98 -251 298 6 ;
-C 205 ; WX 700 ; N hungarumlaut ; B 132 610 609 862 ;
-C 206 ; WX 340 ; N ogonek ; B 79 -195 262 9 ;
-C 207 ; WX 540 ; N caron ; B 71 636 470 774 ;
-C 208 ; WX 1000 ; N emdash ; B 35 230 965 348 ;
-C 225 ; WX 900 ; N AE ; B -5 0 824 740 ;
-C 227 ; WX 360 ; N ordfeminine ; B 19 438 334 755 ;
-C 232 ; WX 480 ; N Lslash ; B 26 0 460 740 ;
-C 233 ; WX 840 ; N Oslash ; B 33 -71 807 814 ;
-C 234 ; WX 1060 ; N OE ; B 37 -15 1007 755 ;
-C 235 ; WX 360 ; N ordmasculine ; B 23 438 338 755 ;
-C 241 ; WX 1080 ; N ae ; B 29 -18 1048 574 ;
-C 245 ; WX 240 ; N dotlessi ; B 53 0 186 555 ;
-C 248 ; WX 320 ; N lslash ; B 34 0 305 740 ;
-C 249 ; WX 660 ; N oslash ; B 35 -50 625 608 ;
-C 250 ; WX 1080 ; N oe ; B 30 -18 1050 574 ;
-C 251 ; WX 600 ; N germandbls ; B 51 -18 585 755 ;
-C -1 ; WX 640 ; N ecircumflex ; B 31 -18 610 774 ;
-C -1 ; WX 640 ; N edieresis ; B 31 -18 610 769 ;
-C -1 ; WX 660 ; N aacute ; B 27 -18 613 849 ;
-C -1 ; WX 740 ; N registered ; B -12 -12 752 752 ;
-C -1 ; WX 240 ; N icircumflex ; B -79 0 320 774 ;
-C -1 ; WX 600 ; N udieresis ; B 50 -18 544 769 ;
-C -1 ; WX 640 ; N ograve ; B 25 -18 615 851 ;
-C -1 ; WX 600 ; N uacute ; B 50 -18 544 849 ;
-C -1 ; WX 600 ; N ucircumflex ; B 50 -18 544 774 ;
-C -1 ; WX 740 ; N Aacute ; B 7 0 732 1019 ;
-C -1 ; WX 240 ; N igrave ; B -65 0 214 851 ;
-C -1 ; WX 280 ; N Icircumflex ; B -59 0 340 944 ;
-C -1 ; WX 640 ; N ccedilla ; B 37 -251 610 574 ;
-C -1 ; WX 660 ; N adieresis ; B 27 -18 613 769 ;
-C -1 ; WX 520 ; N Ecircumflex ; B 61 0 460 944 ;
-C -1 ; WX 440 ; N scaron ; B 19 -18 421 774 ;
-C -1 ; WX 660 ; N thorn ; B 47 -185 629 740 ;
-C -1 ; WX 1000 ; N trademark ; B 9 296 821 740 ;
-C -1 ; WX 640 ; N egrave ; B 31 -18 610 851 ;
-C -1 ; WX 336 ; N threesuperior ; B 8 287 328 749 ;
-C -1 ; WX 460 ; N zcaron ; B 20 0 455 774 ;
-C -1 ; WX 660 ; N atilde ; B 27 -18 613 767 ;
-C -1 ; WX 660 ; N aring ; B 27 -18 613 834 ;
-C -1 ; WX 640 ; N ocircumflex ; B 25 -18 615 774 ;
-C -1 ; WX 520 ; N Edieresis ; B 61 0 459 939 ;
-C -1 ; WX 840 ; N threequarters ; B 18 0 803 749 ;
-C -1 ; WX 580 ; N ydieresis ; B 8 -185 571 769 ;
-C -1 ; WX 580 ; N yacute ; B 8 -185 571 849 ;
-C -1 ; WX 240 ; N iacute ; B 26 0 305 849 ;
-C -1 ; WX 740 ; N Acircumflex ; B 7 0 732 944 ;
-C -1 ; WX 640 ; N Uacute ; B 55 -15 585 1019 ;
-C -1 ; WX 640 ; N eacute ; B 31 -18 610 849 ;
-C -1 ; WX 840 ; N Ograve ; B 33 -15 807 1021 ;
-C -1 ; WX 660 ; N agrave ; B 27 -18 613 851 ;
-C -1 ; WX 640 ; N Udieresis ; B 55 -15 585 939 ;
-C -1 ; WX 660 ; N acircumflex ; B 27 -18 613 774 ;
-C -1 ; WX 280 ; N Igrave ; B -45 0 234 1021 ;
-C -1 ; WX 336 ; N twosuperior ; B 13 296 322 749 ;
-C -1 ; WX 640 ; N Ugrave ; B 55 -15 585 1021 ;
-C -1 ; WX 840 ; N onequarter ; B 92 0 746 740 ;
-C -1 ; WX 640 ; N Ucircumflex ; B 55 -15 585 944 ;
-C -1 ; WX 520 ; N Scaron ; B 12 -15 493 944 ;
-C -1 ; WX 280 ; N Idieresis ; B -32 0 312 939 ;
-C -1 ; WX 240 ; N idieresis ; B -52 0 292 769 ;
-C -1 ; WX 520 ; N Egrave ; B 61 0 459 1021 ;
-C -1 ; WX 840 ; N Oacute ; B 33 -15 807 1019 ;
-C -1 ; WX 600 ; N divide ; B 48 -20 552 526 ;
-C -1 ; WX 740 ; N Atilde ; B 7 0 732 937 ;
-C -1 ; WX 740 ; N Aring ; B 7 0 732 969 ;
-C -1 ; WX 840 ; N Odieresis ; B 33 -15 807 939 ;
-C -1 ; WX 740 ; N Adieresis ; B 7 0 732 939 ;
-C -1 ; WX 740 ; N Ntilde ; B 70 0 671 937 ;
-C -1 ; WX 500 ; N Zcaron ; B 19 0 481 944 ;
-C -1 ; WX 560 ; N Thorn ; B 72 0 545 740 ;
-C -1 ; WX 280 ; N Iacute ; B 46 0 325 1019 ;
-C -1 ; WX 600 ; N plusminus ; B 48 -62 552 556 ;
-C -1 ; WX 600 ; N multiply ; B 59 12 541 494 ;
-C -1 ; WX 520 ; N Eacute ; B 61 0 459 1019 ;
-C -1 ; WX 620 ; N Ydieresis ; B -2 0 622 939 ;
-C -1 ; WX 336 ; N onesuperior ; B 72 296 223 740 ;
-C -1 ; WX 600 ; N ugrave ; B 50 -18 544 851 ;
-C -1 ; WX 600 ; N logicalnot ; B 48 108 552 425 ;
-C -1 ; WX 600 ; N ntilde ; B 54 0 547 767 ;
-C -1 ; WX 840 ; N Otilde ; B 33 -15 807 937 ;
-C -1 ; WX 640 ; N otilde ; B 25 -18 615 767 ;
-C -1 ; WX 780 ; N Ccedilla ; B 34 -251 766 755 ;
-C -1 ; WX 740 ; N Agrave ; B 7 0 732 1021 ;
-C -1 ; WX 840 ; N onehalf ; B 62 0 771 740 ;
-C -1 ; WX 742 ; N Eth ; B 25 0 691 740 ;
-C -1 ; WX 400 ; N degree ; B 57 426 343 712 ;
-C -1 ; WX 620 ; N Yacute ; B -2 0 622 1019 ;
-C -1 ; WX 840 ; N Ocircumflex ; B 33 -15 807 944 ;
-C -1 ; WX 640 ; N oacute ; B 25 -18 615 849 ;
-C -1 ; WX 576 ; N mu ; B 38 -187 539 555 ;
-C -1 ; WX 600 ; N minus ; B 48 193 552 313 ;
-C -1 ; WX 640 ; N eth ; B 27 -18 616 754 ;
-C -1 ; WX 640 ; N odieresis ; B 25 -18 615 769 ;
-C -1 ; WX 740 ; N copyright ; B -12 -12 752 752 ;
-C -1 ; WX 600 ; N brokenbar ; B 233 -100 366 740 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 218
-
-KPX A y -50
-KPX A w -65
-KPX A v -70
-KPX A u -20
-KPX A quoteright -90
-KPX A Y -80
-KPX A W -60
-KPX A V -102
-KPX A U -40
-KPX A T -25
-KPX A Q -50
-KPX A O -50
-KPX A G -40
-KPX A C -40
-
-KPX B A -10
-
-KPX C A -40
-
-KPX D period -20
-KPX D comma -20
-KPX D Y -45
-KPX D W -25
-KPX D V -50
-KPX D A -50
-
-KPX F period -129
-KPX F e -20
-KPX F comma -162
-KPX F a -20
-KPX F A -75
-
-KPX G period -20
-KPX G comma -20
-KPX G Y -15
-
-KPX J period -15
-KPX J a -20
-KPX J A -30
-
-KPX K y -20
-KPX K u -15
-KPX K o -45
-KPX K e -40
-KPX K O -30
-
-KPX L y -23
-KPX L quoteright -30
-KPX L quotedblright -30
-KPX L Y -80
-KPX L W -55
-KPX L V -85
-KPX L T -46
-
-KPX O period -30
-KPX O comma -30
-KPX O Y -30
-KPX O X -30
-KPX O W -20
-KPX O V -45
-KPX O T -15
-KPX O A -60
-
-KPX P period -200
-KPX P o -20
-KPX P e -20
-KPX P comma -220
-KPX P a -20
-KPX P A -100
-
-KPX Q comma 20
-
-KPX R W 25
-KPX R V -10
-KPX R U 25
-KPX R T 40
-KPX R O 25
-
-KPX S comma 20
-
-KPX T y -10
-KPX T w -55
-KPX T u -46
-KPX T semicolon -29
-KPX T r -30
-KPX T period -91
-KPX T o -49
-KPX T hyphen -75
-KPX T e -49
-KPX T comma -82
-KPX T colon -15
-KPX T a -70
-KPX T O -15
-KPX T A -25
-
-KPX U period -20
-KPX U comma -20
-KPX U A -40
-
-KPX V u -55
-KPX V semicolon -33
-KPX V period -145
-KPX V o -101
-KPX V i -15
-KPX V hyphen -75
-KPX V e -101
-KPX V comma -145
-KPX V colon -18
-KPX V a -95
-KPX V O -45
-KPX V G -20
-KPX V A -102
-
-KPX W y -15
-KPX W u -30
-KPX W semicolon -33
-KPX W period -106
-KPX W o -46
-KPX W i -10
-KPX W hyphen -35
-KPX W e -47
-KPX W comma -106
-KPX W colon -15
-KPX W a -50
-KPX W O -20
-KPX W A -58
-
-KPX Y u -52
-KPX Y semicolon -23
-KPX Y period -145
-KPX Y o -89
-KPX Y hyphen -100
-KPX Y e -89
-KPX Y comma -145
-KPX Y colon -10
-KPX Y a -93
-KPX Y O -30
-KPX Y A -80
-
-KPX a t 5
-KPX a p 20
-KPX a b 5
-
-KPX b y -20
-KPX b v -20
-
-KPX c y -20
-KPX c l -15
-KPX c k -15
-
-KPX comma space -50
-KPX comma quoteright -70
-KPX comma quotedblright -70
-
-KPX e y -20
-KPX e x -20
-KPX e w -20
-KPX e v -20
-
-KPX f period -40
-KPX f o -20
-KPX f l -15
-KPX f i -15
-KPX f f -20
-KPX f dotlessi -15
-KPX f comma -40
-KPX f a -15
-
-KPX g i 25
-KPX g a 15
-
-KPX h y -30
-
-KPX k y -5
-KPX k o -30
-KPX k e -40
-
-KPX m y -20
-KPX m u -20
-
-KPX n y -15
-KPX n v -30
-
-KPX o y -20
-KPX o x -30
-KPX o w -20
-KPX o v -30
-
-KPX p y -20
-
-KPX period space -50
-KPX period quoteright -70
-KPX period quotedblright -70
-
-KPX quotedblleft A -50
-
-KPX quotedblright space -50
-
-KPX quoteleft quoteleft -80
-KPX quoteleft A -50
-
-KPX quoteright v -10
-KPX quoteright t 10
-KPX quoteright space -50
-KPX quoteright s -15
-KPX quoteright r -20
-KPX quoteright quoteright -80
-KPX quoteright d -50
-
-KPX r y 40
-KPX r v 40
-KPX r u 20
-KPX r t 20
-KPX r s 20
-KPX r q -8
-KPX r period -73
-KPX r p 20
-KPX r o -15
-KPX r n 21
-KPX r m 15
-KPX r l 20
-KPX r k 5
-KPX r i 20
-KPX r hyphen -60
-KPX r g 1
-KPX r e -4
-KPX r d -6
-KPX r comma -75
-KPX r c -7
-
-KPX s period 20
-KPX s comma 20
-
-KPX space quoteleft -50
-KPX space quotedblleft -50
-KPX space Y -60
-KPX space W -25
-KPX space V -80
-KPX space T -25
-KPX space A -20
-
-KPX v period -90
-KPX v o -20
-KPX v e -20
-KPX v comma -90
-KPX v a -30
-
-KPX w period -90
-KPX w o -30
-KPX w e -20
-KPX w comma -90
-KPX w a -30
-
-KPX x e -20
-
-KPX y period -100
-KPX y o -30
-KPX y e -20
-KPX y comma -100
-KPX y c -35
-KPX y a -30
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 160 170 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 100 170 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 120 170 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 160 170 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 190 135 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 130 170 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 50 170 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex -10 170 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 10 170 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 50 170 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute -45 170 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -130 170 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -110 170 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave -95 170 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 130 170 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 210 170 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 150 170 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 170 170 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 210 170 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 180 170 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron -10 170 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 145 170 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 50 170 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 70 170 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 75 170 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 135 170 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 60 170 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 5 170 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 120 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 60 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 80 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 120 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 150 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 90 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 110 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 50 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 70 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 110 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -65 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -150 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -130 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -115 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 60 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 110 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 50 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 70 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 110 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 80 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron -50 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 125 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 30 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 50 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 55 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 115 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 40 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron -15 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/AvantGarde-DemiOblique.afm b/blt3.0.1/library/afm/AvantGarde-DemiOblique.afm
deleted file mode 100644
index ea40ef1..0000000
--- a/blt3.0.1/library/afm/AvantGarde-DemiOblique.afm
+++ /dev/null
@@ -1,577 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Mon Mar 4 13:49:44 1991
-Comment UniqueID 34373
-Comment VMusage 6550 39938
-FontName AvantGarde-DemiOblique
-FullName ITC Avant Garde Gothic Demi Oblique
-FamilyName ITC Avant Garde Gothic
-Weight Demi
-ItalicAngle -10.5
-IsFixedPitch false
-FontBBox -123 -251 1256 1021
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.ITC Avant Garde Gothic is a registered trademark of International Typeface Corporation.
-EncodingScheme AdobeStandardEncoding
-CapHeight 740
-XHeight 555
-Ascender 740
-Descender -185
-StartCharMetrics 228
-C 32 ; WX 280 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 280 ; N exclam ; B 73 0 343 740 ;
-C 34 ; WX 360 ; N quotedbl ; B 127 444 478 740 ;
-C 35 ; WX 560 ; N numbersign ; B 66 0 618 700 ;
-C 36 ; WX 560 ; N dollar ; B 99 -86 582 857 ;
-C 37 ; WX 860 ; N percent ; B 139 -15 856 755 ;
-C 38 ; WX 680 ; N ampersand ; B 71 -15 742 755 ;
-C 39 ; WX 280 ; N quoteright ; B 159 466 342 740 ;
-C 40 ; WX 380 ; N parenleft ; B 120 -157 490 754 ;
-C 41 ; WX 380 ; N parenright ; B 8 -157 378 754 ;
-C 42 ; WX 440 ; N asterisk ; B 174 457 492 755 ;
-C 43 ; WX 600 ; N plus ; B 84 0 610 506 ;
-C 44 ; WX 280 ; N comma ; B 48 -141 231 133 ;
-C 45 ; WX 420 ; N hyphen ; B 114 230 413 348 ;
-C 46 ; WX 280 ; N period ; B 73 0 231 133 ;
-C 47 ; WX 460 ; N slash ; B -13 -100 591 740 ;
-C 48 ; WX 560 ; N zero ; B 70 -15 628 755 ;
-C 49 ; WX 560 ; N one ; B 230 0 500 740 ;
-C 50 ; WX 560 ; N two ; B 44 0 622 755 ;
-C 51 ; WX 560 ; N three ; B 67 -15 585 755 ;
-C 52 ; WX 560 ; N four ; B 36 0 604 740 ;
-C 53 ; WX 560 ; N five ; B 64 -15 600 740 ;
-C 54 ; WX 560 ; N six ; B 64 -15 587 739 ;
-C 55 ; WX 560 ; N seven ; B 83 0 635 740 ;
-C 56 ; WX 560 ; N eight ; B 71 -15 590 755 ;
-C 57 ; WX 560 ; N nine ; B 110 0 633 754 ;
-C 58 ; WX 280 ; N colon ; B 73 0 309 555 ;
-C 59 ; WX 280 ; N semicolon ; B 48 -141 309 555 ;
-C 60 ; WX 600 ; N less ; B 84 -8 649 514 ;
-C 61 ; WX 600 ; N equal ; B 63 81 631 425 ;
-C 62 ; WX 600 ; N greater ; B 45 -8 610 514 ;
-C 63 ; WX 560 ; N question ; B 135 0 593 755 ;
-C 64 ; WX 740 ; N at ; B 109 -12 832 712 ;
-C 65 ; WX 740 ; N A ; B 7 0 732 740 ;
-C 66 ; WX 580 ; N B ; B 70 0 610 740 ;
-C 67 ; WX 780 ; N C ; B 97 -15 864 755 ;
-C 68 ; WX 700 ; N D ; B 63 0 732 740 ;
-C 69 ; WX 520 ; N E ; B 61 0 596 740 ;
-C 70 ; WX 480 ; N F ; B 61 0 575 740 ;
-C 71 ; WX 840 ; N G ; B 89 -15 887 755 ;
-C 72 ; WX 680 ; N H ; B 71 0 747 740 ;
-C 73 ; WX 280 ; N I ; B 72 0 346 740 ;
-C 74 ; WX 480 ; N J ; B 34 -15 546 740 ;
-C 75 ; WX 620 ; N K ; B 89 0 757 740 ;
-C 76 ; WX 440 ; N L ; B 72 0 459 740 ;
-C 77 ; WX 900 ; N M ; B 63 0 974 740 ;
-C 78 ; WX 740 ; N N ; B 70 0 808 740 ;
-C 79 ; WX 840 ; N O ; B 95 -15 882 755 ;
-C 80 ; WX 560 ; N P ; B 72 0 645 740 ;
-C 81 ; WX 840 ; N Q ; B 94 -15 882 755 ;
-C 82 ; WX 580 ; N R ; B 64 0 656 740 ;
-C 83 ; WX 520 ; N S ; B 49 -15 578 755 ;
-C 84 ; WX 420 ; N T ; B 119 0 555 740 ;
-C 85 ; WX 640 ; N U ; B 97 -15 722 740 ;
-C 86 ; WX 700 ; N V ; B 145 0 832 740 ;
-C 87 ; WX 900 ; N W ; B 144 0 1036 740 ;
-C 88 ; WX 680 ; N X ; B 4 0 813 740 ;
-C 89 ; WX 620 ; N Y ; B 135 0 759 740 ;
-C 90 ; WX 500 ; N Z ; B 19 0 599 740 ;
-C 91 ; WX 320 ; N bracketleft ; B 89 -157 424 754 ;
-C 92 ; WX 640 ; N backslash ; B 233 -100 525 740 ;
-C 93 ; WX 320 ; N bracketright ; B 7 -157 342 754 ;
-C 94 ; WX 600 ; N asciicircum ; B 142 375 596 740 ;
-C 95 ; WX 500 ; N underscore ; B -23 -125 486 -75 ;
-C 96 ; WX 280 ; N quoteleft ; B 158 466 341 740 ;
-C 97 ; WX 660 ; N a ; B 73 -18 716 574 ;
-C 98 ; WX 660 ; N b ; B 47 -18 689 740 ;
-C 99 ; WX 640 ; N c ; B 84 -18 679 574 ;
-C 100 ; WX 660 ; N d ; B 80 -18 755 740 ;
-C 101 ; WX 640 ; N e ; B 77 -18 667 577 ;
-C 102 ; WX 280 ; N f ; B 62 0 420 755 ; L i fi ; L l fl ;
-C 103 ; WX 660 ; N g ; B 33 -226 726 574 ;
-C 104 ; WX 600 ; N h ; B 54 0 614 740 ;
-C 105 ; WX 240 ; N i ; B 53 0 323 740 ;
-C 106 ; WX 260 ; N j ; B -18 -185 342 740 ;
-C 107 ; WX 580 ; N k ; B 80 0 648 740 ;
-C 108 ; WX 240 ; N l ; B 54 0 324 740 ;
-C 109 ; WX 940 ; N m ; B 54 0 954 574 ;
-C 110 ; WX 600 ; N n ; B 54 0 613 574 ;
-C 111 ; WX 640 ; N o ; B 71 -18 672 574 ;
-C 112 ; WX 660 ; N p ; B 13 -185 686 574 ;
-C 113 ; WX 660 ; N q ; B 78 -185 716 574 ;
-C 114 ; WX 320 ; N r ; B 63 0 423 574 ;
-C 115 ; WX 440 ; N s ; B 49 -18 483 574 ;
-C 116 ; WX 300 ; N t ; B 86 0 402 740 ;
-C 117 ; WX 600 ; N u ; B 87 -18 647 555 ;
-C 118 ; WX 560 ; N v ; B 106 0 659 555 ;
-C 119 ; WX 800 ; N w ; B 114 0 892 555 ;
-C 120 ; WX 560 ; N x ; B 3 0 632 555 ;
-C 121 ; WX 580 ; N y ; B 75 -185 674 555 ;
-C 122 ; WX 460 ; N z ; B 20 0 528 555 ;
-C 123 ; WX 340 ; N braceleft ; B 40 -191 455 747 ;
-C 124 ; WX 600 ; N bar ; B 214 -100 503 740 ;
-C 125 ; WX 340 ; N braceright ; B -12 -191 405 747 ;
-C 126 ; WX 600 ; N asciitilde ; B 114 160 579 347 ;
-C 161 ; WX 280 ; N exclamdown ; B 40 -185 310 555 ;
-C 162 ; WX 560 ; N cent ; B 110 39 599 715 ;
-C 163 ; WX 560 ; N sterling ; B 38 0 615 755 ;
-C 164 ; WX 160 ; N fraction ; B -123 0 419 740 ;
-C 165 ; WX 560 ; N yen ; B 83 0 707 740 ;
-C 166 ; WX 560 ; N florin ; B -27 -151 664 824 ;
-C 167 ; WX 560 ; N section ; B 65 -158 602 755 ;
-C 168 ; WX 560 ; N currency ; B 53 69 628 577 ;
-C 169 ; WX 220 ; N quotesingle ; B 152 444 314 740 ;
-C 170 ; WX 480 ; N quotedblleft ; B 156 466 546 740 ;
-C 171 ; WX 460 ; N guillemotleft ; B 105 108 487 469 ;
-C 172 ; WX 240 ; N guilsinglleft ; B 94 108 277 469 ;
-C 173 ; WX 240 ; N guilsinglright ; B 70 108 253 469 ;
-C 174 ; WX 520 ; N fi ; B 72 0 598 755 ;
-C 175 ; WX 520 ; N fl ; B 72 0 598 755 ;
-C 177 ; WX 500 ; N endash ; B 78 230 529 348 ;
-C 178 ; WX 560 ; N dagger ; B 133 -142 612 740 ;
-C 179 ; WX 560 ; N daggerdbl ; B 63 -142 618 740 ;
-C 180 ; WX 280 ; N periodcentered ; B 108 187 265 320 ;
-C 182 ; WX 600 ; N paragraph ; B 90 -103 744 740 ;
-C 183 ; WX 600 ; N bullet ; B 215 222 526 532 ;
-C 184 ; WX 280 ; N quotesinglbase ; B 47 -141 230 133 ;
-C 185 ; WX 480 ; N quotedblbase ; B 45 -141 435 133 ;
-C 186 ; WX 480 ; N quotedblright ; B 157 466 547 740 ;
-C 187 ; WX 460 ; N guillemotright ; B 81 108 463 469 ;
-C 188 ; WX 1000 ; N ellipsis ; B 100 0 924 133 ;
-C 189 ; WX 1280 ; N perthousand ; B 139 -15 1256 755 ;
-C 191 ; WX 560 ; N questiondown ; B 69 -200 527 555 ;
-C 193 ; WX 420 ; N grave ; B 189 624 462 851 ;
-C 194 ; WX 420 ; N acute ; B 224 624 508 849 ;
-C 195 ; WX 540 ; N circumflex ; B 189 636 588 774 ;
-C 196 ; WX 480 ; N tilde ; B 178 636 564 767 ;
-C 197 ; WX 420 ; N macron ; B 192 648 490 759 ;
-C 198 ; WX 480 ; N breve ; B 185 633 582 770 ;
-C 199 ; WX 280 ; N dotaccent ; B 192 636 350 769 ;
-C 200 ; WX 500 ; N dieresis ; B 196 636 565 769 ;
-C 202 ; WX 360 ; N ring ; B 206 619 424 834 ;
-C 203 ; WX 340 ; N cedilla ; B 67 -251 272 6 ;
-C 205 ; WX 700 ; N hungarumlaut ; B 258 610 754 862 ;
-C 206 ; WX 340 ; N ogonek ; B 59 -195 243 9 ;
-C 207 ; WX 540 ; N caron ; B 214 636 613 774 ;
-C 208 ; WX 1000 ; N emdash ; B 78 230 1029 348 ;
-C 225 ; WX 900 ; N AE ; B -5 0 961 740 ;
-C 227 ; WX 360 ; N ordfeminine ; B 127 438 472 755 ;
-C 232 ; WX 480 ; N Lslash ; B 68 0 484 740 ;
-C 233 ; WX 840 ; N Oslash ; B 94 -71 891 814 ;
-C 234 ; WX 1060 ; N OE ; B 98 -15 1144 755 ;
-C 235 ; WX 360 ; N ordmasculine ; B 131 438 451 755 ;
-C 241 ; WX 1080 ; N ae ; B 75 -18 1105 574 ;
-C 245 ; WX 240 ; N dotlessi ; B 53 0 289 555 ;
-C 248 ; WX 320 ; N lslash ; B 74 0 404 740 ;
-C 249 ; WX 660 ; N oslash ; B 81 -50 685 608 ;
-C 250 ; WX 1080 ; N oe ; B 76 -18 1108 574 ;
-C 251 ; WX 600 ; N germandbls ; B 51 -18 629 755 ;
-C -1 ; WX 640 ; N ecircumflex ; B 77 -18 667 774 ;
-C -1 ; WX 640 ; N edieresis ; B 77 -18 667 769 ;
-C -1 ; WX 660 ; N aacute ; B 73 -18 716 849 ;
-C -1 ; WX 740 ; N registered ; B 50 -12 827 752 ;
-C -1 ; WX 240 ; N icircumflex ; B 39 0 438 774 ;
-C -1 ; WX 600 ; N udieresis ; B 87 -18 647 769 ;
-C -1 ; WX 640 ; N ograve ; B 71 -18 672 851 ;
-C -1 ; WX 600 ; N uacute ; B 87 -18 647 849 ;
-C -1 ; WX 600 ; N ucircumflex ; B 87 -18 647 774 ;
-C -1 ; WX 740 ; N Aacute ; B 7 0 732 1019 ;
-C -1 ; WX 240 ; N igrave ; B 53 0 347 851 ;
-C -1 ; WX 280 ; N Icircumflex ; B 72 0 489 944 ;
-C -1 ; WX 640 ; N ccedilla ; B 83 -251 679 574 ;
-C -1 ; WX 660 ; N adieresis ; B 73 -18 716 769 ;
-C -1 ; WX 520 ; N Ecircumflex ; B 61 0 609 944 ;
-C -1 ; WX 440 ; N scaron ; B 49 -18 563 774 ;
-C -1 ; WX 660 ; N thorn ; B 13 -185 686 740 ;
-C -1 ; WX 1000 ; N trademark ; B 131 296 958 740 ;
-C -1 ; WX 640 ; N egrave ; B 77 -18 667 851 ;
-C -1 ; WX 336 ; N threesuperior ; B 87 287 413 749 ;
-C -1 ; WX 460 ; N zcaron ; B 20 0 598 774 ;
-C -1 ; WX 660 ; N atilde ; B 73 -18 716 767 ;
-C -1 ; WX 660 ; N aring ; B 73 -18 716 834 ;
-C -1 ; WX 640 ; N ocircumflex ; B 71 -18 672 774 ;
-C -1 ; WX 520 ; N Edieresis ; B 61 0 606 939 ;
-C -1 ; WX 840 ; N threequarters ; B 97 0 836 749 ;
-C -1 ; WX 580 ; N ydieresis ; B 75 -185 674 769 ;
-C -1 ; WX 580 ; N yacute ; B 75 -185 674 849 ;
-C -1 ; WX 240 ; N iacute ; B 53 0 443 849 ;
-C -1 ; WX 740 ; N Acircumflex ; B 7 0 732 944 ;
-C -1 ; WX 640 ; N Uacute ; B 97 -15 722 1019 ;
-C -1 ; WX 640 ; N eacute ; B 77 -18 667 849 ;
-C -1 ; WX 840 ; N Ograve ; B 95 -15 882 1021 ;
-C -1 ; WX 660 ; N agrave ; B 73 -18 716 851 ;
-C -1 ; WX 640 ; N Udieresis ; B 97 -15 722 939 ;
-C -1 ; WX 660 ; N acircumflex ; B 73 -18 716 774 ;
-C -1 ; WX 280 ; N Igrave ; B 72 0 398 1021 ;
-C -1 ; WX 336 ; N twosuperior ; B 73 296 436 749 ;
-C -1 ; WX 640 ; N Ugrave ; B 97 -15 722 1021 ;
-C -1 ; WX 840 ; N onequarter ; B 187 0 779 740 ;
-C -1 ; WX 640 ; N Ucircumflex ; B 97 -15 722 944 ;
-C -1 ; WX 520 ; N Scaron ; B 49 -15 635 944 ;
-C -1 ; WX 280 ; N Idieresis ; B 72 0 486 939 ;
-C -1 ; WX 240 ; N idieresis ; B 53 0 435 769 ;
-C -1 ; WX 520 ; N Egrave ; B 61 0 596 1021 ;
-C -1 ; WX 840 ; N Oacute ; B 95 -15 882 1019 ;
-C -1 ; WX 600 ; N divide ; B 84 -20 610 526 ;
-C -1 ; WX 740 ; N Atilde ; B 7 0 732 937 ;
-C -1 ; WX 740 ; N Aring ; B 7 0 732 969 ;
-C -1 ; WX 840 ; N Odieresis ; B 95 -15 882 939 ;
-C -1 ; WX 740 ; N Adieresis ; B 7 0 732 939 ;
-C -1 ; WX 740 ; N Ntilde ; B 70 0 808 937 ;
-C -1 ; WX 500 ; N Zcaron ; B 19 0 650 944 ;
-C -1 ; WX 560 ; N Thorn ; B 72 0 619 740 ;
-C -1 ; WX 280 ; N Iacute ; B 72 0 494 1019 ;
-C -1 ; WX 600 ; N plusminus ; B 37 -62 626 556 ;
-C -1 ; WX 600 ; N multiply ; B 76 12 617 494 ;
-C -1 ; WX 520 ; N Eacute ; B 61 0 596 1019 ;
-C -1 ; WX 620 ; N Ydieresis ; B 135 0 759 939 ;
-C -1 ; WX 336 ; N onesuperior ; B 182 296 360 740 ;
-C -1 ; WX 600 ; N ugrave ; B 87 -18 647 851 ;
-C -1 ; WX 600 ; N logicalnot ; B 105 108 631 425 ;
-C -1 ; WX 600 ; N ntilde ; B 54 0 624 767 ;
-C -1 ; WX 840 ; N Otilde ; B 95 -15 882 937 ;
-C -1 ; WX 640 ; N otilde ; B 71 -18 672 767 ;
-C -1 ; WX 780 ; N Ccedilla ; B 97 -251 864 755 ;
-C -1 ; WX 740 ; N Agrave ; B 7 0 732 1021 ;
-C -1 ; WX 840 ; N onehalf ; B 157 0 830 740 ;
-C -1 ; WX 742 ; N Eth ; B 83 0 766 740 ;
-C -1 ; WX 400 ; N degree ; B 160 426 451 712 ;
-C -1 ; WX 620 ; N Yacute ; B 135 0 759 1019 ;
-C -1 ; WX 840 ; N Ocircumflex ; B 95 -15 882 944 ;
-C -1 ; WX 640 ; N oacute ; B 71 -18 672 849 ;
-C -1 ; WX 576 ; N mu ; B 3 -187 642 555 ;
-C -1 ; WX 600 ; N minus ; B 84 193 610 313 ;
-C -1 ; WX 640 ; N eth ; B 73 -18 699 754 ;
-C -1 ; WX 640 ; N odieresis ; B 71 -18 672 769 ;
-C -1 ; WX 740 ; N copyright ; B 50 -12 827 752 ;
-C -1 ; WX 600 ; N brokenbar ; B 214 -100 503 740 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 218
-
-KPX A y -50
-KPX A w -65
-KPX A v -70
-KPX A u -20
-KPX A quoteright -90
-KPX A Y -80
-KPX A W -60
-KPX A V -102
-KPX A U -40
-KPX A T -25
-KPX A Q -50
-KPX A O -50
-KPX A G -40
-KPX A C -40
-
-KPX B A -10
-
-KPX C A -40
-
-KPX D period -20
-KPX D comma -20
-KPX D Y -45
-KPX D W -25
-KPX D V -50
-KPX D A -50
-
-KPX F period -129
-KPX F e -20
-KPX F comma -162
-KPX F a -20
-KPX F A -75
-
-KPX G period -20
-KPX G comma -20
-KPX G Y -15
-
-KPX J period -15
-KPX J a -20
-KPX J A -30
-
-KPX K y -20
-KPX K u -15
-KPX K o -45
-KPX K e -40
-KPX K O -30
-
-KPX L y -23
-KPX L quoteright -30
-KPX L quotedblright -30
-KPX L Y -80
-KPX L W -55
-KPX L V -85
-KPX L T -46
-
-KPX O period -30
-KPX O comma -30
-KPX O Y -30
-KPX O X -30
-KPX O W -20
-KPX O V -45
-KPX O T -15
-KPX O A -60
-
-KPX P period -200
-KPX P o -20
-KPX P e -20
-KPX P comma -220
-KPX P a -20
-KPX P A -100
-
-KPX Q comma 20
-
-KPX R W 25
-KPX R V -10
-KPX R U 25
-KPX R T 40
-KPX R O 25
-
-KPX S comma 20
-
-KPX T y -10
-KPX T w -55
-KPX T u -46
-KPX T semicolon -29
-KPX T r -30
-KPX T period -91
-KPX T o -49
-KPX T hyphen -75
-KPX T e -49
-KPX T comma -82
-KPX T colon -15
-KPX T a -70
-KPX T O -15
-KPX T A -25
-
-KPX U period -20
-KPX U comma -20
-KPX U A -40
-
-KPX V u -55
-KPX V semicolon -33
-KPX V period -145
-KPX V o -101
-KPX V i -15
-KPX V hyphen -75
-KPX V e -101
-KPX V comma -145
-KPX V colon -18
-KPX V a -95
-KPX V O -45
-KPX V G -20
-KPX V A -102
-
-KPX W y -15
-KPX W u -30
-KPX W semicolon -33
-KPX W period -106
-KPX W o -46
-KPX W i -10
-KPX W hyphen -35
-KPX W e -47
-KPX W comma -106
-KPX W colon -15
-KPX W a -50
-KPX W O -20
-KPX W A -58
-
-KPX Y u -52
-KPX Y semicolon -23
-KPX Y period -145
-KPX Y o -89
-KPX Y hyphen -100
-KPX Y e -89
-KPX Y comma -145
-KPX Y colon -10
-KPX Y a -93
-KPX Y O -30
-KPX Y A -80
-
-KPX a t 5
-KPX a p 20
-KPX a b 5
-
-KPX b y -20
-KPX b v -20
-
-KPX c y -20
-KPX c l -15
-KPX c k -15
-
-KPX comma space -50
-KPX comma quoteright -70
-KPX comma quotedblright -70
-
-KPX e y -20
-KPX e x -20
-KPX e w -20
-KPX e v -20
-
-KPX f period -40
-KPX f o -20
-KPX f l -15
-KPX f i -15
-KPX f f -20
-KPX f dotlessi -15
-KPX f comma -40
-KPX f a -15
-
-KPX g i 25
-KPX g a 15
-
-KPX h y -30
-
-KPX k y -5
-KPX k o -30
-KPX k e -40
-
-KPX m y -20
-KPX m u -20
-
-KPX n y -15
-KPX n v -30
-
-KPX o y -20
-KPX o x -30
-KPX o w -20
-KPX o v -30
-
-KPX p y -20
-
-KPX period space -50
-KPX period quoteright -70
-KPX period quotedblright -70
-
-KPX quotedblleft A -50
-
-KPX quotedblright space -50
-
-KPX quoteleft quoteleft -80
-KPX quoteleft A -50
-
-KPX quoteright v -10
-KPX quoteright t 10
-KPX quoteright space -50
-KPX quoteright s -15
-KPX quoteright r -20
-KPX quoteright quoteright -80
-KPX quoteright d -50
-
-KPX r y 40
-KPX r v 40
-KPX r u 20
-KPX r t 20
-KPX r s 20
-KPX r q -8
-KPX r period -73
-KPX r p 20
-KPX r o -15
-KPX r n 21
-KPX r m 15
-KPX r l 20
-KPX r k 5
-KPX r i 20
-KPX r hyphen -60
-KPX r g 1
-KPX r e -4
-KPX r d -6
-KPX r comma -75
-KPX r c -7
-
-KPX s period 20
-KPX s comma 20
-
-KPX space quoteleft -50
-KPX space quotedblleft -50
-KPX space Y -60
-KPX space W -25
-KPX space V -80
-KPX space T -25
-KPX space A -20
-
-KPX v period -90
-KPX v o -20
-KPX v e -20
-KPX v comma -90
-KPX v a -30
-
-KPX w period -90
-KPX w o -30
-KPX w e -20
-KPX w comma -90
-KPX w a -30
-
-KPX x e -20
-
-KPX y period -100
-KPX y o -30
-KPX y e -20
-KPX y comma -100
-KPX y c -35
-KPX y a -30
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 192 170 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 132 170 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 152 170 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 192 170 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 215 135 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 162 170 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 82 170 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 22 170 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 42 170 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 82 170 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute -13 170 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -98 170 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -78 170 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave -63 170 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 162 170 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 242 170 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 182 170 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 202 170 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 242 170 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 212 170 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 22 170 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 177 170 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 82 170 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 102 170 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 107 170 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 167 170 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 92 170 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 37 170 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 120 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 60 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 80 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 120 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 150 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 90 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 110 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 50 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 70 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 110 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -65 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -150 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -130 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -115 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 60 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 110 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 50 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 70 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 110 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 80 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron -50 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 125 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 30 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 50 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 55 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 115 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 40 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron -15 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Bookman-Demi.afm b/blt3.0.1/library/afm/Bookman-Demi.afm
deleted file mode 100644
index 51cb737..0000000
--- a/blt3.0.1/library/afm/Bookman-Demi.afm
+++ /dev/null
@@ -1,416 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Tue Jan 21 16:13:29 1992
-Comment UniqueID 37831
-Comment VMusage 31983 38875
-FontName Bookman-Demi
-FullName ITC Bookman Demi
-FamilyName ITC Bookman
-Weight Demi
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -194 -250 1346 934
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.004
-Notice Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.ITC Bookman is a registered trademark of International Typeface Corporation.
-EncodingScheme AdobeStandardEncoding
-CapHeight 681
-XHeight 502
-Ascender 725
-Descender -212
-StartCharMetrics 228
-C 32 ; WX 340 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 360 ; N exclam ; B 82 -8 282 698 ;
-C 34 ; WX 420 ; N quotedbl ; B 11 379 369 698 ;
-C 35 ; WX 660 ; N numbersign ; B 84 0 576 681 ;
-C 36 ; WX 660 ; N dollar ; B 48 -119 620 805 ;
-C 37 ; WX 940 ; N percent ; B 12 -8 924 698 ;
-C 38 ; WX 800 ; N ampersand ; B 21 -17 772 698 ;
-C 39 ; WX 320 ; N quoteright ; B 82 440 242 698 ;
-C 40 ; WX 320 ; N parenleft ; B 48 -150 289 749 ;
-C 41 ; WX 320 ; N parenright ; B 20 -150 262 749 ;
-C 42 ; WX 460 ; N asterisk ; B 62 317 405 697 ;
-C 43 ; WX 600 ; N plus ; B 51 9 555 514 ;
-C 44 ; WX 340 ; N comma ; B 78 -124 257 162 ;
-C 45 ; WX 360 ; N hyphen ; B 20 210 340 318 ;
-C 46 ; WX 340 ; N period ; B 76 -8 258 172 ;
-C 47 ; WX 600 ; N slash ; B 50 -149 555 725 ;
-C 48 ; WX 660 ; N zero ; B 30 -17 639 698 ;
-C 49 ; WX 660 ; N one ; B 137 0 568 681 ;
-C 50 ; WX 660 ; N two ; B 41 0 628 698 ;
-C 51 ; WX 660 ; N three ; B 37 -17 631 698 ;
-C 52 ; WX 660 ; N four ; B 19 0 649 681 ;
-C 53 ; WX 660 ; N five ; B 44 -17 623 723 ;
-C 54 ; WX 660 ; N six ; B 34 -17 634 698 ;
-C 55 ; WX 660 ; N seven ; B 36 0 632 681 ;
-C 56 ; WX 660 ; N eight ; B 36 -17 633 698 ;
-C 57 ; WX 660 ; N nine ; B 33 -17 636 698 ;
-C 58 ; WX 340 ; N colon ; B 76 -8 258 515 ;
-C 59 ; WX 340 ; N semicolon ; B 75 -124 259 515 ;
-C 60 ; WX 600 ; N less ; B 49 -9 558 542 ;
-C 61 ; WX 600 ; N equal ; B 51 109 555 421 ;
-C 62 ; WX 600 ; N greater ; B 48 -9 557 542 ;
-C 63 ; WX 660 ; N question ; B 61 -8 608 698 ;
-C 64 ; WX 820 ; N at ; B 60 -17 758 698 ;
-C 65 ; WX 720 ; N A ; B -34 0 763 681 ;
-C 66 ; WX 720 ; N B ; B 20 0 693 681 ;
-C 67 ; WX 740 ; N C ; B 35 -17 724 698 ;
-C 68 ; WX 780 ; N D ; B 20 0 748 681 ;
-C 69 ; WX 720 ; N E ; B 20 0 724 681 ;
-C 70 ; WX 680 ; N F ; B 20 0 686 681 ;
-C 71 ; WX 780 ; N G ; B 35 -17 773 698 ;
-C 72 ; WX 820 ; N H ; B 20 0 800 681 ;
-C 73 ; WX 400 ; N I ; B 20 0 379 681 ;
-C 74 ; WX 640 ; N J ; B -12 -17 622 681 ;
-C 75 ; WX 800 ; N K ; B 20 0 796 681 ;
-C 76 ; WX 640 ; N L ; B 20 0 668 681 ;
-C 77 ; WX 940 ; N M ; B 20 0 924 681 ;
-C 78 ; WX 740 ; N N ; B 20 0 724 681 ;
-C 79 ; WX 800 ; N O ; B 35 -17 769 698 ;
-C 80 ; WX 660 ; N P ; B 20 0 658 681 ;
-C 81 ; WX 800 ; N Q ; B 35 -226 775 698 ;
-C 82 ; WX 780 ; N R ; B 20 0 783 681 ;
-C 83 ; WX 660 ; N S ; B 21 -17 639 698 ;
-C 84 ; WX 700 ; N T ; B -4 0 703 681 ;
-C 85 ; WX 740 ; N U ; B 15 -17 724 681 ;
-C 86 ; WX 720 ; N V ; B -20 0 730 681 ;
-C 87 ; WX 940 ; N W ; B -20 0 963 681 ;
-C 88 ; WX 780 ; N X ; B 1 0 770 681 ;
-C 89 ; WX 700 ; N Y ; B -20 0 718 681 ;
-C 90 ; WX 640 ; N Z ; B 6 0 635 681 ;
-C 91 ; WX 300 ; N bracketleft ; B 75 -138 285 725 ;
-C 92 ; WX 600 ; N backslash ; B 50 0 555 725 ;
-C 93 ; WX 300 ; N bracketright ; B 21 -138 231 725 ;
-C 94 ; WX 600 ; N asciicircum ; B 52 281 554 681 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 320 ; N quoteleft ; B 82 440 242 698 ;
-C 97 ; WX 580 ; N a ; B 28 -8 588 515 ;
-C 98 ; WX 600 ; N b ; B -20 -8 568 725 ;
-C 99 ; WX 580 ; N c ; B 31 -8 550 515 ;
-C 100 ; WX 640 ; N d ; B 31 -8 622 725 ;
-C 101 ; WX 580 ; N e ; B 31 -8 548 515 ;
-C 102 ; WX 380 ; N f ; B 22 0 461 741 ; L i fi ; L l fl ;
-C 103 ; WX 580 ; N g ; B 9 -243 583 595 ;
-C 104 ; WX 680 ; N h ; B 22 0 654 725 ;
-C 105 ; WX 360 ; N i ; B 22 0 335 729 ;
-C 106 ; WX 340 ; N j ; B -94 -221 278 729 ;
-C 107 ; WX 660 ; N k ; B 22 0 643 725 ;
-C 108 ; WX 340 ; N l ; B 9 0 322 725 ;
-C 109 ; WX 1000 ; N m ; B 22 0 980 515 ;
-C 110 ; WX 680 ; N n ; B 22 0 652 515 ;
-C 111 ; WX 620 ; N o ; B 31 -8 585 515 ;
-C 112 ; WX 640 ; N p ; B 22 -212 611 515 ;
-C 113 ; WX 620 ; N q ; B 31 -212 633 515 ;
-C 114 ; WX 460 ; N r ; B 22 0 462 502 ;
-C 115 ; WX 520 ; N s ; B 22 -8 492 515 ;
-C 116 ; WX 460 ; N t ; B 22 -8 445 660 ;
-C 117 ; WX 660 ; N u ; B 22 -8 653 502 ;
-C 118 ; WX 600 ; N v ; B -6 0 593 502 ;
-C 119 ; WX 800 ; N w ; B -6 0 810 502 ;
-C 120 ; WX 600 ; N x ; B 8 0 591 502 ;
-C 121 ; WX 620 ; N y ; B 6 -221 613 502 ;
-C 122 ; WX 560 ; N z ; B 22 0 547 502 ;
-C 123 ; WX 320 ; N braceleft ; B 14 -139 301 726 ;
-C 124 ; WX 600 ; N bar ; B 243 -250 362 750 ;
-C 125 ; WX 320 ; N braceright ; B 15 -140 302 725 ;
-C 126 ; WX 600 ; N asciitilde ; B 51 162 555 368 ;
-C 161 ; WX 360 ; N exclamdown ; B 84 -191 284 515 ;
-C 162 ; WX 660 ; N cent ; B 133 17 535 674 ;
-C 163 ; WX 660 ; N sterling ; B 10 -17 659 698 ;
-C 164 ; WX 120 ; N fraction ; B -194 0 312 681 ;
-C 165 ; WX 660 ; N yen ; B -28 0 696 681 ;
-C 166 ; WX 660 ; N florin ; B -46 -209 674 749 ;
-C 167 ; WX 600 ; N section ; B 36 -153 560 698 ;
-C 168 ; WX 660 ; N currency ; B 77 88 584 593 ;
-C 169 ; WX 240 ; N quotesingle ; B 42 379 178 698 ;
-C 170 ; WX 540 ; N quotedblleft ; B 82 439 449 698 ;
-C 171 ; WX 400 ; N guillemotleft ; B 34 101 360 457 ;
-C 172 ; WX 220 ; N guilsinglleft ; B 34 101 188 457 ;
-C 173 ; WX 220 ; N guilsinglright ; B 34 101 188 457 ;
-C 174 ; WX 740 ; N fi ; B 22 0 710 741 ;
-C 175 ; WX 740 ; N fl ; B 22 0 710 741 ;
-C 177 ; WX 500 ; N endash ; B -25 212 525 318 ;
-C 178 ; WX 440 ; N dagger ; B 33 -156 398 698 ;
-C 179 ; WX 380 ; N daggerdbl ; B 8 -156 380 698 ;
-C 180 ; WX 340 ; N periodcentered ; B 76 175 258 355 ;
-C 182 ; WX 800 ; N paragraph ; B 51 0 698 681 ;
-C 183 ; WX 460 ; N bullet ; B 60 170 404 511 ;
-C 184 ; WX 320 ; N quotesinglbase ; B 82 -114 242 144 ;
-C 185 ; WX 540 ; N quotedblbase ; B 82 -114 450 144 ;
-C 186 ; WX 540 ; N quotedblright ; B 82 440 449 698 ;
-C 187 ; WX 400 ; N guillemotright ; B 34 101 360 457 ;
-C 188 ; WX 1000 ; N ellipsis ; B 76 -8 924 172 ;
-C 189 ; WX 1360 ; N perthousand ; B 12 -8 1346 698 ;
-C 191 ; WX 660 ; N questiondown ; B 62 -191 609 515 ;
-C 193 ; WX 400 ; N grave ; B 68 547 327 730 ;
-C 194 ; WX 400 ; N acute ; B 68 547 327 731 ;
-C 195 ; WX 500 ; N circumflex ; B 68 555 430 731 ;
-C 196 ; WX 480 ; N tilde ; B 69 556 421 691 ;
-C 197 ; WX 460 ; N macron ; B 68 577 383 663 ;
-C 198 ; WX 500 ; N breve ; B 68 553 429 722 ;
-C 199 ; WX 320 ; N dotaccent ; B 68 536 259 730 ;
-C 200 ; WX 500 ; N dieresis ; B 68 560 441 698 ;
-C 202 ; WX 340 ; N ring ; B 68 552 275 755 ;
-C 203 ; WX 360 ; N cedilla ; B 68 -213 284 0 ;
-C 205 ; WX 440 ; N hungarumlaut ; B 68 554 365 741 ;
-C 206 ; WX 320 ; N ogonek ; B 68 -163 246 0 ;
-C 207 ; WX 500 ; N caron ; B 68 541 430 717 ;
-C 208 ; WX 1000 ; N emdash ; B -25 212 1025 318 ;
-C 225 ; WX 1140 ; N AE ; B -34 0 1149 681 ;
-C 227 ; WX 400 ; N ordfeminine ; B 27 383 396 698 ;
-C 232 ; WX 640 ; N Lslash ; B 20 0 668 681 ;
-C 233 ; WX 800 ; N Oslash ; B 35 -110 771 781 ;
-C 234 ; WX 1220 ; N OE ; B 35 -17 1219 698 ;
-C 235 ; WX 400 ; N ordmasculine ; B 17 383 383 698 ;
-C 241 ; WX 880 ; N ae ; B 28 -8 852 515 ;
-C 245 ; WX 360 ; N dotlessi ; B 22 0 335 502 ;
-C 248 ; WX 340 ; N lslash ; B 9 0 322 725 ;
-C 249 ; WX 620 ; N oslash ; B 31 -40 586 551 ;
-C 250 ; WX 940 ; N oe ; B 31 -8 908 515 ;
-C 251 ; WX 660 ; N germandbls ; B -61 -91 644 699 ;
-C -1 ; WX 580 ; N ecircumflex ; B 31 -8 548 731 ;
-C -1 ; WX 580 ; N edieresis ; B 31 -8 548 698 ;
-C -1 ; WX 580 ; N aacute ; B 28 -8 588 731 ;
-C -1 ; WX 740 ; N registered ; B 23 -17 723 698 ;
-C -1 ; WX 360 ; N icircumflex ; B -2 0 360 731 ;
-C -1 ; WX 660 ; N udieresis ; B 22 -8 653 698 ;
-C -1 ; WX 620 ; N ograve ; B 31 -8 585 730 ;
-C -1 ; WX 660 ; N uacute ; B 22 -8 653 731 ;
-C -1 ; WX 660 ; N ucircumflex ; B 22 -8 653 731 ;
-C -1 ; WX 720 ; N Aacute ; B -34 0 763 910 ;
-C -1 ; WX 360 ; N igrave ; B 22 0 335 730 ;
-C -1 ; WX 400 ; N Icircumflex ; B 18 0 380 910 ;
-C -1 ; WX 580 ; N ccedilla ; B 31 -213 550 515 ;
-C -1 ; WX 580 ; N adieresis ; B 28 -8 588 698 ;
-C -1 ; WX 720 ; N Ecircumflex ; B 20 0 724 910 ;
-C -1 ; WX 520 ; N scaron ; B 22 -8 492 717 ;
-C -1 ; WX 640 ; N thorn ; B 22 -212 611 725 ;
-C -1 ; WX 980 ; N trademark ; B 42 277 982 681 ;
-C -1 ; WX 580 ; N egrave ; B 31 -8 548 730 ;
-C -1 ; WX 396 ; N threesuperior ; B 5 269 391 698 ;
-C -1 ; WX 560 ; N zcaron ; B 22 0 547 717 ;
-C -1 ; WX 580 ; N atilde ; B 28 -8 588 691 ;
-C -1 ; WX 580 ; N aring ; B 28 -8 588 755 ;
-C -1 ; WX 620 ; N ocircumflex ; B 31 -8 585 731 ;
-C -1 ; WX 720 ; N Edieresis ; B 20 0 724 877 ;
-C -1 ; WX 990 ; N threequarters ; B 15 0 967 692 ;
-C -1 ; WX 620 ; N ydieresis ; B 6 -221 613 698 ;
-C -1 ; WX 620 ; N yacute ; B 6 -221 613 731 ;
-C -1 ; WX 360 ; N iacute ; B 22 0 335 731 ;
-C -1 ; WX 720 ; N Acircumflex ; B -34 0 763 910 ;
-C -1 ; WX 740 ; N Uacute ; B 15 -17 724 910 ;
-C -1 ; WX 580 ; N eacute ; B 31 -8 548 731 ;
-C -1 ; WX 800 ; N Ograve ; B 35 -17 769 909 ;
-C -1 ; WX 580 ; N agrave ; B 28 -8 588 730 ;
-C -1 ; WX 740 ; N Udieresis ; B 15 -17 724 877 ;
-C -1 ; WX 580 ; N acircumflex ; B 28 -8 588 731 ;
-C -1 ; WX 400 ; N Igrave ; B 20 0 379 909 ;
-C -1 ; WX 396 ; N twosuperior ; B 14 279 396 698 ;
-C -1 ; WX 740 ; N Ugrave ; B 15 -17 724 909 ;
-C -1 ; WX 990 ; N onequarter ; B 65 0 967 681 ;
-C -1 ; WX 740 ; N Ucircumflex ; B 15 -17 724 910 ;
-C -1 ; WX 660 ; N Scaron ; B 21 -17 639 896 ;
-C -1 ; WX 400 ; N Idieresis ; B 18 0 391 877 ;
-C -1 ; WX 360 ; N idieresis ; B -2 0 371 698 ;
-C -1 ; WX 720 ; N Egrave ; B 20 0 724 909 ;
-C -1 ; WX 800 ; N Oacute ; B 35 -17 769 910 ;
-C -1 ; WX 600 ; N divide ; B 51 9 555 521 ;
-C -1 ; WX 720 ; N Atilde ; B -34 0 763 870 ;
-C -1 ; WX 720 ; N Aring ; B -34 0 763 934 ;
-C -1 ; WX 800 ; N Odieresis ; B 35 -17 769 877 ;
-C -1 ; WX 720 ; N Adieresis ; B -34 0 763 877 ;
-C -1 ; WX 740 ; N Ntilde ; B 20 0 724 870 ;
-C -1 ; WX 640 ; N Zcaron ; B 6 0 635 896 ;
-C -1 ; WX 660 ; N Thorn ; B 20 0 658 681 ;
-C -1 ; WX 400 ; N Iacute ; B 20 0 379 910 ;
-C -1 ; WX 600 ; N plusminus ; B 51 0 555 514 ;
-C -1 ; WX 600 ; N multiply ; B 48 10 552 514 ;
-C -1 ; WX 720 ; N Eacute ; B 20 0 724 910 ;
-C -1 ; WX 700 ; N Ydieresis ; B -20 0 718 877 ;
-C -1 ; WX 396 ; N onesuperior ; B 65 279 345 687 ;
-C -1 ; WX 660 ; N ugrave ; B 22 -8 653 730 ;
-C -1 ; WX 600 ; N logicalnot ; B 51 129 555 421 ;
-C -1 ; WX 680 ; N ntilde ; B 22 0 652 691 ;
-C -1 ; WX 800 ; N Otilde ; B 35 -17 769 870 ;
-C -1 ; WX 620 ; N otilde ; B 31 -8 585 691 ;
-C -1 ; WX 740 ; N Ccedilla ; B 35 -213 724 698 ;
-C -1 ; WX 720 ; N Agrave ; B -34 0 763 909 ;
-C -1 ; WX 990 ; N onehalf ; B 65 0 980 681 ;
-C -1 ; WX 780 ; N Eth ; B 20 0 748 681 ;
-C -1 ; WX 400 ; N degree ; B 50 398 350 698 ;
-C -1 ; WX 700 ; N Yacute ; B -20 0 718 910 ;
-C -1 ; WX 800 ; N Ocircumflex ; B 35 -17 769 910 ;
-C -1 ; WX 620 ; N oacute ; B 31 -8 585 731 ;
-C -1 ; WX 660 ; N mu ; B 22 -221 653 502 ;
-C -1 ; WX 600 ; N minus ; B 51 207 555 323 ;
-C -1 ; WX 620 ; N eth ; B 31 -8 585 741 ;
-C -1 ; WX 620 ; N odieresis ; B 31 -8 585 698 ;
-C -1 ; WX 740 ; N copyright ; B 23 -17 723 698 ;
-C -1 ; WX 600 ; N brokenbar ; B 243 -175 362 675 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 90
-
-KPX A y -1
-KPX A w -9
-KPX A v -8
-KPX A Y -52
-KPX A W -20
-KPX A V -68
-KPX A T -40
-
-KPX F period -132
-KPX F comma -130
-KPX F A -59
-
-KPX L y 19
-KPX L Y -35
-KPX L W -41
-KPX L V -50
-KPX L T -4
-
-KPX P period -128
-KPX P comma -129
-KPX P A -46
-
-KPX R y -8
-KPX R Y -20
-KPX R W -24
-KPX R V -29
-KPX R T -4
-
-KPX T semicolon 5
-KPX T s -10
-KPX T r 27
-KPX T period -122
-KPX T o -28
-KPX T i 27
-KPX T hyphen -10
-KPX T e -29
-KPX T comma -122
-KPX T colon 7
-KPX T c -29
-KPX T a -24
-KPX T A -42
-
-KPX V y 12
-KPX V u -11
-KPX V semicolon -38
-KPX V r -15
-KPX V period -105
-KPX V o -79
-KPX V i 15
-KPX V hyphen -10
-KPX V e -80
-KPX V comma -103
-KPX V colon -37
-KPX V a -74
-KPX V A -88
-
-KPX W y 12
-KPX W u -11
-KPX W semicolon -38
-KPX W r -15
-KPX W period -105
-KPX W o -78
-KPX W i 15
-KPX W hyphen -10
-KPX W e -79
-KPX W comma -103
-KPX W colon -37
-KPX W a -73
-KPX W A -60
-
-KPX Y v 24
-KPX Y u -13
-KPX Y semicolon -34
-KPX Y q -66
-KPX Y period -105
-KPX Y p -23
-KPX Y o -66
-KPX Y i 2
-KPX Y hyphen -10
-KPX Y e -67
-KPX Y comma -103
-KPX Y colon -32
-KPX Y a -60
-KPX Y A -56
-
-KPX f f 21
-
-KPX r q -9
-KPX r period -102
-KPX r o -9
-KPX r n 20
-KPX r m 20
-KPX r hyphen -10
-KPX r h -23
-KPX r g -9
-KPX r f 20
-KPX r e -10
-KPX r d -10
-KPX r comma -101
-KPX r c -9
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 160 179 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 110 179 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 110 179 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 160 179 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 190 179 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 120 179 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 160 179 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 110 179 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 110 179 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 160 179 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 0 179 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -50 179 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -50 179 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 0 179 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 130 179 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 200 179 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 150 179 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 150 179 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 200 179 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 160 179 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 80 179 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 170 179 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 120 179 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 120 179 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 170 179 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 150 179 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 100 179 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 70 179 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 90 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 40 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 40 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 90 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 100 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 30 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 90 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 40 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 40 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 90 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -20 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -70 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -70 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -20 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 80 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 110 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 60 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 60 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 110 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 50 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 10 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 130 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 80 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 80 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 130 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 110 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 60 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 30 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Bookman-DemiItalic.afm b/blt3.0.1/library/afm/Bookman-DemiItalic.afm
deleted file mode 100644
index 4b05c18..0000000
--- a/blt3.0.1/library/afm/Bookman-DemiItalic.afm
+++ /dev/null
@@ -1,418 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Tue Jan 21 16:12:43 1992
-Comment UniqueID 37832
-Comment VMusage 32139 39031
-FontName Bookman-DemiItalic
-FullName ITC Bookman Demi Italic
-FamilyName ITC Bookman
-Weight Demi
-ItalicAngle -10
-IsFixedPitch false
-FontBBox -231 -250 1333 941
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.004
-Notice Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.ITC Bookman is a registered trademark of International Typeface Corporation.
-EncodingScheme AdobeStandardEncoding
-CapHeight 681
-XHeight 515
-Ascender 732
-Descender -213
-StartCharMetrics 228
-C 32 ; WX 340 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 320 ; N exclam ; B 86 -8 366 698 ;
-C 34 ; WX 380 ; N quotedbl ; B 140 371 507 697 ;
-C 35 ; WX 680 ; N numbersign ; B 157 0 649 681 ;
-C 36 ; WX 680 ; N dollar ; B 45 -164 697 790 ;
-C 37 ; WX 880 ; N percent ; B 106 -17 899 698 ;
-C 38 ; WX 980 ; N ampersand ; B 48 -17 1016 698 ;
-C 39 ; WX 320 ; N quoteright ; B 171 420 349 698 ;
-C 40 ; WX 260 ; N parenleft ; B 31 -134 388 741 ;
-C 41 ; WX 260 ; N parenright ; B -35 -134 322 741 ;
-C 42 ; WX 460 ; N asterisk ; B 126 346 508 698 ;
-C 43 ; WX 600 ; N plus ; B 91 9 595 514 ;
-C 44 ; WX 340 ; N comma ; B 100 -124 298 185 ;
-C 45 ; WX 280 ; N hyphen ; B 59 218 319 313 ;
-C 46 ; WX 340 ; N period ; B 106 -8 296 177 ;
-C 47 ; WX 360 ; N slash ; B 9 -106 502 742 ;
-C 48 ; WX 680 ; N zero ; B 87 -17 703 698 ;
-C 49 ; WX 680 ; N one ; B 123 0 565 681 ;
-C 50 ; WX 680 ; N two ; B 67 0 674 698 ;
-C 51 ; WX 680 ; N three ; B 72 -17 683 698 ;
-C 52 ; WX 680 ; N four ; B 63 0 708 681 ;
-C 53 ; WX 680 ; N five ; B 78 -17 669 681 ;
-C 54 ; WX 680 ; N six ; B 88 -17 704 698 ;
-C 55 ; WX 680 ; N seven ; B 123 0 739 681 ;
-C 56 ; WX 680 ; N eight ; B 68 -17 686 698 ;
-C 57 ; WX 680 ; N nine ; B 71 -17 712 698 ;
-C 58 ; WX 340 ; N colon ; B 106 -8 356 515 ;
-C 59 ; WX 340 ; N semicolon ; B 100 -124 352 515 ;
-C 60 ; WX 620 ; N less ; B 79 -9 588 540 ;
-C 61 ; WX 600 ; N equal ; B 91 109 595 421 ;
-C 62 ; WX 620 ; N greater ; B 89 -9 598 540 ;
-C 63 ; WX 620 ; N question ; B 145 -8 668 698 ;
-C 64 ; WX 780 ; N at ; B 80 -17 790 698 ;
-C 65 ; WX 720 ; N A ; B -27 0 769 681 ;
-C 66 ; WX 720 ; N B ; B 14 0 762 681 ;
-C 67 ; WX 700 ; N C ; B 78 -17 754 698 ;
-C 68 ; WX 760 ; N D ; B 14 0 805 681 ;
-C 69 ; WX 720 ; N E ; B 14 0 777 681 ;
-C 70 ; WX 660 ; N F ; B 14 0 763 681 ;
-C 71 ; WX 760 ; N G ; B 77 -17 828 698 ;
-C 72 ; WX 800 ; N H ; B 14 0 910 681 ;
-C 73 ; WX 380 ; N I ; B 14 0 485 681 ;
-C 74 ; WX 620 ; N J ; B 8 -17 721 681 ;
-C 75 ; WX 780 ; N K ; B 14 0 879 681 ;
-C 76 ; WX 640 ; N L ; B 14 0 725 681 ;
-C 77 ; WX 860 ; N M ; B 14 0 970 681 ;
-C 78 ; WX 740 ; N N ; B 14 0 845 681 ;
-C 79 ; WX 760 ; N O ; B 78 -17 806 698 ;
-C 80 ; WX 640 ; N P ; B -6 0 724 681 ;
-C 81 ; WX 760 ; N Q ; B 37 -213 805 698 ;
-C 82 ; WX 740 ; N R ; B 14 0 765 681 ;
-C 83 ; WX 700 ; N S ; B 59 -17 731 698 ;
-C 84 ; WX 700 ; N T ; B 70 0 802 681 ;
-C 85 ; WX 740 ; N U ; B 112 -17 855 681 ;
-C 86 ; WX 660 ; N V ; B 72 0 819 681 ;
-C 87 ; WX 1000 ; N W ; B 72 0 1090 681 ;
-C 88 ; WX 740 ; N X ; B -7 0 835 681 ;
-C 89 ; WX 660 ; N Y ; B 72 0 817 681 ;
-C 90 ; WX 680 ; N Z ; B 23 0 740 681 ;
-C 91 ; WX 260 ; N bracketleft ; B 9 -118 374 741 ;
-C 92 ; WX 580 ; N backslash ; B 73 0 575 741 ;
-C 93 ; WX 260 ; N bracketright ; B -18 -118 347 741 ;
-C 94 ; WX 620 ; N asciicircum ; B 92 281 594 681 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 320 ; N quoteleft ; B 155 420 333 698 ;
-C 97 ; WX 680 ; N a ; B 84 -8 735 515 ;
-C 98 ; WX 600 ; N b ; B 57 -8 633 732 ;
-C 99 ; WX 560 ; N c ; B 58 -8 597 515 ;
-C 100 ; WX 680 ; N d ; B 60 -8 714 732 ;
-C 101 ; WX 560 ; N e ; B 59 -8 596 515 ;
-C 102 ; WX 420 ; N f ; B -192 -213 641 741 ; L i fi ; L l fl ;
-C 103 ; WX 620 ; N g ; B 21 -213 669 515 ;
-C 104 ; WX 700 ; N h ; B 93 -8 736 732 ;
-C 105 ; WX 380 ; N i ; B 83 -8 420 755 ;
-C 106 ; WX 320 ; N j ; B -160 -213 392 755 ;
-C 107 ; WX 700 ; N k ; B 97 -8 732 732 ;
-C 108 ; WX 380 ; N l ; B 109 -8 410 732 ;
-C 109 ; WX 960 ; N m ; B 83 -8 996 515 ;
-C 110 ; WX 680 ; N n ; B 83 -8 715 515 ;
-C 111 ; WX 600 ; N o ; B 59 -8 627 515 ;
-C 112 ; WX 660 ; N p ; B -24 -213 682 515 ;
-C 113 ; WX 620 ; N q ; B 60 -213 640 515 ;
-C 114 ; WX 500 ; N r ; B 84 0 582 515 ;
-C 115 ; WX 540 ; N s ; B 32 -8 573 515 ;
-C 116 ; WX 440 ; N t ; B 106 -8 488 658 ;
-C 117 ; WX 680 ; N u ; B 83 -8 720 507 ;
-C 118 ; WX 540 ; N v ; B 56 -8 572 515 ;
-C 119 ; WX 860 ; N w ; B 56 -8 891 515 ;
-C 120 ; WX 620 ; N x ; B 10 -8 654 515 ;
-C 121 ; WX 600 ; N y ; B 25 -213 642 507 ;
-C 122 ; WX 560 ; N z ; B 36 -8 586 515 ;
-C 123 ; WX 300 ; N braceleft ; B 49 -123 413 742 ;
-C 124 ; WX 620 ; N bar ; B 303 -250 422 750 ;
-C 125 ; WX 300 ; N braceright ; B -8 -114 356 751 ;
-C 126 ; WX 620 ; N asciitilde ; B 101 162 605 368 ;
-C 161 ; WX 320 ; N exclamdown ; B 64 -191 344 515 ;
-C 162 ; WX 680 ; N cent ; B 161 25 616 718 ;
-C 163 ; WX 680 ; N sterling ; B 0 -17 787 698 ;
-C 164 ; WX 120 ; N fraction ; B -144 0 382 681 ;
-C 165 ; WX 680 ; N yen ; B 92 0 782 681 ;
-C 166 ; WX 680 ; N florin ; B -28 -199 743 741 ;
-C 167 ; WX 620 ; N section ; B 46 -137 638 698 ;
-C 168 ; WX 680 ; N currency ; B 148 85 637 571 ;
-C 169 ; WX 180 ; N quotesingle ; B 126 370 295 696 ;
-C 170 ; WX 520 ; N quotedblleft ; B 156 420 545 698 ;
-C 171 ; WX 380 ; N guillemotleft ; B 62 84 406 503 ;
-C 172 ; WX 220 ; N guilsinglleft ; B 62 84 249 503 ;
-C 173 ; WX 220 ; N guilsinglright ; B 62 84 249 503 ;
-C 174 ; WX 820 ; N fi ; B -191 -213 850 741 ;
-C 175 ; WX 820 ; N fl ; B -191 -213 850 741 ;
-C 177 ; WX 500 ; N endash ; B 40 219 573 311 ;
-C 178 ; WX 420 ; N dagger ; B 89 -137 466 698 ;
-C 179 ; WX 420 ; N daggerdbl ; B 79 -137 486 698 ;
-C 180 ; WX 340 ; N periodcentered ; B 126 173 316 358 ;
-C 182 ; WX 680 ; N paragraph ; B 137 0 715 681 ;
-C 183 ; WX 360 ; N bullet ; B 60 170 404 511 ;
-C 184 ; WX 300 ; N quotesinglbase ; B 106 -112 284 166 ;
-C 185 ; WX 520 ; N quotedblbase ; B 106 -112 495 166 ;
-C 186 ; WX 520 ; N quotedblright ; B 171 420 560 698 ;
-C 187 ; WX 380 ; N guillemotright ; B 62 84 406 503 ;
-C 188 ; WX 1000 ; N ellipsis ; B 86 -8 942 177 ;
-C 189 ; WX 1360 ; N perthousand ; B 106 -17 1333 698 ;
-C 191 ; WX 620 ; N questiondown ; B 83 -189 606 515 ;
-C 193 ; WX 380 ; N grave ; B 193 566 424 771 ;
-C 194 ; WX 340 ; N acute ; B 176 566 407 771 ;
-C 195 ; WX 480 ; N circumflex ; B 183 582 523 749 ;
-C 196 ; WX 480 ; N tilde ; B 178 587 533 709 ;
-C 197 ; WX 480 ; N macron ; B 177 603 531 691 ;
-C 198 ; WX 460 ; N breve ; B 177 577 516 707 ;
-C 199 ; WX 380 ; N dotaccent ; B 180 570 345 734 ;
-C 200 ; WX 520 ; N dieresis ; B 180 570 569 734 ;
-C 202 ; WX 360 ; N ring ; B 185 558 406 775 ;
-C 203 ; WX 360 ; N cedilla ; B 68 -220 289 -8 ;
-C 205 ; WX 560 ; N hungarumlaut ; B 181 560 616 775 ;
-C 206 ; WX 320 ; N ogonek ; B 68 -182 253 0 ;
-C 207 ; WX 480 ; N caron ; B 183 582 523 749 ;
-C 208 ; WX 1000 ; N emdash ; B 40 219 1073 311 ;
-C 225 ; WX 1140 ; N AE ; B -27 0 1207 681 ;
-C 227 ; WX 440 ; N ordfeminine ; B 118 400 495 685 ;
-C 232 ; WX 640 ; N Lslash ; B 14 0 724 681 ;
-C 233 ; WX 760 ; N Oslash ; B 21 -29 847 725 ;
-C 234 ; WX 1180 ; N OE ; B 94 -17 1245 698 ;
-C 235 ; WX 440 ; N ordmasculine ; B 127 400 455 685 ;
-C 241 ; WX 880 ; N ae ; B 39 -8 913 515 ;
-C 245 ; WX 380 ; N dotlessi ; B 83 -8 420 507 ;
-C 248 ; WX 380 ; N lslash ; B 63 -8 412 732 ;
-C 249 ; WX 600 ; N oslash ; B 17 -54 661 571 ;
-C 250 ; WX 920 ; N oe ; B 48 -8 961 515 ;
-C 251 ; WX 660 ; N germandbls ; B -231 -213 702 741 ;
-C -1 ; WX 560 ; N ecircumflex ; B 59 -8 596 749 ;
-C -1 ; WX 560 ; N edieresis ; B 59 -8 596 734 ;
-C -1 ; WX 680 ; N aacute ; B 84 -8 735 771 ;
-C -1 ; WX 780 ; N registered ; B 83 -17 783 698 ;
-C -1 ; WX 380 ; N icircumflex ; B 83 -8 433 749 ;
-C -1 ; WX 680 ; N udieresis ; B 83 -8 720 734 ;
-C -1 ; WX 600 ; N ograve ; B 59 -8 627 771 ;
-C -1 ; WX 680 ; N uacute ; B 83 -8 720 771 ;
-C -1 ; WX 680 ; N ucircumflex ; B 83 -8 720 749 ;
-C -1 ; WX 720 ; N Aacute ; B -27 0 769 937 ;
-C -1 ; WX 380 ; N igrave ; B 83 -8 424 771 ;
-C -1 ; WX 380 ; N Icircumflex ; B 14 0 493 915 ;
-C -1 ; WX 560 ; N ccedilla ; B 58 -220 597 515 ;
-C -1 ; WX 680 ; N adieresis ; B 84 -8 735 734 ;
-C -1 ; WX 720 ; N Ecircumflex ; B 14 0 777 915 ;
-C -1 ; WX 540 ; N scaron ; B 32 -8 573 749 ;
-C -1 ; WX 660 ; N thorn ; B -24 -213 682 732 ;
-C -1 ; WX 940 ; N trademark ; B 42 277 982 681 ;
-C -1 ; WX 560 ; N egrave ; B 59 -8 596 771 ;
-C -1 ; WX 408 ; N threesuperior ; B 86 269 483 698 ;
-C -1 ; WX 560 ; N zcaron ; B 36 -8 586 749 ;
-C -1 ; WX 680 ; N atilde ; B 84 -8 735 709 ;
-C -1 ; WX 680 ; N aring ; B 84 -8 735 775 ;
-C -1 ; WX 600 ; N ocircumflex ; B 59 -8 627 749 ;
-C -1 ; WX 720 ; N Edieresis ; B 14 0 777 900 ;
-C -1 ; WX 1020 ; N threequarters ; B 86 0 1054 691 ;
-C -1 ; WX 600 ; N ydieresis ; B 25 -213 642 734 ;
-C -1 ; WX 600 ; N yacute ; B 25 -213 642 771 ;
-C -1 ; WX 380 ; N iacute ; B 83 -8 420 771 ;
-C -1 ; WX 720 ; N Acircumflex ; B -27 0 769 915 ;
-C -1 ; WX 740 ; N Uacute ; B 112 -17 855 937 ;
-C -1 ; WX 560 ; N eacute ; B 59 -8 596 771 ;
-C -1 ; WX 760 ; N Ograve ; B 78 -17 806 937 ;
-C -1 ; WX 680 ; N agrave ; B 84 -8 735 771 ;
-C -1 ; WX 740 ; N Udieresis ; B 112 -17 855 900 ;
-C -1 ; WX 680 ; N acircumflex ; B 84 -8 735 749 ;
-C -1 ; WX 380 ; N Igrave ; B 14 0 485 937 ;
-C -1 ; WX 408 ; N twosuperior ; B 91 279 485 698 ;
-C -1 ; WX 740 ; N Ugrave ; B 112 -17 855 937 ;
-C -1 ; WX 1020 ; N onequarter ; B 118 0 1054 681 ;
-C -1 ; WX 740 ; N Ucircumflex ; B 112 -17 855 915 ;
-C -1 ; WX 700 ; N Scaron ; B 59 -17 731 915 ;
-C -1 ; WX 380 ; N Idieresis ; B 14 0 499 900 ;
-C -1 ; WX 380 ; N idieresis ; B 83 -8 479 734 ;
-C -1 ; WX 720 ; N Egrave ; B 14 0 777 937 ;
-C -1 ; WX 760 ; N Oacute ; B 78 -17 806 937 ;
-C -1 ; WX 600 ; N divide ; B 91 9 595 521 ;
-C -1 ; WX 720 ; N Atilde ; B -27 0 769 875 ;
-C -1 ; WX 720 ; N Aring ; B -27 0 769 941 ;
-C -1 ; WX 760 ; N Odieresis ; B 78 -17 806 900 ;
-C -1 ; WX 720 ; N Adieresis ; B -27 0 769 900 ;
-C -1 ; WX 740 ; N Ntilde ; B 14 0 845 875 ;
-C -1 ; WX 680 ; N Zcaron ; B 23 0 740 915 ;
-C -1 ; WX 640 ; N Thorn ; B -6 0 701 681 ;
-C -1 ; WX 380 ; N Iacute ; B 14 0 485 937 ;
-C -1 ; WX 600 ; N plusminus ; B 91 0 595 514 ;
-C -1 ; WX 600 ; N multiply ; B 91 10 595 514 ;
-C -1 ; WX 720 ; N Eacute ; B 14 0 777 937 ;
-C -1 ; WX 660 ; N Ydieresis ; B 72 0 817 900 ;
-C -1 ; WX 408 ; N onesuperior ; B 118 279 406 688 ;
-C -1 ; WX 680 ; N ugrave ; B 83 -8 720 771 ;
-C -1 ; WX 620 ; N logicalnot ; B 81 129 585 421 ;
-C -1 ; WX 680 ; N ntilde ; B 83 -8 715 709 ;
-C -1 ; WX 760 ; N Otilde ; B 78 -17 806 875 ;
-C -1 ; WX 600 ; N otilde ; B 59 -8 627 709 ;
-C -1 ; WX 700 ; N Ccedilla ; B 78 -220 754 698 ;
-C -1 ; WX 720 ; N Agrave ; B -27 0 769 937 ;
-C -1 ; WX 1020 ; N onehalf ; B 118 0 1036 681 ;
-C -1 ; WX 760 ; N Eth ; B 14 0 805 681 ;
-C -1 ; WX 400 ; N degree ; B 130 398 430 698 ;
-C -1 ; WX 660 ; N Yacute ; B 72 0 817 937 ;
-C -1 ; WX 760 ; N Ocircumflex ; B 78 -17 806 915 ;
-C -1 ; WX 600 ; N oacute ; B 59 -8 627 771 ;
-C -1 ; WX 680 ; N mu ; B 54 -213 720 507 ;
-C -1 ; WX 600 ; N minus ; B 91 207 595 323 ;
-C -1 ; WX 600 ; N eth ; B 59 -8 662 741 ;
-C -1 ; WX 600 ; N odieresis ; B 59 -8 627 734 ;
-C -1 ; WX 780 ; N copyright ; B 83 -17 783 698 ;
-C -1 ; WX 620 ; N brokenbar ; B 303 -175 422 675 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 92
-
-KPX A y 20
-KPX A w 20
-KPX A v 20
-KPX A Y -25
-KPX A W -35
-KPX A V -40
-KPX A T -17
-
-KPX F period -105
-KPX F comma -98
-KPX F A -35
-
-KPX L y 62
-KPX L Y -5
-KPX L W -15
-KPX L V -19
-KPX L T -26
-
-KPX P period -105
-KPX P comma -98
-KPX P A -31
-
-KPX R y 27
-KPX R Y 4
-KPX R W -4
-KPX R V -8
-KPX R T -3
-
-KPX T y 56
-KPX T w 69
-KPX T u 42
-KPX T semicolon 31
-KPX T s -1
-KPX T r 41
-KPX T period -107
-KPX T o -5
-KPX T i 42
-KPX T hyphen -20
-KPX T e -10
-KPX T comma -100
-KPX T colon 26
-KPX T c -8
-KPX T a -8
-KPX T A -42
-
-KPX V y 17
-KPX V u -1
-KPX V semicolon -22
-KPX V r 2
-KPX V period -115
-KPX V o -50
-KPX V i 32
-KPX V hyphen -20
-KPX V e -50
-KPX V comma -137
-KPX V colon -28
-KPX V a -50
-KPX V A -50
-
-KPX W y -51
-KPX W u -69
-KPX W semicolon -81
-KPX W r -66
-KPX W period -183
-KPX W o -100
-KPX W i -36
-KPX W hyphen -22
-KPX W e -100
-KPX W comma -201
-KPX W colon -86
-KPX W a -100
-KPX W A -77
-
-KPX Y v 26
-KPX Y u -1
-KPX Y semicolon -4
-KPX Y q -43
-KPX Y period -113
-KPX Y o -41
-KPX Y i 20
-KPX Y hyphen -20
-KPX Y e -46
-KPX Y comma -106
-KPX Y colon -9
-KPX Y a -45
-KPX Y A -30
-
-KPX f f 10
-
-KPX r q -3
-KPX r period -120
-KPX r o -1
-KPX r n 39
-KPX r m 39
-KPX r hyphen -20
-KPX r h -35
-KPX r g -23
-KPX r f 42
-KPX r e -6
-KPX r d -3
-KPX r comma -113
-KPX r c -5
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 190 166 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 120 166 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 100 166 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 170 166 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 200 166 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 120 166 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 190 166 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 120 166 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 100 166 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 170 166 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 20 166 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -30 166 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -70 166 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 0 166 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 130 166 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 210 166 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 140 166 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 140 166 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 190 166 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 140 166 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 110 166 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 200 166 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 130 166 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 130 166 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 180 166 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 160 166 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 70 166 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 100 166 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 170 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 100 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 80 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 150 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 160 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 100 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 110 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 60 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 20 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 90 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -90 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -90 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 0 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 60 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 130 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 60 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 40 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 110 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 60 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 30 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 170 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 100 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 80 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 150 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 130 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 40 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 40 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Bookman-Light.afm b/blt3.0.1/library/afm/Bookman-Light.afm
deleted file mode 100644
index 75e019b..0000000
--- a/blt3.0.1/library/afm/Bookman-Light.afm
+++ /dev/null
@@ -1,408 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Tue Jan 21 16:15:53 1992
-Comment UniqueID 37833
-Comment VMusage 32321 39213
-FontName Bookman-Light
-FullName ITC Bookman Light
-FamilyName ITC Bookman
-Weight Light
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -188 -251 1266 908
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.004
-Notice Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.ITC Bookman is a registered trademark of International Typeface Corporation.
-EncodingScheme AdobeStandardEncoding
-CapHeight 681
-XHeight 484
-Ascender 717
-Descender -228
-StartCharMetrics 228
-C 32 ; WX 320 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 300 ; N exclam ; B 75 -8 219 698 ;
-C 34 ; WX 380 ; N quotedbl ; B 56 458 323 698 ;
-C 35 ; WX 620 ; N numbersign ; B 65 0 556 681 ;
-C 36 ; WX 620 ; N dollar ; B 34 -109 593 791 ;
-C 37 ; WX 900 ; N percent ; B 22 -8 873 698 ;
-C 38 ; WX 800 ; N ampersand ; B 45 -17 787 698 ;
-C 39 ; WX 220 ; N quoteright ; B 46 480 178 698 ;
-C 40 ; WX 300 ; N parenleft ; B 76 -145 278 727 ;
-C 41 ; WX 300 ; N parenright ; B 17 -146 219 727 ;
-C 42 ; WX 440 ; N asterisk ; B 54 325 391 698 ;
-C 43 ; WX 600 ; N plus ; B 51 8 555 513 ;
-C 44 ; WX 320 ; N comma ; B 90 -114 223 114 ;
-C 45 ; WX 400 ; N hyphen ; B 50 232 350 292 ;
-C 46 ; WX 320 ; N period ; B 92 -8 220 123 ;
-C 47 ; WX 600 ; N slash ; B 74 -149 532 717 ;
-C 48 ; WX 620 ; N zero ; B 40 -17 586 698 ;
-C 49 ; WX 620 ; N one ; B 160 0 501 681 ;
-C 50 ; WX 620 ; N two ; B 42 0 576 698 ;
-C 51 ; WX 620 ; N three ; B 40 -17 576 698 ;
-C 52 ; WX 620 ; N four ; B 25 0 600 681 ;
-C 53 ; WX 620 ; N five ; B 60 -17 584 717 ;
-C 54 ; WX 620 ; N six ; B 45 -17 590 698 ;
-C 55 ; WX 620 ; N seven ; B 60 0 586 681 ;
-C 56 ; WX 620 ; N eight ; B 44 -17 583 698 ;
-C 57 ; WX 620 ; N nine ; B 37 -17 576 698 ;
-C 58 ; WX 320 ; N colon ; B 92 -8 220 494 ;
-C 59 ; WX 320 ; N semicolon ; B 90 -114 223 494 ;
-C 60 ; WX 600 ; N less ; B 49 -2 558 526 ;
-C 61 ; WX 600 ; N equal ; B 51 126 555 398 ;
-C 62 ; WX 600 ; N greater ; B 48 -2 557 526 ;
-C 63 ; WX 540 ; N question ; B 27 -8 514 698 ;
-C 64 ; WX 820 ; N at ; B 55 -17 755 698 ;
-C 65 ; WX 680 ; N A ; B -37 0 714 681 ;
-C 66 ; WX 740 ; N B ; B 31 0 702 681 ;
-C 67 ; WX 740 ; N C ; B 44 -17 702 698 ;
-C 68 ; WX 800 ; N D ; B 31 0 752 681 ;
-C 69 ; WX 720 ; N E ; B 31 0 705 681 ;
-C 70 ; WX 640 ; N F ; B 31 0 654 681 ;
-C 71 ; WX 800 ; N G ; B 44 -17 778 698 ;
-C 72 ; WX 800 ; N H ; B 31 0 769 681 ;
-C 73 ; WX 340 ; N I ; B 31 0 301 681 ;
-C 74 ; WX 600 ; N J ; B -23 -17 567 681 ;
-C 75 ; WX 720 ; N K ; B 31 0 750 681 ;
-C 76 ; WX 600 ; N L ; B 31 0 629 681 ;
-C 77 ; WX 920 ; N M ; B 26 0 894 681 ;
-C 78 ; WX 740 ; N N ; B 26 0 722 681 ;
-C 79 ; WX 800 ; N O ; B 44 -17 758 698 ;
-C 80 ; WX 620 ; N P ; B 31 0 613 681 ;
-C 81 ; WX 820 ; N Q ; B 44 -189 769 698 ;
-C 82 ; WX 720 ; N R ; B 31 0 757 681 ;
-C 83 ; WX 660 ; N S ; B 28 -17 634 698 ;
-C 84 ; WX 620 ; N T ; B -37 0 656 681 ;
-C 85 ; WX 780 ; N U ; B 25 -17 754 681 ;
-C 86 ; WX 700 ; N V ; B -30 0 725 681 ;
-C 87 ; WX 960 ; N W ; B -30 0 984 681 ;
-C 88 ; WX 720 ; N X ; B -30 0 755 681 ;
-C 89 ; WX 640 ; N Y ; B -30 0 666 681 ;
-C 90 ; WX 640 ; N Z ; B 10 0 656 681 ;
-C 91 ; WX 300 ; N bracketleft ; B 92 -136 258 717 ;
-C 92 ; WX 600 ; N backslash ; B 74 0 532 717 ;
-C 93 ; WX 300 ; N bracketright ; B 41 -136 207 717 ;
-C 94 ; WX 600 ; N asciicircum ; B 52 276 554 681 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 220 ; N quoteleft ; B 46 479 178 698 ;
-C 97 ; WX 580 ; N a ; B 35 -8 587 494 ;
-C 98 ; WX 620 ; N b ; B -2 -8 582 717 ;
-C 99 ; WX 520 ; N c ; B 37 -8 498 494 ;
-C 100 ; WX 620 ; N d ; B 37 -8 591 717 ;
-C 101 ; WX 520 ; N e ; B 37 -8 491 494 ;
-C 102 ; WX 320 ; N f ; B 20 0 414 734 ; L i fi ; L l fl ;
-C 103 ; WX 540 ; N g ; B 17 -243 542 567 ;
-C 104 ; WX 660 ; N h ; B 20 0 643 717 ;
-C 105 ; WX 300 ; N i ; B 20 0 288 654 ;
-C 106 ; WX 300 ; N j ; B -109 -251 214 654 ;
-C 107 ; WX 620 ; N k ; B 20 0 628 717 ;
-C 108 ; WX 300 ; N l ; B 20 0 286 717 ;
-C 109 ; WX 940 ; N m ; B 17 0 928 494 ;
-C 110 ; WX 660 ; N n ; B 20 0 649 494 ;
-C 111 ; WX 560 ; N o ; B 37 -8 526 494 ;
-C 112 ; WX 620 ; N p ; B 20 -228 583 494 ;
-C 113 ; WX 580 ; N q ; B 37 -228 589 494 ;
-C 114 ; WX 440 ; N r ; B 20 0 447 494 ;
-C 115 ; WX 520 ; N s ; B 40 -8 487 494 ;
-C 116 ; WX 380 ; N t ; B 20 -8 388 667 ;
-C 117 ; WX 680 ; N u ; B 20 -8 653 484 ;
-C 118 ; WX 520 ; N v ; B -23 0 534 484 ;
-C 119 ; WX 780 ; N w ; B -19 0 804 484 ;
-C 120 ; WX 560 ; N x ; B -16 0 576 484 ;
-C 121 ; WX 540 ; N y ; B -23 -236 549 484 ;
-C 122 ; WX 480 ; N z ; B 7 0 476 484 ;
-C 123 ; WX 280 ; N braceleft ; B 21 -136 260 717 ;
-C 124 ; WX 600 ; N bar ; B 264 -250 342 750 ;
-C 125 ; WX 280 ; N braceright ; B 21 -136 260 717 ;
-C 126 ; WX 600 ; N asciitilde ; B 52 173 556 352 ;
-C 161 ; WX 300 ; N exclamdown ; B 75 -214 219 494 ;
-C 162 ; WX 620 ; N cent ; B 116 20 511 651 ;
-C 163 ; WX 620 ; N sterling ; B 8 -17 631 698 ;
-C 164 ; WX 140 ; N fraction ; B -188 0 335 681 ;
-C 165 ; WX 620 ; N yen ; B -22 0 647 681 ;
-C 166 ; WX 620 ; N florin ; B -29 -155 633 749 ;
-C 167 ; WX 520 ; N section ; B 33 -178 486 698 ;
-C 168 ; WX 620 ; N currency ; B 58 89 563 591 ;
-C 169 ; WX 220 ; N quotesingle ; B 67 458 153 698 ;
-C 170 ; WX 400 ; N quotedblleft ; B 46 479 348 698 ;
-C 171 ; WX 360 ; N guillemotleft ; B 51 89 312 437 ;
-C 172 ; WX 240 ; N guilsinglleft ; B 51 89 189 437 ;
-C 173 ; WX 240 ; N guilsinglright ; B 51 89 189 437 ;
-C 174 ; WX 620 ; N fi ; B 20 0 608 734 ;
-C 175 ; WX 620 ; N fl ; B 20 0 606 734 ;
-C 177 ; WX 500 ; N endash ; B -15 232 515 292 ;
-C 178 ; WX 540 ; N dagger ; B 79 -156 455 698 ;
-C 179 ; WX 540 ; N daggerdbl ; B 79 -156 455 698 ;
-C 180 ; WX 320 ; N periodcentered ; B 92 196 220 327 ;
-C 182 ; WX 600 ; N paragraph ; B 14 0 577 681 ;
-C 183 ; WX 460 ; N bullet ; B 60 170 404 511 ;
-C 184 ; WX 220 ; N quotesinglbase ; B 46 -108 178 110 ;
-C 185 ; WX 400 ; N quotedblbase ; B 46 -108 348 110 ;
-C 186 ; WX 400 ; N quotedblright ; B 46 480 348 698 ;
-C 187 ; WX 360 ; N guillemotright ; B 51 89 312 437 ;
-C 188 ; WX 1000 ; N ellipsis ; B 101 -8 898 123 ;
-C 189 ; WX 1280 ; N perthousand ; B 22 -8 1266 698 ;
-C 191 ; WX 540 ; N questiondown ; B 23 -217 510 494 ;
-C 193 ; WX 340 ; N grave ; B 68 571 274 689 ;
-C 194 ; WX 340 ; N acute ; B 68 571 274 689 ;
-C 195 ; WX 420 ; N circumflex ; B 68 567 352 685 ;
-C 196 ; WX 440 ; N tilde ; B 68 572 375 661 ;
-C 197 ; WX 440 ; N macron ; B 68 587 364 635 ;
-C 198 ; WX 460 ; N breve ; B 68 568 396 687 ;
-C 199 ; WX 260 ; N dotaccent ; B 68 552 186 672 ;
-C 200 ; WX 420 ; N dieresis ; B 68 552 349 674 ;
-C 202 ; WX 320 ; N ring ; B 68 546 252 731 ;
-C 203 ; WX 320 ; N cedilla ; B 68 -200 257 0 ;
-C 205 ; WX 380 ; N hungarumlaut ; B 68 538 311 698 ;
-C 206 ; WX 320 ; N ogonek ; B 68 -145 245 0 ;
-C 207 ; WX 420 ; N caron ; B 68 554 352 672 ;
-C 208 ; WX 1000 ; N emdash ; B -15 232 1015 292 ;
-C 225 ; WX 1260 ; N AE ; B -36 0 1250 681 ;
-C 227 ; WX 420 ; N ordfeminine ; B 49 395 393 698 ;
-C 232 ; WX 600 ; N Lslash ; B 31 0 629 681 ;
-C 233 ; WX 800 ; N Oslash ; B 44 -53 758 733 ;
-C 234 ; WX 1240 ; N OE ; B 44 -17 1214 698 ;
-C 235 ; WX 420 ; N ordmasculine ; B 56 394 361 698 ;
-C 241 ; WX 860 ; N ae ; B 35 -8 832 494 ;
-C 245 ; WX 300 ; N dotlessi ; B 20 0 288 484 ;
-C 248 ; WX 320 ; N lslash ; B 20 0 291 717 ;
-C 249 ; WX 560 ; N oslash ; B 37 -40 526 534 ;
-C 250 ; WX 900 ; N oe ; B 37 -8 876 494 ;
-C 251 ; WX 660 ; N germandbls ; B -109 -110 614 698 ;
-C -1 ; WX 520 ; N ecircumflex ; B 37 -8 491 685 ;
-C -1 ; WX 520 ; N edieresis ; B 37 -8 491 674 ;
-C -1 ; WX 580 ; N aacute ; B 35 -8 587 689 ;
-C -1 ; WX 740 ; N registered ; B 23 -17 723 698 ;
-C -1 ; WX 300 ; N icircumflex ; B 8 0 292 685 ;
-C -1 ; WX 680 ; N udieresis ; B 20 -8 653 674 ;
-C -1 ; WX 560 ; N ograve ; B 37 -8 526 689 ;
-C -1 ; WX 680 ; N uacute ; B 20 -8 653 689 ;
-C -1 ; WX 680 ; N ucircumflex ; B 20 -8 653 685 ;
-C -1 ; WX 680 ; N Aacute ; B -37 0 714 866 ;
-C -1 ; WX 300 ; N igrave ; B 20 0 288 689 ;
-C -1 ; WX 340 ; N Icircumflex ; B 28 0 312 862 ;
-C -1 ; WX 520 ; N ccedilla ; B 37 -200 498 494 ;
-C -1 ; WX 580 ; N adieresis ; B 35 -8 587 674 ;
-C -1 ; WX 720 ; N Ecircumflex ; B 31 0 705 862 ;
-C -1 ; WX 520 ; N scaron ; B 40 -8 487 672 ;
-C -1 ; WX 620 ; N thorn ; B 20 -228 583 717 ;
-C -1 ; WX 980 ; N trademark ; B 34 277 930 681 ;
-C -1 ; WX 520 ; N egrave ; B 37 -8 491 689 ;
-C -1 ; WX 372 ; N threesuperior ; B 12 269 360 698 ;
-C -1 ; WX 480 ; N zcaron ; B 7 0 476 672 ;
-C -1 ; WX 580 ; N atilde ; B 35 -8 587 661 ;
-C -1 ; WX 580 ; N aring ; B 35 -8 587 731 ;
-C -1 ; WX 560 ; N ocircumflex ; B 37 -8 526 685 ;
-C -1 ; WX 720 ; N Edieresis ; B 31 0 705 851 ;
-C -1 ; WX 930 ; N threequarters ; B 52 0 889 691 ;
-C -1 ; WX 540 ; N ydieresis ; B -23 -236 549 674 ;
-C -1 ; WX 540 ; N yacute ; B -23 -236 549 689 ;
-C -1 ; WX 300 ; N iacute ; B 20 0 288 689 ;
-C -1 ; WX 680 ; N Acircumflex ; B -37 0 714 862 ;
-C -1 ; WX 780 ; N Uacute ; B 25 -17 754 866 ;
-C -1 ; WX 520 ; N eacute ; B 37 -8 491 689 ;
-C -1 ; WX 800 ; N Ograve ; B 44 -17 758 866 ;
-C -1 ; WX 580 ; N agrave ; B 35 -8 587 689 ;
-C -1 ; WX 780 ; N Udieresis ; B 25 -17 754 851 ;
-C -1 ; WX 580 ; N acircumflex ; B 35 -8 587 685 ;
-C -1 ; WX 340 ; N Igrave ; B 31 0 301 866 ;
-C -1 ; WX 372 ; N twosuperior ; B 20 279 367 698 ;
-C -1 ; WX 780 ; N Ugrave ; B 25 -17 754 866 ;
-C -1 ; WX 930 ; N onequarter ; B 80 0 869 681 ;
-C -1 ; WX 780 ; N Ucircumflex ; B 25 -17 754 862 ;
-C -1 ; WX 660 ; N Scaron ; B 28 -17 634 849 ;
-C -1 ; WX 340 ; N Idieresis ; B 28 0 309 851 ;
-C -1 ; WX 300 ; N idieresis ; B 8 0 289 674 ;
-C -1 ; WX 720 ; N Egrave ; B 31 0 705 866 ;
-C -1 ; WX 800 ; N Oacute ; B 44 -17 758 866 ;
-C -1 ; WX 600 ; N divide ; B 51 10 555 514 ;
-C -1 ; WX 680 ; N Atilde ; B -37 0 714 838 ;
-C -1 ; WX 680 ; N Aring ; B -37 0 714 908 ;
-C -1 ; WX 800 ; N Odieresis ; B 44 -17 758 851 ;
-C -1 ; WX 680 ; N Adieresis ; B -37 0 714 851 ;
-C -1 ; WX 740 ; N Ntilde ; B 26 0 722 838 ;
-C -1 ; WX 640 ; N Zcaron ; B 10 0 656 849 ;
-C -1 ; WX 620 ; N Thorn ; B 31 0 613 681 ;
-C -1 ; WX 340 ; N Iacute ; B 31 0 301 866 ;
-C -1 ; WX 600 ; N plusminus ; B 51 0 555 513 ;
-C -1 ; WX 600 ; N multiply ; B 51 9 555 513 ;
-C -1 ; WX 720 ; N Eacute ; B 31 0 705 866 ;
-C -1 ; WX 640 ; N Ydieresis ; B -30 0 666 851 ;
-C -1 ; WX 372 ; N onesuperior ; B 80 279 302 688 ;
-C -1 ; WX 680 ; N ugrave ; B 20 -8 653 689 ;
-C -1 ; WX 600 ; N logicalnot ; B 51 128 555 398 ;
-C -1 ; WX 660 ; N ntilde ; B 20 0 649 661 ;
-C -1 ; WX 800 ; N Otilde ; B 44 -17 758 838 ;
-C -1 ; WX 560 ; N otilde ; B 37 -8 526 661 ;
-C -1 ; WX 740 ; N Ccedilla ; B 44 -200 702 698 ;
-C -1 ; WX 680 ; N Agrave ; B -37 0 714 866 ;
-C -1 ; WX 930 ; N onehalf ; B 80 0 885 681 ;
-C -1 ; WX 800 ; N Eth ; B 31 0 752 681 ;
-C -1 ; WX 400 ; N degree ; B 50 398 350 698 ;
-C -1 ; WX 640 ; N Yacute ; B -30 0 666 866 ;
-C -1 ; WX 800 ; N Ocircumflex ; B 44 -17 758 862 ;
-C -1 ; WX 560 ; N oacute ; B 37 -8 526 689 ;
-C -1 ; WX 680 ; N mu ; B 20 -251 653 484 ;
-C -1 ; WX 600 ; N minus ; B 51 224 555 300 ;
-C -1 ; WX 560 ; N eth ; B 37 -8 526 734 ;
-C -1 ; WX 560 ; N odieresis ; B 37 -8 526 674 ;
-C -1 ; WX 740 ; N copyright ; B 24 -17 724 698 ;
-C -1 ; WX 600 ; N brokenbar ; B 264 -175 342 675 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 82
-
-KPX A y 32
-KPX A w 4
-KPX A v 7
-KPX A Y -35
-KPX A W -40
-KPX A V -56
-KPX A T 1
-
-KPX F period -46
-KPX F comma -41
-KPX F A -21
-
-KPX L y 79
-KPX L Y 13
-KPX L W 1
-KPX L V -4
-KPX L T 28
-
-KPX P period -60
-KPX P comma -55
-KPX P A -8
-
-KPX R y 59
-KPX R Y 26
-KPX R W 13
-KPX R V 8
-KPX R T 71
-
-KPX T s 16
-KPX T r 38
-KPX T period -33
-KPX T o 15
-KPX T i 42
-KPX T hyphen 90
-KPX T e 13
-KPX T comma -28
-KPX T c 14
-KPX T a 17
-KPX T A 1
-
-KPX V y 15
-KPX V u -38
-KPX V r -41
-KPX V period -40
-KPX V o -71
-KPX V i -20
-KPX V hyphen 11
-KPX V e -72
-KPX V comma -34
-KPX V a -69
-KPX V A -66
-
-KPX W y 15
-KPX W u -38
-KPX W r -41
-KPX W period -40
-KPX W o -68
-KPX W i -20
-KPX W hyphen 11
-KPX W e -69
-KPX W comma -34
-KPX W a -66
-KPX W A -64
-
-KPX Y v 15
-KPX Y u -38
-KPX Y q -55
-KPX Y period -40
-KPX Y p -31
-KPX Y o -57
-KPX Y i -37
-KPX Y hyphen 11
-KPX Y e -58
-KPX Y comma -34
-KPX Y a -54
-KPX Y A -53
-
-KPX f f 29
-
-KPX r q 9
-KPX r period -64
-KPX r o 8
-KPX r n 31
-KPX r m 31
-KPX r hyphen 70
-KPX r h -21
-KPX r g -4
-KPX r f 33
-KPX r e 7
-KPX r d 7
-KPX r comma -58
-KPX r c 7
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 200 177 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 130 177 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 130 177 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 140 177 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 180 177 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 120 177 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 220 177 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 150 177 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 150 177 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 160 177 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 20 177 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -40 177 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -40 177 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave -20 177 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 150 177 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 260 177 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 190 177 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 190 177 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 200 177 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 180 177 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 120 177 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 250 177 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 180 177 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 180 177 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 190 177 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 150 177 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 110 177 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 110 177 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 120 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 80 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 80 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 120 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 130 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 70 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 90 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 50 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 50 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 90 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -20 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -60 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -60 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -20 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 110 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 110 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 70 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 70 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 110 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 60 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 50 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 170 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 130 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 130 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 170 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 100 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 60 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 30 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Bookman-LightItalic.afm b/blt3.0.1/library/afm/Bookman-LightItalic.afm
deleted file mode 100644
index 3e6ef4c..0000000
--- a/blt3.0.1/library/afm/Bookman-LightItalic.afm
+++ /dev/null
@@ -1,411 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Tue Jan 21 16:12:06 1992
-Comment UniqueID 37830
-Comment VMusage 33139 40031
-FontName Bookman-LightItalic
-FullName ITC Bookman Light Italic
-FamilyName ITC Bookman
-Weight Light
-ItalicAngle -10
-IsFixedPitch false
-FontBBox -228 -250 1269 883
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.004
-Notice Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.ITC Bookman is a registered trademark of International Typeface Corporation.
-EncodingScheme AdobeStandardEncoding
-CapHeight 681
-XHeight 494
-Ascender 717
-Descender -212
-StartCharMetrics 228
-C 32 ; WX 300 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 320 ; N exclam ; B 103 -8 342 698 ;
-C 34 ; WX 360 ; N quotedbl ; B 107 468 402 698 ;
-C 35 ; WX 620 ; N numbersign ; B 107 0 598 681 ;
-C 36 ; WX 620 ; N dollar ; B 78 -85 619 762 ;
-C 37 ; WX 800 ; N percent ; B 56 -8 811 691 ;
-C 38 ; WX 820 ; N ampersand ; B 65 -18 848 698 ;
-C 39 ; WX 280 ; N quoteright ; B 148 470 288 698 ;
-C 40 ; WX 280 ; N parenleft ; B 96 -146 383 727 ;
-C 41 ; WX 280 ; N parenright ; B -8 -146 279 727 ;
-C 42 ; WX 440 ; N asterisk ; B 139 324 505 698 ;
-C 43 ; WX 600 ; N plus ; B 91 43 595 548 ;
-C 44 ; WX 300 ; N comma ; B 88 -115 227 112 ;
-C 45 ; WX 320 ; N hyphen ; B 78 269 336 325 ;
-C 46 ; WX 300 ; N period ; B 96 -8 231 127 ;
-C 47 ; WX 600 ; N slash ; B 104 -149 562 717 ;
-C 48 ; WX 620 ; N zero ; B 86 -17 646 698 ;
-C 49 ; WX 620 ; N one ; B 154 0 500 681 ;
-C 50 ; WX 620 ; N two ; B 66 0 636 698 ;
-C 51 ; WX 620 ; N three ; B 55 -17 622 698 ;
-C 52 ; WX 620 ; N four ; B 69 0 634 681 ;
-C 53 ; WX 620 ; N five ; B 70 -17 614 681 ;
-C 54 ; WX 620 ; N six ; B 89 -17 657 698 ;
-C 55 ; WX 620 ; N seven ; B 143 0 672 681 ;
-C 56 ; WX 620 ; N eight ; B 61 -17 655 698 ;
-C 57 ; WX 620 ; N nine ; B 77 -17 649 698 ;
-C 58 ; WX 300 ; N colon ; B 96 -8 292 494 ;
-C 59 ; WX 300 ; N semicolon ; B 88 -114 292 494 ;
-C 60 ; WX 600 ; N less ; B 79 33 588 561 ;
-C 61 ; WX 600 ; N equal ; B 91 161 595 433 ;
-C 62 ; WX 600 ; N greater ; B 93 33 602 561 ;
-C 63 ; WX 540 ; N question ; B 114 -8 604 698 ;
-C 64 ; WX 780 ; N at ; B 102 -17 802 698 ;
-C 65 ; WX 700 ; N A ; B -25 0 720 681 ;
-C 66 ; WX 720 ; N B ; B 21 0 746 681 ;
-C 67 ; WX 720 ; N C ; B 88 -17 746 698 ;
-C 68 ; WX 740 ; N D ; B 21 0 782 681 ;
-C 69 ; WX 680 ; N E ; B 21 0 736 681 ;
-C 70 ; WX 620 ; N F ; B 21 0 743 681 ;
-C 71 ; WX 760 ; N G ; B 88 -17 813 698 ;
-C 72 ; WX 800 ; N H ; B 21 0 888 681 ;
-C 73 ; WX 320 ; N I ; B 21 0 412 681 ;
-C 74 ; WX 560 ; N J ; B -2 -17 666 681 ;
-C 75 ; WX 720 ; N K ; B 21 0 804 681 ;
-C 76 ; WX 580 ; N L ; B 21 0 656 681 ;
-C 77 ; WX 860 ; N M ; B 18 0 956 681 ;
-C 78 ; WX 720 ; N N ; B 18 0 823 681 ;
-C 79 ; WX 760 ; N O ; B 88 -17 799 698 ;
-C 80 ; WX 600 ; N P ; B 21 0 681 681 ;
-C 81 ; WX 780 ; N Q ; B 61 -191 812 698 ;
-C 82 ; WX 700 ; N R ; B 21 0 736 681 ;
-C 83 ; WX 640 ; N S ; B 61 -17 668 698 ;
-C 84 ; WX 600 ; N T ; B 50 0 725 681 ;
-C 85 ; WX 720 ; N U ; B 118 -17 842 681 ;
-C 86 ; WX 680 ; N V ; B 87 0 815 681 ;
-C 87 ; WX 960 ; N W ; B 87 0 1095 681 ;
-C 88 ; WX 700 ; N X ; B -25 0 815 681 ;
-C 89 ; WX 660 ; N Y ; B 87 0 809 681 ;
-C 90 ; WX 580 ; N Z ; B 8 0 695 681 ;
-C 91 ; WX 260 ; N bracketleft ; B 56 -136 351 717 ;
-C 92 ; WX 600 ; N backslash ; B 84 0 542 717 ;
-C 93 ; WX 260 ; N bracketright ; B 15 -136 309 717 ;
-C 94 ; WX 600 ; N asciicircum ; B 97 276 599 681 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 280 ; N quoteleft ; B 191 470 330 698 ;
-C 97 ; WX 620 ; N a ; B 71 -8 686 494 ;
-C 98 ; WX 600 ; N b ; B 88 -8 621 717 ;
-C 99 ; WX 480 ; N c ; B 65 -8 522 494 ;
-C 100 ; WX 640 ; N d ; B 65 -8 695 717 ;
-C 101 ; WX 540 ; N e ; B 65 -8 575 494 ;
-C 102 ; WX 340 ; N f ; B -160 -218 557 725 ; L i fi ; L l fl ;
-C 103 ; WX 560 ; N g ; B 4 -221 581 494 ;
-C 104 ; WX 620 ; N h ; B 88 -8 689 717 ;
-C 105 ; WX 280 ; N i ; B 88 -8 351 663 ;
-C 106 ; WX 280 ; N j ; B -200 -221 308 663 ;
-C 107 ; WX 600 ; N k ; B 88 -8 657 717 ;
-C 108 ; WX 280 ; N l ; B 100 -8 342 717 ;
-C 109 ; WX 880 ; N m ; B 88 -8 952 494 ;
-C 110 ; WX 620 ; N n ; B 88 -8 673 494 ;
-C 111 ; WX 540 ; N o ; B 65 -8 572 494 ;
-C 112 ; WX 600 ; N p ; B -24 -212 620 494 ;
-C 113 ; WX 560 ; N q ; B 65 -212 584 494 ;
-C 114 ; WX 400 ; N r ; B 88 0 481 494 ;
-C 115 ; WX 540 ; N s ; B 65 -8 547 494 ;
-C 116 ; WX 340 ; N t ; B 88 -8 411 664 ;
-C 117 ; WX 620 ; N u ; B 88 -8 686 484 ;
-C 118 ; WX 540 ; N v ; B 88 -8 562 494 ;
-C 119 ; WX 880 ; N w ; B 88 -8 893 494 ;
-C 120 ; WX 540 ; N x ; B 9 -8 626 494 ;
-C 121 ; WX 600 ; N y ; B 60 -221 609 484 ;
-C 122 ; WX 520 ; N z ; B 38 -8 561 494 ;
-C 123 ; WX 360 ; N braceleft ; B 122 -191 442 717 ;
-C 124 ; WX 600 ; N bar ; B 294 -250 372 750 ;
-C 125 ; WX 380 ; N braceright ; B 13 -191 333 717 ;
-C 126 ; WX 600 ; N asciitilde ; B 91 207 595 386 ;
-C 161 ; WX 320 ; N exclamdown ; B 73 -213 301 494 ;
-C 162 ; WX 620 ; N cent ; B 148 -29 596 715 ;
-C 163 ; WX 620 ; N sterling ; B 4 -17 702 698 ;
-C 164 ; WX 20 ; N fraction ; B -228 0 323 681 ;
-C 165 ; WX 620 ; N yen ; B 71 0 735 681 ;
-C 166 ; WX 620 ; N florin ; B -26 -218 692 725 ;
-C 167 ; WX 620 ; N section ; B 38 -178 638 698 ;
-C 168 ; WX 620 ; N currency ; B 100 89 605 591 ;
-C 169 ; WX 200 ; N quotesingle ; B 99 473 247 698 ;
-C 170 ; WX 440 ; N quotedblleft ; B 191 470 493 698 ;
-C 171 ; WX 300 ; N guillemotleft ; B 70 129 313 434 ;
-C 172 ; WX 180 ; N guilsinglleft ; B 75 129 208 434 ;
-C 173 ; WX 180 ; N guilsinglright ; B 70 129 203 434 ;
-C 174 ; WX 640 ; N fi ; B -159 -222 709 725 ;
-C 175 ; WX 660 ; N fl ; B -159 -218 713 725 ;
-C 177 ; WX 500 ; N endash ; B 33 269 561 325 ;
-C 178 ; WX 620 ; N dagger ; B 192 -130 570 698 ;
-C 179 ; WX 620 ; N daggerdbl ; B 144 -122 566 698 ;
-C 180 ; WX 300 ; N periodcentered ; B 137 229 272 364 ;
-C 182 ; WX 620 ; N paragraph ; B 112 0 718 681 ;
-C 183 ; WX 460 ; N bullet ; B 100 170 444 511 ;
-C 184 ; WX 320 ; N quotesinglbase ; B 87 -114 226 113 ;
-C 185 ; WX 480 ; N quotedblbase ; B 87 -114 390 113 ;
-C 186 ; WX 440 ; N quotedblright ; B 148 470 451 698 ;
-C 187 ; WX 300 ; N guillemotright ; B 60 129 303 434 ;
-C 188 ; WX 1000 ; N ellipsis ; B 99 -8 900 127 ;
-C 189 ; WX 1180 ; N perthousand ; B 56 -8 1199 691 ;
-C 191 ; WX 540 ; N questiondown ; B 18 -212 508 494 ;
-C 193 ; WX 340 ; N grave ; B 182 551 377 706 ;
-C 194 ; WX 320 ; N acute ; B 178 551 373 706 ;
-C 195 ; WX 440 ; N circumflex ; B 176 571 479 685 ;
-C 196 ; WX 440 ; N tilde ; B 180 586 488 671 ;
-C 197 ; WX 440 ; N macron ; B 178 599 484 658 ;
-C 198 ; WX 440 ; N breve ; B 191 577 500 680 ;
-C 199 ; WX 260 ; N dotaccent ; B 169 543 290 664 ;
-C 200 ; WX 420 ; N dieresis ; B 185 569 467 688 ;
-C 202 ; WX 300 ; N ring ; B 178 551 334 706 ;
-C 203 ; WX 320 ; N cedilla ; B 45 -178 240 0 ;
-C 205 ; WX 340 ; N hungarumlaut ; B 167 547 402 738 ;
-C 206 ; WX 260 ; N ogonek ; B 51 -173 184 0 ;
-C 207 ; WX 440 ; N caron ; B 178 571 481 684 ;
-C 208 ; WX 1000 ; N emdash ; B 33 269 1061 325 ;
-C 225 ; WX 1220 ; N AE ; B -45 0 1269 681 ;
-C 227 ; WX 440 ; N ordfeminine ; B 130 396 513 698 ;
-C 232 ; WX 580 ; N Lslash ; B 21 0 656 681 ;
-C 233 ; WX 760 ; N Oslash ; B 88 -95 799 777 ;
-C 234 ; WX 1180 ; N OE ; B 88 -17 1237 698 ;
-C 235 ; WX 400 ; N ordmasculine ; B 139 396 455 698 ;
-C 241 ; WX 880 ; N ae ; B 71 -8 918 494 ;
-C 245 ; WX 280 ; N dotlessi ; B 88 -8 351 484 ;
-C 248 ; WX 340 ; N lslash ; B 50 -8 398 717 ;
-C 249 ; WX 540 ; N oslash ; B 65 -49 571 532 ;
-C 250 ; WX 900 ; N oe ; B 65 -8 948 494 ;
-C 251 ; WX 620 ; N germandbls ; B -121 -111 653 698 ;
-C -1 ; WX 540 ; N ecircumflex ; B 65 -8 575 685 ;
-C -1 ; WX 540 ; N edieresis ; B 65 -8 575 688 ;
-C -1 ; WX 620 ; N aacute ; B 71 -8 686 706 ;
-C -1 ; WX 740 ; N registered ; B 84 -17 784 698 ;
-C -1 ; WX 280 ; N icircumflex ; B 76 -8 379 685 ;
-C -1 ; WX 620 ; N udieresis ; B 88 -8 686 688 ;
-C -1 ; WX 540 ; N ograve ; B 65 -8 572 706 ;
-C -1 ; WX 620 ; N uacute ; B 88 -8 686 706 ;
-C -1 ; WX 620 ; N ucircumflex ; B 88 -8 686 685 ;
-C -1 ; WX 700 ; N Aacute ; B -25 0 720 883 ;
-C -1 ; WX 280 ; N igrave ; B 88 -8 351 706 ;
-C -1 ; WX 320 ; N Icircumflex ; B 21 0 449 862 ;
-C -1 ; WX 480 ; N ccedilla ; B 65 -178 522 494 ;
-C -1 ; WX 620 ; N adieresis ; B 71 -8 686 688 ;
-C -1 ; WX 680 ; N Ecircumflex ; B 21 0 736 862 ;
-C -1 ; WX 540 ; N scaron ; B 65 -8 547 684 ;
-C -1 ; WX 600 ; N thorn ; B -24 -212 620 717 ;
-C -1 ; WX 980 ; N trademark ; B 69 277 965 681 ;
-C -1 ; WX 540 ; N egrave ; B 65 -8 575 706 ;
-C -1 ; WX 372 ; N threesuperior ; B 70 269 439 698 ;
-C -1 ; WX 520 ; N zcaron ; B 38 -8 561 684 ;
-C -1 ; WX 620 ; N atilde ; B 71 -8 686 671 ;
-C -1 ; WX 620 ; N aring ; B 71 -8 686 706 ;
-C -1 ; WX 540 ; N ocircumflex ; B 65 -8 572 685 ;
-C -1 ; WX 680 ; N Edieresis ; B 21 0 736 865 ;
-C -1 ; WX 930 ; N threequarters ; B 99 0 913 691 ;
-C -1 ; WX 600 ; N ydieresis ; B 60 -221 609 688 ;
-C -1 ; WX 600 ; N yacute ; B 60 -221 609 706 ;
-C -1 ; WX 280 ; N iacute ; B 88 -8 351 706 ;
-C -1 ; WX 700 ; N Acircumflex ; B -25 0 720 862 ;
-C -1 ; WX 720 ; N Uacute ; B 118 -17 842 883 ;
-C -1 ; WX 540 ; N eacute ; B 65 -8 575 706 ;
-C -1 ; WX 760 ; N Ograve ; B 88 -17 799 883 ;
-C -1 ; WX 620 ; N agrave ; B 71 -8 686 706 ;
-C -1 ; WX 720 ; N Udieresis ; B 118 -17 842 865 ;
-C -1 ; WX 620 ; N acircumflex ; B 71 -8 686 685 ;
-C -1 ; WX 320 ; N Igrave ; B 21 0 412 883 ;
-C -1 ; WX 372 ; N twosuperior ; B 68 279 439 698 ;
-C -1 ; WX 720 ; N Ugrave ; B 118 -17 842 883 ;
-C -1 ; WX 930 ; N onequarter ; B 91 0 913 681 ;
-C -1 ; WX 720 ; N Ucircumflex ; B 118 -17 842 862 ;
-C -1 ; WX 640 ; N Scaron ; B 61 -17 668 861 ;
-C -1 ; WX 320 ; N Idieresis ; B 21 0 447 865 ;
-C -1 ; WX 280 ; N idieresis ; B 88 -8 377 688 ;
-C -1 ; WX 680 ; N Egrave ; B 21 0 736 883 ;
-C -1 ; WX 760 ; N Oacute ; B 88 -17 799 883 ;
-C -1 ; WX 600 ; N divide ; B 91 46 595 548 ;
-C -1 ; WX 700 ; N Atilde ; B -25 0 720 848 ;
-C -1 ; WX 700 ; N Aring ; B -25 0 720 883 ;
-C -1 ; WX 760 ; N Odieresis ; B 88 -17 799 865 ;
-C -1 ; WX 700 ; N Adieresis ; B -25 0 720 865 ;
-C -1 ; WX 720 ; N Ntilde ; B 18 0 823 848 ;
-C -1 ; WX 580 ; N Zcaron ; B 8 0 695 861 ;
-C -1 ; WX 600 ; N Thorn ; B 21 0 656 681 ;
-C -1 ; WX 320 ; N Iacute ; B 21 0 412 883 ;
-C -1 ; WX 600 ; N plusminus ; B 91 0 595 548 ;
-C -1 ; WX 600 ; N multiply ; B 91 44 595 548 ;
-C -1 ; WX 680 ; N Eacute ; B 21 0 736 883 ;
-C -1 ; WX 660 ; N Ydieresis ; B 87 0 809 865 ;
-C -1 ; WX 372 ; N onesuperior ; B 114 279 339 688 ;
-C -1 ; WX 620 ; N ugrave ; B 88 -8 686 706 ;
-C -1 ; WX 600 ; N logicalnot ; B 91 163 595 433 ;
-C -1 ; WX 620 ; N ntilde ; B 88 -8 673 671 ;
-C -1 ; WX 760 ; N Otilde ; B 88 -17 799 848 ;
-C -1 ; WX 540 ; N otilde ; B 65 -8 572 671 ;
-C -1 ; WX 720 ; N Ccedilla ; B 88 -178 746 698 ;
-C -1 ; WX 700 ; N Agrave ; B -25 0 720 883 ;
-C -1 ; WX 930 ; N onehalf ; B 91 0 925 681 ;
-C -1 ; WX 740 ; N Eth ; B 21 0 782 681 ;
-C -1 ; WX 400 ; N degree ; B 120 398 420 698 ;
-C -1 ; WX 660 ; N Yacute ; B 87 0 809 883 ;
-C -1 ; WX 760 ; N Ocircumflex ; B 88 -17 799 862 ;
-C -1 ; WX 540 ; N oacute ; B 65 -8 572 706 ;
-C -1 ; WX 620 ; N mu ; B 53 -221 686 484 ;
-C -1 ; WX 600 ; N minus ; B 91 259 595 335 ;
-C -1 ; WX 540 ; N eth ; B 65 -8 642 725 ;
-C -1 ; WX 540 ; N odieresis ; B 65 -8 572 688 ;
-C -1 ; WX 740 ; N copyright ; B 84 -17 784 698 ;
-C -1 ; WX 600 ; N brokenbar ; B 294 -175 372 675 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 85
-
-KPX A Y -62
-KPX A W -73
-KPX A V -78
-KPX A T -5
-
-KPX F period -97
-KPX F comma -98
-KPX F A -16
-
-KPX L y 20
-KPX L Y 7
-KPX L W 9
-KPX L V 4
-
-KPX P period -105
-KPX P comma -106
-KPX P A -30
-
-KPX R Y 11
-KPX R W 2
-KPX R V 2
-KPX R T 65
-
-KPX T semicolon 48
-KPX T s -7
-KPX T r 67
-KPX T period -78
-KPX T o 14
-KPX T i 71
-KPX T hyphen 20
-KPX T e 10
-KPX T comma -79
-KPX T colon 48
-KPX T c 16
-KPX T a 9
-KPX T A -14
-
-KPX V y -14
-KPX V u -10
-KPX V semicolon -44
-KPX V r -20
-KPX V period -100
-KPX V o -70
-KPX V i 3
-KPX V hyphen 20
-KPX V e -70
-KPX V comma -109
-KPX V colon -35
-KPX V a -70
-KPX V A -70
-
-KPX W y -14
-KPX W u -20
-KPX W semicolon -42
-KPX W r -30
-KPX W period -100
-KPX W o -60
-KPX W i 3
-KPX W hyphen 20
-KPX W e -60
-KPX W comma -109
-KPX W colon -35
-KPX W a -60
-KPX W A -60
-
-KPX Y v -19
-KPX Y u -31
-KPX Y semicolon -40
-KPX Y q -72
-KPX Y period -100
-KPX Y p -37
-KPX Y o -75
-KPX Y i -11
-KPX Y hyphen 20
-KPX Y e -78
-KPX Y comma -109
-KPX Y colon -35
-KPX Y a -79
-KPX Y A -82
-
-KPX f f -19
-
-KPX r q -14
-KPX r period -134
-KPX r o -10
-KPX r n 38
-KPX r m 37
-KPX r hyphen 20
-KPX r h -20
-KPX r g -3
-KPX r f -9
-KPX r e -15
-KPX r d -9
-KPX r comma -143
-KPX r c -8
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 200 177 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 130 177 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 140 177 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 160 177 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 220 177 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 130 177 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 210 177 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 140 177 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 150 177 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 150 177 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 30 177 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -30 177 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -20 177 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave -30 177 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 130 177 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 250 177 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 190 177 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 200 177 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 210 177 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 190 177 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 100 177 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 230 177 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 170 177 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 180 177 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 170 177 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 200 177 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 140 177 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 70 177 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 120 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 70 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 80 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 110 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 140 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 60 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 90 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 30 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 40 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 80 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -40 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -100 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -90 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -60 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 60 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 80 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 20 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 40 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 80 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 30 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 30 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 120 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 60 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 70 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 110 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 140 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 70 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 20 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Courier-Bold.afm b/blt3.0.1/library/afm/Courier-Bold.afm
deleted file mode 100644
index 4ade4fa..0000000
--- a/blt3.0.1/library/afm/Courier-Bold.afm
+++ /dev/null
@@ -1,345 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1989, 1990, 1991, Adobe Systems Incorporated. All rights reserved.
-Comment Creation Date: Tue Sep 17 14:02:41 1991
-Comment UniqueID 36384
-Comment VMusage 31992 40360
-FontName Courier-Bold
-FullName Courier Bold
-FamilyName Courier
-Weight Bold
-ItalicAngle 0
-IsFixedPitch true
-FontBBox -113 -250 749 801
-UnderlinePosition -100
-UnderlineThickness 50
-Version 002.004
-Notice Copyright (c) 1989, 1990, 1991, Adobe Systems Incorporated. All rights reserved.
-EncodingScheme AdobeStandardEncoding
-CapHeight 562
-XHeight 439
-Ascender 626
-Descender -142
-StartCharMetrics 260
-C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 600 ; N exclam ; B 202 -15 398 572 ;
-C 34 ; WX 600 ; N quotedbl ; B 135 277 465 562 ;
-C 35 ; WX 600 ; N numbersign ; B 56 -45 544 651 ;
-C 36 ; WX 600 ; N dollar ; B 82 -126 519 666 ;
-C 37 ; WX 600 ; N percent ; B 5 -15 595 616 ;
-C 38 ; WX 600 ; N ampersand ; B 36 -15 546 543 ;
-C 39 ; WX 600 ; N quoteright ; B 171 277 423 562 ;
-C 40 ; WX 600 ; N parenleft ; B 219 -102 461 616 ;
-C 41 ; WX 600 ; N parenright ; B 139 -102 381 616 ;
-C 42 ; WX 600 ; N asterisk ; B 91 219 509 601 ;
-C 43 ; WX 600 ; N plus ; B 71 39 529 478 ;
-C 44 ; WX 600 ; N comma ; B 123 -111 393 174 ;
-C 45 ; WX 600 ; N hyphen ; B 100 203 500 313 ;
-C 46 ; WX 600 ; N period ; B 192 -15 408 171 ;
-C 47 ; WX 600 ; N slash ; B 98 -77 502 626 ;
-C 48 ; WX 600 ; N zero ; B 87 -15 513 616 ;
-C 49 ; WX 600 ; N one ; B 81 0 539 616 ;
-C 50 ; WX 600 ; N two ; B 61 0 499 616 ;
-C 51 ; WX 600 ; N three ; B 63 -15 501 616 ;
-C 52 ; WX 600 ; N four ; B 53 0 507 616 ;
-C 53 ; WX 600 ; N five ; B 70 -15 521 601 ;
-C 54 ; WX 600 ; N six ; B 90 -15 521 616 ;
-C 55 ; WX 600 ; N seven ; B 55 0 494 601 ;
-C 56 ; WX 600 ; N eight ; B 83 -15 517 616 ;
-C 57 ; WX 600 ; N nine ; B 79 -15 510 616 ;
-C 58 ; WX 600 ; N colon ; B 191 -15 407 425 ;
-C 59 ; WX 600 ; N semicolon ; B 123 -111 408 425 ;
-C 60 ; WX 600 ; N less ; B 66 15 523 501 ;
-C 61 ; WX 600 ; N equal ; B 71 118 529 398 ;
-C 62 ; WX 600 ; N greater ; B 77 15 534 501 ;
-C 63 ; WX 600 ; N question ; B 98 -14 501 580 ;
-C 64 ; WX 600 ; N at ; B 16 -15 584 616 ;
-C 65 ; WX 600 ; N A ; B -9 0 609 562 ;
-C 66 ; WX 600 ; N B ; B 30 0 573 562 ;
-C 67 ; WX 600 ; N C ; B 22 -18 560 580 ;
-C 68 ; WX 600 ; N D ; B 30 0 594 562 ;
-C 69 ; WX 600 ; N E ; B 25 0 560 562 ;
-C 70 ; WX 600 ; N F ; B 39 0 570 562 ;
-C 71 ; WX 600 ; N G ; B 22 -18 594 580 ;
-C 72 ; WX 600 ; N H ; B 20 0 580 562 ;
-C 73 ; WX 600 ; N I ; B 77 0 523 562 ;
-C 74 ; WX 600 ; N J ; B 37 -18 601 562 ;
-C 75 ; WX 600 ; N K ; B 21 0 599 562 ;
-C 76 ; WX 600 ; N L ; B 39 0 578 562 ;
-C 77 ; WX 600 ; N M ; B -2 0 602 562 ;
-C 78 ; WX 600 ; N N ; B 8 -12 610 562 ;
-C 79 ; WX 600 ; N O ; B 22 -18 578 580 ;
-C 80 ; WX 600 ; N P ; B 48 0 559 562 ;
-C 81 ; WX 600 ; N Q ; B 32 -138 578 580 ;
-C 82 ; WX 600 ; N R ; B 24 0 599 562 ;
-C 83 ; WX 600 ; N S ; B 47 -22 553 582 ;
-C 84 ; WX 600 ; N T ; B 21 0 579 562 ;
-C 85 ; WX 600 ; N U ; B 4 -18 596 562 ;
-C 86 ; WX 600 ; N V ; B -13 0 613 562 ;
-C 87 ; WX 600 ; N W ; B -18 0 618 562 ;
-C 88 ; WX 600 ; N X ; B 12 0 588 562 ;
-C 89 ; WX 600 ; N Y ; B 12 0 589 562 ;
-C 90 ; WX 600 ; N Z ; B 62 0 539 562 ;
-C 91 ; WX 600 ; N bracketleft ; B 245 -102 475 616 ;
-C 92 ; WX 600 ; N backslash ; B 99 -77 503 626 ;
-C 93 ; WX 600 ; N bracketright ; B 125 -102 355 616 ;
-C 94 ; WX 600 ; N asciicircum ; B 108 250 492 616 ;
-C 95 ; WX 600 ; N underscore ; B 0 -125 600 -75 ;
-C 96 ; WX 600 ; N quoteleft ; B 178 277 428 562 ;
-C 97 ; WX 600 ; N a ; B 35 -15 570 454 ;
-C 98 ; WX 600 ; N b ; B 0 -15 584 626 ;
-C 99 ; WX 600 ; N c ; B 40 -15 545 459 ;
-C 100 ; WX 600 ; N d ; B 20 -15 591 626 ;
-C 101 ; WX 600 ; N e ; B 40 -15 563 454 ;
-C 102 ; WX 600 ; N f ; B 83 0 547 626 ; L i fi ; L l fl ;
-C 103 ; WX 600 ; N g ; B 30 -146 580 454 ;
-C 104 ; WX 600 ; N h ; B 5 0 592 626 ;
-C 105 ; WX 600 ; N i ; B 77 0 523 658 ;
-C 106 ; WX 600 ; N j ; B 63 -146 440 658 ;
-C 107 ; WX 600 ; N k ; B 20 0 585 626 ;
-C 108 ; WX 600 ; N l ; B 77 0 523 626 ;
-C 109 ; WX 600 ; N m ; B -22 0 626 454 ;
-C 110 ; WX 600 ; N n ; B 18 0 592 454 ;
-C 111 ; WX 600 ; N o ; B 30 -15 570 454 ;
-C 112 ; WX 600 ; N p ; B -1 -142 570 454 ;
-C 113 ; WX 600 ; N q ; B 20 -142 591 454 ;
-C 114 ; WX 600 ; N r ; B 47 0 580 454 ;
-C 115 ; WX 600 ; N s ; B 68 -17 535 459 ;
-C 116 ; WX 600 ; N t ; B 47 -15 532 562 ;
-C 117 ; WX 600 ; N u ; B -1 -15 569 439 ;
-C 118 ; WX 600 ; N v ; B -1 0 601 439 ;
-C 119 ; WX 600 ; N w ; B -18 0 618 439 ;
-C 120 ; WX 600 ; N x ; B 6 0 594 439 ;
-C 121 ; WX 600 ; N y ; B -4 -142 601 439 ;
-C 122 ; WX 600 ; N z ; B 81 0 520 439 ;
-C 123 ; WX 600 ; N braceleft ; B 160 -102 464 616 ;
-C 124 ; WX 600 ; N bar ; B 255 -250 345 750 ;
-C 125 ; WX 600 ; N braceright ; B 136 -102 440 616 ;
-C 126 ; WX 600 ; N asciitilde ; B 71 153 530 356 ;
-C 161 ; WX 600 ; N exclamdown ; B 202 -146 398 449 ;
-C 162 ; WX 600 ; N cent ; B 66 -49 518 614 ;
-C 163 ; WX 600 ; N sterling ; B 72 -28 558 611 ;
-C 164 ; WX 600 ; N fraction ; B 25 -60 576 661 ;
-C 165 ; WX 600 ; N yen ; B 10 0 590 562 ;
-C 166 ; WX 600 ; N florin ; B -30 -131 572 616 ;
-C 167 ; WX 600 ; N section ; B 83 -70 517 580 ;
-C 168 ; WX 600 ; N currency ; B 54 49 546 517 ;
-C 169 ; WX 600 ; N quotesingle ; B 227 277 373 562 ;
-C 170 ; WX 600 ; N quotedblleft ; B 71 277 535 562 ;
-C 171 ; WX 600 ; N guillemotleft ; B 8 70 553 446 ;
-C 172 ; WX 600 ; N guilsinglleft ; B 141 70 459 446 ;
-C 173 ; WX 600 ; N guilsinglright ; B 141 70 459 446 ;
-C 174 ; WX 600 ; N fi ; B 12 0 593 626 ;
-C 175 ; WX 600 ; N fl ; B 12 0 593 626 ;
-C 177 ; WX 600 ; N endash ; B 65 203 535 313 ;
-C 178 ; WX 600 ; N dagger ; B 106 -70 494 580 ;
-C 179 ; WX 600 ; N daggerdbl ; B 106 -70 494 580 ;
-C 180 ; WX 600 ; N periodcentered ; B 196 165 404 351 ;
-C 182 ; WX 600 ; N paragraph ; B 6 -70 576 580 ;
-C 183 ; WX 600 ; N bullet ; B 140 132 460 430 ;
-C 184 ; WX 600 ; N quotesinglbase ; B 175 -142 427 143 ;
-C 185 ; WX 600 ; N quotedblbase ; B 65 -142 529 143 ;
-C 186 ; WX 600 ; N quotedblright ; B 61 277 525 562 ;
-C 187 ; WX 600 ; N guillemotright ; B 47 70 592 446 ;
-C 188 ; WX 600 ; N ellipsis ; B 26 -15 574 116 ;
-C 189 ; WX 600 ; N perthousand ; B -113 -15 713 616 ;
-C 191 ; WX 600 ; N questiondown ; B 99 -146 502 449 ;
-C 193 ; WX 600 ; N grave ; B 132 508 395 661 ;
-C 194 ; WX 600 ; N acute ; B 205 508 468 661 ;
-C 195 ; WX 600 ; N circumflex ; B 103 483 497 657 ;
-C 196 ; WX 600 ; N tilde ; B 89 493 512 636 ;
-C 197 ; WX 600 ; N macron ; B 88 505 512 585 ;
-C 198 ; WX 600 ; N breve ; B 83 468 517 631 ;
-C 199 ; WX 600 ; N dotaccent ; B 230 485 370 625 ;
-C 200 ; WX 600 ; N dieresis ; B 128 485 472 625 ;
-C 202 ; WX 600 ; N ring ; B 198 481 402 678 ;
-C 203 ; WX 600 ; N cedilla ; B 205 -206 387 0 ;
-C 205 ; WX 600 ; N hungarumlaut ; B 68 488 588 661 ;
-C 206 ; WX 600 ; N ogonek ; B 169 -199 367 0 ;
-C 207 ; WX 600 ; N caron ; B 103 493 497 667 ;
-C 208 ; WX 600 ; N emdash ; B -10 203 610 313 ;
-C 225 ; WX 600 ; N AE ; B -29 0 602 562 ;
-C 227 ; WX 600 ; N ordfeminine ; B 147 196 453 580 ;
-C 232 ; WX 600 ; N Lslash ; B 39 0 578 562 ;
-C 233 ; WX 600 ; N Oslash ; B 22 -22 578 584 ;
-C 234 ; WX 600 ; N OE ; B -25 0 595 562 ;
-C 235 ; WX 600 ; N ordmasculine ; B 147 196 453 580 ;
-C 241 ; WX 600 ; N ae ; B -4 -15 601 454 ;
-C 245 ; WX 600 ; N dotlessi ; B 77 0 523 439 ;
-C 248 ; WX 600 ; N lslash ; B 77 0 523 626 ;
-C 249 ; WX 600 ; N oslash ; B 30 -24 570 463 ;
-C 250 ; WX 600 ; N oe ; B -18 -15 611 454 ;
-C 251 ; WX 600 ; N germandbls ; B 22 -15 596 626 ;
-C -1 ; WX 600 ; N Odieresis ; B 22 -18 578 748 ;
-C -1 ; WX 600 ; N logicalnot ; B 71 103 529 413 ;
-C -1 ; WX 600 ; N minus ; B 71 203 529 313 ;
-C -1 ; WX 600 ; N merge ; B 137 -15 464 487 ;
-C -1 ; WX 600 ; N degree ; B 86 243 474 616 ;
-C -1 ; WX 600 ; N dectab ; B 8 0 592 320 ;
-C -1 ; WX 600 ; N ll ; B -12 0 600 626 ;
-C -1 ; WX 600 ; N IJ ; B -8 -18 622 562 ;
-C -1 ; WX 600 ; N Eacute ; B 25 0 560 784 ;
-C -1 ; WX 600 ; N Ocircumflex ; B 22 -18 578 780 ;
-C -1 ; WX 600 ; N ucircumflex ; B -1 -15 569 657 ;
-C -1 ; WX 600 ; N left ; B 65 44 535 371 ;
-C -1 ; WX 600 ; N threesuperior ; B 138 222 433 616 ;
-C -1 ; WX 600 ; N up ; B 136 0 463 447 ;
-C -1 ; WX 600 ; N multiply ; B 81 39 520 478 ;
-C -1 ; WX 600 ; N Scaron ; B 47 -22 553 790 ;
-C -1 ; WX 600 ; N tab ; B 19 0 581 562 ;
-C -1 ; WX 600 ; N Ucircumflex ; B 4 -18 596 780 ;
-C -1 ; WX 600 ; N divide ; B 71 16 529 500 ;
-C -1 ; WX 600 ; N Acircumflex ; B -9 0 609 780 ;
-C -1 ; WX 600 ; N eacute ; B 40 -15 563 661 ;
-C -1 ; WX 600 ; N uacute ; B -1 -15 569 661 ;
-C -1 ; WX 600 ; N Aacute ; B -9 0 609 784 ;
-C -1 ; WX 600 ; N copyright ; B 0 -18 600 580 ;
-C -1 ; WX 600 ; N twosuperior ; B 143 230 436 616 ;
-C -1 ; WX 600 ; N Ecircumflex ; B 25 0 560 780 ;
-C -1 ; WX 600 ; N ntilde ; B 18 0 592 636 ;
-C -1 ; WX 600 ; N down ; B 137 -15 464 439 ;
-C -1 ; WX 600 ; N center ; B 40 14 560 580 ;
-C -1 ; WX 600 ; N onesuperior ; B 153 230 447 616 ;
-C -1 ; WX 600 ; N ij ; B 6 -146 574 658 ;
-C -1 ; WX 600 ; N edieresis ; B 40 -15 563 625 ;
-C -1 ; WX 600 ; N graybox ; B 76 0 525 599 ;
-C -1 ; WX 600 ; N odieresis ; B 30 -15 570 625 ;
-C -1 ; WX 600 ; N Ograve ; B 22 -18 578 784 ;
-C -1 ; WX 600 ; N threequarters ; B -47 -60 648 661 ;
-C -1 ; WX 600 ; N plusminus ; B 71 24 529 515 ;
-C -1 ; WX 600 ; N prescription ; B 24 -15 599 562 ;
-C -1 ; WX 600 ; N eth ; B 58 -27 543 626 ;
-C -1 ; WX 600 ; N largebullet ; B 248 229 352 333 ;
-C -1 ; WX 600 ; N egrave ; B 40 -15 563 661 ;
-C -1 ; WX 600 ; N ccedilla ; B 40 -206 545 459 ;
-C -1 ; WX 600 ; N notegraphic ; B 77 -15 523 572 ;
-C -1 ; WX 600 ; N Udieresis ; B 4 -18 596 748 ;
-C -1 ; WX 600 ; N Gcaron ; B 22 -18 594 790 ;
-C -1 ; WX 600 ; N arrowdown ; B 144 -15 456 608 ;
-C -1 ; WX 600 ; N format ; B 5 -146 115 601 ;
-C -1 ; WX 600 ; N Otilde ; B 22 -18 578 759 ;
-C -1 ; WX 600 ; N Idieresis ; B 77 0 523 748 ;
-C -1 ; WX 600 ; N adieresis ; B 35 -15 570 625 ;
-C -1 ; WX 600 ; N ecircumflex ; B 40 -15 563 657 ;
-C -1 ; WX 600 ; N Eth ; B 30 0 594 562 ;
-C -1 ; WX 600 ; N onequarter ; B -56 -60 656 661 ;
-C -1 ; WX 600 ; N LL ; B -45 0 645 562 ;
-C -1 ; WX 600 ; N agrave ; B 35 -15 570 661 ;
-C -1 ; WX 600 ; N Zcaron ; B 62 0 539 790 ;
-C -1 ; WX 600 ; N Scedilla ; B 47 -206 553 582 ;
-C -1 ; WX 600 ; N Idot ; B 77 0 523 748 ;
-C -1 ; WX 600 ; N Iacute ; B 77 0 523 784 ;
-C -1 ; WX 600 ; N indent ; B 65 45 535 372 ;
-C -1 ; WX 600 ; N Ugrave ; B 4 -18 596 784 ;
-C -1 ; WX 600 ; N scaron ; B 68 -17 535 667 ;
-C -1 ; WX 600 ; N overscore ; B 0 579 600 629 ;
-C -1 ; WX 600 ; N Aring ; B -9 0 609 801 ;
-C -1 ; WX 600 ; N Ccedilla ; B 22 -206 560 580 ;
-C -1 ; WX 600 ; N Igrave ; B 77 0 523 784 ;
-C -1 ; WX 600 ; N brokenbar ; B 255 -175 345 675 ;
-C -1 ; WX 600 ; N Oacute ; B 22 -18 578 784 ;
-C -1 ; WX 600 ; N otilde ; B 30 -15 570 636 ;
-C -1 ; WX 600 ; N Yacute ; B 12 0 589 784 ;
-C -1 ; WX 600 ; N lira ; B 72 -28 558 611 ;
-C -1 ; WX 600 ; N Icircumflex ; B 77 0 523 780 ;
-C -1 ; WX 600 ; N Atilde ; B -9 0 609 759 ;
-C -1 ; WX 600 ; N Uacute ; B 4 -18 596 784 ;
-C -1 ; WX 600 ; N Ydieresis ; B 12 0 589 748 ;
-C -1 ; WX 600 ; N ydieresis ; B -4 -142 601 625 ;
-C -1 ; WX 600 ; N idieresis ; B 77 0 523 625 ;
-C -1 ; WX 600 ; N Adieresis ; B -9 0 609 748 ;
-C -1 ; WX 600 ; N mu ; B -1 -142 569 439 ;
-C -1 ; WX 600 ; N trademark ; B -9 230 749 562 ;
-C -1 ; WX 600 ; N oacute ; B 30 -15 570 661 ;
-C -1 ; WX 600 ; N acircumflex ; B 35 -15 570 657 ;
-C -1 ; WX 600 ; N Agrave ; B -9 0 609 784 ;
-C -1 ; WX 600 ; N return ; B 19 0 581 562 ;
-C -1 ; WX 600 ; N atilde ; B 35 -15 570 636 ;
-C -1 ; WX 600 ; N square ; B 19 0 581 562 ;
-C -1 ; WX 600 ; N registered ; B 0 -18 600 580 ;
-C -1 ; WX 600 ; N stop ; B 19 0 581 562 ;
-C -1 ; WX 600 ; N udieresis ; B -1 -15 569 625 ;
-C -1 ; WX 600 ; N arrowup ; B 144 3 456 626 ;
-C -1 ; WX 600 ; N igrave ; B 77 0 523 661 ;
-C -1 ; WX 600 ; N Edieresis ; B 25 0 560 748 ;
-C -1 ; WX 600 ; N zcaron ; B 81 0 520 667 ;
-C -1 ; WX 600 ; N arrowboth ; B -24 143 624 455 ;
-C -1 ; WX 600 ; N gcaron ; B 30 -146 580 667 ;
-C -1 ; WX 600 ; N arrowleft ; B -24 143 634 455 ;
-C -1 ; WX 600 ; N aacute ; B 35 -15 570 661 ;
-C -1 ; WX 600 ; N ocircumflex ; B 30 -15 570 657 ;
-C -1 ; WX 600 ; N scedilla ; B 68 -206 535 459 ;
-C -1 ; WX 600 ; N ograve ; B 30 -15 570 661 ;
-C -1 ; WX 600 ; N onehalf ; B -47 -60 648 661 ;
-C -1 ; WX 600 ; N ugrave ; B -1 -15 569 661 ;
-C -1 ; WX 600 ; N Ntilde ; B 8 -12 610 759 ;
-C -1 ; WX 600 ; N iacute ; B 77 0 523 661 ;
-C -1 ; WX 600 ; N arrowright ; B -34 143 624 455 ;
-C -1 ; WX 600 ; N Thorn ; B 48 0 557 562 ;
-C -1 ; WX 600 ; N Egrave ; B 25 0 560 784 ;
-C -1 ; WX 600 ; N thorn ; B -14 -142 570 626 ;
-C -1 ; WX 600 ; N aring ; B 35 -15 570 678 ;
-C -1 ; WX 600 ; N yacute ; B -4 -142 601 661 ;
-C -1 ; WX 600 ; N icircumflex ; B 63 0 523 657 ;
-EndCharMetrics
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 30 123 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex -30 123 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis -20 123 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave -50 123 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring -10 123 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde -30 123 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 30 123 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 0 123 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 0 123 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 0 123 ;
-CC Gcaron 2 ; PCC G 0 0 ; PCC caron 10 123 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 0 123 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 0 123 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 0 123 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 0 123 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 0 123 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 0 123 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 0 123 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 0 123 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 0 123 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 0 123 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 0 123 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 30 123 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 0 123 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 0 123 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave -30 123 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 30 123 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 0 123 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 0 123 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 0 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex -20 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis -10 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave -30 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 0 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 0 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 0 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 0 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 0 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 0 0 ;
-CC gcaron 2 ; PCC g 0 0 ; PCC caron -40 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -40 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -40 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 0 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 0 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 0 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 0 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 0 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 0 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 0 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 0 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 0 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex -20 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis -20 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave -30 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 30 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 10 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 0 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Courier-BoldOblique.afm b/blt3.0.1/library/afm/Courier-BoldOblique.afm
deleted file mode 100644
index e0b3940..0000000
--- a/blt3.0.1/library/afm/Courier-BoldOblique.afm
+++ /dev/null
@@ -1,345 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1989, 1990, 1991, Adobe Systems Incorporated. All rights reserved.
-Comment Creation Date: Tue Sep 17 14:13:24 1991
-Comment UniqueID 36389
-Comment VMusage 10055 54684
-FontName Courier-BoldOblique
-FullName Courier Bold Oblique
-FamilyName Courier
-Weight Bold
-ItalicAngle -12
-IsFixedPitch true
-FontBBox -56 -250 868 801
-UnderlinePosition -100
-UnderlineThickness 50
-Version 002.004
-Notice Copyright (c) 1989, 1990, 1991, Adobe Systems Incorporated. All rights reserved.
-EncodingScheme AdobeStandardEncoding
-CapHeight 562
-XHeight 439
-Ascender 626
-Descender -142
-StartCharMetrics 260
-C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 600 ; N exclam ; B 216 -15 495 572 ;
-C 34 ; WX 600 ; N quotedbl ; B 212 277 584 562 ;
-C 35 ; WX 600 ; N numbersign ; B 88 -45 640 651 ;
-C 36 ; WX 600 ; N dollar ; B 87 -126 629 666 ;
-C 37 ; WX 600 ; N percent ; B 102 -15 624 616 ;
-C 38 ; WX 600 ; N ampersand ; B 62 -15 594 543 ;
-C 39 ; WX 600 ; N quoteright ; B 230 277 542 562 ;
-C 40 ; WX 600 ; N parenleft ; B 266 -102 592 616 ;
-C 41 ; WX 600 ; N parenright ; B 117 -102 444 616 ;
-C 42 ; WX 600 ; N asterisk ; B 179 219 597 601 ;
-C 43 ; WX 600 ; N plus ; B 114 39 596 478 ;
-C 44 ; WX 600 ; N comma ; B 99 -111 430 174 ;
-C 45 ; WX 600 ; N hyphen ; B 143 203 567 313 ;
-C 46 ; WX 600 ; N period ; B 207 -15 426 171 ;
-C 47 ; WX 600 ; N slash ; B 91 -77 626 626 ;
-C 48 ; WX 600 ; N zero ; B 136 -15 592 616 ;
-C 49 ; WX 600 ; N one ; B 93 0 561 616 ;
-C 50 ; WX 600 ; N two ; B 61 0 593 616 ;
-C 51 ; WX 600 ; N three ; B 72 -15 571 616 ;
-C 52 ; WX 600 ; N four ; B 82 0 558 616 ;
-C 53 ; WX 600 ; N five ; B 77 -15 621 601 ;
-C 54 ; WX 600 ; N six ; B 136 -15 652 616 ;
-C 55 ; WX 600 ; N seven ; B 147 0 622 601 ;
-C 56 ; WX 600 ; N eight ; B 115 -15 604 616 ;
-C 57 ; WX 600 ; N nine ; B 76 -15 592 616 ;
-C 58 ; WX 600 ; N colon ; B 206 -15 479 425 ;
-C 59 ; WX 600 ; N semicolon ; B 99 -111 480 425 ;
-C 60 ; WX 600 ; N less ; B 121 15 612 501 ;
-C 61 ; WX 600 ; N equal ; B 96 118 614 398 ;
-C 62 ; WX 600 ; N greater ; B 97 15 589 501 ;
-C 63 ; WX 600 ; N question ; B 183 -14 591 580 ;
-C 64 ; WX 600 ; N at ; B 66 -15 641 616 ;
-C 65 ; WX 600 ; N A ; B -9 0 631 562 ;
-C 66 ; WX 600 ; N B ; B 30 0 629 562 ;
-C 67 ; WX 600 ; N C ; B 75 -18 674 580 ;
-C 68 ; WX 600 ; N D ; B 30 0 664 562 ;
-C 69 ; WX 600 ; N E ; B 25 0 669 562 ;
-C 70 ; WX 600 ; N F ; B 39 0 683 562 ;
-C 71 ; WX 600 ; N G ; B 75 -18 674 580 ;
-C 72 ; WX 600 ; N H ; B 20 0 699 562 ;
-C 73 ; WX 600 ; N I ; B 77 0 642 562 ;
-C 74 ; WX 600 ; N J ; B 59 -18 720 562 ;
-C 75 ; WX 600 ; N K ; B 21 0 691 562 ;
-C 76 ; WX 600 ; N L ; B 39 0 635 562 ;
-C 77 ; WX 600 ; N M ; B -2 0 721 562 ;
-C 78 ; WX 600 ; N N ; B 8 -12 729 562 ;
-C 79 ; WX 600 ; N O ; B 74 -18 645 580 ;
-C 80 ; WX 600 ; N P ; B 48 0 642 562 ;
-C 81 ; WX 600 ; N Q ; B 84 -138 636 580 ;
-C 82 ; WX 600 ; N R ; B 24 0 617 562 ;
-C 83 ; WX 600 ; N S ; B 54 -22 672 582 ;
-C 84 ; WX 600 ; N T ; B 86 0 678 562 ;
-C 85 ; WX 600 ; N U ; B 101 -18 715 562 ;
-C 86 ; WX 600 ; N V ; B 84 0 732 562 ;
-C 87 ; WX 600 ; N W ; B 84 0 737 562 ;
-C 88 ; WX 600 ; N X ; B 12 0 689 562 ;
-C 89 ; WX 600 ; N Y ; B 109 0 708 562 ;
-C 90 ; WX 600 ; N Z ; B 62 0 636 562 ;
-C 91 ; WX 600 ; N bracketleft ; B 223 -102 606 616 ;
-C 92 ; WX 600 ; N backslash ; B 223 -77 496 626 ;
-C 93 ; WX 600 ; N bracketright ; B 103 -102 486 616 ;
-C 94 ; WX 600 ; N asciicircum ; B 171 250 555 616 ;
-C 95 ; WX 600 ; N underscore ; B -27 -125 584 -75 ;
-C 96 ; WX 600 ; N quoteleft ; B 297 277 487 562 ;
-C 97 ; WX 600 ; N a ; B 62 -15 592 454 ;
-C 98 ; WX 600 ; N b ; B 13 -15 636 626 ;
-C 99 ; WX 600 ; N c ; B 81 -15 631 459 ;
-C 100 ; WX 600 ; N d ; B 61 -15 644 626 ;
-C 101 ; WX 600 ; N e ; B 81 -15 604 454 ;
-C 102 ; WX 600 ; N f ; B 83 0 677 626 ; L i fi ; L l fl ;
-C 103 ; WX 600 ; N g ; B 41 -146 673 454 ;
-C 104 ; WX 600 ; N h ; B 18 0 614 626 ;
-C 105 ; WX 600 ; N i ; B 77 0 545 658 ;
-C 106 ; WX 600 ; N j ; B 37 -146 580 658 ;
-C 107 ; WX 600 ; N k ; B 33 0 642 626 ;
-C 108 ; WX 600 ; N l ; B 77 0 545 626 ;
-C 109 ; WX 600 ; N m ; B -22 0 648 454 ;
-C 110 ; WX 600 ; N n ; B 18 0 614 454 ;
-C 111 ; WX 600 ; N o ; B 71 -15 622 454 ;
-C 112 ; WX 600 ; N p ; B -31 -142 622 454 ;
-C 113 ; WX 600 ; N q ; B 61 -142 684 454 ;
-C 114 ; WX 600 ; N r ; B 47 0 654 454 ;
-C 115 ; WX 600 ; N s ; B 67 -17 607 459 ;
-C 116 ; WX 600 ; N t ; B 118 -15 566 562 ;
-C 117 ; WX 600 ; N u ; B 70 -15 591 439 ;
-C 118 ; WX 600 ; N v ; B 70 0 694 439 ;
-C 119 ; WX 600 ; N w ; B 53 0 711 439 ;
-C 120 ; WX 600 ; N x ; B 6 0 670 439 ;
-C 121 ; WX 600 ; N y ; B -20 -142 694 439 ;
-C 122 ; WX 600 ; N z ; B 81 0 613 439 ;
-C 123 ; WX 600 ; N braceleft ; B 204 -102 595 616 ;
-C 124 ; WX 600 ; N bar ; B 202 -250 504 750 ;
-C 125 ; WX 600 ; N braceright ; B 114 -102 506 616 ;
-C 126 ; WX 600 ; N asciitilde ; B 120 153 589 356 ;
-C 161 ; WX 600 ; N exclamdown ; B 197 -146 477 449 ;
-C 162 ; WX 600 ; N cent ; B 121 -49 604 614 ;
-C 163 ; WX 600 ; N sterling ; B 107 -28 650 611 ;
-C 164 ; WX 600 ; N fraction ; B 22 -60 707 661 ;
-C 165 ; WX 600 ; N yen ; B 98 0 709 562 ;
-C 166 ; WX 600 ; N florin ; B -56 -131 701 616 ;
-C 167 ; WX 600 ; N section ; B 74 -70 619 580 ;
-C 168 ; WX 600 ; N currency ; B 77 49 643 517 ;
-C 169 ; WX 600 ; N quotesingle ; B 304 277 492 562 ;
-C 170 ; WX 600 ; N quotedblleft ; B 190 277 594 562 ;
-C 171 ; WX 600 ; N guillemotleft ; B 63 70 638 446 ;
-C 172 ; WX 600 ; N guilsinglleft ; B 196 70 544 446 ;
-C 173 ; WX 600 ; N guilsinglright ; B 166 70 514 446 ;
-C 174 ; WX 600 ; N fi ; B 12 0 643 626 ;
-C 175 ; WX 600 ; N fl ; B 12 0 643 626 ;
-C 177 ; WX 600 ; N endash ; B 108 203 602 313 ;
-C 178 ; WX 600 ; N dagger ; B 176 -70 586 580 ;
-C 179 ; WX 600 ; N daggerdbl ; B 122 -70 586 580 ;
-C 180 ; WX 600 ; N periodcentered ; B 249 165 461 351 ;
-C 182 ; WX 600 ; N paragraph ; B 61 -70 699 580 ;
-C 183 ; WX 600 ; N bullet ; B 197 132 523 430 ;
-C 184 ; WX 600 ; N quotesinglbase ; B 145 -142 457 143 ;
-C 185 ; WX 600 ; N quotedblbase ; B 35 -142 559 143 ;
-C 186 ; WX 600 ; N quotedblright ; B 120 277 644 562 ;
-C 187 ; WX 600 ; N guillemotright ; B 72 70 647 446 ;
-C 188 ; WX 600 ; N ellipsis ; B 35 -15 586 116 ;
-C 189 ; WX 600 ; N perthousand ; B -44 -15 742 616 ;
-C 191 ; WX 600 ; N questiondown ; B 101 -146 509 449 ;
-C 193 ; WX 600 ; N grave ; B 272 508 503 661 ;
-C 194 ; WX 600 ; N acute ; B 313 508 608 661 ;
-C 195 ; WX 600 ; N circumflex ; B 212 483 606 657 ;
-C 196 ; WX 600 ; N tilde ; B 200 493 642 636 ;
-C 197 ; WX 600 ; N macron ; B 195 505 636 585 ;
-C 198 ; WX 600 ; N breve ; B 217 468 651 631 ;
-C 199 ; WX 600 ; N dotaccent ; B 346 485 490 625 ;
-C 200 ; WX 600 ; N dieresis ; B 244 485 592 625 ;
-C 202 ; WX 600 ; N ring ; B 319 481 528 678 ;
-C 203 ; WX 600 ; N cedilla ; B 169 -206 367 0 ;
-C 205 ; WX 600 ; N hungarumlaut ; B 172 488 728 661 ;
-C 206 ; WX 600 ; N ogonek ; B 144 -199 350 0 ;
-C 207 ; WX 600 ; N caron ; B 238 493 632 667 ;
-C 208 ; WX 600 ; N emdash ; B 33 203 677 313 ;
-C 225 ; WX 600 ; N AE ; B -29 0 707 562 ;
-C 227 ; WX 600 ; N ordfeminine ; B 189 196 526 580 ;
-C 232 ; WX 600 ; N Lslash ; B 39 0 635 562 ;
-C 233 ; WX 600 ; N Oslash ; B 48 -22 672 584 ;
-C 234 ; WX 600 ; N OE ; B 26 0 700 562 ;
-C 235 ; WX 600 ; N ordmasculine ; B 189 196 542 580 ;
-C 241 ; WX 600 ; N ae ; B 21 -15 651 454 ;
-C 245 ; WX 600 ; N dotlessi ; B 77 0 545 439 ;
-C 248 ; WX 600 ; N lslash ; B 77 0 578 626 ;
-C 249 ; WX 600 ; N oslash ; B 55 -24 637 463 ;
-C 250 ; WX 600 ; N oe ; B 19 -15 661 454 ;
-C 251 ; WX 600 ; N germandbls ; B 22 -15 628 626 ;
-C -1 ; WX 600 ; N Odieresis ; B 74 -18 645 748 ;
-C -1 ; WX 600 ; N logicalnot ; B 135 103 617 413 ;
-C -1 ; WX 600 ; N minus ; B 114 203 596 313 ;
-C -1 ; WX 600 ; N merge ; B 168 -15 533 487 ;
-C -1 ; WX 600 ; N degree ; B 173 243 569 616 ;
-C -1 ; WX 600 ; N dectab ; B 8 0 615 320 ;
-C -1 ; WX 600 ; N ll ; B 1 0 653 626 ;
-C -1 ; WX 600 ; N IJ ; B -8 -18 741 562 ;
-C -1 ; WX 600 ; N Eacute ; B 25 0 669 784 ;
-C -1 ; WX 600 ; N Ocircumflex ; B 74 -18 645 780 ;
-C -1 ; WX 600 ; N ucircumflex ; B 70 -15 591 657 ;
-C -1 ; WX 600 ; N left ; B 109 44 589 371 ;
-C -1 ; WX 600 ; N threesuperior ; B 193 222 525 616 ;
-C -1 ; WX 600 ; N up ; B 196 0 523 447 ;
-C -1 ; WX 600 ; N multiply ; B 105 39 606 478 ;
-C -1 ; WX 600 ; N Scaron ; B 54 -22 672 790 ;
-C -1 ; WX 600 ; N tab ; B 19 0 641 562 ;
-C -1 ; WX 600 ; N Ucircumflex ; B 101 -18 715 780 ;
-C -1 ; WX 600 ; N divide ; B 114 16 596 500 ;
-C -1 ; WX 600 ; N Acircumflex ; B -9 0 631 780 ;
-C -1 ; WX 600 ; N eacute ; B 81 -15 608 661 ;
-C -1 ; WX 600 ; N uacute ; B 70 -15 608 661 ;
-C -1 ; WX 600 ; N Aacute ; B -9 0 665 784 ;
-C -1 ; WX 600 ; N copyright ; B 53 -18 667 580 ;
-C -1 ; WX 600 ; N twosuperior ; B 192 230 541 616 ;
-C -1 ; WX 600 ; N Ecircumflex ; B 25 0 669 780 ;
-C -1 ; WX 600 ; N ntilde ; B 18 0 642 636 ;
-C -1 ; WX 600 ; N down ; B 168 -15 496 439 ;
-C -1 ; WX 600 ; N center ; B 103 14 623 580 ;
-C -1 ; WX 600 ; N onesuperior ; B 213 230 514 616 ;
-C -1 ; WX 600 ; N ij ; B 6 -146 714 658 ;
-C -1 ; WX 600 ; N edieresis ; B 81 -15 604 625 ;
-C -1 ; WX 600 ; N graybox ; B 76 0 652 599 ;
-C -1 ; WX 600 ; N odieresis ; B 71 -15 622 625 ;
-C -1 ; WX 600 ; N Ograve ; B 74 -18 645 784 ;
-C -1 ; WX 600 ; N threequarters ; B 8 -60 698 661 ;
-C -1 ; WX 600 ; N plusminus ; B 76 24 614 515 ;
-C -1 ; WX 600 ; N prescription ; B 24 -15 632 562 ;
-C -1 ; WX 600 ; N eth ; B 93 -27 661 626 ;
-C -1 ; WX 600 ; N largebullet ; B 307 229 413 333 ;
-C -1 ; WX 600 ; N egrave ; B 81 -15 604 661 ;
-C -1 ; WX 600 ; N ccedilla ; B 81 -206 631 459 ;
-C -1 ; WX 600 ; N notegraphic ; B 91 -15 619 572 ;
-C -1 ; WX 600 ; N Udieresis ; B 101 -18 715 748 ;
-C -1 ; WX 600 ; N Gcaron ; B 75 -18 674 790 ;
-C -1 ; WX 600 ; N arrowdown ; B 174 -15 486 608 ;
-C -1 ; WX 600 ; N format ; B -26 -146 243 601 ;
-C -1 ; WX 600 ; N Otilde ; B 74 -18 668 759 ;
-C -1 ; WX 600 ; N Idieresis ; B 77 0 642 748 ;
-C -1 ; WX 600 ; N adieresis ; B 62 -15 592 625 ;
-C -1 ; WX 600 ; N ecircumflex ; B 81 -15 606 657 ;
-C -1 ; WX 600 ; N Eth ; B 30 0 664 562 ;
-C -1 ; WX 600 ; N onequarter ; B 14 -60 706 661 ;
-C -1 ; WX 600 ; N LL ; B -45 0 694 562 ;
-C -1 ; WX 600 ; N agrave ; B 62 -15 592 661 ;
-C -1 ; WX 600 ; N Zcaron ; B 62 0 659 790 ;
-C -1 ; WX 600 ; N Scedilla ; B 54 -206 672 582 ;
-C -1 ; WX 600 ; N Idot ; B 77 0 642 748 ;
-C -1 ; WX 600 ; N Iacute ; B 77 0 642 784 ;
-C -1 ; WX 600 ; N indent ; B 99 45 579 372 ;
-C -1 ; WX 600 ; N Ugrave ; B 101 -18 715 784 ;
-C -1 ; WX 600 ; N scaron ; B 67 -17 632 667 ;
-C -1 ; WX 600 ; N overscore ; B 123 579 734 629 ;
-C -1 ; WX 600 ; N Aring ; B -9 0 631 801 ;
-C -1 ; WX 600 ; N Ccedilla ; B 74 -206 674 580 ;
-C -1 ; WX 600 ; N Igrave ; B 77 0 642 784 ;
-C -1 ; WX 600 ; N brokenbar ; B 218 -175 488 675 ;
-C -1 ; WX 600 ; N Oacute ; B 74 -18 645 784 ;
-C -1 ; WX 600 ; N otilde ; B 71 -15 642 636 ;
-C -1 ; WX 600 ; N Yacute ; B 109 0 708 784 ;
-C -1 ; WX 600 ; N lira ; B 107 -28 650 611 ;
-C -1 ; WX 600 ; N Icircumflex ; B 77 0 642 780 ;
-C -1 ; WX 600 ; N Atilde ; B -9 0 638 759 ;
-C -1 ; WX 600 ; N Uacute ; B 101 -18 715 784 ;
-C -1 ; WX 600 ; N Ydieresis ; B 109 0 708 748 ;
-C -1 ; WX 600 ; N ydieresis ; B -20 -142 694 625 ;
-C -1 ; WX 600 ; N idieresis ; B 77 0 552 625 ;
-C -1 ; WX 600 ; N Adieresis ; B -9 0 631 748 ;
-C -1 ; WX 600 ; N mu ; B 50 -142 591 439 ;
-C -1 ; WX 600 ; N trademark ; B 86 230 868 562 ;
-C -1 ; WX 600 ; N oacute ; B 71 -15 622 661 ;
-C -1 ; WX 600 ; N acircumflex ; B 62 -15 592 657 ;
-C -1 ; WX 600 ; N Agrave ; B -9 0 631 784 ;
-C -1 ; WX 600 ; N return ; B 79 0 700 562 ;
-C -1 ; WX 600 ; N atilde ; B 62 -15 642 636 ;
-C -1 ; WX 600 ; N square ; B 19 0 700 562 ;
-C -1 ; WX 600 ; N registered ; B 53 -18 667 580 ;
-C -1 ; WX 600 ; N stop ; B 19 0 700 562 ;
-C -1 ; WX 600 ; N udieresis ; B 70 -15 591 625 ;
-C -1 ; WX 600 ; N arrowup ; B 244 3 556 626 ;
-C -1 ; WX 600 ; N igrave ; B 77 0 545 661 ;
-C -1 ; WX 600 ; N Edieresis ; B 25 0 669 748 ;
-C -1 ; WX 600 ; N zcaron ; B 81 0 632 667 ;
-C -1 ; WX 600 ; N arrowboth ; B 40 143 688 455 ;
-C -1 ; WX 600 ; N gcaron ; B 41 -146 673 667 ;
-C -1 ; WX 600 ; N arrowleft ; B 40 143 708 455 ;
-C -1 ; WX 600 ; N aacute ; B 62 -15 608 661 ;
-C -1 ; WX 600 ; N ocircumflex ; B 71 -15 622 657 ;
-C -1 ; WX 600 ; N scedilla ; B 67 -206 607 459 ;
-C -1 ; WX 600 ; N ograve ; B 71 -15 622 661 ;
-C -1 ; WX 600 ; N onehalf ; B 23 -60 715 661 ;
-C -1 ; WX 600 ; N ugrave ; B 70 -15 591 661 ;
-C -1 ; WX 600 ; N Ntilde ; B 8 -12 729 759 ;
-C -1 ; WX 600 ; N iacute ; B 77 0 608 661 ;
-C -1 ; WX 600 ; N arrowright ; B 20 143 688 455 ;
-C -1 ; WX 600 ; N Thorn ; B 48 0 619 562 ;
-C -1 ; WX 600 ; N Egrave ; B 25 0 669 784 ;
-C -1 ; WX 600 ; N thorn ; B -31 -142 622 626 ;
-C -1 ; WX 600 ; N aring ; B 62 -15 592 678 ;
-C -1 ; WX 600 ; N yacute ; B -20 -142 694 661 ;
-C -1 ; WX 600 ; N icircumflex ; B 77 0 566 657 ;
-EndCharMetrics
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 56 123 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex -4 123 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 6 123 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave -24 123 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 16 123 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde -4 123 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 56 123 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 26 123 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 26 123 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 26 123 ;
-CC Gcaron 2 ; PCC G 0 0 ; PCC caron 36 123 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 26 123 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 26 123 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 26 123 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 26 123 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 26 123 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 26 123 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 26 123 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 26 123 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 26 123 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 26 123 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 26 123 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 56 123 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 26 123 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 26 123 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave -4 123 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 56 123 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 26 123 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 26 123 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 0 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex -20 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis -10 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave -30 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 0 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 0 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 0 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 0 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 0 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 0 0 ;
-CC gcaron 2 ; PCC g 0 0 ; PCC caron -40 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -40 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -40 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 0 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 0 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 0 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 0 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 0 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 0 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 0 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 0 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 0 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex -20 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis -20 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave -30 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 30 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 10 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 0 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Courier-Oblique.afm b/blt3.0.1/library/afm/Courier-Oblique.afm
deleted file mode 100644
index 79bb0c3..0000000
--- a/blt3.0.1/library/afm/Courier-Oblique.afm
+++ /dev/null
@@ -1,345 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1989, 1990, 1991 Adobe Systems Incorporated. All rights reserved.
-Comment Creation Date: Tue Sep 17 09:42:19 1991
-Comment UniqueID 36350
-Comment VMusage 9174 52297
-FontName Courier-Oblique
-FullName Courier Oblique
-FamilyName Courier
-Weight Medium
-ItalicAngle -12
-IsFixedPitch true
-FontBBox -28 -250 742 805
-UnderlinePosition -100
-UnderlineThickness 50
-Version 002.004
-Notice Copyright (c) 1989, 1990, 1991 Adobe Systems Incorporated. All rights reserved.
-EncodingScheme AdobeStandardEncoding
-CapHeight 562
-XHeight 426
-Ascender 629
-Descender -157
-StartCharMetrics 260
-C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 600 ; N exclam ; B 243 -15 464 572 ;
-C 34 ; WX 600 ; N quotedbl ; B 273 328 532 562 ;
-C 35 ; WX 600 ; N numbersign ; B 133 -32 596 639 ;
-C 36 ; WX 600 ; N dollar ; B 108 -126 596 662 ;
-C 37 ; WX 600 ; N percent ; B 134 -15 599 622 ;
-C 38 ; WX 600 ; N ampersand ; B 87 -15 580 543 ;
-C 39 ; WX 600 ; N quoteright ; B 283 328 495 562 ;
-C 40 ; WX 600 ; N parenleft ; B 313 -108 572 622 ;
-C 41 ; WX 600 ; N parenright ; B 137 -108 396 622 ;
-C 42 ; WX 600 ; N asterisk ; B 212 257 580 607 ;
-C 43 ; WX 600 ; N plus ; B 129 44 580 470 ;
-C 44 ; WX 600 ; N comma ; B 157 -112 370 122 ;
-C 45 ; WX 600 ; N hyphen ; B 152 231 558 285 ;
-C 46 ; WX 600 ; N period ; B 238 -15 382 109 ;
-C 47 ; WX 600 ; N slash ; B 112 -80 604 629 ;
-C 48 ; WX 600 ; N zero ; B 154 -15 575 622 ;
-C 49 ; WX 600 ; N one ; B 98 0 515 622 ;
-C 50 ; WX 600 ; N two ; B 70 0 568 622 ;
-C 51 ; WX 600 ; N three ; B 82 -15 538 622 ;
-C 52 ; WX 600 ; N four ; B 108 0 541 622 ;
-C 53 ; WX 600 ; N five ; B 99 -15 589 607 ;
-C 54 ; WX 600 ; N six ; B 155 -15 629 622 ;
-C 55 ; WX 600 ; N seven ; B 182 0 612 607 ;
-C 56 ; WX 600 ; N eight ; B 132 -15 588 622 ;
-C 57 ; WX 600 ; N nine ; B 93 -15 574 622 ;
-C 58 ; WX 600 ; N colon ; B 238 -15 441 385 ;
-C 59 ; WX 600 ; N semicolon ; B 157 -112 441 385 ;
-C 60 ; WX 600 ; N less ; B 96 42 610 472 ;
-C 61 ; WX 600 ; N equal ; B 109 138 600 376 ;
-C 62 ; WX 600 ; N greater ; B 85 42 599 472 ;
-C 63 ; WX 600 ; N question ; B 222 -15 583 572 ;
-C 64 ; WX 600 ; N at ; B 127 -15 582 622 ;
-C 65 ; WX 600 ; N A ; B 3 0 607 562 ;
-C 66 ; WX 600 ; N B ; B 43 0 616 562 ;
-C 67 ; WX 600 ; N C ; B 93 -18 655 580 ;
-C 68 ; WX 600 ; N D ; B 43 0 645 562 ;
-C 69 ; WX 600 ; N E ; B 53 0 660 562 ;
-C 70 ; WX 600 ; N F ; B 53 0 660 562 ;
-C 71 ; WX 600 ; N G ; B 83 -18 645 580 ;
-C 72 ; WX 600 ; N H ; B 32 0 687 562 ;
-C 73 ; WX 600 ; N I ; B 96 0 623 562 ;
-C 74 ; WX 600 ; N J ; B 52 -18 685 562 ;
-C 75 ; WX 600 ; N K ; B 38 0 671 562 ;
-C 76 ; WX 600 ; N L ; B 47 0 607 562 ;
-C 77 ; WX 600 ; N M ; B 4 0 715 562 ;
-C 78 ; WX 600 ; N N ; B 7 -13 712 562 ;
-C 79 ; WX 600 ; N O ; B 94 -18 625 580 ;
-C 80 ; WX 600 ; N P ; B 79 0 644 562 ;
-C 81 ; WX 600 ; N Q ; B 95 -138 625 580 ;
-C 82 ; WX 600 ; N R ; B 38 0 598 562 ;
-C 83 ; WX 600 ; N S ; B 76 -20 650 580 ;
-C 84 ; WX 600 ; N T ; B 108 0 665 562 ;
-C 85 ; WX 600 ; N U ; B 125 -18 702 562 ;
-C 86 ; WX 600 ; N V ; B 105 -13 723 562 ;
-C 87 ; WX 600 ; N W ; B 106 -13 722 562 ;
-C 88 ; WX 600 ; N X ; B 23 0 675 562 ;
-C 89 ; WX 600 ; N Y ; B 133 0 695 562 ;
-C 90 ; WX 600 ; N Z ; B 86 0 610 562 ;
-C 91 ; WX 600 ; N bracketleft ; B 246 -108 574 622 ;
-C 92 ; WX 600 ; N backslash ; B 249 -80 468 629 ;
-C 93 ; WX 600 ; N bracketright ; B 135 -108 463 622 ;
-C 94 ; WX 600 ; N asciicircum ; B 175 354 587 622 ;
-C 95 ; WX 600 ; N underscore ; B -27 -125 584 -75 ;
-C 96 ; WX 600 ; N quoteleft ; B 343 328 457 562 ;
-C 97 ; WX 600 ; N a ; B 76 -15 569 441 ;
-C 98 ; WX 600 ; N b ; B 29 -15 625 629 ;
-C 99 ; WX 600 ; N c ; B 106 -15 608 441 ;
-C 100 ; WX 600 ; N d ; B 85 -15 640 629 ;
-C 101 ; WX 600 ; N e ; B 106 -15 598 441 ;
-C 102 ; WX 600 ; N f ; B 114 0 662 629 ; L i fi ; L l fl ;
-C 103 ; WX 600 ; N g ; B 61 -157 657 441 ;
-C 104 ; WX 600 ; N h ; B 33 0 592 629 ;
-C 105 ; WX 600 ; N i ; B 95 0 515 657 ;
-C 106 ; WX 600 ; N j ; B 52 -157 550 657 ;
-C 107 ; WX 600 ; N k ; B 58 0 633 629 ;
-C 108 ; WX 600 ; N l ; B 95 0 515 629 ;
-C 109 ; WX 600 ; N m ; B -5 0 615 441 ;
-C 110 ; WX 600 ; N n ; B 26 0 585 441 ;
-C 111 ; WX 600 ; N o ; B 102 -15 588 441 ;
-C 112 ; WX 600 ; N p ; B -24 -157 605 441 ;
-C 113 ; WX 600 ; N q ; B 85 -157 682 441 ;
-C 114 ; WX 600 ; N r ; B 60 0 636 441 ;
-C 115 ; WX 600 ; N s ; B 78 -15 584 441 ;
-C 116 ; WX 600 ; N t ; B 167 -15 561 561 ;
-C 117 ; WX 600 ; N u ; B 101 -15 572 426 ;
-C 118 ; WX 600 ; N v ; B 90 -10 681 426 ;
-C 119 ; WX 600 ; N w ; B 76 -10 695 426 ;
-C 120 ; WX 600 ; N x ; B 20 0 655 426 ;
-C 121 ; WX 600 ; N y ; B -4 -157 683 426 ;
-C 122 ; WX 600 ; N z ; B 99 0 593 426 ;
-C 123 ; WX 600 ; N braceleft ; B 233 -108 569 622 ;
-C 124 ; WX 600 ; N bar ; B 222 -250 485 750 ;
-C 125 ; WX 600 ; N braceright ; B 140 -108 477 622 ;
-C 126 ; WX 600 ; N asciitilde ; B 116 197 600 320 ;
-C 161 ; WX 600 ; N exclamdown ; B 225 -157 445 430 ;
-C 162 ; WX 600 ; N cent ; B 151 -49 588 614 ;
-C 163 ; WX 600 ; N sterling ; B 124 -21 621 611 ;
-C 164 ; WX 600 ; N fraction ; B 84 -57 646 665 ;
-C 165 ; WX 600 ; N yen ; B 120 0 693 562 ;
-C 166 ; WX 600 ; N florin ; B -26 -143 671 622 ;
-C 167 ; WX 600 ; N section ; B 104 -78 590 580 ;
-C 168 ; WX 600 ; N currency ; B 94 58 628 506 ;
-C 169 ; WX 600 ; N quotesingle ; B 345 328 460 562 ;
-C 170 ; WX 600 ; N quotedblleft ; B 262 328 541 562 ;
-C 171 ; WX 600 ; N guillemotleft ; B 92 70 652 446 ;
-C 172 ; WX 600 ; N guilsinglleft ; B 204 70 540 446 ;
-C 173 ; WX 600 ; N guilsinglright ; B 170 70 506 446 ;
-C 174 ; WX 600 ; N fi ; B 3 0 619 629 ;
-C 175 ; WX 600 ; N fl ; B 3 0 619 629 ;
-C 177 ; WX 600 ; N endash ; B 124 231 586 285 ;
-C 178 ; WX 600 ; N dagger ; B 217 -78 546 580 ;
-C 179 ; WX 600 ; N daggerdbl ; B 163 -78 546 580 ;
-C 180 ; WX 600 ; N periodcentered ; B 275 189 434 327 ;
-C 182 ; WX 600 ; N paragraph ; B 100 -78 630 562 ;
-C 183 ; WX 600 ; N bullet ; B 224 130 485 383 ;
-C 184 ; WX 600 ; N quotesinglbase ; B 185 -134 397 100 ;
-C 185 ; WX 600 ; N quotedblbase ; B 115 -134 478 100 ;
-C 186 ; WX 600 ; N quotedblright ; B 213 328 576 562 ;
-C 187 ; WX 600 ; N guillemotright ; B 58 70 618 446 ;
-C 188 ; WX 600 ; N ellipsis ; B 46 -15 575 111 ;
-C 189 ; WX 600 ; N perthousand ; B 59 -15 627 622 ;
-C 191 ; WX 600 ; N questiondown ; B 105 -157 466 430 ;
-C 193 ; WX 600 ; N grave ; B 294 497 484 672 ;
-C 194 ; WX 600 ; N acute ; B 348 497 612 672 ;
-C 195 ; WX 600 ; N circumflex ; B 229 477 581 654 ;
-C 196 ; WX 600 ; N tilde ; B 212 489 629 606 ;
-C 197 ; WX 600 ; N macron ; B 232 525 600 565 ;
-C 198 ; WX 600 ; N breve ; B 279 501 576 609 ;
-C 199 ; WX 600 ; N dotaccent ; B 360 477 466 580 ;
-C 200 ; WX 600 ; N dieresis ; B 262 492 570 595 ;
-C 202 ; WX 600 ; N ring ; B 332 463 500 627 ;
-C 203 ; WX 600 ; N cedilla ; B 197 -151 344 10 ;
-C 205 ; WX 600 ; N hungarumlaut ; B 239 497 683 672 ;
-C 206 ; WX 600 ; N ogonek ; B 207 -151 348 0 ;
-C 207 ; WX 600 ; N caron ; B 262 492 614 669 ;
-C 208 ; WX 600 ; N emdash ; B 49 231 661 285 ;
-C 225 ; WX 600 ; N AE ; B 3 0 655 562 ;
-C 227 ; WX 600 ; N ordfeminine ; B 209 249 512 580 ;
-C 232 ; WX 600 ; N Lslash ; B 47 0 607 562 ;
-C 233 ; WX 600 ; N Oslash ; B 94 -80 625 629 ;
-C 234 ; WX 600 ; N OE ; B 59 0 672 562 ;
-C 235 ; WX 600 ; N ordmasculine ; B 210 249 535 580 ;
-C 241 ; WX 600 ; N ae ; B 41 -15 626 441 ;
-C 245 ; WX 600 ; N dotlessi ; B 95 0 515 426 ;
-C 248 ; WX 600 ; N lslash ; B 95 0 583 629 ;
-C 249 ; WX 600 ; N oslash ; B 102 -80 588 506 ;
-C 250 ; WX 600 ; N oe ; B 54 -15 615 441 ;
-C 251 ; WX 600 ; N germandbls ; B 48 -15 617 629 ;
-C -1 ; WX 600 ; N Odieresis ; B 94 -18 625 731 ;
-C -1 ; WX 600 ; N logicalnot ; B 155 108 591 369 ;
-C -1 ; WX 600 ; N minus ; B 129 232 580 283 ;
-C -1 ; WX 600 ; N merge ; B 187 -15 503 436 ;
-C -1 ; WX 600 ; N degree ; B 214 269 576 622 ;
-C -1 ; WX 600 ; N dectab ; B 18 0 593 227 ;
-C -1 ; WX 600 ; N ll ; B 33 0 616 629 ;
-C -1 ; WX 600 ; N IJ ; B 32 -18 702 562 ;
-C -1 ; WX 600 ; N Eacute ; B 53 0 668 793 ;
-C -1 ; WX 600 ; N Ocircumflex ; B 94 -18 625 775 ;
-C -1 ; WX 600 ; N ucircumflex ; B 101 -15 572 654 ;
-C -1 ; WX 600 ; N left ; B 114 68 580 348 ;
-C -1 ; WX 600 ; N threesuperior ; B 213 240 501 622 ;
-C -1 ; WX 600 ; N up ; B 223 0 503 437 ;
-C -1 ; WX 600 ; N multiply ; B 103 43 607 470 ;
-C -1 ; WX 600 ; N Scaron ; B 76 -20 673 805 ;
-C -1 ; WX 600 ; N tab ; B 19 0 641 562 ;
-C -1 ; WX 600 ; N Ucircumflex ; B 125 -18 702 775 ;
-C -1 ; WX 600 ; N divide ; B 136 48 573 467 ;
-C -1 ; WX 600 ; N Acircumflex ; B 3 0 607 775 ;
-C -1 ; WX 600 ; N eacute ; B 106 -15 612 672 ;
-C -1 ; WX 600 ; N uacute ; B 101 -15 602 672 ;
-C -1 ; WX 600 ; N Aacute ; B 3 0 658 793 ;
-C -1 ; WX 600 ; N copyright ; B 53 -18 667 580 ;
-C -1 ; WX 600 ; N twosuperior ; B 230 249 535 622 ;
-C -1 ; WX 600 ; N Ecircumflex ; B 53 0 660 775 ;
-C -1 ; WX 600 ; N ntilde ; B 26 0 629 606 ;
-C -1 ; WX 600 ; N down ; B 187 -15 467 426 ;
-C -1 ; WX 600 ; N center ; B 103 14 623 580 ;
-C -1 ; WX 600 ; N onesuperior ; B 231 249 491 622 ;
-C -1 ; WX 600 ; N ij ; B 37 -157 630 657 ;
-C -1 ; WX 600 ; N edieresis ; B 106 -15 598 595 ;
-C -1 ; WX 600 ; N graybox ; B 76 0 652 599 ;
-C -1 ; WX 600 ; N odieresis ; B 102 -15 588 595 ;
-C -1 ; WX 600 ; N Ograve ; B 94 -18 625 793 ;
-C -1 ; WX 600 ; N threequarters ; B 73 -56 659 666 ;
-C -1 ; WX 600 ; N plusminus ; B 96 44 594 558 ;
-C -1 ; WX 600 ; N prescription ; B 27 -15 617 562 ;
-C -1 ; WX 600 ; N eth ; B 102 -15 639 629 ;
-C -1 ; WX 600 ; N largebullet ; B 315 220 395 297 ;
-C -1 ; WX 600 ; N egrave ; B 106 -15 598 672 ;
-C -1 ; WX 600 ; N ccedilla ; B 106 -151 614 441 ;
-C -1 ; WX 600 ; N notegraphic ; B 143 -15 564 572 ;
-C -1 ; WX 600 ; N Udieresis ; B 125 -18 702 731 ;
-C -1 ; WX 600 ; N Gcaron ; B 83 -18 645 805 ;
-C -1 ; WX 600 ; N arrowdown ; B 152 -15 520 608 ;
-C -1 ; WX 600 ; N format ; B -28 -157 185 607 ;
-C -1 ; WX 600 ; N Otilde ; B 94 -18 656 732 ;
-C -1 ; WX 600 ; N Idieresis ; B 96 0 623 731 ;
-C -1 ; WX 600 ; N adieresis ; B 76 -15 570 595 ;
-C -1 ; WX 600 ; N ecircumflex ; B 106 -15 598 654 ;
-C -1 ; WX 600 ; N Eth ; B 43 0 645 562 ;
-C -1 ; WX 600 ; N onequarter ; B 65 -57 674 665 ;
-C -1 ; WX 600 ; N LL ; B 8 0 647 562 ;
-C -1 ; WX 600 ; N agrave ; B 76 -15 569 672 ;
-C -1 ; WX 600 ; N Zcaron ; B 86 0 643 805 ;
-C -1 ; WX 600 ; N Scedilla ; B 76 -151 650 580 ;
-C -1 ; WX 600 ; N Idot ; B 96 0 623 716 ;
-C -1 ; WX 600 ; N Iacute ; B 96 0 638 793 ;
-C -1 ; WX 600 ; N indent ; B 108 68 574 348 ;
-C -1 ; WX 600 ; N Ugrave ; B 125 -18 702 793 ;
-C -1 ; WX 600 ; N scaron ; B 78 -15 614 669 ;
-C -1 ; WX 600 ; N overscore ; B 123 579 734 629 ;
-C -1 ; WX 600 ; N Aring ; B 3 0 607 753 ;
-C -1 ; WX 600 ; N Ccedilla ; B 93 -151 658 580 ;
-C -1 ; WX 600 ; N Igrave ; B 96 0 623 793 ;
-C -1 ; WX 600 ; N brokenbar ; B 238 -175 469 675 ;
-C -1 ; WX 600 ; N Oacute ; B 94 -18 638 793 ;
-C -1 ; WX 600 ; N otilde ; B 102 -15 629 606 ;
-C -1 ; WX 600 ; N Yacute ; B 133 0 695 793 ;
-C -1 ; WX 600 ; N lira ; B 118 -21 621 611 ;
-C -1 ; WX 600 ; N Icircumflex ; B 96 0 623 775 ;
-C -1 ; WX 600 ; N Atilde ; B 3 0 656 732 ;
-C -1 ; WX 600 ; N Uacute ; B 125 -18 702 793 ;
-C -1 ; WX 600 ; N Ydieresis ; B 133 0 695 731 ;
-C -1 ; WX 600 ; N ydieresis ; B -4 -157 683 595 ;
-C -1 ; WX 600 ; N idieresis ; B 95 0 540 595 ;
-C -1 ; WX 600 ; N Adieresis ; B 3 0 607 731 ;
-C -1 ; WX 600 ; N mu ; B 72 -157 572 426 ;
-C -1 ; WX 600 ; N trademark ; B 75 263 742 562 ;
-C -1 ; WX 600 ; N oacute ; B 102 -15 612 672 ;
-C -1 ; WX 600 ; N acircumflex ; B 76 -15 581 654 ;
-C -1 ; WX 600 ; N Agrave ; B 3 0 607 793 ;
-C -1 ; WX 600 ; N return ; B 79 0 700 562 ;
-C -1 ; WX 600 ; N atilde ; B 76 -15 629 606 ;
-C -1 ; WX 600 ; N square ; B 19 0 700 562 ;
-C -1 ; WX 600 ; N registered ; B 53 -18 667 580 ;
-C -1 ; WX 600 ; N stop ; B 19 0 700 562 ;
-C -1 ; WX 600 ; N udieresis ; B 101 -15 572 595 ;
-C -1 ; WX 600 ; N arrowup ; B 209 0 577 623 ;
-C -1 ; WX 600 ; N igrave ; B 95 0 515 672 ;
-C -1 ; WX 600 ; N Edieresis ; B 53 0 660 731 ;
-C -1 ; WX 600 ; N zcaron ; B 99 0 624 669 ;
-C -1 ; WX 600 ; N arrowboth ; B 36 115 692 483 ;
-C -1 ; WX 600 ; N gcaron ; B 61 -157 657 669 ;
-C -1 ; WX 600 ; N arrowleft ; B 40 115 693 483 ;
-C -1 ; WX 600 ; N aacute ; B 76 -15 612 672 ;
-C -1 ; WX 600 ; N ocircumflex ; B 102 -15 588 654 ;
-C -1 ; WX 600 ; N scedilla ; B 78 -151 584 441 ;
-C -1 ; WX 600 ; N ograve ; B 102 -15 588 672 ;
-C -1 ; WX 600 ; N onehalf ; B 65 -57 669 665 ;
-C -1 ; WX 600 ; N ugrave ; B 101 -15 572 672 ;
-C -1 ; WX 600 ; N Ntilde ; B 7 -13 712 732 ;
-C -1 ; WX 600 ; N iacute ; B 95 0 612 672 ;
-C -1 ; WX 600 ; N arrowright ; B 34 115 688 483 ;
-C -1 ; WX 600 ; N Thorn ; B 79 0 606 562 ;
-C -1 ; WX 600 ; N Egrave ; B 53 0 660 793 ;
-C -1 ; WX 600 ; N thorn ; B -24 -157 605 629 ;
-C -1 ; WX 600 ; N aring ; B 76 -15 569 627 ;
-C -1 ; WX 600 ; N yacute ; B -4 -157 683 672 ;
-C -1 ; WX 600 ; N icircumflex ; B 95 0 551 654 ;
-EndCharMetrics
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 46 121 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex -4 121 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis -1 136 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave -4 121 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 12 126 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 27 126 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 56 121 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 26 121 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 29 136 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 26 121 ;
-CC Gcaron 2 ; PCC G 0 0 ; PCC caron 29 136 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 26 121 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 26 121 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 29 136 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 26 121 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 27 126 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 26 121 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 26 121 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 29 136 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 26 121 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 27 126 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 59 136 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 56 121 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 26 121 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 29 136 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave -4 121 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 56 121 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 29 136 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 29 136 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 0 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 0 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 0 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 0 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 0 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 0 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 0 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 0 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 0 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 0 0 ;
-CC gcaron 2 ; PCC g 0 0 ; PCC caron -30 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -30 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -30 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -30 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 0 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 0 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 0 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 0 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 0 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 0 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 0 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute -10 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex -10 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 0 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave -30 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute -20 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis -10 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 10 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Courier.afm b/blt3.0.1/library/afm/Courier.afm
deleted file mode 100644
index e65ecdf..0000000
--- a/blt3.0.1/library/afm/Courier.afm
+++ /dev/null
@@ -1,345 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1989, 1990, 1991 Adobe Systems Incorporated. All rights reserved.
-Comment Creation Date: Tue Sep 17 07:47:21 1991
-Comment UniqueID 36347
-Comment VMusage 31037 39405
-FontName Courier
-FullName Courier
-FamilyName Courier
-Weight Medium
-ItalicAngle 0
-IsFixedPitch true
-FontBBox -28 -250 628 805
-UnderlinePosition -100
-UnderlineThickness 50
-Version 002.004
-Notice Copyright (c) 1989, 1990, 1991 Adobe Systems Incorporated. All rights reserved.
-EncodingScheme AdobeStandardEncoding
-CapHeight 562
-XHeight 426
-Ascender 629
-Descender -157
-StartCharMetrics 260
-C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 600 ; N exclam ; B 236 -15 364 572 ;
-C 34 ; WX 600 ; N quotedbl ; B 187 328 413 562 ;
-C 35 ; WX 600 ; N numbersign ; B 93 -32 507 639 ;
-C 36 ; WX 600 ; N dollar ; B 105 -126 496 662 ;
-C 37 ; WX 600 ; N percent ; B 81 -15 518 622 ;
-C 38 ; WX 600 ; N ampersand ; B 63 -15 538 543 ;
-C 39 ; WX 600 ; N quoteright ; B 213 328 376 562 ;
-C 40 ; WX 600 ; N parenleft ; B 269 -108 440 622 ;
-C 41 ; WX 600 ; N parenright ; B 160 -108 331 622 ;
-C 42 ; WX 600 ; N asterisk ; B 116 257 484 607 ;
-C 43 ; WX 600 ; N plus ; B 80 44 520 470 ;
-C 44 ; WX 600 ; N comma ; B 181 -112 344 122 ;
-C 45 ; WX 600 ; N hyphen ; B 103 231 497 285 ;
-C 46 ; WX 600 ; N period ; B 229 -15 371 109 ;
-C 47 ; WX 600 ; N slash ; B 125 -80 475 629 ;
-C 48 ; WX 600 ; N zero ; B 106 -15 494 622 ;
-C 49 ; WX 600 ; N one ; B 96 0 505 622 ;
-C 50 ; WX 600 ; N two ; B 70 0 471 622 ;
-C 51 ; WX 600 ; N three ; B 75 -15 466 622 ;
-C 52 ; WX 600 ; N four ; B 78 0 500 622 ;
-C 53 ; WX 600 ; N five ; B 92 -15 497 607 ;
-C 54 ; WX 600 ; N six ; B 111 -15 497 622 ;
-C 55 ; WX 600 ; N seven ; B 82 0 483 607 ;
-C 56 ; WX 600 ; N eight ; B 102 -15 498 622 ;
-C 57 ; WX 600 ; N nine ; B 96 -15 489 622 ;
-C 58 ; WX 600 ; N colon ; B 229 -15 371 385 ;
-C 59 ; WX 600 ; N semicolon ; B 181 -112 371 385 ;
-C 60 ; WX 600 ; N less ; B 41 42 519 472 ;
-C 61 ; WX 600 ; N equal ; B 80 138 520 376 ;
-C 62 ; WX 600 ; N greater ; B 66 42 544 472 ;
-C 63 ; WX 600 ; N question ; B 129 -15 492 572 ;
-C 64 ; WX 600 ; N at ; B 77 -15 533 622 ;
-C 65 ; WX 600 ; N A ; B 3 0 597 562 ;
-C 66 ; WX 600 ; N B ; B 43 0 559 562 ;
-C 67 ; WX 600 ; N C ; B 41 -18 540 580 ;
-C 68 ; WX 600 ; N D ; B 43 0 574 562 ;
-C 69 ; WX 600 ; N E ; B 53 0 550 562 ;
-C 70 ; WX 600 ; N F ; B 53 0 545 562 ;
-C 71 ; WX 600 ; N G ; B 31 -18 575 580 ;
-C 72 ; WX 600 ; N H ; B 32 0 568 562 ;
-C 73 ; WX 600 ; N I ; B 96 0 504 562 ;
-C 74 ; WX 600 ; N J ; B 34 -18 566 562 ;
-C 75 ; WX 600 ; N K ; B 38 0 582 562 ;
-C 76 ; WX 600 ; N L ; B 47 0 554 562 ;
-C 77 ; WX 600 ; N M ; B 4 0 596 562 ;
-C 78 ; WX 600 ; N N ; B 7 -13 593 562 ;
-C 79 ; WX 600 ; N O ; B 43 -18 557 580 ;
-C 80 ; WX 600 ; N P ; B 79 0 558 562 ;
-C 81 ; WX 600 ; N Q ; B 43 -138 557 580 ;
-C 82 ; WX 600 ; N R ; B 38 0 588 562 ;
-C 83 ; WX 600 ; N S ; B 72 -20 529 580 ;
-C 84 ; WX 600 ; N T ; B 38 0 563 562 ;
-C 85 ; WX 600 ; N U ; B 17 -18 583 562 ;
-C 86 ; WX 600 ; N V ; B -4 -13 604 562 ;
-C 87 ; WX 600 ; N W ; B -3 -13 603 562 ;
-C 88 ; WX 600 ; N X ; B 23 0 577 562 ;
-C 89 ; WX 600 ; N Y ; B 24 0 576 562 ;
-C 90 ; WX 600 ; N Z ; B 86 0 514 562 ;
-C 91 ; WX 600 ; N bracketleft ; B 269 -108 442 622 ;
-C 92 ; WX 600 ; N backslash ; B 118 -80 482 629 ;
-C 93 ; WX 600 ; N bracketright ; B 158 -108 331 622 ;
-C 94 ; WX 600 ; N asciicircum ; B 94 354 506 622 ;
-C 95 ; WX 600 ; N underscore ; B 0 -125 600 -75 ;
-C 96 ; WX 600 ; N quoteleft ; B 224 328 387 562 ;
-C 97 ; WX 600 ; N a ; B 53 -15 559 441 ;
-C 98 ; WX 600 ; N b ; B 14 -15 575 629 ;
-C 99 ; WX 600 ; N c ; B 66 -15 529 441 ;
-C 100 ; WX 600 ; N d ; B 45 -15 591 629 ;
-C 101 ; WX 600 ; N e ; B 66 -15 548 441 ;
-C 102 ; WX 600 ; N f ; B 114 0 531 629 ; L i fi ; L l fl ;
-C 103 ; WX 600 ; N g ; B 45 -157 566 441 ;
-C 104 ; WX 600 ; N h ; B 18 0 582 629 ;
-C 105 ; WX 600 ; N i ; B 95 0 505 657 ;
-C 106 ; WX 600 ; N j ; B 82 -157 410 657 ;
-C 107 ; WX 600 ; N k ; B 43 0 580 629 ;
-C 108 ; WX 600 ; N l ; B 95 0 505 629 ;
-C 109 ; WX 600 ; N m ; B -5 0 605 441 ;
-C 110 ; WX 600 ; N n ; B 26 0 575 441 ;
-C 111 ; WX 600 ; N o ; B 62 -15 538 441 ;
-C 112 ; WX 600 ; N p ; B 9 -157 555 441 ;
-C 113 ; WX 600 ; N q ; B 45 -157 591 441 ;
-C 114 ; WX 600 ; N r ; B 60 0 559 441 ;
-C 115 ; WX 600 ; N s ; B 80 -15 513 441 ;
-C 116 ; WX 600 ; N t ; B 87 -15 530 561 ;
-C 117 ; WX 600 ; N u ; B 21 -15 562 426 ;
-C 118 ; WX 600 ; N v ; B 10 -10 590 426 ;
-C 119 ; WX 600 ; N w ; B -4 -10 604 426 ;
-C 120 ; WX 600 ; N x ; B 20 0 580 426 ;
-C 121 ; WX 600 ; N y ; B 7 -157 592 426 ;
-C 122 ; WX 600 ; N z ; B 99 0 502 426 ;
-C 123 ; WX 600 ; N braceleft ; B 182 -108 437 622 ;
-C 124 ; WX 600 ; N bar ; B 275 -250 326 750 ;
-C 125 ; WX 600 ; N braceright ; B 163 -108 418 622 ;
-C 126 ; WX 600 ; N asciitilde ; B 63 197 540 320 ;
-C 161 ; WX 600 ; N exclamdown ; B 236 -157 364 430 ;
-C 162 ; WX 600 ; N cent ; B 96 -49 500 614 ;
-C 163 ; WX 600 ; N sterling ; B 84 -21 521 611 ;
-C 164 ; WX 600 ; N fraction ; B 92 -57 509 665 ;
-C 165 ; WX 600 ; N yen ; B 26 0 574 562 ;
-C 166 ; WX 600 ; N florin ; B 4 -143 539 622 ;
-C 167 ; WX 600 ; N section ; B 113 -78 488 580 ;
-C 168 ; WX 600 ; N currency ; B 73 58 527 506 ;
-C 169 ; WX 600 ; N quotesingle ; B 259 328 341 562 ;
-C 170 ; WX 600 ; N quotedblleft ; B 143 328 471 562 ;
-C 171 ; WX 600 ; N guillemotleft ; B 37 70 563 446 ;
-C 172 ; WX 600 ; N guilsinglleft ; B 149 70 451 446 ;
-C 173 ; WX 600 ; N guilsinglright ; B 149 70 451 446 ;
-C 174 ; WX 600 ; N fi ; B 3 0 597 629 ;
-C 175 ; WX 600 ; N fl ; B 3 0 597 629 ;
-C 177 ; WX 600 ; N endash ; B 75 231 525 285 ;
-C 178 ; WX 600 ; N dagger ; B 141 -78 459 580 ;
-C 179 ; WX 600 ; N daggerdbl ; B 141 -78 459 580 ;
-C 180 ; WX 600 ; N periodcentered ; B 222 189 378 327 ;
-C 182 ; WX 600 ; N paragraph ; B 50 -78 511 562 ;
-C 183 ; WX 600 ; N bullet ; B 172 130 428 383 ;
-C 184 ; WX 600 ; N quotesinglbase ; B 213 -134 376 100 ;
-C 185 ; WX 600 ; N quotedblbase ; B 143 -134 457 100 ;
-C 186 ; WX 600 ; N quotedblright ; B 143 328 457 562 ;
-C 187 ; WX 600 ; N guillemotright ; B 37 70 563 446 ;
-C 188 ; WX 600 ; N ellipsis ; B 37 -15 563 111 ;
-C 189 ; WX 600 ; N perthousand ; B 3 -15 600 622 ;
-C 191 ; WX 600 ; N questiondown ; B 108 -157 471 430 ;
-C 193 ; WX 600 ; N grave ; B 151 497 378 672 ;
-C 194 ; WX 600 ; N acute ; B 242 497 469 672 ;
-C 195 ; WX 600 ; N circumflex ; B 124 477 476 654 ;
-C 196 ; WX 600 ; N tilde ; B 105 489 503 606 ;
-C 197 ; WX 600 ; N macron ; B 120 525 480 565 ;
-C 198 ; WX 600 ; N breve ; B 153 501 447 609 ;
-C 199 ; WX 600 ; N dotaccent ; B 249 477 352 580 ;
-C 200 ; WX 600 ; N dieresis ; B 148 492 453 595 ;
-C 202 ; WX 600 ; N ring ; B 218 463 382 627 ;
-C 203 ; WX 600 ; N cedilla ; B 224 -151 362 10 ;
-C 205 ; WX 600 ; N hungarumlaut ; B 133 497 540 672 ;
-C 206 ; WX 600 ; N ogonek ; B 227 -151 370 0 ;
-C 207 ; WX 600 ; N caron ; B 124 492 476 669 ;
-C 208 ; WX 600 ; N emdash ; B 0 231 600 285 ;
-C 225 ; WX 600 ; N AE ; B 3 0 550 562 ;
-C 227 ; WX 600 ; N ordfeminine ; B 156 249 442 580 ;
-C 232 ; WX 600 ; N Lslash ; B 47 0 554 562 ;
-C 233 ; WX 600 ; N Oslash ; B 43 -80 557 629 ;
-C 234 ; WX 600 ; N OE ; B 7 0 567 562 ;
-C 235 ; WX 600 ; N ordmasculine ; B 157 249 443 580 ;
-C 241 ; WX 600 ; N ae ; B 19 -15 570 441 ;
-C 245 ; WX 600 ; N dotlessi ; B 95 0 505 426 ;
-C 248 ; WX 600 ; N lslash ; B 95 0 505 629 ;
-C 249 ; WX 600 ; N oslash ; B 62 -80 538 506 ;
-C 250 ; WX 600 ; N oe ; B 19 -15 559 441 ;
-C 251 ; WX 600 ; N germandbls ; B 48 -15 588 629 ;
-C -1 ; WX 600 ; N Odieresis ; B 43 -18 557 731 ;
-C -1 ; WX 600 ; N logicalnot ; B 87 108 513 369 ;
-C -1 ; WX 600 ; N minus ; B 80 232 520 283 ;
-C -1 ; WX 600 ; N merge ; B 160 -15 440 436 ;
-C -1 ; WX 600 ; N degree ; B 123 269 477 622 ;
-C -1 ; WX 600 ; N dectab ; B 18 0 582 227 ;
-C -1 ; WX 600 ; N ll ; B 18 0 567 629 ;
-C -1 ; WX 600 ; N IJ ; B 32 -18 583 562 ;
-C -1 ; WX 600 ; N Eacute ; B 53 0 550 793 ;
-C -1 ; WX 600 ; N Ocircumflex ; B 43 -18 557 775 ;
-C -1 ; WX 600 ; N ucircumflex ; B 21 -15 562 654 ;
-C -1 ; WX 600 ; N left ; B 70 68 530 348 ;
-C -1 ; WX 600 ; N threesuperior ; B 155 240 406 622 ;
-C -1 ; WX 600 ; N up ; B 160 0 440 437 ;
-C -1 ; WX 600 ; N multiply ; B 87 43 515 470 ;
-C -1 ; WX 600 ; N Scaron ; B 72 -20 529 805 ;
-C -1 ; WX 600 ; N tab ; B 19 0 581 562 ;
-C -1 ; WX 600 ; N Ucircumflex ; B 17 -18 583 775 ;
-C -1 ; WX 600 ; N divide ; B 87 48 513 467 ;
-C -1 ; WX 600 ; N Acircumflex ; B 3 0 597 775 ;
-C -1 ; WX 600 ; N eacute ; B 66 -15 548 672 ;
-C -1 ; WX 600 ; N uacute ; B 21 -15 562 672 ;
-C -1 ; WX 600 ; N Aacute ; B 3 0 597 793 ;
-C -1 ; WX 600 ; N copyright ; B 0 -18 600 580 ;
-C -1 ; WX 600 ; N twosuperior ; B 177 249 424 622 ;
-C -1 ; WX 600 ; N Ecircumflex ; B 53 0 550 775 ;
-C -1 ; WX 600 ; N ntilde ; B 26 0 575 606 ;
-C -1 ; WX 600 ; N down ; B 160 -15 440 426 ;
-C -1 ; WX 600 ; N center ; B 40 14 560 580 ;
-C -1 ; WX 600 ; N onesuperior ; B 172 249 428 622 ;
-C -1 ; WX 600 ; N ij ; B 37 -157 490 657 ;
-C -1 ; WX 600 ; N edieresis ; B 66 -15 548 595 ;
-C -1 ; WX 600 ; N graybox ; B 76 0 525 599 ;
-C -1 ; WX 600 ; N odieresis ; B 62 -15 538 595 ;
-C -1 ; WX 600 ; N Ograve ; B 43 -18 557 793 ;
-C -1 ; WX 600 ; N threequarters ; B 8 -56 593 666 ;
-C -1 ; WX 600 ; N plusminus ; B 87 44 513 558 ;
-C -1 ; WX 600 ; N prescription ; B 27 -15 577 562 ;
-C -1 ; WX 600 ; N eth ; B 62 -15 538 629 ;
-C -1 ; WX 600 ; N largebullet ; B 261 220 339 297 ;
-C -1 ; WX 600 ; N egrave ; B 66 -15 548 672 ;
-C -1 ; WX 600 ; N ccedilla ; B 66 -151 529 441 ;
-C -1 ; WX 600 ; N notegraphic ; B 136 -15 464 572 ;
-C -1 ; WX 600 ; N Udieresis ; B 17 -18 583 731 ;
-C -1 ; WX 600 ; N Gcaron ; B 31 -18 575 805 ;
-C -1 ; WX 600 ; N arrowdown ; B 116 -15 484 608 ;
-C -1 ; WX 600 ; N format ; B 5 -157 56 607 ;
-C -1 ; WX 600 ; N Otilde ; B 43 -18 557 732 ;
-C -1 ; WX 600 ; N Idieresis ; B 96 0 504 731 ;
-C -1 ; WX 600 ; N adieresis ; B 53 -15 559 595 ;
-C -1 ; WX 600 ; N ecircumflex ; B 66 -15 548 654 ;
-C -1 ; WX 600 ; N Eth ; B 30 0 574 562 ;
-C -1 ; WX 600 ; N onequarter ; B 0 -57 600 665 ;
-C -1 ; WX 600 ; N LL ; B 8 0 592 562 ;
-C -1 ; WX 600 ; N agrave ; B 53 -15 559 672 ;
-C -1 ; WX 600 ; N Zcaron ; B 86 0 514 805 ;
-C -1 ; WX 600 ; N Scedilla ; B 72 -151 529 580 ;
-C -1 ; WX 600 ; N Idot ; B 96 0 504 716 ;
-C -1 ; WX 600 ; N Iacute ; B 96 0 504 793 ;
-C -1 ; WX 600 ; N indent ; B 70 68 530 348 ;
-C -1 ; WX 600 ; N Ugrave ; B 17 -18 583 793 ;
-C -1 ; WX 600 ; N scaron ; B 80 -15 513 669 ;
-C -1 ; WX 600 ; N overscore ; B 0 579 600 629 ;
-C -1 ; WX 600 ; N Aring ; B 3 0 597 753 ;
-C -1 ; WX 600 ; N Ccedilla ; B 41 -151 540 580 ;
-C -1 ; WX 600 ; N Igrave ; B 96 0 504 793 ;
-C -1 ; WX 600 ; N brokenbar ; B 275 -175 326 675 ;
-C -1 ; WX 600 ; N Oacute ; B 43 -18 557 793 ;
-C -1 ; WX 600 ; N otilde ; B 62 -15 538 606 ;
-C -1 ; WX 600 ; N Yacute ; B 24 0 576 793 ;
-C -1 ; WX 600 ; N lira ; B 73 -21 521 611 ;
-C -1 ; WX 600 ; N Icircumflex ; B 96 0 504 775 ;
-C -1 ; WX 600 ; N Atilde ; B 3 0 597 732 ;
-C -1 ; WX 600 ; N Uacute ; B 17 -18 583 793 ;
-C -1 ; WX 600 ; N Ydieresis ; B 24 0 576 731 ;
-C -1 ; WX 600 ; N ydieresis ; B 7 -157 592 595 ;
-C -1 ; WX 600 ; N idieresis ; B 95 0 505 595 ;
-C -1 ; WX 600 ; N Adieresis ; B 3 0 597 731 ;
-C -1 ; WX 600 ; N mu ; B 21 -157 562 426 ;
-C -1 ; WX 600 ; N trademark ; B -23 263 623 562 ;
-C -1 ; WX 600 ; N oacute ; B 62 -15 538 672 ;
-C -1 ; WX 600 ; N acircumflex ; B 53 -15 559 654 ;
-C -1 ; WX 600 ; N Agrave ; B 3 0 597 793 ;
-C -1 ; WX 600 ; N return ; B 19 0 581 562 ;
-C -1 ; WX 600 ; N atilde ; B 53 -15 559 606 ;
-C -1 ; WX 600 ; N square ; B 19 0 581 562 ;
-C -1 ; WX 600 ; N registered ; B 0 -18 600 580 ;
-C -1 ; WX 600 ; N stop ; B 19 0 581 562 ;
-C -1 ; WX 600 ; N udieresis ; B 21 -15 562 595 ;
-C -1 ; WX 600 ; N arrowup ; B 116 0 484 623 ;
-C -1 ; WX 600 ; N igrave ; B 95 0 505 672 ;
-C -1 ; WX 600 ; N Edieresis ; B 53 0 550 731 ;
-C -1 ; WX 600 ; N zcaron ; B 99 0 502 669 ;
-C -1 ; WX 600 ; N arrowboth ; B -28 115 628 483 ;
-C -1 ; WX 600 ; N gcaron ; B 45 -157 566 669 ;
-C -1 ; WX 600 ; N arrowleft ; B -24 115 624 483 ;
-C -1 ; WX 600 ; N aacute ; B 53 -15 559 672 ;
-C -1 ; WX 600 ; N ocircumflex ; B 62 -15 538 654 ;
-C -1 ; WX 600 ; N scedilla ; B 80 -151 513 441 ;
-C -1 ; WX 600 ; N ograve ; B 62 -15 538 672 ;
-C -1 ; WX 600 ; N onehalf ; B 0 -57 611 665 ;
-C -1 ; WX 600 ; N ugrave ; B 21 -15 562 672 ;
-C -1 ; WX 600 ; N Ntilde ; B 7 -13 593 732 ;
-C -1 ; WX 600 ; N iacute ; B 95 0 505 672 ;
-C -1 ; WX 600 ; N arrowright ; B -24 115 624 483 ;
-C -1 ; WX 600 ; N Thorn ; B 79 0 538 562 ;
-C -1 ; WX 600 ; N Egrave ; B 53 0 550 793 ;
-C -1 ; WX 600 ; N thorn ; B -6 -157 555 629 ;
-C -1 ; WX 600 ; N aring ; B 53 -15 559 627 ;
-C -1 ; WX 600 ; N yacute ; B 7 -157 592 672 ;
-C -1 ; WX 600 ; N icircumflex ; B 94 0 505 654 ;
-EndCharMetrics
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 20 121 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex -30 121 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis -30 136 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave -30 121 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring -15 126 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 0 126 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 30 121 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 0 121 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 0 136 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 0 121 ;
-CC Gcaron 2 ; PCC G 0 0 ; PCC caron 0 136 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 0 121 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 0 121 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 0 136 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 0 121 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 0 126 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 0 121 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 0 121 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 0 136 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 0 121 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 0 126 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 30 136 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 30 121 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 0 121 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 0 136 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave -30 121 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 30 121 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 0 136 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 0 136 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 0 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 0 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 0 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 0 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 0 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 0 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 0 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 0 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 0 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 0 0 ;
-CC gcaron 2 ; PCC g 0 0 ; PCC caron -30 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -30 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -30 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -30 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 0 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 0 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 0 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 0 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 0 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 0 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 0 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute -10 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex -10 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 0 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave -30 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute -20 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis -10 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 10 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Helvetica-Bold.afm b/blt3.0.1/library/afm/Helvetica-Bold.afm
deleted file mode 100644
index f428198..0000000
--- a/blt3.0.1/library/afm/Helvetica-Bold.afm
+++ /dev/null
@@ -1,571 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Thu Mar 15 09:43:00 1990
-Comment UniqueID 28357
-Comment VMusage 26878 33770
-FontName Helvetica-Bold
-FullName Helvetica Bold
-FamilyName Helvetica
-Weight Bold
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -170 -228 1003 962
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 718
-XHeight 532
-Ascender 718
-Descender -207
-StartCharMetrics 228
-C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 90 0 244 718 ;
-C 34 ; WX 474 ; N quotedbl ; B 98 447 376 718 ;
-C 35 ; WX 556 ; N numbersign ; B 18 0 538 698 ;
-C 36 ; WX 556 ; N dollar ; B 30 -115 523 775 ;
-C 37 ; WX 889 ; N percent ; B 28 -19 861 710 ;
-C 38 ; WX 722 ; N ampersand ; B 54 -19 701 718 ;
-C 39 ; WX 278 ; N quoteright ; B 69 445 209 718 ;
-C 40 ; WX 333 ; N parenleft ; B 35 -208 314 734 ;
-C 41 ; WX 333 ; N parenright ; B 19 -208 298 734 ;
-C 42 ; WX 389 ; N asterisk ; B 27 387 362 718 ;
-C 43 ; WX 584 ; N plus ; B 40 0 544 506 ;
-C 44 ; WX 278 ; N comma ; B 64 -168 214 146 ;
-C 45 ; WX 333 ; N hyphen ; B 27 215 306 345 ;
-C 46 ; WX 278 ; N period ; B 64 0 214 146 ;
-C 47 ; WX 278 ; N slash ; B -33 -19 311 737 ;
-C 48 ; WX 556 ; N zero ; B 32 -19 524 710 ;
-C 49 ; WX 556 ; N one ; B 69 0 378 710 ;
-C 50 ; WX 556 ; N two ; B 26 0 511 710 ;
-C 51 ; WX 556 ; N three ; B 27 -19 516 710 ;
-C 52 ; WX 556 ; N four ; B 27 0 526 710 ;
-C 53 ; WX 556 ; N five ; B 27 -19 516 698 ;
-C 54 ; WX 556 ; N six ; B 31 -19 520 710 ;
-C 55 ; WX 556 ; N seven ; B 25 0 528 698 ;
-C 56 ; WX 556 ; N eight ; B 32 -19 524 710 ;
-C 57 ; WX 556 ; N nine ; B 30 -19 522 710 ;
-C 58 ; WX 333 ; N colon ; B 92 0 242 512 ;
-C 59 ; WX 333 ; N semicolon ; B 92 -168 242 512 ;
-C 60 ; WX 584 ; N less ; B 38 -8 546 514 ;
-C 61 ; WX 584 ; N equal ; B 40 87 544 419 ;
-C 62 ; WX 584 ; N greater ; B 38 -8 546 514 ;
-C 63 ; WX 611 ; N question ; B 60 0 556 727 ;
-C 64 ; WX 975 ; N at ; B 118 -19 856 737 ;
-C 65 ; WX 722 ; N A ; B 20 0 702 718 ;
-C 66 ; WX 722 ; N B ; B 76 0 669 718 ;
-C 67 ; WX 722 ; N C ; B 44 -19 684 737 ;
-C 68 ; WX 722 ; N D ; B 76 0 685 718 ;
-C 69 ; WX 667 ; N E ; B 76 0 621 718 ;
-C 70 ; WX 611 ; N F ; B 76 0 587 718 ;
-C 71 ; WX 778 ; N G ; B 44 -19 713 737 ;
-C 72 ; WX 722 ; N H ; B 71 0 651 718 ;
-C 73 ; WX 278 ; N I ; B 64 0 214 718 ;
-C 74 ; WX 556 ; N J ; B 22 -18 484 718 ;
-C 75 ; WX 722 ; N K ; B 87 0 722 718 ;
-C 76 ; WX 611 ; N L ; B 76 0 583 718 ;
-C 77 ; WX 833 ; N M ; B 69 0 765 718 ;
-C 78 ; WX 722 ; N N ; B 69 0 654 718 ;
-C 79 ; WX 778 ; N O ; B 44 -19 734 737 ;
-C 80 ; WX 667 ; N P ; B 76 0 627 718 ;
-C 81 ; WX 778 ; N Q ; B 44 -52 737 737 ;
-C 82 ; WX 722 ; N R ; B 76 0 677 718 ;
-C 83 ; WX 667 ; N S ; B 39 -19 629 737 ;
-C 84 ; WX 611 ; N T ; B 14 0 598 718 ;
-C 85 ; WX 722 ; N U ; B 72 -19 651 718 ;
-C 86 ; WX 667 ; N V ; B 19 0 648 718 ;
-C 87 ; WX 944 ; N W ; B 16 0 929 718 ;
-C 88 ; WX 667 ; N X ; B 14 0 653 718 ;
-C 89 ; WX 667 ; N Y ; B 15 0 653 718 ;
-C 90 ; WX 611 ; N Z ; B 25 0 586 718 ;
-C 91 ; WX 333 ; N bracketleft ; B 63 -196 309 722 ;
-C 92 ; WX 278 ; N backslash ; B -33 -19 311 737 ;
-C 93 ; WX 333 ; N bracketright ; B 24 -196 270 722 ;
-C 94 ; WX 584 ; N asciicircum ; B 62 323 522 698 ;
-C 95 ; WX 556 ; N underscore ; B 0 -125 556 -75 ;
-C 96 ; WX 278 ; N quoteleft ; B 69 454 209 727 ;
-C 97 ; WX 556 ; N a ; B 29 -14 527 546 ;
-C 98 ; WX 611 ; N b ; B 61 -14 578 718 ;
-C 99 ; WX 556 ; N c ; B 34 -14 524 546 ;
-C 100 ; WX 611 ; N d ; B 34 -14 551 718 ;
-C 101 ; WX 556 ; N e ; B 23 -14 528 546 ;
-C 102 ; WX 333 ; N f ; B 10 0 318 727 ; L i fi ; L l fl ;
-C 103 ; WX 611 ; N g ; B 40 -217 553 546 ;
-C 104 ; WX 611 ; N h ; B 65 0 546 718 ;
-C 105 ; WX 278 ; N i ; B 69 0 209 725 ;
-C 106 ; WX 278 ; N j ; B 3 -214 209 725 ;
-C 107 ; WX 556 ; N k ; B 69 0 562 718 ;
-C 108 ; WX 278 ; N l ; B 69 0 209 718 ;
-C 109 ; WX 889 ; N m ; B 64 0 826 546 ;
-C 110 ; WX 611 ; N n ; B 65 0 546 546 ;
-C 111 ; WX 611 ; N o ; B 34 -14 578 546 ;
-C 112 ; WX 611 ; N p ; B 62 -207 578 546 ;
-C 113 ; WX 611 ; N q ; B 34 -207 552 546 ;
-C 114 ; WX 389 ; N r ; B 64 0 373 546 ;
-C 115 ; WX 556 ; N s ; B 30 -14 519 546 ;
-C 116 ; WX 333 ; N t ; B 10 -6 309 676 ;
-C 117 ; WX 611 ; N u ; B 66 -14 545 532 ;
-C 118 ; WX 556 ; N v ; B 13 0 543 532 ;
-C 119 ; WX 778 ; N w ; B 10 0 769 532 ;
-C 120 ; WX 556 ; N x ; B 15 0 541 532 ;
-C 121 ; WX 556 ; N y ; B 10 -214 539 532 ;
-C 122 ; WX 500 ; N z ; B 20 0 480 532 ;
-C 123 ; WX 389 ; N braceleft ; B 48 -196 365 722 ;
-C 124 ; WX 280 ; N bar ; B 84 -19 196 737 ;
-C 125 ; WX 389 ; N braceright ; B 24 -196 341 722 ;
-C 126 ; WX 584 ; N asciitilde ; B 61 163 523 343 ;
-C 161 ; WX 333 ; N exclamdown ; B 90 -186 244 532 ;
-C 162 ; WX 556 ; N cent ; B 34 -118 524 628 ;
-C 163 ; WX 556 ; N sterling ; B 28 -16 541 718 ;
-C 164 ; WX 167 ; N fraction ; B -170 -19 336 710 ;
-C 165 ; WX 556 ; N yen ; B -9 0 565 698 ;
-C 166 ; WX 556 ; N florin ; B -10 -210 516 737 ;
-C 167 ; WX 556 ; N section ; B 34 -184 522 727 ;
-C 168 ; WX 556 ; N currency ; B -3 76 559 636 ;
-C 169 ; WX 238 ; N quotesingle ; B 70 447 168 718 ;
-C 170 ; WX 500 ; N quotedblleft ; B 64 454 436 727 ;
-C 171 ; WX 556 ; N guillemotleft ; B 88 76 468 484 ;
-C 172 ; WX 333 ; N guilsinglleft ; B 83 76 250 484 ;
-C 173 ; WX 333 ; N guilsinglright ; B 83 76 250 484 ;
-C 174 ; WX 611 ; N fi ; B 10 0 542 727 ;
-C 175 ; WX 611 ; N fl ; B 10 0 542 727 ;
-C 177 ; WX 556 ; N endash ; B 0 227 556 333 ;
-C 178 ; WX 556 ; N dagger ; B 36 -171 520 718 ;
-C 179 ; WX 556 ; N daggerdbl ; B 36 -171 520 718 ;
-C 180 ; WX 278 ; N periodcentered ; B 58 172 220 334 ;
-C 182 ; WX 556 ; N paragraph ; B -8 -191 539 700 ;
-C 183 ; WX 350 ; N bullet ; B 10 194 340 524 ;
-C 184 ; WX 278 ; N quotesinglbase ; B 69 -146 209 127 ;
-C 185 ; WX 500 ; N quotedblbase ; B 64 -146 436 127 ;
-C 186 ; WX 500 ; N quotedblright ; B 64 445 436 718 ;
-C 187 ; WX 556 ; N guillemotright ; B 88 76 468 484 ;
-C 188 ; WX 1000 ; N ellipsis ; B 92 0 908 146 ;
-C 189 ; WX 1000 ; N perthousand ; B -3 -19 1003 710 ;
-C 191 ; WX 611 ; N questiondown ; B 55 -195 551 532 ;
-C 193 ; WX 333 ; N grave ; B -23 604 225 750 ;
-C 194 ; WX 333 ; N acute ; B 108 604 356 750 ;
-C 195 ; WX 333 ; N circumflex ; B -10 604 343 750 ;
-C 196 ; WX 333 ; N tilde ; B -17 610 350 737 ;
-C 197 ; WX 333 ; N macron ; B -6 604 339 678 ;
-C 198 ; WX 333 ; N breve ; B -2 604 335 750 ;
-C 199 ; WX 333 ; N dotaccent ; B 104 614 230 729 ;
-C 200 ; WX 333 ; N dieresis ; B 6 614 327 729 ;
-C 202 ; WX 333 ; N ring ; B 59 568 275 776 ;
-C 203 ; WX 333 ; N cedilla ; B 6 -228 245 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B 9 604 486 750 ;
-C 206 ; WX 333 ; N ogonek ; B 71 -228 304 0 ;
-C 207 ; WX 333 ; N caron ; B -10 604 343 750 ;
-C 208 ; WX 1000 ; N emdash ; B 0 227 1000 333 ;
-C 225 ; WX 1000 ; N AE ; B 5 0 954 718 ;
-C 227 ; WX 370 ; N ordfeminine ; B 22 276 347 737 ;
-C 232 ; WX 611 ; N Lslash ; B -20 0 583 718 ;
-C 233 ; WX 778 ; N Oslash ; B 33 -27 744 745 ;
-C 234 ; WX 1000 ; N OE ; B 37 -19 961 737 ;
-C 235 ; WX 365 ; N ordmasculine ; B 6 276 360 737 ;
-C 241 ; WX 889 ; N ae ; B 29 -14 858 546 ;
-C 245 ; WX 278 ; N dotlessi ; B 69 0 209 532 ;
-C 248 ; WX 278 ; N lslash ; B -18 0 296 718 ;
-C 249 ; WX 611 ; N oslash ; B 22 -29 589 560 ;
-C 250 ; WX 944 ; N oe ; B 34 -14 912 546 ;
-C 251 ; WX 611 ; N germandbls ; B 69 -14 579 731 ;
-C -1 ; WX 611 ; N Zcaron ; B 25 0 586 936 ;
-C -1 ; WX 556 ; N ccedilla ; B 34 -228 524 546 ;
-C -1 ; WX 556 ; N ydieresis ; B 10 -214 539 729 ;
-C -1 ; WX 556 ; N atilde ; B 29 -14 527 737 ;
-C -1 ; WX 278 ; N icircumflex ; B -37 0 316 750 ;
-C -1 ; WX 333 ; N threesuperior ; B 8 271 326 710 ;
-C -1 ; WX 556 ; N ecircumflex ; B 23 -14 528 750 ;
-C -1 ; WX 611 ; N thorn ; B 62 -208 578 718 ;
-C -1 ; WX 556 ; N egrave ; B 23 -14 528 750 ;
-C -1 ; WX 333 ; N twosuperior ; B 9 283 324 710 ;
-C -1 ; WX 556 ; N eacute ; B 23 -14 528 750 ;
-C -1 ; WX 611 ; N otilde ; B 34 -14 578 737 ;
-C -1 ; WX 722 ; N Aacute ; B 20 0 702 936 ;
-C -1 ; WX 611 ; N ocircumflex ; B 34 -14 578 750 ;
-C -1 ; WX 556 ; N yacute ; B 10 -214 539 750 ;
-C -1 ; WX 611 ; N udieresis ; B 66 -14 545 729 ;
-C -1 ; WX 834 ; N threequarters ; B 16 -19 799 710 ;
-C -1 ; WX 556 ; N acircumflex ; B 29 -14 527 750 ;
-C -1 ; WX 722 ; N Eth ; B -5 0 685 718 ;
-C -1 ; WX 556 ; N edieresis ; B 23 -14 528 729 ;
-C -1 ; WX 611 ; N ugrave ; B 66 -14 545 750 ;
-C -1 ; WX 1000 ; N trademark ; B 44 306 956 718 ;
-C -1 ; WX 611 ; N ograve ; B 34 -14 578 750 ;
-C -1 ; WX 556 ; N scaron ; B 30 -14 519 750 ;
-C -1 ; WX 278 ; N Idieresis ; B -21 0 300 915 ;
-C -1 ; WX 611 ; N uacute ; B 66 -14 545 750 ;
-C -1 ; WX 556 ; N agrave ; B 29 -14 527 750 ;
-C -1 ; WX 611 ; N ntilde ; B 65 0 546 737 ;
-C -1 ; WX 556 ; N aring ; B 29 -14 527 776 ;
-C -1 ; WX 500 ; N zcaron ; B 20 0 480 750 ;
-C -1 ; WX 278 ; N Icircumflex ; B -37 0 316 936 ;
-C -1 ; WX 722 ; N Ntilde ; B 69 0 654 923 ;
-C -1 ; WX 611 ; N ucircumflex ; B 66 -14 545 750 ;
-C -1 ; WX 667 ; N Ecircumflex ; B 76 0 621 936 ;
-C -1 ; WX 278 ; N Iacute ; B 64 0 329 936 ;
-C -1 ; WX 722 ; N Ccedilla ; B 44 -228 684 737 ;
-C -1 ; WX 778 ; N Odieresis ; B 44 -19 734 915 ;
-C -1 ; WX 667 ; N Scaron ; B 39 -19 629 936 ;
-C -1 ; WX 667 ; N Edieresis ; B 76 0 621 915 ;
-C -1 ; WX 278 ; N Igrave ; B -50 0 214 936 ;
-C -1 ; WX 556 ; N adieresis ; B 29 -14 527 729 ;
-C -1 ; WX 778 ; N Ograve ; B 44 -19 734 936 ;
-C -1 ; WX 667 ; N Egrave ; B 76 0 621 936 ;
-C -1 ; WX 667 ; N Ydieresis ; B 15 0 653 915 ;
-C -1 ; WX 737 ; N registered ; B -11 -19 748 737 ;
-C -1 ; WX 778 ; N Otilde ; B 44 -19 734 923 ;
-C -1 ; WX 834 ; N onequarter ; B 26 -19 766 710 ;
-C -1 ; WX 722 ; N Ugrave ; B 72 -19 651 936 ;
-C -1 ; WX 722 ; N Ucircumflex ; B 72 -19 651 936 ;
-C -1 ; WX 667 ; N Thorn ; B 76 0 627 718 ;
-C -1 ; WX 584 ; N divide ; B 40 -42 544 548 ;
-C -1 ; WX 722 ; N Atilde ; B 20 0 702 923 ;
-C -1 ; WX 722 ; N Uacute ; B 72 -19 651 936 ;
-C -1 ; WX 778 ; N Ocircumflex ; B 44 -19 734 936 ;
-C -1 ; WX 584 ; N logicalnot ; B 40 108 544 419 ;
-C -1 ; WX 722 ; N Aring ; B 20 0 702 962 ;
-C -1 ; WX 278 ; N idieresis ; B -21 0 300 729 ;
-C -1 ; WX 278 ; N iacute ; B 69 0 329 750 ;
-C -1 ; WX 556 ; N aacute ; B 29 -14 527 750 ;
-C -1 ; WX 584 ; N plusminus ; B 40 0 544 506 ;
-C -1 ; WX 584 ; N multiply ; B 40 1 545 505 ;
-C -1 ; WX 722 ; N Udieresis ; B 72 -19 651 915 ;
-C -1 ; WX 584 ; N minus ; B 40 197 544 309 ;
-C -1 ; WX 333 ; N onesuperior ; B 26 283 237 710 ;
-C -1 ; WX 667 ; N Eacute ; B 76 0 621 936 ;
-C -1 ; WX 722 ; N Acircumflex ; B 20 0 702 936 ;
-C -1 ; WX 737 ; N copyright ; B -11 -19 749 737 ;
-C -1 ; WX 722 ; N Agrave ; B 20 0 702 936 ;
-C -1 ; WX 611 ; N odieresis ; B 34 -14 578 729 ;
-C -1 ; WX 611 ; N oacute ; B 34 -14 578 750 ;
-C -1 ; WX 400 ; N degree ; B 57 426 343 712 ;
-C -1 ; WX 278 ; N igrave ; B -50 0 209 750 ;
-C -1 ; WX 611 ; N mu ; B 66 -207 545 532 ;
-C -1 ; WX 778 ; N Oacute ; B 44 -19 734 936 ;
-C -1 ; WX 611 ; N eth ; B 34 -14 578 737 ;
-C -1 ; WX 722 ; N Adieresis ; B 20 0 702 915 ;
-C -1 ; WX 667 ; N Yacute ; B 15 0 653 936 ;
-C -1 ; WX 280 ; N brokenbar ; B 84 -19 196 737 ;
-C -1 ; WX 834 ; N onehalf ; B 26 -19 794 710 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 209
-
-KPX A y -30
-KPX A w -30
-KPX A v -40
-KPX A u -30
-KPX A Y -110
-KPX A W -60
-KPX A V -80
-KPX A U -50
-KPX A T -90
-KPX A Q -40
-KPX A O -40
-KPX A G -50
-KPX A C -40
-
-KPX B U -10
-KPX B A -30
-
-KPX D period -30
-KPX D comma -30
-KPX D Y -70
-KPX D W -40
-KPX D V -40
-KPX D A -40
-
-KPX F period -100
-KPX F comma -100
-KPX F a -20
-KPX F A -80
-
-KPX J u -20
-KPX J period -20
-KPX J comma -20
-KPX J A -20
-
-KPX K y -40
-KPX K u -30
-KPX K o -35
-KPX K e -15
-KPX K O -30
-
-KPX L y -30
-KPX L quoteright -140
-KPX L quotedblright -140
-KPX L Y -120
-KPX L W -80
-KPX L V -110
-KPX L T -90
-
-KPX O period -40
-KPX O comma -40
-KPX O Y -70
-KPX O X -50
-KPX O W -50
-KPX O V -50
-KPX O T -40
-KPX O A -50
-
-KPX P period -120
-KPX P o -40
-KPX P e -30
-KPX P comma -120
-KPX P a -30
-KPX P A -100
-
-KPX Q period 20
-KPX Q comma 20
-KPX Q U -10
-
-KPX R Y -50
-KPX R W -40
-KPX R V -50
-KPX R U -20
-KPX R T -20
-KPX R O -20
-
-KPX T y -60
-KPX T w -60
-KPX T u -90
-KPX T semicolon -40
-KPX T r -80
-KPX T period -80
-KPX T o -80
-KPX T hyphen -120
-KPX T e -60
-KPX T comma -80
-KPX T colon -40
-KPX T a -80
-KPX T O -40
-KPX T A -90
-
-KPX U period -30
-KPX U comma -30
-KPX U A -50
-
-KPX V u -60
-KPX V semicolon -40
-KPX V period -120
-KPX V o -90
-KPX V hyphen -80
-KPX V e -50
-KPX V comma -120
-KPX V colon -40
-KPX V a -60
-KPX V O -50
-KPX V G -50
-KPX V A -80
-
-KPX W y -20
-KPX W u -45
-KPX W semicolon -10
-KPX W period -80
-KPX W o -60
-KPX W hyphen -40
-KPX W e -35
-KPX W comma -80
-KPX W colon -10
-KPX W a -40
-KPX W O -20
-KPX W A -60
-
-KPX Y u -100
-KPX Y semicolon -50
-KPX Y period -100
-KPX Y o -100
-KPX Y e -80
-KPX Y comma -100
-KPX Y colon -50
-KPX Y a -90
-KPX Y O -70
-KPX Y A -110
-
-KPX a y -20
-KPX a w -15
-KPX a v -15
-KPX a g -10
-
-KPX b y -20
-KPX b v -20
-KPX b u -20
-KPX b l -10
-
-KPX c y -10
-KPX c l -20
-KPX c k -20
-KPX c h -10
-
-KPX colon space -40
-
-KPX comma space -40
-KPX comma quoteright -120
-KPX comma quotedblright -120
-
-KPX d y -15
-KPX d w -15
-KPX d v -15
-KPX d d -10
-
-KPX e y -15
-KPX e x -15
-KPX e w -15
-KPX e v -15
-KPX e period 20
-KPX e comma 10
-
-KPX f quoteright 30
-KPX f quotedblright 30
-KPX f period -10
-KPX f o -20
-KPX f e -10
-KPX f comma -10
-
-KPX g g -10
-KPX g e 10
-
-KPX h y -20
-
-KPX k o -15
-
-KPX l y -15
-KPX l w -15
-
-KPX m y -30
-KPX m u -20
-
-KPX n y -20
-KPX n v -40
-KPX n u -10
-
-KPX o y -20
-KPX o x -30
-KPX o w -15
-KPX o v -20
-
-KPX p y -15
-
-KPX period space -40
-KPX period quoteright -120
-KPX period quotedblright -120
-
-KPX quotedblright space -80
-
-KPX quoteleft quoteleft -46
-
-KPX quoteright v -20
-KPX quoteright space -80
-KPX quoteright s -60
-KPX quoteright r -40
-KPX quoteright quoteright -46
-KPX quoteright l -20
-KPX quoteright d -80
-
-KPX r y 10
-KPX r v 10
-KPX r t 20
-KPX r s -15
-KPX r q -20
-KPX r period -60
-KPX r o -20
-KPX r hyphen -20
-KPX r g -15
-KPX r d -20
-KPX r comma -60
-KPX r c -20
-
-KPX s w -15
-
-KPX semicolon space -40
-
-KPX space quoteleft -60
-KPX space quotedblleft -80
-KPX space Y -120
-KPX space W -80
-KPX space V -80
-KPX space T -100
-
-KPX v period -80
-KPX v o -30
-KPX v comma -80
-KPX v a -20
-
-KPX w period -40
-KPX w o -20
-KPX w comma -40
-
-KPX x e -10
-
-KPX y period -80
-KPX y o -25
-KPX y e -10
-KPX y comma -80
-KPX y a -30
-
-KPX z e 10
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 195 186 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 195 186 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 195 186 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 195 186 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 195 186 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 195 186 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 215 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 167 186 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 167 186 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 167 186 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 167 186 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute -27 186 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -27 186 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -27 186 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave -27 186 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 195 186 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 223 186 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 223 186 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 223 186 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 223 186 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 223 186 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 167 186 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 195 186 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 195 186 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 195 186 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 195 186 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 167 186 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 167 186 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 186 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 112 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 112 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 112 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 112 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 112 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 112 0 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 132 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 112 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 112 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 112 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 112 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 139 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 139 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 139 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 139 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 139 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 139 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 112 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 139 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 139 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 139 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 139 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 112 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 112 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 84 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Helvetica-BoldOblique.afm b/blt3.0.1/library/afm/Helvetica-BoldOblique.afm
deleted file mode 100644
index 0df5aaf..0000000
--- a/blt3.0.1/library/afm/Helvetica-BoldOblique.afm
+++ /dev/null
@@ -1,571 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Thu Mar 15 10:44:33 1990
-Comment UniqueID 28371
-Comment VMusage 7614 43068
-FontName Helvetica-BoldOblique
-FullName Helvetica Bold Oblique
-FamilyName Helvetica
-Weight Bold
-ItalicAngle -12
-IsFixedPitch false
-FontBBox -174 -228 1114 962
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 718
-XHeight 532
-Ascender 718
-Descender -207
-StartCharMetrics 228
-C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 94 0 397 718 ;
-C 34 ; WX 474 ; N quotedbl ; B 193 447 529 718 ;
-C 35 ; WX 556 ; N numbersign ; B 60 0 644 698 ;
-C 36 ; WX 556 ; N dollar ; B 67 -115 622 775 ;
-C 37 ; WX 889 ; N percent ; B 136 -19 901 710 ;
-C 38 ; WX 722 ; N ampersand ; B 89 -19 732 718 ;
-C 39 ; WX 278 ; N quoteright ; B 167 445 362 718 ;
-C 40 ; WX 333 ; N parenleft ; B 76 -208 470 734 ;
-C 41 ; WX 333 ; N parenright ; B -25 -208 369 734 ;
-C 42 ; WX 389 ; N asterisk ; B 146 387 481 718 ;
-C 43 ; WX 584 ; N plus ; B 82 0 610 506 ;
-C 44 ; WX 278 ; N comma ; B 28 -168 245 146 ;
-C 45 ; WX 333 ; N hyphen ; B 73 215 379 345 ;
-C 46 ; WX 278 ; N period ; B 64 0 245 146 ;
-C 47 ; WX 278 ; N slash ; B -37 -19 468 737 ;
-C 48 ; WX 556 ; N zero ; B 86 -19 617 710 ;
-C 49 ; WX 556 ; N one ; B 173 0 529 710 ;
-C 50 ; WX 556 ; N two ; B 26 0 619 710 ;
-C 51 ; WX 556 ; N three ; B 65 -19 608 710 ;
-C 52 ; WX 556 ; N four ; B 60 0 598 710 ;
-C 53 ; WX 556 ; N five ; B 64 -19 636 698 ;
-C 54 ; WX 556 ; N six ; B 85 -19 619 710 ;
-C 55 ; WX 556 ; N seven ; B 125 0 676 698 ;
-C 56 ; WX 556 ; N eight ; B 69 -19 616 710 ;
-C 57 ; WX 556 ; N nine ; B 78 -19 615 710 ;
-C 58 ; WX 333 ; N colon ; B 92 0 351 512 ;
-C 59 ; WX 333 ; N semicolon ; B 56 -168 351 512 ;
-C 60 ; WX 584 ; N less ; B 82 -8 655 514 ;
-C 61 ; WX 584 ; N equal ; B 58 87 633 419 ;
-C 62 ; WX 584 ; N greater ; B 36 -8 609 514 ;
-C 63 ; WX 611 ; N question ; B 165 0 671 727 ;
-C 64 ; WX 975 ; N at ; B 186 -19 954 737 ;
-C 65 ; WX 722 ; N A ; B 20 0 702 718 ;
-C 66 ; WX 722 ; N B ; B 76 0 764 718 ;
-C 67 ; WX 722 ; N C ; B 107 -19 789 737 ;
-C 68 ; WX 722 ; N D ; B 76 0 777 718 ;
-C 69 ; WX 667 ; N E ; B 76 0 757 718 ;
-C 70 ; WX 611 ; N F ; B 76 0 740 718 ;
-C 71 ; WX 778 ; N G ; B 108 -19 817 737 ;
-C 72 ; WX 722 ; N H ; B 71 0 804 718 ;
-C 73 ; WX 278 ; N I ; B 64 0 367 718 ;
-C 74 ; WX 556 ; N J ; B 60 -18 637 718 ;
-C 75 ; WX 722 ; N K ; B 87 0 858 718 ;
-C 76 ; WX 611 ; N L ; B 76 0 611 718 ;
-C 77 ; WX 833 ; N M ; B 69 0 918 718 ;
-C 78 ; WX 722 ; N N ; B 69 0 807 718 ;
-C 79 ; WX 778 ; N O ; B 107 -19 823 737 ;
-C 80 ; WX 667 ; N P ; B 76 0 738 718 ;
-C 81 ; WX 778 ; N Q ; B 107 -52 823 737 ;
-C 82 ; WX 722 ; N R ; B 76 0 778 718 ;
-C 83 ; WX 667 ; N S ; B 81 -19 718 737 ;
-C 84 ; WX 611 ; N T ; B 140 0 751 718 ;
-C 85 ; WX 722 ; N U ; B 116 -19 804 718 ;
-C 86 ; WX 667 ; N V ; B 172 0 801 718 ;
-C 87 ; WX 944 ; N W ; B 169 0 1082 718 ;
-C 88 ; WX 667 ; N X ; B 14 0 791 718 ;
-C 89 ; WX 667 ; N Y ; B 168 0 806 718 ;
-C 90 ; WX 611 ; N Z ; B 25 0 737 718 ;
-C 91 ; WX 333 ; N bracketleft ; B 21 -196 462 722 ;
-C 92 ; WX 278 ; N backslash ; B 124 -19 307 737 ;
-C 93 ; WX 333 ; N bracketright ; B -18 -196 423 722 ;
-C 94 ; WX 584 ; N asciicircum ; B 131 323 591 698 ;
-C 95 ; WX 556 ; N underscore ; B -27 -125 540 -75 ;
-C 96 ; WX 278 ; N quoteleft ; B 165 454 361 727 ;
-C 97 ; WX 556 ; N a ; B 55 -14 583 546 ;
-C 98 ; WX 611 ; N b ; B 61 -14 645 718 ;
-C 99 ; WX 556 ; N c ; B 79 -14 599 546 ;
-C 100 ; WX 611 ; N d ; B 82 -14 704 718 ;
-C 101 ; WX 556 ; N e ; B 70 -14 593 546 ;
-C 102 ; WX 333 ; N f ; B 87 0 469 727 ; L i fi ; L l fl ;
-C 103 ; WX 611 ; N g ; B 38 -217 666 546 ;
-C 104 ; WX 611 ; N h ; B 65 0 629 718 ;
-C 105 ; WX 278 ; N i ; B 69 0 363 725 ;
-C 106 ; WX 278 ; N j ; B -42 -214 363 725 ;
-C 107 ; WX 556 ; N k ; B 69 0 670 718 ;
-C 108 ; WX 278 ; N l ; B 69 0 362 718 ;
-C 109 ; WX 889 ; N m ; B 64 0 909 546 ;
-C 110 ; WX 611 ; N n ; B 65 0 629 546 ;
-C 111 ; WX 611 ; N o ; B 82 -14 643 546 ;
-C 112 ; WX 611 ; N p ; B 18 -207 645 546 ;
-C 113 ; WX 611 ; N q ; B 80 -207 665 546 ;
-C 114 ; WX 389 ; N r ; B 64 0 489 546 ;
-C 115 ; WX 556 ; N s ; B 63 -14 584 546 ;
-C 116 ; WX 333 ; N t ; B 100 -6 422 676 ;
-C 117 ; WX 611 ; N u ; B 98 -14 658 532 ;
-C 118 ; WX 556 ; N v ; B 126 0 656 532 ;
-C 119 ; WX 778 ; N w ; B 123 0 882 532 ;
-C 120 ; WX 556 ; N x ; B 15 0 648 532 ;
-C 121 ; WX 556 ; N y ; B 42 -214 652 532 ;
-C 122 ; WX 500 ; N z ; B 20 0 583 532 ;
-C 123 ; WX 389 ; N braceleft ; B 94 -196 518 722 ;
-C 124 ; WX 280 ; N bar ; B 80 -19 353 737 ;
-C 125 ; WX 389 ; N braceright ; B -18 -196 407 722 ;
-C 126 ; WX 584 ; N asciitilde ; B 115 163 577 343 ;
-C 161 ; WX 333 ; N exclamdown ; B 50 -186 353 532 ;
-C 162 ; WX 556 ; N cent ; B 79 -118 599 628 ;
-C 163 ; WX 556 ; N sterling ; B 50 -16 635 718 ;
-C 164 ; WX 167 ; N fraction ; B -174 -19 487 710 ;
-C 165 ; WX 556 ; N yen ; B 60 0 713 698 ;
-C 166 ; WX 556 ; N florin ; B -50 -210 669 737 ;
-C 167 ; WX 556 ; N section ; B 61 -184 598 727 ;
-C 168 ; WX 556 ; N currency ; B 27 76 680 636 ;
-C 169 ; WX 238 ; N quotesingle ; B 165 447 321 718 ;
-C 170 ; WX 500 ; N quotedblleft ; B 160 454 588 727 ;
-C 171 ; WX 556 ; N guillemotleft ; B 135 76 571 484 ;
-C 172 ; WX 333 ; N guilsinglleft ; B 130 76 353 484 ;
-C 173 ; WX 333 ; N guilsinglright ; B 99 76 322 484 ;
-C 174 ; WX 611 ; N fi ; B 87 0 696 727 ;
-C 175 ; WX 611 ; N fl ; B 87 0 695 727 ;
-C 177 ; WX 556 ; N endash ; B 48 227 627 333 ;
-C 178 ; WX 556 ; N dagger ; B 118 -171 626 718 ;
-C 179 ; WX 556 ; N daggerdbl ; B 46 -171 628 718 ;
-C 180 ; WX 278 ; N periodcentered ; B 110 172 276 334 ;
-C 182 ; WX 556 ; N paragraph ; B 98 -191 688 700 ;
-C 183 ; WX 350 ; N bullet ; B 83 194 420 524 ;
-C 184 ; WX 278 ; N quotesinglbase ; B 41 -146 236 127 ;
-C 185 ; WX 500 ; N quotedblbase ; B 36 -146 463 127 ;
-C 186 ; WX 500 ; N quotedblright ; B 162 445 589 718 ;
-C 187 ; WX 556 ; N guillemotright ; B 104 76 540 484 ;
-C 188 ; WX 1000 ; N ellipsis ; B 92 0 939 146 ;
-C 189 ; WX 1000 ; N perthousand ; B 76 -19 1038 710 ;
-C 191 ; WX 611 ; N questiondown ; B 53 -195 559 532 ;
-C 193 ; WX 333 ; N grave ; B 136 604 353 750 ;
-C 194 ; WX 333 ; N acute ; B 236 604 515 750 ;
-C 195 ; WX 333 ; N circumflex ; B 118 604 471 750 ;
-C 196 ; WX 333 ; N tilde ; B 113 610 507 737 ;
-C 197 ; WX 333 ; N macron ; B 122 604 483 678 ;
-C 198 ; WX 333 ; N breve ; B 156 604 494 750 ;
-C 199 ; WX 333 ; N dotaccent ; B 235 614 385 729 ;
-C 200 ; WX 333 ; N dieresis ; B 137 614 482 729 ;
-C 202 ; WX 333 ; N ring ; B 200 568 420 776 ;
-C 203 ; WX 333 ; N cedilla ; B -37 -228 220 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B 137 604 645 750 ;
-C 206 ; WX 333 ; N ogonek ; B 41 -228 264 0 ;
-C 207 ; WX 333 ; N caron ; B 149 604 502 750 ;
-C 208 ; WX 1000 ; N emdash ; B 48 227 1071 333 ;
-C 225 ; WX 1000 ; N AE ; B 5 0 1100 718 ;
-C 227 ; WX 370 ; N ordfeminine ; B 92 276 465 737 ;
-C 232 ; WX 611 ; N Lslash ; B 34 0 611 718 ;
-C 233 ; WX 778 ; N Oslash ; B 35 -27 894 745 ;
-C 234 ; WX 1000 ; N OE ; B 99 -19 1114 737 ;
-C 235 ; WX 365 ; N ordmasculine ; B 92 276 485 737 ;
-C 241 ; WX 889 ; N ae ; B 56 -14 923 546 ;
-C 245 ; WX 278 ; N dotlessi ; B 69 0 322 532 ;
-C 248 ; WX 278 ; N lslash ; B 40 0 407 718 ;
-C 249 ; WX 611 ; N oslash ; B 22 -29 701 560 ;
-C 250 ; WX 944 ; N oe ; B 82 -14 977 546 ;
-C 251 ; WX 611 ; N germandbls ; B 69 -14 657 731 ;
-C -1 ; WX 611 ; N Zcaron ; B 25 0 737 936 ;
-C -1 ; WX 556 ; N ccedilla ; B 79 -228 599 546 ;
-C -1 ; WX 556 ; N ydieresis ; B 42 -214 652 729 ;
-C -1 ; WX 556 ; N atilde ; B 55 -14 619 737 ;
-C -1 ; WX 278 ; N icircumflex ; B 69 0 444 750 ;
-C -1 ; WX 333 ; N threesuperior ; B 91 271 441 710 ;
-C -1 ; WX 556 ; N ecircumflex ; B 70 -14 593 750 ;
-C -1 ; WX 611 ; N thorn ; B 18 -208 645 718 ;
-C -1 ; WX 556 ; N egrave ; B 70 -14 593 750 ;
-C -1 ; WX 333 ; N twosuperior ; B 69 283 449 710 ;
-C -1 ; WX 556 ; N eacute ; B 70 -14 627 750 ;
-C -1 ; WX 611 ; N otilde ; B 82 -14 646 737 ;
-C -1 ; WX 722 ; N Aacute ; B 20 0 750 936 ;
-C -1 ; WX 611 ; N ocircumflex ; B 82 -14 643 750 ;
-C -1 ; WX 556 ; N yacute ; B 42 -214 652 750 ;
-C -1 ; WX 611 ; N udieresis ; B 98 -14 658 729 ;
-C -1 ; WX 834 ; N threequarters ; B 99 -19 839 710 ;
-C -1 ; WX 556 ; N acircumflex ; B 55 -14 583 750 ;
-C -1 ; WX 722 ; N Eth ; B 62 0 777 718 ;
-C -1 ; WX 556 ; N edieresis ; B 70 -14 594 729 ;
-C -1 ; WX 611 ; N ugrave ; B 98 -14 658 750 ;
-C -1 ; WX 1000 ; N trademark ; B 179 306 1109 718 ;
-C -1 ; WX 611 ; N ograve ; B 82 -14 643 750 ;
-C -1 ; WX 556 ; N scaron ; B 63 -14 614 750 ;
-C -1 ; WX 278 ; N Idieresis ; B 64 0 494 915 ;
-C -1 ; WX 611 ; N uacute ; B 98 -14 658 750 ;
-C -1 ; WX 556 ; N agrave ; B 55 -14 583 750 ;
-C -1 ; WX 611 ; N ntilde ; B 65 0 646 737 ;
-C -1 ; WX 556 ; N aring ; B 55 -14 583 776 ;
-C -1 ; WX 500 ; N zcaron ; B 20 0 586 750 ;
-C -1 ; WX 278 ; N Icircumflex ; B 64 0 484 936 ;
-C -1 ; WX 722 ; N Ntilde ; B 69 0 807 923 ;
-C -1 ; WX 611 ; N ucircumflex ; B 98 -14 658 750 ;
-C -1 ; WX 667 ; N Ecircumflex ; B 76 0 757 936 ;
-C -1 ; WX 278 ; N Iacute ; B 64 0 528 936 ;
-C -1 ; WX 722 ; N Ccedilla ; B 107 -228 789 737 ;
-C -1 ; WX 778 ; N Odieresis ; B 107 -19 823 915 ;
-C -1 ; WX 667 ; N Scaron ; B 81 -19 718 936 ;
-C -1 ; WX 667 ; N Edieresis ; B 76 0 757 915 ;
-C -1 ; WX 278 ; N Igrave ; B 64 0 367 936 ;
-C -1 ; WX 556 ; N adieresis ; B 55 -14 594 729 ;
-C -1 ; WX 778 ; N Ograve ; B 107 -19 823 936 ;
-C -1 ; WX 667 ; N Egrave ; B 76 0 757 936 ;
-C -1 ; WX 667 ; N Ydieresis ; B 168 0 806 915 ;
-C -1 ; WX 737 ; N registered ; B 55 -19 834 737 ;
-C -1 ; WX 778 ; N Otilde ; B 107 -19 823 923 ;
-C -1 ; WX 834 ; N onequarter ; B 132 -19 806 710 ;
-C -1 ; WX 722 ; N Ugrave ; B 116 -19 804 936 ;
-C -1 ; WX 722 ; N Ucircumflex ; B 116 -19 804 936 ;
-C -1 ; WX 667 ; N Thorn ; B 76 0 716 718 ;
-C -1 ; WX 584 ; N divide ; B 82 -42 610 548 ;
-C -1 ; WX 722 ; N Atilde ; B 20 0 741 923 ;
-C -1 ; WX 722 ; N Uacute ; B 116 -19 804 936 ;
-C -1 ; WX 778 ; N Ocircumflex ; B 107 -19 823 936 ;
-C -1 ; WX 584 ; N logicalnot ; B 105 108 633 419 ;
-C -1 ; WX 722 ; N Aring ; B 20 0 702 962 ;
-C -1 ; WX 278 ; N idieresis ; B 69 0 455 729 ;
-C -1 ; WX 278 ; N iacute ; B 69 0 488 750 ;
-C -1 ; WX 556 ; N aacute ; B 55 -14 627 750 ;
-C -1 ; WX 584 ; N plusminus ; B 40 0 625 506 ;
-C -1 ; WX 584 ; N multiply ; B 57 1 635 505 ;
-C -1 ; WX 722 ; N Udieresis ; B 116 -19 804 915 ;
-C -1 ; WX 584 ; N minus ; B 82 197 610 309 ;
-C -1 ; WX 333 ; N onesuperior ; B 148 283 388 710 ;
-C -1 ; WX 667 ; N Eacute ; B 76 0 757 936 ;
-C -1 ; WX 722 ; N Acircumflex ; B 20 0 706 936 ;
-C -1 ; WX 737 ; N copyright ; B 56 -19 835 737 ;
-C -1 ; WX 722 ; N Agrave ; B 20 0 702 936 ;
-C -1 ; WX 611 ; N odieresis ; B 82 -14 643 729 ;
-C -1 ; WX 611 ; N oacute ; B 82 -14 654 750 ;
-C -1 ; WX 400 ; N degree ; B 175 426 467 712 ;
-C -1 ; WX 278 ; N igrave ; B 69 0 326 750 ;
-C -1 ; WX 611 ; N mu ; B 22 -207 658 532 ;
-C -1 ; WX 778 ; N Oacute ; B 107 -19 823 936 ;
-C -1 ; WX 611 ; N eth ; B 82 -14 670 737 ;
-C -1 ; WX 722 ; N Adieresis ; B 20 0 716 915 ;
-C -1 ; WX 667 ; N Yacute ; B 168 0 806 936 ;
-C -1 ; WX 280 ; N brokenbar ; B 80 -19 353 737 ;
-C -1 ; WX 834 ; N onehalf ; B 132 -19 858 710 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 209
-
-KPX A y -30
-KPX A w -30
-KPX A v -40
-KPX A u -30
-KPX A Y -110
-KPX A W -60
-KPX A V -80
-KPX A U -50
-KPX A T -90
-KPX A Q -40
-KPX A O -40
-KPX A G -50
-KPX A C -40
-
-KPX B U -10
-KPX B A -30
-
-KPX D period -30
-KPX D comma -30
-KPX D Y -70
-KPX D W -40
-KPX D V -40
-KPX D A -40
-
-KPX F period -100
-KPX F comma -100
-KPX F a -20
-KPX F A -80
-
-KPX J u -20
-KPX J period -20
-KPX J comma -20
-KPX J A -20
-
-KPX K y -40
-KPX K u -30
-KPX K o -35
-KPX K e -15
-KPX K O -30
-
-KPX L y -30
-KPX L quoteright -140
-KPX L quotedblright -140
-KPX L Y -120
-KPX L W -80
-KPX L V -110
-KPX L T -90
-
-KPX O period -40
-KPX O comma -40
-KPX O Y -70
-KPX O X -50
-KPX O W -50
-KPX O V -50
-KPX O T -40
-KPX O A -50
-
-KPX P period -120
-KPX P o -40
-KPX P e -30
-KPX P comma -120
-KPX P a -30
-KPX P A -100
-
-KPX Q period 20
-KPX Q comma 20
-KPX Q U -10
-
-KPX R Y -50
-KPX R W -40
-KPX R V -50
-KPX R U -20
-KPX R T -20
-KPX R O -20
-
-KPX T y -60
-KPX T w -60
-KPX T u -90
-KPX T semicolon -40
-KPX T r -80
-KPX T period -80
-KPX T o -80
-KPX T hyphen -120
-KPX T e -60
-KPX T comma -80
-KPX T colon -40
-KPX T a -80
-KPX T O -40
-KPX T A -90
-
-KPX U period -30
-KPX U comma -30
-KPX U A -50
-
-KPX V u -60
-KPX V semicolon -40
-KPX V period -120
-KPX V o -90
-KPX V hyphen -80
-KPX V e -50
-KPX V comma -120
-KPX V colon -40
-KPX V a -60
-KPX V O -50
-KPX V G -50
-KPX V A -80
-
-KPX W y -20
-KPX W u -45
-KPX W semicolon -10
-KPX W period -80
-KPX W o -60
-KPX W hyphen -40
-KPX W e -35
-KPX W comma -80
-KPX W colon -10
-KPX W a -40
-KPX W O -20
-KPX W A -60
-
-KPX Y u -100
-KPX Y semicolon -50
-KPX Y period -100
-KPX Y o -100
-KPX Y e -80
-KPX Y comma -100
-KPX Y colon -50
-KPX Y a -90
-KPX Y O -70
-KPX Y A -110
-
-KPX a y -20
-KPX a w -15
-KPX a v -15
-KPX a g -10
-
-KPX b y -20
-KPX b v -20
-KPX b u -20
-KPX b l -10
-
-KPX c y -10
-KPX c l -20
-KPX c k -20
-KPX c h -10
-
-KPX colon space -40
-
-KPX comma space -40
-KPX comma quoteright -120
-KPX comma quotedblright -120
-
-KPX d y -15
-KPX d w -15
-KPX d v -15
-KPX d d -10
-
-KPX e y -15
-KPX e x -15
-KPX e w -15
-KPX e v -15
-KPX e period 20
-KPX e comma 10
-
-KPX f quoteright 30
-KPX f quotedblright 30
-KPX f period -10
-KPX f o -20
-KPX f e -10
-KPX f comma -10
-
-KPX g g -10
-KPX g e 10
-
-KPX h y -20
-
-KPX k o -15
-
-KPX l y -15
-KPX l w -15
-
-KPX m y -30
-KPX m u -20
-
-KPX n y -20
-KPX n v -40
-KPX n u -10
-
-KPX o y -20
-KPX o x -30
-KPX o w -15
-KPX o v -20
-
-KPX p y -15
-
-KPX period space -40
-KPX period quoteright -120
-KPX period quotedblright -120
-
-KPX quotedblright space -80
-
-KPX quoteleft quoteleft -46
-
-KPX quoteright v -20
-KPX quoteright space -80
-KPX quoteright s -60
-KPX quoteright r -40
-KPX quoteright quoteright -46
-KPX quoteright l -20
-KPX quoteright d -80
-
-KPX r y 10
-KPX r v 10
-KPX r t 20
-KPX r s -15
-KPX r q -20
-KPX r period -60
-KPX r o -20
-KPX r hyphen -20
-KPX r g -15
-KPX r d -20
-KPX r comma -60
-KPX r c -20
-
-KPX s w -15
-
-KPX semicolon space -40
-
-KPX space quoteleft -60
-KPX space quotedblleft -80
-KPX space Y -120
-KPX space W -80
-KPX space V -80
-KPX space T -100
-
-KPX v period -80
-KPX v o -30
-KPX v comma -80
-KPX v a -20
-
-KPX w period -40
-KPX w o -20
-KPX w comma -40
-
-KPX x e -10
-
-KPX y period -80
-KPX y o -25
-KPX y e -10
-KPX y comma -80
-KPX y a -30
-
-KPX z e 10
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 235 186 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 235 186 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 235 186 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 235 186 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 235 186 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 235 186 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 215 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 207 186 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 207 186 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 207 186 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 207 186 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 13 186 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 13 186 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 13 186 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 13 186 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 235 186 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 263 186 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 263 186 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 263 186 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 263 186 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 263 186 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 207 186 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 235 186 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 235 186 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 235 186 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 235 186 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 207 186 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 207 186 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 179 186 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 112 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 112 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 112 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 112 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 112 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 112 0 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 132 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 112 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 112 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 112 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 112 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 139 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 139 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 139 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 139 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 139 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 139 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 112 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 139 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 139 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 139 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 139 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 112 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 112 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 84 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Helvetica-Condensed-Bold.afm b/blt3.0.1/library/afm/Helvetica-Condensed-Bold.afm
deleted file mode 100644
index 4f0c660..0000000
--- a/blt3.0.1/library/afm/Helvetica-Condensed-Bold.afm
+++ /dev/null
@@ -1,419 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1991 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Wed Sep 4 17:42:59 1991
-Comment UniqueID 36188
-Comment VMusage 27402 34294
-FontName Helvetica-Condensed-Bold
-FullName Helvetica Condensed Bold
-FamilyName Helvetica
-Weight Bold
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -169 -250 1091 991
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.004
-Notice Copyright (c) 1985, 1987, 1991 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 750
-XHeight 564
-Ascender 750
-Descender -189
-StartCharMetrics 228
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 101 0 232 750 ;
-C 34 ; WX 333 ; N quotedbl ; B 16 468 318 739 ;
-C 35 ; WX 500 ; N numbersign ; B 31 0 469 738 ;
-C 36 ; WX 500 ; N dollar ; B 35 -124 466 803 ;
-C 37 ; WX 833 ; N percent ; B 31 -15 803 750 ;
-C 38 ; WX 667 ; N ampersand ; B 63 -18 615 768 ;
-C 39 ; WX 278 ; N quoteright ; B 81 479 202 750 ;
-C 40 ; WX 333 ; N parenleft ; B 52 -198 281 768 ;
-C 41 ; WX 333 ; N parenright ; B 52 -198 281 768 ;
-C 42 ; WX 500 ; N asterisk ; B 79 412 422 738 ;
-C 43 ; WX 500 ; N plus ; B 26 0 475 492 ;
-C 44 ; WX 333 ; N comma ; B 101 -145 233 132 ;
-C 45 ; WX 333 ; N hyphen ; B 48 255 286 370 ;
-C 46 ; WX 333 ; N period ; B 101 0 233 132 ;
-C 47 ; WX 278 ; N slash ; B -11 -94 312 750 ;
-C 48 ; WX 500 ; N zero ; B 48 -15 453 753 ;
-C 49 ; WX 500 ; N one ; B 44 0 353 750 ;
-C 50 ; WX 500 ; N two ; B 32 0 453 753 ;
-C 51 ; WX 500 ; N three ; B 28 -15 453 753 ;
-C 52 ; WX 500 ; N four ; B 23 0 470 738 ;
-C 53 ; WX 500 ; N five ; B 37 -15 458 738 ;
-C 54 ; WX 500 ; N six ; B 42 -15 459 753 ;
-C 55 ; WX 500 ; N seven ; B 32 0 454 738 ;
-C 56 ; WX 500 ; N eight ; B 41 -15 460 753 ;
-C 57 ; WX 500 ; N nine ; B 42 -15 459 753 ;
-C 58 ; WX 278 ; N colon ; B 73 0 205 556 ;
-C 59 ; WX 278 ; N semicolon ; B 73 -145 205 556 ;
-C 60 ; WX 500 ; N less ; B 42 -24 459 527 ;
-C 61 ; WX 500 ; N equal ; B 26 96 475 401 ;
-C 62 ; WX 500 ; N greater ; B 42 -24 459 527 ;
-C 63 ; WX 500 ; N question ; B 51 0 440 768 ;
-C 64 ; WX 833 ; N at ; B 38 -18 795 768 ;
-C 65 ; WX 556 ; N A ; B 9 0 547 750 ;
-C 66 ; WX 556 ; N B ; B 65 0 506 750 ;
-C 67 ; WX 556 ; N C ; B 55 -18 512 768 ;
-C 68 ; WX 611 ; N D ; B 72 0 550 750 ;
-C 69 ; WX 500 ; N E ; B 64 0 458 750 ;
-C 70 ; WX 500 ; N F ; B 73 0 470 750 ;
-C 71 ; WX 611 ; N G ; B 55 -18 542 768 ;
-C 72 ; WX 611 ; N H ; B 68 0 544 750 ;
-C 73 ; WX 278 ; N I ; B 69 0 209 750 ;
-C 74 ; WX 444 ; N J ; B 7 -18 384 750 ;
-C 75 ; WX 556 ; N K ; B 68 0 547 750 ;
-C 76 ; WX 500 ; N L ; B 68 0 468 750 ;
-C 77 ; WX 778 ; N M ; B 67 0 712 750 ;
-C 78 ; WX 611 ; N N ; B 68 0 543 750 ;
-C 79 ; WX 611 ; N O ; B 61 -18 551 768 ;
-C 80 ; WX 556 ; N P ; B 68 0 529 750 ;
-C 81 ; WX 611 ; N Q ; B 61 -71 587 768 ;
-C 82 ; WX 611 ; N R ; B 66 0 567 750 ;
-C 83 ; WX 556 ; N S ; B 49 -18 508 768 ;
-C 84 ; WX 500 ; N T ; B 17 0 484 750 ;
-C 85 ; WX 611 ; N U ; B 68 -18 544 750 ;
-C 86 ; WX 556 ; N V ; B 21 0 536 750 ;
-C 87 ; WX 833 ; N W ; B 24 0 810 750 ;
-C 88 ; WX 556 ; N X ; B 11 0 545 750 ;
-C 89 ; WX 556 ; N Y ; B 12 0 545 750 ;
-C 90 ; WX 500 ; N Z ; B 33 0 468 750 ;
-C 91 ; WX 333 ; N bracketleft ; B 81 -94 280 750 ;
-C 92 ; WX 250 ; N backslash ; B -89 0 340 750 ;
-C 93 ; WX 333 ; N bracketright ; B 53 -94 252 750 ;
-C 94 ; WX 500 ; N asciicircum ; B 10 326 490 750 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 278 ; N quoteleft ; B 76 495 197 766 ;
-C 97 ; WX 500 ; N a ; B 42 -15 440 579 ;
-C 98 ; WX 500 ; N b ; B 64 -15 444 750 ;
-C 99 ; WX 444 ; N c ; B 49 -15 403 579 ;
-C 100 ; WX 500 ; N d ; B 53 -15 433 750 ;
-C 101 ; WX 500 ; N e ; B 53 -15 443 579 ;
-C 102 ; WX 278 ; N f ; B 21 0 257 750 ; L i fi ; L l fl ;
-C 103 ; WX 500 ; N g ; B 53 -190 433 579 ;
-C 104 ; WX 500 ; N h ; B 61 0 440 750 ;
-C 105 ; WX 278 ; N i ; B 74 0 204 750 ;
-C 106 ; WX 278 ; N j ; B 31 -192 210 750 ;
-C 107 ; WX 444 ; N k ; B 48 0 443 750 ;
-C 108 ; WX 278 ; N l ; B 74 0 204 750 ;
-C 109 ; WX 778 ; N m ; B 66 0 712 579 ;
-C 110 ; WX 500 ; N n ; B 61 0 440 579 ;
-C 111 ; WX 500 ; N o ; B 53 -15 447 579 ;
-C 112 ; WX 500 ; N p ; B 58 -189 438 579 ;
-C 113 ; WX 500 ; N q ; B 50 -188 430 579 ;
-C 114 ; WX 333 ; N r ; B 60 0 319 574 ;
-C 115 ; WX 444 ; N s ; B 28 -15 407 579 ;
-C 116 ; WX 278 ; N t ; B 14 -7 252 719 ;
-C 117 ; WX 500 ; N u ; B 58 -15 431 564 ;
-C 118 ; WX 444 ; N v ; B 10 0 434 564 ;
-C 119 ; WX 667 ; N w ; B 11 0 645 564 ;
-C 120 ; WX 444 ; N x ; B 8 0 436 564 ;
-C 121 ; WX 444 ; N y ; B 5 -195 429 564 ;
-C 122 ; WX 389 ; N z ; B 23 0 367 564 ;
-C 123 ; WX 274 ; N braceleft ; B -32 -92 240 750 ;
-C 124 ; WX 250 ; N bar ; B 75 -250 175 750 ;
-C 125 ; WX 274 ; N braceright ; B 34 -94 306 750 ;
-C 126 ; WX 500 ; N asciitilde ; B 26 153 475 359 ;
-C 161 ; WX 333 ; N exclamdown ; B 102 -170 232 579 ;
-C 162 ; WX 500 ; N cent ; B 72 -122 428 671 ;
-C 163 ; WX 500 ; N sterling ; B 35 -15 487 768 ;
-C 164 ; WX 167 ; N fraction ; B -169 0 331 738 ;
-C 165 ; WX 500 ; N yen ; B -18 0 518 750 ;
-C 166 ; WX 500 ; N florin ; B 9 -185 492 763 ;
-C 167 ; WX 500 ; N section ; B 37 -183 463 768 ;
-C 168 ; WX 500 ; N currency ; B 9 58 492 560 ;
-C 169 ; WX 250 ; N quotesingle ; B 66 468 185 739 ;
-C 170 ; WX 500 ; N quotedblleft ; B 87 495 405 766 ;
-C 171 ; WX 500 ; N guillemotleft ; B 74 62 419 447 ;
-C 172 ; WX 278 ; N guilsinglleft ; B 58 62 215 447 ;
-C 173 ; WX 278 ; N guilsinglright ; B 63 62 220 447 ;
-C 174 ; WX 500 ; N fi ; B 10 0 446 750 ;
-C 175 ; WX 500 ; N fl ; B 10 0 443 750 ;
-C 177 ; WX 500 ; N endash ; B 0 259 500 369 ;
-C 178 ; WX 500 ; N dagger ; B 37 -155 463 768 ;
-C 179 ; WX 500 ; N daggerdbl ; B 35 -161 466 768 ;
-C 180 ; WX 333 ; N periodcentered ; B 101 183 233 315 ;
-C 182 ; WX 550 ; N paragraph ; B 23 -116 526 750 ;
-C 183 ; WX 420 ; N bullet ; B 22 186 398 562 ;
-C 184 ; WX 278 ; N quotesinglbase ; B 87 -138 207 132 ;
-C 185 ; WX 500 ; N quotedblbase ; B 96 -138 413 132 ;
-C 186 ; WX 500 ; N quotedblright ; B 95 479 413 750 ;
-C 187 ; WX 500 ; N guillemotright ; B 81 62 426 447 ;
-C 188 ; WX 1000 ; N ellipsis ; B 101 0 899 132 ;
-C 189 ; WX 1111 ; N perthousand ; B 21 -18 1091 748 ;
-C 191 ; WX 500 ; N questiondown ; B 60 -190 449 579 ;
-C 193 ; WX 333 ; N grave ; B 1 629 250 775 ;
-C 194 ; WX 333 ; N acute ; B 83 629 332 775 ;
-C 195 ; WX 333 ; N circumflex ; B -10 644 343 790 ;
-C 196 ; WX 333 ; N tilde ; B -16 636 350 764 ;
-C 197 ; WX 333 ; N macron ; B -6 666 340 740 ;
-C 198 ; WX 333 ; N breve ; B -1 635 335 780 ;
-C 199 ; WX 333 ; N dotaccent ; B 103 644 230 759 ;
-C 200 ; WX 333 ; N dieresis ; B 5 644 328 759 ;
-C 202 ; WX 333 ; N ring ; B 60 632 273 845 ;
-C 203 ; WX 333 ; N cedilla ; B 39 -228 275 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B -17 634 447 780 ;
-C 206 ; WX 333 ; N ogonek ; B 88 -205 278 0 ;
-C 207 ; WX 333 ; N caron ; B -10 634 343 780 ;
-C 208 ; WX 1000 ; N emdash ; B 0 259 1000 369 ;
-C 225 ; WX 778 ; N AE ; B -22 0 750 750 ;
-C 227 ; WX 300 ; N ordfeminine ; B 22 412 281 768 ;
-C 232 ; WX 500 ; N Lslash ; B 0 0 474 750 ;
-C 233 ; WX 611 ; N Oslash ; B 36 -38 578 779 ;
-C 234 ; WX 833 ; N OE ; B 61 -18 792 768 ;
-C 235 ; WX 300 ; N ordmasculine ; B 22 412 278 768 ;
-C 241 ; WX 722 ; N ae ; B 44 -15 672 579 ;
-C 245 ; WX 278 ; N dotlessi ; B 74 0 204 564 ;
-C 248 ; WX 278 ; N lslash ; B 2 0 272 750 ;
-C 249 ; WX 500 ; N oslash ; B 7 -58 492 617 ;
-C 250 ; WX 722 ; N oe ; B 46 -15 678 579 ;
-C 251 ; WX 500 ; N germandbls ; B 60 -15 445 768 ;
-C -1 ; WX 500 ; N ecircumflex ; B 53 -15 443 770 ;
-C -1 ; WX 500 ; N edieresis ; B 53 -15 443 759 ;
-C -1 ; WX 500 ; N aacute ; B 42 -15 440 775 ;
-C -1 ; WX 830 ; N registered ; B 22 -18 808 768 ;
-C -1 ; WX 278 ; N icircumflex ; B -47 0 306 770 ;
-C -1 ; WX 500 ; N udieresis ; B 58 -15 431 759 ;
-C -1 ; WX 500 ; N ograve ; B 53 -15 447 775 ;
-C -1 ; WX 500 ; N uacute ; B 58 -15 431 775 ;
-C -1 ; WX 500 ; N ucircumflex ; B 58 -15 431 780 ;
-C -1 ; WX 556 ; N Aacute ; B 9 0 547 961 ;
-C -1 ; WX 278 ; N igrave ; B -26 0 223 775 ;
-C -1 ; WX 278 ; N Icircumflex ; B -37 0 316 956 ;
-C -1 ; WX 444 ; N ccedilla ; B 49 -228 403 579 ;
-C -1 ; WX 500 ; N adieresis ; B 42 -15 440 759 ;
-C -1 ; WX 500 ; N Ecircumflex ; B 64 0 458 956 ;
-C -1 ; WX 444 ; N scaron ; B 28 -15 407 760 ;
-C -1 ; WX 500 ; N thorn ; B 58 -189 438 750 ;
-C -1 ; WX 860 ; N trademark ; B 1 346 774 750 ;
-C -1 ; WX 500 ; N egrave ; B 53 -15 443 775 ;
-C -1 ; WX 300 ; N threesuperior ; B 12 290 288 751 ;
-C -1 ; WX 389 ; N zcaron ; B 18 0 371 760 ;
-C -1 ; WX 500 ; N atilde ; B 42 -15 440 744 ;
-C -1 ; WX 500 ; N aring ; B 42 -15 440 835 ;
-C -1 ; WX 500 ; N ocircumflex ; B 53 -15 447 770 ;
-C -1 ; WX 500 ; N Edieresis ; B 64 0 458 945 ;
-C -1 ; WX 750 ; N threequarters ; B 12 0 739 751 ;
-C -1 ; WX 444 ; N ydieresis ; B 5 -195 429 759 ;
-C -1 ; WX 444 ; N yacute ; B 5 -195 429 775 ;
-C -1 ; WX 278 ; N iacute ; B 56 0 305 775 ;
-C -1 ; WX 556 ; N Acircumflex ; B 9 0 547 956 ;
-C -1 ; WX 611 ; N Uacute ; B 68 -18 544 961 ;
-C -1 ; WX 500 ; N eacute ; B 53 -15 443 775 ;
-C -1 ; WX 611 ; N Ograve ; B 61 -18 551 961 ;
-C -1 ; WX 500 ; N agrave ; B 42 -15 440 775 ;
-C -1 ; WX 611 ; N Udieresis ; B 68 -18 544 945 ;
-C -1 ; WX 500 ; N acircumflex ; B 42 -15 440 770 ;
-C -1 ; WX 278 ; N Igrave ; B -26 0 223 961 ;
-C -1 ; WX 300 ; N twosuperior ; B 13 300 287 752 ;
-C -1 ; WX 611 ; N Ugrave ; B 68 -18 544 961 ;
-C -1 ; WX 750 ; N onequarter ; B 20 0 729 750 ;
-C -1 ; WX 611 ; N Ucircumflex ; B 68 -18 544 956 ;
-C -1 ; WX 556 ; N Scaron ; B 49 -18 508 946 ;
-C -1 ; WX 278 ; N Idieresis ; B -22 0 301 945 ;
-C -1 ; WX 278 ; N idieresis ; B -22 0 301 759 ;
-C -1 ; WX 500 ; N Egrave ; B 64 0 458 961 ;
-C -1 ; WX 611 ; N Oacute ; B 61 -18 551 961 ;
-C -1 ; WX 500 ; N divide ; B 26 6 475 492 ;
-C -1 ; WX 556 ; N Atilde ; B 9 0 547 930 ;
-C -1 ; WX 556 ; N Aring ; B 9 0 547 991 ;
-C -1 ; WX 611 ; N Odieresis ; B 61 -18 551 945 ;
-C -1 ; WX 556 ; N Adieresis ; B 9 0 547 945 ;
-C -1 ; WX 611 ; N Ntilde ; B 68 0 543 930 ;
-C -1 ; WX 500 ; N Zcaron ; B 33 0 468 946 ;
-C -1 ; WX 556 ; N Thorn ; B 68 0 529 750 ;
-C -1 ; WX 278 ; N Iacute ; B 56 0 305 961 ;
-C -1 ; WX 500 ; N plusminus ; B 26 -15 475 513 ;
-C -1 ; WX 500 ; N multiply ; B 26 22 475 476 ;
-C -1 ; WX 500 ; N Eacute ; B 64 0 458 961 ;
-C -1 ; WX 556 ; N Ydieresis ; B 12 0 545 945 ;
-C -1 ; WX 300 ; N onesuperior ; B 50 300 251 750 ;
-C -1 ; WX 500 ; N ugrave ; B 58 -15 431 775 ;
-C -1 ; WX 500 ; N logicalnot ; B 26 105 475 401 ;
-C -1 ; WX 500 ; N ntilde ; B 61 0 440 744 ;
-C -1 ; WX 611 ; N Otilde ; B 61 -18 551 930 ;
-C -1 ; WX 500 ; N otilde ; B 53 -15 447 744 ;
-C -1 ; WX 556 ; N Ccedilla ; B 55 -228 512 768 ;
-C -1 ; WX 556 ; N Agrave ; B 9 0 547 961 ;
-C -1 ; WX 750 ; N onehalf ; B 12 0 739 750 ;
-C -1 ; WX 611 ; N Eth ; B 20 0 550 750 ;
-C -1 ; WX 400 ; N degree ; B 50 450 350 750 ;
-C -1 ; WX 556 ; N Yacute ; B 12 0 545 961 ;
-C -1 ; WX 611 ; N Ocircumflex ; B 61 -18 551 956 ;
-C -1 ; WX 500 ; N oacute ; B 53 -15 447 775 ;
-C -1 ; WX 500 ; N mu ; B 58 -189 431 564 ;
-C -1 ; WX 500 ; N minus ; B 26 194 475 304 ;
-C -1 ; WX 500 ; N eth ; B 53 -15 447 779 ;
-C -1 ; WX 500 ; N odieresis ; B 53 -15 447 759 ;
-C -1 ; WX 830 ; N copyright ; B 22 -18 808 768 ;
-C -1 ; WX 250 ; N brokenbar ; B 75 -175 175 675 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 88
-
-KPX A y -18
-KPX A w -18
-KPX A v -18
-KPX A quoteright -55
-KPX A Y -55
-KPX A W -37
-KPX A V -37
-KPX A T -55
-
-KPX F period -111
-KPX F comma -111
-KPX F A -37
-
-KPX L y -37
-KPX L quoteright -92
-KPX L Y -92
-KPX L W -74
-KPX L V -74
-KPX L T -74
-
-KPX P period -129
-KPX P comma -129
-KPX P A -37
-
-KPX R Y -18
-KPX R T -18
-
-KPX T y -55
-KPX T w -74
-KPX T u -74
-KPX T semicolon -74
-KPX T s -74
-KPX T r -74
-KPX T period -92
-KPX T o -74
-KPX T i -18
-KPX T hyphen -55
-KPX T e -74
-KPX T comma -92
-KPX T colon -74
-KPX T c -74
-KPX T a -74
-KPX T A -55
-
-KPX V u -18
-KPX V semicolon -18
-KPX V r -18
-KPX V period -92
-KPX V o -18
-KPX V hyphen -18
-KPX V e -18
-KPX V comma -92
-KPX V colon -18
-KPX V a -18
-KPX V A -37
-
-KPX W period -74
-KPX W o -18
-KPX W hyphen -18
-KPX W e -18
-KPX W comma -74
-KPX W a -18
-KPX W A -18
-
-KPX Y v -18
-KPX Y u -37
-KPX Y semicolon -37
-KPX Y q -55
-KPX Y period -111
-KPX Y p -37
-KPX Y o -55
-KPX Y i -18
-KPX Y hyphen -74
-KPX Y e -55
-KPX Y comma -111
-KPX Y colon -37
-KPX Y a -55
-KPX Y A -55
-
-KPX f quoteright 18
-
-KPX quoteleft quoteleft -18
-
-KPX quoteright s -55
-KPX quoteright quoteright -18
-
-KPX r z 20
-KPX r y 18
-KPX r x 20
-KPX r w 18
-KPX r v 18
-KPX r period -74
-KPX r hyphen -37
-KPX r comma -74
-
-KPX v period -55
-KPX v comma -55
-
-KPX w period -37
-KPX w comma -37
-
-KPX y period -55
-KPX y comma -55
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 112 186 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 102 166 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 112 186 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 112 186 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 112 146 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 112 166 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 84 186 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 84 166 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 84 186 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 84 186 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute -27 186 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -27 166 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -27 186 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave -27 186 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 139 166 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 139 186 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 139 166 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 139 186 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 139 186 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 139 166 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 112 166 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 139 186 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 139 166 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 139 186 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 139 186 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 112 186 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 112 186 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 84 166 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 84 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 84 -20 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 84 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 84 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 69 -10 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 84 -20 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 84 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 84 -20 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 84 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 84 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -37 -20 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 84 -20 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 -20 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 -20 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 46 -20 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 84 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 84 -10 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 84 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 84 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 56 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 56 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 28 -20 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Helvetica-Condensed-BoldObl.afm b/blt3.0.1/library/afm/Helvetica-Condensed-BoldObl.afm
deleted file mode 100644
index 08c7c21..0000000
--- a/blt3.0.1/library/afm/Helvetica-Condensed-BoldObl.afm
+++ /dev/null
@@ -1,419 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1991 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Wed Sep 4 17:46:28 1991
-Comment UniqueID 36191
-Comment VMusage 8125 43764
-FontName Helvetica-Condensed-BoldObl
-FullName Helvetica Condensed Bold Oblique
-FamilyName Helvetica
-Weight Bold
-ItalicAngle -12
-IsFixedPitch false
-FontBBox -169 -250 1141 991
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.004
-Notice Copyright (c) 1985, 1987, 1991 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 750
-XHeight 564
-Ascender 750
-Descender -189
-StartCharMetrics 228
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 102 0 390 750 ;
-C 34 ; WX 333 ; N quotedbl ; B 115 468 475 739 ;
-C 35 ; WX 500 ; N numbersign ; B 81 0 580 738 ;
-C 36 ; WX 500 ; N dollar ; B 68 -124 576 803 ;
-C 37 ; WX 833 ; N percent ; B 138 -15 853 750 ;
-C 38 ; WX 667 ; N ampersand ; B 101 -18 676 768 ;
-C 39 ; WX 278 ; N quoteright ; B 183 479 361 750 ;
-C 40 ; WX 333 ; N parenleft ; B 91 -198 442 768 ;
-C 41 ; WX 333 ; N parenright ; B 12 -198 363 768 ;
-C 42 ; WX 500 ; N asterisk ; B 203 412 546 738 ;
-C 43 ; WX 500 ; N plus ; B 67 0 540 492 ;
-C 44 ; WX 333 ; N comma ; B 70 -145 261 132 ;
-C 45 ; WX 333 ; N hyphen ; B 102 255 365 370 ;
-C 46 ; WX 333 ; N period ; B 101 0 261 132 ;
-C 47 ; WX 278 ; N slash ; B -31 -94 471 750 ;
-C 48 ; WX 500 ; N zero ; B 82 -15 576 753 ;
-C 49 ; WX 500 ; N one ; B 155 0 512 750 ;
-C 50 ; WX 500 ; N two ; B 32 0 577 753 ;
-C 51 ; WX 500 ; N three ; B 61 -15 563 753 ;
-C 52 ; WX 500 ; N four ; B 55 0 563 738 ;
-C 53 ; WX 500 ; N five ; B 72 -15 581 738 ;
-C 54 ; WX 500 ; N six ; B 83 -15 575 753 ;
-C 55 ; WX 500 ; N seven ; B 126 0 611 738 ;
-C 56 ; WX 500 ; N eight ; B 76 -15 570 753 ;
-C 57 ; WX 500 ; N nine ; B 84 -15 575 753 ;
-C 58 ; WX 278 ; N colon ; B 73 0 323 556 ;
-C 59 ; WX 278 ; N semicolon ; B 42 -145 323 556 ;
-C 60 ; WX 500 ; N less ; B 85 -24 571 527 ;
-C 61 ; WX 500 ; N equal ; B 46 96 560 401 ;
-C 62 ; WX 500 ; N greater ; B 37 -24 523 527 ;
-C 63 ; WX 500 ; N question ; B 147 0 569 768 ;
-C 64 ; WX 833 ; N at ; B 109 -18 897 768 ;
-C 65 ; WX 556 ; N A ; B 9 0 547 750 ;
-C 66 ; WX 556 ; N B ; B 65 0 615 750 ;
-C 67 ; WX 556 ; N C ; B 99 -18 630 768 ;
-C 68 ; WX 611 ; N D ; B 72 0 662 750 ;
-C 69 ; WX 500 ; N E ; B 64 0 617 750 ;
-C 70 ; WX 500 ; N F ; B 73 0 629 750 ;
-C 71 ; WX 611 ; N G ; B 99 -18 664 768 ;
-C 72 ; WX 611 ; N H ; B 68 0 703 750 ;
-C 73 ; WX 278 ; N I ; B 69 0 368 750 ;
-C 74 ; WX 444 ; N J ; B 36 -18 543 750 ;
-C 75 ; WX 556 ; N K ; B 68 0 697 750 ;
-C 76 ; WX 500 ; N L ; B 68 0 491 750 ;
-C 77 ; WX 778 ; N M ; B 67 0 871 750 ;
-C 78 ; WX 611 ; N N ; B 68 0 702 750 ;
-C 79 ; WX 611 ; N O ; B 105 -18 664 768 ;
-C 80 ; WX 556 ; N P ; B 68 0 651 750 ;
-C 81 ; WX 611 ; N Q ; B 105 -71 664 768 ;
-C 82 ; WX 611 ; N R ; B 66 0 671 750 ;
-C 83 ; WX 556 ; N S ; B 85 -18 613 768 ;
-C 84 ; WX 500 ; N T ; B 153 0 643 750 ;
-C 85 ; WX 611 ; N U ; B 105 -18 703 750 ;
-C 86 ; WX 556 ; N V ; B 180 0 695 750 ;
-C 87 ; WX 833 ; N W ; B 167 0 969 750 ;
-C 88 ; WX 556 ; N X ; B 11 0 698 750 ;
-C 89 ; WX 556 ; N Y ; B 171 0 704 750 ;
-C 90 ; WX 500 ; N Z ; B 33 0 618 750 ;
-C 91 ; WX 333 ; N bracketleft ; B 61 -94 439 750 ;
-C 92 ; WX 250 ; N backslash ; B 70 0 340 750 ;
-C 93 ; WX 333 ; N bracketright ; B 33 -94 411 750 ;
-C 94 ; WX 500 ; N asciicircum ; B 89 326 569 750 ;
-C 95 ; WX 500 ; N underscore ; B -27 -125 484 -75 ;
-C 96 ; WX 278 ; N quoteleft ; B 181 495 360 766 ;
-C 97 ; WX 500 ; N a ; B 68 -15 525 579 ;
-C 98 ; WX 500 ; N b ; B 64 -15 534 750 ;
-C 99 ; WX 444 ; N c ; B 79 -15 496 579 ;
-C 100 ; WX 500 ; N d ; B 83 -15 592 750 ;
-C 101 ; WX 500 ; N e ; B 88 -15 530 579 ;
-C 102 ; WX 278 ; N f ; B 71 0 416 750 ; L i fi ; L l fl ;
-C 103 ; WX 500 ; N g ; B 44 -190 553 579 ;
-C 104 ; WX 500 ; N h ; B 61 0 539 750 ;
-C 105 ; WX 278 ; N i ; B 74 0 363 750 ;
-C 106 ; WX 278 ; N j ; B -9 -192 368 750 ;
-C 107 ; WX 444 ; N k ; B 48 0 563 750 ;
-C 108 ; WX 278 ; N l ; B 74 0 363 750 ;
-C 109 ; WX 778 ; N m ; B 66 0 812 579 ;
-C 110 ; WX 500 ; N n ; B 61 0 539 579 ;
-C 111 ; WX 500 ; N o ; B 88 -15 531 579 ;
-C 112 ; WX 500 ; N p ; B 18 -189 528 579 ;
-C 113 ; WX 500 ; N q ; B 80 -188 550 579 ;
-C 114 ; WX 333 ; N r ; B 60 0 441 574 ;
-C 115 ; WX 444 ; N s ; B 56 -15 498 579 ;
-C 116 ; WX 278 ; N t ; B 83 -7 372 719 ;
-C 117 ; WX 500 ; N u ; B 78 -15 551 564 ;
-C 118 ; WX 444 ; N v ; B 130 0 554 564 ;
-C 119 ; WX 667 ; N w ; B 127 0 765 564 ;
-C 120 ; WX 444 ; N x ; B 8 0 553 564 ;
-C 121 ; WX 444 ; N y ; B 36 -195 549 564 ;
-C 122 ; WX 389 ; N z ; B 23 0 487 564 ;
-C 123 ; WX 274 ; N braceleft ; B 37 -92 399 750 ;
-C 124 ; WX 250 ; N bar ; B 22 -250 334 750 ;
-C 125 ; WX 274 ; N braceright ; B 14 -94 375 750 ;
-C 126 ; WX 500 ; N asciitilde ; B 74 153 536 359 ;
-C 161 ; WX 333 ; N exclamdown ; B 66 -170 355 579 ;
-C 162 ; WX 500 ; N cent ; B 103 -122 521 671 ;
-C 163 ; WX 500 ; N sterling ; B 52 -15 603 768 ;
-C 164 ; WX 167 ; N fraction ; B -169 0 488 738 ;
-C 165 ; WX 500 ; N yen ; B 89 0 677 750 ;
-C 166 ; WX 500 ; N florin ; B -28 -185 651 763 ;
-C 167 ; WX 500 ; N section ; B 48 -183 572 768 ;
-C 168 ; WX 500 ; N currency ; B 38 58 594 560 ;
-C 169 ; WX 250 ; N quotesingle ; B 165 468 342 739 ;
-C 170 ; WX 500 ; N quotedblleft ; B 192 495 568 766 ;
-C 171 ; WX 500 ; N guillemotleft ; B 117 62 514 447 ;
-C 172 ; WX 278 ; N guilsinglleft ; B 101 62 310 447 ;
-C 173 ; WX 278 ; N guilsinglright ; B 76 62 285 447 ;
-C 174 ; WX 500 ; N fi ; B 60 0 605 750 ;
-C 175 ; WX 500 ; N fl ; B 60 0 602 750 ;
-C 177 ; WX 500 ; N endash ; B 55 259 578 369 ;
-C 178 ; WX 500 ; N dagger ; B 127 -155 577 768 ;
-C 179 ; WX 500 ; N daggerdbl ; B 51 -161 579 768 ;
-C 180 ; WX 333 ; N periodcentered ; B 140 183 300 315 ;
-C 182 ; WX 550 ; N paragraph ; B 139 -116 685 750 ;
-C 183 ; WX 420 ; N bullet ; B 97 186 482 562 ;
-C 184 ; WX 278 ; N quotesinglbase ; B 58 -138 235 132 ;
-C 185 ; WX 500 ; N quotedblbase ; B 67 -138 441 132 ;
-C 186 ; WX 500 ; N quotedblright ; B 197 479 572 750 ;
-C 187 ; WX 500 ; N guillemotright ; B 94 62 491 447 ;
-C 188 ; WX 1000 ; N ellipsis ; B 101 0 927 132 ;
-C 189 ; WX 1111 ; N perthousand ; B 128 -18 1141 748 ;
-C 191 ; WX 500 ; N questiondown ; B 54 -190 476 579 ;
-C 193 ; WX 333 ; N grave ; B 166 629 384 775 ;
-C 194 ; WX 333 ; N acute ; B 217 629 497 775 ;
-C 195 ; WX 333 ; N circumflex ; B 127 644 480 790 ;
-C 196 ; WX 333 ; N tilde ; B 119 636 512 764 ;
-C 197 ; WX 333 ; N macron ; B 136 666 497 740 ;
-C 198 ; WX 333 ; N breve ; B 161 635 501 780 ;
-C 199 ; WX 333 ; N dotaccent ; B 240 644 391 759 ;
-C 200 ; WX 333 ; N dieresis ; B 142 644 489 759 ;
-C 202 ; WX 333 ; N ring ; B 215 632 432 845 ;
-C 203 ; WX 333 ; N cedilla ; B -4 -228 248 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B 118 634 613 780 ;
-C 206 ; WX 333 ; N ogonek ; B 63 -205 256 0 ;
-C 207 ; WX 333 ; N caron ; B 156 634 509 780 ;
-C 208 ; WX 1000 ; N emdash ; B 55 259 1078 369 ;
-C 225 ; WX 778 ; N AE ; B -22 0 909 750 ;
-C 227 ; WX 300 ; N ordfeminine ; B 127 412 421 768 ;
-C 232 ; WX 500 ; N Lslash ; B 49 0 497 750 ;
-C 233 ; WX 611 ; N Oslash ; B 34 -38 736 779 ;
-C 234 ; WX 833 ; N OE ; B 111 -18 951 768 ;
-C 235 ; WX 300 ; N ordmasculine ; B 133 412 417 768 ;
-C 241 ; WX 722 ; N ae ; B 69 -15 762 579 ;
-C 245 ; WX 278 ; N dotlessi ; B 74 0 324 564 ;
-C 248 ; WX 278 ; N lslash ; B 68 0 391 750 ;
-C 249 ; WX 500 ; N oslash ; B 2 -58 616 617 ;
-C 250 ; WX 722 ; N oe ; B 81 -15 763 579 ;
-C 251 ; WX 500 ; N germandbls ; B 60 -15 561 768 ;
-C -1 ; WX 500 ; N ecircumflex ; B 88 -15 560 770 ;
-C -1 ; WX 500 ; N edieresis ; B 88 -15 573 759 ;
-C -1 ; WX 500 ; N aacute ; B 68 -15 581 775 ;
-C -1 ; WX 830 ; N registered ; B 93 -18 897 768 ;
-C -1 ; WX 278 ; N icircumflex ; B 74 0 439 770 ;
-C -1 ; WX 500 ; N udieresis ; B 78 -15 573 759 ;
-C -1 ; WX 500 ; N ograve ; B 88 -15 531 775 ;
-C -1 ; WX 500 ; N uacute ; B 78 -15 581 775 ;
-C -1 ; WX 500 ; N ucircumflex ; B 78 -15 562 780 ;
-C -1 ; WX 556 ; N Aacute ; B 9 0 648 961 ;
-C -1 ; WX 278 ; N igrave ; B 74 0 357 775 ;
-C -1 ; WX 278 ; N Icircumflex ; B 69 0 488 956 ;
-C -1 ; WX 444 ; N ccedilla ; B 66 -228 496 579 ;
-C -1 ; WX 500 ; N adieresis ; B 68 -15 573 759 ;
-C -1 ; WX 500 ; N Ecircumflex ; B 64 0 617 956 ;
-C -1 ; WX 444 ; N scaron ; B 56 -15 551 760 ;
-C -1 ; WX 500 ; N thorn ; B 18 -189 529 750 ;
-C -1 ; WX 860 ; N trademark ; B 144 346 933 750 ;
-C -1 ; WX 500 ; N egrave ; B 88 -15 530 775 ;
-C -1 ; WX 300 ; N threesuperior ; B 96 290 416 751 ;
-C -1 ; WX 389 ; N zcaron ; B 23 0 533 760 ;
-C -1 ; WX 500 ; N atilde ; B 68 -15 592 744 ;
-C -1 ; WX 500 ; N aring ; B 68 -15 525 835 ;
-C -1 ; WX 500 ; N ocircumflex ; B 88 -15 560 770 ;
-C -1 ; WX 500 ; N Edieresis ; B 64 0 617 945 ;
-C -1 ; WX 750 ; N threequarters ; B 96 0 816 751 ;
-C -1 ; WX 444 ; N ydieresis ; B 36 -195 549 759 ;
-C -1 ; WX 444 ; N yacute ; B 36 -195 553 775 ;
-C -1 ; WX 278 ; N iacute ; B 74 0 470 775 ;
-C -1 ; WX 556 ; N Acircumflex ; B 9 0 617 956 ;
-C -1 ; WX 611 ; N Uacute ; B 105 -18 703 961 ;
-C -1 ; WX 500 ; N eacute ; B 88 -15 581 775 ;
-C -1 ; WX 611 ; N Ograve ; B 105 -18 664 961 ;
-C -1 ; WX 500 ; N agrave ; B 68 -15 525 775 ;
-C -1 ; WX 611 ; N Udieresis ; B 105 -18 703 945 ;
-C -1 ; WX 500 ; N acircumflex ; B 68 -15 560 770 ;
-C -1 ; WX 278 ; N Igrave ; B 69 0 396 961 ;
-C -1 ; WX 300 ; N twosuperior ; B 77 300 425 752 ;
-C -1 ; WX 611 ; N Ugrave ; B 105 -18 703 961 ;
-C -1 ; WX 750 ; N onequarter ; B 131 0 788 750 ;
-C -1 ; WX 611 ; N Ucircumflex ; B 105 -18 703 956 ;
-C -1 ; WX 556 ; N Scaron ; B 85 -18 656 946 ;
-C -1 ; WX 278 ; N Idieresis ; B 69 0 502 945 ;
-C -1 ; WX 278 ; N idieresis ; B 74 0 462 759 ;
-C -1 ; WX 500 ; N Egrave ; B 64 0 617 961 ;
-C -1 ; WX 611 ; N Oacute ; B 105 -18 675 961 ;
-C -1 ; WX 500 ; N divide ; B 67 6 540 492 ;
-C -1 ; WX 556 ; N Atilde ; B 9 0 660 930 ;
-C -1 ; WX 556 ; N Aring ; B 9 0 575 991 ;
-C -1 ; WX 611 ; N Odieresis ; B 105 -18 668 945 ;
-C -1 ; WX 556 ; N Adieresis ; B 9 0 641 945 ;
-C -1 ; WX 611 ; N Ntilde ; B 68 0 702 930 ;
-C -1 ; WX 500 ; N Zcaron ; B 33 0 628 946 ;
-C -1 ; WX 556 ; N Thorn ; B 68 0 625 750 ;
-C -1 ; WX 278 ; N Iacute ; B 69 0 509 961 ;
-C -1 ; WX 500 ; N plusminus ; B 23 -15 556 513 ;
-C -1 ; WX 500 ; N multiply ; B 48 22 560 476 ;
-C -1 ; WX 500 ; N Eacute ; B 64 0 620 961 ;
-C -1 ; WX 556 ; N Ydieresis ; B 171 0 704 945 ;
-C -1 ; WX 300 ; N onesuperior ; B 180 300 410 750 ;
-C -1 ; WX 500 ; N ugrave ; B 78 -15 551 775 ;
-C -1 ; WX 500 ; N logicalnot ; B 88 105 560 401 ;
-C -1 ; WX 500 ; N ntilde ; B 61 0 592 744 ;
-C -1 ; WX 611 ; N Otilde ; B 105 -18 687 930 ;
-C -1 ; WX 500 ; N otilde ; B 88 -15 592 744 ;
-C -1 ; WX 556 ; N Ccedilla ; B 99 -228 630 768 ;
-C -1 ; WX 556 ; N Agrave ; B 9 0 547 961 ;
-C -1 ; WX 750 ; N onehalf ; B 108 0 813 750 ;
-C -1 ; WX 611 ; N Eth ; B 72 0 662 750 ;
-C -1 ; WX 400 ; N degree ; B 174 450 481 750 ;
-C -1 ; WX 556 ; N Yacute ; B 171 0 704 961 ;
-C -1 ; WX 611 ; N Ocircumflex ; B 105 -18 664 956 ;
-C -1 ; WX 500 ; N oacute ; B 88 -15 581 775 ;
-C -1 ; WX 500 ; N mu ; B 18 -189 551 564 ;
-C -1 ; WX 500 ; N minus ; B 67 194 540 304 ;
-C -1 ; WX 500 ; N eth ; B 88 -15 540 779 ;
-C -1 ; WX 500 ; N odieresis ; B 88 -15 573 759 ;
-C -1 ; WX 830 ; N copyright ; B 93 -18 897 768 ;
-C -1 ; WX 250 ; N brokenbar ; B 38 -175 318 675 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 88
-
-KPX A y -18
-KPX A w -18
-KPX A v -18
-KPX A quoteright -55
-KPX A Y -55
-KPX A W -37
-KPX A V -37
-KPX A T -55
-
-KPX F period -111
-KPX F comma -111
-KPX F A -37
-
-KPX L y -37
-KPX L quoteright -92
-KPX L Y -92
-KPX L W -74
-KPX L V -74
-KPX L T -74
-
-KPX P period -129
-KPX P comma -129
-KPX P A -37
-
-KPX R Y -18
-KPX R T -18
-
-KPX T y -55
-KPX T w -74
-KPX T u -74
-KPX T semicolon -74
-KPX T s -74
-KPX T r -74
-KPX T period -92
-KPX T o -74
-KPX T i -18
-KPX T hyphen -55
-KPX T e -74
-KPX T comma -92
-KPX T colon -74
-KPX T c -74
-KPX T a -74
-KPX T A -55
-
-KPX V u -18
-KPX V semicolon -18
-KPX V r -18
-KPX V period -92
-KPX V o -18
-KPX V hyphen -18
-KPX V e -18
-KPX V comma -92
-KPX V colon -18
-KPX V a -18
-KPX V A -37
-
-KPX W period -74
-KPX W o -18
-KPX W hyphen -18
-KPX W e -18
-KPX W comma -74
-KPX W a -18
-KPX W A -18
-
-KPX Y v -18
-KPX Y u -37
-KPX Y semicolon -37
-KPX Y q -55
-KPX Y period -111
-KPX Y p -37
-KPX Y o -55
-KPX Y i -18
-KPX Y hyphen -74
-KPX Y e -55
-KPX Y comma -111
-KPX Y colon -37
-KPX Y a -55
-KPX Y A -55
-
-KPX f quoteright 18
-
-KPX quoteleft quoteleft -18
-
-KPX quoteright s -55
-KPX quoteright quoteright -18
-
-KPX r z 20
-KPX r y 18
-KPX r x 20
-KPX r w 18
-KPX r v 18
-KPX r period -74
-KPX r hyphen -37
-KPX r comma -74
-
-KPX v period -55
-KPX v comma -55
-
-KPX w period -37
-KPX w comma -37
-
-KPX y period -55
-KPX y comma -55
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 152 186 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 137 166 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 152 186 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 152 186 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 143 146 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 147 166 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 124 186 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 119 166 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 124 186 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 124 186 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 13 186 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 8 166 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 13 186 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 13 186 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 174 166 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 179 186 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 174 166 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 179 186 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 179 186 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 174 166 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 147 166 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 179 186 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 174 166 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 179 186 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 179 186 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 152 186 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 152 186 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 119 166 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 84 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 80 -20 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 84 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 84 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 67 -10 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 80 -20 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 84 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 80 -20 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 84 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 84 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -41 -20 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 80 -20 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 80 -20 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 80 -20 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 42 -20 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 84 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 82 -10 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 84 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 84 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 56 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 56 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 24 -20 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Helvetica-Condensed-Oblique.afm b/blt3.0.1/library/afm/Helvetica-Condensed-Oblique.afm
deleted file mode 100644
index 44da649..0000000
--- a/blt3.0.1/library/afm/Helvetica-Condensed-Oblique.afm
+++ /dev/null
@@ -1,421 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1991 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Wed Sep 4 17:59:46 1991
-Comment UniqueID 36200
-Comment VMusage 7672 41967
-FontName Helvetica-Condensed-Oblique
-FullName Helvetica Condensed Oblique
-FamilyName Helvetica
-Weight Medium
-ItalicAngle -12
-IsFixedPitch false
-FontBBox -174 -250 1118 990
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.003
-Notice Copyright (c) 1985, 1987, 1991 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 750
-XHeight 556
-Ascender 750
-Descender -188
-StartCharMetrics 228
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 121 0 371 750 ;
-C 34 ; WX 250 ; N quotedbl ; B 153 513 364 739 ;
-C 35 ; WX 500 ; N numbersign ; B 33 0 621 750 ;
-C 36 ; WX 500 ; N dollar ; B 69 -116 569 815 ;
-C 37 ; WX 833 ; N percent ; B 164 -15 803 750 ;
-C 38 ; WX 667 ; N ampersand ; B 111 -18 648 750 ;
-C 39 ; WX 222 ; N quoteright ; B 171 504 317 750 ;
-C 40 ; WX 333 ; N parenleft ; B 115 -215 443 750 ;
-C 41 ; WX 333 ; N parenright ; B 3 -215 331 750 ;
-C 42 ; WX 500 ; N asterisk ; B 229 455 537 750 ;
-C 43 ; WX 500 ; N plus ; B 91 0 518 505 ;
-C 44 ; WX 250 ; N comma ; B 49 -146 192 100 ;
-C 45 ; WX 333 ; N hyphen ; B 103 275 364 358 ;
-C 46 ; WX 250 ; N period ; B 80 0 192 100 ;
-C 47 ; WX 278 ; N slash ; B -19 -27 450 750 ;
-C 48 ; WX 500 ; N zero ; B 98 -15 563 750 ;
-C 49 ; WX 500 ; N one ; B 190 0 476 750 ;
-C 50 ; WX 500 ; N two ; B 44 0 562 750 ;
-C 51 ; WX 500 ; N three ; B 73 -15 552 750 ;
-C 52 ; WX 500 ; N four ; B 68 0 543 750 ;
-C 53 ; WX 500 ; N five ; B 75 -15 575 735 ;
-C 54 ; WX 500 ; N six ; B 91 -15 566 750 ;
-C 55 ; WX 500 ; N seven ; B 116 0 612 735 ;
-C 56 ; WX 500 ; N eight ; B 83 -15 559 750 ;
-C 57 ; WX 500 ; N nine ; B 91 -15 566 750 ;
-C 58 ; WX 250 ; N colon ; B 80 0 287 547 ;
-C 59 ; WX 250 ; N semicolon ; B 49 -146 287 547 ;
-C 60 ; WX 500 ; N less ; B 89 -10 569 518 ;
-C 61 ; WX 500 ; N equal ; B 70 124 539 384 ;
-C 62 ; WX 500 ; N greater ; B 40 -10 520 518 ;
-C 63 ; WX 500 ; N question ; B 169 0 586 750 ;
-C 64 ; WX 800 ; N at ; B 106 -15 863 750 ;
-C 65 ; WX 556 ; N A ; B 11 0 546 750 ;
-C 66 ; WX 556 ; N B ; B 80 0 610 750 ;
-C 67 ; WX 556 ; N C ; B 106 -18 624 765 ;
-C 68 ; WX 611 ; N D ; B 82 0 653 750 ;
-C 69 ; WX 500 ; N E ; B 74 0 608 750 ;
-C 70 ; WX 444 ; N F ; B 74 0 585 750 ;
-C 71 ; WX 611 ; N G ; B 109 -18 646 765 ;
-C 72 ; WX 611 ; N H ; B 79 0 691 750 ;
-C 73 ; WX 278 ; N I ; B 98 0 340 750 ;
-C 74 ; WX 444 ; N J ; B 52 -15 527 750 ;
-C 75 ; WX 556 ; N K ; B 79 0 698 750 ;
-C 76 ; WX 500 ; N L ; B 83 0 488 750 ;
-C 77 ; WX 778 ; N M ; B 76 0 861 750 ;
-C 78 ; WX 611 ; N N ; B 77 0 693 750 ;
-C 79 ; WX 611 ; N O ; B 116 -18 658 765 ;
-C 80 ; WX 556 ; N P ; B 86 0 641 750 ;
-C 81 ; WX 611 ; N Q ; B 116 -34 659 765 ;
-C 82 ; WX 611 ; N R ; B 86 0 655 750 ;
-C 83 ; WX 556 ; N S ; B 86 -18 611 765 ;
-C 84 ; WX 500 ; N T ; B 158 0 645 750 ;
-C 85 ; WX 611 ; N U ; B 114 -18 690 750 ;
-C 86 ; WX 556 ; N V ; B 170 0 704 750 ;
-C 87 ; WX 833 ; N W ; B 176 0 975 750 ;
-C 88 ; WX 556 ; N X ; B 17 0 692 750 ;
-C 89 ; WX 556 ; N Y ; B 170 0 705 750 ;
-C 90 ; WX 500 ; N Z ; B 28 0 627 750 ;
-C 91 ; WX 333 ; N bracketleft ; B 56 -209 434 750 ;
-C 92 ; WX 250 ; N backslash ; B 128 0 281 750 ;
-C 93 ; WX 333 ; N bracketright ; B 14 -209 392 750 ;
-C 94 ; WX 500 ; N asciicircum ; B 141 333 502 750 ;
-C 95 ; WX 500 ; N underscore ; B -27 -125 484 -75 ;
-C 96 ; WX 222 ; N quoteleft ; B 175 521 321 767 ;
-C 97 ; WX 444 ; N a ; B 55 -15 465 571 ;
-C 98 ; WX 500 ; N b ; B 75 -15 525 750 ;
-C 99 ; WX 444 ; N c ; B 85 -15 488 571 ;
-C 100 ; WX 500 ; N d ; B 88 -15 583 750 ;
-C 101 ; WX 444 ; N e ; B 86 -15 476 571 ;
-C 102 ; WX 278 ; N f ; B 93 0 418 752 ; L i fi ; L l fl ;
-C 103 ; WX 500 ; N g ; B 53 -189 544 571 ;
-C 104 ; WX 500 ; N h ; B 73 0 524 750 ;
-C 105 ; WX 222 ; N i ; B 72 0 310 750 ;
-C 106 ; WX 222 ; N j ; B -27 -190 313 750 ;
-C 107 ; WX 444 ; N k ; B 69 0 552 750 ;
-C 108 ; WX 222 ; N l ; B 72 0 310 750 ;
-C 109 ; WX 778 ; N m ; B 76 0 799 571 ;
-C 110 ; WX 500 ; N n ; B 73 0 524 571 ;
-C 111 ; WX 500 ; N o ; B 96 -15 524 571 ;
-C 112 ; WX 500 ; N p ; B 32 -188 524 571 ;
-C 113 ; WX 500 ; N q ; B 100 -184 544 571 ;
-C 114 ; WX 333 ; N r ; B 81 0 441 563 ;
-C 115 ; WX 444 ; N s ; B 68 -15 473 571 ;
-C 116 ; WX 278 ; N t ; B 101 0 375 707 ;
-C 117 ; WX 500 ; N u ; B 99 -15 542 556 ;
-C 118 ; WX 444 ; N v ; B 131 0 549 556 ;
-C 119 ; WX 667 ; N w ; B 137 0 767 556 ;
-C 120 ; WX 444 ; N x ; B 9 0 548 556 ;
-C 121 ; WX 444 ; N y ; B -13 -190 543 556 ;
-C 122 ; WX 389 ; N z ; B 24 0 482 556 ;
-C 123 ; WX 274 ; N braceleft ; B 77 -95 425 750 ;
-C 124 ; WX 250 ; N bar ; B 40 -250 316 750 ;
-C 125 ; WX 274 ; N braceright ; B -12 -95 337 750 ;
-C 126 ; WX 500 ; N asciitilde ; B 89 166 520 345 ;
-C 161 ; WX 333 ; N exclamdown ; B 83 -179 333 571 ;
-C 162 ; WX 500 ; N cent ; B 94 -137 499 667 ;
-C 163 ; WX 500 ; N sterling ; B 40 -15 589 750 ;
-C 164 ; WX 167 ; N fraction ; B -174 0 500 750 ;
-C 165 ; WX 500 ; N yen ; B 88 0 677 750 ;
-C 166 ; WX 500 ; N florin ; B -28 -192 645 750 ;
-C 167 ; WX 500 ; N section ; B 51 -208 552 750 ;
-C 168 ; WX 500 ; N currency ; B 51 50 576 553 ;
-C 169 ; WX 250 ; N quotesingle ; B 208 513 308 739 ;
-C 170 ; WX 389 ; N quotedblleft ; B 173 521 490 767 ;
-C 171 ; WX 500 ; N guillemotleft ; B 145 125 520 495 ;
-C 172 ; WX 278 ; N guilsinglleft ; B 124 125 320 495 ;
-C 173 ; WX 278 ; N guilsinglright ; B 90 125 286 495 ;
-C 174 ; WX 500 ; N fi ; B 93 0 584 752 ;
-C 175 ; WX 500 ; N fl ; B 93 0 584 752 ;
-C 177 ; WX 500 ; N endash ; B 58 275 573 345 ;
-C 178 ; WX 500 ; N dagger ; B 137 -176 573 750 ;
-C 179 ; WX 500 ; N daggerdbl ; B 50 -176 572 750 ;
-C 180 ; WX 250 ; N periodcentered ; B 123 204 236 304 ;
-C 182 ; WX 440 ; N paragraph ; B 113 -116 550 750 ;
-C 183 ; WX 333 ; N bullet ; B 91 222 401 529 ;
-C 184 ; WX 222 ; N quotesinglbase ; B 33 -146 179 100 ;
-C 185 ; WX 389 ; N quotedblbase ; B 31 -146 348 100 ;
-C 186 ; WX 389 ; N quotedblright ; B 169 504 486 750 ;
-C 187 ; WX 500 ; N guillemotright ; B 112 125 487 495 ;
-C 188 ; WX 1000 ; N ellipsis ; B 121 0 899 100 ;
-C 189 ; WX 1111 ; N perthousand ; B 157 -16 1118 750 ;
-C 191 ; WX 500 ; N questiondown ; B 33 -190 450 559 ;
-C 193 ; WX 333 ; N grave ; B 198 624 366 765 ;
-C 194 ; WX 333 ; N acute ; B 233 624 461 765 ;
-C 195 ; WX 333 ; N circumflex ; B 154 624 446 765 ;
-C 196 ; WX 333 ; N tilde ; B 132 633 496 749 ;
-C 197 ; WX 333 ; N macron ; B 150 657 475 715 ;
-C 198 ; WX 333 ; N breve ; B 172 629 484 765 ;
-C 199 ; WX 250 ; N dotaccent ; B 224 650 324 750 ;
-C 200 ; WX 333 ; N dieresis ; B 190 650 440 750 ;
-C 202 ; WX 250 ; N ring ; B 169 593 377 796 ;
-C 203 ; WX 333 ; N cedilla ; B 23 -224 255 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B 194 624 603 765 ;
-C 206 ; WX 333 ; N ogonek ; B -23 -191 188 13 ;
-C 207 ; WX 333 ; N caron ; B 184 624 476 765 ;
-C 208 ; WX 1000 ; N emdash ; B 58 275 1073 345 ;
-C 225 ; WX 833 ; N AE ; B 0 0 944 750 ;
-C 227 ; WX 300 ; N ordfeminine ; B 129 413 392 765 ;
-C 232 ; WX 500 ; N Lslash ; B 39 0 488 750 ;
-C 233 ; WX 611 ; N Oslash ; B 25 -43 738 796 ;
-C 234 ; WX 833 ; N OE ; B 113 -18 946 765 ;
-C 235 ; WX 300 ; N ordmasculine ; B 138 413 413 765 ;
-C 241 ; WX 667 ; N ae ; B 50 -15 711 571 ;
-C 245 ; WX 222 ; N dotlessi ; B 72 0 269 556 ;
-C 248 ; WX 222 ; N lslash ; B 59 0 347 750 ;
-C 249 ; WX 500 ; N oslash ; B 19 -46 591 582 ;
-C 250 ; WX 722 ; N oe ; B 81 -15 758 571 ;
-C 251 ; WX 500 ; N germandbls ; B 71 -5 548 765 ;
-C -1 ; WX 444 ; N ecircumflex ; B 86 -15 502 765 ;
-C -1 ; WX 444 ; N edieresis ; B 86 -15 496 750 ;
-C -1 ; WX 444 ; N aacute ; B 55 -15 517 765 ;
-C -1 ; WX 800 ; N registered ; B 79 -18 881 765 ;
-C -1 ; WX 222 ; N icircumflex ; B 72 0 391 765 ;
-C -1 ; WX 500 ; N udieresis ; B 99 -15 542 750 ;
-C -1 ; WX 500 ; N ograve ; B 96 -15 524 765 ;
-C -1 ; WX 500 ; N uacute ; B 99 -15 545 765 ;
-C -1 ; WX 500 ; N ucircumflex ; B 99 -15 542 765 ;
-C -1 ; WX 556 ; N Aacute ; B 11 0 614 959 ;
-C -1 ; WX 222 ; N igrave ; B 72 0 311 765 ;
-C -1 ; WX 278 ; N Icircumflex ; B 98 0 460 959 ;
-C -1 ; WX 444 ; N ccedilla ; B 79 -224 488 571 ;
-C -1 ; WX 444 ; N adieresis ; B 55 -15 496 750 ;
-C -1 ; WX 500 ; N Ecircumflex ; B 74 0 608 959 ;
-C -1 ; WX 444 ; N scaron ; B 68 -15 532 765 ;
-C -1 ; WX 500 ; N thorn ; B 32 -188 523 750 ;
-C -1 ; WX 750 ; N trademark ; B 147 329 878 750 ;
-C -1 ; WX 444 ; N egrave ; B 86 -15 476 765 ;
-C -1 ; WX 300 ; N threesuperior ; B 102 291 409 750 ;
-C -1 ; WX 389 ; N zcaron ; B 24 0 504 765 ;
-C -1 ; WX 444 ; N atilde ; B 55 -15 552 749 ;
-C -1 ; WX 444 ; N aring ; B 55 -15 465 826 ;
-C -1 ; WX 500 ; N ocircumflex ; B 96 -15 530 765 ;
-C -1 ; WX 500 ; N Edieresis ; B 74 0 608 944 ;
-C -1 ; WX 750 ; N threequarters ; B 106 0 831 750 ;
-C -1 ; WX 444 ; N ydieresis ; B -13 -190 543 750 ;
-C -1 ; WX 444 ; N yacute ; B -13 -190 543 765 ;
-C -1 ; WX 222 ; N iacute ; B 72 0 406 765 ;
-C -1 ; WX 556 ; N Acircumflex ; B 11 0 599 959 ;
-C -1 ; WX 611 ; N Uacute ; B 114 -18 690 959 ;
-C -1 ; WX 444 ; N eacute ; B 86 -15 517 765 ;
-C -1 ; WX 611 ; N Ograve ; B 116 -18 658 959 ;
-C -1 ; WX 444 ; N agrave ; B 55 -15 465 765 ;
-C -1 ; WX 611 ; N Udieresis ; B 114 -18 690 944 ;
-C -1 ; WX 444 ; N acircumflex ; B 55 -15 502 765 ;
-C -1 ; WX 278 ; N Igrave ; B 98 0 380 959 ;
-C -1 ; WX 300 ; N twosuperior ; B 83 300 413 750 ;
-C -1 ; WX 611 ; N Ugrave ; B 114 -18 690 959 ;
-C -1 ; WX 750 ; N onequarter ; B 143 0 817 750 ;
-C -1 ; WX 611 ; N Ucircumflex ; B 114 -18 690 959 ;
-C -1 ; WX 556 ; N Scaron ; B 86 -18 629 959 ;
-C -1 ; WX 278 ; N Idieresis ; B 98 0 455 944 ;
-C -1 ; WX 222 ; N idieresis ; B 72 0 385 750 ;
-C -1 ; WX 500 ; N Egrave ; B 74 0 608 959 ;
-C -1 ; WX 611 ; N Oacute ; B 116 -18 658 959 ;
-C -1 ; WX 500 ; N divide ; B 91 3 518 505 ;
-C -1 ; WX 556 ; N Atilde ; B 11 0 649 943 ;
-C -1 ; WX 556 ; N Aring ; B 11 0 571 990 ;
-C -1 ; WX 611 ; N Odieresis ; B 116 -18 658 944 ;
-C -1 ; WX 556 ; N Adieresis ; B 11 0 594 944 ;
-C -1 ; WX 611 ; N Ntilde ; B 77 0 693 943 ;
-C -1 ; WX 500 ; N Zcaron ; B 28 0 627 959 ;
-C -1 ; WX 556 ; N Thorn ; B 86 0 618 750 ;
-C -1 ; WX 278 ; N Iacute ; B 98 0 475 959 ;
-C -1 ; WX 500 ; N plusminus ; B 44 0 531 505 ;
-C -1 ; WX 500 ; N multiply ; B 65 48 544 461 ;
-C -1 ; WX 500 ; N Eacute ; B 74 0 608 959 ;
-C -1 ; WX 556 ; N Ydieresis ; B 170 0 705 944 ;
-C -1 ; WX 300 ; N onesuperior ; B 200 300 392 750 ;
-C -1 ; WX 500 ; N ugrave ; B 99 -15 542 765 ;
-C -1 ; WX 500 ; N logicalnot ; B 111 117 539 384 ;
-C -1 ; WX 500 ; N ntilde ; B 73 0 580 749 ;
-C -1 ; WX 611 ; N Otilde ; B 116 -18 676 943 ;
-C -1 ; WX 500 ; N otilde ; B 96 -15 580 749 ;
-C -1 ; WX 556 ; N Ccedilla ; B 106 -224 624 765 ;
-C -1 ; WX 556 ; N Agrave ; B 11 0 546 959 ;
-C -1 ; WX 750 ; N onehalf ; B 91 0 777 750 ;
-C -1 ; WX 611 ; N Eth ; B 82 0 650 750 ;
-C -1 ; WX 400 ; N degree ; B 174 450 481 750 ;
-C -1 ; WX 556 ; N Yacute ; B 170 0 705 959 ;
-C -1 ; WX 611 ; N Ocircumflex ; B 116 -18 658 959 ;
-C -1 ; WX 500 ; N oacute ; B 96 -15 545 765 ;
-C -1 ; WX 500 ; N mu ; B 35 -189 540 556 ;
-C -1 ; WX 500 ; N minus ; B 91 219 518 289 ;
-C -1 ; WX 500 ; N eth ; B 96 -15 525 831 ;
-C -1 ; WX 500 ; N odieresis ; B 96 -15 524 750 ;
-C -1 ; WX 800 ; N copyright ; B 79 -18 880 765 ;
-C -1 ; WX 250 ; N brokenbar ; B 56 -175 300 675 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 90
-
-KPX A y -18
-KPX A w -18
-KPX A v -18
-KPX A quoteright -55
-KPX A Y -55
-KPX A W -37
-KPX A V -37
-KPX A T -55
-
-KPX F period -111
-KPX F comma -111
-KPX F A -37
-
-KPX L y -37
-KPX L quoteright -92
-KPX L Y -92
-KPX L W -74
-KPX L V -74
-KPX L T -74
-
-KPX P period -129
-KPX P comma -129
-KPX P A -37
-
-KPX R Y -18
-KPX R T -18
-
-KPX T y -55
-KPX T w -74
-KPX T u -74
-KPX T semicolon -74
-KPX T s -74
-KPX T r -74
-KPX T period -92
-KPX T o -74
-KPX T i -18
-KPX T hyphen -55
-KPX T e -74
-KPX T comma -92
-KPX T colon -74
-KPX T c -74
-KPX T a -74
-KPX T A -55
-
-KPX V u -18
-KPX V semicolon -18
-KPX V r -18
-KPX V period -92
-KPX V o -18
-KPX V hyphen -18
-KPX V e -18
-KPX V comma -92
-KPX V colon -18
-KPX V a -18
-KPX V A -37
-
-KPX W period -74
-KPX W o -18
-KPX W hyphen -18
-KPX W e -18
-KPX W comma -74
-KPX W a -18
-KPX W A -18
-
-KPX Y v -18
-KPX Y u -37
-KPX Y semicolon -37
-KPX Y q -55
-KPX Y period -111
-KPX Y p -37
-KPX Y o -55
-KPX Y i -18
-KPX Y hyphen -74
-KPX Y e -55
-KPX Y comma -111
-KPX Y colon -37
-KPX Y a -55
-KPX Y A -55
-
-KPX f quoteright 18
-
-KPX quoteleft quoteleft -18
-
-KPX quoteright s -55
-KPX quoteright quoteright -18
-
-KPX r z 20
-KPX r y 18
-KPX r x 20
-KPX r w 18
-KPX r v 18
-KPX r period -74
-KPX r hyphen -37
-KPX r f 20
-KPX r comma -74
-KPX r c -20
-
-KPX v period -55
-KPX v comma -55
-
-KPX w period -37
-KPX w comma -37
-
-KPX y period -55
-KPX y comma -55
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 153 194 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 153 194 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 153 194 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 153 194 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 194 194 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 153 194 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 125 194 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 125 194 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 125 194 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 125 194 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 14 194 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 14 194 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 14 194 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 14 194 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 180 194 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 180 194 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 180 194 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 180 194 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 180 194 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 180 194 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 153 194 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 180 194 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 180 194 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 180 194 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 180 194 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 153 194 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 153 194 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 125 194 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 56 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 56 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 56 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 56 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 88 30 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 56 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 56 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 56 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 56 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 56 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -55 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -55 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -55 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -55 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 84 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 56 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 84 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 84 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 84 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 84 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 56 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 56 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 28 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Helvetica-Condensed.afm b/blt3.0.1/library/afm/Helvetica-Condensed.afm
deleted file mode 100644
index f22040c..0000000
--- a/blt3.0.1/library/afm/Helvetica-Condensed.afm
+++ /dev/null
@@ -1,421 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1991 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Wed Sep 4 17:26:31 1991
-Comment UniqueID 36179
-Comment VMusage 26415 33307
-FontName Helvetica-Condensed
-FullName Helvetica Condensed Medium
-FamilyName Helvetica
-Weight Medium
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -174 -250 1071 990
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.003
-Notice Copyright (c) 1985, 1987, 1991 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 750
-XHeight 556
-Ascender 750
-Descender -188
-StartCharMetrics 228
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 121 0 212 750 ;
-C 34 ; WX 250 ; N quotedbl ; B 44 513 207 739 ;
-C 35 ; WX 500 ; N numbersign ; B 5 0 495 750 ;
-C 36 ; WX 500 ; N dollar ; B 35 -116 465 815 ;
-C 37 ; WX 833 ; N percent ; B 55 -15 756 750 ;
-C 38 ; WX 667 ; N ampersand ; B 75 -18 620 750 ;
-C 39 ; WX 222 ; N quoteright ; B 64 504 158 750 ;
-C 40 ; WX 333 ; N parenleft ; B 76 -215 289 750 ;
-C 41 ; WX 333 ; N parenright ; B 44 -215 257 750 ;
-C 42 ; WX 500 ; N asterisk ; B 96 455 405 750 ;
-C 43 ; WX 500 ; N plus ; B 44 0 457 505 ;
-C 44 ; WX 250 ; N comma ; B 80 -146 171 100 ;
-C 45 ; WX 333 ; N hyphen ; B 45 275 288 358 ;
-C 46 ; WX 250 ; N period ; B 80 0 171 100 ;
-C 47 ; WX 278 ; N slash ; B -13 -27 291 750 ;
-C 48 ; WX 500 ; N zero ; B 46 -15 455 750 ;
-C 49 ; WX 500 ; N one ; B 74 0 317 750 ;
-C 50 ; WX 500 ; N two ; B 44 0 447 750 ;
-C 51 ; WX 500 ; N three ; B 38 -15 447 750 ;
-C 52 ; WX 500 ; N four ; B 28 0 451 750 ;
-C 53 ; WX 500 ; N five ; B 43 -15 446 735 ;
-C 54 ; WX 500 ; N six ; B 43 -15 458 750 ;
-C 55 ; WX 500 ; N seven ; B 44 0 456 735 ;
-C 56 ; WX 500 ; N eight ; B 46 -15 454 750 ;
-C 57 ; WX 500 ; N nine ; B 43 -15 458 750 ;
-C 58 ; WX 250 ; N colon ; B 80 0 171 547 ;
-C 59 ; WX 250 ; N semicolon ; B 80 -146 171 547 ;
-C 60 ; WX 500 ; N less ; B 42 -10 459 518 ;
-C 61 ; WX 500 ; N equal ; B 44 124 457 384 ;
-C 62 ; WX 500 ; N greater ; B 42 -10 459 518 ;
-C 63 ; WX 500 ; N question ; B 60 0 462 750 ;
-C 64 ; WX 800 ; N at ; B 36 -15 764 750 ;
-C 65 ; WX 556 ; N A ; B 11 0 546 750 ;
-C 66 ; WX 556 ; N B ; B 80 0 503 750 ;
-C 67 ; WX 556 ; N C ; B 53 -18 503 765 ;
-C 68 ; WX 611 ; N D ; B 82 0 548 750 ;
-C 69 ; WX 500 ; N E ; B 74 0 451 750 ;
-C 70 ; WX 444 ; N F ; B 74 0 426 750 ;
-C 71 ; WX 611 ; N G ; B 54 -18 532 765 ;
-C 72 ; WX 611 ; N H ; B 79 0 532 750 ;
-C 73 ; WX 278 ; N I ; B 98 0 181 750 ;
-C 74 ; WX 444 ; N J ; B 21 -15 368 750 ;
-C 75 ; WX 556 ; N K ; B 79 0 546 750 ;
-C 76 ; WX 500 ; N L ; B 83 0 472 750 ;
-C 77 ; WX 778 ; N M ; B 76 0 702 750 ;
-C 78 ; WX 611 ; N N ; B 77 0 534 750 ;
-C 79 ; WX 611 ; N O ; B 59 -18 553 765 ;
-C 80 ; WX 556 ; N P ; B 86 0 519 750 ;
-C 81 ; WX 611 ; N Q ; B 59 -34 582 765 ;
-C 82 ; WX 611 ; N R ; B 86 0 565 750 ;
-C 83 ; WX 556 ; N S ; B 51 -18 505 765 ;
-C 84 ; WX 500 ; N T ; B 15 0 486 750 ;
-C 85 ; WX 611 ; N U ; B 81 -18 531 750 ;
-C 86 ; WX 556 ; N V ; B 11 0 545 750 ;
-C 87 ; WX 833 ; N W ; B 17 0 816 750 ;
-C 88 ; WX 556 ; N X ; B 17 0 539 750 ;
-C 89 ; WX 556 ; N Y ; B 11 0 546 750 ;
-C 90 ; WX 500 ; N Z ; B 28 0 473 750 ;
-C 91 ; WX 333 ; N bracketleft ; B 100 -209 275 750 ;
-C 92 ; WX 250 ; N backslash ; B -31 0 281 750 ;
-C 93 ; WX 333 ; N bracketright ; B 58 -209 233 750 ;
-C 94 ; WX 500 ; N asciicircum ; B 70 333 431 750 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 222 ; N quoteleft ; B 64 521 158 767 ;
-C 97 ; WX 444 ; N a ; B 31 -15 417 571 ;
-C 98 ; WX 500 ; N b ; B 75 -15 447 750 ;
-C 99 ; WX 444 ; N c ; B 44 -15 405 571 ;
-C 100 ; WX 500 ; N d ; B 48 -15 424 750 ;
-C 101 ; WX 444 ; N e ; B 43 -15 395 571 ;
-C 102 ; WX 278 ; N f ; B 12 0 259 752 ; L i fi ; L l fl ;
-C 103 ; WX 500 ; N g ; B 45 -189 426 571 ;
-C 104 ; WX 500 ; N h ; B 73 0 428 750 ;
-C 105 ; WX 222 ; N i ; B 72 0 151 750 ;
-C 106 ; WX 222 ; N j ; B 13 -190 154 750 ;
-C 107 ; WX 444 ; N k ; B 69 0 439 750 ;
-C 108 ; WX 222 ; N l ; B 72 0 151 750 ;
-C 109 ; WX 778 ; N m ; B 76 0 703 571 ;
-C 110 ; WX 500 ; N n ; B 73 0 428 571 ;
-C 111 ; WX 500 ; N o ; B 51 -15 449 571 ;
-C 112 ; WX 500 ; N p ; B 72 -188 447 571 ;
-C 113 ; WX 500 ; N q ; B 55 -184 426 571 ;
-C 114 ; WX 333 ; N r ; B 81 0 322 563 ;
-C 115 ; WX 444 ; N s ; B 43 -15 400 571 ;
-C 116 ; WX 278 ; N t ; B 9 0 257 707 ;
-C 117 ; WX 500 ; N u ; B 77 -15 424 556 ;
-C 118 ; WX 444 ; N v ; B 13 0 431 556 ;
-C 119 ; WX 667 ; N w ; B 19 0 649 556 ;
-C 120 ; WX 444 ; N x ; B 9 0 436 556 ;
-C 121 ; WX 444 ; N y ; B 5 -190 425 556 ;
-C 122 ; WX 389 ; N z ; B 24 0 366 556 ;
-C 123 ; WX 274 ; N braceleft ; B 7 -95 266 750 ;
-C 124 ; WX 250 ; N bar ; B 93 -250 157 750 ;
-C 125 ; WX 274 ; N braceright ; B 8 -95 267 750 ;
-C 126 ; WX 500 ; N asciitilde ; B 44 166 457 345 ;
-C 161 ; WX 333 ; N exclamdown ; B 121 -179 212 571 ;
-C 162 ; WX 500 ; N cent ; B 58 -137 418 667 ;
-C 163 ; WX 500 ; N sterling ; B 30 -15 485 750 ;
-C 164 ; WX 167 ; N fraction ; B -174 0 341 750 ;
-C 165 ; WX 500 ; N yen ; B -17 0 518 750 ;
-C 166 ; WX 500 ; N florin ; B 10 -192 488 750 ;
-C 167 ; WX 500 ; N section ; B 35 -208 466 750 ;
-C 168 ; WX 500 ; N currency ; B 24 50 475 553 ;
-C 169 ; WX 250 ; N quotesingle ; B 99 513 151 739 ;
-C 170 ; WX 389 ; N quotedblleft ; B 62 521 327 767 ;
-C 171 ; WX 500 ; N guillemotleft ; B 85 125 415 495 ;
-C 172 ; WX 278 ; N guilsinglleft ; B 64 125 215 495 ;
-C 173 ; WX 278 ; N guilsinglright ; B 63 125 214 495 ;
-C 174 ; WX 500 ; N fi ; B 12 0 427 752 ;
-C 175 ; WX 500 ; N fl ; B 12 0 425 752 ;
-C 177 ; WX 500 ; N endash ; B 0 275 500 345 ;
-C 178 ; WX 500 ; N dagger ; B 40 -176 461 750 ;
-C 179 ; WX 500 ; N daggerdbl ; B 39 -176 462 750 ;
-C 180 ; WX 250 ; N periodcentered ; B 80 204 171 304 ;
-C 182 ; WX 440 ; N paragraph ; B 0 -116 391 750 ;
-C 183 ; WX 333 ; N bullet ; B 15 222 318 529 ;
-C 184 ; WX 222 ; N quotesinglbase ; B 64 -146 158 100 ;
-C 185 ; WX 389 ; N quotedblbase ; B 62 -146 327 100 ;
-C 186 ; WX 389 ; N quotedblright ; B 62 504 327 750 ;
-C 187 ; WX 500 ; N guillemotright ; B 85 125 415 495 ;
-C 188 ; WX 1000 ; N ellipsis ; B 121 0 878 100 ;
-C 189 ; WX 1111 ; N perthousand ; B 47 -16 1071 750 ;
-C 191 ; WX 500 ; N questiondown ; B 38 -190 440 559 ;
-C 193 ; WX 333 ; N grave ; B 35 624 233 765 ;
-C 194 ; WX 333 ; N acute ; B 100 624 298 765 ;
-C 195 ; WX 333 ; N circumflex ; B 21 624 313 765 ;
-C 196 ; WX 333 ; N tilde ; B -3 633 337 749 ;
-C 197 ; WX 333 ; N macron ; B 10 657 323 715 ;
-C 198 ; WX 333 ; N breve ; B 12 629 321 765 ;
-C 199 ; WX 250 ; N dotaccent ; B 86 650 165 750 ;
-C 200 ; WX 333 ; N dieresis ; B 52 650 281 750 ;
-C 202 ; WX 250 ; N ring ; B 23 593 227 796 ;
-C 203 ; WX 333 ; N cedilla ; B 66 -224 281 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B 61 624 440 765 ;
-C 206 ; WX 333 ; N ogonek ; B 0 -191 208 13 ;
-C 207 ; WX 333 ; N caron ; B 21 624 313 765 ;
-C 208 ; WX 1000 ; N emdash ; B 0 275 1000 345 ;
-C 225 ; WX 833 ; N AE ; B 0 0 785 750 ;
-C 227 ; WX 300 ; N ordfeminine ; B 25 413 276 765 ;
-C 232 ; WX 500 ; N Lslash ; B -13 0 472 750 ;
-C 233 ; WX 611 ; N Oslash ; B 29 -43 573 796 ;
-C 234 ; WX 833 ; N OE ; B 56 -18 787 765 ;
-C 235 ; WX 300 ; N ordmasculine ; B 20 413 279 765 ;
-C 241 ; WX 667 ; N ae ; B 26 -15 630 571 ;
-C 245 ; WX 222 ; N dotlessi ; B 72 0 151 556 ;
-C 248 ; WX 222 ; N lslash ; B -8 0 231 750 ;
-C 249 ; WX 500 ; N oslash ; B 25 -46 472 582 ;
-C 250 ; WX 722 ; N oe ; B 40 -15 676 571 ;
-C 251 ; WX 500 ; N germandbls ; B 71 -5 445 765 ;
-C -1 ; WX 444 ; N ecircumflex ; B 43 -15 395 765 ;
-C -1 ; WX 444 ; N edieresis ; B 43 -15 395 750 ;
-C -1 ; WX 444 ; N aacute ; B 31 -15 417 765 ;
-C -1 ; WX 800 ; N registered ; B 8 -18 792 765 ;
-C -1 ; WX 222 ; N icircumflex ; B -34 0 258 765 ;
-C -1 ; WX 500 ; N udieresis ; B 77 -15 424 750 ;
-C -1 ; WX 500 ; N ograve ; B 51 -15 449 765 ;
-C -1 ; WX 500 ; N uacute ; B 77 -15 424 765 ;
-C -1 ; WX 500 ; N ucircumflex ; B 77 -15 424 765 ;
-C -1 ; WX 556 ; N Aacute ; B 11 0 546 959 ;
-C -1 ; WX 222 ; N igrave ; B -20 0 178 765 ;
-C -1 ; WX 278 ; N Icircumflex ; B -6 0 286 959 ;
-C -1 ; WX 444 ; N ccedilla ; B 44 -224 405 571 ;
-C -1 ; WX 444 ; N adieresis ; B 31 -15 417 750 ;
-C -1 ; WX 500 ; N Ecircumflex ; B 74 0 451 959 ;
-C -1 ; WX 444 ; N scaron ; B 43 -15 400 765 ;
-C -1 ; WX 500 ; N thorn ; B 72 -188 447 750 ;
-C -1 ; WX 750 ; N trademark ; B 0 329 719 750 ;
-C -1 ; WX 444 ; N egrave ; B 43 -15 395 765 ;
-C -1 ; WX 300 ; N threesuperior ; B 17 291 283 750 ;
-C -1 ; WX 389 ; N zcaron ; B 24 0 366 765 ;
-C -1 ; WX 444 ; N atilde ; B 31 -15 417 749 ;
-C -1 ; WX 444 ; N aring ; B 31 -15 417 826 ;
-C -1 ; WX 500 ; N ocircumflex ; B 51 -15 449 765 ;
-C -1 ; WX 500 ; N Edieresis ; B 74 0 451 944 ;
-C -1 ; WX 750 ; N threequarters ; B 21 0 730 750 ;
-C -1 ; WX 444 ; N ydieresis ; B 5 -190 425 750 ;
-C -1 ; WX 444 ; N yacute ; B 5 -190 425 765 ;
-C -1 ; WX 222 ; N iacute ; B 45 0 243 765 ;
-C -1 ; WX 556 ; N Acircumflex ; B 11 0 546 959 ;
-C -1 ; WX 611 ; N Uacute ; B 81 -18 531 959 ;
-C -1 ; WX 444 ; N eacute ; B 43 -15 395 765 ;
-C -1 ; WX 611 ; N Ograve ; B 59 -18 553 959 ;
-C -1 ; WX 444 ; N agrave ; B 31 -15 417 765 ;
-C -1 ; WX 611 ; N Udieresis ; B 81 -18 531 944 ;
-C -1 ; WX 444 ; N acircumflex ; B 31 -15 417 765 ;
-C -1 ; WX 278 ; N Igrave ; B 8 0 206 959 ;
-C -1 ; WX 300 ; N twosuperior ; B 19 300 281 750 ;
-C -1 ; WX 611 ; N Ugrave ; B 81 -18 531 959 ;
-C -1 ; WX 750 ; N onequarter ; B 34 0 716 750 ;
-C -1 ; WX 611 ; N Ucircumflex ; B 81 -18 531 959 ;
-C -1 ; WX 556 ; N Scaron ; B 51 -18 505 959 ;
-C -1 ; WX 278 ; N Idieresis ; B 25 0 254 944 ;
-C -1 ; WX 222 ; N idieresis ; B -3 0 226 750 ;
-C -1 ; WX 500 ; N Egrave ; B 74 0 451 959 ;
-C -1 ; WX 611 ; N Oacute ; B 59 -18 553 959 ;
-C -1 ; WX 500 ; N divide ; B 44 3 457 505 ;
-C -1 ; WX 556 ; N Atilde ; B 11 0 546 943 ;
-C -1 ; WX 556 ; N Aring ; B 11 0 546 990 ;
-C -1 ; WX 611 ; N Odieresis ; B 59 -18 553 944 ;
-C -1 ; WX 556 ; N Adieresis ; B 11 0 546 944 ;
-C -1 ; WX 611 ; N Ntilde ; B 77 0 534 943 ;
-C -1 ; WX 500 ; N Zcaron ; B 28 0 473 959 ;
-C -1 ; WX 556 ; N Thorn ; B 86 0 519 750 ;
-C -1 ; WX 278 ; N Iacute ; B 73 0 271 959 ;
-C -1 ; WX 500 ; N plusminus ; B 44 0 457 505 ;
-C -1 ; WX 500 ; N multiply ; B 44 48 457 461 ;
-C -1 ; WX 500 ; N Eacute ; B 74 0 451 959 ;
-C -1 ; WX 556 ; N Ydieresis ; B 11 0 546 944 ;
-C -1 ; WX 300 ; N onesuperior ; B 67 300 233 750 ;
-C -1 ; WX 500 ; N ugrave ; B 77 -15 424 765 ;
-C -1 ; WX 500 ; N logicalnot ; B 44 117 457 384 ;
-C -1 ; WX 500 ; N ntilde ; B 73 0 428 749 ;
-C -1 ; WX 611 ; N Otilde ; B 59 -18 553 943 ;
-C -1 ; WX 500 ; N otilde ; B 51 -15 449 749 ;
-C -1 ; WX 556 ; N Ccedilla ; B 53 -224 503 765 ;
-C -1 ; WX 556 ; N Agrave ; B 11 0 546 959 ;
-C -1 ; WX 750 ; N onehalf ; B 42 0 709 750 ;
-C -1 ; WX 611 ; N Eth ; B 9 0 548 750 ;
-C -1 ; WX 400 ; N degree ; B 50 450 350 750 ;
-C -1 ; WX 556 ; N Yacute ; B 11 0 546 959 ;
-C -1 ; WX 611 ; N Ocircumflex ; B 59 -18 553 959 ;
-C -1 ; WX 500 ; N oacute ; B 51 -15 449 765 ;
-C -1 ; WX 500 ; N mu ; B 75 -189 422 556 ;
-C -1 ; WX 500 ; N minus ; B 44 219 457 289 ;
-C -1 ; WX 500 ; N eth ; B 51 -15 449 831 ;
-C -1 ; WX 500 ; N odieresis ; B 51 -15 449 750 ;
-C -1 ; WX 800 ; N copyright ; B 8 -18 792 765 ;
-C -1 ; WX 250 ; N brokenbar ; B 93 -175 157 675 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 90
-
-KPX A y -18
-KPX A w -18
-KPX A v -18
-KPX A quoteright -55
-KPX A Y -55
-KPX A W -37
-KPX A V -37
-KPX A T -55
-
-KPX F period -111
-KPX F comma -111
-KPX F A -37
-
-KPX L y -37
-KPX L quoteright -92
-KPX L Y -92
-KPX L W -74
-KPX L V -74
-KPX L T -74
-
-KPX P period -129
-KPX P comma -129
-KPX P A -37
-
-KPX R Y -18
-KPX R T -18
-
-KPX T y -55
-KPX T w -74
-KPX T u -74
-KPX T semicolon -74
-KPX T s -74
-KPX T r -74
-KPX T period -92
-KPX T o -74
-KPX T i -18
-KPX T hyphen -55
-KPX T e -74
-KPX T comma -92
-KPX T colon -74
-KPX T c -74
-KPX T a -74
-KPX T A -55
-
-KPX V u -18
-KPX V semicolon -18
-KPX V r -18
-KPX V period -92
-KPX V o -18
-KPX V hyphen -18
-KPX V e -18
-KPX V comma -92
-KPX V colon -18
-KPX V a -18
-KPX V A -37
-
-KPX W period -74
-KPX W o -18
-KPX W hyphen -18
-KPX W e -18
-KPX W comma -74
-KPX W a -18
-KPX W A -18
-
-KPX Y v -18
-KPX Y u -37
-KPX Y semicolon -37
-KPX Y q -55
-KPX Y period -111
-KPX Y p -37
-KPX Y o -55
-KPX Y i -18
-KPX Y hyphen -74
-KPX Y e -55
-KPX Y comma -111
-KPX Y colon -37
-KPX Y a -55
-KPX Y A -55
-
-KPX f quoteright 18
-
-KPX quoteleft quoteleft -18
-
-KPX quoteright s -55
-KPX quoteright quoteright -18
-
-KPX r z 20
-KPX r y 18
-KPX r x 20
-KPX r w 18
-KPX r v 18
-KPX r period -74
-KPX r hyphen -37
-KPX r f 20
-KPX r comma -74
-KPX r c -20
-
-KPX v period -55
-KPX v comma -55
-
-KPX w period -37
-KPX w comma -37
-
-KPX y period -55
-KPX y comma -55
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 112 194 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 112 194 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 112 194 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 112 194 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 153 194 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 112 194 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 84 194 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 84 194 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 84 194 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 84 194 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute -27 194 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -27 194 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -27 194 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave -27 194 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 139 194 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 139 194 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 139 194 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 139 194 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 139 194 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 139 194 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 112 194 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 139 194 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 139 194 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 139 194 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 139 194 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 112 194 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 112 194 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 84 194 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 56 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 56 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 56 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 56 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 82 30 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 56 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 56 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 56 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 56 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 56 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -55 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -55 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -55 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -55 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 84 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 56 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 84 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 84 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 84 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 84 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 56 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 56 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 28 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Helvetica-Narrow-Bold.afm b/blt3.0.1/library/afm/Helvetica-Narrow-Bold.afm
deleted file mode 100644
index 3fdd6ef..0000000
--- a/blt3.0.1/library/afm/Helvetica-Narrow-Bold.afm
+++ /dev/null
@@ -1,571 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Thu Mar 15 11:47:27 1990
-Comment UniqueID 28398
-Comment VMusage 7614 43068
-FontName Helvetica-Narrow-Bold
-FullName Helvetica Narrow Bold
-FamilyName Helvetica
-Weight Bold
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -139 -228 822 962
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 718
-XHeight 532
-Ascender 718
-Descender -207
-StartCharMetrics 228
-C 32 ; WX 228 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 273 ; N exclam ; B 74 0 200 718 ;
-C 34 ; WX 389 ; N quotedbl ; B 80 447 308 718 ;
-C 35 ; WX 456 ; N numbersign ; B 15 0 441 698 ;
-C 36 ; WX 456 ; N dollar ; B 25 -115 429 775 ;
-C 37 ; WX 729 ; N percent ; B 23 -19 706 710 ;
-C 38 ; WX 592 ; N ampersand ; B 44 -19 575 718 ;
-C 39 ; WX 228 ; N quoteright ; B 57 445 171 718 ;
-C 40 ; WX 273 ; N parenleft ; B 29 -208 257 734 ;
-C 41 ; WX 273 ; N parenright ; B 16 -208 244 734 ;
-C 42 ; WX 319 ; N asterisk ; B 22 387 297 718 ;
-C 43 ; WX 479 ; N plus ; B 33 0 446 506 ;
-C 44 ; WX 228 ; N comma ; B 52 -168 175 146 ;
-C 45 ; WX 273 ; N hyphen ; B 22 215 251 345 ;
-C 46 ; WX 228 ; N period ; B 52 0 175 146 ;
-C 47 ; WX 228 ; N slash ; B -27 -19 255 737 ;
-C 48 ; WX 456 ; N zero ; B 26 -19 430 710 ;
-C 49 ; WX 456 ; N one ; B 57 0 310 710 ;
-C 50 ; WX 456 ; N two ; B 21 0 419 710 ;
-C 51 ; WX 456 ; N three ; B 22 -19 423 710 ;
-C 52 ; WX 456 ; N four ; B 22 0 431 710 ;
-C 53 ; WX 456 ; N five ; B 22 -19 423 698 ;
-C 54 ; WX 456 ; N six ; B 25 -19 426 710 ;
-C 55 ; WX 456 ; N seven ; B 20 0 433 698 ;
-C 56 ; WX 456 ; N eight ; B 26 -19 430 710 ;
-C 57 ; WX 456 ; N nine ; B 25 -19 428 710 ;
-C 58 ; WX 273 ; N colon ; B 75 0 198 512 ;
-C 59 ; WX 273 ; N semicolon ; B 75 -168 198 512 ;
-C 60 ; WX 479 ; N less ; B 31 -8 448 514 ;
-C 61 ; WX 479 ; N equal ; B 33 87 446 419 ;
-C 62 ; WX 479 ; N greater ; B 31 -8 448 514 ;
-C 63 ; WX 501 ; N question ; B 49 0 456 727 ;
-C 64 ; WX 800 ; N at ; B 97 -19 702 737 ;
-C 65 ; WX 592 ; N A ; B 16 0 576 718 ;
-C 66 ; WX 592 ; N B ; B 62 0 549 718 ;
-C 67 ; WX 592 ; N C ; B 36 -19 561 737 ;
-C 68 ; WX 592 ; N D ; B 62 0 562 718 ;
-C 69 ; WX 547 ; N E ; B 62 0 509 718 ;
-C 70 ; WX 501 ; N F ; B 62 0 481 718 ;
-C 71 ; WX 638 ; N G ; B 36 -19 585 737 ;
-C 72 ; WX 592 ; N H ; B 58 0 534 718 ;
-C 73 ; WX 228 ; N I ; B 52 0 175 718 ;
-C 74 ; WX 456 ; N J ; B 18 -18 397 718 ;
-C 75 ; WX 592 ; N K ; B 71 0 592 718 ;
-C 76 ; WX 501 ; N L ; B 62 0 478 718 ;
-C 77 ; WX 683 ; N M ; B 57 0 627 718 ;
-C 78 ; WX 592 ; N N ; B 57 0 536 718 ;
-C 79 ; WX 638 ; N O ; B 36 -19 602 737 ;
-C 80 ; WX 547 ; N P ; B 62 0 514 718 ;
-C 81 ; WX 638 ; N Q ; B 36 -52 604 737 ;
-C 82 ; WX 592 ; N R ; B 62 0 555 718 ;
-C 83 ; WX 547 ; N S ; B 32 -19 516 737 ;
-C 84 ; WX 501 ; N T ; B 11 0 490 718 ;
-C 85 ; WX 592 ; N U ; B 59 -19 534 718 ;
-C 86 ; WX 547 ; N V ; B 16 0 531 718 ;
-C 87 ; WX 774 ; N W ; B 13 0 762 718 ;
-C 88 ; WX 547 ; N X ; B 11 0 535 718 ;
-C 89 ; WX 547 ; N Y ; B 12 0 535 718 ;
-C 90 ; WX 501 ; N Z ; B 20 0 481 718 ;
-C 91 ; WX 273 ; N bracketleft ; B 52 -196 253 722 ;
-C 92 ; WX 228 ; N backslash ; B -27 -19 255 737 ;
-C 93 ; WX 273 ; N bracketright ; B 20 -196 221 722 ;
-C 94 ; WX 479 ; N asciicircum ; B 51 323 428 698 ;
-C 95 ; WX 456 ; N underscore ; B 0 -125 456 -75 ;
-C 96 ; WX 228 ; N quoteleft ; B 57 454 171 727 ;
-C 97 ; WX 456 ; N a ; B 24 -14 432 546 ;
-C 98 ; WX 501 ; N b ; B 50 -14 474 718 ;
-C 99 ; WX 456 ; N c ; B 28 -14 430 546 ;
-C 100 ; WX 501 ; N d ; B 28 -14 452 718 ;
-C 101 ; WX 456 ; N e ; B 19 -14 433 546 ;
-C 102 ; WX 273 ; N f ; B 8 0 261 727 ; L i fi ; L l fl ;
-C 103 ; WX 501 ; N g ; B 33 -217 453 546 ;
-C 104 ; WX 501 ; N h ; B 53 0 448 718 ;
-C 105 ; WX 228 ; N i ; B 57 0 171 725 ;
-C 106 ; WX 228 ; N j ; B 2 -214 171 725 ;
-C 107 ; WX 456 ; N k ; B 57 0 461 718 ;
-C 108 ; WX 228 ; N l ; B 57 0 171 718 ;
-C 109 ; WX 729 ; N m ; B 52 0 677 546 ;
-C 110 ; WX 501 ; N n ; B 53 0 448 546 ;
-C 111 ; WX 501 ; N o ; B 28 -14 474 546 ;
-C 112 ; WX 501 ; N p ; B 51 -207 474 546 ;
-C 113 ; WX 501 ; N q ; B 28 -207 453 546 ;
-C 114 ; WX 319 ; N r ; B 52 0 306 546 ;
-C 115 ; WX 456 ; N s ; B 25 -14 426 546 ;
-C 116 ; WX 273 ; N t ; B 8 -6 253 676 ;
-C 117 ; WX 501 ; N u ; B 54 -14 447 532 ;
-C 118 ; WX 456 ; N v ; B 11 0 445 532 ;
-C 119 ; WX 638 ; N w ; B 8 0 631 532 ;
-C 120 ; WX 456 ; N x ; B 12 0 444 532 ;
-C 121 ; WX 456 ; N y ; B 8 -214 442 532 ;
-C 122 ; WX 410 ; N z ; B 16 0 394 532 ;
-C 123 ; WX 319 ; N braceleft ; B 39 -196 299 722 ;
-C 124 ; WX 230 ; N bar ; B 69 -19 161 737 ;
-C 125 ; WX 319 ; N braceright ; B 20 -196 280 722 ;
-C 126 ; WX 479 ; N asciitilde ; B 50 163 429 343 ;
-C 161 ; WX 273 ; N exclamdown ; B 74 -186 200 532 ;
-C 162 ; WX 456 ; N cent ; B 28 -118 430 628 ;
-C 163 ; WX 456 ; N sterling ; B 23 -16 444 718 ;
-C 164 ; WX 137 ; N fraction ; B -139 -19 276 710 ;
-C 165 ; WX 456 ; N yen ; B -7 0 463 698 ;
-C 166 ; WX 456 ; N florin ; B -8 -210 423 737 ;
-C 167 ; WX 456 ; N section ; B 28 -184 428 727 ;
-C 168 ; WX 456 ; N currency ; B -2 76 458 636 ;
-C 169 ; WX 195 ; N quotesingle ; B 57 447 138 718 ;
-C 170 ; WX 410 ; N quotedblleft ; B 52 454 358 727 ;
-C 171 ; WX 456 ; N guillemotleft ; B 72 76 384 484 ;
-C 172 ; WX 273 ; N guilsinglleft ; B 68 76 205 484 ;
-C 173 ; WX 273 ; N guilsinglright ; B 68 76 205 484 ;
-C 174 ; WX 501 ; N fi ; B 8 0 444 727 ;
-C 175 ; WX 501 ; N fl ; B 8 0 444 727 ;
-C 177 ; WX 456 ; N endash ; B 0 227 456 333 ;
-C 178 ; WX 456 ; N dagger ; B 30 -171 426 718 ;
-C 179 ; WX 456 ; N daggerdbl ; B 30 -171 426 718 ;
-C 180 ; WX 228 ; N periodcentered ; B 48 172 180 334 ;
-C 182 ; WX 456 ; N paragraph ; B -7 -191 442 700 ;
-C 183 ; WX 287 ; N bullet ; B 8 194 279 524 ;
-C 184 ; WX 228 ; N quotesinglbase ; B 57 -146 171 127 ;
-C 185 ; WX 410 ; N quotedblbase ; B 52 -146 358 127 ;
-C 186 ; WX 410 ; N quotedblright ; B 52 445 358 718 ;
-C 187 ; WX 456 ; N guillemotright ; B 72 76 384 484 ;
-C 188 ; WX 820 ; N ellipsis ; B 75 0 745 146 ;
-C 189 ; WX 820 ; N perthousand ; B -2 -19 822 710 ;
-C 191 ; WX 501 ; N questiondown ; B 45 -195 452 532 ;
-C 193 ; WX 273 ; N grave ; B -19 604 184 750 ;
-C 194 ; WX 273 ; N acute ; B 89 604 292 750 ;
-C 195 ; WX 273 ; N circumflex ; B -8 604 281 750 ;
-C 196 ; WX 273 ; N tilde ; B -14 610 287 737 ;
-C 197 ; WX 273 ; N macron ; B -5 604 278 678 ;
-C 198 ; WX 273 ; N breve ; B -2 604 275 750 ;
-C 199 ; WX 273 ; N dotaccent ; B 85 614 189 729 ;
-C 200 ; WX 273 ; N dieresis ; B 5 614 268 729 ;
-C 202 ; WX 273 ; N ring ; B 48 568 225 776 ;
-C 203 ; WX 273 ; N cedilla ; B 5 -228 201 0 ;
-C 205 ; WX 273 ; N hungarumlaut ; B 7 604 399 750 ;
-C 206 ; WX 273 ; N ogonek ; B 58 -228 249 0 ;
-C 207 ; WX 273 ; N caron ; B -8 604 281 750 ;
-C 208 ; WX 820 ; N emdash ; B 0 227 820 333 ;
-C 225 ; WX 820 ; N AE ; B 4 0 782 718 ;
-C 227 ; WX 303 ; N ordfeminine ; B 18 276 285 737 ;
-C 232 ; WX 501 ; N Lslash ; B -16 0 478 718 ;
-C 233 ; WX 638 ; N Oslash ; B 27 -27 610 745 ;
-C 234 ; WX 820 ; N OE ; B 30 -19 788 737 ;
-C 235 ; WX 299 ; N ordmasculine ; B 5 276 295 737 ;
-C 241 ; WX 729 ; N ae ; B 24 -14 704 546 ;
-C 245 ; WX 228 ; N dotlessi ; B 57 0 171 532 ;
-C 248 ; WX 228 ; N lslash ; B -15 0 243 718 ;
-C 249 ; WX 501 ; N oslash ; B 18 -29 483 560 ;
-C 250 ; WX 774 ; N oe ; B 28 -14 748 546 ;
-C 251 ; WX 501 ; N germandbls ; B 57 -14 475 731 ;
-C -1 ; WX 501 ; N Zcaron ; B 20 0 481 936 ;
-C -1 ; WX 456 ; N ccedilla ; B 28 -228 430 546 ;
-C -1 ; WX 456 ; N ydieresis ; B 8 -214 442 729 ;
-C -1 ; WX 456 ; N atilde ; B 24 -14 432 737 ;
-C -1 ; WX 228 ; N icircumflex ; B -30 0 259 750 ;
-C -1 ; WX 273 ; N threesuperior ; B 7 271 267 710 ;
-C -1 ; WX 456 ; N ecircumflex ; B 19 -14 433 750 ;
-C -1 ; WX 501 ; N thorn ; B 51 -208 474 718 ;
-C -1 ; WX 456 ; N egrave ; B 19 -14 433 750 ;
-C -1 ; WX 273 ; N twosuperior ; B 7 283 266 710 ;
-C -1 ; WX 456 ; N eacute ; B 19 -14 433 750 ;
-C -1 ; WX 501 ; N otilde ; B 28 -14 474 737 ;
-C -1 ; WX 592 ; N Aacute ; B 16 0 576 936 ;
-C -1 ; WX 501 ; N ocircumflex ; B 28 -14 474 750 ;
-C -1 ; WX 456 ; N yacute ; B 8 -214 442 750 ;
-C -1 ; WX 501 ; N udieresis ; B 54 -14 447 729 ;
-C -1 ; WX 684 ; N threequarters ; B 13 -19 655 710 ;
-C -1 ; WX 456 ; N acircumflex ; B 24 -14 432 750 ;
-C -1 ; WX 592 ; N Eth ; B -4 0 562 718 ;
-C -1 ; WX 456 ; N edieresis ; B 19 -14 433 729 ;
-C -1 ; WX 501 ; N ugrave ; B 54 -14 447 750 ;
-C -1 ; WX 820 ; N trademark ; B 36 306 784 718 ;
-C -1 ; WX 501 ; N ograve ; B 28 -14 474 750 ;
-C -1 ; WX 456 ; N scaron ; B 25 -14 426 750 ;
-C -1 ; WX 228 ; N Idieresis ; B -17 0 246 915 ;
-C -1 ; WX 501 ; N uacute ; B 54 -14 447 750 ;
-C -1 ; WX 456 ; N agrave ; B 24 -14 432 750 ;
-C -1 ; WX 501 ; N ntilde ; B 53 0 448 737 ;
-C -1 ; WX 456 ; N aring ; B 24 -14 432 776 ;
-C -1 ; WX 410 ; N zcaron ; B 16 0 394 750 ;
-C -1 ; WX 228 ; N Icircumflex ; B -30 0 259 936 ;
-C -1 ; WX 592 ; N Ntilde ; B 57 0 536 923 ;
-C -1 ; WX 501 ; N ucircumflex ; B 54 -14 447 750 ;
-C -1 ; WX 547 ; N Ecircumflex ; B 62 0 509 936 ;
-C -1 ; WX 228 ; N Iacute ; B 52 0 270 936 ;
-C -1 ; WX 592 ; N Ccedilla ; B 36 -228 561 737 ;
-C -1 ; WX 638 ; N Odieresis ; B 36 -19 602 915 ;
-C -1 ; WX 547 ; N Scaron ; B 32 -19 516 936 ;
-C -1 ; WX 547 ; N Edieresis ; B 62 0 509 915 ;
-C -1 ; WX 228 ; N Igrave ; B -41 0 175 936 ;
-C -1 ; WX 456 ; N adieresis ; B 24 -14 432 729 ;
-C -1 ; WX 638 ; N Ograve ; B 36 -19 602 936 ;
-C -1 ; WX 547 ; N Egrave ; B 62 0 509 936 ;
-C -1 ; WX 547 ; N Ydieresis ; B 12 0 535 915 ;
-C -1 ; WX 604 ; N registered ; B -9 -19 613 737 ;
-C -1 ; WX 638 ; N Otilde ; B 36 -19 602 923 ;
-C -1 ; WX 684 ; N onequarter ; B 21 -19 628 710 ;
-C -1 ; WX 592 ; N Ugrave ; B 59 -19 534 936 ;
-C -1 ; WX 592 ; N Ucircumflex ; B 59 -19 534 936 ;
-C -1 ; WX 547 ; N Thorn ; B 62 0 514 718 ;
-C -1 ; WX 479 ; N divide ; B 33 -42 446 548 ;
-C -1 ; WX 592 ; N Atilde ; B 16 0 576 923 ;
-C -1 ; WX 592 ; N Uacute ; B 59 -19 534 936 ;
-C -1 ; WX 638 ; N Ocircumflex ; B 36 -19 602 936 ;
-C -1 ; WX 479 ; N logicalnot ; B 33 108 446 419 ;
-C -1 ; WX 592 ; N Aring ; B 16 0 576 962 ;
-C -1 ; WX 228 ; N idieresis ; B -17 0 246 729 ;
-C -1 ; WX 228 ; N iacute ; B 57 0 270 750 ;
-C -1 ; WX 456 ; N aacute ; B 24 -14 432 750 ;
-C -1 ; WX 479 ; N plusminus ; B 33 0 446 506 ;
-C -1 ; WX 479 ; N multiply ; B 33 1 447 505 ;
-C -1 ; WX 592 ; N Udieresis ; B 59 -19 534 915 ;
-C -1 ; WX 479 ; N minus ; B 33 197 446 309 ;
-C -1 ; WX 273 ; N onesuperior ; B 21 283 194 710 ;
-C -1 ; WX 547 ; N Eacute ; B 62 0 509 936 ;
-C -1 ; WX 592 ; N Acircumflex ; B 16 0 576 936 ;
-C -1 ; WX 604 ; N copyright ; B -9 -19 614 737 ;
-C -1 ; WX 592 ; N Agrave ; B 16 0 576 936 ;
-C -1 ; WX 501 ; N odieresis ; B 28 -14 474 729 ;
-C -1 ; WX 501 ; N oacute ; B 28 -14 474 750 ;
-C -1 ; WX 328 ; N degree ; B 47 426 281 712 ;
-C -1 ; WX 228 ; N igrave ; B -41 0 171 750 ;
-C -1 ; WX 501 ; N mu ; B 54 -207 447 532 ;
-C -1 ; WX 638 ; N Oacute ; B 36 -19 602 936 ;
-C -1 ; WX 501 ; N eth ; B 28 -14 474 737 ;
-C -1 ; WX 592 ; N Adieresis ; B 16 0 576 915 ;
-C -1 ; WX 547 ; N Yacute ; B 12 0 535 936 ;
-C -1 ; WX 230 ; N brokenbar ; B 69 -19 161 737 ;
-C -1 ; WX 684 ; N onehalf ; B 21 -19 651 710 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 209
-
-KPX A y -24
-KPX A w -24
-KPX A v -32
-KPX A u -24
-KPX A Y -89
-KPX A W -48
-KPX A V -65
-KPX A U -40
-KPX A T -73
-KPX A Q -32
-KPX A O -32
-KPX A G -40
-KPX A C -32
-
-KPX B U -7
-KPX B A -24
-
-KPX D period -24
-KPX D comma -24
-KPX D Y -56
-KPX D W -32
-KPX D V -32
-KPX D A -32
-
-KPX F period -81
-KPX F comma -81
-KPX F a -15
-KPX F A -65
-
-KPX J u -15
-KPX J period -15
-KPX J comma -15
-KPX J A -15
-
-KPX K y -32
-KPX K u -24
-KPX K o -28
-KPX K e -11
-KPX K O -24
-
-KPX L y -24
-KPX L quoteright -114
-KPX L quotedblright -114
-KPX L Y -97
-KPX L W -65
-KPX L V -89
-KPX L T -73
-
-KPX O period -32
-KPX O comma -32
-KPX O Y -56
-KPX O X -40
-KPX O W -40
-KPX O V -40
-KPX O T -32
-KPX O A -40
-
-KPX P period -97
-KPX P o -32
-KPX P e -24
-KPX P comma -97
-KPX P a -24
-KPX P A -81
-
-KPX Q period 16
-KPX Q comma 16
-KPX Q U -7
-
-KPX R Y -40
-KPX R W -32
-KPX R V -40
-KPX R U -15
-KPX R T -15
-KPX R O -15
-
-KPX T y -48
-KPX T w -48
-KPX T u -73
-KPX T semicolon -32
-KPX T r -65
-KPX T period -65
-KPX T o -65
-KPX T hyphen -97
-KPX T e -48
-KPX T comma -65
-KPX T colon -32
-KPX T a -65
-KPX T O -32
-KPX T A -73
-
-KPX U period -24
-KPX U comma -24
-KPX U A -40
-
-KPX V u -48
-KPX V semicolon -32
-KPX V period -97
-KPX V o -73
-KPX V hyphen -65
-KPX V e -40
-KPX V comma -97
-KPX V colon -32
-KPX V a -48
-KPX V O -40
-KPX V G -40
-KPX V A -65
-
-KPX W y -15
-KPX W u -36
-KPX W semicolon -7
-KPX W period -65
-KPX W o -48
-KPX W hyphen -32
-KPX W e -28
-KPX W comma -65
-KPX W colon -7
-KPX W a -32
-KPX W O -15
-KPX W A -48
-
-KPX Y u -81
-KPX Y semicolon -40
-KPX Y period -81
-KPX Y o -81
-KPX Y e -65
-KPX Y comma -81
-KPX Y colon -40
-KPX Y a -73
-KPX Y O -56
-KPX Y A -89
-
-KPX a y -15
-KPX a w -11
-KPX a v -11
-KPX a g -7
-
-KPX b y -15
-KPX b v -15
-KPX b u -15
-KPX b l -7
-
-KPX c y -7
-KPX c l -15
-KPX c k -15
-KPX c h -7
-
-KPX colon space -32
-
-KPX comma space -32
-KPX comma quoteright -97
-KPX comma quotedblright -97
-
-KPX d y -11
-KPX d w -11
-KPX d v -11
-KPX d d -7
-
-KPX e y -11
-KPX e x -11
-KPX e w -11
-KPX e v -11
-KPX e period 16
-KPX e comma 8
-
-KPX f quoteright 25
-KPX f quotedblright 25
-KPX f period -7
-KPX f o -15
-KPX f e -7
-KPX f comma -7
-
-KPX g g -7
-KPX g e 8
-
-KPX h y -15
-
-KPX k o -11
-
-KPX l y -11
-KPX l w -11
-
-KPX m y -24
-KPX m u -15
-
-KPX n y -15
-KPX n v -32
-KPX n u -7
-
-KPX o y -15
-KPX o x -24
-KPX o w -11
-KPX o v -15
-
-KPX p y -11
-
-KPX period space -32
-KPX period quoteright -97
-KPX period quotedblright -97
-
-KPX quotedblright space -65
-
-KPX quoteleft quoteleft -37
-
-KPX quoteright v -15
-KPX quoteright space -65
-KPX quoteright s -48
-KPX quoteright r -32
-KPX quoteright quoteright -37
-KPX quoteright l -15
-KPX quoteright d -65
-
-KPX r y 8
-KPX r v 8
-KPX r t 16
-KPX r s -11
-KPX r q -15
-KPX r period -48
-KPX r o -15
-KPX r hyphen -15
-KPX r g -11
-KPX r d -15
-KPX r comma -48
-KPX r c -15
-
-KPX s w -11
-
-KPX semicolon space -32
-
-KPX space quoteleft -48
-KPX space quotedblleft -65
-KPX space Y -97
-KPX space W -65
-KPX space V -65
-KPX space T -81
-
-KPX v period -65
-KPX v o -24
-KPX v comma -65
-KPX v a -15
-
-KPX w period -32
-KPX w o -15
-KPX w comma -32
-
-KPX x e -7
-
-KPX y period -65
-KPX y o -20
-KPX y e -7
-KPX y comma -65
-KPX y a -24
-
-KPX z e 8
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 160 186 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 160 186 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 160 186 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 160 186 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 160 186 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 160 186 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 176 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 137 186 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 137 186 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 137 186 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 137 186 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute -22 186 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -22 186 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -22 186 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave -22 186 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 160 186 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 183 186 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 183 186 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 183 186 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 183 186 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 183 186 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 137 186 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 160 186 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 160 186 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 160 186 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 160 186 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 137 186 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 137 186 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 114 186 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 92 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 92 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 92 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 92 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 92 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 92 0 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 108 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 92 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 92 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 92 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 92 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -22 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -22 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -22 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -22 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 114 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 114 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 114 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 114 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 114 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 114 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 92 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 114 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 114 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 114 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 114 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 92 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 92 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 69 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Helvetica-Narrow-BoldOblique.afm b/blt3.0.1/library/afm/Helvetica-Narrow-BoldOblique.afm
deleted file mode 100644
index ff859b3..0000000
--- a/blt3.0.1/library/afm/Helvetica-Narrow-BoldOblique.afm
+++ /dev/null
@@ -1,571 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Thu Mar 15 12:08:57 1990
-Comment UniqueID 28407
-Comment VMusage 7614 43068
-FontName Helvetica-Narrow-BoldOblique
-FullName Helvetica Narrow Bold Oblique
-FamilyName Helvetica
-Weight Bold
-ItalicAngle -12
-IsFixedPitch false
-FontBBox -143 -228 913 962
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 718
-XHeight 532
-Ascender 718
-Descender -207
-StartCharMetrics 228
-C 32 ; WX 228 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 273 ; N exclam ; B 77 0 325 718 ;
-C 34 ; WX 389 ; N quotedbl ; B 158 447 433 718 ;
-C 35 ; WX 456 ; N numbersign ; B 49 0 528 698 ;
-C 36 ; WX 456 ; N dollar ; B 55 -115 510 775 ;
-C 37 ; WX 729 ; N percent ; B 112 -19 739 710 ;
-C 38 ; WX 592 ; N ampersand ; B 73 -19 600 718 ;
-C 39 ; WX 228 ; N quoteright ; B 137 445 297 718 ;
-C 40 ; WX 273 ; N parenleft ; B 62 -208 385 734 ;
-C 41 ; WX 273 ; N parenright ; B -21 -208 302 734 ;
-C 42 ; WX 319 ; N asterisk ; B 120 387 394 718 ;
-C 43 ; WX 479 ; N plus ; B 67 0 500 506 ;
-C 44 ; WX 228 ; N comma ; B 23 -168 201 146 ;
-C 45 ; WX 273 ; N hyphen ; B 60 215 311 345 ;
-C 46 ; WX 228 ; N period ; B 52 0 201 146 ;
-C 47 ; WX 228 ; N slash ; B -30 -19 383 737 ;
-C 48 ; WX 456 ; N zero ; B 71 -19 506 710 ;
-C 49 ; WX 456 ; N one ; B 142 0 434 710 ;
-C 50 ; WX 456 ; N two ; B 21 0 508 710 ;
-C 51 ; WX 456 ; N three ; B 54 -19 499 710 ;
-C 52 ; WX 456 ; N four ; B 50 0 490 710 ;
-C 53 ; WX 456 ; N five ; B 53 -19 522 698 ;
-C 54 ; WX 456 ; N six ; B 70 -19 507 710 ;
-C 55 ; WX 456 ; N seven ; B 102 0 555 698 ;
-C 56 ; WX 456 ; N eight ; B 57 -19 505 710 ;
-C 57 ; WX 456 ; N nine ; B 64 -19 504 710 ;
-C 58 ; WX 273 ; N colon ; B 75 0 288 512 ;
-C 59 ; WX 273 ; N semicolon ; B 46 -168 288 512 ;
-C 60 ; WX 479 ; N less ; B 67 -8 537 514 ;
-C 61 ; WX 479 ; N equal ; B 48 87 519 419 ;
-C 62 ; WX 479 ; N greater ; B 30 -8 500 514 ;
-C 63 ; WX 501 ; N question ; B 135 0 550 727 ;
-C 64 ; WX 800 ; N at ; B 152 -19 782 737 ;
-C 65 ; WX 592 ; N A ; B 16 0 576 718 ;
-C 66 ; WX 592 ; N B ; B 62 0 626 718 ;
-C 67 ; WX 592 ; N C ; B 88 -19 647 737 ;
-C 68 ; WX 592 ; N D ; B 62 0 637 718 ;
-C 69 ; WX 547 ; N E ; B 62 0 620 718 ;
-C 70 ; WX 501 ; N F ; B 62 0 606 718 ;
-C 71 ; WX 638 ; N G ; B 89 -19 670 737 ;
-C 72 ; WX 592 ; N H ; B 58 0 659 718 ;
-C 73 ; WX 228 ; N I ; B 52 0 301 718 ;
-C 74 ; WX 456 ; N J ; B 49 -18 522 718 ;
-C 75 ; WX 592 ; N K ; B 71 0 703 718 ;
-C 76 ; WX 501 ; N L ; B 62 0 501 718 ;
-C 77 ; WX 683 ; N M ; B 57 0 752 718 ;
-C 78 ; WX 592 ; N N ; B 57 0 661 718 ;
-C 79 ; WX 638 ; N O ; B 88 -19 675 737 ;
-C 80 ; WX 547 ; N P ; B 62 0 605 718 ;
-C 81 ; WX 638 ; N Q ; B 88 -52 675 737 ;
-C 82 ; WX 592 ; N R ; B 62 0 638 718 ;
-C 83 ; WX 547 ; N S ; B 66 -19 588 737 ;
-C 84 ; WX 501 ; N T ; B 114 0 615 718 ;
-C 85 ; WX 592 ; N U ; B 96 -19 659 718 ;
-C 86 ; WX 547 ; N V ; B 141 0 656 718 ;
-C 87 ; WX 774 ; N W ; B 138 0 887 718 ;
-C 88 ; WX 547 ; N X ; B 11 0 648 718 ;
-C 89 ; WX 547 ; N Y ; B 137 0 661 718 ;
-C 90 ; WX 501 ; N Z ; B 20 0 604 718 ;
-C 91 ; WX 273 ; N bracketleft ; B 17 -196 379 722 ;
-C 92 ; WX 228 ; N backslash ; B 101 -19 252 737 ;
-C 93 ; WX 273 ; N bracketright ; B -14 -196 347 722 ;
-C 94 ; WX 479 ; N asciicircum ; B 107 323 484 698 ;
-C 95 ; WX 456 ; N underscore ; B -22 -125 443 -75 ;
-C 96 ; WX 228 ; N quoteleft ; B 136 454 296 727 ;
-C 97 ; WX 456 ; N a ; B 45 -14 478 546 ;
-C 98 ; WX 501 ; N b ; B 50 -14 529 718 ;
-C 99 ; WX 456 ; N c ; B 65 -14 491 546 ;
-C 100 ; WX 501 ; N d ; B 67 -14 577 718 ;
-C 101 ; WX 456 ; N e ; B 58 -14 486 546 ;
-C 102 ; WX 273 ; N f ; B 71 0 385 727 ; L i fi ; L l fl ;
-C 103 ; WX 501 ; N g ; B 31 -217 546 546 ;
-C 104 ; WX 501 ; N h ; B 53 0 516 718 ;
-C 105 ; WX 228 ; N i ; B 57 0 298 725 ;
-C 106 ; WX 228 ; N j ; B -35 -214 298 725 ;
-C 107 ; WX 456 ; N k ; B 57 0 549 718 ;
-C 108 ; WX 228 ; N l ; B 57 0 297 718 ;
-C 109 ; WX 729 ; N m ; B 52 0 746 546 ;
-C 110 ; WX 501 ; N n ; B 53 0 516 546 ;
-C 111 ; WX 501 ; N o ; B 67 -14 527 546 ;
-C 112 ; WX 501 ; N p ; B 15 -207 529 546 ;
-C 113 ; WX 501 ; N q ; B 66 -207 545 546 ;
-C 114 ; WX 319 ; N r ; B 52 0 401 546 ;
-C 115 ; WX 456 ; N s ; B 52 -14 479 546 ;
-C 116 ; WX 273 ; N t ; B 82 -6 346 676 ;
-C 117 ; WX 501 ; N u ; B 80 -14 540 532 ;
-C 118 ; WX 456 ; N v ; B 103 0 538 532 ;
-C 119 ; WX 638 ; N w ; B 101 0 723 532 ;
-C 120 ; WX 456 ; N x ; B 12 0 531 532 ;
-C 121 ; WX 456 ; N y ; B 34 -214 535 532 ;
-C 122 ; WX 410 ; N z ; B 16 0 478 532 ;
-C 123 ; WX 319 ; N braceleft ; B 77 -196 425 722 ;
-C 124 ; WX 230 ; N bar ; B 66 -19 289 737 ;
-C 125 ; WX 319 ; N braceright ; B -14 -196 333 722 ;
-C 126 ; WX 479 ; N asciitilde ; B 94 163 473 343 ;
-C 161 ; WX 273 ; N exclamdown ; B 41 -186 290 532 ;
-C 162 ; WX 456 ; N cent ; B 65 -118 491 628 ;
-C 163 ; WX 456 ; N sterling ; B 41 -16 520 718 ;
-C 164 ; WX 137 ; N fraction ; B -143 -19 399 710 ;
-C 165 ; WX 456 ; N yen ; B 49 0 585 698 ;
-C 166 ; WX 456 ; N florin ; B -41 -210 548 737 ;
-C 167 ; WX 456 ; N section ; B 50 -184 491 727 ;
-C 168 ; WX 456 ; N currency ; B 22 76 558 636 ;
-C 169 ; WX 195 ; N quotesingle ; B 135 447 263 718 ;
-C 170 ; WX 410 ; N quotedblleft ; B 132 454 482 727 ;
-C 171 ; WX 456 ; N guillemotleft ; B 111 76 468 484 ;
-C 172 ; WX 273 ; N guilsinglleft ; B 106 76 289 484 ;
-C 173 ; WX 273 ; N guilsinglright ; B 81 76 264 484 ;
-C 174 ; WX 501 ; N fi ; B 71 0 571 727 ;
-C 175 ; WX 501 ; N fl ; B 71 0 570 727 ;
-C 177 ; WX 456 ; N endash ; B 40 227 514 333 ;
-C 178 ; WX 456 ; N dagger ; B 97 -171 513 718 ;
-C 179 ; WX 456 ; N daggerdbl ; B 38 -171 515 718 ;
-C 180 ; WX 228 ; N periodcentered ; B 90 172 226 334 ;
-C 182 ; WX 456 ; N paragraph ; B 80 -191 564 700 ;
-C 183 ; WX 287 ; N bullet ; B 68 194 345 524 ;
-C 184 ; WX 228 ; N quotesinglbase ; B 34 -146 194 127 ;
-C 185 ; WX 410 ; N quotedblbase ; B 29 -146 380 127 ;
-C 186 ; WX 410 ; N quotedblright ; B 132 445 483 718 ;
-C 187 ; WX 456 ; N guillemotright ; B 85 76 443 484 ;
-C 188 ; WX 820 ; N ellipsis ; B 75 0 770 146 ;
-C 189 ; WX 820 ; N perthousand ; B 62 -19 851 710 ;
-C 191 ; WX 501 ; N questiondown ; B 44 -195 459 532 ;
-C 193 ; WX 273 ; N grave ; B 112 604 290 750 ;
-C 194 ; WX 273 ; N acute ; B 194 604 423 750 ;
-C 195 ; WX 273 ; N circumflex ; B 97 604 387 750 ;
-C 196 ; WX 273 ; N tilde ; B 92 610 415 737 ;
-C 197 ; WX 273 ; N macron ; B 100 604 396 678 ;
-C 198 ; WX 273 ; N breve ; B 128 604 405 750 ;
-C 199 ; WX 273 ; N dotaccent ; B 192 614 316 729 ;
-C 200 ; WX 273 ; N dieresis ; B 112 614 395 729 ;
-C 202 ; WX 273 ; N ring ; B 164 568 344 776 ;
-C 203 ; WX 273 ; N cedilla ; B -30 -228 180 0 ;
-C 205 ; WX 273 ; N hungarumlaut ; B 113 604 529 750 ;
-C 206 ; WX 273 ; N ogonek ; B 33 -228 216 0 ;
-C 207 ; WX 273 ; N caron ; B 123 604 412 750 ;
-C 208 ; WX 820 ; N emdash ; B 40 227 878 333 ;
-C 225 ; WX 820 ; N AE ; B 4 0 902 718 ;
-C 227 ; WX 303 ; N ordfeminine ; B 75 276 381 737 ;
-C 232 ; WX 501 ; N Lslash ; B 28 0 501 718 ;
-C 233 ; WX 638 ; N Oslash ; B 29 -27 733 745 ;
-C 234 ; WX 820 ; N OE ; B 81 -19 913 737 ;
-C 235 ; WX 299 ; N ordmasculine ; B 75 276 398 737 ;
-C 241 ; WX 729 ; N ae ; B 46 -14 757 546 ;
-C 245 ; WX 228 ; N dotlessi ; B 57 0 264 532 ;
-C 248 ; WX 228 ; N lslash ; B 33 0 334 718 ;
-C 249 ; WX 501 ; N oslash ; B 18 -29 575 560 ;
-C 250 ; WX 774 ; N oe ; B 67 -14 801 546 ;
-C 251 ; WX 501 ; N germandbls ; B 57 -14 539 731 ;
-C -1 ; WX 501 ; N Zcaron ; B 20 0 604 936 ;
-C -1 ; WX 456 ; N ccedilla ; B 65 -228 491 546 ;
-C -1 ; WX 456 ; N ydieresis ; B 34 -214 535 729 ;
-C -1 ; WX 456 ; N atilde ; B 45 -14 507 737 ;
-C -1 ; WX 228 ; N icircumflex ; B 57 0 364 750 ;
-C -1 ; WX 273 ; N threesuperior ; B 75 271 361 710 ;
-C -1 ; WX 456 ; N ecircumflex ; B 58 -14 486 750 ;
-C -1 ; WX 501 ; N thorn ; B 15 -208 529 718 ;
-C -1 ; WX 456 ; N egrave ; B 58 -14 486 750 ;
-C -1 ; WX 273 ; N twosuperior ; B 57 283 368 710 ;
-C -1 ; WX 456 ; N eacute ; B 58 -14 514 750 ;
-C -1 ; WX 501 ; N otilde ; B 67 -14 529 737 ;
-C -1 ; WX 592 ; N Aacute ; B 16 0 615 936 ;
-C -1 ; WX 501 ; N ocircumflex ; B 67 -14 527 750 ;
-C -1 ; WX 456 ; N yacute ; B 34 -214 535 750 ;
-C -1 ; WX 501 ; N udieresis ; B 80 -14 540 729 ;
-C -1 ; WX 684 ; N threequarters ; B 82 -19 688 710 ;
-C -1 ; WX 456 ; N acircumflex ; B 45 -14 478 750 ;
-C -1 ; WX 592 ; N Eth ; B 51 0 637 718 ;
-C -1 ; WX 456 ; N edieresis ; B 58 -14 487 729 ;
-C -1 ; WX 501 ; N ugrave ; B 80 -14 540 750 ;
-C -1 ; WX 820 ; N trademark ; B 146 306 909 718 ;
-C -1 ; WX 501 ; N ograve ; B 67 -14 527 750 ;
-C -1 ; WX 456 ; N scaron ; B 52 -14 504 750 ;
-C -1 ; WX 228 ; N Idieresis ; B 52 0 405 915 ;
-C -1 ; WX 501 ; N uacute ; B 80 -14 540 750 ;
-C -1 ; WX 456 ; N agrave ; B 45 -14 478 750 ;
-C -1 ; WX 501 ; N ntilde ; B 53 0 529 737 ;
-C -1 ; WX 456 ; N aring ; B 45 -14 478 776 ;
-C -1 ; WX 410 ; N zcaron ; B 16 0 481 750 ;
-C -1 ; WX 228 ; N Icircumflex ; B 52 0 397 936 ;
-C -1 ; WX 592 ; N Ntilde ; B 57 0 661 923 ;
-C -1 ; WX 501 ; N ucircumflex ; B 80 -14 540 750 ;
-C -1 ; WX 547 ; N Ecircumflex ; B 62 0 620 936 ;
-C -1 ; WX 228 ; N Iacute ; B 52 0 433 936 ;
-C -1 ; WX 592 ; N Ccedilla ; B 88 -228 647 737 ;
-C -1 ; WX 638 ; N Odieresis ; B 88 -19 675 915 ;
-C -1 ; WX 547 ; N Scaron ; B 66 -19 588 936 ;
-C -1 ; WX 547 ; N Edieresis ; B 62 0 620 915 ;
-C -1 ; WX 228 ; N Igrave ; B 52 0 301 936 ;
-C -1 ; WX 456 ; N adieresis ; B 45 -14 487 729 ;
-C -1 ; WX 638 ; N Ograve ; B 88 -19 675 936 ;
-C -1 ; WX 547 ; N Egrave ; B 62 0 620 936 ;
-C -1 ; WX 547 ; N Ydieresis ; B 137 0 661 915 ;
-C -1 ; WX 604 ; N registered ; B 45 -19 684 737 ;
-C -1 ; WX 638 ; N Otilde ; B 88 -19 675 923 ;
-C -1 ; WX 684 ; N onequarter ; B 108 -19 661 710 ;
-C -1 ; WX 592 ; N Ugrave ; B 96 -19 659 936 ;
-C -1 ; WX 592 ; N Ucircumflex ; B 96 -19 659 936 ;
-C -1 ; WX 547 ; N Thorn ; B 62 0 588 718 ;
-C -1 ; WX 479 ; N divide ; B 67 -42 500 548 ;
-C -1 ; WX 592 ; N Atilde ; B 16 0 608 923 ;
-C -1 ; WX 592 ; N Uacute ; B 96 -19 659 936 ;
-C -1 ; WX 638 ; N Ocircumflex ; B 88 -19 675 936 ;
-C -1 ; WX 479 ; N logicalnot ; B 86 108 519 419 ;
-C -1 ; WX 592 ; N Aring ; B 16 0 576 962 ;
-C -1 ; WX 228 ; N idieresis ; B 57 0 373 729 ;
-C -1 ; WX 228 ; N iacute ; B 57 0 400 750 ;
-C -1 ; WX 456 ; N aacute ; B 45 -14 514 750 ;
-C -1 ; WX 479 ; N plusminus ; B 33 0 512 506 ;
-C -1 ; WX 479 ; N multiply ; B 47 1 520 505 ;
-C -1 ; WX 592 ; N Udieresis ; B 96 -19 659 915 ;
-C -1 ; WX 479 ; N minus ; B 67 197 500 309 ;
-C -1 ; WX 273 ; N onesuperior ; B 121 283 318 710 ;
-C -1 ; WX 547 ; N Eacute ; B 62 0 620 936 ;
-C -1 ; WX 592 ; N Acircumflex ; B 16 0 579 936 ;
-C -1 ; WX 604 ; N copyright ; B 46 -19 685 737 ;
-C -1 ; WX 592 ; N Agrave ; B 16 0 576 936 ;
-C -1 ; WX 501 ; N odieresis ; B 67 -14 527 729 ;
-C -1 ; WX 501 ; N oacute ; B 67 -14 537 750 ;
-C -1 ; WX 328 ; N degree ; B 143 426 383 712 ;
-C -1 ; WX 228 ; N igrave ; B 57 0 268 750 ;
-C -1 ; WX 501 ; N mu ; B 18 -207 540 532 ;
-C -1 ; WX 638 ; N Oacute ; B 88 -19 675 936 ;
-C -1 ; WX 501 ; N eth ; B 67 -14 549 737 ;
-C -1 ; WX 592 ; N Adieresis ; B 16 0 588 915 ;
-C -1 ; WX 547 ; N Yacute ; B 137 0 661 936 ;
-C -1 ; WX 230 ; N brokenbar ; B 66 -19 289 737 ;
-C -1 ; WX 684 ; N onehalf ; B 108 -19 704 710 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 209
-
-KPX A y -30
-KPX A w -30
-KPX A v -40
-KPX A u -30
-KPX A Y -110
-KPX A W -60
-KPX A V -80
-KPX A U -50
-KPX A T -90
-KPX A Q -40
-KPX A O -40
-KPX A G -50
-KPX A C -40
-
-KPX B U -10
-KPX B A -30
-
-KPX D period -30
-KPX D comma -30
-KPX D Y -70
-KPX D W -40
-KPX D V -40
-KPX D A -40
-
-KPX F period -100
-KPX F comma -100
-KPX F a -20
-KPX F A -80
-
-KPX J u -20
-KPX J period -20
-KPX J comma -20
-KPX J A -20
-
-KPX K y -40
-KPX K u -30
-KPX K o -35
-KPX K e -15
-KPX K O -30
-
-KPX L y -30
-KPX L quoteright -140
-KPX L quotedblright -140
-KPX L Y -120
-KPX L W -80
-KPX L V -110
-KPX L T -90
-
-KPX O period -40
-KPX O comma -40
-KPX O Y -70
-KPX O X -50
-KPX O W -50
-KPX O V -50
-KPX O T -40
-KPX O A -50
-
-KPX P period -120
-KPX P o -40
-KPX P e -30
-KPX P comma -120
-KPX P a -30
-KPX P A -100
-
-KPX Q period 20
-KPX Q comma 20
-KPX Q U -10
-
-KPX R Y -50
-KPX R W -40
-KPX R V -50
-KPX R U -20
-KPX R T -20
-KPX R O -20
-
-KPX T y -60
-KPX T w -60
-KPX T u -90
-KPX T semicolon -40
-KPX T r -80
-KPX T period -80
-KPX T o -80
-KPX T hyphen -120
-KPX T e -60
-KPX T comma -80
-KPX T colon -40
-KPX T a -80
-KPX T O -40
-KPX T A -90
-
-KPX U period -30
-KPX U comma -30
-KPX U A -50
-
-KPX V u -60
-KPX V semicolon -40
-KPX V period -120
-KPX V o -90
-KPX V hyphen -80
-KPX V e -50
-KPX V comma -120
-KPX V colon -40
-KPX V a -60
-KPX V O -50
-KPX V G -50
-KPX V A -80
-
-KPX W y -20
-KPX W u -45
-KPX W semicolon -10
-KPX W period -80
-KPX W o -60
-KPX W hyphen -40
-KPX W e -35
-KPX W comma -80
-KPX W colon -10
-KPX W a -40
-KPX W O -20
-KPX W A -60
-
-KPX Y u -100
-KPX Y semicolon -50
-KPX Y period -100
-KPX Y o -100
-KPX Y e -80
-KPX Y comma -100
-KPX Y colon -50
-KPX Y a -90
-KPX Y O -70
-KPX Y A -110
-
-KPX a y -20
-KPX a w -15
-KPX a v -15
-KPX a g -10
-
-KPX b y -20
-KPX b v -20
-KPX b u -20
-KPX b l -10
-
-KPX c y -10
-KPX c l -20
-KPX c k -20
-KPX c h -10
-
-KPX colon space -40
-
-KPX comma space -40
-KPX comma quoteright -120
-KPX comma quotedblright -120
-
-KPX d y -15
-KPX d w -15
-KPX d v -15
-KPX d d -10
-
-KPX e y -15
-KPX e x -15
-KPX e w -15
-KPX e v -15
-KPX e period 20
-KPX e comma 10
-
-KPX f quoteright 30
-KPX f quotedblright 30
-KPX f period -10
-KPX f o -20
-KPX f e -10
-KPX f comma -10
-
-KPX g g -10
-KPX g e 10
-
-KPX h y -20
-
-KPX k o -15
-
-KPX l y -15
-KPX l w -15
-
-KPX m y -30
-KPX m u -20
-
-KPX n y -20
-KPX n v -40
-KPX n u -10
-
-KPX o y -20
-KPX o x -30
-KPX o w -15
-KPX o v -20
-
-KPX p y -15
-
-KPX period space -40
-KPX period quoteright -120
-KPX period quotedblright -120
-
-KPX quotedblright space -80
-
-KPX quoteleft quoteleft -46
-
-KPX quoteright v -20
-KPX quoteright space -80
-KPX quoteright s -60
-KPX quoteright r -40
-KPX quoteright quoteright -46
-KPX quoteright l -20
-KPX quoteright d -80
-
-KPX r y 10
-KPX r v 10
-KPX r t 20
-KPX r s -15
-KPX r q -20
-KPX r period -60
-KPX r o -20
-KPX r hyphen -20
-KPX r g -15
-KPX r d -20
-KPX r comma -60
-KPX r c -20
-
-KPX s w -15
-
-KPX semicolon space -40
-
-KPX space quoteleft -60
-KPX space quotedblleft -80
-KPX space Y -120
-KPX space W -80
-KPX space V -80
-KPX space T -100
-
-KPX v period -80
-KPX v o -30
-KPX v comma -80
-KPX v a -20
-
-KPX w period -40
-KPX w o -20
-KPX w comma -40
-
-KPX x e -10
-
-KPX y period -80
-KPX y o -25
-KPX y e -10
-KPX y comma -80
-KPX y a -30
-
-KPX z e 10
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 192 186 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 192 186 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 192 186 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 192 186 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 192 186 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 192 186 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 176 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 169 186 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 169 186 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 169 186 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 169 186 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 10 186 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 10 186 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 10 186 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 10 186 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 192 186 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 215 186 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 215 186 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 215 186 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 215 186 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 215 186 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 169 186 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 192 186 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 192 186 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 192 186 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 192 186 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 169 186 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 169 186 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 146 186 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 92 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 92 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 92 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 92 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 92 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 92 0 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 108 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 92 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 92 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 92 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 92 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -22 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -22 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -22 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -22 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 114 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 114 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 114 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 114 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 114 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 114 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 92 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 114 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 114 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 114 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 114 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 92 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 92 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 69 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Helvetica-Narrow-Oblique.afm b/blt3.0.1/library/afm/Helvetica-Narrow-Oblique.afm
deleted file mode 100644
index 0a8cb32..0000000
--- a/blt3.0.1/library/afm/Helvetica-Narrow-Oblique.afm
+++ /dev/null
@@ -1,613 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
-Comment Creation Date: Thu Mar 15 11:25:48 1990
-Comment UniqueID 28389
-Comment VMusage 7572 42473
-FontName Helvetica-Narrow-Oblique
-FullName Helvetica Narrow Oblique
-FamilyName Helvetica
-Weight Medium
-ItalicAngle -12
-IsFixedPitch false
-FontBBox -139 -225 915 931
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.006
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 718
-XHeight 523
-Ascender 718
-Descender -207
-StartCharMetrics 228
-C 32 ; WX 228 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 228 ; N exclam ; B 74 0 278 718 ;
-C 34 ; WX 291 ; N quotedbl ; B 138 463 359 718 ;
-C 35 ; WX 456 ; N numbersign ; B 60 0 517 688 ;
-C 36 ; WX 456 ; N dollar ; B 57 -115 506 775 ;
-C 37 ; WX 729 ; N percent ; B 120 -19 729 703 ;
-C 38 ; WX 547 ; N ampersand ; B 63 -15 530 718 ;
-C 39 ; WX 182 ; N quoteright ; B 124 463 254 718 ;
-C 40 ; WX 273 ; N parenleft ; B 89 -207 372 733 ;
-C 41 ; WX 273 ; N parenright ; B -7 -207 276 733 ;
-C 42 ; WX 319 ; N asterisk ; B 135 431 389 718 ;
-C 43 ; WX 479 ; N plus ; B 70 0 497 505 ;
-C 44 ; WX 228 ; N comma ; B 46 -147 175 106 ;
-C 45 ; WX 273 ; N hyphen ; B 77 232 293 322 ;
-C 46 ; WX 228 ; N period ; B 71 0 175 106 ;
-C 47 ; WX 228 ; N slash ; B -17 -19 370 737 ;
-C 48 ; WX 456 ; N zero ; B 77 -19 499 703 ;
-C 49 ; WX 456 ; N one ; B 170 0 417 703 ;
-C 50 ; WX 456 ; N two ; B 21 0 506 703 ;
-C 51 ; WX 456 ; N three ; B 61 -19 500 703 ;
-C 52 ; WX 456 ; N four ; B 50 0 472 703 ;
-C 53 ; WX 456 ; N five ; B 55 -19 509 688 ;
-C 54 ; WX 456 ; N six ; B 74 -19 504 703 ;
-C 55 ; WX 456 ; N seven ; B 112 0 549 688 ;
-C 56 ; WX 456 ; N eight ; B 60 -19 497 703 ;
-C 57 ; WX 456 ; N nine ; B 67 -19 499 703 ;
-C 58 ; WX 228 ; N colon ; B 71 0 247 516 ;
-C 59 ; WX 228 ; N semicolon ; B 46 -147 247 516 ;
-C 60 ; WX 479 ; N less ; B 77 11 526 495 ;
-C 61 ; WX 479 ; N equal ; B 52 115 515 390 ;
-C 62 ; WX 479 ; N greater ; B 41 11 490 495 ;
-C 63 ; WX 456 ; N question ; B 132 0 500 727 ;
-C 64 ; WX 832 ; N at ; B 176 -19 791 737 ;
-C 65 ; WX 547 ; N A ; B 11 0 536 718 ;
-C 66 ; WX 547 ; N B ; B 61 0 583 718 ;
-C 67 ; WX 592 ; N C ; B 88 -19 640 737 ;
-C 68 ; WX 592 ; N D ; B 66 0 626 718 ;
-C 69 ; WX 547 ; N E ; B 71 0 625 718 ;
-C 70 ; WX 501 ; N F ; B 71 0 603 718 ;
-C 71 ; WX 638 ; N G ; B 91 -19 655 737 ;
-C 72 ; WX 592 ; N H ; B 63 0 655 718 ;
-C 73 ; WX 228 ; N I ; B 75 0 279 718 ;
-C 74 ; WX 410 ; N J ; B 39 -19 476 718 ;
-C 75 ; WX 547 ; N K ; B 62 0 662 718 ;
-C 76 ; WX 456 ; N L ; B 62 0 455 718 ;
-C 77 ; WX 683 ; N M ; B 60 0 749 718 ;
-C 78 ; WX 592 ; N N ; B 62 0 655 718 ;
-C 79 ; WX 638 ; N O ; B 86 -19 677 737 ;
-C 80 ; WX 547 ; N P ; B 71 0 604 718 ;
-C 81 ; WX 638 ; N Q ; B 86 -56 677 737 ;
-C 82 ; WX 592 ; N R ; B 72 0 634 718 ;
-C 83 ; WX 547 ; N S ; B 74 -19 584 737 ;
-C 84 ; WX 501 ; N T ; B 122 0 615 718 ;
-C 85 ; WX 592 ; N U ; B 101 -19 653 718 ;
-C 86 ; WX 547 ; N V ; B 142 0 656 718 ;
-C 87 ; WX 774 ; N W ; B 138 0 886 718 ;
-C 88 ; WX 547 ; N X ; B 16 0 647 718 ;
-C 89 ; WX 547 ; N Y ; B 137 0 661 718 ;
-C 90 ; WX 501 ; N Z ; B 19 0 607 718 ;
-C 91 ; WX 228 ; N bracketleft ; B 17 -196 331 722 ;
-C 92 ; WX 228 ; N backslash ; B 115 -19 239 737 ;
-C 93 ; WX 228 ; N bracketright ; B -11 -196 302 722 ;
-C 94 ; WX 385 ; N asciicircum ; B 35 264 442 688 ;
-C 95 ; WX 456 ; N underscore ; B -22 -125 443 -75 ;
-C 96 ; WX 182 ; N quoteleft ; B 135 470 265 725 ;
-C 97 ; WX 456 ; N a ; B 50 -15 458 538 ;
-C 98 ; WX 456 ; N b ; B 48 -15 479 718 ;
-C 99 ; WX 410 ; N c ; B 61 -15 454 538 ;
-C 100 ; WX 456 ; N d ; B 69 -15 534 718 ;
-C 101 ; WX 456 ; N e ; B 69 -15 474 538 ;
-C 102 ; WX 228 ; N f ; B 71 0 341 728 ; L i fi ; L l fl ;
-C 103 ; WX 456 ; N g ; B 34 -220 500 538 ;
-C 104 ; WX 456 ; N h ; B 53 0 470 718 ;
-C 105 ; WX 182 ; N i ; B 55 0 252 718 ;
-C 106 ; WX 182 ; N j ; B -49 -210 252 718 ;
-C 107 ; WX 410 ; N k ; B 55 0 492 718 ;
-C 108 ; WX 182 ; N l ; B 55 0 252 718 ;
-C 109 ; WX 683 ; N m ; B 53 0 699 538 ;
-C 110 ; WX 456 ; N n ; B 53 0 470 538 ;
-C 111 ; WX 456 ; N o ; B 68 -14 479 538 ;
-C 112 ; WX 456 ; N p ; B 11 -207 479 538 ;
-C 113 ; WX 456 ; N q ; B 69 -207 496 538 ;
-C 114 ; WX 273 ; N r ; B 63 0 365 538 ;
-C 115 ; WX 410 ; N s ; B 52 -15 434 538 ;
-C 116 ; WX 228 ; N t ; B 84 -7 302 669 ;
-C 117 ; WX 456 ; N u ; B 77 -15 492 523 ;
-C 118 ; WX 410 ; N v ; B 98 0 495 523 ;
-C 119 ; WX 592 ; N w ; B 103 0 673 523 ;
-C 120 ; WX 410 ; N x ; B 9 0 487 523 ;
-C 121 ; WX 410 ; N y ; B 12 -214 492 523 ;
-C 122 ; WX 410 ; N z ; B 25 0 468 523 ;
-C 123 ; WX 274 ; N braceleft ; B 75 -196 365 722 ;
-C 124 ; WX 213 ; N bar ; B 74 -19 265 737 ;
-C 125 ; WX 274 ; N braceright ; B 0 -196 291 722 ;
-C 126 ; WX 479 ; N asciitilde ; B 91 180 476 326 ;
-C 161 ; WX 273 ; N exclamdown ; B 63 -195 267 523 ;
-C 162 ; WX 456 ; N cent ; B 78 -115 479 623 ;
-C 163 ; WX 456 ; N sterling ; B 40 -16 520 718 ;
-C 164 ; WX 137 ; N fraction ; B -139 -19 396 703 ;
-C 165 ; WX 456 ; N yen ; B 67 0 573 688 ;
-C 166 ; WX 456 ; N florin ; B -43 -207 537 737 ;
-C 167 ; WX 456 ; N section ; B 63 -191 479 737 ;
-C 168 ; WX 456 ; N currency ; B 49 99 530 603 ;
-C 169 ; WX 157 ; N quotesingle ; B 129 463 233 718 ;
-C 170 ; WX 273 ; N quotedblleft ; B 113 470 378 725 ;
-C 171 ; WX 456 ; N guillemotleft ; B 120 108 454 446 ;
-C 172 ; WX 273 ; N guilsinglleft ; B 112 108 279 446 ;
-C 173 ; WX 273 ; N guilsinglright ; B 91 108 257 446 ;
-C 174 ; WX 410 ; N fi ; B 71 0 481 728 ;
-C 175 ; WX 410 ; N fl ; B 71 0 479 728 ;
-C 177 ; WX 456 ; N endash ; B 42 240 510 313 ;
-C 178 ; WX 456 ; N dagger ; B 110 -159 510 718 ;
-C 179 ; WX 456 ; N daggerdbl ; B 43 -159 511 718 ;
-C 180 ; WX 228 ; N periodcentered ; B 106 190 211 315 ;
-C 182 ; WX 440 ; N paragraph ; B 103 -173 533 718 ;
-C 183 ; WX 287 ; N bullet ; B 74 202 339 517 ;
-C 184 ; WX 182 ; N quotesinglbase ; B 17 -149 147 106 ;
-C 185 ; WX 273 ; N quotedblbase ; B -5 -149 260 106 ;
-C 186 ; WX 273 ; N quotedblright ; B 102 463 367 718 ;
-C 187 ; WX 456 ; N guillemotright ; B 98 108 433 446 ;
-C 188 ; WX 820 ; N ellipsis ; B 94 0 744 106 ;
-C 189 ; WX 820 ; N perthousand ; B 72 -19 844 703 ;
-C 191 ; WX 501 ; N questiondown ; B 70 -201 438 525 ;
-C 193 ; WX 273 ; N grave ; B 139 593 276 734 ;
-C 194 ; WX 273 ; N acute ; B 203 593 390 734 ;
-C 195 ; WX 273 ; N circumflex ; B 121 593 359 734 ;
-C 196 ; WX 273 ; N tilde ; B 102 606 402 722 ;
-C 197 ; WX 273 ; N macron ; B 117 627 384 684 ;
-C 198 ; WX 273 ; N breve ; B 137 595 391 731 ;
-C 199 ; WX 273 ; N dotaccent ; B 204 604 297 706 ;
-C 200 ; WX 273 ; N dieresis ; B 138 604 363 706 ;
-C 202 ; WX 273 ; N ring ; B 175 572 330 756 ;
-C 203 ; WX 273 ; N cedilla ; B 2 -225 191 0 ;
-C 205 ; WX 273 ; N hungarumlaut ; B 129 593 463 734 ;
-C 206 ; WX 273 ; N ogonek ; B 35 -225 204 0 ;
-C 207 ; WX 273 ; N caron ; B 145 593 384 734 ;
-C 208 ; WX 820 ; N emdash ; B 42 240 875 313 ;
-C 225 ; WX 820 ; N AE ; B 7 0 899 718 ;
-C 227 ; WX 303 ; N ordfeminine ; B 82 304 368 737 ;
-C 232 ; WX 456 ; N Lslash ; B 34 0 455 718 ;
-C 233 ; WX 638 ; N Oslash ; B 35 -19 730 737 ;
-C 234 ; WX 820 ; N OE ; B 80 -19 915 737 ;
-C 235 ; WX 299 ; N ordmasculine ; B 82 304 384 737 ;
-C 241 ; WX 729 ; N ae ; B 50 -15 746 538 ;
-C 245 ; WX 228 ; N dotlessi ; B 78 0 241 523 ;
-C 248 ; WX 182 ; N lslash ; B 34 0 284 718 ;
-C 249 ; WX 501 ; N oslash ; B 24 -22 531 545 ;
-C 250 ; WX 774 ; N oe ; B 68 -15 791 538 ;
-C 251 ; WX 501 ; N germandbls ; B 55 -15 539 728 ;
-C -1 ; WX 501 ; N Zcaron ; B 19 0 607 929 ;
-C -1 ; WX 410 ; N ccedilla ; B 61 -225 454 538 ;
-C -1 ; WX 410 ; N ydieresis ; B 12 -214 492 706 ;
-C -1 ; WX 456 ; N atilde ; B 50 -15 486 722 ;
-C -1 ; WX 228 ; N icircumflex ; B 78 0 337 734 ;
-C -1 ; WX 273 ; N threesuperior ; B 74 270 358 703 ;
-C -1 ; WX 456 ; N ecircumflex ; B 69 -15 474 734 ;
-C -1 ; WX 456 ; N thorn ; B 11 -207 479 718 ;
-C -1 ; WX 456 ; N egrave ; B 69 -15 474 734 ;
-C -1 ; WX 273 ; N twosuperior ; B 52 281 368 703 ;
-C -1 ; WX 456 ; N eacute ; B 69 -15 481 734 ;
-C -1 ; WX 456 ; N otilde ; B 68 -14 494 722 ;
-C -1 ; WX 547 ; N Aacute ; B 11 0 560 929 ;
-C -1 ; WX 456 ; N ocircumflex ; B 68 -14 479 734 ;
-C -1 ; WX 410 ; N yacute ; B 12 -214 492 734 ;
-C -1 ; WX 456 ; N udieresis ; B 77 -15 492 706 ;
-C -1 ; WX 684 ; N threequarters ; B 106 -19 706 703 ;
-C -1 ; WX 456 ; N acircumflex ; B 50 -15 458 734 ;
-C -1 ; WX 592 ; N Eth ; B 57 0 626 718 ;
-C -1 ; WX 456 ; N edieresis ; B 69 -15 474 706 ;
-C -1 ; WX 456 ; N ugrave ; B 77 -15 492 734 ;
-C -1 ; WX 820 ; N trademark ; B 152 306 866 718 ;
-C -1 ; WX 456 ; N ograve ; B 68 -14 479 734 ;
-C -1 ; WX 410 ; N scaron ; B 52 -15 453 734 ;
-C -1 ; WX 228 ; N Idieresis ; B 75 0 375 901 ;
-C -1 ; WX 456 ; N uacute ; B 77 -15 492 734 ;
-C -1 ; WX 456 ; N agrave ; B 50 -15 458 734 ;
-C -1 ; WX 456 ; N ntilde ; B 53 0 486 722 ;
-C -1 ; WX 456 ; N aring ; B 50 -15 458 756 ;
-C -1 ; WX 410 ; N zcaron ; B 25 0 468 734 ;
-C -1 ; WX 228 ; N Icircumflex ; B 75 0 371 929 ;
-C -1 ; WX 592 ; N Ntilde ; B 62 0 655 917 ;
-C -1 ; WX 456 ; N ucircumflex ; B 77 -15 492 734 ;
-C -1 ; WX 547 ; N Ecircumflex ; B 71 0 625 929 ;
-C -1 ; WX 228 ; N Iacute ; B 75 0 401 929 ;
-C -1 ; WX 592 ; N Ccedilla ; B 88 -225 640 737 ;
-C -1 ; WX 638 ; N Odieresis ; B 86 -19 677 901 ;
-C -1 ; WX 547 ; N Scaron ; B 74 -19 584 929 ;
-C -1 ; WX 547 ; N Edieresis ; B 71 0 625 901 ;
-C -1 ; WX 228 ; N Igrave ; B 75 0 288 929 ;
-C -1 ; WX 456 ; N adieresis ; B 50 -15 458 706 ;
-C -1 ; WX 638 ; N Ograve ; B 86 -19 677 929 ;
-C -1 ; WX 547 ; N Egrave ; B 71 0 625 929 ;
-C -1 ; WX 547 ; N Ydieresis ; B 137 0 661 901 ;
-C -1 ; WX 604 ; N registered ; B 44 -19 687 737 ;
-C -1 ; WX 638 ; N Otilde ; B 86 -19 677 917 ;
-C -1 ; WX 684 ; N onequarter ; B 123 -19 658 703 ;
-C -1 ; WX 592 ; N Ugrave ; B 101 -19 653 929 ;
-C -1 ; WX 592 ; N Ucircumflex ; B 101 -19 653 929 ;
-C -1 ; WX 547 ; N Thorn ; B 71 0 584 718 ;
-C -1 ; WX 479 ; N divide ; B 70 -19 497 524 ;
-C -1 ; WX 547 ; N Atilde ; B 11 0 573 917 ;
-C -1 ; WX 592 ; N Uacute ; B 101 -19 653 929 ;
-C -1 ; WX 638 ; N Ocircumflex ; B 86 -19 677 929 ;
-C -1 ; WX 479 ; N logicalnot ; B 87 108 515 390 ;
-C -1 ; WX 547 ; N Aring ; B 11 0 536 931 ;
-C -1 ; WX 228 ; N idieresis ; B 78 0 341 706 ;
-C -1 ; WX 228 ; N iacute ; B 78 0 367 734 ;
-C -1 ; WX 456 ; N aacute ; B 50 -15 481 734 ;
-C -1 ; WX 479 ; N plusminus ; B 32 0 507 506 ;
-C -1 ; WX 479 ; N multiply ; B 41 0 526 506 ;
-C -1 ; WX 592 ; N Udieresis ; B 101 -19 653 901 ;
-C -1 ; WX 479 ; N minus ; B 70 216 497 289 ;
-C -1 ; WX 273 ; N onesuperior ; B 136 281 305 703 ;
-C -1 ; WX 547 ; N Eacute ; B 71 0 625 929 ;
-C -1 ; WX 547 ; N Acircumflex ; B 11 0 536 929 ;
-C -1 ; WX 604 ; N copyright ; B 44 -19 687 737 ;
-C -1 ; WX 547 ; N Agrave ; B 11 0 536 929 ;
-C -1 ; WX 456 ; N odieresis ; B 68 -14 479 706 ;
-C -1 ; WX 456 ; N oacute ; B 68 -14 481 734 ;
-C -1 ; WX 328 ; N degree ; B 138 411 384 703 ;
-C -1 ; WX 228 ; N igrave ; B 78 0 254 734 ;
-C -1 ; WX 456 ; N mu ; B 20 -207 492 523 ;
-C -1 ; WX 638 ; N Oacute ; B 86 -19 677 929 ;
-C -1 ; WX 456 ; N eth ; B 67 -15 506 737 ;
-C -1 ; WX 547 ; N Adieresis ; B 11 0 536 901 ;
-C -1 ; WX 547 ; N Yacute ; B 137 0 661 929 ;
-C -1 ; WX 213 ; N brokenbar ; B 74 -19 265 737 ;
-C -1 ; WX 684 ; N onehalf ; B 93 -19 688 703 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 250
-
-KPX A y -40
-KPX A w -40
-KPX A v -40
-KPX A u -30
-KPX A Y -100
-KPX A W -50
-KPX A V -70
-KPX A U -50
-KPX A T -120
-KPX A Q -30
-KPX A O -30
-KPX A G -30
-KPX A C -30
-
-KPX B period -20
-KPX B comma -20
-KPX B U -10
-
-KPX C period -30
-KPX C comma -30
-
-KPX D period -70
-KPX D comma -70
-KPX D Y -90
-KPX D W -40
-KPX D V -70
-KPX D A -40
-
-KPX F r -45
-KPX F period -150
-KPX F o -30
-KPX F e -30
-KPX F comma -150
-KPX F a -50
-KPX F A -80
-
-KPX J u -20
-KPX J period -30
-KPX J comma -30
-KPX J a -20
-KPX J A -20
-
-KPX K y -50
-KPX K u -30
-KPX K o -40
-KPX K e -40
-KPX K O -50
-
-KPX L y -30
-KPX L quoteright -160
-KPX L quotedblright -140
-KPX L Y -140
-KPX L W -70
-KPX L V -110
-KPX L T -110
-
-KPX O period -40
-KPX O comma -40
-KPX O Y -70
-KPX O X -60
-KPX O W -30
-KPX O V -50
-KPX O T -40
-KPX O A -20
-
-KPX P period -180
-KPX P o -50
-KPX P e -50
-KPX P comma -180
-KPX P a -40
-KPX P A -120
-
-KPX Q U -10
-
-KPX R Y -50
-KPX R W -30
-KPX R V -50
-KPX R U -40
-KPX R T -30
-KPX R O -20
-
-KPX S period -20
-KPX S comma -20
-
-KPX T y -120
-KPX T w -120
-KPX T u -120
-KPX T semicolon -20
-KPX T r -120
-KPX T period -120
-KPX T o -120
-KPX T hyphen -140
-KPX T e -120
-KPX T comma -120
-KPX T colon -20
-KPX T a -120
-KPX T O -40
-KPX T A -120
-
-KPX U period -40
-KPX U comma -40
-KPX U A -40
-
-KPX V u -70
-KPX V semicolon -40
-KPX V period -125
-KPX V o -80
-KPX V hyphen -80
-KPX V e -80
-KPX V comma -125
-KPX V colon -40
-KPX V a -70
-KPX V O -40
-KPX V G -40
-KPX V A -80
-
-KPX W y -20
-KPX W u -30
-KPX W period -80
-KPX W o -30
-KPX W hyphen -40
-KPX W e -30
-KPX W comma -80
-KPX W a -40
-KPX W O -20
-KPX W A -50
-
-KPX Y u -110
-KPX Y semicolon -60
-KPX Y period -140
-KPX Y o -140
-KPX Y i -20
-KPX Y hyphen -140
-KPX Y e -140
-KPX Y comma -140
-KPX Y colon -60
-KPX Y a -140
-KPX Y O -85
-KPX Y A -110
-
-KPX a y -30
-KPX a w -20
-KPX a v -20
-
-KPX b y -20
-KPX b v -20
-KPX b u -20
-KPX b period -40
-KPX b l -20
-KPX b comma -40
-KPX b b -10
-
-KPX c k -20
-KPX c comma -15
-
-KPX colon space -50
-
-KPX comma quoteright -100
-KPX comma quotedblright -100
-
-KPX e y -20
-KPX e x -30
-KPX e w -20
-KPX e v -30
-KPX e period -15
-KPX e comma -15
-
-KPX f quoteright 50
-KPX f quotedblright 60
-KPX f period -30
-KPX f o -30
-KPX f e -30
-KPX f dotlessi -28
-KPX f comma -30
-KPX f a -30
-
-KPX g r -10
-
-KPX h y -30
-
-KPX k o -20
-KPX k e -20
-
-KPX m y -15
-KPX m u -10
-
-KPX n y -15
-KPX n v -20
-KPX n u -10
-
-KPX o y -30
-KPX o x -30
-KPX o w -15
-KPX o v -15
-KPX o period -40
-KPX o comma -40
-
-KPX oslash z -55
-KPX oslash y -70
-KPX oslash x -85
-KPX oslash w -70
-KPX oslash v -70
-KPX oslash u -55
-KPX oslash t -55
-KPX oslash s -55
-KPX oslash r -55
-KPX oslash q -55
-KPX oslash period -95
-KPX oslash p -55
-KPX oslash o -55
-KPX oslash n -55
-KPX oslash m -55
-KPX oslash l -55
-KPX oslash k -55
-KPX oslash j -55
-KPX oslash i -55
-KPX oslash h -55
-KPX oslash g -55
-KPX oslash f -55
-KPX oslash e -55
-KPX oslash d -55
-KPX oslash comma -95
-KPX oslash c -55
-KPX oslash b -55
-KPX oslash a -55
-
-KPX p y -30
-KPX p period -35
-KPX p comma -35
-
-KPX period space -60
-KPX period quoteright -100
-KPX period quotedblright -100
-
-KPX quotedblright space -40
-
-KPX quoteleft quoteleft -57
-
-KPX quoteright space -70
-KPX quoteright s -50
-KPX quoteright r -50
-KPX quoteright quoteright -57
-KPX quoteright d -50
-
-KPX r y 30
-KPX r v 30
-KPX r u 15
-KPX r t 40
-KPX r semicolon 30
-KPX r period -50
-KPX r p 30
-KPX r n 25
-KPX r m 25
-KPX r l 15
-KPX r k 15
-KPX r i 15
-KPX r comma -50
-KPX r colon 30
-KPX r a -10
-
-KPX s w -30
-KPX s period -15
-KPX s comma -15
-
-KPX semicolon space -50
-
-KPX space quoteleft -60
-KPX space quotedblleft -30
-KPX space Y -90
-KPX space W -40
-KPX space V -50
-KPX space T -50
-
-KPX v period -80
-KPX v o -25
-KPX v e -25
-KPX v comma -80
-KPX v a -25
-
-KPX w period -60
-KPX w o -10
-KPX w e -10
-KPX w comma -60
-KPX w a -15
-
-KPX x e -30
-
-KPX y period -100
-KPX y o -20
-KPX y e -20
-KPX y comma -100
-KPX y a -20
-
-KPX z o -15
-KPX z e -15
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 171 195 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 171 195 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 171 195 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 171 195 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 167 175 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 171 195 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 160 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 171 195 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 171 195 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 171 195 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 171 195 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 12 195 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 12 195 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 12 195 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 12 195 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 202 195 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 217 195 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 217 195 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 217 195 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 217 195 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 217 195 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 171 195 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 194 195 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 194 195 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 194 195 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 194 195 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 171 195 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 171 195 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 148 195 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 92 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 92 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 92 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 92 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 92 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 84 0 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 69 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 92 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 92 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 92 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 92 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -22 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -22 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -22 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -22 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 84 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 92 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 92 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 92 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 92 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 92 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 69 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 92 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 92 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 92 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 92 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 69 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 69 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 69 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Helvetica-Narrow.afm b/blt3.0.1/library/afm/Helvetica-Narrow.afm
deleted file mode 100644
index 2afeb75..0000000
--- a/blt3.0.1/library/afm/Helvetica-Narrow.afm
+++ /dev/null
@@ -1,613 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
-Comment Creation Date: Thu Mar 15 11:04:57 1990
-Comment UniqueID 28380
-Comment VMusage 7572 42473
-FontName Helvetica-Narrow
-FullName Helvetica Narrow
-FamilyName Helvetica
-Weight Medium
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -136 -225 820 931
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.006
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 718
-XHeight 523
-Ascender 718
-Descender -207
-StartCharMetrics 228
-C 32 ; WX 228 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 228 ; N exclam ; B 74 0 153 718 ;
-C 34 ; WX 291 ; N quotedbl ; B 57 463 234 718 ;
-C 35 ; WX 456 ; N numbersign ; B 23 0 434 688 ;
-C 36 ; WX 456 ; N dollar ; B 26 -115 426 775 ;
-C 37 ; WX 729 ; N percent ; B 32 -19 697 703 ;
-C 38 ; WX 547 ; N ampersand ; B 36 -15 529 718 ;
-C 39 ; WX 182 ; N quoteright ; B 43 463 129 718 ;
-C 40 ; WX 273 ; N parenleft ; B 56 -207 245 733 ;
-C 41 ; WX 273 ; N parenright ; B 28 -207 217 733 ;
-C 42 ; WX 319 ; N asterisk ; B 32 431 286 718 ;
-C 43 ; WX 479 ; N plus ; B 32 0 447 505 ;
-C 44 ; WX 228 ; N comma ; B 71 -147 157 106 ;
-C 45 ; WX 273 ; N hyphen ; B 36 232 237 322 ;
-C 46 ; WX 228 ; N period ; B 71 0 157 106 ;
-C 47 ; WX 228 ; N slash ; B -14 -19 242 737 ;
-C 48 ; WX 456 ; N zero ; B 30 -19 426 703 ;
-C 49 ; WX 456 ; N one ; B 83 0 294 703 ;
-C 50 ; WX 456 ; N two ; B 21 0 416 703 ;
-C 51 ; WX 456 ; N three ; B 28 -19 428 703 ;
-C 52 ; WX 456 ; N four ; B 20 0 429 703 ;
-C 53 ; WX 456 ; N five ; B 26 -19 421 688 ;
-C 54 ; WX 456 ; N six ; B 31 -19 425 703 ;
-C 55 ; WX 456 ; N seven ; B 30 0 429 688 ;
-C 56 ; WX 456 ; N eight ; B 31 -19 424 703 ;
-C 57 ; WX 456 ; N nine ; B 34 -19 421 703 ;
-C 58 ; WX 228 ; N colon ; B 71 0 157 516 ;
-C 59 ; WX 228 ; N semicolon ; B 71 -147 157 516 ;
-C 60 ; WX 479 ; N less ; B 39 11 440 495 ;
-C 61 ; WX 479 ; N equal ; B 32 115 447 390 ;
-C 62 ; WX 479 ; N greater ; B 39 11 440 495 ;
-C 63 ; WX 456 ; N question ; B 46 0 403 727 ;
-C 64 ; WX 832 ; N at ; B 121 -19 712 737 ;
-C 65 ; WX 547 ; N A ; B 11 0 536 718 ;
-C 66 ; WX 547 ; N B ; B 61 0 514 718 ;
-C 67 ; WX 592 ; N C ; B 36 -19 558 737 ;
-C 68 ; WX 592 ; N D ; B 66 0 553 718 ;
-C 69 ; WX 547 ; N E ; B 71 0 505 718 ;
-C 70 ; WX 501 ; N F ; B 71 0 478 718 ;
-C 71 ; WX 638 ; N G ; B 39 -19 577 737 ;
-C 72 ; WX 592 ; N H ; B 63 0 530 718 ;
-C 73 ; WX 228 ; N I ; B 75 0 154 718 ;
-C 74 ; WX 410 ; N J ; B 14 -19 351 718 ;
-C 75 ; WX 547 ; N K ; B 62 0 544 718 ;
-C 76 ; WX 456 ; N L ; B 62 0 440 718 ;
-C 77 ; WX 683 ; N M ; B 60 0 624 718 ;
-C 78 ; WX 592 ; N N ; B 62 0 530 718 ;
-C 79 ; WX 638 ; N O ; B 32 -19 606 737 ;
-C 80 ; WX 547 ; N P ; B 71 0 510 718 ;
-C 81 ; WX 638 ; N Q ; B 32 -56 606 737 ;
-C 82 ; WX 592 ; N R ; B 72 0 561 718 ;
-C 83 ; WX 547 ; N S ; B 40 -19 508 737 ;
-C 84 ; WX 501 ; N T ; B 11 0 490 718 ;
-C 85 ; WX 592 ; N U ; B 65 -19 528 718 ;
-C 86 ; WX 547 ; N V ; B 16 0 531 718 ;
-C 87 ; WX 774 ; N W ; B 13 0 761 718 ;
-C 88 ; WX 547 ; N X ; B 16 0 531 718 ;
-C 89 ; WX 547 ; N Y ; B 11 0 535 718 ;
-C 90 ; WX 501 ; N Z ; B 19 0 482 718 ;
-C 91 ; WX 228 ; N bracketleft ; B 52 -196 205 722 ;
-C 92 ; WX 228 ; N backslash ; B -14 -19 242 737 ;
-C 93 ; WX 228 ; N bracketright ; B 23 -196 176 722 ;
-C 94 ; WX 385 ; N asciicircum ; B -11 264 396 688 ;
-C 95 ; WX 456 ; N underscore ; B 0 -125 456 -75 ;
-C 96 ; WX 182 ; N quoteleft ; B 53 470 139 725 ;
-C 97 ; WX 456 ; N a ; B 30 -15 435 538 ;
-C 98 ; WX 456 ; N b ; B 48 -15 424 718 ;
-C 99 ; WX 410 ; N c ; B 25 -15 391 538 ;
-C 100 ; WX 456 ; N d ; B 29 -15 409 718 ;
-C 101 ; WX 456 ; N e ; B 33 -15 423 538 ;
-C 102 ; WX 228 ; N f ; B 11 0 215 728 ; L i fi ; L l fl ;
-C 103 ; WX 456 ; N g ; B 33 -220 409 538 ;
-C 104 ; WX 456 ; N h ; B 53 0 403 718 ;
-C 105 ; WX 182 ; N i ; B 55 0 127 718 ;
-C 106 ; WX 182 ; N j ; B -13 -210 127 718 ;
-C 107 ; WX 410 ; N k ; B 55 0 411 718 ;
-C 108 ; WX 182 ; N l ; B 55 0 127 718 ;
-C 109 ; WX 683 ; N m ; B 53 0 631 538 ;
-C 110 ; WX 456 ; N n ; B 53 0 403 538 ;
-C 111 ; WX 456 ; N o ; B 29 -14 427 538 ;
-C 112 ; WX 456 ; N p ; B 48 -207 424 538 ;
-C 113 ; WX 456 ; N q ; B 29 -207 405 538 ;
-C 114 ; WX 273 ; N r ; B 63 0 272 538 ;
-C 115 ; WX 410 ; N s ; B 26 -15 380 538 ;
-C 116 ; WX 228 ; N t ; B 11 -7 211 669 ;
-C 117 ; WX 456 ; N u ; B 56 -15 401 523 ;
-C 118 ; WX 410 ; N v ; B 7 0 403 523 ;
-C 119 ; WX 592 ; N w ; B 11 0 581 523 ;
-C 120 ; WX 410 ; N x ; B 9 0 402 523 ;
-C 121 ; WX 410 ; N y ; B 9 -214 401 523 ;
-C 122 ; WX 410 ; N z ; B 25 0 385 523 ;
-C 123 ; WX 274 ; N braceleft ; B 34 -196 239 722 ;
-C 124 ; WX 213 ; N bar ; B 77 -19 137 737 ;
-C 125 ; WX 274 ; N braceright ; B 34 -196 239 722 ;
-C 126 ; WX 479 ; N asciitilde ; B 50 180 429 326 ;
-C 161 ; WX 273 ; N exclamdown ; B 97 -195 176 523 ;
-C 162 ; WX 456 ; N cent ; B 42 -115 421 623 ;
-C 163 ; WX 456 ; N sterling ; B 27 -16 442 718 ;
-C 164 ; WX 137 ; N fraction ; B -136 -19 273 703 ;
-C 165 ; WX 456 ; N yen ; B 2 0 453 688 ;
-C 166 ; WX 456 ; N florin ; B -9 -207 411 737 ;
-C 167 ; WX 456 ; N section ; B 35 -191 420 737 ;
-C 168 ; WX 456 ; N currency ; B 23 99 433 603 ;
-C 169 ; WX 157 ; N quotesingle ; B 48 463 108 718 ;
-C 170 ; WX 273 ; N quotedblleft ; B 31 470 252 725 ;
-C 171 ; WX 456 ; N guillemotleft ; B 80 108 376 446 ;
-C 172 ; WX 273 ; N guilsinglleft ; B 72 108 201 446 ;
-C 173 ; WX 273 ; N guilsinglright ; B 72 108 201 446 ;
-C 174 ; WX 410 ; N fi ; B 11 0 356 728 ;
-C 175 ; WX 410 ; N fl ; B 11 0 354 728 ;
-C 177 ; WX 456 ; N endash ; B 0 240 456 313 ;
-C 178 ; WX 456 ; N dagger ; B 35 -159 421 718 ;
-C 179 ; WX 456 ; N daggerdbl ; B 35 -159 421 718 ;
-C 180 ; WX 228 ; N periodcentered ; B 63 190 166 315 ;
-C 182 ; WX 440 ; N paragraph ; B 15 -173 408 718 ;
-C 183 ; WX 287 ; N bullet ; B 15 202 273 517 ;
-C 184 ; WX 182 ; N quotesinglbase ; B 43 -149 129 106 ;
-C 185 ; WX 273 ; N quotedblbase ; B 21 -149 242 106 ;
-C 186 ; WX 273 ; N quotedblright ; B 21 463 242 718 ;
-C 187 ; WX 456 ; N guillemotright ; B 80 108 376 446 ;
-C 188 ; WX 820 ; N ellipsis ; B 94 0 726 106 ;
-C 189 ; WX 820 ; N perthousand ; B 6 -19 815 703 ;
-C 191 ; WX 501 ; N questiondown ; B 75 -201 432 525 ;
-C 193 ; WX 273 ; N grave ; B 11 593 173 734 ;
-C 194 ; WX 273 ; N acute ; B 100 593 262 734 ;
-C 195 ; WX 273 ; N circumflex ; B 17 593 256 734 ;
-C 196 ; WX 273 ; N tilde ; B -3 606 276 722 ;
-C 197 ; WX 273 ; N macron ; B 8 627 265 684 ;
-C 198 ; WX 273 ; N breve ; B 11 595 263 731 ;
-C 199 ; WX 273 ; N dotaccent ; B 99 604 174 706 ;
-C 200 ; WX 273 ; N dieresis ; B 33 604 240 706 ;
-C 202 ; WX 273 ; N ring ; B 61 572 212 756 ;
-C 203 ; WX 273 ; N cedilla ; B 37 -225 212 0 ;
-C 205 ; WX 273 ; N hungarumlaut ; B 25 593 335 734 ;
-C 206 ; WX 273 ; N ogonek ; B 60 -225 235 0 ;
-C 207 ; WX 273 ; N caron ; B 17 593 256 734 ;
-C 208 ; WX 820 ; N emdash ; B 0 240 820 313 ;
-C 225 ; WX 820 ; N AE ; B 7 0 780 718 ;
-C 227 ; WX 303 ; N ordfeminine ; B 20 304 284 737 ;
-C 232 ; WX 456 ; N Lslash ; B -16 0 440 718 ;
-C 233 ; WX 638 ; N Oslash ; B 32 -19 607 737 ;
-C 234 ; WX 820 ; N OE ; B 30 -19 791 737 ;
-C 235 ; WX 299 ; N ordmasculine ; B 20 304 280 737 ;
-C 241 ; WX 729 ; N ae ; B 30 -15 695 538 ;
-C 245 ; WX 228 ; N dotlessi ; B 78 0 150 523 ;
-C 248 ; WX 182 ; N lslash ; B -16 0 198 718 ;
-C 249 ; WX 501 ; N oslash ; B 23 -22 440 545 ;
-C 250 ; WX 774 ; N oe ; B 29 -15 740 538 ;
-C 251 ; WX 501 ; N germandbls ; B 55 -15 468 728 ;
-C -1 ; WX 501 ; N Zcaron ; B 19 0 482 929 ;
-C -1 ; WX 410 ; N ccedilla ; B 25 -225 391 538 ;
-C -1 ; WX 410 ; N ydieresis ; B 9 -214 401 706 ;
-C -1 ; WX 456 ; N atilde ; B 30 -15 435 722 ;
-C -1 ; WX 228 ; N icircumflex ; B -5 0 234 734 ;
-C -1 ; WX 273 ; N threesuperior ; B 4 270 266 703 ;
-C -1 ; WX 456 ; N ecircumflex ; B 33 -15 423 734 ;
-C -1 ; WX 456 ; N thorn ; B 48 -207 424 718 ;
-C -1 ; WX 456 ; N egrave ; B 33 -15 423 734 ;
-C -1 ; WX 273 ; N twosuperior ; B 3 281 265 703 ;
-C -1 ; WX 456 ; N eacute ; B 33 -15 423 734 ;
-C -1 ; WX 456 ; N otilde ; B 29 -14 427 722 ;
-C -1 ; WX 547 ; N Aacute ; B 11 0 536 929 ;
-C -1 ; WX 456 ; N ocircumflex ; B 29 -14 427 734 ;
-C -1 ; WX 410 ; N yacute ; B 9 -214 401 734 ;
-C -1 ; WX 456 ; N udieresis ; B 56 -15 401 706 ;
-C -1 ; WX 684 ; N threequarters ; B 37 -19 664 703 ;
-C -1 ; WX 456 ; N acircumflex ; B 30 -15 435 734 ;
-C -1 ; WX 592 ; N Eth ; B 0 0 553 718 ;
-C -1 ; WX 456 ; N edieresis ; B 33 -15 423 706 ;
-C -1 ; WX 456 ; N ugrave ; B 56 -15 401 734 ;
-C -1 ; WX 820 ; N trademark ; B 38 306 740 718 ;
-C -1 ; WX 456 ; N ograve ; B 29 -14 427 734 ;
-C -1 ; WX 410 ; N scaron ; B 26 -15 380 734 ;
-C -1 ; WX 228 ; N Idieresis ; B 11 0 218 901 ;
-C -1 ; WX 456 ; N uacute ; B 56 -15 401 734 ;
-C -1 ; WX 456 ; N agrave ; B 30 -15 435 734 ;
-C -1 ; WX 456 ; N ntilde ; B 53 0 403 722 ;
-C -1 ; WX 456 ; N aring ; B 30 -15 435 756 ;
-C -1 ; WX 410 ; N zcaron ; B 25 0 385 734 ;
-C -1 ; WX 228 ; N Icircumflex ; B -5 0 234 929 ;
-C -1 ; WX 592 ; N Ntilde ; B 62 0 530 917 ;
-C -1 ; WX 456 ; N ucircumflex ; B 56 -15 401 734 ;
-C -1 ; WX 547 ; N Ecircumflex ; B 71 0 505 929 ;
-C -1 ; WX 228 ; N Iacute ; B 75 0 239 929 ;
-C -1 ; WX 592 ; N Ccedilla ; B 36 -225 558 737 ;
-C -1 ; WX 638 ; N Odieresis ; B 32 -19 606 901 ;
-C -1 ; WX 547 ; N Scaron ; B 40 -19 508 929 ;
-C -1 ; WX 547 ; N Edieresis ; B 71 0 505 901 ;
-C -1 ; WX 228 ; N Igrave ; B -11 0 154 929 ;
-C -1 ; WX 456 ; N adieresis ; B 30 -15 435 706 ;
-C -1 ; WX 638 ; N Ograve ; B 32 -19 606 929 ;
-C -1 ; WX 547 ; N Egrave ; B 71 0 505 929 ;
-C -1 ; WX 547 ; N Ydieresis ; B 11 0 535 901 ;
-C -1 ; WX 604 ; N registered ; B -11 -19 617 737 ;
-C -1 ; WX 638 ; N Otilde ; B 32 -19 606 917 ;
-C -1 ; WX 684 ; N onequarter ; B 60 -19 620 703 ;
-C -1 ; WX 592 ; N Ugrave ; B 65 -19 528 929 ;
-C -1 ; WX 592 ; N Ucircumflex ; B 65 -19 528 929 ;
-C -1 ; WX 547 ; N Thorn ; B 71 0 510 718 ;
-C -1 ; WX 479 ; N divide ; B 32 -19 447 524 ;
-C -1 ; WX 547 ; N Atilde ; B 11 0 536 917 ;
-C -1 ; WX 592 ; N Uacute ; B 65 -19 528 929 ;
-C -1 ; WX 638 ; N Ocircumflex ; B 32 -19 606 929 ;
-C -1 ; WX 479 ; N logicalnot ; B 32 108 447 390 ;
-C -1 ; WX 547 ; N Aring ; B 11 0 536 931 ;
-C -1 ; WX 228 ; N idieresis ; B 11 0 218 706 ;
-C -1 ; WX 228 ; N iacute ; B 78 0 239 734 ;
-C -1 ; WX 456 ; N aacute ; B 30 -15 435 734 ;
-C -1 ; WX 479 ; N plusminus ; B 32 0 447 506 ;
-C -1 ; WX 479 ; N multiply ; B 32 0 447 506 ;
-C -1 ; WX 592 ; N Udieresis ; B 65 -19 528 901 ;
-C -1 ; WX 479 ; N minus ; B 32 216 447 289 ;
-C -1 ; WX 273 ; N onesuperior ; B 35 281 182 703 ;
-C -1 ; WX 547 ; N Eacute ; B 71 0 505 929 ;
-C -1 ; WX 547 ; N Acircumflex ; B 11 0 536 929 ;
-C -1 ; WX 604 ; N copyright ; B -11 -19 617 737 ;
-C -1 ; WX 547 ; N Agrave ; B 11 0 536 929 ;
-C -1 ; WX 456 ; N odieresis ; B 29 -14 427 706 ;
-C -1 ; WX 456 ; N oacute ; B 29 -14 427 734 ;
-C -1 ; WX 328 ; N degree ; B 44 411 284 703 ;
-C -1 ; WX 228 ; N igrave ; B -11 0 151 734 ;
-C -1 ; WX 456 ; N mu ; B 56 -207 401 523 ;
-C -1 ; WX 638 ; N Oacute ; B 32 -19 606 929 ;
-C -1 ; WX 456 ; N eth ; B 29 -15 428 737 ;
-C -1 ; WX 547 ; N Adieresis ; B 11 0 536 901 ;
-C -1 ; WX 547 ; N Yacute ; B 11 0 535 929 ;
-C -1 ; WX 213 ; N brokenbar ; B 77 -19 137 737 ;
-C -1 ; WX 684 ; N onehalf ; B 35 -19 634 703 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 250
-
-KPX A y -32
-KPX A w -32
-KPX A v -32
-KPX A u -24
-KPX A Y -81
-KPX A W -40
-KPX A V -56
-KPX A U -40
-KPX A T -97
-KPX A Q -24
-KPX A O -24
-KPX A G -24
-KPX A C -24
-
-KPX B period -15
-KPX B comma -15
-KPX B U -7
-
-KPX C period -24
-KPX C comma -24
-
-KPX D period -56
-KPX D comma -56
-KPX D Y -73
-KPX D W -32
-KPX D V -56
-KPX D A -32
-
-KPX F r -36
-KPX F period -122
-KPX F o -24
-KPX F e -24
-KPX F comma -122
-KPX F a -40
-KPX F A -65
-
-KPX J u -15
-KPX J period -24
-KPX J comma -24
-KPX J a -15
-KPX J A -15
-
-KPX K y -40
-KPX K u -24
-KPX K o -32
-KPX K e -32
-KPX K O -40
-
-KPX L y -24
-KPX L quoteright -130
-KPX L quotedblright -114
-KPX L Y -114
-KPX L W -56
-KPX L V -89
-KPX L T -89
-
-KPX O period -32
-KPX O comma -32
-KPX O Y -56
-KPX O X -48
-KPX O W -24
-KPX O V -40
-KPX O T -32
-KPX O A -15
-
-KPX P period -147
-KPX P o -40
-KPX P e -40
-KPX P comma -147
-KPX P a -32
-KPX P A -97
-
-KPX Q U -7
-
-KPX R Y -40
-KPX R W -24
-KPX R V -40
-KPX R U -32
-KPX R T -24
-KPX R O -15
-
-KPX S period -15
-KPX S comma -15
-
-KPX T y -97
-KPX T w -97
-KPX T u -97
-KPX T semicolon -15
-KPX T r -97
-KPX T period -97
-KPX T o -97
-KPX T hyphen -114
-KPX T e -97
-KPX T comma -97
-KPX T colon -15
-KPX T a -97
-KPX T O -32
-KPX T A -97
-
-KPX U period -32
-KPX U comma -32
-KPX U A -32
-
-KPX V u -56
-KPX V semicolon -32
-KPX V period -102
-KPX V o -65
-KPX V hyphen -65
-KPX V e -65
-KPX V comma -102
-KPX V colon -32
-KPX V a -56
-KPX V O -32
-KPX V G -32
-KPX V A -65
-
-KPX W y -15
-KPX W u -24
-KPX W period -65
-KPX W o -24
-KPX W hyphen -32
-KPX W e -24
-KPX W comma -65
-KPX W a -32
-KPX W O -15
-KPX W A -40
-
-KPX Y u -89
-KPX Y semicolon -48
-KPX Y period -114
-KPX Y o -114
-KPX Y i -15
-KPX Y hyphen -114
-KPX Y e -114
-KPX Y comma -114
-KPX Y colon -48
-KPX Y a -114
-KPX Y O -69
-KPX Y A -89
-
-KPX a y -24
-KPX a w -15
-KPX a v -15
-
-KPX b y -15
-KPX b v -15
-KPX b u -15
-KPX b period -32
-KPX b l -15
-KPX b comma -32
-KPX b b -7
-
-KPX c k -15
-KPX c comma -11
-
-KPX colon space -40
-
-KPX comma quoteright -81
-KPX comma quotedblright -81
-
-KPX e y -15
-KPX e x -24
-KPX e w -15
-KPX e v -24
-KPX e period -11
-KPX e comma -11
-
-KPX f quoteright 41
-KPX f quotedblright 49
-KPX f period -24
-KPX f o -24
-KPX f e -24
-KPX f dotlessi -22
-KPX f comma -24
-KPX f a -24
-
-KPX g r -7
-
-KPX h y -24
-
-KPX k o -15
-KPX k e -15
-
-KPX m y -11
-KPX m u -7
-
-KPX n y -11
-KPX n v -15
-KPX n u -7
-
-KPX o y -24
-KPX o x -24
-KPX o w -11
-KPX o v -11
-KPX o period -32
-KPX o comma -32
-
-KPX oslash z -44
-KPX oslash y -56
-KPX oslash x -69
-KPX oslash w -56
-KPX oslash v -56
-KPX oslash u -44
-KPX oslash t -44
-KPX oslash s -44
-KPX oslash r -44
-KPX oslash q -44
-KPX oslash period -77
-KPX oslash p -44
-KPX oslash o -44
-KPX oslash n -44
-KPX oslash m -44
-KPX oslash l -44
-KPX oslash k -44
-KPX oslash j -44
-KPX oslash i -44
-KPX oslash h -44
-KPX oslash g -44
-KPX oslash f -44
-KPX oslash e -44
-KPX oslash d -44
-KPX oslash comma -77
-KPX oslash c -44
-KPX oslash b -44
-KPX oslash a -44
-
-KPX p y -24
-KPX p period -28
-KPX p comma -28
-
-KPX period space -48
-KPX period quoteright -81
-KPX period quotedblright -81
-
-KPX quotedblright space -32
-
-KPX quoteleft quoteleft -46
-
-KPX quoteright space -56
-KPX quoteright s -40
-KPX quoteright r -40
-KPX quoteright quoteright -46
-KPX quoteright d -40
-
-KPX r y 25
-KPX r v 25
-KPX r u 12
-KPX r t 33
-KPX r semicolon 25
-KPX r period -40
-KPX r p 25
-KPX r n 21
-KPX r m 21
-KPX r l 12
-KPX r k 12
-KPX r i 12
-KPX r comma -40
-KPX r colon 25
-KPX r a -7
-
-KPX s w -24
-KPX s period -11
-KPX s comma -11
-
-KPX semicolon space -40
-
-KPX space quoteleft -48
-KPX space quotedblleft -24
-KPX space Y -73
-KPX space W -32
-KPX space V -40
-KPX space T -40
-
-KPX v period -65
-KPX v o -20
-KPX v e -20
-KPX v comma -65
-KPX v a -20
-
-KPX w period -48
-KPX w o -7
-KPX w e -7
-KPX w comma -48
-KPX w a -11
-
-KPX x e -24
-
-KPX y period -81
-KPX y o -15
-KPX y e -15
-KPX y comma -81
-KPX y a -15
-
-KPX z o -11
-KPX z e -11
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 137 195 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 137 195 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 137 195 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 137 195 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 137 175 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 137 195 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 160 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 137 195 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 137 195 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 137 195 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 137 195 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute -22 195 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -22 195 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -22 195 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave -22 195 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 168 195 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 183 195 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 183 195 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 183 195 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 183 195 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 183 195 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 137 195 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 160 195 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 160 195 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 160 195 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 160 195 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 137 195 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 137 195 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 114 195 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 92 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 92 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 92 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 92 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 92 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 84 0 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 69 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 92 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 92 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 92 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 92 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -22 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -22 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -22 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -22 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 84 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 92 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 92 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 92 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 92 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 92 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 69 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 92 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 92 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 92 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 92 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 69 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 69 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 69 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Helvetica-Oblique.afm b/blt3.0.1/library/afm/Helvetica-Oblique.afm
deleted file mode 100644
index 4f0476f..0000000
--- a/blt3.0.1/library/afm/Helvetica-Oblique.afm
+++ /dev/null
@@ -1,613 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
-Comment Creation Date: Thu Mar 15 10:24:18 1990
-Comment UniqueID 28362
-Comment VMusage 7572 42473
-FontName Helvetica-Oblique
-FullName Helvetica Oblique
-FamilyName Helvetica
-Weight Medium
-ItalicAngle -12
-IsFixedPitch false
-FontBBox -170 -225 1116 931
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.006
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 718
-XHeight 523
-Ascender 718
-Descender -207
-StartCharMetrics 228
-C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 278 ; N exclam ; B 90 0 340 718 ;
-C 34 ; WX 355 ; N quotedbl ; B 168 463 438 718 ;
-C 35 ; WX 556 ; N numbersign ; B 73 0 631 688 ;
-C 36 ; WX 556 ; N dollar ; B 69 -115 617 775 ;
-C 37 ; WX 889 ; N percent ; B 147 -19 889 703 ;
-C 38 ; WX 667 ; N ampersand ; B 77 -15 647 718 ;
-C 39 ; WX 222 ; N quoteright ; B 151 463 310 718 ;
-C 40 ; WX 333 ; N parenleft ; B 108 -207 454 733 ;
-C 41 ; WX 333 ; N parenright ; B -9 -207 337 733 ;
-C 42 ; WX 389 ; N asterisk ; B 165 431 475 718 ;
-C 43 ; WX 584 ; N plus ; B 85 0 606 505 ;
-C 44 ; WX 278 ; N comma ; B 56 -147 214 106 ;
-C 45 ; WX 333 ; N hyphen ; B 93 232 357 322 ;
-C 46 ; WX 278 ; N period ; B 87 0 214 106 ;
-C 47 ; WX 278 ; N slash ; B -21 -19 452 737 ;
-C 48 ; WX 556 ; N zero ; B 93 -19 608 703 ;
-C 49 ; WX 556 ; N one ; B 207 0 508 703 ;
-C 50 ; WX 556 ; N two ; B 26 0 617 703 ;
-C 51 ; WX 556 ; N three ; B 75 -19 610 703 ;
-C 52 ; WX 556 ; N four ; B 61 0 576 703 ;
-C 53 ; WX 556 ; N five ; B 68 -19 621 688 ;
-C 54 ; WX 556 ; N six ; B 91 -19 615 703 ;
-C 55 ; WX 556 ; N seven ; B 137 0 669 688 ;
-C 56 ; WX 556 ; N eight ; B 74 -19 607 703 ;
-C 57 ; WX 556 ; N nine ; B 82 -19 609 703 ;
-C 58 ; WX 278 ; N colon ; B 87 0 301 516 ;
-C 59 ; WX 278 ; N semicolon ; B 56 -147 301 516 ;
-C 60 ; WX 584 ; N less ; B 94 11 641 495 ;
-C 61 ; WX 584 ; N equal ; B 63 115 628 390 ;
-C 62 ; WX 584 ; N greater ; B 50 11 597 495 ;
-C 63 ; WX 556 ; N question ; B 161 0 610 727 ;
-C 64 ; WX 1015 ; N at ; B 215 -19 965 737 ;
-C 65 ; WX 667 ; N A ; B 14 0 654 718 ;
-C 66 ; WX 667 ; N B ; B 74 0 712 718 ;
-C 67 ; WX 722 ; N C ; B 108 -19 782 737 ;
-C 68 ; WX 722 ; N D ; B 81 0 764 718 ;
-C 69 ; WX 667 ; N E ; B 86 0 762 718 ;
-C 70 ; WX 611 ; N F ; B 86 0 736 718 ;
-C 71 ; WX 778 ; N G ; B 111 -19 799 737 ;
-C 72 ; WX 722 ; N H ; B 77 0 799 718 ;
-C 73 ; WX 278 ; N I ; B 91 0 341 718 ;
-C 74 ; WX 500 ; N J ; B 47 -19 581 718 ;
-C 75 ; WX 667 ; N K ; B 76 0 808 718 ;
-C 76 ; WX 556 ; N L ; B 76 0 555 718 ;
-C 77 ; WX 833 ; N M ; B 73 0 914 718 ;
-C 78 ; WX 722 ; N N ; B 76 0 799 718 ;
-C 79 ; WX 778 ; N O ; B 105 -19 826 737 ;
-C 80 ; WX 667 ; N P ; B 86 0 737 718 ;
-C 81 ; WX 778 ; N Q ; B 105 -56 826 737 ;
-C 82 ; WX 722 ; N R ; B 88 0 773 718 ;
-C 83 ; WX 667 ; N S ; B 90 -19 713 737 ;
-C 84 ; WX 611 ; N T ; B 148 0 750 718 ;
-C 85 ; WX 722 ; N U ; B 123 -19 797 718 ;
-C 86 ; WX 667 ; N V ; B 173 0 800 718 ;
-C 87 ; WX 944 ; N W ; B 169 0 1081 718 ;
-C 88 ; WX 667 ; N X ; B 19 0 790 718 ;
-C 89 ; WX 667 ; N Y ; B 167 0 806 718 ;
-C 90 ; WX 611 ; N Z ; B 23 0 741 718 ;
-C 91 ; WX 278 ; N bracketleft ; B 21 -196 403 722 ;
-C 92 ; WX 278 ; N backslash ; B 140 -19 291 737 ;
-C 93 ; WX 278 ; N bracketright ; B -14 -196 368 722 ;
-C 94 ; WX 469 ; N asciicircum ; B 42 264 539 688 ;
-C 95 ; WX 556 ; N underscore ; B -27 -125 540 -75 ;
-C 96 ; WX 222 ; N quoteleft ; B 165 470 323 725 ;
-C 97 ; WX 556 ; N a ; B 61 -15 559 538 ;
-C 98 ; WX 556 ; N b ; B 58 -15 584 718 ;
-C 99 ; WX 500 ; N c ; B 74 -15 553 538 ;
-C 100 ; WX 556 ; N d ; B 84 -15 652 718 ;
-C 101 ; WX 556 ; N e ; B 84 -15 578 538 ;
-C 102 ; WX 278 ; N f ; B 86 0 416 728 ; L i fi ; L l fl ;
-C 103 ; WX 556 ; N g ; B 42 -220 610 538 ;
-C 104 ; WX 556 ; N h ; B 65 0 573 718 ;
-C 105 ; WX 222 ; N i ; B 67 0 308 718 ;
-C 106 ; WX 222 ; N j ; B -60 -210 308 718 ;
-C 107 ; WX 500 ; N k ; B 67 0 600 718 ;
-C 108 ; WX 222 ; N l ; B 67 0 308 718 ;
-C 109 ; WX 833 ; N m ; B 65 0 852 538 ;
-C 110 ; WX 556 ; N n ; B 65 0 573 538 ;
-C 111 ; WX 556 ; N o ; B 83 -14 585 538 ;
-C 112 ; WX 556 ; N p ; B 14 -207 584 538 ;
-C 113 ; WX 556 ; N q ; B 84 -207 605 538 ;
-C 114 ; WX 333 ; N r ; B 77 0 446 538 ;
-C 115 ; WX 500 ; N s ; B 63 -15 529 538 ;
-C 116 ; WX 278 ; N t ; B 102 -7 368 669 ;
-C 117 ; WX 556 ; N u ; B 94 -15 600 523 ;
-C 118 ; WX 500 ; N v ; B 119 0 603 523 ;
-C 119 ; WX 722 ; N w ; B 125 0 820 523 ;
-C 120 ; WX 500 ; N x ; B 11 0 594 523 ;
-C 121 ; WX 500 ; N y ; B 15 -214 600 523 ;
-C 122 ; WX 500 ; N z ; B 31 0 571 523 ;
-C 123 ; WX 334 ; N braceleft ; B 92 -196 445 722 ;
-C 124 ; WX 260 ; N bar ; B 90 -19 324 737 ;
-C 125 ; WX 334 ; N braceright ; B 0 -196 354 722 ;
-C 126 ; WX 584 ; N asciitilde ; B 111 180 580 326 ;
-C 161 ; WX 333 ; N exclamdown ; B 77 -195 326 523 ;
-C 162 ; WX 556 ; N cent ; B 95 -115 584 623 ;
-C 163 ; WX 556 ; N sterling ; B 49 -16 634 718 ;
-C 164 ; WX 167 ; N fraction ; B -170 -19 482 703 ;
-C 165 ; WX 556 ; N yen ; B 81 0 699 688 ;
-C 166 ; WX 556 ; N florin ; B -52 -207 654 737 ;
-C 167 ; WX 556 ; N section ; B 76 -191 584 737 ;
-C 168 ; WX 556 ; N currency ; B 60 99 646 603 ;
-C 169 ; WX 191 ; N quotesingle ; B 157 463 285 718 ;
-C 170 ; WX 333 ; N quotedblleft ; B 138 470 461 725 ;
-C 171 ; WX 556 ; N guillemotleft ; B 146 108 554 446 ;
-C 172 ; WX 333 ; N guilsinglleft ; B 137 108 340 446 ;
-C 173 ; WX 333 ; N guilsinglright ; B 111 108 314 446 ;
-C 174 ; WX 500 ; N fi ; B 86 0 587 728 ;
-C 175 ; WX 500 ; N fl ; B 86 0 585 728 ;
-C 177 ; WX 556 ; N endash ; B 51 240 623 313 ;
-C 178 ; WX 556 ; N dagger ; B 135 -159 622 718 ;
-C 179 ; WX 556 ; N daggerdbl ; B 52 -159 623 718 ;
-C 180 ; WX 278 ; N periodcentered ; B 129 190 257 315 ;
-C 182 ; WX 537 ; N paragraph ; B 126 -173 650 718 ;
-C 183 ; WX 350 ; N bullet ; B 91 202 413 517 ;
-C 184 ; WX 222 ; N quotesinglbase ; B 21 -149 180 106 ;
-C 185 ; WX 333 ; N quotedblbase ; B -6 -149 318 106 ;
-C 186 ; WX 333 ; N quotedblright ; B 124 463 448 718 ;
-C 187 ; WX 556 ; N guillemotright ; B 120 108 528 446 ;
-C 188 ; WX 1000 ; N ellipsis ; B 115 0 908 106 ;
-C 189 ; WX 1000 ; N perthousand ; B 88 -19 1029 703 ;
-C 191 ; WX 611 ; N questiondown ; B 85 -201 534 525 ;
-C 193 ; WX 333 ; N grave ; B 170 593 337 734 ;
-C 194 ; WX 333 ; N acute ; B 248 593 475 734 ;
-C 195 ; WX 333 ; N circumflex ; B 147 593 438 734 ;
-C 196 ; WX 333 ; N tilde ; B 125 606 490 722 ;
-C 197 ; WX 333 ; N macron ; B 143 627 468 684 ;
-C 198 ; WX 333 ; N breve ; B 167 595 476 731 ;
-C 199 ; WX 333 ; N dotaccent ; B 249 604 362 706 ;
-C 200 ; WX 333 ; N dieresis ; B 168 604 443 706 ;
-C 202 ; WX 333 ; N ring ; B 214 572 402 756 ;
-C 203 ; WX 333 ; N cedilla ; B 2 -225 232 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B 157 593 565 734 ;
-C 206 ; WX 333 ; N ogonek ; B 43 -225 249 0 ;
-C 207 ; WX 333 ; N caron ; B 177 593 468 734 ;
-C 208 ; WX 1000 ; N emdash ; B 51 240 1067 313 ;
-C 225 ; WX 1000 ; N AE ; B 8 0 1097 718 ;
-C 227 ; WX 370 ; N ordfeminine ; B 100 304 449 737 ;
-C 232 ; WX 556 ; N Lslash ; B 41 0 555 718 ;
-C 233 ; WX 778 ; N Oslash ; B 43 -19 890 737 ;
-C 234 ; WX 1000 ; N OE ; B 98 -19 1116 737 ;
-C 235 ; WX 365 ; N ordmasculine ; B 100 304 468 737 ;
-C 241 ; WX 889 ; N ae ; B 61 -15 909 538 ;
-C 245 ; WX 278 ; N dotlessi ; B 95 0 294 523 ;
-C 248 ; WX 222 ; N lslash ; B 41 0 347 718 ;
-C 249 ; WX 611 ; N oslash ; B 29 -22 647 545 ;
-C 250 ; WX 944 ; N oe ; B 83 -15 964 538 ;
-C 251 ; WX 611 ; N germandbls ; B 67 -15 658 728 ;
-C -1 ; WX 611 ; N Zcaron ; B 23 0 741 929 ;
-C -1 ; WX 500 ; N ccedilla ; B 74 -225 553 538 ;
-C -1 ; WX 500 ; N ydieresis ; B 15 -214 600 706 ;
-C -1 ; WX 556 ; N atilde ; B 61 -15 592 722 ;
-C -1 ; WX 278 ; N icircumflex ; B 95 0 411 734 ;
-C -1 ; WX 333 ; N threesuperior ; B 90 270 436 703 ;
-C -1 ; WX 556 ; N ecircumflex ; B 84 -15 578 734 ;
-C -1 ; WX 556 ; N thorn ; B 14 -207 584 718 ;
-C -1 ; WX 556 ; N egrave ; B 84 -15 578 734 ;
-C -1 ; WX 333 ; N twosuperior ; B 64 281 449 703 ;
-C -1 ; WX 556 ; N eacute ; B 84 -15 587 734 ;
-C -1 ; WX 556 ; N otilde ; B 83 -14 602 722 ;
-C -1 ; WX 667 ; N Aacute ; B 14 0 683 929 ;
-C -1 ; WX 556 ; N ocircumflex ; B 83 -14 585 734 ;
-C -1 ; WX 500 ; N yacute ; B 15 -214 600 734 ;
-C -1 ; WX 556 ; N udieresis ; B 94 -15 600 706 ;
-C -1 ; WX 834 ; N threequarters ; B 130 -19 861 703 ;
-C -1 ; WX 556 ; N acircumflex ; B 61 -15 559 734 ;
-C -1 ; WX 722 ; N Eth ; B 69 0 764 718 ;
-C -1 ; WX 556 ; N edieresis ; B 84 -15 578 706 ;
-C -1 ; WX 556 ; N ugrave ; B 94 -15 600 734 ;
-C -1 ; WX 1000 ; N trademark ; B 186 306 1056 718 ;
-C -1 ; WX 556 ; N ograve ; B 83 -14 585 734 ;
-C -1 ; WX 500 ; N scaron ; B 63 -15 552 734 ;
-C -1 ; WX 278 ; N Idieresis ; B 91 0 458 901 ;
-C -1 ; WX 556 ; N uacute ; B 94 -15 600 734 ;
-C -1 ; WX 556 ; N agrave ; B 61 -15 559 734 ;
-C -1 ; WX 556 ; N ntilde ; B 65 0 592 722 ;
-C -1 ; WX 556 ; N aring ; B 61 -15 559 756 ;
-C -1 ; WX 500 ; N zcaron ; B 31 0 571 734 ;
-C -1 ; WX 278 ; N Icircumflex ; B 91 0 452 929 ;
-C -1 ; WX 722 ; N Ntilde ; B 76 0 799 917 ;
-C -1 ; WX 556 ; N ucircumflex ; B 94 -15 600 734 ;
-C -1 ; WX 667 ; N Ecircumflex ; B 86 0 762 929 ;
-C -1 ; WX 278 ; N Iacute ; B 91 0 489 929 ;
-C -1 ; WX 722 ; N Ccedilla ; B 108 -225 782 737 ;
-C -1 ; WX 778 ; N Odieresis ; B 105 -19 826 901 ;
-C -1 ; WX 667 ; N Scaron ; B 90 -19 713 929 ;
-C -1 ; WX 667 ; N Edieresis ; B 86 0 762 901 ;
-C -1 ; WX 278 ; N Igrave ; B 91 0 351 929 ;
-C -1 ; WX 556 ; N adieresis ; B 61 -15 559 706 ;
-C -1 ; WX 778 ; N Ograve ; B 105 -19 826 929 ;
-C -1 ; WX 667 ; N Egrave ; B 86 0 762 929 ;
-C -1 ; WX 667 ; N Ydieresis ; B 167 0 806 901 ;
-C -1 ; WX 737 ; N registered ; B 54 -19 837 737 ;
-C -1 ; WX 778 ; N Otilde ; B 105 -19 826 917 ;
-C -1 ; WX 834 ; N onequarter ; B 150 -19 802 703 ;
-C -1 ; WX 722 ; N Ugrave ; B 123 -19 797 929 ;
-C -1 ; WX 722 ; N Ucircumflex ; B 123 -19 797 929 ;
-C -1 ; WX 667 ; N Thorn ; B 86 0 712 718 ;
-C -1 ; WX 584 ; N divide ; B 85 -19 606 524 ;
-C -1 ; WX 667 ; N Atilde ; B 14 0 699 917 ;
-C -1 ; WX 722 ; N Uacute ; B 123 -19 797 929 ;
-C -1 ; WX 778 ; N Ocircumflex ; B 105 -19 826 929 ;
-C -1 ; WX 584 ; N logicalnot ; B 106 108 628 390 ;
-C -1 ; WX 667 ; N Aring ; B 14 0 654 931 ;
-C -1 ; WX 278 ; N idieresis ; B 95 0 416 706 ;
-C -1 ; WX 278 ; N iacute ; B 95 0 448 734 ;
-C -1 ; WX 556 ; N aacute ; B 61 -15 587 734 ;
-C -1 ; WX 584 ; N plusminus ; B 39 0 618 506 ;
-C -1 ; WX 584 ; N multiply ; B 50 0 642 506 ;
-C -1 ; WX 722 ; N Udieresis ; B 123 -19 797 901 ;
-C -1 ; WX 584 ; N minus ; B 85 216 606 289 ;
-C -1 ; WX 333 ; N onesuperior ; B 166 281 371 703 ;
-C -1 ; WX 667 ; N Eacute ; B 86 0 762 929 ;
-C -1 ; WX 667 ; N Acircumflex ; B 14 0 654 929 ;
-C -1 ; WX 737 ; N copyright ; B 54 -19 837 737 ;
-C -1 ; WX 667 ; N Agrave ; B 14 0 654 929 ;
-C -1 ; WX 556 ; N odieresis ; B 83 -14 585 706 ;
-C -1 ; WX 556 ; N oacute ; B 83 -14 587 734 ;
-C -1 ; WX 400 ; N degree ; B 169 411 468 703 ;
-C -1 ; WX 278 ; N igrave ; B 95 0 310 734 ;
-C -1 ; WX 556 ; N mu ; B 24 -207 600 523 ;
-C -1 ; WX 778 ; N Oacute ; B 105 -19 826 929 ;
-C -1 ; WX 556 ; N eth ; B 81 -15 617 737 ;
-C -1 ; WX 667 ; N Adieresis ; B 14 0 654 901 ;
-C -1 ; WX 667 ; N Yacute ; B 167 0 806 929 ;
-C -1 ; WX 260 ; N brokenbar ; B 90 -19 324 737 ;
-C -1 ; WX 834 ; N onehalf ; B 114 -19 839 703 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 250
-
-KPX A y -40
-KPX A w -40
-KPX A v -40
-KPX A u -30
-KPX A Y -100
-KPX A W -50
-KPX A V -70
-KPX A U -50
-KPX A T -120
-KPX A Q -30
-KPX A O -30
-KPX A G -30
-KPX A C -30
-
-KPX B period -20
-KPX B comma -20
-KPX B U -10
-
-KPX C period -30
-KPX C comma -30
-
-KPX D period -70
-KPX D comma -70
-KPX D Y -90
-KPX D W -40
-KPX D V -70
-KPX D A -40
-
-KPX F r -45
-KPX F period -150
-KPX F o -30
-KPX F e -30
-KPX F comma -150
-KPX F a -50
-KPX F A -80
-
-KPX J u -20
-KPX J period -30
-KPX J comma -30
-KPX J a -20
-KPX J A -20
-
-KPX K y -50
-KPX K u -30
-KPX K o -40
-KPX K e -40
-KPX K O -50
-
-KPX L y -30
-KPX L quoteright -160
-KPX L quotedblright -140
-KPX L Y -140
-KPX L W -70
-KPX L V -110
-KPX L T -110
-
-KPX O period -40
-KPX O comma -40
-KPX O Y -70
-KPX O X -60
-KPX O W -30
-KPX O V -50
-KPX O T -40
-KPX O A -20
-
-KPX P period -180
-KPX P o -50
-KPX P e -50
-KPX P comma -180
-KPX P a -40
-KPX P A -120
-
-KPX Q U -10
-
-KPX R Y -50
-KPX R W -30
-KPX R V -50
-KPX R U -40
-KPX R T -30
-KPX R O -20
-
-KPX S period -20
-KPX S comma -20
-
-KPX T y -120
-KPX T w -120
-KPX T u -120
-KPX T semicolon -20
-KPX T r -120
-KPX T period -120
-KPX T o -120
-KPX T hyphen -140
-KPX T e -120
-KPX T comma -120
-KPX T colon -20
-KPX T a -120
-KPX T O -40
-KPX T A -120
-
-KPX U period -40
-KPX U comma -40
-KPX U A -40
-
-KPX V u -70
-KPX V semicolon -40
-KPX V period -125
-KPX V o -80
-KPX V hyphen -80
-KPX V e -80
-KPX V comma -125
-KPX V colon -40
-KPX V a -70
-KPX V O -40
-KPX V G -40
-KPX V A -80
-
-KPX W y -20
-KPX W u -30
-KPX W period -80
-KPX W o -30
-KPX W hyphen -40
-KPX W e -30
-KPX W comma -80
-KPX W a -40
-KPX W O -20
-KPX W A -50
-
-KPX Y u -110
-KPX Y semicolon -60
-KPX Y period -140
-KPX Y o -140
-KPX Y i -20
-KPX Y hyphen -140
-KPX Y e -140
-KPX Y comma -140
-KPX Y colon -60
-KPX Y a -140
-KPX Y O -85
-KPX Y A -110
-
-KPX a y -30
-KPX a w -20
-KPX a v -20
-
-KPX b y -20
-KPX b v -20
-KPX b u -20
-KPX b period -40
-KPX b l -20
-KPX b comma -40
-KPX b b -10
-
-KPX c k -20
-KPX c comma -15
-
-KPX colon space -50
-
-KPX comma quoteright -100
-KPX comma quotedblright -100
-
-KPX e y -20
-KPX e x -30
-KPX e w -20
-KPX e v -30
-KPX e period -15
-KPX e comma -15
-
-KPX f quoteright 50
-KPX f quotedblright 60
-KPX f period -30
-KPX f o -30
-KPX f e -30
-KPX f dotlessi -28
-KPX f comma -30
-KPX f a -30
-
-KPX g r -10
-
-KPX h y -30
-
-KPX k o -20
-KPX k e -20
-
-KPX m y -15
-KPX m u -10
-
-KPX n y -15
-KPX n v -20
-KPX n u -10
-
-KPX o y -30
-KPX o x -30
-KPX o w -15
-KPX o v -15
-KPX o period -40
-KPX o comma -40
-
-KPX oslash z -55
-KPX oslash y -70
-KPX oslash x -85
-KPX oslash w -70
-KPX oslash v -70
-KPX oslash u -55
-KPX oslash t -55
-KPX oslash s -55
-KPX oslash r -55
-KPX oslash q -55
-KPX oslash period -95
-KPX oslash p -55
-KPX oslash o -55
-KPX oslash n -55
-KPX oslash m -55
-KPX oslash l -55
-KPX oslash k -55
-KPX oslash j -55
-KPX oslash i -55
-KPX oslash h -55
-KPX oslash g -55
-KPX oslash f -55
-KPX oslash e -55
-KPX oslash d -55
-KPX oslash comma -95
-KPX oslash c -55
-KPX oslash b -55
-KPX oslash a -55
-
-KPX p y -30
-KPX p period -35
-KPX p comma -35
-
-KPX period space -60
-KPX period quoteright -100
-KPX period quotedblright -100
-
-KPX quotedblright space -40
-
-KPX quoteleft quoteleft -57
-
-KPX quoteright space -70
-KPX quoteright s -50
-KPX quoteright r -50
-KPX quoteright quoteright -57
-KPX quoteright d -50
-
-KPX r y 30
-KPX r v 30
-KPX r u 15
-KPX r t 40
-KPX r semicolon 30
-KPX r period -50
-KPX r p 30
-KPX r n 25
-KPX r m 25
-KPX r l 15
-KPX r k 15
-KPX r i 15
-KPX r comma -50
-KPX r colon 30
-KPX r a -10
-
-KPX s w -30
-KPX s period -15
-KPX s comma -15
-
-KPX semicolon space -50
-
-KPX space quoteleft -60
-KPX space quotedblleft -30
-KPX space Y -90
-KPX space W -40
-KPX space V -50
-KPX space T -50
-
-KPX v period -80
-KPX v o -25
-KPX v e -25
-KPX v comma -80
-KPX v a -25
-
-KPX w period -60
-KPX w o -10
-KPX w e -10
-KPX w comma -60
-KPX w a -15
-
-KPX x e -30
-
-KPX y period -100
-KPX y o -20
-KPX y e -20
-KPX y comma -100
-KPX y a -20
-
-KPX z o -15
-KPX z e -15
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 208 195 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 208 195 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 208 195 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 208 195 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 204 175 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 208 195 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 195 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 208 195 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 208 195 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 208 195 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 208 195 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 14 195 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 14 195 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 14 195 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 14 195 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 246 195 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 264 195 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 264 195 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 264 195 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 264 195 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 264 195 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 208 195 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 236 195 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 236 195 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 236 195 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 236 195 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 208 195 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 208 195 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 180 195 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 112 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 112 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 112 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 112 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 112 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 102 0 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 84 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 112 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 112 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 112 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 112 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 102 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 112 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 112 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 112 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 112 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 112 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 84 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 112 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 112 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 112 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 112 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 84 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 84 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Helvetica.afm b/blt3.0.1/library/afm/Helvetica.afm
deleted file mode 100644
index 80d8cff..0000000
--- a/blt3.0.1/library/afm/Helvetica.afm
+++ /dev/null
@@ -1,613 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
-Comment Creation Date: Thu Mar 15 08:58:00 1990
-Comment UniqueID 28352
-Comment VMusage 26389 33281
-FontName Helvetica
-FullName Helvetica
-FamilyName Helvetica
-Weight Medium
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -166 -225 1000 931
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.006
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 718
-XHeight 523
-Ascender 718
-Descender -207
-StartCharMetrics 228
-C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 278 ; N exclam ; B 90 0 187 718 ;
-C 34 ; WX 355 ; N quotedbl ; B 70 463 285 718 ;
-C 35 ; WX 556 ; N numbersign ; B 28 0 529 688 ;
-C 36 ; WX 556 ; N dollar ; B 32 -115 520 775 ;
-C 37 ; WX 889 ; N percent ; B 39 -19 850 703 ;
-C 38 ; WX 667 ; N ampersand ; B 44 -15 645 718 ;
-C 39 ; WX 222 ; N quoteright ; B 53 463 157 718 ;
-C 40 ; WX 333 ; N parenleft ; B 68 -207 299 733 ;
-C 41 ; WX 333 ; N parenright ; B 34 -207 265 733 ;
-C 42 ; WX 389 ; N asterisk ; B 39 431 349 718 ;
-C 43 ; WX 584 ; N plus ; B 39 0 545 505 ;
-C 44 ; WX 278 ; N comma ; B 87 -147 191 106 ;
-C 45 ; WX 333 ; N hyphen ; B 44 232 289 322 ;
-C 46 ; WX 278 ; N period ; B 87 0 191 106 ;
-C 47 ; WX 278 ; N slash ; B -17 -19 295 737 ;
-C 48 ; WX 556 ; N zero ; B 37 -19 519 703 ;
-C 49 ; WX 556 ; N one ; B 101 0 359 703 ;
-C 50 ; WX 556 ; N two ; B 26 0 507 703 ;
-C 51 ; WX 556 ; N three ; B 34 -19 522 703 ;
-C 52 ; WX 556 ; N four ; B 25 0 523 703 ;
-C 53 ; WX 556 ; N five ; B 32 -19 514 688 ;
-C 54 ; WX 556 ; N six ; B 38 -19 518 703 ;
-C 55 ; WX 556 ; N seven ; B 37 0 523 688 ;
-C 56 ; WX 556 ; N eight ; B 38 -19 517 703 ;
-C 57 ; WX 556 ; N nine ; B 42 -19 514 703 ;
-C 58 ; WX 278 ; N colon ; B 87 0 191 516 ;
-C 59 ; WX 278 ; N semicolon ; B 87 -147 191 516 ;
-C 60 ; WX 584 ; N less ; B 48 11 536 495 ;
-C 61 ; WX 584 ; N equal ; B 39 115 545 390 ;
-C 62 ; WX 584 ; N greater ; B 48 11 536 495 ;
-C 63 ; WX 556 ; N question ; B 56 0 492 727 ;
-C 64 ; WX 1015 ; N at ; B 147 -19 868 737 ;
-C 65 ; WX 667 ; N A ; B 14 0 654 718 ;
-C 66 ; WX 667 ; N B ; B 74 0 627 718 ;
-C 67 ; WX 722 ; N C ; B 44 -19 681 737 ;
-C 68 ; WX 722 ; N D ; B 81 0 674 718 ;
-C 69 ; WX 667 ; N E ; B 86 0 616 718 ;
-C 70 ; WX 611 ; N F ; B 86 0 583 718 ;
-C 71 ; WX 778 ; N G ; B 48 -19 704 737 ;
-C 72 ; WX 722 ; N H ; B 77 0 646 718 ;
-C 73 ; WX 278 ; N I ; B 91 0 188 718 ;
-C 74 ; WX 500 ; N J ; B 17 -19 428 718 ;
-C 75 ; WX 667 ; N K ; B 76 0 663 718 ;
-C 76 ; WX 556 ; N L ; B 76 0 537 718 ;
-C 77 ; WX 833 ; N M ; B 73 0 761 718 ;
-C 78 ; WX 722 ; N N ; B 76 0 646 718 ;
-C 79 ; WX 778 ; N O ; B 39 -19 739 737 ;
-C 80 ; WX 667 ; N P ; B 86 0 622 718 ;
-C 81 ; WX 778 ; N Q ; B 39 -56 739 737 ;
-C 82 ; WX 722 ; N R ; B 88 0 684 718 ;
-C 83 ; WX 667 ; N S ; B 49 -19 620 737 ;
-C 84 ; WX 611 ; N T ; B 14 0 597 718 ;
-C 85 ; WX 722 ; N U ; B 79 -19 644 718 ;
-C 86 ; WX 667 ; N V ; B 20 0 647 718 ;
-C 87 ; WX 944 ; N W ; B 16 0 928 718 ;
-C 88 ; WX 667 ; N X ; B 19 0 648 718 ;
-C 89 ; WX 667 ; N Y ; B 14 0 653 718 ;
-C 90 ; WX 611 ; N Z ; B 23 0 588 718 ;
-C 91 ; WX 278 ; N bracketleft ; B 63 -196 250 722 ;
-C 92 ; WX 278 ; N backslash ; B -17 -19 295 737 ;
-C 93 ; WX 278 ; N bracketright ; B 28 -196 215 722 ;
-C 94 ; WX 469 ; N asciicircum ; B -14 264 483 688 ;
-C 95 ; WX 556 ; N underscore ; B 0 -125 556 -75 ;
-C 96 ; WX 222 ; N quoteleft ; B 65 470 169 725 ;
-C 97 ; WX 556 ; N a ; B 36 -15 530 538 ;
-C 98 ; WX 556 ; N b ; B 58 -15 517 718 ;
-C 99 ; WX 500 ; N c ; B 30 -15 477 538 ;
-C 100 ; WX 556 ; N d ; B 35 -15 499 718 ;
-C 101 ; WX 556 ; N e ; B 40 -15 516 538 ;
-C 102 ; WX 278 ; N f ; B 14 0 262 728 ; L i fi ; L l fl ;
-C 103 ; WX 556 ; N g ; B 40 -220 499 538 ;
-C 104 ; WX 556 ; N h ; B 65 0 491 718 ;
-C 105 ; WX 222 ; N i ; B 67 0 155 718 ;
-C 106 ; WX 222 ; N j ; B -16 -210 155 718 ;
-C 107 ; WX 500 ; N k ; B 67 0 501 718 ;
-C 108 ; WX 222 ; N l ; B 67 0 155 718 ;
-C 109 ; WX 833 ; N m ; B 65 0 769 538 ;
-C 110 ; WX 556 ; N n ; B 65 0 491 538 ;
-C 111 ; WX 556 ; N o ; B 35 -14 521 538 ;
-C 112 ; WX 556 ; N p ; B 58 -207 517 538 ;
-C 113 ; WX 556 ; N q ; B 35 -207 494 538 ;
-C 114 ; WX 333 ; N r ; B 77 0 332 538 ;
-C 115 ; WX 500 ; N s ; B 32 -15 464 538 ;
-C 116 ; WX 278 ; N t ; B 14 -7 257 669 ;
-C 117 ; WX 556 ; N u ; B 68 -15 489 523 ;
-C 118 ; WX 500 ; N v ; B 8 0 492 523 ;
-C 119 ; WX 722 ; N w ; B 14 0 709 523 ;
-C 120 ; WX 500 ; N x ; B 11 0 490 523 ;
-C 121 ; WX 500 ; N y ; B 11 -214 489 523 ;
-C 122 ; WX 500 ; N z ; B 31 0 469 523 ;
-C 123 ; WX 334 ; N braceleft ; B 42 -196 292 722 ;
-C 124 ; WX 260 ; N bar ; B 94 -19 167 737 ;
-C 125 ; WX 334 ; N braceright ; B 42 -196 292 722 ;
-C 126 ; WX 584 ; N asciitilde ; B 61 180 523 326 ;
-C 161 ; WX 333 ; N exclamdown ; B 118 -195 215 523 ;
-C 162 ; WX 556 ; N cent ; B 51 -115 513 623 ;
-C 163 ; WX 556 ; N sterling ; B 33 -16 539 718 ;
-C 164 ; WX 167 ; N fraction ; B -166 -19 333 703 ;
-C 165 ; WX 556 ; N yen ; B 3 0 553 688 ;
-C 166 ; WX 556 ; N florin ; B -11 -207 501 737 ;
-C 167 ; WX 556 ; N section ; B 43 -191 512 737 ;
-C 168 ; WX 556 ; N currency ; B 28 99 528 603 ;
-C 169 ; WX 191 ; N quotesingle ; B 59 463 132 718 ;
-C 170 ; WX 333 ; N quotedblleft ; B 38 470 307 725 ;
-C 171 ; WX 556 ; N guillemotleft ; B 97 108 459 446 ;
-C 172 ; WX 333 ; N guilsinglleft ; B 88 108 245 446 ;
-C 173 ; WX 333 ; N guilsinglright ; B 88 108 245 446 ;
-C 174 ; WX 500 ; N fi ; B 14 0 434 728 ;
-C 175 ; WX 500 ; N fl ; B 14 0 432 728 ;
-C 177 ; WX 556 ; N endash ; B 0 240 556 313 ;
-C 178 ; WX 556 ; N dagger ; B 43 -159 514 718 ;
-C 179 ; WX 556 ; N daggerdbl ; B 43 -159 514 718 ;
-C 180 ; WX 278 ; N periodcentered ; B 77 190 202 315 ;
-C 182 ; WX 537 ; N paragraph ; B 18 -173 497 718 ;
-C 183 ; WX 350 ; N bullet ; B 18 202 333 517 ;
-C 184 ; WX 222 ; N quotesinglbase ; B 53 -149 157 106 ;
-C 185 ; WX 333 ; N quotedblbase ; B 26 -149 295 106 ;
-C 186 ; WX 333 ; N quotedblright ; B 26 463 295 718 ;
-C 187 ; WX 556 ; N guillemotright ; B 97 108 459 446 ;
-C 188 ; WX 1000 ; N ellipsis ; B 115 0 885 106 ;
-C 189 ; WX 1000 ; N perthousand ; B 7 -19 994 703 ;
-C 191 ; WX 611 ; N questiondown ; B 91 -201 527 525 ;
-C 193 ; WX 333 ; N grave ; B 14 593 211 734 ;
-C 194 ; WX 333 ; N acute ; B 122 593 319 734 ;
-C 195 ; WX 333 ; N circumflex ; B 21 593 312 734 ;
-C 196 ; WX 333 ; N tilde ; B -4 606 337 722 ;
-C 197 ; WX 333 ; N macron ; B 10 627 323 684 ;
-C 198 ; WX 333 ; N breve ; B 13 595 321 731 ;
-C 199 ; WX 333 ; N dotaccent ; B 121 604 212 706 ;
-C 200 ; WX 333 ; N dieresis ; B 40 604 293 706 ;
-C 202 ; WX 333 ; N ring ; B 75 572 259 756 ;
-C 203 ; WX 333 ; N cedilla ; B 45 -225 259 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B 31 593 409 734 ;
-C 206 ; WX 333 ; N ogonek ; B 73 -225 287 0 ;
-C 207 ; WX 333 ; N caron ; B 21 593 312 734 ;
-C 208 ; WX 1000 ; N emdash ; B 0 240 1000 313 ;
-C 225 ; WX 1000 ; N AE ; B 8 0 951 718 ;
-C 227 ; WX 370 ; N ordfeminine ; B 24 304 346 737 ;
-C 232 ; WX 556 ; N Lslash ; B -20 0 537 718 ;
-C 233 ; WX 778 ; N Oslash ; B 39 -19 740 737 ;
-C 234 ; WX 1000 ; N OE ; B 36 -19 965 737 ;
-C 235 ; WX 365 ; N ordmasculine ; B 25 304 341 737 ;
-C 241 ; WX 889 ; N ae ; B 36 -15 847 538 ;
-C 245 ; WX 278 ; N dotlessi ; B 95 0 183 523 ;
-C 248 ; WX 222 ; N lslash ; B -20 0 242 718 ;
-C 249 ; WX 611 ; N oslash ; B 28 -22 537 545 ;
-C 250 ; WX 944 ; N oe ; B 35 -15 902 538 ;
-C 251 ; WX 611 ; N germandbls ; B 67 -15 571 728 ;
-C -1 ; WX 611 ; N Zcaron ; B 23 0 588 929 ;
-C -1 ; WX 500 ; N ccedilla ; B 30 -225 477 538 ;
-C -1 ; WX 500 ; N ydieresis ; B 11 -214 489 706 ;
-C -1 ; WX 556 ; N atilde ; B 36 -15 530 722 ;
-C -1 ; WX 278 ; N icircumflex ; B -6 0 285 734 ;
-C -1 ; WX 333 ; N threesuperior ; B 5 270 325 703 ;
-C -1 ; WX 556 ; N ecircumflex ; B 40 -15 516 734 ;
-C -1 ; WX 556 ; N thorn ; B 58 -207 517 718 ;
-C -1 ; WX 556 ; N egrave ; B 40 -15 516 734 ;
-C -1 ; WX 333 ; N twosuperior ; B 4 281 323 703 ;
-C -1 ; WX 556 ; N eacute ; B 40 -15 516 734 ;
-C -1 ; WX 556 ; N otilde ; B 35 -14 521 722 ;
-C -1 ; WX 667 ; N Aacute ; B 14 0 654 929 ;
-C -1 ; WX 556 ; N ocircumflex ; B 35 -14 521 734 ;
-C -1 ; WX 500 ; N yacute ; B 11 -214 489 734 ;
-C -1 ; WX 556 ; N udieresis ; B 68 -15 489 706 ;
-C -1 ; WX 834 ; N threequarters ; B 45 -19 810 703 ;
-C -1 ; WX 556 ; N acircumflex ; B 36 -15 530 734 ;
-C -1 ; WX 722 ; N Eth ; B 0 0 674 718 ;
-C -1 ; WX 556 ; N edieresis ; B 40 -15 516 706 ;
-C -1 ; WX 556 ; N ugrave ; B 68 -15 489 734 ;
-C -1 ; WX 1000 ; N trademark ; B 46 306 903 718 ;
-C -1 ; WX 556 ; N ograve ; B 35 -14 521 734 ;
-C -1 ; WX 500 ; N scaron ; B 32 -15 464 734 ;
-C -1 ; WX 278 ; N Idieresis ; B 13 0 266 901 ;
-C -1 ; WX 556 ; N uacute ; B 68 -15 489 734 ;
-C -1 ; WX 556 ; N agrave ; B 36 -15 530 734 ;
-C -1 ; WX 556 ; N ntilde ; B 65 0 491 722 ;
-C -1 ; WX 556 ; N aring ; B 36 -15 530 756 ;
-C -1 ; WX 500 ; N zcaron ; B 31 0 469 734 ;
-C -1 ; WX 278 ; N Icircumflex ; B -6 0 285 929 ;
-C -1 ; WX 722 ; N Ntilde ; B 76 0 646 917 ;
-C -1 ; WX 556 ; N ucircumflex ; B 68 -15 489 734 ;
-C -1 ; WX 667 ; N Ecircumflex ; B 86 0 616 929 ;
-C -1 ; WX 278 ; N Iacute ; B 91 0 292 929 ;
-C -1 ; WX 722 ; N Ccedilla ; B 44 -225 681 737 ;
-C -1 ; WX 778 ; N Odieresis ; B 39 -19 739 901 ;
-C -1 ; WX 667 ; N Scaron ; B 49 -19 620 929 ;
-C -1 ; WX 667 ; N Edieresis ; B 86 0 616 901 ;
-C -1 ; WX 278 ; N Igrave ; B -13 0 188 929 ;
-C -1 ; WX 556 ; N adieresis ; B 36 -15 530 706 ;
-C -1 ; WX 778 ; N Ograve ; B 39 -19 739 929 ;
-C -1 ; WX 667 ; N Egrave ; B 86 0 616 929 ;
-C -1 ; WX 667 ; N Ydieresis ; B 14 0 653 901 ;
-C -1 ; WX 737 ; N registered ; B -14 -19 752 737 ;
-C -1 ; WX 778 ; N Otilde ; B 39 -19 739 917 ;
-C -1 ; WX 834 ; N onequarter ; B 73 -19 756 703 ;
-C -1 ; WX 722 ; N Ugrave ; B 79 -19 644 929 ;
-C -1 ; WX 722 ; N Ucircumflex ; B 79 -19 644 929 ;
-C -1 ; WX 667 ; N Thorn ; B 86 0 622 718 ;
-C -1 ; WX 584 ; N divide ; B 39 -19 545 524 ;
-C -1 ; WX 667 ; N Atilde ; B 14 0 654 917 ;
-C -1 ; WX 722 ; N Uacute ; B 79 -19 644 929 ;
-C -1 ; WX 778 ; N Ocircumflex ; B 39 -19 739 929 ;
-C -1 ; WX 584 ; N logicalnot ; B 39 108 545 390 ;
-C -1 ; WX 667 ; N Aring ; B 14 0 654 931 ;
-C -1 ; WX 278 ; N idieresis ; B 13 0 266 706 ;
-C -1 ; WX 278 ; N iacute ; B 95 0 292 734 ;
-C -1 ; WX 556 ; N aacute ; B 36 -15 530 734 ;
-C -1 ; WX 584 ; N plusminus ; B 39 0 545 506 ;
-C -1 ; WX 584 ; N multiply ; B 39 0 545 506 ;
-C -1 ; WX 722 ; N Udieresis ; B 79 -19 644 901 ;
-C -1 ; WX 584 ; N minus ; B 39 216 545 289 ;
-C -1 ; WX 333 ; N onesuperior ; B 43 281 222 703 ;
-C -1 ; WX 667 ; N Eacute ; B 86 0 616 929 ;
-C -1 ; WX 667 ; N Acircumflex ; B 14 0 654 929 ;
-C -1 ; WX 737 ; N copyright ; B -14 -19 752 737 ;
-C -1 ; WX 667 ; N Agrave ; B 14 0 654 929 ;
-C -1 ; WX 556 ; N odieresis ; B 35 -14 521 706 ;
-C -1 ; WX 556 ; N oacute ; B 35 -14 521 734 ;
-C -1 ; WX 400 ; N degree ; B 54 411 346 703 ;
-C -1 ; WX 278 ; N igrave ; B -13 0 184 734 ;
-C -1 ; WX 556 ; N mu ; B 68 -207 489 523 ;
-C -1 ; WX 778 ; N Oacute ; B 39 -19 739 929 ;
-C -1 ; WX 556 ; N eth ; B 35 -15 522 737 ;
-C -1 ; WX 667 ; N Adieresis ; B 14 0 654 901 ;
-C -1 ; WX 667 ; N Yacute ; B 14 0 653 929 ;
-C -1 ; WX 260 ; N brokenbar ; B 94 -19 167 737 ;
-C -1 ; WX 834 ; N onehalf ; B 43 -19 773 703 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 250
-
-KPX A y -40
-KPX A w -40
-KPX A v -40
-KPX A u -30
-KPX A Y -100
-KPX A W -50
-KPX A V -70
-KPX A U -50
-KPX A T -120
-KPX A Q -30
-KPX A O -30
-KPX A G -30
-KPX A C -30
-
-KPX B period -20
-KPX B comma -20
-KPX B U -10
-
-KPX C period -30
-KPX C comma -30
-
-KPX D period -70
-KPX D comma -70
-KPX D Y -90
-KPX D W -40
-KPX D V -70
-KPX D A -40
-
-KPX F r -45
-KPX F period -150
-KPX F o -30
-KPX F e -30
-KPX F comma -150
-KPX F a -50
-KPX F A -80
-
-KPX J u -20
-KPX J period -30
-KPX J comma -30
-KPX J a -20
-KPX J A -20
-
-KPX K y -50
-KPX K u -30
-KPX K o -40
-KPX K e -40
-KPX K O -50
-
-KPX L y -30
-KPX L quoteright -160
-KPX L quotedblright -140
-KPX L Y -140
-KPX L W -70
-KPX L V -110
-KPX L T -110
-
-KPX O period -40
-KPX O comma -40
-KPX O Y -70
-KPX O X -60
-KPX O W -30
-KPX O V -50
-KPX O T -40
-KPX O A -20
-
-KPX P period -180
-KPX P o -50
-KPX P e -50
-KPX P comma -180
-KPX P a -40
-KPX P A -120
-
-KPX Q U -10
-
-KPX R Y -50
-KPX R W -30
-KPX R V -50
-KPX R U -40
-KPX R T -30
-KPX R O -20
-
-KPX S period -20
-KPX S comma -20
-
-KPX T y -120
-KPX T w -120
-KPX T u -120
-KPX T semicolon -20
-KPX T r -120
-KPX T period -120
-KPX T o -120
-KPX T hyphen -140
-KPX T e -120
-KPX T comma -120
-KPX T colon -20
-KPX T a -120
-KPX T O -40
-KPX T A -120
-
-KPX U period -40
-KPX U comma -40
-KPX U A -40
-
-KPX V u -70
-KPX V semicolon -40
-KPX V period -125
-KPX V o -80
-KPX V hyphen -80
-KPX V e -80
-KPX V comma -125
-KPX V colon -40
-KPX V a -70
-KPX V O -40
-KPX V G -40
-KPX V A -80
-
-KPX W y -20
-KPX W u -30
-KPX W period -80
-KPX W o -30
-KPX W hyphen -40
-KPX W e -30
-KPX W comma -80
-KPX W a -40
-KPX W O -20
-KPX W A -50
-
-KPX Y u -110
-KPX Y semicolon -60
-KPX Y period -140
-KPX Y o -140
-KPX Y i -20
-KPX Y hyphen -140
-KPX Y e -140
-KPX Y comma -140
-KPX Y colon -60
-KPX Y a -140
-KPX Y O -85
-KPX Y A -110
-
-KPX a y -30
-KPX a w -20
-KPX a v -20
-
-KPX b y -20
-KPX b v -20
-KPX b u -20
-KPX b period -40
-KPX b l -20
-KPX b comma -40
-KPX b b -10
-
-KPX c k -20
-KPX c comma -15
-
-KPX colon space -50
-
-KPX comma quoteright -100
-KPX comma quotedblright -100
-
-KPX e y -20
-KPX e x -30
-KPX e w -20
-KPX e v -30
-KPX e period -15
-KPX e comma -15
-
-KPX f quoteright 50
-KPX f quotedblright 60
-KPX f period -30
-KPX f o -30
-KPX f e -30
-KPX f dotlessi -28
-KPX f comma -30
-KPX f a -30
-
-KPX g r -10
-
-KPX h y -30
-
-KPX k o -20
-KPX k e -20
-
-KPX m y -15
-KPX m u -10
-
-KPX n y -15
-KPX n v -20
-KPX n u -10
-
-KPX o y -30
-KPX o x -30
-KPX o w -15
-KPX o v -15
-KPX o period -40
-KPX o comma -40
-
-KPX oslash z -55
-KPX oslash y -70
-KPX oslash x -85
-KPX oslash w -70
-KPX oslash v -70
-KPX oslash u -55
-KPX oslash t -55
-KPX oslash s -55
-KPX oslash r -55
-KPX oslash q -55
-KPX oslash period -95
-KPX oslash p -55
-KPX oslash o -55
-KPX oslash n -55
-KPX oslash m -55
-KPX oslash l -55
-KPX oslash k -55
-KPX oslash j -55
-KPX oslash i -55
-KPX oslash h -55
-KPX oslash g -55
-KPX oslash f -55
-KPX oslash e -55
-KPX oslash d -55
-KPX oslash comma -95
-KPX oslash c -55
-KPX oslash b -55
-KPX oslash a -55
-
-KPX p y -30
-KPX p period -35
-KPX p comma -35
-
-KPX period space -60
-KPX period quoteright -100
-KPX period quotedblright -100
-
-KPX quotedblright space -40
-
-KPX quoteleft quoteleft -57
-
-KPX quoteright space -70
-KPX quoteright s -50
-KPX quoteright r -50
-KPX quoteright quoteright -57
-KPX quoteright d -50
-
-KPX r y 30
-KPX r v 30
-KPX r u 15
-KPX r t 40
-KPX r semicolon 30
-KPX r period -50
-KPX r p 30
-KPX r n 25
-KPX r m 25
-KPX r l 15
-KPX r k 15
-KPX r i 15
-KPX r comma -50
-KPX r colon 30
-KPX r a -10
-
-KPX s w -30
-KPX s period -15
-KPX s comma -15
-
-KPX semicolon space -50
-
-KPX space quoteleft -60
-KPX space quotedblleft -30
-KPX space Y -90
-KPX space W -40
-KPX space V -50
-KPX space T -50
-
-KPX v period -80
-KPX v o -25
-KPX v e -25
-KPX v comma -80
-KPX v a -25
-
-KPX w period -60
-KPX w o -10
-KPX w e -10
-KPX w comma -60
-KPX w a -15
-
-KPX x e -30
-
-KPX y period -100
-KPX y o -20
-KPX y e -20
-KPX y comma -100
-KPX y a -20
-
-KPX z o -15
-KPX z e -15
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 167 195 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 167 195 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 167 195 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 167 195 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 167 175 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 167 195 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 195 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 167 195 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 167 195 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 167 195 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 167 195 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute -27 195 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -27 195 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -27 195 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave -27 195 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 205 195 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 223 195 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 223 195 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 223 195 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 223 195 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 223 195 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 167 195 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 195 195 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 195 195 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 195 195 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 195 195 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 167 195 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 167 195 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 195 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 112 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 112 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 112 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 112 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 112 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 102 0 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 84 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 112 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 112 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 112 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 112 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 102 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 112 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 112 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 112 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 112 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 112 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 84 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 112 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 112 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 112 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 112 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 84 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 84 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Makefile.in b/blt3.0.1/library/afm/Makefile.in
deleted file mode 100644
index edc17be..0000000
--- a/blt3.0.1/library/afm/Makefile.in
+++ /dev/null
@@ -1,78 +0,0 @@
-# ------------------------------------------------------------------------
-# Makefile for AFM files.
-# ------------------------------------------------------------------------
-
-datadir = @datadir@
-datarootdir = @datarootdir@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-prefix = @prefix@
-srcdir = @srcdir@
-
-version = @BLT_VERSION@
-so_prefix = @BLT_SO_PREFIX@
-so_ext = @BLT_SO_EXT@
-lib_suffix = @BLT_LIB_SUFFIX@
-pkgdir = @BLT_LIBRARY@
-afmdir = $(pkgdir)/afm
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-RM = rm -f
-SHELL = /bin/sh
-MKDIR_P = @MKDIR_P@
-
-afmFiles = \
- AvantGarde-Book.afm \
- AvantGarde-BookOblique.afm \
- AvantGarde-Demi.afm \
- AvantGarde-DemiOblique.afm \
- Bookman-Demi.afm \
- Bookman-DemiItalic.afm \
- Bookman-Light.afm \
- Bookman-LightItalic.afm \
- Courier-Bold.afm \
- Courier-BoldOblique.afm \
- Courier-Oblique.afm \
- Courier.afm \
- Helvetica-Bold.afm \
- Helvetica-BoldOblique.afm \
- Helvetica-Condensed-Bold.afm \
- Helvetica-Condensed-BoldObl.afm \
- Helvetica-Condensed-Oblique.afm \
- Helvetica-Condensed.afm \
- Helvetica-Narrow-Bold.afm \
- Helvetica-Narrow-BoldOblique.afm \
- Helvetica-Narrow-Oblique.afm \
- Helvetica-Narrow.afm \
- Helvetica-Oblique.afm \
- Helvetica.afm \
- NewCenturySchlbk-Bold.afm \
- NewCenturySchlbk-BoldItalic.afm \
- NewCenturySchlbk-Italic.afm \
- NewCenturySchlbk-Roman.afm \
- Palatino-Bold.afm \
- Palatino-BoldItalic.afm \
- Palatino-Italic.afm \
- Palatino-Roman.afm \
- Symbol.afm \
- Times-Bold.afm \
- Times-BoldItalic.afm \
- Times-Italic.afm \
- Times-Roman.afm \
- ZapfChancery-MediumItalic.afm \
- ZapfDingbats.afm
-
-all:
-
-install: mkdirs
- for i in $(afmFiles) ; do \
- $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(afmdir) ; \
- done
-mkdirs:
- $(MKDIR_P) $(DESTDIR)$(afmdir)
-
-clean:
-
-distclean: clean
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"* Makefile
diff --git a/blt3.0.1/library/afm/NewCenturySchlbk-Bold.afm b/blt3.0.1/library/afm/NewCenturySchlbk-Bold.afm
deleted file mode 100644
index 6438f86..0000000
--- a/blt3.0.1/library/afm/NewCenturySchlbk-Bold.afm
+++ /dev/null
@@ -1,473 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1988, 1991 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Tue May 28 16:48:12 1991
-Comment UniqueID 35031
-Comment VMusage 30773 37665
-FontName NewCenturySchlbk-Bold
-FullName New Century Schoolbook Bold
-FamilyName New Century Schoolbook
-Weight Bold
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -165 -250 1000 988
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.009
-Notice Copyright (c) 1985, 1987, 1988, 1991 Adobe Systems Incorporated. All Rights Reserved.
-EncodingScheme AdobeStandardEncoding
-CapHeight 722
-XHeight 475
-Ascender 737
-Descender -205
-StartCharMetrics 228
-C 32 ; WX 287 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 296 ; N exclam ; B 53 -15 243 737 ;
-C 34 ; WX 333 ; N quotedbl ; B 0 378 333 737 ;
-C 35 ; WX 574 ; N numbersign ; B 36 0 538 690 ;
-C 36 ; WX 574 ; N dollar ; B 25 -141 549 810 ;
-C 37 ; WX 833 ; N percent ; B 14 -15 819 705 ;
-C 38 ; WX 852 ; N ampersand ; B 34 -15 818 737 ;
-C 39 ; WX 241 ; N quoteright ; B 22 378 220 737 ;
-C 40 ; WX 389 ; N parenleft ; B 77 -117 345 745 ;
-C 41 ; WX 389 ; N parenright ; B 44 -117 312 745 ;
-C 42 ; WX 500 ; N asterisk ; B 54 302 446 737 ;
-C 43 ; WX 606 ; N plus ; B 50 0 556 506 ;
-C 44 ; WX 278 ; N comma ; B 40 -184 238 175 ;
-C 45 ; WX 333 ; N hyphen ; B 42 174 291 302 ;
-C 46 ; WX 278 ; N period ; B 44 -15 234 175 ;
-C 47 ; WX 278 ; N slash ; B -42 -15 320 737 ;
-C 48 ; WX 574 ; N zero ; B 27 -15 547 705 ;
-C 49 ; WX 574 ; N one ; B 83 0 491 705 ;
-C 50 ; WX 574 ; N two ; B 19 0 531 705 ;
-C 51 ; WX 574 ; N three ; B 23 -15 531 705 ;
-C 52 ; WX 574 ; N four ; B 19 0 547 705 ;
-C 53 ; WX 574 ; N five ; B 32 -15 534 705 ;
-C 54 ; WX 574 ; N six ; B 27 -15 547 705 ;
-C 55 ; WX 574 ; N seven ; B 45 -15 547 705 ;
-C 56 ; WX 574 ; N eight ; B 27 -15 548 705 ;
-C 57 ; WX 574 ; N nine ; B 27 -15 547 705 ;
-C 58 ; WX 278 ; N colon ; B 44 -15 234 485 ;
-C 59 ; WX 278 ; N semicolon ; B 40 -184 238 485 ;
-C 60 ; WX 606 ; N less ; B 50 -9 556 515 ;
-C 61 ; WX 606 ; N equal ; B 50 103 556 403 ;
-C 62 ; WX 606 ; N greater ; B 50 -9 556 515 ;
-C 63 ; WX 500 ; N question ; B 23 -15 477 737 ;
-C 64 ; WX 747 ; N at ; B -2 -15 750 737 ;
-C 65 ; WX 759 ; N A ; B -19 0 778 737 ;
-C 66 ; WX 778 ; N B ; B 19 0 739 722 ;
-C 67 ; WX 778 ; N C ; B 39 -15 723 737 ;
-C 68 ; WX 833 ; N D ; B 19 0 794 722 ;
-C 69 ; WX 759 ; N E ; B 19 0 708 722 ;
-C 70 ; WX 722 ; N F ; B 19 0 697 722 ;
-C 71 ; WX 833 ; N G ; B 39 -15 818 737 ;
-C 72 ; WX 870 ; N H ; B 19 0 851 722 ;
-C 73 ; WX 444 ; N I ; B 29 0 415 722 ;
-C 74 ; WX 648 ; N J ; B 6 -15 642 722 ;
-C 75 ; WX 815 ; N K ; B 19 0 822 722 ;
-C 76 ; WX 722 ; N L ; B 19 0 703 722 ;
-C 77 ; WX 981 ; N M ; B 10 0 971 722 ;
-C 78 ; WX 833 ; N N ; B 5 -10 828 722 ;
-C 79 ; WX 833 ; N O ; B 39 -15 794 737 ;
-C 80 ; WX 759 ; N P ; B 24 0 735 722 ;
-C 81 ; WX 833 ; N Q ; B 39 -189 808 737 ;
-C 82 ; WX 815 ; N R ; B 19 -15 815 722 ;
-C 83 ; WX 667 ; N S ; B 51 -15 634 737 ;
-C 84 ; WX 722 ; N T ; B 16 0 706 722 ;
-C 85 ; WX 833 ; N U ; B 14 -15 825 722 ;
-C 86 ; WX 759 ; N V ; B -19 -10 778 722 ;
-C 87 ; WX 981 ; N W ; B 7 -10 974 722 ;
-C 88 ; WX 722 ; N X ; B -12 0 734 722 ;
-C 89 ; WX 722 ; N Y ; B -12 0 734 722 ;
-C 90 ; WX 667 ; N Z ; B 28 0 639 722 ;
-C 91 ; WX 389 ; N bracketleft ; B 84 -109 339 737 ;
-C 92 ; WX 606 ; N backslash ; B 122 -15 484 737 ;
-C 93 ; WX 389 ; N bracketright ; B 50 -109 305 737 ;
-C 94 ; WX 606 ; N asciicircum ; B 66 325 540 690 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 241 ; N quoteleft ; B 22 378 220 737 ;
-C 97 ; WX 611 ; N a ; B 40 -15 601 485 ;
-C 98 ; WX 648 ; N b ; B 4 -15 616 737 ;
-C 99 ; WX 556 ; N c ; B 32 -15 524 485 ;
-C 100 ; WX 667 ; N d ; B 32 -15 644 737 ;
-C 101 ; WX 574 ; N e ; B 32 -15 542 485 ;
-C 102 ; WX 389 ; N f ; B 11 0 461 737 ; L i fi ; L l fl ;
-C 103 ; WX 611 ; N g ; B 30 -205 623 535 ;
-C 104 ; WX 685 ; N h ; B 17 0 662 737 ;
-C 105 ; WX 370 ; N i ; B 26 0 338 737 ;
-C 106 ; WX 352 ; N j ; B -86 -205 271 737 ;
-C 107 ; WX 667 ; N k ; B 17 0 662 737 ;
-C 108 ; WX 352 ; N l ; B 17 0 329 737 ;
-C 109 ; WX 963 ; N m ; B 17 0 940 485 ;
-C 110 ; WX 685 ; N n ; B 17 0 662 485 ;
-C 111 ; WX 611 ; N o ; B 32 -15 579 485 ;
-C 112 ; WX 667 ; N p ; B 17 -205 629 485 ;
-C 113 ; WX 648 ; N q ; B 32 -205 638 485 ;
-C 114 ; WX 519 ; N r ; B 17 0 516 485 ;
-C 115 ; WX 500 ; N s ; B 48 -15 476 485 ;
-C 116 ; WX 426 ; N t ; B 21 -15 405 675 ;
-C 117 ; WX 685 ; N u ; B 17 -15 668 475 ;
-C 118 ; WX 611 ; N v ; B 12 -10 599 475 ;
-C 119 ; WX 889 ; N w ; B 16 -10 873 475 ;
-C 120 ; WX 611 ; N x ; B 12 0 599 475 ;
-C 121 ; WX 611 ; N y ; B 12 -205 599 475 ;
-C 122 ; WX 537 ; N z ; B 38 0 499 475 ;
-C 123 ; WX 389 ; N braceleft ; B 36 -109 313 737 ;
-C 124 ; WX 606 ; N bar ; B 249 -250 357 750 ;
-C 125 ; WX 389 ; N braceright ; B 76 -109 353 737 ;
-C 126 ; WX 606 ; N asciitilde ; B 72 160 534 346 ;
-C 161 ; WX 296 ; N exclamdown ; B 53 -205 243 547 ;
-C 162 ; WX 574 ; N cent ; B 32 -102 528 572 ;
-C 163 ; WX 574 ; N sterling ; B 16 -15 558 705 ;
-C 164 ; WX 167 ; N fraction ; B -165 -15 332 705 ;
-C 165 ; WX 574 ; N yen ; B -10 0 584 690 ;
-C 166 ; WX 574 ; N florin ; B 14 -205 548 737 ;
-C 167 ; WX 500 ; N section ; B 62 -86 438 737 ;
-C 168 ; WX 574 ; N currency ; B 27 84 547 605 ;
-C 169 ; WX 241 ; N quotesingle ; B 53 378 189 737 ;
-C 170 ; WX 481 ; N quotedblleft ; B 22 378 459 737 ;
-C 171 ; WX 500 ; N guillemotleft ; B 46 79 454 397 ;
-C 172 ; WX 333 ; N guilsinglleft ; B 62 79 271 397 ;
-C 173 ; WX 333 ; N guilsinglright ; B 62 79 271 397 ;
-C 174 ; WX 685 ; N fi ; B 11 0 666 737 ;
-C 175 ; WX 685 ; N fl ; B 11 0 666 737 ;
-C 177 ; WX 500 ; N endash ; B 0 184 500 292 ;
-C 178 ; WX 500 ; N dagger ; B 39 -101 461 737 ;
-C 179 ; WX 500 ; N daggerdbl ; B 39 -89 461 737 ;
-C 180 ; WX 278 ; N periodcentered ; B 53 200 225 372 ;
-C 182 ; WX 747 ; N paragraph ; B 96 -71 631 722 ;
-C 183 ; WX 606 ; N bullet ; B 122 180 484 542 ;
-C 184 ; WX 241 ; N quotesinglbase ; B 22 -184 220 175 ;
-C 185 ; WX 481 ; N quotedblbase ; B 22 -184 459 175 ;
-C 186 ; WX 481 ; N quotedblright ; B 22 378 459 737 ;
-C 187 ; WX 500 ; N guillemotright ; B 46 79 454 397 ;
-C 188 ; WX 1000 ; N ellipsis ; B 72 -15 928 175 ;
-C 189 ; WX 1000 ; N perthousand ; B 7 -15 993 705 ;
-C 191 ; WX 500 ; N questiondown ; B 23 -205 477 547 ;
-C 193 ; WX 333 ; N grave ; B 2 547 249 737 ;
-C 194 ; WX 333 ; N acute ; B 84 547 331 737 ;
-C 195 ; WX 333 ; N circumflex ; B -10 547 344 725 ;
-C 196 ; WX 333 ; N tilde ; B -24 563 357 705 ;
-C 197 ; WX 333 ; N macron ; B -6 582 339 664 ;
-C 198 ; WX 333 ; N breve ; B 9 547 324 714 ;
-C 199 ; WX 333 ; N dotaccent ; B 95 552 237 694 ;
-C 200 ; WX 333 ; N dieresis ; B -12 552 345 694 ;
-C 202 ; WX 333 ; N ring ; B 58 545 274 761 ;
-C 203 ; WX 333 ; N cedilla ; B 17 -224 248 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B -16 547 431 737 ;
-C 206 ; WX 333 ; N ogonek ; B 168 -163 346 3 ;
-C 207 ; WX 333 ; N caron ; B -10 547 344 725 ;
-C 208 ; WX 1000 ; N emdash ; B 0 184 1000 292 ;
-C 225 ; WX 981 ; N AE ; B -29 0 963 722 ;
-C 227 ; WX 367 ; N ordfeminine ; B 1 407 393 705 ;
-C 232 ; WX 722 ; N Lslash ; B 19 0 703 722 ;
-C 233 ; WX 833 ; N Oslash ; B 39 -53 794 775 ;
-C 234 ; WX 1000 ; N OE ; B 0 0 982 722 ;
-C 235 ; WX 367 ; N ordmasculine ; B 1 407 366 705 ;
-C 241 ; WX 870 ; N ae ; B 32 -15 838 485 ;
-C 245 ; WX 370 ; N dotlessi ; B 26 0 338 475 ;
-C 248 ; WX 352 ; N lslash ; B 17 0 329 737 ;
-C 249 ; WX 611 ; N oslash ; B 32 -103 579 573 ;
-C 250 ; WX 907 ; N oe ; B 32 -15 875 485 ;
-C 251 ; WX 611 ; N germandbls ; B -2 -15 580 737 ;
-C -1 ; WX 574 ; N ecircumflex ; B 32 -15 542 725 ;
-C -1 ; WX 574 ; N edieresis ; B 32 -15 542 694 ;
-C -1 ; WX 611 ; N aacute ; B 40 -15 601 737 ;
-C -1 ; WX 747 ; N registered ; B -2 -15 750 737 ;
-C -1 ; WX 370 ; N icircumflex ; B 9 0 363 725 ;
-C -1 ; WX 685 ; N udieresis ; B 17 -15 668 694 ;
-C -1 ; WX 611 ; N ograve ; B 32 -15 579 737 ;
-C -1 ; WX 685 ; N uacute ; B 17 -15 668 737 ;
-C -1 ; WX 685 ; N ucircumflex ; B 17 -15 668 725 ;
-C -1 ; WX 759 ; N Aacute ; B -19 0 778 964 ;
-C -1 ; WX 370 ; N igrave ; B 21 0 338 737 ;
-C -1 ; WX 444 ; N Icircumflex ; B 29 0 415 952 ;
-C -1 ; WX 556 ; N ccedilla ; B 32 -224 524 485 ;
-C -1 ; WX 611 ; N adieresis ; B 40 -15 601 694 ;
-C -1 ; WX 759 ; N Ecircumflex ; B 19 0 708 952 ;
-C -1 ; WX 500 ; N scaron ; B 48 -15 476 725 ;
-C -1 ; WX 667 ; N thorn ; B 17 -205 629 737 ;
-C -1 ; WX 1000 ; N trademark ; B 6 317 982 722 ;
-C -1 ; WX 574 ; N egrave ; B 32 -15 542 737 ;
-C -1 ; WX 344 ; N threesuperior ; B -3 273 355 705 ;
-C -1 ; WX 537 ; N zcaron ; B 38 0 499 725 ;
-C -1 ; WX 611 ; N atilde ; B 40 -15 601 705 ;
-C -1 ; WX 611 ; N aring ; B 40 -15 601 761 ;
-C -1 ; WX 611 ; N ocircumflex ; B 32 -15 579 725 ;
-C -1 ; WX 759 ; N Edieresis ; B 19 0 708 921 ;
-C -1 ; WX 861 ; N threequarters ; B 15 -15 838 705 ;
-C -1 ; WX 611 ; N ydieresis ; B 12 -205 599 694 ;
-C -1 ; WX 611 ; N yacute ; B 12 -205 599 737 ;
-C -1 ; WX 370 ; N iacute ; B 26 0 350 737 ;
-C -1 ; WX 759 ; N Acircumflex ; B -19 0 778 952 ;
-C -1 ; WX 833 ; N Uacute ; B 14 -15 825 964 ;
-C -1 ; WX 574 ; N eacute ; B 32 -15 542 737 ;
-C -1 ; WX 833 ; N Ograve ; B 39 -15 794 964 ;
-C -1 ; WX 611 ; N agrave ; B 40 -15 601 737 ;
-C -1 ; WX 833 ; N Udieresis ; B 14 -15 825 921 ;
-C -1 ; WX 611 ; N acircumflex ; B 40 -15 601 725 ;
-C -1 ; WX 444 ; N Igrave ; B 29 0 415 964 ;
-C -1 ; WX 344 ; N twosuperior ; B -3 282 350 705 ;
-C -1 ; WX 833 ; N Ugrave ; B 14 -15 825 964 ;
-C -1 ; WX 861 ; N onequarter ; B 31 -15 838 705 ;
-C -1 ; WX 833 ; N Ucircumflex ; B 14 -15 825 952 ;
-C -1 ; WX 667 ; N Scaron ; B 51 -15 634 952 ;
-C -1 ; WX 444 ; N Idieresis ; B 29 0 415 921 ;
-C -1 ; WX 370 ; N idieresis ; B 7 0 364 694 ;
-C -1 ; WX 759 ; N Egrave ; B 19 0 708 964 ;
-C -1 ; WX 833 ; N Oacute ; B 39 -15 794 964 ;
-C -1 ; WX 606 ; N divide ; B 50 -40 556 546 ;
-C -1 ; WX 759 ; N Atilde ; B -19 0 778 932 ;
-C -1 ; WX 759 ; N Aring ; B -19 0 778 988 ;
-C -1 ; WX 833 ; N Odieresis ; B 39 -15 794 921 ;
-C -1 ; WX 759 ; N Adieresis ; B -19 0 778 921 ;
-C -1 ; WX 833 ; N Ntilde ; B 5 -10 828 932 ;
-C -1 ; WX 667 ; N Zcaron ; B 28 0 639 952 ;
-C -1 ; WX 759 ; N Thorn ; B 24 0 735 722 ;
-C -1 ; WX 444 ; N Iacute ; B 29 0 415 964 ;
-C -1 ; WX 606 ; N plusminus ; B 50 0 556 506 ;
-C -1 ; WX 606 ; N multiply ; B 65 15 541 491 ;
-C -1 ; WX 759 ; N Eacute ; B 19 0 708 964 ;
-C -1 ; WX 722 ; N Ydieresis ; B -12 0 734 921 ;
-C -1 ; WX 344 ; N onesuperior ; B 31 282 309 705 ;
-C -1 ; WX 685 ; N ugrave ; B 17 -15 668 737 ;
-C -1 ; WX 606 ; N logicalnot ; B 50 103 556 403 ;
-C -1 ; WX 685 ; N ntilde ; B 17 0 662 705 ;
-C -1 ; WX 833 ; N Otilde ; B 39 -15 794 932 ;
-C -1 ; WX 611 ; N otilde ; B 32 -15 579 705 ;
-C -1 ; WX 778 ; N Ccedilla ; B 39 -224 723 737 ;
-C -1 ; WX 759 ; N Agrave ; B -19 0 778 964 ;
-C -1 ; WX 861 ; N onehalf ; B 31 -15 838 705 ;
-C -1 ; WX 833 ; N Eth ; B 19 0 794 722 ;
-C -1 ; WX 400 ; N degree ; B 57 419 343 705 ;
-C -1 ; WX 722 ; N Yacute ; B -12 0 734 964 ;
-C -1 ; WX 833 ; N Ocircumflex ; B 39 -15 794 952 ;
-C -1 ; WX 611 ; N oacute ; B 32 -15 579 737 ;
-C -1 ; WX 685 ; N mu ; B 17 -205 668 475 ;
-C -1 ; WX 606 ; N minus ; B 50 199 556 307 ;
-C -1 ; WX 611 ; N eth ; B 32 -15 579 737 ;
-C -1 ; WX 611 ; N odieresis ; B 32 -15 579 694 ;
-C -1 ; WX 747 ; N copyright ; B -2 -15 750 737 ;
-C -1 ; WX 606 ; N brokenbar ; B 249 -175 357 675 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 128
-
-KPX A y -18
-KPX A w -18
-KPX A v -18
-KPX A quoteright -74
-KPX A quotedblright -74
-KPX A Y -91
-KPX A W -74
-KPX A V -74
-KPX A U -18
-KPX A T -55
-
-KPX C period -18
-KPX C comma -18
-
-KPX D period -25
-KPX D comma -25
-
-KPX F r -18
-KPX F period -125
-KPX F o -55
-KPX F i -18
-KPX F e -55
-KPX F comma -125
-KPX F a -74
-
-KPX J u -18
-KPX J period -55
-KPX J o -18
-KPX J e -18
-KPX J comma -55
-KPX J a -18
-KPX J A -18
-
-KPX K y -25
-KPX K u -18
-
-KPX L y -25
-KPX L quoteright -100
-KPX L quotedblright -100
-KPX L Y -74
-KPX L W -74
-KPX L V -100
-KPX L T -100
-
-KPX N period -18
-KPX N comma -18
-
-KPX O period -25
-KPX O comma -25
-KPX O T 10
-
-KPX P period -150
-KPX P o -55
-KPX P e -55
-KPX P comma -150
-KPX P a -55
-KPX P A -74
-
-KPX S period -18
-KPX S comma -18
-
-KPX T u -18
-KPX T r -18
-KPX T period -100
-KPX T o -74
-KPX T i -18
-KPX T hyphen -125
-KPX T e -74
-KPX T comma -100
-KPX T a -74
-KPX T O 10
-KPX T A -55
-
-KPX U period -25
-KPX U comma -25
-KPX U A -18
-
-KPX V u -55
-KPX V semicolon -37
-KPX V period -125
-KPX V o -74
-KPX V i -18
-KPX V hyphen -100
-KPX V e -74
-KPX V comma -125
-KPX V colon -37
-KPX V a -74
-KPX V A -74
-
-KPX W y -25
-KPX W u -37
-KPX W semicolon -55
-KPX W period -100
-KPX W o -74
-KPX W i -18
-KPX W hyphen -100
-KPX W e -74
-KPX W comma -100
-KPX W colon -55
-KPX W a -74
-KPX W A -74
-
-KPX Y u -55
-KPX Y semicolon -25
-KPX Y period -100
-KPX Y o -100
-KPX Y i -18
-KPX Y hyphen -125
-KPX Y e -100
-KPX Y comma -100
-KPX Y colon -25
-KPX Y a -100
-KPX Y A -91
-
-KPX colon space -18
-
-KPX comma space -18
-KPX comma quoteright -18
-KPX comma quotedblright -18
-
-KPX f quoteright 75
-KPX f quotedblright 75
-
-KPX period space -18
-KPX period quoteright -18
-KPX period quotedblright -18
-
-KPX quotedblleft A -74
-
-KPX quotedblright space -18
-
-KPX quoteleft A -74
-
-KPX quoteright s -25
-KPX quoteright d -25
-
-KPX r period -74
-KPX r comma -74
-
-KPX semicolon space -18
-
-KPX space quoteleft -18
-KPX space quotedblleft -18
-KPX space Y -18
-KPX space W -18
-KPX space V -18
-KPX space T -18
-KPX space A -18
-
-KPX v period -100
-KPX v comma -100
-
-KPX w period -100
-KPX w comma -100
-
-KPX y period -100
-KPX y comma -100
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 213 227 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 213 227 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 213 227 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 213 227 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 213 227 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 213 227 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 213 227 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 213 227 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 213 227 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 213 227 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 56 227 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 56 227 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 56 227 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 56 227 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 250 227 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 250 227 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 250 227 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 250 227 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 250 227 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 250 227 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 167 227 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 250 227 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 250 227 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 250 227 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 250 227 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 195 227 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 195 227 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 167 227 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 139 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 139 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 139 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 139 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 139 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 139 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 121 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 121 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 121 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 121 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 19 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex 19 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis 19 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 19 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 176 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 139 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 139 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 139 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 139 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 139 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 84 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 176 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 176 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 176 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 176 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 139 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 139 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 102 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/NewCenturySchlbk-BoldItalic.afm b/blt3.0.1/library/afm/NewCenturySchlbk-BoldItalic.afm
deleted file mode 100644
index 41611c7..0000000
--- a/blt3.0.1/library/afm/NewCenturySchlbk-BoldItalic.afm
+++ /dev/null
@@ -1,603 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Tue May 28 16:56:07 1991
-Comment UniqueID 35034
-Comment VMusage 31030 37922
-FontName NewCenturySchlbk-BoldItalic
-FullName New Century Schoolbook Bold Italic
-FamilyName New Century Schoolbook
-Weight Bold
-ItalicAngle -16
-IsFixedPitch false
-FontBBox -205 -250 1147 991
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
-EncodingScheme AdobeStandardEncoding
-CapHeight 722
-XHeight 477
-Ascender 737
-Descender -205
-StartCharMetrics 228
-C 32 ; WX 287 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 0 -15 333 737 ;
-C 34 ; WX 400 ; N quotedbl ; B 66 388 428 737 ;
-C 35 ; WX 574 ; N numbersign ; B 30 0 544 690 ;
-C 36 ; WX 574 ; N dollar ; B 9 -120 565 810 ;
-C 37 ; WX 889 ; N percent ; B 54 -28 835 727 ;
-C 38 ; WX 889 ; N ampersand ; B 32 -15 823 737 ;
-C 39 ; WX 259 ; N quoteright ; B 48 388 275 737 ;
-C 40 ; WX 407 ; N parenleft ; B 72 -117 454 745 ;
-C 41 ; WX 407 ; N parenright ; B -70 -117 310 745 ;
-C 42 ; WX 500 ; N asterisk ; B 58 301 498 737 ;
-C 43 ; WX 606 ; N plus ; B 50 0 556 506 ;
-C 44 ; WX 287 ; N comma ; B -57 -192 170 157 ;
-C 45 ; WX 333 ; N hyphen ; B 2 177 263 299 ;
-C 46 ; WX 287 ; N period ; B -20 -15 152 157 ;
-C 47 ; WX 278 ; N slash ; B -41 -15 320 737 ;
-C 48 ; WX 574 ; N zero ; B 21 -15 553 705 ;
-C 49 ; WX 574 ; N one ; B 25 0 489 705 ;
-C 50 ; WX 574 ; N two ; B -38 -3 538 705 ;
-C 51 ; WX 574 ; N three ; B -7 -15 536 705 ;
-C 52 ; WX 574 ; N four ; B -13 0 544 705 ;
-C 53 ; WX 574 ; N five ; B 0 -15 574 705 ;
-C 54 ; WX 574 ; N six ; B 31 -15 574 705 ;
-C 55 ; WX 574 ; N seven ; B 64 -15 593 705 ;
-C 56 ; WX 574 ; N eight ; B 0 -15 552 705 ;
-C 57 ; WX 574 ; N nine ; B 0 -15 543 705 ;
-C 58 ; WX 287 ; N colon ; B -20 -15 237 477 ;
-C 59 ; WX 287 ; N semicolon ; B -57 -192 237 477 ;
-C 60 ; WX 606 ; N less ; B 50 -9 556 515 ;
-C 61 ; WX 606 ; N equal ; B 50 103 556 403 ;
-C 62 ; WX 606 ; N greater ; B 50 -8 556 514 ;
-C 63 ; WX 481 ; N question ; B 79 -15 451 737 ;
-C 64 ; WX 747 ; N at ; B -4 -15 751 737 ;
-C 65 ; WX 741 ; N A ; B -75 0 716 737 ;
-C 66 ; WX 759 ; N B ; B -50 0 721 722 ;
-C 67 ; WX 759 ; N C ; B 37 -15 759 737 ;
-C 68 ; WX 833 ; N D ; B -47 0 796 722 ;
-C 69 ; WX 741 ; N E ; B -41 0 730 722 ;
-C 70 ; WX 704 ; N F ; B -41 0 730 722 ;
-C 71 ; WX 815 ; N G ; B 37 -15 805 737 ;
-C 72 ; WX 870 ; N H ; B -41 0 911 722 ;
-C 73 ; WX 444 ; N I ; B -41 0 485 722 ;
-C 74 ; WX 667 ; N J ; B -20 -15 708 722 ;
-C 75 ; WX 778 ; N K ; B -41 0 832 722 ;
-C 76 ; WX 704 ; N L ; B -41 0 670 722 ;
-C 77 ; WX 944 ; N M ; B -44 0 988 722 ;
-C 78 ; WX 852 ; N N ; B -61 -10 913 722 ;
-C 79 ; WX 833 ; N O ; B 37 -15 796 737 ;
-C 80 ; WX 741 ; N P ; B -41 0 730 722 ;
-C 81 ; WX 833 ; N Q ; B 37 -189 796 737 ;
-C 82 ; WX 796 ; N R ; B -41 -15 749 722 ;
-C 83 ; WX 685 ; N S ; B 1 -15 666 737 ;
-C 84 ; WX 722 ; N T ; B 41 0 759 722 ;
-C 85 ; WX 833 ; N U ; B 88 -15 900 722 ;
-C 86 ; WX 741 ; N V ; B 32 -10 802 722 ;
-C 87 ; WX 944 ; N W ; B 40 -10 1000 722 ;
-C 88 ; WX 741 ; N X ; B -82 0 801 722 ;
-C 89 ; WX 704 ; N Y ; B 13 0 775 722 ;
-C 90 ; WX 704 ; N Z ; B -33 0 711 722 ;
-C 91 ; WX 407 ; N bracketleft ; B 1 -109 464 737 ;
-C 92 ; WX 606 ; N backslash ; B 161 -15 445 737 ;
-C 93 ; WX 407 ; N bracketright ; B -101 -109 362 737 ;
-C 94 ; WX 606 ; N asciicircum ; B 66 325 540 690 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 259 ; N quoteleft ; B 47 388 274 737 ;
-C 97 ; WX 667 ; N a ; B 6 -15 636 477 ;
-C 98 ; WX 611 ; N b ; B 29 -15 557 737 ;
-C 99 ; WX 537 ; N c ; B 0 -15 482 477 ;
-C 100 ; WX 667 ; N d ; B 0 -15 660 737 ;
-C 101 ; WX 519 ; N e ; B 0 -15 479 477 ;
-C 102 ; WX 389 ; N f ; B -48 -205 550 737 ; L i fi ; L l fl ;
-C 103 ; WX 611 ; N g ; B -63 -205 604 528 ;
-C 104 ; WX 685 ; N h ; B 0 -15 639 737 ;
-C 105 ; WX 389 ; N i ; B 32 -15 345 737 ;
-C 106 ; WX 370 ; N j ; B -205 -205 347 737 ;
-C 107 ; WX 648 ; N k ; B -11 -15 578 737 ;
-C 108 ; WX 389 ; N l ; B 32 -15 375 737 ;
-C 109 ; WX 944 ; N m ; B 0 -15 909 477 ;
-C 110 ; WX 685 ; N n ; B 0 -15 639 477 ;
-C 111 ; WX 574 ; N o ; B 0 -15 530 477 ;
-C 112 ; WX 648 ; N p ; B -119 -205 590 477 ;
-C 113 ; WX 630 ; N q ; B 0 -205 587 477 ;
-C 114 ; WX 519 ; N r ; B 0 0 527 486 ;
-C 115 ; WX 481 ; N s ; B 0 -15 435 477 ;
-C 116 ; WX 407 ; N t ; B 24 -15 403 650 ;
-C 117 ; WX 685 ; N u ; B 30 -15 635 477 ;
-C 118 ; WX 556 ; N v ; B 30 -15 496 477 ;
-C 119 ; WX 833 ; N w ; B 30 -15 773 477 ;
-C 120 ; WX 574 ; N x ; B -46 -15 574 477 ;
-C 121 ; WX 519 ; N y ; B -66 -205 493 477 ;
-C 122 ; WX 519 ; N z ; B -19 -15 473 477 ;
-C 123 ; WX 407 ; N braceleft ; B 52 -109 408 737 ;
-C 124 ; WX 606 ; N bar ; B 249 -250 357 750 ;
-C 125 ; WX 407 ; N braceright ; B -25 -109 331 737 ;
-C 126 ; WX 606 ; N asciitilde ; B 72 160 534 346 ;
-C 161 ; WX 333 ; N exclamdown ; B -44 -205 289 547 ;
-C 162 ; WX 574 ; N cent ; B 30 -144 512 578 ;
-C 163 ; WX 574 ; N sterling ; B -18 -15 566 705 ;
-C 164 ; WX 167 ; N fraction ; B -166 -15 333 705 ;
-C 165 ; WX 574 ; N yen ; B 17 0 629 690 ;
-C 166 ; WX 574 ; N florin ; B -43 -205 575 737 ;
-C 167 ; WX 500 ; N section ; B -30 -146 515 737 ;
-C 168 ; WX 574 ; N currency ; B 27 84 547 605 ;
-C 169 ; WX 287 ; N quotesingle ; B 112 388 250 737 ;
-C 170 ; WX 481 ; N quotedblleft ; B 54 388 521 737 ;
-C 171 ; WX 481 ; N guillemotleft ; B -35 69 449 407 ;
-C 172 ; WX 278 ; N guilsinglleft ; B -25 69 244 407 ;
-C 173 ; WX 278 ; N guilsinglright ; B -26 69 243 407 ;
-C 174 ; WX 685 ; N fi ; B -70 -205 641 737 ;
-C 175 ; WX 685 ; N fl ; B -70 -205 671 737 ;
-C 177 ; WX 500 ; N endash ; B -47 189 479 287 ;
-C 178 ; WX 500 ; N dagger ; B 48 -146 508 737 ;
-C 179 ; WX 500 ; N daggerdbl ; B -60 -150 508 737 ;
-C 180 ; WX 287 ; N periodcentered ; B 57 200 229 372 ;
-C 182 ; WX 650 ; N paragraph ; B 25 -131 681 722 ;
-C 183 ; WX 606 ; N bullet ; B 122 180 484 542 ;
-C 184 ; WX 259 ; N quotesinglbase ; B -57 -192 170 157 ;
-C 185 ; WX 481 ; N quotedblbase ; B -57 -192 412 157 ;
-C 186 ; WX 481 ; N quotedblright ; B 43 388 510 737 ;
-C 187 ; WX 481 ; N guillemotright ; B -31 69 453 407 ;
-C 188 ; WX 1000 ; N ellipsis ; B 81 -15 919 157 ;
-C 189 ; WX 1167 ; N perthousand ; B 20 -28 1147 727 ;
-C 191 ; WX 481 ; N questiondown ; B 0 -205 372 547 ;
-C 193 ; WX 333 ; N grave ; B 74 538 294 722 ;
-C 194 ; WX 333 ; N acute ; B 123 538 372 722 ;
-C 195 ; WX 333 ; N circumflex ; B 23 533 365 705 ;
-C 196 ; WX 333 ; N tilde ; B 28 561 398 690 ;
-C 197 ; WX 333 ; N macron ; B 47 573 404 649 ;
-C 198 ; WX 333 ; N breve ; B 67 535 390 698 ;
-C 199 ; WX 333 ; N dotaccent ; B 145 546 289 690 ;
-C 200 ; WX 333 ; N dieresis ; B 33 546 393 690 ;
-C 202 ; WX 333 ; N ring ; B 111 522 335 746 ;
-C 203 ; WX 333 ; N cedilla ; B -21 -220 225 3 ;
-C 205 ; WX 333 ; N hungarumlaut ; B 15 538 480 722 ;
-C 206 ; WX 333 ; N ogonek ; B 68 -155 246 -10 ;
-C 207 ; WX 333 ; N caron ; B 60 531 403 705 ;
-C 208 ; WX 1000 ; N emdash ; B -47 189 979 287 ;
-C 225 ; WX 889 ; N AE ; B -86 0 915 722 ;
-C 227 ; WX 412 ; N ordfeminine ; B 47 407 460 705 ;
-C 232 ; WX 704 ; N Lslash ; B -41 0 670 722 ;
-C 233 ; WX 833 ; N Oslash ; B 35 -68 798 790 ;
-C 234 ; WX 963 ; N OE ; B 29 0 989 722 ;
-C 235 ; WX 356 ; N ordmasculine ; B 42 407 394 705 ;
-C 241 ; WX 815 ; N ae ; B -18 -15 775 477 ;
-C 245 ; WX 389 ; N dotlessi ; B 32 -15 345 477 ;
-C 248 ; WX 389 ; N lslash ; B 5 -15 390 737 ;
-C 249 ; WX 574 ; N oslash ; B 0 -121 530 583 ;
-C 250 ; WX 852 ; N oe ; B -6 -15 812 477 ;
-C 251 ; WX 574 ; N germandbls ; B -91 -205 540 737 ;
-C -1 ; WX 519 ; N ecircumflex ; B 0 -15 479 705 ;
-C -1 ; WX 519 ; N edieresis ; B 0 -15 486 690 ;
-C -1 ; WX 667 ; N aacute ; B 6 -15 636 722 ;
-C -1 ; WX 747 ; N registered ; B -2 -15 750 737 ;
-C -1 ; WX 389 ; N icircumflex ; B 21 -15 363 698 ;
-C -1 ; WX 685 ; N udieresis ; B 30 -15 635 690 ;
-C -1 ; WX 574 ; N ograve ; B 0 -15 530 722 ;
-C -1 ; WX 685 ; N uacute ; B 30 -15 635 722 ;
-C -1 ; WX 685 ; N ucircumflex ; B 30 -15 635 705 ;
-C -1 ; WX 741 ; N Aacute ; B -75 0 716 947 ;
-C -1 ; WX 389 ; N igrave ; B 32 -15 345 715 ;
-C -1 ; WX 444 ; N Icircumflex ; B -41 0 485 930 ;
-C -1 ; WX 537 ; N ccedilla ; B 0 -220 482 477 ;
-C -1 ; WX 667 ; N adieresis ; B 6 -15 636 690 ;
-C -1 ; WX 741 ; N Ecircumflex ; B -41 0 730 930 ;
-C -1 ; WX 481 ; N scaron ; B 0 -15 477 705 ;
-C -1 ; WX 648 ; N thorn ; B -119 -205 590 737 ;
-C -1 ; WX 950 ; N trademark ; B 42 317 1017 722 ;
-C -1 ; WX 519 ; N egrave ; B 0 -15 479 722 ;
-C -1 ; WX 344 ; N threesuperior ; B 3 273 361 705 ;
-C -1 ; WX 519 ; N zcaron ; B -19 -15 473 695 ;
-C -1 ; WX 667 ; N atilde ; B 6 -15 636 690 ;
-C -1 ; WX 667 ; N aring ; B 6 -15 636 746 ;
-C -1 ; WX 574 ; N ocircumflex ; B 0 -15 530 705 ;
-C -1 ; WX 741 ; N Edieresis ; B -41 0 730 915 ;
-C -1 ; WX 861 ; N threequarters ; B 35 -15 789 705 ;
-C -1 ; WX 519 ; N ydieresis ; B -66 -205 493 690 ;
-C -1 ; WX 519 ; N yacute ; B -66 -205 493 722 ;
-C -1 ; WX 389 ; N iacute ; B 32 -15 370 715 ;
-C -1 ; WX 741 ; N Acircumflex ; B -75 0 716 930 ;
-C -1 ; WX 833 ; N Uacute ; B 88 -15 900 947 ;
-C -1 ; WX 519 ; N eacute ; B 0 -15 479 722 ;
-C -1 ; WX 833 ; N Ograve ; B 37 -15 796 947 ;
-C -1 ; WX 667 ; N agrave ; B 6 -15 636 722 ;
-C -1 ; WX 833 ; N Udieresis ; B 88 -15 900 915 ;
-C -1 ; WX 667 ; N acircumflex ; B 6 -15 636 705 ;
-C -1 ; WX 444 ; N Igrave ; B -41 0 485 947 ;
-C -1 ; WX 344 ; N twosuperior ; B -17 280 362 705 ;
-C -1 ; WX 833 ; N Ugrave ; B 88 -15 900 947 ;
-C -1 ; WX 861 ; N onequarter ; B 17 -15 789 705 ;
-C -1 ; WX 833 ; N Ucircumflex ; B 88 -15 900 930 ;
-C -1 ; WX 685 ; N Scaron ; B 1 -15 666 930 ;
-C -1 ; WX 444 ; N Idieresis ; B -41 0 509 915 ;
-C -1 ; WX 389 ; N idieresis ; B 31 -15 391 683 ;
-C -1 ; WX 741 ; N Egrave ; B -41 0 730 947 ;
-C -1 ; WX 833 ; N Oacute ; B 37 -15 796 947 ;
-C -1 ; WX 606 ; N divide ; B 50 -40 556 546 ;
-C -1 ; WX 741 ; N Atilde ; B -75 0 716 915 ;
-C -1 ; WX 741 ; N Aring ; B -75 0 716 991 ;
-C -1 ; WX 833 ; N Odieresis ; B 37 -15 796 915 ;
-C -1 ; WX 741 ; N Adieresis ; B -75 0 716 915 ;
-C -1 ; WX 852 ; N Ntilde ; B -61 -10 913 915 ;
-C -1 ; WX 704 ; N Zcaron ; B -33 0 711 930 ;
-C -1 ; WX 741 ; N Thorn ; B -41 0 690 722 ;
-C -1 ; WX 444 ; N Iacute ; B -41 0 488 947 ;
-C -1 ; WX 606 ; N plusminus ; B 50 0 556 506 ;
-C -1 ; WX 606 ; N multiply ; B 65 15 541 491 ;
-C -1 ; WX 741 ; N Eacute ; B -41 0 730 947 ;
-C -1 ; WX 704 ; N Ydieresis ; B 13 0 775 915 ;
-C -1 ; WX 344 ; N onesuperior ; B 19 282 326 705 ;
-C -1 ; WX 685 ; N ugrave ; B 30 -15 635 722 ;
-C -1 ; WX 606 ; N logicalnot ; B 50 103 556 403 ;
-C -1 ; WX 685 ; N ntilde ; B 0 -15 639 690 ;
-C -1 ; WX 833 ; N Otilde ; B 37 -15 796 915 ;
-C -1 ; WX 574 ; N otilde ; B 0 -15 530 690 ;
-C -1 ; WX 759 ; N Ccedilla ; B 37 -220 759 737 ;
-C -1 ; WX 741 ; N Agrave ; B -75 0 716 947 ;
-C -1 ; WX 861 ; N onehalf ; B 17 -15 798 705 ;
-C -1 ; WX 833 ; N Eth ; B -47 0 796 722 ;
-C -1 ; WX 400 ; N degree ; B 86 419 372 705 ;
-C -1 ; WX 704 ; N Yacute ; B 13 0 775 947 ;
-C -1 ; WX 833 ; N Ocircumflex ; B 37 -15 796 930 ;
-C -1 ; WX 574 ; N oacute ; B 0 -15 530 722 ;
-C -1 ; WX 685 ; N mu ; B -89 -205 635 477 ;
-C -1 ; WX 606 ; N minus ; B 50 199 556 307 ;
-C -1 ; WX 574 ; N eth ; B 0 -15 530 752 ;
-C -1 ; WX 574 ; N odieresis ; B 0 -15 530 690 ;
-C -1 ; WX 747 ; N copyright ; B -2 -15 750 737 ;
-C -1 ; WX 606 ; N brokenbar ; B 249 -175 357 675 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 239
-
-KPX A y -33
-KPX A w -25
-KPX A v -10
-KPX A u -15
-KPX A quoteright -95
-KPX A quotedblright -95
-KPX A Y -70
-KPX A W -84
-KPX A V -100
-KPX A U -32
-KPX A T 5
-KPX A Q 5
-KPX A O 5
-KPX A G 5
-KPX A C 5
-
-KPX B period 15
-KPX B comma 15
-KPX B U 15
-KPX B A -11
-
-KPX C A -5
-
-KPX D period -11
-KPX D comma -11
-KPX D Y 6
-KPX D W -11
-KPX D V -18
-
-KPX F r -27
-KPX F period -91
-KPX F o -47
-KPX F i -41
-KPX F e -41
-KPX F comma -91
-KPX F a -47
-KPX F A -79
-
-KPX J u -39
-KPX J period -74
-KPX J o -40
-KPX J e -33
-KPX J comma -74
-KPX J a -40
-KPX J A -30
-
-KPX K y -48
-KPX K u -4
-KPX K o -4
-KPX K e 18
-
-KPX L y -30
-KPX L quoteright -100
-KPX L quotedblright -100
-KPX L Y -55
-KPX L W -69
-KPX L V -97
-KPX L T -75
-
-KPX N period -49
-KPX N comma -49
-
-KPX O period -18
-KPX O comma -18
-KPX O X -18
-KPX O W -15
-KPX O V -24
-KPX O A -5
-
-KPX P period -100
-KPX P o -40
-KPX P e -33
-KPX P comma -100
-KPX P a -40
-KPX P A -80
-
-KPX R W -14
-KPX R V -24
-
-KPX S period -18
-KPX S comma -18
-
-KPX T y -30
-KPX T w -30
-KPX T u -22
-KPX T r -9
-KPX T period -55
-KPX T o -40
-KPX T i -22
-KPX T hyphen -75
-KPX T h -9
-KPX T e -33
-KPX T comma -55
-KPX T a -40
-KPX T O 11
-KPX T A -60
-
-KPX U period -25
-KPX U comma -25
-KPX U A -42
-
-KPX V u -70
-KPX V semicolon 6
-KPX V period -94
-KPX V o -71
-KPX V i -35
-KPX V hyphen -94
-KPX V e -66
-KPX V comma -94
-KPX V colon -49
-KPX V a -55
-KPX V O -19
-KPX V G -12
-KPX V A -100
-
-KPX W y -41
-KPX W u -25
-KPX W semicolon -22
-KPX W period -86
-KPX W o -33
-KPX W i -27
-KPX W hyphen -61
-KPX W h 5
-KPX W e -39
-KPX W comma -86
-KPX W colon -22
-KPX W a -33
-KPX W O -11
-KPX W A -66
-
-KPX Y u -58
-KPX Y semicolon -55
-KPX Y period -91
-KPX Y o -77
-KPX Y i -22
-KPX Y hyphen -91
-KPX Y e -71
-KPX Y comma -91
-KPX Y colon -55
-KPX Y a -77
-KPX Y A -79
-
-KPX a y -8
-KPX a w -8
-KPX a v 6
-
-KPX b y -6
-KPX b v 8
-KPX b period 6
-KPX b comma 6
-
-KPX c y -20
-KPX c period -8
-KPX c l -13
-KPX c k -8
-KPX c h -18
-KPX c comma -8
-
-KPX colon space -18
-
-KPX comma space -18
-KPX comma quoteright -18
-KPX comma quotedblright -18
-
-KPX d y -15
-KPX d w -15
-
-KPX e y -15
-KPX e x -5
-KPX e w -15
-KPX e p -11
-KPX e g -4
-KPX e b -8
-
-KPX f quoteright 105
-KPX f quotedblright 105
-KPX f period -28
-KPX f o 7
-KPX f l 7
-KPX f i 7
-KPX f e 14
-KPX f dotlessi 7
-KPX f comma -28
-KPX f a 8
-
-KPX g y -11
-KPX g r 11
-KPX g period -5
-KPX g comma -5
-
-KPX h y -20
-
-KPX i v 7
-
-KPX k y -15
-KPX k o -22
-KPX k e -16
-
-KPX l y -7
-KPX l w -7
-
-KPX m y -20
-KPX m u -11
-
-KPX n y -20
-KPX n v -7
-KPX n u -11
-
-KPX o y -11
-KPX o w -8
-KPX o v 6
-
-KPX p y -4
-KPX p period 8
-KPX p comma 8
-
-KPX period space -18
-KPX period quoteright -18
-KPX period quotedblright -18
-
-KPX quotedblleft quoteleft 20
-KPX quotedblleft A -60
-
-KPX quotedblright space -18
-
-KPX quoteleft A -80
-
-KPX quoteright v -16
-KPX quoteright t -22
-KPX quoteright s -46
-KPX quoteright r -9
-KPX quoteright l -22
-KPX quoteright d -41
-
-KPX r y -20
-KPX r v -7
-KPX r u -11
-KPX r t -11
-KPX r semicolon 9
-KPX r s -20
-KPX r quoteright 9
-KPX r period -90
-KPX r p -17
-KPX r o -11
-KPX r l -14
-KPX r k 9
-KPX r i -14
-KPX r hyphen -16
-KPX r g -11
-KPX r e -7
-KPX r d -7
-KPX r comma -90
-KPX r colon 9
-KPX r a -11
-
-KPX s period 11
-KPX s comma 11
-
-KPX semicolon space -18
-
-KPX space quotedblleft -18
-KPX space Y -18
-KPX space W -33
-KPX space V -24
-KPX space T -18
-KPX space A -22
-
-KPX v period -11
-KPX v o -6
-KPX v comma -11
-KPX v a -6
-
-KPX w period -17
-KPX w o -14
-KPX w e -8
-KPX w comma -17
-KPX w a -14
-
-KPX x e 5
-
-KPX y period -25
-KPX y o 8
-KPX y e 15
-KPX y comma -25
-KPX y a 8
-
-KPX z e 4
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 259 225 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 259 225 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 259 225 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 259 225 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 229 245 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 259 225 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 296 225 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 296 225 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 296 225 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 296 225 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 116 225 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 116 225 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 116 225 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 116 225 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 326 225 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 315 225 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 315 225 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 315 225 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 315 225 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 315 225 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 206 225 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 340 225 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 340 225 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 340 225 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 340 225 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 246 225 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 236 225 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 226 225 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 167 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 167 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 167 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 167 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 167 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 167 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 93 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 93 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 93 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 93 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -2 -7 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -2 -7 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -2 -7 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -2 -7 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 176 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 121 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 121 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 121 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 121 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 121 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 74 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 176 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 176 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 176 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 176 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 93 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 93 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 63 -10 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/NewCenturySchlbk-Italic.afm b/blt3.0.1/library/afm/NewCenturySchlbk-Italic.afm
deleted file mode 100644
index 09d2bff..0000000
--- a/blt3.0.1/library/afm/NewCenturySchlbk-Italic.afm
+++ /dev/null
@@ -1,537 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Tue May 28 16:40:04 1991
-Comment UniqueID 35028
-Comment VMusage 31423 38315
-FontName NewCenturySchlbk-Italic
-FullName New Century Schoolbook Italic
-FamilyName New Century Schoolbook
-Weight Medium
-ItalicAngle -16
-IsFixedPitch false
-FontBBox -166 -250 994 958
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.006
-Notice Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
-EncodingScheme AdobeStandardEncoding
-CapHeight 722
-XHeight 466
-Ascender 737
-Descender -205
-StartCharMetrics 228
-C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 17 -15 303 737 ;
-C 34 ; WX 400 ; N quotedbl ; B 127 463 363 737 ;
-C 35 ; WX 556 ; N numbersign ; B 28 0 528 690 ;
-C 36 ; WX 556 ; N dollar ; B 4 -142 536 808 ;
-C 37 ; WX 833 ; N percent ; B 43 -15 790 705 ;
-C 38 ; WX 852 ; N ampersand ; B 24 -15 773 737 ;
-C 39 ; WX 204 ; N quoteright ; B 39 463 229 737 ;
-C 40 ; WX 333 ; N parenleft ; B 53 -117 411 745 ;
-C 41 ; WX 333 ; N parenright ; B -93 -117 265 745 ;
-C 42 ; WX 500 ; N asterisk ; B 80 318 500 737 ;
-C 43 ; WX 606 ; N plus ; B 50 0 556 506 ;
-C 44 ; WX 278 ; N comma ; B -39 -165 151 109 ;
-C 45 ; WX 333 ; N hyphen ; B 32 202 259 274 ;
-C 46 ; WX 278 ; N period ; B 17 -15 141 109 ;
-C 47 ; WX 606 ; N slash ; B 132 -15 474 737 ;
-C 48 ; WX 556 ; N zero ; B 30 -15 526 705 ;
-C 49 ; WX 556 ; N one ; B 50 0 459 705 ;
-C 50 ; WX 556 ; N two ; B -37 0 506 705 ;
-C 51 ; WX 556 ; N three ; B -2 -15 506 705 ;
-C 52 ; WX 556 ; N four ; B -8 0 512 705 ;
-C 53 ; WX 556 ; N five ; B 4 -15 540 705 ;
-C 54 ; WX 556 ; N six ; B 36 -15 548 705 ;
-C 55 ; WX 556 ; N seven ; B 69 -15 561 705 ;
-C 56 ; WX 556 ; N eight ; B 6 -15 526 705 ;
-C 57 ; WX 556 ; N nine ; B 8 -15 520 705 ;
-C 58 ; WX 278 ; N colon ; B 17 -15 229 466 ;
-C 59 ; WX 278 ; N semicolon ; B -39 -165 229 466 ;
-C 60 ; WX 606 ; N less ; B 36 -8 542 514 ;
-C 61 ; WX 606 ; N equal ; B 50 117 556 389 ;
-C 62 ; WX 606 ; N greater ; B 64 -8 570 514 ;
-C 63 ; WX 444 ; N question ; B 102 -15 417 737 ;
-C 64 ; WX 747 ; N at ; B -2 -15 750 737 ;
-C 65 ; WX 704 ; N A ; B -87 0 668 737 ;
-C 66 ; WX 722 ; N B ; B -33 0 670 722 ;
-C 67 ; WX 722 ; N C ; B 40 -15 712 737 ;
-C 68 ; WX 778 ; N D ; B -33 0 738 722 ;
-C 69 ; WX 722 ; N E ; B -33 0 700 722 ;
-C 70 ; WX 667 ; N F ; B -33 0 700 722 ;
-C 71 ; WX 778 ; N G ; B 40 -15 763 737 ;
-C 72 ; WX 833 ; N H ; B -33 0 866 722 ;
-C 73 ; WX 407 ; N I ; B -33 0 435 722 ;
-C 74 ; WX 611 ; N J ; B -14 -15 651 722 ;
-C 75 ; WX 741 ; N K ; B -33 0 816 722 ;
-C 76 ; WX 667 ; N L ; B -33 0 627 722 ;
-C 77 ; WX 944 ; N M ; B -33 0 977 722 ;
-C 78 ; WX 815 ; N N ; B -51 -15 866 722 ;
-C 79 ; WX 778 ; N O ; B 40 -15 738 737 ;
-C 80 ; WX 667 ; N P ; B -33 0 667 722 ;
-C 81 ; WX 778 ; N Q ; B 40 -190 738 737 ;
-C 82 ; WX 741 ; N R ; B -45 -15 692 722 ;
-C 83 ; WX 667 ; N S ; B -6 -15 638 737 ;
-C 84 ; WX 685 ; N T ; B 40 0 725 722 ;
-C 85 ; WX 815 ; N U ; B 93 -15 867 722 ;
-C 86 ; WX 704 ; N V ; B 36 -10 779 722 ;
-C 87 ; WX 926 ; N W ; B 53 -10 978 722 ;
-C 88 ; WX 704 ; N X ; B -75 0 779 722 ;
-C 89 ; WX 685 ; N Y ; B 31 0 760 722 ;
-C 90 ; WX 667 ; N Z ; B -25 0 667 722 ;
-C 91 ; WX 333 ; N bracketleft ; B -55 -109 388 737 ;
-C 92 ; WX 606 ; N backslash ; B 132 -15 474 737 ;
-C 93 ; WX 333 ; N bracketright ; B -77 -109 366 737 ;
-C 94 ; WX 606 ; N asciicircum ; B 89 325 517 690 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 204 ; N quoteleft ; B 39 463 229 737 ;
-C 97 ; WX 574 ; N a ; B 2 -15 524 466 ;
-C 98 ; WX 556 ; N b ; B 32 -15 488 737 ;
-C 99 ; WX 444 ; N c ; B 2 -15 394 466 ;
-C 100 ; WX 611 ; N d ; B 2 -15 585 737 ;
-C 101 ; WX 444 ; N e ; B -6 -15 388 466 ;
-C 102 ; WX 333 ; N f ; B -68 -205 470 737 ; L i fi ; L l fl ;
-C 103 ; WX 537 ; N g ; B -79 -205 523 497 ;
-C 104 ; WX 611 ; N h ; B 14 -15 562 737 ;
-C 105 ; WX 333 ; N i ; B 29 -15 282 715 ;
-C 106 ; WX 315 ; N j ; B -166 -205 318 715 ;
-C 107 ; WX 556 ; N k ; B 0 -15 497 737 ;
-C 108 ; WX 333 ; N l ; B 14 -15 292 737 ;
-C 109 ; WX 889 ; N m ; B 14 -15 840 466 ;
-C 110 ; WX 611 ; N n ; B 14 -15 562 466 ;
-C 111 ; WX 500 ; N o ; B 2 -15 450 466 ;
-C 112 ; WX 574 ; N p ; B -101 -205 506 466 ;
-C 113 ; WX 556 ; N q ; B 2 -205 500 466 ;
-C 114 ; WX 444 ; N r ; B 10 0 434 466 ;
-C 115 ; WX 444 ; N s ; B 2 -15 394 466 ;
-C 116 ; WX 352 ; N t ; B 24 -15 328 619 ;
-C 117 ; WX 611 ; N u ; B 44 -15 556 466 ;
-C 118 ; WX 519 ; N v ; B 31 -15 447 466 ;
-C 119 ; WX 778 ; N w ; B 31 -15 706 466 ;
-C 120 ; WX 500 ; N x ; B -33 -15 471 466 ;
-C 121 ; WX 500 ; N y ; B -83 -205 450 466 ;
-C 122 ; WX 463 ; N z ; B -33 -15 416 466 ;
-C 123 ; WX 333 ; N braceleft ; B 38 -109 394 737 ;
-C 124 ; WX 606 ; N bar ; B 267 -250 339 750 ;
-C 125 ; WX 333 ; N braceright ; B -87 -109 269 737 ;
-C 126 ; WX 606 ; N asciitilde ; B 72 184 534 322 ;
-C 161 ; WX 333 ; N exclamdown ; B -22 -205 264 547 ;
-C 162 ; WX 556 ; N cent ; B 62 -144 486 580 ;
-C 163 ; WX 556 ; N sterling ; B -13 -15 544 705 ;
-C 164 ; WX 167 ; N fraction ; B -134 -15 301 705 ;
-C 165 ; WX 556 ; N yen ; B 40 0 624 690 ;
-C 166 ; WX 556 ; N florin ; B -58 -205 569 737 ;
-C 167 ; WX 500 ; N section ; B -10 -147 480 737 ;
-C 168 ; WX 556 ; N currency ; B 26 93 530 597 ;
-C 169 ; WX 278 ; N quotesingle ; B 151 463 237 737 ;
-C 170 ; WX 389 ; N quotedblleft ; B 39 463 406 737 ;
-C 171 ; WX 426 ; N guillemotleft ; B -15 74 402 402 ;
-C 172 ; WX 333 ; N guilsinglleft ; B 40 74 259 402 ;
-C 173 ; WX 333 ; N guilsinglright ; B 40 74 259 402 ;
-C 174 ; WX 611 ; N fi ; B -68 -205 555 737 ;
-C 175 ; WX 611 ; N fl ; B -68 -205 587 737 ;
-C 177 ; WX 500 ; N endash ; B -27 208 487 268 ;
-C 178 ; WX 500 ; N dagger ; B 51 -147 506 737 ;
-C 179 ; WX 500 ; N daggerdbl ; B -54 -147 506 737 ;
-C 180 ; WX 278 ; N periodcentered ; B 71 238 207 374 ;
-C 182 ; WX 650 ; N paragraph ; B 48 -132 665 722 ;
-C 183 ; WX 606 ; N bullet ; B 122 180 484 542 ;
-C 184 ; WX 204 ; N quotesinglbase ; B -78 -165 112 109 ;
-C 185 ; WX 389 ; N quotedblbase ; B -78 -165 289 109 ;
-C 186 ; WX 389 ; N quotedblright ; B 39 463 406 737 ;
-C 187 ; WX 426 ; N guillemotright ; B -15 74 402 402 ;
-C 188 ; WX 1000 ; N ellipsis ; B 59 -15 849 109 ;
-C 189 ; WX 1000 ; N perthousand ; B 6 -15 994 705 ;
-C 191 ; WX 444 ; N questiondown ; B -3 -205 312 547 ;
-C 193 ; WX 333 ; N grave ; B 71 518 262 690 ;
-C 194 ; WX 333 ; N acute ; B 132 518 355 690 ;
-C 195 ; WX 333 ; N circumflex ; B 37 518 331 690 ;
-C 196 ; WX 333 ; N tilde ; B 52 547 383 649 ;
-C 197 ; WX 333 ; N macron ; B 52 560 363 610 ;
-C 198 ; WX 333 ; N breve ; B 69 518 370 677 ;
-C 199 ; WX 333 ; N dotaccent ; B 146 544 248 646 ;
-C 200 ; WX 333 ; N dieresis ; B 59 544 359 646 ;
-C 202 ; WX 333 ; N ring ; B 114 512 314 712 ;
-C 203 ; WX 333 ; N cedilla ; B 3 -215 215 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B 32 518 455 690 ;
-C 206 ; WX 333 ; N ogonek ; B 68 -215 254 0 ;
-C 207 ; WX 333 ; N caron ; B 73 518 378 690 ;
-C 208 ; WX 1000 ; N emdash ; B -27 208 987 268 ;
-C 225 ; WX 870 ; N AE ; B -87 0 888 722 ;
-C 227 ; WX 422 ; N ordfeminine ; B 72 416 420 705 ;
-C 232 ; WX 667 ; N Lslash ; B -33 0 627 722 ;
-C 233 ; WX 778 ; N Oslash ; B 16 -68 748 780 ;
-C 234 ; WX 981 ; N OE ; B 40 0 975 722 ;
-C 235 ; WX 372 ; N ordmasculine ; B 66 416 370 705 ;
-C 241 ; WX 722 ; N ae ; B -18 -15 666 466 ;
-C 245 ; WX 333 ; N dotlessi ; B 29 -15 282 466 ;
-C 248 ; WX 333 ; N lslash ; B -25 -15 340 737 ;
-C 249 ; WX 500 ; N oslash ; B 2 -121 450 549 ;
-C 250 ; WX 778 ; N oe ; B 2 -15 722 466 ;
-C 251 ; WX 556 ; N germandbls ; B -76 -205 525 737 ;
-C -1 ; WX 444 ; N ecircumflex ; B -6 -15 388 690 ;
-C -1 ; WX 444 ; N edieresis ; B -6 -15 415 646 ;
-C -1 ; WX 574 ; N aacute ; B 2 -15 524 690 ;
-C -1 ; WX 747 ; N registered ; B -2 -15 750 737 ;
-C -1 ; WX 333 ; N icircumflex ; B 29 -15 331 690 ;
-C -1 ; WX 611 ; N udieresis ; B 44 -15 556 646 ;
-C -1 ; WX 500 ; N ograve ; B 2 -15 450 690 ;
-C -1 ; WX 611 ; N uacute ; B 44 -15 556 690 ;
-C -1 ; WX 611 ; N ucircumflex ; B 44 -15 556 690 ;
-C -1 ; WX 704 ; N Aacute ; B -87 0 668 946 ;
-C -1 ; WX 333 ; N igrave ; B 29 -15 282 690 ;
-C -1 ; WX 407 ; N Icircumflex ; B -33 0 435 946 ;
-C -1 ; WX 444 ; N ccedilla ; B 2 -215 394 466 ;
-C -1 ; WX 574 ; N adieresis ; B 2 -15 524 646 ;
-C -1 ; WX 722 ; N Ecircumflex ; B -33 0 700 946 ;
-C -1 ; WX 444 ; N scaron ; B 2 -15 434 690 ;
-C -1 ; WX 574 ; N thorn ; B -101 -205 506 737 ;
-C -1 ; WX 950 ; N trademark ; B 32 318 968 722 ;
-C -1 ; WX 444 ; N egrave ; B -6 -15 388 690 ;
-C -1 ; WX 333 ; N threesuperior ; B 22 273 359 705 ;
-C -1 ; WX 463 ; N zcaron ; B -33 -15 443 690 ;
-C -1 ; WX 574 ; N atilde ; B 2 -15 524 649 ;
-C -1 ; WX 574 ; N aring ; B 2 -15 524 712 ;
-C -1 ; WX 500 ; N ocircumflex ; B 2 -15 450 690 ;
-C -1 ; WX 722 ; N Edieresis ; B -33 0 700 902 ;
-C -1 ; WX 834 ; N threequarters ; B 22 -15 782 705 ;
-C -1 ; WX 500 ; N ydieresis ; B -83 -205 450 646 ;
-C -1 ; WX 500 ; N yacute ; B -83 -205 450 690 ;
-C -1 ; WX 333 ; N iacute ; B 29 -15 355 690 ;
-C -1 ; WX 704 ; N Acircumflex ; B -87 0 668 946 ;
-C -1 ; WX 815 ; N Uacute ; B 93 -15 867 946 ;
-C -1 ; WX 444 ; N eacute ; B -6 -15 411 690 ;
-C -1 ; WX 778 ; N Ograve ; B 40 -15 738 946 ;
-C -1 ; WX 574 ; N agrave ; B 2 -15 524 690 ;
-C -1 ; WX 815 ; N Udieresis ; B 93 -15 867 902 ;
-C -1 ; WX 574 ; N acircumflex ; B 2 -15 524 690 ;
-C -1 ; WX 407 ; N Igrave ; B -33 0 435 946 ;
-C -1 ; WX 333 ; N twosuperior ; B 0 282 359 705 ;
-C -1 ; WX 815 ; N Ugrave ; B 93 -15 867 946 ;
-C -1 ; WX 834 ; N onequarter ; B 34 -15 782 705 ;
-C -1 ; WX 815 ; N Ucircumflex ; B 93 -15 867 946 ;
-C -1 ; WX 667 ; N Scaron ; B -6 -15 638 946 ;
-C -1 ; WX 407 ; N Idieresis ; B -33 0 456 902 ;
-C -1 ; WX 333 ; N idieresis ; B 29 -15 359 646 ;
-C -1 ; WX 722 ; N Egrave ; B -33 0 700 946 ;
-C -1 ; WX 778 ; N Oacute ; B 40 -15 738 946 ;
-C -1 ; WX 606 ; N divide ; B 50 -22 556 528 ;
-C -1 ; WX 704 ; N Atilde ; B -87 0 668 905 ;
-C -1 ; WX 704 ; N Aring ; B -87 0 668 958 ;
-C -1 ; WX 778 ; N Odieresis ; B 40 -15 738 902 ;
-C -1 ; WX 704 ; N Adieresis ; B -87 0 668 902 ;
-C -1 ; WX 815 ; N Ntilde ; B -51 -15 866 905 ;
-C -1 ; WX 667 ; N Zcaron ; B -25 0 667 946 ;
-C -1 ; WX 667 ; N Thorn ; B -33 0 627 722 ;
-C -1 ; WX 407 ; N Iacute ; B -33 0 452 946 ;
-C -1 ; WX 606 ; N plusminus ; B 50 0 556 506 ;
-C -1 ; WX 606 ; N multiply ; B 74 24 532 482 ;
-C -1 ; WX 722 ; N Eacute ; B -33 0 700 946 ;
-C -1 ; WX 685 ; N Ydieresis ; B 31 0 760 902 ;
-C -1 ; WX 333 ; N onesuperior ; B 34 282 311 705 ;
-C -1 ; WX 611 ; N ugrave ; B 44 -15 556 690 ;
-C -1 ; WX 606 ; N logicalnot ; B 50 108 556 389 ;
-C -1 ; WX 611 ; N ntilde ; B 14 -15 562 649 ;
-C -1 ; WX 778 ; N Otilde ; B 40 -15 738 905 ;
-C -1 ; WX 500 ; N otilde ; B 2 -15 467 649 ;
-C -1 ; WX 722 ; N Ccedilla ; B 40 -215 712 737 ;
-C -1 ; WX 704 ; N Agrave ; B -87 0 668 946 ;
-C -1 ; WX 834 ; N onehalf ; B 34 -15 776 705 ;
-C -1 ; WX 778 ; N Eth ; B -33 0 738 722 ;
-C -1 ; WX 400 ; N degree ; B 86 419 372 705 ;
-C -1 ; WX 685 ; N Yacute ; B 31 0 760 946 ;
-C -1 ; WX 778 ; N Ocircumflex ; B 40 -15 738 946 ;
-C -1 ; WX 500 ; N oacute ; B 2 -15 450 690 ;
-C -1 ; WX 611 ; N mu ; B -60 -205 556 466 ;
-C -1 ; WX 606 ; N minus ; B 50 217 556 289 ;
-C -1 ; WX 500 ; N eth ; B 2 -15 450 737 ;
-C -1 ; WX 500 ; N odieresis ; B 2 -15 450 646 ;
-C -1 ; WX 747 ; N copyright ; B -2 -15 750 737 ;
-C -1 ; WX 606 ; N brokenbar ; B 267 -175 339 675 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 181
-
-KPX A y -55
-KPX A w -18
-KPX A v -18
-KPX A u -18
-KPX A quoteright -125
-KPX A quotedblright -125
-KPX A Y -55
-KPX A W -74
-KPX A V -74
-KPX A U -37
-KPX A T -30
-KPX A Q -18
-KPX A O -18
-KPX A G -18
-KPX A C -18
-
-KPX B period -50
-KPX B comma -50
-
-KPX C period -50
-KPX C comma -50
-
-KPX D period -50
-KPX D comma -50
-KPX D Y -18
-KPX D W -18
-KPX D V -18
-
-KPX F r -55
-KPX F period -125
-KPX F o -55
-KPX F i -10
-KPX F e -55
-KPX F comma -125
-KPX F a -55
-KPX F A -35
-
-KPX G period -50
-KPX G comma -50
-
-KPX J u -18
-KPX J period -100
-KPX J o -37
-KPX J e -37
-KPX J comma -100
-KPX J a -37
-KPX J A -18
-
-KPX L y -50
-KPX L quoteright -125
-KPX L quotedblright -125
-KPX L Y -100
-KPX L W -100
-KPX L V -100
-KPX L T -100
-
-KPX N period -60
-KPX N comma -60
-
-KPX O period -50
-KPX O comma -50
-KPX O Y -18
-KPX O X -18
-KPX O V -18
-KPX O T 18
-
-KPX P period -125
-KPX P o -55
-KPX P e -55
-KPX P comma -125
-KPX P a -55
-KPX P A -50
-
-KPX Q period -20
-KPX Q comma -20
-
-KPX R Y -18
-KPX R W -18
-KPX R V -18
-KPX R U -18
-
-KPX S period -50
-KPX S comma -50
-
-KPX T y -50
-KPX T w -50
-KPX T u -50
-KPX T semicolon -50
-KPX T r -50
-KPX T period -100
-KPX T o -74
-KPX T i -18
-KPX T hyphen -100
-KPX T h -25
-KPX T e -74
-KPX T comma -100
-KPX T colon -50
-KPX T a -74
-KPX T O 18
-
-KPX U period -100
-KPX U comma -100
-KPX U A -18
-
-KPX V u -75
-KPX V semicolon -75
-KPX V period -100
-KPX V o -75
-KPX V i -50
-KPX V hyphen -100
-KPX V e -75
-KPX V comma -100
-KPX V colon -75
-KPX V a -75
-KPX V A -37
-
-KPX W y -55
-KPX W u -55
-KPX W semicolon -75
-KPX W period -100
-KPX W o -55
-KPX W i -20
-KPX W hyphen -75
-KPX W h -20
-KPX W e -55
-KPX W comma -100
-KPX W colon -75
-KPX W a -55
-KPX W A -55
-
-KPX Y u -100
-KPX Y semicolon -75
-KPX Y period -100
-KPX Y o -100
-KPX Y i -25
-KPX Y hyphen -100
-KPX Y e -100
-KPX Y comma -100
-KPX Y colon -75
-KPX Y a -100
-KPX Y A -55
-
-KPX b period -50
-KPX b comma -50
-KPX b b -10
-
-KPX c period -50
-KPX c k -18
-KPX c h -18
-KPX c comma -50
-
-KPX colon space -37
-
-KPX comma space -37
-KPX comma quoteright -37
-KPX comma quotedblright -37
-
-KPX e period -37
-KPX e comma -37
-
-KPX f quoteright 75
-KPX f quotedblright 75
-KPX f period -75
-KPX f o -10
-KPX f comma -75
-
-KPX g period -50
-KPX g comma -50
-
-KPX l y -10
-
-KPX o period -50
-KPX o comma -50
-
-KPX p period -50
-KPX p comma -50
-
-KPX period space -37
-KPX period quoteright -37
-KPX period quotedblright -37
-
-KPX quotedblleft A -75
-
-KPX quotedblright space -37
-
-KPX quoteleft quoteleft -37
-KPX quoteleft A -75
-
-KPX quoteright s -25
-KPX quoteright quoteright -37
-KPX quoteright d -37
-
-KPX r semicolon -25
-KPX r s -10
-KPX r period -125
-KPX r k -18
-KPX r hyphen -75
-KPX r comma -125
-KPX r colon -25
-
-KPX s period -50
-KPX s comma -50
-
-KPX semicolon space -37
-
-KPX space quoteleft -37
-KPX space quotedblleft -37
-KPX space Y -37
-KPX space W -37
-KPX space V -37
-KPX space T -37
-KPX space A -37
-
-KPX v period -75
-KPX v comma -75
-
-KPX w period -75
-KPX w comma -75
-
-KPX y period -75
-KPX y comma -75
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 246 256 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 246 256 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 231 256 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 246 256 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 216 246 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 231 256 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 255 256 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 255 256 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 255 256 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 255 256 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 97 256 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 97 256 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 97 256 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 97 256 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 301 256 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 283 256 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 283 256 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 283 256 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 283 256 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 283 256 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 227 256 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 301 256 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 301 256 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 301 256 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 301 256 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 256 256 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 236 256 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 227 256 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 121 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 121 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 121 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 121 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 121 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 121 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 56 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 56 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 56 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 56 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex 0 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis 0 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 0 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 139 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 56 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 139 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 139 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 139 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 139 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 84 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 65 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/NewCenturySchlbk-Roman.afm b/blt3.0.1/library/afm/NewCenturySchlbk-Roman.afm
deleted file mode 100644
index 80e9221..0000000
--- a/blt3.0.1/library/afm/NewCenturySchlbk-Roman.afm
+++ /dev/null
@@ -1,525 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Tue May 28 16:31:51 1991
-Comment UniqueID 35025
-Comment VMusage 30420 37312
-FontName NewCenturySchlbk-Roman
-FullName New Century Schoolbook Roman
-FamilyName New Century Schoolbook
-Weight Roman
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -195 -250 1000 965
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
-EncodingScheme AdobeStandardEncoding
-CapHeight 722
-XHeight 464
-Ascender 737
-Descender -205
-StartCharMetrics 228
-C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 296 ; N exclam ; B 86 -15 210 737 ;
-C 34 ; WX 389 ; N quotedbl ; B 61 443 328 737 ;
-C 35 ; WX 556 ; N numbersign ; B 28 0 528 690 ;
-C 36 ; WX 556 ; N dollar ; B 45 -138 511 813 ;
-C 37 ; WX 833 ; N percent ; B 43 -15 790 705 ;
-C 38 ; WX 815 ; N ampersand ; B 51 -15 775 737 ;
-C 39 ; WX 204 ; N quoteright ; B 25 443 179 737 ;
-C 40 ; WX 333 ; N parenleft ; B 40 -117 279 745 ;
-C 41 ; WX 333 ; N parenright ; B 54 -117 293 745 ;
-C 42 ; WX 500 ; N asterisk ; B 57 306 443 737 ;
-C 43 ; WX 606 ; N plus ; B 50 0 556 506 ;
-C 44 ; WX 278 ; N comma ; B 62 -185 216 109 ;
-C 45 ; WX 333 ; N hyphen ; B 42 199 291 277 ;
-C 46 ; WX 278 ; N period ; B 77 -15 201 109 ;
-C 47 ; WX 278 ; N slash ; B -32 -15 310 737 ;
-C 48 ; WX 556 ; N zero ; B 42 -15 514 705 ;
-C 49 ; WX 556 ; N one ; B 100 0 496 705 ;
-C 50 ; WX 556 ; N two ; B 35 0 505 705 ;
-C 51 ; WX 556 ; N three ; B 42 -15 498 705 ;
-C 52 ; WX 556 ; N four ; B 28 0 528 705 ;
-C 53 ; WX 556 ; N five ; B 46 -15 502 705 ;
-C 54 ; WX 556 ; N six ; B 41 -15 515 705 ;
-C 55 ; WX 556 ; N seven ; B 59 -15 508 705 ;
-C 56 ; WX 556 ; N eight ; B 42 -15 514 705 ;
-C 57 ; WX 556 ; N nine ; B 41 -15 515 705 ;
-C 58 ; WX 278 ; N colon ; B 77 -15 201 474 ;
-C 59 ; WX 278 ; N semicolon ; B 62 -185 216 474 ;
-C 60 ; WX 606 ; N less ; B 50 -8 556 514 ;
-C 61 ; WX 606 ; N equal ; B 50 117 556 389 ;
-C 62 ; WX 606 ; N greater ; B 50 -8 556 514 ;
-C 63 ; WX 444 ; N question ; B 29 -15 415 737 ;
-C 64 ; WX 737 ; N at ; B -8 -15 744 737 ;
-C 65 ; WX 722 ; N A ; B -8 0 730 737 ;
-C 66 ; WX 722 ; N B ; B 29 0 669 722 ;
-C 67 ; WX 722 ; N C ; B 45 -15 668 737 ;
-C 68 ; WX 778 ; N D ; B 29 0 733 722 ;
-C 69 ; WX 722 ; N E ; B 29 0 663 722 ;
-C 70 ; WX 667 ; N F ; B 29 0 638 722 ;
-C 71 ; WX 778 ; N G ; B 45 -15 775 737 ;
-C 72 ; WX 833 ; N H ; B 29 0 804 722 ;
-C 73 ; WX 407 ; N I ; B 38 0 369 722 ;
-C 74 ; WX 556 ; N J ; B 5 -15 540 722 ;
-C 75 ; WX 778 ; N K ; B 29 0 803 722 ;
-C 76 ; WX 667 ; N L ; B 29 0 644 722 ;
-C 77 ; WX 944 ; N M ; B 29 0 915 722 ;
-C 78 ; WX 815 ; N N ; B 24 -15 791 722 ;
-C 79 ; WX 778 ; N O ; B 45 -15 733 737 ;
-C 80 ; WX 667 ; N P ; B 29 0 650 722 ;
-C 81 ; WX 778 ; N Q ; B 45 -190 748 737 ;
-C 82 ; WX 722 ; N R ; B 29 -15 713 722 ;
-C 83 ; WX 630 ; N S ; B 47 -15 583 737 ;
-C 84 ; WX 667 ; N T ; B 19 0 648 722 ;
-C 85 ; WX 815 ; N U ; B 16 -15 799 722 ;
-C 86 ; WX 722 ; N V ; B -8 -10 730 722 ;
-C 87 ; WX 981 ; N W ; B 5 -10 976 722 ;
-C 88 ; WX 704 ; N X ; B -8 0 712 722 ;
-C 89 ; WX 704 ; N Y ; B -11 0 715 722 ;
-C 90 ; WX 611 ; N Z ; B 24 0 576 722 ;
-C 91 ; WX 333 ; N bracketleft ; B 126 -109 315 737 ;
-C 92 ; WX 606 ; N backslash ; B 132 -15 474 737 ;
-C 93 ; WX 333 ; N bracketright ; B 18 -109 207 737 ;
-C 94 ; WX 606 ; N asciicircum ; B 89 325 517 690 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 204 ; N quoteleft ; B 25 443 179 737 ;
-C 97 ; WX 556 ; N a ; B 44 -15 542 479 ;
-C 98 ; WX 556 ; N b ; B 10 -15 522 737 ;
-C 99 ; WX 444 ; N c ; B 34 -15 426 479 ;
-C 100 ; WX 574 ; N d ; B 34 -15 552 737 ;
-C 101 ; WX 500 ; N e ; B 34 -15 466 479 ;
-C 102 ; WX 333 ; N f ; B 18 0 437 737 ; L i fi ; L l fl ;
-C 103 ; WX 537 ; N g ; B 23 -205 542 494 ;
-C 104 ; WX 611 ; N h ; B 7 0 592 737 ;
-C 105 ; WX 315 ; N i ; B 18 0 286 722 ;
-C 106 ; WX 296 ; N j ; B -86 -205 216 722 ;
-C 107 ; WX 593 ; N k ; B 10 0 589 737 ;
-C 108 ; WX 315 ; N l ; B 18 0 286 737 ;
-C 109 ; WX 889 ; N m ; B 26 0 863 479 ;
-C 110 ; WX 611 ; N n ; B 22 0 589 479 ;
-C 111 ; WX 500 ; N o ; B 34 -15 466 479 ;
-C 112 ; WX 574 ; N p ; B 22 -205 540 479 ;
-C 113 ; WX 556 ; N q ; B 34 -205 552 479 ;
-C 114 ; WX 444 ; N r ; B 18 0 434 479 ;
-C 115 ; WX 463 ; N s ; B 46 -15 417 479 ;
-C 116 ; WX 389 ; N t ; B 18 -15 371 666 ;
-C 117 ; WX 611 ; N u ; B 22 -15 589 464 ;
-C 118 ; WX 537 ; N v ; B -6 -10 515 464 ;
-C 119 ; WX 778 ; N w ; B 1 -10 749 464 ;
-C 120 ; WX 537 ; N x ; B 8 0 529 464 ;
-C 121 ; WX 537 ; N y ; B 4 -205 533 464 ;
-C 122 ; WX 481 ; N z ; B 42 0 439 464 ;
-C 123 ; WX 333 ; N braceleft ; B 54 -109 279 737 ;
-C 124 ; WX 606 ; N bar ; B 267 -250 339 750 ;
-C 125 ; WX 333 ; N braceright ; B 54 -109 279 737 ;
-C 126 ; WX 606 ; N asciitilde ; B 72 184 534 322 ;
-C 161 ; WX 296 ; N exclamdown ; B 86 -205 210 547 ;
-C 162 ; WX 556 ; N cent ; B 74 -141 482 584 ;
-C 163 ; WX 556 ; N sterling ; B 18 -15 538 705 ;
-C 164 ; WX 167 ; N fraction ; B -195 -15 362 705 ;
-C 165 ; WX 556 ; N yen ; B -1 0 557 690 ;
-C 166 ; WX 556 ; N florin ; B 0 -205 538 737 ;
-C 167 ; WX 500 ; N section ; B 55 -147 445 737 ;
-C 168 ; WX 556 ; N currency ; B 26 93 530 597 ;
-C 169 ; WX 204 ; N quotesingle ; B 59 443 145 737 ;
-C 170 ; WX 389 ; N quotedblleft ; B 25 443 364 737 ;
-C 171 ; WX 426 ; N guillemotleft ; B 39 78 387 398 ;
-C 172 ; WX 259 ; N guilsinglleft ; B 39 78 220 398 ;
-C 173 ; WX 259 ; N guilsinglright ; B 39 78 220 398 ;
-C 174 ; WX 611 ; N fi ; B 18 0 582 737 ;
-C 175 ; WX 611 ; N fl ; B 18 0 582 737 ;
-C 177 ; WX 556 ; N endash ; B 0 208 556 268 ;
-C 178 ; WX 500 ; N dagger ; B 42 -147 458 737 ;
-C 179 ; WX 500 ; N daggerdbl ; B 42 -149 458 737 ;
-C 180 ; WX 278 ; N periodcentered ; B 71 238 207 374 ;
-C 182 ; WX 606 ; N paragraph ; B 60 -132 546 722 ;
-C 183 ; WX 606 ; N bullet ; B 122 180 484 542 ;
-C 184 ; WX 204 ; N quotesinglbase ; B 25 -185 179 109 ;
-C 185 ; WX 389 ; N quotedblbase ; B 25 -185 364 109 ;
-C 186 ; WX 389 ; N quotedblright ; B 25 443 364 737 ;
-C 187 ; WX 426 ; N guillemotright ; B 39 78 387 398 ;
-C 188 ; WX 1000 ; N ellipsis ; B 105 -15 895 109 ;
-C 189 ; WX 1000 ; N perthousand ; B 6 -15 994 705 ;
-C 191 ; WX 444 ; N questiondown ; B 29 -205 415 547 ;
-C 193 ; WX 333 ; N grave ; B 17 528 242 699 ;
-C 194 ; WX 333 ; N acute ; B 91 528 316 699 ;
-C 195 ; WX 333 ; N circumflex ; B 10 528 323 695 ;
-C 196 ; WX 333 ; N tilde ; B 1 553 332 655 ;
-C 197 ; WX 333 ; N macron ; B 10 568 323 623 ;
-C 198 ; WX 333 ; N breve ; B 25 528 308 685 ;
-C 199 ; WX 333 ; N dotaccent ; B 116 543 218 645 ;
-C 200 ; WX 333 ; N dieresis ; B 16 543 317 645 ;
-C 202 ; WX 333 ; N ring ; B 66 522 266 722 ;
-C 203 ; WX 333 ; N cedilla ; B 29 -215 237 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B -9 528 416 699 ;
-C 206 ; WX 333 ; N ogonek ; B 68 -215 254 0 ;
-C 207 ; WX 333 ; N caron ; B 10 528 323 695 ;
-C 208 ; WX 1000 ; N emdash ; B 0 208 1000 268 ;
-C 225 ; WX 1000 ; N AE ; B 0 0 962 722 ;
-C 227 ; WX 334 ; N ordfeminine ; B -4 407 338 705 ;
-C 232 ; WX 667 ; N Lslash ; B 29 0 644 722 ;
-C 233 ; WX 778 ; N Oslash ; B 45 -56 733 778 ;
-C 234 ; WX 1000 ; N OE ; B 21 0 979 722 ;
-C 235 ; WX 300 ; N ordmasculine ; B 4 407 296 705 ;
-C 241 ; WX 796 ; N ae ; B 34 -15 762 479 ;
-C 245 ; WX 315 ; N dotlessi ; B 18 0 286 464 ;
-C 248 ; WX 315 ; N lslash ; B 18 0 286 737 ;
-C 249 ; WX 500 ; N oslash ; B 34 -97 466 561 ;
-C 250 ; WX 833 ; N oe ; B 34 -15 799 479 ;
-C 251 ; WX 574 ; N germandbls ; B 30 -15 537 737 ;
-C -1 ; WX 500 ; N ecircumflex ; B 34 -15 466 695 ;
-C -1 ; WX 500 ; N edieresis ; B 34 -15 466 645 ;
-C -1 ; WX 556 ; N aacute ; B 44 -15 542 699 ;
-C -1 ; WX 737 ; N registered ; B -8 -15 744 737 ;
-C -1 ; WX 315 ; N icircumflex ; B 1 0 314 695 ;
-C -1 ; WX 611 ; N udieresis ; B 22 -15 589 645 ;
-C -1 ; WX 500 ; N ograve ; B 34 -15 466 699 ;
-C -1 ; WX 611 ; N uacute ; B 22 -15 589 699 ;
-C -1 ; WX 611 ; N ucircumflex ; B 22 -15 589 695 ;
-C -1 ; WX 722 ; N Aacute ; B -8 0 730 937 ;
-C -1 ; WX 315 ; N igrave ; B 8 0 286 699 ;
-C -1 ; WX 407 ; N Icircumflex ; B 38 0 369 933 ;
-C -1 ; WX 444 ; N ccedilla ; B 34 -215 426 479 ;
-C -1 ; WX 556 ; N adieresis ; B 44 -15 542 645 ;
-C -1 ; WX 722 ; N Ecircumflex ; B 29 0 663 933 ;
-C -1 ; WX 463 ; N scaron ; B 46 -15 417 695 ;
-C -1 ; WX 574 ; N thorn ; B 22 -205 540 737 ;
-C -1 ; WX 1000 ; N trademark ; B 32 318 968 722 ;
-C -1 ; WX 500 ; N egrave ; B 34 -15 466 699 ;
-C -1 ; WX 333 ; N threesuperior ; B 18 273 315 705 ;
-C -1 ; WX 481 ; N zcaron ; B 42 0 439 695 ;
-C -1 ; WX 556 ; N atilde ; B 44 -15 542 655 ;
-C -1 ; WX 556 ; N aring ; B 44 -15 542 732 ;
-C -1 ; WX 500 ; N ocircumflex ; B 34 -15 466 695 ;
-C -1 ; WX 722 ; N Edieresis ; B 29 0 663 883 ;
-C -1 ; WX 834 ; N threequarters ; B 28 -15 795 705 ;
-C -1 ; WX 537 ; N ydieresis ; B 4 -205 533 645 ;
-C -1 ; WX 537 ; N yacute ; B 4 -205 533 699 ;
-C -1 ; WX 315 ; N iacute ; B 18 0 307 699 ;
-C -1 ; WX 722 ; N Acircumflex ; B -8 0 730 933 ;
-C -1 ; WX 815 ; N Uacute ; B 16 -15 799 937 ;
-C -1 ; WX 500 ; N eacute ; B 34 -15 466 699 ;
-C -1 ; WX 778 ; N Ograve ; B 45 -15 733 937 ;
-C -1 ; WX 556 ; N agrave ; B 44 -15 542 699 ;
-C -1 ; WX 815 ; N Udieresis ; B 16 -15 799 883 ;
-C -1 ; WX 556 ; N acircumflex ; B 44 -15 542 695 ;
-C -1 ; WX 407 ; N Igrave ; B 38 0 369 937 ;
-C -1 ; WX 333 ; N twosuperior ; B 14 282 319 705 ;
-C -1 ; WX 815 ; N Ugrave ; B 16 -15 799 937 ;
-C -1 ; WX 834 ; N onequarter ; B 39 -15 795 705 ;
-C -1 ; WX 815 ; N Ucircumflex ; B 16 -15 799 933 ;
-C -1 ; WX 630 ; N Scaron ; B 47 -15 583 933 ;
-C -1 ; WX 407 ; N Idieresis ; B 38 0 369 883 ;
-C -1 ; WX 315 ; N idieresis ; B 7 0 308 645 ;
-C -1 ; WX 722 ; N Egrave ; B 29 0 663 937 ;
-C -1 ; WX 778 ; N Oacute ; B 45 -15 733 937 ;
-C -1 ; WX 606 ; N divide ; B 50 -22 556 528 ;
-C -1 ; WX 722 ; N Atilde ; B -8 0 730 893 ;
-C -1 ; WX 722 ; N Aring ; B -8 0 730 965 ;
-C -1 ; WX 778 ; N Odieresis ; B 45 -15 733 883 ;
-C -1 ; WX 722 ; N Adieresis ; B -8 0 730 883 ;
-C -1 ; WX 815 ; N Ntilde ; B 24 -15 791 893 ;
-C -1 ; WX 611 ; N Zcaron ; B 24 0 576 933 ;
-C -1 ; WX 667 ; N Thorn ; B 29 0 650 722 ;
-C -1 ; WX 407 ; N Iacute ; B 38 0 369 937 ;
-C -1 ; WX 606 ; N plusminus ; B 50 0 556 506 ;
-C -1 ; WX 606 ; N multiply ; B 74 24 532 482 ;
-C -1 ; WX 722 ; N Eacute ; B 29 0 663 937 ;
-C -1 ; WX 704 ; N Ydieresis ; B -11 0 715 883 ;
-C -1 ; WX 333 ; N onesuperior ; B 39 282 294 705 ;
-C -1 ; WX 611 ; N ugrave ; B 22 -15 589 699 ;
-C -1 ; WX 606 ; N logicalnot ; B 50 108 556 389 ;
-C -1 ; WX 611 ; N ntilde ; B 22 0 589 655 ;
-C -1 ; WX 778 ; N Otilde ; B 45 -15 733 893 ;
-C -1 ; WX 500 ; N otilde ; B 34 -15 466 655 ;
-C -1 ; WX 722 ; N Ccedilla ; B 45 -215 668 737 ;
-C -1 ; WX 722 ; N Agrave ; B -8 0 730 937 ;
-C -1 ; WX 834 ; N onehalf ; B 39 -15 820 705 ;
-C -1 ; WX 778 ; N Eth ; B 29 0 733 722 ;
-C -1 ; WX 400 ; N degree ; B 57 419 343 705 ;
-C -1 ; WX 704 ; N Yacute ; B -11 0 715 937 ;
-C -1 ; WX 778 ; N Ocircumflex ; B 45 -15 733 933 ;
-C -1 ; WX 500 ; N oacute ; B 34 -15 466 699 ;
-C -1 ; WX 611 ; N mu ; B 22 -205 589 464 ;
-C -1 ; WX 606 ; N minus ; B 50 217 556 289 ;
-C -1 ; WX 500 ; N eth ; B 34 -15 466 752 ;
-C -1 ; WX 500 ; N odieresis ; B 34 -15 466 645 ;
-C -1 ; WX 737 ; N copyright ; B -8 -15 744 737 ;
-C -1 ; WX 606 ; N brokenbar ; B 267 -175 339 675 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 169
-
-KPX A y -37
-KPX A w -25
-KPX A v -37
-KPX A quoteright -74
-KPX A quotedblright -74
-KPX A Y -75
-KPX A W -50
-KPX A V -75
-KPX A U -30
-KPX A T -18
-
-KPX B period -37
-KPX B comma -37
-KPX B A -18
-
-KPX C period -37
-KPX C comma -37
-KPX C A -18
-
-KPX D period -37
-KPX D comma -37
-KPX D Y -18
-KPX D V -18
-
-KPX F r -10
-KPX F period -125
-KPX F o -55
-KPX F i -10
-KPX F e -55
-KPX F comma -125
-KPX F a -65
-KPX F A -50
-
-KPX G period -37
-KPX G comma -37
-
-KPX J u -25
-KPX J period -74
-KPX J o -25
-KPX J e -25
-KPX J comma -74
-KPX J a -25
-KPX J A -18
-
-KPX K y -25
-KPX K o 10
-KPX K e 10
-
-KPX L y -25
-KPX L quoteright -100
-KPX L quotedblright -100
-KPX L Y -74
-KPX L W -74
-KPX L V -91
-KPX L T -75
-
-KPX N period -55
-KPX N comma -55
-
-KPX O period -37
-KPX O comma -37
-KPX O Y -18
-KPX O V -18
-KPX O T 10
-
-KPX P period -125
-KPX P o -37
-KPX P e -37
-KPX P comma -125
-KPX P a -37
-KPX P A -55
-
-KPX Q period -25
-KPX Q comma -25
-
-KPX S period -37
-KPX S comma -37
-
-KPX T semicolon -37
-KPX T period -125
-KPX T o -55
-KPX T hyphen -100
-KPX T e -55
-KPX T comma -125
-KPX T colon -37
-KPX T a -55
-KPX T O 10
-KPX T A -18
-
-KPX U period -100
-KPX U comma -100
-KPX U A -30
-
-KPX V u -75
-KPX V semicolon -75
-KPX V period -125
-KPX V o -75
-KPX V i -18
-KPX V hyphen -100
-KPX V e -75
-KPX V comma -125
-KPX V colon -75
-KPX V a -85
-KPX V O -18
-KPX V A -74
-
-KPX W y -55
-KPX W u -55
-KPX W semicolon -100
-KPX W period -125
-KPX W o -60
-KPX W i -18
-KPX W hyphen -100
-KPX W e -60
-KPX W comma -125
-KPX W colon -100
-KPX W a -75
-KPX W A -50
-
-KPX Y u -91
-KPX Y semicolon -75
-KPX Y period -100
-KPX Y o -100
-KPX Y i -18
-KPX Y hyphen -125
-KPX Y e -100
-KPX Y comma -100
-KPX Y colon -75
-KPX Y a -100
-KPX Y O -18
-KPX Y A -75
-
-KPX a y -10
-KPX a w -10
-KPX a v -10
-
-KPX b period -18
-KPX b comma -18
-
-KPX c period -18
-KPX c l -7
-KPX c k -7
-KPX c h -7
-KPX c comma -18
-
-KPX colon space -37
-
-KPX comma space -37
-KPX comma quoteright -37
-KPX comma quotedblright -37
-
-KPX e period -18
-KPX e comma -18
-
-KPX f quoteright 100
-KPX f quotedblright 100
-KPX f period -37
-KPX f comma -37
-
-KPX g period -25
-KPX g comma -25
-
-KPX o period -18
-KPX o comma -18
-
-KPX p period -18
-KPX p comma -18
-
-KPX period space -37
-KPX period quoteright -37
-KPX period quotedblright -37
-
-KPX quotedblleft A -74
-
-KPX quotedblright space -37
-
-KPX quoteleft quoteleft -25
-KPX quoteleft A -74
-
-KPX quoteright s -25
-KPX quoteright quoteright -25
-KPX quoteright d -37
-
-KPX r period -100
-KPX r hyphen -37
-KPX r comma -100
-
-KPX s period -25
-KPX s comma -25
-
-KPX semicolon space -37
-
-KPX space quoteleft -37
-KPX space quotedblleft -37
-KPX space Y -37
-KPX space W -37
-KPX space V -37
-KPX space T -37
-KPX space A -37
-
-KPX v period -125
-KPX v comma -125
-
-KPX w period -125
-KPX w comma -125
-KPX w a -18
-
-KPX y period -125
-KPX y comma -125
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 195 238 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 195 238 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 195 238 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 195 238 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 195 243 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 195 238 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 195 238 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 195 238 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 195 238 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 195 238 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 37 238 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 37 238 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 37 238 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 37 238 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 241 238 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 223 238 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 223 238 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 223 238 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 223 238 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 223 238 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 149 238 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 241 238 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 241 238 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 241 238 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 241 238 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 216 238 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 186 238 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 238 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 112 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 112 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 112 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 112 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 112 10 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 112 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 84 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 84 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 84 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 84 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -9 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -9 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -9 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -9 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 139 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 65 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 139 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 139 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 139 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 139 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 102 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 102 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 74 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Palatino-Bold.afm b/blt3.0.1/library/afm/Palatino-Bold.afm
deleted file mode 100644
index de147f7..0000000
--- a/blt3.0.1/library/afm/Palatino-Bold.afm
+++ /dev/null
@@ -1,435 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Mon Jul 2 22:26:30 1990
-Comment UniqueID 31793
-Comment VMusage 36031 46923
-FontName Palatino-Bold
-FullName Palatino Bold
-FamilyName Palatino
-Weight Bold
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -152 -266 1000 924
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.005
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Palatino is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 681
-XHeight 471
-Ascender 720
-Descender -258
-StartCharMetrics 228
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 278 ; N exclam ; B 63 -12 219 688 ;
-C 34 ; WX 402 ; N quotedbl ; B 22 376 380 695 ;
-C 35 ; WX 500 ; N numbersign ; B 4 0 496 673 ;
-C 36 ; WX 500 ; N dollar ; B 28 -114 472 721 ;
-C 37 ; WX 889 ; N percent ; B 61 -9 828 714 ;
-C 38 ; WX 833 ; N ampersand ; B 52 -17 813 684 ;
-C 39 ; WX 278 ; N quoteright ; B 29 405 249 695 ;
-C 40 ; WX 333 ; N parenleft ; B 65 -104 305 723 ;
-C 41 ; WX 333 ; N parenright ; B 28 -104 268 723 ;
-C 42 ; WX 444 ; N asterisk ; B 44 332 399 695 ;
-C 43 ; WX 606 ; N plus ; B 51 0 555 505 ;
-C 44 ; WX 250 ; N comma ; B -6 -166 227 141 ;
-C 45 ; WX 333 ; N hyphen ; B 16 195 317 305 ;
-C 46 ; WX 250 ; N period ; B 47 -12 203 144 ;
-C 47 ; WX 296 ; N slash ; B -9 -17 305 720 ;
-C 48 ; WX 500 ; N zero ; B 33 -17 468 660 ;
-C 49 ; WX 500 ; N one ; B 35 -3 455 670 ;
-C 50 ; WX 500 ; N two ; B 25 -3 472 660 ;
-C 51 ; WX 500 ; N three ; B 22 -17 458 660 ;
-C 52 ; WX 500 ; N four ; B 12 -3 473 672 ;
-C 53 ; WX 500 ; N five ; B 42 -17 472 656 ;
-C 54 ; WX 500 ; N six ; B 37 -17 469 660 ;
-C 55 ; WX 500 ; N seven ; B 46 -3 493 656 ;
-C 56 ; WX 500 ; N eight ; B 34 -17 467 660 ;
-C 57 ; WX 500 ; N nine ; B 31 -17 463 660 ;
-C 58 ; WX 250 ; N colon ; B 47 -12 203 454 ;
-C 59 ; WX 250 ; N semicolon ; B -6 -166 227 454 ;
-C 60 ; WX 606 ; N less ; B 49 -15 558 519 ;
-C 61 ; WX 606 ; N equal ; B 51 114 555 396 ;
-C 62 ; WX 606 ; N greater ; B 49 -15 558 519 ;
-C 63 ; WX 444 ; N question ; B 43 -12 411 687 ;
-C 64 ; WX 747 ; N at ; B 42 -12 704 681 ;
-C 65 ; WX 778 ; N A ; B 24 -3 757 686 ;
-C 66 ; WX 667 ; N B ; B 39 -3 611 681 ;
-C 67 ; WX 722 ; N C ; B 44 -17 695 695 ;
-C 68 ; WX 833 ; N D ; B 35 -3 786 681 ;
-C 69 ; WX 611 ; N E ; B 39 -4 577 681 ;
-C 70 ; WX 556 ; N F ; B 28 -3 539 681 ;
-C 71 ; WX 833 ; N G ; B 47 -17 776 695 ;
-C 72 ; WX 833 ; N H ; B 36 -3 796 681 ;
-C 73 ; WX 389 ; N I ; B 39 -3 350 681 ;
-C 74 ; WX 389 ; N J ; B -11 -213 350 681 ;
-C 75 ; WX 778 ; N K ; B 39 -3 763 681 ;
-C 76 ; WX 611 ; N L ; B 39 -4 577 681 ;
-C 77 ; WX 1000 ; N M ; B 32 -10 968 681 ;
-C 78 ; WX 833 ; N N ; B 35 -16 798 681 ;
-C 79 ; WX 833 ; N O ; B 47 -17 787 695 ;
-C 80 ; WX 611 ; N P ; B 39 -3 594 681 ;
-C 81 ; WX 833 ; N Q ; B 47 -184 787 695 ;
-C 82 ; WX 722 ; N R ; B 39 -3 708 681 ;
-C 83 ; WX 611 ; N S ; B 57 -17 559 695 ;
-C 84 ; WX 667 ; N T ; B 17 -3 650 681 ;
-C 85 ; WX 778 ; N U ; B 26 -17 760 681 ;
-C 86 ; WX 778 ; N V ; B 20 -3 763 681 ;
-C 87 ; WX 1000 ; N W ; B 17 -3 988 686 ;
-C 88 ; WX 667 ; N X ; B 17 -3 650 695 ;
-C 89 ; WX 667 ; N Y ; B 15 -3 660 695 ;
-C 90 ; WX 667 ; N Z ; B 24 -3 627 681 ;
-C 91 ; WX 333 ; N bracketleft ; B 73 -104 291 720 ;
-C 92 ; WX 606 ; N backslash ; B 72 0 534 720 ;
-C 93 ; WX 333 ; N bracketright ; B 42 -104 260 720 ;
-C 94 ; WX 606 ; N asciicircum ; B 52 275 554 678 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 278 ; N quoteleft ; B 29 405 249 695 ;
-C 97 ; WX 500 ; N a ; B 40 -17 478 471 ;
-C 98 ; WX 611 ; N b ; B 10 -17 556 720 ;
-C 99 ; WX 444 ; N c ; B 37 -17 414 471 ;
-C 100 ; WX 611 ; N d ; B 42 -17 577 720 ;
-C 101 ; WX 500 ; N e ; B 42 -17 461 471 ;
-C 102 ; WX 389 ; N f ; B 34 -3 381 720 ; L i fi ; L l fl ;
-C 103 ; WX 556 ; N g ; B 26 -266 535 471 ;
-C 104 ; WX 611 ; N h ; B 24 -3 587 720 ;
-C 105 ; WX 333 ; N i ; B 34 -3 298 706 ;
-C 106 ; WX 333 ; N j ; B 3 -266 241 706 ;
-C 107 ; WX 611 ; N k ; B 21 -3 597 720 ;
-C 108 ; WX 333 ; N l ; B 24 -3 296 720 ;
-C 109 ; WX 889 ; N m ; B 24 -3 864 471 ;
-C 110 ; WX 611 ; N n ; B 24 -3 587 471 ;
-C 111 ; WX 556 ; N o ; B 40 -17 517 471 ;
-C 112 ; WX 611 ; N p ; B 29 -258 567 471 ;
-C 113 ; WX 611 ; N q ; B 52 -258 589 471 ;
-C 114 ; WX 389 ; N r ; B 30 -3 389 471 ;
-C 115 ; WX 444 ; N s ; B 39 -17 405 471 ;
-C 116 ; WX 333 ; N t ; B 22 -17 324 632 ;
-C 117 ; WX 611 ; N u ; B 25 -17 583 471 ;
-C 118 ; WX 556 ; N v ; B 11 -3 545 459 ;
-C 119 ; WX 833 ; N w ; B 13 -3 820 471 ;
-C 120 ; WX 500 ; N x ; B 20 -3 483 471 ;
-C 121 ; WX 556 ; N y ; B 10 -266 546 459 ;
-C 122 ; WX 500 ; N z ; B 16 -3 464 459 ;
-C 123 ; WX 310 ; N braceleft ; B 5 -117 288 725 ;
-C 124 ; WX 606 ; N bar ; B 260 0 346 720 ;
-C 125 ; WX 310 ; N braceright ; B 22 -117 305 725 ;
-C 126 ; WX 606 ; N asciitilde ; B 51 155 555 342 ;
-C 161 ; WX 278 ; N exclamdown ; B 59 -227 215 471 ;
-C 162 ; WX 500 ; N cent ; B 73 -106 450 554 ;
-C 163 ; WX 500 ; N sterling ; B -2 -19 501 676 ;
-C 164 ; WX 167 ; N fraction ; B -152 0 320 660 ;
-C 165 ; WX 500 ; N yen ; B 17 -3 483 695 ;
-C 166 ; WX 500 ; N florin ; B 11 -242 490 703 ;
-C 167 ; WX 500 ; N section ; B 30 -217 471 695 ;
-C 168 ; WX 500 ; N currency ; B 32 96 468 533 ;
-C 169 ; WX 227 ; N quotesingle ; B 45 376 181 695 ;
-C 170 ; WX 500 ; N quotedblleft ; B 34 405 466 695 ;
-C 171 ; WX 500 ; N guillemotleft ; B 36 44 463 438 ;
-C 172 ; WX 389 ; N guilsinglleft ; B 82 44 307 438 ;
-C 173 ; WX 389 ; N guilsinglright ; B 82 44 307 438 ;
-C 174 ; WX 611 ; N fi ; B 10 -3 595 720 ;
-C 175 ; WX 611 ; N fl ; B 17 -3 593 720 ;
-C 177 ; WX 500 ; N endash ; B 0 208 500 291 ;
-C 178 ; WX 500 ; N dagger ; B 29 -6 472 682 ;
-C 179 ; WX 500 ; N daggerdbl ; B 32 -245 468 682 ;
-C 180 ; WX 250 ; N periodcentered ; B 47 179 203 335 ;
-C 182 ; WX 641 ; N paragraph ; B 19 -161 599 683 ;
-C 183 ; WX 606 ; N bullet ; B 131 172 475 516 ;
-C 184 ; WX 333 ; N quotesinglbase ; B 56 -160 276 130 ;
-C 185 ; WX 500 ; N quotedblbase ; B 34 -160 466 130 ;
-C 186 ; WX 500 ; N quotedblright ; B 34 405 466 695 ;
-C 187 ; WX 500 ; N guillemotright ; B 37 44 464 438 ;
-C 188 ; WX 1000 ; N ellipsis ; B 89 -12 911 144 ;
-C 189 ; WX 1000 ; N perthousand ; B 33 -9 982 724 ;
-C 191 ; WX 444 ; N questiondown ; B 33 -231 401 471 ;
-C 193 ; WX 333 ; N grave ; B 18 506 256 691 ;
-C 194 ; WX 333 ; N acute ; B 78 506 316 691 ;
-C 195 ; WX 333 ; N circumflex ; B -2 506 335 681 ;
-C 196 ; WX 333 ; N tilde ; B -16 535 349 661 ;
-C 197 ; WX 333 ; N macron ; B 1 538 332 609 ;
-C 198 ; WX 333 ; N breve ; B 15 506 318 669 ;
-C 199 ; WX 333 ; N dotaccent ; B 100 537 234 671 ;
-C 200 ; WX 333 ; N dieresis ; B -8 537 341 671 ;
-C 202 ; WX 333 ; N ring ; B 67 500 267 700 ;
-C 203 ; WX 333 ; N cedilla ; B 73 -225 300 -7 ;
-C 205 ; WX 333 ; N hungarumlaut ; B -56 506 390 691 ;
-C 206 ; WX 333 ; N ogonek ; B 60 -246 274 -17 ;
-C 207 ; WX 333 ; N caron ; B -2 510 335 685 ;
-C 208 ; WX 1000 ; N emdash ; B 0 208 1000 291 ;
-C 225 ; WX 1000 ; N AE ; B 12 -4 954 681 ;
-C 227 ; WX 438 ; N ordfeminine ; B 77 367 361 660 ;
-C 232 ; WX 611 ; N Lslash ; B 16 -4 577 681 ;
-C 233 ; WX 833 ; N Oslash ; B 32 -20 808 698 ;
-C 234 ; WX 1000 ; N OE ; B 43 -17 985 695 ;
-C 235 ; WX 488 ; N ordmasculine ; B 89 367 399 660 ;
-C 241 ; WX 778 ; N ae ; B 46 -17 731 471 ;
-C 245 ; WX 333 ; N dotlessi ; B 34 -3 298 471 ;
-C 248 ; WX 333 ; N lslash ; B -4 -3 334 720 ;
-C 249 ; WX 556 ; N oslash ; B 23 -18 534 471 ;
-C 250 ; WX 833 ; N oe ; B 48 -17 799 471 ;
-C 251 ; WX 611 ; N germandbls ; B 30 -17 565 720 ;
-C -1 ; WX 667 ; N Zcaron ; B 24 -3 627 909 ;
-C -1 ; WX 444 ; N ccedilla ; B 37 -225 414 471 ;
-C -1 ; WX 556 ; N ydieresis ; B 10 -266 546 691 ;
-C -1 ; WX 500 ; N atilde ; B 40 -17 478 673 ;
-C -1 ; WX 333 ; N icircumflex ; B -2 -3 335 701 ;
-C -1 ; WX 300 ; N threesuperior ; B 9 261 292 667 ;
-C -1 ; WX 500 ; N ecircumflex ; B 42 -17 461 701 ;
-C -1 ; WX 611 ; N thorn ; B 17 -258 563 720 ;
-C -1 ; WX 500 ; N egrave ; B 42 -17 461 711 ;
-C -1 ; WX 300 ; N twosuperior ; B 5 261 295 660 ;
-C -1 ; WX 500 ; N eacute ; B 42 -17 461 711 ;
-C -1 ; WX 556 ; N otilde ; B 40 -17 517 673 ;
-C -1 ; WX 778 ; N Aacute ; B 24 -3 757 915 ;
-C -1 ; WX 556 ; N ocircumflex ; B 40 -17 517 701 ;
-C -1 ; WX 556 ; N yacute ; B 10 -266 546 711 ;
-C -1 ; WX 611 ; N udieresis ; B 25 -17 583 691 ;
-C -1 ; WX 750 ; N threequarters ; B 15 -2 735 667 ;
-C -1 ; WX 500 ; N acircumflex ; B 40 -17 478 701 ;
-C -1 ; WX 833 ; N Eth ; B 10 -3 786 681 ;
-C -1 ; WX 500 ; N edieresis ; B 42 -17 461 691 ;
-C -1 ; WX 611 ; N ugrave ; B 25 -17 583 711 ;
-C -1 ; WX 998 ; N trademark ; B 38 274 961 678 ;
-C -1 ; WX 556 ; N ograve ; B 40 -17 517 711 ;
-C -1 ; WX 444 ; N scaron ; B 39 -17 405 693 ;
-C -1 ; WX 389 ; N Idieresis ; B 20 -3 369 895 ;
-C -1 ; WX 611 ; N uacute ; B 25 -17 583 711 ;
-C -1 ; WX 500 ; N agrave ; B 40 -17 478 711 ;
-C -1 ; WX 611 ; N ntilde ; B 24 -3 587 673 ;
-C -1 ; WX 500 ; N aring ; B 40 -17 478 700 ;
-C -1 ; WX 500 ; N zcaron ; B 16 -3 464 693 ;
-C -1 ; WX 389 ; N Icircumflex ; B 26 -3 363 905 ;
-C -1 ; WX 833 ; N Ntilde ; B 35 -16 798 885 ;
-C -1 ; WX 611 ; N ucircumflex ; B 25 -17 583 701 ;
-C -1 ; WX 611 ; N Ecircumflex ; B 39 -4 577 905 ;
-C -1 ; WX 389 ; N Iacute ; B 39 -3 350 915 ;
-C -1 ; WX 722 ; N Ccedilla ; B 44 -225 695 695 ;
-C -1 ; WX 833 ; N Odieresis ; B 47 -17 787 895 ;
-C -1 ; WX 611 ; N Scaron ; B 57 -17 559 909 ;
-C -1 ; WX 611 ; N Edieresis ; B 39 -4 577 895 ;
-C -1 ; WX 389 ; N Igrave ; B 39 -3 350 915 ;
-C -1 ; WX 500 ; N adieresis ; B 40 -17 478 691 ;
-C -1 ; WX 833 ; N Ograve ; B 47 -17 787 915 ;
-C -1 ; WX 611 ; N Egrave ; B 39 -4 577 915 ;
-C -1 ; WX 667 ; N Ydieresis ; B 15 -3 660 895 ;
-C -1 ; WX 747 ; N registered ; B 26 -17 720 695 ;
-C -1 ; WX 833 ; N Otilde ; B 47 -17 787 885 ;
-C -1 ; WX 750 ; N onequarter ; B 19 -2 735 665 ;
-C -1 ; WX 778 ; N Ugrave ; B 26 -17 760 915 ;
-C -1 ; WX 778 ; N Ucircumflex ; B 26 -17 760 905 ;
-C -1 ; WX 611 ; N Thorn ; B 39 -3 574 681 ;
-C -1 ; WX 606 ; N divide ; B 51 0 555 510 ;
-C -1 ; WX 778 ; N Atilde ; B 24 -3 757 885 ;
-C -1 ; WX 778 ; N Uacute ; B 26 -17 760 915 ;
-C -1 ; WX 833 ; N Ocircumflex ; B 47 -17 787 905 ;
-C -1 ; WX 606 ; N logicalnot ; B 51 114 555 396 ;
-C -1 ; WX 778 ; N Aring ; B 24 -3 757 924 ;
-C -1 ; WX 333 ; N idieresis ; B -8 -3 341 691 ;
-C -1 ; WX 333 ; N iacute ; B 34 -3 316 711 ;
-C -1 ; WX 500 ; N aacute ; B 40 -17 478 711 ;
-C -1 ; WX 606 ; N plusminus ; B 51 0 555 505 ;
-C -1 ; WX 606 ; N multiply ; B 72 21 534 483 ;
-C -1 ; WX 778 ; N Udieresis ; B 26 -17 760 895 ;
-C -1 ; WX 606 ; N minus ; B 51 212 555 298 ;
-C -1 ; WX 300 ; N onesuperior ; B 14 261 287 665 ;
-C -1 ; WX 611 ; N Eacute ; B 39 -4 577 915 ;
-C -1 ; WX 778 ; N Acircumflex ; B 24 -3 757 905 ;
-C -1 ; WX 747 ; N copyright ; B 26 -17 720 695 ;
-C -1 ; WX 778 ; N Agrave ; B 24 -3 757 915 ;
-C -1 ; WX 556 ; N odieresis ; B 40 -17 517 691 ;
-C -1 ; WX 556 ; N oacute ; B 40 -17 517 711 ;
-C -1 ; WX 400 ; N degree ; B 50 360 350 660 ;
-C -1 ; WX 333 ; N igrave ; B 18 -3 298 711 ;
-C -1 ; WX 611 ; N mu ; B 25 -225 583 471 ;
-C -1 ; WX 833 ; N Oacute ; B 47 -17 787 915 ;
-C -1 ; WX 556 ; N eth ; B 40 -17 517 720 ;
-C -1 ; WX 778 ; N Adieresis ; B 24 -3 757 895 ;
-C -1 ; WX 667 ; N Yacute ; B 15 -3 660 915 ;
-C -1 ; WX 606 ; N brokenbar ; B 260 0 346 720 ;
-C -1 ; WX 750 ; N onehalf ; B 9 -2 745 665 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 101
-
-KPX A y -70
-KPX A w -70
-KPX A v -70
-KPX A space -18
-KPX A quoteright -92
-KPX A Y -111
-KPX A W -90
-KPX A V -129
-KPX A T -92
-
-KPX F period -111
-KPX F comma -111
-KPX F A -55
-
-KPX L y -74
-KPX L space -18
-KPX L quoteright -74
-KPX L Y -92
-KPX L W -92
-KPX L V -92
-KPX L T -74
-
-KPX P period -129
-KPX P comma -129
-KPX P A -74
-
-KPX R y -30
-KPX R Y -55
-KPX R W -37
-KPX R V -74
-KPX R T -55
-
-KPX T y -90
-KPX T w -90
-KPX T u -129
-KPX T semicolon -74
-KPX T s -111
-KPX T r -111
-KPX T period -92
-KPX T o -111
-KPX T i -55
-KPX T hyphen -92
-KPX T e -111
-KPX T comma -92
-KPX T colon -74
-KPX T c -129
-KPX T a -111
-KPX T A -92
-
-KPX V y -90
-KPX V u -92
-KPX V semicolon -74
-KPX V r -111
-KPX V period -129
-KPX V o -111
-KPX V i -55
-KPX V hyphen -92
-KPX V e -111
-KPX V comma -129
-KPX V colon -74
-KPX V a -111
-KPX V A -129
-
-KPX W y -74
-KPX W u -74
-KPX W semicolon -37
-KPX W r -74
-KPX W period -37
-KPX W o -74
-KPX W i -37
-KPX W hyphen -37
-KPX W e -74
-KPX W comma -92
-KPX W colon -37
-KPX W a -74
-KPX W A -90
-
-KPX Y v -74
-KPX Y u -74
-KPX Y semicolon -55
-KPX Y q -92
-KPX Y period -74
-KPX Y p -74
-KPX Y o -74
-KPX Y i -55
-KPX Y hyphen -74
-KPX Y e -74
-KPX Y comma -74
-KPX Y colon -55
-KPX Y a -74
-KPX Y A -55
-
-KPX f quoteright 37
-KPX f f -18
-
-KPX one one -37
-
-KPX quoteleft quoteleft -55
-
-KPX quoteright t -18
-KPX quoteright space -55
-KPX quoteright s -55
-KPX quoteright quoteright -55
-
-KPX r quoteright 55
-KPX r period -55
-KPX r hyphen -18
-KPX r comma -55
-
-KPX v period -111
-KPX v comma -111
-
-KPX w period -92
-KPX w comma -92
-
-KPX y period -92
-KPX y comma -92
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 223 224 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 211 224 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 223 224 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 215 224 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 223 224 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 223 224 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 195 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 139 224 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 139 224 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 139 224 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 139 224 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 28 224 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 28 224 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 28 224 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 28 224 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 250 224 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 250 224 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 250 224 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 250 224 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 250 224 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 250 224 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 139 224 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 235 224 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 235 224 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 235 224 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 223 224 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 211 224 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 199 224 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 167 224 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 84 20 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 84 20 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 84 20 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 84 20 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 84 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 84 12 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 56 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 84 20 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 96 20 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 92 20 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 84 20 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 20 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex 0 20 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis 0 20 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 0 20 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 139 12 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 112 20 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 112 20 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 112 20 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 112 20 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 112 12 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 56 8 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 151 20 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 139 20 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 139 20 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 131 20 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 144 20 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 124 20 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 84 8 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Palatino-BoldItalic.afm b/blt3.0.1/library/afm/Palatino-BoldItalic.afm
deleted file mode 100644
index 44c7b2c..0000000
--- a/blt3.0.1/library/afm/Palatino-BoldItalic.afm
+++ /dev/null
@@ -1,442 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Mon Jul 2 22:48:39 1990
-Comment UniqueID 31799
-Comment VMusage 37656 48548
-FontName Palatino-BoldItalic
-FullName Palatino Bold Italic
-FamilyName Palatino
-Weight Bold
-ItalicAngle -10
-IsFixedPitch false
-FontBBox -170 -271 1073 926
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.005
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Palatino is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 681
-XHeight 469
-Ascender 726
-Descender -271
-StartCharMetrics 228
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 58 -17 322 695 ;
-C 34 ; WX 500 ; N quotedbl ; B 137 467 493 720 ;
-C 35 ; WX 500 ; N numbersign ; B 4 0 496 673 ;
-C 36 ; WX 500 ; N dollar ; B 20 -108 477 737 ;
-C 37 ; WX 889 ; N percent ; B 56 -17 790 697 ;
-C 38 ; WX 833 ; N ampersand ; B 74 -17 811 695 ;
-C 39 ; WX 278 ; N quoteright ; B 76 431 302 720 ;
-C 40 ; WX 333 ; N parenleft ; B 58 -129 368 723 ;
-C 41 ; WX 333 ; N parenright ; B -12 -129 298 723 ;
-C 42 ; WX 444 ; N asterisk ; B 84 332 439 695 ;
-C 43 ; WX 606 ; N plus ; B 50 -5 556 501 ;
-C 44 ; WX 250 ; N comma ; B -33 -164 208 147 ;
-C 45 ; WX 389 ; N hyphen ; B 37 198 362 300 ;
-C 46 ; WX 250 ; N period ; B 48 -17 187 135 ;
-C 47 ; WX 315 ; N slash ; B 1 -17 315 720 ;
-C 48 ; WX 500 ; N zero ; B 42 -17 490 683 ;
-C 49 ; WX 500 ; N one ; B 41 -3 434 678 ;
-C 50 ; WX 500 ; N two ; B 1 -3 454 683 ;
-C 51 ; WX 500 ; N three ; B 8 -17 450 683 ;
-C 52 ; WX 500 ; N four ; B 3 -3 487 683 ;
-C 53 ; WX 500 ; N five ; B 14 -17 481 675 ;
-C 54 ; WX 500 ; N six ; B 39 -17 488 683 ;
-C 55 ; WX 500 ; N seven ; B 69 -3 544 674 ;
-C 56 ; WX 500 ; N eight ; B 26 -17 484 683 ;
-C 57 ; WX 500 ; N nine ; B 27 -17 491 683 ;
-C 58 ; WX 250 ; N colon ; B 38 -17 236 452 ;
-C 59 ; WX 250 ; N semicolon ; B -33 -164 247 452 ;
-C 60 ; WX 606 ; N less ; B 49 -21 558 517 ;
-C 61 ; WX 606 ; N equal ; B 51 106 555 390 ;
-C 62 ; WX 606 ; N greater ; B 48 -21 557 517 ;
-C 63 ; WX 444 ; N question ; B 91 -17 450 695 ;
-C 64 ; WX 833 ; N at ; B 82 -12 744 681 ;
-C 65 ; WX 722 ; N A ; B -35 -3 685 683 ;
-C 66 ; WX 667 ; N B ; B 8 -3 629 681 ;
-C 67 ; WX 685 ; N C ; B 69 -17 695 695 ;
-C 68 ; WX 778 ; N D ; B 0 -3 747 682 ;
-C 69 ; WX 611 ; N E ; B 11 -3 606 681 ;
-C 70 ; WX 556 ; N F ; B -6 -3 593 681 ;
-C 71 ; WX 778 ; N G ; B 72 -17 750 695 ;
-C 72 ; WX 778 ; N H ; B -12 -3 826 681 ;
-C 73 ; WX 389 ; N I ; B -1 -3 412 681 ;
-C 74 ; WX 389 ; N J ; B -29 -207 417 681 ;
-C 75 ; WX 722 ; N K ; B -10 -3 746 681 ;
-C 76 ; WX 611 ; N L ; B 26 -3 578 681 ;
-C 77 ; WX 944 ; N M ; B -23 -17 985 681 ;
-C 78 ; WX 778 ; N N ; B -2 -3 829 681 ;
-C 79 ; WX 833 ; N O ; B 76 -17 794 695 ;
-C 80 ; WX 667 ; N P ; B 11 -3 673 681 ;
-C 81 ; WX 833 ; N Q ; B 76 -222 794 695 ;
-C 82 ; WX 722 ; N R ; B 4 -3 697 681 ;
-C 83 ; WX 556 ; N S ; B 50 -17 517 695 ;
-C 84 ; WX 611 ; N T ; B 56 -3 674 681 ;
-C 85 ; WX 778 ; N U ; B 83 -17 825 681 ;
-C 86 ; WX 667 ; N V ; B 67 -3 745 681 ;
-C 87 ; WX 1000 ; N W ; B 67 -3 1073 689 ;
-C 88 ; WX 722 ; N X ; B -9 -3 772 681 ;
-C 89 ; WX 611 ; N Y ; B 54 -3 675 695 ;
-C 90 ; WX 667 ; N Z ; B 1 -3 676 681 ;
-C 91 ; WX 333 ; N bracketleft ; B 45 -102 381 723 ;
-C 92 ; WX 606 ; N backslash ; B 72 0 534 720 ;
-C 93 ; WX 333 ; N bracketright ; B -21 -102 315 723 ;
-C 94 ; WX 606 ; N asciicircum ; B 63 275 543 678 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 278 ; N quoteleft ; B 65 431 291 720 ;
-C 97 ; WX 556 ; N a ; B 44 -17 519 470 ;
-C 98 ; WX 537 ; N b ; B 44 -17 494 726 ;
-C 99 ; WX 444 ; N c ; B 32 -17 436 469 ;
-C 100 ; WX 556 ; N d ; B 38 -17 550 726 ;
-C 101 ; WX 444 ; N e ; B 28 -17 418 469 ;
-C 102 ; WX 333 ; N f ; B -130 -271 449 726 ; L i fi ; L l fl ;
-C 103 ; WX 500 ; N g ; B -50 -271 529 469 ;
-C 104 ; WX 556 ; N h ; B 22 -17 522 726 ;
-C 105 ; WX 333 ; N i ; B 26 -17 312 695 ;
-C 106 ; WX 333 ; N j ; B -64 -271 323 695 ;
-C 107 ; WX 556 ; N k ; B 34 -17 528 726 ;
-C 108 ; WX 333 ; N l ; B 64 -17 318 726 ;
-C 109 ; WX 833 ; N m ; B 19 -17 803 469 ;
-C 110 ; WX 556 ; N n ; B 17 -17 521 469 ;
-C 111 ; WX 556 ; N o ; B 48 -17 502 469 ;
-C 112 ; WX 556 ; N p ; B -21 -271 516 469 ;
-C 113 ; WX 537 ; N q ; B 32 -271 513 469 ;
-C 114 ; WX 389 ; N r ; B 20 -17 411 469 ;
-C 115 ; WX 444 ; N s ; B 25 -17 406 469 ;
-C 116 ; WX 389 ; N t ; B 42 -17 409 636 ;
-C 117 ; WX 556 ; N u ; B 22 -17 521 469 ;
-C 118 ; WX 556 ; N v ; B 19 -17 513 469 ;
-C 119 ; WX 833 ; N w ; B 27 -17 802 469 ;
-C 120 ; WX 500 ; N x ; B -8 -17 500 469 ;
-C 121 ; WX 556 ; N y ; B 13 -271 541 469 ;
-C 122 ; WX 500 ; N z ; B 31 -17 470 469 ;
-C 123 ; WX 333 ; N braceleft ; B 18 -105 334 720 ;
-C 124 ; WX 606 ; N bar ; B 259 0 347 720 ;
-C 125 ; WX 333 ; N braceright ; B -1 -105 315 720 ;
-C 126 ; WX 606 ; N asciitilde ; B 51 151 555 346 ;
-C 161 ; WX 333 ; N exclamdown ; B 2 -225 259 479 ;
-C 162 ; WX 500 ; N cent ; B 52 -105 456 547 ;
-C 163 ; WX 500 ; N sterling ; B 21 -5 501 683 ;
-C 164 ; WX 167 ; N fraction ; B -170 0 338 683 ;
-C 165 ; WX 500 ; N yen ; B 11 -3 538 695 ;
-C 166 ; WX 500 ; N florin ; B 8 -242 479 690 ;
-C 167 ; WX 556 ; N section ; B 47 -151 497 695 ;
-C 168 ; WX 500 ; N currency ; B 32 96 468 533 ;
-C 169 ; WX 250 ; N quotesingle ; B 127 467 293 720 ;
-C 170 ; WX 500 ; N quotedblleft ; B 65 431 511 720 ;
-C 171 ; WX 500 ; N guillemotleft ; B 35 43 458 446 ;
-C 172 ; WX 333 ; N guilsinglleft ; B 60 43 292 446 ;
-C 173 ; WX 333 ; N guilsinglright ; B 35 40 267 443 ;
-C 174 ; WX 611 ; N fi ; B -130 -271 588 726 ;
-C 175 ; WX 611 ; N fl ; B -130 -271 631 726 ;
-C 177 ; WX 500 ; N endash ; B -12 214 512 282 ;
-C 178 ; WX 556 ; N dagger ; B 67 -3 499 685 ;
-C 179 ; WX 556 ; N daggerdbl ; B 33 -153 537 693 ;
-C 180 ; WX 250 ; N periodcentered ; B 67 172 206 324 ;
-C 182 ; WX 556 ; N paragraph ; B 14 -204 629 681 ;
-C 183 ; WX 606 ; N bullet ; B 131 172 475 516 ;
-C 184 ; WX 250 ; N quotesinglbase ; B -3 -144 220 145 ;
-C 185 ; WX 500 ; N quotedblbase ; B -18 -144 424 145 ;
-C 186 ; WX 500 ; N quotedblright ; B 73 431 519 720 ;
-C 187 ; WX 500 ; N guillemotright ; B 35 40 458 443 ;
-C 188 ; WX 1000 ; N ellipsis ; B 91 -17 896 135 ;
-C 189 ; WX 1000 ; N perthousand ; B 65 -17 912 691 ;
-C 191 ; WX 444 ; N questiondown ; B -12 -226 347 479 ;
-C 193 ; WX 333 ; N grave ; B 110 518 322 699 ;
-C 194 ; WX 333 ; N acute ; B 153 518 392 699 ;
-C 195 ; WX 333 ; N circumflex ; B 88 510 415 684 ;
-C 196 ; WX 333 ; N tilde ; B 82 535 441 654 ;
-C 197 ; WX 333 ; N macron ; B 76 538 418 608 ;
-C 198 ; WX 333 ; N breve ; B 96 518 412 680 ;
-C 199 ; WX 333 ; N dotaccent ; B 202 537 325 668 ;
-C 200 ; WX 333 ; N dieresis ; B 90 537 426 668 ;
-C 202 ; WX 556 ; N ring ; B 277 514 477 714 ;
-C 203 ; WX 333 ; N cedilla ; B 12 -218 248 5 ;
-C 205 ; WX 333 ; N hungarumlaut ; B -28 518 409 699 ;
-C 206 ; WX 333 ; N ogonek ; B 32 -206 238 -17 ;
-C 207 ; WX 333 ; N caron ; B 113 510 445 684 ;
-C 208 ; WX 1000 ; N emdash ; B -12 214 1012 282 ;
-C 225 ; WX 944 ; N AE ; B -29 -3 927 681 ;
-C 227 ; WX 333 ; N ordfeminine ; B 47 391 355 684 ;
-C 232 ; WX 611 ; N Lslash ; B 6 -3 578 681 ;
-C 233 ; WX 833 ; N Oslash ; B 57 -54 797 730 ;
-C 234 ; WX 944 ; N OE ; B 39 -17 961 695 ;
-C 235 ; WX 333 ; N ordmasculine ; B 51 391 346 683 ;
-C 241 ; WX 738 ; N ae ; B 44 -17 711 469 ;
-C 245 ; WX 333 ; N dotlessi ; B 26 -17 293 469 ;
-C 248 ; WX 333 ; N lslash ; B 13 -17 365 726 ;
-C 249 ; WX 556 ; N oslash ; B 14 -50 522 506 ;
-C 250 ; WX 778 ; N oe ; B 48 -17 755 469 ;
-C 251 ; WX 556 ; N germandbls ; B -131 -271 549 726 ;
-C -1 ; WX 667 ; N Zcaron ; B 1 -3 676 896 ;
-C -1 ; WX 444 ; N ccedilla ; B 32 -218 436 469 ;
-C -1 ; WX 556 ; N ydieresis ; B 13 -271 541 688 ;
-C -1 ; WX 556 ; N atilde ; B 44 -17 553 666 ;
-C -1 ; WX 333 ; N icircumflex ; B 26 -17 403 704 ;
-C -1 ; WX 300 ; N threesuperior ; B 23 263 310 683 ;
-C -1 ; WX 444 ; N ecircumflex ; B 28 -17 471 704 ;
-C -1 ; WX 556 ; N thorn ; B -21 -271 516 726 ;
-C -1 ; WX 444 ; N egrave ; B 28 -17 418 719 ;
-C -1 ; WX 300 ; N twosuperior ; B 26 271 321 683 ;
-C -1 ; WX 444 ; N eacute ; B 28 -17 448 719 ;
-C -1 ; WX 556 ; N otilde ; B 48 -17 553 666 ;
-C -1 ; WX 722 ; N Aacute ; B -35 -3 685 911 ;
-C -1 ; WX 556 ; N ocircumflex ; B 48 -17 515 704 ;
-C -1 ; WX 556 ; N yacute ; B 13 -271 541 719 ;
-C -1 ; WX 556 ; N udieresis ; B 22 -17 538 688 ;
-C -1 ; WX 750 ; N threequarters ; B 18 -2 732 683 ;
-C -1 ; WX 556 ; N acircumflex ; B 44 -17 527 704 ;
-C -1 ; WX 778 ; N Eth ; B 0 -3 747 682 ;
-C -1 ; WX 444 ; N edieresis ; B 28 -17 482 688 ;
-C -1 ; WX 556 ; N ugrave ; B 22 -17 521 719 ;
-C -1 ; WX 1000 ; N trademark ; B 38 274 961 678 ;
-C -1 ; WX 556 ; N ograve ; B 48 -17 502 719 ;
-C -1 ; WX 444 ; N scaron ; B 25 -17 489 692 ;
-C -1 ; WX 389 ; N Idieresis ; B -1 -3 454 880 ;
-C -1 ; WX 556 ; N uacute ; B 22 -17 521 719 ;
-C -1 ; WX 556 ; N agrave ; B 44 -17 519 719 ;
-C -1 ; WX 556 ; N ntilde ; B 17 -17 553 666 ;
-C -1 ; WX 556 ; N aring ; B 44 -17 519 714 ;
-C -1 ; WX 500 ; N zcaron ; B 31 -17 517 692 ;
-C -1 ; WX 389 ; N Icircumflex ; B -1 -3 443 896 ;
-C -1 ; WX 778 ; N Ntilde ; B -2 -3 829 866 ;
-C -1 ; WX 556 ; N ucircumflex ; B 22 -17 521 704 ;
-C -1 ; WX 611 ; N Ecircumflex ; B 11 -3 606 896 ;
-C -1 ; WX 389 ; N Iacute ; B -1 -3 420 911 ;
-C -1 ; WX 685 ; N Ccedilla ; B 69 -218 695 695 ;
-C -1 ; WX 833 ; N Odieresis ; B 76 -17 794 880 ;
-C -1 ; WX 556 ; N Scaron ; B 50 -17 557 896 ;
-C -1 ; WX 611 ; N Edieresis ; B 11 -3 606 880 ;
-C -1 ; WX 389 ; N Igrave ; B -1 -3 412 911 ;
-C -1 ; WX 556 ; N adieresis ; B 44 -17 538 688 ;
-C -1 ; WX 833 ; N Ograve ; B 76 -17 794 911 ;
-C -1 ; WX 611 ; N Egrave ; B 11 -3 606 911 ;
-C -1 ; WX 611 ; N Ydieresis ; B 54 -3 675 880 ;
-C -1 ; WX 747 ; N registered ; B 26 -17 720 695 ;
-C -1 ; WX 833 ; N Otilde ; B 76 -17 794 866 ;
-C -1 ; WX 750 ; N onequarter ; B 18 -2 732 683 ;
-C -1 ; WX 778 ; N Ugrave ; B 83 -17 825 911 ;
-C -1 ; WX 778 ; N Ucircumflex ; B 83 -17 825 896 ;
-C -1 ; WX 667 ; N Thorn ; B 11 -3 644 681 ;
-C -1 ; WX 606 ; N divide ; B 50 -5 556 501 ;
-C -1 ; WX 722 ; N Atilde ; B -35 -3 685 866 ;
-C -1 ; WX 778 ; N Uacute ; B 83 -17 825 911 ;
-C -1 ; WX 833 ; N Ocircumflex ; B 76 -17 794 896 ;
-C -1 ; WX 606 ; N logicalnot ; B 51 107 555 390 ;
-C -1 ; WX 722 ; N Aring ; B -35 -3 685 926 ;
-C -1 ; WX 333 ; N idieresis ; B 26 -17 426 688 ;
-C -1 ; WX 333 ; N iacute ; B 26 -17 392 719 ;
-C -1 ; WX 556 ; N aacute ; B 44 -17 519 719 ;
-C -1 ; WX 606 ; N plusminus ; B 50 0 556 501 ;
-C -1 ; WX 606 ; N multiply ; B 72 17 534 479 ;
-C -1 ; WX 778 ; N Udieresis ; B 83 -17 825 880 ;
-C -1 ; WX 606 ; N minus ; B 51 204 555 292 ;
-C -1 ; WX 300 ; N onesuperior ; B 41 271 298 680 ;
-C -1 ; WX 611 ; N Eacute ; B 11 -3 606 911 ;
-C -1 ; WX 722 ; N Acircumflex ; B -35 -3 685 896 ;
-C -1 ; WX 747 ; N copyright ; B 26 -17 720 695 ;
-C -1 ; WX 722 ; N Agrave ; B -35 -3 685 911 ;
-C -1 ; WX 556 ; N odieresis ; B 48 -17 538 688 ;
-C -1 ; WX 556 ; N oacute ; B 48 -17 504 719 ;
-C -1 ; WX 400 ; N degree ; B 50 383 350 683 ;
-C -1 ; WX 333 ; N igrave ; B 26 -17 322 719 ;
-C -1 ; WX 556 ; N mu ; B -15 -232 521 469 ;
-C -1 ; WX 833 ; N Oacute ; B 76 -17 794 911 ;
-C -1 ; WX 556 ; N eth ; B 48 -17 546 726 ;
-C -1 ; WX 722 ; N Adieresis ; B -35 -3 685 880 ;
-C -1 ; WX 611 ; N Yacute ; B 54 -3 675 911 ;
-C -1 ; WX 606 ; N brokenbar ; B 259 0 347 720 ;
-C -1 ; WX 750 ; N onehalf ; B 14 -2 736 683 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 108
-
-KPX A y -55
-KPX A w -37
-KPX A v -55
-KPX A space -55
-KPX A quoteright -55
-KPX A Y -74
-KPX A W -74
-KPX A V -74
-KPX A T -55
-
-KPX F space -18
-KPX F period -111
-KPX F comma -111
-KPX F A -74
-
-KPX L y -37
-KPX L space -18
-KPX L quoteright -55
-KPX L Y -74
-KPX L W -74
-KPX L V -74
-KPX L T -74
-
-KPX P space -55
-KPX P period -129
-KPX P comma -129
-KPX P A -92
-
-KPX R y -20
-KPX R Y -37
-KPX R W -55
-KPX R V -55
-KPX R T -37
-
-KPX T y -80
-KPX T w -50
-KPX T u -92
-KPX T semicolon -55
-KPX T s -92
-KPX T r -92
-KPX T period -55
-KPX T o -111
-KPX T i -74
-KPX T hyphen -92
-KPX T e -111
-KPX T comma -55
-KPX T colon -55
-KPX T c -92
-KPX T a -111
-KPX T O -18
-KPX T A -55
-
-KPX V y -50
-KPX V u -50
-KPX V semicolon -37
-KPX V r -74
-KPX V period -111
-KPX V o -74
-KPX V i -50
-KPX V hyphen -37
-KPX V e -74
-KPX V comma -111
-KPX V colon -37
-KPX V a -92
-KPX V A -74
-
-KPX W y -30
-KPX W u -30
-KPX W semicolon -18
-KPX W r -30
-KPX W period -55
-KPX W o -55
-KPX W i -30
-KPX W e -55
-KPX W comma -55
-KPX W colon -28
-KPX W a -74
-KPX W A -74
-
-KPX Y v -30
-KPX Y u -50
-KPX Y semicolon -55
-KPX Y q -92
-KPX Y period -55
-KPX Y p -74
-KPX Y o -111
-KPX Y i -54
-KPX Y hyphen -55
-KPX Y e -92
-KPX Y comma -55
-KPX Y colon -55
-KPX Y a -111
-KPX Y A -55
-
-KPX f quoteright 37
-KPX f f -37
-
-KPX one one -55
-
-KPX quoteleft quoteleft -55
-
-KPX quoteright t -18
-KPX quoteright space -37
-KPX quoteright s -37
-KPX quoteright quoteright -55
-
-KPX r quoteright 55
-KPX r q -18
-KPX r period -55
-KPX r o -18
-KPX r h -18
-KPX r g -18
-KPX r e -18
-KPX r comma -55
-KPX r c -18
-
-KPX v period -55
-KPX v comma -55
-
-KPX w period -55
-KPX w comma -55
-
-KPX y period -37
-KPX y comma -37
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 195 212 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 195 212 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 195 212 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 195 212 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 83 212 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 195 212 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 176 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 139 212 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 139 212 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 139 212 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 139 212 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 28 212 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 28 212 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 28 212 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 28 212 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 223 212 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 250 212 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 250 212 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 250 212 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 250 212 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 250 212 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 112 212 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 223 212 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 223 212 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 223 212 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 211 212 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 151 212 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 139 212 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 167 212 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 112 20 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 112 20 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 112 20 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 112 20 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 0 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 112 12 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 56 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 56 20 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 56 20 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 56 20 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 56 20 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 20 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -12 20 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis 0 20 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 0 20 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 112 12 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 112 20 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 100 20 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 112 20 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 112 20 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 112 12 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 44 8 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 112 20 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 100 20 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 112 20 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 112 20 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 112 20 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 112 20 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 72 8 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Palatino-Italic.afm b/blt3.0.1/library/afm/Palatino-Italic.afm
deleted file mode 100644
index 46c2eb5..0000000
--- a/blt3.0.1/library/afm/Palatino-Italic.afm
+++ /dev/null
@@ -1,440 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Mon Jul 2 22:37:33 1990
-Comment UniqueID 31796
-Comment VMusage 37415 48307
-FontName Palatino-Italic
-FullName Palatino Italic
-FamilyName Palatino
-Weight Medium
-ItalicAngle -10
-IsFixedPitch false
-FontBBox -170 -276 1010 918
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.005
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Palatino is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 692
-XHeight 482
-Ascender 733
-Descender -276
-StartCharMetrics 228
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 76 -8 292 733 ;
-C 34 ; WX 500 ; N quotedbl ; B 140 508 455 733 ;
-C 35 ; WX 500 ; N numbersign ; B 4 0 495 692 ;
-C 36 ; WX 500 ; N dollar ; B 15 -113 452 733 ;
-C 37 ; WX 889 ; N percent ; B 74 -7 809 710 ;
-C 38 ; WX 778 ; N ampersand ; B 47 -18 766 692 ;
-C 39 ; WX 278 ; N quoteright ; B 78 488 258 733 ;
-C 40 ; WX 333 ; N parenleft ; B 54 -106 331 733 ;
-C 41 ; WX 333 ; N parenright ; B 2 -106 279 733 ;
-C 42 ; WX 389 ; N asterisk ; B 76 368 400 706 ;
-C 43 ; WX 606 ; N plus ; B 51 0 555 504 ;
-C 44 ; WX 250 ; N comma ; B 8 -143 203 123 ;
-C 45 ; WX 333 ; N hyphen ; B 19 223 304 281 ;
-C 46 ; WX 250 ; N period ; B 53 -5 158 112 ;
-C 47 ; WX 296 ; N slash ; B -40 -119 392 733 ;
-C 48 ; WX 500 ; N zero ; B 36 -11 480 699 ;
-C 49 ; WX 500 ; N one ; B 54 -3 398 699 ;
-C 50 ; WX 500 ; N two ; B 12 -3 437 699 ;
-C 51 ; WX 500 ; N three ; B 22 -11 447 699 ;
-C 52 ; WX 500 ; N four ; B 15 -3 478 699 ;
-C 53 ; WX 500 ; N five ; B 14 -11 491 693 ;
-C 54 ; WX 500 ; N six ; B 49 -11 469 699 ;
-C 55 ; WX 500 ; N seven ; B 53 -3 502 692 ;
-C 56 ; WX 500 ; N eight ; B 36 -11 469 699 ;
-C 57 ; WX 500 ; N nine ; B 32 -11 468 699 ;
-C 58 ; WX 250 ; N colon ; B 44 -5 207 458 ;
-C 59 ; WX 250 ; N semicolon ; B -9 -146 219 456 ;
-C 60 ; WX 606 ; N less ; B 53 -6 554 516 ;
-C 61 ; WX 606 ; N equal ; B 51 126 555 378 ;
-C 62 ; WX 606 ; N greater ; B 53 -6 554 516 ;
-C 63 ; WX 500 ; N question ; B 114 -8 427 706 ;
-C 64 ; WX 747 ; N at ; B 27 -18 718 706 ;
-C 65 ; WX 722 ; N A ; B -19 -3 677 705 ;
-C 66 ; WX 611 ; N B ; B 26 -6 559 692 ;
-C 67 ; WX 667 ; N C ; B 45 -18 651 706 ;
-C 68 ; WX 778 ; N D ; B 28 -3 741 692 ;
-C 69 ; WX 611 ; N E ; B 30 -3 570 692 ;
-C 70 ; WX 556 ; N F ; B 0 -3 548 692 ;
-C 71 ; WX 722 ; N G ; B 50 -18 694 706 ;
-C 72 ; WX 778 ; N H ; B -3 -3 800 692 ;
-C 73 ; WX 333 ; N I ; B 7 -3 354 692 ;
-C 74 ; WX 333 ; N J ; B -35 -206 358 692 ;
-C 75 ; WX 667 ; N K ; B 13 -3 683 692 ;
-C 76 ; WX 556 ; N L ; B 16 -3 523 692 ;
-C 77 ; WX 944 ; N M ; B -19 -18 940 692 ;
-C 78 ; WX 778 ; N N ; B 2 -11 804 692 ;
-C 79 ; WX 778 ; N O ; B 53 -18 748 706 ;
-C 80 ; WX 611 ; N P ; B 9 -3 594 692 ;
-C 81 ; WX 778 ; N Q ; B 53 -201 748 706 ;
-C 82 ; WX 667 ; N R ; B 9 -3 639 692 ;
-C 83 ; WX 556 ; N S ; B 42 -18 506 706 ;
-C 84 ; WX 611 ; N T ; B 53 -3 635 692 ;
-C 85 ; WX 778 ; N U ; B 88 -18 798 692 ;
-C 86 ; WX 722 ; N V ; B 75 -8 754 692 ;
-C 87 ; WX 944 ; N W ; B 71 -8 980 700 ;
-C 88 ; WX 722 ; N X ; B 20 -3 734 692 ;
-C 89 ; WX 667 ; N Y ; B 52 -3 675 705 ;
-C 90 ; WX 667 ; N Z ; B 20 -3 637 692 ;
-C 91 ; WX 333 ; N bracketleft ; B 18 -100 326 733 ;
-C 92 ; WX 606 ; N backslash ; B 81 0 513 733 ;
-C 93 ; WX 333 ; N bracketright ; B 7 -100 315 733 ;
-C 94 ; WX 606 ; N asciicircum ; B 51 283 554 689 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 278 ; N quoteleft ; B 78 488 258 733 ;
-C 97 ; WX 444 ; N a ; B 4 -11 406 482 ;
-C 98 ; WX 463 ; N b ; B 37 -11 433 733 ;
-C 99 ; WX 407 ; N c ; B 25 -11 389 482 ;
-C 100 ; WX 500 ; N d ; B 17 -11 483 733 ;
-C 101 ; WX 389 ; N e ; B 15 -11 374 482 ;
-C 102 ; WX 278 ; N f ; B -162 -276 413 733 ; L i fi ; L l fl ;
-C 103 ; WX 500 ; N g ; B -37 -276 498 482 ;
-C 104 ; WX 500 ; N h ; B 10 -9 471 733 ;
-C 105 ; WX 278 ; N i ; B 34 -9 264 712 ;
-C 106 ; WX 278 ; N j ; B -70 -276 265 712 ;
-C 107 ; WX 444 ; N k ; B 8 -9 449 733 ;
-C 108 ; WX 278 ; N l ; B 36 -9 251 733 ;
-C 109 ; WX 778 ; N m ; B 24 -9 740 482 ;
-C 110 ; WX 556 ; N n ; B 24 -9 514 482 ;
-C 111 ; WX 444 ; N o ; B 17 -11 411 482 ;
-C 112 ; WX 500 ; N p ; B -7 -276 465 482 ;
-C 113 ; WX 463 ; N q ; B 24 -276 432 482 ;
-C 114 ; WX 389 ; N r ; B 26 -9 384 482 ;
-C 115 ; WX 389 ; N s ; B 9 -11 345 482 ;
-C 116 ; WX 333 ; N t ; B 41 -9 310 646 ;
-C 117 ; WX 556 ; N u ; B 32 -11 512 482 ;
-C 118 ; WX 500 ; N v ; B 21 -11 477 482 ;
-C 119 ; WX 722 ; N w ; B 21 -11 699 482 ;
-C 120 ; WX 500 ; N x ; B 9 -11 484 482 ;
-C 121 ; WX 500 ; N y ; B -8 -276 490 482 ;
-C 122 ; WX 444 ; N z ; B -1 -11 416 482 ;
-C 123 ; WX 333 ; N braceleft ; B 15 -100 319 733 ;
-C 124 ; WX 606 ; N bar ; B 275 0 331 733 ;
-C 125 ; WX 333 ; N braceright ; B 14 -100 318 733 ;
-C 126 ; WX 606 ; N asciitilde ; B 51 168 555 339 ;
-C 161 ; WX 333 ; N exclamdown ; B 15 -276 233 467 ;
-C 162 ; WX 500 ; N cent ; B 56 -96 418 551 ;
-C 163 ; WX 500 ; N sterling ; B 2 -18 479 708 ;
-C 164 ; WX 167 ; N fraction ; B -170 0 337 699 ;
-C 165 ; WX 500 ; N yen ; B 35 -3 512 699 ;
-C 166 ; WX 500 ; N florin ; B 5 -276 470 708 ;
-C 167 ; WX 500 ; N section ; B 14 -220 463 706 ;
-C 168 ; WX 500 ; N currency ; B 14 115 486 577 ;
-C 169 ; WX 333 ; N quotesingle ; B 140 508 288 733 ;
-C 170 ; WX 500 ; N quotedblleft ; B 98 488 475 733 ;
-C 171 ; WX 500 ; N guillemotleft ; B 57 70 437 440 ;
-C 172 ; WX 333 ; N guilsinglleft ; B 57 70 270 440 ;
-C 173 ; WX 333 ; N guilsinglright ; B 63 70 276 440 ;
-C 174 ; WX 528 ; N fi ; B -162 -276 502 733 ;
-C 175 ; WX 545 ; N fl ; B -162 -276 520 733 ;
-C 177 ; WX 500 ; N endash ; B -10 228 510 278 ;
-C 178 ; WX 500 ; N dagger ; B 48 0 469 692 ;
-C 179 ; WX 500 ; N daggerdbl ; B 10 -162 494 692 ;
-C 180 ; WX 250 ; N periodcentered ; B 53 195 158 312 ;
-C 182 ; WX 500 ; N paragraph ; B 33 -224 611 692 ;
-C 183 ; WX 500 ; N bullet ; B 86 182 430 526 ;
-C 184 ; WX 278 ; N quotesinglbase ; B 27 -122 211 120 ;
-C 185 ; WX 500 ; N quotedblbase ; B 43 -122 424 120 ;
-C 186 ; WX 500 ; N quotedblright ; B 98 488 475 733 ;
-C 187 ; WX 500 ; N guillemotright ; B 63 70 443 440 ;
-C 188 ; WX 1000 ; N ellipsis ; B 102 -5 873 112 ;
-C 189 ; WX 1000 ; N perthousand ; B 72 -6 929 717 ;
-C 191 ; WX 500 ; N questiondown ; B 57 -246 370 467 ;
-C 193 ; WX 333 ; N grave ; B 86 518 310 687 ;
-C 194 ; WX 333 ; N acute ; B 122 518 346 687 ;
-C 195 ; WX 333 ; N circumflex ; B 56 510 350 679 ;
-C 196 ; WX 333 ; N tilde ; B 63 535 390 638 ;
-C 197 ; WX 333 ; N macron ; B 74 538 386 589 ;
-C 198 ; WX 333 ; N breve ; B 92 518 393 677 ;
-C 199 ; WX 333 ; N dotaccent ; B 175 537 283 645 ;
-C 200 ; WX 333 ; N dieresis ; B 78 537 378 637 ;
-C 202 ; WX 333 ; N ring ; B 159 508 359 708 ;
-C 203 ; WX 333 ; N cedilla ; B -9 -216 202 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B 46 518 385 730 ;
-C 206 ; WX 333 ; N ogonek ; B 38 -207 196 -18 ;
-C 207 ; WX 333 ; N caron ; B 104 510 409 679 ;
-C 208 ; WX 1000 ; N emdash ; B -10 228 1010 278 ;
-C 225 ; WX 941 ; N AE ; B -4 -3 902 692 ;
-C 227 ; WX 333 ; N ordfeminine ; B 60 404 321 699 ;
-C 232 ; WX 556 ; N Lslash ; B -16 -3 523 692 ;
-C 233 ; WX 778 ; N Oslash ; B 32 -39 762 721 ;
-C 234 ; WX 1028 ; N OE ; B 56 -18 989 706 ;
-C 235 ; WX 333 ; N ordmasculine ; B 66 404 322 699 ;
-C 241 ; WX 638 ; N ae ; B 1 -11 623 482 ;
-C 245 ; WX 278 ; N dotlessi ; B 34 -9 241 482 ;
-C 248 ; WX 278 ; N lslash ; B -10 -9 302 733 ;
-C 249 ; WX 444 ; N oslash ; B -18 -24 460 510 ;
-C 250 ; WX 669 ; N oe ; B 17 -11 654 482 ;
-C 251 ; WX 500 ; N germandbls ; B -160 -276 488 733 ;
-C -1 ; WX 667 ; N Zcaron ; B 20 -3 637 907 ;
-C -1 ; WX 407 ; N ccedilla ; B 25 -216 389 482 ;
-C -1 ; WX 500 ; N ydieresis ; B -8 -276 490 657 ;
-C -1 ; WX 444 ; N atilde ; B 4 -11 446 650 ;
-C -1 ; WX 278 ; N icircumflex ; B 29 -9 323 699 ;
-C -1 ; WX 300 ; N threesuperior ; B 28 273 304 699 ;
-C -1 ; WX 389 ; N ecircumflex ; B 15 -11 398 699 ;
-C -1 ; WX 500 ; N thorn ; B -39 -276 433 733 ;
-C -1 ; WX 389 ; N egrave ; B 15 -11 374 707 ;
-C -1 ; WX 300 ; N twosuperior ; B 13 278 290 699 ;
-C -1 ; WX 389 ; N eacute ; B 15 -11 394 707 ;
-C -1 ; WX 444 ; N otilde ; B 17 -11 446 650 ;
-C -1 ; WX 722 ; N Aacute ; B -19 -3 677 897 ;
-C -1 ; WX 444 ; N ocircumflex ; B 17 -11 411 699 ;
-C -1 ; WX 500 ; N yacute ; B -8 -276 490 707 ;
-C -1 ; WX 556 ; N udieresis ; B 32 -11 512 657 ;
-C -1 ; WX 750 ; N threequarters ; B 35 -2 715 699 ;
-C -1 ; WX 444 ; N acircumflex ; B 4 -11 406 699 ;
-C -1 ; WX 778 ; N Eth ; B 19 -3 741 692 ;
-C -1 ; WX 389 ; N edieresis ; B 15 -11 406 657 ;
-C -1 ; WX 556 ; N ugrave ; B 32 -11 512 707 ;
-C -1 ; WX 1000 ; N trademark ; B 52 285 951 689 ;
-C -1 ; WX 444 ; N ograve ; B 17 -11 411 707 ;
-C -1 ; WX 389 ; N scaron ; B 9 -11 419 687 ;
-C -1 ; WX 333 ; N Idieresis ; B 7 -3 418 847 ;
-C -1 ; WX 556 ; N uacute ; B 32 -11 512 707 ;
-C -1 ; WX 444 ; N agrave ; B 4 -11 406 707 ;
-C -1 ; WX 556 ; N ntilde ; B 24 -9 514 650 ;
-C -1 ; WX 444 ; N aring ; B 4 -11 406 728 ;
-C -1 ; WX 444 ; N zcaron ; B -1 -11 447 687 ;
-C -1 ; WX 333 ; N Icircumflex ; B 7 -3 390 889 ;
-C -1 ; WX 778 ; N Ntilde ; B 2 -11 804 866 ;
-C -1 ; WX 556 ; N ucircumflex ; B 32 -11 512 699 ;
-C -1 ; WX 611 ; N Ecircumflex ; B 30 -3 570 889 ;
-C -1 ; WX 333 ; N Iacute ; B 7 -3 406 897 ;
-C -1 ; WX 667 ; N Ccedilla ; B 45 -216 651 706 ;
-C -1 ; WX 778 ; N Odieresis ; B 53 -18 748 847 ;
-C -1 ; WX 556 ; N Scaron ; B 42 -18 539 907 ;
-C -1 ; WX 611 ; N Edieresis ; B 30 -3 570 847 ;
-C -1 ; WX 333 ; N Igrave ; B 7 -3 354 897 ;
-C -1 ; WX 444 ; N adieresis ; B 4 -11 434 657 ;
-C -1 ; WX 778 ; N Ograve ; B 53 -18 748 897 ;
-C -1 ; WX 611 ; N Egrave ; B 30 -3 570 897 ;
-C -1 ; WX 667 ; N Ydieresis ; B 52 -3 675 847 ;
-C -1 ; WX 747 ; N registered ; B 11 -18 736 706 ;
-C -1 ; WX 778 ; N Otilde ; B 53 -18 748 866 ;
-C -1 ; WX 750 ; N onequarter ; B 31 -2 715 699 ;
-C -1 ; WX 778 ; N Ugrave ; B 88 -18 798 897 ;
-C -1 ; WX 778 ; N Ucircumflex ; B 88 -18 798 889 ;
-C -1 ; WX 611 ; N Thorn ; B 9 -3 570 692 ;
-C -1 ; WX 606 ; N divide ; B 51 0 555 504 ;
-C -1 ; WX 722 ; N Atilde ; B -19 -3 677 866 ;
-C -1 ; WX 778 ; N Uacute ; B 88 -18 798 897 ;
-C -1 ; WX 778 ; N Ocircumflex ; B 53 -18 748 889 ;
-C -1 ; WX 606 ; N logicalnot ; B 51 118 555 378 ;
-C -1 ; WX 722 ; N Aring ; B -19 -3 677 918 ;
-C -1 ; WX 278 ; N idieresis ; B 34 -9 351 657 ;
-C -1 ; WX 278 ; N iacute ; B 34 -9 331 707 ;
-C -1 ; WX 444 ; N aacute ; B 4 -11 414 707 ;
-C -1 ; WX 606 ; N plusminus ; B 51 0 555 504 ;
-C -1 ; WX 606 ; N multiply ; B 83 36 523 474 ;
-C -1 ; WX 778 ; N Udieresis ; B 88 -18 798 847 ;
-C -1 ; WX 606 ; N minus ; B 51 224 555 280 ;
-C -1 ; WX 300 ; N onesuperior ; B 61 278 285 699 ;
-C -1 ; WX 611 ; N Eacute ; B 30 -3 570 897 ;
-C -1 ; WX 722 ; N Acircumflex ; B -19 -3 677 889 ;
-C -1 ; WX 747 ; N copyright ; B 11 -18 736 706 ;
-C -1 ; WX 722 ; N Agrave ; B -19 -3 677 897 ;
-C -1 ; WX 444 ; N odieresis ; B 17 -11 434 657 ;
-C -1 ; WX 444 ; N oacute ; B 17 -11 414 707 ;
-C -1 ; WX 400 ; N degree ; B 90 389 390 689 ;
-C -1 ; WX 278 ; N igrave ; B 34 -9 271 707 ;
-C -1 ; WX 556 ; N mu ; B 15 -226 512 482 ;
-C -1 ; WX 778 ; N Oacute ; B 53 -18 748 897 ;
-C -1 ; WX 444 ; N eth ; B 17 -11 478 733 ;
-C -1 ; WX 722 ; N Adieresis ; B -19 -3 677 847 ;
-C -1 ; WX 667 ; N Yacute ; B 52 -3 675 897 ;
-C -1 ; WX 606 ; N brokenbar ; B 275 0 331 733 ;
-C -1 ; WX 750 ; N onehalf ; B 31 -2 721 699 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 106
-
-KPX A y -55
-KPX A w -37
-KPX A v -37
-KPX A space -37
-KPX A quoteright -55
-KPX A Y -55
-KPX A W -55
-KPX A V -74
-KPX A T -55
-
-KPX F period -111
-KPX F comma -111
-KPX F A -111
-
-KPX L y -37
-KPX L space -18
-KPX L quoteright -37
-KPX L Y -74
-KPX L W -74
-KPX L V -74
-KPX L T -74
-
-KPX P period -129
-KPX P comma -129
-KPX P A -129
-
-KPX R y -37
-KPX R Y -55
-KPX R W -55
-KPX R V -74
-KPX R T -55
-
-KPX T y -92
-KPX T w -92
-KPX T u -111
-KPX T semicolon -74
-KPX T s -111
-KPX T r -111
-KPX T period -74
-KPX T o -111
-KPX T i -55
-KPX T hyphen -55
-KPX T e -111
-KPX T comma -74
-KPX T colon -74
-KPX T c -111
-KPX T a -111
-KPX T O -18
-KPX T A -92
-
-KPX V y -74
-KPX V u -74
-KPX V semicolon -37
-KPX V r -92
-KPX V period -129
-KPX V o -74
-KPX V i -74
-KPX V hyphen -55
-KPX V e -92
-KPX V comma -129
-KPX V colon -37
-KPX V a -74
-KPX V A -210
-
-KPX W y -20
-KPX W u -20
-KPX W semicolon -18
-KPX W r -20
-KPX W period -55
-KPX W o -20
-KPX W i -20
-KPX W hyphen -18
-KPX W e -20
-KPX W comma -55
-KPX W colon -18
-KPX W a -20
-KPX W A -92
-
-KPX Y v -74
-KPX Y u -92
-KPX Y semicolon -74
-KPX Y q -92
-KPX Y period -92
-KPX Y p -74
-KPX Y o -111
-KPX Y i -55
-KPX Y hyphen -74
-KPX Y e -111
-KPX Y comma -92
-KPX Y colon -74
-KPX Y a -92
-KPX Y A -92
-
-KPX f quoteright 55
-
-KPX one one -55
-
-KPX quoteleft quoteleft -74
-
-KPX quoteright t -37
-KPX quoteright space -55
-KPX quoteright s -55
-KPX quoteright quoteright -74
-
-KPX r quoteright 37
-KPX r q -18
-KPX r period -74
-KPX r o -18
-KPX r h -18
-KPX r g -18
-KPX r e -18
-KPX r comma -74
-KPX r c -18
-
-KPX v period -55
-KPX v comma -55
-
-KPX w period -55
-KPX w comma -55
-
-KPX y period -37
-KPX y comma -37
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 271 210 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 261 210 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 255 210 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 235 210 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 235 210 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 255 228 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 207 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 199 210 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 179 210 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 179 210 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 167 210 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 60 210 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 40 210 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 40 210 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 28 210 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 263 228 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 283 210 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 263 210 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 255 210 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 251 210 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 263 228 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 130 228 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 277 210 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 255 210 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 235 210 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 235 210 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 227 210 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 187 210 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 179 228 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 68 20 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 56 20 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 56 20 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 44 20 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 36 20 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 56 12 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 37 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 48 20 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 48 20 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 28 20 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 16 20 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -15 20 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 20 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 20 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -39 20 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 112 12 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 68 20 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 56 20 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 56 20 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 36 20 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 56 12 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 10 8 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 124 20 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 112 20 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 112 20 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 100 20 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 96 20 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 20 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 38 8 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Palatino-Roman.afm b/blt3.0.1/library/afm/Palatino-Roman.afm
deleted file mode 100644
index c7b7aff..0000000
--- a/blt3.0.1/library/afm/Palatino-Roman.afm
+++ /dev/null
@@ -1,446 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Mon Jul 2 22:14:17 1990
-Comment UniqueID 31790
-Comment VMusage 36445 47337
-FontName Palatino-Roman
-FullName Palatino Roman
-FamilyName Palatino
-Weight Roman
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -166 -283 1021 927
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.005
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Palatino is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 692
-XHeight 469
-Ascender 726
-Descender -281
-StartCharMetrics 228
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 278 ; N exclam ; B 81 -5 197 694 ;
-C 34 ; WX 371 ; N quotedbl ; B 52 469 319 709 ;
-C 35 ; WX 500 ; N numbersign ; B 4 0 495 684 ;
-C 36 ; WX 500 ; N dollar ; B 30 -116 471 731 ;
-C 37 ; WX 840 ; N percent ; B 39 -20 802 709 ;
-C 38 ; WX 778 ; N ampersand ; B 43 -20 753 689 ;
-C 39 ; WX 278 ; N quoteright ; B 45 446 233 709 ;
-C 40 ; WX 333 ; N parenleft ; B 60 -215 301 726 ;
-C 41 ; WX 333 ; N parenright ; B 32 -215 273 726 ;
-C 42 ; WX 389 ; N asterisk ; B 32 342 359 689 ;
-C 43 ; WX 606 ; N plus ; B 51 7 555 512 ;
-C 44 ; WX 250 ; N comma ; B 16 -155 218 123 ;
-C 45 ; WX 333 ; N hyphen ; B 17 215 312 287 ;
-C 46 ; WX 250 ; N period ; B 67 -5 183 111 ;
-C 47 ; WX 606 ; N slash ; B 87 -119 519 726 ;
-C 48 ; WX 500 ; N zero ; B 29 -20 465 689 ;
-C 49 ; WX 500 ; N one ; B 60 -3 418 694 ;
-C 50 ; WX 500 ; N two ; B 16 -3 468 689 ;
-C 51 ; WX 500 ; N three ; B 15 -20 462 689 ;
-C 52 ; WX 500 ; N four ; B 2 -3 472 694 ;
-C 53 ; WX 500 ; N five ; B 13 -20 459 689 ;
-C 54 ; WX 500 ; N six ; B 32 -20 468 689 ;
-C 55 ; WX 500 ; N seven ; B 44 -3 497 689 ;
-C 56 ; WX 500 ; N eight ; B 30 -20 464 689 ;
-C 57 ; WX 500 ; N nine ; B 20 -20 457 689 ;
-C 58 ; WX 250 ; N colon ; B 66 -5 182 456 ;
-C 59 ; WX 250 ; N semicolon ; B 16 -153 218 456 ;
-C 60 ; WX 606 ; N less ; B 57 0 558 522 ;
-C 61 ; WX 606 ; N equal ; B 51 136 555 386 ;
-C 62 ; WX 606 ; N greater ; B 48 0 549 522 ;
-C 63 ; WX 444 ; N question ; B 43 -5 395 694 ;
-C 64 ; WX 747 ; N at ; B 24 -20 724 694 ;
-C 65 ; WX 778 ; N A ; B 15 -3 756 700 ;
-C 66 ; WX 611 ; N B ; B 26 -3 576 692 ;
-C 67 ; WX 709 ; N C ; B 22 -20 670 709 ;
-C 68 ; WX 774 ; N D ; B 22 -3 751 692 ;
-C 69 ; WX 611 ; N E ; B 22 -3 572 692 ;
-C 70 ; WX 556 ; N F ; B 22 -3 536 692 ;
-C 71 ; WX 763 ; N G ; B 22 -20 728 709 ;
-C 72 ; WX 832 ; N H ; B 22 -3 810 692 ;
-C 73 ; WX 337 ; N I ; B 22 -3 315 692 ;
-C 74 ; WX 333 ; N J ; B -15 -194 311 692 ;
-C 75 ; WX 726 ; N K ; B 22 -3 719 692 ;
-C 76 ; WX 611 ; N L ; B 22 -3 586 692 ;
-C 77 ; WX 946 ; N M ; B 16 -13 926 692 ;
-C 78 ; WX 831 ; N N ; B 17 -20 813 692 ;
-C 79 ; WX 786 ; N O ; B 22 -20 764 709 ;
-C 80 ; WX 604 ; N P ; B 22 -3 580 692 ;
-C 81 ; WX 786 ; N Q ; B 22 -176 764 709 ;
-C 82 ; WX 668 ; N R ; B 22 -3 669 692 ;
-C 83 ; WX 525 ; N S ; B 24 -20 503 709 ;
-C 84 ; WX 613 ; N T ; B 18 -3 595 692 ;
-C 85 ; WX 778 ; N U ; B 12 -20 759 692 ;
-C 86 ; WX 722 ; N V ; B 8 -9 706 692 ;
-C 87 ; WX 1000 ; N W ; B 8 -9 984 700 ;
-C 88 ; WX 667 ; N X ; B 14 -3 648 700 ;
-C 89 ; WX 667 ; N Y ; B 9 -3 654 704 ;
-C 90 ; WX 667 ; N Z ; B 15 -3 638 692 ;
-C 91 ; WX 333 ; N bracketleft ; B 79 -184 288 726 ;
-C 92 ; WX 606 ; N backslash ; B 81 0 512 726 ;
-C 93 ; WX 333 ; N bracketright ; B 45 -184 254 726 ;
-C 94 ; WX 606 ; N asciicircum ; B 51 283 554 689 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 278 ; N quoteleft ; B 45 446 233 709 ;
-C 97 ; WX 500 ; N a ; B 32 -12 471 469 ;
-C 98 ; WX 553 ; N b ; B -15 -12 508 726 ;
-C 99 ; WX 444 ; N c ; B 26 -20 413 469 ;
-C 100 ; WX 611 ; N d ; B 35 -12 579 726 ;
-C 101 ; WX 479 ; N e ; B 26 -20 448 469 ;
-C 102 ; WX 333 ; N f ; B 23 -3 341 728 ; L i fi ; L l fl ;
-C 103 ; WX 556 ; N g ; B 32 -283 544 469 ;
-C 104 ; WX 582 ; N h ; B 6 -3 572 726 ;
-C 105 ; WX 291 ; N i ; B 21 -3 271 687 ;
-C 106 ; WX 234 ; N j ; B -40 -283 167 688 ;
-C 107 ; WX 556 ; N k ; B 21 -12 549 726 ;
-C 108 ; WX 291 ; N l ; B 21 -3 271 726 ;
-C 109 ; WX 883 ; N m ; B 16 -3 869 469 ;
-C 110 ; WX 582 ; N n ; B 6 -3 572 469 ;
-C 111 ; WX 546 ; N o ; B 32 -20 514 469 ;
-C 112 ; WX 601 ; N p ; B 8 -281 554 469 ;
-C 113 ; WX 560 ; N q ; B 35 -281 560 469 ;
-C 114 ; WX 395 ; N r ; B 21 -3 374 469 ;
-C 115 ; WX 424 ; N s ; B 30 -20 391 469 ;
-C 116 ; WX 326 ; N t ; B 22 -12 319 621 ;
-C 117 ; WX 603 ; N u ; B 18 -12 581 469 ;
-C 118 ; WX 565 ; N v ; B 6 -7 539 459 ;
-C 119 ; WX 834 ; N w ; B 6 -7 808 469 ;
-C 120 ; WX 516 ; N x ; B 20 -3 496 469 ;
-C 121 ; WX 556 ; N y ; B 12 -283 544 459 ;
-C 122 ; WX 500 ; N z ; B 16 -3 466 462 ;
-C 123 ; WX 333 ; N braceleft ; B 58 -175 289 726 ;
-C 124 ; WX 606 ; N bar ; B 275 0 331 726 ;
-C 125 ; WX 333 ; N braceright ; B 44 -175 275 726 ;
-C 126 ; WX 606 ; N asciitilde ; B 51 176 555 347 ;
-C 161 ; WX 278 ; N exclamdown ; B 81 -225 197 469 ;
-C 162 ; WX 500 ; N cent ; B 61 -101 448 562 ;
-C 163 ; WX 500 ; N sterling ; B 12 -13 478 694 ;
-C 164 ; WX 167 ; N fraction ; B -166 0 337 689 ;
-C 165 ; WX 500 ; N yen ; B 5 -3 496 701 ;
-C 166 ; WX 500 ; N florin ; B 0 -262 473 706 ;
-C 167 ; WX 500 ; N section ; B 26 -219 465 709 ;
-C 168 ; WX 500 ; N currency ; B 30 96 470 531 ;
-C 169 ; WX 208 ; N quotesingle ; B 61 469 147 709 ;
-C 170 ; WX 500 ; N quotedblleft ; B 51 446 449 709 ;
-C 171 ; WX 500 ; N guillemotleft ; B 50 71 450 428 ;
-C 172 ; WX 331 ; N guilsinglleft ; B 66 71 265 428 ;
-C 173 ; WX 331 ; N guilsinglright ; B 66 71 265 428 ;
-C 174 ; WX 605 ; N fi ; B 23 -3 587 728 ;
-C 175 ; WX 608 ; N fl ; B 23 -3 590 728 ;
-C 177 ; WX 500 ; N endash ; B 0 219 500 277 ;
-C 178 ; WX 500 ; N dagger ; B 34 -5 466 694 ;
-C 179 ; WX 500 ; N daggerdbl ; B 34 -249 466 694 ;
-C 180 ; WX 250 ; N periodcentered ; B 67 203 183 319 ;
-C 182 ; WX 628 ; N paragraph ; B 39 -150 589 694 ;
-C 183 ; WX 606 ; N bullet ; B 131 172 475 516 ;
-C 184 ; WX 278 ; N quotesinglbase ; B 22 -153 210 110 ;
-C 185 ; WX 500 ; N quotedblbase ; B 51 -153 449 110 ;
-C 186 ; WX 500 ; N quotedblright ; B 51 446 449 709 ;
-C 187 ; WX 500 ; N guillemotright ; B 50 71 450 428 ;
-C 188 ; WX 1000 ; N ellipsis ; B 109 -5 891 111 ;
-C 189 ; WX 1144 ; N perthousand ; B 123 -20 1021 709 ;
-C 191 ; WX 444 ; N questiondown ; B 43 -231 395 469 ;
-C 193 ; WX 333 ; N grave ; B 31 506 255 677 ;
-C 194 ; WX 333 ; N acute ; B 78 506 302 677 ;
-C 195 ; WX 333 ; N circumflex ; B 11 510 323 677 ;
-C 196 ; WX 333 ; N tilde ; B 2 535 332 640 ;
-C 197 ; WX 333 ; N macron ; B 11 538 323 591 ;
-C 198 ; WX 333 ; N breve ; B 26 506 308 664 ;
-C 199 ; WX 250 ; N dotaccent ; B 75 537 175 637 ;
-C 200 ; WX 333 ; N dieresis ; B 17 537 316 637 ;
-C 202 ; WX 333 ; N ring ; B 67 496 267 696 ;
-C 203 ; WX 333 ; N cedilla ; B 96 -225 304 -10 ;
-C 205 ; WX 380 ; N hungarumlaut ; B 3 506 377 687 ;
-C 206 ; WX 313 ; N ogonek ; B 68 -165 245 -20 ;
-C 207 ; WX 333 ; N caron ; B 11 510 323 677 ;
-C 208 ; WX 1000 ; N emdash ; B 0 219 1000 277 ;
-C 225 ; WX 944 ; N AE ; B -10 -3 908 692 ;
-C 227 ; WX 333 ; N ordfeminine ; B 24 422 310 709 ;
-C 232 ; WX 611 ; N Lslash ; B 6 -3 586 692 ;
-C 233 ; WX 833 ; N Oslash ; B 30 -20 797 709 ;
-C 234 ; WX 998 ; N OE ; B 22 -20 962 709 ;
-C 235 ; WX 333 ; N ordmasculine ; B 10 416 323 709 ;
-C 241 ; WX 758 ; N ae ; B 30 -20 732 469 ;
-C 245 ; WX 287 ; N dotlessi ; B 21 -3 271 469 ;
-C 248 ; WX 291 ; N lslash ; B -14 -3 306 726 ;
-C 249 ; WX 556 ; N oslash ; B 16 -23 530 474 ;
-C 250 ; WX 827 ; N oe ; B 32 -20 800 469 ;
-C 251 ; WX 556 ; N germandbls ; B 23 -9 519 731 ;
-C -1 ; WX 667 ; N Zcaron ; B 15 -3 638 908 ;
-C -1 ; WX 444 ; N ccedilla ; B 26 -225 413 469 ;
-C -1 ; WX 556 ; N ydieresis ; B 12 -283 544 657 ;
-C -1 ; WX 500 ; N atilde ; B 32 -12 471 652 ;
-C -1 ; WX 287 ; N icircumflex ; B -12 -3 300 697 ;
-C -1 ; WX 300 ; N threesuperior ; B 1 266 299 689 ;
-C -1 ; WX 479 ; N ecircumflex ; B 26 -20 448 697 ;
-C -1 ; WX 601 ; N thorn ; B -2 -281 544 726 ;
-C -1 ; WX 479 ; N egrave ; B 26 -20 448 697 ;
-C -1 ; WX 300 ; N twosuperior ; B 0 273 301 689 ;
-C -1 ; WX 479 ; N eacute ; B 26 -20 448 697 ;
-C -1 ; WX 546 ; N otilde ; B 32 -20 514 652 ;
-C -1 ; WX 778 ; N Aacute ; B 15 -3 756 908 ;
-C -1 ; WX 546 ; N ocircumflex ; B 32 -20 514 697 ;
-C -1 ; WX 556 ; N yacute ; B 12 -283 544 697 ;
-C -1 ; WX 603 ; N udieresis ; B 18 -12 581 657 ;
-C -1 ; WX 750 ; N threequarters ; B 15 -3 735 689 ;
-C -1 ; WX 500 ; N acircumflex ; B 32 -12 471 697 ;
-C -1 ; WX 774 ; N Eth ; B 14 -3 751 692 ;
-C -1 ; WX 479 ; N edieresis ; B 26 -20 448 657 ;
-C -1 ; WX 603 ; N ugrave ; B 18 -12 581 697 ;
-C -1 ; WX 979 ; N trademark ; B 40 285 939 689 ;
-C -1 ; WX 546 ; N ograve ; B 32 -20 514 697 ;
-C -1 ; WX 424 ; N scaron ; B 30 -20 391 685 ;
-C -1 ; WX 337 ; N Idieresis ; B 19 -3 318 868 ;
-C -1 ; WX 603 ; N uacute ; B 18 -12 581 697 ;
-C -1 ; WX 500 ; N agrave ; B 32 -12 471 697 ;
-C -1 ; WX 582 ; N ntilde ; B 6 -3 572 652 ;
-C -1 ; WX 500 ; N aring ; B 32 -12 471 716 ;
-C -1 ; WX 500 ; N zcaron ; B 16 -3 466 685 ;
-C -1 ; WX 337 ; N Icircumflex ; B 13 -3 325 908 ;
-C -1 ; WX 831 ; N Ntilde ; B 17 -20 813 871 ;
-C -1 ; WX 603 ; N ucircumflex ; B 18 -12 581 697 ;
-C -1 ; WX 611 ; N Ecircumflex ; B 22 -3 572 908 ;
-C -1 ; WX 337 ; N Iacute ; B 22 -3 315 908 ;
-C -1 ; WX 709 ; N Ccedilla ; B 22 -225 670 709 ;
-C -1 ; WX 786 ; N Odieresis ; B 22 -20 764 868 ;
-C -1 ; WX 525 ; N Scaron ; B 24 -20 503 908 ;
-C -1 ; WX 611 ; N Edieresis ; B 22 -3 572 868 ;
-C -1 ; WX 337 ; N Igrave ; B 22 -3 315 908 ;
-C -1 ; WX 500 ; N adieresis ; B 32 -12 471 657 ;
-C -1 ; WX 786 ; N Ograve ; B 22 -20 764 908 ;
-C -1 ; WX 611 ; N Egrave ; B 22 -3 572 908 ;
-C -1 ; WX 667 ; N Ydieresis ; B 9 -3 654 868 ;
-C -1 ; WX 747 ; N registered ; B 11 -18 736 706 ;
-C -1 ; WX 786 ; N Otilde ; B 22 -20 764 883 ;
-C -1 ; WX 750 ; N onequarter ; B 30 -3 727 692 ;
-C -1 ; WX 778 ; N Ugrave ; B 12 -20 759 908 ;
-C -1 ; WX 778 ; N Ucircumflex ; B 12 -20 759 908 ;
-C -1 ; WX 604 ; N Thorn ; B 32 -3 574 692 ;
-C -1 ; WX 606 ; N divide ; B 51 10 555 512 ;
-C -1 ; WX 778 ; N Atilde ; B 15 -3 756 871 ;
-C -1 ; WX 778 ; N Uacute ; B 12 -20 759 908 ;
-C -1 ; WX 786 ; N Ocircumflex ; B 22 -20 764 908 ;
-C -1 ; WX 606 ; N logicalnot ; B 51 120 551 386 ;
-C -1 ; WX 778 ; N Aring ; B 15 -3 756 927 ;
-C -1 ; WX 287 ; N idieresis ; B -6 -3 293 657 ;
-C -1 ; WX 287 ; N iacute ; B 21 -3 279 697 ;
-C -1 ; WX 500 ; N aacute ; B 32 -12 471 697 ;
-C -1 ; WX 606 ; N plusminus ; B 51 0 555 512 ;
-C -1 ; WX 606 ; N multiply ; B 83 36 523 474 ;
-C -1 ; WX 778 ; N Udieresis ; B 12 -20 759 868 ;
-C -1 ; WX 606 ; N minus ; B 51 233 555 289 ;
-C -1 ; WX 300 ; N onesuperior ; B 31 273 269 692 ;
-C -1 ; WX 611 ; N Eacute ; B 22 -3 572 908 ;
-C -1 ; WX 778 ; N Acircumflex ; B 15 -3 756 908 ;
-C -1 ; WX 747 ; N copyright ; B 11 -18 736 706 ;
-C -1 ; WX 778 ; N Agrave ; B 15 -3 756 908 ;
-C -1 ; WX 546 ; N odieresis ; B 32 -20 514 657 ;
-C -1 ; WX 546 ; N oacute ; B 32 -20 514 697 ;
-C -1 ; WX 400 ; N degree ; B 50 389 350 689 ;
-C -1 ; WX 287 ; N igrave ; B 8 -3 271 697 ;
-C -1 ; WX 603 ; N mu ; B 18 -236 581 469 ;
-C -1 ; WX 786 ; N Oacute ; B 22 -20 764 908 ;
-C -1 ; WX 546 ; N eth ; B 32 -20 504 728 ;
-C -1 ; WX 778 ; N Adieresis ; B 15 -3 756 868 ;
-C -1 ; WX 667 ; N Yacute ; B 9 -3 654 908 ;
-C -1 ; WX 606 ; N brokenbar ; B 275 0 331 726 ;
-C -1 ; WX 750 ; N onehalf ; B 15 -3 735 692 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 111
-
-KPX A y -74
-KPX A w -74
-KPX A v -92
-KPX A space -55
-KPX A quoteright -74
-KPX A Y -111
-KPX A W -74
-KPX A V -111
-KPX A T -74
-
-KPX F period -92
-KPX F comma -92
-KPX F A -74
-
-KPX L y -55
-KPX L space -37
-KPX L quoteright -74
-KPX L Y -92
-KPX L W -74
-KPX L V -92
-KPX L T -74
-
-KPX P space -18
-KPX P period -129
-KPX P comma -129
-KPX P A -92
-
-KPX R y -37
-KPX R Y -37
-KPX R W -37
-KPX R V -55
-KPX R T -37
-
-KPX T y -90
-KPX T w -90
-KPX T u -90
-KPX T semicolon -55
-KPX T s -90
-KPX T r -90
-KPX T period -74
-KPX T o -92
-KPX T i -55
-KPX T hyphen -55
-KPX T e -92
-KPX T comma -74
-KPX T colon -55
-KPX T c -111
-KPX T a -92
-KPX T O -18
-KPX T A -74
-
-KPX V y -92
-KPX V u -92
-KPX V semicolon -55
-KPX V r -92
-KPX V period -129
-KPX V o -111
-KPX V i -55
-KPX V hyphen -74
-KPX V e -111
-KPX V comma -129
-KPX V colon -55
-KPX V a -92
-KPX V A -111
-
-KPX W y -50
-KPX W u -50
-KPX W semicolon -18
-KPX W r -74
-KPX W period -92
-KPX W o -92
-KPX W i -55
-KPX W hyphen -55
-KPX W e -92
-KPX W comma -92
-KPX W colon -18
-KPX W a -92
-KPX W A -92
-
-KPX Y v -90
-KPX Y u -90
-KPX Y space -18
-KPX Y semicolon -74
-KPX Y q -90
-KPX Y period -111
-KPX Y p -111
-KPX Y o -92
-KPX Y i -55
-KPX Y hyphen -92
-KPX Y e -92
-KPX Y comma -111
-KPX Y colon -74
-KPX Y a -92
-KPX Y A -92
-
-KPX f quoteright 55
-KPX f f -18
-
-KPX one one -55
-
-KPX quoteleft quoteleft -37
-
-KPX quoteright quoteright -37
-
-KPX r u -8
-KPX r quoteright 74
-KPX r q -18
-KPX r period -74
-KPX r o -18
-KPX r hyphen -18
-KPX r h -18
-KPX r g -18
-KPX r e -18
-KPX r d -18
-KPX r comma -74
-KPX r c -18
-
-KPX space Y -18
-KPX space A -37
-
-KPX v period -111
-KPX v comma -111
-
-KPX w period -92
-KPX w comma -92
-
-KPX y period -111
-KPX y comma -111
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 229 231 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 223 231 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 223 231 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 215 231 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 223 231 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 223 231 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 188 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 139 231 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 139 231 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 139 231 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 139 231 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 2 231 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 2 231 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 2 231 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 2 231 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 249 231 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 227 231 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 227 231 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 227 231 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 227 231 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 227 243 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 96 231 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 255 231 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 247 231 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 223 231 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 223 231 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 203 231 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 191 231 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 179 231 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 84 20 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 72 20 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 72 20 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 60 20 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 72 20 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 72 12 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 56 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 97 20 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 85 20 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 73 20 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 73 20 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -23 20 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -23 20 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -23 20 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -23 20 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 113 12 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 107 20 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 107 20 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 107 20 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 95 20 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 107 12 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 46 8 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 159 20 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 135 20 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 135 20 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 111 20 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 144 20 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 112 20 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 84 8 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Symbol.afm b/blt3.0.1/library/afm/Symbol.afm
deleted file mode 100644
index 6f07472..0000000
--- a/blt3.0.1/library/afm/Symbol.afm
+++ /dev/null
@@ -1,210 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
-Comment Creation Date: Wed Jan 17 21:48:26 1990
-Comment UniqueID 27004
-Comment VMusage 28489 37622
-FontName Symbol
-FullName Symbol
-FamilyName Symbol
-Weight Medium
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -180 -293 1090 1010
-UnderlinePosition -98
-UnderlineThickness 54
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
-EncodingScheme FontSpecific
-StartCharMetrics 189
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 128 -17 240 672 ;
-C 34 ; WX 713 ; N universal ; B 31 0 681 705 ;
-C 35 ; WX 500 ; N numbersign ; B 20 -16 481 673 ;
-C 36 ; WX 549 ; N existential ; B 25 0 478 707 ;
-C 37 ; WX 833 ; N percent ; B 63 -36 771 655 ;
-C 38 ; WX 778 ; N ampersand ; B 41 -18 750 661 ;
-C 39 ; WX 439 ; N suchthat ; B 48 -17 414 500 ;
-C 40 ; WX 333 ; N parenleft ; B 53 -191 300 673 ;
-C 41 ; WX 333 ; N parenright ; B 30 -191 277 673 ;
-C 42 ; WX 500 ; N asteriskmath ; B 65 134 427 551 ;
-C 43 ; WX 549 ; N plus ; B 10 0 539 533 ;
-C 44 ; WX 250 ; N comma ; B 56 -152 194 104 ;
-C 45 ; WX 549 ; N minus ; B 11 233 535 288 ;
-C 46 ; WX 250 ; N period ; B 69 -17 181 95 ;
-C 47 ; WX 278 ; N slash ; B 0 -18 254 646 ;
-C 48 ; WX 500 ; N zero ; B 23 -17 471 685 ;
-C 49 ; WX 500 ; N one ; B 117 0 390 673 ;
-C 50 ; WX 500 ; N two ; B 25 0 475 686 ;
-C 51 ; WX 500 ; N three ; B 39 -17 435 685 ;
-C 52 ; WX 500 ; N four ; B 16 0 469 685 ;
-C 53 ; WX 500 ; N five ; B 29 -17 443 685 ;
-C 54 ; WX 500 ; N six ; B 36 -17 467 685 ;
-C 55 ; WX 500 ; N seven ; B 24 -16 448 673 ;
-C 56 ; WX 500 ; N eight ; B 54 -18 440 685 ;
-C 57 ; WX 500 ; N nine ; B 31 -18 460 685 ;
-C 58 ; WX 278 ; N colon ; B 81 -17 193 460 ;
-C 59 ; WX 278 ; N semicolon ; B 83 -152 221 460 ;
-C 60 ; WX 549 ; N less ; B 26 0 523 522 ;
-C 61 ; WX 549 ; N equal ; B 11 141 537 390 ;
-C 62 ; WX 549 ; N greater ; B 26 0 523 522 ;
-C 63 ; WX 444 ; N question ; B 70 -17 412 686 ;
-C 64 ; WX 549 ; N congruent ; B 11 0 537 475 ;
-C 65 ; WX 722 ; N Alpha ; B 4 0 684 673 ;
-C 66 ; WX 667 ; N Beta ; B 29 0 592 673 ;
-C 67 ; WX 722 ; N Chi ; B -9 0 704 673 ;
-C 68 ; WX 612 ; N Delta ; B 6 0 608 688 ;
-C 69 ; WX 611 ; N Epsilon ; B 32 0 617 673 ;
-C 70 ; WX 763 ; N Phi ; B 26 0 741 673 ;
-C 71 ; WX 603 ; N Gamma ; B 24 0 609 673 ;
-C 72 ; WX 722 ; N Eta ; B 39 0 729 673 ;
-C 73 ; WX 333 ; N Iota ; B 32 0 316 673 ;
-C 74 ; WX 631 ; N theta1 ; B 18 -18 623 689 ;
-C 75 ; WX 722 ; N Kappa ; B 35 0 722 673 ;
-C 76 ; WX 686 ; N Lambda ; B 6 0 680 688 ;
-C 77 ; WX 889 ; N Mu ; B 28 0 887 673 ;
-C 78 ; WX 722 ; N Nu ; B 29 -8 720 673 ;
-C 79 ; WX 722 ; N Omicron ; B 41 -17 715 685 ;
-C 80 ; WX 768 ; N Pi ; B 25 0 745 673 ;
-C 81 ; WX 741 ; N Theta ; B 41 -17 715 685 ;
-C 82 ; WX 556 ; N Rho ; B 28 0 563 673 ;
-C 83 ; WX 592 ; N Sigma ; B 5 0 589 673 ;
-C 84 ; WX 611 ; N Tau ; B 33 0 607 673 ;
-C 85 ; WX 690 ; N Upsilon ; B -8 0 694 673 ;
-C 86 ; WX 439 ; N sigma1 ; B 40 -233 436 500 ;
-C 87 ; WX 768 ; N Omega ; B 34 0 736 688 ;
-C 88 ; WX 645 ; N Xi ; B 40 0 599 673 ;
-C 89 ; WX 795 ; N Psi ; B 15 0 781 684 ;
-C 90 ; WX 611 ; N Zeta ; B 44 0 636 673 ;
-C 91 ; WX 333 ; N bracketleft ; B 86 -155 299 674 ;
-C 92 ; WX 863 ; N therefore ; B 163 0 701 478 ;
-C 93 ; WX 333 ; N bracketright ; B 33 -155 246 674 ;
-C 94 ; WX 658 ; N perpendicular ; B 15 0 652 674 ;
-C 95 ; WX 500 ; N underscore ; B -2 -252 502 -206 ;
-C 96 ; WX 500 ; N radicalex ; B 480 881 1090 917 ;
-C 97 ; WX 631 ; N alpha ; B 41 -18 622 500 ;
-C 98 ; WX 549 ; N beta ; B 61 -223 515 741 ;
-C 99 ; WX 549 ; N chi ; B 12 -231 522 499 ;
-C 100 ; WX 494 ; N delta ; B 40 -19 481 740 ;
-C 101 ; WX 439 ; N epsilon ; B 22 -19 427 502 ;
-C 102 ; WX 521 ; N phi ; B 27 -224 490 671 ;
-C 103 ; WX 411 ; N gamma ; B 5 -225 484 499 ;
-C 104 ; WX 603 ; N eta ; B 0 -202 527 514 ;
-C 105 ; WX 329 ; N iota ; B 0 -17 301 503 ;
-C 106 ; WX 603 ; N phi1 ; B 36 -224 587 499 ;
-C 107 ; WX 549 ; N kappa ; B 33 0 558 501 ;
-C 108 ; WX 549 ; N lambda ; B 24 -17 548 739 ;
-C 109 ; WX 576 ; N mu ; B 33 -223 567 500 ;
-C 110 ; WX 521 ; N nu ; B -9 -16 475 507 ;
-C 111 ; WX 549 ; N omicron ; B 35 -19 501 499 ;
-C 112 ; WX 549 ; N pi ; B 10 -19 530 487 ;
-C 113 ; WX 521 ; N theta ; B 43 -17 485 690 ;
-C 114 ; WX 549 ; N rho ; B 50 -230 490 499 ;
-C 115 ; WX 603 ; N sigma ; B 30 -21 588 500 ;
-C 116 ; WX 439 ; N tau ; B 10 -19 418 500 ;
-C 117 ; WX 576 ; N upsilon ; B 7 -18 535 507 ;
-C 118 ; WX 713 ; N omega1 ; B 12 -18 671 583 ;
-C 119 ; WX 686 ; N omega ; B 42 -17 684 500 ;
-C 120 ; WX 493 ; N xi ; B 27 -224 469 766 ;
-C 121 ; WX 686 ; N psi ; B 12 -228 701 500 ;
-C 122 ; WX 494 ; N zeta ; B 60 -225 467 756 ;
-C 123 ; WX 480 ; N braceleft ; B 58 -183 397 673 ;
-C 124 ; WX 200 ; N bar ; B 65 -177 135 673 ;
-C 125 ; WX 480 ; N braceright ; B 79 -183 418 673 ;
-C 126 ; WX 549 ; N similar ; B 17 203 529 307 ;
-C 161 ; WX 620 ; N Upsilon1 ; B -2 0 610 685 ;
-C 162 ; WX 247 ; N minute ; B 27 459 228 735 ;
-C 163 ; WX 549 ; N lessequal ; B 29 0 526 639 ;
-C 164 ; WX 167 ; N fraction ; B -180 -12 340 677 ;
-C 165 ; WX 713 ; N infinity ; B 26 124 688 404 ;
-C 166 ; WX 500 ; N florin ; B 2 -193 494 686 ;
-C 167 ; WX 753 ; N club ; B 86 -26 660 533 ;
-C 168 ; WX 753 ; N diamond ; B 142 -36 600 550 ;
-C 169 ; WX 753 ; N heart ; B 117 -33 631 532 ;
-C 170 ; WX 753 ; N spade ; B 113 -36 629 548 ;
-C 171 ; WX 1042 ; N arrowboth ; B 24 -15 1024 511 ;
-C 172 ; WX 987 ; N arrowleft ; B 32 -15 942 511 ;
-C 173 ; WX 603 ; N arrowup ; B 45 0 571 910 ;
-C 174 ; WX 987 ; N arrowright ; B 49 -15 959 511 ;
-C 175 ; WX 603 ; N arrowdown ; B 45 -22 571 888 ;
-C 176 ; WX 400 ; N degree ; B 50 385 350 685 ;
-C 177 ; WX 549 ; N plusminus ; B 10 0 539 645 ;
-C 178 ; WX 411 ; N second ; B 20 459 413 737 ;
-C 179 ; WX 549 ; N greaterequal ; B 29 0 526 639 ;
-C 180 ; WX 549 ; N multiply ; B 17 8 533 524 ;
-C 181 ; WX 713 ; N proportional ; B 27 123 639 404 ;
-C 182 ; WX 494 ; N partialdiff ; B 26 -20 462 746 ;
-C 183 ; WX 460 ; N bullet ; B 50 113 410 473 ;
-C 184 ; WX 549 ; N divide ; B 10 71 536 456 ;
-C 185 ; WX 549 ; N notequal ; B 15 -25 540 549 ;
-C 186 ; WX 549 ; N equivalence ; B 14 82 538 443 ;
-C 187 ; WX 549 ; N approxequal ; B 14 135 527 394 ;
-C 188 ; WX 1000 ; N ellipsis ; B 111 -17 889 95 ;
-C 189 ; WX 603 ; N arrowvertex ; B 280 -120 336 1010 ;
-C 190 ; WX 1000 ; N arrowhorizex ; B -60 220 1050 276 ;
-C 191 ; WX 658 ; N carriagereturn ; B 15 -16 602 629 ;
-C 192 ; WX 823 ; N aleph ; B 175 -18 661 658 ;
-C 193 ; WX 686 ; N Ifraktur ; B 10 -53 578 740 ;
-C 194 ; WX 795 ; N Rfraktur ; B 26 -15 759 734 ;
-C 195 ; WX 987 ; N weierstrass ; B 159 -211 870 573 ;
-C 196 ; WX 768 ; N circlemultiply ; B 43 -17 733 673 ;
-C 197 ; WX 768 ; N circleplus ; B 43 -15 733 675 ;
-C 198 ; WX 823 ; N emptyset ; B 39 -24 781 719 ;
-C 199 ; WX 768 ; N intersection ; B 40 0 732 509 ;
-C 200 ; WX 768 ; N union ; B 40 -17 732 492 ;
-C 201 ; WX 713 ; N propersuperset ; B 20 0 673 470 ;
-C 202 ; WX 713 ; N reflexsuperset ; B 20 -125 673 470 ;
-C 203 ; WX 713 ; N notsubset ; B 36 -70 690 540 ;
-C 204 ; WX 713 ; N propersubset ; B 37 0 690 470 ;
-C 205 ; WX 713 ; N reflexsubset ; B 37 -125 690 470 ;
-C 206 ; WX 713 ; N element ; B 45 0 505 468 ;
-C 207 ; WX 713 ; N notelement ; B 45 -58 505 555 ;
-C 208 ; WX 768 ; N angle ; B 26 0 738 673 ;
-C 209 ; WX 713 ; N gradient ; B 36 -19 681 718 ;
-C 210 ; WX 790 ; N registerserif ; B 50 -17 740 673 ;
-C 211 ; WX 790 ; N copyrightserif ; B 51 -15 741 675 ;
-C 212 ; WX 890 ; N trademarkserif ; B 18 293 855 673 ;
-C 213 ; WX 823 ; N product ; B 25 -101 803 751 ;
-C 214 ; WX 549 ; N radical ; B 10 -38 515 917 ;
-C 215 ; WX 250 ; N dotmath ; B 69 210 169 310 ;
-C 216 ; WX 713 ; N logicalnot ; B 15 0 680 288 ;
-C 217 ; WX 603 ; N logicaland ; B 23 0 583 454 ;
-C 218 ; WX 603 ; N logicalor ; B 30 0 578 477 ;
-C 219 ; WX 1042 ; N arrowdblboth ; B 27 -20 1023 510 ;
-C 220 ; WX 987 ; N arrowdblleft ; B 30 -15 939 513 ;
-C 221 ; WX 603 ; N arrowdblup ; B 39 2 567 911 ;
-C 222 ; WX 987 ; N arrowdblright ; B 45 -20 954 508 ;
-C 223 ; WX 603 ; N arrowdbldown ; B 44 -19 572 890 ;
-C 224 ; WX 494 ; N lozenge ; B 18 0 466 745 ;
-C 225 ; WX 329 ; N angleleft ; B 25 -198 306 746 ;
-C 226 ; WX 790 ; N registersans ; B 50 -20 740 670 ;
-C 227 ; WX 790 ; N copyrightsans ; B 49 -15 739 675 ;
-C 228 ; WX 786 ; N trademarksans ; B 5 293 725 673 ;
-C 229 ; WX 713 ; N summation ; B 14 -108 695 752 ;
-C 230 ; WX 384 ; N parenlefttp ; B 40 -293 436 926 ;
-C 231 ; WX 384 ; N parenleftex ; B 40 -85 92 925 ;
-C 232 ; WX 384 ; N parenleftbt ; B 40 -293 436 926 ;
-C 233 ; WX 384 ; N bracketlefttp ; B 0 -80 341 926 ;
-C 234 ; WX 384 ; N bracketleftex ; B 0 -79 55 925 ;
-C 235 ; WX 384 ; N bracketleftbt ; B 0 -80 340 926 ;
-C 236 ; WX 494 ; N bracelefttp ; B 201 -75 439 926 ;
-C 237 ; WX 494 ; N braceleftmid ; B 14 -85 255 935 ;
-C 238 ; WX 494 ; N braceleftbt ; B 201 -70 439 926 ;
-C 239 ; WX 494 ; N braceex ; B 201 -80 255 935 ;
-C 241 ; WX 329 ; N angleright ; B 21 -198 302 746 ;
-C 242 ; WX 274 ; N integral ; B 2 -107 291 916 ;
-C 243 ; WX 686 ; N integraltp ; B 332 -83 715 921 ;
-C 244 ; WX 686 ; N integralex ; B 332 -88 415 975 ;
-C 245 ; WX 686 ; N integralbt ; B 39 -81 415 921 ;
-C 246 ; WX 384 ; N parenrighttp ; B 54 -293 450 926 ;
-C 247 ; WX 384 ; N parenrightex ; B 398 -85 450 925 ;
-C 248 ; WX 384 ; N parenrightbt ; B 54 -293 450 926 ;
-C 249 ; WX 384 ; N bracketrighttp ; B 22 -80 360 926 ;
-C 250 ; WX 384 ; N bracketrightex ; B 305 -79 360 925 ;
-C 251 ; WX 384 ; N bracketrightbt ; B 20 -80 360 926 ;
-C 252 ; WX 494 ; N bracerighttp ; B 17 -75 255 926 ;
-C 253 ; WX 494 ; N bracerightmid ; B 201 -85 442 935 ;
-C 254 ; WX 494 ; N bracerightbt ; B 17 -70 255 926 ;
-C -1 ; WX 790 ; N apple ; B 56 -3 733 808 ;
-EndCharMetrics
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Times-Bold.afm b/blt3.0.1/library/afm/Times-Bold.afm
deleted file mode 100644
index 6ee7ef6..0000000
--- a/blt3.0.1/library/afm/Times-Bold.afm
+++ /dev/null
@@ -1,649 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Tue Mar 20 12:17:14 1990
-Comment UniqueID 28417
-Comment VMusage 30458 37350
-FontName Times-Bold
-FullName Times Bold
-FamilyName Times
-Weight Bold
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -168 -218 1000 935
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Times is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 676
-XHeight 461
-Ascender 676
-Descender -205
-StartCharMetrics 228
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 81 -13 251 691 ;
-C 34 ; WX 555 ; N quotedbl ; B 83 404 472 691 ;
-C 35 ; WX 500 ; N numbersign ; B 4 0 496 700 ;
-C 36 ; WX 500 ; N dollar ; B 29 -99 472 750 ;
-C 37 ; WX 1000 ; N percent ; B 124 -14 877 692 ;
-C 38 ; WX 833 ; N ampersand ; B 62 -16 787 691 ;
-C 39 ; WX 333 ; N quoteright ; B 79 356 263 691 ;
-C 40 ; WX 333 ; N parenleft ; B 46 -168 306 694 ;
-C 41 ; WX 333 ; N parenright ; B 27 -168 287 694 ;
-C 42 ; WX 500 ; N asterisk ; B 56 255 447 691 ;
-C 43 ; WX 570 ; N plus ; B 33 0 537 506 ;
-C 44 ; WX 250 ; N comma ; B 39 -180 223 155 ;
-C 45 ; WX 333 ; N hyphen ; B 44 171 287 287 ;
-C 46 ; WX 250 ; N period ; B 41 -13 210 156 ;
-C 47 ; WX 278 ; N slash ; B -24 -19 302 691 ;
-C 48 ; WX 500 ; N zero ; B 24 -13 476 688 ;
-C 49 ; WX 500 ; N one ; B 65 0 442 688 ;
-C 50 ; WX 500 ; N two ; B 17 0 478 688 ;
-C 51 ; WX 500 ; N three ; B 16 -14 468 688 ;
-C 52 ; WX 500 ; N four ; B 19 0 475 688 ;
-C 53 ; WX 500 ; N five ; B 22 -8 470 676 ;
-C 54 ; WX 500 ; N six ; B 28 -13 475 688 ;
-C 55 ; WX 500 ; N seven ; B 17 0 477 676 ;
-C 56 ; WX 500 ; N eight ; B 28 -13 472 688 ;
-C 57 ; WX 500 ; N nine ; B 26 -13 473 688 ;
-C 58 ; WX 333 ; N colon ; B 82 -13 251 472 ;
-C 59 ; WX 333 ; N semicolon ; B 82 -180 266 472 ;
-C 60 ; WX 570 ; N less ; B 31 -8 539 514 ;
-C 61 ; WX 570 ; N equal ; B 33 107 537 399 ;
-C 62 ; WX 570 ; N greater ; B 31 -8 539 514 ;
-C 63 ; WX 500 ; N question ; B 57 -13 445 689 ;
-C 64 ; WX 930 ; N at ; B 108 -19 822 691 ;
-C 65 ; WX 722 ; N A ; B 9 0 689 690 ;
-C 66 ; WX 667 ; N B ; B 16 0 619 676 ;
-C 67 ; WX 722 ; N C ; B 49 -19 687 691 ;
-C 68 ; WX 722 ; N D ; B 14 0 690 676 ;
-C 69 ; WX 667 ; N E ; B 16 0 641 676 ;
-C 70 ; WX 611 ; N F ; B 16 0 583 676 ;
-C 71 ; WX 778 ; N G ; B 37 -19 755 691 ;
-C 72 ; WX 778 ; N H ; B 21 0 759 676 ;
-C 73 ; WX 389 ; N I ; B 20 0 370 676 ;
-C 74 ; WX 500 ; N J ; B 3 -96 479 676 ;
-C 75 ; WX 778 ; N K ; B 30 0 769 676 ;
-C 76 ; WX 667 ; N L ; B 19 0 638 676 ;
-C 77 ; WX 944 ; N M ; B 14 0 921 676 ;
-C 78 ; WX 722 ; N N ; B 16 -18 701 676 ;
-C 79 ; WX 778 ; N O ; B 35 -19 743 691 ;
-C 80 ; WX 611 ; N P ; B 16 0 600 676 ;
-C 81 ; WX 778 ; N Q ; B 35 -176 743 691 ;
-C 82 ; WX 722 ; N R ; B 26 0 715 676 ;
-C 83 ; WX 556 ; N S ; B 35 -19 513 692 ;
-C 84 ; WX 667 ; N T ; B 31 0 636 676 ;
-C 85 ; WX 722 ; N U ; B 16 -19 701 676 ;
-C 86 ; WX 722 ; N V ; B 16 -18 701 676 ;
-C 87 ; WX 1000 ; N W ; B 19 -15 981 676 ;
-C 88 ; WX 722 ; N X ; B 16 0 699 676 ;
-C 89 ; WX 722 ; N Y ; B 15 0 699 676 ;
-C 90 ; WX 667 ; N Z ; B 28 0 634 676 ;
-C 91 ; WX 333 ; N bracketleft ; B 67 -149 301 678 ;
-C 92 ; WX 278 ; N backslash ; B -25 -19 303 691 ;
-C 93 ; WX 333 ; N bracketright ; B 32 -149 266 678 ;
-C 94 ; WX 581 ; N asciicircum ; B 73 311 509 676 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 333 ; N quoteleft ; B 70 356 254 691 ;
-C 97 ; WX 500 ; N a ; B 25 -14 488 473 ;
-C 98 ; WX 556 ; N b ; B 17 -14 521 676 ;
-C 99 ; WX 444 ; N c ; B 25 -14 430 473 ;
-C 100 ; WX 556 ; N d ; B 25 -14 534 676 ;
-C 101 ; WX 444 ; N e ; B 25 -14 426 473 ;
-C 102 ; WX 333 ; N f ; B 14 0 389 691 ; L i fi ; L l fl ;
-C 103 ; WX 500 ; N g ; B 28 -206 483 473 ;
-C 104 ; WX 556 ; N h ; B 16 0 534 676 ;
-C 105 ; WX 278 ; N i ; B 16 0 255 691 ;
-C 106 ; WX 333 ; N j ; B -57 -203 263 691 ;
-C 107 ; WX 556 ; N k ; B 22 0 543 676 ;
-C 108 ; WX 278 ; N l ; B 16 0 255 676 ;
-C 109 ; WX 833 ; N m ; B 16 0 814 473 ;
-C 110 ; WX 556 ; N n ; B 21 0 539 473 ;
-C 111 ; WX 500 ; N o ; B 25 -14 476 473 ;
-C 112 ; WX 556 ; N p ; B 19 -205 524 473 ;
-C 113 ; WX 556 ; N q ; B 34 -205 536 473 ;
-C 114 ; WX 444 ; N r ; B 29 0 434 473 ;
-C 115 ; WX 389 ; N s ; B 25 -14 361 473 ;
-C 116 ; WX 333 ; N t ; B 20 -12 332 630 ;
-C 117 ; WX 556 ; N u ; B 16 -14 537 461 ;
-C 118 ; WX 500 ; N v ; B 21 -14 485 461 ;
-C 119 ; WX 722 ; N w ; B 23 -14 707 461 ;
-C 120 ; WX 500 ; N x ; B 12 0 484 461 ;
-C 121 ; WX 500 ; N y ; B 16 -205 480 461 ;
-C 122 ; WX 444 ; N z ; B 21 0 420 461 ;
-C 123 ; WX 394 ; N braceleft ; B 22 -175 340 698 ;
-C 124 ; WX 220 ; N bar ; B 66 -19 154 691 ;
-C 125 ; WX 394 ; N braceright ; B 54 -175 372 698 ;
-C 126 ; WX 520 ; N asciitilde ; B 29 173 491 333 ;
-C 161 ; WX 333 ; N exclamdown ; B 82 -203 252 501 ;
-C 162 ; WX 500 ; N cent ; B 53 -140 458 588 ;
-C 163 ; WX 500 ; N sterling ; B 21 -14 477 684 ;
-C 164 ; WX 167 ; N fraction ; B -168 -12 329 688 ;
-C 165 ; WX 500 ; N yen ; B -64 0 547 676 ;
-C 166 ; WX 500 ; N florin ; B 0 -155 498 706 ;
-C 167 ; WX 500 ; N section ; B 57 -132 443 691 ;
-C 168 ; WX 500 ; N currency ; B -26 61 526 613 ;
-C 169 ; WX 278 ; N quotesingle ; B 75 404 204 691 ;
-C 170 ; WX 500 ; N quotedblleft ; B 32 356 486 691 ;
-C 171 ; WX 500 ; N guillemotleft ; B 23 36 473 415 ;
-C 172 ; WX 333 ; N guilsinglleft ; B 51 36 305 415 ;
-C 173 ; WX 333 ; N guilsinglright ; B 28 36 282 415 ;
-C 174 ; WX 556 ; N fi ; B 14 0 536 691 ;
-C 175 ; WX 556 ; N fl ; B 14 0 536 691 ;
-C 177 ; WX 500 ; N endash ; B 0 181 500 271 ;
-C 178 ; WX 500 ; N dagger ; B 47 -134 453 691 ;
-C 179 ; WX 500 ; N daggerdbl ; B 45 -132 456 691 ;
-C 180 ; WX 250 ; N periodcentered ; B 41 248 210 417 ;
-C 182 ; WX 540 ; N paragraph ; B 0 -186 519 676 ;
-C 183 ; WX 350 ; N bullet ; B 35 198 315 478 ;
-C 184 ; WX 333 ; N quotesinglbase ; B 79 -180 263 155 ;
-C 185 ; WX 500 ; N quotedblbase ; B 14 -180 468 155 ;
-C 186 ; WX 500 ; N quotedblright ; B 14 356 468 691 ;
-C 187 ; WX 500 ; N guillemotright ; B 27 36 477 415 ;
-C 188 ; WX 1000 ; N ellipsis ; B 82 -13 917 156 ;
-C 189 ; WX 1000 ; N perthousand ; B 7 -29 995 706 ;
-C 191 ; WX 500 ; N questiondown ; B 55 -201 443 501 ;
-C 193 ; WX 333 ; N grave ; B 8 528 246 713 ;
-C 194 ; WX 333 ; N acute ; B 86 528 324 713 ;
-C 195 ; WX 333 ; N circumflex ; B -2 528 335 704 ;
-C 196 ; WX 333 ; N tilde ; B -16 547 349 674 ;
-C 197 ; WX 333 ; N macron ; B 1 565 331 637 ;
-C 198 ; WX 333 ; N breve ; B 15 528 318 691 ;
-C 199 ; WX 333 ; N dotaccent ; B 103 537 230 667 ;
-C 200 ; WX 333 ; N dieresis ; B -2 537 335 667 ;
-C 202 ; WX 333 ; N ring ; B 60 527 273 740 ;
-C 203 ; WX 333 ; N cedilla ; B 68 -218 294 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B -13 528 425 713 ;
-C 206 ; WX 333 ; N ogonek ; B 90 -173 319 44 ;
-C 207 ; WX 333 ; N caron ; B -2 528 335 704 ;
-C 208 ; WX 1000 ; N emdash ; B 0 181 1000 271 ;
-C 225 ; WX 1000 ; N AE ; B 4 0 951 676 ;
-C 227 ; WX 300 ; N ordfeminine ; B -1 397 301 688 ;
-C 232 ; WX 667 ; N Lslash ; B 19 0 638 676 ;
-C 233 ; WX 778 ; N Oslash ; B 35 -74 743 737 ;
-C 234 ; WX 1000 ; N OE ; B 22 -5 981 684 ;
-C 235 ; WX 330 ; N ordmasculine ; B 18 397 312 688 ;
-C 241 ; WX 722 ; N ae ; B 33 -14 693 473 ;
-C 245 ; WX 278 ; N dotlessi ; B 16 0 255 461 ;
-C 248 ; WX 278 ; N lslash ; B -22 0 303 676 ;
-C 249 ; WX 500 ; N oslash ; B 25 -92 476 549 ;
-C 250 ; WX 722 ; N oe ; B 22 -14 696 473 ;
-C 251 ; WX 556 ; N germandbls ; B 19 -12 517 691 ;
-C -1 ; WX 667 ; N Zcaron ; B 28 0 634 914 ;
-C -1 ; WX 444 ; N ccedilla ; B 25 -218 430 473 ;
-C -1 ; WX 500 ; N ydieresis ; B 16 -205 480 667 ;
-C -1 ; WX 500 ; N atilde ; B 25 -14 488 674 ;
-C -1 ; WX 278 ; N icircumflex ; B -36 0 301 704 ;
-C -1 ; WX 300 ; N threesuperior ; B 3 268 297 688 ;
-C -1 ; WX 444 ; N ecircumflex ; B 25 -14 426 704 ;
-C -1 ; WX 556 ; N thorn ; B 19 -205 524 676 ;
-C -1 ; WX 444 ; N egrave ; B 25 -14 426 713 ;
-C -1 ; WX 300 ; N twosuperior ; B 0 275 300 688 ;
-C -1 ; WX 444 ; N eacute ; B 25 -14 426 713 ;
-C -1 ; WX 500 ; N otilde ; B 25 -14 476 674 ;
-C -1 ; WX 722 ; N Aacute ; B 9 0 689 923 ;
-C -1 ; WX 500 ; N ocircumflex ; B 25 -14 476 704 ;
-C -1 ; WX 500 ; N yacute ; B 16 -205 480 713 ;
-C -1 ; WX 556 ; N udieresis ; B 16 -14 537 667 ;
-C -1 ; WX 750 ; N threequarters ; B 23 -12 733 688 ;
-C -1 ; WX 500 ; N acircumflex ; B 25 -14 488 704 ;
-C -1 ; WX 722 ; N Eth ; B 6 0 690 676 ;
-C -1 ; WX 444 ; N edieresis ; B 25 -14 426 667 ;
-C -1 ; WX 556 ; N ugrave ; B 16 -14 537 713 ;
-C -1 ; WX 1000 ; N trademark ; B 24 271 977 676 ;
-C -1 ; WX 500 ; N ograve ; B 25 -14 476 713 ;
-C -1 ; WX 389 ; N scaron ; B 25 -14 363 704 ;
-C -1 ; WX 389 ; N Idieresis ; B 20 0 370 877 ;
-C -1 ; WX 556 ; N uacute ; B 16 -14 537 713 ;
-C -1 ; WX 500 ; N agrave ; B 25 -14 488 713 ;
-C -1 ; WX 556 ; N ntilde ; B 21 0 539 674 ;
-C -1 ; WX 500 ; N aring ; B 25 -14 488 740 ;
-C -1 ; WX 444 ; N zcaron ; B 21 0 420 704 ;
-C -1 ; WX 389 ; N Icircumflex ; B 20 0 370 914 ;
-C -1 ; WX 722 ; N Ntilde ; B 16 -18 701 884 ;
-C -1 ; WX 556 ; N ucircumflex ; B 16 -14 537 704 ;
-C -1 ; WX 667 ; N Ecircumflex ; B 16 0 641 914 ;
-C -1 ; WX 389 ; N Iacute ; B 20 0 370 923 ;
-C -1 ; WX 722 ; N Ccedilla ; B 49 -218 687 691 ;
-C -1 ; WX 778 ; N Odieresis ; B 35 -19 743 877 ;
-C -1 ; WX 556 ; N Scaron ; B 35 -19 513 914 ;
-C -1 ; WX 667 ; N Edieresis ; B 16 0 641 877 ;
-C -1 ; WX 389 ; N Igrave ; B 20 0 370 923 ;
-C -1 ; WX 500 ; N adieresis ; B 25 -14 488 667 ;
-C -1 ; WX 778 ; N Ograve ; B 35 -19 743 923 ;
-C -1 ; WX 667 ; N Egrave ; B 16 0 641 923 ;
-C -1 ; WX 722 ; N Ydieresis ; B 15 0 699 877 ;
-C -1 ; WX 747 ; N registered ; B 26 -19 721 691 ;
-C -1 ; WX 778 ; N Otilde ; B 35 -19 743 884 ;
-C -1 ; WX 750 ; N onequarter ; B 28 -12 743 688 ;
-C -1 ; WX 722 ; N Ugrave ; B 16 -19 701 923 ;
-C -1 ; WX 722 ; N Ucircumflex ; B 16 -19 701 914 ;
-C -1 ; WX 611 ; N Thorn ; B 16 0 600 676 ;
-C -1 ; WX 570 ; N divide ; B 33 -31 537 537 ;
-C -1 ; WX 722 ; N Atilde ; B 9 0 689 884 ;
-C -1 ; WX 722 ; N Uacute ; B 16 -19 701 923 ;
-C -1 ; WX 778 ; N Ocircumflex ; B 35 -19 743 914 ;
-C -1 ; WX 570 ; N logicalnot ; B 33 108 537 399 ;
-C -1 ; WX 722 ; N Aring ; B 9 0 689 935 ;
-C -1 ; WX 278 ; N idieresis ; B -36 0 301 667 ;
-C -1 ; WX 278 ; N iacute ; B 16 0 290 713 ;
-C -1 ; WX 500 ; N aacute ; B 25 -14 488 713 ;
-C -1 ; WX 570 ; N plusminus ; B 33 0 537 506 ;
-C -1 ; WX 570 ; N multiply ; B 48 16 522 490 ;
-C -1 ; WX 722 ; N Udieresis ; B 16 -19 701 877 ;
-C -1 ; WX 570 ; N minus ; B 33 209 537 297 ;
-C -1 ; WX 300 ; N onesuperior ; B 28 275 273 688 ;
-C -1 ; WX 667 ; N Eacute ; B 16 0 641 923 ;
-C -1 ; WX 722 ; N Acircumflex ; B 9 0 689 914 ;
-C -1 ; WX 747 ; N copyright ; B 26 -19 721 691 ;
-C -1 ; WX 722 ; N Agrave ; B 9 0 689 923 ;
-C -1 ; WX 500 ; N odieresis ; B 25 -14 476 667 ;
-C -1 ; WX 500 ; N oacute ; B 25 -14 476 713 ;
-C -1 ; WX 400 ; N degree ; B 57 402 343 688 ;
-C -1 ; WX 278 ; N igrave ; B -26 0 255 713 ;
-C -1 ; WX 556 ; N mu ; B 33 -206 536 461 ;
-C -1 ; WX 778 ; N Oacute ; B 35 -19 743 923 ;
-C -1 ; WX 500 ; N eth ; B 25 -14 476 691 ;
-C -1 ; WX 722 ; N Adieresis ; B 9 0 689 877 ;
-C -1 ; WX 722 ; N Yacute ; B 15 0 699 928 ;
-C -1 ; WX 220 ; N brokenbar ; B 66 -19 154 691 ;
-C -1 ; WX 750 ; N onehalf ; B -7 -12 775 688 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 283
-
-KPX A y -74
-KPX A w -90
-KPX A v -100
-KPX A u -50
-KPX A quoteright -74
-KPX A quotedblright 0
-KPX A p -25
-KPX A Y -100
-KPX A W -130
-KPX A V -145
-KPX A U -50
-KPX A T -95
-KPX A Q -45
-KPX A O -45
-KPX A G -55
-KPX A C -55
-
-KPX B period 0
-KPX B comma 0
-KPX B U -10
-KPX B A -30
-
-KPX D period -20
-KPX D comma 0
-KPX D Y -40
-KPX D W -40
-KPX D V -40
-KPX D A -35
-
-KPX F r 0
-KPX F period -110
-KPX F o -25
-KPX F i 0
-KPX F e -25
-KPX F comma -92
-KPX F a -25
-KPX F A -90
-
-KPX G period 0
-KPX G comma 0
-
-KPX J u -15
-KPX J period -20
-KPX J o -15
-KPX J e -15
-KPX J comma 0
-KPX J a -15
-KPX J A -30
-
-KPX K y -45
-KPX K u -15
-KPX K o -25
-KPX K e -25
-KPX K O -30
-
-KPX L y -55
-KPX L quoteright -110
-KPX L quotedblright -20
-KPX L Y -92
-KPX L W -92
-KPX L V -92
-KPX L T -92
-
-KPX N period 0
-KPX N comma 0
-KPX N A -20
-
-KPX O period 0
-KPX O comma 0
-KPX O Y -50
-KPX O X -40
-KPX O W -50
-KPX O V -50
-KPX O T -40
-KPX O A -40
-
-KPX P period -110
-KPX P o -20
-KPX P e -20
-KPX P comma -92
-KPX P a -10
-KPX P A -74
-
-KPX Q period -20
-KPX Q comma 0
-KPX Q U -10
-
-KPX R Y -35
-KPX R W -35
-KPX R V -55
-KPX R U -30
-KPX R T -40
-KPX R O -30
-
-KPX S period 0
-KPX S comma 0
-
-KPX T y -74
-KPX T w -74
-KPX T u -92
-KPX T semicolon -74
-KPX T r -74
-KPX T period -90
-KPX T o -92
-KPX T i -18
-KPX T hyphen -92
-KPX T h 0
-KPX T e -92
-KPX T comma -74
-KPX T colon -74
-KPX T a -92
-KPX T O -18
-KPX T A -90
-
-KPX U period -50
-KPX U comma -50
-KPX U A -60
-
-KPX V u -92
-KPX V semicolon -92
-KPX V period -145
-KPX V o -100
-KPX V i -37
-KPX V hyphen -74
-KPX V e -100
-KPX V comma -129
-KPX V colon -92
-KPX V a -92
-KPX V O -45
-KPX V G -30
-KPX V A -135
-
-KPX W y -60
-KPX W u -50
-KPX W semicolon -55
-KPX W period -92
-KPX W o -75
-KPX W i -18
-KPX W hyphen -37
-KPX W h 0
-KPX W e -65
-KPX W comma -92
-KPX W colon -55
-KPX W a -65
-KPX W O -10
-KPX W A -120
-
-KPX Y u -92
-KPX Y semicolon -92
-KPX Y period -92
-KPX Y o -111
-KPX Y i -37
-KPX Y hyphen -92
-KPX Y e -111
-KPX Y comma -92
-KPX Y colon -92
-KPX Y a -85
-KPX Y O -35
-KPX Y A -110
-
-KPX a y 0
-KPX a w 0
-KPX a v -25
-KPX a t 0
-KPX a p 0
-KPX a g 0
-KPX a b 0
-
-KPX b y 0
-KPX b v -15
-KPX b u -20
-KPX b period -40
-KPX b l 0
-KPX b comma 0
-KPX b b -10
-
-KPX c y 0
-KPX c period 0
-KPX c l 0
-KPX c k 0
-KPX c h 0
-KPX c comma 0
-
-KPX colon space 0
-
-KPX comma space 0
-KPX comma quoteright -55
-KPX comma quotedblright -45
-
-KPX d y 0
-KPX d w -15
-KPX d v 0
-KPX d period 0
-KPX d d 0
-KPX d comma 0
-
-KPX e y 0
-KPX e x 0
-KPX e w 0
-KPX e v -15
-KPX e period 0
-KPX e p 0
-KPX e g 0
-KPX e comma 0
-KPX e b 0
-
-KPX f quoteright 55
-KPX f quotedblright 50
-KPX f period -15
-KPX f o -25
-KPX f l 0
-KPX f i -25
-KPX f f 0
-KPX f e 0
-KPX f dotlessi -35
-KPX f comma -15
-KPX f a 0
-
-KPX g y 0
-KPX g r 0
-KPX g period -15
-KPX g o 0
-KPX g i 0
-KPX g g 0
-KPX g e 0
-KPX g comma 0
-KPX g a 0
-
-KPX h y -15
-
-KPX i v -10
-
-KPX k y -15
-KPX k o -15
-KPX k e -10
-
-KPX l y 0
-KPX l w 0
-
-KPX m y 0
-KPX m u 0
-
-KPX n y 0
-KPX n v -40
-KPX n u 0
-
-KPX o y 0
-KPX o x 0
-KPX o w -10
-KPX o v -10
-KPX o g 0
-
-KPX p y 0
-
-KPX period quoteright -55
-KPX period quotedblright -55
-
-KPX quotedblleft quoteleft 0
-KPX quotedblleft A -10
-
-KPX quotedblright space 0
-
-KPX quoteleft quoteleft -63
-KPX quoteleft A -10
-
-KPX quoteright v -20
-KPX quoteright t 0
-KPX quoteright space -74
-KPX quoteright s -37
-KPX quoteright r -20
-KPX quoteright quoteright -63
-KPX quoteright quotedblright 0
-KPX quoteright l 0
-KPX quoteright d -20
-
-KPX r y 0
-KPX r v -10
-KPX r u 0
-KPX r t 0
-KPX r s 0
-KPX r r 0
-KPX r q -18
-KPX r period -100
-KPX r p -10
-KPX r o -18
-KPX r n -15
-KPX r m 0
-KPX r l 0
-KPX r k 0
-KPX r i 0
-KPX r hyphen -37
-KPX r g -10
-KPX r e -18
-KPX r d 0
-KPX r comma -92
-KPX r c -18
-KPX r a 0
-
-KPX s w 0
-
-KPX space quoteleft 0
-KPX space quotedblleft 0
-KPX space Y -55
-KPX space W -30
-KPX space V -45
-KPX space T -30
-KPX space A -55
-
-KPX v period -70
-KPX v o -10
-KPX v e -10
-KPX v comma -55
-KPX v a -10
-
-KPX w period -70
-KPX w o -10
-KPX w h 0
-KPX w e 0
-KPX w comma -55
-KPX w a 0
-
-KPX x e 0
-
-KPX y period -70
-KPX y o -25
-KPX y e -10
-KPX y comma -55
-KPX y a 0
-
-KPX z o 0
-KPX z e 0
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 188 210 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 188 210 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 188 210 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 188 210 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 180 195 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 188 210 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 208 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 174 210 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 174 210 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 174 210 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 174 210 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 28 210 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 28 210 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 28 210 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 28 210 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 195 210 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 223 210 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 223 210 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 223 210 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 223 210 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 223 210 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 112 210 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 222 210 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 222 210 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 222 210 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 222 210 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 210 215 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 215 210 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 167 210 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 77 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 77 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 77 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 77 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 77 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 77 0 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 69 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 62 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 62 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 62 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 62 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -34 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -34 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -34 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -34 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 112 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 28 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 105 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 105 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 105 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 105 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 84 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 56 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Times-BoldItalic.afm b/blt3.0.1/library/afm/Times-BoldItalic.afm
deleted file mode 100644
index d329ebb..0000000
--- a/blt3.0.1/library/afm/Times-BoldItalic.afm
+++ /dev/null
@@ -1,649 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Tue Mar 20 13:14:55 1990
-Comment UniqueID 28425
-Comment VMusage 32721 39613
-FontName Times-BoldItalic
-FullName Times Bold Italic
-FamilyName Times
-Weight Bold
-ItalicAngle -15
-IsFixedPitch false
-FontBBox -200 -218 996 921
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.009
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Times is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 669
-XHeight 462
-Ascender 699
-Descender -205
-StartCharMetrics 228
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 389 ; N exclam ; B 67 -13 370 684 ;
-C 34 ; WX 555 ; N quotedbl ; B 136 398 536 685 ;
-C 35 ; WX 500 ; N numbersign ; B -33 0 533 700 ;
-C 36 ; WX 500 ; N dollar ; B -20 -100 497 733 ;
-C 37 ; WX 833 ; N percent ; B 39 -10 793 692 ;
-C 38 ; WX 778 ; N ampersand ; B 5 -19 699 682 ;
-C 39 ; WX 333 ; N quoteright ; B 98 369 302 685 ;
-C 40 ; WX 333 ; N parenleft ; B 28 -179 344 685 ;
-C 41 ; WX 333 ; N parenright ; B -44 -179 271 685 ;
-C 42 ; WX 500 ; N asterisk ; B 65 249 456 685 ;
-C 43 ; WX 570 ; N plus ; B 33 0 537 506 ;
-C 44 ; WX 250 ; N comma ; B -60 -182 144 134 ;
-C 45 ; WX 333 ; N hyphen ; B 2 166 271 282 ;
-C 46 ; WX 250 ; N period ; B -9 -13 139 135 ;
-C 47 ; WX 278 ; N slash ; B -64 -18 342 685 ;
-C 48 ; WX 500 ; N zero ; B 17 -14 477 683 ;
-C 49 ; WX 500 ; N one ; B 5 0 419 683 ;
-C 50 ; WX 500 ; N two ; B -27 0 446 683 ;
-C 51 ; WX 500 ; N three ; B -15 -13 450 683 ;
-C 52 ; WX 500 ; N four ; B -15 0 503 683 ;
-C 53 ; WX 500 ; N five ; B -11 -13 487 669 ;
-C 54 ; WX 500 ; N six ; B 23 -15 509 679 ;
-C 55 ; WX 500 ; N seven ; B 52 0 525 669 ;
-C 56 ; WX 500 ; N eight ; B 3 -13 476 683 ;
-C 57 ; WX 500 ; N nine ; B -12 -10 475 683 ;
-C 58 ; WX 333 ; N colon ; B 23 -13 264 459 ;
-C 59 ; WX 333 ; N semicolon ; B -25 -183 264 459 ;
-C 60 ; WX 570 ; N less ; B 31 -8 539 514 ;
-C 61 ; WX 570 ; N equal ; B 33 107 537 399 ;
-C 62 ; WX 570 ; N greater ; B 31 -8 539 514 ;
-C 63 ; WX 500 ; N question ; B 79 -13 470 684 ;
-C 64 ; WX 832 ; N at ; B 63 -18 770 685 ;
-C 65 ; WX 667 ; N A ; B -67 0 593 683 ;
-C 66 ; WX 667 ; N B ; B -24 0 624 669 ;
-C 67 ; WX 667 ; N C ; B 32 -18 677 685 ;
-C 68 ; WX 722 ; N D ; B -46 0 685 669 ;
-C 69 ; WX 667 ; N E ; B -27 0 653 669 ;
-C 70 ; WX 667 ; N F ; B -13 0 660 669 ;
-C 71 ; WX 722 ; N G ; B 21 -18 706 685 ;
-C 72 ; WX 778 ; N H ; B -24 0 799 669 ;
-C 73 ; WX 389 ; N I ; B -32 0 406 669 ;
-C 74 ; WX 500 ; N J ; B -46 -99 524 669 ;
-C 75 ; WX 667 ; N K ; B -21 0 702 669 ;
-C 76 ; WX 611 ; N L ; B -22 0 590 669 ;
-C 77 ; WX 889 ; N M ; B -29 -12 917 669 ;
-C 78 ; WX 722 ; N N ; B -27 -15 748 669 ;
-C 79 ; WX 722 ; N O ; B 27 -18 691 685 ;
-C 80 ; WX 611 ; N P ; B -27 0 613 669 ;
-C 81 ; WX 722 ; N Q ; B 27 -208 691 685 ;
-C 82 ; WX 667 ; N R ; B -29 0 623 669 ;
-C 83 ; WX 556 ; N S ; B 2 -18 526 685 ;
-C 84 ; WX 611 ; N T ; B 50 0 650 669 ;
-C 85 ; WX 722 ; N U ; B 67 -18 744 669 ;
-C 86 ; WX 667 ; N V ; B 65 -18 715 669 ;
-C 87 ; WX 889 ; N W ; B 65 -18 940 669 ;
-C 88 ; WX 667 ; N X ; B -24 0 694 669 ;
-C 89 ; WX 611 ; N Y ; B 73 0 659 669 ;
-C 90 ; WX 611 ; N Z ; B -11 0 590 669 ;
-C 91 ; WX 333 ; N bracketleft ; B -37 -159 362 674 ;
-C 92 ; WX 278 ; N backslash ; B -1 -18 279 685 ;
-C 93 ; WX 333 ; N bracketright ; B -56 -157 343 674 ;
-C 94 ; WX 570 ; N asciicircum ; B 67 304 503 669 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 333 ; N quoteleft ; B 128 369 332 685 ;
-C 97 ; WX 500 ; N a ; B -21 -14 455 462 ;
-C 98 ; WX 500 ; N b ; B -14 -13 444 699 ;
-C 99 ; WX 444 ; N c ; B -5 -13 392 462 ;
-C 100 ; WX 500 ; N d ; B -21 -13 517 699 ;
-C 101 ; WX 444 ; N e ; B 5 -13 398 462 ;
-C 102 ; WX 333 ; N f ; B -169 -205 446 698 ; L i fi ; L l fl ;
-C 103 ; WX 500 ; N g ; B -52 -203 478 462 ;
-C 104 ; WX 556 ; N h ; B -13 -9 498 699 ;
-C 105 ; WX 278 ; N i ; B 2 -9 263 684 ;
-C 106 ; WX 278 ; N j ; B -189 -207 279 684 ;
-C 107 ; WX 500 ; N k ; B -23 -8 483 699 ;
-C 108 ; WX 278 ; N l ; B 2 -9 290 699 ;
-C 109 ; WX 778 ; N m ; B -14 -9 722 462 ;
-C 110 ; WX 556 ; N n ; B -6 -9 493 462 ;
-C 111 ; WX 500 ; N o ; B -3 -13 441 462 ;
-C 112 ; WX 500 ; N p ; B -120 -205 446 462 ;
-C 113 ; WX 500 ; N q ; B 1 -205 471 462 ;
-C 114 ; WX 389 ; N r ; B -21 0 389 462 ;
-C 115 ; WX 389 ; N s ; B -19 -13 333 462 ;
-C 116 ; WX 278 ; N t ; B -11 -9 281 594 ;
-C 117 ; WX 556 ; N u ; B 15 -9 492 462 ;
-C 118 ; WX 444 ; N v ; B 16 -13 401 462 ;
-C 119 ; WX 667 ; N w ; B 16 -13 614 462 ;
-C 120 ; WX 500 ; N x ; B -46 -13 469 462 ;
-C 121 ; WX 444 ; N y ; B -94 -205 392 462 ;
-C 122 ; WX 389 ; N z ; B -43 -78 368 449 ;
-C 123 ; WX 348 ; N braceleft ; B 5 -187 436 686 ;
-C 124 ; WX 220 ; N bar ; B 66 -18 154 685 ;
-C 125 ; WX 348 ; N braceright ; B -129 -187 302 686 ;
-C 126 ; WX 570 ; N asciitilde ; B 54 173 516 333 ;
-C 161 ; WX 389 ; N exclamdown ; B 19 -205 322 492 ;
-C 162 ; WX 500 ; N cent ; B 42 -143 439 576 ;
-C 163 ; WX 500 ; N sterling ; B -32 -12 510 683 ;
-C 164 ; WX 167 ; N fraction ; B -169 -14 324 683 ;
-C 165 ; WX 500 ; N yen ; B 33 0 628 669 ;
-C 166 ; WX 500 ; N florin ; B -87 -156 537 707 ;
-C 167 ; WX 500 ; N section ; B 36 -143 459 685 ;
-C 168 ; WX 500 ; N currency ; B -26 34 526 586 ;
-C 169 ; WX 278 ; N quotesingle ; B 128 398 268 685 ;
-C 170 ; WX 500 ; N quotedblleft ; B 53 369 513 685 ;
-C 171 ; WX 500 ; N guillemotleft ; B 12 32 468 415 ;
-C 172 ; WX 333 ; N guilsinglleft ; B 32 32 303 415 ;
-C 173 ; WX 333 ; N guilsinglright ; B 10 32 281 415 ;
-C 174 ; WX 556 ; N fi ; B -188 -205 514 703 ;
-C 175 ; WX 556 ; N fl ; B -186 -205 553 704 ;
-C 177 ; WX 500 ; N endash ; B -40 178 477 269 ;
-C 178 ; WX 500 ; N dagger ; B 91 -145 494 685 ;
-C 179 ; WX 500 ; N daggerdbl ; B 10 -139 493 685 ;
-C 180 ; WX 250 ; N periodcentered ; B 51 257 199 405 ;
-C 182 ; WX 500 ; N paragraph ; B -57 -193 562 669 ;
-C 183 ; WX 350 ; N bullet ; B 0 175 350 525 ;
-C 184 ; WX 333 ; N quotesinglbase ; B -5 -182 199 134 ;
-C 185 ; WX 500 ; N quotedblbase ; B -57 -182 403 134 ;
-C 186 ; WX 500 ; N quotedblright ; B 53 369 513 685 ;
-C 187 ; WX 500 ; N guillemotright ; B 12 32 468 415 ;
-C 188 ; WX 1000 ; N ellipsis ; B 40 -13 852 135 ;
-C 189 ; WX 1000 ; N perthousand ; B 7 -29 996 706 ;
-C 191 ; WX 500 ; N questiondown ; B 30 -205 421 492 ;
-C 193 ; WX 333 ; N grave ; B 85 516 297 697 ;
-C 194 ; WX 333 ; N acute ; B 139 516 379 697 ;
-C 195 ; WX 333 ; N circumflex ; B 40 516 367 690 ;
-C 196 ; WX 333 ; N tilde ; B 48 536 407 655 ;
-C 197 ; WX 333 ; N macron ; B 51 553 393 623 ;
-C 198 ; WX 333 ; N breve ; B 71 516 387 678 ;
-C 199 ; WX 333 ; N dotaccent ; B 163 525 293 655 ;
-C 200 ; WX 333 ; N dieresis ; B 55 525 397 655 ;
-C 202 ; WX 333 ; N ring ; B 127 516 340 729 ;
-C 203 ; WX 333 ; N cedilla ; B -80 -218 156 5 ;
-C 205 ; WX 333 ; N hungarumlaut ; B 69 516 498 697 ;
-C 206 ; WX 333 ; N ogonek ; B -40 -173 189 44 ;
-C 207 ; WX 333 ; N caron ; B 79 516 411 690 ;
-C 208 ; WX 1000 ; N emdash ; B -40 178 977 269 ;
-C 225 ; WX 944 ; N AE ; B -64 0 918 669 ;
-C 227 ; WX 266 ; N ordfeminine ; B 16 399 330 685 ;
-C 232 ; WX 611 ; N Lslash ; B -22 0 590 669 ;
-C 233 ; WX 722 ; N Oslash ; B 27 -125 691 764 ;
-C 234 ; WX 944 ; N OE ; B 23 -8 946 677 ;
-C 235 ; WX 300 ; N ordmasculine ; B 56 400 347 685 ;
-C 241 ; WX 722 ; N ae ; B -5 -13 673 462 ;
-C 245 ; WX 278 ; N dotlessi ; B 2 -9 238 462 ;
-C 248 ; WX 278 ; N lslash ; B -13 -9 301 699 ;
-C 249 ; WX 500 ; N oslash ; B -3 -119 441 560 ;
-C 250 ; WX 722 ; N oe ; B 6 -13 674 462 ;
-C 251 ; WX 500 ; N germandbls ; B -200 -200 473 705 ;
-C -1 ; WX 611 ; N Zcaron ; B -11 0 590 897 ;
-C -1 ; WX 444 ; N ccedilla ; B -24 -218 392 462 ;
-C -1 ; WX 444 ; N ydieresis ; B -94 -205 438 655 ;
-C -1 ; WX 500 ; N atilde ; B -21 -14 491 655 ;
-C -1 ; WX 278 ; N icircumflex ; B -2 -9 325 690 ;
-C -1 ; WX 300 ; N threesuperior ; B 17 265 321 683 ;
-C -1 ; WX 444 ; N ecircumflex ; B 5 -13 423 690 ;
-C -1 ; WX 500 ; N thorn ; B -120 -205 446 699 ;
-C -1 ; WX 444 ; N egrave ; B 5 -13 398 697 ;
-C -1 ; WX 300 ; N twosuperior ; B 2 274 313 683 ;
-C -1 ; WX 444 ; N eacute ; B 5 -13 435 697 ;
-C -1 ; WX 500 ; N otilde ; B -3 -13 491 655 ;
-C -1 ; WX 667 ; N Aacute ; B -67 0 593 904 ;
-C -1 ; WX 500 ; N ocircumflex ; B -3 -13 451 690 ;
-C -1 ; WX 444 ; N yacute ; B -94 -205 435 697 ;
-C -1 ; WX 556 ; N udieresis ; B 15 -9 494 655 ;
-C -1 ; WX 750 ; N threequarters ; B 7 -14 726 683 ;
-C -1 ; WX 500 ; N acircumflex ; B -21 -14 455 690 ;
-C -1 ; WX 722 ; N Eth ; B -31 0 700 669 ;
-C -1 ; WX 444 ; N edieresis ; B 5 -13 443 655 ;
-C -1 ; WX 556 ; N ugrave ; B 15 -9 492 697 ;
-C -1 ; WX 1000 ; N trademark ; B 32 263 968 669 ;
-C -1 ; WX 500 ; N ograve ; B -3 -13 441 697 ;
-C -1 ; WX 389 ; N scaron ; B -19 -13 439 690 ;
-C -1 ; WX 389 ; N Idieresis ; B -32 0 445 862 ;
-C -1 ; WX 556 ; N uacute ; B 15 -9 492 697 ;
-C -1 ; WX 500 ; N agrave ; B -21 -14 455 697 ;
-C -1 ; WX 556 ; N ntilde ; B -6 -9 504 655 ;
-C -1 ; WX 500 ; N aring ; B -21 -14 455 729 ;
-C -1 ; WX 389 ; N zcaron ; B -43 -78 424 690 ;
-C -1 ; WX 389 ; N Icircumflex ; B -32 0 420 897 ;
-C -1 ; WX 722 ; N Ntilde ; B -27 -15 748 862 ;
-C -1 ; WX 556 ; N ucircumflex ; B 15 -9 492 690 ;
-C -1 ; WX 667 ; N Ecircumflex ; B -27 0 653 897 ;
-C -1 ; WX 389 ; N Iacute ; B -32 0 412 904 ;
-C -1 ; WX 667 ; N Ccedilla ; B 32 -218 677 685 ;
-C -1 ; WX 722 ; N Odieresis ; B 27 -18 691 862 ;
-C -1 ; WX 556 ; N Scaron ; B 2 -18 526 897 ;
-C -1 ; WX 667 ; N Edieresis ; B -27 0 653 862 ;
-C -1 ; WX 389 ; N Igrave ; B -32 0 406 904 ;
-C -1 ; WX 500 ; N adieresis ; B -21 -14 471 655 ;
-C -1 ; WX 722 ; N Ograve ; B 27 -18 691 904 ;
-C -1 ; WX 667 ; N Egrave ; B -27 0 653 904 ;
-C -1 ; WX 611 ; N Ydieresis ; B 73 0 659 862 ;
-C -1 ; WX 747 ; N registered ; B 30 -18 718 685 ;
-C -1 ; WX 722 ; N Otilde ; B 27 -18 691 862 ;
-C -1 ; WX 750 ; N onequarter ; B 7 -14 721 683 ;
-C -1 ; WX 722 ; N Ugrave ; B 67 -18 744 904 ;
-C -1 ; WX 722 ; N Ucircumflex ; B 67 -18 744 897 ;
-C -1 ; WX 611 ; N Thorn ; B -27 0 573 669 ;
-C -1 ; WX 570 ; N divide ; B 33 -29 537 535 ;
-C -1 ; WX 667 ; N Atilde ; B -67 0 593 862 ;
-C -1 ; WX 722 ; N Uacute ; B 67 -18 744 904 ;
-C -1 ; WX 722 ; N Ocircumflex ; B 27 -18 691 897 ;
-C -1 ; WX 606 ; N logicalnot ; B 51 108 555 399 ;
-C -1 ; WX 667 ; N Aring ; B -67 0 593 921 ;
-C -1 ; WX 278 ; N idieresis ; B 2 -9 360 655 ;
-C -1 ; WX 278 ; N iacute ; B 2 -9 352 697 ;
-C -1 ; WX 500 ; N aacute ; B -21 -14 463 697 ;
-C -1 ; WX 570 ; N plusminus ; B 33 0 537 506 ;
-C -1 ; WX 570 ; N multiply ; B 48 16 522 490 ;
-C -1 ; WX 722 ; N Udieresis ; B 67 -18 744 862 ;
-C -1 ; WX 606 ; N minus ; B 51 209 555 297 ;
-C -1 ; WX 300 ; N onesuperior ; B 30 274 301 683 ;
-C -1 ; WX 667 ; N Eacute ; B -27 0 653 904 ;
-C -1 ; WX 667 ; N Acircumflex ; B -67 0 593 897 ;
-C -1 ; WX 747 ; N copyright ; B 30 -18 718 685 ;
-C -1 ; WX 667 ; N Agrave ; B -67 0 593 904 ;
-C -1 ; WX 500 ; N odieresis ; B -3 -13 466 655 ;
-C -1 ; WX 500 ; N oacute ; B -3 -13 463 697 ;
-C -1 ; WX 400 ; N degree ; B 83 397 369 683 ;
-C -1 ; WX 278 ; N igrave ; B 2 -9 260 697 ;
-C -1 ; WX 576 ; N mu ; B -60 -207 516 449 ;
-C -1 ; WX 722 ; N Oacute ; B 27 -18 691 904 ;
-C -1 ; WX 500 ; N eth ; B -3 -13 454 699 ;
-C -1 ; WX 667 ; N Adieresis ; B -67 0 593 862 ;
-C -1 ; WX 611 ; N Yacute ; B 73 0 659 904 ;
-C -1 ; WX 220 ; N brokenbar ; B 66 -18 154 685 ;
-C -1 ; WX 750 ; N onehalf ; B -9 -14 723 683 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 283
-
-KPX A y -74
-KPX A w -74
-KPX A v -74
-KPX A u -30
-KPX A quoteright -74
-KPX A quotedblright 0
-KPX A p 0
-KPX A Y -70
-KPX A W -100
-KPX A V -95
-KPX A U -50
-KPX A T -55
-KPX A Q -55
-KPX A O -50
-KPX A G -60
-KPX A C -65
-
-KPX B period 0
-KPX B comma 0
-KPX B U -10
-KPX B A -25
-
-KPX D period 0
-KPX D comma 0
-KPX D Y -50
-KPX D W -40
-KPX D V -50
-KPX D A -25
-
-KPX F r -50
-KPX F period -129
-KPX F o -70
-KPX F i -40
-KPX F e -100
-KPX F comma -129
-KPX F a -95
-KPX F A -100
-
-KPX G period 0
-KPX G comma 0
-
-KPX J u -40
-KPX J period -10
-KPX J o -40
-KPX J e -40
-KPX J comma -10
-KPX J a -40
-KPX J A -25
-
-KPX K y -20
-KPX K u -20
-KPX K o -25
-KPX K e -25
-KPX K O -30
-
-KPX L y -37
-KPX L quoteright -55
-KPX L quotedblright 0
-KPX L Y -37
-KPX L W -37
-KPX L V -37
-KPX L T -18
-
-KPX N period 0
-KPX N comma 0
-KPX N A -30
-
-KPX O period 0
-KPX O comma 0
-KPX O Y -50
-KPX O X -40
-KPX O W -50
-KPX O V -50
-KPX O T -40
-KPX O A -40
-
-KPX P period -129
-KPX P o -55
-KPX P e -50
-KPX P comma -129
-KPX P a -40
-KPX P A -85
-
-KPX Q period 0
-KPX Q comma 0
-KPX Q U -10
-
-KPX R Y -18
-KPX R W -18
-KPX R V -18
-KPX R U -40
-KPX R T -30
-KPX R O -40
-
-KPX S period 0
-KPX S comma 0
-
-KPX T y -37
-KPX T w -37
-KPX T u -37
-KPX T semicolon -74
-KPX T r -37
-KPX T period -92
-KPX T o -95
-KPX T i -37
-KPX T hyphen -92
-KPX T h 0
-KPX T e -92
-KPX T comma -92
-KPX T colon -74
-KPX T a -92
-KPX T O -18
-KPX T A -55
-
-KPX U period 0
-KPX U comma 0
-KPX U A -45
-
-KPX V u -55
-KPX V semicolon -74
-KPX V period -129
-KPX V o -111
-KPX V i -55
-KPX V hyphen -70
-KPX V e -111
-KPX V comma -129
-KPX V colon -74
-KPX V a -111
-KPX V O -30
-KPX V G -10
-KPX V A -85
-
-KPX W y -55
-KPX W u -55
-KPX W semicolon -55
-KPX W period -74
-KPX W o -80
-KPX W i -37
-KPX W hyphen -50
-KPX W h 0
-KPX W e -90
-KPX W comma -74
-KPX W colon -55
-KPX W a -85
-KPX W O -15
-KPX W A -74
-
-KPX Y u -92
-KPX Y semicolon -92
-KPX Y period -74
-KPX Y o -111
-KPX Y i -55
-KPX Y hyphen -92
-KPX Y e -111
-KPX Y comma -92
-KPX Y colon -92
-KPX Y a -92
-KPX Y O -25
-KPX Y A -74
-
-KPX a y 0
-KPX a w 0
-KPX a v 0
-KPX a t 0
-KPX a p 0
-KPX a g 0
-KPX a b 0
-
-KPX b y 0
-KPX b v 0
-KPX b u -20
-KPX b period -40
-KPX b l 0
-KPX b comma 0
-KPX b b -10
-
-KPX c y 0
-KPX c period 0
-KPX c l 0
-KPX c k -10
-KPX c h -10
-KPX c comma 0
-
-KPX colon space 0
-
-KPX comma space 0
-KPX comma quoteright -95
-KPX comma quotedblright -95
-
-KPX d y 0
-KPX d w 0
-KPX d v 0
-KPX d period 0
-KPX d d 0
-KPX d comma 0
-
-KPX e y 0
-KPX e x 0
-KPX e w 0
-KPX e v 0
-KPX e period 0
-KPX e p 0
-KPX e g 0
-KPX e comma 0
-KPX e b -10
-
-KPX f quoteright 55
-KPX f quotedblright 0
-KPX f period -10
-KPX f o -10
-KPX f l 0
-KPX f i 0
-KPX f f -18
-KPX f e -10
-KPX f dotlessi -30
-KPX f comma -10
-KPX f a 0
-
-KPX g y 0
-KPX g r 0
-KPX g period 0
-KPX g o 0
-KPX g i 0
-KPX g g 0
-KPX g e 0
-KPX g comma 0
-KPX g a 0
-
-KPX h y 0
-
-KPX i v 0
-
-KPX k y 0
-KPX k o -10
-KPX k e -30
-
-KPX l y 0
-KPX l w 0
-
-KPX m y 0
-KPX m u 0
-
-KPX n y 0
-KPX n v -40
-KPX n u 0
-
-KPX o y -10
-KPX o x -10
-KPX o w -25
-KPX o v -15
-KPX o g 0
-
-KPX p y 0
-
-KPX period quoteright -95
-KPX period quotedblright -95
-
-KPX quotedblleft quoteleft 0
-KPX quotedblleft A 0
-
-KPX quotedblright space 0
-
-KPX quoteleft quoteleft -74
-KPX quoteleft A 0
-
-KPX quoteright v -15
-KPX quoteright t -37
-KPX quoteright space -74
-KPX quoteright s -74
-KPX quoteright r -15
-KPX quoteright quoteright -74
-KPX quoteright quotedblright 0
-KPX quoteright l 0
-KPX quoteright d -15
-
-KPX r y 0
-KPX r v 0
-KPX r u 0
-KPX r t 0
-KPX r s 0
-KPX r r 0
-KPX r q 0
-KPX r period -65
-KPX r p 0
-KPX r o 0
-KPX r n 0
-KPX r m 0
-KPX r l 0
-KPX r k 0
-KPX r i 0
-KPX r hyphen 0
-KPX r g 0
-KPX r e 0
-KPX r d 0
-KPX r comma -65
-KPX r c 0
-KPX r a 0
-
-KPX s w 0
-
-KPX space quoteleft 0
-KPX space quotedblleft 0
-KPX space Y -70
-KPX space W -70
-KPX space V -70
-KPX space T 0
-KPX space A -37
-
-KPX v period -37
-KPX v o -15
-KPX v e -15
-KPX v comma -37
-KPX v a 0
-
-KPX w period -37
-KPX w o -15
-KPX w h 0
-KPX w e -10
-KPX w comma -37
-KPX w a -10
-
-KPX x e -10
-
-KPX y period -37
-KPX y o 0
-KPX y e 0
-KPX y comma -37
-KPX y a 0
-
-KPX z o 0
-KPX z e 0
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 172 207 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 187 207 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 167 207 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 172 207 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 157 192 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 167 207 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 167 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 172 207 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 187 207 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 187 207 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 172 207 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 33 207 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 53 207 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 48 207 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 33 207 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 210 207 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 200 207 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 230 207 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 215 207 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 200 207 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 215 207 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 112 207 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 210 207 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 230 207 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 230 207 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 200 207 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 154 207 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 169 207 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 207 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 84 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 84 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 74 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 74 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 84 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 84 0 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 56 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 56 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 56 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 46 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 46 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -42 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -37 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -37 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 97 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 69 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 74 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 28 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 112 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 112 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 97 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 102 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 56 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 41 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 13 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Times-Italic.afm b/blt3.0.1/library/afm/Times-Italic.afm
deleted file mode 100644
index 1db2cff..0000000
--- a/blt3.0.1/library/afm/Times-Italic.afm
+++ /dev/null
@@ -1,649 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Tue Mar 20 13:14:56 1990
-Comment UniqueID 28427
-Comment VMusage 32912 39804
-FontName Times-Italic
-FullName Times Italic
-FamilyName Times
-Weight Medium
-ItalicAngle -15.5
-IsFixedPitch false
-FontBBox -169 -217 1010 883
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Times is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 653
-XHeight 441
-Ascender 683
-Descender -205
-StartCharMetrics 228
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 39 -11 302 667 ;
-C 34 ; WX 420 ; N quotedbl ; B 144 421 432 666 ;
-C 35 ; WX 500 ; N numbersign ; B 2 0 540 676 ;
-C 36 ; WX 500 ; N dollar ; B 31 -89 497 731 ;
-C 37 ; WX 833 ; N percent ; B 79 -13 790 676 ;
-C 38 ; WX 778 ; N ampersand ; B 76 -18 723 666 ;
-C 39 ; WX 333 ; N quoteright ; B 151 436 290 666 ;
-C 40 ; WX 333 ; N parenleft ; B 42 -181 315 669 ;
-C 41 ; WX 333 ; N parenright ; B 16 -180 289 669 ;
-C 42 ; WX 500 ; N asterisk ; B 128 255 492 666 ;
-C 43 ; WX 675 ; N plus ; B 86 0 590 506 ;
-C 44 ; WX 250 ; N comma ; B -4 -129 135 101 ;
-C 45 ; WX 333 ; N hyphen ; B 49 192 282 255 ;
-C 46 ; WX 250 ; N period ; B 27 -11 138 100 ;
-C 47 ; WX 278 ; N slash ; B -65 -18 386 666 ;
-C 48 ; WX 500 ; N zero ; B 32 -7 497 676 ;
-C 49 ; WX 500 ; N one ; B 49 0 409 676 ;
-C 50 ; WX 500 ; N two ; B 12 0 452 676 ;
-C 51 ; WX 500 ; N three ; B 15 -7 465 676 ;
-C 52 ; WX 500 ; N four ; B 1 0 479 676 ;
-C 53 ; WX 500 ; N five ; B 15 -7 491 666 ;
-C 54 ; WX 500 ; N six ; B 30 -7 521 686 ;
-C 55 ; WX 500 ; N seven ; B 75 -8 537 666 ;
-C 56 ; WX 500 ; N eight ; B 30 -7 493 676 ;
-C 57 ; WX 500 ; N nine ; B 23 -17 492 676 ;
-C 58 ; WX 333 ; N colon ; B 50 -11 261 441 ;
-C 59 ; WX 333 ; N semicolon ; B 27 -129 261 441 ;
-C 60 ; WX 675 ; N less ; B 84 -8 592 514 ;
-C 61 ; WX 675 ; N equal ; B 86 120 590 386 ;
-C 62 ; WX 675 ; N greater ; B 84 -8 592 514 ;
-C 63 ; WX 500 ; N question ; B 132 -12 472 664 ;
-C 64 ; WX 920 ; N at ; B 118 -18 806 666 ;
-C 65 ; WX 611 ; N A ; B -51 0 564 668 ;
-C 66 ; WX 611 ; N B ; B -8 0 588 653 ;
-C 67 ; WX 667 ; N C ; B 66 -18 689 666 ;
-C 68 ; WX 722 ; N D ; B -8 0 700 653 ;
-C 69 ; WX 611 ; N E ; B -1 0 634 653 ;
-C 70 ; WX 611 ; N F ; B 8 0 645 653 ;
-C 71 ; WX 722 ; N G ; B 52 -18 722 666 ;
-C 72 ; WX 722 ; N H ; B -8 0 767 653 ;
-C 73 ; WX 333 ; N I ; B -8 0 384 653 ;
-C 74 ; WX 444 ; N J ; B -6 -18 491 653 ;
-C 75 ; WX 667 ; N K ; B 7 0 722 653 ;
-C 76 ; WX 556 ; N L ; B -8 0 559 653 ;
-C 77 ; WX 833 ; N M ; B -18 0 873 653 ;
-C 78 ; WX 667 ; N N ; B -20 -15 727 653 ;
-C 79 ; WX 722 ; N O ; B 60 -18 699 666 ;
-C 80 ; WX 611 ; N P ; B 0 0 605 653 ;
-C 81 ; WX 722 ; N Q ; B 59 -182 699 666 ;
-C 82 ; WX 611 ; N R ; B -13 0 588 653 ;
-C 83 ; WX 500 ; N S ; B 17 -18 508 667 ;
-C 84 ; WX 556 ; N T ; B 59 0 633 653 ;
-C 85 ; WX 722 ; N U ; B 102 -18 765 653 ;
-C 86 ; WX 611 ; N V ; B 76 -18 688 653 ;
-C 87 ; WX 833 ; N W ; B 71 -18 906 653 ;
-C 88 ; WX 611 ; N X ; B -29 0 655 653 ;
-C 89 ; WX 556 ; N Y ; B 78 0 633 653 ;
-C 90 ; WX 556 ; N Z ; B -6 0 606 653 ;
-C 91 ; WX 389 ; N bracketleft ; B 21 -153 391 663 ;
-C 92 ; WX 278 ; N backslash ; B -41 -18 319 666 ;
-C 93 ; WX 389 ; N bracketright ; B 12 -153 382 663 ;
-C 94 ; WX 422 ; N asciicircum ; B 0 301 422 666 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 333 ; N quoteleft ; B 171 436 310 666 ;
-C 97 ; WX 500 ; N a ; B 17 -11 476 441 ;
-C 98 ; WX 500 ; N b ; B 23 -11 473 683 ;
-C 99 ; WX 444 ; N c ; B 30 -11 425 441 ;
-C 100 ; WX 500 ; N d ; B 15 -13 527 683 ;
-C 101 ; WX 444 ; N e ; B 31 -11 412 441 ;
-C 102 ; WX 278 ; N f ; B -147 -207 424 678 ; L i fi ; L l fl ;
-C 103 ; WX 500 ; N g ; B 8 -206 472 441 ;
-C 104 ; WX 500 ; N h ; B 19 -9 478 683 ;
-C 105 ; WX 278 ; N i ; B 49 -11 264 654 ;
-C 106 ; WX 278 ; N j ; B -124 -207 276 654 ;
-C 107 ; WX 444 ; N k ; B 14 -11 461 683 ;
-C 108 ; WX 278 ; N l ; B 41 -11 279 683 ;
-C 109 ; WX 722 ; N m ; B 12 -9 704 441 ;
-C 110 ; WX 500 ; N n ; B 14 -9 474 441 ;
-C 111 ; WX 500 ; N o ; B 27 -11 468 441 ;
-C 112 ; WX 500 ; N p ; B -75 -205 469 441 ;
-C 113 ; WX 500 ; N q ; B 25 -209 483 441 ;
-C 114 ; WX 389 ; N r ; B 45 0 412 441 ;
-C 115 ; WX 389 ; N s ; B 16 -13 366 442 ;
-C 116 ; WX 278 ; N t ; B 37 -11 296 546 ;
-C 117 ; WX 500 ; N u ; B 42 -11 475 441 ;
-C 118 ; WX 444 ; N v ; B 21 -18 426 441 ;
-C 119 ; WX 667 ; N w ; B 16 -18 648 441 ;
-C 120 ; WX 444 ; N x ; B -27 -11 447 441 ;
-C 121 ; WX 444 ; N y ; B -24 -206 426 441 ;
-C 122 ; WX 389 ; N z ; B -2 -81 380 428 ;
-C 123 ; WX 400 ; N braceleft ; B 51 -177 407 687 ;
-C 124 ; WX 275 ; N bar ; B 105 -18 171 666 ;
-C 125 ; WX 400 ; N braceright ; B -7 -177 349 687 ;
-C 126 ; WX 541 ; N asciitilde ; B 40 183 502 323 ;
-C 161 ; WX 389 ; N exclamdown ; B 59 -205 322 473 ;
-C 162 ; WX 500 ; N cent ; B 77 -143 472 560 ;
-C 163 ; WX 500 ; N sterling ; B 10 -6 517 670 ;
-C 164 ; WX 167 ; N fraction ; B -169 -10 337 676 ;
-C 165 ; WX 500 ; N yen ; B 27 0 603 653 ;
-C 166 ; WX 500 ; N florin ; B 25 -182 507 682 ;
-C 167 ; WX 500 ; N section ; B 53 -162 461 666 ;
-C 168 ; WX 500 ; N currency ; B -22 53 522 597 ;
-C 169 ; WX 214 ; N quotesingle ; B 132 421 241 666 ;
-C 170 ; WX 556 ; N quotedblleft ; B 166 436 514 666 ;
-C 171 ; WX 500 ; N guillemotleft ; B 53 37 445 403 ;
-C 172 ; WX 333 ; N guilsinglleft ; B 51 37 281 403 ;
-C 173 ; WX 333 ; N guilsinglright ; B 52 37 282 403 ;
-C 174 ; WX 500 ; N fi ; B -141 -207 481 681 ;
-C 175 ; WX 500 ; N fl ; B -141 -204 518 682 ;
-C 177 ; WX 500 ; N endash ; B -6 197 505 243 ;
-C 178 ; WX 500 ; N dagger ; B 101 -159 488 666 ;
-C 179 ; WX 500 ; N daggerdbl ; B 22 -143 491 666 ;
-C 180 ; WX 250 ; N periodcentered ; B 70 199 181 310 ;
-C 182 ; WX 523 ; N paragraph ; B 55 -123 616 653 ;
-C 183 ; WX 350 ; N bullet ; B 40 191 310 461 ;
-C 184 ; WX 333 ; N quotesinglbase ; B 44 -129 183 101 ;
-C 185 ; WX 556 ; N quotedblbase ; B 57 -129 405 101 ;
-C 186 ; WX 556 ; N quotedblright ; B 151 436 499 666 ;
-C 187 ; WX 500 ; N guillemotright ; B 55 37 447 403 ;
-C 188 ; WX 889 ; N ellipsis ; B 57 -11 762 100 ;
-C 189 ; WX 1000 ; N perthousand ; B 25 -19 1010 706 ;
-C 191 ; WX 500 ; N questiondown ; B 28 -205 368 471 ;
-C 193 ; WX 333 ; N grave ; B 121 492 311 664 ;
-C 194 ; WX 333 ; N acute ; B 180 494 403 664 ;
-C 195 ; WX 333 ; N circumflex ; B 91 492 385 661 ;
-C 196 ; WX 333 ; N tilde ; B 100 517 427 624 ;
-C 197 ; WX 333 ; N macron ; B 99 532 411 583 ;
-C 198 ; WX 333 ; N breve ; B 117 492 418 650 ;
-C 199 ; WX 333 ; N dotaccent ; B 207 508 305 606 ;
-C 200 ; WX 333 ; N dieresis ; B 107 508 405 606 ;
-C 202 ; WX 333 ; N ring ; B 155 492 355 691 ;
-C 203 ; WX 333 ; N cedilla ; B -30 -217 182 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B 93 494 486 664 ;
-C 206 ; WX 333 ; N ogonek ; B -20 -169 200 40 ;
-C 207 ; WX 333 ; N caron ; B 121 492 426 661 ;
-C 208 ; WX 889 ; N emdash ; B -6 197 894 243 ;
-C 225 ; WX 889 ; N AE ; B -27 0 911 653 ;
-C 227 ; WX 276 ; N ordfeminine ; B 42 406 352 676 ;
-C 232 ; WX 556 ; N Lslash ; B -8 0 559 653 ;
-C 233 ; WX 722 ; N Oslash ; B 60 -105 699 722 ;
-C 234 ; WX 944 ; N OE ; B 49 -8 964 666 ;
-C 235 ; WX 310 ; N ordmasculine ; B 67 406 362 676 ;
-C 241 ; WX 667 ; N ae ; B 23 -11 640 441 ;
-C 245 ; WX 278 ; N dotlessi ; B 49 -11 235 441 ;
-C 248 ; WX 278 ; N lslash ; B 37 -11 307 683 ;
-C 249 ; WX 500 ; N oslash ; B 28 -135 469 554 ;
-C 250 ; WX 667 ; N oe ; B 20 -12 646 441 ;
-C 251 ; WX 500 ; N germandbls ; B -168 -207 493 679 ;
-C -1 ; WX 556 ; N Zcaron ; B -6 0 606 873 ;
-C -1 ; WX 444 ; N ccedilla ; B 26 -217 425 441 ;
-C -1 ; WX 444 ; N ydieresis ; B -24 -206 441 606 ;
-C -1 ; WX 500 ; N atilde ; B 17 -11 511 624 ;
-C -1 ; WX 278 ; N icircumflex ; B 34 -11 328 661 ;
-C -1 ; WX 300 ; N threesuperior ; B 43 268 339 676 ;
-C -1 ; WX 444 ; N ecircumflex ; B 31 -11 441 661 ;
-C -1 ; WX 500 ; N thorn ; B -75 -205 469 683 ;
-C -1 ; WX 444 ; N egrave ; B 31 -11 412 664 ;
-C -1 ; WX 300 ; N twosuperior ; B 33 271 324 676 ;
-C -1 ; WX 444 ; N eacute ; B 31 -11 459 664 ;
-C -1 ; WX 500 ; N otilde ; B 27 -11 496 624 ;
-C -1 ; WX 611 ; N Aacute ; B -51 0 564 876 ;
-C -1 ; WX 500 ; N ocircumflex ; B 27 -11 468 661 ;
-C -1 ; WX 444 ; N yacute ; B -24 -206 459 664 ;
-C -1 ; WX 500 ; N udieresis ; B 42 -11 479 606 ;
-C -1 ; WX 750 ; N threequarters ; B 23 -10 736 676 ;
-C -1 ; WX 500 ; N acircumflex ; B 17 -11 476 661 ;
-C -1 ; WX 722 ; N Eth ; B -8 0 700 653 ;
-C -1 ; WX 444 ; N edieresis ; B 31 -11 451 606 ;
-C -1 ; WX 500 ; N ugrave ; B 42 -11 475 664 ;
-C -1 ; WX 980 ; N trademark ; B 30 247 957 653 ;
-C -1 ; WX 500 ; N ograve ; B 27 -11 468 664 ;
-C -1 ; WX 389 ; N scaron ; B 16 -13 454 661 ;
-C -1 ; WX 333 ; N Idieresis ; B -8 0 435 818 ;
-C -1 ; WX 500 ; N uacute ; B 42 -11 477 664 ;
-C -1 ; WX 500 ; N agrave ; B 17 -11 476 664 ;
-C -1 ; WX 500 ; N ntilde ; B 14 -9 476 624 ;
-C -1 ; WX 500 ; N aring ; B 17 -11 476 691 ;
-C -1 ; WX 389 ; N zcaron ; B -2 -81 434 661 ;
-C -1 ; WX 333 ; N Icircumflex ; B -8 0 425 873 ;
-C -1 ; WX 667 ; N Ntilde ; B -20 -15 727 836 ;
-C -1 ; WX 500 ; N ucircumflex ; B 42 -11 475 661 ;
-C -1 ; WX 611 ; N Ecircumflex ; B -1 0 634 873 ;
-C -1 ; WX 333 ; N Iacute ; B -8 0 413 876 ;
-C -1 ; WX 667 ; N Ccedilla ; B 66 -217 689 666 ;
-C -1 ; WX 722 ; N Odieresis ; B 60 -18 699 818 ;
-C -1 ; WX 500 ; N Scaron ; B 17 -18 520 873 ;
-C -1 ; WX 611 ; N Edieresis ; B -1 0 634 818 ;
-C -1 ; WX 333 ; N Igrave ; B -8 0 384 876 ;
-C -1 ; WX 500 ; N adieresis ; B 17 -11 489 606 ;
-C -1 ; WX 722 ; N Ograve ; B 60 -18 699 876 ;
-C -1 ; WX 611 ; N Egrave ; B -1 0 634 876 ;
-C -1 ; WX 556 ; N Ydieresis ; B 78 0 633 818 ;
-C -1 ; WX 760 ; N registered ; B 41 -18 719 666 ;
-C -1 ; WX 722 ; N Otilde ; B 60 -18 699 836 ;
-C -1 ; WX 750 ; N onequarter ; B 33 -10 736 676 ;
-C -1 ; WX 722 ; N Ugrave ; B 102 -18 765 876 ;
-C -1 ; WX 722 ; N Ucircumflex ; B 102 -18 765 873 ;
-C -1 ; WX 611 ; N Thorn ; B 0 0 569 653 ;
-C -1 ; WX 675 ; N divide ; B 86 -11 590 517 ;
-C -1 ; WX 611 ; N Atilde ; B -51 0 566 836 ;
-C -1 ; WX 722 ; N Uacute ; B 102 -18 765 876 ;
-C -1 ; WX 722 ; N Ocircumflex ; B 60 -18 699 873 ;
-C -1 ; WX 675 ; N logicalnot ; B 86 108 590 386 ;
-C -1 ; WX 611 ; N Aring ; B -51 0 564 883 ;
-C -1 ; WX 278 ; N idieresis ; B 49 -11 353 606 ;
-C -1 ; WX 278 ; N iacute ; B 49 -11 356 664 ;
-C -1 ; WX 500 ; N aacute ; B 17 -11 487 664 ;
-C -1 ; WX 675 ; N plusminus ; B 86 0 590 506 ;
-C -1 ; WX 675 ; N multiply ; B 93 8 582 497 ;
-C -1 ; WX 722 ; N Udieresis ; B 102 -18 765 818 ;
-C -1 ; WX 675 ; N minus ; B 86 220 590 286 ;
-C -1 ; WX 300 ; N onesuperior ; B 43 271 284 676 ;
-C -1 ; WX 611 ; N Eacute ; B -1 0 634 876 ;
-C -1 ; WX 611 ; N Acircumflex ; B -51 0 564 873 ;
-C -1 ; WX 760 ; N copyright ; B 41 -18 719 666 ;
-C -1 ; WX 611 ; N Agrave ; B -51 0 564 876 ;
-C -1 ; WX 500 ; N odieresis ; B 27 -11 489 606 ;
-C -1 ; WX 500 ; N oacute ; B 27 -11 487 664 ;
-C -1 ; WX 400 ; N degree ; B 101 390 387 676 ;
-C -1 ; WX 278 ; N igrave ; B 49 -11 284 664 ;
-C -1 ; WX 500 ; N mu ; B -30 -209 497 428 ;
-C -1 ; WX 722 ; N Oacute ; B 60 -18 699 876 ;
-C -1 ; WX 500 ; N eth ; B 27 -11 482 683 ;
-C -1 ; WX 611 ; N Adieresis ; B -51 0 564 818 ;
-C -1 ; WX 556 ; N Yacute ; B 78 0 633 876 ;
-C -1 ; WX 275 ; N brokenbar ; B 105 -18 171 666 ;
-C -1 ; WX 750 ; N onehalf ; B 34 -10 749 676 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 283
-
-KPX A y -55
-KPX A w -55
-KPX A v -55
-KPX A u -20
-KPX A quoteright -37
-KPX A quotedblright 0
-KPX A p 0
-KPX A Y -55
-KPX A W -95
-KPX A V -105
-KPX A U -50
-KPX A T -37
-KPX A Q -40
-KPX A O -40
-KPX A G -35
-KPX A C -30
-
-KPX B period 0
-KPX B comma 0
-KPX B U -10
-KPX B A -25
-
-KPX D period 0
-KPX D comma 0
-KPX D Y -40
-KPX D W -40
-KPX D V -40
-KPX D A -35
-
-KPX F r -55
-KPX F period -135
-KPX F o -105
-KPX F i -45
-KPX F e -75
-KPX F comma -135
-KPX F a -75
-KPX F A -115
-
-KPX G period 0
-KPX G comma 0
-
-KPX J u -35
-KPX J period -25
-KPX J o -25
-KPX J e -25
-KPX J comma -25
-KPX J a -35
-KPX J A -40
-
-KPX K y -40
-KPX K u -40
-KPX K o -40
-KPX K e -35
-KPX K O -50
-
-KPX L y -30
-KPX L quoteright -37
-KPX L quotedblright 0
-KPX L Y -20
-KPX L W -55
-KPX L V -55
-KPX L T -20
-
-KPX N period 0
-KPX N comma 0
-KPX N A -27
-
-KPX O period 0
-KPX O comma 0
-KPX O Y -50
-KPX O X -40
-KPX O W -50
-KPX O V -50
-KPX O T -40
-KPX O A -55
-
-KPX P period -135
-KPX P o -80
-KPX P e -80
-KPX P comma -135
-KPX P a -80
-KPX P A -90
-
-KPX Q period 0
-KPX Q comma 0
-KPX Q U -10
-
-KPX R Y -18
-KPX R W -18
-KPX R V -18
-KPX R U -40
-KPX R T 0
-KPX R O -40
-
-KPX S period 0
-KPX S comma 0
-
-KPX T y -74
-KPX T w -74
-KPX T u -55
-KPX T semicolon -65
-KPX T r -55
-KPX T period -74
-KPX T o -92
-KPX T i -55
-KPX T hyphen -74
-KPX T h 0
-KPX T e -92
-KPX T comma -74
-KPX T colon -55
-KPX T a -92
-KPX T O -18
-KPX T A -50
-
-KPX U period -25
-KPX U comma -25
-KPX U A -40
-
-KPX V u -74
-KPX V semicolon -74
-KPX V period -129
-KPX V o -111
-KPX V i -74
-KPX V hyphen -55
-KPX V e -111
-KPX V comma -129
-KPX V colon -65
-KPX V a -111
-KPX V O -30
-KPX V G 0
-KPX V A -60
-
-KPX W y -70
-KPX W u -55
-KPX W semicolon -65
-KPX W period -92
-KPX W o -92
-KPX W i -55
-KPX W hyphen -37
-KPX W h 0
-KPX W e -92
-KPX W comma -92
-KPX W colon -65
-KPX W a -92
-KPX W O -25
-KPX W A -60
-
-KPX Y u -92
-KPX Y semicolon -65
-KPX Y period -92
-KPX Y o -92
-KPX Y i -74
-KPX Y hyphen -74
-KPX Y e -92
-KPX Y comma -92
-KPX Y colon -65
-KPX Y a -92
-KPX Y O -15
-KPX Y A -50
-
-KPX a y 0
-KPX a w 0
-KPX a v 0
-KPX a t 0
-KPX a p 0
-KPX a g -10
-KPX a b 0
-
-KPX b y 0
-KPX b v 0
-KPX b u -20
-KPX b period -40
-KPX b l 0
-KPX b comma 0
-KPX b b 0
-
-KPX c y 0
-KPX c period 0
-KPX c l 0
-KPX c k -20
-KPX c h -15
-KPX c comma 0
-
-KPX colon space 0
-
-KPX comma space 0
-KPX comma quoteright -140
-KPX comma quotedblright -140
-
-KPX d y 0
-KPX d w 0
-KPX d v 0
-KPX d period 0
-KPX d d 0
-KPX d comma 0
-
-KPX e y -30
-KPX e x -20
-KPX e w -15
-KPX e v -15
-KPX e period -15
-KPX e p 0
-KPX e g -40
-KPX e comma -10
-KPX e b 0
-
-KPX f quoteright 92
-KPX f quotedblright 0
-KPX f period -15
-KPX f o 0
-KPX f l 0
-KPX f i -20
-KPX f f -18
-KPX f e 0
-KPX f dotlessi -60
-KPX f comma -10
-KPX f a 0
-
-KPX g y 0
-KPX g r 0
-KPX g period -15
-KPX g o 0
-KPX g i 0
-KPX g g -10
-KPX g e -10
-KPX g comma -10
-KPX g a 0
-
-KPX h y 0
-
-KPX i v 0
-
-KPX k y -10
-KPX k o -10
-KPX k e -10
-
-KPX l y 0
-KPX l w 0
-
-KPX m y 0
-KPX m u 0
-
-KPX n y 0
-KPX n v -40
-KPX n u 0
-
-KPX o y 0
-KPX o x 0
-KPX o w 0
-KPX o v -10
-KPX o g -10
-
-KPX p y 0
-
-KPX period quoteright -140
-KPX period quotedblright -140
-
-KPX quotedblleft quoteleft 0
-KPX quotedblleft A 0
-
-KPX quotedblright space 0
-
-KPX quoteleft quoteleft -111
-KPX quoteleft A 0
-
-KPX quoteright v -10
-KPX quoteright t -30
-KPX quoteright space -111
-KPX quoteright s -40
-KPX quoteright r -25
-KPX quoteright quoteright -111
-KPX quoteright quotedblright 0
-KPX quoteright l 0
-KPX quoteright d -25
-
-KPX r y 0
-KPX r v 0
-KPX r u 0
-KPX r t 0
-KPX r s -10
-KPX r r 0
-KPX r q -37
-KPX r period -111
-KPX r p 0
-KPX r o -45
-KPX r n 0
-KPX r m 0
-KPX r l 0
-KPX r k 0
-KPX r i 0
-KPX r hyphen -20
-KPX r g -37
-KPX r e -37
-KPX r d -37
-KPX r comma -111
-KPX r c -37
-KPX r a -15
-
-KPX s w 0
-
-KPX space quoteleft 0
-KPX space quotedblleft 0
-KPX space Y -75
-KPX space W -40
-KPX space V -35
-KPX space T -18
-KPX space A -18
-
-KPX v period -74
-KPX v o 0
-KPX v e 0
-KPX v comma -74
-KPX v a 0
-
-KPX w period -74
-KPX w o 0
-KPX w h 0
-KPX w e 0
-KPX w comma -74
-KPX w a 0
-
-KPX x e 0
-
-KPX y period -55
-KPX y o 0
-KPX y e 0
-KPX y comma -55
-KPX y a 0
-
-KPX z o 0
-KPX z e 0
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 139 212 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 144 212 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 139 212 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 149 212 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 129 192 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 139 212 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 167 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 149 212 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 169 212 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 159 212 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 149 212 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 10 212 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 40 212 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 30 212 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 10 212 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 177 212 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 195 212 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 230 212 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 230 212 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 205 212 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 215 212 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 94 212 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 195 212 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 215 212 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 225 212 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 215 212 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 132 212 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 142 212 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 112 212 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 84 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 84 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 84 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 84 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 84 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 84 0 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 56 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 56 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 56 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 46 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 56 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -47 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -57 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -52 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 49 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 74 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 69 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 28 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 74 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 74 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 74 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 84 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 56 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 36 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 8 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/Times-Roman.afm b/blt3.0.1/library/afm/Times-Roman.afm
deleted file mode 100644
index 58de46e..0000000
--- a/blt3.0.1/library/afm/Times-Roman.afm
+++ /dev/null
@@ -1,649 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Tue Mar 20 12:15:44 1990
-Comment UniqueID 28416
-Comment VMusage 30487 37379
-FontName Times-Roman
-FullName Times Roman
-FamilyName Times
-Weight Roman
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -168 -218 1000 898
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Times is a trademark of Linotype AG and/or its subsidiaries.
-EncodingScheme AdobeStandardEncoding
-CapHeight 662
-XHeight 450
-Ascender 683
-Descender -217
-StartCharMetrics 228
-C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 333 ; N exclam ; B 130 -9 238 676 ;
-C 34 ; WX 408 ; N quotedbl ; B 77 431 331 676 ;
-C 35 ; WX 500 ; N numbersign ; B 5 0 496 662 ;
-C 36 ; WX 500 ; N dollar ; B 44 -87 457 727 ;
-C 37 ; WX 833 ; N percent ; B 61 -13 772 676 ;
-C 38 ; WX 778 ; N ampersand ; B 42 -13 750 676 ;
-C 39 ; WX 333 ; N quoteright ; B 79 433 218 676 ;
-C 40 ; WX 333 ; N parenleft ; B 48 -177 304 676 ;
-C 41 ; WX 333 ; N parenright ; B 29 -177 285 676 ;
-C 42 ; WX 500 ; N asterisk ; B 69 265 432 676 ;
-C 43 ; WX 564 ; N plus ; B 30 0 534 506 ;
-C 44 ; WX 250 ; N comma ; B 56 -141 195 102 ;
-C 45 ; WX 333 ; N hyphen ; B 39 194 285 257 ;
-C 46 ; WX 250 ; N period ; B 70 -11 181 100 ;
-C 47 ; WX 278 ; N slash ; B -9 -14 287 676 ;
-C 48 ; WX 500 ; N zero ; B 24 -14 476 676 ;
-C 49 ; WX 500 ; N one ; B 111 0 394 676 ;
-C 50 ; WX 500 ; N two ; B 30 0 475 676 ;
-C 51 ; WX 500 ; N three ; B 43 -14 431 676 ;
-C 52 ; WX 500 ; N four ; B 12 0 472 676 ;
-C 53 ; WX 500 ; N five ; B 32 -14 438 688 ;
-C 54 ; WX 500 ; N six ; B 34 -14 468 684 ;
-C 55 ; WX 500 ; N seven ; B 20 -8 449 662 ;
-C 56 ; WX 500 ; N eight ; B 56 -14 445 676 ;
-C 57 ; WX 500 ; N nine ; B 30 -22 459 676 ;
-C 58 ; WX 278 ; N colon ; B 81 -11 192 459 ;
-C 59 ; WX 278 ; N semicolon ; B 80 -141 219 459 ;
-C 60 ; WX 564 ; N less ; B 28 -8 536 514 ;
-C 61 ; WX 564 ; N equal ; B 30 120 534 386 ;
-C 62 ; WX 564 ; N greater ; B 28 -8 536 514 ;
-C 63 ; WX 444 ; N question ; B 68 -8 414 676 ;
-C 64 ; WX 921 ; N at ; B 116 -14 809 676 ;
-C 65 ; WX 722 ; N A ; B 15 0 706 674 ;
-C 66 ; WX 667 ; N B ; B 17 0 593 662 ;
-C 67 ; WX 667 ; N C ; B 28 -14 633 676 ;
-C 68 ; WX 722 ; N D ; B 16 0 685 662 ;
-C 69 ; WX 611 ; N E ; B 12 0 597 662 ;
-C 70 ; WX 556 ; N F ; B 12 0 546 662 ;
-C 71 ; WX 722 ; N G ; B 32 -14 709 676 ;
-C 72 ; WX 722 ; N H ; B 19 0 702 662 ;
-C 73 ; WX 333 ; N I ; B 18 0 315 662 ;
-C 74 ; WX 389 ; N J ; B 10 -14 370 662 ;
-C 75 ; WX 722 ; N K ; B 34 0 723 662 ;
-C 76 ; WX 611 ; N L ; B 12 0 598 662 ;
-C 77 ; WX 889 ; N M ; B 12 0 863 662 ;
-C 78 ; WX 722 ; N N ; B 12 -11 707 662 ;
-C 79 ; WX 722 ; N O ; B 34 -14 688 676 ;
-C 80 ; WX 556 ; N P ; B 16 0 542 662 ;
-C 81 ; WX 722 ; N Q ; B 34 -178 701 676 ;
-C 82 ; WX 667 ; N R ; B 17 0 659 662 ;
-C 83 ; WX 556 ; N S ; B 42 -14 491 676 ;
-C 84 ; WX 611 ; N T ; B 17 0 593 662 ;
-C 85 ; WX 722 ; N U ; B 14 -14 705 662 ;
-C 86 ; WX 722 ; N V ; B 16 -11 697 662 ;
-C 87 ; WX 944 ; N W ; B 5 -11 932 662 ;
-C 88 ; WX 722 ; N X ; B 10 0 704 662 ;
-C 89 ; WX 722 ; N Y ; B 22 0 703 662 ;
-C 90 ; WX 611 ; N Z ; B 9 0 597 662 ;
-C 91 ; WX 333 ; N bracketleft ; B 88 -156 299 662 ;
-C 92 ; WX 278 ; N backslash ; B -9 -14 287 676 ;
-C 93 ; WX 333 ; N bracketright ; B 34 -156 245 662 ;
-C 94 ; WX 469 ; N asciicircum ; B 24 297 446 662 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 333 ; N quoteleft ; B 115 433 254 676 ;
-C 97 ; WX 444 ; N a ; B 37 -10 442 460 ;
-C 98 ; WX 500 ; N b ; B 3 -10 468 683 ;
-C 99 ; WX 444 ; N c ; B 25 -10 412 460 ;
-C 100 ; WX 500 ; N d ; B 27 -10 491 683 ;
-C 101 ; WX 444 ; N e ; B 25 -10 424 460 ;
-C 102 ; WX 333 ; N f ; B 20 0 383 683 ; L i fi ; L l fl ;
-C 103 ; WX 500 ; N g ; B 28 -218 470 460 ;
-C 104 ; WX 500 ; N h ; B 9 0 487 683 ;
-C 105 ; WX 278 ; N i ; B 16 0 253 683 ;
-C 106 ; WX 278 ; N j ; B -70 -218 194 683 ;
-C 107 ; WX 500 ; N k ; B 7 0 505 683 ;
-C 108 ; WX 278 ; N l ; B 19 0 257 683 ;
-C 109 ; WX 778 ; N m ; B 16 0 775 460 ;
-C 110 ; WX 500 ; N n ; B 16 0 485 460 ;
-C 111 ; WX 500 ; N o ; B 29 -10 470 460 ;
-C 112 ; WX 500 ; N p ; B 5 -217 470 460 ;
-C 113 ; WX 500 ; N q ; B 24 -217 488 460 ;
-C 114 ; WX 333 ; N r ; B 5 0 335 460 ;
-C 115 ; WX 389 ; N s ; B 51 -10 348 460 ;
-C 116 ; WX 278 ; N t ; B 13 -10 279 579 ;
-C 117 ; WX 500 ; N u ; B 9 -10 479 450 ;
-C 118 ; WX 500 ; N v ; B 19 -14 477 450 ;
-C 119 ; WX 722 ; N w ; B 21 -14 694 450 ;
-C 120 ; WX 500 ; N x ; B 17 0 479 450 ;
-C 121 ; WX 500 ; N y ; B 14 -218 475 450 ;
-C 122 ; WX 444 ; N z ; B 27 0 418 450 ;
-C 123 ; WX 480 ; N braceleft ; B 100 -181 350 680 ;
-C 124 ; WX 200 ; N bar ; B 67 -14 133 676 ;
-C 125 ; WX 480 ; N braceright ; B 130 -181 380 680 ;
-C 126 ; WX 541 ; N asciitilde ; B 40 183 502 323 ;
-C 161 ; WX 333 ; N exclamdown ; B 97 -218 205 467 ;
-C 162 ; WX 500 ; N cent ; B 53 -138 448 579 ;
-C 163 ; WX 500 ; N sterling ; B 12 -8 490 676 ;
-C 164 ; WX 167 ; N fraction ; B -168 -14 331 676 ;
-C 165 ; WX 500 ; N yen ; B -53 0 512 662 ;
-C 166 ; WX 500 ; N florin ; B 7 -189 490 676 ;
-C 167 ; WX 500 ; N section ; B 70 -148 426 676 ;
-C 168 ; WX 500 ; N currency ; B -22 58 522 602 ;
-C 169 ; WX 180 ; N quotesingle ; B 48 431 133 676 ;
-C 170 ; WX 444 ; N quotedblleft ; B 43 433 414 676 ;
-C 171 ; WX 500 ; N guillemotleft ; B 42 33 456 416 ;
-C 172 ; WX 333 ; N guilsinglleft ; B 63 33 285 416 ;
-C 173 ; WX 333 ; N guilsinglright ; B 48 33 270 416 ;
-C 174 ; WX 556 ; N fi ; B 31 0 521 683 ;
-C 175 ; WX 556 ; N fl ; B 32 0 521 683 ;
-C 177 ; WX 500 ; N endash ; B 0 201 500 250 ;
-C 178 ; WX 500 ; N dagger ; B 59 -149 442 676 ;
-C 179 ; WX 500 ; N daggerdbl ; B 58 -153 442 676 ;
-C 180 ; WX 250 ; N periodcentered ; B 70 199 181 310 ;
-C 182 ; WX 453 ; N paragraph ; B -22 -154 450 662 ;
-C 183 ; WX 350 ; N bullet ; B 40 196 310 466 ;
-C 184 ; WX 333 ; N quotesinglbase ; B 79 -141 218 102 ;
-C 185 ; WX 444 ; N quotedblbase ; B 45 -141 416 102 ;
-C 186 ; WX 444 ; N quotedblright ; B 30 433 401 676 ;
-C 187 ; WX 500 ; N guillemotright ; B 44 33 458 416 ;
-C 188 ; WX 1000 ; N ellipsis ; B 111 -11 888 100 ;
-C 189 ; WX 1000 ; N perthousand ; B 7 -19 994 706 ;
-C 191 ; WX 444 ; N questiondown ; B 30 -218 376 466 ;
-C 193 ; WX 333 ; N grave ; B 19 507 242 678 ;
-C 194 ; WX 333 ; N acute ; B 93 507 317 678 ;
-C 195 ; WX 333 ; N circumflex ; B 11 507 322 674 ;
-C 196 ; WX 333 ; N tilde ; B 1 532 331 638 ;
-C 197 ; WX 333 ; N macron ; B 11 547 322 601 ;
-C 198 ; WX 333 ; N breve ; B 26 507 307 664 ;
-C 199 ; WX 333 ; N dotaccent ; B 118 523 216 623 ;
-C 200 ; WX 333 ; N dieresis ; B 18 523 315 623 ;
-C 202 ; WX 333 ; N ring ; B 67 512 266 711 ;
-C 203 ; WX 333 ; N cedilla ; B 52 -215 261 0 ;
-C 205 ; WX 333 ; N hungarumlaut ; B -3 507 377 678 ;
-C 206 ; WX 333 ; N ogonek ; B 64 -165 249 0 ;
-C 207 ; WX 333 ; N caron ; B 11 507 322 674 ;
-C 208 ; WX 1000 ; N emdash ; B 0 201 1000 250 ;
-C 225 ; WX 889 ; N AE ; B 0 0 863 662 ;
-C 227 ; WX 276 ; N ordfeminine ; B 4 394 270 676 ;
-C 232 ; WX 611 ; N Lslash ; B 12 0 598 662 ;
-C 233 ; WX 722 ; N Oslash ; B 34 -80 688 734 ;
-C 234 ; WX 889 ; N OE ; B 30 -6 885 668 ;
-C 235 ; WX 310 ; N ordmasculine ; B 6 394 304 676 ;
-C 241 ; WX 667 ; N ae ; B 38 -10 632 460 ;
-C 245 ; WX 278 ; N dotlessi ; B 16 0 253 460 ;
-C 248 ; WX 278 ; N lslash ; B 19 0 259 683 ;
-C 249 ; WX 500 ; N oslash ; B 29 -112 470 551 ;
-C 250 ; WX 722 ; N oe ; B 30 -10 690 460 ;
-C 251 ; WX 500 ; N germandbls ; B 12 -9 468 683 ;
-C -1 ; WX 611 ; N Zcaron ; B 9 0 597 886 ;
-C -1 ; WX 444 ; N ccedilla ; B 25 -215 412 460 ;
-C -1 ; WX 500 ; N ydieresis ; B 14 -218 475 623 ;
-C -1 ; WX 444 ; N atilde ; B 37 -10 442 638 ;
-C -1 ; WX 278 ; N icircumflex ; B -16 0 295 674 ;
-C -1 ; WX 300 ; N threesuperior ; B 15 262 291 676 ;
-C -1 ; WX 444 ; N ecircumflex ; B 25 -10 424 674 ;
-C -1 ; WX 500 ; N thorn ; B 5 -217 470 683 ;
-C -1 ; WX 444 ; N egrave ; B 25 -10 424 678 ;
-C -1 ; WX 300 ; N twosuperior ; B 1 270 296 676 ;
-C -1 ; WX 444 ; N eacute ; B 25 -10 424 678 ;
-C -1 ; WX 500 ; N otilde ; B 29 -10 470 638 ;
-C -1 ; WX 722 ; N Aacute ; B 15 0 706 890 ;
-C -1 ; WX 500 ; N ocircumflex ; B 29 -10 470 674 ;
-C -1 ; WX 500 ; N yacute ; B 14 -218 475 678 ;
-C -1 ; WX 500 ; N udieresis ; B 9 -10 479 623 ;
-C -1 ; WX 750 ; N threequarters ; B 15 -14 718 676 ;
-C -1 ; WX 444 ; N acircumflex ; B 37 -10 442 674 ;
-C -1 ; WX 722 ; N Eth ; B 16 0 685 662 ;
-C -1 ; WX 444 ; N edieresis ; B 25 -10 424 623 ;
-C -1 ; WX 500 ; N ugrave ; B 9 -10 479 678 ;
-C -1 ; WX 980 ; N trademark ; B 30 256 957 662 ;
-C -1 ; WX 500 ; N ograve ; B 29 -10 470 678 ;
-C -1 ; WX 389 ; N scaron ; B 39 -10 350 674 ;
-C -1 ; WX 333 ; N Idieresis ; B 18 0 315 835 ;
-C -1 ; WX 500 ; N uacute ; B 9 -10 479 678 ;
-C -1 ; WX 444 ; N agrave ; B 37 -10 442 678 ;
-C -1 ; WX 500 ; N ntilde ; B 16 0 485 638 ;
-C -1 ; WX 444 ; N aring ; B 37 -10 442 711 ;
-C -1 ; WX 444 ; N zcaron ; B 27 0 418 674 ;
-C -1 ; WX 333 ; N Icircumflex ; B 11 0 322 886 ;
-C -1 ; WX 722 ; N Ntilde ; B 12 -11 707 850 ;
-C -1 ; WX 500 ; N ucircumflex ; B 9 -10 479 674 ;
-C -1 ; WX 611 ; N Ecircumflex ; B 12 0 597 886 ;
-C -1 ; WX 333 ; N Iacute ; B 18 0 317 890 ;
-C -1 ; WX 667 ; N Ccedilla ; B 28 -215 633 676 ;
-C -1 ; WX 722 ; N Odieresis ; B 34 -14 688 835 ;
-C -1 ; WX 556 ; N Scaron ; B 42 -14 491 886 ;
-C -1 ; WX 611 ; N Edieresis ; B 12 0 597 835 ;
-C -1 ; WX 333 ; N Igrave ; B 18 0 315 890 ;
-C -1 ; WX 444 ; N adieresis ; B 37 -10 442 623 ;
-C -1 ; WX 722 ; N Ograve ; B 34 -14 688 890 ;
-C -1 ; WX 611 ; N Egrave ; B 12 0 597 890 ;
-C -1 ; WX 722 ; N Ydieresis ; B 22 0 703 835 ;
-C -1 ; WX 760 ; N registered ; B 38 -14 722 676 ;
-C -1 ; WX 722 ; N Otilde ; B 34 -14 688 850 ;
-C -1 ; WX 750 ; N onequarter ; B 37 -14 718 676 ;
-C -1 ; WX 722 ; N Ugrave ; B 14 -14 705 890 ;
-C -1 ; WX 722 ; N Ucircumflex ; B 14 -14 705 886 ;
-C -1 ; WX 556 ; N Thorn ; B 16 0 542 662 ;
-C -1 ; WX 564 ; N divide ; B 30 -10 534 516 ;
-C -1 ; WX 722 ; N Atilde ; B 15 0 706 850 ;
-C -1 ; WX 722 ; N Uacute ; B 14 -14 705 890 ;
-C -1 ; WX 722 ; N Ocircumflex ; B 34 -14 688 886 ;
-C -1 ; WX 564 ; N logicalnot ; B 30 108 534 386 ;
-C -1 ; WX 722 ; N Aring ; B 15 0 706 898 ;
-C -1 ; WX 278 ; N idieresis ; B -9 0 288 623 ;
-C -1 ; WX 278 ; N iacute ; B 16 0 290 678 ;
-C -1 ; WX 444 ; N aacute ; B 37 -10 442 678 ;
-C -1 ; WX 564 ; N plusminus ; B 30 0 534 506 ;
-C -1 ; WX 564 ; N multiply ; B 38 8 527 497 ;
-C -1 ; WX 722 ; N Udieresis ; B 14 -14 705 835 ;
-C -1 ; WX 564 ; N minus ; B 30 220 534 286 ;
-C -1 ; WX 300 ; N onesuperior ; B 57 270 248 676 ;
-C -1 ; WX 611 ; N Eacute ; B 12 0 597 890 ;
-C -1 ; WX 722 ; N Acircumflex ; B 15 0 706 886 ;
-C -1 ; WX 760 ; N copyright ; B 38 -14 722 676 ;
-C -1 ; WX 722 ; N Agrave ; B 15 0 706 890 ;
-C -1 ; WX 500 ; N odieresis ; B 29 -10 470 623 ;
-C -1 ; WX 500 ; N oacute ; B 29 -10 470 678 ;
-C -1 ; WX 400 ; N degree ; B 57 390 343 676 ;
-C -1 ; WX 278 ; N igrave ; B -8 0 253 678 ;
-C -1 ; WX 500 ; N mu ; B 36 -218 512 450 ;
-C -1 ; WX 722 ; N Oacute ; B 34 -14 688 890 ;
-C -1 ; WX 500 ; N eth ; B 29 -10 471 686 ;
-C -1 ; WX 722 ; N Adieresis ; B 15 0 706 835 ;
-C -1 ; WX 722 ; N Yacute ; B 22 0 703 890 ;
-C -1 ; WX 200 ; N brokenbar ; B 67 -14 133 676 ;
-C -1 ; WX 750 ; N onehalf ; B 31 -14 746 676 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 283
-
-KPX A y -92
-KPX A w -92
-KPX A v -74
-KPX A u 0
-KPX A quoteright -111
-KPX A quotedblright 0
-KPX A p 0
-KPX A Y -105
-KPX A W -90
-KPX A V -135
-KPX A U -55
-KPX A T -111
-KPX A Q -55
-KPX A O -55
-KPX A G -40
-KPX A C -40
-
-KPX B period 0
-KPX B comma 0
-KPX B U -10
-KPX B A -35
-
-KPX D period 0
-KPX D comma 0
-KPX D Y -55
-KPX D W -30
-KPX D V -40
-KPX D A -40
-
-KPX F r 0
-KPX F period -80
-KPX F o -15
-KPX F i 0
-KPX F e 0
-KPX F comma -80
-KPX F a -15
-KPX F A -74
-
-KPX G period 0
-KPX G comma 0
-
-KPX J u 0
-KPX J period 0
-KPX J o 0
-KPX J e 0
-KPX J comma 0
-KPX J a 0
-KPX J A -60
-
-KPX K y -25
-KPX K u -15
-KPX K o -35
-KPX K e -25
-KPX K O -30
-
-KPX L y -55
-KPX L quoteright -92
-KPX L quotedblright 0
-KPX L Y -100
-KPX L W -74
-KPX L V -100
-KPX L T -92
-
-KPX N period 0
-KPX N comma 0
-KPX N A -35
-
-KPX O period 0
-KPX O comma 0
-KPX O Y -50
-KPX O X -40
-KPX O W -35
-KPX O V -50
-KPX O T -40
-KPX O A -35
-
-KPX P period -111
-KPX P o 0
-KPX P e 0
-KPX P comma -111
-KPX P a -15
-KPX P A -92
-
-KPX Q period 0
-KPX Q comma 0
-KPX Q U -10
-
-KPX R Y -65
-KPX R W -55
-KPX R V -80
-KPX R U -40
-KPX R T -60
-KPX R O -40
-
-KPX S period 0
-KPX S comma 0
-
-KPX T y -80
-KPX T w -80
-KPX T u -45
-KPX T semicolon -55
-KPX T r -35
-KPX T period -74
-KPX T o -80
-KPX T i -35
-KPX T hyphen -92
-KPX T h 0
-KPX T e -70
-KPX T comma -74
-KPX T colon -50
-KPX T a -80
-KPX T O -18
-KPX T A -93
-
-KPX U period 0
-KPX U comma 0
-KPX U A -40
-
-KPX V u -75
-KPX V semicolon -74
-KPX V period -129
-KPX V o -129
-KPX V i -60
-KPX V hyphen -100
-KPX V e -111
-KPX V comma -129
-KPX V colon -74
-KPX V a -111
-KPX V O -40
-KPX V G -15
-KPX V A -135
-
-KPX W y -73
-KPX W u -50
-KPX W semicolon -37
-KPX W period -92
-KPX W o -80
-KPX W i -40
-KPX W hyphen -65
-KPX W h 0
-KPX W e -80
-KPX W comma -92
-KPX W colon -37
-KPX W a -80
-KPX W O -10
-KPX W A -120
-
-KPX Y u -111
-KPX Y semicolon -92
-KPX Y period -129
-KPX Y o -110
-KPX Y i -55
-KPX Y hyphen -111
-KPX Y e -100
-KPX Y comma -129
-KPX Y colon -92
-KPX Y a -100
-KPX Y O -30
-KPX Y A -120
-
-KPX a y 0
-KPX a w -15
-KPX a v -20
-KPX a t 0
-KPX a p 0
-KPX a g 0
-KPX a b 0
-
-KPX b y 0
-KPX b v -15
-KPX b u -20
-KPX b period -40
-KPX b l 0
-KPX b comma 0
-KPX b b 0
-
-KPX c y -15
-KPX c period 0
-KPX c l 0
-KPX c k 0
-KPX c h 0
-KPX c comma 0
-
-KPX colon space 0
-
-KPX comma space 0
-KPX comma quoteright -70
-KPX comma quotedblright -70
-
-KPX d y 0
-KPX d w 0
-KPX d v 0
-KPX d period 0
-KPX d d 0
-KPX d comma 0
-
-KPX e y -15
-KPX e x -15
-KPX e w -25
-KPX e v -25
-KPX e period 0
-KPX e p 0
-KPX e g -15
-KPX e comma 0
-KPX e b 0
-
-KPX f quoteright 55
-KPX f quotedblright 0
-KPX f period 0
-KPX f o 0
-KPX f l 0
-KPX f i -20
-KPX f f -25
-KPX f e 0
-KPX f dotlessi -50
-KPX f comma 0
-KPX f a -10
-
-KPX g y 0
-KPX g r 0
-KPX g period 0
-KPX g o 0
-KPX g i 0
-KPX g g 0
-KPX g e 0
-KPX g comma 0
-KPX g a -5
-
-KPX h y -5
-
-KPX i v -25
-
-KPX k y -15
-KPX k o -10
-KPX k e -10
-
-KPX l y 0
-KPX l w -10
-
-KPX m y 0
-KPX m u 0
-
-KPX n y -15
-KPX n v -40
-KPX n u 0
-
-KPX o y -10
-KPX o x 0
-KPX o w -25
-KPX o v -15
-KPX o g 0
-
-KPX p y -10
-
-KPX period quoteright -70
-KPX period quotedblright -70
-
-KPX quotedblleft quoteleft 0
-KPX quotedblleft A -80
-
-KPX quotedblright space 0
-
-KPX quoteleft quoteleft -74
-KPX quoteleft A -80
-
-KPX quoteright v -50
-KPX quoteright t -18
-KPX quoteright space -74
-KPX quoteright s -55
-KPX quoteright r -50
-KPX quoteright quoteright -74
-KPX quoteright quotedblright 0
-KPX quoteright l -10
-KPX quoteright d -50
-
-KPX r y 0
-KPX r v 0
-KPX r u 0
-KPX r t 0
-KPX r s 0
-KPX r r 0
-KPX r q 0
-KPX r period -55
-KPX r p 0
-KPX r o 0
-KPX r n 0
-KPX r m 0
-KPX r l 0
-KPX r k 0
-KPX r i 0
-KPX r hyphen -20
-KPX r g -18
-KPX r e 0
-KPX r d 0
-KPX r comma -40
-KPX r c 0
-KPX r a 0
-
-KPX s w 0
-
-KPX space quoteleft 0
-KPX space quotedblleft 0
-KPX space Y -90
-KPX space W -30
-KPX space V -50
-KPX space T -18
-KPX space A -55
-
-KPX v period -65
-KPX v o -20
-KPX v e -15
-KPX v comma -65
-KPX v a -25
-
-KPX w period -65
-KPX w o -10
-KPX w h 0
-KPX w e 0
-KPX w comma -65
-KPX w a -10
-
-KPX x e -15
-
-KPX y period -65
-KPX y o 0
-KPX y e 0
-KPX y comma -65
-KPX y a 0
-
-KPX z o 0
-KPX z e 0
-EndKernPairs
-EndKernData
-StartComposites 58
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 195 212 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 195 212 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 195 212 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 195 212 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 185 187 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 195 212 ;
-CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 167 0 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 139 212 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 139 212 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 139 212 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 139 212 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 0 212 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 0 212 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 0 212 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 0 212 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 195 212 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 195 212 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 195 212 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 195 212 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 195 212 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 195 212 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 112 212 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 195 212 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 195 212 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 195 212 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 195 212 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 195 212 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 195 212 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 212 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 56 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 56 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 56 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 56 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 56 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 56 0 ;
-CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 56 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 56 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 56 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 56 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 56 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 84 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron 28 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 84 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 84 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 84 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 84 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 84 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 56 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/ZapfChancery-MediumItalic.afm b/blt3.0.1/library/afm/ZapfChancery-MediumItalic.afm
deleted file mode 100644
index 7a8df29..0000000
--- a/blt3.0.1/library/afm/ZapfChancery-MediumItalic.afm
+++ /dev/null
@@ -1,481 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
-Comment Creation Date: Fri Dec 28 16:35:46 1990
-Comment UniqueID 33936
-Comment VMusage 34559 41451
-FontName ZapfChancery-MediumItalic
-FullName ITC Zapf Chancery Medium Italic
-FamilyName ITC Zapf Chancery
-Weight Medium
-ItalicAngle -14
-IsFixedPitch false
-FontBBox -181 -314 1065 831
-UnderlinePosition -100
-UnderlineThickness 50
-Version 001.007
-Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.ITC Zapf Chancery is a registered trademark of International Typeface Corporation.
-EncodingScheme AdobeStandardEncoding
-CapHeight 708
-XHeight 438
-Ascender 714
-Descender -314
-StartCharMetrics 228
-C 32 ; WX 220 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 280 ; N exclam ; B 119 -14 353 610 ;
-C 34 ; WX 220 ; N quotedbl ; B 120 343 333 610 ;
-C 35 ; WX 440 ; N numbersign ; B 83 0 521 594 ;
-C 36 ; WX 440 ; N dollar ; B 60 -144 508 709 ;
-C 37 ; WX 680 ; N percent ; B 132 -160 710 700 ;
-C 38 ; WX 780 ; N ampersand ; B 126 -16 915 610 ;
-C 39 ; WX 240 ; N quoteright ; B 168 343 338 610 ;
-C 40 ; WX 260 ; N parenleft ; B 96 -216 411 664 ;
-C 41 ; WX 220 ; N parenright ; B -13 -216 302 664 ;
-C 42 ; WX 420 ; N asterisk ; B 139 263 479 610 ;
-C 43 ; WX 520 ; N plus ; B 117 0 543 426 ;
-C 44 ; WX 220 ; N comma ; B 25 -140 213 148 ;
-C 45 ; WX 280 ; N hyphen ; B 69 190 334 248 ;
-C 46 ; WX 220 ; N period ; B 102 -14 228 128 ;
-C 47 ; WX 340 ; N slash ; B 74 -16 458 610 ;
-C 48 ; WX 440 ; N zero ; B 79 -16 538 610 ;
-C 49 ; WX 440 ; N one ; B 41 0 428 610 ;
-C 50 ; WX 440 ; N two ; B 17 -16 485 610 ;
-C 51 ; WX 440 ; N three ; B 1 -16 485 610 ;
-C 52 ; WX 440 ; N four ; B 77 -35 499 610 ;
-C 53 ; WX 440 ; N five ; B 60 -16 595 679 ;
-C 54 ; WX 440 ; N six ; B 90 -16 556 610 ;
-C 55 ; WX 440 ; N seven ; B 157 -33 561 645 ;
-C 56 ; WX 440 ; N eight ; B 65 -16 529 610 ;
-C 57 ; WX 440 ; N nine ; B 32 -16 517 610 ;
-C 58 ; WX 260 ; N colon ; B 98 -14 296 438 ;
-C 59 ; WX 240 ; N semicolon ; B 29 -140 299 438 ;
-C 60 ; WX 520 ; N less ; B 139 0 527 468 ;
-C 61 ; WX 520 ; N equal ; B 117 86 543 340 ;
-C 62 ; WX 520 ; N greater ; B 139 0 527 468 ;
-C 63 ; WX 380 ; N question ; B 150 -14 455 610 ;
-C 64 ; WX 700 ; N at ; B 127 -16 753 610 ;
-C 65 ; WX 620 ; N A ; B 13 -16 697 632 ;
-C 66 ; WX 600 ; N B ; B 85 -6 674 640 ;
-C 67 ; WX 520 ; N C ; B 93 -16 631 610 ;
-C 68 ; WX 700 ; N D ; B 86 -6 768 640 ;
-C 69 ; WX 620 ; N E ; B 91 -12 709 618 ;
-C 70 ; WX 580 ; N F ; B 120 -118 793 629 ;
-C 71 ; WX 620 ; N G ; B 148 -242 709 610 ;
-C 72 ; WX 680 ; N H ; B 18 -16 878 708 ;
-C 73 ; WX 380 ; N I ; B 99 0 504 594 ;
-C 74 ; WX 400 ; N J ; B -14 -147 538 594 ;
-C 75 ; WX 660 ; N K ; B 53 -153 844 610 ;
-C 76 ; WX 580 ; N L ; B 53 -16 657 610 ;
-C 77 ; WX 840 ; N M ; B 58 -16 1020 722 ;
-C 78 ; WX 700 ; N N ; B 85 -168 915 708 ;
-C 79 ; WX 600 ; N O ; B 94 -16 660 610 ;
-C 80 ; WX 540 ; N P ; B 42 0 658 628 ;
-C 81 ; WX 600 ; N Q ; B 84 -177 775 610 ;
-C 82 ; WX 600 ; N R ; B 58 -168 805 640 ;
-C 83 ; WX 460 ; N S ; B 45 -81 558 610 ;
-C 84 ; WX 500 ; N T ; B 63 0 744 667 ;
-C 85 ; WX 740 ; N U ; B 126 -16 792 617 ;
-C 86 ; WX 640 ; N V ; B 124 -16 810 714 ;
-C 87 ; WX 880 ; N W ; B 94 -16 1046 723 ;
-C 88 ; WX 560 ; N X ; B -30 -16 699 610 ;
-C 89 ; WX 560 ; N Y ; B 41 -168 774 647 ;
-C 90 ; WX 620 ; N Z ; B 42 -19 669 624 ;
-C 91 ; WX 240 ; N bracketleft ; B -13 -207 405 655 ;
-C 92 ; WX 480 ; N backslash ; B 140 -16 524 610 ;
-C 93 ; WX 320 ; N bracketright ; B -27 -207 391 655 ;
-C 94 ; WX 520 ; N asciicircum ; B 132 239 532 594 ;
-C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
-C 96 ; WX 240 ; N quoteleft ; B 169 343 339 610 ;
-C 97 ; WX 420 ; N a ; B 92 -15 485 438 ;
-C 98 ; WX 420 ; N b ; B 82 -23 492 714 ;
-C 99 ; WX 340 ; N c ; B 87 -14 406 438 ;
-C 100 ; WX 440 ; N d ; B 102 -14 651 714 ;
-C 101 ; WX 340 ; N e ; B 87 -14 403 438 ;
-C 102 ; WX 320 ; N f ; B -119 -314 547 714 ; L i fi ; L l fl ;
-C 103 ; WX 400 ; N g ; B -108 -314 503 438 ;
-C 104 ; WX 440 ; N h ; B 55 -14 524 714 ;
-C 105 ; WX 240 ; N i ; B 100 -14 341 635 ;
-C 106 ; WX 220 ; N j ; B -112 -314 332 635 ;
-C 107 ; WX 440 ; N k ; B 87 -184 628 714 ;
-C 108 ; WX 240 ; N l ; B 102 -14 480 714 ;
-C 109 ; WX 620 ; N m ; B 86 -14 704 438 ;
-C 110 ; WX 460 ; N n ; B 101 -14 544 438 ;
-C 111 ; WX 400 ; N o ; B 87 -14 449 438 ;
-C 112 ; WX 440 ; N p ; B -23 -314 484 432 ;
-C 113 ; WX 400 ; N q ; B 87 -300 490 510 ;
-C 114 ; WX 300 ; N r ; B 101 -14 424 438 ;
-C 115 ; WX 320 ; N s ; B 46 -14 403 438 ;
-C 116 ; WX 320 ; N t ; B 106 -14 426 539 ;
-C 117 ; WX 460 ; N u ; B 102 -14 528 438 ;
-C 118 ; WX 440 ; N v ; B 87 -14 533 488 ;
-C 119 ; WX 680 ; N w ; B 87 -14 782 488 ;
-C 120 ; WX 420 ; N x ; B 70 -195 589 438 ;
-C 121 ; WX 400 ; N y ; B -24 -314 483 438 ;
-C 122 ; WX 440 ; N z ; B 26 -14 508 445 ;
-C 123 ; WX 240 ; N braceleft ; B 55 -207 383 655 ;
-C 124 ; WX 520 ; N bar ; B 320 -16 378 714 ;
-C 125 ; WX 240 ; N braceright ; B -10 -207 318 655 ;
-C 126 ; WX 520 ; N asciitilde ; B 123 186 539 320 ;
-C 161 ; WX 280 ; N exclamdown ; B 72 -186 306 438 ;
-C 162 ; WX 440 ; N cent ; B 122 -134 476 543 ;
-C 163 ; WX 440 ; N sterling ; B -16 -52 506 610 ;
-C 164 ; WX 60 ; N fraction ; B -181 -16 320 610 ;
-C 165 ; WX 440 ; N yen ; B -1 -168 613 647 ;
-C 166 ; WX 440 ; N florin ; B -64 -314 582 610 ;
-C 167 ; WX 420 ; N section ; B 53 -215 514 610 ;
-C 168 ; WX 440 ; N currency ; B 50 85 474 509 ;
-C 169 ; WX 160 ; N quotesingle ; B 145 343 215 610 ;
-C 170 ; WX 340 ; N quotedblleft ; B 169 343 464 610 ;
-C 171 ; WX 340 ; N guillemotleft ; B 98 24 356 414 ;
-C 172 ; WX 240 ; N guilsinglleft ; B 98 24 258 414 ;
-C 173 ; WX 260 ; N guilsinglright ; B 106 24 266 414 ;
-C 174 ; WX 520 ; N fi ; B -124 -314 605 714 ;
-C 175 ; WX 520 ; N fl ; B -124 -314 670 714 ;
-C 177 ; WX 500 ; N endash ; B 51 199 565 239 ;
-C 178 ; WX 460 ; N dagger ; B 138 -37 568 610 ;
-C 179 ; WX 480 ; N daggerdbl ; B 138 -59 533 610 ;
-C 180 ; WX 220 ; N periodcentered ; B 139 208 241 310 ;
-C 182 ; WX 500 ; N paragraph ; B 105 -199 638 594 ;
-C 183 ; WX 600 ; N bullet ; B 228 149 524 445 ;
-C 184 ; WX 180 ; N quotesinglbase ; B 21 -121 191 146 ;
-C 185 ; WX 280 ; N quotedblbase ; B -14 -121 281 146 ;
-C 186 ; WX 360 ; N quotedblright ; B 158 343 453 610 ;
-C 187 ; WX 380 ; N guillemotright ; B 117 24 375 414 ;
-C 188 ; WX 1000 ; N ellipsis ; B 124 -14 916 128 ;
-C 189 ; WX 960 ; N perthousand ; B 112 -160 1005 700 ;
-C 191 ; WX 400 ; N questiondown ; B 82 -186 387 438 ;
-C 193 ; WX 220 ; N grave ; B 193 492 339 659 ;
-C 194 ; WX 300 ; N acute ; B 265 492 422 659 ;
-C 195 ; WX 340 ; N circumflex ; B 223 482 443 649 ;
-C 196 ; WX 440 ; N tilde ; B 243 543 522 619 ;
-C 197 ; WX 440 ; N macron ; B 222 544 465 578 ;
-C 198 ; WX 440 ; N breve ; B 253 522 501 631 ;
-C 199 ; WX 220 ; N dotaccent ; B 236 522 328 610 ;
-C 200 ; WX 360 ; N dieresis ; B 243 522 469 610 ;
-C 202 ; WX 300 ; N ring ; B 240 483 416 659 ;
-C 203 ; WX 300 ; N cedilla ; B 12 -191 184 6 ;
-C 205 ; WX 400 ; N hungarumlaut ; B 208 492 495 659 ;
-C 206 ; WX 280 ; N ogonek ; B 38 -191 233 6 ;
-C 207 ; WX 340 ; N caron ; B 254 492 474 659 ;
-C 208 ; WX 1000 ; N emdash ; B 51 199 1065 239 ;
-C 225 ; WX 740 ; N AE ; B -21 -16 799 594 ;
-C 227 ; WX 260 ; N ordfeminine ; B 111 338 386 610 ;
-C 232 ; WX 580 ; N Lslash ; B 49 -16 657 610 ;
-C 233 ; WX 660 ; N Oslash ; B 83 -78 751 672 ;
-C 234 ; WX 820 ; N OE ; B 63 -16 909 610 ;
-C 235 ; WX 260 ; N ordmasculine ; B 128 339 373 610 ;
-C 241 ; WX 540 ; N ae ; B 67 -14 624 468 ;
-C 245 ; WX 240 ; N dotlessi ; B 100 -14 306 438 ;
-C 248 ; WX 300 ; N lslash ; B 121 -14 515 714 ;
-C 249 ; WX 440 ; N oslash ; B 46 -64 540 488 ;
-C 250 ; WX 560 ; N oe ; B 78 -14 628 438 ;
-C 251 ; WX 420 ; N germandbls ; B -127 -314 542 714 ;
-C -1 ; WX 340 ; N ecircumflex ; B 87 -14 433 649 ;
-C -1 ; WX 340 ; N edieresis ; B 87 -14 449 610 ;
-C -1 ; WX 420 ; N aacute ; B 92 -15 492 659 ;
-C -1 ; WX 740 ; N registered ; B 137 -16 763 610 ;
-C -1 ; WX 240 ; N icircumflex ; B 100 -14 363 649 ;
-C -1 ; WX 460 ; N udieresis ; B 102 -14 528 610 ;
-C -1 ; WX 400 ; N ograve ; B 87 -14 449 659 ;
-C -1 ; WX 460 ; N uacute ; B 102 -14 528 659 ;
-C -1 ; WX 460 ; N ucircumflex ; B 102 -14 528 649 ;
-C -1 ; WX 620 ; N Aacute ; B 13 -16 702 821 ;
-C -1 ; WX 240 ; N igrave ; B 100 -14 306 659 ;
-C -1 ; WX 380 ; N Icircumflex ; B 99 0 504 821 ;
-C -1 ; WX 340 ; N ccedilla ; B 62 -191 406 438 ;
-C -1 ; WX 420 ; N adieresis ; B 92 -15 485 610 ;
-C -1 ; WX 620 ; N Ecircumflex ; B 91 -12 709 821 ;
-C -1 ; WX 320 ; N scaron ; B 46 -14 464 659 ;
-C -1 ; WX 440 ; N thorn ; B -38 -314 505 714 ;
-C -1 ; WX 1000 ; N trademark ; B 127 187 1046 594 ;
-C -1 ; WX 340 ; N egrave ; B 87 -14 403 659 ;
-C -1 ; WX 264 ; N threesuperior ; B 59 234 348 610 ;
-C -1 ; WX 440 ; N zcaron ; B 26 -14 514 659 ;
-C -1 ; WX 420 ; N atilde ; B 92 -15 522 619 ;
-C -1 ; WX 420 ; N aring ; B 92 -15 485 659 ;
-C -1 ; WX 400 ; N ocircumflex ; B 87 -14 453 649 ;
-C -1 ; WX 620 ; N Edieresis ; B 91 -12 709 762 ;
-C -1 ; WX 660 ; N threequarters ; B 39 -16 706 610 ;
-C -1 ; WX 400 ; N ydieresis ; B -24 -314 483 610 ;
-C -1 ; WX 400 ; N yacute ; B -24 -314 483 659 ;
-C -1 ; WX 240 ; N iacute ; B 100 -14 392 659 ;
-C -1 ; WX 620 ; N Acircumflex ; B 13 -16 697 821 ;
-C -1 ; WX 740 ; N Uacute ; B 126 -16 792 821 ;
-C -1 ; WX 340 ; N eacute ; B 87 -14 462 659 ;
-C -1 ; WX 600 ; N Ograve ; B 94 -16 660 821 ;
-C -1 ; WX 420 ; N agrave ; B 92 -15 485 659 ;
-C -1 ; WX 740 ; N Udieresis ; B 126 -16 792 762 ;
-C -1 ; WX 420 ; N acircumflex ; B 92 -15 485 649 ;
-C -1 ; WX 380 ; N Igrave ; B 99 0 504 821 ;
-C -1 ; WX 264 ; N twosuperior ; B 72 234 354 610 ;
-C -1 ; WX 740 ; N Ugrave ; B 126 -16 792 821 ;
-C -1 ; WX 660 ; N onequarter ; B 56 -16 702 610 ;
-C -1 ; WX 740 ; N Ucircumflex ; B 126 -16 792 821 ;
-C -1 ; WX 460 ; N Scaron ; B 45 -81 594 831 ;
-C -1 ; WX 380 ; N Idieresis ; B 99 0 519 762 ;
-C -1 ; WX 240 ; N idieresis ; B 100 -14 369 610 ;
-C -1 ; WX 620 ; N Egrave ; B 91 -12 709 821 ;
-C -1 ; WX 600 ; N Oacute ; B 94 -16 660 821 ;
-C -1 ; WX 520 ; N divide ; B 117 -14 543 440 ;
-C -1 ; WX 620 ; N Atilde ; B 13 -16 702 771 ;
-C -1 ; WX 620 ; N Aring ; B 13 -16 697 831 ;
-C -1 ; WX 600 ; N Odieresis ; B 94 -16 660 762 ;
-C -1 ; WX 620 ; N Adieresis ; B 13 -16 709 762 ;
-C -1 ; WX 700 ; N Ntilde ; B 85 -168 915 761 ;
-C -1 ; WX 620 ; N Zcaron ; B 42 -19 669 831 ;
-C -1 ; WX 540 ; N Thorn ; B 52 0 647 623 ;
-C -1 ; WX 380 ; N Iacute ; B 99 0 532 821 ;
-C -1 ; WX 520 ; N plusminus ; B 117 0 543 436 ;
-C -1 ; WX 520 ; N multiply ; B 133 16 527 410 ;
-C -1 ; WX 620 ; N Eacute ; B 91 -12 709 821 ;
-C -1 ; WX 560 ; N Ydieresis ; B 41 -168 774 762 ;
-C -1 ; WX 264 ; N onesuperior ; B 83 244 311 610 ;
-C -1 ; WX 460 ; N ugrave ; B 102 -14 528 659 ;
-C -1 ; WX 520 ; N logicalnot ; B 117 86 543 340 ;
-C -1 ; WX 460 ; N ntilde ; B 101 -14 544 619 ;
-C -1 ; WX 600 ; N Otilde ; B 94 -16 660 761 ;
-C -1 ; WX 400 ; N otilde ; B 87 -14 502 619 ;
-C -1 ; WX 520 ; N Ccedilla ; B 93 -191 631 610 ;
-C -1 ; WX 620 ; N Agrave ; B 13 -16 697 821 ;
-C -1 ; WX 660 ; N onehalf ; B 56 -16 702 610 ;
-C -1 ; WX 700 ; N Eth ; B 86 -6 768 640 ;
-C -1 ; WX 400 ; N degree ; B 171 324 457 610 ;
-C -1 ; WX 560 ; N Yacute ; B 41 -168 774 821 ;
-C -1 ; WX 600 ; N Ocircumflex ; B 94 -16 660 821 ;
-C -1 ; WX 400 ; N oacute ; B 87 -14 482 659 ;
-C -1 ; WX 460 ; N mu ; B 7 -314 523 438 ;
-C -1 ; WX 520 ; N minus ; B 117 184 543 242 ;
-C -1 ; WX 400 ; N eth ; B 87 -14 522 714 ;
-C -1 ; WX 400 ; N odieresis ; B 87 -14 479 610 ;
-C -1 ; WX 740 ; N copyright ; B 137 -16 763 610 ;
-C -1 ; WX 520 ; N brokenbar ; B 320 -16 378 714 ;
-EndCharMetrics
-StartKernData
-StartKernPairs 131
-
-KPX A quoteright -40
-KPX A quotedblright -40
-KPX A U -10
-KPX A T 10
-KPX A Q 10
-KPX A O 10
-KPX A G -30
-KPX A C 20
-
-KPX D period -30
-KPX D comma -20
-KPX D Y 10
-KPX D A -10
-
-KPX F period -40
-KPX F i 10
-KPX F comma -30
-
-KPX G period -20
-KPX G comma -10
-
-KPX J period -20
-KPX J comma -10
-
-KPX K u -20
-KPX K o -20
-KPX K e -20
-
-KPX L y -10
-KPX L quoteright -25
-KPX L quotedblright -25
-KPX L W -10
-KPX L V -20
-
-KPX O period -20
-KPX O comma -10
-KPX O Y 10
-KPX O T 20
-KPX O A -20
-
-KPX P period -50
-KPX P o -10
-KPX P e -10
-KPX P comma -40
-KPX P a -20
-KPX P A -10
-
-KPX Q U -10
-
-KPX R Y 10
-KPX R W 10
-KPX R T 20
-
-KPX T o -20
-KPX T i 20
-KPX T hyphen -20
-KPX T h 20
-KPX T e -20
-KPX T a -20
-KPX T O 30
-KPX T A 10
-
-KPX V period -100
-KPX V o -20
-KPX V e -20
-KPX V comma -90
-KPX V a -20
-KPX V O 10
-KPX V G -20
-
-KPX W period -50
-KPX W o -20
-KPX W i 10
-KPX W h 10
-KPX W e -20
-KPX W comma -40
-KPX W a -20
-KPX W O 10
-
-KPX Y u -20
-KPX Y period -50
-KPX Y o -50
-KPX Y i 10
-KPX Y e -40
-KPX Y comma -40
-KPX Y a -60
-
-KPX b period -30
-KPX b l -20
-KPX b comma -20
-KPX b b -20
-
-KPX c k -10
-
-KPX comma quoteright -70
-KPX comma quotedblright -70
-
-KPX d w -20
-KPX d v -10
-KPX d d -40
-
-KPX e y 10
-
-KPX f quoteright 30
-KPX f quotedblright 30
-KPX f period -50
-KPX f f -50
-KPX f e -10
-KPX f comma -40
-KPX f a -20
-
-KPX g y 10
-KPX g period -30
-KPX g i 10
-KPX g e 10
-KPX g comma -20
-KPX g a 10
-
-KPX k y 10
-KPX k o -10
-KPX k e -20
-
-KPX m y 10
-KPX m u 10
-
-KPX n y 20
-
-KPX o period -30
-KPX o comma -20
-
-KPX p period -30
-KPX p p -10
-KPX p comma -20
-
-KPX period quoteright -80
-KPX period quotedblright -80
-
-KPX quotedblleft quoteleft 20
-KPX quotedblleft A 10
-
-KPX quoteleft quoteleft -115
-KPX quoteleft A 10
-
-KPX quoteright v 30
-KPX quoteright t 20
-KPX quoteright s -25
-KPX quoteright r 30
-KPX quoteright quoteright -115
-KPX quoteright quotedblright 20
-KPX quoteright l 20
-
-KPX r period -50
-KPX r i 10
-KPX r comma -40
-
-KPX s period -20
-KPX s comma -10
-
-KPX v period -30
-KPX v comma -20
-
-KPX w period -30
-KPX w o 10
-KPX w h 20
-KPX w comma -20
-EndKernPairs
-EndKernData
-StartComposites 56
-CC Aacute 2 ; PCC A 0 0 ; PCC acute 280 162 ;
-CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 240 172 ;
-CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 240 152 ;
-CC Agrave 2 ; PCC A 0 0 ; PCC grave 250 162 ;
-CC Aring 2 ; PCC A 0 0 ; PCC ring 260 172 ;
-CC Atilde 2 ; PCC A 0 0 ; PCC tilde 180 152 ;
-CC Eacute 2 ; PCC E 0 0 ; PCC acute 230 162 ;
-CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 180 172 ;
-CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 170 152 ;
-CC Egrave 2 ; PCC E 0 0 ; PCC grave 220 162 ;
-CC Iacute 2 ; PCC I 0 0 ; PCC acute 110 162 ;
-CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 60 172 ;
-CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 50 152 ;
-CC Igrave 2 ; PCC I 0 0 ; PCC grave 100 162 ;
-CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 210 142 ;
-CC Oacute 2 ; PCC O 0 0 ; PCC acute 160 162 ;
-CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 130 172 ;
-CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 120 152 ;
-CC Ograve 2 ; PCC O 0 0 ; PCC grave 150 162 ;
-CC Otilde 2 ; PCC O 0 0 ; PCC tilde 90 142 ;
-CC Scaron 2 ; PCC S 0 0 ; PCC caron 120 172 ;
-CC Uacute 2 ; PCC U 0 0 ; PCC acute 310 162 ;
-CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 260 172 ;
-CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 260 152 ;
-CC Ugrave 2 ; PCC U 0 0 ; PCC grave 270 162 ;
-CC Yacute 2 ; PCC Y 0 0 ; PCC acute 220 162 ;
-CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 170 152 ;
-CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 130 172 ;
-CC aacute 2 ; PCC a 0 0 ; PCC acute 70 0 ;
-CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 20 0 ;
-CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 10 0 ;
-CC agrave 2 ; PCC a 0 0 ; PCC grave 80 0 ;
-CC aring 2 ; PCC a 0 0 ; PCC ring 60 0 ;
-CC atilde 2 ; PCC a 0 0 ; PCC tilde 0 0 ;
-CC eacute 2 ; PCC e 0 0 ; PCC acute 40 0 ;
-CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex -10 0 ;
-CC edieresis 2 ; PCC e 0 0 ; PCC dieresis -20 0 ;
-CC egrave 2 ; PCC e 0 0 ; PCC grave 30 0 ;
-CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -30 0 ;
-CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -80 0 ;
-CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -100 0 ;
-CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -40 0 ;
-CC ntilde 2 ; PCC n 0 0 ; PCC tilde 10 0 ;
-CC oacute 2 ; PCC o 0 0 ; PCC acute 60 0 ;
-CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 10 0 ;
-CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 10 0 ;
-CC ograve 2 ; PCC o 0 0 ; PCC grave 60 0 ;
-CC otilde 2 ; PCC o 0 0 ; PCC tilde -20 0 ;
-CC scaron 2 ; PCC s 0 0 ; PCC caron -10 0 ;
-CC uacute 2 ; PCC u 0 0 ; PCC acute 70 0 ;
-CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 30 0 ;
-CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 20 0 ;
-CC ugrave 2 ; PCC u 0 0 ; PCC grave 50 0 ;
-CC yacute 2 ; PCC y 0 0 ; PCC acute 60 0 ;
-CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 0 0 ;
-CC zcaron 2 ; PCC z 0 0 ; PCC caron 40 0 ;
-EndComposites
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/afm/ZapfDingbats.afm b/blt3.0.1/library/afm/ZapfDingbats.afm
deleted file mode 100644
index 24fd05e..0000000
--- a/blt3.0.1/library/afm/ZapfDingbats.afm
+++ /dev/null
@@ -1,223 +0,0 @@
-StartFontMetrics 2.0
-Comment Copyright (c) 1985, 1987, 1988, 1989 Adobe Systems Incorporated. All rights reserved.
-Comment Creation Date: Fri Dec 1 12:57:42 1989
-Comment UniqueID 26200
-Comment VMusage 39281 49041
-FontName ZapfDingbats
-FullName ITC Zapf Dingbats
-FamilyName ITC Zapf Dingbats
-Weight Medium
-ItalicAngle 0
-IsFixedPitch false
-FontBBox -1 -143 981 820
-UnderlinePosition -98
-UnderlineThickness 54
-Version 001.004
-Notice Copyright (c) 1985, 1987, 1988, 1989 Adobe Systems Incorporated. All rights reserved.ITC Zapf Dingbats is a registered trademark of International Typeface Corporation.
-EncodingScheme FontSpecific
-StartCharMetrics 202
-C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
-C 33 ; WX 974 ; N a1 ; B 35 72 939 621 ;
-C 34 ; WX 961 ; N a2 ; B 35 81 927 611 ;
-C 35 ; WX 974 ; N a202 ; B 35 72 939 621 ;
-C 36 ; WX 980 ; N a3 ; B 35 0 945 692 ;
-C 37 ; WX 719 ; N a4 ; B 34 139 685 566 ;
-C 38 ; WX 789 ; N a5 ; B 35 -14 755 705 ;
-C 39 ; WX 790 ; N a119 ; B 35 -14 755 705 ;
-C 40 ; WX 791 ; N a118 ; B 35 -13 761 705 ;
-C 41 ; WX 690 ; N a117 ; B 35 138 655 553 ;
-C 42 ; WX 960 ; N a11 ; B 35 123 925 568 ;
-C 43 ; WX 939 ; N a12 ; B 35 134 904 559 ;
-C 44 ; WX 549 ; N a13 ; B 29 -11 516 705 ;
-C 45 ; WX 855 ; N a14 ; B 34 59 820 632 ;
-C 46 ; WX 911 ; N a15 ; B 35 50 876 642 ;
-C 47 ; WX 933 ; N a16 ; B 35 139 899 550 ;
-C 48 ; WX 911 ; N a105 ; B 35 50 876 642 ;
-C 49 ; WX 945 ; N a17 ; B 35 139 909 553 ;
-C 50 ; WX 974 ; N a18 ; B 35 104 938 587 ;
-C 51 ; WX 755 ; N a19 ; B 34 -13 721 705 ;
-C 52 ; WX 846 ; N a20 ; B 36 -14 811 705 ;
-C 53 ; WX 762 ; N a21 ; B 35 0 727 692 ;
-C 54 ; WX 761 ; N a22 ; B 35 0 727 692 ;
-C 55 ; WX 571 ; N a23 ; B -1 -68 571 661 ;
-C 56 ; WX 677 ; N a24 ; B 36 -13 642 705 ;
-C 57 ; WX 763 ; N a25 ; B 35 0 728 692 ;
-C 58 ; WX 760 ; N a26 ; B 35 0 726 692 ;
-C 59 ; WX 759 ; N a27 ; B 35 0 725 692 ;
-C 60 ; WX 754 ; N a28 ; B 35 0 720 692 ;
-C 61 ; WX 494 ; N a6 ; B 35 0 460 692 ;
-C 62 ; WX 552 ; N a7 ; B 35 0 517 692 ;
-C 63 ; WX 537 ; N a8 ; B 35 0 503 692 ;
-C 64 ; WX 577 ; N a9 ; B 35 96 542 596 ;
-C 65 ; WX 692 ; N a10 ; B 35 -14 657 705 ;
-C 66 ; WX 786 ; N a29 ; B 35 -14 751 705 ;
-C 67 ; WX 788 ; N a30 ; B 35 -14 752 705 ;
-C 68 ; WX 788 ; N a31 ; B 35 -14 753 705 ;
-C 69 ; WX 790 ; N a32 ; B 35 -14 756 705 ;
-C 70 ; WX 793 ; N a33 ; B 35 -13 759 705 ;
-C 71 ; WX 794 ; N a34 ; B 35 -13 759 705 ;
-C 72 ; WX 816 ; N a35 ; B 35 -14 782 705 ;
-C 73 ; WX 823 ; N a36 ; B 35 -14 787 705 ;
-C 74 ; WX 789 ; N a37 ; B 35 -14 754 705 ;
-C 75 ; WX 841 ; N a38 ; B 35 -14 807 705 ;
-C 76 ; WX 823 ; N a39 ; B 35 -14 789 705 ;
-C 77 ; WX 833 ; N a40 ; B 35 -14 798 705 ;
-C 78 ; WX 816 ; N a41 ; B 35 -13 782 705 ;
-C 79 ; WX 831 ; N a42 ; B 35 -14 796 705 ;
-C 80 ; WX 923 ; N a43 ; B 35 -14 888 705 ;
-C 81 ; WX 744 ; N a44 ; B 35 0 710 692 ;
-C 82 ; WX 723 ; N a45 ; B 35 0 688 692 ;
-C 83 ; WX 749 ; N a46 ; B 35 0 714 692 ;
-C 84 ; WX 790 ; N a47 ; B 34 -14 756 705 ;
-C 85 ; WX 792 ; N a48 ; B 35 -14 758 705 ;
-C 86 ; WX 695 ; N a49 ; B 35 -14 661 706 ;
-C 87 ; WX 776 ; N a50 ; B 35 -6 741 699 ;
-C 88 ; WX 768 ; N a51 ; B 35 -7 734 699 ;
-C 89 ; WX 792 ; N a52 ; B 35 -14 757 705 ;
-C 90 ; WX 759 ; N a53 ; B 35 0 725 692 ;
-C 91 ; WX 707 ; N a54 ; B 35 -13 672 704 ;
-C 92 ; WX 708 ; N a55 ; B 35 -14 672 705 ;
-C 93 ; WX 682 ; N a56 ; B 35 -14 647 705 ;
-C 94 ; WX 701 ; N a57 ; B 35 -14 666 705 ;
-C 95 ; WX 826 ; N a58 ; B 35 -14 791 705 ;
-C 96 ; WX 815 ; N a59 ; B 35 -14 780 705 ;
-C 97 ; WX 789 ; N a60 ; B 35 -14 754 705 ;
-C 98 ; WX 789 ; N a61 ; B 35 -14 754 705 ;
-C 99 ; WX 707 ; N a62 ; B 34 -14 673 705 ;
-C 100 ; WX 687 ; N a63 ; B 36 0 651 692 ;
-C 101 ; WX 696 ; N a64 ; B 35 0 661 691 ;
-C 102 ; WX 689 ; N a65 ; B 35 0 655 692 ;
-C 103 ; WX 786 ; N a66 ; B 34 -14 751 705 ;
-C 104 ; WX 787 ; N a67 ; B 35 -14 752 705 ;
-C 105 ; WX 713 ; N a68 ; B 35 -14 678 705 ;
-C 106 ; WX 791 ; N a69 ; B 35 -14 756 705 ;
-C 107 ; WX 785 ; N a70 ; B 36 -14 751 705 ;
-C 108 ; WX 791 ; N a71 ; B 35 -14 757 705 ;
-C 109 ; WX 873 ; N a72 ; B 35 -14 838 705 ;
-C 110 ; WX 761 ; N a73 ; B 35 0 726 692 ;
-C 111 ; WX 762 ; N a74 ; B 35 0 727 692 ;
-C 112 ; WX 762 ; N a203 ; B 35 0 727 692 ;
-C 113 ; WX 759 ; N a75 ; B 35 0 725 692 ;
-C 114 ; WX 759 ; N a204 ; B 35 0 725 692 ;
-C 115 ; WX 892 ; N a76 ; B 35 0 858 705 ;
-C 116 ; WX 892 ; N a77 ; B 35 -14 858 692 ;
-C 117 ; WX 788 ; N a78 ; B 35 -14 754 705 ;
-C 118 ; WX 784 ; N a79 ; B 35 -14 749 705 ;
-C 119 ; WX 438 ; N a81 ; B 35 -14 403 705 ;
-C 120 ; WX 138 ; N a82 ; B 35 0 104 692 ;
-C 121 ; WX 277 ; N a83 ; B 35 0 242 692 ;
-C 122 ; WX 415 ; N a84 ; B 35 0 380 692 ;
-C 123 ; WX 392 ; N a97 ; B 35 263 357 705 ;
-C 124 ; WX 392 ; N a98 ; B 34 263 357 705 ;
-C 125 ; WX 668 ; N a99 ; B 35 263 633 705 ;
-C 126 ; WX 668 ; N a100 ; B 36 263 634 705 ;
-C 161 ; WX 732 ; N a101 ; B 35 -143 697 806 ;
-C 162 ; WX 544 ; N a102 ; B 56 -14 488 706 ;
-C 163 ; WX 544 ; N a103 ; B 34 -14 508 705 ;
-C 164 ; WX 910 ; N a104 ; B 35 40 875 651 ;
-C 165 ; WX 667 ; N a106 ; B 35 -14 633 705 ;
-C 166 ; WX 760 ; N a107 ; B 35 -14 726 705 ;
-C 167 ; WX 760 ; N a108 ; B 0 121 758 569 ;
-C 168 ; WX 776 ; N a112 ; B 35 0 741 705 ;
-C 169 ; WX 595 ; N a111 ; B 34 -14 560 705 ;
-C 170 ; WX 694 ; N a110 ; B 35 -14 659 705 ;
-C 171 ; WX 626 ; N a109 ; B 34 0 591 705 ;
-C 172 ; WX 788 ; N a120 ; B 35 -14 754 705 ;
-C 173 ; WX 788 ; N a121 ; B 35 -14 754 705 ;
-C 174 ; WX 788 ; N a122 ; B 35 -14 754 705 ;
-C 175 ; WX 788 ; N a123 ; B 35 -14 754 705 ;
-C 176 ; WX 788 ; N a124 ; B 35 -14 754 705 ;
-C 177 ; WX 788 ; N a125 ; B 35 -14 754 705 ;
-C 178 ; WX 788 ; N a126 ; B 35 -14 754 705 ;
-C 179 ; WX 788 ; N a127 ; B 35 -14 754 705 ;
-C 180 ; WX 788 ; N a128 ; B 35 -14 754 705 ;
-C 181 ; WX 788 ; N a129 ; B 35 -14 754 705 ;
-C 182 ; WX 788 ; N a130 ; B 35 -14 754 705 ;
-C 183 ; WX 788 ; N a131 ; B 35 -14 754 705 ;
-C 184 ; WX 788 ; N a132 ; B 35 -14 754 705 ;
-C 185 ; WX 788 ; N a133 ; B 35 -14 754 705 ;
-C 186 ; WX 788 ; N a134 ; B 35 -14 754 705 ;
-C 187 ; WX 788 ; N a135 ; B 35 -14 754 705 ;
-C 188 ; WX 788 ; N a136 ; B 35 -14 754 705 ;
-C 189 ; WX 788 ; N a137 ; B 35 -14 754 705 ;
-C 190 ; WX 788 ; N a138 ; B 35 -14 754 705 ;
-C 191 ; WX 788 ; N a139 ; B 35 -14 754 705 ;
-C 192 ; WX 788 ; N a140 ; B 35 -14 754 705 ;
-C 193 ; WX 788 ; N a141 ; B 35 -14 754 705 ;
-C 194 ; WX 788 ; N a142 ; B 35 -14 754 705 ;
-C 195 ; WX 788 ; N a143 ; B 35 -14 754 705 ;
-C 196 ; WX 788 ; N a144 ; B 35 -14 754 705 ;
-C 197 ; WX 788 ; N a145 ; B 35 -14 754 705 ;
-C 198 ; WX 788 ; N a146 ; B 35 -14 754 705 ;
-C 199 ; WX 788 ; N a147 ; B 35 -14 754 705 ;
-C 200 ; WX 788 ; N a148 ; B 35 -14 754 705 ;
-C 201 ; WX 788 ; N a149 ; B 35 -14 754 705 ;
-C 202 ; WX 788 ; N a150 ; B 35 -14 754 705 ;
-C 203 ; WX 788 ; N a151 ; B 35 -14 754 705 ;
-C 204 ; WX 788 ; N a152 ; B 35 -14 754 705 ;
-C 205 ; WX 788 ; N a153 ; B 35 -14 754 705 ;
-C 206 ; WX 788 ; N a154 ; B 35 -14 754 705 ;
-C 207 ; WX 788 ; N a155 ; B 35 -14 754 705 ;
-C 208 ; WX 788 ; N a156 ; B 35 -14 754 705 ;
-C 209 ; WX 788 ; N a157 ; B 35 -14 754 705 ;
-C 210 ; WX 788 ; N a158 ; B 35 -14 754 705 ;
-C 211 ; WX 788 ; N a159 ; B 35 -14 754 705 ;
-C 212 ; WX 894 ; N a160 ; B 35 58 860 634 ;
-C 213 ; WX 838 ; N a161 ; B 35 152 803 540 ;
-C 214 ; WX 1016 ; N a163 ; B 34 152 981 540 ;
-C 215 ; WX 458 ; N a164 ; B 35 -127 422 820 ;
-C 216 ; WX 748 ; N a196 ; B 35 94 698 597 ;
-C 217 ; WX 924 ; N a165 ; B 35 140 890 552 ;
-C 218 ; WX 748 ; N a192 ; B 35 94 698 597 ;
-C 219 ; WX 918 ; N a166 ; B 35 166 884 526 ;
-C 220 ; WX 927 ; N a167 ; B 35 32 892 660 ;
-C 221 ; WX 928 ; N a168 ; B 35 129 891 562 ;
-C 222 ; WX 928 ; N a169 ; B 35 128 893 563 ;
-C 223 ; WX 834 ; N a170 ; B 35 155 799 537 ;
-C 224 ; WX 873 ; N a171 ; B 35 93 838 599 ;
-C 225 ; WX 828 ; N a172 ; B 35 104 791 588 ;
-C 226 ; WX 924 ; N a173 ; B 35 98 889 594 ;
-C 227 ; WX 924 ; N a162 ; B 35 98 889 594 ;
-C 228 ; WX 917 ; N a174 ; B 35 0 882 692 ;
-C 229 ; WX 930 ; N a175 ; B 35 84 896 608 ;
-C 230 ; WX 931 ; N a176 ; B 35 84 896 608 ;
-C 231 ; WX 463 ; N a177 ; B 35 -99 429 791 ;
-C 232 ; WX 883 ; N a178 ; B 35 71 848 623 ;
-C 233 ; WX 836 ; N a179 ; B 35 44 802 648 ;
-C 234 ; WX 836 ; N a193 ; B 35 44 802 648 ;
-C 235 ; WX 867 ; N a180 ; B 35 101 832 591 ;
-C 236 ; WX 867 ; N a199 ; B 35 101 832 591 ;
-C 237 ; WX 696 ; N a181 ; B 35 44 661 648 ;
-C 238 ; WX 696 ; N a200 ; B 35 44 661 648 ;
-C 239 ; WX 874 ; N a182 ; B 35 77 840 619 ;
-C 241 ; WX 874 ; N a201 ; B 35 73 840 615 ;
-C 242 ; WX 760 ; N a183 ; B 35 0 725 692 ;
-C 243 ; WX 946 ; N a184 ; B 35 160 911 533 ;
-C 244 ; WX 771 ; N a197 ; B 34 37 736 655 ;
-C 245 ; WX 865 ; N a185 ; B 35 207 830 481 ;
-C 246 ; WX 771 ; N a194 ; B 34 37 736 655 ;
-C 247 ; WX 888 ; N a198 ; B 34 -19 853 712 ;
-C 248 ; WX 967 ; N a186 ; B 35 124 932 568 ;
-C 249 ; WX 888 ; N a195 ; B 34 -19 853 712 ;
-C 250 ; WX 831 ; N a187 ; B 35 113 796 579 ;
-C 251 ; WX 873 ; N a188 ; B 36 118 838 578 ;
-C 252 ; WX 927 ; N a189 ; B 35 150 891 542 ;
-C 253 ; WX 970 ; N a190 ; B 35 76 931 616 ;
-C 254 ; WX 918 ; N a191 ; B 34 99 884 593 ;
-C -1 ; WX 410 ; N a86 ; B 35 0 375 692 ;
-C -1 ; WX 509 ; N a85 ; B 35 0 475 692 ;
-C -1 ; WX 334 ; N a95 ; B 35 0 299 692 ;
-C -1 ; WX 509 ; N a205 ; B 35 0 475 692 ;
-C -1 ; WX 390 ; N a89 ; B 35 -14 356 705 ;
-C -1 ; WX 234 ; N a87 ; B 35 -14 199 705 ;
-C -1 ; WX 276 ; N a91 ; B 35 0 242 692 ;
-C -1 ; WX 390 ; N a90 ; B 35 -14 355 705 ;
-C -1 ; WX 410 ; N a206 ; B 35 0 375 692 ;
-C -1 ; WX 317 ; N a94 ; B 35 0 283 692 ;
-C -1 ; WX 317 ; N a93 ; B 35 0 283 692 ;
-C -1 ; WX 276 ; N a92 ; B 35 0 242 692 ;
-C -1 ; WX 334 ; N a96 ; B 35 0 299 692 ;
-C -1 ; WX 234 ; N a88 ; B 35 -14 199 705 ;
-EndCharMetrics
-EndFontMetrics
-
\ No newline at end of file
diff --git a/blt3.0.1/library/bltCanvEps.pro b/blt3.0.1/library/bltCanvEps.pro
deleted file mode 100644
index 7b275aa..0000000
--- a/blt3.0.1/library/bltCanvEps.pro
+++ /dev/null
@@ -1,78 +0,0 @@
-%
-% PostScript encapulator prolog file of the BLT "eps" canvas item.
-%
-% Copyright 1991-1997 Bell Labs Innovations for Lucent Technologies.
-%
-% Permission to use, copy, modify, and distribute this software and its
-% documentation for any purpose and without fee is hereby granted, provided
-% that the above copyright notice appear in all copies and that both that the
-% copyright notice and warranty disclaimer appear in supporting documentation,
-% and that the names of Lucent Technologies any of their entities not be used
-% in advertising or publicity pertaining to distribution of the software
-% without specific, written prior permission.
-%
-% Lucent Technologies disclaims all warranties with regard to this software,
-% including all implied warranties of merchantability and fitness. In no event
-% shall Lucent Technologies be liable for any special, indirect or
-% consequential damages or any damages whatsoever resulting from loss of use,
-% data or profits, whether in an action of contract, negligence or other
-% tortuous action, arising out of or in connection with the use or performance
-% of this software.
-%
-
-%
-% The definitions of the next two macros are from Appendix H of
-% Adobe's "PostScript Language Reference Manual" pp. 709-736.
-%
-
-% Prepare for EPS file
-
-/BeginEPSF {
- /beforeInclusionState save def
- /dictCount countdictstack def % Save the # objects in the dictionary
- /opCount count 1 sub def % Count object on operator stack
- userdict begin % Make "userdict" the current
- % dictionary
- /showpage {} def % Redefine showpage to be null
- 0 setgray
- 0 setlinecap
- 1 setlinewidth
- 0 setlinejoin
- 10 setmiterlimit
- [] 0 setdash
- newpath
- /languagellevel where {
- pop languagelevel
- 1 ne {
- false setstrokeadjust false setoverprint
- } if
- } if
- % note: no "end"
-} bind def
-
-/EndEPSF { %def
- count opCount sub {
- pop
- } repeat
- countdictstack dictCount sub {
- end % Clean up dictionary stack
- } repeat
- beforeInclusionState restore
-} bind def
-
-
-%
-% Set up a clip region based upon a bounding box (x1, y1, x2, y2).
-%
-/SetClipRegion {
- % Stack: x1 y1 x2 y2
- newpath
- 4 2 roll moveto
- 1 index 0 rlineto
- 0 exch rlineto
- neg 0 rlineto
- closepath
- clip
- newpath
-} def
-
diff --git a/blt3.0.1/library/bltGraph.pro b/blt3.0.1/library/bltGraph.pro
deleted file mode 100644
index 813d92a..0000000
--- a/blt3.0.1/library/bltGraph.pro
+++ /dev/null
@@ -1,472 +0,0 @@
-
-%%BeginProlog
-%
-% PostScript prolog file of the BLT graph widget.
-%
-% Copyright 1989-1992 Regents of the University of California.
-% Permission to use, copy, modify, and distribute this
-% software and its documentation for any purpose and without
-% fee is hereby granted, provided that the above copyright
-% notice appear in all copies. The University of California
-% makes no representations about the suitability of this
-% software for any purpose. It is provided "as is" without
-% express or implied warranty.
-%
-% Copyright 1991-1997 Bell Labs Innovations for Lucent Technologies.
-%
-% Permission to use, copy, modify, and distribute this software and its
-% documentation for any purpose and without fee is hereby granted, provided
-% that the above copyright notice appear in all copies and that both that the
-% copyright notice and warranty disclaimer appear in supporting documentation,
-% and that the names of Lucent Technologies any of their entities not be used
-% in advertising or publicity pertaining to distribution of the software
-% without specific, written prior permission.
-%
-% Lucent Technologies disclaims all warranties with regard to this software,
-% including all implied warranties of merchantability and fitness. In no event
-% shall Lucent Technologies be liable for any special, indirect or
-% consequential damages or any damages whatsoever resulting from loss of use,
-% data or profits, whether in an action of contract, negligence or other
-% tortuous action, arising out of or in connection with the use or performance
-% of this software.
-%
-
-200 dict begin
-
-/BaseRatio 1.3467736870885982 def % Ratio triangle base / symbol size
-/BgColorProc 0 def % Background color routine (symbols)
-/DrawSymbolProc 0 def % Routine to draw symbol outline/fill
-/StippleProc 0 def % Stipple routine (bar segments)
-/DashesProc 0 def % Dashes routine (line segments)
-
-% Define the array ISOLatin1Encoding (which specifies how characters are
-% encoded for ISO-8859-1 fonts), if it isn't already present (Postscript
-% level 2 is supposed to define it, but level 1 doesn't).
-
-systemdict /ISOLatin1Encoding known not {
- /ISOLatin1Encoding [
- /space /space /space /space /space /space /space /space
- /space /space /space /space /space /space /space /space
- /space /space /space /space /space /space /space /space
- /space /space /space /space /space /space /space /space
- /space /exclam /quotedbl /numbersign /dollar /percent /ampersand
- /quoteright
- /parenleft /parenright /asterisk /plus /comma /minus /period /slash
- /zero /one /two /three /four /five /six /seven
- /eight /nine /colon /semicolon /less /equal /greater /question
- /at /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 /bracketleft /backslash /bracketright /asciicircum /underscore
- /quoteleft /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 /braceleft /bar /braceright /asciitilde /space
- /space /space /space /space /space /space /space /space
- /space /space /space /space /space /space /space /space
- /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent
- /dieresis /space /ring /cedilla /space /hungarumlaut /ogonek /caron
- /space /exclamdown /cent /sterling /currency /yen /brokenbar /section
- /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen
- /registered /macron
- /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph
- /periodcentered
- /cedillar /onesuperior /ordmasculine /guillemotright /onequarter
- /onehalf /threequarters /questiondown
- /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
- /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex
- /Idieresis
- /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply
- /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn
- /germandbls
- /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
- /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex
- /idieresis
- /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide
- /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn
- /ydieresis
- ] def
-} if
-
-% font ISOEncode font
-% This procedure changes the encoding of a font from the default
-% Postscript encoding to ISOLatin1. It is typically invoked just
-% before invoking "setfont". The body of this procedure comes from
-% Section 5.6.1 of the Postscript book.
-
-/ISOEncode {
- dup length dict
- begin
- {1 index /FID ne {def} {pop pop} ifelse} forall
- /Encoding ISOLatin1Encoding def
- currentdict
- end
-
- % I'm not sure why it's necessary to use "definefont" on this new
- % font, but it seems to be important; just use the name "Temporary"
- % for the font.
-
- /Temporary exch definefont
-} bind def
-
-/Stroke {
- gsave
- stroke
- grestore
-} def
-
-/Fill {
- gsave
- fill
- grestore
-} def
-
-/SetFont {
- % Stack: pointSize fontName
- findfont exch scalefont ISOEncode setfont
-} def
-
-/Box {
- % Stack: x y width height
- newpath
- exch 4 2 roll moveto
- dup 0 rlineto
- exch 0 exch rlineto
- neg 0 rlineto
- closepath
-} def
-
-% The next two definitions are taken from "$tk_library/prolog.ps"
-
-% desiredSize EvenPixels closestSize
-%
-% The procedure below is used for stippling. Given the optimal size
-% of a dot in a stipple pattern in the current user coordinate system,
-% compute the closest size that is an exact multiple of the device's
-% pixel size. This allows stipple patterns to be displayed without
-% aliasing effects.
-
-/EvenPixels {
- % Compute exact number of device pixels per stipple dot.
- dup 0 matrix currentmatrix dtransform
- dup mul exch dup mul add sqrt
-
- % Round to an integer, make sure the number is at least 1, and compute
- % user coord distance corresponding to this.
- dup round dup 1 lt {pop 1} if
- exch div mul
-} bind def
-
-% width height string filled StippleFill --
-%
-% Given a path and other graphics information already set up, this
-% procedure will fill the current path in a stippled fashion. "String"
-% contains a proper image description of the stipple pattern and
-% "width" and "height" give its dimensions. If "filled" is true then
-% it means that the area to be stippled is gotten by filling the
-% current path (e.g. the interior of a polygon); if it's false, the
-% area is gotten by stroking the current path (e.g. a wide line).
-% Each stipple dot is assumed to be about one unit across in the
-% current user coordinate system.
-
-% width height string StippleFill --
-%
-% Given a path already set up and a clipping region generated from
-% it, this procedure will fill the clipping region with a stipple
-% pattern. "String" contains a proper image description of the
-% stipple pattern and "width" and "height" give its dimensions. Each
-% stipple dot is assumed to be about one unit across in the current
-% user coordinate system. This procedure trashes the graphics state.
-
-/StippleFill {
- % The following code is needed to work around a NeWSprint bug.
-
- /tmpstip 1 index def
-
- % Change the scaling so that one user unit in user coordinates
- % corresponds to the size of one stipple dot.
- 1 EvenPixels dup scale
-
- % Compute the bounding box occupied by the path (which is now
- % the clipping region), and round the lower coordinates down
- % to the nearest starting point for the stipple pattern. Be
- % careful about negative numbers, since the rounding works
- % differently on them.
-
- pathbbox
- 4 2 roll
- 5 index div dup 0 lt {1 sub} if cvi 5 index mul 4 1 roll
- 6 index div dup 0 lt {1 sub} if cvi 6 index mul 3 2 roll
-
- % Stack now: width height string y1 y2 x1 x2
- % Below is a doubly-nested for loop to iterate across this area
- % in units of the stipple pattern size, going up columns then
- % across rows, blasting out a stipple-pattern-sized rectangle at
- % each position
-
- 6 index exch {
- 2 index 5 index 3 index {
- % Stack now: width height string y1 y2 x y
-
- gsave
- 1 index exch translate
- 5 index 5 index true matrix tmpstip imagemask
- grestore
- } for
- pop
- } for
- pop pop pop pop pop
-} bind def
-
-
-/LS { % Stack: x1 y1 x2 y2
- newpath
- 4 2 roll moveto
- lineto
- closepath
- stroke
-} def
-
-/EndText {
- %Stack :
- grestore
-} def
-
-/BeginText {
- %Stack : w h theta centerX centerY
- gsave
- % Translate the origin to the center of bounding box and rotate
- translate neg rotate
- % Translate back to the origin of the text region
- -0.5 mul exch -0.5 mul exch translate
-} def
-
-/DrawAdjText {
- %Stack : str strWidth x y
- moveto % Go to the text position
- exch dup dup 4 2 roll
-
- % Adjust character widths to get desired overall string width
- % adjust X = (desired width - real width)/#chars
-
- stringwidth pop sub exch
- length div
- 0 3 -1 roll
-
- % Flip back the scale so that the string is not drawn in reverse
-
- gsave
- 1 -1 scale
- ashow
- grestore
-} def
-
-/DrawBitmap {
- % Stack: ?bgColorProc? boolean centerX centerY width height theta imageStr
- gsave
- 6 -2 roll translate % Translate to center of bounding box
- 4 1 roll neg rotate % Rotate by theta
-
- % Find upperleft corner of bounding box
-
- 2 copy -.5 mul exch -.5 mul exch translate
- 2 copy scale % Make pixel unit scale
- newpath
- 0 0 moveto
- 0 1 lineto
- 1 1 lineto
- 1 0 lineto
- closepath
-
- % Fill rectangle with background color
-
- 4 -1 roll {
- gsave
- 4 -1 roll exec fill
- grestore
- } if
-
- % Paint the image string into the unit rectangle
-
- 2 copy true 3 -1 roll 0 0 5 -1 roll 0 0 6 array astore 5 -1 roll
- imagemask
- grestore
-} def
-
-% Symbols:
-
-% Skinny-cross
-/Sc {
- % Stack: x y symbolSize
- gsave
- 3 -2 roll translate 45 rotate
- 0 0 3 -1 roll Sp
- grestore
-} def
-
-% Skinny-plus
-/Sp {
- % Stack: x y symbolSize
- gsave
- 3 -2 roll translate
- 2 idiv
- dup 2 copy
- newpath
- neg 0
- moveto 0
- lineto
- DrawSymbolProc
- newpath
- neg 0
- exch moveto 0
- exch lineto
- DrawSymbolProc
- grestore
-} def
-
-% Cross
-/Cr {
- % Stack: x y symbolSize
- gsave
- 3 -2 roll translate 45 rotate
- 0 0 3 -1 roll Pl
- grestore
-} def
-
-% Plus
-/Pl {
- % Stack: x y symbolSize
- gsave
- 3 -2 roll translate
- dup 2 idiv
- exch 6 idiv
-
- %
- % 2 3 The plus/cross symbol is a
- % closed polygon of 12 points.
- % 0 1 4 5 The diagram to the left
- % x,y represents the positions of
- % 11 10 7 6 the points which are computed
- % below.
- % 9 8
- %
-
- newpath
- 2 copy exch neg exch neg moveto
- dup neg dup lineto
- 2 copy neg exch neg lineto
- 2 copy exch neg lineto
- dup dup neg lineto
- 2 copy neg lineto 2 copy lineto
- dup dup lineto
- 2 copy exch lineto
- 2 copy neg exch lineto
- dup dup neg exch lineto
- exch neg exch lineto
- closepath
- DrawSymbolProc
- grestore
-} def
-
-% Circle
-/Ci {
- % Stack: x y symbolSize
- gsave
- 3 copy pop moveto
- newpath
- 2 div 0 360 arc
- closepath
- DrawSymbolProc
- grestore
-} def
-
-% Square
-/Sq {
- % Stack: x y symbolSize
- gsave
- dup dup 2 div dup
- 6 -1 roll exch sub exch
- 5 -1 roll exch sub 4 -2 roll Box
- DrawSymbolProc
- grestore
-} def
-
-% Line
-/Li {
- % Stack: x y symbolSize
- gsave
- 3 1 roll exch 3 -1 roll 2 div 3 copy
- newpath
- sub exch moveto
- add exch lineto
- closepath
- stroke
- grestore
-} def
-
-% Diamond
-/Di {
- % Stack: x y symbolSize
- gsave
- 3 1 roll translate 45 rotate 0 0 3 -1 roll Sq
- grestore
-} def
-
-% Triangle
-/Tr {
- % Stack: x y symbolSize
- gsave
- 3 -2 roll translate
- BaseRatio mul 0.5 mul % Calculate 1/2 base
- dup 0 exch 30 cos mul % h1 = height above center point
- neg % b2 0 -h1
- newpath
- moveto % point 1; b2
- dup 30 sin 30 cos div mul % h2 = height below center point
- 2 copy lineto % point 2; b2 h2
- exch neg exch lineto %
- closepath
- DrawSymbolProc
- grestore
-} def
-
-% Arrow
-/Ar {
- % Stack: x y symbolSize
- gsave
- 3 -2 roll translate
- BaseRatio mul 0.5 mul % Calculate 1/2 base
- dup 0 exch 30 cos mul % h1 = height above center point
- % b2 0 h1
- newpath moveto % point 1; b2
- dup 30 sin 30 cos div mul % h2 = height below center point
- neg % -h2 b2
- 2 copy lineto % point 2; b2 h2
- exch neg exch lineto %
- closepath
- DrawSymbolProc
- grestore
-} def
-
-% Bitmap
-/Bm {
- % Stack: x y symbolSize
- gsave
- 3 1 roll translate pop DrawSymbolProc
- grestore
-} def
-
-%%EndProlog
-
-%%BeginSetup
-gsave % Save the graphics state
-
-% Default line/text style parameters
-
-1 setlinewidth % width
-1 setlinejoin % join
-0 setlinecap % cap
-[] 0 setdash % dashes
-
-0 0 0 setrgbcolor % color
-
diff --git a/blt3.0.1/library/combobutton.tcl b/blt3.0.1/library/combobutton.tcl
deleted file mode 100644
index c9825ec..0000000
--- a/blt3.0.1/library/combobutton.tcl
+++ /dev/null
@@ -1,256 +0,0 @@
-
-namespace eval blt::ComboButton {
- variable _private
- array set _private {
- activeMenu {}
- posted {}
- activeItem {}
- cursor {}
- focus {}
- oldGrab {}
- trace 0
- }
- proc trace { mesg } {
- variable _private
- if { $_private(trace) } {
- puts stderr $mesg
- }
- }
-}
-
-bind ComboButton <Enter> {
- %W activate yes
-}
-
-bind ComboButton <Leave> {
- %W activate no
-}
-
-bind ComboButton <B1-Motion> {
- blt::ComboButton::trace "ComboButton <B1-Motion> %W state=[%W cget -state]"
- blt::ComboButton::NextButton %W %X %Y
-}
-
-bind ComboButton <B1-Leave> {
- blt::ComboButton::trace "ComboButton <B1-Leave> state=[%W cget -state]"
-}
-
-# Standard Motif bindings:
-
-bind ComboButton <ButtonPress-1> {
- blt::ComboButton::trace "ComboButton <ButtonPress-1> state=[%W cget -state]"
- if { [%W cget -state] == "posted" } {
- %W unpost
- blt::ComboButton::UnpostMenu %W
- } else {
- grab -global %W
- blt::ComboButton::PostMenu %W
- }
-}
-
-bind ComboButton <ButtonRelease-1> {
- blt::ComboButton::trace \
- "ComboButton <ButtonRelease-1> state=[%W cget -state]"
- if { [winfo containing -display %W %X %Y] == "%W" } {
- blt::ComboButton::trace "invoke"
- %W invoke
- } else {
- %W activate off
- blt::ComboButton::trace "unpost"
- blt::ComboButton::UnpostMenu %W
- }
-}
-
-bind ComboButton <KeyPress-Down> {
- if { [%W cget -state] != "disabled" } {
- blt::ComboButton::PostMenu %W
- }
-}
-
-# Ignore all Alt, Meta, and Control keypresses unless explicitly bound.
-# Otherwise, if a widget binding for one of these is defined, the
-# <KeyPress> class binding will also fire and insert the character,
-# which is wrong. Ditto for Escape, Return, and Tab.
-
-bind ComboButton <Alt-KeyPress> {# nothing}
-bind ComboButton <Meta-KeyPress> { puts %K }
-bind ComboButton <Control-KeyPress> {# nothing}
-bind ComboButton <Escape> {# nothing}
-#bind ComboButton <KP_Enter> {# nothing}
-bind ComboButton <Tab> {# nothing}
-if {[string equal [tk windowingsystem] "classic"] ||
- [string equal [tk windowingsystem] "aqua"]} {
- bind ComboButton <Command-KeyPress> {# nothing}
-}
-
-
-proc blt::ComboButton::SaveGrab { w } {
- variable _private
-
- set grab [grab current $w]
- set _private(oldGrab) ""
- if { $grab != "" } {
- set type [grab status $grab]
- if { $type == "global" } {
- #set _private(oldGrab) [list grab set -global $grab]
- } else {
- #set _private(oldGrab) [list grab set $grab]
- }
- }
-}
-
-# ::blt::ComboButton::RestoreOldGrab --
-# Restores the grab to what it was before TkSaveGrabInfo was called.
-#
-
-proc ::blt::ComboButton::RestoreOldGrab {} {
- variable _private
-
- if { $_private(oldGrab) != "" } {
- # Be careful restoring the old grab, since it's window may not be
- # visible anymore.
- catch $_private(oldGrab)
- set _private(oldGrab) ""
- }
-}
-
-# ::blt::ComboButton::PostMenu --
-# Given a menubutton, this procedure does all the work of posting
-# its associated menu and unposting any other menu that is currently
-# posted.
-#
-# Arguments:
-# w - The name of the menubutton widget whose menu
-# is to be posted.
-# x, y - Root coordinates of cursor, used for positioning
-# option menus. If not specified, then the center
-# of the menubutton is used for an option menu.
-
-proc ::blt::ComboButton::PostMenu { cbutton } {
- variable _private
-
- trace "proc ComboButton::PostMenu $cbutton, state=[$cbutton cget -state]"
- if { [$cbutton cget -state] == "disabled" } {
- return
- }
- if { [$cbutton cget -state] == "posted" } {
- UnpostMenu $cbutton
- return
- }
- set menu [$cbutton cget -menu]
- if { $menu == "" } {
- return
- }
- set last $_private(posted)
- if { $last != "" } {
- UnpostMenu $last
- }
- set _private(cursor) [$cbutton cget -cursor]
- $cbutton configure -cursor arrow
-
- set _private(posted) $cbutton
- set _private(focus) [focus]
- $menu activate none
- GenerateMenuSelect $menu
-
- # If this looks like an option menubutton then post the menu so
- # that the current entry is on top of the mouse. Otherwise post
- # the menu just below the menubutton, as for a pull-down.
-
- update idletasks
- if { [catch { $cbutton post } msg] != 0 } {
- # Error posting menu (e.g. bogus -postcommand). Unpost it and
- # reflect the error.
- global errorInfo
- set savedInfo $errorInfo
- #
- UnpostMenu $cbutton
- error $msg $savedInfo
- }
-
- focus $menu
- if { [winfo viewable $menu] } {
- SaveGrab $menu
- trace "setting global grab on $menu"
- #grab -global $menu
- }
-}
-
-# ::blt::ComboButton::UnpostMenu --
-# This procedure unposts a given menu, plus all of its ancestors up
-# to (and including) a menubutton, if any. It also restores various
-# values to what they were before the menu was posted, and releases
-# a grab if there's a menubutton involved. Special notes:
-# 1. It's important to unpost all menus before releasing the grab, so
-# that any Enter-Leave events (e.g. from menu back to main
-# application) have mode NotifyGrab.
-# 2. Be sure to enclose various groups of commands in "catch" so that
-# the procedure will complete even if the menubutton or the menu
-# or the grab window has been deleted.
-#
-# Arguments:
-# menu - Name of a menu to unpost. Ignored if there
-# is a posted menubutton.
-
-proc ::blt::ComboButton::UnpostMenu { cbutton } {
- variable _private
-
- trace "proc ComboButton::UnpostMenu $cbutton"
-
- # Restore focus right away (otherwise X will take focus away when the
- # menu is unmapped and under some window managers (e.g. olvwm) we'll
- # lose the focus completely).
- catch { focus $_private(focus) }
- set _private(focus) ""
-
- # Unpost menu(s) and restore some stuff that's dependent on what was
- # posted.
- $cbutton unpost
- set _private(posted) {}
- if { [info exists _private(cursor)] } {
- $cbutton configure -cursor $_private(cursor)
- }
- if { [$cbutton cget -state] != "disabled" } {
- #$cbutton configure -state normal
- }
- set menu [$cbutton cget -menu]
- trace MENU=$menu
- trace GRAB=[grab current $menu]
- # Release grab, if any, and restore the previous grab, if there
- # was one.
- if { $menu != "" } {
- set grab [grab current $menu]
- if { $grab != "" } {
- grab release $grab
- }
- }
- RestoreOldGrab
-}
-
-proc blt::ComboButton::GenerateMenuSelect {menu} {
- variable _private
-
- set item [$menu index active]
- if { $_private(activeMenu) != $menu ||
- $_private(activeItem) != $item } {
- set _private(activeMenu) $menu
- set _private(activeItem) $item
- event generate $menu <<MenuSelect>>
- }
-}
-
-proc blt::ComboButton::NextButton { cbutton rootx rooty } {
- variable _private
-
- set next [winfo containing -display $cbutton $rootx $rooty]
- if { $next == "" || $next == $_private(posted) ||
- [winfo class $next] != "ComboButton" } {
- return
- }
- # Release the current combobutton, including removing the grab.
- event generate $cbutton <ButtonRelease-1>
- grab -global $next
- # Simulate pressing the new combobutton widget.
- event generate $next <ButtonPress-1>
-}
-
diff --git a/blt3.0.1/library/comboentry.tcl b/blt3.0.1/library/comboentry.tcl
deleted file mode 100644
index 5bd1f97..0000000
--- a/blt3.0.1/library/comboentry.tcl
+++ /dev/null
@@ -1,687 +0,0 @@
-
-namespace eval ::blt::ComboEntry {
- variable _private
- array set _private {
- activeItem {}
- afterId -1
- b1 ""
- lastFocus {}
- mouseMoved 0
- oldGrab {}
- postingButton {}
- arrowRelief raised
- trace 0
- lastX -1
- }
- proc trace { mesg } {
- variable _private
- if { $_private(trace) } {
- puts stderr $mesg
- }
- }
-}
-
-bind ComboEntry <Enter> {
- # Do nothing
-}
-
-bind ComboEntry <Leave> {
- %W activate off
-}
-
-# Standard Motif bindings:
-
-bind ComboEntry <Motion> {
- %W activate [%W identify %x %y]
-}
-
-bind ComboEntry <ButtonPress-1> {
- ::blt::ComboEntry::ButtonPress %W %x %y
-}
-
-bind ComboEntry <ButtonRelease-1> {
- blt::ComboEntry::trace "ComboEntry %W at %X,%Y <ButtonRelease-1> state=[%W cget -state], grab=[grab current]"
- after cancel $blt::ComboEntry::_private(afterId)
- switch -- [%W identify -root %X %Y] {
- "arrow" {
- blt::ComboEntry::trace "invoke"
- %W invoke
- }
- "close" {
- blt::ComboEntry::trace "button invoke"
- %W button invoke
- }
- default {
- blt::ComboEntry::trace "unpost"
- blt::ComboEntry::UnpostMenu %W
- }
- }
- if { [info exists blt::ComboEntry::_private(arrowRelief)] } {
- %W configure -arrowrelief $blt::ComboEntry::_private(arrowRelief)
- }
-}
-
-bind ComboEntry <B1-Motion> {
- if { $blt::ComboEntry::_private(b1) != "arrow" } {
- %W selection to [%W closest %x]
- }
-}
-bind ComboEntry <B1-Enter> {
- after cancel $blt::ComboEntry::_private(afterId)
- set blt::ComboEntry::_private(afterId) -1
-}
-bind ComboEntry <B1-Leave> {
- blt::ComboEntry::trace "ComboEntry B1-Leave"
- if { $blt::ComboEntry::_private(b1) == "text" } {
- set blt::ComboEntry::_private(lastX) %x
- blt::ComboEntry::AutoScan %W
- }
-}
-bind ComboEntry <KeyPress-Down> {
- if { [%W cget -state] != "disabled" } {
- grab %W
- ::blt::ComboEntry::PostMenu %W
- }
-}
-bind ComboEntry <Double-1> {
- blt::ComboEntry::trace "Double-1"
- if { [%W identify %x %y] == "arrow" } {
- ::blt::ComboEntry::ButtonPress %W %x %y
- } else {
- %W icursor [%W closest %x]
- %W selection range \
- [string wordstart [%W get] [%W index previous]] \
- [string wordend [%W get] [%W index insert]]
- %W icursor sel.last
- %W see insert
- }
-}
-bind ComboEntry <Triple-1> {
- blt::ComboEntry::trace "Triple-1"
- if { [%W identify %x %y] != "arrow" } {
- %W selection range 0 end
- %W icursor sel.last
- }
-}
-bind ComboEntry <Shift-1> {
- %W selection adjust @%x
-}
-bind ComboEntry <ButtonPress-2> {
- %W scan mark %x
-}
-bind ComboEntry <ButtonRelease-2> {
- if { abs([%W scan mark] - %x) <= 3 } {
- catch {
- %W insert insert [selection get]
- %W see insert
- }
- }
-}
-bind ComboEntry <B2-Motion> {
- %W scan dragto %x
-}
-bind ComboEntry <Control-1> {
- %W icursor @%x
-}
-bind ComboEntry <KeyPress-Left> {
- if { [%W selection present] } {
- %W icursor sel.last
- %W selection clear
- }
- %W icursor previous
- %W see insert
-}
-bind ComboEntry <KeyPress-Right> {
- if { [%W selection present] } {
- %W icursor sel.last
- %W selection clear
- }
- %W icursor next
- %W see insert
-}
-
-bind ComboEntry <Shift-Left> {
- if {![%W selection present]} {
- %W selection range previous insert
- } else {
- %W selection adjust previous
- }
- %W icursor previous
- %W see insert
-}
-
-bind ComboEntry <Shift-Right> {
- if {![%W selection present]} {
- %W selection range insert next
- } else {
- %W selection adjust next
- }
- %W icursor next
- %W see insert
-}
-
-bind ComboEntry <Shift-Control-Left> {
- set previous [string wordstart [%W get] [%W index previous]]
- if {![%W selection present]} {
- %W selection range $previous insert
- } else {
- %W selection adjust $previous
- }
- %W icursor $previous
- %W see insert
-}
-
-bind ComboEntry <Shift-Control-Right> {
- set next [string wordend [%W get] [%W index insert]]
- if {![%W selection present]} {
- %W selection range insert $next
- } else {
- %W selection adjust $next
- }
- %W icursor $next
- %W see insert
-}
-
-bind ComboEntry <Home> {
- %W icursor 0
- %W see insert
-}
-
-bind ComboEntry <Shift-Home> {
- if {![%W selection present]} {
- %W selection range 0 insert
- } else {
- %W selection adjust 0
- }
- %W icursor 0
- %W see insert
-}
-
-bind ComboEntry <End> {
- %W icursor end
- %W see insert
-}
-
-bind ComboEntry <Shift-End> {
- if {![%W selection present]} {
- %W selection range insert end
- } else {
- %W selection adjust end
- }
- %W icursor end
- %W see insert
-}
-
-bind ComboEntry <Delete> {
- if {[%W selection present]} {
- %W delete sel.first sel.last
- } else {
- %W delete insert next
- }
-}
-
-bind ComboEntry <BackSpace> {
- if {[%W selection present]} {
- %W delete sel.first sel.last
- } else {
- %W delete previous insert
- %W see insert
- }
-}
-
-bind ComboEntry <Control-space> {
- %W selection from insert
-}
-
-bind ComboEntry <Select> {
- %W selection from insert
-}
-
-bind ComboEntry <Control-Shift-space> {
- %W selection adjust insert
-}
-
-bind ComboEntry <Shift-Select> {
- %W selection adjust insert
-}
-
-bind ComboEntry <Control-slash> {
- %W selection range 0 end
-}
-
-bind ComboEntry <Control-backslash> {
- %W selection clear
-}
-
-bind ComboEntry <Control-z> {
- %W undo
- %W see insert
-}
-
-bind ComboEntry <Control-Z> {
- %W redo
- %W see insert
-}
-
-bind ComboEntry <Control-y> {
- %W redo
- %W see insert
-}
-
-bind ComboEntry <<Cut>> {
- if { [%W selection present] } {
- clipboard clear -displayof %W
- clipboard append -displayof %W [selection get]
- %W delete sel.first sel.last
- }
-}
-
-bind ComboEntry <<Copy>> {
- if { [%W selection present] } {
- clipboard clear -displayof %W
- clipboard append -displayof %W [selection get]
- }
-}
-
-bind ComboEntry <<Paste>> {
- %W insert insert [selection get]
- %W see insert
-}
-
-bind ComboEntry <<Clear>> {
- %W delete sel.first sel.last
-}
-
-
-bind Entry <<PasteSelection>> {
- if { $tk_strictMotif ||
- ![info exists tk::ComboEntry::_private(mouseMoved)] ||
- !$tk::ComboEntry::_private(mouseMoved)} {
- tk::EntryPaste %W %x
- }
-}
-
-# Paste
-bind ComboEntry <Control-v> {
- %W insert insert [selection get]
-}
-
-# Cut
-bind ComboEntry <Control-x> {
- if { [%W selection present] } {
- clipboard clear -displayof %W
- clipboard append -displayof %W [selection get]
- %W delete sel.first sel.last
- }
-}
-# Copy
-bind ComboEntry <Control-c> {
- if { [%W selection present] } {
- clipboard clear -displayof %W
- clipboard append -displayof %W [selection get]
- }
-}
-
-bind ComboEntry <Return> {
- %W invoke
-}
-
-bind ComboEntry <KeyPress> {
- if { [string compare %A {}] == 0 } {
- continue
- }
- if { [%W selection present] } {
- %W delete sel.first sel.last
- }
- %W insert insert %A
- %W see insert
-}
-
-# Additional emacs-like bindings:
-
-bind ComboEntry <Control-a> {
- %W icursor 0
- %W see insert
-}
-
-bind ComboEntry <Control-b> {
- %W icursor previous
- %W see insert
-}
-
-bind ComboEntry <Control-d> {
- if { [%W selection present] } {
- %W delete sel.first sel.last
- } else {
- %W delete insert next
- }
-}
-
-bind ComboEntry <Control-e> {
- %W icursor end
- %W see insert
-}
-
-bind ComboEntry <Control-f> {
- %W icursor next
- %W see insert
-}
-
-bind ComboEntry <Control-h> {
- if { [%W selection present] } {
- %W delete sel.first sel.last
- } else {
- %W delete previous insert
- %W see insert
- }
-}
-
-bind ComboEntry <Control-k> {
- %W delete insert end
-}
-
-bind ComboEntry <Control-t> {
- set index [%W index insert]
- if { $index != 0 && $index != [%W index end] } {
- set a [string index [%W get] [%W index previous]]
- set b [string index [%W get] [%W index insert]]
- %W delete previous next
- %W insert insert "$b$a"
- }
-}
-
-bind ComboEntry <Alt-b> {
- %W icursor [string wordstart [%W get] [%W index previous]]
- %W see insert
-}
-
-bind ComboEntry <Alt-d> {
- %W delete insert [string wordend [%W get] [%W index insert]]
- %W see insert
-}
-
-bind ComboEntry <Alt-f> {
- %W icursor [string wordend [%W get] [%W index insert]]
- %W see insert
-}
-
-bind ComboEntry <Alt-BackSpace> {
- %W delete [string wordstart [%W get] [%W index previous]] insert
- %W see insert
-}
-
-bind ComboEntry <Alt-Delete> {
- %W delete insert [string wordend [%W get] [%W index insert]]
- %W see insert
-}
-
-####
-bind ComboEntry <Meta-b> {
- %W icursor [string wordstart [%W get] [%W index previous]]
- %W see insert
-}
-
-bind ComboEntry <Meta-d> {
- %W delete insert [string wordend [%W get] [%W index insert]]
- %W see insert
-}
-
-bind ComboEntry <Meta-f> {
- %W icursor [string wordend [%W get] [%W index insert]]
- %W see insert
-}
-
-bind ComboEntry <Meta-BackSpace> {
- %W delete [string wordstart [%W get] [%W index previous]] insert
- %W see insert
-}
-
-bind ComboEntry <Meta-Delete> {
- %W delete insert [string wordend [%W get] [%W index insert]]
- %W see insert
-}
-
-
-# Ignore all Alt, Meta, and Control keypresses unless explicitly bound.
-# Otherwise, if a widget binding for one of these is defined, the
-# <KeyPress> class binding will also fire and insert the character,
-# which is wrong. Ditto for Escape, Return, and Tab.
-
-bind ComboEntry <Alt-KeyPress> {
- # Do nothing.
-}
-bind ComboEntry <Meta-KeyPress> {
- blt::ComboEntry::trace %K
-}
-bind ComboEntry <Control-KeyPress> {
- # Do nothing.
-}
-bind ComboEntry <Escape> {
- # Do nothing.
-}
-bind ComboEntry <KP_Enter> {
- # Do nothing.
-}
-bind ComboEntry <Tab> {
- # Do nothing.
-}
-switch -- [tk windowingsystem] {
- "classic" - "aqua" {
- bind ComboEntry <Command-KeyPress> {
- # Do nothing.
- }
- }
-}
-
-proc ::blt::ComboEntry::AutoScan {w} {
- variable _private
-
- set x $_private(lastX)
- if { ![winfo exists $w] } {
- return
- }
- if { $x >= [winfo width $w] } {
- $w xview scroll 2 units
- } elseif { $x < 0 } {
- $w xview scroll -2 units
- }
- set _private(afterId) [after 50 [list blt::ComboEntry::AutoScan $w]]
-}
-
-proc ::blt::ComboEntry::SaveGrab { w } {
- variable _private
-
- set grab [grab current $w]
- set _private(oldGrab) ""
- if { $grab != "" } {
- set type [grab status $grab]
- if { $type == "global" } {
- #set _private(oldGrab) [list grab set -global $grab]
- } else {
- #set _private(oldGrab) [list grab set $grab]
- }
- }
-}
-
-# ::blt::ComboEntry::RestoreOldGrab --
-# Restores the grab to what it was before TkSaveGrabInfo was called.
-
-proc ::blt::ComboEntry::RestoreOldGrab {} {
- variable _private
-
- if { $_private(oldGrab) != "" } {
- # Be careful restoring the old grab, since it's window may not
- # be visible anymore.
- catch $_private(oldGrab)
- set _private(oldGrab) ""
- }
-}
-
-# ::blt::ComboEntry::PostMenu --
-#
-# Given a menubutton, this procedure does all the work of posting
-# its associated menu and unposting any other menu that is currently
-# posted.
-#
-# Arguments:
-# w - The name of the menubutton widget whose menu
-# is to be posted.
-# x, y - Root coordinates of cursor, used for positioning
-# option menus. If not specified, then the center
-# of the menubutton is used for an option menu.
-
-proc ::blt::ComboEntry::PostMenu { w } {
- variable _private
-
- trace "proc PostMenu $w, state=[$w cget -state]"
- if { [$w cget -state] == "disabled" } {
- return
- }
- if { [$w cget -state] == "posted" } {
- UnpostMenu $w
- return
- }
- set menu [$w cget -menu]
- if { $menu == "" } {
- return
- }
- set cur $_private(postingButton)
- if { $cur != "" } {
- #
- UnpostMenu $cur
- }
- set _private(cursor) [$w cget -cursor]
- $w configure -cursor arrow
-
- set _private(postingButton) $w
- set _private(lastFocus) [focus]
- $menu activate none
- #blt::ComboEntry::GenerateMenuSelect $menu
-
-
- # If this looks like an option menubutton then post the menu so
- # that the current entry is on top of the mouse. Otherwise post
- # the menu just below the menubutton, as for a pull-down.
-
- update idletasks
- if { [catch { $w post } msg] != 0 } {
- # Error posting menu (e.g. bogus -postcommand). Unpost it and
- # reflect the error.
- global errorInfo
- set savedInfo $errorInfo
- #
- UnpostMenu $w
- error $msg $savedInfo
- }
-
- focus $menu
- set value [$w get]
- set index [$menu index $value]
- if { $index != -1 } {
- $menu see $index
- $menu activate $index
- }
- if { [winfo viewable $menu] } {
- SaveGrab $menu
- trace "setting global grab on $menu"
- #grab -global $menu
- }
-}
-
-# ::blt::ComboEntry::UnpostMenu --
-#
-# This procedure unposts a given menu, plus all of its ancestors up
-# to (and including) a menubutton, if any. It also restores various
-# values to what they were before the menu was posted, and releases
-# a grab if there's a menubutton involved. Special notes:
-# 1. It's important to unpost all menus before releasing the grab, so
-# that any Enter-Leave events (e.g. from menu back to main
-# application) have mode NotifyGrab.
-# 2. Be sure to enclose various groups of commands in "catch" so that
-# the procedure will complete even if the menubutton or the menu
-# or the grab window has been deleted.
-#
-# Arguments:
-# menu - Name of a menu to unpost. Ignored if there
-# is a posted menubutton.
-
-proc ::blt::ComboEntry::UnpostMenu { w } {
- variable _private
-
- trace "proc UnpostMenu $w"
- catch {
- # Restore focus right away (otherwise X will take focus away when the
- # menu is unmapped and under some window managers (e.g. olvwm) we'll
- # lose the focus completely).
- focus $_private(lastFocus)
- }
- set _private(lastFocus) ""
-
- # Unpost menu(s) and restore some stuff that's dependent on what was
- # posted.
-
- $w unpost
- set _private(postingButton) {}
- if { [info exists _private(cursor)] } {
- $w configure -cursor $_private(cursor)
- }
- if { [$w cget -state] != "disabled" } {
- #$w configure -state normal
- }
- set menu [$w cget -menu]
- if { $menu == "" } {
- return
- }
- trace MENU=$menu
- trace GRAB=[grab current $menu]
-
- # Release grab, if any, and restore the previous grab, if there
- # was one.
- if { $menu != "" } {
- set grab [grab current $menu]
- if { $grab != "" } {
- grab release $grab
- }
- }
- RestoreOldGrab
-}
-
-proc ::blt::ComboEntry::GenerateMenuSelect {menu} {
- if 0 {
- variable _private
- if { $_private(activeComboMenu) != $menu ||
- $_private(activeItem) != [$menu index active] } {
- set _private(activeComboMenu) $menu
- set _private(activeItem) [$menu index active]
- event generate $menu <<MenuSelect>>
- }
- }
-}
-
-proc ::blt::ComboEntry::ButtonPress { w x y } {
- variable _private
-
- trace "blt::ComboEntry::ButtonPress $w state=[$w cget -state]"
- set _private(b1) [$w identify $x $y]
- trace "_private(b1) = \"$_private(b1)\""
- if { [$w cget -state] == "posted" } {
- trace "state = [$w cget -state]"
- $w unpost
- UnpostMenu $w
- } elseif { $_private(b1) == "arrow" } {
- set _private(arrowRelief) [$w cget -arrowrelief]
- trace "relief=$_private(arrowRelief)"
- if { [$w cget -state] != "disabled" } {
- $w configure -arrowrelief sunken
- }
- grab -global $w
- PostMenu $w
- } else {
- trace "else: priv(v1)=$_private(b1) state=[$w cget -state]"
- focus $w
- $w icursor [$w closest $x]
- $w selection clear
- $w selection from insert
- $w configure -arrowrelief $_private(arrowRelief)
- }
-}
\ No newline at end of file
diff --git a/blt3.0.1/library/combomenu.tcl b/blt3.0.1/library/combomenu.tcl
deleted file mode 100644
index de9f5ca..0000000
--- a/blt3.0.1/library/combomenu.tcl
+++ /dev/null
@@ -1,576 +0,0 @@
-
-namespace eval ::blt::ComboMenu {
- variable _private
- array set _private {
- activeComboMenu ""
- activeItem ""
- afterId -1
- b1 ""
- lastFocus ""
- menuBar ""
- oldGrab ""
- popup ""
- postingMenu ""
- trace 0
- }
- proc trace { mesg } {
- variable _private
- if { $_private(trace) } {
- puts stderr $mesg
- }
- }
-}
-
-# -----------------------------------------------------------------------------
-
-# Must set focus when mouse enters a menu, in order to allow
-# mixed-mode processing using both the mouse and the keyboard.
-# Don't set the focus if the event comes from a grab release,
-# though: such an event can happen after as part of unposting
-# a cascaded chain of menus, after the focus has already been
-# restored to wherever it was before menu selection started.
-
-bind ComboMenu <FocusIn> {}
-
-bind ComboMenu <Enter> {
- blt::ComboMenu::trace "blt::ComboMenu %W <Enter>"
- focus %W
-}
-
-bind ComboMenu <Leave> {
- blt::ComboMenu::trace "blt::ComboMenu %W <Leave> %s"
- if { %s == 0 } {
- #%W activate none
- }
-}
-
-bind ComboMenu <Motion> {
- #blt::ComboMenu::trace "blt::ComboMenu Motion %x,%y"
- %W activate @%x,%y
- %W postcascade active
-}
-
-bind ComboMenu <ButtonRelease-1> {
- blt::ComboMenu::trace "blt::ComboMenu %W at %x,%y ButtonRelease-1"
- set index [%W index @%x,%y]
- if { $index == -1 } {
- blt::ComboMenu::trace "ButtonRelease-1: failed to find item in %W"
- blt::ComboMenu::SimulateButtonRelease %W
- } else {
- %W activate $index
- blt::ComboMenu::trace "ButtonRelease-1: activated $index"
- if { [%W type active] == "cascade" } {
- blt::ComboMenu::trace "ButtonRelease-1: posting cascade for $index"
- %W postcascade active
- blt::ComboMenu::PostMenu %W active
- } else {
- blt::ComboMenu::trace "ButtonRelease-1: %W invoke active ($index)"
- blt::ComboMenu::SimulateButtonRelease %W
- update
- %W invoke active
- }
- }
-}
-
-bind ComboMenu <ButtonPress-1> {
- blt::ComboMenu::trace "blt::ComboMenu ButtonPress-1"
-}
-
-bind ComboMenu <ButtonPress-2> {
- blt::ComboMenu::trace "blt::ComboMenu %W ButtonPress-2"
- set w [grab current]
- $w configure -cursor diamond_cross
- update
- %W scan mark %x %y
-}
-bind ComboMenu <B2-Motion> {
- %W scan dragto %x %y
-}
-
-bind ComboMenu <ButtonRelease-2> {
- blt::ComboMenu::trace "blt::ComboMenu %W ButtonRelease-2"
- set w [grab current]
- $w configure -cursor arrow
-}
-
-bind ComboMenu <ButtonPress-3> {
- blt::ComboMenu::trace "blt::ComboMenu ButtonPress-3"
- blt::ComboMenu::UnpostMenu %W
-}
-
-bind xComboMenu <ButtonRelease-3> {
- blt::ComboMenu::trace "blt::ComboMenu ButtonRelease-3"
- if { $blt::ComboMenu::_private(popup) != "" } {
- blt::ComboMenu::popup %W %X %Y
- }
-}
-
-bind ComboMenu <KeyPress-space> {
- if { [%W type active] == "cascade" } {
- %W postcascade active
- blt::ComboMenu::PostMenu %W active
- } else {
- blt::ComboMenu::SimulateButtonRelease %W
- %W invoke active
- }
-}
-
-bind ComboMenu <KeyRelease> {
- if { [string compare %A {}] == 0 } {
- continue
- }
- set index [%W find "%A" -underline]
- if { $index >= 0 } {
- %W activate $index
- %W see $index
- }
-}
-
-# KeyPress-Return --
-#
-# If the menu item selected is a cascade menu, then post the cascade.
-# Otherwise tell the combobutton or comboentry that we've selected
-# something by simulating a button release. This will unpost all the
-# posted menus. Set the root coordinates of the event to be offscreen
-# so that we don't inadvertantly lie over the arrow of the button.
-#
-bind ComboMenu <KeyPress-Return> {
- if { [%W type active] == "cascade" } {
- %W postcascade active
- blt::ComboMenu::PostMenu %W active
- } else {
- %W invoke active
- blt::ComboMenu::SimulateButtonRelease %W
- }
-}
-
-bind ComboMenu <Escape> {
- blt::ComboMenu::SimulateButtonRelease %W
-}
-
-bind ComboMenu <Left> {
- set menu [winfo parent %W]
- if { [winfo class $menu] == "ComboMenu" } {
- $menu postcascade none
- focus $menu
- }
-}
-
-bind ComboMenu <Right> {
- if { [%W type active] == "cascade" } {
- %W postcascade active
- set menu [%W item cget active -menu]
- focus $menu
- }
-}
-
-bind ComboMenu <KeyPress-Up> {
- %W activate previous
- %W see active
-}
-
-bind ComboMenu <KeyPress-Down> {
- %W activate next
- %W see active
-}
-
-bind ComboMenu <KeyPress-Home> {
- %W activate first
- %W see active
-}
-
-bind ComboMenu <KeyPress-End> {
- %W activate end
- %W see active
-}
-
-bind ComboMenu <KeyPress-Prior> {
- %W yview scroll -1 page
- %W activate view.top
- %W see active
-}
-
-bind ComboMenu <KeyPress-Next> {
- %W yview scroll 1 page
- %W activate view.bottom
- %W see active
-}
-
-# The following bindings apply to all windows, and are used to implement
-# keyboard menu traversal.
-
-if { [tk windowingsystem] == "x11" } {
- bind all <Alt-KeyPress> {
- blt::ComboMenu::Traverse %W %A
- }
- bind all <F10> {
- blt::ComboMenu::FirstItem %W
- }
-} else {
- bind ComboMenubutton <Alt-KeyPress> {
- blt::ComboMenu::Traverse %W %A
- }
-
- bind ComboMenubutton <F10> {
- blt::ComboMenu::First %W
- }
-}
-
-if { [tk windowingsystem] == "x11" } {
- bind ComboMenu <4> {
- %W yview scroll -5 units
- }
- bind ComboMenu <5> {
- %W yview scroll 5 units
- }
-} else {
- bind ComboMenu <MouseWheel> {
- %W yview scroll [expr {- (%D / 120) * 4}] units
- }
-}
-
-# ::blt::ComboMenu::UnpostMenu --
-#
-# This procedure unposts a given menu, plus all of its ancestors up
-# to (and including) a menubutton, if any. It also restores various
-# values to what they were before the menu was posted, and releases
-# a grab if there's a menubutton involved. Special notes:
-# 1. It's important to unpost all menus before releasing the grab, so
-# that any Enter-Leave events (e.g. from menu back to main
-# application) have mode NotifyGrab.
-# 2. Be sure to enclose various groups of commands in "catch" so that
-# the procedure will complete even if the menubutton or the menu
-# or the grab window has been deleted.
-#
-# Arguments:
-# menu - Name of a menu to unpost. Ignored if there
-# is a posted menubutton.
-
-proc ::blt::ComboMenu::UnpostMenu { menu } {
- variable _private
-
- trace "proc ComboMenu::UnpostMenu $menu"
- set mb $_private(postingMenu)
- set mb ""
-
- # Restore focus right away (otherwise X will take focus away when the menu
- # is unmapped and under some window managers (e.g. olvwm) we'll lose the
- # focus completely).
-
- catch {focus $_private(lastFocus)}
- set _private(lastFocus) ""
-
- # Unpost menu(s) and restore some stuff that's dependent on what was
- # posted.
-
- catch {
- if { $mb != "" } {
- set menu [$mb cget -menu]
- $menu unpost
- set _private(postingMenu) {}
- $mb configure -cursor $_private(cursor)
- if { [$mb cget -arrowrelief] == "sunken" } {
- $mb configure -arrowrelief $_private(relief)
- }
- } elseif { $_private(popup) != "" } {
- $_private(popup) unpost
- set _private(popup) {}
- } else {
- # We're in a cascaded sub-menu from a tearoff menu or popup.
- # Unpost all the menus up to the toplevel one (but not including
- # the top-level torn-off one) and deactivate the top-level torn
- # off menu if there is one.
- while {1} {
- set parent [winfo parent $menu]
- if { [winfo class $parent] != "ComboMenu" ||
- ![winfo ismapped $parent]} {
- break
- }
- $parent activate none
- $parent postcascade none
- ComboMenu::GenerateSelect $parent
- set menu $parent
- }
- $menu unpost
- }
- }
- if { $mb != "" && [$mb cget -state] != "disabled" } {
- $mb configure -state normal
- }
-
- trace menuBar=$_private(menuBar)
- trace menu=$menu
- trace grab=[grab current $menu]
-
- # Release grab, if any, and restore the previous grab, if there
- # was one.
- if { $menu != "" } {
- set grab [grab current $menu]
- if { $grab != "" } {
- grab release $grab
- }
- }
- RestoreOldGrab
- if { $_private(menuBar) != "" } {
- $_private(menuBar) configure -cursor $_private(cursor)
- set _private(menuBar) {}
- }
-}
-
-proc ::blt::ComboMenu::SimulateButtonRelease { w } {
- set grab [grab current]
- if { $grab != "$w" } {
- event generate $grab <ButtonRelease-1> -rootx -1000 -rooty -1000
- } else {
- $w unpost
- RestoreOldGrab
- }
-}
-
-proc ::blt::ComboMenu::PostMenu { w item } {
- variable _private
-
- trace "proc ComboMenu::PostMenu $w, item=$item"
- if { [$w item cget $item -state] == "disabled" } {
- return
- }
-
- set menu [$w item cget $item -menu]
- if { $menu == "" } {
- return
- }
- #$menu activate none
- set _private(lastFocus) [focus]
- GenerateSelect $menu
-
-
- # If this looks like an option menubutton then post the menu so
- # that the current entry is on top of the mouse. Otherwise post
- # the menu just below the menubutton, as for a pull-down.
-
- update idletasks
- if { [catch { $w postcascade $item } msg] != 0 } {
- # Error posting menu (e.g. bogus -postcommand). Unpost it and
- # reflect the error.
- global errorInfo
- set savedInfo $errorInfo
- #
- #MbUnpost $w
- error $msg $savedInfo
- }
- focus $menu
- $menu activate first
- if { [winfo viewable $menu] } {
- SaveGrab $menu
- trace "setting global grab on $menu"
- grab -global $menu
- }
-}
-
-# ::blt::xxxComboMenuUnpost --
-# This procedure unposts a given menu, plus all of its ancestors up
-# to (and including) a menubutton, if any. It also restores various
-# values to what they were before the menu was posted, and releases
-# a grab if there's a menubutton involved. Special notes:
-# 1. It's important to unpost all menus before releasing the grab, so
-# that any Enter-Leave events (e.g. from menu back to main
-# application) have mode NotifyGrab.
-# 2. Be sure to enclose various groups of commands in "catch" so that
-# the procedure will complete even if the menubutton or the menu
-# or the grab window has been deleted.
-#
-# Arguments:
-# menu - Name of a menu to unpost. Ignored if there
-# is a posted menubutton.
-
-proc ::blt::xxxComboMenuUnpost { w } {
- variable _private
-
- trace "proc ComboMenuUnpost $w"
- catch {
- # Restore focus right away (otherwise X will take focus away when the
- # menu is unmapped and under some window managers (e.g. olvwm) we'll
- # lose the focus completely).
- focus $_private(lastFocus)
- }
- set _private(lastFocus) ""
-
- # Unpost menu(s) and restore some stuff that's dependent on what was
- # posted.
-
- $w unpost
- #set _private(postingMenu) {}
- $w configure -cursor $_private(cursor)
-
- if { [$w cget -state] != "disabled" } {
- #$w configure -state normal
- }
- set menu [$w cget -menu]
- trace MENU=$menu
- trace GRAB=[grab current $menu]
- # Release grab, if any, and restore the previous grab, if there
- # was one.
- if { $menu != "" } {
- set grab [grab current $menu]
- if { $grab != "" } {
- #grab release $grab
- }
- }
- RestoreOldGrab
-}
-
-# ::blt::SaveGrab --
-# Sets the variable blt::_private(oldGrab) to record
-# the state of any existing grab on the w's display.
-#
-# Arguments:
-# w - Name of a window; used to select the display
-# whose grab information is to be recorded.
-
-proc blt::ComboMenu::SaveGrab { w } {
- variable _private
-
- set grab [grab current $w]
- set _private(oldGrab) ""
- if { $grab != "" } {
- set type [grab status $grab]
- if { $type == "global" } {
- #set _private(oldGrab) [list grab set -global $grab]
- } else {
- #set _private(oldGrab) [list grab set $grab]
- }
- }
-}
-
-# ::blt::RestoreOldGrab --
-# Restores the grab to what it was before TkSaveGrabInfo was called.
-#
-
-proc ::blt::ComboMenu::RestoreOldGrab {} {
- variable _private
-
- trace "RestoreOldGrab: current=[grab current] old=$_private(oldGrab)"
- if { $_private(oldGrab) != "" } {
- # Be careful restoring the old grab, since it's window may not
- # be visible anymore.
- catch $_private(oldGrab)
- set _private(oldGrab) ""
- } else {
- grab release [grab current]
- }
-}
-
-proc ::blt::xxxComboMenuSetFocus {menu} {
- variable _private
- if { $_private(lastFocus) == "" } {
- set _private(lastFocus) [focus]
- }
- focus $menu
-}
-
-proc ::blt::ComboMenu::GenerateSelect {menu} {
- variable _private
-
- if { $_private(activeComboMenu) == $menu &&
- $_private(activeItem) == [$menu index active] } {
- return
- }
- set _private(activeComboMenu) $menu
- set _private(activeItem) [$menu index active]
- event generate $menu <<MenuSelect>>
-}
-
-
-bind ComboMenu <B1-Enter> {
- after cancel $blt::ComboMenu::_private(afterId)
- set blt::ComboMenu::_private(afterId) -1
-}
-
-bind ComboMenu <B1-Leave> {
- blt::ComboMenu::trace "ComboMenu B1-Leave"
- blt::ComboMenu::AutoScroll %W %x %y
-}
-
-bind ComboMenu <Unmap> {
- after cancel $blt::ComboMenu::_private(afterId)
- set blt::ComboMenu::_private(afterId) -1
-}
-
-proc ::blt::ComboMenu::AutoScroll {w x y} {
- variable _private
-
- trace "autoscan $w $y"
- if { ![winfo exists $w] } {
- return
- }
- set i -1
- if { $y >= [winfo height $w] } {
- set i [$w next view.bottom]
- } elseif { $y < 0 } {
- set i [$w previous view.top]
- }
- if { $i > 0 } {
- trace $i
- $w activate $i
- $w see $i
- }
- set cmd [list blt::ComboMenu::AutoScroll $w $x $y]
- set _private(afterId) [after 50 $cmd]
-}
-
-proc blt::ComboMenu::ConfigureScrollbars { menu } {
- set ys [$menu cget -yscrollbar]
- if { $ys != "" } {
- if { [$menu cget -yscrollcommand] == "" } {
- $menu configure -yscrollcommand [list $ys set]
- }
- if { [$ys cget -command] == "" } {
- $ys configure -command [list $menu yview] -orient vertical \
- -highlightthickness 0
- }
- }
- set xs [$menu cget -xscrollbar]
- if { $xs != "" } {
- if { [$menu cget -xscrollcommand] == "" } {
- $menu configure -xscrollcommand [list $xs set]
- }
- if { [$xs cget -command] == "" } {
- $xs configure -command [list $menu xview] -orient horizontal \
- -highlightthickness 0
- }
- }
-}
-
-# ::tk_popup --
-# This procedure pops up a menu and sets things up for traversing
-# the menu and its submenus.
-#
-# Arguments:
-# menu - Name of the menu to be popped up.
-# x, y - Root coordinates at which to pop up the
-# menu.
-# entry - Index of a menu entry to center over (x,y).
-# If omitted or specified as {}, then menu's
-# upper-left corner goes at (x,y).
-
-proc ::blt::ComboMenu::popup { menu x y } {
- variable _private
-
- blt::ComboMenu::trace "blt::ComboMenu::popup $menu $x $y"
- blt::ComboMenu::trace "blt::ComboMenu::popup popup=$_private(popup)"
- if { [grab current] == $menu } {
- blt::ComboMenu::trace "blt::ComboMenu::popup unposting $menu"
- UnpostMenu $menu
- } else {
- blt::ComboMenu::trace "blt::ComboMenu::popup posting $menu"
- $menu post $x $y popup
- if { [tk windowingsystem] == "x11" && [winfo viewable $menu] } {
- set _private(activeComboMenu) $menu
- set _private(popup) $menu
- SaveGrab $menu
- trace "popup: setting global grab on $menu"
- grab -global $menu
- focus $menu
- }
- }
-}
diff --git a/blt3.0.1/library/combotree.tcl b/blt3.0.1/library/combotree.tcl
deleted file mode 100644
index 2c64d4b..0000000
--- a/blt3.0.1/library/combotree.tcl
+++ /dev/null
@@ -1,520 +0,0 @@
-
-# ======================================================================
-#
-# combotree.tcl
-#
-# ----------------------------------------------------------------------
-# Bindings for the BLT combotree widget
-# ----------------------------------------------------------------------
-#
-# AUTHOR: George Howlett
-# Bell Labs Innovations for Lucent Technologies
-# gah at lucent.com
-# http://www.tcltk.com/blt
-#
-# RCS: $Id: combotree.tcl,v 1.1.1.1 2010/10/27 21:57:06 joye Exp $
-#
-# ----------------------------------------------------------------------
-# Copyright (c) 1998 Lucent Technologies, Inc.
-# ----------------------------------------------------------------------
-#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that the copyright notice and warranty disclaimer appear in
-# supporting documentation, and that the names of Lucent Technologies
-# any of their entities not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# Lucent Technologies disclaims all warranties with regard to this
-# software, including all implied warranties of merchantability and
-# fitness. In no event shall Lucent be liable for any special, indirect
-# or consequential damages or any damages whatsoever resulting from loss
-# of use, data or profits, whether in an action of contract, negligence
-# or other tortuous action, arising out of or in connection with the use
-# or performance of this software.
-#
-# ======================================================================
-
-namespace eval blt::ComboTree {
- array set _private {
- afterId -1
- scroll 0
- column ""
- space off
- x 0
- y 0
- }
-}
-
-image create picture ::blt::ComboTree::openIcon -data {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
- ZTKAsiCtWq0JADs=
-}
-image create picture ::blt::ComboTree::closeIcon -data {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM1WBrM+rAEMigJ8c3Kb3OSII6kGABhp1JnaK1VGwjwKwtvHqNzzd263M3H4n2OH1QBwGw6
- nQkAOw==
-}
-
-
-# ----------------------------------------------------------------------
-#
-# Initialize --
-#
-# Invoked by internally by Combotree_Init routine. Initializes
-# the default bindings for the combotree widget entries. These
-# are local to the widget, so they can't be set through the
-# widget's class bind tags.
-#
-# ----------------------------------------------------------------------
-proc blt::ComboTree::Initialize { w } {
- #
- # Active entry bindings
- #
- $w bind Entry <Enter> {
- puts stderr "Entry <Enter> [%W index current]"
- %W activate current
- %W entry highlight current
- }
- $w bind Entry <Leave> {
- puts stderr "Entry <Leave> [%W index current]"
- %W activate none
- %W entry highlight ""
- }
-
- #
- # Button bindings
- #
- $w button bind all <ButtonRelease-1> {
- set index [%W nearest %x %y blt::ComboTree::_private(who)]
- if { [%W index current] == $index &&
- $blt::ComboTree::_private(who) == "button" } {
- %W see -anchor nw current
- %W toggle current
- }
- }
- $w button bind all <Enter> {
- %W button highlight current
- }
- $w button bind all <B1-Enter> {
- %W button highlight current
- }
- $w button bind all <Leave> {
- %W button highlight ""
- }
-
- #
- # ButtonPress-1
- #
- # Performs the following operations:
- #
- # 1. Clears the previous selection.
- # 2. Selects the current entry.
- # 3. Sets the focus to this entry.
- # 4. Scrolls the entry into view.
- # 5. Sets the selection anchor to this entry, just in case
- # this is "multiple" mode.
- #
-
- #
- # ButtonRelease-1
- #
- # For "multiple" mode only.
- #
- $w bind Entry <ButtonRelease-3> {
- puts stderr "Entry <ButtonRelease> [%W index current]"
- %W invoke active
- event generate [grab current] <ButtonRelease-1>
- after cancel $blt::ComboTree::_private(afterId)
- set blt::ComboTree::_private(afterId) -1
- set blt::ComboTree::_private(scroll) 0
- }
- $w bind Entry <ButtonRelease-1> {
- puts stderr "Entry <ButtonRelease-1> [%W index current]"
- %W invoke active
- event generate [grab current] <ButtonRelease-1>
- after cancel $blt::ComboTree::_private(afterId)
- set blt::ComboTree::_private(afterId) -1
- set blt::ComboTree::_private(scroll) 0
- }
-
- $w bind Entry <Double-ButtonPress-1> {
- %W see -anchor nw active
- %W toggle active
- }
-
- #
- # Shift-ButtonPress-1
- #
- # For "multiple" mode only.
- #
-
- $w bind Entry <Shift-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" && [%W selection present] } {
- if { [%W index anchor] == "" } {
- %W selection anchor current
- }
- set index [%W index anchor]
- %W selection clearall
- %W selection set $index current
- } else {
- blt::ComboTree::SetSelectionAnchor %W current
- }
- }
- $w bind Entry <Shift-Double-ButtonPress-1> {
- # do nothing
- }
- $w bind Entry <Shift-B1-Motion> {
- # do nothing
- }
- $w bind Entry <Shift-ButtonRelease-1> {
- after cancel $blt::ComboTree::_private(afterId)
- set blt::ComboTree::_private(afterId) -1
- set blt::ComboTree::_private(scroll) 0
- }
-
- #
- # Control-ButtonPress-1
- #
- # For "multiple" mode only.
- #
- $w bind Entry <Control-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" } {
- set index [%W index current]
- %W selection toggle $index
- %W selection anchor $index
- } else {
- blt::ComboTree::SetSelectionAnchor %W current
- }
- }
- $w bind Entry <Control-Double-ButtonPress-1> {
- # do nothing
- }
- $w bind Entry <Control-B1-Motion> {
- # do nothing
- }
- $w bind Entry <Control-ButtonRelease-1> {
- after cancel $blt::ComboTree::_private(afterId)
- set blt::ComboTree::_private(afterId) -1
- set blt::ComboTree::_private(scroll) 0
- }
-
- $w bind Entry <Control-Shift-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" && [%W selection present] } {
- if { [%W index anchor] == "" } {
- %W selection anchor current
- }
- if { [%W selection includes anchor] } {
- %W selection set anchor current
- } else {
- %W selection clear anchor current
- %W selection set current
- }
- } else {
- blt::ComboTree::SetSelectionAnchor %W current
- }
- }
- $w bind Entry <Control-Shift-Double-ButtonPress-1> {
- # do nothing
- }
- $w bind Entry <Control-Shift-B1-Motion> {
- # do nothing
- }
-
- $w bind Entry <Shift-ButtonPress-3> {
- puts stderr "entry bind buttonpress-3 %W %X %Y"
- blt::ComboTree::EditColumn %W %X %Y
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# AutoScroll --
-#
-# Invoked when the user is selecting elements in a combotree
-# widget and drags the mouse pointer outside of the widget.
-# Scrolls the view in the direction of the pointer.
-#
-# ----------------------------------------------------------------------
-proc blt::ComboTree::AutoScroll { w } {
- variable _private
-
- if { ![winfo exists $w] } {
- return
- }
- set x $_private(x)
- set y $_private(y)
-
- set index [$w nearest $x $y]
-
- if {$y >= [winfo height $w]} {
- $w yview scroll 1 units
- set neighbor down
- } elseif {$y < 0} {
- $w yview scroll -1 units
- set neighbor up
- } else {
- set neighbor $index
- }
- SetSelectionAnchor $w $neighbor
- set _private(afterId) [after 50 blt::ComboTree::AutoScroll $w]
-}
-
-proc blt::ComboTree::SetSelectionAnchor { w tagOrId } {
- set index [$w index $tagOrId]
- # If the anchor hasn't changed, don't do anything
- if { $index != [$w index anchor] } {
- #$w selection clearall
- $w see $index
- #$w focus $index
- #$w selection set $index
- #$w selection anchor $index
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# MoveFocus --
-#
-# Invoked by KeyPress bindings. Moves the active selection to
-# the entry <where>, which is an index such as "up", "down",
-# "prevsibling", "nextsibling", etc.
-#
-# ----------------------------------------------------------------------
-proc blt::ComboTree::MoveFocus { w index } {
- $w activate $index
- $w see active
-}
-
-# ----------------------------------------------------------------------
-#
-# MovePage --
-#
-# Invoked by KeyPress bindings. Pages the current view up or
-# down. The <where> argument should be either "top" or
-# "bottom".
-#
-# ----------------------------------------------------------------------
-proc blt::ComboTree::MovePage { w where } {
-
- # If the focus is already at the top/bottom of the window, we want
- # to scroll a page. It's really one page minus an entry because we
- # want to see the last entry on the next/last page.
- if { [$w index focus] == [$w index view.$where] } {
- if {$where == "top"} {
- $w yview scroll -1 pages
- $w yview scroll 1 units
- } else {
- $w yview scroll 1 pages
- $w yview scroll -1 units
- }
- }
- update
-
- # Adjust the entry focus and the view. Also activate the entry.
- # just in case the mouse point is not in the widget.
- $w entry highlight view.$where
- $w focus view.$where
- $w see view.$where
- if { [$w cget -selectmode] == "single" } {
- $w selection clearall
- $w selection set focus
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# NextMatch --
-#
-# Invoked by KeyPress bindings. Searches for an entry that
-# starts with the letter <char> and makes that entry active.
-#
-# ----------------------------------------------------------------------
-proc blt::ComboTree::NextMatch { w key } {
- if {[string match {[ -~]} $key]} {
- set last [$w index focus]
- set next [$w index next]
- while { $next != $last } {
- set label [$w entry cget $next -label]
- set label [string index $label 0]
- if { [string tolower $label] == [string tolower $key] } {
- break
- }
- set next [$w index -at $next next]
- }
- $w focus $next
- if {[$w cget -selectmode] == "single"} {
- $w selection clearall
- $w selection set focus
- }
- $w see focus
- }
-}
-
-#
-# ButtonPress assignments
-#
-# B1-Enter start auto-scrolling
-# B1-Leave stop auto-scrolling
-# ButtonPress-2 start scan
-# B2-Motion adjust scan
-# ButtonRelease-2 stop scan
-#
-
-bind ComboTree <ButtonPress-2> {
- set blt::ComboTree::_private(cursor) [%W cget -cursor]
- %W configure -cursor hand1
- %W scan mark %x %y
-}
-
-bind ComboTree <B2-Motion> {
- %W scan dragto %x %y
-}
-
-bind ComboTree <ButtonRelease-2> {
- %W configure -cursor $blt::ComboTree::_private(cursor)
-}
-
-bind ComboTree <B1-Leave> {
- if { $blt::ComboTree::_private(scroll) } {
- blt::ComboTree::AutoScroll %W
- }
-}
-
-bind ComboTree <B1-Enter> {
- after cancel $blt::ComboTree::_private(afterId)
- set blt::ComboTree::_private(afterId) -1
-}
-
-#
-# KeyPress assignments
-#
-# Up
-# Down
-# Shift-Up
-# Shift-Down
-# Prior (PageUp)
-# Next (PageDn)
-# Left
-# Right
-# space Start selection toggle of entry currently with focus.
-# Return Start selection toggle of entry currently with focus.
-# Home
-# End
-# F1
-# F2
-# ASCII char Go to next open entry starting with character.
-#
-# KeyRelease
-#
-# space Stop selection toggle of entry currently with focus.
-# Return Stop selection toggle of entry currently with focus.
-
-
-bind ComboTree <KeyPress-Up> {
- %W activate up
- %W see active
-}
-
-bind ComboTree <KeyPress-Down> {
- %W activate down
- %W see active
-}
-
-bind ComboTree <Shift-KeyPress-Up> {
- %W activate prevsibling
- %W see active
-}
-
-bind ComboTree <Shift-KeyPress-Down> {
- %W activate nextsibling
- %W see active
-}
-
-bind ComboTree <KeyPress-Prior> {
- %W activate top
- %W see active
-}
-
-bind ComboTree <KeyPress-Next> {
- %W activate bottom
- %W see active
-}
-
-bind ComboTree <KeyPress-Left> {
- %W close active
-}
-
-bind ComboTree <KeyPress-Right> {
- %W open active
- %W see active
-}
-
-bind ComboTree <KeyPress-space> {
- %W invoke active
-}
-
-bind ComboTree <KeyPress-Return> {
- %W invoke active
-}
-
-bind ComboTree <KeyPress> {
- blt::ComboTree::NextMatch %W %A
-}
-
-bind ComboTree <KeyPress-Home> {
- %W open top
- %W see active -anchor w
-}
-
-bind ComboTree <KeyPress-End> {
- blt::ComboTree::MoveFocus %W bottom
-}
-
-bind ComboTree <KeyPress-F1> {
- %W open -recurse root
-}
-
-bind ComboTree <KeyPress-F2> {
- eval %W close -r [%W entry children root]
-}
-
-if {[string equal "x11" [tk windowingsystem]]} {
- bind ComboTree <4> {
- %W yview scroll -5 units
- }
- bind ComboTree <5> {
- %W yview scroll 5 units
- }
-} else {
- bind ComboTree <MouseWheel> {
- %W yview scroll [expr {- (%D / 120) * 4}] units
- }
-}
-
-
-proc blt::ComboTree::ConfigureScrollbars { menu } {
- set ys [$menu cget -yscrollbar]
- if { $ys != "" } {
- if { [$menu cget -yscrollcommand] == "" } {
- $menu configure -yscrollcommand [list $ys set]
- }
- if { [$ys cget -command] == "" } {
- $ys configure -command [list $menu yview] -orient vertical \
- -highlightthickness 0
- }
- }
- set xs [$menu cget -xscrollbar]
- if { $xs != "" } {
- if { [$menu cget -xscrollcommand] == "" } {
- $menu configure -xscrollcommand [list $xs set]
- }
- if { [$xs cget -command] == "" } {
- $xs configure -command [list $menu xview] -orient horizontal \
- -highlightthickness 0
- }
- }
-}
\ No newline at end of file
diff --git a/blt3.0.1/library/dd_protocols/dd-color.tcl b/blt3.0.1/library/dd_protocols/dd-color.tcl
deleted file mode 100644
index 02ba488..0000000
--- a/blt3.0.1/library/dd_protocols/dd-color.tcl
+++ /dev/null
@@ -1,51 +0,0 @@
-# ----------------------------------------------------------------------
-# PURPOSE: drag&drop send routine for "color" data
-#
-# Widgets that are to participate in drag&drop operations for
-# "color" data should be registered as follows:
-#
-# drag&drop .win source handler color dd_send_color
-# drag&drop .win target handler color my_color_handler
-#
-# proc my_color_handler {} {
-# global DragDrop
-#
-# set data $DragDrop(color)
-# .
-# . do something with $data
-# .
-# }
-#
-# AUTHOR: Michael J. McLennan Phone: (215)770-2842
-# AT&T Bell Laboratories E-mail: aluxpo!mmc at att.com
-#
-# SCCS: %W% (%G%)
-# ----------------------------------------------------------------------
-# Copyright (c) 1993 AT&T All Rights Reserved
-# ======================================================================
-
-# ----------------------------------------------------------------------
-# COMMAND: dd_send_color <interp> <ddwin> <data>
-#
-# INPUTS
-# <interp> = interpreter for target application
-# <ddwin> = pathname for target drag&drop window
-# <data> = data returned from -tokencmd
-#
-# RETURNS
-# ""
-#
-# SIDE-EFFECTS
-# Sends data to remote application DragDrop(color), and then
-# invokes the "color" handler for the drag&drop target.
-# ----------------------------------------------------------------------
-proc dd_send_color {interp ddwin data} {
- send $interp "
- foreach color [list $data] {
- winfo rgb . \$color
- }
- global DragDrop
- set DragDrop(color) [list $data]
- "
- send $interp "drag&drop target $ddwin handle color"
-}
diff --git a/blt3.0.1/library/dd_protocols/dd-file.tcl b/blt3.0.1/library/dd_protocols/dd-file.tcl
deleted file mode 100644
index d49c6f9..0000000
--- a/blt3.0.1/library/dd_protocols/dd-file.tcl
+++ /dev/null
@@ -1,53 +0,0 @@
-# ----------------------------------------------------------------------
-# PURPOSE: drag&drop send routine for "file" data
-#
-# Widgets that are to participate in drag&drop operations for
-# "file" data should be registered as follows:
-#
-# drag&drop .win source handler text dd_send_file
-# drag&drop .win target handler text my_file_handler
-#
-# proc my_file_handler {} {
-# global DragDrop
-#
-# set data $DragDrop(file)
-# .
-# . do something with $data
-# .
-# }
-#
-# AUTHOR: Michael J. McLennan Phone: (215)770-2842
-# AT&T Bell Laboratories E-mail: aluxpo!mmc at att.com
-#
-# SCCS: %W% (%G%)
-# ----------------------------------------------------------------------
-# Copyright (c) 1993 AT&T All Rights Reserved
-# ======================================================================
-
-# ----------------------------------------------------------------------
-# COMMAND: dd_send_file <interp> <ddwin> <data>
-#
-# INPUTS
-# <interp> = interpreter for target application
-# <ddwin> = pathname for target drag&drop window
-# <data> = data returned from -tokencmd
-#
-# RETURNS
-# ""
-#
-# SIDE-EFFECTS
-# Sends data to remote application DragDrop(file), and then
-# invokes the "file" handler for the drag&drop target.
-# ----------------------------------------------------------------------
-proc dd_send_file {interp ddwin data} {
- send $interp "
- foreach file [list $data] {
- if {!\[file exists \$file\]} {
- error \"not a file: \$file\"
- }
- }
- global DragDrop
- set DragDrop(file) [list $data]
- "
- send $interp "drag&drop target $ddwin handle file"
-}
diff --git a/blt3.0.1/library/dd_protocols/dd-number.tcl b/blt3.0.1/library/dd_protocols/dd-number.tcl
deleted file mode 100644
index 0cee537..0000000
--- a/blt3.0.1/library/dd_protocols/dd-number.tcl
+++ /dev/null
@@ -1,51 +0,0 @@
-# ----------------------------------------------------------------------
-# PURPOSE: drag&drop send routine for "number" data
-#
-# Widgets that are to participate in drag&drop operations for
-# "number" data should be registered as follows:
-#
-# drag&drop .win source handler number dd_send_number
-# drag&drop .win target handler number my_number_handler
-#
-# proc my_number_handler {} {
-# global DragDrop
-#
-# set data $DragDrop(number)
-# .
-# . do something with $data
-# .
-# }
-#
-# AUTHOR: Michael J. McLennan Phone: (215)770-2842
-# AT&T Bell Laboratories E-mail: aluxpo!mmc at att.com
-#
-# SCCS: %W% (%G%)
-# ----------------------------------------------------------------------
-# Copyright (c) 1993 AT&T All Rights Reserved
-# ======================================================================
-
-# ----------------------------------------------------------------------
-# COMMAND: dd_send_number <interp> <ddwin> <data>
-#
-# INPUTS
-# <interp> = interpreter for target application
-# <ddwin> = pathname for target drag&drop window
-# <data> = data returned from -tokencmd
-#
-# RETURNS
-# ""
-#
-# SIDE-EFFECTS
-# Sends data to remote application DragDrop(number), and then
-# invokes the "number" handler for the drag&drop target.
-# ----------------------------------------------------------------------
-proc dd_send_number {interp ddwin data} {
- send $interp "
- foreach num [list $data] {
- expr \$num*1
- }
- global DragDrop
- set DragDrop(number) [list $data]
- "
- send $interp "drag&drop target $ddwin handle number"
-}
diff --git a/blt3.0.1/library/dd_protocols/dd-text.tcl b/blt3.0.1/library/dd_protocols/dd-text.tcl
deleted file mode 100644
index eedbd48..0000000
--- a/blt3.0.1/library/dd_protocols/dd-text.tcl
+++ /dev/null
@@ -1,48 +0,0 @@
-# ----------------------------------------------------------------------
-# PURPOSE: drag&drop send routine for "text" data
-#
-# Widgets that are to participate in drag&drop operations for
-# "text" data should be registered as follows:
-#
-# drag&drop .win source handler text dd_send_text
-# drag&drop .win target handler text my_text_handler
-#
-# proc my_text_handler {} {
-# global DragDrop
-#
-# set data $DragDrop(text)
-# .
-# . do something with $data
-# .
-# }
-#
-# AUTHOR: Michael J. McLennan Phone: (215)770-2842
-# AT&T Bell Laboratories E-mail: aluxpo!mmc at att.com
-#
-# SCCS: %W% (%G%)
-# ----------------------------------------------------------------------
-# Copyright (c) 1993 AT&T All Rights Reserved
-# ======================================================================
-
-# ----------------------------------------------------------------------
-# COMMAND: dd_send_text <interp> <ddwin> <data>
-#
-# INPUTS
-# <interp> = interpreter for target application
-# <ddwin> = pathname for target drag&drop window
-# <data> = data returned from -tokencmd
-#
-# RETURNS
-# ""
-#
-# SIDE-EFFECTS
-# Sends data to remote application DragDrop(text), and then
-# invokes the "text" handler for the drag&drop target.
-# ----------------------------------------------------------------------
-proc dd_send_text {interp ddwin data} {
- send $interp "
- global DragDrop
- set DragDrop(text) [list $data]
- "
- send $interp "drag&drop target $ddwin handle text"
-}
diff --git a/blt3.0.1/library/dd_protocols/tclIndex b/blt3.0.1/library/dd_protocols/tclIndex
deleted file mode 100644
index d3ca831..0000000
--- a/blt3.0.1/library/dd_protocols/tclIndex
+++ /dev/null
@@ -1,12 +0,0 @@
-# Tcl autoload index file, version 2.0
-# This file is generated by the "auto_mkindex" command
-# and sourced to set up indexing information for one or
-# more commands. Typically each line is a command that
-# sets an element in the auto_index array, where the
-# element name is the name of a command and the value is
-# a script that loads the command.
-
-set auto_index(dd_send_file) "source $dir/dd-file.tcl"
-set auto_index(dd_send_text) "source $dir/dd-text.tcl"
-set auto_index(dd_send_number) "source $dir/dd-number.tcl"
-set auto_index(dd_send_color) "source $dir/dd-color.tcl"
diff --git a/blt3.0.1/library/dnd.tcl b/blt3.0.1/library/dnd.tcl
deleted file mode 100644
index c8fb68d..0000000
--- a/blt3.0.1/library/dnd.tcl
+++ /dev/null
@@ -1,102 +0,0 @@
-#
-# dnd.tcl
-#
-# ----------------------------------------------------------------------
-# Bindings for the BLT drag&drop command
-# ----------------------------------------------------------------------
-# AUTHOR: George Howlett
-# Bell Labs Innovations for Lucent Technologies
-# gah at bell-labs.com
-# http://www.tcltk.com/blt
-# ----------------------------------------------------------------------
-# Copyright (c) 1998 Lucent Technologies, Inc.
-# ======================================================================
-#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that the copyright notice and warranty disclaimer appear in
-# supporting documentation, and that the names of Lucent Technologies
-# any of their entities not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# Lucent Technologies disclaims all warranties with regard to this
-# software, including all implied warranties of merchantability and
-# fitness. In no event shall Lucent be liable for any special, indirect
-# or consequential damages or any damages whatsoever resulting from loss
-# of use, data or profits, whether in an action of contract, negligence
-# or other tortuous action, arising out of or in connection with the use
-# or performance of this software.
-#
-# ======================================================================
-
-if { $tcl_version >= 8.0 } {
- set cmd blt::dnd
-} else {
- set cmd dnd
-}
-for { set i 1 } { $i <= 5 } { incr i } {
- bind BltDndButton$i <ButtonPress-$i> [list $cmd select %W %X %Y %t]
- bind BltDndButton$i <B$i-Motion> [list $cmd drag %W %X %Y]
- bind BltDndButton$i <ButtonRelease-$i> [list $cmd drop %W %X %Y]
-}
-
-# ----------------------------------------------------------------------
-#
-# DndInit --
-#
-# Invoked from C whenever a new drag&drop source is created.
-# Sets up the default bindings for the drag&drop source.
-#
-# <ButtonPress-?> Starts the drag operation.
-# <B?-Motion> Updates the drag.
-# <ButtonRelease-?> Drop the data on the target.
-#
-# Arguments:
-# widget source widget
-# button Mouse button used to activate drag.
-# cmd "dragdrop" or "blt::dragdrop"
-#
-# ----------------------------------------------------------------------
-
-proc blt::DndInit { widget button } {
- set tagList {}
- if { $button > 0 } {
- lappend tagList BltDndButton$button
- }
- foreach tag [bindtags $widget] {
- if { ![string match BltDndButton* $tag] } {
- lappend tagList $tag
- }
- }
- bindtags $widget $tagList
-}
-
-proc blt::DndStdDrop { widget args } {
- array set info $args
- set fmt [lindex $info(formats) 0]
- dnd pull $widget $fmt
- return 0
-}
-
-proc blt::PrintInfo { array } {
- upvar $array state
-
- parray state
- if { $info(state) & 0x01 } {
- puts "Shift-Drop"
- }
- if { $info(state) & 0x02 } {
- puts "CapsLock-Drop"
- }
- if { $info(state) & 0x04 } {
- puts "Control-Drop"
- }
- if { $info(state) & 0x08 } {
- puts "Alt-Drop"
- }
- if { $info(state) & 0x10 } {
- puts "NumLock-Drop"
- }
-}
\ No newline at end of file
diff --git a/blt3.0.1/library/dragdrop.tcl b/blt3.0.1/library/dragdrop.tcl
deleted file mode 100644
index 04e1960..0000000
--- a/blt3.0.1/library/dragdrop.tcl
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# dragdrop.tcl
-#
-# ----------------------------------------------------------------------
-# Bindings for the BLT drag&drop command
-# ----------------------------------------------------------------------
-# AUTHOR: George Howlett
-# Bell Labs Innovations for Lucent Technologies
-# gah at bell-labs.com
-# http://www.tcltk.com/blt
-# ----------------------------------------------------------------------
-# Copyright (c) 1998 Lucent Technologies, Inc.
-# ======================================================================
-#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that the copyright notice and warranty disclaimer appear in
-# supporting documentation, and that the names of Lucent Technologies
-# any of their entities not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# Lucent Technologies disclaims all warranties with regard to this
-# software, including all implied warranties of merchantability and
-# fitness. In no event shall Lucent be liable for any special, indirect
-# or consequential damages or any damages whatsoever resulting from loss
-# of use, data or profits, whether in an action of contract, negligence
-# or other tortuous action, arising out of or in connection with the use
-# or performance of this software.
-#
-# ======================================================================
-
-if { $tcl_version >= 8.0 } {
- set cmd blt::drag&drop
-} else {
- set cmd drag&drop
-}
-for { set i 1 } { $i <= 5 } { incr i } {
- bind BltDrag&DropButton$i <ButtonPress-$i> [list $cmd drag %W %X %Y]
- bind BltDrag&DropButton$i <B$i-Motion> [list $cmd drag %W %X %Y]
- bind BltDrag&DropButton$i <ButtonRelease-$i> [list $cmd drop %W %X %Y]
-}
-
-# ----------------------------------------------------------------------
-#
-# Drag&DropInit --
-#
-# Invoked from C whenever a new drag&drop source is created.
-# Sets up the default bindings for the drag&drop source.
-#
-# <ButtonPress-?> Starts the drag operation.
-# <B?-Motion> Updates the drag.
-# <ButtonRelease-?> Drop the data on the target.
-#
-# Arguments:
-# widget source widget
-# button Mouse button used to activate drag.
-# cmd "dragdrop" or "blt::dragdrop"
-#
-# ----------------------------------------------------------------------
-
-proc blt::Drag&DropInit { widget button } {
- set tagList {}
- if { $button > 0 } {
- lappend tagList BltDrag&DropButton$button
- }
- foreach tag [bindtags $widget] {
- if { ![string match BltDrag&DropButton* $tag] } {
- lappend tagList $tag
- }
- }
- bindtags $widget $tagList
-}
-
diff --git a/blt3.0.1/library/drawer.tcl b/blt3.0.1/library/drawer.tcl
deleted file mode 100644
index 084062b..0000000
--- a/blt3.0.1/library/drawer.tcl
+++ /dev/null
@@ -1,40 +0,0 @@
-namespace eval blt::Drawer {
- set buttonPressed 0
- proc Initialize {} {
- }
-}
-
-bind DrawerHandle <Enter> {
- if { !$blt::Drawer::buttonPressed } {
- %W activate
- }
-}
-bind DrawerHandle <Leave> {
- if { !$blt::Drawer::buttonPressed } {
- %W deactivate
- }
-}
-bind DrawerHandle <KeyPress-Left> {
- %W move -10 0
-}
-bind DrawerHandle <KeyPress-Right> {
- %W move 10 0
-}
-bind DrawerHandle <KeyPress-Up> {
- %W move 0 -10
-}
-bind DrawerHandle <KeyPress-Down> {
- %W move 0 10
-}
-bind DrawerHandle <ButtonPress-1> {
- set blt::Drawer::buttonPressed 1
- %W anchor %X %Y
-}
-bind DrawerHandle <B1-Motion> {
- %W mark %X %Y
-}
-bind DrawerHandle <ButtonRelease-1> {
- set blt::Drawer::buttonPressed 0
- %W set %X %Y
-}
-
diff --git a/blt3.0.1/library/filmstrip.tcl b/blt3.0.1/library/filmstrip.tcl
deleted file mode 100644
index f7a268c..0000000
--- a/blt3.0.1/library/filmstrip.tcl
+++ /dev/null
@@ -1,52 +0,0 @@
-namespace eval blt::Filmstrip {
- set buttonPressed 0
- proc Initialize {} {
- }
-}
-
-bind FilmstripHandle <Enter> {
- if { !$blt::Filmstrip::buttonPressed } {
- %W activate
- }
-}
-bind FilmstripHandle <Leave> {
- if { !$blt::Filmstrip::buttonPressed } {
- %W deactivate
- }
-}
-bind FilmstripHandle <KeyPress-Left> {
- %W move -10 0
-}
-bind FilmstripHandle <KeyPress-Right> {
- %W move 10 0
-}
-bind FilmstripHandle <KeyPress-Up> {
- %W move 0 -10
-}
-bind FilmstripHandle <KeyPress-Down> {
- %W move 0 10
-}
-bind FilmstripHandle <Shift-KeyPress-Left> {
- %W move -100 0
-}
-bind FilmstripHandle <Shift-KeyPress-Right> {
- %W move 100 0
-}
-bind FilmstripHandle <Shift-KeyPress-Up> {
- %W move 0 -100
-}
-bind FilmstripHandle <Shift-KeyPress-Down> {
- %W move 0 100
-}
-bind FilmstripHandle <ButtonPress-1> {
- set blt::Filmstrip::buttonPressed 1
- %W anchor %X %Y
-}
-bind FilmstripHandle <B1-Motion> {
- %W mark %X %Y
-}
-bind FilmstripHandle <ButtonRelease-1> {
- set blt::Filmstrip::buttonPressed 0
- %W set %X %Y
-}
-
diff --git a/blt3.0.1/library/graph.tcl b/blt3.0.1/library/graph.tcl
deleted file mode 100644
index 8c4fd8d..0000000
--- a/blt3.0.1/library/graph.tcl
+++ /dev/null
@@ -1,842 +0,0 @@
-
-namespace eval ::blt::legend {
- variable _private
- array set _private {
- afterId ""
- scroll 0
- space off
- drag 0
- x 0
- y 0
- }
-}
-
-namespace eval ::blt::ZoomStack {
- variable _private
- array set _private {
- afterId ""
- scroll 0
- space off
- drag 0
- x 0
- y 0
- }
-}
-
-option add *zoomOutline.dashes 4
-option add *zoomOutline.lineWidth 2
-option add *zoomOutline.xor yes
-option add *zoomTitle.anchor nw
-option add *zoomTitle.coords "-Inf Inf"
-option add *zoomTitle.font "Arial 14"
-option add *zoomTitle.foreground yellow3
-option add *zoomTitle.shadow yellow4
-
-# ----------------------------------------------------------------------
-#
-# Initialize --
-#
-# Invoked by internally by Treeview_Init routine. Initializes
-# the default bindings for the treeview widget entries. These
-# are local to the widget, so they can't be set through the
-# widget's class bind tags.
-#
-# ----------------------------------------------------------------------
-proc blt::LegendSelections { w } {
- if 0 {
- #
- # Active entry bindings
- #
- $w legend bind all <Enter> {
- %W entry highlight current
- }
- $w legend bind all <Leave> {
- %W entry highlight ""
- }
- }
-
- #
- # ButtonPress-1
- #
- # Performs the following operations:
- #
- # 1. Clears the previous selection.
- # 2. Selects the current entry.
- # 3. Sets the focus to this entry.
- # 4. Scrolls the entry into view.
- # 5. Sets the selection anchor to this entry, just in case
- # this is "multiple" mode.
- #
-
- $w legend bind all <ButtonPress-1> {
- blt::legend::SetSelectionAnchor %W current
- set blt::legend::_private(scroll) 1
- }
-
- #
- # B1-Motion
- #
- # For "multiple" mode only. Saves the current location of the
- # pointer for auto-scrolling. Resets the selection mark.
- #
- $w legend bind all <B1-Motion> {
- set blt::legend::_private(x) %x
- set blt::legend::_private(y) %y
- set elem [%W legend get @%x,%y]
- if { $elem != "" } {
- if { [%W legend cget -selectmode] == "multiple" } {
- %W legend selection mark $elem
- } else {
- blt::legend::SetSelectionAnchor %W $elem
- }
- }
- }
-
- #
- # ButtonRelease-1
- #
- # For "multiple" mode only.
- #
- $w legend bind all <ButtonRelease-1> {
- if { [%W legend cget -selectmode] == "multiple" } {
- %W legend selection anchor current
- }
- after cancel $blt::legend::_private(afterId)
- set blt::legend::_private(scroll) 0
- }
-
- #
- # Shift-ButtonPress-1
- #
- # For "multiple" mode only.
- #
-
- $w legend bind all <Shift-ButtonPress-1> {
- if { [%W legend cget -selectmode] == "multiple" &&
- [%W legend selection present] } {
- if { [%W legend get anchor] == "" } {
- %W legend selection anchor current
- }
- set elem [%W legend get anchor]
- %W legend selection clearall
- %W legend selection set $elem current
- } else {
- blt::legend::SetSelectionAnchor %W current
- }
- }
- $w legend bind all <Shift-Double-ButtonPress-1> {
- # do nothing
- }
- $w legend bind all <Shift-B1-Motion> {
- # do nothing
- }
- $w legend bind all <Shift-ButtonRelease-1> {
- after cancel $blt::legend::_private(afterId)
- set blt::legend::_private(scroll) 0
- }
-
- #
- # Control-ButtonPress-1
- #
- # For "multiple" mode only.
- #
- $w legend bind all <Control-ButtonPress-1> {
- if { [%W legend cget -selectmode] == "multiple" } {
- set elem [%W legend get current]
- %W legend selection toggle $elem
- %W legend selection anchor $elem
- } else {
- blt::legend::SetSelectionAnchor %W current
- }
- }
- $w legend bind all <Control-Double-ButtonPress-1> {
- # do nothing
- }
- $w legend bind all <Control-B1-Motion> {
- # do nothing
- }
- $w legend bind all <Control-ButtonRelease-1> {
- after cancel $blt::legend::_private(afterId)
- set blt::legend::_private(scroll) 0
- }
-
- $w legend bind all <Control-Shift-ButtonPress-1> {
- if { [%W legend cget -selectmode] == "multiple" &&
- [%W legend selection present] } {
- if { [%W legend get anchor] == "" } {
- %W selection anchor current
- }
- if { [%W legend selection includes anchor] } {
- %W legend selection set anchor current
- } else {
- %W legend selection clear anchor current
- %W legend selection set current
- }
- } else {
- blt::legend::SetSelectionAnchor %W current
- }
- }
- $w legend bind all <Control-Shift-Double-ButtonPress-1> {
- # do nothing
- }
- $w legend bind all <Control-Shift-B1-Motion> {
- # do nothing
- }
- $w legend bind all <KeyPress-Up> {
- blt::legend::MoveFocus %W previous.row
- if { $blt::legend::_private(space) } {
- %W legend selection toggle focus
- }
- }
- $w legend bind all <KeyPress-Down> {
- blt::legend::MoveFocus %W next.row
- if { $blt::legend::_private(space) } {
- %W legend selection toggle focus
- }
- }
- $w legend bind all <KeyPress-Left> {
- blt::legend::MoveFocus %W previous.column
- if { $blt::legend::_private(space) } {
- %W legend selection toggle focus
- }
- }
- $w legend bind all <KeyPress-Right> {
- blt::legend::MoveFocus %W next.column
- if { $blt::legend::_private(space) } {
- %W legend selection toggle focus
- }
- }
- $w legend bind all <KeyPress-space> {
- if { [%W legend cget -selectmode] == "single" } {
- if { [%W legend selection includes focus] } {
- %W legend selection clearall
- } else {
- %W legend selection clearall
- %W legend selection set focus
- }
- } else {
- %W legend selection toggle focus
- }
- set blt::legend::_private(space) on
- }
-
- $w legend bind all <KeyRelease-space> {
- set blt::legend::_private(space) off
- }
- $w legend bind all <KeyPress-Return> {
- blt::legend::MoveFocus %W focus
- set blt::legend::_private(space) on
- }
- $w legend bind all <KeyRelease-Return> {
- set blt::legend::_private(space) off
- }
- $w legend bind all <KeyPress-Home> {
- blt::legend::MoveFocus %W first
- }
- $w legend bind all <KeyPress-End> {
- blt::tv::MoveFocus %W last
- }
-}
-
-proc blt::legend::SetSelectionAnchor { w tagOrId } {
- set elem [$w legend get $tagOrId]
- # If the anchor hasn't changed, don't do anything
- if { $elem != [$w legend get anchor] } {
- $w legend selection clearall
- $w legend focus $elem
- $w legend selection set $elem
- $w legend selection anchor $elem
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# MoveFocus --
-#
-# Invoked by KeyPress bindings. Moves the active selection to
-# the entry <where>, which is an index such as "up", "down",
-# "prevsibling", "nextsibling", etc.
-#
-# ----------------------------------------------------------------------
-proc blt::legend::MoveFocus { w elem } {
- catch {$w legend focus $elem} result
- puts stderr "result=$result elem=$elem"
- if { [$w legend cget -selectmode] == "single" } {
- $w legend selection clearall
- $w legend selection set focus
- $w legend selection anchor focus
- }
-}
-
-
-proc Blt_ActiveLegend { g } {
- $g legend bind all <Enter> [list blt::ActivateLegend $g ]
- $g legend bind all <Leave> [list blt::DeactivateLegend $g]
- $g legend bind all <ButtonPress-1> [list blt::HighlightLegend $g]
-}
-
-proc Blt_Crosshairs { g } {
- blt::Crosshairs $g
-}
-
-proc Blt_ResetCrosshairs { g state } {
- blt::Crosshairs $g "Any-Motion" $state
-}
-
-proc Blt_ZoomStack { g args } {
- array set params {
- -mode click
- }
- array set params $args
- if { $params(-mode) == "click" } {
- blt::ZoomStack::ClickClick $g
- } else {
- blt::ZoomStack::ClickRelease $g
- }
-}
-
-proc Blt_PrintKey { g } {
- blt::PrintKey $g
-}
-
-proc Blt_ClosestPoint { g } {
- blt::ClosestPoint $g
-}
-
-#
-# The following procedures that reside in the "blt" namespace are
-# supposed to be private.
-#
-
-proc blt::ActivateLegend { g } {
- set elem [$g legend get current]
- $g legend activate $elem
-}
-proc blt::DeactivateLegend { g } {
- set elem [$g legend get current]
- $g legend deactivate $elem
-}
-
-proc blt::HighlightLegend { g } {
- set elem [$g legend get current]
- if { $elem != "" } {
- set relief [$g element cget $elem -legendrelief]
- if { $relief == "flat" } {
- $g element configure $elem -legendrelief raised
- $g element activate $elem
- } else {
- $g element configure $elem -legendrelief flat
- $g element deactivate $elem
- }
- }
-}
-
-proc blt::Crosshairs { g {event "Any-Motion"} {state "on"}} {
- $g crosshairs $state
- bind crosshairs-$g <$event> {
- %W crosshairs configure -position @%x,%y
- }
- bind crosshairs-$g <Leave> {
- %W crosshairs off
- }
- bind crosshairs-$g <Enter> {
- %W crosshairs on
- }
- $g crosshairs configure -color red
- if { $state == "on" } {
- blt::AddBindTag $g crosshairs-$g
- } elseif { $state == "off" } {
- blt::RemoveBindTag $g crosshairs-$g
- }
-}
-
-proc blt::PrintKey { g {event "Shift-ButtonRelease-3"} } {
- bind print-$g <$event> { Blt_PostScriptDialog %W }
- blt::AddBindTag $g print-$g
-}
-
-proc blt::ClosestPoint { g {event "Control-ButtonPress-2"} } {
- bind closest-point-$g <$event> {
- blt::FindElement %W %x %y
- }
- blt::AddBindTag $g closest-point-$g
-}
-
-proc blt::AddBindTag { widget tag } {
- set oldTagList [bindtags $widget]
- if { [lsearch $oldTagList $tag] < 0 } {
- bindtags $widget [linsert $oldTagList 0 $tag]
- }
-}
-
-proc blt::RemoveBindTag { widget tag } {
- set oldTagList [bindtags $widget]
- set index [lsearch $oldTagList $tag]
- if { $index >= 0 } {
- bindtags $widget [lreplace $oldTagList $index $index]
- }
-}
-
-proc blt::FindElement { g x y } {
- array set info [$g element closest $x $y -interpolate yes]
- if { ![info exists info(name)] } {
- beep
- return
- }
- # --------------------------------------------------------------
- # find(name) - element Id
- # find(index) - index of closest point
- # find(x) find(y) - coordinates of closest point
- # or closest point on line segment.
- # find(dist) - distance from sample coordinate
- # --------------------------------------------------------------
- set markerName "bltClosest_$info(name)"
- catch { $g marker delete $markerName }
- $g marker create text -coords { $info(x) $info(y) } \
- -name $markerName \
- -text "$info(name): $info(dist)\nindex $info(index)" \
- -font "Arial 6" \
- -anchor center -justify left \
- -yoffset 0 -bg {}
-
- set coords [$g invtransform $x $y]
- set nx [lindex $coords 0]
- set ny [lindex $coords 1]
-
- $g marker create line -coords "$nx $ny $info(x) $info(y)" \
- -name line.$markerName
-
- blt::FlashPoint $g $info(name) $info(index) 10
- blt::FlashPoint $g $info(name) [expr $info(index) + 1] 10
-}
-
-proc blt::FlashPoint { g name index count } {
- if { $count & 1 } {
- $g element deactivate $name
- } else {
- $g element activate $name $index
- }
- incr count -1
- if { $count > 0 } {
- after 200 blt::FlashPoint $g $name $index $count
- update
- } else {
- eval $g marker delete [$g marker names "bltClosest_*"]
- }
-}
-
-
-proc blt::ZoomStack::Init { g } {
- variable _private
- set _private($g,interval) 100
- set _private($g,afterId) 0
- set _private($g,A,x) {}
- set _private($g,A,y) {}
- set _private($g,B,x) {}
- set _private($g,B,y) {}
- set _private($g,stack) {}
- set _private($g,corner) A
-}
-
-proc blt::ZoomStack::ClickClick { g {start "ButtonPress-1"} {reset "ButtonPress-3"} } {
- variable _private
-
- Init $g
-
- bind zoom-$g <Enter> "focus %W"
- bind zoom-$g <KeyPress-Escape> { blt::ZoomStack::Reset %W }
- bind zoom-$g <${start}> { blt::ZoomStack::SetPoint %W %x %y }
- bind zoom-$g <${reset}> {
- if { [%W inside %x %y] } {
- blt::ZoomStack::Reset %W
- }
- }
- blt::AddBindTag $g zoom-$g
-}
-
-proc blt::ZoomStack::ClickRelease { g } {
- variable _private
-
- Init $g
- bind zoom-$g <Enter> "focus %W"
- bind zoom-$g <KeyPress-Escape> { blt::ZoomStack::Reset %W }
- bind zoom-$g <ButtonPress-1> { blt::ZoomStack::DragStart %W %x %y }
- bind zoom-$g <B1-Motion> { blt::ZoomStack::DragMotion %W %x %y }
- bind zoom-$g <ButtonRelease-1> { blt::ZoomStack::DragFinish %W %x %y }
- bind zoom-$g <ButtonPress-3> {
- if { [%W inside %x %y] } {
- blt::ZoomStack::Reset %W
- }
- }
- blt::AddBindTag $g zoom-$g
-}
-
-proc blt::ZoomStack::GetCoords { g x y index } {
- variable _private
- if { [$g cget -invertxy] } {
- set _private($g,$index,x) $y
- set _private($g,$index,y) $x
- } else {
- set _private($g,$index,x) $x
- set _private($g,$index,y) $y
- }
-}
-
-proc blt::ZoomStack::MarkPoint { g index } {
- variable _private
-
- if { [llength [$g xaxis use]] > 0 } {
- set x [$g xaxis invtransform $_private($g,$index,x)]
- } else if { [llength [$g x2axis use]] > 0 } {
- set x [$g x2axis invtransform $_private($g,$index,x)]
- }
- if { [llength [$g yaxis use]] > 0 } {
- set y [$g yaxis invtransform $_private($g,$index,y)]
- } else if { [llength [$g y2axis use]] > 0 } {
- set y [$g y2axis invtransform $_private($g,$index,y)]
- }
- set marker "zoomText_$index"
- set text [format "x=%.4g\ny=%.4g" $x $y]
-
- if [$g marker exists $marker] {
- $g marker configure $marker -coords { $x $y } -text $text
- } else {
- $g marker create text -coords { $x $y } -name $marker \
- -font "mathmatica1 10" \
- -text $text -anchor center -bg {} -justify left
- }
-}
-
-proc blt::ZoomStack::DestroyTitle { g } {
- variable _private
-
- if { $_private($g,corner) == "A" } {
- catch { $g marker delete "zoomTitle" }
- }
-}
-
-proc blt::ZoomStack::Pop { g } {
- variable _private
-
- set zoomStack $_private($g,stack)
- if { [llength $zoomStack] > 0 } {
- set cmd [lindex $zoomStack 0]
- set _private($g,stack) [lrange $zoomStack 1 end]
- eval $cmd
- TitleLast $g
- blt::busy hold $g
- update
- blt::busy release $g
- after 2000 [list blt::ZoomStack::DestroyTitle $g]
- } else {
- catch { $g marker delete "zoomTitle" }
- }
-}
-
-# Push the old axis limits on the stack and set the new ones
-
-proc blt::ZoomStack::Push { g } {
- variable _private
-
- eval $g marker delete [$g marker names "zoom*"]
- if { [info exists _private($g,afterId)] } {
- after cancel $_private($g,afterId)
- }
- set x1 $_private($g,A,x)
- set y1 $_private($g,A,y)
- set x2 $_private($g,B,x)
- set y2 $_private($g,B,y)
-
- if { ($x1 == $x2) || ($y1 == $y2) } {
- # No delta, revert to start
- return
- }
- set cmd {}
- foreach axis [$g axis names] {
- if { [$g axis cget $axis -hide] } {
- continue
- }
- set min [$g axis cget $axis -min]
- set max [$g axis cget $axis -max]
- set logscale [$g axis cget $axis -logscale]
- # Save the current scale (log or linear) so that we can restore it.
- # This is for the case where the user changes to logscale while
- # zooming. A previously pushed axis limit could be negative. It
- # seems better for popping the zoom stack to restore a previous view
- # (not convert the ranges).
- set c [list $g axis configure $axis]
- lappend c -min $min -max $max -logscale $logscale
- append cmd "$c\n"
- }
-
- # This effectively pushes the command to reset the graph to the current
- # zoom level onto the stack. This is useful if the new axis ranges are
- # bad and we need to reset the zoom stack.
- set _private($g,stack) [linsert $_private($g,stack) 0 $cmd]
- foreach axis [$g axis names] {
- if { [$g axis cget $axis -hide] } {
- continue; # Don't set zoom on axes not displayed.
- }
- set type [$g axis type $axis]
- if { $type == "x" } {
- set min [$g axis invtransform $axis $x1]
- set max [$g axis invtransform $axis $x2]
- } elseif { $type == "y" } {
- set min [$g axis invtransform $axis $y1]
- set max [$g axis invtransform $axis $y2]
- } else {
- continue; # Axis is not bound to any margin.
- }
- if { ![SetAxisRanges $g $axis $min $max] } {
- Pop $g
- bell
- return
- }
- }
- blt::busy hold $g
- update; # This "update" redraws the graph
- blt::busy release $g
-}
-
-proc blt::ZoomStack::SetAxisRanges { g axis min max } {
- if { $min > $max } {
- set tmp $max; set max $min; set min $tmp
- }
- if { [catch { $g axis configure $axis -min $min -max $max }] != 0 } {
- return 0
- }
- return 1
-}
-
-#
-# This routine terminates either an existing zoom, or pops back to
-# the previous zoom level (if no zoom is in progress).
-#
-proc blt::ZoomStack::Reset { g } {
- variable _private
-
- if { ![info exists _private($g,corner)] } {
- Init $g
- }
- eval $g marker delete [$g marker names "zoom*"]
-
- if { $_private($g,corner) == "A" } {
- # Reset the whole axis
- Pop $g
- } else {
- set _private($g,corner) A
- blt::RemoveBindTag $g select-region-$g
- }
-}
-
-proc blt::ZoomStack::TitleNext { g } {
- variable _private
-
- set level [expr [llength $_private($g,stack)] + 1]
- if { [$g cget -invertxy] } {
- set coords "Inf -Inf"
- } else {
- set coords "-Inf Inf"
- }
- $g marker create text -name "zoomTitle" -text "Zoom #$level" \
- -coords $coords -bindtags "" -anchor nw
-}
-
-proc blt::ZoomStack::TitleLast { g } {
- variable _private
-
- set level [llength $_private($g,stack)]
- if { $level > 0 } {
- $g marker create text -name "zoomTitle" -anchor nw \
- -text "Zoom #$level"
- }
-}
-
-
-proc blt::ZoomStack::SetPoint { g x y } {
- variable _private
- if { ![info exists _private($g,corner)] } {
- Init $g
- }
- GetCoords $g $x $y $_private($g,corner)
- bind select-region-$g <Motion> {
- blt::ZoomStack::GetCoords %W %x %y B
- #blt::ZoomStack::MarkPoint $g B
- blt::ZoomStack::Box %W
- }
- if { $_private($g,corner) == "A" } {
- if { ![$g inside $x $y] } {
- return
- }
- # First corner selected, start watching motion events
-
- #MarkPoint $g A
- TitleNext $g
-
- blt::AddBindTag $g select-region-$g
- set _private($g,corner) B
- } else {
- # Delete the modal binding
- blt::RemoveBindTag $g select-region-$g
- Push $g
- set _private($g,corner) A
- }
-}
-
-proc blt::ZoomStack::DragStart { g x y } {
- variable _private
- if { ![info exists _private($g,corner)] } {
- Init $g
- }
- GetCoords $g $x $y A
- if { ![$g inside $x $y] } {
- return
- }
- set _private(drag) 1
- TitleNext $g
-}
-
-proc blt::ZoomStack::DragMotion { g x y } {
- variable _private
-
- if { $_private(drag) } {
- GetCoords $g $x $y B
- set dx [expr abs($_private($g,B,x) - $_private($g,A,x))]
- set dy [expr abs($_private($g,B,y) - $_private($g,A,y))]
- Box $g
- if { $dy > 10 && $dx > 10 } {
- return 1
- }
- }
- return 0
-}
-
-proc blt::ZoomStack::DragFinish { g x y } {
- variable _private
- if { [DragMotion $g $x $y] } {
- Push $g
- } else {
- eval $g marker delete [$g marker names "zoom*"]
- if { [info exists _private($g,afterId)] } {
- after cancel $_private($g,afterId)
- }
- }
- set _private(drag) 0
-}
-
-
-proc blt::ZoomStack::MarchingAnts { g offset } {
- variable _private
-
- incr offset
- # wrap the counter after 2^16
- set offset [expr $offset & 0xFFFF]
- if { [$g marker exists zoomOutline] } {
- $g marker configure zoomOutline -dashoffset $offset
- set interval $_private($g,interval)
- set id [after $interval [list blt::ZoomStack::MarchingAnts $g $offset]]
- set _private($g,afterId) $id
- }
-}
-
-proc blt::ZoomStack::Box { g } {
- variable _private
-
- if { $_private($g,A,x) > $_private($g,B,x) } {
- set x1 [$g xaxis invtransform $_private($g,B,x)]
- set y1 [$g yaxis invtransform $_private($g,B,y)]
- set x2 [$g xaxis invtransform $_private($g,A,x)]
- set y2 [$g yaxis invtransform $_private($g,A,y)]
- } else {
- set x1 [$g xaxis invtransform $_private($g,A,x)]
- set y1 [$g yaxis invtransform $_private($g,A,y)]
- set x2 [$g xaxis invtransform $_private($g,B,x)]
- set y2 [$g yaxis invtransform $_private($g,B,y)]
- }
- set coords { $x1 $y1 $x2 $y1 $x2 $y2 $x1 $y2 $x1 $y1 }
- if { [$g marker exists "zoomOutline"] } {
- $g marker configure "zoomOutline" -coords $coords
- } else {
- set X [lindex [$g xaxis use] 0]
- set Y [lindex [$g yaxis use] 0]
- $g marker create line -coords $coords -name "zoomOutline" \
- -mapx $X -mapy $Y
- set interval $_private($g,interval)
- set id [after $interval [list blt::ZoomStack::MarchingAnts $g 0]]
- set _private($g,afterId) $id
- }
-}
-
-
-proc Blt_PostScriptDialog { g } {
- set top $g.top
- toplevel $top
-
- foreach var { center landscape maxpect preview decorations padx
- pady paperwidth paperheight width height colormode } {
- global $g.$var
- set $g.$var [$g postscript cget -$var]
- }
- set row 1
- set col 0
- label $top.title -text "PostScript Options"
- blt::table $top $top.title -cspan 7
- foreach bool { center landscape maxpect preview decorations } {
- set w $top.$bool-label
- label $w -text "-$bool" -font "courier 12"
- blt::table $top $row,$col $w -anchor e -pady { 2 0 } -padx { 0 4 }
- set w $top.$bool-yes
- global $g.$bool
- radiobutton $w -text "yes" -variable $g.$bool -value 1
- blt::table $top $row,$col+1 $w -anchor w
- set w $top.$bool-no
- radiobutton $w -text "no" -variable $g.$bool -value 0
- blt::table $top $row,$col+2 $w -anchor w
- incr row
- }
- label $top.modes -text "-colormode" -font "courier 12"
- blt::table $top $row,0 $top.modes -anchor e -pady { 2 0 } -padx { 0 4 }
- set col 1
- foreach m { color greyscale } {
- set w $top.$m
- radiobutton $w -text $m -variable $g.colormode -value $m
- blt::table $top $row,$col $w -anchor w
- incr col
- }
- set row 1
- frame $top.sep -width 2 -bd 1 -relief sunken
- blt::table $top $row,3 $top.sep -fill y -rspan 6
- set col 4
- foreach value { padx pady paperwidth paperheight width height } {
- set w $top.$value-label
- label $w -text "-$value" -font "courier 12"
- blt::table $top $row,$col $w -anchor e -pady { 2 0 } -padx { 0 4 }
- set w $top.$value-entry
- global $g.$value
- entry $w -textvariable $g.$value -width 8
- blt::table $top $row,$col+1 $w -cspan 2 -anchor w -padx 8
- incr row
- }
- blt::table configure $top c3 -width .125i
- button $top.cancel -text "Cancel" -command "destroy $top"
- blt::table $top $row,0 $top.cancel -width 1i -pady 2 -cspan 3
- button $top.reset -text "Reset" -command "destroy $top"
- #blt::table $top $row,1 $top.reset -width 1i
- button $top.print -text "Print" -command "blt::ResetPostScript $g"
- blt::table $top $row,4 $top.print -width 1i -pady 2 -cspan 2
-}
-
-proc blt::ResetPostScript { g } {
- foreach var { center landscape maxpect preview decorations padx
- pady paperwidth paperheight width height colormode } {
- global $g.$var
- set old [$g postscript cget -$var]
- if { [catch {$g postscript configure -$var [set $g.$var]}] != 0 } {
- $g postscript configure -$var $old
- set $g.$var $old
- }
- }
- $g postscript output "out.ps"
- puts stdout "wrote file \"out.ps\"."
- flush stdout
-}
diff --git a/blt3.0.1/library/hierbox.tcl b/blt3.0.1/library/hierbox.tcl
deleted file mode 100644
index bae993c..0000000
--- a/blt3.0.1/library/hierbox.tcl
+++ /dev/null
@@ -1,522 +0,0 @@
-#
-# hierbox.tcl
-# ----------------------------------------------------------------------
-# Bindings for the BLT hierbox widget
-# ----------------------------------------------------------------------
-# AUTHOR: George Howlett
-# Bell Labs Innovations for Lucent Technologies
-# gah at lucent.com
-# http://www.tcltk.com/blt
-#
-# RCS: $Id: hierbox.tcl,v 1.1.1.1 2010/10/27 21:57:06 joye Exp $
-#
-# ----------------------------------------------------------------------
-# Copyright (c) 1998 Lucent Technologies, Inc.
-# ======================================================================
-#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that the copyright notice and warranty disclaimer appear in
-# supporting documentation, and that the names of Lucent Technologies
-# any of their entities not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# Lucent Technologies disclaims all warranties with regard to this
-# software, including all implied warranties of merchantability and
-# fitness. In no event shall Lucent be liable for any special, indirect
-# or consequential damages or any damages whatsoever resulting from loss
-# of use, data or profits, whether in an action of contract, negligence
-# or other tortuous action, arising out of or in connection with the use
-# or performance of this software.
-#
-# ======================================================================
-
-array set bltHierbox {
- afterId ""
- scroll 0
- space off
- x 0
- y 0
-}
-
-catch {
- namespace eval blt::Hierbox {}
-}
-
-#
-# ButtonPress assignments
-#
-# B1-Enter start auto-scrolling
-# B1-Leave stop auto-scrolling
-# ButtonPress-2 start scan
-# B2-Motion adjust scan
-# ButtonRelease-2 stop scan
-#
-
-bind Hierbox <ButtonPress-2> {
- set bltHierbox(cursor) [%W cget -cursor]
- %W configure -cursor hand1
- %W scan mark %x %y
-}
-
-bind Hierbox <B2-Motion> {
- %W scan dragto %x %y
-}
-
-bind Hierbox <ButtonRelease-2> {
- %W configure -cursor $bltHierbox(cursor)
-}
-
-bind Hierbox <B1-Leave> {
- if { $bltHierbox(scroll) } {
- blt::Hierbox::AutoScroll %W
- }
-}
-
-bind Hierbox <B1-Enter> {
- after cancel $bltHierbox(afterId)
-}
-
-
-#
-# KeyPress assignments
-#
-# Up
-# Down
-# Shift-Up
-# Shift-Down
-# Prior (PageUp)
-# Next (PageDn)
-# Left
-# Right
-# space Start selection toggle of entry currently with focus.
-# Return Start selection toggle of entry currently with focus.
-# Home
-# End
-# F1
-# F2
-# ASCII char Go to next open entry starting with character.
-#
-# KeyRelease
-#
-# space Stop selection toggle of entry currently with focus.
-# Return Stop selection toggle of entry currently with focus.
-
-
-bind Hierbox <KeyPress-Up> {
- blt::Hierbox::MoveFocus %W up
- if { $bltHierbox(space) } {
- %W selection toggle focus
- }
-}
-
-bind Hierbox <KeyPress-Down> {
- blt::Hierbox::MoveFocus %W down
- if { $bltHierbox(space) } {
- %W selection toggle focus
- }
-}
-
-bind Hierbox <Shift-KeyPress-Up> {
- blt::Hierbox::MoveFocus %W prevsibling
-}
-
-bind Hierbox <Shift-KeyPress-Down> {
- blt::Hierbox::MoveFocus %W nextsibling
-}
-
-bind Hierbox <KeyPress-Prior> {
- blt::Hierbox::MovePage %W top
-}
-
-bind Hierbox <KeyPress-Next> {
- blt::Hierbox::MovePage %W bottom
-}
-
-bind Hierbox <KeyPress-Left> {
- %W close focus
-}
-bind Hierbox <KeyPress-Right> {
- %W open focus
- %W see focus -anchor w
-}
-
-bind Hierbox <KeyPress-space> {
- blt::HierboxToggle %W focus
- set bltHierbox(space) on
-}
-
-bind Hierbox <KeyRelease-space> {
- set bltHierbox(space) off
-}
-
-bind Hierbox <KeyPress-Return> {
- blt::HierboxToggle %W focus
- set bltHierbox(space) on
-}
-
-bind Hierbox <KeyRelease-Return> {
- set bltHierbox(space) off
-}
-
-bind Hierbox <KeyPress> {
- blt::Hierbox::NextMatchingEntry %W %A
-}
-
-bind Hierbox <KeyPress-Home> {
- blt::Hierbox::MoveFocus %W root
-}
-
-bind Hierbox <KeyPress-End> {
- blt::Hierbox::MoveFocus %W end
-}
-
-bind Hierbox <KeyPress-F1> {
- %W open -r root
-}
-
-bind Hierbox <KeyPress-F2> {
- eval %W close -r [%W entry children root 0 end]
-}
-
-# ----------------------------------------------------------------------
-# USAGE: blt::HierboxToggle <hierbox> <index>
-# Arguments: hierbox hierarchy widget
-#
-# Invoked when the user presses the space bar. Toggles the selection
-# for the entry at <index>.
-# ----------------------------------------------------------------------
-proc blt::HierboxToggle { widget index } {
- switch -- [$widget cget -selectmode] {
- single {
- if { [$widget selection includes $index] } {
- $widget selection clearall
- } else {
- $widget selection set $index
- }
- }
- multiple {
- $widget selection toggle $index
- }
- }
-}
-
-
-# ----------------------------------------------------------------------
-# USAGE: blt::Hierbox::MovePage <hierbox> <where>
-# Arguments: hierbox hierarchy widget
-#
-# Invoked by KeyPress bindings. Pages the current view up or down.
-# The <where> argument should be either "top" or "bottom".
-# ----------------------------------------------------------------------
-
-proc blt::Hierbox::MovePage { widget where } {
- # If the focus is already at the top/bottom of the window, we want
- # to scroll a page. It's really one page minus an entry because we
- # want to see the last entry on the next/last page.
- if { [$widget index focus] == [$widget index view.$where] } {
- if {$where == "top"} {
- $widget yview scroll -1 pages
- $widget yview scroll 1 units
- } else {
- $widget yview scroll 1 pages
- $widget yview scroll -1 units
- }
- }
- update
-
- # Adjust the entry focus and the view. Also activate the entry.
- # just in case the mouse point is not in the widget.
- $widget entry highlight view.$where
- $widget focus view.$where
- $widget see view.$where
- if { [$widget cget -selectmode] == "single" } {
- $widget selection clearall
- $widget selection set focus
- }
-}
-
-#
-# Edit mode assignments
-#
-# ButtonPress-3 Enables/disables edit mode on entry. Sets focus to
-# entry.
-#
-# KeyPress
-#
-# Left Move insertion position to previous.
-# Right Move insertion position to next.
-# Up Move insertion position up one line.
-# Down Move insertion position down one line.
-# Return End edit mode.
-# Shift-Return Line feed.
-# Home Move to first position.
-# End Move to last position.
-# ASCII char Insert character left of insertion point.
-# Del Delete character right of insertion point.
-# Delete Delete character left of insertion point.
-# Ctrl-X Cut
-# Ctrl-V Copy
-# Ctrl-P Paste
-#
-# KeyRelease
-#
-# ButtonPress-1 Start selection if in entry, otherwise clear selection.
-# B1-Motion Extend/reduce selection.
-# ButtonRelease-1 End selection if in entry, otherwise use last selection.
-# B1-Enter Disabled.
-# B1-Leave Disabled.
-# ButtonPress-2 Same as above.
-# B2-Motion Same as above.
-# ButtonRelease-2 Same as above.
-#
-# All bindings in editting mode will "break" to override other bindings.
-#
-#
-
-bind Hierbox <ButtonPress-3> {
- set node [%W nearest %x %y]
- %W entry insert $node @%x,%y ""
-# %W entry insert $node 2 ""
-}
-
-
-proc blt::Hierbox::Init { widget } {
- #
- # Active entry bindings
- #
- $widget bind Entry <Enter> {
- %W entry highlight current
- }
- $widget bind Entry <Leave> {
- %W entry highlight ""
- }
-
- #
- # Button bindings
- #
- $widget button bind all <ButtonRelease-1> {
- %W see -anchor nw current
- %W toggle current
- }
- $widget button bind all <Enter> {
- %W button highlight current
- }
- $widget button bind all <Leave> {
- %W button highlight ""
- }
-
- #
- # ButtonPress-1
- #
- # Performs the following operations:
- #
- # 1. Clears the previous selection.
- # 2. Selects the current entry.
- # 3. Sets the focus to this entry.
- # 4. Scrolls the entry into view.
- # 5. Sets the selection anchor to this entry, just in case
- # this is "multiple" mode.
- #
-
- $widget bind Entry <ButtonPress-1> {
- blt::Hierbox::SetSelectionAnchor %W current
- set bltHierbox(scroll) 1
- }
-
- $widget bin Entry <Double-ButtonPress-1> {
- %W toggle current
- }
-
- #
- # B1-Motion
- #
- # For "multiple" mode only. Saves the current location of the
- # pointer for auto-scrolling.
- #
- $widget bind Entry <B1-Motion> {
- set bltHierbox(x) %x
- set bltHierbox(y) %y
- set index [%W nearest %x %y]
- if { [%W cget -selectmode] == "multiple" } {
- %W selection mark $index
- } else {
- blt::Hierbox::SetSelectionAnchor %W $index
- }
- }
-
- #
- # ButtonRelease-1
- #
- # For "multiple" mode only.
- #
- $widget bind Entry <ButtonRelease-1> {
- if { [%W cget -selectmode] == "multiple" } {
- %W selection anchor current
- }
- after cancel $bltHierbox(afterId)
- set bltHierbox(scroll) 0
- }
-
- #
- # Shift-ButtonPress-1
- #
- # For "multiple" mode only.
- #
- $widget bind Entry <Shift-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" && [%W selection present] } {
- if { [%W index anchor] == "" } {
- %W selection anchor current
- }
- set index [%W index anchor]
- %W selection clearall
- %W selection set $index current
- } else {
- blt::Hierbox::SetSelectionAnchor %W current
- }
- }
- $widget bind Entry <Shift-B1-Motion> {
- # do nothing
- }
- $widget bind Entry <Shift-ButtonRelease-1> {
- after cancel $bltHierbox(afterId)
- set bltHierbox(scroll) 0
- }
-
- #
- # Control-ButtonPress-1
- #
- # For "multiple" mode only.
- #
- $widget bind Entry <Control-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" } {
- set index [%W index current]
- %W selection toggle $index
- %W selection anchor $index
- } else {
- blt::Hierbox::SetSelectionAnchor %W current
- }
- }
- $widget bind Entry <Control-B1-Motion> {
- # do nothing
- }
- $widget bind Entry <Control-ButtonRelease-1> {
- after cancel $bltHierbox(afterId)
- set bltHierbox(scroll) 0
- }
- #
- # Control-Shift-ButtonPress-1
- #
- # For "multiple" mode only.
- #
- $widget bind Entry <Control-Shift-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" && [%W selection present] } {
- if { [%W index anchor] == "" } {
- %W selection anchor current
- }
- if { [%W selection includes anchor] } {
- %W selection set anchor current
- } else {
- %W selection clear anchor current
- %W selection set current
- }
- } else {
- blt::Hierbox::SetSelectionAnchor %W current
- }
- }
- $widget bind Entry <Control-Shift-B1-Motion> {
- # do nothing
- }
-}
-
-
-# ----------------------------------------------------------------------
-# USAGE: blt::Hierbox::AutoScroll <hierbox>
-#
-# Invoked when the user is selecting elements in a hierbox widget
-# and drags the mouse pointer outside of the widget. Scrolls the
-# view in the direction of the pointer.
-#
-# Arguments: hierbox hierarchy widget
-#
-# ----------------------------------------------------------------------
-proc blt::Hierbox::AutoScroll { widget } {
- global bltHierbox
- if { ![winfo exists $widget] } {
- return
- }
- set x $bltHierbox(x)
- set y $bltHierbox(y)
- set index [$widget nearest $x $y]
- if { $y >= [winfo height $widget] } {
- $widget yview scroll 1 units
- set neighbor down
- } elseif { $y < 0 } {
- $widget yview scroll -1 units
- set neighbor up
- } else {
- set neighbor $index
- }
- if { [$widget cget -selectmode] == "single" } {
- blt::Hierbox::SetSelectionAnchor $widget $neighbor
- } else {
- $widget selection mark $index
- }
- set bltHierbox(afterId) [after 10 blt::Hierbox::AutoScroll $widget]
-}
-
-proc blt::Hierbox::SetSelectionAnchor { widget index } {
- set index [$widget index $index]
- $widget selection clearall
- $widget see $index
- $widget focus $index
- $widget selection set $index
- $widget selection anchor $index
-}
-
-
-# ----------------------------------------------------------------------
-# USAGE: blt::Hierbox::NextMatchingEntry <hierbox> <char>
-# Arguments: hierbox hierarchy widget
-#
-# Invoked by KeyPress bindings. Searches for an entry that starts
-# with the letter <char> and makes that entry active.
-# ----------------------------------------------------------------------
-
-proc blt::Hierbox::NextMatchingEntry { widget key } {
- if {[string match {[ -~]} $key]} {
- set last [$widget index focus]
- set next [$widget index next]
- while { $next != $last } {
- set label [$widget entry cget $next -label]
- if { [string index $label 0] == $key } {
- break
- }
- set next [$widget index -at $next next]
- }
- $widget focus $next
- if {[$widget cget -selectmode] == "single"} {
- $widget selection clearall
- $widget selection set focus
- }
- $widget see focus
- }
-}
-
-# ----------------------------------------------------------------------
-# USAGE: blt::Hierbox::MoveFocus <hierbox> <where>
-#
-# Invoked by KeyPress bindings. Moves the active selection to the
-# entry <where>, which is an index such as "up", "down", "prevsibling",
-# "nextsibling", etc.
-# ----------------------------------------------------------------------
-proc blt::Hierbox::MoveFocus { widget where } {
- catch {$widget focus $where}
- if { [$widget cget -selectmode] == "single" } {
- $widget selection clearall
- $widget selection set focus
- }
- $widget see focus
-}
diff --git a/blt3.0.1/library/hiertable.tcl b/blt3.0.1/library/hiertable.tcl
deleted file mode 100644
index 6efd9fc..0000000
--- a/blt3.0.1/library/hiertable.tcl
+++ /dev/null
@@ -1,943 +0,0 @@
-# hiertable.tcl
-# ----------------------------------------------------------------------
-# Bindings for the BLT hiertable widget
-# ----------------------------------------------------------------------
-# AUTHOR: George Howlett
-# Bell Labs Innovations for Lucent Technologies
-# gah at lucent.com
-# http://www.tcltk.com/blt
-#
-# RCS: $Id: hiertable.tcl,v 1.1.1.1 2010/10/27 21:57:06 joye Exp $
-#
-# ----------------------------------------------------------------------
-# Copyright (c) 1998 Lucent Technologies, Inc.
-# ======================================================================
-#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that the copyright notice and warranty disclaimer appear in
-# supporting documentation, and that the names of Lucent Technologies
-# any of their entities not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# Lucent Technologies disclaims all warranties with regard to this
-# software, including all implied warranties of merchantability and
-# fitness. In no event shall Lucent be liable for any special, indirect
-# or consequential damages or any damages whatsoever resulting from loss
-# of use, data or profits, whether in an action of contract, negligence
-# or other tortuous action, arising out of or in connection with the use
-# or performance of this software.
-#
-# ======================================================================
-
-namespace eval blt::Hiertable {
- set afterId ""
- set scroll 0
- set column ""
- set space off
- set x 0
- set y 0
-}
-
-#
-# ButtonPress assignments
-#
-# B1-Enter start auto-scrolling
-# B1-Leave stop auto-scrolling
-# ButtonPress-2 start scan
-# B2-Motion adjust scan
-# ButtonRelease-2 stop scan
-#
-
-bind Hiertable <ButtonPress-2> {
- set blt::Hiertable::cursor [%W cget -cursor]
- %W configure -cursor hand1
- %W scan mark %x %y
-}
-
-bind Hiertable <B2-Motion> {
- %W scan dragto %x %y
-}
-
-bind Hiertable <ButtonRelease-2> {
- %W configure -cursor $blt::Hiertable::cursor
-}
-
-bind Hiertable <B1-Leave> {
- if { $blt::Hiertable::scroll } {
- blt::Hiertable::AutoScroll %W
- }
-}
-
-bind Hiertable <B1-Enter> {
- after cancel $blt::Hiertable::afterId
-}
-
-#
-# KeyPress assignments
-#
-# Up
-# Down
-# Shift-Up
-# Shift-Down
-# Prior (PageUp)
-# Next (PageDn)
-# Left
-# Right
-# space Start selection toggle of entry currently with focus.
-# Return Start selection toggle of entry currently with focus.
-# Home
-# End
-# F1
-# F2
-# ASCII char Go to next open entry starting with character.
-#
-# KeyRelease
-#
-# space Stop selection toggle of entry currently with focus.
-# Return Stop selection toggle of entry currently with focus.
-
-
-bind Hiertable <KeyPress-Up> {
- blt::Hiertable::MoveFocus %W up
- if { $blt::Hiertable::space } {
- %W selection toggle focus
- }
-}
-
-bind Hiertable <KeyPress-Down> {
- blt::Hiertable::MoveFocus %W down
- if { $blt::Hiertable::space } {
- %W selection toggle focus
- }
-}
-
-bind Hiertable <Shift-KeyPress-Up> {
- blt::Hiertable::MoveFocus %W prevsibling
-}
-
-bind Hiertable <Shift-KeyPress-Down> {
- blt::Hiertable::MoveFocus %W nextsibling
-}
-
-bind Hiertable <KeyPress-Prior> {
- blt::Hiertable::MovePage %W top
-}
-
-bind Hiertable <KeyPress-Next> {
- blt::Hiertable::MovePage %W bottom
-}
-
-bind Hiertable <KeyPress-Left> {
- %W close focus
-}
-bind Hiertable <KeyPress-Right> {
- %W open focus
- %W see focus -anchor w
-}
-
-bind Hiertable <KeyPress-space> {
- if { [%W cget -selectmode] == "single" } {
- if { [%W selection includes focus] } {
- %W selection clearall
- } else {
- %W selection clearall
- %W selection set focus
- }
- } else {
- %W selection toggle focus
- }
- set blt::Hiertable::space on
-}
-
-bind Hiertable <KeyRelease-space> {
- set blt::Hiertable::space off
-}
-
-bind Hiertable <KeyPress-Return> {
- blt::Hiertable::MoveFocus %W focus
- set blt::Hiertable::space on
-}
-
-bind Hiertable <KeyRelease-Return> {
- set blt::Hiertable::space off
-}
-
-bind Hiertable <KeyPress> {
- blt::Hiertable::NextMatchingEntry %W %A
-}
-
-bind Hiertable <KeyPress-Home> {
- blt::Hiertable::MoveFocus %W top
-}
-
-bind Hiertable <KeyPress-End> {
- blt::Hiertable::MoveFocus %W bottom
-}
-
-bind Hiertable <KeyPress-F1> {
- %W open -r root
-}
-
-bind Hiertable <KeyPress-F2> {
- eval %W close -r [%W entry children root]
-}
-
-#
-# Differences between "current" and nearest.
-#
-# set index [$widget index current]
-# set index [$widget nearest $x $y]
-#
-# o Nearest gives you the closest entry.
-# o current is "" if
-# 1) the pointer isn't over an entry.
-# 2) the pointer is over a open/close button.
-# 3)
-#
-#
-# ----------------------------------------------------------------------
-#
-# USAGE: blt::Hiertable::Init <hiertable>
-#
-# Invoked by internally by Hiertable_Init routine. Initializes the
-# default bindings for the hiertable widget entries. These are local
-# to the widget, so they can't be set through the widget's class
-# bind tags.
-#
-# Arguments: hiertable hierarchy widget
-#
-# ----------------------------------------------------------------------
-proc blt::Hiertable::Init { widget } {
- #
- # Active entry bindings
- #
- $widget bind Entry <Enter> {
- %W entry highlight current
- }
- $widget bind Entry <Leave> {
- %W entry highlight ""
- }
-
- #
- # Button bindings
- #
- $widget button bind all <ButtonRelease-1> {
- %W see -anchor nw current
- %W toggle current
- }
- $widget button bind all <Enter> {
- %W button highlight current
- }
- $widget button bind all <Leave> {
- %W button highlight ""
- }
-
- #
- # ButtonPress-1
- #
- # Performs the following operations:
- #
- # 1. Clears the previous selection.
- # 2. Selects the current entry.
- # 3. Sets the focus to this entry.
- # 4. Scrolls the entry into view.
- # 5. Sets the selection anchor to this entry, just in case
- # this is "multiple" mode.
- #
-
- $widget bind Entry <ButtonPress-1> {
- blt::Hiertable::SetSelectionAnchor %W current
- set blt::Hiertable::scroll 1
- }
-
- $widget bind Entry <Double-ButtonPress-1> {
- %W toggle current
- }
-
- #
- # B1-Motion
- #
- # For "multiple" mode only. Saves the current location of the
- # pointer for auto-scrolling. Resets the selection mark.
- #
- $widget bind Entry <B1-Motion> {
- set blt::Hiertable::x %x
- set blt::Hiertable::y %y
- set index [%W nearest %x %y]
- if { [%W cget -selectmode] == "multiple" } {
- %W selection mark $index
- } else {
- blt::Hiertable::SetSelectionAnchor %W $index
- }
- }
-
- #
- # ButtonRelease-1
- #
- # For "multiple" mode only.
- #
- $widget bind Entry <ButtonRelease-1> {
- if { [%W cget -selectmode] == "multiple" } {
- %W selection anchor current
- }
- after cancel $blt::Hiertable::afterId
- set blt::Hiertable::scroll 0
- }
-
- #
- # Shift-ButtonPress-1
- #
- # For "multiple" mode only.
- #
-
- $widget bind Entry <Shift-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" && [%W selection present] } {
- if { [%W index anchor] == "" } {
- %W selection anchor current
- }
- set index [%W index anchor]
- %W selection clearall
- %W selection set $index current
- } else {
- blt::Hiertable::SetSelectionAnchor %W current
- }
- }
- $widget bind Entry <Shift-Double-ButtonPress-1> {
- puts <Shift-Double-ButtonPress-1>
- # do nothing
- }
- $widget bind Entry <Shift-B1-Motion> {
- # do nothing
- }
- $widget bind Entry <Shift-ButtonRelease-1> {
- after cancel $blt::Hiertable::afterId
- set blt::Hiertable::scroll 0
- }
-
- #
- # Control-ButtonPress-1
- #
- # For "multiple" mode only.
- #
- $widget bind Entry <Control-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" } {
- set index [%W index current]
- %W selection toggle $index
- %W selection anchor $index
- } else {
- blt::Hiertable::SetSelectionAnchor %W current
- }
- }
- $widget bind Entry <Control-Double-ButtonPress-1> {
- puts <Control-Double-ButtonPress-1>
- # do nothing
- }
- $widget bind Entry <Control-B1-Motion> {
- # do nothing
- }
- $widget bind Entry <Control-ButtonRelease-1> {
- after cancel $blt::Hiertable::afterId
- set blt::Hiertable::scroll 0
- }
-
- $widget bind Entry <Control-Shift-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" && [%W selection present] } {
- if { [%W index anchor] == "" } {
- %W selection anchor current
- }
- if { [%W selection includes anchor] } {
- %W selection set anchor current
- } else {
- %W selection clear anchor current
- %W selection set current
- }
- } else {
- blt::Hiertable::SetSelectionAnchor %W current
- }
- }
- $widget bind Entry <Control-Shift-Double-ButtonPress-1> {
- puts <Control-Shift-Double-ButtonPress-1>
- # do nothing
- }
- $widget bind Entry <Control-Shift-B1-Motion> {
- # do nothing
- }
- $widget column bind all <Enter> {
- %W column highlight [%W column current]
- }
- $widget column bind all <Leave> {
- %W column highlight ""
- }
- $widget column bind Rule <Enter> {
- %W column highlight [%W column current]
- %W column resize activate [%W column current]
- }
- $widget column bind Rule <Leave> {
- %W column highlight ""
- %W column resize activate ""
- }
- $widget column bind Rule <ButtonPress-1> {
- %W column resize anchor %x
- }
- $widget column bind Rule <B1-Motion> {
- %W column resize mark %x
- }
- $widget column bind Rule <ButtonRelease-1> {
- %W column configure [%W column current] -width [%W column resize set]
- }
- $widget column bind all <ButtonRelease-1> {
- set column [%W column nearest %x %y]
- if { $column != "" } {
- %W column invoke $column
- }
- }
-}
-
-# ----------------------------------------------------------------------
-# USAGE: blt::Hiertable::AutoScroll <hiertable>
-#
-# Invoked when the user is selecting elements in a hiertable widget
-# and drags the mouse pointer outside of the widget. Scrolls the
-# view in the direction of the pointer.
-#
-# Arguments: hiertable hierarchy widget
-#
-# ----------------------------------------------------------------------
-proc blt::Hiertable::AutoScroll { widget } {
- if { ![winfo exists $widget] } {
- return
- }
- set x $blt::Hiertable::x
- set y $blt::Hiertable::y
-
- set index [$widget nearest $x $y]
-
- if {$y >= [winfo height $widget]} {
- $widget yview scroll 1 units
- set neighbor down
- } elseif {$y < 0} {
- $widget yview scroll -1 units
- set neighbor up
- } else {
- set neighbor $index
- }
- if { [$widget cget -selectmode] == "single" } {
- blt::Hiertable::SetSelectionAnchor $widget $neighbor
- } else {
- $widget selection mark $index
- }
- set ::blt::Hiertable::afterId [after 10 blt::Hiertable::AutoScroll $widget]
-}
-
-proc blt::Hiertable::SetSelectionAnchor { widget index } {
- set index [$widget index $index]
- # If the anchor hasn't changed, don't do anything
- if { $index != [$widget index anchor] } {
- $widget selection clearall
- $widget see $index
- $widget focus $index
- $widget selection set $index
- $widget selection anchor $index
- }
-}
-
-# ----------------------------------------------------------------------
-# USAGE: blt::Hiertable::MoveFocus <hiertable> <where>
-#
-# Invoked by KeyPress bindings. Moves the active selection to the
-# entry <where>, which is an index such as "up", "down", "prevsibling",
-# "nextsibling", etc.
-# ----------------------------------------------------------------------
-proc blt::Hiertable::MoveFocus { widget where } {
- catch {$widget focus $where}
- if { [$widget cget -selectmode] == "single" } {
- $widget selection clearall
- $widget selection set focus
- }
- $widget see focus
-}
-
-# ----------------------------------------------------------------------
-# USAGE: blt::Hiertable::MovePage <hiertable> <where>
-# Arguments: hiertable hierarchy widget
-#
-# Invoked by KeyPress bindings. Pages the current view up or down.
-# The <where> argument should be either "top" or "bottom".
-# ----------------------------------------------------------------------
-
-proc blt::Hiertable::MovePage { widget where } {
-
- # If the focus is already at the top/bottom of the window, we want
- # to scroll a page. It's really one page minus an entry because we
- # want to see the last entry on the next/last page.
- if { [$widget index focus] == [$widget index view.$where] } {
- if {$where == "top"} {
- $widget yview scroll -1 pages
- $widget yview scroll 1 units
- } else {
- $widget yview scroll 1 pages
- $widget yview scroll -1 units
- }
- }
- update
-
- # Adjust the entry focus and the view. Also activate the entry.
- # just in case the mouse point is not in the widget.
- $widget entry highlight view.$where
- $widget focus view.$where
- $widget see view.$where
- if { [$widget cget -selectmode] == "single" } {
- $widget selection clearall
- $widget selection set focus
- }
-}
-
-# ----------------------------------------------------------------------
-# USAGE: blt::Hiertable::NextMatchingEntry <hiertable> <char>
-# Arguments: hiertable hierarchy widget
-#
-# Invoked by KeyPress bindings. Searches for an entry that starts
-# with the letter <char> and makes that entry active.
-# ----------------------------------------------------------------------
-
-proc blt::Hiertable::NextMatchingEntry { widget key } {
- if {[string match {[ -~]} $key]} {
- set last [$widget index focus]
- set next [$widget index next]
- while { $next != $last } {
- set label [$widget entry cget $next -label]
- if { [string index $label 0] == $key } {
- break
- }
- set next [$widget index -at $next next]
- }
- $widget focus $next
- if {[$widget cget -selectmode] == "single"} {
- $widget selection clearall
- $widget selection set focus
- }
- $widget see focus
- }
-}
-
-#
-# Edit mode assignments
-#
-# ButtonPress-3 Enables/disables edit mode on entry. Sets focus to
-# entry.
-#
-# KeyPress
-#
-# Left Move insertion position to previous.
-# Right Move insertion position to next.
-# Up Move insertion position up one line.
-# Down Move insertion position down one line.
-# Return End edit mode.
-# Shift-Return Line feed.
-# Home Move to first position.
-# End Move to last position.
-# ASCII char Insert character left of insertion point.
-# Del Delete character right of insertion point.
-# Delete Delete character left of insertion point.
-# Ctrl-X Cut
-# Ctrl-V Copy
-# Ctrl-P Paste
-#
-# KeyRelease
-#
-# ButtonPress-1 Start selection if in entry, otherwise clear selection.
-# B1-Motion Extend/reduce selection.
-# ButtonRelease-1 End selection if in entry, otherwise use last selection.
-# B1-Enter Disabled.
-# B1-Leave Disabled.
-# ButtonPress-2 Same as above.
-# B2-Motion Same as above.
-# ButtonRelease-2 Same as above.
-#
-# All bindings in editting mode will "break" to override other bindings.
-#
-#
-
-bind xEditor <ButtonPress-3> {
- set node [%W nearest %x %y]
- %W entry insert $node @%x,%y ""
-# %W entry insert $node 2 ""
-}
-
-image create photo blt::Hiertable::CloseNormalFolder -format gif -data {
-R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
-AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
-ZTKAsiCtWq0JADs=
-}
-image create photo blt::Hiertable::OpenNormalFolder -format gif -data {
-R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
-AAM1WBrM+rAEMigJ8c3Kb3OSII6kGABhp1JnaK1VGwjwKwtvHqNzzd263M3H4n2OH1QBwGw6
-nQkAOw==
-}
-image create photo blt::Hiertable::CloseActiveFolder -format gif -data {
-R0lGODlhEAANAMIAAAAAAH9/f/////+/AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
-AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
-ZTKAsiCtWq0JADs=
-}
-image create photo blt::Hiertable::OpenActiveFolder -format gif -data {
-R0lGODlhEAANAMIAAAAAAH9/f/////+/AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
-AAM1WBrM+rAEMigJ8c3Kb3OSII6kGABhp1JnaK1VGwjwKwtvHqNzzd263M3H4n2OH1QBwGw6
-nQkAOw==
-}
-
-
-if { $tcl_platform(platform) == "windows" } {
- if { $tk_version >= 8.3 } {
- set cursor "@[file join $blt_library treeview.cur]"
- } else {
- set cursor "size_we"
- }
- option add *Hiertable.ResizeCursor [list $cursor]
-} else {
- option add *Hiertable.ResizeCursor \
- "@$blt_library/treeview.xbm $blt_library/treeview_m.xbm black white"
-}
-
-# Standard Motif bindings:
-
-bind HiertableEditor <ButtonPress-1> {
- %W text icursor @%x,%y
-}
-
-bind HiertableEditor <Left> {
- %W text icursor last
-}
-bind HiertableEditor <Right> {
- %W text icursor next
-}
-bind HiertableEditor <Shift-Left> {
- set new [expr {[%W text index insert] - 1}]
- if {![%W text selection present]} {
- %W text selection from insert
- %W text selection to $new
- } else {
- %W text selection adjust $new
- }
- %W text icursor $new
-}
-bind HiertableEditor <Shift-Right> {
- set new [expr {[%W text index insert] + 1}]
- if {![%W text selection present]} {
- %W text selection from insert
- %W text selection to $new
- } else {
- %W text selection adjust $new
- }
- %W text icursor $new
-}
-
-bind HiertableEditor <Home> {
- %W text icursor 0
-}
-bind HiertableEditor <Shift-Home> {
- set new 0
- if {![%W text selection present]} {
- %W text selection from insert
- %W text selection to $new
- } else {
- %W text selection adjust $new
- }
- %W text icursor $new
-}
-bind HiertableEditor <End> {
- %W text icursor end
-}
-bind HiertableEditor <Shift-End> {
- set new end
- if {![%W text selection present]} {
- %W text selection from insert
- %W text selection to $new
- } else {
- %W text selection adjust $new
- }
- %W text icursor $new
-}
-
-bind HiertableEditor <Delete> {
- if { [%W text selection present]} {
- %W text delete sel.first sel.last
- } else {
- %W text delete insert
- }
-}
-
-bind HiertableEditor <BackSpace> {
- if { [%W text selection present] } {
- %W text delete sel.first sel.last
- } else {
- set index [expr [%W text index insert] - 1]
- if { $index >= 0 } {
- %W text delete $index $index
- }
- }
-}
-
-bind HiertableEditor <Control-space> {
- %W text selection from insert
-}
-
-bind HiertableEditor <Select> {
- %W text selection from insert
-}
-
-bind HiertableEditor <Control-Shift-space> {
- %W text selection adjust insert
-}
-
-bind HiertableEditor <Shift-Select> {
- %W text selection adjust insert
-}
-
-bind HiertableEditor <Control-slash> {
- %W text selection range 0 end
-}
-
-bind HiertableEditor <Control-backslash> {
- %W text selection clear
-}
-
-bind HiertableEditor <KeyPress> {
- blt::Hiertable::Insert %W %A
-}
-
-# Ignore all Alt, Meta, and Control keypresses unless explicitly bound.
-# Otherwise, if a widget binding for one of these is defined, the
-# <KeyPress> class binding will also fire and insert the character,
-# which is wrong. Ditto for Escape, Return, and Tab.
-
-bind HiertableEditor <Alt-KeyPress> {
- # nothing
-}
-
-bind HiertableEditor <Meta-KeyPress> {
- # nothing
-}
-
-bind HiertableEditor <Control-KeyPress> {
- # nothing
-}
-
-bind HiertableEditor <Escape> {
- %W text cancel
- grab release %W
-}
-
-bind HiertableEditor <Return> {
- %W text apply
- grab release %W
-}
-
-bind HiertableEditor <Shift-Return> {
- blt::Hiertable::Insert %W "\n"
-}
-
-bind HiertableEditor <KP_Enter> {
- # nothing
-}
-
-bind HiertableEditor <Tab> {
- # nothing
-}
-
-if {![string compare $tcl_platform(platform) "macintosh"]} {
- bind HiertableEditor <Command-KeyPress> {
- # nothing
- }
-}
-
-# On Windows, paste is done using Shift-Insert. Shift-Insert already
-# generates the <<Paste>> event, so we don't need to do anything here.
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
- bind HiertableEditor <Insert> {
- catch {blt::Hiertable::Insert %W [selection get -displayof %W]}
- }
-}
-
-# Additional emacs-like bindings:
-bind HiertableEditor <ButtonPress-3> {
- if { [winfo viewable %W] } {
- grab release %W
- %W text cancel
- }
-}
-
-bind HiertableEditor <Control-a> {
- %W text icursor 0
- %W text selection clear
-}
-
-bind HiertableEditor <Control-b> {
- %W text icursor [expr {[%W index insert] - 1}]
- %W text selection clear
-}
-
-bind HiertableEditor <Control-d> {
- %W text delete insert
-}
-
-bind HiertableEditor <Control-e> {
- %W text icursor end
- %W text selection clear
-}
-
-bind HiertableEditor <Control-f> {
- %W text icursor [expr {[%W index insert] + 1}]
- %W text selection clear
-}
-
-bind HiertableEditor <Control-h> {
- if {[%W text selection present]} {
- %W text delete sel.first sel.last
- } else {
- set index [expr [%W text index insert] - 1]
- if { $index >= 0 } {
- %W text delete $index $index
- }
- }
-}
-
-bind HiertableEditor <Control-k> {
- %W text delete insert end
-}
-
-
-
-# blt::Hiertable::Insert --
-# Insert a string into an entry at the point of the insertion cursor.
-# If there is a selection in the entry, and it covers the point of the
-# insertion cursor, then delete the selection before inserting.
-#
-# Arguments:
-# w - The entry window in which to insert the string
-# s - The string to insert (usually just a single character)
-
-proc blt::Hiertable::Insert {w s} {
- if {![string compare $s ""]} {
- return
- }
- catch {
- set insert [$w text index insert]
- if {([$w text index sel.first] <= $insert)
- && ([$w text index sel.last] >= $insert)} {
- $w delete sel.first sel.last
- }
- }
- $w text insert insert $s
-}
-
-# tkEntryTranspose -
-# This procedure implements the "transpose" function for entry widgets.
-# It tranposes the characters on either side of the insertion cursor,
-# unless the cursor is at the end of the line. In this case it
-# transposes the two characters to the left of the cursor. In either
-# case, the cursor ends up to the right of the transposed characters.
-#
-# Arguments:
-# w - The entry window.
-
-proc HiertableTranspose w {
- set i [$w text index insert]
- if {$i < [$w text index end]} {
- incr i
- }
- set first [expr {$i-2}]
- if {$first < 0} {
- return
- }
- set new [string index [$w get] [expr {$i-1}]][string index [$w get] $first]
- $w delete $first $i
- $w insert insert $new
-}
-
-# Hiertable::GetSelection --
-#
-# Returns the selected text of the entry with respect to the -show option.
-#
-# Arguments:
-# w - The entry window from which the text to get
-
-proc blt::Hiertable::GetSelection {w} {
- set entryString [string range [$w get] [$w index sel.first] \
- [expr [$w index sel.last] - 1]]
- if {[$w cget -show] != ""} {
- regsub -all . $entryString [string index [$w cget -show] 0] entryString
- }
- return $entryString
-}
-
-if 0 {
- bind HiertableEditor <Control-t> {
- tkEntryTranspose %W
- }
- bind HiertableEditor <Meta-b> {
- %W text icursor [blt::Hiertable::PreviousWord %W insert]
- %W text selection clear
- }
- bind HiertableEditor <Meta-d> {
- %W delete insert [blt::Hiertable::NextWord %W insert]
- }
- bind HiertableEditor <Meta-f> {
- %W text icursor [blt::Hiertable::NextWord %W insert]
- %W text selection clear
- }
- bind HiertableEditor <Meta-BackSpace> {
- %W delete [blt::Hiertable::PreviousWord %W insert] insert
- }
- bind HiertableEditor <Meta-Delete> {
- %W delete [blt::Hiertable::PreviousWord %W insert] insert
- }
- # tkEntryNextWord -- Returns the index of the next word position
- # after a given position in the entry. The next word is platform
- # dependent and may be either the next end-of-word position or the
- # next start-of-word position after the next end-of-word position.
- #
- # Arguments:
- # w - The entry window in which the cursor is to move.
- # start - Position at which to start search.
-
- if {![string compare $tcl_platform(platform) "windows"]} {
- proc blt::Hiertable::NextWord {w start} {
- set pos [tcl_endOfWord [$w get] [$w index $start]]
- if {$pos >= 0} {
- set pos [tcl_startOfNextWord [$w get] $pos]
- }
- if {$pos < 0} {
- return end
- }
- return $pos
- }
- } else {
- proc blt::Hiertable::NextWord {w start} {
- set pos [tcl_endOfWord [$w get] [$w index $start]]
- if {$pos < 0} {
- return end
- }
- return $pos
- }
- }
-
- # blt::Hiertable::PreviousWord --
- #
- # Returns the index of the previous word position before a given
- # position in the entry.
- #
- # Arguments:
- # w - The entry window in which the cursor is to move.
- # start - Position at which to start search.
-
- proc blt::Hiertable::PreviousWord {w start} {
- set pos [tcl_startOfPreviousWord [$w get] [$w index $start]]
- if {$pos < 0} {
- return 0
- }
- return $pos
- }
-}
diff --git a/blt3.0.1/library/listview.tcl b/blt3.0.1/library/listview.tcl
deleted file mode 100644
index 9118218..0000000
--- a/blt3.0.1/library/listview.tcl
+++ /dev/null
@@ -1,926 +0,0 @@
-
-# ======================================================================
-#
-# listview.tcl
-#
-# ----------------------------------------------------------------------
-# Bindings for the BLT listview widget
-# ----------------------------------------------------------------------
-#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that the copyright notice and warranty disclaimer appear in
-# supporting documentation, and that the names of Lucent Technologies
-# any of their entities not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# Lucent Technologies disclaims all warranties with regard to this
-# software, including all implied warranties of merchantability and
-# fitness. In no event shall Lucent be liable for any special, indirect
-# or consequential damages or any damages whatsoever resulting from loss
-# of use, data or profits, whether in an action of contract, negligence
-# or other tortuous action, arising out of or in connection with the use
-# or performance of this software.
-#
-# ======================================================================
-
-namespace eval ::blt::ListView {
- variable _private
- array set _private {
- afterId -1
- scroll 0
- column ""
- space off
- x 0
- y 0
- }
-}
-
-image create picture ::blt::ListView::openIcon -data {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
- ZTKAsiCtWq0JADs=
-}
-image create picture ::blt::ListView::closeIcon -data {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM1WBrM+rAEMigJ8c3Kb3OSII6kGABhp1JnaK1VGwjwKwtvHqNzzd263M3H4n2OH1QBwGw6
- nQkAOw==
-}
-
-if { $tcl_platform(platform) == "windows" } {
- if { $tk_version >= 8.3 } {
- set cursor "@[file join $blt_library treeview.cur]"
- } else {
- set cursor "size_we"
- }
- option add *ListView.ResizeCursor [list $cursor]
-} else {
- option add *ListView.ResizeCursor \
- "@$blt_library/treeview.xbm $blt_library/treeview_m.xbm black white"
-}
-
-bind ListView <Motion> {
- %W activate @%x,%y
-}
-
-#
-# ButtonPress-1
-#
-# Performs the following operations:
-#
-# 1. Clears the previous selection.
-# 2. Selects the current item.
-# 3. Sets the focus to this item.
-# 4. Scrolls the item into view.
-# 5. Sets the selection anchor to this item, just in case
-# this is "multiple" mode.
-#
-
-bind ListView <ButtonPress-1> {
- blt::ListView::SetSelectionAnchor %W @%x,%y
- set blt::ListView::_private(scroll) 1
-}
-
-bind ListView <Double-ButtonPress-1> {
- if { [%W index @%x,@%y] >= 0 } {
- blt::ListView::EditItem %W %X %Y
- }
-}
-
-#
-# B1-Motion
-#
-# For "multiple" mode only. Saves the current location of the
-# pointer for auto-scrolling. Resets the selection mark.
-#
-bind ListView <B1-Motion> {
- set blt::ListView::_private(x) %x
- set blt::ListView::_private(y) %y
- if { [%W cget -selectmode] == "multiple" } {
- %W selection mark @%x,%y
- %W activate @%x,%y
- } else {
- blt::ListView::SetSelectionAnchor %W @%x,%y
- }
-}
-
-#
-# ButtonRelease-1
-#
-# For "multiple" mode only.
-#
-bind ListView <ButtonRelease-1> {
- if { [%W cget -selectmode] == "multiple" } {
- %W selection anchor @%x,%y
- }
- after cancel $blt::ListView::_private(afterId)
- set blt::ListView::_private(afterId) -1
- set blt::ListView::_private(scroll) 0
-}
-
-#
-# Shift-ButtonPress-1
-#
-# For "multiple" mode only.
-#
-
-bind ListView <Shift-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" && [%W selection present] } {
- if { [%W selection anchor] == -1 } {
- %W selection anchor @%x,%y
- }
- set index [%W selection anchor]
- if { $index >= 0 } {
- %W selection clearall
- %W selection set $index @%x,%y
- }
- } else {
- blt::ListView::SetSelectionAnchor %W @%x,%y
- }
-}
-
-bind ListView <Shift-Double-ButtonPress-1> {
- # do nothing
-}
-bind ListView <Shift-B1-Motion> {
- # do nothing
-}
-
-bind ListView <Shift-ButtonRelease-1> {
- after cancel $blt::ListView::_private(afterId)
- set blt::ListView::_private(afterId) -1
- set blt::ListView::_private(scroll) 0
-}
-
-#
-# Control-ButtonPress-1
-#
-# For "multiple" mode only.
-#
-bind ListView <Control-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" } {
- %W selection toggle @%x,%y
- %W selection anchor @%x,%y
- } else {
- blt::ListView::SetSelectionAnchor %W @%x,%y
- }
-}
-bind ListView <Control-Double-ButtonPress-1> {
- # do nothing
-}
-bind ListView <Control-B1-Motion> {
- # do nothing
-}
-bind ListView <Control-ButtonRelease-1> {
- after cancel $blt::ListView::_private(afterId)
- set blt::ListView::_private(afterId) -1
- set blt::ListView::_private(scroll) 0
-}
-
-bind ListView <Control-Shift-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" && [%W selection present] } {
- if { [%W index anchor] == -1 } {
- %W selection anchor @%x,%y
- }
- if { [%W selection includes anchor] } {
- %W selection set anchor @%x,%y
- } else {
- %W selection clear anchor @%x,%y
- %W selection set @%x,%y
- }
- } else {
- blt::ListView::SetSelectionAnchor %W @%x,%y
- }
-}
-bind ListView <Control-Shift-Double-ButtonPress-1> {
- # do nothing
-}
-bind ListView <Control-Shift-B1-Motion> {
- # do nothing
-}
-bind ListView <ButtonRelease-3> {
- blt::ListView::EditItem %W %X %Y
-}
-
-bind ListView <KeyPress> {
- if { [string compare %A {}] == 0 } {
- continue
- }
- set index [%W find "%A*" -from next -count 1 -wrap]
- if { $index >= 0 } {
- %W see $index
- %W focus $index
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# AutoScroll --
-#
-# Invoked when the user is selecting elements in a treeview
-# widget and drags the mouse pointer outside of the widget.
-# Scrolls the view in the direction of the pointer.
-#
-# ----------------------------------------------------------------------
-proc blt::ListView::AutoScroll { w } {
- variable _private
-
- if { ![winfo exists $w] } {
- return
- }
- set x $_private(x)
- set y $_private(y)
-
- if { [$w cget -layoutmode] == "column" } {
- set index [$w nearest $x $y]
- if { $x >= [winfo width $w] } {
- $w xview scroll 1 units
- set neighbor down
- } elseif { $x < 0 } {
- $w xview scroll -1 units
- set neighbor up
- } else {
- set neighbor $index
- }
- } else {
- # This covers both row and icons layouts.
- set index [$w nearest $x $y]
- if {$y >= [winfo height $w]} {
- $w yview scroll 1 units
- set neighbor down
- } elseif {$y < 0} {
- $w yview scroll -1 units
- set neighbor up
- } else {
- set neighbor $index
- }
- }
- puts stderr "layout mode= [$w cget -layoutmode]"
- if { [$w cget -selectmode] == "single" } {
- if { [$w exists $neighbor] } {
- SetSelectionAnchor $w $neighbor
- }
- } else {
- catch { $w selection mark $index }
- }
- set _private(afterId) [after 50 blt::ListView::AutoScroll $w]
-}
-
-proc blt::ListView::SetSelectionAnchor { w item } {
- $w selection clearall
- set index [$w index $item]
- if { $index >= 0 } {
- $w see $index
- $w focus $index
- $w selection set $index
- $w selection anchor $index
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# MoveFocus --
-#
-# Invoked by KeyPress bindings. Moves the active selection to
-# the item <where>, which is an index such as "up", "down",
-# "prevsibling", "nextsibling", etc.
-#
-# ----------------------------------------------------------------------
-proc blt::ListView::MoveFocus { w item } {
- catch {$w focus $item}
- if { [$w cget -selectmode] == "single" } {
- $w selection clearall
- $w selection set focus
- $w selection anchor focus
- }
- $w see focus
-}
-
-# ----------------------------------------------------------------------
-#
-# MovePage --
-#
-# Invoked by KeyPress bindings. Pages the current view up or
-# down. The <where> argument should be either "top" or
-# "bottom".
-#
-# ----------------------------------------------------------------------
-proc blt::ListView::MovePage { w where } {
-
- # If the focus is already at the top/bottom of the window, we want
- # to scroll a page. It's really one page minus an item because we
- # want to see the last item on the next/last page.
- if { [$w index focus] == [$w index view.$where] } {
- if {$where == "top"} {
- $w yview scroll -1 pages
- $w yview scroll 1 units
- } else {
- $w yview scroll 1 pages
- $w yview scroll -1 units
- }
- }
- update
-
- # Adjust the item focus and the view. Also activate the item.
- # just in case the mouse point is not in the widget.
- $w activate view.$where
- $w focus view.$where
- $w see view.$where
- if { [$w cget -selectmode] == "single" } {
- $w selection clearall
- $w selection set focus
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# NextMatch --
-#
-# Invoked by KeyPress bindings. Searches for an item that
-# starts with the letter <char> and makes that item active.
-#
-# ----------------------------------------------------------------------
-proc blt::ListView::NextMatch { w key } {
- if {[string match {[ -~]} $key]} {
- set last [$w index focus]
- if { $last == -1 } {
- return; # No focus.
- }
- set next [$w index next]
- if { $next == -1 } {
- set next $last
- }
- while { $next != $last } {
- set label [$w item cget $next -label]
- set label [string index $label 0]
- if { [string tolower $label] == [string tolower $key] } {
- break
- }
- set next [$w index -at $next next]
- }
- $w focus $next
- if {[$w cget -selectmode] == "single"} {
- $w selection clearall
- $w selection set focus
- }
- $w see focus
- }
-}
-
-#------------------------------------------------------------------------
-#
-# InsertText --
-#
-# Inserts a text string into an item at the insertion cursor.
-# If there is a selection in the item, and it covers the point
-# of the insertion cursor, then delete the selection before
-# inserting.
-#
-# Arguments:
-# w Widget where to insert the text.
-# text Text string to insert (usually just a single character)
-#
-#------------------------------------------------------------------------
-proc blt::ListView::InsertText { w text } {
- if { [string length $text] > 0 } {
- set index [$w index insert]
- if { ($index >= [$w index sel.first]) &&
- ($index <= [$w index sel.last]) } {
- $w delete sel.first sel.last
- }
- $w insert $index $text
- }
-}
-
-#------------------------------------------------------------------------
-#
-# Transpose -
-#
-# This procedure implements the "transpose" function for item
-# widgets. It tranposes the characters on either side of the
-# insertion cursor, unless the cursor is at the end of the line.
-# In this case it transposes the two characters to the left of
-# the cursor. In either case, the cursor ends up to the right
-# of the transposed characters.
-#
-# Arguments:
-# w The item window.
-#
-#------------------------------------------------------------------------
-proc blt::ListView::Transpose { w } {
- set i [$w index insert]
- if {$i < [$w index end]} {
- incr i
- }
- set first [expr {$i-2}]
- if {$first < 0} {
- return
- }
- set new [string index [$w get] [expr {$i-1}]][string index [$w get] $first]
- $w delete $first $i
- $w insert insert $new
-}
-
-#------------------------------------------------------------------------
-#
-# GetSelection --
-#
-# Returns the selected text of the item with respect to the
-# -show option.
-#
-# Arguments:
-# w Item window from which the text to get
-#
-#------------------------------------------------------------------------
-
-proc blt::ListView::GetSelection { w } {
- set text [string range [$w get] [$w index sel.first] \
- [expr [$w index sel.last] - 1]]
- if {[$w cget -show] != ""} {
- regsub -all . $text [string index [$w cget -show] 0] text
- }
- return $text
-}
-
-proc blt::ListView::EditItem { w x y } {
- $w see active
- if { [winfo exists $w.edit] } {
- destroy $w.edit
- return
- }
- if { ![$w edit -root -test $x $y] } {
- return
- }
- $w edit -root $x $y
- update
- if { [winfo exists $w.edit] } {
- focus $w.edit
- $w.edit selection range 0 end
- grab set $w.edit
- tkwait window $w.edit
- grab release $w.edit
- }
-}
-
-#
-# ButtonPress assignments
-#
-# B1-Enter start auto-scrolling
-# B1-Leave stop auto-scrolling
-# ButtonPress-2 start scan
-# B2-Motion adjust scan
-# ButtonRelease-2 stop scan
-#
-
-bind ListView <ButtonPress-2> {
- set blt::ListView::_private(cursor) [%W cget -cursor]
- %W configure -cursor hand1
- %W scan mark %x %y
-}
-
-bind ListView <B2-Motion> {
- %W scan dragto %x %y
-}
-
-bind ListView <ButtonRelease-2> {
- %W configure -cursor $blt::ListView::_private(cursor)
-}
-
-bind ListView <B1-Leave> {
- if { $blt::ListView::_private(scroll) } {
- blt::ListView::AutoScroll %W
- }
-}
-
-bind ListView <B1-Enter> {
- after cancel $blt::ListView::_private(afterId)
- set blt::ListView::_private(afterId) -1
-}
-
-#
-# KeyPress assignments
-#
-# Up
-# Down
-# Shift-Up
-# Shift-Down
-# Prior (PageUp)
-# Next (PageDn)
-# Left
-# Right
-# space Start selection toggle of item currently with focus.
-# Return Start selection toggle of item currently with focus.
-# Home
-# End
-# ASCII char Go to next open item starting with character.
-#
-# KeyRelease
-#
-# space Stop selection toggle of item currently with focus.
-# Return Stop selection toggle of item currently with focus.
-
-
-bind ListView <KeyPress-Up> {
- blt::ListView::MoveFocus %W previous
- if { $blt::ListView::_private(space) } {
- %W selection toggle focus
- }
-}
-
-bind ListView <KeyPress-Down> {
- blt::ListView::MoveFocus %W next
- if { $blt::ListView::_private(space) } {
- %W selection toggle focus
- }
-}
-
-bind ListView <KeyPress-Home> {
- blt::ListView::MoveFocus %W 0
-}
-
-bind ListView <KeyPress-End> {
- blt::ListView::MoveFocus %W end
-}
-
-bind ListView <KeyPress-space> {
- if { [%W cget -selectmode] == "single" } {
- if { [%W selection includes focus] } {
- %W selection clearall
- } else {
- %W selection clearall
- %W selection set focus
- }
- } else {
- %W selection toggle focus
- }
- set blt::ListView::_private(space) on
-}
-
-bind ListView <KeyRelease-space> {
- set blt::ListView::_private(space) off
-}
-
-bind ListView <KeyPress-Return> {
- blt::ListView::MoveFocus %W focus
- set blt::ListView::_private(space) on
-}
-
-bind ListView <KeyRelease-Return> {
- set blt::ListView::_private(space) off
-}
-
-if 0 {
-bind ListView <KeyPress> {
- blt::ListView::NextMatch %W %A
-}
-}
-
-if {[string equal "x11" [tk windowingsystem]]} {
- bind ListView <4> {
- %W yview scroll -5 units
- }
- bind ListView <5> {
- %W yview scroll 5 units
- }
-} else {
- bind ListView <MouseWheel> {
- %W yview scroll [expr {- (%D / 120) * 4}] units
- }
-}
-
-
-#
-# Differences between id "current" and operation nearest.
-#
-# set index [$w index current]
-# set index [$w nearest $x $y]
-#
-# o Nearest gives you the closest item.
-# o current is "" if
-# 1) the pointer isn't over an item.
-# 2) the pointer is over a open/close button.
-# 3)
-#
-
-#
-# Edit mode assignments
-#
-# ButtonPress-3 Enables/disables edit mode on item. Sets focus to
-# item.
-#
-# KeyPress
-#
-# Left Move insertion position to previous.
-# Right Move insertion position to next.
-# Up Move insertion position up one line.
-# Down Move insertion position down one line.
-# Prior Move insertion position up one line.
-# Next Move insertion position down one line.
-# Return End edit mode.
-# Shift-Return Line feed.
-# Home Move to first position.
-# End Move to last position.
-# ASCII char Insert character left of insertion point.
-# Del Delete character right of insertion point.
-# Delete Delete character left of insertion point.
-# Ctrl-X Cut
-# Ctrl-V Copy
-# Ctrl-P Paste
-#
-# KeyRelease
-#
-# ButtonPress-1 Start selection if in item, otherwise clear selection.
-# B1-Motion Extend/reduce selection.
-# ButtonRelease-1 End selection if in item, otherwise use last
-# selection.
-# B1-Enter Disabled.
-# B1-Leave Disabled.
-# ButtonPress-2 Same as above.
-# B2-Motion Same as above.
-# ButtonRelease-2 Same as above.
-#
-#
-
-
-# Standard Motif bindings:
-
-bind ListViewEditor <ButtonPress-1> {
- %W icursor @%x,%y
- %W selection clear
-}
-
-bind ListViewEditor <Left> {
- %W icursor last
- %W selection clear
-}
-
-bind ListViewEditor <Right> {
- %W icursor next
- %W selection clear
-}
-
-bind ListViewEditor <Shift-Left> {
- set new [expr {[%W index insert] - 1}]
- if {![%W selection present]} {
- %W selection from insert
- %W selection to $new
- } else {
- %W selection adjust $new
- }
- %W icursor $new
-}
-
-bind ListViewEditor <Shift-Right> {
- set new [expr {[%W index insert] + 1}]
- if {![%W selection present]} {
- %W selection from insert
- %W selection to $new
- } else {
- %W selection adjust $new
- }
- %W icursor $new
-}
-
-bind ListViewEditor <Home> {
- %W icursor 0
- %W selection clear
-}
-bind ListViewEditor <Shift-Home> {
- set new 0
- if {![%W selection present]} {
- %W selection from insert
- %W selection to $new
- } else {
- %W selection adjust $new
- }
- %W icursor $new
-}
-bind ListViewEditor <End> {
- %W icursor end
- %W selection clear
-}
-bind ListViewEditor <Shift-End> {
- set new end
- if {![%W selection present]} {
- %W selection from insert
- %W selection to $new
- } else {
- %W selection adjust $new
- }
- %W icursor $new
-}
-
-bind ListViewEditor <Delete> {
- if { [%W selection present]} {
- %W delete sel.first sel.last
- } else {
- %W delete insert
- }
-}
-
-bind ListViewEditor <BackSpace> {
- if { [%W selection present] } {
- %W delete sel.first sel.last
- } else {
- set index [expr [%W index insert] - 1]
- if { $index >= 0 } {
- %W delete $index $index
- }
- }
-}
-
-bind ListViewEditor <Control-space> {
- %W selection from insert
-}
-
-bind ListViewEditor <Select> {
- %W selection from insert
-}
-
-bind ListViewEditor <Control-Shift-space> {
- %W selection adjust insert
-}
-
-bind ListViewEditor <Shift-Select> {
- %W selection adjust insert
-}
-
-bind ListViewEditor <Control-slash> {
- %W selection range 0 end
-}
-
-bind ListViewEditor <Control-backslash> {
- %W selection clear
-}
-
-bind ListViewEditor <KeyPress> {
- blt::ListView::InsertText %W %A
-}
-
-# Ignore all Alt, Meta, and Control keypresses unless explicitly bound.
-# Otherwise, if a widget binding for one of these is defined, the
-# <KeyPress> class binding will also fire and insert the character,
-# which is wrong. Ditto for Escape, Return, and Tab.
-
-bind ListViewEditor <Alt-KeyPress> {
- # nothing
-}
-
-bind ListViewEditor <Meta-KeyPress> {
- # nothing
-}
-
-bind ListViewEditor <Control-KeyPress> {
- # nothing
-}
-
-bind ListViewEditor <Escape> {
- %W cancel
-}
-
-bind ListViewEditor <Return> {
- %W apply
-}
-
-bind ListViewEditor <Shift-Return> {
- blt::ListView::InsertText %W "\n"
-}
-
-bind ListViewEditor <KP_Enter> {
- # nothing
-}
-
-bind ListViewEditor <Tab> {
- # nothing
-}
-
-if {![string compare $tcl_platform(platform) "macintosh"]} {
- bind ListViewEditor <Command-KeyPress> {
- # nothing
- }
-}
-
-# On Windows, paste is done using Shift-Insert. Shift-Insert already
-# generates the <<Paste>> event, so we don't need to do anything here.
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
- bind ListViewEditor <Insert> {
- catch {blt::ListView::InsertText %W [selection get -displayof %W]}
- }
-}
-
-# Additional emacs-like bindings:
-bind ListViewEditor <ButtonRelease-3> {
- set parent [winfo parent %W]
- %W cancel
-}
-
-bind ListViewEditor <Control-a> {
- %W icursor 0
- %W selection clear
-}
-
-bind ListViewEditor <Control-b> {
- %W icursor [expr {[%W index insert] - 1}]
- %W selection clear
-}
-
-bind ListViewEditor <Control-d> {
- %W delete insert
-}
-
-bind ListViewEditor <Control-e> {
- %W icursor end
- %W selection clear
-}
-
-bind ListViewEditor <Control-f> {
- %W icursor [expr {[%W index insert] + 1}]
- %W selection clear
-}
-
-bind ListViewEditor <Control-h> {
- if {[%W selection present]} {
- %W delete sel.first sel.last
- } else {
- set index [expr [%W index insert] - 1]
- if { $index >= 0 } {
- %W delete $index $index
- }
- }
-}
-
-bind ListViewEditor <Control-k> {
- %W delete insert end
-}
-
-if 0 {
- bind ListViewEditor <Control-t> {
- blt::ListView::Transpose %W
- }
- bind ListViewEditor <Meta-b> {
- %W icursor [blt::ListView::PreviousWord %W insert]
- %W selection clear
- }
- bind ListViewEditor <Meta-d> {
- %W delete insert [blt::ListView::NextWord %W insert]
- }
- bind ListViewEditor <Meta-f> {
- %W icursor [blt::ListView::NextWord %W insert]
- %W selection clear
- }
- bind ListViewEditor <Meta-BackSpace> {
- %W delete [blt::ListView::PreviousWord %W insert] insert
- }
- bind ListViewEditor <Meta-Delete> {
- %W delete [blt::ListView::PreviousWord %W insert] insert
- }
- # tkEntryNextWord -- Returns the index of the next word position
- # after a given position in the entry. The next word is platform
- # dependent and may be either the next end-of-word position or the
- # next start-of-word position after the next end-of-word position.
- #
- # Arguments:
- # w - The item window in which the cursor is to move.
- # start - Position at which to start search.
-
- if {![string compare $tcl_platform(platform) "windows"]} {
- proc blt::ListView::NextWord {w start} {
- set pos [tcl_endOfWord [$w get] [$w index $start]]
- if {$pos >= 0} {
- set pos [tcl_startOfNextWord [$w get] $pos]
- }
- if {$pos < 0} {
- return end
- }
- return $pos
- }
- } else {
- proc blt::ListView::NextWord {w start} {
- set pos [tcl_endOfWord [$w get] [$w index $start]]
- if {$pos < 0} {
- return end
- }
- return $pos
- }
- }
-
- # PreviousWord --
- #
- # Returns the index of the previous word position before a given
- # position in the item.
- #
- # Arguments:
- # w - The item window in which the cursor is to move.
- # start - Position at which to start search.
-
- proc blt::ListView::PreviousWord {w start} {
- set pos [tcl_startOfPreviousWord [$w get] [$w index $start]]
- if {$pos < 0} {
- return 0
- }
- return $pos
- }
-}
-
diff --git a/blt3.0.1/library/macButton.tcl b/blt3.0.1/library/macButton.tcl
deleted file mode 100644
index 60d8a5d..0000000
--- a/blt3.0.1/library/macButton.tcl
+++ /dev/null
@@ -1,158 +0,0 @@
-
-####################
-# Mac implementation
-####################
-
-bind TkRadiobutton <Enter> {
- blt::Button::Enter %W
-}
-bind TkRadiobutton <1> {
- blt::Button::Down %W
-}
-bind TkRadiobutton <ButtonRelease-1> {
- blt::Button::Up %W
-}
-bind TkCheckbutton <Enter> {
- blt::Button::Enter %W
-}
-bind TkCheckbutton <1> {
- blt::Button::Down %W
-}
-bind TkCheckbutton <ButtonRelease-1> {
- blt::Button::Up %W
-}
-bind TkPushbutton <Enter> {
- blt::Button::Enter %W
-}
-bind TkPushbutton <1> {
- blt::Button::Down %W
-}
-bind TkPushbutton <ButtonRelease-1> {
- blt::Button::Up %W
-}
-
-#
-# Enter --
-#
-# The procedure below is invoked when the mouse pointer enters a
-# button widget. It records the button we're in and changes the
-# state of the button to active unless the button is disabled.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Enter {w} {
- variable _private
- if {[$w cget -state] != "disabled"} {
-
- # If there's an -overrelief value, set the relief to that.
-
- if {$_private(buttonWindow) eq $w} {
- $w configure -state active
- } elseif {[set over [$w cget -overrelief]] ne ""} {
- set _private($w,relief) [$w cget -relief]
- set _private($w,prelief) $over
- $w configure -relief $over
- }
- }
- set _private(window) $w
-}
-
-# Leave --
-#
-# The procedure below is invoked when the mouse pointer leaves a
-# button widget. It changes the state of the button back to
-# inactive. If we're leaving the button window with a mouse button
-# pressed (_private(buttonWindow) == $w), restore the relief of the
-# button too.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Leave w {
- variable _private
- if {$w eq $_private(buttonWindow)} {
- $w configure -state normal
- }
-
- # Restore the original button relief if it was changed by Tk.
- # That is signaled by the existence of _private($w,prelief).
-
- if {[info exists _private($w,relief)]} {
- if {[info exists _private($w,prelief)] && \
- $_private($w,prelief) eq [$w cget -relief]} {
- $w configure -relief $_private($w,relief)
- }
- unset -nocomplain _private($w,relief) _private($w,prelief)
- }
-
- set _private(window) ""
-}
-
-# Down --
-#
-# The procedure below is invoked when the mouse button is pressed in
-# a button widget. It records the fact that the mouse is in the button,
-# saves the button's relief so it can be restored later, and changes
-# the relief to sunken.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Down w {
- variable _private
-
- if {[$w cget -state] != "disabled"} {
- set _private(buttonWindow) $w
- $w configure -state active
-
- # If this button has a repeatdelay set up, get it going with an after
- after cancel $_private(afterId)
- set _private(repeated) 0
- if { ![catch {$w cget -repeatdelay} delay] } {
- if {$delay > 0} {
- set _private(afterId) [after $delay [list blt::Button::AutoInvoke $w]]
- }
- }
- }
-}
-
-# Up --
-#
-# The procedure below is invoked when the mouse button is released
-# in a button widget. It restores the button's relief and invokes
-# the command as long as the mouse hasn't left the button.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Up w {
- variable _private
- if {$_private(buttonWindow) eq $w} {
- set _private(buttonWindow) ""
- $w configure -state normal
-
- # Restore the button's relief if it was cached.
-
- if {[info exists _private($w,relief)]} {
- if {[info exists _private($w,prelief)] && \
- $_private($w,prelief) eq [$w cget -relief]} {
- $w configure -relief $_private($w,relief)
- }
- unset -nocomplain _private($w,relief) _private($w,prelief)
- }
-
- # Clean up the after event from the auto-repeater
- after cancel $_private(afterId)
-
- if {$_private(window) eq $w && [$w cget -state] != "disabled"} {
- # Only invoke the command if it wasn't already invoked by the
- # auto-repeater functionality
- if { $_private(repeated) == 0 } {
- uplevel #0 [list $w invoke]
- }
- }
- }
-}
-
-}
diff --git a/blt3.0.1/library/panes.tcl b/blt3.0.1/library/panes.tcl
deleted file mode 100644
index 6058b26..0000000
--- a/blt3.0.1/library/panes.tcl
+++ /dev/null
@@ -1,213 +0,0 @@
-
-# panes.tcl --
-#
-# This file defines the default bindings for Tk panedwindow widgets and
-# provides procedures that help in implementing those bindings.
-#
-# RCS: @(#) $Id: panes.tcl,v 1.1.1.1 2010/10/27 21:57:06 joye Exp $
-#
-
-bind Panes <Button-1> { ::blt::panes::MarkSash %W %x %y 1 }
-bind Panes <Button-2> { ::blt::panes::MarkSash %W %x %y 0 }
-
-bind Panes <B1-Motion> { ::blt::panes::DragSash %W %x %y 1 }
-bind Panes <B2-Motion> { ::blt::panes::DragSash %W %x %y 0 }
-
-bind Panes <ButtonRelease-1> {::blt::panes::ReleaseSash %W 1}
-bind Panes <ButtonRelease-2> {::blt::panes::ReleaseSash %W 0}
-
-bind Panes <Motion> {
- %W sash activate %x %y
-}
-
-bind Panes <ButtonPress-1> {
- if { [%W sash activate] } {
- %W sash anchor %x %y
- }
-}
-bind Panes <B1-Motion> {
- %W sash mark %x %y
-}
-bind Panes <ButtonRelease-1> {
- %W sash set %x %y
- %W sash activate %x %y
-}
-bind Panes <Leave> {
- %W sash activate -1
-}
-bind Panes <B1-Leave> {
- # do nothing
-}
-bind Panes <Enter> {
- %W sash activate %x %y
-}
-
-bind Panes <Button-2> { ::blt::panes::MarkSash %W %x %y 0 }
-
-# Initialize namespace
-namespace eval ::blt::panes {}
-
-# ::blt::panes::MarkSash --
-#
-# Handle marking the correct sash for possible dragging
-#
-# Arguments:
-# w the widget
-# x widget local x coord
-# y widget local y coord
-# proxy whether this should be a proxy sash
-# Results:
-# None
-#
-proc ::tk::panedwindow::MarkSash {w x y proxy} {
- if {[$w cget -opaqueresize]} { set proxy 0 }
- set what [$w identify $x $y]
- if { [llength $what] == 2 } {
- foreach {index which} $what break
- if { !$::tk_strictMotif || $which eq "handle" } {
- if {!$proxy} { $w sash mark $index $x $y }
- set ::tk::Priv(sash) $index
- foreach {sx sy} [$w sash coord $index] break
- set ::tk::Priv(dx) [expr {$sx-$x}]
- set ::tk::Priv(dy) [expr {$sy-$y}]
- # Do this to init the proxy location
- DragSash $w $x $y $proxy
- }
- }
-}
-
-# ::blt::panes::DragSash --
-#
-# Handle dragging of the correct sash
-#
-# Arguments:
-# w the widget
-# x widget local x coord
-# y widget local y coord
-# proxy whether this should be a proxy sash
-# Results:
-# Moves sash
-#
-proc ::blt::panes::DragSash {w x y proxy} {
- if {[$w cget -opaqueresize]} { set proxy 0 }
- if { [info exists ::tk::Priv(sash)] } {
- if {$proxy} {
- $w proxy place \
- [expr {$x+$::tk::Priv(dx)}] [expr {$y+$::tk::Priv(dy)}]
- } else {
- $w sash place $::tk::Priv(sash) \
- [expr {$x+$::tk::Priv(dx)}] [expr {$y+$::tk::Priv(dy)}]
- }
- }
-}
-
-# ::blt::panes::ReleaseSash --
-#
-# Handle releasing of the sash
-#
-# Arguments:
-# w the widget
-# proxy whether this should be a proxy sash
-# Results:
-# Returns ...
-#
-proc ::blt::panes::ReleaseSash {w proxy} {
- if {[$w cget -opaqueresize]} { set proxy 0 }
- if { [info exists ::tk::Priv(sash)] } {
- if {$proxy} {
- foreach {x y} [$w proxy coord] break
- $w sash place $::tk::Priv(sash) $x $y
- $w proxy forget
- }
- unset ::tk::Priv(sash) ::tk::Priv(dx) ::tk::Priv(dy)
- }
-}
-
-# ::blt::panes::Motion --
-#
-# Handle motion on the widget. This is used to change the cursor
-# when the user moves over the sash area.
-#
-# Arguments:
-# w the widget
-# x widget local x coord
-# y widget local y coord
-# Results:
-# May change the cursor. Sets up a timer to verify that we are still
-# over the widget.
-#
-proc ::blt::panes::Motion {w x y} {
- variable ::tk::Priv
- set id [$w identify $x $y]
- if {([llength $id] == 2) && \
- (!$::tk_strictMotif || [lindex $id 1] eq "handle")} {
- if { ![info exists Priv($w,panecursor)] } {
- set Priv($w,panecursor) [$w cget -cursor]
- if { [$w cget -sashcursor] eq "" } {
- if { [$w cget -orient] eq "horizontal" } {
- $w configure -cursor sb_h_double_arrow
- } else {
- $w configure -cursor sb_v_double_arrow
- }
- } else {
- $w configure -cursor [$w cget -sashcursor]
- }
- if {[info exists Priv($w,pwAfterId)]} {
- after cancel $Priv($w,pwAfterId)
- }
- set Priv($w,pwAfterId) [after 150 \
- [list ::tk::panedwindow::Cursor $w]]
- }
- return
- }
- if { [info exists Priv($w,panecursor)] } {
- $w configure -cursor $Priv($w,panecursor)
- unset Priv($w,panecursor)
- }
-}
-
-# ::blt::panes::Cursor --
-#
-# Handles returning the normal cursor when we are no longer over the
-# sash area. This needs to be done this way, because the panedwindow
-# won't see Leave events when the mouse moves from the sash to a
-# paned child, although the child does receive an Enter event.
-#
-# Arguments:
-# w the widget
-# Results:
-# May restore the default cursor, or schedule a timer to do it.
-#
-proc ::blt::panes::Cursor {w} {
- variable ::tk::Priv
- # Make sure to check window existence in case it is destroyed.
- if {[info exists Priv($w,panecursor)] && [winfo exists $w]} {
- if {[winfo containing [winfo pointerx $w] [winfo pointery $w]] eq $w} {
- set Priv($w,pwAfterId) [after 150 \
- [list ::tk::panedwindow::Cursor $w]]
- } else {
- $w configure -cursor $Priv($w,panecursor)
- unset Priv($w,panecursor)
- if {[info exists Priv($w,pwAfterId)]} {
- after cancel $Priv($w,pwAfterId)
- unset Priv($w,pwAfterId)
- }
- }
- }
-}
-
-# ::blt::panes::Leave --
-#
-# Return to default cursor when leaving the pw widget.
-#
-# Arguments:
-# w the widget
-# Results:
-# Restores the default cursor
-#
-proc ::tk::panedwindow::Leave {w} {
- if {[info exists ::tk::Priv($w,panecursor)]} {
- $w configure -cursor $::tk::Priv($w,panecursor)
- unset ::tk::Priv($w,panecursor)
- }
-}
diff --git a/blt3.0.1/library/paneset.tcl b/blt3.0.1/library/paneset.tcl
deleted file mode 100644
index 0914838..0000000
--- a/blt3.0.1/library/paneset.tcl
+++ /dev/null
@@ -1,39 +0,0 @@
-namespace eval blt::Paneset {
- set buttonPressed 0
- proc Initialize {} {
- }
-}
-
-bind PanesetSash <Enter> {
- if { !$blt::Paneset::buttonPressed } {
- %W activate
- }
-}
-bind PanesetSash <Leave> {
- if { !$blt::Paneset::buttonPressed } {
- %W deactivate
- }
-}
-bind PanesetSash <KeyPress-Left> {
- %W move -10 0
-}
-bind PanesetSash <KeyPress-Right> {
- %W move 10 0
-}
-bind PanesetSash <KeyPress-Up> {
- %W move 0 -10
-}
-bind PanesetSash <KeyPress-Down> {
- %W move 0 10
-}
-bind PanesetSash <ButtonPress-1> {
- set blt::Paneset::buttonPressed 1
- %W anchor %X %Y
-}
-bind PanesetSash <B1-Motion> {
- %W mark %X %Y
-}
-bind PanesetSash <ButtonRelease-1> {
- set blt::Paneset::buttonPressed 0
- %W set %X %Y
-}
diff --git a/blt3.0.1/library/pkgIndex.tcl.in b/blt3.0.1/library/pkgIndex.tcl.in
deleted file mode 100644
index 6932fd5..0000000
--- a/blt3.0.1/library/pkgIndex.tcl.in
+++ /dev/null
@@ -1,112 +0,0 @@
-# Tcl package index file, version 1.0
-
-set version "%VERSION%"
-
-namespace eval blt${version} {}
-
-proc blt${version}::load_library { name version dir package } {
-
- set prefix "%SO_PREFIX%"
- set suffix "%LIB_SUFFIX%"
- set so [info sharedlibextension]
- regsub {\.} $version {} version_no_dots
-
- set fullname ${prefix}${name}${version_no_dots}${suffix}${so}
-
- global tcl_platform
- if { $tcl_platform(platform) == "unix" } {
- set library [file join $dir $fullname]
- if { ![file exists $library] } {
- # Try the parent directory.
- set library [file join [file dirname $dir] $fullname]
- }
- if { ![file exists $library] } {
- # Default to the path generated at compilation.
- set library [file join "%LIB_DIR%" $fullname]
- }
- } else {
- set library $fullname
- }
- load $library $package
-}
-
-package ifneeded BLT $version [subst -nocommands {
- package require blt_core $version
- if { [info commands tk] == "tk" } {
- package require blt_extra $version
- }
- package provide BLT $version
-}]
-
-# Core (tcl-only) and extra (Tk) packages
-
-package ifneeded blt_core $version \
- [list blt${version}::load_library "BLTCore" $version $dir "blt_core"]
-
-package ifneeded blt_extra $version [subst {
- package require blt_core
- blt${version}::load_library "BLTX" $version $dir "blt_x"
-}]
-
-# Data table data format packages
-
-package ifneeded blt_datatable_xml $version [subst {
- package require blt_core
- blt::datatable load xml $dir
-}]
-
-package ifneeded blt_datatable_mysql $version \
- [list blt::datatable load mysql $dir]
-
-package ifneeded blt_datatable_tree $version \
- [list blt::datatable load tree $dir]
-
-package ifneeded blt_datatable_vector $version \
- [list blt::datatable load vector $dir]
-
-package ifneeded blt_datatable_csv $version \
- [list blt::datatable load csv $dir]
-
-# Picture image format packages
-
-package ifneeded blt_picture_bmp $version [subst {
- package require BLT
- blt::picture load bmp $dir
-}]
-
-package ifneeded blt_picture_gif $version \
- [list blt::picture load gif $dir]
-
-package ifneeded blt_picture_jpg $version \
- [list blt::picture load jpg $dir]
-
-package ifneeded blt_picture_pbm $version \
- [list blt::picture load pbm $dir]
-
-package ifneeded blt_picture_pdf $version \
- [list blt::picture load pdf $dir]
-
-package ifneeded blt_picture_png $version \
- [list blt::picture load png $dir]
-
-package ifneeded blt_picture_ps $version \
- [list blt::picture load ps $dir]
-
-package ifneeded blt_picture_tif $version \
- [list blt::picture load tif $dir]
-
-package ifneeded blt_picture_xbm $version \
- [list blt::picture load xbm $dir]
-
-package ifneeded blt_picture_xpm $version \
- [list blt::picture load xpm $dir]
-
-package ifneeded blt_picture_photo $version \
- [list blt::picture load photo $dir]
-
-# Tree data format packages
-
-package ifneeded blt_tree_xml $version \
- [list blt::tree load xml $dir]
-
-# End of package index file
diff --git a/blt3.0.1/library/pushbutton.tcl b/blt3.0.1/library/pushbutton.tcl
deleted file mode 100644
index dc5d88f..0000000
--- a/blt3.0.1/library/pushbutton.tcl
+++ /dev/null
@@ -1,166 +0,0 @@
-
-# button.tcl --
-#
-# This file defines the default bindings for Tk label, button,
-# checkbutton, and radiobutton widgets and provides procedures
-# that help in implementing those bindings.
-#
-# RCS: @(#) $Id: pushbutton.tcl,v 1.1.1.1 2010/10/27 21:57:06 joye Exp $
-#
-# Copyright (c) 1992-1994 The Regents of the University of California.
-# Copyright (c) 1994-1996 Sun Microsystems, Inc.
-# Copyright (c) 2002 ActiveState Corporation.
-#
-# See the file "license.terms" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-
-namespace eval blt::Button {
- array set _private {
- afterId -1
- repeated ""
- window ""
- trace 0
- buttonWindow ""
- }
- proc trace { mesg } {
- variable _private
- if { $_private(trace) } {
- puts stderr $mesg
- }
- }
-}
-
-#-------------------------------------------------------------------------
-# The code below creates the default class bindings for buttons.
-#-------------------------------------------------------------------------
-
-switch -glob -- [tk windowingsystem] {
- "classic" - "aqua" {
- source [file join $blt_library macButton.tcl]
- }
- "x11" {
- source [file join $blt_library unixButton.tcl]
- }
- "win*" {
- source [file join $blt_library winButton.tcl]
- }
-}
-
-##################
-# Shared routines
-##################
-
-# Invoke --
-#
-# The procedure below is called when a button is invoked through
-# the keyboard. It simulates a press of the button via the mouse.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Invoke w {
- if {[$w cget -state] != "disabled"} {
- set oldRelief [$w cget -relief]
- set oldState [$w cget -state]
- $w configure -state active -relief sunken
- update idletasks
- after 100
- $w configure -state $oldState -relief $oldRelief
- uplevel #0 [list $w invoke]
- }
-}
-
-# ::blt::Button::AutoInvoke --
-#
-# Invoke an auto-repeating button, and set it up to continue to repeat.
-#
-# Arguments:
-# w button to invoke.
-#
-# Results:
-# None.
-#
-# Side effects:
-# May create an after event to call ::blt::Button::AutoInvoke.
-
-proc ::blt::Button::AutoInvoke {w} {
- variable _private
- after cancel $_private(afterId)
- set delay [$w cget -repeatinterval]
- if {$_private(window) eq $w} {
- incr _private(repeated)
- uplevel #0 [list $w invoke]
- }
- if {$delay > 0} {
- set _private(afterId) [after $delay [list blt::Button::AutoInvoke $w]]
- }
-}
-
-# ::blt::Button::CheckRadioInvoke --
-# The procedure below is invoked when the mouse button is pressed in
-# a checkbutton or radiobutton widget, or when the widget is invoked
-# through the keyboard. It invokes the widget if it
-# isn't disabled.
-#
-# Arguments:
-# w - The name of the widget.
-# cmd - The subcommand to invoke (one of invoke, select, or deselect).
-
-proc ::blt::Button::CheckRadioInvoke {w {cmd invoke}} {
- if {[$w cget -state] != "disabled"} {
- uplevel #0 [list $w $cmd]
- }
-}
-
-bind TkButton <space> {
- blt::Button::Invoke %W
-}
-
-bind TkCheckbutton <space> {
- blt::Button::CheckRadioInvoke %W
-}
-
-bind TkRadiobutton <space> {
- blt::Button::CheckRadioInvoke %W
-}
-
-bind TkPushbutton <space> {
- blt::Button::CheckRadioInvoke %W
-}
-
-bind TkButton <FocusIn> {
-}
-
-bind TkButton <Enter> {
- blt::Button::Enter %W
-}
-bind TkButton <Leave> {
- blt::Button::Leave %W
-}
-bind TkButton <1> {
- blt::Button::Down %W
-}
-bind TkButton <ButtonRelease-1> {
- blt::Button::Up %W
-}
-
-bind TkCheckbutton <FocusIn> {
-}
-
-bind TkCheckbutton <Leave> {
- blt::Button::Leave %W
-}
-
-bind TkRadiobutton <FocusIn> {}
-
-bind TkRadiobutton <Leave> {
- blt::Button::Leave %W
-}
-
-bind TkPushbutton <FocusIn> {}
-
-bind TkPushbutton <Leave> {
- blt::Button::Leave %W
-}
-
diff --git a/blt3.0.1/library/scrollbar.tcl b/blt3.0.1/library/scrollbar.tcl
deleted file mode 100644
index 10f985a..0000000
--- a/blt3.0.1/library/scrollbar.tcl
+++ /dev/null
@@ -1,461 +0,0 @@
-
-# scrollbar.tcl --
-#
-# This file defines the default bindings for Tk scrollbar widgets.
-# It also provides procedures that help in implementing the bindings.
-#
-# RCS: @(#) $Id: scrollbar.tcl,v 1.1.1.1 2010/10/27 21:57:06 joye Exp $
-#
-# Copyright (c) 1994 The Regents of the University of California.
-# Copyright (c) 1994-1996 Sun Microsystems, Inc.
-#
-# See the file "license.terms" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-
-#-------------------------------------------------------------------------
-# The code below creates the default class bindings for scrollbars.
-#-------------------------------------------------------------------------
-
-# Standard Motif bindings:
-
-namespace eval ::blt::TkScrollbar {
- variable _private
-
- array set _private {
- activeBg ""
- afterId -1
- border 1
- initPos 0
- initValues ""
- x 0
- y 0
- relief flat
- }
-}
-
-bind TkScrollbar <Enter> {
- if {$tk_strictMotif} {
- set blt::TkScrollbar::_private(activeBg) [%W cget -activebackground]
- %W configure -activebackground [%W cget -background]
- }
- %W activate [%W identify %x %y]
-}
-bind TkScrollbar <Motion> {
- %W activate [%W identify %x %y]
-}
-
-# The "info exists" command in the following binding handles the
-# situation where a Leave event occurs for a scrollbar without the Enter
-# event. This seems to happen on some systems (such as Solaris 2.4) for
-# unknown reasons.
-
-bind TkScrollbar <Leave> {
- if {$tk_strictMotif && [info exists blt::TkScrollbar::_private(activeBg)]} {
- %W configure -activebackground $blt::TkScrollbar::_private(activeBg)
- }
- %W activate {}
-}
-bind TkScrollbar <1> {
- blt::TkScrollbar::ScrollButtonDown %W %x %y
-}
-bind TkScrollbar <B1-Motion> {
- blt::TkScrollbar::ScrollDrag %W %x %y
-}
-bind TkScrollbar <B1-B2-Motion> {
- blt::TkScrollbar::ScrollDrag %W %x %y
-}
-bind TkScrollbar <ButtonRelease-1> {
- blt::TkScrollbar::ScrollButtonUp %W %x %y
-}
-bind TkScrollbar <B1-Leave> {
- # Prevents <Leave> binding from being invoked.
-}
-bind TkScrollbar <B1-Enter> {
- # Prevents <Enter> binding from being invoked.
-}
-bind TkScrollbar <2> {
- blt::TkScrollbar::ScrollButton2Down %W %x %y
-}
-bind TkScrollbar <B1-2> {
- # Do nothing, since button 1 is already down.
-}
-bind TkScrollbar <B2-1> {
- # Do nothing, since button 2 is already down.
-}
-bind TkScrollbar <B2-Motion> {
- blt::TkScrollbar::ScrollDrag %W %x %y
-}
-bind TkScrollbar <ButtonRelease-2> {
- blt::TkScrollbar::ScrollButtonUp %W %x %y
-}
-bind TkScrollbar <B1-ButtonRelease-2> {
- # Do nothing: B1 release will handle it.
-}
-bind TkScrollbar <B2-ButtonRelease-1> {
- # Do nothing: B2 release will handle it.
-}
-bind TkScrollbar <B2-Leave> {
- # Prevents <Leave> binding from being invoked.
-}
-bind TkScrollbar <B2-Enter> {
- # Prevents <Enter> binding from being invoked.
-}
-bind TkScrollbar <Control-1> {
- blt::TkScrollbar::ScrollTopBottom %W %x %y
-}
-bind TkScrollbar <Control-2> {
- blt::TkScrollbar::ScrollTopBottom %W %x %y
-}
-
-bind TkScrollbar <Up> {
- blt::TkScrollbar::ScrollByUnits %W v -1
-}
-bind TkScrollbar <Down> {
- blt::TkScrollbar::ScrollByUnits %W v 1
-}
-bind TkScrollbar <Control-Up> {
- blt::TkScrollbar::ScrollByPages %W v -1
-}
-bind TkScrollbar <Control-Down> {
- blt::TkScrollbar::ScrollByPages %W v 1
-}
-bind TkScrollbar <Left> {
- blt::TkScrollbar::ScrollByUnits %W h -1
-}
-bind TkScrollbar <Right> {
- blt::TkScrollbar::ScrollByUnits %W h 1
-}
-bind TkScrollbar <Control-Left> {
- blt::TkScrollbar::ScrollByPages %W h -1
-}
-bind TkScrollbar <Control-Right> {
- blt::TkScrollbar::ScrollByPages %W h 1
-}
-bind TkScrollbar <Prior> {
- blt::TkScrollbar::ScrollByPages %W hv -1
-}
-bind TkScrollbar <Next> {
- blt::TkScrollbar::ScrollByPages %W hv 1
-}
-bind TkScrollbar <Home> {
- blt::TkScrollbar::ScrollToPos %W 0
-}
-bind TkScrollbar <End> {
- blt::TkScrollbar::ScrollToPos %W 1
-}
-
-
-if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
- bind TkScrollbar <MouseWheel> {
- blt::TkScrollbar::ScrollByUnits %W v [expr {- (%D)}]
- }
- bind TkScrollbar <Option-MouseWheel> {
- blt::TkScrollbar::ScrollByUnits %W v [expr {-10 * (%D)}]
- }
- bind TkScrollbar <Shift-MouseWheel> {
- blt::TkScrollbar::ScrollByUnits %W h [expr {- (%D)}]
- }
- bind TkScrollbar <Shift-Option-MouseWheel> {
- blt::TkScrollbar::ScrollByUnits %W h [expr {-10 * (%D)}]
- }
-}
-# blt::TkScrollbar::ScrollButtonDown --
-# This procedure is invoked when a button is pressed in a scrollbar.
-# It changes the way the scrollbar is displayed and takes actions
-# depending on where the mouse is.
-#
-# Arguments:
-# w - The scrollbar widget.
-# x, y - Mouse coordinates.
-
-proc blt::TkScrollbar::ScrollButtonDown {w x y} {
- variable _private
-
- set _private(relief) [$w cget -activerelief]
- set _private(border) [$w cget -activebackground]
- $w configure -activerelief sunken
- set element [$w identify $x $y]
- $w select $element
- if {$element eq "slider"} {
- ScrollStartDrag $w $x $y
- } else {
- ScrollSelect $w $element initial
- }
-}
-
-# ScrollButtonUp --
-# This procedure is invoked when a button is released in a scrollbar.
-# It cancels scans and auto-repeats that were in progress, and restores
-# the way the active element is displayed.
-#
-# Arguments:
-# w - The scrollbar widget.
-# x, y - Mouse coordinates.
-
-proc ::blt::TkScrollbar::ScrollButtonUp {w x y} {
- variable _private
-
- CancelRepeat
- if {[info exists _private(relief)]} {
- # Avoid error due to spurious release events
- $w configure -activerelief $_private(relief)
- ScrollEndDrag $w $x $y
- set element [$w identify $x $y]
- $w activate [$w identify $x $y]
- $w select {}
- }
-}
-
-# ScrollSelect --
-# This procedure is invoked when a button is pressed over the scrollbar.
-# It invokes one of several scrolling actions depending on where in
-# the scrollbar the button was pressed.
-#
-# Arguments:
-# w - The scrollbar widget.
-# element - The element of the scrollbar that was selected, such
-# as "arrow1" or "trough2". Shouldn't be "slider".
-# repeat - Whether and how to auto-repeat the action: "noRepeat"
-# means don't auto-repeat, "initial" means this is the
-# first action in an auto-repeat sequence, and "again"
-# means this is the second repetition or later.
-
-proc ::blt::TkScrollbar::ScrollSelect {w element repeat} {
- variable _private
-
- if {![winfo exists $w]} {
- return
- }
- switch -- $element {
- "arrow1" {ScrollByUnits $w hv -1}
- "trough1" {ScrollByPages $w hv -1}
- "trough2" {ScrollByPages $w hv 1}
- "arrow2" {ScrollByUnits $w hv 1}
- default {return}
- }
- set cmd [list blt::TkScrollbar::ScrollSelect $w $element again]
- if {$repeat eq "again"} {
- set _private(afterId) [after [$w cget -repeatinterval] $cmd]
- } elseif {$repeat eq "initial"} {
- set delay [$w cget -repeatdelay]
- if {$delay > 0} {
- set _private(afterId) [after $delay $cmd]
- }
- }
-}
-
-# ScrollStartDrag --
-# This procedure is called to initiate a drag of the slider. It just
-# remembers the starting position of the mouse and slider.
-#
-# Arguments:
-# w - The scrollbar widget.
-# x, y - The mouse position at the start of the drag operation.
-
-proc ::blt::TkScrollbar::ScrollStartDrag {w x y} {
- variable _private
-
- if {[$w cget -command] eq ""} {
- return
- }
- set _private(x) $x
- set _private(y) $y
- set _private(initValues) [$w get]
- set iv0 [lindex $_private(initValues) 0]
- if {[llength $_private(initValues)] == 2} {
- set _private(initPos) $iv0
- } elseif {$iv0 == 0} {
- set _private(initPos) 0.0
- } else {
- set _private(initPos) [expr {(double([lindex $_private(initValues) 2])) \
- / [lindex $_private(initValues) 0]}]
- }
-}
-
-# ScrollDrag --
-# This procedure is called for each mouse motion even when the slider
-# is being dragged. It notifies the associated widget if we're not
-# jump scrolling, and it just updates the scrollbar if we are jump
-# scrolling.
-#
-# Arguments:
-# w - The scrollbar widget.
-# x, y - The current mouse position.
-
-proc ::blt::TkScrollbar::ScrollDrag {w x y} {
- variable _private
-
- if {$_private(initPos) eq ""} {
- return
- }
- set delta \
- [$w delta [expr {$x - $_private(x)}] [expr {$y - $_private(y)}]]
- if {[$w cget -jump]} {
- if {[llength $_private(initValues)] == 2} {
- $w set [expr {[lindex $_private(initValues) 0] + $delta}] \
- [expr {[lindex $_private(initValues) 1] + $delta}]
- } else {
- set delta [expr {round($delta * [lindex $_private(initValues) 0])}]
- eval [list $w] set [lreplace $_private(initValues) 2 3 \
- [expr {[lindex $_private(initValues) 2] + $delta}] \
- [expr {[lindex $_private(initValues) 3] + $delta}]]
- }
- } else {
- ScrollToPos $w [expr {$_private(initPos) + $delta}]
- }
-}
-
-# ScrollEndDrag --
-# This procedure is called to end an interactive drag of the slider.
-# It scrolls the window if we're in jump mode, otherwise it does nothing.
-#
-# Arguments:
-# w - The scrollbar widget.
-# x, y - The mouse position at the end of the drag operation.
-
-proc ::blt::TkScrollbar::ScrollEndDrag {w x y} {
- variable _private
-
- if {$_private(initPos) eq ""} {
- return
- }
- if {[$w cget -jump]} {
- set delta [$w delta [expr {$x-$_private(x)}] [expr {$y-$_private(y)}]]
- ScrollToPos $w [expr {$_private(initPos) + $delta}]
- }
- set _private(initPos) ""
-}
-
-# ScrollByUnits --
-# This procedure tells the scrollbar's associated widget to scroll up
-# or down by a given number of units. It notifies the associated widget
-# in different ways for old and new command syntaxes.
-#
-# Arguments:
-# w - The scrollbar widget.
-# orient - Which kinds of scrollbars this applies to: "h" for
-# horizontal, "v" for vertical, "hv" for both.
-# amount - How many units to scroll: typically 1 or -1.
-
-proc ::blt::TkScrollbar::ScrollByUnits {w orient amount} {
- set cmd [$w cget -command]
- if {$cmd eq "" || ([string first [string index [$w cget -orient] 0] $orient] < 0)} {
- return
- }
- set info [$w get]
- if {[llength $info] == 2} {
- uplevel #0 $cmd scroll $amount units
- } else {
- uplevel #0 $cmd [expr {[lindex $info 2] + $amount}]
- }
-}
-
-# ScrollByPages --
-# This procedure tells the scrollbar's associated widget to scroll up
-# or down by a given number of screenfuls. It notifies the associated
-# widget in different ways for old and new command syntaxes.
-#
-# Arguments:
-# w - The scrollbar widget.
-# orient - Which kinds of scrollbars this applies to: "h" for
-# horizontal, "v" for vertical, "hv" for both.
-# amount - How many screens to scroll: typically 1 or -1.
-
-proc ::blt::TkScrollbar::ScrollByPages {w orient amount} {
- set cmd [$w cget -command]
- if {$cmd eq "" || ([string first [string index [$w cget -orient] 0] $orient] < 0)} {
- return
- }
- set info [$w get]
- if {[llength $info] == 2} {
- uplevel #0 $cmd scroll $amount pages
- } else {
- uplevel #0 $cmd [expr {[lindex $info 2] + $amount*([lindex $info 1] - 1)}]
- }
-}
-
-# ScrollToPos --
-# This procedure tells the scrollbar's associated widget to scroll to
-# a particular location, given by a fraction between 0 and 1. It notifies
-# the associated widget in different ways for old and new command syntaxes.
-#
-# Arguments:
-# w - The scrollbar widget.
-# pos - A fraction between 0 and 1 indicating a desired position
-# in the document.
-
-proc ::blt::TkScrollbar::ScrollToPos {w pos} {
- set cmd [$w cget -command]
- if {$cmd eq ""} {
- return
- }
- set info [$w get]
- if {[llength $info] == 2} {
- uplevel #0 $cmd moveto $pos
- } else {
- uplevel #0 $cmd [expr {round([lindex $info 0]*$pos)}]
- }
-}
-
-#
-# ScrollTopBottom --
-#
-# Scroll to the top or bottom of the document, depending on the mouse
-# position.
-#
-# Arguments:
-# w The scrollbar widget.
-# x, y Mouse coordinates within the widget.
-#
-proc ::blt::TkScrollbar::ScrollTopBottom {w x y} {
- variable _private
-
- set element [$w identify $x $y]
- if {[string match *1 $element]} {
- ScrollToPos $w 0
- } elseif {[string match *2 $element]} {
- ScrollToPos $w 1
- }
- # Set _private(relief), since it's needed by ScrollButtonUp.
- set _private(relief) [$w cget -activerelief]
-}
-
-#
-# ScrollButton2Down --
-#
-# This procedure is invoked when button 2 is pressed over a scrollbar.
-# If the button is over the trough or slider, it sets the scrollbar to
-# the mouse position and starts a slider drag. Otherwise it just
-# behaves the same as button 1.
-#
-# Arguments:
-# w The scrollbar widget.
-# x, y Mouse coordinates within the widget.
-
-proc ::blt::TkScrollbar::ScrollButton2Down {w x y} {
- variable _private
-
- set element [$w identify $x $y]
- if {[string match {arrow[12]} $element]} {
- ScrollButtonDown $w $x $y
- return
- }
- ScrollToPos $w [$w fraction $x $y]
- set _private(relief) [$w cget -activerelief]
-
- # Need the "update idletasks" below so that the widget calls us
- # back to reset the actual scrollbar position before we start the
- # slider drag.
-
- update idletasks
- $w configure -activerelief sunken
- $w activate slider
- ScrollStartDrag $w $x $y
-}
-
-proc ::blt::TkScrollbar::CancelRepeat {} {
- variable _private
- after cancel $_private(afterId)
- set _private(afterId) -1
-}
diff --git a/blt3.0.1/library/scrollset.tcl b/blt3.0.1/library/scrollset.tcl
deleted file mode 100644
index 9490f6f..0000000
--- a/blt3.0.1/library/scrollset.tcl
+++ /dev/null
@@ -1,44 +0,0 @@
-
-namespace eval blt {
- namespace eval Scrollset {
- #empty
- }
-}
-
-proc blt::Scrollset::ConfigureScrollbars { scrollset } {
- set xscrollbar [$scrollset cget -xscrollbar]
- set yscrollbar [$scrollset cget -yscrollbar]
- set slave [$scrollset cget -window]
- if { $slave != "" } {
- set yscrollcmd [$scrollset cget -yscrollcommand]
- if { $yscrollcmd == "" } {
- set yscrollcmd [list $slave yview]
- }
- if { [catch $yscrollcmd] == 0 } {
- $slave configure -yscrollcommand [list $scrollset set y]
- }
- set xscrollcmd [$scrollset cget -xscrollcommand]
- if { $xscrollcmd == "" } {
- set xscrollcmd [list $slave xview]
- }
- if { [catch $xscrollcmd] == 0 } {
- $slave configure -xscrollcommand [list $scrollset set x]
- }
- }
- if { $xscrollbar != "" } {
- $xscrollbar configure -command [list $scrollset xview] \
- -orient horizontal -highlightthickness 0
- }
- if { $yscrollbar != "" } {
- $yscrollbar configure -command [list $scrollset yview] \
- -orient vertical -highlightthickness 0
- }
-}
-
-
-
-
-
-
-
-
diff --git a/blt3.0.1/library/tabset.tcl b/blt3.0.1/library/tabset.tcl
deleted file mode 100644
index 8930c36..0000000
--- a/blt3.0.1/library/tabset.tcl
+++ /dev/null
@@ -1,398 +0,0 @@
-
-#
-# tabset.tcl
-#
-# ----------------------------------------------------------------------
-# Bindings for the BLT tabset widget
-# ----------------------------------------------------------------------
-# AUTHOR: George Howlett
-# Bell Labs Innovations for Lucent Technologies
-# gah at bell-labs.com
-# http://www.tcltk.com/blt
-# ----------------------------------------------------------------------
-# Copyright (c) 1998 Lucent Technologies, Inc.
-# ======================================================================
-#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that the copyright notice and warranty disclaimer appear in
-# supporting documentation, and that the names of Lucent Technologies
-# any of their entities not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# Lucent Technologies disclaims all warranties with regard to this
-# software, including all implied warranties of merchantability and
-# fitness. In no event shall Lucent be liable for any special, indirect
-# or consequential damages or any damages whatsoever resulting from loss
-# of use, data or profits, whether in an action of contract, negligence
-# or other tortuous action, arising out of or in connection with the use
-# or performance of this software.
-#
-# ======================================================================
-
-#
-# Indicates whether to activate (highlight) tabs when the mouse passes
-# over them. This is turned off during scan operations.
-#
-
-namespace eval blt {
- namespace eval Tabset {
- variable privateData
- set privateData(activate) yes
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# ButtonPress assignments
-#
-# <ButtonPress-2> Starts scan mechanism (pushes the tabs)
-# <B2-Motion> Adjust scan
-# <ButtonRelease-2> Stops scan
-# <ButtonPress-3> Starts scan mechanism (pushes the tabs)
-# <B3-Motion> Adjust scan
-# <ButtonRelease-3> Stops scan
-#
-# ----------------------------------------------------------------------
-bind Tabset <B2-Motion> {
- %W scan dragto %x %y
-}
-
-bind Tabset <ButtonPress-2> {
- set blt::Tabset::privateData(cursor) [%W cget -cursor]
- set blt::Tabset::privateData(activate) no
- %W configure -cursor hand1
- %W scan mark %x %y
-}
-
-bind Tabset <ButtonRelease-2> {
- %W configure -cursor $::blt::Tabset::privateData(cursor)
- set blt::Tabset::privateData(activate) yes
- %W activate @%x,%y
-}
-
-bind Tabset <B3-Motion> {
- %W scan dragto %x %y
-}
-
-bind Tabset <ButtonPress-3> {
- set blt::Tabset::privateData(cursor) [%W cget -cursor]
- set blt::Tabset::privateData(activate) no
- %W configure -cursor hand1
- %W scan mark %x %y
-}
-
-bind Tabset <ButtonRelease-3> {
- %W configure -cursor $blt::Tabset::privateData(cursor)
- set blt::Tabset::privateData(activate) yes
- %W activate @%x,%y
-}
-
-# ----------------------------------------------------------------------
-#
-# KeyPress assignments
-#
-# <KeyPress-Up> Moves focus to the tab immediately above the
-# current.
-# <KeyPress-Down> Moves focus to the tab immediately below the
-# current.
-# <KeyPress-Left> Moves focus to the tab immediately left of the
-# currently focused tab.
-# <KeyPress-Right> Moves focus to the tab immediately right of the
-# currently focused tab.
-# <KeyPress-space> Invokes the commands associated with the current
-# tab.
-# <KeyPress-Return> Same as above.
-# <KeyPress> Go to next tab starting with the ASCII character.
-# <KeyPress-End> Moves focus to the last tab.
-# <KeyPress-Home> Moves focus to the last tab.
-#
-# ----------------------------------------------------------------------
-
-bind Tabset <KeyPress-Up> {
- blt::Tabset::MoveFocus %W "up"
-}
-bind Tabset <KeyPress-Down> {
- blt::Tabset::MoveFocus %W "down"
-}
-bind Tabset <KeyPress-Right> {
- blt::Tabset::MoveFocus %W "right"
-}
-bind Tabset <KeyPress-Left> {
- blt::Tabset::MoveFocus %W "left"
-}
-bind Tabset <KeyPress-Home> {
- blt::Tabset::MoveFocus %W "first"
-}
-bind Tabset <KeyPress-End> {
- blt::Tabset::MoveFocus %W "last"
-}
-bind Tabset <KeyPress-space> {
- blt::Tabset::Select %W "focus"
-}
-
-bind Tabset <KeyPress-Return> {
- %W invoke focus
-}
-
-bind Tabset <KeyPress> {
- if { [string match {[A-Za-z0-9]*} "%A"] } {
- blt::Tabset::FindMatch %W %A
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# FindMatch --
-#
-# Find the first tab (from the tab that currently has focus)
-# starting with the same first letter as the tab. It searches
-# in order of the tab positions and wraps around. If no tab
-# matches, it stops back at the current tab.
-#
-# Arguments:
-# widget Tabset widget.
-# key ASCII character of key pressed
-#
-# ----------------------------------------------------------------------
-proc blt::Tabset::FindMatch { w key } {
- set key [string tolower $key]
- set itab [$w index focus]
- set numTabs [$w size]
- for { set i 0 } { $i < $numTabs } { incr i } {
- if { [incr itab] >= $numTabs } {
- set itab 0
- }
- set label [string tolower [$w tab cget $itab -text]]
- if { [string index $label 0] == $key } {
- break
- }
- }
- $w focus $itab
- $w see focus
-}
-
-# ----------------------------------------------------------------------
-#
-# Select --
-#
-# Invokes the command for the tab. If the widget associated tab
-# is currently torn off, the tearoff is raised.
-#
-# Arguments:
-# widget Tabset widget.
-# x y Unused.
-#
-# ----------------------------------------------------------------------
-proc blt::Tabset::Select { w tab } {
- set index [$w index $tab]
- if { $index != "" } {
- $w select $index
- $w focus $index
- $w see $index
- set tearoff [$w tearoff $index]
- if { ($tearoff != "") && ($tearoff != "$w") } {
- raise [winfo toplevel $tearoff]
- }
- $w invoke $index
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# MoveFocus --
-#
-# Invokes the command for the tab. If the widget associated tab
-# is currently torn off, the tearoff is raised.
-#
-# Arguments:
-# widget Tabset widget.
-# x y Unused.
-#
-# ----------------------------------------------------------------------
-proc blt::Tabset::MoveFocus { w tab } {
- set index [$w index $tab]
- if { $index != "" } {
- $w focus $index
- $w see $index
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# DestroyTearoff --
-#
-# Destroys the toplevel window and the container tearoff
-# window holding the embedded widget. The widget is placed
-# back inside the tab.
-#
-# Arguments:
-# widget Tabset widget.
-# tab Tab selected.
-#
-# ----------------------------------------------------------------------
-proc blt::Tabset::DestroyTearoff { w tab } {
- set id [$w id $tab]
- set top "$w.toplevel-$id"
- if { [winfo exists $top] } {
- wm withdraw $top
- update
- $w tearoff $tab $w
- destroy $top
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# CreateTearoff --
-#
-# Creates a new toplevel window and moves the embedded widget
-# into it. The toplevel is placed just below the tab. The
-# DELETE WINDOW property is set so that if the toplevel window
-# is requested to be deleted by the window manager, the embedded
-# widget is placed back inside of the tab. Note also that
-# if the tabset container is ever destroyed, the toplevel is
-# also destroyed.
-#
-# Arguments:
-# widget Tabset widget.
-# tab Tab selected.
-# x y The coordinates of the mouse pointer.
-#
-# ----------------------------------------------------------------------
-
-proc blt::Tabset::CreateTearoff { w tab rootX rootY } {
-
- # ------------------------------------------------------------------
- # When reparenting the window contained in the tab, check if the
- # window or any window in its hierarchy currently has focus.
- # Since we're reparenting windows behind its back, Tk can
- # mistakenly activate the keyboard focus when the mouse enters the
- # old toplevel. The simplest way to deal with this problem is to
- # take the focus off the window and set it to the tabset widget
- # itself.
- # ------------------------------------------------------------------
-
- set focus [focus]
- set win [$w tab cget $tab -window]
- set index [$w index $tab]
- if { ($focus == $w) || ([string match ${win}.* $focus]) } {
- focus -force $w
- }
- set id [$w id $index]
- set top "$w.toplevel-$id"
- toplevel $top
- $w tearoff $tab $top.container
- blt::table $top 0,0 $top.container -fill both
-
- incr rootX 10 ; incr rootY 10
- wm geometry $top +$rootX+$rootY
-
- set parent [winfo toplevel $w]
- wm title $top "[wm title $parent]: [$w tab cget $index -text]"
- #wm transient $top $parent
-
- # If the user tries to delete the toplevel, put the window back
- # into the tab folder.
-
- wm protocol $top WM_DELETE_WINDOW \
- [list blt::Tabset::DestroyTearoff $w $tab]
-
- # If the container is ever destroyed, automatically destroy the
- # toplevel too.
-
- bind $top.container <Destroy> [list destroy $top]
-}
-
-# ----------------------------------------------------------------------
-#
-# ToggleTearoff --
-#
-# Toggles the tab tearoff. If the tab contains a embedded widget,
-# it is placed inside of a toplevel window. If the widget has
-# already been torn off, the widget is replaced back in the tab.
-#
-# Arguments:
-# widget tabset widget.
-# x y The coordinates of the mouse pointer.
-#
-# ----------------------------------------------------------------------
-
-proc blt::Tabset::ToggleTearoff { w index } {
- set tab [$w index $index]
- if { $tab == "" } {
- return
- }
- $w invoke $tab
- set win [$w tearoff $index]
- if { $win == "$w" } {
- foreach { x1 y1 x2 y2 } [$w extents $tab] break
- CreateTearoff $w $tab $x1 $y1
- } elseif { $win != "" } {
- DestroyTearoff $w $tab
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# Init
-#
-# Invoked from C whenever a new tabset widget is created.
-# Sets up the default bindings for the all tab entries.
-# These bindings are local to the widget, so they can't be
-# set through the usual widget class bind tags mechanism.
-#
-# <Enter> Activates the tab.
-# <Leave> Deactivates all tabs.
-# <ButtonPress-1> Selects the tab and invokes its command.
-# <Control-ButtonPress-1>
-# Toggles the tab tearoff. If the tab contains
-# a embedded widget, it is placed inside of a
-# toplevel window. If the widget has already
-# been torn off, the widget is replaced back
-# in the tab.
-#
-# Arguments:
-# widget tabset widget
-#
-# ----------------------------------------------------------------------
-
-proc blt::Tabset::Init { w } {
- $w bind all <Enter> {
- if { $::blt::Tabset::privateData(activate) } {
- %W activate current
- }
- }
- $w bind all <Leave> {
- %W activate ""
- }
- $w bind all <ButtonPress-1> {
- blt::Tabset::Select %W "current"
- }
- $w bind all <Control-ButtonPress-1> {
- blt::Tabset::ToggleTearoff %W active
- }
- $w configure -perforationcommand [list blt::Tabset::ToggleTearoff $w]
- $w bind Perforation <Enter> {
- %W perforation activate on
- }
- $w bind Perforation <Leave> {
- %W perforation activate off
- }
- $w bind Perforation <ButtonRelease-1> {
- %W perforation invoke
- }
- $w bind Button <Enter> {
- %W button activate current
- }
- $w bind Button <Leave> {
- %W button activate ""
- }
- $w bind Button <ButtonRelease-1> {
- if { [catch {%W close current}] == 0 } {
- %W delete current
- }
- }
-}
diff --git a/blt3.0.1/library/tclIndex b/blt3.0.1/library/tclIndex
deleted file mode 100644
index 0b72d79..0000000
--- a/blt3.0.1/library/tclIndex
+++ /dev/null
@@ -1,13 +0,0 @@
-# Tcl autoload index file, version 2.0
-# This file is generated by the "auto_mkindex" command
-# and sourced to set up indexing information for one or
-# more commands. Typically each line is a command that
-# sets an element in the auto_index array, where the
-# element name is the name of a command and the value is
-# a script that loads the command.
-
-set auto_index(Blt_ActiveLegend) [list source $dir/graph.tcl]
-set auto_index(Blt_Crosshairs) [list source $dir/graph.tcl]
-set auto_index(Blt_ZoomStack) [list source $dir/graph.tcl]
-set auto_index(Blt_PrintKey) [list source $dir/graph.tcl]
-set auto_index(Blt_ClosestPoint) [list source $dir/graph.tcl]
diff --git a/blt3.0.1/library/treeview.cur b/blt3.0.1/library/treeview.cur
deleted file mode 100644
index 040cf43..0000000
Binary files a/blt3.0.1/library/treeview.cur and /dev/null differ
diff --git a/blt3.0.1/library/treeview.tcl b/blt3.0.1/library/treeview.tcl
deleted file mode 100644
index ee93589..0000000
--- a/blt3.0.1/library/treeview.tcl
+++ /dev/null
@@ -1,1063 +0,0 @@
-
-# ======================================================================
-#
-# treeview.tcl
-#
-# ----------------------------------------------------------------------
-# Bindings for the BLT treeview widget
-# ----------------------------------------------------------------------
-#
-# AUTHOR: George Howlett
-# Bell Labs Innovations for Lucent Technologies
-# gah at lucent.com
-# http://www.tcltk.com/blt
-#
-# RCS: $Id: treeview.tcl,v 1.1.1.1 2010/10/27 21:57:06 joye Exp $
-#
-# ----------------------------------------------------------------------
-# Copyright (c) 1998 Lucent Technologies, Inc.
-# ----------------------------------------------------------------------
-#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that the copyright notice and warranty disclaimer appear in
-# supporting documentation, and that the names of Lucent Technologies
-# any of their entities not be used in advertising or publicity
-# pertaining to distribution of the software without specific, written
-# prior permission.
-#
-# Lucent Technologies disclaims all warranties with regard to this
-# software, including all implied warranties of merchantability and
-# fitness. In no event shall Lucent be liable for any special, indirect
-# or consequential damages or any damages whatsoever resulting from loss
-# of use, data or profits, whether in an action of contract, negligence
-# or other tortuous action, arising out of or in connection with the use
-# or performance of this software.
-#
-# ======================================================================
-
-namespace eval ::blt::TreeView {
- variable _private
- array set _private {
- afterId -1
- scroll 0
- column ""
- space off
- x 0
- y 0
- }
-}
-
-image create picture ::blt::TreeView::openIcon -data {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM8WBrM+rAEQWmIb5KxiWjNInCkV32AJHRlGQBgDA7vdN4vUa8tC78qlrCWmvRKsJTquHkp
- ZTKAsiCtWq0JADs=
-}
-image create picture ::blt::TreeView::closeIcon -data {
- R0lGODlhEAANAMIAAAAAAH9/f///////AL+/vwAA/wAAAAAAACH5BAEAAAUALAAAAAAQAA0A
- AAM1WBrM+rAEMigJ8c3Kb3OSII6kGABhp1JnaK1VGwjwKwtvHqNzzd263M3H4n2OH1QBwGw6
- nQkAOw==
-}
-if { $tcl_platform(platform) == "windows" } {
- if { $tk_version >= 8.3 } {
- set cursor "@[file join $blt_library treeview.cur]"
- } else {
- set cursor "size_we"
- }
- option add *TreeView.ResizeCursor [list $cursor]
-} else {
- option add *TreeView.ResizeCursor \
- "@$blt_library/treeview.xbm $blt_library/treeview_m.xbm black white"
-}
-
-# ----------------------------------------------------------------------
-#
-# Initialize --
-#
-# Invoked by internally by Treeview_Init routine. Initializes
-# the default bindings for the treeview widget entries. These
-# are local to the widget, so they can't be set through the
-# widget's class bind tags.
-#
-# ----------------------------------------------------------------------
-proc blt::TreeView::Initialize { w } {
- variable _private
- #
- # Active entry bindings
- #
- $w bind Entry <Enter> {
- %W entry highlight current
- }
- $w bind Entry <Leave> {
- %W entry highlight ""
- }
-
- #
- # Button bindings
- #
- $w button bind all <ButtonRelease-1> {
- set index [%W nearest %x %y blt::TreeView::_private(who)]
- if { [%W index current] == $index &&
- $blt::TreeView::_private(who) == "button" } {
- %W see -anchor nw current
- %W toggle current
- }
- }
- $w button bind all <Enter> {
- %W button highlight current
- }
- $w button bind all <Leave> {
- %W button highlight ""
- }
-
- #
- # ButtonPress-1
- #
- # Performs the following operations:
- #
- # 1. Clears the previous selection.
- # 2. Selects the current entry.
- # 3. Sets the focus to this entry.
- # 4. Scrolls the entry into view.
- # 5. Sets the selection anchor to this entry, just in case
- # this is "multiple" mode.
- #
-
- $w bind Entry <ButtonPress-1> {
- blt::TreeView::SetSelectionAnchor %W current
- set blt::TreeView::_private(scroll) 1
- }
-
- $w bind Entry <Double-ButtonPress-1> {
- if { ![%W cget -flat] } {
- %W toggle current
- }
- }
-
- #
- # B1-Motion
- #
- # For "multiple" mode only. Saves the current location of the
- # pointer for auto-scrolling. Resets the selection mark.
- #
- $w bind Entry <B1-Motion> {
- set blt::TreeView::_private(x) %x
- set blt::TreeView::_private(y) %y
- set index [%W nearest %x %y]
- if { [%W cget -selectmode] == "multiple" } {
- %W selection mark $index
- } else {
- blt::TreeView::SetSelectionAnchor %W $index
- }
- }
-
- #
- # ButtonRelease-1
- #
- # For "multiple" mode only.
- #
- $w bind Entry <ButtonRelease-1> {
- if { [%W cget -selectmode] == "multiple" } {
- %W selection anchor current
- }
- after cancel $blt::TreeView::_private(afterId)
- set blt::TreeView::_private(afterId) -1
- set blt::TreeView::_private(scroll) 0
- }
-
- #
- # Shift-ButtonPress-1
- #
- # For "multiple" mode only.
- #
-
- $w bind Entry <Shift-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" && [%W selection present] } {
- if { [%W index anchor] == -1 } {
- %W selection anchor current
- }
- set index [%W index anchor]
- %W selection clearall
- %W selection set $index current
- } else {
- blt::TreeView::SetSelectionAnchor %W current
- }
- }
- $w bind Entry <Shift-Double-ButtonPress-1> {
- # do nothing
- }
- $w bind Entry <Shift-B1-Motion> {
- # do nothing
- }
- $w bind Entry <Shift-ButtonRelease-1> {
- after cancel $blt::TreeView::_private(afterId)
- set blt::TreeView::_private(afterId) -1
- set blt::TreeView::_private(scroll) 0
- }
-
- #
- # Control-ButtonPress-1
- #
- # For "multiple" mode only.
- #
- $w bind Entry <Control-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" } {
- set index [%W index current]
- %W selection toggle $index
- %W selection anchor $index
- } else {
- blt::TreeView::SetSelectionAnchor %W current
- }
- }
- $w bind Entry <Control-Double-ButtonPress-1> {
- # do nothing
- }
- $w bind Entry <Control-B1-Motion> {
- # do nothing
- }
- $w bind Entry <Control-ButtonRelease-1> {
- after cancel $blt::TreeView::_private(afterId)
- set blt::TreeView::_private(afterId) -1
- set blt::TreeView::_private(scroll) 0
- }
-
- $w bind Entry <Control-Shift-ButtonPress-1> {
- if { [%W cget -selectmode] == "multiple" && [%W selection present] } {
- if { [%W index anchor] == -1 } {
- %W selection anchor current
- }
- if { [%W selection includes anchor] } {
- %W selection set anchor current
- } else {
- %W selection clear anchor current
- %W selection set current
- }
- } else {
- blt::TreeView::SetSelectionAnchor %W current
- }
- }
- $w bind Entry <Control-Shift-Double-ButtonPress-1> {
- # do nothing
- }
- $w bind Entry <Control-Shift-B1-Motion> {
- # do nothing
- }
-
- $w bind Entry <ButtonRelease-3> {
- blt::TreeView::EditColumn %W %X %Y
- }
-
- $w column bind all <Enter> {
- %W column highlight [%W column current]
- }
- $w column bind all <Leave> {
- %W column highlight ""
- }
- $w column bind Rule <Enter> {
- %W column highlight [%W column current]
- %W column resize activate [%W column current]
- }
- $w column bind Rule <Leave> {
- %W column highlight ""
- %W column resize activate ""
- }
- $w column bind Rule <ButtonPress-1> {
- %W column resize anchor %x
- }
- $w column bind Rule <B1-Motion> {
- %W column resize mark %x
- }
- $w column bind Rule <ButtonRelease-1> {
- %W column configure [%W column current] -width [%W column resize set]
- }
- $w column bind all <ButtonPress-1> {
- set blt::TreeView::_private(column) [%W column current]
- %W column configure $blt::TreeView::_private(column) \
- -titlerelief sunken
- }
- $w column bind all <ButtonRelease-1> {
- set column [%W column current]
- if { $column != "" } {
- %W column invoke $column
- }
- %W column configure $blt::TreeView::_private(column) \
- -titlerelief raised
- }
-# $w bind TextBoxStyle <ButtonPress-3> {
-# puts stderr "widget bind buttonpress-3 %W %X %Y"
-# if { [%W edit -root -test %X %Y] } {
-# break
-# }
-# }
-# $w bind TextBoxStyle <ButtonRelease-3> {
-# if { [%W edit -root -test %X %Y] } {
-# blt::TreeView::EditColumn %W %X %Y
-# break
-# }
-# }
- $w bind CheckBoxStyle <Enter> {
- if { [%W column cget [%W column current] -edit] } {
- %W style activate current [%W column current]
- }
- }
- $w bind CheckBoxStyle <Leave> {
- %W style activate ""
- }
- $w bind CheckBoxStyle <ButtonPress-1> {
- if { [%W column cget [%W column current] -edit] } {
- break
- }
- }
- $w bind CheckBoxStyle <B1-Motion> {
- if { [%W column cget [%W column current] -edit] } {
- break
- }
- }
- $w bind CheckBoxStyle <ButtonRelease-1> {
- if { [%W edit -root -test %X %Y] } {
- %W edit -root %X %Y
- break
- }
- }
- $w bind ComboBoxStyle <Enter> {
- if { [%W column cget [%W column current] -edit] } {
- %W style activate current [%W column current]
- }
- }
- $w bind ComboBoxStyle <Leave> {
- %W style activate ""
- }
- $w bind ComboBoxStyle <ButtonPress-1> {
- if { [%W column cget [%W column current] -edit] } {
- break
- }
- }
- $w bind ComboBoxStyle <ButtonRelease-1> {
- if { [%W edit -root -test %X %Y] } {
- %W edit -root %X %Y
- break
- }
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# AutoScroll --
-#
-# Invoked when the user is selecting elements in a treeview
-# widget and drags the mouse pointer outside of the widget.
-# Scrolls the view in the direction of the pointer.
-#
-# ----------------------------------------------------------------------
-proc blt::TreeView::AutoScroll { w } {
- variable _private
-
- if { ![winfo exists $w] } {
- return
- }
- set x $_private(x)
- set y $_private(y)
-
- set index [$w nearest $x $y]
- if {$y >= [winfo height $w]} {
- $w yview scroll 1 units
- set neighbor down
- } elseif {$y < 0} {
- $w yview scroll -1 units
- set neighbor up
- } else {
- set neighbor $index
- }
- if { [$w cget -selectmode] == "single" } {
- SetSelectionAnchor $w $neighbor
- } else {
- $w selection mark $index
- }
- set _private(afterId) [after 50 blt::TreeView::AutoScroll $w]
-}
-
-proc blt::TreeView::SetSelectionAnchor { w tagOrId } {
- set index [$w index $tagOrId]
- $w selection clearall
- $w see $index
- $w focus $index
- $w selection set $index
- $w selection anchor $index
-}
-
-# ----------------------------------------------------------------------
-#
-# MoveFocus --
-#
-# Invoked by KeyPress bindings. Moves the active selection to
-# the entry <where>, which is an index such as "up", "down",
-# "prevsibling", "nextsibling", etc.
-#
-# ----------------------------------------------------------------------
-proc blt::TreeView::MoveFocus { w tagOrId } {
- catch {$w focus $tagOrId}
- if { [$w cget -selectmode] == "single" } {
- $w selection clearall
- $w selection set focus
- $w selection anchor focus
- }
- $w see focus
-}
-
-# ----------------------------------------------------------------------
-#
-# MovePage --
-#
-# Invoked by KeyPress bindings. Pages the current view up or
-# down. The <where> argument should be either "top" or
-# "bottom".
-#
-# ----------------------------------------------------------------------
-proc blt::TreeView::MovePage { w where } {
-
- # If the focus is already at the top/bottom of the window, we want
- # to scroll a page. It's really one page minus an entry because we
- # want to see the last entry on the next/last page.
- if { [$w index focus] == [$w index view.$where] } {
- if {$where == "top"} {
- $w yview scroll -1 pages
- $w yview scroll 1 units
- } else {
- $w yview scroll 1 pages
- $w yview scroll -1 units
- }
- }
- update
-
- # Adjust the entry focus and the view. Also activate the entry.
- # just in case the mouse point is not in the widget.
- $w entry highlight view.$where
- $w focus view.$where
- $w see view.$where
- if { [$w cget -selectmode] == "single" } {
- $w selection clearall
- $w selection set focus
- }
-}
-
-# ----------------------------------------------------------------------
-#
-# NextMatch --
-#
-# Invoked by KeyPress bindings. Searches for an entry that
-# starts with the letter <char> and makes that entry active.
-#
-# ----------------------------------------------------------------------
-proc blt::TreeView::NextMatch { w key } {
- if {[string match {[ -~]} $key]} {
- set last [$w index focus]
- if { $last == -1 } {
- return; # No focus.
- }
- set next [$w index next]
- if { $next == -1 } {
- set next $last
- }
- while { $next != $last } {
- set label [$w entry cget $next -label]
- set label [string index $label 0]
- if { [string tolower $label] == [string tolower $key] } {
- break
- }
- set next [$w index -at $next next]
- }
- $w focus $next
- if {[$w cget -selectmode] == "single"} {
- $w selection clearall
- $w selection set focus
- }
- $w see focus
- }
-}
-
-#------------------------------------------------------------------------
-#
-# InsertText --
-#
-# Inserts a text string into an entry at the insertion cursor.
-# If there is a selection in the entry, and it covers the point
-# of the insertion cursor, then delete the selection before
-# inserting.
-#
-# Arguments:
-# w Widget where to insert the text.
-# text Text string to insert (usually just a single character)
-#
-#------------------------------------------------------------------------
-proc blt::TreeView::InsertText { w text } {
- if { [string length $text] > 0 } {
- set index [$w index insert]
- if { ($index >= [$w index sel.first]) &&
- ($index <= [$w index sel.last]) } {
- $w delete sel.first sel.last
- }
- $w insert $index $text
- }
-}
-
-#------------------------------------------------------------------------
-#
-# Transpose -
-#
-# This procedure implements the "transpose" function for entry
-# widgets. It tranposes the characters on either side of the
-# insertion cursor, unless the cursor is at the end of the line.
-# In this case it transposes the two characters to the left of
-# the cursor. In either case, the cursor ends up to the right
-# of the transposed characters.
-#
-# Arguments:
-# w The entry window.
-#
-#------------------------------------------------------------------------
-proc blt::TreeView::Transpose { w } {
- set i [$w index insert]
- if {$i < [$w index end]} {
- incr i
- }
- set first [expr {$i-2}]
- if {$first < 0} {
- return
- }
- set new [string index [$w get] [expr {$i-1}]][string index [$w get] $first]
- $w delete $first $i
- $w insert insert $new
-}
-
-#------------------------------------------------------------------------
-#
-# GetSelection --
-#
-# Returns the selected text of the entry with respect to the
-# -show option.
-#
-# Arguments:
-# w Entry window from which the text to get
-#
-#------------------------------------------------------------------------
-
-proc blt::TreeView::GetSelection { w } {
- set text [string range [$w get] [$w index sel.first] \
- [expr [$w index sel.last] - 1]]
- if {[$w cget -show] != ""} {
- regsub -all . $text [string index [$w cget -show] 0] text
- }
- return $text
-}
-
-proc blt::TreeView::EditColumn { w x y } {
- $w see current
- if { [winfo exists $w.edit] } {
- destroy $w.edit
- return
- }
- if { ![$w edit -root -test $x $y] } {
- return
- }
- $w edit -root $x $y
- update
- if { [winfo exists $w.edit] } {
- focus $w.edit
- $w.edit selection range 0 end
- grab set $w.edit
- tkwait window $w.edit
- grab release $w.edit
- }
-}
-
-#
-# ButtonPress assignments
-#
-# B1-Enter start auto-scrolling
-# B1-Leave stop auto-scrolling
-# ButtonPress-2 start scan
-# B2-Motion adjust scan
-# ButtonRelease-2 stop scan
-#
-
-bind TreeView <ButtonPress-2> {
- set blt::TreeView::_private(cursor) [%W cget -cursor]
- %W configure -cursor hand1
- %W scan mark %x %y
-}
-
-bind TreeView <B2-Motion> {
- %W scan dragto %x %y
-}
-
-bind TreeView <ButtonRelease-2> {
- %W configure -cursor $blt::TreeView::_private(cursor)
-}
-
-bind TreeView <B1-Leave> {
- if { $blt::TreeView::_private(scroll) } {
- blt::TreeView::AutoScroll %W
- }
-}
-
-bind TreeView <B1-Enter> {
- after cancel $blt::TreeView::_private(afterId)
- set blt::TreeView::_private(afterId) -1
-}
-
-#
-# KeyPress assignments
-#
-# Up
-# Down
-# Shift-Up
-# Shift-Down
-# Prior (PageUp)
-# Next (PageDn)
-# Left
-# Right
-# space Start selection toggle of entry currently with focus.
-# Return Start selection toggle of entry currently with focus.
-# Home
-# End
-# F1
-# F2
-# ASCII char Go to next open entry starting with character.
-#
-# KeyRelease
-#
-# space Stop selection toggle of entry currently with focus.
-# Return Stop selection toggle of entry currently with focus.
-
-
-bind TreeView <KeyPress-Up> {
- blt::TreeView::MoveFocus %W up
- if { $blt::TreeView::_private(space) } {
- %W selection toggle focus
- }
-}
-
-bind TreeView <KeyPress-Down> {
- blt::TreeView::MoveFocus %W down
- if { $blt::TreeView::_private(space) } {
- %W selection toggle focus
- }
-}
-
-bind TreeView <Shift-KeyPress-Up> {
- blt::TreeView::MoveFocus %W prevsibling
-}
-
-bind TreeView <Shift-KeyPress-Down> {
- blt::TreeView::MoveFocus %W nextsibling
-}
-
-bind TreeView <KeyPress-Prior> {
- blt::TreeView::MovePage %W top
-}
-
-bind TreeView <KeyPress-Next> {
- blt::TreeView::MovePage %W bottom
-}
-
-bind TreeView <KeyPress-Left> {
- %W close focus
-}
-bind TreeView <KeyPress-Right> {
- %W open focus
- %W see focus -anchor w
-}
-
-bind TreeView <KeyPress-space> {
- if { [%W cget -selectmode] == "single" } {
- if { [%W selection includes focus] } {
- %W selection clearall
- } else {
- %W selection clearall
- %W selection set focus
- }
- } else {
- %W selection toggle focus
- }
- set blt::TreeView::_private(space) on
-}
-
-bind TreeView <KeyRelease-space> {
- set blt::TreeView::_private(space) off
-}
-
-bind TreeView <KeyPress-Return> {
- blt::TreeView::MoveFocus %W focus
- set blt::TreeView::_private(space) on
-}
-
-bind TreeView <KeyRelease-Return> {
- set blt::TreeView::_private(space) off
-}
-
-bind TreeView <KeyPress> {
- blt::TreeView::NextMatch %W %A
-}
-
-bind TreeView <KeyPress-Home> {
- blt::TreeView::MoveFocus %W top
-}
-
-bind TreeView <KeyPress-End> {
- blt::TreeView::MoveFocus %W bottom
-}
-
-bind TreeView <KeyPress-F1> {
- %W open -r root
-}
-
-bind TreeView <KeyPress-F2> {
- eval %W close -r [%W entry children root]
-}
-
-if {[string equal "x11" [tk windowingsystem]]} {
- bind TreeView <4> {
- %W yview scroll -5 units
- }
- bind TreeView <5> {
- %W yview scroll 5 units
- }
-} else {
- bind TreeView <MouseWheel> {
- %W yview scroll [expr {- (%D / 120) * 4}] units
- }
-}
-
-
-#
-# Differences between id "current" and operation nearest.
-#
-# set index [$w index current]
-# set index [$w nearest $x $y]
-#
-# o Nearest gives you the closest entry.
-# o current is "" if
-# 1) the pointer isn't over an entry.
-# 2) the pointer is over a open/close button.
-# 3)
-#
-
-#
-# Edit mode assignments
-#
-# ButtonPress-3 Enables/disables edit mode on entry. Sets focus to
-# entry.
-#
-# KeyPress
-#
-# Left Move insertion position to previous.
-# Right Move insertion position to next.
-# Up Move insertion position up one line.
-# Down Move insertion position down one line.
-# Return End edit mode.
-# Shift-Return Line feed.
-# Home Move to first position.
-# End Move to last position.
-# ASCII char Insert character left of insertion point.
-# Del Delete character right of insertion point.
-# Delete Delete character left of insertion point.
-# Ctrl-X Cut
-# Ctrl-V Copy
-# Ctrl-P Paste
-#
-# KeyRelease
-#
-# ButtonPress-1 Start selection if in entry, otherwise clear selection.
-# B1-Motion Extend/reduce selection.
-# ButtonRelease-1 End selection if in entry, otherwise use last
-# selection.
-# B1-Enter Disabled.
-# B1-Leave Disabled.
-# ButtonPress-2 Same as above.
-# B2-Motion Same as above.
-# ButtonRelease-2 Same as above.
-#
-#
-
-
-# Standard Motif bindings:
-
-bind TreeViewEditor <ButtonPress-1> {
- %W icursor @%x,%y
- %W selection clear
-}
-
-bind TreeViewEditor <Left> {
- %W icursor last
- %W selection clear
-}
-
-bind TreeViewEditor <Right> {
- %W icursor next
- %W selection clear
-}
-
-bind TreeViewEditor <Shift-Left> {
- set new [expr {[%W index insert] - 1}]
- if {![%W selection present]} {
- %W selection from insert
- %W selection to $new
- } else {
- %W selection adjust $new
- }
- %W icursor $new
-}
-
-bind TreeViewEditor <Shift-Right> {
- set new [expr {[%W index insert] + 1}]
- if {![%W selection present]} {
- %W selection from insert
- %W selection to $new
- } else {
- %W selection adjust $new
- }
- %W icursor $new
-}
-
-bind TreeViewEditor <Home> {
- %W icursor 0
- %W selection clear
-}
-bind TreeViewEditor <Shift-Home> {
- set new 0
- if {![%W selection present]} {
- %W selection from insert
- %W selection to $new
- } else {
- %W selection adjust $new
- }
- %W icursor $new
-}
-bind TreeViewEditor <End> {
- %W icursor end
- %W selection clear
-}
-bind TreeViewEditor <Shift-End> {
- set new end
- if {![%W selection present]} {
- %W selection from insert
- %W selection to $new
- } else {
- %W selection adjust $new
- }
- %W icursor $new
-}
-
-bind TreeViewEditor <Delete> {
- if { [%W selection present]} {
- %W delete sel.first sel.last
- } else {
- %W delete insert
- }
-}
-
-bind TreeViewEditor <BackSpace> {
- if { [%W selection present] } {
- %W delete sel.first sel.last
- } else {
- set index [expr [%W index insert] - 1]
- if { $index >= 0 } {
- %W delete $index $index
- }
- }
-}
-
-bind TreeViewEditor <Control-space> {
- %W selection from insert
-}
-
-bind TreeViewEditor <Select> {
- %W selection from insert
-}
-
-bind TreeViewEditor <Control-Shift-space> {
- %W selection adjust insert
-}
-
-bind TreeViewEditor <Shift-Select> {
- %W selection adjust insert
-}
-
-bind TreeViewEditor <Control-slash> {
- %W selection range 0 end
-}
-
-bind TreeViewEditor <Control-backslash> {
- %W selection clear
-}
-
-bind TreeViewEditor <KeyPress> {
- blt::TreeView::InsertText %W %A
-}
-
-# Ignore all Alt, Meta, and Control keypresses unless explicitly bound.
-# Otherwise, if a widget binding for one of these is defined, the
-# <KeyPress> class binding will also fire and insert the character,
-# which is wrong. Ditto for Escape, Return, and Tab.
-
-bind TreeViewEditor <Alt-KeyPress> {
- # nothing
-}
-
-bind TreeViewEditor <Meta-KeyPress> {
- # nothing
-}
-
-bind TreeViewEditor <Control-KeyPress> {
- # nothing
-}
-
-bind TreeViewEditor <Escape> {
- %W cancel
-}
-
-bind TreeViewEditor <Return> {
- %W apply
-}
-
-bind TreeViewEditor <Shift-Return> {
- blt::TreeView::InsertText %W "\n"
-}
-
-bind TreeViewEditor <KP_Enter> {
- # nothing
-}
-
-bind TreeViewEditor <Tab> {
- # nothing
-}
-
-if {![string compare $tcl_platform(platform) "macintosh"]} {
- bind TreeViewEditor <Command-KeyPress> {
- # nothing
- }
-}
-
-# On Windows, paste is done using Shift-Insert. Shift-Insert already
-# generates the <<Paste>> event, so we don't need to do anything here.
-if { [string compare $tcl_platform(platform) "windows"] != 0 } {
- bind TreeViewEditor <Insert> {
- catch {blt::TreeView::InsertText %W [selection get -displayof %W]}
- }
-}
-
-# Additional emacs-like bindings:
-bind TreeViewEditor <ButtonRelease-3> {
- set parent [winfo parent %W]
- %W cancel
-}
-
-bind TreeViewEditor <Control-a> {
- %W icursor 0
- %W selection clear
-}
-
-bind TreeViewEditor <Control-b> {
- %W icursor [expr {[%W index insert] - 1}]
- %W selection clear
-}
-
-bind TreeViewEditor <Control-d> {
- %W delete insert
-}
-
-bind TreeViewEditor <Control-e> {
- %W icursor end
- %W selection clear
-}
-
-bind TreeViewEditor <Control-f> {
- %W icursor [expr {[%W index insert] + 1}]
- %W selection clear
-}
-
-bind TreeViewEditor <Control-h> {
- if {[%W selection present]} {
- %W delete sel.first sel.last
- } else {
- set index [expr [%W index insert] - 1]
- if { $index >= 0 } {
- %W delete $index $index
- }
- }
-}
-
-bind TreeViewEditor <Control-k> {
- %W delete insert end
-}
-
-if 0 {
- bind TreeViewEditor <Control-t> {
- blt::TreeView::Transpose %W
- }
- bind TreeViewEditor <Meta-b> {
- %W icursor [blt::TreeView::PreviousWord %W insert]
- %W selection clear
- }
- bind TreeViewEditor <Meta-d> {
- %W delete insert [blt::TreeView::NextWord %W insert]
- }
- bind TreeViewEditor <Meta-f> {
- %W icursor [blt::TreeView::NextWord %W insert]
- %W selection clear
- }
- bind TreeViewEditor <Meta-BackSpace> {
- %W delete [blt::TreeView::PreviousWord %W insert] insert
- }
- bind TreeViewEditor <Meta-Delete> {
- %W delete [blt::TreeView::PreviousWord %W insert] insert
- }
- # tkEntryNextWord -- Returns the index of the next word position
- # after a given position in the entry. The next word is platform
- # dependent and may be either the next end-of-word position or the
- # next start-of-word position after the next end-of-word position.
- #
- # Arguments:
- # w - The entry window in which the cursor is to move.
- # start - Position at which to start search.
-
- if {![string compare $tcl_platform(platform) "windows"]} {
- proc blt::TreeView::NextWord {w start} {
- set pos [tcl_endOfWord [$w get] [$w index $start]]
- if {$pos >= 0} {
- set pos [tcl_startOfNextWord [$w get] $pos]
- }
- if {$pos < 0} {
- return end
- }
- return $pos
- }
- } else {
- proc blt::TreeView::NextWord {w start} {
- set pos [tcl_endOfWord [$w get] [$w index $start]]
- if {$pos < 0} {
- return end
- }
- return $pos
- }
- }
-
- # PreviousWord --
- #
- # Returns the index of the previous word position before a given
- # position in the entry.
- #
- # Arguments:
- # w - The entry window in which the cursor is to move.
- # start - Position at which to start search.
-
- proc blt::TreeView::PreviousWord {w start} {
- set pos [tcl_startOfPreviousWord [$w get] [$w index $start]]
- if {$pos < 0} {
- return 0
- }
- return $pos
- }
-}
-
diff --git a/blt3.0.1/library/treeview.xbm b/blt3.0.1/library/treeview.xbm
deleted file mode 100644
index 9bc935a..0000000
--- a/blt3.0.1/library/treeview.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define test_width 16
-#define test_height 16
-#define test_x_hot 7
-#define test_y_hot 7
-static unsigned char test_bits[] = {
- 0x00, 0x00, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x64, 0x26,
- 0x66, 0x66, 0x7f, 0xfe, 0x66, 0x66, 0x64, 0x26, 0x60, 0x06, 0x60, 0x06,
- 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x00, 0x00};
diff --git a/blt3.0.1/library/treeview_m.xbm b/blt3.0.1/library/treeview_m.xbm
deleted file mode 100644
index 9ba8767..0000000
--- a/blt3.0.1/library/treeview_m.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define testm_width 16
-#define testm_height 16
-#define testm_x_hot 7
-#define testm_y_hot 7
-static unsigned char testm_bits[] = {
- 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xfc, 0x3f, 0xfe, 0x7f,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfc, 0x3f, 0xf0, 0x0f,
- 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f};
diff --git a/blt3.0.1/library/unixButton.tcl b/blt3.0.1/library/unixButton.tcl
deleted file mode 100644
index 1f9cdc6..0000000
--- a/blt3.0.1/library/unixButton.tcl
+++ /dev/null
@@ -1,180 +0,0 @@
-
-#####################
-# Unix implementation
-#####################
-
-bind TkCheckbutton <Return> {
- if {!$tk_strictMotif} {
- blt::Button::CheckRadioInvoke %W
- }
-}
-
-bind TkRadiobutton <Return> {
- if {!$tk_strictMotif} {
- blt::Button::CheckRadioInvoke %W
- }
-}
-
-bind TkPushbutton <Return> {
- if {!$tk_strictMotif} {
- blt::Button::CheckRadioInvoke %W
- }
-}
-
-bind TkCheckbutton <1> {
- blt::Button::CheckRadioInvoke %W
-}
-
-bind TkRadiobutton <1> {
- blt::Button::CheckRadioInvoke %W
-}
-
-bind TkPushbutton <1> {
- blt::Button::CheckRadioInvoke %W
-}
-
-bind TkCheckbutton <Enter> {
- blt::Button::Enter %W
-}
-
-bind TkRadiobutton <Enter> {
- blt::Button::Enter %W
-}
-
-bind TkPushbutton <Enter> {
- blt::Button::Enter %W
-}
-
-# Enter --
-#
-# The procedure below is invoked when the mouse pointer enters a
-# button widget. It records the button we're in and changes the
-# state of the button to active unless the button is disabled.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Enter {w} {
- variable _private
- if { [$w cget -state] != "disabled" } {
- # On unix the state is active just with mouse-over
- $w configure -state active
-
- # If the mouse button is down, set the relief to sunken on entry.
- # Overwise, if there's an -overrelief value, set the relief to that.
-
- set _private($w,relief) [$w cget -relief]
- if {$_private(buttonWindow) eq $w} {
- $w configure -relief sunken
- set _private($w,prelief) sunken
- } elseif {[set over [$w cget -overrelief]] ne ""} {
- $w configure -relief $over
- set _private($w,prelief) $over
- }
- }
- set _private(window) $w
-}
-
-# Leave --
-#
-# The procedure below is invoked when the mouse pointer leaves a
-# button widget. It changes the state of the button back to inactive.
-# Restore any modified relief too.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Leave w {
- variable _private
- if {[$w cget -state] != "disabled"} {
- $w configure -state normal
- }
-
- # Restore the original button relief if it was changed by Tk.
- # That is signaled by the existence of _private($w,prelief).
-
- if {[info exists _private($w,relief)]} {
- if {[info exists _private($w,prelief)] && \
- $_private($w,prelief) eq [$w cget -relief]} {
- $w configure -relief $_private($w,relief)
- }
- unset -nocomplain _private($w,relief) _private($w,prelief)
- }
-
- set _private(window) ""
-}
-
-# Down --
-#
-# The procedure below is invoked when the mouse button is pressed in
-# a button widget. It records the fact that the mouse is in the button,
-# saves the button's relief so it can be restored later, and changes
-# the relief to sunken.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Down w {
- variable _private
-
- # Only save the button's relief if it does not yet exist. If there
- # is an overrelief setting, Priv($w,relief) will already have been set,
- # and the current value of the -relief option will be incorrect.
-
- if {![info exists _private($w,relief)]} {
- set _private($w,relief) [$w cget -relief]
- }
-
- if {[$w cget -state] != "disabled"} {
- set _private(buttonWindow) $w
- $w configure -relief sunken
- set _private($w,prelief) sunken
-
- # If this button has a repeatdelay set up, get it going with an after
- after cancel $_private(afterId)
- set delay [$w cget -repeatdelay]
- set _private(repeated) 0
- if {$delay > 0} {
- set cmd [list blt::Button::AutoInvoke $w]
- set _private(afterId) [after $delay $cmd]
- }
- }
-}
-
-# Up --
-#
-# The procedure below is invoked when the mouse button is released
-# in a button widget. It restores the button's relief and invokes
-# the command as long as the mouse hasn't left the button.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Up w {
- variable _private
- if {$w eq $_private(buttonWindow)} {
- set _private(buttonWindow) ""
-
- # Restore the button's relief if it was cached.
-
- if {[info exists _private($w,relief)]} {
- if {[info exists _private($w,prelief)] && \
- $_private($w,prelief) eq [$w cget -relief]} {
- $w configure -relief $_private($w,relief)
- }
- unset -nocomplain _private($w,relief) _private($w,prelief)
- }
-
- # Clean up the after event from the auto-repeater
- after cancel $_private(afterId)
-
- if {$_private(window) eq $w && [$w cget -state] != "disabled"} {
- # Only invoke the command if it wasn't already invoked by the
- # auto-repeater functionality
- if { $_private(repeated) == 0 } {
- uplevel #0 [list $w invoke]
- }
- }
- }
-}
-
diff --git a/blt3.0.1/library/winButton.tcl b/blt3.0.1/library/winButton.tcl
deleted file mode 100644
index 42ce38b..0000000
--- a/blt3.0.1/library/winButton.tcl
+++ /dev/null
@@ -1,240 +0,0 @@
-#########################
-# Windows implementation
-#########################
-
-bind TkCheckbutton <equal> {
- blt::Button::CheckRadioInvoke %W select
-}
-
-bind TkCheckbutton <plus> {
- blt::Button::CheckRadioInvoke %W select
-}
-
-bind TkCheckbutton <minus> {
- blt::Button::CheckRadioInvoke %W deselect
-}
-
-bind TkCheckbutton <1> {
- blt::Button::CheckRadioDown %W
-}
-
-bind TkCheckbutton <ButtonRelease-1> {
- blt::Button::Up %W
-}
-
-bind TkCheckbutton <Enter> {
- blt::Button::CheckRadioEnter %W
-}
-
-bind TkRadiobutton <1> {
- blt::Button::CheckRadioDown %W
-}
-
-bind TkRadiobutton <ButtonRelease-1> {
- blt::Button::Up %W
-}
-
-bind TkRadiobutton <Enter> {
- blt::Button::CheckRadioEnter %W
-}
-
-bind TkPushbutton <equal> {
- blt::Button::CheckRadioInvoke %W select
-}
-
-bind TkPushbutton <plus> {
- blt::Button::CheckRadioInvoke %W select
-}
-
-bind TkPushbutton <minus> {
- blt::Button::CheckRadioInvoke %W deselect
-}
-
-bind TkPushbutton <1> {
- blt::Button::CheckRadioDown %W
-}
-
-bind TkPushbutton <ButtonRelease-1> {
- blt::Button::Up %W
-}
-
-bind TkPushbutton <Enter> {
- blt::Button::CheckRadioEnter %W
-}
-
-# Enter --
-#
-# The procedure below is invoked when the mouse pointer enters a
-# button widget. It records the button we're in and changes the
-# state of the button to active unless the button is disabled.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Enter w {
- variable _private
- if {[$w cget -state] != "disabled"} {
-
- # If the mouse button is down, set the relief to sunken on entry.
- # Overwise, if there's an -overrelief value, set the relief to that.
- set _private($w,relief) [$w cget -relief]
- if { $_private(buttonWindow) == $w } {
- $w configure -relief sunken -state active
- set _private($w,prelief) sunken
- } elseif {[set over [$w cget -overrelief]] ne ""} {
- $w configure -relief $over
- set _private($w,prelief) $over
- }
- }
- set _private(window) $w
-}
-
-# Leave --
-# The procedure below is invoked when the mouse pointer leaves a
-# button widget. It changes the state of the button back to inactive.
-# Restore any modified relief too.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Leave w {
- variable _private
- if {[$w cget -state] != "disabled"} {
- $w configure -state normal
- }
-
- # Restore the original button relief if it was changed by Tk.
- # That is signaled by the existence of _private($w,prelief).
-
- if { [info exists _private($w,relief)] } {
- if {[info exists _private($w,prelief)] && \
- $_private($w,prelief) eq [$w cget -relief]} {
- $w configure -relief $_private($w,relief)
- }
- unset -nocomplain _private($w,relief) _private($w,prelief)
- }
- set _private(window) ""
-}
-
-# Down --
-#
-# The procedure below is invoked when the mouse button is pressed in
-# a button widget. It records the fact that the mouse is in the button,
-# saves the button's relief so it can be restored later, and changes
-# the relief to sunken.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Down w {
- variable _private
-
- # Only save the button's relief if it does not yet exist. If there
- # is an overrelief setting, Priv($w,relief) will already have been set,
- # and the current value of the -relief option will be incorrect.
-
- if {![info exists _private($w,relief)]} {
- set _private($w,relief) [$w cget -relief]
- }
- if {[$w cget -state] != "disabled"} {
- set _private(buttonWindow) $w
- $w configure -relief sunken -state active
- set _private($w,prelief) sunken
-
- # If this button has a repeatdelay set up, get it going with an after
- after cancel $_private(afterId)
- set delay [$w cget -repeatdelay]
- set _private(repeated) 0
- if {$delay > 0} {
- set cmd [list blt::Button::AutoInvoke $w]
- set _private(afterId) [after $delay $cmd]
- }
- }
-}
-
-# Up --
-#
-# The procedure below is invoked when the mouse button is released in
-# a button widget. It restores the button's relief and invokes the
-# command as long as the mouse hasn't left the button.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::Up { w } {
- variable _private
- if { $_private(buttonWindow) == $w } {
- set _private(buttonWindow) ""
-
- # Restore the button's relief if it was cached.
- if { [info exists _private($w,relief)] } {
- if {[info exists _private($w,prelief)] && \
- $_private($w,prelief) eq [$w cget -relief]} {
- $w configure -relief $_private($w,relief)
- }
- unset -nocomplain _private($w,relief) _private($w,prelief)
- }
-
- # Clean up the after event from the auto-repeater
- after cancel $_private(afterId)
-
- if {$_private(window) eq $w && [$w cget -state] != "disabled"} {
- $w configure -state normal
-
- # Only invoke the command if it wasn't already invoked by the
- # auto-repeater functionality
- if { $_private(repeated) == 0 } {
- uplevel #0 [list $w invoke]
- }
- }
- }
-}
-
-# CheckRadioEnter --
-#
-# The procedure below is invoked when the mouse pointer enters a
-# checkbutton or radiobutton widget. It records the button we're in
-# and changes the state of the button to active unless the button is
-# disabled.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::CheckRadioEnter w {
- variable _private
- if { [$w cget -state] != "disabled" } {
- if { $_private(buttonWindow) == $w } {
- $w configure -state active
- }
- if {[set over [$w cget -overrelief]] ne ""} {
- set _private($w,relief) [$w cget -relief]
- set _private($w,prelief) $over
- $w configure -relief $over
- }
- }
- set _private(window) $w
-}
-
-# CheckRadioDown --
-#
-# The procedure below is invoked when the mouse button is pressed in
-# a button widget. It records the fact that the mouse is in the button,
-# saves the button's relief so it can be restored later, and changes
-# the relief to sunken.
-#
-# Arguments:
-# w - The name of the widget.
-
-proc ::blt::Button::CheckRadioDown w {
- variable _private
- if {![info exists _private($w,relief)]} {
- set _private($w,relief) [$w cget -relief]
- }
- if {[$w cget -state] != "disabled"} {
- set _private(buttonWindow) $w
- set _private(repeated) 0
- $w configure -state active
- }
-}
-
-}
diff --git a/blt3.0.1/man/BLT.mann b/blt3.0.1/man/BLT.mann
deleted file mode 100644
index 1593029..0000000
--- a/blt3.0.1/man/BLT.mann
+++ /dev/null
@@ -1,153 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-.so man.macros
-.TH intro n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-BLT \- Introduction to the BLT library
-.BE
-.SH DESCRIPTION
-BLT is a library of extensions to the Tk library. It adds new
-commands and variables to the application's interpreter.
-.LP
-.SH COMMANDS
-The following commands are added to the interpreter from the BLT library:
-.TP 15
-\fBtable\fR
-A table geometry manager for Tk. You specify window placements as table
-row,column positions and windows can also span multiple rows or columns.
-It also has many options for setting and/or bounding window sizes.
-.TP 15
-\fBgraph\fR
-A 2D plotting widget. Plots two variable data in a window with an optional
-legend and annotations. It has of several components; coordinate axes,
-crosshairs, a legend, and a collection of elements and tags.
-.TP 15
-\fBbarchart\fR
-A barchart widget. Plots two-variable data as rectangular bars in a
-window. The x-coordinate values designate the position of the bar along
-the x-axis, while the y-coordinate values designate the magnitude.
-The \fBbarchart\fR widget has of several components; coordinate axes,
-crosshairs, a legend, and a collection of elements and tags.
-.TP 15
-\fBvector\fR
-Creates a vector of floating point values. The vector's components
-can be manipulated in three ways: through a Tcl array variable, a Tcl
-command, or the C API.
-.TP
-\fBspline\fR
-Computes a spline fitting a set of data points (x and y vectors) and
-produces a vector of the interpolated images (y-coordinates) at a
-given set of x-coordinates.
-.TP 15
-\fBbgexec\fR
-Like Tcl's \fBexec\fR command, \fBbgexec\fR runs a pipeline of Unix
-commands in the background. Unlike \fBexec\fR, the output of the last
-process is collected and a global Tcl variable is set upon its completion.
-\fBbgexec\fR can be used with \fBtkwait\fR to wait for Unix commands
-to finish while still handling expose events. Intermediate output is
-also available while the pipeline is active.
-.TP 15
-\fBbusy\fR
-Creates a "busy window" which prevents user-interaction when an
-application is busy. The busy window also provides an easy way
-to have temporary busy cursors (such as a watch or hourglass).
-.TP 15
-\fBbitmap\fR
-Reads and writes bitmaps from Tcl. New X bitmaps can be defined
-on-the-fly from Tcl, obviating the need to copy around bitmap files.
-Other options query loaded X bitmap's dimensions and data.
-.TP 15
-\fBdrag&drop\fR
-Provides a drag-and-drop facility for Tk. Information (represented
-by a token window) can be dragged to and from any Tk window, including
-those of another Tk application. \fBdrag&drop\fR acts as a
-coordinator, directing Tk \fBsend\fR commands between (or within) TCL/Tk
-applications.
-.TP 15
-\fBhtext\fR
-A simple hypertext widget. Combines text and Tk widgets into a single
-scroll-able window. Tcl commands can be embedded into text, which are
-invoked as the text is parsed. In addition, Tk widgets can be
-appended to the window at the current point in the text. \fBHtext\fR
-can be also used to create scrolled windows of Tk widgets.
-.TP 15
-\fBwinop\fR
-Raise, lower, map, or, unmap any window. The raise and lower functions
-are useful for stacking windows above or below "busy windows".
-.TP 15
-\fBwatch\fR
-Arranges for Tcl procedures to be called before and/or after the execution
-of every Tcl command. This command
-may be used in the logging, profiling, or tracing of Tcl code.
-.TP 15
-\fBbltdebug\fR
-A simple Tcl command tracing facility useful for debugging Tcl code.
-Displays each Tcl command before and after substitution along its level
-in the interpreter on standard error.
-.SH VARIABLES
-.PP
-The following Tcl variables are either set or used by BLT at various times
-in its execution:
-.TP 15
-\fBblt_library\fR
-This variable contains the name of a directory containing a library
-of Tcl scripts and other files related to BLT. Currently, this
-directory contains the \fBdrag&drop\fR protocol scripts and the
-PostScript prolog
-used by \fBgraph\fR and \fBbarchart\fR.
-The value of this variable is taken from the BLT_LIBRARY environment
-variable, if one exists, or else from a default value compiled into
-the \fBBLT\fR library.
-.TP 15
-\fBblt_versions\fR
-This variable is set in the interpreter for each application. It is an
-array of the current version numbers for each
-of the BLT commands in the form \fImajor\fR.\fIminor\fR. \fIMajor\fR and
-\fIminor\fR are integers. The major version number increases in
-any command that includes changes that are not backward compatible
-(i.e. whenever existing applications and scripts may have to change to
-work with the new release). The minor version number increases with
-each new release of a command, except that it resets to zero whenever the
-major version number changes. The array is indexed by the individual
-command name.
-.SH ADDING BLT TO YOUR APPLICATIONS
-It's easy to add BLT to an existing Tk application. BLT requires no
-patches or edits to the Tcl or Tk libraries. To add BLT, simply add the
-following code snippet to your application's tkAppInit.c file.
-.CS
-if (Blt_Init(interp) != TCL_OK) {
- return TCL_ERROR;
-}
-.CE
-Recompile and link with the BLT library (libBLT.a) and that's it.
-.PP
-Alternately, you can dynamically load BLT, simply by invoking the
-command
-.CS
-package require BLT
-.CE
-from your Tcl script.
-.SH BUGS
-Send bug reports, requests, suggestions, etc. to
-gah at siliconmetrics.com or ghowlett at grandecom.net
-.SH KEYWORDS
-BLT
diff --git a/blt3.0.1/man/Blt_Tree.man3 b/blt3.0.1/man/Blt_Tree.man3
deleted file mode 100644
index 09a9169..0000000
--- a/blt3.0.1/man/Blt_Tree.man3
+++ /dev/null
@@ -1,232 +0,0 @@
-'\"
-'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
-'\"
-'\" See the file "license.terms" for information on usage and redistribution
-'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-'\"
-'\" RCS: @(#) $Id: Blt_Tree.man3,v 1.1.1.1 2010/10/27 21:57:06 joye Exp $
-'\"
-.so man.macros
-.TH Blt_Tree 3 BLT_VERSION BLT "Blt Library Procedures"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-Blt_Tree \- Tree data object.
-.SH SYNOPSIS
-.nf
-#include <bltTree.h>
-.sp
-struct Blt_Tree {
-\fBTcl_Alloc\fR(\fIsize\fR)
-.sp
-\fBTcl_Free\fR(\fIptr\fR)
-.sp
-char *
-\fBTcl_Realloc\fR(\fIptr, size\fR)
-.SH ARGUMENTS
-.AS char *size
-.AP int size in
-Size in bytes of the memory block to allocate.
-.AP char *ptr in
-Pointer to memory block to free or realloc.
-.BE
-
-.SH DESCRIPTION
-.PP
-These procedures provide a platform and compiler independent interface
-for memory allocation. Programs that need to transfer ownership of
-memory blocks between Tcl and other modules should use these routines
-rather than the native \fBmalloc()\fR and \fBfree()\fR routines
-provided by the C run-time library.
-.PP
-\fBTcl_Alloc\fR returns a pointer to a block of at least \fIsize\fR
-bytes suitably aligned for any use.
-.PP
-\fBTcl_Free\fR makes the space referred to by \fIptr\fR available for
-further allocation.
-.PP
-\fBTcl_Realloc\fR changes the size of the block pointed to by
-\fIptr\fR to \fIsize\fR bytes and returns a pointer to the new block.
-The contents will be unchanged up to the lesser of the new and old
-sizes. The returned location may be different from \fIptr\fR.
-.SH TREE OBJECT ROUTINES
-The following library routines allow you to create and destroy tree
-objects. Each tree object has a name that uniquely identifies it.
-Tree objects can also be shared. For example, the \fBtree\fR
-and \fBhiertable\fR commands may access the same tree data object.
-Each client grabs a token associated with the tree. When all tokens
-are released the tree data object is automatically destroyed.
-.TP 2.0i
-\fBBlt_TreeCreate\fR
-Create a tree data object and optionally obtains a token associated
-with it.
-.TP
-\fBBlt_TreeExists\fR
-Indicates if a tree by a given name exists.
-.TP
-\fBBlt_TreeGetToken\fR
-Obtains a token for an existing tree data object.
-.TP
-\fBBlt_TreeReleaseToken\fR
-Releases a token for a tree data object. The tree object is deleted
-when all outstanding tokens have been released.
-.TP
-\fBBlt_TreeName\fR
-Returns the name of the tree object.
-.TP
-\fBBlt_TreeChangeRoot\fR
-Specifies a node as the new root to a tree.
-.SH TREENODE ROUTINES
-Tree objects initially contain only a root node. You can add or
-delete nodes with the following routines.
-.TP 2i
-\fBBlt_TreeCreateNode\fR
-Creates a new child node for a given parent in the tree.
-.TP
-\fBBlt_TreeDeleteNode\fR
-Deletes a node and its children.
-.TP
-\fBBlt_TreeNodeId\fR
-Returns the unique node identifier for a node.
-.TP
-\fBBlt_TreeGetNode\fR
-Gets a node based upon its identifier.
-.TP
-\fBBlt_TreeFindChild\fR
-Searches for a child node given by its label in a parent node.
-.TP
-\fBBlt_TreeNodeLabel\fR
-Returns the current label for a node.
-.TP
-\fBBlt_TreeRelabelNode\fR
-Resets a node's label.
-.TP
-\fBBlt_TreeNodePath\fR
-Returns the fullpath to a node.
-.TP
-\fBBlt_TreeNodeDepth\fR
-Returns the depth of the node.
-.TP
-\fBBlt_TreeNodeDegree\fR
-Returns the number of children for a node.
-.TP
-\fBBlt_TreeIsLeaf\fR
-Indicates if a node has no children.
-.TP
-\fBBlt_TreeIsBefore\fR
-Indicates if a node is before another node in depth-first search order.
-.TP
-\fBBlt_TreeIsAncestor\fR
-Indicates if a node is an ancestor or another.
-.TP
-\fBBlt_TreeSortNode\fR
-Sorts the children of a node.
-.TP
-\fBBlt_TreeSize\fR
-Returns the number of nodes in a node and its descendants.
-.TP
-\fBBlt_TreeMoveNode\fR
-.SH NODE NAVIGATION
-Each node can have zero or more children nodes. These routines
-let you navigate the tree hierarchy.
-.TP 2i
-\fBBlt_TreeNodeParent\fR
-Returns the parent node.
-.TP
-\fBBlt_TreeFirstChild\fR
-Returns the first child of a parent node.
-.TP
-\fBBlt_TreeLastChild\fR
-Returns the last child of a parent node.
-.TP
-\fBBlt_TreeNextSibling\fR
-Returns the next sibling node in the parent's list of children.
-.TP
-\fBBlt_TreePrevSibling\fR
-Returns the previous sibling node in the parent's list of children.
-.TP
-\fBBlt_TreeRootNode\fR
-Returns the root node of the tree.
-.TP
-\fBBlt_TreeNextNode\fR
-Returns the next node in depth-first order.
-.TP
-\fBBlt_TreePrevNode\fR
-Returns the previous node in depth-first order.
-.TP
-\fBBlt_TreeEndNode\fR
-Returns the last node in the tree as determined by depth-first order.
-.TP
-\fBBlt_TreeApply\fR
-Walks through a node and all it descendants, applying a given
-callback procedure.
-.TP
-\fBBlt_TreeApplyDFS\fR
-Walks through a node and all it descendants in depth-first search
-order, applying a given callback procedure.
-.TP
-\fBBlt_TreeApplyBFS\fR
-Walks through a node and all it descendants in breadth-first search
-order, applying a given callback procedure.
-.SH NODE DATA VALUES
-Data values can be stored at any node. Values have by both a string
-key and a Tcl_Obj value. Data value keys do not have to be homogenous
-across all nodes (i.e. nodes do not have to contain the same keys).
-There is also a special node array data type.
-.TP 2i
-\fBBlt_TreeGetValue\fR
-Gets the node data value given by a key.
-.TP
-\fBBlt_TreeValueExists\fR
-Indicates if a node data value given by a key exists.
-.TP
-\fBBlt_TreeSetValue\fR
-Sets a node's value of a key.
-.TP
-\fBBlt_TreeUnsetValue\fR
-Remove the node data value and key.
-.TP
-\fBBlt_TreeGetArrayValue\fR
-Gets the node data array value given by a key and an array index.
-.TP
-\fBBlt_TreeSetArrayValue\fR
-Sets the node data array value given by a key and an array index.
-.TP
-\fBBlt_TreeUnsetArrayValue\fR
-Remove the node data array value.
-.TP
-\fBBlt_TreeArrayValueExists\fR
-Determines if an array element by a given index exists.
-.TP
-\fBBlt_TreeFirstKey\fR
-Returns the key of the first value in the node.
-.TP
-\fBBlt_TreeNextKey\fR
-Returns the key of the next value in the node.
-.TP
-\fBBlt_TreePrivateValue\fR
-Lock the value to current client, making it private.
-.TP
-\fBBlt_TreePublicValue\fR
-Unlock the value so that all clients can access it.
-.TP
-\fBBlt_TreeGetKey\fR
-.SH NODE TRACES
-.TP 2i
-\fBBlt_TreeCreateTrace\fR
-Sets up a trace callback to be invoked when the node value is
-read, set, or unset.
-.TP
-\fBBlt_TreeDeleteTrace\fR
-Deletes an existing trace.
-.SH NODE EVENTS
-.TP 2i
-\fBBlt_TreeCreateEventHandler\fR
-Sets up a callback to be invoked when events (create, delete,
-relabel, etc) take place on a node.
-.TP
-\fBBlt_TreeDeleteEventHandler\fR
-Deletes an existing node callback.
-.SH KEYWORDS
-alloc, allocation, free, malloc, memory, realloc
-
diff --git a/blt3.0.1/man/Blt_TreeCreate.man3 b/blt3.0.1/man/Blt_TreeCreate.man3
deleted file mode 100644
index fd45537..0000000
--- a/blt3.0.1/man/Blt_TreeCreate.man3
+++ /dev/null
@@ -1,100 +0,0 @@
-'\"
-'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\"
-.so man.macros
-.TH Blt_TreeCreate 3 BLT_VERSION BLT "BLT Library Procedures"
-.BS
-.SH NAME
-Blt_TreeCreate \- Create tree data object.
-.SH SYNOPSIS
-.nf
-\fB#include <bltTree.h>\fR
-.sp
-int
-\fBBlt_TreeCreate\fR(\fIinterp\fR, \fIname\fR, \fItokenPtr\fR)
-.SH ARGUMENTS
-.AS Tcl_Interp *interp
-.AP Tcl_Interp *interp in
-Interpreter to report results back to.
-.AP "const char" *name in
-Name of the new tree. Can be qualified by a namespace.
-.AP Blt_Tree *tokenPtr out
-If not NULL, points to location to store the client tree token.
-.BE
-.SH DESCRIPTION
-.PP
-This procedure creates a C-based tree data object and optionally
-returns a token to it. The arguments are as follows:
-.TP 1i
-\fIinterp\fR
-Interpreter to report results back to. If an error occurs, then
-interp->result will contain an error message.
-.TP 1i
-\fIname\fR
-Name of the new tree object. You can think of \fIname\fR as
-the memory address of the object. It's a unique name that identifies
-the tree object. No tree object \fIname\fR
-can already exist. \fIName\fR can be qualified by a namespace such
-as \f(CWfred::myTree\fR. If no namespace qualifier is used, the tree
-will be created in the current namespace, not the global namespace.
-If a qualifier is present, the namespace must already exist.
-.TP 1i
-\fItokenPtr\fR
-Holds the returned token. \fITokenPtr\fR points to a location
-where it is stored. Tree tokens are used to work with the tree object.
-If NULL, no token is allocated. You can later use
-\fBTcl_TreeGetToken\fR to obtain a token.
-.PP
-The new tree data object created will initially contain only a root
-node. You can add new nodes with \fBBlt_TreeCreateNode\fR.
-.PP
-Optionally a token for the tree data object is returned. Tree data
-objects can be shared. For example, the \fBtree\fR and
-\fBhiertable\fR commands may be accessing the same tree data object.
-Each client grabs a token that is associated with the tree. When all
-tokens are released (see \fBBlt_TreeReleaseToken\fR) the tree data
-object is automatically destroyed.
-.PP
-.SH RETURNS
-A standard Tcl result is returned. If TCL_ERROR is returned, then
-\fIinterp->result\fR will contain an error message. The following
-errors may occur:
-.IP \(bu 3
-There already exists a tree by the same name as \fIname\fR. You can
-use \fBTcl_TreeExists\fR to determine if a tree exists beforehand.
-.IP \(bu
-The tree name is prefixed by a namespace that doesn't exist. If you
-qualified the tree name with a namespace, the namespace must exist.
-Unlike Tcl procs and variables, the namespace is not automatically
-created for you.
-.IP \(bu
-Memory can't be allocated for the tree or token.
-.SH EXAMPLE
-The following example creates a new
-.CS
-Blt_Tree token;
-
-if (Blt_TreeCreate(interp, "myTree", &token) != TCL_OK) {
- return TCL_ERROR;
-}
-printf("tree is %s\\n", Blt_TreeName(token));
-.CE
-.SH KEYWORDS
-Tcl_TreeGetToken, Tcl_TreeExists, Tcl_TreeReleaseToken
diff --git a/blt3.0.1/man/Blt_TreeCreateNode.man3 b/blt3.0.1/man/Blt_TreeCreateNode.man3
deleted file mode 100644
index 2e8b6bb..0000000
--- a/blt3.0.1/man/Blt_TreeCreateNode.man3
+++ /dev/null
@@ -1,95 +0,0 @@
-'\"
-'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\"
-.so man.macros
-.TH Blt_TreeCreateNode 3 BLT_VERSION BLT "BLT Library Procedures"
-.BS
-.SH NAME
-Blt_TreeCreateNode \- Creates a node in a tree data object.
-.SH SYNOPSIS
-.nf
-#include <bltTree.h>
-.sp
-Blt_TreeNode
-\fBBlt_TreeCreateNode\fR(\fItree\fR, \fIparent\fR, \fIname\fR, \fIposition\fR)
-.SH ARGUMENTS
-.AS Blt_TreeNode parent
-.AP Blt_Tree tree in
-Tree containing the parent node.
-.AP Blt_TreeNode parent in
-Node in which to insert the new child.
-.AP "const char" *name in
-Node label. If NULL, a label will automatically be generated.
-.AP int position in
-Position in the parent's list of children to insert the new node.
-.BE
-.SH DESCRIPTION
-.PP
-This procedure creates a new node is a tree data object. The node
-is initially empty, but data values can be added with
-\fBBlt_TreeSetValue\fR. Each node has a serial number that identifies it
-within the tree. No two nodes in the same tree will ever have the
-same ID. You can find a node's ID with \fBBlt_TreeNodeId\fR.
-.PP
-The arguments are as follows:
-.TP 1i
-\fItree\fR
-The tree containing the parent node.
-.TP
-\fIparent\fR
-Node in which the new child will be inserted.
-.TP
-\fIname\fR
-Label of the new node. If \fIname\fR is NULL, a label in the
-form "\f(CWnode0\fR", "\f(CWnode1\fR", etc. will automatically be
-generated. \fIName\fR can be any string. Labels are non-unique. A
-parent can contain two nodes with the same label. Nodes can be
-relabeled using \fBBlt_TreeRelabelNode\fR.
-.TP
-\fIposition\fR
-Position the parent's list of children to insert the new node. For
-example, if \fIposition\fR is 0, then the new node is prepended to the
-beginning of the list. If \fIposition\fR is -1, then the node is
-appended onto the end of the parent's list.
-.PP
-.SH RETURNS
-The new node returned is of type \fBBlt_TreeNode\fR. It's a token
-that can be used with other routines to add/delete data values or
-children nodes.
-.SH EXAMPLE
-The following example creates a new node from the root node.
-.CS
-Blt_Tree token;
-Blt_TreeNode root, node;
-
-if (Blt_TreeGetToken(interp, "myTree", &token) != TCL_OK) {
- return TCL_ERROR;
-}
-root = Blt_TreeRootNode(token);
-node = Blt_TreeCreateNode(token, root, "myNode", -1);
-.CE
-.SH NOTIFICATIONS
-\fBBlt_TreeCreateNode\fR can trigger tree notify events.
-You can be notified whenever a node is created by using the
-\fBBlt_TreeCreateNotifyHandler\fR. A callback routine is registered
-that will be automatically invoked whenever a new node is added
-via \fBBlt_TreeCreateNode\fR to the tree.
-.SH KEYWORDS
-tree, token
diff --git a/blt3.0.1/man/Blt_TreeDeleteNode.man3 b/blt3.0.1/man/Blt_TreeDeleteNode.man3
deleted file mode 100644
index 565c5ec..0000000
--- a/blt3.0.1/man/Blt_TreeDeleteNode.man3
+++ /dev/null
@@ -1,75 +0,0 @@
-'\"
-'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\"
-.so man.macros
-.TH Blt_TreeDeleteNode 3 BLT_VERSION BLT "BLT Library Procedures"
-.BS
-.SH NAME
-Blt_TreeDeleteNode \- Deletes a node and its descendants.
-.SH SYNOPSIS
-.nf
-#include <bltTree.h>
-.sp
-Blt_TreeNode
-\fBBlt_TreeDeleteNode\fR(\fItree\fR, \fInode\fR)
-.SH ARGUMENTS
-.AS Blt_TreeNode node
-.AP Blt_Tree tree in
-Tree containing the node.
-.AP Blt_TreeNode node in
-Node to be deleted.
-.BE
-.SH DESCRIPTION
-This procedure deletes a given node and all it descendants from a tree
-data object.
-.PP
-The arguments are as follows:
-.TP 1i
-\fItree\fR
-The tree containing the parent node.
-.TP
-\fInode\fR
-Node to be deleted. The node and its descendant nodes are deleted.
-Each node's data values are deleted also. The reference count of
-the Tcl_Obj is decremented.
-.PP
-Since all tree objects must contain at least a root node, the root
-node itself can't be deleted unless the tree is released and
-destroyed. Therefore you can clear a tree by deleting its root, but
-the root node will remain until the tree is destroyed.
-.SH RETURNS
-Always returns TCL_OK. Errors generated in a notification callbacks
-are backgrounded (see \fBTcl_TreeCreateNotifyHandler\fR).
-.SH EXAMPLE
-The following example deletes the root node.
-.CS
-Blt_TreeNode root;
-
-root = Blt_TreeRootNode(token);
-Blt_TreeDeleteNode(token, root);
-.CE
-.SH NOTIFICATIONS
-\fBBlt_TreeDeleteNode\fR can trigger tree notify events.
-You can be notified whenever a node is deleted by using the
-\fBBlt_TreeCreateNotifyHandler\fR. A callback routine is registered
-that will be automatically invoked whenever a node is deleted
-via \fBBlt_TreeDeleteNode\fR to the tree.
-.SH KEYWORDS
-tree, token
diff --git a/blt3.0.1/man/Blt_TreeExists.man3 b/blt3.0.1/man/Blt_TreeExists.man3
deleted file mode 100644
index 70b257a..0000000
--- a/blt3.0.1/man/Blt_TreeExists.man3
+++ /dev/null
@@ -1,66 +0,0 @@
-'\"
-'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\"
-.so man.macros
-.TH Blt_TreeExists 3 BLT_VERSION BLT "BLT Library Procedures"
-.BS
-.SH NAME
-Blt_TreeExists \- Indicates if a tree exists.
-.SH SYNOPSIS
-.nf
-\fB#include <bltTree.h>\fR
-.sp
-int
-\fBBlt_TreeExists\fR(\fIinterp\fR, \fIname\fR)
-.SH ARGUMENTS
-.AS Tcl_Interp *interp
-.AP Tcl_Interp *interp in
-Interpreter to determine current namespace context.
-.AP "const char" *name in
-Name of an existing tree data object. Can be qualified by a namespace.
-.BE
-.SH DESCRIPTION
-.PP
-This procedure determines if a C-based tree data object exists by
-a given name. The arguments are as follows:
-.TP 1i
-interp
-Used the determine the current namespace context.
-.TP 1i
-name
-Name of an existing tree data object. \fIName\fR can be qualified by
-a namespace such as \f(CWfred::myTree\fR. If no namespace qualifier
-is used, the current namespace is searched, then the global namespace.
-.PP
-.SH RETURNS
-A boolean result is returned. If the tree exists 1 is returned,
-0 otherwise.
-.SH EXAMPLE
-The following example checks if a tree "myTree" exists.
-.CS
-.ft CW
-if (!Blt_TreeExists(interp, "myTree")) {
- fprintf(stderr, "can't find tree \\"myTree\\\\n");
-}
-.ft R
-.CE
-.SH KEYWORDS
-tree, token
-Tcl_TreeCreate, Tcl_TreeGetToken, Tcl_TreeReleaseToken
\ No newline at end of file
diff --git a/blt3.0.1/man/Blt_TreeGetNode.man3 b/blt3.0.1/man/Blt_TreeGetNode.man3
deleted file mode 100644
index 16be9c3..0000000
--- a/blt3.0.1/man/Blt_TreeGetNode.man3
+++ /dev/null
@@ -1,69 +0,0 @@
-'\"
-'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\"
-.so man.macros
-.TH Blt_TreeGetNode 3 BLT_VERSION BLT "BLT Library Procedures"
-.BS
-.SH NAME
-Blt_TreeGetNode \- Finds the node from the ID.
-.SH SYNOPSIS
-.nf
-\fB#include <bltTree.h>\fR
-.sp
-Blt_TreeNode
-\fBBlt_TreeGetNode\fR(\fItree\fR, \fInumber\fR)
-.SH ARGUMENTS
-.AS "unsigned int" number
-.AP Blt_Tree tree in
-Tree containing the requested node.
-.AP "unsigned int" number in
-Serial number of the requested node.
-.BE
-.SH DESCRIPTION
-This procedure returns a node in a tree object
-based upon a give serial number.
-The node is searched using the serial number.
-.PP
-The arguments are as follows:
-.TP 1i
-\fItree\fR
-The tree containing the requested node.
-.TP 1i
-\fInumber\fR
-The serial number of the requested node.
-.SH RETURNS
-The node represented by the given serial number is returned. If no
-node with that ID exists in \fItree\fR then NULL is returned.
-.SH EXAMPLE
-The following example gets the node from a serial number.
-.CS
-unsigned int number;
-Blt_TreeNode node;
-Blt_TreeToken token;
-...
-node = Blt_TreeGetNode(token, number);
-if (node == NULL) {
- printf("no node with ID %d exists\\n", number);
-} else {
- printf("node found: label is %s\\n", Blt_TreeNodeLabel(node));
-}
-.CE
-.SH KEYWORDS
-Tcl_TreeCreateNode, Tcl_TreeDeleteNode
diff --git a/blt3.0.1/man/Blt_TreeGetToken.man3 b/blt3.0.1/man/Blt_TreeGetToken.man3
deleted file mode 100644
index e685db9..0000000
--- a/blt3.0.1/man/Blt_TreeGetToken.man3
+++ /dev/null
@@ -1,88 +0,0 @@
-'\"
-'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\"
-.so man.macros
-.TH Blt_TreeGetToken 3 BLT_VERSION BLT "BLT Library Procedures"
-.BS
-.SH NAME
-Blt_TreeGetToken \- Grabs a token associated with existing tree data object.
-.SH SYNOPSIS
-.nf
-\fB#include <bltTree.h>\fR
-.sp
-int
-\fBBlt_TreeGetToken\fR(\fIinterp\fR, \fIname\fR, \fItokenPtr\fR)
-.SH ARGUMENTS
-.AS Tcl_Interp *interp
-.AP Tcl_Interp *interp in
-Interpreter to report results back to.
-.AP "const char" *name in
-Name of an existing tree data object. Can be qualified by a namespace.
-.AP Blt_Tree *tokenPtr out
-Points to location to store the client tree token.
-.BE
-.SH DESCRIPTION
-.PP
-This procedure obtains a token to a C-based tree data object. The
-arguments are as follows:
-.TP 1i
-\fIinterp\fR
-Interpreter to report results back to. If an error occurs, then
-interp->result will contain an error message.
-.TP 1i
-\fIname\fR
-Name of an existing tree data object. It's an error if a tree
-\fIname\fR doesn't already exist. \fIName\fR can be qualified by
-a namespace such as \f(CWfred::myTree\fR. If no namespace qualifier
-is used, the tree the current namespace is searched, then the global
-namespace.
-.TP 1i
-\fItokenPtr\fR
-Points to the location where the returned token is stored. A tree
-token is used to work with the tree object.
-.PP
-A token for the tree data object is returned. Tree data objects can
-be shared. For example, the \fBtree\fR and \fBhiertable\fR commands
-may be accessing the same tree data object. Each client grabs a token
-that is associated with the tree. When all tokens are released (see
-\fBBlt_TreeReleaseToken\fR) the tree data object is automatically
-destroyed.
-.PP
-.SH RETURNS
-A standard Tcl result is returned. If TCL_ERROR is returned, then
-\fIinterp->result\fR will contain an error message. The following errors
-may occur:
-.IP \(bu 3
-No tree exists as \fIname\fR. You can use \fBTcl_TreeExists\fR to
-determine if a tree exists beforehand.
-.IP \(bu
-Memory can't be allocated for the token.
-.SH EXAMPLE
-The following example allocated a token for an existing tree.
-.CS
-Blt_Tree token;
-
-if (Blt_TreeGetToken(interp, "myTree", &token) != TCL_OK) {
- return TCL_ERROR;
-}
-printf("tree is %s\\n", Blt_TreeName(token));
-.CE
-.SH SEE ALSO
-Tcl_TreeCreate, Tcl_TreeExists, Tcl_TreeReleaseToken
diff --git a/blt3.0.1/man/Blt_TreeName.man3 b/blt3.0.1/man/Blt_TreeName.man3
deleted file mode 100644
index 04dca8d..0000000
--- a/blt3.0.1/man/Blt_TreeName.man3
+++ /dev/null
@@ -1,59 +0,0 @@
-'\"
-'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\"
-.so man.macros
-.TH Blt_TreeName 3 BLT_VERSION BLT "BLT Library Procedures"
-.BS
-.SH NAME
-Blt_TreeName \- Returns the name of the tree data object.
-.SH SYNOPSIS
-.nf
-\fB#include <bltTree.h>\fR
-.sp
-char *
-\fBBlt_TreeName\fR(\fItree\fR)
-.SH ARGUMENTS
-.AS Blt_Tree tree
-.AP Blt_Tree tree in
-Token for the tree object.
-.BE
-.SH DESCRIPTION
-.PP
-This procedure returns the name of the C-based tree data object.
-The arguments are as follows:
-.TP 1i
-\fItree\fR
-Token for the tree object. The token must have been previously
-obtained via \fBBlt_TreeGetToken\fR or \fBBlt_TreeCreate\fR.
-.SH RETURNS
-The name of the tree object is returned. The name will be fully
-qualified with a namespace context.
-.SH EXAMPLE
-The following example prints the name of the new tree.
-.CS
-Blt_Tree token;
-
-if (Blt_TreeCreate(interp, NULL, &token) != TCL_OK) {
- return TCL_ERROR;
-}
-printf("tree is %s\\n", Blt_TreeName(token));
-.CE
-.SH KEYWORDS
-Tcl_TreeGetToken, Tcl_TreeExists, Tcl_TreeReleaseToken
diff --git a/blt3.0.1/man/Blt_TreeNodeId.man3 b/blt3.0.1/man/Blt_TreeNodeId.man3
deleted file mode 100644
index 44fc4ef..0000000
--- a/blt3.0.1/man/Blt_TreeNodeId.man3
+++ /dev/null
@@ -1,58 +0,0 @@
-'\"
-'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\"
-.so man.macros
-.TH Blt_TreeNodeId 3 BLT_VERSION BLT "BLT Library Procedures"
-.BS
-.SH NAME
-Blt_TreeNodeId \- Returns the node serial number.
-.SH SYNOPSIS
-.nf
-\fB#include <bltTree.h>\fR
-.sp
-unsigned int
-\fBBlt_TreeNodeId\fR(\fInode\fR)
-.SH ARGUMENTS
-.AS Blt_TreeNode node
-.AP Blt_TreeNode node in
-Node whose ID is to be returned.
-.BE
-.SH DESCRIPTION
-This procedure returns the node serial number. The node serial number
-is useful for programs that export the tree data object to the Tcl
-programming level. Since node labels (and therefore pathnames) are
-not unique, the ID can be used to uniquely identify a node.
-.PP
-The arguments are as follows:
-.TP 1i
-\fInode\fR
-The node whose serial number is returned. The serial number of
-the root node for example is always 0.
-.SH RETURNS
-The serial number of the node. Nodes are given a unique serial number
-when they are created. You can use the ID to later retrieve the node
-using \fBBlt_TreeGetNode\fR.
-.SH EXAMPLE
-The following example prints the ID of a node.
-.CS
-printf("root ID is %s\\n", Blt_TreeNodeId(node));
-.CE
-.SH KEYWORDS
-Tcl_TreeCreateNode, Tcl_TreeDeleteNode
diff --git a/blt3.0.1/man/Blt_TreeReleaseToken.man3 b/blt3.0.1/man/Blt_TreeReleaseToken.man3
deleted file mode 100644
index e0bd7c3..0000000
--- a/blt3.0.1/man/Blt_TreeReleaseToken.man3
+++ /dev/null
@@ -1,64 +0,0 @@
-'\"
-'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\"
-.so man.macros
-.TH Blt_TreeReleaseToken 3 BLT_VERSION BLT "BLT Library Procedures"
-.BS
-.SH NAME
-Blt_TreeReleaseToken \- Releases token associated with tree object.
-.SH SYNOPSIS
-.nf
-\fB#include <bltTree.h>\fR
-.sp
-int
-\fBBlt_TreeReleaseToken\fR(\fItoken\fR)
-.SH ARGUMENTS
-.AS Blt_Tree token
-.AP Blt_Tree *token in
-Token of tree to be released.
-.BE
-.SH DESCRIPTION
-.PP
-This procedure releases the token associated with a C-based tree data
-object. When all outstanding tokens for a tree data object have been
-released, then the data object itself will be freed. The arguments
-are as follows:
-.TP 1i
-token
-Token of the tree data object to be released. This token was
-initialized either by \fBTcl_TreeGetToken\fI or \fIBlt_TreeCreate\fR
-earlier.
-.SH RETURNS
-Nothing.
-.SH EXAMPLE
-The following example creates and then releases a new token.
-.CS
-Blt_Tree token;
-
-if (Blt_TreeCreate(interp, "myTree", &token) != TCL_OK) {
- return TCL_ERROR;
-}
-printf("tree is %s\\n", Blt_TreeName(token));
-
-/* Tree will be destroyed when the token is released. */
-Blt_TreeReleaseToken(token);
-.CE
-.SH KEYWORDS
-tree, token
diff --git a/blt3.0.1/man/Makefile.in b/blt3.0.1/man/Makefile.in
deleted file mode 100644
index eaf796d..0000000
--- a/blt3.0.1/man/Makefile.in
+++ /dev/null
@@ -1,74 +0,0 @@
-# ------------------------------------------------------------------------
-# Makefile for manual page files
-# ------------------------------------------------------------------------
-
-prefix = @prefix@
-mandir = @mandir@
-manndir = $(mandir)/mann
-man1dir = $(mandir)/man1
-man3dir = $(mandir)/man3
-srcdir = @srcdir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-version = @BLT_VERSION@
-
-instdirs = $(man1dir) $(manndir) $(man3dir)
-
-MAN_N = BLT.n barchart.n beep.n bgexec.n bitmap.n \
- bltdebug.n busy.n container.n cutbuffer.n \
- dragdrop.n eps.n graph.n hierbox.n \
- hiertable.n htext.n spline.n stripchart.n \
- table.n tabset.n tile.n tree.n treeview.n vector.n \
- watch.n winop.n
-
-MAN_3 = Blt_Tree.3 Blt_TreeGetNode.3 \
- Blt_TreeCreate.3 Blt_TreeGetToken.3 \
- Blt_TreeCreateNode.3 Blt_TreeName.3 \
- Blt_TreeDeleteNode.3 Blt_TreeNodeId.3 \
- Blt_TreeExists.3 Blt_TreeReleaseToken.3
-
-MANPAGES = $(MAN_N) $(MAN_3)
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-SHELL = /bin/sh
-RM = rm -rf
-MKDIR_P = @MKDIR_P@
-VPATH = $(srcdir)
-
-all: man.macros $(MANPAGES)
-
-install: mkdirs install-mann install-man3
-
-install-mann: $(MAN_N)
- for i in *.n ; do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(manndir); \
- done
-
-install-man3: $(MAN_3)
- for i in *.3 ; do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(man3dir); \
- done
-
-mkdirs:
- @for i in $(instdirs) ; do \
- echo "$(MKDIR_P) $(DESTDIR)$$i" ; \
- $(MKDIR_P) $(DESTDIR)$$i ; \
- done
-
-.SUFFIXES: .n .mann .3 .man3
-
-.man3.3: $(srcdir)/man.macros
- $(RM) $@
- sed -e "/man\.macros/r $(srcdir)/man.macros" -e '/man\.macros/d' -e 's/BLT_VERSION/$(version)/' $< > $@
-
-.mann.n: $(srcdir)/man.macros
- $(RM) $@
- sed -e "/man\.macros/r $(srcdir)/man.macros" -e '/man\.macros/d' -e 's/BLT_VERSION/$(version)/' $< > $@
-
-clean:
- $(RM) *.3 *.n
-
-distclean: clean
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"* Makefile
-
diff --git a/blt3.0.1/man/barchart.mann b/blt3.0.1/man/barchart.mann
deleted file mode 100644
index ec2b5f4..0000000
--- a/blt3.0.1/man/barchart.mann
+++ /dev/null
@@ -1,2236 +0,0 @@
-'\"
-'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Barchart widget created by Sani Nassif and George Howlett.
-'\"
-.so man.macros
-.TH barchart n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-barchart \- Bar chart for plotting X-Y coordinate data.
-.SH SYNOPSIS
-\fBbarchart\fI \fIpathName \fR?\fIoption value\fR?...
-.BE
-.SH DESCRIPTION
-The \fBbarchart\fR command creates a bar chart for plotting
-two-dimensional data (X-Y coordinates). A bar chart is a graphic means
-of comparing numbers by displaying bars of lengths proportional to the
-y-coordinates of the points they represented. The bar chart has many
-configurable components: coordinate axes, elements, legend, grid
-lines, cross hairs, etc. They allow you to customize the look and
-feel of the graph.
-.SH INTRODUCTION
-The \fBbarchart\fR command creates a new window for plotting
-two-dimensional data (X-Y coordinates), using bars of
-various lengths to represent the data points. The bars are drawn in a
-rectangular area displayed in the center of the new window. This is the
-\fIplotting area\fR. The coordinate axes are drawn in
-the margins surrounding the plotting area. By default, the legend is
-drawn in the right margin. The title is displayed in top margin.
-.PP
-A \fBbarchart\fR widget has several configurable components:
-coordinate axes, data elements, legend, grid, cross hairs, pens,
-postscript, and annotation markers. Each component can be queried or
-modified.
-.TP 1i
-\f(CWaxis\fR
-
-Up to four coordinate axes (two X\-coordinate and two Y\-coordinate
-axes) can be displayed, but you can create and use any number of
-axes. Axes control what region of data is displayed and how the data
-is scaled. Each axis consists of the axis line, title, major and minor
-ticks, and tick labels. Tick labels display the value at each major
-tick.
-.TP 1i
-\f(CWcrosshairs\fR
-Cross hairs are used to position the mouse pointer relative to the X
-and Y coordinate axes. Two perpendicular lines, intersecting at the
-current location of the mouse, extend across the plotting area to the
-coordinate axes.
-.TP 1i
-\f(CWelement\fR
-An element represents a set of data to be plotted. It contains an x
-and y vector of values representing the data points. Each
-data point is displayed as a bar where the length of the bar is
-proportional to the ordinate (Y-coordinate) of the data point.
-The appearance of the bar, such as its color, stipple, or relief
-is configurable.
-.sp
-A special case exists when two or more data points have the same
-abscissa (X-coordinate). By default, the bars are overlayed, one on
-top of the other. The bars are drawn in the order of the element
-display list. But you can also configure the bars to be displayed in
-two other ways. They may be displayed as a stack, where each bar
-(with the same abscissa) is stacked on the previous. Or they can be
-drawn side-by-side as thin bars. The width of each bar is a function
-of the number of data points with the same abscissa.
-.TP 1i
-\f(CWgrid\fR
-Extends the major and minor ticks of the X\-axis and/or Y\-axis across the
-plotting area.
-.TP 1i
-\f(CWlegend\fR
-The legend displays the name and symbol of each data element.
-The legend can be drawn in any margin or in the plotting area.
-.TP 1i
-\f(CWmarker\fR
-Markers are used annotate or highlight areas of the graph. For
-example, you could use a text marker to label a particular data
-point. Markers come in various forms: text strings, bitmaps, connected
-line segments, images, polygons, or embedded widgets.
-.TP 1i
-\f(CWpen\fR
-Pens define attributes for elements. Data elements use pens to
-specify how they should be drawn. A data element may use many pens at
-once. Here the particular pen used for a data point is determined
-from each element's weight vector (see the element's \fB\-weight\fR
-and \fB\-style\fR options).
-.TP 1i
-\f(CWpostscript\fR
-The widget can generate encapsulated PostScript output. This component
-has several options to configure how the PostScript is generated.
-.SH SYNTAX
-.DS
-\fBbarchart \fIpathName \fR?\fIoption value\fR?...
-.DE
-The \fBbarchart\fR command creates a new window \fIpathName\fR and makes
-it into a \fBbarchart\fR widget. At the time this command is invoked, there
-must not exist a window named \fIpathName\fR, but \fIpathName\fR's
-parent must exist. Additional options may be specified on the
-command line or in the option database to configure aspects of the
-graph such as its colors and font. See the \fBconfigure\fR operation
-below for the exact details about what \fIoption\fR and \fIvalue\fR
-pairs are valid.
-.PP
-If successful, \fBbarchart\fR returns the path name of the widget. It
-also creates a new Tcl command by the same name. You can use this
-command to invoke various operations that query or modify the graph.
-The general form is:
-.DS
-\fIpathName \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for the graph are described in
-the
-.SB "BARCHART OPERATIONS"
-section.
-.PP
-The command can also be used to access components of the graph.
-.DS
-\fIpathName component operation\fR ?\fIarg\fR?...
-.DE
-The operation, now located after the name of the component, is the
-function to be performed on that component. Each component has its own
-set of operations that manipulate that component. They will be
-described below in their own sections.
-.SH EXAMPLE
-The \fBbarchart\fR command creates a new bar chart.
-.CS
-# Create a new bar chart. Plotting area is black.
-barchart .b -plotbackground black
-.CE
-A new Tcl command \f(CW.b\fR is created. This command can be used
-to query and modify the bar chart. For
-example, to change the title of the graph to "My Plot", you use the
-new command and the \fBconfigure\fR operation.
-.CS
-# Change the title.
-\&.b configure -title "My Plot"
-.CE
-To add data elements, you use the command and the \fBelement\fR component.
-.CS
-# Create a new element named "e1"
-\&.b element create e1 \\
- -xdata { 1 2 3 4 5 6 7 8 9 10 } \\
- -ydata { 26.18 50.46 72.85 93.31 111.86 128.47 143.14
- 155.85 166.60 175.38 }
-.CE
-The element's X-Y coordinates are specified using lists of
-numbers. Alternately, BLT vectors could be used to hold the X-Y
-coordinates.
-.CS
-# Create two vectors and add them to the barchart.
-vector xVector yVector
-xVector set { 1 2 3 4 5 6 7 8 9 10 }
-yVector set { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 155.85
- 166.60 175.38 }
-\&n.b element create e1 -xdata xVector -ydata yVector
-.CE
-The advantage of using vectors is that when you modify one, the graph
-is automatically redrawn to reflect the new values.
-.CS
-# Change the y coordinate of the first point.
-set yVector(0) 25.18
-.CE
-An element named \f(CWe1\fR is now created in \f(CW.b\fR. It
-is automatically added to the display list of elements. You can
-use this list to control in what order elements are displayed.
-To query or reset the element display list, you use the element's
-\fBshow\fR operation.
-.CS
-# Get the current display list
-set elemList [.b element show]
-# Remove the first element so it won't be displayed.
-\&.b element show [lrange $elemList 0 end]
-.CE
-The element will be displayed by as many bars as there are data points
-(in this case there are ten). The bars will be drawn centered at the
-x-coordinate of the data point. All the bars will have the same
-attributes (colors, stipple, etc). The width of each bar is by
-default one unit. You can change this with using the \fB\-barwidth\fR
-option.
-.CS
-# Change the scale of the x-coordinate data
-xVector set { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 }
-# Make sure we change the bar width too.
-\&.b configure -barwidth 0.2
-.CE
-The height of each bar is proportional to the ordinate (Y-coordinate)
-of the data point.
-.PP
-If two or more data points have the same abscissa (X-coordinate
-value), the bars representing those data points may be drawn in
-various ways.
-The default is to overlay the bars, one on top of the other.
-The ordering is determined from the of element display list. If
-the stacked mode is selected (using the \fB\-barmode\fR configuration
-option), the bars are stacked, each bar above the previous.
-.CS
-# Display the elements as stacked.
-\&.b configure -barmode stacked
-.CE
-If the aligned mode is selected, the bars having the same
-x-coordinates are displayed side by side. The width of each bar is a
-fraction of its normal width, based upon the number of bars with the
-same x-coordinate.
-.CS
-# Display the elements side-by-side.
-\&.b configure -barmode aligned
-.CE
-By default, the element's label in the legend will be also
-\f(CWe1\fR. You can change the label, or specify no legend entry,
-again using the element's \fBconfigure\fR operation.
-.CS
-# Don't display "e1" in the legend.
-\&.b element configure e1 -label ""
-.CE
-You can configure more than just the element's label. An element has
-many attributes such as stipple, foreground and background colors,
-relief, etc.
-.CS
-\&.b element configure e1 -fg red -bg pink \\
- -stipple gray50
-.CE
-Four coordinate axes are automatically created: \f(CWx\fR, \f(CWx2\fR,
-\f(CWy\fR, and \f(CWy2\fR. And by default, elements are mapped onto the
-axes \f(CWx\fR and \f(CWy\fR. This can be changed with the \fB\-mapx\fR
-and \fB\-mapy\fR options.
-.CS
-# Map "e1" on the alternate y axis "y2".
-\&.b element configure e1 -mapy y2
-.CE
-Axes can be configured in many ways too. For example, you change the
-scale of the Y\-axis from linear to log using the \fBaxis\fR component.
-.CS
-# Y-axis is log scale.
-\&.b axis configure y -logscale yes
-.CE
-One important way axes are used is to zoom in on a particular data
-region. Zooming is done by simply specifying new axis limits using
-the \fB\-min\fR and \fB\-max\fR configuration options.
-.CS
-\&.b axis configure x \-min 1.0 \-max 1.5
-\&.b axis configure y \-min 12.0 \-max 55.15
-.CE
-To zoom interactively, you link the\fBaxis configure\fR operations with
-some user interaction (such as pressing the mouse button), using the
-\fBbind\fR command. To convert between screen and graph coordinates,
-use the \fBinvtransform\fR operation.
-.CS
-# Click the button to set a new minimum
-bind .b <ButtonPress-1> {
- %W axis configure x \-min [%W axis invtransform x %x]
- %W axis configure x \-min [%W axis invtransform x %y]
-}
-.CE
-By default, the limits of the axis are determined from data values.
-To reset back to the default limits, set the \fB\-min\fR and
-\fB\-max\fR options to the empty value.
-.CS
-# Reset the axes to autoscale again.
-\&.b axis configure x \-min {} \-max {}
-\&.b axis configure y \-min {} \-max {}
-.CE
-By default, the legend is drawn in the right margin. You can
-change this or any legend configuration options using the
-\fBlegend\fR component.
-.CS
-# Configure the legend font, color, and relief
-\&.b legend configure -position left -relief raised \\
- -font fixed -fg blue
-.CE
-To prevent the legend from being displayed, turn on the \fB\-hide\fR
-option.
-.CS
-# Don't display the legend.
-\&.b legend configure \-hide yes\fR
-.CE
-The \fBbarchart\fR has simple drawing procedures called markers. They can be
-used to highlight or annotate data in the graph. The types of markers
-available are bitmaps, polygons, lines, or windows. Markers can be
-used, for example, to mark or brush points. For example there may be
-a line marker which indicates some low-water value. Markers are created
-using the \fBmarker\fR operation.
-.CS
-# Create a line represent the low water mark at 10.0
-\&.b marker create line -name "low_water" \\
- -coords { -Inf 10.0 Inf 10.0 } \\
- -dashes { 2 4 2 } -fg red -bg blue
-.CE
-This creates a line marker named \f(CWlow_water\fR. It will display a
-horizontal line stretching across the plotting area at the
-y-coordinate 10.0. The coordinates "-Inf" and "Inf" indicate the
-relative minimum and maximum of the axis (in this case the x-axis). By
-default, markers are drawn last, on top of the bars. You can change this
-with the \fB\-under\fR option.
-.CS
-# Draw the marker before elements are drawn.
-\&.b marker configure low_water -under yes
-.CE
-You can add cross hairs or grid lines using the \fBcrosshairs\fR and
-\fBgrid\fR components.
-.CS
-# Display both cross hairs and grid lines.
-\&.b crosshairs configure -hide no -color red
-\&.b grid configure -hide no -dashes { 2 2 }
-.CE
-Finally, to get hardcopy of the graph, use the \fBpostscript\fR
-component.
-.CS
-# Print the bar chart into file "file.ps"
-\&.b postscript output file.ps -maxpect yes -decorations no
-.CE
-This generates a file \f(CWfile.ps\fR containing the encapsulated
-PostScript of the graph. The option \fB\-maxpect\fR says to scale the
-plot to the size of the page. Turning off the \fB\-decorations\fR
-option denotes that no borders or color backgrounds should be
-drawn (i.e. the background of the margins, legend, and plotting
-area will be white).
-.SH SYNTAX
-.DS
-\fBbarchart \fIpathName \fR?\fIoption value\fR?...
-.DE
-The \fBbarchart\fR command creates a new window \fIpathName\fR and makes
-it into a barchart widget. At the time this command is invoked, there
-must not exist a window named \fIpathName\fR, but \fIpathName\fR's
-parent must exist. Additional options may may be specified on the
-command line or in the option database to configure aspects of the
-bar chart such as its colors and font. See the \fBconfigure\fR operation
-below for the exact details as to what \fIoption\fR and \fIvalue\fR
-pairs are valid.
-.PP
-If successful, \fBbarchart\fR returns \fIpathName\fR. It also creates a
-new Tcl command \fIpathName\fR. This command may be used to invoke
-various operations to query or modify the bar chart. It has the general
-form:
-.DS
-\fIpathName \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for the bar chart are described in
-the following section.
-.SH "BARCHART OPERATIONS"
-.TP
-\fIpathName \fBbar \fIelemName \fR?\fIoption value\fR?...
-Creates a new barchart element \fIelemName\fR. It's an
-error if an element \fIelemName\fR already exists.
-See the manual for \fBbarchart\fR for details about
-what \fIoption\fR and \fIvalue\fR pairs are valid.
-.TP
-\fIpathName \fBcget\fR \fIoption\fR
-Returns the current value of the configuration option given by
-\fIoption\fR. \fIOption\fR may be any option described
-below for the \fBconfigure\fR operation.
-.TP
-\fIpathName \fBconfigure \fR?\fIoption value\fR?...
-Queries or modifies the configuration options of the graph. If
-\fIoption\fR isn't specified, a list describing the current
-options for \fIpathName\fR is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
-If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
-for each pair, the option \fIoption\fR is set to \fIvalue\fR.
-The following options are valid.
-.RS
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color. This includes the margins and
-legend, but not the plotting area.
-.TP
-\fB\-barmode \fImode\fR
-Indicates how related bar elements will be drawn. Related elements
-have data points with the same abscissas (X-coordinates). \fIMode\fR
-indicates how those segments should be drawn. \fIMode\fR can be
-\f(CWinfront\fR, \f(CWaligned\fR, \f(CWoverlap\fR, or \f(CWstacked\fR.
-The default mode is \f(CWinfront\fR.
-.RS
-.TP 1i
-\f(CWinfront\fR
-Each successive segment is drawn in front of the previous.
-.TP 1i
-\f(CWstacked\fR
-Each successive segment is stacked vertically on top of the previous.
-.TP 1i
-\f(CWaligned\fR
-Segments is displayed aligned from right-to-left.
-.TP 1i
-\f(CWoverlap\fR
-Like \f(CWaligned\fR but segments slightly overlap each other.
-.RE
-.TP
-\fB\-barwidth \fIvalue\fR
-Specifies the width of the bars. This value can be overrided by the
-individual elements using their \fB\-barwidth\fR configuration option.
-\fIValue\fR is the width in terms of graph-coordinates. The
-default width is \f(CW1.0\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the outside edge of the widget. The
-\fB\-relief\fR option determines if the border is to be drawn. The
-default is \f(CW2\fR.
-.TP
-\fB\-bottommargin \fIpixels\fR
-Specifies the size of the margin below the X\-coordinate axis. If
-\fIpixels\fR is \f(CW0\fR, the size of the margin is selected automatically.
-The default is \f(CW0\fR.
-.TP
-\fB\-bufferelements \fIboolean\fR
-Indicates whether an internal pixmap to buffer the display of data
-elements should be used. If \fIboolean\fR is true, data elements are
-drawn to an internal pixmap. This option is especially useful when
-the graph is redrawn frequently while the remains data unchanged (for
-example, moving a marker across the plot). See the
-.SB "SPEED TIPS"
-section.
-The default is \f(CW1\fR.
-.TP
-\fB\-cursor \fIcursor\fR
-Specifies the widget's cursor. The default cursor is \f(CWcrosshair\fR.
-.TP
-\fB\-font \fIfontName\fR
-Specifies the font of the graph title. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-18-180-*\fR.
-.TP
-\fB\-halo \fIpixels\fR
-Specifies a maximum distance to consider when searching for the
-closest data point (see the element's \fBclosest\fR operation below).
-Data points further than \fIpixels\fR away are ignored. The default is
-\f(CW0.5i\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the requested height of widget. The default is
-\f(CW4i\fR.
-.TP
-\fB\-invertxy \fIboolean\fR
-Indicates whether the placement X\-axis and Y\-axis should be inverted. If
-\fIboolean\fR is true, the X and Y axes are swapped. The default is
-\f(CW0\fR.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the title should be justified. This matters only when
-the title contains more than one line of text. \fIJustify\fR must be
-\f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR. The default is
-\f(CWcenter\fR.
-.TP
-\fB\-leftmargin \fIpixels\fR
-Sets the size of the margin from the left edge of the window to
-the Y\-coordinate axis. If \fIpixels\fR is \f(CW0\fR, the size is
-calculated automatically. The default is \f(CW0\fR.
-.TP
-\fB\-plotbackground \fIcolor\fR
-Specifies the background color of the plotting area. The default is
-\f(CWwhite\fR.
-.TP
-\fB\-plotborderwidth \fIpixels\fR
-Sets the width of the 3-D border around the plotting area. The
-\fB\-plotrelief\fR option determines if a border is drawn. The
-default is \f(CW2\fR.
-.TP
-\fB\-plotpadx \fIpad\fR
-Sets the amount of padding to be added to the left and right sides of
-the plotting area. \fIPad\fR can be a list of one or two screen
-distances. If \fIpad\fR has two elements, the left side of the
-plotting area entry is padded by the first distance and the right side
-by the second. If \fIpad\fR is just one distance, both the left and
-right sides are padded evenly. The default is \f(CW8\fR.
-.TP
-\fB\-plotpady \fIpad\fR
-Sets the amount of padding to be added to the top and bottom of the
-plotting area. \fIPad\fR can be a list of one or two screen
-distances. If \fIpad\fR has two elements, the top of the plotting
-area is padded by the first distance and the bottom by the second. If
-\fIpad\fR is just one distance, both the top and bottom are padded
-evenly. The default is \f(CW8\fR.
-.TP
-\fB\-plotrelief \fIrelief\fR
-Specifies the 3-D effect for the plotting area. \fIRelief\fR
-specifies how the interior of the plotting area should appear relative
-to rest of the graph; for example, \f(CWraised\fR means the plot should
-appear to protrude from the graph, relative to the surface of the
-graph. The default is \f(CWsunken\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for the barchart widget. \fIRelief\fR
-specifies how the graph should appear relative to widget it is packed
-into; for example, \f(CWraised\fR means the graph should
-appear to protrude. The default is \f(CWflat\fR.
-.TP
-\fB\-rightmargin \fIpixels\fR
-Sets the size of margin from the plotting area to the right edge of
-the window. By default, the legend is drawn in this margin. If
-\fIpixels\fR is than 1, the margin size is selected automatically.
-.TP
-\fB\-takefocus\fR \fIfocus\fR
-Provides information used when moving the focus from window to window
-via keyboard traversal (e.g., Tab and Shift-Tab). If \fIfocus\fR is
-\f(CW0\fR, this means that this window should be skipped entirely during
-keyboard traversal. \f(CW1\fR means that the this window should always
-receive the input focus. An empty value means that the traversal
-scripts make the decision whether to focus on the window.
-The default is \f(CW""\fR.
-.TP
-\fB\-tile \fIimage\fR
-Specifies a tiled background for the widget. If \fIimage\fR isn't
-\f(CW""\fR, the background is tiled using \fIimage\fR.
-Otherwise, the normal background color is drawn (see the
-\fB\-background\fR option). \fIImage\fR must be an image created
-using the Tk \fBimage\fR command. The default is \f(CW""\fR.
-.TP
-\fB\-title \fItext\fR
-Sets the title to \fItext\fR. If \fItext\fR is \f(CW""\fR,
-no title will be displayed.
-.TP
-\fB\-topmargin \fIpixels\fR
-Specifies the size of the margin above the x2 axis. If \fIpixels\fR
-is \f(CW0\fR, the margin size is calculated automatically.
-.TP
-\fB\-width \fIpixels\fR
-Specifies the requested width of the widget. The default is
-\f(CW5i\fR.
-.RE
-.TP
-\fIpathName \fBcrosshairs \fIoperation \fR?\fIarg\fR?
-See the
-.SB "CROSSHAIRS COMPONENT"
-section.
-.TP
-\fIpathName \fBelement \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "ELEMENT COMPONENTS"
-section.
-.TP
-\fIpathName \fBextents \fIitem\fR
-Returns the size of a particular item in the graph. \fIItem\fR must
-be either \f(CWleftmargin\fR, \f(CWrightmargin\fR, \f(CWtopmargin\fR,
-\f(CWbottommargin\fR, \f(CWplotwidth\fR, or \f(CWplotheight\fR.
-.TP
-\fIpathName \fBgrid \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "GRID COMPONENT"
-section.
-.TP
-\fIpathName \fBinvtransform \fIwinX winY\fR
-Performs an inverse coordinate transformation, mapping window
-coordinates back to graph-coordinates, using the standard X\-axis and Y\-axis.
-Returns a list of containing the X-Y graph-coordinates.
-.TP
-\fIpathName \fBinside \fIx y\fR
-Returns \f(CW1\fR is the designated screen-coordinate (\fIx\fR and \fIy\fR)
-is inside the plotting area and \f(CW0\fR otherwise.
-.TP
-\fIpathName \fBlegend \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "LEGEND COMPONENT"
-section.
-.TP
-\fIpathName \fBline\fB operation arg\fR...
-The operation is the same as \fBelement\fR.
-.TP
-\fIpathName \fBmarker \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "MARKER COMPONENTS"
-section.
-.TP
-\fIpathName\fR \fBmetafile\fR ?\fIfileName\fR?
-\fIThis operation is for Window platforms only\fR.
-Creates a Windows enhanced metafile of the barchart.
-If present, \fIfileName\fR is the file name of the new metafile.
-Otherwise, the metafile is automatically added to the clipboard.
-.TP
-\fIpathName \fBpostscript \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "POSTSCRIPT COMPONENT"
-section.
-.TP
-\fIpathName \fBsnap \fIphotoName\fR
-Takes a snapshot of the graph and stores the contents in the photo
-image \fIphotoName\fR. \fIPhotoName\fR is the name of a Tk photo
-image that must already exist.
-.TP
-\fIpathName \fBtransform \fIx y\fR
-Performs a coordinate transformation, mapping graph-coordinates to
-window coordinates, using the standard X\-axis and Y\-axis.
-Returns a list containing the X\-Y screen-coordinates.
-.TP
-\fIpathName \fBxaxis \fIoperation\fR ?\fIarg\fR?...
-.TP
-\fIpathName \fBx2axis \fIoperation\fR ?\fIarg\fR?...
-.TP
-\fIpathName \fByaxis \fIoperation\fR ?\fIarg\fR?...
-.TP
-\fIpathName \fBy2axis \fIoperation\fR ?\fIarg\fR?...
-See the
-.SB "AXIS COMPONENTS"
-section.
-.SH "BARCHART COMPONENTS"
-A graph is composed of several components: coordinate axes, data
-elements, legend, grid, cross hairs, postscript, and annotation
-markers. Instead of one big set of configuration options and
-operations, the graph is partitioned, where each component has its own
-configuration options and operations that specifically control that
-aspect or part of the graph.
-.SS "AXIS COMPONENTS"
-Four coordinate axes are automatically created: two X\-coordinate axes
-(\f(CWx\fR and \f(CWx2\fR) and two Y\-coordinate axes (\f(CWy\fR, and
-\f(CWy2\fR). By default, the axis \f(CWx\fR is located in the bottom
-margin, \f(CWy\fR in the left margin, \f(CWx2\fR in the top margin, and
-\f(CWy2\fR in the right margin.
-.PP
-An axis consists of the axis line, title, major and minor ticks, and
-tick labels. Major ticks are drawn at uniform intervals along the
-axis. Each tick is labeled with its coordinate value. Minor ticks
-are drawn at uniform intervals within major ticks.
-.PP
-The range of the axis controls what region of data is plotted.
-Data points outside the minimum and maximum limits of the axis are
-not plotted. By default, the minimum and maximum limits are
-determined from the data, but you can reset either limit.
-.PP
-You can create and use several axes. To create an axis, invoke
-the axis component and its create operation.
-.CS
-# Create a new axis called "temperature"
-\&.b axis create temperature
-.CE
-You map data elements to an axis using the element's \-mapy and \-mapx
-configuration options. They specify the coordinate axes an element
-is mapped onto.
-.CS
-# Now map the temperature data to this axis.
-\&.b element create "temp" \-xdata $x \-ydata $tempData \\
- \-mapy temperature
-.CE
-While you can have many axes, only four axes can be displayed
-simultaneously. They are drawn in each of the margins surrounding
-the plotting area. The axes \f(CWx\fR and \f(CWy\fR are drawn in the
-bottom and left margins. The axes \f(CWx2\fR and \f(CWy2\fR are drawn in
-top and right margins. Only \f(CWx\fR and \f(CWy\fR are shown by
-default. Note that the axes can have different scales.
-.PP
-To display a different axis, you invoke one of the following
-components: \fBxaxis\fR, \fByaxis\fR, \fBx2axis\fR, and \fBy2axis\fR.
-The \fBuse\fR operation designates the axis to be drawn in the
-corresponding margin: \fBxaxis\fR in the bottom, \fByaxis\fR in the left,
-\fBx2axis\fR in the top, and \fBy2axis\fR in the right.
-.CS
-# Display the axis temperature in the left margin.
-\&.b yaxis use temperature
-.CE
-.PP
-You can configure axes in many ways. The axis scale can be linear or
-logarithmic. The values along the axis can either monotonically
-increase or decrease. If you need custom tick labels, you can specify
-a Tcl procedure to format the label any way you wish. You can
-control how ticks are drawn, by changing the major tick interval
-or the number of minor ticks. You can define non-uniform tick intervals,
-such as for time-series plots.
-.PP
-.TP
-\fIpathName \fBaxis \fBcget \fIaxisName \fIoption\fR
-Returns the current value of the option given by \fIoption\fR for
-\fIaxisName\fR. \fIOption\fR may be any option described below
-for the axis \fBconfigure\fR operation.
-.TP
-\fIpathName \fBaxis \fBconfigure \fIaxisName \fR?\fIaxisName\fR?... ?\fIoption value\fR?...
-Queries or modifies the configuration options of \fIaxisName\fR.
-Several axes can be changed. If \fIoption\fR isn't specified, a list
-describing all the current options for \fIaxisName\fR is returned. If
-\fIoption\fR is specified, but not \fIvalue\fR, then a list describing
-\fIoption\fR is returned. If one or more \fIoption\fR and \fIvalue\fR
-pairs are specified, then for each pair, the axis option \fIoption\fR
-is set to \fIvalue\fR. The following options are valid for axes.
-.RS
-.TP
-\fB\-autorange \fIrange\fR
-Sets the range of values for the axis to \fIrange\fR. The axis limits
-are automatically reset to display the most recent data points in this range.
-If \fIrange\fR is 0.0, the range is
-determined from the limits of the data. If \fB\-min\fR or \fB-max\fR
-are specified, they override this option. The default is \f(CW0.0\fR.
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the axis and tick labels.
-The default is \f(CWblack\fR.
-.TP
-\fB\-command \fIprefix\fR
-Specifies a Tcl command to be invoked when formatting the axis tick
-labels. \fIPrefix\fR is a string containing the name of a Tcl proc and
-any extra arguments for the procedure. This command is invoked for each
-major tick on the axis. Two additional arguments are passed to the
-procedure: the pathname of the widget and the current the numeric
-value of the tick. The procedure returns the formatted tick label. If
-\f(CW""\fR is returned, no label will appear next to the tick. You can
-get the standard tick labels again by setting \fIprefix\fR to
-\f(CW""\fR. The default is \f(CW""\fR.
-.sp 1
-Please note that this procedure is invoked while the bar chart is redrawn.
-You may query the widget's configuration options. But do not reset
-options, because this can have unexpected results.
-.TP
-\fB\-descending \fIboolean\fR
-Indicates whether the values along the axis are monotonically increasing or
-decreasing. If \fIboolean\fR is true, the axis values will be
-decreasing. The default is \f(CW0\fR.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the axis is displayed.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the axis title should be justified. This matters only
-when the axis title contains more than one line of text. \fIJustify\fR
-must be \f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR. The default is
-\f(CWcenter\fR.
-.TP
-\fB\-limits \fIformatStr\fR
-Specifies a printf-like description to format the minimum and maximum
-limits of the axis. The limits are displayed at the top/bottom or
-left/right sides of the plotting area. \fIFormatStr\fR is a list of
-one or two format descriptions. If one description is supplied, both
-the minimum and maximum limits are formatted in the same way. If two,
-the first designates the format for the minimum limit, the second for
-the maximum. If \f(CW""\fR is given as either description, then
-the that limit will not be displayed. The default is \f(CW""\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the axis and tick lines. The default is \f(CW1\fR
-pixel.
-.TP
-\fB\-logscale \fIboolean\fR
-Indicates whether the scale of the axis is logarithmic or linear. If
-\fIboolean\fR is true, the axis is logarithmic. The default scale is
-linear.
-.TP
-\fB\-loose \fIboolean\fR
-Indicates whether the limits of the axis should fit the data points tightly,
-at the outermost data points, or loosely, at the outer tick intervals.
-This is relevant only when the axis limit is automatically calculated.
-If \fIboolean\fR is true, the axis range is "loose".
-The default is \f(CW0\fR.
-.TP
-\fB\-majorticks \fImajorList\fR
-Specifies where to display major axis ticks. You can use this option
-to display ticks at non-uniform intervals. \fIMajorList\fR is a list
-of axis coordinates designating the location of major ticks. No
-minor ticks are drawn. If \fImajorList\fR is \f(CW""\fR,
-major ticks will be automatically computed. The default is \f(CW""\fR.
-.TP
-\fB\-max \fIvalue\fR
-Sets the maximum limit of \fIaxisName\fR. Any data point greater
-than \fIvalue\fR is not displayed. If \fIvalue\fR is \f(CW""\fR,
-the maximum limit is calculated using the largest data value.
-The default is \f(CW""\fR.
-.TP
-\fB\-min \fIvalue\fR
-Sets the minimum limit of \fIaxisName\fR. Any data point less than
-\fIvalue\fR is not displayed. If \fIvalue\fR is \f(CW""\fR,
-the minimum limit is calculated using the smallest data value.
-The default is \f(CW""\fR.
-.TP
-\fB\-minorticks \fIminorList\fR
-Specifies where to display minor axis ticks. You can use this option
-to display minor ticks at non-uniform intervals. \fIMinorList\fR is a
-list of real values, ranging from 0.0 to 1.0, designating the placement of
-a minor tick. No minor ticks are drawn if the \fB\-majortick\fR
-option is also set. If \fIminorList\fR is \f(CW""\fR, minor ticks will
-be automatically computed. The default is \f(CW""\fR.
-.TP
-\fB\-rotate \fItheta\fR
-Specifies the how many degrees to rotate the axis tick labels.
-\fITheta\fR is a real value representing the number of degrees
-to rotate the tick labels. The default is \f(CW0.0\fR degrees.
-.TP
-\fB\-shiftby \fIvalue\fR
-Specifies how much to automatically shift the range of the axis.
-When the new data exceeds the current axis maximum, the maximum
-is increased in increments of \fIvalue\fR. You can use this
-option to prevent the axis limits from being recomputed
-at each new time point. If \fIvalue\fR is 0.0, then no automatic
-shifting is down. The default is \f(CW0.0\fR.
-.TP
-\fB\-showticks \fIboolean\fR
-Indicates whether axis ticks should be drawn. If \fIboolean\fR is
-true, ticks are drawn. If false, only the
-axis line is drawn. The default is \f(CW1\fR.
-.TP
-\fB\-stepsize \fIvalue\fR
-Specifies the interval between major axis ticks. If \fIvalue\fR isn't
-a valid interval (must be less than the axis range),
-the request is ignored and the step size is automatically calculated.
-.TP
-\fB\-subdivisions \fInumber\fR
-Indicates how many minor axis ticks are
-to be drawn. For example, if \fInumber\fR is two, only one minor
-tick is drawn. If \fInumber\fR is one, no minor ticks are
-displayed. The default is \f(CW2\fR.
-.TP
-\fB\-tickfont \fIfontName\fR
-Specifies the font for axis tick labels. The default is
-\f(CW*-Courier-Bold-R-Normal-*-100-*\fR.
-.TP
-\fB\-ticklength \fIpixels\fR
-Sets the length of major and minor ticks (minor ticks are half the
-length of major ticks). If \fIpixels\fR is less than zero, the axis
-will be inverted with ticks drawn pointing towards the plot. The
-default is \f(CW0.1i\fR.
-.TP
-\fB\-title \fItext\fR
-Sets the title of the axis. If \fItext\fR is
-\f(CW""\fR, no axis title will be displayed.
-.TP
-\fB\-titlecolor \fIcolor\fR
-Sets the color of the axis title. The default is \f(CWblack\fR.
-.TP
-\fB\-titlefont \fIfontName\fR
-Specifies the font for axis title. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-14-140-*\fR.
-.PP
-Axis configuration options may be also be set by the \fBoption\fR
-command. The resource class is \f(CWAxis\fR. The resource names
-are the names of the axes (such as \f(CWx\fR or \f(CWx2\fR).
-.CS
-option add *Barchart.Axis.Color blue
-option add *Barchart.x.LogScale true
-option add *Barchart.x2.LogScale false
-.CE
-.RE
-.TP
-\fIpathName \fBaxis \fBcreate \fIaxisName \fR?\fIoption value\fR?...
-Creates a new axis by the name \fIaxisName\fR. No axis by the same
-name can already exist. \fIOption\fR and \fIvalue\fR are described
-in above in the axis \fBconfigure\fR operation.
-.TP
-\fIpathName \fBaxis \fBdelete \fR?\fIaxisName\fR?...
-Deletes the named axes. An axis is not really
-deleted until it is not longer in use, so it's safe to delete
-axes mapped to elements.
-.TP
-\fIpathName \fBaxis invtransform \fIaxisName value\fR
-Performs the inverse transformation, changing the screen-coordinate
-\fIvalue\fR to a graph-coordinate, mapping the value mapped to
-\fIaxisName\fR. Returns the graph-coordinate.
-.TP
-\fIpathName \fBaxis limits \fIaxisName\fR
-Returns a list of the minimum and maximum limits for \fIaxisName\fR. The order
-of the list is \f(CWmin max\fR.
-.TP
-\fIpathName \fBaxis names \fR?\fIpattern\fR?...
-Returns a list of axes matching zero or more patterns. If no
-\fIpattern\fR argument is give, the names of all axes are returned.
-.TP
-\fIpathName \fBaxis transform \fIaxisName value\fR
-Transforms the coordinate \fIvalue\fR to a screen-coordinate by mapping
-the it to \fIaxisName\fR. Returns the transformed screen-coordinate.
-.PP
-Only four axes can be displayed simultaneously. By default, they are
-\f(CWx\fR, \f(CWy\fR, \f(CWx2\fR, and \f(CWy2\fR. You can swap in a different
-axis with \fBuse\fR operation of the special axis components:
-\fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, and \fBy2axis\fR.
-.CS
-\&.g create axis temp
-\&.g create axis time
-\&...
-\&.g xaxis use temp
-\&.g yaxis use time
-.CE
-Only the axes specified for use are displayed on the screen.
-.PP
-The \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, and \fBy2axis\fR
-components operate on an axis location rather than a specific axis
-like the more general \fBaxis\fR component does. The \fBxaxis\fR
-component manages the X-axis located in the bottom margin (whatever
-axis that happens to be). Likewise, \fByaxis\fR uses the Y-axis in
-the left margin, \fBx2axis\fR the top X-axis, and \fBy2axis\fR the
-right Y-axis.
-.PP
-They implicitly control the axis that is currently using to that
-location. By default, \fBxaxis\fR uses the \f(CWx\fR axis, \fByaxis\fR
-uses \f(CWy\fR, \fBx2axis\fR uses \f(CWx2\fR, and \fBy2axis\fR uses
-\f(CWy2\fR. These components can be more convenient to use than always
-determining what axes are current being displayed by the graph.
-.PP
-The following operations are available for axes. They mirror exactly
-the operations of the \fBaxis\fR component. The \fIaxis\fR argument
-must be \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, or \fBy2axis\fR.
-.TP
-\fIpathName \fIaxis \fBcget \fIoption\fR
-.TP
-\fIpathName \fIaxis \fBconfigure \fR?\fIoption value\fR?...
-.TP
-\fIpathName \fIaxis\fB invtransform \fIvalue\fR
-.TP
-\fIpathName \fIaxis \fBlimits\fR
-.TP
-\fIpathName \fIaxis\fB transform \fIvalue\fR
-.TP
-\fIpathName \fIaxis\fB use \fR?\fIaxisName\fR?
-Designates the axis \fIaxisName\fR is to be displayed at this
-location. \fIAxisName\fR can not be already in use at another location.
-This command returns the name of the axis currently using this location.
-.SS "CROSSHAIRS COMPONENT"
-Cross hairs consist of two intersecting lines (one vertical and one horizontal)
-drawn completely across the plotting area. They are used to position
-the mouse in relation to the coordinate axes. Cross hairs differ from line
-markers in that they are implemented using XOR drawing primitives.
-This means that they can be quickly drawn and erased without redrawing
-the entire widget.
-.PP
-The following operations are available for cross hairs:
-.TP
-\fIpathName \fBcrosshairs cget \fIoption\fR
-Returns the current value of the cross hairs configuration option
-given by \fIoption\fR. \fIOption\fR may be any option
-described below for the cross hairs \fBconfigure\fR operation.
-.TP
-\fIpathName \fBcrosshairs configure \fR?\fIoption value\fR?...
-Queries or modifies the configuration options of the cross hairs. If
-\fIoption\fR isn't specified, a list describing all the current
-options for the cross hairs is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
-If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
-for each pair, the cross hairs option \fIoption\fR is set to
-\fIvalue\fR.
-The following options are available for cross hairs.
-.RS
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the cross hairs. The default is \f(CWblack\fR.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the cross hairs. \fIDashList\fR is a list of up
-to 11 numbers that alternately represent the lengths of the dashes
-and gaps on the cross hair lines. Each number must be between 1 and
-255. If \fIdashList\fR is \f(CW""\fR, the cross hairs will be solid
-lines.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether cross hairs are drawn. If \fIboolean\fR is true,
-cross hairs are not drawn. The default is \f(CWyes\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Set the width of the cross hair lines. The default is \f(CW1\fR.
-.TP
-\fB\-position \fIpos\fR
-Specifies the screen position where the cross hairs intersect.
-\fIPos\fR must be in the form "\fI at x,y\fR", where \fIx\fR and \fIy\fR
-are the window coordinates of the intersection.
-.PP
-Cross hairs configuration options may be also be set by the
-\fBoption\fR command. The resource name and class are
-\f(CWcrosshairs\fR and \f(CWCrosshairs\fR respectively.
-.CS
-option add *Barchart.Crosshairs.LineWidth 2
-option add *Barchart.Crosshairs.Color red
-.CE
-.RE
-.TP
-\fIpathName \fBcrosshairs off\fR
-Turns off the cross hairs.
-.TP
-\fIpathName \fBcrosshairs on\fR
-Turns on the display of the cross hairs.
-.TP
-\fIpathName \fBcrosshairs toggle\fR
-Toggles the current state of the cross hairs, alternately mapping and
-unmapping the cross hairs.
-.SH "ELEMENTS"
-A data element represents a set of data. It contains x and y vectors
-which are the coordinates of the data points. Elements are displayed
-as bars where the length of the bar is proportional to the ordinate of
-the data point. Elements also control the appearance of the data,
-such as the color, stipple, relief, etc.
-.PP
-When new data elements are created, they are automatically added to a
-list of displayed elements. The display list controls what elements
-are drawn and in what order.
-.PP
-The following operations are available for elements.
-.TP
-\fIpathName \fBelement activate \fIelemName \fR?\fIindex\fR?...
-Specifies the data points of element \fIelemName\fR to be drawn
-using active foreground and background colors. \fIElemName\fR is the
-name of the element and \fIindex\fR is a number representing the index
-of the data point. If no indices are present then all data points
-become active.
-.TP
-\fIpathName \fBelement bind \fItagName\fR ?\fIsequence\fR? ?\fIcommand\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for an element with this
-tag, \fIcommand\fR will be invoked. The syntax is similar to the
-\fBbind\fR command except that it operates on graph elements, rather
-than widgets. See the \fBbind\fR manual entry for
-complete details on \fIsequence\fR and the substitutions performed on
-\fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBelement cget \fIelemName \fIoption\fR
-Returns the current value of the element configuration option given by
-\fIoption\fR. \fIOption\fR may be any of the options described below
-for the element \fBconfigure\fR operation.
-.TP
-\fIpathName \fBelement closest \fIx y\fR ?\fIoption value\fR?... ?\fIelemName\fR?...
-Finds the data point representing the bar closest to the window
-coordinates \fIx\fR and \fIy\fR in the element \fIelemName\fR.
-\fIElemName\fR is the name of an element, which must be currently displayed.
-If no elements are specified, then all displayed elements are searched. It
-returns a key-value list containing the name of the closest element,
-the index of its closest point, and the graph-coordinates of the
-point. If no data point within the threshold distance can be found,
-\f(CW""\fR is returned. The following \fIoption\fR-\fIvalue\fR pairs
-are available.
-.RS
-.TP
-\fB\-halo \fIpixels\fR
-Specifies a threshold distance where selected data points are ignored.
-\fIPixels\fR is a valid screen distance, such as \f(CW2\fR or \f(CW1.2i\fR.
-If this option isn't specified, then it defaults to the value of the
-\fBbarchart\fR's \fB\-halo\fR option.
-.RE
-.TP
-\fIpathName \fBelement configure \fIelemName \fR?\fIelemName\fR... ?\fIoption value\fR?...
-Queries or modifies the configuration options for elements. Several
-elements can be modified at the same time. If \fIoption\fR isn't
-specified, a list describing all the current options for
-\fIelemName\fR is returned. If \fIoption\fR is specified, but not
-\fIvalue\fR, then a list describing the option \fIoption\fR is
-returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
-specified, then for each pair, the element option \fIoption\fR is set
-to \fIvalue\fR. The following options are valid for elements.
-.RS
-.TP
-\fB\-activepen \fIpenName\fR
-Specifies pen to use to draw active element. If \fIpenName\fR is
-\f(CW""\fR, no active elements will be drawn. The default is
-\f(CWactiveLine\fR.
-.TP
-\fB\-bindtags \fItagList\fR
-Specifies the binding tags for the element. \fITagList\fR is a list
-of binding tag names. The tags and their order will determine how
-events for elements. Each tag in the list matching the current event
-sequence will have its Tcl command executed. Implicitly the name of
-the element is always the first tag in the list. The default value is
-\f(CWall\fR.
-.TP
-\fB\-background \fIcolor\fR
-Sets the the color of the border around each bar. The default is
-\f(CWwhite\fR.
-.TP
-\fB\-barwidth \fIvalue\fR
-Specifies the width the bars drawn for the element. \fIValue\fR is
-the width in X-coordinates. If this option isn't
-specified, the width of each bar is the value of the widget's
-\fB\-barwidth\fR option.
-.TP
-\fB\-baseline \fIvalue\fR
-Specifies the baseline of the bar segments. This affects how bars are
-drawn since bars are drawn from their respective y-coordinate the
-baseline. By default the baseline is \f(CW0.0\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the border width of the 3-D border drawn around the outside of
-each bar. The \fB\-relief\fR option determines if such a border is
-drawn. \fIPixels\fR must be a valid screen distance like \f(CW2\fR or
-\f(CW0.25i\fR. The default is \f(CW2\fR.
-.TP
-\fB\-data \fIcoordList\fR
-Specifies the X\-Y coordinates of the data. \fICoordList\fR is a
-list of numeric expressions representing the X\-Y coordinate pairs
-of each data point.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the color of the interior of the bars.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the element is displayed. The default is \f(CWno\fR.
-.TP
-\fB\-label \fItext\fR
-Sets the element's label in the legend. If \fItext\fR
-is \f(CW""\fR, the element will have no entry in the legend.
-The default label is the element's name.
-.TP
-\fB\-mapx \fIxAxis\fR
-Selects the X\-axis to map the element's X\-coordinates onto.
-\fIXAxis\fR must be the name of an axis. The default is \f(CWx\fR.
-.TP
-\fB\-mapy \fIyAxis\fR
-Selects the Y\-axis to map the element's Y\-coordinates onto.
-\fIYAxis\fR must be the name of an axis. The default is \f(CWy\fR.
-.TP
-\fB\-relief \fIstring\fR
-Specifies the 3-D effect desired for bars. \fIRelief\fR indicates how
-the interior of the bar should appear relative to the surface of the
-chart; for example, \f(CWraised\fR means the bar should appear to
-protrude from the surface of the plotting area. The default is
-\f(CWraised\fR.
-.TP
-\fB\-stipple \fIbitmap\fR
-Specifies a stipple pattern with which to draw the bars. If
-\fIbitmap\fR is \f(CW""\fR, then the bar is drawn in a solid fashion.
-.TP
-\fB\-xdata \fIxVector\fR
-Specifies the x-coordinate vector of the data.
-\fIXVector\fR is the name of a BLT vector or a
-list of numeric expressions.
-.TP
-\fB\-ydata \fIyVector\fR
-Specifies the y-coordinate vector of the data.
-\fIYVector\fR is the name of a BLT vector or a list of
-numeric expressions.
-.PP
-Element configuration options may also be set by the
-\fBoption\fR command. The resource names in the option database
-are prefixed by \f(CWelem\fR.
-.CS
-option add *Barchart.Element.background blue
-.CE
-.RE
-.TP
-\fIpathName \fBelement create \fIelemName\fR ?\fIoption value\fR?...
-Creates a new element \fIelemName\fR. Element
-names must be unique, so an element \fIelemName\fR may not already
-exist. If additional arguments are present, they specify any of the
-element options valid for element \fBconfigure\fR operation.
-.TP
-\fIpathName \fBelement deactivate \fIpattern\fR...
-Deactivates all the elements matching \fIpattern\fR for the graph.
-Elements whose names match any of the patterns given are redrawn
-using their normal colors.
-.TP
-\fIpathName \fBelement delete\fR ?\fIpattern\fR?...
-Deletes all the elements matching \fIpattern\fR for the graph.
-Elements whose names match any of the patterns given are deleted.
-The graph will be redrawn without the deleted elements.
-.TP
-\fIpathName \fBelement exists \fIelemName\fR
-Returns \f(CW1\fR if an element \fIelemName\fR currently exists and
-\f(CW0\fR otherwise.
-.TP
-\fIpathName \fBelement names \fR?\fIpattern\fR?...
-Returns the elements matching one or more pattern. If no
-\fIpattern\fR is given, the names of all elements is returned.
-.TP
-\fIpathName \fBelement show\fR ?\fInameList\fR?
-Queries or modifies the element display list. The element display
-list designates the elements drawn and in what
-order. \fINameList\fR is a list of elements to be displayed in the
-order they are named. If there is no \fInameList\fR argument,
-the current display list is returned.
-.TP
-\fIpathName \fBelement type\fR \fIelemName\fR
-Returns the type of \fIelemName\fR.
-If the element is a bar element, the commands returns the string
-\f(CW"bar"\fR, otherwise it returns \f(CW"line"\fR.
-.CE
-.SS "GRID COMPONENT"
-Grid lines extend from the major and minor ticks of each axis
-horizontally or vertically across the plotting area. The following
-operations are available for grid lines.
-.TP
-\fIpathName \fBgrid cget \fIoption\fR
-Returns the current value of the grid line configuration option given by
-\fIoption\fR. \fIOption\fR may be any option described below
-for the grid \fBconfigure\fR operation.
-.TP
-\fIpathName \fBgrid configure\fR ?\fIoption value\fR?...
-Queries or modifies the configuration options for grid lines. If
-\fIoption\fR isn't specified, a list describing all the current
-grid options for \fIpathName\fR is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing \fIoption\fR is
-returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
-specified, then for each pair, the grid line option \fIoption\fR is set to
-\fIvalue\fR. The following options are valid for grid lines.
-.RS
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the grid lines. The default is \f(CWblack\fR.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the grid lines. \fIDashList\fR is a list of up
-to 11 numbers that alternately represent the lengths of the dashes
-and gaps on the grid lines. Each number must be between 1 and 255.
-If \fIdashList\fR is \f(CW""\fR, the grid will be solid lines.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the grid should be drawn. If \fIboolean\fR
-is true, grid lines are not shown. The default is \f(CWyes\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of grid lines. The default width is \f(CW1\fR.
-.TP
-\fB\-mapx \fIxAxis\fR
-Specifies the X\-axis to display grid lines. \fIXAxis\fR
-must be the name of an axis or \f(CW""\fR for no grid lines.
-The default is \f(CW""\fR.
-.TP
-\fB\-mapy \fIyAxis\fR
-Specifies the Y\-axis to display grid lines. \fIYAxis\fR
-must be the name of an axis or \f(CW""\fR for no grid lines.
-The default is \f(CWy\fR.
-.TP
-\fB\-minor \fIboolean\fR
-Indicates whether the grid lines should be drawn for minor ticks.
-If \fIboolean\fR is true, the lines will appear at
-minor tick intervals. The default is \f(CW1\fR.
-.PP
-Grid configuration options may also be set by the
-\fBoption\fR command. The resource name and class are \f(CWgrid\fR and
-\f(CWGrid\fR respectively.
-.CS
-option add *Barchart.grid.LineWidth 2
-option add *Barchart.Grid.Color black
-.CE
-.RE
-.TP
-\fIpathName \fBgrid off\fR
-Turns off the display the grid lines.
-.TP
-\fIpathName \fBgrid on\fR
-Turns on the display the grid lines.
-.TP
-\fIpathName \fBgrid toggle\fR
-Toggles the display of the grid.
-.SS "LEGEND COMPONENT"
-The legend displays a list of the data elements. Each entry consists
-of the element's symbol and label. The legend can appear in any
-margin (the default location is in the right margin). It
-can also be positioned anywhere within the plotting area.
-.PP
-The following operations are valid for the legend.
-.TP
-\fIpathName \fBlegend activate \fIpattern\fR...
-Selects legend entries to be drawn using the active legend colors and relief.
-All entries whose element names match \fIpattern\fR are selected. To
-be selected, the element name must match only one \fIpattern\fR.
-.TP
-\fIpathName \fBlegend bind \fItagName\fR ?\fIsequence\fR? ?\fIcommand\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for a legend entry with this
-tag, \fIcommand\fR will be invoked. Implicitly the element names
-in the entry are tags. The syntax is similar to the
-\fBbind\fR command except that it operates on legend entries, rather
-than widgets. See the \fBbind\fR manual entry for
-complete details on \fIsequence\fR and the substitutions performed on
-\fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBlegend cget \fIoption\fR
-Returns the current value of a legend configuration option.
-\fIOption\fR may be any option described below in the
-legend \fBconfigure\fR operation.
-.TP
-\fIpathName \fBlegend configure \fR?\fIoption value\fR?...
-Queries or modifies the configuration options for the legend. If
-\fIoption\fR isn't specified, a list describing the current
-legend options for \fIpathName\fR is returned. If \fIoption\fR is
-specified, but not \fIvalue\fR, then a list describing \fIoption\fR is
-returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
-specified, then for each pair, the legend option \fIoption\fR is set
-to \fIvalue\fR. The following options are valid for the legend.
-.RS
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the background color for active legend entries. All legend
-entries marked active (see the legend \fBactivate\fR operation) are
-drawn using this background color.
-.TP
-\fB\-activeborderwidth \fIpixels\fR
-Sets the width of the 3-D border around the outside edge of the active legend
-entries. The default is \f(CW2\fR.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the foreground color for active legend entries. All legend
-entries marked as active (see the legend \fBactivate\fR operation) are
-drawn using this foreground color.
-.TP
-\fB\-activerelief \fIrelief\fR
-Specifies the 3-D effect desired for active legend entries.
-\fIRelief\fR denotes how the interior of the entry should appear
-relative to the legend; for example, \f(CWraised\fR means the entry
-should appear to protrude from the legend, relative to the surface of
-the legend. The default is \f(CWflat\fR.
-.TP
-\fB\-anchor \fIanchor\fR
-Tells how to position the legend relative to the positioning point for
-the legend. This is dependent on the value of the \fB\-position\fR
-option. The default is \f(CWcenter\fR.
-.RS
-.TP 1.25i
-\f(CWleft\fR or \f(CWright\fR
-The anchor describes how to position the legend vertically.
-.TP
-\f(CWtop\fR or \f(CWbottom\fR
-The anchor describes how to position the legend horizontally.
-.TP
-\f(CW at x,y\fR
-The anchor specifies how to position the legend relative to the
-positioning point. For example, if \fIanchor\fR is \f(CWcenter\fR then
-the legend is centered on the point; if \fIanchor\fR is \f(CWn\fR then
-the legend will be drawn such that the top center point of the
-rectangular region occupied by the legend will be at the positioning
-point.
-.TP
-\f(CWplotarea\fR
-The anchor specifies how to position the legend relative to the
-plotting area. For example, if \fIanchor\fR is \f(CWcenter\fR then the
-legend is centered in the plotting area; if \fIanchor\fR is \f(CWne\fR
-then the legend will be drawn such that occupies the upper right
-corner of the plotting area.
-.RE
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the legend. If \fIcolor\fR is \f(CW""\fR,
-the legend background with be transparent.
-.TP
-\fB\-bindtags \fItagList\fR
-Specifies the binding tags for legend entries. \fITagList\fR is a list
-of binding tag names. The tags and their order will determine how
-events for legend entries. Each tag in the list matching the current
-event sequence will have its Tcl command executed. The default value
-is \f(CWall\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3-D border around the outside edge of the legend (if
-such border is being drawn; the \fBrelief\fR option determines this).
-The default is \f(CW2\fR pixels.
-.TP
-\fB\-font \fIfontName\fR
-\fIFontName\fR specifies a font to use when drawing the labels of each
-element into the legend. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the foreground color of the text drawn for the element's label.
-The default is \f(CWblack\fR.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the legend should be displayed. If \fIboolean\fR is
-true, the legend will not be draw. The default is \f(CWno\fR.
-.TP
-\fB\-ipadx \fIpad\fR
-Sets the amount of internal padding to be added to the width of each
-legend entry. \fIPad\fR can be a list of one or two screen distances. If
-\fIpad\fR has two elements, the left side of the legend entry is
-padded by the first distance and the right side by the second. If
-\fIpad\fR is just one distance, both the left and right sides are padded
-evenly. The default is \f(CW2\fR.
-.TP
-\fB\-ipady \fIpad\fR
-Sets an amount of internal padding to be added to the height of each
-legend entry. \fIPad\fR can be a list of one or two screen distances. If
-\fIpad\fR has two elements, the top of the entry is padded by the
-first distance and the bottom by the second. If \fIpad\fR is just
-one distance, both the top and bottom of the entry are padded evenly.
-The default is \f(CW2\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets the padding to the left and right exteriors of the legend.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the legend is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default is \f(CW4\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets the padding above and below the legend. \fIPad\fR can be a list
-of one or two screen distances. If \fIpad\fR has two elements, the area above
-the legend is padded by the first distance and the area below by the
-second. If \fIpad\fR is just one distance, both the top and
-bottom areas are padded evenly. The default is \f(CW0\fR.
-.TP
-\fB\-position \fIpos\fR
-Specifies where the legend is drawn. The
-\fB\-anchor\fR option also affects where the legend is positioned. If
-\fIpos\fR is \f(CWleft\fR, \f(CWleft\fR, \f(CWtop\fR, or \f(CWbottom\fR, the
-legend is drawn in the specified margin. If \fIpos\fR is
-\f(CWplotarea\fR, then the legend is drawn inside the plotting area at a
-particular anchor. If \fIpos\fR is in the form "\fI at x,y\fR", where
-\fIx\fR and \fIy\fR are the window coordinates, the legend is drawn in
-the plotting area at the specified coordinates. The default is
-\f(CWright\fR.
-.TP
-\fB\-raised \fIboolean\fR
-Indicates whether the legend is above or below the data elements. This
-matters only if the legend is in the plotting area. If \fIboolean\fR
-is true, the legend will be drawn on top of any elements that may
-overlap it. The default is \f(CWno\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for the border around the legend.
-\fIRelief\fR specifies how the interior of the legend should appear
-relative to the bar chart; for example, \f(CWraised\fR means the legend
-should appear to protrude from the bar chart, relative to the surface of
-the bar chart. The default is \f(CWsunken\fR.
-.PP
-Legend configuration options may also be set by the \fBoption\fR
-command. The resource name and class are \f(CWlegend\fR and
-\f(CWLegend\fR respectively.
-.CS
-option add *Barchart.legend.Foreground blue
-option add *Barchart.Legend.Relief raised
-.CE
-.RE
-.TP
-\fIpathName \fBlegend deactivate \fIpattern\fR...
-Selects legend entries to be drawn using the normal legend colors and
-relief. All entries whose element names match \fIpattern\fR are
-selected. To be selected, the element name must match only one
-\fIpattern\fR.
-.TP
-\fIpathName \fBlegend get \fIpos\fR
-Returns the name of the element whose entry is at the screen position
-\fIpos\fR in the legend. \fIPos\fR must be in the form "\fI at x,y\fR",
-where \fIx\fR and \fIy\fR are window coordinates. If the given
-coordinates do not lie over a legend entry, \f(CW""\fR is returned.
-.SS "PEN COMPONENTS"
-Pens define attributes for elements.
-Pens mirror the configuration options of data elements that pertain to
-how symbols and lines are drawn. Data elements use pens to determine
-how they are drawn. A data element may use several pens at once. In
-this case, the pen used for a particular data point is determined from
-each element's weight vector (see the element's \fB\-weight\fR and
-\fB\-style\fR options).
-.PP
-One pen, called \f(CWactiveBar\fR, is automatically created.
-It's used as the default active pen for elements. So you can change
-the active attributes for all elements by simply reconfiguring this
-pen.
-.CS
-\&.g pen configure "activeBar" -fg green -bg green4
-.CE
-You can create and use several pens. To create a pen, invoke
-the pen component and its create operation.
-.CS
-\&.g pen create myPen
-.CE
-You map pens to a data element using either the element's
-\fB\-pen\fR or \fB\-activepen\fR options.
-.CS
-\&.g element create "e1" -xdata $x -ydata $tempData \\
- -pen myPen
-.CE
-An element can use several pens at once. This is done by specifying
-the name of the pen in the element's style list (see the
-\fB\-styles\fR option).
-.CS
-\&.g element configure "e1" -styles { myPen 2.0 3.0 }
-.CE
-This says that any data point with a weight between 2.0 and 3.0
-is to be drawn using the pen \f(CWmyPen\fR. All other points
-are drawn with the element's default attributes.
-.PP
-The following operations are available for pen components.
-.PP
-.TP
-\fIpathName \fBpen \fBcget \fIpenName \fIoption\fR
-Returns the current value of the option given by \fIoption\fR for
-\fIpenName\fR. \fIOption\fR may be any option described below
-for the pen \fBconfigure\fR operation.
-.TP
-\fIpathName \fBpen \fBconfigure \fIpenName \fR?\fIpenName\fR... ?\fIoption value\fR?...
-Queries or modifies the configuration options of
-\fIpenName\fR. Several pens can be modified at once. If \fIoption\fR
-isn't specified, a list describing the current options for
-\fIpenName\fR is returned. If \fIoption\fR is specified, but not
-\fIvalue\fR, then a list describing \fIoption\fR is returned. If one
-or more \fIoption\fR and \fIvalue\fR pairs are specified, then for
-each pair, the pen option \fIoption\fR is set to \fIvalue\fR. The
-following options are valid for pens.
-.RS
-.TP
-\fB\-background \fIcolor\fR
-Sets the the color of the border around each bar. The default is
-\f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the border width of the 3-D border drawn around the outside of
-each bar. The \fB\-relief\fR option determines if such a border is
-drawn. \fIPixels\fR must be a valid screen distance like \f(CW2\fR or
-\f(CW0.25i\fR. The default is \f(CW2\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the color of the interior of the bars.
-.TP
-\fB\-relief \fIstring\fR
-Specifies the 3-D effect desired for bars. \fIRelief\fR indicates how
-the interior of the bar should appear relative to the surface of the
-chart; for example, \f(CWraised\fR means the bar should appear to
-protrude from the bar chart, relative to the surface of the plotting
-area. The default is \f(CWraised\fR.
-.TP
-\fB\-stipple \fIbitmap\fR
-Specifies a stipple pattern with which to draw the bars. If
-\fIbitmap\fR is \f(CW""\fR, then the bar is drawn in a solid fashion.
-.TP
-\fB\-type \fIelemType\fR
-Specifies the type of element the pen is to be used with.
-This option should only be employed when creating the pen. This
-is for those that wish to mix different types of elements (bars and
-lines) on the same graph. The default type is "bar".
-.PP
-Pen configuration options may be also be set by the \fBoption\fR
-command. The resource class is \f(CWPen\fR. The resource names
-are the names of the pens.
-.CS
-option add *Barchart.Pen.Foreground blue
-option add *Barchart.activeBar.foreground green
-.CE
-.RE
-.TP
-\fIpathName \fBpen \fBcreate \fIpenName \fR?\fIoption value\fR?...
-Creates a new pen by the name \fIpenName\fR. No pen by the same
-name can already exist. \fIOption\fR and \fIvalue\fR are described
-in above in the pen \fBconfigure\fR operation.
-.TP
-\fIpathName \fBpen \fBdelete \fR?\fIpenName\fR?...
-Deletes the named pens. A pen is not really
-deleted until it is not longer in use, so it's safe to delete
-pens mapped to elements.
-.TP
-\fIpathName \fBpen names \fR?\fIpattern\fR?...
-Returns a list of pens matching zero or more patterns. If no
-\fIpattern\fR argument is give, the names of all pens are returned.
-.SS "POSTSCRIPT COMPONENT"
-The barchart can generate encapsulated PostScript output. There
-are several configuration options you can specify to control how the
-plot will be generated. You can change the page dimensions and
-borders. The plot itself can be scaled, centered, or rotated to
-landscape. The PostScript output can be written directly to a file or
-returned through the interpreter.
-.PP
-The following postscript operations are available.
-.TP
-\fIpathName \fBpostscript cget \fIoption\fR
-Returns the current value of the postscript option given by
-\fIoption\fR. \fIOption\fR may be any option described
-below for the postscript \fBconfigure\fR operation.
-.TP
-\fIpathName \fBpostscript configure \fR?\fIoption value\fR?...
-Queries or modifies the configuration options for PostScript
-generation. If \fIoption\fR isn't specified, a list describing
-the current postscript options for \fIpathName\fR is returned. If
-\fIoption\fR is specified, but not \fIvalue\fR, then a list describing
-\fIoption\fR is returned. If one or more \fIoption\fR and \fIvalue\fR
-pairs are specified, then for each pair, the postscript option
-\fIoption\fR is set to \fIvalue\fR. The following postscript options
-are available.
-.RS
-.TP
-\fB\-center \fIboolean\fR
-Indicates whether the plot should be centered on the PostScript page. If
-\fIboolean\fR is false, the plot will be placed in the upper left
-corner of the page. The default is \f(CW1\fR.
-.TP
-\fB\-colormap \fIvarName\fR
-\fIVarName\fR must be the name of a global array variable that
-specifies a color mapping from the X color name to PostScript. Each
-element of \fIvarName\fR must consist of PostScript code to set a
-particular color value (e.g. ``\f(CW1.0 1.0 0.0 setrgbcolor\fR''). When
-generating color information in PostScript, the array variable \fIvarName\fR
-is checked if an element of the name as the color exists. If so, it uses
-its value as the PostScript
-command to set the color. If this option hasn't been specified, or if
-there isn't an entry in \fIvarName\fR for a given color, then it uses
-the red, green, and blue intensities from the X color.
-.TP
-\fB\-colormode \fImode\fR
-Specifies how to output color information. \fIMode\fR must be either
-\f(CWcolor\fR (for full color output), \f(CWgray\fR (convert all colors to
-their gray-scale equivalents) or \f(CWmono\fR (convert foreground colors
-to black and background colors to white). The default mode is
-\f(CWcolor\fR.
-.TP
-\fB\-fontmap \fIvarName\fR
-\fIVarName\fR must be the name of a global array variable that
-specifies a font mapping from the X font name to PostScript. Each
-element of \fIvarName\fR must consist of a Tcl list with one or two
-elements; the name and point size of a PostScript font.
-When outputting PostScript commands for a particular font, the array
-variable \fIvarName\fR is checked to see if an element by the
-specified font exists. If there is such an element, then the font
-information contained in that element is used in the PostScript
-output. (If the point size is omitted from the list, the point size
-of the X font is used). Otherwise the X font is examined in an
-attempt to guess what PostScript font to use. This works only for
-fonts whose foundry property is \fIAdobe\fR (such as Times, Helvetica,
-Courier, etc.). If all of this fails then the font defaults to
-\f(CWHelvetica-Bold\fR.
-.TP
-\fB\-decorations \fIboolean\fR
-Indicates whether PostScript commands to generate color backgrounds and 3-D
-borders will be output. If \fIboolean\fR is false, the graph will
-background will be white and no 3-D borders will be generated. The
-default is \f(CW1\fR.
-.TP
-\fB\-height \fIpixels\fR
-Sets the height of the plot. This lets you print the bar chart with a
-height different from the one drawn on the screen. If
-\fIpixels\fR is 0, the height is the same as the widget's height.
-The default is \f(CW0\fR.
-.TP
-\fB\-landscape \fIboolean\fR
-If \fIboolean\fR is true, this specifies the printed area is to be
-rotated 90 degrees. In non-rotated output the X\-axis of the printed
-area runs along the short dimension of the page (``portrait''
-orientation); in rotated output the X\-axis runs along the long
-dimension of the page (``landscape'' orientation). Defaults to
-\f(CW0\fR.
-.TP
-\fB\-maxpect \fIboolean\fR
-Indicates to scale the plot so that it fills the PostScript page.
-The aspect ratio of the barchart is still retained. The default is
-\f(CW0\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets the horizontal padding for the left and right page borders. The
-borders are exterior to the plot. \fIPad\fR can be a list of one or
-two screen distances. If \fIpad\fR has two elements, the left border is padded
-by the first distance and the right border by the second. If
-\fIpad\fR has just one distance, both the left and right borders are
-padded evenly. The default is \f(CW1i\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets the vertical padding for the top and bottom page borders. The
-borders are exterior to the plot. \fIPad\fR can be a list of one or
-two screen distances. If \fIpad\fR has two elements, the top border is padded
-by the first distance and the bottom border by the second. If
-\fIpad\fR has just one distance, both the top and bottom borders are
-padded evenly. The default is \f(CW1i\fR.
-.TP
-\fB\-paperheight \fIpixels\fR
-Sets the height of the postscript page. This can be used to select
-between different page sizes (letter, A4, etc). The default height is
-\f(CW11.0i\fR.
-.TP
-\fB\-paperwidth \fIpixels\fR
-Sets the width of the postscript page. This can be used to select
-between different page sizes (letter, A4, etc). The default width is
-\f(CW8.5i\fR.
-.TP
-\fB\-width \fIpixels\fR
-Sets the width of the plot. This lets you generate a plot
-of a width different from that of the widget. If \fIpixels\fR
-is 0, the width is the same as the widget's width. The default is
-\f(CW0\fR.
-.PP
-Postscript configuration options may be also be set by the
-\fBoption\fR command. The resource name and class are
-\f(CWpostscript\fR and \f(CWPostscript\fR respectively.
-.CS
-option add *Barchart.postscript.Decorations false
-option add *Barchart.Postscript.Landscape true
-.CE
-.RE
-.TP
-\fIpathName \fBpostscript output \fR?\fIfileName\fR? ?\fIoption value\fR?...
-Outputs a file of encapsulated PostScript. If a
-\fIfileName\fR argument isn't present, the command returns the
-PostScript. If any \fIoption-value\fR pairs are present, they set
-configuration options controlling how the PostScript is generated.
-\fIOption\fR and \fIvalue\fR can be anything accepted by the
-postscript \fBconfigure\fR operation above.
-.SS "MARKER COMPONENTS"
-Markers are simple drawing procedures used to annotate or highlight
-areas of the graph. Markers have various types: text strings,
-bitmaps, images, connected lines, windows, or polygons. They can be
-associated with a particular element, so that when the element is
-hidden or un-hidden, so is the marker. By default, markers are the
-last items drawn, so that data elements will appear in
-behind them. You can change this by configuring the \fB\-under\fR
-option.
-.PP
-Markers, in contrast to elements, don't affect the scaling of the
-coordinate axes. They can also have \fIelastic\fR coordinates
-(specified by \f(CW-Inf\fR and \f(CWInf\fR respectively) that translate
-into the minimum or maximum limit of the axis. For example, you can
-place a marker so it always remains in the lower left corner of the
-plotting area, by using the coordinates \f(CW-Inf\fR,\f(CW-Inf\fR.
-.PP
-The following operations are available for markers.
-.TP
-\fIpathName \fBmarker after \fImarkerId\fR ?\fIafterId\fR?
-Changes the order of the markers, drawing the first
-marker after the second. If no second \fIafterId\fR argument is
-specified, the marker is placed at the end of the display list. This
-command can be used to control how markers are displayed since markers
-are drawn in the order of this display list.
-.TP
-\fIpathName \fBmarker before \fImarkerId\fR ?\fIbeforeId\fR?
-Changes the order of the markers, drawing the first
-marker before the second. If no second \fIbeforeId\fR argument is
-specified, the marker is placed at the beginning of the display list.
-This command can be used to control how markers are displayed since
-markers are drawn in the order of this display list.
-.TP
-\fIpathName \fBmarker bind \fItagName\fR ?\fIsequence\fR? ?\fIcommand\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for a marker with this
-tag, \fIcommand\fR will be invoked. The syntax is similar to the
-\fBbind\fR command except that it operates on graph markers, rather
-than widgets. See the \fBbind\fR manual entry for
-complete details on \fIsequence\fR and the substitutions performed on
-\fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBmarker cget \fIoption\fR
-Returns the current value of the marker configuration option given by
-\fIoption\fR. \fIOption\fR may be any option described
-below in the \fBconfigure\fR operation.
-.TP
-\fIpathName \fBmarker configure \fImarkerId\fR ?\fIoption value\fR?...
-Queries or modifies the configuration options for markers. If
-\fIoption\fR isn't specified, a list describing the current
-options for \fImarkerId\fR is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
-If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
-for each pair, the marker option \fIoption\fR is set to \fIvalue\fR.
-.sp
-The following options are valid for all markers.
-Each type of marker also has its own type-specific options.
-They are described in the sections below.
-.RS
-.TP
-\fB\-bindtags \fItagList\fR
-Specifies the binding tags for the marker. \fITagList\fR is a list
-of binding tag names. The tags and their order will determine how
-events for markers are handled. Each tag in the list matching the
-current event sequence will have its Tcl command executed. Implicitly
-the name of the marker is always the first tag in the list.
-The default value is \f(CWall\fR.
-.TP
-\fB\-coords \fIcoordList\fR
-Specifies the coordinates of the marker. \fICoordList\fR is
-a list of graph-coordinates. The number of coordinates required
-is dependent on the type of marker. Text, image, and window markers
-need only two coordinates (an X\-Y coordinate). Bitmap markers
-can take either two or four coordinates (if four, they represent the
-corners of the bitmap). Line markers
-need at least four coordinates, polygons at least six.
-If \fIcoordList\fR is \f(CW""\fR, the marker will not be displayed.
-The default is \f(CW""\fR.
-.TP
-\fB\-element \fIelemName\fR
-Links the marker with the element \fIelemName\fR. The marker is
-drawn only if the element is also currently displayed (see the
-element's \fBshow\fR operation). If \fIelemName\fR is \f(CW""\fR, the
-marker is always drawn. The default is \f(CW""\fR.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the marker is drawn. If \fIboolean\fR is true,
-the marker is not drawn. The default is \f(CWno\fR.
-.TP
-\fB\-mapx \fIxAxis\fR
-Specifies the X\-axis to map the marker's X\-coordinates onto.
-\fIXAxis\fR must the name of an axis. The default is \f(CWx\fR.
-.TP
-\fB\-mapy \fIyAxis\fR
-Specifies the Y\-axis to map the marker's Y\-coordinates onto.
-\fIYAxis\fR must the name of an axis. The default is \f(CWy\fR.
-.TP
-\fB\-name \fImarkerId\fR
-Changes the identifier for the marker. The identifier \fImarkerId\fR
-can not already be used by another marker. If this option
-isn't specified, the marker's name is uniquely generated.
-.TP
-\fB\-under \fIboolean\fR
-Indicates whether the marker is drawn below/above data
-elements. If \fIboolean\fR is true, the marker is be drawn
-underneath the data elements. Otherwise, the marker is
-drawn on top of the element. The default is \f(CW0\fR.
-.TP
-\fB\-xoffset \fIpixels\fR
-Specifies a screen distance to offset the marker horizontally.
-\fIPixels\fR is a valid screen distance, such as \f(CW2\fR or \f(CW1.2i\fR.
-The default is \f(CW0\fR.
-.TP
-\fB\-yoffset \fIpixels\fR
-Specifies a screen distance to offset the markers vertically.
-\fIPixels\fR is a valid screen distance, such as \f(CW2\fR or \f(CW1.2i\fR.
-The default is \f(CW0\fR.
-.PP
-Marker configuration options may also be set by the \fBoption\fR command.
-The resource class is either \f(CWBitmapMarker\fR, \f(CWImageMarker\fR,
-\f(CWLineMarker\fR, \f(CWPolygonMarker\fR, \f(CWTextMarker\fR, or \f(CWWindowMarker\fR,
-depending on the type of marker. The resource name is the name of the
-marker.
-.CS
-option add *Barchart.TextMarker.Foreground white
-option add *Barchart.BitmapMarker.Foreground white
-option add *Barchart.m1.Background blue
-.CE
-.RE
-.TP
-\fIpathName \fBmarker create \fItype\fR ?\fIoption value\fR?...
-Creates a marker of the selected type. \fIType\fR may be either
-\f(CWtext\fR, \f(CWline\fR, \f(CWbitmap\fR, \f(CWimage\fR, \f(CWpolygon\fR, or
-\f(CWwindow\fR. This command returns the marker identifier,
-used as the \fImarkerId\fR argument in the other marker-related
-commands. If the \fB\-name\fR option is used, this overrides the
-normal marker identifier. If the name provided is already used for
-another marker, the new marker will replace the old.
-.TP
-\fIpathName \fBmarker delete\fR ?\fIname\fR?...
-Removes one of more markers. The graph will automatically be redrawn
-without the marker.\fR.
-.TP
-\fIpathName \fBmarker exists \fImarkerId\fR
-Returns \f(CW1\fR if the marker \fImarkerId\fR exists and \f(CW0\fR
-otherwise.
-.TP
-\fIpathName \fBmarker names\fR ?\fIpattern\fR?
-Returns the names of all the markers that currently exist. If
-\fIpattern\fR is supplied, only those markers whose names match it
-will be returned.
-.TP
-\fIpathName \fBmarker type \fImarkerId\fR
-Returns the type of the marker given by \fImarkerId\fR, such as
-\f(CWline\fR or \f(CWtext\fR. If \fImarkerId\fR is not a valid a marker
-identifier, \f(CW""\fR is returned.
-.SS "BITMAP MARKERS"
-A bitmap marker displays a bitmap. The size of the
-bitmap is controlled by the number of coordinates specified. If two
-coordinates, they specify the position of the top-left corner of the
-bitmap. The bitmap retains its normal width and height. If four
-coordinates, the first and second pairs of coordinates represent the
-corners of the bitmap. The bitmap will be stretched or reduced as
-necessary to fit into the bounding rectangle.
-.PP
-Bitmap markers are created with the marker's \fBcreate\fR operation in
-the form:
-.DS
-\fIpathName \fBmarker create bitmap \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR pairs, each
-sets a configuration options for the marker. These
-same \fIoption\fR\-\fIvalue\fR pairs may be used with the marker's
-\fBconfigure\fR operation.
-.PP
-The following options are specific to bitmap markers:
-.TP
-\fB\-background \fIcolor\fR
-Same as the \fB\-fill\fR option.
-.TP
-\fB\-bitmap \fIbitmap\fR
-Specifies the bitmap to be displayed. If \fIbitmap\fR is \f(CW""\fR,
-the marker will not be displayed. The default is \f(CW""\fR.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the background color of the bitmap. If \fIcolor\fR is the empty
-string, no background will be transparent. The default background color is
-\f(CW""\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Same as the \fB\-outline\fR option.
-.TP
-\fB\-mask \fImask\fR
-Specifies a mask for the bitmap to be displayed. This mask is a bitmap
-itself, denoting the pixels that are transparent. If \fImask\fR is
-\f(CW""\fR, all pixels of the bitmap will be drawn. The default is
-\f(CW""\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the foreground color of the bitmap. The default value is \f(CWblack\fR.
-.TP
-\fB\-rotate \fItheta\fR
-Sets the rotation of the bitmap. \fITheta\fR is a real number
-representing the angle of rotation in degrees. The marker is first
-rotated and then placed according to its anchor position. The default
-rotation is \f(CW0.0\fR.
-.SS "IMAGE MARKERS"
-A image marker displays an image. Image markers are
-created with the marker's \fBcreate\fR operation in the form:
-.DS
-\fIpathName \fBmarker create image \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR
-pairs, each sets a configuration option
-for the marker. These same \fIoption\fR\-\fIvalue\fR pairs may be
-used with the marker's \fBconfigure\fR operation.
-.PP
-The following options are specific to image markers:
-.TP
-\fB\-anchor \fIanchor\fR
-\fIAnchor\fR tells how to position the image relative to the
-positioning point for the image. For example, if \fIanchor\fR
-is \f(CWcenter\fR then the image is centered on the point; if
-\fIanchor\fR is \f(CWn\fR then the image will be drawn such that
-the top center point of the rectangular region occupied by the
-image will be at the positioning point.
-This option defaults to \f(CWcenter\fR.
-.TP
-\fB\-image \fIimage\fR
-Specifies the image to be drawn.
-If \fIimage\fR is \f(CW""\fR, the marker will not be
-drawn. The default is \f(CW""\fR.
-.SS "LINE MARKERS"
-A line marker displays one or more connected line segments.
-Line markers are created with marker's \fBcreate\fR operation in the form:
-.DS
-\fIpathName \fBmarker create line \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR
-pairs, each sets a configuration option
-for the marker. These same \fIoption\fR-\fIvalue\fR pairs may be
-used with the marker's \fBconfigure\fR operation.
-.PP
-The following options are specific to line markers:
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the line. \fIDashList\fR is a list of up to 11
-numbers that alternately represent the lengths of the dashes and gaps
-on the line. Each number must be between 1 and 255. If
-\fIdashList\fR is \f(CW""\fR, the marker line will be solid.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the background color of the line. This color is used with
-striped lines (see the \fB\-fdashes\R option). If \fIcolor\fR is
-the empty string, no background color is drawn (the line will be
-dashed, not striped). The default background color is \f(CW""\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the lines.
-The default width is \f(CW0\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the foreground color of the line. The default value is \f(CWblack\fR.
-.TP
-\fB\-stipple \fIbitmap\fR
-Specifies a stipple pattern used to draw the line, rather than
-a solid line.
-\fIBitmap\fR specifies a bitmap to use as the stipple
-pattern. If \fIbitmap\fR is \f(CW""\fR, then the
-line is drawn in a solid fashion. The default is \f(CW""\fR.
-.SS "POLYGON MARKERS"
-A polygon marker displays a closed region described as two or more
-connected line segments. It is assumed the first and
-last points are connected. Polygon markers are created using the
-marker \fBcreate\fR operation in the form:
-.DS
-\fIpathName \fBmarker create polygon \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR
-pairs, each sets a configuration option
-for the marker. These same \fIoption\fR\-\fIvalue\fR pairs may be
-used with the \fBmarker configure\fR command to change the marker's
-configuration.
-The following options are supported for polygon markers:
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the outline of the polygon. \fIDashList\fR is a
-list of up to 11 numbers that alternately represent the lengths of
-the dashes and gaps on the outline. Each number must be between 1 and
-255. If \fIdashList\fR is \f(CW""\fR, the outline will be a solid line.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the fill color of the polygon. If \fIcolor\fR is \f(CW""\fR, then
-the interior of the polygon is transparent.
-The default is \f(CWwhite\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the outline of the polygon. If \fIpixels\fR is zero,
-no outline is drawn. The default is \f(CW0\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the color of the outline of the polygon. If the polygon is
-stippled (see the \fB\-stipple\fR option), then this represents the
-foreground color of the stipple. The default is \f(CWblack\fR.
-.TP
-\fB\-stipple \fIbitmap\fR
-Specifies that the polygon should be drawn with a stippled pattern
-rather than a solid color. \fIBitmap\fR specifies a bitmap to use as
-the stipple pattern. If \fIbitmap\fR is \f(CW""\fR, then the polygon is
-filled with a solid color (if the \fB\-fill\fR option is set). The
-default is \f(CW""\fR.
-.SS "TEXT MARKERS"
-A text marker displays a string of characters on one or more lines of
-text. Embedded newlines cause line breaks. They may be used to
-annotate regions of the graph. Text markers are created with the
-\fBcreate\fR operation in the form:
-.DS
-\fIpathName \fBmarker create text \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR pairs,
-each sets a configuration option for the text marker.
-These same \fIoption\fR\-\fIvalue\fR pairs may be used with the
-marker's \fBconfigure\fR operation.
-.PP
-The following options are specific to text markers:
-.TP
-\fB\-anchor \fIanchor\fR
-\fIAnchor\fR tells how to position the text relative to the
-positioning point for the text. For example, if \fIanchor\fR is
-\f(CWcenter\fR then the text is centered on the point; if
-\fIanchor\fR is \f(CWn\fR then the text will be drawn such that the
-top center point of the rectangular region occupied by the text will
-be at the positioning point. This default is \f(CWcenter\fR.
-.TP
-\fB\-background \fIcolor\fR
-Same as the \fB\-fill\fR option.
-.TP
-\fB\-font \fIfontName\fR
-Specifies the font of the text. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-120-*\fR.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the background color of the text. If \fIcolor\fR is the empty
-string, no background will be transparent. The default background color is
-\f(CW""\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Same as the \fB\-outline\fR option.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the text should be justified. This matters only when
-the marker contains more than one line of text. \fIJustify\fR must be
-\f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR. The default is
-\f(CWcenter\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the color of the text. The default value is \f(CWblack\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets the padding to the left and right exteriors of the text.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the text is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default is \f(CW4\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets the padding above and below the text. \fIPad\fR can be a list of
-one or two screen distances. If \fIpad\fR has two elements, the area above the
-text is padded by the first distance and the area below by the second.
-If \fIpad\fR is just one distance, both the top and bottom areas
-are padded evenly. The default is \f(CW4\fR.
-.TP
-\fB\-rotate \fItheta\fR
-Specifies the number of degrees to rotate the text. \fITheta\fR is a
-real number representing the angle of rotation. The marker is first
-rotated along its center and is then drawn according to its anchor
-position. The default is \f(CW0.0\fR.
-.TP
-\fB\-text \fItext\fR
-Specifies the text of the marker. The exact way the text is
-displayed may be affected by other options such as \fB\-anchor\fR or
-\fB\-rotate\fR.
-.SS "WINDOW MARKERS"
-A window marker displays a widget at a given position.
-Window markers are created with the marker's \fBcreate\fR operation in
-the form:
-.DS
-\fIpathName \fBmarker create window \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR
-pairs, each sets a configuration option
-for the marker. These same \fIoption\fR\-\fIvalue\fR pairs may be
-used with the marker's \fBconfigure\fR command.
-.PP
-The following options are specific to window markers:
-.TP
-\fB\-anchor \fIanchor\fR
-\fIAnchor\fR tells how to position the widget relative to the
-positioning point for the widget. For example, if \fIanchor\fR is
-\f(CWcenter\fR then the widget is centered on the point; if \fIanchor\fR
-is \f(CWn\fR then the widget will be displayed such that the top center
-point of the rectangular region occupied by the widget will be at the
-positioning point. This option defaults to \f(CWcenter\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the height to assign to the marker's window. If this option
-isn't specified, or if it is specified as \f(CW""\fR, then the window is
-given whatever height the widget requests internally.
-.TP
-\fB\-width \fIpixels\fR
-Specifies the width to assign to the marker's window. If this option
-isn't specified, or if it is specified as \f(CW""\fR, then the window is
-given whatever width the widget requests internally.
-.TP
-\fB\-window \fIpathName\fR
-Specifies the widget to be managed by the barchart. \fIPathName\fR must
-be a child of the \fBbarchart\fR widget.
-.SH "GRAPH COMPONENT BINDINGS"
-Specific barchart components, such as elements, markers and legend
-entries, can have a command trigger when event occurs in them, much
-like canvas items in Tk's canvas widget. Not all event sequences are
-valid. The only binding events that may be specified are those
-related to the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR,
-\fBButtonPress\fR, \fBMotion\fR, and \fBKeyPress\fR).
-.PP
-Only one element or marker can be picked during an event. This means,
-that if the mouse is directly over both an element and a marker, only
-the uppermost component is selected. This isn't true for legend entries.
-Both a legend entry and an element (or marker) binding commands
-will be invoked if both items are picked.
-.PP
-It is possible for multiple bindings to match a particular event.
-This could occur, for example, if one binding is associated with the
-element name and another is associated with one of the element's tags
-(see the \fB\-bindtags\fR option). When this occurs, all of the
-matching bindings are invoked. A binding associated with the element
-name is invoked first, followed by one binding for each of the element's
-bindtags. If there are multiple matching bindings for a single tag,
-then only the most specific binding is invoked. A continue command
-in a binding script terminates that script, and a break command
-terminates that script and skips any remaining scripts for the event,
-just as for the bind command.
-.PP
-The \fB\-bindtags\fR option for these components controls addition
-tag names which can be matched. Implicitly elements and markers
-always have tags matching their names. Setting the value of
-the \fB\-bindtags\fR option doesn't change this.
-.SH "C LANGUAGE API"
-You can manipulate data elements from the C language. There
-may be situations where it is too expensive to translate the data
-values from ASCII strings. Or you might want to read data in a
-special file format.
-.PP
-Data can manipulated from the C language using BLT vectors.
-You specify the X-Y data coordinates of an element as vectors and
-manipulate the vector from C. The barchart will be redrawn automatically
-after the vectors are updated.
-.PP
-From Tcl, create the vectors and configure the element to use them.
-.CS
-vector X Y
-\&.g element configure line1 -xdata X -ydata Y
-.CE
-To set data points from C, you pass the values as arrays of doubles
-using the \fBBlt_ResetVector\fR call. The vector is reset with the
-new data and at the next idle point (when Tk re-enters its event
-loop), the graph will be redrawn automatically.
-.CS
-#include <tcl.h>
-#include <blt.h>
-
-register int i;
-Blt_Vector *xVec, *yVec;
-double x[50], y[50];
-
-/* Get the BLT vectors "X" and "Y" (created above from Tcl) */
-if ((Blt_GetVector(interp, "X", 50, &xVec) != TCL_OK) ||
- (Blt_GetVector(interp, "Y", 50, &yVec) != TCL_OK)) {
- return TCL_ERROR;
-}
-
-for (i = 0; i < 50; i++) {
- x[i] = i * 0.02;
- y[i] = sin(x[i]);
-}
-
-/* Put the data into BLT vectors */
-if ((Blt_ResetVector(xVec, x, 50, 50, TCL_VOLATILE) != TCL_OK) ||
- (Blt_ResetVector(yVec, y, 50, 50, TCL_VOLATILE) != TCL_OK)) {
- return TCL_ERROR;
-}
-.CE
-See the \fBvector\fR manual page for more details.
-.SH SPEED TIPS
-There may be cases where the bar chart needs to be drawn and updated as
-quickly as possible. If drawing speed becomes a big
-problem, here are a few tips to speed up displays.
-.TP 2
-\(bu
-Try to minimize the number of data points. The more data points
-looked at, the more work the bar chart must do.
-.TP 2
-\(bu
-If your data is generated as floating point values, the time required
-to convert the data values to and from ASCII strings can be
-significant, especially when there any many data points. You can
-avoid the redundant string-to-decimal conversions using the C API to
-BLT vectors.
-.TP 2
-\(bu
-Don't stipple or dash the element. Solid bars are much faster.
-.TP 2
-\(bu
-If you update data elements frequently, try turning off the
-widget's \fB\-bufferelements\fR option. When the bar chart is first
-displayed, it draws data elements into an internal pixmap. The pixmap
-acts as a cache, so that when the bar chart needs to be redrawn again, and
-the data elements or coordinate axes haven't changed, the pixmap is
-simply copied to the screen. This is especially useful when you are
-using markers to highlight points and regions on the bar chart. But if
-the bar chart is updated frequently, changing either the element data or
-coordinate axes, the buffering becomes redundant.
-.SH LIMITATIONS
-Auto-scale routines do not use requested min/max limits
-as boundaries when the axis is logarithmically scaled.
-.PP
-The PostScript output generated for polygons with more than 1500
-points may exceed the limits of some printers (See PostScript Language
-Reference Manual, page 568). The work-around is to break the polygon
-into separate pieces.
-.SH KEYWORDS
-bar chart, widget
diff --git a/blt3.0.1/man/beep.mann b/blt3.0.1/man/beep.mann
deleted file mode 100644
index ced245c..0000000
--- a/blt3.0.1/man/beep.mann
+++ /dev/null
@@ -1,48 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-.so man.macros
-.TH beep n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-beep \- ring the bell
-.SH SYNOPSIS
-\fBbeep\fR ?\fIpercent\fR?
-.BE
-.SH DESCRIPTION
-The \fBbeep\fR command rings the keyboard bell. \fIPercent\fR is
-relative to the base volume of the keyboard bell and can range from
--100 to 100 inclusive.
-.PP
-If \fIpercent\fR is nonnegative then the bell volume is:
-.CS
-base - [(base * \fIpercent\fR) / 100] + \fIpercent\fR
-.CE
-If \fIpercent\fR is negative then the bell volume is:
-.CS C
-base + [(base * \fIpercent\fR) / 100]
-.CE
-The default \fIpercent\fR is 50.
-.SH EXAMPLE
-.CS
-beep
-.CE
-.SH KEYWORDS
-bell, beep
diff --git a/blt3.0.1/man/bgexec.mann b/blt3.0.1/man/bgexec.mann
deleted file mode 100644
index 82d7a45..0000000
--- a/blt3.0.1/man/bgexec.mann
+++ /dev/null
@@ -1,309 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Bgexec command created by George Howlett.
-'\"
-.so man.macros
-.TH bgexec n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-\fBbgexec\fR \- Run programs in the background while handling Tk events.
-.SH SYNOPSIS
-\fBblt::bgexec \fIvarName\fR ?\fIoption value\fR?... \fIprogram\fR ?\fIarg\fR?...
-.BE
-.SH DESCRIPTION
-.PP
-The \fBbgexec\fR command executes programs in the background,
-allowing Tk to handle events. A global Tcl variable \fIvarName\fR is
-set when the program has completed.
-.SH INTRODUCTION
-Tcl's \fBexec\fR command is very useful for gathering information from
-the operating system. It runs a program and returns the output as its
-result. This works well for Tcl-only applications. But
-for Tk applications, a problem occurs when the program takes time to
-process. Let's say we want the get the disk usage of a
-directory. We'll use the Unix program \f(CWdu\fR to get the summary.
-.CS
-set out [exec du -s $dir]
-puts "Disk usage for $dir is $out"
-.CE
-While \f(CWdu\fR is running, scrollbars won't respond. None of the Tk
-widgets will be redrawn properly. The \fBsend\fR command won't work.
-And the worst part is that the application appears hung up or dead.
-The problem is that while \fBexec\fR is waiting for \fIdu\fR to
-finish, Tk is not able to handle X events.
-.PP
-The \fBbgexec\fR command performs the same functions as \fBexec\fR,
-but also allows Tk to handle events. You can execute a long-running
-program and the Tk widgets will behave normally. When the
-program finishes, its output and the exit status are written to Tcl
-variables. This makes it easy to monitor and save the output of a
-program.
-.SH EXAMPLE
-Here is the disk usage example again, this time using \fBbgexec\fR.
-The syntax to invoke "du" is exactly the same as the previous
-example, when we used \fBexec\fR.
-.CS
-global myStatus myOutput
-blt::bgexec myStatus -output myOutput du -s $dir
-puts "Disk usage for $dir is $myOutput"
-.CE
-Two global variables, \f(CWmyStatus\fR and \f(CWmyOutput\fR, will be set by
-\fBbgexec\fR when \f(CWdu\fR has completed. \f(CWMyStatus\fR
-will contain the program's exit status. \f(CWMyOutput\fR, specified by the
-\fB\-output\fR option, will store the output of the program.
-.PP
-You can also terminate the program by setting the variable
-\f(CWmyStatus\fR. If \f(CWmyStatus\fR is set before \f(CWdu\fR has
-completed, the process is killed. Under Unix, this is done sending by
-a configurable signal (by default it's SIGKILL). Under Win32, this
-is done by calling \fBTerminateProcess\fR. It makes no
-difference what \f(CWmyStatus\fR is set to.
-.CS
-set myStatus {}
-.CE
-There are several \fBbgexec\fR options to collect different types of
-information.
-.CS
-global myStatus myOutput myErrs
-blt::bgexec myStatus -output myOutput -error myErrs du -s $dir
-.CE
-The \fB\-error\fR option is similar to \fB\-output\fR. It sets a global
-variable when the program completes. The variable will contain
-any data written to stderr by the program.
-.PP
-The \fB\-output\fR and \fB\-error\fR variables are set only
-after the program completes. But if the program takes a long time, to
-run you may want to receive its partial output. You can gather data
-as it becomes available using the \fB\-onoutput\fR option. It
-specifies a Tcl command prefix. Whenever new data is available, this
-command is executed, with the data appended as an argument to the
-command.
-.CS
-proc GetInfo { data } {
- puts $data
-}
-blt::bgexec myStatus -onoutput GetInfo du -s $dir
-.CE
-When output is available, the procedure \f(CWGetInfo\fR is called.
-The \fB\-onerror\fR option performs a similar function for the stderr
-data stream.
-.PP
-Like \fBexec\fR, \fBbgexec\fR returns an error if the exit code of the
-program is not zero. If you think you may get a non-zero exit
-code, you might want to invoke \fBbgexec\fR from within a \fBcatch\fR.
-.CS
-catch { blt::bgexec myStatus -output myOutput du -s $dir }
-.CE
-By default, \fBbgexec\fR will wait for the program to finish.
-But you can detach the program making ampersand (&) the last
-argument on the command line.
-.CS
-global myStatus myOutput
-blt::bgexec myStatus -output myOutput du -s $dir &
-.CE
-\fBBgexec\fR will return immediately and its result will be a list of
-the spawned process ids. If at some point you need to wait for the
-program to finish up, you can use \fBtkwait\fR. When the program
-finishes, the variable \f(CWmyStatus\fR will be written to, breaking
-out the \fBtkwait\fR command.
-.CS
-global myStatus myOutput
-blt::bgexec myStatus -output myOutput du -s $dir &
- ...
-tkwait variable myStatus
-.CE
-.SH SYNTAX
-The \fBbgexec\fR command takes the following form:
-.sp
-\fB blt::bgexec \fIvarName\fR ?\fIoption value\fR?... \fIprogram\fR ?\fIarg\fR?...
-.sp
-\fIVarName\fR is the name of a global variable which is set when
-\fIprogram\fR has finished executing. The exit status of
-will be stored in \fIvarName\fR. The exit status is a
-list of a status token, the process-id of the program, the exit code,
-and a status message. You can also prematurely terminate the program
-by setting \fIvarName\fR. Under Unix, the program will be sent a signal to
-terminate it (by default the signal is a SIGKILL; see the
-\fB\-killsignal\fR option).
-.PP
-\fIProgram\fR is the name of the program to be executed and \fIargs\fR
-are any extra arguments for \fIprogram\fR. The syntax of
-\fIprogram\fR and \fIargs\fR is the same as the \fBexec\fR command. So
-you can redirect I/O, execute pipelines, etc. (see the \fBexec\fR
-manual for further information) just like \fBexec\fR. If the last
-argument is an ampersand (&), the program will be run detached, and
-\fBbgexec\fR will return immediately. \fIVarName\fR will still be set
-with the return status when \fIprogram\fR completes.
-.SH OPTIONS
-\fIOption\fR refers to the switch name always beginning with a dash (\-).
-\fIValue\fR is the value of the option. Option-value pairs are
-terminated either by the program name, or double dashes (\-\-).
-The following options are available for \fBbgexec\fR:
-.TP
-\fB\-decodeerror \fIencodingName\fR
-.br
-Specifies the encoding of the stderr channel.
-This affects only data returned to the Tcl interpreter. No translation
-is done on file redirection.
-.br
-For example if data is to be converted from Unicode for use in Tcl,
-you would use the "unicode" encoding. The default is that no
-tranlation is performed.
-.TP
-\fB\-decodeoutput \fIencodingName\fR
-.br
-Specifies the encoding of the stdout channels.
-This affects only data returned to the Tcl interpreter. No translation
-is done on file redirection.
-.br
-For example if data is to be converted from Unicode for use in Tcl,
-you would use the "unicode" encoding. The default is that no
-tranlation is performed.
-.TP
-\fB\-error \fIvarName\fR
-.br
-Specifies that a global variable \fIvarName\fR is to be set with the
-contents of stderr after the program has completed.
-.TP
-\fB\-keepnewline \fIboolean\fR
-Specifies that a trailing newline should be retained in the
-output. If \fIboolean\fR is true, the trailing newline is truncated
-from the output of the \fB\-onoutput\fR and \fB\-output\fR variables.
-The default value is \f(CWtrue\fR.
-.TP
-\fB\-killsignal \fIsignal\fR
-Specifies the signal to be sent to the program when
-terminating. This is available only under Unix.
-\fISignal\fR can either be a number (typically 1-32) or
-a mnemonic (such as SIGINT). If \fIsignal\fR is the empty string,
-then no signal is sent. The default signal is \f(CW9\fR (SIGKILL).
-.TP
-\fB\-lasterror \fIvarName\fR
-Specifies a variable \fIvarName\fR that is updated whenever data
-becomes available from standard error of the program.
-\fIVarName\fR is a global variable. Unlike the \fB\-error\fR option,
-data is available as soon as it arrives.
-.TP
-\fB\-lastoutput \fIvarName\fR
-Specifies a variable \fIvarName\fR that is updated whenever data
-becomes available from standard output of the program.
-\fIVarName\fR is a global variable. Unlike the \fB\-output\fR option,
-data is available as soon as it arrives.
-.TP
-\fB\-linebuffered \fIboolean\fR
-Specifies that updates should be made on a line-by-line basis.
-Normally when new data is available \fBbgexec\fR will set the variable
-(\fB\-lastoutput\fR and \fB\-lasterror\fR options) or invoke the
-command (\fB\-onoutput\fR and \fB\-onerror\fR options) delivering all
-the new data currently available. If \fIboolean\fR is true, only one
-line at a time will be delivered. This can be useful when you want to
-process the output on a line-by-line basis.
-The default value is
-\f(CWfalse\fR.
-.TP
-\fB\-output \fIvarName\fR
-.br
-Specifies that a global variable \fIvarName\fR is to be set with the
-output of the program, once it has completed. If this option
-is not set, no output will be accumulated.
-.TP
-\fB\-onerror \fIcommand\fR
-Specifies the start of a Tcl command that will be executed
-whenever new data is available from standard error. The data
-is appended to the command as an extra argument before it is
-executed.
-.TP
-\fB\-onoutput \fIcommand\fR
-Specifies the start of a Tcl command that will be executed
-whenever new data is available from standard output. The data
-is appended to the command as an extra argument before it is
-executed.
-.TP
-\fB\-update \fIvarName\fR
-Deprecated. This option is replaced by \fB\-lasterror\fR.
-.TP
-\fB\-\|\-\fR
-This marks the end of the options. The following argument will
-be considered the name of a program even if it starts with
-a dash (\fB\-\fR).
-.SH PREEMPTION
-Because \fBbgexec\fR allows Tk to handle events while a program is
-running, it's possible for an application to preempt itself with
-further user-interactions. Let's say your application has a button
-that runs the disk usage example. And while the \f(CWdu\fR program is
-running, the user accidently presses the button again. A second
-\fBbgexec\fR program will preempt the first. What this means is that
-the first program can not finish until the second program has
-completed.
-.PP
-Care must be taken to prevent an application from preempting itself by
-blocking further user-interactions (such as button clicks). The BLT
-\fBbusy\fR command is very useful for just these situations.
-See the \fBbusy\fR manual for details.
-.SH DIFFERENCES WITH FILEEVENT
-Since Tk 4.0, a subset of \fBbgexec\fR can be also achieved using the
-\fBfileevent\fR command. The steps for running a program in the
-background are:
-.PP
-Execute the program with the \fBopen\fR command (using the "|"
-syntax) and save the file handle.
-.CS
-global fileId
-set fileId [open "|du -s $dir" r]
-.CE
-Next register a Tcl code snippet with \fBfileevent\fR to be run
-whenever output is available on the file handle. The code snippet
-will read from the file handle and save the output in a variable.
-.CS
-fileevent fileId readable {
- if { [gets $fileId line] < 0 } {
- close $fileId
- set output $temp
- unset fileId temp
- } else {
- append temp $line
- }
-}
-.CE
-.PP
-The biggest advantage of \fBbgexec\fR is that, unlike \fBfileevent\fR,
-it requires no additional Tcl code to run a program. It's simpler and
-less error prone. You don't have to worry about non-blocking I/O.
-It's handled tranparently for you.
-.PP
-\fBBgexec\fR runs programs that \fBfileevent\fR can not.
-\fBFileevent\fR assumes that the when stdout is closed the program has
-completed. But some programs, like the Unix \f(CWcompress\fR program,
-reopen stdout, fooling \fBfileevent\fR into thinking the program has
-terminated. In the example above, we assume that the program will
-write and flush its output line-by-line. However running another
-program, your application may block in the \fBgets\fR command reading
-a partial line.
-.PP
-\fBBgexec\fR lets you get back the exit status of the program. It also
-allows you to collect data from both stdout and stderr simultaneously.
-Finally, since data collection is handled in C code, \fBbgexec\fR is
-faster. You get back to the Tk event loop more quickly, making your
-application seem more responsive.
-.SH SEE ALSO
-busy, exec, tkwait
-.SH KEYWORDS
-exec, background, busy
diff --git a/blt3.0.1/man/bitmap.mann b/blt3.0.1/man/bitmap.mann
deleted file mode 100644
index 437f84a..0000000
--- a/blt3.0.1/man/bitmap.mann
+++ /dev/null
@@ -1,219 +0,0 @@
-'\"
-'\" Copyright 1991-2001 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Bitmap command created by George Howlett.
-'\"
-.so man.macros
-.TH bitmap n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-\fBbitmap\fR \- Define a new bitmap from a Tcl script
-.SH SYNOPSIS
-\fBblt::bitmap define \fIbitmapName data\fR ?\fIoption value\fR?...
-.sp
-\fBblt::bitmap compose \fIbitmapName text\fR ?\fIoption value\fR?...
-.sp
-\fBblt::bitmap exists \fIbitmapName\fR
-.sp
-\fBblt::bitmap source \fIbitmapName\fR
-.sp
-\fBblt::bitmap data \fIbitmapName\fR
-.sp
-\fBblt::bitmap height \fIbitmapName\fR
-.sp
-\fBblt::bitmap width \fIbitmapName\fR
-.BE
-.SH DESCRIPTION
-The \fBbitmap\fR command lets you create new bitmaps directly from your
-Tcl script. The bitmap can be specified as a list of data or a text string
-which is converted into a bitmap. You can arbitrarily scale
-or rotate the bitmap too.
-.SH INTRODUCTION
-Bitmaps are commonly used within Tk. In label and button widgets, you
-display bitmaps them instead of text strings and in the canvas and
-text widgets, they're used for stippling. But Tk let's you can create
-new bitmaps only by reading the bitmap data from a file. This makes
-bitmaps cumbersome to manage, especially in packaging the program as a
-\fBwish\fR script, since each bitmap must be its own file. It would
-be nicer if you could create new bitmaps directly from your Tcl script.
-.PP
-The \fBbitmap\fR command lets you do just that. You can specify the
-bitmap as in various formats (such as the X11 bitmap format). You can
-also compose a bitmap from a text string. The \fBbitmap\fR command
-also lets you and arbitrarily rotate or scale the bitmap. For example, you
-could use this to create button widgets with the text label rotated 90
-degrees.
-.SH EXAMPLE
-You can define a new bitmap with the \fBdefine\fR operation. For
-example, let's say you are using the X11 bitmap "gray1". Normally to
-use it, you would specify the location of the file.
-.CS
-label .l -bitmap @/usr/X11R6/include/X11/bitmaps/gray1
-.CE
-But you can simply cut and paste the contents of "gray1" into the
-\fBbitmap\fR command.
-.CS
-blt::bitmap define gray1 {
- #define gray1_width 2
- #define gray1_height 2
- static char gray1_bits[] = {
- 0x01, 0x02};
-}
-label .l -bitmap gray1
-.CE
-Tk will recognize "gray1" as a bitmap which can now be used with any
-widget that accepts bitmaps.
-.CS
-.barchart element configure elem1 -stipple gray1
-.CE
-The bitmap data can be specified in a mulitude of forms.
-The following commands are all equivalent.
-.CS
-blt::bitmap define gray1 {
- #define gray1_width 2
- #define gray1_height 2
- static char gray1_bits[] = {
- 0x01, 0x02};
-}
-blt::bitmap define gray1 { { 2 2 } { 0x01, 0x02 } }
-blt::bitmap define gray1 { { 2 2 } { 0x01 0x02 } }
-blt::bitmap define gray1 { { 2 2 } { 1 2 } }
-.CE
-Either the data is in the standard X11 bitmap form, or it's a list of
-two lists. The first list contains the height and width of the bitmap.
-The second list is the bitmap source data. Each element of that list
-is an hexadecimal number specifying which pixels are foreground (1)
-and which are background (0) of the bitmap. Note that the format of
-the source data is exactly that of the XBM format.
-.P
-You can scale or rotate the bitmap as you create it, by using the
-\fB-scale\fR or\fB-rotate\fR options.
-.CS
-blt::bitmap define gray1 {
- #define gray1_width 2
- #define gray1_height 2
- static char gray1_bits[] = {
- 0x01, 0x02};
-} -scale 2.0 -rotate 90.0
-.CE
-In addition, you can compose bitmaps from text strings. This makes it
-easy to create rotated buttons or labels. The text string can have
-multi-line.
-.CS
-blt::bitmap compose rot_text "This is rotated\\ntext" \\
- -rotate 90.0 -font fixed
-.CE
-There are also a number of ways to query bitmaps. This isn't limited
-to bitmaps that you create, but any bitmap.
-.CS
-blt::bitmap exists rot_text
-blt::bitmap width rot_text
-blt::bitmap height rot_text
-blt::bitmap data rot_text
-blt::bitmap source rot_text
-.CE
-The \fBexists\fR operation indicates if a bitmap by that name is
-defined. You can query the dimensions of the bitmap using the
-\fBwidth\fR and \fBheight\fR operations. The \fBdata\fR operation
-returns the list of the data used to create the bitmap.
-For example, you could query the data of a bitmap and \fBsend\fR
-it across the network to another Tk application.
-.CS
-set data [blt::bitmap data @/usr/X11R6/include/X11/bitmaps/ghost.xbm]
-send {wish #2} blt::bitmap define ghost $data
-.CE
-.SH OPERATIONS
-The following operations are available for \fBbitmap\fR:
-.TP
-\fBblt::bitmap compose \fIbitmapName text \fR?\fIoption value\fR?...
-Creates a bitmap \fIbitmapName\fR from the text string \fItext\fR.
-A bitmap \fIbitmapName\fR can not already exist.
-The following options are available.
-.RS
-.TP
-\fB\-font \fIfontName\fR
-Specifies a font to use when drawing text into the bitmap.
-If this option isn't specified then \fIfontName\fR defaults to
-\f(CW*-Helvetica-Bold-R-Normal-*-140-*\fR.
-.TP
-\fB\-rotate \fItheta\fR
-Specifies the angle of rotation of the text in the bitmap.
-\fITheta\fR is a real number representing the angle in degrees.
-It defaults to \f(CW0.0\fR degrees.
-.TP
-\fB\-scale \fIvalue\fR
-Specifies the scale of the bitmap.
-\fIValue\fR is a real number representing the scale. A scale
-of 1.0 indicates no scaling is necessary, while 2.0 would
-double the size of the bitmap. There is no way to specify
-differents scales for the width and height of the bitmap.
-The default scale is \f(CW1.0\fR.
-.RE
-.TP
-\fBblt::bitmap data \fIbitmapName\fR
-Returns a list of both the
-dimensions of the bitmap \fIbitmapName\fR and its source data.
-.TP
-\fBblt::bitmap define \fIbitmapName data\fR \fR?\fIoption value\fR?...
-Associates \fIbitmapName\fR with in-memory bitmap data so that
-\fIbitmapName\fR can be used in later calls to \fBTk_GetBitmap\fR.
-The \fIbitmapName\fR argument is the name of the bitmap; it must not
-previously have been defined in either a call to Tk_DefineBitmap or
-\fBbitmap\fR. The argument \fIdata\fP describes the bitmap to
-be created. It is either the X11 bitmap format (a C structure) or
-a list of two lists: the dimensions and source data. The dimensions
-are a list of two numbers which are the width
-and height of the bitmap. The source data is a list of hexadecimal
-values in a format similar to the X11 or X10 bitmap format. The
-values may be optionally separated by commas and do not need to be
-prefixed with "0x". The following options are available.
-.RS
-.TP
-\fB\-rotate \fItheta\fR
-Specifies how many degrees to rotate the bitmap.
-\fITheta\fR is a real number representing the angle.
-The default is \f(CW0.0\fR degrees.
-.TP
-\fB\-scale \fIvalue\fR
-Specifies how to scale the bitmap.
-\fIValue\fR is a real number representing the scale. A scale
-of 1.0 indicates no scaling is necessary, while 2.0 would
-double the size of the bitmap. There is no way to specify
-differents scales for the width and height of the bitmap.
-The default scale is \f(CW1.0\fR.
-.RE
-.TP
-\fBblt::bitmap exists \fIbitmapName\fR
-Returns \f(CW1\fR if a bitmap \fIbitmapName\fR exists, otherwise \f(CW0\fR.
-.TP
-\fBblt::bitmap height \fIbitmapName\fR
-Returns the height in pixels of the bitmap \fIbitmapName\fR.
-.TP
-\fBblt::bitmap source \fIbitmapName\fR
-Returns the source data of the bitmap \fIbitmapName\fR. The source data is a
-list of the hexadecimal values.
-.TP
-\fBblt::bitmap width \fIbitmapName\fR
-Returns the width in pixels of the bitmap \fIbitmapName\fR.
-.SH LIMITATIONS
-Tk currently offers no way of destroying bitmaps. Once a bitmap is
-created, it exists until the application terminates.
-.SH KEYWORDS
-bitmap
diff --git a/blt3.0.1/man/bltdebug.mann b/blt3.0.1/man/bltdebug.mann
deleted file mode 100644
index ecb3f86..0000000
--- a/blt3.0.1/man/bltdebug.mann
+++ /dev/null
@@ -1,38 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-.so man.macros
-.TH bltdebug n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-bltdebug \- print Tcl commands before execution
-.SH SYNOPSIS
-\fBbltdebug\fR ?\fIlevel\fR?
-.BE
-.SH DESCRIPTION
-The \fBbltdebug\fR command is a simple tracing facility for Tcl commands.
-Each command line is printed before it is executed on standard error.
-The output consists of the command line both before and after
-substitutions have occurred. \fILevel\fR indicates at what level to
-stop tracing commands. If \fIlevel\fR is \f(CW0\fR, no tracing is
-performed. This is the default. If no \fIlevel\fR argument is given,
-the current level is printed.
-.SH KEYWORDS
-debug
diff --git a/blt3.0.1/man/busy.mann b/blt3.0.1/man/busy.mann
deleted file mode 100644
index a29f209..0000000
--- a/blt3.0.1/man/busy.mann
+++ /dev/null
@@ -1,260 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Busy command created by George Howlett.
-'\"
-.so man.macros
-.TH busy n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-\fBbusy\fR \- Make Tk widgets busy, temporarily blocking user interactions.
-.SH SYNOPSIS
-\fBblt::busy hold \fIwindow\fR ?\fIoption value\fR?...
-.sp
-\fBblt::busy release \fIwindow\fR ?\fIwindow\fR?...
-.sp
-\fBblt::busy configure \fIwindow\fR ?\fIoption value\fR?...
-.sp
-\fBblt::busy forget \fIwindow\fR ?\fIwindow\fR?...
-.sp
-\fBblt::busy isbusy \fR?\fIpattern\fR?
-.sp
-\fBblt::busy names \fR?\fIpattern\fR?
-.sp
-\fBblt::busy status \fIwindow\fR
-.BE
-.SH DESCRIPTION
-.PP
-The \fBbusy\fR command provides a simple means to block
-keyboard, button, and pointer events from Tk widgets, while overriding
-the widget's cursor with a configurable busy cursor.
-.SH INTRODUCTION
-.PP
-There are many times in applications where you want to temporarily
-restrict what actions the user can take. For example, an application
-could have a "run" button that when pressed causes some processing to
-occur. But while the application is busy processing, you probably don't
-want the the user to be able to click the "run" button again. You
-may also want restrict the user from other tasks such as clicking a
-"print" button.
-.PP
-The \fBbusy\fR command lets you make Tk widgets busy. This means
-that user interactions such as button clicks, moving the mouse, typing
-at the keyboard, etc. are ignored by the widget. You can set a
-special cursor (like a watch) that overrides the widget's normal
-cursor, providing feedback that the application (widget) is
-temporarily busy.
-.PP
-When a widget is made busy, the widget and all of its descendents will
-ignore events. It's easy to make an entire panel of widgets busy. You
-can simply make the toplevel widget (such as ".") busy. This is
-easier and far much more efficient than recursively traversing the
-widget hierarchy, disabling each widget and re-configuring its cursor.
-.PP
-Often, the busy command can be used instead of Tk's \fBgrab\fR
-command. Unlike \fBgrab\fR which restricts all user interactions to
-one widget, with the busy command you can have more than one widget
-active (for example, a "cancel" dialog and a "help" button).
-.SH EXAMPLE
-You can make several widgets busy by simply making its ancestor widget
-busy using the \fBhold\fR operation.
-.CS
-frame .top
-button .top.button; canvas .top.canvas
-pack .top.button .top.canvas
-pack .top
- . . .
-blt::busy hold .top
-update
-.CE
-All the widgets within \f(CW.top\fR (including \f(CW.top\fR) are now busy.
-Using \fBupdate\fR insures that \fBbusy\fR command will take effect before
-any other user events can occur.
-.PP
-When the application is no longer busy processing, you can allow user
-interactions again by the \fBrelease\fR operation.
-.nf
-
-\f(CW blt::busy release .top \fR
-
-.fi
-The busy window has a configurable cursor. You can change the busy
-cursor using the \fBconfigure\fR operation.
-.nf
-
-\f(CW blt::busy configure .top -cursor "watch"\fR
-
-.fi
-Finally, when you no longer need to the busy window,
-invoke the \fBforget\fR operation to free any resources it allocated.
-.nf
-
-\f(CW blt::busy forget .top \fR
-
-.fi
-Destroying the widget will also clean up any resources allocated by
-the busy command.
-.PP
-.SH OPERATIONS
-The following operations are available for the \fBbusy\fR command:
-.TP
-\fBblt::busy hold \fIwindow\fR ?\fIoption value\fR?...
-Makes the widget \fIwindow\fR (and its descendants in the Tk window
-hierarchy) busy. \fIWindow\fR must be a valid path name of a Tk
-widget. The busy window is mapped the next time idle tasks are
-processed, and the widget and its descendants will be blocked from
-user interactions. All events in the widget window and its
-descendants are ignored. Normally \fBupdate\fR should be called
-immediately afterward to insure that the \fBhold\fR operation is in
-effect \fIbefore\fR the application starts its processing. The
-following configuration options are valid:
-.RS
-.TP
-\fB\-cursor \fIcursorName\fR
-Specifies the cursor to be displayed when the widget is made busy.
-\fICursorName\fR can be in any form accepted by \fBTk_GetCursor\fR.
-The default cursor is \f(CWwatch\fR.
-.RE
-.TP
-\fBblt::busy configure \fIwindow\fR ?\fIoption value\fR?...
-Queries or modifies the \fBbusy\fR command configuration options for
-\fIwindow\fR. \fIWindow\fR must be the path name of a widget previously
-made busy by the \fBhold\fR operation. If no options are
-specified, a list describing all of the available options for
-\fIwindow\fR (see \fBTk_ConfigureInfo\fR for information on the format
-of this list) is returned. If \fIoption\fR is specified with no
-\fIvalue\fR, then the command returns a list describing the one named
-option (this list will be identical to the corresponding sublist of
-the value returned if no \fIoption\fR is specified). If one or more
-\fIoption\-value\fR pairs are specified, then the command modifies the
-given widget option(s) to have the given value(s); in this case the
-command returns the empty string. \fIOption\fR may have any of the
-values accepted by the \fBhold\fR operation.
-.sp
-Please note that the
-option database is referenced through \fIwindow\fR. For example, if
-the widget \f(CW.frame\fR is to be made busy, the busy
-cursor can be specified for it by either \fBoption\fR command:
-.nf
-
- \f(CWoption add *frame.busyCursor gumby\fR
- \f(CWoption add *Frame.BusyCursor gumby\fR
-
-.fi
-.TP
-\fBblt::busy forget \fIwindow\fR ?\fIwindow\fR?...
-Releases resources allocated by the busy command for \fIwindow\fR,
-including the busy window. User events will again be received again
-by \fIwindow\fR. Resources are also released when \fIwindow\fR
-is destroyed. \fIWindow\fR must be the name of a widget specified
-in the \fBhold\fR operation, otherwise an error is reported.
-.TP
-\fBblt::busy check \fIwindow\fR
-Checks if \fIwindow\fR or any of its ancestors are currently busy. If
-\fIwindow\fR is presently busy (it can not receive user interactions)
-\f(CW1\fR is returned, otherwise \f(CW0\fR.
-.TP
-\fBblt::busy isbusy \fR?\fIpattern\fR?
-Returns the pathnames of all widgets that are currently busy.
-If a \fIpattern\fR is given, the path names of busy widgets
-matching \fIpattern\fR are returned.
-.TP
-\fBblt::busy names \fR?\fIpattern\fR?
-Returns the pathnames of all widgets that have previously been
-made busy (i.e. a busy window is allocated and associated with the
-widget). It makes no difference if the window is currently busy or
-not. If a \fIpattern\fR is given, the path names of busy widgets
-matching \fIpattern\fR are returned.
-.TP
-\fBblt::busy release \fIwindow\fR ?\fIwindow\fR?...
-Restores user interactions to the widget \fIwindow\fR again.
-This differs from the \fBforget\fR operation in that the busy window
-is not destroyed, but simply unmapped.
-\fIWindow\fR must be the name of a widget specified
-in a \fBhold\fR operation, otherwise an error is reported.
-.TP
-\fBblt::busy status \fIwindow\fR
-Returns the status of a widget \fIwindow\fR previously made busy.
-An error is reported if \fIwindow\fR does not was never made busy, or
-the \fBforget\fR operation was invoked (i.e. does not currently have a
-busy window associated with it). If \fIwindow\fR is presently can
-not receive user interactions, \f(CW1\fR is returned, otherwise \f(CW0\fR.
-.sp 1
-.SH BINDINGS
-The event blocking feature is implemented by creating and mapping a
-transparent window that completely covers the widget. When the busy
-window is mapped, it invisibly shields the widget and its hierarchy
-from all events that may be sent. Like Tk widgets, busy windows have
-widget names in the Tk window hierarchy. This means that you can use
-the \fBbind\fR command, to handle events in the busy window.
-.CS
-blt::busy hold .frame.canvas
-bind .frame.canvas_Busy <Enter> { ... }
-.CE
-.PP
-Normally the busy window is a sibling of the widget. The
-name of the busy window is "\fIwidget\f(CW_Busy\fR" where \fIwidget\fR
-is the name of the widget to be made busy. In the previous example, the
-pathname of the busy window is "\f(CW.frame.canvas_Busy\fR" The
-exception is when the widget is a toplevel widget (such as ".") where
-the busy window can't be made a sibling. The busy window is then a
-child of the widget named "\fIwidget\f(CW._Busy\fR" where \fIwidget\fR
-is the name of the toplevel widget. In the following example, the
-pathname of the busy window is "\f(CW._Busy\fR"
-.CS
-blt::busy hold .
-bind ._Busy <Enter> { ... }
-.CE
-.SH ENTER/LEAVE EVENTS
-Mapping and unmapping busy windows generates Enter/Leave events for
-all widgets they cover. Please note this if you are tracking
-Enter/Leave events in widgets.
-.SH KEYBOARD EVENTS
-When a widget is made busy, the widget is prevented from gaining the
-keyboard focus by the busy window. But if the widget already had
-focus, it still may received keyboard events. To prevent this, you
-must move focus to another window.
-.CS
-blt::busy hold .frame
-label .dummy
-focus .dummy
-update
-.CE
-The above example moves the focus from .frame immediately after
-invoking the \fBhold\fR so that no keyboard events will be sent to
-\f(CW.frame\fR or any of its descendants.
-.PP
-Tk's tab traversal mechanism should be also modified to check for busy
-windows. You can do this by adding a simple test to "tkFocusOK". Here's
-an example.
-.CS
-tk_focusNext .
-rename tkFocusOK tkFocusOK.orig
-proc tkFocusOK { w } {
- if { [blt::busy check $w] } {
- return 0
- }
- return [tkFocusOK.orig $w]
-}
-.CE
-.SH KEYWORDS
-busy, keyboard events, pointer events, window, cursor
-
-
diff --git a/blt3.0.1/man/container.mann b/blt3.0.1/man/container.mann
deleted file mode 100644
index 682fff3..0000000
--- a/blt3.0.1/man/container.mann
+++ /dev/null
@@ -1,303 +0,0 @@
-'\"
-'\" Copyright 1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Container widget created by George Howlett.
-'\"
-.so man.macros.in
-.TH container n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-container \- Widget to contain a foreign window.
-.BE
-.SH SYNOPSIS
-\fBcontainer\fR \fIpathName \fR?\fIoptions\fR?
-.SH DESCRIPTION
-The \fBcontainer\fR widget lets you embed an X11 window from a foreign
-application into your Tk application. The foreign window is
-reparented inside of the widget. You can then place and arrange the
-container just as you would any Tk widget.
-.SH INTRODUCTION
-Notebooks are a popular graphical paradigm. They allow you to organize
-many windows in a single widget. For example, you might have an
-application the displays several X-Y graphs at the same time.
-Typically, you can't pack the graphs into the same \fBframe\fR because
-they are too large. The other alternative is to pack the graphs into
-several \fBtoplevel\fR widgets, allowing them to overlap on the
-screen. The problem is that all the different toplevel windows
-clutter the screen and are difficult to manage.
-.PP
-The \fBcontainer\fR widget lets organize your application by displaying
-each graph as a page in a folder of a notebook. Only one page is
-visible at a time. When you click on a tab, the folder (graph)
-corresponding to the tab is displayed in the \fBcontainer\fR widget. The
-container also lets you temporarily tear pages out of the notebook into a
-separate toplevel widget, and put them back in the container later. For
-example, you could compare two graphs side-by-side by tearing them
-out, and then replace them when you are finished.
-.PP
-A container may contain an unlimited number of folders. If there are too
-many tabs to view, you can arrange them as multiple tiers or scroll
-the tabs. The container uses the conventional Tk scrollbar syntax, so you
-can attach a scrollbar too.
-.SH EXAMPLE
-You create a container widget with the \fBcontainer\fR command.
-.CS
-# Create a new container
-container .c
-.CE
-A new Tcl command \f(CW.c\fR is also created. This command can be
-used to query and modify the container. For example, to change the
-default borderwidth, you use the new command and
-the container's \fBconfigure\fR operation.
-.CS
-# Change the default font.
-\&.c configure \-borderwidth 2
-.CE
-You can then add folders using the \fBinsert\fR operation.
-.CS
-# Create a new folder "f1"
-\&.c coinsert 0 "f1"
-.CE
-This inserts the new tab named "f1" into the container. The index
-\f(CW0\fR indicates location to insert the new tab. You can also use
-the index \f(CWend\fR to append a tab to the end of the container. By
-default, the text of the tab is the name of the tab. You can change
-this by configuring the \fB\-text\fR option.
-.CS
-# Change the label of "f1"
-\&.ts tab configure "f1" -label "Tab #1"
-.CE
-The \fBinsert\fR operation lets you add one or more folders at a time.
-.CS
-\&.ts insert end "f2" -label "Tab #2" "f3" "f4"
-.CE
-The tab on each folder contains a label. A label may display both
-an image and a text string. You can reconfigure the tab's attributes
-(foreground/background colors, font, rotation, etc) using the \fBtab
-configure\fR operation.
-.CS
-# Add an image to the label of "f1"
-set image [image create photo -file stopsign.gif]
-\&.ts tab configure "f1" -image $image
-\&.ts tab configure "f2" -rotate 90
-.CE
-Each folder may contain an embedded widget to represent its contents.
-The widget to be embedded must be a child of the container widget. Using
-the \fB\-window\fR option, you specify the name of widget to be
-embedded. But don't pack the widget, the container takes care of placing
-and arranging the widget for you.
-.CS
-graph .ts.graph
-\&.ts tab configure "f1" -window ".ts.graph" \\
- -fill both -padx 0.25i -pady 0.25i
-.CE
-The size of the folder is determined the sizes of the Tk widgets
-embedded inside each folder. The folder will be as wide as the widest
-widget in any folder. The tallest determines the height. You can use
-the tab's \fB\-pagewidth\fR and \fB\-pageheight\fR options override this.
-.PP
-Other options control how the widget appears in the folder. The
-\fB\-fill\fR option says that you wish to have the widget stretch to
-fill the available space in the folder.
-.CS
-\&.ts tab configure "f1" -fill both -padx 0.25i -pady 0.25i
-.CE
-.PP
-Now when you click the left mouse button on "f1", the
-graph will be displayed in the folder. It will be automatically
-hidden when another folder is selected. If you click on the right
-mouse button, the embedded widget will be moved into a toplevel widget
-of its own. Clicking again on the right mouse button puts it back into
-the folder.
-.PP
-If you want to share a page between two different folders, the
-\fB\-command\fR option lets you specify a Tcl command to be invoked
-whenever the folder is selected. You can reset the \fB\-window\fR
-option for the tab whenever it's clicked.
-.CS
-\&.ts tab configure "f2" -command {
- \&.ts tab configure "f2" -window ".ts.graph"
-}
-\&.ts tab configure "f1" -command {
- \&.ts tab configure "f1" -window ".ts.graph"
-}
-.CE
-If you have many folders, you may wish to stack tabs in multiple
-tiers. The container's \fB\-tiers\fR option requests a maximum
-number of tiers. The default is one tier.
-.CS
-\&.ts configure -tiers 2
-.CE
-If the tabs can fit in less tiers, the widget will use that many.
-Whenever there are more tabs than can be displayed in the maximum number
-of tiers, the container will automatically let you scroll the tabs. You
-can even attach a scrollbar to the container.
-.CS
-\&.ts configure -scrollcommand { .sbar set } -scrollincrement 20
-\&.sbar configure -orient horizontal -command { .ts view }
-.CE
-By default tabs are along the top of the container from left to right.
-But tabs can be placed on any side of the container using the \fB\-side\fR
-option.
-.CS
-# Arrange tabs along the right side of the container.
-\&.ts configure -side right -rotate 270
-.CE
-.SH SYNTAX
-The \fBcontainer\fR command creates a new window using the \fIpathName\fR
-argument and makes it into a container widget.
-.CS
-\fBcontainer \fIpathName \fR?\fIoption value\fR?...
-.CE
-Additional options may be specified on the command line or in the
-option database to configure aspects of the container such as its colors,
-font, text, and relief. The \fBcontainer\fR command returns its
-\fIpathName\fR argument. At the time this command is invoked, there
-must not exist a window named \fIpathName\fR, but \fIpathName\fR's
-parent must exist.
-.PP
-When first created, a new container contains no tabs. Tabs are added or
-deleted using widget operations described below. It is not necessary
-for all the tabs to be displayed in the container window at once;
-commands described below may be used to change the view in the window.
-Containers allow scrolling of tabs using the \fB\-scrollcommand\fR
-option. They also support scanning (see the \fBscan\fR operation).
-Tabs may be arranged along any side of the container window using the
-\fB\-side\fR option.
-.PP
-The size of the container window is determined the number of tiers of
-tabs and the sizes of the Tk widgets embedded inside each folder.
-The widest widget determines the width of the folder. The tallest
-determines the height. If no folders contain an embedded widget, the
-size is detemined solely by the size of the tabs.
-.PP
-You can override either dimension with the container's \fB\-width\fR
-and \fB\-height\fR options.
-.SH "CONTAINER OPERATIONS"
-All \fBcontainer\fR operations are invoked by specifying the widget's
-pathname, the operation, and any arguments that pertain to that
-operation. The general form is:
-.sp
-.CS
- \fIpathName operation \fR?\fIarg arg ...\fR?
-.CE
-.sp
-\fIOperation\fR and the \fIarg\fRs determine the exact behavior of the
-command. The following operations are available for container widgets:
-.TP
-\fIpathName \fBcget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described below:
-.RS
-.TP
-\fB\-background \fIcolor\fR
-Sets the border color of the container.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the outside edge of the widget. The
-\fB\-relief\fR option determines how the border is to be drawn. The
-default is \f(CW2\fR.
-.TP
-\fB\-command \fIpattern\fR
-Specifies to search for a window whose \f(CWWM_COMMAND\fR property matches
-the given pattern. If no windows, or more than one window, matches
-the pattern, an error is generated. If \fIpattern\fR is the empty
-string, then no command search is performed.
-The default is \f(CW""\fR.
-.TP
-\fB\-cursor \fIcursor\fR
-Specifies the widget's cursor. The default cursor is \f(CW""\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the requested height of widget. If \fIpixels\fR is
-0, then the height is height the embedded window plus the specified
-borderwidth. The default is \f(CW0\fR.
-.TP
-\fB\-highlightbackground \fIcolor\fR
-Sets the color to display in the traversal highlight region when
-the container does not have the input focus.
-.TP
-\fB\-highlightcolor \fIcolor\fR
-Sets the color to use for the traversal highlight rectangle that is
-drawn around the widget when it has the input focus.
-The default is \f(CWblack\fR.
-.TP
-\fB\-highlightthickness \fIpixels\fR
-Sets the width of the highlight rectangle to draw around the outside of
-the widget when it has the input focus. \fIPixels\fR is a non-negative
-value and may have any of the forms acceptable to \fBTk_GetPixels\fR.
-If the value is zero, no focus highlight is drawn around the widget.
-The default is \f(CW2\fR.
-.TP
-\fB\-name \fIpattern\fR
-Specifies to search for a window whose \f(CWWM_NAME\fR property matches
-the given pattern. If no windows, or more than one window, matches
-the pattern, an error is generated. If \fIpattern\fR is the empty
-string, then no name search is performed.
-The default is \f(CW""\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for the container widget. \fIRelief\fR
-specifies how the container should appear relative to widget that
-it is packed into; for example, \f(CWraised\fR means the container should
-appear to protrude. The default is \f(CWsunken\fR.
-.TP
-\fB\-takefocus\fR \fIfocus\fR
-Provides information used when moving the focus from window to window
-via keyboard traversal (e.g., Tab and Shift-Tab). If \fIfocus\fR is
-\f(CW0\fR, this means that this window should be skipped entirely during
-keyboard traversal. \f(CW1\fR means that the this window should always
-receive the input focus. An empty value means that the traversal
-scripts decide whether to focus on the window.
-The default is \f(CW1\fR.
-.TP
-\fB\-width \fIpixels\fR
-Specifies the requested width of the widget. If \fIpixels\fR is 0,
-then the width is the width the embedded window and the specified
-borderwidth. The default is \f(CW0\fR.
-.TP
-\fB\-window \fIid\fR
-Specifies the foreign embedded using its X window id.
-.RE
-.TP
-\fIpathName \fBfind \fB\-command\fR|\fB\-name\fR \fIpattern\fR
-Searches for all windows that match the given pattern. If the
-\fB\-command\fR switch is given, all windows whose \fCWWM_COMMAND\fR
-property match \fIpattern\fR are returned in a list. If the
-\fB\-name\fR switch is given, all windows whose \fCWWM_NAME\fR
-property match \fIpattern\fR are returned in a list. The list
-returned will contains pairs of the window id and the matching property.
-.SH KEYWORDS
-container, widget
diff --git a/blt3.0.1/man/cutbuffer.mann b/blt3.0.1/man/cutbuffer.mann
deleted file mode 100644
index ce06106..0000000
--- a/blt3.0.1/man/cutbuffer.mann
+++ /dev/null
@@ -1,54 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-.so man.macros
-.TH cutbuffer n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-cutbuffer \- Manipulate X cut buffer properties
-.SH SYNOPSIS
-\fBcutbuffer\fI get ?number?\fR
-.br
-\fBcutbuffer\fI rotate ?count?\fR
-.br
-\fBcutbuffer\fI set value ?number?\fR
-.BE
-.SH DESCRIPTION
-.PP
-The \fBcutbuffer\fR command allows you to read or modify the eight X cut
-buffer properties. You can also rotate the buffers properties.
-.SH OPERATIONS
-The following operations are available for the \fBcutbuffer\fR command:
-.TP
-\fBcutbuffer get \fI?number?\fR
-Returns the value of a cutbuffer \fInumber\fR. \fINumber\fR must be a
-number between 0 and 7. The default is 0. The cutbuffer is returned
-exactly, except that NUL bytes are converted to '@' characters. If a
-cut buffer \fInumber\fR does not exist, then \f(CW""\fR is returned.
-.TP
-\fBcutbuffer rotate \fI?count?\fR
-Rotates the cut buffers by \fIcount\fR. \fICount\fR must be a number
-between -7 and 7. The default is 1.
-.TP
-\fBcutbuffer set \fIvalue\fR ?\fInumber\fR?
-Sets the cutbuffer \fInumber\fR to \fIvalue\fR. \fINumber\fR must be a
-number between 0 and 7. The default is 0.
-.SH KEYWORDS
-cut buffer, property
diff --git a/blt3.0.1/man/datatable.mann b/blt3.0.1/man/datatable.mann
deleted file mode 100644
index 747f327..0000000
--- a/blt3.0.1/man/datatable.mann
+++ /dev/null
@@ -1,1505 +0,0 @@
-
-'\"
-'\" Copyright 1991-1997 by Lucent Technologies, Inc.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Datatable command created by George Howlett.
-'\"
-.so man.macros
-.TH datatable n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-\fBdatatable\fR \- Create and manage table data objects.
-.SH SYNOPSIS
-\fBblt::datatable create \fR?\fItableName\fR?
-.sp
-\fBblt::datatable destroy\fR \fItableName\fR...
-.sp
-\fBblt::datatable names\fR \fR?\fIpattern\fR?
-.BE
-.SH DESCRIPTION
-The \fBdatatable\fR command creates table data objects. A \fItable object\fR
-is general ordered tree of nodes. Each node has both a label and a
-key-value list of data. Data can be heterogeneous, since nodes do not
-have to contain the same data keys. It is associated with a Tcl
-command that you can use to access and modify the its structure and
-data. Table objects can also be managed via a C API.
-.SH INTRODUCTION
-
-.SH EXAMPLE
-
-.SH SYNTAX
-.TP
-\fBblt::datatable create\fR ?\fItableName\fR?
-Creates a new table object. The name of the new table is returned. If
-no \fItableName\fR argument is present, then the name of the table is
-automatically generated in the form "\f(CWdatatable0\fR", "\f(CWdatatable1\fR",
-etc. If the substring "\f(CW#auto\fR" is found in \fItableName\fR, it
-is automatically substituted by a generated name. For example, the
-name \f(CW.foo.#auto.bar\fR will be translated to \f(CW.foo.datatable0.bar\fR.
-.sp
-A new Tcl command (by the same name as the table) is also created.
-Another Tcl command or table object can not already exist as
-\fItableName\fR. If the Tcl command is deleted, the table will also be
-freed. The new table will contain no rows or columns. Tables are by
-default, created in the current namespace, not the global namespace,
-unless \fItableName\fR contains a namespace qualifier, such as
-"\f(CWfred::myTable\fR".
-.TP
-\fBblt::datatable destroy\fR \fItableName\fR...
-Deletes one of more tables. The Tcl command associated with
-\fItableName\fR is also removed. If the table is currently shared
-(another client is using it), the table data isn't destroyed until
-no one else is using it.
-.TP
-\fBblt::datatable names \fR?\fIpattern\fR?
-Returns the names of all table objects. if a \fIpattern\fR argument
-is given, then the only those tables whose name matches pattern will
-be listed.
-.SH ROW/COLUMN IDENTIFIERS
-Rows and columns in a table object may be identified by either an index,
-label, or tag.
-.SS INDEX
-An index is the position of the row/column. Row/column indices start from
-one (not zero). Indices may change if rows/columns are inserted, deleted, or
-sorted.
-.SS LABEL
-A label is a string of characters that identifies a row or column. A label
-may reference more than one row or column. It is up to the programmer to
-maintain unique labels. For example, if two columns have the same label, only
-the first column may be accessed using that label. Row and column labels are
-distinct. Labels do not change if other rows/columns are inserted, deleted,
-or sorted. Labels can not start with a "-".
-.SS TAG
-A row/column may also have any number of tags associated with it. A tag is
-just a string of characters, and it may take any form except that of
-an integer. For example, "\f(CWx123\fR" is valid, but "\f(CW123\fR"
-isn't. The same tag may be associated with many different rows/columns.
-This is commonly done to group rows/columns in various interesting ways.
-.sp
-There are two built-in tags: The tag \fBall\fR is implicitly
-associated with every row/column in the table. It may be used to invoke
-operations on all the rows/columns in the table. The tag \fBend\fR is
-managed automatically by the table object. It applies to the last row/column.
-.sp
-When specifying nodes in table object commands, if the specifier is an
-integer then it is assumed to refer to the single node with that id.
-If the specifier is not an integer, then it is assumed to refer to all
-of the nodes in the table that have a tag matching the specifier. The
-symbol \fInode\fR is used below to indicate that an argument specifies
-either an id that selects a single node or a tag that selects zero or
-more nodes. Many table commands only operate on a single node at a
-time; if \fInode\fR is specified in a way that names multiple items, then
-an error "refers to more than one node" is generated.
-.SH NODE MODIFIERS
-You can also specify node in relation to another node by appending one
-or more modifiers to the node id or tag. A modifier refers to a node
-in relation to the specified node. For example,
-"\f(CWroot->firstchild\fR"
-selects the first subtree of the root node.
-.PP
-The following modifiers are available:
-.RS
-.TP 1i
-\fBfirstchild\fR
-Selects the first child of the node.
-.TP 1i
-\fBlastchild\fR
-Selects the last child of the node.
-.TP 1i
-\fBnext\fR
-Selects the next node in preorder to the node.
-.TP 1i
-\fBnextsibling\fR
-Selects the next sibling of the node.
-.TP 1i
-\fBparent\fR
-Selects the parent of the node.
-.TP 1i
-\fBprevious\fR
-Selects the previous node in preorder to the node.
-.TP 1i
-\fBprevsibling\fR
-Selects the previous sibling of the node.
-.TP 1i
-"\fIlabel\fR"
-Selects the node whose label is \fIlabel\fR. Enclosing \fIlabel\fR in
-quotes indicates to always search for a node by its label (for example,
-even if the node is labeled "parent").
-.RE
-.sp
-It's an error the node can't be found. For example,
-\fBlastchild\fR and \fBfirstchild\fR will generate errors if the node
-has no children. The exception to this is the \fBindex\fR operation.
-You can use \fBindex\fR to test if a modifier is valid.
-.SH TABLE OPERATIONS
-Once you create a table object, you can use its Tcl command
-to query or modify it. The
-general form is
-.DS
-\fItableName\fR \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for tables are listed below.
-.TP
-\fItableName\fR \fBarray\fR \fBexists\fR \fIrow\fR \fIcol\fR \fIkey\fR
-Indicates if \fIkey\fR exists in the array element located at the
-given row and column position in the table. If \fIrow\fR is not a valid
-row identifier, \fIcol\fR is not a valid column identifier, or \fIkey\fR
-is not a valid key for the array, then \f(CW0\fR is returned, otherwise
-\f(CW1\fR.
-.TP
-\fItableName\fR \fBarray\fR \fBget\fR \fIrow\fR \fIcol\fR \fIkey\fR ?\fIdefValue\fR?
-Returns the value associated with \fIkey\fR in the array located
-at the given row and column position in the table. It's normally an
-error if \fIrow\fR is not a valid row identifier, \fIcol\fR is not a
-valid column identifier, or \fIkey\fR is not a valid key for the array.
-But if you provide a \fIdefValue\fR argument, this value is will be returned
-instead. This operation may trigger \fBread\fR traces.
-.TP
-\fItableName\fR \fBarray\fR \fBnames\fR \fIrow\fR \fIcol\fR
-Returns a list of the current keys in the array located at the
-given row and column position in the table. It is an error \fIrow\fR
-is not a valid row identifier or \fIcol\fR is not a valid column identifier.
-.TP
-\fItableName\fR \fBarray\fR \fBset\fR \fIrow\fR \fIcol\fR \fIkey\fR \fIvalue\fR
-Sets the value to the array element associated with \fIkey\fR located at the
-given row and column position in the table. If either \fIrow\fR or
-\fIcolumn\fR do not exist, they will be automatically created (they must
-be a label or index). If \fIkey\fR doesn't exist, a new entry in the array
-be created. This operation may trigger \fBwrite\fR traces.
-.TP
-\fItableName\fR \fBarray\fR \fBunset\fR \fIrow\fR \fIcol\fR \fIkey\fR...
-Unsets the value to the array element associated with \fIkey\fR located at the
-given row and column position in the table. It's an error if either
-\fIrow\fR or \fIcolumn\fR do not exist.
-This operation may trigger \fBunset\fR traces.
-.TP
-\fItableName\fR \fBapply\fR \fInode\fR ?\fIswitches\fR?
-Runs commands for all nodes matching the criteria given by
-\fIswitches\fR for the subtree designated by \fInode\fR. By default
-all nodes match, but you can set switches to narrow the match. This
-operation differs from \fBfind\fR in two ways: 1) Tcl commands can be
-invoked both pre- and post-traversal of a node and 2) the table is
-always traversed in depth first order.
-.sp
-The \fB\-exact\fR, \fB\-glob\fR,
-and \fB\-regexp\fR switches indicate both what kind of pattern matching
-to perform and the pattern. By default each pattern will be compared
-with the node label. You can set more than one of these switches. If
-any of the patterns match (logical or), the node matches.
-If the \fB\-key\fR switch is
-used, it designates the data field to be matched.
-.sp
-The valid switches are listed
-below:
-.RS
-.TP 1i
-\fB\-depth\fR \fInumber\fR
-Descend at most \fInumber\fR (a non-negative integer) levels
-If \fInumber\fR is \f(CW1\fR this means only apply the tests
-to the children of \fInode\fR.
-.TP 1i
-\fB\-exact\fR \fIstring\fR
-Matches each node using \fIstring\fR. The node must match \fIstring\fR
-exactly.
-.TP 1i
-\fB\-glob\fR \fIstring\fR
-Test each node to \fIstring\fR using global pattern
-matching. Matching is done in a fashion similar to that used by the
-C-shell.
-.TP 1i
-\fB\-invert\fR
-Select non-matching nodes. Any node that \fIdoesn't\fR match
-the given criteria will be selected.
-.TP 1i
-\fB\-key\fR \fIkey\fR
-If pattern matching is selected (using the \fB\-exact\fR,
-\fB\-glob\fR, or \fB\-regexp\fR switches), compare the values of the
-data field keyed by \fIkey\fR instead of the node's label. If no
-pattern matching switches are set, then any node with this data key
-will match.
-.TP 1i
-\fB\-leafonly\fR
-Only test nodes with no children.
-.TP 1i
-\fB\-nocase\fR
-Ignore case when matching patterns.
-.TP 1i
-\fB\-path\fR
-Use the node's full path when comparing nodes. The node's full
-path is a list of labels, starting from the root of each ancestor
-and the node itself.
-.TP 1i
-\fB\-precommand\fR \fIcommand\fR
-Invoke \fIcommand\fR for each matching node. Before \fIcommand\fR is
-invoked, the id of the node is appended. You can control
-processing by the return value of \fIcommand\fR. If \fIcommand\fR
-generates an error, processing stops and the \fBfind\fR operation
-returns an error. But if \fIcommand\fR returns \fBbreak\fR, then
-processing stops, no error is generated. If \fIcommand\fR returns
-\fBcontinue\fR, then processing
-stops on that subtree and continues on the next.
-.TP 1i
-\fB\-postcommand\fR \fIcommand\fR
-Invoke \fIcommand\fR for each matching node. Before \fIcommand\fR is
-invoked, the id of the node is appended. You can control
-processing by the return value of \fIcommand\fR. If \fIcommand\fR
-generates an error, processing stops and the \fBfind\fR operation
-returns an error. But if \fIcommand\fR returns \fBbreak\fR, then
-processing stops, no error is generated. If \fIcommand\fR returns
-\fBcontinue\fR, then processing
-stops on that subtree and continues on the next.
-.TP 1i
-\fB\-regexp\fR \fIstring\fR
-Test each node using \fIstring\fR as a regular expression pattern.
-.TP 1i
-\fB\-tag\fR \fIstring\fR
-Only test nodes that have the tag \fIstring\fR.
-.RE
-.TP
-\fItableName\fR \fBattach\fR \fItableObject\fR ?\fIswitches\fR?
-Attaches to an existing table object \fItableObject\fR.
-The current table associated with \fItableName\fR is discarded.
-In addition, the current set of tags, notifier events, and traces are
-removed. The valid \fIswitches\fR are listed below:
-.RS
-.TP
-\fB\-newtags\fR
-By default, the table will share the tags of the attached table. If this
-flag is present, the table will start with an empty tag table.
-.RE
-.TP
-\fItableName\fR \fBchildren\fR \fInode\fR
-Returns a list of children for \fInode\fR. If \fInode\fR is a leaf,
-then an empty string is returned.
-.TP
-\fItableName\fR \fBcopy\fR \fIparent\fR ?\fItable\fR? \fInode\fR ?\fIswitches\fR?
-Copies \fInode\fR into \fIparent\fR. Both nodes \fInode\fR and
-\fIparent\fR must already exist. The id of the new node is
-returned. You can also copy nodes from another table. If a \fItable\fR
-argument is present, it indicates the name of the source table.
-The valid \fIswitches\fR are listed below:
-.RS
-.TP
-\fB\-label\fR \fIstring\fR
-Label \fIdestNode\fR as \fIstring\fR. By default, \fIdestNode\fR has
-the same label as \fIsrcNode\fR.
-.TP
-\fB\-overwrite\fR
-Overwrite nodes that already exist. Normally nodes are always
-created, even if there already exists a node by the same name. This
-switch indicates to add or overwrite the node's data fields.
-.TP
-\fB\-recurse\fR
-Recursively copy all the subtables of \fIsrcNode\fR as well. In this case,
-\fIsrcNode\fR can't be an ancestor of \fIdestNode\fR as it would result
-in a cyclic copy.
-.TP
-\fB\-tags\fR
-Copy tag inforation. Normally the following node is copied: its
-label and data fields. This indicates to copy tags as well.
-.RE
-.TP
-\fItableName\fR \fBdegree\fR \fInode\fR
-Returns the number of children of \fInode\fR.
-.TP
-\fItableName\fR \fBdelete\fR \fInode\fR...
-Recursively deletes one or more nodes from the table.
-The node and all its descendants are removed. The one exception
-is the root node. In this case, only its descendants are removed.
-The root node will remain. Any tags or
-traces on the nodes are released.
-.TP
-\fItableName\fR \fBdepth\fR \fInode\fR
-Returns the depth of the node. The depth is the number of
-steps from the node to the root of the table. The depth of the
-root node is \f(CW0\fR.
-.TP
-\fItableName\fR \fBdump\fR \fInode\fR
-Returns a list of the paths and respective data for \fInode\fR
-and its descendants. The subtable designated by \fInode\fR is
-traversed returning the following information for each node: 1) the node's
-path relative to \fInode\fR, 2) a sublist key value pairs
-representing the node's data fields, and 3) a sublist of tags.
-This list returned can be used
-later to copy or restore the table with the \fBrestore\fR operation.
-.TP
-\fItableName\fR \fBdumpfile\fR \fInode\fR \fIfileName\fR
-Writes a list of the paths and respective data for \fInode\fR
-and its descendants to the given file \fIfileName\fR.
-The subtable designated by \fInode\fR is traversed returning the
-following information for each node: 1) the node's
-path relative to \fInode\fR, 2) a sublist key value pairs
-representing the node's data fields, and 3) a sublist of tags.
-This list returned can be used
-later to copy or restore the table with the \fBrestore\fR operation.
-.TP
-\fItableName\fR \fBexists\fR \fInode\fR ?\fIkey\fR?
-Indicates if \fInode\fR exists in the table. If a \fIkey\fR argument
-is present then the command also indicates if the named data field
-exists.
-.TP
-\fItableName\fR \fBfind\fR \fInode\fR ?\fIswitches\fR?
-Finds for all nodes matching the criteria given by \fIswitches\fR
-for the subtable designated by \fInode\fR. A list of the selected
-nodes is returned. By default all nodes match, but you can set
-switches to narrow the match.
-.sp
-The \fB\-exact\fR, \fB\-glob\fR,
-and \fB\-regexp\fR switches indicate both what kind of pattern matching
-to perform and the pattern. By default each pattern will be compared
-with the node label. You can set more than one of these switches. If
-any of the patterns match (logical or), the node matches.
-If the \fB\-key\fR switch is
-used, it designates the data field to be matched.
-.sp
-The order in
-which the nodes are traversed is controlled by the \fB\-order\fR switch.
-The possible orderings are \fBpreorder\fR, \fBpostorder\fR, \fBinorder\fR,
-and \fBbreadthfirst\fR. The default is \fBpostorder\fR.
-.sp
-The valid switches are listed
-below:
-.RS
-.TP 1i
-\fB\-addtag\fR \fIstring\fR
-Add the tag \fIstring\fR to each selected node.
-.TP 1i
-\fB\-count\fR \fInumber\fR
-Stop processing after \fInumber\fR (a positive integer) matches.
-.TP 1i
-\fB\-depth\fR \fInumber\fR
-Descend at most \fInumber\fR (a non-negative integer) levels
-If \fInumber\fR is \f(CW1\fR this means only apply the tests
-to the children of \fInode\fR.
-.TP 1i
-\fB\-exact\fR \fIstring\fR
-Matches each node using \fIstring\fR. The node must match \fIstring\fR
-exactly.
-.TP 1i
-\fB\-excludes\fR \fInodeList\fR
-Excludes any node in the list \fInodeList\fR from the search.
-The subnodes of an excluded node are still examined.
-.TP 1i
-\fB\-exec\fR \fIcommand\fR
-Invoke \fIcommand\fR for each matching node. Before \fIcommand\fR is
-invoked, the id of the node is appended. You can control
-processing by the return value of \fIcommand\fR. If \fIcommand\fR
-generates an error, processing stops and the \fBfind\fR operation
-returns an error. But if \fIcommand\fR returns \fBbreak\fR, then
-processing stops, no error is generated. If \fIcommand\fR returns
-\fBcontinue\fR, then processing
-stops on that subtable and continues on the next.
-.TP 1i
-\fB\-glob\fR \fIstring\fR
-Test each node to \fIstring\fR using global pattern
-matching. Matching is done in a fashion similar to that used by the
-C-shell.
-.TP 1i
-\fB\-invert\fR
-Select non-matching nodes. Any node that \fIdoesn't\fR match
-the given criteria will be selected.
-.TP 1i
-\fB\-key\fR \fIkey\fR
-Compare the values of the data field keyed by \fIkey\fR instead of
-the node's label. If no pattern is given (\fB\-exact\fR, \fB\-glob\fR, or
-\fB\-regexp\fR switches), then any node with this data key will match.
-.TP 1i
-\fB\-leafonly\fR
-Only test nodes with no children.
-.TP 1i
-\fB\-nocase\fR
-Ignore case when matching patterns.
-.TP
-\fB\-order\fR \fIstring\fR
-Traverse the table and process nodes according to \fIstring\fR. \fIString\fR
-can be one of the following:
-.RS
-.TP 1i
-\fBbreadthfirst\fR
-Process the node and the subtables at each sucessive level. Each node
-on a level is processed before going to the next level.
-.TP 1i
-\fBinorder\fR
-Recursively process the nodes of the first subtable, the node itself,
-and any the remaining subtables.
-.TP 1i
-\fBpostorder\fR
-Recursively process all subtables before the node.
-.TP 1i
-\fBpreorder\fR
-Recursively process the node first, then any subtables.
-.RE
-.TP
-\fB\-path\fR
-Use the node's full path when comparing nodes.
-.TP
-\fB\-regexp\fR \fIstring\fR
-Test each node using \fIstring\fR as a regular expression pattern.
-.TP
-\fB\-tag\fR \fIstring\fR
-Only test nodes that have the tag \fIstring\fR.
-.RE
-.TP
-\fItableName\fR \fBfindchild\fR \fInode\fR \fIlabel\fR
-Searches for a child node \Ilabel\fR in \fInode\fR. The id of the
-child node is returned if found. Otherwise \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBfirstchild\fR \fInode\fR
-Returns the id of the first child in the \fInode\fR's list
-of subtables. If \fInode\fR is a leaf (has no children),
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBget\fR \fInode\fR ?\fIkey\fR? ?\fIdefaultValue\fR?
-Returns a list of key-value pairs of data for the node. If \fIkey\fR
-is present, then only the value for that particular data field is
-returned. It's normally an error if \fInode\fR does not contain the
-data field \fIkey\fR. But if you provide a \fIdefaultValue\fR
-argument, this value is returned instead (\fInode\fR will still not
-contain \fIkey\fR). This feature can be used to access a data field of
-\fInode\fR without first testing if it exists. This operation may
-trigger \fBread\fR data traces.
-.TP
-\fItableName\fR \fBindex\fR \fInode\fR
-Returns the id of \fInode\fR. If \fInode\fR is a tag, it
-can only specify one node. If \fInode\fR does not represent a valid
-node id or tag, or has modifiers that are invalid, then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBinsert\fR \fIparent\fR ?\fIswitches\fR?
-Inserts a new node into parent node \fIparent\fR.
-The id of the new node is returned. The following switches
-are available:
-.RS
-.TP 1i
-\fB\-after\fR \fIchild\fR
-Position \fInode\fR after \fIchild\fR. The node \fIchild\fR must be a
-child of \fIparent\fR.
-.TP 1i
-\fB\-at\fR \fInumber\fR
-Inserts the node into \fIparent\fR's list of children at
-position \fInumber\fR. The default is to append \fInode\fR.
-.TP 1i
-\fB\-before\fR \fIchild\fR
-Position \fInode\fR before \fIchild\fR. The node \fIchild\fR must be a
-child of \fIparent\fR.
-.TP 1i
-\fB\-data\fR \fIdataList\fR
-Sets the value for each data field in \fIdataList\fR for the
-new node. \fIDataList\fR is a list of key-value pairs.
-.TP 1i
-\fB\-label\fR \fIstring\fR
-Designates the labels of the node as \fIstring\fR. By default, nodes
-are labeled as \f(CWnode0\fR, \f(CWnode1\fR, etc.
-.TP 1i
-\fB\-node\fR \fIid\fR
-Designates the id for the node. Normally new ids are automatically
-generated. This allows you to create a node with a specific id.
-It is an error if the id is already used by another node in the table.
-.TP 1i
-\fB\-tags\fR \fItagList\fR
-Adds each tag in \fItagList\fR to the new node. \fITagList\fR is a list
-of tags, so be careful if a tag has embedded spaces.
-.RE
-.TP
-\fItableName\fR \fBis\fR \fIproperty\fR \fIargs\fR
-Indicates the property of a node. Both \fIproperty\fR and \fIargs\fR
-determine the property being tested. Returns \f(CW1\fR if true and
-\f(CW0\fR otherwise. The following \fIproperty\fR and \fIargs\fR
-are valid:
-.RS
-.TP 1i
-\fBancestor\fR \fInode1\fR \fInode2\fR
-Indicates if \fInode1\fR is an ancestor of \fInode2\fR.
-.TP 1i
-\fBbefore\fR \fInode1\fR \fInode2\fR
-Indicates if \fInode1\fR is before \fInode2\fR in depth first traversal.
-.TP 1i
-\fBleaf\fR \fInode\fR
-Indicates if \fInode\fR is a leaf (it has no subtables).
-.TP 1i
-\fBroot\fR \fInode\fR
-Indicates if \fInode\fR is the designated root. This can be changed
-by the \fBroot\fR operation.
-.RE
-.TP
-\fItableName\fR \fBlabel\fR \fInode\fR ?\fInewLabel\fR?
-Returns the label of the node designated by \fInode\fR. If \fInewLabel\fR
-is present, the node is relabeled using it as the new label.
-.TP
-\fItableName\fR \fBlastchild\fR \fInode\fR
-Returns the id of the last child in the \fInode\fR's list
-of subtables. If \fInode\fR is a leaf (has no children),
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBmove\fR \fInode\fR \fInewParent\fR ?\fIswitches\fR?
-Moves \fInode\fR into \fInewParent\fR. \fINode\fR is appended to the
-list children of \fInewParent\fR. \fINode\fR can not be an ancestor
-of \fInewParent\fR. The valid flags for \fIswitches\fR are described below.
-.RS
-.TP 1i
-\fB\-after\fR \fIchild\fR
-Position \fInode\fR after \fIchild\fR. The node \fIchild\fR must be a
-child of \fInewParent\fR.
-.TP 1i
-\fB\-at\fR \fInumber\fR
-Inserts \fInode\fR into \fIparent\fR's list of children at
-position \fInumber\fR. The default is to append the node.
-.TP 1i
-\fB\-before\fR \fIchild\fR
-Position \fInode\fR before \fIchild\fR. The node \fIchild\fR must be a
-child of \fInewParent\fR.
-.RE
-.TP
-\fItableName\fR \fBnext\fR \fInode\fR
-Returns the next node from \fInode\fR in a preorder traversal.
-If \fInode\fR is the last node in the table,
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBnextsibling\fR \fInode\fR
-Returns the node representing the next subtable from \fInode\fR
-in its parent's list of children. If \fInode\fR is the last child,
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBnotify\fR \fIargs\fR
-Manages notification events that indicate that the table structure has
-been changed.
-See the
-.SB "NOTIFY OPERATIONS"
-section below.
-.TP
-\fItableName\fR \fBparent\fR \fInode\fR
-Returns the parent node of \fInode\fR. If \fInode\fR is the root
-of the table,
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBpath\fR \fInode\fR
-Returns the full path (from root) of \fInode\fR.
-.TP
-\fItableName\fR \fBposition\fR \fInode\fR
-Returns the position of the node in its parent's list of children.
-Positions are numbered from 0.
-The position of the root node is always 0.
-.TP
-\fItableName\fR \fBprevious\fR \fInode\fR
-Returns the previous node from \fInode\fR in a preorder traversal.
-If \fInode\fR is the root of the table,
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBprevsibling\fR \fInode\fR
-Returns the node representing the previous subtable from \fInode\fR
-in its parent's list of children. If \fInode\fR is the first child,
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBrestore\fR \fInode\fR \fIdataString\fR \fIswitches\fR
-Performs the inverse function of the \fBdump\fR operation, restoring
-nodes to the table. The format of \fIdataString\fR is exactly what is
-returned by the \fBdump\fR operation. It's a list containing information
-for each node to be restored. The information consists of 1) the relative
-path of the node, 2) a sublist of key value pairs representing the
-node's data, and 3) a list of tags for the node. Nodes are created
-starting from \fInode\fR. Nodes can be listed in any order. If a node's
-path describes ancestor nodes that do not already exist, they are
-automatically created. The valid \fIswitches\fR are listed below:
-.RS
-.TP
-\fB\-overwrite\fR
-Overwrite nodes that already exist. Normally nodes are always
-created, even if there already exists a node by the same name. This
-switch indicates to add or overwrite the node's data fields.
-.RE
-.TP
-\fItableName\fR \fBrestorefile\fR \fInode\fR \fIfileName\fR \fIswitches\fR
-Performs the inverse function of the \fBdumpfile\fR operation, restoring
-nodes to the table from the file \fIfileName\fR. The format of
-\fIfileName\fR is exactly what is returned by the \fBdumpfile\fR operation.
-It's a list containing information for each node to be restored.
-The information consists of 1) the relative path of the node, 2)
-a sublist of key value pairs representing the node's data, and 3)
-a list of tags for the node. Nodes are created
-starting from \fInode\fR. Nodes can be listed in any order. If a node's
-path describes ancestor nodes that do not already exist, they are
-automatically created. The valid \fIswitches\fR are listed below:
-.RS
-.TP
-\fB\-overwrite\fR
-Overwrite nodes that already exist. Normally nodes are always
-created, even if there already exists a node by the same name. This
-switch indicates to add or overwrite the node's data fields.
-.RE
-.TP
-\fItableName\fR \fBroot\fR ?\fInode\fR?
-Returns the id of the root node. Normally this is node \f(CW0\fR. If
-a \fInode\fR argument is provided, it will become the new root of the
-table. This lets you temporarily work within a subset of the table.
-Changing root affects operations such as \fBnext\fR, \fBpath\fR,
-\fBprevious\fR, etc.
-.TP
-\fItableName\fR \fBset\fR \fInode\fR \fIkey value\fR ?\fIkey value\fR...?
-Sets one or more data fields in \fInode\fR. \fINode\fR may
-be a tag that represents several nodes. \fIKey\fR is the
-name of the data field to be set and \fIvalue\fR is its respective
-value. This operation may trigger \fBwrite\fR and \fBcreate\fR data traces.
-.TP
-\fItableName\fR \fBsize\fR \fInode\fR
-Returns the number of nodes in the subtable. This includes the node
-and all its descendants. The size of a leaf node is 1.
-.TP
-\fItableName\fR \fBsort\fR \fInode\fR ?\fIswitches\fR?
-.RS
-.TP 1i
-\fB\-ascii\fR
-Compare strings using the ASCII collation order.
-.TP 1i
-\fB\-command\fR \fIstring\fR
-Use command \fIstring\fR as a comparison command. To compare two
-elements, evaluate a Tcl script consisting of command with the two
-elements appended as additional arguments. The script should return
-an integer less than, equal to, or greater than zero if the first
-element is to be considered less than, equal to, or greater than the
-second, respectively.
-.TP 1i
-\fB\-decreasing\fR
-Sort in decreasing order (largest items come first).
-.TP 1i
-\fB\-dictionary\fR
-Compare strings using a dictionary-style comparison. This is the same
-as \fB\-ascii\fR except (a) case is ignored except as a tie-breaker and (b)
-if two strings contain embedded numbers, the numbers compare as integers, not
-characters. For example, in \fB\-dictionary\fR mode, bigBoy sorts between
-bigbang and bigboy, and x10y sorts between x9y and x11y.
-.TP 1i
-\fB\-integer\fR
-Compare the nodes as integers.
-.TP 1i
-\fB\-key\fR \fIstring\fR
-Sort based upon the node's data field keyed by \fIstring\fR. Normally
-nodes are sorted according to their label.
-.TP 1i
-\fB\-path\fR
-Compare the full path of each node. The default is to compare only its
-label.
-.TP 1i
-\fB\-real\fR
-Compare the nodes as real numbers.
-.TP 1i
-\fB\-recurse\fR
-Recursively sort the entire subtable rooted at \fInode\fR.
-.TP 1i
-\fB\-reorder\fR
-Recursively sort subtables for each node. \fBWarning\fR. Unlike
-the normal flat sort, where a list of nodes is returned, this will
-reorder the table.
-.RE
-.TP
-\fItableName\fR \fBtag\fR \fIargs\fR
-Manages tags for the table object.
-See the
-.SH TABLE OPERATIONS
-Once you create a table object, you can use its Tcl command
-to query or modify it. The
-general form is
-.DS
-\fItableName\fR \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for tables are listed below.
-.TP
-\fItableName\fR \fBancestor\fR \fInode1\fR \fInode2\fR
-Returns the mutual ancestor of the two nodes \fInode1\fR and
-\fInode2\fR. The ancestor can be one of the two nodes. For example,
-if \fInode1\fR and \fInode2\fR are the same nodes, their ancestor is
-\fInode1\fR.
-.TP
-\fItableName\fR \fBapply\fR \fInode\fR ?\fIswitches\fR?
-Runs commands for all nodes matching the criteria given by
-\fIswitches\fR for the subtree designated by \fInode\fR. By default
-all nodes match, but you can set switches to narrow the match. This
-operation differs from \fBfind\fR in two ways: 1) Tcl commands can be
-invoked both pre- and post-traversal of a node and 2) the table is
-always traversed in depth first order.
-.sp
-The \fB\-exact\fR, \fB\-glob\fR,
-and \fB\-regexp\fR switches indicate both what kind of pattern matching
-to perform and the pattern. By default each pattern will be compared
-with the node label. You can set more than one of these switches. If
-any of the patterns match (logical or), the node matches.
-If the \fB\-key\fR switch is
-used, it designates the data field to be matched.
-.sp
-The valid switches are listed
-below:
-.RS
-.TP 1i
-\fB\-depth\fR \fInumber\fR
-Descend at most \fInumber\fR (a non-negative integer) levels
-If \fInumber\fR is \f(CW1\fR this means only apply the tests
-to the children of \fInode\fR.
-.TP 1i
-\fB\-exact\fR \fIstring\fR
-Matches each node using \fIstring\fR. The node must match \fIstring\fR
-exactly.
-.TP 1i
-\fB\-glob\fR \fIstring\fR
-Test each node to \fIstring\fR using global pattern
-matching. Matching is done in a fashion similar to that used by the
-C-shell.
-.TP 1i
-\fB\-invert\fR
-Select non-matching nodes. Any node that \fIdoesn't\fR match
-the given criteria will be selected.
-.TP 1i
-\fB\-key\fR \fIkey\fR
-If pattern matching is selected (using the \fB\-exact\fR,
-\fB\-glob\fR, or \fB\-regexp\fR switches), compare the values of the
-data field keyed by \fIkey\fR instead of the node's label. If no
-pattern matching switches are set, then any node with this data key
-will match.
-.TP 1i
-\fB\-leafonly\fR
-Only test nodes with no children.
-.TP 1i
-\fB\-nocase\fR
-Ignore case when matching patterns.
-.TP 1i
-\fB\-path\fR
-Use the node's full path when comparing nodes. The node's full
-path is a list of labels, starting from the root of each ancestor
-and the node itself.
-.TP 1i
-\fB\-precommand\fR \fIcommand\fR
-Invoke \fIcommand\fR for each matching node. Before \fIcommand\fR is
-invoked, the id of the node is appended. You can control
-processing by the return value of \fIcommand\fR. If \fIcommand\fR
-generates an error, processing stops and the \fBfind\fR operation
-returns an error. But if \fIcommand\fR returns \fBbreak\fR, then
-processing stops, no error is generated. If \fIcommand\fR returns
-\fBcontinue\fR, then processing
-stops on that subtree and continues on the next.
-.TP 1i
-\fB\-postcommand\fR \fIcommand\fR
-Invoke \fIcommand\fR for each matching node. Before \fIcommand\fR is
-invoked, the id of the node is appended. You can control
-processing by the return value of \fIcommand\fR. If \fIcommand\fR
-generates an error, processing stops and the \fBfind\fR operation
-returns an error. But if \fIcommand\fR returns \fBbreak\fR, then
-processing stops, no error is generated. If \fIcommand\fR returns
-\fBcontinue\fR, then processing
-stops on that subtree and continues on the next.
-.TP 1i
-\fB\-regexp\fR \fIstring\fR
-Test each node using \fIstring\fR as a regular expression pattern.
-.TP 1i
-\fB\-tag\fR \fIstring\fR
-Only test nodes that have the tag \fIstring\fR.
-.RE
-.TP
-\fItableName\fR \fBattach\fR \fItableObject\fR ?\fIswitches\fR?
-Attaches to an existing table object \fItableObject\fR.
-The current table associated with \fItableName\fR is discarded.
-In addition, the current set of tags, notifier events, and traces are
-removed. The valid \fIswitches\fR are listed below:
-.RS
-.TP
-\fB\-newtags\fR
-By default, the table will share the tags of the attached table. If this
-flag is present, the table will start with an empty tag table.
-.RE
-.TP
-\fItableName\fR \fBchildren\fR \fInode\fR
-Returns a list of children for \fInode\fR. If \fInode\fR is a leaf,
-then an empty string is returned.
-.TP
-\fItableName\fR \fBcopy\fR \fIparent\fR ?\fItable\fR? \fInode\fR ?\fIswitches\fR?
-Copies \fInode\fR into \fIparent\fR. Both nodes \fInode\fR and
-\fIparent\fR must already exist. The id of the new node is
-returned. You can also copy nodes from another table. If a \fItable\fR
-argument is present, it indicates the name of the source table.
-The valid \fIswitches\fR are listed below:
-.RS
-.TP
-\fB\-label\fR \fIstring\fR
-Label \fIdestNode\fR as \fIstring\fR. By default, \fIdestNode\fR has
-the same label as \fIsrcNode\fR.
-.TP
-\fB\-overwrite\fR
-Overwrite nodes that already exist. Normally nodes are always
-created, even if there already exists a node by the same name. This
-switch indicates to add or overwrite the node's data fields.
-.TP
-\fB\-recurse\fR
-Recursively copy all the subtables of \fIsrcNode\fR as well. In this case,
-\fIsrcNode\fR can't be an ancestor of \fIdestNode\fR as it would result
-in a cyclic copy.
-.TP
-\fB\-tags\fR
-Copy tag inforation. Normally the following node is copied: its
-label and data fields. This indicates to copy tags as well.
-.RE
-.TP
-\fItableName\fR \fBdegree\fR \fInode\fR
-Returns the number of children of \fInode\fR.
-.TP
-\fItableName\fR \fBdelete\fR \fInode\fR...
-Recursively deletes one or more nodes from the table.
-The node and all its descendants are removed. The one exception
-is the root node. In this case, only its descendants are removed.
-The root node will remain. Any tags or
-traces on the nodes are released.
-.TP
-\fItableName\fR \fBdepth\fR \fInode\fR
-Returns the depth of the node. The depth is the number of
-steps from the node to the root of the table. The depth of the
-root node is \f(CW0\fR.
-.TP
-\fItableName\fR \fBdump\fR \fInode\fR
-Returns a list of the paths and respective data for \fInode\fR
-and its descendants. The subtable designated by \fInode\fR is
-traversed returning the following information for each node: 1) the node's
-path relative to \fInode\fR, 2) a sublist key value pairs
-representing the node's data fields, and 3) a sublist of tags.
-This list returned can be used
-later to copy or restore the table with the \fBrestore\fR operation.
-.TP
-\fItableName\fR \fBdumpfile\fR \fInode\fR \fIfileName\fR
-Writes a list of the paths and respective data for \fInode\fR
-and its descendants to the given file \fIfileName\fR.
-The subtable designated by \fInode\fR is traversed returning the
-following information for each node: 1) the node's
-path relative to \fInode\fR, 2) a sublist key value pairs
-representing the node's data fields, and 3) a sublist of tags.
-This list returned can be used
-later to copy or restore the table with the \fBrestore\fR operation.
-.TP
-\fItableName\fR \fBexists\fR \fInode\fR ?\fIkey\fR?
-Indicates if \fInode\fR exists in the table. If a \fIkey\fR argument
-is present then the command also indicates if the named data field
-exists.
-.TP
-\fItableName\fR \fBfind\fR \fInode\fR ?\fIswitches\fR?
-Finds for all nodes matching the criteria given by \fIswitches\fR
-for the subtable designated by \fInode\fR. A list of the selected
-nodes is returned. By default all nodes match, but you can set
-switches to narrow the match.
-.sp
-The \fB\-exact\fR, \fB\-glob\fR,
-and \fB\-regexp\fR switches indicate both what kind of pattern matching
-to perform and the pattern. By default each pattern will be compared
-with the node label. You can set more than one of these switches. If
-any of the patterns match (logical or), the node matches.
-If the \fB\-key\fR switch is
-used, it designates the data field to be matched.
-.sp
-The order in
-which the nodes are traversed is controlled by the \fB\-order\fR switch.
-The possible orderings are \fBpreorder\fR, \fBpostorder\fR, \fBinorder\fR,
-and \fBbreadthfirst\fR. The default is \fBpostorder\fR.
-.sp
-The valid switches are listed
-below:
-.RS
-.TP 1i
-\fB\-addtag\fR \fIstring\fR
-Add the tag \fIstring\fR to each selected node.
-.TP 1i
-\fB\-count\fR \fInumber\fR
-Stop processing after \fInumber\fR (a positive integer) matches.
-.TP 1i
-\fB\-depth\fR \fInumber\fR
-Descend at most \fInumber\fR (a non-negative integer) levels
-If \fInumber\fR is \f(CW1\fR this means only apply the tests
-to the children of \fInode\fR.
-.TP 1i
-\fB\-exact\fR \fIstring\fR
-Matches each node using \fIstring\fR. The node must match \fIstring\fR
-exactly.
-.TP 1i
-\fB\-excludes\fR \fInodeList\fR
-Excludes any node in the list \fInodeList\fR from the search.
-The subnodes of an excluded node are still examined.
-.TP 1i
-\fB\-exec\fR \fIcommand\fR
-Invoke \fIcommand\fR for each matching node. Before \fIcommand\fR is
-invoked, the id of the node is appended. You can control
-processing by the return value of \fIcommand\fR. If \fIcommand\fR
-generates an error, processing stops and the \fBfind\fR operation
-returns an error. But if \fIcommand\fR returns \fBbreak\fR, then
-processing stops, no error is generated. If \fIcommand\fR returns
-\fBcontinue\fR, then processing
-stops on that subtable and continues on the next.
-.TP 1i
-\fB\-glob\fR \fIstring\fR
-Test each node to \fIstring\fR using global pattern
-matching. Matching is done in a fashion similar to that used by the
-C-shell.
-.TP 1i
-\fB\-invert\fR
-Select non-matching nodes. Any node that \fIdoesn't\fR match
-the given criteria will be selected.
-.TP 1i
-\fB\-key\fR \fIkey\fR
-Compare the values of the data field keyed by \fIkey\fR instead of
-the node's label. If no pattern is given (\fB\-exact\fR, \fB\-glob\fR, or
-\fB\-regexp\fR switches), then any node with this data key will match.
-.TP 1i
-\fB\-leafonly\fR
-Only test nodes with no children.
-.TP 1i
-\fB\-nocase\fR
-Ignore case when matching patterns.
-.TP
-\fB\-order\fR \fIstring\fR
-Traverse the table and process nodes according to \fIstring\fR. \fIString\fR
-can be one of the following:
-.RS
-.TP 1i
-\fBbreadthfirst\fR
-Process the node and the subtables at each sucessive level. Each node
-on a level is processed before going to the next level.
-.TP 1i
-\fBinorder\fR
-Recursively process the nodes of the first subtable, the node itself,
-and any the remaining subtables.
-.TP 1i
-\fBpostorder\fR
-Recursively process all subtables before the node.
-.TP 1i
-\fBpreorder\fR
-Recursively process the node first, then any subtables.
-.RE
-.TP
-\fB\-path\fR
-Use the node's full path when comparing nodes.
-.TP
-\fB\-regexp\fR \fIstring\fR
-Test each node using \fIstring\fR as a regular expression pattern.
-.TP
-\fB\-tag\fR \fIstring\fR
-Only test nodes that have the tag \fIstring\fR.
-.RE
-.TP
-\fItableName\fR \fBfindchild\fR \fInode\fR \fIlabel\fR
-Searches for a child node \Ilabel\fR in \fInode\fR. The id of the
-child node is returned if found. Otherwise \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBfirstchild\fR \fInode\fR
-Returns the id of the first child in the \fInode\fR's list
-of subtables. If \fInode\fR is a leaf (has no children),
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBget\fR \fInode\fR ?\fIkey\fR? ?\fIdefaultValue\fR?
-Returns a list of key-value pairs of data for the node. If \fIkey\fR
-is present, then onlyx the value for that particular data field is
-returned. It's normally an error if \fInode\fR does not contain the
-data field \fIkey\fR. But if you provide a \fIdefaultValue\fR
-argument, this value is returned instead (\fInode\fR will still not
-contain \fIkey\fR). This feature can be used to access a data field of
-\fInode\fR without first testing if it exists. This operation may
-trigger \fBread\fR data traces.
-.TP
-\fItableName\fR \fBindex\fR \fInode\fR
-Returns the id of \fInode\fR. If \fInode\fR is a tag, it
-can only specify one node. If \fInode\fR does not represent a valid
-node id or tag, or has modifiers that are invalid, then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBinsert\fR \fIparent\fR ?\fIswitches\fR?
-Inserts a new node into parent node \fIparent\fR.
-The id of the new node is returned. The following switches
-are available:
-.RS
-.TP 1i
-\fB\-after\fR \fIchild\fR
-Position \fInode\fR after \fIchild\fR. The node \fIchild\fR must be a
-child of \fIparent\fR.
-.TP 1i
-\fB\-at\fR \fInumber\fR
-Inserts the node into \fIparent\fR's list of children at
-position \fInumber\fR. The default is to append \fInode\fR.
-.TP 1i
-\fB\-before\fR \fIchild\fR
-Position \fInode\fR before \fIchild\fR. The node \fIchild\fR must be a
-child of \fIparent\fR.
-.TP 1i
-\fB\-data\fR \fIdataList\fR
-Sets the value for each data field in \fIdataList\fR for the
-new node. \fIDataList\fR is a list of key-value pairs.
-.TP 1i
-\fB\-label\fR \fIstring\fR
-Designates the labels of the node as \fIstring\fR. By default, nodes
-are labeled as \f(CWnode0\fR, \f(CWnode1\fR, etc.
-.TP 1i
-\fB\-node\fR \fIid\fR
-Designates the id for the node. Normally new ids are automatically
-generated. This allows you to create a node with a specific id.
-It is an error if the id is already used by another node in the table.
-.TP 1i
-\fB\-tags\fR \fItagList\fR
-Adds each tag in \fItagList\fR to the new node. \fITagList\fR is a list
-of tags, so be careful if a tag has embedded spaces.
-.RE
-.TP
-\fItableName\fR \fBis\fR \fIproperty\fR \fIargs\fR
-Indicates the property of a node. Both \fIproperty\fR and \fIargs\fR
-determine the property being tested. Returns \f(CW1\fR if true and
-\f(CW0\fR otherwise. The following \fIproperty\fR and \fIargs\fR
-are valid:
-.RS
-.TP 1i
-\fBancestor\fR \fInode1\fR \fInode2\fR
-Indicates if \fInode1\fR is an ancestor of \fInode2\fR.
-.TP 1i
-\fBbefore\fR \fInode1\fR \fInode2\fR
-Indicates if \fInode1\fR is before \fInode2\fR in depth first traversal.
-.TP 1i
-\fBleaf\fR \fInode\fR
-Indicates if \fInode\fR is a leaf (it has no subtables).
-.TP 1i
-\fBroot\fR \fInode\fR
-Indicates if \fInode\fR is the designated root. This can be changed
-by the \fBroot\fR operation.
-.RE
-.TP
-\fItableName\fR \fBlabel\fR \fInode\fR ?\fInewLabel\fR?
-Returns the label of the node designated by \fInode\fR. If \fInewLabel\fR
-is present, the node is relabeled using it as the new label.
-.TP
-\fItableName\fR \fBlastchild\fR \fInode\fR
-Returns the id of the last child in the \fInode\fR's list
-of subtables. If \fInode\fR is a leaf (has no children),
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBmove\fR \fInode\fR \fInewParent\fR ?\fIswitches\fR?
-Moves \fInode\fR into \fInewParent\fR. \fINode\fR is appended to the
-list children of \fInewParent\fR. \fINode\fR can not be an ancestor
-of \fInewParent\fR. The valid flags for \fIswitches\fR are described below.
-.RS
-.TP 1i
-\fB\-after\fR \fIchild\fR
-Position \fInode\fR after \fIchild\fR. The node \fIchild\fR must be a
-child of \fInewParent\fR.
-.TP 1i
-\fB\-at\fR \fInumber\fR
-Inserts \fInode\fR into \fIparent\fR's list of children at
-position \fInumber\fR. The default is to append the node.
-.TP 1i
-\fB\-before\fR \fIchild\fR
-Position \fInode\fR before \fIchild\fR. The node \fIchild\fR must be a
-child of \fInewParent\fR.
-.RE
-.TP
-\fItableName\fR \fBnext\fR \fInode\fR
-Returns the next node from \fInode\fR in a preorder traversal.
-If \fInode\fR is the last node in the table,
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBnextsibling\fR \fInode\fR
-Returns the node representing the next subtable from \fInode\fR
-in its parent's list of children. If \fInode\fR is the last child,
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBnotify\fR \fIargs\fR
-Manages notification events that indicate that the table structure has
-been changed.
-See the
-.SB "NOTIFY OPERATIONS"
-section below.
-.TP
-\fItableName\fR \fBparent\fR \fInode\fR
-Returns the parent node of \fInode\fR. If \fInode\fR is the root
-of the table,
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBpath\fR \fInode\fR
-Returns the full path (from root) of \fInode\fR.
-.TP
-\fItableName\fR \fBposition\fR \fInode\fR
-Returns the position of the node in its parent's list of children.
-Positions are numbered from 0.
-The position of the root node is always 0.
-.TP
-\fItableName\fR \fBprevious\fR \fInode\fR
-Returns the previous node from \fInode\fR in a preorder traversal.
-If \fInode\fR is the root of the table,
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBprevsibling\fR \fInode\fR
-Returns the node representing the previous subtable from \fInode\fR
-in its parent's list of children. If \fInode\fR is the first child,
-then \f(CW-1\fR is returned.
-.TP
-\fItableName\fR \fBrestore\fR \fInode\fR \fIdataString\fR \fIswitches\fR
-Performs the inverse function of the \fBdump\fR operation, restoring
-nodes to the table. The format of \fIdataString\fR is exactly what is
-returned by the \fBdump\fR operation. It's a list containing information
-for each node to be restored. The information consists of 1) the relative
-path of the node, 2) a sublist of key value pairs representing the
-node's data, and 3) a list of tags for the node. Nodes are created
-starting from \fInode\fR. Nodes can be listed in any order. If a node's
-path describes ancestor nodes that do not already exist, they are
-automatically created. The valid \fIswitches\fR are listed below:
-.RS
-.TP
-\fB\-overwrite\fR
-Overwrite nodes that already exist. Normally nodes are always
-created, even if there already exists a node by the same name. This
-switch indicates to add or overwrite the node's data fields.
-.RE
-.TP
-\fItableName\fR \fBrestorefile\fR \fInode\fR \fIfileName\fR \fIswitches\fR
-Performs the inverse function of the \fBdumpfile\fR operation, restoring
-nodes to the table from the file \fIfileName\fR. The format of
-\fIfileName\fR is exactly what is returned by the \fBdumpfile\fR operation.
-It's a list containing information for each node to be restored.
-The information consists of 1) the relative path of the node, 2)
-a sublist of key value pairs representing the node's data, and 3)
-a list of tags for the node. Nodes are created
-starting from \fInode\fR. Nodes can be listed in any order. If a node's
-path describes ancestor nodes that do not already exist, they are
-automatically created. The valid \fIswitches\fR are listed below:
-.RS
-.TP
-\fB\-overwrite\fR
-Overwrite nodes that already exist. Normally nodes are always
-created, even if there already exists a node by the same name. This
-switch indicates to add or overwrite the node's data fields.
-.RE
-.TP
-\fItableName\fR \fBroot\fR ?\fInode\fR?
-Returns the id of the root node. Normally this is node \f(CW0\fR. If
-a \fInode\fR argument is provided, it will become the new root of the
-table. This lets you temporarily work within a subset of the table.
-Changing root affects operations such as \fBnext\fR, \fBpath\fR,
-\fBprevious\fR, etc.
-.TP
-\fItableName\fR \fBset\fR \fInode\fR \fIkey value\fR ?\fIkey value\fR...?
-Sets one or more data fields in \fInode\fR. \fINode\fR may
-be a tag that represents several nodes. \fIKey\fR is the
-name of the data field to be set and \fIvalue\fR is its respective
-value. This operation may trigger \fBwrite\fR and \fBcreate\fR data traces.
-.TP
-\fItableName\fR \fBsize\fR \fInode\fR
-Returns the number of nodes in the subtable. This includes the node
-and all its descendants. The size of a leaf node is 1.
-.TP
-\fItableName\fR \fBsort\fR \fInode\fR ?\fIswitches\fR?
-.RS
-.TP 1i
-\fB\-ascii\fR
-Compare strings using the ASCII collation order.
-.TP 1i
-\fB\-command\fR \fIstring\fR
-Use command \fIstring\fR as a comparison command. To compare two
-elements, evaluate a Tcl script consisting of command with the two
-elements appended as additional arguments. The script should return
-an integer less than, equal to, or greater than zero if the first
-element is to be considered less than, equal to, or greater than the
-second, respectively.
-.TP 1i
-\fB\-decreasing\fR
-Sort in decreasing order (largest items come first).
-.TP 1i
-\fB\-dictionary\fR
-Compare strings using a dictionary-style comparison. This is the same
-as \fB\-ascii\fR except (a) case is ignored except as a tie-breaker and (b)
-if two strings contain embedded numbers, the numbers compare as integers, not
-characters. For example, in \fB\-dictionary\fR mode, bigBoy sorts between
-bigbang and bigboy, and x10y sorts between x9y and x11y.
-.TP 1i
-\fB\-integer\fR
-Compare the nodes as integers.
-.TP 1i
-\fB\-key\fR \fIstring\fR
-Sort based upon the node's data field keyed by \fIstring\fR. Normally
-nodes are sorted according to their label.
-.TP 1i
-\fB\-path\fR
-Compare the full path of each node. The default is to compare only its
-label.
-.TP 1i
-\fB\-real\fR
-Compare the nodes as real numbers.
-.TP 1i
-\fB\-recurse\fR
-Recursively sort the entire subtable rooted at \fInode\fR.
-.TP 1i
-\fB\-reorder\fR
-Recursively sort subtables for each node. \fBWarning\fR. Unlike
-the normal flat sort, where a list of nodes is returned, this will
-reorder the table.
-.RE
-.TP
-\fItableName\fR \fBtag\fR \fIargs\fR
-Manages tags for the table object.
-See the
-.SB "TAG OPERATIONS"
-section below.
-.TP
-\fItableName\fR \fBtrace\fR \fIargs\fR
-Manages traces for data fields in the table object.
-Traces cause Tcl commands to be executed whenever a data field of a
-node is created, read, written, or unset. Traces can be set for a
-specific node or a tag, representing possibly many nodes.
-See the
-.SB "TRACE OPERATIONS"
-section below.
-.TP
-\fItableName\fR \fBunset\fR \fInode\fR \fIkey\fR...
-Removes one or more data fields from \fInode\fR. \fINode\fR may
-be a tag that represents several nodes. \fIKey\fR is the
-name of the data field to be removed. It's not an error is
-\fInode\fR does not contain \fIkey\fR.
-This operation may trigger \fBunset\fR data traces.
-.RE
-.SH TAG OPERATIONS
-Tags are a general means of selecting and marking nodes in the table.
-A tag is just a string of characters, and it may take any form except
-that of an integer. The same tag may be associated with many
-different nodes.
-.sp
-There are two built-in tags: The tag \fBall\fR is implicitly
-associated with every node in the table. It may be used to invoke
-operations on all the nodes in the table. The tag \fBroot\fR is
-managed automatically by the table object. It specifies the node
-that is currently set as the root of the table.
-.sp
-Most table operations use tags. And several operations let you
-operate on multiple nodes at once. For example, you can use the
-\fBset\fR operation with the tag \fBall\fR to set a data field in
-for all nodes in the table.
-.PP
-Tags are invoked by the \fBtag\fR operation. The
-general form is
-.DS
-\fItableName\fR \fBtag\fR \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for tags are listed below.
-.TP
-\fItableName\fR \fBtag add\fR \fIstring\fR \fInode\fR...
-Adds the tag \fIstring\fR to one of more nodes.
-.TP
-\fItableName\fR \fBtag delete\fR \fIstring\fR \fInode\fR...
-Deletes the tag \fIstring\fR from one or more nodes.
-.TP
-\fItableName\fR \fBtag forget\fR \fIstring\fR
-Removes the tag \fIstring\fR from all nodes. It's not an error if no
-nodes are tagged as \fIstring\fR.
-.TP
-\fItableName\fR \fBtag get\fR \fInode\fR \fIpattern\fR...
-Returns the tag names for a given node. If one of more pattern
-arguments are provided, then only those matching tags are returned.
-.TP
-\fItableName\fR \fBtag names\fR ?\fInode\fR?
-Returns a list of tags used by the table. If a \fInode\fR argument
-is present, only those tags used by \fInode\fR are returned.
-.TP
-\fItableName\fR \fBtag nodes\fR \fIstring\fR
-Returns a list of nodes that have the tag \fIstring\fR. If no node
-is tagged as \fIstring\fR, then an empty string is returned.
-.TP
-\fItableName\fR \fBtag set\fR \fInode\fR \fIstring\fR...
-Sets one or more tags for a given node. Tag names can't start with a
-digit (to distinquish them from node ids) and can't be a reserved tag
-("root" or "all").
-.TP
-\fItableName\fR \fBtag unset\fR \fInode\fR \fIstring\fR...
-Removes one or more tags from a given node. Tag names that don't exist
-or are reserved ("root" or "all") are silently ignored.
-.SH TRACE OPERATIONS
-Data fields can be traced much in the same way that you can trace Tcl
-variables. Data traces cause Tcl commands to be executed whenever a
-particular data field of a node is created, read, written, or unset.
-A trace can apply to one or more nodes. You can trace a specific node
-by using its id, or a group of nodes by a their tag.
-.PP
-The table's \fBget\fR, \fBset\fR, and \fBunset\fR operations can
-trigger various traces. The \fBget\fR operation can cause
-a \fIread\fR trace to fire. The \fBset\fR operation causes a \fIwrite\fR
-trace to fire. And if the data field is written for the first time, you
-will also get a \fIcreate\fR trace.
-The \fBunset\fR operation triggers \fIunset\fR traces.
-.PP
-Data traces are invoked by the \fBtrace\fR
-operation. The general form is
-.DS
-\fItableName\fR \fBtrace\fR \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for traces are listed below.
-.TP
-\fItableName\fR \fBtrace create\fR \fInode\fR \fIkey\fR \fIops\fR \fIcommand\fR
-Creates a trace for \fInode\fR on data field \fIkey\fR. \fINode\fR
-can refer to more than one node (for example, the tag \fBall\fR). If
-\fInode\fR is a tag, any node with that tag can possibly trigger a trace,
-invoking \fIcommand\fR.
-\fICommand\fR is command prefix, typically a procedure name.
-Whenever a trace is triggered, four arguments are appended to
-\fIcommand\fR before it is invoked: \fItableName\fR, id of the
-node, \fIkey\fR and, \fIops\fR.
-Note that no nodes need have the field \fIkey\fR.
-A trace identifier in the form "\f(CWtrace0\fR", "\f(CWtrace1\fR", etc.
-is returned.
-.sp
-\fIOps\fR indicates which operations are of
-interest, and consists of one or more of the following letters:
-.RS
-.TP
-\fBr\fR
-Invoke \fIcommand\fR whenever \fIkey\fR is read. Both read and
-write traces are temporarily disabled when \fIcommand\fR is executed.
-.TP
-\fBw\fR
-Invoke \fIcommand\fR whenever \fIkey\fR is written. Both read and
-write traces are temporarily disabled when \fIcommand\fR is executed.
-.TP
-\fBc\fR
-Invoke \fIcommand\fR whenever \fIkey\fR is created.
-.TP
-\fBu\fR
-Invoke \fIcommand\fR whenever \fIkey\fR is unset. Data fields are
-typically unset with the \fBunset\fR command. Data fields are also
-unset when the table is released, but all traces are disabled prior
-to that.
-.sp
-.RE
-.TP
-\fItableName\fR \fBtrace delete\fR \fItraceId\fR...
-Deletes one of more traces. \fITraceId\fR is
-the trace identifier returned by the \fBtrace create\fR operation.
-.TP
-\fItableName\fR \fBtrace info\fR \fItraceId\fR
-Returns information about the trace \fItraceId\fR. \fITraceId\fR
-is a trace identifier previously returned by the \fBtrace create\fR operation.
-It's the same information specified for the \fBtrace create\fR operation.
-It consists of the node id or tag, data field key, a string of letters
-indicating the operations that are traced (it's in the same
-form as \fIops\fR) and, the command prefix.
-.TP
-\fItableName\fR \fBtrace names\fR
-Returns a list of identifers for all the current traces.
-.SH NOTIFY OPERATIONS
-Table objects can be shared among many clients, such as a
-\fBhiertable\fR widget. Any client can create or delete nodes,
-sorting the table, etc. You can request to be notified whenever these
-events occur. Notify events cause Tcl commands to be executed
-whenever the table structure is changed.
-.PP
-Notifications are handled by the \fBnotify\fR operation. The
-general form is
-.DS
-\fItableName\fR \fBnotify\fR \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for events are listed below.
-.TP
-\fItableName\fR \fBnotify create\fR ?\fIswitches\fR? \fIcommand\fR \fR?\fIargs\fR?...
-Creates a notifier for the table. A notify identifier in the form
-"\f(CWnotify0\fR", "\f(CWnotify1\fR", etc. is returned.
-.sp
-\fICommand\fR and \fIargs\fR are saved and invoked whenever the table
-structure is changed (according to \fIswitches\fR). Two arguments are
-appended to \fIcommand\fR and \fIargs\fR before it's invoked: the id
-of the node and a string representing the type of event that occured.
-One of more switches can be set to indicate the events that are of
-interest. The valid switches are as follows:
-.RS
-.TP 1i
-\fB\-create\fR
-Invoke \fIcommand\fR whenever a new node has been added.
-.TP 1i
-\fB\-delete\fR
-Invoke \fIcommand\fR whenever a node has been deleted.
-.TP 1i
-\fB\-move\fR
-Invoke \fIcommand\fR whenever a node has been moved.
-.TP 1i
-\fB\-sort\fR
-Invoke \fIcommand\fR whenever the table has been sorted and reordered.
-.TP 1i
-\fB\-relabel\fR
-Invoke \fIcommand\fR whenever a node has been relabeled.
-.TP 1i
-\fB\-allevents\fR
-Invoke \fIcommand\fR whenever any of the above events occur.
-.TP 1i
-\fB\-whenidle\fR
-When an event occurs don't invoke \fIcommand\fR immediately, but
-queue it to be run the next time the event loop is entered and there
-are no events to process. If subsequent events occur before
-the event loop is entered, \fIcommand\fR will still be
-invoked only once.
-.RE
-.TP
-\fItableName\fR \fBnotify delete\fR \fInotifyId\fR
-Deletes one or more notifiers from the table. \fINotifyId\fR is the
-notifier identifier returned by the \fBnotify create\fR operation.
-.TP
-\fItableName\fR \fBnotify info\fR \fInotifyId\fR
-Returns information about the notify event \fInotifyId\fR. \fINotifyId\fR
-is a notify identifier previously returned by the \fBnotify create\fR operation.
-It's the same information specified for the \fBnotify create\fR operation.
-It consists of the notify id, a sublist of event flags (it's in the same
-form as \fIflags\fR) and, the command prefix.
-.TP
-\fItableName\fR \fBnotify names\fR
-Returns a list of identifers for all the current notifiers.
-.SH C LANGUAGE API
-Blt_Dt_Apply,
-Blt_Dt_ApplyBFS,
-Blt_Dt_ApplyDFS,
-Blt_Dt_ChangeRoot,
-Blt_Dt_Create,
-Blt_Dt_CreateEventHandler,
-Blt_Dt_CreateNode,
-Blt_Dt_CreateTrace,
-Blt_Dt_DeleteEventHandler,
-Blt_Dt_DeleteNode,
-Blt_Dt_DeleteTrace,
-Blt_Dt_Exists,
-Blt_Dt_FindChild,
-Blt_Dt_FirstChild,
-Blt_Dt_FirstKey,
-Blt_Dt_GetNode,
-Blt_Dt_GetToken,
-Blt_Dt_GetValue,
-Blt_Dt_IsAncestor,
-Blt_Dt_IsBefore,
-Blt_Dt_IsLeaf,
-Blt_Dt_LastChild,
-Blt_Dt_MoveNode,
-Blt_Dt_Name,
-Blt_Dt_NextKey,
-Blt_Dt_NextNode,
-Blt_Dt_NextSibling,
-Blt_Dt_NodeDegree,
-Blt_Dt_NodeDepth,
-Blt_Dt_NodeId,
-Blt_Dt_NodeLabel,
-Blt_Dt_NodeParent,
-Blt_Dt_PrevNode,
-Blt_Dt_PrevSibling,
-Blt_Dt_RelabelNode,
-Blt_Dt_ReleaseToken,
-Blt_Dt_RootNode,
-Blt_Dt_SetValue,
-Blt_Dt_Size,
-Blt_Dt_SortNode, and
-Blt_Dt_UnsetValue.
-.SH KEYWORDS
-table, hiertable, widget
diff --git a/blt3.0.1/man/dragdrop.mann b/blt3.0.1/man/dragdrop.mann
deleted file mode 100644
index 895e804..0000000
--- a/blt3.0.1/man/dragdrop.mann
+++ /dev/null
@@ -1,470 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\"
-.so man.macros
-.TH drag&drop n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-drag&drop \- facilities for handling drag&drop data transfers
-.SH SYNOPSIS
-\fBdrag&drop source
-.br
-\fBdrag&drop source \fIwindow \fR?\fIoptions\fR?
-.br
-\fBdrag&drop source \fIwindow \fBhandler \fR?\fIdataType\fR? ?\fIcommand arg arg...\fR?
-.sp
-\fBdrag&drop target
-.br
-\fBdrag&drop target \fIwindow \fBhandler \fR?\fIdataType command arg arg...\fR?
-.sp
-\fBdrag&drop target \fIwindow \fBhandle \fIdataType\fR ?\fIvalue\fR?
-.sp
-\fBdrag&drop token \fIwindow
-.sp
-\fBdrag&drop drag \fIwindow x y
-.br
-\fBdrag&drop drop \fIwindow x y
-.br
-\fBdrag&drop active
-.br
-\fBdrag&drop location \fR?\fIx y\fR?
-.BE
-
-.SH DESCRIPTION
-.PP
-The \fBdrag&drop\fR command provides access to a set of facilities
-for managing drag-and-drop data transfers. Any of the usual Tk widgets can
-be registered to participate in the drag-and-drop process. Widgets
-registered as a drag&drop \fIsource\fP can export data to other widgets
-registered as a drag&drop \fItarget\fP. Note that a particular widget
-can be registered as a source, as a target, or as both.
-.PP
-The drag-and-drop process begins when the user clicks and holds a mouse
-button in a source window; a token window appears with an icon or message
-to represent the data being transferred. As the user moves the mouse pointer,
-the token window follows along, acting as a movable packet of data.
-Whenever the mouse pointer falls on a valid target window, the border of the
-token window is changed to a raised (active) state. When the mouse button is
-released over the target window, a Tcl routine is invoked to send the data
-to the desired application, and the target window is asked to "handle"
-the data. If this communication process fails, a rejection symbol (a
-circle with a line through it) is displayed on the token window to
-indicate failure.
-.PP
-The details of the communication process are fully configurable by the
-application developer. In the simplest case, the value that is sent
-to the target window is a simple string. The target window is simply
-asked to "handle" that string value. In general, the source window
-can have a special "handler" procedure to transfer a particular data
-type by issuing a series of "send" commands. After this, the target
-window is again asked to "handle" the result.
-.PP
-Both sources and targets can have a list of "handlers" for different
-data types. As a token window is dragged from its source to various
-targets, each target is checked to see if it recognizes a handler
-offered by the source. If it does, it is treated as a valid target.
-Otherwise, it is ignored. This scheme allows the same source to
-interact with many different kinds of targets. For example, a source
-for RGB color samples might have "color" and "string" handlers. This
-would allow it to communicate with "color" targets (sending RGB data)
-as well as entry widgets (sending strings of the form "#rrggbb").
-.PP
-This introduction was presented as a brief overview of the communication
-process; further details are presented below:
-.TP
-\fBdrag&drop source\fR
-Returns a list of path names for widgets registered as drag&drop
-sources. Returns an empty string if no widgets have been registered.
-.TP
-\fBdrag&drop source \fIwindow \fR?\fIoptions\fR?
-Registers a new drag&drop source window with the given options, or
-modifies the options for an existing window:
-.RS
-.LP
-.nf
-Name: \fBbuttonBinding\fR
-Class: \fBButtonBinding\fR
-Switch: \fB\-button\fR \fIn\fR
-.fi
-.IP
-Specifies the mouse button (integer 1-5) that will invoke the drag&drop
-operation on the source window. This causes the following bindings to
-be added to the widget:
-.sp
-.nf
-.RS
-\f(CWbind \fIwin\fP <ButtonPress-\fIn\fP> {drag&drop drag %W %X %Y}
-\f(CWbind \fIwin\fP <B\fIn\fP-Motion> {drag&drop drag %W %X %Y}
-\f(CWbind \fIwin\fP <ButtonRelease-\fIn\fP> {drag&drop drop %W %X %Y}\fR
-.RE
-.fi
-.sp
-The default value is button 3. If the value "0" is specified, then no
-bindings are added; this enables the user to establish bindings
-manually.
-.LP
-.nf
-Name: \fBpackageCommand\fR
-Class: \fBCommand\fR
-Switch: \fB\-packagecmd \fIcommand\fR
-.fi
-.IP
-Specifies a Tcl command used to establish the appearance of the token
-window at the start of each drag&drop operation. This command is
-automatically invoked by the \fBdrag&drop drag\fP command whenever the
-token window is about to be mapped for a drag operation. It should
-update the appearance of the token window to represent the data that
-is being moved.
-.PP
-The following substitutions are made in the \fIcommand\fR string
-before it is executed:
-.RS
-.TP
-\fB%t\fR
-Replaced with the window path name for the token which represents
-the data being dragged.
-.TP
-\fB%W\fR
-Replaced with the window path name for the drag&drop source.
-.RE
-.LP
-The return value from the package command represents the data being
-transferred. If the package command returns an empty string, the
-drag operation is quietly aborted. This can be used to disallow
-drag&drop operations from certain parts of a widget, if the drag
-position is inappropriate.
-.LP
-For example, the following package routine will select an item
-from a listbox and configure the token window to display the selected
-string. It uses the \fBdrag&drop location\fR command to
-determine the entry in the listbox that the user has selected
-and it returns this as the data value:
-.sp
-.nf
-.RS
-\f(CWproc package_list_item {lbox token} {
- set xy [drag&drop location]
- set y [expr [lindex $xy 1]-[winfo rooty $lbox]]
-
- set str [$lbox get [$lbox nearest $y]]
- $token.value configure -text $str
- return $str
-}\fR
-.RE
-.fi
-.sp
-The return value is available later when the source and target
-communicate. If the source has a command associated with its
-data handler, then this value is substituted in place of "%v"
-in the source handler. Otherwise, it is substituted in place
-of "%v" in the target handler.
-.LP
-.nf
-Name: \fBerrorCmd\fR
-Class: \fBErrorCmd\fR
-Switch: \fB\-errorcmd \fIproc\fR
-.fi
-.IP
-Specifies a Tcl \fIproc\fR used to handle errors encountered during
-drag&drop operations. If a \fIproc\fR is not specified, this command
-returns the current error handler. By default, all errors are sent
-to the usual \fBtkerror\fR command, and therefore appear in a dialog
-box to the user. This behavior is quite useful when debugging
-communication protocols, but may not be desirable in a finished
-application. Errors can be suppressed entirely (leaving the rejection
-symbol as the only error indicator) by specifying a null string in
-place of the \fIproc\fR name.
-.LP
-.nf
-Name: \fBrejectBackground\fR
-Class: \fBBackground\fR
-Switch: \fB\-rejectbg \fIcolor\fR
-.fi
-.IP
-Specifies the color used to draw the background of the rejection symbol
-on the token window. The rejection symbol (a circle with a line through
-it--the international "no") appears whenever communication fails.
-.LP
-.nf
-Name: \fBrejectForeground\fR
-Class: \fBForeground\fR
-Switch: \fB\-rejectfg \fIcolor\fR
-.fi
-.IP
-Specifies the color used to draw the foreground of the rejection symbol
-on the token window.
-.LP
-.nf
-Name: \fBrejectStipple\fR
-Class: \fBStipple\fR
-Switch: \fB\-rejectstipple \fIpattern\fR
-.fi
-.IP
-Specifies a stipple pattern used to draw the foreground of the rejection
-symbol on the token window. Any of the forms acceptable to Tk_GetBitmap
-can be used.
-.LP
-.nf
-Name: \fBselfTarget\fR
-Class: \fBSelfTarget\fR
-Switch: \fB\-selftarget \fIboolean\fR
-.fi
-.IP
-If the \fIboolean\fR value is true, and if a source widget is also
-registered as a compatible target, then the source will be able to transmit
-to itself during drag&drop operations. This is primarily useful for
-complex sources such as a canvas widget, where items may be moved from
-place to place within the same widget. By default, this option is disabled.
-.LP
-.nf
-Name: \fBsend\fR
-Class: \fBSend\fR
-Switch: \fB\-send \fIlist\fR
-.fi
-.IP
-Specifies a \fIlist\fR of \fIdataTypes\fR enabled for communication. Only
-\fIdataTypes\fR defined by commands of the form "\fBdrag&drop source
-\fIwindow \fBhandler \fR?\fIdataType\fR ?\fIcommand arg arg...\fR?" are
-allowed. This list also determines the priority of the various
-\fIdataTypes\fR.
-When a token window is over a potential drag&drop target, this list is
-searched from start to finish for a \fIdataType\fR that is also recognized
-by the target. The first matching \fIdataType\fR found determines the
-value that will be sent if the token is dropped. If no matching \fIdataType\fR
-is found, then the target is incompatible, and is ignored. By default,
-this option has the value "all", indicating that all \fIdataTypes\fR should
-be considered in the order that they were defined for the source.
-.LP
-Note that this option makes it easy to control a drag&drop source. Setting
-the value to an empty string disables the source; setting the value back
-to "all" restores communication.
-.LP
-.nf
-Name: \fBsiteCommand\fR
-Class: \fBCommand\fR
-Switch: \fB\-sitecmd \fIcommand\fR
-.fi
-.IP
-Specifies a Tcl command used to update the appearance of the token window.
-If specified, this command is automatically invoked by the
-\fBdrag&drop drag\fP command whenever the token window is over a
-compatible drag&drop target.
-.PP
-The following substitutions are made in the \fIcommand\fR string
-before it is executed:
-.RS
-.TP
-\fB%s\fR
-Replaced with "1" if the token window is over a compatible target,
-and "0" otherwise.
-.TP
-\fB%t\fR
-Replaced with the window path name for the token which represents
-the data being dragged.
-.RE
-.LP
-Regardless of this command, border of the token window will become
-raised whenever the token is over a valid target. This command
-can be used to display other visual cues.
-.LP
-.nf
-Name: \fBtokenAnchor\fR
-Class: \fBAnchor\fR
-Switch: \fB\-tokenanchor \fIanchor\fR
-.fi
-.IP
-Specifies how the token window is positioned relative to the mouse
-pointer coordinates passed to the \fBdrag&drop drag\fP command.
-Must be one of the values n, s, e, w, center, nw, ne, sw or se.
-For example, "nw" means to position the token such that its upper-left
-corner is at the mouse pointer. The default value is "center".
-.LP
-.nf
-Name: \fBtokenBackground\fR
-Class: \fBBackground\fR
-Switch: \fB\-tokenbg \fIcolor\fR
-.fi
-.IP
-Specifies the color used to draw the background of the token window.
-.LP
-.nf
-Name: \fBtokenBorderWidth\fR
-Class: \fBBorderWidth\fR
-Switch: \fB\-tokenborderwidth \fIsize\fR
-.fi
-.IP
-Specifies the width in pixels of the border around the token window.
-This border becomes raised to indicate when the token is over a compatible
-drag&drop target site. The value may have any of the forms acceptable
-to Tk_GetPixels. The default value is "3".
-.LP
-.nf
-Name: \fBtokenCursor\fR
-Class: \fBCursor\fR
-Switch: \fB\-tokencursor \fIcursor\fR
-.fi
-.IP
-Specifies the cursor used when a token window is active. The value
-may have any of the forms acceptable to Tk_GetCursor. The default
-value is "center_ptr".
-.RE
-.TP
-\fBdrag&drop source \fIwindow \fBhandler \fR?\fIdataType\fR? ?\fIcommand arg arg...\fR?
-With no extra arguments, this command returns a list of all \fIdataType\fR
-names that have been registered for the source \fIwindow\fR. If only the
-\fIdataType\fR is specified, then the \fIdataType\fR is created if
-necessary, and the command associated with the \fIdataType\fR is returned.
-Otherwise, it concatenates the \fIcommand\fR and any extra \fIarg\fR strings,
-and registers a new \fIdataType\fR with this command.
-.PP
-The following substitutions are made in the \fIcommand\fR string
-before it is executed:
-.RS
-.TP
-\fB%i\fR
-Replaced with the name of the interpreter for the target application.
-.TP
-\fB%v\fR
-Replaced with the value returned from the "-packagecmd" command.
-.TP
-\fB%w\fR
-Replaced with the window path name for the target window.
-.RE
-.LP
-A typical source handler contains one or more "send" commands which
-transfer data to the remote application. The target window is then
-asked to handle the new data. Whatever value is returned by the
-source \fIcommand\fR handler is automatically substituted into the
-"%v" fields of the target handler.
-.LP
-This separation between the transfer and the handling of the data is
-important. It allows the same source handler to transfer data for
-many different targets, and it allows each of the targets to handle
-the incoming data differently. If an error is encountered during the
-communication process, the rejection symbol is posted on the token window
-to indicate failure.
-.RE
-.sp
-.TP
-\fBdrag&drop target\fR
-Returns a list of path names for widgets registered as drag&drop
-targets. Returns an empty string if no widgets have been registered.
-.TP
-\fBdrag&drop target \fIwindow \fBhandler \fR?\fIdataType command arg arg...\fR?
-Registers a new drag&drop target window with a given handler, or
-modifies the handlers for an existing window. If no \fIdataType\fR
-is specified, this command returns the current list of recognized
-\fIdataType\fR strings. Each \fIdataType\fR is a symbolic name
-representing a form of data, and the corresponding \fIcommand\fR is
-a Tcl command that specifies how the target will make use of the data.
-This command is invoked indirectly after a source has transferred data
-to a target application.
-.PP
-The following substitutions are made in the \fIcommand\fR string
-before it is executed:
-.RS
-.TP
-\fB%v\fR
-In the simplest case, the source window does not have a handler command
-for the selected \fIdataType\fR, and this field is replaced with the
-result from the "-packagecmd" command. When the source does have a
-handler command, the result from the "-packagecmd" command is substituted
-into its "%v" field, and the result from this command is substituted
-into this field in the target command.
-.TP
-\fB%W\fR
-Replaced with the window path name for the target window.
-.RE
-.TP
-\fBdrag&drop target \fIwindow \fRhandle \fIdataType\fR ?\fIvalue\fR?
-Searches for the given \fIdataType\fR name among the handlers registered
-for the target \fIwindow\fR, and invokes the appropriate \fIcommand\fR.
-If a \fIvalue\fR is specified, it is substituted into any "%v" fields
-in the handler command associated with the \fIdataType\fR. If the
-\fIdataType\fR name is not recognized, this command returns an error.
-This command is invoked automatically by the drag&drop facility when
-data is being transferred from a source to a target.
-.TP
-\fBdrag&drop token \fIwindow\fR
-Returns the token window associated with a drag&drop source \fIwindow\fR.
-The token window is used to represent data as it is being dragged from
-the source to a target. When a source is first established, its token
-window must be filled with widgets to display the source data. For
-example,
-.sp
-.nf
-.RS
-\f(CWdrag&drop source .foo
-
-set win [drag&drop token .foo]
-label $win.label -text "Data"
-pack $win.label\fR
-.RE
-.fi
-.sp
-.TP
-\fBdrag&drop drag \fIwindow x y\fR
-Marks the start of (or movement during) a drag&drop operation. If
-the token window is unmapped when this command is invoked, then the
-\fB\-packagecmd\fR for the source \fIwindow\fR is executed. If this
-command is successful and returns a non-null string, the token window
-is mapped. On subsequent calls, the token window is moved to the new
-\fIx y\fR location. Unless the "\fB\-button 0\fR" option is specified for
-the source, this command is automatically bound to <ButtonPress-\fIn\fR>
-and <B\fIn\fR-Motion> events for "\fB\-button \fIn\fR" of the source widget.
-.TP
-\fBdrag&drop drop \fIwindow x y\fR
-Marks the end of a drag&drop operation. If the mouse pointer is
-over a compatible target window, then the appropriate send handler for
-the first compatible \fIdataType\fR is invoked to handle the data transfer.
-If the data transfer is successful, then the token window is unmapped;
-otherwise, a rejection symbol is drawn on the token window, and the window
-is unmapped after a small delay. Unless the "\fB\-button 0\fR" option is
-specified for the source, this command is automatically bound to the
-<ButtonRelease-\fIn\fR> event for "\fB\-button \fIn\fR" of the source widget.
-.TP
-\fBdrag&drop active\fR
-Returns "1" if a drag&drop operation is in progress, and "0" otherwise.
-A drag&drop operation officially starts after the package command has
-been executed successfully, and ends after the send handler has been
-executed (successfully or otherwise).
-.TP
-\fBdrag&drop errors \fR?\fIproc\fR?
-Specifies a Tcl \fIproc\fR used to handle errors encountered during
-drag&drop operations. If a \fIproc\fR is not specified, this command
-returns the current error handler. By default, all errors are sent
-to the usual \fBtkerror\fR command, and therefore appear in a dialog
-box to the user. This behavior is quite useful when debugging
-communication protocols, but may not be desirable in a finished
-application. Errors can be suppressed entirely (leaving the rejection
-symbol as the only error indicator) by specifying a null string in
-place of the \fIproc\fR name.
-.TP
-\fBdrag&drop location \fR?\fIx y\fR?
-Used to set or query the pointer location during a drag&drop operation.
-The \fIx y\fR arguments specify the current location; if these arguments
-are missing, then the last reported (x,y) location is returned as a list
-with two elements. This command is issued automatically within the
-\fBdrag&drop drag\fR and \fBdrag&drop drop\fR commands, to
-keep track of pointer movement.
-
-.SH KEYWORDS
-drag&drop, send, bind, widget
diff --git a/blt3.0.1/man/eps.mann b/blt3.0.1/man/eps.mann
deleted file mode 100644
index 3f31d80..0000000
--- a/blt3.0.1/man/eps.mann
+++ /dev/null
@@ -1,163 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Graph widget created by Sani Nassif and George Howlett.
-'\"
-.so man.macros
-.TH eps n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-eps \- Encapsulated PostScript canvas item.
-.SH SYNOPSIS
-\fIcanvas\fB create eps \fIx y \fR?\fIoption value\fR?...
-.BE
-.SH DESCRIPTION
-The \fBeps\fR canvas item lets you place encapulated PostScript (EPS)
-on a canvas, controlling its size and placement. The EPS item is
-displayed either as a solid rectangle or a preview image. The preview
-image is designated in one of two ways: 1) the EPS file
-contains an ASCII hexidecimal preview, or 2) a Tk photo image. When
-the canvas generates PostScript output, the EPS will be inserted with
-the proper translation and scaling to match that of the EPS item. So
-can use the canvas widget as a page layout tool.
-.SH EXAMPLE
-Let's say you have for PostScript files of four graphs which you
-want to tile two-by-two on a single page. Maybe you'd like
-to annotate the graphs by putting a caption at the bottom of
-each graph.
-.PP
-Normally, you would have to resort to an external tool or write your
-own PostScript program. The \fBeps\fR canvas item lets you do this
-through Tk's canvas widget. An \fBeps\fR item displays an
-image (or rectangle) representing the encapsulated PostScript file.
-It also scales and translates the EPS file when the canvas is printed.
-
-.SH SYNTAX
-.DS
-\fIcanvas \fBcreate eps \fIx y \fR?\fIoption value\fR?...
-.DE
-The \fBeps\fR item creates a new canvas item. \fICanvas\fR is the name
-of a \fBcanvas\fR widget. You must supply the X-Y coordinate of
-the new eps item. How the coordinate is exactly interpretered is
-controlled by the \fB\-anchor\fR option (see below).
-.PP
-Additional options may be specified on the command line to configure
-aspects of the eps item such as its color, stipple, and font. The
-following \fIoption\fR and \fIvalue\fR pairs are valid.
-.TP
-\fB\-anchor \fIanchor\fR
-Tells how to position the EPS item relative to its X-Y coordinate.
-The default is \f(CWcenter\fR.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the EPS rectangle.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the outside edge of the item. The
-\fB\-relief\fR option determines if the border is to be drawn. The
-default is \f(CW0\fR.
-.TP
-\fB\-file \fIfileName\fR
-Specifies the name of the EPS file. The first line of an
-EPS file must start with "%!PS" and contain a "EPS" version
-specification. The other requirement is that there be a "%%BoundingBox:"
-entry which contains four integers representing the lower-left and
-upper-right coordinates of the area bounding the EPS.
-The default is \f(CW""\fR.
-.TP
-\fB\-font \fIfontName\fR
-Specifies the font of the title. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-18-180-*\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Specifies the foreground color of the EPS rectangle. The option
-matters only when the \fB\-stipple\fR option is set.
-The default is \f(CWwhite\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the height EPS item. If \fIpixels\fR is \f(CW0\fR, then
-the height is determined from the PostScript "BoundingBox:" entry
-in the EPS file.
-The default is \f(CW0\fR.
-.TP
-\fB\-image \fIphoto\fR
-Specifies the name of a Tk photo image to be displayed as in
-the item as a preview image. This option overrides any preview
-specification found in the EPS file.
-The default is \f(CW""\fR.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the title should be justified. This matters only when
-the title contains more than one line of text. \fIJustify\fR must be
-\f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR. The default is
-\f(CWcenter\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for the EPS item. \fIRelief\fR
-specifies how the item should appear relative to canvas;
-for example, \f(CWraised\fR means the item should appear to
-protrude. The default is \f(CWflat\fR.
-.TP
-\fB\-shadowcolor \fIcolor\fR
-Specifies the color of the drop shadow used for the title. The
-option with the \fB\-shadowoffset\fR option control how the
-title's drop shadow appears.
-The default is \f(CWgrey\fR.
-.TP
-\fB\-shadowoffset \fIpixels\fR
-Specifies the offset of the drop shadow from the title's text.
-If \fIpixels\fR is \f(CW0\fR, no shadow will be seen.
-The default is \f(CW0\fR.
-.TP
-\fB\-showimage \fIboolean\fR
-Indicates whether to display the image preview (if one exists),
-or a simple rectangle.
-The default is \f(CWyes\fR.
-.TP
-\fB\-stipple \fIbitmap\fR
-Specifies a bitmap to used to stipple the rectangle representing
-the EPS item. The default is \f(CW""\fR.
-.TP
-\fB\-title \fIstring\fR
-Sets the title of the EPS item. If \fIstring\fR is \f(CW""\fR,
-then the title specified by the PostScript "Title:" entry
-is used. You can set the string a single space to display
-no title. The default is \f(CW""\fR.
-.TP
-\fB\-titleanchor \fIanchor\fR
-Tells how to position the title within EPS item.
-The default is \f(CWn\fR.
-.TP
-\fB\-titlecolor \fIcolor\fR
-Specifies the color of the title.
-The default is \f(CWwhite\fR.
-.TP
-\fB\-titlerotate \fIdegrees\fR
-Sets the rotation of the title. \fIDegrees\fR is a real number
-representing the angle of rotation.
-The title is first rotated in space and then placed according to
-the \fB\-titleanchor\fR position. The default rotation is \f(CW0.0\fR.
-.TP
-\fB\-width \fIpixels\fR
-Specifies the width EPS item. If \fIpixels\fR is \f(CW0\fR, then
-the width is determined from the PostScript "BoundingBox:" entry
-in the EPS file.
-The default is \f(CW0\fR.
-\f(CW5i\fR.
diff --git a/blt3.0.1/man/graph.mann b/blt3.0.1/man/graph.mann
deleted file mode 100644
index c631975..0000000
--- a/blt3.0.1/man/graph.mann
+++ /dev/null
@@ -1,2397 +0,0 @@
-'\"
-'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Graph widget created by Sani Nassif and George Howlett.
-'\"
-.so man.macros
-.TH graph n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-graph \- 2D graph for plotting X\-Y coordinate data.
-.SH SYNOPSIS
-\fBgraph\fI \fIpathName \fR?\fIoption value\fR?...
-.BE
-.SH DESCRIPTION
-The \fBgraph\fR command creates a graph for plotting
-two-dimensional data (X\-Y coordinates). It has many configurable
-components: coordinate axes, elements, legend, grid lines, cross
-hairs, etc. They allow you to customize the look and feel of the
-graph.
-.SH INTRODUCTION
-The \fBgraph\fR command creates a new window for plotting
-two-dimensional data (X\-Y coordinates). Data points are plotted in a
-rectangular area displayed in the center of the new window. This is the
-\fIplotting area\fR. The coordinate axes are drawn in the
-margins around the plotting area. By default, the legend is displayed
-in the right margin. The title is displayed in top margin.
-.PP
-The \fBgraph\fR widget is composed of several components: coordinate
-axes, data elements, legend, grid, cross hairs, pens, postscript, and
-annotation markers.
-.TP 1i
-\f(CWaxis\fR
-The graph has four standard axes (\f(CWx\fR, \f(CWx2\fR,
-\f(CWy\fR, and \f(CWy2\fR), but you can create and display any number
-of axes. Axes control what region of data is
-displayed and how the data is scaled. Each axis consists of the axis
-line, title, major and minor ticks, and tick labels. Tick labels
-display the value at each major tick.
-.TP 1i
-\f(CWcrosshairs\fR
-Cross hairs are used to position the mouse pointer relative to the X
-and Y coordinate axes. Two perpendicular lines, intersecting at the
-current location of the mouse, extend across the plotting area to the
-coordinate axes.
-.TP 1i
-\f(CWelement\fR
-An element represents a set of data points. Elements can be plotted
-with a symbol at each data point and lines connecting the points.
-The appearance of the element, such as its symbol, line width, and
-color is configurable.
-.TP 1i
-\f(CWgrid\fR
-Extends the major and minor ticks of the X\-axis and/or Y\-axis across the
-plotting area.
-.TP 1i
-\f(CWlegend\fR
-The legend displays the name and symbol of each data element.
-The legend can be drawn in any margin or in the plotting area.
-.TP 1i
-\f(CWmarker\fR
-Markers are used annotate or highlight areas of the graph. For
-example, you could use a polygon marker to fill an area under a
-curve, or a text marker to label a particular data point. Markers
-come in various forms: text strings, bitmaps, connected line
-segments, images, polygons, or embedded widgets.
-.TP 1i
-\f(CWpen\fR
-Pens define attributes (both symbol and line style) for elements.
-Data elements use pens to specify how they should be drawn. A data
-element may use many pens at once. Here, the particular pen
-used for a data point is determined from each element's weight
-vector (see the element's \fB\-weight\fR and \fB\-style\fR options).
-.TP 1i
-\f(CWpostscript\fR
-The widget can generate encapsulated PostScript output. This component
-has several options to configure how the PostScript is generated.
-.SH SYNTAX
-.DS
-\fBgraph \fIpathName \fR?\fIoption value\fR?...
-.DE
-The \fBgraph\fR command creates a new window \fIpathName\fR and makes
-it into a \fBgraph\fR widget. At the time this command is invoked, there
-must not exist a window named \fIpathName\fR, but \fIpathName\fR's
-parent must exist. Additional options may be specified on the
-command line or in the option database to configure aspects of the
-graph such as its colors and font. See the \fBconfigure\fR operation
-below for the exact details about what \fIoption\fR and \fIvalue\fR
-pairs are valid.
-.PP
-If successful, \fBgraph\fR returns the path name of the widget. It
-also creates a new Tcl command by the same name. You can use this
-command to invoke various operations that query or modify the graph.
-The general form is:
-.DS
-\fIpathName \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for the graph are described in
-the
-.SB "GRAPH OPERATIONS"
-section.
-.PP
-The command can also be used to access components of the graph.
-.DS
-\fIpathName component operation\fR ?\fIarg\fR?...
-.DE
-The operation, now located after the name of the component, is the
-function to be performed on that component. Each component has its own
-set of operations that manipulate that component. They will be
-described below in their own sections.
-.SH EXAMPLE
-The \fBgraph\fR command creates a new graph.
-.CS
-# Create a new graph. Plotting area is black.
-graph .g \-plotbackground black
-.CE
-A new Tcl command \f(CW.g\fR is also created. This command can be used
-to query and modify the graph. For example, to change the title of
-the graph to "My Plot", you use the new command and the graph's
-\fBconfigure\fR operation.
-.CS
-# Change the title.
-\&.g configure \-title "My Plot"
-.CE
-A graph has several components. To access a particular component you
-use the component's name. For example, to add data elements, you use
-the new command and the \fBelement\fR component.
-.CS
-# Create a new element named "line1"
-\&.g element create line1 \\
- \-xdata { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 } \\
- \-ydata { 26.18 50.46 72.85 93.31 111.86 128.47 143.14
- 155.85 166.60 175.38 }
-.CE
-The element's X-Y coordinates are specified using lists of
-numbers. Alternately, BLT vectors could be used to hold the X\-Y
-coordinates.
-.CS
-# Create two vectors and add them to the graph.
-vector xVec yVec
-xVec set { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 }
-yVec set { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 155.85
- 166.60 175.38 }
-\&.g element create line1 \-xdata xVec \-ydata yVec
-.CE
-The advantage of using vectors is that when you modify one, the graph
-is automatically redrawn to reflect the new values.
-.CS
-# Change the y coordinate of the first point.
-set yVector(0) 25.18
-.CE
-An element named \f(CWe1\fR is now created in \f(CW.b\fR. It
-is automatically added to the display list of elements. You can
-use this list to control in what order elements are displayed.
-To query or reset the element display list, you use the element's
-\fBshow\fR operation.
-.CS
-# Get the current display list
-set elemList [.b element show]
-# Remove the first element so it won't be displayed.
-\&.b element show [lrange $elemList 0 end]
-.CE
-The element will be displayed by as many bars as there are data points
-(in this case there are ten). The bars will be drawn centered at the
-x-coordinate of the data point. All the bars will have the same
-attributes (colors, stipple, etc). The width of each bar is by
-default one unit. You can change this with using the \fB\-barwidth\fR
-option.
-.CS
-# Change the X\-Y coordinates of the first point.
-set xVec(0) 0.18
-set yVec(0) 25.18
-.CE
-An element named \f(CWline1\fR is now created in \f(CW.g\fR. By
-default, the element's label in the legend will be also \f(CWline1\fR.
-You can change the label, or specify no legend entry, again using the
-element's \fBconfigure\fR operation.
-.CS
-# Don't display "line1" in the legend.
-\&.g element configure line1 \-label ""
-.CE
-You can configure more than just the element's label. An element has
-many attributes such as symbol type and size, dashed or solid lines,
-colors, line width, etc.
-.CS
-\&.g element configure line1 \-symbol square \-color red \\
- \-dashes { 2 4 2 } \-linewidth 2 \-pixels 2c
-.CE
-Four coordinate axes are automatically created: \f(CWx\fR, \f(CWx2\fR,
-\f(CWy\fR, and \f(CWy2\fR. And by default, elements are mapped onto the
-axes \f(CWx\fR and \f(CWy\fR. This can be changed with the \fB\-mapx\fR
-and \fB\-mapy\fR options.
-.CS
-# Map "line1" on the alternate Y\-axis "y2".
-\&.g element configure line1 \-mapy y2
-.CE
-Axes can be configured in many ways too. For example, you change the
-scale of the Y\-axis from linear to log using the \fBaxis\fR component.
-.CS
-# Y\-axis is log scale.
-\&.g axis configure y \-logscale yes
-.CE
-One important way axes are used is to zoom in on a particular data
-region. Zooming is done by simply specifying new axis limits using
-the \fB\-min\fR and \fB\-max\fR configuration options.
-.CS
-\&.g axis configure x \-min 1.0 \-max 1.5
-\&.g axis configure y \-min 12.0 \-max 55.15
-.CE
-To zoom interactively, you link the \fBaxis configure\fR operations with
-some user interaction (such as pressing the mouse button), using the
-\fBbind\fR command. To convert between screen and graph coordinates,
-use the \fBinvtransform\fR operation.
-.CS
-# Click the button to set a new minimum
-bind .g <ButtonPress-1> {
- %W axis configure x \-min [%W axis invtransform x %x]
- %W axis configure x \-min [%W axis invtransform x %y]
-}
-.CE
-By default, the limits of the axis are determined from data values.
-To reset back to the default limits, set the \fB\-min\fR and
-\fB\-max\fR options to the empty value.
-.CS
-# Reset the axes to autoscale again.
-\&.g axis configure x \-min {} \-max {}
-\&.g axis configure y \-min {} \-max {}
-.CE
-By default, the legend is drawn in the right margin. You can
-change this or any legend configuration options using the
-\fBlegend\fR component.
-.CS
-# Configure the legend font, color, and relief
-\&.g legend configure \-position left \-relief raised \\
- \-font fixed \-fg blue
-.CE
-To prevent the legend from being displayed, turn on the \fB\-hide\fR
-option.
-.CS
-# Don't display the legend.
-\&.g legend configure \-hide yes\fR
-.CE
-The \fBgraph\fR widget has simple drawing procedures called markers.
-They can be used to highlight or annotate data in the graph. The types
-of markers available are bitmaps, images, polygons, lines, or windows.
-Markers can be used, for example, to mark or brush points. In this
-example, is a text marker that labels the data first point. Markers
-are created using the \fBmarker\fR component.
-.CS
-# Create a label for the first data point of "line1".
-\&.g marker create text \-name first_marker \-coords { 0.2 26.18 } \\
- \-text "start" \-anchor se \-xoffset -10 \-yoffset -10
-.CE
-This creates a text marker named \f(CWfirst_marker\fR. It will display
-the text "start" near the coordinates of the first data point. The
-\fB\-anchor\fR, \fB\-xoffset\fR, and \fB\-yoffset\fR options are used
-to display the marker above and to the left of the data point, so that
-the data point isn't covered by the marker. By default,
-markers are drawn last, on top of data. You can change this with the
-\fB\-under\fR option.
-.CS
-# Draw the label before elements are drawn.
-\&.g marker configure first_marker \-under yes
-.CE
-You can add cross hairs or grid lines using the \fBcrosshairs\fR and
-\fBgrid\fR components.
-.CS
-# Display both cross hairs and grid lines.
-\&.g crosshairs configure \-hide no \-color red
-\&.g grid configure \-hide no \-dashes { 2 2 }
-# Set up a binding to reposition the crosshairs.
-bind .g <Motion> {
- .g crosshairs configure -position @%x,%y
-}
-.CE
-The crosshairs are repositioned as the mouse pointer is moved
-in the graph. The pointer X-Y coordinates define the center
-of the crosshairs.
-.PP
-Finally, to get hardcopy of the graph, use the \fBpostscript\fR
-component.
-.CS
-# Print the graph into file "file.ps"
-\&.g postscript output file.ps \-maxpect yes \-decorations no
-.CE
-This generates a file \f(CWfile.ps\fR containing the encapsulated
-PostScript of the graph. The option \fB\-maxpect\fR says to scale the
-plot to the size of the page. Turning off the \fB\-decorations\fR
-option denotes that no borders or color backgrounds should be
-drawn (i.e. the background of the margins, legend, and plotting
-area will be white).
-.SH "GRAPH OPERATIONS"
-.TP
-\fIpathName \fBaxis \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "AXIS COMPONENTS"
-section.
-.TP
-\fIpathName \fBbar \fIelemName \fR?\fIoption value\fR?...
-Creates a new barchart element \fIelemName\fR. It's an
-error if an element \fIelemName\fR already exists.
-See the manual for \fBbarchart\fR for details about
-what \fIoption\fR and \fIvalue\fR pairs are valid.
-.TP
-\fIpathName \fBcget\fR \fIoption\fR
-Returns the current value of the configuration option given by
-\fIoption\fR. \fIOption\fR may be any option described
-below for the \fBconfigure\fR operation.
-.TP
-\fIpathName \fBconfigure \fR?\fIoption value\fR?...
-Queries or modifies the configuration options of the graph. If
-\fIoption\fR isn't specified, a list describing the current
-options for \fIpathName\fR is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
-If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
-for each pair, the option \fIoption\fR is set to \fIvalue\fR.
-The following options are valid.
-.RS
-.TP
-\fB\-aspect \fIwidth/height\fR
-Force a fixed aspect ratio of \fIwidth/height\fR, a floating point number.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color. This includes the margins and
-legend, but not the plotting area.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the outside edge of the widget. The
-\fB\-relief\fR option determines if the border is to be drawn. The
-default is \f(CW2\fR.
-.TP
-\fB\-bottommargin \fIpixels\fR
-If non-zero, overrides the computed size of the margin extending
-below the X\-coordinate axis.
-If \fIpixels\fR is \f(CW0\fR, the automatically computed size is used.
-The default is \f(CW0\fR.
-.TP
-\fB\-bufferelements \fIboolean\fR
-Indicates whether an internal pixmap to buffer the display of data
-elements should be used. If \fIboolean\fR is true, data elements are
-drawn to an internal pixmap. This option is especially useful when
-the graph is redrawn frequently while the remains data unchanged (for
-example, moving a marker across the plot). See the
-.SB "SPEED TIPS"
-section.
-The default is \f(CW1\fR.
-.TP
-\fB\-cursor \fIcursor\fR
-Specifies the widget's cursor. The default cursor is \f(CWcrosshair\fR.
-.TP
-\fB\-font \fIfontName\fR
-Specifies the font of the graph title. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-18-180-*\fR.
-.TP
-\fB\-halo \fIpixels\fR
-Specifies a maximum distance to consider when searching for the
-closest data point (see the element's \fBclosest\fR operation below).
-Data points further than \fIpixels\fR away are ignored. The default is
-\f(CW0.5i\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the requested height of widget. The default is
-\f(CW4i\fR.
-.TP
-\fB\-invertxy \fIboolean\fR
-Indicates whether the placement X\-axis and Y\-axis should be inverted. If
-\fIboolean\fR is true, the X and Y axes are swapped. The default is
-\f(CW0\fR.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the title should be justified. This matters only when
-the title contains more than one line of text. \fIJustify\fR must be
-\f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR. The default is
-\f(CWcenter\fR.
-.TP
-\fB\-leftmargin \fIpixels\fR
-If non-zero, overrides the computed size of the margin extending
-from the left edge of the window to the Y\-coordinate axis.
-If \fIpixels\fR is \f(CW0\fR, the automatically computed size is used.
-The default is \f(CW0\fR.
-.TP
-\fB\-plotbackground \fIcolor\fR
-Specifies the background color of the plotting area. The default is
-\f(CWwhite\fR.
-.TP
-\fB\-plotborderwidth \fIpixels\fR
-Sets the width of the 3-D border around the plotting area. The
-\fB\-plotrelief\fR option determines if a border is drawn. The
-default is \f(CW2\fR.
-.TP
-\fB\-plotpadx \fIpad\fR
-Sets the amount of padding to be added to the left and right sides of
-the plotting area. \fIPad\fR can be a list of one or two screen
-distances. If \fIpad\fR has two elements, the left side of the
-plotting area entry is padded by the first distance and the right side
-by the second. If \fIpad\fR is just one distance, both the left and
-right sides are padded evenly. The default is \f(CW8\fR.
-.TP
-\fB\-plotpady \fIpad\fR
-Sets the amount of padding to be added to the top and bottom of the
-plotting area. \fIPad\fR can be a list of one or two screen
-distances. If \fIpad\fR has two elements, the top of the plotting
-area is padded by the first distance and the bottom by the second. If
-\fIpad\fR is just one distance, both the top and bottom are padded
-evenly. The default is \f(CW8\fR.
-.TP
-\fB\-plotrelief \fIrelief\fR
-Specifies the 3-D effect for the plotting area. \fIRelief\fR
-specifies how the interior of the plotting area should appear relative
-to rest of the graph; for example, \f(CWraised\fR means the plot should
-appear to protrude from the graph, relative to the surface of the
-graph. The default is \f(CWsunken\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for the graph widget. \fIRelief\fR
-specifies how the graph should appear relative to widget it is packed
-into; for example, \f(CWraised\fR means the graph should
-appear to protrude. The default is \f(CWflat\fR.
-.TP
-\fB\-rightmargin \fIpixels\fR
-If non-zero, overrides the computed size of the margin extending
-from the plotting area to the right edge of
-the window. By default, the legend is drawn in this margin.
-If \fIpixels\fR is \f(CW0\fR, the automatically computed size is used.
-The default is \f(CW0\fR.
-.TP
-\fB\-takefocus\fR \fIfocus\fR
-Provides information used when moving the focus from window to window
-via keyboard traversal (e.g., Tab and Shift-Tab). If \fIfocus\fR is
-\f(CW0\fR, this means that this window should be skipped entirely during
-keyboard traversal. \f(CW1\fR means that the this window should always
-receive the input focus. An empty value means that the traversal
-scripts make the decision whether to focus on the window.
-The default is \f(CW""\fR.
-.TP
-\fB\-tile \fIimage\fR
-Specifies a tiled background for the widget. If \fIimage\fR isn't
-\f(CW""\fR, the background is tiled using \fIimage\fR.
-Otherwise, the normal background color is drawn (see the
-\fB\-background\fR option). \fIImage\fR must be an image created
-using the Tk \fBimage\fR command. The default is \f(CW""\fR.
-.TP
-\fB\-title \fItext\fR
-Sets the title to \fItext\fR. If \fItext\fR is \f(CW""\fR,
-no title will be displayed.
-.TP
-\fB\-topmargin \fIpixels\fR
-If non-zero, overrides the computed size of the margin above the x2
-axis. If \fIpixels\fR is \f(CW0\fR, the automatically computed size
-is used. The default is \f(CW0\fR.
-.TP
-\fB\-width \fIpixels\fR
-Specifies the requested width of the widget. The default is
-\f(CW5i\fR.
-.RE
-.TP
-\fIpathName \fBcrosshairs \fIoperation \fR?\fIarg\fR?
-See the
-.SB "CROSSHAIRS COMPONENT"
-section.
-.TP
-\fIpathName \fBelement \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "ELEMENT COMPONENTS"
-section.
-.TP
-\fIpathName \fBextents \fIitem\fR
-Returns the size of a particular item in the graph. \fIItem\fR must
-be either \f(CWleftmargin\fR, \f(CWrightmargin\fR, \f(CWtopmargin\fR,
-\f(CWbottommargin\fR, \f(CWplotwidth\fR, or \f(CWplotheight\fR.
-.TP
-\fIpathName \fBgrid \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "GRID COMPONENT"
-section.
-.TP
-\fIpathName \fBinvtransform \fIwinX winY\fR
-Performs an inverse coordinate transformation, mapping window
-coordinates back to graph coordinates, using the standard X\-axis and Y\-axis.
-Returns a list of containing the X-Y graph coordinates.
-.TP
-\fIpathName \fBinside \fIx y\fR
-Returns \f(CW1\fR is the designated screen coordinate (\fIx\fR and \fIy\fR)
-is inside the plotting area and \f(CW0\fR otherwise.
-.TP
-\fIpathName \fBlegend \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "LEGEND COMPONENT"
-section.
-.TP
-\fIpathName \fBline\fB operation arg\fR...
-The operation is the same as \fBelement\fR.
-.TP
-\fIpathName \fBmarker \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "MARKER COMPONENTS"
-section.
-.TP
-\fIpathName \fBpostscript \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "POSTSCRIPT COMPONENT"
-section.
-.TP
-\fIpathName \fBsnap \fR?\fIswitches\fR? \fIoutputName\fR
-Takes a snapshot of the graph, saving the output in \fIoutputName\fR.
-The following switches are available.
-.RS
-.TP 1i
-\fB\-format\fR \fIformat\fR
-Specifies how the snapshot is output. \fIFormat\fR may be one of
-the following listed below. The default is \f(CWphoto\fR.
-.RS
-.TP
-\f(CWphoto\fR
-Saves a Tk photo image. \fIOutputName\fR represents the name of a
-Tk photo image that must already have been created.
-.TP
-\f(CWwmf\fR
-Saves an Aldus Placeable Metafile. \fIOutputName\fR represents the
-filename where the metafile is written. If \fIoutputName\fR is
-\f(CWCLIPBOARD\fR, then output is written directly to the Windows
-clipboard. This format is available only under Microsoft Windows.
-.TP
-\f(CWemf\fR
-Saves an Enhanced Metafile. \fIOutputName\fR represents the filename
-where the metafile is written. If \fIoutputName\fR is
-\f(CWCLIPBOARD\fR, then output is written directly to the Windows
-clipboard. This format is available only under Microsoft Windows.
-.RE
-.TP 1i
-\fB\-height\fR \fIsize\fR
-Specifies the height of the graph. \fISize\fR is a screen distance.
-The graph will be redrawn using this dimension, rather than its
-current window height.
-.TP 1i
-\fB\-width\fR \fIsize\fR
-Specifies the width of the graph. \fISize\fR is a screen distance.
-The graph will be redrawn using this dimension, rather than its
-current window width.
-.RE
-.TP
-\fIpathName \fBtransform \fIx y\fR
-Performs a coordinate transformation, mapping graph coordinates to
-window coordinates, using the standard X\-axis and Y\-axis.
-Returns a list containing the X\-Y screen coordinates.
-.TP
-\fIpathName \fBxaxis \fIoperation\fR ?\fIarg\fR?...
-.TP
-\fIpathName \fBx2axis \fIoperation\fR ?\fIarg\fR?...
-.TP
-\fIpathName \fByaxis \fIoperation\fR ?\fIarg\fR?...
-.TP
-\fIpathName \fBy2axis \fIoperation\fR ?\fIarg\fR?...
-See the
-.SB "AXIS COMPONENTS"
-section.
-.SH "GRAPH COMPONENTS"
-A graph is composed of several components: coordinate axes, data
-elements, legend, grid, cross hairs, postscript, and annotation
-markers. Instead of one big set of configuration options and
-operations, the graph is partitioned, where each component has its own
-configuration options and operations that specifically control that
-aspect or part of the graph.
-.SS "AXIS COMPONENTS"
-Four coordinate axes are automatically created: two X\-coordinate axes
-(\f(CWx\fR and \f(CWx2\fR) and two Y\-coordinate axes (\f(CWy\fR, and
-\f(CWy2\fR). By default, the axis \f(CWx\fR is located in the bottom
-margin, \f(CWy\fR in the left margin, \f(CWx2\fR in the top margin, and
-\f(CWy2\fR in the right margin.
-.PP
-An axis consists of the axis line, title, major and minor ticks, and
-tick labels. Major ticks are drawn at uniform intervals along the
-axis. Each tick is labeled with its coordinate value. Minor ticks
-are drawn at uniform intervals within major ticks.
-.PP
-The range of the axis controls what region of data is plotted.
-Data points outside the minimum and maximum limits of the axis are
-not plotted. By default, the minimum and maximum limits are
-determined from the data, but you can reset either limit.
-.PP
-You can have several axes. To create an axis, invoke
-the axis component and its create operation.
-.CS
-# Create a new axis called "tempAxis"
-\&.g axis create tempAxis
-.CE
-You map data elements to an axis using the element's \-mapy and \-mapx
-configuration options. They specify the coordinate axes an element
-is mapped onto.
-.CS
-# Now map the tempAxis data to this axis.
-\&.g element create "e1" \-xdata $x \-ydata $y \-mapy tempAxis
-.CE
-Any number of axes can be displayed simultaneously. They are drawn in
-the margins surrounding the plotting area. The default axes \f(CWx\fR
-and \f(CWy\fR are drawn in the bottom and left margins. The axes
-\f(CWx2\fR and \f(CWy2\fR are drawn in top and right margins. By
-default, only \f(CWx\fR and \f(CWy\fR are shown. Note that the axes
-can have different scales.
-.PP
-To display a different axis or more than one axis, you invoke one of
-the following components: \fBxaxis\fR, \fByaxis\fR, \fBx2axis\fR, and
-\fBy2axis\fR. Each component has a \fBuse\fR operation that
-designates the axis (or axes) to be drawn in that corresponding
-margin: \fBxaxis\fR in the bottom, \fByaxis\fR in the left,
-\fBx2axis\fR in the top, and \fBy2axis\fR in the right.
-.CS
-# Display the axis tempAxis in the left margin.
-\&.g yaxis use tempAxis
-.CE
-The \fBuse\fR operation takes a list of axis names as its last
-argument. This is the list of axes to be drawn in this margin.
-.PP
-You can configure axes in many ways. The axis scale can be linear or
-logarithmic. The values along the axis can either monotonically
-increase or decrease. If you need custom tick labels, you can specify
-a Tcl procedure to format the label any way you wish. You can control
-how ticks are drawn, by changing the major tick interval or the number
-of minor ticks. You can define non-uniform tick intervals, such as
-for time-series plots.
-.PP
-.TP
-\fIpathName \fBaxis bind \fItagName\fR ?\fIsequence\fR? ?\fIcommand\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for an axis with this
-tag, \fIcommand\fR will be invoked. The syntax is similar to the
-\fBbind\fR command except that it operates on graph axes, rather
-than widgets. See the \fBbind\fR manual entry for
-complete details on \fIsequence\fR and the substitutions performed on
-\fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBaxis \fBcget \fIaxisName \fIoption\fR
-Returns the current value of the option given by \fIoption\fR for
-\fIaxisName\fR. \fIOption\fR may be any option described below
-for the axis \fBconfigure\fR operation.
-.TP
-\fIpathName \fBaxis \fBconfigure \fIaxisName \fR?\fIaxisName\fR?... ?\fIoption value\fR?...
-Queries or modifies the configuration options of \fIaxisName\fR.
-Several axes can be changed. If \fIoption\fR isn't specified, a list
-describing all the current options for \fIaxisName\fR is returned. If
-\fIoption\fR is specified, but not \fIvalue\fR, then a list describing
-\fIoption\fR is returned. If one or more \fIoption\fR and \fIvalue\fR
-pairs are specified, then for each pair, the axis option \fIoption\fR
-is set to \fIvalue\fR. The following options are valid for axes.
-.RS
-.TP
-\fB\-bindtags \fItagList\fR
-Specifies the binding tags for the axis. \fITagList\fR is a list
-of binding tag names. The tags and their order will determine how
-events for axes are handled. Each tag in the list matching the current event
-sequence will have its Tcl command executed. Implicitly the name of
-the element is always the first tag in the list. The default value is
-\f(CWall\fR.
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the axis and tick labels.
-The default is \f(CWblack\fR.
-.TP
-\fB\-command \fIprefix\fR
-Specifies a Tcl command to be invoked when formatting the axis tick
-labels. \fIPrefix\fR is a string containing the name of a Tcl proc and
-any extra arguments for the procedure. This command is invoked for each
-major tick on the axis. Two additional arguments are passed to the
-procedure: the pathname of the widget and the current the numeric
-value of the tick. The procedure returns the formatted tick label. If
-\f(CW""\fR is returned, no label will appear next to the tick. You can
-get the standard tick labels again by setting \fIprefix\fR to
-\f(CW""\fR. The default is \f(CW""\fR.
-.sp 1
-Please note that this procedure is invoked while the graph is redrawn.
-You may query configuration options. But do not them, because this
-can have unexpected results.
-.TP
-\fB\-descending \fIboolean\fR
-Indicates whether the values along the axis are monotonically increasing or
-decreasing. If \fIboolean\fR is true, the axis values will be
-decreasing. The default is \f(CW0\fR.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates if the axis is displayed. If \fIboolean\fR is false the axis
-will be displayed. Any element mapped to the axis is displayed regardless.
-The default value is \f(CW0\fR.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the axis title should be justified. This matters only
-when the axis title contains more than one line of text. \fIJustify\fR
-must be \f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR. The default is
-\f(CWcenter\fR.
-.TP
-\fB\-limits \fIformatStr\fR
-Specifies a printf-like description to format the minimum and maximum
-limits of the axis. The limits are displayed at the top/bottom or
-left/right sides of the plotting area. \fIFormatStr\fR is a list of
-one or two format descriptions. If one description is supplied, both
-the minimum and maximum limits are formatted in the same way. If two,
-the first designates the format for the minimum limit, the second for
-the maximum. If \f(CW""\fR is given as either description, then
-the that limit will not be displayed. The default is \f(CW""\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the axis and tick lines. The default is \f(CW1\fR
-pixel.
-.TP
-\fB\-logscale \fIboolean\fR
-Indicates whether the scale of the axis is logarithmic or linear. If
-\fIboolean\fR is true, the axis is logarithmic. The default scale is
-linear.
-.TP
-\fB\-loose \fIboolean\fR
-Indicates whether the limits of the axis should fit the data points tightly,
-at the outermost data points, or loosely, at the outer tick intervals.
-If the axis limit is set with the -min or -max option, the axes are
-displayed tightly.
-If \fIboolean\fR is true, the axis range is "loose".
-The default is \f(CW0\fR.
-.TP
-\fB\-majorticks \fImajorList\fR
-Specifies where to display major axis ticks. You can use this option
-to display ticks at non-uniform intervals. \fIMajorList\fR is a list
-of axis coordinates designating the location of major ticks. No
-minor ticks are drawn. If \fImajorList\fR is \f(CW""\fR,
-major ticks will be automatically computed. The default is \f(CW""\fR.
-.TP
-\fB\-max \fIvalue\fR
-Sets the maximum limit of \fIaxisName\fR. Any data point greater
-than \fIvalue\fR is not displayed. If \fIvalue\fR is \f(CW""\fR,
-the maximum limit is calculated using the largest data value.
-The default is \f(CW""\fR.
-.TP
-\fB\-min \fIvalue\fR
-Sets the minimum limit of \fIaxisName\fR. Any data point less than
-\fIvalue\fR is not displayed. If \fIvalue\fR is \f(CW""\fR,
-the minimum limit is calculated using the smallest data value.
-The default is \f(CW""\fR.
-.TP
-\fB\-minorticks \fIminorList\fR
-Specifies where to display minor axis ticks. You can use this option
-to display minor ticks at non-uniform intervals. \fIMinorList\fR is a
-list of real values, ranging from 0.0 to 1.0, designating the placement of
-a minor tick. No minor ticks are drawn if the \fB\-majortick\fR
-option is also set. If \fIminorList\fR is \f(CW""\fR, minor ticks will
-be automatically computed. The default is \f(CW""\fR.
-.TP
-\fB\-rotate \fItheta\fR
-Specifies the how many degrees to rotate the axis tick labels.
-\fITheta\fR is a real value representing the number of degrees
-to rotate the tick labels. The default is \f(CW0.0\fR degrees.
-.TP
-\fB\-scrollcommand \fIcommand\fR
-Specify the prefix for a command used to communicate with scrollbars
-for this axis, such as \fI.sbar set\fP.
-.TP
-\fB\-scrollmax \fIvalue\fR
-Sets the maximum limit of the axis scroll region. If \fIvalue\fR is
-\f(CW""\fR, the maximum limit is calculated using the largest data
-value. The default is \f(CW""\fR.
-.TP
-\fB\-scrollmin \fIvalue\fR
-Sets the minimum limit of axis scroll region. If \fIvalue\fR is
-\f(CW""\fR, the minimum limit is calculated using the smallest data
-value. The default is \f(CW""\fR.
-.TP
-\fB\-showticks \fIboolean\fR
-Indicates whether axis ticks should be drawn. If \fIboolean\fR is
-true, ticks are drawn. If false, only the
-axis line is drawn. The default is \f(CW1\fR.
-.TP
-\fB\-stepsize \fIvalue\fR
-Specifies the interval between major axis ticks. If \fIvalue\fR isn't
-a valid interval (must be less than the axis range),
-the request is ignored and the step size is automatically calculated.
-.TP
-\fB\-subdivisions \fInumber\fR
-Indicates how many minor axis ticks are
-to be drawn. For example, if \fInumber\fR is two, only one minor
-tick is drawn. If \fInumber\fR is one, no minor ticks are
-displayed. The default is \f(CW2\fR.
-.TP
-\fB\-tickfont \fIfontName\fR
-Specifies the font for axis tick labels. The default is
-\f(CW*-Courier-Bold-R-Normal-*-100-*\fR.
-.TP
-\fB\-ticklength \fIpixels\fR
-Sets the length of major and minor ticks (minor ticks are half the
-length of major ticks). If \fIpixels\fR is less than zero, the axis
-will be inverted with ticks drawn pointing towards the plot. The
-default is \f(CW0.1i\fR.
-.TP
-\fB\-title \fItext\fR
-Sets the title of the axis. If \fItext\fR is
-\f(CW""\fR, no axis title will be displayed.
-.TP
-\fB\-titlealternate \fIboolean\fR
-Indicates to display the axis title in its alternate location.
-Normally the axis title is centered along the axis. This option
-places the axis either to the right (horizontal axes) or above
-(vertical axes) the axis. The default is \f(CW0\fR.
-.TP
-\fB\-titlecolor \fIcolor\fR
-Sets the color of the axis title. The default is \f(CWblack\fR.
-.TP
-\fB\-titlefont \fIfontName\fR
-Specifies the font for axis title. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-14-140-*\fR.
-.PP
-Axis configuration options may be also be set by the \fBoption\fR
-command. The resource class is \f(CWAxis\fR. The resource names
-are the names of the axes (such as \f(CWx\fR or \f(CWx2\fR).
-.CS
-option add *Graph.Axis.Color blue
-option add *Graph.x.LogScale true
-option add *Graph.x2.LogScale false
-.CE
-.RE
-.TP
-\fIpathName \fBaxis \fBcreate \fIaxisName \fR?\fIoption value\fR?...
-Creates a new axis by the name \fIaxisName\fR. No axis by the same
-name can already exist. \fIOption\fR and \fIvalue\fR are described
-in above in the axis \fBconfigure\fR operation.
-.TP
-\fIpathName \fBaxis \fBdelete \fR?\fIaxisName\fR?...
-Deletes the named axes. An axis is not really
-deleted until it is not longer in use, so it's safe to delete
-axes mapped to elements.
-.TP
-\fIpathName \fBaxis invtransform \fIaxisName value\fR
-Performs the inverse transformation, changing the screen coordinate
-\fIvalue\fR to a graph coordinate, mapping the value mapped to
-\fIaxisName\fR. Returns the graph coordinate.
-.TP
-\fIpathName \fBaxis limits \fIaxisName\fR
-Returns a list of the minimum and maximum limits for \fIaxisName\fR. The order
-of the list is \f(CWmin max\fR.
-.TP
-\fIpathName \fBaxis names \fR?\fIpattern\fR?...
-Returns a list of axes matching zero or more patterns. If no
-\fIpattern\fR argument is give, the names of all axes are returned.
-.TP
-\fIpathName \fBaxis transform \fIaxisName value\fR
-Transforms the coordinate \fIvalue\fR to a screen coordinate by mapping
-the it to \fIaxisName\fR. Returns the transformed screen coordinate.
-.TP
-\fIpathName \fBaxis view \fIaxisName\fR
-Change the viewable area of this axis. Use as an argument to a scrollbar's "\fI\-command\fR".
-.PP
-The default axes are \f(CWx\fR, \f(CWy\fR, \f(CWx2\fR, and \f(CWy2\fR.
-But you can display more than four axes simultaneously. You can also
-swap in a different axis with \fBuse\fR operation of the special axis
-components: \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, and \fBy2axis\fR.
-.CS
-\&.g create axis temp
-\&.g create axis time
-\&...
-\&.g xaxis use temp
-\&.g yaxis use time
-.CE
-Only the axes specified for use are displayed on the screen.
-.PP
-The \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, and \fBy2axis\fR
-components operate on an axis location rather than a specific axis
-like the more general \fBaxis\fR component does. They implicitly
-control the axis that is currently using to that location. By
-default, \fBxaxis\fR uses the \f(CWx\fR axis, \fByaxis\fR uses
-\f(CWy\fR, \fBx2axis\fR uses \f(CWx2\fR, and \fBy2axis\fR uses
-\f(CWy2\fR. When more than one axis is displayed in a margin, it
-represents the first axis displayed.
-.PP
-The following operations are available for axes. They mirror exactly
-the operations of the \fBaxis\fR component. The \fIaxis\fR argument
-must be \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, or \fBy2axis\fR. This
-feature is deprecated since more than one axis can now be used a
-margin. You should only use the \fBxaxis\fR, \fBx2axis\fR,
-\fByaxis\fR, and \fBy2axis\fR components with the \fBuse\fR operation.
-For all other operations, use the general \fBaxis\fR component
-instead.
-.TP
-\fIpathName \fIaxis \fBcget \fIoption\fR
-.TP
-\fIpathName \fIaxis \fBconfigure \fR?\fIoption value\fR?...
-.TP
-\fIpathName \fIaxis\fB invtransform \fIvalue\fR
-.TP
-\fIpathName \fIaxis \fBlimits\fR
-.TP
-\fIpathName \fIaxis\fB transform \fIvalue\fR
-.TP
-\fIpathName \fIaxis\fB use \fR?\fIaxisName\fR?
-Designates the axis \fIaxisName\fR is to be displayed at this
-location. \fIAxisName\fR can not be already in use at another location.
-This command returns the name of the axis currently using this location.
-.SS "CROSSHAIRS COMPONENT"
-Cross hairs consist of two intersecting lines (one vertical and one horizontal)
-drawn completely across the plotting area. They are used to position
-the mouse in relation to the coordinate axes. Cross hairs differ from line
-markers in that they are implemented using XOR drawing primitives.
-This means that they can be quickly drawn and erased without redrawing
-the entire graph.
-.PP
-The following operations are available for cross hairs:
-.TP
-\fIpathName \fBcrosshairs cget \fIoption\fR
-Returns the current value of the cross hairs configuration option
-given by \fIoption\fR. \fIOption\fR may be any option
-described below for the cross hairs \fBconfigure\fR operation.
-.TP
-\fIpathName \fBcrosshairs configure \fR?\fIoption value\fR?...
-Queries or modifies the configuration options of the cross hairs. If
-\fIoption\fR isn't specified, a list describing all the current
-options for the cross hairs is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
-If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
-for each pair, the cross hairs option \fIoption\fR is set to
-\fIvalue\fR.
-The following options are available for cross hairs.
-.RS
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the cross hairs. The default is \f(CWblack\fR.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the cross hairs. \fIDashList\fR is a list of up
-to 11 numbers that alternately represent the lengths of the dashes
-and gaps on the cross hair lines. Each number must be between 1 and
-255. If \fIdashList\fR is \f(CW""\fR, the cross hairs will be solid
-lines.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether cross hairs are drawn. If \fIboolean\fR is true,
-cross hairs are not drawn. The default is \f(CWyes\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Set the width of the cross hair lines. The default is \f(CW1\fR.
-.TP
-\fB\-position \fIpos\fR
-Specifies the screen position where the cross hairs intersect.
-\fIPos\fR must be in the form "\fI at x,y\fR", where \fIx\fR and \fIy\fR
-are the window coordinates of the intersection.
-.PP
-Cross hairs configuration options may be also be set by the
-\fBoption\fR command. The resource name and class are
-\f(CWcrosshairs\fR and \f(CWCrosshairs\fR respectively.
-.CS
-option add *Graph.Crosshairs.LineWidth 2
-option add *Graph.Crosshairs.Color red
-.CE
-.RE
-.TP
-\fIpathName \fBcrosshairs off\fR
-Turns off the cross hairs.
-.TP
-\fIpathName \fBcrosshairs on\fR
-Turns on the display of the cross hairs.
-.TP
-\fIpathName \fBcrosshairs toggle\fR
-Toggles the current state of the cross hairs, alternately mapping and
-unmapping the cross hairs.
-.SS "ELEMENT COMPONENTS"
-A data element represents a set of data. It contains x and y vectors
-containing the coordinates of the data points. Elements can be
-displayed with a symbol at each data point and lines connecting the
-points. Elements also control the appearance of the data, such as the
-symbol type, line width, color etc.
-.PP
-When new data elements are created, they are automatically added to a
-list of displayed elements. The display list controls what elements
-are drawn and in what order.
-.PP
-The following operations are available for elements.
-.TP
-\fIpathName \fBelement activate \fIelemName \fR?\fIindex\fR?...
-Specifies the data points of element \fIelemName\fR to be drawn
-using active foreground and background colors. \fIElemName\fR is the
-name of the element and \fIindex\fR is a number representing the index
-of the data point. If no indices are present then all data points
-become active.
-.TP
-\fIpathName \fBelement bind \fItagName\fR ?\fIsequence\fR? ?\fIcommand\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for an element with this
-tag, \fIcommand\fR will be invoked. The syntax is similar to the
-\fBbind\fR command except that it operates on graph elements, rather
-than widgets. See the \fBbind\fR manual entry for
-complete details on \fIsequence\fR and the substitutions performed on
-\fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBelement cget \fIelemName \fIoption\fR
-Returns the current value of the element configuration option given by
-\fIoption\fR. \fIOption\fR may be any of the options described below
-for the element \fBconfigure\fR operation.
-.TP
-\fIpathName \fBelement closest \fIx y\fR ?\fIoption value\fR?... ?\fIelemName\fR?...
-Searches for the data point closest to the window coordinates \fIx\fR
-and \fIy\fR. By default, all elements are searched. Hidden elements
-(see the \fB\-hide\fR option is false) are ignored. You can limit the
-search by specifying only the elements you want to be considered.
-\fIElemName\fR must be the name of an element that can not be hidden.
-It returns a key-value list containing the name of the closest element,
-the index of the closest data point, and the graph-coordinates of the point.
-Returns \f(CW""\fR, if no data point within the threshold distance
-can be found. The following
-\fIoption\fR\-\fIvalue\fR pairs are available.
-.RS
-.TP
-\fB\-along \fIdirection\fR
-Search for the closest element using the following criteria:
-.RS
-.TP
-\f(CWx\fR
-Find closest element vertically from the given X-coordinate.
-.TP
-\f(CWy\fR
-Find the closest element horizontally from the given Y-coordinate.
-.TP
-\f(CWboth\fR
-Find the closest element for the given point (using both the X and Y
-coordinates).
-.RE
-.TP
-\fB\-halo \fIpixels\fR
-Specifies a threshold distance where selected data points are ignored.
-\fIPixels\fR is a valid screen distance, such as \f(CW2\fR or \f(CW1.2i\fR.
-If this option isn't specified, then it defaults to the value of the
-graph's \fB\-halo\fR option.
-.TP
-\fB\-interpolate \fIstring\fR
-Indicates whether to consider projections that lie along the line segments
-connecting data points when searching for the closest point.
-The default value is \f(CW0\fR. The values for \fIstring\fR are
-described below.
-.RS
-.TP 1.25i
-\f(CWno\fR
-Search only for the closest data point.
-.TP
-\f(CWyes\fR
-Search includes projections that lie along the
-line segments connecting the data points.
-.RE
-.RE
-.TP
-\fIpathName \fBelement configure \fIelemName \fR?\fIelemName\fR... ?\fIoption value\fR?...
-Queries or modifies the configuration options for elements. Several
-elements can be modified at the same time. If \fIoption\fR isn't
-specified, a list describing all the current options for
-\fIelemName\fR is returned. If \fIoption\fR is specified, but not
-\fIvalue\fR, then a list describing the option \fIoption\fR is
-returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
-specified, then for each pair, the element option \fIoption\fR is set
-to \fIvalue\fR. The following options are valid for elements.
-.RS
-.TP
-\fB\-activepen \fIpenName\fR
-Specifies pen to use to draw active element. If \fIpenName\fR is
-\f(CW""\fR, no active elements will be drawn. The default is
-\f(CWactiveLine\fR.
-.TP
-\fB\-areabackground \fIcolor\fR
-Specifies the background color of the area under the curve. The
-background area color is drawn only for bitmaps (see the
-\fB\-areapattern\fR option). If \fIcolor\fR is \f(CW""\fR, the
-background is transparent. The default is \f(CWblack\fR.
-.TP
-\fB\-areaforeground \fIcolor\fR
-Specifies the foreground color of the area under the curve.
-The default is \f(CWblack\fR.
-.TP
-\fB\-areapattern \fIpattern\fR
-Specifies how to fill the area under the curve. \fIPattern\fR may be
-the name of a Tk bitmap, \f(CWsolid\fR, or \f(CW""\fR. If "solid",
-then the area under the curve is drawn with the color designated by
-the \fB\-areaforeground\fR option. If a bitmap, then the bitmap is
-stippled across the area. Here the bitmap colors are controlled by the
-\fB\-areaforeground\fR and \fB\-areabackground\fR options. If
-\fIpattern\fR is \f(CW""\fR, no filled area is drawn. The default is
-\f(CW""\fR.
-.TP
-\fB\-areatile \fIimage\fR
-Specifies the name of a Tk image to be used to tile the area under the
-curve. This option supersedes the \fB\-areapattern\fR option.
-\fIImage\fR must be a photo image. If \fIimage\fR is \f(CW""\fR, no
-tiling is performed. The default is \f(CW""\fR.
-.TP
-\fB\-bindtags \fItagList\fR
-Specifies the binding tags for the element. \fITagList\fR is a list
-of binding tag names. The tags and their order will determine how
-events are handled for elements. Each tag in the list matching the
-current event
-sequence will have its Tcl command executed. Implicitly the name of
-the element is always the first tag in the list. The default value is
-\f(CWall\fR.
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the traces connecting the data points.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of element line. \fIDashList\fR is a list of up to
-11 numbers that alternately represent the lengths of the dashes and
-gaps on the element line. Each number must be between 1 and 255. If
-\fIdashList\fR is \f(CW""\fR, the lines will be solid.
-.TP
-\fB\-data \fIcoordList\fR
-Specifies the X\-Y coordinates of the data. \fICoordList\fR is a
-list of numeric expressions representing the X\-Y coordinate pairs
-of each data point.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the interior color of symbols. If \fIcolor\fR is \f(CW""\fR, then
-the interior of the symbol is transparent. If \fIcolor\fR is
-\f(CWdefcolor\fR, then the color will be the same as the \fB\-color\fR
-option. The default is \f(CWdefcolor\fR.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the element is displayed.
-The default is \f(CWno\fR.
-.TP
-\fB\-label \fItext\fR
-Sets the element's label in the legend. If \fItext\fR
-is \f(CW""\fR, the element will have no entry in the legend.
-The default label is the element's name.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the connecting lines between data points. If
-\fIpixels\fR is \f(CW0\fR, no connecting lines will be drawn between
-symbols. The default is \f(CW0\fR.
-.TP
-\fB\-mapx \fIxAxis\fR
-Selects the X\-axis to map the element's X\-coordinates onto.
-\fIXAxis\fR must be the name of an axis. The default is \f(CWx\fR.
-.TP
-\fB\-mapy \fIyAxis\fR
-Selects the Y\-axis to map the element's Y\-coordinates onto.
-\fIYAxis\fR must be the name of an axis. The default is \f(CWy\fR.
-.TP
-\fB\-offdash \fIcolor\fR
-Sets the color of the stripes when traces are dashed (see the
-\fB\-dashes\fR option). If \fIcolor\fR is \f(CW""\fR, then the "off"
-pixels will represent gaps instead of stripes. If \fIcolor\fR is
-\f(CWdefcolor\fR, then the color will be the same as the \fB\-color\fR
-option. The default is \f(CWdefcolor\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the color or the outline around each symbol. If \fIcolor\fR is
-\f(CW""\fR, then no outline is drawn. If \fIcolor\fR is \f(CWdefcolor\fR,
-then the color will be the same as the \fB\-color\fR option. The
-default is \f(CWdefcolor\fR.
-.TP
-\fB\-pen \fIpenname\fR
-Set the pen to use for this element.
-.TP
-\fB\-outlinewidth \fIpixels\fR
-Sets the width of the outline bordering each symbol. If \fIpixels\fR
-is \f(CW0\fR, no outline will be drawn. The default is \f(CW1\fR.
-.TP
-\fB\-pixels \fIpixels\fR
-Sets the size of symbols. If \fIpixels\fR is \f(CW0\fR, no symbols will
-be drawn. The default is \f(CW0.125i\fR.
-.TP
-\fB\-scalesymbols \fIboolean\fR
-If \fIboolean\fR is true, the size of the symbols
-drawn for \fIelemName\fR will change with scale of the X\-axis and Y\-axis.
-At the time this option is set, the current ranges of the axes are
-saved as the normalized scales (i.e scale factor is 1.0) and the
-element is drawn at its designated size (see the \fB\-pixels\fR
-option). As the scale of the axes change, the symbol will be scaled
-according to the smaller of the X\-axis and Y\-axis scales. If \fIboolean\fR
-is false, the element's symbols are drawn at the designated size,
-regardless of axis scales. The default is \f(CW0\fR.
-.TP
-\fB\-smooth \fIsmooth\fR
-Specifies how connecting line segments are drawn between data points.
-\fISmooth\fR can be either \f(CWlinear\fR, \f(CWstep\fR, \f(CWnatural\fR, or
-\f(CWquadratic\fR. If \fIsmooth\fR is \f(CWlinear\fR, a single line
-segment is drawn, connecting both data points. When \fIsmooth\fR is
-\f(CWstep\fR, two line segments are drawn. The first is a horizontal
-line segment that steps the next X\-coordinate. The second is a
-vertical line, moving to the next Y\-coordinate. Both \fInatural\fR and
-\fIquadratic\fR generate multiple segments between data points. If
-\fInatural\fR, the segments are generated using a cubic spline. If
-\fIquadratic\fR, a quadratic spline is used. The default is
-\fIlinear\fR.
-.TP
-\fB\-styles \fIstyleList\fR
-Specifies what pen to use based on the range of weights given.
-\fIStyleList\fR is a list of style specifications. Each style
-specification, in turn, is a list consisting of a pen name, and
-optionally a minimum and maximum range. Data points whose weight (see
-the \fB\-weight\fR option) falls in this range, are drawn with this
-pen. If no range is specified it defaults to the index of the pen in
-the list. Note that this affects only symbol attributes. Line
-attributes, such as line width, dashes, etc. are ignored.
-.TP
-\fB\-symbol \fIsymbol\fR
-Specifies the symbol for data points. \fISymbol\fR can be either
-\f(CWsquare\fR, \f(CWcircle\fR, \f(CWdiamond\fR, \f(CWplus\fR, \f(CWcross\fR,
-\f(CWsplus\fR, \f(CWscross\fR, \f(CWtriangle\fR, \f(CW""\fR (where no symbol
-is drawn), or a bitmap. Bitmaps are specified as "\fIsource\fR
-?\fImask\fR?", where \fIsource\fR is the name of the bitmap, and
-\fImask\fR is the bitmap's optional mask. The default is
-\f(CWcircle\fR.
-.TP
-\fB\-trace \fIdirection\fR
-Indicates whether connecting lines between data points (whose
-X\-coordinate values are either increasing or decreasing) are drawn.
-\fIDirection\fR
-must be \f(CWincreasing\fR, \f(CWdecreasing\fR, or \f(CWboth\fR. For
-example, if \fIdirection\fR is \f(CWincreasing\fR, connecting lines will
-be drawn only between those data points where X\-coordinate values are
-monotonically increasing. If \fIdirection\fR is \f(CWboth\fR,
-connecting lines will be draw between all data points. The default is
-\f(CWboth\fR.
-.TP
-\fB\-weights \fIwVec\fR
-Specifies the weights of the individual data points. This,
-with the list pen styles (see the \fB\-styles\fR option),
-controls how data points are drawn. \fIWVec\fR is the name of a BLT
-vector or a list of numeric expressions representing the weights for
-each data point.
-.TP
-\fB\-xdata \fIxVec\fR
-Specifies the X\-coordinates of the data. \fIXVec\fR is the name of
-a BLT vector or a list of numeric expressions.
-.TP
-\fB\-ydata \fIyVec\fR
-Specifies the Y\-coordinates of the data. \fIYVec\fR is the name of
-a BLT vector or a list of numeric expressions.
-.PP
-Element configuration options may also be set by the \fBoption\fR
-command. The resource class is \f(CWElement\fR. The resource name is
-the name of the element.
-.CS
-option add *Graph.Element.symbol line
-option add *Graph.e1.symbol line
-.CE
-.RE
-.TP
-\fIpathName \fBelement create \fIelemName\fR ?\fIoption value\fR?...
-Creates a new element \fIelemName\fR. It's an error is
-an element \fIelemName\fR already exists. If
-additional arguments are present, they specify options valid for
-the element \fBconfigure\fR operation.
-.TP
-\fIpathName \fBelement deactivate \fIelemName\fR ?\fIelemName\fR?...
-Deactivates all the elements matching \fIpattern\fR.
-Elements whose names match any of the patterns given are redrawn using
-their normal colors.
-.TP
-\fIpathName \fBelement delete\fR ?\fIelemName\fR?...
-Deletes all the named elements. The graph is automatically redrawn.
-.TP
-\fIpathName \fBelement exists \fIelemName\fR
-Returns \f(CW1\fR if an element \fIelemName\fR currently exists and
-\f(CW0\fR otherwise.
-.TP
-\fIpathName \fBelement names \fR?\fIpattern\fR?...
-Returns the elements matching one or more pattern. If no
-\fIpattern\fR is given, the names of all elements is returned.
-.TP
-\fIpathName \fBelement show\fR ?\fInameList\fR?
-Queries or modifies the element display list. The element display
-list designates the elements drawn and in what
-order. \fINameList\fR is a list of elements to be displayed in the
-order they are named. If there is no \fInameList\fR argument,
-the current display list is returned.
-.TP
-\fIpathName \fBelement type\fR \fIelemName\fR
-Returns the type of \fIelemName\fR.
-If the element is a bar element, the commands returns the string
-\f(CW"bar"\fR, otherwise it returns \f(CW"line"\fR.
-.CE
-.SS "GRID COMPONENT"
-Grid lines extend from the major and minor ticks of each axis
-horizontally or vertically across the plotting area. The following
-operations are available for grid lines.
-.TP
-\fIpathName \fBgrid cget \fIoption\fR
-Returns the current value of the grid line configuration option given by
-\fIoption\fR. \fIOption\fR may be any option described below
-for the grid \fBconfigure\fR operation.
-.TP
-\fIpathName \fBgrid configure\fR ?\fIoption value\fR?...
-Queries or modifies the configuration options for grid lines. If
-\fIoption\fR isn't specified, a list describing all the current
-grid options for \fIpathName\fR is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing \fIoption\fR is
-returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
-specified, then for each pair, the grid line option \fIoption\fR is set to
-\fIvalue\fR. The following options are valid for grid lines.
-.RS
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the grid lines. The default is \f(CWblack\fR.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the grid lines. \fIDashList\fR is a list of up
-to 11 numbers that alternately represent the lengths of the dashes
-and gaps on the grid lines. Each number must be between 1 and 255.
-If \fIdashList\fR is \f(CW""\fR, the grid will be solid lines.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the grid should be drawn. If \fIboolean\fR
-is true, grid lines are not shown. The default is \f(CWyes\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of grid lines. The default width is \f(CW1\fR.
-.TP
-\fB\-mapx \fIxAxis\fR
-Specifies the X\-axis to display grid lines. \fIXAxis\fR
-must be the name of an axis or \f(CW""\fR for no grid lines.
-The default is \f(CW""\fR.
-.TP
-\fB\-mapy \fIyAxis\fR
-Specifies the Y\-axis to display grid lines. \fIYAxis\fR
-must be the name of an axis or \f(CW""\fR for no grid lines.
-The default is \f(CWy\fR.
-.TP
-\fB\-minor \fIboolean\fR
-Indicates whether the grid lines should be drawn for minor ticks.
-If \fIboolean\fR is true, the lines will appear at
-minor tick intervals. The default is \f(CW1\fR.
-.PP
-Grid configuration options may also be set by the
-\fBoption\fR command. The resource name and class are \f(CWgrid\fR and
-\f(CWGrid\fR respectively.
-.CS
-option add *Graph.grid.LineWidth 2
-option add *Graph.Grid.Color black
-.CE
-.RE
-.TP
-\fIpathName \fBgrid off\fR
-Turns off the display the grid lines.
-.TP
-\fIpathName \fBgrid on\fR
-Turns on the display the grid lines.
-.TP
-\fIpathName \fBgrid toggle\fR
-Toggles the display of the grid.
-.SS "LEGEND COMPONENT"
-The legend displays a list of the data elements. Each entry consists
-of the element's symbol and label. The legend can appear in any
-margin (the default location is in the right margin). It
-can also be positioned anywhere within the plotting area.
-.PP
-The following operations are valid for the legend.
-.TP
-\fIpathName \fBlegend activate \fIpattern\fR...
-Selects legend entries to be drawn using the active legend colors and relief.
-All entries whose element names match \fIpattern\fR are selected. To
-be selected, the element name must match only one \fIpattern\fR.
-.TP
-\fIpathName \fBlegend bind \fItagName\fR ?\fIsequence\fR? ?\fIcommand\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for a legend entry with this
-tag, \fIcommand\fR will be invoked. Implicitly the element names
-in the entry are tags. The syntax is similar to the
-\fBbind\fR command except that it operates on legend entries, rather
-than widgets. See the \fBbind\fR manual entry for
-complete details on \fIsequence\fR and the substitutions performed on
-\fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBlegend cget \fIoption\fR
-Returns the current value of a legend configuration option.
-\fIOption\fR may be any option described below in the
-legend \fBconfigure\fR operation.
-.TP
-\fIpathName \fBlegend configure \fR?\fIoption value\fR?...
-Queries or modifies the configuration options for the legend. If
-\fIoption\fR isn't specified, a list describing the current
-legend options for \fIpathName\fR is returned. If \fIoption\fR is
-specified, but not \fIvalue\fR, then a list describing \fIoption\fR is
-returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
-specified, then for each pair, the legend option \fIoption\fR is set
-to \fIvalue\fR. The following options are valid for the legend.
-.RS
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the background color for active legend entries. All legend
-entries marked active (see the legend \fBactivate\fR operation) are
-drawn using this background color.
-.TP
-\fB\-activeborderwidth \fIpixels\fR
-Sets the width of the 3-D border around the outside edge of the active legend
-entries. The default is \f(CW2\fR.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the foreground color for active legend entries. All legend
-entries marked as active (see the legend \fBactivate\fR operation) are
-drawn using this foreground color.
-.TP
-\fB\-activerelief \fIrelief\fR
-Specifies the 3-D effect desired for active legend entries.
-\fIRelief\fR denotes how the interior of the entry should appear
-relative to the legend; for example, \f(CWraised\fR means the entry
-should appear to protrude from the legend, relative to the surface of
-the legend. The default is \f(CWflat\fR.
-.TP
-\fB\-anchor \fIanchor\fR
-Tells how to position the legend relative to the positioning point for
-the legend. This is dependent on the value of the \fB\-position\fR
-option. The default is \f(CWcenter\fR.
-.RS
-.TP 1.25i
-\f(CWleft\fR or \f(CWright\fR
-The anchor describes how to position the legend vertically.
-.TP
-\f(CWtop\fR or \f(CWbottom\fR
-The anchor describes how to position the legend horizontally.
-.TP
-\f(CW at x,y\fR
-The anchor specifies how to position the legend relative to the
-positioning point. For example, if \fIanchor\fR is \f(CWcenter\fR then
-the legend is centered on the point; if \fIanchor\fR is \f(CWn\fR then
-the legend will be drawn such that the top center point of the
-rectangular region occupied by the legend will be at the positioning
-point.
-.TP
-\f(CWplotarea\fR
-The anchor specifies how to position the legend relative to the
-plotting area. For example, if \fIanchor\fR is \f(CWcenter\fR then the
-legend is centered in the plotting area; if \fIanchor\fR is \f(CWne\fR
-then the legend will be drawn such that occupies the upper right
-corner of the plotting area.
-.RE
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the legend. If \fIcolor\fR is \f(CW""\fR,
-the legend background with be transparent.
-.TP
-\fB\-bindtags \fItagList\fR
-Specifies the binding tags for legend entries. \fITagList\fR is a list
-of binding tag names. The tags and their order will determine how
-events are handled for legend entries. Each tag in the list matching
-the current event sequence will have its Tcl command executed. The
-default value is \f(CWall\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3-D border around the outside edge of the legend (if
-such border is being drawn; the \fBrelief\fR option determines this).
-The default is \f(CW2\fR pixels.
-.TP
-\fB\-font \fIfontName\fR
-\fIFontName\fR specifies a font to use when drawing the labels of each
-element into the legend. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the foreground color of the text drawn for the element's label.
-The default is \f(CWblack\fR.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the legend should be displayed. If \fIboolean\fR is
-true, the legend will not be draw. The default is \f(CWno\fR.
-.TP
-\fB\-ipadx \fIpad\fR
-Sets the amount of internal padding to be added to the width of each
-legend entry. \fIPad\fR can be a list of one or two screen distances. If
-\fIpad\fR has two elements, the left side of the legend entry is
-padded by the first distance and the right side by the second. If
-\fIpad\fR is just one distance, both the left and right sides are padded
-evenly. The default is \f(CW2\fR.
-.TP
-\fB\-ipady \fIpad\fR
-Sets an amount of internal padding to be added to the height of each
-legend entry. \fIPad\fR can be a list of one or two screen distances. If
-\fIpad\fR has two elements, the top of the entry is padded by the
-first distance and the bottom by the second. If \fIpad\fR is just
-one distance, both the top and bottom of the entry are padded evenly.
-The default is \f(CW2\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets the padding to the left and right exteriors of the legend.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the legend is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default is \f(CW4\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets the padding above and below the legend. \fIPad\fR can be a list
-of one or two screen distances. If \fIpad\fR has two elements, the area above
-the legend is padded by the first distance and the area below by the
-second. If \fIpad\fR is just one distance, both the top and
-bottom areas are padded evenly. The default is \f(CW0\fR.
-.TP
-\fB\-position \fIpos\fR
-Specifies where the legend is drawn. The
-\fB\-anchor\fR option also affects where the legend is positioned. If
-\fIpos\fR is \f(CWleft\fR, \f(CWleft\fR, \f(CWtop\fR, or \f(CWbottom\fR, the
-legend is drawn in the specified margin. If \fIpos\fR is
-\f(CWplotarea\fR, then the legend is drawn inside the plotting area at a
-particular anchor. If \fIpos\fR is in the form "\fI at x,y\fR", where
-\fIx\fR and \fIy\fR are the window coordinates, the legend is drawn in
-the plotting area at the specified coordinates. The default is
-\f(CWright\fR.
-.TP
-\fB\-raised \fIboolean\fR
-Indicates whether the legend is above or below the data elements. This
-matters only if the legend is in the plotting area. If \fIboolean\fR
-is true, the legend will be drawn on top of any elements that may
-overlap it. The default is \f(CWno\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for the border around the legend.
-\fIRelief\fR specifies how the interior of the legend should appear
-relative to the graph; for example, \f(CWraised\fR means the legend
-should appear to protrude from the graph, relative to the surface of
-the graph. The default is \f(CWsunken\fR.
-.PP
-Legend configuration options may also be set by the \fBoption\fR
-command. The resource name and class are \f(CWlegend\fR and
-\f(CWLegend\fR respectively.
-.CS
-option add *Graph.legend.Foreground blue
-option add *Graph.Legend.Relief raised
-.CE
-.RE
-.TP
-\fIpathName \fBlegend deactivate \fIpattern\fR...
-Selects legend entries to be drawn using the normal legend colors and
-relief. All entries whose element names match \fIpattern\fR are
-selected. To be selected, the element name must match only one
-\fIpattern\fR.
-.TP
-\fIpathName \fBlegend get \fIpos\fR
-Returns the name of the element whose entry is at the screen position
-\fIpos\fR in the legend. \fIPos\fR must be in the form "\fI at x,y\fR",
-where \fIx\fR and \fIy\fR are window coordinates. If the given
-coordinates do not lie over a legend entry, \f(CW""\fR is returned.
-.SS "PEN COMPONENTS"
-Pens define attributes (both symbol and line style) for elements.
-Pens mirror the configuration options of data elements that pertain to
-how symbols and lines are drawn. Data elements use pens to determine
-how they are drawn. A data element may use several pens at once. In
-this case, the pen used for a particular data point is determined from
-each element's weight vector (see the element's \fB\-weight\fR and
-\fB\-style\fR options).
-.PP
-One pen, called \f(CWactiveLine\fR, is automatically created.
-It's used as the default active pen for elements. So you can change
-the active attributes for all elements by simply reconfiguring this
-pen.
-.CS
-\&.g pen configure "activeLine" -color green
-.CE
-You can create and use several pens. To create a pen, invoke
-the pen component and its create operation.
-.CS
-\&.g pen create myPen
-.CE
-You map pens to a data element using either the element's
-\fB\-pen\fR or \fB\-activepen\fR options.
-.CS
-\&.g element create "line1" -xdata $x -ydata $tempData \\
- -pen myPen
-.CE
-An element can use several pens at once. This is done by specifying
-the name of the pen in the element's style list (see the
-\fB\-styles\fR option).
-.CS
-\&.g element configure "line1" -styles { myPen 2.0 3.0 }
-.CE
-This says that any data point with a weight between 2.0 and 3.0
-is to be drawn using the pen \f(CWmyPen\fR. All other points
-are drawn with the element's default attributes.
-.PP
-The following operations are available for pen components.
-.PP
-.TP
-\fIpathName \fBpen \fBcget \fIpenName \fIoption\fR
-Returns the current value of the option given by \fIoption\fR for
-\fIpenName\fR. \fIOption\fR may be any option described below
-for the pen \fBconfigure\fR operation.
-.TP
-\fIpathName \fBpen \fBconfigure \fIpenName \fR?\fIpenName\fR... ?\fIoption value\fR?...
-Queries or modifies the configuration options of
-\fIpenName\fR. Several pens can be modified at once. If \fIoption\fR
-isn't specified, a list describing the current options for
-\fIpenName\fR is returned. If \fIoption\fR is specified, but not
-\fIvalue\fR, then a list describing \fIoption\fR is returned. If one
-or more \fIoption\fR and \fIvalue\fR pairs are specified, then for
-each pair, the pen option \fIoption\fR is set to \fIvalue\fR. The
-following options are valid for pens.
-.RS
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the traces connecting the data points.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of element line. \fIDashList\fR is a list of up to
-11 numbers that alternately represent the lengths of the dashes and
-gaps on the element line. Each number must be between 1 and 255. If
-\fIdashList\fR is \f(CW""\fR, the lines will be solid.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the interior color of symbols. If \fIcolor\fR is \f(CW""\fR, then
-the interior of the symbol is transparent. If \fIcolor\fR is
-\f(CWdefcolor\fR, then the color will be the same as the \fB\-color\fR
-option. The default is \f(CWdefcolor\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the connecting lines between data points. If
-\fIpixels\fR is \f(CW0\fR, no connecting lines will be drawn between
-symbols. The default is \f(CW0\fR.
-.TP
-\fB\-offdash \fIcolor\fR
-Sets the color of the stripes when traces are dashed (see the
-\fB\-dashes\fR option). If \fIcolor\fR is \f(CW""\fR, then the "off"
-pixels will represent gaps instead of stripes. If \fIcolor\fR is
-\f(CWdefcolor\fR, then the color will be the same as the \fB\-color\fR
-option. The default is \f(CWdefcolor\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the color or the outline around each symbol. If \fIcolor\fR is
-\f(CW""\fR, then no outline is drawn. If \fIcolor\fR is \f(CWdefcolor\fR,
-then the color will be the same as the \fB\-color\fR option. The
-default is \f(CWdefcolor\fR.
-.TP
-\fB\-outlinewidth \fIpixels\fR
-Sets the width of the outline bordering each symbol. If \fIpixels\fR
-is \f(CW0\fR, no outline will be drawn. The default is \f(CW1\fR.
-.TP
-\fB\-pixels \fIpixels\fR
-Sets the size of symbols. If \fIpixels\fR is \f(CW0\fR, no symbols will
-be drawn. The default is \f(CW0.125i\fR.
-.TP
-\fB\-symbol \fIsymbol\fR
-Specifies the symbol for data points. \fISymbol\fR can be either
-\f(CWsquare\fR, \f(CWcircle\fR, \f(CWdiamond\fR, \f(CWplus\fR, \f(CWcross\fR,
-\f(CWsplus\fR, \f(CWscross\fR, \f(CWtriangle\fR, \f(CW""\fR (where no symbol
-is drawn), or a bitmap. Bitmaps are specified as "\fIsource\fR
-?\fImask\fR?", where \fIsource\fR is the name of the bitmap, and
-\fImask\fR is the bitmap's optional mask. The default is
-\f(CWcircle\fR.
-.TP
-\fB\-type \fIelemType\fR
-Specifies the type of element the pen is to be used with.
-This option should only be employed when creating the pen. This
-is for those that wish to mix different types of elements (bars and
-lines) on the same graph. The default type is "line".
-.PP
-Pen configuration options may be also be set by the \fBoption\fR
-command. The resource class is \f(CWPen\fR. The resource names
-are the names of the pens.
-.CS
-option add *Graph.Pen.Color blue
-option add *Graph.activeLine.color green
-.CE
-.RE
-.TP
-\fIpathName \fBpen \fBcreate \fIpenName \fR?\fIoption value\fR?...
-Creates a new pen by the name \fIpenName\fR. No pen by the same
-name can already exist. \fIOption\fR and \fIvalue\fR are described
-in above in the pen \fBconfigure\fR operation.
-.TP
-\fIpathName \fBpen \fBdelete \fR?\fIpenName\fR?...
-Deletes the named pens. A pen is not really
-deleted until it is not longer in use, so it's safe to delete
-pens mapped to elements.
-.TP
-\fIpathName \fBpen names \fR?\fIpattern\fR?...
-Returns a list of pens matching zero or more patterns. If no
-\fIpattern\fR argument is give, the names of all pens are returned.
-.SS "POSTSCRIPT COMPONENT"
-The graph can generate encapsulated PostScript output. There
-are several configuration options you can specify to control how the
-plot will be generated. You can change the page dimensions and
-borders. The plot itself can be scaled, centered, or rotated to
-landscape. The PostScript output can be written directly to a file or
-returned through the interpreter.
-.PP
-The following postscript operations are available.
-.TP
-\fIpathName \fBpostscript cget \fIoption\fR
-Returns the current value of the postscript option given by
-\fIoption\fR. \fIOption\fR may be any option described
-below for the postscript \fBconfigure\fR operation.
-.TP
-\fIpathName \fBpostscript configure \fR?\fIoption value\fR?...
-Queries or modifies the configuration options for PostScript
-generation. If \fIoption\fR isn't specified, a list describing
-the current postscript options for \fIpathName\fR is returned. If
-\fIoption\fR is specified, but not \fIvalue\fR, then a list describing
-\fIoption\fR is returned. If one or more \fIoption\fR and \fIvalue\fR
-pairs are specified, then for each pair, the postscript option
-\fIoption\fR is set to \fIvalue\fR. The following postscript options
-are available.
-.RS
-.TP
-\fB\-center \fIboolean\fR
-Indicates whether the plot should be centered on the PostScript page. If
-\fIboolean\fR is false, the plot will be placed in the upper left
-corner of the page. The default is \f(CW1\fR.
-.TP
-\fB\-colormap \fIvarName\fR
-\fIVarName\fR must be the name of a global array variable that
-specifies a color mapping from the X color name to PostScript. Each
-element of \fIvarName\fR must consist of PostScript code to set a
-particular color value (e.g. ``\f(CW1.0 1.0 0.0 setrgbcolor\fR''). When
-generating color information in PostScript, the array variable \fIvarName\fR
-is checked if an element of the name as the color exists. If so, it uses
-its value as the PostScript
-command to set the color. If this option hasn't been specified, or if
-there isn't an entry in \fIvarName\fR for a given color, then it uses
-the red, green, and blue intensities from the X color.
-.TP
-\fB\-colormode \fImode\fR
-Specifies how to output color information. \fIMode\fR must be either
-\f(CWcolor\fR (for full color output), \f(CWgray\fR (convert all colors to
-their gray-scale equivalents) or \f(CWmono\fR (convert foreground colors
-to black and background colors to white). The default mode is
-\f(CWcolor\fR.
-.TP
-\fB\-fontmap \fIvarName\fR
-\fIVarName\fR must be the name of a global array variable that
-specifies a font mapping from the X font name to PostScript. Each
-element of \fIvarName\fR must consist of a Tcl list with one or two
-elements; the name and point size of a PostScript font.
-When outputting PostScript commands for a particular font, the array
-variable \fIvarName\fR is checked to see if an element by the
-specified font exists. If there is such an element, then the font
-information contained in that element is used in the PostScript
-output. (If the point size is omitted from the list, the point size
-of the X font is used). Otherwise the X font is examined in an
-attempt to guess what PostScript font to use. This works only for
-fonts whose foundry property is \fIAdobe\fR (such as Times, Helvetica,
-Courier, etc.). If all of this fails then the font defaults to
-\f(CWHelvetica-Bold\fR.
-.TP
-\fB\-decorations \fIboolean\fR
-Indicates whether PostScript commands to generate color backgrounds and 3-D
-borders will be output. If \fIboolean\fR is false, the background will be
-white and no 3-D borders will be generated. The
-default is \f(CW1\fR.
-.TP
-\fB\-height \fIpixels\fR
-Sets the height of the plot. This lets you print the graph with a
-height different from the one drawn on the screen. If
-\fIpixels\fR is 0, the height is the same as the widget's height.
-The default is \f(CW0\fR.
-.TP
-\fB\-landscape \fIboolean\fR
-If \fIboolean\fR is true, this specifies the printed area is to be
-rotated 90 degrees. In non-rotated output the X\-axis of the printed
-area runs along the short dimension of the page (``portrait''
-orientation); in rotated output the X\-axis runs along the long
-dimension of the page (``landscape'' orientation). Defaults to
-\f(CW0\fR.
-.TP
-\fB\-maxpect \fIboolean\fR
-Indicates to scale the plot so that it fills the PostScript page.
-The aspect ratio of the graph is still retained. The default is
-\f(CW0\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets the horizontal padding for the left and right page borders. The
-borders are exterior to the plot. \fIPad\fR can be a list of one or
-two screen distances. If \fIpad\fR has two elements, the left border is padded
-by the first distance and the right border by the second. If
-\fIpad\fR has just one distance, both the left and right borders are
-padded evenly. The default is \f(CW1i\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets the vertical padding for the top and bottom page borders. The
-borders are exterior to the plot. \fIPad\fR can be a list of one or
-two screen distances. If \fIpad\fR has two elements, the top border is padded
-by the first distance and the bottom border by the second. If
-\fIpad\fR has just one distance, both the top and bottom borders are
-padded evenly. The default is \f(CW1i\fR.
-.TP
-\fB\-paperheight \fIpixels\fR
-Sets the height of the postscript page. This can be used to select
-between different page sizes (letter, A4, etc). The default height is
-\f(CW11.0i\fR.
-.TP
-\fB\-paperwidth \fIpixels\fR
-Sets the width of the postscript page. This can be used to select
-between different page sizes (letter, A4, etc). The default width is
-\f(CW8.5i\fR.
-.TP
-\fB\-width \fIpixels\fR
-Sets the width of the plot. This lets you generate a plot
-of a width different from that of the widget. If \fIpixels\fR
-is 0, the width is the same as the widget's width. The default is
-\f(CW0\fR.
-.PP
-Postscript configuration options may be also be set by the
-\fBoption\fR command. The resource name and class are
-\f(CWpostscript\fR and \f(CWPostscript\fR respectively.
-.CS
-option add *Graph.postscript.Decorations false
-option add *Graph.Postscript.Landscape true
-.CE
-.RE
-.TP
-\fIpathName \fBpostscript output \fR?\fIfileName\fR? ?\fIoption value\fR?...
-Outputs a file of encapsulated PostScript. If a
-\fIfileName\fR argument isn't present, the command returns the
-PostScript. If any \fIoption-value\fR pairs are present, they set
-configuration options controlling how the PostScript is generated.
-\fIOption\fR and \fIvalue\fR can be anything accepted by the
-postscript \fBconfigure\fR operation above.
-.SS "MARKER COMPONENTS"
-Markers are simple drawing procedures used to annotate or highlight
-areas of the graph. Markers have various types: text strings,
-bitmaps, images, connected lines, windows, or polygons. They can be
-associated with a particular element, so that when the element is
-hidden or un-hidden, so is the marker. By default, markers are the
-last items drawn, so that data elements will appear in
-behind them. You can change this by configuring the \fB\-under\fR
-option.
-.PP
-Markers, in contrast to elements, don't affect the scaling of the
-coordinate axes. They can also have \fIelastic\fR coordinates
-(specified by \f(CW-Inf\fR and \f(CWInf\fR respectively) that translate
-into the minimum or maximum limit of the axis. For example, you can
-place a marker so it always remains in the lower left corner of the
-plotting area, by using the coordinates \f(CW-Inf\fR,\f(CW-Inf\fR.
-.PP
-The following operations are available for markers.
-.TP
-\fIpathName \fBmarker after \fImarkerId\fR ?\fIafterId\fR?
-Changes the order of the markers, drawing the first
-marker after the second. If no second \fIafterId\fR argument is
-specified, the marker is placed at the end of the display list. This
-command can be used to control how markers are displayed since markers
-are drawn in the order of this display list.
-.TP
-\fIpathName \fBmarker before \fImarkerId\fR ?\fIbeforeId\fR?
-Changes the order of the markers, drawing the first
-marker before the second. If no second \fIbeforeId\fR argument is
-specified, the marker is placed at the beginning of the display list.
-This command can be used to control how markers are displayed since
-markers are drawn in the order of this display list.
-.TP
-\fIpathName \fBmarker bind \fItagName\fR ?\fIsequence\fR? ?\fIcommand\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for a marker with this
-tag, \fIcommand\fR will be invoked. The syntax is similar to the
-\fBbind\fR command except that it operates on graph markers, rather
-than widgets. See the \fBbind\fR manual entry for
-complete details on \fIsequence\fR and the substitutions performed on
-\fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBmarker cget \fIoption\fR
-Returns the current value of the marker configuration option given by
-\fIoption\fR. \fIOption\fR may be any option described
-below in the \fBconfigure\fR operation.
-.TP
-\fIpathName \fBmarker configure \fImarkerId\fR ?\fIoption value\fR?...
-Queries or modifies the configuration options for markers. If
-\fIoption\fR isn't specified, a list describing the current
-options for \fImarkerId\fR is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
-If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
-for each pair, the marker option \fIoption\fR is set to \fIvalue\fR.
-.sp
-The following options are valid for all markers.
-Each type of marker also has its own type-specific options.
-They are described in the sections below.
-.RS
-.TP
-\fB\-bindtags \fItagList\fR
-Specifies the binding tags for the marker. \fITagList\fR is a list
-of binding tag names. The tags and their order will determine how
-events for markers are handled. Each tag in the list matching the
-current event sequence will have its Tcl command executed. Implicitly
-the name of the marker is always the first tag in the list.
-The default value is \f(CWall\fR.
-.TP
-\fB\-coords \fIcoordList\fR
-Specifies the coordinates of the marker. \fICoordList\fR is
-a list of graph coordinates. The number of coordinates required
-is dependent on the type of marker. Text, image, and window markers
-need only two coordinates (an X\-Y coordinate). Bitmap markers
-can take either two or four coordinates (if four, they represent the
-corners of the bitmap). Line markers
-need at least four coordinates, polygons at least six.
-If \fIcoordList\fR is \f(CW""\fR, the marker will not be displayed.
-The default is \f(CW""\fR.
-.TP
-\fB\-element \fIelemName\fR
-Links the marker with the element \fIelemName\fR. The marker is
-drawn only if the element is also currently displayed (see the
-element's \fBshow\fR operation). If \fIelemName\fR is \f(CW""\fR, the
-marker is always drawn. The default is \f(CW""\fR.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the marker is drawn. If \fIboolean\fR is true,
-the marker is not drawn. The default is \f(CWno\fR.
-.TP
-\fB\-mapx \fIxAxis\fR
-Specifies the X\-axis to map the marker's X\-coordinates onto.
-\fIXAxis\fR must the name of an axis. The default is \f(CWx\fR.
-.TP
-\fB\-mapy \fIyAxis\fR
-Specifies the Y\-axis to map the marker's Y\-coordinates onto.
-\fIYAxis\fR must the name of an axis. The default is \f(CWy\fR.
-.TP
-\fB\-name \fImarkerId\fR
-Changes the identifier for the marker. The identifier \fImarkerId\fR
-can not already be used by another marker. If this option
-isn't specified, the marker's name is uniquely generated.
-.TP
-\fB\-under \fIboolean\fR
-Indicates whether the marker is drawn below/above data
-elements. If \fIboolean\fR is true, the marker is be drawn
-underneath the data element symbols and lines. Otherwise, the marker is
-drawn on top of the element. The default is \f(CW0\fR.
-.TP
-\fB\-xoffset \fIpixels\fR
-Specifies a screen distance to offset the marker horizontally.
-\fIPixels\fR is a valid screen distance, such as \f(CW2\fR or \f(CW1.2i\fR.
-The default is \f(CW0\fR.
-.TP
-\fB\-yoffset \fIpixels\fR
-Specifies a screen distance to offset the markers vertically.
-\fIPixels\fR is a valid screen distance, such as \f(CW2\fR or \f(CW1.2i\fR.
-The default is \f(CW0\fR.
-.PP
-Marker configuration options may also be set by the \fBoption\fR command.
-The resource class is either \f(CWBitmapMarker\fR, \f(CWImageMarker\fR,
-\f(CWLineMarker\fR, \f(CWPolygonMarker\fR, \f(CWTextMarker\fR, or \f(CWWindowMarker\fR,
-depending on the type of marker. The resource name is the name of the
-marker.
-.CS
-option add *Graph.TextMarker.Foreground white
-option add *Graph.BitmapMarker.Foreground white
-option add *Graph.m1.Background blue
-.CE
-.RE
-.TP
-\fIpathName \fBmarker create \fItype\fR ?\fIoption value\fR?...
-Creates a marker of the selected type. \fIType\fR may be either
-\f(CWtext\fR, \f(CWline\fR, \f(CWbitmap\fR, \f(CWimage\fR, \f(CWpolygon\fR, or
-\f(CWwindow\fR. This command returns the marker identifier,
-used as the \fImarkerId\fR argument in the other marker-related
-commands. If the \fB\-name\fR option is used, this overrides the
-normal marker identifier. If the name provided is already used for
-another marker, the new marker will replace the old.
-.TP
-\fIpathName \fBmarker delete\fR ?\fIname\fR?...
-Removes one of more markers. The graph will automatically be redrawn
-without the marker.\fR.
-.TP
-\fIpathName \fBmarker exists \fImarkerId\fR
-Returns \f(CW1\fR if the marker \fImarkerId\fR exists and \f(CW0\fR
-otherwise.
-.TP
-\fIpathName \fBmarker names\fR ?\fIpattern\fR?
-Returns the names of all the markers that currently exist. If
-\fIpattern\fR is supplied, only those markers whose names match it
-will be returned.
-.TP
-\fIpathName \fBmarker type \fImarkerId\fR
-Returns the type of the marker given by \fImarkerId\fR, such as
-\f(CWline\fR or \f(CWtext\fR. If \fImarkerId\fR is not a valid a marker
-identifier, \f(CW""\fR is returned.
-.SS "BITMAP MARKERS"
-A bitmap marker displays a bitmap. The size of the
-bitmap is controlled by the number of coordinates specified. If two
-coordinates, they specify the position of the top-left corner of the
-bitmap. The bitmap retains its normal width and height. If four
-coordinates, the first and second pairs of coordinates represent the
-corners of the bitmap. The bitmap will be stretched or reduced as
-necessary to fit into the bounding rectangle.
-.PP
-Bitmap markers are created with the marker's \fBcreate\fR operation in
-the form:
-.DS
-\fIpathName \fBmarker create bitmap \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR pairs, each
-sets a configuration options for the marker. These
-same \fIoption\fR\-\fIvalue\fR pairs may be used with the marker's
-\fBconfigure\fR operation.
-.PP
-The following options are specific to bitmap markers:
-.TP
-\fB\-background \fIcolor\fR
-Same as the \fB\-fill\fR option.
-.TP
-\fB\-bitmap \fIbitmap\fR
-Specifies the bitmap to be displayed. If \fIbitmap\fR is \f(CW""\fR,
-the marker will not be displayed. The default is \f(CW""\fR.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the background color of the bitmap. If \fIcolor\fR is the empty
-string, no background will be transparent. The default background color is
-\f(CW""\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Same as the \fB\-outline\fR option.
-.TP
-\fB\-mask \fImask\fR
-Specifies a mask for the bitmap to be displayed. This mask is a bitmap
-itself, denoting the pixels that are transparent. If \fImask\fR is
-\f(CW""\fR, all pixels of the bitmap will be drawn. The default is
-\f(CW""\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the foreground color of the bitmap. The default value is \f(CWblack\fR.
-.TP
-\fB\-rotate \fItheta\fR
-Sets the rotation of the bitmap. \fITheta\fR is a real number
-representing the angle of rotation in degrees. The marker is first
-rotated and then placed according to its anchor position. The default
-rotation is \f(CW0.0\fR.
-.SS "IMAGE MARKERS"
-A image marker displays an image. Image markers are
-created with the marker's \fBcreate\fR operation in the form:
-.DS
-\fIpathName \fBmarker create image \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR
-pairs, each sets a configuration option
-for the marker. These same \fIoption\fR\-\fIvalue\fR pairs may be
-used with the marker's \fBconfigure\fR operation.
-.PP
-The following options are specific to image markers:
-.TP
-\fB\-anchor \fIanchor\fR
-\fIAnchor\fR tells how to position the image relative to the
-positioning point for the image. For example, if \fIanchor\fR
-is \f(CWcenter\fR then the image is centered on the point; if
-\fIanchor\fR is \f(CWn\fR then the image will be drawn such that
-the top center point of the rectangular region occupied by the
-image will be at the positioning point.
-This option defaults to \f(CWcenter\fR.
-.TP
-\fB\-image \fIimage\fR
-Specifies the image to be drawn.
-If \fIimage\fR is \f(CW""\fR, the marker will not be
-drawn. The default is \f(CW""\fR.
-.SS "LINE MARKERS"
-A line marker displays one or more connected line segments.
-Line markers are created with marker's \fBcreate\fR operation in the form:
-.DS
-\fIpathName \fBmarker create line \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR
-pairs, each sets a configuration option
-for the marker. These same \fIoption\fR-\fIvalue\fR pairs may be
-used with the marker's \fBconfigure\fR operation.
-.PP
-The following options are specific to line markers:
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the line. \fIDashList\fR is a list of up to 11
-numbers that alternately represent the lengths of the dashes and gaps
-on the line. Each number must be between 1 and 255. If
-\fIdashList\fR is \f(CW""\fR, the marker line will be solid.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the background color of the line. This color is used with
-striped lines (see the \fB\-fdashes\fR option). If \fIcolor\fR is
-the empty string, no background color is drawn (the line will be
-dashed, not striped). The default background color is \f(CW""\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the lines.
-The default width is \f(CW0\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the foreground color of the line. The default value is \f(CWblack\fR.
-.TP
-\fB\-stipple \fIbitmap\fR
-Specifies a stipple pattern used to draw the line, rather than
-a solid line.
-\fIBitmap\fR specifies a bitmap to use as the stipple
-pattern. If \fIbitmap\fR is \f(CW""\fR, then the
-line is drawn in a solid fashion. The default is \f(CW""\fR.
-.SS "POLYGON MARKERS"
-A polygon marker displays a closed region described as two or more
-connected line segments. It is assumed the first and
-last points are connected. Polygon markers are created using the
-marker \fBcreate\fR operation in the form:
-.DS
-\fIpathName \fBmarker create polygon \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR
-pairs, each sets a configuration option
-for the marker. These same \fIoption\fR\-\fIvalue\fR pairs may be
-used with the \fBmarker configure\fR command to change the marker's
-configuration.
-The following options are supported for polygon markers:
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the outline of the polygon. \fIDashList\fR is a
-list of up to 11 numbers that alternately represent the lengths of
-the dashes and gaps on the outline. Each number must be between 1 and
-255. If \fIdashList\fR is \f(CW""\fR, the outline will be a solid line.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the fill color of the polygon. If \fIcolor\fR is \f(CW""\fR, then
-the interior of the polygon is transparent.
-The default is \f(CWwhite\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the outline of the polygon. If \fIpixels\fR is zero,
-no outline is drawn. The default is \f(CW0\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the color of the outline of the polygon. If the polygon is
-stippled (see the \fB\-stipple\fR option), then this represents the
-foreground color of the stipple. The default is \f(CWblack\fR.
-.TP
-\fB\-stipple \fIbitmap\fR
-Specifies that the polygon should be drawn with a stippled pattern
-rather than a solid color. \fIBitmap\fR specifies a bitmap to use as
-the stipple pattern. If \fIbitmap\fR is \f(CW""\fR, then the polygon is
-filled with a solid color (if the \fB\-fill\fR option is set). The
-default is \f(CW""\fR.
-.SS "TEXT MARKERS"
-A text marker displays a string of characters on one or more lines of
-text. Embedded newlines cause line breaks. They may be used to
-annotate regions of the graph. Text markers are created with the
-\fBcreate\fR operation in the form:
-.DS
-\fIpathName \fBmarker create text \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR pairs,
-each sets a configuration option for the text marker.
-These same \fIoption\fR\-\fIvalue\fR pairs may be used with the
-marker's \fBconfigure\fR operation.
-.PP
-The following options are specific to text markers:
-.TP
-\fB\-anchor \fIanchor\fR
-\fIAnchor\fR tells how to position the text relative to the
-positioning point for the text. For example, if \fIanchor\fR is
-\f(CWcenter\fR then the text is centered on the point; if
-\fIanchor\fR is \f(CWn\fR then the text will be drawn such that the
-top center point of the rectangular region occupied by the text will
-be at the positioning point. This default is \f(CWcenter\fR.
-.TP
-\fB\-background \fIcolor\fR
-Same as the \fB\-fill\fR option.
-.TP
-\fB\-font \fIfontName\fR
-Specifies the font of the text. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-120-*\fR.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the background color of the text. If \fIcolor\fR is the empty
-string, no background will be transparent. The default background color is
-\f(CW""\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Same as the \fB\-outline\fR option.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the text should be justified. This matters only when
-the marker contains more than one line of text. \fIJustify\fR must be
-\f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR. The default is
-\f(CWcenter\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the color of the text. The default value is \f(CWblack\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets the padding to the left and right exteriors of the text.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the text is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default is \f(CW4\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets the padding above and below the text. \fIPad\fR can be a list of
-one or two screen distances. If \fIpad\fR has two elements, the area above the
-text is padded by the first distance and the area below by the second.
-If \fIpad\fR is just one distance, both the top and bottom areas
-are padded evenly. The default is \f(CW4\fR.
-.TP
-\fB\-rotate \fItheta\fR
-Specifies the number of degrees to rotate the text. \fITheta\fR is a
-real number representing the angle of rotation. The marker is first
-rotated along its center and is then drawn according to its anchor
-position. The default is \f(CW0.0\fR.
-.TP
-\fB\-text \fItext\fR
-Specifies the text of the marker. The exact way the text is
-displayed may be affected by other options such as \fB\-anchor\fR or
-\fB\-rotate\fR.
-.SS "WINDOW MARKERS"
-A window marker displays a widget at a given position.
-Window markers are created with the marker's \fBcreate\fR operation in
-the form:
-.DS
-\fIpathName \fBmarker create window \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR
-pairs, each sets a configuration option
-for the marker. These same \fIoption\fR\-\fIvalue\fR pairs may be
-used with the marker's \fBconfigure\fR command.
-.PP
-The following options are specific to window markers:
-.TP
-\fB\-anchor \fIanchor\fR
-\fIAnchor\fR tells how to position the widget relative to the
-positioning point for the widget. For example, if \fIanchor\fR is
-\f(CWcenter\fR then the widget is centered on the point; if \fIanchor\fR
-is \f(CWn\fR then the widget will be displayed such that the top center
-point of the rectangular region occupied by the widget will be at the
-positioning point. This option defaults to \f(CWcenter\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the height to assign to the marker's window. If this option
-isn't specified, or if it is specified as \f(CW""\fR, then the window is
-given whatever height the widget requests internally.
-.TP
-\fB\-width \fIpixels\fR
-Specifies the width to assign to the marker's window. If this option
-isn't specified, or if it is specified as \f(CW""\fR, then the window is
-given whatever width the widget requests internally.
-.TP
-\fB\-window \fIpathName\fR
-Specifies the widget to be managed by the graph. \fIPathName\fR must
-be a child of the \fBgraph\fR widget.
-.SH "GRAPH COMPONENT BINDINGS"
-Specific graph components, such as elements, markers and legend
-entries, can have a command trigger when event occurs in them, much
-like canvas items in Tk's canvas widget. Not all event sequences are
-valid. The only binding events that may be specified are those
-related to the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR,
-\fBButtonPress\fR, \fBMotion\fR, and \fBKeyPress\fR).
-.PP
-Only one element or marker can be picked during an event. This means,
-that if the mouse is directly over both an element and a marker, only
-the uppermost component is selected. This isn't true for legend entries.
-Both a legend entry and an element (or marker) binding commands
-will be invoked if both items are picked.
-.PP
-It is possible for multiple bindings to match a particular event.
-This could occur, for example, if one binding is associated with the
-element name and another is associated with one of the element's tags
-(see the \fB\-bindtags\fR option). When this occurs, all of the
-matching bindings are invoked. A binding associated with the element
-name is invoked first, followed by one binding for each of the element's
-bindtags. If there are multiple matching bindings for a single tag,
-then only the most specific binding is invoked. A continue command
-in a binding script terminates that script, and a break command
-terminates that script and skips any remaining scripts for the event,
-just as for the bind command.
-.PP
-The \fB\-bindtags\fR option for these components controls addition
-tag names which can be matched. Implicitly elements and markers
-always have tags matching their names. Setting the value of
-the \fB\-bindtags\fR option doesn't change this.
-.SH "C LANGUAGE API"
-You can manipulate data elements from the C language. There
-may be situations where it is too expensive to translate the data
-values from ASCII strings. Or you might want to read data in a
-special file format.
-.PP
-Data can manipulated from the C language using BLT vectors.
-You specify the X-Y data coordinates of an element as vectors and
-manipulate the vector from C. The graph will be redrawn automatically
-after the vectors are updated.
-.PP
-From Tcl, create the vectors and configure the element to use them.
-.CS
-vector X Y
-\&.g element configure line1 -xdata X -ydata Y
-.CE
-To set data points from C, you pass the values as arrays of doubles
-using the \fBBlt_ResetVector\fR call. The vector is reset with the
-new data and at the next idle point (when Tk re-enters its event
-loop), the graph will be redrawn automatically.
-.CS
-#include <tcl.h>
-#include <blt.h>
-
-register int i;
-Blt_Vector *xVec, *yVec;
-double x[50], y[50];
-
-/* Get the BLT vectors "X" and "Y" (created above from Tcl) */
-if ((Blt_GetVector(interp, "X", &xVec) != TCL_OK) ||
- (Blt_GetVector(interp, "Y", &yVec) != TCL_OK)) {
- return TCL_ERROR;
-}
-
-for (i = 0; i < 50; i++) {
- x[i] = i * 0.02;
- y[i] = sin(x[i]);
-}
-
-/* Put the data into BLT vectors */
-if ((Blt_ResetVector(xVec, x, 50, 50, TCL_VOLATILE) != TCL_OK) ||
- (Blt_ResetVector(yVec, y, 50, 50, TCL_VOLATILE) != TCL_OK)) {
- return TCL_ERROR;
-}
-.CE
-See the \fBvector\fR manual page for more details.
-.SH SPEED TIPS
-There may be cases where the graph needs to be drawn and updated as
-quickly as possible. If drawing speed becomes a big
-problem, here are a few tips to speed up displays.
-.TP 2
-\(bu
-Try to minimize the number of data points. The more data points
-the looked at, the more work the graph must do.
-.TP 2
-\(bu
-If your data is generated as floating point values, the time required
-to convert the data values to and from ASCII strings can be
-significant, especially when there any many data points. You can
-avoid the redundant string-to-decimal conversions using the C API to
-BLT vectors.
-.TP 2
-\(bu
-Data elements without symbols are drawn faster than with symbols.
-Set the data element's \fB\-symbol\fR option to \f(CWnone\fR. If you need to
-draw symbols, try using the simple symbols such as \f(CWsplus\fR and
-\f(CWscross\fR.
-.TP 2
-\(bu
-Don't stipple or dash the element. Solid lines are much faster.
-.TP 2
-\(bu
-If you update data elements frequently, try turning off the
-widget's \fB\-bufferelements\fR option. When the graph is first
-displayed, it draws data elements into an internal pixmap. The pixmap
-acts as a cache, so that when the graph needs to be redrawn again, and
-the data elements or coordinate axes haven't changed, the pixmap is
-simply copied to the screen. This is especially useful when you are
-using markers to highlight points and regions on the graph. But if
-the graph is updated frequently, changing either the element data or
-coordinate axes, the buffering becomes redundant.
-.SH LIMITATIONS
-Auto-scale routines do not use requested min/max limits as boundaries
-when the axis is logarithmically scaled.
-.PP
-The PostScript output generated for polygons with more than 1500
-points may exceed the limits of some printers (See PostScript Language
-Reference Manual, page 568). The work-around is to break the polygon
-into separate pieces.
-.SH KEYWORDS
-graph, widget
diff --git a/blt3.0.1/man/hierbox.mann b/blt3.0.1/man/hierbox.mann
deleted file mode 100644
index 457bf18..0000000
--- a/blt3.0.1/man/hierbox.mann
+++ /dev/null
@@ -1,2261 +0,0 @@
-'\"
-'\" Copyright 2001-2 by Silicon Metrics Corporation.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Silicon Metrics or any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Silicon Metrics disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Silicon Metrics be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" The hierarchical table widget created by George Howlett.
-'\"
-.so man.macros
-.TH treeview n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-treeview \- Create and manipulate hierarchical table widgets
-.BE
-.SH SYNOPSIS
-\fBtreeview\fR \fIpathName \fR?\fIoptions\fR?
-.SH DESCRIPTION
-The \fBtreeview\fR widget displays a tree of data. It replaces both
-the \fBhiertable\fR and \fBhierbox\fR widgets. The \fBtreeview\fR is
-100% syntax compatible with the \fBhiertable\fR widget. The
-\fBhiertable\fR command is retained for sake of script-level
-compatibility. This widget obsoletes the \fBhierbox\fR widget. It
-does everything the old \fBhierbox\fR widget did, but also provides
-data sharing (via \fItree data objects\fR) and the ability to tag
-nodes.
-.SH INTRODUCTION
-The \fBtreeview\fR widget displays hierarchical data. Data is
-represented as nodes in a general-ordered tree. Each node may have
-sub-nodes and these nodes can in turn has their own children.
-.PP
-A node is displayed as a row entry in the widget. Each entry has a
-text label and icon. When a node has children, its entry is drawn
-with a small button to the left of the label. Clicking the mouse over
-this button opens or closes the node. When a node is \fIopen\fR, its
-children are exposed. When it is \fIclosed\fR, the children and their
-descedants are hidden. The button is normally a \f(CW+\fR or
-\f(CW\-\fR symbol (ala Windows Explorer), but can be replaced with a
-pair of Tk images (open and closed images).
-.PP
-If the node has data associated with it, they can be displayed in
-columns running vertically on either side the tree. You can control
-the color, font, etc of each entry. Any entry label or data field can
-be edited in-place.
-.SH "TREE DATA OBJECT"
-The tree is not stored inside the widget but in a tree data object
-(see the \fBtree\fR command for a further explanation). Tree data
-objects can be shared among different clients, such as a
-\fBtreeview\fR widget or the \fBtree\fR command. You can walk the
-tree and manage its data with the \fBtree\fR command tree, while
-displaying it with the \fBtreeview\fR widget. Whenever the tree is
-updated, the \fBtreeview\fR widget is automatically redrawn.
-.PP
-By default, the \fBtreeview\fR widget creates its own tree object.
-The tree initially contains just a root node. But you can also
-display trees created by the \fBtree\fR command using the \fB\-tree\fR
-configuration option. \fBTreeview\fR widgets can share the same tree
-object, possibly displaying different views of the same data.
-.PP
-A tree object has both a Tcl and C API. You can insert or delete
-nodes using \fBtreeview\fR widget or \fBtree\fR command operations,
-but also from C code. For example, you can load the tree from your C
-code while still managing and displaying the tree from Tcl. The widget
-is automatically notified whenever the tree is modified via C or Tcl.
-.SH SYNTAX
-.DS
-\fBtreeview \fIpathName \fR?\fIoption value\fR?...
-.DE
-The \fBtreeview\fR command creates a new window \fIpathName\fR and
-makes it into a \fBtreeview\fR widget. At the time this command is
-invoked, there must not exist a window named \fIpathName\fR, but
-\fIpathName\fR's parent must exist. Additional options may be
-specified on the command line or in the option database to configure
-aspects of the widget such as its colors and font. See the
-\fBconfigure\fR operation below for the exact details about what
-\fIoption\fR and \fIvalue\fR pairs are valid.
-.PP
-If successful, \fBtreeview\fR returns the path name of the widget. It
-also creates a new Tcl command by the same name. You can use this
-command to invoke various operations that query or modify the widget.
-The general form is:
-.DS
-\fIpathName \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available are described in the
-.SB "TREEVIEW OPERATIONS"
-section.
-.SH "IDS AND TAGS"
-Nodes can be inserted into a tree using the \fBtreeview\fR widget
-.CS
-blt::treeview .t
-set node [.t insert end root "one"]
-.CE
-or \fBtree\fR command.
-.CS
-set tree [blt::tree create]
-set node [$tree insert root "one"]
-.CE
-In both cases, a number identifying the node is returned (the value of
-\f(CW$node\fR). This serial number or \fIid\fR uniquely identifies
-the node. Please note that you can't infer a location or position of
-a node from its id. The only exception is that the root node is
-always id \f(CW0\fR. Since nodes may have the same labels or be moved
-within the tree, ids provide an convenient way to identify nodes. If
-a tree is shared, the ids will be the same regardless if you are using
-by the \fBtreeview\fR widget or the \fBtree\fR command. Ids are
-recycled when the node deleted.
-.PP
-A node may also have any number of \fItags\fR associated with it. A
-tag is just a string of characters, and it may take any form except
-that of an integer. For example, "\f(CWx123\fR" is valid, but
-"\f(CW123\fR" isn't. The same tag may be associated with many
-different nodes. This is typically done to associate a group of
-nodes. Many operations in the \fBtreeview\fR widget take either node
-ids or tag names as arguments. Using a tag says to apply the operation
-to all nodes with that tag.
-.PP
-The tag \fBall\fR is implicitly associated with every node in
-the tree. It may be used to invoke operations on all the nodes in the
-tree.
-.PP
-Tags may be shared, just like trees, between clients. For example,
-you can use the tags created by the \fBtree\fR command with
-\fBtreeview\fR widgets.
-.SH SPECIAL NODE IDS
-There are also several special non-numeric ids. Special ids differ
-from tags in that they are always translated to their numeric
-equivalent. They also take precedence over tags. For example, you
-can't use a tag name that is a special id. These ids are specific to
-the \fBtreeview\fR widget.
-.TP 15
-\fBactive\fR
-The node where the mouse pointer is currently located.
-When a node is active, it is drawn using its active icon
-(see the \fB\-activeicon\fR option).
-The \fBactive\fR id is changed automatically by moving the mouse
-pointer over another node or by using the \fBentry activate\fR
-operation. Note that there can be only one active node at a time.
-.TP 15
-\fBanchor\fR
-The node representing the fixed end of the current selection.
-The anchor is set by the \fBselection anchor\fR operation.
-.TP 15
-\fBcurrent\fR
-The node where the mouse pointer is currently located.
-But unlike \fBactive\fR, this id changes while the
-selection is dragged. It is used to determine the
-current node during button drags.
-.TP 15
-\fBdown\fR
-The next open node from the current focus. The \fBdown\fR of
-the last open node is the same.
-.TP 15
-\fBend\fR
-The last open node (in depth-first order) on the tree.
-.TP 15
-\fBfocus\fR
-The node that currently has focus. When a node has focus,
-it receives key events. To indicate focus, the node
-is drawn with a dotted line around its label. You can change the
-focus using the \fBfocus\fR operation.
-.TP 15
-\fBlast\fR
-The last open node from the current focus. But unlike \fBup\fR,
-when the focus is at root, \fBlast\fR wraps around to the last
-open node in the tree.
-.TP 15
-\fBmark\fR
-The node representing the non-fixed end of the current selection.
-The mark is set by the \fBselection mark\fR operation.
-.TP 15
-\fBnext\fR
-The next open node from the current focus. But unlike \fBdown\fR,
-when the focus is on last open node, \fBnext\fR wraps around to the
-root node.
-.TP 15
-\fBnextsibling\fR
-The next sibling from the node with the current focus. If the node
-is already the last sibling then it is the \fBnextsibling\fB.
-.TP 15
-\fBparent\fR
-The parent of the node with the current focus. The \fBparent\fR
-of the root is also the root.
-.TP 15
-\fBprevsibling\fR
-The previous sibling from the node with the current focus. If the node
-is already the first sibling then it is the \fBprevsibling\fB.
-.TP 15
-\fBroot\fR
-The root node. You can also use id \f(CW0\fR to indicate
-the root.
-.TP 15
-\fBup\fR
-The last open node (in depth-first order) from the current focus. The
-\fBup\fR of the root node (i.e. the root has focus) is also the root.
-.TP 15
-\fBview.top\fR
-First node that's current visible in the widget.
-.TP 15
-\fBview.bottom\fR
-Last node that's current visible in the widget.
-.TP 15
-\fIpath\fR
-Absolute path of a node. Path names refer to the node name, not
-their entry labels. Paths don't have to start with a separator (see
-the \fB\-separator\fR configuration option), but component names must
-be separated by the designated separator.
-.TP 15
-\fB@\fIx\fB,\fIy\fR
-Indicates the node that covers the point in the treeview window
-specified by \fIx\fR and \fIy\fR (in pixel coordinates). If no
-part of the entryd covers that point, then the closest node to that
-point is used.
-.PP
-A node may be specified as an id or tag. If the specifier is an
-integer then it is assumed to refer to the single node with that id.
-If the specifier is not an integer, it's checked to see if it's a
-special id (such as focus). Otherwise, it's assumed to be tag. Some
-operations only operate on a single node at a time; if a tag refers to
-more than one node, then an error is generated.
-.SH DATA FIELDS
-A node in the tree can have \fIdata fields\fR. A data field is a
-name-value pair, used to represent arbitrary data in the node. Nodes
-can contain different fields (they aren't required to contain the same
-fields). You can optionally display these fields in the
-\fBtreeview\fR widget in columns running on either side of the
-displayed tree. A node's value for the field is drawn in the column
-along side its node in the hierarchy. Any node that doesn't have a
-specific field is left blank. Columns can be interactively resized,
-hidden, or, moved.
-.SH ENTRY BINDINGS
-You can bind Tcl commands to be invoked when events occur on nodes
-(much like Tk canvas items). You can bind a node using its id or
-its \fIbindtags\fR. Bindtags are simply names that associate a
-binding with one or more nodes. There is a built-in tag \f(CWall\fR
-that all node entries automatically have.
-.SH "TREEVIEW OPERATIONS"
-The \fBtreeview\fR operations are the invoked by specifying
-the widget's pathname, the operation, and any arguments that pertain
-to that operation. The general form is:
-.sp
-.CS
-\fIpathName operation \fR?\fIarg arg ...\fR?
-.CE
-.sp
-\fIOperation\fR and the \fIarg\fRs determine the exact behavior of the
-command. The following operation are available for \fBtreeview\fR widgets:
-.TP
-\fIpathName \fBbbox\fR ?\fB-screen\fR? \fItagOrId...\fR
-Returns a list of 4 numbers, representing a bounding box of around
-the specified entries. The entries is given by one or more \fItagOrId\fR
-arguments.
-If the \fB\-screen\fR flag is given, then the x-y coordinates
-of the bounding box are returned as screen coordinates, not
-virtual coordinates. Virtual coordinates start from \f(CW0\fR from the
-root node.
-The returned list contains the following values.
-.RS
-.TP 1.25i
-\fIx\fR
-X-coordinate of the upper-left corner of the bounding box.
-.TP
-\fIy\fR
-Y-coordinate of the upper-left corner of the bounding box.
-.TP
-\fIwidth\fR
-Width of the bounding box.
-.TP
-\fIheight\fR
-Height of the bounding box.
-.RE
-.TP
-\fIpathName \fBbind\fR \fItagName\fR ?\fIsequence command\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for a node with this
-tag, \fIcommand\fR will be invoked. The syntax is similar to the
-\fBbind\fR command except that it operates on \fBtreeview\fR entries,
-rather than widgets. See the \fBbind\fR manual entry for
-complete details on \fIsequence\fR and the substitutions performed on
-\fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBbutton \fIoperation\fR ?\fIargs\fR?
-This command is used to control the button selectors within a
-\fBtreeview\fR widget.
-It has several forms, depending on \fIoperation\fR:
-.RS
-.TP
-\fIpathName \fBbutton activate\fR \fItagOrId\fR
-Designates the node given by \fItagOrId\fR as active.
-When a node is active it's entry is drawn using its active icon
-(see the \fB\-activeicon\fR option).
-Note that there can be only one active entry at a time.
-The special id \fBactive\fR indicates the currently active node.
-.TP
-\fIpathName \fBbutton bind\fR \fItagName\fR ?\fIsequence command\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for an button of a
-node entry with this tag, \fIcommand\fR will be invoked. The syntax is
-similar to the \fBbind\fR command except that it operates on
-\fBtreeview\fR buttons, rather than widgets. See the \fBbind\fR
-manual entry for complete details on \fIsequence\fR and the
-substitutions performed on \fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBbutton cget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBbutton configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "BUTTON OPTIONS"
-below.
-.RE
-.TP
-\fIpathName \fBcget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBclose \fR?\fB\-recurse\fR? \fItagOrId...\fR
-Closes the node specified by \fItagOrId\fR. In addition, if a Tcl
-script was specified by the \fB\-closecommand\fR option, it is
-invoked. If the node is already closed, this command has no effect.
-If the \fB\-recurse\fR flag is present, each child node is
-recursively closed.
-.TP
-\fIpathName \fBcolumn \fIoperation\fR ?\fIargs\fR?
-The following operations are available for treeview columns.
-.RS
-.TP
-\fIpathName \fBcolumn activate\fR \fIcolumn\fR
-Sets the active column to \fIcolumn\fR. \fIColumn\fR is the
-name of a column in the widget.
-When a column is active, it's drawn using its \fB\-activetitlebackground\fR
-and \fB\-activetitleforeground\fR options. If \fIcolumn\fR is the \f(CW""\fR,
-then no column will be active. If no column argument is provided, then
-the name of the currently active column is returned.
-.TP
-\fIpathName \fBcolumn cget\fR \fIname\fR \fIoption\fR
-Returns the current value of the column configuration option given
-by \fIoption\fR for \fIname\fR. \fIName\fR is the name of column
-that corresponds to a data field.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBcolumn configure\fR \fIname\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the column designated
-by \fIname\fR. \fIName\fR is the name of the column corresponding
-to a data field.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "COLUMN OPTIONS"
-below.
-.TP
-\fIpathName \fBcolumn delete\fR \fIfield\fR ?\fIfield\fR...?
-Deletes one of more columns designated by \fIfield\fR. Note
-that this does not delete the data fields themselves.
-.TP
-\fIpathName \fBcolumn insert\fR \fIposition\fR \fIfield\fR ?\fIoptions\fR...?
-Inserts one of more columns designated by \fIfield\fR. A column displays
-each node's data field by the same name. If the node doesn't
-have the given field, the cell is left blank.
-\fIPosition\fR
-indicates where in the list of columns to add the new column. It may be
-either a number or \f(CWend\fR.
-.TP
-\fIpathName \fBcolumn invoke\fR \fIfield\fR
-Invokes the Tcl command associated with the column \fIfield\fR,
-if there is one (using the column's \fB\-command\fR option).
-The command is ignored if the column's \fB\-state\fR option
-set to \f(CWdisabled\fR.
-.TP
-\fIpathName \fBcolumn move \fIname\fR \fIdest\fR
-Moves the column \fIname\fR to the destination position.
-\fIDest\fR is the name of another column or a screen position
-in the form \f(CW@\fIx\f(CW,\fIy\fR.
-.TP
-\fIpathName \fBcolumn names\fR
-Returns a list of the names of all columns in the widget.
-The list is ordered as the columns are drawn from left-to-right.
-.TP
-\fIpathName \fBcolumn nearest\fR \fIx\fR ?\fIy\fR?
-Returns the name of the column closest to the given X-Y screen
-coordinate. If you provide a \fIy\fR argument (it's optional),
-a name is returned only when if the point is over a column's title.
-.RE
-.TP
-\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "TREEVIEW OPTIONS"
-below.
-.TP
-\fIpathName \fBcurselection\fR
-Returns a list containing the ids of all of the entries that are
-currently selected.
-If there are no entries selected, then the empty string is returned.
-.TP
-\fIpathName \fBdelete \fItagOrId\fR...
-Deletes one or more entries given by \fItagOrId\fR and its children.
-.TP
-\fIpathName \fBentry \fIoperation\fR ?\fIargs\fR?
-The following operations are available for treeview entries.
-.RS
-.TP
-\fIpathName \fBentry activate\fR \fItagOrId\fR
-Sets the active entry to the one specified by \fItagOrId\fR.
-When an entry is active it is drawn using its active icon
-(see the \fB\-activeicon\fR option).
-Note that there can be only one active node at a time.
-The special id of the currently active node is \fBactive\fR.
-.TP
-\fIpathName \fBentry cget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBentry children\fR \fItagOrId\fR ?\fIfirst\fR? ?\fIlast\fR?
-Returns a list of ids for the given range of children of \fItagOrId\fR.
-\fITagOrId\fR is the id or tag of the node to be examined.
-If only a \fIfirst\fR argument is present, then the id
-of the that child at that numeric position is returned. If both \fIfirst\fR
-and \fIlast\fR arguments are given, then the ids of all the children
-in that range are returned. Otherwise the ids of all children
-are returned.
-.TP
-\fIpathName \fBentry configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described below:
-.TP
-\fIpathName \fBentry delete\fR \fItagOrId\fR ?\fIfirst\fR ?\fIlast\fR?
-Deletes the one or more children nodes of the parent \fItagOrId\fR.
-If \fIfirst\fR and \fIlast\fR arguments are present, they are
-positions designating a range of children nodes to be deleted.
-.TP
-\fIpathName \fBentry isbefore \fItagOrId1\fR \fItagOrId2\fR
-Returns 1 if \fItagOrId1\fR is before \fItagOrId2\fR and 0 otherwise.
-.TP
-\fIpathName \fBentry ishidden \fItagOrId\fR
-Returns 1 if the node is currently hidden and 0 otherwise. A node is
-also hidden if any of its ancestor nodes are closed or hidden.
-.TP
-\fIpathName \fBentry isopen \fItagOrId\fR
-Returns 1 if the node is currently open and 0 otherwise.
-.TP
-\fIpathName \fBentry size\fR \fB\-recurse\fR \fItagOrId\fR
-Returns the number of children for parent node \fItagOrId\fR.
-If the \fB\-recurse\fR flag is set, the number of all
-its descendants is returned. The node itself is not counted.
-.RE
-.TP
-\fIpathName \fBfind \fR?\fIflags\fR? \fIfirst\fR \fIlast\fR
-Finds for all entries matching the criteria given by \fIflags\fR. A
-list of ids for all matching nodes is returned. \fIFirst\fR and
-\fIlast\fR are ids designating the range of the search in
-depth-first order. If \fIlast\fR is before \fIfirst\fR, then nodes
-are searched in reverse order. The valid flags are:
-.RS
-.TP 1.25i
-\fB\-name\fI pattern\fR
-Specifies pattern to match against node names.
-.TP 1.25i
-\fB\-full\fI pattern\fR
-Specifies pattern to match against node pathnames.
-.TP 1.25i
-\fB\-\fIoption\fI pattern\fR
-Specifies pattern to match against the node entry's configuration option.
-.TP 1.25i
-\fB\-exact\fR
-Patterns must match exactly. The is the default.
-.TP 1.25i
-\fB\-glob\fR
-Use global pattern matching. Matching is done in a fashion
-similar to that used by the C-shell. For the two
-strings to match, their contents must be identical
-except that the following special sequences may
-appear in pattern:
-.RS
-.TP 5
-\f(CW*\fR
-Matches any sequence of characters in
-string, including a null string.
-.TP 5
-\f(CW?\fR
-Matches any single character in string.
-.TP 5
-\f(CW[\fIchars\f(CW]\fR
-Matches any character in the set given by \fIchars\fR. If a sequence of the
-form \fIx\fR-\fIy\fR appears in \fIchars\fR, then any character between
-\fIx\fR and \fIy\fR,
-inclusive, will match.
-.TP 5
-\f(CW\\\fIx\fR
-Matches the single character \fIx\fR. This
-provides a way of avoiding the special
-interpretation of the characters \f(CW*?[]\\\fR in
-the pattern.
-.RE
-.TP 1.25i
-\fB\-regexp\fR
-Use regular expression pattern matching (i.e. the same as implemented
-by the \fBregexp\fR command).
-.TP 1.25i
-\fB\-nonmatching\fR
-Pick entries that don't match.
-.TP 1.25i
-\fB\-exec\fI string\fR
-Specifies a Tcl script to be invoked for each matching node.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.TP 1.25i
-\fB\-count\fI number\fR
-Stop searching after \fInumber\fR matches.
-.TP 1.25i
-\fB\-\-\fR
-Indicates the end of flags.
-.RE
-.TP
-\fIpathName \fBfocus \fR \fItagOrId\fR
-Sets the focus to the node given by \fItagOrId\fR. When a node
-has focus, it can receive keyboard events.
-The special id \fBfocus\fR designates the node that currently has focus.
-.TP
-\fIpathName \fBget \fR?\fB\-full\fR? \fItagOrId\fR \fItagOrId\fR...
-Translates one or more ids to their node entry names. It returns a list of
-names for all the ids specified. If the \fB\-full\fR
-flag is set, then the full pathnames are returned.
-.TP
-\fIpathName \fBhide \fR?\fBflags\fR? \fItagOrId\fR...
-Hides all nodes matching the criteria given by \fIflags\fR. The
-search is performed recursively for each node given by \fItagOrId\fR.
-The valid flags are described below:
-.RS
-.TP 1.25i
-\fB\-name\fI pattern\fR
-Specifies pattern to match against node names.
-.TP 1.25i
-\fB\-full\fI pattern\fR
-Specifies pattern to match against node pathnames.
-.TP 1.25i
-\fB\-\fIoption\fI pattern\fR
-Specifies pattern to match against the node entry's configuration option.
-.TP 1.25i
-\fB\-exact\fR
-Match patterns exactly. The is the default.
-.TP 1.25i
-\fB\-glob\fR
-Use global pattern matching. Matching is done in a fashion
-similar to that used by the C-shell. For the two
-strings to match, their contents must be identical
-except that the following special sequences may
-appear in pattern:
-.RS
-.TP 5
-\f(CW*\fR
-Matches any sequence of characters in
-string, including a null string.
-.TP 5
-\f(CW?\fR
-Matches any single character in string.
-.TP 5
-\f(CW[\fIchars\f(CW]\fR
-Matches any character in the set given by \fIchars\fR. If a sequence of the
-form \fIx\fR-\fIy\fR appears in \fIchars\fR, then any character between
-\fIx\fR and \fIy\fR,
-inclusive, will match.
-.TP 5
-\f(CW\\\fIx\fR
-Matches the single character \fIx\fR. This
-provides a way of avoiding the special
-interpretation of the characters \f(CW*?[]\\\fR in
-the pattern.
-.RE
-.TP 1.25i
-\fB\-regexp\fR
-Use regular expression pattern matching (i.e. the same as implemented
-by the \fBregexp\fR command).
-.TP 1.25i
-\fB\-nonmatching\fR
-Hide nodes that don't match.
-.TP 1.25i
-\fB\-\-\fR
-Indicates the end of flags.
-.RE
-.TP
-\fIpathName \fBindex \fR?\fB\-at\fR \fItagOrId\fR? \fIstring\fR
-Returns the id of the node specified by \fIstring\fR. \fIString\fR
-may be a tag or node id.
-Some special ids are normally relative to the node that
-has focus. The \fB\-at\fR flag lets you select another node.
-.TP
-\fIpathName \fBinsert \fR?\fB\-at \fItagOrId\fR? \fIposition\fR \fIpath\fR ?\fIoptions...\fR? ?\fIpath\fR? ?\fIoptions...\fR?
-Inserts one or more nodes at \fIposition\fR. \fIPosition\fR is the
-location (number or \f(CWend\fR) where the new nodes are added to
-the parent node. \fIPath\fR is the pathname of the new node.
-Pathnames can be formated either as a Tcl list (each element is a path
-component) or as a string separated by a special character sequence
-(using the \fB\-separator\fR option). Pathnames are normally
-absolute, but the \fB\-at\fR switch lets you select a relative
-starting point. Its value is the id of the starting node.
-.sp
-All ancestors of the new node must already exist, unless the
-\fB\-autocreate\fR option is set. It is also an error if a node
-already exists, unless the \fB\-allowduplicates\fR option is set.
-.sp
-\fIOption\fR and \fIvalue\fR may have any of the values accepted by the
-\fBentry configure\fR operation described in the
-.SB "ENTRY OPERATIONS"
-section below. This command returns a list of the ids of
-the new entries.
-.TP
-\fIpathName \fBmove \fItagOrId\fR \fIhow\fR \fIdestId\fR
-Moves the node given by \fItagOrId\fR to the destination node. The
-node can not be an ancestor of the destination. \fIDestId\fR is
-the id of the destination node and can not be the root of the
-tree. In conjunction with \fIhow\fR, it describes how the move is
-performed.
-.RS
-.TP 8
-\f(CWbefore\fR
-Moves the node before the destination node.
-.TP 8
-\f(CWafter\fR
-Moves the node after the destination node.
-.TP 8
-\f(CWinto\fR
-Moves the node to the end of the destination's list of children.
-.RE
-.TP
-\fIpathName \fBnearest \fIx y\fR ?\fIvarName\fR?
-Returns the id of the node entry closest to the given X-Y screen
-coordinate. The optional argument \fIvarName\fR is the name of
-variable which is set to either \f(CWbutton\fR or \f(CWselect\fR to
-indicate over what part of the node the coordinate lies.
-If the coordinate is not directly over any node, then
-\fIvarName\fR will contain the empty string.
-.TP
-\fIpathName \fBopen \fR?\fB\-recurse\fR? \fItagOrId...\fR
-Opens the one or more nodes specified by \fItagOrId\fR.
-If a node is not already open, the Tcl script specified by the
-\fB\-opencommand\fR option is invoked. If the \fB\-recurse\fR flag
-is present, then each descendant is recursively opened.
-.TP
-\fIpathName \fBrange\fR ?\fB-open\fR? \fIfirst last\fR
-Returns the ids in depth-first order of the nodes
-between the \fIfirst\fR and \fIlast\fR ids. If the \fB\-open\fR
-flag is present, it indicates to consider only open nodes.
-If \fIlast\fR is before \fIfirst\fR, then the ids are
-returned in reverse order.
-.TP
-\fIpathName \fBscan\fR \fIoption args\fR
-This command implements scanning. It has
-two forms, depending on \fIoption\fR:
-.RS
-.TP
-\fIpathName \fBscan mark \fIx y\fR
-Records \fIx\fR and \fIy\fR and the current view in the treeview
-window; used in conjunction with later \fBscan dragto\fR commands.
-Typically this command is associated with a mouse button press in
-the widget. It returns an empty string.
-.TP
-\fIpathName \fBscan dragto \fIx y\fR.
-Computes the difference between its \fIx\fR and \fIy\fR
-arguments and the \fIx\fR and \fIy\fR arguments to the last
-\fBscan mark\fR command for the widget.
-It then adjusts the view by 10 times the
-difference in coordinates. This command is typically associated
-with mouse motion events in the widget, to produce the effect of
-dragging the list at high speed through the window. The return
-value is an empty string.
-.RE
-.TP
-\fIpathName \fBsee\fR ?\fB\-anchor \fIanchor\fR? \fItagOrId\fR
-Adjusts the view of entries so that the node given by \fItagOrId\fR is
-visible in the widget window. It is an error if \fBtagOrId\fR is a
-tag that refers to more than one node. By default the node's entry
-is displayed in the middle of the window. This can changed using the
-\fB\-anchor\fR flag. Its value is a Tk anchor position.
-.TP
-\fIpathName \fBselection \fIoption arg\fR
-This command is used to adjust the selection within a \fBtreeview\fR
-widget. It has several forms, depending on \fIoption\fR:
-.RS
-.TP
-\fIpathName \fBselection anchor \fItagOrId\fR
-Sets the selection anchor to the node given by \fItagOrId\fR.
-If \fItagOrId\fR refers to a non-existent node, then the closest
-node is used.
-The selection anchor is the end of the selection that is fixed
-while dragging out a selection with the mouse.
-The special id \fBanchor\fR may be used to refer to the anchor
-node.
-.TP
-\fIpathName \fBselection cancel\fR
-Clears the temporary selection of entries back to the
-current anchor. Temporary selections are created by
-the \fBselection mark\fR operation.
-.TP
-\fIpathName \fBselection clear \fIfirst \fR?\fIlast\fR?
-Removes the entries between \fIfirst\fR and \fIlast\fR
-(inclusive) from the selection. Both \fIfirst\fR and
-\fIlast\fR are ids representing a range of entries.
-If \fIlast\fR isn't given, then only \fIfirst\fR is deselected.
-Entries outside the selection are not affected.
-.TP
-\fIpathName \fBselection clearall\fR
-Clears the entire selection.
-.TP
-\fIpathName \fBselection mark \fItagOrId\fR
-Sets the selection mark to the node given by \fItagOrId\fR. This
-causes the range of entries between the anchor and the mark to be
-temporarily added to the selection. The selection mark is the end of
-the selection that is fixed while dragging out a selection with the
-mouse. The special id \fBmark\fR may be used to refer to the current
-mark node.
-If \fItagOrId\fR refers to a non-existent node, then the mark
-is ignored.
-Resetting the mark will unselect
-the previous range. Setting the anchor finalizes the range.
-.TP
-\fIpathName \fBselection includes \fItagOrId\fR
-Returns 1 if the node given by \fItagOrId\fR is currently
-selected, 0 if it isn't.
-.TP
-\fIpathName \fBselection present\fR
-Returns 1 if any nodes are currently selected and 0 otherwise.
-.TP
-\fIpathName \fBselection set \fIfirst \fR?\fIlast\fR?
-Selects all of the nodes in the range between
-\fIfirst\fR and \fIlast\fR, inclusive, without affecting
-the selection state of nodes outside that range.
-.TP
-\fIpathName \fBselection toggle \fIfirst \fR?\fIlast\fR?
-Selects/deselects nodes in the range between
-\fIfirst\fR and \fIlast\fR, inclusive, from the selection.
-If a node is currently selected, it becomes deselected, and
-visa versa.
-.RE
-.TP
-\fIpathName \fBshow \fR?\fBflags\fR? \fItagOrId\fR...
-Exposes all nodes matching the criteria given by \fIflags\fR. This
-is the inverse of the \fBhide\fR operation. The search is performed
-recursively for each node given by \fItagOrId\fR. The valid flags are
-described below:
-.RS
-.TP 1.25i
-\fB\-name\fI pattern\fR
-Specifies pattern to match against node names.
-.TP 1.25i
-\fB\-full\fI pattern\fR
-Specifies pattern to match against node pathnames.
-.TP 1.25i
-\fB\-\fIoption\fI pattern\fR
-Specifies pattern to match against the entry's configuration option.
-.TP 1.25i
-\fB\-exact\fR
-Match patterns exactly. The is the default.
-.TP 1.25i
-\fB\-glob\fR
-\fB\-glob\fR
-Use global pattern matching. Matching is done in a fashion
-similar to that used by the C-shell. For the two
-strings to match, their contents must be identical
-except that the following special sequences may
-appear in pattern:
-.RS
-.TP 5
-\f(CW*\fR
-Matches any sequence of characters in
-string, including a null string.
-.TP 5
-\f(CW?\fR
-Matches any single character in string.
-.TP 5
-\f(CW[\fIchars\f(CW]\fR
-Matches any character in the set given by \fIchars\fR. If a sequence of the
-form \fIx\fR-\fIy\fR appears in \fIchars\fR, then any character between
-\fIx\fR and \fIy\fR,
-inclusive, will match.
-.TP 5
-\f(CW\\\fIx\fR
-Matches the single character \fIx\fR. This
-provides a way of avoiding the special
-interpretation of the characters \f(CW*?[]\\\fR in
-the pattern.
-.RE
-.TP 1.25i
-\fB\-regexp\fR
-Use regular expression pattern matching (i.e. the same as implemented
-by the \fBregexp\fR command).
-.TP 1.25i
-\fB\-nonmatching\fR
-Expose nodes that don't match.
-.TP 1.25i
-\fB\-\-\fR
-Indicates the end of flags.
-.RE
-.TP
-\fIpathName \fBsort\fR ?\fIoperation\fR? \fIargs...\fR
-.RS
-.TP
-\fIpathName \fBsort auto\fR ?\fIboolean\fR
-Turns on/off automatic sorting of node entries. If \fIboolean\fR is
-true, entries will be automatically sorted as they are opened,
-closed, inserted, or deleted. If no \fIboolean\fR argument is
-provided, the current state is returned.
-.TP
-\fIpathName \fBsort cget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBsort configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the sorting configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given sorting option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described below:
-.RS
-.TP
-\fB\-column\fI string\fR
-Specifies the column to sort. Entries in the widget are rearranged
-according to this column. If \fIcolumn\fR is \f(CW""\fR then
-no sort is performed.
-.TP
-\fB\-command\fI string\fR
-Specifies a Tcl procedure to be called when sorting nodes.
-The procedure is called with three arguments: the pathname of the widget
-and the fields of two entries. The procedure returns 1 if the first
-node is greater than the second, -1 is the second is greater, and 0
-if equal.
-.TP
-\fB\-decreasing\fI boolean\fR
-Indicates to sort in ascending/descending order. If \fIboolean\fR
-is true, then the entries as in descending order. The default is
-\f(CWno\fR.
-.TP
-\fB\-mode\fI string\fR
-Specifies how to compare entries when sorting. \fIString\fR
-may be one of the following:
-.RS
-.TP 1.5i
-\f(CWascii\fR
-Use string comparison based upon the ASCII collation order.
-.TP 1.5i
-\f(CWdictionary\fR
-Use dictionary-style comparison. This is the same as \f(CWascii\fR
-except (a) case is ignored except as a tie-breaker and (b) if two
-strings contain embedded numbers, the numbers compare as integers, not
-characters. For example, "bigBoy" sorts between
-"bigbang" and "bigboy", and "x10y" sorts between "x9y" and "x11y".
-.TP 1.5i
-\f(CWinteger\fR
-Compares fields as integers.
-.TP 1.5i
-\f(CWreal\fR
-Compares fields as floating point numbers.
-.TP 1.5i
-\f(CWcommand\fR
-Use the Tcl proc specified by the \fB\-command\fR option to compare entries
-when sorting. If no command is specified, the sort reverts to
-\f(CWascii\fR sorting.
-.RE
-.RE
-.TP
-\fIpathName \fBsort once\fR ?\fIflags\fR? \fItagOrId...\fR
-Sorts the children for each entries specified by \fItagOrId\fR.
-By default, entries are sorted by name, but you can specify a
-Tcl proc to do your own comparisons.
-.RS
-.TP 1.5i
-\fB\-recurse\fR
-Recursively sort the entire branch, not just the children.
-.RE
-.RE
-.TP
-\fIpathName \fBtag \fIoperation args\fR
-Tags are a general means of selecting and marking nodes in the tree.
-A tag is just a string of characters, and it may take any form except
-that of an integer. The same tag may be associated with many
-different nodes.
-.sp
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for tags are listed below.
-.RS
-.TP
-\fIpathName\fR \fBtag add\fR \fIstring\fR \fIid\fR...
-Adds the tag \fIstring\fR to one of more entries.
-.TP
-\fIpathName\fR \fBtag delete\fR \fIstring\fR \fIid\fR...
-Deletes the tag \fIstring\fR from one or more entries.
-.TP
-\fIpathName\fR \fBtag forget\fR \fIstring\fR
-Removes the tag \fIstring\fR from all entries. It's not an error if no
-entries are tagged as \fIstring\fR.
-.TP
-\fIpathName\fR \fBtag names\fR ?\fIid\fR?
-Returns a list of tags used. If an \fIid\fR argument
-is present, only those tags used by the node designated by \fIid\fR
-are returned.
-.TP
-\fIpathName\fR \fBtag nodes\fR \fIstring\fR
-Returns a list of ids that have the tag \fIstring\fR. If no node
-is tagged as \fIstring\fR, then an empty string is returned.
-.RE
-.TP
-\fIpathName \fBtext \fIoperation\fR ?\fIargs\fR?
-This operation is used to provide text editing for cells (data
-fields in a column) or entry labels.
-It has several forms, depending on \fIoperation\fR:
-.RS
-.TP
-\fIpathName \fBtext apply\fR
-Applies the edited buffer, replacing the entry label
-or data field. The edit window is hidden.
-.TP
-\fIpathName \fBtext cancel\fR
-Cancels the editing operation, reverting the entry label
-or data value back to the previous value. The edit window is hidden.
-.TP
-\fIpathName \fBtext cget\fI value\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBtext configure\fR ?\fIoption value\fR?
-Query or modify the configuration options of the edit window.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "TEXT EDITING OPTIONS"
-below.
-.RE
-.TP
-\fIpathName \fBtext delete\fI first last\fR
-Deletes the characters in the edit buffer between the two given
-character positions.
-.TP
-\fIpathName \fBtext get\fR ?\fI\-root\fR? \fIx y\fR
-.TP
-\fIpathName \fBtext icursor\fI index\fR
-.TP
-\fIpathName \fBtext index\fI index\fR
-Returns the text index of given \fIindex\fR.
-.TP
-\fIpathName \fBtext insert\fI index string\fR
-Insert the text string \fIstring\fR into the edit buffer at the index
-\fIindex\fR. For example, the index 0 will prepend the buffer.
-.TP
-\fIpathName \fBtext selection\fI args\fR
-This operation controls the selection of the editing window. Note
-that this differs from the selection of entries.
-It has the following forms:
-.RS
-.TP
-\fIpathName \fBtext selection adjust\fI index\fR
-Adjusts either the first or last index of the selection.
-.TP
-\fIpathName \fBtext selection clear\fR
-Clears the selection.
-.TP
-\fIpathName \fBtext selection from\fI index\fR
-Sets the anchor of the selection.
-.TP
-\fIpathName \fBtext selection present\fR
-Indicates if a selection is present.
-.TP
-\fIpathName \fBtext selection range\fI start end\fR
-Sets both the anchor and mark of the selection.
-.TP
-\fIpathName \fBtext selection to\fI index\fR
-Sets the unanchored end (mark) of the selection.
-.RE
-.TP
-\fIpathName \fBtoggle \fItagOrId\fR
-Opens or closes the node given by \fItagOrId\fR. If the corresponding
-\fB\-opencommand\fR or \fB\-closecommand\fR option is set, then that
-command is also invoked.
-.TP
-\fIpathName \fBxview \fIargs\fR
-This command is used to query and change the horizontal position of the
-information in the widget's window. It can take any of the following
-forms:
-.RS
-.TP
-\fIpathName \fBxview\fR
-Returns a list containing two elements.
-Each element is a real fraction between 0 and 1; together they describe
-the horizontal span that is visible in the window.
-For example, if the first element is .2 and the second element is .6,
-20% of the \fBtreeview\fR widget's text is off-screen to the left,
-the middle 40% is visible
-in the window, and 40% of the text is off-screen to the right.
-These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
-option.
-.TP
-\fIpathName \fBxview\fR \fItagOrId\fR
-Adjusts the view in the window so that the character position given by
-\fItagOrId\fR is displayed at the left edge of the window.
-Character positions are defined by the width of the character \fB0\fR.
-.TP
-\fIpathName \fBxview moveto\fI fraction\fR
-Adjusts the view in the window so that \fIfraction\fR of the
-total width of the \fBtreeview\fR widget's text is off-screen to the left.
-\fIfraction\fR must be a fraction between 0 and 1.
-.TP
-\fIpathName \fBxview scroll \fInumber what\fR
-This command shifts the view in the window left or right according to
-\fInumber\fR and \fIwhat\fR.
-\fINumber\fR must be an integer.
-\fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviation
-of one of these.
-If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
-\fInumber\fR character units (the width of the \fB0\fR character)
-on the display; if it is \fBpages\fR then the view adjusts by
-\fInumber\fR screenfuls.
-If \fInumber\fR is negative then characters farther to the left
-become visible; if it is positive then characters farther to the right
-become visible.
-.RE
-.TP
-\fIpathName \fByview \fI?args\fR?
-This command is used to query and change the vertical position of the
-text in the widget's window.
-It can take any of the following forms:
-.RS
-.TP
-\fIpathName \fByview\fR
-Returns a list containing two elements, both of which are real fractions
-between 0 and 1.
-The first element gives the position of the node at the
-top of the window, relative to the widget as a whole (0.5 means
-it is halfway through the treeview window, for example).
-The second element gives the position of the node just after
-the last one in the window, relative to the widget as a whole.
-These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR
-option.
-.TP
-\fIpathName \fByview\fR \fItagOrId\fR
-Adjusts the view in the window so that the node given by
-\fItagOrId\fR is displayed at the top of the window.
-.TP
-\fIpathName \fByview moveto\fI fraction\fR
-Adjusts the view in the window so that the node given by \fIfraction\fR
-appears at the top of the window.
-\fIFraction\fR is a fraction between 0 and 1; 0 indicates the first
-node, 0.33 indicates the node one-third the
-way through the \fBtreeview\fR widget, and so on.
-.TP
-\fIpathName \fByview scroll \fInumber what\fR
-This command adjusts the view in the window up or down according to
-\fInumber\fR and \fIwhat\fR.
-\fINumber\fR must be an integer.
-\fIWhat\fR must be either \fBunits\fR or \fBpages\fR.
-If \fIwhat\fR is \fBunits\fR, the view adjusts up or down by
-\fInumber\fR lines; if it is \fBpages\fR then
-the view adjusts by \fInumber\fR screenfuls.
-If \fInumber\fR is negative then earlier nodes
-become visible; if it is positive then later nodes
-become visible.
-.RE
-.SH "TREEVIEW OPTIONS"
-In addition to the \fBconfigure\fR operation, widget configuration
-options may also be set by the Tk \fBoption\fR command. The class
-resource name is \f(CWTreeView\fR.
-.CS
-option add *TreeView.Foreground white
-option add *TreeView.Background blue
-.CE
-The following widget options are available:
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the background color for active entries. A node
-is active when the mouse passes over it's entry or using the
-\fBactivate\fR operation.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the foreground color of the active node. A node
-is active when the mouse passes over it's entry or using the
-\fBactivate\fR operation.
-.TP
-\fB\-activeicons \fIimages\fR
-Specifies images to be displayed for an entry's icon
-when it is active. \fIImages\fR is a list of two Tk images:
-the first image is displayed when the node is open, the
-second when it is closed.
-.TP
-\fB\-autocreate \fIboolean\fR
-If \fIboolean\fR is true, automatically create missing ancestor
-nodes when inserting new nodes. Otherwise flag an error.
-The default is \f(CWno\fR.
-.TP
-\fB\-allowduplicates \fIboolean\fR
-If \fIboolean\fR is true, allow nodes with duplicate pathnames
-when inserting new nodes. Otherwise flag an error.
-The default is \f(CWno\fR.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the widget. The default is \f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the outside edge of the widget. The
-\fB\-relief\fR option determines if the border is to be drawn. The
-default is \f(CW2\fR.
-.TP
-\fB\-closecommand \fIstring\fR
-Specifies a Tcl script to be invoked when a node is closed. You can
-overrider this for individual entries using the entry's \fB\-closecommand\fR
-option. The default is \f(CW""\fR.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.TP
-\fB\-cursor \fIcursor\fR
-Specifies the widget's cursor. The default cursor is \f(CW""\fR.
-.TP
-\fB\-dashes \fInumber\fR
-Sets the dash style of the horizontal and vertical lines drawn connecting
-entries. \fINumber\fR is the length in pixels of the dashes and gaps in
-the line. If \fInumber\fR is \f(CW0\fR, solid lines will
-be drawn. The default is \f(CW1\fR (dotted).
-.TP
-\fB\-exportselection \fIboolean\fR
-Indicates if the selection is exported. If the widget is exporting its
-selection then it will observe the standard X11 protocols for handling
-the selection. Selections are available as type \fBSTRING\fR;
-the value of the selection will be the label of the selected nodes,
-separated by newlines. The default is \f(CWno\fR.
-.TP
-\fB\-flat \fIboolean\fR
-Indicates whether to display the tree as a flattened list.
-If \fIboolean\fR is true, then the hierarchy will be a list of full
-paths for the nodes. This option also has affect on sorting.
-See the
-.SB "SORT OPERATIONS"
-section for more information.
-The default is \f(CWno\fR.
-.TP
-\fB\-focusdashes \fIdashList\fR
-Sets the dash style of the outline rectangle drawn around the entry
-label of the node that current has focus. \fINumber\fR is the length
-in pixels of the dashes and gaps in the line. If
-\fInumber\fR is \f(CW0\fR, a solid line will be drawn. The default is
-\f(CW1\fR.
-.TP
-\fB\-focusforeground \fIcolor\fR
-Sets the color of the focus rectangle.
-The default is \f(CWblack\fR.
-.TP
-\fB\-font \fIfontName\fR
-Specifies the font for entry labels. You can override this for individual
-entries with the entry's \fB\-font\fR configuration option. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the text color of entry labels. You can override this for individual
-entries with the entry's \fB\-foreground\fR configuration option.
-The default is
-\f(CWblack\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the requested height of widget. The default is
-\f(CW400\fR.
-.TP
-\fB\-hideroot \fIboolean\fR
-If \fIboolean\fR is true, it indicates that no entry for the root node
-should be displayed. The default is \f(CWno\fR.
-.TP
-\fB\-highlightbackground \fIcolor\fR
-Specifies the normal color of the traversal highlight region when
-the widget does not have the input focus.
-.TP
-\fB\-highlightcolor \fIcolor\fR
-Specifies the color of the traversal highlight rectangle when
-the widget has the input focus.
-The default is \f(CWblack\fR.
-.TP
-\fB\-highlightthickness \fIpixels\fR
-Specifies the width of the highlight rectangle indicating when the
-widget has input focus. The value may have any of the forms acceptable
-to \fBTk_GetPixels\fR. If the value is zero, no focus highlight will
-be displayed. The default is \f(CW2\fR.
-.TP
-\fB\-icons \fIimages\fR
-Specifies images for the entry's icon.
-\fIImages\fR is a list of two Tk images:
-the first image is displayed when the node is open, the
-second when it is closed.
-.TP
-\fB\-linecolor \fIcolor\fR
-Sets the color of the connecting lines drawn between entries.
-The default is \f(CWblack\fR.
-.TP
-\fB\-linespacing \fIpixels\fR
-Sets the number of pixels spacing between entries.
-The default is \f(CW0\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Set the width of the lines drawn connecting entries. If \fIpixels\fR
-is \f(CW0\fR, no vertical or horizontal lines are drawn.
-The default is \f(CW1\fR.
-.TP
-\fB\-opencommand \fIstring\fR
-Specifies a Tcl script to be invoked when a node is open.
-You can override this for individual entries with the entry's
-\fB\-opencommand\fR configuration option. The default is \f(CW""\fR.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for the widget. \fIRelief\fR
-specifies how the \fBtreeview\fR widget should appear relative to widget
-it is packed into; for example, \f(CWraised\fR means the \fBtreeview\fR widget
-should appear to protrude. The default is \f(CWsunken\fR.
-.TP
-\fB\-scrollmode \fImode\fR
-Specifies the style of scrolling to be used. The following
-styles are valid. This is the default is \f(CWhierbox\fR.
-.RS
-.TP 1.25i
-\f(CWlistbox\fR
-Like the \fBlistbox\fR widget, the last entry can always be
-scrolled to the top of the widget window. This allows the scrollbar
-thumb to shrink as the last entry is scrolled upward.
-.TP 1.25i
-\f(CWhierbox\fR
-Like the \fBhierbox\fR widget, the last entry can only be
-viewed at the bottom of the widget window. The scrollbar
-stays a constant size.
-.TP 1.25i
-\f(CWcanvas\fR
-Like the \fBcanvas\fR widget, the entries are bound within
-the scrolling area.
-.RE
-.TP
-\fB\-selectbackground \fIcolor\fR
-Sets the background color selected node entries.
-The default is \f(CW#ffffea\fR.
-.TP
-\fB\-selectborderwidth \fIpixels\fR
-Sets the width of the raised 3-D border drawn around the labels
-of selected entries. The default is \f(CW0\fR.
-\fB\-selectcommand \fIstring\fR
-Specifies a Tcl script to invoked when the set of selected
-nodes changes.
-The default is \f(CW""\fR.
-.TP
-\fB\-selectforeground \fIcolor\fB
-Sets the color of the labels of selected node entries.
-The default is \f(CWblack\fR.
-.TP
-\fB\-selectmode \fImode\fR
-Specifies the selection mode. If \fImode\fR is
-\f(CWsingle\fR, only one node can be selected
-at a time. If \f(CWmultiple\fR more than one
-node can be selected.
-The default is \f(CWsingle\fR.
-.TP
-\fB\-separator \fIstring\fR
-Specifies the character sequence to use when spliting the path components.
-The separator may be several characters wide (such as "::")
-Consecutive separators in a pathname are treated as one.
-If \fIstring\fR is the empty string, the pathnames are Tcl lists.
-Each element is a path component. The default is \f(CW""\fR.
-.TP
-\fB\-showtitles \fIboolean\fR
-If \fIboolean\fR is false, column titles are not be displayed.
-The default is \f(CWyes\fR.
-.TP
-\fB\-sortselection \fIboolean\fR
-If \fIboolean\fR is true, nodes in the selection are ordered as they
-are currently displayed (depth-first or sorted), not in the order
-they were selected. The default is \f(CWno\fR.
-.TP
-\fB\-takefocus\fR \fIfocus\fR
-Provides information used when moving the focus from window to window
-via keyboard traversal (e.g., Tab and Shift-Tab). If \fIfocus\fR is
-\f(CW0\fR, this means that this window should be skipped entirely during
-keyboard traversal. \f(CW1\fR means that the this window should always
-receive the input focus. An empty value means that the traversal
-scripts make the decision whether to focus on the window.
-The default is \f(CW"1"\fR.
-.TP
-\fB\-trim \fIstring\fR
-Specifies a string leading characters to trim from entry pathnames
-before parsing. This only makes sense if the \fB\-separator\fR is also
-set. The default is \f(CW""\fR.
-.TP
-\fB\-width \fIpixels\fR
-Sets the requested width of the widget. If \fIpixels\fR is 0, then
-the with is computed from the contents of the \fBtreeview\fR widget.
-The default is \f(CW200\fR.
-.TP
-\fB\-xscrollcommand \fIstring\fR
-Specifies the prefix for a command used to communicate with horizontal
-scrollbars. Whenever the horizontal view in the widget's window
-changes, the widget will generate a Tcl command by concatenating the
-scroll command and two numbers. If this option is not specified, then
-no command will be executed.
-.TP
-\fB\-xscrollincrement\fR \fIpixels\fR
-Sets the horizontal scrolling distance. The default is 20 pixels.
-.TP
-\fB\-yscrollcommand \fIstring\fR
-Specifies the prefix for a command used to communicate with vertical
-scrollbars. Whenever the vertical view in the widget's window
-changes, the widget will generate a Tcl command by concatenating the
-scroll command and two numbers. If this option is not specified, then
-no command will be executed.
-.TP
-\fB\-yscrollincrement\fR \fIpixels\fR
-Sets the vertical scrolling distance. The default is 20 pixels.
-.SH "ENTRY OPTIONS"
-Many widget configuration options have counterparts in entries. For
-example, there is a \fB\-closecommand\fR configuration option for both
-widget itself and for individual entries. Options set at the widget
-level are global for all entries. If the entry configuration option
-is set, then it overrides the widget option. This is done to avoid
-wasting memory by replicated options. Most entries will have
-redundant options.
-.PP
-There is no resource class or name for entries.
-.TP
-\fB\-activeicons \fIimages\fR
-Specifies images to be displayed as the entry's icon
-when it is active. This overrides the global \fB\-activeicons\fR
-configuration option for the specific entry.
-\fIImages\fR is a list of two Tk images:
-the first image is displayed when the node is open, the
-second when it is closed.
-.TP
-\fB\-bindtags \fItagList\fR
-Specifies the binding tags for nodes. \fITagList\fR is a list
-of binding tag names. The tags and their order will determine how
-events are handled for nodes. Each tag in the list matching the current
-event sequence will have its Tcl command executed. The default value
-is \f(CWall\fR.
-.TP
-\fB\-button \fIstring\fR
-Indicates whether a button should be displayed on the left side
-of the node entry. \fIString\fR can be \f(CWyes\fR, \f(CWno\fR,
-or \f(CWauto\fR. If \f(CWauto\fR, then a button is automatically
-displayed if the node has children. This is the default.
-.TP
-\fB\-closecommand \fIstring\fR
-Specifies a Tcl script to be invoked when the node is closed. This
-overrides the global \fB\-closecommand\fR option for this entry.
-The default is \f(CW""\fR.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.TP
-\fB\-data \fIstring\fR
-Sets data fields for the node. \fIString\fR is a list of
-name-value pairs to be set. The default is \f(CW""\fR.
-.TP
-\fB\-font \fIfontName\fR
-Sets the font for entry labels. This overrides the widget's
-\fB\-font\fR option for this node. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the text color of the entry label. This overrides the widget's
-\fB\-foreground\fR configuration option. The default is \f(CW""\fR.
-.TP
-\fB\-icons \fIimages\fR
-Specifies images to be displayed for the entry's icon.
-This overrides the global \fB\-icons\fR configuration option.
-\fIImages\fR is a list of two Tk images:
-the first image is displayed when the node is open, the
-second when it is closed.
-.TP
-\fB\-label \fIstring\fR
-Sets the text for the entry's label. If not set, this
-defaults to the name of the node. The default is \f(CW""\fR.
-.TP
-\fB\-opencommand \fIstring\fR
-Specifies a Tcl script to be invoked when the entry is opened.
-This overrides the widget's \fB\-opencommand\fR option for this node.
-The default is \f(CW""\fR.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.SH "BUTTON OPTIONS"
-Button configuration options may also be set by the \fBoption\fR command.
-The resource subclass is \f(CWButton\fR. The resource name is always
-\f(CWbutton\fR.
-.CS
-option add *TreeView.Button.Foreground white
-option add *TreeView.button.Background blue
-.CE
-The following are the configuration options available for buttons.
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the background color of active buttons. A button
-is made active when the mouse passes over it or by the
-\fBbutton activate\fR operation.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the foreground color of active buttons. A button
-is made active when the mouse passes over it or by the
-\fBbutton activate\fR operation.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background of the button. The default is \f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the button.
-The \fB\-relief\fR option determines if a border is to be drawn. The
-default is \f(CW1\fR.
-.TP
-\fB\-closerelief \fIrelief\fR
-Specifies the 3-D effect for the closed button. \fIRelief\fR
-indicates how the button should appear relative to the widget;
-for example, \f(CWraised\fR means the button should
-appear to protrude. The default is \f(CWsolid\fR.
-.TP
-\fB\-cursor \fIcursor\fR
-Sets the widget's cursor. The default cursor is \f(CW""\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the foreground color of buttons.
-The default is \f(CWblack\fR.
-.TP
-\fB\-images \fIimages\fR
-Specifies images to be displayed for the button.
-\fIImages\fR is a list of two Tk images:
-the first image is displayed when the button is open, the
-second when it is closed. If the \fIimages\fR is the empty string,
-then a plus/minus gadget is drawn. The default is \f(CW""\fR.
-.TP
-\fB\-openrelief \fIrelief\fR
-Specifies the 3-D effect of the open button. \fIRelief\fR
-indicates how the button should appear relative to the widget;
-for example, \f(CWraised\fR means the button should
-appear to protrude. The default is \f(CWflat\fR.
-.TP
-\fB\-size \fIpixels\fR
-Sets the requested size of the button.
-The default is \f(CW0\fR.
-.RE
-.SH "COLUMN OPTIONS"
-Column configuration options may also be set by the \fBoption\fR command.
-The resource subclass is \f(CWColumn\fR. The resource name is the
-name of the column.
-.CS
-option add *TreeView.Column.Foreground white
-option add *TreeView.treeView.Background blue
-.CE
-The following configuration options are available for columns.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the column. This overrides
-the widget's \fB\-background\fR option. The default is \f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border of the column.
-The \fB\-relief\fR option determines if a border is to be drawn. The
-default is \f(CW0\fR.
-.TP
-\fB\-edit \fIboolean\fR
-Indicates if the column's data fields can be edited. If \fIboolean\fR is
-false, the data fields in the column may not be edited.
-The default is \f(CWyes\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Specifies the foreground color of the column.
-You can override this for individual entries with the entry's
-\fB\-foreground\fR option.
-The default is \f(CWblack\fR.
-.TP
-\fB\-font \fIfontName\fR
-Sets the font for a column. You can override this for individual entries
-with the entry's \fB\-font\fR option. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-hide \fIboolean\fR
-If \fIboolean\fR is true, the column is not displayed.
-The default is \f(CWyes\fR.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the column data fields title should be justified within
-the column. This matters only when the column is wider than the
-data field to be display.
-\fIJustify\fR must be \f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR.
-The default is \f(CWleft\fR.
-.TP
-\fB\-pad \fIpad\fR
-Specifies how much padding for the left and right sides of the column.
-\fIPad\fR is a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the column is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default is \f(CW2\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect of the column. \fIRelief\fR
-specifies how the column should appear relative to the widget;
-for example, \f(CWraised\fR means the column should
-appear to protrude. The default is \f(CWflat\fR.
-.TP
-\fB\-state \fIstate\fR
-Sets the state of the column. If \fIstate\fR is \f(CWdisable\fR then
-the column title can not be activated nor invoked.
-The default is \f(CWnormal\fR.
-.TP
-\fB\-text \fIstring\fR
-Sets the title for the column.
-The default is \f(CW""\fR.
-.TP
-\fB\-titleforeground \fIcolor\fR
-Sets the foreground color of the column title.
-The default is \f(CWblack\fR.
-.TP
-\fB\-titleshadow \fIcolor\fR
-Sets the color of the drop shadow of the column title.
-The default is \f(CW""\fR.
-.TP
-\fB\-width \fIpixels\fR
-Sets the requested width of the column. This overrides
-the computed with of the column. If \fIpixels\fR is 0,
-the width is computed as from the contents of the column. The
-default is \f(CW0\fR.
-.RE
-.SH "TEXT EDITING OPTIONS"
-Text edit window configuration options may also be set by the
-\fBoption\fR command. The resource class is \f(CWTreeViewEditor\fR.
-The resource name is always \f(CWedit\fR.
-.CS
-option add *TreeViewEditor.Foreground white
-option add *edit.Background blue
-.CE
-The following are the configuration options available for the
-text editing window.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background of the text edit window. The default is \f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the edit window.
-The \fB\-relief\fR option determines if a border is to be drawn. The
-default is \f(CW1\fR.
-.TP
-\fB\-exportselection \fIboolean\fR
-Indicates if the text selection is exported. If the edit window is
-exporting its selection then it will observe the standard X11 protocols
-for handling the selection. Selections are available as type \fBSTRING\fR.
-The default is \f(CWno\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect of the edit window. \fIRelief\fR
-indicates how the background should appear relative to the edit
-window; for example, \f(CWraised\fR means the background should
-appear to protrude. The default is \f(CWsolid\fR.
-.TP
-\fB\-selectbackground \fIcolor\fR
-Sets the background of the selected text in the edit window.
-The default is \f(CWwhite\fR.
-.TP
-\fB\-selectborderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the selected text in the
-edit window. The \fB\-selectrelief\fR option determines if a border
-is to be drawn. The default is \f(CW1\fR.
-.TP
-\fB\-selectforeground \fIcolor\fR
-Sets the foreground of the selected text in the edit window.
-The default is \f(CWwhite\fR.
-.TP
-\fB\-selectrelief \fIrelief\fR
-Specifies the 3-D effect of the selected text in the edit window.
-\fIRelief\fR indicates how the text should appear relative to the edit
-window; for example, \f(CWraised\fR means the text should
-appear to protrude. The default is \f(CWflat\fR.
-.RE
-.SH "DEFAULT BINDINGS"
-Tk automatically creates class bindings for treeviews that give them
-Motif-like behavior. Much of the behavior of a \fBtreeview\fR widget is determined
-by its \fB\-selectmode\fR option, which selects one of two ways
-of dealing with the selection.
-.PP
-If the selection mode is \fBsingle\fR, only one node can be
-selected at a time.
-Clicking button 1 on an node selects
-it and deselects any other selected item.
-.PP
-If the selection mode is \fBmultiple\fR,
-any number of entries may be selected at once, including discontiguous
-ranges. Clicking Control-Button-1 on a node entry
-toggles its selection state without affecting any other entries.
-Pressing Shift-Button-1 on a node entry selects
-it, extends the selection.
-.IP [1]
-In \fBextended\fR mode, the selected range can be adjusted by pressing
-button 1 with the Shift key down: this modifies the selection to
-consist of the entries between the anchor and the entry under
-the mouse, inclusive.
-The un-anchored end of this new selection can also be dragged with
-the button down.
-.IP [2]
-In \fBextended\fR mode, pressing button 1 with the Control key down
-starts a toggle operation: the anchor is set to the entry under
-the mouse, and its selection state is reversed. The selection state
-of other entries isn't changed.
-If the mouse is dragged with button 1 down, then the selection state
-of all entries between the anchor and the entry under the mouse
-is set to match that of the anchor entry; the selection state of
-all other entries remains what it was before the toggle operation
-began.
-.IP [3]
-If the mouse leaves the treeview window with button 1 down, the window
-scrolls away from the mouse, making information visible that used
-to be off-screen on the side of the mouse.
-The scrolling continues until the mouse re-enters the window, the
-button is released, or the end of the hierarchy is reached.
-.IP [4]
-Mouse button 2 may be used for scanning.
-If it is pressed and dragged over the \fBtreeview\fR widget, the contents of
-the hierarchy drag at high speed in the direction the mouse moves.
-.IP [5]
-If the Up or Down key is pressed, the location cursor (active
-entry) moves up or down one entry.
-If the selection mode is \fBbrowse\fR or \fBextended\fR then the
-new active entry is also selected and all other entries are
-deselected.
-In \fBextended\fR mode the new active entry becomes the
-selection anchor.
-.IP [6]
-In \fBextended\fR mode, Shift-Up and Shift-Down move the location
-cursor (active entry) up or down one entry and also extend
-the selection to that entry in a fashion similar to dragging
-with mouse button 1.
-.IP [7]
-The Left and Right keys scroll the \fBtreeview\fR widget view left and right
-by the width of the character \fB0\fR.
-Control-Left and Control-Right scroll the \fBtreeview\fR widget view left and
-right by the width of the window.
-Control-Prior and Control-Next also scroll left and right by
-the width of the window.
-.IP [8]
-The Prior and Next keys scroll the \fBtreeview\fR widget view up and down
-by one page (the height of the window).
-.IP [9]
-The Home and End keys scroll the \fBtreeview\fR widget horizontally to
-the left and right edges, respectively.
-.IP [10]
-Control-Home sets the location cursor to the the first entry,
-selects that entry, and deselects everything else
-in the widget.
-.IP [11]
-Control-End sets the location cursor to the the last entry,
-selects that entry, and deselects everything else
-in the widget.
-.IP [12]
-In \fBextended\fR mode, Control-Shift-Home extends the selection
-to the first entry and Control-Shift-End extends
-the selection to the last entry.
-.IP [13]
-In \fBmultiple\fR mode, Control-Shift-Home moves the location cursor
-to the first entry and Control-Shift-End moves
-the location cursor to the last entry.
-.IP [14]
-The space and Select keys make a selection at the location cursor
-(active entry) just as if mouse button 1 had been pressed over
-this entry.
-.IP [15]
-In \fBextended\fR mode, Control-Shift-space and Shift-Select
-extend the selection to the active entry just as if button 1
-had been pressed with the Shift key down.
-.IP [16]
-In \fBextended\fR mode, the Escape key cancels the most recent
-selection and restores all the entries in the selected range
-to their previous selection state.
-.IP [17]
-Control-slash selects everything in the widget, except in
-\fBsingle\fR and \fBbrowse\fR modes, in which case it selects
-the active entry and deselects everything else.
-.IP [18]
-Control-backslash deselects everything in the widget, except in
-\fBbrowse\fR mode where it has no effect.
-.IP [19]
-The F16 key (labelled Copy on many Sun workstations) or Meta-w
-copies the selection in the widget to the clipboard, if there is
-a selection.
-.PP
-The behavior of \fBtreeview\fR widgets can be changed by defining new bindings
-for individual widgets or by redefining the class bindings.
-.SS WIDGET BINDINGS
-In addition to the above behavior, the following additional behavior
-is defined by the default widget class (TreeView) bindings.
-.IP \f(CW<ButtonPress-2>\fR
-Starts scanning.
-.IP \f(CW<B2-Motion>\fR
-Adjusts the scan.
-.IP \f(CW<ButtonRelease-2>\fR
-Stops scanning.
-.IP \f(CW<B1-Leave>\fR
-Starts auto-scrolling.
-.IP \f(CW<B1-Enter>\fR
-Starts auto-scrolling
-.IP \f(CW<KeyPress-Up>\fR
-Moves the focus to the previous entry.
-.IP \f(CW<KeyPress-Down>\fR
-Moves the focus to the next entry.
-.IP \f(CW<Shift-KeyPress-Up>\fR
-Moves the focus to the previous sibling.
-.IP \f(CW<Shift-KeyPress-Down>\fR
-Moves the focus to the next sibling.
-.IP \f(CW<KeyPress-Prior>\fR
-Moves the focus to first entry. Closed or hidden entries
-are ignored.
-.IP \f(CW<KeyPress-Next>\fR
-Move the focus to the last entry. Closed or hidden entries
-are ignored.
-.IP \f(CW<KeyPress-Left>\fR
-Closes the entry. It is not an error if the entry has no children.
-.IP \f(CW<KeyPress-Right>\fR
-Opens the entry, displaying its children. It is not an
-error if the entry has no children.
-.IP \f(CW<KeyPress-space>\fR
-In "single" select mode this selects the entry. In "multiple" mode,
-it toggles the entry (if it was previous selected, it is not
-deselected).
-.IP \f(CW<KeyRelease-space>\fR
-Turns off select mode.
-.IP \f(CW<KeyPress-Return>\fR
-Sets the focus to the current entry.
-.IP \f(CW<KeyRelease-Return>\fR
-Turns off select mode.
-.IP \f(CW<KeyPress>\fR
-Moves to the next entry whose label starts with the letter typed.
-.IP \f(CW<KeyPress-Home>\fR
-Moves the focus to first entry. Closed or hidden entries
-are ignored.
-.IP \f(CW<KeyPress-End>\fR
-Move the focus to the last entry. Closed or hidden entries
-are ignored.
-.IP \f(CW<KeyPress-F1>\fR
-Opens all entries.
-.IP \f(CW<KeyPress-F2>\fR
-Closes all entries (except root).
-.SS BUTTON BINDINGS
-Buttons have bindings. There are associated with the "all" bindtag
-(see the entry's -bindtag option). You can use the \fBbind\fR
-operation to change them.
-.IP \f(CW<Enter>\fR
-Highlights the button of the current entry.
-.IP \f(CW<Leave>\fR
-Returns the button back to its normal state.
-.IP \f(CW<ButtonRelease-1>\fR
-Adjust the view so that the current entry is visible.
-.SS ENTRY BINDINGS
-Entries have default bindings. There are associated with the "all"
-bindtag (see the entry's -bindtag option). You can use the \fBbind\fR
-operation to modify them.
-.IP \f(CW<Enter>\fR
-Highlights the current entry.
-.IP \f(CW<Leave>\fR
-Returns the entry back to its normal state.
-.IP \f(CW<ButtonPress-1>\fR
-Sets the selection anchor the current entry.
-.IP \f(CW<Double-ButtonPress-1>\fR
-Toggles the selection of the current entry.
-.IP \f(CW<B1-Motion>\fR
-For "multiple" mode only. Saves the current location of the
-pointer for auto-scrolling. Resets the selection mark.
-.IP \f(CW<ButtonRelease-1>\fR
-For "multiple" mode only. Sets the selection anchor to the
-current entry.
-.IP \f(CW<Shift-ButtonPress-1>\fR
-For "multiple" mode only. Extends the selection.
-.IP \f(CW<Shift-Double-ButtonPress-1>\fR
-Place holder. Does nothing.
-.IP \f(CW<Shift-B1-Motion>\fR
-Place holder. Does nothing.
-.IP \f(CW<Shift-ButtonRelease-1>\fR
-Stop auto-scrolling.
-.IP \f(CW<Control-ButtonPress-1>\fR
-For "multiple" mode only. Toggles and extends the selection.
-.IP \f(CW<Control-Double-ButtonPress-1>\fR
-Place holder. Does nothing.
-.IP \f(CW<Control-B1-Motion>\fR
-Place holder. Does nothing.
-.IP \f(CW<Control-ButtonRelease-1>\fR
-Stops auto-scrolling.
-.IP \f(CW<Control-Shift-ButtonPress-1>\fR
-???
-.IP \f(CW<Control-Shift-Double-ButtonPress-1>\fR
-Place holder. Does nothing.
-.IP \f(CW<Control-Shift-B1-Motion>\fR
-Place holder. Does nothing.
-.SS COLUMN BINDINGS
-Columns have bindings too. They are associated with the column's
-"all" bindtag (see the column -bindtag option). You can use the
-\fBcolumn bind\fR operation to change them.
-.IP \f(CW<Enter>\fR
-Highlights the current column title.
-.IP \f(CW<Leave>\fR
-Returns the column back to its normal state.
-.IP \f(CW<ButtonRelease-1>\fR
-Invokes the command (see the column's -command option) if one
-if specified.
-.SS COLUMN RULE BINDINGS
-.IP \f(CW<Enter>\fR
-Highlights the current and activates the ruler.
-.IP \f(CW<Leave>\fR
-Returns the column back to its normal state. Deactivates the
-ruler.
-.IP \f(CW<ButtonPress-1>\fR
-Sets the resize anchor for the column.
-.IP \f(CW<B1-Motion>\fR
-Sets the resize mark for the column.
-.IP \f(CW<ButtonRelease-1>\fR
-Adjust the size of the column, based upon the resize anchor and mark
-positions.
-.SH EXAMPLE
-The \fBtreeview\fR command creates a new widget.
-.CS
-treeview .h \-bg white
-.CE
-A new Tcl command \f(CW.h\fR is also created. This command can be used
-to query and modify the \fBtreeview\fR widget. For example, to change the
-background
-color of the table to "green", you use the new command and the widget's
-\fBconfigure\fR operation.
-.CS
-# Change the background color.
-\&.h configure \-background "green"
-.CE
-By default, the \fBtreeview\fR widget will automatically create a new tree object
-to contain the data. The name of the new tree is the pathname of the
-widget. Above, the new tree object name is ".h". But you can use the
-\fB\-tree\fR option to specify the name of another tree.
-.CS
-# View the tree "myTree".
-\&.h configure \-tree "myTree"
-.CE
-When a new tree is created, it contains only a root node. The node
-is automatically opened. The id of the root node is always
-\f(CW0\fR (you can use also use the special id \f(CWroot\fR). The
-\fBinsert\fR operation lets you insert one or more new entries into
-the tree. The last argument is the node's \fIpathname\fR.
-.CS
-# Create a new entry named "myEntry"
-set id [\&.h insert end "myEntry"]
-.CE
-This appends a new node named "myEntry". It will positioned as the
-last child of the root of the tree (using the position "end"). You
-can supply another position to order the node within its siblings.
-.CS
-# Prepend "fred".
-set id [\&.h insert 0 "fred"]
-.CE
-Entry names do not need to be unique. By default, the node's label
-is its name. To supply a different text label, add the \fB\-label\fR
-option.
-.CS
-# Create a new node named "fred"
-set id [\&.h insert end "fred" -label "Fred Flintstone"]
-.CE
-The \fBinsert\fR operation returns the id of the new node. You can
-also use the \fBindex\fR operation to get this information.
-.CS
-# Get the id of "fred"
-\&.h index "fred"
-.CE
-To insert a node somewhere other than root, use the \fB\-at\fR switch.
-It takes the id of the node where the new child will be added.
-.CS
-# Create a new node "barney" in "fred".
-\&.h insert -at $id end "barney"
-.CE
-A pathname describes the path to an entry in the hierarchy. It's a
-list of entry names that compose the path in the tree. Therefore, you
-can also add "barney" to "fred" as follows.
-.CS
-# Create a new sub-entry of "fred"
-\&.h insert end "fred barney"
-.CE
-Every name in the list is ancestor of the next. All ancestors must
-already exist. That means that an entry "fred" is an ancestor of
-"barney" and must already exist. But you can use the
-\fB\-autocreate\fR configuration option to force the creation of
-ancestor nodes.
-.CS
-# Force the creation of ancestors.
-\&.h configure -autocreate yes
-\&.h insert end "fred barney wilma betty"
-.CE
-Sometimes the pathname is already separated by a character sequence
-rather than formed as a list. A file name is a good example of this.
-You can use the \fB\-separator\fR option to specify a separator string
-to split the path into its components. Each pathname inserted is
-automatically split using the separator string as a separator.
-Multiple separators are treated as one.
-.CS
-\&.h configure -separator /
-\&.h insert end "/usr/local/tcl/bin"
-.CE
-If the path is prefixed by extraneous characters, you can
-automatically trim it off using the \fB\-trim\fR option. It removed
-the string from the path before it is parsed.
-.CS
-\&.h configure -trim C:/windows -separator /
-\&.h insert end "C:/window/system"
-.CE
-You can insert more than one entry at a time with the \fBinsert\fR
-operation. This can be much faster than looping over a list of names.
-.CS
-# The slow way
-foreach f [glob $dir/*] {
- \&.h insert end $f
-}
-# The fast way
-eval .h insert end [glob $dir/*]
-.CE
-In this case, the \fBinsert\fR operation will return a list of ids
-of the new entries.
-.PP
-You can delete entries with the \fBdelete\fR operation. It takes one or
-more tags of ids as its argument. It deletes the entry and all its
-children.
-.CS
-\&.h delete $id
-.CE
-Entries have several configuration options. They control the appearance
-of the entry's icon and label. We have already seen the \fB\-label\fR
-option that sets the entry's text label. The \fBentry configure\fR
-operation lets you set or modify an entry's configuration options.
-.CS
-\&.h entry configure $id -color red -font fixed
-.CE
-You can hide an entry and its children using the \fB\-hide\fR option.
-.CS
-\&.h entry configure $id -hide yes
-.CE
-More that one entry can be configured at once. All entries specified
-are configured with the same options.
-.CS
-\&.h entry configure $i1 $i2 $i3 $i4 -color brown
-.CE
-An icon is displayed for each entry. It's a Tk image drawn to the
-left of the label. You can set the icon with the entry's
-\fB\-icons\fR option. It takes a list of two image names: one to
-represent the open entry, another when it is closed.
-.CS
-set im1 [image create photo -file openfolder.gif]
-set im2 [image create photo -file closefolder.gif]
-\&.h entry configure $id -icons "$im1 $im2"
-.CE
-If \fB\-icons\fR is set to the empty string, no icons are display.
-.PP
-If an entry has children, a button is displayed to the left of the
-icon. Clicking the mouse on this button opens or closes the
-sub-hierarchy. The button is normally a \f(CW+\fR or \f(CW\-\fR
-symbol, but can be configured in a variety of ways using the \fBbutton
-configure\fR operation. For example, the \f(CW+\fR and \f(CW\-\fR
-symbols can be replaced with Tk images.
-.CS
-set im1 [image create photo -file closefolder.gif]
-set im2 [image create photo -file downarrow.gif]
-\&.h button configure $id -images "$im1 $im2" \\
- -openrelief raised -closerelief raised
-.CE
-Entries can contain an arbitrary number of \fIdata fields\fR. Data
-fields are name-value pairs. Both the value and name are strings.
-The entry's \fB\-data\fR option lets you set data fields.
-.CS
-\&.h entry configure $id -data {mode 0666 group users}
-.CE
-The \fB\-data\fR takes a list of name-value pairs.
-.PP
-You can display these data fields as \fIcolumns\fR in the
-\fBtreeview\fR widget. You can create and configure columns with
-the \fBcolumn\fR operation. For example, to add a new column to the
-widget, use the \fBcolumn insert\fR operation. The last argument is
-the name of the data field that you want to display.
-.CS
-\&.h column insert end "mode"
-.CE
-The column title is displayed at the top of the column. By default,
-it's is the field name. You can override this using the column's
-\fB\-text\fR option.
-.CS
-\&.h column insert end "mode" -text "File Permissions"
-.CE
-Columns have several configuration options. The \fBcolumn
-configure\fR operation lets you query or modify column options.
-.CS
-\&.h column configure "mode" -justify left
-.CE
-The \fB\-justify\fR option says how the data is justified within in
-the column. The \fB\-hide\fR option indicates whether the column is
-displayed.
-.CS
-\&.h column configure "mode" -hide yes
-.CE
-Entries can be selected by clicking on the mouse. Selected entries
-are drawn using the colors specified by the \fB\-selectforeground\fR
-and \fB\-selectbackground\fR configuration options.
-The selection itself is managed by the \fBselection\fR operation.
-.CS
-# Clear all selections
-\&.h selection clear 0 end
-# Select the root node
-\&.h selection set 0
-.CE
-The \fBcurselection\fR operation returns a list of ids of
-all the selected entries.
-.CS
-set ids [\&.h curselection]
-.CE
-You can use the \fBget\fR operation to convert the ids to
-their pathnames.
-.CS
-set names [eval .h get -full $ids]
-.CE
-If a treeview is exporting its selection (using the
-\fB\-exportselection\fR option), then it will observe the standard X11
-protocols for handling the selection. Treeview selections are
-available as type \fBSTRING\fR; the value of the selection will be the
-pathnames of the selected entries, separated by newlines.
-.PP
-The \fBtreeview\fR supports two modes of selection: \f(CWsingle\fR
-and \f(CWmultiple\fR. In single select mode, only one entry can be
-selected at a time, while multiple select mode allows several entries
-to be selected. The mode is set by the widget's \fB\-selectmode\fR
-option.
-.CS
-\&.h configure -selectmode "multiple"
-.CE
-You can be notified when the list of selected entries changes. The widget's
-\fB\-selectcommand\fR specifies a Tcl procedure that is called whenever
-the selection changes.
-.CS
-proc SelectNotify { widget } {
- set ids [\&$widget curselection]
-}
-\&.h configure -selectcommand "SelectNotify .h"
-.CE
-The widget supports the standard Tk scrolling and scanning operations.
-The \fBtreeview\fR can be both horizontally and vertically. You can
-attach scrollbars to the \fBtreeview\fR the same way as the listbox
-or canvas widgets.
-.CS
-scrollbar .xbar -orient horizontal -command ".h xview"
-scrollbar .ybar -orient vertical -command ".h yview"
-\&.h configure -xscrollcommand ".xbar set" \\
- -yscrollcommand ".ybar set"
-.CE
-There are three different modes of scrolling: \f(CWlistbox\fR,
-\f(CWcanvas\fR, and \f(CWhierbox\fR. In \f(CWlistbox\fR mode, the last
-entry can always be scrolled to the top of the widget. In \f(CWhierbox\fR
-mode, the last entry is always drawn at the bottom of the widget.
-The scroll mode is set by the widget's \fB\-selectmode\fR
-option.
-.CS
-\&.h configure -scrollmode "listbox"
-.CE
-Entries can be programmatically opened or closed using the \fBopen\fR
-and \fBclose\fR operations respectively.
-.CS
-\&.h open $id
-\&.h close $id
-.CE
-When an entry is opened, a Tcl procedure can be automatically invoked.
-The \fB\-opencommand\fR option specifies this procedure. This
-procedure can lazily insert entries as needed.
-.CS
-proc AddEntries { dir } {
- eval .h insert end [glob -nocomplain $dir/*]
-}
-\&.h configure -opencommand "AddEntries %P"
-.CE
-Now when an entry is opened, the procedure \f(CWAddEntries\fR is
-called and adds children to the entry. Before the command is invoked,
-special "%" substitutions (like \fBbind\fR) are performed. Above,
-\f(CW%P\fR is translated to the pathname of the entry.
-.PP
-The same feature exists when an entry is closed. The
-\fB\-closecommand\fR option specifies the procedure.
-.CS
-proc DeleteEntries { id } {
- .h entry delete $id 0 end
-}
-\&.h configure -closecommand "DeleteEntries %#"
-.CE
-When an entry is closed, the procedure \f(CWDeleteEntries\fR is called
-and deletes the entry's children using the \fBentry delete\fR operation
-(\f(CW%#\fR is the id of entry).
-.SH KEYWORDS
-treeview, widget
diff --git a/blt3.0.1/man/hiertable.mann b/blt3.0.1/man/hiertable.mann
deleted file mode 100644
index 457bf18..0000000
--- a/blt3.0.1/man/hiertable.mann
+++ /dev/null
@@ -1,2261 +0,0 @@
-'\"
-'\" Copyright 2001-2 by Silicon Metrics Corporation.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Silicon Metrics or any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Silicon Metrics disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Silicon Metrics be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" The hierarchical table widget created by George Howlett.
-'\"
-.so man.macros
-.TH treeview n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-treeview \- Create and manipulate hierarchical table widgets
-.BE
-.SH SYNOPSIS
-\fBtreeview\fR \fIpathName \fR?\fIoptions\fR?
-.SH DESCRIPTION
-The \fBtreeview\fR widget displays a tree of data. It replaces both
-the \fBhiertable\fR and \fBhierbox\fR widgets. The \fBtreeview\fR is
-100% syntax compatible with the \fBhiertable\fR widget. The
-\fBhiertable\fR command is retained for sake of script-level
-compatibility. This widget obsoletes the \fBhierbox\fR widget. It
-does everything the old \fBhierbox\fR widget did, but also provides
-data sharing (via \fItree data objects\fR) and the ability to tag
-nodes.
-.SH INTRODUCTION
-The \fBtreeview\fR widget displays hierarchical data. Data is
-represented as nodes in a general-ordered tree. Each node may have
-sub-nodes and these nodes can in turn has their own children.
-.PP
-A node is displayed as a row entry in the widget. Each entry has a
-text label and icon. When a node has children, its entry is drawn
-with a small button to the left of the label. Clicking the mouse over
-this button opens or closes the node. When a node is \fIopen\fR, its
-children are exposed. When it is \fIclosed\fR, the children and their
-descedants are hidden. The button is normally a \f(CW+\fR or
-\f(CW\-\fR symbol (ala Windows Explorer), but can be replaced with a
-pair of Tk images (open and closed images).
-.PP
-If the node has data associated with it, they can be displayed in
-columns running vertically on either side the tree. You can control
-the color, font, etc of each entry. Any entry label or data field can
-be edited in-place.
-.SH "TREE DATA OBJECT"
-The tree is not stored inside the widget but in a tree data object
-(see the \fBtree\fR command for a further explanation). Tree data
-objects can be shared among different clients, such as a
-\fBtreeview\fR widget or the \fBtree\fR command. You can walk the
-tree and manage its data with the \fBtree\fR command tree, while
-displaying it with the \fBtreeview\fR widget. Whenever the tree is
-updated, the \fBtreeview\fR widget is automatically redrawn.
-.PP
-By default, the \fBtreeview\fR widget creates its own tree object.
-The tree initially contains just a root node. But you can also
-display trees created by the \fBtree\fR command using the \fB\-tree\fR
-configuration option. \fBTreeview\fR widgets can share the same tree
-object, possibly displaying different views of the same data.
-.PP
-A tree object has both a Tcl and C API. You can insert or delete
-nodes using \fBtreeview\fR widget or \fBtree\fR command operations,
-but also from C code. For example, you can load the tree from your C
-code while still managing and displaying the tree from Tcl. The widget
-is automatically notified whenever the tree is modified via C or Tcl.
-.SH SYNTAX
-.DS
-\fBtreeview \fIpathName \fR?\fIoption value\fR?...
-.DE
-The \fBtreeview\fR command creates a new window \fIpathName\fR and
-makes it into a \fBtreeview\fR widget. At the time this command is
-invoked, there must not exist a window named \fIpathName\fR, but
-\fIpathName\fR's parent must exist. Additional options may be
-specified on the command line or in the option database to configure
-aspects of the widget such as its colors and font. See the
-\fBconfigure\fR operation below for the exact details about what
-\fIoption\fR and \fIvalue\fR pairs are valid.
-.PP
-If successful, \fBtreeview\fR returns the path name of the widget. It
-also creates a new Tcl command by the same name. You can use this
-command to invoke various operations that query or modify the widget.
-The general form is:
-.DS
-\fIpathName \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available are described in the
-.SB "TREEVIEW OPERATIONS"
-section.
-.SH "IDS AND TAGS"
-Nodes can be inserted into a tree using the \fBtreeview\fR widget
-.CS
-blt::treeview .t
-set node [.t insert end root "one"]
-.CE
-or \fBtree\fR command.
-.CS
-set tree [blt::tree create]
-set node [$tree insert root "one"]
-.CE
-In both cases, a number identifying the node is returned (the value of
-\f(CW$node\fR). This serial number or \fIid\fR uniquely identifies
-the node. Please note that you can't infer a location or position of
-a node from its id. The only exception is that the root node is
-always id \f(CW0\fR. Since nodes may have the same labels or be moved
-within the tree, ids provide an convenient way to identify nodes. If
-a tree is shared, the ids will be the same regardless if you are using
-by the \fBtreeview\fR widget or the \fBtree\fR command. Ids are
-recycled when the node deleted.
-.PP
-A node may also have any number of \fItags\fR associated with it. A
-tag is just a string of characters, and it may take any form except
-that of an integer. For example, "\f(CWx123\fR" is valid, but
-"\f(CW123\fR" isn't. The same tag may be associated with many
-different nodes. This is typically done to associate a group of
-nodes. Many operations in the \fBtreeview\fR widget take either node
-ids or tag names as arguments. Using a tag says to apply the operation
-to all nodes with that tag.
-.PP
-The tag \fBall\fR is implicitly associated with every node in
-the tree. It may be used to invoke operations on all the nodes in the
-tree.
-.PP
-Tags may be shared, just like trees, between clients. For example,
-you can use the tags created by the \fBtree\fR command with
-\fBtreeview\fR widgets.
-.SH SPECIAL NODE IDS
-There are also several special non-numeric ids. Special ids differ
-from tags in that they are always translated to their numeric
-equivalent. They also take precedence over tags. For example, you
-can't use a tag name that is a special id. These ids are specific to
-the \fBtreeview\fR widget.
-.TP 15
-\fBactive\fR
-The node where the mouse pointer is currently located.
-When a node is active, it is drawn using its active icon
-(see the \fB\-activeicon\fR option).
-The \fBactive\fR id is changed automatically by moving the mouse
-pointer over another node or by using the \fBentry activate\fR
-operation. Note that there can be only one active node at a time.
-.TP 15
-\fBanchor\fR
-The node representing the fixed end of the current selection.
-The anchor is set by the \fBselection anchor\fR operation.
-.TP 15
-\fBcurrent\fR
-The node where the mouse pointer is currently located.
-But unlike \fBactive\fR, this id changes while the
-selection is dragged. It is used to determine the
-current node during button drags.
-.TP 15
-\fBdown\fR
-The next open node from the current focus. The \fBdown\fR of
-the last open node is the same.
-.TP 15
-\fBend\fR
-The last open node (in depth-first order) on the tree.
-.TP 15
-\fBfocus\fR
-The node that currently has focus. When a node has focus,
-it receives key events. To indicate focus, the node
-is drawn with a dotted line around its label. You can change the
-focus using the \fBfocus\fR operation.
-.TP 15
-\fBlast\fR
-The last open node from the current focus. But unlike \fBup\fR,
-when the focus is at root, \fBlast\fR wraps around to the last
-open node in the tree.
-.TP 15
-\fBmark\fR
-The node representing the non-fixed end of the current selection.
-The mark is set by the \fBselection mark\fR operation.
-.TP 15
-\fBnext\fR
-The next open node from the current focus. But unlike \fBdown\fR,
-when the focus is on last open node, \fBnext\fR wraps around to the
-root node.
-.TP 15
-\fBnextsibling\fR
-The next sibling from the node with the current focus. If the node
-is already the last sibling then it is the \fBnextsibling\fB.
-.TP 15
-\fBparent\fR
-The parent of the node with the current focus. The \fBparent\fR
-of the root is also the root.
-.TP 15
-\fBprevsibling\fR
-The previous sibling from the node with the current focus. If the node
-is already the first sibling then it is the \fBprevsibling\fB.
-.TP 15
-\fBroot\fR
-The root node. You can also use id \f(CW0\fR to indicate
-the root.
-.TP 15
-\fBup\fR
-The last open node (in depth-first order) from the current focus. The
-\fBup\fR of the root node (i.e. the root has focus) is also the root.
-.TP 15
-\fBview.top\fR
-First node that's current visible in the widget.
-.TP 15
-\fBview.bottom\fR
-Last node that's current visible in the widget.
-.TP 15
-\fIpath\fR
-Absolute path of a node. Path names refer to the node name, not
-their entry labels. Paths don't have to start with a separator (see
-the \fB\-separator\fR configuration option), but component names must
-be separated by the designated separator.
-.TP 15
-\fB@\fIx\fB,\fIy\fR
-Indicates the node that covers the point in the treeview window
-specified by \fIx\fR and \fIy\fR (in pixel coordinates). If no
-part of the entryd covers that point, then the closest node to that
-point is used.
-.PP
-A node may be specified as an id or tag. If the specifier is an
-integer then it is assumed to refer to the single node with that id.
-If the specifier is not an integer, it's checked to see if it's a
-special id (such as focus). Otherwise, it's assumed to be tag. Some
-operations only operate on a single node at a time; if a tag refers to
-more than one node, then an error is generated.
-.SH DATA FIELDS
-A node in the tree can have \fIdata fields\fR. A data field is a
-name-value pair, used to represent arbitrary data in the node. Nodes
-can contain different fields (they aren't required to contain the same
-fields). You can optionally display these fields in the
-\fBtreeview\fR widget in columns running on either side of the
-displayed tree. A node's value for the field is drawn in the column
-along side its node in the hierarchy. Any node that doesn't have a
-specific field is left blank. Columns can be interactively resized,
-hidden, or, moved.
-.SH ENTRY BINDINGS
-You can bind Tcl commands to be invoked when events occur on nodes
-(much like Tk canvas items). You can bind a node using its id or
-its \fIbindtags\fR. Bindtags are simply names that associate a
-binding with one or more nodes. There is a built-in tag \f(CWall\fR
-that all node entries automatically have.
-.SH "TREEVIEW OPERATIONS"
-The \fBtreeview\fR operations are the invoked by specifying
-the widget's pathname, the operation, and any arguments that pertain
-to that operation. The general form is:
-.sp
-.CS
-\fIpathName operation \fR?\fIarg arg ...\fR?
-.CE
-.sp
-\fIOperation\fR and the \fIarg\fRs determine the exact behavior of the
-command. The following operation are available for \fBtreeview\fR widgets:
-.TP
-\fIpathName \fBbbox\fR ?\fB-screen\fR? \fItagOrId...\fR
-Returns a list of 4 numbers, representing a bounding box of around
-the specified entries. The entries is given by one or more \fItagOrId\fR
-arguments.
-If the \fB\-screen\fR flag is given, then the x-y coordinates
-of the bounding box are returned as screen coordinates, not
-virtual coordinates. Virtual coordinates start from \f(CW0\fR from the
-root node.
-The returned list contains the following values.
-.RS
-.TP 1.25i
-\fIx\fR
-X-coordinate of the upper-left corner of the bounding box.
-.TP
-\fIy\fR
-Y-coordinate of the upper-left corner of the bounding box.
-.TP
-\fIwidth\fR
-Width of the bounding box.
-.TP
-\fIheight\fR
-Height of the bounding box.
-.RE
-.TP
-\fIpathName \fBbind\fR \fItagName\fR ?\fIsequence command\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for a node with this
-tag, \fIcommand\fR will be invoked. The syntax is similar to the
-\fBbind\fR command except that it operates on \fBtreeview\fR entries,
-rather than widgets. See the \fBbind\fR manual entry for
-complete details on \fIsequence\fR and the substitutions performed on
-\fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBbutton \fIoperation\fR ?\fIargs\fR?
-This command is used to control the button selectors within a
-\fBtreeview\fR widget.
-It has several forms, depending on \fIoperation\fR:
-.RS
-.TP
-\fIpathName \fBbutton activate\fR \fItagOrId\fR
-Designates the node given by \fItagOrId\fR as active.
-When a node is active it's entry is drawn using its active icon
-(see the \fB\-activeicon\fR option).
-Note that there can be only one active entry at a time.
-The special id \fBactive\fR indicates the currently active node.
-.TP
-\fIpathName \fBbutton bind\fR \fItagName\fR ?\fIsequence command\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for an button of a
-node entry with this tag, \fIcommand\fR will be invoked. The syntax is
-similar to the \fBbind\fR command except that it operates on
-\fBtreeview\fR buttons, rather than widgets. See the \fBbind\fR
-manual entry for complete details on \fIsequence\fR and the
-substitutions performed on \fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBbutton cget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBbutton configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "BUTTON OPTIONS"
-below.
-.RE
-.TP
-\fIpathName \fBcget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBclose \fR?\fB\-recurse\fR? \fItagOrId...\fR
-Closes the node specified by \fItagOrId\fR. In addition, if a Tcl
-script was specified by the \fB\-closecommand\fR option, it is
-invoked. If the node is already closed, this command has no effect.
-If the \fB\-recurse\fR flag is present, each child node is
-recursively closed.
-.TP
-\fIpathName \fBcolumn \fIoperation\fR ?\fIargs\fR?
-The following operations are available for treeview columns.
-.RS
-.TP
-\fIpathName \fBcolumn activate\fR \fIcolumn\fR
-Sets the active column to \fIcolumn\fR. \fIColumn\fR is the
-name of a column in the widget.
-When a column is active, it's drawn using its \fB\-activetitlebackground\fR
-and \fB\-activetitleforeground\fR options. If \fIcolumn\fR is the \f(CW""\fR,
-then no column will be active. If no column argument is provided, then
-the name of the currently active column is returned.
-.TP
-\fIpathName \fBcolumn cget\fR \fIname\fR \fIoption\fR
-Returns the current value of the column configuration option given
-by \fIoption\fR for \fIname\fR. \fIName\fR is the name of column
-that corresponds to a data field.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBcolumn configure\fR \fIname\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the column designated
-by \fIname\fR. \fIName\fR is the name of the column corresponding
-to a data field.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "COLUMN OPTIONS"
-below.
-.TP
-\fIpathName \fBcolumn delete\fR \fIfield\fR ?\fIfield\fR...?
-Deletes one of more columns designated by \fIfield\fR. Note
-that this does not delete the data fields themselves.
-.TP
-\fIpathName \fBcolumn insert\fR \fIposition\fR \fIfield\fR ?\fIoptions\fR...?
-Inserts one of more columns designated by \fIfield\fR. A column displays
-each node's data field by the same name. If the node doesn't
-have the given field, the cell is left blank.
-\fIPosition\fR
-indicates where in the list of columns to add the new column. It may be
-either a number or \f(CWend\fR.
-.TP
-\fIpathName \fBcolumn invoke\fR \fIfield\fR
-Invokes the Tcl command associated with the column \fIfield\fR,
-if there is one (using the column's \fB\-command\fR option).
-The command is ignored if the column's \fB\-state\fR option
-set to \f(CWdisabled\fR.
-.TP
-\fIpathName \fBcolumn move \fIname\fR \fIdest\fR
-Moves the column \fIname\fR to the destination position.
-\fIDest\fR is the name of another column or a screen position
-in the form \f(CW@\fIx\f(CW,\fIy\fR.
-.TP
-\fIpathName \fBcolumn names\fR
-Returns a list of the names of all columns in the widget.
-The list is ordered as the columns are drawn from left-to-right.
-.TP
-\fIpathName \fBcolumn nearest\fR \fIx\fR ?\fIy\fR?
-Returns the name of the column closest to the given X-Y screen
-coordinate. If you provide a \fIy\fR argument (it's optional),
-a name is returned only when if the point is over a column's title.
-.RE
-.TP
-\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "TREEVIEW OPTIONS"
-below.
-.TP
-\fIpathName \fBcurselection\fR
-Returns a list containing the ids of all of the entries that are
-currently selected.
-If there are no entries selected, then the empty string is returned.
-.TP
-\fIpathName \fBdelete \fItagOrId\fR...
-Deletes one or more entries given by \fItagOrId\fR and its children.
-.TP
-\fIpathName \fBentry \fIoperation\fR ?\fIargs\fR?
-The following operations are available for treeview entries.
-.RS
-.TP
-\fIpathName \fBentry activate\fR \fItagOrId\fR
-Sets the active entry to the one specified by \fItagOrId\fR.
-When an entry is active it is drawn using its active icon
-(see the \fB\-activeicon\fR option).
-Note that there can be only one active node at a time.
-The special id of the currently active node is \fBactive\fR.
-.TP
-\fIpathName \fBentry cget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBentry children\fR \fItagOrId\fR ?\fIfirst\fR? ?\fIlast\fR?
-Returns a list of ids for the given range of children of \fItagOrId\fR.
-\fITagOrId\fR is the id or tag of the node to be examined.
-If only a \fIfirst\fR argument is present, then the id
-of the that child at that numeric position is returned. If both \fIfirst\fR
-and \fIlast\fR arguments are given, then the ids of all the children
-in that range are returned. Otherwise the ids of all children
-are returned.
-.TP
-\fIpathName \fBentry configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described below:
-.TP
-\fIpathName \fBentry delete\fR \fItagOrId\fR ?\fIfirst\fR ?\fIlast\fR?
-Deletes the one or more children nodes of the parent \fItagOrId\fR.
-If \fIfirst\fR and \fIlast\fR arguments are present, they are
-positions designating a range of children nodes to be deleted.
-.TP
-\fIpathName \fBentry isbefore \fItagOrId1\fR \fItagOrId2\fR
-Returns 1 if \fItagOrId1\fR is before \fItagOrId2\fR and 0 otherwise.
-.TP
-\fIpathName \fBentry ishidden \fItagOrId\fR
-Returns 1 if the node is currently hidden and 0 otherwise. A node is
-also hidden if any of its ancestor nodes are closed or hidden.
-.TP
-\fIpathName \fBentry isopen \fItagOrId\fR
-Returns 1 if the node is currently open and 0 otherwise.
-.TP
-\fIpathName \fBentry size\fR \fB\-recurse\fR \fItagOrId\fR
-Returns the number of children for parent node \fItagOrId\fR.
-If the \fB\-recurse\fR flag is set, the number of all
-its descendants is returned. The node itself is not counted.
-.RE
-.TP
-\fIpathName \fBfind \fR?\fIflags\fR? \fIfirst\fR \fIlast\fR
-Finds for all entries matching the criteria given by \fIflags\fR. A
-list of ids for all matching nodes is returned. \fIFirst\fR and
-\fIlast\fR are ids designating the range of the search in
-depth-first order. If \fIlast\fR is before \fIfirst\fR, then nodes
-are searched in reverse order. The valid flags are:
-.RS
-.TP 1.25i
-\fB\-name\fI pattern\fR
-Specifies pattern to match against node names.
-.TP 1.25i
-\fB\-full\fI pattern\fR
-Specifies pattern to match against node pathnames.
-.TP 1.25i
-\fB\-\fIoption\fI pattern\fR
-Specifies pattern to match against the node entry's configuration option.
-.TP 1.25i
-\fB\-exact\fR
-Patterns must match exactly. The is the default.
-.TP 1.25i
-\fB\-glob\fR
-Use global pattern matching. Matching is done in a fashion
-similar to that used by the C-shell. For the two
-strings to match, their contents must be identical
-except that the following special sequences may
-appear in pattern:
-.RS
-.TP 5
-\f(CW*\fR
-Matches any sequence of characters in
-string, including a null string.
-.TP 5
-\f(CW?\fR
-Matches any single character in string.
-.TP 5
-\f(CW[\fIchars\f(CW]\fR
-Matches any character in the set given by \fIchars\fR. If a sequence of the
-form \fIx\fR-\fIy\fR appears in \fIchars\fR, then any character between
-\fIx\fR and \fIy\fR,
-inclusive, will match.
-.TP 5
-\f(CW\\\fIx\fR
-Matches the single character \fIx\fR. This
-provides a way of avoiding the special
-interpretation of the characters \f(CW*?[]\\\fR in
-the pattern.
-.RE
-.TP 1.25i
-\fB\-regexp\fR
-Use regular expression pattern matching (i.e. the same as implemented
-by the \fBregexp\fR command).
-.TP 1.25i
-\fB\-nonmatching\fR
-Pick entries that don't match.
-.TP 1.25i
-\fB\-exec\fI string\fR
-Specifies a Tcl script to be invoked for each matching node.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.TP 1.25i
-\fB\-count\fI number\fR
-Stop searching after \fInumber\fR matches.
-.TP 1.25i
-\fB\-\-\fR
-Indicates the end of flags.
-.RE
-.TP
-\fIpathName \fBfocus \fR \fItagOrId\fR
-Sets the focus to the node given by \fItagOrId\fR. When a node
-has focus, it can receive keyboard events.
-The special id \fBfocus\fR designates the node that currently has focus.
-.TP
-\fIpathName \fBget \fR?\fB\-full\fR? \fItagOrId\fR \fItagOrId\fR...
-Translates one or more ids to their node entry names. It returns a list of
-names for all the ids specified. If the \fB\-full\fR
-flag is set, then the full pathnames are returned.
-.TP
-\fIpathName \fBhide \fR?\fBflags\fR? \fItagOrId\fR...
-Hides all nodes matching the criteria given by \fIflags\fR. The
-search is performed recursively for each node given by \fItagOrId\fR.
-The valid flags are described below:
-.RS
-.TP 1.25i
-\fB\-name\fI pattern\fR
-Specifies pattern to match against node names.
-.TP 1.25i
-\fB\-full\fI pattern\fR
-Specifies pattern to match against node pathnames.
-.TP 1.25i
-\fB\-\fIoption\fI pattern\fR
-Specifies pattern to match against the node entry's configuration option.
-.TP 1.25i
-\fB\-exact\fR
-Match patterns exactly. The is the default.
-.TP 1.25i
-\fB\-glob\fR
-Use global pattern matching. Matching is done in a fashion
-similar to that used by the C-shell. For the two
-strings to match, their contents must be identical
-except that the following special sequences may
-appear in pattern:
-.RS
-.TP 5
-\f(CW*\fR
-Matches any sequence of characters in
-string, including a null string.
-.TP 5
-\f(CW?\fR
-Matches any single character in string.
-.TP 5
-\f(CW[\fIchars\f(CW]\fR
-Matches any character in the set given by \fIchars\fR. If a sequence of the
-form \fIx\fR-\fIy\fR appears in \fIchars\fR, then any character between
-\fIx\fR and \fIy\fR,
-inclusive, will match.
-.TP 5
-\f(CW\\\fIx\fR
-Matches the single character \fIx\fR. This
-provides a way of avoiding the special
-interpretation of the characters \f(CW*?[]\\\fR in
-the pattern.
-.RE
-.TP 1.25i
-\fB\-regexp\fR
-Use regular expression pattern matching (i.e. the same as implemented
-by the \fBregexp\fR command).
-.TP 1.25i
-\fB\-nonmatching\fR
-Hide nodes that don't match.
-.TP 1.25i
-\fB\-\-\fR
-Indicates the end of flags.
-.RE
-.TP
-\fIpathName \fBindex \fR?\fB\-at\fR \fItagOrId\fR? \fIstring\fR
-Returns the id of the node specified by \fIstring\fR. \fIString\fR
-may be a tag or node id.
-Some special ids are normally relative to the node that
-has focus. The \fB\-at\fR flag lets you select another node.
-.TP
-\fIpathName \fBinsert \fR?\fB\-at \fItagOrId\fR? \fIposition\fR \fIpath\fR ?\fIoptions...\fR? ?\fIpath\fR? ?\fIoptions...\fR?
-Inserts one or more nodes at \fIposition\fR. \fIPosition\fR is the
-location (number or \f(CWend\fR) where the new nodes are added to
-the parent node. \fIPath\fR is the pathname of the new node.
-Pathnames can be formated either as a Tcl list (each element is a path
-component) or as a string separated by a special character sequence
-(using the \fB\-separator\fR option). Pathnames are normally
-absolute, but the \fB\-at\fR switch lets you select a relative
-starting point. Its value is the id of the starting node.
-.sp
-All ancestors of the new node must already exist, unless the
-\fB\-autocreate\fR option is set. It is also an error if a node
-already exists, unless the \fB\-allowduplicates\fR option is set.
-.sp
-\fIOption\fR and \fIvalue\fR may have any of the values accepted by the
-\fBentry configure\fR operation described in the
-.SB "ENTRY OPERATIONS"
-section below. This command returns a list of the ids of
-the new entries.
-.TP
-\fIpathName \fBmove \fItagOrId\fR \fIhow\fR \fIdestId\fR
-Moves the node given by \fItagOrId\fR to the destination node. The
-node can not be an ancestor of the destination. \fIDestId\fR is
-the id of the destination node and can not be the root of the
-tree. In conjunction with \fIhow\fR, it describes how the move is
-performed.
-.RS
-.TP 8
-\f(CWbefore\fR
-Moves the node before the destination node.
-.TP 8
-\f(CWafter\fR
-Moves the node after the destination node.
-.TP 8
-\f(CWinto\fR
-Moves the node to the end of the destination's list of children.
-.RE
-.TP
-\fIpathName \fBnearest \fIx y\fR ?\fIvarName\fR?
-Returns the id of the node entry closest to the given X-Y screen
-coordinate. The optional argument \fIvarName\fR is the name of
-variable which is set to either \f(CWbutton\fR or \f(CWselect\fR to
-indicate over what part of the node the coordinate lies.
-If the coordinate is not directly over any node, then
-\fIvarName\fR will contain the empty string.
-.TP
-\fIpathName \fBopen \fR?\fB\-recurse\fR? \fItagOrId...\fR
-Opens the one or more nodes specified by \fItagOrId\fR.
-If a node is not already open, the Tcl script specified by the
-\fB\-opencommand\fR option is invoked. If the \fB\-recurse\fR flag
-is present, then each descendant is recursively opened.
-.TP
-\fIpathName \fBrange\fR ?\fB-open\fR? \fIfirst last\fR
-Returns the ids in depth-first order of the nodes
-between the \fIfirst\fR and \fIlast\fR ids. If the \fB\-open\fR
-flag is present, it indicates to consider only open nodes.
-If \fIlast\fR is before \fIfirst\fR, then the ids are
-returned in reverse order.
-.TP
-\fIpathName \fBscan\fR \fIoption args\fR
-This command implements scanning. It has
-two forms, depending on \fIoption\fR:
-.RS
-.TP
-\fIpathName \fBscan mark \fIx y\fR
-Records \fIx\fR and \fIy\fR and the current view in the treeview
-window; used in conjunction with later \fBscan dragto\fR commands.
-Typically this command is associated with a mouse button press in
-the widget. It returns an empty string.
-.TP
-\fIpathName \fBscan dragto \fIx y\fR.
-Computes the difference between its \fIx\fR and \fIy\fR
-arguments and the \fIx\fR and \fIy\fR arguments to the last
-\fBscan mark\fR command for the widget.
-It then adjusts the view by 10 times the
-difference in coordinates. This command is typically associated
-with mouse motion events in the widget, to produce the effect of
-dragging the list at high speed through the window. The return
-value is an empty string.
-.RE
-.TP
-\fIpathName \fBsee\fR ?\fB\-anchor \fIanchor\fR? \fItagOrId\fR
-Adjusts the view of entries so that the node given by \fItagOrId\fR is
-visible in the widget window. It is an error if \fBtagOrId\fR is a
-tag that refers to more than one node. By default the node's entry
-is displayed in the middle of the window. This can changed using the
-\fB\-anchor\fR flag. Its value is a Tk anchor position.
-.TP
-\fIpathName \fBselection \fIoption arg\fR
-This command is used to adjust the selection within a \fBtreeview\fR
-widget. It has several forms, depending on \fIoption\fR:
-.RS
-.TP
-\fIpathName \fBselection anchor \fItagOrId\fR
-Sets the selection anchor to the node given by \fItagOrId\fR.
-If \fItagOrId\fR refers to a non-existent node, then the closest
-node is used.
-The selection anchor is the end of the selection that is fixed
-while dragging out a selection with the mouse.
-The special id \fBanchor\fR may be used to refer to the anchor
-node.
-.TP
-\fIpathName \fBselection cancel\fR
-Clears the temporary selection of entries back to the
-current anchor. Temporary selections are created by
-the \fBselection mark\fR operation.
-.TP
-\fIpathName \fBselection clear \fIfirst \fR?\fIlast\fR?
-Removes the entries between \fIfirst\fR and \fIlast\fR
-(inclusive) from the selection. Both \fIfirst\fR and
-\fIlast\fR are ids representing a range of entries.
-If \fIlast\fR isn't given, then only \fIfirst\fR is deselected.
-Entries outside the selection are not affected.
-.TP
-\fIpathName \fBselection clearall\fR
-Clears the entire selection.
-.TP
-\fIpathName \fBselection mark \fItagOrId\fR
-Sets the selection mark to the node given by \fItagOrId\fR. This
-causes the range of entries between the anchor and the mark to be
-temporarily added to the selection. The selection mark is the end of
-the selection that is fixed while dragging out a selection with the
-mouse. The special id \fBmark\fR may be used to refer to the current
-mark node.
-If \fItagOrId\fR refers to a non-existent node, then the mark
-is ignored.
-Resetting the mark will unselect
-the previous range. Setting the anchor finalizes the range.
-.TP
-\fIpathName \fBselection includes \fItagOrId\fR
-Returns 1 if the node given by \fItagOrId\fR is currently
-selected, 0 if it isn't.
-.TP
-\fIpathName \fBselection present\fR
-Returns 1 if any nodes are currently selected and 0 otherwise.
-.TP
-\fIpathName \fBselection set \fIfirst \fR?\fIlast\fR?
-Selects all of the nodes in the range between
-\fIfirst\fR and \fIlast\fR, inclusive, without affecting
-the selection state of nodes outside that range.
-.TP
-\fIpathName \fBselection toggle \fIfirst \fR?\fIlast\fR?
-Selects/deselects nodes in the range between
-\fIfirst\fR and \fIlast\fR, inclusive, from the selection.
-If a node is currently selected, it becomes deselected, and
-visa versa.
-.RE
-.TP
-\fIpathName \fBshow \fR?\fBflags\fR? \fItagOrId\fR...
-Exposes all nodes matching the criteria given by \fIflags\fR. This
-is the inverse of the \fBhide\fR operation. The search is performed
-recursively for each node given by \fItagOrId\fR. The valid flags are
-described below:
-.RS
-.TP 1.25i
-\fB\-name\fI pattern\fR
-Specifies pattern to match against node names.
-.TP 1.25i
-\fB\-full\fI pattern\fR
-Specifies pattern to match against node pathnames.
-.TP 1.25i
-\fB\-\fIoption\fI pattern\fR
-Specifies pattern to match against the entry's configuration option.
-.TP 1.25i
-\fB\-exact\fR
-Match patterns exactly. The is the default.
-.TP 1.25i
-\fB\-glob\fR
-\fB\-glob\fR
-Use global pattern matching. Matching is done in a fashion
-similar to that used by the C-shell. For the two
-strings to match, their contents must be identical
-except that the following special sequences may
-appear in pattern:
-.RS
-.TP 5
-\f(CW*\fR
-Matches any sequence of characters in
-string, including a null string.
-.TP 5
-\f(CW?\fR
-Matches any single character in string.
-.TP 5
-\f(CW[\fIchars\f(CW]\fR
-Matches any character in the set given by \fIchars\fR. If a sequence of the
-form \fIx\fR-\fIy\fR appears in \fIchars\fR, then any character between
-\fIx\fR and \fIy\fR,
-inclusive, will match.
-.TP 5
-\f(CW\\\fIx\fR
-Matches the single character \fIx\fR. This
-provides a way of avoiding the special
-interpretation of the characters \f(CW*?[]\\\fR in
-the pattern.
-.RE
-.TP 1.25i
-\fB\-regexp\fR
-Use regular expression pattern matching (i.e. the same as implemented
-by the \fBregexp\fR command).
-.TP 1.25i
-\fB\-nonmatching\fR
-Expose nodes that don't match.
-.TP 1.25i
-\fB\-\-\fR
-Indicates the end of flags.
-.RE
-.TP
-\fIpathName \fBsort\fR ?\fIoperation\fR? \fIargs...\fR
-.RS
-.TP
-\fIpathName \fBsort auto\fR ?\fIboolean\fR
-Turns on/off automatic sorting of node entries. If \fIboolean\fR is
-true, entries will be automatically sorted as they are opened,
-closed, inserted, or deleted. If no \fIboolean\fR argument is
-provided, the current state is returned.
-.TP
-\fIpathName \fBsort cget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBsort configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the sorting configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given sorting option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described below:
-.RS
-.TP
-\fB\-column\fI string\fR
-Specifies the column to sort. Entries in the widget are rearranged
-according to this column. If \fIcolumn\fR is \f(CW""\fR then
-no sort is performed.
-.TP
-\fB\-command\fI string\fR
-Specifies a Tcl procedure to be called when sorting nodes.
-The procedure is called with three arguments: the pathname of the widget
-and the fields of two entries. The procedure returns 1 if the first
-node is greater than the second, -1 is the second is greater, and 0
-if equal.
-.TP
-\fB\-decreasing\fI boolean\fR
-Indicates to sort in ascending/descending order. If \fIboolean\fR
-is true, then the entries as in descending order. The default is
-\f(CWno\fR.
-.TP
-\fB\-mode\fI string\fR
-Specifies how to compare entries when sorting. \fIString\fR
-may be one of the following:
-.RS
-.TP 1.5i
-\f(CWascii\fR
-Use string comparison based upon the ASCII collation order.
-.TP 1.5i
-\f(CWdictionary\fR
-Use dictionary-style comparison. This is the same as \f(CWascii\fR
-except (a) case is ignored except as a tie-breaker and (b) if two
-strings contain embedded numbers, the numbers compare as integers, not
-characters. For example, "bigBoy" sorts between
-"bigbang" and "bigboy", and "x10y" sorts between "x9y" and "x11y".
-.TP 1.5i
-\f(CWinteger\fR
-Compares fields as integers.
-.TP 1.5i
-\f(CWreal\fR
-Compares fields as floating point numbers.
-.TP 1.5i
-\f(CWcommand\fR
-Use the Tcl proc specified by the \fB\-command\fR option to compare entries
-when sorting. If no command is specified, the sort reverts to
-\f(CWascii\fR sorting.
-.RE
-.RE
-.TP
-\fIpathName \fBsort once\fR ?\fIflags\fR? \fItagOrId...\fR
-Sorts the children for each entries specified by \fItagOrId\fR.
-By default, entries are sorted by name, but you can specify a
-Tcl proc to do your own comparisons.
-.RS
-.TP 1.5i
-\fB\-recurse\fR
-Recursively sort the entire branch, not just the children.
-.RE
-.RE
-.TP
-\fIpathName \fBtag \fIoperation args\fR
-Tags are a general means of selecting and marking nodes in the tree.
-A tag is just a string of characters, and it may take any form except
-that of an integer. The same tag may be associated with many
-different nodes.
-.sp
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for tags are listed below.
-.RS
-.TP
-\fIpathName\fR \fBtag add\fR \fIstring\fR \fIid\fR...
-Adds the tag \fIstring\fR to one of more entries.
-.TP
-\fIpathName\fR \fBtag delete\fR \fIstring\fR \fIid\fR...
-Deletes the tag \fIstring\fR from one or more entries.
-.TP
-\fIpathName\fR \fBtag forget\fR \fIstring\fR
-Removes the tag \fIstring\fR from all entries. It's not an error if no
-entries are tagged as \fIstring\fR.
-.TP
-\fIpathName\fR \fBtag names\fR ?\fIid\fR?
-Returns a list of tags used. If an \fIid\fR argument
-is present, only those tags used by the node designated by \fIid\fR
-are returned.
-.TP
-\fIpathName\fR \fBtag nodes\fR \fIstring\fR
-Returns a list of ids that have the tag \fIstring\fR. If no node
-is tagged as \fIstring\fR, then an empty string is returned.
-.RE
-.TP
-\fIpathName \fBtext \fIoperation\fR ?\fIargs\fR?
-This operation is used to provide text editing for cells (data
-fields in a column) or entry labels.
-It has several forms, depending on \fIoperation\fR:
-.RS
-.TP
-\fIpathName \fBtext apply\fR
-Applies the edited buffer, replacing the entry label
-or data field. The edit window is hidden.
-.TP
-\fIpathName \fBtext cancel\fR
-Cancels the editing operation, reverting the entry label
-or data value back to the previous value. The edit window is hidden.
-.TP
-\fIpathName \fBtext cget\fI value\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBtext configure\fR ?\fIoption value\fR?
-Query or modify the configuration options of the edit window.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "TEXT EDITING OPTIONS"
-below.
-.RE
-.TP
-\fIpathName \fBtext delete\fI first last\fR
-Deletes the characters in the edit buffer between the two given
-character positions.
-.TP
-\fIpathName \fBtext get\fR ?\fI\-root\fR? \fIx y\fR
-.TP
-\fIpathName \fBtext icursor\fI index\fR
-.TP
-\fIpathName \fBtext index\fI index\fR
-Returns the text index of given \fIindex\fR.
-.TP
-\fIpathName \fBtext insert\fI index string\fR
-Insert the text string \fIstring\fR into the edit buffer at the index
-\fIindex\fR. For example, the index 0 will prepend the buffer.
-.TP
-\fIpathName \fBtext selection\fI args\fR
-This operation controls the selection of the editing window. Note
-that this differs from the selection of entries.
-It has the following forms:
-.RS
-.TP
-\fIpathName \fBtext selection adjust\fI index\fR
-Adjusts either the first or last index of the selection.
-.TP
-\fIpathName \fBtext selection clear\fR
-Clears the selection.
-.TP
-\fIpathName \fBtext selection from\fI index\fR
-Sets the anchor of the selection.
-.TP
-\fIpathName \fBtext selection present\fR
-Indicates if a selection is present.
-.TP
-\fIpathName \fBtext selection range\fI start end\fR
-Sets both the anchor and mark of the selection.
-.TP
-\fIpathName \fBtext selection to\fI index\fR
-Sets the unanchored end (mark) of the selection.
-.RE
-.TP
-\fIpathName \fBtoggle \fItagOrId\fR
-Opens or closes the node given by \fItagOrId\fR. If the corresponding
-\fB\-opencommand\fR or \fB\-closecommand\fR option is set, then that
-command is also invoked.
-.TP
-\fIpathName \fBxview \fIargs\fR
-This command is used to query and change the horizontal position of the
-information in the widget's window. It can take any of the following
-forms:
-.RS
-.TP
-\fIpathName \fBxview\fR
-Returns a list containing two elements.
-Each element is a real fraction between 0 and 1; together they describe
-the horizontal span that is visible in the window.
-For example, if the first element is .2 and the second element is .6,
-20% of the \fBtreeview\fR widget's text is off-screen to the left,
-the middle 40% is visible
-in the window, and 40% of the text is off-screen to the right.
-These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
-option.
-.TP
-\fIpathName \fBxview\fR \fItagOrId\fR
-Adjusts the view in the window so that the character position given by
-\fItagOrId\fR is displayed at the left edge of the window.
-Character positions are defined by the width of the character \fB0\fR.
-.TP
-\fIpathName \fBxview moveto\fI fraction\fR
-Adjusts the view in the window so that \fIfraction\fR of the
-total width of the \fBtreeview\fR widget's text is off-screen to the left.
-\fIfraction\fR must be a fraction between 0 and 1.
-.TP
-\fIpathName \fBxview scroll \fInumber what\fR
-This command shifts the view in the window left or right according to
-\fInumber\fR and \fIwhat\fR.
-\fINumber\fR must be an integer.
-\fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviation
-of one of these.
-If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
-\fInumber\fR character units (the width of the \fB0\fR character)
-on the display; if it is \fBpages\fR then the view adjusts by
-\fInumber\fR screenfuls.
-If \fInumber\fR is negative then characters farther to the left
-become visible; if it is positive then characters farther to the right
-become visible.
-.RE
-.TP
-\fIpathName \fByview \fI?args\fR?
-This command is used to query and change the vertical position of the
-text in the widget's window.
-It can take any of the following forms:
-.RS
-.TP
-\fIpathName \fByview\fR
-Returns a list containing two elements, both of which are real fractions
-between 0 and 1.
-The first element gives the position of the node at the
-top of the window, relative to the widget as a whole (0.5 means
-it is halfway through the treeview window, for example).
-The second element gives the position of the node just after
-the last one in the window, relative to the widget as a whole.
-These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR
-option.
-.TP
-\fIpathName \fByview\fR \fItagOrId\fR
-Adjusts the view in the window so that the node given by
-\fItagOrId\fR is displayed at the top of the window.
-.TP
-\fIpathName \fByview moveto\fI fraction\fR
-Adjusts the view in the window so that the node given by \fIfraction\fR
-appears at the top of the window.
-\fIFraction\fR is a fraction between 0 and 1; 0 indicates the first
-node, 0.33 indicates the node one-third the
-way through the \fBtreeview\fR widget, and so on.
-.TP
-\fIpathName \fByview scroll \fInumber what\fR
-This command adjusts the view in the window up or down according to
-\fInumber\fR and \fIwhat\fR.
-\fINumber\fR must be an integer.
-\fIWhat\fR must be either \fBunits\fR or \fBpages\fR.
-If \fIwhat\fR is \fBunits\fR, the view adjusts up or down by
-\fInumber\fR lines; if it is \fBpages\fR then
-the view adjusts by \fInumber\fR screenfuls.
-If \fInumber\fR is negative then earlier nodes
-become visible; if it is positive then later nodes
-become visible.
-.RE
-.SH "TREEVIEW OPTIONS"
-In addition to the \fBconfigure\fR operation, widget configuration
-options may also be set by the Tk \fBoption\fR command. The class
-resource name is \f(CWTreeView\fR.
-.CS
-option add *TreeView.Foreground white
-option add *TreeView.Background blue
-.CE
-The following widget options are available:
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the background color for active entries. A node
-is active when the mouse passes over it's entry or using the
-\fBactivate\fR operation.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the foreground color of the active node. A node
-is active when the mouse passes over it's entry or using the
-\fBactivate\fR operation.
-.TP
-\fB\-activeicons \fIimages\fR
-Specifies images to be displayed for an entry's icon
-when it is active. \fIImages\fR is a list of two Tk images:
-the first image is displayed when the node is open, the
-second when it is closed.
-.TP
-\fB\-autocreate \fIboolean\fR
-If \fIboolean\fR is true, automatically create missing ancestor
-nodes when inserting new nodes. Otherwise flag an error.
-The default is \f(CWno\fR.
-.TP
-\fB\-allowduplicates \fIboolean\fR
-If \fIboolean\fR is true, allow nodes with duplicate pathnames
-when inserting new nodes. Otherwise flag an error.
-The default is \f(CWno\fR.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the widget. The default is \f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the outside edge of the widget. The
-\fB\-relief\fR option determines if the border is to be drawn. The
-default is \f(CW2\fR.
-.TP
-\fB\-closecommand \fIstring\fR
-Specifies a Tcl script to be invoked when a node is closed. You can
-overrider this for individual entries using the entry's \fB\-closecommand\fR
-option. The default is \f(CW""\fR.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.TP
-\fB\-cursor \fIcursor\fR
-Specifies the widget's cursor. The default cursor is \f(CW""\fR.
-.TP
-\fB\-dashes \fInumber\fR
-Sets the dash style of the horizontal and vertical lines drawn connecting
-entries. \fINumber\fR is the length in pixels of the dashes and gaps in
-the line. If \fInumber\fR is \f(CW0\fR, solid lines will
-be drawn. The default is \f(CW1\fR (dotted).
-.TP
-\fB\-exportselection \fIboolean\fR
-Indicates if the selection is exported. If the widget is exporting its
-selection then it will observe the standard X11 protocols for handling
-the selection. Selections are available as type \fBSTRING\fR;
-the value of the selection will be the label of the selected nodes,
-separated by newlines. The default is \f(CWno\fR.
-.TP
-\fB\-flat \fIboolean\fR
-Indicates whether to display the tree as a flattened list.
-If \fIboolean\fR is true, then the hierarchy will be a list of full
-paths for the nodes. This option also has affect on sorting.
-See the
-.SB "SORT OPERATIONS"
-section for more information.
-The default is \f(CWno\fR.
-.TP
-\fB\-focusdashes \fIdashList\fR
-Sets the dash style of the outline rectangle drawn around the entry
-label of the node that current has focus. \fINumber\fR is the length
-in pixels of the dashes and gaps in the line. If
-\fInumber\fR is \f(CW0\fR, a solid line will be drawn. The default is
-\f(CW1\fR.
-.TP
-\fB\-focusforeground \fIcolor\fR
-Sets the color of the focus rectangle.
-The default is \f(CWblack\fR.
-.TP
-\fB\-font \fIfontName\fR
-Specifies the font for entry labels. You can override this for individual
-entries with the entry's \fB\-font\fR configuration option. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the text color of entry labels. You can override this for individual
-entries with the entry's \fB\-foreground\fR configuration option.
-The default is
-\f(CWblack\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the requested height of widget. The default is
-\f(CW400\fR.
-.TP
-\fB\-hideroot \fIboolean\fR
-If \fIboolean\fR is true, it indicates that no entry for the root node
-should be displayed. The default is \f(CWno\fR.
-.TP
-\fB\-highlightbackground \fIcolor\fR
-Specifies the normal color of the traversal highlight region when
-the widget does not have the input focus.
-.TP
-\fB\-highlightcolor \fIcolor\fR
-Specifies the color of the traversal highlight rectangle when
-the widget has the input focus.
-The default is \f(CWblack\fR.
-.TP
-\fB\-highlightthickness \fIpixels\fR
-Specifies the width of the highlight rectangle indicating when the
-widget has input focus. The value may have any of the forms acceptable
-to \fBTk_GetPixels\fR. If the value is zero, no focus highlight will
-be displayed. The default is \f(CW2\fR.
-.TP
-\fB\-icons \fIimages\fR
-Specifies images for the entry's icon.
-\fIImages\fR is a list of two Tk images:
-the first image is displayed when the node is open, the
-second when it is closed.
-.TP
-\fB\-linecolor \fIcolor\fR
-Sets the color of the connecting lines drawn between entries.
-The default is \f(CWblack\fR.
-.TP
-\fB\-linespacing \fIpixels\fR
-Sets the number of pixels spacing between entries.
-The default is \f(CW0\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Set the width of the lines drawn connecting entries. If \fIpixels\fR
-is \f(CW0\fR, no vertical or horizontal lines are drawn.
-The default is \f(CW1\fR.
-.TP
-\fB\-opencommand \fIstring\fR
-Specifies a Tcl script to be invoked when a node is open.
-You can override this for individual entries with the entry's
-\fB\-opencommand\fR configuration option. The default is \f(CW""\fR.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for the widget. \fIRelief\fR
-specifies how the \fBtreeview\fR widget should appear relative to widget
-it is packed into; for example, \f(CWraised\fR means the \fBtreeview\fR widget
-should appear to protrude. The default is \f(CWsunken\fR.
-.TP
-\fB\-scrollmode \fImode\fR
-Specifies the style of scrolling to be used. The following
-styles are valid. This is the default is \f(CWhierbox\fR.
-.RS
-.TP 1.25i
-\f(CWlistbox\fR
-Like the \fBlistbox\fR widget, the last entry can always be
-scrolled to the top of the widget window. This allows the scrollbar
-thumb to shrink as the last entry is scrolled upward.
-.TP 1.25i
-\f(CWhierbox\fR
-Like the \fBhierbox\fR widget, the last entry can only be
-viewed at the bottom of the widget window. The scrollbar
-stays a constant size.
-.TP 1.25i
-\f(CWcanvas\fR
-Like the \fBcanvas\fR widget, the entries are bound within
-the scrolling area.
-.RE
-.TP
-\fB\-selectbackground \fIcolor\fR
-Sets the background color selected node entries.
-The default is \f(CW#ffffea\fR.
-.TP
-\fB\-selectborderwidth \fIpixels\fR
-Sets the width of the raised 3-D border drawn around the labels
-of selected entries. The default is \f(CW0\fR.
-\fB\-selectcommand \fIstring\fR
-Specifies a Tcl script to invoked when the set of selected
-nodes changes.
-The default is \f(CW""\fR.
-.TP
-\fB\-selectforeground \fIcolor\fB
-Sets the color of the labels of selected node entries.
-The default is \f(CWblack\fR.
-.TP
-\fB\-selectmode \fImode\fR
-Specifies the selection mode. If \fImode\fR is
-\f(CWsingle\fR, only one node can be selected
-at a time. If \f(CWmultiple\fR more than one
-node can be selected.
-The default is \f(CWsingle\fR.
-.TP
-\fB\-separator \fIstring\fR
-Specifies the character sequence to use when spliting the path components.
-The separator may be several characters wide (such as "::")
-Consecutive separators in a pathname are treated as one.
-If \fIstring\fR is the empty string, the pathnames are Tcl lists.
-Each element is a path component. The default is \f(CW""\fR.
-.TP
-\fB\-showtitles \fIboolean\fR
-If \fIboolean\fR is false, column titles are not be displayed.
-The default is \f(CWyes\fR.
-.TP
-\fB\-sortselection \fIboolean\fR
-If \fIboolean\fR is true, nodes in the selection are ordered as they
-are currently displayed (depth-first or sorted), not in the order
-they were selected. The default is \f(CWno\fR.
-.TP
-\fB\-takefocus\fR \fIfocus\fR
-Provides information used when moving the focus from window to window
-via keyboard traversal (e.g., Tab and Shift-Tab). If \fIfocus\fR is
-\f(CW0\fR, this means that this window should be skipped entirely during
-keyboard traversal. \f(CW1\fR means that the this window should always
-receive the input focus. An empty value means that the traversal
-scripts make the decision whether to focus on the window.
-The default is \f(CW"1"\fR.
-.TP
-\fB\-trim \fIstring\fR
-Specifies a string leading characters to trim from entry pathnames
-before parsing. This only makes sense if the \fB\-separator\fR is also
-set. The default is \f(CW""\fR.
-.TP
-\fB\-width \fIpixels\fR
-Sets the requested width of the widget. If \fIpixels\fR is 0, then
-the with is computed from the contents of the \fBtreeview\fR widget.
-The default is \f(CW200\fR.
-.TP
-\fB\-xscrollcommand \fIstring\fR
-Specifies the prefix for a command used to communicate with horizontal
-scrollbars. Whenever the horizontal view in the widget's window
-changes, the widget will generate a Tcl command by concatenating the
-scroll command and two numbers. If this option is not specified, then
-no command will be executed.
-.TP
-\fB\-xscrollincrement\fR \fIpixels\fR
-Sets the horizontal scrolling distance. The default is 20 pixels.
-.TP
-\fB\-yscrollcommand \fIstring\fR
-Specifies the prefix for a command used to communicate with vertical
-scrollbars. Whenever the vertical view in the widget's window
-changes, the widget will generate a Tcl command by concatenating the
-scroll command and two numbers. If this option is not specified, then
-no command will be executed.
-.TP
-\fB\-yscrollincrement\fR \fIpixels\fR
-Sets the vertical scrolling distance. The default is 20 pixels.
-.SH "ENTRY OPTIONS"
-Many widget configuration options have counterparts in entries. For
-example, there is a \fB\-closecommand\fR configuration option for both
-widget itself and for individual entries. Options set at the widget
-level are global for all entries. If the entry configuration option
-is set, then it overrides the widget option. This is done to avoid
-wasting memory by replicated options. Most entries will have
-redundant options.
-.PP
-There is no resource class or name for entries.
-.TP
-\fB\-activeicons \fIimages\fR
-Specifies images to be displayed as the entry's icon
-when it is active. This overrides the global \fB\-activeicons\fR
-configuration option for the specific entry.
-\fIImages\fR is a list of two Tk images:
-the first image is displayed when the node is open, the
-second when it is closed.
-.TP
-\fB\-bindtags \fItagList\fR
-Specifies the binding tags for nodes. \fITagList\fR is a list
-of binding tag names. The tags and their order will determine how
-events are handled for nodes. Each tag in the list matching the current
-event sequence will have its Tcl command executed. The default value
-is \f(CWall\fR.
-.TP
-\fB\-button \fIstring\fR
-Indicates whether a button should be displayed on the left side
-of the node entry. \fIString\fR can be \f(CWyes\fR, \f(CWno\fR,
-or \f(CWauto\fR. If \f(CWauto\fR, then a button is automatically
-displayed if the node has children. This is the default.
-.TP
-\fB\-closecommand \fIstring\fR
-Specifies a Tcl script to be invoked when the node is closed. This
-overrides the global \fB\-closecommand\fR option for this entry.
-The default is \f(CW""\fR.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.TP
-\fB\-data \fIstring\fR
-Sets data fields for the node. \fIString\fR is a list of
-name-value pairs to be set. The default is \f(CW""\fR.
-.TP
-\fB\-font \fIfontName\fR
-Sets the font for entry labels. This overrides the widget's
-\fB\-font\fR option for this node. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the text color of the entry label. This overrides the widget's
-\fB\-foreground\fR configuration option. The default is \f(CW""\fR.
-.TP
-\fB\-icons \fIimages\fR
-Specifies images to be displayed for the entry's icon.
-This overrides the global \fB\-icons\fR configuration option.
-\fIImages\fR is a list of two Tk images:
-the first image is displayed when the node is open, the
-second when it is closed.
-.TP
-\fB\-label \fIstring\fR
-Sets the text for the entry's label. If not set, this
-defaults to the name of the node. The default is \f(CW""\fR.
-.TP
-\fB\-opencommand \fIstring\fR
-Specifies a Tcl script to be invoked when the entry is opened.
-This overrides the widget's \fB\-opencommand\fR option for this node.
-The default is \f(CW""\fR.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.SH "BUTTON OPTIONS"
-Button configuration options may also be set by the \fBoption\fR command.
-The resource subclass is \f(CWButton\fR. The resource name is always
-\f(CWbutton\fR.
-.CS
-option add *TreeView.Button.Foreground white
-option add *TreeView.button.Background blue
-.CE
-The following are the configuration options available for buttons.
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the background color of active buttons. A button
-is made active when the mouse passes over it or by the
-\fBbutton activate\fR operation.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the foreground color of active buttons. A button
-is made active when the mouse passes over it or by the
-\fBbutton activate\fR operation.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background of the button. The default is \f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the button.
-The \fB\-relief\fR option determines if a border is to be drawn. The
-default is \f(CW1\fR.
-.TP
-\fB\-closerelief \fIrelief\fR
-Specifies the 3-D effect for the closed button. \fIRelief\fR
-indicates how the button should appear relative to the widget;
-for example, \f(CWraised\fR means the button should
-appear to protrude. The default is \f(CWsolid\fR.
-.TP
-\fB\-cursor \fIcursor\fR
-Sets the widget's cursor. The default cursor is \f(CW""\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the foreground color of buttons.
-The default is \f(CWblack\fR.
-.TP
-\fB\-images \fIimages\fR
-Specifies images to be displayed for the button.
-\fIImages\fR is a list of two Tk images:
-the first image is displayed when the button is open, the
-second when it is closed. If the \fIimages\fR is the empty string,
-then a plus/minus gadget is drawn. The default is \f(CW""\fR.
-.TP
-\fB\-openrelief \fIrelief\fR
-Specifies the 3-D effect of the open button. \fIRelief\fR
-indicates how the button should appear relative to the widget;
-for example, \f(CWraised\fR means the button should
-appear to protrude. The default is \f(CWflat\fR.
-.TP
-\fB\-size \fIpixels\fR
-Sets the requested size of the button.
-The default is \f(CW0\fR.
-.RE
-.SH "COLUMN OPTIONS"
-Column configuration options may also be set by the \fBoption\fR command.
-The resource subclass is \f(CWColumn\fR. The resource name is the
-name of the column.
-.CS
-option add *TreeView.Column.Foreground white
-option add *TreeView.treeView.Background blue
-.CE
-The following configuration options are available for columns.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the column. This overrides
-the widget's \fB\-background\fR option. The default is \f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border of the column.
-The \fB\-relief\fR option determines if a border is to be drawn. The
-default is \f(CW0\fR.
-.TP
-\fB\-edit \fIboolean\fR
-Indicates if the column's data fields can be edited. If \fIboolean\fR is
-false, the data fields in the column may not be edited.
-The default is \f(CWyes\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Specifies the foreground color of the column.
-You can override this for individual entries with the entry's
-\fB\-foreground\fR option.
-The default is \f(CWblack\fR.
-.TP
-\fB\-font \fIfontName\fR
-Sets the font for a column. You can override this for individual entries
-with the entry's \fB\-font\fR option. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-hide \fIboolean\fR
-If \fIboolean\fR is true, the column is not displayed.
-The default is \f(CWyes\fR.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the column data fields title should be justified within
-the column. This matters only when the column is wider than the
-data field to be display.
-\fIJustify\fR must be \f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR.
-The default is \f(CWleft\fR.
-.TP
-\fB\-pad \fIpad\fR
-Specifies how much padding for the left and right sides of the column.
-\fIPad\fR is a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the column is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default is \f(CW2\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect of the column. \fIRelief\fR
-specifies how the column should appear relative to the widget;
-for example, \f(CWraised\fR means the column should
-appear to protrude. The default is \f(CWflat\fR.
-.TP
-\fB\-state \fIstate\fR
-Sets the state of the column. If \fIstate\fR is \f(CWdisable\fR then
-the column title can not be activated nor invoked.
-The default is \f(CWnormal\fR.
-.TP
-\fB\-text \fIstring\fR
-Sets the title for the column.
-The default is \f(CW""\fR.
-.TP
-\fB\-titleforeground \fIcolor\fR
-Sets the foreground color of the column title.
-The default is \f(CWblack\fR.
-.TP
-\fB\-titleshadow \fIcolor\fR
-Sets the color of the drop shadow of the column title.
-The default is \f(CW""\fR.
-.TP
-\fB\-width \fIpixels\fR
-Sets the requested width of the column. This overrides
-the computed with of the column. If \fIpixels\fR is 0,
-the width is computed as from the contents of the column. The
-default is \f(CW0\fR.
-.RE
-.SH "TEXT EDITING OPTIONS"
-Text edit window configuration options may also be set by the
-\fBoption\fR command. The resource class is \f(CWTreeViewEditor\fR.
-The resource name is always \f(CWedit\fR.
-.CS
-option add *TreeViewEditor.Foreground white
-option add *edit.Background blue
-.CE
-The following are the configuration options available for the
-text editing window.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background of the text edit window. The default is \f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the edit window.
-The \fB\-relief\fR option determines if a border is to be drawn. The
-default is \f(CW1\fR.
-.TP
-\fB\-exportselection \fIboolean\fR
-Indicates if the text selection is exported. If the edit window is
-exporting its selection then it will observe the standard X11 protocols
-for handling the selection. Selections are available as type \fBSTRING\fR.
-The default is \f(CWno\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect of the edit window. \fIRelief\fR
-indicates how the background should appear relative to the edit
-window; for example, \f(CWraised\fR means the background should
-appear to protrude. The default is \f(CWsolid\fR.
-.TP
-\fB\-selectbackground \fIcolor\fR
-Sets the background of the selected text in the edit window.
-The default is \f(CWwhite\fR.
-.TP
-\fB\-selectborderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the selected text in the
-edit window. The \fB\-selectrelief\fR option determines if a border
-is to be drawn. The default is \f(CW1\fR.
-.TP
-\fB\-selectforeground \fIcolor\fR
-Sets the foreground of the selected text in the edit window.
-The default is \f(CWwhite\fR.
-.TP
-\fB\-selectrelief \fIrelief\fR
-Specifies the 3-D effect of the selected text in the edit window.
-\fIRelief\fR indicates how the text should appear relative to the edit
-window; for example, \f(CWraised\fR means the text should
-appear to protrude. The default is \f(CWflat\fR.
-.RE
-.SH "DEFAULT BINDINGS"
-Tk automatically creates class bindings for treeviews that give them
-Motif-like behavior. Much of the behavior of a \fBtreeview\fR widget is determined
-by its \fB\-selectmode\fR option, which selects one of two ways
-of dealing with the selection.
-.PP
-If the selection mode is \fBsingle\fR, only one node can be
-selected at a time.
-Clicking button 1 on an node selects
-it and deselects any other selected item.
-.PP
-If the selection mode is \fBmultiple\fR,
-any number of entries may be selected at once, including discontiguous
-ranges. Clicking Control-Button-1 on a node entry
-toggles its selection state without affecting any other entries.
-Pressing Shift-Button-1 on a node entry selects
-it, extends the selection.
-.IP [1]
-In \fBextended\fR mode, the selected range can be adjusted by pressing
-button 1 with the Shift key down: this modifies the selection to
-consist of the entries between the anchor and the entry under
-the mouse, inclusive.
-The un-anchored end of this new selection can also be dragged with
-the button down.
-.IP [2]
-In \fBextended\fR mode, pressing button 1 with the Control key down
-starts a toggle operation: the anchor is set to the entry under
-the mouse, and its selection state is reversed. The selection state
-of other entries isn't changed.
-If the mouse is dragged with button 1 down, then the selection state
-of all entries between the anchor and the entry under the mouse
-is set to match that of the anchor entry; the selection state of
-all other entries remains what it was before the toggle operation
-began.
-.IP [3]
-If the mouse leaves the treeview window with button 1 down, the window
-scrolls away from the mouse, making information visible that used
-to be off-screen on the side of the mouse.
-The scrolling continues until the mouse re-enters the window, the
-button is released, or the end of the hierarchy is reached.
-.IP [4]
-Mouse button 2 may be used for scanning.
-If it is pressed and dragged over the \fBtreeview\fR widget, the contents of
-the hierarchy drag at high speed in the direction the mouse moves.
-.IP [5]
-If the Up or Down key is pressed, the location cursor (active
-entry) moves up or down one entry.
-If the selection mode is \fBbrowse\fR or \fBextended\fR then the
-new active entry is also selected and all other entries are
-deselected.
-In \fBextended\fR mode the new active entry becomes the
-selection anchor.
-.IP [6]
-In \fBextended\fR mode, Shift-Up and Shift-Down move the location
-cursor (active entry) up or down one entry and also extend
-the selection to that entry in a fashion similar to dragging
-with mouse button 1.
-.IP [7]
-The Left and Right keys scroll the \fBtreeview\fR widget view left and right
-by the width of the character \fB0\fR.
-Control-Left and Control-Right scroll the \fBtreeview\fR widget view left and
-right by the width of the window.
-Control-Prior and Control-Next also scroll left and right by
-the width of the window.
-.IP [8]
-The Prior and Next keys scroll the \fBtreeview\fR widget view up and down
-by one page (the height of the window).
-.IP [9]
-The Home and End keys scroll the \fBtreeview\fR widget horizontally to
-the left and right edges, respectively.
-.IP [10]
-Control-Home sets the location cursor to the the first entry,
-selects that entry, and deselects everything else
-in the widget.
-.IP [11]
-Control-End sets the location cursor to the the last entry,
-selects that entry, and deselects everything else
-in the widget.
-.IP [12]
-In \fBextended\fR mode, Control-Shift-Home extends the selection
-to the first entry and Control-Shift-End extends
-the selection to the last entry.
-.IP [13]
-In \fBmultiple\fR mode, Control-Shift-Home moves the location cursor
-to the first entry and Control-Shift-End moves
-the location cursor to the last entry.
-.IP [14]
-The space and Select keys make a selection at the location cursor
-(active entry) just as if mouse button 1 had been pressed over
-this entry.
-.IP [15]
-In \fBextended\fR mode, Control-Shift-space and Shift-Select
-extend the selection to the active entry just as if button 1
-had been pressed with the Shift key down.
-.IP [16]
-In \fBextended\fR mode, the Escape key cancels the most recent
-selection and restores all the entries in the selected range
-to their previous selection state.
-.IP [17]
-Control-slash selects everything in the widget, except in
-\fBsingle\fR and \fBbrowse\fR modes, in which case it selects
-the active entry and deselects everything else.
-.IP [18]
-Control-backslash deselects everything in the widget, except in
-\fBbrowse\fR mode where it has no effect.
-.IP [19]
-The F16 key (labelled Copy on many Sun workstations) or Meta-w
-copies the selection in the widget to the clipboard, if there is
-a selection.
-.PP
-The behavior of \fBtreeview\fR widgets can be changed by defining new bindings
-for individual widgets or by redefining the class bindings.
-.SS WIDGET BINDINGS
-In addition to the above behavior, the following additional behavior
-is defined by the default widget class (TreeView) bindings.
-.IP \f(CW<ButtonPress-2>\fR
-Starts scanning.
-.IP \f(CW<B2-Motion>\fR
-Adjusts the scan.
-.IP \f(CW<ButtonRelease-2>\fR
-Stops scanning.
-.IP \f(CW<B1-Leave>\fR
-Starts auto-scrolling.
-.IP \f(CW<B1-Enter>\fR
-Starts auto-scrolling
-.IP \f(CW<KeyPress-Up>\fR
-Moves the focus to the previous entry.
-.IP \f(CW<KeyPress-Down>\fR
-Moves the focus to the next entry.
-.IP \f(CW<Shift-KeyPress-Up>\fR
-Moves the focus to the previous sibling.
-.IP \f(CW<Shift-KeyPress-Down>\fR
-Moves the focus to the next sibling.
-.IP \f(CW<KeyPress-Prior>\fR
-Moves the focus to first entry. Closed or hidden entries
-are ignored.
-.IP \f(CW<KeyPress-Next>\fR
-Move the focus to the last entry. Closed or hidden entries
-are ignored.
-.IP \f(CW<KeyPress-Left>\fR
-Closes the entry. It is not an error if the entry has no children.
-.IP \f(CW<KeyPress-Right>\fR
-Opens the entry, displaying its children. It is not an
-error if the entry has no children.
-.IP \f(CW<KeyPress-space>\fR
-In "single" select mode this selects the entry. In "multiple" mode,
-it toggles the entry (if it was previous selected, it is not
-deselected).
-.IP \f(CW<KeyRelease-space>\fR
-Turns off select mode.
-.IP \f(CW<KeyPress-Return>\fR
-Sets the focus to the current entry.
-.IP \f(CW<KeyRelease-Return>\fR
-Turns off select mode.
-.IP \f(CW<KeyPress>\fR
-Moves to the next entry whose label starts with the letter typed.
-.IP \f(CW<KeyPress-Home>\fR
-Moves the focus to first entry. Closed or hidden entries
-are ignored.
-.IP \f(CW<KeyPress-End>\fR
-Move the focus to the last entry. Closed or hidden entries
-are ignored.
-.IP \f(CW<KeyPress-F1>\fR
-Opens all entries.
-.IP \f(CW<KeyPress-F2>\fR
-Closes all entries (except root).
-.SS BUTTON BINDINGS
-Buttons have bindings. There are associated with the "all" bindtag
-(see the entry's -bindtag option). You can use the \fBbind\fR
-operation to change them.
-.IP \f(CW<Enter>\fR
-Highlights the button of the current entry.
-.IP \f(CW<Leave>\fR
-Returns the button back to its normal state.
-.IP \f(CW<ButtonRelease-1>\fR
-Adjust the view so that the current entry is visible.
-.SS ENTRY BINDINGS
-Entries have default bindings. There are associated with the "all"
-bindtag (see the entry's -bindtag option). You can use the \fBbind\fR
-operation to modify them.
-.IP \f(CW<Enter>\fR
-Highlights the current entry.
-.IP \f(CW<Leave>\fR
-Returns the entry back to its normal state.
-.IP \f(CW<ButtonPress-1>\fR
-Sets the selection anchor the current entry.
-.IP \f(CW<Double-ButtonPress-1>\fR
-Toggles the selection of the current entry.
-.IP \f(CW<B1-Motion>\fR
-For "multiple" mode only. Saves the current location of the
-pointer for auto-scrolling. Resets the selection mark.
-.IP \f(CW<ButtonRelease-1>\fR
-For "multiple" mode only. Sets the selection anchor to the
-current entry.
-.IP \f(CW<Shift-ButtonPress-1>\fR
-For "multiple" mode only. Extends the selection.
-.IP \f(CW<Shift-Double-ButtonPress-1>\fR
-Place holder. Does nothing.
-.IP \f(CW<Shift-B1-Motion>\fR
-Place holder. Does nothing.
-.IP \f(CW<Shift-ButtonRelease-1>\fR
-Stop auto-scrolling.
-.IP \f(CW<Control-ButtonPress-1>\fR
-For "multiple" mode only. Toggles and extends the selection.
-.IP \f(CW<Control-Double-ButtonPress-1>\fR
-Place holder. Does nothing.
-.IP \f(CW<Control-B1-Motion>\fR
-Place holder. Does nothing.
-.IP \f(CW<Control-ButtonRelease-1>\fR
-Stops auto-scrolling.
-.IP \f(CW<Control-Shift-ButtonPress-1>\fR
-???
-.IP \f(CW<Control-Shift-Double-ButtonPress-1>\fR
-Place holder. Does nothing.
-.IP \f(CW<Control-Shift-B1-Motion>\fR
-Place holder. Does nothing.
-.SS COLUMN BINDINGS
-Columns have bindings too. They are associated with the column's
-"all" bindtag (see the column -bindtag option). You can use the
-\fBcolumn bind\fR operation to change them.
-.IP \f(CW<Enter>\fR
-Highlights the current column title.
-.IP \f(CW<Leave>\fR
-Returns the column back to its normal state.
-.IP \f(CW<ButtonRelease-1>\fR
-Invokes the command (see the column's -command option) if one
-if specified.
-.SS COLUMN RULE BINDINGS
-.IP \f(CW<Enter>\fR
-Highlights the current and activates the ruler.
-.IP \f(CW<Leave>\fR
-Returns the column back to its normal state. Deactivates the
-ruler.
-.IP \f(CW<ButtonPress-1>\fR
-Sets the resize anchor for the column.
-.IP \f(CW<B1-Motion>\fR
-Sets the resize mark for the column.
-.IP \f(CW<ButtonRelease-1>\fR
-Adjust the size of the column, based upon the resize anchor and mark
-positions.
-.SH EXAMPLE
-The \fBtreeview\fR command creates a new widget.
-.CS
-treeview .h \-bg white
-.CE
-A new Tcl command \f(CW.h\fR is also created. This command can be used
-to query and modify the \fBtreeview\fR widget. For example, to change the
-background
-color of the table to "green", you use the new command and the widget's
-\fBconfigure\fR operation.
-.CS
-# Change the background color.
-\&.h configure \-background "green"
-.CE
-By default, the \fBtreeview\fR widget will automatically create a new tree object
-to contain the data. The name of the new tree is the pathname of the
-widget. Above, the new tree object name is ".h". But you can use the
-\fB\-tree\fR option to specify the name of another tree.
-.CS
-# View the tree "myTree".
-\&.h configure \-tree "myTree"
-.CE
-When a new tree is created, it contains only a root node. The node
-is automatically opened. The id of the root node is always
-\f(CW0\fR (you can use also use the special id \f(CWroot\fR). The
-\fBinsert\fR operation lets you insert one or more new entries into
-the tree. The last argument is the node's \fIpathname\fR.
-.CS
-# Create a new entry named "myEntry"
-set id [\&.h insert end "myEntry"]
-.CE
-This appends a new node named "myEntry". It will positioned as the
-last child of the root of the tree (using the position "end"). You
-can supply another position to order the node within its siblings.
-.CS
-# Prepend "fred".
-set id [\&.h insert 0 "fred"]
-.CE
-Entry names do not need to be unique. By default, the node's label
-is its name. To supply a different text label, add the \fB\-label\fR
-option.
-.CS
-# Create a new node named "fred"
-set id [\&.h insert end "fred" -label "Fred Flintstone"]
-.CE
-The \fBinsert\fR operation returns the id of the new node. You can
-also use the \fBindex\fR operation to get this information.
-.CS
-# Get the id of "fred"
-\&.h index "fred"
-.CE
-To insert a node somewhere other than root, use the \fB\-at\fR switch.
-It takes the id of the node where the new child will be added.
-.CS
-# Create a new node "barney" in "fred".
-\&.h insert -at $id end "barney"
-.CE
-A pathname describes the path to an entry in the hierarchy. It's a
-list of entry names that compose the path in the tree. Therefore, you
-can also add "barney" to "fred" as follows.
-.CS
-# Create a new sub-entry of "fred"
-\&.h insert end "fred barney"
-.CE
-Every name in the list is ancestor of the next. All ancestors must
-already exist. That means that an entry "fred" is an ancestor of
-"barney" and must already exist. But you can use the
-\fB\-autocreate\fR configuration option to force the creation of
-ancestor nodes.
-.CS
-# Force the creation of ancestors.
-\&.h configure -autocreate yes
-\&.h insert end "fred barney wilma betty"
-.CE
-Sometimes the pathname is already separated by a character sequence
-rather than formed as a list. A file name is a good example of this.
-You can use the \fB\-separator\fR option to specify a separator string
-to split the path into its components. Each pathname inserted is
-automatically split using the separator string as a separator.
-Multiple separators are treated as one.
-.CS
-\&.h configure -separator /
-\&.h insert end "/usr/local/tcl/bin"
-.CE
-If the path is prefixed by extraneous characters, you can
-automatically trim it off using the \fB\-trim\fR option. It removed
-the string from the path before it is parsed.
-.CS
-\&.h configure -trim C:/windows -separator /
-\&.h insert end "C:/window/system"
-.CE
-You can insert more than one entry at a time with the \fBinsert\fR
-operation. This can be much faster than looping over a list of names.
-.CS
-# The slow way
-foreach f [glob $dir/*] {
- \&.h insert end $f
-}
-# The fast way
-eval .h insert end [glob $dir/*]
-.CE
-In this case, the \fBinsert\fR operation will return a list of ids
-of the new entries.
-.PP
-You can delete entries with the \fBdelete\fR operation. It takes one or
-more tags of ids as its argument. It deletes the entry and all its
-children.
-.CS
-\&.h delete $id
-.CE
-Entries have several configuration options. They control the appearance
-of the entry's icon and label. We have already seen the \fB\-label\fR
-option that sets the entry's text label. The \fBentry configure\fR
-operation lets you set or modify an entry's configuration options.
-.CS
-\&.h entry configure $id -color red -font fixed
-.CE
-You can hide an entry and its children using the \fB\-hide\fR option.
-.CS
-\&.h entry configure $id -hide yes
-.CE
-More that one entry can be configured at once. All entries specified
-are configured with the same options.
-.CS
-\&.h entry configure $i1 $i2 $i3 $i4 -color brown
-.CE
-An icon is displayed for each entry. It's a Tk image drawn to the
-left of the label. You can set the icon with the entry's
-\fB\-icons\fR option. It takes a list of two image names: one to
-represent the open entry, another when it is closed.
-.CS
-set im1 [image create photo -file openfolder.gif]
-set im2 [image create photo -file closefolder.gif]
-\&.h entry configure $id -icons "$im1 $im2"
-.CE
-If \fB\-icons\fR is set to the empty string, no icons are display.
-.PP
-If an entry has children, a button is displayed to the left of the
-icon. Clicking the mouse on this button opens or closes the
-sub-hierarchy. The button is normally a \f(CW+\fR or \f(CW\-\fR
-symbol, but can be configured in a variety of ways using the \fBbutton
-configure\fR operation. For example, the \f(CW+\fR and \f(CW\-\fR
-symbols can be replaced with Tk images.
-.CS
-set im1 [image create photo -file closefolder.gif]
-set im2 [image create photo -file downarrow.gif]
-\&.h button configure $id -images "$im1 $im2" \\
- -openrelief raised -closerelief raised
-.CE
-Entries can contain an arbitrary number of \fIdata fields\fR. Data
-fields are name-value pairs. Both the value and name are strings.
-The entry's \fB\-data\fR option lets you set data fields.
-.CS
-\&.h entry configure $id -data {mode 0666 group users}
-.CE
-The \fB\-data\fR takes a list of name-value pairs.
-.PP
-You can display these data fields as \fIcolumns\fR in the
-\fBtreeview\fR widget. You can create and configure columns with
-the \fBcolumn\fR operation. For example, to add a new column to the
-widget, use the \fBcolumn insert\fR operation. The last argument is
-the name of the data field that you want to display.
-.CS
-\&.h column insert end "mode"
-.CE
-The column title is displayed at the top of the column. By default,
-it's is the field name. You can override this using the column's
-\fB\-text\fR option.
-.CS
-\&.h column insert end "mode" -text "File Permissions"
-.CE
-Columns have several configuration options. The \fBcolumn
-configure\fR operation lets you query or modify column options.
-.CS
-\&.h column configure "mode" -justify left
-.CE
-The \fB\-justify\fR option says how the data is justified within in
-the column. The \fB\-hide\fR option indicates whether the column is
-displayed.
-.CS
-\&.h column configure "mode" -hide yes
-.CE
-Entries can be selected by clicking on the mouse. Selected entries
-are drawn using the colors specified by the \fB\-selectforeground\fR
-and \fB\-selectbackground\fR configuration options.
-The selection itself is managed by the \fBselection\fR operation.
-.CS
-# Clear all selections
-\&.h selection clear 0 end
-# Select the root node
-\&.h selection set 0
-.CE
-The \fBcurselection\fR operation returns a list of ids of
-all the selected entries.
-.CS
-set ids [\&.h curselection]
-.CE
-You can use the \fBget\fR operation to convert the ids to
-their pathnames.
-.CS
-set names [eval .h get -full $ids]
-.CE
-If a treeview is exporting its selection (using the
-\fB\-exportselection\fR option), then it will observe the standard X11
-protocols for handling the selection. Treeview selections are
-available as type \fBSTRING\fR; the value of the selection will be the
-pathnames of the selected entries, separated by newlines.
-.PP
-The \fBtreeview\fR supports two modes of selection: \f(CWsingle\fR
-and \f(CWmultiple\fR. In single select mode, only one entry can be
-selected at a time, while multiple select mode allows several entries
-to be selected. The mode is set by the widget's \fB\-selectmode\fR
-option.
-.CS
-\&.h configure -selectmode "multiple"
-.CE
-You can be notified when the list of selected entries changes. The widget's
-\fB\-selectcommand\fR specifies a Tcl procedure that is called whenever
-the selection changes.
-.CS
-proc SelectNotify { widget } {
- set ids [\&$widget curselection]
-}
-\&.h configure -selectcommand "SelectNotify .h"
-.CE
-The widget supports the standard Tk scrolling and scanning operations.
-The \fBtreeview\fR can be both horizontally and vertically. You can
-attach scrollbars to the \fBtreeview\fR the same way as the listbox
-or canvas widgets.
-.CS
-scrollbar .xbar -orient horizontal -command ".h xview"
-scrollbar .ybar -orient vertical -command ".h yview"
-\&.h configure -xscrollcommand ".xbar set" \\
- -yscrollcommand ".ybar set"
-.CE
-There are three different modes of scrolling: \f(CWlistbox\fR,
-\f(CWcanvas\fR, and \f(CWhierbox\fR. In \f(CWlistbox\fR mode, the last
-entry can always be scrolled to the top of the widget. In \f(CWhierbox\fR
-mode, the last entry is always drawn at the bottom of the widget.
-The scroll mode is set by the widget's \fB\-selectmode\fR
-option.
-.CS
-\&.h configure -scrollmode "listbox"
-.CE
-Entries can be programmatically opened or closed using the \fBopen\fR
-and \fBclose\fR operations respectively.
-.CS
-\&.h open $id
-\&.h close $id
-.CE
-When an entry is opened, a Tcl procedure can be automatically invoked.
-The \fB\-opencommand\fR option specifies this procedure. This
-procedure can lazily insert entries as needed.
-.CS
-proc AddEntries { dir } {
- eval .h insert end [glob -nocomplain $dir/*]
-}
-\&.h configure -opencommand "AddEntries %P"
-.CE
-Now when an entry is opened, the procedure \f(CWAddEntries\fR is
-called and adds children to the entry. Before the command is invoked,
-special "%" substitutions (like \fBbind\fR) are performed. Above,
-\f(CW%P\fR is translated to the pathname of the entry.
-.PP
-The same feature exists when an entry is closed. The
-\fB\-closecommand\fR option specifies the procedure.
-.CS
-proc DeleteEntries { id } {
- .h entry delete $id 0 end
-}
-\&.h configure -closecommand "DeleteEntries %#"
-.CE
-When an entry is closed, the procedure \f(CWDeleteEntries\fR is called
-and deletes the entry's children using the \fBentry delete\fR operation
-(\f(CW%#\fR is the id of entry).
-.SH KEYWORDS
-treeview, widget
diff --git a/blt3.0.1/man/htext.mann b/blt3.0.1/man/htext.mann
deleted file mode 100644
index 4b8be49..0000000
--- a/blt3.0.1/man/htext.mann
+++ /dev/null
@@ -1,384 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Hypertext widget created by George Howlett.
-'\"
-.so man.macros
-.TH htext n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-htext \- Create and manipulate hypertext widgets
-.SH SYNOPSIS
-\fBhtext\fP \fIpathName \fR?\fIoption value\fR?...
-.BE
-.SH DESCRIPTION
-.PP
-The \fBhtext\fR command creates a new window (given by the
-\fIpathName\fR argument) and makes it into a \fBhtext\fP widget.
-Additional options, described above, may be specified on the command line
-or in the option database to configure aspects of the widget such as its
-color and font. At the time this command is invoked, there must not
-exist a window named \fIpathName\fR, but \fIpathName\fR's parent must exist.
-The \fBhtext\fR command returns its \fIpathName\fR.
-.PP
-The \fBhtext\fP widget is hybrid of a non-editable text widget and
-a geometry manager (e.g. the packer). It displays text (optionally read
-from file) in a window. Text can be scrolled either horizontally or
-vertically using the \fBhtext\fR window as a viewport.
-In addition, Tcl commands can be embedded into
-the text which are evaluated as the text is parsed. Text between special
-double characters (percent signs "%%") is immediately passed to the Tcl
-interpreter for evaluation.
-.PP
-Furthermore, any widget or widget hierarchy can be packed in-line and made
-to appear on the current line of the text. Widgets are packed using the
-\fBhtext append\fP command. All widgets must be children of the
-\fBhtext\fP window and must already exist before packing.
-Once a widget has been packed it cannot be moved to a different
-position within the text. Widgets can be resized but they will remain
-at the same position within the text.
-.PP
-Before a file or text string is parsed by the \fBhtext\fR widget,
-all the widget's current children are destroyed. You can reload files or text
-without worrying about unmapping or destroying each child window beforehand.
-.PP
-Setting the either the \fB\-filename\fR or \fB\-text\fR configuration option
-will adjust the value of the other. If both options are set, the file
-takes precedence. When a new file is read using the \fB\-filename\fR option,
-the value of the \fB\-text\fR option is reset to the empty string. Likewise,
-when the \fB\-text\fR option is set, the string representing the
-\fB\-filename\fR option is cleared.
-.SH FILE FORMAT
-The format of \fBhtext\fP text file is typically ASCII text.
-Text enclosed by special double characters (by default, percent signs '%%')
-is interpreted and executed as Tcl commands.
-The special character may be specified by the \fB\-specialchar\fP option.
-In the following example of a \fBhtext\fP file, a button widget
-is appended to the text between the words "\f(CWa\fP" and "\f(CWwhich\fP".
-The \fIpathName\fR of the \fBhtext\fP widget is "\f(CW.ht\fP".
-.CS
-\f(CWThis will be displayed as normal text.
-But this will become a %%
- button .ht.button -text "button" -fg red
- .ht append .ht.button
-%% which can invoke a Tcl command.\fR
-.CE
-.LP
-.SH INDICES
-.PP
-Some of the widget operations (\fBselection\fR, \fRgotoline\fR,
-\fBsearch\fR, etc.) take one or more indices as arguments.
-An index is a string used to indicate a particular place within
-the text, such as the first and last characters in a range to be
-selected.
-.LP
-An index must have one of the following forms:
-.TP 12
-\fIline\fB.\fIchar\fR
-Indicates \fIchar\fR'th character on line \fIline\fR.
-Both lines and characters are number from 0, so "0.0" is the
-first beginning of the text. \fIChar\fR may be undesignated. In
-this case a character position of 0 is assumed.
-.TP 12
-\fB@\fIx\fB,\fIy\fR
-Indicates the character that covers the pixel whose x and y coordinates
-within the text's window are \fIx\fR and \fIy\fR.
-.TP 12
-\fBend\fR
-Indicates the end of the text.
-.TP 12
-\fBanchor\fR
-Indicates the anchor point for the selection, which is set with the
-\fBselection\fR operation.
-.TP 12
-\fBsel.first\fR
-Indicates the first character in the selection. It is an error to
-use this form if the selection isn't in the entry window.
-.TP 12
-\fBsel.last\fR
-.VS
-Indicates the character just after the last one in the selection.
-.VE
-It is an error to use this form if the selection isn't in the
-entry window.
-.SH "VARIABLES"
-.PP
-The following global Tcl variables are maintained when an
-\fBhtext\fR file is parsed.
-.TP
-\fBhtext(widget)\fR
-is the pathname of the \fBhtext\fP widget.
-.TP
-\fBhtext(file)\fR
-is the name of the file the \fBhtext\fP widget is currently parsing.
-It is the empty string when the \fB\-text\fP option is used.
-.TP
-\fBhtext(line)\fR
-is the current line number in the text.
-.PP
-This information might be used to construct hyper links
-between different files and/or lines.
-.LP
-.SH "SYNTAX"
-The \fBhtext\fP command creates a new Tcl command whose
-name is \fIpathName\fR. This command may be used to invoke various
-operations on the widget. It has the following general form:
-.DS
-\fIpathName oper \fR?\fIargs\fR?
-.DE
-\fIOper\fR and \fIargs\fR determine the exact behavior of the command.
-.PP
-.SH "OPERATIONS"
-The following operations are available for \fBhtext\fP widgets:
-.TP
-\fIpathName \fBappend \fIwindow \fR?\fIoption value\fR?...
-Embeds the widget \fIwindow\fP into the htext widget. \fIWindow\fP is
-the pathname of the widget to be embedded which must be a child of
-\fIpathName\fR. \fIWindow\fR will be positioned in the htext widget
-at the current location of the text. If \fIoption\fR and \fIvalue\fR
-pairs are present, they configure various aspects how \fIwindow\fR
-appears in \fIpathName\fR. The following options are available.
-.RS
-.TP
-\fB\-anchor \fIanchorPos\fR
-Specifies how \fIwindow\fR will be arranged if there is any extra
-space in the cavity surrounding the window. For example, if
-\fIanchorPos\fR is \fBcenter\fR then the window is centered in the
-cavity; if \fIanchorPos\fR is \fBw\fR then the window will be drawn
-such it touches the leftmost edge of the cavity. The default
-is \f(CWcenter\fR.
-.TP
-\fB\-fill \fIstyle\fR
-Specifies how the \fIwindow\fR should be stretched to occupy the extra
-space in the cavity surrounding it (if any exists). \fIStyle\fR is
-\f(CWnone\fR, \f(CWx\fR, \f(CWy\fR, \f(CWboth\fR. If \fIstyle\fR is \f(CWx\fR,
-the width of \fIwindow\fR is expanded to fill the cavity. If
-\fIstyle\fR is \fBy\fR, the height is expanded. The default is
-\f(CWnone\fR.
-.TP
-\fB\-height \fIpixels\fR
-Sets the height of the cavity surrounding \fIwindow\fR. If
-\fIpixels\fP is zero, the height of the cavity will be the same as the
-requested height of \fIwindow\fR. If \fIpixels\fR is less than the
-requested height of \fIwindow\fR, \fIwindow\fR will be reduced to fit
-the cavity. The default is \f(CW0\fR.
-.TP
-\fB\-ipadx \fIpad\fR
-Sets the amount of internal padding to be added to the width
-\fIwindow\fR. \fIPad\fR can be a list of one or two numbers. If
-\fIpad\fR has two elements, the left side of \fIwindow\fR is extended
-by the first value and the right side by the second value. If
-\fIpad\fR is just one value, both the left and right sides are padded
-by evenly by the value. The default is \f(CW0\fR.
-.TP
-\fB\-ipady \fIpad\fR
-Sets an amount of internal padding to be added to the height of
-\fIwindow\fR. \fIPad\fR can be a list of one or two numbers. If
-\fIpad\fR has two elements, the top of \fIwindow\fR is padded by the
-first value and the bottom by the second value. If \fIpad\fR is just
-one number, both the top and bottom are padded evenly by the value.
-The default is \f(CW0\fR.
-.TP
-\fB\-justify \fIjustify\fR
-Justifies \fIwindow\fR vertically within the cavity containing it
-in relation to the line of text. \fIJustify\fR is \fBtop\fP,
-\fBbottom\fR, or \fBcenter\fR. If \fIjustify\fR is \f(CWcenter\fR the
-widget is centered along the baseline of the line of text. The
-default is \f(CWcenter\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets the padding on the left and right sides of \fIwindow\fR.
-\fIPad\fR can be a list of one or two numbers. If \fIpad\fR has two
-elements, the left side of \fIwindow\fR is padded by the first value
-and the right side by the second value. If \fIpad\fR has just one
-value, both the left and right sides are padded evenly by the value.
-The default is \f(CW0\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets the padding above and below \fIwindow\fR. \fIPad\fR can be a
-list of one or two numbers. If \fIpad\fR has two elements, the area
-above \fIwindow\fR is padded by the first value and the area below by
-the second value. If \fIpad\fR is just one number, both the top and
-bottom are padded by the value. The default is \f(CW0\fR.
-.TP
-\fB\-relheight \fIvalue\fR
-Specifies the height of the cavity containing \fIwindow\fR relative to
-the height of \fIpathName\fR. \fIValue\fP is real number indicating
-the ratio of the height of the cavity to the height of \fIpathName\fR.
-As the height of \fIpathName\fR changes, so will the height of \fIwindow\fR.
-If \fIvalue\fR is 0.0 or less, the height of the cavity is the requested
-height \fIwindow\fR. The default is \f(CW0.0\fR.
-.TP
-\fB\-relwidth \fIvalue\fR
-Specifies the width of the cavity containing \fIwindow\fR relative to
-the width of \fIpathName\fR. \fIValue\fP is real number indicating
-the ratio of the width of the cavity to the width of \IpathName\fR.
-As the height of \fIpathName\fR changes, so will the height of \fIwindow\fR.
-If \fIvalue\fR is 0.0 or less, the width of the cavity is the
-requested width of \fIwindow\fR. The default is \f(CW0.0\fR.
-.TP
-\fB\-width \fIvalue\fR
-Species the width of the cavity containing the child window.
-\fIValue\fP must be in a form accepted by \fBTk_GetPixels\fR.
-If \fIvalue\fP is greater than zero, the cavity is resized to that width.
-If the requested window width is greater than the cavity's width, the
-window will be reduced to fit the cavity.
-By default, the cavity is requested width of the child window.
-.RE
-.TP
-\fIpathName \fBconfigure\fR ?\fIwindow\fR? ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Queries or modifies the configuration options of the text widget or one
-of its embedded widgets. If no \fIwindow\fR argument is present,
-the htext widget itself is configured. Otherwise \fIwindow\fR
-is the pathname of a widget already embedded into the htext widget.
-Then this command configure the options for the embedded widget.
-.PP
-If \fIoption\fR isn't specified, a list describing all of the current
-options for \fIpathName\fR or \fIwindow\fR is returned. If
-\fIoption\fR is specified, but not \fIvalue\fR, then a list describing
-the option \fIoption\fR is returned. If one or more \fIoption\fR and
-\fIvalue\fR pairs are specified, then for each pair, the htext or embedded
-window option \fIoption\fR is set to \fIvalue\fR.
-.PP
-The following options are valid for the htext widget.
-.RS
-.TP
-\fB\-background\fR \fIcolor\fI
-Sets the background of the htext widget to \fIcolor\fR. This default is
-\f(CWwhite\fR.
-.TP
-\fB\-cursor\fR \fIcursor\fR
-Specifies the cursor for the htext widget. The default cursor is
-\f(CWpencil\fR.
-.TP
-\fB\-filename\fR \fIfileName\fR
-Specifies a \fBhtext\fP file to be displayed in the window.
-If the value is the empty string, the \fB\-text\fR option is used instead.
-See the section
-.SB FILE FORMAT
-for a description of the \fBhtext\fP
-file format.
-.TP
-\fB\-font\fR \fIfontName\fR
-Sets the font of the text in the htext widget to \fIfontName\fR. The
-default is \f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-foreground\fR \fIcolor\fR
-Sets the foreground of the htext widget to \fIcolor\fR. This is
-the color of the text. This default is \f(CWblack\fR.
-.TP
-\fB\-height\fR \fIpixels\fR
-Specifies the height of the htext widget window.
-.TP
-\fB\-linespacing\fR \fIpixels\fR
-Specifies the spacing between each line of text. The value must be in
-a form accepted by \fBTk_GetPixels\fR. The default value is 1 pixel.
-.TP
-\fB\-specialchar\fR \fInumber\fR
-Specifies the ASCII value of the special double character delimiters.
-In \fBhtext\fP files, the text between these special characters is
-evaluated as a block of Tcl commands. The default special character
-is the \f(CW0x25\fR (percent sign).
-.TP
-\fB\-text\fR \fItext\fR
-Specifies the text to be displayed in the htext widget. \fIText\fR
-can be any valid string of characters. See
-.SB "FILE FORMAT"
-for a description.
-.TP
-\fB\-xscrollcommand\fR \fIstring\fR
-Specifies the prefix for a command used to communicate with horizontal
-scrollbars. When the view in the htext widget's window changes (or
-whenever anything else occurs that could change the display in a
-scrollbar, such as a change in the total size of the widget's
-contents), the widget invoke \fIstring\fR concatenated by two numbers.
-Each of the numbers is a fraction between 0 and 1, which indicates a
-position in the document. If this option is not specified, then no
-command will be executed.
-.TP
-\fB\-yscrollcommand\fR \fIstring\fR
-Specifies the prefix for a command used to communicate with vertical
-scrollbars. When the view in the htext widget's window changes (or
-whenever anything else occurs that could change the display in a
-scrollbar, such as a change in the total size of the widget's
-contents), the widget invoke \fIstring\fR concatenated by two numbers.
-Each of the numbers is a fraction between 0 and 1, which indicates a
-position in the document. If this option is not specified, then no
-command will be executed.
-.TP
-\fB\-width\fR \fIpixels\fR
-Specifies the desired width of the viewport window. If the
-\fIpixels\fR is less than one, the window will grow to accommodate the
-widest line of text.
-.TP
-\fB\-xscrollunits\fR \fIpixels\fR
-Specifies the horizontal scrolling distance. The default is 10 pixels.
-.TP
-\fB\-yscrollunits\fR \fIpixels\fR
-Specifies the vertical scrolling distance. The default is 10 pixels.
-.RE
-.TP
-\fIpathName \fBgotoline \fR?\fIindex\fR?
-Sets the top line of the text to \fIindex\fP. \fIIndex\fP must be
-a valid text index (the character offset is ignored).
-If an \fIindex\fP isn't provided, the current line number is
-returned.
-.TP
-\fIpathName \fBscan mark \fIposition\fR
-Records \fIposition\fR and the current view in the text window; used in
-conjunction with later \fBscan dragto\fR commands. \fIPosition\fR must
-be in the form "\fI at x,y\fR, where \fIx\fR and \fIy\fR are window coordinates.
-Typically this
-command is associated with a mouse button press in the widget. It
-returns an empty string.
-.TP
-\fIpathName \fBscan dragto \fIposition\fR
-Computes the difference between \fIposition\fR and the position registered
-in the last \fBscan mark\fR command for the widget.
-The view is then adjusted
-up or down by 10 times the difference in coordinates. This command is
-can be associated with mouse motion events to produce the effect of
-dragging the text at high speed through the window.
-\fIPosition\fR must be in the form "\fI at x,y\fR, where \fIx\fR and
-\fIy\fR are window coordinates. The command returns an empty string.
-.TP
-\fIpathName \fBsearch \fIpattern\fR ?\fIfrom\fR? ?\fIto\fR?
-Returns the number of the next line matching \fIpattern\fR. \fIPattern\fR is
-a string which obeys the matching rules of \fBTcl_StringMatch\fR.
-\fIFrom\fR and \fIto\fR are text line numbers (inclusive) which
-bound the search.
-If no match for \fIpattern\fR can be found, \fB-1\fR is returned.
-.TP
-\fIpathName \fBxview \fR?\fIposition\fR?
-Moves the viewport horizontally to the new text x-coordinate position.
-\fIPosition\fR is the offset from the left side of the text to the current
-position and must be in a form accepted by \fBTk_GetPixels\fR. If \fIposition\fR
-is not present, the current text position is returned.
-.TP
-\fIpathName \fByview \fR?\fIposition\fR?
-Moves the viewport vertically to the new text y-coordinate position.
-\fIPosition\fR is the offset from the top of the text to the current
-position and must be in a form accepted by \fBTk_GetPixels\fR. If \fIposition\fR
-is not present, the current text position is returned.
-.SH BUGS
-Text with embedded tabs can be obscured by child windows when scrolled
-horizontally.
-.SH KEYWORDS
-hypertext, widget
diff --git a/blt3.0.1/man/man.macros b/blt3.0.1/man/man.macros
deleted file mode 100644
index cea92f5..0000000
--- a/blt3.0.1/man/man.macros
+++ /dev/null
@@ -1,240 +0,0 @@
-'\" The definitions below are for supplemental macros used in Tcl/Tk
-'\" manual entries.
-'\"
-'\" .AP type name in/out ?indent?
-'\" Start paragraph describing an argument to a library procedure.
-'\" type is type of argument (int, etc.), in/out is either "in", "out",
-'\" or "in/out" to describe whether procedure reads or modifies arg,
-'\" and indent is equivalent to second arg of .IP (shouldn't ever be
-'\" needed; use .AS below instead)
-'\"
-'\" .AS ?type? ?name?
-'\" Give maximum sizes of arguments for setting tab stops. Type and
-'\" name are examples of largest possible arguments that will be passed
-'\" to .AP later. If args are omitted, default tab stops are used.
-'\"
-'\" .BS
-'\" Start box enclosure. From here until next .BE, everything will be
-'\" enclosed in one large box.
-'\"
-'\" .BE
-'\" End of box enclosure.
-'\"
-'\" .CS
-'\" Begin code excerpt.
-'\"
-'\" .CE
-'\" End code excerpt.
-'\"
-'\" .VS ?version? ?br?
-'\" Begin vertical sidebar, for use in marking newly-changed parts
-'\" of man pages. The first argument is ignored and used for recording
-'\" the version when the .VS was added, so that the sidebars can be
-'\" found and removed when they reach a certain age. If another argument
-'\" is present, then a line break is forced before starting the sidebar.
-'\"
-'\" .VE
-'\" End of vertical sidebar.
-'\"
-'\" .DS
-'\" Begin an indented unfilled display.
-'\"
-'\" .DE
-'\" End of indented unfilled display.
-'\"
-'\" .SO
-'\" Start of list of standard options for a Tk widget. The
-'\" options follow on successive lines, in four columns separated
-'\" by tabs.
-'\"
-'\" .SE
-'\" End of list of standard options for a Tk widget.
-'\"
-'\" .OP cmdName dbName dbClass
-'\" Start of description of a specific option. cmdName gives the
-'\" option's name as specified in the class command, dbName gives
-'\" the option's name in the option database, and dbClass gives
-'\" the option's class in the option database.
-'\"
-'\" .UL arg1 arg2
-'\" Print arg1 underlined, then print arg2 normally.
-'\"
-'\" RCS: @(#) $Id: man.macros,v 1.1.1.1 2010/10/27 21:57:06 joye Exp $
-'\"
-'\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
-.if t .wh -1.3i ^B
-.nr ^l \n(.l
-.ad b
-'\" # Start an argument description
-.de AP
-.ie !"\\$4"" .TP \\$4
-.el \{\
-. ie !"\\$2"" .TP \\n()Cu
-. el .TP 15
-.\}
-.ta \\n()Au \\n()Bu
-.ie !"\\$3"" \{\
-\&\\$1 \\fI\\$2\\fP (\\$3)
-.\".b
-.\}
-.el \{\
-.br
-.ie !"\\$2"" \{\
-\&\\$1 \\fI\\$2\\fP
-.\}
-.el \{\
-\&\\fI\\$1\\fP
-.\}
-.\}
-..
-'\" # define tabbing values for .AP
-.de AS
-.nr )A 10n
-.if !"\\$1"" .nr )A \\w'\\$1'u+3n
-.nr )B \\n()Au+15n
-.\"
-.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
-.nr )C \\n()Bu+\\w'(in/out)'u+2n
-..
-.AS Tcl_Interp Tcl_CreateInterp in/out
-'\" # BS - start boxed text
-'\" # ^y = starting y location
-'\" # ^b = 1
-.de BS
-.br
-.mk ^y
-.nr ^b 1u
-.if n .nf
-.if n .ti 0
-.if n \l'\\n(.lu\(ul'
-.if n .fi
-..
-'\" # BE - end boxed text (draw box now)
-.de BE
-.nf
-.ti 0
-.mk ^t
-.ie n \l'\\n(^lu\(ul'
-.el \{\
-.\" Draw four-sided box normally, but don't draw top of
-.\" box if the box started on an earlier page.
-.ie !\\n(^b-1 \{\
-\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
-.\}
-.el \}\
-\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
-.\}
-.\}
-.fi
-.br
-.nr ^b 0
-..
-'\" # VS - start vertical sidebar
-'\" # ^Y = starting y location
-'\" # ^v = 1 (for troff; for nroff this doesn't matter)
-.de VS
-.if !"\\$2"" .br
-.mk ^Y
-.ie n 'mc \s12\(br\s0
-.el .nr ^v 1u
-..
-'\" # VE - end of vertical sidebar
-.de VE
-.ie n 'mc
-.el \{\
-.ev 2
-.nf
-.ti 0
-.mk ^t
-\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
-.sp -1
-.fi
-.ev
-.\}
-.nr ^v 0
-..
-'\" # Special macro to handle page bottom: finish off current
-'\" # box/sidebar if in box/sidebar mode, then invoked standard
-'\" # page bottom macro.
-.de ^B
-.ev 2
-'ti 0
-'nf
-.mk ^t
-.if \\n(^b \{\
-.\" Draw three-sided box if this is the box's first page,
-.\" draw two sides but no top otherwise.
-.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
-.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
-.\}
-.if \\n(^v \{\
-.nr ^x \\n(^tu+1v-\\n(^Yu
-\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
-.\}
-.bp
-'fi
-.ev
-.if \\n(^b \{\
-.mk ^y
-.nr ^b 2
-.\}
-.if \\n(^v \{\
-.mk ^Y
-.\}
-..
-'\" # DS - begin display
-.de DS
-.RS
-.nf
-.sp
-..
-'\" # DE - end display
-.de DE
-.fi
-.RE
-.sp
-..
-'\" # SO - start of list of standard options
-.de SO
-.SH "STANDARD OPTIONS"
-.LP
-.nf
-.ta 4c 8c 12c
-.ft B
-..
-'\" # SE - end of list of standard options
-.de SE
-.fi
-.ft R
-.LP
-See the \\fBoptions\\fR manual entry for details on the standard options.
-..
-'\" # OP - start of full description for a single option
-.de OP
-.LP
-.nf
-.ta 4c
-Command-Line Name: \\fB\\$1\\fR
-Database Name: \\fB\\$2\\fR
-Database Class: \\fB\\$3\\fR
-.fi
-.IP
-..
-'\" # CS - begin code excerpt
-.de CS
-.RS
-.nf
-.ta .25i .5i .75i 1i
-.ft CW
-.sp
-..
-'\" # CE - end code excerpt
-.de CE
-.fi
-.RE
-.ft R
-.sp
-..
-.de UL
-\\$1\l'|0\(ul'\\$2
-..
diff --git a/blt3.0.1/man/scrollset.mann b/blt3.0.1/man/scrollset.mann
deleted file mode 100644
index 5af8797..0000000
--- a/blt3.0.1/man/scrollset.mann
+++ /dev/null
@@ -1,763 +0,0 @@
-
-'\"
-'\" Copyright 1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Scrollset widget created by George Howlett.
-'\"
-.so man.macros
-.TH scrollset n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-scrollset \- Create and manipulate scrollset widgets
-.BE
-.SH SYNOPSIS
-\fBscrollset\fR \fIpathName \fR?\fIoptions\fR?
-.SH DESCRIPTION
-The \fBscrollset\fR manages a widget and two scrollbars, displaying
-the scrollbars only when they are needed to scroll the widget.
-The embedded widget may be any type of widget. If the widget
-doesn't have native scrolling capabilities (i.e. a "xview" or "yview" operation)
-the widget is by changing the scrollset viewport over the widget.
-.PP
-There's no limit to the number of folders. Tabs can be tiered (more than
-one row). If there are more tabs than can be displayed, tabs can also
-be scrolled. Any folder can also be torn off, when the contents (the Tk widget
-contained by it) is temporarily moved into another toplevel widget.
-A scrollset may used as just a set of tabs, without a displaying any pages.
-You can bind events to individual tabs, so it's easy to add features like
-"balloon help".
-.SH SYNTAX
-The \fBscrollset\fR command creates a new window using the \fIpathName\fR
-argument and makes it into a scrollset widget.
-.DS
-\fBscrollset \fIpathName \fR?\fIoption value\fR?...
-.DE
-Additional options may be specified on the command line or in the
-option database to configure aspects of the scrollset such as its background
-color, scrollbars, or embedded widget. The \fBscrollset\fR command returns its
-\fIpathName\fR argument. At the time this command is invoked, there
-must not exist a window named \fIpathName\fR, but \fIpathName\fR's
-parent must exist.
-.PP
-The scrollbars and embedded widget must be children of the scrollset
-widget. The scrollbars and embedded widget may be designated
-in the \fBscrollset\fR widget before they exist. The normal size of
-of \fBscrollset\fR is the requested width and height of the embedded widget
-(where no scrollbars are necessary). You can override the embedded widget's
-requested size by setting the scrollset's \fB\-reqwidth\fR and
-\fB\-reqheight\fR options respectively.
-.SH "OPERATIONS"
-All \fBscrollset\fR operations are invoked by specifying the widget's
-pathname, the operation, and any arguments that pertain to that
-operation. The general form is:
-.sp
-.DS
- \fIpathName operation \fR?\fIarg arg ...\fR?
-.DE
-.sp
-\fIOperation\fR and the \fIarg\fRs determine the exact behavior of the
-command. The following operations are available for scrollset widgets:
-.TP
-\fIpathName \fBcget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described in the section
-.SB "WIDGET OPTIONS"
-below.
-.TP
-\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "WIDGET OPTIONS"
-below.
-.TP
-\fIpathName \fBset \fBx\fR|\fBy\fIfirst\fR \fIlast\fR
-Scrolls the scrollset so that the tab
-\fItab\fR is visible in the widget's window.
-.TP
-\fIpathName \fBsize\fR
-Returns the number of tabs in the scrollset.
-.TP
-\fIpathName \fBtab \fIoperation\fR ?\fIargs\fR?
-.RS
-.TP
-\fIpathName \fBtab cget\fR \fItab\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR for tab \fItab\fR.
-\fIOption\fR may have any of the values accepted by the \fBtab configure\fR
-operation described in the section
-.SB "TAB OPTIONS"
-below.
-.TP
-\fIpathName \fBtab configure\fR \fItab\fR \fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of one or more tabs.
- More than one tab can be configured if \fItab\fR refers to multiple tabs.
-If no \fIoption\fR is specified, this operation returns a list
-describing all the available options for \fItab\fR.
-.sp
-If \fIoption\fR is specified, but not \fIvalue\fR, then a list describing the
-one named option is returned. If one or more \fIoption\-value\fR pairs
-are specified, then each named tab (specified by \fInameOrIndex\fR) will
-have its configurations option(s) set the given value(s). In
-this last case, the empty string is returned.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "TAB OPTIONS"
-below.
-.TP
-\fIpathName \fBtab names\fR ?\fIpattern\fR?
-Returns the names of all the tabs matching the given pattern. If
-no \fIpattern\fR argument is provided, then all tab names are returned.
-.TP
-\fIpathName \fBtab tearoff \fItab\fR ?\fIwindow\fR?
-Moves the widget embedded the folder \fItab\fR (see the \fB-window\fR option),
-placing it inside of \fIwindow\fR. \fIWindow\fR is either the name of
-an new widget that will contain the embedded widget or the name
-of the \fBscrollset\fR widget. It the last case, the embedded widget
-is put back into the folder.
-.sp
-If no \fIwindow\fR argument is provided, then the name of the current
-parent of the embedded widget is returned.
-.RE
-.TP
-\fIpathName \fBview \fIargs\fR
-This command queries or changes the position of the
-scrollset in the widget's window. It can take any of the following
-forms:
-.RS
-.TP
-\fIpathName \fBview\fR
-Returns a list of two numbers between 0.0 and
-1.0 that describe the amount and position of the scrollset that is
-visible in the window. For example, if \fIview\fR is "0.2 0.6", 20%
-of the scrollset's text is off-screen to the left, 40% is visible in the
-window, and 40% of the scrollset is off-screen to the right. These are
-the same values passed to scrollbars via the \fB\-scrollcommand\fR
-option.
-.TP
-\fIpathName \fBview moveto\fI fraction\fR
-Adjusts the view in the window so that \fIfraction\fR of the
-total width of the scrollset text is off-screen to the left.
-\fIfraction\fR must be a number between 0.0 and 1.0.
-.TP
-\fIpathName \fBview scroll \fInumber what\fR
-This command shifts the view in the window (left/top or right/bottom)
-according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an
-integer. \fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an
-abbreviation of these. If \fIwhat\fR is \fBunits\fR, the view adjusts
-left or right by \fInumber\fR scroll units (see the
-\fB\-scrollincrement\fR option). ; if it is \fBpages\fR then the view
-adjusts by \fInumber\fR widget windows. If \fInumber\fR is negative
-then tabs farther to the left become visible; if it is positive then
-tabs farther to the right become visible.
-.RE
-.SH "WIDGET OPTIONS"
-Widget configuration options may be set either by the \fBconfigure\fR
-operation or the Tk \fBoption\fR command. The resource class
-is \f(CWScrollset\fR. The resource name is the name of the widget.
-.CS
-option add *Scrollset.Foreground white
-option add *Scrollset.Background blue
-.CE
-The following widget options are available:
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the default active background color for tabs. A tab is active
-when the mouse is positioned over it or set by the \fBactivate\fR
-operation. Individual tabs may override this option by setting the
-tab's \fB\-activebackground\fR option.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the default active foreground color for tabs. A tab is active
-when the mouse is positioned over it or set by the \fBactivate\fR
-operation. Individual tabs may override this option by setting the
-tab's \fB\-activeforeground\fR option.
-.TP
-\fB\-background \fIcolor\fR
-Sets the default background color of folders. Individual tabs can
-override this with their own \fBR-background\fR option.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around tabs and folders. The
-\fB\-relief\fR option determines how the border is to be drawn. The
-default is \f(CW1\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for both tabs and folders. \fIRelief\fR
-specifies how the tabs should appear relative to background of the
-widget; for example, \f(CWraised\fR means the tab should
-appear to protrude. The default is \f(CWraised\fR.
-.TP
-\fB\-troughbackground \fIcolor\fR
-Sets the background color of the trough under the tabs.
-.TP
-\fB\-outerborderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the outside edge of the widget. The
-\fB\-relief\fR option determines how the border is to be drawn. The
-default is \f(CW0\fR.
-.TP
-\fB\-outerpad \fIpixels\fR
-Sets the amount of padding between the highlight ring on the
-outer edge of the scrollset and the folder.
-The default is \f(CW0\fR.
-.TP
-\fB\-outerrelief \fIrelief\fR
-Specifies the 3-D effect for the scrollset widget. \fIRelief\fR
-specifies how the scrollset should appear relative to widget that
-it is packed into; for example, \f(CWraised\fR means the scrollset should
-appear to protrude. The default is \f(CWsunken\fR.
-.TP
-\fB\-cursor \fIcursor\fR
-Specifies the widget's cursor. The default cursor is \f(CW""\fR.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the focus outline. When a tab has the widget's
-focus, it is drawn with a dashed outline around its label.
-\fIDashList\fR is a list of up
-to 11 numbers that alternately represent the lengths of the dashes
-and gaps on the cross hair lines. Each number must be between 1 and
-255. If \fIdashList\fR is \f(CW""\fR, the outline will be a solid
-line. The default value is \f(CW5 2\fR.
-.TP
-\fB\-font \fIfontName\fR
-Sets the default font for the text in tab labels. Individual tabs may
-override this by setting the tab's \fB\-font\fR option. The default value is
-\f(CW*Arial 9\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the default color of tab labels. Individual tabs may
-override this option by setting the tab's \fB\-foreground\fR option.
-The default value is \f(CWblack\fR.
-.TP
-\fB\-gap \fIsize\fR
-Sets the gap (in pixels) between tabs. The default value is \f(CW2\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the requested height of widget. If \fIpixels\fR is
-0, then the height of the widget will be calculated based on
-the size the tabs and their pages.
-The default is \f(CW0\fR.
-.TP
-\fB\-highlightbackground \fIcolor\fR
-Sets the color to display in the traversal highlight region when
-the scrollset does not have the input focus.
-.TP
-\fB\-highlightcolor \fIcolor\fR
-Sets the color to use for the traversal highlight rectangle that is
-drawn around the widget when it has the input focus.
-The default is \f(CWblack\fR.
-.TP
-\fB\-highlightthickness \fIpixels\fR
-Sets the width of the highlight rectangle to draw around the outside of
-the widget when it has the input focus. \fIPixels\fR is a non-negative
-value and may have any of the forms acceptable to \fBTk_GetPixels\fR.
-If the value is zero, no focus highlight is drawn around the widget.
-The default is \f(CW2\fR.
-.TP
-\fB\-pageheight \fIpixels\fR
-Sets the requested height of the page. The page is the area under the
-tab used to display the page contents. If \fIpixels\fR is \f(CW0\fR,
-the maximum height of all embedded tab windows is used.
-The default is \f(CW0\fR.
-.TP
-\fB\-pagewidth \fIpixels\fR
-Sets the requested width of the page. The page is the area under the
-tab used to display the page contents. If \fIpixels\fR is \f(CW0\fR,
-the maximum width of all embedded tab windows is used. The default
-is \f(CW0\fR.
-.TP
-\fB\-perforationcommand\fR \fIstring\fR
-Specifies a Tcl script to be invoked to tear off the current
-page in the scrollset. This command is typically invoked when
-left mouse button is released over the tab perforation. The default
-action is to tear-off the page and place it into a new toplevel
-window.
-.TP
-\fB\-rotate \fIangle\fR
-Specifies the degrees to rotate text in tab labels.
-\fIAngle\fR is a real value representing the number of degrees
-to rotate the text labels. The default is \f(CW0.0\fR degrees.
-.TP
-\fB\-tabwidth \fIwidth\fR
-Indicates the width of each tab. \fIWidth\fR can be one of the
-following:
-.RS
-.TP 1i
-\f(CWvariable\fR
-The width of the tab is determined by its text and image.
-.TP 1i
-\f(CWsame\fR
-The width of every tab is the maximum size.
-.TP 1i
-\f(CWpixels\fR
-The width of the tab is set to \fIpixels\R.
-\fIPixels\fR is a positive screen distance.
-.RE
-The default is \f(CWsame\fR.
-.TP
-\fB\-scrollcommand \fIstring\fR
-Specifies the prefix for a command for communicating with
-scrollbars. Whenever the view in the widget's window
-changes, the widget will generate a Tcl command by concatenating the
-scroll command and two numbers. If this option is not specified, then
-no command will be executed.
-.TP
-\fB\-scrollincrement \fIpixels\fR
-Sets the smallest number of pixels to scroll the tabs.
-If \fIpixels\fR is greater than 0, this sets the units for
-scrolling (e.g., when you the change the view by clicking
-on the left and right arrows of a scrollbar).
-.TP
-\fB\-selectbackground \fIcolor\fR
-Sets the color to use when displaying background of the selected
-tab. Individual tabs can override this option by setting the tab's
-\fB\-selectbackground\fR option.
-'\".TP
-'\" \fB\-selectborderwidth \fIpixels\fR
-'\" Sets the width of the raised 3-D border to draw around the label of
-'\" the selected tab. \fIPixels\fR must be a non-negative value.
-'\" The default value is \f(CW1\fR.
-.TP
-\fB\-selectcommand \fIstring\fR
-Specifies a default Tcl script to be associated with tabs. This
-command is typically invoked when left mouse button is released over
-the tab. Individual tabs may override this with the tab's
-\fB\-command\fR option. The default value is \f(CW""\fR.
-.TP
-\fB\-selectforeground \fIcolor\fB
-Sets the default color of the selected tab's text label.
-Individual tabs can override this option by setting the tab's
-\fB\-selectforeground\fR option. The default value is \f(CWblack\fR.
-.TP
-\fB\-selectpad \fIpixels\fB
-Specifies extra padding to be displayed around the selected tab.
-The default value is \f(CW3\fR.
-.TP
-\fB\-side \fIside\fB
-Specifies the side of the widget to place tabs. The following
-values are valid for \fIside\fR. The default value is \f(CWtop\fR.
-.RS
-.TP 1i
-\f(CWtop\fR
-Tabs are drawn along the top.
-.TP 1i
-\f(CWleft\fR
-Tabs are drawn along the left side.
-.TP 1i
-\f(CWright\fR
-Tabs are drawn along the right side.
-.TP 1i
-\f(CWboth\fR
-Tabs are drawn along the bottom side.
-.RE
-.TP
-\fB\-slant \fIslant\fR
-Specifies if the tabs should be slanted 45 degrees on the left and/or
-right sides. The following values are valid for \fIslant\fR. The default
-is \f(CWnone\fR.
-.RS
-.TP 1i
-\f(CWnone\fR
-Tabs are drawn as a rectangle.
-.TP 1i
-\f(CWleft\fR
-The left side of the tab is slanted.
-.TP 1i
-\f(CWright\fR
-The right side of the tab is slanted.
-.TP 1i
-\f(CWboth\fR
-Boths sides of the tab are slanted.
-.RE
-.TP
-\fB\-takefocus\fR \fIfocus\fR
-Provides information used when moving the focus from window to window
-via keyboard traversal (e.g., Tab and Shift-Tab). If \fIfocus\fR is
-\f(CW0\fR, this means that this window should be skipped entirely during
-keyboard traversal. \f(CW1\fR means that the this window should always
-receive the input focus. An empty value means that the traversal
-scripts decide whether to focus on the window.
-The default is \f(CW1\fR.
-.TP
-\fB\-tearoff \fIboolean\fR
-.TP
-\fB\-textside \fIside\fB
-If both images and text are specified for a tab, this option determines on
-which side of the tab the text is to be displayed. The
-valid sides are \f(CWleft\fR, \f(CWright\fR, \f(CWtop\fR, and
-\f(CWbottom\fR. The default value is \f(CWleft\fR.
-.TP
-\fB\-tiers \fInumber\fB
-Specifies the maximum number of tiers to use to display the tabs.
-The default value is \f(CW1\fR.
-.TP
-\fB\-width \fIpixels\fR
-Specifies the requested width of the widget. If \fIpixels\fR is
-0, then the width of the widget will be calculated based on
-the size the tabs and their pages.
-The default is \f(CW0\fR.
-.SH "TAB OPTIONS"
-In addition to the \fBconfigure\fR operation, widget configuration
-options may also be set by the Tk \fBoption\fR command. The class
-resource name is \f(CWTab\fR.
-.CS
-option add *Scrollset.Tab.Foreground white
-option add *Scrollset.name.Background blue
-.CE
-The following widget options are available:
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the active background color for \fInameOrIndex\fR. A tab is active
-when the mouse is positioned over it or set by the \fBactivate\fR
-operation. This overrides the widget's \fB-activebackground\fR
-option.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the default active foreground color \fInameOrIndex\fR. A tab is "active"
-when the mouse is positioned over it or set by the \fBactivate\fR
-operation. Individual tabs may override this option by setting the
-tab's \fB-activeforeground\fR option.
-.TP
-\fB\-anchor \fIanchor\fR
-Anchors the tab's embedded widget to a particular edge of the folder.
-This option has effect only if the space in the folder surrounding the
-embedded widget is larger than the widget itself. \fIAnchor\fR specifies
-how the widget will be positioned in the extra space. For example, if
-\fIanchor\fR is \f(CWcenter\fR then the window is centered in the folder
-; if \fIanchor\fR is \f(CWw\fR then the window will
-be aligned with the leftmost edge of the folder. The default value is
-\f(CWcenter\fR.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color for \fInameOrIndex\fR. Setting this option overides the
-widget's \fB\-tabbackground\fR option.
-.TP
-\fB\-bindtags \fItagList\fR
-Specifies the binding tags for this tab. \fITagList\fR is a list of
-binding tag names. The tags and their order will determine how
-commands for events in tabs are invoked. Each tag in the list matching
-the event sequence will have its Tcl command executed. Implicitly the
-name of the tab is always the first tag in the list. The default value is
-\f(CWall\fR.
-.TP
-\fB\-command \fIstring\fR
-Specifies a Tcl script to be associated with \fInameOrIndex\fR. This
-command is typically invoked when left mouse button is released over
-the tab. Setting this option overrides the widget's
-\fB\-selectcommand\fR option.
-.TP
-\fB\-data \fIstring\fR
-Specifies a string to be associated with \fInameOrIndex\fR.
-This value isn't used in the widget code. It may be used in Tcl bindings
-to associate extra data (other than the image or text) with the
-tab. The default value is \f(CW""\fR.
-.TP
-\fB\-fill \fIfill\fR
-If the space in the folder surrounding the tab's embedded widget is
-larger than the widget, then \fIfill\fR indicates if the embedded widget
-should be stretched to occupy the extra space. \fIFill\fR is either
-\f(CWnone\fR,
-\f(CWx\fR, \f(CWy\fR, \f(CWboth\fR. For example, if \fIfill\fR is \f(CWx\fR,
-then the widget is stretched horizontally. If \fIfill\fR is \f(CWy\fR,
-the widget is stretched vertically. The default is \f(CWnone\fR.
-.TP
-\fB\-font \fIfontName\fR
-Sets the font for the text in tab labels. If \fIfontName\fR is not
-the empty string, this overrides the scrollset's \fB\-font\fR option.
-The default value is \f(CW""\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the color of the label for \fInameOrIndex\fR. If \fIcolor\fR
-is not the empty string, this overrides the widget's \fB\-tabforeground\fR
-option. The default value is \f(CW""\fR.
-.TP
-\fB\-image \fIimageName\fR
-Specifies the image to be drawn in label for \fInameOrIndex\fR.
-If \fIimage\fR is \f(CW""\fR, no image will be drawn. Both text and
-images may be displayed at the same time in tab labels.
-The default value is \f(CW""\fR.
-.TP
-\fB\-ipadx \fIpad\fR
-Sets the padding to the left and right of the label.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the label is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default value is \f(CW0\fR.
-.TP
-\fB\-ipady \fIpad\fR
-Sets the padding to the top and bottom of the label.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the top of the label is padded by the first
-distance and the bottom by the second. If \fIpad\fR has just one
-distance, both the top and bottom sides are padded evenly. The
-default value is \f(CW0\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets the padding around the left and right of the embedded widget, if
-one exists.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the widget is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default value is \f(CW0\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets the padding around the top and bottom of the embedded widget, if
-one exists.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the top of the widget is padded by the first
-distance and the bottom by the second. If \fIpad\fR has just one
-distance, both the top and bottom sides are padded evenly. The
-default value is \f(CW0\fR.
-.TP
-\fB\-selectbackground \fIcolor\fR
-Sets the color to use when displaying background of the selected
-tab. If \fIcolor\fR is not the empty string, this overrides the
-widget's \fB\-selectbackground\fR option. The default value is
-\f(CW""\fR.
-.TP
-\fB\-shadow \fIcolor\fR
-Sets the shadow color for the text in the tab's label. Drop shadows
-are useful when both the foreground and background of the tab
-have similar color intensities.
-If \fIcolor\fR is the empty string, no shadow is drawn.
-The default value is \f(CW""\fR.
-.TP
-\fB\-state \fIstate\fR
-Sets the state of the tab. If \fIstate\fR is \f(CWdisable\fR the
-text of the tab is drawn as engraved and operations on the tab
-(such as \fBinvoke\fR and \fBtab tearoff\fR) are ignored.
-The default is \f(CWnormal\fR.
-.TP
-\fB\-stipple \fIbitmap\fR
-Specifies a stipple pattern to use for the background of the folder
-when the window is torn off.
-\fIBitmap\fR specifies a bitmap to use as the stipple
-pattern. The default is \f(CWBLT\fR.
-.TP
-\fB\-text \fItext\fR
-Specifies the text of the tab's label. The exact way the text is
-drawn may be affected by other options such as \fB\-state\fR or
-\fB\-rotate\fR.
-.TP
-\fB\-window \fIpathName\fR
-Specifies the widget to be embedded into the tab. \fIPathName\fR must
-be a child of the \fBscrollset\fR widget. The scrollset will "pack" and
-manage the size and placement of \fIpathName\fR. The default value
-is \f(CW""\fR.
-.TP
-\fB\-windowheight \fIpixels\fR
-Sets the requested height of the page. The page is the area under the
-tab used to display the page contents. If \fIpixels\fR is \f(CW0\fR,
-the maximum height of all embedded tab windows is used. The default
-is \f(CW0\fR.
-.TP
-\fB\-windowwidth \fIpixels\fR
-Sets the requested width of the page. The page is the area under the
-tab used to display the page contents. If \fIpixels\fR is \f(CW0\fR,
-the maximum width of all embedded tab windows is used. The default
-is \f(CW0\fR.
-.SH "DEFAULT BINDINGS"
-.PP
-BLT automatically generates class bindings that supply scrollsets their
-default behaviors. The following event sequences are set by default
-for scrollsets (via the class bind tag \f(CWScrollset\fR):
-.IP \fB<ButtonPress-2>\fR
-.IP \fB<B2-Motion>\fR
-.IP \fB<ButtonRelease-2>\fR
-Mouse button 2 may be used for scanning.
-If it is pressed and dragged over the scrollset, the contents of
-the scrollset drag at high speed in the direction the mouse moves.
-.IP \fB<KeyPress-Up>\fR
-.IP \fB<KeyPress-Down>\fR
-The up and down arrow keys move the focus to the tab immediately above
-or below the current focus tab. The tab with focus is drawn
-with the a dashed outline around the tab label.
-.IP \fB<KeyPress-Left>\fR
-.IP \fB<KeyPress-Right>\fR
-The left and right arrow keys move the focus to the tab immediately to the left
-or right of the current focus tab. The tab with focus is drawn
-with the a dashed outline around the tab label.
-.IP \fB<KeyPress-space>\fR
-.IP \fB<KeyPress-Return>\fR
-The space and return keys select the current tab given focus.
-When a folder is selected, it's command is invoked and the
-embedded widget is mapped.
-.PP
-Each tab, by default, also has a set of bindings (via the tag
-\f(CWall\fR). These bindings may be reset using the scrollset's
-\fBbind\fR operation.
-.IP \fB<Enter>\fR
-.IP \fB<Leave>\fR
-When the mouse pointer enters a tab, it is activated (i.e. drawn in
-its active colors) and when the pointer leaves, it is redrawn in
-its normal colors.
-.IP \fB<ButtonRelease-1>\fR
-Clicking with the left mouse button on a tab causes the tab to be
-selected and its Tcl script (see the \fB\-command\fR or
-\fB\-selectcommand\fR options) to be invoked. The folder and any embedded
-widget (if one is specified) is automatically mapped.
-.IP \fB<ButtonRelease-3>\fR
-.IP \fB<Control-ButtonRelease-1>\fR
-Clicking on the right mouse button (or the left mouse button with the
-Control key held down) tears off the current page into its own toplevel
-widget. The embedded widget is re-packed into a new toplevel and
-an outline of the widget is drawn in the folder. Clicking again
-(toggling) will reverse this operation and replace the page back in
-the folder.
-.SH "BIND TAGS"
-You can bind commands to tabs that are triggered when a particular
-event sequence occurs in them, much like canvas items in Tk's
-canvas widget. Not all event sequences are valid. The only binding
-events that may be specified are those related to the mouse and
-keyboard (such as \fBEnter\fR, \fBLeave\fR, \fBButtonPress\fR,
-\fBMotion\fR, and \fBKeyPress\fR).
-.PP
-It is possible for multiple bindings to match a particular event.
-This could occur, for example, if one binding is associated with the
-tab name and another is associated with the tab's tags
-(see the \fB\-bindtags\fR option). When this occurs, all the
-matching bindings are invoked. A binding associated with the tab
-name is invoked first, followed by one binding for each of the tab's
-bindtags. If there are multiple matching bindings for a single tag,
-then only the most specific binding is invoked. A continue command
-in a binding script terminates that script, and a break command
-terminates that script and skips any remaining scripts for the event,
-just as for the bind command.
-.PP
-The \fB\-bindtags\fR option for tabs controls addition tag names that
-can be matched. Implicitly the first tag for each tab is its name.
-Setting the value of the \fB\-bindtags\fR option doesn't change this.
-.SH EXAMPLE
-You create a scrollset widget with the \fBscrollset\fR command.
-.CS
-# Create a new scrollset
-scrollset .ts -relief sunken -borderwidth 2
-.CE
-A new Tcl command \f(CW.ts\fR is also created. This command can be
-used to query and modify the scrollset. For example, to change the
-default font used by all the tab labels, you use the new command and
-the scrollset's \fBconfigure\fR operation.
-.CS
-# Change the default font.
-\&.ts configure \-font "fixed"
-.CE
-You can then add folders using the \fBinsert\fR operation.
-.CS
-# Create a new folder "f1"
-\&.ts insert 0 "f1"
-.CE
-This inserts the new tab named "f1" into the scrollset. The index
-\f(CW0\fR indicates location to insert the new tab. You can also use
-the index \f(CWend\fR to append a tab to the end of the scrollset. By
-default, the text of the tab is the name of the tab. You can change
-this by configuring the \fB\-text\fR option.
-.CS
-# Change the label of "f1"
-\&.ts tab configure "f1" -text "Tab #1"
-.CE
-The \fBinsert\fR operation lets you add one or more folders at a time.
-.CS
-\&.ts insert end "f2" -text "Tab #2" "f3" "f4"
-.CE
-The tab on each folder contains a label. A label may display both
-an image and a text string. You can reconfigure the tab's attributes
-(foreground/background colors, font, rotation, etc) using the \fBtab
-configure\fR operation.
-.CS
-# Add an image to the label of "f1"
-set image [image create photo -file stopsign.gif]
-\&.ts tab configure "f1" -image $image
-\&.ts tab configure "f2" -rotate 90
-.CE
-Each folder may contain an embedded widget to represent its contents.
-The widget to be embedded must be a child of the scrollset widget. Using
-the \fB\-window\fR option, you specify the name of widget to be
-embedded. But don't pack the widget, the scrollset takes care of placing
-and arranging the widget for you.
-.CS
-graph .ts.graph
-\&.ts tab configure "f1" -window ".ts.graph" \\
- -fill both -padx 0.25i -pady 0.25i
-.CE
-The size of the folder is determined the sizes of the Tk widgets
-embedded inside each folder. The folder will be as wide as the widest
-widget in any folder. The tallest determines the height. You can use
-the tab's \fB\-pagewidth\fR and \fB\-pageheight\fR options override this.
-.PP
-Other options control how the widget appears in the folder. The
-\fB\-fill\fR option says that you wish to have the widget stretch to
-fill the available space in the folder.
-.CS
-\&.ts tab configure "f1" -fill both -padx 0.25i -pady 0.25i
-.CE
-.PP
-Now when you click the left mouse button on "f1", the
-graph will be displayed in the folder. It will be automatically
-hidden when another folder is selected. If you click on the right
-mouse button, the embedded widget will be moved into a toplevel widget
-of its own. Clicking again on the right mouse button puts it back into
-the folder.
-.PP
-If you want to share a page between two different folders, the
-\fB\-command\fR option lets you specify a Tcl command to be invoked
-whenever the folder is selected. You can reset the \fB\-window\fR
-option for the tab whenever it's clicked.
-.CS
-\&.ts tab configure "f2" -command {
- \&.ts tab configure "f2" -window ".ts.graph"
-}
-\&.ts tab configure "f1" -command {
- \&.ts tab configure "f1" -window ".ts.graph"
-}
-.CE
-If you have many folders, you may wish to stack tabs in multiple
-tiers. The scrollset's \fB\-tiers\fR option requests a maximum
-number of tiers. The default is one tier.
-.CS
-\&.ts configure -tiers 2
-.CE
-If the tabs can fit in less tiers, the widget will use that many.
-Whenever there are more tabs than can be displayed in the maximum number
-of tiers, the scrollset will automatically let you scroll the tabs. You
-can even attach a scrollbar to the scrollset.
-.CS
-\&.ts configure -scrollcommand { .sbar set } -scrollincrement 20
-\&.sbar configure -orient horizontal -command { .ts view }
-.CE
-By default tabs are along the top of the scrollset from left to right.
-But tabs can be placed on any side of the scrollset using the \fB\-side\fR
-option.
-.CS
-# Arrange tabs along the right side of the scrollset.
-\&.ts configure -side right -rotate 270
-.CE
-.SH KEYWORDS
-scrollset, widget
diff --git a/blt3.0.1/man/spline.mann b/blt3.0.1/man/spline.mann
deleted file mode 100644
index 4fcca80..0000000
--- a/blt3.0.1/man/spline.mann
+++ /dev/null
@@ -1,181 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Spline command created by George Howlett.
-'\"
-.so man.macros
-.TH spline n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-\fBspline\fR \- Fit curves with spline interpolation
-.SH SYNOPSIS
-.sp
-\fBblt::spline natural \fIx y sx sy\fR
-.sp
-\fBblt::spline quadratic \fIx y sx sy\fR
-.BE
-.SH DESCRIPTION
-The \fBspline\fR command computes a spline fitting a set of data
-points (x and y vectors) and produces a vector of the interpolated
-images (y-coordinates) at a given set of x-coordinates.
-.SH INTRODUCTION
-Curve fitting has many applications. In graphs, curve fitting can
-be useful for displaying curves which are aesthetically pleasing to the
-eye. Another advantage is that you can quickly generate arbitrary points
-on the curve from a small set of data points.
-.PP
-A spline is a device used in drafting to produce smoothed curves. The
-points of the curve, known as \fIknots\fR, are fixed and the
-\fIspline\fR, typically a thin strip of wood or metal, is bent around
-the knots to create the smoothed curve. Spline interpolation is the
-mathematical equivalent. The curves between adjacent knots are
-piecewise functions such that the resulting spline runs exactly
-through all the knots. The order and coefficients of the polynominal
-determine the "looseness" or "tightness" of the curve fit from the
-line segments formed by the knots.
-.PP
-The \fBspline\fR command performs spline interpolation using cubic
-("natural") or quadratic polynomial functions. It computes the spline
-based upon the knots, which are given as x and y vectors. The
-interpolated new points are determined by another vector which
-represents the abscissas (x-coordinates) or the new points. The
-ordinates (y-coordinates) are interpolated using the spline and
-written to another vector.
-.SH EXAMPLE
-Before we can use the \fBspline\fR command, we need to create two BLT
-vectors which will represent the knots (x and y coordinates) of the
-data that we're going to fit. Obviously, both vectors must be the
-same length.
-.CS
-# Create sample data of ten points.
-blt::vector x(10) y(10)
-
-for {set i 10} {$i > 0} {incr i -1} {
- set x($i-1) [expr $i*$i]
- set y($i-1) [expr sin($i*$i*$i)]
-}
-.CE
-We now have two vectors \f(CWx\fR and \f(CWy\fR representing the ten data
-points we're trying to fit. The order of the values of \f(CWx\fR must
-be monotonically increasing. We can use the vector's \fBsort\fR operation
-to sort the vectors.
-.CS
-x sort y
-.CE
-The components of \f(CWx\fR are sorted in increasing order. The
-components of \f(CWy\fR are rearranged so that the original x,y
-coordinate pairings are retained.
-.PP
-A third vector is needed to indicate the abscissas (x-coordinates) of
-the new points to be interpolated by the spline. Like the x vector,
-the vector of abscissas must be monotonically increasing. All the
-abscissas must lie between the first and last knots (x vector)
-forming the spline.
-.PP
-How the abscissas are picked is arbitrary. But if we are going to
-plot the spline, we will want to include the knots too. Since both
-the quadratic and natural splines preserve the knots (an abscissa from
-the x vector will always produce the corresponding ordinate from the y
-vector), we can simply make the new vector a superset of \f(CWx\fR.
-It will contain the same coordinates as \f(CWx\fR, but also the
-abscissas of the new points we want interpolated. A simple way is to
-use the vector's \fBpopulate\fR operation.
-.CS
-x populate sx 10
-.CE
-This creates a new vector \f(CWsx\fR. It contains the abscissas of
-\f(CWx\fR, but in addition \f(CWsx\fR will have ten evenly distributed
-values between each abscissa. You can interpolate any points you
-wish, simply by setting the vector values.
-.PP
-Finally, we generate the ordinates (the images of the spline) using
-the \fBspline\fR command. The ordinates are stored in a fourth
-vector.
-.CS
-blt::spline natural x y sx sy
-.CE
-This creates a new vector \f(CWsy\fR. It will have the same length as
-\f(CWsx\fR. The vectors \f(CWsx\fR and \f(CWsy\fR represent the smoothed
-curve which we can now plot.
-.CS
-blt::graph .graph
-\&.graph element create original -x x -y x -color blue
-\&.graph element create spline -x sx -y sy -color red
-blt::table . .graph
-.CE
-The \fBnatural\fR operation employs a cubic interpolant when forming
-the spline. In terms of the draftmen's spline, a \fInatural spline\fR
-requires the least amount of energy to bend the spline (strip of
-wood), while still passing through each knot. In mathematical terms,
-the second derivatives of the first and last points are zero.
-.PP
-Alternatively, you can generate a spline using the \fBquadratic\fR
-operation. Quadratic interpolation produces a spline which follows
-the line segments of the data points much more closely.
-.CS
-blt::spline quadratic x y sx sy
-.CE
-.SH OPERATIONS
-.TP
-\fBblt::spline natural \fIx y sx sy\fR
-Computes a cubic spline from the data points represented by the
-vectors \fIx\fR and \fIy\fR and interpolates new points using vector
-\fIsx\fR as the x-coordinates. The resulting y-coordinates are
-written to a new vector \fIsy\fR. The vectors \fIx\fR and \fIy\fR must
-be the same length and contain at least three components. The order
-of the components of \fIx\fR must be monotonically increasing.
-\fISx\fR is the vector containing the x-coordinates of the points to
-be interpolated. No component of \fIsx\fR can be less than first
-component of \fIx\fR or greater than the last component. The order
-of the components of \fIsx\fR must be monotonically increasing.
-\fISy\fR is the name of the vector where the calculated y-coordinates
-will be stored. If \fIsy\fR does not already exist, a new vector will be
-created.
-.TP
-\fBblt::spline quadratic \fIx y sx sy\fR
-Computes a quadratic spline from the data points represented by the
-vectors \fIx\fR and \fIy\fR and interpolates new points using vector
-\fIsx\fR as the x-coordinates. The resulting y-coordinates are
-written to a new vector \fIsy\fR. The vectors \fIx\fR and \fIy\fR must
-be the same length and contain at least three components. The order
-of the components of \fIx\fR must be monotonically increasing.
-\fISx\fR is the vector containing the x-coordinates of the points to
-be interpolated. No component of \fIsx\fR can be less than first
-component of \fIx\fR or greater than the last component. The order of
-the components of \fIsx\fR must be monotonically increasing. \fISy\fR
-is the name of the vector where the calculated y-coordinates are
-stored. If \fIsy\fR does not already exist, a new vector will be
-created.
-.SH REFERENCES
-.nf
-.sp
-Numerical Analysis
-by R. Burden, J. Faires and A. Reynolds.
-Prindle, Weber & Schmidt, 1981, pp. 112
-.sp
-Shape Preserving Quadratic Splines
-by D.F.Mcallister & J.A.Roulier
-Coded by S.L.Dodd & M.Roulier N.C.State University.
-.sp
-.fi
-The original code for the quadratric spline can be found in TOMS #574.
-.SH KEYWORDS
-spline, vector, graph
-
diff --git a/blt3.0.1/man/stripchart.mann b/blt3.0.1/man/stripchart.mann
deleted file mode 100644
index 1553647..0000000
--- a/blt3.0.1/man/stripchart.mann
+++ /dev/null
@@ -1,2168 +0,0 @@
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Stripchart widget created by Sani Nassif and George Howlett.
-'\"
-.so man.macros
-.TH stripchart n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-stripchart \- 2D strip chart for plotting x and y coordinate data.
-.SH SYNOPSIS
-\fBstripchart\fI \fIpathName \fR?\fIoption value\fR?...
-.BE
-.SH DESCRIPTION
-The \fBstripchart\fR command creates a strip chart for plotting
-two-dimensional data (x,y coordinates). It has many configurable
-components: coordinate axes, elements, legend, grid lines, cross
-hairs, etc. They allow you to customize the look and feel of the
-strip chart.
-.PP
-The \fBstripchart\fR is essentially the same as the \fBgraph\fR
-widget. It works almost exactly the very same way.
-.PP
-The use of a strip chart differs in that the X-axis typically refers
-to time points. Data values are added at intervals. The strip chart
-lets you automatically maintain a view of the most recent time points.
-The axis options \fB\-shiftby\fR and \fB\-autorange\fR control this.
-You can specify different line styles for data points (see the
-\fB\-styles\fR option).
-.SH INTRODUCTION
-The \fBstripchart\fR command creates a new window for plotting
-two-dimensional data (x,y coordinates). Data points are plotted in a
-box displayed in the center of the new window. This is the
-\fIplotting area\fR. The coordinate axes are displayed in the
-margins around the plotting area. By default, the legend is displayed
-in the right margin. The title is displayed in top margin.
-.PP
-A strip chart is composed of several components: coordinate axes, data
-elements, legend, grid, cross hairs, pens, postscript, and annotation
-markers.
-.TP 1i
-\f(CWaxis\fR
-The stripchart widget can display up to four coordinate axes (two
-X-coordinate and two Y-coordinate axes), but you can create and use
-any number of axes. Axes control what region of data is displayed and
-how the data is scaled. Each axis consists of the axis line, title,
-major and minor ticks, and tick labels. Tick labels display the value
-of each major tick.
-.TP 1i
-\f(CWcrosshairs\fR
-Cross hairs are used to finely position the mouse pointer in relation
-to the coordinate axes. Two perpendicular lines are drawn across the
-plotting area, intersecting at the current location of the mouse
-pointer.
-.TP 1i
-\f(CWelement\fR
-An element represents a set of data points. Elements can be plotted
-with a symbol at each data point and lines connecting the points.
-The appearance of the element, such as its symbol, line width, and
-color is configurable.
-.TP 1i
-\f(CWgrid\fR
-Extends the major and minor ticks of the X\-axis and/or Y\-axis across the
-plotting area.
-.TP 1i
-\f(CWlegend\fR
-The legend displays the name and symbol of each data element.
-The legend can be drawn in any margin or in the plotting area.
-.TP 1i
-\f(CWmarker\fR
-Markers are used annotate or highlight areas of the graph. For
-example, you could use a polygon marker to fill an area under a
-curve, or a text marker to label a particular data point. Markers
-come in various forms: text strings, bitmaps, connected line
-segments, images, polygons, or embedded widgets.
-.TP 1i
-\f(CWpen\fR
-Pens define attributes (both symbol and line style) for elements.
-Data elements use pens to specify how they should be drawn. A data
-element may use many pens at once. Here, the particular pen
-used for a data point is determined from each element's weight
-vector (see the element's \fB\-weight\fR and \fB\-style\fR options).
-.TP 1i
-\f(CWpostscript\fR
-The widget can generate encapsulated PostScript output. This component
-has several options to configure how the PostScript is generated.
-.SH SYNTAX
-.DS
-\fBstripchart \fIpathName \fR?\fIoption value\fR?...
-.DE
-The \fBstripchart\fR command creates a new window \fIpathName\fR and makes
-it into a \fBstripchart\fR widget. At the time this command is invoked, there
-must not exist a window named \fIpathName\fR, but \fIpathName\fR's
-parent must exist. Additional options may may be specified on the
-command line or in the option database to configure aspects of the
-strip chart such as its colors and font. See the \fBconfigure\fR operation
-below for the exact details as to what \fIoption\fR and \fIvalue\fR
-pairs are valid.
-.PP
-If successful, \fBstripchart\fR returns the path name of the widget. It
-also creates a new Tcl command by the same name. You can use this
-command to perform various operations that query or modify the graph.
-The general form is:
-.DS
-\fIpathName \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for the strip chart are described in
-the
-.SB "STRIPCHART OPERATIONS"
-section.
-.PP
-The command can also be used to access components of the strip chart.
-.DS
-\fIpathName component operation\fR ?\fIarg\fR?...
-.DE
-The operation, now located after the name of the component, is the
-function to be performed on that component. Each component has its own
-set of operations that manipulate that component. They will be
-described below in their own sections.
-.SH EXAMPLE
-The \fBstripchart\fR command creates a new strip chart.
-.CS
-# Create a new strip chart. Plotting area is black.
-stripchart .s -plotbackground black
-.CE
-A new Tcl command \f(CW.s\fR is also created. This command can be used
-to query and modify the strip chart. For example, to change the title of
-the strip chart to "My Plot", you use the new command and the widget's
-\fBconfigure\fR operation.
-.CS
-# Change the title.
-\&.s configure \-title "My Plot"
-.CE
-A strip chart has several components. To access a particular component you
-use the component's name. For example, to add data elements, you use
-the new command and the \fBelement\fR component.
-.CS
-# Create a new element named "line1"
-\&.s element create line1 \\
- \-xdata { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 } \\
- \-ydata { 26.18 50.46 72.85 93.31 111.86 128.47 143.14
- 155.85 166.60 175.38 }
-.CE
-The element's X and Y coordinates are specified using lists of
-numbers. Alternately, BLT vectors could be used to hold the X\-Y
-coordinates.
-.CS
-# Create two vectors and add them to the strip chart.
-vector xVec yVec
-xVec set { 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 }
-yVec set { 26.18 50.46 72.85 93.31 111.86 128.47 143.14 155.85
- 166.60 175.38 }
-\&.s element create line1 \-xdata xVec \-ydata yVec
-.CE
-The advantage of using vectors is that when you modify one, the graph
-is automatically redrawn to display the new values.
-.CS
-# Change the X\-Y coordinates of the first point.
-set xVec(0) 0.18
-set yVec(0) 25.18
-.CE
-An element named \f(CWline1\fR is now created in \f(CW.s\fR. By
-default, the element's label in the legend will be also \f(CWline1\fR.
-You can change the label, or specify no legend entry, again using the
-element's \fBconfigure\fR operation.
-.CS
-# Don't display "line1" in the legend.
-\&.s element configure line1 -label ""
-.CE
-You can configure more than just the element's label. An element has
-many attributes such as symbol type and size, dashed or solid lines,
-colors, line width, etc.
-.CS
-\&.s element configure line1 -symbol square -color red \\
- -dashes { 2 4 2 } -linewidth 2 -pixels 2c
-.CE
-Four coordinate axes are automatically created: \f(CWx\fR, \f(CWx2\fR,
-\f(CWy\fR, and \f(CWy2\fR. And by default, elements are mapped onto the
-axes \f(CWx\fR and \f(CWy\fR. This can be changed with the \fB\-mapx\fR
-and \fB\-mapy\fR options.
-.CS
-# Map "line1" on the alternate Y-axis "y2".
-\&.s element configure line1 -mapy y2
-.CE
-Axes can be configured in many ways too. For example, you change the
-scale of the Y-axis from linear to log using the \fBaxis\fR operation.
-.CS
-# Y-axis is log scale.
-\&.s axis configure y -logscale yes
-.CE
-Axis limits are reset by simply specifying new axis
-limits using the \fB\-min\fR and \fB\-max\fR configuration options.
-.CS
-\&.s axis configure x -min 1.0 -max 1.5
-\&.s axis configure y -min 12.0 -max 55.15
-.CE
-By default, the limits of the axis are determined from data values.
-To reset back to the default limits, set the \fB\-min\fR and
-\fB\-max\fR options to the empty value.
-.CS
-# Reset the axes to autoscale again.
-\&.s axis configure x -min {} -max {}
-\&.s axis configure y -min {} -max {}
-.CE
-It's common with strip charts to automatically maintain a view of
-the most recent time points. You can do this my setting the
-\fB\-autorange\fR option.
-.CS
-\&.s axis configure x -autorange 20.0
-.CE
-If the time points are added in X-coordinates 1.0 unit, only the last
-twenty time points will be displayed. As more data
-is added, the view will march along.
-.PP
-Sometimes the rate of data is so high that changing the axis limits
-with each additional time point is prohibitive. You can use the
-\fB\-shiftby\fR option to define an increment to shift the view
-when needed.
-.CS
-\&.s axis configure x -shiftby 15.0
-.CE
-When the view is shifted, it will allow a range of 15
-new time points to be added until the axis limits are recomputed.
-.PP
-By default, the legend is displayed in the right margin. You can
-change this or any other legend configuration options using the
-\fBlegend\fR component.
-.CS
-# Configure the legend font, color, and relief
-\&.s legend configure -position left -relief raised \\
- -font fixed -fg blue
-.CE
-To prevent the legend from being displayed, turn on the \fB\-hide\fR
-option.
-.CS
-# Don't display the legend.
-\&.s legend configure -hide yes\fR
-.CE
-The \fBstripchart\fR widget has simple drawing procedures called markers.
-They can be used to highlight or annotate data in the strip chart. The types
-of markers available are bitmaps, images, polygons, lines, or windows.
-Markers can be used, for example, to mark or brush points. Here
-is a text marker which labels the data first point. Markers
-are created using the \fBmarker\fR operation.
-.CS
-# Create a label for the first data point of "line1".
-\&.s marker create text \-name first_marker \-coords { 0.2 26.18 } \\
- \-text "start" \-anchor se \-xoffset -10 \-yoffset -10
-.CE
-This creates a text marker named \f(CWfirst_marker\fR. It will display
-the text "start" near the coordinates of the first data point. The
-\fB\-anchor\fR, \fB\-xoffset\fR, and \fB\-yoffset\fR options are used
-to display the marker above and to the left of the data point, so that
-the actual data point isn't covered by the marker. By default,
-markers are drawn last, on top of data. You can change this with the
-\fB\-under\fR option.
-.CS
-# Draw the label before elements are drawn.
-\&.s marker configure first_marker -under yes
-.CE
-You can add cross hairs or grid lines using the \fBcrosshairs\fR and
-\fBgrid\fR operations.
-.CS
-# Display both cross hairs and grid lines.
-\&.s crosshairs configure \-hide no \-color red
-\&.s grid configure \-hide no \-dashes { 2 2 }
-.CE
-Finally, to get hardcopy of the strip chart, use the \fBpostscript\fR
-operation.
-.CS
-# Print the strip chart into file "file.ps"
-\&.s postscript output file.ps \-maxpect yes \-decorations no
-.CE
-This generates a file \f(CWfile.ps\fR containing the encapsulated
-PostScript of the strip chart. The option \fB\-maxpect\fR says to scale the
-plot to the size of the page. Turning off the \fB\-decorations\fR
-option indicates that no borders or color backgrounds should be
-displayed (i.e. the background of the margins, legend, and plotting
-area will be white).
-.SH "STRIPCHART OPERATIONS"
-.TP
-\fIpathName \fBaxis \fIoperation\fR ?\fIarg\fR?...
-See the
-.SB "AXIS COMPONENTS"
-section.
-.TP
-\fIpathName \fBbar \fIelemName \fR?\fIoption value\fR?...
-Creates a new barchart element \fIelemName\fR. It's an
-error if an element \fIelemName\fR already exists.
-See the manual for \fBbarchart\fR for details about
-what \fIoption\fR and \fIvalue\fR pairs are valid.
-.TP
-\fIpathName \fBcget\fR \fIoption\fR
-Returns the current value of the stripchart configuration option given by
-\fIoption\fR. \fIOption\fR may be any option described
-below for the \fBconfigure\fR operation.
-.TP
-\fIpathName \fBconfigure \fR?\fIoption value\fR?...
-Queries or modifies the configuration options of the strip chart. If
-\fIoption\fR isn't specified, a list describing all of the current
-options for \fIpathName\fR is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
-If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
-for each pair, the stripchart option \fIoption\fR is set to \fIvalue\fR.
-The following options are valid for the stripchart.
-.RS
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color. This includes the margins and
-legend, but not the plotting area.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the outside edge of the widget. The
-\fB\-relief\fR option determines if the border is to be drawn. The
-default is \f(CW2\fR.
-.TP
-\fB\-bottommargin \fIpixels\fR
-Specifies the size of the margin below the X\-coordinate axis. If
-\fIpixels\fR is \f(CW0\fR, the size of the margin is selected automatically.
-The default is \f(CW0\fR.
-.TP
-\fB\-bufferelements \fIboolean\fR
-Indicates whether to draw elements into a pixmap before displaying
-them on the screen. The advantage of buffering elements is when markers
-are used heavily. Markers can be moved and redrawn without requiring
-every element to be redrawn again. The disadvantage is that it takes
-slightly longer to draw the graph. If \fIboolean\fR is true, data elements are
-drawn to an internal pixmap. The option should be turned off if the plot
-is updated frequently. See the
-.SB "SPEED TIPS"
-section.
-The default is \f(CW1\fR.
-.TP
-\fB\-buffergraph \fIboolean\fR
-Indicates whether to draw the graph into a pixmap first.
-If \fIboolean\fR is true, the entire graph is drawn into a pixmap and then
-copied onto the screen. This reduces flashing. If false, the graph is
-drawn directly into the window. Especially under Windows, turning off the
-option can be helpful when the stripchart is updated frequently. Turning
-off this option also turns \fB\-bufferelements\fR off. See the
-.SB "SPEED TIPS"
-section.
-The default is \f(CW1\fR.
-.TP
-\fB\-cursor \fIcursor\fR
-Specifies the widget's cursor. The default
-cursor is \f(CWcrosshair\fR.
-.TP
-\fB\-font \fIfontName\fR
-Specifies the title font. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-18-180-*\fR.
-.TP
-\fB\-halo \fIpixels\fR
-Specifies a maximum distance to consider when searching for the
-closest data point (see the element's \fBclosest\fR operation below).
-Data points further than \fIpixels\fR away are ignored. The default is
-\f(CW0.5i\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the requested height of widget. The default is
-\f(CW4i\fR.
-.TP
-\fB\-invertxy \fIboolean\fR
-Indicates whether the placement X\-axis and Y\-axis should be inverted. If
-\fIboolean\fR is true, the X and Y axes are swapped. The default is
-\f(CW0\fR.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the title should be justified. This matters only when
-the title contains more than one line of text. \fIJustify\fR must be
-\f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR. The default is
-\f(CWcenter\fR.
-.TP
-\fB\-leftmargin \fIpixels\fR
-Sets the size of the margin from the left edge of the window to
-the Y\-coordinate axis. If \fIpixels\fR is \f(CW0\fR, the size is
-calculated automatically. The default is \f(CW0\fR.
-.TP
-\fB\-plotbackground \fIcolor\fR
-Specifies the background color of the plotting area. The default is
-\f(CWwhite\fR.
-.TP
-\fB\-plotborderwidth \fIpixels\fR
-Sets the width of the 3-D border around the plotting area. The
-\fB\-plotrelief\fR option determines if a border is drawn. The
-default is \f(CW2\fR.
-.TP
-\fB\-plotpadx \fIpad\fR
-Sets the amount of padding to be added to the left and right sides of
-the plotting area. \fIPad\fR can be a list of one or two screen
-distances. If \fIpad\fR has two elements, the left side of the
-plotting area entry is padded by the first distance and the right side
-by the second. If \fIpad\fR is just one distance, both the left and
-right sides are padded evenly. The default is \f(CW8\fR.
-.TP
-\fB\-plotpady \fIpad\fR
-Sets the amount of padding to be added to the top and bottom of the
-plotting area. \fIPad\fR can be a list of one or two screen
-distances. If \fIpad\fR has two elements, the top of the plotting
-area is padded by the first distance and the bottom by the second. If
-\fIpad\fR is just one distance, both the top and bottom are padded
-evenly. The default is \f(CW8\fR.
-.TP
-\fB\-plotrelief \fIrelief\fR
-Specifies the 3-D effect for the plotting area. \fIRelief\fR
-indicates how the interior of the plotting area should appear relative
-to rest of the strip chart; for example, \f(CWraised\fR means the plot should
-appear to protrude from the strip chart, relative to the surface of the
-strip chart. The default is \f(CWsunken\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for the widget. \fIRelief\fR
-indicates how the strip chart should appear relative to widget it is packed
-into; for example, \f(CWraised\fR means the strip chart should
-appear to protrude. The default is \f(CWflat\fR.
-.TP
-\fB\-rightmargin \fIpixels\fR
-Sets the size of margin from the plotting area to the right edge of
-the window. By default, the legend is displayed in this margin. If
-\fIpixels\fR is than 1, the margin size is selected automatically.
-.TP
-\fB\-takefocus\fR \fIfocus\fR
-Provides information used when moving the focus from window to window
-via keyboard traversal (e.g., Tab and Shift-Tab). If \fIfocus\fR is
-\f(CW0\fR, this means that this window should be skipped entirely during
-keyboard traversal. \f(CW1\fR means that the this window should always
-receive the input focus. An empty value means that the traversal
-scripts make the decision whether to focus on the window.
-The default is \f(CW""\fR.
-.TP
-\fB\-tile \fIimage\fR
-Specifies a tiled background. If \fIimage\fR isn't
-\f(CW""\fR, the background is tiled using \fIimage\fR.
-Otherwise, the normal background color is drawn (see the
-\fB\-background\fR option). \fIImage\fR must be an image created
-using the Tk \fBimage\fR command. The default is \f(CW""\fR.
-.TP
-\fB\-title \fItext\fR
-Sets the title to \fItext\fR. If \fItext\fR is \f(CW""\fR,
-no title will be displayed.
-.TP
-\fB\-topmargin \fIpixels\fR
-Specifies the size of the margin above the x2 axis. If \fIpixels\fR
-is \f(CW0\fR, the margin size is calculated automatically.
-.TP
-\fB\-width \fIpixels\fR
-Specifies the requested width of the widget. The default is
-\f(CW5i\fR.
-.RE
-.TP
-\fIpathName \fBcrosshairs \fIoperation \fR?\fIarg\fR?
-See the
-.SB "CROSSHAIRS COMPONENT"
-section.
-.TP
-\fIpathName \fBelement \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "ELEMENT COMPONENTS"
-section.
-.TP
-\fIpathName \fBextents \fIitem\fR
-Returns the size of a particular item in the strip chart. \fIItem\fR must
-be either \f(CWleftmargin\fR, \f(CWrightmargin\fR, \f(CWtopmargin\fR,
-\f(CWbottommargin\fR, \f(CWplotwidth\fR, or \f(CWplotheight\fR.
-.TP
-\fIpathName \fBgrid \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "GRID COMPONENT"
-section.
-.TP
-\fIpathName \fBinvtransform \fIwinX winY\fR
-Performs an inverse coordinate transformation, mapping window
-coordinates back to graph coordinates, using the standard X\-axis and Y\-axis.
-Returns a list of containing the graph coordinates.
-.TP
-\fIpathName \fBlegend \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "LEGEND COMPONENT"
-section.
-.TP
-\fIpathName \fBline \fIelemName\fR ?\fIoption value\fR?...
-The operation is the same as \fBelement\fR.
-.TP
-\fIpathName \fBmarker \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "MARKER COMPONENTS"
-section.
-.TP
-\fIpathName\fR \fBmetafile\fR ?\fIfileName\fR?
-\fIThis operation is for Window platforms only\fR.
-Creates a Windows enhanced metafile of the stripchart.
-If present, \fIfileName\fR is the file name of the new metafile.
-Otherwise, the metafile is automatically added to the clipboard.
-.TP
-\fIpathName \fBpostscript \fIoperation \fR?\fIarg\fR?...
-See the
-.SB "POSTSCRIPT COMPONENT"
-section.
-.TP
-\fIpathName \fBsnap \fIphotoName\fR
-Takes a snapshot of the strip chart and stores the contents in the photo
-image \fIphotoName\fR. \fIPhotoName\fR is the name of a Tk photo
-image that must already exist.
-.TP
-\fIpathName \fBtransform \fIx y\fR
-Performs a coordinate transformation, mapping graph coordinates to
-window coordinates, using the standard X\-axis and Y\-axis.
-Returns a list containing the X\-Y screen coordinates.
-.TP
-\fIpathName \fBxaxis \fIoperation\fR ?\fIarg\fR?...
-.TP
-\fIpathName \fBx2axis \fIoperation\fR ?\fIarg\fR?...
-.TP
-\fIpathName \fByaxis \fIoperation\fR ?\fIarg\fR?...
-.TP
-\fIpathName \fBy2axis \fIoperation\fR ?\fIarg\fR?...
-See the
-.SB "AXIS COMPONENTS"
-section.
-.SH "STRIPCHART COMPONENTS"
-A strip chart is composed of several components: coordinate axes, data
-elements, legend, grid, cross hairs, postscript, and annotation
-markers. Instead of one big set of configuration options and
-operations, the strip chart is partitioned, where each component has its own
-configuration options and operations that specifically control that
-aspect or part of the strip chart.
-.SS "AXIS COMPONENTS"
-Four coordinate axes are automatically created: two X\-coordinate axes
-(\f(CWx\fR and \f(CWx2\fR) and two Y\-coordinate axes (\f(CWy\fR, and
-\f(CWy2\fR). By default, the axis \f(CWx\fR is located in the bottom
-margin, \f(CWy\fR in the left margin, \f(CWx2\fR in the top margin, and
-\f(CWy2\fR in the right margin.
-.PP
-An axis consists of the axis line, title, major and minor ticks, and
-tick labels. Major ticks are drawn at uniform intervals along the
-axis. Each tick is labeled with its coordinate value. Minor ticks
-are drawn at uniform intervals within major ticks.
-.PP
-The range of the axis controls what region of data is plotted.
-Data points outside the minimum and maximum limits of the axis are
-not plotted. By default, the minimum and maximum limits are
-determined from the data, but you can reset either limit.
-.PP
-You can create and use several axes. To create an axis, invoke
-the axis component and its create operation.
-.CS
-# Create a new axis called "temperature"
-\&.s axis create temperature
-.CE
-You map data elements to an axis using the element's \-mapy and \-mapx
-configuration options. They specify the coordinate axes an element
-is mapped onto.
-.CS
-# Now map the temperature data to this axis.
-\&.s element create "temp" \-xdata $x \-ydata $tempData \\
- \-mapy temperature
-.CE
-While you can have many axes, only four axes can be displayed
-simultaneously. They are drawn in each of the margins surrounding the
-plotting area. The axes x and y are drawn in the bottom and left
-margins. The axes x2 and y2 are drawn in top and right margins.
-Only x and y are shown by default. Note that the axes can have
-different scales.
-.PP
-To display a different axis, you invoke one of the following
-components: \fBxaxis\fR, \fByaxis\fR, \fBx2axis\fR, and \fBy2axis\fR.
-The \fBuse\fR operation designates the axis to be drawn in the
-corresponding margin: \fBxaxis\fR in the bottom, \fByaxis\fR in the left,
-\fBx2axis\fR in the top, and \fBy2axis\fR in the right.
-.CS
-# Display the axis temperature in the left margin.
-\&.s yaxis use temperature
-.CE
-.PP
-You can configure axes in many ways. The axis scale can be linear or
-logarithmic. The values along the axis can either monotonically
-increase or decrease. If you need custom tick labels, you can specify
-a Tcl procedure to format the label as you wish. You can
-control how ticks are drawn, by changing the major tick interval
-or the number of minor ticks. You can define non-uniform tick intervals,
-such as for time-series plots.
-.PP
-.TP
-\fIpathName \fBaxis \fBcget \fIaxisName \fIoption\fR
-Returns the current value of the option given by \fIoption\fR for
-\fIaxisName\fR. \fIOption\fR may be any option described below
-for the axis \fBconfigure\fR operation.
-.TP
-\fIpathName \fBaxis \fBconfigure \fIaxisName \fR?\fIoption value\fR?...
-Queries or modifies the configuration options of \fIaxisName\fR. If
-\fIoption\fR isn't specified, a list describing all the current
-options for \fIaxisName\fR is returned. If \fIoption\fR is specified, but
-not \fIvalue\fR, then a list describing \fIoption\fR is
-returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
-specified, then for each pair, the axis option \fIoption\fR is set to
-\fIvalue\fR.
-The following options are valid for axes.
-.RS
-.TP
-\fB\-autorange \fIrange\fR
-Sets the range of values for the axis to \fIrange\fR. The axis limits
-are automatically reset to display the most recent data points in this range.
-If \fIrange\fR is 0.0, the range is
-determined from the limits of the data. If \fB\-min\fR or \fB-max\fR
-are specified, they override this option. The default is \f(CW0.0\fR.
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the axis and tick labels.
-The default is \f(CWblack\fR.
-.TP
-\fB\-command \fIprefix\fR
-Specifies a Tcl command to be invoked when formatting the axis tick
-labels. \fIPrefix\fR is a string containing the name of a Tcl proc and
-any extra arguments for the procedure. This command is invoked for each
-major tick on the axis. Two additional arguments are passed to the
-procedure: the pathname of the widget and the current the numeric
-value of the tick. The procedure returns the formatted tick label. If
-\f(CW""\fR is returned, no label will appear next to the tick. You can
-get the standard tick labels again by setting \fIprefix\fR to
-\f(CW""\fR. The default is \f(CW""\fR.
-.sp 1
-Please note that this procedure is invoked while the strip chart is redrawn.
-You may query the configuration options. But do not reset them, because
-this can have unexpected results.
-.TP
-\fB\-descending \fIboolean\fR
-Indicates whether the values along the axis are monotonically increasing or
-decreasing. If \fIboolean\fR is true, the axis values will be
-decreasing. The default is \f(CW0\fR.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the axis is displayed.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the axis title should be justified. This matters only
-when the axis title contains more than one line of text. \fIJustify\fR
-must be \f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR. The default is
-\f(CWcenter\fR.
-.TP
-\fB\-limits \fIformatStr\fR
-Specifies a printf-like description to format the minimum and maximum
-limits of the axis. The limits are displayed at the top/bottom or
-left/right sides of the plotting area. \fIFormatStr\fR is a list of
-one or two format descriptions. If one description is supplied, both
-the minimum and maximum limits are formatted in the same way. If two,
-the first designates the format for the minimum limit, the second for
-the maximum. If \f(CW""\fR is given as either description, then
-the that limit will not be displayed. The default is \f(CW""\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the axis and tick lines. The default is \f(CW1\fR
-pixel.
-.TP
-\fB\-logscale \fIboolean\fR
-Indicates whether the scale of the axis is logarithmic or linear. If
-\fIboolean\fR is true, the axis is logarithmic. The default scale is
-linear.
-.TP
-\fB\-loose \fIboolean\fR
-Indicates whether the limits of the axis should fit the data points tightly,
-at the outermost data points, or loosely, at the outer tick intervals.
-This is relevant only when the axis limit is automatically calculated.
-If \fIboolean\fR is true, the axis range is "loose".
-The default is \f(CW0\fR.
-.TP
-\fB\-majorticks \fImajorList\fR
-Specifies where to display major axis ticks. You can use this option
-to display ticks at non-uniform intervals. \fIMajorList\fR is a list
-of axis coordinates designating the location of major ticks. No
-minor ticks are drawn. If \fImajorList\fR is \f(CW""\fR,
-major ticks will be automatically computed. The default is \f(CW""\fR.
-.TP
-\fB\-max \fIvalue\fR
-Sets the maximum limit of \fIaxisName\fR. Any data point greater
-than \fIvalue\fR is not displayed. If \fIvalue\fR is \f(CW""\fR,
-the maximum limit is calculated using the largest data value.
-The default is \f(CW""\fR.
-.TP
-\fB\-min \fIvalue\fR
-Sets the minimum limit of \fIaxisName\fR. Any data point less than
-\fIvalue\fR is not displayed. If \fIvalue\fR is \f(CW""\fR,
-the minimum limit is calculated using the smallest data value.
-The default is \f(CW""\fR.
-.TP
-\fB\-minorticks \fIminorList\fR
-Specifies where to display minor axis ticks. You can use this option
-to display minor ticks at non-uniform intervals. \fIMinorList\fR is a
-list of real values, ranging from 0.0 to 1.0, designating the placement of
-a minor tick. No minor ticks are drawn if the \fB\-majortick\fR
-option is also set. If \fIminorList\fR is \f(CW""\fR, minor ticks will
-be automatically computed. The default is \f(CW""\fR.
-.TP
-\fB\-rotate \fItheta\fR
-Specifies the how many degrees to rotate the axis tick labels.
-\fITheta\fR is a real value representing the number of degrees
-to rotate the tick labels. The default is \f(CW0.0\fR degrees.
-.TP
-\fB\-shiftby \fIvalue\fR
-Specifies how much to automatically shift the range of the axis.
-When the new data exceeds the current axis maximum, the maximum
-is increased in increments of \fIvalue\fR. You can use this
-option to prevent the axis limits from being recomputed
-at each new time point. If \fIvalue\fR is 0.0, then no automatic
-shifting is done. The default is \f(CW0.0\fR.
-.TP
-\fB\-showticks \fIboolean\fR
-Indicates whether axis ticks should be drawn. If \fIboolean\fR is
-true, ticks are drawn. If false, only the
-axis line is drawn. The default is \f(CW1\fR.
-.TP
-\fB\-stepsize \fIvalue\fR
-Specifies the interval between major axis ticks. If \fIvalue\fR isn't
-a valid interval (must be less than the axis range),
-the request is ignored and the step size is automatically calculated.
-.TP
-\fB\-subdivisions \fInumber\fR
-Indicates how many minor axis ticks are
-to be drawn. For example, if \fInumber\fR is two, only one minor
-tick is drawn. If \fInumber\fR is one, no minor ticks are
-displayed. The default is \f(CW2\fR.
-.TP
-\fB\-tickfont \fIfontName\fR
-Specifies the font for axis tick labels. The default is
-\f(CW*-Courier-Bold-R-Normal-*-100-*\fR.
-.TP
-\fB\-ticklength \fIpixels\fR
-Sets the length of major and minor ticks (minor ticks are half the
-length of major ticks). If \fIpixels\fR is less than zero, the axis
-will be inverted with ticks drawn pointing towards the plot. The
-default is \f(CW0.1i\fR.
-.TP
-\fB\-title \fItext\fR
-Sets the title of the axis. If \fItext\fR is
-\f(CW""\fR, no axis title will be displayed.
-.TP
-\fB\-titlecolor \fIcolor\fR
-Sets the color of the axis title. The default is \f(CWblack\fR.
-.TP
-\fB\-titlefont \fIfontName\fR
-Specifies the font for axis title. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-14-140-*\fR.
-.PP
-Axis configuration options may be also be set by the \fBoption\fR
-command. The resource class is \f(CWAxis\fR. The resource names
-are the names of the axes (such as \f(CWx\fR or \f(CWx2\fR).
-.CS
-option add *Stripchart.Axis.Color blue
-option add *Stripchart.x.LogScale true
-option add *Stripchart.x2.LogScale false
-.CE
-.RE
-.TP
-\fIpathName \fBaxis \fBcreate \fIaxisName \fR?\fIoption value\fR?...
-Creates a new axis by the name \fIaxisName\fR. No axis by the same
-name can already exist. \fIOption\fR and \fIvalue\fR are described
-in above in the axis \fBconfigure\fR operation.
-.TP
-\fIpathName \fBaxis \fBdelete \fR?\fIaxisName\fR?...
-Deletes the named axes. An axis is not really
-deleted until it is not longer in use, so it's safe to delete
-axes mapped to elements.
-.TP
-\fIpathName \fBaxis invtransform \fIaxisName value\fR
-Performs the inverse transformation, changing the screen coordinate
-\fIvalue\fR to a graph coordinate, mapping the value mapped to
-\fIaxisName\fR. Returns the graph coordinate.
-.TP
-\fIpathName \fBaxis limits \fIaxisName\fR
-Returns a list of the minimum and maximum limits for \fIaxisName\fR. The order
-of the list is \f(CWmin max\fR.
-.TP
-\fIpathName \fBaxis names \fR?\fIpattern\fR?...
-Returns a list of axes matching zero or more patterns. If no
-\fIpattern\fR argument is give, the names of all axes are returned.
-.TP
-\fIpathName \fBaxis transform \fIaxisName value\fR
-Transforms the coordinate \fIvalue\fR to a screen coordinate by mapping
-the it to \fIaxisName\fR. Returns the transformed screen coordinate.
-.PP
-Only four axes can be displayed simultaneously. By default, they are
-\f(CWx\fR, \f(CWy\fR, \f(CWx2\fR, and \f(CWy2\fR. You can swap in a different
-axis with \fBuse\fR operation of the special axis components:
-\fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, and \fBy2axis\fR.
-.CS
-\&.g create axis temp
-\&.g create axis time
-\&...
-\&.g xaxis use temp
-\&.g yaxis use time
-.CE
-Only the axes specified for use are displayed on the screen.
-.PP
-The \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, and \fBy2axis\fR
-components operate on an axis location rather than a specific axis
-like the more general \fBaxis\fR component does. The \fBxaxis\fR
-component manages the X-axis located in the bottom margin (whatever
-axis that happens to be). Likewise, \fByaxis\fR uses the Y-axis in
-the left margin, \fBx2axis\fR the top X-axis, and \fBy2axis\fR the
-right Y-axis.
-.PP
-They implicitly control the axis that is currently using to that
-location. By default, \fBxaxis\fR uses the \f(CWx\fR axis, \fByaxis\fR
-uses \f(CWy\fR, \fBx2axis\fR uses \f(CWx2\fR, and \fBy2axis\fR uses
-\f(CWy2\fR. These components can be more convenient to use than always
-determining what axes are current being displayed by the graph.
-.PP
-The following operations are available for axes. They mirror exactly
-the operations of the \fBaxis\fR component. The \fIaxis\fR argument
-must be \fBxaxis\fR, \fBx2axis\fR, \fByaxis\fR, or \fBy2axis\fR.
-.TP
-\fIpathName \fIaxis \fBcget \fIoption\fR
-.TP
-\fIpathName \fIaxis \fBconfigure \fR?\fIoption value\fR?...
-.TP
-\fIpathName \fIaxis\fB invtransform \fIvalue\fR
-.TP
-\fIpathName \fIaxis \fBlimits\fR
-.TP
-\fIpathName \fIaxis\fB transform \fIvalue\fR
-.TP
-\fIpathName \fIaxis\fB use \fR?\fIaxisName\fR?
-Designates the axis \fIaxisName\fR is to be displayed at this
-location. \fIAxisName\fR can not be already in use at another location.
-This command returns the name of the axis currently using this location.
-.SS "CROSSHAIRS COMPONENT"
-Cross hairs consist of two intersecting lines (one vertical and one horizontal)
-drawn completely across the plotting area. They are used to position
-the mouse in relation to the coordinate axes. Cross hairs differ from line
-markers in that they are implemented using XOR drawing primitives.
-This means that they can be quickly drawn and erased without redrawing
-the entire strip chart.
-.PP
-The following operations are available for cross hairs:
-.TP
-\fIpathName \fBcrosshairs cget \fIoption\fR
-Returns the current value of the cross hairs configuration option
-given by \fIoption\fR. \fIOption\fR may be any option
-described below for the cross hairs \fBconfigure\fR operation.
-.TP
-\fIpathName \fBcrosshairs configure \fR?\fIoption value\fR?...
-Queries or modifies the configuration options of the cross hairs. If
-\fIoption\fR isn't specified, a list describing all the current
-options for the cross hairs is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
-If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
-for each pair, the cross hairs option \fIoption\fR is set to
-\fIvalue\fR.
-The following options are available for cross hairs.
-.RS
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the cross hairs. The default is \f(CWblack\fR.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the cross hairs. \fIDashList\fR is a list of up
-to 11 numbers that alternately represent the lengths of the dashes
-and gaps on the cross hair lines. Each number must be between 1 and
-255. If \fIdashList\fR is \f(CW""\fR, the cross hairs will be solid
-lines.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether cross hairs are drawn. If \fIboolean\fR is true,
-cross hairs are not drawn. The default is \f(CWyes\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Set the width of the cross hair lines. The default is \f(CW1\fR.
-.TP
-\fB\-position \fIpos\fR
-Specifies the screen position where the cross hairs intersect.
-\fIPos\fR must be in the form "\fI at x,y\fR", where \fIx\fR and \fIy\fR
-are the window coordinates of the intersection.
-.PP
-Cross hairs configuration options may be also be set by the
-\fBoption\fR command. The resource name and class are
-\f(CWcrosshairs\fR and \f(CWCrosshairs\fR respectively.
-.CS
-option add *Stripchart.Crosshairs.LineWidth 2
-option add *Stripchart.Crosshairs.Color red
-.CE
-.RE
-.TP
-\fIpathName \fBcrosshairs off\fR
-Turns of the cross hairs.
-.TP
-\fIpathName \fBcrosshairs on\fR
-Turns on the display of the cross hairs.
-.TP
-\fIpathName \fBcrosshairs toggle\fR
-Toggles the current state of the cross hairs, alternately mapping and
-unmapping the cross hairs.
-.SS "ELEMENT COMPONENTS"
-A data element represents a set of data. It contains x and y vectors
-containing the coordinates of the data points. Elements can be
-displayed with a symbol at each data point and lines connecting the
-points. Elements also control the appearance of the data, such as the
-symbol type, line width, color etc.
-.PP
-When new data elements are created, they are automatically added to a
-list of displayed elements. The display list controls what elements
-are drawn and in what order.
-.PP
-The following operations are available for elements.
-.TP
-\fIpathName \fBelement activate \fIelemName \fR?\fIindex\fR?...
-Specifies the data points of element \fIelemName\fR to be drawn
-using active foreground and background colors. \fIElemName\fR is the
-name of the element and \fIindex\fR is a number representing the index
-of the data point. If no indices are present then all data points
-become active.
-.TP
-\fIpathName \fBelement cget \fIelemName \fIoption\fR
-Returns the current value of the element configuration option given by
-\fIoption\fR. \fIOption\fR may be any option described below
-for the element \fBconfigure\fR operation.
-.TP
-\fIpathName \fBelement closest \fIx y\fR \fIvarName\fR ?\fIoption value\fR?... ?\fIelemName\fR?...
-Finds the data point closest to the window coordinates \fIx\fR and
-\fIy\fR in the element \fIelemName\fR. \fIElemName\fR is the name of
-an element, that must not be hidden. If no elements are specified,
-then all visible elements are searched. It returns via the array
-variable \fIvarName\fR the name of the closest element, the index of
-its closest point, and the graph coordinates of the point. Returns
-\f(CW0\fR, if no data point within the threshold distance can be found,
-otherwise \f(CW1\fR is returned. The following
-\fIoption\fR\-\fIvalue\fR pairs are available.
-.RS
-.TP
-\fB\-halo \fIpixels\fR
-Specifies a threshold distance where selected data points are ignored.
-\fIPixels\fR is a valid screen distance, such as \f(CW2\fR or \f(CW1.2i\fR.
-If this option isn't specified, then it defaults to the value of the
-stripchart's \fB\-halo\fR option.
-.TP
-\fB\-interpolate \fIboolean\fR
-Indicates that both the data points and interpolated points along
-the line segment formed should be considered. If \fIboolean\fR
-is true, the closest line segment will be selected instead of the
-closest point. If this option isn't specified, \fIboolean\fR defaults
-to \f(CW0\fR.
-.RE
-.TP
-\fIpathName \fBelement configure \fIelemName \fR?\fIoption value\fR?...
-Queries or modifies the configuration options for elements. If
-\fIoption\fR isn't specified, a list describing all the current
-options for \fIelemName\fR is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing the option \fIoption\fR is
-returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
-specified, then for each pair, the element option \fIoption\fR is set
-to \fIvalue\fR. The following options are valid for elements.
-.RS
-.TP
-\fB\-activepen \fIpenName\fR
-Specifies pen to use to draw active element. If \fIpenName\fR is
-\f(CW""\fR, no active elements will be drawn. The default is
-\f(CWactiveLine\fR.
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the traces connecting the data points.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of element line. \fIDashList\fR is a list of up to
-11 numbers that alternately represent the lengths of the dashes and
-gaps on the element line. Each number must be between 1 and 255. If
-\fIdashList\fR is \f(CW""\fR, the lines will be solid.
-.TP
-\fB\-data \fIcoordList\fR
-Specifies the X\-Y coordinates of the data. \fICoordList\fR is a
-list of numeric expressions representing the X\-Y coordinate pairs
-of each data point.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the interior color of symbols. If \fIcolor\fR is \f(CW""\fR, then
-the interior of the symbol is transparent. If \fIcolor\fR is
-\f(CWdefcolor\fR, then the color will be the same as the \fB\-color\fR
-option. The default is \f(CWdefcolor\fR.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the element is displayed. The default is \f(CWno\fR.
-.TP
-\fB\-label \fItext\fR
-Sets the element's label in the legend. If \fItext\fR
-is \f(CW""\fR, the element will have no entry in the legend.
-The default label is the element's name.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the connecting lines between data points. If
-\fIpixels\fR is \f(CW0\fR, no connecting lines will be drawn between
-symbols. The default is \f(CW0\fR.
-.TP
-\fB\-mapx \fIxAxis\fR
-Selects the X\-axis to map the element's X\-coordinates onto.
-\fIXAxis\fR must be the name of an axis. The default is \f(CWx\fR.
-.TP
-\fB\-mapy \fIyAxis\fR
-Selects the Y\-axis to map the element's Y\-coordinates onto.
-\fIYAxis\fR must be the name of an axis. The default is \f(CWy\fR.
-.TP
-\fB\-offdash \fIcolor\fR
-Sets the color of the stripes when traces are dashed (see the
-\fB\-dashes\fR option). If \fIcolor\fR is \f(CW""\fR, then the "off"
-pixels will represent gaps instead of stripes. If \fIcolor\fR is
-\f(CWdefcolor\fR, then the color will be the same as the \fB\-color\fR
-option. The default is \f(CWdefcolor\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the color or the outline around each symbol. If \fIcolor\fR is
-\f(CW""\fR, then no outline is drawn. If \fIcolor\fR is \f(CWdefcolor\fR,
-then the color will be the same as the \fB\-color\fR option. The
-default is \f(CWdefcolor\fR.
-.TP
-\fB\-outlinewidth \fIpixels\fR
-Sets the width of the outline bordering each symbol. If \fIpixels\fR
-is \f(CW0\fR, no outline will be drawn. The default is \f(CW1\fR.
-.TP
-\fB\-pixels \fIpixels\fR
-Sets the size of symbols. If \fIpixels\fR is \f(CW0\fR, no symbols will
-be drawn. The default is \f(CW0.125i\fR.
-.TP
-\fB\-scalesymbols \fIboolean\fR
-If \fIboolean\fR is true, the size of the symbols
-drawn for \fIelemName\fR will change with scale of the X\-axis and Y\-axis.
-At the time this option is set, the current ranges of the axes are
-saved as the normalized scales (i.e scale factor is 1.0) and the
-element is drawn at its designated size (see the \fB\-pixels\fR
-option). As the scale of the axes change, the symbol will be scaled
-according to the smaller of the X\-axis and Y\-axis scales. If \fIboolean\fR
-is false, the element's symbols are drawn at the designated size,
-regardless of axis scales. The default is \f(CW0\fR.
-.TP
-\fB\-smooth \fIsmooth\fR
-Specifies how connecting line segments are drawn between data points.
-\fISmooth\fR can be either \f(CWlinear\fR, \f(CWstep\fR, \f(CWnatural\fR, or
-\f(CWquadratic\fR. If \fIsmooth\fR is \f(CWlinear\fR, a single line
-segment is drawn, connecting both data points. When \fIsmooth\fR is
-\f(CWstep\fR, two line segments are drawn. The first is a horizontal
-line segment which steps the next x-coordinate. The second is a
-vertical line, moving to the next y-coordinate. Both \fInatural\fR and
-\fIquadratic\fR generate multiple segments between data points. If
-\fInatural\fR, the segments are generated using a cubic spline. If
-\fIquadratic\fR, a quadratic spline is used. The default is
-\fIlinear\fR.
-.TP
-\fB\-styles \fIstyleList\fR
-Specifies what pen to use based upon the range of weights given.
-\fIStyleList\fR is a list of style specifications. Each style
-specification, in turn, is a list consisting of a pen name, and
-optionally a minimum and maximum range. Data points whose weight (see
-the \fB\-weight\fR option) falls in this range, are drawn with this
-pen. If no range is specified it defaults to the number of the pen in
-the list.
-.TP
-\fB\-symbol \fIsymbol\fR
-Specifies the symbol for data points. \fISymbol\fR can be either
-\f(CWsquare\fR, \f(CWcircle\fR, \f(CWdiamond\fR, \f(CWplus\fR, \f(CWcross\fR,
-\f(CWsplus\fR, \f(CWscross\fR, \f(CWtriangle\fR, \f(CW""\fR (where no symbol
-is drawn), or a bitmap. Bitmaps are specified as "\fIsource\fR
-?\fImask\fR?", where \fIsource\fR is the name of the bitmap, and
-\fImask\fR is the bitmap's optional mask. The default is
-\f(CWcircle\fR.
-.TP
-\fB\-weights \fIwVec\fR
-Specifies the weights of the individual data points. This, in
-conjunction with the list pen styles (see the \fB\-styles\fR option)
-controls how data points are drawn. \fIWVec\fR is the name of a BLT
-vector or a list of numeric expressions representing the weights for
-each data point.
-.TP
-\fB\-xdata \fIxVec\fR
-Specifies the x-coordinates of the data. \fIXVec\fR is the name of
-a BLT vector or a list of numeric expressions.
-.TP
-\fB\-ydata \fIyVec\fR
-Specifies the y-coordinates of the data. \fIYVec\fR is the name of
-a BLT vector or a list of numeric expressions.
-.PP
-Element configuration options may also be set by the \fBoption\fR
-command. The resource class is \f(CWElement\fR. The resource name is
-the name of the element.
-.CS
-option add *Stripchart.Element.symbol line
-option add *Stripchart.e1.symbol line
-.CE
-.RE
-.TP
-\fIpathName \fBelement create \fIelemName\fR ?\fIoption value\fR?...
-Creates a new element \fIelemName\fR. It's an error is
-an element \fIelemName\fR already exists. If
-additional arguments are present, they specify options valid for
-element \fBconfigure\fR operation.
-.TP
-\fIpathName \fBelement deactivate \fIelemName\fR ?\fIelemName\fR?...
-Deactivates all the elements matching \fIpattern\fR.
-Elements whose names match any of the patterns given are redrawn using
-their normal colors.
-.TP
-\fIpathName \fBelement delete\fR ?\fIelemName\fR?...
-Deletes all the named elements. The graph is automatically redrawn.
-.TP
-\fIpathName \fBelement exists \fIelemName\fR
-Returns \f(CW1\fR if an element \fIelemName\fR currently exists and \f(CW0\fR otherwise.
-.TP
-\fIpathName \fBelement names \fR?\fIpattern\fR?...
-Returns the elements matching one or more pattern. If no
-\fIpattern\fR is given, the names of all elements is returned.
-.TP
-\fIpathName \fBelement show\fR ?\fInameList\fR?
-Queries or modifies the element display list. The element display
-list designates the elements drawn and in what
-order. \fINameList\fR is a list of elements to be displayed in the
-order they are named. If there is no \fInameList\fR argument,
-the current display list is returned.
-.TP
-\fIpathName \fBelement type\fR \fIelemName\fR
-Returns the type of \fIelemName\fR.
-If the element is a bar element, the commands returns the string
-\f(CW"bar"\fR, otherwise it returns \f(CW"line"\fR.
-.CE
-.SS "GRID COMPONENT"
-Grid lines extend from the major and minor ticks of each axis
-horizontally or vertically across the plotting area. The following
-operations are available for grid lines.
-.TP
-\fIpathName \fBgrid cget \fIoption\fR
-Returns the current value of the grid line configuration option given by
-\fIoption\fR. \fIOption\fR may be any option described below
-for the grid \fBconfigure\fR operation.
-.TP
-\fIpathName \fBgrid configure\fR ?\fIoption value\fR?...
-Queries or modifies the configuration options for grid lines. If
-\fIoption\fR isn't specified, a list describing all the current
-grid options for \fIpathName\fR is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing \fIoption\fR is
-returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
-specified, then for each pair, the grid line option \fIoption\fR is set to
-\fIvalue\fR. The following options are valid for grid lines.
-.RS
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the grid lines. The default is \f(CWblack\fR.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the grid lines. \fIDashList\fR is a list of up
-to 11 numbers that alternately represent the lengths of the dashes
-and gaps on the grid lines. Each number must be between 1 and 255.
-If \fIdashList\fR is \f(CW""\fR, the grid will be solid lines.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the grid should be drawn. If \fIboolean\fR
-is true, grid lines are not shown. The default is \f(CWyes\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of grid lines. The default width is \f(CW1\fR.
-.TP
-\fB\-mapx \fIxAxis\fR
-Specifies the X\-axis to display grid lines. \fIXAxis\fR
-must be the name of an axis. The default is \f(CWx\fR.
-.TP
-\fB\-mapy \fIyAxis\fR
-Specifies the Y\-axis to display grid lines. \fIYAxis\fR
-must be the name of an axis. The default is \f(CWy\fR.
-.TP
-\fB\-minor \fIboolean\fR
-Indicates whether the grid lines should be drawn for minor ticks.
-If \fIboolean\fR is true, the lines will appear at
-minor tick intervals. The default is \f(CW1\fR.
-.PP
-Grid configuration options may also be set by the
-\fBoption\fR command. The resource name and class are \f(CWgrid\fR and
-\f(CWGrid\fR respectively.
-.CS
-option add *Stripchart.grid.LineWidth 2
-option add *Stripchart.Grid.Color black
-.CE
-.RE
-.TP
-\fIpathName \fBgrid off\fR
-Turns off the display the grid lines.
-.TP
-\fIpathName \fBgrid on\fR
-Turns on the display the grid lines.
-.TP
-\fIpathName \fBgrid toggle\fR
-Toggles the display of the grid.
-.SS "LEGEND COMPONENT"
-The legend displays a list of the data elements. Each entry consists
-of the element's symbol and label. The legend can appear in any
-margin (the default location is in the right margin). It
-can also be positioned anywhere within the plotting area.
-.PP
-The following operations are valid for the legend.
-.TP
-\fIpathName \fBlegend activate \fIpattern\fR...
-Selects legend entries to be drawn using the active legend colors and relief.
-All entries whose element names match \fIpattern\fR are selected. To
-be selected, the element name must match only one \fIpattern\fR.
-.TP
-\fIpathName \fBlegend cget \fIoption\fR
-Returns the current value of a legend configuration option.
-\fIOption\fR may be any option described below in the
-legend \fBconfigure\fR operation.
-.TP
-\fIpathName \fBlegend configure \fR?\fIoption value\fR?...
-Queries or modifies the configuration options for the legend. If
-\fIoption\fR isn't specified, a list describing the current
-legend options for \fIpathName\fR is returned. If \fIoption\fR is
-specified, but not \fIvalue\fR, then a list describing \fIoption\fR is
-returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
-specified, then for each pair, the legend option \fIoption\fR is set
-to \fIvalue\fR. The following options are valid for the legend.
-.RS
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the background color for active legend entries. All legend
-entries marked active (see the legend \fBactivate\fR operation) are
-drawn using this background color.
-.TP
-\fB\-activeborderwidth \fIpixels\fR
-Sets the width of the 3-D border around the outside edge of the active legend
-entries. The default is \f(CW2\fR.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the foreground color for active legend entries. All legend
-entries marked as active (see the legend \fBactivate\fR operation) are
-drawn using this foreground color.
-.TP
-\fB\-activerelief \fIrelief\fR
-Specifies the 3-D effect desired for active legend entries.
-\fIRelief\fR denotes how the interior of the entry should appear
-relative to the legend; for example, \f(CWraised\fR means the entry
-should appear to protrude from the legend, relative to the surface of
-the legend. The default is \f(CWflat\fR.
-.TP
-\fB\-anchor \fIanchor\fR
-Tells how to position the legend relative to the positioning point for
-the legend. This is dependent on the value of the \fB\-position\fR
-option. The default is \f(CWcenter\fR.
-.RS
-.TP 1.25i
-\f(CWleft\fR or \f(CWright\fR
-The anchor describes how to position the legend vertically.
-.TP
-\f(CWtop\fR or \f(CWbottom\fR
-The anchor describes how to position the legend horizontally.
-.TP
-\f(CW at x,y\fR
-The anchor specifies how to position the legend relative to the
-positioning point. For example, if \fIanchor\fR is \f(CWcenter\fR then
-the legend is centered on the point; if \fIanchor\fR is \f(CWn\fR then
-the legend will be drawn such that the top center point of the
-rectangular region occupied by the legend will be at the positioning
-point.
-.TP
-\f(CWplotarea\fR
-The anchor specifies how to position the legend relative to the
-plotting area. For example, if \fIanchor\fR is \f(CWcenter\fR then the
-legend is centered in the plotting area; if \fIanchor\fR is \f(CWne\fR
-then the legend will be drawn such that occupies the upper right
-corner of the plotting area.
-.RE
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the legend. If \fIcolor\fR is \f(CW""\fR,
-the legend background with be transparent.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3-D border around the outside edge of the legend (if
-such border is being drawn; the \fBrelief\fR option determines this).
-The default is \f(CW2\fR pixels.
-.TP
-\fB\-font \fIfontName\fR
-\fIFontName\fR specifies a font to use when drawing the labels of each
-element into the legend. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the foreground color of the text drawn for the element's label.
-The default is \f(CWblack\fR.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the legend should be displayed. If \fIboolean\fR is
-true, the legend will not be draw. The default is \f(CWno\fR.
-.TP
-\fB\-ipadx \fIpad\fR
-Sets the amount of internal padding to be added to the width of each
-legend entry. \fIPad\fR can be a list of one or two screen distances. If
-\fIpad\fR has two elements, the left side of the legend entry is
-padded by the first distance and the right side by the second. If
-\fIpad\fR is just one distance, both the left and right sides are padded
-evenly. The default is \f(CW2\fR.
-.TP
-\fB\-ipady \fIpad\fR
-Sets an amount of internal padding to be added to the height of each
-legend entry. \fIPad\fR can be a list of one or two screen distances. If
-\fIpad\fR has two elements, the top of the entry is padded by the
-first distance and the bottom by the second. If \fIpad\fR is just
-one distance, both the top and bottom of the entry are padded evenly.
-The default is \f(CW2\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets the padding to the left and right exteriors of the legend.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the legend is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default is \f(CW4\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets the padding above and below the legend. \fIPad\fR can be a list
-of one or two screen distances. If \fIpad\fR has two elements, the area above
-the legend is padded by the first distance and the area below by the
-second. If \fIpad\fR is just one distance, both the top and
-bottom areas are padded evenly. The default is \f(CW0\fR.
-.TP
-\fB\-position \fIpos\fR
-Specifies where the legend is drawn. The
-\fB\-anchor\fR option also affects where the legend is positioned. If
-\fIpos\fR is \f(CWleft\fR, \f(CWleft\fR, \f(CWtop\fR, or \f(CWbottom\fR, the
-legend is drawn in the specified margin. If \fIpos\fR is
-\f(CWplotarea\fR, then the legend is drawn inside the plotting area at a
-particular anchor. If \fIpos\fR is in the form "\fI at x,y\fR", where
-\fIx\fR and \fIy\fR are the window coordinates, the legend is drawn in
-the plotting area at the specified coordinates. The default is
-\f(CWright\fR.
-.TP
-\fB\-raised \fIboolean\fR
-Indicates whether the legend is above or below the data elements. This
-matters only if the legend is in the plotting area. If \fIboolean\fR
-is true, the legend will be drawn on top of any elements that may
-overlap it. The default is \f(CWno\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for the border around the legend.
-\fIRelief\fR specifies how the interior of the legend should appear
-relative to the strip chart; for example, \f(CWraised\fR means the legend
-should appear to protrude from the strip chart, relative to the surface of
-the strip chart. The default is \f(CWsunken\fR.
-.PP
-Legend configuration options may also be set by the \fBoption\fR
-command. The resource name and class are \f(CWlegend\fR and
-\f(CWLegend\fR respectively.
-.CS
-option add *Stripchart.legend.Foreground blue
-option add *Stripchart.Legend.Relief raised
-.CE
-.RE
-.TP
-\fIpathName \fBlegend deactivate \fIpattern\fR...
-Selects legend entries to be drawn using the normal legend colors and
-relief. All entries whose element names match \fIpattern\fR are
-selected. To be selected, the element name must match only one
-\fIpattern\fR.
-.TP
-\fIpathName \fBlegend get \fIpos\fR
-Returns the name of the element whose entry is at the screen position
-\fIpos\fR in the legend. \fIPos\fR must be in the form "\fI at x,y\fR",
-where \fIx\fR and \fIy\fR are window coordinates. If the given
-coordinates do not lie over a legend entry, \f(CW""\fR is returned.
-.SS "PEN COMPONENTS"
-Pens define attributes (both symbol and line style) for elements.
-Pens mirror the configuration options of data elements that pertain to
-how symbols and lines are drawn. Data elements use pens to determine
-how they are drawn. A data element may use several pens at once. In
-this case, the pen used for a particular data point is determined from
-each element's weight vector (see the element's \fB\-weight\fR and
-\fB\-style\fR options).
-.PP
-One pen, called \f(CWactiveLine\fR, is automatically created.
-It's used as the default active pen for elements. So you can change
-the active attributes for all elements by simply reconfiguring this
-pen.
-.CS
-\&.s pen configure "activeLine" -color green
-.CE
-You can create and use any number of pens. To create a pen, invoke
-the pen component and its create operation.
-.CS
-\&.s pen create myPen
-.CE
-You map pens to a data element using either the element's
-\fB\-pen\fR or \fB\-activepen\fR options.
-.CS
-\&.s element create "line1" -xdata $x -ydata $tempData \\
- -pen myPen
-.CE
-An element can use several pens at once. This is done by specifying
-the name of the pen in the element's style list (see the
-\fB\-styles\fR option).
-.CS
-\&.s element configure "line1" -styles { myPen 2.0 3.0 }
-.CE
-This says that any data point with a weight between 2.0 and 3.0
-is to be drawn using the pen \f(CWmyPen\fR. All other points
-are drawn with the element's default attributes.
-.PP
-The following operations are available for pen components.
-.PP
-.TP
-\fIpathName \fBpen \fBcget \fIpenName \fIoption\fR
-Returns the current value of the option given by \fIoption\fR for
-\fIpenName\fR. \fIOption\fR may be any option described below
-for the pen \fBconfigure\fR operation.
-.TP
-\fIpathName \fBpen \fBconfigure \fIpenName \fR?\fIoption value\fR?...
-Queries or modifies the configuration options of \fIpenName\fR. If
-\fIoption\fR isn't specified, a list describing the current
-options for \fIpenName\fR is returned. If \fIoption\fR is specified, but
-not \fIvalue\fR, then a list describing \fIoption\fR is
-returned. If one or more \fIoption\fR and \fIvalue\fR pairs are
-specified, then for each pair, the pen option \fIoption\fR is set to
-\fIvalue\fR.
-The following options are valid for pens.
-.RS
-.TP
-\fB\-color \fIcolor\fR
-Sets the color of the traces connecting the data points.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of element line. \fIDashList\fR is a list of up to
-11 numbers that alternately represent the lengths of the dashes and
-gaps on the element line. Each number must be between 1 and 255. If
-\fIdashList\fR is \f(CW""\fR, the lines will be solid.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the interior color of symbols. If \fIcolor\fR is \f(CW""\fR, then
-the interior of the symbol is transparent. If \fIcolor\fR is
-\f(CWdefcolor\fR, then the color will be the same as the \fB\-color\fR
-option. The default is \f(CWdefcolor\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the connecting lines between data points. If
-\fIpixels\fR is \f(CW0\fR, no connecting lines will be drawn between
-symbols. The default is \f(CW0\fR.
-.TP
-\fB\-offdash \fIcolor\fR
-Sets the color of the stripes when traces are dashed (see the
-\fB\-dashes\fR option). If \fIcolor\fR is \f(CW""\fR, then the "off"
-pixels will represent gaps instead of stripes. If \fIcolor\fR is
-\f(CWdefcolor\fR, then the color will be the same as the \fB\-color\fR
-option. The default is \f(CWdefcolor\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the color or the outline around each symbol. If \fIcolor\fR is
-\f(CW""\fR, then no outline is drawn. If \fIcolor\fR is \f(CWdefcolor\fR,
-then the color will be the same as the \fB\-color\fR option. The
-default is \f(CWdefcolor\fR.
-.TP
-\fB\-outlinewidth \fIpixels\fR
-Sets the width of the outline bordering each symbol. If \fIpixels\fR
-is \f(CW0\fR, no outline will be drawn. The default is \f(CW1\fR.
-.TP
-\fB\-pixels \fIpixels\fR
-Sets the size of symbols. If \fIpixels\fR is \f(CW0\fR, no symbols will
-be drawn. The default is \f(CW0.125i\fR.
-.TP
-\fB\-symbol \fIsymbol\fR
-Specifies the symbol for data points. \fISymbol\fR can be either
-\f(CWsquare\fR, \f(CWcircle\fR, \f(CWdiamond\fR, \f(CWplus\fR, \f(CWcross\fR,
-\f(CWsplus\fR, \f(CWscross\fR, \f(CWtriangle\fR, \f(CW""\fR (where no symbol
-is drawn), or a bitmap. Bitmaps are specified as "\fIsource\fR
-?\fImask\fR?", where \fIsource\fR is the name of the bitmap, and
-\fImask\fR is the bitmap's optional mask. The default is
-\f(CWcircle\fR.
-.TP
-\fB\-type \fIelemType\fR
-Specifies the type of element the pen is to be used with.
-This option should only be employed when creating the pen. This
-is for those that wish to mix different types of elements (bars and
-lines) on the same graph. The default type is "line".
-.PP
-Pen configuration options may be also be set by the \fBoption\fR
-command. The resource class is \f(CWPen\fR. The resource names
-are the names of the pens.
-.CS
-option add *Stripchart.Pen.Color blue
-option add *Stripchart.activeLine.color green
-.CE
-.RE
-.TP
-\fIpathName \fBpen \fBcreate \fIpenName \fR?\fIoption value\fR?...
-Creates a new pen by the name \fIpenName\fR. No pen by the same
-name can already exist. \fIOption\fR and \fIvalue\fR are described
-in above in the pen \fBconfigure\fR operation.
-.TP
-\fIpathName \fBpen \fBdelete \fR?\fIpenName\fR?...
-Deletes the named pens. A pen is not really
-deleted until it is not longer in use, so it's safe to delete
-pens mapped to elements.
-.TP
-\fIpathName \fBpen names \fR?\fIpattern\fR?...
-Returns a list of pens matching zero or more patterns. If no
-\fIpattern\fR argument is give, the names of all pens are returned.
-.SS "POSTSCRIPT COMPONENT"
-The strip chart can generate encapsulated PostScript output. There
-are several configuration options you can specify to control how the
-plot is generated. You can change the page dimensions and
-borders. The plot itself can be scaled, centered, or rotated to
-landscape. The PostScript output can be written directly to a file or
-returned through the interpreter.
-.PP
-The following postscript operations are available.
-.TP
-\fIpathName \fBpostscript cget \fIoption\fR
-Returns the current value of the postscript option given by
-\fIoption\fR. \fIOption\fR may be any option described
-below for the postscript \fBconfigure\fR operation.
-.TP
-\fIpathName \fBpostscript configure \fR?\fIoption value\fR?...
-Queries or modifies the configuration options for PostScript
-generation. If \fIoption\fR isn't specified, a list describing
-the current postscript options for \fIpathName\fR is returned. If
-\fIoption\fR is specified, but not \fIvalue\fR, then a list describing
-\fIoption\fR is returned. If one or more \fIoption\fR and \fIvalue\fR
-pairs are specified, then for each pair, the postscript option
-\fIoption\fR is set to \fIvalue\fR. The following postscript options
-are available.
-.RS
-.TP
-\fB\-center \fIboolean\fR
-Indicates whether the plot should be centered on the PostScript page. If
-\fIboolean\fR is false, the plot will be placed in the upper left
-corner of the page. The default is \f(CW1\fR.
-.TP
-\fB\-colormap \fIvarName\fR
-\fIVarName\fR must be the name of a global array variable that
-specifies a color mapping from the X color name to PostScript. Each
-element of \fIvarName\fR must consist of PostScript code to set a
-particular color value (e.g. ``\f(CW1.0 1.0 0.0 setrgbcolor\fR''). When
-outputting color information in PostScript, the array variable \fIvarName\fR
-is checked to see if an element of the name of the color exists. If so,
-it uses the value of the element as the PostScript
-command to set the color. If this option hasn't been specified, or if
-there isn't an entry in \fIvarName\fR for a given color, then it uses
-the red, green, and blue intensities from the X color.
-.TP
-\fB\-colormode \fImode\fR
-Specifies how to output color information. \fIMode\fR must be either
-\f(CWcolor\fR (for full color output), \f(CWgray\fR (convert all colors to
-their gray-scale equivalents) or \f(CWmono\fR (convert foreground colors
-to black and background colors to white). The default mode is
-\f(CWcolor\fR.
-.TP
-\fB\-fontmap \fIvarName\fR
-\fIVarName\fR must be the name of a global array variable that
-specifies a font mapping from the X font name to PostScript. Each
-element of \fIvarName\fR must consist of a Tcl list with one or two
-elements, which are the name and point size of a PostScript font.
-When outputting PostScript commands for a particular font, the
-array variable \fIvarName\fR is checked to see an element of the specified
-font exists. If there is such an element, then the font
-information contained in that element is used in the PostScript
-output. (If the point size is omitted from the list, the point size
-of the X font is used). Otherwise the X font is examined in an
-attempt to guess what PostScript font to use. This works only for
-fonts whose foundry property is \fIAdobe\fR (such as Times, Helvetica,
-Courier, etc.). If all of this fails then the font defaults to
-\f(CWHelvetica-Bold\fR.
-.TP
-\fB\-decorations \fIboolean\fR
-Indicates if PostScript commands to generate color backgrounds and 3-D
-borders should be output. If \fIboolean\fR is false, the background will
-be white and no 3-D borders will be generated. The
-default is \f(CW1\fR.
-.TP
-\fB\-height \fIpixels\fR
-Sets the height of the plot. This lets you plot the stripchart with a
-height different from the one displayed on the screen. If
-\fIpixels\fR is 0, the height is the same as the displayed height.
-The default is \f(CW0\fR.
-.TP
-\fB\-landscape \fIboolean\fR
-If \fIboolean\fR is true, this specifies the printed area is to be
-rotated 90 degrees. In non-rotated output the X-axis of the printed
-area runs along the short dimension of the page (``portrait''
-orientation); in rotated output the X-axis runs along the long
-dimension of the page (``landscape'' orientation). Defaults to
-\f(CW0\fR.
-.TP
-\fB\-maxpect \fIboolean\fR
-Indicates to scale the the plot so that it fills the PostScript page.
-The aspect ratio of the strip chart is still retained. The default is
-\f(CW0\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets the horizontal padding for the left and right page borders. The
-borders are exterior to the plot. \fIPad\fR can be a list of one or
-two screen distances. If \fIpad\fR has two elements, the left border is padded
-by the first distance and the right border by the second. If
-\fIpad\fR has just one distance, both the left and right borders are
-padded evenly. The default is \f(CW1i\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets the vertical padding for the top and bottom page borders. The
-borders are exterior to the plot. \fIPad\fR can be a list of one or
-two screen distances. If \fIpad\fR has two elements, the top border is padded
-by the first distance and the bottom border by the second. If
-\fIpad\fR has just one distance, both the top and bottom borders are
-padded evenly. The default is \f(CW1i\fR.
-.TP
-\fB\-paperheight \fIpixels\fR
-Sets the height of the postscript page. This can be used to select
-between different page sizes (letter, A4, etc). The default height is
-\f(CW11.0i\fR.
-.TP
-\fB\-paperwidth \fIpixels\fR
-Sets the width of the postscript page. This can be used to select
-between different page sizes (letter, A4, etc). The default width is
-\f(CW8.5i\fR.
-.TP
-\fB\-width \fIpixels\fR
-Sets the width of the plot. This lets you plot the strip chart with a
-width different from the one drawn on the screen. If \fIpixels\fR
-is 0, the width is the same as the widget's width. The default is
-\f(CW0\fR.
-.PP
-Postscript configuration options may be also be set by the
-\fBoption\fR command. The resource name and class are
-\f(CWpostscript\fR and \f(CWPostscript\fR respectively.
-.CS
-option add *Stripchart.postscript.Decorations false
-option add *Stripchart.Postscript.Landscape true
-.CE
-.RE
-.TP
-\fIpathName \fBpostscript output \fR?\fIfileName\fR? ?\fIoption value\fR?...
-Outputs a file of encapsulated PostScript. If a
-\fIfileName\fR argument isn't present, the command returns the
-PostScript. If any \fIoption-value\fR pairs are present, they set
-configuration options controlling how the PostScript is generated.
-\fIOption\fR and \fIvalue\fR can be anything accepted by the
-postscript \fBconfigure\fR operation above.
-.SS "MARKER COMPONENTS"
-Markers are simple drawing procedures used to annotate or highlight
-areas of the strip chart. Markers have various types: text strings,
-bitmaps, images, connected lines, windows, or polygons. They can be
-associated with a particular element, so that when the element is
-hidden or un-hidden, so is the marker. By default, markers are the
-last items drawn, so that data elements will appear in
-behind them. You can change this by configuring the \fB\-under\fR
-option.
-.PP
-Markers, in contrast to elements, don't affect the scaling of the
-coordinate axes. They can also have \fIelastic\fR coordinates
-(specified by \f(CW-Inf\fR and \f(CWInf\fR respectively) that translate
-into the minimum or maximum limit of the axis. For example, you can
-place a marker so it always remains in the lower left corner of the
-plotting area, by using the coordinates \f(CW-Inf\fR,\f(CW-Inf\fR.
-.PP
-The following operations are available for markers.
-.TP
-\fIpathName \fBmarker after \fImarkerId\fR ?\fIafterId\fR?
-Changes the order of the markers, drawing the first
-marker after the second. If no second \fIafterId\fR argument is
-specified, the marker is placed at the end of the display list. This
-command can be used to control how markers are displayed since markers
-are drawn in the order of this display list.
-.TP
-\fIpathName \fBmarker before \fImarkerId\fR ?\fIbeforeId\fR?
-Changes the order of the markers, drawing the first
-marker before the second. If no second \fIbeforeId\fR argument is
-specified, the marker is placed at the beginning of the display list.
-This command can be used to control how markers are displayed since
-markers are drawn in the order of this display list.
-.TP
-\fIpathName \fBmarker cget \fIoption\fR
-Returns the current value of the marker configuration option given by
-\fIoption\fR. \fIOption\fR may be any option described
-below in the \fBconfigure\fR operation.
-.TP
-\fIpathName \fBmarker configure \fImarkerId\fR ?\fIoption value\fR?...
-Queries or modifies the configuration options for markers. If
-\fIoption\fR isn't specified, a list describing the current
-options for \fImarkerId\fR is returned. If \fIoption\fR is specified,
-but not \fIvalue\fR, then a list describing \fIoption\fR is returned.
-If one or more \fIoption\fR and \fIvalue\fR pairs are specified, then
-for each pair, the marker option \fIoption\fR is set to \fIvalue\fR.
-.sp
-The following options are valid for all markers.
-Each type of marker also has its own type-specific options.
-They are described in the sections below.
-.RS
-.TP
-\fB\-coords \fIcoordList\fR
-Specifies the coordinates of the marker. \fICoordList\fR is
-a list of graph coordinates. The number of coordinates required
-is dependent on the type of marker. Text, image, and window markers
-need only two coordinates (an X\-Y coordinate). Bitmap markers
-can take either two or four coordinates (if four, they represent the
-corners of the bitmap). Line markers
-need at least four coordinates, polygons at least six.
-If \fIcoordList\fR is \f(CW""\fR, the marker will not be displayed.
-The default is \f(CW""\fR.
-.TP
-\fB\-element \fIelemName\fR
-Links the marker with the element \fIelemName\fR. The marker is
-drawn only if the element is also currently displayed (see the
-element's \fBshow\fR operation). If \fIelemName\fR is \f(CW""\fR, the
-marker is always drawn. The default is \f(CW""\fR.
-.TP
-\fB\-hide \fIboolean\fR
-Indicates whether the marker is drawn. If \fIboolean\fR is true,
-the marker is not drawn. The default is \f(CWno\fR.
-.TP
-\fB\-mapx \fIxAxis\fR
-Specifies the X\-axis to map the marker's X\-coordinates onto.
-\fIXAxis\fR must the name of an axis. The default is \f(CWx\fR.
-.TP
-\fB\-mapy \fIyAxis\fR
-Specifies the Y\-axis to map the marker's Y\-coordinates onto.
-\fIYAxis\fR must the name of an axis. The default is \f(CWy\fR.
-.TP
-\fB\-name \fImarkerId\fR
-Changes the identifier for the marker. The identifier \fImarkerId\fR
-can not already be used by another marker. If this option
-isn't specified, the marker's name is uniquely generated.
-.TP
-\fB\-under \fIboolean\fR
-Indicates whether the marker is drawn below/above data
-elements. If \fIboolean\fR is true, the marker is be drawn
-underneath the data element symbols and lines. Otherwise, the marker is
-drawn on top of the element. The default is \f(CW0\fR.
-.TP
-\fB\-xoffset \fIpixels\fR
-Specifies a screen distance to offset the marker horizontally.
-\fIPixels\fR is a valid screen distance, such as \f(CW2\fR or \f(CW1.2i\fR.
-The default is \f(CW0\fR.
-.TP
-\fB\-yoffset \fIpixels\fR
-Specifies a screen distance to offset the markers vertically.
-\fIPixels\fR is a valid screen distance, such as \f(CW2\fR or \f(CW1.2i\fR.
-The default is \f(CW0\fR.
-.PP
-Marker configuration options may also be set by the \fBoption\fR command.
-The resource class is either \f(CWBitmapMarker\fR, \f(CWImageMarker\fR,
-\f(CWLineMarker\fR, \f(CWPolygonMarker\fR, \f(CWTextMarker\fR, or \f(CWWindowMarker\fR,
-depending on the type of marker. The resource name is the name of the
-marker.
-.CS
-option add *Stripchart.TextMarker.Foreground white
-option add *Stripchart.BitmapMarker.Foreground white
-option add *Stripchart.m1.Background blue
-.CE
-.RE
-.TP
-\fIpathName \fBmarker create \fItype\fR ?\fIoption value\fR?...
-Creates a marker of the selected type. \fIType\fR may be either
-\f(CWtext\fR, \f(CWline\fR, \f(CWbitmap\fR, \f(CWimage\fR, \f(CWpolygon\fR, or
-\f(CWwindow\fR. This command returns the marker identifier,
-used as the \fImarkerId\fR argument in the other marker-related
-commands. If the \fB\-name\fR option is used, this overrides the
-normal marker identifier. If the name provided is already used for
-another marker, the new marker will replace the old.
-.TP
-\fIpathName \fBmarker delete\fR ?\fIname\fR?...
-Removes one of more markers. The graph will automatically be redrawn
-without the marker.\fR.
-.TP
-\fIpathName \fBmarker exists \fImarkerId\fR
-Returns \f(CW1\fR if the marker \fImarkerId\fR exists and \f(CW0\fR
-otherwise.
-.TP
-\fIpathName \fBmarker names\fR ?\fIpattern\fR?
-Returns the names of all the markers that currently exist. If
-\fIpattern\fR is supplied, only those markers whose names match it
-will be returned.
-.TP
-\fIpathName \fBmarker type \fImarkerId\fR
-Returns the type of the marker given by \fImarkerId\fR, such as
-\f(CWline\fR or \f(CWtext\fR. If \fImarkerId\fR is not a valid a marker
-identifier, \f(CW""\fR is returned.
-.SS "BITMAP MARKERS"
-A bitmap marker displays a bitmap. The size of the
-bitmap is controlled by the number of coordinates specified. If two
-coordinates, they specify the position of the top-left corner of the
-bitmap. The bitmap retains its normal width and height. If four
-coordinates, the first and second pairs of coordinates represent the
-corners of the bitmap. The bitmap will be stretched or reduced as
-necessary to fit into the bounding rectangle.
-.PP
-Bitmap markers are created with the marker's \fBcreate\fR operation in
-the form:
-.DS
-\fIpathName \fBmarker create bitmap \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR pairs, each
-sets a configuration options for the marker. These
-same \fIoption\fR\-\fIvalue\fR pairs may be used with the marker's
-\fBconfigure\fR operation.
-.PP
-The following options are specific to bitmap markers:
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the bitmap. If \fIcolor\fR is \f(CW""\fR,
-the background color will be transparent. The default background
-color is \f(CWwhite\fR.
-.TP
-\fB\-bitmap \fIbitmap\fR
-Specifies the bitmap to be displayed. If \fIbitmap\fR is \f(CW""\fR,
-the marker will not be displayed. The default is \f(CW""\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the foreground color of the bitmap. The default foreground color
-is \f(CWblack\fR.
-.TP
-\fB\-mask \fImask\fR
-Specifies a mask for the bitmap to be displayed. This mask is a bitmap
-itself, denoting the pixels that are transparent. If \fImask\fR is
-\f(CW""\fR, all pixels of the bitmap will be drawn. The default is
-\f(CW""\fR.
-.TP
-\fB\-rotate \fItheta\fR
-Sets the rotation of the bitmap. \fITheta\fR is a real number
-representing the angle of rotation in degrees. The marker is first
-rotated and then placed according to its anchor position. The default
-rotation is \f(CW0.0\fR.
-.SS "IMAGE MARKERS"
-A image marker displays an image. Image markers are
-created with the marker's \fBcreate\fR operation in the form:
-.DS
-\fIpathName \fBmarker create image \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR
-pairs, each sets a configuration option
-for the marker. These same \fIoption\fR\-\fIvalue\fR pairs may be
-used with the marker's \fBconfigure\fR operation.
-.PP
-The following options are specific to image markers:
-.TP
-\fB\-anchor \fIanchor\fR
-\fIAnchor\fR tells how to position the image relative to the
-positioning point for the image. For example, if \fIanchor\fR
-is \f(CWcenter\fR then the image is centered on the point; if
-\fIanchor\fR is \f(CWn\fR then the image will be drawn such that
-the top center point of the rectangular region occupied by the
-image will be at the positioning point.
-This option defaults to \f(CWcenter\fR.
-.TP
-\fB\-image \fIimage\fR
-Specifies the image to be drawn.
-If \fIimage\fR is \f(CW""\fR, the marker will not be
-drawn. The default is \f(CW""\fR.
-.SS "LINE MARKERS"
-A line marker displays one or more connected line segments.
-Line markers are created with marker's \fBcreate\fR operation in the form:
-.DS
-\fIpathName \fBmarker create line \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR
-pairs, each sets a configuration option
-for the marker. These same \fIoption\fR-\fIvalue\fR pairs may be
-used with the marker's \fBconfigure\fR operation.
-.PP
-The following options are specific to line markers:
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the line.
-The option is affects the line color only when the \fB\-stipple\fR option
-is set.
-If this option isn't specified then it defaults to \f(CWwhite\fR.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the line. \fIDashList\fR is a list of up to 11
-numbers that alternately represent the lengths of the dashes and gaps
-on the line. Each number must be between 1 and 255. If
-\fIdashList\fR is \f(CW""\fR, the marker line will be solid.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the foreground color. The default foreground color is \f(CWblack\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the lines.
-The default width is \f(CW0\fR.
-.TP
-\fB\-stipple \fIbitmap\fR
-Specifies a stipple pattern used to draw the line, rather than
-a solid line.
-\fIBitmap\fR specifies a bitmap to use as the stipple
-pattern. If \fIbitmap\fR is \f(CW""\fR, then the
-line is drawn in a solid fashion. The default is \f(CW""\fR.
-.SS "POLYGON MARKERS"
-A polygon marker displays a closed region described as two or more
-connected line segments. It is assumed the first and
-last points are connected. Polygon markers are created using the
-marker \fBcreate\fR operation in the form:
-.DS
-\fIpathName \fBmarker create polygon \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR
-pairs, each sets a configuration option
-for the marker. These same \fIoption\fR\-\fIvalue\fR pairs may be
-used with the \fBmarker configure\fR command to change the marker's
-configuration.
-The following options are supported for polygon markers:
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the outline of the polygon. \fIDashList\fR is a
-list of up to 11 numbers that alternately represent the lengths of
-the dashes and gaps on the outline. Each number must be between 1 and
-255. If \fIdashList\fR is \f(CW""\fR, the outline will be a solid line.
-.TP
-\fB\-fill \fIcolor\fR
-Sets the fill color of the polygon. If \fIcolor\fR is \f(CW""\fR, then
-the interior of the polygon is transparent.
-The default is \f(CWwhite\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Sets the width of the outline of the polygon. If \fIpixels\fR is zero,
-no outline is drawn. The default is \f(CW0\fR.
-.TP
-\fB\-outline \fIcolor\fR
-Sets the color of the outline of the polygon. If the polygon is
-stippled (see the \fB\-stipple\fR option), then this represents the
-foreground color of the stipple. The default is \f(CWblack\fR.
-.TP
-\fB\-stipple \fIbitmap\fR
-Specifies that the polygon should be drawn with a stippled pattern
-rather than a solid color. \fIBitmap\fR specifies a bitmap to use as
-the stipple pattern. If \fIbitmap\fR is \f(CW""\fR, then the polygon is
-filled with a solid color (if the \fB\-fill\fR option is set). The
-default is \f(CW""\fR.
-.SS "TEXT MARKERS"
-A text marker displays a string of characters on one or more lines of
-text. Embedded newlines cause line breaks. They may be used to
-annotate regions of the strip chart. Text markers are created with the
-\fBcreate\fR operation in the form:
-.DS
-\fIpathName \fBmarker create text \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR pairs,
-each sets a configuration option for the text marker.
-These same \fIoption\fR\-\fIvalue\fR pairs may be used with the
-marker's \fBconfigure\fR operation.
-.PP
-The following options are specific to text markers:
-.TP
-\fB\-anchor \fIanchor\fR
-\fIAnchor\fR tells how to position the text relative to the
-positioning point for the text. For example, if \fIanchor\fR is
-\f(CWcenter\fR then the text is centered on the point; if
-\fIanchor\fR is \f(CWn\fR then the text will be drawn such that the
-top center point of the rectangular region occupied by the text will
-be at the positioning point. This default is \f(CWcenter\fR.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the text string. If \fIcolor\fR is
-\f(CW""\fR, the background will be transparent. The default is
-\f(CWwhite\fR.
-.TP
-\fB\-font \fIfontName\fR
-Specifies the font of the text. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-120-*\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the foreground color of the text. The default is \f(CWblack\fR.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the text should be justified. This matters only when
-the marker contains more than one line of text. \fIJustify\fR must be
-\f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR. The default is
-\f(CWcenter\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets the padding to the left and right exteriors of the text.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the text is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default is \f(CW4\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets the padding above and below the text. \fIPad\fR can be a list of
-one or two screen distances. If \fIpad\fR has two elements, the area above the
-text is padded by the first distance and the area below by the second.
-If \fIpad\fR is just one distance, both the top and bottom areas
-are padded evenly. The default is \f(CW4\fR.
-.TP
-\fB\-rotate \fItheta\fR
-Specifies the number of degrees to rotate the text. \fITheta\fR is a
-real number representing the angle of rotation. The marker is first
-rotated along its center and is then drawn according to its anchor
-position. The default is \f(CW0.0\fR.
-.TP
-\fB\-text \fItext\fR
-Specifies the text of the marker. The exact way the text is
-displayed may be affected by other options such as \fB\-anchor\fR or
-\fB\-rotate\fR.
-.SS "WINDOW MARKERS"
-A window marker displays a widget at a given position.
-Window markers are created with the marker's \fBcreate\fR operation in
-the form:
-.DS
-\fIpathName \fBmarker create window \fR?\fIoption value\fR?...
-.DE
-There may be many \fIoption\fR-\fIvalue\fR
-pairs, each sets a configuration option
-for the marker. These same \fIoption\fR\-\fIvalue\fR pairs may be
-used with the marker's \fBconfigure\fR command.
-.PP
-The following options are specific to window markers:
-.TP
-\fB\-anchor \fIanchor\fR
-\fIAnchor\fR tells how to position the widget relative to the
-positioning point for the widget. For example, if \fIanchor\fR is
-\f(CWcenter\fR then the widget is centered on the point; if \fIanchor\fR
-is \f(CWn\fR then the widget will be displayed such that the top center
-point of the rectangular region occupied by the widget will be at the
-positioning point. This option defaults to \f(CWcenter\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the height to assign to the marker's window. If this option
-isn't specified, or if it is specified as \f(CW""\fR, then the window is
-given whatever height the widget requests internally.
-.TP
-\fB\-width \fIpixels\fR
-Specifies the width to assign to the marker's window. If this option
-isn't specified, or if it is specified as \f(CW""\fR, then the window is
-given whatever width the widget requests internally.
-.TP
-\fB\-window \fIpathName\fR
-Specifies the widget to be managed. \fIPathName\fR must
-be a child of the \fBstripchart\fR widget.
-.SH "GRAPH COMPONENT BINDINGS"
-Specific stripchart components, such as elements, markers and legend
-entries, can have a command trigger when event occurs in them, much
-like canvas items in Tk's canvas widget. Not all event sequences are
-valid. The only binding events that may be specified are those
-related to the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR,
-\fBButtonPress\fR, \fBMotion\fR, and \fBKeyPress\fR).
-.sp
-Only one element or marker can be picked during an event. This means,
-that if the mouse is directly over both an element and a marker, only
-the uppermost component is selected. This isn't true for legend entries.
-Both a legend entry and an element (or marker) binding commands
-will be invoked if both items are picked.
-.sp
-It is possible for multiple bindings to match a particular event.
-This could occur, for example, if one binding is associated with the
-element name and another is associated with one of the element's tags
-(see the \fB\-bindtags\fR option). When this occurs, all of the
-matching bindings are invoked. A binding associated with the element
-name is invoked first, followed by one binding for each of the element's
-bindtags. If there are multiple matching bindings for a single tag,
-then only the most specific binding is invoked. A continue command
-in a binding script terminates that script, and a break command
-terminates that script and skips any remaining scripts for the event,
-just as for the bind command.
-.sp
-The \fB\-bindtags\R option for these components controls addition
-tag names which can be matched. Implicitly elements and markers
-always have tags matching their names. Setting the value of
-the \fB\-bindtags\fR option doesn't change this.
-.SH "C LANGUAGE API"
-You can manipulate data elements from the C language. There
-may be situations where it is too expensive to translate the data
-values from ASCII strings. Or you might want to read data in a
-special file format.
-.PP
-Data can manipulated from the C language using BLT vectors.
-You specify the x and y data coordinates of an element as vectors and
-manipulate the vector from C. The strip chart will be redrawn automatically
-after the vectors are updated.
-.PP
-From Tcl, create the vectors and configure the element to use them.
-.CS
-vector X Y
-\&.s element configure line1 -xdata X -ydata Y
-.CE
-To set data points from C, you pass the values as arrays of doubles
-using the \fBBlt_ResetVector\fR call. The vector is reset with the
-new data and at the next idle point (when Tk re-enters its event
-loop), the strip chart will be redrawn automatically.
-.CS
-#include <tcl.h>
-#include <blt.h>
-
-register int i;
-Blt_Vector *xVec, *yVec;
-double x[50], y[50];
-
-/* Get the BLT vectors "X" and "Y" (created above from Tcl) */
-if ((Blt_GetVector(interp, "X", 50, &xVec) != TCL_OK) ||
- (Blt_GetVector(interp, "Y", 50, &yVec) != TCL_OK)) {
- return TCL_ERROR;
-}
-
-for (i = 0; i < 50; i++) {
- x[i] = i * 0.02;
- y[i] = sin(x[i]);
-}
-
-/* Put the data into BLT vectors */
-if ((Blt_ResetVector(xVec, x, 50, 50, TCL_VOLATILE) != TCL_OK) ||
- (Blt_ResetVector(yVec, y, 50, 50, TCL_VOLATILE) != TCL_OK)) {
- return TCL_ERROR;
-}
-.CE
-See the \fBvector\fR manual page for more details.
-.SH SPEED TIPS
-There may be cases where the strip chart needs to be drawn and updated as
-quickly as possible. If drawing speed becomes a big
-problem, here are a few tips to speed up displays.
-.TP 2
-\(bu
-Try to minimize the number of data points. The more data points
-the looked at, the more work the strip chart must do.
-.TP 2
-\(bu
-If your data is generated as floating point values, the time required
-to convert the data values to and from ASCII strings can be
-significant, especially when there any many data points. You can
-avoid the redundant string-to-decimal conversions using the C API to
-BLT vectors.
-.TP 2
-\(bu
-Data elements without symbols are drawn faster than with symbols.
-Set the data element's \fB\-symbol\fR option to \f(CWnone\fR. If you need to
-draw symbols, try using the simple symbols such as \f(CWsplus\fR and
-\f(CWscross\fR.
-.TP 2
-\(bu
-Don't stipple or dash the element. Solid lines are much faster.
-.TP 2
-\(bu
-If you update data elements frequently, try turning off the
-widget's \fB\-bufferelements\fR option. When the strip chart is first
-displayed, it draws data elements into an internal pixmap. The pixmap
-acts as a cache, so that when the strip chart needs to be redrawn again, and
-the data elements or coordinate axes haven't changed, the pixmap is
-simply copied to the screen. This is especially useful when you are
-using markers to highlight points and regions on the strip chart. But if
-the strip chart is updated frequently, changing either the element data or
-coordinate axes, the buffering becomes redundant.
-.SH LIMITATIONS
-Auto-scale routines do not use requested min/max limits as boundaries
-when the axis is logarithmically scaled.
-.PP
-The PostScript output generated for polygons with more than 1500
-points may exceed the limits of some printers (See PostScript Language
-Reference Manual, page 568). The work-around is to break the polygon
-into separate pieces.
-.SH "FUTURE INCOMPATIBILITY"
-The \fB\-mapped\fR options are obsoleted and will be removed. You can
-achieve the same results using the \fB\-hide\fR option instead.
-.CS
-# Works for now.
-\&.s legend configure -mapped no
-
-# Instead use this.
-\&.s legend configure -hide yes
-.CE
-.SH KEYWORDS
-stripchart, graph, widget
diff --git a/blt3.0.1/man/table.mann b/blt3.0.1/man/table.mann
deleted file mode 100644
index 76372f1..0000000
--- a/blt3.0.1/man/table.mann
+++ /dev/null
@@ -1,757 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" The table geometry manager created by George Howlett.
-'\"
-.so man.macros
-.TH table n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-table \- Arranges widgets in a table
-.SH SYNOPSIS
-\fBtable \fIcontainer\fR ?\fIwidget index option value\fR?...
-.sp
-\fBtable arrange\fR \fIcontainer\fR
-.sp
-\fBtable cget \fIcontainer\fR ?\fIitem\fR? \fIoption\fR
-.sp
-\fBtable configure \fIcontainer\fR ?\fIitem\fR?... ?\fIoption value\fR?...
-.sp
-\fBtable extents \fIcontainer\fR \fIitem\fR
-.sp
-\fBtable forget \fIwidget\fR ?\fIwidget\fR?...
-.sp
-\fBtable info \fIcontainer\fR \fIitem\fR
-.sp
-\fBtable locate \fIcontainer\fR \fIx y\fR
-.sp
-\fBtable containers \fR?\fIswitch\fR? ?\fIarg\fR?
-.sp
-\fBtable save \fIcontainer\fR
-.sp
-\fBtable search \fIcontainer\fR ?\fIswitch arg\fR?...
-.BE
-.SH DESCRIPTION
-The \fBtable\fR command arranges widgets in a table. The alignment of
-widgets is detemined by their row and column positions and the number
-of rows or columns that they span.
-.SH INTRODUCTION
-Probably the most painstaking aspect of building a graphical
-application is getting the placement and size of the widgets just right.
-It usually takes many iterations to align widgets and adjust their spacing.
-That's because managing the geometry of widgets is simply not a
-packing problem, but also graphical design problem. Attributes
-such as alignment, symmetry, and balance are more important than
-minimizing the amount of space used for packing.
-.PP
-The \fBtable\fR geometry manager arranges widgets in a table. It's
-easy to align widgets (horizontally and vertically) or to create empty
-space to balance the arrangement of the widgets. Widgets (called
-\fIslaves\fR in the Tk parlance) are arranged inside a containing
-widget (called the \fImaster\fR). Widgets are positioned at
-row,column locations and may span any number of rows or columns. More
-than one widget can occupy a single location.
-.PP
-The placement of widget windows determines both the size and
-arrangement of the table. The table queries the requested size of
-each widget. The \fIrequested size\fR of a widget is the natural size
-of the widget (before the widget is shrunk or expanded). The height
-of each row and the width of each column is the largest widget spanning
-that row or column. The size of the table is in turn the sum of the
-row and column sizes. This is the table's \fInormal size\fR.
-.PP
-The total number of rows and columns in a table is determined from the
-indices specified. The table grows dynamically as windows are added
-at larger indices.
-.SH EXAMPLE
-The table geometry manager is created by invoking the \fBtable\fR command.
-.CS
-# Create a table in the root window
-table .
-.CE
-The window \f(CW.\fR is now the \fIcontainer\fR of the table. Widgets
-are packed into the table and displayed within the confines of the
-container.
-.PP
-You add widgets to the table by row and column location. Row and
-column indices start from zero.
-.CS
-label .title -text "This is a title"
-
-# Add a label to the table
-table . .title 0,0
-.CE
-The label \f(CW.title\fR is added to the table. We can add more widgets
-in the same way.
-.CS
-button .ok -text "Ok"
-button .cancel -text "Cancel"
-
-# Add two buttons
-table . .ok 1,0
-table . .cancel 1,1
-.CE
-Two buttons \f(CW.ok\fR and \f(CW.cancel\fR are now packed into the second
-row of the table. They each occupy one cell of the table. By
-default, widgets span only a single row and column.
-.PP
-The first column contains two widgets, \f(CW.title\fR and \f(CW.ok\fR. By
-default, the widest of the two widgets will define the width of the
-column. However, we want \f(CW.title\fR to be centered horizontally
-along the top of the table. We can make \f(CW.title\fR span two columns
-using the \fBconfigure\fR operation.
-.CS
-# Make the label span both columns
-table configure . .title -cspan 2
-.CE
-The label \f(CW.title\fR will now be centered along the top row of the
-table.
-.PP
-In the above example, we've create and arranged the layout for the
-table invoking the \fBtable\fR command several times. Alternately, we
-could have used a single \fBtable\fR command.
-.CS
-label .title -text "This is a title"
-button .ok -text "Ok"
-button .cancel -text "Cancel"
-
-# Create and pack the table
-table . \\
- .title 0,0 -cspan 2 \\
- .ok 1,0 \\
- .cancel 1,1
-.CE
-The table will override the requested width and height of the container
-so that the window fits the table exactly. This also means
-that any change to the size of table will be propagated up through the
-Tk window hierarchy. This feature can be turned off using the
-\fBconfigure\fR operation again.
-.CS
-table configure . -propagate no
-.CE
-You can also set the width of height of the table to a specific
-value. This supersedes the calculated table size.
-.CS
-# Make the container 4 inches wide, 3 inches high
-table configure . -reqwidth 4i -reqheight 3i
-.CE
-If a widget is smaller than the cell(s) it occupies, the widget will
-float within the extra space. By default, the widget will be centered
-within the space, but you can anchor the widget to any side of cell
-using the \fB\-anchor\fR configuration option.
-.CS
-table configure . .ok -anchor w
-.CE
-The \fB\-fill\fR option expands the widget to fill the
-extra space either vertically or horizontally (or both).
-.CS
-# Make the title label fill the entire top row
-table configure . .title -cspan 2 -fill x
-
-# Each button will be as height of the 2nd row.
-table configure . .ok .cancel -fill y
-.CE
-The width of \f(CW.title\fR will be the combined widths of both columns.
-Both \f(CW.ok\fR and \f(CW.cancel\fR will become as tall as the second row.
-.PP
-The \fB\-padx\fR and \fB\-pady\fR options control the amount of padding
-around the widget. Both options take a list of one or two values.
-.CS
-# Pad the title by two pixels above and below.
-table configure . .title -pady 2
-
-# Pad each button 2 pixels on the left, and 4 on the right.
-table configure . .ok .cancel -padx { 2 4 }
-.CE
-If the list has only one value, then both exterior sides (top and bottom
-or left and right) of the widget are padded by that amount. If the
-list has two elements, the first specifies padding for the top or left
-side and the second for the bottom or right side.
-.PP
-Like the container, you can also override the requested widths and
-heights of widgets using the \fB\-reqwidth\fR and
-\fB\-reqheight\fR options. This is especially useful with
-character-based widgets (such as buttons, labels, text, listbox, etc)
-that let you specify their size only in units of characters and lines,
-instead of pixels.
-.CS
-# Make all buttons one inch wide
-table configure . .ok .cancel -reqwidth 1i
-.CE
-.PP
-Each row and column of the table can be configured, again using the
-\fBconfigure\fR operation. Rows are and columns are designated by
-\f(CWR\fIi\fR and \f(CWC\fIi\fR respectively, where \fIi\fR is the index
-of the row or column.
-.PP
-For example, you can set the size of a row or column.
-.CS
-# Make the 1st column 2 inches wide
-table configure . c0 -width 2.0i
-
-# Make the 2nd row 1/2 inch high.
-table configure . r1 -height 0.5i
-.CE
-The new size for the row or column overrides its calculated size. If
-no widgets span the row or column, its height or width is zero.
-So you can use the \fB\-width\fR and \fB\-height\fR options to create
-empty spaces in the table.
-.CS
-# Create an empty row and column
-table configure . r2 c2 -width 1i
-.CE
-The \fB\-pady\fR option lets you add padding to the top and bottom
-sides of rows. The \fB\-padx\fR option adds padding to the left and
-right sides of columns. Both options take a list of one or two
-values.
-.CS
-# Pad above the title by two pixels
-table configure . r0 -pady { 2 0 }
-
-# Pad each column 4 pixels on the left, and 2 on the right.
-table configure . c* -padx { 2 4 }
-.CE
-.PP
-Notice that you can configure all the rows and columns using either
-\f(CWR*\fR or \f(CWC*\fR.
-.PP
-When the container is resized, the rows and columns of the table are
-also resized. Only the rows or columns that contain widgets (a widget
-spans the row or column) grow or shrink. The \fB\-resize\fR option
-indicates whether the row or column can be shrunk or stretched. If
-the value is \f(CWshrink\fR, the row or column can only be resized
-smaller. If \f(CWexpand\fR, it can only be resized larger. If
-\f(CWnone\fR, the row or column is frozen at its requested size.
-.CS
-# Let the 1st column get smaller, but not bigger
-table configure . c0 -resize shrink
-
-# Let the 2nd column get bigger, not smaller
-table configure . c1 -resize expand
-
-# Don't resize the first row
-table configure . r0 -resize none
-.CE
-The following example packs a canvas, two scrollbars, and a title.
-The rows and columns containing the scrollbars are frozen at their
-requested size, so that even if the frame is resized, the scrollbars will
-remain the same width.
-.CS
-table . \\
- .title 0,0 -cspan 3 \\
- .canvas 1,1 -fill both \\
- .vscroll 1,2 -fill y \\
- .hscroll 2,1 -fill x
-
-# Don't let the scrollbars resize
-table configure . c2 r2 -resize none
-
-# Create an empty space to balance the scrollbar
-table configure . c0 -width .vscroll
-.CE
-Note that the value of the \fB\-width\fR option is the name of a widget
-window. This indicates that the width of the column should be the
-same as the requested width of \f(CW.vscroll\fR.
-.PP
-Finally, the \fBforget\fR operation removes widgets from the table.
-.CS
-# Remove the windows from the table
-table forget .quit .frame
-.CE
-It's not necessary to specify the container. The \fBtable\fR
-command determines the container from the widget name.
-.SH OPERATIONS
-The following operations are available for the \fBtable\fR:
-.TP
-\fBtable \fIcontainer\fR ?\fIwidget index option value\fR?...
-Adds the widget \fIwidget\fR to the table at \fIindex\fR. \fIIndex\fR
-is a row,column position in the table. It must be in the form
-\fIrow\fR,\fIcolumn\fR where \fIrow\fR and \fIcolumn\fR are the
-respective row and column numbers, starting from zero (0,0 is the
-upper leftmost position). \fIRow\fR and \fIcolumn\fR may also be
-numeric expressions that are recursively evaluated. If a table
-doesn't exist for \fIcontainer\fR, one is created. \fIWidget\fR is the
-path name of the window, that must already exist, to be arranged
-inside of \fIcontainer\fR. \fIOption\fR and \fIvalue\fR are described
-in the
-.SB WIDGET OPTIONS
-section.
-.TP
-\fBtable arrange\fR \fIcontainer\fR
-Forces the table to compute its layout immediately. Normally, the
-table geometry manager will wait until the next idle point, before
-calculating the size of its rows and columns. This is useful for
-collecting the \fInormal\fR sizes of rows and columns, that are
-based upon the requested widget sizes.
-.TP
-\fBtable cget\fR \fIcontainer \fR?\fIitem\fR?\fI option\fR
-Returns the current value of the configuration option specific to
-\fIitem\fR given by \fIoption\fR. \fIItem\fR is either a row or
-column index, or the path name of a widget. \fIItem\fR can be
-in any form describe in the \fBconfigure\fR operation below. If no
-\fIitem\fR argument is provided, then the configuration option is
-for the table itself. \fIOption\fR may be any one of the options
-described in the appropiate section for \fIitem\fR.
-.TP
-\fBtable configure\fR \fIcontainer item\fR... ?\fIoption value\fR?...
-Queries or modifies the configuration options specific to \fIitem\fR.
-If no \fIoption\fR is specified, this command returns a list
-describing all of the available options for \fIitem\fR
-If the argument \fIitem\fR is omitted, then the specified
-configuration options are for the table itself. Otherwise
-\fIitem\fR must be either a row or column specification, or the path
-name of a widget.
-The following \fIitem\fR types are available.
-.RS
-.TP
-\f(CWC\fIi\fR
-Specifies the column of \fIcontainer\fR to be configured. \fIItem\fR
-must be in the form \f(CWC\fIn\fR, where \fIi\fR is the index of
-the column. See the
-.SB COLUMN OPTIONS
-section.
-.TP
-\f(CWR\fIi\fR
-Specifies the row of \fIcontainer\fR to be configured. \fIItem\fR must be
-in the form \f(CWR\fIi\fR, where \fIi\fR is the index of the row. See
-the
-.SB ROW OPTIONS
-section.
-.TP
-\fIwidget\fR
-Specifies a widget of \fIcontainer\fR to be queried. \fIWidget\fR
-is the path name of a widget packed in \fIcontainer\fR. See the
-.SB WIDGET OPTIONS
-section.
-.TP
-No argument
-Specifies that the table itself is to be queried.
-See the
-.SB TABLE OPTIONS
-section for a description of the option-value pairs for the table.
-.RE
-.RS
-.sp
-The \fIoption\fI and \fIvalue\fR pairs are specific to \fIitem\fR. If
-\fIoption\fR is specified with no \fIvalue\fR, then the command
-returns a list describing the one named option (this list will be
-identical to the corresponding sublist of the value returned if no
-\fIoption\fR is specified). If one or more \fIoption\-value\fR pairs
-are specified, then the command modifies the given option(s) to have
-the given value(s); in this case the command returns the empty string.
-.RE
-.TP
-\fBtable extents \fIcontainer\fR \fIindex\fR
-Queries the location and dimensions of row and columns in the table.
-\fIIndex\fR can be either a row or column index or a table index.
-Returns a list of the x,y coordinates (upperleft corner) and
-dimensions (width and height) of the cell, row, or column.
-.TP
-\fBtable forget \fIwidget\fR ?\fIwidget\fR?...
-Requests that \fIwidget\fR no longer have its geometry managed.
-\fIWidget\fR is the pathname of the window currently
-managed by some table. The window will be unmapped so that it no longer
-appears on the screen. If \fIwidget\fR is not currently managed by any table,
-an error message is returned, otherwise the empty string.
-.TP
-\fBtable info \fIcontainer\fR \fIitem\fR
-Returns a list of the current configuration options for \fIitem\fR.
-The list returned is exactly in the form that might be specified to the
-\fBtable\fR command. It can be used to save and reset table
-configurations. \fIItem\fR must be one of the following.
-.RS
-.TP .75i
-\f(CWC\fIi\fR
-Specifies the column of \fIcontainer\fR to be queried. \fIItem\fR
-must be in the form \f(CWC\fIn\fR, where \fIn\fR is the index of
-the column.
-.TP
-\f(CWR\fIi\fR
-Specifies the row of \fIcontainer\fR to be queried. \fIItem\fR must be
-in the form \f(CWR\fIi\fR, where \fIi\fR is the index of the row.
-.TP
-\fIwidget\fR
-Specifies a widget of \fIcontainer\fR to be queried.
-\fIWidget\fR is the path name of a widget packed in \fIcontainer\fR.
-.TP
-No argument
-Specifies that the table itself is to be queried.
-.RE
-.TP
-\fBtable locate \fIcontainer\fR \fIx y\fR
-Returns the table index (row,column) of the cell containing the given
-screen coordinates. The \fIx\fR and \fIy\fR arguments represent
-the x and y coordinates of the sample point to be tested.
-.TP
-\fBtable containers \fR?\fIswitch arg\fR?
-Returns a list of all container windows matching a given criteria (using
-\fIswitch\fR and \fIarg\fR). If no \fIswitch\fR and \fIarg\fR
-arguments are given, the names of all container windows (only those using
-the \fBtable\fR command) are returned. The following are valid
-switches:
-.RS
-.TP
-\fB\-pattern\fR \fIpattern\fR
-Returns a list of pathnames of all container windows matching \fIpattern\fR.
-.TP
-\fB\-slave\fR \fIwindow\fR
-Returns the name of the container window of table managing \fIwindow\fR.
-\fIWindow\fR must be the path name of widget. If \fIwindow\fR is not
-managed by any table, the empty string is returned.
-.RE
-.TP
-\fBtable search \fIcontainer\fR ?\fIswitch arg\fR?...
-Returns the names of all the widgets in \fIcontainer\fR matching
-the criteria given by \fIswitch\fR and \fIarg\fR. \fIContainer\fR is
-name of the container window associated with the table to be searched.
-The name of the widget is returned if any one
-\fIswitch\fR-\fIarg\fR criteria matches. If no \fIswitch\fR-\fIarg\fR
-arguments are given, the names of all widgets managed by
-\fIcontainer\fR are returned. The following are switches are available:
-.RS
-.TP
-\fB\-pattern\fR \fIpattern\fR
-Returns the names of any names of the widgets matching
-\fIpattern\fR.
-.TP
-\fB\-span\fR \fIindex\fR
-Returns the names of widgets that span \fIindex\fR. A widget
-does not need to start at \fIindex\fR to be included.
-\fIIndex\fR must be in the form \fIrow\fR,\fIcolumn\fR, where
-\fIrow\fR and \fIcolumn\fR are valid row and column numbers.
-.TP
-\fB\-start\fR \fIindex\fR
-Returns the names of widgets that start at \fIindex\fR.
-\fIIndex\fR must be in the form \fIrow\fR,\fIcolumn\fR, where
-\fIrow\fR and \fIcolumn\fR are valid row and column numbers.
-.RE
-.SH TABLE OPTIONS
-To configure the table itself, you omit the \fIitem\fR argument
-when invoking the \fBconfigure\fR operation.
-.CS
-\fBtable configure\fR \fIcontainer\fR ?\fIoption value\fR?...
-.CE
-The following options are available for the table:
-.RS
-.TP
-\fB\-padx \fIpad\fR
-Sets how much padding to add to the left and right exteriors of the table.
-\fIPad\fR can be a list of one or two numbers. If \fIpad\fR
-has two elements, the left side of the table is padded by the first
-value and the right side by the second value. If \fIpad\fR has just
-one value, both the left and right sides are padded evenly by the
-value. The default is \f(CW0\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets how much padding to add to the top and bottom exteriors of the table.
-\fIPad\fR can be a list of one or two numbers. If
-\fIpad\fR has two elements, the area above the table is padded by
-the first value and the area below by the second value. If \fIpad\fR
-is just one number, both the top and bottom areas are padded by the
-value. The default is \f(CW0\fR.
-.TP
-\fB\-propagate \fIboolean\fR
-Indicates if the table should override the requested width and height
-of the \fIcontainer\fR window. If \fIboolean\fR is false, \fIcontainer\fR
-will not be resized. \fIContainer\fR will be its requested size. The
-default is \f(CW1\fR.
-.RE
-.SH WIDGET OPTIONS
-widgets are configured by specifying the name of the widget
-when invoking the \fBconfigure\fR operation.
-.DS
-\fBtable configure\fR \fIcontainer \fIwidget\fR ?\fIoption value\fR?...
-.DE
-\fIWidget\fR must be the path name of a window already packed in
-the table associated with \fIcontainer\fR. The following options
-are available for widgets:
-.RS
-.TP
-\fB\-anchor \fIanchor\fR
-Anchors \fIwidget\fR to a particular edge of the cell(s) it resides.
-This option has effect only if the space of the spans surrounding
-\fIwidget\fR is larger than \fIwidget\fR. \fIAnchor\fR specifies
-how \fIwidget\fR will be positioned in the space. For example, if
-\fIanchor\fR is \f(CWcenter\fR then the window is centered in the rows
-and columns it spans; if \fIanchor\fR is \f(CWw\fR then the window will
-be aligned with the leftmost edge of the span. The default is
-\f(CWcenter\fR.
-.TP
-\fB\-columnspan \fInumber\fR
-Sets the number of columns \fIwidget\fR will span.
-The default is \f(CW1\fR.
-.TP
-\fB\-columncontrol \fIcontrol\fR
-Specifies how the width of \fIwidget\fR should control the
-width of the columns it spans. \fIControl\fR is
-either \f(CWnormal\fR, \f(CWnone\fR, or \f(CWfull\fR.
-The default is \f(CWnormal\fR.
-.RS
-.TP 1i
-\f(CWnone\fR
-The width of \fIwidget\fR is not considered.
-.TP 1i
-\f(CWfull\fR
-Only the width of \fIwidget\fR will be considered when computing the
-widths of the columns.
-.TP 1i
-\f(CWnormal\fR
-Indicates that the widest widget spanning the column will determine
-the width of the span.
-.RE
-.TP
-\fB\-fill \fIfill\fR
-Specifies if \fIwidget\fR should be stretched to fill any free space
-in the span surrounding \fIwidget\fR. \fIFill\fR is either \f(CWnone\fR,
-\f(CWx\fR, \f(CWy\fR, \f(CWboth\fR. The default is \f(CWnone\fR.
-.RS
-.TP 1i
-\f(CWx\fR
-The widget can grow horizontally.
-.TP 1i
-\f(CWy\fR
-The widget can grow vertically.
-.TP 1i
-\f(CWboth\fR
-The widget can grow both vertically and horizontally.
-.TP 1i
-\f(CWnone\fR
-The widget does not grow along with the span.
-.RE
-.TP
-\fB\-ipadx \fIpixels\fR
-Sets how much horizontal padding to add internally on the left and
-right sides of \fIwidget\fR. \fIPixels\fR must be a valid screen distance
-like \f(CW2\fR or \f(CW0.3i\fR. The default is \f(CW0\fR.
-.TP
-\fB\-ipady \fIpixels\fR
-Sets how much vertical padding to add internally on the top and bottom
-of \fIwidget\fR. \fIPixels\fR must be a valid screen distance
-like \f(CW2\fR or \f(CW0.3i\fR. The default is \f(CW0\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets how much padding to add to the left and right exteriors of \fIwidget\fR.
-\fIPad\fR can be a list of one or two numbers. If \fIpad\fR
-has two elements, the left side of \fIwidget\fR is padded by the first
-value and the right side by the second value. If \fIpad\fR has just
-one value, both the left and right sides are padded evenly by the
-value. The default is \f(CW0\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets how much padding to add to the top and bottom exteriors of
-\fIwidget\fR. \fIPad\fR can be a list of one or two numbers. If
-\fIpad\fR has two elements, the area above \fIwidget\fR is padded by
-the first value and the area below by the second value. If \fIpad\fR
-is just one number, both the top and bottom areas are padded by the
-value. The default is \f(CW0\fR.
-.TP
-\fB\-reqheight \fIheight\fR
-Specifies the limits of the requested height for \fIwidget\fR.
-\fIHeight\fR is a list of bounding values. See the
-.SB BOUNDING SIZES
-section for a description of this list. By default, the height of
-\fIwidget\fR is its requested height with its internal padding
-(see the \fB\-ipady\fR option). The bounds specified by \fIheight\fR
-either override the height completely, or bound the height between two sizes.
-The default is \f(CW""\fR.
-.TP
-\fB\-reqwidth \fIwidth\fR
-Specifies the limits of the requested width for \fIwidget\fR.
-\fIWidth\fR is a list of bounding values. See the
-.SB BOUNDING SIZES
-section for a description of this list. By default, the width of
-\fIwidget\fR is its requested width with its internal padding
-(set the \fB\-ipadx\fR option). The bounds specified by \fIwidth\fR
-either override the width completely, or bound the height between two sizes.
-The default is \f(CW""\fR.
-.TP
-\fB\-rowspan \fInumber\fR
-Sets the number of rows \fIwidget\fR will span. The default is \f(CW1\fR.
-.TP
-\fB\-rowcontrol \fIcontrol\fR
-Specifies how the height of \fIwidget\fR should control the
-height of the rows it spans. \fIControl\fR is
-either \f(CWnormal\fR, \f(CWnone\fR, or \f(CWfull\fR.
-The default is \f(CWnormal\fR.
-.RS
-.TP 1i
-\f(CWnone\fR
-The height of \fIwidget\fR is not considered.
-.TP 1i
-\f(CWfull\fR
-Only the height of \fIwidget\fR will be considered when computing the
-heights of the rows.
-.TP 1i
-\f(CWnormal\fR
-Indicates that the tallest widget spanning the row will determine
-the height of the span.
-.RE
-.RE
-.SH COLUMN OPTIONS
-To configure a column in the table, specify the column index as
-\f(CWC\fIi\fR, where \fIi\fR is the index of the column to be
-configured.
-.DS
-\fBtable configure\fR \fIcontainer \f(CWC\fIi\fR ?\fIoption value\fR?...
-.DE
-If the index is specified as \f(CWC*\fR, then all columns of the table
-will be configured. The following options are available for table
-columns.
-.RS
-.TP
-\fB\-padx \fIpad\fR
-Sets the padding to the left and right of the column.
-\fIPad\fR can be a list of one or two numbers. If \fIpad\fR has two
-elements, the left side of the column is padded by the first value and
-the right side by the second value. If \fIpad\fR has just one value,
-both the left and right sides are padded evenly by the value. The
-default is \f(CW0\fR.
-.TP
-\fB\-resize \fImode\fR
-Indicates that the column can expand or shrink from its requested width
-when the table is resized.
-\fIMode\fR must be one of the following:
-\f(CWnone\fR, \f(CWexpand\fR, \f(CWshrink\fR, or \f(CWboth\fR. If \fImode\fR is
-\f(CWexpand\fR the width of the column is expanded if there is extra space
-in the container window. If \fImode\fR is \f(CWshrink\fR its width may be
-reduced beyond its requested width if there is not enough space in the container.
-The default is \f(CWnone\fR.
-.TP
-\fB\-width \fIwidth\fR
-Specifies the limits within that the width of the column may expand
-or shrink. \fIWidth\fR is a list of bounding values. See the section
-.SB BOUNDING SIZES
-for a description of this list.
-By default there are no constraints.
-.RE
-.SH ROW OPTIONS
-To configure a row in the table, specify the row index as \f(CWR\fIi\fR,
-where \fIi\fR is the index of the row to be configured.
-.DS
-\fBtable configure\fR \fIcontainer \f(CWR\fIi\fR ?\fIoption value\fR?...
-.DE
-If the index is specified as \f(CWR*\fR, then all rows of the table will
-be configured. The following options are available for table rows.
-.RS
-.TP
-\fB\-height \fIheight\fR
-Specifies the limits of the height that the row may expand or shrink to.
-\fIHeight\fR is a list of bounding values. See the section
-.SB BOUNDING SIZES
-for a description of this list.
-By default there are no constraints.
-.TP
-\fB\-pady \fIpad\fR
-Sets the padding above and below the row. \fIPad\fR can be a list
-of one or two numbers. If \fIpad\fR has two elements, the area above
-the row is padded by the first value and the area below by the
-second value. If \fIpad\fR is just one number, both the top and
-bottom areas are padded by the value. The default is \f(CW0\fR.
-.TP
-\fB\-resize \fImode\fR
-Indicates that the row can expand or shrink from its requested height
-when the table is resized.
-\fIMode\fR must be one of the following:
-\f(CWnone\fR, \f(CWexpand\fR, \f(CWshrink\fR, or \f(CWboth\fR. If \fImode\fR is
-\f(CWexpand\fR the height of the row is expanded if there is extra space
-in the container. If \fImode\fR is \f(CWshrink\fR its height may be
-reduced beyond its requested height if there is not enough space in
-the container. The default is \f(CWnone\fR.
-.RE
-.SH BOUNDING SIZES
-Sometimes it's more useful to limit resizes to an acceptable range,
-than to fix the size to a particular value or disallow resizing
-altogether. Similar to the way the \fBwm\fR command lets you specify
-a \fBminsize\fR and \fBmaxsize\fR for a toplevel window, you can bound
-the sizes the container, a widget, row, or column may take.
-The \fB\-width\fR, \fB\-height\fR, \fB\-reqwidth\fR, and
-\fB\-reqheight\fR options, take a list of one, two, or three values.
-We can take a previous example and instead preventing resizing,
-bound the size of the scrollbars between two values.
-.CS
-table . \\
- .title 0,0 -cspan 3 \\
- .canvas 1,1 -fill both \\
- .vscroll 1,2 -fill y \\
- .hscroll 2,1 -fill x
-
-# Bound the scrollbars between 1/8 and 1/2 inch
-table configure . c2 -width { 0.125 0.5 }
-table configure . r2 -height { 0.125 0.5 }
-table configure . vscroll .hscroll -fill both
-.CE
-The scrollbars will get no smaller than 1/8 of an inch, or bigger
-than 1/2 inch. The initial size will be their requested size,
-so long as it is within the specified bounds.
-.PP
-How the elements of the list are interpreted is dependent upon the
-number of elements in the list.
-.RS
-.TP 1i
-{\fI\fR}
-Empty list. No bounds are set. The default sizing is performed.
-.TP
-{\fI x \fR}
-Fixes the size to \fIx\fR. The window or partition cannot grow or
-shrink.
-.TP
-{\fI min max \fR}
-Sets up minimum and maximum limits for the size of the window or
-partition. The window or partition can be reduced less than
-\fImin\fR, nor can it be stretched beyond \fImax\fR.
-.TP
-{\fI min max nom \fR}
-Specifies minimum and maximum size limits, but also specifies a
-nominal size \fInom\fR. This overrides the calculated size of the
-window or partition.
-.RE
-.SH MISCELLANEOUS
-Another feature is that you can put two widgets in the
-same cell of the table. This is useful when you want to add
-decorations around a widget.
-.CS
-frame .frame -bd 1 -relief sunken
-button .quit -text "Quit"
-
-# Put both the frame and the button in the same cell.
-table . \\
- .quit 1,0 -padx 2 -pady 2 \\
- .frame 1,0 -fill both
-.CE
-.SH LIMITATIONS
-A long standing bug in Tk (circa 1993), there is no way to detect if a
-window is already a container of a different geometry manager. This
-is usually done by accident, such as the following where all three
-widgets are arranged in the same container ".", but using different
-geometry managers.
-.CS
- table .f1
- ...
- pack .f2
- ...
- grid .f3
-.CE
-This leads to bizarre window resizing, as each geometry manager
-applies its own brand of layout policies. When the container is a top
-level window (such as "."), your window manager may become locked
-as it responds to the never-ending stream of resize requests.
-.SH KEYWORDS
-frame, geometry manager, location, table, size
-
diff --git a/blt3.0.1/man/tabset.mann b/blt3.0.1/man/tabset.mann
deleted file mode 100644
index 3081688..0000000
--- a/blt3.0.1/man/tabset.mann
+++ /dev/null
@@ -1,942 +0,0 @@
-
-'\"
-'\" Copyright 1998 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Tabset widget created by George Howlett.
-'\"
-.so man.macros
-.TH tabset n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-tabset \- Create and manipulate tabset widgets
-.BE
-.SH SYNOPSIS
-\fBtabset\fR \fIpathName \fR?\fIoptions\fR?
-.SH DESCRIPTION
-The \fBtabset\fR widget displays a series of tabbed folders
-where only one folder at a time is displayed. A folder can contain
-a Tk widget that is displayed when the folder is displayed.
-.PP
-There's no limit to the number of folders. Tabs can be tiered (more than
-one row). If there are more tabs than can be displayed, tabs can also
-be scrolled. Any folder can also be torn off, when the contents (the Tk widget
-contained by it) is temporarily moved into another toplevel widget.
-A tabset may used as just a set of tabs, without a displaying any pages.
-You can bind events to individual tabs, so it's easy to add features like
-"balloon help".
-.SH SYNTAX
-The \fBtabset\fR command creates a new window using the \fIpathName\fR
-argument and makes it into a tabset widget.
-.DS
-\fBtabset \fIpathName \fR?\fIoption value\fR?...
-.DE
-Additional options may be specified on the command line or in the
-option database to configure aspects of the tabset such as its colors,
-font, text, and relief. The \fBtabset\fR command returns its
-\fIpathName\fR argument. At the time this command is invoked, there
-must not exist a window named \fIpathName\fR, but \fIpathName\fR's
-parent must exist.
-.PP
-When first created the new tabset widget contains no tabs. Tabs are
-added using the \fBinsert\fR operation described below.
-The size of the tabset window is determined the number of tiers of
-tabs requested and the sizes of the Tk widgets embedded inside each folder.
-The widest embedded widget determines the width of all folders. The tallest
-determines the height. If no folders contain an embedded widget, the
-size is detemined solely by the size of the tabs. You can override
-either dimension with the tabset's \fB\-width\fR
-and \fB\-height\fR options.
-.PP
-Tabs may be scrolled using the \fB\-scrollcommand\fR option. They also
-support scanning (see the \fBscan\fR operation). Tabs also may be arranged
-along any side of the tabset window using the \fB\-side\fR option.
-.PP
-An individual tabs/folders in the tabset may be described by its index,
-name, tag or text label.
-.SS "INDICES"
-An index is the order of the tab in the tabset. Indices start from zero.
-In addition to numeric indices, there are additional special indices.
-They are described below:
-.TP 12
-\fInumber\fR
-Unique node id of the tab.
-.TP 12
-\fB@\fIx\fB,\fIy\fR
-Tab that covers the point in the tabset window
-specified by \fIx\fR and \fIy\fR (in screen coordinates). If no
-tab covers that point, then the index is ignored.
-.TP 12
-\fBselected\fR
-The currently selected tab. The \fBselected\fR index is
-typically changed by either clicking on the tab with the left mouse
-button or using the widget's \fBinvoke\fR operation.
-.TP 12
-\fBactive\fR
-The tab where the mouse pointer is currently located. The label
-is drawn using its active colors (see the \fB\-activebackground\fR and
-\fB\-activeforeground\fR options). The \fBactive\fR index is typically
-changed by moving the mouse pointer over a tab or using the widget's
-\fBactivate\fR operation. There can be only one active tab at a time.
-If there is no tab located under the mouse pointer, the index
-is ignored.
-.TP 12
-\fBfocus\fR
-Tab that currently has the widget's focus.
-This tab is displayed with a dashed line around its label. You can
-change this using the \fBfocus\fR operation. If no tab has focus,
-then the index is ignored.
-.TP 12
-\fBdown\fR
-Tab immediately below the tab that currently has focus,
-if there is one. If there is no tab below, the current
-tab is returned.
-.TP 12
-\fBleft\fR
-Tab immediately to the left the tab that currently has focus,
-if there is one. If there is no tab to the left, the current
-tab is returned.
-.TP 12
-\fBright\fR
-Tab immediately to the right the tab that currently has focus, if
-there is one. If there is no tab to the right, the current tab is
-returned.
-.TP 12
-\fBup\fR
-Tab immediately above, if there is one, to the tab that currently has
-focus. If there is no tab above, the current tab is returned.
-.TP 12
-\fBend\fR
-Last tab in the tabset. If there are no tabs in the tabset then the
-index is ignored.
-.LP
-Some indices may not always be available. For example, if the mouse
-is not over any tab, "active" does not have an index. For most
-tabset operations this is harmless and ignored.
-.SH "NAMES"
-
-.SH "OPERATIONS"
-All \fBtabset\fR operations are invoked by specifying the widget's
-pathname, the operation, and any arguments that pertain to that
-operation. The general form is:
-.sp
-.DS
- \fIpathName operation \fR?\fIarg arg ...\fR?
-.DE
-.sp
-\fIOperation\fR and the \fIarg\fRs determine the exact behavior of the
-command. The following operations are available for tabset widgets:
-.TP
-\fIpathName \fBactivate\fR \fItab\fR
-Sets the active tab to the one indicated by \fIindex\fR. The
-active tab is drawn with its \fIactive\fR colors (see the
-\fB\-activebackground\fR and \fB\-activeforeground\fR options) and may
-be retrieved with the index \fBactive\fR. Only one tab may be active
-at a time. If \fIindex\fR is the empty string, then all tabs will
-be drawn with their normal foreground and background colors.
-.TP
-\fIpathName \fBbind\fR \fItagName\fR ?\fIsequence\fR? ?\fIcommand\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for a tab with this
-tag, \fIcommand\fR will be invoked. The syntax is similar to the
-\fBbind\fR command except that it operates on tabs, rather
-than widgets. See the \fBbind\fR manual entry for
-complete details on \fIsequence\fR and the substitutions performed on
-\fIcommand\fR.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBcget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described in the section
-.SB "WIDGET OPTIONS"
-below.
-.TP
-\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "WIDGET OPTIONS"
-below.
-.TP
-\fIpathName \fBdelete \fItab...\fR?
-Deletes one or more tabs from the tabset. \fITab\fR may be
-an index, tag, name, or label referring to one or more tabs.
-.TP
-\fIpathName \fBfocus \fItab\fR
-Specifies the tab to get the widget's focus. The tab is displayed
-with a dashed line around its label.
-.TP
-\fIpathName \fBget\fR \fItab\fR
-Returns the name of the tab. The value of \fIindex\fR may
-be in any form described in the section
-.SB "INDICES".
-.TP
-\fIpathName \fBindex\fR ?\fIflag\fR? \fIstring\fR
-Returns the node id of the tab specified by \fIstring\fR. If
-\fIflag\fR is \fB\-name\fR, then \fIstring\fR is the name of a tab.
-If \fIflag\fR is \fB\-index\fR, \fIstring\fR is an index such as
-"active" or "focus". If \fIflag\fR isn't specified, it defaults to
-\fB\-index\fR.
-.TP
-\fIpathName \fBinsert\fR \fIposition\fR ?\fIname\fR? ?\fIoption value\fR?...
-Inserts a new tab into the tabset. The new tab is inserted before the
-tab given by \fIposition\fR. \fIPosition\fR may be either a number,
-indicating where in the list the new tab should be added, or \fBend\fR,
-indicating that the new tab is to be added the end of the list.
-\fIName\fR is the name of the tab. If \fIname\fR isn't given,
-then a name is generated in the form "tabN". Returns the name of the
-new tab.
-.TP
-\fIpathName \fBinvoke \fItab\fR
-Selects the folder given by \fItab\fR, displaying it in the tabset.
-It also invokes the Tcl command associated with the tab \
-(see the tabset's \fB\-selectcommand\fR option or the tab's \fB\-command\fR
-option), if there is one.
-It returns the return value from the Tcl command, or an empty
-string if there is no command associated with the tab.
-This command is ignored if the tab's state (see the \fB\-state\fR option)
-is disabled.
-.TP
-\fIpathName \fBmove\fR \fItab\fR \fBbefore\fR|\fBafter\fR \fItab\fR
-Moves the tab \fItab\fR to a new position in the tabset.
-.TP
-\fIpathName \fBnearest\fR \fIx\fR \fIy\fR
-Returns the name of the tab nearest to given X-Y screen coordinate.
-.TP
-\fIpathName \fBperforation \fIoperation\fR ?\fIargs\fR?
-This operation controls the perforation on the tab label.
-.RS
-.TP
-\fIpathName \fBperforation highlight\fR \fItab\fR \fIboolean\fR
-.TP
-\fIpathName \fBperforation invoke\fR \fItab\fR
-Invokes the command specified for perforations (see the
-\fB\-perforationcommand\fR widget option). Typically this command
-places the page into a top level widget. The name of the toplevel
-is the concatonation of the \fIpathName\fR, "-", and the \fItabName\fR.
-The return value is the return value from the Tcl command, or an empty
-string if there is no command associated with the tab.
-This command is ignored if the tab's state (see the \fB\-state\fR option)
-is disabled.
-.RE
-.TP
-\fIpathName \fBscan\fR \fIoption args\fR
-This command implements scanning on tabsets. It has
-two forms, depending on \fIoption\fR:
-.RS
-.TP
-\fIpathName \fBscan mark \fIx y\fR
-Records \fIx\fR and \fIy\fR and the current view in the tabset
-window; used with later \fBscan dragto\fR commands.
-Typically this command is associated with a mouse button press in
-the widget. It returns an empty string.
-.TP
-\fIpathName \fBscan dragto \fIx y\fR.
-This command computes the difference between its \fIx\fR and \fIy\fR
-arguments and the \fIx\fR and \fIy\fR arguments to the last
-\fBscan mark\fR command for the widget.
-It then adjusts the view by 10 times the
-difference in coordinates. This command is typically associated
-with mouse motion events in the widget, to produce the effect of
-dragging the list at high speed through the window. The return
-value is an empty string.
-.RE
-.TP
-\fIpathName \fBsee \fItab\fR
-Scrolls the tabset so that the tab
-\fItab\fR is visible in the widget's window.
-.TP
-\fIpathName \fBsize\fR
-Returns the number of tabs in the tabset.
-.TP
-\fIpathName \fBtab \fIoperation\fR ?\fIargs\fR?
-.RS
-.TP
-\fIpathName \fBtab cget\fR \fItab\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR for tab \fItab\fR.
-\fIOption\fR may have any of the values accepted by the \fBtab configure\fR
-operation described in the section
-.SB "TAB OPTIONS"
-below.
-.TP
-\fIpathName \fBtab configure\fR \fItab\fR \fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of one or more tabs.
- More than one tab can be configured if \fItab\fR refers to multiple tabs.
-If no \fIoption\fR is specified, this operation returns a list
-describing all the available options for \fItab\fR.
-.sp
-If \fIoption\fR is specified, but not \fIvalue\fR, then a list describing the
-one named option is returned. If one or more \fIoption\-value\fR pairs
-are specified, then each named tab (specified by \fInameOrIndex\fR) will
-have its configurations option(s) set the given value(s). In
-this last case, the empty string is returned.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "TAB OPTIONS"
-below.
-.TP
-\fIpathName \fBtab names\fR ?\fIpattern\fR?
-Returns the names of all the tabs matching the given pattern. If
-no \fIpattern\fR argument is provided, then all tab names are returned.
-.TP
-\fIpathName \fBtab tearoff \fItab\fR ?\fIwindow\fR?
-Moves the widget embedded the folder \fItab\fR (see the \fB-window\fR option),
-placing it inside of \fIwindow\fR. \fIWindow\fR is either the name of
-an new widget that will contain the embedded widget or the name
-of the \fBtabset\fR widget. It the last case, the embedded widget
-is put back into the folder.
-.sp
-If no \fIwindow\fR argument is provided, then the name of the current
-parent of the embedded widget is returned.
-.RE
-.TP
-\fIpathName \fBview \fIargs\fR
-This command queries or changes the position of the
-tabset in the widget's window. It can take any of the following
-forms:
-.RS
-.TP
-\fIpathName \fBview\fR
-Returns a list of two numbers between 0.0 and
-1.0 that describe the amount and position of the tabset that is
-visible in the window. For example, if \fIview\fR is "0.2 0.6", 20%
-of the tabset's text is off-screen to the left, 40% is visible in the
-window, and 40% of the tabset is off-screen to the right. These are
-the same values passed to scrollbars via the \fB\-scrollcommand\fR
-option.
-.TP
-\fIpathName \fBview moveto\fI fraction\fR
-Adjusts the view in the window so that \fIfraction\fR of the
-total width of the tabset text is off-screen to the left.
-\fIfraction\fR must be a number between 0.0 and 1.0.
-.TP
-\fIpathName \fBview scroll \fInumber what\fR
-This command shifts the view in the window (left/top or right/bottom)
-according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an
-integer. \fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an
-abbreviation of these. If \fIwhat\fR is \fBunits\fR, the view adjusts
-left or right by \fInumber\fR scroll units (see the
-\fB\-scrollincrement\fR option). ; if it is \fBpages\fR then the view
-adjusts by \fInumber\fR widget windows. If \fInumber\fR is negative
-then tabs farther to the left become visible; if it is positive then
-tabs farther to the right become visible.
-.RE
-.SH "WIDGET OPTIONS"
-Widget configuration options may be set either by the \fBconfigure\fR
-operation or the Tk \fBoption\fR command. The resource class
-is \f(CWTabset\fR. The resource name is the name of the widget.
-.CS
-option add *Tabset.Foreground white
-option add *Tabset.Background blue
-.CE
-The following widget options are available:
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the default active background color for tabs. A tab is active
-when the mouse is positioned over it or set by the \fBactivate\fR
-operation. Individual tabs may override this option by setting the
-tab's \fB\-activebackground\fR option.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the default active foreground color for tabs. A tab is active
-when the mouse is positioned over it or set by the \fBactivate\fR
-operation. Individual tabs may override this option by setting the
-tab's \fB\-activeforeground\fR option.
-.TP
-\fB\-background \fIcolor\fR
-Sets the default background color of folders. Individual tabs can
-override this with their own \fBR-background\fR option.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around tabs and folders. The
-\fB\-relief\fR option determines how the border is to be drawn. The
-default is \f(CW1\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for both tabs and folders. \fIRelief\fR
-specifies how the tabs should appear relative to background of the
-widget; for example, \f(CWraised\fR means the tab should
-appear to protrude. The default is \f(CWraised\fR.
-.TP
-\fB\-troughbackground \fIcolor\fR
-Sets the background color of the trough under the tabs.
-.TP
-\fB\-outerborderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the outside edge of the widget. The
-\fB\-relief\fR option determines how the border is to be drawn. The
-default is \f(CW0\fR.
-.TP
-\fB\-outerpad \fIpixels\fR
-Sets the amount of padding between the highlight ring on the
-outer edge of the tabset and the folder.
-The default is \f(CW0\fR.
-.TP
-\fB\-outerrelief \fIrelief\fR
-Specifies the 3-D effect for the tabset widget. \fIRelief\fR
-specifies how the tabset should appear relative to widget that
-it is packed into; for example, \f(CWraised\fR means the tabset should
-appear to protrude. The default is \f(CWsunken\fR.
-.TP
-\fB\-cursor \fIcursor\fR
-Specifies the widget's cursor. The default cursor is \f(CW""\fR.
-.TP
-\fB\-dashes \fIdashList\fR
-Sets the dash style of the focus outline. When a tab has the widget's
-focus, it is drawn with a dashed outline around its label.
-\fIDashList\fR is a list of up
-to 11 numbers that alternately represent the lengths of the dashes
-and gaps on the cross hair lines. Each number must be between 1 and
-255. If \fIdashList\fR is \f(CW""\fR, the outline will be a solid
-line. The default value is \f(CW5 2\fR.
-.TP
-\fB\-font \fIfontName\fR
-Sets the default font for the text in tab labels. Individual tabs may
-override this by setting the tab's \fB\-font\fR option. The default value is
-\f(CW*Arial 9\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the default color of tab labels. Individual tabs may
-override this option by setting the tab's \fB\-foreground\fR option.
-The default value is \f(CWblack\fR.
-.TP
-\fB\-gap \fIsize\fR
-Sets the gap (in pixels) between tabs. The default value is \f(CW2\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the requested height of widget. If \fIpixels\fR is
-0, then the height of the widget will be calculated based on
-the size the tabs and their pages.
-The default is \f(CW0\fR.
-.TP
-\fB\-highlightbackground \fIcolor\fR
-Sets the color to display in the traversal highlight region when
-the tabset does not have the input focus.
-.TP
-\fB\-highlightcolor \fIcolor\fR
-Sets the color to use for the traversal highlight rectangle that is
-drawn around the widget when it has the input focus.
-The default is \f(CWblack\fR.
-.TP
-\fB\-highlightthickness \fIpixels\fR
-Sets the width of the highlight rectangle to draw around the outside of
-the widget when it has the input focus. \fIPixels\fR is a non-negative
-value and may have any of the forms acceptable to \fBTk_GetPixels\fR.
-If the value is zero, no focus highlight is drawn around the widget.
-The default is \f(CW2\fR.
-.TP
-\fB\-pageheight \fIpixels\fR
-Sets the requested height of the page. The page is the area under the
-tab used to display the page contents. If \fIpixels\fR is \f(CW0\fR,
-the maximum height of all embedded tab windows is used.
-The default is \f(CW0\fR.
-.TP
-\fB\-pagewidth \fIpixels\fR
-Sets the requested width of the page. The page is the area under the
-tab used to display the page contents. If \fIpixels\fR is \f(CW0\fR,
-the maximum width of all embedded tab windows is used. The default
-is \f(CW0\fR.
-.TP
-\fB\-perforationcommand\fR \fIstring\fR
-Specifies a Tcl script to be invoked to tear off the current
-page in the tabset. This command is typically invoked when
-left mouse button is released over the tab perforation. The default
-action is to tear-off the page and place it into a new toplevel
-window.
-.TP
-\fB\-rotate \fIangle\fR
-Specifies the degrees to rotate text in tab labels.
-\fIAngle\fR is a real value representing the number of degrees
-to rotate the text labels. The default is \f(CW0.0\fR degrees.
-.TP
-\fB\-tabwidth \fIwidth\fR
-Indicates the width of each tab. \fIWidth\fR can be one of the
-following:
-.RS
-.TP 1i
-\f(CWvariable\fR
-The width of the tab is determined by its text and image.
-.TP 1i
-\f(CWsame\fR
-The width of every tab is the maximum size.
-.TP 1i
-\f(CWpixels\fR
-The width of the tab is set to \fIpixels\R.
-\fIPixels\fR is a positive screen distance.
-.RE
-The default is \f(CWsame\fR.
-.TP
-\fB\-scrollcommand \fIstring\fR
-Specifies the prefix for a command for communicating with
-scrollbars. Whenever the view in the widget's window
-changes, the widget will generate a Tcl command by concatenating the
-scroll command and two numbers. If this option is not specified, then
-no command will be executed.
-.TP
-\fB\-scrollincrement \fIpixels\fR
-Sets the smallest number of pixels to scroll the tabs.
-If \fIpixels\fR is greater than 0, this sets the units for
-scrolling (e.g., when you the change the view by clicking
-on the left and right arrows of a scrollbar).
-.TP
-\fB\-selectbackground \fIcolor\fR
-Sets the color to use when displaying background of the selected
-tab. Individual tabs can override this option by setting the tab's
-\fB\-selectbackground\fR option.
-'\".TP
-'\" \fB\-selectborderwidth \fIpixels\fR
-'\" Sets the width of the raised 3-D border to draw around the label of
-'\" the selected tab. \fIPixels\fR must be a non-negative value.
-'\" The default value is \f(CW1\fR.
-.TP
-\fB\-selectcommand \fIstring\fR
-Specifies a default Tcl script to be associated with tabs. This
-command is typically invoked when left mouse button is released over
-the tab. Individual tabs may override this with the tab's
-\fB\-command\fR option. The default value is \f(CW""\fR.
-.TP
-\fB\-selectforeground \fIcolor\fB
-Sets the default color of the selected tab's text label.
-Individual tabs can override this option by setting the tab's
-\fB\-selectforeground\fR option. The default value is \f(CWblack\fR.
-.TP
-\fB\-selectpad \fIpixels\fB
-Specifies extra padding to be displayed around the selected tab.
-The default value is \f(CW3\fR.
-.TP
-\fB\-side \fIside\fB
-Specifies the side of the widget to place tabs. The following
-values are valid for \fIside\fR. The default value is \f(CWtop\fR.
-.RS
-.TP 1i
-\f(CWtop\fR
-Tabs are drawn along the top.
-.TP 1i
-\f(CWleft\fR
-Tabs are drawn along the left side.
-.TP 1i
-\f(CWright\fR
-Tabs are drawn along the right side.
-.TP 1i
-\f(CWboth\fR
-Tabs are drawn along the bottom side.
-.RE
-.TP
-\fB\-slant \fIslant\fR
-Specifies if the tabs should be slanted 45 degrees on the left and/or
-right sides. The following values are valid for \fIslant\fR. The default
-is \f(CWnone\fR.
-.RS
-.TP 1i
-\f(CWnone\fR
-Tabs are drawn as a rectangle.
-.TP 1i
-\f(CWleft\fR
-The left side of the tab is slanted.
-.TP 1i
-\f(CWright\fR
-The right side of the tab is slanted.
-.TP 1i
-\f(CWboth\fR
-Boths sides of the tab are slanted.
-.RE
-.TP
-\fB\-takefocus\fR \fIfocus\fR
-Provides information used when moving the focus from window to window
-via keyboard traversal (e.g., Tab and Shift-Tab). If \fIfocus\fR is
-\f(CW0\fR, this means that this window should be skipped entirely during
-keyboard traversal. \f(CW1\fR means that the this window should always
-receive the input focus. An empty value means that the traversal
-scripts decide whether to focus on the window.
-The default is \f(CW1\fR.
-.TP
-\fB\-tearoff \fIboolean\fR
-.TP
-\fB\-textside \fIside\fB
-If both images and text are specified for a tab, this option determines on
-which side of the tab the text is to be displayed. The
-valid sides are \f(CWleft\fR, \f(CWright\fR, \f(CWtop\fR, and
-\f(CWbottom\fR. The default value is \f(CWleft\fR.
-.TP
-\fB\-tiers \fInumber\fB
-Specifies the maximum number of tiers to use to display the tabs.
-The default value is \f(CW1\fR.
-.TP
-\fB\-width \fIpixels\fR
-Specifies the requested width of the widget. If \fIpixels\fR is
-0, then the width of the widget will be calculated based on
-the size the tabs and their pages.
-The default is \f(CW0\fR.
-.SH "TAB OPTIONS"
-In addition to the \fBconfigure\fR operation, widget configuration
-options may also be set by the Tk \fBoption\fR command. The class
-resource name is \f(CWTab\fR.
-.CS
-option add *Tabset.Tab.Foreground white
-option add *Tabset.name.Background blue
-.CE
-The following widget options are available:
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the active background color for \fInameOrIndex\fR. A tab is active
-when the mouse is positioned over it or set by the \fBactivate\fR
-operation. This overrides the widget's \fB-activebackground\fR
-option.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the default active foreground color \fInameOrIndex\fR. A tab is "active"
-when the mouse is positioned over it or set by the \fBactivate\fR
-operation. Individual tabs may override this option by setting the
-tab's \fB-activeforeground\fR option.
-.TP
-\fB\-anchor \fIanchor\fR
-Anchors the tab's embedded widget to a particular edge of the folder.
-This option has effect only if the space in the folder surrounding the
-embedded widget is larger than the widget itself. \fIAnchor\fR specifies
-how the widget will be positioned in the extra space. For example, if
-\fIanchor\fR is \f(CWcenter\fR then the window is centered in the folder
-; if \fIanchor\fR is \f(CWw\fR then the window will
-be aligned with the leftmost edge of the folder. The default value is
-\f(CWcenter\fR.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color for \fInameOrIndex\fR. Setting this option overides the
-widget's \fB\-tabbackground\fR option.
-.TP
-\fB\-bindtags \fItagList\fR
-Specifies the binding tags for this tab. \fITagList\fR is a list of
-binding tag names. The tags and their order will determine how
-commands for events in tabs are invoked. Each tag in the list matching
-the event sequence will have its Tcl command executed. Implicitly the
-name of the tab is always the first tag in the list. The default value is
-\f(CWall\fR.
-.TP
-\fB\-command \fIstring\fR
-Specifies a Tcl script to be associated with \fInameOrIndex\fR. This
-command is typically invoked when left mouse button is released over
-the tab. Setting this option overrides the widget's
-\fB\-selectcommand\fR option.
-.TP
-\fB\-data \fIstring\fR
-Specifies a string to be associated with \fInameOrIndex\fR.
-This value isn't used in the widget code. It may be used in Tcl bindings
-to associate extra data (other than the image or text) with the
-tab. The default value is \f(CW""\fR.
-.TP
-\fB\-fill \fIfill\fR
-If the space in the folder surrounding the tab's embedded widget is
-larger than the widget, then \fIfill\fR indicates if the embedded widget
-should be stretched to occupy the extra space. \fIFill\fR is either
-\f(CWnone\fR,
-\f(CWx\fR, \f(CWy\fR, \f(CWboth\fR. For example, if \fIfill\fR is \f(CWx\fR,
-then the widget is stretched horizontally. If \fIfill\fR is \f(CWy\fR,
-the widget is stretched vertically. The default is \f(CWnone\fR.
-.TP
-\fB\-font \fIfontName\fR
-Sets the font for the text in tab labels. If \fIfontName\fR is not
-the empty string, this overrides the tabset's \fB\-font\fR option.
-The default value is \f(CW""\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the color of the label for \fInameOrIndex\fR. If \fIcolor\fR
-is not the empty string, this overrides the widget's \fB\-tabforeground\fR
-option. The default value is \f(CW""\fR.
-.TP
-\fB\-image \fIimageName\fR
-Specifies the image to be drawn in label for \fInameOrIndex\fR.
-If \fIimage\fR is \f(CW""\fR, no image will be drawn. Both text and
-images may be displayed at the same time in tab labels.
-The default value is \f(CW""\fR.
-.TP
-\fB\-ipadx \fIpad\fR
-Sets the padding to the left and right of the label.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the label is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default value is \f(CW0\fR.
-.TP
-\fB\-ipady \fIpad\fR
-Sets the padding to the top and bottom of the label.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the top of the label is padded by the first
-distance and the bottom by the second. If \fIpad\fR has just one
-distance, both the top and bottom sides are padded evenly. The
-default value is \f(CW0\fR.
-.TP
-\fB\-padx \fIpad\fR
-Sets the padding around the left and right of the embedded widget, if
-one exists.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the widget is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default value is \f(CW0\fR.
-.TP
-\fB\-pady \fIpad\fR
-Sets the padding around the top and bottom of the embedded widget, if
-one exists.
-\fIPad\fR can be a list of one or two screen distances. If \fIpad\fR
-has two elements, the top of the widget is padded by the first
-distance and the bottom by the second. If \fIpad\fR has just one
-distance, both the top and bottom sides are padded evenly. The
-default value is \f(CW0\fR.
-.TP
-\fB\-selectbackground \fIcolor\fR
-Sets the color to use when displaying background of the selected
-tab. If \fIcolor\fR is not the empty string, this overrides the
-widget's \fB\-selectbackground\fR option. The default value is
-\f(CW""\fR.
-.TP
-\fB\-shadow \fIcolor\fR
-Sets the shadow color for the text in the tab's label. Drop shadows
-are useful when both the foreground and background of the tab
-have similar color intensities.
-If \fIcolor\fR is the empty string, no shadow is drawn.
-The default value is \f(CW""\fR.
-.TP
-\fB\-state \fIstate\fR
-Sets the state of the tab. If \fIstate\fR is \f(CWdisable\fR the
-text of the tab is drawn as engraved and operations on the tab
-(such as \fBinvoke\fR and \fBtab tearoff\fR) are ignored.
-The default is \f(CWnormal\fR.
-.TP
-\fB\-stipple \fIbitmap\fR
-Specifies a stipple pattern to use for the background of the folder
-when the window is torn off.
-\fIBitmap\fR specifies a bitmap to use as the stipple
-pattern. The default is \f(CWBLT\fR.
-.TP
-\fB\-text \fItext\fR
-Specifies the text of the tab's label. The exact way the text is
-drawn may be affected by other options such as \fB\-state\fR or
-\fB\-rotate\fR.
-.TP
-\fB\-window \fIpathName\fR
-Specifies the widget to be embedded into the tab. \fIPathName\fR must
-be a child of the \fBtabset\fR widget. The tabset will "pack" and
-manage the size and placement of \fIpathName\fR. The default value
-is \f(CW""\fR.
-.TP
-\fB\-windowheight \fIpixels\fR
-Sets the requested height of the page. The page is the area under the
-tab used to display the page contents. If \fIpixels\fR is \f(CW0\fR,
-the maximum height of all embedded tab windows is used. The default
-is \f(CW0\fR.
-.TP
-\fB\-windowwidth \fIpixels\fR
-Sets the requested width of the page. The page is the area under the
-tab used to display the page contents. If \fIpixels\fR is \f(CW0\fR,
-the maximum width of all embedded tab windows is used. The default
-is \f(CW0\fR.
-.SH "DEFAULT BINDINGS"
-.PP
-BLT automatically generates class bindings that supply tabsets their
-default behaviors. The following event sequences are set by default
-for tabsets (via the class bind tag \f(CWTabset\fR):
-.IP \fB<ButtonPress-2>\fR
-.IP \fB<B2-Motion>\fR
-.IP \fB<ButtonRelease-2>\fR
-Mouse button 2 may be used for scanning.
-If it is pressed and dragged over the tabset, the contents of
-the tabset drag at high speed in the direction the mouse moves.
-.IP \fB<KeyPress-Up>\fR
-.IP \fB<KeyPress-Down>\fR
-The up and down arrow keys move the focus to the tab immediately above
-or below the current focus tab. The tab with focus is drawn
-with the a dashed outline around the tab label.
-.IP \fB<KeyPress-Left>\fR
-.IP \fB<KeyPress-Right>\fR
-The left and right arrow keys move the focus to the tab immediately to the left
-or right of the current focus tab. The tab with focus is drawn
-with the a dashed outline around the tab label.
-.IP \fB<KeyPress-space>\fR
-.IP \fB<KeyPress-Return>\fR
-The space and return keys select the current tab given focus.
-When a folder is selected, it's command is invoked and the
-embedded widget is mapped.
-.PP
-Each tab, by default, also has a set of bindings (via the tag
-\f(CWall\fR). These bindings may be reset using the tabset's
-\fBbind\fR operation.
-.IP \fB<Enter>\fR
-.IP \fB<Leave>\fR
-When the mouse pointer enters a tab, it is activated (i.e. drawn in
-its active colors) and when the pointer leaves, it is redrawn in
-its normal colors.
-.IP \fB<ButtonRelease-1>\fR
-Clicking with the left mouse button on a tab causes the tab to be
-selected and its Tcl script (see the \fB\-command\fR or
-\fB\-selectcommand\fR options) to be invoked. The folder and any embedded
-widget (if one is specified) is automatically mapped.
-.IP \fB<ButtonRelease-3>\fR
-.IP \fB<Control-ButtonRelease-1>\fR
-Clicking on the right mouse button (or the left mouse button with the
-Control key held down) tears off the current page into its own toplevel
-widget. The embedded widget is re-packed into a new toplevel and
-an outline of the widget is drawn in the folder. Clicking again
-(toggling) will reverse this operation and replace the page back in
-the folder.
-.SH "BIND TAGS"
-You can bind commands to tabs that are triggered when a particular
-event sequence occurs in them, much like canvas items in Tk's
-canvas widget. Not all event sequences are valid. The only binding
-events that may be specified are those related to the mouse and
-keyboard (such as \fBEnter\fR, \fBLeave\fR, \fBButtonPress\fR,
-\fBMotion\fR, and \fBKeyPress\fR).
-.PP
-It is possible for multiple bindings to match a particular event.
-This could occur, for example, if one binding is associated with the
-tab name and another is associated with the tab's tags
-(see the \fB\-bindtags\fR option). When this occurs, all the
-matching bindings are invoked. A binding associated with the tab
-name is invoked first, followed by one binding for each of the tab's
-bindtags. If there are multiple matching bindings for a single tag,
-then only the most specific binding is invoked. A continue command
-in a binding script terminates that script, and a break command
-terminates that script and skips any remaining scripts for the event,
-just as for the bind command.
-.PP
-The \fB\-bindtags\fR option for tabs controls addition tag names that
-can be matched. Implicitly the first tag for each tab is its name.
-Setting the value of the \fB\-bindtags\fR option doesn't change this.
-.SH EXAMPLE
-You create a tabset widget with the \fBtabset\fR command.
-.CS
-# Create a new tabset
-tabset .ts -relief sunken -borderwidth 2
-.CE
-A new Tcl command \f(CW.ts\fR is also created. This command can be
-used to query and modify the tabset. For example, to change the
-default font used by all the tab labels, you use the new command and
-the tabset's \fBconfigure\fR operation.
-.CS
-# Change the default font.
-\&.ts configure \-font "fixed"
-.CE
-You can then add folders using the \fBinsert\fR operation.
-.CS
-# Create a new folder "f1"
-\&.ts insert 0 "f1"
-.CE
-This inserts the new tab named "f1" into the tabset. The index
-\f(CW0\fR indicates location to insert the new tab. You can also use
-the index \f(CWend\fR to append a tab to the end of the tabset. By
-default, the text of the tab is the name of the tab. You can change
-this by configuring the \fB\-text\fR option.
-.CS
-# Change the label of "f1"
-\&.ts tab configure "f1" -text "Tab #1"
-.CE
-The \fBinsert\fR operation lets you add one or more folders at a time.
-.CS
-\&.ts insert end "f2" -text "Tab #2" "f3" "f4"
-.CE
-The tab on each folder contains a label. A label may display both
-an image and a text string. You can reconfigure the tab's attributes
-(foreground/background colors, font, rotation, etc) using the \fBtab
-configure\fR operation.
-.CS
-# Add an image to the label of "f1"
-set image [image create photo -file stopsign.gif]
-\&.ts tab configure "f1" -image $image
-\&.ts tab configure "f2" -rotate 90
-.CE
-Each folder may contain an embedded widget to represent its contents.
-The widget to be embedded must be a child of the tabset widget. Using
-the \fB\-window\fR option, you specify the name of widget to be
-embedded. But don't pack the widget, the tabset takes care of placing
-and arranging the widget for you.
-.CS
-graph .ts.graph
-\&.ts tab configure "f1" -window ".ts.graph" \\
- -fill both -padx 0.25i -pady 0.25i
-.CE
-The size of the folder is determined the sizes of the Tk widgets
-embedded inside each folder. The folder will be as wide as the widest
-widget in any folder. The tallest determines the height. You can use
-the tab's \fB\-pagewidth\fR and \fB\-pageheight\fR options override this.
-.PP
-Other options control how the widget appears in the folder. The
-\fB\-fill\fR option says that you wish to have the widget stretch to
-fill the available space in the folder.
-.CS
-\&.ts tab configure "f1" -fill both -padx 0.25i -pady 0.25i
-.CE
-.PP
-Now when you click the left mouse button on "f1", the
-graph will be displayed in the folder. It will be automatically
-hidden when another folder is selected. If you click on the right
-mouse button, the embedded widget will be moved into a toplevel widget
-of its own. Clicking again on the right mouse button puts it back into
-the folder.
-.PP
-If you want to share a page between two different folders, the
-\fB\-command\fR option lets you specify a Tcl command to be invoked
-whenever the folder is selected. You can reset the \fB\-window\fR
-option for the tab whenever it's clicked.
-.CS
-\&.ts tab configure "f2" -command {
- \&.ts tab configure "f2" -window ".ts.graph"
-}
-\&.ts tab configure "f1" -command {
- \&.ts tab configure "f1" -window ".ts.graph"
-}
-.CE
-If you have many folders, you may wish to stack tabs in multiple
-tiers. The tabset's \fB\-tiers\fR option requests a maximum
-number of tiers. The default is one tier.
-.CS
-\&.ts configure -tiers 2
-.CE
-If the tabs can fit in less tiers, the widget will use that many.
-Whenever there are more tabs than can be displayed in the maximum number
-of tiers, the tabset will automatically let you scroll the tabs. You
-can even attach a scrollbar to the tabset.
-.CS
-\&.ts configure -scrollcommand { .sbar set } -scrollincrement 20
-\&.sbar configure -orient horizontal -command { .ts view }
-.CE
-By default tabs are along the top of the tabset from left to right.
-But tabs can be placed on any side of the tabset using the \fB\-side\fR
-option.
-.CS
-# Arrange tabs along the right side of the tabset.
-\&.ts configure -side right -rotate 270
-.CE
-.SH KEYWORDS
-tabset, widget
diff --git a/blt3.0.1/man/tile.mann b/blt3.0.1/man/tile.mann
deleted file mode 100644
index d8717ca..0000000
--- a/blt3.0.1/man/tile.mann
+++ /dev/null
@@ -1,108 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Tile command created by George Howlett.
-'\"
-.so man.macros
-.TH tile n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-tile \- Tiling versions of Tk widgets
-.SH SYNOPSIS
-.sp
-\fBtile::button \fIpathName\fR \fIoption value\fR...
-.sp
-\fBtile::checkbutton \fIpathName\fR \fIoption value\fR...
-.sp
-\fBtile::frame \fIpathName\fR \fIoption value\fR...
-.sp
-\fBtile::label \fIpathName\fR \fIoption value\fR...
-.sp
-\fBtile::radiobutton \fIpathName\fR \fIoption value\fR...
-.sp
-\fBtile::scrollbar \fIpathName\fR \fIoption value\fR...
-.sp
-\fBtile::toplevel \fIpathName\fR \fIoption value\fR...
-.sp
-.BE
-.SH DESCRIPTION
-The tile widgets let you create textured backgrounds. The texture is
-a Tk image which is tiled over the entire background of the widget.
-.SH INTRODUCTION
-With the advent of Tk 4.0, images are now easy to create and use in
-applications. Images add interest to applications and they convey
-more information. But one area where Tk hasn't taken advantage of
-images is using images as textures for widgets. Since tiling is a
-standard feature of windowing systems, it's very easy to use images
-as textures.
-.PP
-The tile widgets take the standard Tk 4.0 widgets and add tiling
-configuration options to them. Textures are specified by the name
-of the image you wish to be tiled across the background of the widget.
-.SH EXAMPLE
-To add tiling to a widget, you simply create an image using
-Tk's \fBimage\fR command and use the image name as the value for
-the \fB\-tile\fR configuration option of the widget.
-.CS
-image create photo my_texture -file tan_paper.gif
-blt::tile::frame .f -tile my_texture
-.CE
-The image \f(CWmy_texture\fR is added to the frame.
-If \f(CWmy_texture\fR is updated, so will the widget background.
-.CS
-image create photo my_texture -file rain.gif
-.CE
-The tile widget commands reside in the "blt::tile" namespace, so
-as not to collide with the normal Tk widgets.
-An easy way to add tiling to existing programs is to import
-the tile widget commands into the global namespace.
-.CS
-image create photo my_texture -file tan_paper.gif
-namespace import -force blt::tile::*
-frame .f -tile my_texture
-.CE
-To use one image for all texturing, you can use the "Tile" option
-class name to specify the same image for all tile widgets.
-.CS
-image create photo my_texture -file tan_paper.gif
-option add *Tile my_texture
-.CE
-.SH OPTIONS
-The following configurations options are added to the widgets. If
-a \fB\-tile\fB or \fB\-activetile\fR option is specified, it overrides
-the background color of the widget.
-.TP
-\fB\-activetile \fIimage\fR
-Specifies a textured background to display when the widget is active.
-This option is available for the \fBtilebutton\fR,
-\fBtilecheckbutton\fR, \fBtileradiobutton\fR, and \fBtilescrollbar\fR
-widgets. \fIImage\fR is the name an image created using Tk's
-\fBimage\fR command. The background of the widget is tiled with
-\fIimage\fR. If \fIimage\fR is \f(CW""\fR, then the active background
-color is displayed. The default is \f(CW""\fR.
-.TP
-\fB\-tile \fIimage\fR
-Specifies a textured background to display for the widget.
-\fIImage\fR is the name an image created using Tk's \fBimage\fR
-command. The background of the widget is tiled with \fIimage\fR. If
-\fIimage\fR is \f(CW""\fR, then the normal background color is
-displayed. The default is \f(CW""\fR.
-.SH KEYWORDS
-tile, texture, button, label, radiobutton, checkbutton, scrollbar, frame, toplevel
diff --git a/blt3.0.1/man/tree.mann b/blt3.0.1/man/tree.mann
deleted file mode 100644
index 93e1836..0000000
--- a/blt3.0.1/man/tree.mann
+++ /dev/null
@@ -1,933 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Lucent Technologies, Inc.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Tree command created by George Howlett.
-'\"
-.so man.macros
-.TH tree n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-\fBtree\fR \- Create and manage tree data objects.
-.SH SYNOPSIS
-\fBblt::tree create \fR?\fItreeName\fR?
-.sp
-\fBblt::tree destroy\fR \fItreeName\fR...
-.sp
-\fBblt::tree names\fR \fR?\fIpattern\fR?
-.BE
-.SH DESCRIPTION
-The \fBtree\fR command creates tree data objects. A \fItree object\fR
-is general ordered tree of nodes. Each node has both a label and a
-key-value list of data. Data can be heterogeneous, since nodes do not
-have to contain the same data keys. It is associated with a Tcl
-command that you can use to access and modify the its structure and
-data. Tree objects can also be managed via a C API.
-.SH INTRODUCTION
-
-.SH EXAMPLE
-
-.SH SYNTAX
-.TP
-\fBblt::tree create\fR ?\fItreeName\fR?
-Creates a new tree object. The name of the new tree is returned. If
-no \fItreeName\fR argument is present, then the name of the tree is
-automatically generated in the form "\f(CWtree0\fR", "\f(CWtree1\fR",
-etc. If the substring "\f(CW#auto\fR" is found in \fItreeName\fR, it
-is automatically substituted by a generated name. For example, the
-name \f(CW.foo.#auto.bar\fR will be translated to \f(CW.foo.tree0.bar\fR.
-.sp
-A new Tcl command (by the same name as the tree) is also created.
-Another Tcl command or tree object can not already exist as
-\fItreeName\fR. If the Tcl command is deleted, the tree will also be
-freed. The new tree will contain just the root node. Trees are by
-default, created in the current namespace, not the global namespace,
-unless \fItreeName\fR contains a namespace qualifier, such as
-"\f(CWfred::myTree\fR".
-.TP
-\fBblt::tree destroy\fR \fItreeName\fR...
-Releases one of more trees. The Tcl command associated with
-\fItreeName\fR is also removed. Trees are reference counted. The
-internal tree data object isn't destroyed until no one else is using
-the tree.
-.TP
-\fBblt::tree names \fR?\fIpattern\fR?
-Returns the names of all tree objects. if a \fIpattern\fR argument
-is given, then the only those trees whose name matches pattern will
-be listed.
-.SH NODE IDS AND TAGS
-Nodes in a tree object may be referred in either of two ways: by id or by
-tag. Each node has a unique serial number or id that is assigned to that
-node when it's created. The id of an node never changes and id numbers
-are not re-used.
-.PP
-A node may also have any number of tags associated with it. A tag is
-just a string of characters, and it may take any form except that of
-an integer. For example, "\f(CWx123\fR" is valid, but "\f(CW123\fR"
-isn't. The same tag may be associated with many different nodes.
-This is commonly done to group nodes in various interesting ways.
-.sp
-There are two built-in tags: The tag \fBall\fR is implicitly
-associated with every node in the tree. It may be used to invoke
-operations on all the nodes in the tree. The tag \fBroot\fR is
-managed automatically by the tree object. It applies to the node
-currently set as root.
-.sp
-When specifying nodes in tree object commands, if the specifier is an
-integer then it is assumed to refer to the single node with that id.
-If the specifier is not an integer, then it is assumed to refer to all
-of the nodes in the tree that have a tag matching the specifier. The
-symbol \fInode\fR is used below to indicate that an argument specifies
-either an id that selects a single node or a tag that selects zero or
-more nodes. Many tree commands only operate on a single node at a
-time; if \fInode\fR is specified in a way that names multiple items, then
-an error "refers to more than one node" is generated.
-.SH NODE MODIFIERS
-You can also specify node in relation to another node by appending one
-or more modifiers to the node id or tag. A modifier refers to a node
-in relation to the specified node. For example,
-"\f(CWroot->firstchild\fR"
-selects the first subtree of the root node.
-.PP
-The following modifiers are available:
-.RS
-.TP 1i
-\fBfirstchild\fR
-Selects the first child of the node.
-.TP 1i
-\fBlastchild\fR
-Selects the last child of the node.
-.TP 1i
-\fBnext\fR
-Selects the next node in preorder to the node.
-.TP 1i
-\fBnextsibling\fR
-Selects the next sibling of the node.
-.TP 1i
-\fBparent\fR
-Selects the parent of the node.
-.TP 1i
-\fBprevious\fR
-Selects the previous node in preorder to the node.
-.TP 1i
-\fBprevsibling\fR
-Selects the previous sibling of the node.
-.TP 1i
-"\fIlabel\fR"
-Selects the node whose label is \fIlabel\fR. Enclosing \fIlabel\fR in
-quotes indicates to always search for a node by its label (for example,
-even if the node is labeled "parent").
-.RE
-.sp
-It's an error the node can't be found. For example,
-\fBlastchild\fR and \fBfirstchild\fR will generate errors if the node
-has no children. The exception to this is the \fBindex\fR operation.
-You can use \fBindex\fR to test if a modifier is valid.
-.SH TREE OPERATIONS
-Once you create a tree object, you can use its Tcl command
-to query or modify it. The
-general form is
-.DS
-\fItreeName\fR \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for trees are listed below.
-.TP
-\fItreeName\fR \fBancestor\fR \fInode1\fR \fInode2\fR
-Returns the mutual ancestor of the two nodes \fInode1\fR and
-\fInode2\fR. The ancestor can be one of the two nodes. For example,
-if \fInode1\fR and \fInode2\fR are the same nodes, their ancestor is
-\fInode1\fR.
-.TP
-\fItreeName\fR \fBapply\fR \fInode\fR ?\fIswitches\fR?
-Runs commands for all nodes matching the criteria given by
-\fIswitches\fR for the subtree designated by \fInode\fR. By default
-all nodes match, but you can set switches to narrow the match. This
-operation differs from \fBfind\fR in two ways: 1) Tcl commands can be
-invoked both pre- and post-traversal of a node and 2) the tree is
-always traversed in depth first order.
-.sp
-The \fB\-exact\fR, \fB\-glob\fR,
-and \fB\-regexp\fR switches indicate both what kind of pattern matching
-to perform and the pattern. By default each pattern will be compared
-with the node label. You can set more than one of these switches. If
-any of the patterns match (logical or), the node matches.
-If the \fB\-key\fR switch is
-used, it designates the data field to be matched.
-.sp
-The valid switches are listed
-below:
-.RS
-.TP 1i
-\fB\-depth\fR \fInumber\fR
-Descend at most \fInumber\fR (a non-negative integer) levels
-If \fInumber\fR is \f(CW1\fR this means only apply the tests
-to the children of \fInode\fR.
-.TP 1i
-\fB\-exact\fR \fIstring\fR
-Matches each node using \fIstring\fR. The node must match \fIstring\fR
-exactly.
-.TP 1i
-\fB\-glob\fR \fIstring\fR
-Test each node to \fIstring\fR using global pattern
-matching. Matching is done in a fashion similar to that used by the
-C-shell.
-.TP 1i
-\fB\-invert\fR
-Select non-matching nodes. Any node that \fIdoesn't\fR match
-the given criteria will be selected.
-.TP 1i
-\fB\-key\fR \fIkey\fR
-If pattern matching is selected (using the \fB\-exact\fR,
-\fB\-glob\fR, or \fB\-regexp\fR switches), compare the values of the
-data field keyed by \fIkey\fR instead of the node's label. If no
-pattern matching switches are set, then any node with this data key
-will match.
-.TP 1i
-\fB\-leafonly\fR
-Only test nodes with no children.
-.TP 1i
-\fB\-nocase\fR
-Ignore case when matching patterns.
-.TP 1i
-\fB\-path\fR
-Use the node's full path when comparing nodes. The node's full
-path is a list of labels, starting from the root of each ancestor
-and the node itself.
-.TP 1i
-\fB\-precommand\fR \fIcommand\fR
-Invoke \fIcommand\fR for each matching node. Before \fIcommand\fR is
-invoked, the id of the node is appended. You can control
-processing by the return value of \fIcommand\fR. If \fIcommand\fR
-generates an error, processing stops and the \fBfind\fR operation
-returns an error. But if \fIcommand\fR returns \fBbreak\fR, then
-processing stops, no error is generated. If \fIcommand\fR returns
-\fBcontinue\fR, then processing
-stops on that subtree and continues on the next.
-.TP 1i
-\fB\-postcommand\fR \fIcommand\fR
-Invoke \fIcommand\fR for each matching node. Before \fIcommand\fR is
-invoked, the id of the node is appended. You can control
-processing by the return value of \fIcommand\fR. If \fIcommand\fR
-generates an error, processing stops and the \fBfind\fR operation
-returns an error. But if \fIcommand\fR returns \fBbreak\fR, then
-processing stops, no error is generated. If \fIcommand\fR returns
-\fBcontinue\fR, then processing
-stops on that subtree and continues on the next.
-.TP 1i
-\fB\-regexp\fR \fIstring\fR
-Test each node using \fIstring\fR as a regular expression pattern.
-.TP 1i
-\fB\-tag\fR \fIstring\fR
-Only test nodes that have the tag \fIstring\fR.
-.RE
-.TP
-\fItreeName\fR \fBattach\fR \fItreeObject\fR ?\fIswitches\fR?
-Attaches to an existing tree object \fItreeObject\fR.
-The current tree associated with \fItreeName\fR is discarded.
-In addition, the current set of tags, notifier events, and traces are
-removed. The valid \fIswitches\fR are listed below:
-.RS
-.TP
-\fB\-newtags\fR
-By default, the tree will share the tags of the attached tree. If this
-flag is present, the tree will start with an empty tag table.
-.RE
-.TP
-\fItreeName\fR \fBchildren\fR \fInode\fR
-Returns a list of children for \fInode\fR. If \fInode\fR is a leaf,
-then an empty string is returned.
-.TP
-\fItreeName\fR \fBcopy\fR \fIparent\fR ?\fItree\fR? \fInode\fR ?\fIswitches\fR?
-Copies \fInode\fR into \fIparent\fR. Both nodes \fInode\fR and
-\fIparent\fR must already exist. The id of the new node is
-returned. You can also copy nodes from another tree. If a \fItree\fR
-argument is present, it indicates the name of the source tree.
-The valid \fIswitches\fR are listed below:
-.RS
-.TP
-\fB\-label\fR \fIstring\fR
-Label \fIdestNode\fR as \fIstring\fR. By default, \fIdestNode\fR has
-the same label as \fIsrcNode\fR.
-.TP
-\fB\-overwrite\fR
-Overwrite nodes that already exist. Normally nodes are always
-created, even if there already exists a node by the same name. This
-switch indicates to add or overwrite the node's data fields.
-.TP
-\fB\-recurse\fR
-Recursively copy all the subtrees of \fIsrcNode\fR as well. In this case,
-\fIsrcNode\fR can't be an ancestor of \fIdestNode\fR as it would result
-in a cyclic copy.
-.TP
-\fB\-tags\fR
-Copy tag inforation. Normally the following node is copied: its
-label and data fields. This indicates to copy tags as well.
-.RE
-.TP
-\fItreeName\fR \fBdegree\fR \fInode\fR
-Returns the number of children of \fInode\fR.
-.TP
-\fItreeName\fR \fBdelete\fR \fInode\fR...
-Recursively deletes one or more nodes from the tree.
-The node and all its descendants are removed. The one exception
-is the root node. In this case, only its descendants are removed.
-The root node will remain. Any tags or
-traces on the nodes are released.
-.TP
-\fItreeName\fR \fBdepth\fR \fInode\fR
-Returns the depth of the node. The depth is the number of
-steps from the node to the root of the tree. The depth of the
-root node is \f(CW0\fR.
-.TP
-\fItreeName\fR \fBdump\fR \fInode\fR
-Returns a list of the paths and respective data for \fInode\fR
-and its descendants. The subtree designated by \fInode\fR is
-traversed returning the following information for each node: 1) the node's
-path relative to \fInode\fR, 2) a sublist key value pairs
-representing the node's data fields, and 3) a sublist of tags.
-This list returned can be used
-later to copy or restore the tree with the \fBrestore\fR operation.
-.TP
-\fItreeName\fR \fBdumpfile\fR \fInode\fR \fIfileName\fR
-Writes a list of the paths and respective data for \fInode\fR
-and its descendants to the given file \fIfileName\fR.
-The subtree designated by \fInode\fR is traversed returning the
-following information for each node: 1) the node's
-path relative to \fInode\fR, 2) a sublist key value pairs
-representing the node's data fields, and 3) a sublist of tags.
-This list returned can be used
-later to copy or restore the tree with the \fBrestore\fR operation.
-.TP
-\fItreeName\fR \fBexists\fR \fInode\fR ?\fIkey\fR?
-Indicates if \fInode\fR exists in the tree. If a \fIkey\fR argument
-is present then the command also indicates if the named data field
-exists.
-.TP
-\fItreeName\fR \fBfind\fR \fInode\fR ?\fIswitches\fR?
-Finds for all nodes matching the criteria given by \fIswitches\fR
-for the subtree designated by \fInode\fR. A list of the selected
-nodes is returned. By default all nodes match, but you can set
-switches to narrow the match.
-.sp
-The \fB\-exact\fR, \fB\-glob\fR,
-and \fB\-regexp\fR switches indicate both what kind of pattern matching
-to perform and the pattern. By default each pattern will be compared
-with the node label. You can set more than one of these switches. If
-any of the patterns match (logical or), the node matches.
-If the \fB\-key\fR switch is
-used, it designates the data field to be matched.
-.sp
-The order in
-which the nodes are traversed is controlled by the \fB\-order\fR switch.
-The possible orderings are \fBpreorder\fR, \fBpostorder\fR, \fBinorder\fR,
-and \fBbreadthfirst\fR. The default is \fBpostorder\fR.
-.sp
-The valid switches are listed
-below:
-.RS
-.TP 1i
-\fB\-addtag\fR \fIstring\fR
-Add the tag \fIstring\fR to each selected node.
-.TP 1i
-\fB\-count\fR \fInumber\fR
-Stop processing after \fInumber\fR (a positive integer) matches.
-.TP 1i
-\fB\-depth\fR \fInumber\fR
-Descend at most \fInumber\fR (a non-negative integer) levels
-If \fInumber\fR is \f(CW1\fR this means only apply the tests
-to the children of \fInode\fR.
-.TP 1i
-\fB\-exact\fR \fIstring\fR
-Matches each node using \fIstring\fR. The node must match \fIstring\fR
-exactly.
-.TP 1i
-\fB\-excludes\fR \fInodeList\fR
-Excludes any node in the list \fInodeList\fR from the search.
-The subnodes of an excluded node are still examined.
-.TP 1i
-\fB\-exec\fR \fIcommand\fR
-Invoke \fIcommand\fR for each matching node. Before \fIcommand\fR is
-invoked, the id of the node is appended. You can control
-processing by the return value of \fIcommand\fR. If \fIcommand\fR
-generates an error, processing stops and the \fBfind\fR operation
-returns an error. But if \fIcommand\fR returns \fBbreak\fR, then
-processing stops, no error is generated. If \fIcommand\fR returns
-\fBcontinue\fR, then processing
-stops on that subtree and continues on the next.
-.TP 1i
-\fB\-glob\fR \fIstring\fR
-Test each node to \fIstring\fR using global pattern
-matching. Matching is done in a fashion similar to that used by the
-C-shell.
-.TP 1i
-\fB\-invert\fR
-Select non-matching nodes. Any node that \fIdoesn't\fR match
-the given criteria will be selected.
-.TP 1i
-\fB\-key\fR \fIkey\fR
-Compare the values of the data field keyed by \fIkey\fR instead of
-the node's label. If no pattern is given (\fB\-exact\fR, \fB\-glob\fR, or
-\fB\-regexp\fR switches), then any node with this data key will match.
-.TP 1i
-\fB\-leafonly\fR
-Only test nodes with no children.
-.TP 1i
-\fB\-nocase\fR
-Ignore case when matching patterns.
-.TP
-\fB\-order\fR \fIstring\fR
-Traverse the tree and process nodes according to \fIstring\fR. \fIString\fR
-can be one of the following:
-.RS
-.TP 1i
-\fBbreadthfirst\fR
-Process the node and the subtrees at each sucessive level. Each node
-on a level is processed before going to the next level.
-.TP 1i
-\fBinorder\fR
-Recursively process the nodes of the first subtree, the node itself,
-and any the remaining subtrees.
-.TP 1i
-\fBpostorder\fR
-Recursively process all subtrees before the node.
-.TP 1i
-\fBpreorder\fR
-Recursively process the node first, then any subtrees.
-.RE
-.TP
-\fB\-path\fR
-Use the node's full path when comparing nodes.
-.TP
-\fB\-regexp\fR \fIstring\fR
-Test each node using \fIstring\fR as a regular expression pattern.
-.TP
-\fB\-tag\fR \fIstring\fR
-Only test nodes that have the tag \fIstring\fR.
-.RE
-.TP
-\fItreeName\fR \fBfindchild\fR \fInode\fR \fIlabel\fR
-Searches for a child node \Ilabel\fR in \fInode\fR. The id of the
-child node is returned if found. Otherwise \f(CW-1\fR is returned.
-.TP
-\fItreeName\fR \fBfirstchild\fR \fInode\fR
-Returns the id of the first child in the \fInode\fR's list
-of subtrees. If \fInode\fR is a leaf (has no children),
-then \f(CW-1\fR is returned.
-.TP
-\fItreeName\fR \fBget\fR \fInode\fR ?\fIkey\fR? ?\fIdefaultValue\fR?
-Returns a list of key-value pairs of data for the node. If \fIkey\fR
-is present, then onlyx the value for that particular data field is
-returned. It's normally an error if \fInode\fR does not contain the
-data field \fIkey\fR. But if you provide a \fIdefaultValue\fR
-argument, this value is returned instead (\fInode\fR will still not
-contain \fIkey\fR). This feature can be used to access a data field of
-\fInode\fR without first testing if it exists. This operation may
-trigger \fBread\fR data traces.
-.TP
-\fItreeName\fR \fBindex\fR \fInode\fR
-Returns the id of \fInode\fR. If \fInode\fR is a tag, it
-can only specify one node. If \fInode\fR does not represent a valid
-node id or tag, or has modifiers that are invalid, then \f(CW-1\fR is returned.
-.TP
-\fItreeName\fR \fBinsert\fR \fIparent\fR ?\fIswitches\fR?
-Inserts a new node into parent node \fIparent\fR.
-The id of the new node is returned. The following switches
-are available:
-.RS
-.TP 1i
-\fB\-after\fR \fIchild\fR
-Position \fInode\fR after \fIchild\fR. The node \fIchild\fR must be a
-child of \fIparent\fR.
-.TP 1i
-\fB\-at\fR \fInumber\fR
-Inserts the node into \fIparent\fR's list of children at
-position \fInumber\fR. The default is to append \fInode\fR.
-.TP 1i
-\fB\-before\fR \fIchild\fR
-Position \fInode\fR before \fIchild\fR. The node \fIchild\fR must be a
-child of \fIparent\fR.
-.TP 1i
-\fB\-data\fR \fIdataList\fR
-Sets the value for each data field in \fIdataList\fR for the
-new node. \fIDataList\fR is a list of key-value pairs.
-.TP 1i
-\fB\-label\fR \fIstring\fR
-Designates the labels of the node as \fIstring\fR. By default, nodes
-are labeled as \f(CWnode0\fR, \f(CWnode1\fR, etc.
-.TP 1i
-\fB\-node\fR \fIid\fR
-Designates the id for the node. Normally new ids are automatically
-generated. This allows you to create a node with a specific id.
-It is an error if the id is already used by another node in the tree.
-.TP 1i
-\fB\-tags\fR \fItagList\fR
-Adds each tag in \fItagList\fR to the new node. \fITagList\fR is a list
-of tags, so be careful if a tag has embedded spaces.
-.RE
-.TP
-\fItreeName\fR \fBis\fR \fIproperty\fR \fIargs\fR
-Indicates the property of a node. Both \fIproperty\fR and \fIargs\fR
-determine the property being tested. Returns \f(CW1\fR if true and
-\f(CW0\fR otherwise. The following \fIproperty\fR and \fIargs\fR
-are valid:
-.RS
-.TP 1i
-\fBancestor\fR \fInode1\fR \fInode2\fR
-Indicates if \fInode1\fR is an ancestor of \fInode2\fR.
-.TP 1i
-\fBbefore\fR \fInode1\fR \fInode2\fR
-Indicates if \fInode1\fR is before \fInode2\fR in depth first traversal.
-.TP 1i
-\fBleaf\fR \fInode\fR
-Indicates if \fInode\fR is a leaf (it has no subtrees).
-.TP 1i
-\fBroot\fR \fInode\fR
-Indicates if \fInode\fR is the designated root. This can be changed
-by the \fBroot\fR operation.
-.RE
-.TP
-\fItreeName\fR \fBlabel\fR \fInode\fR ?\fInewLabel\fR?
-Returns the label of the node designated by \fInode\fR. If \fInewLabel\fR
-is present, the node is relabeled using it as the new label.
-.TP
-\fItreeName\fR \fBlastchild\fR \fInode\fR
-Returns the id of the last child in the \fInode\fR's list
-of subtrees. If \fInode\fR is a leaf (has no children),
-then \f(CW-1\fR is returned.
-.TP
-\fItreeName\fR \fBmove\fR \fInode\fR \fInewParent\fR ?\fIswitches\fR?
-Moves \fInode\fR into \fInewParent\fR. \fINode\fR is appended to the
-list children of \fInewParent\fR. \fINode\fR can not be an ancestor
-of \fInewParent\fR. The valid flags for \fIswitches\fR are described below.
-.RS
-.TP 1i
-\fB\-after\fR \fIchild\fR
-Position \fInode\fR after \fIchild\fR. The node \fIchild\fR must be a
-child of \fInewParent\fR.
-.TP 1i
-\fB\-at\fR \fInumber\fR
-Inserts \fInode\fR into \fIparent\fR's list of children at
-position \fInumber\fR. The default is to append the node.
-.TP 1i
-\fB\-before\fR \fIchild\fR
-Position \fInode\fR before \fIchild\fR. The node \fIchild\fR must be a
-child of \fInewParent\fR.
-.RE
-.TP
-\fItreeName\fR \fBnext\fR \fInode\fR
-Returns the next node from \fInode\fR in a preorder traversal.
-If \fInode\fR is the last node in the tree,
-then \f(CW-1\fR is returned.
-.TP
-\fItreeName\fR \fBnextsibling\fR \fInode\fR
-Returns the node representing the next subtree from \fInode\fR
-in its parent's list of children. If \fInode\fR is the last child,
-then \f(CW-1\fR is returned.
-.TP
-\fItreeName\fR \fBnotify\fR \fIargs\fR
-Manages notification events that indicate that the tree structure has
-been changed.
-See the
-.SB "NOTIFY OPERATIONS"
-section below.
-.TP
-\fItreeName\fR \fBparent\fR \fInode\fR
-Returns the parent node of \fInode\fR. If \fInode\fR is the root
-of the tree,
-then \f(CW-1\fR is returned.
-.TP
-\fItreeName\fR \fBpath\fR \fInode\fR
-Returns the full path (from root) of \fInode\fR.
-.TP
-\fItreeName\fR \fBposition\fR \fInode\fR
-Returns the position of the node in its parent's list of children.
-Positions are numbered from 0.
-The position of the root node is always 0.
-.TP
-\fItreeName\fR \fBprevious\fR \fInode\fR
-Returns the previous node from \fInode\fR in a preorder traversal.
-If \fInode\fR is the root of the tree,
-then \f(CW-1\fR is returned.
-.TP
-\fItreeName\fR \fBprevsibling\fR \fInode\fR
-Returns the node representing the previous subtree from \fInode\fR
-in its parent's list of children. If \fInode\fR is the first child,
-then \f(CW-1\fR is returned.
-.TP
-\fItreeName\fR \fBrestore\fR \fInode\fR \fIdataString\fR \fIswitches\fR
-Performs the inverse function of the \fBdump\fR operation, restoring
-nodes to the tree. The format of \fIdataString\fR is exactly what is
-returned by the \fBdump\fR operation. It's a list containing information
-for each node to be restored. The information consists of 1) the relative
-path of the node, 2) a sublist of key value pairs representing the
-node's data, and 3) a list of tags for the node. Nodes are created
-starting from \fInode\fR. Nodes can be listed in any order. If a node's
-path describes ancestor nodes that do not already exist, they are
-automatically created. The valid \fIswitches\fR are listed below:
-.RS
-.TP
-\fB\-overwrite\fR
-Overwrite nodes that already exist. Normally nodes are always
-created, even if there already exists a node by the same name. This
-switch indicates to add or overwrite the node's data fields.
-.RE
-.TP
-\fItreeName\fR \fBrestorefile\fR \fInode\fR \fIfileName\fR \fIswitches\fR
-Performs the inverse function of the \fBdumpfile\fR operation, restoring
-nodes to the tree from the file \fIfileName\fR. The format of
-\fIfileName\fR is exactly what is returned by the \fBdumpfile\fR operation.
-It's a list containing information for each node to be restored.
-The information consists of 1) the relative path of the node, 2)
-a sublist of key value pairs representing the node's data, and 3)
-a list of tags for the node. Nodes are created
-starting from \fInode\fR. Nodes can be listed in any order. If a node's
-path describes ancestor nodes that do not already exist, they are
-automatically created. The valid \fIswitches\fR are listed below:
-.RS
-.TP
-\fB\-overwrite\fR
-Overwrite nodes that already exist. Normally nodes are always
-created, even if there already exists a node by the same name. This
-switch indicates to add or overwrite the node's data fields.
-.RE
-.TP
-\fItreeName\fR \fBroot\fR ?\fInode\fR?
-Returns the id of the root node. Normally this is node \f(CW0\fR. If
-a \fInode\fR argument is provided, it will become the new root of the
-tree. This lets you temporarily work within a subset of the tree.
-Changing root affects operations such as \fBnext\fR, \fBpath\fR,
-\fBprevious\fR, etc.
-.TP
-\fItreeName\fR \fBset\fR \fInode\fR \fIkey value\fR ?\fIkey value\fR...?
-Sets one or more data fields in \fInode\fR. \fINode\fR may
-be a tag that represents several nodes. \fIKey\fR is the
-name of the data field to be set and \fIvalue\fR is its respective
-value. This operation may trigger \fBwrite\fR and \fBcreate\fR data traces.
-.TP
-\fItreeName\fR \fBsize\fR \fInode\fR
-Returns the number of nodes in the subtree. This includes the node
-and all its descendants. The size of a leaf node is 1.
-.TP
-\fItreeName\fR \fBsort\fR \fInode\fR ?\fIswitches\fR?
-.RS
-.TP 1i
-\fB\-ascii\fR
-Compare strings using the ASCII collation order.
-.TP 1i
-\fB\-command\fR \fIstring\fR
-Use command \fIstring\fR as a comparison command. To compare two
-elements, evaluate a Tcl script consisting of command with the two
-elements appended as additional arguments. The script should return
-an integer less than, equal to, or greater than zero if the first
-element is to be considered less than, equal to, or greater than the
-second, respectively.
-.TP 1i
-\fB\-decreasing\fR
-Sort in decreasing order (largest items come first).
-.TP 1i
-\fB\-dictionary\fR
-Compare strings using a dictionary-style comparison. This is the same
-as \fB\-ascii\fR except (a) case is ignored except as a tie-breaker and (b)
-if two strings contain embedded numbers, the numbers compare as integers, not
-characters. For example, in \fB\-dictionary\fR mode, bigBoy sorts between
-bigbang and bigboy, and x10y sorts between x9y and x11y.
-.TP 1i
-\fB\-integer\fR
-Compare the nodes as integers.
-.TP 1i
-\fB\-key\fR \fIstring\fR
-Sort based upon the node's data field keyed by \fIstring\fR. Normally
-nodes are sorted according to their label.
-.TP 1i
-\fB\-path\fR
-Compare the full path of each node. The default is to compare only its
-label.
-.TP 1i
-\fB\-real\fR
-Compare the nodes as real numbers.
-.TP 1i
-\fB\-recurse\fR
-Recursively sort the entire subtree rooted at \fInode\fR.
-.TP 1i
-\fB\-reorder\fR
-Recursively sort subtrees for each node. \fBWarning\fR. Unlike
-the normal flat sort, where a list of nodes is returned, this will
-reorder the tree.
-.RE
-.TP
-\fItreeName\fR \fBtag\fR \fIargs\fR
-Manages tags for the tree object.
-See the
-.SB "TAG OPERATIONS"
-section below.
-.TP
-\fItreeName\fR \fBtrace\fR \fIargs\fR
-Manages traces for data fields in the tree object.
-Traces cause Tcl commands to be executed whenever a data field of a
-node is created, read, written, or unset. Traces can be set for a
-specific node or a tag, representing possibly many nodes.
-See the
-.SB "TRACE OPERATIONS"
-section below.
-.TP
-\fItreeName\fR \fBunset\fR \fInode\fR \fIkey\fR...
-Removes one or more data fields from \fInode\fR. \fINode\fR may
-be a tag that represents several nodes. \fIKey\fR is the
-name of the data field to be removed. It's not an error is
-\fInode\fR does not contain \fIkey\fR.
-This operation may trigger \fBunset\fR data traces.
-.RE
-.SH TAG OPERATIONS
-Tags are a general means of selecting and marking nodes in the tree.
-A tag is just a string of characters, and it may take any form except
-that of an integer. The same tag may be associated with many
-different nodes.
-.sp
-There are two built-in tags: The tag \fBall\fR is implicitly
-associated with every node in the tree. It may be used to invoke
-operations on all the nodes in the tree. The tag \fBroot\fR is
-managed automatically by the tree object. It specifies the node
-that is currently set as the root of the tree.
-.sp
-Most tree operations use tags. And several operations let you
-operate on multiple nodes at once. For example, you can use the
-\fBset\fR operation with the tag \fBall\fR to set a data field in
-for all nodes in the tree.
-.PP
-Tags are invoked by the \fBtag\fR operation. The
-general form is
-.DS
-\fItreeName\fR \fBtag\fR \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for tags are listed below.
-.TP
-\fItreeName\fR \fBtag add\fR \fIstring\fR \fInode\fR...
-Adds the tag \fIstring\fR to one of more nodes.
-.TP
-\fItreeName\fR \fBtag delete\fR \fIstring\fR \fInode\fR...
-Deletes the tag \fIstring\fR from one or more nodes.
-.TP
-\fItreeName\fR \fBtag forget\fR \fIstring\fR
-Removes the tag \fIstring\fR from all nodes. It's not an error if no
-nodes are tagged as \fIstring\fR.
-.TP
-\fItreeName\fR \fBtag get\fR \fInode\fR \fIpattern\fR...
-Returns the tag names for a given node. If one of more pattern
-arguments are provided, then only those matching tags are returned.
-.TP
-\fItreeName\fR \fBtag names\fR ?\fInode\fR?
-Returns a list of tags used by the tree. If a \fInode\fR argument
-is present, only those tags used by \fInode\fR are returned.
-.TP
-\fItreeName\fR \fBtag nodes\fR \fIstring\fR
-Returns a list of nodes that have the tag \fIstring\fR. If no node
-is tagged as \fIstring\fR, then an empty string is returned.
-.TP
-\fItreeName\fR \fBtag set\fR \fInode\fR \fIstring\fR...
-Sets one or more tags for a given node. Tag names can't start with a
-digit (to distinquish them from node ids) and can't be a reserved tag
-("root" or "all").
-.TP
-\fItreeName\fR \fBtag unset\fR \fInode\fR \fIstring\fR...
-Removes one or more tags from a given node. Tag names that don't exist
-or are reserved ("root" or "all") are silently ignored.
-.SH TRACE OPERATIONS
-Data fields can be traced much in the same way that you can trace Tcl
-variables. Data traces cause Tcl commands to be executed whenever a
-particular data field of a node is created, read, written, or unset.
-A trace can apply to one or more nodes. You can trace a specific node
-by using its id, or a group of nodes by a their tag.
-.PP
-The tree's \fBget\fR, \fBset\fR, and \fBunset\fR operations can
-trigger various traces. The \fBget\fR operation can cause
-a \fIread\fR trace to fire. The \fBset\fR operation causes a \fIwrite\fR
-trace to fire. And if the data field is written for the first time, you
-will also get a \fIcreate\fR trace.
-The \fBunset\fR operation triggers \fIunset\fR traces.
-.PP
-Data traces are invoked by the \fBtrace\fR
-operation. The general form is
-.DS
-\fItreeName\fR \fBtrace\fR \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for traces are listed below.
-.TP
-\fItreeName\fR \fBtrace create\fR \fInode\fR \fIkey\fR \fIops\fR \fIcommand\fR
-Creates a trace for \fInode\fR on data field \fIkey\fR. \fINode\fR
-can refer to more than one node (for example, the tag \fBall\fR). If
-\fInode\fR is a tag, any node with that tag can possibly trigger a trace,
-invoking \fIcommand\fR.
-\fICommand\fR is command prefix, typically a procedure name.
-Whenever a trace is triggered, four arguments are appended to
-\fIcommand\fR before it is invoked: \fItreeName\fR, id of the
-node, \fIkey\fR and, \fIops\fR.
-Note that no nodes need have the field \fIkey\fR.
-A trace identifier in the form "\f(CWtrace0\fR", "\f(CWtrace1\fR", etc.
-is returned.
-.sp
-\fIOps\fR indicates which operations are of
-interest, and consists of one or more of the following letters:
-.RS
-.TP
-\fBr\fR
-Invoke \fIcommand\fR whenever \fIkey\fR is read. Both read and
-write traces are temporarily disabled when \fIcommand\fR is executed.
-.TP
-\fBw\fR
-Invoke \fIcommand\fR whenever \fIkey\fR is written. Both read and
-write traces are temporarily disabled when \fIcommand\fR is executed.
-.TP
-\fBc\fR
-Invoke \fIcommand\fR whenever \fIkey\fR is created.
-.TP
-\fBu\fR
-Invoke \fIcommand\fR whenever \fIkey\fR is unset. Data fields are
-typically unset with the \fBunset\fR command. Data fields are also
-unset when the tree is released, but all traces are disabled prior
-to that.
-.sp
-.RE
-.TP
-\fItreeName\fR \fBtrace delete\fR \fItraceId\fR...
-Deletes one of more traces. \fITraceId\fR is
-the trace identifier returned by the \fBtrace create\fR operation.
-.TP
-\fItreeName\fR \fBtrace info\fR \fItraceId\fR
-Returns information about the trace \fItraceId\fR. \fITraceId\fR
-is a trace identifier previously returned by the \fBtrace create\fR operation.
-It's the same information specified for the \fBtrace create\fR operation.
-It consists of the node id or tag, data field key, a string of letters
-indicating the operations that are traced (it's in the same
-form as \fIops\fR) and, the command prefix.
-.TP
-\fItreeName\fR \fBtrace names\fR
-Returns a list of identifers for all the current traces.
-.SH NOTIFY OPERATIONS
-Tree objects can be shared among many clients, such as a
-\fBhiertable\fR widget. Any client can create or delete nodes,
-sorting the tree, etc. You can request to be notified whenever these
-events occur. Notify events cause Tcl commands to be executed
-whenever the tree structure is changed.
-.PP
-Notifications are handled by the \fBnotify\fR operation. The
-general form is
-.DS
-\fItreeName\fR \fBnotify\fR \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for events are listed below.
-.TP
-\fItreeName\fR \fBnotify create\fR ?\fIswitches\fR? \fIcommand\fR \fR?\fIargs\fR?...
-Creates a notifier for the tree. A notify identifier in the form
-"\f(CWnotify0\fR", "\f(CWnotify1\fR", etc. is returned.
-.sp
-\fICommand\fR and \fIargs\fR are saved and invoked whenever the tree
-structure is changed (according to \fIswitches\fR). Two arguments are
-appended to \fIcommand\fR and \fIargs\fR before it's invoked: the id
-of the node and a string representing the type of event that occured.
-One of more switches can be set to indicate the events that are of
-interest. The valid switches are as follows:
-.RS
-.TP 1i
-\fB\-create\fR
-Invoke \fIcommand\fR whenever a new node has been added.
-.TP 1i
-\fB\-delete\fR
-Invoke \fIcommand\fR whenever a node has been deleted.
-.TP 1i
-\fB\-move\fR
-Invoke \fIcommand\fR whenever a node has been moved.
-.TP 1i
-\fB\-sort\fR
-Invoke \fIcommand\fR whenever the tree has been sorted and reordered.
-.TP 1i
-\fB\-relabel\fR
-Invoke \fIcommand\fR whenever a node has been relabeled.
-.TP 1i
-\fB\-allevents\fR
-Invoke \fIcommand\fR whenever any of the above events occur.
-.TP 1i
-\fB\-whenidle\fR
-When an event occurs don't invoke \fIcommand\fR immediately, but
-queue it to be run the next time the event loop is entered and there
-are no events to process. If subsequent events occur before
-the event loop is entered, \fIcommand\fR will still be
-invoked only once.
-.RE
-.TP
-\fItreeName\fR \fBnotify delete\fR \fInotifyId\fR
-Deletes one or more notifiers from the tree. \fINotifyId\fR is the
-notifier identifier returned by the \fBnotify create\fR operation.
-.TP
-\fItreeName\fR \fBnotify info\fR \fInotifyId\fR
-Returns information about the notify event \fInotifyId\fR. \fINotifyId\fR
-is a notify identifier previously returned by the \fBnotify create\fR operation.
-It's the same information specified for the \fBnotify create\fR operation.
-It consists of the notify id, a sublist of event flags (it's in the same
-form as \fIflags\fR) and, the command prefix.
-.TP
-\fItreeName\fR \fBnotify names\fR
-Returns a list of identifers for all the current notifiers.
-.SH C LANGUAGE API
-Blt_TreeApply,
-Blt_TreeApplyBFS,
-Blt_TreeApplyDFS,
-Blt_TreeChangeRoot,
-Blt_TreeCreate,
-Blt_TreeCreateEventHandler,
-Blt_TreeCreateNode,
-Blt_TreeCreateTrace,
-Blt_TreeDeleteEventHandler,
-Blt_TreeDeleteNode,
-Blt_TreeDeleteTrace,
-Blt_TreeExists,
-Blt_TreeFindChild,
-Blt_TreeFirstChild,
-Blt_TreeFirstKey,
-Blt_TreeGetNode,
-Blt_TreeGetToken,
-Blt_TreeGetValue,
-Blt_TreeIsAncestor,
-Blt_TreeIsBefore,
-Blt_TreeIsLeaf,
-Blt_TreeLastChild,
-Blt_TreeMoveNode,
-Blt_TreeName,
-Blt_TreeNextKey,
-Blt_TreeNextNode,
-Blt_TreeNextSibling,
-Blt_TreeNodeDegree,
-Blt_TreeNodeDepth,
-Blt_TreeNodeId,
-Blt_TreeNodeLabel,
-Blt_TreeNodeParent,
-Blt_TreePrevNode,
-Blt_TreePrevSibling,
-Blt_TreeRelabelNode,
-Blt_TreeReleaseToken,
-Blt_TreeRootNode,
-Blt_TreeSetValue,
-Blt_TreeSize,
-Blt_TreeSortNode, and
-Blt_TreeUnsetValue.
-.SH KEYWORDS
-tree, hiertable, widget
diff --git a/blt3.0.1/man/treeview.mann b/blt3.0.1/man/treeview.mann
deleted file mode 100644
index f172f37..0000000
--- a/blt3.0.1/man/treeview.mann
+++ /dev/null
@@ -1,2264 +0,0 @@
-'\"
-'\" Copyright 2001-2 by Silicon Metrics Corporation.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Silicon Metrics or any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Silicon Metrics disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Silicon Metrics be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" The hierarchical table widget created by George Howlett.
-'\"
-.so man.macros
-.TH treeview n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-\fBtreeview\fR \- Create and manipulate hierarchical table widgets
-.BE
-.SH SYNOPSIS
-\fBblt::treeview\fR \fIpathName \fR?\fIoptions\fR?
-.SH DESCRIPTION
-The \fBtreeview\fR widget displays a tree of data. It replaces both
-the \fBhiertable\fR and \fBhierbox\fR widgets. The \fBtreeview\fR is
-100% syntax compatible with the \fBhiertable\fR widget. The
-\fBhiertable\fR command is retained for sake of script-level
-compatibility. This widget obsoletes the \fBhierbox\fR widget. It
-does everything the old \fBhierbox\fR widget did, but also provides
-data sharing (via \fItree data objects\fR) and the ability to tag
-nodes.
-.SH INTRODUCTION
-The \fBtreeview\fR widget displays hierarchical data. Data is
-represented as nodes in a general-ordered tree. Each node may have
-sub-nodes and these nodes can in turn has their own children.
-.PP
-A node is displayed as a row entry in the widget. Each entry has a
-text label and icon. When a node has children, its entry is drawn
-with a small button to the left of the label. Clicking the mouse over
-this button opens or closes the node. When a node is \fIopen\fR, its
-children are exposed. When it is \fIclosed\fR, the children and their
-descedants are hidden. The button is normally a \f(CW+\fR or
-\f(CW\-\fR symbol (ala Windows Explorer), but can be replaced with a
-pair of Tk images (open and closed images).
-.PP
-If the node has data associated with it, they can be displayed in
-columns running vertically on either side the tree. You can control
-the color, font, etc of each entry. Any entry label or data field can
-be edited in-place.
-.SH "TREE DATA OBJECT"
-The tree is not stored inside the widget but in a tree data object
-(see the \fBtree\fR command for a further explanation). Tree data
-objects can be shared among different clients, such as a
-\fBtreeview\fR widget or the \fBtree\fR command. You can walk the
-tree and manage its data with the \fBtree\fR command tree, while
-displaying it with the \fBtreeview\fR widget. Whenever the tree is
-updated, the \fBtreeview\fR widget is automatically redrawn.
-.PP
-By default, the \fBtreeview\fR widget creates its own tree object.
-The tree initially contains just a root node. But you can also
-display trees created by the \fBtree\fR command using the \fB\-tree\fR
-configuration option. \fBTreeview\fR widgets can share the same tree
-object, possibly displaying different views of the same data.
-.PP
-A tree object has both a Tcl and C API. You can insert or delete
-nodes using \fBtreeview\fR widget or \fBtree\fR command operations,
-but also from C code. For example, you can load the tree from your C
-code while still managing and displaying the tree from Tcl. The widget
-is automatically notified whenever the tree is modified via C or Tcl.
-.SH SYNTAX
-.DS
-\fBblt::treeview \fIpathName \fR?\fIoption value\fR?...
-.DE
-The \fBtreeview\fR command creates a new window \fIpathName\fR and
-makes it into a \fBtreeview\fR widget. At the time this command is
-invoked, there must not exist a window named \fIpathName\fR, but
-\fIpathName\fR's parent must exist. Additional options may be
-specified on the command line or in the option database to configure
-aspects of the widget such as its colors and font. See the
-\fBconfigure\fR operation below for the exact details about what
-\fIoption\fR and \fIvalue\fR pairs are valid.
-.PP
-If successful, \fBtreeview\fR returns the path name of the widget. It
-also creates a new Tcl command by the same name. You can use this
-command to invoke various operations that query or modify the widget.
-The general form is:
-.DS
-\fIpathName \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available are described in the
-.SB "TREEVIEW OPERATIONS"
-section.
-.SH "IDS AND TAGS"
-Nodes can be inserted into a tree using the \fBtreeview\fR widget
-.CS
-blt::treeview .t
-set node [.t insert end root "one"]
-.CE
-or \fBtree\fR command.
-.CS
-set tree [blt::tree create]
-set node [$tree insert root "one"]
-.CE
-In both cases, a number identifying the node is returned (the value of
-\f(CW$node\fR). This serial number or \fIid\fR uniquely identifies
-the node. Please note that you can't infer a location or position of
-a node from its id. The only exception is that the root node is
-always id \f(CW0\fR. Since nodes may have the same labels or be moved
-within the tree, ids provide an convenient way to identify nodes. If
-a tree is shared, the ids will be the same regardless if you are using
-by the \fBtreeview\fR widget or the \fBtree\fR command. Ids are
-recycled when the node deleted.
-.PP
-A node may also have any number of \fItags\fR associated with it. A
-tag is just a string of characters, and it may take any form except
-that of an integer. For example, "\f(CWx123\fR" is valid, but
-"\f(CW123\fR" isn't. The same tag may be associated with many
-different nodes. This is typically done to associate a group of
-nodes. Many operations in the \fBtreeview\fR widget take either node
-ids or tag names as arguments. Using a tag says to apply the operation
-to all nodes with that tag.
-.PP
-The tag \fBall\fR is implicitly associated with every node in
-the tree. It may be used to invoke operations on all the nodes in the
-tree.
-.PP
-Tags may be shared, just like trees, between clients. For example,
-you can use the tags created by the \fBtree\fR command with
-\fBtreeview\fR widgets.
-.SH SPECIAL NODE IDS
-There are also several special non-numeric ids. Special ids differ
-from tags in that they are always translated to their numeric
-equivalent. They also take precedence over tags. For example, you
-can't use a tag name that is a special id. These ids are specific to
-the \fBtreeview\fR widget.
-.TP 15
-\fBactive\fR
-The node where the mouse pointer is currently located.
-When a node is active, it is drawn using its active icon
-(see the \fB\-activeicon\fR option).
-The \fBactive\fR id is changed automatically by moving the mouse
-pointer over another node or by using the \fBentry activate\fR
-operation. Note that there can be only one active node at a time.
-.TP 15
-\fBanchor\fR
-The node representing the fixed end of the current selection.
-The anchor is set by the \fBselection anchor\fR operation.
-.TP 15
-\fBcurrent\fR
-The node where the mouse pointer is currently located.
-But unlike \fBactive\fR, this id changes while the
-selection is dragged. It is used to determine the
-current node during button drags.
-.TP 15
-\fBdown\fR
-The next open node from the current focus. The \fBdown\fR of
-the last open node is the same.
-.TP 15
-\fBend\fR
-The last open node (in depth-first order) on the tree.
-.TP 15
-\fBfocus\fR
-The node that currently has focus. When a node has focus,
-it receives key events. To indicate focus, the node
-is drawn with a dotted line around its label. You can change the
-focus using the \fBfocus\fR operation.
-.TP 15
-\fBlast\fR
-The last open node from the current focus. But unlike \fBup\fR,
-when the focus is at root, \fBlast\fR wraps around to the last
-open node in the tree.
-.TP 15
-\fBmark\fR
-The node representing the non-fixed end of the current selection.
-The mark is set by the \fBselection mark\fR operation.
-.TP 15
-\fBnext\fR
-The next open node from the current focus. But unlike \fBdown\fR,
-when the focus is on last open node, \fBnext\fR wraps around to the
-root node.
-.TP 15
-\fBnextsibling\fR
-The next sibling from the node with the current focus. If the node
-is already the last sibling then it is the \fBnextsibling\fB.
-.TP 15
-\fBparent\fR
-The parent of the node with the current focus. The \fBparent\fR
-of the root is also the root.
-.TP 15
-\fBprevsibling\fR
-The previous sibling from the node with the current focus. If the node
-is already the first sibling then it is the \fBprevsibling\fB.
-.TP 15
-\fBroot\fR
-The root node. You can also use id \f(CW0\fR to indicate
-the root.
-.TP 15
-\fBup\fR
-The last open node (in depth-first order) from the current focus. The
-\fBup\fR of the root node (i.e. the root has focus) is also the root.
-.TP 15
-\fBview.top\fR
-First node that's current visible in the widget.
-.TP 15
-\fBview.bottom\fR
-Last node that's current visible in the widget.
-.TP 15
-\fB@\fIx\fB,\fIy\fR
-Indicates the node that covers the point in the treeview window
-specified by \fIx\fR and \fIy\fR (in pixel coordinates). If no
-part of the entryd covers that point, then the closest node to that
-point is used.
-.PP
-A node may be specified as an id or tag. If the specifier is an
-integer then it is assumed to refer to the single node with that id.
-If the specifier is not an integer, it's checked to see if it's a
-special id (such as focus). Otherwise, it's assumed to be tag. Some
-operations only operate on a single node at a time; if a tag refers to
-more than one node, then an error is generated.
-.SH DATA FIELDS
-A node in the tree can have \fIdata fields\fR. A data field is a
-name-value pair, used to represent arbitrary data in the node. Nodes
-can contain different fields (they aren't required to contain the same
-fields). You can optionally display these fields in the
-\fBtreeview\fR widget in columns running on either side of the
-displayed tree. A node's value for the field is drawn in the column
-along side its node in the hierarchy. Any node that doesn't have a
-specific field is left blank. Columns can be interactively resized,
-hidden, or, moved.
-.SH ENTRY BINDINGS
-You can bind Tcl commands to be invoked when events occur on nodes
-(much like Tk canvas items). You can bind a node using its id or
-its \fIbindtags\fR. Bindtags are simply names that associate a
-binding with one or more nodes. There is a built-in tag \f(CWall\fR
-that all node entries automatically have.
-.SH "TREEVIEW OPERATIONS"
-The \fBtreeview\fR operations are the invoked by specifying
-the widget's pathname, the operation, and any arguments that pertain
-to that operation. The general form is:
-.sp
-.CS
-\fIpathName operation \fR?\fIarg arg ...\fR?
-.CE
-.sp
-\fIOperation\fR and the \fIarg\fRs determine the exact behavior of the
-command. The following operation are available for \fBtreeview\fR widgets:
-.TP
-\fIpathName \fBbbox\fR ?\fB-screen\fR? \fItagOrId...\fR
-Returns a list of 4 numbers, representing a bounding box of around
-the specified entries. The entries is given by one or more \fItagOrId\fR
-arguments.
-If the \fB\-screen\fR flag is given, then the x-y coordinates
-of the bounding box are returned as screen coordinates, not
-virtual coordinates. Virtual coordinates start from \f(CW0\fR from the
-root node.
-The returned list contains the following values.
-.RS
-.TP 1.25i
-\fIx\fR
-X-coordinate of the upper-left corner of the bounding box.
-.TP
-\fIy\fR
-Y-coordinate of the upper-left corner of the bounding box.
-.TP
-\fIwidth\fR
-Width of the bounding box.
-.TP
-\fIheight\fR
-Height of the bounding box.
-.RE
-.TP
-\fIpathName \fBbind\fR \fItagName\fR ?\fIsequence command\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for a node with this
-tag, \fIcommand\fR will be invoked. The syntax is similar to the
-\fBbind\fR command except that it operates on \fBtreeview\fR entries,
-rather than widgets. See the \fBbind\fR manual entry for
-complete details on \fIsequence\fR and the substitutions performed on
-\fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBbutton \fIoperation\fR ?\fIargs\fR?
-This command is used to control the button selectors within a
-\fBtreeview\fR widget.
-It has several forms, depending on \fIoperation\fR:
-.RS
-.TP
-\fIpathName \fBbutton activate\fR \fItagOrId\fR
-Designates the node given by \fItagOrId\fR as active.
-When a node is active it's entry is drawn using its active icon
-(see the \fB\-activeicon\fR option).
-Note that there can be only one active entry at a time.
-The special id \fBactive\fR indicates the currently active node.
-.TP
-\fIpathName \fBbutton bind\fR \fItagName\fR ?\fIsequence command\fR?
-Associates \fIcommand\fR with \fItagName\fR such that whenever the
-event sequence given by \fIsequence\fR occurs for an button of a
-node entry with this tag, \fIcommand\fR will be invoked. The syntax is
-similar to the \fBbind\fR command except that it operates on
-\fBtreeview\fR buttons, rather than widgets. See the \fBbind\fR
-manual entry for complete details on \fIsequence\fR and the
-substitutions performed on \fIcommand\fR before invoking it.
-.sp
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR.
-If the first character of \fIcommand\fR is \f(CW+\fR then \fIcommand\fR
-augments an existing binding rather than replacing it.
-If no \fIcommand\fR argument is provided then the command currently
-associated with \fItagName\fR and \fIsequence\fR (it's an error occurs
-if there's no such binding) is returned. If both \fIcommand\fR and
-\fIsequence\fR are missing then a list of all the event sequences for
-which bindings have been defined for \fItagName\fR.
-.TP
-\fIpathName \fBbutton cget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBbutton configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "BUTTON OPTIONS"
-below.
-.RE
-.TP
-\fIpathName \fBcget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBclose \fR?\fB\-recurse\fR? \fItagOrId...\fR
-Closes the node specified by \fItagOrId\fR. In addition, if a Tcl
-script was specified by the \fB\-closecommand\fR option, it is
-invoked. If the node is already closed, this command has no effect.
-If the \fB\-recurse\fR flag is present, each child node is
-recursively closed.
-.TP
-\fIpathName \fBcolumn \fIoperation\fR ?\fIargs\fR?
-The following operations are available for treeview columns.
-.RS
-.TP
-\fIpathName \fBcolumn activate\fR \fIcolumn\fR
-Sets the active column to \fIcolumn\fR. \fIColumn\fR is the
-name of a column in the widget.
-When a column is active, it's drawn using its \fB\-activetitlebackground\fR
-and \fB\-activetitleforeground\fR options. If \fIcolumn\fR is the \f(CW""\fR,
-then no column will be active. If no column argument is provided, then
-the name of the currently active column is returned.
-.TP
-\fIpathName \fBcolumn cget\fR \fIname\fR \fIoption\fR
-Returns the current value of the column configuration option given
-by \fIoption\fR for \fIname\fR. \fIName\fR is the name of column
-that corresponds to a data field.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBcolumn configure\fR \fIname\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the column designated
-by \fIname\fR. \fIName\fR is the name of the column corresponding
-to a data field.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "COLUMN OPTIONS"
-below.
-.TP
-\fIpathName \fBcolumn delete\fR \fIfield\fR ?\fIfield\fR...?
-Deletes one of more columns designated by \fIfield\fR. Note
-that this does not delete the data fields themselves.
-.TP
-\fIpathName \fBcolumn insert\fR \fIposition\fR \fIfield\fR ?\fIoptions\fR...?
-Inserts one of more columns designated by \fIfield\fR. A column displays
-each node's data field by the same name. If the node doesn't
-have the given field, the cell is left blank.
-\fIPosition\fR
-indicates where in the list of columns to add the new column. It may be
-either a number or \f(CWend\fR.
-.TP
-\fIpathName \fBcolumn invoke\fR \fIfield\fR
-Invokes the Tcl command associated with the column \fIfield\fR,
-if there is one (using the column's \fB\-command\fR option).
-The command is ignored if the column's \fB\-state\fR option
-set to \f(CWdisabled\fR.
-.TP
-\fIpathName \fBcolumn move \fIname\fR \fIdest\fR
-Moves the column \fIname\fR to the destination position.
-\fIDest\fR is the name of another column or a screen position
-in the form \f(CW@\fIx\f(CW,\fIy\fR.
-.TP
-\fIpathName \fBcolumn names\fR
-Returns a list of the names of all columns in the widget.
-The list is ordered as the columns are drawn from left-to-right.
-.TP
-\fIpathName \fBcolumn nearest\fR \fIx\fR ?\fIy\fR?
-Returns the name of the column closest to the given X-Y screen
-coordinate. If you provide a \fIy\fR argument (it's optional),
-a name is returned only when if the point is over a column's title.
-.RE
-.TP
-\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "TREEVIEW OPTIONS"
-below.
-.TP
-\fIpathName \fBcurselection\fR
-Returns a list containing the ids of all of the entries that are
-currently selected.
-If there are no entries selected, then the empty string is returned.
-.TP
-\fIpathName \fBdelete \fItagOrId\fR...
-Deletes one or more entries given by \fItagOrId\fR and its children.
-.TP
-\fIpathName \fBentry \fIoperation\fR ?\fIargs\fR?
-The following operations are available for treeview entries.
-.RS
-.TP
-\fIpathName \fBentry activate\fR \fItagOrId\fR
-Sets the active entry to the one specified by \fItagOrId\fR.
-When an entry is active it is drawn using its active icon
-(see the \fB\-activeicon\fR option).
-Note that there can be only one active node at a time.
-The special id of the currently active node is \fBactive\fR.
-.TP
-\fIpathName \fBentry cget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBentry children\fR \fItagOrId\fR ?\fIfirst\fR? ?\fIlast\fR?
-Returns a list of ids for the given range of children of \fItagOrId\fR.
-\fITagOrId\fR is the id or tag of the node to be examined.
-If only a \fIfirst\fR argument is present, then the id
-of the that child at that numeric position is returned. If both \fIfirst\fR
-and \fIlast\fR arguments are given, then the ids of all the children
-in that range are returned. Otherwise the ids of all children
-are returned.
-.TP
-\fIpathName \fBentry configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described below:
-.TP
-\fIpathName \fBentry delete\fR \fItagOrId\fR ?\fIfirst\fR ?\fIlast\fR?
-Deletes the one or more children nodes of the parent \fItagOrId\fR.
-If \fIfirst\fR and \fIlast\fR arguments are present, they are
-positions designating a range of children nodes to be deleted.
-.TP
-\fIpathName \fBentry isbefore \fItagOrId1\fR \fItagOrId2\fR
-Returns 1 if \fItagOrId1\fR is before \fItagOrId2\fR and 0 otherwise.
-.TP
-\fIpathName \fBentry ishidden \fItagOrId\fR
-Returns 1 if the node is currently hidden and 0 otherwise. A node is
-also hidden if any of its ancestor nodes are closed or hidden.
-.TP
-\fIpathName \fBentry isopen \fItagOrId\fR
-Returns 1 if the node is currently open and 0 otherwise.
-.TP
-\fIpathName \fBentry size\fR \fB\-recurse\fR \fItagOrId\fR
-Returns the number of children for parent node \fItagOrId\fR.
-If the \fB\-recurse\fR flag is set, the number of all
-its descendants is returned. The node itself is not counted.
-.RE
-.TP
-\fIpathName \fBfind \fR?\fIflags\fR? \fIfirst\fR \fIlast\fR
-Finds for all entries matching the criteria given by \fIflags\fR. A
-list of ids for all matching nodes is returned. \fIFirst\fR and
-\fIlast\fR are ids designating the range of the search in
-depth-first order. If \fIlast\fR is before \fIfirst\fR, then nodes
-are searched in reverse order. The valid flags are:
-.RS
-.TP 1.25i
-\fB\-name\fI pattern\fR
-Specifies pattern to match against node names.
-.TP 1.25i
-\fB\-full\fI pattern\fR
-Specifies pattern to match against node pathnames.
-.TP 1.25i
-\fB\-\fIoption\fI pattern\fR
-Specifies pattern to match against the node entry's configuration option.
-.TP 1.25i
-\fB\-exact\fR
-Patterns must match exactly. The is the default.
-.TP 1.25i
-\fB\-glob\fR
-Use global pattern matching. Matching is done in a fashion
-similar to that used by the C-shell. For the two
-strings to match, their contents must be identical
-except that the following special sequences may
-appear in pattern:
-.RS
-.TP 5
-\f(CW*\fR
-Matches any sequence of characters in
-string, including a null string.
-.TP 5
-\f(CW?\fR
-Matches any single character in string.
-.TP 5
-\f(CW[\fIchars\f(CW]\fR
-Matches any character in the set given by \fIchars\fR. If a sequence of the
-form \fIx\fR-\fIy\fR appears in \fIchars\fR, then any character between
-\fIx\fR and \fIy\fR,
-inclusive, will match.
-.TP 5
-\f(CW\\\fIx\fR
-Matches the single character \fIx\fR. This
-provides a way of avoiding the special
-interpretation of the characters \f(CW*?[]\\\fR in
-the pattern.
-.RE
-.TP 1.25i
-\fB\-regexp\fR
-Use regular expression pattern matching (i.e. the same as implemented
-by the \fBregexp\fR command).
-.TP 1.25i
-\fB\-nonmatching\fR
-Pick entries that don't match.
-.TP 1.25i
-\fB\-exec\fI string\fR
-Specifies a Tcl script to be invoked for each matching node.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.TP 1.25i
-\fB\-count\fI number\fR
-Stop searching after \fInumber\fR matches.
-.TP 1.25i
-\fB\-\-\fR
-Indicates the end of flags.
-.RE
-.TP
-\fIpathName \fBfocus \fR \fItagOrId\fR
-Sets the focus to the node given by \fItagOrId\fR. When a node
-has focus, it can receive keyboard events.
-The special id \fBfocus\fR designates the node that currently has focus.
-.TP
-\fIpathName \fBget \fR?\fB\-full\fR? \fItagOrId\fR \fItagOrId\fR...
-Translates one or more ids to their node entry names. It returns a list of
-names for all the ids specified. If the \fB\-full\fR
-flag is set, then the full pathnames are returned.
-.sp
-Note: If the \fB\-separator\fR option is the empty string (the default),
-the result is always a list of lists, even if there is only one node
-specified.
-.TP
-\fIpathName \fBhide \fR?\fBflags\fR? \fItagOrId\fR...
-Hides all nodes matching the criteria given by \fIflags\fR. The
-search is performed recursively for each node given by \fItagOrId\fR.
-The valid flags are described below:
-.RS
-.TP 1.25i
-\fB\-name\fI pattern\fR
-Specifies pattern to match against node names.
-.TP 1.25i
-\fB\-full\fI pattern\fR
-Specifies pattern to match against node pathnames.
-.TP 1.25i
-\fB\-\fIoption\fI pattern\fR
-Specifies pattern to match against the node entry's configuration option.
-.TP 1.25i
-\fB\-exact\fR
-Match patterns exactly. The is the default.
-.TP 1.25i
-\fB\-glob\fR
-Use global pattern matching. Matching is done in a fashion
-similar to that used by the C-shell. For the two
-strings to match, their contents must be identical
-except that the following special sequences may
-appear in pattern:
-.RS
-.TP 5
-\f(CW*\fR
-Matches any sequence of characters in
-string, including a null string.
-.TP 5
-\f(CW?\fR
-Matches any single character in string.
-.TP 5
-\f(CW[\fIchars\f(CW]\fR
-Matches any character in the set given by \fIchars\fR. If a sequence of the
-form \fIx\fR-\fIy\fR appears in \fIchars\fR, then any character between
-\fIx\fR and \fIy\fR,
-inclusive, will match.
-.TP 5
-\f(CW\\\fIx\fR
-Matches the single character \fIx\fR. This
-provides a way of avoiding the special
-interpretation of the characters \f(CW*?[]\\\fR in
-the pattern.
-.RE
-.TP 1.25i
-\fB\-regexp\fR
-Use regular expression pattern matching (i.e. the same as implemented
-by the \fBregexp\fR command).
-.TP 1.25i
-\fB\-nonmatching\fR
-Hide nodes that don't match.
-.TP 1.25i
-\fB\-\-\fR
-Indicates the end of flags.
-.RE
-.TP
-\fIpathName \fBindex \fR?\fB\-at\fR ?\fB\-path\fR? \fItagOrId\fR? \fIstring\fR
-Returns the id of the node specified by \fIstring\fR. \fIString\fR
-may be a tag or node id.
-Some special ids are normally relative to the node that
-has focus. The \fB\-at\fR flag lets you select another node.
-.TP
-\fIpathName \fBinsert \fR?\fB\-at \fItagOrId\fR? \fIposition\fR \fIpath\fR ?\fIoptions...\fR? ?\fIpath\fR? ?\fIoptions...\fR?
-Inserts one or more nodes at \fIposition\fR. \fIPosition\fR is the
-location (number or \f(CWend\fR) where the new nodes are added to
-the parent node. \fIPath\fR is the pathname of the new node.
-Pathnames can be formated either as a Tcl list (each element is a path
-component) or as a string separated by a special character sequence
-(using the \fB\-separator\fR option). Pathnames are normally
-absolute, but the \fB\-at\fR switch lets you select a relative
-starting point. Its value is the id of the starting node.
-.sp
-All ancestors of the new node must already exist, unless the
-\fB\-autocreate\fR option is set. It is also an error if a node
-already exists, unless the \fB\-allowduplicates\fR option is set.
-.sp
-\fIOption\fR and \fIvalue\fR may have any of the values accepted by the
-\fBentry configure\fR operation described in the
-.SB "ENTRY OPERATIONS"
-section below. This command returns a list of the ids of
-the new entries.
-.TP
-\fIpathName \fBmove \fItagOrId\fR \fIhow\fR \fIdestId\fR
-Moves the node given by \fItagOrId\fR to the destination node. The
-node can not be an ancestor of the destination. \fIDestId\fR is
-the id of the destination node and can not be the root of the
-tree. In conjunction with \fIhow\fR, it describes how the move is
-performed.
-.RS
-.TP 8
-\f(CWbefore\fR
-Moves the node before the destination node.
-.TP 8
-\f(CWafter\fR
-Moves the node after the destination node.
-.TP 8
-\f(CWinto\fR
-Moves the node to the end of the destination's list of children.
-.RE
-.TP
-\fIpathName \fBnearest \fIx y\fR ?\fIvarName\fR?
-Returns the id of the node entry closest to the given X-Y screen
-coordinate. If the coordinate is not directly over any node, then the
-empty string is returned. If the argument \fIvarName\fR is present,
-this is a Tcl variable that is set to either \f(CWbutton\fR,
-\f(CWlabel\fR, \f(CWlabel\fR, or \f(CW""\fR depending what part of the
-entry the coordinate lies.
-.TP
-\fIpathName \fBopen \fR?\fB\-recurse\fR? \fItagOrId...\fR
-Opens the one or more nodes specified by \fItagOrId\fR.
-If a node is not already open, the Tcl script specified by the
-\fB\-opencommand\fR option is invoked. If the \fB\-recurse\fR flag
-is present, then each descendant is recursively opened.
-.TP
-\fIpathName \fBrange\fR ?\fB-open\fR? \fIfirst last\fR
-Returns the ids in depth-first order of the nodes
-between the \fIfirst\fR and \fIlast\fR ids. If the \fB\-open\fR
-flag is present, it indicates to consider only open nodes.
-If \fIlast\fR is before \fIfirst\fR, then the ids are
-returned in reverse order.
-.TP
-\fIpathName \fBscan\fR \fIoption args\fR
-This command implements scanning. It has
-two forms, depending on \fIoption\fR:
-.RS
-.TP
-\fIpathName \fBscan mark \fIx y\fR
-Records \fIx\fR and \fIy\fR and the current view in the treeview
-window; used in conjunction with later \fBscan dragto\fR commands.
-Typically this command is associated with a mouse button press in
-the widget. It returns an empty string.
-.TP
-\fIpathName \fBscan dragto \fIx y\fR.
-Computes the difference between its \fIx\fR and \fIy\fR
-arguments and the \fIx\fR and \fIy\fR arguments to the last
-\fBscan mark\fR command for the widget.
-It then adjusts the view by 10 times the
-difference in coordinates. This command is typically associated
-with mouse motion events in the widget, to produce the effect of
-dragging the list at high speed through the window. The return
-value is an empty string.
-.RE
-.TP
-\fIpathName \fBsee\fR ?\fB\-anchor \fIanchor\fR? \fItagOrId\fR
-Adjusts the view of entries so that the node given by \fItagOrId\fR is
-visible in the widget window. It is an error if \fBtagOrId\fR is a
-tag that refers to more than one node. By default the node's entry
-is displayed in the middle of the window. This can changed using the
-\fB\-anchor\fR flag. Its value is a Tk anchor position.
-.TP
-\fIpathName \fBselection \fIoption arg\fR
-This command is used to adjust the selection within a \fBtreeview\fR
-widget. It has several forms, depending on \fIoption\fR:
-.RS
-.TP
-\fIpathName \fBselection anchor \fItagOrId\fR
-Sets the selection anchor to the node given by \fItagOrId\fR.
-If \fItagOrId\fR refers to a non-existent node, then the closest
-node is used.
-The selection anchor is the end of the selection that is fixed
-while dragging out a selection with the mouse.
-The special id \fBanchor\fR may be used to refer to the anchor
-node.
-.TP
-\fIpathName \fBselection cancel\fR
-Clears the temporary selection of entries back to the
-current anchor. Temporary selections are created by
-the \fBselection mark\fR operation.
-.TP
-\fIpathName \fBselection clear \fIfirst \fR?\fIlast\fR?
-Removes the entries between \fIfirst\fR and \fIlast\fR
-(inclusive) from the selection. Both \fIfirst\fR and
-\fIlast\fR are ids representing a range of entries.
-If \fIlast\fR isn't given, then only \fIfirst\fR is deselected.
-Entries outside the selection are not affected.
-.TP
-\fIpathName \fBselection clearall\fR
-Clears the entire selection.
-.TP
-\fIpathName \fBselection mark \fItagOrId\fR
-Sets the selection mark to the node given by \fItagOrId\fR. This
-causes the range of entries between the anchor and the mark to be
-temporarily added to the selection. The selection mark is the end of
-the selection that is fixed while dragging out a selection with the
-mouse. The special id \fBmark\fR may be used to refer to the current
-mark node.
-If \fItagOrId\fR refers to a non-existent node, then the mark
-is ignored.
-Resetting the mark will unselect
-the previous range. Setting the anchor finalizes the range.
-.TP
-\fIpathName \fBselection includes \fItagOrId\fR
-Returns 1 if the node given by \fItagOrId\fR is currently
-selected, 0 if it isn't.
-.TP
-\fIpathName \fBselection present\fR
-Returns 1 if any nodes are currently selected and 0 otherwise.
-.TP
-\fIpathName \fBselection set \fIfirst \fR?\fIlast\fR?
-Selects all of the nodes in the range between
-\fIfirst\fR and \fIlast\fR, inclusive, without affecting
-the selection state of nodes outside that range.
-.TP
-\fIpathName \fBselection toggle \fIfirst \fR?\fIlast\fR?
-Selects/deselects nodes in the range between
-\fIfirst\fR and \fIlast\fR, inclusive, from the selection.
-If a node is currently selected, it becomes deselected, and
-visa versa.
-.RE
-.TP
-\fIpathName \fBshow \fR?\fBflags\fR? \fItagOrId\fR...
-Exposes all nodes matching the criteria given by \fIflags\fR. This
-is the inverse of the \fBhide\fR operation. The search is performed
-recursively for each node given by \fItagOrId\fR. The valid flags are
-described below:
-.RS
-.TP 1.25i
-\fB\-name\fI pattern\fR
-Specifies pattern to match against node names.
-.TP 1.25i
-\fB\-full\fI pattern\fR
-Specifies pattern to match against node pathnames.
-.TP 1.25i
-\fB\-\fIoption\fI pattern\fR
-Specifies pattern to match against the entry's configuration option.
-.TP 1.25i
-\fB\-exact\fR
-Match patterns exactly. The is the default.
-.TP 1.25i
-\fB\-glob\fR
-\fB\-glob\fR
-Use global pattern matching. Matching is done in a fashion
-similar to that used by the C-shell. For the two
-strings to match, their contents must be identical
-except that the following special sequences may
-appear in pattern:
-.RS
-.TP 5
-\f(CW*\fR
-Matches any sequence of characters in
-string, including a null string.
-.TP 5
-\f(CW?\fR
-Matches any single character in string.
-.TP 5
-\f(CW[\fIchars\f(CW]\fR
-Matches any character in the set given by \fIchars\fR. If a sequence of the
-form \fIx\fR-\fIy\fR appears in \fIchars\fR, then any character between
-\fIx\fR and \fIy\fR,
-inclusive, will match.
-.TP 5
-\f(CW\\\fIx\fR
-Matches the single character \fIx\fR. This
-provides a way of avoiding the special
-interpretation of the characters \f(CW*?[]\\\fR in
-the pattern.
-.RE
-.TP 1.25i
-\fB\-regexp\fR
-Use regular expression pattern matching (i.e. the same as implemented
-by the \fBregexp\fR command).
-.TP 1.25i
-\fB\-nonmatching\fR
-Expose nodes that don't match.
-.TP 1.25i
-\fB\-\-\fR
-Indicates the end of flags.
-.RE
-.TP
-\fIpathName \fBsort\fR ?\fIoperation\fR? \fIargs...\fR
-.RS
-.TP
-\fIpathName \fBsort auto\fR ?\fIboolean\fR
-Turns on/off automatic sorting of node entries. If \fIboolean\fR is
-true, entries will be automatically sorted as they are opened,
-closed, inserted, or deleted. If no \fIboolean\fR argument is
-provided, the current state is returned.
-.TP
-\fIpathName \fBsort cget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBsort configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-Query or modify the sorting configuration options of the widget.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given sorting option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described below:
-.RS
-.TP
-\fB\-column\fI string\fR
-Specifies the column to sort. Entries in the widget are rearranged
-according to this column. If \fIcolumn\fR is \f(CW""\fR then
-no sort is performed.
-.TP
-\fB\-command\fI string\fR
-Specifies a Tcl procedure to be called when sorting nodes.
-The procedure is called with three arguments: the pathname of the widget
-and the fields of two entries. The procedure returns 1 if the first
-node is greater than the second, -1 is the second is greater, and 0
-if equal.
-.TP
-\fB\-decreasing\fI boolean\fR
-Indicates to sort in ascending/descending order. If \fIboolean\fR
-is true, then the entries as in descending order. The default is
-\f(CWno\fR.
-.TP
-\fB\-mode\fI string\fR
-Specifies how to compare entries when sorting. \fIString\fR
-may be one of the following:
-.RS
-.TP 1.5i
-\f(CWascii\fR
-Use string comparison based upon the ASCII collation order.
-.TP 1.5i
-\f(CWdictionary\fR
-Use dictionary-style comparison. This is the same as \f(CWascii\fR
-except (a) case is ignored except as a tie-breaker and (b) if two
-strings contain embedded numbers, the numbers compare as integers, not
-characters. For example, "bigBoy" sorts between
-"bigbang" and "bigboy", and "x10y" sorts between "x9y" and "x11y".
-.TP 1.5i
-\f(CWinteger\fR
-Compares fields as integers.
-.TP 1.5i
-\f(CWreal\fR
-Compares fields as floating point numbers.
-.TP 1.5i
-\f(CWcommand\fR
-Use the Tcl proc specified by the \fB\-command\fR option to compare entries
-when sorting. If no command is specified, the sort reverts to
-\f(CWascii\fR sorting.
-.RE
-.RE
-.TP
-\fIpathName \fBsort once\fR ?\fIflags\fR? \fItagOrId...\fR
-Sorts the children for each entries specified by \fItagOrId\fR.
-By default, entries are sorted by name, but you can specify a
-Tcl proc to do your own comparisons.
-.RS
-.TP 1.5i
-\fB\-recurse\fR
-Recursively sort the entire branch, not just the children.
-.RE
-.RE
-.TP
-\fIpathName \fBtag \fIoperation args\fR
-Tags are a general means of selecting and marking nodes in the tree.
-A tag is just a string of characters, and it may take any form except
-that of an integer. The same tag may be associated with many
-different nodes.
-.sp
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for tags are listed below.
-.RS
-.TP
-\fIpathName\fR \fBtag add\fR \fIstring\fR \fIid\fR...
-Adds the tag \fIstring\fR to one of more entries.
-.TP
-\fIpathName\fR \fBtag delete\fR \fIstring\fR \fIid\fR...
-Deletes the tag \fIstring\fR from one or more entries.
-.TP
-\fIpathName\fR \fBtag forget\fR \fIstring\fR
-Removes the tag \fIstring\fR from all entries. It's not an error if no
-entries are tagged as \fIstring\fR.
-.TP
-\fIpathName\fR \fBtag names\fR ?\fIid\fR?
-Returns a list of tags used. If an \fIid\fR argument
-is present, only those tags used by the node designated by \fIid\fR
-are returned.
-.TP
-\fIpathName\fR \fBtag nodes\fR \fIstring\fR
-Returns a list of ids that have the tag \fIstring\fR. If no node
-is tagged as \fIstring\fR, then an empty string is returned.
-.RE
-.TP
-\fIpathName \fBtext \fIoperation\fR ?\fIargs\fR?
-This operation is used to provide text editing for cells (data
-fields in a column) or entry labels.
-It has several forms, depending on \fIoperation\fR:
-.RS
-.TP
-\fIpathName \fBtext apply\fR
-Applies the edited buffer, replacing the entry label
-or data field. The edit window is hidden.
-.TP
-\fIpathName \fBtext cancel\fR
-Cancels the editing operation, reverting the entry label
-or data value back to the previous value. The edit window is hidden.
-.TP
-\fIpathName \fBtext cget\fI value\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBconfigure\fR
-operation described below.
-.TP
-\fIpathName \fBtext configure\fR ?\fIoption value\fR?
-Query or modify the configuration options of the edit window.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options (see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
-with no \fIvalue\fR, then the command returns a list describing the
-one named option (this list will be identical to the corresponding
-sublist of the value returned if no \fIoption\fR is specified). If
-one or more \fIoption\-value\fR pairs are specified, then the command
-modifies the given widget option(s) to have the given value(s); in
-this case the command returns an empty string.
-\fIOption\fR and \fIvalue\fR are described in the section
-.SB "TEXT EDITING OPTIONS"
-below.
-.RE
-.TP
-\fIpathName \fBtext delete\fI first last\fR
-Deletes the characters in the edit buffer between the two given
-character positions.
-.TP
-\fIpathName \fBtext get\fR ?\fI\-root\fR? \fIx y\fR
-.TP
-\fIpathName \fBtext icursor\fI index\fR
-.TP
-\fIpathName \fBtext index\fI index\fR
-Returns the text index of given \fIindex\fR.
-.TP
-\fIpathName \fBtext insert\fI index string\fR
-Insert the text string \fIstring\fR into the edit buffer at the index
-\fIindex\fR. For example, the index 0 will prepend the buffer.
-.TP
-\fIpathName \fBtext selection\fI args\fR
-This operation controls the selection of the editing window. Note
-that this differs from the selection of entries.
-It has the following forms:
-.RS
-.TP
-\fIpathName \fBtext selection adjust\fI index\fR
-Adjusts either the first or last index of the selection.
-.TP
-\fIpathName \fBtext selection clear\fR
-Clears the selection.
-.TP
-\fIpathName \fBtext selection from\fI index\fR
-Sets the anchor of the selection.
-.TP
-\fIpathName \fBtext selection present\fR
-Indicates if a selection is present.
-.TP
-\fIpathName \fBtext selection range\fI start end\fR
-Sets both the anchor and mark of the selection.
-.TP
-\fIpathName \fBtext selection to\fI index\fR
-Sets the unanchored end (mark) of the selection.
-.RE
-.TP
-\fIpathName \fBtoggle \fItagOrId\fR
-Opens or closes the node given by \fItagOrId\fR. If the corresponding
-\fB\-opencommand\fR or \fB\-closecommand\fR option is set, then that
-command is also invoked.
-.TP
-\fIpathName \fBxview \fIargs\fR
-This command is used to query and change the horizontal position of the
-information in the widget's window. It can take any of the following
-forms:
-.RS
-.TP
-\fIpathName \fBxview\fR
-Returns a list containing two elements.
-Each element is a real fraction between 0 and 1; together they describe
-the horizontal span that is visible in the window.
-For example, if the first element is .2 and the second element is .6,
-20% of the \fBtreeview\fR widget's text is off-screen to the left,
-the middle 40% is visible
-in the window, and 40% of the text is off-screen to the right.
-These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
-option.
-.TP
-\fIpathName \fBxview\fR \fItagOrId\fR
-Adjusts the view in the window so that the character position given by
-\fItagOrId\fR is displayed at the left edge of the window.
-Character positions are defined by the width of the character \fB0\fR.
-.TP
-\fIpathName \fBxview moveto\fI fraction\fR
-Adjusts the view in the window so that \fIfraction\fR of the
-total width of the \fBtreeview\fR widget's text is off-screen to the left.
-\fIfraction\fR must be a fraction between 0 and 1.
-.TP
-\fIpathName \fBxview scroll \fInumber what\fR
-This command shifts the view in the window left or right according to
-\fInumber\fR and \fIwhat\fR.
-\fINumber\fR must be an integer.
-\fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviation
-of one of these.
-If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
-\fInumber\fR character units (the width of the \fB0\fR character)
-on the display; if it is \fBpages\fR then the view adjusts by
-\fInumber\fR screenfuls.
-If \fInumber\fR is negative then characters farther to the left
-become visible; if it is positive then characters farther to the right
-become visible.
-.RE
-.TP
-\fIpathName \fByview \fI?args\fR?
-This command is used to query and change the vertical position of the
-text in the widget's window.
-It can take any of the following forms:
-.RS
-.TP
-\fIpathName \fByview\fR
-Returns a list containing two elements, both of which are real fractions
-between 0 and 1.
-The first element gives the position of the node at the
-top of the window, relative to the widget as a whole (0.5 means
-it is halfway through the treeview window, for example).
-The second element gives the position of the node just after
-the last one in the window, relative to the widget as a whole.
-These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR
-option.
-.TP
-\fIpathName \fByview\fR \fItagOrId\fR
-Adjusts the view in the window so that the node given by
-\fItagOrId\fR is displayed at the top of the window.
-.TP
-\fIpathName \fByview moveto\fI fraction\fR
-Adjusts the view in the window so that the node given by \fIfraction\fR
-appears at the top of the window.
-\fIFraction\fR is a fraction between 0 and 1; 0 indicates the first
-node, 0.33 indicates the node one-third the
-way through the \fBtreeview\fR widget, and so on.
-.TP
-\fIpathName \fByview scroll \fInumber what\fR
-This command adjusts the view in the window up or down according to
-\fInumber\fR and \fIwhat\fR.
-\fINumber\fR must be an integer.
-\fIWhat\fR must be either \fBunits\fR or \fBpages\fR.
-If \fIwhat\fR is \fBunits\fR, the view adjusts up or down by
-\fInumber\fR lines; if it is \fBpages\fR then
-the view adjusts by \fInumber\fR screenfuls.
-If \fInumber\fR is negative then earlier nodes
-become visible; if it is positive then later nodes
-become visible.
-.RE
-.SH "TREEVIEW OPTIONS"
-In addition to the \fBconfigure\fR operation, widget configuration
-options may also be set by the Tk \fBoption\fR command. The class
-resource name is \f(CWTreeView\fR.
-.CS
-option add *TreeView.Foreground white
-option add *TreeView.Background blue
-.CE
-The following widget options are available:
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the background color for active entries. A node
-is active when the mouse passes over it's entry or using the
-\fBactivate\fR operation.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the foreground color of the active node. A node
-is active when the mouse passes over it's entry or using the
-\fBactivate\fR operation.
-.TP
-\fB\-activeicons \fIimages\fR
-Specifies images to be displayed for an entry's icon
-when it is active. \fIImages\fR is a list of two Tk images:
-the first image is displayed when the node is open, the
-second when it is closed.
-.TP
-\fB\-autocreate \fIboolean\fR
-If \fIboolean\fR is true, automatically create missing ancestor
-nodes when inserting new nodes. Otherwise flag an error.
-The default is \f(CWno\fR.
-.TP
-\fB\-allowduplicates \fIboolean\fR
-If \fIboolean\fR is true, allow nodes with duplicate pathnames
-when inserting new nodes. Otherwise flag an error.
-The default is \f(CWno\fR.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the widget. The default is \f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the outside edge of the widget. The
-\fB\-relief\fR option determines if the border is to be drawn. The
-default is \f(CW2\fR.
-.TP
-\fB\-closecommand \fIstring\fR
-Specifies a Tcl script to be invoked when a node is closed. You can
-overrider this for individual entries using the entry's \fB\-closecommand\fR
-option. The default is \f(CW""\fR.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.TP
-\fB\-cursor \fIcursor\fR
-Specifies the widget's cursor. The default cursor is \f(CW""\fR.
-.TP
-\fB\-dashes \fInumber\fR
-Sets the dash style of the horizontal and vertical lines drawn connecting
-entries. \fINumber\fR is the length in pixels of the dashes and gaps in
-the line. If \fInumber\fR is \f(CW0\fR, solid lines will
-be drawn. The default is \f(CW1\fR (dotted).
-.TP
-\fB\-exportselection \fIboolean\fR
-Indicates if the selection is exported. If the widget is exporting its
-selection then it will observe the standard X11 protocols for handling
-the selection. Selections are available as type \fBSTRING\fR;
-the value of the selection will be the label of the selected nodes,
-separated by newlines. The default is \f(CWno\fR.
-.TP
-\fB\-flat \fIboolean\fR
-Indicates whether to display the tree as a flattened list.
-If \fIboolean\fR is true, then the hierarchy will be a list of full
-paths for the nodes. This option also has affect on sorting.
-See the
-.SB "SORT OPERATIONS"
-section for more information.
-The default is \f(CWno\fR.
-.TP
-\fB\-focusdashes \fIdashList\fR
-Sets the dash style of the outline rectangle drawn around the entry
-label of the node that current has focus. \fINumber\fR is the length
-in pixels of the dashes and gaps in the line. If
-\fInumber\fR is \f(CW0\fR, a solid line will be drawn. The default is
-\f(CW1\fR.
-.TP
-\fB\-focusforeground \fIcolor\fR
-Sets the color of the focus rectangle.
-The default is \f(CWblack\fR.
-.TP
-\fB\-font \fIfontName\fR
-Specifies the font for entry labels. You can override this for individual
-entries with the entry's \fB\-font\fR configuration option. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the text color of entry labels. You can override this for individual
-entries with the entry's \fB\-foreground\fR configuration option.
-The default is
-\f(CWblack\fR.
-.TP
-\fB\-height \fIpixels\fR
-Specifies the requested height of widget. The default is
-\f(CW400\fR.
-.TP
-\fB\-hideroot \fIboolean\fR
-If \fIboolean\fR is true, it indicates that no entry for the root node
-should be displayed. The default is \f(CWno\fR.
-.TP
-\fB\-highlightbackground \fIcolor\fR
-Specifies the normal color of the traversal highlight region when
-the widget does not have the input focus.
-.TP
-\fB\-highlightcolor \fIcolor\fR
-Specifies the color of the traversal highlight rectangle when
-the widget has the input focus.
-The default is \f(CWblack\fR.
-.TP
-\fB\-highlightthickness \fIpixels\fR
-Specifies the width of the highlight rectangle indicating when the
-widget has input focus. The value may have any of the forms acceptable
-to \fBTk_GetPixels\fR. If the value is zero, no focus highlight will
-be displayed. The default is \f(CW2\fR.
-.TP
-\fB\-icons \fIimages\fR
-Specifies images for the entry's icon.
-\fIImages\fR is a list of two Tk images:
-the first image is displayed when the node is open, the
-second when it is closed.
-.TP
-\fB\-linecolor \fIcolor\fR
-Sets the color of the connecting lines drawn between entries.
-The default is \f(CWblack\fR.
-.TP
-\fB\-linespacing \fIpixels\fR
-Sets the number of pixels spacing between entries.
-The default is \f(CW0\fR.
-.TP
-\fB\-linewidth \fIpixels\fR
-Set the width of the lines drawn connecting entries. If \fIpixels\fR
-is \f(CW0\fR, no vertical or horizontal lines are drawn.
-The default is \f(CW1\fR.
-.TP
-\fB\-newtags \fIboolean\fR
-If \fIboolean\fR is true, when sharing a tree object (see the
-\fB\-tree\fR option), don't share its tags too.
-The default is \f(CW0\fR.
-.TP
-\fB\-opencommand \fIstring\fR
-Specifies a Tcl script to be invoked when a node is open.
-You can override this for individual entries with the entry's
-\fB\-opencommand\fR configuration option. The default is \f(CW""\fR.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect for the widget. \fIRelief\fR
-specifies how the \fBtreeview\fR widget should appear relative to widget
-it is packed into; for example, \f(CWraised\fR means the \fBtreeview\fR widget
-should appear to protrude. The default is \f(CWsunken\fR.
-.TP
-\fB\-scrollmode \fImode\fR
-Specifies the style of scrolling to be used. The following
-styles are valid. This is the default is \f(CWhierbox\fR.
-.RS
-.TP 1.25i
-\f(CWlistbox\fR
-Like the \fBlistbox\fR widget, the last entry can always be
-scrolled to the top of the widget window. This allows the scrollbar
-thumb to shrink as the last entry is scrolled upward.
-.TP 1.25i
-\f(CWhierbox\fR
-Like the \fBhierbox\fR widget, the last entry can only be
-viewed at the bottom of the widget window. The scrollbar
-stays a constant size.
-.TP 1.25i
-\f(CWcanvas\fR
-Like the \fBcanvas\fR widget, the entries are bound within
-the scrolling area.
-.RE
-.TP
-\fB\-selectbackground \fIcolor\fR
-Sets the background color selected node entries.
-The default is \f(CW#ffffea\fR.
-.TP
-\fB\-selectborderwidth \fIpixels\fR
-Sets the width of the raised 3-D border drawn around the labels
-of selected entries. The default is \f(CW0\fR.
-\fB\-selectcommand \fIstring\fR
-Specifies a Tcl script to invoked when the set of selected
-nodes changes.
-The default is \f(CW""\fR.
-.TP
-\fB\-selectforeground \fIcolor\fB
-Sets the color of the labels of selected node entries.
-The default is \f(CWblack\fR.
-.TP
-\fB\-selectmode \fImode\fR
-Specifies the selection mode. If \fImode\fR is
-\f(CWsingle\fR, only one node can be selected
-at a time. If \f(CWmultiple\fR more than one
-node can be selected.
-The default is \f(CWsingle\fR.
-.TP
-\fB\-separator \fIstring\fR
-Specifies the character sequence to use when spliting the path components.
-The separator may be several characters wide (such as "::")
-Consecutive separators in a pathname are treated as one.
-If \fIstring\fR is the empty string, the pathnames are Tcl lists.
-Each element is a path component. The default is \f(CW""\fR.
-.TP
-\fB\-showtitles \fIboolean\fR
-If \fIboolean\fR is false, column titles are not be displayed.
-The default is \f(CWyes\fR.
-.TP
-\fB\-sortselection \fIboolean\fR
-If \fIboolean\fR is true, nodes in the selection are ordered as they
-are currently displayed (depth-first or sorted), not in the order
-they were selected. The default is \f(CWno\fR.
-.TP
-\fB\-takefocus\fR \fIfocus\fR
-Provides information used when moving the focus from window to window
-via keyboard traversal (e.g., Tab and Shift-Tab). If \fIfocus\fR is
-\f(CW0\fR, this means that this window should be skipped entirely during
-keyboard traversal. \f(CW1\fR means that the this window should always
-receive the input focus. An empty value means that the traversal
-scripts make the decision whether to focus on the window.
-The default is \f(CW"1"\fR.
-.TP
-\fB\-trim \fIstring\fR
-Specifies a string leading characters to trim from entry pathnames
-before parsing. This only makes sense if the \fB\-separator\fR is also
-set. The default is \f(CW""\fR.
-.TP
-\fB\-width \fIpixels\fR
-Sets the requested width of the widget. If \fIpixels\fR is 0, then
-the with is computed from the contents of the \fBtreeview\fR widget.
-The default is \f(CW200\fR.
-.TP
-\fB\-xscrollcommand \fIstring\fR
-Specifies the prefix for a command used to communicate with horizontal
-scrollbars. Whenever the horizontal view in the widget's window
-changes, the widget will generate a Tcl command by concatenating the
-scroll command and two numbers. If this option is not specified, then
-no command will be executed.
-.TP
-\fB\-xscrollincrement\fR \fIpixels\fR
-Sets the horizontal scrolling distance. The default is 20 pixels.
-.TP
-\fB\-yscrollcommand \fIstring\fR
-Specifies the prefix for a command used to communicate with vertical
-scrollbars. Whenever the vertical view in the widget's window
-changes, the widget will generate a Tcl command by concatenating the
-scroll command and two numbers. If this option is not specified, then
-no command will be executed.
-.TP
-\fB\-yscrollincrement\fR \fIpixels\fR
-Sets the vertical scrolling distance. The default is 20 pixels.
-.SH "ENTRY OPTIONS"
-Many widget configuration options have counterparts in entries. For
-example, there is a \fB\-closecommand\fR configuration option for both
-widget itself and for individual entries. Options set at the widget
-level are global for all entries. If the entry configuration option
-is set, then it overrides the widget option. This is done to avoid
-wasting memory by replicated options. Most entries will have
-redundant options.
-.PP
-There is no resource class or name for entries.
-.TP
-\fB\-activeicons \fIimages\fR
-Specifies images to be displayed as the entry's icon
-when it is active. This overrides the global \fB\-activeicons\fR
-configuration option for the specific entry.
-\fIImages\fR is a list of two Tk images:
-the first image is displayed when the node is open, the
-second when it is closed.
-.TP
-\fB\-bindtags \fItagList\fR
-Specifies the binding tags for nodes. \fITagList\fR is a list
-of binding tag names. The tags and their order will determine how
-events are handled for nodes. Each tag in the list matching the current
-event sequence will have its Tcl command executed. The default value
-is \f(CWall\fR.
-.TP
-\fB\-button \fIstring\fR
-Indicates whether a button should be displayed on the left side
-of the node entry. \fIString\fR can be \f(CWyes\fR, \f(CWno\fR,
-or \f(CWauto\fR. If \f(CWauto\fR, then a button is automatically
-displayed if the node has children. This is the default.
-.TP
-\fB\-closecommand \fIstring\fR
-Specifies a Tcl script to be invoked when the node is closed. This
-overrides the global \fB\-closecommand\fR option for this entry.
-The default is \f(CW""\fR.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.TP
-\fB\-data \fIstring\fR
-Sets data fields for the node. \fIString\fR is a list of
-name-value pairs to be set. The default is \f(CW""\fR.
-.TP
-\fB\-font \fIfontName\fR
-Sets the font for entry labels. This overrides the widget's
-\fB\-font\fR option for this node. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the text color of the entry label. This overrides the widget's
-\fB\-foreground\fR configuration option. The default is \f(CW""\fR.
-.TP
-\fB\-icons \fIimages\fR
-Specifies images to be displayed for the entry's icon.
-This overrides the global \fB\-icons\fR configuration option.
-\fIImages\fR is a list of two Tk images:
-the first image is displayed when the node is open, the
-second when it is closed.
-.TP
-\fB\-label \fIstring\fR
-Sets the text for the entry's label. If not set, this
-defaults to the name of the node. The default is \f(CW""\fR.
-.TP
-\fB\-opencommand \fIstring\fR
-Specifies a Tcl script to be invoked when the entry is opened.
-This overrides the widget's \fB\-opencommand\fR option for this node.
-The default is \f(CW""\fR.
-Percent substitutions are performed on \fIstring\fR before
-it is executed. The following substitutions are valid:
-.RS
-.TP 5
-\f(CW%W\fR
-The pathname of the widget.
-.TP 5
-\f(CW%p\fR
-The name of the node.
-.TP 5
-\f(CW%P\fR
-The full pathname of the node.
-.TP 5
-\f(CW%#\fR
-The id of the node.
-.TP 5
-\f(CW%%\fR
-Translates to a single percent.
-.RE
-.SH "BUTTON OPTIONS"
-Button configuration options may also be set by the \fBoption\fR command.
-The resource subclass is \f(CWButton\fR. The resource name is always
-\f(CWbutton\fR.
-.CS
-option add *TreeView.Button.Foreground white
-option add *TreeView.button.Background blue
-.CE
-The following are the configuration options available for buttons.
-.TP
-\fB\-activebackground \fIcolor\fR
-Sets the background color of active buttons. A button
-is made active when the mouse passes over it or by the
-\fBbutton activate\fR operation.
-.TP
-\fB\-activeforeground \fIcolor\fR
-Sets the foreground color of active buttons. A button
-is made active when the mouse passes over it or by the
-\fBbutton activate\fR operation.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background of the button. The default is \f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the button.
-The \fB\-relief\fR option determines if a border is to be drawn. The
-default is \f(CW1\fR.
-.TP
-\fB\-closerelief \fIrelief\fR
-Specifies the 3-D effect for the closed button. \fIRelief\fR
-indicates how the button should appear relative to the widget;
-for example, \f(CWraised\fR means the button should
-appear to protrude. The default is \f(CWsolid\fR.
-.TP
-\fB\-cursor \fIcursor\fR
-Sets the widget's cursor. The default cursor is \f(CW""\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Sets the foreground color of buttons.
-The default is \f(CWblack\fR.
-.TP
-\fB\-images \fIimages\fR
-Specifies images to be displayed for the button.
-\fIImages\fR is a list of two Tk images:
-the first image is displayed when the button is open, the
-second when it is closed. If the \fIimages\fR is the empty string,
-then a plus/minus gadget is drawn. The default is \f(CW""\fR.
-.TP
-\fB\-openrelief \fIrelief\fR
-Specifies the 3-D effect of the open button. \fIRelief\fR
-indicates how the button should appear relative to the widget;
-for example, \f(CWraised\fR means the button should
-appear to protrude. The default is \f(CWflat\fR.
-.TP
-\fB\-size \fIpixels\fR
-Sets the requested size of the button.
-The default is \f(CW0\fR.
-.RE
-.SH "COLUMN OPTIONS"
-Column configuration options may also be set by the \fBoption\fR command.
-The resource subclass is \f(CWColumn\fR. The resource name is the
-name of the column.
-.CS
-option add *TreeView.Column.Foreground white
-option add *TreeView.treeView.Background blue
-.CE
-The following configuration options are available for columns.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background color of the column. This overrides
-the widget's \fB\-background\fR option. The default is \f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border of the column.
-The \fB\-relief\fR option determines if a border is to be drawn. The
-default is \f(CW0\fR.
-.TP
-\fB\-edit \fIboolean\fR
-Indicates if the column's data fields can be edited. If \fIboolean\fR is
-false, the data fields in the column may not be edited.
-The default is \f(CWyes\fR.
-.TP
-\fB\-foreground \fIcolor\fR
-Specifies the foreground color of the column.
-You can override this for individual entries with the entry's
-\fB\-foreground\fR option.
-The default is \f(CWblack\fR.
-.TP
-\fB\-font \fIfontName\fR
-Sets the font for a column. You can override this for individual entries
-with the entry's \fB\-font\fR option. The default is
-\f(CW*-Helvetica-Bold-R-Normal-*-12-120-*\fR.
-.TP
-\fB\-hide \fIboolean\fR
-If \fIboolean\fR is true, the column is not displayed.
-The default is \f(CWyes\fR.
-.TP
-\fB\-justify \fIjustify\fR
-Specifies how the column data fields title should be justified within
-the column. This matters only when the column is wider than the
-data field to be display.
-\fIJustify\fR must be \f(CWleft\fR, \f(CWright\fR, or \f(CWcenter\fR.
-The default is \f(CWleft\fR.
-.TP
-\fB\-pad \fIpad\fR
-Specifies how much padding for the left and right sides of the column.
-\fIPad\fR is a list of one or two screen distances. If \fIpad\fR
-has two elements, the left side of the column is padded by the first
-distance and the right side by the second. If \fIpad\fR has just one
-distance, both the left and right sides are padded evenly. The
-default is \f(CW2\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect of the column. \fIRelief\fR
-specifies how the column should appear relative to the widget;
-for example, \f(CWraised\fR means the column should
-appear to protrude. The default is \f(CWflat\fR.
-.TP
-\fB\-state \fIstate\fR
-Sets the state of the column. If \fIstate\fR is \f(CWdisable\fR then
-the column title can not be activated nor invoked.
-The default is \f(CWnormal\fR.
-.TP
-\fB\-title \fIstring\fR
-Sets the title for the column.
-The default is \f(CW""\fR.
-.TP
-\fB\-titleforeground \fIcolor\fR
-Sets the foreground color of the column title.
-The default is \f(CWblack\fR.
-.TP
-\fB\-titleshadow \fIcolor\fR
-Sets the color of the drop shadow of the column title.
-The default is \f(CW""\fR.
-.TP
-\fB\-width \fIpixels\fR
-Sets the requested width of the column. This overrides
-the computed with of the column. If \fIpixels\fR is 0,
-the width is computed as from the contents of the column. The
-default is \f(CW0\fR.
-.RE
-.SH "TEXT EDITING OPTIONS"
-Text edit window configuration options may also be set by the
-\fBoption\fR command. The resource class is \f(CWTreeViewEditor\fR.
-The resource name is always \f(CWedit\fR.
-.CS
-option add *TreeViewEditor.Foreground white
-option add *edit.Background blue
-.CE
-The following are the configuration options available for the
-text editing window.
-.TP
-\fB\-background \fIcolor\fR
-Sets the background of the text edit window. The default is \f(CWwhite\fR.
-.TP
-\fB\-borderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the edit window.
-The \fB\-relief\fR option determines if a border is to be drawn. The
-default is \f(CW1\fR.
-.TP
-\fB\-exportselection \fIboolean\fR
-Indicates if the text selection is exported. If the edit window is
-exporting its selection then it will observe the standard X11 protocols
-for handling the selection. Selections are available as type \fBSTRING\fR.
-The default is \f(CWno\fR.
-.TP
-\fB\-relief \fIrelief\fR
-Specifies the 3-D effect of the edit window. \fIRelief\fR
-indicates how the background should appear relative to the edit
-window; for example, \f(CWraised\fR means the background should
-appear to protrude. The default is \f(CWsolid\fR.
-.TP
-\fB\-selectbackground \fIcolor\fR
-Sets the background of the selected text in the edit window.
-The default is \f(CWwhite\fR.
-.TP
-\fB\-selectborderwidth \fIpixels\fR
-Sets the width of the 3\-D border around the selected text in the
-edit window. The \fB\-selectrelief\fR option determines if a border
-is to be drawn. The default is \f(CW1\fR.
-.TP
-\fB\-selectforeground \fIcolor\fR
-Sets the foreground of the selected text in the edit window.
-The default is \f(CWwhite\fR.
-.TP
-\fB\-selectrelief \fIrelief\fR
-Specifies the 3-D effect of the selected text in the edit window.
-\fIRelief\fR indicates how the text should appear relative to the edit
-window; for example, \f(CWraised\fR means the text should
-appear to protrude. The default is \f(CWflat\fR.
-.RE
-.SH "DEFAULT BINDINGS"
-Tk automatically creates class bindings for treeviews that give them
-Motif-like behavior. Much of the behavior of a \fBtreeview\fR widget is determined
-by its \fB\-selectmode\fR option, which selects one of two ways
-of dealing with the selection.
-.PP
-If the selection mode is \fBsingle\fR, only one node can be
-selected at a time.
-Clicking button 1 on an node selects
-it and deselects any other selected item.
-.PP
-If the selection mode is \fBmultiple\fR,
-any number of entries may be selected at once, including discontiguous
-ranges. Clicking Control-Button-1 on a node entry
-toggles its selection state without affecting any other entries.
-Pressing Shift-Button-1 on a node entry selects
-it, extends the selection.
-.IP [1]
-In \fBextended\fR mode, the selected range can be adjusted by pressing
-button 1 with the Shift key down: this modifies the selection to
-consist of the entries between the anchor and the entry under
-the mouse, inclusive.
-The un-anchored end of this new selection can also be dragged with
-the button down.
-.IP [2]
-In \fBextended\fR mode, pressing button 1 with the Control key down
-starts a toggle operation: the anchor is set to the entry under
-the mouse, and its selection state is reversed. The selection state
-of other entries isn't changed.
-If the mouse is dragged with button 1 down, then the selection state
-of all entries between the anchor and the entry under the mouse
-is set to match that of the anchor entry; the selection state of
-all other entries remains what it was before the toggle operation
-began.
-.IP [3]
-If the mouse leaves the treeview window with button 1 down, the window
-scrolls away from the mouse, making information visible that used
-to be off-screen on the side of the mouse.
-The scrolling continues until the mouse re-enters the window, the
-button is released, or the end of the hierarchy is reached.
-.IP [4]
-Mouse button 2 may be used for scanning.
-If it is pressed and dragged over the \fBtreeview\fR widget, the contents of
-the hierarchy drag at high speed in the direction the mouse moves.
-.IP [5]
-If the Up or Down key is pressed, the location cursor (active
-entry) moves up or down one entry.
-If the selection mode is \fBbrowse\fR or \fBextended\fR then the
-new active entry is also selected and all other entries are
-deselected.
-In \fBextended\fR mode the new active entry becomes the
-selection anchor.
-.IP [6]
-In \fBextended\fR mode, Shift-Up and Shift-Down move the location
-cursor (active entry) up or down one entry and also extend
-the selection to that entry in a fashion similar to dragging
-with mouse button 1.
-.IP [7]
-The Left and Right keys scroll the \fBtreeview\fR widget view left and right
-by the width of the character \fB0\fR.
-Control-Left and Control-Right scroll the \fBtreeview\fR widget view left and
-right by the width of the window.
-Control-Prior and Control-Next also scroll left and right by
-the width of the window.
-.IP [8]
-The Prior and Next keys scroll the \fBtreeview\fR widget view up and down
-by one page (the height of the window).
-.IP [9]
-The Home and End keys scroll the \fBtreeview\fR widget horizontally to
-the left and right edges, respectively.
-.IP [10]
-Control-Home sets the location cursor to the the first entry,
-selects that entry, and deselects everything else
-in the widget.
-.IP [11]
-Control-End sets the location cursor to the the last entry,
-selects that entry, and deselects everything else
-in the widget.
-.IP [12]
-In \fBextended\fR mode, Control-Shift-Home extends the selection
-to the first entry and Control-Shift-End extends
-the selection to the last entry.
-.IP [13]
-In \fBmultiple\fR mode, Control-Shift-Home moves the location cursor
-to the first entry and Control-Shift-End moves
-the location cursor to the last entry.
-.IP [14]
-The space and Select keys make a selection at the location cursor
-(active entry) just as if mouse button 1 had been pressed over
-this entry.
-.IP [15]
-In \fBextended\fR mode, Control-Shift-space and Shift-Select
-extend the selection to the active entry just as if button 1
-had been pressed with the Shift key down.
-.IP [16]
-In \fBextended\fR mode, the Escape key cancels the most recent
-selection and restores all the entries in the selected range
-to their previous selection state.
-.IP [17]
-Control-slash selects everything in the widget, except in
-\fBsingle\fR and \fBbrowse\fR modes, in which case it selects
-the active entry and deselects everything else.
-.IP [18]
-Control-backslash deselects everything in the widget, except in
-\fBbrowse\fR mode where it has no effect.
-.IP [19]
-The F16 key (labelled Copy on many Sun workstations) or Meta-w
-copies the selection in the widget to the clipboard, if there is
-a selection.
-.PP
-The behavior of \fBtreeview\fR widgets can be changed by defining new bindings
-for individual widgets or by redefining the class bindings.
-.SS WIDGET BINDINGS
-In addition to the above behavior, the following additional behavior
-is defined by the default widget class (TreeView) bindings.
-.IP \f(CW<ButtonPress-2>\fR
-Starts scanning.
-.IP \f(CW<B2-Motion>\fR
-Adjusts the scan.
-.IP \f(CW<ButtonRelease-2>\fR
-Stops scanning.
-.IP \f(CW<B1-Leave>\fR
-Starts auto-scrolling.
-.IP \f(CW<B1-Enter>\fR
-Starts auto-scrolling
-.IP \f(CW<KeyPress-Up>\fR
-Moves the focus to the previous entry.
-.IP \f(CW<KeyPress-Down>\fR
-Moves the focus to the next entry.
-.IP \f(CW<Shift-KeyPress-Up>\fR
-Moves the focus to the previous sibling.
-.IP \f(CW<Shift-KeyPress-Down>\fR
-Moves the focus to the next sibling.
-.IP \f(CW<KeyPress-Prior>\fR
-Moves the focus to first entry. Closed or hidden entries
-are ignored.
-.IP \f(CW<KeyPress-Next>\fR
-Move the focus to the last entry. Closed or hidden entries
-are ignored.
-.IP \f(CW<KeyPress-Left>\fR
-Closes the entry. It is not an error if the entry has no children.
-.IP \f(CW<KeyPress-Right>\fR
-Opens the entry, displaying its children. It is not an
-error if the entry has no children.
-.IP \f(CW<KeyPress-space>\fR
-In "single" select mode this selects the entry. In "multiple" mode,
-it toggles the entry (if it was previous selected, it is not
-deselected).
-.IP \f(CW<KeyRelease-space>\fR
-Turns off select mode.
-.IP \f(CW<KeyPress-Return>\fR
-Sets the focus to the current entry.
-.IP \f(CW<KeyRelease-Return>\fR
-Turns off select mode.
-.IP \f(CW<KeyPress>\fR
-Moves to the next entry whose label starts with the letter typed.
-.IP \f(CW<KeyPress-Home>\fR
-Moves the focus to first entry. Closed or hidden entries
-are ignored.
-.IP \f(CW<KeyPress-End>\fR
-Move the focus to the last entry. Closed or hidden entries
-are ignored.
-.IP \f(CW<KeyPress-F1>\fR
-Opens all entries.
-.IP \f(CW<KeyPress-F2>\fR
-Closes all entries (except root).
-.SS BUTTON BINDINGS
-Buttons have bindings. There are associated with the "all" bindtag
-(see the entry's -bindtag option). You can use the \fBbind\fR
-operation to change them.
-.IP \f(CW<Enter>\fR
-Highlights the button of the current entry.
-.IP \f(CW<Leave>\fR
-Returns the button back to its normal state.
-.IP \f(CW<ButtonRelease-1>\fR
-Adjust the view so that the current entry is visible.
-.SS ENTRY BINDINGS
-Entries have default bindings. There are associated with the "all"
-bindtag (see the entry's -bindtag option). You can use the \fBbind\fR
-operation to modify them.
-.IP \f(CW<Enter>\fR
-Highlights the current entry.
-.IP \f(CW<Leave>\fR
-Returns the entry back to its normal state.
-.IP \f(CW<ButtonPress-1>\fR
-Sets the selection anchor the current entry.
-.IP \f(CW<Double-ButtonPress-1>\fR
-Toggles the selection of the current entry.
-.IP \f(CW<B1-Motion>\fR
-For "multiple" mode only. Saves the current location of the
-pointer for auto-scrolling. Resets the selection mark.
-.IP \f(CW<ButtonRelease-1>\fR
-For "multiple" mode only. Sets the selection anchor to the
-current entry.
-.IP \f(CW<Shift-ButtonPress-1>\fR
-For "multiple" mode only. Extends the selection.
-.IP \f(CW<Shift-Double-ButtonPress-1>\fR
-Place holder. Does nothing.
-.IP \f(CW<Shift-B1-Motion>\fR
-Place holder. Does nothing.
-.IP \f(CW<Shift-ButtonRelease-1>\fR
-Stop auto-scrolling.
-.IP \f(CW<Control-ButtonPress-1>\fR
-For "multiple" mode only. Toggles and extends the selection.
-.IP \f(CW<Control-Double-ButtonPress-1>\fR
-Place holder. Does nothing.
-.IP \f(CW<Control-B1-Motion>\fR
-Place holder. Does nothing.
-.IP \f(CW<Control-ButtonRelease-1>\fR
-Stops auto-scrolling.
-.IP \f(CW<Control-Shift-ButtonPress-1>\fR
-???
-.IP \f(CW<Control-Shift-Double-ButtonPress-1>\fR
-Place holder. Does nothing.
-.IP \f(CW<Control-Shift-B1-Motion>\fR
-Place holder. Does nothing.
-.SS COLUMN BINDINGS
-Columns have bindings too. They are associated with the column's
-"all" bindtag (see the column -bindtag option). You can use the
-\fBcolumn bind\fR operation to change them.
-.IP \f(CW<Enter>\fR
-Highlights the current column title.
-.IP \f(CW<Leave>\fR
-Returns the column back to its normal state.
-.IP \f(CW<ButtonRelease-1>\fR
-Invokes the command (see the column's -command option) if one
-if specified.
-.SS COLUMN RULE BINDINGS
-.IP \f(CW<Enter>\fR
-Highlights the current and activates the ruler.
-.IP \f(CW<Leave>\fR
-Returns the column back to its normal state. Deactivates the
-ruler.
-.IP \f(CW<ButtonPress-1>\fR
-Sets the resize anchor for the column.
-.IP \f(CW<B1-Motion>\fR
-Sets the resize mark for the column.
-.IP \f(CW<ButtonRelease-1>\fR
-Adjust the size of the column, based upon the resize anchor and mark
-positions.
-.SH EXAMPLE
-The \fBtreeview\fR command creates a new widget.
-.CS
-treeview .h \-bg white
-.CE
-A new Tcl command \f(CW.h\fR is also created. This command can be used
-to query and modify the \fBtreeview\fR widget. For example, to change the
-background
-color of the table to "green", you use the new command and the widget's
-\fBconfigure\fR operation.
-.CS
-# Change the background color.
-\&.h configure \-background "green"
-.CE
-By default, the \fBtreeview\fR widget will automatically create a new tree object
-to contain the data. The name of the new tree is the pathname of the
-widget. Above, the new tree object name is ".h". But you can use the
-\fB\-tree\fR option to specify the name of another tree.
-.CS
-# View the tree "myTree".
-\&.h configure \-tree "myTree"
-.CE
-When a new tree is created, it contains only a root node. The node
-is automatically opened. The id of the root node is always
-\f(CW0\fR (you can use also use the special id \f(CWroot\fR). The
-\fBinsert\fR operation lets you insert one or more new entries into
-the tree. The last argument is the node's \fIpathname\fR.
-.CS
-# Create a new entry named "myEntry"
-set id [\&.h insert end "myEntry"]
-.CE
-This appends a new node named "myEntry". It will positioned as the
-last child of the root of the tree (using the position "end"). You
-can supply another position to order the node within its siblings.
-.CS
-# Prepend "fred".
-set id [\&.h insert 0 "fred"]
-.CE
-Entry names do not need to be unique. By default, the node's label
-is its name. To supply a different text label, add the \fB\-label\fR
-option.
-.CS
-# Create a new node named "fred"
-set id [\&.h insert end "fred" -label "Fred Flintstone"]
-.CE
-The \fBinsert\fR operation returns the id of the new node. You can
-also use the \fBindex\fR operation to get this information.
-.CS
-# Get the id of "fred"
-\&.h index "fred"
-.CE
-To insert a node somewhere other than root, use the \fB\-at\fR switch.
-It takes the id of the node where the new child will be added.
-.CS
-# Create a new node "barney" in "fred".
-\&.h insert -at $id end "barney"
-.CE
-A pathname describes the path to an entry in the hierarchy. It's a
-list of entry names that compose the path in the tree. Therefore, you
-can also add "barney" to "fred" as follows.
-.CS
-# Create a new sub-entry of "fred"
-\&.h insert end "fred barney"
-.CE
-Every name in the list is ancestor of the next. All ancestors must
-already exist. That means that an entry "fred" is an ancestor of
-"barney" and must already exist. But you can use the
-\fB\-autocreate\fR configuration option to force the creation of
-ancestor nodes.
-.CS
-# Force the creation of ancestors.
-\&.h configure -autocreate yes
-\&.h insert end "fred barney wilma betty"
-.CE
-Sometimes the pathname is already separated by a character sequence
-rather than formed as a list. A file name is a good example of this.
-You can use the \fB\-separator\fR option to specify a separator string
-to split the path into its components. Each pathname inserted is
-automatically split using the separator string as a separator.
-Multiple separators are treated as one.
-.CS
-\&.h configure -separator /
-\&.h insert end "/usr/local/tcl/bin"
-.CE
-If the path is prefixed by extraneous characters, you can
-automatically trim it off using the \fB\-trim\fR option. It removed
-the string from the path before it is parsed.
-.CS
-\&.h configure -trim C:/windows -separator /
-\&.h insert end "C:/window/system"
-.CE
-You can insert more than one entry at a time with the \fBinsert\fR
-operation. This can be much faster than looping over a list of names.
-.CS
-# The slow way
-foreach f [glob $dir/*] {
- \&.h insert end $f
-}
-# The fast way
-eval .h insert end [glob $dir/*]
-.CE
-In this case, the \fBinsert\fR operation will return a list of ids
-of the new entries.
-.PP
-You can delete entries with the \fBdelete\fR operation. It takes one or
-more tags of ids as its argument. It deletes the entry and all its
-children.
-.CS
-\&.h delete $id
-.CE
-Entries have several configuration options. They control the appearance
-of the entry's icon and label. We have already seen the \fB\-label\fR
-option that sets the entry's text label. The \fBentry configure\fR
-operation lets you set or modify an entry's configuration options.
-.CS
-\&.h entry configure $id -color red -font fixed
-.CE
-You can hide an entry and its children using the \fB\-hide\fR option.
-.CS
-\&.h entry configure $id -hide yes
-.CE
-More that one entry can be configured at once. All entries specified
-are configured with the same options.
-.CS
-\&.h entry configure $i1 $i2 $i3 $i4 -color brown
-.CE
-An icon is displayed for each entry. It's a Tk image drawn to the
-left of the label. You can set the icon with the entry's
-\fB\-icons\fR option. It takes a list of two image names: one to
-represent the open entry, another when it is closed.
-.CS
-set im1 [image create photo -file openfolder.gif]
-set im2 [image create photo -file closefolder.gif]
-\&.h entry configure $id -icons "$im1 $im2"
-.CE
-If \fB\-icons\fR is set to the empty string, no icons are display.
-.PP
-If an entry has children, a button is displayed to the left of the
-icon. Clicking the mouse on this button opens or closes the
-sub-hierarchy. The button is normally a \f(CW+\fR or \f(CW\-\fR
-symbol, but can be configured in a variety of ways using the \fBbutton
-configure\fR operation. For example, the \f(CW+\fR and \f(CW\-\fR
-symbols can be replaced with Tk images.
-.CS
-set im1 [image create photo -file closefolder.gif]
-set im2 [image create photo -file downarrow.gif]
-\&.h button configure $id -images "$im1 $im2" \\
- -openrelief raised -closerelief raised
-.CE
-Entries can contain an arbitrary number of \fIdata fields\fR. Data
-fields are name-value pairs. Both the value and name are strings.
-The entry's \fB\-data\fR option lets you set data fields.
-.CS
-\&.h entry configure $id -data {mode 0666 group users}
-.CE
-The \fB\-data\fR takes a list of name-value pairs.
-.PP
-You can display these data fields as \fIcolumns\fR in the
-\fBtreeview\fR widget. You can create and configure columns with
-the \fBcolumn\fR operation. For example, to add a new column to the
-widget, use the \fBcolumn insert\fR operation. The last argument is
-the name of the data field that you want to display.
-.CS
-\&.h column insert end "mode"
-.CE
-The column title is displayed at the top of the column. By default,
-it's is the field name. You can override this using the column's
-\fB\-title\fR option.
-.CS
-\&.h column insert end "mode" -title "File Permissions"
-.CE
-Columns have several configuration options. The \fBcolumn
-configure\fR operation lets you query or modify column options.
-.CS
-\&.h column configure "mode" -justify left
-.CE
-The \fB\-justify\fR option says how the data is justified within in
-the column. The \fB\-hide\fR option indicates whether the column is
-displayed.
-.CS
-\&.h column configure "mode" -hide yes
-.CE
-Entries can be selected by clicking on the mouse. Selected entries
-are drawn using the colors specified by the \fB\-selectforeground\fR
-and \fB\-selectbackground\fR configuration options.
-The selection itself is managed by the \fBselection\fR operation.
-.CS
-# Clear all selections
-\&.h selection clear 0 end
-# Select the root node
-\&.h selection set 0
-.CE
-The \fBcurselection\fR operation returns a list of ids of
-all the selected entries.
-.CS
-set ids [\&.h curselection]
-.CE
-You can use the \fBget\fR operation to convert the ids to
-their pathnames.
-.CS
-set names [eval .h get -full $ids]
-.CE
-If a treeview is exporting its selection (using the
-\fB\-exportselection\fR option), then it will observe the standard X11
-protocols for handling the selection. Treeview selections are
-available as type \fBSTRING\fR; the value of the selection will be the
-pathnames of the selected entries, separated by newlines.
-.PP
-The \fBtreeview\fR supports two modes of selection: \f(CWsingle\fR
-and \f(CWmultiple\fR. In single select mode, only one entry can be
-selected at a time, while multiple select mode allows several entries
-to be selected. The mode is set by the widget's \fB\-selectmode\fR
-option.
-.CS
-\&.h configure -selectmode "multiple"
-.CE
-You can be notified when the list of selected entries changes. The widget's
-\fB\-selectcommand\fR specifies a Tcl procedure that is called whenever
-the selection changes.
-.CS
-proc SelectNotify { widget } {
- set ids [\&$widget curselection]
-}
-\&.h configure -selectcommand "SelectNotify .h"
-.CE
-The widget supports the standard Tk scrolling and scanning operations.
-The \fBtreeview\fR can be both horizontally and vertically. You can
-attach scrollbars to the \fBtreeview\fR the same way as the listbox
-or canvas widgets.
-.CS
-scrollbar .xbar -orient horizontal -command ".h xview"
-scrollbar .ybar -orient vertical -command ".h yview"
-\&.h configure -xscrollcommand ".xbar set" \\
- -yscrollcommand ".ybar set"
-.CE
-There are three different modes of scrolling: \f(CWlistbox\fR,
-\f(CWcanvas\fR, and \f(CWhierbox\fR. In \f(CWlistbox\fR mode, the last
-entry can always be scrolled to the top of the widget. In \f(CWhierbox\fR
-mode, the last entry is always drawn at the bottom of the widget.
-The scroll mode is set by the widget's \fB\-selectmode\fR
-option.
-.CS
-\&.h configure -scrollmode "listbox"
-.CE
-Entries can be programmatically opened or closed using the \fBopen\fR
-and \fBclose\fR operations respectively.
-.CS
-\&.h open $id
-\&.h close $id
-.CE
-When an entry is opened, a Tcl procedure can be automatically invoked.
-The \fB\-opencommand\fR option specifies this procedure. This
-procedure can lazily insert entries as needed.
-.CS
-proc AddEntries { dir } {
- eval .h insert end [glob -nocomplain $dir/*]
-}
-\&.h configure -opencommand "AddEntries %P"
-.CE
-Now when an entry is opened, the procedure \f(CWAddEntries\fR is
-called and adds children to the entry. Before the command is invoked,
-special "%" substitutions (like \fBbind\fR) are performed. Above,
-\f(CW%P\fR is translated to the pathname of the entry.
-.PP
-The same feature exists when an entry is closed. The
-\fB\-closecommand\fR option specifies the procedure.
-.CS
-proc DeleteEntries { id } {
- .h entry delete $id 0 end
-}
-\&.h configure -closecommand "DeleteEntries %#"
-.CE
-When an entry is closed, the procedure \f(CWDeleteEntries\fR is called
-and deletes the entry's children using the \fBentry delete\fR operation
-(\f(CW%#\fR is the id of entry).
-.SH KEYWORDS
-treeview, widget
diff --git a/blt3.0.1/man/vector.mann b/blt3.0.1/man/vector.mann
deleted file mode 100644
index da7abf2..0000000
--- a/blt3.0.1/man/vector.mann
+++ /dev/null
@@ -1,1130 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Lucent Technologies, Inc.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Vector command created by George Howlett.
-'\"
-.so man.macros
-.TH blt::vector n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-\fBvector\fR \- Vector data type for Tcl
-.SH SYNOPSIS
-\fBblt::vector create \fIvecName \fR?\fIvecName\fR...? ?\fIswitches\fR?
-.sp
-\fBblt::vector destroy \fIvecName \fR?\fIvecName\fR...?
-.sp
-\fBblt::vector expr \fIexpression\fR
-.sp
-\fBblt::vector names \fR?\fIpattern\fR...?
-.BE
-.SH DESCRIPTION
-The \fBvector\fR command creates an array of floating point
-values. The vector's components can be manipulated in three ways:
-through a Tcl array variable, a Tcl command, or the C API.
-.SH INTRODUCTION
-A vector is an ordered set of real numbers. The components of a
-vector are indexed by integers.
-.PP
-Vectors are common data structures for many applications. For
-example, a graph may use two vectors to represent the X-Y
-coordinates of the data plotted. The graph will automatically
-be redrawn when the vectors are updated or changed. By using vectors,
-you can separate
-data analysis from the graph widget. This makes it easier, for
-example, to add data transformations, such as splines. It's possible
-to plot the same data to in multiple graphs, where each graph presents
-a different view or scale of the data.
-.PP
-You could try to use Tcl's associative arrays as vectors. Tcl arrays
-are easy to use. You can access individual elements randomly by
-specifying the index, or the set the entire array by providing a list
-of index and value pairs for each element. The disadvantages of
-associative arrays as vectors lie in the fact they are implemented as
-hash tables.
-.TP 2
-\(bu
-There's no implied ordering to the associative arrays. If you used
-vectors for plotting, you would want to insure the second component
-comes after the first, an so on. This isn't possible since arrays
-are actually hash tables. For example, you can't get a range of
-values between two indices. Nor can you sort an array.
-.TP 2
-\(bu
-Arrays consume lots of memory when the number of elements becomes
-large (tens of thousands). This is because each element's index and
-value are stored as strings in the hash table.
-.TP 2
-\(bu
-The C programming interface is unwieldy. Normally with vectors, you
-would like to view the Tcl array as you do a C array, as an array of
-floats or doubles. But with hash tables, you must convert both the
-index and value to and from decimal strings, just to access
-an element in the array. This makes it cumbersome to perform operations on
-the array as a whole.
-.PP
-The \fBvector\fR command tries to overcome these disadvantages while
-still retaining the ease of use of Tcl arrays. The \fBvector\fR
-command creates both a new Tcl command and associate array which are
-linked to the vector components. You can randomly access vector
-components though the elements of array. Not have all indices are
-generated for the array, so printing the array (using the \fBparray\fR
-procedure) does not print out all the component values. You can use
-the Tcl command to access the array as a whole. You can copy, append,
-or sort vector using its command. If you need greater performance, or
-customized behavior, you can write your own C code to manage vectors.
-.SH EXAMPLE
-You create vectors using the \fBvector\fR command and its \fBcreate\fR
-operation.
-.CS
-# Create a new vector.
-blt::vector create y(50)
-.CE
-This creates a new vector named \f(CWy\fR. It has fifty components, by
-default, initialized to \f(CW0.0\fR. In addition, both a Tcl command
-and array variable, both named \f(CWy\fR, are created. You can use
-either the command or variable to query or modify components of the
-vector.
-.CS
-# Set the first value.
-set y(0) 9.25
-puts "y has [y length] components"
-.CE
-The array \f(CWy\fR can be used to read or set individual components of
-the vector. Vector components are indexed from zero. The array index
-must be a number less than the number of components. For example,
-it's an error if you try to set the 51st element of \f(CWy\fR.
-.CS
-# This is an error. The vector only has 50 components.
-set y(50) 0.02
-.CE
-You can also specify a range of indices using a colon (:) to separate
-the first and last indices of the range.
-.CS
-# Set the first six components of y
-set y(0:5) 25.2
-.CE
-If you don't include an index, then it will default to the first
-and/or last component of the vector.
-.CS
-# Print out all the components of y
-puts "y = $y(:)"
-.CE
-There are special non-numeric indices. The index \f(CWend\fR, specifies
-the last component of the vector. It's an error to use this index if
-the vector is empty (length is zero). The index \f(CW++end\fR can be
-used to extend the vector by one component and initialize it to a specific
-value. You can't read from the array using this index, though.
-.CS
-# Extend the vector by one component.
-set y(++end) 0.02
-.CE
-The other special indices are \f(CWmin\fR and \f(CWmax\fR. They return the
-current smallest and largest components of the vector.
-.CS
-# Print the bounds of the vector
-puts "min=$y(min) max=$y(max)"
-.CE
-To delete components from a vector, simply unset the corresponding
-array element. In the following example, the first component of
-\f(CWy\fR is deleted. All the remaining components of \f(CWy\fR will be
-moved down by one index as the length of the vector is reduced by
-one.
-.CS
-# Delete the first component
-unset y(0)
-puts "new first element is $y(0)"
-.CE
-The vector's Tcl command can also be used to query or set the vector.
-.CS
-# Create and set the components of a new vector
-blt::vector create x
-x set { 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 }
-.CE
-Here we've created a vector \f(CWx\fR without a initial length specification.
-In this case, the length is zero. The \fBset\fR operation resets the vector,
-extending it and setting values for each new component.
-.PP
-There are several operations for vectors. The \fBrange\fR operation
-lists the components of a vector between two indices.
-.CS
-# List the components
-puts "x = [x range 0 end]"
-.CE
-You can search for a particular value using the \fBsearch\fR
-operation. It returns a list of indices of the components with the
-same value. If no component has the same value, it returns \f(CW""\fR.
-.CS
-# Find the index of the biggest component
-set indices [x search $x(max)]
-.CE
-Other operations copy, append, or sort vectors. You can append
-vectors or new values onto an existing vector with the \fBappend\fR
-operation.
-.CS
-# Append assorted vectors and values to x
-x append x2 x3 { 2.3 4.5 } x4
-.CE
-The \fBsort\fR operation sorts the vector. If any additional vectors
-are specified, they are rearranged in the same order as the vector.
-For example, you could use it to sort data points represented by x and
-y vectors.
-.CS
-# Sort the data points
-x sort y
-.CE
-The vector \f(CWx\fR is sorted while the components of \f(CWy\fR are
-rearranged so that the original x,y coordinate pairs are retained.
-.PP
-The \fBexpr\fR operation lets you perform arithmetic on vectors.
-The result is stored in the vector.
-.CS
-# Add the two vectors and a scalar
-x expr { x + y }
-x expr { x * 2 }
-.CE
-When a vector is modified, resized, or deleted, it may trigger
-call-backs to notify the clients of the vector. For example, when a
-vector used in the \fBgraph\fR widget is updated, the vector
-automatically notifies the widget that it has changed. The graph can
-then redrawn itself at the next idle point. By default, the
-notification occurs when Tk is next idle. This way you can modify the
-vector many times without incurring the penalty of the graph redrawing
-itself for each change. You can change this behavior using the
-\fBnotify\fR operation.
-.CS
-# Make vector x notify after every change
-x notify always
- ...
-# Never notify
-x notify never
- ...
-# Force notification now
-x notify now
-.CE
-To delete a vector, use the \fBvector delete\fR command.
-Both the vector and its corresponding Tcl command are destroyed.
-.CS
-# Remove vector x
-blt::vector destroy x
-.CE
-.SH SYNTAX
-Vectors are created using the \fBvector create\fR operation.
-Th \fBcreate\fR operation can be invoked in one of three forms:
-.TP
-\fBblt::vector create \fIvecName\fR
-This creates a new vector \fIvecName\fR which initially has no components.
-.TP
-\fBblt::vector create \fIvecName\fR(\fIsize\fR)
-This second form creates a new vector which will contain \fIsize\fR
-number of components. The components will be indexed starting from
-zero (0). The default value for the components is \f(CW0.0\fR.
-.TP
-\fBblt::vector create \fIvecName\fR(\fIfirst\fR:\fIlast\fR)
-The last form creates a new vector of indexed \fIfirst\fR through
-\fIlast\fR. \fIFirst\fR and \fIlast\fR can be any integer value
-so long as \fIfirst\fR is less than \fIlast\fR.
-.PP
-Vector names must start with a letter and consist of letters, digits,
-or underscores.
-.CS
-# Error: must start with letter
-blt::vector create 1abc
-.CE
-You can automatically generate vector names using the
-"\f(CW#auto\fR" vector name. The \fBcreate\fR operation will generate a
-unique vector name.
-.CS
-set vec [blt::vector create #auto]
-puts "$vec has [$vec length] components"
-.CE
-.SS VECTOR INDICES
-Vectors are indexed by integers. You can access the individual vector
-components via its array variable or Tcl command. The string
-representing the index can be an integer, a numeric expression, a
-range, or a special keyword.
-.PP
-The index must lie within the current range of the vector, otherwise
-an an error message is returned. Normally the indices of a vector
-are start from 0. But you can use the \fBoffset\fR operation to
-change a vector's indices on-the-fly.
-.CS
-puts $vecName(0)
-vecName offset -5
-puts $vecName(-5)
-.CE
-You can also use numeric expressions as indices. The result
-of the expression must be an integer value.
-.CS
-set n 21
-set vecName($n+3) 50.2
-.CE
-The following special non-numeric indices are available: \f(CWmin\fR, \f(CWmax\fR, \f(CWend\fR, and
-\f(CW++end\fR.
-.CS
-puts "min = $vecName($min)"
-set vecName(end) -1.2
-.CE
-The indices \f(CWmin\fR and \f(CWmax\fR will return the minimum and maximum
-values of the vector. The index \f(CWend\fR returns the value of the
-last component in the vector. The index \f(CW++end\fR is used to append
-new value onto the vector. It automatically extends the vector by
-one component and sets its value.
-.CS
-# Append an new component to the end
-set vecName(++end) 3.2
-.CE
-A range of indices can be indicated by a colon (:).
-.CS
-# Set the first six components to 1.0
-set vecName(0:5) 1.0
-.CE
-If no index is supplied the first or last component is assumed.
-.CS
-# Print the values of all the components
-puts $vecName(:)
-.CE
-.SH VECTOR OPERATIONS
-.TP
-\fBblt::vector create \fIvecName\fR?(\fIsize\fR)?... \fR?\fIswitches\fR?
-The \fBcreate\fR operation creates a new vector \fIvecName\fR. Both a
-Tcl command and array variable \fIvecName\fR are also created. The
-name \fIvecName\fR must be unique, so another Tcl command or array
-variable can not already exist in that scope. You can access the
-components of the vector using its variable. If you change a value in
-the array, or unset an array element, the vector is updated to reflect
-the changes. When the variable \fIvecName\fR is unset, the vector and
-its Tcl command are also destroyed.
-.sp
-The vector has optional switches that affect how the vector is created. They
-are as follows:
-.RS
-.TP
-\fB\-variable \fIvarName\fR
-Specifies the name of a Tcl variable to be mapped to the vector. If
-the variable already exists, it is first deleted, then recreated.
-If \fIvarName\fR is the empty string, then no variable will be mapped.
-You can always map a variable back to the vector using the vector's
-\fBvariable\fR operation.
-.TP
-\fB\-command \fIcmdName\fR
-Maps a Tcl command to the vector. The vector can be accessed using
-\fIcmdName\fR and one of the vector instance operations.
-A Tcl command by that name cannot already exist.
-If \fIcmdName\fR is the empty string, no command mapping
-will be made.
-.TP
-\fB\-watchunset \fIboolean\fR
-Indicates that the vector should automatically delete itself if
-the variable associated with the vector is unset. By default,
-the vector will not be deleted. This is different from previous
-releases. Set \fIboolean\fR to "true" to get the old behavior.
-.RE
-.TP
-\fBblt::vector destroy \fIvecName\fR \fR?\fIvecName...\fR?
-Deletes one or more vectors. Both the Tcl command and array variable
-are removed also.
-.TP
-\fBblt::vector expr \fIexpression\fR
-.RS
-All binary operators take vectors as operands (remember that numbers
-are treated as one-component vectors). The exact action of binary
-operators depends upon the length of the second operand. If the
-second operand has only one component, then each element of the first
-vector operand is computed by that value. For example, the expression
-"x * 2" multiples all elements of the vector x by 2. If the second
-operand has more than one component, both operands must be the same
-length. Each pair of corresponding elements are computed. So "x + y"
-adds the the first components of x and y together, the second, and so on.
-.sp
-The valid operators are listed below, grouped in decreasing order
-of precedence:
-.TP 20
-\fB\-\0\0!\fR
-Unary minus and logical NOT. The unary minus flips the sign of each
-component in the vector. The logical not operator returns a vector of
-whose values are 0.0 or 1.0. For each non-zero component 1.0 is returned,
-0.0 otherwise.
-.TP 20
-\fB^\fR
-Exponentiation.
-.TP 20
-\fB*\0\0/\0\0%\fR
-Multiply, divide, remainder.
-.TP 20
-\fB+\0\0\-\fR
-Add and subtract.
-.TP 20
-\fB<<\0\0>>\fR
-Left and right shift. Circularly shifts the values of the vector
-(not implemented yet).
-.TP 20
-\fB<\0\0>\0\0<=\0\0>=\fR
-Boolean less, greater, less than or equal, and greater than or equal.
-Each operator returns a vector of ones and zeros. If the condition is true,
-1.0 is the component value, 0.0 otherwise.
-.TP 20
-\fB==\0\0!=\fR
-Boolean equal and not equal.
-Each operator returns a vector of ones and zeros. If the condition is true,
-1.0 is the component value, 0.0 otherwise.
-.TP 20
-\fB|\fR
-Bit-wise OR. (Not implemented).
-.TP 20
-\fB&&\fR
-Logical AND. Produces a 1 result if both operands are non-zero, 0 otherwise.
-.TP 20
-\fB||\fR
-Logical OR. Produces a 0 result if both operands are zero, 1 otherwise.
-.TP 20
-\fIx\fB?\fIy\fB:\fIz\fR
-If-then-else, as in C. (Not implemented yet).
-.LP
-See the C manual for more details on the results produced by each
-operator. All of the binary operators group left-to-right within the
-same precedence level.
-.sp
-Several mathematical functions are supported for vectors. Each of
-the following functions invokes the math library function of the same name;
-see the manual entries for the library functions for details on what
-they do. The operation is applied to all elements of the vector
-returning the results.
-.CS
-.ta 3c 6c 9c
-\fBacos\fR \fBcos\fR \fBhypot\fR \fBsinh\fR
-\fBasin\fR \fBcosh\fR \fBlog\fR \fBsqrt\fR
-\fBatan\fR \fBexp\fR \fBlog10\fR \fBtan\fR
-\fBceil\fR \fBfloor\fR \fBsin\fR \fBtanh\fR
-.CE
-Additional functions are:
-.TP 1i
-\fBabs\fR
-Returns the absolute value of each component.
-.TP 1i
-\fBrandom\fR
-Returns a vector of non-negative values uniformly distributed
-between [0.0, 1.0) using \fIdrand48\fR.
-The seed comes from the internal clock of the machine or may be
-set manual with the srandom function.
-.TP 1i
-\fBround\fR
-Rounds each component of the vector.
-.TP 1i
-\fBsrandom\fR
-Initializes the random number generator using \fIsrand48\fR.
-The high order 32-bits are set using the integral portion of the first
-vector component. All other components are ignored. The low order 16-bits
-are set to an arbitrary value.
-.PP
-The following functions return a single value.
-.TP 1i
-\fBadev\fR
-Returns the average deviation (defined as the sum of the absolute values
-of the differences between component and the mean, divided by the length
-of the vector).
-.TP 1i
-\fBkurtosis\fR
-Returns the degree of peakedness (fourth moment) of the vector.
-.TP 1i
-\fBlength\fR
-Returns the number of components in the vector.
-.TP 1i
-\fBmax\fR
-Returns the vector's maximum value.
-.TP 1i
-\fBmean\fR
-Returns the mean value of the vector.
-.TP 1i
-\fBmedian\fR
-Returns the median of the vector.
-.TP 1i
-\fBmin\fR
-Returns the vector's minimum value.
-.TP 1i
-\fBq1\fR
-Returns the first quartile of the vector.
-.TP 1i
-\fBq3\fR
-Returns the third quartile of the vector.
-.TP 1i
-\fBprod\fR
-Returns the product of the components.
-.TP 1i
-\fBsdev\fR
-Returns the standard deviation (defined as the square root of the variance)
-of the vector.
-.TP 1i
-\fBskew\fR
-Returns the skewness (or third moment) of the vector. This characterizes
-the degree of asymmetry of the vector about the mean.
-.TP 1i
-\fBsum\fR
-Returns the sum of the components.
-.TP 1i
-\fBvar\fR
-Returns the variance of the vector. The sum of the squared differences
-between each component and the mean is computed. The variance is
-the sum divided by the length of the vector minus 1.
-.PP
-The last set returns a vector of the same length as the argument.
-.TP 1i
-\fBnorm\fR
-Scales the values of the vector to lie in the range [0.0..1.0].
-.TP 1i
-\fBsort\fR
-Returns the vector components sorted in ascending order.
-.RE
-.TP
-\fBvector names \fR?\fIpattern\fR?
-.SH INSTANCE OPERATIONS
-You can also use the vector's Tcl command to query or modify it. The
-general form is
-.DS
-\fIvecName \fIoperation\fR \fR?\fIarg\fR?...
-.DE
-Both \fIoperation\fR and its arguments determine the exact behavior of
-the command. The operations available for vectors are listed below.
-.TP
-\fIvecName \fBappend\fR \fIitem\fR ?\fIitem\fR?...
-Appends the component values from \fIitem\fR to \fIvecName\fR.
-\fIItem\fR can be either the name of a vector or a list of numeric
-values.
-.TP
-\fIvecName \fBbinread\fR \fIchannel\fR ?\fIlength\fR? ?\fIswitches\fR?
-Reads binary values from a Tcl channel. Values are either appended
-to the end of the vector or placed at a given index (using the
-\fB\-at\fR option), overwriting existing values. Data is read until EOF
-is found on the channel or a specified number of values \fIlength\fR
-are read (note that this is not necessarily the same as the number of
-bytes). The following switches are supported:
-.RS
-.TP
-\fB\-swap\fR
-Swap bytes and words. The default endian is the host machine.
-.TP
-\fB\-at \fIindex\fR
-New values will start at vector index \fIindex\fR. This will
-overwrite any current values.
-.TP
-\fB\-format\fR \fIformat\fR
-Specifies the format of the data. \fIFormat\fR can be one of the
-following: "i1", "i2", "i4", "i8", "u1, "u2", "u4", "u8", "r4",
-"r8", or "r16". The number indicates the number of bytes
-required for each value. The letter indicates the type: "i" for signed,
-"u" for unsigned, "r" or real. The default format is "r16".
-.RE
-.TP
-\fIvecName \fBclear\fR
-Clears the element indices from the array variable associated with
-\fIvecName\fR. This doesn't affect the components of the vector. By
-default, the number of entries in the Tcl array doesn't match the
-number of components in the vector. This is because its too expensive
-to maintain decimal strings for both the index and value for each
-component. Instead, the index and value are saved only when you read
-or write an element with a new index. This command removes the index
-and value strings from the array. This is useful when the vector is
-large.
-.TP
-\fIvecName \fBdelete\fR \fIindex\fR ?\fIindex\fR?...
-Deletes the \fIindex\fRth component from the vector \fIvecName\fR.
-\fIIndex\fR is the index of the element to be deleted. This is the
-same as unsetting the array variable element \fIindex\fR. The vector
-is compacted after all the indices have been deleted.
-.TP
-\fIvecName \fBdup\fR \fIdestName\fR
-Copies \fIvecName\fR to \fIdestName\fR. \fIDestName\fR is the name of a
-destination vector. If a vector \fIdestName\fR already exists, it is
-overwritten with the components of \fIvecName\fR. Otherwise a
-new vector is created.
-.TP
-\fIvecName \fBexpr\fR \fIexpression\fR
-Computes the expression and resets the values of the vector accordingly.
-Both scalar and vector math operations are allowed. All values in
-expressions are either real numbers or names of vectors. All numbers
-are treated as one component vectors.
-.TP
-\fIvecName \fBlength\fR ?\fInewSize\fR?
-Queries or resets the number of components in \fIvecName\fR.
-\fINewSize\fR is a number specifying the new size of the vector. If
-\fInewSize\fR is smaller than the current size of \fIvecName\fR,
-\fIvecName\fR is truncated. If \fInewSize\fR is greater, the vector
-is extended and the new components are initialized to \f(CW0.0\fR. If
-no \fInewSize\fR argument is present, the current length of the vector
-is returned.
-.TP
-\fIvecName \fBmerge\fR \fIsrcName\fR ?\fIsrcName\fR?...
-Merges the named vectors into a single vector. The resulting
-vector is formed by merging the components of each source vector
-one index at a time.
-.TP
-\fIvecName \fBnotify\fR \fIkeyword\fR
-Controls how vector clients are notified of changes to the vector.
-The exact behavior is determined by \fIkeyword\fR.
-.RS
-.TP 0.75i
-\f(CWalways\fR
-Indicates that clients are to be notified immediately whenever the
-vector is updated.
-.TP
-\f(CWnever\fR
-Indicates that no clients are to be notified.
-.TP
-\f(CWwhenidle\fR
-Indicates that clients are to be notified at the next idle point
-whenever the vector is updated.
-.TP
-\f(CWnow\fR
-If any client notifications is currently pending, they are notified
-immediately.
-.TP
-\f(CWcancel\fR
-Cancels pending notifications of clients using the vector.
-.TP
-\f(CWpending\fR
-Returns \f(CW1\fR if a client notification is pending, and \f(CW0\fR otherwise.
-.RE
-.TP
-\fIvecName \fBoffset\fR ?\fIvalue\fR?
-Shifts the indices of the vector by the amount specified by \fIvalue\fR.
-\fIValue\fR is an integer number. If no \fIvalue\fR argument is
-given, the current offset is returned.
-.TP
-\fIvecName \fBpopulate\fR \fIdestName\fR ?\fIdensity\fR?
-Creates a vector \fIdestName\fR which is a superset of \fIvecName\fR.
-\fIDestName\fR will include all the components of \fIvecName\fR, in
-addition the interval between each of the original components will
-contain a \fIdensity\fR number of new components, whose values are
-evenly distributed between the original components values. This is
-useful for generating abscissas to be interpolated along a spline.
-.TP
-\fIvecName \fBrange\fR \fIfirstIndex\fR ?\fIlastIndex\fR?...
-Returns a list of numeric values representing the vector components
-between two indices. Both \fIfirstIndex\fR and \fIlastIndex\fR are
-indices representing the range of components to be returned. If
-\fIlastIndex\fR is less than \fIfirstIndex\fR, the components are
-listed in reverse order.
-.TP
-\fIvecName \fBsearch\fR \fIvalue\fR ?\fIvalue\fR?
-Searches for a value or range of values among the components of
-\fIvecName\fR. If one \fIvalue\fR argument is given, a list of
-indices of the components which equal \fIvalue\fR is returned. If a
-second \fIvalue\fR is also provided, then the indices of all
-components which lie within the range of the two values are returned.
-If no components are found, then \f(CW""\fR is returned.
-.TP
-\fIvecName \fBset\fR \fIitem\fR
-Resets the components of the vector to \fIitem\fR. \fIItem\fR can
-be either a list of numeric expressions or another vector.
-.TP
-\fIvecName \fBseq\fR \fIstart\fR ?\fIfinish\fR? ?\fIstep\fR?
-Generates a sequence of values starting with the value \fIstart\fR.
-\fIFinish\fR indicates the terminating value of the sequence.
-The vector is automatically resized to contain just the sequence.
-If three arguments are present, \fIstep\fR designates the interval.
-.sp
-With only two arguments (no \fIfinish\fR argument), the sequence will
-continue until the vector is filled. With one argument, the interval
-defaults to 1.0.
-.TP
-\fIvecName \fBsort\fR ?\fB-reverse\fR? ?\fIargName\fR?...
-Sorts the vector \fIvecName\fR in increasing order. If the
-\fB-reverse\fR flag is present, the vector is sorted in decreasing
-order. If other arguments \fIargName\fR are present, they are the
-names of vectors which will be rearranged in the same manner as
-\fIvecName\fR. Each vector must be the same length as \fIvecName\fR.
-You could use this to sort the x vector of a graph, while still
-retaining the same x,y coordinate pairs in a y vector.
-.TP
-\fIvecName \fBvariable\fR \fIvarName\fR
-Maps a Tcl variable to the vector, creating another means for
-accessing the vector. The variable \fIvarName\fR can't already
-exist. This overrides any current variable mapping the vector
-may have.
-.RE
-.SH C LANGUAGE API
-You can create, modify, and destroy vectors from C code, using
-library routines.
-You need to include the header file \f(CWblt.h\fR. It contains the
-definition of the structure \fBBlt_Vector\fR, which represents the
-vector. It appears below.
-.CS
-\fRtypedef struct {
- double *\fIvalueArr\fR;
- int \fInumValues\fR;
- int \fIarraySize\fR;
- double \fImin\fR, \fImax\fR;
-} \fBBlt_Vector\fR;
-.CE
-The field \fIvalueArr\fR points to memory holding the vector
-components. The components are stored in a double precision array,
-whose size size is represented by \fIarraySize\fR. \fINumValues\fR is
-the length of vector. The size of the array is always equal to or
-larger than the length of the vector. \fIMin\fR and \fImax\fR are
-minimum and maximum component values.
-.SH LIBRARY ROUTINES
-The following routines are available from C to manage vectors.
-Vectors are identified by the vector name.
-.PP
-\fBBlt_CreateVector\fR
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-int \fBBlt_CreateVector\fR (\fIinterp\fR, \fIvecName\fR, \fIlength\fR, \fIvecPtrPtr\fR)
-.RS 1.25i
-Tcl_Interp *\fIinterp\fR;
-char *\fIvecName\fR;
-int \fIlength\fR;
-Blt_Vector **\fIvecPtrPtr\fR;
-.RE
-.CE
-.TP
-Description:
-Creates a new vector \fIvecName\fR\fR with a length of \fIlength\fR.
-\fBBlt_CreateVector\fR creates both a new Tcl command and array
-variable \fIvecName\fR. Neither a command nor variable named
-\fIvecName\fR can already exist. A pointer to the vector is
-placed into \fIvecPtrPtr\fR.
-.TP
-Results:
-Returns \f(CWTCL_OK\fR if the vector is successfully created. If
-\fIlength\fR is negative, a Tcl variable or command \fIvecName\fR
-already exists, or memory cannot be allocated for the vector, then
-\f(CWTCL_ERROR\fR is returned and \fIinterp->result\fR will contain an
-error message.
-.RE
-.sp
-.PP
-\fBBlt_DeleteVectorByName\fR
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-int \fBBlt_DeleteVectorByName\fR (\fIinterp\fR, \fIvecName\fR)
-.RS 1.25i
-Tcl_Interp *\fIinterp\fR;
-char *\fIvecName\fR;
-.RE
-.CE
-.TP 1i
-Description:
-Removes the vector \fIvecName\fR. \fIVecName\fR is the name of a vector
-which must already exist. Both the Tcl command and array variable
-\fIvecName\fR are destroyed. All clients of the vector will be notified
-immediately that the vector has been destroyed.
-.TP
-Results:
-Returns \f(CWTCL_OK\fR if the vector is successfully deleted. If
-\fIvecName\fR is not the name a vector, then \f(CWTCL_ERROR\fR is returned
-and \fIinterp->result\fR will contain an error message.
-.RE
-.sp
-.PP
-\fBBlt_DeleteVector\fR
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-int \fBBlt_DeleteVector\fR (\fIvecPtr\fR)
-.RS 1.25i
-Blt_Vector *\fIvecPtr\fR;
-.RE
-.CE
-.TP 1i
-Description:
-Removes the vector pointed to by \fIvecPtr\fR. \fIVecPtr\fR is a
-pointer to a vector, typically set by \fBBlt_GetVector\fR or
-\fBBlt_CreateVector\fR. Both the Tcl command and array variable of
-the vector are destroyed. All clients of the vector will be notified
-immediately that the vector has been destroyed.
-.TP
-Results:
-Returns \f(CWTCL_OK\fR if the vector is successfully deleted. If
-\fIvecName\fR is not the name a vector, then \f(CWTCL_ERROR\fR is returned
-and \fIinterp->result\fR will contain an error message.
-.RE
-.sp
-.PP
-\fBBlt_GetVector\fR
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-int \fBBlt_GetVector\fR (\fIinterp\fR, \fIvecName\fR, \fIvecPtrPtr\fR)
-.RS 1.25i
-Tcl_Interp *\fIinterp\fR;
-char *\fIvecName\fR;
-Blt_Vector **\fIvecPtrPtr\fR;
-.RE
-.CE
-.TP 1i
-Description:
-Retrieves the vector \fIvecName\fR. \fIVecName\fR is the name of a
-vector which must already exist. \fIVecPtrPtr\fR will point be set to
-the address of the vector.
-.TP
-Results:
-Returns \f(CWTCL_OK\fR if the vector is successfully retrieved. If
-\fIvecName\fR is not the name of a vector, then \f(CWTCL_ERROR\fR is
-returned and \fIinterp->result\fR will contain an error message.
-.RE
-.sp
-.PP
-\fBBlt_ResetVector\fR
-.PP
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-int \fBBlt_ResetVector\fR (\fIvecPtr\fR, \fIdataArr\fR,
- \fInumValues\fR, \fIarraySize\fR, \fIfreeProc\fR)
-.RS 1.25i
-Blt_Vector *\fIvecPtr\fR;
-double *\fIdataArr\fR;
-int *\fInumValues\fR;
-int *\fIarraySize\fR;
-Tcl_FreeProc *\fIfreeProc\fR;
-.RE
-.CE
-.TP
-Description:
-Resets the components of the vector pointed to by \fIvecPtr\fR.
-Calling \fBBlt_ResetVector\fR will trigger the vector to dispatch
-notifications to its clients. \fIDataArr\fR is the array of doubles
-which represents the vector data. \fINumValues\fR is the number of
-elements in the array. \fIArraySize\fR is the actual size of the array
-(the array may be bigger than the number of values stored in
-it). \fIFreeProc\fP indicates how the storage for the vector component
-array (\fIdataArr\fR) was allocated. It is used to determine how to
-reallocate memory when the vector is resized or destroyed. It must be
-\f(CWTCL_DYNAMIC\fR, \f(CWTCL_STATIC\fR, \f(CWTCL_VOLATILE\fR, or a pointer
-to a function to free the memory allocated for the vector array. If
-\fIfreeProc\fR is \f(CWTCL_VOLATILE\fR, it indicates that \fIdataArr\fR
-must be copied and saved. If \fIfreeProc\fR is \f(CWTCL_DYNAMIC\fR, it
-indicates that \fIdataArr\fR was dynamically allocated and that Tcl
-should free \fIdataArr\fR if necessary. \f(CWStatic\fR indicates that
-nothing should be done to release storage for \fIdataArr\fR.
-.TP
-Results:
-Returns \f(CWTCL_OK\fR if the vector is successfully resized. If
-\fInewSize\fR is negative, a vector \fIvecName\fR does not exist, or
-memory cannot be allocated for the vector, then \f(CWTCL_ERROR\fR is
-returned and \fIinterp->result\fR will contain an error message.
-.RE
-.sp
-.PP
-\fBBlt_ResizeVector\fR
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-int \fBBlt_ResizeVector\fR (\fIvecPtr\fR, \fInewSize\fR)
-.RS 1.25i
-Blt_Vector *\fIvecPtr\fR;
-int \fInewSize\fR;
-.RE
-.CE
-.TP
-Description:
-Resets the length of the vector pointed to by \fIvecPtr\fR to
-\fInewSize\fR. If \fInewSize\fR is smaller than the current size of
-the vector, it is truncated. If \fInewSize\fR is greater, the vector
-is extended and the new components are initialized to \f(CW0.0\fR.
-Calling \fBBlt_ResetVector\fR will trigger the vector to dispatch
-notifications.
-.TP
-Results:
-Returns \f(CWTCL_OK\fR if the vector is successfully resized. If
-\fInewSize\fR is negative or memory can not be allocated for the vector,
-then \f(CWTCL_ERROR\fR is returned and \fIinterp->result\fR will contain
-an error message.
-.sp
-.PP
-\fBBlt_VectorExists\fR
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-int \fBBlt_VectorExists\fR (\fIinterp\fR, \fIvecName\fR)
-.RS 1.25i
-Tcl_Interp *\fIinterp\fR;
-char *\fIvecName\fR;
-.RE
-.CE
-.TP
-Description:
-Indicates if a vector named \fIvecName\fR exists in \fIinterp\fR.
-.TP
-Results:
-Returns \f(CW1\fR if a vector \fIvecName\fR exists and \f(CW0\fR otherwise.
-.RE
-.sp
-.PP
-If your application needs to be notified when a vector changes, it can
-allocate a unique \fIclient identifier\fR for itself. Using this
-identifier, you can then register a call-back to be made whenever the
-vector is updated or destroyed. By default, the call-backs are made at
-the next idle point. This can be changed to occur at the time the
-vector is modified. An application can allocate more than one
-identifier for any vector. When the client application is done with
-the vector, it should free the identifier.
-.PP
-The call-back routine must of the following type.
-.CS
-.RS
-.sp
-typedef void (\fBBlt_VectorChangedProc\fR) (Tcl_Interp *\fIinterp\fR,
-.RS .25i
-ClientData \fIclientData\fR, Blt_VectorNotify \fInotify\fR);
-.RE
-.sp
-.RE
-.CE
-.fi
-\fIClientData\fR is passed to this routine whenever it is called. You
-can use this to pass information to the call-back. The \fInotify\fR
-argument indicates whether the vector has been updated of destroyed. It
-is an enumerated type.
-.CS
-.RS
-.sp
-typedef enum {
- \f(CWBLT_VECTOR_NOTIFY_UPDATE\fR=1,
- \f(CWBLT_VECTOR_NOTIFY_DESTROY\fR=2
-} \fBBlt_VectorNotify\fR;
-.sp
-.RE
-.CE
-.PP
-\fBBlt_AllocVectorId\fR
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-Blt_VectorId \fBBlt_AllocVectorId\fR (\fIinterp\fR, \fIvecName\fR)
-.RS 1.25i
-Tcl_Interp *\fIinterp\fR;
-char *\fIvecName\fR;
-.RE
-.CE
-.TP
-Description:
-Allocates an client identifier for with the vector \fIvecName\fR.
-This identifier can be used to specify a call-back which is triggered
-when the vector is updated or destroyed.
-.TP
-Results:
-Returns a client identifier if successful. If \fIvecName\fR is not
-the name of a vector, then \f(CWNULL\fR is returned and
-\fIinterp->result\fR will contain an error message.
-.RE
-.sp
-.PP
-\fBBlt_GetVectorById\fR
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-int \fBBlt_GetVector\fR (\fIinterp\fR, \fIclientId\fR, \fIvecPtrPtr\fR)
-.RS 1.25i
-Tcl_Interp *\fIinterp\fR;
-Blt_VectorId \fIclientId\fR;
-Blt_Vector **\fIvecPtrPtr\fR;
-.RE
-.CE
-.TP 1i
-Description:
-Retrieves the vector used by \fIclientId\fR. \fIClientId\fR is a valid
-vector client identifier allocated by \fBBlt_AllocVectorId\fR.
-\fIVecPtrPtr\fR will point be set to the address of the vector.
-.TP
-Results:
-Returns \f(CWTCL_OK\fR if the vector is successfully retrieved.
-.RE
-.sp
-.PP
-\fBBlt_SetVectorChangedProc\fR
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-void \fBBlt_SetVectorChangedProc\fR (\fIclientId\fR, \fIproc\fR, \fIclientData\fR);
-.RS 1.25i
-Blt_VectorId \fIclientId\fR;
-Blt_VectorChangedProc *\fIproc\fR;
-ClientData *\fIclientData\fR;
-.RE
-.CE
-.TP
-Description:
-Specifies a call-back routine to be called whenever the vector
-associated with \fIclientId\fR is updated or deleted. \fIProc\fR is a
-pointer to call-back routine and must be of the type
-\fBBlt_VectorChangedProc\fR. \fIClientData\fR is a one-word value to
-be passed to the routine when it is invoked. If \fIproc\fR is
-\f(CWNULL\fR, then the client is not notified.
-.TP
-Results:
-The designated call-back procedure will be invoked when the vector is
-updated or destroyed.
-.RE
-.sp
-.PP
-\fBBlt_FreeVectorId\fR
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-void \fBBlt_FreeVectorId\fR (\fIclientId\fR);
-.RS 1.25i
-Blt_VectorId \fIclientId\fR;
-.RE
-.CE
-.TP
-Description:
-Frees the client identifier. Memory allocated for the identifier
-is released. The client will no longer be notified when the
-vector is modified.
-.TP
-Results:
-The designated call-back procedure will be no longer be invoked when
-the vector is updated or destroyed.
-.RE
-.sp
-.PP
-\fBBlt_NameOfVectorId\fR
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-char *\fBBlt_NameOfVectorId\fR (\fIclientId\fR);
-.RS 1.25i
-Blt_VectorId \fIclientId\fR;
-.RE
-.CE
-.TP
-Description:
-Retrieves the name of the vector associated with the client identifier
-\fIclientId\fR.
-.TP
-Results:
-Returns the name of the vector associated with \fIclientId\fR. If
-\fIclientId\fR is not an identifier or the vector has been destroyed,
-\f(CWNULL\fR is returned.
-.RE
-.sp
-.PP
-\fBBlt_InstallIndexProc\fR
-.RS .25i
-.TP 1i
-Synopsis:
-.CS
-void \fBBlt_InstallIndexProc\fR (\fIindexName\fR, \fIprocPtr\fR)
-.RS 1.25i
-char *\fIindexName\fR;
-Blt_VectorIndexProc *\fIprocPtr\fR;
-.RE
-.CE
-.TP
-Description:
-Registers a function to be called to retrieved the index \fIindexName\fR
-from the vector's array variable.
-.sp
-typedef double Blt_VectorIndexProc(Vector *vecPtr);
-.sp
-The function will be passed a pointer to the vector. The function must
-return a double representing the value at the index.
-.TP
-Results:
-The new index is installed into the vector.
-.RE
-.RE
-.SH C API EXAMPLE
-The following example opens a file of binary data and stores it in an
-array of doubles. The array size is computed from the size of the
-file. If the vector "data" exists, calling \fBBlt_VectorExists\fR,
-\fBBlt_GetVector\fR is called to get the pointer to the vector.
-Otherwise the routine \fBBlt_CreateVector\fR is called to create a new
-vector and returns a pointer to it. Just like the Tcl interface, both
-a new Tcl command and array variable are created when a new vector is
-created. It doesn't make any difference what the initial size of the
-vector is since it will be reset shortly. The vector is updated when
-\fBlt_ResetVector\fR is called. Blt_ResetVector makes the changes
-visible to the Tcl interface and other vector clients (such as a graph
-widget).
-.sp
-.CS
-#include <tcl.h>
-#include <blt.h>
-...
-Blt_Vector *vecPtr;
-double *newArr;
-FILE *f;
-struct stat statBuf;
-int numBytes, numValues;
-
-f = fopen("binary.dat", "r");
-fstat(fileno(f), &statBuf);
-numBytes = (int)statBuf.st_size;
-
-/* Allocate an array big enough to hold all the data */
-newArr = (double *)malloc(numBytes);
-numValues = numBytes / sizeof(double);
-fread((void *)newArr, numValues, sizeof(double), f);
-fclose(f);
-
-if (Blt_VectorExists(interp, "data")) {
- if (Blt_GetVector(interp, "data", &vecPtr) != TCL_OK) {
- return TCL_ERROR;
- }
-} else {
- if (Blt_CreateVector(interp, "data", 0, &vecPtr) != TCL_OK) {
- return TCL_ERROR;
- }
-}
-/*
- * Reset the vector. Clients will be notified when Tk is idle.
- * TCL_DYNAMIC tells the vector to free the memory allocated
- * if it needs to reallocate or destroy the vector.
- */
-if (Blt_ResetVector(vecPtr, newArr, numValues, numValues,
- TCL_DYNAMIC) != TCL_OK) {
- return TCL_ERROR;
-}
-.CE
-.SH "INCOMPATIBILITIES"
-In previous versions, if the array variable isn't global
-(i.e. local to a Tcl procedure), the vector is automatically
-destroyed when the procedure returns.
-.CS
-proc doit {} {
- # Temporary vector x
- vector x(10)
- set x(9) 2.0
- ...
-}
-.CE
-.PP
-This has changed. Variables are not automatically destroyed when
-their variable is unset. You can restore the old behavior by
-setting the "-watchunset" switch.
-.CE
-.SH KEYWORDS
-vector, graph, widget
diff --git a/blt3.0.1/man/watch.mann b/blt3.0.1/man/watch.mann
deleted file mode 100644
index 5080943..0000000
--- a/blt3.0.1/man/watch.mann
+++ /dev/null
@@ -1,137 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\"
-.so man.macros
-.TH watch n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-.SH NAME
-watch \- call Tcl procedures before and after each command
-.SH SYNOPSIS
-\fBwatch create\fR \fIwatchName\fR ?\fIoptions\fR?
-.sp
-\fBwatch activate\fR \fIwatchName\fR
-.sp
-\fBwatch deactivate\fR \fIwatchName\fR
-.sp
-\fBwatch delete\fR \fIwatchName\fR
-.sp
-\fBwatch configure\fR \fIwatchName\fR ?\fIoptions\fR
-.sp
-\fBwatch info\fR \fIwatchName\fR
-.sp
-\fBwatch names\fR
-.BE
-.SH DESCRIPTION
-The \fBwatch\fR command arranges for Tcl procedures to be invoked
-before and after the execution of each Tcl command.
-.SH INTRODUCTION
-When an error occurs in Tcl, the global variable \fIerrorInfo\fR will
-contain a stack-trace of the active procedures when the error occured.
-Sometimes, however, the stack trace is insufficient. You may need to
-know exactly where in the program's execution the error occured. In
-cases like this, a more general tracing facility would be useful.
-.PP
-The \fBwatch\fR command lets you designate Tcl procedures to be
-invoked before and after the execution of each Tcl command. This
-means you can display the command line and its results for each
-command as it executes. Another use is to profile your Tcl commands.
-You can profile any Tcl command (like \fBif\fR and \fBset\fR), not just
-Tcl procedures.
-.SH EXAMPLE
-The following example use \fBwatch\fR to trace Tcl commands
-(printing to standard error) both before and after they are executed.
-.CS
-proc preCmd { level command argv } {
- set name [lindex $argv 0]
- puts stderr "$level $name => $command"
-}
-
-proc postCmd { level command argv retcode results } {
- set name [lindex $argv 0]
- puts stderr "$level $name => $argv\n<= ($retcode) $results"
-}
-watch create trace \\
- -postcmd postCmd -precmd preCmd
-.CE
-.SH "OPERATIONS"
-The following operations are available for the \fBwatch\fR command:
-.TP
-\fBwatch activate \fIwatchName\fR
-Activates the watch, causing Tcl commands the be traced to the
-maximum depth selected.
-.TP
-\fBwatch create \fIwatchName\fR ?\fIoptions\fR?...
-Creates a new watch \fIwatchName\fR. It's an error if another watch
-\fIwatchName\fR already exists and an error message will be returned.
-\fIOptions\fR may have any of the values accepted by the
-\fBwatch configure\fR command.
-This command returns the empty string.
-.TP
-\fBwatch configure \fIwatchName\fR ?\fIoptions...\fR?
-Queries or modifies the configuration options of the watch \fIwatchName\fR.
-\fIWatchName\fR is the name of a watch.
-\fIOptions\fR may have any of the following values:
-.RS
-.TP
-\fB\-active \fIboolean\fR
-Specifies if the watch is active.
-By default, watches are active when created.
-.TP
-\fB\-postcmd \fIstring\fR
-Specifies a Tcl procedure to be called immediately after each Tcl
-command. \fIString\fR is name of a Tcl procedure and any extra
-arguments to be passed to it. Before \fIstring\fR is invoked, five
-more arguments are appended: 1) the current level 2) the current
-command line 3) a list containing the command after substitutions and
-split into words 4) the return code of the command, and 5) the results
-of the command. The return status of the postcmd procedure is always
-ignored.
-.TP
-\fB\-precmd \fIstring\fR
-Specifies a Tcl procedure to be called immediately before each Tcl
-command. \fIString\fR is name of a Tcl procedure and any extra
-arguments to be passed to it. Before \fIstring\fR is invoked, three
-arguments are appended: 1) the current level 2) the current command
-line, and 3) a list containing the command after substitutions and
-split into words. The return status of the \fB\-precmd\fR procedure
-is always ignored.
-.TP
-\fB\-maxlevel \fInumber\fR
-Specifies the maximum evaluation depth to watch Tcl commands.
-The default maximum level is 10000.
-.RE
-.TP
-\fBwatch deactivate \fIwatchName\fR
-Deactivates the watch. The \fB\-precmd\fR and \fB\-postcmd\fR procedures
-will no longer be invoked.
-.TP
-\fBwatch info \fIwatchName\fR
-Returns the configuration information associated with the
-watch \fIwatchName\fR. \fIWatchName\fR is the name of a watch.
-.TP
-\fBwatch names\fR ?\fIstate\fR?
-Lists the names of the watches for a given state. \fIState\fR may be
-one of the following: \f(CWactive\fR, \f(CWidle\fR, or \f(CWignore\fR. If a
-\fIstate\fR argument isn't specified,
- all watches are
-listed.
-.RE
-.SH KEYWORDS
-debug, profile
diff --git a/blt3.0.1/man/winop.mann b/blt3.0.1/man/winop.mann
deleted file mode 100644
index 189680d..0000000
--- a/blt3.0.1/man/winop.mann
+++ /dev/null
@@ -1,131 +0,0 @@
-'\"
-'\" Copyright 1991-1997 by Bell Labs Innovations for Lucent Technologies.
-'\"
-'\" Permission to use, copy, modify, and distribute this software and its
-'\" documentation for any purpose and without fee is hereby granted, provided
-'\" that the above copyright notice appear in all copies and that both that the
-'\" copyright notice and warranty disclaimer appear in supporting documentation,
-'\" and that the names of Lucent Technologies any of their entities not be used
-'\" in advertising or publicity pertaining to distribution of the software
-'\" without specific, written prior permission.
-'\"
-'\" Lucent Technologies disclaims all warranties with regard to this software,
-'\" including all implied warranties of merchantability and fitness. In no event
-'\" shall Lucent Technologies be liable for any special, indirect or
-'\" consequential damages or any damages whatsoever resulting from loss of use,
-'\" data or profits, whether in an action of contract, negligence or other
-'\" tortuous action, arising out of or in connection with the use or performance
-'\" of this software.
-'\"
-'\" Window command created by George Howlett.
-'\"
-.so man.macros
-.TH winop n BLT_VERSION BLT "BLT Built-In Commands"
-.BS
-'\" Note: do not modify the .SH NAME line immediately below!
-.SH NAME
-winop \- Perform assorted window operations
-.SH SYNOPSIS
-\fBwinop lower\fR ?\fIwindow\fR?...
-.sp
-\fBwinop map\fR ?\fIwindow\fR?...
-.sp
-\fBwinop move \fIwindow x y\fR
-.sp
-\fBwinop raise\fR ?\fIwindow\fR?...
-.sp
-\fBwinop snap \fIwindow photoName\fR
-.sp
-\fBwinop unmap\fR ?\fIwindow\fR?...
-.sp
-\fBwinop warpto\fR ?\fIwindow\fR?
-.BE
-.SH DESCRIPTION
-The \fBwinop\fR command performs various window operations on Tk
-windows using low-level Xlib function calls to work around window
-manager pecularities.
-.SH INTRODUCTION
-Tk has several commands for manipulating its windows: \fBraise\fR,
-\fBlower\fR, \fBwm\fR, etc. These commands ask the window manager to
-perform operations on Tk windows. In some cases, a particular window
-manager won't perform the operation as expected.
-.PP
-For example, if you positioned a toplevel window using \fBwm geometry\fR,
-the window may not actually be at those particular coordinates. The
-position of the window may be offset by dimensions of the title bar added
-by the window manager.
-.PP
-In situations like these, the \fBwinop\fR command can be used to
-workaround these difficulties. Instead, it makes low-level Xlib
-(such \fBXRaiseWindow\fR and \fBXMapWindow\fR) calls to perform these
-operations.
-.CS
-toplevel .top
-wm withdraw .top
-
-# Set the geometry to make the window manager
-# place the window.
-wm geometry .top +100+100
-
-# Move the window to the desired location
-# and "update" to force the window manager
-# to recognize it.
-winop move .top 100 100
-update
-
-wm deiconify .top
-winop move .top 100 100
-.CE
-.SH OPERATIONS
-The following operations are available for the \fBwinop\fR command:
-.TP
-\fBwinop lower\fR ?\fIwindow\fR?...
-Lowers \fIwindow\fR to the bottom of the X window stack. \fIWindow\fR is
-the path name of a Tk window.
-.TP
-\fBwinop map\fR ?\fIwindow\fR?...
-Maps \fIwindow\fR on the screen. \fIWindow\fR
-is the path name of a Tk window. If \fIwindow\fR is already mapped,
-this command has no effect.
-.TP
-\fBwinop move \fIwindow x y\fR
-Move \fIwindow\fR to the screen location specified by \fIx\fR
-and \fIy\fR. \fIWindow\fR is the path name of a Tk window, while
-\fIx\fR and \fIy\fR are screen coordinates. This command returns
-the empty string.
-.TP
-\fBwinop raise\fR ?\fIwindow\fR?...
-Raises \fIwindow\fR to the top of the X window stack. \fIWindow\fR must be
-a valid path name of a Tk window. This command returns the empty string.
-.TP
-\fBwinop snap \fIwindow photoName\fR
-Takes a snapshot of the \fIwindow\fR and stores the contents in the
-photo image \fIphotoName\fR. \fIWindow\fR is the valid path name of a
-Tk window which must be totally visible (unobscured). \fIPhotoName\fR
-is the name of a Tk photo image which must already exist. This command
-can fail if the window is obscured in any fashion, such as covered by
-another window or partially offscreen. In that case, an error message
-is returned.
-.TP
-\fBwinop unmap\fR ?\fIwindow\fR?...
-Unmaps \fIwindow\fR from the screen. \fIWindow\fR is the path name of a Tk
-window.
-.TP
-\fBwinop warpto\fR ?\fIwindow\fR?
-Warps the pointer to \fIwindow\fR. \fIWindow\fR is the path name of a Tk window
-which must be mapped. If \fIwindow\fR is in the form \fI at x,y\fR, where
-\fIx\fR and \fIy\fR are root screen coordinates, the pointer is warped to
-that location on the screen.
-.sp
-[\fII've never heard a good case for warping the pointer in an
-application. It can be useful for testing, but in applications, it's
-always a bad idea. Simply stated, the user owns the pointer, not the
-application. If you have an application that needs it, I'd like to
-hear about it.\fR]
-.sp
-If no \fIwindow\fR argument is present the current location of the
-pointer is returned. The location is returned as a list in the form
-"\fIx y\fR", where \fIx\fR and \fIy\fR are the current coordinates of
-the pointer.
-.SH KEYWORDS
-window, map, raise, lower, pointer, warp
diff --git a/blt3.0.1/src/Makefile-cyg.in b/blt3.0.1/src/Makefile-cyg.in
deleted file mode 100644
index faf45eb..0000000
--- a/blt3.0.1/src/Makefile-cyg.in
+++ /dev/null
@@ -1,672 +0,0 @@
-
-# ------------------------------------------------------------------------
-# Makefile for static version of BLT library
-# ------------------------------------------------------------------------
-
-# ------------------------------------------------------------------------
-# C Compiler options
-# ------------------------------------------------------------------------
-
-BLT_LIBRARY = @BLT_LIBRARY@
-CC = @CC@
-CFLAGS = @CFLAGS@
-DEFINES = @DEFINES@
-EXTRA_CFLAGS = @GCCFLAGS@ $(SO_CFLAGS)
-LDFLAGS = @LDFLAGS@ @LD_RUN_PATH@
-LIB_PREFIX = @LIB_PREFIX@
-TCLLIBPATH = @TCL_LIB_DIR@/tcl at TCL_VERSION@
-TCL_DBG = @TCL_DBGX@
-
-SO_CFLAGS = @BLT_SO_CFLAGS@
-LIB_SUFFIX = @BLT_LIB_SUFFIX@
-SO_EXT = @BLT_SO_EXT@
-SO_PREFIX = @BLT_SO_PREFIX@
-SO_LD = @BLT_SO_LD@
-SO_LDFLAGS = @BLT_SO_LD_FLAGS@ @LD_RUN_PATH@
-
-IMPLIB_PREFIX = @IMPLIB_PREFIX@
-IMPLIB_EXT = @IMPLIB_EXT@
-
-EXPAT_INC_SPEC = @EXPAT_INC_SPEC@
-EXPAT_LIB_SPEC = @EXPAT_LIB_SPEC@
-FT2_INC_SPEC = @FT2_INC_SPEC@
-FT2_LIB_SPEC = @FT2_LIB_SPEC@
-JPG_INC_SPEC = @JPG_INC_SPEC@
-JPG_LIB_SPEC = @JPG_LIB_SPEC@
-MYSQL_INC_SPEC = @MYSQL_INC_SPEC@
-MYSQL_LIB_SPEC = @MYSQL_LIB_SPEC@
-PNG_INC_SPEC = @PNG_INC_SPEC@
-PNG_LIB_SPEC = @PNG_LIB_SPEC@ $(Z_LIB_SPEC)
-TCL_INC_SPEC = @TCL_INC_SPEC@
-TCL_LIB_SPEC = @TCL_LIB_SPEC@
-TCL_STUBS_SPEC = @TCL_STUBS_SPEC@
-TIF_INC_SPEC = @TIF_INC_SPEC@
-TIF_LIB_SPEC = @TIF_LIB_SPEC@
-TK_INC_SPEC = @TK_INC_SPEC@
-TK_LIB_SPEC = @TK_LIB_SPEC@
-TK_STUBS_SPEC = @TK_STUBS_SPEC@
-X11_INC_SPEC = @X11_INC_SPEC@
-X11_LIB_SPEC = @X11_LIB_SPEC@
-XFT_INC_SPEC = @XFT_INC_SPEC@
-XFT_LIB_SPEC = @XFT_LIB_SPEC@
-XPM_INC_SPEC = @XPM_INC_SPEC@
-XPM_LIB_SPEC = @XPM_LIB_SPEC@
-FTCFG_LIB_SPEC = @FTCFG_LIB_SPEC@
-Z_LIB_SPEC = @Z_LIB_SPEC@
-
-version = @BLT_MAJOR_VERSION@@BLT_MINOR_VERSION@
-
-# ------------------------------------------------------------------------
-# Source and targer installation directories
-# ------------------------------------------------------------------------
-
-bindir = $(exec_prefix)/bin
-datadir = @datadir@
-datarootdir = @datarootdir@
-exec_prefix = @exec_prefix@
-incdir = $(prefix)/include
-includedir = @includedir@
-libdir = @libdir@
-prefix = @prefix@
-scriptdir = $(exec_prefix)/lib
-srcdir = @srcdir@
-pkgdir = @BLT_LIBRARY@
-
-instdirs = $(prefix) \
- $(exec_prefix) \
- $(bindir) \
- $(libdir) \
- $(incdir) \
- $(pkgdir) \
- $(scriptdir)
-
-# ------------------------------------------------------------------------
-# Directories containing Tcl and Tk include files and libraries
-# ------------------------------------------------------------------------
-
-INCLUDES = -I. -I$(srcdir) \
- -I$(srcdir)/../win \
- $(TK_INC_SPEC) \
- $(TCL_INC_SPEC) \
- @INCLUDES@
-
-# ------------------------------------------------------------------------
-# Libraries directives for Tcl, Tk, X11, and BLT
-# ------------------------------------------------------------------------
-
-EXTRA_CORE_LIBS = @LIBS@ @EXTRA_LIBS@
-
-EXTRA_X_LIBS = $(EXTRA_CORE_LIBS)
-
-BLT_X_SO_LIBS = $(TK_LIB_SPEC) \
- $(XFT_LIB_SPEC) \
- $(FTCFG_LIB_SPEC) \
- $(FT2_LIB_SPEC)
-
-BLT_X_A_LIBS = $(BLT_X_SO_LIBS) \
- $(JPG_LIB_SPEC) \
- $(PNG_LIB_SPEC) \
- $(TIF_LIB_SPEC) \
- $(XPM_LIB_SPEC)
-
-BLT_CORE_SO_LIBS =
-
-BLT_CORE_A_LIBS = $(BLT_CORE_SO_LIBS) \
- $(MYSQL_LIB_SPEC) \
- $(EXPAT_LIB_SPEC)
-
-blt_core_name = BLTCore$(version)$(LIB_SUFFIX)
-blt_x_name = BLTX$(version)$(LIB_SUFFIX)
-
-blt_core_so = $(SO_PREFIX)$(blt_core_name)$(SO_EXT)
-blt_core_a = lib$(blt_core_name).a
-
-blt_x_so = $(SO_PREFIX)$(blt_x_name)$(SO_EXT)
-blt_x_a = lib$(blt_x_name).a
-
-blt_core_implib = $(IMPLIB_PREFIX)$(blt_core_name)$(IMPLIB_EXT)
-blt_x_implib = $(IMPLIB_PREFIX)$(blt_x_name)$(IMPLIB_EXT)
-
-blt_dt_csv_name = DataTableCsv$(version)$(LIB_SUFFIX)
-blt_dt_mysql_name = DataTableMysql$(version)$(LIB_SUFFIX)
-blt_dt_tree_name = DataTableTree$(version)$(LIB_SUFFIX)
-blt_dt_vec_name = DataTableVector$(version)$(LIB_SUFFIX)
-blt_dt_xml_name = DataTableXml$(version)$(LIB_SUFFIX)
-
-blt_dt_csv_so = $(blt_dt_csv_name)$(SO_EXT)
-blt_dt_mysql_so = $(blt_dt_mysql_name)$(SO_EXT)
-blt_dt_tree_so = $(blt_dt_tree_name)$(SO_EXT)
-blt_dt_xml_so = $(blt_dt_xml_name)$(SO_EXT)
-blt_dt_vec_so = $(blt_dt_vec_name)$(SO_EXT)
-
-blt_dt_csv_implib = $(IMPLIB_PREFIX)$(blt_dt_csv_name)$(IMPLIB_EXT)
-blt_dt_mysql_implib = $(IMPLIB_PREFIX)$(blt_dt_mysql_name)$(IMPLIB_EXT)
-blt_dt_tree_implib = $(IMPLIB_PREFIX)$(blt_dt_tree_name)$(IMPLIB_EXT)
-blt_dt_vec_implib = $(IMPLIB_PREFIX)$(blt_dt_vec_name)$(IMPLIB_EXT)
-blt_dt_xml_implib = $(IMPLIB_PREFIX)$(blt_dt_xml_name)$(IMPLIB_EXT)
-
-blt_pict_bmp_name = PictureBmp$(version)$(LIB_SUFFIX)
-blt_pict_gif_name = PictureGif$(version)$(LIB_SUFFIX)
-blt_pict_jpg_name = PictureJpg$(version)$(LIB_SUFFIX)
-blt_pict_pbm_name = PicturePbm$(version)$(LIB_SUFFIX)
-blt_pict_pdf_name = PicturePdf$(version)$(LIB_SUFFIX)
-blt_pict_photo_name = PicturePhoto$(version)$(LIB_SUFFIX)
-blt_pict_png_name = PicturePng$(version)$(LIB_SUFFIX)
-blt_pict_ps_name = PicturePs$(version)$(LIB_SUFFIX)
-blt_pict_tif_name = PictureTif$(version)$(LIB_SUFFIX)
-blt_pict_xbm_name = PictureXbm$(version)$(LIB_SUFFIX)
-blt_pict_xpm_name = PictureXpm$(version)$(LIB_SUFFIX)
-
-blt_pict_bmp_so = $(blt_pict_bmp_name)$(SO_EXT)
-blt_pict_gif_so = $(blt_pict_gif_name)$(SO_EXT)
-blt_pict_jpg_so = $(blt_pict_jpg_name)$(SO_EXT)
-blt_pict_pbm_so = $(blt_pict_pbm_name)$(SO_EXT)
-blt_pict_pdf_so = $(blt_pict_pdf_name)$(SO_EXT)
-blt_pict_photo_so = $(blt_pict_photo_name)$(SO_EXT)
-blt_pict_png_so = $(blt_pict_png_name)$(SO_EXT)
-blt_pict_ps_so = $(blt_pict_ps_name)$(SO_EXT)
-blt_pict_tif_so = $(blt_pict_tif_name)$(SO_EXT)
-blt_pict_xbm_so = $(blt_pict_xbm_name)$(SO_EXT)
-blt_pict_xpm_so = $(blt_pict_xpm_name)$(SO_EXT)
-
-blt_pict_bmp_implib = $(IMPLIB_PREFIX)$(blt_pict_bmp_name)$(IMPLIB_EXT)
-blt_pict_gif_implib = $(IMPLIB_PREFIX)$(blt_pict_gif_name)$(IMPLIB_EXT)
-blt_pict_jpg_implib = $(IMPLIB_PREFIX)$(blt_pict_jpg_name)$(IMPLIB_EXT)
-blt_pict_pbm_implib = $(IMPLIB_PREFIX)$(blt_pict_pbm_name)$(IMPLIB_EXT)
-blt_pict_pdf_implib = $(IMPLIB_PREFIX)$(blt_pict_pdf_name)$(IMPLIB_EXT)
-blt_pict_photo_implib = $(IMPLIB_PREFIX)$(blt_pict_photo_name)$(IMPLIB_EXT)
-blt_pict_png_implib = $(IMPLIB_PREFIX)$(blt_pict_png_name)$(IMPLIB_EXT)
-blt_pict_ps_implib = $(IMPLIB_PREFIX)$(blt_pict_ps_name)$(IMPLIB_EXT)
-blt_pict_tif_implib = $(IMPLIB_PREFIX)$(blt_pict_tif_name)$(IMPLIB_EXT)
-blt_pict_xbm_implib = $(IMPLIB_PREFIX)$(blt_pict_xbm_name)$(IMPLIB_EXT)
-blt_pict_xpm_implib = $(IMPLIB_PREFIX)$(blt_pict_xpm_name)$(IMPLIB_EXT)
-
-blt_tree_xml_name = TreeXml$(version)$(LIB_SUFFIX)
-
-blt_tree_xml_so = $(blt_tree_xml_name)$(SO_EXT)
-
-blt_tree_xml_implib = $(IMPLIB_PREFIX)$(blt_tree_xml_name)$(IMPLIB_EXT)
-
-blt_core_pkgs_so = $(blt_dt_csv_so) \
- $(blt_dt_tree_so) \
- $(blt_dt_vec_so)
-ifneq ("$(EXPAT_LIB_SPEC)", "")
- blt_core_pkgs_so += $(blt_dt_xml_so) $(blt_tree_xml_so)
-endif
-ifneq ("$(MYSQL_LIB_SPEC)", "")
- blt_core_pkgs_so += $(blt_dt_mysql_so)
-endif
-
-blt_x_pkgs_so = $(blt_pict_gif_so) \
- $(blt_pict_xbm_so) \
- $(blt_pict_bmp_so) \
- $(blt_pict_pbm_so) \
- $(blt_pict_pdf_so) \
- $(blt_pict_ps_so) \
- $(blt_pict_photo_so)
-ifneq ("$(JPG_LIB_SPEC)", "")
- blt_x_pkgs_so += $(blt_pict_jpg_so)
-endif
-ifneq ("$(PNG_LIB_SPEC)", "")
- blt_x_pkgs_so += $(blt_pict_png_so)
-endif
-ifneq ("$(XPM_LIB_SPEC)", "")
- blt_x_pkgs_so += $(blt_pict_xpm_so)
-endif
-ifneq ("$(XPM_TIF_SPEC)", "")
- blt_x_pkgs_so += $(blt_pict_tif_so)
-endif
-
-ifneq ("$(TCL_STUBS_SPEC)", "")
- tcl_lib_spec=$(TCL_STUBS_SPEC)
-else
- tcl_lib_spec=$(TCL_LIB_SPEC)
-endif
-
-ifneq ("$(TK_STUBS_SPEC)", "")
- tk_lib_spec=$(TK_STUBS_SPEC)
-else
- tk_lib_spec=$(TK_LIB_SPEC)
-endif
-
-ifneq ("$(EXPAT_LIB_SPEC)", "")
- blt_core_pkgs_so += $(blt_dt_xml_so) $(blt_tree_xml_so)
-endif
-
-# ------------------------------------------------------------------------
-# You don't need to edit anything beyond this point
-# ------------------------------------------------------------------------
-
-#N_OBJS = bltTed.o
-#V3_OBJS = bltTri.o bltGrMt.o
-
-#TK_OBJS = tkButton.o tkFrame.o bltScrollbar.o
-
-GRAPH_OBJS = bltGrAxis.o \
- bltGrBar.o \
- bltGrElem.o \
- bltGrHairs.o \
- bltGrLegd.o \
- bltGrLine.o \
- bltGrMarker.o \
- bltGrMisc.o \
- bltGrPen.o \
- bltGrPs.o \
- bltGraph.o
-
-#TREEVIEW_OBJS = bltTreeView.o \
- bltTvCmd.o \
- bltTvCol.o \
- bltTvEdit.o \
- bltTvStyle.o
-
-PICTURE_OBJS = bltPicture.o \
- bltPictCmd.o \
- bltPictDraw.o \
-
-# bltPictMmx.o
-
-#PICTURE_PKG_OBJS = bltPictBmp.o \
- bltPictGif.o \
- bltPictJpg.o \
- bltPictPbm.o \
- bltPictPdf.o \
- bltPictPhoto.o \
- bltPictPng.o \
- bltPictPs.o \
- bltPictTif.o \
- bltPictXbm.o \
- bltPictXpm.o
-
-#TREE_OBJS = bltTree.o \
- bltTreeCmd.o \
-
-#TREE_PKG_OBJS = bltTreeXml.o
-
-DATATABLE_OBJS = bltDataTable.o \
-# bltDtCmd.o \
-
-#DATATABLE_PKG_OBJS = bltDtCsv.o \
- bltDtMysql.o \
- bltDtTree.o \
- bltDtVec.o \
- bltDtXml.o
-
-BLT_CORE_SO_OBJS = bltAlloc.o \
- bltArrayObj.o \
- bltBase64.o \
- bltChain.o \
- $(DATATABLE_OBJS) \
- bltHash.o \
- bltInit.o \
- bltList.o \
- bltNsUtil.o \
- bltParse.o \
- bltPool.o \
- bltDBuffer.o \
- bltSpline.o \
- bltSwitch.o \
- $(TREE_OBJS) \
- bltUtil.o \
- bltVar.o \
- bltVecCmd.o \
- bltVecMath.o \
- bltVector.o \
- bltWinDde.o \
- bltWinUtil.o \
- bltCoreInit.o \
-
-# bltBgexec.o \
- bltCrc32.o \
- bltCsv.o \
- bltDebug.o \
- bltWatch.o \
- bltWinPipe.o \
- pure_api.o
-
-BLT_CORE_A_OBJS = $(BLT_CORE_SO_OBJS) \
- $(TREE_PKG_OBJS) \
- $(DATATABLE_PKG_OBJS)
-
-BLT_X_SO_OBJS = $(GRAPH_OBJS) \
- $(PICTURE_OBJS) \
- $(TREEVIEW_OBJS) \
- bltBgStyle.o \
- bltBind.o \
- bltBusy.o \
- bltConfig.o \
- bltImage.o \
- bltPs.o \
- bltPsAfm.o \
- bltText.o \
- bltWinBitmap.o \
- bltWinDraw.o \
- bltWinFont.o \
- bltWinPainter.o \
- bltWinPrnt.o \
- bltWinWindow.o \
- bltWindow.o \
- bltExtInit.o \
- $(TK_OBJS) $(N_OBJS)
-
-# bltBeep.o \
- bltBitmap.o \
- bltCanvEps.o \
- bltComboBtn.o \
- bltComboEntry.o \
- bltComboMenu.o \
- bltComboTree.o \
- bltContainer.o \
- bltCutbuffer.o \
- bltDragdrop.o \
- bltHtext.o \
- bltListView.o \
- bltMenubar.o \
- bltOldConfig.o \
- bltPaneset.o \
- bltScrollset.o \
- bltTable.o \
- bltTabset.o \
- bltWinop.o \
-
-BLT_X_A_OBJS = $(BLT_X_SO_OBJS) \
- $(PICTURE_PKG_OBJS)
-
-
-BLT_SO_OBJS = $(BLT_CORE_SO_OBJS) \
- $(BLT_X_SO_OBJS)
-
-BLT_A_OBJS = $(BLT_CORE_A_OBJS) \
- $(BLT_X_A_OBJS)
-
-# GNU Make-specific macro
-SRCS = $(patsubst %.o,$(srcdir)/%.c,$(BLT_A_OBJS))
-
-bltwish = bltwish$(version).exe
-bltsh = bltsh$(version).exe
-
-# Public headers to be installed
-headers = $(srcdir)/blt.h \
- $(srcdir)/bltBind.h \
- $(srcdir)/bltChain.h \
- bltHash.h \
- $(srcdir)/bltList.h \
- $(srcdir)/bltPool.h \
- $(srcdir)/bltTree.h \
- $(srcdir)/bltVector.h
-
-CC_OPTS = $(EXTRA_CFLAGS) $(CFLAGS) $(DEFINES) $(INCLUDES)
-MAIN_CC_OPTS = $(EXTRA_CFLAGS) $(CFLAGS) $(DEFINES) $(INCLUDES)
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-DESTDIR =
-RANLIB = @RANLIB@
-SHELL = /bin/sh
-AR = ar rc
-RM = rm -f
-LINT = splint
-LINTFLAGS = #-axhbns
-XREF = cxref
-XREFFLAGS = -dltR
-LN_S = @LN_S@
-VPATH = $(srcdir)
-
-all: build_libs build_demos
-
-build_demos: $(bltsh) $(bltwish)
-build_libs: build_ at BLT_TARGET@
-
-build_shared: $(blt_core_so) $(blt_x_so) build_core_pkgs build_x_pkgs
-build_static: $(blt_core_a) $(blt_x_a)
-build_core_pkgs: $(blt_core_pkgs_so)
-build_x_pkgs: $(blt_x_pkgs_so)
-
-$(bltwish): $(blt_core_a) $(blt_x_a) $(srcdir)/bltWinMain.c $(srcdir)/tkConsole.o
- $(RM) $(bltwish)
- $(CC) $(MAIN_CC_OPTS) $(LDFLAGS) -o $(bltwish) \
- -DTCLLIBPATH=\"$(TCLLIBPATH)\" \
- $(srcdir)/bltWinMain.c $(srcdir)/tkConsole.c \
- $(blt_x_a) $(blt_core_a) \
- $(TK_LIB_SPEC) $(TCL_LIB_SPEC) \
- $(BLT_X_A_LIBS) $(BLT_CORE_A_LIBS) \
- $(EXTRA_X_LIBS) -mwindows
-
-$(bltsh): $(blt_core_a) $(srcdir)/bltWinMain.c
- $(RM) $(bltsh)
- $(CC) $(CC_OPTS) $(LDFLAGS) -o $(bltsh) \
- -DTCL_ONLY -DTCLLIBPATH=\"$(TCLLIBPATH)\" \
- $(srcdir)/bltWinMain.c \
- $(blt_core_a) \
- $(TCL_STUBS_SPEC) $(TCL_LIB_SPEC) \
- $(BLT_CORE_A_LIBS) \
- $(EXTRA_CORE_LIBS) -mconsole
-
-$(blt_core_a): $(BLT_CORE_A_OBJS)
- $(RM) $@
- $(AR) $@ $(BLT_CORE_A_OBJS)
- $(RANLIB) $@
-
-$(blt_x_a): $(BLT_X_A_OBJS)
- $(RM) $@
- $(AR) $@ $(BLT_X_A_OBJS)
- $(RANLIB) $@
-
-$(blt_core_so): $(BLT_CORE_SO_OBJS)
- $(RM) $@
- $(CC) -shared -Wl,--dll -o $(blt_core_so) \
- -Wl,--out-implib=$(blt_core_implib) \
- $(BLT_CORE_SO_OBJS) $(BLT_CORE_SO_LIBS) $(tcl_lib_spec) \
- -mconsole
-
-$(blt_x_so): $(BLT_X_SO_OBJS) bltExtInit.o $(blt_core_so)
- $(RM) $@
- $(CC) -shared -o $(blt_x_so) \
- -Wl,--out-implib=$(blt_x_implib) \
- $(BLT_X_SO_OBJS) $(blt_core_so) \
- $(BLT_X_SO_LIBS) $(BLT_CORE_SO_LIBS) \
- $(tcl_lib_spec) $(tk_lib_spec) \
- -mwindows -lwinspool
-
-$(blt_dt_mysql_so): bltDtMysql.o $(blt_core_implib)
- $(RM) $@
- $(CC) -shared -o $(blt_dt_mysql_so) \
- -Wl,--out-implib=$(blt_dt_mysql_implib) bltDtMysql.o \
- $(blt_core_so) $(tcl_lib_spec) $(MYSQL_LIB_SPEC)
-
-$(blt_dt_xml_so): bltDtXml.o $(blt_core_implib)
- $(RM) $@
- $(CC) -shared -o $(blt_dt_xml_so) \
- -Wl,--out-implib=$(blt_dt_xml_implib) bltDtXml.o \
- $(blt_core_so) $(tcl_lib_spec) $(EXPAT_LIB_SPEC)
-
-$(blt_dt_csv_so): bltDtCsv.o $(blt_core_implib)
- $(RM) $@
- $(CC) -shared -Wl,--dll -o $(blt_dt_csv_so) \
- -Wl,--out-implib=$(blt_dt_csv_implib) bltDtCsv.o \
- $(blt_core_so) $(tcl_lib_spec)
-
-$(blt_dt_vec_so): bltDtVec.o $(blt_core_implib)
- $(RM) $@
- $(CC) -shared -o $(blt_dt_vec_so) \
- -Wl,--out-implib=$(blt_dt_vec_implib) bltDtVec.o \
- $(blt_core_so) $(tcl_lib_spec)
-
-$(blt_dt_tree_so): bltDtTree.o $(blt_core_implib)
- $(RM) $@
- $(CC) -shared -o $(blt_dt_tree_so) \
- -Wl,--out-implib=$(blt_dt_tree_implib) bltDtTree.o \
- $(blt_core_so) $(tcl_lib_spec)
-
-$(blt_tree_xml_so): bltTreeXml.o $(blt_core_implib)
- $(RM) $@
- $(CC) -shared -o $(blt_tree_xml_so) \
- -Wl,--out-implib=$(blt_tree_xml_implib) bltTreeXml.o \
- $(blt_core_so) $(tcl_lib_spec) $(EXPAT_LIB_SPEC)
-
-$(blt_pict_bmp_so): bltPictBmp.o $(blt_core_so) $(blt_x_so)
- $(RM) $@
- $(CC) -shared -o $(blt_pict_bmp_so) \
- -Wl,--out-implib=$(blt_pict_bmp_implib) bltPictBmp.o \
- $(blt_core_so) $(blt_x_so) $(tcl_lib_spec)
-
-$(blt_pict_gif_so): bltPictGif.o $(blt_core_so) $(blt_x_so)
- $(RM) $@
- $(CC) -shared -o $(blt_pict_gif_so) \
- -Wl,--out-implib=$(blt_pict_gif_implib) bltPictGif.o \
- $(blt_core_so) $(blt_x_so) $(tcl_lib_spec)
-
-
-$(blt_pict_jpg_so): bltPictJpg.o $(blt_core_so) $(blt_x_so)
- $(RM) $@
- $(CC) -shared -o $(blt_pict_jpg_so) \
- -Wl,--out-implib=$(blt_pict_jpg_implib) bltPictJpg.o \
- $(blt_core_so) $(blt_x_so) $(tcl_lib_spec) $(JPG_LIB_SPEC)
-
-$(blt_pict_png_so): bltPictPng.o $(blt_core_so) $(blt_x_so)
- $(RM) $@
- $(CC) -shared -o $(blt_pict_png_so) \
- -Wl,--out-implib=$(blt_pict_png_implib) bltPictPng.o \
- $(blt_core_so) $(blt_x_so) $(tcl_lib_spec) $(PNG_LIB_SPEC)
-
-
-$(blt_pict_pbm_so): bltPictPbm.o $(blt_core_so) $(blt_x_so)
- $(RM) $@
- $(CC) -shared -o $(blt_pict_pbm_so) \
- -Wl,--out-implib=$(blt_pict_pbm_implib) bltPictPbm.o \
- $(blt_core_so) $(blt_x_so) $(tcl_lib_spec)
-
-$(blt_pict_pdf_so): bltPictPdf.o $(blt_core_so) $(blt_x_so)
- $(RM) $@
- $(CC) -shared -o $(blt_pict_pdf_so) \
- -Wl,--out-implib=$(blt_pict_pdf_implib) bltPictPdf.o \
- $(blt_core_so) $(blt_x_so) $(tk_lib_spec) $(tcl_lib_spec)
-
-$(blt_pict_tif_so): bltPictTif.o $(blt_core_so) $(blt_x_so)
- $(RM) $@
- $(CC) -shared -o $(blt_pict_tif_so) \
- -Wl,--out-implib=$(blt_pict_tif_implib) bltPictTif.o \
- $(blt_core_so) $(blt_x_so) $(tcl_lib_spec) $(TIF_LIB_SPEC)
-
-$(blt_pict_xbm_so): bltPictXbm.o $(blt_core_so) $(blt_x_so)
- $(RM) $@
- $(CC) -shared -o $(blt_pict_xbm_so) \
- -Wl,--out-implib=$(blt_pict_xbm_implib) bltPictXbm.o \
- $(blt_core_so) $(blt_x_so) $(tcl_lib_spec)
-
-$(blt_pict_xpm_so): bltPictXpm.o $(blt_core_so) $(blt_x_so)
- $(RM) $@
- $(CC) -shared -o $(blt_pict_xpm_so) \
- -Wl,--out-implib=$(blt_pict_xpm_implib) bltPictXpm.o \
- $(blt_core_so) $(blt_x_so) $(tcl_lib_spec) $(XPM_LIB_SPEC)
-
-$(blt_pict_ps_so): bltPictPs.o $(blt_core_so) $(blt_x_so)
- $(RM) $@
- $(CC) -shared -o $(blt_pict_ps_so) \
- -Wl,--out-implib=$(blt_pict_ps_implib) bltPictPs.o \
- $(blt_core_so) $(blt_x_so) $(tk_lib_spec) $(tcl_lib_spec)
-
-$(blt_pict_photo_so): bltPictPhoto.o $(blt_core_so) $(blt_x_so)
- $(RM) $@
- $(CC) -shared -o $(blt_pict_photo_so) \
- -Wl,--out-implib=$(blt_pict_photo_implib) bltPictPhoto.o \
- $(blt_core_so) $(blt_x_so) $(tk_lib_spec) $(tcl_lib_spec)
-
-
-install: mkdirs install-demos install-libs install-headers
-
-install-libs: install- at BLT_TARGET@
-
-install-demos: $(bltwish) $(bltsh)
- $(INSTALL) -m 0755 $(bltwish) $(DESTDIR)$(bindir)
- $(INSTALL) -m 0755 $(bltsh) $(DESTDIR)$(bindir)
-
-install-shared: $(blt_core_so) $(blt_x_so) install-pkgs install-static
- $(INSTALL) -m 0755 $(blt_core_so) $(DESTDIR)$(bindir)
- $(INSTALL) -m 0755 $(blt_x_so) $(DESTDIR)$(bindir)
-
-install-static: $(blt_core_a) $(blt_x_a)
- $(INSTALL_DATA) $(blt_core_a) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(blt_x_a) $(DESTDIR)$(libdir)
-
-install-implib: $(blt_core_implib) $(blt_x_implib)
- $(INSTALL_DATA) $(blt_core_implib) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(blt_x_implib) $(DESTDIR)$(libdir)
-
-install-pkgs: $(blt_core_pkgs_so) $(blt_x_pkgs_so)
- for i in $(blt_core_pkgs_so) $(blt_x_pkgs_so) ; do \
- echo $(RM) $(DESTDIR)$(libdir)/$$i ; \
- $(RM) $(DESTDIR)$(libdir)/$$i ; \
- echo $(INSTALL) -m 0755 $$i $(DESTDIR)$(pkgdir) ; \
- $(INSTALL) -m 0755 $$i $(DESTDIR)$(pkgdir) ; \
- done
-
-install-headers:
- @for i in $(headers) ; do \
- echo "installing $$i..." ; \
- $(INSTALL_DATA) -m 0444 $$i $(DESTDIR)$(incdir) ; \
- done
-
-mkdirs:
- @for i in $(instdirs) ; do \
- if test -d $(DESTDIR)$$i ; then \
- : ; \
- else \
- echo " mkdir $(DESTDIR)$$i" ; \
- $(INSTALL) -d $(DESTDIR)$$i ; \
- fi ; \
- done
-
-
-lint:
- $(LINT) $(LINTFLAGS) $(DEFINES) $(INCLUDES) $(SRCS)
-
-xref:
- $(XREF) $(XREFFLAGS) $(DEFINES) $(INCLUDES) $(SRCS)
-
-clean: clean-objs clean-libs clean-demos
-clean-libs: clean- at BLT_TARGET@
-clean-objs:
- $(RM) $(BLT_A_OBJS)
-clean-demos:
- $(RM) $(bltsh)* $(bltwish)* *pure* .pure*
-clean-static:
- $(RM) $(blt_core_a) $(blt_x_a)
-clean-implib:
- $(RM) $(blt_core_implib) $(blt_x_implib)
-clean-pkgs:
- $(RM) $(blt_core_pkgs_so) $(blt_x_pkgs_so)
-clean-shared: clean-pkgs clean-static clean-implib
- $(RM) $(blt_core_so) $(blt_x_so)
-
-distclean: clean
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"* Makefile
- $(RM) config.h bltHash.h Makefile TAGS
-
-bltDtMysql.o: $(srcdir)/bltDtMysql.c
- $(CC) -c $(CC_OPTS) $(MYSQL_INC_SPEC) $?
-
-bltDtXml.o: $(srcdir)/bltDtXml.c
- $(CC) -c $(CC_OPTS) $(EXPAT_INC_SPEC) $?
-
-bltTree.o: $(srcdir)/bltTree.c
- $(CC) -c $(CC_OPTS) $(EXPAT_INC_SPEC) $?
-
-bltTreeXml.o: $(srcdir)/bltTreeXml.c
- $(CC) -c $(CC_OPTS) $(EXPAT_INC_SPEC) $?
-
-bltPictDraw.o: $(srcdir)/bltPictDraw.c $(srcdir)/bltPaintDraw.c
- $(CC) -c $(CC_OPTS) $(FT2_INC_SPEC) $<
-bltPictJpg.o: $(srcdir)/bltPictJpg.c
- $(CC) -c $(CC_OPTS) $(JPG_INC_SPEC) $?
-bltPictTif.o: $(srcdir)/bltPictTif.c
- $(CC) -c $(CC_OPTS) $(TIF_INC_SPEC) $?
-bltPictPng.o: $(srcdir)/bltPictPng.c
- $(CC) -c $(CC_OPTS) $(PNG_INC_SPEC) $?
-bltPictXpm.o: $(srcdir)/bltPictXpm.c
- $(CC) -c $(CC_OPTS) $(XPM_INC_SPEC) $?
-bltCoreInit.o: $(srcdir)/bltCoreInit.c
- $(CC) -c $(CC_OPTS) -DTCL_ONLY -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
- $(srcdir)/bltCoreInit.c
-.c.o:
- $(CC) -c $(CC_OPTS) $<
-
diff --git a/blt3.0.1/src/Makefile-macosx.in b/blt3.0.1/src/Makefile-macosx.in
deleted file mode 100644
index e219d30..0000000
--- a/blt3.0.1/src/Makefile-macosx.in
+++ /dev/null
@@ -1,623 +0,0 @@
-
-# ------------------------------------------------------------------------
-# Makefile for static version of BLT library
-# ------------------------------------------------------------------------
-
-# ------------------------------------------------------------------------
-# C Compiler options
-# ------------------------------------------------------------------------
-
-BLT_LIBRARY = @BLT_LIBRARY@
-CC = @CC@
-CFLAGS = @CFLAGS@
-DEFINES = @DEFINES@
-EXTRA_CFLAGS = @GCCFLAGS@ $(SO_CFLAGS)
-LDFLAGS = @LDFLAGS@ @LD_RUN_PATH@
-LIB_PREFIX = @LIB_PREFIX@
-TCLLIBPATH = @TCL_LIB_DIR@/tcl at TCL_VERSION@
-TCL_DBG = @TCL_DBGX@
-
-SO_CFLAGS = @BLT_SO_CFLAGS@
-LIB_SUFFIX = @BLT_LIB_SUFFIX@
-SO_EXT = @BLT_SO_EXT@
-SO_PREFIX = @BLT_SO_PREFIX@
-SO_LD = @BLT_SO_LD@
-SO_LDFLAGS = @BLT_SO_LDFLAGS@ @LD_RUN_PATH@
-
-EXPAT_INC_SPEC = @EXPAT_INC_SPEC@
-EXPAT_LIB_SPEC = @EXPAT_LIB_SPEC@
-FT2_INC_SPEC = @FT2_INC_SPEC@
-FT2_LIB_SPEC = @FT2_LIB_SPEC@
-JPG_INC_SPEC = @JPG_INC_SPEC@
-JPG_LIB_SPEC = @JPG_LIB_SPEC@
-MYSQL_INC_SPEC = @MYSQL_INC_SPEC@
-MYSQL_LIB_SPEC = @MYSQL_LIB_SPEC@
-PNG_INC_SPEC = @PNG_INC_SPEC@
-PNG_LIB_SPEC = @PNG_LIB_SPEC@ $(Z_LIB_SPEC)
-TCL_INC_SPEC = @TCL_INC_SPEC@
-TCL_LIB_SPEC = @TCL_LIB_SPEC@
-TCL_STUBS_SPEC = @TCL_STUBS_SPEC@
-TIF_INC_SPEC = @TIF_INC_SPEC@
-TIF_LIB_SPEC = @TIF_LIB_SPEC@
-TK_INC_SPEC = @TK_INC_SPEC@
-TK_LIB_SPEC = @TK_LIB_SPEC@
-TK_STUBS_SPEC = @TK_STUBS_SPEC@
-X11_INC_SPEC = @X11_INC_SPEC@
-X11_LIB_SPEC = @X11_LIB_SPEC@
-XFT_INC_SPEC = @XFT_INC_SPEC@
-XFT_LIB_SPEC = @XFT_LIB_SPEC@
-XPM_INC_SPEC = @XPM_INC_SPEC@
-XPM_LIB_SPEC = @XPM_LIB_SPEC@
-XAU_LIB_SPEC = @XAU_LIB_SPEC@
-XRANDR_LIB_SPEC = @XRANDR_LIB_SPEC@
-XRENDER_LIB_SPEC = @XRENDER_LIB_SPEC@
-FTCFG_LIB_SPEC = @FTCFG_LIB_SPEC@
-XDMCP_LIB_SPEC = @XDMCP_LIB_SPEC@
-Z_LIB_SPEC = @Z_LIB_SPEC@
-
-version = @BLT_MAJOR_VERSION@@BLT_MINOR_VERSION@
-
-# ------------------------------------------------------------------------
-# Source and targer installation directories
-# ------------------------------------------------------------------------
-
-bindir = $(exec_prefix)/bin
-datadir = @datadir@
-datarootdir = @datarootdir@
-exec_prefix = @exec_prefix@
-incdir = $(prefix)/include
-includedir = @includedir@
-libdir = @libdir@
-prefix = @prefix@
-scriptdir = $(exec_prefix)/lib
-srcdir = @srcdir@
-pkgdir = @BLT_LIBRARY@
-
-instdirs = $(prefix) \
- $(exec_prefix) \
- $(bindir) \
- $(libdir) \
- $(incdir) \
- $(pkgdir) \
- $(scriptdir)
-
-# ------------------------------------------------------------------------
-# Directories containing Tcl and Tk include files and libraries
-# ------------------------------------------------------------------------
-
-INCLUDES = -I. -I$(srcdir) \
- @INCLUDES@
-
-# ------------------------------------------------------------------------
-# Libraries directives for Tcl, Tk, X11, and BLT
-# ------------------------------------------------------------------------
-
-EXTRA_CORE_LIBS = @LIBS@ @EXTRA_LIBS@
-
-EXTRA_X_LIBS = $(X11_LIB_SPEC) \
- $(XAU_LIB_SPEC) \
- $(XDMCP_LIB_SPEC) \
- $(XRANDR_LIB_SPEC) \
- $(XRENDER_LIB_SPEC) \
- $(EXTRA_CORE_LIBS)
-
-BLT_X_SO_LIBS = $(TK_LIB_SPEC) \
- $(XFT_LIB_SPEC) \
- $(FTCFG_LIB_SPEC) \
- $(XRANDR_LIB_SPEC) \
- $(FT2_LIB_SPEC) \
- $(EXTRA_X_LIBS)
-
-BLT_X_A_LIBS = $(BLT_X_SO_LIBS) \
- $(JPG_LIB_SPEC) \
- $(PNG_LIB_SPEC) \
- $(TIF_LIB_SPEC) \
- $(XPM_LIB_SPEC)
-
-BLT_CORE_SO_LIBS = $(TCL_LIB_SPEC)
-
-BLT_CORE_A_LIBS = $(BLT_CORE_SO_LIBS) \
- $(MYSQL_LIB_SPEC) \
- $(EXPAT_LIB_SPEC)
-
-blt_core_name = BLTCore$(version)$(LIB_SUFFIX)
-blt_x_name = BLTX$(version)$(LIB_SUFFIX)
-
-blt_core_so = lib$(blt_core_name)$(SO_EXT)
-blt_core_a = lib$(blt_core_name).a
-
-blt_x_so = lib$(blt_x_name)$(SO_EXT)
-blt_x_a = lib$(blt_x_name).a
-
-blt_dt_csv_name = TableCsv$(version)$(LIB_SUFFIX)
-blt_dt_mysql_name = TableMysql$(version)$(LIB_SUFFIX)
-blt_dt_tree_name = TableTree$(version)$(LIB_SUFFIX)
-blt_dt_vec_name = TableVector$(version)$(LIB_SUFFIX)
-blt_dt_xml_name = TableXml$(version)$(LIB_SUFFIX)
-
-blt_dt_csv_so = $(blt_dt_csv_name)$(SO_EXT)
-blt_dt_mysql_so = $(blt_dt_mysql_name)$(SO_EXT)
-blt_dt_tree_so = $(blt_dt_tree_name)$(SO_EXT)
-blt_dt_vec_so = $(blt_dt_vec_name)$(SO_EXT)
-blt_dt_xml_so = $(blt_dt_xml_name)$(SO_EXT)
-
-blt_pict_bmp_name = PictureBmp$(version)$(LIB_SUFFIX)
-blt_pict_gif_name = PictureGif$(version)$(LIB_SUFFIX)
-blt_pict_jpg_name = PictureJpg$(version)$(LIB_SUFFIX)
-blt_pict_pbm_name = PicturePbm$(version)$(LIB_SUFFIX)
-blt_pict_pdf_name = PicturePdf$(version)$(LIB_SUFFIX)
-blt_pict_photo_name = PicturePhoto$(version)$(LIB_SUFFIX)
-blt_pict_png_name = PicturePng$(version)$(LIB_SUFFIX)
-blt_pict_ps_name = PicturePs$(version)$(LIB_SUFFIX)
-blt_pict_tif_name = PictureTif$(version)$(LIB_SUFFIX)
-blt_pict_xbm_name = PictureXbm$(version)$(LIB_SUFFIX)
-blt_pict_xpm_name = PictureXpm$(version)$(LIB_SUFFIX)
-
-blt_pict_bmp_so = $(blt_pict_bmp_name)$(SO_EXT)
-blt_pict_gif_so = $(blt_pict_gif_name)$(SO_EXT)
-blt_pict_jpg_so = $(blt_pict_jpg_name)$(SO_EXT)
-blt_pict_pbm_so = $(blt_pict_pbm_name)$(SO_EXT)
-blt_pict_pdf_so = $(blt_pict_pdf_name)$(SO_EXT)
-blt_pict_photo_so = $(blt_pict_photo_name)$(SO_EXT)
-blt_pict_png_so = $(blt_pict_png_name)$(SO_EXT)
-blt_pict_ps_so = $(blt_pict_ps_name)$(SO_EXT)
-blt_pict_tif_so = $(blt_pict_tif_name)$(SO_EXT)
-blt_pict_xbm_so = $(blt_pict_xbm_name)$(SO_EXT)
-blt_pict_xpm_so = $(blt_pict_xpm_name)$(SO_EXT)
-
-blt_tree_xml_name = TreeXml$(version)$(LIB_SUFFIX)
-
-blt_tree_xml_so = $(blt_tree_xml_name)$(SO_EXT)
-
-blt_core_pkgs_so = $(blt_dt_csv_so) \
- $(blt_dt_tree_so) \
- $(blt_dt_vec_so)
-ifneq ("$(EXPAT_LIB_SPEC)", "")
- blt_core_pkgs_so += $(blt_dt_xml_so) $(blt_tree_xml_so)
-endif
-ifneq ("$(MYSQL_LIB_SPEC)", "")
- blt_core_pkgs_so += $(blt_dt_mysql_so)
-endif
-
-blt_x_pkgs_so = $(blt_pict_gif_so) \
- $(blt_pict_xbm_so) \
- $(blt_pict_bmp_so) \
- $(blt_pict_pbm_so) \
- $(blt_pict_pdf_so) \
- $(blt_pict_ps_so) \
- $(blt_pict_photo_so)
-ifneq ("$(JPG_LIB_SPEC)", "")
- blt_x_pkgs_so += $(blt_pict_jpg_so)
-endif
-ifneq ("$(PNG_LIB_SPEC)", "")
- blt_x_pkgs_so += $(blt_pict_png_so)
-endif
-ifneq ("$(XPM_LIB_SPEC)", "")
- blt_x_pkgs_so += $(blt_pict_xpm_so)
-endif
-ifneq ("$(XPM_TIF_SPEC)", "")
- blt_x_pkgs_so += $(blt_pict_tif_so)
-endif
-
-ifneq ("$(TCL_STUBS_SPEC)", "")
- tcl_lib_spec=$(TCL_STUBS_SPEC)
-else
- tcl_lib_spec=$(TCL_LIB_SPEC)
-endif
-
-ifneq ("$(TK_STUBS_SPEC)", "")
- tk_lib_spec=$(TK_STUBS_SPEC)
-else
- tk_lib_spec=$(TK_LIB_SPEC)
-endif
-
-ifneq ("$(EXPAT_LIB_SPEC)", "")
- blt_core_pkgs_so += $(blt_dt_xml_so) $(blt_tree_xml_so)
-endif
-
-# ------------------------------------------------------------------------
-# You don't need to edit anything beyond this point
-# ------------------------------------------------------------------------
-
-N_OBJS = bltTed.o
-V3_OBJS = bltTri.o bltGrMt.o
-
-TK_OBJS = tkButton.o tkFrame.o bltScrollbar.o
-
-GRAPH_OBJS = bltGrAxis.o \
- bltGrBar.o \
- bltGrElem.o \
- bltGrHairs.o \
- bltGrLegd.o \
- bltGrLine.o \
- bltGrMarker.o \
- bltGrMisc.o \
- bltGrPen.o \
- bltGrPs.o \
- bltGraph.o
-
-TREEVIEW_OBJS = bltTreeView.o \
- bltTvCmd.o \
- bltTvCol.o \
- bltTvEdit.o \
- bltTvStyle.o
-
-PICTURE_OBJS = bltPicture.o \
- bltPictCmd.o \
- bltPictDraw.o \
- bltPictMmx.o
-
-PICTURE_PKG_OBJS = bltPictBmp.o \
- bltPictGif.o \
- bltPictJpg.o \
- bltPictPbm.o \
- bltPictPdf.o \
- bltPictPhoto.o \
- bltPictPng.o \
- bltPictPs.o \
- bltPictTif.o \
- bltPictXbm.o \
- bltPictXpm.o
-
-TREE_OBJS = bltTree.o \
- bltTreeCmd.o \
-
-TREE_PKG_OBJS = bltTreeXml.o
-
-DATATABLE_OBJS = bltDataTable.o \
- bltDtCmd.o \
-
-DATATABLE_PKG_OBJS = bltDtCsv.o \
- bltDtMysql.o \
- bltDtTree.o \
- bltDtVec.o \
- bltDtXml.o
-
-BLT_CORE_SO_OBJS = bltAlloc.o \
- bltArrayObj.o \
- bltBase64.o \
- bltBgexec.o \
- bltChain.o \
- bltCrc32.o \
- bltCsv.o \
- $(DATATABLE_OBJS) \
- bltDebug.o \
- bltHash.o \
- bltInit.o \
- bltList.o \
- bltNsUtil.o \
- bltParse.o \
- bltPool.o \
- bltDBuffer.o \
- bltSpline.o \
- bltSwitch.o \
- $(TREE_OBJS) \
- bltUtil.o \
- bltVar.o \
- bltVecCmd.o \
- bltVecMath.o \
- bltVector.o \
- bltWatch.o \
- bltTri.o \
- bltUnixBgexec.o \
- bltUnixPipe.o \
- bltCoreInit.o
-
-BLT_CORE_A_OBJS = $(BLT_CORE_SO_OBJS) \
- $(TREE_PKG_OBJS) \
- $(DATATABLE_PKG_OBJS)
-
-BLT_X_SO_OBJS = $(GRAPH_OBJS) \
- $(PICTURE_OBJS) \
- $(TREEVIEW_OBJS) \
- bltBeep.o \
- bltBgStyle.o \
- bltBind.o \
- bltBitmap.o \
- bltBusy.o \
- bltCanvEps.o \
- bltComboBtn.o \
- bltComboEntry.o \
- bltComboMenu.o \
- bltComboTree.o \
- bltConfig.o \
- bltContainer.o \
- bltCutbuffer.o \
- bltDragdrop.o \
- bltHtext.o \
- bltImage.o \
- bltListView.o \
- bltMenubar.o \
- bltOldConfig.o \
- bltPaneset.o \
- bltPs.o \
- bltPsAfm.o \
- bltScrollset.o \
- bltTable.o \
- bltTabset.o \
- bltText.o \
- bltUnixBitmap.o \
- bltUnixDnd.o \
- bltUnixFont.o \
- bltUnixPainter.o \
- bltUnixWindow.o \
- bltWindow.o \
- bltWinop.o \
- bltExtInit.o \
- $(TK_OBJS) $(N_OBJS)
-
-
-BLT_X_A_OBJS = $(BLT_X_SO_OBJS) \
- $(PICTURE_PKG_OBJS)
-
-
-BLT_SO_OBJS = $(BLT_CORE_SO_OBJS) \
- $(BLT_X_SO_OBJS)
-
-BLT_A_OBJS = $(BLT_CORE_A_OBJS) \
- $(BLT_X_A_OBJS)
-
-# GNU Make-specific macro
-SRCS = $(patsubst %.o,$(srcdir)/%.c,$(BLT_A_OBJS))
-
-bltwish = bltwish$(version)
-bltsh = bltsh$(version)
-
-# Public headers to be installed
-headers = $(srcdir)/blt.h \
- $(srcdir)/bltBind.h \
- $(srcdir)/bltChain.h \
- bltHash.h \
- $(srcdir)/bltList.h \
- $(srcdir)/bltPool.h \
- $(srcdir)/bltTree.h \
- $(srcdir)/bltVector.h
-
-CC_OPTS = $(EXTRA_CFLAGS) $(CFLAGS) $(DEFINES) $(INCLUDES)
-MAIN_CC_OPTS = $(EXTRA_CFLAGS) $(CFLAGS) $(DEFINES) $(INCLUDES)
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_ROOT =
-RANLIB = @RANLIB@
-SHELL = /bin/sh
-AR = ar rc
-RM = rm -f
-LINT = splint
-LINTFLAGS = #-axhbns
-XREF = cxref
-XREFFLAGS = -dltR
-LN_S = @LN_S@
-VPATH = $(srcdir)
-
-all: build_libs build_demos
-
-build_demos: $(bltsh) $(bltwish)
-build_libs: build_ at BLT_TARGET@
-
-build_shared: $(blt_core_so) $(blt_x_so) build_core_pkgs build_x_pkgs
-build_static: $(blt_core_a) $(blt_x_a)
-build_core_pkgs: $(blt_core_so) $(blt_core_pkgs_so)
-build_x_pkgs: $(blt_x_so) $(blt_x_pkgs_so)
-
-$(bltwish): $(blt_core_a) $(blt_x_a) $(srcdir)/bltUnixMain.c
- $(RM) $(bltwish)
- $(CC) $(MAIN_CC_OPTS) $(LDFLAGS) -o $(bltwish) \
- -DSTATIC_PKGS -DTCLLIBPATH=\"$(TCLLIBPATH)\" \
- $(srcdir)/bltUnixMain.c \
- $(blt_x_a) $(blt_core_a) $(TK_LIB_SPEC) $(TCL_LIB_SPEC) \
- $(BLT_X_A_LIBS) $(BLT_CORE_A_LIBS) $(EXTRA_X_LIBS)
-
-$(bltsh): $(blt_core_a) $(srcdir)/bltUnixMain.c
- $(RM) $(bltsh)
- $(CC) $(CC_OPTS) $(LDFLAGS) -o $(bltsh) \
- -DTCL_ONLY -DSTATIC_PKGS -DTCLLIBPATH=\"$(TCLLIBPATH)\" \
- $(srcdir)/bltUnixMain.c \
- $(blt_core_a) $(TCL_STUBS_SPEC) $(TCL_LIB_SPEC) \
- $(BLT_CORE_A_LIBS) $(EXTRA_CORE_LIBS)
-
-$(blt_core_a): $(BLT_CORE_A_OBJS)
- $(RM) $@
- $(AR) $@ $(BLT_CORE_A_OBJS)
- $(RANLIB) $@
-
-$(blt_x_a): $(BLT_X_A_OBJS)
- $(RM) $@
- $(AR) $@ $(BLT_X_A_OBJS)
- $(RANLIB) $@
-
-$(blt_core_so): $(BLT_CORE_SO_OBJS)
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ $(BLT_CORE_SO_OBJS) $(BLT_CORE_SO_LIBS) \
- $(core_lib_spec)
-
-$(blt_x_so): $(BLT_X_SO_OBJS)
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ $(BLT_X_SO_OBJS) $(BLT_X_SO_LIBS) \
- $(blt_core_so) $(BLT_CORE_SO_LIBS) $(tcl_lib_spec)
-
-$(blt_dt_mysql_so): bltDtMysql.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltDtMysql.o $(MYSQL_LIB_SPEC) \
- $(blt_core_so) $(BLT_CORE_SO_LIBS) $(tcl_lib_spec)
-
-$(blt_dt_xml_so): bltDtXml.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltDtXml.o $(EXPAT_LIB_SPEC) \
- $(blt_core_so) $(BLT_CORE_SO_LIBS) $(tcl_lib_spec)
-
-$(blt_dt_csv_so): bltDtCsv.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltDtCsv.o \
- $(blt_core_so) $(BLT_CORE_SO_LIBS) $(tcl_lib_spec)
-
-$(blt_dt_vec_so): bltDtVec.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltDtVec.o \
- $(blt_core_so) $(BLT_CORE_SO_LIBS) $(tcl_lib_spec)
-
-$(blt_dt_tree_so): bltDtTree.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltDtTree.o \
- $(blt_core_so) $(BLT_CORE_SO_LIBS) $(tcl_lib_spec)
-
-$(blt_pict_bmp_so): bltPictBmp.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictBmp.o \
- $(blt_x_so) $(blt_core_so) \
- $(TCL_LIB_SPEC)
-
-$(blt_pict_gif_so): bltPictGif.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictGif.o \
- $(blt_x_so) $(blt_core_so) \
- $(TK_LIB_SPEC) $(TCL_LIB_SPEC)
-
-$(blt_pict_jpg_so): bltPictJpg.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictJpg.o $(JPG_LIB_SPEC)
-
-$(blt_pict_png_so): bltPictPng.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictPng.o $(PNG_LIB_SPEC)
-
-$(blt_pict_pbm_so): bltPictPbm.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictPbm.o \
- $(blt_x_so) $(blt_core_so) $(TCL_LIB_SPEC)
-
-$(blt_pict_tif_so): bltPictTif.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictTif.o $(TIF_LIB_SPEC)
-
-$(blt_pict_xbm_so): bltPictXbm.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictXbm.o \
- $(blt_x_so) $(blt_core_so) \
- $(TK_LIB_SPEC) $(TCL_LIB_SPEC)
-
-$(blt_pict_xpm_so): bltPictXpm.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictXpm.o \
- $(blt_x_so) $(blt_core_so) \
- $(TCL_LIB_SPEC) $(X11_LIB_SPEC) $(XPM_LIB_SPEC)
-
-$(blt_pict_pdf_so): bltPictPdf.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictPdf.o \
- $(blt_x_so) $(blt_core_so) \
- $(TK_LIB_SPEC) $(TCL_LIB_SPEC)
-
-$(blt_pict_ps_so): bltPictPs.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictPs.o \
- $(blt_x_so) $(blt_core_so) \
- $(TK_LIB_SPEC) $(TCL_LIB_SPEC)
-
-$(blt_pict_photo_so): bltPictPhoto.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictPhoto.o \
- $(blt_x_so) $(blt_core_so) \
- $(TK_LIB_SPEC) $(TCL_LIB_SPEC)
-
-$(blt_tree_xml_so): bltTreeXml.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltTreeXml.o $(EXPAT_LIB_SPEC) \
- $(blt_core_so) $(BLT_CORE_SO_LIBS) $(tcl_lib_spec)
-
-
-install: mkdirs install-demos install-libs install-headers
-
-install-libs: install- at BLT_TARGET@
-
-install-demos: $(bltwish) $(bltsh)
- $(INSTALL) -m 0755 $(bltwish) $(DESTDIR)$(bindir)
- $(INSTALL) -m 0755 $(bltsh) $(DESTDIR)$(bindir)
-
-install-shared: $(blt_core_so) $(blt_x_so) install-pkgs install-static
- $(INSTALL) -m 0755 $(blt_core_so) $(DESTDIR)$(libdir)
- $(INSTALL) -m 0755 $(blt_x_so) $(DESTDIR)$(libdir)
-
-install-static: $(blt_core_a) $(blt_x_a)
- $(INSTALL_DATA) $(blt_core_a) $(DESTDIR)$(libdir)
- $(RANLIB) $(DESTDIR)$(libdir)/$(blt_core_a)
- $(INSTALL_DATA) $(blt_x_a) $(DESTDIR)$(libdir)
- $(RANLIB) $(DESTDIR)$(libdir)/$(blt_x_a)
-
-install-pkgs: $(blt_core_pkgs_so) $(blt_x_pkgs_so)
- for i in $(blt_core_pkgs_so) $(blt_x_pkgs_so) ; do \
- echo $(RM) $(DESTDIR)$(libdir)/$$i ; \
- $(RM) $(DESTDIR)$(libdir)/$$i ; \
- echo $(INSTALL) -m 0755 $$i $(DESTDIR)$(pkgdir) ; \
- $(INSTALL) -m 0755 $$i $(DESTDIR)$(pkgdir) ; \
- done
-
-install-headers:
- @for i in $(headers) ; do \
- echo "installing $$i..." ; \
- $(INSTALL_DATA) -m 0444 $$i $(DESTDIR)$(incdir) ; \
- done
-
-mkdirs:
- @for i in $(instdirs) ; do \
- if test -d $(DESTDIR)$$i ; then \
- : ; \
- else \
- echo " mkdir $(DESTDIR)$$i" ; \
- $(INSTALL) -d $(DESTDIR)$$i ; \
- fi ; \
- done
-
-
-lint:
- $(LINT) $(LINTFLAGS) $(DEFINES) $(INCLUDES) $(SRCS)
-
-xref:
- $(XREF) $(XREFFLAGS) $(DEFINES) $(INCLUDES) $(SRCS)
-
-clean: clean-objs clean-libs clean-demos
-clean-libs: clean- at BLT_TARGET@
-clean-objs:
- $(RM) $(BLT_A_OBJS)
-clean-demos:
- $(RM) $(bltsh)* $(bltwish)* *pure* .pure*
-clean-static:
- $(RM) $(blt_core_a) $(blt_x_a)
-clean-pkgs:
- $(RM) $(blt_core_pkgs_so) $(blt_x_pkgs_so)
-clean-shared: clean-pkgs clean-static
- $(RM) $(blt_core_so) $(blt_x_so)
-
-distclean: clean
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"* Makefile
- $(RM) config.h bltHash.h Makefile TAGS
-
-bltDtMysql.o: $(srcdir)/bltDtMysql.c
- $(CC) -c $(CC_OPTS) $(MYSQL_INC_SPEC) $?
-bltDtXml.o: $(srcdir)/bltDtXml.c
- $(CC) -c $(CC_OPTS) $(EXPAT_INC_SPEC) $?
-
-bltTree.o: $(srcdir)/bltTree.c
- $(CC) -c $(CC_OPTS) $(EXPAT_INC_SPEC) $?
-bltTreeXml.o: $(srcdir)/bltTreeXml.c
- $(CC) -c $(CC_OPTS) $(EXPAT_INC_SPEC) $?
-
-bltUnixFont.o: $(srcdir)/bltUnixFont.c
- $(CC) -c $(CC_OPTS) $(FT2_INC_SPEC) $?
-
-bltPictDraw.o: $(srcdir)/bltPictDraw.c $(srcdir)/bltPaintDraw.c
- $(CC) -c $(CC_OPTS) $(FT2_INC_SPEC) $<
-bltPictJpg.o: $(srcdir)/bltPictJpg.c
- $(CC) -c $(CC_OPTS) $(JPG_INC_SPEC) $?
-bltPictTif.o: $(srcdir)/bltPictTif.c
- $(CC) -c $(CC_OPTS) $(TIF_INC_SPEC) $?
-bltPictPng.o: $(srcdir)/bltPictPng.c
- $(CC) -c $(CC_OPTS) $(PNG_INC_SPEC) $?
-bltPictXpm.o: $(srcdir)/bltPictXpm.c
- $(CC) -c $(CC_OPTS) $(XPM_INC_SPEC) $?
-
-bltCoreInit.o: $(srcdir)/bltCoreInit.c
- $(CC) -c $(CC_OPTS) -DTCL_ONLY -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
- $(srcdir)/bltCoreInit.c
-.c.o:
- $(CC) -c $(CC_OPTS) $<
-
diff --git a/blt3.0.1/src/Makefile.bc b/blt3.0.1/src/Makefile.bc
deleted file mode 100644
index 17576b8..0000000
--- a/blt3.0.1/src/Makefile.bc
+++ /dev/null
@@ -1,341 +0,0 @@
-
-# ------------------------------------------------------------------------
-# Makefile for BLT library using BCC55.
-# ------------------------------------------------------------------------
-
-.SUFFIXES: .obj .c
-
-!include ..\win\makedefs
-
-prefix = C:\Program Files\Tcl
-exec_prefix = $(prefix)
-includedir = $(prefix)\include
-bindir = $(prefix)\bin
-libdir = $(prefix)\lib
-scriptdir = $(libdir)\blt$(BLT_VERSION)
-BLT_LIBRARY = $(libdir)\blt$(BLT_VERSION)
-TCLLIBPATH = $(libdir)\tcl$(v1)
-
-SHLIB_SUFFIX = .dll
-
-SHELL = bash.exe
-RM = -del
-
-TOOLS32 = c:\Borland\BCC55
-
-AR = $(TOOLS32)\bin\implib.exe
-LD = $(TOOLS32)\bin\ilink32.exe
-CC = $(TOOLS32)\bin\bcc32.exe
-rc32 = $(TOOLS32)\bin\rc.exe
-
-!if ($(WITH_JPEG) == 0)
-EXTRA_DEFINES =
-!endif
-!if ($(WITH_JPEG) == 1)
-EXTRA_DEFINES = -DHAVE_JPEGLIB_H=1
-JPEGDIR = $(srcdir)\..\..\jpeg-6b
-JPEGLIB = $(JPEGDIR)\libjpeg.lib
-JPEGINC = $(JPEGDIR)
-!endif
-!if ($(WITH_JPEG) == 2)
-EXTRA_DEFINES = -DHAVE_IJL_H=1
-JPEGDIR = c:\Program\ Files\Intel\IJL
-JPEGLIB = $(JPEGDIR)\lib\ijl15l.lib
-JPEGINC = $(JPEGDIR)\Include
-!endif
-
-# ------------------------------------------------------------------------
-# C Compiler options
-# ------------------------------------------------------------------------
-
-DEFINES = -D__STDC__ -DWIN32 -DCONSOLE -D_MT -DNO_STRICT -D_NO_VCL \
- $(DEBUG_DEFINES) $(SHLIB_DEFINES) $(EXTRA_DEFINES)
-
-!if ($(SHARED) == 1)
-SHLIB_DEFINES = -D_DLL
-SHLIB_TARGET = build-dll
-LIBS = $(COMMON_LIBS) $(EXTRA_LIBS)
-!else
-SHLIB_CFLAGS =
-SHLIB_DEFINES =
-LIBS = $(COMMON_LIBS) $(EXTRA_LIBS)
-!endif
-
-!if ($(DEBUG) == 1)
-# -Od Disable all optimizations.
-# -k Turn on standard stack frame.
-# -r- Disable use of registers.
-# -v Turn on source debugging.
-# -vG All code guard options on.
-# -vi- Turn off expansion of inline functions.
-# -y Debug line numbers on.
-DEBUG_CFLAGS = -v -k -Od -vi- -y -r- -lv -tW -tWM
-# -v Turn on source debugging.
-DEBUG_LDFLAGS = -v
-DEBUG_DEFINES = -DUSE_TCLALLOC=0
-DEBUG_DEFINES =
-TK_LIB = $(TKDIR)\win\Debug\tk$(v2)d.lib
-TCL_LIB = $(TCLDIR)\win\Debug\tcl$(v2)d.lib
-MSVCRT =
-!else
-# -v- Turn off source debugging.
-# -vi- Turn off expansion of inline functions.
-# -O2 Generate fastest code possible.
-DEBUG_CFLAGS = -v- -vi- -O2 -D_DEBUG
-DEBUG_LDFLAGS =
-TK_LIB = $(TKDIR)\win\Release\tk$(v2).lib
-TCL_LIB = $(TCLDIR)\win\Release\tcl$(v2).lib
-MSVCRT =
-!endif
-
-# Turn off the following bcc warnings:
-# -w-pro Call to function with no prototype
-# -w-par Parameter is never used.
-# -w-sus Suspicious pointer conversion (bltCanvEps.c).
-# -w-eff Code has no effect (pure_api.c).
-#
-WARNINGS = -w-pro -w-par -w-eff -w-sus
-
-# -q Suppress compiler identification banner.
-# -g1 Stop after the first warning.
-# -tWC Target is a Windows console application.
-# -X Disable compiler autodependency output.
-# -ps Use stdcall calling convention.
-
-EXTRA_CFLAGS = -q -g1 -tWC -X
-
-CFLAGS = $(WARNINGS) $(DEBUG_CFLAGS) $(SHLIB_CFLAGS) $(EXTRA_CFLAGS)
-
-# ------------------------------------------------------------------------
-# Linker flags and options
-# ------------------------------------------------------------------------
-
-# -D Save specified description.
-# -w Turn on warnings.
-# -c Treate case as significant in symbols.
-# -x
-# -Gi Generate .lib file.
-# -r Verbose linking.
-# -x Suppresses map creation.
-COMMON_LDFLAGS = -D"" -w -c -x $(DEBUG_LDFLAGS) -L$(TOOLS32)\lib
-
-SHLIB_LDFLAGS = $(COMMON_LDFLAGS) -x -Gi -Tpd $(TOOLS32)\lib\c0d32
-
-LDFLAGS = $(COMMON_LDFLAGS) -x -Tpe -S:2400000
-
-COMMON_LIBS = $(TK_LIB) $(TCL_LIB) import32 cw32
-
-EXTRA_LIBS = $(OLELIB) \
- $(JPEGLIB)
-
-TCL_ONLY_COMMON_LIBS = $(TCL_LIB) import32 cw32
-TCL_ONLY_LIBS = $(TCL_ONLY_COMMON_LIBS) $(EXTRA_LIBS)
-
-# ------------------------------------------------------------------------
-# Source and target installation directories
-# ------------------------------------------------------------------------
-
-srcdir = .
-instdirs = $(prefix) $(exec_prefix) $(bindir) $(libdir) $(includedir)
-instdirs = $(exec_prefix) $(prefix) $(libdir)
-
-# ------------------------------------------------------------------------
-# Directories containing Tcl and Tk include files and libraries
-# ------------------------------------------------------------------------
-
-TCLDIR = $(srcdir)\..\..\tcl$(v3)
-TKDIR = $(srcdir)\..\..\tk$(v3)
-INCLUDES = -I. -I$(srcdir) \
- -I$(TOOLS32)\include \
- -I$(JPEGINC) \
- -I$(TCLDIR)\win -I$(TCLDIR)\generic \
- -I$(TKDIR)\win -I$(TKDIR)\generic -I$(TKDIR)\xlib \
-
-SHLIB_LD_LIBS = $(COMMON_LIBS) $(EXTRA_LIBS)
-SHLIB_TCL_ONLY_LIBS = $(COMMON_LIBS) $(EXTRA_LIBS)
-
-# ------------------------------------------------------------------------
-# You don't need to edit anything beyond this point
-# ------------------------------------------------------------------------
-
-N_OBJS = bltTed.obj
-V3_OBJS = bltTri.obj bltGrMt.obj
-
-TK_OBJS = tkButton.obj tkFrame.obj bltScrollbar.obj
-
-GRAPH_OBJS = bltGrAxis.obj \
- bltGrBar.obj \
- bltGrElem.obj \
- bltGrHairs.obj \
- bltGrLegd.obj \
- bltGrLine.obj \
- bltGrMarker.obj \
- bltGrMisc.obj \
- bltGrPen.obj \
- bltGrPs.obj \
- bltGraph.obj
-
-TCL_ONLY_OBJS = bltAlloc.obj \
- bltArrayObj.obj \
- bltBgexec.obj \
- bltChain.obj \
- bltDebug.obj \
- bltHash.obj \
- bltList.obj \
- bltNsUtil.obj \
- bltParse.obj \
- bltPool.obj \
- bltSpline.obj \
- bltSwitch.obj \
- bltTree.obj \
- bltTreeCmd.obj \
- bltUtil.obj \
- bltVecCmd.obj \
- bltVecMath.obj \
- bltVector.obj \
- bltWatch.obj \
- bltWinPipe.obj \
- bltWinUtil.obj \
- bltWinDde.obj \
- pure_api.obj
-
-DEMO_OBJS = tkConsole.obj bltWinMain.obj
-
-OBJS = $(GRAPH_OBJS) \
- $(TCL_ONLY_OBJS) \
- bltBeep.obj \
- bltBind.obj \
- bltBitmap.obj \
- bltBusy.obj \
- bltCanvEps.obj \
- bltConfig.obj \
- bltContainer.obj \
- bltDragdrop.obj \
- bltHtext.obj \
- bltImage.obj \
- bltOldConfig.obj \
- bltPs.obj \
- bltTable.obj \
- bltTabnotebook.obj \
- bltTabset.obj \
- bltText.obj \
- bltTile.obj \
- bltTreeView.obj \
- bltTreeViewCmd.obj \
- bltTreeViewColumn.obj \
- bltTreeViewEdit.obj \
- bltTreeViewStyle.obj \
- bltWinDraw.obj \
- bltWinImage.obj \
- bltWinPrnt.obj \
- bltWindow.obj \
- bltWinop.obj \
- $(TK_OBJS) $(N_OBJS)
-
-NOT_YET = bltContainer.obj bltCutBuffer.obj bltColor.obj
-
-HEADERS = blt.h bltChain.h bltVector.h bltTree.h bltPool.h bltHash.h
-
-# GNU Make-specific macro
-SRCS = $(patsubst %.obj,$(srcdir)\%.c,$(OBJS))
-
-shell_name = bltwish
-version = $(BLT_MAJOR_VERSION)$(BLT_MINOR_VERSION)
-bltwish = bltwish.exe
-bltsh = bltsh.exe
-
-lib_name = BLT$(version)
-lib_a = BLT$(version).lib
-lib_so = BLT$(version).dll
-tcl_only_lib_a = BLTlite$(version).lib
-tcl_only_lib_so = BLTlite$(version).dll
-
-CC_SWITCHES = $(CFLAGS) $(DEFINES) $(INCLUDES)
-VPATH = $(srcdir)
-
-all: build-library build-demos
-
-build-demos: $(bltsh) $(bltwish)
-
-build-library: $(lib_a) $(tcl_only_lib_a)
-
-build-dll: build-library $(lib_so) $(tcl_only_lib_so)
-
-$(bltwish): $(lib_a) tkConsole.obj bltWinMain.c
- -del $(bltwish) 2>nul
- $(CC) -c $(CC_SWITCHES) -DTCLLIBPATH="\"$(TCLLIBPATH)\"" \
- -obltWinMain.obj $(srcdir)\bltWinMain.c
- $(LD) $(LDFLAGS) -aa $(TOOLS32)\lib\c0w32 \
- tkConsole.obj bltWinMain.obj, \
- $(bltwish),, $(lib_a) $(LIBS)
-
-$(bltsh): $(tcl_only_lib_a) bltWinMain.c
- -del $(bltsh) 2>nul
- $(CC) -c $(CC_SWITCHES) -DTCL_ONLY \
- -DTCLLIBPATH="\"$(TCLLIBPATH)\"" \
- -obltWinMain.obj $(srcdir)\bltWinMain.c
- $(LD) $(LDFLAGS) -ap $(TOOLS32)\lib\c0x32 bltWinMain.obj, \
- $(bltsh),, $(tcl_only_lib_a) $(TCL_ONLY_LIBS)
-
-$(lib_a): $(lib_so) bltHash.h $(OBJS) bltInit.c
- -del bltInit.obj 2>nul
- $(CC) -c $(CC_SWITCHES) -DBLT_LIBRARY="\"$(BLT_LIBRARY)\"" \
- -obltInit.obj $(srcdir)\bltInit.c
- -del $@ 2>nul
- $(AR) $@ $(lib_so)
-
-$(lib_so): $(OBJS) bltInit.c
- -del bltInit.obj 2>nul
- $(CC) -c $(CC_SWITCHES) -DBLT_LIBRARY="\"$(BLT_LIBRARY)\"" \
- -obltInit.obj $(srcdir)\bltInit.c
- -del $@ 2>nul
- $(LD) $(SHLIB_LDFLAGS) bltInit.obj $(OBJS), $@,, $(LIBS)
-
-$(tcl_only_lib_a): $(tcl_only_lib_so) bltHash.h $(TCL_ONLY_OBJS) bltInit.c
- -del bltInit.obj 2>nul
- $(CC) -c $(CC_SWITCHES) -DTCL_ONLY -DBLT_LIBRARY="\"$(BLT_LIBRARY)\"" \
- -obltInit.obj $(srcdir)\bltInit.c
- -del $@ 2>nul
- $(AR) $@ $(tcl_only_lib_so)
-
-$(tcl_only_lib_so): $(TCL_ONLY_OBJS) bltInit.c
- -del bltInit.obj 2>nul
- $(CC) -c $(CC_SWITCHES) -DTCL_ONLY -DBLT_LIBRARY="\"$(BLT_LIBRARY)\"" \
- -obltInit.obj $(srcdir)\bltInit.c
- -del $@ 2>nul
- $(LD) $(SHLIB_LDFLAGS) bltInit.obj $(TCL_ONLY_OBJS), $@, -x, \
- $(TCL_ONLY_LIBS),,
-
-bltHash.h: bltHash.h.in
- sed -e 's/@SIZEOF_VOID_P@/4/' \
- -e 's/@SIZEOF_INT@/4/' \
- -e 's/@SIZEOF_LONG@/4/' \
- -e 's/@SIZEOF_LONG_LONG@/8/' \
- -e 's/@HAVE_INTTYPES_H@/0/' \
- bltHash.h.in > bltHash.h
-
-clean:
- -del *.obj 2>nul
- -del *.pdb 2>nul
- -del *.exp 2>nul
- -del $(lib_a) 2>nul
- -del $(lib_so) 2>nul
- -del $(tcl_only_lib_a) 2>nul
- -del $(tcl_only_lib_so) 2>nul
- -del $(bltwish) 2>nul
- -del $(bltsh) 2>nul
- -del $(srcdir)\*.bak 2>nul
- -del $(srcdir)\*~ 2>nul
- -del $(srcdir)\"#"* 2>nul
- -del *.pdb 2>nul
- -del *.ilf 2>nul
- -del *.ils 2>nul
- -del *.ilc 2>nul
- -del *.ild 2>nul
- -del *.tds 2>nul
- -del *.td2 2>nul
- -del *.TR2 2>nul
-
-.c.obj:
- $(CC) -c $(CC_SWITCHES) $<
-
diff --git a/blt3.0.1/src/Makefile.in b/blt3.0.1/src/Makefile.in
deleted file mode 100644
index d776b85..0000000
--- a/blt3.0.1/src/Makefile.in
+++ /dev/null
@@ -1,605 +0,0 @@
-
-# ------------------------------------------------------------------------
-# Makefile for static version of BLT library
-# ------------------------------------------------------------------------
-
-# ------------------------------------------------------------------------
-# C Compiler options
-# ------------------------------------------------------------------------
-
-BLT_LIBRARY = @BLT_LIBRARY@
-CC = @CC@
-CFLAGS = @CFLAGS@
-DEFINES = @DEFINES@
-EXTRA_CFLAGS = @GCCFLAGS@ $(SO_CFLAGS)
-LDFLAGS = @LDFLAGS@ @LD_RUN_PATH@
-LIB_PREFIX = @LIB_PREFIX@
-TCLLIBPATH = @TCL_LIB_DIR@/tcl at TCL_VERSION@
-TCL_DBG = @TCL_DBGX@
-
-SO_CFLAGS = @BLT_SO_CFLAGS@
-LIB_SUFFIX = @BLT_LIB_SUFFIX@
-SO_EXT = @BLT_SO_EXT@
-SO_PREFIX = @BLT_SO_PREFIX@
-SO_LD = @BLT_SO_LD@
-SO_LDFLAGS = @BLT_SO_LDFLAGS@ @LD_RUN_PATH@
-
-EXPAT_INC_SPEC = @EXPAT_INC_SPEC@
-EXPAT_LIB_SPEC = @EXPAT_LIB_SPEC@
-FT2_INC_SPEC = @FT2_INC_SPEC@
-FT2_LIB_SPEC = @FT2_LIB_SPEC@
-JPG_INC_SPEC = @JPG_INC_SPEC@
-JPG_LIB_SPEC = @JPG_LIB_SPEC@
-MYSQL_INC_SPEC = @MYSQL_INC_SPEC@
-MYSQL_LIB_SPEC = @MYSQL_LIB_SPEC@
-PNG_INC_SPEC = @PNG_INC_SPEC@
-PNG_LIB_SPEC = @PNG_LIB_SPEC@ $(Z_LIB_SPEC)
-TCL_INC_SPEC = @TCL_INC_SPEC@
-TCL_LIB_SPEC = @TCL_LIB_SPEC@
-TCL_STUBS_SPEC = @TCL_STUBS_SPEC@
-TIF_INC_SPEC = @TIF_INC_SPEC@
-TIF_LIB_SPEC = @TIF_LIB_SPEC@
-TK_INC_SPEC = @TK_INC_SPEC@
-TK_LIB_SPEC = @TK_LIB_SPEC@
-TK_STUBS_SPEC = @TK_STUBS_SPEC@
-X11_INC_SPEC = @X11_INC_SPEC@
-X11_LIB_SPEC = @X11_LIB_SPEC@
-XFT_INC_SPEC = @XFT_INC_SPEC@
-XFT_LIB_SPEC = @XFT_LIB_SPEC@
-XPM_INC_SPEC = @XPM_INC_SPEC@
-XPM_LIB_SPEC = @XPM_LIB_SPEC@
-XAU_LIB_SPEC = @XAU_LIB_SPEC@
-XRANDR_LIB_SPEC = @XRANDR_LIB_SPEC@
-XRENDER_LIB_SPEC = @XRENDER_LIB_SPEC@
-FTCFG_LIB_SPEC = @FTCFG_LIB_SPEC@
-XDMCP_LIB_SPEC = @XDMCP_LIB_SPEC@
-Z_LIB_SPEC = @Z_LIB_SPEC@
-
-version = @BLT_MAJOR_VERSION@@BLT_MINOR_VERSION@
-
-# ------------------------------------------------------------------------
-# Source and targer installation directories
-# ------------------------------------------------------------------------
-
-bindir = $(exec_prefix)/bin
-datadir = @datadir@
-datarootdir = @datarootdir@
-exec_prefix = @exec_prefix@
-incdir = $(prefix)/include
-includedir = @includedir@
-libdir = @libdir@
-prefix = @prefix@
-scriptdir = $(exec_prefix)/lib
-srcdir = @srcdir@
-pkgdir = @BLT_LIBRARY@
-
-instdirs = $(prefix) \
- $(exec_prefix) \
- $(bindir) \
- $(libdir) \
- $(incdir) \
- $(pkgdir) \
- $(scriptdir)
-
-# ------------------------------------------------------------------------
-# Directories containing Tcl and Tk include files and libraries
-# ------------------------------------------------------------------------
-
-INCLUDES = -I. -I$(srcdir) \
- @INCLUDES@
-
-# ------------------------------------------------------------------------
-# Libraries directives for Tcl, Tk, X11, and BLT
-# ------------------------------------------------------------------------
-
-EXTRA_CORE_LIBS = @LIBS@ @EXTRA_LIBS@
-
-EXTRA_X_LIBS = @TK_XLIBSW@ \
- $(X11_LIB_SPEC) \
- $(XAU_LIB_SPEC) \
- $(XDMCP_LIB_SPEC) \
- $(XRANDR_LIB_SPEC) \
- $(XRENDER_LIB_SPEC) \
- $(EXTRA_CORE_LIBS)
-
-BLT_X_SO_LIBS = $(XFT_LIB_SPEC) \
- $(FTCFG_LIB_SPEC) \
- $(XRANDR_LIB_SPEC) \
- $(FT2_LIB_SPEC)
-
-BLT_X_A_LIBS = $(BLT_X_SO_LIBS) \
- $(JPG_LIB_SPEC) \
- $(PNG_LIB_SPEC) \
- $(TIF_LIB_SPEC) \
- $(XPM_LIB_SPEC)
-
-BLT_CORE_SO_LIBS =
-
-BLT_CORE_A_LIBS = $(BLT_CORE_SO_LIBS) \
- $(MYSQL_LIB_SPEC) \
- $(EXPAT_LIB_SPEC)
-
-blt_core_name = BLTCore$(version)$(LIB_SUFFIX)
-blt_x_name = BLTX$(version)$(LIB_SUFFIX)
-
-blt_core_so = lib$(blt_core_name)$(SO_EXT)
-blt_core_a = lib$(blt_core_name).a
-
-blt_x_so = lib$(blt_x_name)$(SO_EXT)
-blt_x_a = lib$(blt_x_name).a
-
-blt_dt_csv_name = TableCsv$(version)$(LIB_SUFFIX)
-blt_dt_mysql_name = TableMysql$(version)$(LIB_SUFFIX)
-blt_dt_tree_name = TableTree$(version)$(LIB_SUFFIX)
-blt_dt_vec_name = TableVector$(version)$(LIB_SUFFIX)
-blt_dt_xml_name = TableXml$(version)$(LIB_SUFFIX)
-
-blt_dt_csv_so = $(blt_dt_csv_name)$(SO_EXT)
-blt_dt_mysql_so = $(blt_dt_mysql_name)$(SO_EXT)
-blt_dt_tree_so = $(blt_dt_tree_name)$(SO_EXT)
-blt_dt_vec_so = $(blt_dt_vec_name)$(SO_EXT)
-blt_dt_xml_so = $(blt_dt_xml_name)$(SO_EXT)
-
-blt_pict_bmp_name = PictureBmp$(version)$(LIB_SUFFIX)
-blt_pict_gif_name = PictureGif$(version)$(LIB_SUFFIX)
-blt_pict_jpg_name = PictureJpg$(version)$(LIB_SUFFIX)
-blt_pict_pbm_name = PicturePbm$(version)$(LIB_SUFFIX)
-blt_pict_pdf_name = PicturePdf$(version)$(LIB_SUFFIX)
-blt_pict_photo_name = PicturePhoto$(version)$(LIB_SUFFIX)
-blt_pict_png_name = PicturePng$(version)$(LIB_SUFFIX)
-blt_pict_ps_name = PicturePs$(version)$(LIB_SUFFIX)
-blt_pict_tif_name = PictureTif$(version)$(LIB_SUFFIX)
-blt_pict_xbm_name = PictureXbm$(version)$(LIB_SUFFIX)
-blt_pict_xpm_name = PictureXpm$(version)$(LIB_SUFFIX)
-
-blt_pict_bmp_so = $(blt_pict_bmp_name)$(SO_EXT)
-blt_pict_gif_so = $(blt_pict_gif_name)$(SO_EXT)
-blt_pict_jpg_so = $(blt_pict_jpg_name)$(SO_EXT)
-blt_pict_pbm_so = $(blt_pict_pbm_name)$(SO_EXT)
-blt_pict_pdf_so = $(blt_pict_pdf_name)$(SO_EXT)
-blt_pict_photo_so = $(blt_pict_photo_name)$(SO_EXT)
-blt_pict_png_so = $(blt_pict_png_name)$(SO_EXT)
-blt_pict_ps_so = $(blt_pict_ps_name)$(SO_EXT)
-blt_pict_tif_so = $(blt_pict_tif_name)$(SO_EXT)
-blt_pict_xbm_so = $(blt_pict_xbm_name)$(SO_EXT)
-blt_pict_xpm_so = $(blt_pict_xpm_name)$(SO_EXT)
-
-blt_tree_xml_name = TreeXml$(version)$(LIB_SUFFIX)
-
-blt_tree_xml_so = $(blt_tree_xml_name)$(SO_EXT)
-
-blt_core_pkgs_so = $(blt_dt_csv_so) \
- $(blt_dt_tree_so) \
- $(blt_dt_vec_so)
-ifneq ("$(EXPAT_LIB_SPEC)", "")
- blt_core_pkgs_so += $(blt_dt_xml_so) $(blt_tree_xml_so)
-endif
-ifneq ("$(MYSQL_LIB_SPEC)", "")
- blt_core_pkgs_so += $(blt_dt_mysql_so)
-endif
-
-blt_x_pkgs_so = $(blt_pict_gif_so) \
- $(blt_pict_xbm_so) \
- $(blt_pict_bmp_so) \
- $(blt_pict_pbm_so) \
- $(blt_pict_pdf_so) \
- $(blt_pict_ps_so) \
- $(blt_pict_photo_so)
-ifneq ("$(JPG_LIB_SPEC)", "")
- blt_x_pkgs_so += $(blt_pict_jpg_so)
-endif
-ifneq ("$(PNG_LIB_SPEC)", "")
- blt_x_pkgs_so += $(blt_pict_png_so)
-endif
-ifneq ("$(XPM_LIB_SPEC)", "")
- blt_x_pkgs_so += $(blt_pict_xpm_so)
-endif
-ifneq ("$(XPM_TIF_SPEC)", "")
- blt_x_pkgs_so += $(blt_pict_tif_so)
-endif
-
-ifneq ("$(TCL_STUBS_SPEC)", "")
- tcl_lib_spec=$(TCL_STUBS_SPEC)
-else
- tcl_lib_spec=$(TCL_LIB_SPEC)
-endif
-
-ifneq ("$(TK_STUBS_SPEC)", "")
- tk_lib_spec=$(TK_STUBS_SPEC)
-else
- tk_lib_spec=$(TK_LIB_SPEC)
-endif
-
-ifneq ("$(EXPAT_LIB_SPEC)", "")
- blt_core_pkgs_so += $(blt_dt_xml_so) $(blt_tree_xml_so)
-endif
-
-# ------------------------------------------------------------------------
-# You don't need to edit anything beyond this point
-# ------------------------------------------------------------------------
-
-#N_OBJS = bltTed.o
-#V3_OBJS = bltTri.o bltGrMt.o
-
-#TK_OBJS = tkButton.o tkFrame.o bltScrollbar.o
-
-GRAPH_OBJS = bltGrAxis.o \
- bltGrBar.o \
- bltGrElem.o \
- bltGrHairs.o \
- bltGrLegd.o \
- bltGrLine.o \
- bltGrMarker.o \
- bltGrMisc.o \
- bltGrPen.o \
- bltGrPs.o \
- bltGraph.o
-
-#TREEVIEW_OBJS = bltTreeView.o \
- bltTvCmd.o \
- bltTvCol.o \
- bltTvEdit.o \
- bltTvStyle.o
-
-PICTURE_OBJS = bltPicture.o \
- bltPictCmd.o \
- bltPictDraw.o
-
-# bltPictMmx.o \
-
-#PICTURE_PKG_OBJS = bltPictBmp.o \
- bltPictGif.o \
- bltPictJpg.o \
- bltPictPbm.o \
- bltPictPdf.o \
- bltPictPhoto.o \
- bltPictPng.o \
- bltPictPs.o \
- bltPictTif.o \
- bltPictXbm.o \
- bltPictXpm.o
-
-#TREE_OBJS = bltTree.o \
- bltTreeCmd.o \
-
-#TREE_PKG_OBJS = bltTreeXml.o
-
-DATATABLE_OBJS = bltDataTable.o \
-# bltDtCmd.o \
-
-#DATATABLE_PKG_OBJS = bltDtCsv.o \
- bltDtMysql.o \
- bltDtTree.o \
- bltDtVec.o \
- bltDtXml.o
-
-BLT_CORE_SO_OBJS = bltAlloc.o \
- bltArrayObj.o \
- bltBase64.o \
- bltChain.o \
- bltDBuffer.o \
- $(DATATABLE_OBJS) \
- bltHash.o \
- bltInit.o \
- bltList.o \
- bltNsUtil.o \
- bltParse.o \
- bltPool.o \
- bltSpline.o \
- bltSwitch.o \
- $(TREE_OBJS) \
- bltUtil.o \
- bltVar.o \
- bltVecCmd.o \
- bltVecMath.o \
- bltVector.o \
- bltCoreInit.o \
- tclGet.o
-
-# bltBgexec.o \
- bltCrc32.o \
- bltCsv.o \
- bltDebug.o \
- bltTri.o \
- bltUnixBgexec.o \
- bltUnixPipe.o \
- bltWatch.o \
-
-BLT_CORE_A_OBJS = $(BLT_CORE_SO_OBJS) \
- $(TREE_PKG_OBJS) \
- $(DATATABLE_PKG_OBJS)
-
-BLT_X_SO_OBJS = $(GRAPH_OBJS) \
- $(PICTURE_OBJS) \
- $(TREEVIEW_OBJS) \
- bltBgStyle.o \
- bltBind.o \
- bltBusy.o \
- bltConfig.o \
- bltImage.o \
- bltPs.o \
- bltPsAfm.o \
- bltText.o \
- bltUnixBitmap.o \
- bltUnixFont.o \
- bltUnixPainter.o \
- bltUnixWindow.o \
- bltWindow.o \
- bltExtInit.o \
- $(TK_OBJS) $(N_OBJS)
-
-# bltBeep.o \
- bltBitmap.o \
- bltCanvEps.o \
- bltComboBtn.o \
- bltComboEntry.o \
- bltComboMenu.o \
- bltComboTree.o \
- bltContainer.o \
- bltCutbuffer.o \
- bltDragdrop.o \
- bltHtext.o \
- bltListView.o \
- bltMenubar.o \
- bltOldConfig.o \
- bltPaneset.o \
- bltScrollset.o \
- bltTable.o \
- bltTabset.o \
- bltUnixDnd.o \
- bltWinop.o \
-
-BLT_X_A_OBJS = $(BLT_X_SO_OBJS) \
- $(PICTURE_PKG_OBJS)
-
-
-BLT_SO_OBJS = $(BLT_CORE_SO_OBJS) \
- $(BLT_X_SO_OBJS)
-
-BLT_A_OBJS = $(BLT_CORE_A_OBJS) \
- $(BLT_X_A_OBJS)
-
-# GNU Make-specific macro
-SRCS = $(patsubst %.o,$(srcdir)/%.c,$(BLT_A_OBJS))
-
-bltwish = bltwish$(version)
-bltsh = bltsh$(version)
-
-# Public headers to be installed
-headers = $(srcdir)/blt.h \
- $(srcdir)/bltBind.h \
- $(srcdir)/bltChain.h \
- bltHash.h \
- $(srcdir)/bltList.h \
- $(srcdir)/bltPool.h \
- $(srcdir)/bltTree.h \
- $(srcdir)/bltVector.h
-
-CC_OPTS = $(EXTRA_CFLAGS) $(CFLAGS) $(DEFINES) $(INCLUDES)
-MAIN_CC_OPTS = $(EXTRA_CFLAGS) $(CFLAGS) $(DEFINES) $(INCLUDES)
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_ROOT =
-RANLIB = @RANLIB@
-SHELL = /bin/sh
-AR = ar rc
-RM = rm -f
-LINT = splint
-LINTFLAGS = #-axhbns
-XREF = cxref
-XREFFLAGS = -dltR
-LN_S = @LN_S@
-VPATH = $(srcdir)
-
-all: build_libs build_demos
-
-build_demos: $(bltsh) $(bltwish)
-build_libs: build_ at BLT_TARGET@
-
-build_shared: $(blt_core_so) $(blt_x_so) build_core_pkgs build_x_pkgs
-build_static: $(blt_core_a) $(blt_x_a)
-build_core_pkgs: $(blt_core_so) $(blt_core_pkgs_so)
-build_x_pkgs: $(blt_x_so) $(blt_x_pkgs_so)
-
-$(bltwish): $(blt_core_a) $(blt_x_a) $(srcdir)/bltUnixMain.c
- $(RM) $(bltwish)
- $(CC) $(MAIN_CC_OPTS) $(LDFLAGS) -o $(bltwish) \
- -DTCLLIBPATH=\"$(TCLLIBPATH)\" \
- $(srcdir)/bltUnixMain.c \
- $(blt_x_a) $(blt_core_a) $(TK_LIB_SPEC) $(TCL_LIB_SPEC) \
- $(BLT_X_A_LIBS) $(BLT_CORE_A_LIBS) $(EXTRA_X_LIBS)
-
-$(bltsh): $(blt_core_a) $(srcdir)/bltUnixMain.c
- $(RM) $(bltsh)
- $(CC) $(CC_OPTS) $(LDFLAGS) -o $(bltsh) \
- -DTCL_ONLY -DTCLLIBPATH=\"$(TCLLIBPATH)\" \
- $(srcdir)/bltUnixMain.c \
- $(blt_core_a) $(TCL_STUBS_SPEC) $(TCL_LIB_SPEC) \
- $(BLT_CORE_A_LIBS) $(EXTRA_CORE_LIBS)
-
-$(blt_core_a): $(BLT_CORE_A_OBJS)
- $(RM) $@
- $(AR) $@ $(BLT_CORE_A_OBJS)
- $(RANLIB) $@
-
-$(blt_x_a): $(BLT_X_A_OBJS)
- $(RM) $@
- $(AR) $@ $(BLT_X_A_OBJS)
- $(RANLIB) $@
-
-$(blt_core_so): $(BLT_CORE_SO_OBJS)
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ $(BLT_CORE_SO_OBJS) $(BLT_CORE_SO_LIBS) \
- $(core_lib_spec)
-
-$(blt_x_so): $(BLT_X_SO_OBJS)
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ $(BLT_X_SO_OBJS) $(BLT_X_SO_LIBS) \
- $(BLT_CORE_SO_LIBS) $(tcl_lib_spec)
-
-$(blt_dt_mysql_so): bltDtMysql.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltDtMysql.o $(MYSQL_LIB_SPEC)
-
-$(blt_dt_xml_so): bltDtXml.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltDtXml.o $(EXPAT_LIB_SPEC)
-
-$(blt_dt_csv_so): bltDtCsv.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltDtCsv.o
-
-$(blt_dt_vec_so): bltDtVec.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltDtVec.o
-
-$(blt_dt_tree_so): bltDtTree.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltDtTree.o
-
-$(blt_pict_bmp_so): bltPictBmp.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictBmp.o
-
-$(blt_pict_gif_so): bltPictGif.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictGif.o
-
-$(blt_pict_jpg_so): bltPictJpg.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictJpg.o $(JPG_LIB_SPEC)
-
-$(blt_pict_png_so): bltPictPng.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictPng.o $(PNG_LIB_SPEC)
-
-$(blt_pict_pbm_so): bltPictPbm.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictPbm.o
-
-$(blt_pict_tif_so): bltPictTif.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictTif.o $(TIF_LIB_SPEC)
-
-$(blt_pict_xbm_so): bltPictXbm.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictXbm.o
-
-$(blt_pict_xpm_so): bltPictXpm.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictXpm.o \
- $(X11_LIB_SPEC) $(XPM_LIB_SPEC)
-
-$(blt_pict_pdf_so): bltPictPdf.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictPdf.o
-
-$(blt_pict_ps_so): bltPictPs.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictPs.o
-
-$(blt_pict_photo_so): bltPictPhoto.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltPictPhoto.o
-
-$(blt_tree_xml_so): bltTreeXml.o
- $(RM) $@
- $(SO_LD) $(SO_LDFLAGS) -o $@ bltTreeXml.o $(EXPAT_LIB_SPEC)
-
-
-install: mkdirs install-demos install-libs install-headers
-
-install-libs: install- at BLT_TARGET@
-
-install-demos: $(bltwish) $(bltsh)
- $(INSTALL) -m 0755 $(bltwish) $(DESTDIR)$(bindir)
- $(INSTALL) -m 0755 $(bltsh) $(DESTDIR)$(bindir)
-
-install-shared: $(blt_core_so) $(blt_x_so) install-pkgs install-static
- $(INSTALL) -m 0755 $(blt_core_so) $(DESTDIR)$(libdir)
- $(INSTALL) -m 0755 $(blt_x_so) $(DESTDIR)$(libdir)
-
-install-static: $(blt_core_a) $(blt_x_a)
- $(INSTALL_DATA) $(blt_core_a) $(DESTDIR)$(libdir)
- $(RANLIB) $(DESTDIR)$(libdir)/$(blt_core_a)
- $(INSTALL_DATA) $(blt_x_a) $(DESTDIR)$(libdir)
- $(RANLIB) $(DESTDIR)$(libdir)/$(blt_x_a)
-
-install-pkgs: $(blt_core_pkgs_so) $(blt_x_pkgs_so)
- for i in $(blt_core_pkgs_so) $(blt_x_pkgs_so) ; do \
- echo $(RM) $(DESTDIR)$(libdir)/$$i ; \
- $(RM) $(DESTDIR)$(libdir)/$$i ; \
- echo $(INSTALL) -m 0755 $$i $(DESTDIR)$(pkgdir) ; \
- $(INSTALL) -m 0755 $$i $(DESTDIR)$(pkgdir) ; \
- done
-
-install-headers:
- @for i in $(headers) ; do \
- echo "installing $$i..." ; \
- $(INSTALL_DATA) -m 0444 $$i $(DESTDIR)$(incdir) ; \
- done
-
-mkdirs:
- @for i in $(instdirs) ; do \
- if test -d $(DESTDIR)$$i ; then \
- : ; \
- else \
- echo " mkdir $(DESTDIR)$$i" ; \
- $(INSTALL) -d $(DESTDIR)$$i ; \
- fi ; \
- done
-
-
-lint:
- $(LINT) $(LINTFLAGS) $(DEFINES) $(INCLUDES) $(SRCS)
-
-xref:
- $(XREF) $(XREFFLAGS) $(DEFINES) $(INCLUDES) $(SRCS)
-
-clean: clean-objs clean-libs clean-demos
-clean-libs: clean- at BLT_TARGET@
-clean-objs:
- $(RM) $(BLT_A_OBJS)
-clean-demos:
- $(RM) $(bltsh)* $(bltwish)* *pure* .pure*
-clean-static:
- $(RM) $(blt_core_a) $(blt_x_a)
-clean-pkgs:
- $(RM) $(blt_core_pkgs_so) $(blt_x_pkgs_so)
-clean-shared: clean-pkgs clean-static
- $(RM) $(blt_core_so) $(blt_x_so)
-
-distclean: clean
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"* Makefile
- $(RM) config.h bltHash.h Makefile TAGS
-
-bltDtMysql.o: $(srcdir)/bltDtMysql.c
- $(CC) -c $(CC_OPTS) $(MYSQL_INC_SPEC) $?
-bltDtXml.o: $(srcdir)/bltDtXml.c
- $(CC) -c $(CC_OPTS) $(EXPAT_INC_SPEC) $?
-
-bltTree.o: $(srcdir)/bltTree.c
- $(CC) -c $(CC_OPTS) $(EXPAT_INC_SPEC) $?
-bltTreeXml.o: $(srcdir)/bltTreeXml.c
- $(CC) -c $(CC_OPTS) $(EXPAT_INC_SPEC) $?
-
-bltUnixFont.o: $(srcdir)/bltUnixFont.c
- $(CC) -c $(CC_OPTS) $(FT2_INC_SPEC) $?
-
-bltPictDraw.o: $(srcdir)/bltPictDraw.c $(srcdir)/bltPaintDraw.c
- $(CC) -c $(CC_OPTS) $(FT2_INC_SPEC) $<
-bltPictJpg.o: $(srcdir)/bltPictJpg.c
- $(CC) -c $(CC_OPTS) $(JPG_INC_SPEC) $?
-bltPictTif.o: $(srcdir)/bltPictTif.c
- $(CC) -c $(CC_OPTS) $(TIF_INC_SPEC) $?
-bltPictPng.o: $(srcdir)/bltPictPng.c
- $(CC) -c $(CC_OPTS) $(PNG_INC_SPEC) $?
-bltPictXpm.o: $(srcdir)/bltPictXpm.c
- $(CC) -c $(CC_OPTS) $(XPM_INC_SPEC) $?
-
-bltCoreInit.o: $(srcdir)/bltCoreInit.c
- $(CC) -c $(CC_OPTS) -DTCL_ONLY -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
- $(srcdir)/bltCoreInit.c
-.c.o:
- $(CC) -c $(CC_OPTS) $<
-
diff --git a/blt3.0.1/src/Makefile.vc b/blt3.0.1/src/Makefile.vc
deleted file mode 100644
index 79f3ada..0000000
--- a/blt3.0.1/src/Makefile.vc
+++ /dev/null
@@ -1,775 +0,0 @@
-
-# ------------------------------------------------------------------------
-# Makefile for BLT library using VC++.
-# ------------------------------------------------------------------------
-
-include ../vc.config
-srcdir = ../$(TOP)/src
-libsrcdir = $(srcdir)/../..
-TOOLS32 = C:\Program Files\Microsoft Visual Studio 8\Vc
-BIN = C:/Program\ Files/Microsoft\ Visual\ Studio\ 8/Vc/bin
-AR = lib.exe -link50compat
-LD = link.exe
-CC = cl.exe
-rc32 = rc.exe
-MT = mt.exe
-SDK = C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2
-mslibs = $(TOOLS32)\lib;$(SDK)\lib;.
-
-ifeq ($(WITH_JPG),1)
-JPG_DEFINES = -DHAVE_LIBJPG
-endif # WITH_JPG
-
-ifeq ($(WITH_PNG),1)
-PNG_DEFINES = -DHAVE_LIBPNG
-endif # WITH_PNG
-
-ifeq ($(WITH_PNG),1)
-PNGDEF = -DHAVE_PNG_H -DHAVE_LIBPNG
-PNGDIR = $(libsrcdir)/libpng-1.2.5
-ZLIBDIR = $(libsrcdir)/zlib-1.2.1
-PNGLIB = $(PNGDIR)/libpng.lib $(ZLIBDIR)/zlib.lib
-PNGINC = -I$(PNGDIR) -I$(ZLIBDIR)
-endif # WITH_PNG
-
-ifeq ($(WITH_TIF),1)
-TIFDEF = -DHAVE_TIFF_H -DHAVE_LIBTIFF
-TIFDIR = $(libsrcdir)/tiff-v3.4beta037/libtiff
-TIFLIB = $(TIFDIR)/libtiff.lib
-TIFINC = -I$(TIFDIR)
-endif # WITH_TIF
-
-ifeq ($(WITH_EXPAT),1)
-EXPAT_DEFINES = -DHAVE_EXPAT_H -DHAVE_LIBEXPAT
-endif
-
-ifeq ($(WITH_FT2),1)
-FT2_DEFINES = -DHAVE_FT2BUILD_H -DHAVE_LIBFT2 $(FT2_INC_SPEC)
-endif
-
-PICTURE_DEFINES = $(JPGDEF) $(PNGDEF) $(TIFDEF)
-PICTURE_INCLUDES = $(JPGINC) $(PNGINC) $(TIFINC)
-
-TCL_STUBS_SPEC =
-TK_STUBS_SPEC =
-STUB_DEFINES =
-
-ifeq ($(ENABLE_STUBS),1)
-STUB_DEFINES = -DUSE_TCL_STUBS -DUSE_TK_STUBS
-endif # ENABLE_STUBS
-
-# ------------------------------------------------------------------------
-# C Compiler options
-# ------------------------------------------------------------------------
-
-DEFINES = -D_X86_=1 -D__STDC__ -DWIN32 -DCONSOLE -D_MT \
- $(DEBUG_DEFINES) $(STUB_DEFINES) $(SO_DEFINES) $(EXTRA_DEFINES)
-
-LIB_DEFINES = -DBLT_LIB_SUFFIX=\"$(DBG)\" -DBLT_SO_PREFIX=\"\" \
- -DBLT_SO_EXT=\".dll\"
-
-ifeq ($(ENABLE_SHARED),1)
-SO_DEFINES = -D_DLL
-SO_TARGET = build-dll
-LIBS = $(COMMON_LIBS)
-else
-SO_DEFINES = -D_CTYPE_DISABLE_MACROS
-LIBS = $(COMMON_LIBS) $(EXTRA_LIBS)
-endif # ENABLE_SHARED
-
-ifeq ($(ENABLE_SYMBOLS),1)
-CFLAGS = -Z7 -Od
-DEBUG_LDFLAGS = -debug:full -debugtype:cv
-DEBUG_DEFINES = -DUSE_TCLALLOC=0
-TK_LIB_SPEC = $(TKDIR)/lib/tk$(v2).lib
-TCL_LIB_SPEC = $(TCLDIR)/lib/tcl$(v2).lib
-MSVCRT = msvcrt.lib
-
-TCL_STUBS_SPEC = $(TCLDIR)/lib/tclstub$(v2).lib
-TK_STUBS_SPEC = $(TKDIR)/lib/tkstub$(v2).lib
-
-else
-
-CFLAGS = -Ox -GB -GD
-DEBUG_LDFLAGS = -debug:full -debugtype:cv
-TK_LIB_SPEC = $(TKDIR)/lib/tk$(v2).lib
-TCL_LIB_SPEC = $(TCLDIR)/lib/tcl$(v2).lib
-MSVCRT = msvcrt.lib
-
-TCL_STUBS_SPEC = $(TCLDIR)/lib/tclstub$(v2).lib
-TK_STUBS_SPEC = $(TKDIR)/lib/tkstub$(v2).lib
-
-endif # ENABLE_SYMBOLS
-
-ifeq ($(ENABLE_STUBS), 1)
- tcl_lib_spec=$(TCL_STUBS_SPEC)
- tk_lib_spec=$(TK_STUBS_SPEC)
-else
- tcl_lib_spec=$(TCL_LIB_SPEC)
- tk_lib_spec=$(TK_LIB_SPEC)
-endif
-
-EXTRA_CFLAGS = -nologo -W3
-
-# ------------------------------------------------------------------------
-# Linker flags and options
-# ------------------------------------------------------------------------
-#-align:0x1000
-COMMON_LDFLAGS = -nodefaultlib -release -nologo -warn:3 \
- -machine:IX86 \
- $(DEBUG_LDFLAGS)
-
-# -opt:ref -opt:icf,3 -opt:nowin98
-
-DLLENTRY = @12
-SO_LDFLAGS = $(COMMON_LDFLAGS) \
- -subsystem:console -entry:mainCRTStartup \
- -subsystem:windows -entry:WinMainCRTStartup \
- -entry:_DllMainCRTStartup$(DLLENTRY) -dll
-
-
-BLT_TCL_SO_LDFLAGS = $(COMMON_LDFLAGS) \
- -subsystem:console -entry:mainCRTStartup \
- -entry:_DllMainCRTStartup$(DLLENTRY) -dll
-
-BLT_TCL_SO_LDFLAGS = $(COMMON_LDFLAGS) -dll
-
-BLT_TK_SO_LDFLAGS = $(COMMON_LDFLAGS) \
- -subsystem:windows -entry:WinMainCRTStartup \
- -entry:_DllMainCRTStartup$(DLLENTRY) -dll
-
-BLT_TK_SO_LDFLAGS = $(COMMON_LDFLAGS) -dll
-
-LDFLAGS = $(COMMON_LDFLAGS) \
- -fixed:NO -stack:2300000
-
-COMMON_LIBS = $(MSVCRT) \
- kernel32.lib user32.lib advapi32.lib
-
-EXTRA_LIBS = $(OLELIB) \
- $(JPG_LIB_SPEC) $(PNG_LIB_SPEC) $(TIFLIB) \
- gdi32.lib \
- oldnames.lib \
- advapi32.lib \
- winspool.lib \
- comdlg32.lib
-
-BLT_TCL_LIBS = $(MSVCRT) \
- kernel32.lib user32.lib advapi32.lib
-
-BLT_TK_LIBS = $(OLELIB) \
- $(JPG_LIB_SPEC) $(PNG_LIB_SPEC) $(TIF_LIB_SPEC) \
- $(FT2_LIB_SPEC) \
- $(MSVCRT) \
- kernel32.lib user32.lib \
- gdi32.lib oldnames.lib advapi32.lib winspool.lib \
- comdlg32.lib
-
-
-# ------------------------------------------------------------------------
-# Source and target installation directories
-# ------------------------------------------------------------------------
-
-instdirs = $(prefix) $(exec_prefix) $(bindir) $(libdir) \
- $(includedir)
-instdirs = $(exec_prefix) $(prefix) $(libdir)
-
-# ------------------------------------------------------------------------
-# Directories containing Tcl and Tk include files and libraries
-# ------------------------------------------------------------------------
-
-INCLUDES = -I. -I$(srcdir) -I$(srcdir)/win \
- -I'$(TOOLS32)/include' \
- -I$(TCLDIR)/include -I$(TKDIR)/include
-
-#-I$(TCLROOT)/include
-
-SO_LD_LIBS = $(COMMON_LIBS) $(EXTRA_LIBS)
-
-# ------------------------------------------------------------------------
-# You don't need to edit anything beyond this point
-# ------------------------------------------------------------------------
-
-blt_dt_csv_name = BltDataTableCsv$(version)$(DBG)
-blt_dt_mysql_name = BltDataTableMysql$(version)$(DBG)
-blt_dt_tree_name = BltDataTableTree$(version)$(DBG)
-blt_dt_vec_name = BltDataTableVector$(version)$(DBG)
-blt_dt_xml_name = BltDataTableXml$(version)$(DBG)
-
-blt_dt_xml_so = $(blt_dt_xml_name).dll
-blt_dt_mysql_so = $(blt_dt_mysql_name).dll
-blt_dt_tree_so = $(blt_dt_tree_name).dll
-blt_dt_vec_so = $(blt_dt_vec_name).dll
-blt_dt_csv_so = $(blt_dt_csv_name).dll
-
-blt_dt_xml_implib = $(blt_dt_xml_name).lib
-blt_dt_mysql_implib = $(blt_dt_mysql_name).lib
-blt_dt_tree_implib = $(blt_dt_tree_name).lib
-blt_dt_vec_implib = $(blt_dt_vec_name).lib
-blt_dt_csv_implib = $(blt_dt_csv_name).lib
-
-blt_pict_gif_name = BltPictureGif$(version)$(DBG)
-blt_pict_jpg_name = BltPictureJpg$(version)$(DBG)
-blt_pict_photo_name = BltPicturePhoto$(version)$(DBG)
-blt_pict_png_name = BltPicturePng$(version)$(DBG)
-blt_pict_tif_name = BltPictureTif$(version)$(DBG)
-blt_pict_xbm_name = BltPictureXbm$(version)$(DBG)
-blt_pict_xpm_name = BltPictureXpm$(version)$(DBG)
-
-blt_pict_gif_so = $(blt_pict_gif_name).dll
-blt_pict_jpg_so = $(blt_pict_jpg_name).dll
-blt_pict_png_so = $(blt_pict_png_name).dll
-blt_pict_tif_so = $(blt_pict_tif_name).dll
-blt_pict_xbm_so = $(blt_pict_xbm_name).dll
-blt_pict_xpm_so = $(blt_pict_xpm_name).dll
-blt_pict_photo_so = $(blt_pict_photo_name).dll
-
-blt_pict_gif_implib = $(blt_pict_gif_name).lib
-blt_pict_jpg_implib = $(blt_pict_jpg_name).lib
-blt_pict_png_implib = $(blt_pict_png_name).lib
-blt_pict_tif_implib = $(blt_pict_tif_name).lib
-blt_pict_xbm_implib = $(blt_pict_xbm_name).lib
-blt_pict_xpm_implib = $(blt_pict_xpm_name).lib
-blt_pict_photo_implib = $(blt_pict_photo_name).lib
-
-blt_tree_xml_name = BltTreeXml$(version)$(DBG)
-
-blt_tree_xml_so = $(blt_tree_xml_name).dll
-blt_tree_xml_implib = $(blt_tree_xml_name).lib
-
-blt_tcl_pkgs_so = $(blt_dt_csv_so) \
- $(blt_dt_tree_so) \
- $(blt_dt_vec_so)
-ifeq ($(WITH_EXPAT), 1)
- blt_tcl_pkgs_so += $(blt_dt_xml_so) $(blt_tree_xml_so)
-endif
-ifneq ($(WITH_MYSQL), 1)
- blt_tcl_pkgs_so += $(blt_dt_mysql_so)
-endif
-
-blt_tk_pkgs_so = $(blt_pict_gif_so) \
- $(blt_pict_xbm_so) \
- $(blt_pict_photo_so)
-ifneq ($(WITH_JPG), 1)
- blt_tk_pkgs_so += $(blt_pict_jpg_so)
-endif
-ifneq ("$(PNG_LIB_SPEC)", "")
- blt_tk_pkgs_so += $(blt_pict_png_so)
-endif
-ifneq ("$(XPM_LIB_SPEC)", "")
- blt_tk_pkgs_so += $(blt_pict_xpm_so)
-endif
-ifneq ("$(XPM_TIF_SPEC)", "")
- blt_tk_pkgs_so += $(blt_pict_tif_so)
-endif
-
-
-N_OBJS = bltTed.o
-V3_OBJS = bltTri.o bltGrMt.o
-
-TK_OBJS = tkButton.o tkFrame.o bltScrollbar.o
-
-GRAPH_OBJS = bltGrAxis.o \
- bltGrBar.o \
- bltGrElem.o \
- bltGrHairs.o \
- bltGrLegd.o \
- bltGrLine.o \
- bltGrMarker.o \
- bltGrMisc.o \
- bltGrPen.o \
- bltGrPs.o \
- bltGraph.o
-
-TREEVIEW_OBJS = bltTreeView.o \
- bltTvCmd.o \
- bltTvCol.o \
- bltTvEdit.o \
- bltTvStyle.o
-
-PICTURE_OBJS = bltPicture.o \
- bltPictCmd.o \
- bltPictDraw.o \
- bltPictMmx.o
-
-PICTURE_PKG_OBJS = bltPictGif.o \
- bltPictJpg.o \
- bltPictPhoto.o \
- bltPictPng.o \
- bltPictTif.o \
- bltPictXbm.o \
- bltPictXpm.o
-
-
-TREE_OBJS = bltTree.o \
- bltTreeCmd.o \
-
-TREE_PKG_OBJS = bltTreeXml.o
-
-DATATABLE_OBJS = bltDataTable.o \
- bltDtCmd.o \
-
-DATATABLE_PKG_OBJS = bltDtCsv.o \
- bltDtMysql.o \
- bltDtTree.o \
- bltDtVec.o \
- bltDtXml.o
-
-BLT_TCL_SO_OBJS = bltAlloc.o \
- bltArrayObj.o \
- bltBase64.o \
- bltBgexec.o \
- bltChain.o \
- bltCrc32.o \
- bltCsv.o \
- $(DATATABLE_OBJS) \
- bltDebug.o \
- bltHash.o \
- bltInit.o \
- bltList.o \
- bltNsUtil.o \
- bltParse.o \
- bltPool.o \
- bltDBuffer.o \
- bltSpline.o \
- bltSwitch.o \
- $(TREE_OBJS) \
- bltUtil.o \
- bltVar.o \
- bltVecCmd.o \
- bltVecMath.o \
- bltVector.o \
- bltWatch.o \
- bltWinDde.o \
- bltWinPipe.o \
- bltWinUtil.o \
- pure_api.o
-
-
-BLT_TCL_A_OBJS = $(BLT_TCL_SO_OBJS) \
- $(TREE_PKG_OBJS) \
- $(DATATABLE_PKG_OBJS)
-
-BLT_TK_SO_OBJS = $(GRAPH_OBJS) \
- $(PICTURE_OBJS) \
- $(TREEVIEW_OBJS) \
- bltBeep.o \
- bltBgStyle.o \
- bltBind.o \
- bltBitmap.o \
- bltBusy.o \
- bltCanvEps.o \
- bltComboBtn.o \
- bltComboEntry.o \
- bltComboMenu.o \
- bltComboTree.o \
- bltConfig.o \
- bltContainer.o \
- bltCutbuffer.o \
- bltDragdrop.o \
- bltHtext.o \
- bltImage.o \
- bltOldConfig.o \
- bltPs.o \
- bltTable.o \
- bltTabnotebook.o \
- bltTabset.o \
- bltText.o \
- bltTile.o \
- bltWinBitmap.o \
- bltWinDraw.o \
- bltWinFont.o \
- bltWinPainter.o \
- bltWinPrnt.o \
- bltWinWindow.o \
- bltWindow.o \
- bltWinop.o \
- $(TK_OBJS) $(N_OBJS)
-
-
-BLT_TK_A_OBJS = $(BLT_TK_SO_OBJS) \
- $(PICTURE_PKG_OBJS)
-
-BLT_SO_OBJS = $(BLT_TCL_SO_OBJS) \
- $(BLT_TK_SO_OBJS)
-
-BLT_A_OBJS = $(BLT_TCL_A_OBJS) \
- $(BLT_TK_A_OBJS)
-
-DEMO_OBJS = tkConsole.o bltWinMain.o
-
-NOT_YET = bltContainer.o bltCutBuffer.o bltColor.o
-
-# GNU Make-specific macro
-SRCS = $(patsubst %.o,$(srcdir)/%.c,$(OBJS))
-
-
-HEADERS = blt.h bltChain.h bltVector.h bltTree.h bltPool.h
-GENERATED_HEADERS = bltHash.h
-
-# GNU Make-specific macro
-SRCS = $(patsubst %.o,$(srcdir)/%.c,$(BLT_A_OBJS))
-
-shell_name = bltwish
-version = $(BLT_MAJOR_VERSION)$(BLT_MINOR_VERSION)
-bltwish = bltwish.exe
-bltsh = bltsh.exe
-bltwish2 = bltwish$(version).exe
-bltsh2 = bltsh$(version).exe
-
-blt_tcl_name = BltTcl$(version)$(DBG)
-blt_tk_name = BltTk$(version)$(DBG)
-
-blt_tcl_spec = -L. -l$(blt_tcl_name)
-blt_tk_spec = -L. -l$(blt_tcl_name)
-
-blt_tcl_so = $(blt_tcl_name).dll
-blt_tcl_a = $(blt_tcl_name).a
-blt_tcl_implib = $(blt_tcl_name).lib
-
-blt_tk_so = $(blt_tk_name).dll
-blt_tk_a = $(blt_tk_name).a
-blt_tk_implib = $(blt_tk_name).lib
-
-CC_OPTS = $(CFLAGS) $(EXTRA_CFLAGS) $(DEFINES) $(INCLUDES)
-MAIN_CC_OPTS = $(CC_OPTS) $(JPG_DEFINES) $(PNG_DEFINES)
-
-VPATH = $(srcdir)
-
-all: bltHash.h build-library $(SO_TARGET) build-demos
-
-install: all install-dirs install-headers install-binaries install-demos
-
-build-demos: $(SO_TARGET) $(bltsh) $(bltwish)
-
-build-library: $(blt_tcl_so) $(blt_tcl_a) $(blt_tk_so) $(blt_tk_a)
-
-build-dll: build-library $(blt_tcl_so) $(blt_tk_so)
-
-build_tcl_pkgs: $(blt_tcl_pkgs_so)
-build_tk_pkgs: $(blt_tk_pkgs_so)
-
-$(bltwish): $(blt_tcl_so) $(blt_tk_so) tkConsole.o $(srcdir)/bltWinMain.c
- $(RM) $(bltwish)
- $(CC) -c $(MAIN_CC_OPTS) -DSTATIC_PKGS -DTCLLIBPATH=\"$(TCLLIBPATH)\" \
- -FobltWinMain.o $(srcdir)/bltWinMain.c
- $(LD) $(LDFLAGS) tkConsole.o bltWinMain.o -out:$(bltwish) \
- -subsystem:windows -entry:WinMainCRTStartup \
- $(blt_tk_a) $(blt_tcl_a) \
- $(TK_STUBS_SPEC) $(TK_LIB_SPEC) \
- $(TCL_STUBS_SPEC) $(TCL_LIB_SPEC) \
- $(BLT_TK_LIBS)
- if test -r "$(bltwish).manifest" ; then \
- $(MT) -nologo -manifest $(bltwish).manifest \
- -outputresource:$(bltwish)\;1 ; \
- fi
-
-$(bltsh): $(blt_tcl_so) $(srcdir)/bltWinMain.c
- $(RM) $(bltsh)
- $(CC) -c $(MAIN_CC_OPTS) -DTCL_ONLY -DSTATIC_PKGS \
- -DTCLLIBPATH=\"$(TCLLIBPATH)\" \
- -FobltWinMain.o $(srcdir)/bltWinMain.c
- $(LD) $(LDFLAGS) bltWinMain.o -out:$(bltsh) \
- -subsystem:console -entry:mainCRTStartup \
- $(blt_tcl_a) \
- $(TCL_STUBS_SPEC) $(TCL_LIB_SPEC) \
- $(BLT_TCL_LIBS)
- if test -r "$(bltsh).manifest" ; then \
- $(MT) -nologo -manifest $(bltsh).manifest \
- -outputresource:$(bltsh)\;1 ; \
- fi
-
-$(blt_tk_a): $(BLT_TK_A_OBJS) bltTkInit.c
- $(RM) bltTkInit.o
- $(CC) -c $(CC_OPTS) -FobltTkInit.o $(srcdir)/bltTkInit.c
- $(RM) $@
- $(AR) -out:$@ bltTkInit.o $(BLT_TK_A_OBJS)
-
-$(blt_tk_so): $(blt_tcl_a) $(BLT_TK_SO_OBJS) bltTkInit.c
- $(RM) bltTkInit.o
- $(CC) -c $(CC_OPTS) -DUSE_DLL -FobltTkInit.o $(srcdir)/bltTkInit.c
- $(RM) $@
- $(LD) $(BLT_TK_SO_LDFLAGS) -out:$@ bltTkInit.o $(BLT_TK_SO_OBJS) \
- $(blt_tcl_implib) $(tk_lib_spec) $(tcl_lib_spec) \
- $(BLT_TK_LIBS)
- if test -r "$(blt_tk_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_tk_so).manifest \
- -outputresource:$(blt_tk_so)\;2 ; \
- fi
-
-
-$(blt_tcl_a): bltHash.h $(BLT_TCL_A_OBJS) bltTclInit.c
- $(RM) bltTclInit.o
- $(CC) -c $(CC_OPTS) -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
- -FobltTclInit.o $(srcdir)/bltTclInit.c
- $(RM) $@
- $(AR) -out:$@ bltTclInit.o $(BLT_TCL_A_OBJS)
-
-$(blt_tcl_so): $(blt_tcl_a) $(BLT_TCL_SO_OBJS) bltTkInit.c
- $(RM) bltTclInit.o
- $(CC) -c $(CC_OPTS) -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" -DUSE_DLL \
- -FobltTclInit.o $(srcdir)/bltTclInit.c
- $(RM) $@
- $(LD) $(BLT_TCL_SO_LDFLAGS) -out:$@ bltTclInit.o $(BLT_TCL_SO_OBJS) \
- $(tcl_lib_spec) $(BLT_TCL_LIBS) $(LIBS)
- if test -r "$(blt_tcl_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_tcl_so).manifest \
- -outputresource:$(blt_tcl_so)\;2 ; \
- fi
-
-$(blt_dt_mysql_so): bltDtMysql.o
- $(RM) $@
- $(LD) $(BLT_TCL_SO_LDFLAGS) -out:$@ bltDtMysql.o \
- $(blt_tcl_implib) $(tcl_lib_spec) $(BLT_TCL_LIBS) $(LIBS)
- if test -r "$(blt_dt_mysql_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_dt_mysql_so).manifest \
- -outputresource:$(blt_dt_mysql_so)\;2 ; \
- fi
-
-$(blt_dt_xml_so): bltDtXml.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltDtXml.o $(EXPAT_LIB_SPEC)
- $(RM) $@
- $(LD) $(BLT_TCL_SO_LDFLAGS) -out:$@ bltDtXml.o $(EXPAT_LIB_SPEC) \
- $(blt_tcl_implib) $(tcl_lib_spec) $(BLT_TCL_LIBS) $(LIBS)
- if test -r "$(blt_dt_xml_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_dt_xml_so).manifest \
- -outputresource:$(blt_dt_xml_so)\;2 ; \
- fi
-
-$(blt_dt_csv_so): bltDtCsv.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltDtCsv.o
- $(RM) $@
- $(LD) $(BLT_TCL_SO_LDFLAGS) -out:$@ bltDtMysql.o \
- $(blt_tcl_implib) $(tcl_lib_spec) \
- $(BLT_TCL_LIBS) $(LIBS)
- if test -r "$(blt_dt_mysql_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_dt_mysql_so).manifest \
- -outputresource:$(blt_dt_mysql_so)\;2 ; \
- fi
-
-$(blt_dt_vec_so): bltDtVec.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltDtVec.o
- $(RM) $@
- $(LD) $(BLT_TCL_SO_LDFLAGS) -out:$@ bltDtMysql.o \
- $(blt_tcl_implib) $(tcl_lib_spec) \
- $(BLT_TCL_LIBS) $(LIBS)
- if test -r "$(blt_dt_mysql_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_dt_mysql_so).manifest \
- -outputresource:$(blt_dt_mysql_so)\;2 ; \
- fi
-
-$(blt_dt_tree_so): bltDtTree.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltDtTree.o
- $(RM) $@
- $(LD) $(BLT_TCL_SO_LDFLAGS) -out:$@ bltDtMysql.o \
- $(blt_tcl_implib) $(tcl_lib_spec) \
- $(BLT_TCL_LIBS) $(LIBS)
- if test -r "$(blt_dt_mysql_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_dt_mysql_so).manifest \
- -outputresource:$(blt_dt_mysql_so)\;2 ; \
- fi
-
-$(blt_pict_gif_so): bltPictGif.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictGif.o
- $(RM) $@
- $(LD) $(BLT_TCL_SO_LDFLAGS) -out:$@ bltDtMysql.o \
- $(blt_tcl_implib) $(tcl_lib_spec) \
- $(BLT_TCL_LIBS) $(LIBS)
- if test -r "$(blt_dt_mysql_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_dt_mysql_so).manifest \
- -outputresource:$(blt_dt_mysql_so)\;2 ; \
- fi
-
-$(blt_pict_jpg_so): bltPictJpg.o
- $(RM) $@
- $(LD) $(BLT_TK_SO_LDFLAGS) -out:$@ bltPictJpg.o $(JPG_LIB_SPEC) \
- $(blt_tcl_implib) $(tcl_lib_spec) $(LIBS)
- if test -r "$(blt_pict_jpg_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_pict_jpg_so).manifest \
- -outputresource:$(blt_pict_jpg_so)\;2 ; \
- fi
-
-$(blt_pict_png_so): bltPictPng.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictPng.o $(PNG_LIB_SPEC)
- $(RM) $@
- $(LD) $(BLT_TCL_SO_LDFLAGS) -out:$@ bltDtMysql.o \
- $(blt_tcl_implib) $(tcl_lib_spec) \
- $(BLT_TCL_LIBS) $(LIBS)
- if test -r "$(blt_dt_mysql_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_dt_mysql_so).manifest \
- -outputresource:$(blt_dt_mysql_so)\;2 ; \
- fi
-
-$(blt_pict_tif_so): bltPictTif.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictTif.o $(TIF_LIB_SPEC)
- $(RM) $@
- $(LD) $(BLT_TCL_SO_LDFLAGS) -out:$@ bltDtMysql.o \
- $(blt_tcl_implib) $(tcl_lib_spec) \
- $(BLT_TCL_LIBS) $(LIBS)
- if test -r "$(blt_dt_mysql_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_dt_mysql_so).manifest \
- -outputresource:$(blt_dt_mysql_so)\;2 ; \
- fi
-
-$(blt_pict_xbm_so): bltPictXbm.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictXbm.o
- $(RM) $@
- $(LD) $(BLT_TCL_SO_LDFLAGS) -out:$@ bltDtMysql.o \
- $(blt_tcl_implib) $(tcl_lib_spec) \
- $(BLT_TCL_LIBS) $(LIBS)
- if test -r "$(blt_dt_mysql_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_dt_mysql_so).manifest \
- -outputresource:$(blt_dt_mysql_so)\;2 ; \
- fi
-
-$(blt_pict_xpm_so): bltPictXpm.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictXpm.o \
- $(X11_LIB_SPEC) $(XPM_LIB_SPEC)
- $(RM) $@
- $(LD) $(BLT_TK_SO_LDFLAGS) -out:$@ bltDtMysql.o \
- $(blt_tcl_implib) $(tcl_lib_spec) $(tk_lib_spec) \
- $(BLT_TCL_LIBS) $(LIBS)
- if test -r "$(blt_dt_mysql_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_dt_mysql_so).manifest \
- -outputresource:$(blt_dt_mysql_so)\;2 ; \
- fi
-
-$(blt_pict_photo_so): bltPictPhoto.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictPhoto.o
- $(RM) $@
- $(LD) $(BLT_TK_SO_LDFLAGS) -out:$@ bltPictPhoto.o \
- $(blt_tk_implib) $(blt_tcl_implib) \
- $(tk_lib_spec) $(tcl_lib_spec) \
- $(BLT_TK_LIBS) $(LIBS)
- if test -r "$(blt_pict_photo_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_pict_photo_so).manifest \
- -outputresource:$(blt_pict_photo_so)\;2 ; \
- fi
-
-$(blt_tree_xml_so): bltTreeXml.o
- $(RM) $@
- $(LD) $(BLT_TCL_SO_LDFLAGS) -out:$@ bltTreeXml.o $(EXPAT_LIB_SPEC) \
- $(blt_tcl_implib) $(tcl_lib_spec) \
- $(BLT_TCL_LIBS) $(LIBS)
- if test -r "$(blt_tree_xml_so).manifest" ; then \
- $(MT) -nologo -manifest $(blt_tree_xml_so).manifest \
- -outputresource:$(blt_tree_xml_so)\;2 ; \
- fi
-
-bltWinMain.o: $(srcdir)/bltWinMain.c
- $(CC) -c $(CC_OPTS) -DTCLLIBPATH=\"$(TCLLIBPATH)\" \
- -FobltWinMain.o $(srcdir)/bltWinMain.c
-
-bltPictureDraw.o: $(srcdir)/bltPictureDraw.c
- $(CC) -c $(CC_OPTS) $(FREETYPE2_INC_SPEC) \
- -FobltPictureDraw.o $(srcdir)/bltPictureDraw.c
-
-bltDtMysql.o: $(srcdir)/bltDtMysql.c
- $(CC) -c $(CC_OPTS) $(MYSQL_DEFINES) $(MYSQL_INC_SPEC) \
- -FobltDtMysql.o $(srcdir)/bltDtMysql.c
-
-bltDtXml.o: $(srcdir)/bltDtXml.c
- $(CC) -c $(CC_OPTS) $(EXPAT_DEFINES) $(EXPAT_INC_SPEC) \
- -FobltDtXml.o $(srcdir)/bltDtXml.c
-
-bltTreeXml.o: $(srcdir)/bltTreeXml.c
- $(CC) -c $(CC_OPTS) $(EXPAT_DEFINES) $(EXPAT_INC_SPEC) \
- -FobltTreeXml.o $(srcdir)/bltTreeXml.c
-
-bltPictJpg.o: $(srcdir)/bltPictJpg.c
- $(CC) -c $(CC_OPTS) $(JPG_DEFINES) $(JPG_INC_SPEC) \
- -FobltPictJpg.o $(srcdir)/bltPictJpg.c
-
-bltPictPng.o: $(srcdir)/bltPictPng.c
- $(CC) -c $(CC_OPTS) $(PNG_DEFINES) $(PNG_INC_SPEC) \
- -FobltPictPng.o $(srcdir)/bltPictPng.c
-
-bltPictureFormats.o: $(srcdir)/bltPictureFormats.c
- $(CC) -c $(CC_OPTS) $(PICTURE_DEFINES) \
- $(FREETYPE2_INC_SPEC) $(PICTURE_INCLUDES) \
- -FobltPictureFormats.o $(srcdir)/bltPictureFormats.c
-
-bltPictureImage.o: $(srcdir)/bltPictureImage.c
- $(CC) -c $(CC_OPTS) $(PICTURE_DEFINES) \
- -FobltPictureImage.o $(srcdir)/bltPictureImage.c
-
-bltHash.h: $(srcdir)/bltHash.h.in
- sed -e 's/@SIZEOF_VOID_P@/4/' \
- -e 's/@SIZEOF_INT@/4/' \
- -e 's/@SIZEOF_LONG@/4/' \
- -e 's/@SIZEOF_LONG_LONG@/8/' \
- -e 's/@HAVE_INTTYPES_H@/0/' \
- $(srcdir)/bltHash.h.in > bltHash.h
-
-bltHash.c: bltHash.h
-
-install-dirs:
- @for i in $(instdirs) ; do \
- if test ! -d "$$i" ; then \
- echo " mkdir $$i" ; \
- mkdir "$$i" ; \
- fi ; \
- done
-
-install-binaries: install-lib install-demos
-
-install-demos: build-demos
- $(INSTALL) $(bltwish) $(bindir)/$(bltwish)
- $(INSTALL) $(bltwish) $(bindir)/$(bltwish2)
- $(INSTALL) $(bltsh) $(bindir)/$(bltsh)
- $(INSTALL) $(bltsh) $(bindir)/$(bltsh2)
-
-install-lib: $(blt_tcl_so) $(blt_tk_so) $(blt_tcl_a) $(blt_tk_a)
- $(INSTALL) $(blt_tcl_so) $(bindir)
- $(INSTALL) $(blt_tk_so) $(bindir)
- $(INSTALL_DATA) $(blt_tcl_a) $(libdir)
- $(INSTALL_DATA) $(blt_tk_a) $(libdir)
-
-install-headers: bltHash.h
- for i in $(HEADERS) ; do \
- $(INSTALL_DATA) "$(srcdir)/$$i" $(includedir) ; \
- done
- $(INSTALL_DATA) bltHash.h $(includedir)
-
-lint:
- $(LINT) $(LINTFLAGS) $(DEFINES) $(INCLUDES) $(SRCS)
-
-clean:
- $(RM) *.o *.pdb *.exp *.manifest *.lib \
- $(blt_tcl_a) $(blt_tcl_so) \
- $(blt_tk_a) $(blt_tk_so) \
- $(bltwish) $(bltsh) $(bltwish2) $(bltsh2)
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"*
-
-distclean: clean
- $(RM) Makefile
-
-bltTclInit.o: bltTclInit.c
- $(CC) -c $(CC_OPTS) -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
- -FobltTclInit.o $(srcdir)/bltTclInit.c
-
-bltPictCmd.o: $(srcdir)/bltPictCmd.c
- $(CC) -c $(CC_OPTS) $(LIB_DEFINES) -Fo$@ $(srcdir)/bltPictCmd.c
-
-bltDtCmd.o: $(srcdir)/bltDtCmd.c
- $(CC) -c $(CC_OPTS) $(LIB_DEFINES) -Fo$@ $(srcdir)/bltDtCmd.c
-
-bltTreeCmd.o: $(srcdir)/bltTreeCmd.c
- $(CC) -c $(CC_OPTS) $(LIB_DEFINES) -Fo$@ $(srcdir)/bltTreeCmd.c
-
-bltPictDraw.o: $(srcdir)/bltPictDraw.c
- $(CC) -c $(CC_OPTS) $(FT2_DEFINES) -Fo$@ $(srcdir)/bltPictDraw.c
-
-.c.o:
- $(CC) -c $(CC_OPTS) -Fo$@ $<
-
diff --git a/blt3.0.1/src/TODO b/blt3.0.1/src/TODO
deleted file mode 100644
index aa858f2..0000000
--- a/blt3.0.1/src/TODO
+++ /dev/null
@@ -1,175 +0,0 @@
-
-To do:
-
-bgexec (Windows)
- 1. (BUG) Convert collected data to UTF before passing to the interpreter.
-
-container (Unix)
- 1. (done) Add timeout option to control how long to search for application
- window.
-
-debug
- 1. (done) Recent versions of Tcl swamp Tcl_CommandTrace.
- Add line cutoff option (default is 6).
-
-dnd (Unix)
- 1. (DOC) Create manual page for "dnd" command.
- 2. (Feature) Add Motif drag-and-drop capabilities.
-
-eps
- 1. (DOC) Update manual page for eps canvas item.
- 2. (FEATURE) Read Windows EPS files with embedded TIFF images.
-
-graph
- 1. (done) Fix zooming graph procedure to handle multiple axes.
- 2. (BUG) Windows printing commands "print1" and "print2" need to use
- postscript options like -maxpect, -pad, etc. to control graph
- size.
- 3. (BUG) No PostScript generated for polygon tiling.
- 4. (BUG) Clip background polygon for text/bitmap markers.
- 5. (FEATURE) Add -mask option for bitmap marker.
- 6. (FEATURE) Allow rotated image markers.
- 7. (FEATURE) Add oval and rectangle markers.
- 8. (FEATURE) Add arrowheads to line markers.
- 9. (BUG) Finish adding error bars.
- 10. (DOC) Review and update documentation for new typos, new features.
- 11. (BUG) Store converted screen coordinates in floating point. Can't
- use integer coordinates for higher resolution PostScript
- devices. How do Windows' print devices handle this?
-
-hierbox
- 1. (CHANGE) Hierbox to use tree object for data. The -data option will
- be a field in the tree.
- 2. (FEATURE) Add edit bindings for entries.
- 3. (DOCUMENTATION) Create real hierbox manual page.
-
-hiertable
- 1. (done) -tree option dumps core.
- 2. (done) Sorting tree view affects all other hiertables using the tree.
- Is separate data structure needed for non-flattened sorts? What
- about moves?
- 3. (done) Call tree update procedure when tree object is sorted. This
- is only when a tree is shared between more than one hiertable.
- It goes out-of-sync with actual tree positions.
- 4. (CHANGE) "column resize set" should change the width of the active
- column automatically.
- 5a.(FEATURE) XOR outline for entry move operation.
- 5b.(FEATURE) XOR outline for entry resize operation.
- 6a.(done) XOR outline for column resize operation.
- 6b.(FEATURE) XOR outline for column move operation.
- 7. (???) Update procedure isn't called for moved nodes. Call global
- update routine (like sort) or selected node update procedures?
- 8. (DOC) Explain selection modes ("single" and "multiple")
- in manual page.
- 9. (BUG) Multi-line entry editting is broken.
- 10. (BUG) Add default bindings for entry editting. Need to set grab
- on edit window.
- 11. (BUG) Add standard keyboard bindings.
- 12. (FEATURE) Images in column title.
- 13. (PERFORMANCE) Don't redraw entire widget for scrolling. Copy
- portions of pixmap and redraw only changed areas.
- This will affect lots of code.
- 14. (PERFORMANCE) Don't redraw entire widget for selections. Draw
- only changed entries.
- 15. (???) Add checkbox column entries.
- 16. (BUG) "column resize" reports incorrect width of column.
-
-printer (Windows)
- 1. (DOC) Create manual page for "printer" command.
- 2. (FEATURE) Add operation to print text and canvas widgets.
- 3. (FEATURE) Create sample print dialog.
- 4. (BUG) Needs print job abort handler.
-
-tabset
- 1. (done) Add perforation gizmo for tearoffs.
- 2. (FEATURE) Allow alternatative tearout styles.
-
-tree
- 1. (done) Create Tcl interface.
- 2. (DOC) Create manuals for both Tcl and C APIs.
-
-vector
- 1. (FEATURE) Add Tcl-based notification callbacks.
-
-gradient
- 1. (FEATURE) Create gradient command that interfaces with tiling.
-
-all (Mac)
-
----------------------
-
-barchart - Anti-aliased lines for bars?
-barchart - Clip bars properly.
-barchart - Store bars with floating point coordinates
-barchart - Fix PostScript, fix translucent bars.
-graph - Fix PostScript, fix translucent symbols
-graph - Fix PostScript font stringwidth using AFM files
-graph - Simple markup (subscript/superscript, font size color, greek symbols)
-graph - PDF output.
-picture - Add gradient paint operations
-picture - Wide lines
-picture - shadows.
-picture - Fix text operations. Single glyph
-picture - PDF output
-picture - convolve
-bgpattern - tile and gradient polygons
-table widget -
-contour widget -
-
-macosx - build
- - busy, ?
-
-dataarray:
-
-1. Reference counted vectors. Don't require master to delete.
- Can attach like trees and tables.
-2. No variable interface.
-3. Tcl notifier interface.
-4. Connect to table columns.
-5. Use Blt_Objs
-6. No #auto.
-7. Test harness.
-8. Use Tcl_Objs instead of double array. Allow strings, images, arrays, etc.
-
-
----------------------------------------------
-
-Paneset --
-
- Fix modes.
- Leave room for sash when shrinking window.
-
-Graph --
-
- Constrain size of symbols.
- Fix axis line with solid plot lines.
-
-Barchart --
-
- Clip bar segments against plot area.
-
-Scrollset --
-
- Fix manual.
-
-Treeview --
-
- Fix combobox style to support combomenus.
- Add automatic scrollbars.
- Change scrolling to use XCopyArea.
-
-Combomenu --
-
- Better icon for radiobuttons.
-
-Comboentry --
-
-Combotree --
-
- Fix background.
-
-Combobutton --
-
-Menubar --
-
-
diff --git a/blt3.0.1/src/blt.h b/blt3.0.1/src/blt.h
deleted file mode 100644
index d57c007..0000000
--- a/blt3.0.1/src/blt.h
+++ /dev/null
@@ -1,53 +0,0 @@
-
-/*
- * blt.h --
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_H
-#define _BLT_H
-
-#define BLT_MAJOR_VERSION 3
-#define BLT_MINOR_VERSION 0
-#define BLT_VERSION "3.0"
-#define BLT_PATCH_LEVEL "3.0a"
-#define BLT_RELEASE_SERIAL 0
-
-#define BLT_STORAGE_CLASS
-
-#ifdef __cplusplus
-# define BLT_EXTERN BLT_STORAGE_CLASS extern "C"
-#else
-# define BLT_EXTERN BLT_STORAGE_CLASS extern
-#endif /* __cplusplus */
-
-#define _VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-
-#ifndef _ANSI_ARGS_
-# define _ANSI_ARGS_(x) ()
-#endif
-
-#endif /*_BLT_H*/
diff --git a/blt3.0.1/src/blt.mak b/blt3.0.1/src/blt.mak
deleted file mode 100644
index 91dd6fa..0000000
--- a/blt3.0.1/src/blt.mak
+++ /dev/null
@@ -1,321 +0,0 @@
-
-# ------------------------------------------------------------------------
-#
-# Nmakefile for BLT library using VC++.
-#
-# Please note this file may or may not be up-to-date.
-#
-# You can compare it with "Makefile.vc" in this directory. That's
-# what I use to build BLT (so it should be current). It builds BLT
-# with VC++ 6.0 and the cygwin32 tool suite from
-#
-# http://sourceware.cygnus.com
-#
-# ------------------------------------------------------------------------
-
-!INCLUDE ../win/makedefs
-
-TOOLS32 = C:/Program Files/Microsoft Visual Studio/Vc98
-prefix = C:/Program Files/Tcl
-
-AR = lib.exe
-LD = link.exe
-CC = cl.exe
-rc32 = rc.exe
-RM = -del
-
-# ------------------------------------------------------------------------
-# C Compiler options
-# ------------------------------------------------------------------------
-
-DEFINES = -D_X86_=1 -D__STDC__ -DWIN32 -DCONSOLE -D_MT \
- $(DEBUG_DEFINES) $(SHLIB_DEFINES)
-EXTRA_CFLAGS = -nologo -W3
-
-!IF "$(SHARED)" == "1"
-SHLIB_DEFINES = -D_DLL
-SHLIB_TARGET = build-dll
-LIBS = $(COMMON_LIBS)
-!ELSE
-SHLIB_DEFINES = -D_CTYPE_DISABLE_MACROS
-LIBS = $(COMMON_LIBS) $(EXTRA_LIBS)
-!ENDIF
-
-!IF "$(DEBUG)" == "1"
-CFLAGS = -Z7 -Od
-DEBUG_LDFLAGS = -debug:full -debugtype:cv
-D = d
-builddir = .\Debug
-!ELSE
-CFLAGS = -Ox -GB -GD
-DEBUG_LDFLAGS = -debug:full -debugtype:cv
-D =
-builddir = .\Release
-!ENDIF
-
-
-MSVCRT = msvcrt$(DBG).lib
-TK_LIB = $(TKDIR)/win/$(builddir)/tk$(v2)$(D).lib
-TCL_LIB = $(TCLDIR)/win/$(builddir)/tcl$(v2)$(D).lib
-
-# ------------------------------------------------------------------------
-# Linker flags and options
-# ------------------------------------------------------------------------
-
-JPEGLIB = $(JPEGDIR)/libjpeg.lib
-
-COMMON_LDFLAGS = -nodefaultlib -release -nologo -warn:3 \
- -machine:IX86 -align:0x1000 \
- $(DEBUG_LDFLAGS)
-
-DLLENTRY = @12
-SHLIB_LDFLAGS = $(COMMON_LDFLAGS) \
- -subsystem:console -entry:mainCRTStartup \
- -subsystem:windows -entry:WinMainCRTStartup \
- -entry:_DllMainCRTStartup$(DLLENTRY) -dll
-
-LDFLAGS = $(COMMON_LDFLAGS) \
- -fixed:NO -stack:2300000
-
-COMMON_LIBS = $(TK_LIB) $(TCL_LIB) \
- $(MSVCRT) \
- kernel32.lib user32.lib
-
-EXTRA_LIBS = $(OLELIB) \
- $(JPEGLIB) \
- gdi32.lib \
- oldnames.lib \
- advapi32.lib \
- winspool.lib
-
-TCL_ONLY_LIBS = $(TCL_LIB) $(MSVCRT) kernel32.lib user32.lib advapi32.lib
-
-# ------------------------------------------------------------------------
-# Source and target directories
-# ------------------------------------------------------------------------
-
-srcdir = .
-instdirs = $(prefix) $(exec_prefix) $(bindir) $(libdir) \
- $(includedir)
-instdirs = $(exec_prefix) $(prefix) $(libdir)
-
-# ------------------------------------------------------------------------
-# Directories containing Tcl and Tk include files and libraries
-# ------------------------------------------------------------------------
-
-JPEGDIR = $(srcdir)/../../jpeg-6b
-TCLDIR = $(srcdir)/../../tcl$(v3)
-TKDIR = $(srcdir)/../../tk$(v3)
-INCLUDES = -I. -I$(srcdir) \
- -I"$(TOOLS32)/include" \
- -I$(TCLDIR)/win \
- -I$(TCLDIR)/generic \
- -I$(TKDIR)/win \
- -I$(TKDIR)/generic \
- -I$(TKDIR)/xlib \
- -I$(JPEGDIR)
-SHLIB_LD_LIBS = $(COMMON_LIBS) $(EXTRA_LIBS)
-
-# ------------------------------------------------------------------------
-# You don't need to edit anything beyond this point
-# ------------------------------------------------------------------------
-
-N_OBJS = bltTed.o
-V3_OBJS = bltTri.o bltGrMt.o
-
-TK_OBJS = tkButton.o tkFrame.o bltScrollbar.o
-
-GRAPH_OBJS = bltGrAxis.o \
- bltGrBar.o \
- bltGrElem.o \
- bltGrHairs.o \
- bltGrLegd.o \
- bltGrLine.o \
- bltGrMarker.o \
- bltGrMisc.o \
- bltGrPen.o \
- bltGrPs.o \
- bltGraph.o
-
-TCL_ONLY_OBJS = bltAlloc.o \
- bltArrayObj.o \
- bltBgexec.o \
- bltChain.o \
- bltDebug.o \
- bltHash.o \
- bltList.o \
- bltNsUtil.o \
- bltParse.o \
- bltPool.o \
- bltSpline.o \
- bltSwitch.o \
- bltTree.o \
- bltTreeCmd.o \
- bltUtil.o \
- bltVecCmd.o \
- bltVecMath.o \
- bltVector.o \
- bltWatch.o
- bltWinPipe.o \
-
-OBJS = $(GRAPH_OBJS) \
- $(TCL_ONLY_OBJS) \
- bltBeep.o \
- bltBind.o \
- bltBitmap.o \
- bltBusy.o \
- bltCanvEps.o \
- bltConfig.o \
- bltContainer.o \
- bltDragdrop.o \
- bltHtext.o \
- bltImage.o \
- bltOldConfig.o \
- bltPainter.o \
- bltPicture.o \
- bltPictureFormats.o \
- bltPictureImage.o \
- bltPictureMMX.o \
- bltPs.o \
- bltTable.o \
- bltTabnotebook.o \
- bltTabset.o \
- bltText.o \
- bltTile.o \
- bltTreeView.o \
- bltTreeViewCmd.o \
- bltTreeViewColumn.o \
- bltTreeViewEdit.o \
- bltTreeViewStyle.o \
- bltWinBitmap.o \
- bltWinDraw.o \
- bltWinPainter.o \
- bltWinPrnt.o \
- bltWinWindow.o \
- bltWindow.o \
- bltWinop.o \
- $(TK_OBJS) $(N_OBJS)
-
-bltwish = bltwish.exe
-bltsh = bltsh.exe
-headers = $(srcdir)/blt.h \
- $(srcdir)/bltBind.h \
- $(srcdir)/bltChain.h \
- bltHash.h \
- $(srcdir)/bltList.h \
- $(srcdir)/bltPool.h \
- $(srcdir)/bltTree.h \
- $(srcdir)/bltVector.h
-
-version = $(BLT_MAJOR_VERSION)$(BLT_MINOR_VERSION)
-bltwish2 = bltwish$(version).exe
-bltsh2 = bltsh$(version).exe
-
-lib_name = BLT$(version)
-lib_a = BLT$(version).lib
-lib_so = BLT$(version).dll
-tcl_only_lib_a = BLTlite$(version).lib
-tcl_only_lib_so = BLTlite$(version).dll
-
-CC_SWITCHES = $(CFLAGS) $(EXTRA_CFLAGS) $(DEFINES) $(INCLUDES)
-VPATH = $(srcdir)
-
-all: build-library $(SHLIB_TARGET) build-demos
-
-build-demos: $(SHLIB_TARGET) $(bltwish) $(bltsh)
-
-build-library: $(BLT_LIB)
-
-build-library: $(lib_a) $(tcl_only_lib_a)
-
-build-dll: build-library $(lib_so) $(tcl_only_lib_so)
-
-$(bltwish): $(lib_a) tkConsole.o bltWinMain.c
- $(RM) $(bltwish)
- $(CC) -c $(CC_SWITCHES) -DTCLLIBPATH=\"$(TCLLIBPATH)\" \
- -FobltWinMain.o $(srcdir)/bltWinMain.c
- LIB=$(TOOLS32)/lib \
- $(LD) $(LDFLAGS) tkConsole.o bltWinMain.o -out:$(bltwish) \
- $(lib_a) $(LIBS)
-
-$(bltsh): $(tcl_only_lib_a) bltWinMain.c
- $(RM) $(bltsh)
- $(CC) -c $(CC_SWITCHES) -DTCL_ONLY \
- -DTCLLIBPATH=\"$(TCLLIBPATH)\" \
- -FobltWinMain.o $(srcdir)/bltWinMain.c
- LIB=$(TOOLS32)/lib \
- $(LD) $(LDFLAGS) bltWinMain.o -out:$(bltsh) \
- $(tcl_only_lib_a) $(TCL_ONLY_LIBS)
-
-$(lib_a): bltHash.h $(OBJS) bltInit.c
- $(RM) bltInit.o
- $(CC) -c $(CC_SWITCHES) -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
- -FobltInit.o $(srcdir)/bltInit.c
- $(RM) $@
- $(AR) -out:$@ bltInit.o $(OBJS)
-
-$(lib_so): $(lib_a) $(OBJS) bltInit.c
- $(RM) bltInit.o
- $(CC) -c $(CC_SWITCHES) -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
- -FobltInit.o $(srcdir)/bltInit.c
- $(RM) $@
- LIB=$(TOOLS32)/lib \
- $(LD) $(SHLIB_LDFLAGS) -out:$@ bltInit.o $(OBJS) $(SHLIB_LD_LIBS)
-
-$(tcl_only_lib_a): bltHash.h $(TCL_ONLY_OBJS) bltInit.c
- $(RM) bltInit.o
- $(CC) -c $(CC_SWITCHES) -DTCL_ONLY -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
- -FobltInit.o $(srcdir)/bltInit.c
- $(RM) $@
- $(AR) -out:$@ bltInit.o $(TCL_ONLY_OBJS)
-
-$(tcl_only_lib_so): $(tcl_only_lib_a) $(TCL_ONLY_OBJS) bltInit.c
- $(RM) bltInit.o
- $(CC) -c $(CC_SWITCHES) -DTCL_ONLY -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
- -FobltInit.o $(srcdir)/bltInit.c
- $(RM) $@
- LIB=$(TOOLS32)/lib \
- $(LD) $(SHLIB_LDFLAGS) -out:$@ bltInit.o $(TCL_ONLY_OBJS) \
- $(TCL_ONLY_LIBS)
-
-bltHash.h: bltHash.h.in
- sed -e 's/@SIZEOF_VOID_P@/4/' \
- -e 's/@SIZEOF_INT@/4/' \
- -e 's/@SIZEOF_LONG@/4/' \
- -e 's/@SIZEOF_LONG_LONG@/8/' \
- -e 's/@HAVE_INTTYPES_H@/0/' \
- bltHash.h.in > bltHash.h
-
-clean:
- -del *.o 2>nul
- -del *.pdb 2>nul
- -del *.exp 2>nul
- -del $(lib_name).* 2>nul
- -del $(bltwish) 2>nul
- -del $(bltsh) 2>nul
- -del $(srcdir)\*.bak 2>nul
- -del $(srcdir)\*~ 2>nul
- -del $(srcdir)\"#"* 2>nul
-
-bltPictureDraw.o: $(srcdir)/bltPictureDraw.c
- $(CC) -c $(CC_OPTS) $(FT_INC_SPEC) \
- -FobltPictureDraw.o $(srcdir)/bltPictureDraw.c
-
-bltPictureFormats.o: $(srcdir)/bltPictureFormats.c
- $(CC) -c $(CC_OPTS) \
- $(FT_INC_SPEC) \
- $(JPEG_INC_SPEC) $(TIFF_INC_SPEC) $(PNG_INC_SPEC) \
- $(XPM_INC_SPEC)$(PICTURE_INCLUDES) \
- -FobltPictureFormats.o $(srcdir)/bltPictureFormats.c
-
-{$(srcdir)}.c.o:
- $(CC) -c $(CC_SWITCHES) -Fo$*.o $<
-
-
-
-
-
-
-
-
-
diff --git a/blt3.0.1/src/bltAlloc.c b/blt3.0.1/src/bltAlloc.c
deleted file mode 100644
index 266544c..0000000
--- a/blt3.0.1/src/bltAlloc.c
+++ /dev/null
@@ -1,229 +0,0 @@
-#include "bltInt.h"
-
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif /* HAVE_MALLOC_H */
-
-/*
- * Memory allocation/deallocation in BLT is performed via the global
- * variables bltMallocPtr, bltFreePtr, and bltReallocPtr. By default,
- * they point to the same routines that TCL uses. The routine
- * Blt_AllocInit allows you to specify your own memory allocation and
- * deallocation routines for BLT on a library-wide basis.
- */
-#ifdef WIN32
-
-#ifdef __GNUC__
-#ifndef USE_TCL_STUBS
-EXTERN char *Tcl_Alloc(unsigned int size);
-EXTERN void Tcl_Free(char * ptr);
-EXTERN char *Tcl_Realloc(char *ptr, unsigned int size);
-#endif
-#endif /*__GNUC__*/
-
-#else
-
-#if (_TCL_VERSION >= _VERSION(8,1,0))
-#ifndef USE_TCL_STUBS
-BLT_EXTERN Blt_MallocProc TclpAlloc;
-BLT_EXTERN Blt_FreeProc TclpFree;
-BLT_EXTERN Blt_ReallocProc TclpRealloc;
-#endif
-#else
-#if !HAVE_DECL_FREE
-BLT_EXTERN void free (void *);
-#endif
-#endif /* >= 8.1.0 */
-#endif /* WIN32 */
-
-static Blt_MallocProc *bltMallocPtr;
-static Blt_ReallocProc *bltReallocPtr;
-static Blt_FreeProc *bltFreePtr;
-
-void *
-Blt_Malloc(size_t size)
-{
- return (*bltMallocPtr)(size);
-}
-
-
-void
-Blt_Free(const void *mem)
-{
- (*bltFreePtr)((void *)mem);
-}
-
-void *
-Blt_Realloc(void *ptr, size_t size)
-{
- return (*bltReallocPtr)(ptr, size);
-}
-
-void *
-Blt_Calloc(size_t nElem, size_t elemSize)
-{
- void *ptr;
- size_t size;
-
- size = nElem * elemSize;
- ptr = (*bltMallocPtr)(size);
- if (ptr != NULL) {
- memset(ptr, 0, size);
- }
- return ptr;
-}
-
-void *
-Blt_MallocAbortOnError(size_t size, const char *fileName, int lineNum)
-{
- void *ptr;
-
- ptr = (*bltMallocPtr)(size);
- if (ptr == NULL) {
-#ifdef WINDEBUG
- PurifyPrintf("line %d of %s: can't allocate %lu bytes of memory\n",
- lineNum, fileName, (unsigned long)size);
-#endif
- fprintf(stderr, "line %d of %s: can't allocate %lu bytes of memory\n",
- lineNum, fileName, (unsigned long)size);
-
- fflush(stderr);
- abort();
- }
- return ptr;
-}
-
-void *
-Blt_CallocAbortOnError(size_t nElem, size_t elemSize, const char *fileName,
- int lineNum)
-{
- void *ptr;
- size_t size;
-
- size = nElem * elemSize;
- ptr = (*bltMallocPtr)(size);
- if (ptr == NULL) {
-#ifdef WINDEBUG
- PurifyPrintf(
- "line %d of %s: can't allocate %lu item(s) of size %lu each\n",
- lineNum, fileName, (unsigned long)nElem,
- (unsigned long)elemSize);
-#endif
- fprintf(stderr,
- "line %d of %s: can't allocate %lu item(s) of size %lu each\n",
- lineNum, fileName, (unsigned long)nElem,
- (unsigned long)elemSize);
- fflush(stderr);
- abort();
- }
- memset(ptr, 0, size);
- return ptr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Strdup --
- *
- * Create a copy of the string from heap storage.
- *
- * Results:
- * Returns a pointer to the need string copy.
- *
- *---------------------------------------------------------------------------
- */
-char *
-Blt_Strdup(const char *string)
-{
- size_t size;
- char *ptr;
-
- size = strlen(string) + 1;
- ptr = (*bltMallocPtr)(size * sizeof(char));
- if (ptr != NULL) {
- strcpy(ptr, string);
- }
- return ptr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_StrdupAbortOnError --
- *
- * Create a copy of the string from heap storage.
- *
- * Results:
- * Returns a pointer to the need string copy.
- *
- *---------------------------------------------------------------------------
- */
-char *
-Blt_StrdupAbortOnError(const char *string, const char *fileName, int lineNum)
-{
- size_t size;
- char *ptr;
-
- size = strlen(string) + 1;
- ptr = (*bltMallocPtr)(size * sizeof(char));
- if (ptr == NULL) {
-#ifdef WINDEBUG
- PurifyPrintf("line %d of %s: can't allocate string of %lu bytes\n",
- lineNum, fileName, (unsigned long)size);
-#endif
- fprintf(stderr, "line %d of %s: can't allocate string of %lu bytes\n",
- lineNum, fileName, (unsigned long)size);
- fflush(stderr);
- abort();
- }
- strcpy(ptr, string);
- return ptr;
-}
-
-void
-Blt_AllocInit(
- Blt_MallocProc *mallocProc,
- Blt_ReallocProc *reallocProc,
- Blt_FreeProc *freeProc)
-{
- Blt_MallocProc *defMallocProc;
- Blt_FreeProc *defFreeProc;
- Blt_ReallocProc *defReallocProc;
-
- /*
- * Try to use the same memory allocator/deallocator that TCL is
- * using. Before 8.1 it used malloc/free.
- */
-#ifdef WIN32
- defMallocProc = (Blt_MallocProc *)Tcl_Alloc;
- defFreeProc = (Blt_FreeProc *)Tcl_Free;
- defReallocProc = (Blt_ReallocProc *)Tcl_Realloc;
-#else
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- /*
- * We're pointing to the private TclpAlloc/TclpFree instead of public
- * Tcl_Alloc/Tcl_Free routines because they don't automatically trigger a
- * panic when not enough memory is available. There are cases (such as
- * allocating a very large vector) where an out-of-memory error is
- * recoverable.
- */
- defMallocProc = (Blt_MallocProc *)TclpAlloc;
- defFreeProc = (Blt_FreeProc *)TclpFree;
- defReallocProc = (Blt_ReallocProc *)TclpRealloc;
-#else
- defMallocProc = malloc;
- defFreeProc = free;
- defReallocProc = realloc;
-#endif /* >= 8.1.0 */
-#endif /* WIN32 */
- if (bltMallocPtr == NULL) {
- bltMallocPtr = (mallocProc != NULL) ? mallocProc : defMallocProc;
- }
- if (bltFreePtr == NULL) {
- bltFreePtr = (freeProc != NULL) ? freeProc : defFreeProc;
- }
- if (bltReallocPtr == NULL) {
- bltReallocPtr = (reallocProc != NULL) ? reallocProc : defReallocProc;
- }
-}
-
diff --git a/blt3.0.1/src/bltAlloc.h b/blt3.0.1/src/bltAlloc.h
deleted file mode 100644
index 2aec31a..0000000
--- a/blt3.0.1/src/bltAlloc.h
+++ /dev/null
@@ -1,40 +0,0 @@
-
-/*
- * Memory allocation/deallocation in BLT is performed via the
- * global variables bltMallocPtr, bltFreePtr, and bltReallocPtr.
- * By default, they point to the same routines that TCL uses.
- * The routine Blt_AllocInit allows you to specify your own
- * memory allocation/deallocation routines for BLT on a
- * library-wide basis.
- */
-
-#ifndef _BLT_ALLOC_H
-#define _BLT_ALLOC_H
-
-#include <assert.h>
-
-typedef void *(Blt_MallocProc) (size_t size);
-typedef void *(Blt_ReallocProc) (void *ptr, size_t size);
-typedef void (Blt_FreeProc) (const void *ptr);
-
-BLT_EXTERN void Blt_AllocInit(Blt_MallocProc *mallocProc,
- Blt_ReallocProc *reallocProc, Blt_FreeProc *freeProc);
-
-BLT_EXTERN void *Blt_Malloc(size_t size);
-BLT_EXTERN void *Blt_Realloc(void *ptr, size_t size);
-BLT_EXTERN void Blt_Free(const void *ptr);
-BLT_EXTERN void *Blt_Calloc(size_t nElem, size_t size);
-BLT_EXTERN char *Blt_Strdup(const char *string);
-
-BLT_EXTERN void *Blt_MallocAbortOnError(size_t size, const char *file,int line);
-
-BLT_EXTERN void *Blt_CallocAbortOnError(size_t nElem, size_t size,
- const char *file, int line);
-BLT_EXTERN char *Blt_StrdupAbortOnError(const char *ptr, const char *file,
- int line);
-
-#define Blt_AssertCalloc(n,s) (Blt_CallocAbortOnError(n,s,__FILE__, __LINE__))
-#define Blt_AssertMalloc(s) (Blt_MallocAbortOnError(s,__FILE__, __LINE__))
-#define Blt_AssertStrdup(s) (Blt_StrdupAbortOnError(s,__FILE__, __LINE__))
-
-#endif /* _BLT_ALLOC_H */
diff --git a/blt3.0.1/src/bltArrayObj.c b/blt3.0.1/src/bltArrayObj.c
deleted file mode 100644
index 0e85790..0000000
--- a/blt3.0.1/src/bltArrayObj.c
+++ /dev/null
@@ -1,232 +0,0 @@
-
-/*
- * bltArrayObj.c --
- *
- * This file implements an array-based Tcl_Obj.
- *
- * Copyright (c) 2000 George A. Howlett
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltArrayObj.h"
-#include "bltHash.h"
-
-static Tcl_DupInternalRepProc DupArrayInternalRep;
-static Tcl_FreeInternalRepProc FreeArrayInternalRep;
-static Tcl_UpdateStringProc UpdateStringOfArray;
-static Tcl_SetFromAnyProc SetArrayFromAny;
-
-static Tcl_ObjType arrayObjType = {
- (char *)"array",
- FreeArrayInternalRep, /* Called when an object is freed. */
- DupArrayInternalRep, /* Copies an internal representation from one
- * object to another. */
- UpdateStringOfArray, /* Creates string representation from an
- * object's internal representation. */
- SetArrayFromAny, /* Creates valid internal representation from
- * an object's string representation. */
-};
-
-static int
-SetArrayFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr)
-{
- Blt_HashTable *tablePtr;
- Tcl_ObjType *oldTypePtr = objPtr->typePtr;
- const char **argv, *string;
- int argc, i;
-
- if (objPtr->typePtr == &arrayObjType) {
- return TCL_OK;
- }
- /* Get the string representation. Make it up-to-date if necessary. */
- string = Tcl_GetString(objPtr);
- if (Tcl_SplitList(interp, string, &argc, &argv) != TCL_OK) {
- return TCL_ERROR;
- }
- tablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(tablePtr, BLT_STRING_KEYS);
- for (i = 0; i < argc; i += 2) {
- Blt_HashEntry *hPtr;
- Tcl_Obj *elemObjPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(tablePtr, argv[i], &isNew);
- elemObjPtr = Tcl_NewStringObj(argv[i + 1], -1);
- Blt_SetHashValue(hPtr, elemObjPtr);
-
- /* Make sure we increment the reference count */
- Tcl_IncrRefCount(elemObjPtr);
- }
-
- if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) {
- oldTypePtr->freeIntRepProc(objPtr);
- }
- objPtr->internalRep.otherValuePtr = (VOID *)tablePtr;
- objPtr->typePtr = &arrayObjType;
- Blt_Free(argv);
- return TCL_OK;
-}
-
-static void
-DupArrayInternalRep(
- Tcl_Obj *srcPtr, /* Object with internal rep to copy. */
- Tcl_Obj *destPtr) /* Object with internal rep to set. */
-{
- Blt_HashEntry *hp;
- Blt_HashSearch iter;
- Blt_HashTable *srcTablePtr, *destTablePtr;
-
- srcTablePtr = (Blt_HashTable *)srcPtr->internalRep.otherValuePtr;
- destTablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(destTablePtr, BLT_STRING_KEYS);
- for (hp = Blt_FirstHashEntry(srcTablePtr, &iter); hp != NULL;
- hp = Blt_NextHashEntry(&iter)) {
- Tcl_Obj *valueObjPtr;
- const char *key;
- int isNew;
-
- key = Blt_GetHashKey(srcTablePtr, hp);
- Blt_CreateHashEntry(destTablePtr, key, &isNew);
- valueObjPtr = Blt_GetHashValue(hp);
- Blt_SetHashValue(hp, valueObjPtr);
-
- /* Make sure we increment the reference count now that both array
- * objects are using the same elements. */
- Tcl_IncrRefCount(valueObjPtr);
- }
- Tcl_InvalidateStringRep(destPtr);
- destPtr->internalRep.otherValuePtr = (VOID *)destTablePtr;
- destPtr->typePtr = &arrayObjType;
-}
-
-static void
-UpdateStringOfArray(Tcl_Obj *objPtr) /* Array object w/ string rep to update. */
-{
- Tcl_DString dString;
- Blt_HashTable *tablePtr;
- Blt_HashEntry *hp;
- Blt_HashSearch iter;
-
- tablePtr = (Blt_HashTable *)objPtr->internalRep.otherValuePtr;
- Tcl_DStringInit(&dString);
- for (hp = Blt_FirstHashEntry(tablePtr, &iter); hp != NULL;
- hp = Blt_NextHashEntry(&iter)) {
- Tcl_Obj *elemObjPtr;
-
- elemObjPtr = Blt_GetHashValue(hp);
- Tcl_DStringAppendElement(&dString, Blt_GetHashKey(tablePtr, hp));
- Tcl_DStringAppendElement(&dString, Tcl_GetString(elemObjPtr));
- }
- objPtr->bytes = Blt_AssertStrdup(Tcl_DStringValue(&dString));
- objPtr->length = strlen(Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
-}
-
-static void
-FreeArrayInternalRep(Tcl_Obj *objPtr) /* Array object to release. */
-{
- Blt_HashEntry *hp;
- Blt_HashSearch iter;
- Blt_HashTable *tablePtr;
-
- Tcl_InvalidateStringRep(objPtr);
- tablePtr = (Blt_HashTable *)objPtr->internalRep.otherValuePtr;
- for (hp = Blt_FirstHashEntry(tablePtr, &iter); hp != NULL;
- hp = Blt_NextHashEntry(&iter)) {
- Tcl_Obj *elemObjPtr;
-
- elemObjPtr = Blt_GetHashValue(hp);
- Tcl_DecrRefCount(elemObjPtr);
- }
- Blt_DeleteHashTable(tablePtr);
- Blt_Free(tablePtr);
-}
-
-int
-Blt_GetArrayFromObj(
- Tcl_Interp *interp,
- Tcl_Obj *objPtr,
- Blt_HashTable **tablePtrPtr)
-{
- if (objPtr->typePtr == &arrayObjType) {
- *tablePtrPtr = (Blt_HashTable *)objPtr->internalRep.otherValuePtr;
- return TCL_OK;
- }
- if (SetArrayFromAny(interp, objPtr) == TCL_OK) {
- *tablePtrPtr = (Blt_HashTable *)objPtr->internalRep.otherValuePtr;
- return TCL_OK;
- }
- return TCL_ERROR;
-}
-
-Tcl_Obj *
-Blt_NewArrayObj(int objc, Tcl_Obj **objv)
-{
- Blt_HashTable *tablePtr;
- Tcl_Obj *arrayObjPtr;
- int i;
-
- tablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(tablePtr, BLT_STRING_KEYS);
-
- for (i = 0; i < objc; i += 2) {
- Blt_HashEntry *hp;
- Tcl_Obj *objPtr;
- int isNew;
-
- hp = Blt_CreateHashEntry(tablePtr, Tcl_GetString(objv[i]), &isNew);
- objPtr = ((i + 1) == objc) ? Tcl_NewStringObj("", -1) : objv[i+1];
- Tcl_IncrRefCount(objPtr);
- if (!isNew) {
- Tcl_Obj *oldObjPtr;
-
- oldObjPtr = Blt_GetHashValue(hp);
- Tcl_DecrRefCount(oldObjPtr);
- }
- Blt_SetHashValue(hp, objPtr);
- }
- arrayObjPtr = Tcl_NewObj();
- /*
- * Reference counts for entry objects are initialized to 0. They are
- * incremented as they are inserted into the tree via the Blt_Tree_SetValue
- * call.
- */
- arrayObjPtr->refCount = 0;
- arrayObjPtr->internalRep.otherValuePtr = (VOID *)tablePtr;
- arrayObjPtr->bytes = NULL;
- arrayObjPtr->length = 0;
- arrayObjPtr->typePtr = &arrayObjType;
- return arrayObjPtr;
-}
-
-int
-Blt_IsArrayObj(Tcl_Obj *objPtr)
-{
- return (objPtr->typePtr == &arrayObjType);
-}
-
-/*ARGSUSED*/
-void
-Blt_RegisterArrayObj(void)
-{
- Tcl_RegisterObjType(&arrayObjType);
-}
diff --git a/blt3.0.1/src/bltArrayObj.h b/blt3.0.1/src/bltArrayObj.h
deleted file mode 100644
index 7490fd8..0000000
--- a/blt3.0.1/src/bltArrayObj.h
+++ /dev/null
@@ -1,43 +0,0 @@
-
-/*
- * bltArrayObj.h --
- *
- * This file implements an array-based Tcl_Obj.
- *
- * Copyright (c) 2000 George A. Howlett
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_ARRAY_OBJ_H
-#define _BLT_ARRAY_OBJ_H
-
-#include "bltHash.h"
-
-BLT_EXTERN int Blt_GetArrayFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- Blt_HashTable **tablePtrPtr);
-BLT_EXTERN Tcl_Obj *Blt_NewArrayObj(int objc, Tcl_Obj *objv[]);
-BLT_EXTERN void Blt_RegisterArrayObj(void);
-BLT_EXTERN int Blt_IsArrayObj(Tcl_Obj *obj);
-
-#endif /* _BLT_ARRAY_OBJ_H */
diff --git a/blt3.0.1/src/bltAssert.h b/blt3.0.1/src/bltAssert.h
deleted file mode 100644
index aea6feb..0000000
--- a/blt3.0.1/src/bltAssert.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef _BLT_ASSERT_H
-#define _BLT_ASSERT_H
-
-/*
- * Since the Tcl/Tk distribution doesn't perform any asserts, dynamic
- * loading can fail to find the __assert function. As a workaround,
- * we'll include our own.
- */
-#undef assert
-
-#ifdef NDEBUG
-# define assert(EX) ((void)0)
-#else
-
-BLT_EXTERN void Blt_Assert(const char *expr, const char *file, int line);
-
-#ifdef __STDC__
-# define assert(EX) (void)((EX) || (Blt_Assert(#EX, __FILE__, __LINE__), 0))
-#else
-# define assert(EX) (void)((EX) || (Blt_Assert("EX", __FILE__, __LINE__), 0))
-#endif /* __STDC__ */
-
-#endif /* NDEBUG */
-
-#endif /* _BLT_ASSERT_H */
diff --git a/blt3.0.1/src/bltBase64.c b/blt3.0.1/src/bltBase64.c
deleted file mode 100644
index d4eb408..0000000
--- a/blt3.0.1/src/bltBase64.c
+++ /dev/null
@@ -1,350 +0,0 @@
-
-/*
- * bltBase64.c --
- *
- * This module implements base64 processing procedures for the BLT toolkit.
- *
- * Copyright 1991-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltDBuffer.h"
-
-/*
- * Table for encoding base64.
- */
-static char encode64[64] = {
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
-};
-
-/*
- * Table for decoding base64.
- *
- * Note that NUL and '=' also return 0. This is so we can blindly decode 4
- * octets without requiring special handing of left-over bytes (i.e. when the
- * encoded buffer did not end on a 3-byte boundary).
- */
-#define NA 127
-
-static char decode64[256] = {
- 0 /* '\0' */,
- NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
- NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
- NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
- 62 /* + */,
- NA, NA, NA,
- 63 /* / */,
- 52 /* 0 */, 53 /* 1 */, 54 /* 2 */, 55 /* 3 */, 56 /* 4 */,
- 57 /* 5 */, 58 /* 6 */, 59 /* 7 */, 60 /* 8 */, 61 /* 9 */,
- NA, NA, NA,
- 0 /* = */,
- NA, NA, NA,
- 0 /* A */, 1 /* B */, 2 /* C */, 3 /* D */, 4 /* E */,
- 5 /* F */, 6 /* G */, 7 /* H */, 8 /* I */, 9 /* J */,
- 10 /* K */, 11 /* L */, 12 /* M */, 13 /* N */, 14 /* O */,
- 15 /* P */, 16 /* Q */, 17 /* R */, 18 /* S */, 19 /* T */,
- 20 /* U */, 21 /* V */, 22 /* W */, 23 /* X */, 24 /* Y */,
- 25 /* Z */,
- NA, NA, NA, NA, NA, NA,
- 26 /* a */, 27 /* b */, 28 /* c */, 29 /* d */, 30 /* e */,
- 31 /* f */, 32 /* g */, 33 /* h */, 34 /* i */, 35 /* j */,
- 36 /* k */, 37 /* l */, 38 /* m */, 39 /* n */, 40 /* o */,
- 41 /* p */, 42 /* q */, 43 /* r */, 44 /* s */, 45 /* t */,
- 46 /* u */, 47 /* v */, 48 /* w */, 49 /* x */, 50 /* y */,
- 51 /* z */,
- NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
- NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
- NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
- NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
- NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
- NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
- NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
- NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
- NA, NA, NA, NA, NA
-};
-
-int
-Blt_IsBase64(const unsigned char *bytes, size_t nBytes)
-{
- const unsigned char *bp, *bend;
-
- for (bp = bytes, bend = bp + nBytes; bp < bend; bp++) {
- unsigned int byte;
-
- byte = *bp;
- if ((decode64[byte] == NA) && (!isspace(byte))) {
- return FALSE;
- }
- }
- return TRUE;
-}
-
-static INLINE unsigned char
-NextChar(const unsigned char **bp, const unsigned char *lastPtr)
-{
- char c;
-
- /* Skip whitespace and invalid characters. Let's see if being fault-tolerant
- * is better than erroring out here.*/
- while (((*bp) < lastPtr) && (decode64[(**bp)] == NA)) {
- (*bp)++;
- }
- c = ((*bp) < lastPtr) ? **bp : 0;
- if ((c != '\0') && (c != '=')) {
- (*bp)++;
- }
- return c; /* Valid symbol */
-}
-
-unsigned char *
-Blt_Base64_Decode(Tcl_Interp *interp, const char *string, size_t *lengthPtr)
-{
- size_t nBytes;
- unsigned char *bp;
- unsigned char *buffer;
- const unsigned char *p, *pend;
- nBytes = *lengthPtr;
-
- /*
- * Assuming that the string contains no padding or whitespace, allocate a
- * buffer with a worst-case length.
- */
- nBytes = ((nBytes + 1) * 3) / 4;
- buffer = Blt_Malloc(nBytes);
- if (buffer == NULL) {
- Tcl_AppendResult(interp, "can't allocate ", Blt_Itoa(nBytes),
- " for buffer", (char *)NULL);
- return NULL;
- }
- bp = buffer;
- for (p = (unsigned char *)string, pend = p + *lengthPtr; p < pend;
- /*empty*/) {
- unsigned char a, b, c, d;
- unsigned int u1, u2, u3;
-
- a = NextChar(&p, pend);
- b = NextChar(&p, pend);
- c = NextChar(&p, pend);
- d = NextChar(&p, pend);
-
- if (d == '\0') {
- if (a != '\0') {
- Tcl_AppendResult(interp, "premature end of base64 data",
- (char *)NULL);
- Blt_Free(buffer);
- return NULL;
- }
- break;
- }
-
- /*
- * in: a b c d
- * ------.......-------......
- * |54321054|32105432|10543210|
- * out: u1 u2 u3
- */
-
- /* a = [543210xx] | [xxxxxx54] >> 4 */
- u1 = (decode64[a] << 2) | ((decode64[b] & 0x30) >> 4);
- /* b = [3210xxxx] | [xxxx5432] */
- u2 = ((decode64[b] & 0x0F) << 4) |((decode64[c] & 0x3C) >> 2);
- /* c = [10xxxxxx] | [xx543210] */
- u3 = ((decode64[c] & 0x03) << 6) | decode64[d];
-
- if (d == '=') {
- if ((a == '=') || (b == '=')) {
- break; /* This should not be possible. */
- }
- if (c == '=') {
- *bp++ = (unsigned char)u1;
- } else {
- *bp++ = (unsigned char)u1;
- *bp++ = (unsigned char)u2;
- }
- break;
- }
- bp[0] = (unsigned char)u1;
- bp[1] = (unsigned char)u2;
- bp[2] = (unsigned char)u3;
- bp += 3;
- }
- nBytes = bp - buffer;
- /* Reset the fill point to the number of bytes processed. */
- *lengthPtr = nBytes;
- return buffer;
-}
-
-char *
-Blt_Base64_Encode(Tcl_Interp *interp, const unsigned char *buffer,
- size_t bufsize)
-{
- char *dest, *dp;
- int count, remainder;
- size_t length;
- const unsigned char *sp, *send;
-
- /* Compute worst-case length. */
- length = (((bufsize + 1) * 4) + 2) / 3;
- length += (length + 59) / 60; /* Add space for newlines. */
- length++; /* NUL byte */
-
- dest = Blt_Malloc(sizeof(char) * length);
- if (dest == NULL) {
- Tcl_AppendResult(interp, "can't allocate \"", Blt_Itoa(length),
- "\" bytes for buffer", (char *)NULL);
- return NULL;
- }
- count = 0;
- remainder = bufsize % 3;
- send = buffer + (bufsize - remainder);
- dp = dest;
- for (sp = buffer; sp < send; sp += 3) {
- int a, b, c, d;
-
- /*
- * in: 0 1 2
- * |76543210|76543210|76543210|
- * ------.......-------......
- * out: a b c d
- */
- /* a = [xx765432] */
- a = sp[0] >> 2;
- /* b = [xx10xxxx] | [xxxx7654] */
- b = ((sp[0] & 0x03) << 4) | ((sp[1] & 0xF0) >> 4);
- /* c = [xx3210xx] | [xxxxxx76] */
- c = ((sp[1] & 0x0F) << 2) | ((sp[2] & 0xC0) >> 6);
- /* d = [xx543210] */
- d = (sp[2] & 0x3F);
-
- dp[0] = encode64[a];
- dp[1] = encode64[b];
- dp[2] = encode64[c];
- dp[3] = encode64[d];
-
- dp += 4;
- count += 4;
- if (count > 60) {
- *dp++ = '\n';
- count = 0;
- }
- }
-
- if (remainder > 0) {
- int a, b, c;
-
- /*
- * Handle the two cases where the input buffer doesn't end on a 3-byte
- * boundary.
- */
- if (remainder == 2) {
- a = sp[0] >> 2;
- b = ((sp[0] & 0x03) << 4) | ((sp[1] & 0xF0) >> 4);
- c = ((sp[1] & 0x0F) << 2);
- dp[0] = encode64[a];
- dp[1] = encode64[b];
- dp[2] = encode64[c];
- dp[3] = '=';
- } else if (remainder == 1) {
- a = sp[0] >> 2;
- b = ((sp[0] & 0x03) << 4);
- dp[0] = encode64[a];
- dp[1] = encode64[b];
- dp[2] = dp[3] = '=';
- }
- dp += 4;
- count += 4;
- if (count > 60) {
- *dp++ = '\n';
- }
- }
- assert((size_t)(dp - dest) < length);
- *dp = '\0';
- return dest;
-}
-
-/*ARGSUSED*/
-static int
-Base64Cmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int option;
- static const char *args[] = {
- "decode", "encode", NULL,
- };
-
- if (objc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), "encode|decode bytes\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (Tcl_GetIndexFromObj(interp, objv[1], args, "qualifier", TCL_EXACT,
- &option) != TCL_OK) {
- return TCL_ERROR;
- }
- switch (option) {
- case 0: /* decode */
- {
- int length;
- size_t nBytes; /* # bytes in decoded string. */
- unsigned char *bp;
- const char *in;
-
- in = Tcl_GetStringFromObj(objv[2], &length);
- nBytes = (size_t)length;
- bp = Blt_Base64_Decode(interp, in, &nBytes);
- if (bp == NULL) {
- return TCL_ERROR;
- }
- Tcl_SetByteArrayObj(Tcl_GetObjResult(interp), bp, nBytes);
- }
- break;
- case 1: /* encode */
- {
- int length;
- unsigned char *bp;
- const char *out;
-
- bp = Tcl_GetByteArrayFromObj(objv[2], &length);
- out = Blt_Base64_Encode(interp, bp, length);
- if (out == NULL) {
- return TCL_ERROR;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), out, -1);
- }
- break;
- default:
- Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]),
- "\": should be encode or decode", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-
-int
-Blt_Base64CmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "base64", Base64Cmd, };
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
diff --git a/blt3.0.1/src/bltBeep.c b/blt3.0.1/src/bltBeep.c
deleted file mode 100644
index 432706f..0000000
--- a/blt3.0.1/src/bltBeep.c
+++ /dev/null
@@ -1,90 +0,0 @@
-
-/*
- * bltBeep.c --
- *
- * Copyright 1993-2003 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_BEEP
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_BeepCmd --
- *
- * This procedure is invoked to process the "beep" command.
- * See the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static Tcl_ObjCmdProc BeepCmd;
-
-/* ARGSUSED */
-static int
-BeepCmd(
- ClientData clientData, /* Main window associated with interpreter.*/
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- int percent;
-
- if (objc > 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ?volumePercent?\"", (char *)NULL);
- return TCL_ERROR;
- }
- percent = 50; /* Default setting */
- if (objc == 2) {
- if (Tcl_GetIntFromObj(interp, objv[1], &percent) != TCL_OK) {
- return TCL_ERROR;
- }
- if (percent < -100) {
- percent = -100;
- } else if (percent > 100) {
- percent = 100;
- }
- }
- XBell(Tk_Display(Tk_MainWindow(interp)), percent);
- return TCL_OK;
-}
-
-int
-Blt_BeepCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "beep", BeepCmd, };
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-#endif /* NO_BEEP */
diff --git a/blt3.0.1/src/bltBgStyle.c b/blt3.0.1/src/bltBgStyle.c
deleted file mode 100644
index 36b9f0a..0000000
--- a/blt3.0.1/src/bltBgStyle.c
+++ /dev/null
@@ -1,3324 +0,0 @@
-
-/*
- * bltBgPattern.c --
- *
- * This module creates background patterns for the BLT toolkit.
- *
- * Copyright 1995-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include "bltChain.h"
-#include "bltHash.h"
-#include "bltImage.h"
-#include "bltPicture.h"
-#include "bltPainter.h"
-#include <X11/Xutil.h>
-#include "bltBgStyle.h"
-
-#define BG_PATTERN_THREAD_KEY "BLT Background Pattern Data"
-#define TEXTURE_CHECKERED 1
-#define TEXTURE_STRIPED 0
-
-/*
- bgpattern create pattern
- -image $image
- -color $color
- -darkcolor $color
- -lightcolor $color
- -resamplefilter $filter
- -opacity $alpha
- -xorigin $x
- -yorigin $y
- -tile yes
- -center yes
- -scale no
- -relativeto self|toplevel|window
- -mask image|bitmap
-
- bgpattern create tile
- -relativeto self|toplevel|window
- -image $image
- -bg $color
- bgpattern create picture
- -image $image
- -filter $filterName
- -bg $color
- bgpattern create gradient
- -type radial|xlinear|ylinear|diagonal
- -low $color
- -high $color
- -bg $color
- bgpattern create border
- -bg $color
- -alpha $color
-
- bgpattern create texture -type metal|wind|???
- -bg $color
-
- bgpattern names
- bgpattern configure $tile
- bgpattern delete $tile
-*/
-
-
-enum PatternTypes {
- PATTERN_GRADIENT, /* Color gradient. */
- PATTERN_TILE, /* Tiled or resizable color picture. */
- PATTERN_SOLID, /* General pattern. */
- PATTERN_TEXTURE, /* Procedural texture. */
-};
-
-
-static const char *patternTypes[] = {
- "gradient",
- "tile",
- "solid",
- "texture"
-};
-
-enum ReferenceTypes {
- REFERENCE_SELF, /* Current window. */
- REFERENCE_TOPLEVEL, /* Toplevel of current window. */
- REFERENCE_WINDOW, /* Specifically named window. */
- REFERENCE_NONE, /* Don't use reference
- * window. Background region will be
- * defined by user. */
-};
-
-typedef struct {
- int x, y;
- unsigned int w, h;
- Tk_Window tkwin;
-} Reference;
-
-typedef struct {
- int x, y, width, height;
-} BgRegion;
-
-typedef struct {
- Blt_HashTable patternTable; /* Hash table of pattern structures
- * keyed by the name of the image. */
- Tcl_Interp *interp; /* Interpreter associated with this set
- * of background patterns. */
- int nextId; /* Serial number of the identifier to be
- * used for next background pattern
- * created. */
-} BackgroundInterpData;
-
-typedef struct _Pattern Pattern;
-
-typedef void (DestroyPatternProc)(Pattern *patternPtr);
-typedef int (ConfigurePatternProc)(Tcl_Interp *interp, Pattern *patternPtr,
- int objc, Tcl_Obj *const *objv, unsigned int flags);
-typedef void (DrawRectangleProc)(Tk_Window tkwin, Drawable drawable,
- Pattern *patternPtr, int x, int y, int w, int h);
-typedef void (DrawPolygonProc)(Tk_Window tkwin, Drawable drawable,
- Pattern *patternPtr, int nPoints, XPoint *points);
-
-typedef struct {
- enum PatternTypes type; /* Type of pattern style: solid, tile,
- * texture, or gradient. */
- Blt_ConfigSpec *configSpecs;
- DestroyPatternProc *destroyProc;
- ConfigurePatternProc *configProc;
- DrawRectangleProc *drawRectangleProc;
- DrawPolygonProc *drawPolygonProc;
-} PatternClass;
-
-
-struct _Pattern {
- const char *name; /* Generated name of background
- * pattern. */
- PatternClass *classPtr;
- BackgroundInterpData *dataPtr;
- Tk_Window tkwin; /* Main window. Used to query background
- * pattern options. */
- Display *display; /* Display of this background
- * pattern. */
- unsigned int flags; /* See definitions below. */
- Blt_HashEntry *hashPtr; /* Hash entry in pattern table. */
- Blt_Chain chain; /* List of pattern tokens. Used to
- * register callbacks for each client of
- * the background pattern. */
- Blt_ChainLink link; /* Background token that is associated
- * with the pattern creation "bgpattern
- * create...". */
- Tk_3DBorder border; /* 3D Border. May be used for all
- * background types. */
- Tk_Window refWindow; /* Refer to coordinates in this window
- * when determining the tile/gradient
- * origin. */
- BgRegion refRegion;
- Blt_HashTable pictTable; /* Table of pictures cached for each
- * pattern reference. */
- int reference; /* "self", "toplevel", or "window". */
- int xOrigin, yOrigin;
-};
-
-typedef struct {
- const char *name; /* Generated name of background
- * pattern. */
- PatternClass *classPtr;
- BackgroundInterpData *dataPtr;
- Tk_Window tkwin; /* Main window. Used to query background
- * pattern options. */
- Display *display; /* Display of this background
- * pattern. */
- unsigned int flags; /* See definitions below. */
- Blt_HashEntry *hashPtr; /* Link to original client. */
- Blt_Chain chain; /* List of pattern tokens. Used to
- * register callbacks for each client of
- * the background pattern. */
- Blt_ChainLink link; /* Background token that is associated
- * with the pattern creation "bgpattern
- * create...". */
- Tk_3DBorder border; /* 3D Border. May be used for all
- * pattern types. */
- Tk_Window refWindow; /* Refer to coordinates in this window
- * when determining the tile/gradient
- * origin. */
- BgRegion refRegion;
- Blt_HashTable pictTable; /* Table of pictures cached for each
- * pattern reference. */
- int reference; /* "self", "toplevel", or "window". */
- int xOrigin, yOrigin;
-
- /* Solid pattern specific fields. */
- int alpha; /* Transparency value. */
-} SolidPattern;
-
-typedef struct {
- const char *name; /* Generated name of background
- * pattern. */
- PatternClass *classPtr;
- BackgroundInterpData *dataPtr;
- Tk_Window tkwin; /* Main window. Used to query background
- * pattern options. */
- Display *display; /* Display of this background
- * pattern. */
- unsigned int flags; /* See definitions below. */
- Blt_HashEntry *hashPtr; /* Link to original client. */
- Blt_Chain chain; /* List of pattern tokens. Used to
- * register callbacks for each client of
- * the background pattern. */
- Blt_ChainLink link; /* Background token that is associated
- * with the pattern creation "bgpattern
- * create...". */
- Tk_3DBorder border; /* 3D Border. May be used for all
- * pattern types. */
- Tk_Window refWindow; /* Refer to coordinates in this window
- * when determining the tile/gradient
- * origin. */
- BgRegion refRegion;
- Blt_HashTable pictTable; /* Table of pictures cached for each
- * pattern reference. */
- int reference; /* "self", "toplevel", or "window". */
- int xOrigin, yOrigin;
- /* Image pattern specific fields. */
- Tk_Image tkImage; /* Original image (before
- * resampling). */
- Blt_ResampleFilter filter; /* 1-D image filter to use to when
- * resizing the original picture. */
-} TilePattern;
-
-typedef struct {
- const char *name; /* Generated name of background
- * pattern. */
- PatternClass *classPtr;
- BackgroundInterpData *dataPtr;
- Tk_Window tkwin; /* Main window. Used to query background
- * pattern options. */
- Display *display; /* Display of this background
- * pattern. */
- unsigned int flags; /* See definitions below. */
- Blt_HashEntry *hashPtr; /* Link to original client. */
- Blt_Chain chain; /* List of pattern tokens. Used to
- * register callbacks for each client of
- * the background pattern. */
- Blt_ChainLink link; /* Background token that is associated
- * with the pattern creation "bgpattern
- * create...". */
- Tk_3DBorder border; /* 3D Border. May be used for all
- * pattern types. */
- Tk_Window refWindow; /* Refer to coordinates in this window
- * when determining the tile/gradient
- * origin. */
- BgRegion refRegion;
- Blt_HashTable pictTable; /* Table of pictures cached for each
- * pattern reference. */
- int reference; /* "self", "toplevel", or "window". */
- int xOrigin, yOrigin;
- /* Gradient pattern specific fields. */
- Blt_Gradient gradient;
- Blt_Pixel low, high; /* Texture or gradient colors. */
- int alpha; /* Transparency value. */
-} GradientPattern;
-
-typedef struct {
- const char *name; /* Generated name of background
- * pattern. */
- PatternClass *classPtr;
- BackgroundInterpData *dataPtr;
- Tk_Window tkwin; /* Main window. Used to query background
- * pattern options. */
- Display *display; /* Display of this background
- * pattern. */
- unsigned int flags; /* See definitions below. */
- Blt_HashEntry *hashPtr; /* Link to original client. */
- Blt_Chain chain; /* List of pattern tokens. Used to
- * register callbacks for each client of
- * the background pattern. */
- Blt_ChainLink link; /* Background token that is associated
- * with the pattern creation "bgpattern
- * create...". */
- Tk_3DBorder border; /* 3D Border. May be used for all
- * pattern types. */
- Tk_Window refWindow; /* Refer to coordinates in this window
- * when determining the tile/gradient
- * origin. */
- BgRegion refRegion;
- Blt_HashTable pictTable; /* Table of pictures cached for each
- * pattern reference. */
- int reference; /* "self", "toplevel", or "window". */
- int xOrigin, yOrigin;
-
- /* Texture pattern specific fields. */
- Blt_Pixel low, high; /* Texture colors. */
- int alpha; /* Transparency value. */
- int type;
-} TexturePattern;
-
-struct _Blt_Background {
- Pattern *corePtr; /* Pointer to master background pattern
- * object. */
- Blt_BackgroundChangedProc *notifyProc;
- ClientData clientData; /* Data to be passed on notifier
- * callbacks. */
- Blt_ChainLink link; /* Entry in notifier list. */
-};
-
-#define DELETE_PENDING (1<<0)
-#define BG_CENTER (1<<2)
-#define BG_SCALE (1<<3)
-
-typedef struct _Blt_Background Background;
-
-#define DEF_OPACITY "100.0"
-#define DEF_ORIGIN_X "0"
-#define DEF_ORIGIN_Y "0"
-#define DEF_BORDER STD_NORMAL_BACKGROUND
-#define DEF_GRADIENT_PATH "y"
-#define DEF_GRADIENT_HIGH "grey90"
-#define DEF_GRADIENT_JITTER "no"
-#define DEF_GRADIENT_LOGSCALE "yes"
-#define DEF_GRADIENT_LOW "grey50"
-#define DEF_GRADIENT_MODE "xlinear"
-#define DEF_GRADIENT_SHAPE "linear"
-#define DEF_REFERENCE "toplevel"
-#define DEF_RESAMPLE_FILTER "box"
-#define DEF_SCALE "no"
-#define DEF_CENTER "no"
-#define DEF_TILE "no"
-
-static Blt_OptionParseProc ObjToImageProc;
-static Blt_OptionPrintProc ImageToObjProc;
-static Blt_OptionFreeProc FreeImageProc;
-static Blt_CustomOption imageOption =
-{
- ObjToImageProc, ImageToObjProc, FreeImageProc, (ClientData)0
-};
-
-extern Blt_CustomOption bltFilterOption;
-
-static Blt_OptionParseProc ObjToReferenceProc;
-static Blt_OptionPrintProc ReferenceToObjProc;
-static Blt_CustomOption referenceToOption =
-{
- ObjToReferenceProc, ReferenceToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToShapeProc;
-static Blt_OptionPrintProc ShapeToObjProc;
-static Blt_CustomOption shapeOption =
-{
- ObjToShapeProc, ShapeToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToPathProc;
-static Blt_OptionPrintProc PathToObjProc;
-static Blt_CustomOption pathOption =
-{
- ObjToPathProc, PathToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToOpacityProc;
-static Blt_OptionPrintProc OpacityToObjProc;
-static Blt_CustomOption opacityOption =
-{
- ObjToOpacityProc, OpacityToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToTypeProc;
-static Blt_OptionPrintProc TypeToObjProc;
-static Blt_CustomOption typeOption =
-{
- ObjToTypeProc, TypeToObjProc, NULL, (ClientData)0
-};
-
-static Blt_ConfigSpec solidConfigSpecs[] =
-{
- {BLT_CONFIG_SYNONYM, "-background", "color", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_SYNONYM, "-bg", "color", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_BORDER, "-color", "color", "Color", DEF_BORDER,
- Blt_Offset(SolidPattern, border), 0},
- {BLT_CONFIG_CUSTOM, "-opacity", "opacity", "Opacity", "100.0",
- Blt_Offset(SolidPattern, alpha), BLT_CONFIG_DONT_SET_DEFAULT,
- &opacityOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static Blt_ConfigSpec tileConfigSpecs[] =
-{
- {BLT_CONFIG_BITMASK, "-center", "center", "Center", DEF_CENTER,
- Blt_Offset(TilePattern, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)BG_CENTER},
- {BLT_CONFIG_BORDER, "-color", "color", "Color", DEF_BORDER,
- Blt_Offset(TilePattern, border), 0},
- {BLT_CONFIG_BORDER, "-darkcolor", "darkColor", "DarkColor", DEF_BORDER,
- Blt_Offset(TilePattern, border), 0},
- {BLT_CONFIG_CUSTOM, "-filter", "filter", "Filter", DEF_RESAMPLE_FILTER,
- Blt_Offset(TilePattern, filter), 0, &bltFilterOption},
- {BLT_CONFIG_CUSTOM, "-image", "image", "Image", (char *)NULL,
- Blt_Offset(TilePattern, tkImage), BLT_CONFIG_DONT_SET_DEFAULT,
- &imageOption},
- {BLT_CONFIG_BORDER, "-lightcolor", "lightColor", "LightColor", DEF_BORDER,
- Blt_Offset(TilePattern, border), 0},
- {BLT_CONFIG_CUSTOM, "-relativeto", "relativeTo", "RelativeTo",
- DEF_REFERENCE, Blt_Offset(TilePattern, reference),
- BLT_CONFIG_DONT_SET_DEFAULT, &referenceToOption},
- {BLT_CONFIG_BITMASK, "-scale", "scale", "scale", DEF_SCALE,
- Blt_Offset(TilePattern, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)BG_SCALE},
- {BLT_CONFIG_PIXELS, "-xorigin", "xOrigin", "XOrigin", DEF_ORIGIN_X,
- Blt_Offset(TilePattern, xOrigin), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-yorigin", "yOrigin", "YOrigin", DEF_ORIGIN_Y,
- Blt_Offset(TilePattern, yOrigin), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static Blt_ConfigSpec gradientConfigSpecs[] =
-{
- {BLT_CONFIG_BORDER, "-background", "background", "Background", DEF_BORDER,
- Blt_Offset(GradientPattern, border), 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_CUSTOM, "-direction", "direction", "Direction",
- DEF_GRADIENT_PATH, Blt_Offset(GradientPattern, gradient.path),
- BLT_CONFIG_DONT_SET_DEFAULT, &pathOption},
- {BLT_CONFIG_PIX32, "-high", "high", "High", DEF_GRADIENT_HIGH,
- Blt_Offset(GradientPattern, high), 0},
- {BLT_CONFIG_BOOLEAN, "-jitter", "jitter", "Jitter",
- DEF_GRADIENT_JITTER, Blt_Offset(GradientPattern, gradient.jitter),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-logscale", "logscale", "Logscale",
- DEF_GRADIENT_LOGSCALE, Blt_Offset(GradientPattern,gradient.logScale),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIX32, "-low", "low", "Low", DEF_GRADIENT_LOW,
- Blt_Offset(GradientPattern, low), 0},
- {BLT_CONFIG_CUSTOM, "-opacity", "opacity", "Opacity", "100.0",
- Blt_Offset(GradientPattern, alpha), BLT_CONFIG_DONT_SET_DEFAULT,
- &opacityOption},
- {BLT_CONFIG_CUSTOM, "-relativeto", "relativeTo", "RelativeTo",
- DEF_REFERENCE, Blt_Offset(GradientPattern, reference),
- BLT_CONFIG_DONT_SET_DEFAULT, &referenceToOption},
- {BLT_CONFIG_CUSTOM, "-shape", "shape", "Shape", DEF_GRADIENT_SHAPE,
- Blt_Offset(GradientPattern, gradient.shape),
- BLT_CONFIG_DONT_SET_DEFAULT, &shapeOption},
- {BLT_CONFIG_PIXELS, "-xorigin", "xOrigin", "XOrigin", DEF_ORIGIN_X,
- Blt_Offset(GradientPattern, xOrigin), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-yorigin", "yOrigin", "YOrigin", DEF_ORIGIN_Y,
- Blt_Offset(GradientPattern, yOrigin), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static Blt_ConfigSpec textureConfigSpecs[] =
-{
- {BLT_CONFIG_BORDER, "-background", "background", "Background", DEF_BORDER,
- Blt_Offset(TexturePattern, border), 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIX32, "-high", "high", "High", DEF_GRADIENT_HIGH,
- Blt_Offset(TexturePattern, high), 0},
- {BLT_CONFIG_PIX32, "-low", "low", "Low", DEF_GRADIENT_LOW,
- Blt_Offset(TexturePattern, low), 0},
- {BLT_CONFIG_CUSTOM, "-relativeto", "relativeTo", "RelativeTo",
- DEF_REFERENCE, Blt_Offset(TexturePattern, reference),
- BLT_CONFIG_DONT_SET_DEFAULT, &referenceToOption},
- {BLT_CONFIG_CUSTOM, "-type", "type", "Type",
- DEF_REFERENCE, Blt_Offset(TexturePattern, type),
- BLT_CONFIG_DONT_SET_DEFAULT, &typeOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static void NotifyClients(Pattern *corePtr);
-
-static Blt_Picture
-ImageToPicture(TilePattern *patternPtr, int *isFreePtr)
-{
- Tcl_Interp *interp;
-
- interp = patternPtr->dataPtr->interp;
- return Blt_GetPictureFromImage(interp, patternPtr->tkImage, isFreePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImageChangedProc
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-ImageChangedProc(
- ClientData clientData,
- int x, int y, int width, int height, /* Not used. */
- int imageWidth, int imageHeight) /* Not used. */
-{
- Pattern *corePtr = clientData;
-
- /* Propagate the change in the image to all the clients. */
- NotifyClients(corePtr);
-}
-
-/*ARGSUSED*/
-static void
-FreeImageProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- TilePattern *patternPtr = (TilePattern *)(widgRec);
-
- if (patternPtr->tkImage != NULL) {
- Tk_FreeImage(patternPtr->tkImage);
- patternPtr->tkImage = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToImageProc --
- *
- * Given an image name, get the Tk image associated with it.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToImageProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags)
-{
- TilePattern *patternPtr = (TilePattern *)(widgRec);
- Tk_Image tkImage;
-
- tkImage = Tk_GetImage(interp, patternPtr->tkwin, Tcl_GetString(objPtr),
- ImageChangedProc, patternPtr);
- if (tkImage == NULL) {
- return TCL_ERROR;
- }
- patternPtr->tkImage = tkImage;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImageToObjProc --
- *
- * Convert the image name into a string Tcl_Obj.
- *
- * Results:
- * The string representation of the image is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ImageToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- TilePattern *patternPtr = (TilePattern *)(widgRec);
-
- if (patternPtr->tkImage == NULL) {
- return Tcl_NewStringObj("", -1);
- }
- return Tcl_NewStringObj(Blt_Image_Name(patternPtr->tkImage), -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToReference --
- *
- * Given a string name, get the resample filter associated with it.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToReferenceProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Pattern *patternPtr = (Pattern *)(widgRec);
- int *referencePtr = (int *)(widgRec + offset);
- const char *string;
- char c;
- int refType;
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 's') && (strncmp(string, "self", length) == 0)) {
- refType = REFERENCE_SELF;
- } else if ((c == 't') && (strncmp(string, "toplevel", length) == 0)) {
- refType = REFERENCE_TOPLEVEL;
- } else if ((c == 'n') && (strncmp(string, "none", length) == 0)) {
- refType = REFERENCE_NONE;
- } else if (c == '.') {
- Tk_Window tkwin, tkMain;
-
- tkMain = Tk_MainWindow(interp);
- tkwin = Tk_NameToWindow(interp, string, tkMain);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- refType = REFERENCE_WINDOW;
- patternPtr->refWindow = tkwin;
- } else {
- Tcl_AppendResult(interp, "unknown reference type \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- *referencePtr = refType;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReferenceToObjProc --
- *
- * Convert the picture filter into a string Tcl_Obj.
- *
- * Results:
- * The string representation of the filter is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ReferenceToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int reference = *(int *)(widgRec + offset);
- const char *string;
-
- switch (reference) {
- case REFERENCE_SELF:
- string = "self";
- break;
-
- case REFERENCE_TOPLEVEL:
- string = "toplevel";
- break;
-
- case REFERENCE_NONE:
- string = "none";
- break;
-
- case REFERENCE_WINDOW:
- {
- Pattern *patternPtr = (Pattern *)(widgRec);
-
- string = Tk_PathName(patternPtr->refWindow);
- }
- break;
-
- default:
- string = "???";
- break;
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToShapeProc --
- *
- * Translate the given string to the gradient shape is represents. Value
- * shapes are "linear", "bilinear", "radial", and "rectangular".
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToShapeProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_GradientShape *shapePtr = (Blt_GradientShape *)(widgRec + offset);
- char *string;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "linear") == 0) {
- *shapePtr = BLT_GRADIENT_SHAPE_LINEAR;
- } else if (strcmp(string, "bilinear") == 0) {
- *shapePtr = BLT_GRADIENT_SHAPE_BILINEAR;
- } else if (strcmp(string, "radial") == 0) {
- *shapePtr = BLT_GRADIENT_SHAPE_RADIAL;
- } else if (strcmp(string, "rectangular") == 0) {
- *shapePtr = BLT_GRADIENT_SHAPE_RECTANGULAR;
- } else {
- Tcl_AppendResult(interp, "unknown gradient type \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShapeToObjProc --
- *
- * Returns the string representing the current gradiant shape.
- *
- * Results:
- * The string representation of the shape is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ShapeToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_GradientShape shape = *(Blt_GradientShape *)(widgRec + offset);
- const char *string;
-
- switch (shape) {
- case BLT_GRADIENT_SHAPE_LINEAR:
- string = "linear";
- break;
-
- case BLT_GRADIENT_SHAPE_BILINEAR:
- string = "bilinear";
- break;
-
- case BLT_GRADIENT_SHAPE_RADIAL:
- string = "radial";
- break;
-
- case BLT_GRADIENT_SHAPE_RECTANGULAR:
- string = "rectangular";
- break;
-
- default:
- string = "???";
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToPathProc --
- *
- * Translates the given string to the gradient path it represents. Valid
- * paths are "x", "y", "xy", and "yx".
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToPathProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_GradientPath *pathPtr = (Blt_GradientPath *)(widgRec + offset);
- char *string;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "x") == 0) {
- *pathPtr = BLT_GRADIENT_PATH_X;
- } else if (strcmp(string, "y") == 0) {
- *pathPtr = BLT_GRADIENT_PATH_Y;
- } else if (strcmp(string, "xy") == 0) {
- *pathPtr = BLT_GRADIENT_PATH_XY;
- } else if (strcmp(string, "yx") == 0) {
- *pathPtr = BLT_GRADIENT_PATH_YX;
- } else {
- Tcl_AppendResult(interp, "unknown gradient path \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PathToObjProc --
- *
- * Convert the picture filter into a string Tcl_Obj.
- *
- * Results:
- * The string representation of the filter is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-PathToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_GradientPath path = *(Blt_GradientPath *)(widgRec + offset);
- const char *string;
-
- switch (path) {
- case BLT_GRADIENT_PATH_X:
- string = "x";
- break;
-
- case BLT_GRADIENT_PATH_Y:
- string = "y";
- break;
-
- case BLT_GRADIENT_PATH_XY:
- string = "xy";
- break;
-
- case BLT_GRADIENT_PATH_YX:
- string = "yx";
- break;
-
- default:
- string = "?? unknown path ??";
- break;
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToOpacity --
- *
- * Given a string name, get the resample filter associated with it.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToOpacityProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int *alphaPtr = (int *)(widgRec + offset);
- double opacity;
-
- if (Tcl_GetDoubleFromObj(interp, objPtr, &opacity) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((opacity < 0.0) || (opacity > 100.0)) {
- Tcl_AppendResult(interp, "invalid percent opacity \"",
- Tcl_GetString(objPtr), "\" should be 0 to 100", (char *)NULL);
- return TCL_ERROR;
- }
- opacity = (opacity / 100.0) * 255.0;
- *alphaPtr = ROUND(opacity);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OpacityToObj --
- *
- * Convert the picture filter into a string Tcl_Obj.
- *
- * Results:
- * The string representation of the filter is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-OpacityToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int *alphaPtr = (int *)(widgRec + offset);
- double opacity;
-
- opacity = (*alphaPtr / 255.0) * 100.0;
- return Tcl_NewDoubleObj(opacity);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToTypeProc --
- *
- * Translate the given string to the gradient shape is represents. Value
- * shapes are "linear", "bilinear", "radial", and "rectangular".
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTypeProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int *typePtr = (int *)(widgRec + offset);
- char *string;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "striped") == 0) {
- *typePtr = TEXTURE_STRIPED;
- } else if (strcmp(string, "checkered") == 0) {
- *typePtr = TEXTURE_CHECKERED;
- } else {
- Tcl_AppendResult(interp, "unknown pattern type \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TypeToObjProc --
- *
- * Returns the string representing the current pattern type.
- *
- * Results:
- * The string representation of the pattern is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TypeToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int type = *(int *)(widgRec + offset);
- const char *string;
-
- switch (type) {
- case TEXTURE_STRIPED:
- string = "striped";
- break;
-
- case TEXTURE_CHECKERED:
- string = "checkered";
- break;
-
- default:
- string = "???";
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyClients --
- *
- * Notify each client that the background pattern has changed.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-NotifyClients(Pattern *patternPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(patternPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Background *bgPtr;
-
- /* Notify each client that the background pattern has changed. The
- * client should schedule itself for redrawing. */
- bgPtr = Blt_Chain_GetValue(link);
- if (bgPtr->notifyProc != NULL) {
- (*bgPtr->notifyProc)(bgPtr->clientData);
- }
- }
-}
-
-static const char *
-NameOfPattern(Pattern *patternPtr)
-{
- return patternTypes[patternPtr->classPtr->type];
-}
-
-static int
-GetPatternTypeFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *typePtr)
-{
- const char *string;
- char c;
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 't') && (length > 1) && (strncmp(string, "tile", length) == 0)) {
- *typePtr = PATTERN_TILE;
- } else if ((c == 'g') && (strncmp(string, "gradient", length) == 0)) {
- *typePtr = PATTERN_GRADIENT;
- } else if ((c == 's') && (strncmp(string, "solid", length) == 0)) {
- *typePtr = PATTERN_SOLID;
- } else if ((c == 't') && (length > 1) &&
- (strncmp(string, "texture", length) == 0)) {
- *typePtr = PATTERN_TEXTURE;
- } else {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "unknown background pattern \"", string,
- "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static void
-ClearCache(Pattern *corePtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&corePtr->pictTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_Picture picture;
-
- picture = Blt_GetHashValue(hPtr);
- Blt_FreePicture(picture);
- }
-}
-
-static void
-GetTileOffsets(Tk_Window tkwin, Pattern *patternPtr, Blt_Picture picture,
- int x, int y, int *xOffsetPtr, int *yOffsetPtr)
-{
- int dx, dy;
- int x0, y0;
- int tw, th;
- Tk_Window refWindow;
-
- if (patternPtr->reference == REFERENCE_SELF) {
- refWindow = tkwin;
- } else if (patternPtr->reference == REFERENCE_TOPLEVEL) {
- refWindow = Blt_Toplevel(tkwin);
- } else if (patternPtr->reference == REFERENCE_WINDOW) {
- refWindow = patternPtr->refWindow;
- } else if (patternPtr->reference == REFERENCE_NONE) {
- refWindow = NULL;
- } else {
- return; /* Unknown reference window. */
- }
- if ((patternPtr->reference == REFERENCE_WINDOW) ||
- (patternPtr->reference == REFERENCE_TOPLEVEL)) {
- Tk_Window tkwin2;
-
- tkwin2 = tkwin;
- while ((tkwin2 != refWindow) && (tkwin2 != NULL)) {
- x += Tk_X(tkwin2) + Tk_Changes(tkwin2)->border_width;
- y += Tk_Y(tkwin2) + Tk_Changes(tkwin2)->border_width;
- tkwin2 = Tk_Parent(tkwin2);
- }
- if (tkwin2 == NULL) {
- /*
- * The window associated with the background pattern isn't an
- * ancestor of the current window. That means we can't use the
- * reference window as a guide to the size of the picture. Simply
- * convert to a self reference.
- */
- patternPtr->reference = REFERENCE_SELF;
- refWindow = tkwin;
- abort();
- }
- }
-
- x0 = patternPtr->xOrigin;
- y0 = patternPtr->yOrigin;
- tw = Blt_PictureWidth(picture);
- th = Blt_PictureHeight(picture);
-
- /* Compute the starting x and y offsets of the tile/gradient from the
- * coordinates of the origin. */
- dx = (x0 - x) % tw;
- if (dx > 0) {
- dx = (tw - dx);
- } else if (dx < 0) {
- dx = x - x0;
- }
- dy = (y0 - y) % th;
- if (dy > 0) {
- dy = (th - dy);
- } else if (dy < 0) {
- dy = y - y0;
- }
- *xOffsetPtr = dx % tw;
- *yOffsetPtr = dy % th;
-#ifdef notdef
- fprintf(stderr, "Tile offsets x0=%d y0=%d x=%d,y=%d sx=%d,sy=%d\n",
- x0, y0, x, y, *xOffsetPtr, *yOffsetPtr);
-#endif
-}
-
-
-static void
-Tile(
- Tk_Window tkwin,
- Drawable drawable,
- Pattern *patternPtr,
- Blt_Picture picture, /* Picture used as the tile. */
- int x, int y, int w, int h) /* Region of destination picture to be
- * tiled. */
-{
- Blt_Painter painter;
- int xOffset, yOffset; /* Starting upper left corner of
- * region. */
- int tileWidth, tileHeight; /* Tile dimensions. */
- int right, bottom, left, top;
-
- tileWidth = Blt_PictureWidth(picture);
- tileHeight = Blt_PictureHeight(picture);
- GetTileOffsets(tkwin, patternPtr, picture, x, y, &xOffset, &yOffset);
-
-#ifdef notdef
- fprintf(stderr, "tile is (xo=%d,yo=%d,tw=%d,th=%d)\n",
- patternPtr->xOrigin, patternPtr->yOrigin, tileWidth, tileHeight);
- fprintf(stderr, "region is (x=%d,y=%d,w=%d,h=%d)\n", x, y, w, h);
- fprintf(stderr, "starting offsets at sx=%d,sy=%d\n", xOffset, yOffset);
-#endif
-
- left = x;
- top = y;
- right = x + w;
- bottom = y + h;
-
- painter = Blt_GetPainter(tkwin, 1.0);
- for (y = (top - yOffset); y < bottom; y += tileHeight) {
- int sy, dy, ih;
-
- if (y < top) {
- dy = top;
- ih = MIN(tileHeight - yOffset, bottom - top);
- sy = yOffset;
- } else {
- dy = y;
- ih = MIN(tileHeight, bottom - y);
- sy = 0;
- }
-
- for (x = (left - xOffset); x < right; x += tileWidth) {
- int sx, dx, iw;
-
- if (x < left) {
- dx = left;
- iw = MIN(tileWidth - xOffset, right - left);
- sx = xOffset;
- } else {
- dx = x;
- iw = MIN(tileWidth, right - x);
- sx = 0;
- }
-
- Blt_PaintPicture(painter, drawable, picture, sx, sy, iw, ih,
- dx, dy, /*flags*/0);
-#ifdef notdef
- fprintf(stderr, "drawing pattern (sx=%d,sy=%d,iw=%d,ih=%d) at dx=%d,dy=%d\n",
- sx, sy, iw, ih, dx, dy);
-#endif
- }
- }
-}
-
-static void
-GetPolygonBBox(XPoint *points, int n, int *leftPtr, int *rightPtr, int *topPtr,
- int *bottomPtr)
-{
- XPoint *p, *pend;
- int left, right, bottom, top;
-
- /* Determine the bounding box of the polygon. */
- left = right = points[0].x;
- top = bottom = points[0].y;
- for (p = points, pend = p + n; p < pend; p++) {
- if (p->x < left) {
- left = p->x;
- }
- if (p->x > right) {
- right = p->x;
- }
- if (p->y < top) {
- top = p->y;
- }
- if (p->y > bottom) {
- bottom = p->y;
- }
- }
- if (leftPtr != NULL) {
- *leftPtr = left;
- }
- if (rightPtr != NULL) {
- *rightPtr = right;
- }
- if (topPtr != NULL) {
- *topPtr = top;
- }
- if (bottomPtr != NULL) {
- *bottomPtr = bottom;
- }
-}
-
-/*
- * The following routines are directly from tk3d.c.
- *
- * tk3d.c --
- *
- * This module provides procedures to draw borders in
- * the three-dimensional Motif style.
- *
- * Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994-1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * They fix a problem in the Intersect procedure when the polygon is big (e.q
- * 1600x1200). The computation overflows the 32-bit integers used.
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShiftLine --
- *
- * Given two points on a line, compute a point on a new line that is
- * parallel to the given line and a given distance away from it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ShiftLine(
- XPoint *p, /* First point on line. */
- XPoint *q, /* Second point on line. */
- int distance, /* New line is to be this many units
- * to the left of original line, when
- * looking from p1 to p2. May be
- * negative. */
- XPoint *r) /* Store coords of point on new line
- * here. */
-{
- int dx, dy, dxNeg, dyNeg;
-
- /*
- * The table below is used for a quick approximation in computing the new
- * point. An index into the table is 128 times the slope of the original
- * line (the slope must always be between 0 and 1). The value of the
- * table entry is 128 times the amount to displace the new line in y for
- * each unit of perpendicular distance. In other words, the table maps
- * from the tangent of an angle to the inverse of its cosine. If the
- * slope of the original line is greater than 1, then the displacement is
- * done in x rather than in y.
- */
- static int shiftTable[129];
-
- /*
- * Initialize the table if this is the first time it is
- * used.
- */
-
- if (shiftTable[0] == 0) {
- int i;
- double tangent, cosine;
-
- for (i = 0; i <= 128; i++) {
- tangent = i/128.0;
- cosine = 128/cos(atan(tangent)) + .5;
- shiftTable[i] = (int) cosine;
- }
- }
-
- *r = *p;
- dx = q->x - p->x;
- dy = q->y - p->y;
- if (dy < 0) {
- dyNeg = 1;
- dy = -dy;
- } else {
- dyNeg = 0;
- }
- if (dx < 0) {
- dxNeg = 1;
- dx = -dx;
- } else {
- dxNeg = 0;
- }
- if (dy <= dx) {
- dy = ((distance * shiftTable[(dy<<7)/dx]) + 64) >> 7;
- if (!dxNeg) {
- dy = -dy;
- }
- r->y += dy;
- } else {
- dx = ((distance * shiftTable[(dx<<7)/dy]) + 64) >> 7;
- if (dyNeg) {
- dx = -dx;
- }
- r->x += dx;
- }
-}
-
-/*
- *----------------------------------------------------------------------------
- *
- * Intersect --
- *
- * Find the intersection point between two lines.
- *
- * Results:
- * Under normal conditions 0 is returned and the point at *iPtr is filled
- * in with the intersection between the two lines. If the two lines are
- * parallel, then -1 is returned and *iPtr isn't modified.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------------
- */
-static int
-Intersect(a1Ptr, a2Ptr, b1Ptr, b2Ptr, iPtr)
- XPoint *a1Ptr; /* First point of first line. */
- XPoint *a2Ptr; /* Second point of first line. */
- XPoint *b1Ptr; /* First point of second line. */
- XPoint *b2Ptr; /* Second point of second line. */
- XPoint *iPtr; /* Filled in with intersection point. */
-{
- float dxadyb, dxbdya, dxadxb, dyadyb, p, q;
-
- /*
- * The code below is just a straightforward manipulation of two
- * equations of the form y = (x-x1)*(y2-y1)/(x2-x1) + y1 to solve
- * for the x-coordinate of intersection, then the y-coordinate.
- */
-
- dxadyb = (a2Ptr->x - a1Ptr->x)*(b2Ptr->y - b1Ptr->y);
- dxbdya = (b2Ptr->x - b1Ptr->x)*(a2Ptr->y - a1Ptr->y);
- dxadxb = (a2Ptr->x - a1Ptr->x)*(b2Ptr->x - b1Ptr->x);
- dyadyb = (a2Ptr->y - a1Ptr->y)*(b2Ptr->y - b1Ptr->y);
-
- if (dxadyb == dxbdya) {
- return -1;
- }
- p = (a1Ptr->x*dxbdya - b1Ptr->x*dxadyb + (b1Ptr->y - a1Ptr->y)*dxadxb);
- q = dxbdya - dxadyb;
- if (q < 0) {
- p = -p;
- q = -q;
- }
- if (p < 0) {
- iPtr->x = - ((-p + q/2)/q);
- } else {
- iPtr->x = (p + q/2)/q;
- }
- p = (a1Ptr->y*dxadyb - b1Ptr->y*dxbdya + (b1Ptr->x - a1Ptr->x)*dyadyb);
- q = dxadyb - dxbdya;
- if (q < 0) {
- p = -p;
- q = -q;
- }
- if (p < 0) {
- iPtr->y = (int)(- ((-p + q/2)/q));
- } else {
- iPtr->y = (int)((p + q/2)/q);
- }
- return 0;
-}
-
-/*
- *--------------------------------------------------------------
- *
- * Draw3DPolygon --
- *
- * Draw a border with 3-D appearance around the edge of a given polygon.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information is drawn in "drawable" in the form of a 3-D border
- * borderWidth units width wide on the left of the trajectory given by
- * pointPtr and n (or -borderWidth units wide on the right side,
- * if borderWidth is negative).
- *
- *--------------------------------------------------------------
- */
-
-static void
-Draw3DPolygon(
- Tk_Window tkwin, /* Window for which border was
- allocated. */
- Drawable drawable, /* X window or pixmap in which to
- * draw. */
- Tk_3DBorder border, /* Token for border to draw. */
- XPoint *points, /* Array of points describing polygon.
- * All points must be absolute
- * (CoordModeOrigin). */
- int n, /* Number of points at *points. */
- int borderWidth, /* Width of border, measured in
- * pixels to the left of the polygon's
- * trajectory. May be negative. */
- int leftRelief) /* TK_RELIEF_RAISED or
- * TK_RELIEF_SUNKEN: indicates how
- * stuff to left of trajectory looks
- * relative to stuff on right. */
-{
- XPoint poly[4], b1, b2, newB1, newB2;
- XPoint perp, c, shift1, shift2; /* Used for handling parallel lines. */
- XPoint *p, *q;
- GC gc;
- int i, lightOnLeft, dx, dy, parallel, pointsSeen;
-
- /* Handle grooves and ridges with recursive calls. */
- if ((leftRelief == TK_RELIEF_GROOVE) || (leftRelief == TK_RELIEF_RIDGE)) {
- int halfWidth, relief;
-
- halfWidth = borderWidth / 2;
- relief = (leftRelief == TK_RELIEF_GROOVE)
- ? TK_RELIEF_RAISED : TK_RELIEF_SUNKEN;
- Draw3DPolygon(tkwin, drawable, border, points, n, halfWidth, relief);
- Draw3DPolygon(tkwin, drawable, border, points, n, -halfWidth, relief);
- return;
- }
- /*
- * If the polygon is already closed, drop the last point from it
- * (we'll close it automatically).
- */
- p = points + (n-1);
- q = points;
- if ((p->x == q->x) && (p->y == q->y)) {
- n--;
- }
-
- /*
- * The loop below is executed once for each vertex in the polgon.
- * At the beginning of each iteration things look like this:
- *
- * poly[1] /
- * * /
- * | /
- * b1 * poly[0] (points[i-1])
- * | |
- * | |
- * | |
- * | |
- * | |
- * | | *p *q
- * b2 *--------------------*
- * |
- * |
- * x-------------------------
- *
- * The job of this iteration is to do the following:
- * (a) Compute x (the border corner corresponding to
- * points[i]) and put it in poly[2]. As part of
- * this, compute a new b1 and b2 value for the next
- * side of the polygon.
- * (b) Put points[i] into poly[3].
- * (c) Draw the polygon given by poly[0..3].
- * (d) Advance poly[0], poly[1], b1, and b2 for the
- * next side of the polygon.
- */
-
- /*
- * The above situation doesn't first come into existence until two points
- * have been processed; the first two points are used to "prime the pump",
- * so some parts of the processing are ommitted for these points. The
- * variable "pointsSeen" keeps track of the priming process; it has to be
- * separate from i in order to be able to ignore duplicate points in the
- * polygon.
- */
- pointsSeen = 0;
- for (i = -2, p = points + (n-2), q = p+1; i < n; i++, p = q, q++) {
- if ((i == -1) || (i == n-1)) {
- q = points;
- }
- if ((q->x == p->x) && (q->y == p->y)) {
- /*
- * Ignore duplicate points (they'd cause core dumps in
- * ShiftLine calls below).
- */
- continue;
- }
- ShiftLine(p, q, borderWidth, &newB1);
- newB2.x = newB1.x + (q->x - p->x);
- newB2.y = newB1.y + (q->y - p->y);
- poly[3] = *p;
- parallel = 0;
- if (pointsSeen >= 1) {
- parallel = Intersect(&newB1, &newB2, &b1, &b2, &poly[2]);
-
- /*
- * If two consecutive segments of the polygon are parallel,
- * then things get more complex. Consider the following
- * diagram:
- *
- * poly[1]
- * *----b1-----------b2------a
- * \
- * \
- * *---------*----------* b
- * poly[0] *q *p /
- * /
- * --*--------*----c
- * newB1 newB2
- *
- * Instead of using x and *p for poly[2] and poly[3], as
- * in the original diagram, use a and b as above. Then instead
- * of using x and *p for the new poly[0] and poly[1], use
- * b and c as above.
- *
- * Do the computation in three stages:
- * 1. Compute a point "perp" such that the line p-perp
- * is perpendicular to p-q.
- * 2. Compute the points a and c by intersecting the lines
- * b1-b2 and newB1-newB2 with p-perp.
- * 3. Compute b by shifting p-perp to the right and
- * intersecting it with p-q.
- */
-
- if (parallel) {
- perp.x = p->x + (q->y - p->y);
- perp.y = p->y - (q->x - p->x);
- Intersect(p, &perp, &b1, &b2, &poly[2]);
- Intersect(p, &perp, &newB1, &newB2, &c);
- ShiftLine(p, &perp, borderWidth, &shift1);
- shift2.x = shift1.x + (perp.x - p->x);
- shift2.y = shift1.y + (perp.y - p->y);
- Intersect(p, q, &shift1, &shift2, &poly[3]);
- }
- }
- if (pointsSeen >= 2) {
- dx = poly[3].x - poly[0].x;
- dy = poly[3].y - poly[0].y;
- if (dx > 0) {
- lightOnLeft = (dy <= dx);
- } else {
- lightOnLeft = (dy < dx);
- }
- if (lightOnLeft ^ (leftRelief == TK_RELIEF_RAISED)) {
- gc = Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC);
- } else {
- gc = Tk_3DBorderGC(tkwin, border, TK_3D_DARK_GC);
- }
- XFillPolygon(Tk_Display(tkwin), drawable, gc, poly, 4, Convex,
- CoordModeOrigin);
- }
- b1.x = newB1.x;
- b1.y = newB1.y;
- b2.x = newB2.x;
- b2.y = newB2.y;
- poly[0].x = poly[3].x;
- poly[0].y = poly[3].y;
- if (parallel) {
- poly[1].x = c.x;
- poly[1].y = c.y;
- } else if (pointsSeen >= 1) {
- poly[1].x = poly[2].x;
- poly[1].y = poly[2].y;
- }
- pointsSeen++;
- }
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * DestroySolidPattern --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroySolidPattern(Pattern *patternPtr)
-{
-}
-#endif
-
-static int
-ConfigureSolidPattern(Tcl_Interp *interp, Pattern *corePtr, int objc,
- Tcl_Obj *const *objv, unsigned int flags)
-{
- SolidPattern *patternPtr = (SolidPattern *)corePtr;
-
- if (Blt_ConfigureWidgetFromObj(interp, patternPtr->tkwin,
- patternPtr->classPtr->configSpecs, objc, objv, (char *)patternPtr,
- flags) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawSolidRectangle --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawSolidRectangle(Tk_Window tkwin, Drawable drawable, Pattern *corePtr,
- int x, int y, int w, int h)
-{
- SolidPattern *patternPtr = (SolidPattern *)corePtr;
-
- if ((h <= 0) || (w <= 0)) {
- return;
- }
- if (patternPtr->alpha == 0xFF) {
- Tk_Fill3DRectangle(tkwin, drawable, patternPtr->border, x, y, w, h,
- 0, TK_RELIEF_FLAT);
- } else if (patternPtr->alpha != 0x00) {
- Blt_Picture picture;
- Blt_Painter painter;
- Blt_Pixel color;
-
- picture = Blt_DrawableToPicture(tkwin, drawable, x, y, w, h, 1.0);
- if (picture == NULL) {
- return; /* Background is obscured. */
- }
- color = Blt_XColorToPixel(Tk_3DBorderColor(patternPtr->border));
- color.Alpha = patternPtr->alpha;
- Blt_PaintRectangle(picture, 0, 0, w, h, 0, 0, &color);
- painter = Blt_GetPainter(tkwin, 1.0);
- Blt_PaintPicture(painter, drawable, picture, 0, 0, w, h, x, y, 0);
- Blt_FreePicture(picture);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawSolidRectangle --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawSolidPolygon(Tk_Window tkwin, Drawable drawable, Pattern *corePtr, int n,
- XPoint *points)
-{
- SolidPattern *patternPtr = (SolidPattern *)corePtr;
-
- if (n < 3) {
- return; /* Not enough points for polygon */
- }
- if (patternPtr->alpha == 0xFF) {
- XFillPolygon(Tk_Display(tkwin), drawable,
- Tk_3DBorderGC(tkwin, patternPtr->border, TK_3D_FLAT_GC),
- points, n, Complex, CoordModeOrigin);
- } else if (patternPtr->alpha != 0x00) {
- Blt_Picture picture;
- Blt_Painter painter;
- Blt_Pixel color;
- int x1, x2, y1, y2;
- int i;
- Point2f *vertices;
- int w, h;
-
- /* Get polygon bounding box. */
- GetPolygonBBox(points, n, &x1, &x2, &y1, &y2);
- vertices = Blt_AssertMalloc(n * sizeof(Point2f));
- /* Translate the polygon */
- for (i = 0; i < n; i++) {
- vertices[i].x = (float)(points[i].x - x1);
- vertices[i].y = (float)(points[i].y - y1);
- }
- w = x2 - x1 + 1;
- h = y2 - y1 + 1;
- picture = Blt_DrawableToPicture(tkwin, drawable, x1, y1, w, h, 1.0);
- if (picture == NULL) {
- return; /* Background is obscured. */
- }
- color = Blt_XColorToPixel(Tk_3DBorderColor(patternPtr->border));
- color.Alpha = patternPtr->alpha;
- Blt_PaintPolygon(picture, n, vertices, &color);
- Blt_Free(vertices);
- painter = Blt_GetPainter(tkwin, 1.0);
- Blt_PaintPicture(painter, drawable, picture, 0, 0, w, h, x1, y1, 0);
- Blt_FreePicture(picture);
- }
-}
-
-static PatternClass solidPatternClass = {
- PATTERN_SOLID,
- solidConfigSpecs,
- NULL, /* DestroySolidPattern */
- ConfigureSolidPattern,
- DrawSolidRectangle,
- DrawSolidPolygon
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateSolidPattern --
- *
- * Creates a new solid background pattern.
- *
- * Results:
- * Returns pointer to the new background pattern.
- *
- *---------------------------------------------------------------------------
- */
-static Pattern *
-CreateSolidPattern(void)
-{
- SolidPattern *patternPtr;
-
- patternPtr = Blt_Calloc(1, sizeof(SolidPattern));
- if (patternPtr == NULL) {
- return NULL;
- }
- patternPtr->classPtr = &solidPatternClass;
- patternPtr->alpha = 0xFF;
- return (Pattern *)patternPtr;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyTilePattern --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyTilePattern(Pattern *corePtr)
-{
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawTileRectangle --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawTileRectangle(Tk_Window tkwin, Drawable drawable, Pattern *corePtr,
- int x, int y, int w, int h)
-{
- TilePattern *patternPtr = (TilePattern *)corePtr;
- Blt_Painter painter;
- Tk_Window refWindow;
-
- if ((h <= 0) || (w <= 0)) {
- return;
- }
- if (patternPtr->tkImage == NULL) {
- /* No image so draw solid color background using border. */
- Tk_Fill3DRectangle(tkwin, drawable, patternPtr->border, x, y, w, h,
- 0, TK_RELIEF_FLAT);
- return;
- }
- if (patternPtr->flags & BG_SCALE) {
- Blt_Picture picture;
- int refWidth, refHeight;
- Blt_HashEntry *hPtr;
-
- hPtr = NULL;
- picture = NULL;
- refWidth = w, refHeight = h;
- if (patternPtr->reference != REFERENCE_NONE) {
- int isNew;
-
- /* See if a picture has previously been generated. There will be a
- * picture for each reference window. */
- hPtr = Blt_CreateHashEntry(&patternPtr->pictTable,
- (char *)refWindow, &isNew);
- if (!isNew) {
- picture = Blt_GetHashValue(hPtr);
- }
- refWidth = Tk_Width(refWindow);
- refHeight = Tk_Height(refWindow);
- }
- if ((picture == NULL) ||
- (Blt_PictureWidth(picture) != refWidth) ||
- (Blt_PictureHeight(picture) != refHeight)) {
- Blt_Picture original;
- int isNew;
-
- /*
- * Either the size of the reference window has changed or one of
- * the background pattern options has been reset. Resize the
- * picture if necessary and regenerate the background.
- */
- if (picture == NULL) {
- picture = Blt_CreatePicture(refWidth, refHeight);
- if (hPtr != NULL) {
- Blt_SetHashValue(hPtr, picture);
- }
- } else {
- Blt_ResizePicture(picture, refWidth, refHeight);
- }
- original = ImageToPicture(patternPtr, &isNew);
- if (original != NULL) {
- Blt_ResamplePicture(picture, original, patternPtr->filter,
- patternPtr->filter);
- if (isNew) {
- Blt_FreePicture(original);
- }
- }
- }
- Blt_PaintPicture(painter, drawable, picture, 0, 0, w, h, x, y, 0);
- } else {
- int isNew;
- Blt_Picture picture;
-
- picture = ImageToPicture(patternPtr, &isNew);
- Tile(tkwin, drawable, corePtr, picture, x, y, w, h);
- if (isNew) {
- Blt_FreePicture(picture);
- }
- }
-}
-
-static int
-ConfigureTilePattern(Tcl_Interp *interp, Pattern *corePtr, int objc,
- Tcl_Obj *const *objv, unsigned int flags)
-{
- TilePattern *patternPtr = (TilePattern *)corePtr;
-
- if (Blt_ConfigureWidgetFromObj(interp, patternPtr->tkwin,
- patternPtr->classPtr->configSpecs, objc, objv, (char *)patternPtr,
- flags) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static PatternClass tilePatternClass = {
- PATTERN_TILE,
- tileConfigSpecs,
- NULL, /* DestroyTilePattern, */
- ConfigureTilePattern,
- DrawTileRectangle,
- DrawSolidPolygon
-
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateTilePattern --
- *
- * Creates a new image background pattern.
- *
- * Results:
- * Returns pointer to the new background pattern.
- *
- *---------------------------------------------------------------------------
- */
-static Pattern *
-CreateTilePattern(void)
-{
- TilePattern *patternPtr;
-
- patternPtr = Blt_Calloc(1, sizeof(TilePattern));
- if (patternPtr == NULL) {
- return NULL;
- }
- patternPtr->classPtr = &tilePatternClass;
- patternPtr->reference = REFERENCE_TOPLEVEL;
- return (Pattern *)patternPtr;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyGradientPattern --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyGradientPattern(Pattern *patternPtr)
-{
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawGradientRectangle --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawGradientRectangle(Tk_Window tkwin, Drawable drawable, Pattern *corePtr,
- int x, int y, int w, int h)
-{
- GradientPattern *patternPtr = (GradientPattern *)corePtr;
- int sx, sy;
- Tk_Window refWindow;
- Blt_Picture picture;
- int refWidth, refHeight;
- Blt_HashEntry *hPtr;
-
- if ((h <= 0) || (w <= 0)) {
- return;
- }
- if (patternPtr->reference == REFERENCE_SELF) {
- refWindow = tkwin;
- } else if (patternPtr->reference == REFERENCE_TOPLEVEL) {
- refWindow = Blt_Toplevel(tkwin);
- } else if (patternPtr->reference == REFERENCE_WINDOW) {
- refWindow = patternPtr->refWindow;
- } else if (patternPtr->reference == REFERENCE_NONE) {
- refWindow = NULL;
- } else {
- return; /* Unknown reference window. */
- }
-
- hPtr = NULL;
- picture = NULL;
- refWidth = w, refHeight = h;
- sx = x, sy = y;
- if (patternPtr->reference != REFERENCE_NONE) {
- int isNew;
-
- if ((patternPtr->reference == REFERENCE_WINDOW) ||
- (patternPtr->reference == REFERENCE_TOPLEVEL)) {
- Tk_Window tkwin2;
-
- tkwin2 = tkwin;
- while ((tkwin2 != refWindow) && (tkwin2 != NULL)) {
- sx += Tk_X(tkwin2) + Tk_Changes(tkwin2)->border_width;
- sy += Tk_Y(tkwin2) + Tk_Changes(tkwin2)->border_width;
- tkwin2 = Tk_Parent(tkwin2);
- }
- if (tkwin2 == NULL) {
- /*
- * The window associated with the background pattern isn't an
- * ancestor of the current window. That means we can't use the
- * reference window as a guide to the size of the picture.
- * Simply convert to a self reference.
- */
- patternPtr->reference = REFERENCE_SELF;
- refWindow = tkwin;
- sx = x, sy = y;
- }
- }
- /* See if a picture has previously been generated. There will be a
- * picture for each reference window. */
- hPtr = Blt_CreateHashEntry(&patternPtr->pictTable, (char *)refWindow,
- &isNew);
- if (!isNew) {
- picture = Blt_GetHashValue(hPtr);
- }
- refWidth = Tk_Width(refWindow);
- refHeight = Tk_Height(refWindow);
- }
- if (patternPtr->reference == REFERENCE_SELF) {
- refWidth = Tk_Width(refWindow);
- refHeight = Tk_Height(refWindow);
- sx = x, sy = y;
- }
- if ((picture == NULL) ||
- (Blt_PictureWidth(picture) != refWidth) ||
- (Blt_PictureHeight(picture) != refHeight)) {
- /*
- * Either the size of the reference window has changed or one of the
- * background pattern options has been reset. Resize the picture if
- * necessary and regenerate the background.
- */
- if (picture == NULL) {
- picture = Blt_CreatePicture(refWidth, refHeight);
- if (hPtr != NULL) {
- Blt_SetHashValue(hPtr, picture);
- }
- } else {
- Blt_ResizePicture(picture, refWidth, refHeight);
- }
- Blt_GradientPicture(picture, &patternPtr->high, &patternPtr->low,
- &patternPtr->gradient);
- }
- Tile(tkwin, drawable, corePtr, picture, x, y, w, h);
-#ifdef notdef
- painter = Blt_GetPainter(tkwin, 1.0);
- Blt_PaintPicture(painter, drawable, picture, sx, sy, w, h, x, y, 0);
-#endif
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawGradientRectangle --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawGradientPolygon(Tk_Window tkwin, Drawable drawable, Pattern *corePtr,
- int n, XPoint *points)
-{
- GradientPattern *patternPtr = (GradientPattern *)corePtr;
- Tk_Window refWindow;
-
- if (patternPtr->reference == REFERENCE_SELF) {
- refWindow = tkwin;
- } else if (patternPtr->reference == REFERENCE_TOPLEVEL) {
- refWindow = Blt_Toplevel(tkwin);
- } else if (patternPtr->reference == REFERENCE_WINDOW) {
- refWindow = patternPtr->refWindow;
- } else if (patternPtr->reference == REFERENCE_NONE) {
- refWindow = NULL;
- } else {
- return; /* Unknown reference window. */
- }
- if (n < 3) {
- return; /* Not enough points for polygon */
- }
- if (patternPtr->alpha == 0xFF) {
- XFillPolygon(Tk_Display(tkwin), drawable,
- Tk_3DBorderGC(tkwin, patternPtr->border, TK_3D_FLAT_GC),
- points, n, Complex, CoordModeOrigin);
- } else if (patternPtr->alpha != 0x00) {
- Blt_Picture picture;
- Blt_Painter painter;
- Blt_Pixel color;
- int x1, x2, y1, y2;
- int i;
- Point2f *vertices;
- int w, h;
-
- /* Get polygon bounding box. */
- GetPolygonBBox(points, n, &x1, &x2, &y1, &y2);
- vertices = Blt_AssertMalloc(n * sizeof(Point2f));
- /* Translate the polygon */
- for (i = 0; i < n; i++) {
- vertices[i].x = (float)(points[i].x - x1);
- vertices[i].y = (float)(points[i].y - y1);
- }
- w = x2 - x1 + 1;
- h = y2 - y1 + 1;
- picture = Blt_DrawableToPicture(tkwin, drawable, x1, y1, w, h, 1.0);
- if (picture == NULL) {
- return; /* Background is obscured. */
- }
- color = Blt_XColorToPixel(Tk_3DBorderColor(patternPtr->border));
- color.Alpha = patternPtr->alpha;
- Blt_PaintPolygon(picture, n, vertices, &color);
- Blt_Free(vertices);
- painter = Blt_GetPainter(tkwin, 1.0);
- Blt_PaintPicture(painter, drawable, picture, 0, 0, w, h, x1, y1, 0);
- Blt_FreePicture(picture);
- }
-}
-
-static int
-ConfigureGradientPattern(Tcl_Interp *interp, Pattern *corePtr, int objc,
- Tcl_Obj *const *objv, unsigned int flags)
-{
- GradientPattern *patternPtr = (GradientPattern *)corePtr;
-
- if (Blt_ConfigureWidgetFromObj(interp, patternPtr->tkwin,
- patternPtr->classPtr->configSpecs, objc, objv, (char *)patternPtr,
- flags) != TCL_OK) {
- return TCL_ERROR;
- }
- if (patternPtr->alpha != 0xFF) {
- patternPtr->low.Alpha = patternPtr->alpha;
- patternPtr->high.Alpha = patternPtr->alpha;
- }
- return TCL_OK;
-}
-
-
-static PatternClass gradientPatternClass = {
- PATTERN_GRADIENT,
- gradientConfigSpecs,
- NULL, /* DestroyGradientPattern, */
- ConfigureGradientPattern,
- DrawGradientRectangle,
- DrawGradientPolygon,
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateGradientPattern --
- *
- * Creates a new solid background pattern.
- *
- * Results:
- * Returns pointer to the new background pattern.
- *
- *---------------------------------------------------------------------------
- */
-static Pattern *
-CreateGradientPattern(void)
-{
- GradientPattern *patternPtr;
-
- patternPtr = Blt_Calloc(1, sizeof(GradientPattern));
- if (patternPtr == NULL) {
- return NULL;
- }
- patternPtr->classPtr = &gradientPatternClass;
- patternPtr->reference = REFERENCE_TOPLEVEL;
- patternPtr->gradient.shape = BLT_GRADIENT_SHAPE_LINEAR;
- patternPtr->gradient.path = BLT_GRADIENT_PATH_Y;
- patternPtr->gradient.jitter = FALSE;
- patternPtr->gradient.logScale = TRUE;
- patternPtr->alpha = 255;
- return (Pattern *)patternPtr;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyTexturePattern --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyTexturePattern(Pattern *patternPtr)
-{
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawTextureRectangle --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawTextureRectangle(Tk_Window tkwin, Drawable drawable, Pattern *corePtr,
- int x, int y, int w, int h)
-{
- Blt_Painter painter;
- Blt_Picture picture;
- TexturePattern *patternPtr = (TexturePattern *)corePtr;
- Tk_Window refWindow;
- int refWidth, refHeight;
- Blt_HashEntry *hPtr;
-
- if ((h <= 0) || (w <= 0)) {
- return;
- }
- if (patternPtr->reference == REFERENCE_SELF) {
- refWindow = tkwin;
- } else if (patternPtr->reference == REFERENCE_TOPLEVEL) {
- refWindow = Blt_Toplevel(tkwin);
- } else if (patternPtr->reference == REFERENCE_WINDOW) {
- refWindow = patternPtr->refWindow;
- } else if (patternPtr->reference == REFERENCE_NONE) {
- refWindow = NULL;
- } else {
- return; /* Unknown reference window. */
- }
- painter = Blt_GetPainter(tkwin, 1.0);
-
- picture = NULL;
- refWidth = w, refHeight = h;
- if (patternPtr->reference != REFERENCE_NONE) {
- int isNew;
-
- /* See if a picture has previously been generated. There will be a
- * picture for each reference window. */
- hPtr = Blt_CreateHashEntry(&patternPtr->pictTable, (char *)refWindow,
- &isNew);
- if (!isNew) {
- picture = Blt_GetHashValue(hPtr);
- }
- refWidth = Tk_Width(refWindow);
- refHeight = Tk_Height(refWindow);
- }
- if ((picture == NULL) ||
- (Blt_PictureWidth(picture) != refWidth) ||
- (Blt_PictureHeight(picture) != refHeight)) {
-
- /*
- * Either the size of the reference window has changed or one of the
- * background pattern options has been reset. Resize the picture if
- * necessary and regenerate the background.
- */
- if (picture == NULL) {
- picture = Blt_CreatePicture(refWidth, refHeight);
- if (hPtr != NULL) {
- Blt_SetHashValue(hPtr, picture);
- }
- } else {
- Blt_ResizePicture(picture, refWidth, refHeight);
- }
- Blt_TexturePicture(picture, &patternPtr->high, &patternPtr->low,
- patternPtr->type);
- }
- Blt_PaintPicture(painter, drawable, picture, 0, 0, w, h, x, y, 0);
-}
-
-static int
-ConfigureTexturePattern(Tcl_Interp *interp, Pattern *corePtr, int objc,
- Tcl_Obj *const *objv, unsigned int flags)
-{
- TexturePattern *patternPtr = (TexturePattern *)corePtr;
-
- if (Blt_ConfigureWidgetFromObj(interp, patternPtr->tkwin,
- patternPtr->classPtr->configSpecs, objc, objv, (char *)patternPtr,
- flags) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static PatternClass texturePatternClass = {
- PATTERN_TEXTURE,
- textureConfigSpecs,
- NULL, /* DestroyTexturePattern, */
- ConfigureTexturePattern,
- DrawTextureRectangle,
- DrawSolidPolygon
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateTexturePattern --
- *
- * Creates a new texture background pattern.
- *
- * Results:
- * Returns pointer to the new background pattern.
- *
- *---------------------------------------------------------------------------
- */
-static Pattern *
-CreateTexturePattern()
-{
- TexturePattern *patternPtr;
-
- patternPtr = Blt_Calloc(1, sizeof(TexturePattern));
- if (patternPtr == NULL) {
- return NULL;
- }
- patternPtr->classPtr = &texturePatternClass;
- patternPtr->reference = REFERENCE_TOPLEVEL;
- return (Pattern *)patternPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreatePattern --
- *
- * Creates a new background pattern.
- *
- * Results:
- * Returns pointer to the new background pattern.
- *
- *---------------------------------------------------------------------------
- */
-static Pattern *
-CreatePattern(BackgroundInterpData *dataPtr, Tcl_Interp *interp, int type)
-{
- Pattern *patternPtr;
-
- switch (type) {
- case PATTERN_SOLID:
- patternPtr = CreateSolidPattern();
- break;
- case PATTERN_TILE:
- patternPtr = CreateTilePattern();
- break;
- case PATTERN_GRADIENT:
- patternPtr = CreateGradientPattern();
- break;
- case PATTERN_TEXTURE:
- patternPtr = CreateTexturePattern();
- break;
- default:
- abort();
- break;
- }
- if (patternPtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate background pattern",
- (char *)NULL);
- return NULL;
- }
- patternPtr->dataPtr = dataPtr;
- Blt_InitHashTable(&patternPtr->pictTable, BLT_ONE_WORD_KEYS);
- patternPtr->chain = Blt_Chain_Create();
- patternPtr->tkwin = Tk_MainWindow(interp);
- patternPtr->display = Tk_Display(patternPtr->tkwin);
- return patternPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyPattern --
- *
- * Removes the client from the servers's list of clients and memory used
- * by the client token is released. When the last client is deleted, the
- * server is also removed.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyPattern(Pattern *patternPtr)
-{
- Blt_FreeOptions(patternPtr->classPtr->configSpecs, (char *)patternPtr,
- patternPtr->display, 0);
- if (patternPtr->classPtr->destroyProc != NULL) {
- (*patternPtr->classPtr->destroyProc)(patternPtr);
- }
- if (patternPtr->border != NULL) {
- Tk_Free3DBorder(patternPtr->border);
- }
- if (patternPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&patternPtr->dataPtr->patternTable,
- patternPtr->hashPtr);
- }
- ClearCache(patternPtr);
- Blt_Chain_Destroy(patternPtr->chain);
- Blt_DeleteHashTable(&patternPtr->pictTable);
- Blt_Free(patternPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyBackground --
- *
- * Removes the client from the servers's list of clients and memory used
- * by the client token is released. When the last client is deleted, the
- * server is also removed.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyBackground(Background *bgPtr)
-{
- Pattern *patternPtr = bgPtr->corePtr;
-
- Blt_Chain_DeleteLink(patternPtr->chain, bgPtr->link);
- if (Blt_Chain_GetLength(patternPtr->chain) <= 0) {
- DestroyPattern(patternPtr);
- }
- Blt_Free(bgPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetPatternFromObj --
- *
- * Retrieves the background pattern named by the given the Tcl_Obj.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetPatternFromObj(Tcl_Interp *interp, BackgroundInterpData *dataPtr,
- Tcl_Obj *objPtr, Pattern **patternPtrPtr)
-{
- Blt_HashEntry *hPtr;
- const char *string;
-
- string = Tcl_GetString(objPtr);
- hPtr = Blt_FindHashEntry(&dataPtr->patternTable, string);
- if (hPtr == NULL) {
- Tcl_AppendResult(dataPtr->interp, "can't find background pattern \"",
- string, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- *patternPtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-/*
- * bgpattern create type ?option values?...
- */
-static int
-CreateOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Background *bgPtr;
- BackgroundInterpData *dataPtr = clientData;
- Pattern *patternPtr;
- int type;
-
- if (GetPatternTypeFromObj(interp, objv[2], &type) != TCL_OK) {
- return TCL_ERROR;
- }
- patternPtr = CreatePattern(dataPtr, interp, type);
- if (patternPtr == NULL) {
- return TCL_ERROR;
- }
- if ((*patternPtr->classPtr->configProc)(interp, patternPtr,
- objc - 3, objv + 3, 0) != TCL_OK) {
- DestroyPattern(patternPtr);
- return TCL_ERROR;
- }
- /* Create the container for the pattern. */
- bgPtr = Blt_Calloc(1, sizeof(Background));
- if (bgPtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate background.", (char *)NULL);
- DestroyPattern(patternPtr);
- return TCL_ERROR;
- }
- /* Generate a unique name for the pattern. */
- {
- int isNew;
- char name[200];
- Blt_HashEntry *hPtr;
-
- do {
- sprintf_s(name, 200, "bgpattern%d", dataPtr->nextId++);
- hPtr = Blt_CreateHashEntry(&dataPtr->patternTable, name, &isNew);
- } while (!isNew);
- assert(hPtr != NULL);
- assert(patternPtr != NULL);
- Blt_SetHashValue(hPtr, patternPtr);
- patternPtr->hashPtr = hPtr;
- patternPtr->name = Blt_GetHashKey(&dataPtr->patternTable, hPtr);
- }
-
- /* Add the container to the pattern's list. */
- bgPtr->link = Blt_Chain_Append(patternPtr->chain, bgPtr);
- patternPtr->link = bgPtr->link;
- bgPtr->corePtr = patternPtr;
- Tcl_SetStringObj(Tcl_GetObjResult(interp), patternPtr->name, -1);
- return TCL_OK;
-}
-
-/*
- * bgpattern cget $pattern ?option?...
- */
-static int
-CgetOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- BackgroundInterpData *dataPtr = clientData;
- Pattern *patternPtr;
-
- if (GetPatternFromObj(interp, dataPtr, objv[2], &patternPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_ConfigureValueFromObj(interp, patternPtr->tkwin,
- patternPtr->classPtr->configSpecs, (char *)patternPtr, objv[3], 0);
-}
-
-/*
- * bgpattern configure $pattern ?option?...
- */
-static int
-ConfigureOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- BackgroundInterpData *dataPtr = clientData;
- Pattern *patternPtr;
- int flags;
-
- if (GetPatternFromObj(interp, dataPtr, objv[2], &patternPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- flags = BLT_CONFIG_OBJV_ONLY;
- if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, patternPtr->tkwin,
- patternPtr->classPtr->configSpecs, (char *)patternPtr,
- (Tcl_Obj *)NULL, flags);
- } else if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, patternPtr->tkwin,
- patternPtr->classPtr->configSpecs, (char *)patternPtr, objv[3],
- flags);
- } else {
- if ((*patternPtr->classPtr->configProc)(interp, patternPtr,
- objc-3, objv+3, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- ClearCache(patternPtr);
- NotifyClients(patternPtr);
- return TCL_OK;
- }
-}
-
-/*
- * bgpattern delete $pattern...
- */
-static int
-DeleteOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- BackgroundInterpData *dataPtr = clientData;
- int i;
-
- for (i = 2; i < objc; i++) {
- Blt_HashEntry *hPtr;
- Pattern *patternPtr;
- const char *name;
-
- name = Tcl_GetString(objv[i]);
- hPtr = Blt_FindHashEntry(&dataPtr->patternTable, name);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "can't find background pattern \"",
- name, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- patternPtr = Blt_GetHashValue(hPtr);
- assert(patternPtr->hashPtr == hPtr);
-
- /* FIXME: Assuming that the first background token is always
- * associated with the command. Need to known when pattern was created
- * by bgpattern command. Does bgpattern delete #ffffff make sense? */
- /*
- * Look up clientData from command hash table. If it's found it
- * represents a command?
- */
- if (patternPtr->link != NULL) {
- Background *bgPtr;
-
- bgPtr = Blt_Chain_GetValue(patternPtr->link);
- assert(patternPtr->link == bgPtr->link);
- /* Take the pattern entry out of the hash table. */
- Blt_DeleteHashEntry(&patternPtr->dataPtr->patternTable,
- patternPtr->hashPtr);
- patternPtr->name = NULL;
- patternPtr->hashPtr = NULL;
- patternPtr->link = NULL; /* Disconnect pattern. */
- DestroyBackground(bgPtr);
- }
- }
- return TCL_OK;
-}
-
-/*
- * bgpattern type $pattern
- */
-static int
-TypeOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- BackgroundInterpData *dataPtr = clientData;
- Pattern *patternPtr;
-
- if (GetPatternFromObj(interp, dataPtr, objv[2], &patternPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), NameOfPattern(patternPtr), -1);
- return TCL_OK;
-}
-
-static Blt_OpSpec patternOps[] =
-{
- {"cget", 2, CgetOp, 4, 4, "pattern option",},
- {"configure", 2, ConfigureOp, 3, 0, "pattern ?option value?...",},
- {"create", 2, CreateOp, 3, 0, "type ?args?",},
- {"delete", 1, DeleteOp, 2, 0, "pattern...",},
- {"type", 1, TypeOp, 3, 3, "pattern",},
-};
-static int nPatternOps = sizeof(patternOps) / sizeof(Blt_OpSpec);
-
-static int
-BgPatternCmdProc(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nPatternOps, patternOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (clientData, interp, objc, objv);
-}
-
-static void
-BgPatternDeleteCmdProc(ClientData clientData)
-{
- BackgroundInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->patternTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Pattern *patternPtr;
- Blt_ChainLink link, next;
-
- patternPtr = Blt_GetHashValue(hPtr);
- patternPtr->hashPtr = NULL;
- for (link = Blt_Chain_FirstLink(patternPtr->chain); link != NULL;
- link = next) {
- Background *bgPtr;
-
- next = Blt_Chain_NextLink(link);
- bgPtr = Blt_Chain_GetValue(link);
- DestroyBackground(bgPtr);
- }
- }
- Blt_DeleteHashTable(&dataPtr->patternTable);
- Tcl_DeleteAssocData(dataPtr->interp, BG_PATTERN_THREAD_KEY);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetBackgroundInterpData --
- *
- *---------------------------------------------------------------------------
- */
-static BackgroundInterpData *
-GetBackgroundInterpData(Tcl_Interp *interp)
-{
- BackgroundInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (BackgroundInterpData *)
- Tcl_GetAssocData(interp, BG_PATTERN_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(BackgroundInterpData));
- dataPtr->interp = interp;
- dataPtr->nextId = 1;
-
-
- /* FIXME: Create interp delete proc to teardown the hash table and
- * data entry. Must occur after all the widgets have been destroyed
- * (clients of the background pattern). */
-
- Tcl_SetAssocData(interp, BG_PATTERN_THREAD_KEY,
- (Tcl_InterpDeleteProc *)NULL, dataPtr);
- Blt_InitHashTable(&dataPtr->patternTable, BLT_STRING_KEYS);
- }
- return dataPtr;
-}
-
-
-/*LINTLIBRARY*/
-int
-Blt_BgPatternCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {
- "bgpattern", BgPatternCmdProc, BgPatternDeleteCmdProc,
- };
- cmdSpec.clientData = GetBackgroundInterpData(interp);
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetBackground
- *
- * Creates a new background from the given pattern description. The
- * background structure returned is a token for the client to use the
- * background. If the pattern isn't a solid pattern (i.e. a solid color
- * that Tk_Get3DBorder will accept) then the pattern must already exist.
- * Solid patterns are the exception to this rule. This lets "-background
- * #ffffff" work without already having allocated a background pattern
- * "#ffffff".
- *
- * Results:
- * Returns a background pattern token.
- *
- * Side Effects:
- * Memory is allocated for the new token.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Background
-Blt_GetBackground(Tcl_Interp *interp, Tk_Window tkwin, const char *name)
-{
- Pattern *patternPtr;
- BackgroundInterpData *dataPtr;
- Background *bgPtr; /* Pattern container. */
- Blt_HashEntry *hPtr;
- int isNew;
-
- /* Create new token for the background. */
- bgPtr = Blt_Calloc(1, sizeof(Background));
- if (bgPtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate background \"", name, "\".",
- (char *)NULL);
- return NULL;
- }
- dataPtr = GetBackgroundInterpData(interp);
- hPtr = Blt_CreateHashEntry(&dataPtr->patternTable, name, &isNew);
- if (isNew) {
- Tk_3DBorder border;
-
- /* Pattern doesn't already exist, see if it's a color name
- * (i.e. something that Tk_Get3DBorder will accept). */
- border = Tk_Get3DBorder(interp, tkwin, name);
- if (border == NULL) {
- goto error; /* Nope. It's an error. */
- }
- patternPtr = CreatePattern(dataPtr, interp, PATTERN_SOLID);
- if (patternPtr == NULL) {
- Tk_Free3DBorder(border);
- goto error; /* Can't allocate new pattern. */
- }
- patternPtr->border = border;
- patternPtr->hashPtr = hPtr;
- patternPtr->name = Blt_GetHashKey(&dataPtr->patternTable, hPtr);
- patternPtr->link = NULL;
- Blt_SetHashValue(hPtr, patternPtr);
- } else {
- patternPtr = Blt_GetHashValue(hPtr);
- assert(patternPtr != NULL);
- }
- /* Add the new background to the pattern's list of clients. */
- bgPtr->link = Blt_Chain_Append(patternPtr->chain, bgPtr);
- bgPtr->corePtr = patternPtr;
- return bgPtr;
- error:
- Blt_Free(bgPtr);
- Blt_DeleteHashEntry(&dataPtr->patternTable, hPtr);
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetBackgroundFromObj
- *
- * Retrieves a new token of a background pattern from the named background
- * pattern.
- *
- * Results:
- * Returns a background pattern token.
- *
- * Side Effects:
- * Memory is allocated for the new token.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Background
-Blt_GetBackgroundFromObj(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)
-{
- return Blt_GetBackground(interp, tkwin, Tcl_GetString(objPtr));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_SetBackgroundChangedProc
- *
- * Sets the routine to called when an image changes.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The designated routine will be called the next time the image
- * associated with the tile changes.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_SetBackgroundChangedProc(
- Background *bgPtr, /* Background to register callback
- * with. */
- Blt_BackgroundChangedProc *notifyProc, /* Function to call when pattern
- * has changed. NULL indicates to
- * unset the callback.*/
- ClientData clientData)
-{
- bgPtr->notifyProc = notifyProc;
- bgPtr->clientData = clientData;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FreeBackground
- *
- * Removes the background pattern token.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Memory is freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FreeBackground(Background *bgPtr)
-{
- Pattern *patternPtr = bgPtr->corePtr;
-
- assert(patternPtr != NULL);
- DestroyBackground(bgPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetBackgroundOrigin
- *
- * Returns the coordinates of the origin of the background pattern
- * referenced by the token.
- *
- * Results:
- * Returns the coordinates of the origin.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_GetBackgroundOrigin(Background *bgPtr, int *xPtr, int *yPtr)
-{
- *xPtr = bgPtr->corePtr->xOrigin;
- *yPtr = bgPtr->corePtr->yOrigin;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_SetBackgroundOrigin
- *
- * Sets the origin of the background pattern referenced by the token.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_SetBackgroundOrigin(Tk_Window tkwin, Background *bgPtr, int x, int y)
-{
- Pattern *patternPtr = bgPtr->corePtr;
- patternPtr->xOrigin = x;
- patternPtr->yOrigin = y;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_NameOfBackground
- *
- * Returns the name of the core background pattern referenced by the
- * token.
- *
- * Results:
- * Return the name of the background pattern.
- *
- *---------------------------------------------------------------------------
- */
-const char *
-Blt_NameOfBackground(Background *bgPtr)
-{
- if (bgPtr->corePtr->name == NULL) {
- return "";
- }
- return bgPtr->corePtr->name;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_BackgroundBorderColor
- *
- * Returns the border color of the background pattern referenced by the
- * token.
- *
- * Results:
- * Returns the XColor representing the border color of the pattern.
- *
- *---------------------------------------------------------------------------
- */
-XColor *
-Blt_BackgroundBorderColor(Background *bgPtr)
-{
- return Tk_3DBorderColor(bgPtr->corePtr->border);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_BackgroundBorder
- *
- * Returns the border of the background pattern referenced by the token.
- *
- * Results:
- * Return the border of the background pattern.
- *
- *---------------------------------------------------------------------------
- */
-Tk_3DBorder
-Blt_BackgroundBorder(Background *bgPtr)
-{
- return bgPtr->corePtr->border;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawBackgroundRectangle
- *
- * Draws the background pattern in the designated window.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DrawBackgroundRectangle(Tk_Window tkwin, Drawable drawable,
- Background *bgPtr, int x, int y, int w, int h,
- int borderWidth, int relief)
-{
- Tk_Draw3DRectangle(tkwin, drawable, bgPtr->corePtr->border, x, y, w, h,
- borderWidth, relief);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FillBackgroundRectangle
- *
- * Draws the background pattern in the designated window.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FillBackgroundRectangle(Tk_Window tkwin, Drawable drawable,
- Background *bgPtr, int x, int y, int w, int h,
- int borderWidth, int relief)
-{
- Pattern *patternPtr;
-
- if ((h < 1) || (w < 1)) {
- return;
- }
- patternPtr = bgPtr->corePtr;
- (*patternPtr->classPtr->drawRectangleProc)(tkwin, drawable, patternPtr,
- x, y, w, h);
- if ((relief != TK_RELIEF_FLAT) && (borderWidth > 0)) {
- Tk_Draw3DRectangle(tkwin, drawable, patternPtr->border, x, y, w, h,
- borderWidth, relief);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawBackgroundPolygon
- *
- * Draws the background pattern in the designated window.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DrawBackgroundPolygon(Tk_Window tkwin, Drawable drawable, Background *bgPtr,
- XPoint *points, int n, int borderWidth, int relief)
-{
- Pattern *patternPtr;
-
-#ifdef notdef
- if (n < 3) {
- return;
- }
-#endif
- patternPtr = bgPtr->corePtr;
- Draw3DPolygon(tkwin, drawable, patternPtr->border, points, n,
- borderWidth, relief);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FillBackgroundPolygon
- *
- * Draws the background pattern in the designated window.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FillBackgroundPolygon(Tk_Window tkwin, Drawable drawable, Background *bgPtr,
- XPoint *points, int n, int borderWidth, int relief)
-{
- Pattern *patternPtr;
-
- if (n < 3) {
- return;
- }
- patternPtr = bgPtr->corePtr;
- (*patternPtr->classPtr->drawPolygonProc)(tkwin, drawable, patternPtr,
- n, points);
- if ((relief != TK_RELIEF_FLAT) && (borderWidth != 0)) {
- Draw3DPolygon(tkwin, drawable, patternPtr->border, points, n,
- borderWidth, relief);
- }
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FillPictureBackground
- *
- * Draws the background pattern in the designated picture.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FillPictureBackground(
- Tk_Window tkwin,
- Blt_Picture dest,
- Background *bgPtr,
- int x, int y, int w, int h,
- int borderWidth, int relief)
-{
- Pattern *patternPtr;
- Blt_Picture picture;
- int sx, sy;
-
- patternPtr = bgPtr->corePtr;
- if (patternPtr->classPtr->pattern == PATTERN_BORDER) {
- return;
- }
- picture = GetBackgroundPicture(patternPtr, tkwin, x, y, &sx, &sy);
- if (picture == NULL) {
- return;
- }
- Blt_CopyPictureBits(dest, picture, sx, sy, w, h, x, y);
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawFocusBackground
- *
- * Draws the background pattern in the designated picture.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DrawFocusBackground(Tk_Window tkwin, Background *bgPtr,
- int highlightThickness, Drawable drawable)
-{
- Pattern *patternPtr = (Pattern *)bgPtr->corePtr;
- int w, h;
-
- w = Tk_Width(tkwin);
- h = Tk_Height(tkwin);
- /* Top */
- (*patternPtr->classPtr->drawRectangleProc)(tkwin, drawable, patternPtr,
- 0, 0, w, highlightThickness);
- /* Bottom */
- (*patternPtr->classPtr->drawRectangleProc)(tkwin, drawable, patternPtr,
- 0, h - highlightThickness, w, highlightThickness);
- /* Left */
- (*patternPtr->classPtr->drawRectangleProc)(tkwin, drawable, patternPtr,
- 0, highlightThickness, highlightThickness, h - 2 * highlightThickness);
- /* Right */
- (*patternPtr->classPtr->drawRectangleProc)(tkwin, drawable, patternPtr,
- w - highlightThickness, highlightThickness, highlightThickness,
- h - 2 * highlightThickness);
-}
-
-
-#ifdef notdef
-static void
-Draw3DRectangle(Tk_Window tkwin, Drawable drawable, Background *bgPtr,
- int x, int y, int w, int h, int borderWidth, int relief)
-{
- int nSegments;
- XSegment *segments, *sp;
- int i;
-
- nSegments = borderWidth + borderWidth;
- segments = Blt_AssertMalloc(sizeof(XSegment) * nSegments);
- sp = segments;
- for (i = 0; i < borderWidth; i++) {
- sp->x1 = x + i;
- sp->y1 = y + i;
- sp->x2 = x + (w - 1) - i;
- sp->y2 = y + i;
- sp++;
- sp->x1 = x + i;
- sp->y1 = y + i;
- sp->x2 = x + i;
- sp->y2 = y + (h - 1) - i;
- sp++;
- }
- gc = Tk_3DBorderGC(tkwin, bgPtr->corePtr->border, TK_3D_LIGHT_GC);
- XDrawSegments(Tk_Display(tkwin), drawable, gc, segments, nSegments);
-
- sp = segments;
- for (i = 0; i < borderWidth; i++) {
- sp->x1 = x + i;
- sp->y1 = y + (h - 1) - i;
- sp->x2 = x + (w - 1) - i;
- sp->y2 = y + (h - 1) - i;
- sp++;
- sp->x1 = x + (w - 1 ) - i;
- sp->y1 = y + i;
- sp->x2 = x + (w - 1) - i;
- sp->y2 = y + (h - 1) - i;
- sp++;
- }
- gc = Tk_3DBorderGC(tkwin, bgPtr->corePtr->border, TK_3D_DARK_GC);
- XDrawSegments(Tk_Display(tkwin), drawable, gc, segments, nSegments);
-}
-#endif
-
-#ifdef notdef
-void
-Blt_SetBackgroundRegion(Background *bgPtr, int x, int y, int w, int h)
-{
- if (bgPtr->corePtr->reference == REFERENCE_NONE) {
- bgPtr->corePtr->refRegion.x = x;
- bgPtr->corePtr->refRegion.y = y;
- bgPtr->corePtr->refRegion.width = w;
- bgPtr->corePtr->refRegion.height = h;
- }
-}
-#endif
-
-void
-Blt_SetBackgroundFromBackground(Tk_Window tkwin, Background *bgPtr)
-{
- Tk_SetBackgroundFromBorder(tkwin, bgPtr->corePtr->border);
-}
-
-GC
-Blt_BackgroundBorderGC(Tk_Window tkwin, Background *bgPtr, int which)
-{
- return Tk_3DBorderGC(tkwin, bgPtr->corePtr->border, which);
-}
-
-void
-Blt_SetBackgroundClipRegion(Tk_Window tkwin, Background *bgPtr, TkRegion rgn)
-{
- Blt_Painter painter;
- Display *display;
- GC gc;
-
- display = Tk_Display(tkwin);
- gc = Tk_3DBorderGC(tkwin, bgPtr->corePtr->border, TK_3D_LIGHT_GC);
- TkSetRegion(display, gc, rgn);
- gc = Tk_3DBorderGC(tkwin, bgPtr->corePtr->border, TK_3D_DARK_GC);
- TkSetRegion(display, gc, rgn);
- gc = Tk_3DBorderGC(tkwin, bgPtr->corePtr->border, TK_3D_FLAT_GC);
- TkSetRegion(display, gc, rgn);
- painter = Blt_GetPainter(tkwin, 1.0);
- gc = Blt_PainterGC(painter);
- TkSetRegion(display, gc, rgn);
-}
-
-
-void
-Blt_UnsetBackgroundClipRegion(Tk_Window tkwin, Background *bgPtr)
-{
- Blt_Painter painter;
- Display *display;
- GC gc;
-
- display = Tk_Display(tkwin);
- gc = Tk_3DBorderGC(tkwin, bgPtr->corePtr->border, TK_3D_LIGHT_GC);
- XSetClipMask(display, gc, None);
- gc = Tk_3DBorderGC(tkwin, bgPtr->corePtr->border, TK_3D_DARK_GC);
- XSetClipMask(display, gc, None);
- gc = Tk_3DBorderGC(tkwin, bgPtr->corePtr->border, TK_3D_FLAT_GC);
- XSetClipMask(display, gc, None);
- painter = Blt_GetPainter(tkwin, 1.0);
- gc = Blt_PainterGC(painter);
- XSetClipMask(display, gc, None);
-}
diff --git a/blt3.0.1/src/bltBgStyle.h b/blt3.0.1/src/bltBgStyle.h
deleted file mode 100644
index 8a43639..0000000
--- a/blt3.0.1/src/bltBgStyle.h
+++ /dev/null
@@ -1,87 +0,0 @@
-
-/*
- * bltBgPattern.h --
- *
- * Copyright 1995-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_BGPATTERN_H
-#define _BLT_BGPATTERN_H
-
-typedef struct _Blt_Background *Blt_Background;
-
-typedef void Blt_BackgroundChangedProc(ClientData clientData);
-
-BLT_EXTERN Blt_Background Blt_GetBackground(Tcl_Interp *interp, Tk_Window tkwin,
- const char *styleName);
-
-BLT_EXTERN Blt_Background Blt_GetBackgroundFromObj(Tcl_Interp *interp,
- Tk_Window tkwin, Tcl_Obj *objPtr);
-
-BLT_EXTERN XColor *Blt_BackgroundBorderColor(Blt_Background bg);
-
-BLT_EXTERN Tk_3DBorder Blt_BackgroundBorder(Blt_Background bg);
-
-BLT_EXTERN const char *Blt_NameOfBackground(Blt_Background bg);
-
-BLT_EXTERN void Blt_FreeBackground(Blt_Background bg);
-
-BLT_EXTERN void Blt_DrawBackgroundRectangle(Tk_Window tkwin, Drawable drawable,
- Blt_Background bg, int x, int y, int width, int height, int borderWidth,
- int relief);
-
-BLT_EXTERN void Blt_FillBackgroundRectangle(Tk_Window tkwin, Drawable drawable,
- Blt_Background bg, int x, int y, int width, int height,
- int borderWidth, int relief);
-
-BLT_EXTERN void Blt_DrawBackgroundPolygon(Tk_Window tkwin, Drawable drawable,
- Blt_Background bg, XPoint *points, int nPoints, int borderWidth,
- int leftRelief);
-
-BLT_EXTERN void Blt_FillBackgroundPolygon(Tk_Window tkwin, Drawable drawable,
- Blt_Background bg, XPoint *points, int nPoints, int borderWidth,
- int leftRelief);
-
-BLT_EXTERN void Blt_GetBackgroundOrigin(Blt_Background bg, int *xPtr,int *yPtr);
-
-BLT_EXTERN void Blt_SetBackgroundChangedProc(Blt_Background bg,
- Blt_BackgroundChangedProc *notifyProc, ClientData clientData);
-
-BLT_EXTERN void Blt_SetBackgroundOrigin(Tk_Window tkwin, Blt_Background bg,
- int x, int y);
-
-BLT_EXTERN void Blt_DrawFocusBackground(Tk_Window tkwin, Blt_Background bg,
- int highlightWidth, Drawable drawable);
-
-BLT_EXTERN GC Blt_BackgroundBorderGC(Tk_Window tkwin, Blt_Background bg,
- int which);
-
-BLT_EXTERN void Blt_SetBackgroundFromBackground(Tk_Window tkwin,
- Blt_Background bg);
-
-BLT_EXTERN void Blt_UnsetBackgroundClipRegion(Tk_Window tkwin,
- Blt_Background bg);
-
-BLT_EXTERN void Blt_SetBackgroundClipRegion(Tk_Window tkwin, Blt_Background bg,
- TkRegion rgn);
-
-#endif /* BLT_BGPATTERN_H */
diff --git a/blt3.0.1/src/bltBgexec.c b/blt3.0.1/src/bltBgexec.c
deleted file mode 100644
index 0cacbe9..0000000
--- a/blt3.0.1/src/bltBgexec.c
+++ /dev/null
@@ -1,1971 +0,0 @@
-
-/*
- * bltBgexec.c --
- *
- * This module implements a background "exec" command for the BLT toolkit.
- *
- * Copyright 1993-1998 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_BGEXEC
-
-#include <fcntl.h>
-#include <signal.h>
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#include <sys/types.h>
-
-#include "bltWait.h"
-#include "bltSwitch.h"
-#include "bltChain.h"
-
-static Tcl_ObjCmdProc BgexecCmd;
-
-#define WINDEBUG 0
-
-#if (_TCL_VERSION < _VERSION(8,1,0))
-typedef void *Tcl_Encoding; /* Make up dummy type for encoding. */
-#endif
-
-#define ENCODING_ASCII ((Tcl_Encoding)NULL)
-#define ENCODING_BINARY ((Tcl_Encoding)1)
-
-/*
- * This module creates a replacement of the old Tcl_CreatePipeline call in
- * the TCL C library. The prescribed workaround is Tcl_OpenCommandChannel.
- * But it hides the pids of the pipeline away (unless of course you pry open
- * the undocumented structure PipeStatus as clientData). The bigger problem
- * is that I couldn't figure any way to make one side of the pipe to be
- * non-blocking.
- */
-
-#ifdef WIN32
-#define read(fd, buf, size) Blt_AsyncRead((fd),(buf),(size))
-#define close(fd) CloseHandle((HANDLE)fd)
-#define Tcl_CreateFileHandler Blt_CreateFileHandler
-#define Tcl_DeleteFileHandler Blt_DeleteFileHandler
-#define kill KillProcess
-#define waitpid WaitProcess
-#endif
-
-#define BGEXEC_THREAD_KEY "BLT Bgexec Data"
-
-#define READ_AGAIN (0)
-#define READ_EOF (-1)
-#define READ_ERROR (-2)
-
-/* The wait-related definitions are taken from tclUnix.h */
-
-#define TRACE_FLAGS (TCL_TRACE_WRITES | TCL_TRACE_UNSETS | TCL_GLOBAL_ONLY)
-
-#define BLOCK_SIZE 1024 /* Size of allocation blocks for
- * buffer */
-#define DEF_BUFFER_SIZE (BLOCK_SIZE * 8)
-#define MAX_READS 100 /* Maximum # of successful reads
- * before stopping to let TCL catch up
- * on events */
-#ifndef NSIG
-#define NSIG 32 /* # of signals available */
-#endif /*NSIG*/
-
-#ifndef SIGINT
-#define SIGINT 2
-#endif /* SIGINT */
-
-#ifndef SIGQUIT
-#define SIGQUIT 3
-#endif /* SIGQUIT */
-
-#ifndef SIGKILL
-#define SIGKILL 9
-#endif /* SIGKILL */
-
-#ifndef SIGTERM
-#define SIGTERM 14
-#endif /* SIGTERM */
-
-typedef struct {
- int number;
- const char *name;
-} SignalToken;
-
-static SignalToken signalTokens[] =
-{
-#ifdef SIGABRT
- {SIGABRT, "SIGABRT"},
-#endif
-#ifdef SIGALRM
- {SIGALRM, "SIGALRM"},
-#endif
-#ifdef SIGBUS
- {SIGBUS, "SIGBUS"},
-#endif
-#ifdef SIGCHLD
- {SIGCHLD, "SIGCHLD"},
-#endif
-#if defined(SIGCLD) && (!defined(SIGCHLD) || (SIGCLD != SIGCHLD))
- {SIGCLD, "SIGCLD"},
-#endif
-#ifdef SIGCONT
- {SIGCONT, "SIGCONT"},
-#endif
-#if defined(SIGEMT) && (!defined(SIGXCPU) || (SIGEMT != SIGXCPU))
- {SIGEMT, "SIGEMT"},
-#endif
-#ifdef SIGFPE
- {SIGFPE, "SIGFPE"},
-#endif
-#ifdef SIGHUP
- {SIGHUP, "SIGHUP"},
-#endif
-#ifdef SIGILL
- {SIGILL, "SIGILL"},
-#endif
-#ifdef SIGINT
- {SIGINT, "SIGINT"},
-#endif
-#ifdef SIGIO
- {SIGIO, "SIGIO"},
-#endif
-#if defined(SIGIOT) && (!defined(SIGABRT) || (SIGIOT != SIGABRT))
- {SIGIOT, "SIGIOT"},
-#endif
-#ifdef SIGKILL
- {SIGKILL, "SIGKILL"},
-#endif
-#if defined(SIGLOST) && (!defined(SIGIOT) || (SIGLOST != SIGIOT)) && (!defined(SIGURG) || (SIGLOST != SIGURG))
- {SIGLOST, "SIGLOST"},
-#endif
-#ifdef SIGPIPE
- {SIGPIPE, "SIGPIPE"},
-#endif
-#if defined(SIGPOLL) && (!defined(SIGIO) || (SIGPOLL != SIGIO))
- {SIGPOLL, "SIGPOLL"},
-#endif
-#ifdef SIGPROF
- {SIGPROF, "SIGPROF"},
-#endif
-#if defined(SIGPWR) && (!defined(SIGXFSZ) || (SIGPWR != SIGXFSZ))
- {SIGPWR, "SIGPWR"},
-#endif
-#ifdef SIGQUIT
- {SIGQUIT, "SIGQUIT"},
-#endif
-#ifdef SIGSEGV
- {SIGSEGV, "SIGSEGV"},
-#endif
-#ifdef SIGSTOP
- {SIGSTOP, "SIGSTOP"},
-#endif
-#ifdef SIGSYS
- {SIGSYS, "SIGSYS"},
-#endif
-#ifdef SIGTERM
- {SIGTERM, "SIGTERM"},
-#endif
-#ifdef SIGTRAP
- {SIGTRAP, "SIGTRAP"},
-#endif
-#ifdef SIGTSTP
- {SIGTSTP, "SIGTSTP"},
-#endif
-#ifdef SIGTTIN
- {SIGTTIN, "SIGTTIN"},
-#endif
-#ifdef SIGTTOU
- {SIGTTOU, "SIGTTOU"},
-#endif
-#if defined(SIGURG) && (!defined(SIGIO) || (SIGURG != SIGIO))
- {SIGURG, "SIGURG"},
-#endif
-#if defined(SIGUSR1) && (!defined(SIGIO) || (SIGUSR1 != SIGIO))
- {SIGUSR1, "SIGUSR1"},
-#endif
-#if defined(SIGUSR2) && (!defined(SIGURG) || (SIGUSR2 != SIGURG))
- {SIGUSR2, "SIGUSR2"},
-#endif
-#ifdef SIGVTALRM
- {SIGVTALRM, "SIGVTALRM"},
-#endif
-#ifdef SIGWINCH
- {SIGWINCH, "SIGWINCH"},
-#endif
-#ifdef SIGXCPU
- {SIGXCPU, "SIGXCPU"},
-#endif
-#ifdef SIGXFSZ
- {SIGXFSZ, "SIGXFSZ"},
-#endif
- {-1, "unknown signal"},
-};
-
-#ifdef TCL_THREADS
-static Tcl_Mutex *mutexPtr = NULL;
-#endif
-static Blt_Chain activePipelines; /* List of active pipelines and their
- * bgexec structures. */
-
-/*
- * Sink buffer:
- * ____________________
- * | | "size" current allocated length of buffer.
- * | |
- * |--------------------| "fill" fill point (# characters in buffer).
- * | Raw |
- * |--------------------| "mark" Marks end of cooked characters.
- * | |
- * | Cooked |
- * | |
- * | |
- * |--------------------| "lastMark" Mark end of processed characters.
- * | |
- * | |
- * | Processed |
- * | |
- * |____________________| 0
- */
-typedef struct {
- const char *name; /* Name of the sink */
- const char *doneVar; /* Name of a TCL variable (malloc'ed)
- * set to the collected data of the
- * last UNIX * subprocess. */
- const char *updateVar; /* Name of a TCL variable (malloc'ed)
- * updated as data is read from the
- * pipe. */
- Tcl_Obj *cmdObjPtr; /* Start of a TCL command executed
- * whenever data is read from the
- * pipe. */
- int flags;
- Tcl_Encoding encoding; /* Decoding scheme to use when
- * translating data. */
- int fd; /* File descriptor of the pipe. */
- int status;
- int echo; /* Indicates if the pipeline's stderr
- * stream should be echoed */
-
- unsigned char *bytes; /* Stores pipeline output (malloc-ed):
- * Initially points to static
- * storage */
- int size; /* Size of dynamically allocated
- * buffer. */
-
- int fill; /* # of bytes read into the
- * buffer. Marks the current fill
- * point of the buffer. */
-
- int mark; /* # of bytes translated (cooked). */
- int lastMark; /* # of bytes as of the last read. This
- * indicates the start of the new data
- * in the buffer since the last time
- * the "update" variable was set. */
- unsigned char staticSpace[DEF_BUFFER_SIZE]; /* Static space */
-
-} Sink;
-
-#define SINK_BUFFERED (1<<0)
-#define SINK_KEEP_NL (1<<1)
-#define SINK_NOTIFY (1<<2)
-
-typedef struct {
- const char *statVar; /* Name of a TCL variable set to the
- * exit status of the last
- * process. Setting this variable
- * triggers the termination of all
- * subprocesses (regardless whether
- * they have already completed) */
- int signalNum; /* If non-zero, indicates the signal
- * to send subprocesses when cleaning
- * up.*/
- unsigned int flags; /* Various bit flags: see below. */
- int interval; /* Interval to poll for the exiting
- * processes */
- /* Private */
- Tcl_Interp *interp; /* Interpreter containing variables */
- int nProcs; /* # of processes in pipeline */
- ProcessId *procIds; /* Array of process tokens from
- * pipeline. Under Unix, tokens are
- * pid_t, while for Win32 they're
- * handles. */
- Tcl_TimerToken timerToken; /* Token for timer handler which polls
- * for the exit status of each
- * sub-process. If zero, there's no
- * timer handler queued. */
- int *exitCodePtr; /* Pointer to a memory location to
- * contain the last process' exit
- * code. */
- int *donePtr;
- Sink err, out; /* Data sinks for pipeline's output
- * and error channels. */
- Blt_ChainLink link;
-} Bgexec;
-
-#define KEEPNEWLINE (1<<0) /* Indicates to set TCL output
- * variables with trailing newlines
- * intact */
-#define LINEBUFFERED (1<<1) /* Indicates to provide data to update
- * variable and update proc on a
- * line-by-line * basis. */
-#define IGNOREEXITCODE (1<<2) /* Don't check for 0 exit status of
- * the pipeline. */
-#define TRACED (1<<3) /* Indicates that the status variable
- * is currently being traced. */
-#define DETACHED (1<<4) /* Indicates that the pipeline is
- * detached from standard I/O, running
- * in the background. */
-
-static Blt_SwitchParseProc ObjToSignalProc;
-static Blt_SwitchCustom killSignalSwitch =
-{
- ObjToSignalProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc ObjToEncodingProc;
-static Blt_SwitchFreeProc FreeEncodingProc;
-static Blt_SwitchCustom encodingSwitch =
-{
- ObjToEncodingProc, FreeEncodingProc, (ClientData)0,
-};
-
-static Blt_SwitchSpec switchSpecs[] =
-{
- {BLT_SWITCH_CUSTOM, "-decodeoutput", "encoding",
- Blt_Offset(Bgexec, out.encoding), 0, 0, &encodingSwitch},
- {BLT_SWITCH_CUSTOM, "-decodeerror", "encoding",
- Blt_Offset(Bgexec, err.encoding), 0, 0, &encodingSwitch},
- {BLT_SWITCH_BOOLEAN, "-echo", "bool",
- Blt_Offset(Bgexec, err.echo), 0},
- {BLT_SWITCH_STRING, "-error", "variable",
- Blt_Offset(Bgexec, err.doneVar), 0},
- {BLT_SWITCH_STRING, "-update", "variable",
- Blt_Offset(Bgexec, out.updateVar), 0},
- {BLT_SWITCH_STRING, "-output", "variable",
- Blt_Offset(Bgexec, out.doneVar), 0},
- {BLT_SWITCH_STRING, "-lasterror", "variable",
- Blt_Offset(Bgexec, err.updateVar), 0},
- {BLT_SWITCH_STRING, "-lastoutput", "variable",
- Blt_Offset(Bgexec, out.updateVar), 0},
- {BLT_SWITCH_OBJ, "-onerror", "command",
- Blt_Offset(Bgexec, err.cmdObjPtr), 0},
- {BLT_SWITCH_OBJ, "-onoutput", "command",
- Blt_Offset(Bgexec, out.cmdObjPtr), 0},
- {BLT_SWITCH_BOOLEAN, "-keepnewline", "bool",
- Blt_Offset(Bgexec, flags), 0, KEEPNEWLINE},
- {BLT_SWITCH_INT, "-check", "interval",
- Blt_Offset(Bgexec, interval), 0},
- {BLT_SWITCH_CUSTOM, "-killsignal", "signal",
- Blt_Offset(Bgexec, signalNum), 0, 0, &killSignalSwitch},
- {BLT_SWITCH_BOOLEAN, "-linebuffered", "bool",
- Blt_Offset(Bgexec, flags), 0, LINEBUFFERED},
- {BLT_SWITCH_BOOLEAN, "-ignoreexitcode", "bool",
- Blt_Offset(Bgexec, flags), 0, IGNOREEXITCODE},
- {BLT_SWITCH_END}
-};
-
-static Tcl_VarTraceProc VariableProc;
-static Tcl_TimerProc TimerProc;
-static Tcl_FileProc StdoutProc, StderrProc;
-static Tcl_ExitProc BgexecExitProc;
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToSignalProc --
- *
- * Convert a Tcl_Obj representing a signal number into its integer
- * value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToSignalProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Intrepreter to return results */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* Value representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- char *string;
- int *signalPtr = (int *)(record + offset);
- int signalNum;
-
- string = Tcl_GetString(objPtr);
- if (string[0] == '\0') {
- *signalPtr = 0;
- return TCL_OK;
- }
- if (isdigit(UCHAR(string[0]))) {
- if (Tcl_GetIntFromObj(interp, objPtr, &signalNum) != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- char *name;
- SignalToken *sp;
-
- name = string;
-
- /* Clip off any "SIG" prefix from the signal name */
- if ((name[0] == 'S') && (name[1] == 'I') && (name[2] == 'G')) {
- name += 3;
- }
- signalNum = -1;
- for (sp = signalTokens; sp->number > 0; sp++) {
- if (strcmp(sp->name + 3, name) == 0) {
- signalNum = sp->number;
- break;
- }
- }
- if (signalNum < 0) {
- Tcl_AppendResult(interp, "unknown signal \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- }
- if ((signalNum < 0) || (signalNum > NSIG)) {
- /* Outside range of signals */
- Tcl_AppendResult(interp, "signal number \"", string,
- "\" is out of range", (char *)NULL);
- return TCL_ERROR;
- }
- *signalPtr = signalNum;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToEncodingProc --
- *
- * Convert a Tcl_Obj representing a encoding into a Tcl_Encoding.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToEncodingProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Intrepreter to return results */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* Value representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Tcl_Encoding *encodingPtr = (Tcl_Encoding *)(record + offset);
- Tcl_Encoding encoding;
- const char *name;
-
- name = Tcl_GetString(objPtr);
- encoding = ENCODING_ASCII;
- if (name != NULL) {
- if (strcmp(name, "binary") == 0) {
- encoding = ENCODING_BINARY;
- } else {
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- encoding = Tcl_GetEncoding(interp, name);
- if (encoding == NULL) {
- return TCL_ERROR;
- }
-#endif
- }
- }
- if ((*encodingPtr != ENCODING_BINARY) && (*encodingPtr != ENCODING_ASCII)) {
- Tcl_FreeEncoding(*encodingPtr);
- }
- *encodingPtr = encoding;
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static void
-FreeEncodingProc(char *record, int offset, int flags)
-{
- Tcl_Encoding *encodingPtr = (Tcl_Encoding *)(record + offset);
-
- if ((*encodingPtr != ENCODING_BINARY) && (*encodingPtr != ENCODING_ASCII)) {
- Tcl_FreeEncoding(*encodingPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetSinkData --
- *
- * Returns the data currently saved in the buffer
- *
- *---------------------------------------------------------------------------
- */
-static void
-GetSinkData(Sink *sinkPtr, unsigned char **dataPtr, int *lengthPtr)
-{
- int length;
-
- sinkPtr->bytes[sinkPtr->mark] = '\0';
- length = sinkPtr->mark;
- if ((sinkPtr->mark > 0) && (sinkPtr->encoding != ENCODING_BINARY)) {
- unsigned char *last;
-
- last = sinkPtr->bytes + (sinkPtr->mark - 1);
- if (((sinkPtr->flags & SINK_KEEP_NL) == 0) && (*last == '\n')) {
- length--;
- }
- }
- *dataPtr = sinkPtr->bytes;
- *lengthPtr = length;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextBlock --
- *
- * Returns the next block of data since the last time this routine was
- * called.
- *
- *---------------------------------------------------------------------------
- */
-static unsigned char *
-NextBlock(Sink *sinkPtr, int *lengthPtr)
-{
- unsigned char *string;
- int length;
-
- string = sinkPtr->bytes + sinkPtr->lastMark;
- length = sinkPtr->mark - sinkPtr->lastMark;
- sinkPtr->lastMark = sinkPtr->mark;
- if (length > 0) {
- if ((!(sinkPtr->flags & SINK_KEEP_NL)) && (string[length-1] == '\n')) {
- length--;
- }
- *lengthPtr = length;
- return string;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextLine --
- *
- * Returns the next line of data.
- *
- *---------------------------------------------------------------------------
- */
-static unsigned char *
-NextLine(Sink *sinkPtr, int *lengthPtr)
-{
- if (sinkPtr->mark > sinkPtr->lastMark) {
- unsigned char *string;
- int newBytes;
- int i;
-
- string = sinkPtr->bytes + sinkPtr->lastMark;
- newBytes = sinkPtr->mark - sinkPtr->lastMark;
- for (i = 0; i < newBytes; i++) {
- if (string[i] == '\n') {
- int length;
-
- length = i + 1;
- sinkPtr->lastMark += length;
- if (!(sinkPtr->flags & SINK_KEEP_NL)) {
- length--; /* Backup over the newline. */
- }
- *lengthPtr = length;
- return string;
- }
- }
- /* Newline not found. On errors or EOF, also return a partial line. */
- if (sinkPtr->status < 0) {
- *lengthPtr = newBytes;
- sinkPtr->lastMark = sinkPtr->mark;
- return string;
- }
- }
- return NULL;
-}
-/*
- *---------------------------------------------------------------------------
- *
- * ResetSink --
- *
- * Removes the bytes already processed from the buffer, possibly
- * resetting it to empty. This used when we don't care about keeping all
- * the data collected from the channel (no -output flag and the process
- * is detached).
- *
- *---------------------------------------------------------------------------
- */
-static void
-ResetSink(Sink *sinkPtr)
-{
- if ((sinkPtr->flags & SINK_BUFFERED) &&
- (sinkPtr->fill > sinkPtr->lastMark)) {
- int i, j;
-
- /* There may be bytes remaining in the buffer, awaiting another read
- * before we see the next newline. So move the bytes to the front of
- * the array. */
-
- for (i = 0, j = sinkPtr->lastMark; j < sinkPtr->fill; i++, j++) {
- sinkPtr->bytes[i] = sinkPtr->bytes[j];
- }
- /* Move back the fill point and processed point. */
- sinkPtr->fill -= sinkPtr->lastMark;
- sinkPtr->mark -= sinkPtr->lastMark;
- } else {
- sinkPtr->mark = sinkPtr->fill = 0;
- }
- sinkPtr->lastMark = 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InitSink --
- *
- * Initializes the buffer's storage.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Storage is cleared.
- *
- *---------------------------------------------------------------------------
- */
-static void
-InitSink(Bgexec *bgPtr, Sink *sinkPtr, const char *name)
-{
- sinkPtr->name = name;
- sinkPtr->echo = FALSE;
- sinkPtr->fd = -1;
- sinkPtr->bytes = sinkPtr->staticSpace;
- sinkPtr->size = DEF_BUFFER_SIZE;
-
- if (bgPtr->flags & KEEPNEWLINE) {
- sinkPtr->flags |= SINK_KEEP_NL;
- }
- if (bgPtr->flags & LINEBUFFERED) {
- sinkPtr->flags |= SINK_BUFFERED;
- }
- if ((sinkPtr->cmdObjPtr != NULL) ||
- (sinkPtr->updateVar != NULL) ||
- (sinkPtr->echo)) {
- sinkPtr->flags |= SINK_NOTIFY;
- }
- ResetSink(sinkPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeSinkBuffer --
- *
- * Frees the buffer's storage, freeing any malloc'ed space.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeSinkBuffer(Sink *sinkPtr)
-{
- if (sinkPtr->bytes != sinkPtr->staticSpace) {
- Blt_Free(sinkPtr->bytes);
- }
- sinkPtr->fd = -1;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExtendSinkBuffer --
- *
- * Doubles the size of the current buffer.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ExtendSinkBuffer(Sink *sinkPtr)
-{
- unsigned char *bytes;
- /*
- * Allocate a new array, double the old size
- */
- sinkPtr->size += sinkPtr->size;
- bytes = Blt_Malloc(sizeof(unsigned char) * sinkPtr->size);
- if (bytes != NULL) {
- unsigned char *sp, *dp, *send;
-
- dp = bytes;
- for (sp = sinkPtr->bytes, send = sp + sinkPtr->fill; sp < send;
- /*empty*/) {
- *dp++ = *sp++;
- }
- if (sinkPtr->bytes != sinkPtr->staticSpace) {
- Blt_Free(sinkPtr->bytes);
- }
- sinkPtr->bytes = bytes;
- return (sinkPtr->size - sinkPtr->fill); /* Return bytes left. */
- }
- return -1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReadBytes --
- *
- * Reads and appends any available data from a given file descriptor
- * to the buffer.
- *
- * Results:
- * Returns TCL_OK when EOF is found, TCL_RETURN if reading data would
- * block, and TCL_ERROR if an error occurred.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ReadBytes(Sink *sinkPtr)
-{
- int i;
- int nBytes;
-
- /*
- * Worry about indefinite postponement.
- *
- * Typically we want to stay in the read loop as long as it takes to
- * collect all the data that's currently available. But if it's coming
- * in at a constant high rate, we need to arbitrarily break out at some
- * point. This allows for both setting the update variable and the Tk
- * program to handle idle events.
- */
- nBytes = 0;
- for (i = 0; i < MAX_READS; i++) {
- int bytesLeft;
- unsigned char *array;
-
- /* Allocate a larger buffer when the number of remaining bytes is
- * below the threshold BLOCK_SIZE. */
-
- bytesLeft = sinkPtr->size - sinkPtr->fill;
-
- if (bytesLeft < BLOCK_SIZE) {
- bytesLeft = ExtendSinkBuffer(sinkPtr);
- if (bytesLeft < 0) {
- errno = ENOMEM;
- sinkPtr->status = READ_ERROR;
- return;
- }
- }
- array = sinkPtr->bytes + sinkPtr->fill;
-
- /* Read into a buffer but make sure we leave room for a trailing NUL
- * byte. */
- nBytes = read(sinkPtr->fd, array, bytesLeft - 1);
- if (nBytes == 0) { /* EOF: break out of loop. */
- sinkPtr->status = READ_EOF;
- return;
- }
- if (nBytes < 0) {
-#ifdef O_NONBLOCK
-#define BLOCKED EAGAIN
-#else
-#define BLOCKED EWOULDBLOCK
-#endif /*O_NONBLOCK*/
- /* Either an error has occurred or no more data is currently
- * available to read. */
- if (errno == BLOCKED) {
- sinkPtr->status = READ_AGAIN;
- return;
- }
- sinkPtr->bytes[0] = '\0';
- sinkPtr->status = READ_ERROR;
- return;
- }
- sinkPtr->fill += nBytes;
- sinkPtr->bytes[sinkPtr->fill] = '\0';
- }
- sinkPtr->status = nBytes;
-}
-
-#define SINKOPEN(sinkPtr) ((sinkPtr)->fd != -1)
-
-static void
-CloseSink(Tcl_Interp *interp, Sink *sinkPtr)
-{
- if (SINKOPEN(sinkPtr)) {
- close(sinkPtr->fd);
- Tcl_DeleteFileHandler(sinkPtr->fd);
- sinkPtr->fd = -1;
-
-#if WINDEBUG
- PurifyPrintf("CloseSink: set done var %s\n", sinkPtr->name);
-#endif
- if (sinkPtr->doneVar != NULL) {
- unsigned char *data;
- int length;
- /*
- * If data is to be collected, set the "done" variable with the
- * contents of the buffer.
- */
- GetSinkData(sinkPtr, &data, &length);
-#if (_TCL_VERSION < _VERSION(8,1,0))
- data[length] = '\0';
- if (Tcl_SetVar(interp, sinkPtr->doneVar, data,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_BackgroundError(interp);
- }
-#else
- if (Tcl_SetVar2Ex(interp, sinkPtr->doneVar, NULL,
- Tcl_NewByteArrayObj(data, (int)length),
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_BackgroundError(interp);
- }
-#endif
- }
-#if WINDEBUG
- PurifyPrintf("CloseSink %s: done\n", sinkPtr->name);
-#endif
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CookSink --
- *
- * For Windows, translate CR/NL combinations to NL alone.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of the byte array may shrink and array contents shifted as
- * carriage returns are found and removed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-CookSink(Tcl_Interp *interp, Sink *sinkPtr)
-{
- unsigned char *srcPtr, *endPtr;
-#ifdef WIN32
- int oldMark;
-
- oldMark = sinkPtr->mark;
-#endif
- if (sinkPtr->encoding == ENCODING_BINARY) { /* binary */
- /* No translation needed. */
- sinkPtr->mark = sinkPtr->fill;
- } else if (sinkPtr->encoding == ENCODING_ASCII) { /* ascii */
-#if (_TCL_VERSION < _VERSION(8,1,0))
- /* Convert NUL bytes to question marks. */
- srcPtr = sinkPtr->bytes + sinkPtr->mark;
- endPtr = sinkPtr->bytes + sinkPtr->fill;
- while (srcPtr < endPtr) {
- if (*srcPtr == '\0') {
- *srcPtr = '?';
- }
- srcPtr++;
- }
-#endif /* < 8.1.0 */
- /* One-to-one translation. mark == fill. */
- sinkPtr->mark = sinkPtr->fill;
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- } else { /* unicode. */
- int nSrcCooked, nCooked;
- int result;
- int cookedSize, spaceLeft, needed;
- int nRaw, nLeftOver;
- unsigned char *destPtr;
- unsigned char *raw, *cooked;
- unsigned char leftover[100];
-
- raw = sinkPtr->bytes + sinkPtr->mark;
- nRaw = sinkPtr->fill - sinkPtr->mark;
- /* Ideally, the cooked buffer size should be smaller */
- cookedSize = nRaw * TCL_UTF_MAX + 1;
- cooked = Blt_AssertMalloc(cookedSize);
- result = Tcl_ExternalToUtf(interp, sinkPtr->encoding,
- (char *)raw, nRaw, 0, NULL, (char *)cooked,
- cookedSize, &nSrcCooked, &nCooked, NULL);
- nLeftOver = 0;
- if (result == TCL_CONVERT_MULTIBYTE) {
- /*
- * Last multibyte sequence wasn't completed. Save the extra
- * characters in a temporary buffer.
- */
- nLeftOver = (nRaw - nSrcCooked);
- srcPtr = sinkPtr->bytes + (sinkPtr->mark + nSrcCooked);
- endPtr = srcPtr + nLeftOver;
- destPtr = leftover;
- while (srcPtr < endPtr) {
- *destPtr++ = *srcPtr++;
- }
- }
- /*
- * Create a bigger sink.
- */
-
- needed = nLeftOver + nCooked;
- spaceLeft = sinkPtr->size - sinkPtr->mark;
- if (spaceLeft >= needed) {
- spaceLeft = ExtendSinkBuffer(sinkPtr);
- }
- assert(spaceLeft > needed);
- /*
- * Replace the characters from the mark with the translated
- * characters.
- */
- srcPtr = cooked;
- endPtr = cooked + nCooked;
- destPtr = sinkPtr->bytes + sinkPtr->mark;
- while (srcPtr < endPtr) {
- *destPtr++ = *srcPtr++;
- }
- /* Add the number of newly translated characters to the mark */
- sinkPtr->mark += nCooked;
-
- srcPtr = leftover;
- endPtr = leftover + nLeftOver;
- while (srcPtr < endPtr) {
- *destPtr++ = *srcPtr++;
- }
- sinkPtr->fill = sinkPtr->mark + nLeftOver;
-#endif /* >= 8.1.0 */
- }
-#ifdef WIN32
- /*
- * Translate CRLF character sequences to LF characters. We have to do
- * this after converting the string to UTF from UNICODE.
- */
- if (sinkPtr->encoding != ENCODING_BINARY) {
- int count;
- unsigned char *destPtr;
-
- destPtr = srcPtr = sinkPtr->bytes + oldMark;
- endPtr = sinkPtr->bytes + sinkPtr->fill;
- *endPtr = '\0';
- count = 0;
- for (endPtr--; srcPtr < endPtr; srcPtr++) {
- if ((*srcPtr == '\r') && (*(srcPtr + 1) == '\n')) {
- count++;
- continue; /* Skip the CR in CR/LF sequences. */
- }
- if (srcPtr != destPtr) {
- *destPtr = *srcPtr; /* Collapse the string, overwriting
- * the \r's encountered. */
- }
- destPtr++;
- }
- sinkPtr->mark -= count;
- sinkPtr->fill -= count;
- *destPtr = *srcPtr; /* Copy the last byte */
- if (*destPtr == '\r') {
- sinkPtr->mark--;
- }
- }
-#endif /* WIN32 */
-}
-
-#ifdef WIN32
-/*
- *---------------------------------------------------------------------------
- *
- * WaitProcess --
- *
- * Emulates the waitpid system call under the Win32 API.
- *
- * Results:
- * Returns 0 if the process is still alive, -1 on an error, or the pid on
- * a clean close.
- *
- * Side effects:
- * Unless WNOHANG is set and the wait times out, the process information
- * record will be deleted and the process handle will be closed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-WaitProcess(
- ProcessId child,
- int *statusPtr,
- int flags)
-{
- DWORD status, exitCode;
- int result;
- int timeout;
-
-#if WINDEBUG
- PurifyPrintf("WAITPID(%x)\n", child.hProcess);
-#endif
- *statusPtr = 0;
- if (child.hProcess == INVALID_HANDLE_VALUE) {
- errno = EINVAL;
- return -1;
- }
-#if WINDEBUG
- PurifyPrintf("WAITPID: waiting for 0x%x\n", child.hProcess);
-#endif
- timeout = (flags & WNOHANG) ? 0 : INFINITE;
- status = WaitForSingleObject(child.hProcess, timeout);
-
-#if WINDEBUG
- PurifyPrintf("WAITPID: wait status is %d\n", status);
-#endif
- switch (status) {
- case WAIT_FAILED:
- errno = ECHILD;
- *statusPtr = ECHILD;
- result = -1;
- break;
-
- case WAIT_TIMEOUT:
- if (timeout == 0) {
- return 0; /* Try again */
- }
- result = 0;
- break;
-
- default:
- case WAIT_ABANDONED:
- case WAIT_OBJECT_0:
- GetExitCodeProcess(child.hProcess, &exitCode);
- *statusPtr = ((exitCode << 8) & 0xff00);
-#if WINDEBUG
- PurifyPrintf("WAITPID: exit code of %d is %d (%x)\n", child.hProcess,
- *statusPtr, exitCode);
-#endif
- result = child.pid;
- assert(result != -1);
- break;
- }
- CloseHandle(child.hProcess);
- return result;
-}
-
-static BOOL CALLBACK
-EnumWindowsProc(HWND hWnd, LPARAM lParam)
-{
- DWORD pid = 0;
- ProcessId *procPtr = (ProcessId *)lParam;
-
- GetWindowThreadProcessId(hWnd, &pid);
- if (pid == procPtr->pid) {
- PostMessage(hWnd, WM_CLOSE, 0, 0);
- }
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * KillProcess --
- *
- * Emulates the UNIX kill system call under Win32 API.
- *
- * Results:
- * Returns 0 if the process is killed, -1 on an error.
- *
- * Side effects:
- * Process is terminated.
- *
- *---------------------------------------------------------------------------
- */
-static int
-KillProcess(ProcessId proc, int signal)
-{
- DWORD status;
-
- if ((proc.hProcess == NULL) || (proc.hProcess == INVALID_HANDLE_VALUE)) {
- errno = EINVAL;
- return -1;
- }
-
- EnumWindows(EnumWindowsProc, (LPARAM)&proc);
-
- /*
- * Wait on the handle. If it signals, great. If it times out, then call
- * TerminateProcess on it.
- *
- * On Windows 95/98 this also has the added benefit of stopping
- * KERNEL32.dll from dumping. The 2 second number is arbitrary (1 second
- * seems to fail intermittently).
- */
- status = WaitForSingleObject(proc.hProcess, 2000);
- if (status == WAIT_OBJECT_0) {
- return 0;
- }
- if (!TerminateProcess(proc.hProcess, 1)) {
-#if WINDEBUG
- PurifyPrintf("can't terminate process (handle=%d): %s\n",
- proc.hProcess, Blt_LastError());
-#endif /* WINDEBUG */
- return -1;
- }
- return 0;
-}
-
-#endif /* WIN32 */
-
-#if (_TCL_VERSION < _VERSION(8,1,0))
-
-static void
-NotifyOnUpdate(Tcl_Interp *interp, Sink *sinkPtr, unsigned char *data,
- int nBytes)
-{
- char save;
-
-#if WINDEBUG
- PurifyPrintf("read %s\n", data);
-#endif
- if (data[0] == '\0') {
- return;
- }
- save = data[nBytes];
- data[nBytes] = '\0';
- if (sinkPtr->echo) {
- Tcl_Channel channel;
-
- channel = Tcl_GetStdChannel(TCL_STDERR);
- if (channel == NULL) {
- Tcl_AppendResult(interp, "can't get stderr channel", (char *)NULL);
- Tcl_BackgroundError(interp);
- sinkPtr->echo = FALSE;
- } else {
- Tcl_Write(channel, data, nBytes);
- if (save == '\n') {
- Tcl_Write(channel, "\n", 1);
- }
- Tcl_Flush(channel);
- }
- }
- objPtr = Tcl_NewByteArrayObj(data, (int)nBytes);
- Tcl_IncrRefCount(objPtr);
- if (sinkPtr->cmdObjPtr != NULL) {
- Tcl_Obj *cmdObjPtr, *objPtr;
- int result;
-
- cmdObjPtr = Tcl_DuplicateObj(sinkPtr->cmdObjPtr);
- Tcl_ListObjAppendElement(interp, cmdObjPtr, objPtr);
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- if (result != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
- }
- if (sinkPtr->updateVar != NULL) {
- if (Tcl_SetVar2Ex(interp, sinkPtr->updateVar, NULL, objPtr,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_BackgroundError(interp);
- }
- }
- Tcl_DecrRefCount(objPtr);
- data[nBytes] = save;
-}
-
-#else
-
-static void
-NotifyOnUpdate(Tcl_Interp *interp, Sink *sinkPtr, unsigned char *data,
- int nBytes)
-{
- Tcl_Obj *objPtr;
-
-#if WINDEBUG
- PurifyPrintf("read %s\n", data);
-#endif
- if ((nBytes == 0) || (data[0] == '\0')) {
- return;
- }
- if (sinkPtr->echo) {
- Tcl_Channel channel;
-
- channel = Tcl_GetStdChannel(TCL_STDERR);
- if (channel == NULL) {
- Tcl_AppendResult(interp, "can't get stderr channel", (char *)NULL);
- Tcl_BackgroundError(interp);
- sinkPtr->echo = FALSE;
- } else {
- if (data[nBytes] == '\n') {
- objPtr = Tcl_NewByteArrayObj(data, nBytes + 1);
- } else {
- objPtr = Tcl_NewByteArrayObj(data, nBytes);
- }
- Tcl_WriteObj(channel, objPtr);
- Tcl_Flush(channel);
- }
- }
-
- objPtr = Tcl_NewByteArrayObj(data, nBytes);
- Tcl_IncrRefCount(objPtr);
- if (sinkPtr->cmdObjPtr != NULL) {
- Tcl_Obj *cmdObjPtr;
- int result;
-
- cmdObjPtr = Tcl_DuplicateObj(sinkPtr->cmdObjPtr);
- Tcl_ListObjAppendElement(interp, cmdObjPtr, objPtr);
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- if (result != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
- }
- if (sinkPtr->updateVar != NULL) {
- if (Tcl_SetVar2Ex(interp, sinkPtr->updateVar, NULL, objPtr,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_BackgroundError(interp);
- }
- }
- Tcl_DecrRefCount(objPtr);
-}
-
-#endif /* < 8.1.0 */
-
-static int
-CollectData(Bgexec *bgPtr, Sink *sinkPtr)
-{
- if ((bgPtr->flags & DETACHED) && (sinkPtr->doneVar == NULL)) {
- ResetSink(sinkPtr);
- }
- ReadBytes(sinkPtr);
- CookSink(bgPtr->interp, sinkPtr);
- if ((sinkPtr->mark > sinkPtr->lastMark) && (sinkPtr->flags & SINK_NOTIFY)) {
- if (sinkPtr->flags & SINK_BUFFERED) {
- int length;
- unsigned char *data;
-
- /* For line-by-line updates, call NotifyOnUpdate for each new
- * complete line. */
- while ((data = NextLine(sinkPtr, &length)) != NULL) {
- NotifyOnUpdate(bgPtr->interp, sinkPtr, data, length);
- }
- } else {
- int length;
- unsigned char *data;
-
- length = 0; /* Suppress compiler warning. */
- data = NextBlock(sinkPtr, &length);
- NotifyOnUpdate(bgPtr->interp, sinkPtr, data, length);
- }
- }
- if (sinkPtr->status >= 0) {
- return TCL_OK;
- }
- if (sinkPtr->status == READ_ERROR) {
- Tcl_AppendResult(bgPtr->interp, "can't read data from ", sinkPtr->name,
- ": ", Tcl_PosixError(bgPtr->interp), (char *)NULL);
- Tcl_BackgroundError(bgPtr->interp);
- return TCL_ERROR;
- }
-#if WINDEBUG
- PurifyPrintf("CollectData %s: done\n", sinkPtr->name);
-#endif
- return TCL_RETURN;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateSinkHandler --
- *
- * Creates a file handler for the given sink. The file descriptor is
- * also set for non-blocking I/O.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The memory allocated to the Bgexec structure released.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateSinkHandler(Bgexec *bgPtr, Sink *sinkPtr, Tcl_FileProc *proc)
-{
-#ifndef WIN32
- int flags;
-
- flags = fcntl(sinkPtr->fd, F_GETFL);
-#ifdef O_NONBLOCK
- flags |= O_NONBLOCK;
-#else
- flags |= O_NDELAY;
-#endif
- if (fcntl(sinkPtr->fd, F_SETFL, flags) < 0) {
- Tcl_AppendResult(bgPtr->interp, "can't set file descriptor ",
- Blt_Itoa(sinkPtr->fd), " to non-blocking:",
- Tcl_PosixError(bgPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
-#endif /* WIN32 */
- Tcl_CreateFileHandler(sinkPtr->fd, TCL_READABLE, proc, bgPtr);
- return TCL_OK;
-}
-
-static void
-DisableTriggers(Bgexec *bgPtr) /* Background info record. */
-{
- if (bgPtr->flags & TRACED) {
- Tcl_UntraceVar(bgPtr->interp, bgPtr->statVar, TRACE_FLAGS,
- VariableProc, bgPtr);
- bgPtr->flags &= ~TRACED;
- }
- if (SINKOPEN(&bgPtr->out)) {
- CloseSink(bgPtr->interp, &bgPtr->out);
- }
- if (SINKOPEN(&bgPtr->err)) {
- CloseSink(bgPtr->interp, &bgPtr->err);
- }
- if (bgPtr->timerToken != (Tcl_TimerToken) 0) {
- Tcl_DeleteTimerHandler(bgPtr->timerToken);
- bgPtr->timerToken = 0;
- }
- if (bgPtr->donePtr != NULL) {
- *bgPtr->donePtr = TRUE;
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeBgexec --
- *
- * Releases the memory allocated for the backgrounded process.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeBgexec(Bgexec *bgPtr)
-{
- Blt_FreeSwitches(switchSpecs, (char *)bgPtr, 0);
- if (bgPtr->statVar != NULL) {
- Blt_Free(bgPtr->statVar);
- }
- if (bgPtr->procIds != NULL) {
- Blt_Free(bgPtr->procIds);
- }
- if (bgPtr->link != NULL) {
- Tcl_MutexLock(mutexPtr);
- Blt_Chain_DeleteLink(activePipelines, bgPtr->link);
- Tcl_MutexUnlock(mutexPtr);
- }
- Blt_Free(bgPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * KillProcesses --
- *
- * Cleans up background execution processes and memory.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The memory allocated to the Bgexec structure released.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-KillProcesses(Bgexec *bgPtr) /* Background info record. */
-{
- if (bgPtr->procIds != NULL) {
- int i;
-
- for (i = 0; i < bgPtr->nProcs; i++) {
- Tcl_Pid tclPid;
-
- if (bgPtr->signalNum > 0) {
- kill(bgPtr->procIds[i], bgPtr->signalNum);
- }
-#ifdef WIN32
- tclPid = (Tcl_Pid)bgPtr->procIds[i].pid;
-#else
- {
- unsigned long pid;
-
- pid = (long)bgPtr->procIds[i];
- tclPid = (Tcl_Pid)pid;
- }
-#endif /* WIN32 */
- Tcl_DetachPids(1, &tclPid);
- }
- }
- Tcl_ReapDetachedProcs();
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyBgexec --
- *
- * Cleans up background execution processes and memory.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The memory allocated to the Bgexec structure released.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-DestroyBgexec(Bgexec *bgPtr) /* Background info record. */
-{
- DisableTriggers(bgPtr);
- FreeSinkBuffer(&bgPtr->err);
- FreeSinkBuffer(&bgPtr->out);
- KillProcesses(bgPtr);
- FreeBgexec(bgPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * VariableProc --
- *
- * Kills all currently running subprocesses (given the specified
- * signal). This procedure is called when the user sets the status
- * variable associated with this group of child subprocesses.
- *
- * Results:
- * Always returns NULL. Only called from a variable trace.
- *
- * Side effects:
- * The subprocesses are signaled for termination using the specified kill
- * signal. Additionally, any resources allocated to track the
- * subprocesses is released.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static char *
-VariableProc(
- ClientData clientData, /* File output information. */
- Tcl_Interp *interp, /* Not used. */
- const char *part1, /* Not used. */
- const char *part2, /* Not Used. */
- int flags)
-{
- if (flags & TRACE_FLAGS) {
- Bgexec *bgPtr = clientData;
-
- /* Kill all child processes that remain alive. */
- KillProcesses(bgPtr);
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TimerProc --
- *
- * This is a timer handler procedure which gets called periodically to
- * reap any of the sub-processes if they have terminated. After the last
- * process has terminated, the contents of standard output are stored in
- * the output variable, which triggers the cleanup proc (using a variable
- * trace). The status the last process to exit is written to the status
- * variable.
- *
- * Results:
- * None. Called from the TCL event loop.
- *
- * Side effects:
- * Many. The contents of procIds is shifted, leaving only those
- * sub-processes which have not yet terminated. If there are still
- * subprocesses left, this procedure is placed in the timer queue
- * again. Otherwise the output and possibly the status variables are
- * updated. The former triggers the cleanup routine which will destroy
- * the information and resources associated with these background
- * processes.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TimerProc(ClientData clientData)
-{
- enum PROCESS_STATUS {
- PROCESS_EXITED, PROCESS_STOPPED, PROCESS_KILLED, PROCESS_UNKNOWN
- } pcode;
- static const char *tokens[] = {
- "EXITED", "KILLED", "STOPPED", "UNKNOWN"
- };
- Bgexec *bgPtr = clientData;
- Tcl_Obj *listObjPtr, *objPtr;
- Tcl_Interp *interp;
- WAIT_STATUS_TYPE waitStatus, lastStatus;
- char string[200];
- const char *mesg;
- int code;
- int i;
- int nLeft; /* # of processes still not reaped */
- unsigned int lastPid;
-
- interp = bgPtr->interp;
- lastPid = (unsigned int)-1;
- *((int *)&waitStatus) = 0;
- *((int *)&lastStatus) = 0;
-
- nLeft = 0;
- for (i = 0; i < bgPtr->nProcs; i++) {
- int pid;
-
-#ifdef WIN32
- pid = WaitProcess(bgPtr->procIds[i], (int *)&waitStatus, WNOHANG);
-#else
- pid = waitpid(bgPtr->procIds[i], (int *)&waitStatus, WNOHANG);
-#endif
- if (pid == 0) { /* Process has not terminated yet */
- if (nLeft < i) {
- bgPtr->procIds[nLeft] = bgPtr->procIds[i];
- }
- nLeft++; /* Count the # of processes left */
- } else if (pid != -1) {
- /*
- * Save the status information associated with the subprocess.
- * We'll use it only if this is the last subprocess to be reaped.
- */
- lastStatus = waitStatus;
- lastPid = (unsigned int)pid;
- }
- }
- bgPtr->nProcs = nLeft;
-
- if ((nLeft > 0) || (SINKOPEN(&bgPtr->out)) ||
- (SINKOPEN(&bgPtr->err))) {
- /* Keep polling for the status of the children that are left */
- bgPtr->timerToken = Tcl_CreateTimerHandler(bgPtr->interval, TimerProc,
- bgPtr);
-#if WINDEBUG
- PurifyPrintf("schedule TimerProc(nProcs=%d)\n", nLeft);
-#endif
- return;
- }
-
- /*
- * All child processes have completed. Set the status variable with the
- * status of the last process reaped. The status is a list of an error
- * token, the exit status, and a message.
- */
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- code = WEXITSTATUS(lastStatus);
- if (WIFEXITED(lastStatus)) {
- pcode = PROCESS_EXITED;
- } else if (WIFSIGNALED(lastStatus)) {
- pcode = PROCESS_KILLED;
- code = -1;
- } else if (WIFSTOPPED(lastStatus)) {
- pcode = PROCESS_STOPPED;
- code = -1;
- } else {
- pcode = PROCESS_UNKNOWN;
- }
- objPtr = Tcl_NewStringObj(tokens[pcode], -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewLongObj(lastPid);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- switch(pcode) {
- case PROCESS_EXITED:
- mesg = "child completed normally";
- break;
- case PROCESS_KILLED:
- mesg = Tcl_SignalMsg((int)(WTERMSIG(lastStatus)));
- break;
- case PROCESS_STOPPED:
- mesg = Tcl_SignalMsg((int)(WSTOPSIG(lastStatus)));
- break;
- case PROCESS_UNKNOWN:
- sprintf_s(string, 200, "child completed with unknown status 0x%x",
- *((int *)&lastStatus));
- mesg = string;
- break;
- }
- objPtr = Tcl_NewStringObj(mesg, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-
- if (bgPtr->exitCodePtr != NULL) {
- *bgPtr->exitCodePtr = code;
- }
- DisableTriggers(bgPtr);
- if (Tcl_SetVar2Ex(interp, bgPtr->statVar, NULL, listObjPtr,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_BackgroundError(interp);
- }
- if (bgPtr->flags & DETACHED) {
- DestroyBgexec(bgPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Stdoutproc --
- *
- * This procedure is called when output from the detached pipeline is
- * available. The output is read and saved in a buffer in the Bgexec
- * structure.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Data is stored in the buffer. This character array may be increased
- * as more space is required to contain the output of the pipeline.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-StdoutProc(ClientData clientData, int mask)
-{
- Bgexec *bgPtr = clientData;
-
- if (CollectData(bgPtr, &bgPtr->out) == TCL_OK) {
- return;
- }
- /*
- * Either EOF or an error has occurred. In either case, close the
- * sink. Note that closing the sink will also remove the file handler, so
- * this routine will not be called again.
- */
- CloseSink(bgPtr->interp, &bgPtr->out);
-
- /*
- * If both sinks (stdout and stderr) are closed, this doesn't necessarily
- * mean that the process has terminated. Set up a timer handler to
- * periodically poll for the exit status of each process. Initially check
- * at the next idle interval.
- */
- if (!SINKOPEN(&bgPtr->err)) {
- bgPtr->timerToken = Tcl_CreateTimerHandler(0, TimerProc, clientData);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StderrProc --
- *
- * This procedure is called when error from the detached pipeline is
- * available. The error is read and saved in a buffer in the Bgexec
- * structure.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Data is stored in the buffer. This character array may be increased
- * as more space is required to contain the stderr of the pipeline.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-StderrProc(ClientData clientData, int mask)
-{
- Bgexec *bgPtr = clientData;
-
- if (CollectData(bgPtr, &bgPtr->err) == TCL_OK) {
- return;
- }
- /*
- * Either EOF or an error has occurred. In either case, close the
- * sink. Note that closing the sink will also remove the file handler, so
- * this routine will not be called again.
- */
- CloseSink(bgPtr->interp, &bgPtr->err);
-
- /*
- * If both sinks (stdout and stderr) are closed, this doesn't necessarily
- * mean that the process has terminated. Set up a timer handler to
- * periodically poll for the exit status of each process. Initially check
- * at the next idle interval.
- */
- if (!SINKOPEN(&bgPtr->out)) {
- bgPtr->timerToken = Tcl_CreateTimerHandler(0, TimerProc, clientData);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BgexecCmd --
- *
- * This procedure is invoked to process the "bgexec" TCL command. See
- * the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-BgexecCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* # of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- Bgexec *bgPtr;
- ProcessId *pidPtr;
- char *lastArg;
- int *outFdPtr, *errFdPtr;
- int isDetached;
- int i;
- int nProcs;
-
- if (objc < 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " varName ?options? command ?arg...?\"",
- (char *)NULL);
- return TCL_ERROR;
- }
-
- /* Check if the command line is to be run detached (the last argument is
- * "&") */
- lastArg = Tcl_GetString(objv[objc - 1]);
- isDetached = ((lastArg[0] == '&') && (lastArg[1] == '\0'));
- if (isDetached) {
- objc--; /* Remove the '&' argument */
- }
- bgPtr = Blt_AssertCalloc(1, sizeof(Bgexec));
- /* Initialize the background information record */
- bgPtr->interp = interp;
- bgPtr->signalNum = SIGTERM;
- bgPtr->nProcs = -1;
- bgPtr->interval = 1000;
- if (isDetached) {
- bgPtr->flags |= DETACHED;
- }
- bgPtr->statVar = Blt_AssertStrdup(Tcl_GetString(objv[1]));
- Tcl_MutexLock(mutexPtr);
- bgPtr->link = Blt_Chain_Append(activePipelines, bgPtr);
- Tcl_MutexUnlock(mutexPtr);
- bgPtr->out.encoding = ENCODING_ASCII;
- bgPtr->err.encoding = ENCODING_ASCII;
-
- /* Try to clean up any detached processes */
- Tcl_ReapDetachedProcs();
- i = Blt_ParseSwitches(interp, switchSpecs, objc - 2, objv + 2, bgPtr,
- BLT_SWITCH_OBJV_PARTIAL);
- if (i < 0) {
- FreeBgexec(bgPtr);
- return TCL_ERROR;
- }
- i += 2;
- /* Must be at least one argument left as the command to execute. */
- if (objc <= i) {
- Tcl_AppendResult(interp, "missing command to execute: should be \"",
- Tcl_GetString(objv[0]), " varName ?options? command ?arg...?\"",
- (char *)NULL);
- FreeBgexec(bgPtr);
- return TCL_ERROR;
- }
-
- /* Put a trace on the exit status variable. The will also allow the user
- * to terminate the pipeline by simply setting the variable. */
- Tcl_TraceVar(interp, bgPtr->statVar, TRACE_FLAGS, VariableProc, bgPtr);
- bgPtr->flags |= TRACED;
-
- InitSink(bgPtr, &bgPtr->out, "stdout");
- InitSink(bgPtr, &bgPtr->err, "stderr");
-
- outFdPtr = errFdPtr = (int *)NULL;
-#ifdef WIN32
- if ((!isDetached) || (bgPtr->out.doneVar != NULL) ||
- (bgPtr->out.updateVar != NULL) || (bgPtr->out.cmdObjPtr != NULL)) {
- outFdPtr = &bgPtr->out.fd;
- }
-#else
- outFdPtr = &bgPtr->out.fd;
-#endif
- if ((bgPtr->err.doneVar != NULL) || (bgPtr->err.updateVar != NULL) ||
- (bgPtr->err.cmdObjPtr != NULL) || (bgPtr->err.echo)) {
- errFdPtr = &bgPtr->err.fd;
- }
- nProcs = Blt_CreatePipeline(interp, objc - i, objv + i, &pidPtr,
- (int *)NULL, outFdPtr, errFdPtr);
- if (nProcs < 0) {
- goto error;
- }
- bgPtr->procIds = pidPtr;
- bgPtr->nProcs = nProcs;
- if (bgPtr->out.fd == -1) {
- /*
- * If output has been redirected, start polling immediately for the
- * exit status of each process. Normally, this is done only after
- * stdout has been closed by the last process, but here stdout has
- * been redirected. The default polling interval is every 1 second.
- */
- bgPtr->timerToken = Tcl_CreateTimerHandler(bgPtr->interval, TimerProc,
- bgPtr);
-
- } else if (CreateSinkHandler(bgPtr, &bgPtr->out, StdoutProc) != TCL_OK) {
- goto error;
- }
- if ((bgPtr->err.fd != -1) &&
- (CreateSinkHandler(bgPtr, &bgPtr->err, StderrProc) != TCL_OK)) {
- goto error;
- }
- if (isDetached) {
- Tcl_Obj *listObjPtr;
- /* If detached, return a list of the child process ids instead of the
- * output of the pipeline. */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (i = 0; i < nProcs; i++) {
- Tcl_Obj *objPtr;
-#ifdef WIN32
- objPtr = Tcl_NewLongObj((unsigned int)bgPtr->procIds[i].pid);
-#else
- objPtr = Tcl_NewLongObj(bgPtr->procIds[i]);
-#endif
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- } else {
- int exitCode;
- int done;
-
- bgPtr->exitCodePtr = &exitCode;
- bgPtr->donePtr = &done;
-
- exitCode = done = 0;
- while (!done) {
- Tcl_DoOneEvent(0);
- }
- DisableTriggers(bgPtr);
- if ((bgPtr->flags & IGNOREEXITCODE) || (exitCode == 0)) {
- if (bgPtr->out.doneVar == NULL) {
- unsigned char *data;
- int length;
-
- /* Return the output of the pipeline. */
- GetSinkData(&bgPtr->out, &data, &length);
- assert(length <= UINT_MAX);
-#if (_TCL_VERSION < _VERSION(8,1,0))
- data[length] = '\0';
- Tcl_SetObjResult(interp, Tcl_NewStringObj(data, length));
-#else
- Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(data, length));
-#endif
- }
- } else {
- DestroyBgexec(bgPtr);
- Tcl_AppendResult(interp, "child process exited abnormally",
- (char *)NULL);
- return TCL_ERROR;
- }
- DestroyBgexec(bgPtr);
- }
- return TCL_OK;
- error:
- DestroyBgexec(bgPtr);
- return TCL_ERROR;
-}
-
-
-
-static void
-BgexecExitProc(ClientData clientData)
-{
- Blt_ChainLink link, next;
-
- Tcl_MutexLock(mutexPtr);
- for (link = Blt_Chain_FirstLink(activePipelines); link != NULL;
- link = next) {
- next = Blt_Chain_NextLink(link);
- Bgexec *bgPtr;
-
- bgPtr = Blt_Chain_GetValue(link);
- bgPtr->link = NULL;
- KillProcesses(bgPtr);
- }
- Blt_Chain_Destroy(activePipelines);
- Tcl_MutexUnlock(mutexPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_BgexecCmdInitProc --
- *
- * This procedure is invoked to initialize the "bgexec" TCL command. See
- * the user documentation for details on what it does.
- *
- * Results:
- * None.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_BgexecCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "bgexec", BgexecCmd, };
-
- if (activePipelines == NULL) {
-#ifdef TCL_THREADS
- mutexPtr = Tcl_GetAllocMutex();
-#endif
- activePipelines = Blt_Chain_Create();
- Tcl_CreateExitHandler(BgexecExitProc, activePipelines);
- }
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-#endif /* NO_BGEXEC */
-
diff --git a/blt3.0.1/src/bltBind.c b/blt3.0.1/src/bltBind.c
deleted file mode 100644
index 7b288f7..0000000
--- a/blt3.0.1/src/bltBind.c
+++ /dev/null
@@ -1,1825 +0,0 @@
-
-/*
- * bltBind.c --
- *
- * This module implements object binding procedures for the BLT toolkit.
- *
- * Copyright 1998 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltBind.h"
-#include <bltList.h>
-
-static Tk_EventProc BindProc;
-
-typedef struct _Blt_BindTable BindTable;
-
-/* Make button presses on objects have implicit grab. */
-#define FULLY_SIMULATE_GRAB 1
-
-/*
- * Binding table procedures.
- */
-#define REPICK_IN_PROGRESS (1<<0)
-#define LEFT_GRABBED_ITEM (1<<1)
-
-#define ALL_BUTTONS_MASK \
- (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask)
-
-#ifndef VirtualEventMask
-#define VirtualEventMask (1L << 30)
-#endif
-
-#define ALL_VALID_EVENTS_MASK \
- (ButtonMotionMask | Button1MotionMask | Button2MotionMask | \
- Button3MotionMask | Button4MotionMask | Button5MotionMask | \
- ButtonPressMask | ButtonReleaseMask | EnterWindowMask | \
- LeaveWindowMask | KeyPressMask | KeyReleaseMask | \
- PointerMotionMask | VirtualEventMask)
-
-static int buttonMasks[] =
-{
- 0, /* No buttons pressed */
- Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask,
-};
-
-
-/*
- * How to make drag&drop work?
- *
- * Right now we generate pseudo <Enter> <Leave> events within button grab
- * on an object. They're marked NotifyVirtual instead of NotifyAncestor.
- * A better solution: generate new-style virtual <<DragEnter>>
- * <<DragMotion>> <<DragLeave>> events. These virtual events don't have
- * to exist as "real" event sequences, like virtual events do now.
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * DoEvent --
- *
- * This procedure is called to invoke binding processing for a new event
- * that is associated with the current item for a legend.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Depends on the bindings for the legend. A binding script could delete
- * an entry, so callers should protect themselves with Tcl_Preserve and
- * Tcl_Release.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DoEvent(
- BindTable *bindPtr, /* Binding information for widget in which
- * event occurred. */
- XEvent *eventPtr, /* Real or simulated X event that is to be
- * processed. */
- ClientData item, /* Item picked. */
- ClientData context) /* Context of item. */
-{
- Blt_List tagList;
-
- if ((bindPtr->tkwin == NULL) || (bindPtr->bindingTable == NULL)) {
- return;
- }
- if ((eventPtr->type == KeyPress) || (eventPtr->type == KeyRelease)) {
- item = bindPtr->focusItem;
- context = bindPtr->focusContext;
- }
- if (item == NULL) {
- return;
- }
- /*
- * Invoke the binding system.
- */
- tagList = Blt_List_Create(BLT_ONE_WORD_KEYS);
- if (bindPtr->tagProc == NULL) {
- Blt_List_Append(tagList, Tk_GetUid("all"), 0);
- Blt_List_Append(tagList, (char *)item, 0);
- } else {
- (*bindPtr->tagProc) (bindPtr, item, context, tagList);
- }
- if (Blt_List_GetLength(tagList) > 0) {
- int nTags;
- ClientData *tagArray;
-#define MAX_STATIC_TAGS 64
- ClientData staticTags[MAX_STATIC_TAGS];
- Blt_ListNode node;
-
- tagArray = staticTags;
- nTags = Blt_List_GetLength(tagList);
- if (nTags >= MAX_STATIC_TAGS) {
- tagArray = Blt_AssertMalloc(sizeof(ClientData) * nTags);
-
- }
- nTags = 0;
- for (node = Blt_List_FirstNode(tagList); node != NULL;
- node = Blt_List_NextNode(node)) {
- tagArray[nTags++] = (ClientData)Blt_List_GetKey(node);
- }
- Tk_BindEvent(bindPtr->bindingTable, eventPtr, bindPtr->tkwin, nTags,
- tagArray);
- if (tagArray != staticTags) {
- Blt_Free(tagArray);
- }
- }
- Blt_List_Destroy(tagList);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PickCurrentItem --
- *
- * Find the topmost item in a legend that contains a given location and
- * mark the the current item. If the current item has changed, generate
- * a fake exit event on the old current item and a fake enter event on
- * the new current item.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The current item may change. If it does, then the commands associated
- * with item entry and exit could do just about anything. A binding
- * script could delete the legend, so callers should protect themselves
- * with Tcl_Preserve and Tcl_Release.
- *
- *---------------------------------------------------------------------------
- */
-static void
-PickCurrentItem(
- BindTable *bindPtr, /* Binding table information. */
- XEvent *eventPtr) /* Event describing location of mouse cursor.
- * Must be EnterWindow, LeaveWindow,
- * ButtonRelease, or MotionNotify. */
-{
- int buttonDown;
- ClientData newItem, oldItem;
- ClientData newContext;
-
- /*
- * Check whether or not a button is down. If so, we'll log entry and exit
- * into and out of the current item, but not entry into any other item.
- * This implements a form of grabbing equivalent to what the X server does
- * for windows.
- */
- buttonDown = (bindPtr->state & ALL_BUTTONS_MASK);
- if (!buttonDown) {
- bindPtr->flags &= ~LEFT_GRABBED_ITEM;
- }
-
- /*
- * Save information about this event in the widget. The event in the
- * widget is used for two purposes:
- *
- * 1. Event bindings: if the current item changes, fake events are
- * generated to allow item-enter and item-leave bindings to trigger.
- * 2. Reselection: if the current item gets deleted, can use the
- * saved event to find a new current item.
- * Translate MotionNotify events into EnterNotify events, since that's
- * what gets reported to item handlers.
- */
-
- if (eventPtr != &bindPtr->pickEvent) {
- if ((eventPtr->type == MotionNotify) ||
- (eventPtr->type == ButtonRelease)) {
- bindPtr->pickEvent.xcrossing.type = EnterNotify;
- bindPtr->pickEvent.xcrossing.serial = eventPtr->xmotion.serial;
- bindPtr->pickEvent.xcrossing.send_event =
- eventPtr->xmotion.send_event;
- bindPtr->pickEvent.xcrossing.display = eventPtr->xmotion.display;
- bindPtr->pickEvent.xcrossing.window = eventPtr->xmotion.window;
- bindPtr->pickEvent.xcrossing.root = eventPtr->xmotion.root;
- bindPtr->pickEvent.xcrossing.subwindow = None;
- bindPtr->pickEvent.xcrossing.time = eventPtr->xmotion.time;
- bindPtr->pickEvent.xcrossing.x = eventPtr->xmotion.x;
- bindPtr->pickEvent.xcrossing.y = eventPtr->xmotion.y;
- bindPtr->pickEvent.xcrossing.x_root = eventPtr->xmotion.x_root;
- bindPtr->pickEvent.xcrossing.y_root = eventPtr->xmotion.y_root;
- bindPtr->pickEvent.xcrossing.mode = NotifyNormal;
- bindPtr->pickEvent.xcrossing.detail = NotifyNonlinear;
- bindPtr->pickEvent.xcrossing.same_screen
- = eventPtr->xmotion.same_screen;
- bindPtr->pickEvent.xcrossing.focus = False;
- bindPtr->pickEvent.xcrossing.state = eventPtr->xmotion.state;
- } else {
- bindPtr->pickEvent = *eventPtr;
- }
- }
- bindPtr->activePick = TRUE;
-
- /*
- * If this is a recursive call (there's already a partially completed call
- * pending on the stack; it's in the middle of processing a Leave event
- * handler for the old current item) then just return; the pending call
- * will do everything that's needed.
- */
- if (bindPtr->flags & REPICK_IN_PROGRESS) {
- return;
- }
- /*
- * A LeaveNotify event automatically means that there's no current item,
- * so the check for closest item can be skipped.
- */
- newContext = NULL;
- if (bindPtr->pickEvent.type != LeaveNotify) {
- int x, y;
-
- x = bindPtr->pickEvent.xcrossing.x;
- y = bindPtr->pickEvent.xcrossing.y;
- newItem = (*bindPtr->pickProc) (bindPtr->clientData, x, y, &newContext);
- } else {
- newItem = NULL;
- }
- if (((newItem == bindPtr->currentItem) &&
- (newContext == bindPtr->currentContext)) &&
- ((bindPtr->flags & LEFT_GRABBED_ITEM) == 0)) {
- /*
- * Nothing to do: the current item hasn't changed.
- */
- return;
- }
-#if FULLY_SIMULATE_GRAB
- if (((newItem != bindPtr->currentItem) ||
- (newContext != bindPtr->currentContext)) &&
- (buttonDown)) {
- bindPtr->flags |= LEFT_GRABBED_ITEM;
-#ifdef notdef
- fprintf(stderr, "pickcurrentitem: simulate grab.\n");
-#endif
- return;
- }
-#endif
- /*
- * Simulate a LeaveNotify event on the previous current item and an
- * EnterNotify event on the new current item. Remove the "current" tag
- * from the previous current item and place it on the new current item.
- */
- oldItem = bindPtr->currentItem;
- Tcl_Preserve(oldItem);
- Tcl_Preserve(newItem);
-
- if ((bindPtr->currentItem != NULL) &&
- ((newItem != bindPtr->currentItem) ||
- (newContext != bindPtr->currentContext)) &&
- ((bindPtr->flags & LEFT_GRABBED_ITEM) == 0)) {
- XEvent event;
-
- event = bindPtr->pickEvent;
- event.type = LeaveNotify;
- /*
- * If the event's detail happens to be NotifyInferior the binding
- * mechanism will discard the event. To be consistent, always use
- * NotifyAncestor.
- */
- event.xcrossing.detail = NotifyAncestor;
-
- bindPtr->flags |= REPICK_IN_PROGRESS;
- DoEvent(bindPtr, &event, bindPtr->currentItem, bindPtr->currentContext);
- bindPtr->flags &= ~REPICK_IN_PROGRESS;
-
- /*
- * Note: during DoEvent above, it's possible that bindPtr->newItem got
- * reset to NULL because the item was deleted.
- */
- }
- if (((newItem != bindPtr->currentItem) ||
- (newContext != bindPtr->currentContext)) &&
- (buttonDown)) {
- XEvent event;
-
- bindPtr->flags |= LEFT_GRABBED_ITEM;
- event = bindPtr->pickEvent;
- if ((newItem != bindPtr->newItem) ||
- (newContext != bindPtr->newContext)) {
- ClientData savedItem;
- ClientData savedContext;
-
- /*
- * Generate <Enter> and <Leave> events for objects during button
- * grabs. This isn't standard. But for example, it allows one to
- * provide balloon help on the individual entries of the Hierbox
- * widget.
- */
- savedItem = bindPtr->currentItem;
- savedContext = bindPtr->currentContext;
- if (bindPtr->newItem != NULL) {
- event.type = LeaveNotify;
- event.xcrossing.detail = NotifyVirtual /* Ancestor */ ;
- bindPtr->currentItem = bindPtr->newItem;
- DoEvent(bindPtr, &event, bindPtr->newItem, bindPtr->newContext);
- }
- bindPtr->newItem = newItem;
- bindPtr->newContext = newContext;
- if (newItem != NULL) {
- event.type = EnterNotify;
- event.xcrossing.detail = NotifyVirtual /* Ancestor */ ;
- bindPtr->currentItem = newItem;
- DoEvent(bindPtr, &event, newItem, newContext);
- }
- bindPtr->currentItem = savedItem;
- bindPtr->currentContext = savedContext;
- }
- goto done;
- }
- /*
- * Special note: it's possible that
- * bindPtr->newItem == bindPtr->currentItem
- * here. This can happen, for example, if LEFT_GRABBED_ITEM was set.
- */
-
- bindPtr->flags &= ~LEFT_GRABBED_ITEM;
- bindPtr->currentItem = bindPtr->newItem = newItem;
- bindPtr->currentContext = bindPtr->newContext = newContext;
- if (bindPtr->currentItem != NULL) {
- XEvent event;
-
- event = bindPtr->pickEvent;
- event.type = EnterNotify;
- event.xcrossing.detail = NotifyAncestor;
- DoEvent(bindPtr, &event, newItem, newContext);
-#ifdef notdef
- if ((eventPtr->type == MotionNotify) ||
- (eventPtr->type == ButtonRelease)) {
- fprintf(stderr, "pickcurrentitem: DoEvent Button buttondown=%d.\n",
- buttonDown);
- event.type = eventPtr->type;
- event.xbutton.button = eventPtr->xbutton.button;
- DoEvent(bindPtr, &event, newItem, newContext);
- fprintf(stderr, "pickcurrentitem: done.\n");
- }
-#endif
- }
- done:
- Tcl_Release(newItem);
- Tcl_Release(oldItem);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BindProc --
- *
- * This procedure is invoked by the Tk dispatcher to handle events
- * associated with bindings on items.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Depends on the command invoked as part of the binding
- * (if there was any).
- *
- *---------------------------------------------------------------------------
- */
-static void
-BindProc(
- ClientData clientData, /* Pointer to widget structure. */
- XEvent *eventPtr) /* Pointer to X event that just happened. */
-{
- BindTable *bindPtr = clientData;
- int mask;
-
- Tcl_Preserve(bindPtr->clientData);
- /*
- * This code below keeps track of the current modifier state in
- * bindPtr->state. This information is used to defer repicks of the
- * current item while buttons are down.
- */
- switch (eventPtr->type) {
- case ButtonPress:
- case ButtonRelease:
- mask = 0;
- if ((eventPtr->xbutton.button >= Button1) &&
- (eventPtr->xbutton.button <= Button5)) {
- mask = buttonMasks[eventPtr->xbutton.button];
- }
- /*
- * For button press events, repick the current item using the button
- * state before the event, then process the event. For button release
- * events, first process the event, then repick the current item using
- * the button state *after* the event (the button has logically gone
- * up before we change the current item).
- */
- if (eventPtr->type == ButtonPress) {
-
- /*
- * On a button press, first repick the current item using the
- * button state before the event, the process the event.
- */
-
- bindPtr->state = eventPtr->xbutton.state;
- PickCurrentItem(bindPtr, eventPtr);
- bindPtr->state ^= mask;
- DoEvent(bindPtr, eventPtr, bindPtr->currentItem,
- bindPtr->currentContext);
-
- } else {
-
- /*
- * Button release: first process the event, with the button still
- * considered to be down. Then repick the current item under the
- * assumption that the button is no longer down.
- */
- bindPtr->state = eventPtr->xbutton.state;
- DoEvent(bindPtr, eventPtr, bindPtr->currentItem,
- bindPtr->currentContext);
- eventPtr->xbutton.state ^= mask;
- bindPtr->state = eventPtr->xbutton.state;
- PickCurrentItem(bindPtr, eventPtr);
- eventPtr->xbutton.state ^= mask;
- }
- break;
-
- case EnterNotify:
- case LeaveNotify:
- bindPtr->state = eventPtr->xcrossing.state;
- PickCurrentItem(bindPtr, eventPtr);
- break;
-
- case MotionNotify:
- bindPtr->state = eventPtr->xmotion.state;
- PickCurrentItem(bindPtr, eventPtr);
- DoEvent(bindPtr, eventPtr, bindPtr->currentItem,
- bindPtr->currentContext);
- break;
-
- case KeyPress:
- case KeyRelease:
- bindPtr->state = eventPtr->xkey.state;
- PickCurrentItem(bindPtr, eventPtr);
- DoEvent(bindPtr, eventPtr, bindPtr->currentItem,
- bindPtr->currentContext);
- break;
- }
- Tcl_Release(bindPtr->clientData);
-}
-
-int
-Blt_ConfigureBindings(
- Tcl_Interp *interp,
- BindTable *bindPtr,
- ClientData item,
- int argc,
- const char **argv)
-{
- const char *command;
- unsigned long mask;
- const char *seq;
-
- if (argc == 0) {
- Tk_GetAllBindings(interp, bindPtr->bindingTable, item);
- return TCL_OK;
- }
- if (argc == 1) {
- command = Tk_GetBinding(interp, bindPtr->bindingTable, item, argv[0]);
- if (command == NULL) {
- Tcl_AppendResult(interp, "can't find event \"", argv[0], "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), command, -1);
- return TCL_OK;
- }
-
- seq = argv[0];
- command = argv[1];
-
- if (command[0] == '\0') {
- return Tk_DeleteBinding(interp, bindPtr->bindingTable, item, seq);
- }
-
- if (command[0] == '+') {
- mask = Tk_CreateBinding(interp, bindPtr->bindingTable, item, seq,
- command + 1, TRUE);
- } else {
- mask = Tk_CreateBinding(interp, bindPtr->bindingTable, item, seq,
- command, FALSE);
- }
- if (mask == 0) {
- Tcl_AppendResult(interp, "event mask can't be zero for \"", item, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (mask & (unsigned)~ALL_VALID_EVENTS_MASK) {
- Tk_DeleteBinding(interp, bindPtr->bindingTable, item, seq);
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "requested illegal events; ",
- "only key, button, motion, enter, leave, and virtual ",
- "events may be used", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-
-int
-Blt_ConfigureBindingsFromObj(
- Tcl_Interp *interp,
- BindTable *bindPtr,
- ClientData item,
- int objc,
- Tcl_Obj *const *objv)
-{
- const char *command;
- unsigned long mask;
- const char *seq;
- const char *string;
-
- if (objc == 0) {
- Tk_GetAllBindings(interp, bindPtr->bindingTable, item);
- return TCL_OK;
- }
- string = Tcl_GetString(objv[0]);
- if (objc == 1) {
- command = Tk_GetBinding(interp, bindPtr->bindingTable, item, string);
- if (command == NULL) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "invalid binding event \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), command, -1);
- return TCL_OK;
- }
-
- seq = string;
- command = Tcl_GetString(objv[1]);
-
- if (command[0] == '\0') {
- return Tk_DeleteBinding(interp, bindPtr->bindingTable, item, seq);
- }
-
- if (command[0] == '+') {
- mask = Tk_CreateBinding(interp, bindPtr->bindingTable, item, seq,
- command + 1, TRUE);
- } else {
- mask = Tk_CreateBinding(interp, bindPtr->bindingTable, item, seq,
- command, FALSE);
- }
- if (mask == 0) {
- return TCL_ERROR;
- }
- if (mask & (unsigned)~ALL_VALID_EVENTS_MASK) {
- Tk_DeleteBinding(interp, bindPtr->bindingTable, item, seq);
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "requested illegal events; ",
- "only key, button, motion, enter, leave, and virtual ",
- "events may be used", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-Blt_BindTable
-Blt_CreateBindingTable(
- Tcl_Interp *interp,
- Tk_Window tkwin,
- ClientData clientData,
- Blt_BindPickProc *pickProc,
- Blt_BindTagProc *tagProc)
-{
- unsigned int mask;
- BindTable *bindPtr;
-
- bindPtr = Blt_AssertCalloc(1, sizeof(BindTable));
- bindPtr->bindingTable = Tk_CreateBindingTable(interp);
- bindPtr->clientData = clientData;
- bindPtr->tkwin = tkwin;
- bindPtr->pickProc = pickProc;
- bindPtr->tagProc = tagProc;
- mask = (KeyPressMask | KeyReleaseMask | ButtonPressMask |
- ButtonReleaseMask | EnterWindowMask | LeaveWindowMask |
- PointerMotionMask);
- Tk_CreateEventHandler(tkwin, mask, BindProc, bindPtr);
- return bindPtr;
-}
-
-void
-Blt_DestroyBindingTable(BindTable *bindPtr)
-{
- unsigned int mask;
-
- Tk_DeleteBindingTable(bindPtr->bindingTable);
- mask = (KeyPressMask | KeyReleaseMask | ButtonPressMask |
- ButtonReleaseMask | EnterWindowMask | LeaveWindowMask |
- PointerMotionMask);
- Tk_DeleteEventHandler(bindPtr->tkwin, mask, BindProc, bindPtr);
- Blt_Free(bindPtr);
-}
-
-void
-Blt_PickCurrentItem(BindTable *bindPtr)
-{
- if (bindPtr->activePick) {
- PickCurrentItem(bindPtr, &bindPtr->pickEvent);
- }
-}
-
-void
-Blt_DeleteBindings(
- BindTable *bindPtr,
- ClientData object)
-{
- Tk_DeleteAllBindings(bindPtr->bindingTable, object);
-
- /*
- * If this is the object currently picked, we need to repick one.
- */
- if (bindPtr->currentItem == object) {
- bindPtr->currentItem = NULL;
- bindPtr->currentContext = NULL;
- }
- if (bindPtr->newItem == object) {
- bindPtr->newItem = NULL;
- bindPtr->newContext = NULL;
- }
- if (bindPtr->focusItem == object) {
- bindPtr->focusItem = NULL;
- bindPtr->focusContext = NULL;
- }
-}
-
-void
-Blt_MoveBindingTable(
- BindTable *bindPtr,
- Tk_Window tkwin)
-{
- unsigned int mask;
-
- mask = (KeyPressMask | KeyReleaseMask | ButtonPressMask |
- ButtonReleaseMask | EnterWindowMask | LeaveWindowMask |
- PointerMotionMask);
- if (bindPtr->tkwin != NULL) {
- Tk_DeleteEventHandler(bindPtr->tkwin, mask, BindProc, bindPtr);
- }
- Tk_CreateEventHandler(tkwin, mask, BindProc, bindPtr);
- bindPtr->tkwin = tkwin;
-}
-
-/*
- * The following union is used to hold the detail information from an
- * XEvent (including Tk's XVirtualEvent extension).
- */
-typedef union {
- KeySym keySym; /* KeySym that corresponds to xkey.keycode. */
- int button; /* Button that was pressed (xbutton.button). */
- Tk_Uid name; /* Tk_Uid of virtual event. */
- ClientData clientData; /* Used when type of Detail is unknown, and to
- * ensure that all bytes of Detail are initialized
- * when this structure is used in a hash key. */
-} Detail;
-
-
-/*
- * The following structure defines a pattern, which is matched against X
- * events as part of the process of converting X events into TCL commands.
- */
-typedef struct {
- int eventType; /* Type of X event, e.g. ButtonPress. */
- int needMods; /* Mask of modifiers that must be
- * present (0 means no modifiers are
- * required). */
- Detail detail; /* Additional information that must
- * match event. Normally this is 0,
- * meaning no additional information
- * must match. For KeyPress and
- * KeyRelease events, a keySym may
- * be specified to select a
- * particular keystroke (0 means any
- * keystrokes). For button events,
- * specifies a particular button (0
- * means any buttons are OK). For virtual
- * events, specifies the Tk_Uid of the
- * virtual event name (never 0). */
-} Pattern;
-
-typedef struct {
- const char *name; /* Name of modifier. */
- int mask; /* Button/modifier mask value, such as
- * Button1Mask. */
- int flags; /* Various flags; see below for
- * definitions. */
-} EventModifier;
-
-/*
- * Flags for EventModifier structures:
- *
- * DOUBLE - Non-zero means duplicate this event,
- * e.g. for double-clicks.
- * TRIPLE - Non-zero means triplicate this event,
- * e.g. for triple-clicks.
- * QUADRUPLE - Non-zero means quadruple this event,
- * e.g. for 4-fold-clicks.
- * MULT_CLICKS - Combination of all of above.
- */
-
-#define DOUBLE (1<<0)
-#define TRIPLE (1<<1)
-#define QUADRUPLE (1<<2)
-#define MULT_CLICKS (DOUBLE|TRIPLE|QUADRUPLE)
-
-#define META_MASK (AnyModifier<<1)
-#define ALT_MASK (AnyModifier<<2)
-
-static EventModifier eventModifiers[] = {
- {"Alt", ALT_MASK, 0},
- {"Any", 0, 0}, /* Ignored: historical relic. */
- {"B1", Button1Mask, 0},
- {"B2", Button2Mask, 0},
- {"B3", Button3Mask, 0},
- {"B4", Button4Mask, 0},
- {"B5", Button5Mask, 0},
- {"Button1", Button1Mask, 0},
- {"Button2", Button2Mask, 0},
- {"Button3", Button3Mask, 0},
- {"Button4", Button4Mask, 0},
- {"Button5", Button5Mask, 0},
- {"Command", Mod1Mask, 0},
- {"Control", ControlMask, 0},
- {"Double", 0, DOUBLE},
- {"Lock", LockMask, 0},
- {"M", META_MASK, 0},
- {"M1", Mod1Mask, 0},
- {"M2", Mod2Mask, 0},
- {"M3", Mod3Mask, 0},
- {"M4", Mod4Mask, 0},
- {"M5", Mod5Mask, 0},
- {"Meta", META_MASK, 0},
- {"Mod1", Mod1Mask, 0},
- {"Mod2", Mod2Mask, 0},
- {"Mod3", Mod3Mask, 0},
- {"Mod4", Mod4Mask, 0},
- {"Mod5", Mod5Mask, 0},
- {"Option", Mod2Mask, 0},
- {"Quadruple", 0, QUADRUPLE},
- {"Shift", ShiftMask, 0},
- {"Triple", 0, TRIPLE},
-};
-
-typedef struct {
- const char *name; /* Name of event. */
- int type; /* Event type for X, such as
- * ButtonPress. */
- int eventMask; /* Mask bits (for XSelectInput)
- * for this event type. */
-} EventInfo;
-
-/*
- * Note: some of the masks below are an OR-ed combination of
- * several masks. This is necessary because X doesn't report
- * up events unless you also ask for down events. Also, X
- * doesn't report button state in motion events unless you've
- * asked about button events.
- */
-
-static EventInfo events[] = {
- {"Activate", ActivateNotify, ActivateMask},
- {"Button", ButtonPress, ButtonPressMask},
- {"ButtonPress", ButtonPress, ButtonPressMask},
- {"ButtonRelease", ButtonRelease, ButtonPressMask|ButtonReleaseMask},
- {"Circulate", CirculateNotify, StructureNotifyMask},
- {"CirculateRequest", CirculateRequest, SubstructureRedirectMask},
- {"Colormap", ColormapNotify, ColormapChangeMask},
- {"Configure", ConfigureNotify, StructureNotifyMask},
- {"ConfigureRequest", ConfigureRequest, SubstructureRedirectMask},
- {"Create", CreateNotify, SubstructureNotifyMask},
- {"Deactivate", DeactivateNotify, ActivateMask},
- {"Destroy", DestroyNotify, StructureNotifyMask},
- {"Enter", EnterNotify, EnterWindowMask},
- {"Expose", Expose, ExposureMask},
- {"FocusIn", FocusIn, FocusChangeMask},
- {"FocusOut", FocusOut, FocusChangeMask},
- {"Gravity", GravityNotify, StructureNotifyMask},
- {"Key", KeyPress, KeyPressMask},
- {"KeyPress", KeyPress, KeyPressMask},
- {"KeyRelease", KeyRelease, KeyPressMask|KeyReleaseMask},
- {"Leave", LeaveNotify, LeaveWindowMask},
- {"Map", MapNotify, StructureNotifyMask},
- {"MapRequest", MapRequest, SubstructureRedirectMask},
- {"Motion", MotionNotify, ButtonPressMask|PointerMotionMask},
- {"MouseWheel", MouseWheelEvent, MouseWheelMask},
- {"Property", PropertyNotify, PropertyChangeMask},
- {"Reparent", ReparentNotify, StructureNotifyMask},
- {"ResizeRequest", ResizeRequest, ResizeRedirectMask},
- {"Unmap", UnmapNotify, StructureNotifyMask},
- {"Visibility", VisibilityNotify, VisibilityChangeMask},
-};
-
-/*
- * The defines and table below are used to classify events into
- * various groups. The reason for this is that logically identical
- * fields (e.g. "state") appear at different places in different
- * types of events. The classification masks can be used to figure
- * out quickly where to extract information from events.
- */
-
-#define KEY 0x1
-#define BUTTON 0x2
-#define MOTION 0x4
-#define CROSSING 0x8
-#define FOCUS 0x10
-#define EXPOSE 0x20
-#define VISIBILITY 0x40
-#define CREATE 0x80
-#define DESTROY 0x100
-#define UNMAP 0x200
-#define MAP 0x400
-#define REPARENT 0x800
-#define CONFIG 0x1000
-#define GRAVITY 0x2000
-#define CIRC 0x4000
-#define PROP 0x8000
-#define COLORMAP 0x10000
-#define VIRTUAL 0x20000
-#define ACTIVATE 0x40000
-#define MAPREQ 0x80000
-#define CONFIGREQ 0x100000
-#define RESIZEREQ 0x200000
-#define CIRCREQ 0x400000
-
-#define KEY_BUTTON_MOTION_VIRTUAL (KEY|BUTTON|MOTION|VIRTUAL)
-#define KEY_BUTTON_MOTION_CROSSING (KEY|BUTTON|MOTION|CROSSING|VIRTUAL)
-
-static int flagArray[TK_LASTEVENT+1] = {
- /* Not used */ 0,
- /* Not used */ 0,
- /* KeyPress */ KEY,
- /* KeyRelease */ KEY,
- /* ButtonPress */ BUTTON,
- /* ButtonRelease */ BUTTON,
- /* MotionNotify */ MOTION,
- /* EnterNotify */ CROSSING,
- /* LeaveNotify */ CROSSING,
- /* FocusIn */ FOCUS,
- /* FocusOut */ FOCUS,
- /* KeymapNotify */ 0,
- /* Expose */ EXPOSE,
- /* GraphicsExpose */ EXPOSE,
- /* NoExpose */ 0,
- /* VisibilityNotify */ VISIBILITY,
- /* CreateNotify */ CREATE,
- /* DestroyNotify */ DESTROY,
- /* UnmapNotify */ UNMAP,
- /* MapNotify */ MAP,
- /* MapRequest */ MAPREQ,
- /* ReparentNotify */ REPARENT,
- /* ConfigureNotify */ CONFIG,
- /* ConfigureRequest */ CONFIGREQ,
- /* GravityNotify */ GRAVITY,
- /* ResizeRequest */ RESIZEREQ,
- /* CirculateNotify */ CIRC,
- /* CirculateRequest */ 0,
- /* PropertyNotify */ PROP,
- /* SelectionClear */ 0,
- /* SelectionRequest */ 0,
- /* SelectionNotify */ 0,
- /* ColormapNotify */ COLORMAP,
- /* ClientMessage */ 0,
- /* MappingNotify */ 0,
-#ifdef GenericEvent
- /* GenericEvent */ 0,
-#endif
- /* VirtualEvent */ VIRTUAL,
- /* Activate */ ACTIVATE,
- /* Deactivate */ ACTIVATE,
- /* MouseWheel */ KEY
-};
-
-
-static EventModifier *
-FindModifier(const char *string)
-{
- int high, low;
- char c;
-
- low = 0;
- high = (sizeof(eventModifiers) / sizeof(EventModifier)) - 1;
- c = string[0];
- while (low <= high) {
- EventModifier *modPtr;
- int compare;
- int median;
-
- median = (low + high) >> 1;
- modPtr = eventModifiers + median;
-
- /* Test the first character */
- compare = c - modPtr->name[0];
- if (compare == 0) {
- compare = strcmp(string, modPtr->name);
- }
- if (compare < 0) {
- high = median - 1;
- } else if (compare > 0) {
- low = median + 1;
- } else {
- return modPtr; /* Modifier found. */
- }
- }
- return NULL; /* Can't find modifier */
-}
-
-static EventInfo *
-FindEvent(const char *string)
-{
- int high, low;
- char c;
-
- low = 0;
- high = (sizeof(events) / sizeof(EventInfo)) - 1;
- c = string[0];
- while (low <= high) {
- EventInfo *infoPtr;
- int compare;
- int median;
-
- median = (low + high) >> 1;
- infoPtr = events + median;
-
- /* Test the first character */
- compare = c - infoPtr->name[0];
- if (compare == 0) {
- compare = strcmp(string, infoPtr->name);
- }
- if (compare < 0) {
- high = median - 1;
- } else if (compare > 0) {
- low = median + 1;
- } else {
- return infoPtr; /* Event found. */
- }
- }
- return NULL; /* Can't find event. */
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * GetField --
- *
- * Used to parse pattern descriptions. Copies up to
- * size characters from p to copy, stopping at end of
- * string, space, "-", ">", or whenever size is
- * exceeded.
- *
- * Results:
- * The return value is a pointer to the character just
- * after the last one copied (usually "-" or space or
- * ">", but could be anything if size was exceeded).
- * Also places NULL-terminated string (up to size
- * character, including NULL), at copy.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static char *
-GetField(p, copy, size)
- char *p; /* Pointer to part of pattern. */
- char *copy; /* Place to copy field. */
- int size; /* Maximum number of characters to
- * copy. */
-{
- while ((*p != '\0') && !isspace(UCHAR(*p)) && (*p != '>')
- && (*p != '-') && (size > 1)) {
- *copy = *p;
- p++;
- copy++;
- size--;
- }
- *copy = '\0';
- return p;
-}
-
-static int
-ParseEventDescription(Tcl_Interp *interp, const char **eventStringPtr,
- Pattern *patPtr, unsigned long *eventMaskPtr)
-{
- char *p;
- unsigned long eventMask;
- int count, eventFlags;
-#define FIELD_SIZE 48
- char field[FIELD_SIZE];
- EventInfo *infoPtr;
-
- Tcl_DString copy;
- Tcl_DStringInit(©);
- p = Tcl_DStringAppend(©, *eventStringPtr, -1);
-
- patPtr->eventType = -1;
- patPtr->needMods = 0;
- patPtr->detail.clientData = 0;
-
- eventMask = 0;
- count = 1;
-
- /*
- * Handle simple ASCII characters.
- */
-
- if (*p != '<') {
- char string[2];
-
- patPtr->eventType = KeyPress;
- eventMask = KeyPressMask;
- string[0] = *p;
- string[1] = 0;
- patPtr->detail.keySym = XStringToKeysym(string);
- if (patPtr->detail.keySym == NoSymbol) {
- if (isprint(UCHAR(*p))) {
- patPtr->detail.keySym = *p;
- } else {
- char buf[64];
-
- sprintf(buf, "bad ASCII character 0x%x", (unsigned char) *p);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- count = 0;
- goto done;
- }
- }
- p++;
- goto end;
- }
-
- /*
- * A physical event description consists of:
- *
- * 1. open angle bracket.
- * 2. any number of modifiers, each followed by spaces
- * or dashes.
- * 3. an optional event name.
- * 4. an option button or keysym name. Either this or
- * item 3 *must* be present; if both are present
- * then they are separated by spaces or dashes.
- * 5. a close angle bracket.
- */
-
- p++;
-
- while (1) {
- EventModifier *modPtr;
- p = GetField(p, field, FIELD_SIZE);
- if (*p == '>') {
- /*
- * This solves the problem of, e.g., <Control-M> being
- * misinterpreted as Control + Meta + missing keysym
- * instead of Control + KeyPress + M.
- */
- break;
- }
- modPtr = FindModifier(field);
- if (modPtr == NULL) {
- break;
- }
- patPtr->needMods |= modPtr->mask;
- if (modPtr->flags & (MULT_CLICKS)) {
- int i = modPtr->flags & MULT_CLICKS;
- count = 2;
- while (i >>= 1) count++;
- }
- while ((*p == '-') || isspace(UCHAR(*p))) {
- p++;
- }
- }
-
- eventFlags = 0;
- infoPtr = FindEvent(field);
- if (infoPtr != NULL) {
- patPtr->eventType = infoPtr->type;
- eventFlags = flagArray[infoPtr->type];
- eventMask = infoPtr->eventMask;
- while ((*p == '-') || isspace(UCHAR(*p))) {
- p++;
- }
- p = GetField(p, field, FIELD_SIZE);
- }
- if (*field != '\0') {
- if ((*field >= '1') && (*field <= '5') && (field[1] == '\0')) {
- if (eventFlags == 0) {
- patPtr->eventType = ButtonPress;
- eventMask = ButtonPressMask;
- } else if (eventFlags & KEY) {
- goto getKeysym;
- } else if ((eventFlags & BUTTON) == 0) {
- Tcl_AppendResult(interp, "specified button \"", field,
- "\" for non-button event", (char *) NULL);
- count = 0;
- goto done;
- }
- patPtr->detail.button = (*field - '0');
- } else {
- getKeysym:
- patPtr->detail.keySym = XStringToKeysym(field);
- if (patPtr->detail.keySym == NoSymbol) {
- Tcl_AppendResult(interp, "bad event type or keysym \"",
- field, "\"", (char *)NULL);
- count = 0;
- goto done;
- }
- if (eventFlags == 0) {
- patPtr->eventType = KeyPress;
- eventMask = KeyPressMask;
- } else if ((eventFlags & KEY) == 0) {
- Tcl_AppendResult(interp, "specified keysym \"", field,
- "\" for non-key event", (char *)NULL);
- count = 0;
- goto done;
- }
- }
- } else if (eventFlags == 0) {
- Tcl_AppendResult(interp, "no event type or button # or keysym",
- (char *)NULL);
- count = 0;
- goto done;
- }
-
- while ((*p == '-') || isspace(UCHAR(*p))) {
- p++;
- }
- if (*p != '>') {
- while (*p != '\0') {
- p++;
- if (*p == '>') {
- Tcl_AppendResult(interp,
- "extra characters after detail in binding",
- (char *)NULL);
- count = 0;
- goto done;
- }
- }
- Tcl_AppendResult(interp, "missing \">\" in binding", (char *)NULL);
- count = 0;
- goto done;
- }
- p++;
-
-end:
- *eventStringPtr += (p - Tcl_DStringValue(©));
- *eventMaskPtr |= eventMask;
-done:
- Tcl_DStringFree(©);
- return count;
-}
-
-typedef struct {
- int numKey; /* Integer representation of a value. */
- const char *strKey; /* String representation of a value. */
-} TkStateMap;
-
-static TkStateMap notifyMode[] = {
- {NotifyNormal, "NotifyNormal"},
- {NotifyGrab, "NotifyGrab"},
- {NotifyUngrab, "NotifyUngrab"},
- {NotifyWhileGrabbed, "NotifyWhileGrabbed"},
- {-1, NULL}
-};
-
-static TkStateMap notifyDetail[] = {
- {NotifyAncestor, "NotifyAncestor"},
- {NotifyVirtual, "NotifyVirtual"},
- {NotifyInferior, "NotifyInferior"},
- {NotifyNonlinear, "NotifyNonlinear"},
- {NotifyNonlinearVirtual, "NotifyNonlinearVirtual"},
- {NotifyPointer, "NotifyPointer"},
- {NotifyPointerRoot, "NotifyPointerRoot"},
- {NotifyDetailNone, "NotifyDetailNone"},
- {-1, NULL}
-};
-
-static TkStateMap circPlace[] = {
- {PlaceOnTop, "PlaceOnTop"},
- {PlaceOnBottom, "PlaceOnBottom"},
- {-1, NULL}
-};
-
-static TkStateMap visNotify[] = {
- {VisibilityUnobscured, "VisibilityUnobscured"},
- {VisibilityPartiallyObscured, "VisibilityPartiallyObscured"},
- {VisibilityFullyObscured, "VisibilityFullyObscured"},
- {-1, NULL}
-};
-
-static TkStateMap configureRequestDetail[] = {
- {None, "None"},
- {Above, "Above"},
- {Below, "Below"},
- {BottomIf, "BottomIf"},
- {TopIf, "TopIf"},
- {Opposite, "Opposite"},
- {-1, NULL}
-};
-
-static TkStateMap propNotify[] = {
- {PropertyNewValue, "NewValue"},
- {PropertyDelete, "Delete"},
- {-1, NULL}
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleEventGenerate --
- *
- * Helper function for the "event generate" command. Generate and
- * process an XEvent, constructed from information parsed from the
- * event description string and its optional arguments.
- *
- * argv[0] contains name of the target window.
- * argv[1] contains pattern string for one event (e.g, <Control-v>).
- * argv[2..argc-1] contains -field/option pairs for specifying
- * additional detail in the generated event.
- *
- * Either virtual or physical events can be generated this way.
- * The event description string must contain the specification
- * for only one event.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When constructing the event,
- * event.xany.serial is filled with the current X serial number.
- * event.xany.window is filled with the target window.
- * event.xany.display is filled with the target window's display.
- * Any other fields in eventPtr which are not specified by the pattern
- * string or the optional arguments, are set to 0.
- *
- * The event may be handled sychronously or asynchronously, depending
- * on the value specified by the optional "-when" option. The
- * default setting is synchronous.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SendEventCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- XEvent event;
- CONST char *p;
- char *name;
- Window window;
- Display *display;
- Tk_Window tkwin;
- int count, flags, synch, i, number, warp;
- Tcl_QueuePosition pos;
- Pattern pat;
- unsigned long eventMask;
- static CONST char *fieldStrings[] = {
- "-when", "-above", "-borderwidth", "-button",
- "-count", "-delta", "-detail", "-focus",
- "-height",
- "-keycode", "-keysym", "-mode", "-override",
- "-place", "-root", "-rootx", "-rooty",
- "-sendevent", "-serial", "-state", "-subwindow",
- "-time", "-warp", "-width", "-window",
- "-x", "-y", NULL
- };
- enum field {
- EVENT_WHEN, EVENT_ABOVE, EVENT_BORDER, EVENT_BUTTON,
- EVENT_COUNT, EVENT_DELTA, EVENT_DETAIL, EVENT_FOCUS,
- EVENT_HEIGHT,
- EVENT_KEYCODE, EVENT_KEYSYM, EVENT_MODE, EVENT_OVERRIDE,
- EVENT_PLACE, EVENT_ROOT, EVENT_ROOTX, EVENT_ROOTY,
- EVENT_SEND, EVENT_SERIAL, EVENT_STATE, EVENT_SUBWINDOW,
- EVENT_TIME, EVENT_WARP, EVENT_WIDTH, EVENT_WINDOW,
- EVENT_X, EVENT_Y
- };
- tkwin = Tk_MainWindow(interp);
- if (Blt_GetWindowFromObj(interp, objv[1], &window) != TCL_OK) {
- return TCL_ERROR;
- }
- name = Tcl_GetStringFromObj(objv[2], NULL);
-
- display = Tk_Display(tkwin);
- p = name;
- eventMask = 0;
- count = ParseEventDescription(interp, &p, &pat, &eventMask);
- if (count == 0) {
- return TCL_ERROR;
- }
- if (count != 1) {
- Tcl_AppendResult(interp, "Double or Triple modifier not allowed",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (*p != '\0') {
- Tcl_AppendResult(interp, "only one event specification allowed",
- (char *)NULL);
- return TCL_ERROR;
- }
-
- memset((VOID *) &event, 0, sizeof(event));
- event.xany.type = pat.eventType;
- event.xany.serial = NextRequest(display);
- event.xany.send_event = False;
- event.xany.window = window;
- event.xany.display = display;
-
- flags = flagArray[event.xany.type];
- if (flags & DESTROY) {
- /*
- * Event DestroyNotify should be generated by destroying
- * the window.
- */
- XDestroyWindow(display, window);
- return TCL_OK;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
- event.xkey.state = pat.needMods;
- if ((flags & KEY) && (event.xany.type != MouseWheelEvent)) {
- TkpSetKeycodeAndState(tkwin, pat.detail.keySym, &event);
- } else if (flags & BUTTON) {
- event.xbutton.button = pat.detail.button;
- } else if (flags & VIRTUAL) {
- ((XVirtualEvent *) &event)->name = pat.detail.name;
- }
- }
- if (flags & (CREATE|UNMAP|MAP|REPARENT|CONFIG|GRAVITY|CIRC)) {
- event.xcreatewindow.window = event.xany.window;
- }
-
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.x_root = -1;
- event.xkey.y_root = -1;
- }
-
- /*
- * Process the remaining arguments to fill in additional fields
- * of the event.
- */
-
- synch = 1;
- warp = 0;
- pos = TCL_QUEUE_TAIL;
- for (i = 3; i < objc; i += 2) {
- Tcl_Obj *optionPtr, *valuePtr;
- int index;
-
- optionPtr = objv[i];
- valuePtr = objv[i + 1];
-
- if (Tcl_GetIndexFromObj(interp, optionPtr, fieldStrings, "option",
- TCL_EXACT, &index) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((objc & 1) == 0) {
- /*
- * This test occurs after Tcl_GetIndexFromObj() so that
- * "event generate <Button> -xyz" will return the error message
- * that "-xyz" is a bad option, rather than that the value
- * for "-xyz" is missing.
- */
-
- Tcl_AppendResult(interp, "value for \"",
- Tcl_GetStringFromObj(optionPtr, NULL), "\" missing",
- (char *)NULL);
- return TCL_ERROR;
- }
-
- switch ((enum field) index) {
- case EVENT_WARP: {
- if (Tcl_GetBooleanFromObj(interp, valuePtr, &warp) != TCL_OK) {
- return TCL_ERROR;
- }
- if (!(flags & (KEY_BUTTON_MOTION_VIRTUAL))) {
- goto badopt;
- }
- break;
- }
- case EVENT_WHEN: {
-#ifdef notdef
- pos = (Tcl_QueuePosition) TkFindStateNumObj(interp, optionPtr,
- queuePosition, valuePtr);
- if ((int) pos < -1) {
- return TCL_ERROR;
- }
- synch = 0;
- if ((int) pos == -1) {
- synch = 1;
- }
-#endif
- break;
- }
- case EVENT_ABOVE: {
- Window window2;
-
- if (Blt_GetWindowFromObj(interp, valuePtr, &window2) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & CONFIG) {
- event.xconfigure.above = window2;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_BORDER: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number)!=TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (CREATE|CONFIG)) {
- event.xcreatewindow.border_width = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_BUTTON: {
- if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & BUTTON) {
- event.xbutton.button = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_COUNT: {
- if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & EXPOSE) {
- event.xexpose.count = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_DELTA: {
- if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((flags & KEY) && (event.xkey.type == MouseWheelEvent)) {
- event.xkey.keycode = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_DETAIL: {
- number = TkFindStateNumObj(interp, optionPtr, notifyDetail,
- valuePtr);
- if (number < 0) {
- return TCL_ERROR;
- }
- if (flags & FOCUS) {
- event.xfocus.detail = number;
- } else if (flags & CROSSING) {
- event.xcrossing.detail = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_FOCUS: {
- if (Tcl_GetBooleanFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & CROSSING) {
- event.xcrossing.focus = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_HEIGHT: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & EXPOSE) {
- event.xexpose.height = number;
- } else if (flags & CONFIG) {
- event.xconfigure.height = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_KEYCODE: {
- if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((flags & KEY) && (event.xkey.type != MouseWheelEvent)) {
- event.xkey.keycode = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_KEYSYM: {
- KeySym keysym;
- char *value;
-
- value = Tcl_GetStringFromObj(valuePtr, NULL);
- keysym = TkStringToKeysym(value);
- if (keysym == NoSymbol) {
- Tcl_AppendResult(interp, "unknown keysym \"", value, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
-
- TkpSetKeycodeAndState(tkwin, keysym, &event);
- if (event.xkey.keycode == 0) {
- Tcl_AppendResult(interp, "no keycode for keysym \"", value,
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (!(flags & KEY) || (event.xkey.type == MouseWheelEvent)) {
- goto badopt;
- }
- break;
- }
- case EVENT_MODE: {
- number = TkFindStateNumObj(interp, optionPtr, notifyMode,
- valuePtr);
- if (number < 0) {
- return TCL_ERROR;
- }
- if (flags & CROSSING) {
- event.xcrossing.mode = number;
- } else if (flags & FOCUS) {
- event.xfocus.mode = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_OVERRIDE: {
- if (Tcl_GetBooleanFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & CREATE) {
- event.xcreatewindow.override_redirect = number;
- } else if (flags & MAP) {
- event.xmap.override_redirect = number;
- } else if (flags & REPARENT) {
- event.xreparent.override_redirect = number;
- } else if (flags & CONFIG) {
- event.xconfigure.override_redirect = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_PLACE: {
- number = TkFindStateNumObj(interp, optionPtr, circPlace,
- valuePtr);
- if (number < 0) {
- return TCL_ERROR;
- }
- if (flags & CIRC) {
- event.xcirculate.place = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_ROOT: {
- Window window2;
-
- if (Blt_GetWindowFromObj(interp, valuePtr, &window2) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.root = window2;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_ROOTX: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.x_root = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_ROOTY: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.y_root = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_SEND: {
- CONST char *value;
-
- value = Tcl_GetStringFromObj(valuePtr, NULL);
- if (isdigit(UCHAR(value[0]))) {
- /*
- * Allow arbitrary integer values for the field; they
- * are needed by a few of the tests in the Tk test suite.
- */
-
- if (Tcl_GetIntFromObj(interp, valuePtr, &number)
- != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- if (Tcl_GetBooleanFromObj(interp, valuePtr, &number)
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- event.xany.send_event = number;
- break;
- }
- case EVENT_SERIAL: {
- if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- event.xany.serial = number;
- break;
- }
- case EVENT_STATE: {
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- if (Tcl_GetIntFromObj(interp, valuePtr, &number)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
- event.xkey.state = number;
- } else {
- event.xcrossing.state = number;
- }
- } else if (flags & VISIBILITY) {
- number = TkFindStateNumObj(interp, optionPtr, visNotify,
- valuePtr);
- if (number < 0) {
- return TCL_ERROR;
- }
- event.xvisibility.state = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_SUBWINDOW: {
- Window window2;
-
- if (Blt_GetWindowFromObj(interp, valuePtr, &window2) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.subwindow = window2;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_TIME: {
- if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.time = (Time) number;
- } else if (flags & PROP) {
- event.xproperty.time = (Time) number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_WIDTH: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & EXPOSE) {
- event.xexpose.width = number;
- } else if (flags & (CREATE|CONFIG)) {
- event.xcreatewindow.width = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_WINDOW: {
- Window window2;
-
- if (Blt_GetWindowFromObj(interp, valuePtr, &window2) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (CREATE|UNMAP|MAP|REPARENT|CONFIG
- |GRAVITY|CIRC)) {
- event.xcreatewindow.window = window2;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_X: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.x = number;
- /*
- * Only modify rootx as well if it hasn't been changed.
- */
- if (event.xkey.x_root == -1) {
- int rootX, rootY;
-
- Tk_GetRootCoords(tkwin, &rootX, &rootY);
- event.xkey.x_root = rootX + number;
- }
- } else if (flags & EXPOSE) {
- event.xexpose.x = number;
- } else if (flags & (CREATE|CONFIG|GRAVITY)) {
- event.xcreatewindow.x = number;
- } else if (flags & REPARENT) {
- event.xreparent.x = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_Y: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.y = number;
- /*
- * Only modify rooty as well if it hasn't been changed.
- */
- if (event.xkey.y_root == -1) {
- int rootX, rootY;
-
- Tk_GetRootCoords(tkwin, &rootX, &rootY);
- event.xkey.y_root = rootY + number;
- }
- } else if (flags & EXPOSE) {
- event.xexpose.y = number;
- } else if (flags & (CREATE|CONFIG|GRAVITY)) {
- event.xcreatewindow.y = number;
- } else if (flags & REPARENT) {
- event.xreparent.y = number;
- } else {
- goto badopt;
- }
- break;
- }
- }
- continue;
-
- badopt:
- Tcl_AppendResult(interp, name, " event doesn't accept \"",
- Tcl_GetStringFromObj(optionPtr, NULL), "\" option",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (!XSendEvent(display, window, False, pat.eventType, &event)) {
- fprintf(stderr, "synthethic event failed\n");
- }
- return TCL_OK;
-}
-
-int
-Blt_SendEventCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {
- "sendevent", SendEventCmd,
- };
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
diff --git a/blt3.0.1/src/bltBind.h b/blt3.0.1/src/bltBind.h
deleted file mode 100644
index 2e2c5cb..0000000
--- a/blt3.0.1/src/bltBind.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * bltBind.h --
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_BIND_H
-#define _BLT_BIND_H
-
-#include <bltList.h>
-
-typedef struct _Blt_BindTable *Blt_BindTable;
-
-typedef ClientData (Blt_BindPickProc)(ClientData clientData, int x, int y,
- ClientData *contextPtr);
-
-typedef void (Blt_BindTagProc)(Blt_BindTable bindTable, ClientData object,
- ClientData context, Blt_List list);
-
-
-/*
- * Binding structure information:
- */
-
-struct _Blt_BindTable {
- unsigned int flags;
- Tk_BindingTable bindingTable;
- /* Table of all bindings currently defined.
- * NULL means that no bindings exist, so the
- * table hasn't been created. Each "object"
- * used for this table is either a Tk_Uid for
- * a tag or the address of an item named by
- * id. */
-
- ClientData currentItem; /* The item currently containing the mouse
- * pointer, or NULL if none. */
- ClientData currentContext; /* One word indicating what kind of object was
- * picked. */
-
- ClientData newItem; /* The item that is about to become the
- * current one, or NULL. This field is used
- * to detect deletions of the new current item
- * pointer that occur during Leave processing
- * of the previous current tab. */
- ClientData newContext; /* One-word indicating what kind of object was
- * just picked. */
-
- ClientData focusItem;
- ClientData focusContext;
-
- XEvent pickEvent; /* The event upon which the current choice of
- * the current tab is based. Must be saved so
- * that if the current item is deleted, we can
- * pick another. */
- int activePick; /* The pick event has been initialized so that
- * we can repick it */
-
- int state; /* Last known modifier state. Used to defer
- * picking a new current object while buttons
- * are down. */
-
- ClientData clientData;
- Tk_Window tkwin;
- Blt_BindPickProc *pickProc; /* Routine to report the item the mouse is
- * currently over. */
- Blt_BindTagProc *tagProc; /* Routine to report tags picked items. */
-};
-
-BLT_EXTERN void Blt_DestroyBindingTable(Blt_BindTable table);
-
-BLT_EXTERN Blt_BindTable Blt_CreateBindingTable(Tcl_Interp *interp,
- Tk_Window tkwin, ClientData clientData, Blt_BindPickProc *pickProc,
- Blt_BindTagProc *tagProc);
-
-BLT_EXTERN int Blt_ConfigureBindings(Tcl_Interp *interp, Blt_BindTable table,
- ClientData item, int argc, const char **argv);
-
-BLT_EXTERN int Blt_ConfigureBindingsFromObj(Tcl_Interp *interp,
- Blt_BindTable table, ClientData item, int objc, Tcl_Obj *const *objv);
-
-BLT_EXTERN void Blt_PickCurrentItem(Blt_BindTable table);
-
-BLT_EXTERN void Blt_DeleteBindings(Blt_BindTable table, ClientData object);
-
-BLT_EXTERN void Blt_MoveBindingTable(Blt_BindTable table, Tk_Window tkwin);
-
-#define Blt_SetFocusItem(bindPtr, object, context) \
- ((bindPtr)->focusItem = (ClientData)(object),\
- (bindPtr)->focusContext = (ClientData)(context))
-
-#define Blt_SetCurrentItem(bindPtr, object, context) \
- ((bindPtr)->currentItem = (ClientData)(object),\
- (bindPtr)->currentContext = (ClientData)(context))
-
-#define Blt_GetCurrentItem(bindPtr) ((bindPtr)->currentItem)
-#define Blt_GetCurrentContext(bindPtr) ((bindPtr)->currentContext)
-#define Blt_GetLatestItem(bindPtr) ((bindPtr)->newItem)
-
-#define Blt_GetBindingData(bindPtr) ((bindPtr)->clientData)
-
-#endif /*_BLT_BIND_H*/
diff --git a/blt3.0.1/src/bltBitmap.c b/blt3.0.1/src/bltBitmap.c
deleted file mode 100644
index 9cb7bbb..0000000
--- a/blt3.0.1/src/bltBitmap.c
+++ /dev/null
@@ -1,1415 +0,0 @@
-
-/*
- * bltBitmap.c --
- *
- * This module implements TCL bitmaps for the Tk toolkit.
- *
- * Copyright 1993-1998 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Much of the code is taken from XRdBitF.c and XWrBitF.c from the MIT
- * X11R5 distribution.
- *
- * Copyright, 1987, Massachusetts Institute of Technology
- * Permission to use, copy, modify, distribute, and sell this
- * software and its documentation for any purpose is hereby
- * granted without fee, provided that the above copyright notice
- * appear in all copies and that both that copyright notice and
- * this permission notice appear in supporting documentation, and
- * that the name of M.I.T. not be used in advertising or
- * publicity pertaining to distribution of the software without
- * specific, written prior permission. M.I.T. makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- */
-
-/*
- Predefined table holds bitmap info (source width, height)
- Name table holds bitmap names
- Id table hold bitmap ids
- Both id and name tables get you the actual bitmap.
- */
-#include "bltInt.h"
-
-#ifndef NO_BITMAP
-#include "bltOp.h"
-#include "bltHash.h"
-#include "bltFont.h"
-#include "bltText.h"
-#include <X11/Xutil.h>
-
-#define BITMAP_THREAD_KEY "BLT Bitmap Data"
-
-/*
- * BitmapInterpData --
- *
- * Tk's routine to create a bitmap, Tk_DefineBitmap, assumes that
- * the source (bit array) is always statically allocated. This
- * isn't true here (we dynamically allocate the arrays), so we have
- * to save them in a hashtable and cleanup after the interpreter
- * is deleted.
- */
-typedef struct {
- Blt_HashTable bitmapTable; /* Hash table of bitmap data keyed by
- * the name of the bitmap. */
- Tcl_Interp *interp;
- Display *display; /* Display of interpreter. */
- Tk_Window tkMain; /* Main window of interpreter. */
-} BitmapInterpData;
-
-#define MAX_SIZE 255
-
-/*
- * BitmapInfo --
- */
-typedef struct {
- float angle; /* Rotation of text string */
- float scale; /* Scaling factor */
- Blt_Font font; /* Font pointer */
- Tk_Justify justify; /* Justify text */
- Blt_Pad xPad, yPad; /* Padding around the text */
-} BitmapInfo;
-
-/*
- * BitmapData --
- */
-typedef struct {
- int width, height; /* Dimension of image */
- unsigned char *bits; /* Data array for bitmap image */
-} BitmapData;
-
-#define DEF_BITMAP_FONT STD_FONT
-#define DEF_BITMAP_PAD "4"
-#define DEF_BITMAP_ANGLE "0.0"
-#define DEF_BITMAP_SCALE "1.0"
-#define DEF_BITMAP_JUSTIFY "center"
-
-#define ROTATE_0 0
-#define ROTATE_90 1
-#define ROTATE_180 2
-#define ROTATE_270 3
-
-
-static Blt_ConfigSpec composeConfigSpecs[] =
-{
- {BLT_CONFIG_FONT, "-font", (char *)NULL, (char *)NULL,
- DEF_BITMAP_FONT, Blt_Offset(BitmapInfo, font), 0},
- {BLT_CONFIG_JUSTIFY, "-justify", (char *)NULL, (char *)NULL,
- DEF_BITMAP_JUSTIFY, Blt_Offset(BitmapInfo, justify),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-padx", (char *)NULL, (char *)NULL,
- DEF_BITMAP_PAD, Blt_Offset(BitmapInfo, xPad),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-pady", (char *)NULL, (char *)NULL,
- DEF_BITMAP_PAD, Blt_Offset(BitmapInfo, yPad),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FLOAT, "-rotate", (char *)NULL, (char *)NULL,
- DEF_BITMAP_ANGLE, Blt_Offset(BitmapInfo, angle),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FLOAT, "-scale", (char *)NULL, (char *)NULL,
- DEF_BITMAP_SCALE, Blt_Offset(BitmapInfo, scale),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-static Blt_ConfigSpec defineConfigSpecs[] =
-{
- {BLT_CONFIG_FLOAT, "-rotate", (char *)NULL, (char *)NULL,
- DEF_BITMAP_ANGLE, Blt_Offset(BitmapInfo, angle),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FLOAT, "-scale", (char *)NULL, (char *)NULL,
- DEF_BITMAP_SCALE, Blt_Offset(BitmapInfo, scale),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-/* Shared data for the image read/parse logic */
-static unsigned char hexTable[256]; /* conversion value */
-static int initialized = 0; /* easier to fill in at run time */
-
-#define blt_width 40
-#define blt_height 40
-static unsigned char blt_bits[] =
-{
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x04,
- 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, 0xe4, 0x33, 0x3f,
- 0x01, 0x00, 0x64, 0x36, 0x0c, 0x01, 0x00, 0x64, 0x36, 0x8c, 0x00, 0x00,
- 0xe4, 0x33, 0x8c, 0x00, 0x00, 0x64, 0x36, 0x8c, 0x00, 0x00, 0x64, 0x36,
- 0x0c, 0x01, 0x00, 0xe4, 0xf3, 0x0d, 0x01, 0x00, 0x04, 0x00, 0x00, 0x02,
- 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x0c,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xf8, 0xff,
- 0x03, 0x80, 0xed, 0x07, 0x00, 0x04, 0xe0, 0x0c, 0x00, 0x20, 0x09, 0x10,
- 0x0c, 0x00, 0x00, 0x12, 0x10, 0x0c, 0x00, 0x00, 0x10, 0x30, 0x00, 0x00,
- 0x00, 0x19, 0xd0, 0x03, 0x00, 0x00, 0x14, 0xb0, 0xfe, 0xff, 0xff, 0x1b,
- 0x50, 0x55, 0x55, 0x55, 0x0d, 0xe8, 0xaa, 0xaa, 0xaa, 0x16, 0xe4, 0xff,
- 0xff, 0xff, 0x2f, 0xf4, 0xff, 0xff, 0xff, 0x27, 0xd8, 0xae, 0xaa, 0xbd,
- 0x2d, 0x6c, 0x5f, 0xd5, 0x67, 0x1b, 0xbc, 0xf3, 0x7f, 0xd0, 0x36, 0xf8,
- 0x01, 0x10, 0xcc, 0x1f, 0xe0, 0x45, 0x8e, 0x92, 0x0f, 0xb0, 0x32, 0x41,
- 0x43, 0x0b, 0xd0, 0xcf, 0x3c, 0x7c, 0x0d, 0xb0, 0xaa, 0xc2, 0xab, 0x0a,
- 0x60, 0x55, 0x55, 0x55, 0x05, 0xc0, 0xff, 0xab, 0xaa, 0x03, 0x00, 0x00,
- 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-#define bigblt_width 64
-#define bigblt_height 64
-static unsigned char bigblt_bits[] =
-{
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00,
- 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0xe2, 0x0f, 0xc7, 0xff, 0x10, 0x00, 0x00, 0x00, 0xe2, 0x1f,
- 0xc7, 0xff, 0x10, 0x00, 0x00, 0x00, 0xe2, 0x38, 0x07, 0x1c, 0x08, 0x00,
- 0x00, 0x00, 0xe2, 0x38, 0x07, 0x1c, 0x08, 0x00, 0x00, 0x00, 0xe2, 0x38,
- 0x07, 0x1c, 0x08, 0x00, 0x00, 0x00, 0xe2, 0x1f, 0x07, 0x1c, 0x04, 0x00,
- 0x00, 0x00, 0xe2, 0x1f, 0x07, 0x1c, 0x04, 0x00, 0x00, 0x00, 0xe2, 0x38,
- 0x07, 0x1c, 0x08, 0x00, 0x00, 0x00, 0xe2, 0x38, 0x07, 0x1c, 0x08, 0x00,
- 0x00, 0x00, 0xe2, 0x38, 0x07, 0x1c, 0x08, 0x00, 0x00, 0x00, 0xe2, 0x1f,
- 0xff, 0x1c, 0x10, 0x00, 0x00, 0x00, 0xe2, 0x0f, 0xff, 0x1c, 0x10, 0x00,
- 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00,
- 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x06, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xc0, 0xff, 0xff, 0x07, 0x00,
- 0x00, 0xe0, 0xf6, 0x3f, 0x00, 0x00, 0x38, 0x00, 0x00, 0x1c, 0x06, 0x00,
- 0x00, 0x00, 0xc0, 0x00, 0x80, 0x03, 0x06, 0x00, 0x00, 0xc0, 0x08, 0x03,
- 0x40, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x06, 0x00,
- 0x00, 0x00, 0x40, 0x04, 0x40, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x04,
- 0x40, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x04, 0xc0, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0c, 0x06, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
- 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x06, 0x40, 0x55, 0xff, 0xff,
- 0xff, 0xff, 0x7f, 0x05, 0x80, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x06,
- 0x80, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x03, 0x40, 0xab, 0xaa, 0xaa,
- 0xaa, 0xaa, 0xaa, 0x01, 0x70, 0x57, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x04,
- 0x28, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0xd8, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0x14, 0xd0, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13,
- 0xf0, 0xda, 0xbf, 0xaa, 0xba, 0xfd, 0xd6, 0x0b, 0x70, 0xed, 0x77, 0x55,
- 0x57, 0xe5, 0xad, 0x07, 0xb8, 0xf7, 0xab, 0xaa, 0xaa, 0xd2, 0x5b, 0x0f,
- 0xf8, 0xfb, 0x54, 0x55, 0x75, 0x94, 0xf7, 0x1e, 0xf0, 0x7b, 0xfa, 0xff,
- 0x9f, 0xa9, 0xef, 0x1f, 0xc0, 0xbf, 0x00, 0x20, 0x40, 0x54, 0xfe, 0x0f,
- 0x00, 0x1f, 0x92, 0x00, 0x04, 0xa9, 0xfc, 0x01, 0xc0, 0x5f, 0x41, 0xf9,
- 0x04, 0x21, 0xfd, 0x00, 0xc0, 0x9b, 0x28, 0x04, 0xd8, 0x0a, 0x9a, 0x03,
- 0x40, 0x5d, 0x08, 0x40, 0x44, 0x44, 0x62, 0x03, 0xc0, 0xaa, 0x67, 0xe2,
- 0x03, 0x64, 0xba, 0x02, 0x40, 0x55, 0xd5, 0x55, 0xfd, 0xdb, 0x55, 0x03,
- 0x80, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x01, 0x00, 0x57, 0x55, 0x55,
- 0x55, 0x55, 0xd5, 0x00, 0x00, 0xac, 0xaa, 0xaa, 0xaa, 0xaa, 0x2a, 0x00,
- 0x00, 0xf0, 0xff, 0x57, 0x55, 0x55, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xf8,
- 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-static Tcl_ObjCmdProc BitmapCmd;
-static Tcl_InterpDeleteProc BitmapInterpDeleteProc;
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetHexValue --
- *
- * Converts the hexadecimal string into an unsigned integer
- * value. The hexadecimal string need not have a leading "0x".
- *
- * Results:
- * Returns a standard TCL result. If the conversion was
- * successful, TCL_OK is returned, otherwise TCL_ERROR.
- *
- * Side Effects:
- * If the conversion fails, interp->result is filled with an
- * error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetHexValue(Tcl_Interp *interp, const char *string, int *valuePtr)
-{
- const char *s;
- int value;
-
- s = string;
- if ((s[0] == '0') && ((s[1] == 'x') || (s[1] == 'X'))) {
- s += 2;
- }
- if (s[0] == '\0') {
- Tcl_AppendResult(interp, "expecting hex value: got \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR; /* Only found "0x" */
- }
- value = 0;
- for ( /*empty*/ ; *s != '\0'; s++) {
- unsigned char byte;
-
- /* Trim high bits, check type and accumulate */
- byte = hexTable[(int)*s];
- if (byte == 0xFF) {
- Tcl_AppendResult(interp, "expecting hex value: got \"", string,
- "\"", (char *)NULL);
- return TCL_ERROR; /* Not a hexadecimal number */
- }
- value = (value << 4) | byte;
- }
- *valuePtr = value;
- return TCL_OK;
-}
-
-#ifdef WIN32
-/*
- *---------------------------------------------------------------------------
- *
- * BitmapToData --
- *
- * Converts a bitmap into an data array.
- *
- * Results:
- * Returns the number of bytes in an data array representing the bitmap.
- *
- * Side Effects:
- * Memory is allocated for the data array. Caller must free
- * array later.
- *
- *---------------------------------------------------------------------------
- */
-static int
-BitmapToData(
- Tk_Window tkwin, /* Main window of interpreter */
- Pixmap bitmap, /* Bitmap to be queried */
- int width, int height, /* Dimensions of the bitmap */
- unsigned char **bitsPtr) /* Pointer to converted array of data */
-{
- int y;
- int count;
- int nBytes, bytes_per_line;
- unsigned char *bits;
- unsigned char *srcBits;
- int bytesPerRow;
-
- *bitsPtr = NULL;
- srcBits = Blt_GetBitmapData(Tk_Display(tkwin), bitmap, width, height,
- &bytesPerRow);
- if (srcBits == NULL) {
- OutputDebugString("BitmapToData: Can't get bitmap data");
- return 0;
- }
- bytes_per_line = (width + 7) / 8;
- nBytes = height * bytes_per_line;
- bits = Blt_AssertMalloc(sizeof(unsigned char) * nBytes);
- count = 0;
- for (y = height - 1; y >= 0; y--) {
- unsigned char *srcPtr;
- int value, bitMask;
- int x;
-
- srcPtr = srcBits + (bytesPerRow * y);
- value = 0, bitMask = 1;
- for (x = 0; x < width; /* empty */ ) {
- unsigned long pixel;
-
- pixel = (*srcPtr & (0x80 >> (x % 8)));
- if (pixel) {
- value |= bitMask;
- }
- bitMask <<= 1;
- x++;
- if (!(x & 7)) {
- bits[count++] = (unsigned char)value;
- value = 0, bitMask = 1;
- srcPtr++;
- }
- }
- if (x & 7) {
- bits[count++] = (unsigned char)value;
- }
- }
- *bitsPtr = bits;
- return count;
-}
-
-#else
-
-/*
- *---------------------------------------------------------------------------
- *
- * BitmapToData --
- *
- * Converts a bitmap into an data array.
- *
- * Results:
- * Returns the number of bytes in an data array representing the bitmap.
- *
- * Side Effects:
- * Memory is allocated for the data array. Caller must free
- * array later.
- *
- *---------------------------------------------------------------------------
- */
-static int
-BitmapToData(
- Tk_Window tkwin, /* Main window of interpreter */
- Pixmap bitmap, /* Bitmap to be queried */
- int width, int height, /* Dimensions of the bitmap */
- unsigned char **bitsPtr) /* Pointer to converted array of data */
-{
- int y;
- int count;
- int nBytes, bytes_per_line;
- Display *display;
- XImage *imagePtr;
- unsigned char *bits;
-
- display = Tk_Display(tkwin);
- /* Convert the bitmap to an X image */
- imagePtr = XGetImage(display, bitmap, 0, 0, width, height, 1L, XYPixmap);
- /*
- * The slow but robust brute force method of converting an X image:
- */
- bytes_per_line = (width + 7) / 8;
- nBytes = height * bytes_per_line;
- bits = Blt_AssertMalloc(sizeof(unsigned char) * nBytes);
- count = 0;
- for (y = 0; y < height; y++) {
- int value, bitMask;
- int x;
-
- value = 0, bitMask = 1;
- for (x = 0; x < width; /*empty*/ ) {
- unsigned long pixel;
-
- pixel = XGetPixel(imagePtr, x, y);
- if (pixel) {
- value |= bitMask;
- }
- bitMask <<= 1;
- x++;
- if (!(x & 7)) {
- bits[count++] = (unsigned char)value;
- value = 0, bitMask = 1;
- }
- }
- if (x & 7) {
- bits[count++] = (unsigned char)value;
- }
- }
- XDestroyImage(imagePtr);
- *bitsPtr = bits;
- return count;
-}
-
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * AsciiToData --
- *
- * Converts a TCL list of ASCII values into a data array.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * If an error occurs while processing the data, interp->result
- * is filled with a corresponding error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AsciiToData(
- Tcl_Interp *interp, /* Interpreter to report results to */
- char *elemList, /* List of of hex numbers representing
- * bitmap data */
- int width, int height, /* Dimension of bitmap. */
- unsigned char **bitsPtr) /* data array (output) */
-{
- int nBytes; /* Number of bytes of data */
- int value; /* from an input line */
- int padding; /* to handle alignment */
- int bytesPerLine; /* per scanline of data */
- unsigned char *bits;
- int count;
- enum Formats {
- V10, V11
- } format;
- int i; /* */
- const char **valueArr;
- int nValues;
-
- /* First time through initialize the ascii->hex translation table */
- if (!initialized) {
- Blt_InitHexTable(hexTable);
- initialized = 1;
- }
- if (Tcl_SplitList(interp, elemList, &nValues, &valueArr) != TCL_OK) {
- return TCL_ERROR;
- }
- bytesPerLine = (width + 7) / 8;
- nBytes = bytesPerLine * height;
- if (nValues == nBytes) {
- format = V11;
- } else if (nValues == (nBytes / 2)) {
- format = V10;
- } else {
- Tcl_AppendResult(interp, "bitmap has wrong # of data values",
- (char *)NULL);
- goto error;
- }
- padding = 0;
- if (format == V10) {
- padding = ((width % 16) && ((width % 16) < 9));
- if (padding) {
- bytesPerLine = (width + 7) / 8 + padding;
- nBytes = bytesPerLine * height;
- }
- }
- bits = Blt_Calloc(nBytes, sizeof(unsigned char));
- if (bits == NULL) {
- Tcl_AppendResult(interp, "can't allocate memory for bitmap",
- (char *)NULL);
- goto error;
- }
- count = 0;
- for (i = 0; i < nValues; i++) {
- if (GetHexValue(interp, valueArr[i], &value) != TCL_OK) {
- Blt_Free(bits);
- goto error;
- }
- bits[count++] = (unsigned char)value;
- if (format == V10) {
- if ((!padding) || (((i * 2) + 2) % bytesPerLine)) {
- bits[count++] = value >> 8;
- }
- }
- }
- Blt_Free(valueArr);
- *bitsPtr = bits;
- return TCL_OK;
- error:
- Blt_Free(valueArr);
- return TCL_ERROR;
-}
-
-static int
-ParseListData(
- Tcl_Interp *interp,
- Tcl_Obj *objPtr,
- int *widthPtr,
- int *heightPtr,
- unsigned char **bitsPtr)
-{
- char *p;
- int width, height;
- char *string;
- int objc;
- Tcl_Obj **objv;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 2) {
- Tcl_Obj **dims;
- int nDims;
-
- if (Tcl_ListObjGetElements(interp, objv[0], &nDims, &dims) != TCL_OK) {
- return TCL_ERROR;
- }
- if (nDims != 2) {
- Tcl_AppendResult(interp, "wrong # of bitmap dimensions: ",
- "should be \"width height\"", (char *)NULL);
- return TCL_ERROR;
- }
- if ((Tcl_GetIntFromObj(interp, dims[0], &width) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, dims[1], &height) != TCL_OK)) {
- return TCL_ERROR;
- }
- string = Tcl_GetString(objv[1]);
- } else if (objc == 3) {
- if ((Tcl_GetIntFromObj(interp, objv[0], &width) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[1], &height) != TCL_OK)) {
- return TCL_ERROR;
- }
- string = Tcl_GetString(objv[2]);
- } else {
- Tcl_AppendResult(interp, "wrong # of bitmap data components: ",
- "should be \"dimensions sourceData\"", (char *)NULL);
- return TCL_ERROR;;
- }
- if ((width < 1) || (height < 1)) {
- Tcl_AppendResult(interp, "bad bitmap dimensions", (char *)NULL);
- return TCL_ERROR;
- }
- /* Convert commas to blank spaces */
- string = Blt_AssertStrdup(string);
- for (p = string; *p != '\0'; p++) {
- if (*p == ',') {
- *p = ' ';
- }
- }
- if (AsciiToData(interp, string, width, height, bitsPtr) != TCL_OK) {
- Blt_Free(string);
- return TCL_ERROR;
- }
- *widthPtr = width;
- *heightPtr = height;
- return TCL_OK;
-}
-
-/*
- * Parse the lines that define the dimensions of the bitmap,
- * plus the first line that defines the bitmap data (it declares
- * the name of a data variable but doesn't include any actual
- * data). These lines look something like the following:
- *
- * #define foo_width 16
- * #define foo_height 16
- * #define foo_x_hot 3
- * #define foo_y_hot 3
- * static char foo_bits[] = {
- *
- * The x_hot and y_hot lines may or may not be present. It's
- * important to check for "char" in the last line, in order to
- * reject old X10-style bitmaps that used shorts.
- */
-
-static int
-ParseStructData(Tcl_Interp *interp, Tcl_Obj *objPtr, int *widthPtr,
- int *heightPtr, unsigned char **bitsPtr)
-{
- int width, height;
- int hotX, hotY;
- char *line, *nextline;
- char *data;
- char *string;
-
- width = height = 0;
- hotX = hotY = -1;
- data = NULL;
- {
- char *p;
-
- /* Skip leading spaces. */
- for (p = Tcl_GetString(objPtr); isspace(UCHAR(*p)); p++) {
- /*empty*/
- }
- string = Blt_AssertStrdup(p);
- }
- nextline = string;
- for (line = string; nextline != NULL; line = nextline + 1) {
- Tcl_RegExp re;
-
- nextline = strchr(line, '\n');
- if ((nextline == NULL) || (line == nextline)) {
- continue; /* Empty line */
- }
- *nextline = '\0';
- re = Tcl_RegExpCompile(interp, " *# *define +");
- if (Tcl_RegExpExec(interp, re, line, line)) {
- const char *start, *end;
- const char *name, *value;
- size_t len;
-
- Tcl_RegExpRange(re, 0, &start, &end);
- name = strtok((char *)end, " \t");
- value = strtok(NULL, " \t");
- if ((name == NULL) || (value == NULL)) {
- Tcl_AppendResult(interp, "what's the error?", (char *)NULL);
- goto error;
- }
- len = strlen(name);
- if ((len >= 6) && (name[len-6] == '_') &&
- (strcmp(name+len-6, "_width") == 0)) {
- if (Tcl_GetInt(interp, value, &width) != TCL_OK) {
- goto error;
- }
- } else if ((len >= 7) && (name[len-7] == '_') &&
- (strcmp(name+len-7, "_height") == 0)) {
- if (Tcl_GetInt(interp, value, &height) != TCL_OK) {
- goto error;
- }
- } else if ((len >= 6) && (name[len-6] == '_') &&
- (strcmp(name+len-6, "_x_hot") == 0)) {
- if (Tcl_GetInt(interp, value, &hotX) != TCL_OK) {
- goto error;
- }
- } else if ((len >= 6) && (name[len-6] == '_') &&
- (strcmp(name+len-6, "_y_hot") == 0)) {
- if (Tcl_GetInt(interp, value, &hotY) != TCL_OK) {
- goto error;
- }
- }
- } else {
- re = Tcl_RegExpCompile(interp, " *static +.*char +");
- if (Tcl_RegExpExec(interp, re, line, line)) {
- char *p;
-
- /* Find the { */
- /* Repair the string so we can search the entire string. */
- *nextline = ' ';
- p = strchr(line, '{');
- if (p == NULL) {
- goto error;
- }
- data = p + 1;
- break;
- } else {
- Tcl_AppendResult(interp, "unknown bitmap format \"", line,
- "\": obsolete X10 bitmap file?", (char *)NULL);
- goto error;
- }
- }
- }
- /*
- * Now we've read everything but the data. Allocate an array
- * and read in the data.
- */
- if ((width <= 0) || (height <= 0)) {
- Tcl_AppendResult(interp, "invalid bitmap dimensions \"", (char *)NULL);
- Tcl_AppendResult(interp, Blt_Itoa(width), " x ", (char *)NULL);
- Tcl_AppendResult(interp, Blt_Itoa(height), "\"", (char *)NULL);
- goto error;
- }
- {
- char *p;
-
- for (p = data; *p != '\0'; p++) {
- if ((*p == ',') || (*p == ';') || (*p == '}')) {
- *p = ' ';
- }
- }
- }
- if (AsciiToData(interp, data, width, height, bitsPtr) != TCL_OK) {
- goto error;
- }
- *widthPtr = width;
- *heightPtr = height;
- Blt_Free(string);
- return TCL_OK;
- error:
- Blt_Free(string);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScaleRotateData --
- *
- * Creates a new data array of the rotated and scaled bitmap.
- *
- * Results:
- * A standard TCL result. If the bitmap data is rotated
- * successfully, TCL_OK is returned. But if memory could not be
- * allocated for the new data array, TCL_ERROR is returned and an
- * error message is left in interp->result.
- *
- * Side Effects:
- * Memory is allocated for rotated, scaled data array. Caller
- * must free array later.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ScaleRotateData(
- Tcl_Interp *interp, /* Interpreter to report results to */
- BitmapData *srcPtr, /* Source bitmap to transform. */
- float angle, /* Number of degrees to rotate the bitmap. */
- float scale, /* Factor to scale the bitmap. */
- BitmapData *destPtr) /* Destination bitmap. */
-{
- int x, y;
- double srcX, srcY, destX, destY; /* Origins of source and destination
- * bitmaps */
- double sinTheta, cosTheta;
- double rotWidth, rotHeight;
- double radians;
- unsigned char *bits;
- int nBytes;
- int srcBytesPerLine, destBytesPerLine;
-
- srcBytesPerLine = (srcPtr->width + 7) / 8;
- Blt_GetBoundingBox(srcPtr->width, srcPtr->height, angle, &rotWidth,
- &rotHeight, (Point2d *)NULL);
- destPtr->width = (int)(rotWidth * scale + 0.5) ;
- destPtr->height = (int)(rotHeight * scale + 0.5);
-
- destBytesPerLine = (destPtr->width + 7) / 8;
- nBytes = destPtr->height * destBytesPerLine;
- bits = Blt_Calloc(nBytes, sizeof(unsigned char));
- if (bits == NULL) {
- Tcl_AppendResult(interp, "can't allocate bitmap data array",
- (char *)NULL);
- return TCL_ERROR;
- }
- scale = 1.0 / scale;
- destPtr->bits = bits;
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians);
- cosTheta = cos(radians);
-
- /*
- * Coordinates of the centers of the source and destination rectangles
- */
- srcX = srcPtr->width * 0.5;
- srcY = srcPtr->height * 0.5;
- destX = rotWidth * 0.5;
- destY = rotHeight * 0.5;
-
- /*
- * Rotate each pixel of dest image, placing results in source X image
- */
- for (y = 0; y < destPtr->height; y++) {
- for (x = 0; x < destPtr->width; x++) {
- double sxd, syd;
- int sx, sy;
- int pixel, ipixel;
-
- sxd = scale * (double)x;
- syd = scale * (double)y;
- if (angle == 270.0) {
- sx = (int)syd, sy = (int)(rotWidth - sxd) - 1;
- } else if (angle == 180.0) {
- sx = (int)(rotWidth - sxd) - 1, sy = (int)(rotHeight - syd) - 1;
- } else if (angle == 90.0) {
- sx = (int)(rotHeight - syd) - 1, sy = (int)sxd;
- } else if (angle == 0.0) {
- sx = (int)sxd, sy = (int)syd;
- } else {
- double tx, ty, rx, ry;
- /* Translate origin to center of destination X image */
-
- tx = sxd - destX;
- ty = syd - destY;
-
- /* Rotate the coordinates about the origin */
-
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source X image */
- rx += srcX;
- ry += srcY;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination X image
- * can be bigger than the source.
- */
-
- if ((sx >= srcPtr->width) || (sx < 0) ||
- (sy >= srcPtr->height) || (sy < 0)) {
- continue;
- }
- }
- ipixel = (srcBytesPerLine * sy) + (sx / 8);
- pixel = srcPtr->bits[ipixel] & (1 << (sx % 8));
- if (pixel) {
- ipixel = (destBytesPerLine * y) + (x / 8);
- bits[ipixel] |= (1 << (x % 8));
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BitmapDataToString --
- *
- * Returns a list of hex values corresponding to the data
- * bits of the bitmap given.
- *
- * Converts the unsigned character value into a two character
- * hexadecimal string. A separator is also added, which may
- * either a newline or space according the the number of bytes
- * already output.
- *
- * Results:
- * Returns TCL_ERROR if a data array can't be generated
- * from the bitmap (memory allocation failure), otherwise TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-static void
-BitmapDataToString(
- Tk_Window tkwin, /* Main window of interpreter */
- Pixmap bitmap, /* Bitmap to be queried */
- Tcl_DString *resultPtr) /* Dynamic string to output results to */
-{
- unsigned char *bits;
- int nBytes;
- int i;
- int width, height;
-
- /* Get the dimensions of the bitmap */
- Tk_SizeOfBitmap(Tk_Display(tkwin), bitmap, &width, &height);
- nBytes = BitmapToData(tkwin, bitmap, width, height, &bits);
-#define BYTES_PER_OUTPUT_LINE 24
- for (i = 0; i < nBytes; i++) {
- const char *separator;
- char string[200];
-
- separator = (i % BYTES_PER_OUTPUT_LINE) ? " " : "\n ";
- sprintf_s(string, 200, "%s%02x", separator, bits[i]);
- Tcl_DStringAppend(resultPtr, string, -1);
- }
- if (bits != NULL) {
- Blt_Free(bits);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComposeOp --
- *
- * Converts the text string into an internal bitmap.
- *
- * There's a lot of extra (read unnecessary) work going on here,
- * but I don't (right now) think that it matters much. The
- * rotated bitmap (formerly an X image) is converted back to an
- * image just so we can convert it to a data array for
- * Tk_DefineBitmap.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * If an error occurs while processing the data, interp->result
- * is filled with a corresponding error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ComposeOp(
- ClientData clientData, /* Thread-specific data for bitmaps. */
- Tcl_Interp *interp, /* Interpreter to report results to */
- int objc, /* Number of arguments */
- Tcl_Obj *const *objv) /* Argument list */
-{
- BitmapInfo bi; /* Text rotation and font information */
- BitmapInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Pixmap bitmap; /* Text bitmap */
- TextLayout *textPtr;
- TextStyle ts;
- char *string;
- float angle;
- int nBytes;
- int isNew;
- int result;
- int width, height; /* Dimensions of bitmap */
- unsigned char *bits; /* Data array derived from text bitmap */
-
- bitmap = Tk_AllocBitmapFromObj((Tcl_Interp *)NULL, dataPtr->tkMain,
- objv[2]);
- if (bitmap != None) {
- Tk_FreeBitmap(dataPtr->display, bitmap);
- return TCL_OK;
- }
- /* Initialize info and process flags */
- bi.justify = TK_JUSTIFY_CENTER;
- bi.angle = 0.0f; /* No rotation or scaling by default */
- bi.scale = 1.0f;
- bi.padLeft = bi.padRight = 0;
- bi.padTop = bi.padBottom = 0;
- bi.font = (Blt_Font)NULL; /* Initialized by Blt_ConfigureWidget */
- if (Blt_ConfigureWidgetFromObj(interp, dataPtr->tkMain, composeConfigSpecs,
- objc - 4, objv + 4, (char *)&bi, 0) != TCL_OK) {
- return TCL_ERROR;
- }
- angle = FMOD(bi.angle, 360.0);
- if (angle < 0.0) {
- angle += 360.0;
- }
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, bi.font);
- Blt_Ts_SetJustify(ts, bi.justify);
- Blt_Ts_SetPadding(ts, bi.xPad.side1, bi.yPad.side2, bi.yPad.side1,
- bi.yPad.side2);
-
- string = Tcl_GetStringFromObj(objv[3], &nBytes);
- textPtr = Blt_Ts_CreateLayout(string, nBytes, &ts);
- bitmap = Blt_Ts_Bitmap(dataPtr->tkMain, textPtr, &ts, &width, &height);
- Blt_Free(textPtr);
- if (bitmap == None) {
- Tcl_AppendResult(interp, "can't create bitmap", (char *)NULL);
- return TCL_ERROR;
- }
- /* Free the font structure, since we don't need it anymore */
- Blt_FreeOptions(composeConfigSpecs, (char *)&bi, dataPtr->display, 0);
-
- /* Convert bitmap back to a data array */
- nBytes = BitmapToData(dataPtr->tkMain, bitmap, width, height, &bits);
- Tk_FreePixmap(dataPtr->display, bitmap);
- if (nBytes == 0) {
- Tcl_AppendResult(interp, "can't get bitmap data", (char *)NULL);
- return TCL_ERROR;
- }
- /* If bitmap is to be rotated or scaled, do it here */
- if ((angle != 0.0) || (bi.scale != 1.0f)) {
- BitmapData srcData, destData;
-
- srcData.bits = bits;
- srcData.width = width;
- srcData.height = height;
-
- result = ScaleRotateData(interp, &srcData, angle, bi.scale, &destData);
- Blt_Free(bits); /* Free the un-transformed data array. */
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- bits = destData.bits;
- width = destData.width;
- height = destData.height;
- }
- /* Create the bitmap again, this time using Tk's bitmap facilities */
- string = Tcl_GetString(objv[2]);
- result = Tk_DefineBitmap(interp, Tk_GetUid(string), (char *)bits,
- width, height);
- if (result != TCL_OK) {
- Blt_Free(bits);
- }
- hPtr = Blt_CreateHashEntry(&dataPtr->bitmapTable, string, &isNew);
- Blt_SetHashValue(hPtr, bits);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DefineOp --
- *
- * Converts the dataList into an internal bitmap.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * If an error occurs while processing the data, interp->result
- * is filled with a corresponding error message.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-DefineOp(
- ClientData clientData, /* Thread-specific data for bitmaps. */
- Tcl_Interp *interp, /* Interpreter to report results to */
- int objc, /* Number of arguments */
- Tcl_Obj *const *objv) /* Argument list */
-{
- BitmapInterpData *dataPtr = clientData;
- int width, height; /* Dimensions of bitmap */
- unsigned char *bits; /* working variable */
- char *p;
- BitmapInfo bi;
- int result;
- float angle;
- Pixmap bitmap;
- Blt_HashEntry *hPtr;
- int isNew;
- char *string;
-
- bitmap = Tk_AllocBitmapFromObj((Tcl_Interp *)NULL, dataPtr->tkMain, objv[2]);
- if (bitmap != None) {
- Tk_FreeBitmap(dataPtr->display, bitmap);
- return TCL_OK;
- }
- /* Initialize info and then process flags */
- bi.angle = 0.0f; /* No rotation by default */
- bi.scale = 1.0f; /* No scaling by default */
- if (Blt_ConfigureWidgetFromObj(interp, dataPtr->tkMain, defineConfigSpecs,
- objc - 4, objv + 4, (char *)&bi, 0) != TCL_OK) {
- return TCL_ERROR;
- }
- bits = NULL;
- /* Skip leading spaces. */
- for (p = Tcl_GetString(objv[3]); isspace(UCHAR(*p)); p++) {
- /*empty*/
- }
- width = height = 0; /* Suppress compiler warning. */
- if (*p == '#') {
- result = ParseStructData(interp, objv[3], &width, &height, &bits);
- } else {
- result = ParseListData(interp, objv[3], &width, &height, &bits);
- }
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- angle = FMOD(bi.angle, 360.0);
- if (angle < 0.0) {
- angle += 360.0;
- }
- /* If bitmap is to be rotated or scale, do it here */
- if ((angle != 0.0) || (bi.scale != 1.0f)) {
- BitmapData srcData, destData;
-
- srcData.bits = bits;
- srcData.width = width;
- srcData.height = height;
-
- result = ScaleRotateData(interp, &srcData, angle, bi.scale, &destData);
- Blt_Free(bits); /* Free the array of un-transformed data. */
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- bits = destData.bits;
- width = destData.width;
- height = destData.height;
- }
- string = Tcl_GetString(objv[2]);
- result = Tk_DefineBitmap(interp, Tk_GetUid(string), (char *)bits, width,
- height);
- if (result != TCL_OK) {
- Blt_Free(bits);
- }
- hPtr = Blt_CreateHashEntry(&dataPtr->bitmapTable, string, &isNew);
- Blt_SetHashValue(hPtr, bits);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExistOp --
- *
- * Indicates if the named bitmap exists.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ExistsOp(
- ClientData clientData, /* Thread-specific data for bitmaps. */
- Tcl_Interp *interp, /* Interpreter to report results to */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Argument list */
-{
- BitmapInterpData *dataPtr = clientData;
- Pixmap bitmap;
-
- bitmap = Tk_AllocBitmapFromObj((Tcl_Interp *)NULL, dataPtr->tkMain, objv[2]);
- if (bitmap != None) {
- Tk_FreeBitmap(dataPtr->display, bitmap);
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), (bitmap != None));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HeightOp --
- *
- * Returns the height of the named bitmap.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HeightOp(
- ClientData clientData, /* Thread-specific data for bitmaps. */
- Tcl_Interp *interp, /* Interpreter to report results to */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Argument list */
-{
- BitmapInterpData *dataPtr = clientData;
- int width, height;
- Pixmap bitmap;
-
- bitmap = Tk_AllocBitmapFromObj(interp, dataPtr->tkMain, objv[2]);
- if (bitmap == None) {
- return TCL_ERROR;
- }
- Tk_SizeOfBitmap(dataPtr->display, bitmap, &width, &height);
- Tk_FreeBitmap(dataPtr->display, bitmap);
- Tcl_SetIntObj(Tcl_GetObjResult(interp), height);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WidthOp --
- *
- * Returns the width of the named bitmap.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-WidthOp(
- ClientData clientData, /* Thread-specific data for bitmaps. */
- Tcl_Interp *interp, /* Interpreter to report results to */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Argument list */
-{
- BitmapInterpData *dataPtr = clientData;
- int width, height;
- Pixmap bitmap;
-
- bitmap = Tk_AllocBitmapFromObj(interp, dataPtr->tkMain, objv[2]);
- if (bitmap == None) {
- return TCL_ERROR;
- }
- Tk_SizeOfBitmap(dataPtr->display, bitmap, &width, &height);
- Tk_FreeBitmap(dataPtr->display, bitmap);
- Tcl_SetIntObj(Tcl_GetObjResult(interp), width);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SourceOp --
- *
- * Returns the data array (excluding width and height)
- * of the named bitmap.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SourceOp(
- ClientData clientData, /* Thread-specific data for bitmaps. */
- Tcl_Interp *interp, /* Interpreter to report results to */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Argument list */
-{
- BitmapInterpData *dataPtr = clientData;
- Pixmap bitmap;
- Tcl_DString dString;
-
- bitmap = Tk_AllocBitmapFromObj(interp, dataPtr->tkMain, objv[2]);
- if (bitmap == None) {
- return TCL_ERROR;
- }
- Tcl_DStringInit(&dString);
- BitmapDataToString(dataPtr->tkMain, bitmap, &dString);
- Tk_FreeBitmap(dataPtr->display, bitmap);
- Tcl_DStringResult(interp, &dString);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DataOp --
- *
- * Returns the data array, including width and height,
- * of the named bitmap.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DataOp(
- ClientData clientData, /* Thread-specific data for bitmaps. */
- Tcl_Interp *interp, /* Interpreter to report results to */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Argument list */
-{
- BitmapInterpData *dataPtr = clientData;
- Pixmap bitmap;
- int width, height;
- Tcl_DString dString;
-
- bitmap = Tk_AllocBitmapFromObj(interp, dataPtr->tkMain, objv[2]);
- if (bitmap == None) {
- return TCL_ERROR;
- }
- Tk_SizeOfBitmap(dataPtr->display, bitmap, &width, &height);
- Tcl_DStringInit(&dString);
- Tcl_DStringAppendElement(&dString, Blt_Itoa(width));
- Tcl_DStringAppendElement(&dString, Blt_Itoa(height));
- Tcl_DStringStartSublist(&dString);
- BitmapDataToString(dataPtr->tkMain, bitmap, &dString);
- Tcl_DStringEndSublist(&dString);
- Tk_FreeBitmap(dataPtr->display, bitmap);
- Tcl_DStringResult(interp, &dString);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BLT Sub-command specification:
- *
- * - Name of the sub-command.
- * - Minimum number of characters needed to unambiguously
- * recognize the sub-command.
- * - Pointer to the function to be called for the sub-command.
- * - Minimum number of arguments accepted.
- * - Maximum number of arguments accepted.
- * - String to be displayed for usage.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec bitmapOps[] =
-{
- {"compose", 1, ComposeOp, 4, 0, "bitmapName text ?flags?",},
- {"data", 2, DataOp, 3, 3, "bitmapName",},
- {"define", 2, DefineOp, 4, 0, "bitmapName data ?flags?",},
- {"exists", 1, ExistsOp, 3, 3, "bitmapName",},
- {"height", 1, HeightOp, 3, 3, "bitmapName",},
- {"source", 1, SourceOp, 3, 3, "bitmapName",},
- {"width", 1, WidthOp, 3, 3, "bitmapName",},
-};
-static int nBitmapOps = sizeof(bitmapOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * BitmapCmd --
- *
- * This procedure is invoked to process the TCL command
- * that corresponds to bitmaps managed by this module.
- * See the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BitmapCmd(
- ClientData clientData, /* Thread-specific data for bitmaps. */
- Tcl_Interp *interp, /* Interpreter to report results to */
- int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nBitmapOps, bitmapOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (clientData, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BitmapInterpDeleteProc --
- *
- * This is called when the interpreter is deleted. All the bitmaps
- * specific to that interpreter are destroyed.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Destroys the bitmap table.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-BitmapInterpDeleteProc(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp)
-{
- BitmapInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->bitmapTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- unsigned char *bits;
-
- bits = Blt_GetHashValue(hPtr);
- Blt_Free(bits);
- }
- Blt_DeleteHashTable(&dataPtr->bitmapTable);
- Tcl_DeleteAssocData(interp, BITMAP_THREAD_KEY);
- Blt_Free(dataPtr);
-}
-
-static BitmapInterpData *
-GetBitmapInterpData(Tcl_Interp *interp)
-{
- BitmapInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (BitmapInterpData *)
- Tcl_GetAssocData(interp, BITMAP_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(BitmapInterpData));
- dataPtr->interp = interp;
- dataPtr->tkMain = Tk_MainWindow(interp);
- dataPtr->display = Tk_Display(dataPtr->tkMain);
- Tcl_SetAssocData(interp, BITMAP_THREAD_KEY, BitmapInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->bitmapTable, BLT_STRING_KEYS);
- }
- return dataPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_BitmapCmdInitProc --
- *
- * This procedure is invoked to initialize the bitmap command.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Adds the command to the interpreter and sets an array variable
- * which its version number.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_BitmapCmdInitProc(Tcl_Interp *interp)
-{
- BitmapInterpData *dataPtr;
- static Blt_InitCmdSpec cmdSpec = {"bitmap", BitmapCmd };
-
- /* Define the BLT logo bitmaps */
-
- dataPtr = GetBitmapInterpData(interp);
- cmdSpec.clientData = dataPtr;
- Tk_DefineBitmap(interp, Tk_GetUid("bigBLT"), (char *)bigblt_bits,
- bigblt_width, bigblt_height);
- Tk_DefineBitmap(interp, Tk_GetUid("BLT"), (char *)blt_bits,
- blt_width, blt_height);
- Tcl_ResetResult(interp);
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-#endif /* NO_BITMAP */
diff --git a/blt3.0.1/src/bltBitmap.h b/blt3.0.1/src/bltBitmap.h
deleted file mode 100644
index 7da86ca..0000000
--- a/blt3.0.1/src/bltBitmap.h
+++ /dev/null
@@ -1,14 +0,0 @@
-
-BLT_EXTERN Pixmap Blt_PhotoImageMask(Tk_Window tkwin, Tk_PhotoImageBlock src);
-
-BLT_EXTERN Pixmap Blt_ScaleBitmap(Tk_Window tkwin, Pixmap srcBitmap, int srcWidth,
- int srcHeight, int destWidth, int destHeight);
-
-BLT_EXTERN Pixmap Blt_RotateBitmap(Tk_Window tkwin, Pixmap srcBitmap,
- int srcWidth, int srcHeight, float angle, int *destWidthPtr,
- int *destHeightPtr);
-
-BLT_EXTERN Pixmap Blt_ScaleRotateBitmapArea(Tk_Window tkwin, Pixmap srcBitmap,
- unsigned int srcWidth, unsigned int srcHeight, int regionX, int regionY,
- unsigned int regionWidth, unsigned int regionHeight,
- unsigned int destWidth, unsigned int destHeight, float angle);
diff --git a/blt3.0.1/src/bltBusy.c b/blt3.0.1/src/bltBusy.c
deleted file mode 100644
index eeabbe9..0000000
--- a/blt3.0.1/src/bltBusy.c
+++ /dev/null
@@ -1,1815 +0,0 @@
-
-/*
- * bltBusy.c --
- *
- * This module implements busy windows for the BLT toolkit.
- *
- * Copyright 1993-2009 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_BUSY
-#include "bltOp.h"
-#include "bltHash.h"
-#include "tkDisplay.h"
-#include "bltBgStyle.h"
-#include "bltPicture.h"
-#include "bltPainter.h"
-#include "bltImage.h"
-#define BUSYDEBUG 0
-
-#ifndef TK_REPARENTED
-#define TK_REPARENTED 0
-#endif
-
-#define BUSY_THREAD_KEY "BLT Busy Data"
-
-typedef struct {
- unsigned int flags;
- Display *display; /* Display of busy window */
- Tcl_Interp *interp; /* Interpreter where "busy" command
- * was created. It's used to key the
- * searches in the window
- * hierarchy. See the "windows"
- * command. */
- Tk_Window tkBusy; /* Busy window: Transparent window
- * used to block delivery of events to
- * windows underneath it. */
- Tk_Window tkParent; /* Parent window of the busy
- * window. It may be the reference
- * window (if the reference is a
- * toplevel) or a mutual ancestor of
- * the reference window */
- Tk_Window tkRef; /* Reference window of the busy
- * window. It's is used to manage the
- * size and position of the busy
- * window. */
- int x, y; /* Position of the reference window */
- int width, height; /* Size of the reference
- * window. Retained to know if the
- * reference window has been
- * reconfigured to a new size. */
- int menuBar; /* Menu bar flag. */
- Tk_Cursor cursor; /* Cursor for the busy window. */
- Blt_HashEntry *hashPtr; /* Used the delete the busy window
- * entry out of the global hash
- * table. */
- Blt_HashTable *tablePtr;
- const char *text; /* Text to be displayed in the opaque
- * window. */
- Blt_Picture snapshot; /* Snapshot of reference window
- * used as background of opaque
- * busy window. */
- Blt_Background bg; /* Default background to use if 1)
- * busy window is opaque and 2) a
- * snapshot of the reference window
- * can't be obtained (possibly because
- * the reference window was
- * obscurred. */
- GC gc;
- int darken;
- Blt_Picture picture; /* Image to be displayed in the
- * center of the busy window. */
- Tk_Image tkImage;
-} Busy;
-
-#define REDRAW_PENDING (1<<0) /* Indicates a DoWhenIdle handler has
- * already been queued to redraw this
- * window. */
-#define ACTIVE (1<<1) /* Indicates whether the busy window
- * should be displayed. This can be
- * different from what Tk_IsMapped
- * says because the a sibling
- * reference window may be unmapped,
- * forcing the busy window to be also
- * hidden. */
-#define OPAQUE (1<<2) /* Indicates whether the busy window
- * is opaque. */
-#define IMAGE_PHOTO (1<<3) /* Indicates that the image was
- * a photo. */
-
-#ifdef WIN32
-#define DEF_BUSY_CURSOR "wait"
-#else
-#define DEF_BUSY_CURSOR "watch"
-#endif
-#define DEF_BUSY_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_BUSY_OPAQUE "0"
-#define DEF_BUSY_DARKEN "30"
-
-static Blt_OptionParseProc ObjToPictImageProc;
-static Blt_OptionPrintProc PictImageToObjProc;
-static Blt_OptionFreeProc FreePictImageProc;
-static Blt_CustomOption pictImageOption =
-{
- ObjToPictImageProc, PictImageToObjProc, FreePictImageProc, (ClientData)0
-};
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_BUSY_BACKGROUND, Blt_Offset(Busy, bg), 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_CURSOR, "-cursor", "busyCursor", "BusyCursor",
- DEF_BUSY_CURSOR, Blt_Offset(Busy, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_INT, "-darken", "darken", "Darken", DEF_BUSY_DARKEN,
- Blt_Offset(Busy, darken), 0},
- {BLT_CONFIG_CUSTOM, "-image", "image", "Image", (char *)NULL,
- Blt_Offset(Busy, picture), BLT_CONFIG_NULL_OK, &pictImageOption},
- {BLT_CONFIG_BITMASK, "-opaque", "opaque", "Opaque", DEF_BUSY_OPAQUE,
- Blt_Offset(Busy, flags), 0, (Blt_CustomOption *)OPAQUE},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-typedef struct {
- Blt_HashTable busyTable; /* Hash table of busy window
- * structures keyed by the address of
- * thereference Tk window */
- Tk_Window tkMain;
- Tcl_Interp *interp;
-} BusyInterpData;
-
-static Tk_GeomRequestProc BusyGeometryProc;
-static Tk_GeomLostSlaveProc BusyCustodyProc;
-static Tk_GeomMgr busyMgrInfo =
-{
- (char *)"busy", /* Name of geometry manager used by
- * winfo */
- BusyGeometryProc, /* Procedure to for new geometry
- * requests */
- BusyCustodyProc, /* Procedure when window is taken
- * away */
-};
-
-/* Forward declarations */
-static Tcl_IdleProc DisplayBusy;
-static Tcl_FreeProc DestroyBusy;
-static Tk_EventProc BusyEventProc;
-static Tk_EventProc RefWinEventProc;
-static Tcl_ObjCmdProc BusyCmd;
-static Tcl_InterpDeleteProc BusyInterpDeleteProc;
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Tells the Tk dispatcher to call the busy display routine at the next
- * idle point. This request is made only if the window is displayed and
- * no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(Busy *busyPtr)
-{
- if ((busyPtr->tkBusy != NULL) &&
- ((busyPtr->flags & (REDRAW_PENDING|OPAQUE)) == OPAQUE)) {
- Tcl_DoWhenIdle(DisplayBusy, busyPtr);
- busyPtr->flags |= REDRAW_PENDING;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImageChangedProc --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-ImageChangedProc(
- ClientData clientData,
- int x, int y, int w, int h, /* Not used. */
- int imageWidth, int imageHeight) /* Not used. */
-{
- Busy *busyPtr = clientData;
- int isPhoto;
-
- if ((busyPtr->picture != NULL) && (busyPtr->flags & IMAGE_PHOTO)) {
- Blt_FreePicture(busyPtr->picture);
- }
- busyPtr->picture = NULL;
- busyPtr->flags &= ~IMAGE_PHOTO;
- if (Blt_Image_IsDeleted(busyPtr->tkImage)) {
- Tk_FreeImage(busyPtr->tkImage);
- busyPtr->tkImage = NULL;
- return;
- }
- busyPtr->picture = Blt_GetPictureFromImage(busyPtr->interp,
- busyPtr->tkImage, &isPhoto);
- if (isPhoto) {
- busyPtr->flags |= IMAGE_PHOTO;
- }
- EventuallyRedraw(busyPtr);
-}
-
-/*ARGSUSED*/
-static void
-FreePictImageProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Busy *busyPtr = (Busy *)widgRec;
-
- if ((busyPtr->picture != NULL) && (busyPtr->flags & IMAGE_PHOTO)) {
- Blt_FreePicture(busyPtr->picture);
- }
- busyPtr->picture = NULL;
- if (busyPtr->tkImage != NULL) {
- Tk_FreeImage(busyPtr->tkImage);
- }
- busyPtr->tkImage = NULL;
- busyPtr->flags &= ~IMAGE_PHOTO;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToPictImageProc --
- *
- * Given an image name, get the Tk image associated with it.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToPictImageProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to return results */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Busy *busyPtr = (Busy *)widgRec;
- Tk_Image tkImage;
- const char *name;
- int isPhoto;
-
- name = Tcl_GetString(objPtr);
- tkImage = Tk_GetImage(interp, tkwin, name, ImageChangedProc, busyPtr);
- if (tkImage == NULL) {
- return TCL_ERROR;
- }
- if (busyPtr->tkImage != NULL) {
- Tk_FreeImage(busyPtr->tkImage);
- }
- busyPtr->flags &= ~IMAGE_PHOTO;
- if (busyPtr->picture != NULL) {
- Blt_FreePicture(busyPtr->picture);
- }
- busyPtr->tkImage = tkImage;
- busyPtr->picture = Blt_GetPictureFromImage(busyPtr->interp, tkImage,
- &isPhoto);
- if (isPhoto) {
- busyPtr->flags |= IMAGE_PHOTO;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictImageToObjProc --
- *
- * Convert the image name into a string Tcl_Obj.
- *
- * Results:
- * The string representation of the image is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-PictImageToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Busy *busyPtr = (Busy *)(widgRec);
-
- if (busyPtr->tkImage == NULL) {
- return Tcl_NewStringObj("", -1);
- }
- return Tcl_NewStringObj(Blt_Image_Name(busyPtr->tkImage), -1);
-}
-
-
-static void
-ShowBusyWindow(Busy *busyPtr)
-{
- /*
- * If the busy window is opaque, take a snapshot of the reference
- * window and use that as the contents of the window.
- */
- if (busyPtr->flags & OPAQUE) {
- Tk_Window tkwin;
- Blt_Picture picture;
- Blt_Pixel color;
- int rx, ry;
- int delta;
-
- tkwin = Blt_Toplevel(busyPtr->tkRef);
- Blt_RaiseToplevelWindow(tkwin);
- Blt_RootCoordinates(busyPtr->tkRef, busyPtr->x, busyPtr->y, &rx, &ry);
- picture = Blt_DrawableToPicture(busyPtr->tkRef,
- Tk_RootWindow(busyPtr->tkRef), rx, ry,
- busyPtr->width, busyPtr->height, 1.0);
- if (picture == NULL) {
- fprintf(stderr, "can't grab window (possibly obscured?)\n");
- return;
- }
- delta = (int)((busyPtr->darken / 100.0) * 255);
- color.u32 = 0x0;
- color.Red = color.Blue = color.Green = delta;
- Blt_ApplyScalarToPicture(picture, &color, PIC_ARITH_SUB);
- if (busyPtr->snapshot != NULL) {
- Blt_FreePicture(busyPtr->snapshot);
- }
- busyPtr->snapshot = picture;
- EventuallyRedraw(busyPtr);
- }
- if (busyPtr->tkBusy != NULL) {
- Tk_MapWindow(busyPtr->tkBusy);
- /*
- * Always raise the busy window just in case new sibling windows have
- * been created in the meantime. Can't use Tk_RestackWindow because it
- * doesn't work under Win32.
- */
- XRaiseWindow(busyPtr->display, Tk_WindowId(busyPtr->tkBusy));
- }
-#ifdef WIN32
- {
- POINT point;
- /*
- * In Win32 cursors aren't associated with windows. Tk fakes this by
- * watching <Motion> events on its windows. Tk will automatically
- * change the cursor when the pointer enters the Busy window. But
- * Windows doesn't immediately change the cursor; it waits for the
- * cursor position to change or a system call. We need to change the
- * cursor before the application starts processing, so set the cursor
- * position redundantly back to the current position.
- */
- GetCursorPos(&point);
- SetCursorPos(point.x, point.y);
- }
-#else
- XFlush(busyPtr->display);
-#endif /* WIN32 */
-}
-
-static void
-HideBusyWindow(Busy *busyPtr)
-{
- if (busyPtr->tkBusy != NULL) {
- Tk_UnmapWindow(busyPtr->tkBusy);
- }
-#ifdef WIN32
- {
- POINT point;
- /*
- * Under Win32, cursors aren't associated with windows. Tk fakes this
- * by watching Motion events on its windows. So Tk will automatically
- * change the cursor when the pointer enters the Busy window. But
- * Windows doesn't immediately change the cursor: it waits for the
- * cursor position to change or a system call. We need to change the
- * cursor before the application starts processing, so set the cursor
- * position redundantly back to the current position.
- */
- GetCursorPos(&point);
- SetCursorPos(point.x, point.y);
- }
-#else
- XFlush(busyPtr->display);
-#endif /* WIN32 */
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BusyEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for events on the busy
- * window itself. We're only concerned with destroy events.
- *
- * It might be necessary (someday) to watch resize events. Right now, I
- * don't think there's any point in it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When a busy window is destroyed, all internal structures associated
- * with it released at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
-static void
-BusyEventProc(
- ClientData clientData, /* Busy window record */
- XEvent *eventPtr) /* Event which triggered call to
- * routine */
-{
- Busy *busyPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(busyPtr);
- }
- } else if (eventPtr->type == DestroyNotify) {
- busyPtr->tkBusy = NULL;
- if (busyPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayBusy, busyPtr);
- }
- Tcl_EventuallyFree(busyPtr, DestroyBusy);
- } else if (eventPtr->type == ConfigureNotify) {
- EventuallyRedraw(busyPtr);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * BusyCustodyProc --
- *
- * This procedure is invoked when the busy window has been stolen by
- * another geometry manager. The information and memory associated with
- * the busy window is released. I don't know why anyone would try to pack
- * a busy window, but this should keep everything sane, if it is.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The Busy structure is freed at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-BusyCustodyProc(
- ClientData clientData, /* Information about the busy window. */
- Tk_Window tkwin) /* Not used. */
-{
- Busy *busyPtr = clientData;
-
- Tk_DeleteEventHandler(busyPtr->tkBusy, StructureNotifyMask, BusyEventProc,
- busyPtr);
- HideBusyWindow(busyPtr);
- busyPtr->tkBusy = NULL;
- Tcl_EventuallyFree(busyPtr, DestroyBusy);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BusyGeometryProc --
- *
- * This procedure is invoked by Tk_GeometryRequest for busy windows.
- * Busy windows never request geometry, so it's unlikely that this
- * routine will ever be called. The routine exists simply as a place
- * holder for the GeomProc in the Geometry Manager structure.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-BusyGeometryProc(
- ClientData clientData, /* Information about window that got new
- * preferred geometry. */
- Tk_Window tkwin) /* Other Tk-related information about
- * the window. */
-{
- /* Should never get here */
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RefWinEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for the following events
- * on the reference window. If the reference and parent windows are the
- * same, only the first event is important.
- *
- * 1) ConfigureNotify - The reference window has been resized or
- * moved. Move and resize the busy window
- * to be the same size and position of the
- * reference window.
- *
- * 2) DestroyNotify - The reference window was destroyed. Destroy
- * the busy window and the free resources
- * used.
- *
- * 3) MapNotify - The reference window was (re)shown. Map the
- * busy window again.
- *
- * 4) UnmapNotify - The reference window was hidden. Unmap the
- * busy window.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the reference window gets deleted, internal structures get cleaned
- * up. When it gets resized, the busy window is resized accordingly. If
- * it's displayed, the busy window is displayed. And when it's hidden, the
- * busy window is unmapped.
- *
- *---------------------------------------------------------------------------
- */
-static void
-RefWinEventProc(
- ClientData clientData, /* Busy window record */
- XEvent *eventPtr) /* Event that triggered the call to this
- * routine */
-{
- Busy *busyPtr = clientData;
-
- switch (eventPtr->type) {
- case ReparentNotify:
- case DestroyNotify:
-
- /*
- * Arrange for the busy structure to be removed at a proper time.
- */
- Tcl_EventuallyFree(busyPtr, DestroyBusy);
- break;
-
- case ConfigureNotify:
- if ((busyPtr->width != Tk_Width(busyPtr->tkRef)) ||
- (busyPtr->height != Tk_Height(busyPtr->tkRef)) ||
- (busyPtr->x != Tk_X(busyPtr->tkRef)) ||
- (busyPtr->y != Tk_Y(busyPtr->tkRef))) {
- int x, y;
-
- busyPtr->width = Tk_Width(busyPtr->tkRef);
- busyPtr->height = Tk_Height(busyPtr->tkRef);
- busyPtr->x = Tk_X(busyPtr->tkRef);
- busyPtr->y = Tk_Y(busyPtr->tkRef);
-
- x = y = 0;
-
- if (busyPtr->tkParent != busyPtr->tkRef) {
- Tk_Window tkwin;
-
- for (tkwin = busyPtr->tkRef; (tkwin != NULL) &&
- (!Tk_IsTopLevel(tkwin)); tkwin = Tk_Parent(tkwin)) {
- if (tkwin == busyPtr->tkParent) {
- break;
- }
- x += Tk_X(tkwin) + Tk_Changes(tkwin)->border_width;
- y += Tk_Y(tkwin) + Tk_Changes(tkwin)->border_width;
- }
- }
-#if BUSYDEBUG
- PurifyPrintf("menubar2: width=%d, height=%d\n",
- busyPtr->width, busyPtr->height);
-#endif
- if (busyPtr->tkBusy != NULL) {
-#if BUSYDEBUG
- fprintf(stderr, "busy window %s is at %d,%d %dx%d\n",
- Tk_PathName(busyPtr->tkBusy), x, y,
- busyPtr->width, busyPtr->height);
-#endif
- Tk_MoveResizeWindow(busyPtr->tkBusy, x, y, busyPtr->width,
- busyPtr->height);
- if (busyPtr->flags & ACTIVE) {
- ShowBusyWindow(busyPtr);
- }
- }
- }
- break;
-
- case MapNotify:
- if ((busyPtr->tkParent != busyPtr->tkRef) &&
- (busyPtr->flags & ACTIVE)) {
- ShowBusyWindow(busyPtr);
- }
- break;
-
- case UnmapNotify:
- if (busyPtr->tkParent != busyPtr->tkRef) {
- HideBusyWindow(busyPtr);
- }
- break;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureBusy --
- *
- * This procedure is called from the Tk event dispatcher. It releases X
- * resources and memory used by the busy window and updates the internal
- * hash table.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory and resources are released and the Tk event handler is removed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureBusy(
- Tcl_Interp *interp,
- Busy *busyPtr,
- int objc,
- Tcl_Obj *const *objv)
-{
- Tk_Cursor oldCursor;
-
- oldCursor = busyPtr->cursor;
- if (Blt_ConfigureWidgetFromObj(interp, busyPtr->tkRef, configSpecs,
- objc, objv, (char *)busyPtr, 0) != TCL_OK) {
- return TCL_ERROR;
- }
- if (busyPtr->cursor != oldCursor) {
- if (busyPtr->cursor == None) {
- Tk_UndefineCursor(busyPtr->tkBusy);
- } else {
- Tk_DefineCursor(busyPtr->tkBusy, busyPtr->cursor);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateBusy --
- *
- * Creates a child transparent window that obscures its parent window
- * thereby effectively blocking device events. The size and position of
- * the busy window is exactly that of the reference window.
- *
- * We want to create sibling to the window to be blocked. If the busy
- * window is a child of the window to be blocked, Enter/Leave events can
- * sneak through. Futhermore under WIN32, messages of transparent
- * windows are sent directly to the parent. The only exception to this
- * are toplevels, since we can't make a sibling. Fortunately, toplevel
- * windows rarely receive events that need blocking.
- *
- * Results:
- * Returns a pointer to the new busy window structure.
- *
- * Side effects:
- * When the busy window is eventually displayed, it will screen device
- * events (in the area of the reference window) from reaching its parent
- * window and its children. User feed back can be achieved by changing
- * the cursor.
- *
- *---------------------------------------------------------------------------
- */
-static Busy *
-CreateBusy2(
- Tcl_Interp *interp, /* Interpreter to report error to */
- Tk_Window tkRef) /* Window hosting the busy window */
-{
- Busy *busyPtr;
- Tk_FakeWin *winPtr;
- Tk_Window tkBusy, tkParent;
- Window parent;
- char *name;
- const char *fmt;
- int length;
- int x, y;
- unsigned int mask;
-
- busyPtr = Blt_AssertCalloc(1, sizeof(Busy));
- x = y = 0;
- length = strlen(Tk_Name(tkRef));
- name = Blt_AssertMalloc(length + 6);
- if (Tk_IsTopLevel(tkRef)) {
- fmt = "_Busy"; /* Child */
- tkParent = tkRef;
- } else {
- Tk_Window tkwin;
-
- fmt = "%s_Busy"; /* Sibling */
- tkParent = Tk_Parent(tkRef);
- for (tkwin = tkRef; (tkwin != NULL) && (!Tk_IsTopLevel(tkwin));
- tkwin = Tk_Parent(tkwin)) {
- if (tkwin == tkParent) {
- break;
- }
- x += Tk_X(tkwin) + Tk_Changes(tkwin)->border_width;
- y += Tk_Y(tkwin) + Tk_Changes(tkwin)->border_width;
- }
- }
- {
- Tk_Window tkwin;
-
- for (tkwin = Blt_FirstChild(tkParent); tkwin != NULL;
- tkwin = Blt_NextChild(tkwin)) {
- Tk_MakeWindowExist(tkwin);
- }
- }
- sprintf_s(name, length + 6, fmt, Tk_Name(tkRef));
- tkBusy = Tk_CreateWindow(interp, tkParent, name, (char *)NULL);
- Blt_Free(name);
-
- if (tkBusy == NULL) {
- return NULL;
- }
- Tk_MakeWindowExist(tkRef);
- busyPtr->display = Tk_Display(tkRef);
- busyPtr->interp = interp;
- busyPtr->tkRef = tkRef;
- busyPtr->tkParent = tkParent;
- busyPtr->tkBusy = tkBusy;
- busyPtr->width = Tk_Width(tkRef);
- busyPtr->height = Tk_Height(tkRef);
- busyPtr->x = Tk_X(tkRef);
- busyPtr->y = Tk_Y(tkRef);
- busyPtr->cursor = None;
- busyPtr->flags = 0;
- Tk_SetClass(tkBusy, "Busy");
- Blt_SetWindowInstanceData(tkBusy, busyPtr);
-
- winPtr = (Tk_FakeWin *)tkRef;
- if (winPtr->flags & TK_REPARENTED) {
- /*
- * This works around a bug in the implementation of menubars for
- * non-MacIntosh window systems (Win32 and X11). Tk doesn't reset the
- * pointers to the parent window when the menu is reparented
- * (winPtr->parentPtr points to the wrong window). We get around this
- * by determining the parent via the native API calls.
- */
-#ifdef WIN32
- {
- HWND hWnd;
- RECT rect;
-
- hWnd = Tk_GetHWND(Tk_WindowId(tkRef));
- hWnd = GetParent(hWnd);
- parent = (Window) hWnd;
- if (GetWindowRect(hWnd, &rect)) {
- busyPtr->width = rect.right - rect.left;
- busyPtr->height = rect.bottom - rect.top;
-#if BUSYDEBUG
- PurifyPrintf("menubar: width=%d, height=%d\n",
- busyPtr->width, busyPtr->height);
-#endif
- }
- }
-#else
- parent = Blt_GetParentWindow(busyPtr->display, Tk_WindowId(tkRef));
-#endif
- } else {
- parent = Tk_WindowId(tkParent);
-#ifdef WIN32
- parent = (Window) Tk_GetHWND(parent);
-#endif
- }
-
- mask = StructureNotifyMask;
- if (busyPtr->flags & OPAQUE) {
- mask |= ExposureMask;
- } else {
- Blt_MakeTransparentWindowExist(tkBusy, parent, TRUE);
- }
-
-#if BUSYDEBUG
- PurifyPrintf("menubar1: width=%d, height=%d\n", busyPtr->width,
- busyPtr->height);
- fprintf(stderr, "busy window %s is at %d,%d %dx%d\n", Tk_PathName(tkBusy),
- x, y, busyPtr->width, busyPtr->height);
-#endif
- Tk_MoveResizeWindow(tkBusy, x, y, busyPtr->width, busyPtr->height);
-
- /* Only worry if the busy window is destroyed. */
- Tk_CreateEventHandler(tkBusy, StructureNotifyMask, BusyEventProc, busyPtr);
- /*
- * Indicate that the busy window's geometry is being managed. This will
- * also notify us if the busy window is ever packed.
- */
- Tk_ManageGeometry(tkBusy, &busyMgrInfo, busyPtr);
- if (busyPtr->cursor != None) {
- Tk_DefineCursor(tkBusy, busyPtr->cursor);
- }
- /* Track the reference window to see if it is resized or destroyed. */
- Tk_CreateEventHandler(tkRef, StructureNotifyMask, RefWinEventProc, busyPtr);
- return busyPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewBusy --
- *
- * Creates a child transparent window that obscures its parent window
- * thereby effectively blocking device events. The size and position of
- * the busy window is exactly that of the reference window.
- *
- * We want to create sibling to the window to be blocked. If the busy
- * window is a child of the window to be blocked, Enter/Leave events can
- * sneak through. Futhermore under WIN32, messages of transparent
- * windows are sent directly to the parent. The only exception to this
- * are toplevels, since we can't make a sibling. Fortunately, toplevel
- * windows rarely receive events that need blocking.
- *
- * Results:
- * Returns a pointer to the new busy window structure.
- *
- * Side effects:
- * When the busy window is eventually displayed, it will screen device
- * events (in the area of the reference window) from reaching its parent
- * window and its children. User feed back can be achieved by changing
- * the cursor.
- *
- *---------------------------------------------------------------------------
- */
-static Busy *
-NewBusy(
- Tcl_Interp *interp, /* Interpreter to report error to */
- Tk_Window tkRef) /* Window hosting the busy window */
-{
- Busy *busyPtr;
- Tk_Window tkBusy;
- Tk_Window tkParent;
- char *name;
- const char *fmt;
- int length;
- int x, y;
-
- busyPtr = Blt_AssertCalloc(1, sizeof(Busy));
- x = y = 0;
- if (Tk_IsTopLevel(tkRef)) {
- fmt = "_Busy"; /* Child */
- tkParent = tkRef;
- } else {
- Tk_Window tkwin;
-
- fmt = "%s_Busy"; /* Sibling */
- tkParent = Tk_Parent(tkRef);
- for (tkwin = tkRef; (tkwin != NULL) && (!Tk_IsTopLevel(tkwin));
- tkwin = Tk_Parent(tkwin)) {
- if (tkwin == tkParent) {
- break;
- }
- x += Tk_X(tkwin) + Tk_Changes(tkwin)->border_width;
- y += Tk_Y(tkwin) + Tk_Changes(tkwin)->border_width;
- }
- }
- {
- Tk_Window tkwin;
-
- for (tkwin = Blt_FirstChild(tkParent); tkwin != NULL;
- tkwin = Blt_NextChild(tkwin)) {
- Tk_MakeWindowExist(tkwin);
- }
- }
- length = strlen(Tk_Name(tkRef));
- name = Blt_AssertMalloc(length + 6);
- sprintf_s(name, length + 6, fmt, Tk_Name(tkRef));
- tkBusy = Tk_CreateWindow(interp, tkParent, name, (char *)NULL);
- Blt_Free(name);
-
- if (tkBusy == NULL) {
- return NULL;
- }
- Tk_MakeWindowExist(tkRef);
- busyPtr->display = Tk_Display(tkRef);
- busyPtr->interp = interp;
- busyPtr->tkRef = tkRef;
- busyPtr->tkParent = tkParent;
- busyPtr->tkBusy = tkBusy;
- busyPtr->width = Tk_Width(tkRef);
- busyPtr->height = Tk_Height(tkRef);
- busyPtr->x = Tk_X(tkRef);
- busyPtr->y = Tk_Y(tkRef);
- busyPtr->cursor = None;
- busyPtr->darken = 30;
- busyPtr->flags = 0;
- Tk_SetClass(tkBusy, "Busy");
- Blt_SetWindowInstanceData(tkBusy, busyPtr);
- return busyPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateBusy --
- *
- * Creates a child transparent window that obscures its parent window
- * thereby effectively blocking device events. The size and position of
- * the busy window is exactly that of the reference window.
- *
- * We want to create sibling to the window to be blocked. If the busy
- * window is a child of the window to be blocked, Enter/Leave events can
- * sneak through. Futhermore under WIN32, messages of transparent
- * windows are sent directly to the parent. The only exception to this
- * are toplevels, since we can't make a sibling. Fortunately, toplevel
- * windows rarely receive events that need blocking.
- *
- * Results:
- * Returns a pointer to the new busy window structure.
- *
- * Side effects:
- * When the busy window is eventually displayed, it will screen device
- * events (in the area of the reference window) from reaching its parent
- * window and its children. User feed back can be achieved by changing
- * the cursor.
- *
- *---------------------------------------------------------------------------
- */
-static void
-InitializeBusy(Busy *busyPtr)
-{
- Tk_FakeWin *winPtr;
- Window parent;
- unsigned int mask;
-
- winPtr = (Tk_FakeWin *) busyPtr->tkRef;
- if (winPtr->flags & TK_REPARENTED) {
- /*
- * This works around a bug in the implementation of menubars for
- * non-MacIntosh window systems (Win32 and X11). Tk doesn't reset the
- * pointers to the parent window when the menu is reparented
- * (winPtr->parentPtr points to the wrong window). We get around this
- * by determining the parent via the native API calls.
- */
-#ifdef WIN32
- {
- HWND hWnd;
- RECT rect;
-
- hWnd = Tk_GetHWND(Tk_WindowId(busyPtr->tkRef));
- hWnd = GetParent(hWnd);
- parent = (Window) hWnd;
- if (GetWindowRect(hWnd, &rect)) {
- busyPtr->width = rect.right - rect.left;
- busyPtr->height = rect.bottom - rect.top;
-#if BUSYDEBUG
- PurifyPrintf("menubar: width=%d, height=%d\n",
- busyPtr->width, busyPtr->height);
-#endif
- }
- }
-#else
- parent = Blt_GetParentWindow(busyPtr->display,
- Tk_WindowId(busyPtr->tkRef));
-#endif
- } else {
- parent = Tk_WindowId(busyPtr->tkParent);
-#ifdef WIN32
- parent = (Window) Tk_GetHWND(parent);
-#endif
- }
- mask = StructureNotifyMask;
- if (busyPtr->flags & OPAQUE) {
- Tk_MakeWindowExist(busyPtr->tkBusy);
- mask |= ExposureMask;
- } else {
- Blt_MakeTransparentWindowExist(busyPtr->tkBusy, parent, TRUE);
- }
-
-#if BUSYDEBUG
- PurifyPrintf("menubar1: width=%d, height=%d\n", busyPtr->width,
- busyPtr->height);
- fprintf(stderr, "busy window %s is at %d,%d %dx%d\n",
- Tk_PathName(busyPtr->tkBusy), busyPtr->x, busyPtr->y, busyPtr->width,
- busyPtr->height);
-#endif
- Tk_MoveResizeWindow(busyPtr->tkBusy, busyPtr->x, busyPtr->y,
- busyPtr->width, busyPtr->height);
-
- /* Only worry if the busy window is destroyed. */
- Tk_CreateEventHandler(busyPtr->tkBusy, mask, BusyEventProc, busyPtr);
- /*
- * Indicate that the busy window's geometry is being managed. This will
- * also notify us if the busy window is ever packed.
- */
- Tk_ManageGeometry(busyPtr->tkBusy, &busyMgrInfo, busyPtr);
- if (busyPtr->cursor != None) {
- Tk_DefineCursor(busyPtr->tkBusy, busyPtr->cursor);
- }
- /* Track the reference window to see if it is resized or destroyed. */
- Tk_CreateEventHandler(busyPtr->tkRef, StructureNotifyMask, RefWinEventProc,
- busyPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyBusy --
- *
- * This procedure is called from the Tk event dispatcher. It releases X
- * resources and memory used by the busy window and updates the internal
- * hash table.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory and resources are released and the Tk event handler is removed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyBusy(DestroyData data) /* Busy window structure record */
-{
- Busy *busyPtr = (Busy *)data;
-
- Blt_FreeOptions(configSpecs, (char *)busyPtr, busyPtr->display, 0);
- if (busyPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(busyPtr->tablePtr, busyPtr->hashPtr);
- }
- if (busyPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayBusy, busyPtr);
- }
- Tk_DeleteEventHandler(busyPtr->tkRef, StructureNotifyMask,
- RefWinEventProc, busyPtr);
- if (busyPtr->snapshot != NULL) {
- Blt_FreePicture(busyPtr->snapshot);
- }
- if (busyPtr->tkBusy != NULL) {
- Tk_DeleteEventHandler(busyPtr->tkBusy, StructureNotifyMask,
- BusyEventProc, busyPtr);
- Tk_ManageGeometry(busyPtr->tkBusy, NULL, busyPtr);
- Tk_DestroyWindow(busyPtr->tkBusy);
- }
- Blt_Free(busyPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetBusy --
- *
- * Returns the busy window structure associated with the reference
- * window, keyed by its path name. The clientData argument is the main
- * window of the interpreter, used to search for the reference window in
- * its own window hierarchy.
- *
- * Results:
- * If path name represents a reference window with a busy window, a
- * pointer to the busy window structure is returned. Otherwise, NULL is
- * returned and an error message is left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetBusy(
- BusyInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report errors to. If
- * NULL, indicates not to generate error
- * message. */
- Tcl_Obj *objPtr,
- Busy **busyPtrPtr) /* Will contain address of busy window
- * if found. */
-{
- Blt_HashEntry *hPtr;
- Tk_Window tkwin;
- const char *pathName; /* Path name of parent window */
-
- pathName = Tcl_GetString(objPtr);
- tkwin = Tk_NameToWindow(dataPtr->interp, pathName, dataPtr->tkMain);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- hPtr = Blt_FindHashEntry(&dataPtr->busyTable, (char *)tkwin);
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find busy window \"", pathName,
- "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- *busyPtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HoldBusy --
- *
- * Creates (if necessary) and maps a busy window, thereby preventing
- * device events from being be received by the parent window and its
- * children.
- *
- * Results:
- * Returns a standard TCL result. If path name represents a busy window,
- * it is unmapped and TCL_OK is returned. Otherwise, TCL_ERROR is
- * returned and an error message is left in interp->result.
- *
- * Side effects:
- * The busy window is created and displayed, blocking events from the
- * parent window and its children.
- *
- *---------------------------------------------------------------------------
- */
-static int
-HoldBusy(
- BusyInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report errors to */
- int objc,
- Tcl_Obj *const *objv) /* Window name and option pairs */
-{
- Tk_Window tkwin;
- Blt_HashEntry *hPtr;
- Busy *busyPtr;
- int isNew;
- int result;
-
- tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[0]), dataPtr->tkMain);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- hPtr = Blt_CreateHashEntry(&dataPtr->busyTable, (char *)tkwin, &isNew);
- if (isNew) {
- busyPtr = NewBusy(interp, tkwin);
- if (busyPtr == NULL) {
- return TCL_ERROR;
- }
- Blt_SetHashValue(hPtr, busyPtr);
- busyPtr->hashPtr = hPtr;
- busyPtr->tablePtr = &dataPtr->busyTable;
- result = ConfigureBusy(interp, busyPtr, objc - 1, objv + 1);
- InitializeBusy(busyPtr);
- } else {
- busyPtr = Blt_GetHashValue(hPtr);
- result = ConfigureBusy(interp, busyPtr, objc - 1, objv + 1);
- }
- /*
- * Don't map the busy window unless the reference window is also currently
- * displayed.
- */
- if (Tk_IsMapped(busyPtr->tkRef)) {
- ShowBusyWindow(busyPtr);
- } else {
- HideBusyWindow(busyPtr);
- }
- busyPtr->flags |= ACTIVE;
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StatusOp --
- *
- * Returns the status of the busy window; whether it's blocking events or
- * not.
- *
- * Results:
- * Returns a standard TCL result. If path name represents a busy window,
- * the status is returned via interp->result and TCL_OK is
- * returned. Otherwise, TCL_ERROR is returned and an error message is
- * left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-StatusOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report error to */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- BusyInterpData *dataPtr = clientData;
- Busy *busyPtr;
-
- if (GetBusy(dataPtr, interp, objv[2], &busyPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), busyPtr->flags & ACTIVE);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ForgetOp --
- *
- * Destroys the busy window associated with the reference window and
- * arranges for internal resources to the released when they're not being
- * used anymore.
- *
- * Results:
- * Returns a standard TCL result. If path name represents a busy window,
- * it is destroyed and TCL_OK is returned. Otherwise, TCL_ERROR is
- * returned and an error message is left in interp->result.
- *
- * Side effects:
- * The busy window is removed. Other related memory and resources are
- * eventually released by the Tk dispatcher.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ForgetOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Not used. */
- int objc,
- Tcl_Obj *const *objv)
-{
- BusyInterpData *dataPtr = clientData;
- int i;
-
- for (i = 2; i < objc; i++) {
- Busy *busyPtr;
-
- if (GetBusy(dataPtr, (Tcl_Interp *)NULL, objv[i], &busyPtr) == TCL_OK) {
- /* Unmap the window even though it will be soon destroyed */
- HideBusyWindow(busyPtr);
- Tcl_EventuallyFree(busyPtr, DestroyBusy);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReleaseOp --
- *
- * Unmaps the busy window, thereby permitting device events to be
- * received by the parent window and its children.
- *
- * Results:
- * Returns a standard TCL result. If path name represents a busy window,
- * it is unmapped and TCL_OK is returned. Otherwise, TCL_ERROR is
- * returned and an error message is left in interp->result.
- *
- * Side effects:
- * The busy window is hidden, allowing the parent window and its children
- * to receive events again.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ReleaseOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Not used. */
- int objc,
- Tcl_Obj *const *objv)
-{
- BusyInterpData *dataPtr = clientData;
- Busy *busyPtr;
- int i;
-
- for (i = 2; i < objc; i++) {
- if (GetBusy(dataPtr, (Tcl_Interp *)NULL, objv[i], &busyPtr) == TCL_OK) {
- HideBusyWindow(busyPtr);
- busyPtr->flags &= ~ACTIVE;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * Reports the names of all widgets with busy windows attached to them,
- * matching a given pattern. If no pattern is given, all busy widgets
- * are listed.
- *
- * Results:
- * Returns a TCL list of the names of the widget with busy windows
- * attached to them, regardless if the widget is currently busy or not.
- *
- *---------------------------------------------------------------------------
- */
-static int
-NamesOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report errors to */
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- BusyInterpData *dataPtr = clientData;
- Tcl_Obj *listObjPtr;
- const char *pattern;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- pattern = (objc > 2) ? Tcl_GetString(objv[2]) : NULL;
- for (hPtr = Blt_FirstHashEntry(&dataPtr->busyTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Busy *busyPtr;
-
- busyPtr = Blt_GetHashValue(hPtr);
- if ((pattern == NULL) ||
- (Tcl_StringMatch(Tk_PathName(busyPtr->tkRef), pattern))) {
- Tcl_Obj *objPtr;
- objPtr = Tcl_NewStringObj(Tk_PathName(busyPtr->tkRef), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BusyOp --
- *
- * Reports the names of all widgets with busy windows attached to them,
- * matching a given pattern. If no pattern is given, all busy widgets
- * are listed.
- *
- * Results:
- * Returns a TCL list of the names of the widget with busy windows
- * attached to them, regardless if the widget is currently busy or not.
- *
- *---------------------------------------------------------------------------
- */
-static int
-BusyOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report errors to */
- int objc,
- Tcl_Obj *const *objv)
-{
- BusyInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
- const char *pattern;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- pattern = (objc > 2) ? Tcl_GetString(objv[2]) : NULL;
- for (hPtr = Blt_FirstHashEntry(&dataPtr->busyTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Busy *busyPtr;
-
- busyPtr = Blt_GetHashValue(hPtr);
- if ((busyPtr->flags & ACTIVE) == 0) {
- continue;
- }
- if ((pattern == NULL) ||
- (Tcl_StringMatch(Tk_PathName(busyPtr->tkRef), pattern))) {
- Tcl_Obj *objPtr;
- objPtr = Tcl_NewStringObj(Tk_PathName(busyPtr->tkRef), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CheckOp --
- *
- * Checks if the named window is currently busy. This also includes
- * windows whose ancestors are currently busy.
- *
- * Results:
- * Returns 1 a TCL list of the names of the widget with busy windows
- * attached to them, regardless if the widget is currently busy or not.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CheckOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report errors to */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- BusyInterpData *dataPtr = clientData;
- Tk_Window tkwin;
- const char *pathName;
-
- pathName = Tcl_GetString(objv[2]);
- tkwin = Tk_NameToWindow(interp, pathName, dataPtr->tkMain);
- do {
- hPtr = Blt_FindHashEntry(&dataPtr->busyTable, (char *)tkwin);
- if (hPtr != NULL) {
- Busy *busyPtr;
-
- /* Found a busy window, is it on? */
- busyPtr = Blt_GetHashValue(hPtr);
- if (busyPtr->flags & ACTIVE) {
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), 1);
- return TCL_OK;
- }
- }
- tkwin = Tk_Parent(tkwin);
- } while(tkwin != NULL);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), 0);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HoldOp --
- *
- * Creates (if necessary) and maps a busy window, thereby preventing
- * device events from being be received by the parent window and its
- * children. The argument vector may contain option-value pairs of
- * configuration options to be set.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * Side effects:
- * The busy window is created and displayed, blocking events from the
- * parent window and its children.
- *
- *---------------------------------------------------------------------------
- */
-static int
-HoldOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report errors to */
- int objc,
- Tcl_Obj *const *objv) /* Window name and option pairs */
-{
- BusyInterpData *dataPtr = clientData;
- int i;
- const char *string;
-
- string = Tcl_GetString(objv[1]);
- if ((string[0] == 'h') && (strcmp(string, "hold") == 0)) {
- objc--, objv++; /* Command used "hold" keyword */
- }
- for (i = 1; i < objc; i++) {
- int count;
- /*
- * Find the end of the option-value pairs for this window.
- */
- for (count = i + 1; count < objc; count += 2) {
- string = Tcl_GetString(objv[count]);
- if (string[0] != '-') {
- break;
- }
- }
- if (count > objc) {
- count = objc;
- }
- if (HoldBusy(dataPtr, interp, count - i, objv + i) != TCL_OK) {
- return TCL_ERROR;
- }
- i = count;
- }
- return TCL_OK;
-}
-
-/* ARGSUSED*/
-static int
-CgetOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report errors to */
- int objc,
- Tcl_Obj *const *objv) /* Widget pathname and option switch */
-{
- BusyInterpData *dataPtr = clientData;
- Busy *busyPtr;
- int result;
-
- if (GetBusy(dataPtr, interp, objv[2], &busyPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_Preserve(busyPtr);
- result = Blt_ConfigureValueFromObj(interp, busyPtr->tkRef, configSpecs,
- (char *)busyPtr, objv[3], 0);
- Tcl_Release(busyPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * This procedure is called to process an objv/objc list in order to
- * configure (or reconfigure) a busy window.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result contains an error message.
- *
- * Side effects:
- * Configuration information get set for busyPtr; old resources get
- * freed, if there were any. The busy window destroyed and recreated in
- * a new parent window.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report errors to */
- int objc,
- Tcl_Obj *const *objv) /* Reference window path name and
- * options */
-{
- BusyInterpData *dataPtr = clientData;
- Busy *busyPtr;
- int result;
-
- if (GetBusy(dataPtr, interp, objv[2], &busyPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 3) {
- result = Blt_ConfigureInfoFromObj(interp, busyPtr->tkRef, configSpecs,
- (char *)busyPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 4) {
- result = Blt_ConfigureInfoFromObj(interp, busyPtr->tkRef, configSpecs,
- (char *)busyPtr, objv[3], 0);
- } else {
- Tcl_Preserve(busyPtr);
- result = ConfigureBusy(interp, busyPtr, objc - 3, objv + 3);
- Tcl_Release(busyPtr);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BusyInterpDeleteProc --
- *
- * This is called when the interpreter hosting the "busy" command is
- * destroyed.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Destroys all the hash table managing the busy windows.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-BusyInterpDeleteProc(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp)
-{
- BusyInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->busyTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Busy *busyPtr;
-
- busyPtr = Blt_GetHashValue(hPtr);
- busyPtr->hashPtr = NULL;
- DestroyBusy((DestroyData)busyPtr);
- }
- Blt_DeleteHashTable(&dataPtr->busyTable);
- Tcl_DeleteAssocData(interp, BUSY_THREAD_KEY);
- Blt_Free(dataPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Busy Sub-command specification:
- *
- * - Name of the sub-command.
- * - Minimum number of characters needed to unambiguously
- * recognize the sub-command.
- * - Pointer to the function to be called for the sub-command.
- * - Minimum number of arguments accepted.
- * - Maximum number of arguments accepted.
- * - String to be displayed for usage (arguments only).
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec busyOps[] =
-{
- {"cget", 2, CgetOp, 4, 4, "window option",},
- {"check", 1, CheckOp, 3, 3, "window",},
- {"configure", 2, ConfigureOp, 3, 0, "window ?options?...",},
- {"forget", 1, ForgetOp, 2, 0, "?window?...",},
- {"hold", 3, HoldOp, 3, 0,
- "window ?options?... ?window options?...",},
- {"isbusy", 1, BusyOp, 2, 3, "?pattern?",},
- {"names", 1, NamesOp, 2, 3, "?pattern?",},
- {"release", 1, ReleaseOp, 2, 0, "?window?...",},
- {"status", 1, StatusOp, 3, 3, "window",},
- {"windows", 1, NamesOp, 2, 3, "?pattern?",},
-};
-static int nBusyOps = sizeof(busyOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * BusyCmd --
- *
- * This procedure is invoked to process the "busy" TCL command. See the
- * user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static int
-BusyCmd(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter associated with
- * command */
- int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
- int result;
-
- if (objc > 1) {
- const char *string;
-
- string = Tcl_GetString(objv[1]);
- if (string[0] == '.') {
- return HoldOp(clientData, interp, objc, objv);
- }
- }
- proc = Blt_GetOpFromObj(interp, nBusyOps, busyOps, BLT_OP_ARG1, objc, objv,
- 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (clientData, interp, objc, objv);
- return result;
-}
-
-static BusyInterpData *
-GetBusyInterpData(Tcl_Interp *interp)
-{
- BusyInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (BusyInterpData *)
- Tcl_GetAssocData(interp, BUSY_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(BusyInterpData));
- Tcl_SetAssocData(interp, BUSY_THREAD_KEY, BusyInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->busyTable, BLT_ONE_WORD_KEYS);
- dataPtr->interp = interp;
- dataPtr->tkMain = Tk_MainWindow(interp);
- }
- return dataPtr;
-}
-
-int
-Blt_BusyCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {"busy", BusyCmd, };
-
- cmdSpec.clientData = GetBusyInterpData(interp);
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-
-static void
-DisplayBusy(ClientData clientData)
-{
- Busy *busyPtr = clientData;
- Pixmap drawable;
- Tk_Window tkwin;
- Blt_Painter painter;
-
- busyPtr->flags &= ~REDRAW_PENDING;
- if (busyPtr->tkBusy == NULL) {
- return; /* Window has been destroyed (we
- * should not get here) */
- }
- tkwin = busyPtr->tkBusy;
-#ifndef notdef
- fprintf(stderr, "Calling DisplayBusy(%s)\n", Tk_PathName(tkwin));
-#endif
- if ((Tk_Width(tkwin) <= 1) || (Tk_Height(tkwin) <= 1)) {
- /* Don't bother computing the layout until the size of the window is
- * something reasonable. */
- return;
- }
- busyPtr->width = Tk_Width(tkwin);
- busyPtr->height = Tk_Height(tkwin);
-
- if (!Tk_IsMapped(tkwin)) {
- /* The busy window isn't displayed, so don't bother drawing
- * anything. By getting this far, we've at least computed the
- * coordinates of the graph's new layout. */
- return;
- }
- /* Create a pixmap the size of the window for double buffering. */
- drawable = Tk_GetPixmap(busyPtr->display, Tk_WindowId(tkwin),
- busyPtr->width, busyPtr->height, Tk_Depth(tkwin));
-#ifdef WIN32
- assert(drawable != None);
-#endif
- painter = Blt_GetPainter(busyPtr->tkBusy, 1.0);
- if (busyPtr->snapshot == NULL) {
- Blt_FillBackgroundRectangle(busyPtr->tkBusy, drawable, busyPtr->bg,
- busyPtr->x, busyPtr->y, busyPtr->width, busyPtr->height,
- 0, TK_RELIEF_FLAT);
- if (busyPtr->picture != NULL) {
- int x, y;
-
- x = (busyPtr->width - Blt_PictureWidth(busyPtr->picture)) / 2;
- y = (busyPtr->height - Blt_PictureHeight(busyPtr->picture)) / 2;
- Blt_PaintPicture(painter, drawable, busyPtr->picture, 0, 0,
- busyPtr->width, busyPtr->height, x, y, 0);
- }
- } else {
- Blt_Picture copy;
-
- copy = busyPtr->snapshot;
- if (busyPtr->picture != NULL) {
- int x, y, w, h;
-
- w = Blt_PictureWidth(busyPtr->picture);
- h = Blt_PictureHeight(busyPtr->picture);
- x = (busyPtr->width - w) / 2;
- y = (busyPtr->height - h) / 2;
- fprintf(stderr, "Drawing picture at %d %d w=%d h=%d\n",
- x, y, w, h);
- copy = Blt_ClonePicture(busyPtr->snapshot);
- Blt_BlendPictures(copy, busyPtr->picture, 0, 0, w, h, x, y);
- }
- Blt_PaintPicture(painter, drawable, copy, 0, 0, busyPtr->width,
- busyPtr->height, busyPtr->x, busyPtr->y, 0);
- if (copy != busyPtr->snapshot) {
- Blt_FreePicture(copy);
- }
- }
-#ifdef notdef
- if (busyPtr->text != NULL) {
- Blt_DrawText(drawable);
- }
- if (busyPtr->picture != NULL) {
- int x, y;
-
- Blt_BlendPicture(painter, drawable, busyPtr->picture, 0, 0,
- busyPtr->width, busyPtr->height, busyPtr->x, busyPtr->y, 0);
- Tk_RedrawImage(drawable, busyPtr->text);
- }
-#endif
- XCopyArea(busyPtr->display, drawable, Tk_WindowId(tkwin),
- DefaultGC(busyPtr->display, Tk_ScreenNumber(tkwin)),
- 0, 0, busyPtr->width, busyPtr->height, 0, 0);
- Tk_FreePixmap(busyPtr->display, drawable);
-}
-
-#endif /* NO_BUSY */
-
diff --git a/blt3.0.1/src/bltCanvEps.c b/blt3.0.1/src/bltCanvEps.c
deleted file mode 100644
index aaf6316..0000000
--- a/blt3.0.1/src/bltCanvEps.c
+++ /dev/null
@@ -1,1849 +0,0 @@
-
-/*
- * bltCanvEps.c --
- *
- * This file implements an Encapsulated PostScript item for canvas
- * widgets.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * To do:
- *
- * 1. Add -rotate option. Allow arbitrary rotation of image and EPS.
- * 2. Draw pictures instead of photos. This will eliminate the need
- * to create hidden photo images.
- * 3. Create a spiffy demo that lets you edit your page description.
- */
-#define USE_OLD_CANVAS 1
-
-#include "bltInt.h"
-#include "bltPs.h"
-#include "bltImage.h"
-#include "bltPicture.h"
-#include "bltPainter.h"
-
-#ifdef HAVE_TIFF_H
-#include "tiff.h"
-#endif
-#include <fcntl.h>
-
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-#include <io.h>
-#define open _open
-#define close _close
-#define write _write
-#define unlink _unlink
-#define lseek _lseek
-#define fdopen _fdopen
-#define fcntl _fcntl
-#ifdef _MSC_VER
-#define O_RDWR _O_RDWR
-#define O_CREAT _O_CREAT
-#define O_TRUNC _O_TRUNC
-#define O_EXCL _O_EXCL
-#endif /* _MSC_VER */
-#endif /* _MSC_VER || __BORLANDC__ */
-
-#define DEBUG_READER 0
-#ifndef WIN32
-#define PurifyPrintf printf
-#endif
-#define PS_PREVIEW_EPSI 0
-#define PS_PREVIEW_WMF 1
-#define PS_PREVIEW_TIFF 2
-
-#define MAX_EPS_LINE_LENGTH 255 /* Maximum line length for a EPS
- * file */
-/*
- * ParseInfo --
- *
- * This structure is used to pass PostScript file information around to
- * various routines while parsing the EPS file.
- */
-typedef struct {
- int maxBytes; /* Maximum length of PostScript
- * code. */
- int lineNumber; /* Current line number of EPS file */
- char line[MAX_EPS_LINE_LENGTH + 1]; /* Buffer to contain a single line
- * from the PostScript file. */
- unsigned char hexTable[256]; /* Table for converting ASCII hex
- * digits to values */
-
- char *nextPtr; /* Pointer to the next character to
- * process on the current line. If
- * NULL (or if nextPtr points a NULL
- * byte), this indicates the the next
- * line needs to be read. */
- FILE *f; /* */
-} ParseInfo;
-
-#define DEF_EPS_ANCHOR "nw"
-#define DEF_EPS_OUTLINE_COLOR RGB_BLACK
-#define DEF_EPS_BORDERWIDTH STD_BORDERWIDTH
-#define DEF_EPS_FILE_NAME (char *)NULL
-#define DEF_EPS_FONT STD_FONT
-#define DEF_EPS_FILL_COLOR STD_NORMAL_FOREGROUND
-#define DEF_EPS_HEIGHT "0"
-#define DEF_EPS_IMAGE_NAME (char *)NULL
-#define DEF_EPS_JUSTIFY "center"
-#define DEF_EPS_QUICK_RESIZE "no"
-#define DEF_EPS_RELIEF "sunken"
-#define DEF_EPS_SHOW_IMAGE "yes"
-#define DEF_EPS_STIPPLE (char *)NULL
-#define DEF_EPS_TAGS (char *)NULL
-#define DEF_EPS_TITLE (char *)NULL
-#define DEF_EPS_TITLE_ANCHOR "center"
-#define DEF_EPS_TITLE_COLOR RGB_BLACK
-#define DEF_EPS_WIDTH "0"
-
-/*
- * Information used for parsing configuration specs:
- */
-
-static Tk_CustomOption tagsOption;
-
-BLT_EXTERN Tk_CustomOption bltDistanceOption;
-
-/*
- * The structure below defines the record for each EPS item.
- */
-typedef struct {
- Tk_Item item; /* Generic stuff that's the same for
- * all types. MUST BE FIRST IN
- * STRUCTURE. */
- Tk_Canvas canvas; /* Canvas containing the EPS item. */
- int lastWidth, lastHeight; /* Last known dimensions of the EPS
- * item. This is used to know if the
- * picture preview needs to be
- * resized. */
- Tcl_Interp *interp;
- FILE *psFile; /* File pointer to Encapsulated
- * PostScript file. We'll hold this as
- * long as the EPS item is using this
- * file. */
- unsigned int psStart; /* File offset of PostScript code. */
- unsigned int psLength; /* Length of PostScript code. If zero,
- * indicates to read to EOF. */
- unsigned int wmfStart; /* File offset of Windows Metafile
- * preview. */
- unsigned int wmfLength; /* Length of WMF portion in bytes. If
- * zero, indicates there is no WMF
- * preview. */
- unsigned int tiffStart; /* File offset of TIFF preview. */
- unsigned int tiffLength; /* Length of TIFF portion in bytes. If
- * zero, indicates there is no TIFF *
- * preview. */
- const char *previewImageName;
- int previewFormat;
-
- Tk_Image preview; /* A Tk photo image provided as a
- * preview of the EPS contents. This
- * image supersedes any EPS preview
- * embedded PostScript preview
- * (EPSI). */
- Blt_Painter painter;
- Blt_Picture original; /* The original photo or PostScript
- * preview image converted to a
- * picture. */
- int origFromPicture;
- Blt_Picture picture; /* Holds resized preview image.
- * Created and deleted internally. */
- int firstLine, lastLine; /* First and last line numbers of the
- * PostScript preview. They are used
- * to skip over the preview when
- * encapsulating PostScript for the
- * canvas item. */
- GC fillGC; /* Graphics context to fill background
- * of image outline if no preview
- * image was present. */
- int llx, lly, urx, ury; /* Lower left and upper right
- * coordinates of PostScript bounding
- * box, retrieved from file's
- * "BoundingBox:" field. */
- const char *title; /* Title, retrieved from the file's
- * "Title:" field, to be displayed
- * over the top of the EPS preview
- * (malloc-ed). */
- Tcl_DString dString; /* Contains the encapsulated
- * PostScript. */
-
- /* User configurable fields */
-
- double x, y; /* Requested anchor in canvas
- * coordinates of the item */
- Tk_Anchor anchor;
-
- Region2d bb;
-
- const char *fileName; /* Name of the encapsulated PostScript
- * file. If NULL, indicates that no
- * EPS file has be successfully
- * loaded yet. */
- const char *reqTitle; /* Title to be displayed in the EPS
- * item. Supersedes the title found
- * in the EPS file. If NULL, indicates
- * that the title found in the EPS
- * file should be used. */
- int width, height; /* Requested dimension of EPS item in
- * canvas coordinates. If non-zero,
- * this overrides the dimension
- * computed from the "%%BoundingBox:"
- * specification in the EPS file
- * used. */
- int showImage; /* Indicates if the image or the
- * outline rectangle should be
- * displayed */
-
- int quick;
- unsigned int flags;
-
- XColor *fillColor; /* Fill color of the image outline. */
-
- Tk_3DBorder border; /* Outline color */
-
- int borderWidth;
- int relief;
-
- TextStyle titleStyle; /* Font, color, etc. for title */
- Blt_Font font;
- Pixmap stipple; /* Stipple for image fill */
-
- ClientData tiffPtr;
-#ifdef WIN32
- HENHMETAFILE *hMetaFile; /* Windows metafile. */
-#endif
-} Eps;
-
-static int StringToFont(ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, const char *string, char *widgRec, int offset);
-static char *FontToString (ClientData clientData, Tk_Window tkwin,
- char *widgRec, int offset, Tcl_FreeProc **proc);
-
-static Tk_CustomOption bltFontOption =
-{
- StringToFont, FontToString, (ClientData)0
-};
-
-
-static Tk_ConfigSpec configSpecs[] =
-{
- {TK_CONFIG_ANCHOR, (char *)"-anchor", (char *)NULL, (char *)NULL,
- DEF_EPS_ANCHOR, Blt_Offset(Eps, anchor),
- TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_SYNONYM, (char *)"-bd", "borderWidth", (char *)NULL, (char *)NULL, 0, 0},
- {TK_CONFIG_CUSTOM, (char *)"-borderwidth", "borderWidth", (char *)NULL,
- DEF_EPS_BORDERWIDTH, Blt_Offset(Eps, borderWidth),
- TK_CONFIG_DONT_SET_DEFAULT, &bltDistanceOption},
- {TK_CONFIG_STRING, (char *)"-file", (char *)NULL, (char *)NULL,
- DEF_EPS_FILE_NAME, Blt_Offset(Eps, fileName), TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, (char *)"-font", "font", "Font",
- DEF_EPS_FONT, Blt_Offset(Eps, font), 0, &bltFontOption},
- {TK_CONFIG_COLOR, (char *)"-fill", "fill", (char *)NULL,
- DEF_EPS_FILL_COLOR, Blt_Offset(Eps, fillColor), 0},
- {TK_CONFIG_CUSTOM, (char *)"-height", (char *)NULL, (char *)NULL,
- DEF_EPS_HEIGHT, Blt_Offset(Eps, height),
- TK_CONFIG_DONT_SET_DEFAULT, &bltDistanceOption},
- {TK_CONFIG_STRING, (char *)"-image", (char *)NULL, (char *)NULL,
- DEF_EPS_IMAGE_NAME, Blt_Offset(Eps, previewImageName),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_JUSTIFY, (char *)"-justify", "justify", "Justify",
- DEF_EPS_JUSTIFY, Blt_Offset(Eps, titleStyle.justify),
- TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_BORDER, (char *)"-outline", "outline", (char *)NULL,
- DEF_EPS_OUTLINE_COLOR, Blt_Offset(Eps, border),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_BOOLEAN, (char *)"-quick", "quick", "Quick",
- DEF_EPS_QUICK_RESIZE, Blt_Offset(Eps, quick),
- TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_RELIEF, (char *)"-relief", (char *)NULL, (char *)NULL,
- DEF_EPS_RELIEF, Blt_Offset(Eps, relief),
- TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_BOOLEAN, (char *)"-showimage", "showImage", "ShowImage",
- DEF_EPS_SHOW_IMAGE, Blt_Offset(Eps, showImage),
- TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_BITMAP, (char *)"-stipple", (char *)NULL, (char *)NULL,
- DEF_EPS_STIPPLE, Blt_Offset(Eps, stipple), TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, (char *)"-tags", (char *)NULL, (char *)NULL,
- DEF_EPS_TAGS, 0, TK_CONFIG_NULL_OK, &tagsOption},
- {TK_CONFIG_STRING, (char *)"-title", (char *)NULL, (char *)NULL,
- DEF_EPS_TITLE, Blt_Offset(Eps, reqTitle), TK_CONFIG_NULL_OK},
- {TK_CONFIG_ANCHOR, (char *)"-titleanchor", (char *)NULL, (char *)NULL,
- DEF_EPS_TITLE_ANCHOR, Blt_Offset(Eps, titleStyle.anchor), 0},
- {TK_CONFIG_COLOR, (char *)"-titlecolor", (char *)NULL, (char *)NULL,
- DEF_EPS_TITLE_COLOR, Blt_Offset(Eps, titleStyle.color), 0},
- {TK_CONFIG_CUSTOM, (char *)"-width", (char *)NULL, (char *)NULL,
- DEF_EPS_WIDTH, Blt_Offset(Eps, width),
- TK_CONFIG_DONT_SET_DEFAULT, &bltDistanceOption},
- {TK_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-/* Prototypes for procedures defined in this file: */
-static Tk_ImageChangedProc ImageChangedProc;
-static Tk_ItemCoordProc EpsCoords;
-static Tk_ItemAreaProc EpsToArea;
-static Tk_ItemPointProc EpsToPoint;
-static Tk_ItemConfigureProc ConfigureEps;
-static Tk_ItemCreateProc CreateEps;
-static Tk_ItemDeleteProc DeleteEps;
-static Tk_ItemDisplayProc DisplayEps;
-static Tk_ItemScaleProc ScaleEps;
-static Tk_ItemTranslateProc TranslateEps;
-static Tk_ItemPostscriptProc EpsToPostScript;
-
-static void ComputeEpsBbox(Tk_Canvas canvas, Eps *imgPtr);
-static int ReadPostScript(Tcl_Interp *interp, Eps *epsPtr);
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * StringToFont --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-StringToFont(
- ClientData clientData, /* Indicated how to check distance */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Window */
- const char *string, /* Pixel value string */
- char *widgRec, /* Widget record */
- int offset) /* Offset of pixel size in record */
-{
- Blt_Font *fontPtr = (Blt_Font *)(widgRec + offset);
- Blt_Font font;
-
- font = Blt_GetFont(interp, tkwin, string);
- if (font == NULL) {
- return TCL_ERROR;
- }
- *fontPtr = font;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FontToString --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static char *
-FontToString(
- ClientData clientData, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget structure record */
- int offset, /* Offset in widget record */
- Tcl_FreeProc **freeProcPtr) /* Not used. */
-{
- Blt_Font font = *(Blt_Font *)(widgRec + offset);
- const char *string;
-
- string = Blt_NameOfFont(font);
- *freeProcPtr = (Tcl_FreeProc *)TCL_STATIC;
- return (char *)string;
-}
-
-static char *
-SkipBlanks(ParseInfo *piPtr)
-{
- char *s;
-
- for (s = piPtr->line; isspace(UCHAR(*s)); s++) {
- /*empty*/
- }
- return s;
-}
-
-static int
-ReadPsLine(ParseInfo *piPtr)
-{
- int nBytes;
-
- nBytes = 0;
- if (ftell(piPtr->f) < piPtr->maxBytes) {
- char *cp;
-
- cp = piPtr->line;
- while ((*cp = fgetc(piPtr->f)) != EOF) {
- if (*cp == '\r') {
- continue;
- }
- nBytes++;
- if ((*cp == '\n') || (nBytes >= MAX_EPS_LINE_LENGTH)) {
- break;
- }
- cp++;
- }
- if (*cp == '\n') {
- piPtr->lineNumber++;
- }
- *cp = '\0';
- }
- return nBytes;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReverseBits --
- *
- * Convert a byte from a X image into PostScript image order. This
- * requires not only the nybbles to be reversed but also their bit
- * values.
- *
- * Results:
- * The converted byte is returned.
- *
- *---------------------------------------------------------------------------
- */
-INLINE static unsigned char
-ReverseBits(unsigned char byte)
-{
- byte = ((byte >> 1) & 0x55) | ((byte << 1) & 0xaa);
- byte = ((byte >> 2) & 0x33) | ((byte << 2) & 0xcc);
- byte = ((byte >> 4) & 0x0f) | ((byte << 4) & 0xf0);
- return byte;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetHexValue --
- *
- * Reads the next ASCII hex value from EPS preview image and converts it.
- *
- * Results:
- * One of three TCL return values is possible.
- *
- * TCL_OK the next byte was successfully parsed.
- * TCL_ERROR an error occurred processing the next hex value.
- * TCL_RETURN "%%EndPreview" line was detected.
- *
- * The converted hex value is returned via "bytePtr".
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetHexValue(ParseInfo *piPtr, unsigned char *bytePtr)
-{
- char *p;
- unsigned int byte;
- unsigned char a, b;
-
- p = piPtr->nextPtr;
- if (p == NULL) {
-
- nextLine:
- if (!ReadPsLine(piPtr)) {
-#if DEBUG_READER
- PurifyPrintf("short file\n");
-#endif
- return TCL_ERROR; /* Short file */
- }
- if (piPtr->line[0] != '%') {
-#if DEBUG_READER
- PurifyPrintf("line doesn't start with %% (%s)\n", piPtr->line);
-#endif
- return TCL_ERROR;
- }
- if ((piPtr->line[1] == '%') &&
- (strncmp(piPtr->line + 2, "EndPreview", 10) == 0)) {
-#if DEBUG_READER
- PurifyPrintf("end of preview (%s)\n", piPtr->line);
-#endif
- return TCL_RETURN;
- }
- p = piPtr->line + 1;
- }
- while (isspace((int)*p)) {
- p++; /* Skip spaces */
- }
- if (*p == '\0') {
- goto nextLine;
- }
-
- a = piPtr->hexTable[(int)p[0]];
- b = piPtr->hexTable[(int)p[1]];
-
- if ((a == 0xFF) || (b == 0xFF)) {
-#if DEBUG_READER
- PurifyPrintf("not a hex digit (%s)\n", piPtr->line);
-#endif
- return TCL_ERROR;
- }
- byte = (a << 4) | b;
- p += 2;
- piPtr->nextPtr = p;
- *bytePtr = byte;
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReadEPSI --
- *
- * Reads the EPS preview image from the PostScript file, converting it
- * into a picture. If an error occurs when parsing the preview, the
- * preview is silently ignored.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ReadEPSI(Eps *epsPtr, ParseInfo *piPtr)
-{
- Blt_Picture picture;
- int width, height, bitsPerPixel, nLines;
- char *dscBeginPreview;
-
- dscBeginPreview = piPtr->line + 16;
- if (sscanf(dscBeginPreview, "%d %d %d %d", &width, &height, &bitsPerPixel,
- &nLines) != 4) {
-#if DEBUG_READER
- PurifyPrintf("bad %%BeginPreview (%s) format\n", dscBeginPreview);
-#endif
- return;
- }
- if (((bitsPerPixel != 1) && (bitsPerPixel != 8)) || (width < 1) ||
- (width > SHRT_MAX) || (height < 1) || (height > SHRT_MAX)) {
-#if DEBUG_READER
- PurifyPrintf("Bad %%BeginPreview (%s) values\n", dscBeginPreview);
-#endif
- return; /* Bad "%%BeginPreview:" information */
- }
- epsPtr->firstLine = piPtr->lineNumber;
- Blt_InitHexTable(piPtr->hexTable);
- piPtr->nextPtr = NULL;
- picture = Blt_CreatePicture(width, height);
-
- if (bitsPerPixel == 8) {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = Blt_PictureBits(picture) +
- (height - 1) * Blt_PictureStride(picture);
- for (y = height - 1; y >= 0; y--) {
- Blt_Pixel *dp;
- int x;
-
- dp = destRowPtr;
- for (x = 0; x < width; x++, dp++) {
- int result;
- unsigned char byte;
-
- result = GetHexValue(piPtr, &byte);
- if (result == TCL_ERROR) {
- goto error;
- }
- if (result == TCL_RETURN) {
- goto done;
- }
- dp->Red = dp->Green = dp->Blue = ~byte;
- dp->Alpha = ALPHA_OPAQUE;
- }
- destRowPtr -= Blt_PictureStride(picture);
- }
- } else if (bitsPerPixel == 1) {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = Blt_PictureBits(picture);
- for (y = 0; y < height; y++) {
- Blt_Pixel *dp, *dend;
- int bit;
- unsigned char byte;
-
- bit = 8;
- byte = 0; /* Suppress compiler warning. */
- for (dp = destRowPtr, dend = dp + width; dp < dend; dp++) {
- if (bit == 8) {
- int result;
-
- result = GetHexValue(piPtr, &byte);
- if (result == TCL_ERROR) {
- goto error;
- }
- if (result == TCL_RETURN) {
- goto done;
- }
- byte = ReverseBits(byte);
- bit = 0;
- }
- if (((byte >> bit) & 0x01) == 0) {
- dp->u32 = 0xFFFFFFFF;
- }
- bit++;
- }
- destRowPtr += Blt_PictureStride(picture);
- }
- } else {
- fprintf(stderr, "unknown EPSI bitsPerPixel (%d)\n", bitsPerPixel);
- }
- done:
- epsPtr->original = picture;
- epsPtr->origFromPicture = FALSE;
- epsPtr->lastWidth = Blt_PictureWidth(picture);
- epsPtr->lastHeight = Blt_PictureHeight(picture);
- epsPtr->lastLine = piPtr->lineNumber + 1;
- return;
-
- error:
- epsPtr->firstLine = epsPtr->lastLine = -1;
- if (picture != NULL) {
- Blt_FreePicture(picture);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReadPostScript --
- *
- * This routine reads and parses the few fields we need out of an EPS
- * file.
- *
- * The EPS standards are outlined from Appendix H of the "PostScript
- * Language Reference Manual" pp. 709-736.
- *
- * Mandatory fields:
- *
- * - Starts with "%!PS*"
- * - Contains "%%BoundingBox: llx lly urx ury"
- *
- * Optional fields for EPS item:
- * - "%%BeginPreview: w h bpp #lines"
- * Preview is in hexadecimal. Each line must start with "%"
- * - "%%EndPreview"
- * - "%%Title: (string)"
- *
- *---------------------------------------------------------------------------
- */
-static int
-ReadPostScript(Tcl_Interp *interp, Eps *epsPtr)
-{
- char *field;
- char *dscTitle, *dscBoundingBox;
- char *dscEndComments;
- ParseInfo pi;
-
- pi.line[0] = '\0';
- pi.maxBytes = epsPtr->psLength;
- pi.lineNumber = 0;
- pi.f = epsPtr->psFile;
-
- Tcl_DStringInit(&epsPtr->dString);
- if (pi.maxBytes == 0) {
- pi.maxBytes = INT_MAX;
- }
- if (epsPtr->psStart > 0) {
- if (fseek(epsPtr->psFile, epsPtr->psStart, 0) != 0) {
- Tcl_AppendResult(interp,
- "can't seek to start of PostScript code in \"",
- epsPtr->fileName, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (!ReadPsLine(&pi)) {
- Tcl_AppendResult(interp, "file \"", epsPtr->fileName, "\" is empty?",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (strncmp(pi.line, "%!PS", 4) != 0) {
- Tcl_AppendResult(interp, "file \"", epsPtr->fileName,
- "\" doesn't start with \"%!PS\"", (char *)NULL);
- return TCL_ERROR;
- }
-
- /*
- * Initialize field flags to NULL. We want to look only at the first
- * appearance of these comment fields. The file itself may have another
- * EPS file embedded into it.
- */
- dscBoundingBox = dscTitle = dscEndComments = NULL;
- pi.lineNumber = 1;
- while (ReadPsLine(&pi)) {
- pi.lineNumber++;
- if ((pi.line[0] == '%') && (pi.line[1] == '%')) { /* Header comment */
- field = pi.line + 2;
- if (field[0] == 'B') {
- if (strncmp(field, "BeginSetup", 8) == 0) {
- break; /* Done */
- }
- if (strncmp(field, "BeginProlog", 8) == 0) {
- break; /* Done */
- }
- if ((strncmp(field, "BoundingBox:", 12) == 0) &&
- (dscBoundingBox == NULL)) {
- int nFields;
-
- dscBoundingBox = field + 12;
- nFields = sscanf(dscBoundingBox, "%d %d %d %d",
- &epsPtr->llx, &epsPtr->lly,
- &epsPtr->urx, &epsPtr->ury);
- if (nFields != 4) {
- Tcl_AppendResult(interp,
- "bad \"%%BoundingBox\" values: \"",
- dscBoundingBox, "\"", (char *)NULL);
- goto error;
- }
- }
- } else if ((field[0] == 'T') &&
- (strncmp(field, "Title:", 6) == 0)) {
- if (dscTitle == NULL) {
- char *lp, *rp;
-
- lp = strchr(field + 6, '(');
- if (lp != NULL) {
- rp = strrchr(field + 6, ')');
- if (rp != NULL) {
- *rp = '\0';
- }
- dscTitle = Blt_AssertStrdup(lp + 1);
- } else {
- dscTitle = Blt_AssertStrdup(field + 6);
- }
- }
- } else if (field[0] == 'E') {
- if (strncmp(field, "EndComments", 11) == 0) {
- dscEndComments = field;
- break; /* Done */
- }
- }
- } /* %% */
- }
- if (dscBoundingBox == NULL) {
- Tcl_AppendResult(interp, "no \"%%BoundingBox:\" found in \"",
- epsPtr->fileName, "\"", (char *)NULL);
- goto error;
- }
- if (dscEndComments != NULL) {
- /* Check if a "%%BeginPreview" immediately follows */
- while (ReadPsLine(&pi)) {
- field = SkipBlanks(&pi);
- if (field[0] != '\0') {
- break;
- }
- }
- if (strncmp(pi.line, "%%BeginPreview:", 15) == 0) {
- ReadEPSI(epsPtr, &pi);
- }
- }
- if (dscTitle != NULL) {
- epsPtr->title = dscTitle;
- }
- /* Finally save the PostScript into a dynamic string. */
- while (ReadPsLine(&pi)) {
- Tcl_DStringAppend(&epsPtr->dString, pi.line, -1);
- Tcl_DStringAppend(&epsPtr->dString, "\n", 1);
- }
- return TCL_OK;
- error:
- if (dscTitle != NULL) {
- Blt_Free(dscTitle);
- }
- return TCL_ERROR; /* BoundingBox: is required. */
-}
-
-static int
-OpenEpsFile(Tcl_Interp *interp, Eps *epsPtr)
-{
- FILE *f;
-#ifdef WIN32
- DOSEPSHEADER dosHeader;
- int nBytes;
-#endif
-
- f = Blt_OpenFile(interp, epsPtr->fileName, "rb");
- if (f == NULL) {
- Tcl_AppendResult(epsPtr->interp, "can't open \"", epsPtr->fileName,
- "\": ", Tcl_PosixError(epsPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- epsPtr->psFile = f;
- epsPtr->psStart = epsPtr->psLength = 0L;
- epsPtr->wmfStart = epsPtr->wmfLength = 0L;
- epsPtr->tiffStart = epsPtr->tiffLength = 0L;
-
-#ifdef WIN32
- nBytes = fread(&dosHeader, sizeof(DOSEPSHEADER), 1, f);
- if ((nBytes == sizeof(DOSEPSHEADER)) &&
- (dosHeader.magic[0] == 0xC5) && (dosHeader.magic[1] == 0xD0) &&
- (dosHeader.magic[2] == 0xD3) && (dosHeader.magic[3] == 0xC6)) {
-
- /* DOS EPS file */
- epsPtr->psStart = dosHeader.psStart;
- epsPtr->wmfStart = dosHeader.wmfStart;
- epsPtr->wmfLength = dosHeader.wmfLength;
- epsPtr->tiffStart = dosHeader.tiffStart;
- epsPtr->tiffLength = dosHeader.tiffLength;
- epsPtr->previewFormat = PS_PREVIEW_EPSI;
-#ifdef HAVE_TIFF_H
- if (epsPtr->tiffLength > 0) {
- epsPtr->previewFormat = PS_PREVIEW_TIFF;
- }
-#endif /* HAVE_TIFF_H */
- if (epsPtr->wmfLength > 0) {
- epsPtr->previewFormat = PS_PREVIEW_WMF;
- }
- }
- fseek(f, 0, 0);
-#endif /* WIN32 */
- return ReadPostScript(interp, epsPtr);
-}
-
-static void
-CloseEpsFile(Eps *epsPtr)
-{
- if (epsPtr->psFile != NULL) {
- fclose(epsPtr->psFile);
- epsPtr->psFile = NULL;
- }
-}
-
-#ifdef WIN32
-#ifdef HAVE_TIFF_H
-static void
-ReadTiffPreview(Eps *epsPtr)
-{
- unsigned int width, height;
- Blt_Picture picture;
- Blt_Pixel *dataPtr;
- FILE *f;
- int n;
-
- TIFFGetField(epsPtr->tiffPtr, TIFFTAG_IMAGEWIDTH, &width);
- TIFFGetField(epsPtr->tiffPtr, TIFFTAG_IMAGELENGTH, &height);
- picture = Blt_CreatePicture(width, height);
- dataPtr = Blt_PictureBits(picture);
- if (!TIFFReadRGBAImage(epsPtr->tiffPtr, width, height, dataPtr, 0)) {
- Blt_FreePicture(picture);
- return;
- }
- /* Reverse the order of the components for each pixel. */
- /* ... */
- epsPtr->origFromPicture = FALSE;
- epsPtr->picture = picture;
-}
-#endif
-
-#ifdef notdef
-ReadWMF(f, epsPtr, headerPtr)
- FILE *f;
-{
- HANDLE hMem;
- Tk_Window tkwin;
-
- if (fseek(f, headerPtr->wmfStart, 0) != 0) {
- Tcl_AppendResult(interp, "can't seek in \"", epsPtr->fileName,
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- hMem = GlobalAlloc(GHND, size);
- if (hMem == NULL) {
- Tcl_AppendResult(graphPtr->interp, "can't allocate global memory:",
- Blt_LastError(), (char *)NULL);
- return TCL_ERROR;
- }
- buffer = (LPVOID)GlobalLock(hMem);
- /* Read the header and see what kind of meta file it is. */
- fread(buffer, sizeof(unsigned char), headerPtr->wmfLength, f);
- mfp.mm = 0;
- mfp.xExt = epsPtr->width;
- mfp.yExt = epsPtr->height;
- mfp.hMF = hMetaFile;
- tkwin = Tk_CanvasTkwin(epsPtr->canvas);
- hRefDC = TkWinGetDrawableDC(Tk_Display(tkwin), Tk_WindowId(tkwin), &state);
- hDC = CreateEnhMetaFile(hRefDC, NULL, NULL, NULL);
- mfp.hMF = CloseEnhMetaFile(hDC);
- hMetaFile = SetWinMetaFileBits(size, buffer, MM_ANISOTROPIC, &picture);
- Tcl_AppendResult(graphPtr->interp, "can't get metafile data:",
- Blt_LastError(), (char *)NULL);
- goto error;
-}
-#endif
-#endif /* WIN32 */
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteEps --
- *
- * This procedure is called to clean up the data structure associated
- * with a EPS item.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Resources associated with itemPtr are released.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-DeleteEps(
- Tk_Canvas canvas, /* Info about overall canvas
- * widget. */
- Tk_Item *itemPtr, /* Item that is being deleted. */
- Display *display) /* Display containing window for
- * canvas. */
-{
- Eps *epsPtr = (Eps *)itemPtr;
-
- Tk_FreeOptions(configSpecs, (char *)epsPtr, display, 0);
- CloseEpsFile(epsPtr);
- if ((!epsPtr->origFromPicture) && (epsPtr->original != NULL)) {
- Blt_FreePicture(epsPtr->original);
- }
- if (epsPtr->picture != NULL) {
- Blt_FreePicture(epsPtr->picture);
- }
- if (epsPtr->painter != NULL) {
- Blt_FreePainter(epsPtr->painter);
- }
- if (epsPtr->preview != NULL) {
- Tk_FreeImage(epsPtr->preview);
- }
- if (epsPtr->previewImageName != NULL) {
- Blt_Free(epsPtr->previewImageName);
- }
- if (epsPtr->stipple != None) {
- Tk_FreePixmap(display, epsPtr->stipple);
- }
- if (epsPtr->fillGC != NULL) {
- Tk_FreeGC(display, epsPtr->fillGC);
- }
- Blt_Ts_FreeStyle(display, &epsPtr->titleStyle);
-
- if (epsPtr->title != NULL) {
- Blt_Free(epsPtr->title);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateEps --
- *
- * This procedure is invoked to create a new EPS item in a canvas.
- *
- * Results:
- * A standard TCL return value. If an error occurred in creating the
- * item, then an error message is left in interp->result; in this case
- * itemPtr is left uninitialized, so it can be safely freed by the
- * caller.
- *
- * Side effects:
- * A new EPS item is created.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateEps(
- Tcl_Interp *interp, /* Interpreter for error reporting. */
- Tk_Canvas canvas, /* Canvas to hold new item. */
- Tk_Item *itemPtr, /* Record to hold new item; header has
- * been initialized by caller. */
- int argc, /* Number of arguments in argv. */
- char **argv) /* Arguments describing rectangle. */
-{
- Eps *epsPtr = (Eps *)itemPtr;
- Tk_Window tkwin;
- double x, y;
-
- tkwin = Tk_CanvasTkwin(canvas);
- if (argc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tk_PathName(tkwin), " create ", itemPtr->typePtr->name,
- " x1 y1 ?options?\"", (char *)NULL);
- return TCL_ERROR;
- }
-
- /* Initialize the item's record by hand (bleah). */
- epsPtr->anchor = TK_ANCHOR_NW;
- epsPtr->border = NULL;
- epsPtr->borderWidth = 0;
- epsPtr->canvas = canvas;
- epsPtr->fileName = NULL;
- epsPtr->psFile = NULL;
- epsPtr->fillGC = NULL;
- epsPtr->fillColor = NULL;
- epsPtr->painter = NULL;
- epsPtr->original = NULL;
- epsPtr->origFromPicture = FALSE;
- epsPtr->previewImageName = NULL;
- epsPtr->preview = NULL;
- epsPtr->interp = interp;
- epsPtr->picture = NULL;
- epsPtr->firstLine = epsPtr->lastLine = -1;
- epsPtr->relief = TK_RELIEF_SUNKEN;
- epsPtr->reqTitle = NULL;
- epsPtr->stipple = None;
- epsPtr->showImage = TRUE;
- epsPtr->quick = FALSE;
- epsPtr->title = NULL;
- epsPtr->lastWidth = epsPtr->lastHeight = 0;
- epsPtr->width = epsPtr->height = 0;
- epsPtr->x = epsPtr->y = 0.0;
- epsPtr->llx = epsPtr->lly = epsPtr->urx = epsPtr->ury = 0;
- epsPtr->bb.left = epsPtr->bb.right = epsPtr->bb.top = epsPtr->bb.bottom = 0;
- Tcl_DStringInit(&epsPtr->dString);
- Blt_Ts_InitStyle(epsPtr->titleStyle);
-#define PAD 8
- Blt_Ts_SetPadding(epsPtr->titleStyle, PAD, PAD, PAD, PAD);
-
- /* Process the arguments to fill in the item record. */
- if ((Tk_CanvasGetCoord(interp, canvas, argv[0], &x) != TCL_OK) ||
- (Tk_CanvasGetCoord(interp, canvas, argv[1], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- epsPtr->x = x;
- epsPtr->y = y;
- if (ConfigureEps(interp, canvas, itemPtr, argc - 2, argv + 2, 0)
- != TCL_OK) {
- DeleteEps(canvas, itemPtr, Tk_Display(tkwin));
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImageChangedProc
- *
- * The image is over-written each time the EPS item is resized. So we
- * only worry if the image is deleted.
- *
- * We always resample from the picture we saved when the photo image was
- * specified (-image option).
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-ImageChangedProc(
- ClientData clientData,
- int x, int y, int width, int height, /* Not used. */
- int imageWidth, int imageHeight) /* Not used. */
-{
- Eps *epsPtr = clientData;
-
- if ((epsPtr->preview == NULL) || (Blt_Image_IsDeleted(epsPtr->preview))) {
- epsPtr->preview = NULL;
- if (epsPtr->previewImageName != NULL) {
- Blt_Free(epsPtr->previewImageName);
- epsPtr->previewImageName = NULL;
- }
- Tk_CanvasEventuallyRedraw(epsPtr->canvas, epsPtr->item.x1,
- epsPtr->item.y1, epsPtr->item.x2, epsPtr->item.y2);
- }
- if (epsPtr->preview != NULL) {
- int result;
-
- if ((!epsPtr->origFromPicture) && (epsPtr->original != NULL)) {
- Blt_FreePicture(epsPtr->original);
- }
- result = Blt_GetPicture(epsPtr->interp, epsPtr->previewImageName,
- &epsPtr->original);
- if (result == TCL_OK) {
- epsPtr->origFromPicture = TRUE;
- } else {
- Tk_PhotoHandle photo; /* Photo handle to Tk image. */
-
- photo = Tk_FindPhoto(epsPtr->interp, epsPtr->previewImageName);
- if (photo == NULL) {
- fprintf(stderr, "image \"%s\" isn't a picture or photo image\n",
- epsPtr->previewImageName);
- return;
- }
- epsPtr->original = Blt_PhotoToPicture(photo);
- epsPtr->origFromPicture = FALSE;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureEps --
- *
- * This procedure is invoked to configure various aspects of an EPS item,
- * such as its background color.
- *
- * Results:
- * A standard TCL result code. If an error occurs, then an error message
- * is left in interp->result.
- *
- * Side effects:
- * Configuration information may be set for itemPtr.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureEps(
- Tcl_Interp *interp, /* Used for error reporting. */
- Tk_Canvas canvas, /* Canvas containing itemPtr. */
- Tk_Item *itemPtr, /* EPS item to reconfigure. */
- int argc, /* Number of elements in argv. */
- char **argv, /* Arguments describing things to
- * configure. */
- int flags) /* Flags to pass to
- * Tk_ConfigureWidget. */
-{
- Eps *epsPtr = (Eps *)itemPtr;
- Tk_Window tkwin;
- XGCValues gcValues;
- unsigned long gcMask;
- GC newGC;
- int width, height;
- Blt_Painter painter;
-
- tkwin = Tk_CanvasTkwin(canvas);
- if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, (const char**)argv,
- (char *)epsPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- painter = Blt_GetPainter(tkwin, 1.0);
- if (epsPtr->painter != NULL) {
- Blt_FreePainter(epsPtr->painter);
- }
- epsPtr->painter = painter;
- /* Determine the size of the EPS item */
- /*
- * Check for a "-image" option specifying an image to be displayed
- * representing the EPS canvas item.
- */
- if (Blt_OldConfigModified(configSpecs, "-image", (char *)NULL)) {
- if (epsPtr->preview != NULL) {
- Tk_FreeImage(epsPtr->preview); /* Release old Tk image */
- if ((!epsPtr->origFromPicture) && (epsPtr->original != NULL)) {
- Blt_FreePicture(epsPtr->original);
- }
- epsPtr->original = NULL;
- if (epsPtr->picture != NULL) {
- Blt_FreePicture(epsPtr->picture);
- }
- epsPtr->picture = NULL;
- epsPtr->preview = NULL;
- epsPtr->origFromPicture = FALSE;
- }
- if (epsPtr->previewImageName != NULL) {
- int result;
-
- /* Allocate a new image, if one was named. */
- epsPtr->preview = Tk_GetImage(interp, tkwin,
- epsPtr->previewImageName, ImageChangedProc, epsPtr);
- if (epsPtr->preview == NULL) {
- Tcl_AppendResult(interp, "can't find an image \"",
- epsPtr->previewImageName, "\"", (char *)NULL);
- Blt_Free(epsPtr->previewImageName);
- epsPtr->previewImageName = NULL;
- return TCL_ERROR;
- }
- result = Blt_GetPicture(interp, epsPtr->previewImageName,
- &epsPtr->original);
- if (result == TCL_OK) {
- epsPtr->origFromPicture = TRUE;
- } else {
- Tk_PhotoHandle photo; /* Photo handle to Tk image. */
-
- photo = Tk_FindPhoto(interp, epsPtr->previewImageName);
- if (photo == NULL) {
- Tcl_AppendResult(interp, "image \"",
- epsPtr->previewImageName,
- "\" is not a picture or photo image", (char *)NULL);
- return TCL_ERROR;
- }
- epsPtr->original = Blt_PhotoToPicture(photo);
- epsPtr->origFromPicture = FALSE;
- }
- }
- }
- if (Blt_OldConfigModified(configSpecs, "-file", (char *)NULL)) {
- CloseEpsFile(epsPtr);
- if ((!epsPtr->origFromPicture) && (epsPtr->original != NULL)) {
- Blt_FreePicture(epsPtr->original);
- epsPtr->original = NULL;
- }
- if (epsPtr->picture != NULL) {
- Blt_FreePicture(epsPtr->picture);
- epsPtr->picture = NULL;
- }
- epsPtr->firstLine = epsPtr->lastLine = -1;
- if (epsPtr->fileName != NULL) {
- if (OpenEpsFile(interp, epsPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- /* Compute the normal width and height of the item, but let the
- * user-requested dimensions override them. */
- width = height = 0;
- if (epsPtr->preview != NULL) {
- /* Default dimension is the size of the image. */
- Tk_SizeOfImage(epsPtr->preview, &width, &height);
- }
- if (epsPtr->fileName != NULL) {
- /* Use dimensions provided by the BoundingBox. */
- width = (epsPtr->urx - epsPtr->llx);
- height = (epsPtr->ury - epsPtr->lly);
- }
- if (epsPtr->width == 0) {
- epsPtr->width = width;
- }
- if (epsPtr->height == 0) {
- epsPtr->height = height;
- }
-
- if (Blt_OldConfigModified(configSpecs, "-quick", (char *)NULL)) {
- epsPtr->lastWidth = epsPtr->lastHeight = 0;
- }
- /* Fill color GC */
-
- newGC = NULL;
- if (epsPtr->fillColor != NULL) {
- gcMask = GCForeground;
- gcValues.foreground = epsPtr->fillColor->pixel;
- if (epsPtr->stipple != None) {
- gcMask |= (GCStipple | GCFillStyle);
- gcValues.stipple = epsPtr->stipple;
- if (epsPtr->border != NULL) {
- gcValues.foreground = Tk_3DBorderColor(epsPtr->border)->pixel;
- gcValues.background = epsPtr->fillColor->pixel;
- gcMask |= GCBackground;
- gcValues.fill_style = FillOpaqueStippled;
- } else {
- gcValues.fill_style = FillStippled;
- }
- }
- newGC = Tk_GetGC(tkwin, gcMask, &gcValues);
- }
- if (epsPtr->fillGC != NULL) {
- Tk_FreeGC(Tk_Display(tkwin), epsPtr->fillGC);
- }
- epsPtr->fillGC = newGC;
- CloseEpsFile(epsPtr);
- ComputeEpsBbox(canvas, epsPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EpsCoords --
- *
- * This procedure is invoked to process the "coords" widget command on
- * EPS items. See the user documentation for details on what it does.
- *
- * Results:
- * Returns TCL_OK or TCL_ERROR, and sets interp->result.
- *
- * Side effects:
- * The coordinates for the given item may be changed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-EpsCoords(
- Tcl_Interp *interp, /* Used for error reporting. */
- Tk_Canvas canvas, /* Canvas containing item. */
- Tk_Item *itemPtr, /* Item whose coordinates are to be
- * read or modified. */
- int argc, /* Number of coordinates supplied in
- * argv. */
- char **argv) /* Array of coordinates: x1, y1, x2,
- * y2, ... */
-{
- Eps *epsPtr = (Eps *)itemPtr;
-
- if ((argc != 0) && (argc != 2)) {
- Tcl_AppendResult(interp, "wrong # coordinates: expected 0 or 2, got ",
- Blt_Itoa(argc), (char *)NULL);
- return TCL_ERROR;
- }
- if (argc == 2) {
- double x, y; /* Don't overwrite old coordinates on
- * errors */
-
- if ((Tk_CanvasGetCoord(interp, canvas, argv[0], &x) != TCL_OK) ||
- (Tk_CanvasGetCoord(interp, canvas, argv[1], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- epsPtr->x = x;
- epsPtr->y = y;
- ComputeEpsBbox(canvas, epsPtr);
- return TCL_OK;
- }
- Tcl_AppendElement(interp, Blt_Dtoa(interp, epsPtr->x));
- Tcl_AppendElement(interp, Blt_Dtoa(interp, epsPtr->y));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeEpsBbox --
- *
- * This procedure is invoked to compute the bounding box of all the
- * pixels that may be drawn as part of a EPS item. This procedure is
- * where the preview image's placement is computed.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The fields x1, y1, x2, and y2 are updated in the item for itemPtr.
- *
- *---------------------------------------------------------------------------
- */
- /* ARGSUSED */
-static void
-ComputeEpsBbox(
- Tk_Canvas canvas, /* Canvas that contains item. */
- Eps *epsPtr) /* Item whose bbox is to be
- * recomputed. */
-{
- Point2d anchorPos;
-
- /* Translate the coordinates wrt the anchor. */
- anchorPos = Blt_AnchorPoint(epsPtr->x, epsPtr->y, (double)epsPtr->width,
- (double)epsPtr->height, epsPtr->anchor);
- /*
- * Note: The right and bottom are exterior to the item.
- */
- epsPtr->bb.left = anchorPos.x;
- epsPtr->bb.top = anchorPos.y;
- epsPtr->bb.right = epsPtr->bb.left + epsPtr->width;
- epsPtr->bb.bottom = epsPtr->bb.top + epsPtr->height;
-
- epsPtr->item.x1 = ROUND(epsPtr->bb.left);
- epsPtr->item.y1 = ROUND(epsPtr->bb.top);
- epsPtr->item.x2 = ROUND(epsPtr->bb.right);
- epsPtr->item.y2 = ROUND(epsPtr->bb.bottom);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayEps --
- *
- * This procedure is invoked to draw the EPS item in a given drawable.
- * The EPS item may be drawn as either a solid rectangle or a pixmap of
- * the preview image.
- *
- * Results:
- * None.
- *
- * Side effects:
- * ItemPtr is drawn in drawable using the transformation information in
- * canvas.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayEps(
- Tk_Canvas canvas, /* Canvas that contains item. */
- Tk_Item *itemPtr, /* Item to be displayed. */
- Display *display, /* Display on which to draw item. */
- Drawable drawable, /* Pixmap or window in which to draw
- * item. */
- int rx, int ry,
- int rw, int rh) /* Describes region of canvas that
- * must be redisplayed (not used). */
-{
- Blt_Picture picture;
- Eps *epsPtr = (Eps *)itemPtr;
- Tk_Window tkwin;
- const char *title;
- int w, h;
- short int dx, dy;
-
- w = (int)(epsPtr->bb.right - epsPtr->bb.left);
- h = (int)(epsPtr->bb.bottom - epsPtr->bb.top);
- if ((w < 1) || (h < 1)) {
- return;
- }
- tkwin = Tk_CanvasTkwin(canvas);
- if (epsPtr->original != NULL) {
- if ((epsPtr->lastWidth != w) || (epsPtr->lastHeight != h)) {
- if (epsPtr->quick) {
- picture = Blt_ScalePicture(epsPtr->original, 0, 0,
- Blt_PictureWidth(epsPtr->original),
- Blt_PictureHeight(epsPtr->original), w, h);
- } else {
- fprintf(stderr, "orig=%dx%d new=width=%dx%d last=%dx%d\n",
- Blt_PictureWidth(epsPtr->original),
- Blt_PictureHeight(epsPtr->original),
- w, h,
- epsPtr->lastWidth, epsPtr->lastHeight);
- picture = Blt_CreatePicture(w, h);
- Blt_ResamplePicture(picture, epsPtr->original, bltBoxFilter,
- bltBoxFilter);
- }
- if (epsPtr->picture != NULL) {
- Blt_FreePicture(epsPtr->picture);
- }
- epsPtr->picture = picture;
- epsPtr->lastHeight = h;
- epsPtr->lastWidth = w;
- }
- }
- picture = epsPtr->picture;
- if (picture == NULL) {
- picture = epsPtr->original;
- }
-
- /*
- * Translate the coordinates to those of the EPS item, then redisplay it.
- */
- Tk_CanvasDrawableCoords(canvas, epsPtr->bb.left, epsPtr->bb.top,
- &dx, &dy);
-
- title = epsPtr->title;
-
- if (epsPtr->reqTitle != NULL) {
- title = epsPtr->reqTitle;
- }
- if ((epsPtr->showImage) && (picture != NULL)) {
- struct region {
- short int left, right, top, bottom;
- } p, r;
- short int destX, destY;
-
- /* The eps item may only partially exposed. Be careful to clip the
- * unexposed portions. */
-
- /* Convert everything to screen coordinates since the origin of the
- * item is only available in */
-
- p.left = dx, p.top = dy;
- Tk_CanvasDrawableCoords(canvas, epsPtr->bb.right, epsPtr->bb.bottom,
- &p.right, &p.bottom);
- Tk_CanvasDrawableCoords(canvas, (double)rx, (double)ry,
- &r.left, &r.top);
- Tk_CanvasDrawableCoords(canvas,(double)(rx+rw), (double)(ry+rh),
- &r.right, &r.bottom);
- destX = (int)dx, destY = (int)dy;
- if (p.left < r.left) {
- p.left = r.left;
- }
- if (p.top < r.top) {
- p.top = r.top;
- }
- if (p.right > r.right) {
- p.right = r.right;
- }
- if (p.bottom > r.bottom) {
- p.bottom = r.bottom;
- }
- if (destX < r.left) {
- destX = r.left;
- }
- if (destY < r.top) {
- destY = r.top;
- }
- p.left -= dx, p.right -= dx;
- p.top -= dy, p.bottom -= dy;;
- if (0 /* epsPtr->quick */) {
- Blt_Picture fade;
-
- fade = Blt_CreatePicture(Blt_PictureWidth(picture),
- Blt_PictureHeight(picture));
- Blt_FadePicture(fade, picture, 0, 0, Blt_PictureWidth(picture),
- Blt_PictureHeight(picture), 0, 0, 150);
- Blt_PaintPicture(epsPtr->painter, drawable, fade,
- (int)p.left, (int)p.top, (int)(p.right - p.left),
- (int)(p.bottom - p.top), destX, destY, FALSE);
- Blt_FreePicture(fade);
- } else {
- Blt_PaintPicture(epsPtr->painter, drawable, picture, (int)p.left,
- (int)p.top, (int)(p.right - p.left), (int)(p.bottom - p.top),
- destX, destY, FALSE);
- }
- } else {
- if (epsPtr->fillGC != NULL) {
- XSetTSOrigin(display, epsPtr->fillGC, dx, dy);
- XFillRectangle(display, drawable, epsPtr->fillGC, dx, dy,
- epsPtr->width, epsPtr->height);
- XSetTSOrigin(display, epsPtr->fillGC, 0, 0);
- }
- }
-
- if (title != NULL) {
- TextLayout *textPtr;
- double rw, rh;
- int dw, dh;
-
- /* Translate the title to an anchor position within the EPS item */
- epsPtr->titleStyle.font = epsPtr->font;
- textPtr = Blt_Ts_CreateLayout(title, -1, &epsPtr->titleStyle);
- Blt_GetBoundingBox(textPtr->width, textPtr->height,
- epsPtr->titleStyle.angle, &rw, &rh, (Point2d *)NULL);
- dw = (int)ceil(rw);
- dh = (int)ceil(rh);
- if ((dw <= w) && (dh <= h)) {
- int tx, ty;
-
- Blt_TranslateAnchor(dx, dy, w, h, epsPtr->titleStyle.anchor,
- &tx, &ty);
- if (picture == NULL) {
- tx += epsPtr->borderWidth;
- ty += epsPtr->borderWidth;
- }
- Blt_Ts_DrawLayout(tkwin, drawable, textPtr, &epsPtr->titleStyle,
- tx, ty);
- }
- Blt_Free(textPtr);
- }
- if ((picture == NULL) && (epsPtr->border != NULL) &&
- (epsPtr->borderWidth > 0)) {
- Blt_Draw3DRectangle(tkwin, drawable, epsPtr->border, dx, dy,
- epsPtr->width, epsPtr->height, epsPtr->borderWidth, epsPtr->relief);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EpsToPoint --
- *
- * Computes the distance from a given point to a given rectangle, in
- * canvas units.
- *
- * Results:
- * The return value is 0 if the point whose x and y coordinates are
- * coordPtr[0] and coordPtr[1] is inside the EPS item. If the point
- * isn't inside the item then the return value is the distance from the
- * point to the EPS item.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static double
-EpsToPoint(
- Tk_Canvas canvas, /* Canvas containing item. */
- Tk_Item *itemPtr, /* Item to check against point. */
- double *pts) /* Array of x and y coordinates. */
-{
- Eps *epsPtr = (Eps *)itemPtr;
- double x, y, dx, dy;
-
- x = pts[0], y = pts[1];
-
- /*
- * Check if point is outside the bounding rectangle and compute the
- * distance to the closest side.
- */
- dx = dy = 0;
- if (x < epsPtr->item.x1) {
- dx = epsPtr->item.x1 - x;
- } else if (x > epsPtr->item.x2) {
- dx = x - epsPtr->item.x2;
- }
- if (y < epsPtr->item.y1) {
- dy = epsPtr->item.y1 - y;
- } else if (y > epsPtr->item.y2) {
- dy = y - epsPtr->item.y2;
- }
- return hypot(dx, dy);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EpsToArea --
- *
- * This procedure is called to determine whether an item lies entirely
- * inside, entirely outside, or overlapping a given rectangle.
- *
- * Results:
- * -1 is returned if the item is entirely outside the area given by
- * rectPtr, 0 if it overlaps, and 1 if it is entirely inside the given
- * area.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EpsToArea(
- Tk_Canvas canvas, /* Canvas containing the item. */
- Tk_Item *itemPtr, /* Item to check against bounding
- * rectangle. */
- double pts[]) /* Array of four coordinates (x1, y1,
- * x2, y2) describing area. */
-{
- Eps *epsPtr = (Eps *)itemPtr;
-
- if ((pts[2] <= epsPtr->bb.left) || (pts[0] >= epsPtr->bb.right) ||
- (pts[3] <= epsPtr->bb.top) || (pts[1] >= epsPtr->bb.bottom)) {
- return -1; /* Outside. */
- }
- if ((pts[0] <= epsPtr->bb.left) && (pts[1] <= epsPtr->bb.top) &&
- (pts[2] >= epsPtr->bb.right) && (pts[3] >= epsPtr->bb.bottom)) {
- return 1; /* Inside. */
- }
- return 0; /* Overlap. */
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScaleEps --
- *
- * This procedure is invoked to rescale an item.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The item referred to by itemPtr is rescaled so that the
- * following transformation is applied to all point coordinates:
- * x' = xOrigin + xScale*(x-xOrigin)
- * y' = yOrigin + yScale*(y-yOrigin)
- *
- *---------------------------------------------------------------------------
- */
-static void
-ScaleEps(
- Tk_Canvas canvas, /* Canvas containing rectangle. */
- Tk_Item *itemPtr, /* Rectangle to be scaled. */
- double xOrigin, double yOrigin, /* Origin wrt scale rect. */
- double xScale, double yScale)
-{
- Eps *epsPtr = (Eps *)itemPtr;
-
- epsPtr->bb.left = xOrigin + xScale * (epsPtr->bb.left - xOrigin);
- epsPtr->bb.right = xOrigin + xScale * (epsPtr->bb.right - xOrigin);
- epsPtr->bb.top = yOrigin + yScale * (epsPtr->bb.top - yOrigin);
- epsPtr->bb.bottom = yOrigin + yScale *(epsPtr->bb.bottom - yOrigin);
-
- /* Reset the user-requested values to the newly scaled values. */
- epsPtr->width = ROUND(epsPtr->bb.right - epsPtr->bb.left);
- epsPtr->height = ROUND(epsPtr->bb.bottom - epsPtr->bb.top);
- epsPtr->x = ROUND(epsPtr->bb.left);
- epsPtr->y = ROUND(epsPtr->bb.top);
-
- epsPtr->item.x1 = ROUND(epsPtr->bb.left);
- epsPtr->item.y1 = ROUND(epsPtr->bb.top);
- epsPtr->item.x2 = ROUND(epsPtr->bb.right);
- epsPtr->item.y2 = ROUND(epsPtr->bb.bottom);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TranslateEps --
- *
- * This procedure is called to move an item by a given amount.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The position of the item is offset by (dx, dy), and the bounding box
- * is updated in the generic part of the item structure.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TranslateEps(
- Tk_Canvas canvas, /* Canvas containing item. */
- Tk_Item *itemPtr, /* Item that is being moved. */
- double dx, double dy) /* Amount by which item is to be
- * moved. */
-{
- Eps *epsPtr = (Eps *)itemPtr;
-
- epsPtr->bb.left += dx;
- epsPtr->bb.right += dx;
- epsPtr->bb.top += dy;
- epsPtr->bb.bottom += dy;
-
- epsPtr->x = epsPtr->bb.left;
- epsPtr->y = epsPtr->bb.top;
-
- epsPtr->item.x1 = ROUND(epsPtr->bb.left);
- epsPtr->item.x2 = ROUND(epsPtr->bb.right);
- epsPtr->item.y1 = ROUND(epsPtr->bb.top);
- epsPtr->item.y2 = ROUND(epsPtr->bb.bottom);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EpsToPostScript --
- *
- * This procedure is called to generate PostScript for EPS canvas items.
- *
- * Results:
- * The return value is a standard TCL result. If an error occurs in
- * generating PostScript then an error message is left in interp->result,
- * replacing whatever used to be there. If no errors occur, then
- * PostScript output for the item is appended to the interpreter result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-EpsToPostScript(
- Tcl_Interp *interp, /* Interpreter to hold generated
- * PostScript or reports errors back
- * to. */
- Tk_Canvas canvas, /* Information about overall
- * canvas. */
- Tk_Item *itemPtr, /* eps item. */
- int prepass) /* If 1, this is a prepass to collect
- * font information; 0 means final *
- * PostScript is being created. */
-{
- Eps *epsPtr = (Eps *)itemPtr;
- Blt_Ps ps;
- double xScale, yScale;
- double x, y, w, h;
- PageSetup setup;
-
- if (prepass) {
- return TCL_OK; /* Don't worry about fonts. */
- }
- memset(&setup, 0, sizeof(setup));
- ps = Blt_Ps_Create(interp, &setup);
-
- /* Lower left corner of item on page. */
- x = epsPtr->bb.left;
- y = Tk_CanvasPsY(canvas, epsPtr->bb.bottom);
- w = epsPtr->bb.right - epsPtr->bb.left;
- h = epsPtr->bb.bottom - epsPtr->bb.top;
-
- if (epsPtr->fileName == NULL) {
- /* No PostScript file, generate PostScript of resized image instead. */
- if (epsPtr->picture != NULL) {
- Blt_Ps_Format(ps, "gsave\n");
- /*
- * First flip the PostScript y-coordinate axis so that the origin
- * is the upper-left corner like our picture.
- */
- Blt_Ps_Format(ps, " %g %g translate\n", x, y + h);
- Blt_Ps_Format(ps, " 1 -1 scale\n");
-
- Blt_Ps_DrawPicture(ps, epsPtr->picture, 0.0, 0.0);
- Blt_Ps_Format(ps, "grestore\n");
-
- Blt_Ps_SetInterp(ps, interp);
- Blt_Ps_Free(ps);
- }
- return TCL_OK;
- }
-
- /* Copy in the PostScript prolog for EPS encapsulation. */
- if (Blt_Ps_IncludeFile(interp, ps, "bltCanvEps.pro") != TCL_OK) {
- goto error;
- }
- Blt_Ps_Append(ps, "BeginEPSF\n");
-
- xScale = w / (double)(epsPtr->urx - epsPtr->llx);
- yScale = h / (double)(epsPtr->ury - epsPtr->lly);
-
- /* Set up scaling and translation transformations for the EPS item */
-
- Blt_Ps_Format(ps, "%g %g translate\n", x, y);
- Blt_Ps_Format(ps, "%g %g scale\n", xScale, yScale);
- Blt_Ps_Format(ps, "%d %d translate\n", -(epsPtr->llx), -(epsPtr->lly));
-
- /* FIXME: Why clip against the old bounding box? */
- Blt_Ps_Format(ps, "%d %d %d %d SetClipRegion\n", epsPtr->llx,
- epsPtr->lly, epsPtr->urx, epsPtr->ury);
-
- Blt_Ps_VarAppend(ps, "%% including \"", epsPtr->fileName, "\"\n\n",
- (char *)NULL);
-
- Blt_Ps_AppendBytes(ps, Tcl_DStringValue(&epsPtr->dString),
- Tcl_DStringLength(&epsPtr->dString));
- Blt_Ps_Append(ps, "EndEPSF\n");
- Blt_Ps_SetInterp(ps, interp);
- Blt_Ps_Free(ps);
- return TCL_OK;
-
- error:
- Blt_Ps_Free(ps);
- return TCL_ERROR;
-}
-
-
-/*
- * The structures below defines the EPS item type in terms of procedures that
- * can be invoked by generic item code.
- */
-static Tk_ItemType itemType = {
- (char *)"eps", /* name */
- sizeof(Eps), /* itemSize */
- CreateEps, /* createProc */
- configSpecs, /* configSpecs */
- ConfigureEps, /* configureProc */
- EpsCoords, /* coordProc */
- DeleteEps, /* deleteProc */
- DisplayEps, /* displayProc */
- 0, /* alwaysRedraw */
- EpsToPoint, /* pointProc */
- EpsToArea, /* areaProc */
- EpsToPostScript, /* postscriptProc */
- ScaleEps, /* scaleProc */
- TranslateEps, /* translateProc */
- (Tk_ItemIndexProc *)NULL, /* indexProc */
- (Tk_ItemCursorProc *)NULL, /* icursorProc */
- (Tk_ItemSelectionProc *)NULL, /* selectionProc */
- (Tk_ItemInsertProc *)NULL, /* insertProc */
- (Tk_ItemDCharsProc *)NULL, /* dTextProc */
- (Tk_ItemType *)NULL /* nextPtr */
-};
-
-/*ARGSUSED*/
-void
-Blt_RegisterEpsCanvasItem(void)
-{
- Tk_CreateItemType(&itemType);
- /* Initialize custom canvas option routines. */
- tagsOption.parseProc = Tk_CanvasTagsParseProc;
- tagsOption.printProc = Tk_CanvasTagsPrintProc;
-}
diff --git a/blt3.0.1/src/bltChain.c b/blt3.0.1/src/bltChain.c
deleted file mode 100644
index b6051b8..0000000
--- a/blt3.0.1/src/bltChain.c
+++ /dev/null
@@ -1,518 +0,0 @@
-
-/*
- * bltChain.c --
- *
- * The module implements a generic linked list package.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltChain.h"
-
-#ifndef ALIGN
-#define ALIGN(a) \
- (((size_t)a + (sizeof(double) - 1)) & (~(sizeof(double) - 1)))
-#endif /* ALIGN */
-
-typedef struct _Blt_ChainLink ChainLink;
-typedef struct _Blt_Chain Chain;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_Create --
- *
- * Creates a new linked list (chain) structure and initializes its
- * pointers;
- *
- * Results:
- * Returns a pointer to the newly created chain structure.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Chain
-Blt_Chain_Create(void)
-{
- Chain *chainPtr;
-
- chainPtr = Blt_Malloc(sizeof(Chain));
- if (chainPtr != NULL) {
- Blt_Chain_Init(chainPtr);
- }
- return chainPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_AllocLink --
- *
- * Creates a new chain link. Unlink Blt_Chain_NewLink, this routine also
- * allocates extra memory in the node for data.
- *
- * Results:
- * The return value is the pointer to the newly created entry.
- *
- *---------------------------------------------------------------------------
- */
-Blt_ChainLink
-Blt_Chain_AllocLink(size_t extraSize)
-{
- ChainLink *linkPtr;
- size_t linkSize;
-
- linkSize = ALIGN(sizeof(ChainLink));
- linkPtr = Blt_AssertCalloc(1, linkSize + extraSize);
- if (extraSize > 0) {
- /* Point clientData at the memory beyond the normal structure. */
- linkPtr->clientData = (ClientData)((char *)linkPtr + linkSize);
- }
- return linkPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_InitLink --
- *
- * Initializes the new link. This routine is for applications that use
- * their own memory allocation procedures to allocate links.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Chain_InitLink(ChainLink *linkPtr)
-{
- linkPtr->clientData = NULL;
- linkPtr->next = linkPtr->prev = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_NewLink --
- *
- * Creates a new link.
- *
- * Results:
- * The return value is the pointer to the newly created link.
- *
- *---------------------------------------------------------------------------
- */
-Blt_ChainLink
-Blt_Chain_NewLink(void)
-{
- ChainLink *linkPtr;
-
- linkPtr = Blt_AssertMalloc(sizeof(ChainLink));
- linkPtr->clientData = NULL;
- linkPtr->next = linkPtr->prev = NULL;
- return linkPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_Reset --
- *
- * Removes all the links in the chain, freeing the memory used for each
- * link. Memory pointed to by the link (clientData) is not freed. It's
- * the caller's responsibility to deallocate it.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Chain_Reset(Chain *chainPtr) /* Chain to clear */
-{
- if (chainPtr != NULL) {
- ChainLink *oldPtr;
- ChainLink *linkPtr = chainPtr->head;
-
- while (linkPtr != NULL) {
- oldPtr = linkPtr;
- linkPtr = linkPtr->next;
- Blt_Free(oldPtr);
- }
- Blt_Chain_Init(chainPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_Destroy
- *
- * Frees all the nodes in the chain and deallocates the memory used for
- * the chain structure itself. It's assumed that the chain was previously
- * allocated by Blt_Chain_Create.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Chain_Destroy(Chain *chainPtr)
-{
- if (chainPtr != NULL) {
- Blt_Chain_Reset(chainPtr);
- Blt_Free(chainPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_Init --
- *
- * Initializes a linked list.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Chain_Init(Chain *chainPtr)
-{
- chainPtr->nLinks = 0;
- chainPtr->head = chainPtr->tail = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_LinkAfter --
- *
- * Inserts a link after another link. If afterPtr is NULL, then the new
- * link is prepended to the beginning of the chain.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Chain_LinkAfter(Chain *chainPtr, ChainLink *linkPtr, ChainLink *afterPtr)
-{
- if (chainPtr->head == NULL) {
- chainPtr->tail = chainPtr->head = linkPtr;
- } else {
- if (afterPtr == NULL) {
- /* Append to the end of the chain. */
- linkPtr->next = NULL;
- linkPtr->prev = chainPtr->tail;
- chainPtr->tail->next = linkPtr;
- chainPtr->tail = linkPtr;
- } else {
- linkPtr->next = afterPtr->next;
- linkPtr->prev = afterPtr;
- if (afterPtr == chainPtr->tail) {
- chainPtr->tail = linkPtr;
- } else {
- afterPtr->next->prev = linkPtr;
- }
- afterPtr->next = linkPtr;
- }
- }
- chainPtr->nLinks++;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_LinkBefore --
- *
- * Inserts a new link preceding a given link in a chain. If beforePtr is
- * NULL, then the new link is placed at the beginning of the list.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Chain_LinkBefore(Chain *chainPtr, ChainLink *linkPtr, ChainLink *beforePtr)
-{
- if (chainPtr->head == NULL) {
- chainPtr->tail = chainPtr->head = linkPtr;
- } else {
- if (beforePtr == NULL) {
- /* Prepend to the front of the chain */
- linkPtr->next = chainPtr->head;
- linkPtr->prev = NULL;
- chainPtr->head->prev = linkPtr;
- chainPtr->head = linkPtr;
- } else {
- linkPtr->prev = beforePtr->prev;
- linkPtr->next = beforePtr;
- if (beforePtr == chainPtr->head) {
- chainPtr->head = linkPtr;
- } else {
- beforePtr->prev->next = linkPtr;
- }
- beforePtr->prev = linkPtr;
- }
- }
- chainPtr->nLinks++;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_UnlinkLink --
- *
- * Unlinks a link from the chain. The link is not deallocated, but only
- * removed from the chain.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Chain_UnlinkLink(Chain *chainPtr, ChainLink *linkPtr)
-{
- int unlinked; /* Indicates if the link is actually removed
- * from the chain. */
-
- unlinked = FALSE;
- if (chainPtr->head == linkPtr) {
- chainPtr->head = linkPtr->next;
- unlinked = TRUE;
- }
- if (chainPtr->tail == linkPtr) {
- chainPtr->tail = linkPtr->prev;
- unlinked = TRUE;
- }
- if (linkPtr->next != NULL) {
- linkPtr->next->prev = linkPtr->prev;
- unlinked = TRUE;
- }
- if (linkPtr->prev != NULL) {
- linkPtr->prev->next = linkPtr->next;
- unlinked = TRUE;
- }
- if (unlinked) {
- chainPtr->nLinks--;
- }
- linkPtr->prev = linkPtr->next = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_DeleteLink --
- *
- * Unlinks and frees the given link from the chain. It's assumed that
- * the link belong to the chain. No error checking is performed to verify
- * this.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Chain_DeleteLink(Blt_Chain chain, Blt_ChainLink link)
-{
- Blt_Chain_UnlinkLink(chain, link);
- Blt_Free(link);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_Append
- *
- * Creates and new link with the given data and appends it to the end of
- * the chain.
- *
- * Results:
- * Returns a pointer to the link created.
- *
- *---------------------------------------------------------------------------
- */
-Blt_ChainLink
-Blt_Chain_Append(Blt_Chain chain, ClientData clientData)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_NewLink();
- Blt_Chain_LinkAfter(chain, link, (Blt_ChainLink)NULL);
- Blt_Chain_SetValue(link, clientData);
- return link;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_Prepend
- *
- * Creates and new link with the given data and prepends it to beginning
- * of the chain.
- *
- * Results:
- * Returns a pointer to the link created.
- *
- *---------------------------------------------------------------------------
- */
-Blt_ChainLink
-Blt_Chain_Prepend(Blt_Chain chain, ClientData clientData)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_NewLink();
- Blt_Chain_LinkBefore(chain, link, (Blt_ChainLink)NULL);
- Blt_Chain_SetValue(link, clientData);
- return link;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_GetNthLink --
- *
- * Find the link at the given position in the chain. The position
- * is number from 0. If position is negative is returns the nth
- * link from the back of the chain.
- *
- * Results:
- * Returns the pointer to the link, if that numbered link
- * exists. Otherwise NULL.
- *
- *---------------------------------------------------------------------------
- */
-Blt_ChainLink
-Blt_Chain_GetNthLink(Chain *chainPtr, long position)
-{
- if (chainPtr != NULL) {
- if (position < 0) {
- ChainLink *linkPtr;
- int i;
-
- position = -position;
- for (i = 0, linkPtr = chainPtr->tail; linkPtr != NULL;
- linkPtr = linkPtr->prev, i++) {
- if (i == position) {
- return linkPtr;
- }
- }
- } else {
- ChainLink *linkPtr;
- int i;
-
- linkPtr = chainPtr->head;
- for (i = 0, linkPtr = chainPtr->head; linkPtr != NULL;
- linkPtr = linkPtr->next, i++) {
- if (i == position) {
- return linkPtr;
- }
- }
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_Sort --
- *
- * Sorts the chain according to the given comparison routine.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The chain is reordered.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Chain_Sort(Chain *chainPtr, Blt_ChainCompareProc *proc)
-{
- ChainLink **linkArr;
- ChainLink *linkPtr;
- long i;
-
- if (chainPtr->nLinks < 2) {
- return;
- }
- linkArr = Blt_Malloc(sizeof(Blt_ChainLink) * (chainPtr->nLinks + 1));
- if (linkArr == NULL) {
- return; /* Out of memory. */
- }
- i = 0;
- for (linkPtr = chainPtr->head; linkPtr != NULL;
- linkPtr = linkPtr->next) {
- linkArr[i++] = linkPtr;
- }
- qsort((char *)linkArr, chainPtr->nLinks, sizeof(Blt_ChainLink),
- (QSortCompareProc *)proc);
-
- /* Rethread the chain. */
- linkPtr = linkArr[0];
- chainPtr->head = linkPtr;
- linkPtr->prev = NULL;
- for (i = 1; i < chainPtr->nLinks; i++) {
- linkPtr->next = linkArr[i];
- linkPtr->next->prev = linkPtr;
- linkPtr = linkPtr->next;
- }
- chainPtr->tail = linkPtr;
- linkPtr->next = NULL;
- Blt_Free(linkArr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Chain_IsBefore --
- *
- *
- * Results:
- * Return boolean value if the first link comes before the second.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Chain_IsBefore(ChainLink *firstPtr, ChainLink *lastPtr)
-{
- ChainLink *linkPtr;
-
- for (linkPtr = firstPtr; linkPtr != NULL; linkPtr = linkPtr->next) {
- if (linkPtr == lastPtr) {
- return TRUE;
- }
- }
- return FALSE;
-}
-
diff --git a/blt3.0.1/src/bltChain.h b/blt3.0.1/src/bltChain.h
deleted file mode 100644
index e0b0259..0000000
--- a/blt3.0.1/src/bltChain.h
+++ /dev/null
@@ -1,90 +0,0 @@
-
-/*
- * bltChain.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#ifndef _BLT_CHAIN_H
-#define _BLT_CHAIN_H
-
-typedef struct _Blt_Chain *Blt_Chain;
-typedef struct _Blt_ChainLink *Blt_ChainLink;
-
-/*
- * A Blt_ChainLink is the container structure for the Blt_Chain.
- */
-
-struct _Blt_ChainLink {
- Blt_ChainLink prev; /* Link to the previous link */
- Blt_ChainLink next; /* Link to the next link */
- ClientData clientData; /* Pointer to the data object */
-};
-
-typedef int (Blt_ChainCompareProc)(Blt_ChainLink *l1Ptr, Blt_ChainLink *l2Ptr);
-
-/*
- * A Blt_Chain is a doubly chained list structure.
- */
-struct _Blt_Chain {
- Blt_ChainLink head; /* Pointer to first element in chain */
- Blt_ChainLink tail; /* Pointer to last element in chain */
- long nLinks; /* Number of elements in chain */
-};
-
-BLT_EXTERN void Blt_Chain_Init(Blt_Chain chain);
-BLT_EXTERN Blt_Chain Blt_Chain_Create(void);
-BLT_EXTERN void Blt_Chain_Destroy(Blt_Chain chain);
-BLT_EXTERN Blt_ChainLink Blt_Chain_NewLink(void);
-BLT_EXTERN Blt_ChainLink Blt_Chain_AllocLink(size_t size);
-BLT_EXTERN Blt_ChainLink Blt_Chain_Append(Blt_Chain chain,
- ClientData clientData);
-BLT_EXTERN Blt_ChainLink Blt_Chain_Prepend(Blt_Chain chain,
- ClientData clientData);
-BLT_EXTERN void Blt_Chain_Reset(Blt_Chain chain);
-BLT_EXTERN void Blt_Chain_InitLink(Blt_ChainLink link);
-BLT_EXTERN void Blt_Chain_LinkAfter(Blt_Chain chain, Blt_ChainLink link,
- Blt_ChainLink after);
-BLT_EXTERN void Blt_Chain_LinkBefore(Blt_Chain chain, Blt_ChainLink link,
- Blt_ChainLink before);
-BLT_EXTERN void Blt_Chain_UnlinkLink(Blt_Chain chain, Blt_ChainLink link);
-BLT_EXTERN void Blt_Chain_DeleteLink(Blt_Chain chain, Blt_ChainLink link);
-BLT_EXTERN Blt_ChainLink Blt_Chain_GetNthLink(Blt_Chain chain, long position);
-BLT_EXTERN void Blt_Chain_Sort(Blt_Chain chain, Blt_ChainCompareProc *proc);
-BLT_EXTERN int Blt_Chain_IsBefore(Blt_ChainLink first, Blt_ChainLink last);
-
-#define Blt_Chain_GetLength(c) (((c) == NULL) ? 0 : (c)->nLinks)
-#define Blt_Chain_FirstLink(c) (((c) == NULL) ? NULL : (c)->head)
-#define Blt_Chain_LastLink(c) (((c) == NULL) ? NULL : (c)->tail)
-#define Blt_Chain_PrevLink(l) ((l)->prev)
-#define Blt_Chain_NextLink(l) ((l)->next)
-#define Blt_Chain_GetValue(l) ((l)->clientData)
-#define Blt_Chain_FirstValue(c) (((c)->head == NULL) ? NULL : (c)->head->clientData)
-#define Blt_Chain_SetValue(l, value) ((l)->clientData = (ClientData)(value))
-#define Blt_Chain_AppendLink(c, l) \
- (Blt_Chain_LinkAfter((c), (l), (Blt_ChainLink)NULL))
-#define Blt_Chain_PrependLink(c, l) \
- (Blt_Chain_LinkBefore((c), (l), (Blt_ChainLink)NULL))
-
-#endif /* _BLT_CHAIN_H */
diff --git a/blt3.0.1/src/bltComboBtn.c b/blt3.0.1/src/bltComboBtn.c
deleted file mode 100644
index a0dbdd0..0000000
--- a/blt3.0.1/src/bltComboBtn.c
+++ /dev/null
@@ -1,2049 +0,0 @@
-
-/*
- * bltComboButton.c --
- *
- * This module implements a combo button widget for the BLT toolkit.
- *
- * Copyright 2006 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include "bltFont.h"
-#include "bltText.h"
-#include "bltChain.h"
-#include "bltImage.h"
-#include "bltHash.h"
-#include "bltBgStyle.h"
-
-#define IPAD 2 /* Internal pad between components. */
-#define YPAD 2 /* External pad between components. */
-#define XPAD 2 /* External pad between border and
- * button. */
-#define ARROW_WIDTH 13
-#define ARROW_HEIGHT 13
-
-#define STATE_NORMAL (0) /* Draw widget normally. */
-#define STATE_ACTIVE (1<<0) /* Widget is currently active. */
-#define STATE_DISABLED (1<<1) /* Widget is disabled. */
-#define STATE_POSTED (1<<2) /* Widget is currently posting its
- * menu. */
-#define STATE_MASK (STATE_ACTIVE|STATE_DISABLED|STATE_POSTED)
-#define REDRAW_PENDING (1<<3) /* Widget is scheduled to be
- * redrawn. */
-#define LAYOUT_PENDING (1<<4) /* Widget layout needs to be
- * recomputed. */
-#define FOCUS (1<<5) /* Widget has focus. */
-
-#define ARROW (1<<8)
-#define TEXT_VAR_TRACED (1<<16)
-#define ICON_VAR_TRACED (1<<17)
-
-
-#define TRACE_VAR_FLAGS (TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|\
- TCL_TRACE_UNSETS)
-
-#define DEF_ACTIVEBACKGROUND STD_ACTIVE_BACKGROUND
-#define DEF_ACTIVEFOREGROUND STD_ACTIVE_FOREGROUND
-#define DEF_BORDERWIDTH "2"
-#define DEF_CMD ((char *)NULL)
-#define DEF_CURSOR ((char *)NULL)
-#define DEF_DIRECTION ((char *)NULL)
-#define DEF_DISABLED_BG STD_DISABLED_BACKGROUND
-#define DEF_DISABLED_FG STD_DISABLED_FOREGROUND
-#define DEF_ENTRY_BG RGB_GREY90
-#define DEF_FONT STD_FONT
-#define DEF_HEIGHT "0"
-#define DEF_HIGHLIGHTBACKGROUND ""
-#define DEF_HIGHLIGHTCOLOR "black"
-#define DEF_HIGHLIGHTTHICKNESS "2"
-#define DEF_ICON ((char *)NULL)
-#define DEF_ICON_VARIABLE ((char *)NULL)
-#define DEF_IMAGE ((char *)NULL)
-#define DEF_ARROW_ON "0"
-#define DEF_ARROW_WIDTH "0"
-#define DEF_INDICTOR_ACTIVE_FG STD_ACTIVE_FOREGROUND
-#define DEF_ARROW_BORDERWIDTH "2"
-#define DEF_ARROW_DISABLED_FG STD_DISABLED_FOREGROUND
-#define DEF_ARROW_POSTED_FG STD_DISABLED_FOREGROUND
-#define DEF_ARROW_NORMAL_FG STD_NORMAL_FOREGROUND
-#define DEF_ARROW_RELIEF "flat"
-#define DEF_JUSTIFY "left"
-#define DEF_MENU ((char *)NULL)
-#define DEF_MENU_ANCHOR "sw"
-#define DEF_NORMAL_BG STD_NORMAL_BACKGROUND
-#define DEF_NORMAL_FG STD_NORMAL_FOREGROUND
-#define DEF_POSTED_BG RGB_SKYBLUE4
-#define DEF_POSTED_FG RGB_WHITE
-#define DEF_NORMAL_RELIEF "raised"
-#define DEF_POSTED_RELIEF "flat"
-#define DEF_ACTIVERELIEF "raised"
-#define DEF_STATE "normal"
-#define DEF_TAKE_FOCUS "1"
-#define DEF_TEXT ((char *)NULL)
-#define DEF_TEXT_VARIABLE ((char *)NULL)
-#define DEF_TYPE "button"
-#define DEF_UNDERLINE "-1"
-#define DEF_WIDTH "0"
-
-static Tcl_VarTraceProc TextVarTraceProc;
-static Tcl_VarTraceProc IconVarTraceProc;
-
-static Blt_OptionFreeProc FreeTextProc;
-static Blt_OptionParseProc ObjToTextProc;
-static Blt_OptionPrintProc TextToObjProc;
-static Blt_CustomOption textOption = {
- ObjToTextProc, TextToObjProc, FreeTextProc, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeIconProc;
-static Blt_OptionParseProc ObjToIconProc;
-static Blt_OptionPrintProc IconToObjProc;
-static Blt_CustomOption iconOption = {
- ObjToIconProc, IconToObjProc, FreeIconProc, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeTextVarProc;
-static Blt_OptionParseProc ObjToTextVarProc;
-static Blt_OptionPrintProc TextVarToObjProc;
-static Blt_CustomOption textVarOption = {
- ObjToTextVarProc, TextVarToObjProc, FreeTextVarProc, (ClientData)0
-};
-static Blt_OptionFreeProc FreeIconVarProc;
-static Blt_OptionParseProc ObjToIconVarProc;
-static Blt_OptionPrintProc IconVarToObjProc;
-static Blt_CustomOption iconVarOption = {
- ObjToIconVarProc, IconVarToObjProc, FreeIconVarProc, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToStateProc;
-static Blt_OptionPrintProc StateToObjProc;
-static Blt_CustomOption stateOption = {
- ObjToStateProc, StateToObjProc, NULL, (ClientData)0
-};
-
-static const char *emptyString = "";
-
-/*
- * Icon --
- *
- * Since instances of the same Tk image can be displayed in different
- * windows with possibly different color palettes, Tk internally stores
- * each instance in a linked list. But if the instances are used in the
- * same widget and therefore use the same color palette, this adds a lot
- * of overhead, especially when deleting instances from the linked list.
- *
- * For the combobutton widget, we never need more than a single instance
- * of an image, regardless of how many times it's used. Cache the image,
- * maintaining a reference count for each image used in the widget. It's
- * likely that the comboview widget will use many instances of the same
- * image.
- */
-
-typedef struct Icon {
- Tk_Image tkImage; /* The Tk image being cached. */
- short int width, height; /* Dimensions of the cached image. */
-} *Icon;
-
-#define IconHeight(i) ((i)->height)
-#define IconWidth(i) ((i)->width)
-#define IconImage(i) ((i)->tkImage)
-#define IconName(i) (Blt_Image_Name((i)->tkImage))
-
-typedef struct {
- Tcl_Interp *interp; /* Interpreter associated with
- * button. */
- Tk_Window tkwin; /* Window that embodies the combo
- * button. If NULL, indicates the
- * window has been destroyed but the
- * data structures haven't yet been
- * cleaned up.*/
- Display *display; /* Display containing widget. Used,
- * among other things, so that
- * resources can be freed even after
- * tkwin has gone away. */
- Tcl_Command cmdToken; /* Token for widget command. */
- int reqWidth, reqHeight;
- int relief, postedRelief, activeRelief;
- int borderWidth;
- Blt_Background normalBg;
- Blt_Background activeBg;
- Blt_Background postedBg;
- Blt_Background disabledBg;
- Tcl_Obj *takeFocusObjPtr; /* Value of -takefocus option; not
- * used in the C code, but used by
- * keyboard traversal scripts. */
-
- /*
- * In/Out Focus Highlight Ring:
- */
- XColor *highlightColor;
- GC highlightGC;
- XColor *highlightBgColor;
- GC highlightBgGC;
- int highlightWidth;
-
- /*
- * The button contains an optional icon and text string.
- */
- Icon icon; /* If non-NULL, image to be displayed
- * in button. Its value may be
- * overridden by the -iconvariable
- * option. */
-
- Tcl_Obj *iconVarObjPtr; /* Name of TCL variable. If non-NULL,
- * this variable contains the name of
- * an image representing the icon.
- * This overrides the value of the
- * above field. */
- Icon image; /* If non-NULL, image to be displayed
- * instead of text in the button. */
- const char *text; /* Text string to be displayed in the
- * button if an image has no been
- * designated. Its value is overridden
- * by the -textvariable option. */
- Tcl_Obj *textVarObjPtr; /* Name of TCL variable. If non-NULL,
- * this variable contains the text
- * string to be displayed in the
- * button. This overrides the above
- * field. */
- Blt_Font font; /* Font of text to be display in
- * button. */
- Tk_Justify justify; /* Justification to use for text
- * within the button. */
- int textLen; /* # bytes of text. */
- int underline; /* Character index of character to be
- * underlined. If -1, no character is
- * underlined. */
- XColor *textNormalColor;
- XColor *textActiveColor;
- XColor *textPostedColor;
- XColor *textDisabledColor;
-
- /*
- * Arrow (button) Information:
- *
- * The arrow is a button with an optional 3D border.
- */
- int arrowBW;
- int arrowPad;
- int arrowRelief;
- int reqArrowWidth;
-
- Tk_Cursor cursor; /* Current cursor or * None. */
- int prefWidth; /* Desired width of window, measured
- * in average characters. */
- int inset;
- short int arrowWidth, arrowHeight;
- short int iconWidth, iconHeight;
- short int entryWidth, entryHeight;
- short int textWidth, textHeight;
- short int width, height;
- Tcl_Obj *cmdObjPtr; /* If non-NULL, command to be executed
- * when this menu is posted. */
- Tcl_Obj *menuObjPtr;
- Tcl_Obj *postCmdObjPtr; /* If non-NULL, command to be executed
- * when this menu is posted. */
- int menuAnchor;
- unsigned int flags;
-} ComboButton;
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_ACTIVEBACKGROUND,
- Blt_Offset(ComboButton, activeBg),0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "ActiveForeground", DEF_ACTIVEFOREGROUND,
- Blt_Offset(ComboButton, textActiveColor), 0},
- {BLT_CONFIG_RELIEF, "-activerelief", "activeRelief", "Relief",
- DEF_ACTIVERELIEF, Blt_Offset(ComboButton, activeRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-arrowon", "arrowOn", "ArrowOn",
- DEF_ARROW_ON, Blt_Offset(ComboButton, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)ARROW},
- {BLT_CONFIG_PIXELS_NNEG, "-arrowborderwidth", "arrowBorderWidth",
- "ArrowBorderWidth", DEF_ARROW_BORDERWIDTH,
- Blt_Offset(ComboButton, arrowBW), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-arrowrelief", "arrowRelief","ArrowRelief",
- DEF_ARROW_RELIEF, Blt_Offset(ComboButton, arrowRelief), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-arrowwidth", "arrowWidth","ArrowWidth",
- DEF_ARROW_WIDTH, Blt_Offset(ComboButton, reqArrowWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_NORMAL_BG, Blt_Offset(ComboButton, normalBg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_BORDERWIDTH, Blt_Offset(ComboButton, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-command", "command", "Command",
- DEF_CMD, Blt_Offset(ComboButton, cmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_CURSOR, Blt_Offset(ComboButton, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BACKGROUND, "-disabledbackground", "disabledBackground",
- "DisabledBackground", DEF_DISABLED_BG,
- Blt_Offset(ComboButton, disabledBg), 0},
- {BLT_CONFIG_COLOR, "-disabledforeground", "disabledForeground",
- "DisabledForeground", DEF_DISABLED_FG,
- Blt_Offset(ComboButton, textDisabledColor), 0},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_FONT,
- Blt_Offset(ComboButton, font), 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_NORMAL_FG, Blt_Offset(ComboButton, textNormalColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-height", "height", "Height", DEF_HEIGHT,
- Blt_Offset(ComboButton, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_HIGHLIGHTBACKGROUND,
- Blt_Offset(ComboButton, highlightBgColor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_HIGHLIGHTCOLOR, Blt_Offset(ComboButton, highlightColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_HIGHLIGHTTHICKNESS,
- Blt_Offset(ComboButton, highlightWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-icon", "icon", "Icon", DEF_ICON,
- Blt_Offset(ComboButton, icon), BLT_CONFIG_NULL_OK, &iconOption},
- {BLT_CONFIG_CUSTOM, "-iconvariable", "iconVariable", "IconVariable",
- DEF_TEXT_VARIABLE, Blt_Offset(ComboButton, iconVarObjPtr),
- BLT_CONFIG_NULL_OK, &iconVarOption},
- {BLT_CONFIG_CUSTOM, "-image", "image", "Image", DEF_IMAGE,
- Blt_Offset(ComboButton, image), BLT_CONFIG_NULL_OK, &iconOption},
- {BLT_CONFIG_JUSTIFY, "-justify", "justify", "Justify", DEF_JUSTIFY,
- Blt_Offset(ComboButton, justify), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-menu", "menu", "Menu", DEF_MENU,
- Blt_Offset(ComboButton, menuObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ANCHOR, "-menuanchor", "menuAnchor", "MenuAnchor",
- DEF_MENU_ANCHOR, Blt_Offset(ComboButton, menuAnchor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-postcommand", "postCommand", "PostCommand",
- DEF_CMD, Blt_Offset(ComboButton, postCmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BACKGROUND, "-postedbackground", "postedBackground",
- "PostedBackground", DEF_POSTED_BG, Blt_Offset(ComboButton, postedBg),0},
- {BLT_CONFIG_COLOR, "-postedforeground", "postedForeground",
- "PostedForeground", DEF_POSTED_FG,
- Blt_Offset(ComboButton, textPostedColor), 0},
- {BLT_CONFIG_RELIEF, "-postedrelief", "postedRelief", "PostedRelief",
- DEF_POSTED_RELIEF, Blt_Offset(ComboButton, postedRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_NORMAL_RELIEF,
- Blt_Offset(ComboButton, relief), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-state", "state", "State", DEF_STATE,
- Blt_Offset(ComboButton, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- &stateOption},
- {BLT_CONFIG_OBJ, "-takefocus", "takeFocus", "TakeFocus", DEF_TAKE_FOCUS,
- Blt_Offset(ComboButton, takeFocusObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-text", "text", "Text", DEF_TEXT,
- Blt_Offset(ComboButton, text), 0, &textOption},
- {BLT_CONFIG_CUSTOM, "-textvariable", "textVariable", "TextVariable",
- DEF_TEXT_VARIABLE, Blt_Offset(ComboButton, textVarObjPtr),
- BLT_CONFIG_NULL_OK, &textVarOption},
- {BLT_CONFIG_INT, "-underline", "underline", "Underline", DEF_UNDERLINE,
- Blt_Offset(ComboButton, underline), BLT_CONFIG_DONT_SET_DEFAULT },
- {BLT_CONFIG_PIXELS_NNEG, "-width", "width", "Width", DEF_WIDTH,
- Blt_Offset(ComboButton, reqWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-static Tcl_IdleProc DisplayComboButton;
-static Tcl_FreeProc DestroyComboButton;
-static Tk_EventProc ComboButtonEventProc;
-static Tcl_ObjCmdProc ComboButtonInstCmdProc;
-static Tcl_CmdDeleteProc ComboButtonInstCmdDeletedProc;
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Tells the Tk dispatcher to call the combobutton display routine at the
- * next idle point. This request is made only if the window is displayed
- * and no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(ComboButton *comboPtr)
-{
- if ((comboPtr->tkwin != NULL) && ((comboPtr->flags & REDRAW_PENDING) == 0)){
- comboPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayComboButton, comboPtr);
- }
-}
-
-static int
-UpdateTextVar(Tcl_Interp *interp, ComboButton *comboPtr)
-{
- Tcl_Obj *resultObjPtr, *objPtr;
-
- objPtr = Tcl_NewStringObj(comboPtr->text, comboPtr->textLen);
- Tcl_IncrRefCount(objPtr);
- resultObjPtr = Tcl_ObjSetVar2(interp, comboPtr->textVarObjPtr, NULL,
- objPtr, TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG);
- Tcl_DecrRefCount(objPtr);
- if (resultObjPtr == NULL) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-UpdateIconVar(Tcl_Interp *interp, ComboButton *comboPtr)
-{
- Tcl_Obj *resultObjPtr, *objPtr;
-
- if (comboPtr->icon != NULL) {
- objPtr = Tcl_NewStringObj(IconName(comboPtr->icon), -1);
- } else {
- objPtr = Tcl_NewStringObj("", -1);
- }
- Tcl_IncrRefCount(objPtr);
- resultObjPtr = Tcl_ObjSetVar2(interp, comboPtr->iconVarObjPtr, NULL,
- objPtr, TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG);
- Tcl_DecrRefCount(objPtr);
- if (resultObjPtr == NULL) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static void
-FreeIcon(ComboButton *comboPtr, Icon icon)
-{
- Tk_FreeImage(IconImage(icon));
- Blt_Free(icon);
-}
-
-static char *
-GetInterpResult(Tcl_Interp *interp)
-{
-#define MAX_ERR_MSG 1023
- static char mesg[MAX_ERR_MSG+1];
-
- strncpy(mesg, Tcl_GetStringResult(interp), MAX_ERR_MSG);
- mesg[MAX_ERR_MSG] = '\0';
- return mesg;
-}
-
-static void
-SetTextFromObj(ComboButton *comboPtr, Tcl_Obj *objPtr)
-{
- int nBytes;
- const char *string;
-
- if (comboPtr->text != emptyString) {
- Blt_Free(comboPtr->text);
- }
- string = Tcl_GetStringFromObj(objPtr, &nBytes);
- comboPtr->text = Blt_AssertMalloc(nBytes + 1);
- strcpy((char *)comboPtr->text, string);
- comboPtr->textLen = nBytes;
- comboPtr->flags |= LAYOUT_PENDING;
- comboPtr->underline = -1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconChangedProc
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-IconChangedProc(
- ClientData clientData,
- int x, int y, int w, int h, /* Not used. */
- int imageWidth, int imageHeight) /* Not used. */
-{
- ComboButton *comboPtr = clientData;
-
- comboPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(comboPtr);
-}
-
-static int
-GetIconFromObj(
- Tcl_Interp *interp,
- ComboButton *comboPtr,
- Tcl_Obj *objPtr,
- Icon *iconPtr)
-{
- Tk_Image tkImage;
- const char *iconName;
-
- iconName = Tcl_GetString(objPtr);
- if (iconName[0] == '\0') {
- *iconPtr = NULL;
- return TCL_OK;
- }
- tkImage = Tk_GetImage(interp, comboPtr->tkwin, iconName, IconChangedProc,
- comboPtr);
- if (tkImage != NULL) {
- struct Icon *ip;
- int width, height;
-
- ip = Blt_AssertMalloc(sizeof(struct Icon));
- Tk_SizeOfImage(tkImage, &width, &height);
- ip->tkImage = tkImage;
- ip->width = width;
- ip->height = height;
- *iconPtr = ip;
- return TCL_OK;
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboButtonEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * combobutton widgets.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComboButtonEventProc(ClientData clientData, XEvent *eventPtr)
-{
- ComboButton *comboPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(comboPtr);
- }
- } else if (eventPtr->type == ConfigureNotify) {
- EventuallyRedraw(comboPtr);
- } else if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
- if (eventPtr->xfocus.detail == NotifyInferior) {
- return;
- }
- if (eventPtr->type == FocusIn) {
- comboPtr->flags |= FOCUS;
- } else {
- comboPtr->flags &= ~FOCUS;
- }
- EventuallyRedraw(comboPtr);
- } else if (eventPtr->type == DestroyNotify) {
- if (comboPtr->tkwin != NULL) {
- comboPtr->tkwin = NULL;
- }
- if (comboPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayComboButton, comboPtr);
- }
- Tcl_EventuallyFree(comboPtr, DestroyComboButton);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextVarTraceProc --
- *
- * This procedure is invoked when someone changes the state variable
- * associated with a combobutton.
- *
- * Results:
- * NULL is always returned.
- *
- *---------------------------------------------------------------------------
- */
-static char *
-TextVarTraceProc(
- ClientData clientData, /* Information about the item. */
- Tcl_Interp *interp, /* Interpreter containing variable. */
- const char *name1, /* First part of variable's name. */
- const char *name2, /* Second part of variable's name. */
- int flags) /* Describes what just happened. */
-{
- ComboButton *comboPtr = clientData;
-
- assert(comboPtr->textVarObjPtr != NULL);
- if (flags & TCL_INTERP_DESTROYED) {
- return NULL; /* Interpreter is going away. */
-
- }
- /*
- * If the variable is being unset, then re-establish the trace.
- */
- if (flags & TCL_TRACE_UNSETS) {
- if (flags & TCL_TRACE_DESTROYED) {
- Tcl_SetVar(interp, name1, comboPtr->text, TCL_GLOBAL_ONLY);
- Tcl_TraceVar(interp, name1, TRACE_VAR_FLAGS, TextVarTraceProc,
- clientData);
- comboPtr->flags |= TEXT_VAR_TRACED;
- }
- return NULL;
- }
- if (flags & TCL_TRACE_WRITES) {
- Tcl_Obj *valueObjPtr;
-
- /*
- * Update the combobutton's text with the value of the variable,
- * unless the widget already has that value (this happens when the
- * variable changes value because we changed it because someone typed
- * in the entry).
- */
- valueObjPtr = Tcl_ObjGetVar2(interp, comboPtr->textVarObjPtr, NULL,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG);
- if (valueObjPtr == NULL) {
- return GetInterpResult(interp);
- } else {
- SetTextFromObj(comboPtr, valueObjPtr);
- }
- EventuallyRedraw(comboPtr);
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconVarTraceProc --
- *
- * This procedure is invoked when someone changes the state
- * variable associated with combobutton.
- *
- * Results:
- * NULL is always returned.
- *
- *---------------------------------------------------------------------------
- */
-static char *
-IconVarTraceProc(
- ClientData clientData, /* Information about the item. */
- Tcl_Interp *interp, /* Interpreter containing variable. */
- const char *name1, /* First part of variable's name. */
- const char *name2, /* Second part of variable's name. */
- int flags) /* Describes what just happened. */
-{
- ComboButton *comboPtr = clientData;
-
- assert(comboPtr->iconVarObjPtr != NULL);
- if (flags & TCL_INTERP_DESTROYED) {
- return NULL; /* Interpreter is going away. */
-
- }
- /*
- * If the variable is being unset, then re-establish the trace.
- */
- if (flags & TCL_TRACE_UNSETS) {
- if (flags & TCL_TRACE_DESTROYED) {
- Tcl_SetVar(interp, name1, IconName(comboPtr->icon),TCL_GLOBAL_ONLY);
- Tcl_TraceVar(interp, name1, TRACE_VAR_FLAGS, IconVarTraceProc,
- clientData);
- comboPtr->flags |= ICON_VAR_TRACED;
- }
- return NULL;
- }
- if (flags & TCL_TRACE_WRITES) {
- Icon icon;
- Tcl_Obj *valueObjPtr;
-
- /*
- * Update the combobutton's icon with the image whose name is
- * stored in the variable.
- */
- valueObjPtr = Tcl_ObjGetVar2(interp, comboPtr->iconVarObjPtr, NULL,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG);
- if (valueObjPtr == NULL) {
- return GetInterpResult(interp);
- }
- if (GetIconFromObj(interp, comboPtr, valueObjPtr, &icon) != TCL_OK) {
- return GetInterpResult(interp);
- }
- if (comboPtr->icon != NULL) {
- FreeIcon(comboPtr, comboPtr->icon);
- }
- comboPtr->icon = icon;
- comboPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(comboPtr);
- }
- return NULL;
-}
-
-/*ARGSUSED*/
-static void
-FreeIconVarProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Tcl_Obj **objPtrPtr = (Tcl_Obj **)(widgRec + offset);
-
- if (*objPtrPtr != NULL) {
- ComboButton *comboPtr = (ComboButton *)widgRec;
-
- Tcl_UntraceVar(comboPtr->interp, Tcl_GetString(*objPtrPtr),
- TRACE_VAR_FLAGS, IconVarTraceProc, comboPtr);
- Tcl_DecrRefCount(*objPtrPtr);
- *objPtrPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToIconVarProc --
- *
- * Convert the variable to a traced variable.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToIconVarProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboButton *comboPtr = (ComboButton *)(widgRec);
- Tcl_Obj **objPtrPtr = (Tcl_Obj **)(widgRec + offset);
- char *varName;
- Tcl_Obj *valueObjPtr;
-
- /* Remove the current trace on the variable. */
- if (*objPtrPtr != NULL) {
- Tcl_UntraceVar(interp, Tcl_GetString(*objPtrPtr), TRACE_VAR_FLAGS,
- IconVarTraceProc, comboPtr);
- Tcl_DecrRefCount(*objPtrPtr);
- *objPtrPtr = NULL;
- }
- varName = Tcl_GetString(objPtr);
- if ((varName[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- return TCL_OK;
- }
-
- valueObjPtr = Tcl_ObjGetVar2(interp, objPtr, NULL, TCL_GLOBAL_ONLY);
- if (valueObjPtr != NULL) {
- Icon icon;
-
- if (GetIconFromObj(interp, comboPtr, valueObjPtr, &icon) != TCL_OK) {
- return TCL_ERROR;
- }
- if (comboPtr->icon != NULL) {
- FreeIcon(comboPtr, comboPtr->icon);
- }
- comboPtr->icon = icon;
- }
- *objPtrPtr = objPtr;
- Tcl_IncrRefCount(objPtr);
- Tcl_TraceVar(interp, varName, TRACE_VAR_FLAGS, IconVarTraceProc, comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconVarToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-IconVarToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tcl_Obj *objPtr = *(Tcl_Obj **)(widgRec + offset);
-
- if (objPtr == NULL) {
- objPtr = Tcl_NewStringObj("", -1);
- }
- return objPtr;
-}
-
-/*ARGSUSED*/
-static void
-FreeTextVarProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Tcl_Obj **objPtrPtr = (Tcl_Obj **)(widgRec + offset);
-
- if (*objPtrPtr != NULL) {
- ComboButton *comboPtr = (ComboButton *)(widgRec);
- char *varName;
-
- varName = Tcl_GetString(*objPtrPtr);
- Tcl_UntraceVar(comboPtr->interp, varName, TRACE_VAR_FLAGS,
- TextVarTraceProc, comboPtr);
- Tcl_DecrRefCount(*objPtrPtr);
- *objPtrPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToTextVarProc --
- *
- * Convert the variable to a traced variable.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTextVarProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboButton *comboPtr = (ComboButton *)(widgRec);
- Tcl_Obj **objPtrPtr = (Tcl_Obj **)(widgRec + offset);
- char *varName;
- Tcl_Obj *valueObjPtr;
-
- /* Remove the current trace on the variable. */
- if (*objPtrPtr != NULL) {
- varName = Tcl_GetString(*objPtrPtr);
- Tcl_UntraceVar(interp, varName, TRACE_VAR_FLAGS, TextVarTraceProc,
- comboPtr);
- Tcl_DecrRefCount(*objPtrPtr);
- *objPtrPtr = NULL;
- }
- varName = Tcl_GetString(objPtr);
- if ((varName[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- return TCL_OK;
- }
-
- valueObjPtr = Tcl_ObjGetVar2(interp, objPtr, NULL, TCL_GLOBAL_ONLY);
- if (valueObjPtr != NULL) {
- SetTextFromObj(comboPtr, valueObjPtr);
- if (comboPtr->textVarObjPtr != NULL) {
- if (UpdateTextVar(interp, comboPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- *objPtrPtr = objPtr;
- Tcl_IncrRefCount(objPtr);
- Tcl_TraceVar(interp, varName, TRACE_VAR_FLAGS, TextVarTraceProc, comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextVarToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TextVarToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tcl_Obj *objPtr = *(Tcl_Obj **)(widgRec + offset);
-
- if (objPtr == NULL) {
- objPtr = Tcl_NewStringObj("", -1);
- }
- return objPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToStateProc --
- *
- * Converts the string representing a state into a bitflag.
- *
- * Results:
- * The return value is a standard TCL result. The state flags are
- * updated.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToStateProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing state. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboButton *comboPtr = (ComboButton *)(widgRec);
- unsigned int *flagsPtr = (unsigned int *)(widgRec + offset);
- char *string;
- int flag;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "disabled") == 0) {
- flag = STATE_DISABLED;
- } else if (strcmp(string, "normal") == 0) {
- flag = STATE_NORMAL;
- } else if (strcmp(string, "active") == 0) {
- flag = STATE_ACTIVE;
- } else {
- Tcl_AppendResult(interp, "unknown state \"", string,
- "\": should be active, disabled, or normal.", (char *)NULL);
- return TCL_ERROR;
- }
- if (comboPtr->flags & flag) {
- return TCL_OK; /* State is already set to value. */
- }
- *flagsPtr &= ~STATE_MASK;
- *flagsPtr |= flag;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StateToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-StateToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int state = *(unsigned int *)(widgRec + offset);
- const char *string;
-
- switch (state & STATE_MASK) {
- case STATE_NORMAL: string = "normal"; break;
- case STATE_ACTIVE: string = "active"; break;
- case STATE_POSTED: string = "posted"; break;
- case STATE_DISABLED: string = "disabled"; break;
- default: string = Blt_Itoa(state & STATE_MASK);
- break;
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-/*ARGSUSED*/
-static void
-FreeIconProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Icon icon = *(Icon *)(widgRec + offset);
-
- if (icon != NULL) {
- ComboButton *comboPtr = (ComboButton *)widgRec;
-
- FreeIcon(comboPtr, icon);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToIconProc --
- *
- * Convert a image into a hashed icon.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToIconProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboButton *comboPtr = (ComboButton *)widgRec;
- Icon *iconPtr = (Icon *)(widgRec + offset);
- Icon icon;
-
- if (GetIconFromObj(interp, comboPtr, objPtr, &icon) != TCL_OK) {
- return TCL_ERROR;
- }
- if (*iconPtr != NULL) {
- FreeIcon(comboPtr, *iconPtr);
- }
- *iconPtr = icon;
- if (comboPtr->iconVarObjPtr != NULL) {
- if (UpdateIconVar(interp, comboPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconToObjProc --
- *
- * Converts the icon into its string representation (its name).
- *
- * Results:
- * The name of the icon is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-IconToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Icon icon = *(Icon *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (icon == NULL) {
- objPtr = Tcl_NewStringObj("", 0);
- } else {
- objPtr =Tcl_NewStringObj(Blt_Image_Name(IconImage(icon)), -1);
- }
- return objPtr;
-}
-
-
-/*ARGSUSED*/
-static void
-FreeTextProc(ClientData clientData, Display *display, char *widgRec, int offset)
-{
- ComboButton *comboPtr = (ComboButton *)(widgRec);
-
- if (comboPtr->text != emptyString) {
- Blt_Free(comboPtr->text);
- comboPtr->text = emptyString;
- comboPtr->textLen = 0;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToTextProc --
- *
- * Save the text and add the item to the text hashtable.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTextProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboButton *comboPtr = (ComboButton *)(widgRec);
-
- if (comboPtr->text != emptyString) {
- Blt_Free(comboPtr->text);
- comboPtr->text = emptyString;
- comboPtr->textLen = 0;
- }
- SetTextFromObj(comboPtr, objPtr);
- if (comboPtr->textVarObjPtr != NULL) {
- if (UpdateTextVar(interp, comboPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextToObjProc --
- *
- * Return the text of the item.
- *
- * Results:
- * The text is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TextToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboButton *comboPtr = (ComboButton *)(widgRec);
-
- return Tcl_NewStringObj(comboPtr->text, comboPtr->textLen);
-}
-
-/*
- *---------------------------------------------------------------------------
- * H
- * C
- * L
- * P
- * max of icon/text/image/button
- * P
- * L
- * C
- * H
- *
- * |H|C|L|P| icon |P| text/image |P|L|B| button |B|C|H|
- *
- * H = highlight thickness
- * C = combobutton borderwidth
- * L = label borderwidth
- * P = pad
- * I = icon
- * T = text or image
- *---------------------------------------------------------------------------
- */
-static void
-ComputeGeometry(ComboButton *comboPtr)
-{
- int width, height;
-
- /* Determine the height of the button. It's the maximum height of all
- * it's components: icon, label, and button. */
- comboPtr->iconWidth = comboPtr->iconHeight = 0;
- comboPtr->entryWidth = comboPtr->entryHeight = 0;
- comboPtr->textWidth = comboPtr->textHeight = 0;
- comboPtr->arrowWidth = comboPtr->arrowHeight = 0;
- comboPtr->inset = comboPtr->arrowWidth + comboPtr->highlightWidth;
- if (comboPtr->icon != NULL) {
- comboPtr->iconWidth = IconWidth(comboPtr->icon);
- comboPtr->iconHeight = IconHeight(comboPtr->icon);
- }
- comboPtr->entryWidth += comboPtr->iconWidth;
- if (comboPtr->entryHeight < comboPtr->iconHeight) {
- comboPtr->entryHeight = comboPtr->iconHeight;
- }
- if (comboPtr->image != NULL) {
- comboPtr->textWidth = IconWidth(comboPtr->image);
- comboPtr->textHeight = IconHeight(comboPtr->image);
- } else if (comboPtr->text != NULL) {
- unsigned int w, h;
-
- if (comboPtr->text[0] == '\0') {
- Blt_FontMetrics fm;
-
- Blt_GetFontMetrics(comboPtr->font, &fm);
- comboPtr->textHeight = fm.linespace;
- } else {
- Blt_GetTextExtents(comboPtr->font, 0, comboPtr->text,
- comboPtr->textLen, &w, &h);
- comboPtr->textWidth = w + 2 * IPAD;
- comboPtr->textHeight = h;
- }
- }
- comboPtr->entryWidth += comboPtr->textWidth + IPAD;
- if (comboPtr->iconWidth == 0) {
- comboPtr->entryWidth += IPAD;
- }
- if (comboPtr->entryHeight < comboPtr->textHeight) {
- comboPtr->entryHeight = comboPtr->textHeight;
- }
- if (comboPtr->flags & ARROW) {
- comboPtr->arrowHeight = ARROW_HEIGHT;
- if (comboPtr->reqArrowWidth > 0) {
- comboPtr->arrowWidth = comboPtr->reqArrowWidth;
- } else {
- comboPtr->arrowWidth = Blt_TextWidth(comboPtr->font, "0", 1) + 4;
- }
- comboPtr->arrowWidth += 2 * (comboPtr->arrowBW + comboPtr->arrowPad);
- comboPtr->arrowHeight += 2 * (comboPtr->arrowBW + comboPtr->arrowPad);
- if (comboPtr->arrowHeight > comboPtr->entryHeight) {
- comboPtr->entryHeight = comboPtr->arrowHeight;
- }
- }
- comboPtr->entryHeight += 2 * YPAD;
- comboPtr->entryWidth += 2 * XPAD;
- comboPtr->width = comboPtr->entryWidth + comboPtr->arrowWidth +
- 2 * comboPtr->inset;
- comboPtr->height = comboPtr->entryHeight + 2 * comboPtr->inset;
- if (comboPtr->flags & ARROW) {
- comboPtr->width += comboPtr->borderWidth;
- }
- width = (comboPtr->reqWidth > 0) ? comboPtr->reqWidth : comboPtr->width;
- height = (comboPtr->reqHeight > 0) ? comboPtr->reqHeight : comboPtr->height;
- if ((width != Tk_ReqWidth(comboPtr->tkwin)) ||
- (height != Tk_ReqHeight(comboPtr->tkwin))) {
- Tk_GeometryRequest(comboPtr->tkwin, width, height);
- }
- comboPtr->flags &= ~LAYOUT_PENDING;
-}
-
-static int
-ConfigureComboButton(
- Tcl_Interp *interp,
- ComboButton *comboPtr,
- int objc,
- Tcl_Obj *const *objv,
- int flags)
-{
- unsigned int gcMask;
- XGCValues gcValues;
- GC newGC;
-
- if (Blt_ConfigureWidgetFromObj(interp, comboPtr->tkwin, configSpecs, objc,
- objv, (char *)comboPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
-
- /* Focus highlight GCs */
- gcMask = GCForeground;
- gcValues.foreground = comboPtr->highlightColor->pixel;
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (comboPtr->highlightGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->highlightGC);
- }
- comboPtr->highlightGC = newGC;
- if (comboPtr->highlightBgColor != NULL) {
- gcValues.foreground = comboPtr->highlightBgColor->pixel;
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- } else {
- newGC = NULL;
- }
- if (comboPtr->highlightBgGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->highlightBgGC);
- }
- comboPtr->highlightBgGC = newGC;
- ComputeGeometry(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateOp --
- *
- * Activates
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cb activate bool
- *
- *---------------------------------------------------------------------------
- */
-static int
-ActivateOp(ComboButton *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int bool;
-
- if (comboPtr->flags & (STATE_POSTED|STATE_DISABLED)) {
- return TCL_OK; /* Writing is currently disabled. */
- }
- if (Tcl_GetBooleanFromObj(interp, objv[2], &bool) != TCL_OK) {
- return TCL_ERROR;
- }
- comboPtr->flags &= ~STATE_ACTIVE;
- if (bool) {
- comboPtr->flags |= STATE_ACTIVE;
- }
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cb cget option
- *
- *---------------------------------------------------------------------------
- */
-static int
-CgetOp(ComboButton *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- iconOption.clientData = comboPtr;
- return Blt_ConfigureValueFromObj(interp, comboPtr->tkwin, configSpecs,
- (char *)comboPtr, objv[2], BLT_CONFIG_OBJV_ONLY);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm configure ?option value?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(ComboButton *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int result;
-
- iconOption.clientData = comboPtr;
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin, configSpecs,
- (char *)comboPtr, (Tcl_Obj *)NULL, BLT_CONFIG_OBJV_ONLY);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin, configSpecs,
- (char *)comboPtr, objv[2], BLT_CONFIG_OBJV_ONLY);
- }
- Tcl_Preserve(comboPtr);
- result = ConfigureComboButton(interp, comboPtr, objc - 2, objv + 2,
- BLT_CONFIG_OBJV_ONLY);
- Tcl_Release(comboPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- comboPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InvokeOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cb invoke item
- *
- *---------------------------------------------------------------------------
- */
-static int
-InvokeOp(ComboButton *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int result;
-
- if (comboPtr->flags & STATE_DISABLED) {
- return TCL_OK; /* Item is currently disabled. */
- }
- result = TCL_OK;
- if (comboPtr->cmdObjPtr != NULL) {
- Tcl_Preserve(comboPtr);
- Tcl_IncrRefCount(comboPtr->cmdObjPtr);
- result = Tcl_EvalObjEx(interp, comboPtr->cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(comboPtr->cmdObjPtr);
- Tcl_Release(comboPtr);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PostOp --
- *
- * Posts the menu associated with this widget.
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .ce post
- *
- *---------------------------------------------------------------------------
- */
-static int
-PostOp(ComboButton *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- char *menuName;
- Tk_Window menuWin;
-
- if (comboPtr->flags & (STATE_POSTED|STATE_DISABLED)) {
- return TCL_OK; /* Button's menu is currently posted
- * or entry is disabled. */
- }
- if (comboPtr->menuObjPtr == NULL) {
- return TCL_OK;
- }
- menuName = Tcl_GetString(comboPtr->menuObjPtr);
- menuWin = Tk_NameToWindow(interp, menuName, comboPtr->tkwin);
- if (menuWin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_Parent(menuWin) != comboPtr->tkwin) {
- Tcl_AppendResult(interp, "can't post \"", Tk_PathName(menuWin),
- "\": it isn't a descendant of ", Tk_PathName(comboPtr->tkwin),
- (char *)NULL);
- return TCL_ERROR;
- }
- if (comboPtr->postCmdObjPtr) {
- int result;
-
- Tcl_Preserve(comboPtr);
- Tcl_IncrRefCount(comboPtr->postCmdObjPtr);
- result = Tcl_EvalObjEx(interp, comboPtr->postCmdObjPtr,TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(comboPtr->postCmdObjPtr);
- Tcl_Release(comboPtr);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (Tk_IsMapped(comboPtr->tkwin)) {
- Tcl_Obj *cmd[5];
- int result;
- int rootX, rootY;
-
- Tk_GetRootCoords(comboPtr->tkwin, &rootX, &rootY);
- cmd[0] = comboPtr->menuObjPtr;
- cmd[1] = Tcl_NewStringObj("post", 4);
- cmd[2] = Tcl_NewIntObj(rootX);
- cmd[3] = Tcl_NewIntObj(rootY + Tk_Height(comboPtr->tkwin));
- cmd[4] = Tcl_NewStringObj("left", 4);
- Tcl_Preserve(comboPtr);
- result = Blt_GlobalEvalObjv(interp, 5, cmd);
- Tcl_Release(comboPtr);
- if (result == TCL_OK) {
- comboPtr->flags &= ~STATE_MASK;
- comboPtr->flags |= STATE_POSTED;
- }
- EventuallyRedraw(comboPtr);
- return result;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnpostOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .ce unpost
- *
- *---------------------------------------------------------------------------
- */
-static int
-UnpostOp(
- ComboButton *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
-#ifdef notdef
- fprintf(stderr, "UnpostOp\n");
- fprintf(stderr, "menuObjPtr=%x\n", comboPtr->menuObjPtr);
- fprintf(stderr, "flags=Posted%d,Disabled%d\n",
- comboPtr->flags & STATE_POSTED, comboPtr->flags & STATE_DISABLED);
-#endif
- if ((comboPtr->menuObjPtr != NULL) && (comboPtr->flags & STATE_POSTED)) {
- char *menuName;
- Tk_Window menuWin;
-
- comboPtr->flags &= ~STATE_MASK;
- comboPtr->flags |= STATE_NORMAL;
- menuName = Tcl_GetString(comboPtr->menuObjPtr);
- menuWin = Tk_NameToWindow(interp, menuName, comboPtr->tkwin);
- if (menuWin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_Parent(menuWin) != comboPtr->tkwin) {
- Tcl_AppendResult(interp, "can't unpost \"", Tk_PathName(menuWin),
- "\": it isn't a descendant of ",
- Tk_PathName(comboPtr->tkwin), (char *)NULL);
- return TCL_ERROR;
- }
- if (Tk_IsMapped(menuWin)) {
- Tk_UnmapWindow(menuWin);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyComboButton --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the internal structure of the widget at a safe time (when
- * no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Everything associated with the widget is freed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyComboButton(DestroyData dataPtr) /* Pointer to the widget record. */
-{
- ComboButton *comboPtr = (ComboButton *)dataPtr;
-
- iconOption.clientData = comboPtr;
- Blt_FreeOptions(configSpecs, (char *)comboPtr, comboPtr->display, 0);
- if (comboPtr->highlightGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->highlightGC);
- }
- if (comboPtr->highlightBgGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->highlightBgGC);
- }
- Tcl_DeleteCommandFromToken(comboPtr->interp, comboPtr->cmdToken);
- Blt_Free(comboPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewComboButton --
- *
- *---------------------------------------------------------------------------
- */
-static ComboButton *
-NewComboButton(Tcl_Interp *interp, Tk_Window tkwin)
-{
- ComboButton *comboPtr;
-
- comboPtr = Blt_AssertCalloc(1, sizeof(ComboButton));
-
- comboPtr->borderWidth = 1;
- comboPtr->display = Tk_Display(tkwin);
- comboPtr->flags = (LAYOUT_PENDING | STATE_NORMAL);
- comboPtr->highlightWidth = 2;
- comboPtr->arrowBW = 2;
- comboPtr->arrowRelief = TK_RELIEF_FLAT;
- comboPtr->interp = interp;
- comboPtr->menuAnchor = TK_ANCHOR_SW;
- comboPtr->relief = TK_RELIEF_RAISED;
- comboPtr->postedRelief = TK_RELIEF_FLAT;
- comboPtr->activeRelief = TK_RELIEF_RAISED;
- comboPtr->text = emptyString;
- comboPtr->textLen = 0;
- comboPtr->tkwin = tkwin;
- comboPtr->underline = -1;
- return comboPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboButtonCmd --
- *
- * This procedure is invoked to process the "combobutton" command. See
- * the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec comboButtonOps[] =
-{
- {"activate", 1, ActivateOp, 3, 3, "bool",},
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"configure", 2, ConfigureOp, 2, 0, "?option value?...",},
- {"invoke", 1, InvokeOp, 2, 2, "",},
- {"post", 1, PostOp, 2, 2, "",},
- {"unpost", 1, UnpostOp, 2, 2, "",},
-};
-
-static int nComboButtonOps = sizeof(comboButtonOps) / sizeof(Blt_OpSpec);
-
-typedef int (ComboInstOp)(ComboButton *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-static int
-ComboButtonInstCmdProc(
- ClientData clientData, /* Information about the widget. */
- Tcl_Interp *interp, /* Interpreter to report errors. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument vector. */
-{
- ComboInstOp *proc;
- ComboButton *comboPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nComboButtonOps, comboButtonOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(comboPtr);
- result = (*proc) (comboPtr, interp, objc, objv);
- Tcl_Release(comboPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboButtonInstCmdDeletedProc --
- *
- * This procedure can be called if the window was destroyed (tkwin will
- * be NULL) and the command was deleted automatically. In this case, we
- * need to do nothing.
- *
- * Otherwise this routine was called because the command was deleted.
- * Then we need to clean-up and destroy the widget.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComboButtonInstCmdDeletedProc(ClientData clientData)
-{
- ComboButton *comboPtr = clientData; /* Pointer to widget record. */
-
- if (comboPtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = comboPtr->tkwin;
- comboPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboButtonCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-ComboButtonCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- ComboButton *comboPtr;
- Tcl_CmdInfo cmdInfo;
- Tk_Window tkwin;
- char *path;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * First time in this interpreter, set up procs and initialize various
- * bindings for the widget. If the proc doesn't already exist, source it
- * from "$blt_library/comboentry.tcl". We've deferred sourcing this file
- * until now so that the user could reset the variable $blt_library from
- * within her script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::ComboButton::PostMenu", &cmdInfo)) {
- static char cmd[] = "source [file join $blt_library combobutton.tcl]";
-
- if (Tcl_GlobalEval(interp, cmd) != TCL_OK) {
- char info[200];
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- return TCL_ERROR;
- }
- }
- path = Tcl_GetString(objv[1]);
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), path,
- (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- comboPtr = NewComboButton(interp, tkwin);
-#define EVENT_MASK (ExposureMask|StructureNotifyMask|FocusChangeMask)
- Tk_CreateEventHandler(tkwin, EVENT_MASK, ComboButtonEventProc, comboPtr);
- Tk_SetClass(tkwin, "ComboButton");
- comboPtr->cmdToken = Tcl_CreateObjCommand(interp, path,
- ComboButtonInstCmdProc, comboPtr, ComboButtonInstCmdDeletedProc);
- Blt_SetWindowInstanceData(tkwin, comboPtr);
- if (ConfigureComboButton(interp, comboPtr, objc-2, objv+2, 0) != TCL_OK) {
- Tk_DestroyWindow(comboPtr->tkwin);
- return TCL_ERROR;
- }
- Tcl_SetObjResult(interp, objv[1]);
- return TCL_OK;
-}
-
-int
-Blt_ComboButtonInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "combobutton", ComboButtonCmd, };
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawLabel --
- *
- * Draws the text associated with the label. This is used when the
- * widget acts like a standard label.
- *
- * Results:
- * Nothing.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawLabel(ComboButton *comboPtr, Drawable drawable, int x, int y, int w, int h)
-{
- if (comboPtr->image != NULL) {
- int imgWidth, imgHeight;
-
- imgWidth = MIN(w, comboPtr->textWidth) - IPAD;
- imgHeight = MIN(h, comboPtr->textHeight);
- Tk_RedrawImage(IconImage(comboPtr->image), 0, 0, imgWidth, imgHeight,
- drawable, x + IPAD, y);
- } else {
- TextStyle ts;
- XColor *fg;
-
- if (comboPtr->flags & STATE_POSTED) {
- fg = comboPtr->textPostedColor;
- } else if (comboPtr->flags & STATE_ACTIVE) {
- fg = comboPtr->textActiveColor;
- } else if (comboPtr->flags & STATE_DISABLED) {
- fg = comboPtr->textDisabledColor;
- } else {
- fg = comboPtr->textNormalColor;
- }
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, comboPtr->font);
- Blt_Ts_SetAnchor(ts, TK_ANCHOR_NW);
- Blt_Ts_SetJustify(ts, comboPtr->justify);
- Blt_Ts_SetUnderline(ts, comboPtr->underline);
- Blt_Ts_SetMaxLength(ts, w);
- Blt_Ts_SetForeground(ts, fg);
- Blt_Ts_DrawText(comboPtr->tkwin, drawable, comboPtr->text,
- comboPtr->textLen, &ts, x + IPAD, y);
- }
-}
-
-static void
-DrawComboButton(ComboButton *comboPtr, Drawable drawable)
-{
- Blt_Background bg;
- int x, y;
- int w, h;
- int relief;
-
- /* ComboButton background (just inside of focus highlight ring). */
-
- if (comboPtr->flags & STATE_POSTED) {
- bg = comboPtr->postedBg;
- } else if (comboPtr->flags & STATE_ACTIVE) {
- bg = comboPtr->activeBg;
- } else if (comboPtr->flags & STATE_DISABLED) {
- bg = comboPtr->disabledBg;
- } else {
- bg = comboPtr->normalBg;
- }
- Blt_FillBackgroundRectangle(comboPtr->tkwin, drawable, bg, 0, 0,
- Tk_Width(comboPtr->tkwin), Tk_Height(comboPtr->tkwin),
- comboPtr->borderWidth, TK_RELIEF_FLAT);
-
- x = y = comboPtr->inset;
- w = Tk_Width(comboPtr->tkwin) - (2 * comboPtr->inset);
- h = Tk_Height(comboPtr->tkwin) - (2 * comboPtr->inset);
-
- /* Label: includes icon and text. */
- if (h > comboPtr->entryHeight) {
- y += (h - comboPtr->entryHeight) / 2;
- }
- x += XPAD;
- /* Draw Icon. */
- if (comboPtr->icon != NULL) {
- int ix, iy, iw, ih;
-
- ix = x;
- iy = y;
- if (comboPtr->iconHeight < comboPtr->entryHeight) {
- iy += (comboPtr->entryHeight - comboPtr->iconHeight) / 2;
- }
- iw = MIN(w, comboPtr->iconWidth);
- ih = MIN(h, comboPtr->iconHeight);
- Tk_RedrawImage(IconImage(comboPtr->icon), 0, 0, iw, ih,drawable, ix,iy);
- x += comboPtr->iconWidth + IPAD;
- w -= comboPtr->iconWidth + IPAD;
- }
- if ((w > 0) && (h > 0)) {
- int tx, ty, tw, th;
-
- tx = x + IPAD;
- ty = y;
- if (comboPtr->entryHeight > comboPtr->textHeight) {
- ty += (comboPtr->entryHeight - comboPtr->textHeight) / 2;
- }
- tw = MIN(w, comboPtr->textWidth);
- th = MIN(h, comboPtr->textHeight);
- DrawLabel(comboPtr, drawable, tx, ty, tw, th);
- }
- /* Arrow button. */
- if (comboPtr->flags & ARROW) {
- XColor *color;
-
- x = Tk_Width(comboPtr->tkwin) - comboPtr->inset - comboPtr->arrowWidth;
- y = comboPtr->inset;
- if (h > comboPtr->entryHeight) {
- y += (h - comboPtr->entryHeight) / 2;
- }
- if (x < 0) {
- x = comboPtr->inset;
- }
- Blt_FillBackgroundRectangle(comboPtr->tkwin, drawable, bg, x, y,
- comboPtr->arrowWidth, comboPtr->entryHeight, comboPtr->arrowBW,
- comboPtr->arrowRelief);
- if (comboPtr->flags & STATE_POSTED) {
- color = comboPtr->textPostedColor;
- } else if (comboPtr->flags & STATE_ACTIVE) {
- color = comboPtr->textActiveColor;
- } else if (comboPtr->flags & STATE_DISABLED) {
- color = comboPtr->textDisabledColor;
- } else {
- color = comboPtr->textNormalColor;
- }
- Blt_DrawArrow(comboPtr->display, drawable, color, x, y,
- comboPtr->arrowWidth, comboPtr->entryHeight,
- comboPtr->arrowBW, ARROW_DOWN);
- }
- /* Draw focus highlight ring. */
- if (comboPtr->highlightWidth > 0) {
- if (comboPtr->flags & FOCUS) {
- Tk_DrawFocusHighlight(comboPtr->tkwin, comboPtr->highlightGC,
- comboPtr->highlightWidth, drawable);
- } else {
- Blt_Background bg;
-
- if (comboPtr->flags & STATE_POSTED) {
- bg = comboPtr->postedBg;
- } else if (comboPtr->flags & STATE_DISABLED) {
- bg = comboPtr->disabledBg;
- } else {
- bg = comboPtr->normalBg;
- }
- Blt_DrawFocusBackground(comboPtr->tkwin, bg,
- comboPtr->highlightWidth, drawable);
- }
- }
- if (comboPtr->flags & STATE_POSTED) {
- relief = comboPtr->postedRelief;
- } else if (comboPtr->flags & STATE_ACTIVE) {
- relief = comboPtr->activeRelief;
- } else {
- relief = comboPtr->relief;
- }
- if (relief != TK_RELIEF_FLAT) {
- Blt_DrawBackgroundRectangle(comboPtr->tkwin, drawable, bg,
- comboPtr->highlightWidth, comboPtr->highlightWidth,
- Tk_Width(comboPtr->tkwin) - 2 * comboPtr->highlightWidth,
- Tk_Height(comboPtr->tkwin) - 2 * comboPtr->highlightWidth,
- comboPtr->borderWidth, relief);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayComboButton --
- *
- * This procedure is invoked to display a combobutton widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the button.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayComboButton(ClientData clientData)
-{
- ComboButton *comboPtr = clientData;
- Pixmap drawable;
- int w, h; /* Window width and height. */
-
- comboPtr->flags &= ~REDRAW_PENDING;
- if (comboPtr->tkwin == NULL) {
- return; /* Window destroyed (should not get
- * here) */
- }
-#ifdef notdef
- fprintf(stderr, "Calling DisplayComboButton(%s)\n",
- Tk_PathName(comboPtr->tkwin));
-#endif
- w = Tk_Width(comboPtr->tkwin);
- h = Tk_Height(comboPtr->tkwin);
- if ((w <= 1) || (h <=1)) {
- /* Don't bother computing the layout until the window size is
- * something reasonable. */
- return;
- }
- if (comboPtr->flags & LAYOUT_PENDING) {
- ComputeGeometry(comboPtr);
- }
- if (!Tk_IsMapped(comboPtr->tkwin)) {
- /* The widget's window isn't displayed, so don't bother drawing
- * anything. By getting this far, we've at least computed the
- * coordinates of the combobutton's new layout. */
- return;
- }
-
- /* Create a pixmap the size of the window for double buffering. */
- drawable = Tk_GetPixmap(comboPtr->display, Tk_WindowId(comboPtr->tkwin),
- w, h, Tk_Depth(comboPtr->tkwin));
-#ifdef WIN32
- assert(drawable != None);
-#endif
- DrawComboButton(comboPtr, drawable);
- XCopyArea(comboPtr->display, drawable, Tk_WindowId(comboPtr->tkwin),
- comboPtr->highlightGC, 0, 0, w, h, 0, 0);
- Tk_FreePixmap(comboPtr->display, drawable);
-}
diff --git a/blt3.0.1/src/bltComboEntry.c b/blt3.0.1/src/bltComboEntry.c
deleted file mode 100644
index b84772e..0000000
--- a/blt3.0.1/src/bltComboEntry.c
+++ /dev/null
@@ -1,4470 +0,0 @@
-
-/*
- * bltComboEntry.c --
- *
- * This module implements a comboentry widget for the BLT toolkit.
- *
- * Copyright 2006 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include "bltFont.h"
-#include "bltText.h"
-#include "bltChain.h"
-#include "bltImage.h"
-#include "bltHash.h"
-#include "bltBgStyle.h"
-#include "bltPicture.h"
-#include "bltPainter.h"
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-
-#define FCLAMP(x) ((((x) < 0.0) ? 0.0 : ((x) > 1.0) ? 1.0 : (x)))
-#define IPAD 4 /* Internal pad between components. */
-#define YPAD 2 /* Internal pad between components. */
-#define ICWIDTH 2 /* External pad between border and
- * arrow. */
-#define ARROW_WIDTH 13
-#define ARROW_HEIGHT 13
-#define CLOSE_WIDTH 16
-#define CLOSE_HEIGHT 16
-
-#define EVENT_MASK (ExposureMask|StructureNotifyMask|FocusChangeMask)
-#define CHILD_EVENT_MASK (ExposureMask|StructureNotifyMask)
-
-#define REDRAW_PENDING (1<<0) /* The widget is scheduled to be
- * redrawn. */
-#define LAYOUT_PENDING (1<<1) /* The widget's layout needs to be
- * recomputed. */
-#define ICURSOR (1<<2) /* Insertion cursor is active.
- * Depending upon the timer interval,
- * it may be drawn or not drawn. */
-#define SCROLL_PENDING (1<<3) /* The widget needs to be scrolled. */
-#define FOCUS (1<<4) /* The widget has focus. */
-#define SELECT_PENDING (1<<5) /* The widget is scheduled to invoke a
- * -selectcommand in response to a
- * change in its selection. */
-#define INVOKE_PENDING (1<<6) /* The widget is scheduled to invoke a
- * -command. */
-#define CIPHER (1<<7) /* Don't display the actual text on
- * the screen. */
-#define READONLY (1<<8) /* The widget's editting functions
- * are disabled. */
-#define EXPORT_SELECTION (1<<9) /* The selection is exported to the
- * clipboard. */
-
-#define NORMAL (1<<10) /* The widget is drawn normally. */
-#define DISABLED (1<<11) /* The widget is is disabled. */
-#define POSTED (1<<12) /* The widget has posted a menu. */
-#define STATE_MASK ((DISABLED)|(NORMAL)|(POSTED))
-
-#define ICURSOR_ON (1<<13) /* The insertion cursor is currently
- * visible on screen. */
-#define ARROW (1<<14) /* Display the arrow button on the far
- * right.*/
-#define CLOSE (1<<15) /* Display the close button on the
- * right when text has been
- * entered. */
-#define ACTIVE_ARROW (1<<16) /* The arrow button is currently
- active. */
-#define ACTIVE_CLOSE (1<<17) /* The close button is currently
- * active. */
-#define ACTIVE_MASK ((ACTIVE_ARROW)|(ACTIVE_CLOSE))
-
-#define MODIFIED (1<<18) /* The contents of the text of the
- * entry have been modified. */
-#define TRACE_VAR_FLAGS (TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS)
-
-
-#define DEF_ARROW_ACTIVE_BG STD_ACTIVE_BACKGROUND
-#define DEF_ARROW_ACTIVE_FG STD_ACTIVE_FOREGROUND
-#define DEF_BORDERWIDTH "0"
-#define DEF_ARROW "1"
-#define DEF_ARROW_BORDERWIDTH "2"
-#define DEF_ARROW_PAD "0"
-#define DEF_ARROW_RELIEF "raised"
-#define DEF_ARROW_WIDTH "0"
-#define DEF_CIPHER "0"
-#define DEF_CLOSE "0"
-#define DEF_CMD ((char *)NULL)
-#define DEF_CURSOR ((char *)NULL)
-#define DEF_DISABLED_BG STD_DISABLED_BACKGROUND
-#define DEF_DISABLED_FG STD_DISABLED_FOREGROUND
-#define DEF_EXPORTSELECTION "1"
-#define DEF_FONT STD_FONT_SMALL
-#define DEF_HEIGHT "0"
-#define DEF_HIGHLIGHT_BG_COLOR ((char *)NULL)
-#define DEF_HIGHLIGHT_COLOR "black"
-#define DEF_HIGHLIGHT_WIDTH "2"
-#define DEF_ICON ((char *)NULL)
-#define DEF_ICON_VARIABLE ((char *)NULL)
-#define DEF_IMAGE ((char *)NULL)
-#define DEF_INSERT_COLOR STD_NORMAL_FOREGROUND
-#define DEF_INSERT_OFFTIME "300"
-#define DEF_INSERT_ONTIME "600"
-#define DEF_JUSTIFY "left"
-#define DEF_MENU ((char *)NULL)
-#define DEF_MENU_ANCHOR "sw"
-#define DEF_NORMAL_BG STD_NORMAL_BACKGROUND
-#define DEF_NORMAL_FG STD_NORMAL_FOREGROUND
-#define DEF_EDITABLE "1"
-#define DEF_RELIEF "sunken"
-#define DEF_SCROLL_CMD ((char *)NULL)
-#define DEF_SCROLL_INCR "2"
-#define DEF_SELECT_BORDERWIDTH "0"
-#define DEF_SELECT_CMD ((char *)NULL)
-#define DEF_SELECT_FG RGB_WHITE
-#define DEF_SELECT_BG RGB_SKYBLUE4
-#define DEF_SELECT_RELIEF "flat"
-#define DEF_STATE "normal"
-#define DEF_TAKE_FOCUS "1"
-#define DEF_TEXT (char *)NULL
-#define DEF_TEXT_FOCUS_BG RGB_WHITE
-#define DEF_TEXT_FOCUS_FG RGB_BLACK
-#define DEF_TEXT_NORMAL_BG RGB_WHITE
-#define DEF_TEXT_NORMAL_FG RGB_BLACK
-#define DEF_TEXT_VARIABLE ((char *)NULL)
-#define DEF_UNDERLINE "-1"
-#define DEF_WIDTH "0"
-
-#define DEF_BUTTON_ACTIVEBACKGROUND RGB_RED
-#define DEF_BUTTON_ACTIVEFOREGROUND RGB_WHITE
-#define DEF_BUTTON_ACTIVERELIEF "raised"
-#define DEF_BUTTON_BACKGROUND RGB_GREY70
-#define DEF_BUTTON_BORDERWIDTH "1"
-#define DEF_BUTTON_COMMAND (char *)NULL
-#define DEF_BUTTON_FOREGROUND RGB_GREY95
-#define DEF_BUTTON_RELIEF "flat"
-
-static Tcl_VarTraceProc TextVarTraceProc;
-static Tcl_VarTraceProc IconVarTraceProc;
-
-static Blt_OptionFreeProc FreeTextProc;
-static Blt_OptionParseProc ObjToTextProc;
-static Blt_OptionPrintProc TextToObjProc;
-static Blt_CustomOption textOption = {
- ObjToTextProc, TextToObjProc, FreeTextProc, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeIconProc;
-static Blt_OptionParseProc ObjToIconProc;
-static Blt_OptionPrintProc IconToObjProc;
-static Blt_CustomOption iconOption = {
- ObjToIconProc, IconToObjProc, FreeIconProc, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeTextVarProc;
-static Blt_OptionParseProc ObjToTextVarProc;
-static Blt_OptionPrintProc TextVarToObjProc;
-static Blt_CustomOption textVarOption = {
- ObjToTextVarProc, TextVarToObjProc, FreeTextVarProc, (ClientData)0
-};
-static Blt_OptionFreeProc FreeIconVarProc;
-static Blt_OptionParseProc ObjToIconVarProc;
-static Blt_OptionPrintProc IconVarToObjProc;
-static Blt_CustomOption iconVarOption = {
- ObjToIconVarProc, IconVarToObjProc, FreeIconVarProc, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToStateProc;
-static Blt_OptionPrintProc StateToObjProc;
-static Blt_CustomOption stateOption = {
- ObjToStateProc, StateToObjProc, NULL, (ClientData)0
-};
-
-/*
- * Icon --
- *
- * Since instances of the same Tk image can be displayed in different
- * windows with possibly different color palettes, Tk internally stores
- * each instance in a linked list. But if the instances are used in the
- * same widget and therefore use the same color palette, this adds a lot
- * of overhead, especially when deleting instances from the linked list.
- *
- * For the comboentry widget, we never need more than a single instance
- * of an image, regardless of how many times it's used. Cache the image,
- * maintaining a reference count for each image used in the widget. It's
- * likely that the comboview widget will use many instances of the same
- * image.
- */
-
-typedef struct Icon {
- Tk_Image tkImage; /* The Tk image being cached. */
- short int width, height; /* Dimensions of the cached image. */
-} *Icon;
-
-#define IconHeight(i) ((i)->height)
-#define IconWidth(i) ((i)->width)
-#define IconImage(i) ((i)->tkImage)
-#define IconName(i) (Blt_Image_Name((i)->tkImage))
-
-#define INSERT_OP 1
-#define DELETE_OP 2
-
-/*
- * Button --
- */
-typedef struct {
- int borderWidth; /* Width of 3D border around the tab's
- * button. */
- int pad; /* Extra padding around button. */
- int activeRelief; /* 3D relief when the button is
- * active. */
- int relief; /* 3D relief of button. */
- XColor *normalFg; /* If non-NULL, image to be displayed
- * when button is displayed. */
- XColor *normalBg; /* If non-NULL, image to be displayed
- * when the button is active. */
- XColor *activeFg; /* If non-NULL, image to be displayed
- * when button is displayed. */
- XColor *activeBg; /* If non-NULL, image to be displayed
- * when the button is active. */
- Tcl_Obj *cmdObjPtr; /* Command to be executed when the
- * the button is invoked. */
- Blt_Painter painter;
- Blt_Picture normalPicture; /* If non-NULL, image to be displayed
- * when button is displayed. */
- Blt_Picture activePicture; /* If non-NULL, image to be displayed
- * when the button is active. */
- short int x, y; /* Location of the button in the
- * entry. Used for picking. */
- short int width, height; /* Dimension of the button. */
-} Button;
-
-
-static Blt_ConfigSpec buttonSpecs[] =
-{
- {BLT_CONFIG_COLOR, "-activebackground", "activeBackrgound",
- "ActiveBackground", DEF_BUTTON_ACTIVEBACKGROUND,
- Blt_Offset(Button, activeBg), 0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForergound",
- "ActiveForeground", DEF_BUTTON_ACTIVEFOREGROUND,
- Blt_Offset(Button, activeFg), 0},
- {BLT_CONFIG_COLOR, "-background", "backrgound", "Background",
- DEF_BUTTON_BACKGROUND, Blt_Offset(Button, normalBg), 0},
- {BLT_CONFIG_COLOR, "-foreground", "forergound", "Foreground",
- DEF_BUTTON_FOREGROUND, Blt_Offset(Button, normalFg), 0},
- {BLT_CONFIG_RELIEF, "-activerelief", "activeRelief", "ActiveRelief",
- DEF_BUTTON_ACTIVERELIEF, Blt_Offset(Button, activeRelief), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_BUTTON_BORDERWIDTH, Blt_Offset(Button, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-command", "command", "Command", DEF_BUTTON_COMMAND,
- Blt_Offset(Button, cmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_BUTTON_RELIEF,
- Blt_Offset(Button, relief), 0},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-static char emptyString[] = "";
-
-typedef struct _EditRecord {
- struct _EditRecord *nextPtr;
- short int type;
- short int insertOffset;
- short int offset;
- short int textLen;
- char text[1];
-} EditRecord;
-
-typedef struct {
- Tcl_Interp *interp; /* Interpreter associated with
- * entry. */
- Tk_Window tkwin; /* Window that embodies the
- * comboentry. If NULL, indicates the
- * window has been destroyed but the
- * data structures haven't yet been
- * cleaned up.*/
- Display *display; /* Display containing widget. Used,
- * among other things, so that
- * resources can be freed even after
- * tkwin has gone away. */
- Tcl_Command cmdToken; /* Token for comboentry's widget
- * command. */
- Tk_Cursor cursor; /* Current cursor for window or
- * None. */
- int reqWidth, reqHeight;
- int relief;
- int borderWidth;
-
- Blt_Background inFocusBg;
- Blt_Background outFocusBg;
- Blt_Background normalBg;
- Blt_Background activeBg;
- Blt_Background disabledBg;
-
- XColor *normalColor;
- XColor *activeColor;
- XColor *disabledColor;
-
- Tcl_Obj *takeFocusObjPtr; /* Value of -takefocus option; not
- * used in the C code, but used by
- * keyboard traversal scripts. */
-
- /*
- * Selection Information:
- *
- * The selection is the rectangle that contains selected text. It is
- * displayed as a solid colored entry with optionally a 3D border.
- */
- int selAnchor; /* Fixed end of selection. Used to
- * extend the selection while
- * maintaining the * other end of the
- * selection. */
- short int selFirst; /* Byte offset of the 1st character in
- * the selection. */
- short int selLast; /* Byte offset of the last character
- * in the selection. */
- int selRelief; /* Relief of selected items. Currently
- * is always raised. */
- int selBW; /* Border width of a selected text.*/
- XColor *selFgColor; /* Text color of a selected text. */
- GC selectGC;
- Tcl_Obj *selCmdObjPtr;
-
- Blt_Background selectBg;
-
- Button closeButton;
-
- /*
- * Scanning Information:
- */
- int scanAnchor; /* Scan anchor in screen
- * coordinates. */
- int scanX; /* x-offset of the start of the scan
- * in world coordinates.*/
-
- /*
- * Scrolling Information:
- */
- Tcl_Obj *scrollCmdObjPtr; /* Command prefix for communicating
- * with scrollbars. If NULL,
- * indicates no command to issue. */
- int scrollUnits; /* # of pixels per scroll unit. */
- int scrollX; /* x-offset of the start of visible
- * text in the viewport. */
- int viewWidth; /* Width of the viewport. */
-
- /*
- * In/Out Focus Highlight Ring:
- */
- XColor *highlightColor;
- XColor *highlightBgColor;
- GC highlightBgGC;
- GC highlightGC;
- int highlightWidth;
-
- /*
- * Entry entry:
- *
- * The entry contains optionally an icon and a text string. The rectangle
- * surrounding an entry may have a 3D border.
- */
- Icon icon; /* If non-NULL, image to be displayed
- * in entry. Its value may be
- * overridden by the -iconvariable
- * option. */
- Tcl_Obj *iconVarObjPtr; /* Name of TCL variable. If non-NULL,
- * this variable contains the name of
- * an image representing the icon.
- * This overrides the value of the
- * above field. */
- Icon image; /* If non-NULL, image to be displayed
- * instead of text in the entry. */
- char *text; /* Text string to be displayed in the
- * entry if an image has no been
- * designated. Its value is overridden
- * by the -textvariable option. */
- char *screenText; /* Text string to be displayed in the
- * entry if an image has no been
- * designated. Its value is overridden
- * by the -textvariable option. */
- Tcl_Obj *textVarObjPtr; /* Name of TCL variable. If non-NULL,
- * this variable contains the text
- * string to * be displayed in the
- * entry. This overrides the above
- * field. */
- Blt_Font font; /* Font of text to be display in
- * entry. */
- XColor *textInFocusColor;
- XColor *textOutFocusColor;
- GC textInFocusGC;
- GC textOutFocusGC;
- int textLen; /* # bytes of text. */
- /*
- * Arrow Information:
- */
- int arrowBW;
- int arrowRelief;
- int reqArrowWidth;
- int arrowPad;
-
- /*
- * Insertion cursor information:
- */
- XColor *insertColor; /* Color used to draw vertical bar for
- * insertion cursor. */
- int insertOffTime; /* Time in milliseconds cursor should
- * spend in "off" state for each
- * blink. */
- int insertOnTime; /* Time in milliseconds cursor should
- * spend in "off" state for each
- * blink. */
- Tcl_TimerToken insertTimerToken; /* Handle for a timer event called
- * periodically to blink the insertion
- * cursor. */
-
- int insertWidth; /* Total width of insert cursor. */
- int insertOffset; /* Byte offset of insertion cursor in
- * the text string. */
- GC insertGC;
- int prefTextWidth; /* Desired width of text, measured in
- * average characters. */
- int prefIconWidth; /* Desired width of icon, measured in
- * pixels. */
- int inset;
- short int arrowWidth, arrowHeight;
- short int iconWidth, iconHeight;
- short int entryWidth, entryHeight;
- short int textWidth, textHeight;
- short int width, height;
-
-
- short int firstOffset, lastOffset; /* Byte offset of first and last
- * characters visible in viewport. */
- int firstX, lastX; /* x-coordinates of first and last
- * characters visible in viewport. */
- Tcl_Obj *cmdObjPtr; /* If non-NULL, command to be executed
- * when this menu is posted. */
- Tcl_Obj *menuObjPtr;
- Tk_Window menuWin;
- Tcl_Obj *postCmdObjPtr; /* If non-NULL, command to be executed
- * when this menu is posted. */
- int menuAnchor;
- unsigned int flags;
- EditRecord *undoPtr, *redoPtr;
-} ComboEntry;
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_ARROW_ACTIVE_BG,
- Blt_Offset(ComboEntry, activeBg),0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "ActiveForeground", DEF_ARROW_ACTIVE_FG,
- Blt_Offset(ComboEntry, activeColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-arrowborderwidth", "arrowBorderWidth",
- "ArrowBorderWidth", DEF_ARROW_BORDERWIDTH,
- Blt_Offset(ComboEntry, arrowBW), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-arrowpad", "arrowPad", "ArrowPad",
- DEF_ARROW_PAD, Blt_Offset(ComboEntry, arrowPad),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-arrowrelief", "arrowRelief","ArrowRelief",
- DEF_ARROW_RELIEF, Blt_Offset(ComboEntry, arrowRelief), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-arrowwidth", "arrowWidth","ArrowWidth",
- DEF_ARROW_WIDTH, Blt_Offset(ComboEntry, reqArrowWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_NORMAL_BG, Blt_Offset(ComboEntry, normalBg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_BORDERWIDTH, Blt_Offset(ComboEntry, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-cipher", "cipher", "Cipher", DEF_CIPHER,
- Blt_Offset(ComboEntry, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)CIPHER},
- {BLT_CONFIG_BITMASK, "-closebutton", "closeButton", "CloseButton",
- DEF_CLOSE, Blt_Offset(ComboEntry, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)CLOSE},
- {BLT_CONFIG_OBJ, "-closecommand", "closeCommand", "CloseCommand",
- DEF_BUTTON_COMMAND, Blt_Offset(ComboEntry, closeButton.cmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-command", "command", "Command",
- DEF_CMD, Blt_Offset(ComboEntry, cmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_CURSOR, Blt_Offset(ComboEntry, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BACKGROUND, "-disabledbackground", "disabledBackground",
- "DisabledBackground", DEF_DISABLED_BG,
- Blt_Offset(ComboEntry, disabledBg), 0},
- {BLT_CONFIG_COLOR, "-disabledforeground", "disabledForeground",
- "DisabledForeground", DEF_DISABLED_FG,
- Blt_Offset(ComboEntry, disabledColor), 0},
- {BLT_CONFIG_BITMASK, "-exportselection", "exportSelection",
- "ExportSelection", DEF_EXPORTSELECTION, Blt_Offset(ComboEntry, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)EXPORT_SELECTION},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_FONT,
- Blt_Offset(ComboEntry, font), 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_NORMAL_FG, Blt_Offset(ComboEntry, normalColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-height", "height", "Height", DEF_HEIGHT,
- Blt_Offset(ComboEntry, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK_INVERT, "-hidearrow", "hideArrow", "HideArrow",
- DEF_ARROW, Blt_Offset(ComboEntry, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)ARROW},
- {BLT_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_HIGHLIGHT_BG_COLOR,
- Blt_Offset(ComboEntry, highlightBgColor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_HIGHLIGHT_COLOR, Blt_Offset(ComboEntry, highlightColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_HIGHLIGHT_WIDTH,
- Blt_Offset(ComboEntry, highlightWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-icon", "icon", "Icon", DEF_ICON,
- Blt_Offset(ComboEntry, icon), BLT_CONFIG_NULL_OK, &iconOption},
- {BLT_CONFIG_CUSTOM, "-iconvariable", "iconVariable", "IconVariable",
- DEF_TEXT_VARIABLE, Blt_Offset(ComboEntry, iconVarObjPtr),
- BLT_CONFIG_NULL_OK, &iconVarOption},
- {BLT_CONFIG_PIXELS_NNEG, "-iconwidth", "iconWidth", "IconWidth",
- DEF_WIDTH, Blt_Offset(ComboEntry, prefIconWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-image", "image", "Image", DEF_IMAGE,
- Blt_Offset(ComboEntry, image), BLT_CONFIG_NULL_OK, &iconOption},
- {BLT_CONFIG_COLOR, "-insertbackground", "insertBackground",
- "InsertBackground", DEF_INSERT_COLOR,
- Blt_Offset(ComboEntry, insertColor), 0},
- {BLT_CONFIG_INT, "-insertofftime", "insertOffTime", "OffTime",
- DEF_INSERT_OFFTIME, Blt_Offset(ComboEntry, insertOffTime),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_INT, "-insertontime", "insertOnTime", "OnTime",
- DEF_INSERT_ONTIME, Blt_Offset(ComboEntry, insertOnTime),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-menu", "menu", "Menu", DEF_MENU,
- Blt_Offset(ComboEntry, menuObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ANCHOR, "-menuanchor", "menuAnchor", "MenuAnchor",
- DEF_MENU_ANCHOR, Blt_Offset(ComboEntry, menuAnchor),BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-postcommand", "postCommand", "PostCommand",
- DEF_CMD, Blt_Offset(ComboEntry, postCmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMASK_INVERT, "-editable", "editable", "Editable",
- DEF_EDITABLE, Blt_Offset(ComboEntry, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)READONLY},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_RELIEF,
- Blt_Offset(ComboEntry, relief), 0},
- {BLT_CONFIG_BACKGROUND, "-selectbackground", "selectBackground",
- "Foreground", DEF_SELECT_BG, Blt_Offset(ComboEntry, selectBg), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-selectborderwidth", "selectBorderWidth",
- "BorderWidth", DEF_SELECT_BORDERWIDTH,
- Blt_Offset(ComboEntry, selBW), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-selectcommand", "selectCommand", "SelectCommand",
- DEF_SELECT_CMD, Blt_Offset(ComboEntry, selCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background",
- DEF_SELECT_FG, Blt_Offset(ComboEntry, selFgColor), 0},
- {BLT_CONFIG_RELIEF, "-selectrelief", "selectRelief", "Relief",
- DEF_SELECT_RELIEF, Blt_Offset(ComboEntry, selRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-state", "state", "State", DEF_STATE,
- Blt_Offset(ComboEntry, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- &stateOption},
- {BLT_CONFIG_OBJ, "-takefocus", "takeFocus", "TakeFocus", DEF_TAKE_FOCUS,
- Blt_Offset(ComboEntry, takeFocusObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-text", "text", "Text", DEF_TEXT,
- Blt_Offset(ComboEntry, text), 0, &textOption},
- {BLT_CONFIG_BACKGROUND, "-textbackground", "textBackground", "Background",
- DEF_TEXT_NORMAL_BG, Blt_Offset(ComboEntry, outFocusBg), 0},
- {BLT_CONFIG_BACKGROUND, "-textfocusbackground", "textFocusBackground",
- "FocusBackground", DEF_TEXT_FOCUS_BG,
- Blt_Offset(ComboEntry, inFocusBg), 0},
- {BLT_CONFIG_COLOR, "-textfocusforeground", "textFocusForeground",
- "focusForeground", DEF_TEXT_FOCUS_FG,
- Blt_Offset(ComboEntry, textInFocusColor), 0},
- {BLT_CONFIG_COLOR, "-textforeground", "textForeground", "TextForeground",
- DEF_TEXT_NORMAL_FG, Blt_Offset(ComboEntry, textOutFocusColor), 0},
- {BLT_CONFIG_CUSTOM, "-textvariable", "textVariable", "TextVariable",
- DEF_TEXT_VARIABLE, Blt_Offset(ComboEntry, textVarObjPtr),
- BLT_CONFIG_NULL_OK, &textVarOption},
- {BLT_CONFIG_PIXELS_NNEG, "-textwidth", "textWidth", "TextWidth",
- DEF_WIDTH, Blt_Offset(ComboEntry, prefTextWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-width", "width", "Width",
- DEF_WIDTH, Blt_Offset(ComboEntry, reqWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
- DEF_SCROLL_CMD, Blt_Offset(ComboEntry, scrollCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_POS, "-xscrollincrement", "xScrollIncrement",
- "ScrollIncrement", DEF_SCROLL_INCR,
- Blt_Offset(ComboEntry, scrollUnits), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-static Tcl_IdleProc DisplayComboEntry;
-static Tcl_IdleProc ComboEntrySelectCmdProc;
-static Tcl_IdleProc ComboEntryInvokeCmdProc;
-static Tcl_FreeProc FreeComboEntryProc;
-static Tk_EventProc ComboEntryEventProc;
-static Tcl_ObjCmdProc ComboEntryInstCmdProc;
-static Tcl_CmdDeleteProc ComboEntryInstCmdDeletedProc;
-static Tk_LostSelProc ComboEntryLostSelProc;
-static Tk_SelectionProc ComboEntrySelectionProc;
-static Tcl_TimerProc BlinkInsertCursorProc;
-
-typedef int (ComboEntryCmdProc)(ComboEntry *comboPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Tells the Tk dispatcher to call the comboentry display routine at the
- * next idle point. This request is made only if the window is displayed
- * and no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(ComboEntry *comboPtr)
-{
- if ((comboPtr->tkwin != NULL) && ((comboPtr->flags & REDRAW_PENDING)==0)) {
- comboPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayComboEntry, comboPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyInvokeSelectCmd --
- *
- * Queues a request to execute the -selectcommand code associated with
- * the widget at the next idle point. Invoked whenever the selection
- * changes.
- *
- * Results:
- * None.
- *
- * Side effects:
- * TCL code gets executed for some application-specific task.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyInvokeSelectCmd(ComboEntry *comboPtr)
-{
- if ((comboPtr->flags & SELECT_PENDING) == 0) {
- comboPtr->flags |= SELECT_PENDING;
- Tcl_DoWhenIdle(ComboEntrySelectCmdProc, comboPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyInvokeCmd --
- *
- * Queues a request to execute the -selectcommand code associated with
- * the widget at the next idle point. Invoked whenever the selection
- * changes.
- *
- * Results:
- * None.
- *
- * Side effects:
- * TCL code gets executed for some application-specific task.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyInvokeCmd(ComboEntry *comboPtr)
-{
- if ((comboPtr->flags & INVOKE_PENDING) == 0) {
- comboPtr->flags |= INVOKE_PENDING;
- Tcl_DoWhenIdle(ComboEntryInvokeCmdProc, comboPtr);
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * GenerateModifiedEvent --
- *
- * Send an event that the text was modified. This is equivalent to
- * event generate $textWidget <<Modified>>
- *
- * Results:
- * None
- *
- * Side effects:
- * May force the text window into existence.
- *
- *----------------------------------------------------------------------
- */
-static void
-GenerateModifiedEvent(ComboEntry *comboPtr)
-{
- XVirtualEvent event;
-
- Tk_MakeWindowExist(comboPtr->tkwin);
- memset(&event, 0, sizeof(event));
- event.type = VirtualEvent;
- event.serial = NextRequest(comboPtr->display);
- event.send_event = False;
- event.event = Tk_WindowId(comboPtr->tkwin);
- event.display = comboPtr->display;
- event.name = Tk_GetUid("Modified");
- Tk_HandleEvent((XEvent *)&event);
- comboPtr->flags &= ~MODIFIED;
-}
-
-static int
-InvokeCommand(Tcl_Interp *interp, ComboEntry *comboPtr)
-{
- int result;
-
- Tcl_Preserve(comboPtr);
- Tcl_IncrRefCount(comboPtr->cmdObjPtr);
- result = Tcl_EvalObjEx(interp, comboPtr->cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(comboPtr->cmdObjPtr);
- Tcl_Release(comboPtr);
- return result;
-}
-
-static int
-UpdateTextVariable(Tcl_Interp *interp, ComboEntry *comboPtr)
-{
- Tcl_Obj *resultObjPtr, *objPtr;
- const char *varName;
-
- objPtr = Tcl_NewStringObj(comboPtr->text, comboPtr->textLen);
- varName = Tcl_GetString(comboPtr->textVarObjPtr);
- Tcl_UntraceVar(interp, varName, TRACE_VAR_FLAGS, TextVarTraceProc,comboPtr);
- Tcl_IncrRefCount(objPtr);
- resultObjPtr = Tcl_ObjSetVar2(interp, comboPtr->textVarObjPtr, NULL,
- objPtr, TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG);
- Tcl_DecrRefCount(objPtr);
- Tcl_TraceVar(interp, varName, TRACE_VAR_FLAGS, TextVarTraceProc, comboPtr);
- if (resultObjPtr == NULL) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static void
-FreeUndoRecords(ComboEntry *comboPtr)
-{
- EditRecord *recPtr, *nextPtr;
-
- for (recPtr = comboPtr->undoPtr; recPtr != NULL; recPtr = nextPtr) {
- nextPtr = recPtr->nextPtr;
- Blt_Free(recPtr);
- }
- comboPtr->undoPtr = NULL;
-}
-
-static void
-FreeRedoRecords(ComboEntry *comboPtr)
-{
- EditRecord *recPtr, *nextPtr;
-
- for (recPtr = comboPtr->redoPtr; recPtr != NULL; recPtr = nextPtr) {
- nextPtr = recPtr->nextPtr;
- Blt_Free(recPtr);
- }
- comboPtr->redoPtr = NULL;
-}
-
-static void
-RecordEdit(ComboEntry *comboPtr, int type, int offset, int textLen,
- const char *text)
-{
- EditRecord *recPtr;
-
- recPtr = Blt_AssertMalloc(sizeof(EditRecord) + textLen);
- recPtr->type = type;
- recPtr->insertOffset = comboPtr->insertOffset;
- recPtr->offset = offset;
- recPtr->textLen = textLen;
- memcpy(recPtr->text, text, textLen);
- recPtr->nextPtr = comboPtr->undoPtr;
- comboPtr->undoPtr = recPtr;
-}
-
-static void
-CleanText(ComboEntry *comboPtr)
-{
- char *p, *q, *pend;
-
- if (comboPtr->screenText != NULL) {
- Blt_Free(comboPtr->screenText);
- }
- comboPtr->screenText = Blt_AssertMalloc(comboPtr->textLen + 1);
- for (p = comboPtr->text, q = comboPtr->screenText,
- pend = p + comboPtr->textLen; p < pend; p++, q++) {
- if (comboPtr->flags & CIPHER) {
- *q = '*';
- } else if ((*p == '\n') || (*p == '\t')) {
- *q = ' ';
- } else {
- *q = *p;
- }
- }
-}
-
-static void
-DeleteText(ComboEntry *comboPtr, int first, int last)
-{
- int nBytes;
- int i, j;
-
- nBytes = last - first;
- comboPtr->selFirst = comboPtr->selLast = -1;
- if (comboPtr->insertOffset >= first) {
- if (comboPtr->insertOffset >= last) {
- comboPtr->insertOffset -= nBytes;
- } else {
- comboPtr->insertOffset = first;
- }
- }
- for (i = first, j = last; j < comboPtr->textLen; i++, j++) {
- comboPtr->text[i] = comboPtr->text[j];
- }
- comboPtr->text[i] = '\0';
- comboPtr->textLen -= nBytes;
- CleanText(comboPtr);
- if (comboPtr->textVarObjPtr != NULL) {
- UpdateTextVariable(comboPtr->interp, comboPtr);
- }
- comboPtr->selFirst = comboPtr->selLast = -1;
- comboPtr->flags |= (MODIFIED | LAYOUT_PENDING | SCROLL_PENDING);
-}
-
-static int
-InsertText(ComboEntry *comboPtr, int offset, int nBytes, const char *insertText)
-{
- char *text;
-
- /* Create a larger buffer to hold the text. */
- text = Blt_Malloc(comboPtr->textLen + nBytes);
- if (text == NULL) {
- return TCL_ERROR;
- }
- /* Copy the old + extra to the new text. */
- memcpy(text, comboPtr->text, offset);
- memcpy(text + offset, insertText, nBytes);
- memcpy(text + offset + nBytes, comboPtr->text + offset,
- comboPtr->textLen - offset);
- comboPtr->textLen += nBytes;
- if (comboPtr->text != emptyString) {
- Blt_Free(comboPtr->text);
- }
- comboPtr->text = text;
- if (comboPtr->insertOffset >= offset) {
- comboPtr->insertOffset += nBytes;
- }
- comboPtr->selFirst = comboPtr->selLast = -1;
- CleanText(comboPtr);
- if (comboPtr->textVarObjPtr != NULL) {
- UpdateTextVariable(comboPtr->interp, comboPtr);
- }
- comboPtr->flags |= (MODIFIED | LAYOUT_PENDING | SCROLL_PENDING);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- * H
- * C
- * L
- * P
- * max of icon/text/image/arrow
- * P
- * L
- * C
- * H
- *
- * |H|C|L|P| icon |P| text/image |P|L|B| arrow |B|C|H|
- *
- * H = highlight thickness
- * C = comboentry borderwidth
- * L = label borderwidth
- * P = pad
- * I = icon
- * T = text or image
- *---------------------------------------------------------------------------
- */
-static void
-ComputeGeometry(ComboEntry *comboPtr)
-{
- Button *butPtr = &comboPtr->closeButton;
- /* Determine the height of the entry. It's the maximum height of all it's
- * components: icon, label, close button, and arrow. */
- comboPtr->iconWidth = comboPtr->iconHeight = 0;
- comboPtr->entryWidth = comboPtr->entryHeight = 0;
- comboPtr->textWidth = comboPtr->textHeight = 0;
- comboPtr->arrowWidth = comboPtr->arrowHeight = 0;
- butPtr->width = butPtr->height = 0;
- comboPtr->inset = comboPtr->borderWidth + comboPtr->highlightWidth;
-
- comboPtr->width = 2 * comboPtr->inset + IPAD;
- comboPtr->height = 2 * comboPtr->inset;
-
- if (comboPtr->icon != NULL) {
- comboPtr->iconWidth = IconWidth(comboPtr->icon) + IPAD;
- comboPtr->iconHeight = IconHeight(comboPtr->icon) + 2 * YPAD;
- }
- if (comboPtr->prefIconWidth > 0) {
- comboPtr->iconWidth = comboPtr->prefIconWidth + IPAD;
- }
- comboPtr->entryWidth += comboPtr->iconWidth;
- if (comboPtr->entryHeight < comboPtr->iconHeight) {
- comboPtr->entryHeight = comboPtr->iconHeight;
- }
- if (comboPtr->image != NULL) {
- comboPtr->textWidth = IconWidth(comboPtr->image) + IPAD;
- comboPtr->textHeight = IconHeight(comboPtr->image) + YPAD * 2;
- } else {
- unsigned int w, h;
-
- CleanText(comboPtr);
- if (comboPtr->textLen == 0) {
- Blt_GetTextExtents(comboPtr->font, 0, "0", 1, &w, &h);
- } else {
- Blt_GetTextExtents(comboPtr->font, 0, comboPtr->screenText,
- comboPtr->textLen, &w, &h);
- }
- comboPtr->textWidth = w;
- comboPtr->textHeight = h + 2 * YPAD;
- if (comboPtr->prefTextWidth > 0) {
- w = Blt_TextWidth(comboPtr->font, "0", 1);
- comboPtr->entryWidth += comboPtr->prefTextWidth * w;
- } else {
- comboPtr->entryWidth += comboPtr->textWidth;
- }
- comboPtr->entryWidth += IPAD;
- }
- if (comboPtr->entryHeight < comboPtr->textHeight) {
- comboPtr->entryHeight = comboPtr->textHeight;
- }
- comboPtr->width += comboPtr->entryWidth;
- comboPtr->height += comboPtr->entryHeight;
- if (comboPtr->flags & ARROW) {
- comboPtr->arrowHeight = ARROW_HEIGHT;
- if (comboPtr->reqArrowWidth > 0) {
- comboPtr->arrowWidth = comboPtr->reqArrowWidth;
- } else {
- comboPtr->arrowWidth = Blt_TextWidth(comboPtr->font, "0", 1);
- comboPtr->arrowWidth = comboPtr->arrowWidth + 4;
- }
- comboPtr->arrowWidth += 2 * (comboPtr->arrowBW + comboPtr->arrowPad);
- comboPtr->arrowHeight += 2 * comboPtr->arrowBW;
- if (comboPtr->arrowHeight > comboPtr->entryHeight) {
- comboPtr->height = comboPtr->entryHeight = comboPtr->arrowHeight;
- }
- comboPtr->arrowWidth |= 0x1;
- comboPtr->width += comboPtr->arrowWidth;
- }
- if (comboPtr->flags & CLOSE) {
- Button *butPtr = &comboPtr->closeButton;
-
- butPtr->height = CLOSE_HEIGHT;
- butPtr->width = CLOSE_WIDTH;
- butPtr->width += 2 * (butPtr->borderWidth + butPtr->pad);
- butPtr->height += 2 * (butPtr->borderWidth + butPtr->pad);
- if (butPtr->height > comboPtr->entryHeight) {
- comboPtr->height = comboPtr->entryHeight = butPtr->height;
- }
- comboPtr->width += butPtr->width;
- }
- {
- int w, h;
- w = (comboPtr->reqWidth > 0) ? comboPtr->reqWidth : comboPtr->width;
- h = (comboPtr->reqHeight > 0) ? comboPtr->reqHeight : comboPtr->height;
- if ((w != Tk_ReqWidth(comboPtr->tkwin)) ||
- (h != Tk_ReqHeight(comboPtr->tkwin))) {
- Tk_GeometryRequest(comboPtr->tkwin, w, h);
- }
- }
- comboPtr->flags &= ~LAYOUT_PENDING;
-}
-
-static int
-UpdateIconVariable(Tcl_Interp *interp, ComboEntry *comboPtr)
-{
- Tcl_Obj *resultObjPtr, *objPtr;
-
- if (comboPtr->icon != NULL) {
- objPtr = Tcl_NewStringObj(IconName(comboPtr->icon), -1);
- } else {
- objPtr = Tcl_NewStringObj("", -1);
- }
- Tcl_IncrRefCount(objPtr);
- resultObjPtr = Tcl_ObjSetVar2(interp, comboPtr->iconVarObjPtr, NULL,
- objPtr, TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG);
- Tcl_DecrRefCount(objPtr);
- if (resultObjPtr == NULL) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static void
-FreeIcon(ComboEntry *comboPtr, Icon icon)
-{
- Tk_FreeImage(IconImage(icon));
- Blt_Free(icon);
-}
-
-static char *
-GetInterpResult(Tcl_Interp *interp)
-{
-#define MAX_ERR_MSG 1023
- static char mesg[MAX_ERR_MSG+1];
-
- strncpy(mesg, Tcl_GetStringResult(interp), MAX_ERR_MSG);
- mesg[MAX_ERR_MSG] = '\0';
- return mesg;
-}
-
-static void
-SetTextFromObj(ComboEntry *comboPtr, Tcl_Obj *objPtr)
-{
- int nBytes;
- char *string;
-
- if (comboPtr->text != emptyString) {
- Blt_Free(comboPtr->text);
- }
- string = Tcl_GetStringFromObj(objPtr, &nBytes);
- comboPtr->text = Blt_AssertMalloc(nBytes + 1);
- memcpy(comboPtr->text, string, nBytes);
- comboPtr->text[nBytes] = '\0';
- comboPtr->textLen = nBytes;
- CleanText(comboPtr);
- comboPtr->flags |= (ICURSOR | SCROLL_PENDING | LAYOUT_PENDING);
- comboPtr->scrollX = 0;
- comboPtr->selFirst = comboPtr->selLast = -1;
- comboPtr->insertOffset = nBytes;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconChangedProc
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-IconChangedProc(
- ClientData clientData,
- int x, int y, int w, int h, /* Not used. */
- int imageWidth, int imageHeight) /* Not used. */
-{
- ComboEntry *comboPtr = clientData;
-
- comboPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(comboPtr);
-}
-
-static int
-GetIconFromObj(Tcl_Interp *interp, ComboEntry *comboPtr, Tcl_Obj *objPtr,
- Icon *iconPtr)
-{
- Tk_Image tkImage;
- const char *iconName;
-
- iconName = Tcl_GetString(objPtr);
- if (iconName[0] == '\0') {
- *iconPtr = NULL;
- return TCL_OK;
- }
- tkImage = Tk_GetImage(interp, comboPtr->tkwin, iconName, IconChangedProc,
- comboPtr);
- if (tkImage != NULL) {
- struct Icon *ip;
- int width, height;
-
- ip = Blt_AssertMalloc(sizeof(struct Icon));
- Tk_SizeOfImage(tkImage, &width, &height);
- ip->tkImage = tkImage;
- ip->width = width;
- ip->height = height;
- *iconPtr = ip;
- return TCL_OK;
- }
- return TCL_ERROR;
-}
-
-static void
-BlinkCursor(ComboEntry *comboPtr)
-{
- int time;
-
- if (comboPtr->flags & ICURSOR_ON) {
- comboPtr->flags &= ~ICURSOR_ON;
- time = comboPtr->insertOffTime;
- } else {
- comboPtr->flags |= ICURSOR_ON;
- time = comboPtr->insertOnTime;
- }
- comboPtr->insertTimerToken = Tcl_CreateTimerHandler(time,
- BlinkInsertCursorProc, comboPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BlinkInsertCursorProc --
- *
- * This procedure is called as a timer handler to blink the insertion
- * cursor off and on.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The cursor gets turned on or off, redisplay gets invoked, and this
- * procedure reschedules itself.
- *
- *---------------------------------------------------------------------------
- */
-static void
-BlinkInsertCursorProc(ClientData clientData)
-{
- ComboEntry *comboPtr = clientData;
-
- if (((comboPtr->flags & FOCUS) == 0)||(comboPtr->insertOffTime == 0)) {
- return;
- }
- if (comboPtr->flags & ICURSOR) {
- BlinkCursor(comboPtr);
- EventuallyRedraw(comboPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboEntryEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * comboentry widgets.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComboEntryEventProc(ClientData clientData, XEvent *eventPtr)
-{
- ComboEntry *comboPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(comboPtr);
- }
- } else if (eventPtr->type == ConfigureNotify) {
- comboPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(comboPtr);
- } else if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
- if (eventPtr->xfocus.detail == NotifyInferior) {
- return;
- }
- if (eventPtr->type == FocusIn) {
- comboPtr->flags |= FOCUS;
- } else {
- comboPtr->flags &= ~FOCUS;
- }
- if (comboPtr->insertTimerToken != NULL) {
- Tcl_DeleteTimerHandler(comboPtr->insertTimerToken);
- comboPtr->insertTimerToken = NULL;
- }
- if ((comboPtr->flags & (FOCUS|ICURSOR|READONLY))==(FOCUS|ICURSOR)) {
- if (comboPtr->flags & ICURSOR_ON) {
- comboPtr->flags &= ~ICURSOR_ON;
- } else {
- comboPtr->flags |= ICURSOR_ON;
- }
- if (comboPtr->insertOffTime != 0) {
- BlinkCursor(comboPtr);
- }
- }
- EventuallyRedraw(comboPtr);
- } else if (eventPtr->type == DestroyNotify) {
- if (comboPtr->tkwin != NULL) {
- comboPtr->tkwin = NULL;
- }
- if (comboPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayComboEntry, comboPtr);
- }
- if (comboPtr->flags & SELECT_PENDING) {
- Tcl_CancelIdleCall(ComboEntrySelectCmdProc, comboPtr);
- }
- if (comboPtr->flags & INVOKE_PENDING) {
- Tcl_CancelIdleCall(ComboEntryInvokeCmdProc, comboPtr);
- }
- if (comboPtr->insertTimerToken != NULL) {
- Tcl_DeleteTimerHandler(comboPtr->insertTimerToken);
- }
- Tcl_EventuallyFree(comboPtr, FreeComboEntryProc);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboEntryLostSelProc --
- *
- * This procedure is called back by Tk when the selection is grabbed away
- * from the comboentry widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The existing selection is unhighlighted, and the window is marked as
- * not containing a selection.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComboEntryLostSelProc(ClientData clientData)
-{
- ComboEntry *comboPtr = clientData;
-
- if ((comboPtr->selFirst >= 0) && (comboPtr->flags & EXPORT_SELECTION)) {
- comboPtr->selFirst = comboPtr->selLast = -1;
- EventuallyRedraw(comboPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChildEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * sub-menus of comboentry widgets.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ChildEventProc(ClientData clientData, XEvent *eventPtr)
-{
- ComboEntry *comboPtr = clientData;
-
- if ((eventPtr->type == UnmapNotify) || (eventPtr->type == DestroyNotify)) {
- comboPtr->flags &= ~STATE_MASK;
- comboPtr->flags |= NORMAL;
- } else if (eventPtr->type == MapNotify) {
- comboPtr->flags &= ~STATE_MASK;
- comboPtr->flags |= POSTED;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboEntryInvokeCmdProc --
- *
- * Invoked at the next idle point whenever the current
- * selection changes. Executes some application-specific code
- * in the -selectcommand option. This provides a way for
- * applications to handle selection changes.
- *
- * Results:
- * None.
- *
- * Side effects:
- * TCL code gets executed for some application-specific task.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComboEntryInvokeCmdProc(ClientData clientData)
-{
- ComboEntry *comboPtr = clientData;
-
- comboPtr->flags &= ~INVOKE_PENDING;
- if (comboPtr->cmdObjPtr != NULL) {
- if (InvokeCommand(comboPtr->interp, comboPtr) != TCL_OK) {
- Tcl_BackgroundError(comboPtr->interp);
- }
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectText --
- *
- * Modify the selection by moving its un-anchored end. This could make
- * the selection either larger or smaller.
- *
- * 1) If index is before the anchor point, sets the selection to the
- * characters from index up to but not including the anchor point.
- * 2) If index is the same as the anchor point, does nothing.
- * 3) If index is after the anchor point, set the selection to the
- * characters from the anchor point up to but not including index.
- * The anchor point is determined by the most recent select from
- * or select adjust command in this widget.
- * 4) If the selection isn't in this widget then a new selection is
- * created using the most recent anchor point specified for the
- * widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is possibly redrawn with the new selection.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectText(ComboEntry *comboPtr, int offset)
-{
- int selFirst, selLast;
-
- /*
- * Grab the selection if we don't own it already.
- */
- if ((comboPtr->flags & EXPORT_SELECTION) && (comboPtr->selFirst == -1)) {
- Tk_OwnSelection(comboPtr->tkwin, XA_PRIMARY, ComboEntryLostSelProc,
- comboPtr);
- }
- /* If the anchor hasn't been set yet, assume the beginning of the text*/
- if (comboPtr->selAnchor < 0) {
- comboPtr->selAnchor = 0;
- }
- if (comboPtr->selAnchor <= offset) {
- selFirst = comboPtr->selAnchor;
- selLast = offset;
- } else {
- selFirst = offset;
- selLast = comboPtr->selAnchor;
- }
- if (((comboPtr->selFirst != selFirst) || (comboPtr->selLast != selLast)) &&
- (selFirst != selLast)) {
- comboPtr->selFirst = selFirst;
- comboPtr->selLast = selLast;
- EventuallyRedraw(comboPtr);
- if (comboPtr->selCmdObjPtr != NULL) {
- EventuallyInvokeSelectCmd(comboPtr);
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboEntrySelectCmdProc --
- *
- * Invoked at the next idle point whenever the current
- * selection changes. Executes some application-specific code
- * in the -selectcommand option. This provides a way for
- * applications to handle selection changes.
- *
- * Results:
- * None.
- *
- * Side effects:
- * TCL code gets executed for some application-specific task.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComboEntrySelectCmdProc(ClientData clientData)
-{
- ComboEntry *comboPtr = clientData;
-
- if (comboPtr->selCmdObjPtr != NULL) {
- int result;
-
- comboPtr->flags &= ~SELECT_PENDING;
- Tcl_Preserve(comboPtr);
- Tcl_IncrRefCount(comboPtr->selCmdObjPtr);
- result = Tcl_EvalObjEx(comboPtr->interp, comboPtr->selCmdObjPtr,
- TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(comboPtr->selCmdObjPtr);
- Tcl_Release(comboPtr);
- if (result != TCL_OK) {
- Tcl_BackgroundError(comboPtr->interp);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboEntrySelectionProc --
- *
- * This procedure is called back by Tk when the selection is requested by
- * someone. It returns part or all of the selection in a buffer provided
- * by the caller.
- *
- * Results:
- * The return value is the number of non-NULL bytes stored at buffer.
- * Buffer is filled (or partially filled) with a NUL-terminated string
- * containing part or all of the selection, as given by offset and
- * maxBytes.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ComboEntrySelectionProc(
- ClientData clientData, /* Information about the widget. */
- int offset, /* Offset within the selection of the
- * first character to be returned. */
- char *buffer, /* Location in which to place
- * selection. */
- int maxBytes) /* Maximum number of bytes to place at
- * buffer, not including terminating
- * NULL character. */
-{
- ComboEntry *comboPtr = clientData;
- int size;
-
- size = 0;
- if (comboPtr->selFirst >= 0) {
- size = comboPtr->selLast - comboPtr->selFirst - offset;
- assert(size >= 0);
- if (size > maxBytes) {
- size = maxBytes;
- }
- memcpy(buffer, comboPtr->text + comboPtr->selFirst + offset, size);
- buffer[size] = '\0';
- }
- return size;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextVarTraceProc --
- *
- * This procedure is invoked when someone changes the state variable
- * associated with a comboentry entry. The entry's selected state is set
- * to match the value of the variable.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The comboentry entry may become selected or deselected.
- *
- *---------------------------------------------------------------------------
- */
-static char *
-TextVarTraceProc(
- ClientData clientData, /* Information about the item. */
- Tcl_Interp *interp, /* Interpreter containing variable. */
- const char *name1, /* First part of variable's name. */
- const char *name2, /* Second part of variable's name. */
- int flags) /* Describes what just happened. */
-{
- ComboEntry *comboPtr = clientData;
-
- assert(comboPtr->textVarObjPtr != NULL);
- if (flags & TCL_INTERP_DESTROYED) {
- return NULL; /* Interpreter is going away. */
- }
- /*
- * If the variable is being unset, then re-establish the trace.
- */
- if (flags & TCL_TRACE_UNSETS) {
- if (flags & TCL_TRACE_DESTROYED) {
- Tcl_SetVar(interp, name1, comboPtr->text, TCL_GLOBAL_ONLY);
- Tcl_TraceVar(interp, name1, TRACE_VAR_FLAGS, TextVarTraceProc,
- clientData);
- }
- return NULL;
- }
- if (comboPtr->flags & DISABLED) {
- return NULL;
- }
- if (flags & TCL_TRACE_WRITES) {
- Tcl_Obj *valueObjPtr;
-
- /*
- * Update the comboentry's text with the value of the variable, unless
- * the widget already has that value (this happens when the variable
- * changes value because we changed it because someone typed in the
- * entry).
- */
- valueObjPtr = Tcl_ObjGetVar2(interp, comboPtr->textVarObjPtr, NULL,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG);
- if (valueObjPtr == NULL) {
- return GetInterpResult(interp);
- } else {
- SetTextFromObj(comboPtr, valueObjPtr);
- if (comboPtr->cmdObjPtr != NULL) {
- EventuallyInvokeCmd(comboPtr);
- }
- }
- EventuallyRedraw(comboPtr);
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconVarTraceProc --
- *
- * This procedure is invoked when someone changes the state variable
- * associated with a comboentry entry. The entry's selected state is set
- * to match the value of the variable.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The comboentry entry may become selected or deselected.
- *
- *---------------------------------------------------------------------------
- */
-static char *
-IconVarTraceProc(
- ClientData clientData, /* Information about the item. */
- Tcl_Interp *interp, /* Interpreter containing variable. */
- const char *name1, /* First part of variable's name. */
- const char *name2, /* Second part of variable's name. */
- int flags) /* Describes what just happened. */
-{
- ComboEntry *comboPtr = clientData;
-
- assert(comboPtr->iconVarObjPtr != NULL);
- if (flags & TCL_INTERP_DESTROYED) {
- return NULL; /* Interpreter is going away. */
-
- }
- /*
- * If the variable is being unset, then re-establish the trace.
- */
- if (flags & TCL_TRACE_UNSETS) {
- if (flags & TCL_TRACE_DESTROYED) {
- Tcl_SetVar(interp, name1, IconName(comboPtr->icon),TCL_GLOBAL_ONLY);
- Tcl_TraceVar(interp, name1, TRACE_VAR_FLAGS, IconVarTraceProc,
- clientData);
- }
- return NULL;
- }
- if (comboPtr->flags & DISABLED) {
- return NULL;
- }
- if (flags & TCL_TRACE_WRITES) {
- Icon icon;
- Tcl_Obj *valueObjPtr;
-
- /*
- * Update the comboentry's icon with the image whose name is
- * stored in the variable.
- */
- valueObjPtr = Tcl_ObjGetVar2(interp, comboPtr->iconVarObjPtr, NULL,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG);
- if (valueObjPtr == NULL) {
- return GetInterpResult(interp);
- }
- if (GetIconFromObj(interp, comboPtr, valueObjPtr, &icon) != TCL_OK) {
- return GetInterpResult(interp);
- }
- if (comboPtr->icon != NULL) {
- FreeIcon(comboPtr, comboPtr->icon);
- }
- comboPtr->icon = icon;
- comboPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(comboPtr);
- }
- return NULL;
-}
-
-/*ARGSUSED*/
-static void
-FreeIconVarProc(ClientData clientData, Display *display, char *widgRec,
- int offset)
-{
- Tcl_Obj **objPtrPtr = (Tcl_Obj **)(widgRec + offset);
-
- if (*objPtrPtr != NULL) {
- ComboEntry *comboPtr = (ComboEntry *)widgRec;
-
- Tcl_UntraceVar(comboPtr->interp, Tcl_GetString(*objPtrPtr),
- TRACE_VAR_FLAGS, IconVarTraceProc, comboPtr);
- Tcl_DecrRefCount(*objPtrPtr);
- *objPtrPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToIconVarProc --
- *
- * Convert the variable to a traced variable.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToIconVarProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboEntry *comboPtr = (ComboEntry *)(widgRec);
- Tcl_Obj **objPtrPtr = (Tcl_Obj **)(widgRec + offset);
- char *varName;
- Tcl_Obj *valueObjPtr;
-
- /* Remove the current trace on the variable. */
- if (*objPtrPtr != NULL) {
- Tcl_UntraceVar(interp, Tcl_GetString(*objPtrPtr), TRACE_VAR_FLAGS,
- IconVarTraceProc, comboPtr);
- Tcl_DecrRefCount(*objPtrPtr);
- *objPtrPtr = NULL;
- }
- varName = Tcl_GetString(objPtr);
- if ((varName[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- return TCL_OK;
- }
-
- valueObjPtr = Tcl_ObjGetVar2(interp, objPtr, NULL, TCL_GLOBAL_ONLY);
- if (valueObjPtr != NULL) {
- Icon icon;
-
- if (GetIconFromObj(interp, comboPtr, valueObjPtr, &icon) != TCL_OK) {
- return TCL_ERROR;
- }
- if (comboPtr->icon != NULL) {
- FreeIcon(comboPtr, comboPtr->icon);
- }
- comboPtr->icon = icon;
- }
- *objPtrPtr = objPtr;
- Tcl_IncrRefCount(objPtr);
- Tcl_TraceVar(interp, varName, TRACE_VAR_FLAGS, IconVarTraceProc, comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconVarToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-IconVarToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tcl_Obj *objPtr = *(Tcl_Obj **)(widgRec + offset);
-
- if (objPtr == NULL) {
- objPtr = Tcl_NewStringObj("", -1);
- }
- return objPtr;
-}
-
-/*ARGSUSED*/
-static void
-FreeTextVarProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Tcl_Obj **objPtrPtr = (Tcl_Obj **)(widgRec + offset);
-
- if (*objPtrPtr != NULL) {
- ComboEntry *comboPtr = (ComboEntry *)(widgRec);
- const char *varName;
-
- varName = Tcl_GetString(*objPtrPtr);
- Tcl_UntraceVar(comboPtr->interp, varName, TRACE_VAR_FLAGS,
- TextVarTraceProc, comboPtr);
- Tcl_DecrRefCount(*objPtrPtr);
- *objPtrPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToTextVarProc --
- *
- * Convert the variable to a traced variable.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTextVarProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboEntry *comboPtr = (ComboEntry *)(widgRec);
- Tcl_Obj **objPtrPtr = (Tcl_Obj **)(widgRec + offset);
- const char *varName;
- Tcl_Obj *valueObjPtr;
-
- /* Remove the current trace on the variable. */
- if (*objPtrPtr != NULL) {
- varName = Tcl_GetString(*objPtrPtr);
- Tcl_UntraceVar(interp, varName, TRACE_VAR_FLAGS, TextVarTraceProc,
- comboPtr);
- Tcl_DecrRefCount(*objPtrPtr);
- *objPtrPtr = NULL;
- }
- varName = Tcl_GetString(objPtr);
- if ((varName[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- return TCL_OK;
- }
-
- valueObjPtr = Tcl_ObjGetVar2(interp, objPtr, NULL, TCL_GLOBAL_ONLY);
- if (valueObjPtr != NULL) {
- SetTextFromObj(comboPtr, valueObjPtr);
- if (comboPtr->textVarObjPtr != NULL) {
- if (UpdateTextVariable(interp, comboPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- *objPtrPtr = objPtr;
- Tcl_IncrRefCount(objPtr);
- Tcl_TraceVar(interp, varName, TRACE_VAR_FLAGS, TextVarTraceProc, comboPtr);
- comboPtr->flags |= MODIFIED;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextVarToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TextVarToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tcl_Obj *objPtr = *(Tcl_Obj **)(widgRec + offset);
-
- if (objPtr == NULL) {
- objPtr = Tcl_NewStringObj("", -1);
- }
- return objPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToStateProc --
- *
- * Converts the string represents an entry state into a bitflag.
- *
- * Results:
- * The return value is a standard TCL result. The state flags are
- * updated.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToStateProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing state. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboEntry *comboPtr = (ComboEntry *)(widgRec);
- unsigned int *flagsPtr = (unsigned int *)(widgRec + offset);
- char *string;
- int flag;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "normal") == 0) {
- flag = NORMAL;
- } else if (strcmp(string, "posted") == 0) {
- flag = POSTED;
- } else if (strcmp(string, "disabled") == 0) {
- flag = DISABLED;
- } else {
- Tcl_AppendResult(interp, "unknown state \"", string,
- "\": should be active, disabled, normal, or posted.",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (comboPtr->flags & flag) {
- return TCL_OK; /* State is already set to value. */
- }
- *flagsPtr &= ~STATE_MASK;
- *flagsPtr |= flag;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StateToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-StateToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int state = *(unsigned int *)(widgRec + offset);
- const char *string;
-
- if (state & NORMAL) {
- string = "normal";
- } else if (state & DISABLED) {
- string = "disabled";
- } else if (state & POSTED) {
- string = "posted";
- } else {
- string = "???";
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-/*ARGSUSED*/
-static void
-FreeIconProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Icon icon = *(Icon *)(widgRec + offset);
-
- if (icon != NULL) {
- ComboEntry *comboPtr = (ComboEntry *)widgRec;
-
- FreeIcon(comboPtr, icon);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToIconProc --
- *
- * Convert a image into a hashed icon.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToIconProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboEntry *comboPtr = (ComboEntry *)widgRec;
- Icon *iconPtr = (Icon *)(widgRec + offset);
- Icon icon;
-
- if (GetIconFromObj(interp, comboPtr, objPtr, &icon) != TCL_OK) {
- return TCL_ERROR;
- }
- if (*iconPtr != NULL) {
- FreeIcon(comboPtr, *iconPtr);
- }
- *iconPtr = icon;
- if (comboPtr->iconVarObjPtr != NULL) {
- if (UpdateIconVariable(interp, comboPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconToObjProc --
- *
- * Converts the icon into its string representation (its name).
- *
- * Results:
- * The name of the icon is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-IconToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Icon icon = *(Icon *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (icon == NULL) {
- objPtr = Tcl_NewStringObj("", 0);
- } else {
- objPtr =Tcl_NewStringObj(Blt_Image_Name(IconImage(icon)), -1);
- }
- return objPtr;
-}
-
-/*ARGSUSED*/
-static void
-FreeTextProc(ClientData clientData, Display *display, char *widgRec, int offset)
-{
- ComboEntry *comboPtr = (ComboEntry *)(widgRec);
-
- if (comboPtr->text != emptyString) {
- Blt_Free(comboPtr->text);
- comboPtr->text = emptyString;
- comboPtr->textLen = 0;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToTextProc --
- *
- * Save the text and add the item to the text hashtable.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTextProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboEntry *comboPtr = (ComboEntry *)(widgRec);
-
- if (comboPtr->text != emptyString) {
- Blt_Free(comboPtr->text);
- comboPtr->text = emptyString;
- comboPtr->textLen = 0;
- }
- SetTextFromObj(comboPtr, objPtr);
- if (comboPtr->textVarObjPtr != NULL) {
- if (UpdateTextVariable(interp, comboPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- comboPtr->flags |= MODIFIED;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextToObjProc --
- *
- * Returns the current text of the entry.
- *
- * Results:
- * The text is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TextToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboEntry *comboPtr = (ComboEntry *)(widgRec);
-
- return Tcl_NewStringObj(comboPtr->text, comboPtr->textLen);
-}
-
-static int
-PrevUtfOffset(const char *string)
-{
- int i;
-
- for (i = 1; i <= TCL_UTF_MAX; i++) {
- unsigned char byte;
-
- string--;
- byte = *(unsigned char *)string;
- if (byte < 0x80) {
- break;
- }
- if (byte >= 0xC0) {
- return i;
- }
- }
- return i;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTextOffset --
- *
- * Converts a string representing a item index into an item pointer.
- * The index may be in one of the following forms:
- *
- * number Specifies the character as a numerical index,
- * where 0 corresponds to the first character in
- * the string.
- * "anchor" Indicates the anchor point for the selection,
- * which is set with the select from and select
- * adjust widget commands.
- * "end" Indicates the character just after the last one
- * in the entry's string. This is equivalent to
- * specifying a numerical index equal to the length
- * of the entry's string.
- * "insert" Indicates the character adjacent to and immediately
- * following the insertion cursor.
- * "sel.first" Indicates the first character in the selection.
- * It is an error to use this form if the selection
- * isn't in the entry window.
- * "sel.last" Indicates the character just after the last one
- * in the selection. It is an error to use this form
- * if the selection isn't in the entry window.
- * @x X-coordinate in the entry's window; the character
- * spanning that x-coordinate is used. For example,
- * "@0" indicates the left-most character in the window.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned. The
- * pointer to the node is returned via itemPtrPtr. Otherwise, TCL_ERROR
- * is returned and an error message is left in interpreter's result
- * field.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetTextOffset(Tcl_Interp *interp, ComboEntry *comboPtr, Tcl_Obj *objPtr,
- int *offsetPtr)
-{
- char *string;
- char c;
- int nChars, offset;
-
- if (Tcl_GetIntFromObj((Tcl_Interp *)NULL, objPtr, &nChars) == TCL_OK) {
- int nBytes, maxChars;
-
- /* Convert the character index into a byte offset. */
- if (comboPtr->text == NULL) {
- *offsetPtr = 0;
- return TCL_OK;
- }
- nBytes = comboPtr->textLen;
- maxChars = Tcl_NumUtfChars(comboPtr->text, comboPtr->textLen);
- if (nChars < 0) {
- nBytes = 0;
- } else if (nChars <= maxChars) {
- nBytes = Tcl_UtfAtIndex(comboPtr->text, nChars) - comboPtr->text;
- }
- *offsetPtr = nBytes;
- return TCL_OK;
- }
- string = Tcl_GetString(objPtr);
- c = string[0];
- if ((c == 'a') && (strcmp(string, "anchor") == 0)) {
- if (comboPtr->selAnchor < 0) {
- Tcl_AppendResult(interp, "bad index \"", string,
- "\": no selection present.", (char *)NULL);
- return TCL_ERROR;
- }
- *offsetPtr = comboPtr->selAnchor;
- } else if ((c == 'e') && (strcmp(string, "end") == 0)) {
- *offsetPtr = comboPtr->textLen;
- } else if ((c == 'i') && (strcmp(string, "insert") == 0)) {
- *offsetPtr = comboPtr->insertOffset;
- } else if ((c == 'n') && (strcmp(string, "next") == 0)) {
- offset = comboPtr->insertOffset;
- if (offset < comboPtr->textLen) {
- Tcl_UniChar dummy;
- int nBytes;
-
- nBytes = Tcl_UtfToUniChar(comboPtr->text + comboPtr->insertOffset,
- &dummy);
- offset = comboPtr->insertOffset + nBytes;
- }
- *offsetPtr = offset;
- } else if ((c == 'p') && (strcmp(string, "previous") == 0)) {
- offset = comboPtr->insertOffset;
- if (offset > 0) {
- int nBytes;
-
- nBytes = PrevUtfOffset(comboPtr->text + comboPtr->insertOffset);
- offset = comboPtr->insertOffset - nBytes;
- }
- *offsetPtr = offset;
- } else if ((c == 's') && (strcmp(string, "sel.first") == 0)) {
- *offsetPtr = (int)comboPtr->selFirst;
- } else if ((c == 's') && (strcmp(string, "sel.last") == 0)) {
- *offsetPtr = (int)comboPtr->selLast;
- } else if (c == '@') {
- int x, dummy;
- if (Tcl_GetInt(interp, string+1, &x) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Convert screen position to character index */
- x -= comboPtr->inset + comboPtr->iconWidth;
- x += comboPtr->scrollX;
- *offsetPtr = Blt_MeasureChars(comboPtr->font, comboPtr->screenText,
- comboPtr->textLen, x, TK_PARTIAL_OK|TK_AT_LEAST_ONE, &dummy);
- } else {
- Tcl_AppendResult(interp, "unknown index \"", string, "\"",(char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyButton --
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyButton(ComboEntry *comboPtr, Button *butPtr)
-{
- iconOption.clientData = comboPtr;
- Blt_FreeOptions(buttonSpecs, (char *)butPtr, comboPtr->display, 0);
- if (butPtr->activePicture != NULL) {
- Blt_FreePicture(butPtr->activePicture);
- }
- if (butPtr->normalPicture != NULL) {
- Blt_FreePicture(butPtr->normalPicture);
- }
- if (butPtr->painter != NULL) {
- Blt_FreePainter(butPtr->painter);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureButton --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) the widget.
- *
- * Results:
-
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for setPtr; old resources get freed, if there were any. The widget
- * is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureButton(
- Tcl_Interp *interp, /* Interpreter to report errors. */
- ComboEntry *comboPtr, /* Information about widget; may or
- * may not already have values for
- * some fields. */
- int objc,
- Tcl_Obj *const *objv,
- int flags)
-{
- Button *butPtr = &comboPtr->closeButton;
-
- iconOption.clientData = comboPtr;
- if (Blt_ConfigureWidgetFromObj(interp, comboPtr->tkwin, buttonSpecs,
- objc, objv, (char *)butPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- butPtr->width = butPtr->height = 0;
- if (comboPtr->flags & CLOSE) {
- butPtr->width = CLOSE_WIDTH + 2 * butPtr->borderWidth;
- butPtr->height = CLOSE_HEIGHT + 2 * butPtr->borderWidth;
- }
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-
-static int
-ConfigureComboEntry(Tcl_Interp *interp, ComboEntry *comboPtr, int objc,
- Tcl_Obj *const *objv, int flags)
-{
- unsigned int gcMask;
- XGCValues gcValues;
- GC newGC;
-
- if (Blt_ConfigureWidgetFromObj(interp, comboPtr->tkwin, configSpecs, objc,
- objv, (char *)comboPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Text in/out focus GCs. */
- gcMask = GCForeground | GCFont;
- if (comboPtr->flags & DISABLED) {
- gcValues.foreground = comboPtr->disabledColor->pixel;
- } else {
- gcValues.foreground = comboPtr->textInFocusColor->pixel;
- }
- gcValues.font = Blt_FontId(comboPtr->font);
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (comboPtr->textInFocusGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->textInFocusGC);
- }
- comboPtr->textInFocusGC = newGC;
-
- gcMask = GCForeground | GCFont;
- if (comboPtr->flags & DISABLED) {
- gcValues.foreground = comboPtr->disabledColor->pixel;
- } else {
- gcValues.foreground = comboPtr->textOutFocusColor->pixel;
- }
- gcValues.font = Blt_FontId(comboPtr->font);
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (comboPtr->textOutFocusGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->textOutFocusGC);
- }
- comboPtr->textOutFocusGC = newGC;
-
- /* Selection foreground. */
- gcMask = GCForeground | GCFont;
- gcValues.foreground = comboPtr->selFgColor->pixel;
- gcValues.font = Blt_FontId(comboPtr->font);
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (comboPtr->selectGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->selectGC);
- }
- comboPtr->selectGC = newGC;
-
- /* Arrow. */
- if (comboPtr->flags & ARROW) {
- gcMask = GCForeground;
- if (comboPtr->flags & ACTIVE_ARROW) {
- gcValues.foreground = comboPtr->activeColor->pixel;
- } else if (comboPtr->flags & NORMAL) {
- gcValues.foreground = comboPtr->normalColor->pixel;
- } else if (comboPtr->flags & DISABLED) {
- gcValues.foreground = comboPtr->disabledColor->pixel;
- }
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- } else {
- newGC = NULL;
- }
-
- /* Focus highlight GCs */
- gcMask = GCForeground;
- gcValues.foreground = comboPtr->highlightColor->pixel;
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (comboPtr->highlightGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->highlightGC);
- }
- comboPtr->highlightGC = newGC;
-
- if (comboPtr->highlightBgColor != NULL) {
- gcMask = GCForeground;
- gcValues.foreground = comboPtr->highlightBgColor->pixel;
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- } else {
- newGC = NULL;
- }
- if (comboPtr->highlightBgGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->highlightBgGC);
- }
- comboPtr->highlightBgGC = newGC;
-
- /* Insert cursor. */
- gcMask = GCForeground;
- gcValues.foreground = comboPtr->insertColor->pixel;
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (comboPtr->insertGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->insertGC);
- }
- comboPtr->insertGC = newGC;
- ComputeGeometry(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateOp --
- *
- * Activates
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cb activate bool
- *
- *---------------------------------------------------------------------------
- */
-static int
-ActivateOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- const char *string;
- unsigned int old;
-
- if (comboPtr->flags & DISABLED) {
- return TCL_OK; /* Writing is currently disabled. */
- }
- string = Tcl_GetString(objv[2]);
- old = (comboPtr->flags & ACTIVE_MASK);
- comboPtr->flags &= ~ACTIVE_MASK;
- if (strcmp(string, "close") == 0) {
- comboPtr->flags |= ACTIVE_CLOSE;
- } else if (strcmp(string, "arrow") == 0) {
- comboPtr->flags |= ACTIVE_ARROW;
- }
- if (old != (comboPtr->flags & ACTIVE_MASK)) {
- EventuallyRedraw(comboPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BboxOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cb bentry option
- *
- *---------------------------------------------------------------------------
- */
-static int
-BboxOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- iconOption.clientData = comboPtr;
- return Blt_ConfigureValueFromObj(interp, comboPtr->tkwin, configSpecs,
- (char *)comboPtr, objv[2], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonCgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ButtonCgetOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- iconOption.clientData = comboPtr;
- return Blt_ConfigureValueFromObj(interp, comboPtr->tkwin, buttonSpecs,
- (char *)&comboPtr->closeButton, objv[2], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonConfigureOp --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) the widget.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for comboPtr; old resources get freed, if there were any. The
- * widget is redisplayed.
- *
- * .ce button configure ?optio value?
- *
- *---------------------------------------------------------------------------
- */
-static int
-ButtonConfigureOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- iconOption.clientData = comboPtr;
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin, buttonSpecs,
- (char *)&comboPtr->closeButton, (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin, buttonSpecs,
- (char *)&comboPtr->closeButton, objv[2], 0);
- }
- if (ConfigureButton(interp, comboPtr, objc - 3, objv + 3,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonInvokeOp --
- *
- * This procedure is called to invoke a button command.
- *
- * .t button invoke
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then
- * interp->result contains an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ButtonInvokeOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- if (comboPtr->closeButton.cmdObjPtr != NULL) {
- Tcl_Obj *cmdObjPtr;
- int result;
-
- cmdObjPtr = Tcl_DuplicateObj(comboPtr->closeButton.cmdObjPtr);
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonOp --
- *
- * This procedure handles tab operations.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec buttonOps[] =
-{
- {"cget", 2, ButtonCgetOp, 4, 4, "option",},
- {"configure", 2, ButtonConfigureOp, 3, 0, "?option value?...",},
- {"invoke", 1, ButtonInvokeOp, 3, 3, "",},
-};
-static int nButtonOps = sizeof(buttonOps) / sizeof(Blt_OpSpec);
-
-
-static int
-ButtonOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- ComboEntryCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nButtonOps, buttonOps,
- BLT_OP_ARG2, objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (comboPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cb cget option
- *
- *---------------------------------------------------------------------------
- */
-static int
-CgetOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- iconOption.clientData = comboPtr;
- return Blt_ConfigureValueFromObj(interp, comboPtr->tkwin, configSpecs,
- (char *)comboPtr, objv[2], BLT_CONFIG_OBJV_ONLY);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClosestOp --
- *
- * Returns the index of the edge closest to the given x-coordinate.
- *
- * Results:
- * A standard TCL result. If the argument does not represent a valid
- * index, then TCL_ERROR is returned and the interpreter result will
- * contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ClosestOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int offset;
- int x;
-
- if (Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Convert screen position to character index */
- x -= comboPtr->inset;
- if (comboPtr->icon != NULL) {
- x -= comboPtr->iconWidth;
- }
- x += comboPtr->scrollX;
- if (x <= 0) {
- offset = 0;
- } else if (x >= comboPtr->textWidth) {
- offset = comboPtr->textLen;
- } else {
- int prev;
- int dummy, leftEdge, rightEdge, mid;
-
- offset = Blt_MeasureChars(comboPtr->font, comboPtr->screenText,
- comboPtr->textLen, x, TK_PARTIAL_OK|TK_AT_LEAST_ONE, &dummy);
- /* Get the previous character */
- prev = offset - PrevUtfOffset(comboPtr->text + offset);
- /* Measure the two strings. */
- rightEdge = Blt_TextWidth(comboPtr->font, comboPtr->screenText, offset);
- leftEdge = Blt_TextWidth(comboPtr->font, comboPtr->screenText, prev);
- mid = (rightEdge + leftEdge + 1) / 2;
- if (x <= mid) {
- offset = prev;
- }
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), offset);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm configure ?option value?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(
- ComboEntry *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int result;
-
- iconOption.clientData = comboPtr;
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin, configSpecs,
- (char *)comboPtr, (Tcl_Obj *)NULL, BLT_CONFIG_OBJV_ONLY);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin, configSpecs,
- (char *)comboPtr, objv[2], BLT_CONFIG_OBJV_ONLY);
- }
- Tcl_Preserve(comboPtr);
- result = ConfigureComboEntry(interp, comboPtr, objc - 2, objv + 2,
- BLT_CONFIG_OBJV_ONLY);
- Tcl_Release(comboPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- comboPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Deletes one of more characters in the label's text label. The range
- * of characters is specified by the range first/last. If no last
- * argument is provided, then only the single character is deleted.
- *
- * Tv\a
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cb delete first ?last?
- *
- *---------------------------------------------------------------------------
- */
-static int
-DeleteOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int first, last;
-
- if (comboPtr->flags & (READONLY|DISABLED)) {
- return TCL_OK; /* Writing is currently disabled. */
- }
- if (GetTextOffset(interp, comboPtr, objv[2], &first) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 4) {
- if (GetTextOffset(interp, comboPtr, objv[3], &last) != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- last = first + 1;
- }
- if ((first == -1) || (last == -1)) {
- return TCL_OK;
- }
- /* Record the delete for futher redo/undos. */
- RecordEdit(comboPtr, DELETE_OP, first, last - first, comboPtr->text+first);
- DeleteText(comboPtr, first, last);
- FreeRedoRecords(comboPtr);
- if (comboPtr->textVarObjPtr != NULL) {
- if (UpdateTextVariable(interp, comboPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- comboPtr->flags |= MODIFIED;
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetOp --
- * Returns the current text string in the widget.
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cb bentry option
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(comboPtr->text, comboPtr->textLen);
- Tcl_SetObjResult(interp, objPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- * Returns the actual character index of the index supplied. This
- * converts text indices such as "end" to the number of UTF characters in
- * the text string.
- *
- * It's an error if the index refers to a non-present selection. Empty
- * text strings always return an index of 0.
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cb index index
- *
- *---------------------------------------------------------------------------
- */
-static int
-IndexOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int offset, nChars;
-
- if (GetTextOffset(interp, comboPtr, objv[2], &offset) != TCL_OK) {
- return TCL_ERROR;
- }
- if (offset == -1) {
- nChars = -1;
- } else {
- /* Convert the Utf byte offset into an Unicode character index. */
- nChars = Tcl_NumUtfChars(comboPtr->text, offset);
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), nChars);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IcursorOp --
- *
- * Sets the cursor to a new location.
- *
- * Results:
- * A standard TCL result. If the argument does not represent a valid
- * index, then TCL_ERROR is returned and the interpreter result will
- * contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IcursorOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int offset;
-
- if (comboPtr->flags & DISABLED) {
- return TCL_OK; /* Widget is currently disabled. */
- }
- if (GetTextOffset(interp, comboPtr, objv[2], &offset) != TCL_OK) {
- return TCL_ERROR;
- }
- if (offset == -1) {
- return TCL_OK;
- }
- comboPtr->insertOffset = offset;
- comboPtr->flags |= ICURSOR;
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * IdentifyOp --
- *
- * Returns the name of the element under the point given by x and y
- * (such as arrow1), or an empty string if the point does not lie
- * in any element of the comboentry. X and Y must be pixel
- * coordinates relative to the widget.
- *
- * Results:
- * A standard TCL result. If the argument does not represent a valid
- * index, then TCL_ERROR is returned and the interpreter result will
- * contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IdentifyOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int x, y, width, height;
- int isRoot;
- char *string;
-
- isRoot = FALSE;
- string = Tcl_GetString(objv[2]);
- if (strcmp("-root", string) == 0) {
- isRoot = TRUE;
- objv++, objc--;
- }
- if (objc < 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ", Tcl_GetString(objv[1]),
- " ?-root? x y\"", (char *)NULL);
- return TCL_ERROR;
-
- }
- if ((Tk_GetPixelsFromObj(interp, comboPtr->tkwin, objv[2], &x) != TCL_OK) ||
- (Tk_GetPixelsFromObj(interp, comboPtr->tkwin, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (isRoot) {
- int rootX, rootY;
-
- Tk_GetRootCoords(comboPtr->tkwin, &rootX, &rootY);
- x -= rootX;
- y -= rootY;
- }
- width = Tk_Width(comboPtr->tkwin);
- height = Tk_Height(comboPtr->tkwin);
- if ((x < 0) || (x >= width) || (y < 0) || (y >= height)) {
- return TCL_OK;
- }
- if (comboPtr->flags & READONLY) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj("arrow", 5));
- return TCL_OK;
- }
- if (height > comboPtr->entryHeight) {
- y += (height - comboPtr->entryHeight) / 2;
- }
- if (comboPtr->icon) {
- int iconX;
-
- iconX = comboPtr->inset;
- if ((x >= iconX) && (x < (iconX + IconWidth(comboPtr->icon)))) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj("icon", 4));
- return TCL_OK;
- }
- }
- if (comboPtr->flags & ARROW) {
- int arrowX;
-
- arrowX = Tk_Width(comboPtr->tkwin) -
- (comboPtr->inset + comboPtr->arrowWidth);
- if (arrowX < 0) {
- arrowX = comboPtr->inset;
- }
- if ((x >= arrowX) && (x < (arrowX + comboPtr->arrowWidth))) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj("arrow", 5));
- return TCL_OK;
- }
- }
- if (comboPtr->flags & CLOSE) {
- Button *butPtr = &comboPtr->closeButton;
-
- if ((x >= butPtr->x) && (x < (butPtr->x + butPtr->width)) &&
- (y >= butPtr->y) && (y < (butPtr->y + butPtr->height))) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj("close", 5));
- return TCL_OK;
- }
- }
- {
- int textX, textY;
-
- textX = comboPtr->inset;
- textY = y;
- if (comboPtr->iconWidth > 0) {
- textX += comboPtr->iconWidth;
- }
- textY += (comboPtr->entryHeight - comboPtr->textHeight) / 2;
- if ((x >= textX) && (x < (textX + comboPtr->textWidth))) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj("text", 4));
- return TCL_OK;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InvokeOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cb invoke item
- *
- *---------------------------------------------------------------------------
- */
-static int
-InvokeOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int result;
-
- if (comboPtr->flags & DISABLED) {
- return TCL_OK; /* Item is currently disabled. */
- }
- result = TCL_OK;
- if (comboPtr->cmdObjPtr != NULL) {
- result = InvokeCommand(interp, comboPtr);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InsertOp --
- *
- * Inserts a new item into the comboentry at the given index.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The comboentry gets a new item.
- *
- * .cb insert index string
- *
- *---------------------------------------------------------------------------
- */
-static int
-InsertOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int offset;
- char *insertText;
- int nBytes;
-
- if (comboPtr->flags & (READONLY|DISABLED)) {
- return TCL_OK; /* Writing is currently disabled. */
- }
- if (GetTextOffset(interp, comboPtr, objv[2], &offset) != TCL_OK) {
- return TCL_ERROR;
- }
- if (offset == -1) {
- return TCL_OK;
- }
- insertText = Tcl_GetStringFromObj(objv[3], &nBytes);
-
- /* Record the operation for future undo/redos. */
- RecordEdit(comboPtr, INSERT_OP, offset, nBytes, insertText);
-
- if (InsertText(comboPtr, offset, nBytes, insertText) != TCL_OK) {
- return TCL_ERROR;
- }
- FreeRedoRecords(comboPtr);
- if (comboPtr->textVarObjPtr != NULL) {
- if (UpdateTextVariable(interp, comboPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- comboPtr->flags |= MODIFIED;
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PostOp --
- *
- * Posts the menu associated with this widget.
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .ce post
- *
- *---------------------------------------------------------------------------
- */
-static int
-PostOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- char *menuName;
- Tk_Window menuWin;
-
- if (comboPtr->flags & (POSTED|DISABLED)) {
- return TCL_OK; /* Entry's menu is currently posted or entry
- * is disabled. */
- }
- if (comboPtr->menuObjPtr == NULL) {
- return TCL_OK;
- }
- menuName = Tcl_GetString(comboPtr->menuObjPtr);
- menuWin = Tk_NameToWindow(interp, menuName, comboPtr->tkwin);
- comboPtr->menuWin = menuWin;
- if (menuWin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_Parent(menuWin) != comboPtr->tkwin) {
- Tcl_AppendResult(interp, "can't post \"", Tk_PathName(menuWin),
- "\": it isn't a descendant of ", Tk_PathName(comboPtr->tkwin),
- (char *)NULL);
- return TCL_ERROR;
- }
- if (comboPtr->menuWin != NULL) {
- Tk_DeleteEventHandler(comboPtr->menuWin, CHILD_EVENT_MASK,
- ChildEventProc, comboPtr);
- }
- comboPtr->menuWin = menuWin;
- Tk_CreateEventHandler(menuWin, CHILD_EVENT_MASK, ChildEventProc, comboPtr);
- if (comboPtr->postCmdObjPtr) {
- int result;
-
- Tcl_Preserve(comboPtr);
- Tcl_IncrRefCount(comboPtr->postCmdObjPtr);
- result = Tcl_EvalObjEx(interp, comboPtr->postCmdObjPtr,
- TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(comboPtr->postCmdObjPtr);
- Tcl_Release(comboPtr);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- {
- Tcl_Obj *cmd[5];
- int result;
- int rootX, rootY;
-
- Tk_GetRootCoords(comboPtr->tkwin, &rootX, &rootY);
- cmd[0] = comboPtr->menuObjPtr;
- cmd[1] = Tcl_NewStringObj("post", 4);
- cmd[2] = Tcl_NewIntObj(rootX + Tk_Width(comboPtr->tkwin));
- cmd[3] = Tcl_NewIntObj(rootY + Tk_Height(comboPtr->tkwin));
- cmd[4] = Tcl_NewStringObj("right", 5);
- Tcl_Preserve(comboPtr);
- result = Blt_GlobalEvalObjv(interp, 5, cmd);
- Tcl_Release(comboPtr);
- if (result == TCL_OK) {
- comboPtr->flags &= ~STATE_MASK;
- comboPtr->flags |= POSTED;
- }
- return result;
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScanOp --
- *
- * Implements the quick scan.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ScanOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int oper;
- int x;
-
-#define SCAN_MARK 1
-#define SCAN_DRAGTO 2
- {
- char *string;
- char c;
- int length;
-
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- if ((c == 'm') && (strncmp(string, "mark", length) == 0)) {
- oper = SCAN_MARK;
- } else if ((c == 'd') && (strncmp(string, "dragto", length) == 0)) {
- oper = SCAN_DRAGTO;
- } else {
- Tcl_AppendResult(interp, "bad scan operation \"", string,
- "\": should be either \"mark\" or \"dragto\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (objc == 3) {
- if (oper == SCAN_MARK) {
- Tcl_SetIntObj(Tcl_GetObjResult(interp), comboPtr->scanAnchor);
- }
- return TCL_OK;
- }
- if (comboPtr->flags & DISABLED) {
- return TCL_OK; /* Widget is currently disabled. */
- }
- if (Blt_GetPixelsFromObj(interp, comboPtr->tkwin, objv[3], PIXELS_ANY, &x)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (oper == SCAN_MARK) {
- comboPtr->scanAnchor = x;
- comboPtr->scanX = comboPtr->scrollX;
- } else {
- int worldX, xMax;
- int dx;
-
- dx = comboPtr->scanAnchor - x;
- worldX = comboPtr->scanX + (10 * dx);
- xMax = comboPtr->viewWidth - ICWIDTH;
-
- if (worldX < 0) {
- worldX = 0;
- } else if ((worldX + xMax) >= comboPtr->textWidth) {
- worldX = comboPtr->textWidth; /* - (8 * xMax / 10); */
- }
- comboPtr->scrollX = worldX;
- comboPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(comboPtr);
- }
- return TCL_OK;
-}
-
-static int
-SeeOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int offset;
-
- if (comboPtr->flags & DISABLED) {
- return TCL_OK; /* Widget is currently disabled. */
- }
- if (GetTextOffset(interp, comboPtr, objv[2], &offset) != TCL_OK) {
- return TCL_ERROR;
- }
- if (offset == -1) {
- return TCL_OK;
- }
- if ((offset <= comboPtr->firstOffset) ||
- (offset >= (comboPtr->lastOffset-1))) {
- int xMax, x;
-
- x = Blt_TextWidth(comboPtr->font, comboPtr->screenText, offset);
- xMax = comboPtr->viewWidth - ICWIDTH;
- if (x >= xMax) {
- x -= xMax;
- if (offset <= comboPtr->firstOffset) {
- x += 9 * xMax / 10;
- } else {
- x += 1 * xMax / 10;
- }
- } else {
- x = 0;
- }
- comboPtr->scrollX = x;
- }
- comboPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionAdjustOp --
- *
- * Locates the end of the selection nearest to the character given by
- * index, and adjusts that end of the selection to be at index
- * (i.e. including but not going beyond index). The other end of the
- * selection is made the anchor point for future select to commands. If
- * the selection isn't currently in the comboentry, then a new selection
- * is created to include the characters between index and the most recent
- * selection anchor point, inclusive.
- *
- * This procedure is called back by Tk when the selection is requested by
- * someone. It returns part or all of the selection in a buffer provided
- * by the caller.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * The widget is possibly redrawn with the new selection.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionAdjustOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int offset;
- int half1, half2;
-
- if (comboPtr->flags & DISABLED) {
- return TCL_OK; /* Widget is currently disabled. */
- }
- if (GetTextOffset(interp, comboPtr, objv[3], &offset) != TCL_OK) {
- return TCL_ERROR;
- }
- if (offset == -1) {
- return TCL_OK;
- }
- half1 = (comboPtr->selFirst + comboPtr->selLast) / 2;
- half2 = (comboPtr->selFirst + comboPtr->selLast + 1) / 2;
- if (offset < half1) {
- comboPtr->selAnchor = comboPtr->selLast;
- } else if (offset > half2) {
- comboPtr->selAnchor = comboPtr->selFirst;
- }
- return SelectText(comboPtr, offset);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionClearOp --
- *
- * Clears the selection.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * The widget is possibly redrawn.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionClearOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- if (comboPtr->flags & DISABLED) {
- return TCL_OK; /* Widget is currently disabled. */
- }
- if (comboPtr->selFirst != -1) {
- comboPtr->selFirst = comboPtr->selLast = -1;
- EventuallyRedraw(comboPtr);
- if (comboPtr->selCmdObjPtr != NULL) {
- EventuallyInvokeSelectCmd(comboPtr);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionFromOp --
- *
- * Sets the selection anchor point to just before the character
- * designated by the given index. Doesn't change the selection, just
- * resets the anchor of the existing selection. Returns an empty string.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionFromOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int offset;
-
- if (comboPtr->flags & DISABLED) {
- return TCL_OK; /* Widget is currently disabled. */
- }
- if (GetTextOffset(interp, comboPtr, objv[3], &offset) != TCL_OK) {
- return TCL_ERROR;
- }
- if (offset == -1) {
- return TCL_OK;
- }
- comboPtr->selAnchor = offset;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionPresentOp --
- *
- * Indicates if there are characters selected in the comboentry.
- *
- * Results:
- * Returns in the interpreter result, 1 if there is are characters
- * selected, 0 if nothing is selected.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionPresentOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), (comboPtr->selFirst != -1));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionRangeOp --
- *
- * Sets the selection to include the characters starting with the one
- * indexed by start and ending with the one just before end. If end
- * refers to the same character as start or an earlier one, then the
- * entry's selection is cleared.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionRangeOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int selFirst, selLast;
-
- if (comboPtr->flags & DISABLED) {
- return TCL_OK; /* Widget is currently disabled. */
- }
- if (GetTextOffset(interp, comboPtr, objv[3], &selFirst) != TCL_OK) {
- return TCL_ERROR;
- }
- if (GetTextOffset(interp, comboPtr, objv[4], &selLast) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((selFirst == -1) || (selLast == -1)) {
- return TCL_OK;
- }
- comboPtr->selAnchor = selFirst;
- return SelectText(comboPtr, selLast);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionToOp --
- *
- * Resets the selection depending upon the given new index. Returns an
- * empty string.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionToOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int offset;
-
- if (comboPtr->flags & DISABLED) {
- return TCL_OK; /* Widget is currently disabled. */
- }
- if (GetTextOffset(interp, comboPtr, objv[3], &offset) != TCL_OK) {
- return TCL_ERROR;
- }
- if (offset == -1) {
- return TCL_OK;
- }
- return SelectText(comboPtr, offset);
-}
-
-
-static Blt_OpSpec selectionOps[] =
-{
- {"adjust", 1, SelectionAdjustOp, 4, 4, "index",},
- {"clear", 1, SelectionClearOp, 3, 3, "",},
- {"from", 1, SelectionFromOp, 4, 4, "index"},
- {"present", 1, SelectionPresentOp, 3, 3, ""},
- {"range", 1, SelectionRangeOp, 5, 5, "start end",},
- {"to", 1, SelectionToOp, 4, 4, "index"},
-};
-
-static int nSelectionOps = sizeof(selectionOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionOp --
- *
- * This procedure handles the individual options for text
- * selections.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectionOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- ComboEntryCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nSelectionOps, selectionOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (comboPtr, interp, objc, objv);
- return result;
-}
-/*
- *---------------------------------------------------------------------------
- *
- * RedoOp --
- *
- * Inserts a new item into the comboentry at the given index.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The comboentry gets a new item.
- *
- * .cb insert index string
- *
- *---------------------------------------------------------------------------
- */
-static int
-RedoOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (comboPtr->flags & (READONLY|DISABLED)) {
- return TCL_OK; /* Writing is currently disabled. */
- }
- if (comboPtr->redoPtr != NULL) {
- EditRecord *recPtr;
-
- recPtr = comboPtr->redoPtr;
- if (recPtr->type == INSERT_OP) {
- InsertText(comboPtr, recPtr->offset, recPtr->textLen, recPtr->text);
- } else if (recPtr->type == DELETE_OP) {
- DeleteText(comboPtr, recPtr->offset,
- recPtr->offset + recPtr->textLen);
- } else {
- Tcl_AppendResult(interp, "unknown record type \"",
- Blt_Itoa(recPtr->type), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- comboPtr->insertOffset = recPtr->insertOffset;
- comboPtr->redoPtr = recPtr->nextPtr;
- recPtr->nextPtr = comboPtr->undoPtr;
- comboPtr->undoPtr = recPtr;
- EventuallyRedraw(comboPtr);
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * UndoOp --
- *
- * Inserts a new item into the comboentry at the given index.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The comboentry gets a new item.
- *
- * .cb insert index string
- *
- *---------------------------------------------------------------------------
- */
-static int
-UndoOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (comboPtr->flags & (READONLY|DISABLED)) {
- return TCL_OK; /* Writing is currently disabled. */
- }
- if (comboPtr->undoPtr != NULL) {
- EditRecord *recPtr;
-
- recPtr = comboPtr->undoPtr;
- if (recPtr->type == INSERT_OP) {
- DeleteText(comboPtr, recPtr->offset,
- recPtr->offset + recPtr->textLen);
- } else if (recPtr->type == DELETE_OP) {
- InsertText(comboPtr, recPtr->offset, recPtr->textLen, recPtr->text);
- } else {
- Tcl_AppendResult(interp, "unknown record type \"",
- Blt_Itoa(recPtr->type), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- comboPtr->insertOffset = recPtr->insertOffset;
- comboPtr->undoPtr = recPtr->nextPtr;
- recPtr->nextPtr = comboPtr->redoPtr;
- comboPtr->redoPtr = recPtr;
- EventuallyRedraw(comboPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnpostOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .ce unpost
- *
- *---------------------------------------------------------------------------
- */
-static int
-UnpostOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- if ((comboPtr->menuObjPtr != NULL) &&
- ((comboPtr->flags & (POSTED|DISABLED)) == POSTED)) {
- char *menuName;
- Tk_Window menuWin;
-
- comboPtr->flags &= ~STATE_MASK;
- comboPtr->flags |= NORMAL;
-
- menuName = Tcl_GetString(comboPtr->menuObjPtr);
- menuWin = Tk_NameToWindow(interp, menuName, comboPtr->tkwin);
- if (menuWin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_Parent(menuWin) != comboPtr->tkwin) {
- Tcl_AppendResult(interp, "can't unpost \"", Tk_PathName(menuWin),
- "\": it isn't a descendant of ",
- Tk_PathName(comboPtr->tkwin), (char *)NULL);
- return TCL_ERROR;
- }
- Blt_UnmapToplevelWindow(menuWin);
- if (Tk_IsMapped(menuWin)) {
- Tk_UnmapWindow(menuWin);
- }
- }
- return TCL_OK;
-}
-
-static int
-XviewOp(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int width;
-
- if (comboPtr->flags & (DISABLED|READONLY)) {
- return TCL_OK; /* Widget is currently disabled. */
- }
- width = comboPtr->viewWidth;
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- /*
- * Note: we are bounding the fractions between 0.0 and 1.0 to support
- * the "canvas"-style of scrolling.
- */
- fract = (double)comboPtr->scrollX / comboPtr->textWidth;
- fract = FCLAMP(fract);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(fract));
- fract = (double)(comboPtr->scrollX + width) / comboPtr->textWidth;
- fract = FCLAMP(fract);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(fract));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2,
- &comboPtr->scrollX, comboPtr->textWidth, width,
- comboPtr->scrollUnits, BLT_SCROLL_MODE_HIERBOX) != TCL_OK) {
- return TCL_ERROR;
- }
- comboPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeComboEntryProc --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the internal structure of the widget at a safe time (when
- * no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeComboEntryProc(DestroyData dataPtr) /* Pointer to the widget record. */
-{
- ComboEntry *comboPtr = (ComboEntry *)dataPtr;
-
- iconOption.clientData = comboPtr;
- Blt_FreeOptions(configSpecs, (char *)comboPtr, comboPtr->display, 0);
- if (comboPtr->textInFocusGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->textInFocusGC);
- }
- if (comboPtr->textOutFocusGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->textOutFocusGC);
- }
- FreeUndoRecords(comboPtr);
- FreeRedoRecords(comboPtr);
- DestroyButton(comboPtr, &comboPtr->closeButton);
- if (comboPtr->screenText != NULL) {
- Blt_Free(comboPtr->screenText);
- }
- if (comboPtr->selectGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->selectGC);
- }
- if (comboPtr->highlightGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->highlightGC);
- }
- if (comboPtr->highlightBgGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->highlightBgGC);
- }
- if (comboPtr->insertGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->insertGC);
- }
- if (comboPtr->insertTimerToken != NULL) {
- Tcl_DeleteTimerHandler(comboPtr->insertTimerToken);
- }
- if (comboPtr->tkwin != NULL) {
- Tk_DeleteSelHandler(comboPtr->tkwin, XA_PRIMARY, XA_STRING);
- Tk_DeleteEventHandler(comboPtr->tkwin, EVENT_MASK,
- ComboEntryEventProc, comboPtr);
- }
- if (comboPtr->insertTimerToken != NULL) {
- Tcl_DeleteTimerHandler(comboPtr->insertTimerToken);
- }
- Tcl_DeleteCommandFromToken(comboPtr->interp, comboPtr->cmdToken);
- Blt_Free(comboPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewComboEntry --
- *
- *---------------------------------------------------------------------------
- */
-static ComboEntry *
-NewComboEntry(Tcl_Interp *interp, Tk_Window tkwin)
-{
- ComboEntry *comboPtr;
-
- comboPtr = Blt_AssertCalloc(1, sizeof(ComboEntry));
-
- comboPtr->borderWidth = 2;
- comboPtr->arrowBW = 2;
- comboPtr->arrowRelief = TK_RELIEF_RAISED;
- comboPtr->display = Tk_Display(tkwin);
- comboPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING | NORMAL |
- ARROW | EXPORT_SELECTION);
- comboPtr->highlightWidth = 2;
- comboPtr->insertOffTime = 300;
- comboPtr->insertOffset = 0;
- comboPtr->insertOnTime = 600;
- comboPtr->interp = interp;
- comboPtr->menuAnchor = TK_ANCHOR_SW;
- comboPtr->relief = TK_RELIEF_SUNKEN;
- comboPtr->scrollUnits = 2;
- comboPtr->selAnchor = -1;
- comboPtr->selFirst = -1;
- comboPtr->selLast = -1;
- comboPtr->text = emptyString;
- comboPtr->textLen = 0;
- comboPtr->tkwin = tkwin;
- return comboPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboEntryCmd --
- *
- * This procedure is invoked to process the "comboentry" command. See
- * the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec comboEntryOps[] =
-{
- {"activate", 1, ActivateOp, 3, 3, "what",},
- {"bbox", 1, BboxOp, 3, 3, "index",},
- {"button", 2, ButtonOp, 2, 0, "args",},
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"closest", 2, ClosestOp, 3, 3, "x",},
- {"configure", 2, ConfigureOp, 2, 0, "?option value?...",},
- {"delete", 1, DeleteOp, 2, 0, "first ?last?",},
- {"get", 1, GetOp, 2, 2, "",},
- {"icursor", 2, IcursorOp, 3, 3, "index",},
- {"identify", 2, IdentifyOp, 4, 5, "x y",},
- {"index", 3, IndexOp, 3, 3, "index",},
- {"insert", 3, InsertOp, 3, 0, "index string",},
- {"invoke", 3, InvokeOp, 2, 2, "",},
- {"post", 1, PostOp, 2, 2, "",},
- {"redo", 2, RedoOp, 2, 2, "",},
- {"scan", 2, ScanOp, 3, 4, "dragto|mark x",},
- {"see", 3, SeeOp, 3, 3, "index",},
- {"selection", 3, SelectionOp, 2, 0, "args",},
- {"undo", 3, UndoOp, 2, 2, "",},
- {"unpost", 3, UnpostOp, 2, 2, "",},
-#ifdef notdef
- {"validate", 1, ValidateOp, 3, 3, "item",},
-#endif
- {"xview", 1, XviewOp, 2, 5, "?moveto fract? ?scroll number what?",},
-};
-
-static int nComboEntryOps = sizeof(comboEntryOps) / sizeof(Blt_OpSpec);
-
-typedef int (ComboInstOp)(ComboEntry *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-static int
-ComboEntryInstCmdProc(
- ClientData clientData, /* Information about the widget. */
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument vector. */
-{
- ComboInstOp *proc;
- ComboEntry *comboPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nComboEntryOps, comboEntryOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(comboPtr);
- result = (*proc) (comboPtr, interp, objc, objv);
- Tcl_Release(comboPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboEntryInstCmdDeletedProc --
- *
- * This procedure can be called if the window was destroyed (tkwin will
- * be NULL) and the command was deleted automatically. In this case, we
- * need to do nothing.
- *
- * Otherwise this routine was called because the command was deleted.
- * Then we need to clean-up and destroy the widget.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComboEntryInstCmdDeletedProc(ClientData clientData)
-{
- ComboEntry *comboPtr = clientData; /* Pointer to widget record. */
-
- if (comboPtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = comboPtr->tkwin;
- comboPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboEntryCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-ComboEntryCmd(
- ClientData clientData, /* Main window associated with interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- ComboEntry *comboPtr;
- Tcl_CmdInfo cmdInfo;
- Tk_Window tkwin;
- char *path;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * First time in this interpreter, set up procs and initialize various
- * bindings for the widget. If the proc doesn't already exist, source it
- * from "$blt_library/comboentry.tcl". We've deferred sourcing this file
- * until now so that the user could reset the variable $blt_library from
- * within her script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::ComboEntry::PostMenu", &cmdInfo)) {
- static char cmd[] = "source [file join $blt_library comboentry.tcl]";
-
- if (Tcl_GlobalEval(interp, cmd) != TCL_OK) {
- char info[200];
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- return TCL_ERROR;
- }
- }
- path = Tcl_GetString(objv[1]);
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), path,
- (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- comboPtr = NewComboEntry(interp, tkwin);
- Tk_CreateEventHandler(tkwin, EVENT_MASK, ComboEntryEventProc, comboPtr);
- Tk_CreateSelHandler(tkwin, XA_PRIMARY, XA_STRING, ComboEntrySelectionProc,
- comboPtr, XA_STRING);
- Tk_SetClass(tkwin, "ComboEntry");
- comboPtr->cmdToken = Tcl_CreateObjCommand(interp, path,
- ComboEntryInstCmdProc, comboPtr, ComboEntryInstCmdDeletedProc);
- Blt_SetWindowInstanceData(tkwin, comboPtr);
- if (ConfigureComboEntry(interp, comboPtr, objc-2, objv+2, 0) != TCL_OK) {
- Tk_DestroyWindow(comboPtr->tkwin);
- return TCL_ERROR;
- }
- if (ConfigureButton(interp, comboPtr, 0, NULL, 0) != TCL_OK) {
- Tk_DestroyWindow(comboPtr->tkwin);
- return TCL_ERROR;
- }
- Tcl_SetObjResult(interp, objv[1]);
- return TCL_OK;
-}
-
-int
-Blt_ComboEntryInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "comboentry", ComboEntryCmd, };
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawEntry --
- *
- * Draw the editable text associated with the entry. The widget may be
- * scrolled so the text may be clipped. We use a temporary pixmap to
- * draw the visible portion of the text.
- *
- * We assume that text strings will be small for the most part. The bad
- * part of this is that we measure the text string 5 times.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawEntry(ComboEntry *comboPtr, Drawable drawable, int x, int y, int w, int h)
-{
- Blt_FontMetrics fm;
- Pixmap pixmap;
- int insertX;
- int textX, textY;
- Blt_Background bg;
- GC gc;
-
-#define TEXT_FLAGS (TK_PARTIAL_OK | TK_AT_LEAST_ONE)
- if (comboPtr->textHeight <= 0) {
- return;
- }
- if (h > comboPtr->entryHeight) {
- h = comboPtr->entryHeight;
- }
- if (comboPtr->image != NULL) {
- int imgX, imgY, imgWidth, imgHeight;
-
- imgWidth = comboPtr->textWidth;
- if (comboPtr->scrollX < imgWidth) {
- imgX = comboPtr->scrollX;
- imgY = y;
- if (comboPtr->entryHeight > comboPtr->iconHeight) {
- imgY += (comboPtr->entryHeight - comboPtr->iconHeight) / 2;
- }
- imgWidth -= comboPtr->scrollX;
- if (imgWidth > w) {
- imgWidth = w;
- }
- imgHeight = MIN(h, comboPtr->iconHeight);
- Tk_RedrawImage(IconImage(comboPtr->image), imgX, 0, imgWidth,
- imgHeight, drawable, x, y);
- }
- return;
- }
- Blt_GetFontMetrics(comboPtr->font, &fm);
- textY = fm.ascent;
- if (comboPtr->entryHeight > comboPtr->textHeight) {
- textY += (comboPtr->entryHeight - comboPtr->textHeight) / 2;
- }
-#ifdef WIN32
- assert(drawable != None);
-#endif
- /*
- * Create a pixmap the size of visible text area. This will be used for
- * clipping the scrolled text string.
- */
- pixmap = Tk_GetPixmap(comboPtr->display, Tk_WindowId(comboPtr->tkwin),
- w, h, Tk_Depth(comboPtr->tkwin));
-
- if ((comboPtr->flags & (FOCUS|READONLY)) == FOCUS) {
- bg = comboPtr->inFocusBg;
- gc = comboPtr->textInFocusGC;
- } else {
- bg = comboPtr->outFocusBg;
- gc = comboPtr->textOutFocusGC;
- }
- /* Text background. */
- {
- int xOrigin, yOrigin;
-
- Blt_GetBackgroundOrigin(bg, &xOrigin, &yOrigin);
- Blt_SetBackgroundOrigin(comboPtr->tkwin, bg, xOrigin+x, yOrigin+y);
- Blt_FillBackgroundRectangle(comboPtr->tkwin, pixmap, bg, 0, 0, w, h,
- 0, TK_RELIEF_FLAT);
- Blt_SetBackgroundOrigin(comboPtr->tkwin, bg, xOrigin, yOrigin);
- }
- if (comboPtr->flags & SCROLL_PENDING) {
- int firstX, textWidth;
-
- /* Find the range of visible characters in both bytes and pixels. */
- comboPtr->firstOffset = comboPtr->lastOffset =
- Blt_MeasureChars(comboPtr->font, comboPtr->screenText,
- comboPtr->textLen, comboPtr->scrollX, 0, &firstX);
- comboPtr->lastOffset += Blt_MeasureChars(comboPtr->font,
- comboPtr->screenText + comboPtr->firstOffset,
- comboPtr->textLen - comboPtr->firstOffset,
- w, TEXT_FLAGS, &textWidth);
- if (comboPtr->lastOffset < comboPtr->textLen) {
- comboPtr->lastOffset++;
- }
- comboPtr->firstX = firstX;
- comboPtr->lastX = textWidth + firstX;
- }
- /*
- * The viewport starts somewhere over the first visible character, but not
- * necessarily at the start of the character. Subtract the viewport
- * offset from the start of the first character. This is zero or a
- * negative x-coordinate, indicating where start drawing the text so that
- * it's properly clipped by the temporary pixmap. */
- textX = comboPtr->firstX - comboPtr->scrollX;
-
- insertX = -1;
- if (((comboPtr->flags & (FOCUS|ICURSOR_ON|DISABLED|READONLY))
- == (FOCUS|ICURSOR_ON)) && (comboPtr->selFirst == -1) &&
- (comboPtr->insertOffset >= comboPtr->firstOffset) &&
- (comboPtr->insertOffset <= comboPtr->lastOffset)) {
- insertX = textX;
- if (comboPtr->insertOffset > comboPtr->firstOffset) {
- insertX += Blt_TextWidth(comboPtr->font,
- comboPtr->screenText + comboPtr->firstOffset,
- comboPtr->insertOffset - comboPtr->firstOffset);
- }
- if (insertX > (comboPtr->lastX - comboPtr->firstX)) {
- insertX = -1;
- }
- }
-
- /*
- * Text is drawn in (up to) three segments.
- *
- * 1) Any text before the start the selection. 2) The selected text
- * (drawn with a flat border) 3) Any text following the selection.
- * This step will draw the text string if there is no selection.
- */
-
- /* Step 1. Draw any text preceding the selection that's still visible in
- * the viewport. */
- if (comboPtr->selFirst >= comboPtr->firstOffset) {
- int nPixels, len, nBytes;
- int selFirst;
-
- selFirst = comboPtr->selFirst;
- if (selFirst > comboPtr->lastOffset) {
- selFirst = comboPtr->lastOffset;
- }
- len = selFirst - comboPtr->firstOffset;
- nBytes = Blt_MeasureChars(comboPtr->font,
- comboPtr->screenText + comboPtr->firstOffset, len, w,
- TEXT_FLAGS, &nPixels);
- Blt_DrawChars(Tk_Display(comboPtr->tkwin), pixmap, gc, comboPtr->font,
- Tk_Depth(comboPtr->tkwin), 0.0f,
- comboPtr->screenText + comboPtr->firstOffset, nBytes,
- textX, textY);
- textX += nPixels;
- }
- /* Step 2. Draw the selection itself, if it's visible in the
- * viewport. Otherwise step 1 drew as much as we need. */
- if ((comboPtr->selFirst >= 0) &&
- (comboPtr->selFirst <= comboPtr->lastOffset)) {
- Blt_Background bg;
- int nBytes, nPixels;
- int selFirst, selLast;
-
- /* The background of the selection rectangle is different depending
- * whether the widget has focus or not. */
- bg = comboPtr->selectBg;
- selFirst = comboPtr->selFirst;
- if (selFirst < comboPtr->firstOffset) {
- selFirst = comboPtr->firstOffset;
- }
- selLast = comboPtr->selLast;
- if (selLast > comboPtr->lastOffset) {
- selLast = comboPtr->lastOffset;
- }
- nBytes = Blt_MeasureChars(comboPtr->font,
- comboPtr->screenText + selFirst, selLast - selFirst, w,
- TEXT_FLAGS, &nPixels);
- Blt_FillBackgroundRectangle(comboPtr->tkwin, pixmap, bg, textX, 0,
- nPixels, h, 0, TK_RELIEF_FLAT);
- Blt_DrawChars(Tk_Display(comboPtr->tkwin), pixmap, comboPtr->selectGC,
- comboPtr->font, Tk_Depth(comboPtr->tkwin), 0.0f,
- comboPtr->screenText + selFirst, nBytes, textX, textY);
- textX += nPixels;
- }
- /* Step 3. Draw any text following the selection that's visible
- * in the viewport. In the case of no selection, we draw
- * the entire text string. */
- if (comboPtr->selLast < comboPtr->lastOffset) {
- int selLast;
-
- selLast = comboPtr->selLast;
- if (selLast < comboPtr->firstOffset) {
- selLast = comboPtr->firstOffset;
- }
- Blt_DrawChars(Tk_Display(comboPtr->tkwin), pixmap, gc,
- comboPtr->font, Tk_Depth(comboPtr->tkwin), 0.0f,
- comboPtr->screenText + selLast, comboPtr->lastOffset - selLast,
- textX, textY);
- }
- /* Draw the insertion cursor, if one is needed. */
- if (insertX >= 0) {
- int y1, y2;
-
- y1 = 1;
- y2 = h - 2;
- XDrawLine(Tk_Display(comboPtr->tkwin), pixmap, comboPtr->insertGC,
- insertX, y1, insertX, y2);
-#ifdef notdef
- XDrawLine(Tk_Display(comboPtr->tkwin), pixmap, comboPtr->insertGC,
- insertX + 1, y1, insertX + 1, y2);
-#endif
- }
- XCopyArea(comboPtr->display, pixmap, drawable, gc, 0, 0, w, h,
- x, y);
- Tk_FreePixmap(comboPtr->display, pixmap);
-}
-
-static void
-DrawComboEntry(ComboEntry *comboPtr, Drawable drawable, int width, int height)
-{
- Blt_Background bg;
- int x, y, w, h, tx, ty;
- Button *butPtr = &comboPtr->closeButton;
- int closeButtonNeeded;
-
- /* Background (just inside of focus highlight ring). */
- x = y = comboPtr->inset;
- w = width - (2 * comboPtr->inset);
- h = height - (2 * comboPtr->inset);
- if (comboPtr->flags & FOCUS) {
- bg = comboPtr->inFocusBg;
- } else {
- bg = comboPtr->outFocusBg;
- }
- Blt_FillBackgroundRectangle(comboPtr->tkwin, drawable, bg, x, y, w, h, 0,
- TK_RELIEF_FLAT);
-
- /* Label: includes icon and text. */
-
- if (comboPtr->flags & ARROW) {
- w -= comboPtr->arrowWidth;
- }
- closeButtonNeeded = ((comboPtr->flags & CLOSE) && (comboPtr->textLen > 0));
- if (closeButtonNeeded) {
- w -= butPtr->width;
- }
- if (h > comboPtr->entryHeight) {
- y += (h - comboPtr->entryHeight) / 2;
- }
- /* Draw Icon. */
- if (comboPtr->icon != NULL) {
- int ix, iy, iw, ih;
-
- ix = x + IPAD;
- iy = y + YPAD;
- iw = MIN(w, comboPtr->iconWidth);
- ih = MIN(h, comboPtr->iconHeight);
- if (comboPtr->iconHeight < comboPtr->entryHeight) {
- iy += (comboPtr->entryHeight - comboPtr->iconHeight) / 2;
- }
- if ((Blt_IsPicture(IconImage(comboPtr->icon))) &&
- (comboPtr->flags & DISABLED)) {
- Blt_Picture picture;
- Blt_Painter painter;
-
- painter = Blt_GetPainter(comboPtr->tkwin, 1.0);
- picture = Blt_GetPictureFromPictureImage(comboPtr->interp,
- IconImage(comboPtr->icon));
- picture = Blt_GreyscalePicture(picture);
- Blt_PaintPicture(painter, drawable, picture, 0, 0, iw, ih,ix,iy,0);
- Blt_FreePicture(picture);
- } else {
- Tk_RedrawImage(IconImage(comboPtr->icon), 0, 0, iw, ih, drawable,
- ix, iy);
- }
- x += comboPtr->iconWidth;
- w -= comboPtr->iconWidth;
- }
- tx = x + IPAD;
- ty = y + 1;
- if ((w > 0) && (h > 0)) {
-#ifdef notdef
- DrawEntry(comboPtr, drawable, x + IPAD, y + 1, w, h - 2);
- x += comboPtr->entryWidth;
-#endif
- }
- if (comboPtr->flags & DISABLED) {
- bg = comboPtr->disabledBg;
- } else if (comboPtr->flags & ACTIVE_ARROW) {
- bg = comboPtr->activeBg;
- } else {
- bg = comboPtr->normalBg;
- }
- /* Close button. */
- if (closeButtonNeeded) {
- Button *butPtr = &comboPtr->closeButton;
- Blt_Picture picture;
- int bx;
-
- comboPtr->viewWidth -= butPtr->width + comboPtr->inset +
- 2 * (butPtr->borderWidth + butPtr->pad);
- bx = width - (comboPtr->inset + comboPtr->arrowWidth +
- butPtr->width);
- y = comboPtr->inset + comboPtr->arrowPad;
- if (bx < 0) {
- bx = comboPtr->inset;
- }
-
- butPtr->x = bx + butPtr->borderWidth + butPtr->pad;
- butPtr->y = y;
- x += butPtr->width;
- w -= 6;
- if (comboPtr->entryHeight > butPtr->height) {
- butPtr->y += (comboPtr->entryHeight - butPtr->height) / 2;
- }
- if (comboPtr->flags & ACTIVE_CLOSE) {
- if (butPtr->activePicture == NULL) {
- butPtr->activePicture = Blt_PaintDelete(CLOSE_WIDTH,
- CLOSE_HEIGHT,
- butPtr->activeBg,
- butPtr->activeFg);
- }
- picture = butPtr->activePicture;
- } else {
- if (butPtr->normalPicture == NULL) {
- butPtr->normalPicture =
- Blt_PaintDelete(CLOSE_WIDTH, CLOSE_HEIGHT,
- butPtr->normalBg, butPtr->normalFg);
- }
- picture = butPtr->normalPicture;
- }
- if (butPtr->painter == NULL) {
- butPtr->painter = Blt_GetPainter(comboPtr->tkwin, 1.0);
- }
- Blt_PaintPictureWithBlend(butPtr->painter, drawable, picture, 0, 0,
- butPtr->width, butPtr->height, butPtr->x, butPtr->y, 0, 1.0);
- }
- /* Arrow. */
- if (comboPtr->flags & ARROW) {
- XColor *color;
- int bw, bh;
-
- x = width - comboPtr->inset - comboPtr->arrowWidth;
- y = comboPtr->inset;
- if (x < 0) {
- x = comboPtr->inset;
- }
- bw = comboPtr->arrowWidth - 2 * comboPtr->arrowPad;
- bh = h;
- x += comboPtr->arrowPad;
- Blt_FillBackgroundRectangle(comboPtr->tkwin, drawable, bg, x, y,
- bw, bh, comboPtr->arrowBW, comboPtr->arrowRelief);
- if (comboPtr->flags & ACTIVE_ARROW) {
- color = comboPtr->activeColor;
- } else if (comboPtr->flags & DISABLED) {
- color = comboPtr->disabledColor;
- } else {
- color = comboPtr->normalColor;
- }
- x += comboPtr->arrowBW;
- y += comboPtr->arrowBW;
- bw -= 2 * comboPtr->arrowBW;
- bh -= 2 * comboPtr->arrowBW;
- Blt_DrawArrow(comboPtr->display, drawable, color,
- x, y, bw, bh, comboPtr->arrowBW, ARROW_DOWN);
- }
- comboPtr->viewWidth = w;
- if ((w > 0) && (h > 0)) {
- DrawEntry(comboPtr, drawable, tx, ty, w, h - 2);
- }
-
- /* Draw focus highlight ring. */
- if (comboPtr->highlightWidth > 0) {
- GC gc;
-
- if ((comboPtr->flags & (FOCUS|READONLY)) == FOCUS) {
- gc = comboPtr->highlightGC;
- Tk_DrawFocusHighlight(comboPtr->tkwin, gc, comboPtr->highlightWidth,
- drawable);
- } else {
- Blt_DrawFocusBackground(comboPtr->tkwin, comboPtr->normalBg,
- comboPtr->highlightWidth, drawable);
- }
- }
- if ((comboPtr->relief != TK_RELIEF_FLAT) && (comboPtr->borderWidth > 0)) {
- Blt_DrawBackgroundRectangle(comboPtr->tkwin, drawable,
- comboPtr->normalBg, comboPtr->highlightWidth,
- comboPtr->highlightWidth, width - 2 * comboPtr->highlightWidth,
- height - 2 * comboPtr->highlightWidth, comboPtr->borderWidth,
- comboPtr->relief);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayComboEntry --
- *
- * This procedure is invoked to display a comboentry widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the comboentry.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayComboEntry(ClientData clientData)
-{
- ComboEntry *comboPtr = clientData;
- Pixmap drawable;
- int w, h; /* Window width and height. */
-
- comboPtr->flags &= ~REDRAW_PENDING;
- if (comboPtr->tkwin == NULL) {
- return; /* Window destroyed (should not get here) */
- }
-#ifdef notdef
- fprintf(stderr, "Calling DisplayComboEntry(%s)\n",
- Tk_PathName(comboPtr->tkwin));
-#endif
- w = Tk_Width(comboPtr->tkwin);
- h = Tk_Height(comboPtr->tkwin);
- if ((w <= 1) || (h <=1)) {
- /* Don't bother computing the layout until the window size is
- * something reasonable. */
- return;
- }
- if (comboPtr->flags & LAYOUT_PENDING) {
- ComputeGeometry(comboPtr);
- comboPtr->flags |= SCROLL_PENDING;
- }
- if (!Tk_IsMapped(comboPtr->tkwin)) {
- /* The widget's window isn't displayed, so don't bother drawing
- * anything. By getting this far, we've at least computed the
- * coordinates of the comboentry's new layout. */
- return;
- }
- /*
- * Create a pixmap the size of the window for double buffering.
- */
- drawable = Tk_GetPixmap(comboPtr->display, Tk_WindowId(comboPtr->tkwin),
- w, h, Tk_Depth(comboPtr->tkwin));
-#ifdef WIN32
- assert(drawable != None);
-#endif
- DrawComboEntry(comboPtr, drawable, w, h);
- XCopyArea(comboPtr->display, drawable, Tk_WindowId(comboPtr->tkwin),
- comboPtr->textInFocusGC, 0, 0, w, h, 0, 0);
- Tk_FreePixmap(comboPtr->display, drawable);
-
- if (comboPtr->flags & SCROLL_PENDING) {
- if (comboPtr->scrollCmdObjPtr != NULL) {
- Blt_UpdateScrollbar(comboPtr->interp, comboPtr->scrollCmdObjPtr,
- comboPtr->scrollX, comboPtr->scrollX + comboPtr->viewWidth,
- comboPtr->textWidth);
- }
- comboPtr->flags &= ~SCROLL_PENDING;
- }
- if (comboPtr->flags & MODIFIED) {
- GenerateModifiedEvent(comboPtr);
- }
-}
diff --git a/blt3.0.1/src/bltComboMenu.c b/blt3.0.1/src/bltComboMenu.c
deleted file mode 100755
index c04aedc..0000000
--- a/blt3.0.1/src/bltComboMenu.c
+++ /dev/null
@@ -1,6568 +0,0 @@
-
-/*
- * bltComboMenu.c --
- *
- * This module implements a combomenu widget for the BLT toolkit.
- *
- * Copyright 2006 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include "bltBind.h"
-#include "bltImage.h"
-#include "bltPicture.h"
-#include "bltFont.h"
-#include "bltText.h"
-#include "bltChain.h"
-#include "bltHash.h"
-#include "bltBgStyle.h"
-#include "bltPainter.h"
-#include "bltSwitch.h"
-
-static const char emptyString[] = "";
-
-#define MAXSCROLLBARTHICKNESS 100
-
-#define REDRAW_PENDING (1<<0)
-#define LAYOUT_PENDING (1<<1)
-#define UPDATE_PENDING (1<<2)
-#define FOCUS (1<<3)
-#define SCROLLX (1<<4)
-#define SCROLLY (1<<5)
-#define SCROLL_PENDING (SCROLLX|SCROLLY)
-
-#define INSTALL_XSCROLLBAR (1<<8)
-#define INSTALL_YSCROLLBAR (1<<9)
-
-#define RESTRICT_MIN (1<<10)
-#define RESTRICT_MAX (1<<11)
-#define RESTRICT_NONE (0)
-
-#define VAR_FLAGS (TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS)
-
-#define PIXMAPX(cm, wx) ((wx) - (cm)->xOffset)
-#define PIXMAPY(cm, wy) ((wy) - (cm)->yOffset)
-
-#define SCREENX(cm, wx) ((wx) - (cm)->xOffset + (cm)->borderWidth)
-#define SCREENY(cm, wy) ((wy) - (cm)->yOffset + (cm)->borderWidth)
-
-#define WORLDX(cm, sx) ((sx) - (cm)->borderWidth + (cm)->xOffset)
-#define WORLDY(cm, sy) ((sy) - (cm)->borderWidth + (cm)->yOffset)
-
-#define VPORTWIDTH(cm) \
- (Tk_Width((cm)->tkwin) - 2 * (cm)->borderWidth - (cm)->yScrollbarWidth)
-#define VPORTHEIGHT(cm) \
- (Tk_Height((cm)->tkwin) - 2 * (cm)->borderWidth - (cm)->xScrollbarHeight)
-
-#define FCLAMP(x) ((((x) < 0.0) ? 0.0 : ((x) > 1.0) ? 1.0 : (x)))
-#define CLAMP(x,min,max) ((((x) < (min)) ? (min) : ((x) > (max)) ? (max) : (x)))
-
-#define ITEM_IPAD 3
-#define ITEM_XPAD 2
-#define ITEM_YPAD 1
-#define ITEM_SEP_HEIGHT 6
-#define ITEM_L_IND_WIDTH 19
-#define ITEM_L_IND_HEIGHT 19
-#define ITEM_R_IND_WIDTH 13
-#define ITEM_R_IND_HEIGHT 13
-
-#define ITEM_MAP (1<<1) /* Item needs to be remapped */
-#define ITEM_REDRAW (1<<2) /* Item needs to be redrawn. */
-#define ITEM_SELECTED (1<<4) /* Radiobutton/checkbutton is
- * selected. */
-
-/* Item state. */
-#define ITEM_NORMAL (1<<5) /* Draw item normally. */
-#define ITEM_DISABLED (1<<6) /* Item is disabled. */
-#define ITEM_STATE_MASK ((ITEM_DISABLED)|(ITEM_NORMAL))
-
-/* Item type. */
-#define ITEM_BUTTON (1<<9) /* Item is command button. */
-#define ITEM_RADIOBUTTON (1<<10) /* Item is radiobutton. */
-#define ITEM_CHECKBUTTON (1<<11) /* Item is checkbutton. */
-#define ITEM_CASCADE (1<<12) /* Item is cascade. */
-#define ITEM_SEPARATOR (1<<13) /* Item is separator. */
-#define ITEM_TYPE_MASK ((ITEM_BUTTON)|(ITEM_RADIOBUTTON)|(ITEM_CHECKBUTTON)|\
- (ITEM_CASCADE)|(ITEM_SEPARATOR))
-
-#define DEF_COMBO_BORDERWIDTH "1"
-#define DEF_COMBO_CURSOR ((char *)NULL)
-#define DEF_COMBO_HEIGHT "0"
-#define DEF_COMBO_ICON_VARIABLE ((char *)NULL)
-#define DEF_COMBO_POSTCOMMAND ((char *)NULL)
-#define DEF_COMBO_RELIEF "solid"
-#define DEF_COMBO_SCROLLBAR ((char *)NULL)
-#define DEF_COMBO_SCROLL_CMD ((char *)NULL)
-#define DEF_COMBO_SCROLL_INCR "2"
-#define DEF_COMBO_TAKE_FOCUS "1"
-#define DEF_COMBO_TEXT_VARIABLE ((char *)NULL)
-#define DEF_COMBO_UNPOSTCOMMAND ((char *)NULL)
-#define DEF_COMBO_WIDTH "0"
-#define DEF_COMBO_CHECKBUTTON_FILL_COLOR (char *)NULL
-#define DEF_COMBO_CHECKBUTTON_OUTLINE_COLOR (char *)NULL
-#define DEF_COMBO_CHECKBUTTON_COLOR STD_INDICATOR_COLOR
-#define DEF_COMBO_CHECKBUTTON_SIZE "12"
-#define DEF_COMBO_RADIOBUTTON_FILL_COLOR RGB_WHITE
-#define DEF_COMBO_RADIOBUTTON_OUTLINE_COLOR RGB_BLACK
-#define DEF_COMBO_RADIOBUTTON_COLOR STD_INDICATOR_COLOR
-#define DEF_COMBO_RADIOBUTTON_SIZE "12"
-
-#define DEF_ITEM_ACCELERATOR ((char *)NULL)
-#define DEF_ITEM_BITMAP ((char *)NULL)
-#define DEF_ITEM_COMMAND ((char *)NULL)
-#define DEF_ITEM_DATA ((char *)NULL)
-#define DEF_ITEM_ICON ((char *)NULL)
-#define DEF_ITEM_IMAGE ((char *)NULL)
-#define DEF_ITEM_INDENT "0"
-#define DEF_ITEM_MENU ((char *)NULL)
-#define DEF_ITEM_OFF_VALUE "0"
-#define DEF_ITEM_ON_VALUE "1"
-#define DEF_ITEM_STATE "normal"
-#define DEF_ITEM_STYLE "default"
-#define DEF_ITEM_TAGS ((char *)NULL)
-#define DEF_ITEM_TEXT ((char *)NULL)
-#define DEF_ITEM_TIP ((char *)NULL)
-#define DEF_ITEM_TYPE "command"
-#define DEF_ITEM_UNDERLINE "-1"
-#define DEF_ITEM_VALUE ((char *)NULL)
-#define DEF_ITEM_VARIABLE ((char *)NULL)
-#define DEF_STYLE_ACCEL_ACTIVE_FG RGB_WHITE
-#define DEF_STYLE_ACCEL_FG RGB_BLACK
-#define DEF_STYLE_ACCEL_FONT STD_FONT_SMALL
-#define DEF_STYLE_ACTIVE_BG RGB_SKYBLUE4
-#define DEF_STYLE_ACTIVE_FG RGB_WHITE
-#define DEF_STYLE_ACTIVE_RELIEF "flat"
-#define DEF_STYLE_BG RGB_WHITE
-#define DEF_STYLE_BORDERWIDTH "0"
-#define DEF_STYLE_DISABLED_ACCEL_FG STD_DISABLED_FOREGROUND
-#define DEF_STYLE_DISABLED_BG DISABLED_BACKGROUND
-#define DEF_STYLE_DISABLED_FG DISABLED_FOREGROUND
-#define DEF_STYLE_FG RGB_BLACK
-#define DEF_STYLE_FONT STD_FONT_SMALL
-#define DEF_STYLE_IND_FILL_COLOR (char *)NULL
-#define DEF_STYLE_IND_OUTLINE_COLOR (char *)NULL
-#define DEF_STYLE_IND_COLOR (char *)NULL
-#define DEF_STYLE_IND_SIZE "12"
-#define DEF_STYLE_RELIEF "flat"
-#define DISABLED_BACKGROUND RGB_GREY90
-#define DISABLED_FOREGROUND RGB_GREY70
-
-
-static Blt_OptionFreeProc FreeStyleProc;
-static Blt_OptionParseProc ObjToStyleProc;
-static Blt_OptionPrintProc StyleToObjProc;
-static Blt_CustomOption styleOption = {
- ObjToStyleProc, StyleToObjProc, FreeStyleProc, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeTagsProc;
-static Blt_OptionParseProc ObjToTagsProc;
-static Blt_OptionPrintProc TagsToObjProc;
-static Blt_CustomOption tagsOption = {
- ObjToTagsProc, TagsToObjProc, FreeTagsProc, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToTypeProc;
-static Blt_OptionPrintProc TypeToObjProc;
-static Blt_CustomOption typeOption = {
- ObjToTypeProc, TypeToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeLabelProc;
-static Blt_OptionParseProc ObjToLabelProc;
-static Blt_OptionPrintProc LabelToObjProc;
-static Blt_CustomOption labelOption = {
- ObjToLabelProc, LabelToObjProc, FreeLabelProc, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeIconProc;
-static Blt_OptionParseProc ObjToIconProc;
-static Blt_OptionPrintProc IconToObjProc;
-static Blt_CustomOption iconOption = {
- ObjToIconProc, IconToObjProc, FreeIconProc, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeTraceVarProc;
-static Blt_OptionParseProc ObjToTraceVarProc;
-static Blt_OptionPrintProc TraceVarToObjProc;
-static Blt_CustomOption traceVarOption = {
- ObjToTraceVarProc, TraceVarToObjProc, FreeTraceVarProc, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToStateProc;
-static Blt_OptionPrintProc StateToObjProc;
-static Blt_CustomOption stateOption = {
- ObjToStateProc, StateToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToRestrictProc;
-static Blt_OptionPrintProc RestrictToObjProc;
-static Blt_CustomOption restrictOption = {
- ObjToRestrictProc, RestrictToObjProc, NULL, (ClientData)0
-};
-
-extern Blt_CustomOption bltLimitsOption;
-
-typedef struct _ComboMenu ComboMenu;
-
-/*
- * Icon --
- *
- * Since instances of the same Tk image can be displayed in different
- * windows with possibly different color palettes, Tk internally stores
- * each instance in a linked list. But if the instances are used in the
- * same widget and therefore use the same color palette, this adds a lot
- * of overhead, especially when deleting instances from the linked list.
- *
- * For the combomenu widget, we never need more than a single instance of
- * an image, regardless of how many times it's used. Cache the image,
- * maintaining a reference count for each image used in the widget. It's
- * likely that the combomenu widget will use many instances of the same
- * image.
- */
-
-typedef struct _Icon {
- Tk_Image tkImage; /* The Tk image being cached. */
- Blt_HashEntry *hPtr; /* Hash table pointer to the image. */
- int refCount; /* Reference count for this image. */
- short int width, height; /* Dimensions of the cached image. */
-} *Icon;
-
-#define IconHeight(i) ((i)->height)
-#define IconWidth(i) ((i)->width)
-#define IconImage(i) ((i)->tkImage)
-#define IconName(i) (Blt_Image_Name(IconImage(i)))
-
-typedef struct {
- const char *name;
- Blt_HashEntry *hPtr;
- ComboMenu *comboPtr;
- int refCount; /* Indicates if the style is currently
- * in use in the combomenu. */
- int borderWidth;
- int relief;
- int activeRelief;
- int reqIndWidth;
-
- Blt_Background normalBg;
- Blt_Background activeBg;
- Blt_Background disabledBg;
-
- XColor *normalFgColor;
- XColor *activeFgColor;
- XColor *disabledFgColor;
-
- Blt_Font accelFont; /* Font of accelerator text. */
- XColor *accelNormalColor; /* Color of accelerator text. */
- XColor *accelDisabledColor; /* Color of accelerator text. */
- XColor *accelActiveColor; /* Color of accelerator background. */
-
- Blt_Font labelFont; /* Font of the label */
- XColor *labelNormalColor; /* Color of label text. */
- XColor *labelDisabledColor; /* Color of label background. */
- XColor *labelActiveColor; /* Color of label background. */
-
- /* Radiobuttons, checkbuttons, and cascades. */
- Blt_Picture radiobutton[3];
- Blt_Picture checkbutton[3];
-
- XColor *indOutlineColor;
- XColor *indFillColor;
- XColor *indColor;
-
- GC accelActiveGC;
- GC accelDisabledGC;
- GC accelNormalGC;
- GC labelActiveGC;
- GC labelDisabledGC;
- GC labelNormalGC;
-} Style;
-
-static Blt_ConfigSpec styleConfigSpecs[] =
-{
- {BLT_CONFIG_FONT, "-acceleratorfont", (char *)NULL, (char *)NULL,
- DEF_STYLE_ACCEL_FONT, Blt_Offset(Style, accelFont), 0},
- {BLT_CONFIG_COLOR, "-acceleratorforeground", (char *)NULL, (char *)NULL,
- DEF_STYLE_ACCEL_FG, Blt_Offset(Style, accelNormalColor), 0},
- {BLT_CONFIG_COLOR, "-activeacceleratorforeground", (char *)NULL,
- (char *)NULL, DEF_STYLE_ACCEL_ACTIVE_FG,
- Blt_Offset(Style, accelActiveColor), 0},
- {BLT_CONFIG_BACKGROUND, "-activebackground", (char *)NULL, (char *)NULL,
- DEF_STYLE_ACTIVE_BG, Blt_Offset(Style, activeBg), 0},
- {BLT_CONFIG_COLOR, "-activeforeground", (char *)NULL, (char *)NULL,
- DEF_STYLE_ACTIVE_FG, Blt_Offset(Style, labelActiveColor), 0},
- {BLT_CONFIG_RELIEF, "-activerelief", (char *)NULL, (char *)NULL,
- DEF_STYLE_ACTIVE_RELIEF, Blt_Offset(Style, activeRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-background", (char *)NULL, (char *)NULL,
- DEF_STYLE_BG, Blt_Offset(Style, normalBg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_SYNONYM, "-bg", (char *)NULL, (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", (char *)NULL, (char *)NULL,
- DEF_STYLE_BORDERWIDTH, Blt_Offset(Style, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-disabledacceleratorforeground", (char *)NULL,
- (char *)NULL, DEF_STYLE_DISABLED_ACCEL_FG,
- Blt_Offset(Style, accelDisabledColor), 0},
- {BLT_CONFIG_BACKGROUND, "-disabledbackground", (char *)NULL, (char *)NULL,
- DEF_STYLE_DISABLED_BG, Blt_Offset(Style, disabledBg), 0},
- {BLT_CONFIG_COLOR, "-disabledforeground", (char *)NULL, (char *)NULL,
- DEF_STYLE_DISABLED_FG, Blt_Offset(Style, labelDisabledColor), 0},
- {BLT_CONFIG_SYNONYM, "-fg", (char *)NULL, (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-foreground", (char *)NULL, (char *)NULL, DEF_STYLE_FG,
- Blt_Offset(Style, labelNormalColor), 0},
- {BLT_CONFIG_FONT, "-font", (char *)NULL, (char *)NULL, DEF_STYLE_FONT,
- Blt_Offset(Style, labelFont), 0},
- {BLT_CONFIG_COLOR, "-indicatorfillcolor", (char *)NULL, (char *)NULL,
- DEF_STYLE_IND_FILL_COLOR, Blt_Offset(Style, indFillColor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-indicatoroutlinecolor", (char *)NULL, (char *)NULL,
- DEF_STYLE_IND_OUTLINE_COLOR, Blt_Offset(Style, indOutlineColor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-indicatorcolor", (char *)NULL, (char *)NULL,
- DEF_STYLE_IND_COLOR, Blt_Offset(Style, indColor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-indicatorsize", (char *)NULL, (char *)NULL,
- DEF_STYLE_IND_SIZE, Blt_Offset(Style, reqIndWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-relief", (char *)NULL, (char *)NULL,
- DEF_STYLE_RELIEF, Blt_Offset(Style, relief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-/*
- *
- * [left indicator] [icon] [label] [right indicator/accel] [scrollbar]
- *
- * left indicator: checkbutton or radiobutton entries.
- * icon: all entries.
- * label: all entries.
- * accel: checkbutton, radiobutton, or button entries.
- * right indicator: cascade item only.
- */
-typedef struct {
- ComboMenu *comboPtr; /* Combomenu containing this item. */
- long index; /* Index of the item (numbered from 0)*/
- int xWorld, yWorld; /* Upper left world-coordinate of item
- * in menu. */
- Style *stylePtr; /* Style used by this item. */
- unsigned int flags; /* Contains various bits of
- * information about the item, such as
- * type, state. */
- Blt_ChainLink link;
- int relief;
- int underline; /* Underlined character. */
- int indent; /* # of pixels to indent the icon. */
- Icon image; /* If non-NULL, image to be displayed
- * instead of text label. */
- Icon icon; /* Button, RadioButton, and
- * CheckButton entries. */
- const char *label; /* Label to be displayed. */
- const char *accel; /* Accelerator text. May be NULL.*/
- Tcl_Obj *cmdObjPtr; /* Command to be invoked when item is
- * clicked. */
- Tcl_Obj *dataObjPtr; /* User-data associated with this
- * item. */
- Tcl_Obj *variableObjPtr; /* Name of TCL variable. If non-NULL,
- * this variable will be set to the
- * value string of the selected
- * item. */
- Tcl_Obj *valueObjPtr; /* Radiobutton value. */
-
- /* Checkbutton on and off values. */
- Tcl_Obj *onValueObjPtr; /* Checkbutton on-value. */
- Tcl_Obj *offValueObjPtr; /* Checkbutton off-value. */
-
- /* Cascade menu. */
- Tcl_Obj *menuObjPtr; /* Name of the sub-menu. */
-
- Tcl_Obj *tagsObjPtr;
-
- Tcl_Obj *tipObjPtr;
-
- short int labelWidth, labelHeight;
- short int iconWidth, iconHeight;
- short int leftIndWidth, leftIndHeight;
- short int rightIndWidth, rightIndHeight;
- short int width, height;
-
-} Item;
-
-static Blt_ConfigSpec itemConfigSpecs[] =
-{
- {BLT_CONFIG_STRING, "-accelerator", (char *)NULL, (char *)NULL,
- DEF_ITEM_ACCELERATOR, Blt_Offset(Item, accel), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-command", (char *)NULL, (char *)NULL, DEF_ITEM_COMMAND,
- Blt_Offset(Item, cmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-data", (char *)NULL, (char *)NULL, DEF_ITEM_DATA,
- Blt_Offset(Item, dataObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-icon", (char *)NULL, (char *)NULL, DEF_ITEM_ICON,
- Blt_Offset(Item, icon), BLT_CONFIG_NULL_OK, &iconOption},
- {BLT_CONFIG_CUSTOM, "-image", (char *)NULL, (char *)NULL, DEF_ITEM_IMAGE,
- Blt_Offset(Item, image), BLT_CONFIG_NULL_OK, &iconOption},
- {BLT_CONFIG_PIXELS_NNEG, "-indent", (char *)NULL, (char *)NULL,
- DEF_ITEM_INDENT, Blt_Offset(Item, indent), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-menu", (char *)NULL, (char *)NULL, DEF_ITEM_MENU,
- Blt_Offset(Item, menuObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-offvalue", (char *)NULL, (char *)NULL,
- DEF_ITEM_OFF_VALUE, Blt_Offset(Item, offValueObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-onvalue", (char *)NULL, (char *)NULL, DEF_ITEM_ON_VALUE,
- Blt_Offset(Item, onValueObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-state", (char *)NULL, (char *)NULL, DEF_ITEM_STATE,
- Blt_Offset(Item, flags), BLT_CONFIG_DONT_SET_DEFAULT, &stateOption},
- {BLT_CONFIG_CUSTOM, "-style", (char *)NULL, (char *)NULL, DEF_ITEM_STYLE,
- Blt_Offset(Item, stylePtr), 0, &styleOption},
- {BLT_CONFIG_CUSTOM, "-tags", (char *)NULL, (char *)NULL,
- DEF_ITEM_TAGS, 0, BLT_CONFIG_NULL_OK, &tagsOption},
- {BLT_CONFIG_CUSTOM, "-text", (char *)NULL, (char *)NULL, DEF_ITEM_TEXT,
- Blt_Offset(Item, label), BLT_CONFIG_NULL_OK, &labelOption},
- {BLT_CONFIG_OBJ, "-tooltip", (char *)NULL, (char *)NULL, DEF_ITEM_TIP,
- Blt_Offset(Item, tipObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-type", (char *)NULL, (char *)NULL, DEF_ITEM_TYPE,
- Blt_Offset(Item, flags), BLT_CONFIG_DONT_SET_DEFAULT, &typeOption},
- {BLT_CONFIG_INT, "-underline", (char *)NULL, (char *)NULL,
- DEF_ITEM_UNDERLINE, Blt_Offset(Item, underline),
- BLT_CONFIG_DONT_SET_DEFAULT },
- {BLT_CONFIG_OBJ, "-value", (char *)NULL, (char *)NULL, DEF_ITEM_VALUE,
- Blt_Offset(Item, valueObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-variable", (char *)NULL, (char *)NULL,
- DEF_ITEM_VARIABLE, Blt_Offset(Item, variableObjPtr), BLT_CONFIG_NULL_OK,
- &traceVarOption},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-struct _ComboMenu {
-
- /*
- * This works around a bug in the Tk API. Under Win32, Tk tries to
- * read the widget record of toplevel windows (TopLevel or Frame widget),
- * to get its menu name field. What this means is that we must carefully
- * arrange the fields of this widget so that the menuName field is at the
- * same offset in the structure.
- */
-
- Tk_Window tkwin; /* Window that embodies the frame.
- * NULL means that the window has been
- * destroyed but the data structures
- * haven't yet been cleaned up. */
- Display *display; /* Display containing widget. Used,
- * among other things, so that
- * resources can be freed even after
- * tkwin has gone away. */
- Tcl_Interp *interp; /* Interpreter associated with widget.
- * Used to delete widget command. */
- Tcl_Command cmdToken; /* Token for widget's command. */
- Tcl_Obj *postCmdObjPtr; /* If non-NULL, command to be executed
- * when this menu is posted. */
- Tcl_Obj *unpostCmdObjPtr; /* If non-NULL, command to be executed
- * when this menu is posted. */
- unsigned int flags;
- Tcl_Obj *iconVarObjPtr; /* Name of TCL variable. If non-NULL,
- * this variable will be set to the
- * name of the Tk image representing
- * the icon of the selected item. */
- Tcl_Obj *textVarObjPtr; /* Name of TCL variable. If non-NULL,
- * this variable will be set to the
- * text string of the label of the
- * selected item. */
- Tcl_Obj *takeFocusObjPtr; /* Value of -takefocus option; not
- * used in the C code, but used by
- * keyboard * traversal scripts. */
- char *menuName; /* Textual description of menu to use
- * for menubar. Malloc-ed, may be
- * NULL. */
- Tk_Cursor cursor; /* Current cursor for window or None. */
-
- Tk_Anchor anchor;
-
- Blt_Limits reqWidth, reqHeight;
- int relief;
- int borderWidth;
-
- Style defStyle; /* Default style. */
-
- int parentWidth;
- int normalWidth, normalHeight;
-
- int xScrollUnits, yScrollUnits;
-
- /* Names of scrollbars to embed into the widget window. */
- Tcl_Obj *xScrollbarObjPtr, *yScrollbarObjPtr;
-
- /* Commands to control horizontal and vertical scrollbars. */
- Tcl_Obj *xScrollCmdObjPtr, *yScrollCmdObjPtr;
-
- Blt_HashTable tagTable; /* Table of tags. */
- Blt_HashTable labelTable; /* Table of labels (hashtables). */
- Blt_HashTable iconTable; /* Table of icons. */
-
- Blt_Chain chain;
-
- Item *activePtr; /* If non-NULL, item that is currently
- * active. If a cascade item, a
- * submenu may be posted. */
- Item *postedPtr;
-
- Item *firstPtr, *lastPtr; /* Defines the range of visible
- * items. */
-
- int xOffset, yOffset; /* Scroll offsets of viewport in
- * world. */
- int worldWidth, worldHeight; /* Dimension of entire menu. */
-
- Tk_Window xScrollbar; /* Horizontal scrollbar to be used if
- * necessary. If NULL, no x-scrollbar
- * is used. */
- Tk_Window yScrollbar; /* Vertical scrollbar to be used if
- * necessary. If NULL, no y-scrollbar
- * is used. */
-
- short int yScrollbarWidth, xScrollbarHeight;
- short int leftIndWidth, rightIndWidth;
- short int labelWidth, iconWidth;
-
- Blt_HashTable styleTable; /* Table of styles used. */
-
- Icon rbIcon;
- Icon cbIcon;
- Icon casIcon;
-
- XColor *checkButtonFillColor;
- XColor *checkButtonOutlineColor;
- XColor *checkButtonColor;
- int checkButtonReqSize;
-
- XColor *radioButtonFillColor;
- XColor *radioButtonOutlineColor;
- XColor *radioButtonColor;
- int radioButtonReqSize;
-
- /*
- * Scanning Information:
- */
- int scanAnchorX; /* Horizontal scan anchor in screen
- * x-coordinates. */
- int scanX; /* x-offset of the start of the
- * horizontal scan in world
- * coordinates.*/
- int scanAnchorY; /* Vertical scan anchor in screen
- * y-coordinates. */
- int scanY; /* y-offset of the start of the
- * vertical scan in world
- * coordinates.*/
- short int width, height;
- Blt_Painter painter;
-};
-
-static Blt_ConfigSpec comboConfigSpecs[] =
-{
- {BLT_CONFIG_FONT, "-acceleratorfont", "acceleratorFont", "AcceleratorFont",
- DEF_STYLE_ACCEL_FONT, Blt_Offset(ComboMenu, defStyle.accelFont), 0},
- {BLT_CONFIG_COLOR, "-acceleratorforeground", "acceleratorForeground",
- "AcceleratorForeground", DEF_STYLE_ACCEL_FG,
- Blt_Offset(ComboMenu, defStyle.accelNormalColor), 0},
- {BLT_CONFIG_COLOR, "-activeacceleratorforeground",
- "activeAcceleratorForeground", "ActiveAcceleratorForeground",
- DEF_STYLE_ACCEL_ACTIVE_FG,
- Blt_Offset(ComboMenu, defStyle.accelActiveColor), 0},
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_STYLE_ACTIVE_BG,
- Blt_Offset(ComboMenu, defStyle.activeBg), 0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "ActiveForeground", DEF_STYLE_ACTIVE_FG,
- Blt_Offset(ComboMenu, defStyle.labelActiveColor), 0},
- {BLT_CONFIG_RELIEF, "-activerelief", "activeRelief", "ActiveRelief",
- DEF_STYLE_ACTIVE_RELIEF, Blt_Offset(ComboMenu, defStyle.activeRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_STYLE_BG, Blt_Offset(ComboMenu, defStyle.normalBg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_COMBO_BORDERWIDTH, Blt_Offset(ComboMenu, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", DEF_COMBO_CURSOR,
- Blt_Offset(ComboMenu, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-disabledacceleratorforeground",
- "disabledAcceleratorForeground", "DisabledAcceleratorForeground",
- DEF_STYLE_DISABLED_ACCEL_FG,
- Blt_Offset(ComboMenu, defStyle.accelDisabledColor), 0},
- {BLT_CONFIG_BACKGROUND, "-disabledbackground", "disabledBackground",
- "DisabledBackground", DEF_STYLE_DISABLED_BG,
- Blt_Offset(ComboMenu, defStyle.disabledBg), 0},
- {BLT_CONFIG_COLOR, "-disabledforeground", "disabledForeground",
- "DisabledForeground", DEF_STYLE_DISABLED_FG,
- Blt_Offset(ComboMenu, defStyle.labelDisabledColor), 0},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_STYLE_FG, Blt_Offset(ComboMenu, defStyle.labelNormalColor), 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_STYLE_FONT,
- Blt_Offset(ComboMenu, defStyle.labelFont), 0},
- {BLT_CONFIG_CUSTOM, "-height", "height", "Height", DEF_COMBO_HEIGHT,
- Blt_Offset(ComboMenu, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT,
- &bltLimitsOption},
- {BLT_CONFIG_OBJ, "-iconvariable", "iconVariable", "IconVariable",
- DEF_COMBO_ICON_VARIABLE, Blt_Offset(ComboMenu, iconVarObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-itemborderwidth", "itemBorderWidth",
- "ItemBorderWidth", DEF_STYLE_BORDERWIDTH,
- Blt_Offset(ComboMenu, defStyle.borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-postcommand", "postCommand", "PostCommand",
- DEF_COMBO_POSTCOMMAND, Blt_Offset(ComboMenu, postCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_COMBO_RELIEF,
- Blt_Offset(ComboMenu, relief), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-restrictwidth", "restrictWidth", "RestrictWidth",
- (char *)NULL, Blt_Offset(ComboMenu, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- &restrictOption},
- {BLT_CONFIG_OBJ, "-textvariable", "textVariable", "TextVariable",
- DEF_COMBO_TEXT_VARIABLE, Blt_Offset(ComboMenu, textVarObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-xscrollbar", "xScrollbar", "Scrollbar",
- DEF_COMBO_SCROLLBAR, Blt_Offset(ComboMenu, xScrollbarObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
- DEF_COMBO_SCROLL_CMD, Blt_Offset(ComboMenu, xScrollCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_POS, "-xscrollincrement", "xScrollIncrement",
- "ScrollIncrement", DEF_COMBO_SCROLL_INCR,
- Blt_Offset(ComboMenu, xScrollUnits), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-yscrollbar", "yScrollbar", "Scrollbar",
- DEF_COMBO_SCROLLBAR, Blt_Offset(ComboMenu, yScrollbarObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
- DEF_COMBO_SCROLL_CMD, Blt_Offset(ComboMenu, yScrollCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_POS, "-yscrollincrement", "yScrollIncrement",
- "ScrollIncrement", DEF_COMBO_SCROLL_INCR,
- Blt_Offset(ComboMenu, yScrollUnits),BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-takefocus", "takeFocus", "TakeFocus",
- DEF_COMBO_TAKE_FOCUS, Blt_Offset(ComboMenu, takeFocusObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-unpostcommand", "unpostCommand", "UnpostCommand",
- DEF_COMBO_UNPOSTCOMMAND, Blt_Offset(ComboMenu, unpostCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-width", "width", "Width", DEF_COMBO_WIDTH,
- Blt_Offset(ComboMenu, reqWidth), BLT_CONFIG_DONT_SET_DEFAULT,
- &bltLimitsOption},
-#ifdef notdef
- {BLT_CONFIG_CUSTOM, "-radioimage", (char *)NULL, (char *)NULL,
- DEF_ITEM_IMAGE, Blt_Offset(ComboMenu, rbIcon), BLT_CONFIG_NULL_OK,
- &iconOption},
- {BLT_CONFIG_CUSTOM, "-checkimage", (char *)NULL, (char *)NULL,
- DEF_ITEM_IMAGE, Blt_Offset(ComboMenu, cbIcon), BLT_CONFIG_NULL_OK,
- &iconOption},
- {BLT_CONFIG_CUSTOM, "-cascadeimage", (char *)NULL, (char *)NULL,
- DEF_ITEM_IMAGE, Blt_Offset(ComboMenu, casIcon), BLT_CONFIG_NULL_OK,
- &iconOption},
-#endif
- {BLT_CONFIG_COLOR, "-checkbuttonfillcolor", (char *)NULL, (char *)NULL,
- DEF_COMBO_CHECKBUTTON_FILL_COLOR,
- Blt_Offset(ComboMenu, checkButtonFillColor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-checkbuttonoutlinecolor", (char *)NULL, (char *)NULL,
- DEF_COMBO_CHECKBUTTON_OUTLINE_COLOR,
- Blt_Offset(ComboMenu, checkButtonOutlineColor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-checkbuttoncolor", (char *)NULL, (char *)NULL,
- DEF_COMBO_CHECKBUTTON_COLOR, Blt_Offset(ComboMenu, checkButtonColor),0},
- {BLT_CONFIG_PIXELS_NNEG, "-checkbuttonsize", (char *)NULL, (char *)NULL,
- DEF_COMBO_CHECKBUTTON_SIZE, Blt_Offset(ComboMenu, checkButtonReqSize),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-radiobuttonfillcolor", (char *)NULL, (char *)NULL,
- DEF_COMBO_RADIOBUTTON_FILL_COLOR,
- Blt_Offset(ComboMenu, radioButtonFillColor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-radiobuttonoutlinecolor", (char *)NULL, (char *)NULL,
- DEF_COMBO_RADIOBUTTON_OUTLINE_COLOR,
- Blt_Offset(ComboMenu, radioButtonOutlineColor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-radiobuttoncolor", (char *)NULL, (char *)NULL,
- DEF_COMBO_RADIOBUTTON_COLOR, Blt_Offset(ComboMenu, radioButtonColor),0},
- {BLT_CONFIG_PIXELS_NNEG, "-radiobuttonsize", (char *)NULL, (char *)NULL,
- DEF_COMBO_RADIOBUTTON_SIZE, Blt_Offset(ComboMenu, radioButtonReqSize),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-/*
- * ItemIterator --
- *
- * Items may be tagged with strings. An item may have many tags. The
- * same tag may be used for many items.
- *
- */
-
-typedef enum {
- ITER_SINGLE, ITER_ALL, ITER_TAG, ITER_TYPE, ITER_PATTERN
-} IteratorType;
-
-typedef struct _Iterator {
- ComboMenu *comboPtr; /* ComboMenu that we're iterating
- * over. */
-
- IteratorType type; /* Type of iteration:
- * ITER_TAG By item tag.
- * ITER_ALL By every item.
- * ITER_SINGLE Single item: either
- * tag or index.
- * ITER_TYPE Over a single item
- * type.
- */
-
- Item *startPtr, *last; /* Starting and ending item. Starting
- * point of search, saved if iterator
- * is reused. Used for ITER_ALL and
- * ITER_SINGLE searches. */
- Item *endPtr; /* Ending item (inclusive). */
- Item *nextPtr; /* Next item. */
- int itemType; /* For tag-based searches. */
- char *tagName; /* If non-NULL, is the tag that we are
- * currently iterating over. */
-
- Blt_HashTable *tablePtr; /* Pointer to tag hash table. */
-
- Blt_HashSearch cursor; /* Search iterator for tag hash
- * table. */
- Blt_ChainLink link;
-} ItemIterator;
-
-static Tk_GeomRequestProc ScrollbarGeometryProc;
-static Tk_GeomLostSlaveProc ScrollbarCustodyProc;
-static Tk_GeomMgr comboMgrInfo = {
- (char *)"combomenu", /* Name of geometry manager used by
- * winfo. */
- ScrollbarGeometryProc, /* Procedure to for new geometry
- * requests. */
- ScrollbarCustodyProc, /* Procedure when scrollbar is taken
- * away. */
-};
-
-static Blt_SwitchParseProc TypeSwitch;
-static Blt_SwitchCustom typeSwitch = {
- TypeSwitch, NULL, NULL,
-};
-static Blt_SwitchParseProc ItemSwitch;
-static Blt_SwitchCustom itemSwitch = {
- ItemSwitch, NULL, NULL,
-};
-
-#define FIND_DECREASING (1<<0)
-#define FIND_UNDERLINE (1<<1)
-#define FIND_GLOB 1
-#define FIND_REGEXP 2
-
-typedef struct {
- unsigned int mask;
- int search;
- int type;
- Item *fromPtr;
-} FindSwitches;
-
-static Blt_SwitchSpec findSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-from", "item",
- Blt_Offset(FindSwitches, fromPtr), 0, 0, &itemSwitch},
- {BLT_SWITCH_BITMASK, "-decreasing", "",
- Blt_Offset(FindSwitches, mask), 0, FIND_DECREASING},
- {BLT_SWITCH_VALUE, "-glob", "",
- Blt_Offset(FindSwitches, search), 0, FIND_GLOB},
- {BLT_SWITCH_VALUE, "-regexp", "",
- Blt_Offset(FindSwitches, search), 0, FIND_REGEXP},
- {BLT_SWITCH_CUSTOM, "-type", "type",
- Blt_Offset(FindSwitches, type), 0, 0, &typeSwitch},
- {BLT_SWITCH_BITMASK, "-underline", "",
- Blt_Offset(FindSwitches, mask), 0, FIND_UNDERLINE},
- {BLT_SWITCH_END}
-};
-
-typedef int (ComboMenuCmdProc)(ComboMenu *comboPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-static int GetItemIterator(Tcl_Interp *interp, ComboMenu *comboPtr,
- Tcl_Obj *objPtr, ItemIterator *iterPtr);
-static int GetItemFromObj(Tcl_Interp *interp, ComboMenu *comboPtr,
- Tcl_Obj *objPtr, Item **itemPtrPtr);
-
-static Tcl_IdleProc ConfigureScrollbarsProc;
-static Tcl_IdleProc DisplayItem;
-static Tcl_IdleProc DisplayComboMenu;
-static Tcl_FreeProc DestroyComboMenu;
-static Tk_EventProc ScrollbarEventProc;
-static Tk_EventProc ComboMenuEventProc;
-static Tcl_ObjCmdProc ComboMenuInstCmdProc;
-static Tcl_CmdDeleteProc ComboMenuInstCmdDeletedProc;
-static Tcl_VarTraceProc ItemVarTraceProc;
-static Tk_ImageChangedProc IconChangedProc;
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Tells the Tk dispatcher to call the combomenu display routine at the
- * next idle point. This request is made only if the window is displayed
- * and no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(ComboMenu *comboPtr)
-{
- if ((comboPtr->tkwin != NULL) && !(comboPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayComboMenu, comboPtr);
- comboPtr->flags |= REDRAW_PENDING;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedrawItem --
- *
- * Tells the Tk dispatcher to call the combomenu display routine at the
- * next idle point. This request is made only if the window is displayed
- * and no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedrawItem(Item *itemPtr)
-{
- ComboMenu *comboPtr;
-
- comboPtr = itemPtr->comboPtr;
- if ((comboPtr->tkwin != NULL) &&
- ((comboPtr->flags & REDRAW_PENDING) == 0) &&
- ((itemPtr->flags & ITEM_REDRAW) == 0)) {
- Tcl_DoWhenIdle(DisplayItem, itemPtr);
- itemPtr->flags |= ITEM_REDRAW;
- }
-}
-
-static void
-ConfigureScrollbarsProc(ClientData clientData)
-{
- ComboMenu *comboPtr = clientData;
- Tcl_Interp *interp;
-
- interp = comboPtr->interp;
- /*
- * Execute the initialization procedure on this widget.
- */
- comboPtr->flags &= ~UPDATE_PENDING;
- if (Tcl_VarEval(interp, "::blt::ComboMenu::ConfigureScrollbars ",
- Tk_PathName(comboPtr->tkwin), (char *)NULL) != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReleaseTags --
- *
- * Releases the tags used by this item.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ReleaseTags(ComboMenu *comboPtr, Item *itemPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&comboPtr->tagTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tagTablePtr;
- Blt_HashEntry *h2Ptr;
-
- tagTablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tagTablePtr, (char *)itemPtr->index);
- if (h2Ptr != NULL) {
- Blt_DeleteHashEntry(tagTablePtr, h2Ptr);
- }
- }
-}
-
-static void
-DestroyItem(Item *itemPtr)
-{
- ComboMenu *comboPtr = itemPtr->comboPtr;
-
- ReleaseTags(comboPtr, itemPtr);
- iconOption.clientData = comboPtr;
- Blt_FreeOptions(itemConfigSpecs, (char *)itemPtr, comboPtr->display, 0);
- if (comboPtr->activePtr == itemPtr) {
- comboPtr->activePtr = NULL;
- }
- if (comboPtr->postedPtr == itemPtr) {
- comboPtr->postedPtr = NULL;
- }
- Blt_Chain_DeleteLink(comboPtr->chain, itemPtr->link);
-}
-
-static void
-DestroyItems(ComboMenu *comboPtr)
-{
- Blt_ChainLink link, next;
-
- for (link = Blt_Chain_FirstLink(comboPtr->chain); link != NULL;
- link = next) {
- Item *itemPtr;
-
- next = Blt_Chain_NextLink(link);
- itemPtr = Blt_Chain_GetValue(link);
- DestroyItem(itemPtr);
- }
- Blt_Chain_Destroy(comboPtr->chain);
-}
-
-static Item *
-NewItem(ComboMenu *comboPtr)
-{
- Item *itemPtr;
- Blt_ChainLink link;
-
- link = Blt_Chain_AllocLink(sizeof(Item));
- itemPtr = Blt_Chain_GetValue(link);
- itemPtr->comboPtr = comboPtr;
- itemPtr->flags |= (ITEM_BUTTON | ITEM_NORMAL);
- itemPtr->link = link;
- itemPtr->index = Blt_Chain_GetLength(comboPtr->chain);
- Blt_Chain_LinkAfter(comboPtr->chain, link, NULL);
- itemPtr->label = emptyString;
- itemPtr->underline = -1;
- return itemPtr;
-}
-
-static INLINE Item *
-FindItemByIndex(ComboMenu *comboPtr, long index)
-{
- Blt_ChainLink link;
-
- if ((index < 1) || (index > Blt_Chain_GetLength(comboPtr->chain))) {
- return NULL;
- }
- link = Blt_Chain_GetNthLink(comboPtr->chain, index - 1);
- return Blt_Chain_GetValue(link);
-}
-
-static INLINE Item *
-FirstItem(ComboMenu *comboPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(comboPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- if ((itemPtr->flags & ITEM_DISABLED) == 0) {
- return itemPtr;
- }
- }
- return NULL;
-}
-
-static INLINE Item *
-LastItem(ComboMenu *comboPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_LastLink(comboPtr->chain); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- if ((itemPtr->flags & ITEM_DISABLED) == 0) {
- return itemPtr;
- }
- }
- return NULL;
-}
-
-
-static Item *
-NextItem(Item *itemPtr)
-{
- if (itemPtr != NULL) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_NextLink(itemPtr->link); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- itemPtr = Blt_Chain_GetValue(link);
- if ((itemPtr->flags & (ITEM_SEPARATOR|ITEM_DISABLED)) == 0) {
- return itemPtr;
- }
- }
- }
- return NULL;
-}
-
-static INLINE Item *
-PrevItem(Item *itemPtr)
-{
- if (itemPtr != NULL) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_PrevLink(itemPtr->link); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- itemPtr = Blt_Chain_GetValue(link);
- if ((itemPtr->flags & (ITEM_SEPARATOR|ITEM_DISABLED)) == 0) {
- return itemPtr;
- }
- }
- }
- return NULL;
-}
-
-static INLINE Item *
-BeginItem(ComboMenu *comboPtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_FirstLink(comboPtr->chain);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- return NULL;
-}
-
-static INLINE Item *
-EndItem(ComboMenu *comboPtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_LastLink(comboPtr->chain);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- return NULL;
-}
-
-static Item *
-StepItem(Item *itemPtr)
-{
- if (itemPtr != NULL) {
- Blt_ChainLink link;
-
- link = Blt_Chain_NextLink(itemPtr->link);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- }
- return NULL;
-}
-
-static int
-SelectItem(Tcl_Interp *interp, ComboMenu *comboPtr, Item *itemPtr, int newState)
-{
- int result;
-
- if (itemPtr->flags & (ITEM_CASCADE|ITEM_SEPARATOR)) {
- return TCL_OK;
- }
-
- result = TCL_OK;
- if (newState == -1) {
- newState = (itemPtr->flags & ITEM_SELECTED) == 0;
- }
- if ((comboPtr->iconVarObjPtr != NULL) && (itemPtr->icon != NULL)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(IconName(itemPtr->icon), -1);
- if (Tcl_ObjSetVar2(interp, comboPtr->iconVarObjPtr, NULL, objPtr,
- TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- }
- if ((comboPtr->textVarObjPtr != NULL) && (itemPtr->label != emptyString)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(itemPtr->label, -1);
- if (Tcl_ObjSetVar2(interp, comboPtr->textVarObjPtr, NULL, objPtr,
- TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- }
- if (itemPtr->variableObjPtr != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = NULL;
- if (itemPtr->flags & ITEM_CHECKBUTTON) {
- objPtr = (newState) ?
- itemPtr->onValueObjPtr : itemPtr->offValueObjPtr;
- } else {
- objPtr = itemPtr->valueObjPtr;
- if (objPtr == NULL) {
- objPtr = Tcl_NewStringObj(itemPtr->label, -1);
- }
- }
- if (objPtr != NULL) {
- Tcl_IncrRefCount(objPtr);
- if (Tcl_ObjSetVar2(interp, itemPtr->variableObjPtr, NULL, objPtr,
- TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- result = TCL_ERROR;
- }
- Tcl_DecrRefCount(objPtr);
- }
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateItem --
- *
- * Marks the designated item as active. The item is redrawn with its
- * active colors. The previously active item is deactivated. If the new
- * item is NULL, then this means that no new item is to be activated.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Menu items may be scheduled to be drawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ActivateItem(ComboMenu *comboPtr, Item *itemPtr)
-{
- if ((comboPtr->activePtr == itemPtr) && (itemPtr != NULL)) {
- return; /* Item is already active. */
- }
- if (comboPtr->activePtr != NULL) {
- EventuallyRedrawItem(comboPtr->activePtr);
- }
- comboPtr->activePtr = itemPtr;
- if (itemPtr != NULL) {
- EventuallyRedrawItem(itemPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetBoundedWidth --
- *
- * Bounds a given width value to the limits described in the limit
- * structure. The initial starting value may be overridden by the nominal
- * value in the limits.
- *
- * Results:
- * Returns the constrained value.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetBoundedWidth(ComboMenu *comboPtr, int w)
-{
- /*
- * Check widgets for requested width values;
- */
- if (comboPtr->reqWidth.flags & LIMITS_NOM_SET) {
- w = comboPtr->reqWidth.nom; /* Override initial value */
- }
- if (w < comboPtr->reqWidth.min) {
- w = comboPtr->reqWidth.min; /* Bounded by minimum value */
- }
- if (w > comboPtr->reqWidth.max) {
- w = comboPtr->reqWidth.max; /* Bounded by maximum value */
- }
- if (comboPtr->flags & (RESTRICT_MIN|RESTRICT_MAX)) {
- Tk_Window parent;
-
- parent = Tk_Parent(comboPtr->tkwin);
- if ((comboPtr->flags & RESTRICT_MIN) && (w < Tk_Width(parent))) {
- w = Tk_Width(parent);
- }
- if ((comboPtr->flags & RESTRICT_MAX) && (w > Tk_Width(parent))) {
- w = Tk_Width(parent);
- }
- }
- {
- int screenWidth, screenHeight;
-
- Blt_SizeOfScreen(comboPtr->tkwin, &screenWidth, &screenHeight);
- if (w > screenWidth) {
- w = screenWidth;
- }
- }
- return w;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetBoundedHeight --
- *
- * Bounds a given value to the limits described in the limit structure.
- * The initial starting value may be overridden by the nominal value in
- * the limits.
- *
- * Results:
- * Returns the constrained value.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetBoundedHeight(ComboMenu *comboPtr, int h)
-{
- /*
- * Check widgets for requested height values;
- */
- if (comboPtr->reqHeight.flags & LIMITS_NOM_SET) {
- h = comboPtr->reqHeight.nom; /* Override initial value */
- }
- if (h < comboPtr->reqHeight.min) {
- h = comboPtr->reqHeight.min; /* Bounded by minimum value */
- }
- if (h > comboPtr->reqHeight.max) {
- h = comboPtr->reqHeight.max; /* Bounded by maximum value */
- }
- if (h > HeightOfScreen(Tk_Screen(comboPtr->tkwin))) {
- h = HeightOfScreen(Tk_Screen(comboPtr->tkwin));
- }
- return h;
-}
-
-static void
-FixMenuCoords(ComboMenu *comboPtr, Tk_Window parent, int *xPtr, int *yPtr)
-{
- int x, y, w, h, pw, ph;
- int screenWidth, screenHeight;
-
- Blt_SizeOfScreen(comboPtr->tkwin, &screenWidth, &screenHeight);
- x = *xPtr, y = *yPtr;
-
- /* Determine the size of the menu. */
- w = Tk_ReqWidth(comboPtr->tkwin);
- h = Tk_ReqHeight(comboPtr->tkwin);
- if (parent == comboPtr->tkwin) { /* This is a popup. */
- pw = w;
- ph = h;
- } else {
- pw = Tk_Width(parent);
- ph = Tk_Height(parent);
- }
- if ((y + h) > screenHeight) {
- y -= (ph + h); /* Flip to show menu above. */
- if (y < 0) {
- y = 0;
- }
- }
- if ((x + w) > screenWidth) {
- x -= pw; /* Flip to show menu on left side. */
- if (x < 0) {
- x = 0;
- }
- }
- *xPtr = x;
- *yPtr = y;
-}
-
-static void
-ComputeItemGeometry(ComboMenu *comboPtr, Item *itemPtr)
-{
-
- /* Determine the height of the item. It's the maximum height of all it's
- * components: left gadget (radiobutton or checkbutton), icon, label,
- * right gadget (cascade), and accelerator. */
- itemPtr->labelWidth = itemPtr->labelHeight = 0;
- itemPtr->leftIndWidth = itemPtr->leftIndHeight = 0;
- itemPtr->rightIndWidth = itemPtr->rightIndHeight = 0;
- itemPtr->iconWidth = itemPtr->iconHeight = 0;
- itemPtr->width = itemPtr->height = 0;
- if (itemPtr->flags & ITEM_SEPARATOR) {
- itemPtr->height = ITEM_SEP_HEIGHT;
- itemPtr->width = 0;
- if (itemPtr->image != NULL) {
- itemPtr->labelWidth = IconWidth(itemPtr->image);
- itemPtr->labelHeight = IconHeight(itemPtr->image);
- if (itemPtr->height < itemPtr->labelHeight) {
- itemPtr->height = itemPtr->labelHeight;
- }
- } else if (itemPtr->label != emptyString) {
- unsigned int w, h;
-
- Blt_GetTextExtents(itemPtr->stylePtr->labelFont, 0, itemPtr->label,
- -1, &w, &h);
- itemPtr->labelWidth = w;
- itemPtr->labelHeight = h;
- if (itemPtr->height < itemPtr->labelHeight) {
- itemPtr->height = itemPtr->labelHeight;
- }
- }
- if (itemPtr->labelWidth > 0) {
- itemPtr->width += itemPtr->labelWidth + ITEM_IPAD;
- }
- } else {
- if (itemPtr->flags & (ITEM_RADIOBUTTON | ITEM_CHECKBUTTON)) {
- Blt_FontMetrics fm;
- size_t reqSize;
-
- Blt_GetFontMetrics(itemPtr->stylePtr->labelFont, &fm);
- itemPtr->leftIndWidth = itemPtr->leftIndHeight =
- (fm.linespace) + 4 * ITEM_YPAD;
-#ifdef notdef
- itemPtr->leftIndWidth = ITEM_L_IND_WIDTH;
- itemPtr->leftIndHeight = ITEM_L_IND_HEIGHT;
-#endif
- reqSize = itemPtr->stylePtr->reqIndWidth;
- if (reqSize == 0) {
- reqSize = (itemPtr->flags & ITEM_RADIOBUTTON) ?
- comboPtr->radioButtonReqSize : comboPtr->checkButtonReqSize;
- }
- if (reqSize > 0) {
- itemPtr->leftIndWidth = itemPtr->leftIndHeight =
- reqSize + 2*ITEM_YPAD;
- }
- if (itemPtr->height < itemPtr->leftIndHeight) {
- itemPtr->height = itemPtr->leftIndHeight;
- }
- itemPtr->width += itemPtr->leftIndWidth + 2 * ITEM_IPAD;
- }
-
- if (itemPtr->icon != NULL) {
- itemPtr->iconWidth = IconWidth(itemPtr->icon);
- itemPtr->iconHeight = IconHeight(itemPtr->icon);
- if (itemPtr->height < IconHeight(itemPtr->icon)) {
- itemPtr->height = IconHeight(itemPtr->icon);
- }
- itemPtr->width += itemPtr->iconWidth + ITEM_IPAD;
- }
-
- if (itemPtr->image != NULL) {
- itemPtr->labelWidth = IconWidth(itemPtr->image);
- itemPtr->labelHeight = IconHeight(itemPtr->image);
- if (itemPtr->height < itemPtr->labelHeight) {
- itemPtr->height = itemPtr->labelHeight;
- }
- } else if (itemPtr->label != emptyString) {
- unsigned int w, h;
-
- Blt_GetTextExtents(itemPtr->stylePtr->labelFont, 0, itemPtr->label,
- -1, &w, &h);
- itemPtr->labelWidth = w;
- itemPtr->labelHeight = h;
- if (itemPtr->height < itemPtr->labelHeight) {
- itemPtr->height = itemPtr->labelHeight;
- }
- }
-
- if (itemPtr->labelWidth > 0) {
- itemPtr->width += itemPtr->labelWidth + ITEM_IPAD;
- }
-
- if (itemPtr->flags & ITEM_CASCADE) {
- itemPtr->rightIndWidth = ITEM_R_IND_WIDTH;
- itemPtr->rightIndHeight = ITEM_R_IND_HEIGHT;
- } else if (itemPtr->accel != NULL) {
- unsigned int w, h;
-
- Blt_GetTextExtents(itemPtr->stylePtr->accelFont, 0, itemPtr->accel,
- -1, &w, &h);
- itemPtr->rightIndWidth = w;
- itemPtr->rightIndHeight = h;
- }
- if (itemPtr->height < itemPtr->rightIndHeight) {
- itemPtr->height = itemPtr->rightIndHeight;
- }
- }
- itemPtr->width += 2 * itemPtr->stylePtr->borderWidth;
- itemPtr->height += 2 * (ITEM_XPAD + itemPtr->stylePtr->borderWidth);
-#ifdef notdef
- fprintf(stderr, "%s= w=%d,h=%d leftInd w=%d,h=%d icon w=%d,h=%d label w=%d,h=%d rightInd w=%d,h=%d\n",
- itemPtr->label, itemPtr->width, itemPtr->height,
- itemPtr->leftIndWidth, itemPtr->leftIndHeight,
- itemPtr->iconWidth, itemPtr->iconHeight, itemPtr->labelWidth,
- itemPtr->labelHeight, itemPtr->rightIndWidth,
- itemPtr->rightIndHeight);
-#endif
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SearchForItem --
- *
- * Performs a binary search for the item at the given y-offset in world
- * coordinates. The range of items is specified by menu indices (high
- * and low). The item must be (visible) in the viewport.
- *
- * Results:
- * Returns 0 if no item is found, other the index of the item (menu
- * indices start from 1).
- *
- *---------------------------------------------------------------------------
- */
-static Item *
-SearchForItem(ComboMenu *comboPtr, Item *firstPtr, Item *lastPtr, int yOffset)
-{
- Blt_ChainLink first, last, link, next;
-
- first = (firstPtr == NULL) ?
- Blt_Chain_FirstLink(comboPtr->chain): firstPtr->link;
- last = (lastPtr == NULL) ?
- Blt_Chain_LastLink(comboPtr->chain) : lastPtr->link;
-
- for (link = first; link != NULL; link = next) {
- Item *itemPtr;
-
- next = Blt_Chain_NextLink(link);
- itemPtr = Blt_Chain_GetValue(link);
- if ((yOffset >= itemPtr->yWorld) &&
- (yOffset < (itemPtr->yWorld + itemPtr->height))) {
- return itemPtr;
- }
- if (link == last) {
- break;
- }
- }
- return NULL;
-}
-
-static void
-ComputeVisibleItems(ComboMenu *comboPtr)
-{
- Item *itemPtr;
- int cavityWidth, cavityHeight;
-
- if (Blt_Chain_GetLength(comboPtr->chain) == 0) {
- comboPtr->firstPtr = comboPtr->lastPtr = NULL;
- return;
- }
- cavityWidth = Tk_Width(comboPtr->tkwin);
- cavityHeight = Tk_Height(comboPtr->tkwin);
- comboPtr->xScrollbarHeight = comboPtr->yScrollbarWidth = 0;
- if ((comboPtr->xScrollbar != NULL) && (comboPtr->worldWidth > cavityWidth)){
- comboPtr->xScrollbarHeight = Tk_ReqHeight(comboPtr->xScrollbar);
- if (comboPtr->xScrollbarHeight > MAXSCROLLBARTHICKNESS) {
- comboPtr->xScrollbarHeight = MAXSCROLLBARTHICKNESS;
- }
- cavityHeight -= comboPtr->xScrollbarHeight;
- }
- if ((comboPtr->yScrollbar != NULL) && (comboPtr->worldHeight>cavityHeight)){
- comboPtr->yScrollbarWidth = Tk_ReqWidth(comboPtr->yScrollbar);
- if (comboPtr->yScrollbarWidth > MAXSCROLLBARTHICKNESS) {
- comboPtr->yScrollbarWidth = MAXSCROLLBARTHICKNESS;
- }
- cavityWidth -= comboPtr->yScrollbarWidth;
- }
- if ((comboPtr->xScrollbar != NULL) && (comboPtr->xScrollbarHeight == 0) &&
- (comboPtr->worldWidth > cavityWidth)) {
- comboPtr->xScrollbarHeight = Tk_ReqHeight(comboPtr->xScrollbar);
- if (comboPtr->xScrollbarHeight > MAXSCROLLBARTHICKNESS) {
- comboPtr->xScrollbarHeight = MAXSCROLLBARTHICKNESS;
- }
- cavityHeight -= comboPtr->xScrollbarHeight;
- }
- if ((comboPtr->yScrollbar != NULL) && (comboPtr->yScrollbarWidth == 0) &&
- (comboPtr->worldHeight > cavityHeight)) {
- comboPtr->yScrollbarWidth = Tk_ReqWidth(comboPtr->yScrollbar);
- if (comboPtr->yScrollbarWidth > MAXSCROLLBARTHICKNESS) {
- comboPtr->yScrollbarWidth = MAXSCROLLBARTHICKNESS;
- }
- cavityWidth -= comboPtr->yScrollbarWidth;
- }
- comboPtr->width = cavityWidth;
- comboPtr->height = cavityHeight;
- itemPtr = SearchForItem(comboPtr, NULL, NULL, comboPtr->yOffset);
- if (itemPtr == NULL) {
- Blt_ChainLink link;
-
- link = Blt_Chain_LastLink(comboPtr->chain);
- comboPtr->firstPtr = comboPtr->lastPtr = Blt_Chain_GetValue(link);
- return;
- }
- comboPtr->firstPtr = itemPtr;
-
- itemPtr = SearchForItem(comboPtr, comboPtr->firstPtr, NULL,
- comboPtr->yOffset + VPORTHEIGHT(comboPtr));
- if (itemPtr == NULL) {
- Blt_ChainLink link;
-
- link = Blt_Chain_LastLink(comboPtr->chain);
- comboPtr->lastPtr = Blt_Chain_GetValue(link);
- return;
- }
- comboPtr->lastPtr = itemPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NearestItem --
- *
- * Find the item closest to the x-y screen coordinate given. The item
- * must be (visible) in the viewport.
- *
- * Results:
- * Returns the closest item. If selectOne is set, then always returns an
- * item (unless the menu is empty). Otherwise, NULL is returned is the
- * pointer is not over an item.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Item *
-NearestItem(ComboMenu *comboPtr, int x, int y, int selectOne)
-{
- Item *itemPtr;
-
- if (comboPtr->firstPtr == NULL) {
- return NULL; /* No visible entries. */
- }
- if ((x < 0) || (x >= Tk_Width(comboPtr->tkwin)) ||
- (y < 0) || (y >= Tk_Height(comboPtr->tkwin))) {
- return NULL; /* Screen coordinates are outside of
- * menu. */
- }
- /*
- * Item positions are saved in world coordinates. Convert the text point
- * screen y-coordinate to a world coordinate.
- */
- itemPtr = SearchForItem(comboPtr, comboPtr->firstPtr, comboPtr->lastPtr,
- WORLDY(comboPtr, y));
- if (itemPtr == NULL) {
- if (!selectOne) {
- return NULL;
- }
- if (y < comboPtr->borderWidth) {
- return FirstItem(comboPtr);
- }
- return LastItem(comboPtr);
- }
- return itemPtr;
-}
-
-static void
-ComputeCascadeMenuCoords(ComboMenu *comboPtr, Item *itemPtr, Tk_Window menuWin,
- int *xPtr, int *yPtr)
-{
- int rootX, rootY, x, y;
- int screenWidth, screenHeight;
-
- x = Tk_Width(comboPtr->tkwin);
- y = SCREENY(comboPtr, itemPtr->yWorld);
- Blt_SizeOfScreen(comboPtr->tkwin, &screenWidth, &screenHeight);
- Tk_GetRootCoords(comboPtr->tkwin, &rootX, &rootY);
- if (rootX < 0) {
- rootX = 0;
- }
- if (rootY < 0) {
- rootY = 0;
- }
- x += rootX, y += rootY;
- if ((y + Tk_ReqHeight(menuWin)) > screenHeight) {
- /* If we go offscreen on the bottom, raised the menu. */
- y = screenHeight - Tk_ReqHeight(menuWin) - 10;
- if (y < 0) {
- y = 0;
- }
- }
- if ((x + Tk_ReqWidth(menuWin)) > screenWidth) {
- /* If we go offscreen on the bottom, try the menu on the other side. */
- x = rootX - Tk_ReqWidth(menuWin);
- if (x < 0) {
- x = 0;
- }
- }
- *xPtr = x;
- *yPtr = y;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnpostCascade --
- *
- * This procedure arranges for the currently active item's cascade menu
- * to be unposted (i.e. the submenu is unmapped). Only the active item
- * can have it's submenu unposted.
- *
- * Results:
- * A standard TCL return result. Errors may occur in the TCL commands
- * generated to unpost submenus.
- *
- * Side effects:
- * The currently active item's submenu is unposted.
- *
- *---------------------------------------------------------------------------
- */
-static int
-UnpostCascade(
- Tcl_Interp *interp, /* Used for invoking "unpost" commands
- * and reporting errors. */
- ComboMenu *comboPtr) /* Information about the menu. */
-{
- Item *itemPtr = comboPtr->postedPtr;
- char *menuName;
- Tk_Window menuWin;
-
- if ((itemPtr == NULL) || (itemPtr->menuObjPtr == NULL)) {
- return TCL_OK; /* No item currenly posted or no menu
- * designated for cascade item. */
- }
- comboPtr->postedPtr = NULL;
- assert((itemPtr != NULL) && (itemPtr->flags & ITEM_CASCADE));
- menuName = Tcl_GetString(itemPtr->menuObjPtr);
- menuWin = Tk_NameToWindow(interp, menuName, comboPtr->tkwin);
- if (menuWin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_Parent(menuWin) != comboPtr->tkwin) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't unpost \"", Tk_PathName(menuWin),
- "\": it isn't a descendant of ",
- Tk_PathName(comboPtr->tkwin), (char *)NULL);
- }
- return TCL_ERROR;
- }
- Blt_UnmapToplevelWindow(menuWin);
- /*
- * Note: when unposting a submenu, we have to redraw the entire
- * parent menu. This is because of a combination of the following
- * things:
- * (a) the submenu partially overlaps the parent.
- * (b) the submenu specifies "save under", which causes the X
- * server to make a copy of the information under it when it
- * is posted. When the submenu is unposted, the X server
- * copies this data back and doesn't generate any Expose
- * events for the parent.
- * (c) the parent may have redisplayed itself after the submenu
- * was posted, in which case the saved information is no
- * longer correct.
- * The simplest solution is just force a complete redisplay of
- * the parent.
- */
-
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PostCascade --
- *
- * This procedure arranges for the currently active item's cascade menu
- * to be posted. Only the active item can have it's submenu posted.
- *
- * Results:
- * A standard TCL return result. Errors may occur in the TCL commands
- * generated to post submenus.
- *
- * Side effects:
- * The new submenu is posted.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PostCascade(
- Tcl_Interp *interp, /* Used for invoking "post" command
- * and reporting errors. */
- ComboMenu *comboPtr, /* Information about the menu. */
- Item *itemPtr) /* Cascade item */
-{
- char *menuName;
- Tk_Window menuWin;
-
- assert((itemPtr != NULL) && (itemPtr->flags & ITEM_CASCADE));
- if (itemPtr->menuObjPtr == NULL) {
- return TCL_OK; /* No menu was designated for this
- * cascade item. */
- }
- if (comboPtr->postedPtr == itemPtr) {
-#ifdef notdef
- fprintf(stderr, "postcascade: %s is already posted\n",
- Tcl_GetString(itemPtr->menuObjPtr));
-#endif
- return TCL_OK; /* Item is already posted. */
- }
- menuName = Tcl_GetString(itemPtr->menuObjPtr);
- menuWin = Tk_NameToWindow(interp, menuName, comboPtr->tkwin);
- if (menuWin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_Parent(menuWin) != comboPtr->tkwin) {
- Tcl_AppendResult(interp, "can't post \"", Tk_PathName(menuWin),
- "\": it isn't a descendant of ", Tk_PathName(comboPtr->tkwin),
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Tk_IsMapped(comboPtr->tkwin)) {
- Tcl_Obj *objv[4];
- int result, x, y;
-
- /*
- * Position the cascade with its upper left corner slightly below and
- * to the left of the upper right corner of the menu entry (this is an
- * attempt to match Motif behavior).
- *
- * The menu has to redrawn so that the entry can change relief.
- */
- ComputeCascadeMenuCoords(comboPtr, itemPtr, menuWin, &x, &y);
- objv[0] = itemPtr->menuObjPtr;
- objv[1] = Tcl_NewStringObj("post", 4);
- objv[2] = Tcl_NewIntObj(x);
- objv[3] = Tcl_NewIntObj(y);
- result = Blt_GlobalEvalObjv(interp, 4, objv);
- if (result != TCL_OK) {
- return result;
- }
- EventuallyRedrawItem(itemPtr);
- }
- comboPtr->postedPtr = itemPtr;
- return TCL_OK;
-}
-
-static void
-ComputeComboGeometry(ComboMenu *comboPtr)
-{
- int xWorld, yWorld;
- Blt_ChainLink link;
- int w, h;
- int reqWidth, reqHeight;
-
- /*
- * Step 1. Collect the maximum widths of the items in their individual
- * columns.
- */
- comboPtr->worldHeight = 0;
- comboPtr->width = comboPtr->height = 0;
- comboPtr->leftIndWidth = comboPtr->rightIndWidth = 0;
- comboPtr->iconWidth = comboPtr->labelWidth = 0;
- xWorld = yWorld = 0;
- for (link = Blt_Chain_FirstLink(comboPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- ComputeItemGeometry(comboPtr, itemPtr);
- if (itemPtr->leftIndWidth > comboPtr->leftIndWidth) {
- comboPtr->leftIndWidth = itemPtr->leftIndWidth;
- }
- if (itemPtr->iconWidth > comboPtr->iconWidth) {
- comboPtr->iconWidth = itemPtr->iconWidth;
- }
- if (itemPtr->labelWidth > comboPtr->labelWidth) {
- comboPtr->labelWidth = itemPtr->labelWidth;
- }
- if (itemPtr->rightIndWidth > comboPtr->rightIndWidth) {
- comboPtr->rightIndWidth = itemPtr->rightIndWidth;
- }
- comboPtr->worldHeight += itemPtr->height;
- itemPtr->xWorld = xWorld, itemPtr->yWorld = yWorld;
- yWorld += itemPtr->height;
- }
- comboPtr->worldWidth = comboPtr->leftIndWidth + comboPtr->iconWidth +
- comboPtr->labelWidth + comboPtr->rightIndWidth;
- if (comboPtr->leftIndWidth > 0) {
- comboPtr->worldWidth += ITEM_IPAD;
- }
- if (comboPtr->iconWidth > 0) {
- comboPtr->worldWidth += ITEM_IPAD;
- }
- if (comboPtr->labelWidth > 0) {
- comboPtr->worldWidth += ITEM_IPAD;
- }
- if (comboPtr->rightIndWidth > 0) {
- comboPtr->worldWidth += 4 * ITEM_IPAD;
- }
- comboPtr->worldWidth += ITEM_IPAD;
- comboPtr->xScrollbarHeight = comboPtr->yScrollbarWidth = 0;
-
- /* Figure out the requested size of the widget. This will also tell us if
- * we need scrollbars. */
-
- reqWidth = comboPtr->worldWidth + 2 * comboPtr->borderWidth;
- reqHeight = comboPtr->worldHeight + 2 * comboPtr->borderWidth;
-
- w = GetBoundedWidth(comboPtr, reqWidth);
- h = GetBoundedHeight(comboPtr, reqHeight);
-
-
- if ((reqWidth > w) && (comboPtr->xScrollbar != NULL)) {
- comboPtr->xScrollbarHeight = Tk_ReqHeight(comboPtr->xScrollbar);
- h = GetBoundedHeight(comboPtr, reqHeight + comboPtr->xScrollbarHeight);
- }
- if ((reqHeight > h) && (comboPtr->yScrollbar != NULL)) {
- comboPtr->yScrollbarWidth = Tk_ReqWidth(comboPtr->yScrollbar);
- w = GetBoundedWidth(comboPtr, reqWidth + comboPtr->yScrollbarWidth);
- }
- /* Save the computed width so that we only override the menu width if the
- * parent (combobutton/comboentry) width is greater than the normal size
- * of the menu. */
- comboPtr->normalWidth = w;
- comboPtr->normalHeight = h;
- if (h < 20) {
- h = 20;
- }
- if (w < comboPtr->parentWidth) {
- w = comboPtr->parentWidth;
- }
- comboPtr->width = w;
- comboPtr->height = h;
-#ifdef notdef
- fprintf(stderr, "%s= w=%d leftInd w=%d icon w=%d label w=%d rightInd w=%d\n",
- Tk_PathName(comboPtr->tkwin), comboPtr->width,
- comboPtr->leftIndWidth, comboPtr->iconWidth, comboPtr->labelWidth,
- comboPtr->rightIndWidth);
-#endif
- if (w != Tk_ReqWidth(comboPtr->tkwin)) {
- comboPtr->xOffset = 0;
- }
- if (h != Tk_ReqHeight(comboPtr->tkwin)) {
- comboPtr->yOffset = 0;
- }
-
- if ((w != Tk_ReqWidth(comboPtr->tkwin)) ||
- (h != Tk_ReqHeight(comboPtr->tkwin))) {
- Tk_GeometryRequest(comboPtr->tkwin, w, h);
- }
- comboPtr->flags |= SCROLL_PENDING | LAYOUT_PENDING;
-}
-
-static void
-DestroyStyle(Style *stylePtr)
-{
- ComboMenu *comboPtr;
- int i;
-
- stylePtr->refCount--;
- if (stylePtr->refCount > 0) {
- return;
- }
- comboPtr = stylePtr->comboPtr;
- iconOption.clientData = comboPtr;
- Blt_FreeOptions(styleConfigSpecs, (char *)stylePtr, comboPtr->display, 0);
- if (stylePtr->labelActiveGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->labelActiveGC);
- }
- if (stylePtr->labelDisabledGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->labelDisabledGC);
- }
- if (stylePtr->labelNormalGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->labelNormalGC);
- }
- if (stylePtr->accelActiveGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->accelActiveGC);
- }
- if (stylePtr->accelDisabledGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->accelDisabledGC);
- }
- if (stylePtr->accelNormalGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->accelNormalGC);
- }
- if (stylePtr->hPtr != NULL) {
- Blt_DeleteHashEntry(&stylePtr->comboPtr->styleTable, stylePtr->hPtr);
- }
- for (i = 0; i < 3; i++) {
- if (stylePtr->radiobutton[i] != NULL) {
- Blt_FreePicture(stylePtr->radiobutton[i]);
- }
- if (stylePtr->checkbutton[i] != NULL) {
- Blt_FreePicture(stylePtr->checkbutton[i]);
- }
- }
- if (stylePtr != &stylePtr->comboPtr->defStyle) {
- Blt_Free(stylePtr);
- }
-
-}
-
-static Style *
-AddDefaultStyle(Tcl_Interp *interp, ComboMenu *comboPtr)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- Style *stylePtr;
-
- hPtr = Blt_CreateHashEntry(&comboPtr->styleTable, "default", &isNew);
- if (!isNew) {
- Tcl_AppendResult(interp, "combomenu style \"", "default",
- "\" already exists.", (char *)NULL);
- return NULL;
- }
- stylePtr = &comboPtr->defStyle;
- assert(stylePtr);
- stylePtr->refCount = 1;
- stylePtr->name = Blt_GetHashKey(&comboPtr->styleTable, hPtr);
- stylePtr->hPtr = hPtr;
- stylePtr->comboPtr = comboPtr;
- stylePtr->borderWidth = 0;
- stylePtr->activeRelief = TK_RELIEF_FLAT;
- Blt_SetHashValue(hPtr, stylePtr);
- return TCL_OK;
-}
-
-static void
-DestroyStyles(ComboMenu *comboPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&comboPtr->styleTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Style *stylePtr;
-
- stylePtr = Blt_GetHashValue(hPtr);
- stylePtr->hPtr = NULL;
- stylePtr->refCount = 0;
- DestroyStyle(stylePtr);
- }
- Blt_DeleteHashTable(&comboPtr->styleTable);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetStyleFromObj --
- *
- * Gets the style associated with the given name.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetStyleFromObj(Tcl_Interp *interp, ComboMenu *comboPtr, Tcl_Obj *objPtr,
- Style **stylePtrPtr)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&comboPtr->styleTable, Tcl_GetString(objPtr));
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find style \"",
- Tcl_GetString(objPtr), "\" in combomenu \"",
- Tk_PathName(comboPtr->tkwin), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- *stylePtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetTag --
- *
- * Associates a tag with a given row. Individual row tags are
- * stored in hash tables keyed by the tag name. Each table is in
- * turn stored in a hash table keyed by the row location.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A tag is stored for a particular row.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SetTag(Tcl_Interp *interp, Item *itemPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tagTablePtr;
- ComboMenu *comboPtr;
- int isNew;
- long dummy;
-
- if ((strcmp(tagName, "all") == 0) || (strcmp(tagName, "end") == 0)) {
- return TCL_OK; /* Don't need to create reserved
- * tags. */
- }
- if (tagName[0] == '\0') {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "tag \"", tagName, "\" can't be empty.",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (tagName[0] == '-') {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "tag \"", tagName,
- "\" can't start with a '-'.", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (Tcl_GetLong(NULL, (char *)tagName, &dummy) == TCL_OK) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "tag \"", tagName, "\" can't be a number.",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- comboPtr = itemPtr->comboPtr;
- hPtr = Blt_CreateHashEntry(&comboPtr->tagTable, tagName, &isNew);
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't add tag \"", tagName,
- "\": out of memory", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (isNew) {
- tagTablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(tagTablePtr, BLT_ONE_WORD_KEYS);
- Blt_SetHashValue(hPtr, tagTablePtr);
- } else {
- tagTablePtr = Blt_GetHashValue(hPtr);
- }
- hPtr = Blt_CreateHashEntry(tagTablePtr, (char *)itemPtr->index, &isNew);
- if (isNew) {
- Blt_SetHashValue(hPtr, itemPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTagTable --
- *
- * Returns the hash table containing row indices for a tag.
- *
- * Results:
- * Returns a pointer to the hash table containing indices for the
- * given tag. If the row has no tags, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_HashTable *
-GetTagTable(ComboMenu *comboPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&comboPtr->tagTable, tagName);
- if (hPtr == NULL) {
- return NULL; /* No tag by that name. */
- }
- return Blt_GetHashValue(hPtr);
-}
-
-
-static void
-UnmanageScrollbar(ComboMenu *comboPtr, Tk_Window scrollbar)
-{
- if (scrollbar != NULL) {
- Tk_DeleteEventHandler(scrollbar, StructureNotifyMask,
- ScrollbarEventProc, comboPtr);
- Tk_ManageGeometry(scrollbar, (Tk_GeomMgr *)NULL, comboPtr);
- if (Tk_IsMapped(scrollbar)) {
- Tk_UnmapWindow(scrollbar);
- }
- }
-}
-
-static void
-ManageScrollbar(ComboMenu *comboPtr, Tk_Window scrollbar)
-{
- if (scrollbar != NULL) {
- Tk_CreateEventHandler(scrollbar, StructureNotifyMask,
- ScrollbarEventProc, comboPtr);
- Tk_ManageGeometry(scrollbar, &comboMgrInfo, comboPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InstallScrollbar --
- *
- * Convert the string representation of a color into a XColor pointer.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-InstallScrollbar(
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- ComboMenu *comboPtr,
- Tcl_Obj *objPtr, /* String representing scrollbar
- * window. */
- Tk_Window *tkwinPtr)
-{
- Tk_Window tkwin;
-
- if (objPtr == NULL) {
- *tkwinPtr = NULL;
- return;
- }
- tkwin = Tk_NameToWindow(interp, Tcl_GetString(objPtr), comboPtr->tkwin);
- if (tkwin == NULL) {
- Tcl_BackgroundError(interp);
- return;
- }
- if (Tk_Parent(tkwin) != comboPtr->tkwin) {
- Tcl_AppendResult(interp, "scrollbar \"", Tk_PathName(tkwin),
- "\" must be a child of combomenu.", (char *)NULL);
- Tcl_BackgroundError(interp);
- return;
- }
- ManageScrollbar(comboPtr, tkwin);
- *tkwinPtr = tkwin;
- return;
-}
-
-static void
-InstallXScrollbar(ClientData clientData)
-{
- ComboMenu *comboPtr = clientData;
-
- comboPtr->flags &= ~INSTALL_XSCROLLBAR;
- InstallScrollbar(comboPtr->interp, comboPtr, comboPtr->xScrollbarObjPtr,
- &comboPtr->xScrollbar);
-}
-
-static void
-InstallYScrollbar(ClientData clientData)
-{
- ComboMenu *comboPtr = clientData;
-
- comboPtr->flags &= ~INSTALL_YSCROLLBAR;
- InstallScrollbar(comboPtr->interp, comboPtr, comboPtr->yScrollbarObjPtr,
- &comboPtr->yScrollbar);
-}
-
-
-static int
-GetIconFromObj(Tcl_Interp *interp, ComboMenu *comboPtr, Tcl_Obj *objPtr,
- Icon *iconPtr)
-{
- Blt_HashEntry *hPtr;
- struct _Icon *iPtr;
- int isNew;
- const char *iconName;
-
- iconName = Tcl_GetString(objPtr);
- if (iconName[0] == '\0') {
- *iconPtr = NULL;
- return TCL_OK;
- }
- hPtr = Blt_CreateHashEntry(&comboPtr->iconTable, iconName, &isNew);
- if (isNew) {
- Tk_Image tkImage;
- int w, h;
-
- tkImage = Tk_GetImage(interp, comboPtr->tkwin, (char *)iconName,
- IconChangedProc, comboPtr);
- if (tkImage == NULL) {
- Blt_DeleteHashEntry(&comboPtr->iconTable, hPtr);
- return TCL_ERROR;
- }
- Tk_SizeOfImage(tkImage, &w, &h);
- iPtr = Blt_AssertMalloc(sizeof(struct _Icon ));
- iPtr->tkImage = tkImage;
- iPtr->hPtr = hPtr;
- iPtr->refCount = 1;
- iPtr->width = w;
- iPtr->height = h;
- Blt_SetHashValue(hPtr, iPtr);
- } else {
- iPtr = Blt_GetHashValue(hPtr);
- iPtr->refCount++;
- }
- *iconPtr = iPtr;
- return TCL_OK;
-}
-
-static void
-FreeIcon(ComboMenu *comboPtr, struct _Icon *iPtr)
-{
- iPtr->refCount--;
- if (iPtr->refCount == 0) {
- Blt_DeleteHashEntry(&comboPtr->iconTable, iPtr->hPtr);
- Tk_FreeImage(iPtr->tkImage);
- Blt_Free(iPtr);
- }
-}
-
-static void
-DestroyIcons(ComboMenu *comboPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&comboPtr->iconTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Icon icon;
-
- icon = Blt_GetHashValue(hPtr);
- Tk_FreeImage(IconImage(icon));
- Blt_Free(icon);
- }
- Blt_DeleteHashTable(&comboPtr->iconTable);
-}
-
-static INLINE Item *
-FindItemByLabel(ComboMenu *comboPtr, const char *label)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&comboPtr->labelTable, label);
- if (hPtr != NULL) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *h2Ptr;
- Blt_HashSearch iter;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FirstHashEntry(tablePtr, &iter);
- if (h2Ptr != NULL) {
- return Blt_GetHashValue(h2Ptr);
- }
- }
- return NULL;
-}
-
-static char *
-NewLabel(Item *itemPtr, const char *label)
-{
- Blt_HashEntry *hPtr, *h2Ptr;
- Blt_HashTable *tablePtr;
- int isNew;
- ComboMenu *comboPtr;
-
- comboPtr = itemPtr->comboPtr;
- hPtr = Blt_CreateHashEntry(&comboPtr->labelTable, label, &isNew);
- if (isNew) {
- tablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(tablePtr, BLT_ONE_WORD_KEYS);
- Blt_SetHashValue(hPtr, tablePtr);
- } else {
- tablePtr = Blt_GetHashValue(hPtr);
- }
- h2Ptr = Blt_CreateHashEntry(tablePtr, (char *)itemPtr, &isNew);
- Blt_SetHashValue(h2Ptr, itemPtr);
- return Blt_GetHashKey(&comboPtr->labelTable, hPtr);
-}
-
-static void
-RemoveLabel(ComboMenu *comboPtr, Item *itemPtr)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&comboPtr->labelTable, itemPtr->label);
- if (hPtr != NULL) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *h2Ptr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tablePtr, (char *)itemPtr);
- if (h2Ptr != NULL) {
- itemPtr->label = emptyString;
- Blt_DeleteHashEntry(tablePtr, h2Ptr);
- if (tablePtr->numEntries == 0) {
- Blt_DeleteHashEntry(&comboPtr->labelTable, hPtr);
- Blt_DeleteHashTable(tablePtr);
- Blt_Free(tablePtr);
- }
- }
- }
-}
-
-static void
-DestroyLabels(ComboMenu *comboPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&comboPtr->labelTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(tablePtr);
- Blt_Free(tablePtr);
- }
- Blt_DeleteHashTable(&comboPtr->labelTable);
-}
-
-static void
-MoveItem(ComboMenu *comboPtr, Item *itemPtr, int dir, Item *wherePtr)
-{
- if (Blt_Chain_GetLength(comboPtr->chain) == 1) {
- return; /* Can't rearrange one item. */
- }
- Blt_Chain_UnlinkLink(comboPtr->chain, itemPtr->link);
- switch(dir) {
- case 0: /* After */
- Blt_Chain_LinkAfter(comboPtr->chain, itemPtr->link, wherePtr->link);
- break;
- case 1: /* At */
- Blt_Chain_LinkAfter(comboPtr->chain, itemPtr->link, wherePtr->link);
- break;
- default:
- case 2: /* Before */
- Blt_Chain_LinkBefore(comboPtr->chain, itemPtr->link, wherePtr->link);
- break;
- }
- {
- Blt_ChainLink link;
- long count;
-
- for (count = 0, link = Blt_Chain_FirstLink(comboPtr->chain);
- link != NULL; link = Blt_Chain_NextLink(link), count++) {
- itemPtr = Blt_Chain_GetValue(link);
- itemPtr->index = count;
- }
- }
-}
-
-static int
-GetTypeFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *typePtr)
-{
- char *string;
- int length, flag;
- char c;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'r') && (length > 1) &&
- (strncmp(string, "radiobutton", length) == 0)) {
- flag = ITEM_RADIOBUTTON;
- } else if ((c == 'c') && (length > 1) &&
- (strncmp(string, "command", length) == 0)) {
- flag = ITEM_BUTTON;
- } else if ((c == 'c') && (length > 1) &&
- (strncmp(string, "cascade", length) == 0)) {
- flag = ITEM_CASCADE;
- } else if ((c == 'c') && (length > 1) &&
- (strncmp(string, "checkbutton", length) == 0)) {
- flag = ITEM_CHECKBUTTON;
- } else if ((c == 's') && (length > 1) &&
- (strncmp(string, "separator", length) == 0)) {
- flag = ITEM_SEPARATOR;
- } else {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "unknown item type \"", string,
- "\": should be command, checkbutton, cascade, ",
- "radiobutton, or separator.", (char *)NULL);
- }
- return TCL_ERROR;
- }
- *typePtr = flag;
- return TCL_OK;
-}
-
-
-static const char *
-NameOfType(unsigned int flags)
-{
- if (flags & ITEM_BUTTON) {
- return "command";
- }
- if (flags & ITEM_RADIOBUTTON) {
- return "radiobutton";
- }
- if (flags & ITEM_CHECKBUTTON) {
- return "checkbutton";
- }
- if (flags & ITEM_CASCADE) {
- return "cascade";
- }
- if (flags & ITEM_SEPARATOR) {
- return "separator";
- }
- return "???";
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextTaggedItem --
- *
- * Returns the next item derived from the given tag.
- *
- * Results:
- * Returns the row location of the first item. If no more rows can be
- * found, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Item *
-NextTaggedItem(ItemIterator *iterPtr)
-{
- Item *itemPtr;
-
- switch (iterPtr->type) {
- case ITER_TAG:
- {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_NextHashEntry(&iterPtr->cursor);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- }
- break;
- case ITER_TYPE:
- itemPtr = iterPtr->nextPtr;
- if (itemPtr == NULL) {
- return itemPtr;
- }
- while (itemPtr != iterPtr->endPtr) {
- if (itemPtr->flags & iterPtr->itemType) {
- break;
- }
- itemPtr = StepItem(itemPtr);
- }
- if (itemPtr == iterPtr->endPtr) {
- iterPtr->nextPtr = NULL;
- } else {
- iterPtr->nextPtr = StepItem(itemPtr);
- }
- return itemPtr;
-
- case ITER_ALL:
- if (iterPtr->link != NULL) {
- itemPtr = Blt_Chain_GetValue(iterPtr->link);
- iterPtr->link = Blt_Chain_NextLink(iterPtr->link);
- return itemPtr;
- }
- break;
-
- case ITER_PATTERN:
- {
- Blt_ChainLink link;
-
- for (link = iterPtr->link; link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(iterPtr->link);
- if (Tcl_StringMatch(itemPtr->label, iterPtr->tagName)) {
- iterPtr->link = Blt_Chain_NextLink(link);
- return itemPtr;
- }
- }
- break;
- }
- default:
- break;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FirstTaggedItem --
- *
- * Returns the first item derived from the given tag.
- *
- * Results:
- * Returns the row location of the first item. If no more rows can be
- * found, then -1 is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Item *
-FirstTaggedItem(ItemIterator *iterPtr)
-{
- Item *itemPtr;
-
- switch (iterPtr->type) {
- case ITER_TAG:
- {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FirstHashEntry(iterPtr->tablePtr, &iterPtr->cursor);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
- }
- break;
-
- case ITER_ALL:
- if (iterPtr->link != NULL) {
- itemPtr = Blt_Chain_GetValue(iterPtr->link);
- iterPtr->link = Blt_Chain_NextLink(iterPtr->link);
- return itemPtr;
- }
- break;
-
- case ITER_PATTERN:
- {
- Blt_ChainLink link;
-
- for (link = iterPtr->link; link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(iterPtr->link);
- if (Tcl_StringMatch(itemPtr->label, iterPtr->tagName)) {
- iterPtr->link = Blt_Chain_NextLink(link);
- return itemPtr;
- }
- }
- }
- break;
-
- case ITER_TYPE:
- itemPtr = iterPtr->startPtr;
- if (itemPtr == NULL) {
- return itemPtr;
- }
- while (itemPtr != iterPtr->endPtr) {
- if (itemPtr->flags & iterPtr->itemType) {
- break;
- }
- itemPtr = StepItem(itemPtr);
- }
- if (itemPtr == iterPtr->endPtr) {
- iterPtr->nextPtr = NULL;
- } else {
- iterPtr->nextPtr = StepItem(itemPtr);
- }
- return itemPtr;
-
- case ITER_SINGLE:
- itemPtr = iterPtr->startPtr;
- iterPtr->nextPtr = NextTaggedItem(iterPtr);
- return itemPtr;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetItemFromObj --
- *
- * Get the item associated the given index, tag, or label. This routine
- * is used when you want only one item. It's an error if more than one
- * item is specified (e.g. "all" tag). It's also an error if the tag is
- * empty (no items are currently tagged).
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetItemFromObj(Tcl_Interp *interp, ComboMenu *comboPtr, Tcl_Obj *objPtr,
- Item **itemPtrPtr)
-{
- ItemIterator iter;
- Item *firstPtr;
-
- if (GetItemIterator(interp, comboPtr, objPtr, &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- firstPtr = FirstTaggedItem(&iter);
- if (firstPtr != NULL) {
- Item *nextPtr;
-
- nextPtr = NextTaggedItem(&iter);
- if (nextPtr != NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "multiple items specified by \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- }
- *itemPtrPtr = firstPtr;
- return TCL_OK;
-}
-
-static int
-GetItemByIndex(Tcl_Interp *interp, ComboMenu *comboPtr, const char *string,
- int length, Item **itemPtrPtr)
-{
- Item *itemPtr;
- char c;
- long pos;
-
- itemPtr = NULL;
- c = string[0];
- if ((isdigit(c)) && (TclGetLong(NULL, string, &pos) == TCL_OK)) {
- Blt_ChainLink link;
-
- link = Blt_Chain_GetNthLink(comboPtr->chain, pos);
- if (link != NULL) {
- itemPtr = Blt_Chain_GetValue(link);
- }
- if (itemPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find item: bad index \"",
- string, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- } else if ((c == 'n') && (strcmp(string, "next") == 0)) {
- itemPtr = NextItem(comboPtr->activePtr);
- if (itemPtr == NULL) {
- itemPtr = comboPtr->activePtr;
- }
- } else if ((c == 'p') && (strcmp(string, "previous") == 0)) {
- itemPtr = PrevItem(comboPtr->activePtr);
- if (itemPtr == NULL) {
- itemPtr = comboPtr->activePtr;
- }
- } else if ((c == 'e') && (strcmp(string, "end") == 0)) {
- itemPtr = LastItem(comboPtr);
- } else if ((c == 'f') && (strcmp(string, "first") == 0)) {
- itemPtr = FirstItem(comboPtr);
- } else if ((c == 'l') && (strcmp(string, "last") == 0)) {
- itemPtr = LastItem(comboPtr);
- } else if ((c == 'v') && (strcmp(string, "view.top") == 0)) {
- itemPtr = comboPtr->firstPtr;
- } else if ((c == 'v') && (strcmp(string, "view.bottom") == 0)) {
- itemPtr = comboPtr->lastPtr;
- } else if ((c == 'n') && (strcmp(string, "none") == 0)) {
- itemPtr = NULL;
- } else if ((c == 'a') && (strcmp(string, "active") == 0)) {
- itemPtr = comboPtr->activePtr;
-#ifdef notdef
- } else if ((c == 'f') && (strcmp(string, "focus") == 0)) {
- itemPtr = comboPtr->focusPtr;
-#endif
- } else if (c == '@') {
- int x, y;
-
- if (Blt_GetXY(comboPtr->interp, comboPtr->tkwin, string, &x, &y)
- != TCL_OK) {
- return TCL_ERROR;
- }
- itemPtr = NearestItem(comboPtr, x, y, TRUE);
-#ifdef notdef
- if ((itemPtr != NULL) && (itemPtr->flags & ITEM_DISABLED)) {
- itemPtr = NextItem(itemPtr);
- }
-#endif
- } else {
- return TCL_CONTINUE;
- }
- *itemPtrPtr = itemPtr;
- return TCL_OK;
-}
-
-static Item *
-GetItemByLabel(ComboMenu *comboPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&comboPtr->labelTable, string);
- if (hPtr != NULL) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *h2Ptr;
- Blt_HashSearch iter;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FirstHashEntry(tablePtr, &iter);
- if (h2Ptr != NULL) {
- return Blt_GetHashValue(h2Ptr);
- }
- }
- return NULL;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetItemIterator --
- *
- * Converts a string representing a item index into an item pointer. The
- * index may be in one of the following forms:
- *
- * number Item at index in the list of items.
- * @x,y Item closest to the specified X-Y screen coordinates.
- * "active" Item where mouse pointer is located.
- * "posted" Item is the currently posted cascade item.
- * "next" Next item from the focus item.
- * "previous" Previous item from the focus item.
- * "end" Last item.
- * "none" No item.
- *
- * number Item at position in the list of items.
- * @x,y Item closest to the specified X-Y screen coordinates.
- * "active" Item mouse is located over.
- * "focus" Item is the widget's focus.
- * "select" Currently selected item.
- * "right" Next item from the focus item.
- * "left" Previous item from the focus item.
- * "up" Next item from the focus item.
- * "down" Previous item from the focus item.
- * "end" Last item in list.
- * "index:number" Item at index number in list of items.
- * "tag:string" Item(s) tagged by "string".
- * "label:pattern" Item(s) with label matching "pattern".
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned. The
- * pointer to the node is returned via itemPtrPtr. Otherwise, TCL_ERROR
- * is returned and an error message is left in interpreter's result
- * field.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetItemIterator(Tcl_Interp *interp, ComboMenu *comboPtr, Tcl_Obj *objPtr,
- ItemIterator *iterPtr)
-{
- Item *itemPtr, *startPtr, *endPtr;
- Blt_HashTable *tablePtr;
- char *string;
- char c;
- int nBytes;
- int length;
- int result;
-
- iterPtr->comboPtr = comboPtr;
- iterPtr->type = ITER_SINGLE;
- iterPtr->tagName = Tcl_GetStringFromObj(objPtr, &nBytes);
- iterPtr->nextPtr = NULL;
- iterPtr->startPtr = iterPtr->endPtr = NULL;
-
- if (comboPtr->flags & LAYOUT_PENDING) {
- ComputeComboGeometry(comboPtr);
- }
- if (comboPtr->flags & SCROLL_PENDING) {
- ComputeVisibleItems(comboPtr);
- }
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- iterPtr->startPtr = iterPtr->endPtr = comboPtr->activePtr;
- startPtr = endPtr = itemPtr = NULL;
- if (c == '\0') {
- startPtr = endPtr = NULL;
- }
- iterPtr->type = ITER_SINGLE;
- result = GetItemByIndex(interp, comboPtr, string, length, &itemPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (result == TCL_OK) {
- iterPtr->startPtr = iterPtr->endPtr = itemPtr;
- return TCL_OK;
- }
- if ((c == 'a') && (strcmp(iterPtr->tagName, "all") == 0)) {
- iterPtr->type = ITER_ALL;
- iterPtr->link = Blt_Chain_FirstLink(comboPtr->chain);
- } else if ((c == 'i') && (length > 6) &&
- (strncmp(string, "index:", 6) == 0)) {
- if (GetItemByIndex(interp, comboPtr, string + 6, length - 6, &itemPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- iterPtr->startPtr = iterPtr->endPtr = itemPtr;
- } else if ((c == 't') && (length > 4) &&
- (strncmp(string, "tag:", 4) == 0)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = GetTagTable(comboPtr, string + 4);
- if (tablePtr == NULL) {
- Tcl_AppendResult(interp, "can't find a tag \"", string + 5,
- "\" in \"", Tk_PathName(comboPtr->tkwin), "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- iterPtr->tagName = string + 4;
- iterPtr->tablePtr = tablePtr;
- iterPtr->type = ITER_TAG;
- } else if ((c == 'l') && (length > 6) &&
- (strncmp(string, "label:", 6) == 0)) {
- iterPtr->link = Blt_Chain_FirstLink(comboPtr->chain);
- iterPtr->tagName = string + 6;
- iterPtr->type = ITER_PATTERN;
- } else if ((itemPtr = GetItemByLabel(comboPtr, string)) != NULL) {
- iterPtr->startPtr = iterPtr->endPtr = itemPtr;
- } else if ((tablePtr = GetTagTable(comboPtr, string)) != NULL) {
- iterPtr->tagName = string;
- iterPtr->tablePtr = tablePtr;
- iterPtr->type = ITER_TAG;
- } else {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find item index, label, or tag \"",
- string, "\" in \"", Tk_PathName(comboPtr->tkwin), "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-ConfigureItem(
- Tcl_Interp *interp,
- Item *itemPtr,
- int objc,
- Tcl_Obj *const *objv,
- int flags)
-{
- ComboMenu *comboPtr;
-
- comboPtr = itemPtr->comboPtr;
- iconOption.clientData = comboPtr;
- if (Blt_ConfigureWidgetFromObj(interp, comboPtr->tkwin, itemConfigSpecs,
- objc, objv, (char *)itemPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- ComputeItemGeometry(comboPtr, itemPtr);
- return TCL_OK;
-}
-
-static int
-ConfigureStyle(Tcl_Interp *interp, Style *stylePtr, int objc,
- Tcl_Obj *const *objv, int flags)
-{
- ComboMenu *comboPtr = stylePtr->comboPtr;
- unsigned int gcMask;
- XGCValues gcValues;
- GC newGC;
-
- if (Blt_ConfigureWidgetFromObj(interp, comboPtr->tkwin, styleConfigSpecs,
- objc, objv, (char *)stylePtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Normal label */
- gcMask = GCForeground | GCFont | GCLineWidth;
- gcValues.line_width = 0;
- gcValues.foreground = stylePtr->labelNormalColor->pixel;
- gcValues.font = Blt_FontId(stylePtr->labelFont);
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (stylePtr->labelNormalGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->labelNormalGC);
- }
- stylePtr->labelNormalGC = newGC;
-
- /* Disabled label */
- gcMask = GCForeground | GCFont;
- gcValues.foreground = stylePtr->labelDisabledColor->pixel;
- gcValues.font = Blt_FontId(stylePtr->labelFont);
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (stylePtr->labelDisabledGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->labelDisabledGC);
- }
- stylePtr->labelDisabledGC = newGC;
-
- /* Active label */
- gcMask = GCForeground | GCFont;
- gcValues.foreground = stylePtr->labelActiveColor->pixel;
- gcValues.font = Blt_FontId(stylePtr->labelFont);
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (stylePtr->labelActiveGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->labelActiveGC);
- }
- stylePtr->labelActiveGC = newGC;
-
- /* Normal accelerator */
- gcMask = GCForeground | GCFont;
- gcValues.foreground = stylePtr->accelNormalColor->pixel;
- gcValues.font = Blt_FontId(stylePtr->accelFont);
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (stylePtr->accelNormalGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->accelNormalGC);
- }
- stylePtr->accelNormalGC = newGC;
-
- /* Disabled accelerator */
- gcMask = GCForeground | GCFont;
- gcValues.foreground = stylePtr->accelDisabledColor->pixel;
- gcValues.font = Blt_FontId(stylePtr->accelFont);
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (stylePtr->accelDisabledGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->accelDisabledGC);
- }
- stylePtr->accelDisabledGC = newGC;
-
- /* Active accelerator */
- gcMask = GCForeground | GCFont;
- gcValues.foreground = stylePtr->accelActiveColor->pixel;
- gcValues.font = Blt_FontId(stylePtr->accelFont);
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (stylePtr->accelActiveGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->accelActiveGC);
- }
- stylePtr->accelActiveGC = newGC;
-
-#ifdef notdef
- if (itemPtr->flags & (ITEM_RADIOBUTTON | ITEM_CHECKBUTTON)) {
- itemPtr->leftIndWidth = ITEM_L_IND_WIDTH + 2 * ITEM_IPAD;
- itemPtr->leftIndHeight = ITEM_L_IND_HEIGHT;
- }
-#endif
- return TCL_OK;
-}
-
-static int
-ConfigureComboMenu(Tcl_Interp *interp, ComboMenu *comboPtr, int objc,
- Tcl_Obj *const *objv, int flags)
-{
- int updateNeeded;
-
- if (Blt_ConfigureWidgetFromObj(interp, comboPtr->tkwin, comboConfigSpecs,
- objc, objv, (char *)comboPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- if (ConfigureStyle(interp, &comboPtr->defStyle, 0, NULL,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
-
- updateNeeded = FALSE;
- /* Install the embedded scrollbars as needed. We defer installing the
- * scrollbars so the scrollbar widgets don't have to exist when they are
- * specified by the -xscrollbar and -yscrollbar options respectively. The
- * down-side is that errors found in the scrollbar name will be
- * backgrounded. */
- if (Blt_ConfigModified(comboConfigSpecs, "-xscrollbar", (char *)NULL)) {
- if (comboPtr->xScrollbar != NULL) {
- UnmanageScrollbar(comboPtr, comboPtr->xScrollbar);
- comboPtr->xScrollbar = NULL;
- }
- if ((comboPtr->flags & INSTALL_XSCROLLBAR) == 0) {
- Tcl_DoWhenIdle(InstallXScrollbar, comboPtr);
- comboPtr->flags |= INSTALL_XSCROLLBAR;
- }
- updateNeeded = TRUE;
- }
- if (Blt_ConfigModified(comboConfigSpecs, "-yscrollbar", (char *)NULL)) {
- if (comboPtr->yScrollbar != NULL) {
- UnmanageScrollbar(comboPtr, comboPtr->yScrollbar);
- comboPtr->yScrollbar = NULL;
- }
- if ((comboPtr->flags & INSTALL_YSCROLLBAR) == 0) {
- Tcl_DoWhenIdle(InstallYScrollbar, comboPtr);
- comboPtr->flags |= INSTALL_YSCROLLBAR;
- }
- updateNeeded = TRUE;
- }
- if (updateNeeded) {
- if ((comboPtr->flags & UPDATE_PENDING) == 0) {
- Tcl_DoWhenIdle(ConfigureScrollbarsProc, comboPtr);
- comboPtr->flags |= UPDATE_PENDING;
- }
- }
- return TCL_OK;
-}
-
-/* Widget Callbacks */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboMenuEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * comboentry widgets.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComboMenuEventProc(ClientData clientData, XEvent *eventPtr)
-{
- ComboMenu *comboPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(comboPtr);
- }
- } else if (eventPtr->type == UnmapNotify) {
- if (comboPtr->lastPtr != NULL) {
- UnpostCascade((Tcl_Interp *)NULL, comboPtr);
- EventuallyRedraw(comboPtr);
- }
- } else if (eventPtr->type == ConfigureNotify) {
- comboPtr->flags |= (SCROLL_PENDING | LAYOUT_PENDING);
- EventuallyRedraw(comboPtr);
- } else if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
- if (eventPtr->xfocus.detail == NotifyInferior) {
- return;
- }
- if (eventPtr->type == FocusIn) {
- comboPtr->flags |= FOCUS;
- } else {
- comboPtr->flags &= ~FOCUS;
- }
- EventuallyRedraw(comboPtr);
- } else if (eventPtr->type == DestroyNotify) {
- if (comboPtr->tkwin != NULL) {
- comboPtr->tkwin = NULL;
- }
- if (comboPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayComboMenu, comboPtr);
- }
- Tcl_EventuallyFree(comboPtr, DestroyComboMenu);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollbarEventProc --
- *
- * This procedure is invoked by the Tk event handler when StructureNotify
- * events occur in a scrollbar managed by the widget.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ScrollbarEventProc(
- ClientData clientData, /* Pointer to Entry structure for
- * widget referred to by eventPtr. */
- XEvent *eventPtr) /* Describes what just happened. */
-{
- ComboMenu *comboPtr = clientData;
-
- if (eventPtr->type == ConfigureNotify) {
- EventuallyRedraw(comboPtr);
- } else if (eventPtr->type == DestroyNotify) {
- if (eventPtr->xany.window == Tk_WindowId(comboPtr->yScrollbar)) {
- comboPtr->yScrollbar = NULL;
- } else if (eventPtr->xany.window == Tk_WindowId(comboPtr->xScrollbar)) {
- comboPtr->xScrollbar = NULL;
- }
- comboPtr->flags |= LAYOUT_PENDING;;
- EventuallyRedraw(comboPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollbarCustodyProc --
- *
- * This procedure is invoked when a scrollbar has been stolen by another
- * geometry manager.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the combomenu to have its layout re-arranged at the next
- * idle point.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-ScrollbarCustodyProc(
- ClientData clientData, /* Information about the combomenu. */
- Tk_Window tkwin) /* Scrollbar stolen by another geometry
- * manager. */
-{
- ComboMenu *comboPtr = (ComboMenu *)clientData;
-
- if (tkwin == comboPtr->yScrollbar) {
- comboPtr->yScrollbar = NULL;
- comboPtr->yScrollbarWidth = 0;
- } else if (tkwin == comboPtr->xScrollbar) {
- comboPtr->xScrollbar = NULL;
- comboPtr->xScrollbarHeight = 0;
- } else {
- return;
- }
- Tk_UnmaintainGeometry(tkwin, comboPtr->tkwin);
- comboPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(comboPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollbarGeometryProc --
- *
- * This procedure is invoked by Tk_GeometryRequest for scrollbars managed
- * by the combomenu.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the combomenu to have its layout re-computed and
- * re-arranged at the next idle point.
- *
- * -------------------------------------------------------------------------- */
-/* ARGSUSED */
-static void
-ScrollbarGeometryProc(
- ClientData clientData, /* ComboMenu widget record. */
- Tk_Window tkwin) /* Scrollbar whose geometry has
- * changed. */
-{
- ComboMenu *comboPtr = (ComboMenu *)clientData;
-
- comboPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(comboPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ItemVarTraceProc --
- *
- * This procedure is invoked when someone changes the state variable
- * associated with a radiobutton or checkbutton entry. The entry's
- * selected state is set to match the value of the variable.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The combobox entry may become selected or deselected.
- *
- *---------------------------------------------------------------------------
- */
-static char *
-ItemVarTraceProc(
- ClientData clientData, /* Information about the item. */
- Tcl_Interp *interp, /* Interpreter containing variable. */
- const char *name1, /* First part of variable's name. */
- const char *name2, /* Second part of variable's name. */
- int flags) /* Describes what just happened. */
-{
- Item *itemPtr = clientData;
- Tcl_Obj *objPtr;
- int bool;
-
- assert(itemPtr->variableObjPtr != NULL);
- if (flags & TCL_INTERP_DESTROYED) {
- return NULL; /* Interpreter is going away. */
-
- }
- /*
- * If the variable is being unset, then re-establish the trace.
- */
- if (flags & TCL_TRACE_UNSETS) {
- itemPtr->flags &= ~ITEM_SELECTED;
- if (flags & TCL_TRACE_DESTROYED) {
- char *varName;
-
- varName = Tcl_GetString(itemPtr->variableObjPtr);
- Tcl_TraceVar(interp, varName, VAR_FLAGS, ItemVarTraceProc,
- clientData);
- }
- goto done;
- }
-
- if ((itemPtr->flags & (ITEM_RADIOBUTTON|ITEM_CHECKBUTTON|ITEM_BUTTON))==0) {
- return NULL; /* Not a radiobutton or checkbutton. */
- }
-
- /*
- * Use the value of the variable to update the selected status of the
- * item.
- */
- objPtr = Tcl_ObjGetVar2(interp, itemPtr->variableObjPtr, NULL,
- TCL_GLOBAL_ONLY);
- if (objPtr == NULL) {
- return NULL; /* Can't get value of variable. */
- }
- bool = 0;
- if (itemPtr->flags & (ITEM_BUTTON|ITEM_RADIOBUTTON)) {
- const char *string;
-
- if (itemPtr->valueObjPtr == NULL) {
- string = itemPtr->label;
- } else {
- string = Tcl_GetString(itemPtr->valueObjPtr);
- }
- if (string == NULL) {
- return NULL;
- }
- bool = (strcmp(string, Tcl_GetString(objPtr)) == 0);
- } else if (itemPtr->flags & ITEM_CHECKBUTTON) {
- if (itemPtr->onValueObjPtr == NULL) {
- if (Tcl_GetBooleanFromObj(NULL, objPtr, &bool) != TCL_OK) {
- return NULL;
- }
- } else {
- bool = (strcmp(Tcl_GetString(objPtr),
- Tcl_GetString(itemPtr->onValueObjPtr)) == 0);
- }
- }
- if (bool) {
- ComboMenu *comboPtr;
-
- if (itemPtr->flags & ITEM_SELECTED) {
- return NULL; /* Already selected. */
- }
- comboPtr = itemPtr->comboPtr;
- if ((comboPtr->textVarObjPtr != NULL) &&
- (itemPtr->label != emptyString)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(itemPtr->label, -1);
- if (Tcl_ObjSetVar2(interp, comboPtr->textVarObjPtr, NULL, objPtr,
- TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- }
- itemPtr->flags |= ITEM_SELECTED;
- } else if (itemPtr->flags & ITEM_SELECTED) {
- itemPtr->flags &= ~ITEM_SELECTED;
- } else {
- return NULL; /* Already deselected. */
- }
- done:
- EventuallyRedraw(itemPtr->comboPtr);
- return NULL; /* Done. */
-}
-
-/*ARGSUSED*/
-static void
-FreeTraceVarProc(ClientData clientData, Display *display, char *widgRec,
- int offset)
-{
- Item *itemPtr = (Item *)(widgRec);
-
- if (itemPtr->variableObjPtr != NULL) {
- const char *varName;
- ComboMenu *comboPtr;
-
- comboPtr = itemPtr->comboPtr;
- varName = Tcl_GetString(itemPtr->variableObjPtr);
- Tcl_UntraceVar(comboPtr->interp, varName, VAR_FLAGS, ItemVarTraceProc,
- itemPtr);
- Tcl_DecrRefCount(itemPtr->variableObjPtr);
- itemPtr->variableObjPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
-
- * ObjToTraceVarProc --
- *
- * Convert the string representation of a color into a XColor pointer.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTraceVarProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Item *itemPtr = (Item *)(widgRec);
- const char *varName;
-
- /* Remove the current trace on the variable. */
- if (itemPtr->variableObjPtr != NULL) {
- varName = Tcl_GetString(itemPtr->variableObjPtr);
- Tcl_UntraceVar(interp, varName, VAR_FLAGS, ItemVarTraceProc, itemPtr);
- Tcl_DecrRefCount(itemPtr->variableObjPtr);
- itemPtr->variableObjPtr = NULL;
- }
- varName = Tcl_GetString(objPtr);
- if ((varName[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- return TCL_OK;
- }
- itemPtr->variableObjPtr = objPtr;
- Tcl_IncrRefCount(objPtr);
- Tcl_TraceVar(interp, varName, VAR_FLAGS, ItemVarTraceProc, itemPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceVarToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TraceVarToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Item *itemPtr = (Item *)(widgRec);
- Tcl_Obj *objPtr;
-
- if (itemPtr->variableObjPtr == NULL) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- objPtr = itemPtr->variableObjPtr;
- }
- return objPtr;
-}
-
-/*ARGSUSED*/
-static void
-FreeStyleProc(ClientData clientData, Display *display, char *widgRec,
- int offset)
-{
- Style *stylePtr = *(Style **)(widgRec + offset);
-
- if ((stylePtr != NULL) && (stylePtr != &stylePtr->comboPtr->defStyle)) {
- DestroyStyle(stylePtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToStyleProc --
- *
- * Convert the string representation of a color into a XColor pointer.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToStyleProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboMenu *comboPtr;
- Item *itemPtr = (Item *)widgRec;
- Style **stylePtrPtr = (Style **)(widgRec + offset);
- Style *stylePtr;
- char *string;
-
- string = Tcl_GetString(objPtr);
- comboPtr = itemPtr->comboPtr;
- if ((string[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- stylePtr = NULL;
- } else if (GetStyleFromObj(interp, comboPtr, objPtr, &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Release the old style. */
- if ((*stylePtrPtr != NULL) && (*stylePtrPtr != &comboPtr->defStyle)) {
- DestroyStyle(*stylePtrPtr);
- }
- stylePtr->refCount++;
- *stylePtrPtr = stylePtr;
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-StyleToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Style *stylePtr = *(Style **)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (stylePtr == NULL) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- objPtr = Tcl_NewStringObj(stylePtr->name, -1);
- }
- return objPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToRestrictProc --
- *
- * Convert the string representation of an item state into a flag.
- *
- * Results:
- * The return value is a standard TCL result. The state flags are
- * updated.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToRestrictProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing state. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int *flagsPtr = (unsigned int *)(widgRec + offset);
- char *string;
- int flag;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "min") == 0) {
- flag = RESTRICT_MIN;
- } else if (strcmp(string, "max") == 0) {
- flag = RESTRICT_MAX;
- } else if (strcmp(string, "both") == 0) {
- flag = RESTRICT_MIN|RESTRICT_MAX;
- } else if (strcmp(string, "none") == 0) {
- flag = 0;
- } else {
- Tcl_AppendResult(interp, "unknown state \"", string,
- "\": should be active, disabled, or normal.", (char *)NULL);
- return TCL_ERROR;
- }
- *flagsPtr &= ~(RESTRICT_MIN|RESTRICT_MAX);
- *flagsPtr |= flag;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RestrictToObjProc --
- *
- * Return the string representation of the restrict flags.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-RestrictToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int *flagsPtr = (unsigned int *)(widgRec + offset);
- int restrict;
-
- restrict = *flagsPtr & (RESTRICT_MIN|RESTRICT_MAX);
- switch (restrict) {
- case RESTRICT_MIN:
- return Tcl_NewStringObj("min", -1);
- case RESTRICT_MAX:
- return Tcl_NewStringObj("max", -1);
- case (RESTRICT_MIN|RESTRICT_MAX):
- return Tcl_NewStringObj("both", -1);
- case RESTRICT_NONE:
- return Tcl_NewStringObj("none", -1);
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToStateProc --
- *
- * Convert the string representation of an item state into a flag.
- *
- * Results:
- * The return value is a standard TCL result. The state flags are
- * updated.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToStateProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing state. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Item *itemPtr = (Item *)(widgRec);
- unsigned int *flagsPtr = (unsigned int *)(widgRec + offset);
- char *string;
- ComboMenu *comboPtr;
- int flag;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "disabled") == 0) {
- flag = ITEM_DISABLED;
- } else if (strcmp(string, "normal") == 0) {
- flag = ITEM_NORMAL;
- } else {
- Tcl_AppendResult(interp, "unknown state \"", string,
- "\": should be active, disabled, or normal.", (char *)NULL);
- return TCL_ERROR;
- }
- if (itemPtr->flags & flag) {
- return TCL_OK; /* State is already set to value. */
- }
- comboPtr = itemPtr->comboPtr;
- if (comboPtr->activePtr != itemPtr) {
- ActivateItem(comboPtr, NULL);
- comboPtr->activePtr = NULL;
- }
- *flagsPtr &= ~ITEM_STATE_MASK;
- *flagsPtr |= flag;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StateToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-StateToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int state = *(unsigned int *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (state & ITEM_NORMAL) {
- objPtr = Tcl_NewStringObj("normal", -1);
- } else if (state & ITEM_DISABLED) {
- objPtr = Tcl_NewStringObj("disabled", -1);
- } else {
- objPtr = Tcl_NewStringObj("???", -1);
- }
- return objPtr;
-}
-
-
-/*ARGSUSED*/
-static void
-FreeTagsProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- ComboMenu *comboPtr;
- Item *itemPtr = (Item *)widgRec;
-
- comboPtr = itemPtr->comboPtr;
- ReleaseTags(comboPtr, itemPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToTagsProc --
- *
- * Convert the string representation of a list of tags.
- *
- * Results:
- * The return value is a standard TCL result. The tags are
- * save in the widget.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTagsProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboMenu *comboPtr;
- Item *itemPtr = (Item *)widgRec;
- int i;
- char *string;
- int objc;
- Tcl_Obj **objv;
-
- comboPtr = itemPtr->comboPtr;
- ReleaseTags(comboPtr, itemPtr);
- string = Tcl_GetString(objPtr);
- if ((string[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- return TCL_OK;
- }
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 0; i < objc; i++) {
- SetTag(interp, itemPtr, Tcl_GetString(objv[i]));
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagsToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TagsToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- ComboMenu *comboPtr;
- Item *itemPtr = (Item *)widgRec;
- Tcl_Obj *listObjPtr;
-
- comboPtr = itemPtr->comboPtr;
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&comboPtr->tagTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tagTablePtr;
- Blt_HashEntry *h2Ptr;
-
- tagTablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tagTablePtr, (char *)itemPtr->index);
- if (h2Ptr != NULL) {
- Tcl_Obj *objPtr;
- const char *name;
-
- name = Tcl_GetHashKey(&comboPtr->tagTable, hPtr);
- objPtr = Tcl_NewStringObj(name, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- return listObjPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconChangedProc
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-IconChangedProc(
- ClientData clientData,
- int x, int y, int w, int h, /* Not used. */
- int imageWidth, int imageHeight) /* Not used. */
-{
- ComboMenu *comboPtr = clientData;
-
- comboPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(comboPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToIconProc --
- *
- * Convert a image into a hashed icon.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToIconProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboMenu *comboPtr = clientData;
- Icon *iconPtr = (Icon *)(widgRec + offset);
- Icon icon;
-
- if (GetIconFromObj(interp, comboPtr, objPtr, &icon) != TCL_OK) {
- return TCL_ERROR;
- }
- if (*iconPtr != NULL) {
- FreeIcon(comboPtr, *iconPtr);
- }
- *iconPtr = icon;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconToObjProc --
- *
- * Converts the icon into its string representation (its name).
- *
- * Results:
- * The name of the icon is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-IconToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Icon icon = *(Icon *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (icon == NULL) {
- objPtr = Tcl_NewStringObj("", 0);
- } else {
- objPtr =Tcl_NewStringObj(Blt_Image_Name(IconImage(icon)), -1);
- }
- return objPtr;
-}
-
-/*ARGSUSED*/
-static void
-FreeIconProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Icon *iconPtr = (Icon *)(widgRec + offset);
-
- if (*iconPtr != NULL) {
- ComboMenu *comboPtr = clientData;
-
- FreeIcon(comboPtr, *iconPtr);
- *iconPtr = NULL;
- }
-}
-
-/*ARGSUSED*/
-static void
-FreeLabelProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Item *itemPtr = (Item *)widgRec;
-
- if (itemPtr->label != emptyString) {
- RemoveLabel(itemPtr->comboPtr, itemPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToLabelProc --
- *
- * Save the label and add the item to the label hashtable.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToLabelProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Item *itemPtr = (Item *)(widgRec);
- char *string;
-
- if (itemPtr->label != emptyString) {
- RemoveLabel(itemPtr->comboPtr, itemPtr);
- }
- string = Tcl_GetString(objPtr);
- if ((string[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- return TCL_OK;
- }
- itemPtr->label = NewLabel(itemPtr, string);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LabelToObjProc --
- *
- * Return the label of the item.
- *
- * Results:
- * The label is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-LabelToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Item *itemPtr = (Item *)(widgRec);
- Tcl_Obj *objPtr;
-
- if (itemPtr->label == emptyString) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- objPtr = Tcl_NewStringObj(itemPtr->label, -1);
- }
- return objPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToTypeProc --
- *
- * Convert the string representation of an item into a value.
- *
- * Results:
- * A standard TCL result. The type pointer is written into the
- * widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTypeProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing type. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int *typePtr = (unsigned int *)(widgRec + offset);
- int flag;
-
- if (GetTypeFromObj(interp, objPtr, &flag) != TCL_OK) {
- return TCL_ERROR;
- }
- *typePtr &= ~ITEM_TYPE_MASK;
- *typePtr |= flag;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TypeToObjProc --
- *
- * Return the name of the type.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TypeToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int type = *(int *)(widgRec + offset);
-
- return Tcl_NewStringObj(NameOfType(type), -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TypeSwitch --
- *
- * Convert a string representing an item type into its integer value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TypeSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- unsigned int *typePtr = (unsigned int *)(record + offset);
- int flag;
-
- if (GetTypeFromObj(interp, objPtr, &flag) != TCL_OK) {
- return TCL_ERROR;
- }
- *typePtr &= ~ITEM_TYPE_MASK;
- *typePtr |= flag;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ItemSwitch --
- *
- * Convert a string representing an item into its pointer.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ItemSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Item **itemPtrPtr = (Item **)(record + offset);
- ComboMenu *comboPtr = clientData;
- Item *itemPtr;
-
- if (GetItemFromObj(NULL, comboPtr, objPtr, &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- *itemPtrPtr = itemPtr;
- return TCL_OK;
-}
-
-
-/* Widget Operations */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm activate item
- *
- *---------------------------------------------------------------------------
- */
-static int
-ActivateOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
-
- if (GetItemFromObj(NULL, comboPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (comboPtr->activePtr == itemPtr) {
- return TCL_OK; /* Item is already active. */
- }
- ActivateItem(comboPtr, NULL);
- comboPtr->activePtr = NULL;
- if ((itemPtr != NULL) &&
- ((itemPtr->flags & (ITEM_DISABLED|ITEM_SEPARATOR)) == 0)) {
- ActivateItem(comboPtr, itemPtr);
- comboPtr->activePtr = itemPtr;
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * AddOp --
- *
- * Appends a new item to the combomenu.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The combomenu entry may become selected or deselected.
- *
- * .cm add radiobutton -text "fred" -tags ""
- *
- *---------------------------------------------------------------------------
- */
-static int
-AddOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Item *itemPtr;
-
- itemPtr = NewItem(comboPtr);
- if (ConfigureItem(interp, itemPtr, objc - 2, objv + 2, 0) != TCL_OK) {
- DestroyItem(itemPtr);
- return TCL_ERROR; /* Error configuring the entry. */
- }
- EventuallyRedraw(comboPtr);
- Tcl_SetLongObj(Tcl_GetObjResult(interp), itemPtr->index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AddListOp --
- *
- * Appends a list of items to the combomenu.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * New items are added to the combomenu.
- *
- * .cm add labelList -type radiobutton -text "fred" -tags ""
- *
- *---------------------------------------------------------------------------
- */
-static int
-AddListOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int i;
- int iobjc;
- Tcl_Obj **iobjv;
- Tcl_Obj *listObjPtr;
-
- if (Tcl_ListObjGetElements(interp, objv[2], &iobjc, &iobjv) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (i = 0; i < iobjc; i++) {
- Tcl_Obj *objPtr;
- Item *itemPtr;
-
- itemPtr = NewItem(comboPtr);
- if (ConfigureItem(interp, itemPtr, objc - 3, objv + 3, 0) != TCL_OK) {
- DestroyItem(itemPtr);
- return TCL_ERROR;
- }
- itemPtr->label = NewLabel(itemPtr, Tcl_GetString(iobjv[i]));
- objPtr = Tcl_NewLongObj(itemPtr->index);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- EventuallyRedraw(comboPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm configure ?option value?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(
- ComboMenu *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int result;
-
- iconOption.clientData = comboPtr;
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin,
- comboConfigSpecs, (char *)comboPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin,
- comboConfigSpecs, (char *)comboPtr, objv[2], 0);
- }
- Tcl_Preserve(comboPtr);
- result = ConfigureComboMenu(interp, comboPtr, objc - 2, objv + 2,
- BLT_CONFIG_OBJV_ONLY);
- Tcl_Release(comboPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- comboPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm cget option
- *
- *---------------------------------------------------------------------------
- */
-static int
-CgetOp(
- ComboMenu *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- iconOption.clientData = comboPtr;
- return Blt_ConfigureValueFromObj(interp, comboPtr->tkwin, comboConfigSpecs,
- (char *)comboPtr, objv[2], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm delete item...
- *
- *---------------------------------------------------------------------------
- */
-static int
-DeleteOp(
- ComboMenu *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 2; i < objc; i++) {
- ItemIterator iter;
- Item *itemPtr, *nextPtr;
-
- if (GetItemIterator(interp, comboPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (itemPtr = FirstTaggedItem(&iter); itemPtr != NULL;
- itemPtr = nextPtr) {
- nextPtr = NextTaggedItem(&iter);
- DestroyItem(itemPtr);
- }
- }
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExistsOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm exists item
- *
- *---------------------------------------------------------------------------
- */
-static int
-ExistsOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- int bool;
-
- bool = FALSE;
- if (GetItemFromObj(NULL, comboPtr, objv[2], &itemPtr) == TCL_OK) {
- if (itemPtr != NULL) {
- bool = TRUE;
- }
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindOp --
- *
- * Search for an item according to the string given.
- *
- * Results:
- * The index of the found item is returned. If no item is found
- * -1 is returned.
- *
- * .cm find string -from active -previous -underline -type separator
- *
- *---------------------------------------------------------------------------
- */
-static int
-FindOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- long index;
- FindSwitches switches;
- const char *pattern;
-
- /* Process switches */
- pattern = Tcl_GetString(objv[2]);
- switches.mask = 0;
- switches.type = 0;
- itemSwitch.clientData = comboPtr;
-
- switches.fromPtr = comboPtr->activePtr;
- if (Blt_ParseSwitches(interp, findSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- index = -1;
- if (switches.mask & FIND_UNDERLINE) {
- Tcl_UniChar want;
- Item *itemPtr;
-
- itemPtr = switches.fromPtr;
- itemPtr = (itemPtr == NULL) ? FirstItem(comboPtr) : NextItem(itemPtr);
- want = Tcl_UniCharAtIndex(pattern, 0);
- want = Tcl_UniCharToLower(want);
- for (/*empty*/; itemPtr != NULL; itemPtr = NextItem(itemPtr)) {
- if (itemPtr->underline >= 0) {
- Tcl_UniChar have;
-
- have = Tcl_UniCharAtIndex(itemPtr->label, itemPtr->underline);
- have = Tcl_UniCharToLower(have);
- if (want == have) {
- index = itemPtr->index;
- break;
- }
- }
- }
- if (itemPtr == NULL) {
- for (itemPtr = FirstItem(comboPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- if (itemPtr->underline >= 0) {
- Tcl_UniChar have;
-
- have = Tcl_UniCharAtIndex(itemPtr->label,
- itemPtr->underline);
- have = Tcl_UniCharToLower(have);
- if (want == have) {
- index = itemPtr->index;
- break;
- }
- }
- if (itemPtr == comboPtr->activePtr) {
- break;
- }
- }
- }
- } else if (switches.mask & FIND_DECREASING) {
- Item *itemPtr;
-
- itemPtr = switches.fromPtr;
- itemPtr = (itemPtr == NULL) ? LastItem(comboPtr) : PrevItem(itemPtr);
- for (/*empty*/; itemPtr != NULL; itemPtr = PrevItem(itemPtr)) {
- int found;
-
- if ((switches.type > 0) && ((switches.type & itemPtr->flags)==0)) {
- continue;
- }
- if (switches.mask & FIND_GLOB) {
- found = Tcl_StringMatch(itemPtr->label, pattern);
- } else if (switches.mask & FIND_REGEXP) {
- found = Tcl_RegExpMatch(NULL, itemPtr->label, pattern);
- } else {
- found = (strcmp(itemPtr->label, pattern) == 0);
- }
- if (found) {
- index = itemPtr->index;
- break;
- }
- }
- } else {
- Blt_ChainLink link;
- Item *itemPtr;
-
- itemPtr = switches.fromPtr;
- itemPtr = (itemPtr == NULL) ? FirstItem(comboPtr) : NextItem(itemPtr);
- for (link = itemPtr->link; link != NULL;
- link = Blt_Chain_NextLink(link)) {
- int found;
-
- itemPtr = Blt_Chain_GetValue(link);
- if ((switches.type > 0) && ((switches.type & itemPtr->flags)==0)) {
- continue;
- }
- if (switches.search == FIND_GLOB) {
- found = Tcl_StringMatch(itemPtr->label, pattern);
- } else if (switches.search == FIND_REGEXP) {
- found = Tcl_RegExpMatch(NULL, itemPtr->label, pattern);
- } else {
- found = (strcmp(itemPtr->label, pattern) == 0);
- }
- if (found) {
- index = itemPtr->index;
- break;
- }
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm index item
- *
- *---------------------------------------------------------------------------
- */
-static int
-IndexOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- int index;
-
- index = -1;
- if (GetItemFromObj(NULL, comboPtr, objv[2], &itemPtr) == TCL_OK) {
- if (itemPtr != NULL) {
- index = itemPtr->index;
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InvokeOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm invoke item
- *
- *---------------------------------------------------------------------------
- */
-static int
-InvokeOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int result;
- Item *itemPtr;
-
- if (GetItemFromObj(interp, comboPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((itemPtr == NULL) || (itemPtr->flags & ITEM_DISABLED)) {
- return TCL_OK; /* Item is currently disabled. */
- }
- result = TCL_OK;
- Tcl_Preserve(itemPtr);
- result = SelectItem(interp, comboPtr, itemPtr, -1);
- /*
- * We check nItems in addition to whether the item has a command because
- * that goes to zero if the combomenu is deleted (e.g., during command
- * evaluation).
- */
- if ((Blt_Chain_GetLength(comboPtr->chain) > 0) && (result == TCL_OK) &&
- (itemPtr->cmdObjPtr != NULL)) {
- Tcl_IncrRefCount(itemPtr->cmdObjPtr);
- result = Tcl_EvalObjEx(interp, itemPtr->cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(itemPtr->cmdObjPtr);
- }
- Tcl_Release(itemPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InsertOp --
- *
- * Inserts a new item into the combomenu at the given index.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The combomenu gets a new item.
- *
- * .cm insert before 0 after 1 -text label
- *
- *---------------------------------------------------------------------------
- */
-static int
-InsertOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr, *wherePtr;
- int dir;
- static const char *dirs[] = { "after", "at", "before" , NULL};
-
- if (Tcl_GetIndexFromObj(interp, objv[2], dirs, "key", 0, &dir) != TCL_OK) {
- return TCL_ERROR;
- }
- if (GetItemFromObj(interp, comboPtr, objv[3], &wherePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (wherePtr == NULL) {
- Tcl_AppendResult(interp, "can't insert item: no index \"",
- Tcl_GetString(objv[3]), "\"", (char *)NULL);
- return TCL_ERROR; /* No item. */
- }
- itemPtr = NewItem(comboPtr);
- if (ConfigureItem(interp, itemPtr, objc - 4, objv + 4, 0) != TCL_OK) {
- DestroyItem(itemPtr);
- return TCL_ERROR; /* Error configuring the entry. */
- }
- MoveItem(comboPtr, itemPtr, dir, wherePtr);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ItemConfigureOp --
- *
- * This procedure handles item operations.
- *
- * Results:
- * A standard TCL result.
- *
- * .cm item configure item ?option value?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ItemConfigureOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- ItemIterator iter;
-
- if (GetItemIterator(interp, comboPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- iconOption.clientData = comboPtr;
- for (itemPtr = FirstTaggedItem(&iter); itemPtr != NULL;
- itemPtr = NextTaggedItem(&iter)) {
- int result;
- unsigned int flags;
-
- flags = BLT_CONFIG_OBJV_ONLY;
- if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin,
- itemConfigSpecs, (char *)itemPtr, (Tcl_Obj *)NULL, flags);
- } else if (objc == 5) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin,
- itemConfigSpecs, (char *)itemPtr, objv[4], flags);
- }
- Tcl_Preserve(itemPtr);
- result = ConfigureItem(interp, itemPtr, objc - 4, objv + 4, flags);
- Tcl_Release(itemPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- }
- comboPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ItemCgetOp --
- *
- * This procedure handles item operations.
- *
- * Results:
- * A standard TCL result.
- *
- * .cm item cget item option
- *
- *---------------------------------------------------------------------------
- */
-static int
-ItemCgetOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
-
- if (GetItemFromObj(interp, comboPtr, objv[3], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- Tcl_AppendResult(interp, "can't retrieve item \"",
- Tcl_GetString(objv[3]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- iconOption.clientData = comboPtr;
- return Blt_ConfigureValueFromObj(interp, comboPtr->tkwin, itemConfigSpecs,
- (char *)itemPtr, objv[4], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ItemOp --
- *
- * This procedure handles item operations.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec itemOps[] = {
- {"cget", 2, ItemCgetOp, 5, 5, "item option",},
- {"configure", 2, ItemConfigureOp, 4, 0, "item ?option value?...",},
-};
-
-static int nItemOps = sizeof(itemOps) / sizeof(Blt_OpSpec);
-
-static int
-ItemOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- ComboMenuCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nItemOps, itemOps, BLT_OP_ARG2, objc, objv,
- 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (comboPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * .cm names pattern...
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NamesOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- int i;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (i = 2; i < objc; i++) {
- const char *pattern;
- Blt_ChainLink link;
-
- pattern = Tcl_GetString(objv[i]);
- for (link = Blt_Chain_FirstLink(comboPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
- Tcl_Obj *objPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- if (Tcl_StringMatch(itemPtr->label, pattern)) {
- if (itemPtr->label == emptyString) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- objPtr = Tcl_NewStringObj(itemPtr->label, -1);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-NearestOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int x, y;
- int wx, wy;
- Item *itemPtr;
- int isRoot;
- char *string;
-
- isRoot = FALSE;
- string = Tcl_GetString(objv[2]);
- if (strcmp("-root", string) == 0) {
- isRoot = TRUE;
- objv++, objc--;
- }
- if (objc < 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ", Tcl_GetString(objv[1]),
- " ?-root? x y\"", (char *)NULL);
- return TCL_ERROR;
-
- }
- if ((Tk_GetPixelsFromObj(interp, comboPtr->tkwin, objv[2], &x) != TCL_OK) ||
- (Tk_GetPixelsFromObj(interp, comboPtr->tkwin, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (isRoot) {
- int rootX, rootY;
-
- Tk_GetRootCoords(comboPtr->tkwin, &rootX, &rootY);
- x -= rootX;
- y -= rootY;
- }
- itemPtr = NearestItem(comboPtr, x, y, TRUE);
- if (itemPtr == NULL) {
- return TCL_OK;
- }
- x = WORLDX(comboPtr, x);
- y = WORLDY(comboPtr, y);
- wx = itemPtr->xWorld + ITEM_XPAD;
- wy = itemPtr->xWorld + ITEM_XPAD;
- if (objc > 4) {
- const char *where;
-
- where = "";
- if (itemPtr->flags & (ITEM_RADIOBUTTON | ITEM_CHECKBUTTON)) {
- int bx, by, bw, bh;
-
- bx = wx;
- by = wy;
- if (itemPtr->flags & ITEM_RADIOBUTTON) {
- bw = IconWidth(comboPtr->rbIcon);
- bh = IconHeight(comboPtr->rbIcon);
- } else {
- bw = IconWidth(comboPtr->cbIcon);
- bh = IconHeight(comboPtr->cbIcon);
- }
- wx += comboPtr->leftIndWidth + ITEM_IPAD;
- if ((x >= bx) && (x < (bx + bw)) && (y >= by) && (y < (by + bh))) {
- if (itemPtr->flags & ITEM_RADIOBUTTON) {
- where = "radiobutton";
- } else {
- where = "checkbutton";
- }
- goto done;
- }
- }
- if (itemPtr->icon != NULL) {
- int ix, iy, iw, ih;
-
- ih = IconHeight(itemPtr->icon);
- iw = IconWidth(itemPtr->icon);
- ix = wx;
- iy = wy;
- wx += comboPtr->iconWidth + ITEM_IPAD;
- if ((x >= ix) && (x <= (ix + iw)) && (y >= iy) && (y < (iy + ih))) {
- where = "icon";
- goto done;
- }
- }
- if ((itemPtr->label != emptyString) || (itemPtr->image != NULL)) {
- int lx, ly;
-
- lx = wx;
- ly = wy;
-
- wx += comboPtr->labelWidth + ITEM_IPAD;
- if ((x >= lx) && (x < (lx + itemPtr->labelWidth)) &&
- (y >= ly) && (y < (ly + itemPtr->labelHeight))) {
- where = "label";
- goto done;
- }
- }
- if ((itemPtr->accel != NULL) || (itemPtr->flags & ITEM_CASCADE)) {
- int ax, ay, aw, ah;
-
- ax = wx;
- ay = wy;
- aw = itemPtr->rightIndWidth;
- ah = itemPtr->rightIndHeight;
- if ((x >= ax) && (x < (ax + aw)) && (y >= ay) && (y < (ay + ah))) {
- if (itemPtr->flags & ITEM_CASCADE) {
- where = "cascade";
- } else {
- where = "accelerator";
- }
- goto done;
- }
-
- }
- done:
- if (Tcl_SetVar(interp, Tcl_GetString(objv[4]), where,
- TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), itemPtr->index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm next item
- *
- *---------------------------------------------------------------------------
- */
-static int
-NextOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- int index;
-
- index = -1;
- if (GetItemFromObj(NULL, comboPtr, objv[2], &itemPtr) == TCL_OK) {
- itemPtr = NextItem(itemPtr);
- if (itemPtr != NULL) {
- index = itemPtr->index;
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PostOp --
- *
- * Posts this menu at the given root screen coordinates.
- *
- * .cm post ?switches?
- *
- * -anchor ne -fill yes -width 80 -x -y
- * .cm post -x 0 -y 0 -reqwidth -reqheight -anchor -fill yes
- *---------------------------------------------------------------------------
- */
-static int
-PostOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int x, y;
- Tk_Window parent;
- int menuWidth;
-
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- parent = Tk_Parent(comboPtr->tkwin);
- comboPtr->parentWidth = 0;
- menuWidth = comboPtr->normalWidth;
- if (menuWidth < Tk_Width(parent)) {
- menuWidth = Tk_Width(parent);
- }
- if (objc == 5) {
- const char *string;
-
- string = Tcl_GetString(objv[4]);
- if (strcmp(string, "left") == 0) {
- /* Do nothing. */
- } else if (strcmp(string, "right") == 0) {
- x -= menuWidth;
- } else if (strcmp(string, "center") == 0) {
- x -= menuWidth / 2;
- } else if (strcmp(string, "popup") == 0) {
- /* Do nothing. */
- parent = comboPtr->tkwin;
- } else {
- Tcl_AppendResult(interp, "bad alignment value \"", string,
- "\": should be left, right, or center.", (char *)NULL);
- return TCL_ERROR;
- }
- comboPtr->parentWidth = Tk_Width(parent);
- }
- if (comboPtr->flags & LAYOUT_PENDING) {
- ComputeComboGeometry(comboPtr);
- }
- FixMenuCoords(comboPtr, parent, &x, &y);
- /*
- * If there is a post command for the menu, execute it. This may change
- * the size of the menu, so be sure to recompute the menu's geometry if
- * needed.
- */
- if (comboPtr->postCmdObjPtr != NULL) {
- int result;
-
- Tcl_IncrRefCount(comboPtr->postCmdObjPtr);
- result = Tcl_EvalObjEx(interp, comboPtr->postCmdObjPtr,
- TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(comboPtr->postCmdObjPtr);
- if (result != TCL_OK) {
- return result;
- }
- /*
- * The post commands could have deleted the menu, which means we are
- * dead and should go away.
- */
- if (comboPtr->tkwin == NULL) {
- return TCL_OK;
- }
- if (comboPtr->flags & LAYOUT_PENDING) {
- ComputeComboGeometry(comboPtr);
- }
- }
-
- /*
- * Adjust the position of the menu if necessary to keep it visible on the
- * screen. There are two special tricks to make this work right:
- *
- * 1. If a virtual root window manager is being used then
- * the coordinates are in the virtual root window of
- * menuPtr's parent; since the menu uses override-redirect
- * mode it will be in the *real* root window for the screen,
- * so we have to map the coordinates from the virtual root
- * (if any) to the real root. Can't get the virtual root
- * from the menu itself (it will never be seen by the wm)
- * so use its parent instead (it would be better to have an
- * an option that names a window to use for this...).
- * 2. The menu may not have been mapped yet, so its current size
- * might be the default 1x1. To compute how much space it
- * needs, use its requested size, not its actual size.
- *
- * Note that this code assumes square screen regions and all positive
- * coordinates. This does not work on a Mac with multiple monitors. But
- * then again, Tk has other problems with this.
- */
- {
- int vx, vy, vw, vh;
- int tmp;
- int screenWidth, screenHeight;
-
- Blt_SizeOfScreen(comboPtr->tkwin, &screenWidth, &screenHeight);
- Tk_GetVRootGeometry(parent, &vx, &vy, &vw, &vh);
- x += vx;
- y += vy;
- tmp = screenWidth - Tk_Width(comboPtr->tkwin);
- if (x > tmp) {
- x = tmp;
- }
- if (x < 0) {
- x = 0;
- }
- tmp = screenHeight - Tk_Height(comboPtr->tkwin);
- if (y > tmp) {
- y = tmp;
- }
- if (y < 0) {
- y = 0;
- }
- Tk_MoveToplevelWindow(comboPtr->tkwin, x, y);
- if (!Tk_IsMapped(comboPtr->tkwin)) {
- Tk_MapWindow(comboPtr->tkwin);
- }
- Blt_MapToplevelWindow(comboPtr->tkwin);
- Blt_RaiseToplevelWindow(comboPtr->tkwin);
-#ifdef notdef
- TkWmRestackToplevel(comboPtr->tkwin, Above, NULL);
-#endif
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PostCascadeOp --
- *
- * Posts the menu of a cascade item. If the item is a cascade menu, then
- * the submenu is requested to be posted.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * The item's submenu may be posted.
- *
- * .cm postcascade item
- *
- *---------------------------------------------------------------------------
- */
-static int
-PostCascadeOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- char *string;
-
- string = Tcl_GetString(objv[2]);
- if (GetItemFromObj(interp, comboPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == comboPtr->postedPtr) {
- return TCL_OK; /* Nothing to do, submenu is already
- * posted. */
- }
- if (UnpostCascade(interp, comboPtr) != TCL_OK) {
- return TCL_ERROR; /* Error unposting submenu. */
- }
- if ((itemPtr != NULL) && (itemPtr->menuObjPtr != NULL) &&
- ((itemPtr->flags & (ITEM_CASCADE|ITEM_DISABLED)) == ITEM_CASCADE)) {
- return PostCascade(interp, comboPtr, itemPtr);
- }
- return TCL_OK; /* No menu to post. */
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PreviousOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm previous item
- *
- *---------------------------------------------------------------------------
- */
-static int
-PreviousOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- int index;
-
- index = -1;
- if (GetItemFromObj(NULL, comboPtr, objv[2], &itemPtr) == TCL_OK) {
- itemPtr = PrevItem(itemPtr);
- if (itemPtr != NULL) {
- index = itemPtr->index;
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScanOp --
- *
- * Implements the quick scan.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ScanOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int oper;
- int x, y;
-
-#define SCAN_MARK 1
-#define SCAN_DRAGTO 2
- {
- char *string;
- char c;
- int length;
-
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- if ((c == 'm') && (strncmp(string, "mark", length) == 0)) {
- oper = SCAN_MARK;
- } else if ((c == 'd') && (strncmp(string, "dragto", length) == 0)) {
- oper = SCAN_DRAGTO;
- } else {
- Tcl_AppendResult(interp, "bad scan operation \"", string,
- "\": should be either \"mark\" or \"dragto\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if ((Blt_GetPixelsFromObj(interp, comboPtr->tkwin, objv[3], PIXELS_ANY, &x)
- != TCL_OK) ||
- (Blt_GetPixelsFromObj(interp, comboPtr->tkwin, objv[4], PIXELS_ANY, &y)
- != TCL_OK)) {
- return TCL_ERROR;
- }
- if (oper == SCAN_MARK) {
- comboPtr->scanAnchorX = x;
- comboPtr->scanAnchorY = y;
- comboPtr->scanX = comboPtr->xOffset;
- comboPtr->scanY = comboPtr->yOffset;
- } else {
- int xWorld, yWorld;
- int viewWidth, viewHeight;
- int dx, dy;
-
- dx = comboPtr->scanAnchorX - x;
- dy = comboPtr->scanAnchorY - y;
- xWorld = comboPtr->scanX + (10 * dx);
- yWorld = comboPtr->scanY + (10 * dy);
-
- viewWidth = VPORTWIDTH(comboPtr);
- if (xWorld > (comboPtr->worldWidth - viewWidth)) {
- xWorld = comboPtr->worldWidth - viewWidth;
- }
- if (xWorld < 0) {
- xWorld = 0;
- }
- viewHeight = VPORTHEIGHT(comboPtr);
- if (yWorld > (comboPtr->worldHeight - viewHeight)) {
- yWorld = comboPtr->worldHeight - viewHeight;
- }
- if (yWorld < 0) {
- yWorld = 0;
- }
- comboPtr->xOffset = xWorld;
- comboPtr->yOffset = yWorld;
- comboPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(comboPtr);
- }
- return TCL_OK;
-}
-
-
-/*ARGSUSED*/
-static int
-SeeOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- int x, y, w, h;
- Tk_Anchor anchor;
- int left, right, top, bottom;
- char *string;
-
- string = Tcl_GetString(objv[2]);
- anchor = TK_ANCHOR_W; /* Default anchor is West */
- if ((string[0] == '-') && (strcmp(string, "-anchor") == 0)) {
- if (objc == 3) {
- Tcl_AppendResult(interp, "missing \"-anchor\" argument",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Tk_GetAnchorFromObj(interp, objv[3], &anchor) != TCL_OK) {
- return TCL_ERROR;
- }
- objc -= 2, objv += 2;
- }
- if (objc == 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", objv[0],
- "see ?-anchor anchor? item\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (GetItemFromObj(interp, comboPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- return TCL_OK;
- }
-
- w = VPORTWIDTH(comboPtr);
- h = VPORTHEIGHT(comboPtr);
-
- /*
- * XVIEW: If the entry is left or right of the current view, adjust
- * the offset. If the entry is nearby, adjust the view just
- * a bit. Otherwise, center the entry.
- */
- left = comboPtr->xOffset;
- right = comboPtr->xOffset + w;
-
- switch (anchor) {
- case TK_ANCHOR_W:
- case TK_ANCHOR_NW:
- case TK_ANCHOR_SW:
- x = 0;
- break;
- case TK_ANCHOR_E:
- case TK_ANCHOR_NE:
- case TK_ANCHOR_SE:
- x = itemPtr->xWorld + itemPtr->width - w;
- break;
- default:
- if (itemPtr->xWorld < left) {
- x = itemPtr->xWorld;
- } else if ((itemPtr->xWorld + itemPtr->width) > right) {
- x = itemPtr->xWorld + itemPtr->width - w;
- } else {
- x = comboPtr->xOffset;
- }
- break;
- }
-
- /*
- * YVIEW: If the entry is above or below the current view, adjust
- * the offset. If the entry is nearby, adjust the view just
- * a bit. Otherwise, center the entry.
- */
- top = comboPtr->yOffset;
- bottom = comboPtr->yOffset + h;
-
- switch (anchor) {
- case TK_ANCHOR_N:
- y = comboPtr->yOffset;
- break;
- case TK_ANCHOR_NE:
- case TK_ANCHOR_NW:
- y = itemPtr->yWorld - (h / 2);
- break;
- case TK_ANCHOR_S:
- case TK_ANCHOR_SE:
- case TK_ANCHOR_SW:
- y = itemPtr->yWorld + itemPtr->height - h;
- break;
- default:
- if (itemPtr->yWorld < top) {
- y = itemPtr->yWorld;
- } else if ((itemPtr->yWorld + itemPtr->height) > bottom) {
- y = itemPtr->yWorld + itemPtr->height - h;
- } else {
- y = comboPtr->yOffset;
- }
- break;
- }
- if ((y != comboPtr->yOffset) || (x != comboPtr->xOffset)) {
- comboPtr->xOffset = x;
- comboPtr->yOffset = y;
- comboPtr->flags |= SCROLL_PENDING;
- }
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InvokeOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm select item
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- const char *cmd;
- int result;
-
- if (GetItemFromObj(interp, comboPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((itemPtr == NULL) || (itemPtr->flags & ITEM_DISABLED)) {
- return TCL_OK; /* Item is currently disabled. */
- }
- cmd = Tcl_GetString(objv[1]);
- Tcl_Preserve(itemPtr);
- result = SelectItem(interp, comboPtr, itemPtr, cmd[0] == 's');
- Tcl_Release(itemPtr);
- return result;
-}
-
-/*ARGSUSED*/
-static int
-SizeOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_SetLongObj(Tcl_GetObjResult(interp),
- Blt_Chain_GetLength(comboPtr->chain));
- return TCL_OK;
-}
-
-/* .m style create name option value option value */
-
-static int
-StyleCreateOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Style *stylePtr;
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&comboPtr->styleTable, Tcl_GetString(objv[3]),
- &isNew);
- if (!isNew) {
- Tcl_AppendResult(interp, "combomenu style \"", Tcl_GetString(objv[3]),
- "\" already exists.", (char *)NULL);
- return TCL_ERROR;
- }
- stylePtr = Blt_AssertCalloc(1, sizeof(Style));
- stylePtr->name = Blt_GetHashKey(&comboPtr->styleTable, hPtr);
- stylePtr->hPtr = hPtr;
- stylePtr->comboPtr = comboPtr;
- stylePtr->borderWidth = 0;
- stylePtr->activeRelief = TK_RELIEF_RAISED;
- Blt_SetHashValue(hPtr, stylePtr);
- iconOption.clientData = comboPtr;
- if (ConfigureStyle(interp, stylePtr, objc - 4, objv + 4, 0) != TCL_OK) {
- DestroyStyle(stylePtr);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-StyleCgetOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Style *stylePtr;
-
- if (GetStyleFromObj(interp, comboPtr, objv[3], &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- iconOption.clientData = comboPtr;
- return Blt_ConfigureValueFromObj(interp, comboPtr->tkwin, styleConfigSpecs,
- (char *)stylePtr, objv[4], 0);
-}
-
-static int
-StyleConfigureOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int result, flags;
- Style *stylePtr;
-
- if (GetStyleFromObj(interp, comboPtr, objv[3], &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- iconOption.clientData = comboPtr;
- flags = BLT_CONFIG_OBJV_ONLY;
- if (objc == 1) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin,
- styleConfigSpecs, (char *)stylePtr, (Tcl_Obj *)NULL, flags);
- } else if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin,
- styleConfigSpecs, (char *)stylePtr, objv[2], flags);
- }
- Tcl_Preserve(stylePtr);
- result = ConfigureStyle(interp, stylePtr, objc - 4, objv + 4, flags);
- Tcl_Release(stylePtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- comboPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-static int
-StyleDeleteOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Style *stylePtr;
-
- if (GetStyleFromObj(interp, comboPtr, objv[3], &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (stylePtr->refCount > 0) {
- Tcl_AppendResult(interp, "can't destroy combomenu style \"",
- stylePtr->name, "\": style in use.", (char *)NULL);
- return TCL_ERROR;
- }
- DestroyStyle(stylePtr);
- return TCL_OK;
-}
-
-static int
-StyleNamesOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&comboPtr->styleTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Style *stylePtr;
- int found;
- int i;
-
- found = TRUE;
- stylePtr = Blt_GetHashValue(hPtr);
- for (i = 3; i < objc; i++) {
- const char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- found = Tcl_StringMatch(stylePtr->name, pattern);
- if (found) {
- break;
- }
- }
- if (found) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(stylePtr->name, -1));
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-static Blt_OpSpec styleOps[] =
-{
- {"cget", 2, StyleCgetOp, 5, 5, "name option",},
- {"configure", 2, StyleConfigureOp, 4, 0, "name ?option value?...",},
- {"create", 2, StyleCreateOp, 4, 0, "name ?option value?...",},
- {"delete", 1, StyleDeleteOp, 3, 0, "?name...?",},
- {"names", 1, StyleNamesOp, 3, 0, "?pattern...?",},
-};
-
-static int nStyleOps = sizeof(styleOps) / sizeof(Blt_OpSpec);
-
-static int
-StyleOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- ComboMenuCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nStyleOps, styleOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (comboPtr, interp, objc, objv);
- return result;
-}
-
-static int
-TypeOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Item *itemPtr;
-
- if (GetItemFromObj(interp, comboPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr != NULL) {
- const char *name;
-
- name = NameOfType(itemPtr->flags);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), name, -1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnpostOp --
- *
- * Unposts this menu.
- *
- * .cm post
- *
- *---------------------------------------------------------------------------
- */
-static int
-UnpostOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- if (!Tk_IsMapped(comboPtr->tkwin)) {
- return TCL_OK; /* This menu is already unposted. */
- }
- /* Deactivate the current item. */
- if (comboPtr->postedPtr != NULL) {
- if (UnpostCascade(interp, comboPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- comboPtr->postedPtr = NULL;
- }
- if (Tk_IsMapped(comboPtr->tkwin)) {
- Tk_UnmapWindow(comboPtr->tkwin);
- }
- /*
- * If there is a post command for the menu, execute it. This may change
- * the size of the menu, so be sure to recompute the menu's geometry if
- * needed.
- */
- if (comboPtr->unpostCmdObjPtr != NULL) {
- int result;
-
- Tcl_IncrRefCount(comboPtr->unpostCmdObjPtr);
- result = Tcl_EvalObjEx(interp, comboPtr->unpostCmdObjPtr,
- TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(comboPtr->unpostCmdObjPtr);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-static int
-XpositionOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
-
- if (GetItemFromObj(interp, comboPtr, objv[3], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- Tcl_AppendResult(interp, "can't get x-position of item: no item \"",
- Tcl_GetString(objv[3]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), itemPtr->xWorld-comboPtr->xOffset);
- return TCL_OK;
-}
-
-static int
-XviewOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int w;
-
- w = VPORTWIDTH(comboPtr);
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr, *objPtr;
-
- /* Report first and last fractions */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- /*
- * Note: we are bounding the fractions between 0.0 and 1.0 to support
- * the "canvas"-style of scrolling.
- */
- fract = (double)comboPtr->xOffset / (comboPtr->worldWidth+1);
- objPtr = Tcl_NewDoubleObj(FCLAMP(fract));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- fract = (double)(comboPtr->xOffset + w) / (comboPtr->worldWidth+1);
- objPtr = Tcl_NewDoubleObj(FCLAMP(fract));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2, &comboPtr->xOffset,
- comboPtr->worldWidth, w, comboPtr->xScrollUnits,
- BLT_SCROLL_MODE_HIERBOX) != TCL_OK) {
- return TCL_ERROR;
- }
- comboPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-static int
-YpositionOp(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
-
- if (GetItemFromObj(interp, comboPtr, objv[3], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- Tcl_AppendResult(interp, "can't get y-position of item: such index \"",
- Tcl_GetString(objv[3]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), itemPtr->yWorld-comboPtr->yOffset);
- return TCL_OK;
-}
-
-static int
-YviewOp(
- ComboMenu *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int height;
-
- height = VPORTHEIGHT(comboPtr);
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr, *objPtr;
-
- /* Report first and last fractions */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- /*
- * Note: we are bounding the fractions between 0.0 and 1.0 to support
- * the "canvas"-style of scrolling.
- */
- fract = (double)comboPtr->yOffset / (comboPtr->worldHeight+1);
- objPtr = Tcl_NewDoubleObj(FCLAMP(fract));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- fract = (double)(comboPtr->yOffset + height) /(comboPtr->worldHeight+1);
- objPtr = Tcl_NewDoubleObj(FCLAMP(fract));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2, &comboPtr->yOffset,
- comboPtr->worldHeight, height, comboPtr->yScrollUnits,
- BLT_SCROLL_MODE_HIERBOX) != TCL_OK) {
- return TCL_ERROR;
- }
- comboPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyComboMenu --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the internal structure of the widget at a safe time (when
- * no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyComboMenu(DestroyData dataPtr) /* Pointer to the widget record. */
-{
- ComboMenu *comboPtr = (ComboMenu *)dataPtr;
-
- if (comboPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayComboMenu, comboPtr);
- }
- if (comboPtr->flags & INSTALL_XSCROLLBAR) {
- Tcl_CancelIdleCall(InstallXScrollbar, comboPtr);
- }
- if (comboPtr->flags & INSTALL_YSCROLLBAR) {
- Tcl_CancelIdleCall(InstallYScrollbar, comboPtr);
- }
- if (comboPtr->flags & UPDATE_PENDING) {
- Tcl_CancelIdleCall(ConfigureScrollbarsProc, comboPtr);
- }
- DestroyItems(comboPtr);
- DestroyStyles(comboPtr);
- DestroyLabels(comboPtr);
- Blt_DeleteHashTable(&comboPtr->tagTable);
- DestroyIcons(comboPtr);
- if (comboPtr->painter != NULL) {
- Blt_FreePainter(comboPtr->painter);
- }
- iconOption.clientData = comboPtr;
- Blt_FreeOptions(comboConfigSpecs, (char *)comboPtr, comboPtr->display, 0);
- Tcl_DeleteCommandFromToken(comboPtr->interp, comboPtr->cmdToken);
- Blt_Free(comboPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewComboMenu --
- *
- *---------------------------------------------------------------------------
- */
-static ComboMenu *
-NewComboMenu(Tcl_Interp *interp, Tk_Window tkwin)
-{
- ComboMenu *comboPtr;
-
- comboPtr = Blt_AssertCalloc(1, sizeof(ComboMenu));
-
- Tk_SetClass(tkwin, "ComboMenu");
-
- comboPtr->tkwin = tkwin;
- comboPtr->display = Tk_Display(tkwin);
- comboPtr->interp = interp;
- comboPtr->flags |= LAYOUT_PENDING | SCROLL_PENDING;
- comboPtr->relief = TK_RELIEF_SOLID;
- comboPtr->xScrollUnits = 2;
- comboPtr->yScrollUnits = 2;
- comboPtr->borderWidth = 1;
- comboPtr->chain = Blt_Chain_Create();
- comboPtr->painter = Blt_GetPainter(tkwin, 1.0);
- Blt_ResetLimits(&comboPtr->reqWidth);
- Blt_ResetLimits(&comboPtr->reqHeight);
- Blt_InitHashTable(&comboPtr->iconTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&comboPtr->labelTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&comboPtr->styleTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&comboPtr->tagTable, BLT_STRING_KEYS);
- AddDefaultStyle(interp, comboPtr);
- Blt_SetWindowInstanceData(tkwin, comboPtr);
- return comboPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboMenuCmd --
- *
- * This procedure is invoked to process the "combomenu" command. See the
- * user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec menuOps[] =
-{
- {"activate", 2, ActivateOp, 3, 3, "item",},
- {"add", 2, AddOp, 2, 0, "?option value?",},
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"configure", 2, ConfigureOp, 2, 0, "?option value?...",},
- {"delete", 3, DeleteOp, 2, 0, "items...",},
- {"deselect", 3, SelectOp, 3, 3, "item",},
- {"exists", 3, ExistsOp, 3, 3, "item",},
- {"find", 1, FindOp, 3, 0, "string ?switches?",},
- {"index", 3, IndexOp, 3, 3, "item",},
- {"insert", 3, InsertOp, 3, 0,
- "after|at|before index ?option value?",},
- {"invoke", 3, InvokeOp, 3, 3, "item",},
- {"item", 2, ItemOp, 2, 0, "oper args",},
- {"listadd", 1, AddListOp, 3, 0, "labelList ?option value?",},
- {"names", 2, NamesOp, 2, 0, "?pattern...?",},
- {"nearest", 3, NearestOp, 4, 4, "x y",},
- {"next", 3, NextOp, 3, 3, "item",},
- {"post", 4, PostOp, 4, 5, "x y ?align?",},
- {"postcascade", 5, PostCascadeOp, 3, 3, "item",},
- {"previous", 2, PreviousOp, 3, 3, "item",},
- {"scan", 2, ScanOp, 5, 5, "dragto|mark x y",},
- {"see", 3, SeeOp, 3, 5, "item",},
- {"select", 3, SelectOp, 3, 3, "item",},
- {"size", 2, SizeOp, 2, 2, "",},
- {"style", 2, StyleOp, 2, 0, "op ?args...?",},
- {"type", 1, TypeOp, 3, 3, "item",},
- {"unpost", 1, UnpostOp, 2, 2, "",},
- {"xposition", 2, XpositionOp, 3, 3, "item",},
- {"xview", 2, XviewOp, 2, 5,
- "?moveto fract? ?scroll number what?",},
- {"yposition", 2, YpositionOp, 3, 3, "item",},
- {"yview", 2, YviewOp, 2, 5,
- "?moveto fract? ?scroll number what?",},
-};
-
-static int nMenuOps = sizeof(menuOps) / sizeof(Blt_OpSpec);
-
-typedef int (ComboInstOp)(ComboMenu *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-static int
-ComboMenuInstCmdProc(
- ClientData clientData, /* Information about the widget. */
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to. */
- int objc, /* # of arguments. */
- Tcl_Obj *const *objv) /* Argument vector. */
-{
- ComboInstOp *proc;
- ComboMenu *comboPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nMenuOps, menuOps, BLT_OP_ARG1, objc, objv,
- 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(comboPtr);
- result = (*proc) (comboPtr, interp, objc, objv);
- Tcl_Release(comboPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboMenuInstCmdDeletedProc --
- *
- * This procedure can be called if the window was destroyed (tkwin will
- * be NULL) and the command was deleted automatically. In this case, we
- * need to do nothing.
- *
- * Otherwise this routine was called because the command was deleted.
- * Then we need to clean-up and destroy the widget.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComboMenuInstCmdDeletedProc(ClientData clientData)
-{
- ComboMenu *comboPtr = clientData; /* Pointer to widget record. */
-
- if (comboPtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = comboPtr->tkwin;
- comboPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboMenuCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-ComboMenuCmd(
- ClientData clientData, /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- ComboMenu *comboPtr;
- Tcl_CmdInfo cmdInfo;
- Tk_Window tkwin;
- XSetWindowAttributes attrs;
- char *path;
- unsigned int mask;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * First time in this interpreter, invoke a procedure to initialize
- * various bindings on the combomenu widget. If the procedure doesn't
- * already exist, source it from "$blt_library/combomenu.tcl". We
- * deferred sourcing the file until now so that the variable $blt_library
- * could be set within a script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::ComboMenu::PostMenu", &cmdInfo)) {
- if (Tcl_GlobalEval(interp,
- "source [file join $blt_library combomenu.tcl]") != TCL_OK) {
- char info[200];
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- return TCL_ERROR;
- }
- }
- path = Tcl_GetString(objv[1]);
-#define TOP_LEVEL_SCREEN ""
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), path,
- TOP_LEVEL_SCREEN);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- comboPtr = NewComboMenu(interp, tkwin);
- if (ConfigureComboMenu(interp, comboPtr, objc - 2, objv + 2, 0) != TCL_OK) {
- Tk_DestroyWindow(comboPtr->tkwin);
- return TCL_ERROR;
- }
- mask = (ExposureMask | StructureNotifyMask | FocusChangeMask);
- Tk_CreateEventHandler(tkwin, mask, ComboMenuEventProc, comboPtr);
- comboPtr->cmdToken = Tcl_CreateObjCommand(interp, path,
- ComboMenuInstCmdProc, comboPtr, ComboMenuInstCmdDeletedProc);
-
- attrs.override_redirect = True;
- attrs.backing_store = WhenMapped;
- attrs.save_under = True;
- mask = (CWOverrideRedirect | CWSaveUnder | CWBackingStore);
- Tk_ChangeWindowAttributes(tkwin, mask, &attrs);
-
- Tk_MakeWindowExist(tkwin);
- Tcl_SetObjResult(interp, objv[1]);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboViewCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-ComboViewCmd(
- ClientData clientData, /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* # of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- ComboMenu *comboPtr;
- Tcl_CmdInfo cmdInfo;
- Tk_Window tkwin;
- char *path;
- unsigned int mask;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * First time in this interpreter, invoke a procedure to initialize
- * various bindings on the combomenu widget. If the procedure doesn't
- * already exist, source it from "$blt_library/combomenu.tcl". We
- * deferred sourcing the file until now so that the variable $blt_library
- * could be set within a script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::ComboMenu::PostMenu", &cmdInfo)) {
- if (Tcl_GlobalEval(interp,
- "source [file join $blt_library combomenu.tcl]") != TCL_OK) {
- char info[200];
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- return TCL_ERROR;
- }
- }
- path = Tcl_GetString(objv[1]);
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), path, NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- comboPtr = NewComboMenu(interp, tkwin);
- if (ConfigureComboMenu(interp, comboPtr, objc - 2, objv + 2, 0) != TCL_OK) {
- Tk_DestroyWindow(comboPtr->tkwin);
- return TCL_ERROR;
- }
- mask = (ExposureMask | StructureNotifyMask | FocusChangeMask);
- Tk_CreateEventHandler(tkwin, mask, ComboMenuEventProc, comboPtr);
- comboPtr->cmdToken = Tcl_CreateObjCommand(interp, path,
- ComboMenuInstCmdProc, comboPtr, ComboMenuInstCmdDeletedProc);
-
- Tcl_SetObjResult(interp, objv[1]);
- return TCL_OK;
-}
-
-int
-Blt_ComboMenuInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec[2] = {
- { "combomenu", ComboMenuCmd },
- { "comboview", ComboViewCmd },
- };
- return Blt_InitCmds(interp, "::blt", cmdSpec, 2);
-}
-
-
-static void
-DrawItemBackground(Item *itemPtr, Drawable drawable, int x, int y)
-{
- Blt_Background bg;
- Style *stylePtr;
- ComboMenu *comboPtr;
- int relief;
- int w, h;
-
- stylePtr = itemPtr->stylePtr;
- comboPtr = itemPtr->comboPtr;
- relief = itemPtr->relief;
- if ((itemPtr->flags & (ITEM_DISABLED|ITEM_SEPARATOR)) == ITEM_DISABLED) {
- bg = stylePtr->disabledBg;
- } else if (comboPtr->activePtr == itemPtr) {
- bg = stylePtr->activeBg;
- relief = stylePtr->activeRelief;
- } else {
- bg = stylePtr->normalBg;
- }
- w = VPORTWIDTH(comboPtr);
- w = MAX(comboPtr->worldWidth, w);
- h = itemPtr->height;
-#ifndef notdef
- if (y == 0) {
- int xOrigin, yOrigin;
- int px, py;
-
- px = PIXMAPX(comboPtr, itemPtr->xWorld);
- py = PIXMAPY(comboPtr, itemPtr->yWorld);
- Blt_GetBackgroundOrigin(bg, &xOrigin, &yOrigin);
- Blt_SetBackgroundOrigin(comboPtr->tkwin, bg, px, py);
- Blt_FillBackgroundRectangle(comboPtr->tkwin, drawable, bg, x, y,
- w, h, stylePtr->borderWidth, relief);
- Blt_SetBackgroundOrigin(comboPtr->tkwin, bg, xOrigin, yOrigin);
- } else {
- Blt_FillBackgroundRectangle(comboPtr->tkwin, drawable, bg, x, y,
- w, h, stylePtr->borderWidth, relief);
- }
-#else
- Blt_FillBackgroundRectangle(comboPtr->tkwin, drawable, bg, x, y, w, h,
- stylePtr->borderWidth, relief);
-#endif
-}
-
-static void
-DrawSeparator(Item *itemPtr, Drawable drawable, int x, int y, int w, int h)
-{
- XPoint points[2];
- Tk_3DBorder border;
- ComboMenu *comboPtr;
- Style *stylePtr;
-
- comboPtr = itemPtr->comboPtr;
- stylePtr = itemPtr->stylePtr;
- border = Blt_BackgroundBorder(stylePtr->normalBg);
- points[0].x = x + ITEM_XPAD;
- points[0].y = y + h / 2;
- points[1].x = w - 2 * ITEM_XPAD;
- points[1].y = points[0].y;
- Tk_Draw3DPolygon(comboPtr->tkwin, drawable, border, points, 2, 1,
- TK_RELIEF_SUNKEN);
-}
-
-static void
-DrawCheckButton(Item *itemPtr, Drawable drawable, int x, int y, int w, int h)
-{
- Style *stylePtr;
- Display *display;
- ComboMenu *comboPtr;
- XColor *outlineColor, *fillColor, *checkColor;
-
- comboPtr = itemPtr->comboPtr;
- Blt_Picture picture;
- int on;
- stylePtr = itemPtr->stylePtr;
- display = itemPtr->comboPtr->display;
- on = (itemPtr->flags & ITEM_SELECTED);
- fillColor = (stylePtr->indFillColor)
- ? stylePtr->indFillColor : comboPtr->checkButtonFillColor;
- outlineColor = (stylePtr->indOutlineColor)
- ? stylePtr->indOutlineColor : comboPtr->checkButtonOutlineColor;
- checkColor = (stylePtr->indColor)
- ? stylePtr->indColor : comboPtr->checkButtonColor;
- if (itemPtr->flags & ITEM_DISABLED) {
- if (stylePtr->checkbutton[0] == NULL) {
- if (fillColor != NULL) {
- fillColor = Blt_BackgroundBorderColor(stylePtr->disabledBg);
- }
- if (outlineColor != NULL) {
- outlineColor = stylePtr->labelDisabledColor;
- }
- stylePtr->checkbutton[0] =
- Blt_PaintCheckbox(w, h, fillColor, outlineColor,
- Blt_BackgroundBorderColor(stylePtr->disabledBg),
- FALSE);
- }
- picture = stylePtr->checkbutton[0];
- } else {
- Blt_Picture *picturePtr;
-
- picturePtr = (on) ? stylePtr->checkbutton + 1 :
- stylePtr->checkbutton + 2;
- if (*picturePtr == NULL) {
- *picturePtr = Blt_PaintCheckbox(w, h, fillColor, outlineColor,
- checkColor, on);
- }
- picture = *picturePtr;
- }
- Blt_PaintPicture(comboPtr->painter, drawable, picture, 0, 0, w, h, x, y, 0);
-}
-
-static void
-DrawRadioButton(Item *itemPtr, Drawable drawable, int x, int y, int w, int h)
-{
- Style *stylePtr;
- Display *display;
- ComboMenu *comboPtr;
- Blt_Picture picture;
- int on;
-
- comboPtr = itemPtr->comboPtr;
- stylePtr = itemPtr->stylePtr;
- display = itemPtr->comboPtr->display;
-
- on = (itemPtr->flags & ITEM_SELECTED);
- if (itemPtr->flags & ITEM_DISABLED) {
- picture = stylePtr->radiobutton[0];
- if (picture == NULL) {
- picture = Blt_PaintRadioButton(w, h,
- Blt_BackgroundBorderColor(stylePtr->disabledBg),
- stylePtr->labelDisabledColor,
- stylePtr->labelDisabledColor,
- FALSE);
- stylePtr->radiobutton[0] = picture;
- }
- } else {
- Blt_Picture *picturePtr;
-
- picturePtr = (on) ? stylePtr->radiobutton + 1 :
- stylePtr->radiobutton + 2;
- if (*picturePtr == NULL) {
- XColor *fillColor, *circleColor, *outlineColor;
-
- fillColor = (stylePtr->indFillColor)
- ? stylePtr->indFillColor : comboPtr->radioButtonFillColor;
- outlineColor = (stylePtr->indOutlineColor)
- ? stylePtr->indOutlineColor : comboPtr->radioButtonOutlineColor;
- circleColor = (stylePtr->indColor)
- ? stylePtr->indColor : comboPtr->radioButtonColor;
- *picturePtr = Blt_PaintRadioButton(w, h, fillColor, outlineColor,
- circleColor, on);
- }
- picture = *picturePtr;
- }
- Blt_PaintPicture(comboPtr->painter, drawable, picture, 0, 0, w, h, x, y, 0);
-}
-
-static void
-DrawItem(Item *itemPtr, Drawable drawable, int x, int y)
-{
- ComboMenu *comboPtr;
- Style *stylePtr;
- int x0, w, h;
-
- itemPtr->flags &= ~ITEM_REDRAW;
- stylePtr = itemPtr->stylePtr;
- comboPtr = itemPtr->comboPtr;
- x0 = x;
- w = VPORTWIDTH(comboPtr) - 2 * stylePtr->borderWidth;
- x += stylePtr->borderWidth + comboPtr->borderWidth;
- h = itemPtr->height - 2 * stylePtr->borderWidth;
- y += stylePtr->borderWidth;
- if (itemPtr->flags & ITEM_SEPARATOR) {
- DrawSeparator(itemPtr, drawable, x, y, w, h);
- y += ITEM_SEP_HEIGHT;
- } else {
- x += ITEM_IPAD;
- /* Radiobutton or checkbutton. */
- if (itemPtr->flags & (ITEM_RADIOBUTTON | ITEM_CHECKBUTTON)) {
- if (itemPtr->flags & ITEM_RADIOBUTTON) {
- DrawRadioButton(itemPtr, drawable, x,
- y + (h - itemPtr->leftIndHeight) / 2,
- itemPtr->leftIndWidth, itemPtr->leftIndHeight);
- } else if (itemPtr->flags & ITEM_CHECKBUTTON) {
- DrawCheckButton(itemPtr, drawable, x,
- y + (h - itemPtr->leftIndHeight) / 2,
- itemPtr->leftIndWidth, itemPtr->leftIndHeight);
- }
- }
- x += itemPtr->indent;
- if (comboPtr->leftIndWidth > 0) {
- x += comboPtr->leftIndWidth + ITEM_IPAD;
- }
- /* Icon. */
- if (itemPtr->icon != NULL) {
- if ((Blt_IsPicture(IconImage(itemPtr->icon))) &&
- (itemPtr->flags & ITEM_DISABLED)) {
- Blt_Picture picture;
- Blt_Painter painter;
-
- painter = Blt_GetPainter(comboPtr->tkwin, 1.0);
- picture = Blt_GetPictureFromPictureImage(comboPtr->interp,
- IconImage(itemPtr->icon));
- picture = Blt_GreyscalePicture(picture);
- Blt_PaintPicture(painter, drawable, picture, 0, 0,
- IconWidth(itemPtr->icon), IconHeight(itemPtr->icon),
- x + (comboPtr->iconWidth - itemPtr->iconWidth) / 2,
- y + (h - IconHeight(itemPtr->icon)) / 2, 0);
- Blt_FreePicture(picture);
- } else {
- Tk_RedrawImage(IconImage(itemPtr->icon), 0, 0,
- IconWidth(itemPtr->icon), IconHeight(itemPtr->icon),
- drawable,
- x + (comboPtr->iconWidth - itemPtr->iconWidth) / 2,
- y + (h - IconHeight(itemPtr->icon)) / 2);
- }
- if (comboPtr->iconWidth > 0) {
- x += comboPtr->iconWidth + ITEM_IPAD;
- }
- }
- /* Image or label. */
- if (itemPtr->image != NULL) {
- Tk_RedrawImage(IconImage(itemPtr->image), 0, 0,
- IconWidth(itemPtr->image), IconHeight(itemPtr->image),
- drawable, x, y + (h - IconHeight(itemPtr->image)) / 2);
- } else if (itemPtr->label != emptyString) {
- TextStyle ts;
- XColor *fg;
-
- if (itemPtr->flags & ITEM_DISABLED) {
- fg = stylePtr->labelDisabledColor;
- } else if (comboPtr->activePtr == itemPtr) {
- fg = stylePtr->labelActiveColor;
- } else {
- fg = stylePtr->labelNormalColor;
- }
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, stylePtr->labelFont);
- Blt_Ts_SetForeground(ts, fg);
- Blt_Ts_SetAnchor(ts, TK_ANCHOR_NW);
- Blt_Ts_SetUnderline(ts, itemPtr->underline);
- Blt_Ts_SetJustify(ts, TK_JUSTIFY_LEFT);
- Blt_DrawText(comboPtr->tkwin, drawable, (char *)itemPtr->label, &ts,
- x, y + (h - itemPtr->labelHeight) / 2);
- }
- x = x0 + MAX(comboPtr->worldWidth, VPORTWIDTH(comboPtr)) - 2*ITEM_IPAD;
- /* Accelerator or submenu arrow. */
- if (itemPtr->flags & ITEM_CASCADE) {
- XColor *color;
-
- if (itemPtr->flags & ITEM_DISABLED) {
- color = stylePtr->labelDisabledColor;
- } else if (comboPtr->activePtr == itemPtr) {
- color = stylePtr->labelActiveColor;
- } else {
- color = stylePtr->labelNormalColor;
- }
- x -= ITEM_R_IND_WIDTH;
- Blt_DrawArrow(comboPtr->display, drawable, color, x + ITEM_IPAD, y,
- ITEM_R_IND_WIDTH, h, 1, ARROW_RIGHT);
- } else if (itemPtr->accel != NULL) {
- TextStyle ts;
- XColor *fg;
-
- if (itemPtr->flags & ITEM_DISABLED) {
- fg = stylePtr->accelDisabledColor;
- } else if (comboPtr->activePtr == itemPtr) {
- fg = stylePtr->accelActiveColor;
- } else {
- fg = stylePtr->accelNormalColor;
- }
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetForeground(ts, fg);
- Blt_Ts_SetFont(ts, stylePtr->accelFont);
- Blt_Ts_SetAnchor(ts, TK_ANCHOR_NW);
- Blt_Ts_SetJustify(ts, TK_JUSTIFY_LEFT);
- x -= itemPtr->rightIndWidth;
- Blt_DrawText(comboPtr->tkwin, drawable, (char *)itemPtr->accel, &ts,
- x, y + (h - itemPtr->rightIndHeight) / 2);
- }
- }
-}
-
-
-static void
-DrawComboMenu(ComboMenu *comboPtr, Drawable drawable)
-{
- /* Draw each visible item. */
- if (comboPtr->firstPtr != NULL) {
- Blt_ChainLink first, last, link;
-
- first = comboPtr->firstPtr->link;
- last = comboPtr->lastPtr->link;
- for (link = first; link != NULL; link = Blt_Chain_NextLink(link)) {
- int x, y;
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- x = PIXMAPX(comboPtr, itemPtr->xWorld);
- y = PIXMAPY(comboPtr, itemPtr->yWorld);
- DrawItemBackground(itemPtr, drawable, x, y);
- DrawItem(itemPtr, drawable, x, y);
- if (link == last) {
- break;
- }
- }
- }
- /* Manage the geometry of the scrollbars. */
- if (comboPtr->yScrollbarWidth > 0) {
- int x, y;
- int yScrollbarHeight;
-
- x = Tk_Width(comboPtr->tkwin) - comboPtr->borderWidth -
- comboPtr->yScrollbarWidth;
- y = comboPtr->borderWidth;
- yScrollbarHeight = Tk_Height(comboPtr->tkwin) -
- comboPtr->xScrollbarHeight - 2 * comboPtr->borderWidth;
- if ((Tk_Width(comboPtr->yScrollbar) != comboPtr->yScrollbarWidth) ||
- (Tk_Height(comboPtr->yScrollbar) != yScrollbarHeight) ||
- (x != Tk_X(comboPtr->yScrollbar)) ||
- (y != Tk_Y(comboPtr->yScrollbar))) {
- Tk_MoveResizeWindow(comboPtr->yScrollbar, x, y,
- comboPtr->yScrollbarWidth, yScrollbarHeight);
- }
- if (!Tk_IsMapped(comboPtr->yScrollbar)) {
- Tk_MapWindow(comboPtr->yScrollbar);
- }
- } else if ((comboPtr->yScrollbar != NULL) &&
- (Tk_IsMapped(comboPtr->yScrollbar))) {
- Tk_UnmapWindow(comboPtr->yScrollbar);
- }
- if (comboPtr->xScrollbarHeight > 0) {
- int x, y;
- int xScrollbarWidth;
-
- x = comboPtr->borderWidth;
- y = Tk_Height(comboPtr->tkwin) - comboPtr->xScrollbarHeight -
- comboPtr->borderWidth;
- xScrollbarWidth = Tk_Width(comboPtr->tkwin) -
- comboPtr->yScrollbarWidth - 2 * comboPtr->borderWidth;
- if ((Tk_Width(comboPtr->xScrollbar) != xScrollbarWidth) ||
- (Tk_Height(comboPtr->xScrollbar) != comboPtr->xScrollbarHeight) ||
- (x != Tk_X(comboPtr->xScrollbar)) ||
- (y != Tk_Y(comboPtr->xScrollbar))) {
- Tk_MoveResizeWindow(comboPtr->xScrollbar, x, y, xScrollbarWidth,
- comboPtr->xScrollbarHeight);
- }
- if (!Tk_IsMapped(comboPtr->xScrollbar)) {
- Tk_MapWindow(comboPtr->xScrollbar);
- }
- } else if ((comboPtr->xScrollbar != NULL) &&
- (Tk_IsMapped(comboPtr->xScrollbar))) {
- Tk_UnmapWindow(comboPtr->xScrollbar);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayItem --
- *
- * This procedure is invoked to display an item in the combomenu widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the item.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayItem(ClientData clientData)
-{
- Item *itemPtr = clientData;
- int x, y, w, h, d, sy;
- Pixmap drawable;
- ComboMenu *comboPtr;
-
- /*
- * Create a pixmap the size of the item for double buffering.
- */
- comboPtr = itemPtr->comboPtr;
- h = itemPtr->height;
- w = VPORTWIDTH(comboPtr);
- drawable = Tk_GetPixmap(comboPtr->display, Tk_WindowId(comboPtr->tkwin),
- w, h, Tk_Depth(comboPtr->tkwin));
-#ifdef WIN32
- assert(drawable != None);
-#endif
- DrawItemBackground(itemPtr, drawable, -comboPtr->xOffset, 0);
- DrawItem(itemPtr, drawable, -comboPtr->xOffset, 0);
- x = PIXMAPX(comboPtr, itemPtr->xWorld) + comboPtr->borderWidth;
- y = PIXMAPY(comboPtr, itemPtr->yWorld) + comboPtr->borderWidth;
- sy = 0;
- d = comboPtr->borderWidth - y;
- if (d > 0) {
- h -= d;
- sy = d;
- y += d;
- }
- d = (y + h) - (Tk_Height(comboPtr->tkwin) - comboPtr->borderWidth);
- if (d > 0) {
- h -= d;
- }
- XCopyArea(comboPtr->display, drawable, Tk_WindowId(comboPtr->tkwin),
- comboPtr->defStyle.labelNormalGC, 0, sy, w, h, comboPtr->borderWidth,y);
- Tk_FreePixmap(comboPtr->display, drawable);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayComboMenu --
- *
- * This procedure is invoked to display a combomenu widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the menu.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayComboMenu(ClientData clientData)
-{
- ComboMenu *comboPtr = clientData;
- Pixmap drawable;
- int w, h; /* Window width and height. */
- int screenWidth, screenHeight;
-
- comboPtr->flags &= ~REDRAW_PENDING;
- if (comboPtr->tkwin == NULL) {
- return; /* Window destroyed (should not get
- * here) */
- }
-#ifdef notdef
- fprintf(stderr, "Calling DisplayComboMenu(%s) w=%d h=%d\n",
- Tk_PathName(comboPtr->tkwin), Tk_Width(comboPtr->tkwin),
- Tk_Height(comboPtr->tkwin));
-#endif
- if (comboPtr->flags & LAYOUT_PENDING) {
- ComputeComboGeometry(comboPtr);
- }
- if ((Tk_Width(comboPtr->tkwin) <= 1) || (Tk_Height(comboPtr->tkwin) <= 1)){
- /* Don't bother computing the layout until the window size is
- * something reasonable. */
- return;
- }
- if (!Tk_IsMapped(comboPtr->tkwin)) {
- /* The menu's window isn't displayed, so don't bother drawing
- * anything. By getting this far, we've at least computed the
- * coordinates of the combomenu's new layout. */
- return;
- }
- if (comboPtr->flags & SCROLL_PENDING) {
- int vw, vh; /* Viewport width and height. */
- /*
- * The view port has changed. The visible items need to be recomputed
- * and the scrollbars updated.
- */
- ComputeVisibleItems(comboPtr);
- vw = VPORTWIDTH(comboPtr);
- vh = VPORTHEIGHT(comboPtr);
- if ((comboPtr->xScrollCmdObjPtr != NULL) &&
- (comboPtr->flags & SCROLLX)) {
- Blt_UpdateScrollbar(comboPtr->interp, comboPtr->xScrollCmdObjPtr,
- comboPtr->xOffset, comboPtr->xOffset + vw, comboPtr->worldWidth);
- }
- if ((comboPtr->yScrollCmdObjPtr != NULL) &&
- (comboPtr->flags & SCROLLY)) {
- Blt_UpdateScrollbar(comboPtr->interp, comboPtr->yScrollCmdObjPtr,
- comboPtr->yOffset, comboPtr->yOffset+vh, comboPtr->worldHeight);
- }
- comboPtr->flags &= ~SCROLL_PENDING;
- }
- /*
- * Create a pixmap the size of the window for double buffering.
- */
- w = Tk_Width(comboPtr->tkwin) - 2 * comboPtr->borderWidth -
- comboPtr->yScrollbarWidth;
- h = Tk_Height(comboPtr->tkwin) - 2 * comboPtr->borderWidth -
- comboPtr->xScrollbarHeight;
- Blt_SizeOfScreen(comboPtr->tkwin, &screenWidth, &screenHeight);
- w = CLAMP(w, 1, screenWidth);
- h = CLAMP(h, 1, screenHeight);
- drawable = Tk_GetPixmap(comboPtr->display, Tk_WindowId(comboPtr->tkwin),
- w, h, Tk_Depth(comboPtr->tkwin));
-#ifdef WIN32
- assert(drawable != None);
-#endif
- if (comboPtr->activePtr == NULL) {
- ActivateItem(comboPtr, comboPtr->firstPtr);
- }
- /*
- * Shadowed menu. Request window size slightly bigger than menu. Get
- * snapshot of background from root menu.
- */
- /* Background */
- Blt_FillBackgroundRectangle(comboPtr->tkwin, drawable,
- comboPtr->defStyle.normalBg, 0, 0, w, h, 0, TK_RELIEF_FLAT);
- DrawComboMenu(comboPtr, drawable);
- XCopyArea(comboPtr->display, drawable, Tk_WindowId(comboPtr->tkwin),
- comboPtr->defStyle.labelNormalGC, 0, 0, w, h,
- comboPtr->borderWidth, comboPtr->borderWidth);
- Tk_FreePixmap(comboPtr->display, drawable);
- if ((comboPtr->xScrollbarHeight > 0) && (comboPtr->yScrollbarWidth > 0)) {
- /* Draw the empty corner. */
- Blt_FillBackgroundRectangle(comboPtr->tkwin,
- Tk_WindowId(comboPtr->tkwin), comboPtr->defStyle.disabledBg,
- w + comboPtr->borderWidth, h + comboPtr->borderWidth,
- comboPtr->yScrollbarWidth, comboPtr->xScrollbarHeight,
- 0, TK_RELIEF_FLAT);
- }
- Blt_DrawBackgroundRectangle(comboPtr->tkwin, Tk_WindowId(comboPtr->tkwin),
- comboPtr->defStyle.normalBg, 0, 0, Tk_Width(comboPtr->tkwin),
- Tk_Height(comboPtr->tkwin), comboPtr->borderWidth, comboPtr->relief);
-}
diff --git a/blt3.0.1/src/bltComboTree.c b/blt3.0.1/src/bltComboTree.c
deleted file mode 100644
index 3135b80..0000000
--- a/blt3.0.1/src/bltComboTree.c
+++ /dev/null
@@ -1,7149 +0,0 @@
-
-/*
- * bltComboTree.c --
- *
- * This module implements a combotree widget for the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * TODO:
- *
- * BUGS:
- * 1. "open" operation should change scroll offset so that as many
- * new entries (up to half a screen) can be seen.
- * 2. "open" needs to adjust the scrolloffset so that the same entry
- * is seen at the same place.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_COMBOTREE
-#include "bltOp.h"
-#include "bltImage.h"
-#include "bltHash.h"
-#include "bltFont.h"
-#include "bltText.h"
-#include "bltChain.h"
-#include "bltTree.h"
-#include "bltBind.h"
-#include "bltBgStyle.h"
-
-#define PICK_ENTRY (ClientData)0
-#define PICK_BUTTON (ClientData)1
-
-#if HAVE_UTF
-#else
-#define Tcl_NumUtfChars(s,n) (((n) == -1) ? strlen((s)) : (n))
-#define Tcl_UtfAtIndex(s,i) ((s) + (i))
-#endif
-
-#define ODD(x) ((x) | 0x01)
-
-#define END (-1)
-#define SEPARATOR_LIST ((char *)NULL)
-#define SEPARATOR_NONE ((char *)-1)
-
-#define SEARCH_Y 1
-
-#define ARROW_WIDTH 17
-#define ARROW_HEIGHT 17
-
-typedef const char *UID;
-
-#define FCLAMP(x) ((((x) < 0.0) ? 0.0 : ((x) > 1.0) ? 1.0 : (x)))
-#define CHOOSE(default, override) \
- (((override) == NULL) ? (default) : (override))
-
-#define GETLABEL(e) \
- (((e)->labelUid != NULL) ? (e)->labelUid : Blt_Tree_NodeLabel((e)->node))
-
-/*
- * The macro below is used to modify a "char" value (e.g. by casting it to an
- * unsigned character) so that it can be used safely with macros such as
- * isspace.
- */
-#define UCHAR(c) ((unsigned char) (c))
-
-#define SCREENX(c, wx) ((wx) - (c)->xOffset + (c)->borderWidth)
-#define SCREENY(c, wy) ((wy) - (c)->yOffset + (c)->borderWidth)
-
-#define PIXMAPX(c, wx) ((wx) - (c)->xOffset)
-#define PIXMAPY(c, wy) ((wy) - (c)->yOffset)
-
-#define WORLDX(c, sx) ((sx) - (c)->borderWidth + (c)->xOffset)
-#define WORLDY(c, sy) ((sy) - (c)->borderWidth + (c)->yOffset)
-
-#define VPORTWIDTH(c) \
- (Tk_Width((c)->tkwin) - 2 * (c)->borderWidth - (c)->yScrollbarWidth)
-#define VPORTHEIGHT(c) \
- (Tk_Height((c)->tkwin) - 2 * (c)->borderWidth - (c)->xScrollbarHeight)
-
-#define ICONWIDTH(d) (comboPtr->levelInfo[(d)].iconWidth)
-#define LEVELX(d) (comboPtr->levelInfo[(d)].x)
-#define DEPTH(h, n) Blt_Tree_NodeDepth(n)
-
-/*
- *---------------------------------------------------------------------------
- *
- * Internal combotree widget flags:
- *
- * LAYOUT_PENDING The layout of the hierarchy needs to be recomputed.
- *
- * REDRAW_PENDING A redraw request is pending for the widget.
- *
- * XSCROLL X-scroll request is pending.
- *
- * SCROLLY Y-scroll request is pending.
- *
- * SCROLL_PENDING Both X-scroll and Y-scroll requests are pending.
- *
- * FOCUS The widget is receiving keyboard events.
- * Draw the focus highlight border around the widget.
- *
- * DIRTY The hierarchy has changed. It may invalidate
- * the locations and pointers to entries. The widget
- * will need to recompute its layout.
- *
- * VIEWPORT Indicates that the viewport has changed in some
- * way: the size of the viewport, the location of
- * the viewport, or the contents of the viewport.
- *
- */
-
-#define LAYOUT_PENDING (1<<0)
-#define REDRAW_PENDING (1<<1)
-#define UPDATE_PENDING (1<<2)
-#define SCROLLX (1<<3)
-#define SCROLLY (1<<4)
-#define SCROLL_PENDING (SCROLLX | SCROLLY)
-#define FOCUS (1<<5)
-#define DIRTY (1<<6)
-#define VIEWPORT (1<<7)
-#define REPOPULATE (1<<8)
-#define INSTALL_SCROLLBAR_X (1<<9)
-#define INSTALL_SCROLLBAR_Y (1<<10)
-
-/*
- * Miscellaneous flags:
- *
- * HIDE_ROOT Don't display the root entry.
- *
- * HIDE_LEAVES Don't display entries that are leaves.
- *
- * NEW_TAGS
- */
-#define HIDE_ROOT (1<<23)
-#define HIDE_LEAVES (1<<24)
-#define NEW_TAGS (1<<27)
-
-/*
- *---------------------------------------------------------------------------
- *
- * Internal entry flags:
- *
- * ENTRY_BUTTON Indicates that a button is needed
- * for this entry.
- *
- * ENTRY_CLOSED Indicates that the entry is closed and
- * its subentries are not displayed.
- *
- * ENTRY_HIDE Indicates that the entry is hidden (i.e.
- * can not be viewed by opening or scrolling).
- *
- * ENTRY_BTN_AUTO
- * ENTRY_BTN_SHOW
- * ENTRY_BTN_MASK
- *
- *---------------------------------------------------------------------------
- */
-#define ENTRY_CLOSED (1<<0)
-#define ENTRY_HIDE (1<<1)
-#define ENTRY_MASK (ENTRY_CLOSED | ENTRY_HIDE)
-#define ENTRY_NOT_LEAF (1<<2)
-
-#define ENTRY_BUTTON (1<<3)
-#define ENTRY_ICON (1<<4)
-#define ENTRY_REDRAW (1<<5)
-#define ENTRY_LAYOUT_PENDING (1<<6)
-#define ENTRY_DATA_CHANGED (1<<7)
-#define ENTRY_DIRTY (ENTRY_DATA_CHANGED | ENTRY_LAYOUT_PENDING)
-
-#define ENTRY_BTN_AUTO (1<<8)
-#define ENTRY_BTN_SHOW (1<<9)
-#define ENTRY_BTN_MASK (ENTRY_BTN_AUTO | ENTRY_BTN_SHOW)
-
-#define ENTRY_EDITABLE (1<<10)
-
-#define COLUMN_RULE_PICKED (1<<1)
-#define COLUMN_DIRTY (1<<2)
-
-#define STYLE_TEXTBOX (0)
-#define STYLE_COMBOBOX (1)
-#define STYLE_CHECKBOX (2)
-#define STYLE_TYPE 0x3
-
-#define STYLE_LAYOUT (1<<3)
-#define STYLE_DIRTY (1<<4)
-#define STYLE_HIGHLIGHT (1<<5)
-#define STYLE_USER (1<<6)
-
-#define STYLE_EDITABLE (1<<10)
-
-typedef struct _Entry Entry;
-typedef struct _ComboTree ComboTree;
-typedef struct _Style Style;
-
-typedef int (CompareProc)(Tcl_Interp *interp, const char *name,
- const char *pattern);
-
-typedef Entry *(IterProc)(Entry *entryPtr, unsigned int mask);
-
-/*
- * Icon --
- *
- * Since instances of the same Tk image can be displayed in
- * different windows with possibly different color palettes, Tk
- * internally stores each instance in a linked list. But if
- * the instances are used in the same widget and therefore use
- * the same color palette, this adds a lot of overhead,
- * especially when deleting instances from the linked list.
- *
- * For the combotree widget, we never need more than a single
- * instance of an image, regardless of how many times it's used.
- * Cache the image, maintaining a reference count for each
- * image used in the widget. It's likely that the combotree
- * widget will use many instances of the same image (for example
- * the open/close icons).
- */
-
-typedef struct _Icon {
- Tk_Image tkImage; /* The Tk image being cached. */
-
- int refCount; /* Reference count for this image. */
-
- short int width, height; /* Dimensions of the cached image. */
-
- Blt_HashEntry *hashPtr; /* Hash table pointer to the image. */
-
-} *Icon;
-
-#define IconHeight(icon) ((icon)->height)
-#define IconWidth(icon) ((icon)->width)
-#define IconImage(icon) ((icon)->tkImage)
-#define IconName(icon) (Blt_Image_Name((icon)->tkImage))
-
-struct _Style {
- const char *name; /* Instance name. */
- Blt_HashEntry *hPtr;
- ComboTree *comboPtr;
- int refCount; /* Indicates if the style is currently
- * in use in the combotree. */
-
- unsigned int flags; /* Bit field containing both the style
- * type and various flags. */
-
- /* General style fields. */
-
- int borderWidth; /* Width of 3D border. */
- int activeRelief;
- int relief;
-
- int gap; /* # pixels gap between icon and
- * text. */
- Blt_Font labelFont;
- XColor *labelNormalColor; /* Normal foreground color of cell. */
- XColor *labelActiveColor; /* Foreground color of cell when
- * active. */
-
- Blt_Background normalBg; /* Normal background color. */
- Blt_Background altBg; /* Alternate normal background
- * color. */
- Blt_Background activeBg; /* Active entry background color. */
- Blt_Background disabledBg; /* Disabled entry background color. */
-
- GC labelNormalGC;
- GC labelActiveGC;
- GC labelDisabledGC;
-
- Icon *icons; /* Tk images displayed for the entry.
- * The first image is the icon
- * displayed to the left of the
- * entry's label. The second is icon
- * displayed when entry is "open". */
-};
-
-/*
- * Entry --
- *
- * Contains data-specific information how to represent the data
- * of a node of the hierarchy.
- *
- */
-struct _Entry {
- Blt_TreeNode node; /* Node containing entry */
- int worldX, worldY; /* X-Y position in world coordinates where the
- * entry is positioned. */
-
- Blt_HashEntry *hPtr;
-
- short int width, height; /* Dimensions of the entry. This includes the
- * size of its columns. */
-
- int reqHeight; /* Requested height of the entry. Overrides
- * computed height. */
-
- int vertLineLength; /* Length of the vertical line segment. */
-
- short int lineHeight; /* Height of first line of text. */
-
- unsigned short int flags; /* Flags for this entry. For the definitions
- * of the various bit fields see below. */
-
- Tcl_Obj *tagsObjPtr; /* List of binding tags for this entry. */
- ComboTree *comboPtr;
-
- Tcl_Obj *cmdObjPtr; /* List of binding tags for this entry. */
-
- UID openCmd, closeCmd; /* TCL commands to invoke when entries are
- * opened or closed. They override those
- * specified globally. */
- /*
- * Button information:
- */
- short int buttonX, buttonY; /* X-Y coordinate offsets from to upper left
- * corner of the entry to the upper-left
- * corner of the button. Used to pick the
- * button quickly */
-
- short int iconWidth, iconHeight;
- /* Maximum dimensions for icons and buttons
- * for this entry. This is used to align the
- * button, icon, and text. */
- /*
- * Label information:
- */
- TextLayout *textPtr;
-
- short int labelWidth, labelHeight;
-
- UID labelUid; /* Text displayed right of the icon. */
-
- int seqNum; /* Used to navigate to next/last entry when
- * the view is flat. */
-
- Style *stylePtr; /* Default style for entry. */
-};
-
-/*
- * Button --
- *
- * A button is the open/close indicator at the far left of the entry. It
- * is displayed as a plus or minus in a solid colored box with optionally
- * an border. It has both "active" and "normal" colors.
- */
-typedef struct {
- XColor *fgColor; /* Foreground color. */
- XColor *activeFgColor; /* Active foreground color. */
-
- Blt_Background normalBg; /* Normal button background. */
- Blt_Background activeBg; /* Active background color. */
-
- GC normalGC;
- GC activeGC;
-
- int reqSize;
-
- int borderWidth;
-
- int openRelief, closeRelief;
-
- int width, height;
-
- Icon *icons;
-
-} Button;
-
-/*
- * LevelInfo --
- *
- */
-typedef struct {
- int x;
- int iconWidth;
- int labelWidth;
-} LevelInfo;
-
-/*
- * ComboTree --
- *
- * A ComboTree is a widget that displays an hierarchical table of one or
- * more entries.
- *
- * Entries are positioned in "world" coordinates, referring to the
- * virtual combotree. Coordinate 0,0 is the upper-left corner of the root
- * entry and the bottom is the end of the last entry. The widget's Tk
- * window acts as view port into this virtual space. The combotree's
- * xOffset and yOffset fields specify the location of the view port in
- * the virtual world. Scrolling the viewport is therefore simply
- * changing the xOffset and/or yOffset fields and redrawing.
- *
- * Note that world coordinates are integers, not signed short integers
- * like X11 screen coordinates. It's very easy to create a hierarchy
- * taller than 0x7FFF pixels.
- */
-struct _ComboTree {
-
- /*
- * This works around a bug in the Tk API. Under under Win32, Tk tries to
- * read the widget record of toplevel windows (TopLevel or Frame widget),
- * to get its menu name field. What this means is that we must carefully
- * arrange the fields of this widget so that the menuName field is at the
- * same offset in the structure.
- */
-
- Tk_Window tkwin; /* Window that embodies the frame. NULL
- * means that the window has been destroyed
- * but the data structures haven't yet been
- * cleaned up. */
-
- Display *display; /* Display containing widget. Used, among
- * other things, so that resources can be
- * freed even after tkwin has gone away. */
-
- Tcl_Interp *interp; /* Interpreter associated with widget. Used
- * to delete widget command. */
-
- Tcl_Command cmdToken; /* Token for widget's command. */
-
- Tcl_Obj *postCmdObjPtr; /* If non-NULL, command to be executed when
- * this menu is posted. */
-
- unsigned int flags; /* For bitfield definitions, see below */
-
- Tcl_Obj *iconVarObjPtr; /* Name of TCL variable. If non-NULL, this
- * variable will be set to the name of the Tk
- * image representing the icon of the selected
- * item. */
-
- Tcl_Obj *textVarObjPtr; /* Name of TCL variable. If non-NULL, this
- * variable will be set to the text string of
- * the label of the selected item. */
-
- Tcl_Obj *takeFocusObjPtr; /* Value of -takefocus option; not used in the
- * C code, but used by keyboard traversal
- * scripts. */
-
- const char *menuName; /* Textual description of menu to use for
- * menubar. Malloc-ed, may be NULL. */
-
- Tk_Cursor cursor; /* Current cursor for window or None. */
-
- /*------*/
-
- Blt_Tree tree; /* Handle representing the tree. */
- const char *treeName;
-
- Blt_HashEntry *hPtr;
-
- /* ComboTree_ specific fields. */
-
- Blt_HashTable entryTable; /* Table of entry information, keyed by the
- * node pointer. */
-
- int inset; /* Total width of all borders, including
- * traversal highlight and 3-D border.
- * Indicates how much interior stuff must be
- * offset from outside edges to leave room for
- * borders. */
-
- Style defStyle;
-
- int borderWidth; /* Width of 3D border. */
-
- int relief; /* 3D border relief. */
-
- /*
- * Entries are connected by horizontal and vertical lines. They may be
- * drawn dashed or solid.
- */
- int lineWidth; /* Width of lines connecting entries */
-
- int dashes; /* Dash on-off value. */
-
- XColor *lineColor; /* Color of connecting lines. */
-
- /*
- * Button Information:
- *
- * The button is the open/close indicator at the far left of the entry.
- * It is usually displayed as a plus or minus in a solid colored box with
- * optionally an border. It has both "active" and "normal" colors.
- */
- Button button;
-
- int leader; /* Number of pixels padding between
- * entries. */
-
- int reqWidth, reqHeight; /* Requested dimensions of the combotree
- * widget's window. */
-
- GC lineGC; /* GC for drawing dotted line between
- * entries. */
-
- Entry *activePtr; /* Last active entry. */
-
- Entry *activeBtnPtr; /* Pointer to last active button */
-
- Entry *fromPtr;
-
- /* Names of scrollbars to embed into the widget window. */
- Tcl_Obj *xScrollbarObjPtr, *yScrollbarObjPtr;
-
- /* Command strings to control horizontal and vertical scrollbars. */
- Tcl_Obj *xScrollCmdObjPtr, *yScrollCmdObjPtr;
-
- int xScrollUnits, yScrollUnits; /* # of pixels per scroll unit. */
-
- /*
- * Total size of all "open" entries. This represents the range of world
- * coordinates.
- */
- int worldWidth, worldHeight;
-
- int xOffset, yOffset; /* Translation between view port and world
- * origin. */
-
- LevelInfo *levelInfo;
-
- /* Scanning information: */
- int scanAnchorX, scanAnchorY; /* Scan anchor in screen coordinates. */
-
- int scanX, scanY; /* X-Y world coordinate where the scan
- * started. */
-
-
- Blt_HashTable iconTable; /* Table of Tk images */
-
- Blt_HashTable uidTable; /* Table of strings. */
-
- Blt_HashTable styleTable; /* Table of cell styles. */
-
- Entry *rootPtr; /* Root entry of tree. */
-
- Entry **visibleEntries; /* Array of visible entries */
-
- int nVisible; /* Number of entries in the above array */
-
- int nEntries; /* Number of entries in tree. */
-
- int buttonFlags; /* Global button indicator for all entries.
- * This may be overridden by the entry's
- * -button option. */
-
- const char *openCmd;
- const char *closeCmd; /* TCL commands to invoke when entries are
- * opened or closed. */
-
- const char *pathSep; /* Pathname separators */
-
- ClientData clientData;
-
- Blt_BindTable bindTable; /* Binding information for entries. */
-
- Blt_HashTable entryBindTagTable;
- Blt_HashTable buttonBindTagTable;
-
- size_t depth;
-
- int flatView; /* Indicates if the view of the tree has been
- * flattened. */
- Blt_Pool entryPool;
-
- Tk_Window xScrollbar; /* Horizontal scrollbar to be used if
- * necessary. If NULL, no x-scrollbar is
- * used. */
- Tk_Window yScrollbar; /* Vertical scrollbar to be used if
- * necessary. If NULL, no y-scrollbar is
- * used. */
-
- short int yScrollbarWidth, xScrollbarHeight;
-
- short int maxWidth; /* Width of the widest entry. */
- short int minHeight; /* Minimum entry height. Used to to compute
- * what the y-scroll unit should be. */
-};
-
-/*
- * EntryIterator --
- *
- * Entries may be tagged with strings. An entry may have many tags. The
- * same tag may be used for many entries.
- *
- */
-
-typedef enum {
- ITER_INDEX, ITER_ALL, ITER_TAG,
-} IteratorType;
-
-typedef struct _Iterator {
- ComboTree *comboPtr; /* ComboTree that we're iterating over. */
-
- IteratorType type; /* Type of iteration:
- * ITER_TAG By entry tag.
- * ITER_ALL By every entry.
- * ITER_INDEX Single entry: either
- * tag or index.
- */
-
- Entry *first; /* Starting point of search, saved if iterator
- * is reused. Used for ITER_ALL and
- * ITER_INDEX searches. */
- Entry *next; /* Next entry. */
-
- /* For tag-based searches. */
- const char *tagName; /* If non-NULL, is the tag that we are
- * currently iterating over. */
-
- Blt_HashTable *tablePtr; /* Pointer to tag hash table. */
- Blt_HashSearch cursor; /* Search iterator for tag hash table. */
-
-} EntryIterator;
-
-
-#define BUTTON_IPAD 1
-#define BUTTON_PAD 2
-#define BUTTON_SIZE 7
-#define COLUMN_PAD 2
-#define FOCUS_WIDTH 1
-#define ICON_HEIGHT 16
-#define ICON_PADX 2
-#define ICON_PADY 1
-#define ICON_WIDTH 16
-#define INSET_PAD 0
-#define LABEL_PADX 3
-#define LABEL_PADY 0
-
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-
-
-typedef ClientData (TagProc)(ComboTree *comboPtr, const char *string);
-typedef int (ApplyProc) (ComboTree *comboPtr, Entry *entryPtr);
-
-
-#define DEF_BTN_ACTIVE_BG RGB_WHITE
-#define DEF_BTN_ACTIVE_FG STD_ACTIVE_FOREGROUND
-#define DEF_BTN_BORDERWIDTH "1"
-#define DEF_BTN_CLOSE_RELIEF "solid"
-#define DEF_BTN_NORMAL_BG RGB_WHITE
-#define DEF_BTN_NORMAL_FG STD_NORMAL_FOREGROUND
-#define DEF_BTN_OPEN_RELIEF "solid"
-#define DEF_BTN_SIZE "7"
-
-#define DEF_COMBO_ACTIVE_STIPPLE "gray25"
-#define DEF_COMBO_BORDERWIDTH "1"
-#define DEF_COMBO_BUTTON "auto"
-#define DEF_COMBO_DASHES "dot"
-#define DEF_COMBO_HEIGHT "400"
-#define DEF_COMBO_HIDE_LEAVES "no"
-#define DEF_COMBO_HIDE_ROOT "yes"
-#define DEF_COMBO_ICON_VARIABLE ((char *)NULL)
-#define DEF_COMBO_LINESPACING "0"
-#define DEF_COMBO_LINEWIDTH "1"
-#define DEF_COMBO_MAKE_PATH "no"
-#define DEF_COMBO_NEWTAGS "no"
-#define DEF_COMBO_RELIEF "solid"
-#define DEF_COMBO_SCROLLBAR ((char *)NULL)
-#define DEF_COMBO_SCROLLINCREMENT "20"
-#define DEF_COMBO_SHOW_ROOT "yes"
-#define DEF_COMBO_TAKE_FOCUS "1"
-#define DEF_COMBO_TEXT_VARIABLE ((char *)NULL)
-#define DEF_COMBO_LINECOLOR RGB_GREY50
-#define DEF_COMBO_WIDTH "0"
-#ifdef WIN32
-#define DEF_COMBO_SEPARATOR "\\"
-#else
-#define DEF_COMBO_SEPARATOR "/"
-#endif
-
-#define DEF_ENTRY_STYLE "default"
-#define DEF_STYLE_ACTIVE_BG RGB_SKYBLUE4
-#define DEF_STYLE_ACTIVE_FG RGB_WHITE
-#define DEF_STYLE_ACTIVE_RELIEF "flat"
-#define DEF_STYLE_ALT_BG ((char *)NULL)
-#define DEF_STYLE_BG "white"
-#define DEF_STYLE_BORDERWIDTH STD_BORDERWIDTH
-#define DEF_STYLE_FG STD_NORMAL_FOREGROUND
-#define DEF_STYLE_FONT "Courier 12"
-#define DEF_STYLE_ICONS "::blt::ComboTree::openIcon ::blt::ComboTree::closeIcon"
-#define DEF_STYLE_NORMAL_BG STD_NORMAL_BACKGROUND
-#define DEF_STYLE_RELIEF "flat"
-
-static Blt_TreeApplyProc CreateApplyProc;
-
-static Blt_OptionParseProc ObjToIconsProc;
-static Blt_OptionPrintProc IconsToObjProc;
-static Blt_OptionFreeProc FreeIconsProc;
-static Blt_CustomOption iconsOption = {
- ObjToIconsProc, IconsToObjProc, FreeIconsProc, NULL,
-};
-
-static Blt_OptionParseProc ObjToButtonProc;
-static Blt_OptionPrintProc ButtonToObjProc;
-static Blt_CustomOption buttonOption = {
- ObjToButtonProc, ButtonToObjProc, NULL, NULL,
-};
-
-static Blt_OptionParseProc ObjToUidProc;
-static Blt_OptionPrintProc UidToObjProc;
-static Blt_OptionFreeProc FreeUidProc;
-static Blt_CustomOption uidOption = {
- ObjToUidProc, UidToObjProc, FreeUidProc, NULL,
-};
-
-static Blt_OptionParseProc ObjToLabelProc;
-static Blt_OptionPrintProc LabelToObjProc;
-static Blt_OptionFreeProc FreeLabelProc;
-static Blt_CustomOption labelOption =
-{
- ObjToLabelProc, LabelToObjProc, FreeLabelProc, NULL,
-};
-
-static Blt_OptionParseProc ObjToStyleProc;
-static Blt_OptionPrintProc StyleToObjProc;
-static Blt_OptionFreeProc FreeStyleProc;
-static Blt_CustomOption styleOption = {
- ObjToStyleProc, StyleToObjProc, FreeStyleProc, NULL,
-};
-
-static Blt_ConfigSpec buttonSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "Background", DEF_BTN_ACTIVE_BG,
- Blt_Offset(ComboTree, button.activeBg), 0},
- {BLT_CONFIG_SYNONYM, "-activebg", "activeBackground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-activefg", "activeForeground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground", "Foreground",
- DEF_BTN_ACTIVE_FG,
- Blt_Offset(ComboTree, button.activeFgColor), 0},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_BTN_NORMAL_BG, Blt_Offset(ComboTree, button.normalBg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,
- 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_BTN_BORDERWIDTH, Blt_Offset(ComboTree, button.borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-closerelief", "closeRelief", "Relief",
- DEF_BTN_CLOSE_RELIEF, Blt_Offset(ComboTree, button.closeRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_BTN_NORMAL_FG, Blt_Offset(ComboTree, button.fgColor), 0},
- {BLT_CONFIG_CUSTOM, "-images", "images", "Icons", (char *)NULL,
- Blt_Offset(ComboTree, button.icons), BLT_CONFIG_NULL_OK,
- &iconsOption},
- {BLT_CONFIG_RELIEF, "-openrelief", "openRelief", "Relief",
- DEF_BTN_OPEN_RELIEF, Blt_Offset(ComboTree, button.openRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-size", "size", "Size", DEF_BTN_SIZE,
- Blt_Offset(ComboTree, button.reqSize), 0},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-static Blt_ConfigSpec entrySpecs[] =
-{
- {BLT_CONFIG_CUSTOM, "-bindtags", (char *)NULL, (char *)NULL, (char *)NULL,
- Blt_Offset(Entry, tagsObjPtr), BLT_CONFIG_NULL_OK, &uidOption},
- {BLT_CONFIG_CUSTOM, "-button", (char *)NULL, (char *)NULL, DEF_COMBO_BUTTON,
- Blt_Offset(Entry, flags), BLT_CONFIG_DONT_SET_DEFAULT, &buttonOption},
- {BLT_CONFIG_CUSTOM, "-closecommand", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(Entry, closeCmd), BLT_CONFIG_NULL_OK,
- &uidOption},
- {BLT_CONFIG_PIXELS_NNEG, "-height", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(Entry, reqHeight),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-label", (char *)NULL, (char *)NULL, (char *)NULL,
- Blt_Offset(Entry, labelUid), 0, &labelOption},
- {BLT_CONFIG_CUSTOM, "-opencommand", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(Entry, openCmd), BLT_CONFIG_NULL_OK,
- &uidOption},
- {BLT_CONFIG_CUSTOM, "-style", (char *)NULL, (char *)NULL, DEF_ENTRY_STYLE,
- Blt_Offset(Entry, stylePtr), 0, &styleOption},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-static Blt_ConfigSpec styleSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", (char *)NULL, (char *)NULL,
- DEF_STYLE_ACTIVE_BG, Blt_Offset(Style, activeBg), 0},
- {BLT_CONFIG_COLOR, "-activeforeground", (char *)NULL, (char *)NULL,
- DEF_STYLE_ACTIVE_FG, Blt_Offset(Style, labelActiveColor), 0},
- {BLT_CONFIG_RELIEF, "-activerelief", "activeRelief", "Relief",
- DEF_STYLE_ACTIVE_RELIEF, Blt_Offset(Style, activeRelief), 0},
- {BLT_CONFIG_BACKGROUND, "-alternatebackground", "alternateBackground",
- "Background", DEF_STYLE_ALT_BG, Blt_Offset(Style, altBg), 0},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_STYLE_BG, Blt_Offset(Style, normalBg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_STYLE_BORDERWIDTH, Blt_Offset(Style, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_STYLE_FONT,
- Blt_Offset(Style, labelFont), 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", DEF_STYLE_FG,
- Blt_Offset(Style, labelNormalColor), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_CUSTOM, "-icons", (char *)NULL, (char *)NULL, DEF_STYLE_ICONS,
- Blt_Offset(Style, icons), BLT_CONFIG_NULL_OK, &iconsOption},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_STYLE_RELIEF,
- Blt_Offset(Style, relief), 0},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-static Blt_ConfigSpec comboSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_STYLE_ACTIVE_BG,
- Blt_Offset(ComboTree, defStyle.activeBg), 0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "ActiveForeground", DEF_STYLE_ACTIVE_FG,
- Blt_Offset(ComboTree, defStyle.labelActiveColor), 0},
- {BLT_CONFIG_BACKGROUND, "-alternatebackground", "alternateBackground",
- "Background", DEF_STYLE_ALT_BG, Blt_Offset(ComboTree, defStyle.altBg),
- 0},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_STYLE_BG, Blt_Offset(ComboTree, defStyle.normalBg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_COMBO_BORDERWIDTH, Blt_Offset(ComboTree, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-button", "button", "Button",
- DEF_COMBO_BUTTON, Blt_Offset(ComboTree, buttonFlags),
- BLT_CONFIG_DONT_SET_DEFAULT, &buttonOption},
- {BLT_CONFIG_STRING, "-closecommand", "closeCommand", "CloseCommand",
- (char *)NULL, Blt_Offset(ComboTree, closeCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- (char *)NULL, Blt_Offset(ComboTree, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_DASHES, "-dashes", "dashes", "Dashes", DEF_COMBO_DASHES,
- Blt_Offset(ComboTree, dashes), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_STYLE_FONT,
- Blt_Offset(ComboTree, defStyle.labelFont), 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_STYLE_FG, Blt_Offset(ComboTree, defStyle.labelNormalColor),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_PIXELS, "-height", "height", "Height", DEF_COMBO_HEIGHT,
- Blt_Offset(ComboTree, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-hideleaves", "hideLeaves", "HideLeaves",
- DEF_COMBO_HIDE_LEAVES, Blt_Offset(ComboTree, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)HIDE_LEAVES},
- {BLT_CONFIG_BITMASK, "-hideroot", "hideRoot", "HideRoot",
- DEF_COMBO_HIDE_ROOT, Blt_Offset(ComboTree, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)HIDE_ROOT},
- {BLT_CONFIG_OBJ, "-iconvariable", "iconVariable", "IconVariable",
- DEF_COMBO_ICON_VARIABLE, Blt_Offset(ComboTree, iconVarObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-icons", "icons", "Icons", DEF_STYLE_ICONS,
- Blt_Offset(ComboTree, defStyle.icons), BLT_CONFIG_NULL_OK,
- &iconsOption},
- {BLT_CONFIG_COLOR, "-linecolor", "lineColor", "LineColor",
- DEF_COMBO_LINECOLOR, Blt_Offset(ComboTree, lineColor),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_PIXELS_NNEG, "-linespacing", "lineSpacing", "LineSpacing",
- DEF_COMBO_LINESPACING, Blt_Offset(ComboTree, leader),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-linewidth", "lineWidth", "LineWidth",
- DEF_COMBO_LINEWIDTH, Blt_Offset(ComboTree, lineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-newtags", "newTags", "NewTags", DEF_COMBO_NEWTAGS,
- Blt_Offset(ComboTree, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)NEW_TAGS},
- {BLT_CONFIG_STRING, "-opencommand", "openCommand", "OpenCommand",
- (char *)NULL, Blt_Offset(ComboTree, openCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_COMBO_RELIEF, Blt_Offset(ComboTree, relief), 0},
- {BLT_CONFIG_STRING, "-separator", "separator", "Separator",
- DEF_COMBO_SEPARATOR, Blt_Offset(ComboTree, pathSep),
- BLT_CONFIG_NULL_OK, 0},
- {BLT_CONFIG_OBJ, "-takefocus", "takeFocus", "TakeFocus",
- DEF_COMBO_TAKE_FOCUS, Blt_Offset(ComboTree, takeFocusObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-textvariable", "textVariable", "TextVariable",
- DEF_COMBO_TEXT_VARIABLE, Blt_Offset(ComboTree, textVarObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-tree", "tree", "Tree", (char *)NULL,
- Blt_Offset(ComboTree, treeName), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS, "-width", "width", "Width", DEF_COMBO_WIDTH,
- Blt_Offset(ComboTree, reqWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-xscrollbar", "xScrollbar", "Scrollbar",
- DEF_COMBO_SCROLLBAR, Blt_Offset(ComboTree, xScrollbarObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
- (char *)NULL, Blt_Offset(ComboTree, xScrollCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-xscrollincrement", "xScrollIncrement",
- "ScrollIncrement", DEF_COMBO_SCROLLINCREMENT,
- Blt_Offset(ComboTree, xScrollUnits), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-yscrollbar", "yScrollbar", "Scrollbar",
- DEF_COMBO_SCROLLBAR, Blt_Offset(ComboTree, yScrollbarObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
- (char *)NULL, Blt_Offset(ComboTree, yScrollCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-yscrollincrement", "yScrollIncrement",
- "ScrollIncrement", DEF_COMBO_SCROLLINCREMENT,
- Blt_Offset(ComboTree, yScrollUnits), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-/* Forward Declarations */
-static Tcl_IdleProc ConfigureScrollbarsProc;
-static Blt_BindPickProc PickEntry;
-static Blt_BindTagProc GetTags;
-static Blt_TreeNotifyEventProc TreeEventProc;
-static Tcl_CmdDeleteProc ComboTreeInstCmdDeleteProc;
-static Tcl_FreeProc DestroyComboTree;
-static Tcl_FreeProc DestroyEntry;
-static Tcl_IdleProc DisplayComboTree;
-static Tcl_IdleProc DisplayEntry;
-static Tcl_ObjCmdProc ComboTreeInstCmdProc;
-static Tcl_ObjCmdProc ComboTreeObjCmdProc;
-static Tk_EventProc ComboTreeEventProc;
-static Tk_EventProc ScrollbarEventProc;
-static Tk_ImageChangedProc IconChangedProc;
-
-static Tk_GeomRequestProc ScrollbarGeometryProc;
-static Tk_GeomLostSlaveProc ScrollbarCustodyProc;
-static Tk_GeomMgr comboMgrInfo = {
- (char *)"combomenu", /* Name of geometry manager used by winfo */
- ScrollbarGeometryProc, /* Procedure to for new geometry requests */
- ScrollbarCustodyProc, /* Procedure when scrollbar is taken away */
-};
-
-static int ComputeVisibleEntries(ComboTree *comboPtr);
-
-typedef int (ComboTreeCmdProc)(ComboTree *comboPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Queues a request to redraw the widget at the next idle point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets redisplayed. Right now we don't do selective
- * redisplays: the whole window will be redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(ComboTree *comboPtr)
-{
- if ((comboPtr->tkwin != NULL) && ((comboPtr->flags & REDRAW_PENDING)==0)) {
- comboPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayComboTree, comboPtr);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedrawEntry --
- *
- * Tells the Tk dispatcher to call the combomenu display routine at the
- * next idle point. This request is made only if the window is displayed
- * and no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedrawEntry(Entry *entryPtr)
-{
- ComboTree *comboPtr;
-
- comboPtr = entryPtr->comboPtr;
- if ((comboPtr->tkwin != NULL) && ((comboPtr->flags & REDRAW_PENDING)==0) &&
- ((entryPtr->flags & ENTRY_REDRAW) == 0)) {
- Tcl_DoWhenIdle(DisplayEntry, entryPtr);
- entryPtr->flags |= ENTRY_REDRAW;
- }
-}
-
-static void
-ConfigureScrollbarsProc(ClientData clientData)
-{
- ComboTree *comboPtr = clientData;
- Tcl_Interp *interp;
-
- interp = comboPtr->interp;
- /*
- * Execute the initialization procedure on this widget.
- */
- comboPtr->flags &= ~UPDATE_PENDING;
- if (Tcl_VarEval(interp, "::blt::ComboTree::ConfigureScrollbars ",
- Tk_PathName(comboPtr->tkwin), (char *)NULL) != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
-}
-
-static void
-UnmanageScrollbar(ComboTree *comboPtr, Tk_Window tkwin)
-{
- if (tkwin != NULL) {
- Tk_DeleteEventHandler(tkwin, StructureNotifyMask,
- ScrollbarEventProc, comboPtr);
- Tk_ManageGeometry(tkwin, (Tk_GeomMgr *)NULL, comboPtr);
- if (Tk_IsMapped(tkwin)) {
- Tk_UnmapWindow(tkwin);
- }
- }
-}
-
-static void
-ManageScrollbar(ComboTree *comboPtr, Tk_Window tkwin)
-{
- if (tkwin != NULL) {
- Tk_CreateEventHandler(tkwin, StructureNotifyMask, ScrollbarEventProc,
- comboPtr);
- Tk_ManageGeometry(tkwin, &comboMgrInfo, comboPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InstallScrollbar --
- *
- * Convert the string representation of a color into a XColor pointer.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-InstallScrollbar(
- Tcl_Interp *interp, /* Interpreter to send results back to */
- ComboTree *comboPtr,
- Tcl_Obj *objPtr, /* String representing scrollbar window. */
- Tk_Window *tkwinPtr)
-{
- Tk_Window tkwin;
-
- if (objPtr == NULL) {
- *tkwinPtr = NULL;
- return;
- }
- tkwin = Tk_NameToWindow(interp, Tcl_GetString(objPtr), comboPtr->tkwin);
- if (tkwin == NULL) {
- Tcl_BackgroundError(interp);
- return;
- }
- if (Tk_Parent(tkwin) != comboPtr->tkwin) {
- Tcl_AppendResult(interp, "scrollbar \"", Tk_PathName(tkwin),
- "\" must be a child of combomenu.", (char *)NULL);
- Tcl_BackgroundError(interp);
- return;
- }
- ManageScrollbar(comboPtr, tkwin);
- *tkwinPtr = tkwin;
- return;
-}
-
-static void
-InstallXScrollbar(ClientData clientData)
-{
- ComboTree *comboPtr = clientData;
-
- comboPtr->flags &= ~INSTALL_SCROLLBAR_X;
- InstallScrollbar(comboPtr->interp, comboPtr, comboPtr->xScrollbarObjPtr,
- &comboPtr->xScrollbar);
-}
-
-static void
-InstallYScrollbar(ClientData clientData)
-{
- ComboTree *comboPtr = clientData;
-
- comboPtr->flags &= ~INSTALL_SCROLLBAR_Y;
- InstallScrollbar(comboPtr->interp, comboPtr, comboPtr->yScrollbarObjPtr,
- &comboPtr->yScrollbar);
-}
-
-static Entry *
-NodeToEntry(ComboTree *comboPtr, Blt_TreeNode node)
-{
- Blt_HashEntry *hPtr;
-
- if (node == NULL) {
- return NULL;
- }
- hPtr = Blt_FindHashEntry(&comboPtr->entryTable, (char *)node);
- if (hPtr == NULL) {
- fprintf(stderr, "NodeToEntry: can't find node %s\n",
- Blt_Tree_NodeLabel(node));
- abort();
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-
-static Entry *
-ParentEntry(Entry *entryPtr)
-{
- ComboTree *comboPtr = entryPtr->comboPtr;
- Blt_TreeNode node;
-
- if (entryPtr->node == Blt_Tree_RootNode(comboPtr->tree)) {
- return NULL;
- }
- node = Blt_Tree_ParentNode(entryPtr->node);
- if (node == NULL) {
- return NULL;
- }
- return NodeToEntry(comboPtr, node);
-}
-
-static int
-EntryIsHidden(Entry *entryPtr)
-{
- ComboTree *comboPtr = entryPtr->comboPtr;
-
- if ((comboPtr->flags & HIDE_LEAVES) && (Blt_Tree_IsLeaf(entryPtr->node))) {
- return TRUE;
- }
- return (entryPtr->flags & ENTRY_HIDE) ? TRUE : FALSE;
-}
-
-static Entry *
-GetEntryFromNode(ComboTree *comboPtr, Blt_TreeNode node)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&comboPtr->entryTable, (char *)node);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-
-static Entry *
-FirstChild(Entry *entryPtr, unsigned int mask)
-{
- Blt_TreeNode node;
- ComboTree *comboPtr = entryPtr->comboPtr;
-
- for (node = Blt_Tree_FirstChild(entryPtr->node); node != NULL;
- node = Blt_Tree_NextSibling(node)) {
- entryPtr = NodeToEntry(comboPtr, node);
- if (((mask & ENTRY_HIDE) == 0) || (!EntryIsHidden(entryPtr))) {
- return entryPtr;
- }
- }
- return NULL;
-}
-
-static Entry *
-LastChild(Entry *entryPtr, unsigned int mask)
-{
- Blt_TreeNode node;
- ComboTree *comboPtr = entryPtr->comboPtr;
-
- for (node = Blt_Tree_LastChild(entryPtr->node); node != NULL;
- node = Blt_Tree_PrevSibling(node)) {
- entryPtr = NodeToEntry(comboPtr, node);
- if (((mask & ENTRY_HIDE) == 0) || (!EntryIsHidden(entryPtr))) {
- return entryPtr;
- }
- }
- return NULL;
-}
-
-static Entry *
-NextSibling(Entry *entryPtr, unsigned int mask)
-{
- Blt_TreeNode node;
- ComboTree *comboPtr = entryPtr->comboPtr;
-
- for (node = Blt_Tree_NextSibling(entryPtr->node); node != NULL;
- node = Blt_Tree_NextSibling(node)) {
- entryPtr = NodeToEntry(comboPtr, node);
- if (((mask & ENTRY_HIDE) == 0) || (!EntryIsHidden(entryPtr))) {
- return entryPtr;
- }
- }
- return NULL;
-}
-
-static Entry *
-PrevSibling(Entry *entryPtr, unsigned int mask)
-{
- Blt_TreeNode node;
- ComboTree *comboPtr = entryPtr->comboPtr;
-
- for (node = Blt_Tree_PrevSibling(entryPtr->node); node != NULL;
- node = Blt_Tree_PrevSibling(node)) {
- entryPtr = NodeToEntry(comboPtr, node);
- if (((mask & ENTRY_HIDE) == 0) || (!EntryIsHidden(entryPtr))) {
- return entryPtr;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PrevEntry --
- *
- * Returns the "previous" node in the tree. This node (in
- * depth-first order) is its parent if the node has no siblings
- * that are previous to it. Otherwise it is the last descendant
- * of the last sibling. In this case, descend the sibling's
- * hierarchy, using the last child at any ancestor, until we
- * we find a leaf.
- *
- *---------------------------------------------------------------------------
- */
-static Entry *
-PrevEntry(Entry *entryPtr, unsigned int mask)
-{
- ComboTree *comboPtr = entryPtr->comboPtr;
- Entry *prevPtr;
-
- if (entryPtr->node == Blt_Tree_RootNode(comboPtr->tree)) {
- return NULL; /* The root is the first node. */
- }
- prevPtr = PrevSibling(entryPtr, mask);
- if (prevPtr == NULL) {
- /* There are no siblings previous to this one, so pick the parent. */
- prevPtr = ParentEntry(entryPtr);
- } else {
- /*
- * Traverse down the right-most thread in order to select the
- * last entry. Stop if we find a "closed" entry or reach a leaf.
- */
- entryPtr = prevPtr;
- while ((entryPtr->flags & mask) == 0) {
- entryPtr = LastChild(entryPtr, mask);
- if (entryPtr == NULL) {
- break; /* Found a leaf. */
- }
- prevPtr = entryPtr;
- }
- }
- if (prevPtr == NULL) {
- return NULL;
- }
- return prevPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextEntry --
- *
- * Returns the "next" node in relation to the given node.
- * The next node (in depth-first order) is either the first
- * child of the given node the next sibling if the node has
- * no children (the node is a leaf). If the given node is the
- * last sibling, then try it's parent next sibling. Continue
- * until we either find a next sibling for some ancestor or
- * we reach the root node. In this case the current node is
- * the last node in the tree.
- *
- *---------------------------------------------------------------------------
- */
-static Entry *
-NextEntry(Entry *entryPtr, unsigned int mask)
-{
- ComboTree *comboPtr = entryPtr->comboPtr;
- Entry *nextPtr;
- int ignoreLeaf;
-
- ignoreLeaf = ((comboPtr->flags & HIDE_LEAVES) &&
- (Blt_Tree_IsLeaf(entryPtr->node)));
-
- if ((!ignoreLeaf) && ((entryPtr->flags & mask) == 0)) {
- nextPtr = FirstChild(entryPtr, mask);
- if (nextPtr != NULL) {
- return nextPtr; /* Pick the first sub-node. */
- }
- }
-
- /*
- * Back up until to a level where we can pick a "next sibling".
- * For the last entry we'll thread our way back to the root.
- */
-
- while (entryPtr != comboPtr->rootPtr) {
- nextPtr = NextSibling(entryPtr, mask);
- if (nextPtr != NULL) {
- return nextPtr;
- }
- entryPtr = ParentEntry(entryPtr);
- }
- return NULL; /* At root, no next node. */
-}
-
-static Entry *
-LastEntry(ComboTree *comboPtr, Entry *entryPtr, unsigned int mask)
-{
- Blt_TreeNode next;
- Entry *nextPtr;
-
- next = Blt_Tree_LastChild(entryPtr->node);
- while (next != NULL) {
- nextPtr = NodeToEntry(comboPtr, next);
- if ((nextPtr->flags & mask) != mask) {
- break;
- }
- entryPtr = nextPtr;
- next = Blt_Tree_LastChild(next);
- }
- return entryPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NearestEntry --
- *
- * Finds the entry closest to the given screen X-Y coordinates
- * in the viewport.
- *
- * Results:
- * Returns the pointer to the closest node. If no node is
- * visible (nodes may be hidden), NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Entry *
-NearestEntry(ComboTree *comboPtr, int x, int y, int selectOne)
-{
- Entry *lastPtr;
- Entry **p;
-
- /*
- * We implicitly can pick only visible entries. So make sure that
- * the tree exists.
- */
- if (comboPtr->nVisible == 0) {
- return NULL;
- }
- if (y < 0) {
- return (selectOne) ? comboPtr->visibleEntries[0] : NULL;
- }
- /*
- * Since the entry positions were previously computed in world
- * coordinates, convert Y-coordinate from screen to world
- * coordinates too.
- */
- y = WORLDY(comboPtr, y);
- lastPtr = comboPtr->visibleEntries[0];
- for (p = comboPtr->visibleEntries; *p != NULL; p++) {
- Entry *entryPtr;
-
- entryPtr = *p;
- /*
- * If the start of the next entry starts beyond the point,
- * use the last entry.
- */
- if (entryPtr->worldY > y) {
- return (selectOne) ? entryPtr : NULL;
- }
- if (y < (entryPtr->worldY + entryPtr->height)) {
- return entryPtr; /* Found it. */
- }
- lastPtr = entryPtr;
- }
- return (selectOne) ? lastPtr : NULL;
-}
-
-
-static Entry *
-FindEntryByLabel(ComboTree *comboPtr, const char *string)
-{
- Entry *entryPtr;
-
- entryPtr = comboPtr->rootPtr;
- if (comboPtr->activePtr != NULL) {
- entryPtr = comboPtr->activePtr;
- }
- for (/*empty*/; entryPtr != NULL;
- entryPtr = NextEntry(entryPtr, ENTRY_MASK)){
- if (strcmp(GETLABEL(entryPtr), string) == 0) {
- return entryPtr;
- }
- }
- return NULL;
-}
-
-static void
-DestroyEntry(DestroyData data)
-{
- Entry *entryPtr = (Entry *)data;
- ComboTree *comboPtr;
-
- comboPtr = entryPtr->comboPtr;
- iconsOption.clientData = comboPtr;
- uidOption.clientData = comboPtr;
- labelOption.clientData = comboPtr;
- Blt_FreeOptions(entrySpecs, (char *)entryPtr, comboPtr->display, 0);
- if (!Blt_Tree_TagTableIsShared(comboPtr->tree)) {
- /* Don't clear tags unless this client is the only one using
- * the tag table.*/
- Blt_Tree_ClearTags(comboPtr->tree, entryPtr->node);
- }
- if (entryPtr->textPtr != NULL) {
- Blt_Free(entryPtr->textPtr);
- }
- Blt_PoolFreeItem(comboPtr->entryPool, entryPtr);
-}
-
-
-static void
-FreeEntry(ComboTree *comboPtr, Entry *entryPtr)
-{
- if (entryPtr == comboPtr->activePtr) {
- comboPtr->activePtr = ParentEntry(entryPtr);
- }
- if (entryPtr == comboPtr->activeBtnPtr) {
- comboPtr->activeBtnPtr = NULL;
- }
- Blt_DeleteBindings(comboPtr->bindTable, entryPtr);
- if (entryPtr->hPtr != NULL) {
- Blt_DeleteHashEntry(&comboPtr->entryTable, entryPtr->hPtr);
- }
- entryPtr->node = NULL;
-
- Tcl_EventuallyFree(entryPtr, DestroyEntry);
- /*
- * Indicate that the screen layout of the hierarchy may have changed
- * because this node was deleted. The screen positions of the nodes
- * in comboPtr->visibleEntries are invalidated.
- */
- comboPtr->flags |= (LAYOUT_PENDING | DIRTY);
- EventuallyRedraw(comboPtr);
-}
-
-static void
-DestroyEntries(ComboTree *comboPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- /* Release the current tree, removing any entry fields. */
- for (hPtr = Blt_FirstHashEntry(&comboPtr->entryTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Entry *entryPtr;
-
- entryPtr = Blt_GetHashValue(hPtr);
- entryPtr->hPtr = NULL;
- FreeEntry(comboPtr, entryPtr);
- }
- Blt_DeleteHashTable(&comboPtr->entryTable);
-}
-
-static const char *
-GetFullName(
- ComboTree *comboPtr,
- Entry *entryPtr,
- Tcl_DString *resultPtr)
-{
- const char **names; /* Used the stack the component names. */
- const char *staticSpace[64+2];
- int level;
- int i;
-
- level = Blt_Tree_NodeDepth(entryPtr->node);
- if (GETLABEL(comboPtr->rootPtr) == NULL) {
- level--;
- }
- if (level > 64) {
- names = Blt_AssertMalloc((level + 2) * sizeof(char *));
- } else {
- names = staticSpace;
- }
- for (i = level; i >= 0; i--) {
- Blt_TreeNode node;
-
- /* Save the name of each ancestor in the name array. */
- names[i] = GETLABEL(entryPtr);
- node = Blt_Tree_ParentNode(entryPtr->node);
- if (node != NULL) {
- entryPtr = NodeToEntry(comboPtr, node);
- }
- }
- if (level >= 0) {
- if (comboPtr->pathSep == NULL) {
- for (i = 0; i <= level; i++) {
- Tcl_DStringAppendElement(resultPtr, names[i]);
- }
- } else {
- Tcl_DStringAppend(resultPtr, names[0], -1);
- for (i = 1; i <= level; i++) {
- Tcl_DStringAppend(resultPtr, comboPtr->pathSep, -1);
- Tcl_DStringAppend(resultPtr, names[i], -1);
- }
- }
- } else {
- if (comboPtr->pathSep != NULL) {
- Tcl_DStringAppend(resultPtr, comboPtr->pathSep, -1);
- }
- }
- if (names != staticSpace) {
- Blt_Free(names);
- }
- return Tcl_DStringValue(resultPtr);
-}
-
-
-/*
- * Preprocess the command string for percent substitution.
- */
-static void
-PercentSubst(
- ComboTree *comboPtr,
- Entry *entryPtr,
- const char *command,
- Tcl_DString *resultPtr)
-{
- const char *last, *p;
- const char *fullName;
- Tcl_DString ds;
-
- /*
- * Get the full path name of the node, in case we need to substitute for
- * it.
- */
- Tcl_DStringInit(&ds);
- fullName = GetFullName(comboPtr, entryPtr, &ds);
- Tcl_DStringInit(resultPtr);
- /* Append the widget name and the node .t 0 */
- for (last = p = command; *p != '\0'; p++) {
- if (*p == '%') {
- const char *string;
- char buf[3];
-
- if (p > last) {
- Tcl_DStringAppend(resultPtr, last, p - last);
- }
- switch (*(p + 1)) {
- case '%': /* Percent sign */
- string = "%";
- break;
- case 'W': /* Widget name */
- string = Tk_PathName(comboPtr->tkwin);
- break;
- case 'P': /* Full pathname */
- string = fullName;
- break;
- case 'p': /* Name of the node */
- string = GETLABEL(entryPtr);
- break;
- case '#': /* Node identifier */
- string = Blt_Tree_NodeIdAscii(entryPtr->node);
- break;
- default:
- if (*(p + 1) == '\0') {
- p--;
- }
- buf[0] = *p, buf[1] = *(p + 1), buf[2] = '\0';
- string = buf;
- break;
- }
- Tcl_DStringAppend(resultPtr, string, -1);
- p++;
- last = p + 1;
- }
- }
- if (p > last) {
- Tcl_DStringAppend(resultPtr, last, p-last);
- }
- Tcl_DStringFree(&ds);
-}
-
-static int
-CloseEntry(ComboTree *comboPtr, Entry *entryPtr)
-{
- const char *cmd;
-
- if (entryPtr->flags & ENTRY_CLOSED) {
- return TCL_OK; /* Entry is already closed. */
- }
- entryPtr->flags |= ENTRY_CLOSED;
-
- /*
- * Invoke the entry's "close" command, if there is one. Otherwise
- * try the treeview's global "close" command.
- */
- cmd = CHOOSE(comboPtr->closeCmd, entryPtr->closeCmd);
- if (cmd != NULL) {
- Tcl_DString ds;
- int result;
-
- PercentSubst(comboPtr, entryPtr, cmd, &ds);
- Tcl_Preserve(entryPtr);
- result = Tcl_GlobalEval(comboPtr->interp, Tcl_DStringValue(&ds));
- Tcl_Release(entryPtr);
- Tcl_DStringFree(&ds);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- comboPtr->flags |= LAYOUT_PENDING;
- return TCL_OK;
-}
-
-
-static int
-OpenEntry(ComboTree *comboPtr, Entry *entryPtr)
-{
- const char *cmd;
-
- if ((entryPtr->flags & ENTRY_CLOSED) == 0) {
- return TCL_OK; /* Entry is already open. */
- }
- entryPtr->flags &= ~ENTRY_CLOSED;
- /*
- * If there's a "open" command proc specified for the entry, use that
- * instead of the more general "open" proc for the entire treeview.
- */
- cmd = CHOOSE(comboPtr->openCmd, entryPtr->openCmd);
- if (cmd != NULL) {
- Tcl_DString ds;
- int result;
-
- PercentSubst(comboPtr, entryPtr, cmd, &ds);
- Tcl_Preserve(entryPtr);
- result = Tcl_GlobalEval(comboPtr->interp, Tcl_DStringValue(&ds));
- Tcl_Release(entryPtr);
- Tcl_DStringFree(&ds);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- comboPtr->flags |= LAYOUT_PENDING;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateEntry --
- *
- * Marks the designated entry as active. The entry is redrawn with its
- * active colors. The previously active entry is deactivated. If the
- * new entry is NULL, then this means that no new entry is to be
- * activated.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Individual entries entries may be scheduled to be drawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ActivateEntry(ComboTree *comboPtr, Entry *entryPtr)
-{
- if ((comboPtr->activePtr == entryPtr) && (entryPtr != NULL)) {
- return; /* Entry is already active. */
- }
- if (comboPtr->activePtr != NULL) {
- EventuallyRedrawEntry(comboPtr->activePtr);
- }
- comboPtr->activePtr = entryPtr;
- if (entryPtr != NULL) {
- EventuallyRedrawEntry(entryPtr);
- }
-}
-
-static int
-ConfigureEntry(
- ComboTree *comboPtr,
- Entry *entryPtr,
- int objc,
- Tcl_Obj *const *objv,
- int flags)
-{
- iconsOption.clientData = comboPtr;
- uidOption.clientData = comboPtr;
- labelOption.clientData = comboPtr;
- if (Blt_ConfigureWidgetFromObj(comboPtr->interp, comboPtr->tkwin,
- entrySpecs, objc, objv, (char *)entryPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
-
- /* Assume all changes require a new layout. */
- entryPtr->flags |= ENTRY_LAYOUT_PENDING;
- comboPtr->flags |= (LAYOUT_PENDING | DIRTY);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewEntry --
- *
- * Allocates and initializes a new entry.
- *
- * Results:
- * Returns the entry.
- *
- *---------------------------------------------------------------------------
- */
-static Entry *
-NewEntry(ComboTree *comboPtr, Blt_TreeNode node)
-{
- Entry *entryPtr;
-
- entryPtr = Blt_PoolAllocItem(comboPtr->entryPool, sizeof(Entry));
- memset(entryPtr, 0, sizeof(Entry));
- entryPtr->flags = (unsigned short)(comboPtr->buttonFlags | ENTRY_CLOSED);
- entryPtr->comboPtr = comboPtr;
- entryPtr->labelUid = NULL;
- entryPtr->node = node;
- return entryPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateEntry --
- *
- * This procedure is called by the Tree object when a node is created and
- * inserted into the tree. It adds a new treeview entry field to the
- * node.
- *
- * Results:
- * Returns the entry.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateEntry(
- ComboTree *comboPtr,
- Blt_TreeNode node, /* Node that has just been created. */
- int objc,
- Tcl_Obj *const *objv,
- int flags)
-{
- Entry *entryPtr;
- int isNew;
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_CreateHashEntry(&comboPtr->entryTable, (char *)node, &isNew);
- if (isNew) {
- entryPtr = NewEntry(comboPtr, node);
- Blt_SetHashValue(hPtr, entryPtr);
- entryPtr->hPtr = hPtr;
- } else {
- entryPtr = Blt_GetHashValue(hPtr);
- }
- if (ConfigureEntry(comboPtr, entryPtr, objc, objv, flags) != TCL_OK) {
- FreeEntry(comboPtr, entryPtr);
- return TCL_ERROR; /* Error configuring the entry. */
- }
- comboPtr->flags |= (LAYOUT_PENDING | DIRTY);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTagTable --
- *
- * Returns the hash table containing row indices for a tag.
- *
- * Results:
- * Returns a pointer to the hash table containing indices for the given
- * tag. If the row has no tags, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_HashTable *
-GetTagTable(ComboTree *comboPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&comboPtr->entryBindTagTable, tagName);
- if (hPtr == NULL) {
- return NULL; /* No tag by that name. */
- }
- return Blt_GetHashValue(hPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetEntryIterator --
- *
- * Converts a string into node pointer. The string may be in one of the
- * following forms:
- *
- * NNN - inode.
- * "active" - Currently active node.
- * "anchor" - anchor of selected region.
- * "current" - Currently picked node in bindtable.
- * "focus" - The node currently with focus.
- * "root" - Root node.
- * "end" - Last open node in the entire hierarchy.
- * "next" - Next open node from the currently active
- * node. Wraps around back to top.
- * "last" - Previous open node from the currently active
- * node. Wraps around back to bottom.
- * "up" - Next open node from the currently active
- * node. Does not wrap around.
- * "down" - Previous open node from the currently active
- * node. Does not wrap around.
- * "nextsibling" - Next sibling of the current node.
- * "prevsibling" - Previous sibling of the current node.
- * "parent" - Parent of the current node.
- * "view.top" - Top of viewport.
- * "view.bottom" - Bottom of viewport.
- * @x,y - Closest node to the specified X-Y position.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned. The
- * pointer to the node is returned via nodePtr. Otherwise, TCL_ERROR is
- * returned and an error message is left in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetEntryIterator(
- Tcl_Interp *interp,
- ComboTree *comboPtr,
- Tcl_Obj *objPtr,
- EntryIterator *iterPtr)
-{
- Entry *entryPtr, *fromPtr;
- char c;
- const char *string;
-
- iterPtr->first = NULL;
- iterPtr->type = ITER_INDEX;
- string = Tcl_GetString(objPtr);
- iterPtr->tagName = Tcl_GetString(objPtr);
- entryPtr = NULL;
- fromPtr = comboPtr->activePtr;
- if (fromPtr == NULL) {
- fromPtr = comboPtr->rootPtr;
- }
- c = string[0];
- if (isdigit(UCHAR(string[0]))) {
- Blt_TreeNode node;
- long inode;
-
- if (Tcl_GetLongFromObj(interp, objPtr, &inode) != TCL_OK) {
- return TCL_ERROR;
- }
- node = Blt_Tree_GetNode(comboPtr->tree, inode);
- if (node != NULL) {
- iterPtr->first = NodeToEntry(comboPtr, node);
- }
- return TCL_OK; /* Node Id. */
- }
- if (c == '@') {
- int x, y;
-
- if (Blt_GetXY(interp, comboPtr->tkwin, string, &x, &y) == TCL_OK) {
- iterPtr->first = NearestEntry(comboPtr, x, y, TRUE);
- }
- } else if ((c == 'a') && (strcmp(string, "all") == 0)) {
- iterPtr->first = comboPtr->rootPtr;
- iterPtr->type = ITER_ALL;
- } else if ((c == 'a') && (strcmp(string, "active") == 0)) {
- iterPtr->first = comboPtr->activePtr;
- } else if ((c == 'b') && (strcmp(string, "bottom") == 0)) {
- iterPtr->first = LastEntry(comboPtr, comboPtr->rootPtr, ENTRY_MASK);
- } else if ((c == 't') && (strcmp(string, "top") == 0)) {
- entryPtr = comboPtr->rootPtr;
- if (comboPtr->flags & HIDE_ROOT) {
- entryPtr = NextEntry(entryPtr, ENTRY_MASK);
- }
- iterPtr->first = entryPtr;
- } else if ((c == 'e') && (strcmp(string, "end") == 0)) {
- iterPtr->first = LastEntry(comboPtr, comboPtr->rootPtr, ENTRY_MASK);
- } else if ((c == 'r') && (strcmp(string, "root") == 0)) {
- iterPtr->first = comboPtr->rootPtr;
- } else if ((c == 'p') && (strcmp(string, "parent") == 0)) {
- if (fromPtr != comboPtr->rootPtr) {
- iterPtr->first = ParentEntry(fromPtr);
- }
- } else if ((c == 'c') && (strcmp(string, "current") == 0)) {
- /* Can't trust picked entry, if entries have been added or deleted. */
- if (!(comboPtr->flags & DIRTY)) {
- ClientData context;
-
- context = Blt_GetCurrentContext(comboPtr->bindTable);
- if ((context == PICK_ENTRY) || (context == PICK_BUTTON)) {
- iterPtr->first = Blt_GetCurrentItem(comboPtr->bindTable);
- }
- }
- } else if ((c == 'u') && (strcmp(string, "up") == 0)) {
- entryPtr = PrevEntry(fromPtr, ENTRY_MASK);
- if (entryPtr == NULL) {
- entryPtr = fromPtr;
- }
- if ((entryPtr == comboPtr->rootPtr) &&
- (comboPtr->flags & HIDE_ROOT)) {
- entryPtr = NextEntry(entryPtr, ENTRY_MASK);
- }
- iterPtr->first = entryPtr;
- } else if ((c == 'd') && (strcmp(string, "down") == 0)) {
- entryPtr = NextEntry(fromPtr, ENTRY_MASK);
- if (entryPtr == NULL) {
- entryPtr = fromPtr;
- }
- if ((entryPtr == comboPtr->rootPtr) &&
- (comboPtr->flags & HIDE_ROOT)) {
- entryPtr = NextEntry(entryPtr, ENTRY_MASK);
- }
- iterPtr->first = entryPtr;
- } else if (((c == 'l') && (strcmp(string, "last") == 0)) ||
- ((c == 'p') && (strcmp(string, "prev") == 0))) {
- entryPtr = PrevEntry(fromPtr, ENTRY_MASK);
- if (entryPtr == NULL) {
- entryPtr = LastEntry(comboPtr, comboPtr->rootPtr, ENTRY_MASK);
- }
- if ((entryPtr == comboPtr->rootPtr) &&
- (comboPtr->flags & HIDE_ROOT)) {
- entryPtr = NextEntry(entryPtr, ENTRY_MASK);
- }
- iterPtr->first = entryPtr;
- } else if ((c == 'n') && (strcmp(string, "next") == 0)) {
- entryPtr = NextEntry(fromPtr, ENTRY_MASK);
- if (entryPtr == NULL) {
- if (comboPtr->flags & HIDE_ROOT) {
- entryPtr = NextEntry(comboPtr->rootPtr,ENTRY_MASK);
- } else {
- entryPtr = comboPtr->rootPtr;
- }
- }
- iterPtr->first = entryPtr;
- } else if ((c == 'n') && (strcmp(string, "nextsibling") == 0)) {
- iterPtr->first = NextSibling(fromPtr, ENTRY_MASK);
- } else if ((c == 'n') && (strcmp(string, "none") == 0)) {
- iterPtr->first = NULL;
- } else if ((c == 'p') && (strcmp(string, "prevsibling") == 0)) {
- iterPtr->first = PrevSibling(fromPtr, ENTRY_MASK);
- } else if ((c == 'v') && (strcmp(string, "view.top") == 0)) {
- if (comboPtr->nVisible > 0) {
- iterPtr->first = comboPtr->visibleEntries[0];
- }
- } else if ((c == 'v') && (strcmp(string, "view.bottom") == 0)) {
- if (comboPtr->nVisible > 0) {
- iterPtr->first = comboPtr->visibleEntries[comboPtr->nVisible - 1];
- }
- } else {
- entryPtr = FindEntryByLabel(comboPtr, iterPtr->tagName);
- if (entryPtr != NULL) {
- iterPtr->first = entryPtr;
- } else {
- iterPtr->tablePtr = GetTagTable(comboPtr, iterPtr->tagName);
- if (iterPtr->tablePtr != NULL) {
- iterPtr->type = ITER_TAG;
- return TCL_OK;
- }
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find tag or entry \"", string,
- "\" in \"", Tk_PathName(comboPtr->tkwin), "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextTaggedEntry --
- *
- * Returns the next entry derived from the given tag.
- *
- * Results:
- * Returns the row location of the first entry. If no more rows can be
- * found, then -1 is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Entry *
-NextTaggedEntry(EntryIterator *iterPtr)
-{
- if (iterPtr->type == ITER_TAG) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_NextHashEntry(&iterPtr->cursor);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- } else if (iterPtr->type == ITER_ALL) {
- Entry *entryPtr;
-
- entryPtr = iterPtr->next;
- if (entryPtr != NULL) {
- iterPtr->next = NextEntry(entryPtr, ENTRY_MASK);
- }
- return entryPtr;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FirstTaggedEntry --
- *
- * Returns the first entry derived from the given tag.
- *
- * Results:
- * Returns the row location of the first entry. If no more rows can be
- * found, then -1 is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Entry *
-FirstTaggedEntry(EntryIterator *iterPtr)
-{
- if (iterPtr->type == ITER_TAG) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FirstHashEntry(iterPtr->tablePtr, &iterPtr->cursor);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
- } else {
- Entry *entryPtr;
-
- entryPtr = iterPtr->first;
- iterPtr->next = NextTaggedEntry(iterPtr);
- return entryPtr;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetEntryFromObj --
- *
- * Gets the entry associated the given index, tag, or label. This
- * routine is used when you want only one entry. It's an error if more
- * than one entry is specified (e.g. "all" tag or range "1:4"). It's
- * also an error if the tag is empty (no entries are currently tagged).
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetEntryFromObj(
- Tcl_Interp *interp,
- ComboTree *comboPtr,
- Tcl_Obj *objPtr,
- Entry **entryPtrPtr)
-{
- EntryIterator iter;
- Entry *firstPtr;
-
- if (GetEntryIterator(interp, comboPtr, objPtr, &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- firstPtr = FirstTaggedEntry(&iter);
- if (firstPtr != NULL) {
- Entry *nextPtr;
-
- nextPtr = NextTaggedEntry(&iter);
- if (nextPtr != NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "multiple entries specified by \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- }
- *entryPtrPtr = firstPtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetEntry --
- *
- * Returns an entry based upon its index. This differs from
- * GetEntryFromObj in that an non-existant entry (NULL) is treated
- * an error.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned. The
- * pointer to the node is returned via nodePtr. Otherwise, TCL_ERROR is
- * returned and an error message is left in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetEntry(ComboTree *comboPtr, Tcl_Obj *objPtr, Entry **entryPtrPtr)
-{
- Entry *entryPtr;
-
- if (GetEntryFromObj(comboPtr->interp, comboPtr, objPtr, &entryPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (entryPtr == NULL) {
- Tcl_ResetResult(comboPtr->interp);
- Tcl_AppendResult(comboPtr->interp, "can't find entry \"",
- Tcl_GetString(objPtr), "\" in \"", Tk_PathName(comboPtr->tkwin),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- *entryPtrPtr = entryPtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetUid --
- *
- * Gets or creates a unique string identifier. Strings are reference
- * counted. The string is placed into a hashed table local to the
- * treeview.
- *
- * Results:
- * Returns the pointer to the hashed string.
- *
- *---------------------------------------------------------------------------
- */
-static UID
-GetUid(ComboTree *comboPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- size_t refCount;
-
- hPtr = Blt_CreateHashEntry(&comboPtr->uidTable, string, &isNew);
- if (isNew) {
- refCount = 1;
- } else {
- refCount = (size_t)Blt_GetHashValue(hPtr);
- refCount++;
- }
- Blt_SetHashValue(hPtr, refCount);
- return Blt_GetHashKey(&comboPtr->uidTable, hPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeUid --
- *
- * Releases the uid. Uids are reference counted, so only when the
- * reference count is zero (i.e. no one else is using the string) is the
- * entry removed from the hash table.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeUid(ComboTree *comboPtr, UID uid)
-{
- Blt_HashEntry *hPtr;
- size_t refCount;
-
- hPtr = Blt_FindHashEntry(&comboPtr->uidTable, uid);
- assert(hPtr != NULL);
- refCount = (size_t)Blt_GetHashValue(hPtr);
- refCount--;
- if (refCount > 0) {
- Blt_SetHashValue(hPtr, refCount);
- } else {
- Blt_DeleteHashEntry(&comboPtr->uidTable, hPtr);
- }
-}
-
-static Icon
-GetIcon(ComboTree *comboPtr, const char *iconName)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- struct _Icon *iconPtr;
-
- hPtr = Blt_CreateHashEntry(&comboPtr->iconTable, iconName, &isNew);
- if (isNew) {
- Tk_Image tkImage;
- int width, height;
-
- tkImage = Tk_GetImage(comboPtr->interp, comboPtr->tkwin,
- (char *)iconName, IconChangedProc, comboPtr);
- if (tkImage == NULL) {
- Blt_DeleteHashEntry(&comboPtr->iconTable, hPtr);
- return NULL;
- }
- Tk_SizeOfImage(tkImage, &width, &height);
- iconPtr = Blt_AssertMalloc(sizeof(struct _Icon));
- iconPtr->tkImage = tkImage;
- iconPtr->hashPtr = hPtr;
- iconPtr->refCount = 1;
- iconPtr->width = width;
- iconPtr->height = height;
- Blt_SetHashValue(hPtr, iconPtr);
- } else {
- iconPtr = Blt_GetHashValue(hPtr);
- iconPtr->refCount++;
- }
- return iconPtr;
-}
-
-static void
-FreeIcon(ComboTree *comboPtr, struct _Icon *iconPtr)
-{
- iconPtr->refCount--;
- if (iconPtr->refCount == 0) {
- Blt_DeleteHashEntry(&comboPtr->iconTable, iconPtr->hashPtr);
- Tk_FreeImage(iconPtr->tkImage);
- Blt_Free(iconPtr);
- }
-}
-
-static void
-DestroyIcons(ComboTree *comboPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- struct _Icon *iconPtr;
-
- for (hPtr = Blt_FirstHashEntry(&comboPtr->iconTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- iconPtr = Blt_GetHashValue(hPtr);
- Tk_FreeImage(iconPtr->tkImage);
- Blt_Free(iconPtr);
- }
- Blt_DeleteHashTable(&comboPtr->iconTable);
-}
-
-static void
-DestroyStyle(Style *stylePtr)
-{
- ComboTree *comboPtr;
-
- stylePtr->refCount--;
- if (stylePtr->refCount > 0) {
- return;
- }
- comboPtr = stylePtr->comboPtr;
- iconsOption.clientData = comboPtr;
- Blt_FreeOptions(styleSpecs, (char *)stylePtr, comboPtr->display, 0);
- if (stylePtr->labelActiveGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->labelActiveGC);
- }
- if (stylePtr->labelDisabledGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->labelDisabledGC);
- }
- if (stylePtr->labelNormalGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->labelNormalGC);
- }
- if (stylePtr->hPtr != NULL) {
- Blt_DeleteHashEntry(&stylePtr->comboPtr->styleTable, stylePtr->hPtr);
- }
- if (stylePtr != &stylePtr->comboPtr->defStyle) {
- Blt_Free(stylePtr);
- }
-}
-
-static int
-AddDefaultStyle(Tcl_Interp *interp, ComboTree *comboPtr)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- Style *stylePtr;
-
- hPtr = Blt_CreateHashEntry(&comboPtr->styleTable, "default", &isNew);
- if (!isNew) {
- Tcl_AppendResult(interp, "combotree style \"", "default",
- "\" already exists.", (char *)NULL);
- return TCL_ERROR;
- }
- stylePtr = &comboPtr->defStyle;
- assert(stylePtr);
- stylePtr->refCount = 1;
- stylePtr->name = Blt_GetHashKey(&comboPtr->styleTable, hPtr);
- stylePtr->hPtr = hPtr;
- stylePtr->comboPtr = comboPtr;
- stylePtr->relief = TK_RELIEF_FLAT;
- stylePtr->activeRelief = TK_RELIEF_FLAT;
- Blt_SetHashValue(hPtr, stylePtr);
- return TCL_OK;
-}
-
-static void
-DestroyStyles(ComboTree *comboPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&comboPtr->styleTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Style *stylePtr;
-
- stylePtr = Blt_GetHashValue(hPtr);
- stylePtr->hPtr = NULL;
- stylePtr->refCount = 0;
- DestroyStyle(stylePtr);
- }
- Blt_DeleteHashTable(&comboPtr->styleTable);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetStyleFromObj --
- *
- * Gets the style associated with the given name.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetStyleFromObj(
- Tcl_Interp *interp,
- ComboTree *comboPtr,
- Tcl_Obj *objPtr,
- Style **stylePtrPtr)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&comboPtr->styleTable, Tcl_GetString(objPtr));
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find style \"",
- Tcl_GetString(objPtr), "\" in combomenu \"",
- Tk_PathName(comboPtr->tkwin), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- *stylePtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-
-
-static void
-MapEntry(Entry *entryPtr)
-{
- ComboTree *comboPtr;
- int entryWidth, entryHeight;
-
- comboPtr = entryPtr->comboPtr;
- /*
- * FIXME: Use of DIRTY flag inconsistent. When does it
- * mean "dirty entry"? When does it mean "dirty column"?
- * Does it matter? probably
- */
- if (entryPtr->flags & ENTRY_DIRTY) {
- Blt_FontMetrics fontMetrics;
- Style *stylePtr;
- const char *label;
- int textWidth, textHeight;
-
- stylePtr = entryPtr->stylePtr;
-
- entryPtr->iconWidth = entryPtr->iconHeight = 0;
- if (stylePtr->icons != NULL) {
- int i;
-
- for (i = 0; i < 2; i++) {
- if (stylePtr->icons[i] == NULL) {
- break;
- }
- if (entryPtr->iconWidth < IconWidth(stylePtr->icons[i])) {
- entryPtr->iconWidth = IconWidth(stylePtr->icons[i]);
- }
- if (entryPtr->iconHeight < IconHeight(stylePtr->icons[i])) {
- entryPtr->iconHeight = IconHeight(stylePtr->icons[i]);
- }
- }
- }
- if ((stylePtr->icons == NULL) || (stylePtr->icons[0] == NULL)) {
- entryPtr->iconWidth = ICON_WIDTH;
- entryPtr->iconHeight = ICON_HEIGHT;
- }
- entryPtr->iconWidth += 2 * ICON_PADX;
- entryPtr->iconHeight += 2 * ICON_PADY;
- entryHeight = MAX(entryPtr->iconHeight, comboPtr->button.height);
-
- if (entryPtr->textPtr != NULL) {
- Blt_Free(entryPtr->textPtr);
- entryPtr->textPtr = NULL;
- }
- Blt_GetFontMetrics(stylePtr->labelFont, &fontMetrics);
- entryPtr->lineHeight = fontMetrics.linespace;
- entryPtr->lineHeight += 2 * LABEL_PADY + comboPtr->leader;
- label = GETLABEL(entryPtr);
- if (label[0] == '\0') {
- textWidth = textHeight = entryPtr->lineHeight;
- } else {
- TextStyle ts;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, stylePtr->labelFont);
- entryPtr->textPtr = Blt_Ts_CreateLayout(label, -1, &ts);
- textWidth = entryPtr->textPtr->width;
- textHeight = entryPtr->textPtr->height;
- }
- textWidth += 2 * LABEL_PADX;
- textHeight += 2 * LABEL_PADY;
- textWidth = ODD(textWidth);
- if (entryPtr->reqHeight > textHeight) {
- textHeight = entryPtr->reqHeight;
- }
- textHeight = ODD(textHeight);
- entryWidth = textWidth;
- if (entryHeight < textHeight) {
- entryHeight = textHeight;
- }
- entryPtr->labelWidth = textWidth;
- entryPtr->labelHeight = textHeight;
- } else {
- entryHeight = entryPtr->labelHeight;
- entryWidth = entryPtr->labelWidth;
- }
- /*
- * Find the maximum height of the data value entries. This also has the
- * side effect of contributing the maximum width of the column.
- */
- entryPtr->width = entryWidth + COLUMN_PAD;
- entryPtr->height = entryHeight + comboPtr->leader;
- /*
- * Force the height of the entry to an even number. This is to make the
- * dots or the vertical line segments coincide with the start of the
- * horizontal lines.
- */
- if (entryPtr->height & 0x01) {
- entryPtr->height++;
- }
- entryPtr->flags &= ~ENTRY_DIRTY;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResetCoordinates --
- *
- * Determines the maximum height of all visible entries.
- *
- * 1. Sets the worldY coordinate for all mapped/open entries.
- * 2. Determines if entry needs a button.
- * 3. Collects the minimum height of open/mapped entries. (Do for all
- * entries upon insert).
- * 4. Figures out horizontal extent of each entry (will be width of
- * tree view column).
- * 5. Collects maximum icon size for each level.
- * 6. The height of its vertical line
- *
- * Results:
- * Returns 1 if beyond the last visible entry, 0 otherwise.
- *
- * Side effects:
- * The array of visible nodes is filled.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ResetCoordinates(ComboTree *comboPtr, Entry *entryPtr, int *yPtr, int *numPtr)
-{
- if ((entryPtr != comboPtr->rootPtr) && (EntryIsHidden(entryPtr))) {
- entryPtr->worldY = -1;
- entryPtr->vertLineLength = -1;
- return; /* If the entry is hidden, then do nothing. */
- }
- /* Set the world y-coordinate of the entry. Initialize the length of the
- * dotted vertical line that runs from the entry downward with the current
- * y-offset. */
- entryPtr->worldY = *yPtr;
- entryPtr->vertLineLength = -(*yPtr);
- *yPtr += entryPtr->height;
- entryPtr->seqNum = *numPtr;
- (*numPtr)++;
- {
- int depth;
- LevelInfo *infoPtr;
-
- depth = Blt_Tree_NodeDepth(entryPtr->node) + 1;
- infoPtr = comboPtr->levelInfo + depth;
- if (infoPtr->labelWidth < entryPtr->labelWidth) {
- infoPtr->labelWidth = entryPtr->labelWidth;
- }
- if (infoPtr->iconWidth < entryPtr->iconWidth) {
- infoPtr->iconWidth = entryPtr->iconWidth;
- }
- infoPtr->iconWidth |= 0x01;
- }
- if ((entryPtr->flags & ENTRY_CLOSED) == 0) {
- Entry *bottomPtr, *nextPtr;
-
- bottomPtr = entryPtr;
- for (nextPtr = FirstChild(entryPtr, ENTRY_HIDE); nextPtr != NULL;
- nextPtr = NextSibling(nextPtr, ENTRY_HIDE)) {
- ResetCoordinates(comboPtr, nextPtr, yPtr, numPtr);
- bottomPtr = nextPtr;
- }
- entryPtr->vertLineLength += bottomPtr->worldY;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapTree --
- *
- * Compute the layout when entries are opened/closed, inserted/deleted,
- * or when text attributes change (such as font, linespacing).
- *
- * Results:
- * None.
- *
- * Side effects:
- * The world coordinates are set for all the opened entries.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapTree(ComboTree *comboPtr)
-{
- int y;
- int index;
-
- /*
- * Pass 1: Reinitialize column sizes and loop through all nodes.
- *
- * 1. Recalculate the size of each entry as needed.
- * 2. The maximum depth of the tree.
- * 3. Minimum height of an entry. Dividing this by the
- * height of the widget gives a rough estimate of the
- * maximum number of visible entries.
- * 4. Build an array to hold level information to be filled
- * in on pass 2.
- */
- if (comboPtr->flags & DIRTY) {
- Entry *entryPtr;
-
- comboPtr->minHeight = SHRT_MAX;
- comboPtr->depth = 0;
- for (entryPtr = comboPtr->rootPtr; entryPtr != NULL;
- entryPtr = NextEntry(entryPtr, 0)){
- MapEntry(entryPtr);
-
- /* Get the height of the shortest entry. */
- if (comboPtr->minHeight > entryPtr->height) {
- comboPtr->minHeight = entryPtr->height;
- }
-
- /*
- * Determine if the entry should display a button (indicating that
- * it has children) and mark the entry accordingly.
- */
- entryPtr->flags &= ~ENTRY_BUTTON;
- if (entryPtr->flags & ENTRY_BTN_SHOW) {
- entryPtr->flags |= ENTRY_BUTTON;
- } else if (entryPtr->flags & ENTRY_BTN_AUTO) {
- if (comboPtr->flags & HIDE_LEAVES) {
- /* Check that a non-leaf child exists */
- if (FirstChild(entryPtr, ENTRY_HIDE) != NULL) {
- entryPtr->flags |= ENTRY_BUTTON;
- }
- } else if (!Blt_Tree_IsLeaf(entryPtr->node)) {
- entryPtr->flags |= ENTRY_BUTTON;
- }
- }
-
- /* Save the maximum depth of the tree. */
- if (comboPtr->depth < Blt_Tree_NodeDepth(entryPtr->node)) {
- comboPtr->depth = Blt_Tree_NodeDepth(entryPtr->node);
- }
- }
-
- /* Create bookkeeping for each level of the tree. */
- if (comboPtr->levelInfo != NULL) {
- Blt_Free(comboPtr->levelInfo);
- }
- comboPtr->levelInfo = Blt_AssertCalloc(comboPtr->depth + 2,
- sizeof(LevelInfo));
- comboPtr->flags &= ~DIRTY;
- }
- {
- size_t i;
-
- /* Reset the level bookkeeping. */
- for (i = 0; i <= (comboPtr->depth + 1); i++) {
- comboPtr->levelInfo[i].labelWidth = comboPtr->levelInfo[i].x =
- comboPtr->levelInfo[i].iconWidth = 0;
- }
- }
-
- /*
- * Pass 2: Loop through all open/mapped nodes.
- *
- * 1. Set world y-coordinates for entries. We must defer setting
- * the x-coordinates until we know the maximum icon sizes at
- * each level.
- * 2. Compute the maximum depth of the tree.
- * 3. Build an array to hold level information.
- */
- y = 0;
- if (comboPtr->flags & HIDE_ROOT) {
- /* If the root entry is to be hidden, cheat by offsetting the
- * y-coordinates by the height of the entry. */
- y = -(comboPtr->rootPtr->height);
- }
- index = 0;
- ResetCoordinates(comboPtr, comboPtr->rootPtr, &y, &index);
- comboPtr->worldHeight = y; /* Set the scroll height of the hierarchy. */
- if (comboPtr->worldHeight < 1) {
- comboPtr->worldHeight = 1;
- }
- {
- int maxX;
- int sum;
- size_t i;
-
- sum = maxX = 0;
- for (i = 0; i <= (comboPtr->depth + 1); i++) {
- int x;
-
- sum += comboPtr->levelInfo[i].iconWidth;
- if (i <= comboPtr->depth) {
- comboPtr->levelInfo[i + 1].x = sum;
- }
- x = sum + comboPtr->levelInfo[i].labelWidth;
- if (x > maxX) {
- maxX = x;
- }
- }
- comboPtr->worldWidth = maxX;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeComboGeometry --
- *
- * Recompute the layout when entries are opened/closed, inserted/deleted,
- * or when text attributes change (such as font, linespacing).
- *
- * Results:
- * None.
- *
- * Side effects:
- * The world coordinates are set for all the opened entries.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComputeComboGeometry(ComboTree *comboPtr)
-{
- int w, h;
- int screenWidth, screenHeight;
-
-
- MapTree(comboPtr);
-
- Blt_SizeOfScreen(comboPtr->tkwin, &screenWidth, &screenHeight);
- comboPtr->xScrollbarHeight = comboPtr->yScrollbarWidth = 0;
- if (comboPtr->reqWidth > 0) {
- w = comboPtr->reqWidth;
- fprintf(stderr, "%s rw=%d\n", Tk_PathName(comboPtr->tkwin), w);
- } else if (comboPtr->reqWidth < 0) {
- w = MIN(-comboPtr->reqWidth, comboPtr->worldWidth);
- fprintf(stderr, "%s min(%d,%d)=%d\n", Tk_PathName(comboPtr->tkwin),
- -comboPtr->reqWidth, comboPtr->worldWidth, w);
- } else {
- w = Tk_Width(Tk_Parent(comboPtr->tkwin));
- if (w <= 1) {
- w = Tk_ReqWidth(Tk_Parent(comboPtr->tkwin));
- }
- fprintf(stderr, "%s min(%d,%d)=%d\n", Tk_PathName(comboPtr->tkwin),
- screenWidth, comboPtr->worldWidth, w);
- }
- if ((comboPtr->worldWidth > w) && (comboPtr->xScrollbar != NULL)) {
- comboPtr->xScrollbarHeight = Tk_ReqHeight(comboPtr->xScrollbar);
- }
- if (comboPtr->reqHeight > 0) {
- h = comboPtr->reqHeight;
- } else if (comboPtr->reqHeight < 0) {
- h = MIN(-comboPtr->reqHeight, comboPtr->worldHeight);
- } else {
- h=MIN(screenHeight, comboPtr->worldHeight);
- }
- if ((comboPtr->worldHeight > h) && (comboPtr->yScrollbar != NULL)) {
- comboPtr->yScrollbarWidth = Tk_ReqWidth(comboPtr->yScrollbar);
- }
- if (comboPtr->reqWidth == 0) {
-#ifdef notdef
- w += 2 * (comboPtr->borderWidth + 2 * ITEM_IPAD);
- w += comboPtr->yScrollbarWidth;
-#endif
- }
- if (comboPtr->reqHeight == 0) {
- h += comboPtr->xScrollbarHeight;
- h += 2 * comboPtr->borderWidth;
- }
-#ifdef notdef
- comboPtr->width = w;
- comboPtr->height = h;
- fprintf(stderr, "%s= w=%d leftInd w=%d icon w=%d label w=%d rightInd w=%d\n",
- Tk_PathName(comboPtr->tkwin), comboPtr->width,
- comboPtr->leftIndWidth, comboPtr->iconWidth, comboPtr->labelWidth,
- comboPtr->rightIndWidth);
-#endif
- if ((w != Tk_ReqWidth(comboPtr->tkwin)) ||
- (h != Tk_ReqHeight(comboPtr->tkwin))) {
- Tk_GeometryRequest(comboPtr->tkwin, w, h);
- }
- comboPtr->flags |= SCROLL_PENDING | LAYOUT_PENDING;
-}
-
-/* Converters for configuration options. */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToButtonProc --
- *
- * Convert a string to one of three values.
- * 0 - false, no, off
- * 1 - true, yes, on
- * 2 - auto
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToButtonProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- const char *string;
- int *flagsPtr = (int *)(widgRec + offset);
-
- string = Tcl_GetString(objPtr);
- if ((string[0] == 'a') && (strcmp(string, "auto") == 0)) {
- *flagsPtr &= ~ENTRY_BTN_MASK;
- *flagsPtr |= ENTRY_BTN_AUTO;
- } else {
- int bool;
-
- if (Tcl_GetBooleanFromObj(interp, objPtr, &bool) != TCL_OK) {
- return TCL_ERROR;
- }
- *flagsPtr &= ~ENTRY_BTN_MASK;
- if (bool) {
- *flagsPtr |= ENTRY_BTN_SHOW;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonToObjProc --
- *
- * Results:
- * The string representation of the button boolean is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ButtonToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- int bool;
- unsigned int buttonFlags = *(int *)(widgRec + offset);
-
- bool = (buttonFlags & ENTRY_BTN_MASK);
- if (bool == ENTRY_BTN_AUTO) {
- return Tcl_NewStringObj("auto", 4);
- } else {
- return Tcl_NewBooleanObj(bool);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToLabelProc --
- *
- * Convert the string representing the label.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToLabelProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- UID *labelPtr = (UID *)(widgRec + offset);
- const char *string;
-
- string = Tcl_GetString(objPtr);
- if (string[0] != '\0') {
- ComboTree *comboPtr = clientData;
-
- *labelPtr = GetUid(comboPtr, string);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LabelToObjProc --
- *
- * Results:
- * The string of the entry's label is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-LabelToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- UID labelUid = *(UID *)(widgRec + offset);
- const char *string;
-
- if (labelUid == NULL) {
- Entry *entryPtr = (Entry *)widgRec;
-
- string = Blt_Tree_NodeLabel(entryPtr->node);
- } else {
- string = labelUid;
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-/*ARGSUSED*/
-static void
-FreeLabelProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- UID *labelPtr = (UID *)(widgRec + offset);
-
- if (*labelPtr != NULL) {
- ComboTree *comboPtr = clientData;
-
- FreeUid(comboPtr, *labelPtr);
- *labelPtr = NULL;
- }
-}
-
-/*ARGSUSED*/
-static void
-FreeStyleProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Style *stylePtr = *(Style **)(widgRec + offset);
-
- if ((stylePtr != NULL) && (stylePtr != &stylePtr->comboPtr->defStyle)) {
- DestroyStyle(stylePtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToStyleProc --
- *
- * Convert the string representation of a color into a XColor pointer.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToStyleProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboTree *comboPtr;
- Entry *entryPtr = (Entry *)widgRec;
- Style **stylePtrPtr = (Style **)(widgRec + offset);
- Style *stylePtr;
- const char *string;
-
- string = Tcl_GetString(objPtr);
- comboPtr = entryPtr->comboPtr;
- if ((string[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- stylePtr = NULL;
- } else if (GetStyleFromObj(interp, comboPtr, objPtr, &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Release the old style. */
- if ((*stylePtrPtr != NULL) && (*stylePtrPtr != &comboPtr->defStyle)) {
- DestroyStyle(*stylePtrPtr);
- }
- stylePtr->refCount++;
- *stylePtrPtr = stylePtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-StyleToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Style *stylePtr = *(Style **)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (stylePtr == NULL) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- objPtr = Tcl_NewStringObj(stylePtr->name, -1);
- }
- return objPtr;
-}
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToUidProc --
- *
- * Converts the string to a Uid. Uid's are hashed, reference
- * counted strings.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToUidProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- ComboTree *comboPtr = clientData;
- UID *uidPtr = (UID *)(widgRec + offset);
-
- *uidPtr = GetUid(comboPtr, Tcl_GetString(objPtr));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UidToObjProc --
- *
- * Returns the uid as a string.
- *
- * Results:
- * The fill style string is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-UidToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- UID uid = *(UID *)(widgRec + offset);
-
- if (uid == NULL) {
- return Tcl_NewStringObj("", -1);
- } else {
- return Tcl_NewStringObj(uid, -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeUid --
- *
- * Free the UID from the widget record, setting it to NULL.
- *
- * Results:
- * The UID in the widget record is set to NULL.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-FreeUidProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- UID *uidPtr = (UID *)(widgRec + offset);
-
- if (*uidPtr != NULL) {
- ComboTree *comboPtr = clientData;
-
- FreeUid(comboPtr, *uidPtr);
- *uidPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconChangedProc
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-IconChangedProc(
- ClientData clientData,
- int x, /* Not used. */
- int y, /* Not used. */
- int width, /* Not used. */
- int height, /* Not used. */
- int imageWidth, /* Not used. */
- int imageHeight) /* Not used. */
-{
- ComboTree *comboPtr = clientData;
-
- comboPtr->flags |= (DIRTY | LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(comboPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToIconsProc --
- *
- * Convert a list of image names into Tk images.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToIconsProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tcl_Obj **objv;
- ComboTree *comboPtr = clientData;
- Icon **iconPtrPtr = (Icon **)(widgRec + offset);
- Icon *icons;
- int objc;
- int result;
-
- result = TCL_OK;
- icons = NULL;
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc > 0) {
- int i;
-
- icons = Blt_AssertMalloc(sizeof(Icon *) * (objc + 1));
- for (i = 0; i < objc; i++) {
- icons[i] = GetIcon(comboPtr, Tcl_GetString(objv[i]));
- if (icons[i] == NULL) {
- result = TCL_ERROR;
- break;
- }
- }
- icons[i] = NULL;
- }
- *iconPtrPtr = icons;
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconsToObjProc --
- *
- * Converts the icon into its string representation (its name).
- *
- * Results:
- * The name of the icon is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-IconsToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Icon *icons = *(Icon **)(widgRec + offset);
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (icons != NULL) {
- Icon *iconPtr;
-
- for (iconPtr = icons; *iconPtr != NULL; iconPtr++) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(Blt_Image_Name((*iconPtr)->tkImage), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-
- }
- }
- return listObjPtr;
-}
-
-/*ARGSUSED*/
-static void
-FreeIconsProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Icon **iconsPtr = (Icon **)(widgRec + offset);
-
- if (*iconsPtr != NULL) {
- Icon *ip;
- ComboTree *comboPtr = clientData;
-
- for (ip = *iconsPtr; *ip != NULL; ip++) {
- FreeIcon(comboPtr, *ip);
- }
- Blt_Free(*iconsPtr);
- *iconsPtr = NULL;
- }
-}
-
-static int
-Apply(
- ComboTree *comboPtr,
- Entry *entryPtr, /* Root entry of subtree. */
- ApplyProc *proc, /* Procedure to call for each entry. */
- unsigned int flags)
-{
- if ((flags & ENTRY_HIDE) && (EntryIsHidden(entryPtr))) {
- return TCL_OK; /* Hidden node. */
- }
- if ((flags & ENTRY_HIDE) && (entryPtr->flags & ENTRY_HIDE)) {
- return TCL_OK; /* Hidden node. */
- }
- if (((flags & ENTRY_CLOSED) == 0) ||
- ((entryPtr->flags & ENTRY_CLOSED) == 0)) {
- Entry *childPtr;
- Blt_TreeNode node, next;
-
- for (node = Blt_Tree_FirstChild(entryPtr->node); node != NULL;
- node = next) {
- next = Blt_Tree_NextSibling(node);
- /*
- * Get the next child before calling Apply
- * recursively. This is because the apply callback may
- * delete the node and its link.
- */
- childPtr = NodeToEntry(comboPtr, node);
- if (Apply(comboPtr, childPtr, proc, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- if ((*proc) (comboPtr, entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-
-#ifdef notdef
-int
-EntryIsMapped(Entry *entryPtr)
-{
- ComboTree *comboPtr = entryPtr->comboPtr;
-
- /* Don't check if the entry itself is open, only that its
- * ancestors are. */
- if (EntryIsHidden(entryPtr)) {
- return FALSE;
- }
- if (entryPtr == comboPtr->rootPtr) {
- return TRUE;
- }
- entryPtr = ParentEntry(entryPtr);
- while (entryPtr != comboPtr->rootPtr) {
- if (entryPtr->flags & (ENTRY_CLOSED | ENTRY_HIDE)) {
- return FALSE;
- }
- entryPtr = ParentEntry(entryPtr);
- }
- return TRUE;
-}
-#endif
-
-
-static void
-ConfigureButtons(ComboTree *comboPtr)
-{
- Button *btnPtr = &comboPtr->button;
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
-
- gcMask = GCForeground;
- gcValues.foreground = btnPtr->fgColor->pixel;
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (btnPtr->normalGC != NULL) {
- Tk_FreeGC(comboPtr->display, btnPtr->normalGC);
- }
- btnPtr->normalGC = newGC;
-
- gcMask = GCForeground;
- gcValues.foreground = btnPtr->activeFgColor->pixel;
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (btnPtr->activeGC != NULL) {
- Tk_FreeGC(comboPtr->display, btnPtr->activeGC);
- }
- btnPtr->activeGC = newGC;
-
- btnPtr->width = btnPtr->height = ODD(btnPtr->reqSize);
- if (btnPtr->icons != NULL) {
- int i;
-
- for (i = 0; i < 2; i++) {
- int width, height;
-
- if (btnPtr->icons[i] == NULL) {
- break;
- }
- width = IconWidth(btnPtr->icons[i]);
- height = IconWidth(btnPtr->icons[i]);
- if (btnPtr->width < width) {
- btnPtr->width = width;
- }
- if (btnPtr->height < height) {
- btnPtr->height = height;
- }
- }
- }
- btnPtr->width += 2 * btnPtr->borderWidth;
- btnPtr->height += 2 * btnPtr->borderWidth;
-}
-
-static int
-ConfigureStyle(
- Tcl_Interp *interp,
- Style *stylePtr,
- int objc,
- Tcl_Obj *const *objv,
- int flags)
-{
- ComboTree *comboPtr = stylePtr->comboPtr;
- unsigned int gcMask;
- XGCValues gcValues;
- GC newGC;
-
- if (Blt_ConfigureWidgetFromObj(interp, comboPtr->tkwin, styleSpecs,
- objc, objv, (char *)stylePtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
-
- gcMask = GCForeground | GCFont | GCLineWidth;
- gcValues.font = Blt_FontId(stylePtr->labelFont);
- gcValues.line_width = comboPtr->lineWidth;
- if (comboPtr->dashes > 0) {
- gcMask |= (GCLineStyle | GCDashList);
- gcValues.line_style = LineOnOffDash;
- gcValues.dashes = comboPtr->dashes;
- }
-
- /* Normal label */
- gcValues.foreground = stylePtr->labelNormalColor->pixel;
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (stylePtr->labelNormalGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->labelNormalGC);
- }
- stylePtr->labelNormalGC = newGC;
-
- /* Active label */
- gcValues.foreground = stylePtr->labelActiveColor->pixel;
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (stylePtr->labelActiveGC != NULL) {
- Tk_FreeGC(comboPtr->display, stylePtr->labelActiveGC);
- }
- stylePtr->labelActiveGC = newGC;
-
- return TCL_OK;
-}
-
-
-/*ARGSUSED*/
-static int
-CreateApplyProc(
- Blt_TreeNode node, /* Node that has just been created. */
- ClientData clientData,
- int order) /* Not used. */
-{
- ComboTree *comboPtr = clientData;
- return CreateEntry(comboPtr, node, 0, NULL, 0);
-}
-
-static int
-TreeEventProc(ClientData clientData, Blt_TreeNotifyEvent *eventPtr)
-{
- Blt_TreeNode node;
- ComboTree *comboPtr = clientData;
-
- node = Blt_Tree_GetNode(eventPtr->tree, eventPtr->inode);
- switch (eventPtr->type) {
- case TREE_NOTIFY_CREATE:
- return CreateEntry(comboPtr, node, 0, NULL, 0);
- case TREE_NOTIFY_DELETE:
- /*
- * Deleting the tree node triggers a call back to free the
- * treeview entry that is associated with it.
- */
- if (node != NULL) {
- Entry *entryPtr;
-
- entryPtr = GetEntryFromNode(comboPtr, node);
- if (entryPtr != NULL) {
- FreeEntry(comboPtr, entryPtr);
- }
- }
- break;
- case TREE_NOTIFY_RELABEL:
- if (node != NULL) {
- Entry *entryPtr;
-
- entryPtr = NodeToEntry(comboPtr, node);
- entryPtr->flags |= ENTRY_DIRTY;
- }
- /*FALLTHRU*/
- case TREE_NOTIFY_MOVE:
- case TREE_NOTIFY_SORT:
- EventuallyRedraw(comboPtr);
- comboPtr->flags |= (LAYOUT_PENDING | DIRTY);
- break;
- default:
- /* empty */
- break;
- }
- return TCL_OK;
-}
-
-
-static ClientData
-EntryTag(ComboTree *comboPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
- int isNew; /* Not used. */
-
- hPtr = Blt_CreateHashEntry(&comboPtr->entryBindTagTable, string, &isNew);
- return Blt_GetHashKey(&comboPtr->entryBindTagTable, hPtr);
-}
-
-static ClientData
-ButtonTag(ComboTree *comboPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
- int isNew; /* Not used. */
-
- hPtr = Blt_CreateHashEntry(&comboPtr->buttonBindTagTable, string, &isNew);
- return Blt_GetHashKey(&comboPtr->buttonBindTagTable, hPtr);
-}
-
-static void
-AddIdsToList(ComboTree *comboPtr, Blt_List ids, Tcl_Obj *objPtr,
- TagProc *tagProc)
-{
- int objc;
- Tcl_Obj **objv;
-
- if (Tcl_ListObjGetElements(comboPtr->interp, objPtr, &objc, &objv)
- == TCL_OK) {
- int i;
-
- for (i = 0; i < objc; i++) {
- ClientData clientData;
-
- clientData = (*tagProc)(comboPtr, Tcl_GetString(objv[i]));
- Blt_List_Append(ids, clientData, 0);
- }
- }
-}
-
-static void
-GetTags(
- Blt_BindTable table,
- ClientData object, /* Object picked. */
- ClientData context, /* Context of object. */
- Blt_List ids) /* (out) List of binding ids to be
- * applied for this object. */
-{
- ComboTree *comboPtr;
-
- comboPtr = Blt_GetBindingData(table);
- if (context == (ClientData)PICK_BUTTON) {
- Entry *entryPtr = object;
-
- Blt_List_Append(ids, ButtonTag(comboPtr, "Button"), 0);
- if (entryPtr->tagsObjPtr != NULL) {
- AddIdsToList(comboPtr, ids, entryPtr->tagsObjPtr, ButtonTag);
- } else {
- Blt_List_Append(ids, ButtonTag(comboPtr, "Entry"), 0);
- Blt_List_Append(ids, ButtonTag(comboPtr, "all"), 0);
- }
- } else {
- Entry *entryPtr = object;
-
- Blt_List_Append(ids, (char *)entryPtr, 0);
- if (entryPtr->tagsObjPtr != NULL) {
- AddIdsToList(comboPtr, ids, entryPtr->tagsObjPtr, EntryTag);
- } else if (context == PICK_ENTRY){
- Blt_List_Append(ids, EntryTag(comboPtr, "Entry"), 0);
- Blt_List_Append(ids, EntryTag(comboPtr, "all"), 0);
- }
- }
-}
-
-/*ARGSUSED*/
-static ClientData
-PickEntry(
- ClientData clientData,
- int x, int y, /* Screen coordinates of the test point. */
- ClientData *contextPtr) /* (out) Context of entry selected: should
- * be PICK_ENTRY or PICK_BUTTON. */
-{
- ComboTree *comboPtr = clientData;
- Entry *entryPtr;
-
- if (contextPtr != NULL) {
- *contextPtr = NULL;
- }
- if (comboPtr->flags & DIRTY) {
- /* Can't trust the selected entry if nodes have been added or
- * deleted. So recompute the layout. */
- if (comboPtr->flags & LAYOUT_PENDING) {
- ComputeComboGeometry(comboPtr);
- }
- ComputeVisibleEntries(comboPtr);
- }
- if (comboPtr->nVisible == 0) {
- return NULL;
- }
- entryPtr = NearestEntry(comboPtr, x, y, FALSE);
- if (entryPtr == NULL) {
- return NULL;
- }
- x = WORLDX(comboPtr, x);
- y = WORLDY(comboPtr, y);
- if (contextPtr != NULL) {
- *contextPtr = PICK_ENTRY;
- if (entryPtr->flags & ENTRY_BUTTON) {
- Button *btnPtr = &comboPtr->button;
- int left, right, top, bottom;
-
- left = entryPtr->worldX + entryPtr->buttonX - BUTTON_PAD;
- right = left + btnPtr->width + 2 * BUTTON_PAD;
- top = entryPtr->worldY + entryPtr->buttonY - BUTTON_PAD;
- bottom = top + btnPtr->height + 2 * BUTTON_PAD;
- if ((x >= left) && (x < right) && (y >= top) && (y < bottom)) {
- *contextPtr = (ClientData)PICK_BUTTON;
- }
- }
- }
- return entryPtr;
-}
-
-
-/*
- * TreeView Procedures
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewComboTree --
- *
- *---------------------------------------------------------------------------
- */
-static ComboTree *
-NewComboTree(Tcl_Interp *interp, Tcl_Obj *objPtr)
-{
- Tk_Window tkwin;
- ComboTree *comboPtr;
- const char *name;
-
- name = Tcl_GetString(objPtr);
-#define TOP_LEVEL_SCREEN ""
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), name,
- TOP_LEVEL_SCREEN);
- if (tkwin == NULL) {
- return NULL;
- }
- Tk_SetClass(tkwin, "ComboTree");
-
- comboPtr = Blt_AssertCalloc(1, sizeof(ComboTree));
- comboPtr->tkwin = tkwin;
- comboPtr->display = Tk_Display(tkwin);
- comboPtr->interp = interp;
- comboPtr->flags = (HIDE_ROOT | DIRTY | LAYOUT_PENDING | REPOPULATE);
- comboPtr->leader = 0;
- comboPtr->dashes = 1;
- comboPtr->borderWidth = 1;
- comboPtr->relief = TK_RELIEF_SUNKEN;
- comboPtr->button.closeRelief = comboPtr->button.openRelief = TK_RELIEF_SOLID;
- comboPtr->reqWidth = 0;
- comboPtr->reqHeight = 0;
- comboPtr->xScrollUnits = comboPtr->yScrollUnits = 20;
- comboPtr->lineWidth = 1;
- comboPtr->button.borderWidth = 1;
- comboPtr->buttonFlags = ENTRY_BTN_AUTO;
- Blt_InitHashTableWithPool(&comboPtr->entryTable, BLT_ONE_WORD_KEYS);
- Blt_InitHashTable(&comboPtr->iconTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&comboPtr->uidTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&comboPtr->styleTable, BLT_STRING_KEYS);
- comboPtr->bindTable = Blt_CreateBindingTable(interp, tkwin, comboPtr,
- PickEntry, GetTags);
- Blt_InitHashTable(&comboPtr->entryBindTagTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&comboPtr->buttonBindTagTable, BLT_STRING_KEYS);
-
- comboPtr->entryPool = Blt_PoolCreate(BLT_FIXED_SIZE_ITEMS);
- Blt_SetWindowInstanceData(tkwin, comboPtr);
- comboPtr->cmdToken = Tcl_CreateObjCommand(interp,
- Tk_PathName(comboPtr->tkwin),
- ComboTreeInstCmdProc, comboPtr, ComboTreeInstCmdDeleteProc);
-
- /*
- * By default create a tree. The name will be the same as the widget
- * pathname.
- */
- comboPtr->tree = Blt_Tree_Open(interp, Tk_PathName(comboPtr->tkwin),
- TREE_CREATE);
- if (comboPtr->tree == NULL) {
- return NULL;
- }
- Tk_CreateEventHandler(comboPtr->tkwin, ExposureMask | StructureNotifyMask |
- FocusChangeMask, ComboTreeEventProc, comboPtr);
- if (AddDefaultStyle(interp, comboPtr) != TCL_OK) {
- return NULL;
- }
- return comboPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyComboTree --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of a TreeView at a safe time
- * (when no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyComboTree(DestroyData dataPtr) /* Pointer to the widget record. */
-{
- ComboTree *comboPtr = (ComboTree *)dataPtr;
- Button *btnPtr;
-
- if (comboPtr->tree != NULL) {
- Blt_Tree_Close(comboPtr->tree);
- }
- iconsOption.clientData = comboPtr;
- Blt_FreeOptions(comboSpecs, (char *)comboPtr, comboPtr->display, 0);
- Tcl_DeleteCommandFromToken(comboPtr->interp, comboPtr->cmdToken);
- if (comboPtr->tkwin != NULL) {
- Tk_DeleteSelHandler(comboPtr->tkwin, XA_PRIMARY, XA_STRING);
- }
- if (comboPtr->lineGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->lineGC);
- }
- if (comboPtr->visibleEntries != NULL) {
- Blt_Free(comboPtr->visibleEntries);
- }
- if (comboPtr->levelInfo != NULL) {
- Blt_Free(comboPtr->levelInfo);
- }
- btnPtr = &comboPtr->button;
- if (btnPtr->activeGC != NULL) {
- Tk_FreeGC(comboPtr->display, btnPtr->activeGC);
- }
- if (btnPtr->normalGC != NULL) {
- Tk_FreeGC(comboPtr->display, btnPtr->normalGC);
- }
- Blt_DestroyBindingTable(comboPtr->bindTable);
- Blt_DeleteHashTable(&comboPtr->entryBindTagTable);
- Blt_DeleteHashTable(&comboPtr->buttonBindTagTable);
-
- Blt_DeleteHashTable(&comboPtr->uidTable);
- Blt_DeleteHashTable(&comboPtr->entryTable);
-
- Blt_PoolDestroy(comboPtr->entryPool);
- DestroyIcons(comboPtr);
- DestroyStyles(comboPtr);
- Blt_Free(comboPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollbarEventProc --
- *
- * This procedure is invoked by the Tk event handler when StructureNotify
- * events occur in a scrollbar managed by the widget.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ScrollbarEventProc(
- ClientData clientData, /* Pointer to Entry structure for widget
- * referred to by eventPtr. */
- XEvent *eventPtr) /* Describes what just happened. */
-{
- ComboTree *comboPtr = clientData;
-
- if (eventPtr->type == ConfigureNotify) {
- EventuallyRedraw(comboPtr);
- } else if (eventPtr->type == DestroyNotify) {
- if (eventPtr->xany.window == Tk_WindowId(comboPtr->yScrollbar)) {
- comboPtr->yScrollbar = NULL;
- } else if (eventPtr->xany.window == Tk_WindowId(comboPtr->xScrollbar)) {
- comboPtr->xScrollbar = NULL;
- }
- comboPtr->flags |= LAYOUT_PENDING;;
- EventuallyRedraw(comboPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollbarCustodyProc --
- *
- * This procedure is invoked when a scrollbar has been stolen by another
- * geometry manager.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the combomenu to have its layout re-arranged at the next
- * idle point.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-ScrollbarCustodyProc(
- ClientData clientData, /* Information about the combomenu. */
- Tk_Window tkwin) /* Scrollbar stolen by another geometry
- * manager. */
-{
- ComboTree *comboPtr = (ComboTree *)clientData;
-
- if (tkwin == comboPtr->yScrollbar) {
- comboPtr->yScrollbar = NULL;
- comboPtr->yScrollbarWidth = 0;
- } else if (tkwin == comboPtr->xScrollbar) {
- comboPtr->xScrollbar = NULL;
- comboPtr->xScrollbarHeight = 0;
- } else {
- return;
- }
- Tk_UnmaintainGeometry(tkwin, comboPtr->tkwin);
- comboPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(comboPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollbarGeometryProc --
- *
- * This procedure is invoked by Tk_GeometryRequest for scrollbars managed
- * by the combomenu.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the combomenu to have its layout re-computed and
- * re-arranged at the next idle point.
- *
- * -------------------------------------------------------------------------- */
-/* ARGSUSED */
-static void
-ScrollbarGeometryProc(
- ClientData clientData, /* ComboTree widget record. */
- Tk_Window tkwin) /* Scrollbar whose geometry has changed. */
-{
- ComboTree *comboPtr = (ComboTree *)clientData;
-
- comboPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(comboPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboTreeEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various
- * events on treeview widgets.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComboTreeEventProc(ClientData clientData, XEvent *eventPtr)
-{
- ComboTree *comboPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(comboPtr);
- Blt_PickCurrentItem(comboPtr->bindTable);
- }
- } else if (eventPtr->type == ConfigureNotify) {
- comboPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(comboPtr);
- } else if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- if (eventPtr->type == FocusIn) {
- comboPtr->flags |= FOCUS;
- } else {
- comboPtr->flags &= ~FOCUS;
- }
- EventuallyRedraw(comboPtr);
- }
- } else if (eventPtr->type == DestroyNotify) {
- if (comboPtr->tkwin != NULL) {
- comboPtr->tkwin = NULL;
- }
- if (comboPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayComboTree, comboPtr);
- }
- Tcl_EventuallyFree(comboPtr, DestroyComboTree);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboTreeInstCmdDeleteProc --
- *
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComboTreeInstCmdDeleteProc(ClientData clientData)
-{
- ComboTree *comboPtr = clientData;
-
- /*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin
- * is NULL) or because the command was deleted, and then this
- * procedure destroys the widget.
- */
- if (comboPtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = comboPtr->tkwin;
- comboPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureComboTree --
- *
- * Updates the GCs and other information associated with the
- * treeview widget.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is
- * returned, then interp->result contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for comboPtr; old resources get freed, if there
- * were any. The widget is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureComboTree(Tcl_Interp *interp, ComboTree *comboPtr, int objc,
- Tcl_Obj *const *objv, int flags)
-{
- int updateNeeded;
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
-
- if (Blt_ConfigureWidgetFromObj(interp, comboPtr->tkwin, comboSpecs,
- objc, objv, (char *)comboPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- if (ConfigureStyle(interp, &comboPtr->defStyle, 0, NULL,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * GC for dotted vertical line.
- */
- gcMask = (GCForeground | GCLineWidth);
- gcValues.foreground = comboPtr->lineColor->pixel;
- gcValues.line_width = comboPtr->lineWidth;
- if (comboPtr->dashes > 0) {
- gcMask |= (GCLineStyle | GCDashList);
- gcValues.line_style = LineOnOffDash;
- gcValues.dashes = comboPtr->dashes;
- }
- newGC = Tk_GetGC(comboPtr->tkwin, gcMask, &gcValues);
- if (comboPtr->lineGC != NULL) {
- Tk_FreeGC(comboPtr->display, comboPtr->lineGC);
- }
- comboPtr->lineGC = newGC;
-
- ConfigureButtons(comboPtr);
- comboPtr->inset = comboPtr->borderWidth + INSET_PAD;
-
- /*
- * These options change the layout of the box. Mark the widget for update.
- */
- if (Blt_ConfigModified(comboSpecs, "-font", "-linespacing", "-*width",
- "-height", "-hide*", "-tree", (char *)NULL)) {
- comboPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- }
- /*
- * If the tree view was changed, mark all the nodes dirty (we'll be
- * switching back to either the full path name or the label) and free the
- * array representing the flattened view of the tree.
- */
- if (Blt_ConfigModified(comboSpecs, "-hideleaves", (char *)NULL)) {
- Entry *ep;
-
- comboPtr->flags |= DIRTY;
- /* Mark all entries dirty. */
- for (ep = comboPtr->rootPtr; ep != NULL; ep = NextEntry(ep, 0)) {
- ep->flags |= ENTRY_DIRTY;
- }
- }
- if ((comboPtr->reqHeight != Tk_ReqHeight(comboPtr->tkwin)) ||
- (comboPtr->reqWidth != Tk_ReqWidth(comboPtr->tkwin))) {
- Tk_GeometryRequest(comboPtr->tkwin, comboPtr->reqWidth,
- comboPtr->reqHeight);
- }
- if (Blt_ConfigModified(comboSpecs, "-tree", (char *)NULL)) {
- DestroyEntries(comboPtr);
- Blt_InitHashTableWithPool(&comboPtr->entryTable, BLT_ONE_WORD_KEYS);
- if (Blt_Tree_Attach(interp, comboPtr->tree, comboPtr->treeName)
- != TCL_OK) {
- return TCL_ERROR;
- }
- comboPtr->flags |= REPOPULATE;
- }
- /* If the tree object was changed, we need to setup the new one. */
- if (comboPtr->flags & REPOPULATE) {
- Blt_TreeNode root;
-
- Blt_Tree_CreateEventHandler(comboPtr->tree, TREE_NOTIFY_ALL,
- TreeEventProc, comboPtr);
- root = Blt_Tree_RootNode(comboPtr->tree);
- /* Automatically add view-entry values to the new tree. */
- Blt_Tree_Apply(root, CreateApplyProc, comboPtr);
- comboPtr->rootPtr = NodeToEntry(comboPtr, root);
- /* Automatically open the root node. */
- if (OpenEntry(comboPtr, comboPtr->rootPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (comboPtr->flags & NEW_TAGS) {
- Blt_Tree_NewTagTable(comboPtr->tree);
- }
- comboPtr->flags &= ~REPOPULATE;
- }
-
- updateNeeded = FALSE;
- /* Install the embedded scrollbars as needed. We defer installing the
- * scrollbars so the scrollbar widgets don't have to exist when they are
- * specified by the -xscrollbar and -yscrollbar options respectively. The
- * down-side is that errors found in the scrollbar name will be
- * backgrounded. */
- if (Blt_ConfigModified(comboSpecs, "-xscrollbar", (char *)NULL)) {
- if (comboPtr->xScrollbar != NULL) {
- UnmanageScrollbar(comboPtr, comboPtr->xScrollbar);
- comboPtr->xScrollbar = NULL;
- }
- if ((comboPtr->flags & INSTALL_SCROLLBAR_X) == 0) {
- Tcl_DoWhenIdle(InstallXScrollbar, comboPtr);
- comboPtr->flags |= INSTALL_SCROLLBAR_X;
- }
- updateNeeded = TRUE;
- }
- if (Blt_ConfigModified(comboSpecs, "-yscrollbar", (char *)NULL)) {
- if (comboPtr->yScrollbar != NULL) {
- UnmanageScrollbar(comboPtr, comboPtr->yScrollbar);
- comboPtr->yScrollbar = NULL;
- }
- if ((comboPtr->flags & INSTALL_SCROLLBAR_Y) == 0) {
- Tcl_DoWhenIdle(InstallYScrollbar, comboPtr);
- comboPtr->flags |= INSTALL_SCROLLBAR_Y;
- }
- updateNeeded = TRUE;
- }
- if (updateNeeded) {
- if ((comboPtr->flags & UPDATE_PENDING) == 0) {
- Tcl_DoWhenIdle(ConfigureScrollbarsProc, comboPtr);
- comboPtr->flags |= UPDATE_PENDING;
- }
- }
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-
-
-#ifdef notdef
-static void
-PrintFlags(ComboTree *comboPtr, char *string)
-{
- fprintf(stderr, "%s: flags=", string);
- if (comboPtr->flags & LAYOUT_PENDING) {
- fprintf(stderr, "layout ");
- }
- if (comboPtr->flags & REDRAW_PENDING) {
- fprintf(stderr, "redraw ");
- }
- if (comboPtr->flags & SCROLLX) {
- fprintf(stderr, "xscroll ");
- }
- if (comboPtr->flags & SCROLLY) {
- fprintf(stderr, "yscroll ");
- }
- if (comboPtr->flags & FOCUS) {
- fprintf(stderr, "focus ");
- }
- if (comboPtr->flags & DIRTY) {
- fprintf(stderr, "dirty ");
- }
- if (comboPtr->flags & REDRAW_BORDERS) {
- fprintf(stderr, "borders ");
- }
- if (comboPtr->flags & VIEWPORT) {
- fprintf(stderr, "viewport ");
- }
- fprintf(stderr, "\n");
-}
-#endif
-
-static void
-FixMenuCoords(ComboTree *comboPtr, int *xPtr, int *yPtr)
-{
- int x, y, w, h;
- int screenWidth, screenHeight;
- Tk_Window parent;
-
- parent = Tk_Parent(comboPtr->tkwin);
- Blt_SizeOfScreen(comboPtr->tkwin, &screenWidth, &screenHeight);
- x = *xPtr, y = *yPtr;
-
- /* Determine the size of the menu. */
- w = Tk_Width(comboPtr->tkwin);
- if (w <= 1) {
- w = Tk_ReqWidth(comboPtr->tkwin);
- }
- h = Tk_Height(comboPtr->tkwin);
- if (h <= 1) {
- h = Tk_Height(comboPtr->tkwin);
- }
- if ((y + h) > screenHeight) {
- y -= (Tk_Height(parent) + h); /* Flip to show menu above. */
- if (y < 0) {
- y = 0;
- }
- }
- if ((x + w) > screenWidth) {
- x -= (Tk_Width(parent)); /* Flip to show menu on left side. */
- if (x < 0) {
- x = 0;
- }
- }
- *xPtr = x;
- *yPtr = y;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeVisibleEntries --
- *
- * The entries visible in the viewport (the widget's window) are
- * inserted into the array of visible nodes.
- *
- * Results:
- * Returns 1 if beyond the last visible entry, 0 otherwise.
- *
- * Side effects:
- * The array of visible nodes is filled.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ComputeVisibleEntries(ComboTree *comboPtr)
-{
- int nSlots;
- int maxX, maxY;
- int xOffset, yOffset;
- Entry *entryPtr;
-
- xOffset = Blt_AdjustViewport(comboPtr->xOffset, comboPtr->worldWidth,
- VPORTWIDTH(comboPtr), comboPtr->xScrollUnits, BLT_SCROLL_MODE_HIERBOX);
- yOffset = Blt_AdjustViewport(comboPtr->yOffset, comboPtr->worldHeight,
- VPORTHEIGHT(comboPtr), comboPtr->yScrollUnits, BLT_SCROLL_MODE_HIERBOX);
-
- if ((xOffset != comboPtr->xOffset) || (yOffset != comboPtr->yOffset)) {
- comboPtr->yOffset = yOffset;
- comboPtr->xOffset = xOffset;
- comboPtr->flags |= VIEWPORT;
- }
- /* Allocate worst case number of slots for entry array. */
- nSlots = (VPORTHEIGHT(comboPtr) / comboPtr->minHeight) + 3;
- if (nSlots != comboPtr->nVisible) {
- if (comboPtr->visibleEntries != NULL) {
- Blt_Free(comboPtr->visibleEntries);
- }
- comboPtr->visibleEntries = Blt_AssertCalloc(nSlots, sizeof(Entry *));
- }
- comboPtr->nVisible = 0;
- comboPtr->visibleEntries[0] = NULL;
-
- if (comboPtr->rootPtr->flags & ENTRY_HIDE) {
- return TCL_OK; /* Root node is hidden. */
- }
-
- /* Find the first node in the viewport. */
- entryPtr = comboPtr->rootPtr;
- while ((entryPtr->worldY + entryPtr->height) <= comboPtr->yOffset) {
- for (entryPtr = LastChild(entryPtr, ENTRY_HIDE); entryPtr != NULL;
- entryPtr = PrevSibling(entryPtr, ENTRY_HIDE)) {
- if (entryPtr->worldY <= comboPtr->yOffset) {
- break;
- }
- }
- /*
- * If we can't find the starting node, then the view must be
- * scrolled down, but some nodes were deleted. Reset the view
- * back to the top and try again.
- */
- if (entryPtr == NULL) {
- if (comboPtr->yOffset == 0) {
- return TCL_OK; /* All entries are hidden. */
- }
- comboPtr->yOffset = 0;
- continue;
- }
- }
-
- maxY = comboPtr->yOffset + VPORTHEIGHT(comboPtr);
- maxX = 0;
- while (entryPtr != NULL) {
- int x;
- int level;
-
- /*
- * Compute and save the entry's X-coordinate now that we know
- * the maximum level offset for the entire widget.
- */
- level = Blt_Tree_NodeDepth(entryPtr->node);
- entryPtr->worldX = LEVELX(level);
- x = entryPtr->worldX + ICONWIDTH(level) + ICONWIDTH(level+1) +
- entryPtr->width;
- if (x > maxX) {
- maxX = x;
- }
- if (entryPtr->worldY >= maxY) {
- break; /* Entry starts after viewport. */
- }
- comboPtr->visibleEntries[comboPtr->nVisible] = entryPtr;
- comboPtr->nVisible++;
- entryPtr = NextEntry(entryPtr, ENTRY_MASK);
- }
- comboPtr->visibleEntries[comboPtr->nVisible] = NULL;
-
- /*
- *-------------------------------------------------------------------------------
- *
- * Note: It's assumed that the view port always starts at or over an
- * entry. Check that a change in the hierarchy (e.g. closing a
- * node) hasn't left the viewport beyond the last entry. If so,
- * adjust the viewport to start on the last entry.
- *
- *-------------------------------------------------------------------------------
- */
- if (comboPtr->xOffset > (comboPtr->worldWidth - comboPtr->xScrollUnits)) {
- comboPtr->xOffset = comboPtr->worldWidth - comboPtr->xScrollUnits;
- }
- if (comboPtr->yOffset > (comboPtr->worldHeight - comboPtr->yScrollUnits)) {
- comboPtr->yOffset = comboPtr->worldHeight - comboPtr->yScrollUnits;
- }
- comboPtr->xOffset = Blt_AdjustViewport(comboPtr->xOffset,
- comboPtr->worldWidth, VPORTWIDTH(comboPtr), comboPtr->xScrollUnits,
- BLT_SCROLL_MODE_HIERBOX);
- comboPtr->yOffset = Blt_AdjustViewport(comboPtr->yOffset,
- comboPtr->worldHeight, VPORTHEIGHT(comboPtr), comboPtr->yScrollUnits,
- BLT_SCROLL_MODE_HIERBOX);
-
- comboPtr->flags &= ~DIRTY;
- Blt_PickCurrentItem(comboPtr->bindTable);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetEntryIcon --
- *
- * Selects the correct image for the entry's icon depending upon
- * the current state of the entry: active/inactive normal/selected.
- *
- * active - normal
- * active - selected
- * inactive - normal
- * inactive - selected
- *
- * Results:
- * Returns the image for the icon.
- *
- *---------------------------------------------------------------------------
- */
-static Icon
-GetEntryIcon(ComboTree *comboPtr, Entry *entryPtr)
-{
- Icon *icons;
- Icon icon;
-
- icons = entryPtr->stylePtr->icons;
- icon = NULL;
- if (icons != NULL) {
- icon = icons[0]; /* Open icon. */
- if ((entryPtr->flags & ENTRY_CLOSED) && (icons[1] != NULL)) {
- icon = icons[1]; /* Closed icon. */
- }
- }
- return icon;
-}
-/*
- *---------------------------------------------------------------------------
- *
- * DrawButton --
- *
- * Draws a button for the given entry. The button is drawn
- * centered in the region immediately to the left of the origin
- * of the entry (computed in the layout routines). The height
- * and width of the button were previously calculated from the
- * average row height.
- *
- * button height = entry height - (2 * some arbitrary padding).
- * button width = button height.
- *
- * The button may have a border. The symbol (either a plus or
- * minus) is slight smaller than the width or height minus the
- * border.
- *
- * x,y origin of entry
- *
- * +---+
- * | + | icon label
- * +---+
- * closed
- *
- * |----|----| horizontal offset
- *
- * +---+
- * | - | icon label
- * +---+
- * open
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A button is drawn for the entry.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawButton(
- ComboTree *comboPtr, /* Widget record containing the
- * attribute information for
- * buttons. */
- Entry *entryPtr, /* Entry. */
- Drawable drawable, /* Pixmap or window to draw into. */
- int x,
- int y)
-{
- Blt_Background bg;
- Button *btnPtr = &comboPtr->button;
- Icon icon;
- int relief;
- int width, height;
-
- bg = (entryPtr == comboPtr->activeBtnPtr)
- ? btnPtr->activeBg : btnPtr->normalBg;
- relief = (entryPtr->flags & ENTRY_CLOSED)
- ? btnPtr->closeRelief : btnPtr->openRelief;
- if (relief == TK_RELIEF_SOLID) {
- relief = TK_RELIEF_FLAT;
- }
- Blt_FillBackgroundRectangle(comboPtr->tkwin, drawable, bg, x, y,
- btnPtr->width, btnPtr->height, btnPtr->borderWidth, relief);
-
- x += btnPtr->borderWidth;
- y += btnPtr->borderWidth;
- width = btnPtr->width - (2 * btnPtr->borderWidth);
- height = btnPtr->height - (2 * btnPtr->borderWidth);
-
- icon = NULL;
- if (btnPtr->icons != NULL) { /* Open or close button icon? */
- icon = btnPtr->icons[0];
- if (((entryPtr->flags & ENTRY_CLOSED) == 0) &&
- (btnPtr->icons[1] != NULL)) {
- icon = btnPtr->icons[1];
- }
- }
- if (icon != NULL) { /* Icon or rectangle? */
- Tk_RedrawImage(IconImage(icon), 0, 0, width, height, drawable, x, y);
- } else {
- int top, bottom, left, right;
- XSegment segments[6];
- int count;
- GC gc;
-
- gc = (entryPtr == comboPtr->activeBtnPtr)
- ? btnPtr->activeGC : btnPtr->normalGC;
- if (relief == TK_RELIEF_FLAT) {
- /* Draw the box outline */
-
- left = x - btnPtr->borderWidth;
- top = y - btnPtr->borderWidth;
- right = left + btnPtr->width - 1;
- bottom = top + btnPtr->height - 1;
-
- segments[0].x1 = left;
- segments[0].x2 = right;
- segments[0].y2 = segments[0].y1 = top;
- segments[1].x2 = segments[1].x1 = right;
- segments[1].y1 = top;
- segments[1].y2 = bottom;
- segments[2].x2 = segments[2].x1 = left;
- segments[2].y1 = top;
- segments[2].y2 = bottom;
-#ifdef WIN32
- segments[2].y2++;
-#endif
- segments[3].x1 = left;
- segments[3].x2 = right;
- segments[3].y2 = segments[3].y1 = bottom;
-#ifdef WIN32
- segments[3].x2++;
-#endif
- }
- top = y + height / 2;
- left = x + BUTTON_IPAD;
- right = x + width - BUTTON_IPAD;
-
- segments[4].y1 = segments[4].y2 = top;
- segments[4].x1 = left;
- segments[4].x2 = right - 1;
-#ifdef WIN32
- segments[4].x2++;
-#endif
-
- count = 5;
- if (entryPtr->flags & ENTRY_CLOSED) { /* Draw the vertical
- * line for the plus. */
- top = y + BUTTON_IPAD;
- bottom = y + height - BUTTON_IPAD;
- segments[5].y1 = top;
- segments[5].y2 = bottom - 1;
- segments[5].x1 = segments[5].x2 = x + width / 2;
-#ifdef WIN32
- segments[5].y2++;
-#endif
- count = 6;
- }
- XDrawSegments(comboPtr->display, drawable, gc, segments, count);
- }
-}
-
-static int
-DrawComboIcon(ComboTree *comboPtr, Entry *entryPtr, Drawable drawable, int x,
- int y)
-{
- Icon icon;
-
- icon = GetEntryIcon(comboPtr, entryPtr);
- if (icon != NULL) { /* Icon or default icon bitmap? */
- int entryHeight;
- int level;
- int maxY;
- int top, bottom;
- int topInset, botInset;
- int width, height;
-
- level = Blt_Tree_NodeDepth(entryPtr->node);
- entryHeight = MAX3(entryPtr->lineHeight, entryPtr->iconHeight,
- comboPtr->button.height);
- height = IconHeight(icon);
- width = IconWidth(icon);
- if (comboPtr->flatView) {
- x += (ICONWIDTH(0) - width) / 2;
- } else {
- x += (ICONWIDTH(level + 1) - width) / 2;
- }
- y += (entryHeight - height) / 2;
- botInset = comboPtr->inset - INSET_PAD;
- topInset = comboPtr->inset;
- maxY = Tk_Height(comboPtr->tkwin) - botInset;
- top = 0;
- bottom = y + height;
- if (y < topInset) {
- height += y - topInset;
- top = -y + topInset;
- y = topInset;
- } else if (bottom >= maxY) {
- height = maxY - y;
- }
- Tk_RedrawImage(IconImage(icon), 0, top, width, height, drawable, x, y);
- }
- return (icon != NULL);
-}
-
-static int
-DrawLabel(ComboTree *comboPtr, Entry *entryPtr, Drawable drawable, int x, int y,
- int maxLength)
-{
- const char *label;
- int entryHeight;
- int width, height; /* Width and height of label. */
-
- entryHeight = MAX3(entryPtr->lineHeight, entryPtr->iconHeight,
- comboPtr->button.height);
-
- /* Includes padding, selection 3-D border, and focus outline. */
- width = entryPtr->labelWidth;
- height = entryPtr->labelHeight;
-
- /* Center the label, if necessary, vertically along the entry row. */
- if (height < entryHeight) {
- y += (entryHeight - height) / 2;
- }
- x += LABEL_PADX;
- y += LABEL_PADY;
-
- label = GETLABEL(entryPtr);
- if (label[0] != '\0') {
- Style *stylePtr;
- TextStyle ts;
- XColor *color;
-
- stylePtr = entryPtr->stylePtr;
- if (entryPtr == comboPtr->activePtr) {
- color = stylePtr->labelActiveColor;
- } else {
- color = stylePtr->labelNormalColor;
- }
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, stylePtr->labelFont);
- Blt_Ts_SetForeground(ts, color);
- Blt_Ts_SetMaxLength(ts, maxLength);
- Blt_Ts_DrawLayout(comboPtr->tkwin, drawable, entryPtr->textPtr, &ts,
- x, y);
- if (entryPtr == comboPtr->activePtr) {
- Blt_Ts_UnderlineLayout(comboPtr->tkwin, drawable, entryPtr->textPtr,
- &ts, x, y);
- }
- }
- return entryHeight;
-}
-
-static void
-DrawEntryBackground(
- ComboTree *comboPtr,
- Entry *entryPtr,
- Drawable drawable,
- int x, int y, int w, int h)
-{
- Blt_Background bg;
- Style *stylePtr;
- int relief;
-
- stylePtr = entryPtr->stylePtr;
- if (entryPtr == comboPtr->activePtr) {
- bg = stylePtr->activeBg;
- relief = stylePtr->activeRelief;
- } else if ((stylePtr->altBg != NULL) && (entryPtr->seqNum & 0x1)) {
- bg = stylePtr->altBg;
- relief = stylePtr->relief;
- } else {
- bg = stylePtr->normalBg;
- relief = stylePtr->relief;
- }
- /* This also fills the background where there are no entries. */
- Blt_FillBackgroundRectangle(comboPtr->tkwin, drawable, bg, x, y, w, h,
- stylePtr->borderWidth, relief);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawEntry --
- *
- * Draws a button for the given entry. Note that buttons should only be
- * drawn if the entry has sub-entries to be opened or closed. It's the
- * responsibility of the calling routine to ensure this.
- *
- * The button is drawn centered in the region immediately to the left of
- * the origin of the entry (computed in the layout routines). The height
- * and width of the button were previously calculated from the average
- * row height.
- *
- * button height = entry height - (2 * some arbitrary padding).
- * button width = button height.
- *
- * The button has a border. The symbol (either a plus or minus) is
- * slight smaller than the width or height minus the border.
- *
- * x,y origin of entry
- *
- * +---+
- * | + | icon label
- * +---+
- * closed
- *
- * |----|----| horizontal offset
- *
- * +---+
- * | - | icon label
- * +---+
- * open
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A button is drawn for the entry.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawEntry(ComboTree *comboPtr, Entry *entryPtr, Drawable drawable,
- int x, int y, int w, int h)
-{
- Button *btnPtr = &comboPtr->button;
- int buttonY;
- int level;
- int xMax;
- int x1, y1, x2, y2;
- GC gc;
-
- entryPtr->flags &= ~ENTRY_REDRAW;
-
- if ((comboPtr->activePtr == entryPtr) && (y == 0)) {
- gc = comboPtr->defStyle.labelActiveGC;
- } else {
- gc = comboPtr->lineGC;
- }
- level = Blt_Tree_NodeDepth(entryPtr->node);
- w = ICONWIDTH(level);
- h = MAX3(entryPtr->lineHeight, entryPtr->iconHeight, btnPtr->height);
-
- entryPtr->buttonX = (w - btnPtr->width) / 2;
- entryPtr->buttonY = (h - btnPtr->height) / 2;
-
- buttonY = y + entryPtr->buttonY;
-
- x1 = x + (w / 2);
- y1 = y2 = buttonY + (btnPtr->height / 2);
- x2 = x1 + (ICONWIDTH(level) + ICONWIDTH(level + 1)) / 2;
-
- if ((Blt_Tree_ParentNode(entryPtr->node) != NULL) &&
- (comboPtr->lineWidth > 0)) {
- /*
- * For every node except root, draw a horizontal line from the
- * vertical bar to the middle of the icon.
- */
- XDrawLine(comboPtr->display, drawable, gc, x1, y1, x2, y2);
- }
- if (((entryPtr->flags & ENTRY_CLOSED) == 0) && (comboPtr->lineWidth > 0) &&
- (entryPtr->vertLineLength > 0)) {
- /*
- * Entry is open, draw vertical line.
- */
- y2 = y1 + entryPtr->vertLineLength;
- if (y2 > Tk_Height(comboPtr->tkwin)) {
- y2 = Tk_Height(comboPtr->tkwin); /* Clip line at window border. */
- }
- XDrawLine(comboPtr->display, drawable, gc, x2, y1, x2, y2);
- }
- if ((entryPtr->flags & ENTRY_BUTTON) && (entryPtr != comboPtr->rootPtr)) {
- /*
- * Except for the root, draw a button for every entry that needs one.
- * The displayed button can be either an icon (Tk image) or a line
- * drawing (rectangle with plus or minus sign).
- */
- DrawButton(comboPtr, entryPtr, drawable, x + entryPtr->buttonX,
- y + entryPtr->buttonY);
- }
- x += ICONWIDTH(level);
-
- if (!DrawComboIcon(comboPtr, entryPtr, drawable, x, y)) {
- x -= (ICON_WIDTH * 2) / 3;
- }
- x += ICONWIDTH(level + 1) + 4;
-
- /* Entry label. */
- xMax = comboPtr->worldWidth;
- DrawLabel(comboPtr, entryPtr, drawable, x, y, xMax - x);
-}
-
-static void
-DrawEntryBackgrounds(ComboTree *comboPtr, Drawable drawable)
-{
- int x;
- int width;
- Entry **entryPtrPtr;
-
- width = Tk_Width(comboPtr->tkwin);
- x = comboPtr->inset;
-
- /* This also fills the background where there are no entries. */
- Blt_FillBackgroundRectangle(comboPtr->tkwin, drawable,
- comboPtr->defStyle.normalBg, x, 0, width, Tk_Height(comboPtr->tkwin),
- 0, TK_RELIEF_FLAT);
-
- for (entryPtrPtr = comboPtr->visibleEntries; *entryPtrPtr != NULL;
- entryPtrPtr++) {
- Blt_Background bg;
- Style *stylePtr;
- Entry *entryPtr;
- int relief;
- int y;
-
- entryPtr = *entryPtrPtr;
- stylePtr = entryPtr->stylePtr;
- if (entryPtr == comboPtr->activePtr) {
- bg = stylePtr->activeBg;
- relief = stylePtr->activeRelief;
- } else if ((stylePtr->altBg != NULL) && (entryPtr->seqNum & 0x1)) {
- bg = stylePtr->altBg;
- relief = stylePtr->relief;
- } else {
- bg = stylePtr->normalBg;
- relief = stylePtr->relief;
- }
- y = SCREENY(comboPtr, entryPtr->worldY) - 1;
- Blt_FillBackgroundRectangle(comboPtr->tkwin, drawable, bg, x, y, width,
- entryPtr->height + 1, stylePtr->borderWidth, relief);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawVerticals --
- *
- * Draws vertical lines for the ancestor nodes. While the entry
- * of the ancestor may not be visible, its vertical line segment
- * does extent into the viewport. So walk back up the hierarchy
- * drawing lines until we get to the root.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Vertical lines are drawn for the ancestor nodes.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawVerticals(ComboTree *comboPtr, Entry *entryPtr, Drawable drawable,
- int xOffset, int yOffset)
-{
- GC gc;
-
- if ((comboPtr->activePtr == entryPtr) && (yOffset > 0)) {
- gc = comboPtr->defStyle.labelActiveGC;
- } else {
- gc = comboPtr->lineGC;
- }
- while (entryPtr != comboPtr->rootPtr) {
- entryPtr = ParentEntry(entryPtr);
- if (entryPtr == NULL) {
- break;
- }
- if (entryPtr->vertLineLength > 0) {
- int level;
- int ax, ay, bx, by;
- int x, y;
- int height;
-
- /*
- * World X-coordinates aren't computed for entries that are
- * outside the view port. So for each off-screen ancestor node
- * compute it here too.
- */
- level = Blt_Tree_NodeDepth(entryPtr->node);
- entryPtr->worldX = LEVELX(level);
- x = SCREENX(comboPtr, entryPtr->worldX) - xOffset;
- y = SCREENY(comboPtr, entryPtr->worldY) - yOffset;
- height = MAX3(entryPtr->lineHeight, entryPtr->iconHeight,
- comboPtr->button.height);
- y += (height - comboPtr->button.height) / 2;
- ax = bx = x + ICONWIDTH(level) + ICONWIDTH(level + 1) / 2;
- ay = y + comboPtr->button.height / 2;
- by = ay + entryPtr->vertLineLength;
- if ((entryPtr == comboPtr->rootPtr) &&
- (comboPtr->flags & HIDE_ROOT)) {
- ay += entryPtr->height;
- }
- /*
- * Clip the line's Y-coordinates at the viewport's borders.
- */
- if (ay < 0) {
- ay = (ay & 0x1); /* Make sure the dotted line starts on
- * the same even/odd pixel. */
- }
- if (by > Tk_Height(comboPtr->tkwin)) {
- by = Tk_Height(comboPtr->tkwin);
- }
- if ((ay < Tk_Height(comboPtr->tkwin)) && (by > 0)) {
- XDrawLine(comboPtr->display, drawable, gc,
- ax, ay, bx, by);
- }
- }
- }
-}
-
-static void
-DrawComboTree(ComboTree *comboPtr, Drawable drawable)
-{
- Entry **entryPtrPtr;
-
- DrawEntryBackgrounds(comboPtr, drawable);
-
- if ((comboPtr->lineWidth > 0) && (comboPtr->nVisible > 0)) {
- /* Draw all the vertical lines from topmost node. */
- DrawVerticals(comboPtr, comboPtr->visibleEntries[0], drawable, 0, 0);
- }
- for (entryPtrPtr = comboPtr->visibleEntries; *entryPtrPtr != NULL;
- entryPtrPtr++) {
- int x, y, w, h;
- Entry *entryPtr;
-
- entryPtr = *entryPtrPtr;
- x = SCREENX(comboPtr, entryPtr->worldX);
- y = SCREENY(comboPtr, entryPtr->worldY);
- w = ICONWIDTH(Blt_Tree_NodeDepth(entryPtr->node));
- h = MAX3(entryPtr->lineHeight, entryPtr->iconHeight,
- comboPtr->button.height);
- DrawEntry(comboPtr, entryPtr, drawable, x, y, w, h);
- }
-
- /* Manage the geometry of the embedded scrollbars. */
-
- if (comboPtr->yScrollbarWidth > 0) {
- int x, y;
- int yScrollbarHeight;
-
- x = Tk_Width(comboPtr->tkwin) - comboPtr->borderWidth -
- comboPtr->yScrollbarWidth;
- y = comboPtr->borderWidth;
- yScrollbarHeight = Tk_Height(comboPtr->tkwin) -
- comboPtr->xScrollbarHeight - 2 * comboPtr->borderWidth;
- if ((Tk_Width(comboPtr->yScrollbar) != comboPtr->yScrollbarWidth) ||
- (Tk_Height(comboPtr->yScrollbar) != yScrollbarHeight) ||
- (x != Tk_X(comboPtr->yScrollbar)) ||
- (y != Tk_Y(comboPtr->yScrollbar))) {
- Tk_MoveResizeWindow(comboPtr->yScrollbar, x, y,
- comboPtr->yScrollbarWidth, yScrollbarHeight);
- }
- if (!Tk_IsMapped(comboPtr->yScrollbar)) {
- Tk_MapWindow(comboPtr->yScrollbar);
- }
- } else if ((comboPtr->yScrollbar != NULL) &&
- (Tk_IsMapped(comboPtr->yScrollbar))) {
- Tk_UnmapWindow(comboPtr->yScrollbar);
- }
- if (comboPtr->xScrollbarHeight > 0) {
- int x, y;
- int xScrollbarWidth;
-
- x = comboPtr->borderWidth;
- y = Tk_Height(comboPtr->tkwin) - comboPtr->xScrollbarHeight -
- comboPtr->borderWidth;
- xScrollbarWidth = Tk_Width(comboPtr->tkwin) -
- comboPtr->yScrollbarWidth - 2 * comboPtr->borderWidth;
- if ((Tk_Width(comboPtr->xScrollbar) != xScrollbarWidth) ||
- (Tk_Height(comboPtr->xScrollbar) != comboPtr->xScrollbarHeight) ||
- (x != Tk_X(comboPtr->xScrollbar)) ||
- (y != Tk_Y(comboPtr->xScrollbar))) {
- Tk_MoveResizeWindow(comboPtr->xScrollbar, x, y, xScrollbarWidth,
- comboPtr->xScrollbarHeight);
- }
- if (!Tk_IsMapped(comboPtr->xScrollbar)) {
- Tk_MapWindow(comboPtr->xScrollbar);
- }
- } else if ((comboPtr->xScrollbar != NULL) &&
- (Tk_IsMapped(comboPtr->xScrollbar))) {
- Tk_UnmapWindow(comboPtr->xScrollbar);
- }
-}
-
-static void
-DrawOuterBorders(ComboTree *comboPtr, Drawable drawable)
-{
- /* Draw 3D border just inside of the focus highlight ring. */
- if ((comboPtr->borderWidth > 0) && (comboPtr->relief != TK_RELIEF_FLAT)) {
- Blt_DrawBackgroundRectangle(comboPtr->tkwin, drawable,
- comboPtr->defStyle.normalBg, 0, 0, Tk_Width(comboPtr->tkwin),
- Tk_Height(comboPtr->tkwin), comboPtr->borderWidth, comboPtr->relief);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayEntry --
- *
- * This procedure is invoked to display an entry in the combotree widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the entry.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayEntry(ClientData clientData)
-{
- Entry *entryPtr = clientData;
- ComboTree *comboPtr;
- Pixmap drawable;
- int x, y, w, h, d, sy;
-
-#ifdef notdef
- fprintf(stderr, "DisplayEntry (%s)\n", GETLABEL(entryPtr));
-#endif
- comboPtr = entryPtr->comboPtr;
-
- /* Create a pixmap the size of the window for double buffering. */
- comboPtr = entryPtr->comboPtr;
- w = VPORTWIDTH(comboPtr);
- h = entryPtr->height;
- drawable = Tk_GetPixmap(comboPtr->display, Tk_WindowId(comboPtr->tkwin),
- w, h, Tk_Depth(comboPtr->tkwin));
-#ifdef WIN32
- assert(drawable != None);
-#endif
- x = PIXMAPX(comboPtr, entryPtr->worldX);
- y = PIXMAPY(comboPtr, entryPtr->worldY) + comboPtr->borderWidth;
- DrawEntryBackground(comboPtr, entryPtr, drawable, 0, 0, w, h);
- if ((comboPtr->lineWidth > 0) && (comboPtr->nVisible > 0)) {
- /* Draw all the vertical lines from topmost node. */
- DrawVerticals(comboPtr, entryPtr, drawable,
- comboPtr->borderWidth,
- SCREENY(comboPtr, entryPtr->worldY));
- }
- DrawEntry(comboPtr, entryPtr, drawable, x, 0, w, h);
- sy = 0;
- d = comboPtr->borderWidth - y;
- if (d > 0) {
- h -= d;
- sy = d;
- y += d;
- }
- d = (y + h) - (Tk_Height(comboPtr->tkwin) - comboPtr->borderWidth);
- if (d > 0) {
- h -= d;
- }
- XCopyArea(comboPtr->display, drawable, Tk_WindowId(comboPtr->tkwin),
- comboPtr->defStyle.labelNormalGC, 0, sy, w, h, comboPtr->borderWidth, y);
- Tk_FreePixmap(comboPtr->display, drawable);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateOp --
- *
- * Activate the specified entry (draw with active foreground/background).
- * Only one entry may be active at one time, so the previously active
- * entry is deactivated.
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * The widget is eventually redraw.
- *
- * .cm activate entry
- *
- *---------------------------------------------------------------------------
- */
-static int
-ActivateOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Entry *entryPtr;
-
- if (GetEntryFromObj(NULL, comboPtr, objv[2], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (comboPtr->activePtr == entryPtr) {
- return TCL_OK; /* Entry is already active. */
- }
- ActivateEntry(comboPtr, NULL); /* Deactive the current active. */
- if (entryPtr != NULL) {
- ActivateEntry(comboPtr, entryPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BindOp --
- *
- * .t bind entry sequence command
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BindOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- ClientData object;
- Entry *entryPtr;
- const char *string;
-
- /*
- * Entries are selected by id only. All other strings are interpreted as
- * a binding tag.
- */
- string = Tcl_GetString(objv[2]);
- if (isdigit(UCHAR(string[0]))) {
- Blt_TreeNode node;
- long inode;
-
- if (Tcl_GetLongFromObj(comboPtr->interp, objv[2], &inode) != TCL_OK) {
- return TCL_ERROR;
- }
- node = Blt_Tree_GetNode(comboPtr->tree, inode);
- object = NodeToEntry(comboPtr, node);
- } else if (GetEntryFromObj(interp, comboPtr, objv[2], &entryPtr)==TCL_OK) {
- if (entryPtr != NULL) {
- return TCL_OK; /* Special id doesn't currently
- * exist. */
- }
- object = entryPtr;
- } else {
- /* Assume that this is a binding tag. */
- object = EntryTag(comboPtr, string);
- }
- return Blt_ConfigureBindingsFromObj(interp, comboPtr->bindTable, object,
- objc - 3, objv + 3);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonActivateOp --
- *
- * Selects the button to appear active.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ButtonActivateOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Entry *oldPtr, *entryPtr;
- const char *string;
-
- string = Tcl_GetString(objv[3]);
- if (string[0] == '\0') {
- entryPtr = NULL;
- } else if (GetEntryFromObj(interp, comboPtr, objv[3], &entryPtr) != TCL_OK){
- return TCL_ERROR;
- }
- if ((entryPtr != NULL) && !(entryPtr->flags & ENTRY_BUTTON)) {
- entryPtr = NULL;
- }
- oldPtr = comboPtr->activeBtnPtr;
- comboPtr->activeBtnPtr = entryPtr;
- if (!(comboPtr->flags & REDRAW_PENDING) && (entryPtr != oldPtr)) {
- if ((oldPtr != NULL) && (oldPtr != comboPtr->rootPtr)) {
-#ifdef notdef
- DrawButton(comboPtr, oldPtr);
-#endif
- }
- if ((entryPtr != NULL) && (entryPtr != comboPtr->rootPtr)) {
-#ifdef notdef
- DrawButton(comboPtr, entryPtr);
-#endif
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonBindOp --
- *
- * .ct bind tag sequence command
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ButtonBindOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- ClientData object;
-
- /* Assume that this is a binding tag. */
- object = ButtonTag(comboPtr, Tcl_GetString(objv[3]));
- return Blt_ConfigureBindingsFromObj(interp, comboPtr->bindTable, object,
- objc - 4, objv + 4);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonCgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ButtonCgetOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- return Blt_ConfigureValueFromObj(interp, comboPtr->tkwin, buttonSpecs,
- (char *)comboPtr, objv[3], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonConfigureOp --
- *
- * This procedure is called to process a list of configuration options
- * database, in order to reconfigure the one of more entries in the
- * widget.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for comboPtr; old resources get freed, if there were any.
- *
- * .ct button configure option value
- *
- *---------------------------------------------------------------------------
- */
-static int
-ButtonConfigureOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin, buttonSpecs,
- (char *)comboPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin, buttonSpecs,
- (char *)comboPtr, objv[3], 0);
- }
- iconsOption.clientData = comboPtr;
- if (Blt_ConfigureWidgetFromObj(comboPtr->interp, comboPtr->tkwin,
- buttonSpecs, objc - 3, objv + 3, (char *)comboPtr,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- ConfigureButtons(comboPtr);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonOp --
- *
- * This procedure handles button operations.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec buttonOps[] =
-{
- {"activate", 1, ButtonActivateOp, 4, 4, "entry",},
- {"bind", 1, ButtonBindOp, 4, 6, "tagName ?sequence command?",},
- {"cget", 2, ButtonCgetOp, 4, 4, "option",},
- {"configure", 2, ButtonConfigureOp, 3, 0, "?option value?...",},
- {"highlight", 1, ButtonActivateOp, 4, 4, "entry",},
-};
-
-static int nButtonOps = sizeof(buttonOps) / sizeof(Blt_OpSpec);
-
-static int
-ButtonOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- ComboTreeCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nButtonOps, buttonOps, BLT_OP_ARG2, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (comboPtr, interp, objc, objv);
- return result;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CgetOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- return Blt_ConfigureValueFromObj(interp, comboPtr->tkwin, comboSpecs,
- (char *)comboPtr, objv[2], 0);
-}
-
-/*ARGSUSED*/
-static int
-CloseOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int recurse, result;
- Entry *entryPtr;
- EntryIterator iter;
-
- recurse = FALSE;
- if (objc > 2) {
- const char *string;
- int length;
-
- string = Tcl_GetStringFromObj(objv[2], &length);
- if ((string[0] == '-') && (length > 1) &&
- (strncmp(string, "-recurse", length) == 0)) {
- objv++, objc--;
- recurse = TRUE;
- }
- }
- if (GetEntryIterator(interp, comboPtr, objv[2], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = NextTaggedEntry(&iter)) {
-
- /*
- * Check if either the active entry is in this hierarchy. Must move
- * it or disable it before we close the node. Otherwise it may be
- * deleted by a TCL "close" script, and we'll be left pointing to a
- * bogus memory location.
- */
- if ((comboPtr->activePtr != NULL) &&
- (Blt_Tree_IsAncestor(entryPtr->node, comboPtr->activePtr->node))) {
- comboPtr->activePtr = entryPtr;
- }
- if (recurse) {
- result = Apply(comboPtr, entryPtr, CloseEntry, 0);
- } else {
- result = CloseEntry(comboPtr, entryPtr);
- }
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- /* Closing a node may affect the visible entries and the the world layout
- * of the entries. */
- comboPtr->flags |= (LAYOUT_PENDING | DIRTY);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) the widget.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for comboPtr; old resources get freed, if there were any. The
- * widget is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin, comboSpecs,
- (char *)comboPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin,
- comboSpecs, (char *)comboPtr, objv[2], 0);
- }
- iconsOption.clientData = comboPtr;
- if (ConfigureComboTree(interp, comboPtr, objc - 2, objv + 2,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryActivateOp --
- *
- * Selects the entry to appear active.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EntryActivateOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Entry *newPtr, *oldPtr;
- const char *string;
-
- string = Tcl_GetString(objv[3]);
- if (string[0] == '\0') {
- newPtr = NULL;
- } else if (GetEntry(comboPtr, objv[3], &newPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- oldPtr = comboPtr->activePtr;
- comboPtr->activePtr = newPtr;
- if (((comboPtr->flags & REDRAW_PENDING) == 0) && (newPtr != oldPtr)) {
- Drawable drawable;
- int x, y;
-
- drawable = Tk_WindowId(comboPtr->tkwin);
- if (oldPtr != NULL) {
- x = SCREENX(comboPtr, oldPtr->worldX) +
- ICONWIDTH(Blt_Tree_NodeDepth(oldPtr->node));
- y = SCREENY(comboPtr, oldPtr->worldY);
- oldPtr->flags |= ENTRY_ICON;
- DrawComboIcon(comboPtr, oldPtr, drawable, x, y);
- }
- if (newPtr != NULL) {
- x = SCREENX(comboPtr, newPtr->worldX) +
- ICONWIDTH(Blt_Tree_NodeDepth(newPtr->node));
- y = SCREENY(comboPtr, newPtr->worldY);
- newPtr->flags |= ENTRY_ICON;
- DrawComboIcon(comboPtr, newPtr, drawable, x, y);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryCgetOp --
- *
- * .ct entry cget entry option
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EntryCgetOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Entry *entryPtr;
-
- if (GetEntry(comboPtr, objv[3], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_ConfigureValueFromObj(interp, comboPtr->tkwin, entrySpecs,
- (char *)entryPtr, objv[4], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryConfigureOp --
- *
- * This procedure is called to process a list of configuration options
- * database, in order to reconfigure the one of more entries in the
- * widget.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for comboPtr; old resources get freed, if there were any. The
- * hypertext is redisplayed.
- *
- * .ct entry configure entry option value
- *
- *---------------------------------------------------------------------------
- */
-static int
-EntryConfigureOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- EntryIterator iter;
- Entry *entryPtr;
-
- iconsOption.clientData = comboPtr;
- uidOption.clientData = comboPtr;
-
- if (GetEntryIterator(interp, comboPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = NextTaggedEntry(&iter)) {
- if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin,
- entrySpecs, (char *)entryPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 5) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin,
- entrySpecs, (char *)entryPtr, objv[4], 0);
- }
- if (ConfigureEntry(comboPtr, entryPtr, objc, objv,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- comboPtr->flags |= (DIRTY | LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryIsHiddenOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EntryIsHiddenOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Entry *entryPtr;
- int bool;
-
- if (GetEntry(comboPtr, objv[3], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- bool = (entryPtr->flags & ENTRY_HIDE);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryIsOpenOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EntryIsOpenOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Entry *entryPtr;
- int bool;
-
- if (GetEntry(comboPtr, objv[3], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- bool = ((entryPtr->flags & ENTRY_CLOSED) == 0);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryOp --
- *
- * This procedure handles entry operations.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-
-static Blt_OpSpec entryOps[] =
-{
- {"activate", 1, EntryActivateOp, 4, 4, "entry",},
- {"cget", 2, EntryCgetOp, 5, 5, "entry option",},
- {"configure", 2, EntryConfigureOp, 4, 0,
- "entry ?entry...? ?option value?...",},
- {"highlight", 1, EntryActivateOp, 4, 4, "entry",},
- {"ishidden", 3, EntryIsHiddenOp, 4, 4, "entry",},
- {"isopen", 3, EntryIsOpenOp, 4, 4, "entry",},
-};
-static int nEntryOps = sizeof(entryOps) / sizeof(Blt_OpSpec);
-
-static int
-EntryOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- ComboTreeCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nEntryOps, entryOps, BLT_OP_ARG2, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (comboPtr, interp, objc, objv);
- return result;
-}
-
-/*ARGSUSED*/
-static int
-ExactCompare(Tcl_Interp *interp, const char *name, const char *pattern)
-{
- return (strcmp(name, pattern) == 0);
-}
-
-/*ARGSUSED*/
-static int
-GlobCompare(Tcl_Interp *interp, const char *name, const char *pattern)
-{
- return Tcl_StringMatch(name, pattern);
-}
-
-static int
-RegexpCompare(Tcl_Interp *interp, const char *name, const char *pattern)
-{
- return Tcl_RegExpMatch(interp, name, pattern);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetOp --
- *
- * Converts one or more node identifiers to its path component. The path
- * may be either the single entry name or the full path of the entry.
- *
- * Results:
- * A standard TCL result. The interpreter result will contain a list of
- * the convert names.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int useFullName;
- int i;
- Tcl_DString d1, d2;
- int count;
-
- useFullName = FALSE;
- if (objc > 2) {
- const char *string;
-
- string = Tcl_GetString(objv[2]);
- if ((string[0] == '-') && (strcmp(string, "-full") == 0)) {
- useFullName = TRUE;
- objv++, objc--;
- }
- }
- Tcl_DStringInit(&d1); /* Result. */
- Tcl_DStringInit(&d2); /* Last element. */
- count = 0;
- for (i = 2; i < objc; i++) {
- EntryIterator iter;
- Entry *entryPtr;
-
- if (GetEntryIterator(interp, comboPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = NextTaggedEntry(&iter)) {
- Tcl_DStringSetLength(&d2, 0);
- count++;
- if (entryPtr->node != NULL) {
- if (useFullName) {
- GetFullName(comboPtr, entryPtr, &d2);
- } else {
- Tcl_DStringAppend(&d2, Blt_Tree_NodeLabel(entryPtr->node),-1);
- }
- Tcl_DStringAppendElement(&d1, Tcl_DStringValue(&d2));
- }
- }
- }
- /* This handles the single element list problem. */
- if (count == 1) {
- Tcl_DStringResult(interp, &d2);
- Tcl_DStringFree(&d1);
- } else {
- Tcl_DStringResult(interp, &d1);
- Tcl_DStringFree(&d2);
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShowEntryApplyProc --
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ShowEntryApplyProc(ComboTree *comboPtr, Entry *entryPtr)
-{
- entryPtr->flags &= ~ENTRY_HIDE;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HideEntryApplyProc --
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HideEntryApplyProc(ComboTree *comboPtr, Entry *entryPtr)
-{
- entryPtr->flags |= ENTRY_HIDE;
- return TCL_OK;
-}
-
-static void
-MapAncestors(ComboTree *comboPtr, Entry *entryPtr)
-{
- while (entryPtr != comboPtr->rootPtr) {
- entryPtr = ParentEntry(entryPtr);
- if (entryPtr->flags & (ENTRY_CLOSED | ENTRY_HIDE)) {
- comboPtr->flags |= LAYOUT_PENDING;
- entryPtr->flags &= ~(ENTRY_CLOSED | ENTRY_HIDE);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapAncestorsApplyProc --
- *
- * If a node in mapped, then all its ancestors must be mapped also. This
- * routine traverses upwards and maps each unmapped ancestor. It's
- * assumed that for any mapped ancestor, all it's ancestors will already
- * be mapped too.
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-static int
-MapAncestorsApplyProc(ComboTree *comboPtr, Entry *entryPtr)
-{
- /*
- * Make sure that all the ancestors of this entry are mapped too.
- */
- while (entryPtr != comboPtr->rootPtr) {
- entryPtr = ParentEntry(entryPtr);
- if ((entryPtr->flags & (ENTRY_HIDE | ENTRY_CLOSED)) == 0) {
- break; /* Assume ancestors are also mapped. */
- }
- entryPtr->flags &= ~(ENTRY_HIDE | ENTRY_CLOSED);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SearchAndApplyToTree --
- *
- * Searches through the current tree and applies a procedure to matching
- * nodes. The search specification is taken from the following
- * command-line arguments:
- *
- * ?-exact? ?-glob? ?-regexp? ?-nonmatching?
- * ?-data string?
- * ?-name string?
- * ?-full string?
- * ?--?
- * ?inode...?
- *
- * Results:
- * A standard TCL result. If the result is valid, and if the nonmatchPtr
- * is specified, it returns a boolean value indicating whether or not the
- * search was inverted. This is needed to fix things properly for the
- * "hide nonmatching" case.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SearchAndApplyToTree(ComboTree *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv, ApplyProc *proc, int *nonMatchPtr)
-{
- CompareProc *compareProc;
- int invertMatch; /* normal search mode (matching entries) */
- const char *namePattern, *fullPattern;
- int i;
- int length;
- int result;
- const char *option, *pattern;
- char c;
- Blt_List options;
- Entry *entryPtr;
- Blt_ListNode node;
- const char *string;
- const char *withTag;
- Tcl_Obj *objPtr;
-
- options = Blt_List_Create(BLT_ONE_WORD_KEYS);
- invertMatch = FALSE;
- namePattern = fullPattern = NULL;
- compareProc = ExactCompare;
- withTag = NULL;
-
- entryPtr = comboPtr->rootPtr;
- for (i = 2; i < objc; i++) {
- string = Tcl_GetStringFromObj(objv[i], &length);
- if (string[0] != '-') {
- break;
- }
- option = string + 1;
- length--;
- c = option[0];
- if ((c == 'e') && (strncmp(option, "exact", length) == 0)) {
- compareProc = ExactCompare;
- } else if ((c == 'g') && (strncmp(option, "glob", length) == 0)) {
- compareProc = GlobCompare;
- } else if ((c == 'r') && (strncmp(option, "regexp", length) == 0)) {
- compareProc = RegexpCompare;
- } else if ((c == 'n') && (length > 1) &&
- (strncmp(option, "nonmatching", length) == 0)) {
- invertMatch = TRUE;
- } else if ((c == 'f') && (strncmp(option, "full", length) == 0)) {
- if ((i + 1) == objc) {
- goto missingArg;
- }
- i++;
- fullPattern = Tcl_GetString(objv[i]);
- } else if ((c == 'n') && (length > 1) &&
- (strncmp(option, "name", length) == 0)) {
- if ((i + 1) == objc) {
- goto missingArg;
- }
- i++;
- namePattern = Tcl_GetString(objv[i]);
- } else if ((c == 't') && (length > 1) &&
- (strncmp(option, "tag", length) == 0)) {
- if ((i + 1) == objc) {
- goto missingArg;
- }
- i++;
- withTag = Tcl_GetString(objv[i]);
- } else if ((option[0] == '-') && (option[1] == '\0')) {
- break;
- } else {
- /*
- * Verify that the switch is actually an entry configuration
- * option.
- */
- if (Blt_ConfigureValueFromObj(interp, comboPtr->tkwin, entrySpecs,
- (char *)entryPtr, objv[i], 0) != TCL_OK) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad switch \"", string,
- "\": must be -exact, -glob, -regexp, -name, -full, or -nonmatching",
- (char *)NULL);
- return TCL_ERROR;
- }
- if ((i + 1) == objc) {
- goto missingArg;
- }
- /* Save the option in the list of configuration options */
- node = Blt_List_GetNode(options, (char *)objv[i]);
- if (node == NULL) {
- node = Blt_List_CreateNode(options, (char *)objv[i]);
- Blt_List_AppendNode(options, node);
- }
- i++;
- Blt_List_SetValue(node, Tcl_GetString(objv[i]));
- }
- }
-
- if ((namePattern != NULL) || (fullPattern != NULL) ||
- (Blt_List_GetLength(options) > 0)) {
- /*
- * Search through the tree and look for nodes that match the current
- * spec. Apply the input procedure to each of the matching nodes.
- */
- for (entryPtr = comboPtr->rootPtr; entryPtr != NULL;
- entryPtr = NextEntry(entryPtr, 0)) {
- if (namePattern != NULL) {
- result = (*compareProc) (interp,
- Blt_Tree_NodeLabel(entryPtr->node), namePattern);
- if (result == invertMatch) {
- continue; /* Failed to match */
- }
- }
- if (fullPattern != NULL) {
- Tcl_DString ds;
-
- GetFullName(comboPtr, entryPtr, &ds);
- result = (*compareProc)(interp, Tcl_DStringValue(&ds),
- fullPattern);
- Tcl_DStringFree(&ds);
- if (result == invertMatch) {
- continue; /* Failed to match */
- }
- }
- if (withTag != NULL) {
- result = Blt_Tree_HasTag(comboPtr->tree, entryPtr->node, withTag);
- if (result == invertMatch) {
- continue; /* Failed to match */
- }
- }
- for (node = Blt_List_FirstNode(options); node != NULL;
- node = Blt_List_NextNode(node)) {
- objPtr = (Tcl_Obj *)Blt_List_GetKey(node);
- Tcl_ResetResult(interp);
- if (Blt_ConfigureValueFromObj(interp, comboPtr->tkwin,
- entrySpecs, (char *)entryPtr, objPtr, 0) != TCL_OK) {
- return TCL_ERROR; /* This shouldn't happen. */
- }
- pattern = Blt_List_GetValue(node);
- objPtr = Tcl_GetObjResult(interp);
- result = (*compareProc)(interp, Tcl_GetString(objPtr), pattern);
- if (result == invertMatch) {
- continue; /* Failed to match */
- }
- }
- /* Finally, apply the procedure to the node */
- (*proc)(comboPtr, entryPtr);
- }
- Tcl_ResetResult(interp);
- Blt_List_Destroy(options);
- }
- /*
- * Apply the procedure to nodes that have been specified individually.
- */
- for ( /*empty*/ ; i < objc; i++) {
- EntryIterator iter;
-
- if (GetEntryIterator(interp, comboPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = NextTaggedEntry(&iter)) {
- if ((*proc) (comboPtr, entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- if (nonMatchPtr != NULL) {
- *nonMatchPtr = invertMatch; /* return "inverted search" status */
- }
- return TCL_OK;
-
- missingArg:
- Blt_List_Destroy(options);
- Tcl_AppendResult(interp, "missing pattern for search option \"", objv[i],
- "\"", (char *)NULL);
- return TCL_ERROR;
-
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HideOp --
- *
- * Hides one or more nodes. Nodes can be specified by their inode, or by
- * matching a name or data value pattern. By default, the patterns are
- * matched exactly. They can also be matched using glob-style and
- * regular expression rules.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-HideOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int status, nonmatching;
-
- status = SearchAndApplyToTree(comboPtr, interp, objc, objv,
- HideEntryApplyProc, &nonmatching);
-
- if (status != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * If this was an inverted search, scan back through the tree and make
- * sure that the parents for all visible nodes are also visible. After
- * all, if a node is supposed to be visible, its parent can't be hidden.
- */
- if (nonmatching) {
- Apply(comboPtr, comboPtr->rootPtr, MapAncestorsApplyProc, 0);
- }
-
- /* Hiding an entry only effects the visible nodes. */
- comboPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- * Converts one of more words representing indices of the entries in the
- * treeview widget to their respective serial identifiers.
- *
- * Results:
- * A standard TCL result. Interp->result will contain the identifier of
- * each inode found. If an inode could not be found, then the serial
- * identifier will be the empty string.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IndexOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Entry *entryPtr;
- long nodeId;
-
- nodeId = -1;
- if ((GetEntryFromObj(NULL, comboPtr, objv[2], &entryPtr) == TCL_OK) &&
- (entryPtr != NULL)) {
- nodeId = Blt_Tree_NodeId(entryPtr->node);
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), nodeId);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InvokeOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set.
- *
- * .ct invoke entry
- *
- *---------------------------------------------------------------------------
- */
-static int
-InvokeOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int result;
- Entry *entryPtr;
-
- if (GetEntryFromObj(interp, comboPtr, objv[2], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (entryPtr == NULL) {
- return TCL_OK; /* Entry is currently disabled. */
- }
- result = TCL_OK;
- Tcl_Preserve((ClientData)entryPtr);
- if (comboPtr->iconVarObjPtr != NULL) {
- Tcl_Obj *objPtr;
- Icon icon;
-
- icon = GetEntryIcon(comboPtr, entryPtr);
- objPtr = Tcl_NewStringObj(IconName(icon), -1);
- if (Tcl_ObjSetVar2(interp, comboPtr->iconVarObjPtr, NULL, objPtr,
- TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- }
- if (comboPtr->textVarObjPtr != NULL) {
- Tcl_Obj *objPtr;
- Tcl_DString ds;
-
- Tcl_DStringInit(&ds);
- GetFullName(comboPtr, entryPtr, &ds);
- objPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), -1);
- Tcl_DStringFree(&ds);
- if (Tcl_ObjSetVar2(interp, comboPtr->textVarObjPtr, NULL, objPtr,
- TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- }
- if (entryPtr->cmdObjPtr != NULL) {
- Tcl_IncrRefCount(entryPtr->cmdObjPtr);
- result = Tcl_EvalObjEx(interp, entryPtr->cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(entryPtr->cmdObjPtr);
- }
- Tcl_Release((ClientData)entryPtr);
- return result;
-}
-
-/*ARGSUSED*/
-static int
-NearestOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Button *buttonPtr = &comboPtr->button;
- int x, y; /* Screen coordinates of the test point. */
- Entry *entryPtr;
- int isRoot;
- const char *string;
-
- isRoot = FALSE;
- string = Tcl_GetString(objv[2]);
- if (strcmp("-root", string) == 0) {
- isRoot = TRUE;
- objv++, objc--;
- }
- if (objc < 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ", Tcl_GetString(objv[1]),
- " ?-root? x y\"", (char *)NULL);
- return TCL_ERROR;
-
- }
- if ((Tk_GetPixelsFromObj(interp, comboPtr->tkwin, objv[2], &x) != TCL_OK) ||
- (Tk_GetPixelsFromObj(interp, comboPtr->tkwin, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (comboPtr->nVisible == 0) {
- return TCL_OK;
- }
- if (isRoot) {
- int rootX, rootY;
-
- Tk_GetRootCoords(comboPtr->tkwin, &rootX, &rootY);
- x -= rootX;
- y -= rootY;
- }
- entryPtr = NearestEntry(comboPtr, x, y, TRUE);
- if (entryPtr == NULL) {
- return TCL_OK;
- }
- x = WORLDX(comboPtr, x);
- y = WORLDY(comboPtr, y);
- if (objc > 4) {
- const char *where;
- int labelX, labelY, depth;
- Icon icon;
-
- where = "";
- if (entryPtr->flags & ENTRY_BUTTON) {
- int buttonX, buttonY;
-
- buttonX = entryPtr->worldX + entryPtr->buttonX;
- buttonY = entryPtr->worldY + entryPtr->buttonY;
- if ((x >= buttonX) && (x < (buttonX + buttonPtr->width)) &&
- (y >= buttonY) && (y < (buttonY + buttonPtr->height))) {
- where = "button";
- goto done;
- }
- }
- depth = Blt_Tree_NodeDepth(entryPtr->node);
-
- icon = GetEntryIcon(comboPtr, entryPtr);
- if (icon != NULL) {
- int iconWidth, iconHeight, entryHeight;
- int iconX, iconY;
-
- entryHeight = MAX(entryPtr->iconHeight, comboPtr->button.height);
- iconHeight = IconHeight(icon);
- iconWidth = IconWidth(icon);
- iconX = entryPtr->worldX + ICONWIDTH(depth);
- iconY = entryPtr->worldY;
- iconX += (ICONWIDTH(depth + 1) - iconWidth) / 2;
- iconY += (entryHeight - iconHeight) / 2;
- if ((x >= iconX) && (x <= (iconX + iconWidth)) &&
- (y >= iconY) && (y < (iconY + iconHeight))) {
- where = "icon";
- goto done;
- }
- }
- labelX = entryPtr->worldX + ICONWIDTH(depth);
- labelY = entryPtr->worldY;
- if (!comboPtr->flatView) {
- labelX += ICONWIDTH(depth + 1) + 4;
- }
- if ((x >= labelX) && (x < (labelX + entryPtr->labelWidth)) &&
- (y >= labelY) && (y < (labelY + entryPtr->labelHeight))) {
- where = "label";
- }
- done:
- if (Tcl_SetVar(interp, Tcl_GetString(objv[4]), where,
- TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), Blt_Tree_NodeId(entryPtr->node));
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * OpenOp --
- *
- * Returns the node identifiers in a given range.
- *
- * .ct open ?-recurse? $entry
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-OpenOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp, /* Not used. */
- int objc,
- Tcl_Obj *const *objv)
-{
- int recurse, result;
- Entry *entryPtr;
- EntryIterator iter;
-
- recurse = FALSE;
- if (objc > 2) {
- int length;
- const char *string;
-
- string = Tcl_GetStringFromObj(objv[2], &length);
- if ((string[0] == '-') && (length > 1) &&
- (strncmp(string, "-recurse", length) == 0)) {
- objv++, objc--;
- recurse = TRUE;
- }
- }
- if (GetEntryIterator(interp, comboPtr, objv[2], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = NextTaggedEntry(&iter)) {
- if (recurse) {
- result = Apply(comboPtr, entryPtr, OpenEntry, 0);
- } else {
- result = OpenEntry(comboPtr, entryPtr);
- }
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- /* Make sure ancestors of this node aren't hidden. */
- MapAncestors(comboPtr, entryPtr);
- }
- /*FIXME: This is only for flattened entries. */
- comboPtr->flags |= (LAYOUT_PENDING | DIRTY | SCROLL_PENDING);
-
- /* Can't trust the selected entry if nodes have been added or deleted. So
- * recompute the layout. */
- if (comboPtr->flags & LAYOUT_PENDING) {
- ComputeComboGeometry(comboPtr);
- }
- ComputeVisibleEntries(comboPtr);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PostOp --
- *
- * Posts this menu at the given root screen coordinates.
- *
- * .cm post ?x y?
- *
- *---------------------------------------------------------------------------
- */
-static int
-PostOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int x, y;
- Tk_Window parent;
- int menuWidth;
-
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (comboPtr->flags & LAYOUT_PENDING) {
- ComputeComboGeometry(comboPtr);
- }
- menuWidth = Tk_ReqWidth(comboPtr->tkwin);
- parent = Tk_Parent(comboPtr->tkwin);
- if (Tk_Width(parent) > menuWidth) {
- menuWidth = Tk_Width(parent);
- }
- if (objc == 5) {
- const char *string;
-
- string = Tcl_GetString(objv[4]);
- if (strcmp(string, "left") == 0) {
- /* Do nothing. */
- } else if (strcmp(string, "right") == 0) {
- x -= menuWidth;
- } else if (strcmp(string, "center") == 0) {
- x -= menuWidth / 2;
- } else {
- Tcl_AppendResult(interp, "bad alignment value \"", string,
- "\": should be left, right, or center.", (char *)NULL);
- return TCL_ERROR;
- }
- }
- FixMenuCoords(comboPtr, &x, &y);
-#ifdef notdef
- int x, y;
-
- if (objc == 4) {
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- } else if (objc == 2) {
- if (comboPtr->flags & LAYOUT_PENDING) {
- ComputeComboGeometry(comboPtr);
- }
- ComputeMenuCoords(comboPtr, TK_ANCHOR_SE, &x, &y);
- } else {
- Tcl_AppendResult(interp, "wrong # of args: should be \"",
- Tcl_GetString(objv[0]), " post ?x y?\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (Tk_IsMapped(comboPtr->tkwin)) {
- return TCL_OK; /* This menu is already posted. */
- }
-#endif
- /*
- * If there is a post command for the menu, execute it. This may change
- * the size of the menu, so be sure to recompute the menu's geometry if
- * needed.
- */
- if (comboPtr->postCmdObjPtr != NULL) {
- int result;
-
- Tcl_IncrRefCount(comboPtr->postCmdObjPtr);
- result = Tcl_EvalObjEx(interp, comboPtr->postCmdObjPtr,TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(comboPtr->postCmdObjPtr);
- if (result != TCL_OK) {
- return result;
- }
- /*
- * The post commands could have deleted the menu, which means we are
- * dead and should go away.
- */
- if (comboPtr->tkwin == NULL) {
- return TCL_OK;
- }
- if (comboPtr->flags & LAYOUT_PENDING) {
- ComputeComboGeometry(comboPtr);
- }
- }
-
- /*
- * Adjust the position of the menu if necessary to keep it visible on the
- * screen. There are two special tricks to make this work right:
- *
- * 1. If a virtual root window manager is being used then
- * the coordinates are in the virtual root window of
- * menuPtr's parent; since the menu uses override-redirect
- * mode it will be in the *real* root window for the screen,
- * so we have to map the coordinates from the virtual root
- * (if any) to the real root. Can't get the virtual root
- * from the menu itself (it will never be seen by the wm)
- * so use its parent instead (it would be better to have an
- * an option that names a window to use for this...).
- * 2. The menu may not have been mapped yet, so its current size
- * might be the default 1x1. To compute how much space it
- * needs, use its requested size, not its actual size.
- *
- * Note that this code assumes square screen regions and all positive
- * coordinates. This does not work on a Mac with multiple monitors. But
- * then again, Tk has other problems with this.
- */
- {
- int vx, vy, vw, vh;
- int tmp;
- int screenWidth, screenHeight;
-
- Blt_SizeOfScreen(comboPtr->tkwin, &screenWidth, &screenHeight);
- Tk_GetVRootGeometry(Tk_Parent(comboPtr->tkwin), &vx, &vy, &vw, &vh);
- x += vx;
- y += vy;
- tmp = screenWidth - Tk_ReqWidth(comboPtr->tkwin);
- if (x > tmp) {
- x = tmp;
- }
- if (x < 0) {
- x = 0;
- }
- tmp = screenHeight - Tk_ReqHeight(comboPtr->tkwin);
- if (y > tmp) {
- y = tmp;
- }
- if (y < 0) {
- y = 0;
- }
- Tk_MoveToplevelWindow(comboPtr->tkwin, x, y);
- Blt_MapToplevelWindow(comboPtr->tkwin);
- if (!Tk_IsMapped(comboPtr->tkwin)) {
- Tk_MapWindow(comboPtr->tkwin);
- }
- Blt_MapToplevelWindow(comboPtr->tkwin);
- Blt_RaiseToplevelWindow(comboPtr->tkwin);
-#ifdef notdef
- TkWmRestackToplevel(comboPtr->tkwin, Above, NULL);
-#endif
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScanOp --
- *
- * Implements the quick scan.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ScanOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int x, y;
- char c;
- int length;
- int oper;
- const char *string;
- Tk_Window tkwin;
-
-#define SCAN_MARK 1
-#define SCAN_DRAGTO 2
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- tkwin = comboPtr->tkwin;
- if ((c == 'm') && (strncmp(string, "mark", length) == 0)) {
- oper = SCAN_MARK;
- } else if ((c == 'd') && (strncmp(string, "dragto", length) == 0)) {
- oper = SCAN_DRAGTO;
- } else {
- Tcl_AppendResult(interp, "bad scan operation \"", string,
- "\": should be either \"mark\" or \"dragto\"", (char *)NULL);
- return TCL_ERROR;
- }
- if ((Blt_GetPixelsFromObj(interp, tkwin, objv[3], PIXELS_ANY, &x)
- != TCL_OK) ||
- (Blt_GetPixelsFromObj(interp, tkwin, objv[4], PIXELS_ANY, &y)
- != TCL_OK)) {
- return TCL_ERROR;
- }
- if (oper == SCAN_MARK) {
- comboPtr->scanAnchorX = x;
- comboPtr->scanAnchorY = y;
- comboPtr->scanX = comboPtr->xOffset;
- comboPtr->scanY = comboPtr->yOffset;
- } else {
- int worldX, worldY;
- int viewWidth, viewHeight;
- int dx, dy;
-
- dx = comboPtr->scanAnchorX - x;
- dy = comboPtr->scanAnchorY - y;
- worldX = comboPtr->scanX + (10 * dx);
- worldY = comboPtr->scanY + (10 * dy);
-
- viewWidth = VPORTWIDTH(comboPtr);
- if (worldX > (comboPtr->worldWidth - viewWidth)) {
- worldX = comboPtr->worldWidth - viewWidth;
- }
- if (worldX < 0) {
- worldX = 0;
- }
- viewHeight = VPORTHEIGHT(comboPtr);
- if (worldY > (comboPtr->worldHeight - viewHeight)) {
- worldY = comboPtr->worldHeight - viewHeight;
- }
- if (worldY < 0) {
- worldY = 0;
- }
- comboPtr->xOffset = worldX;
- comboPtr->yOffset = worldY;
- comboPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(comboPtr);
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-SeeOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Entry *entryPtr;
- int width, height;
- int x, y;
- Tk_Anchor anchor;
- int left, right, top, bottom;
- const char *string;
-
- string = Tcl_GetString(objv[2]);
- anchor = TK_ANCHOR_W; /* Default anchor is West */
- if ((string[0] == '-') && (strcmp(string, "-anchor") == 0)) {
- if (objc == 3) {
- Tcl_AppendResult(interp, "missing \"-anchor\" argument",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Tk_GetAnchorFromObj(interp, objv[3], &anchor) != TCL_OK) {
- return TCL_ERROR;
- }
- objc -= 2, objv += 2;
- }
- if (objc == 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", objv[0],
- "see ?-anchor anchor? entry\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (GetEntryFromObj(interp, comboPtr, objv[2], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (entryPtr == NULL) {
- return TCL_OK;
- }
- if (entryPtr->flags & ENTRY_HIDE) {
- MapAncestors(comboPtr, entryPtr);
- comboPtr->flags |= SCROLL_PENDING;
- /*
- * If the entry wasn't previously exposed, its world coordinates
- * aren't likely to be valid. So re-compute the layout before we try
- * to see the viewport to the entry's location.
- */
- ComputeComboGeometry(comboPtr);
- }
- width = VPORTWIDTH(comboPtr);
- height = VPORTHEIGHT(comboPtr);
-
- /*
- * XVIEW: If the entry is left or right of the current view, adjust
- * the offset. If the entry is nearby, adjust the view just
- * a bit. Otherwise, center the entry.
- */
- left = comboPtr->xOffset;
- right = comboPtr->xOffset + width;
-
- switch (anchor) {
- case TK_ANCHOR_W:
- case TK_ANCHOR_NW:
- case TK_ANCHOR_SW:
- x = 0;
- break;
- case TK_ANCHOR_E:
- case TK_ANCHOR_NE:
- case TK_ANCHOR_SE:
- x = entryPtr->worldX + entryPtr->width +
- ICONWIDTH(Blt_Tree_NodeDepth(entryPtr->node)) - width;
- break;
- default:
- if (entryPtr->worldX < left) {
- x = entryPtr->worldX;
- } else if ((entryPtr->worldX + entryPtr->width) > right) {
- x = entryPtr->worldX + entryPtr->width - width;
- } else {
- x = comboPtr->xOffset;
- }
- break;
- }
- /*
- * YVIEW: If the entry is above or below the current view, adjust
- * the offset. If the entry is nearby, adjust the view just
- * a bit. Otherwise, center the entry.
- */
- top = comboPtr->yOffset;
- bottom = comboPtr->yOffset + height;
-
- switch (anchor) {
- case TK_ANCHOR_N:
- y = comboPtr->yOffset;
- break;
- case TK_ANCHOR_NE:
- case TK_ANCHOR_NW:
- y = entryPtr->worldY - (height / 2);
- break;
- case TK_ANCHOR_S:
- case TK_ANCHOR_SE:
- case TK_ANCHOR_SW:
- y = entryPtr->worldY + entryPtr->height - height;
- break;
- default:
- if (entryPtr->worldY < top) {
- y = entryPtr->worldY;
- } else if ((entryPtr->worldY + entryPtr->height) > bottom) {
- y = entryPtr->worldY + entryPtr->height - height;
- } else {
- y = comboPtr->yOffset;
- }
- break;
- }
- if ((y != comboPtr->yOffset) || (x != comboPtr->xOffset)) {
- /* comboPtr->xOffset = x; */
- comboPtr->yOffset = y;
- comboPtr->flags |= SCROLL_PENDING;
- }
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShowOp --
- *
- * Mark one or more nodes to be exposed. Nodes can be specified by their
- * inode, or by matching a name or data value pattern. By default, the
- * patterns are matched exactly. They can also be matched using
- * glob-style and regular expression rules.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ShowOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (SearchAndApplyToTree(comboPtr, interp, objc, objv, ShowEntryApplyProc,
- (int *)NULL) != TCL_OK) {
- return TCL_ERROR;
- }
- comboPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/* .m style create name option value option value */
-
-static int
-StyleCreateOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Style *stylePtr;
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&comboPtr->styleTable, Tcl_GetString(objv[3]),
- &isNew);
- if (!isNew) {
- Tcl_AppendResult(interp, "combomenu style \"", Tcl_GetString(objv[3]),
- "\" already exists.", (char *)NULL);
- return TCL_ERROR;
- }
- stylePtr = Blt_AssertCalloc(1, sizeof(Style));
- stylePtr->name = Blt_GetHashKey(&comboPtr->styleTable, hPtr);
- stylePtr->hPtr = hPtr;
- stylePtr->comboPtr = comboPtr;
- stylePtr->activeRelief = TK_RELIEF_RAISED;
- Blt_SetHashValue(hPtr, stylePtr);
- iconsOption.clientData = comboPtr;
- if (ConfigureStyle(interp, stylePtr, objc - 4, objv + 4, 0) != TCL_OK) {
- DestroyStyle(stylePtr);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-StyleCgetOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Style *stylePtr;
-
- if (GetStyleFromObj(interp, comboPtr, objv[3], &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- iconsOption.clientData = comboPtr;
- return Blt_ConfigureValueFromObj(interp, comboPtr->tkwin, styleSpecs,
- (char *)stylePtr, objv[4], 0);
-}
-
-static int
-StyleConfigureOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int result, flags;
- Style *stylePtr;
-
- if (GetStyleFromObj(interp, comboPtr, objv[3], &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- iconsOption.clientData = comboPtr;
- flags = BLT_CONFIG_OBJV_ONLY;
- if (objc == 1) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin, styleSpecs,
- (char *)stylePtr, (Tcl_Obj *)NULL, flags);
- } else if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, comboPtr->tkwin, styleSpecs,
- (char *)stylePtr, objv[2], flags);
- }
- Tcl_Preserve(stylePtr);
- result = ConfigureStyle(interp, stylePtr, objc - 4, objv + 4, flags);
- Tcl_Release(stylePtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- comboPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-static int
-StyleDeleteOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Style *stylePtr;
-
- if (GetStyleFromObj(interp, comboPtr, objv[3], &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (stylePtr->refCount > 0) {
- Tcl_AppendResult(interp, "can't destroy combotree style \"",
- stylePtr->name, "\": style in use.", (char *)NULL);
- return TCL_ERROR;
- }
- DestroyStyle(stylePtr);
- return TCL_OK;
-}
-
-static int
-StyleNamesOp(
- ComboTree *comboPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&comboPtr->styleTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Style *stylePtr;
- int found;
- int i;
-
- found = TRUE;
- stylePtr = Blt_GetHashValue(hPtr);
- for (i = 3; i < objc; i++) {
- const char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- found = Tcl_StringMatch(stylePtr->name, pattern);
- if (found) {
- break;
- }
- }
- if (found) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(stylePtr->name, -1));
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-static Blt_OpSpec styleOps[] =
-{
- {"cget", 2, StyleCgetOp, 5, 5, "name option",},
- {"configure", 2, StyleConfigureOp, 4, 0, "name ?option value?...",},
- {"create", 2, StyleCreateOp, 4, 0, "name ?option value?...",},
- {"delete", 1, StyleDeleteOp, 3, 0, "?name...?",},
- {"names", 1, StyleNamesOp, 3, 0, "?pattern...?",},
-};
-
-static int nStyleOps = sizeof(styleOps) / sizeof(Blt_OpSpec);
-
-static int
-StyleOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- ComboTreeCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nStyleOps, styleOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (comboPtr, interp, objc, objv);
- return result;
-}
-
-/*ARGSUSED*/
-static int
-ToggleOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Entry *entryPtr;
- EntryIterator iter;
-
- if (GetEntryIterator(interp, comboPtr, objv[2], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = NextTaggedEntry(&iter)) {
- if (entryPtr->flags & ENTRY_CLOSED) {
- OpenEntry(comboPtr, entryPtr);
- } else {
- CloseEntry(comboPtr, entryPtr);
- }
- }
- comboPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnpostOp --
- *
- * Unposts this menu.
- *
- * .cm unpost
- *
- *---------------------------------------------------------------------------
- */
-static int
-UnpostOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- if (!Tk_IsMapped(comboPtr->tkwin)) {
- return TCL_OK; /* This menu is already unposted. */
- }
- if (Tk_IsMapped(comboPtr->tkwin)) {
- Tk_UnmapWindow(comboPtr->tkwin);
- }
- return TCL_OK;
-}
-
-static int
-XViewOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int w, worldWidth;
-
- w = VPORTWIDTH(comboPtr);
- worldWidth = comboPtr->worldWidth;
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- fract = (double)comboPtr->xOffset / worldWidth;
- fract = FCLAMP(fract);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(fract));
- fract = (double)(comboPtr->xOffset + w) / worldWidth;
- fract = FCLAMP(fract);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(fract));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2, &comboPtr->xOffset,
- worldWidth, w, comboPtr->xScrollUnits, BLT_SCROLL_MODE_HIERBOX)
- != TCL_OK) {
- return TCL_ERROR;
- }
- comboPtr->flags |= SCROLLX;
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-static int
-YViewOp(ComboTree *comboPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int h, worldHeight;
-
- h = VPORTHEIGHT(comboPtr);
- worldHeight = comboPtr->worldHeight;
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- /* Report first and last fractions */
- fract = (double)comboPtr->yOffset / worldHeight;
- fract = FCLAMP(fract);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(fract));
- fract = (double)(comboPtr->yOffset + h) / worldHeight;
- fract = FCLAMP(fract);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(fract));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2, &comboPtr->yOffset,
- worldHeight, h, comboPtr->yScrollUnits, BLT_SCROLL_MODE_HIERBOX)
- != TCL_OK) {
- return TCL_ERROR;
- }
- comboPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(comboPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboTreeInstCmdProc --
- *
- * This procedure is invoked to process commands on behalf of the
- * treeview widget.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec comboOps[] =
-{
- {"activate", 1, ActivateOp, 3, 3, "entry",},
- {"bind", 2, BindOp, 3, 5, "tagName ?sequence command?",},
- {"button", 2, ButtonOp, 2, 0, "args",},
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"close", 2, CloseOp, 2, 4, "?-recurse? entry",},
- {"configure", 3, ConfigureOp, 2, 0, "?option value?...",},
- {"entry", 2, EntryOp, 2, 0, "oper args",},
- {"get", 1, GetOp, 2, 0, "?-full? entry ?entry...?",},
- {"hide", 1, HideOp, 2, 0, "?-exact|-glob|-regexp? ?-nonmatching? ?-name string? ?-full string? ?-data string? ?--? ?entry...?",},
- {"index", 3, IndexOp, 3, 3, "entry",},
- {"invoke", 3, InvokeOp, 3, 3, "entry",},
- {"nearest", 1, NearestOp, 4, 5, "x y ?varName?",},
- {"open", 1, OpenOp, 2, 4, "?-recurse? entry",},
- {"post", 1, PostOp, 4, 5, "x y ?align?",},
- {"scan", 2, ScanOp, 5, 5, "dragto|mark x y",},
- {"see", 2, SeeOp, 3, 0, "?-anchor anchor? entry",},
- {"show", 2, ShowOp, 2, 0, "?-exact? ?-glob? ?-regexp? ?-nonmatching? ?-name string? ?-full string? ?-data string? ?--? ?entry...?",},
- {"style", 2, StyleOp, 2, 0, "args",},
- {"toggle", 2, ToggleOp, 3, 3, "entry",},
- {"unpost", 1, UnpostOp, 2, 2, "",},
- {"xview", 1, XViewOp, 2, 5, "?moveto fract? ?scroll number what?",},
- {"yview", 1, YViewOp, 2, 5, "?moveto fract? ?scroll number what?",},
-};
-
-static int nComboOps = sizeof(comboOps) / sizeof(Blt_OpSpec);
-
-static int
-ComboTreeInstCmdProc(
- ClientData clientData, /* Information about the widget. */
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Vector of argument strings. */
-{
- ComboTreeCmdProc *proc;
- ComboTree *comboPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nComboOps, comboOps, BLT_OP_ARG1, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(comboPtr);
- result = (*proc) (comboPtr, interp, objc, objv);
- Tcl_Release(comboPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayComboTree --
- *
- * This procedure is invoked to display the widget.
- *
- * Recompute the layout of the text if necessary. This is
- * necessary if the world coordinate system has changed.
- * Specifically, the following may have occurred:
- *
- * 1. a text attribute has changed (font, linespacing, etc.).
- * 2. an entry's option changed, possibly resizing the entry.
- *
- * This is deferred to the display routine since potentially
- * many of these may occur.
- *
- * Set the vertical and horizontal scrollbars. This is done
- * here since the window width and height are needed for the
- * scrollbar calculations.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayComboTree(ClientData clientData) /* Information about widget. */
-{
- ComboTree *comboPtr = clientData;
- Pixmap drawable;
-
- comboPtr->flags &= ~REDRAW_PENDING;
- if (comboPtr->tkwin == NULL) {
- return; /* Window has been destroyed. */
- }
- if (comboPtr->rootPtr == NULL) {
- fprintf(stderr, "no root to tree \n");
- return;
- }
- if (comboPtr->flags & LAYOUT_PENDING) {
- /*
- * Recompute the layout when entries are opened/closed,
- * inserted/deleted, or when text attributes change (such as
- * font, linespacing).
- */
- ComputeComboGeometry(comboPtr);
- }
- if (comboPtr->flags & (SCROLL_PENDING | DIRTY)) {
- /*
- * Scrolling means that the view port has changed and that the
- * visible entries need to be recomputed.
- */
- ComputeVisibleEntries(comboPtr);
- if ((comboPtr->flags & SCROLLX) && (comboPtr->xScrollCmdObjPtr!=NULL)) {
- int w;
-
- w = VPORTWIDTH(comboPtr);
- Blt_UpdateScrollbar(comboPtr->interp, comboPtr->xScrollCmdObjPtr,
- comboPtr->xOffset, comboPtr->xOffset + w, comboPtr->worldWidth);
- }
- if ((comboPtr->flags & SCROLLY) && (comboPtr->yScrollCmdObjPtr!=NULL)) {
- int h;
-
- h = VPORTHEIGHT(comboPtr);
- Blt_UpdateScrollbar(comboPtr->interp, comboPtr->yScrollCmdObjPtr,
- comboPtr->yOffset, comboPtr->yOffset + h, comboPtr->worldHeight);
- }
- comboPtr->flags &= ~SCROLL_PENDING;
- }
-#ifdef notdef
- if (comboPtr->reqWidth == 0) {
- /*
- * The first time through this routine, set the requested
- * width to the computed width. All we want is to
- * automatically set the width of the widget, not dynamically
- * grow/shrink it as attributes change.
- */
- comboPtr->reqWidth = comboPtr->worldWidth + 2 * comboPtr->inset;
- Tk_GeometryRequest(comboPtr->tkwin, comboPtr->reqWidth,
- comboPtr->reqHeight);
- }
-#endif
- if (!Tk_IsMapped(comboPtr->tkwin)) {
- return;
- }
- drawable = Tk_GetPixmap(comboPtr->display, Tk_WindowId(comboPtr->tkwin),
- Tk_Width(comboPtr->tkwin), Tk_Height(comboPtr->tkwin),
- Tk_Depth(comboPtr->tkwin));
-
- comboPtr->flags |= VIEWPORT;
- /* Clear the column background. */
- DrawComboTree(comboPtr, drawable);
- DrawOuterBorders(comboPtr, drawable);
-
- /* Now copy the new view to the window. */
- XCopyArea(comboPtr->display, drawable, Tk_WindowId(comboPtr->tkwin),
- comboPtr->lineGC, 0, 0, Tk_Width(comboPtr->tkwin),
- Tk_Height(comboPtr->tkwin), 0, 0);
- Tk_FreePixmap(comboPtr->display, drawable);
- comboPtr->flags &= ~VIEWPORT;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComboTreeObjCmdProc --
- *
- * This procedure is invoked to process the TCL command that
- * corresponds to a widget managed by this module. See the user
- * documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-ComboTreeObjCmdProc(
- ClientData clientData, /* Main window associated with interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- ComboTree *comboPtr;
- Tcl_CmdInfo cmdInfo;
- XSetWindowAttributes attrs;
- unsigned int mask;
- int result;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- comboPtr = NewComboTree(interp, objv[1]);
- if (comboPtr == NULL) {
- goto error;
- }
-
- /*
- * Source in the initialization script for treeview entries from
- * "$blt_library/treeview.tcl". We deferred sourcing the file until now
- * so that the variable $blt_library could be set within a script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::ComboTree::Initialize", &cmdInfo)) {
- static char cmd[] = {
- "source [file join $blt_library combotree.tcl]"
- };
- if (Tcl_GlobalEval(interp, cmd) != TCL_OK) {
- char info[200];
-
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- goto error;
- }
- }
- /*
- * Initialize the widget's configuration options here. The options need to
- * be set first, so that entry, column, and style components can use them
- * for their own GCs.
- */
- iconsOption.clientData = comboPtr;
- if (Blt_ConfigureComponentFromObj(interp, comboPtr->tkwin, "button",
- "Button", buttonSpecs, 0, (Tcl_Obj **)NULL, (char *)comboPtr, 0)
- != TCL_OK) {
- goto error;
- }
- /*
- * Rebuild the widget's GC and other resources that are predicated by the
- * widget's configuration options. Do the same for the default column.
- */
- if (ConfigureComboTree(interp, comboPtr, objc - 2, objv + 2, 0) != TCL_OK) {
- goto error;
- }
- /*
- * Invoke a procedure to initialize various bindings on treeview entries.
- */
- {
- Tcl_Obj *cmd[2];
-
- cmd[0] = Tcl_NewStringObj("::blt::ComboTree::Initialize", -1);
- cmd[1] = objv[1];
- Tcl_IncrRefCount(cmd[0]);
- Tcl_IncrRefCount(cmd[1]);
- result = Tcl_EvalObjv(interp, 2, cmd, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmd[1]);
- Tcl_DecrRefCount(cmd[0]);
- if (result != TCL_OK) {
- goto error;
- }
- }
-
- attrs.override_redirect = True;
- attrs.backing_store = WhenMapped;
- attrs.save_under = True;
- mask = (CWOverrideRedirect | CWSaveUnder | CWBackingStore);
- Tk_ChangeWindowAttributes(comboPtr->tkwin, mask, &attrs);
- Tk_MakeWindowExist(comboPtr->tkwin);
-
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(comboPtr->tkwin),-1);
- return TCL_OK;
- error:
- if (comboPtr != NULL) {
- Tk_DestroyWindow(comboPtr->tkwin);
- }
- return TCL_ERROR;
-}
-
-int
-Blt_ComboTreeInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "combotree", ComboTreeObjCmdProc, };
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-#endif /* NO_COMBOTREE */
diff --git a/blt3.0.1/src/bltConfig.c b/blt3.0.1/src/bltConfig.c
deleted file mode 100644
index cf67a23..0000000
--- a/blt3.0.1/src/bltConfig.c
+++ /dev/null
@@ -1,2493 +0,0 @@
-
-/*
- * bltConfig.c --
- *
- * This file contains a Tcl_Obj based replacement for the widget
- * configuration functions in Tk.
- *
- * Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994-1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * Copyright 2003-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * This is a Tcl_Obj based replacement for the widget configuration
- * functions in Tk.
- *
- * What not use the new Tk_Option interface?
- *
- * There were design changes in the new Tk_Option interface that
- * make it unwieldy.
- *
- * o You have to dynamically allocate, store, and deallocate
- * your option table.
- * o The Tk_FreeConfigOptions routine requires a tkwin argument.
- * Unfortunately, most widgets save the display pointer and
- * de-reference their tkwin when the window is destroyed.
- * o There's no TK_CONFIG_CUSTOM functionality. This means that
- * save special options must be saved as strings by
- * Tk_ConfigureWidget and processed later, thus losing the
- * benefits of Tcl_Objs. It also make error handling
- * problematic, since you don't pick up certain errors like
- *
- * .widget configure -myoption bad -myoption good
- *
- * You will never see the first "bad" value.
- * o Especially compared to the former Tk_ConfigureWidget calls,
- * the new interface is overly complex. If there was a big
- * performance win, it might be worth the effort. But let's
- * face it, this biggest wins are in processing custom options
- * values with thousands of elements. Most common resources
- * (font, color, etc) have string tokens anyways.
- *
- * On the other hand, the replacement functions in this file fell
- * into place quite easily both from the aspect of API writer and
- * user. The biggest benefit is that you don't need to change lots
- * of working code just to get the benefits of Tcl_Objs.
- *
- */
-
-#include "bltInt.h"
-
-#include <stdarg.h>
-#include "bltFont.h"
-#include "bltPicture.h"
-#include "bltBgStyle.h"
-
-#if (_TK_VERSION < _VERSION(8,1,0))
-/*
- *---------------------------------------------------------------------------
- *
- * Tk_GetAnchorFromObj --
- *
- * Return a Tk_Anchor value based on the value of the objPtr.
- *
- * Results:
- * The return value is a standard TCL result. If an error occurs during
- * conversion, an error message is left in the interpreter's result
- * unless "interp" is NULL.
- *
- * Side effects:
- * The object gets converted by Tcl_GetIndexFromObj.
- *
- *---------------------------------------------------------------------------
- */
-int
-Tk_GetAnchorFromObj(
- Tcl_Interp *interp, /* Used for error reporting. */
- Tcl_Obj *objPtr, /* The object we are trying to get the
- * value from. */
- Tk_Anchor *anchorPtr) /* Where to place the Tk_Anchor that
- * corresponds to the string value of
- * objPtr. */
-{
- return Tk_GetAnchor(interp, Tcl_GetString(objPtr), anchorPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Tk_GetJustifyFromObj --
- *
- * Return a Tk_Justify value based on the value of the objPtr.
- *
- * Results:
- * The return value is a standard TCL result. If an error occurs during
- * conversion, an error message is left in the interpreter's result
- * unless "interp" is NULL.
- *
- * Side effects:
- * The object gets converted by Tcl_GetIndexFromObj.
- *
- *---------------------------------------------------------------------------
- */
-int
-Tk_GetJustifyFromObj(
- Tcl_Interp *interp, /* Used for error reporting. */
- Tcl_Obj *objPtr, /* The object we are trying to get the
- * value from. */
- Tk_Justify *justifyPtr) /* Where to place the Tk_Justify that
- * corresponds to the string value of
- * objPtr. */
-{
- return Tk_GetJustify(interp, Tcl_GetString(objPtr), justifyPtr);
-}
-/*
- *---------------------------------------------------------------------------
- *
- * Tk_GetReliefFromObj --
- *
- * Return an integer value based on the value of the objPtr.
- *
- * Results:
- * The return value is a standard TCL result. If an error occurs during
- * conversion, an error message is left in the interpreter's result
- * unless "interp" is NULL.
- *
- * Side effects:
- * The object gets converted by Tcl_GetIndexFromObj.
- *
- *---------------------------------------------------------------------------
- */
-int
-Tk_GetReliefFromObj(
- Tcl_Interp *interp, /* Used for error reporting. */
- Tcl_Obj *objPtr, /* The object we are trying to get the
- * value from. */
- int *reliefPtr) /* Where to place the answer. */
-{
- return Tk_GetRelief(interp, Tcl_GetString(objPtr), reliefPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Tk_Alloc3DBorderFromObj --
- *
- * Given a Tcl_Obj *, map the value to a corresponding
- * Tk_3DBorder structure based on the tkwin given.
- *
- * Results:
- * The return value is a token for a data structure describing a
- * 3-D border. This token may be passed to procedures such as
- * Blt_Draw3DRectangle and Tk_Free3DBorder. If an error prevented
- * the border from being created then NULL is returned and an error
- * message will be left in the interp's result.
- *
- * Side effects:
- * The border is added to an internal database with a reference
- * count. For each call to this procedure, there should eventually
- * be a call to FreeBorderObjProc so that the database is
- * cleaned up when borders aren't in use anymore.
- *
- *---------------------------------------------------------------------------
- */
-Tk_3DBorder
-Tk_Alloc3DBorderFromObj(
- Tcl_Interp *interp, /* Interp for error results. */
- Tk_Window tkwin, /* Need the screen the border is used on.*/
- Tcl_Obj *objPtr) /* Object giving name of color for window
- * background. */
-{
- return Tk_Get3DBorder(interp, tkwin, Tcl_GetString(objPtr));
-}
-/*
- *---------------------------------------------------------------------------
- *
- * Tk_AllocBitmapFromObj --
- *
- * Given a Tcl_Obj *, map the value to a corresponding
- * Pixmap structure based on the tkwin given.
- *
- * Results:
- * The return value is the X identifer for the desired bitmap
- * (i.e. a Pixmap with a single plane), unless string couldn't be
- * parsed correctly. In this case, None is returned and an error
- * message is left in the interp's result. The caller should never
- * modify the bitmap that is returned, and should eventually call
- * Tk_FreeBitmapFromObj when the bitmap is no longer needed.
- *
- * Side effects:
- * The bitmap is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeBitmapFromObj, so that the database can be cleaned up
- * when bitmaps aren't needed anymore.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Tk_AllocBitmapFromObj(
- Tcl_Interp *interp, /* Interp for error results. This may
- * be NULL. */
- Tk_Window tkwin, /* Need the screen the bitmap is used on.*/
- Tcl_Obj *objPtr) /* Object describing bitmap; see manual
- * entry for legal syntax of string value. */
-{
- return Tk_GetBitmap(interp, tkwin, Tcl_GetString(objPtr));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Tk_AllocFontFromObj --
- *
- * Given a string description of a font, map the description to a
- * corresponding Blt_Font that represents the font.
- *
- * Results:
- * The return value is token for the font, or NULL if an error
- * prevented the font from being created. If NULL is returned, an
- * error message will be left in interp's result object.
- *
- * Side effects:
- * The font is added to an internal database with a reference
- * count. For each call to this procedure, there should eventually
- * be a call to Blt_FreeFont() or Blt_FreeFontFromObj() so that the
- * database is cleaned up when fonts aren't in use anymore.
- *
- *---------------------------------------------------------------------------
- */
-Tk_Font
-Tk_AllocFontFromObj(
- Tcl_Interp *interp, /* Interp for database and error return. */
- Tk_Window tkwin, /* For screen on which font will be used. */
- Tcl_Obj *objPtr) /* Object describing font, as: named font,
- * native format, or parseable string. */
-{
- return Tk_GetFont(interp, tkwin, Tcl_GetString(objPtr));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Tk_AllocCursorFromObj --
- *
- * Given a Tcl_Obj *, map the value to a corresponding
- * Tk_Cursor structure based on the tkwin given.
- *
- * Results:
- * The return value is the X identifer for the desired cursor,
- * unless objPtr couldn't be parsed correctly. In this case,
- * None is returned and an error message is left in the interp's result.
- * The caller should never modify the cursor that is returned, and
- * should eventually call Tk_FreeCursorFromObj when the cursor is no
- * longer needed.
- *
- * Side effects:
- * The cursor is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeCursorFromObj, so that the database can be cleaned up
- * when cursors aren't needed anymore.
- *
- *---------------------------------------------------------------------------
- */
-Tk_Cursor
-Tk_AllocCursorFromObj(
- Tcl_Interp *interp, /* Interp for error results. */
- Tk_Window tkwin, /* Window in which the cursor will be used.*/
- Tcl_Obj *objPtr) /* Object describing cursor; see manual
- * entry for description of legal
- * syntax of this obj's string rep. */
-{
- return Tk_GetCursor(interp, tkwin, Tcl_GetString(objPtr));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Tk_AllocColorFromObj --
- *
- * Given a Tcl_Obj *, map the value to a corresponding
- * XColor structure based on the tkwin given.
- *
- * Results:
- * The return value is a pointer to an XColor structure that
- * indicates the red, blue, and green intensities for the color
- * given by the string in objPtr, and also specifies a pixel value
- * to use to draw in that color. If an error occurs, NULL is
- * returned and an error message will be left in interp's result
- * (unless interp is NULL).
- *
- * Side effects:
- * The color is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeColorFromObj so that the database is cleaned up when colors
- * aren't in use anymore.
- *
- *---------------------------------------------------------------------------
- */
-XColor *
-Tk_AllocColorFromObj(
- Tcl_Interp *interp, /* Used only for error reporting. If NULL,
- * then no messages are provided. */
- Tk_Window tkwin, /* Window in which the color will be used.*/
- Tcl_Obj *objPtr) /* Object that describes the color; string
- * value is a color name such as "red" or
- * "#ff0000".*/
-{
- const char *string;
-
- string = Tcl_GetString(objPtr);
- return Tk_GetColor(interp, tkwin, Tk_GetUid(string));
-}
-#endif
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPositionFromObj --
- *
- * Convert a string representing a numeric position.
- * A position can be in one of the following forms.
- *
- * number - number of the item in the hierarchy, indexed
- * from zero.
- * "end" - last position in the hierarchy.
- *
- * Results:
- * A standard TCL result. If "string" is a valid index, then
- * *indexPtr is filled with the corresponding numeric index.
- * If "end" was selected then *indexPtr is set to -1.
- * Otherwise an error message is left in interp->result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetPositionFromObj(
- Tcl_Interp *interp, /* Interpreter to report results back
- * to. */
- Tcl_Obj *objPtr, /* Tcl_Obj representation of the index.
- * Can be an integer or "end" to refer
- * to the last index. */
- long *indexPtr) /* Holds the converted index. */
-{
- const char *string;
-
- string = Tcl_GetString(objPtr);
- if ((string[0] == 'e') && (strcmp(string, "end") == 0)) {
- *indexPtr = -1; /* Indicates last position in hierarchy. */
- } else {
- long position;
-
- if (Tcl_GetLongFromObj(interp, objPtr, &position) != TCL_OK) {
- return TCL_ERROR;
- }
- if (position < 0) {
- Tcl_AppendResult(interp, "bad position \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- *indexPtr = position;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPixelsFromObj --
- *
- * Like Tk_GetPixelsFromObj, but checks for negative, zero.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetPixelsFromObj(
- Tcl_Interp *interp,
- Tk_Window tkwin,
- Tcl_Obj *objPtr,
- int check, /* Can be PIXELS_POS, PIXELS_NNEG,
- * or PIXELS_ANY, */
- int *valuePtr)
-{
- int length;
-
- if (Tk_GetPixelsFromObj(interp, tkwin, objPtr, &length) != TCL_OK) {
- return TCL_ERROR;
- }
- if (length >= SHRT_MAX) {
- Tcl_AppendResult(interp, "bad distance \"", Tcl_GetString(objPtr),
- "\": too big to represent", (char *)NULL);
- return TCL_ERROR;
- }
- switch (check) {
- case PIXELS_NNEG:
- if (length < 0) {
- Tcl_AppendResult(interp, "bad distance \"", Tcl_GetString(objPtr),
- "\": can't be negative", (char *)NULL);
- return TCL_ERROR;
- }
- break;
-
- case PIXELS_POS:
- if (length <= 0) {
- Tcl_AppendResult(interp, "bad distance \"", Tcl_GetString(objPtr),
- "\": must be positive", (char *)NULL);
- return TCL_ERROR;
- }
- break;
-
- case PIXELS_ANY:
- break;
- }
- *valuePtr = length;
- return TCL_OK;
-}
-
-int
-Blt_GetPadFromObj(
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Window */
- Tcl_Obj *objPtr, /* Pixel value string */
- Blt_Pad *padPtr)
-{
- int side1, side2;
- int objc;
- Tcl_Obj **objv;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((objc < 1) || (objc > 2)) {
- Tcl_AppendResult(interp, "wrong # elements in padding list",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Blt_GetPixelsFromObj(interp, tkwin, objv[0], PIXELS_NNEG,
- &side1) != TCL_OK) {
- return TCL_ERROR;
- }
- side2 = side1;
- if ((objc > 1) &&
- (Blt_GetPixelsFromObj(interp, tkwin, objv[1], PIXELS_NNEG,
- &side2) != TCL_OK)) {
- return TCL_ERROR;
- }
- /* Don't update the pad structure until we know both values are okay. */
- padPtr->side1 = side1;
- padPtr->side2 = side2;
- return TCL_OK;
-}
-
-int
-Blt_GetStateFromObj(
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tcl_Obj *objPtr, /* Pixel value string */
- int *statePtr)
-{
- char c;
- const char *string;
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'n') && (strncmp(string, "normal", length) == 0)) {
- *statePtr = STATE_NORMAL;
- } else if ((c == 'd') && (strncmp(string, "disabled", length) == 0)) {
- *statePtr = STATE_DISABLED;
- } else if ((c == 'a') && (strncmp(string, "active", length) == 0)) {
- *statePtr = STATE_ACTIVE;
- } else {
- Tcl_AppendResult(interp, "bad state \"", string,
- "\": should be normal, active, or disabled", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-const char *
-Blt_NameOfState(int state)
-{
- switch (state) {
- case STATE_ACTIVE:
- return "active";
- case STATE_DISABLED:
- return "disabled";
- case STATE_NORMAL:
- return "normal";
- default:
- return "???";
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_NameOfFill --
- *
- * Converts the integer representing the fill style into a string.
- *
- *---------------------------------------------------------------------------
- */
-const char *
-Blt_NameOfFill(int fill)
-{
- switch (fill) {
- case FILL_X:
- return "x";
- case FILL_Y:
- return "y";
- case FILL_NONE:
- return "none";
- case FILL_BOTH:
- return "both";
- default:
- return "unknown value";
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetFillFromObj --
- *
- * Converts the fill style string into its numeric representation.
- *
- * Valid style strings are:
- *
- * "none" Use neither plane.
- * "x" X-coordinate plane.
- * "y" Y-coordinate plane.
- * "both" Use both coordinate planes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-Blt_GetFillFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *fillPtr)
-{
- char c;
- const char *string;
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'n') && (strncmp(string, "none", length) == 0)) {
- *fillPtr = FILL_NONE;
- } else if ((c == 'x') && (strncmp(string, "x", length) == 0)) {
- *fillPtr = FILL_X;
- } else if ((c == 'y') && (strncmp(string, "y", length) == 0)) {
- *fillPtr = FILL_Y;
- } else if ((c == 'b') && (strncmp(string, "both", length) == 0)) {
- *fillPtr = FILL_BOTH;
- } else {
- Tcl_AppendResult(interp, "bad argument \"", string,
- "\": should be \"none\", \"x\", \"y\", or \"both\"", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_NameOfResize --
- *
- * Converts the resize value into its string representation.
- *
- * Results:
- * Returns a pointer to the static name string.
- *
- *---------------------------------------------------------------------------
- */
-const char *
-Blt_NameOfResize(int resize)
-{
- switch (resize & RESIZE_BOTH) {
- case RESIZE_NONE:
- return "none";
- case RESIZE_EXPAND:
- return "expand";
- case RESIZE_SHRINK:
- return "shrink";
- case RESIZE_BOTH:
- return "both";
- default:
- return "unknown resize value";
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetResizeFromObj --
- *
- * Converts the resize string into its numeric representation.
- *
- * Valid style strings are:
- *
- * "none"
- * "expand"
- * "shrink"
- * "both"
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-Blt_GetResizeFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *resizePtr)
-{
- char c;
- const char *string;
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'n') && (strncmp(string, "none", length) == 0)) {
- *resizePtr = RESIZE_NONE;
- } else if ((c == 'b') && (strncmp(string, "both", length) == 0)) {
- *resizePtr = RESIZE_BOTH;
- } else if ((c == 'e') && (strncmp(string, "expand", length) == 0)) {
- *resizePtr = RESIZE_EXPAND;
- } else if ((c == 's') && (strncmp(string, "shrink", length) == 0)) {
- *resizePtr = RESIZE_SHRINK;
- } else {
- Tcl_AppendResult(interp, "bad resize argument \"", string,
- "\": should be \"none\", \"expand\", \"shrink\", or \"both\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetDashesFromObj --
- *
- * Converts a TCL list of dash values into a dash list ready for
- * use with XSetDashes.
- *
- * A valid list dash values can have zero through 11 elements
- * (PostScript limit). Values must be between 1 and 255. Although
- * a list of 0 (like the empty string) means no dashes.
- *
- * Results:
- * A standard TCL result. If the list represented a valid dash
- * list TCL_OK is returned and *dashesPtr* will contain the
- * valid dash list. Otherwise, TCL_ERROR is returned and
- * interp->result will contain an error message.
- *
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetDashesFromObj(
- Tcl_Interp *interp,
- Tcl_Obj *objPtr,
- Blt_Dashes *dashesPtr)
-{
- const char *string;
- char c;
-
- string = Tcl_GetString(objPtr);
- if (string == NULL) {
- dashesPtr->values[0] = 0;
- return TCL_OK;
- }
- c = string[0];
- if (c == '\0') {
- dashesPtr->values[0] = 0;
- } else if ((c == 'd') && (strcmp(string, "dot") == 0)) {
- /* 1 */
- dashesPtr->values[0] = 1;
- dashesPtr->values[1] = 0;
- } else if ((c == 'd') && (strcmp(string, "dash") == 0)) {
- /* 5 2 */
- dashesPtr->values[0] = 5;
- dashesPtr->values[1] = 2;
- dashesPtr->values[2] = 0;
- } else if ((c == 'd') && (strcmp(string, "dashdot") == 0)) {
- /* 2 4 2 */
- dashesPtr->values[0] = 2;
- dashesPtr->values[1] = 4;
- dashesPtr->values[2] = 2;
- dashesPtr->values[3] = 0;
- } else if ((c == 'd') && (strcmp(string, "dashdotdot") == 0)) {
- /* 2 4 2 2 */
- dashesPtr->values[0] = 2;
- dashesPtr->values[1] = 4;
- dashesPtr->values[2] = 2;
- dashesPtr->values[3] = 2;
- dashesPtr->values[4] = 0;
- } else {
- int objc;
- Tcl_Obj **objv;
- int i;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc > 11) { /* This is the postscript limit */
- Tcl_AppendResult(interp, "too many values in dash list \"",
- string, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- for (i = 0; i < objc; i++) {
- int value;
-
- if (Tcl_GetIntFromObj(interp, objv[i], &value) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Backward compatibility:
- * Allow list of 0 to turn off dashes
- */
- if ((value == 0) && (objc == 1)) {
- break;
- }
- if ((value < 1) || (value > 255)) {
- Tcl_AppendResult(interp, "dash value \"",
- Tcl_GetString(objv[i]), "\" is out of range",
- (char *)NULL);
- return TCL_ERROR;
- }
- dashesPtr->values[i] = (unsigned char)value;
- }
- /* Make sure the array ends with a NUL byte */
- dashesPtr->values[i] = 0;
- }
- return TCL_OK;
-}
-
-const char *
-Blt_NameOfSide(int side)
-{
- switch (side) {
- case SIDE_LEFT:
- return "left";
- case SIDE_RIGHT:
- return "right";
- case SIDE_BOTTOM:
- return "bottom";
- case SIDE_TOP:
- return "top";
- }
- return "unknown side value";
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetSideFromObj --
- *
- * Converts the fill style string into its numeric representation.
- *
- * Valid style strings are "left", "right", "top", or "bottom".
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED */
-int
-Blt_GetSideFromObj(
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tcl_Obj *objPtr, /* Value string */
- int *sidePtr) /* (out) Token representing side:
- * either SIDE_LEFT, SIDE_RIGHT,
- * SIDE_TOP, or SIDE_BOTTOM. */
-{
- char c;
- const char *string;
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'l') && (strncmp(string, "left", length) == 0)) {
- *sidePtr = SIDE_LEFT;
- } else if ((c == 'r') && (strncmp(string, "right", length) == 0)) {
- *sidePtr = SIDE_RIGHT;
- } else if ((c == 't') && (strncmp(string, "top", length) == 0)) {
- *sidePtr = SIDE_TOP;
- } else if ((c == 'b') && (strncmp(string, "bottom", length) == 0)) {
- *sidePtr = SIDE_BOTTOM;
- } else {
- Tcl_AppendResult(interp, "bad side \"", string,
- "\": should be left, right, top, or bottom", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ResetLimits --
- *
- * Resets the limits to their default values.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ResetLimits(Blt_Limits *limitsPtr) /* Limits to be imposed on the value */
-{
- limitsPtr->flags = 0;
- limitsPtr->min = LIMITS_MIN;
- limitsPtr->max = LIMITS_MAX;
- limitsPtr->nom = LIMITS_NOM;
-}
-
-int
-Blt_GetLimitsFromObj(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr,
- Blt_Limits *limitsPtr)
-{
- int values[3];
- int nValues;
- int limitsFlags;
-
- /* Initialize limits to default values */
- values[2] = LIMITS_NOM;
- values[1] = LIMITS_MAX;
- values[0] = LIMITS_MIN;
- limitsFlags = 0;
- nValues = 0;
- if (objPtr != NULL) {
- Tcl_Obj **objv;
- int objc;
- int i;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc > 3) {
- Tcl_AppendResult(interp, "wrong # limits \"", Tcl_GetString(objPtr),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- for (i = 0; i < objc; i++) {
- const char *string;
- int size;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] == '\0') {
- continue; /* Empty string: use default value */
- }
- limitsFlags |= (1 << i);
- if (Tk_GetPixelsFromObj(interp, tkwin, objv[i], &size) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((size < LIMITS_MIN) || (size > LIMITS_MAX)) {
- Tcl_AppendResult(interp, "bad limit \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- values[i] = size;
- }
- nValues = objc;
- }
- /*
- * Check the limits specified. We can't check the requested size of
- * widgets.
- */
- switch (nValues) {
- case 1:
- limitsFlags |= (LIMITS_MIN_SET | LIMITS_MAX_SET);
- values[1] = values[0]; /* Set minimum and maximum to value */
- break;
-
- case 2:
- if (values[1] < values[0]) {
- Tcl_AppendResult(interp, "bad range \"", Tcl_GetString(objPtr),
- "\": min > max", (char *)NULL);
- return TCL_ERROR; /* Minimum is greater than maximum */
- }
- break;
-
- case 3:
- if (values[1] < values[0]) {
- Tcl_AppendResult(interp, "bad range \"", Tcl_GetString(objPtr),
- "\": min > max", (char *)NULL);
- return TCL_ERROR; /* Minimum is greater than maximum */
- }
- if ((values[2] < values[0]) || (values[2] > values[1])) {
- Tcl_AppendResult(interp, "nominal value \"", Tcl_GetString(objPtr),
- "\" out of range", (char *)NULL);
- return TCL_ERROR; /* Nominal is outside of range defined
- * by minimum and maximum */
- }
- break;
- }
- limitsPtr->min = values[0];
- limitsPtr->max = values[1];
- limitsPtr->nom = values[2];
- limitsPtr->flags = limitsFlags;
- return TCL_OK;
-}
-
-/* Configuration option helper routines */
-
-/*
- *---------------------------------------------------------------------------
- *
- * DoConfig --
- *
- * This procedure applies a single configuration option
- * to a widget record.
- *
- * Results:
- * A standard TCL return value.
- *
- * Side effects:
- * WidgRec is modified as indicated by specPtr and value.
- * The old value is recycled, if that is appropriate for
- * the value type.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DoConfig(
- Tcl_Interp *interp, /* Interpreter for error reporting. */
- Tk_Window tkwin, /* Window containing widget (needed to
- * set up X resources). */
- Blt_ConfigSpec *sp, /* Specifier to apply. */
- Tcl_Obj *objPtr, /* Value to use to fill in widgRec. */
- char *widgRec) /* Record whose fields are to be
- * modified. Values must be properly
- * initialized. */
-{
- char *ptr;
- int objIsEmpty;
-
- objIsEmpty = FALSE;
- if (objPtr == NULL) {
- objIsEmpty = TRUE;
- } else if (sp->specFlags & BLT_CONFIG_NULL_OK) {
- int length;
-
- if (objPtr->bytes != NULL) {
- length = objPtr->length;
- } else {
- Tcl_GetStringFromObj(objPtr, &length);
- }
- objIsEmpty = (length == 0);
- }
- do {
- ptr = widgRec + sp->offset;
- switch (sp->type) {
- case BLT_CONFIG_ANCHOR:
- {
- Tk_Anchor anchor;
-
- if (Tk_GetAnchorFromObj(interp, objPtr, &anchor) != TCL_OK) {
- return TCL_ERROR;
- }
- *(Tk_Anchor *)ptr = anchor;
- }
- break;
-
- case BLT_CONFIG_BITMAP:
- {
- Pixmap bitmap;
-
- if (objIsEmpty) {
- bitmap = None;
- } else {
- bitmap = Tk_AllocBitmapFromObj(interp, tkwin, objPtr);
- if (bitmap == None) {
- return TCL_ERROR;
- }
- }
- if (*(Pixmap *)ptr != None) {
- Tk_FreeBitmap(Tk_Display(tkwin), *(Pixmap *)ptr);
- }
- *(Pixmap *)ptr = bitmap;
- }
- break;
-
- case BLT_CONFIG_BOOLEAN:
- {
- int bool;
-
- if (Tcl_GetBooleanFromObj(interp, objPtr, &bool) != TCL_OK) {
- return TCL_ERROR;
- }
- *(int *)ptr = bool;
- }
- break;
-
- case BLT_CONFIG_BORDER:
- {
- Tk_3DBorder border;
-
- if (objIsEmpty) {
- border = NULL;
- } else {
- border = Tk_Alloc3DBorderFromObj(interp, tkwin, objPtr);
- if (border == NULL) {
- return TCL_ERROR;
- }
- }
- if (*(Tk_3DBorder *)ptr != NULL) {
- Tk_Free3DBorder(*(Tk_3DBorder *)ptr);
- }
- *(Tk_3DBorder *)ptr = border;
- }
- break;
-
- case BLT_CONFIG_CAP_STYLE:
- {
- int cap;
- Tk_Uid uid;
-
- uid = Tk_GetUid(Tcl_GetString(objPtr));
- if (Tk_GetCapStyle(interp, uid, &cap) != TCL_OK) {
- return TCL_ERROR;
- }
- *(int *)ptr = cap;
- }
- break;
-
- case BLT_CONFIG_COLOR:
- {
- XColor *color;
-
- if (objIsEmpty) {
- color = NULL;
- } else {
- color = Tk_GetColor(interp, tkwin,
- Tk_GetUid(Tcl_GetString(objPtr)));
- if (color == NULL) {
- return TCL_ERROR;
- }
- }
- if (*(XColor **)ptr != NULL) {
- Tk_FreeColor(*(XColor **)ptr);
- }
- *(XColor **)ptr = color;
- }
- break;
-
- case BLT_CONFIG_CURSOR:
- case BLT_CONFIG_ACTIVE_CURSOR:
- {
- Tk_Cursor cursor;
-
- if (objIsEmpty) {
- cursor = None;
- } else {
- cursor = Tk_AllocCursorFromObj(interp, tkwin, objPtr);
- if (cursor == None) {
- return TCL_ERROR;
- }
- }
- if (*(Tk_Cursor *)ptr != None) {
- Tk_FreeCursor(Tk_Display(tkwin), *(Tk_Cursor *)ptr);
- }
- *(Tk_Cursor *)ptr = cursor;
- if (sp->type == BLT_CONFIG_ACTIVE_CURSOR) {
- Tk_DefineCursor(tkwin, cursor);
- }
- }
- break;
-
- case BLT_CONFIG_CUSTOM:
- if ((*sp->customPtr->parseProc)(sp->customPtr->clientData, interp,
- tkwin, objPtr, widgRec, sp->offset, sp->specFlags) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
-
- case BLT_CONFIG_DOUBLE:
- {
- double value;
-
- if (Tcl_GetDoubleFromObj(interp, objPtr, &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(double *)ptr = value;
- }
- break;
-
- case BLT_CONFIG_FONT:
- {
- Blt_Font font;
-
- if (objIsEmpty) {
- font = NULL;
- } else {
- font = Blt_AllocFontFromObj(interp, tkwin, objPtr);
- if (font == NULL) {
- return TCL_ERROR;
- }
- }
- if (*(Blt_Font *)ptr != NULL) {
- Blt_FreeFont(*(Blt_Font *)ptr);
- }
- *(Blt_Font *)ptr = font;
- }
- break;
-
- case BLT_CONFIG_TK_FONT:
- {
- Tk_Font font;
-
- if (objIsEmpty) {
- font = NULL;
- } else {
- font = Tk_AllocFontFromObj(interp, tkwin, objPtr);
- if (font == NULL) {
- return TCL_ERROR;
- }
- }
- if (*(Tk_Font *)ptr != NULL) {
- Tk_FreeFont(*(Tk_Font *)ptr);
- }
- *(Tk_Font *)ptr = font;
- }
- break;
-
- case BLT_CONFIG_INT:
- {
- int value;
-
- if (Tcl_GetIntFromObj(interp, objPtr, &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(int *)ptr = value;
- }
- break;
-
- case BLT_CONFIG_JOIN_STYLE:
- {
- int join;
- Tk_Uid uid;
-
- uid = Tk_GetUid(Tcl_GetString(objPtr));
- if (Tk_GetJoinStyle(interp, uid, &join) != TCL_OK) {
- return TCL_ERROR;
- }
- *(int *)ptr = join;
- }
- break;
-
- case BLT_CONFIG_JUSTIFY:
- {
- Tk_Justify justify;
-
- if (Tk_GetJustifyFromObj(interp, objPtr, &justify) != TCL_OK) {
- return TCL_ERROR;
- }
- *(Tk_Justify *)ptr = justify;
- }
- break;
-
- case BLT_CONFIG_MM:
- {
- double value;
-
- if (Tk_GetMMFromObj(interp, tkwin, objPtr, &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(double *)ptr = value;
- }
- break;
-
-
- case BLT_CONFIG_RELIEF:
- {
- int relief;
-
- if (Tk_GetReliefFromObj(interp, objPtr, &relief) != TCL_OK) {
- return TCL_ERROR;
- }
- *(int *)ptr = relief;
- }
- break;
-
- case BLT_CONFIG_STRING:
- {
- char *value;
-
- value = (objIsEmpty) ? NULL :
- Blt_AssertStrdup(Tcl_GetString(objPtr));
- if (*(char **)ptr != NULL) {
- Blt_Free(*(char **)ptr);
- }
- *(char **)ptr = value;
- }
- break;
-
- case BLT_CONFIG_UID:
- if (*(Blt_Uid *)ptr != NULL) {
- Blt_FreeUid(*(Blt_Uid *)ptr);
- }
- if (objIsEmpty) {
- *(Blt_Uid *)ptr = NULL;
- } else {
- *(Blt_Uid *)ptr = Blt_GetUid(Tcl_GetString(objPtr));
- }
- break;
-
- case BLT_CONFIG_WINDOW:
- {
- Tk_Window tkwin2;
-
- if (objIsEmpty) {
- tkwin2 = None;
- } else {
- const char *path;
-
- path = Tcl_GetString(objPtr);
- tkwin2 = Tk_NameToWindow(interp, path, tkwin);
- if (tkwin2 == NULL) {
- return TCL_ERROR;
- }
- }
- *(Tk_Window *)ptr = tkwin2;
- }
- break;
-
- case BLT_CONFIG_BITMASK:
- {
- int bool;
- unsigned long mask, flags;
-
- if (Tcl_GetBooleanFromObj(interp, objPtr, &bool) != TCL_OK) {
- return TCL_ERROR;
- }
- mask = (unsigned long)sp->customPtr;
- flags = *(int *)ptr;
- flags &= ~mask;
- if (bool) {
- flags |= mask;
- }
- *(int *)ptr = flags;
- }
- break;
-
- case BLT_CONFIG_BITMASK_INVERT:
- {
- int bool;
- unsigned long mask, flags;
-
- if (Tcl_GetBooleanFromObj(interp, objPtr, &bool) != TCL_OK) {
- return TCL_ERROR;
- }
- mask = (unsigned long)sp->customPtr;
- flags = *(int *)ptr;
- flags &= ~mask;
- if (!bool) {
- flags |= mask;
- }
- *(int *)ptr = flags;
- }
- break;
-
- case BLT_CONFIG_DASHES:
- if (Blt_GetDashesFromObj(interp, objPtr, (Blt_Dashes *)ptr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- break;
-
-
- case BLT_CONFIG_FILL:
- if (Blt_GetFillFromObj(interp, objPtr, (int *)ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
-
- case BLT_CONFIG_RESIZE:
- if (Blt_GetResizeFromObj(interp, objPtr, (int *)ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
-
- case BLT_CONFIG_FLOAT:
- {
- double value;
-
- if (Tcl_GetDoubleFromObj(interp, objPtr, &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(float *)ptr = (float)value;
- }
- break;
-
- case BLT_CONFIG_INT_NNEG:
- {
- long value;
-
- if (Blt_GetCountFromObj(interp, objPtr, COUNT_NNEG,
- &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(int *)ptr = (int)value;
- }
- break;
-
-
- case BLT_CONFIG_INT_POS:
- {
- long value;
-
- if (Blt_GetCountFromObj(interp, objPtr, COUNT_POS, &value)
- != TCL_OK) {
- return TCL_ERROR;
- }
- *(int *)ptr = (int)value;
- }
- break;
-
-
- case BLT_CONFIG_LIST:
- {
- const char **argv;
- int argc;
-
- if (Tcl_SplitList(interp, Tcl_GetString(objPtr), &argc, &argv)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (*(char ***)ptr != NULL) {
- Blt_Free(*(char ***)ptr);
- }
- *(const char ***)ptr = argv;
- }
- break;
-
- case BLT_CONFIG_LONG:
- {
- long value;
-
- if (Tcl_GetLongFromObj(interp, objPtr, &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(long *)ptr = value;
- }
- break;
-
- case BLT_CONFIG_LONG_NNEG:
- {
- long value;
-
- if (Blt_GetCountFromObj(interp, objPtr, COUNT_NNEG,
- &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(long *)ptr = value;
- }
- break;
-
-
- case BLT_CONFIG_LONG_POS:
- {
- long value;
-
- if (Blt_GetCountFromObj(interp, objPtr, COUNT_POS, &value)
- != TCL_OK) {
- return TCL_ERROR;
- }
- *(long *)ptr = value;
- }
- break;
-
- case BLT_CONFIG_OBJ:
- {
- Tcl_IncrRefCount(objPtr);
- if (*(Tcl_Obj **)ptr != NULL) {
- Tcl_DecrRefCount(*(Tcl_Obj **)ptr);
- }
- *(Tcl_Obj **)ptr = objPtr;
- }
- break;
-
- case BLT_CONFIG_PAD:
- if (Blt_GetPadFromObj(interp, tkwin, objPtr, (Blt_Pad *)ptr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- break;
-
- case BLT_CONFIG_PIXELS_NNEG:
- {
- int value;
-
- if (Blt_GetPixelsFromObj(interp, tkwin, objPtr,
- PIXELS_NNEG, &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(int *)ptr = value;
- }
- break;
-
- case BLT_CONFIG_PIXELS:
- {
- int value;
-
- if (Blt_GetPixelsFromObj(interp, tkwin, objPtr, PIXELS_ANY,
- &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(int *)ptr = value;
- }
- break;
-
- case BLT_CONFIG_PIXELS_POS:
- {
- int value;
-
- if (Blt_GetPixelsFromObj(interp, tkwin, objPtr, PIXELS_POS,
- &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(int *)ptr = value;
- }
- break;
-
- case BLT_CONFIG_STATE:
- if (Blt_GetStateFromObj(interp, objPtr, (int *)ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
-
- case BLT_CONFIG_SIDE:
- if (Blt_GetSideFromObj(interp, objPtr, (int *)ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
-
- case BLT_CONFIG_BACKGROUND:
- {
- Blt_Background style;
-
- if (objIsEmpty) {
- style = NULL;
- } else {
- style = Blt_GetBackgroundFromObj(interp, tkwin, objPtr);
- if (style == NULL) {
- return TCL_ERROR;
- }
- }
- if (*(Blt_Background *)ptr != NULL) {
- Blt_FreeBackground(*(Blt_Background *)ptr);
- }
- *(Blt_Background *)ptr = style;
- }
- break;
-
- case BLT_CONFIG_PIX32:
- if (Blt_GetPixelFromObj(interp, objPtr, (Blt_Pixel *)ptr)!=TCL_OK) {
- return TCL_ERROR;
- }
- break;
-
- default:
- Tcl_AppendResult(interp, "bad config table: unknown type ",
- Blt_Itoa(sp->type), (char *)NULL);
- return TCL_ERROR;
- }
- sp++;
- } while ((sp->switchName == NULL) && (sp->type != BLT_CONFIG_END));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FormatConfigValue --
- *
- * This procedure formats the current value of a configuration
- * option.
- *
- * Results:
- * The return value is the formatted value of the option given
- * by specPtr and widgRec. If the value is static, so that it
- * need not be freed, *freeProcPtr will be set to NULL; otherwise
- * *freeProcPtr will be set to the address of a procedure to
- * free the result, and the caller must invoke this procedure
- * when it is finished with the result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static Tcl_Obj *
-FormatConfigValue(
- Tcl_Interp *interp, /* Interpreter for use in real conversions. */
- Tk_Window tkwin, /* Window corresponding to widget. */
- Blt_ConfigSpec *sp, /* Pointer to information describing option.
- * Must not point to a synonym option. */
- char *widgRec) /* Pointer to record holding current
- * values of info for widget. */
-{
- char *ptr;
- const char *string;
-
- ptr = widgRec + sp->offset;
- string = "";
- switch (sp->type) {
- case BLT_CONFIG_ANCHOR:
- string = Tk_NameOfAnchor(*(Tk_Anchor *)ptr);
- break;
-
- case BLT_CONFIG_BITMAP:
- if (*(Pixmap *)ptr != None) {
- string = Tk_NameOfBitmap(Tk_Display(tkwin), *(Pixmap *)ptr);
- }
- break;
-
- case BLT_CONFIG_BOOLEAN:
- return Tcl_NewBooleanObj(*(int *)ptr);
-
- case BLT_CONFIG_BORDER:
- if (*(Tk_3DBorder *)ptr != NULL) {
- string = Tk_NameOf3DBorder(*(Tk_3DBorder *)ptr);
- }
- break;
-
- case BLT_CONFIG_CAP_STYLE:
- string = Tk_NameOfCapStyle(*(int *)ptr);
- break;
-
- case BLT_CONFIG_COLOR:
- if (*(XColor **)ptr != NULL) {
- string = Tk_NameOfColor(*(XColor **)ptr);
- }
- break;
-
- case BLT_CONFIG_CURSOR:
- case BLT_CONFIG_ACTIVE_CURSOR:
- if (*(Tk_Cursor *)ptr != None) {
- string = Tk_NameOfCursor(Tk_Display(tkwin), *(Tk_Cursor *)ptr);
- }
- break;
-
- case BLT_CONFIG_CUSTOM:
- return (*sp->customPtr->printProc)
- (sp->customPtr->clientData, interp, tkwin, widgRec,
- sp->offset, sp->specFlags);
-
- case BLT_CONFIG_DOUBLE:
- return Tcl_NewDoubleObj(*(double *)ptr);
-
- case BLT_CONFIG_FONT:
- if (*(Blt_Font *)ptr != NULL) {
- string = Blt_NameOfFont(*(Blt_Font *)ptr);
- }
- break;
-
- case BLT_CONFIG_TK_FONT:
- if (*(Tk_Font *)ptr != NULL) {
- string = Tk_NameOfFont(*(Tk_Font *)ptr);
- }
- break;
-
- case BLT_CONFIG_INT:
- return Tcl_NewIntObj(*(int *)ptr);
-
- case BLT_CONFIG_JOIN_STYLE:
- string = Tk_NameOfJoinStyle(*(int *)ptr);
- break;
-
- case BLT_CONFIG_JUSTIFY:
- string = Tk_NameOfJustify(*(Tk_Justify *)ptr);
- break;
-
- case BLT_CONFIG_MM:
- return Tcl_NewDoubleObj(*(double *)ptr);
-
- case BLT_CONFIG_PIXELS:
- case BLT_CONFIG_PIXELS_POS:
- case BLT_CONFIG_PIXELS_NNEG:
- return Tcl_NewIntObj(*(int *)ptr);
-
- case BLT_CONFIG_RELIEF:
- string = Tk_NameOfRelief(*(int *)ptr);
- break;
-
- case BLT_CONFIG_STRING:
- case BLT_CONFIG_UID:
- if (*(char **)ptr != NULL) {
- string = *(char **)ptr;
- }
- break;
-
- case BLT_CONFIG_BITMASK:
- {
- unsigned long flag;
-
- flag = (*(unsigned long *)ptr) & (unsigned long)sp->customPtr;
- return Tcl_NewBooleanObj((flag != 0));
- }
-
- case BLT_CONFIG_BITMASK_INVERT:
- {
- unsigned long flag;
-
- flag = (*(unsigned long *)ptr) & (unsigned long)sp->customPtr;
- return Tcl_NewBooleanObj((flag == 0));
- }
-
- case BLT_CONFIG_DASHES:
- {
- unsigned char *p;
- Tcl_Obj *listObjPtr;
- Blt_Dashes *dashesPtr = (Blt_Dashes *)ptr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for(p = dashesPtr->values; *p != 0; p++) {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(*p));
- }
- return listObjPtr;
- }
-
- case BLT_CONFIG_INT_NNEG:
- case BLT_CONFIG_INT_POS:
- return Tcl_NewIntObj(*(int *)ptr);
-
- case BLT_CONFIG_FILL:
- string = Blt_NameOfFill(*(int *)ptr);
- break;
-
- case BLT_CONFIG_RESIZE:
- string = Blt_NameOfResize(*(int *)ptr);
- break;
-
- case BLT_CONFIG_FLOAT:
- {
- double x = *(float *)ptr;
- return Tcl_NewDoubleObj(x);
- }
-
- case BLT_CONFIG_LIST:
- {
- Tcl_Obj *objPtr, *listObjPtr;
- char *const *p;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (p = *(char ***)ptr; *p != NULL; p++) {
- objPtr = Tcl_NewStringObj(*p, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- return listObjPtr;
- }
-
- case BLT_CONFIG_LONG:
- return Tcl_NewLongObj(*(long *)ptr);
-
- case BLT_CONFIG_LONG_NNEG:
- case BLT_CONFIG_LONG_POS:
- return Tcl_NewLongObj(*(long *)ptr);
-
- case BLT_CONFIG_OBJ:
- if (*(Tcl_Obj **)ptr != NULL) {
- return *(Tcl_Obj **)ptr;
- }
- break;
-
- case BLT_CONFIG_PAD:
- {
- Blt_Pad *padPtr = (Blt_Pad *)ptr;
- Tcl_Obj *objPtr, *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- objPtr = Tcl_NewIntObj(padPtr->side1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewIntObj(padPtr->side2);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- return listObjPtr;
- }
-
- case BLT_CONFIG_STATE:
- string = Blt_NameOfState(*(int *)ptr);
- break;
-
- case BLT_CONFIG_SIDE:
- string = Blt_NameOfSide(*(int *)ptr);
- break;
-
- case BLT_CONFIG_BACKGROUND:
- if (*(Blt_Background *)ptr != NULL) {
- string = Blt_NameOfBackground(*(Blt_Background *)ptr);
- }
- break;
-
- case BLT_CONFIG_PIX32:
- string = Blt_NameOfPixel((Blt_Pixel *)ptr);
- break;
-
- default:
- string = "?? unknown type ??";
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FormatConfigInfo --
- *
- * Create a valid TCL list holding the configuration information
- * for a single configuration option.
- *
- * Results:
- * A TCL list, dynamically allocated. The caller is expected to
- * arrange for this list to be freed eventually.
- *
- * Side effects:
- * Memory is allocated.
- *
- *---------------------------------------------------------------------------
- */
-static Tcl_Obj *
-FormatConfigInfo(
- Tcl_Interp *interp, /* Interpreter to use for things
- * like floating-point precision. */
- Tk_Window tkwin, /* Window corresponding to widget. */
- Blt_ConfigSpec *sp, /* Pointer to information describing
- * option. */
- char *widgRec) /* Pointer to record holding current
- * values of info for widget. */
-{
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (sp->switchName != NULL) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(sp->switchName, -1));
- } else {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("", -1));
- }
- if (sp->dbName != NULL) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(sp->dbName, -1));
- } else {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("", -1));
- }
- if (sp->type == BLT_CONFIG_SYNONYM) {
- return listObjPtr;
- }
- if (sp->dbClass != NULL) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(sp->dbClass, -1));
- } else {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("", -1));
- }
- if (sp->defValue != NULL) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(sp->defValue, -1));
- } else {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("", -1));
- }
- Tcl_ListObjAppendElement(interp, listObjPtr,
- FormatConfigValue(interp, tkwin, sp, widgRec));
- return listObjPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindConfigSpec --
- *
- * Search through a table of configuration specs, looking for
- * one that matches a given switchName.
- *
- * Results:
- * The return value is a pointer to the matching entry, or NULL
- * if nothing matched. In that case an error message is left
- * in the interp's result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_ConfigSpec *
-FindConfigSpec(
- Tcl_Interp *interp, /* Used for reporting errors. */
- Blt_ConfigSpec *specs, /* Pointer to table of configuration
- * specifications for a widget. */
- Tcl_Obj *objPtr, /* Name (suitable for use in a "config"
- * command) identifying particular option. */
- int needFlags, /* Flags that must be present in matching
- * entry. */
- int hateFlags) /* Flags that must NOT be present in
- * matching entry. */
-{
- Blt_ConfigSpec *matchPtr; /* Matching spec, or NULL. */
- Blt_ConfigSpec *sp;
- const char *string;
- char c; /* First character of current argument. */
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[1];
- matchPtr = NULL;
- for (sp = specs; sp->type != BLT_CONFIG_END; sp++) {
- if (sp->switchName == NULL) {
- continue;
- }
- if ((sp->switchName[1] != c) ||
- (strncmp(sp->switchName, string, length) != 0)) {
- continue;
- }
- if (((sp->specFlags & needFlags) != needFlags) ||
- (sp->specFlags & hateFlags)) {
- continue;
- }
- if (sp->switchName[length] == 0) {
- matchPtr = sp;
- goto gotMatch;
- }
- if (matchPtr != NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "ambiguous option \"", string, "\"",
- (char *)NULL);
- }
- return (Blt_ConfigSpec *)NULL;
- }
- matchPtr = sp;
- }
-
- if (matchPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "unknown option \"", string, "\"",
- (char *)NULL);
- }
- return (Blt_ConfigSpec *)NULL;
- }
-
- /*
- * Found a matching entry. If it's a synonym, then find the
- * entry that it's a synonym for.
- */
-
- gotMatch:
- sp = matchPtr;
- if (sp->type == BLT_CONFIG_SYNONYM) {
- for (sp = specs; /*empty*/; sp++) {
- if (sp->type == BLT_CONFIG_END) {
- if (interp != NULL) {
- Tcl_AppendResult(interp,
- "couldn't find synonym for option \"", string, "\"",
- (char *)NULL);
- }
- return (Blt_ConfigSpec *) NULL;
- }
- if ((sp->dbName == matchPtr->dbName) &&
- (sp->type != BLT_CONFIG_SYNONYM) &&
- ((sp->specFlags & needFlags) == needFlags) &&
- !(sp->specFlags & hateFlags)) {
- break;
- }
- }
- }
- return sp;
-}
-
-/* Public routines */
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ConfigureWidgetFromObj --
- *
- * Process command-line options and database options to
- * fill in fields of a widget record with resources and
- * other parameters.
- *
- * Results:
- * A standard TCL return value. In case of an error,
- * the interp's result will hold an error message.
- *
- * Side effects:
- * The fields of widgRec get filled in with information
- * from argc/argv and the option database. Old information
- * in widgRec's fields gets recycled.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_ConfigureWidgetFromObj(
- Tcl_Interp *interp, /* Interpreter for error reporting. */
- Tk_Window tkwin, /* Window containing widget (needed to
- * set up X resources). */
- Blt_ConfigSpec *specs, /* Describes legal options. */
- int objc, /* Number of elements in argv. */
- Tcl_Obj *const *objv, /* Command-line options. */
- char *widgRec, /* Record whose fields are to be
- * modified. Values must be properly
- * initialized. */
- int flags) /* Used to specify additional flags
- * that must be present in config specs
- * for them to be considered. Also,
- * may have BLT_CONFIG_OBJV_ONLY set. */
-{
- Blt_ConfigSpec *sp;
- int needFlags; /* Specs must contain this set of flags
- * or else they are not considered. */
- int hateFlags; /* If a spec contains any bits here, it's
- * not considered. */
- int result;
-
- if (tkwin == NULL) {
- /*
- * Either we're not really in Tk, or the main window was destroyed and
- * we're on our way out of the application
- */
- Tcl_AppendResult(interp, "NULL main window", (char *)NULL);
- return TCL_ERROR;
- }
-
- needFlags = flags & ~(BLT_CONFIG_USER_BIT - 1);
- if (Tk_Depth(tkwin) <= 1) {
- hateFlags = BLT_CONFIG_COLOR_ONLY;
- } else {
- hateFlags = BLT_CONFIG_MONO_ONLY;
- }
-
- /*
- * Pass one: scan through all the option specs, replacing strings
- * with Tk_Uid structs (if this hasn't been done already) and
- * clearing the BLT_CONFIG_OPTION_SPECIFIED flags.
- */
-
- for (sp = specs; sp->type != BLT_CONFIG_END; sp++) {
- if (!(sp->specFlags & INIT) && (sp->switchName != NULL)) {
- if (sp->dbName != NULL) {
- sp->dbName = Tk_GetUid(sp->dbName);
- }
- if (sp->dbClass != NULL) {
- sp->dbClass = Tk_GetUid(sp->dbClass);
- }
- if (sp->defValue != NULL) {
- sp->defValue = Tk_GetUid(sp->defValue);
- }
- }
- sp->specFlags = (sp->specFlags & ~BLT_CONFIG_OPTION_SPECIFIED) | INIT;
- }
-
- /*
- * Pass two: scan through all of the arguments, processing those
- * that match entries in the specs.
- */
- while (objc > 0) {
- sp = FindConfigSpec(interp, specs, objv[0], needFlags, hateFlags);
- if (sp == NULL) {
- return TCL_ERROR;
- }
-
- /* Process the entry. */
- if (objc < 2) {
- Tcl_AppendResult(interp, "value for \"", Tcl_GetString(objv[0]),
- "\" missing", (char *)NULL);
- return TCL_ERROR;
- }
- if (DoConfig(interp, tkwin, sp, objv[1], widgRec) != TCL_OK) {
- char msg[100];
-
- sprintf_s(msg, 100, "\n (processing \"%.40s\" option)",
- sp->switchName);
- Tcl_AddErrorInfo(interp, msg);
- return TCL_ERROR;
- }
- sp->specFlags |= BLT_CONFIG_OPTION_SPECIFIED;
- objc -= 2, objv += 2;
- }
-
- /*
- * Pass three: scan through all of the specs again; if no
- * command-line argument matched a spec, then check for info
- * in the option database. If there was nothing in the
- * database, then use the default.
- */
-
- if ((flags & BLT_CONFIG_OBJV_ONLY) == 0) {
- Tcl_Obj *objPtr;
-
- for (sp = specs; sp->type != BLT_CONFIG_END; sp++) {
- if ((sp->specFlags & BLT_CONFIG_OPTION_SPECIFIED) ||
- (sp->switchName == NULL) || (sp->type == BLT_CONFIG_SYNONYM)) {
- continue;
- }
- if (((sp->specFlags & needFlags) != needFlags) ||
- (sp->specFlags & hateFlags)) {
- continue;
- }
- objPtr = NULL;
- if (sp->dbName != NULL) {
- Tk_Uid value;
-
- /* If a resource name was specified, check if there's
- * also a value was associated with it. This
- * overrides the default value. */
- value = Tk_GetOption(tkwin, sp->dbName, sp->dbClass);
- if (value != NULL) {
- objPtr = Tcl_NewStringObj(value, -1);
- }
- }
-
- if (objPtr != NULL) {
- Tcl_IncrRefCount(objPtr);
- result = DoConfig(interp, tkwin, sp, objPtr, widgRec);
- Tcl_DecrRefCount(objPtr);
- if (result != TCL_OK) {
- char msg[200];
-
- sprintf_s(msg, 200,
- "\n (%s \"%.50s\" in widget \"%.50s\")",
- "database entry for", sp->dbName, Tk_PathName(tkwin));
- Tcl_AddErrorInfo(interp, msg);
- return TCL_ERROR;
- }
- } else if ((sp->defValue != NULL) &&
- ((sp->specFlags & BLT_CONFIG_DONT_SET_DEFAULT) == 0)) {
-
- /* No resource value is found, use the default value. */
- objPtr = Tcl_NewStringObj(sp->defValue, -1);
- Tcl_IncrRefCount(objPtr);
- result = DoConfig(interp, tkwin, sp, objPtr, widgRec);
- Tcl_DecrRefCount(objPtr);
- if (result != TCL_OK) {
- char msg[200];
-
- sprintf_s(msg, 200,
- "\n (%s \"%.50s\" in widget \"%.50s\")",
- "default value for", sp->dbName, Tk_PathName(tkwin));
- Tcl_AddErrorInfo(interp, msg);
- return TCL_ERROR;
- }
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ConfigureInfoFromObj --
- *
- * Return information about the configuration options
- * for a window, and their current values.
- *
- * Results:
- * Always returns TCL_OK. The interp's result will be modified
- * hold a description of either a single configuration option
- * available for "widgRec" via "specs", or all the configuration
- * options available. In the "all" case, the result will
- * available for "widgRec" via "specs". The result will
- * be a list, each of whose entries describes one option.
- * Each entry will itself be a list containing the option's
- * name for use on command lines, database name, database
- * class, default value, and current value (empty string
- * if none). For options that are synonyms, the list will
- * contain only two values: name and synonym name. If the
- * "name" argument is non-NULL, then the only information
- * returned is that for the named argument (i.e. the corresponding
- * entry in the overall list is returned).
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-int
-Blt_ConfigureInfoFromObj(
- Tcl_Interp *interp, /* Interpreter for error reporting. */
- Tk_Window tkwin, /* Window corresponding to widgRec. */
- Blt_ConfigSpec *specs, /* Describes legal options. */
- char *widgRec, /* Record whose fields contain current
- * values for options. */
- Tcl_Obj *objPtr, /* If non-NULL, indicates a single option
- * whose info is to be returned. Otherwise
- * info is returned for all options. */
- int flags) /* Used to specify additional flags
- * that must be present in config specs
- * for them to be considered. */
-{
- Blt_ConfigSpec *sp;
- Tcl_Obj *listObjPtr, *valueObjPtr;
- const char *string;
- int needFlags, hateFlags;
-
- needFlags = flags & ~(BLT_CONFIG_USER_BIT - 1);
- if (Tk_Depth(tkwin) <= 1) {
- hateFlags = BLT_CONFIG_COLOR_ONLY;
- } else {
- hateFlags = BLT_CONFIG_MONO_ONLY;
- }
-
- /*
- * If information is only wanted for a single configuration
- * spec, then handle that one spec specially.
- */
-
- Tcl_SetResult(interp, (char *)NULL, TCL_STATIC);
- if (objPtr != NULL) {
- sp = FindConfigSpec(interp, specs, objPtr, needFlags, hateFlags);
- if (sp == NULL) {
- return TCL_ERROR;
- }
- valueObjPtr = FormatConfigInfo(interp, tkwin, sp, widgRec);
- Tcl_SetObjResult(interp, valueObjPtr);
- return TCL_OK;
- }
-
- /*
- * Loop through all the specs, creating a big list with all
- * their information.
- */
- string = NULL; /* Suppress compiler warning. */
- if (objPtr != NULL) {
- string = Tcl_GetString(objPtr);
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (sp = specs; sp->type != BLT_CONFIG_END; sp++) {
- if ((objPtr != NULL) && (sp->switchName != string)) {
- continue;
- }
- if (((sp->specFlags & needFlags) != needFlags) ||
- (sp->specFlags & hateFlags)) {
- continue;
- }
- if (sp->switchName == NULL) {
- continue;
- }
- valueObjPtr = FormatConfigInfo(interp, tkwin, sp, widgRec);
- Tcl_ListObjAppendElement(interp, listObjPtr, valueObjPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ConfigureValueFromObj --
- *
- * This procedure returns the current value of a configuration
- * option for a widget.
- *
- * Results:
- * The return value is a standard TCL completion code (TCL_OK or
- * TCL_ERROR). The interp's result will be set to hold either the value
- * of the option given by objPtr (if TCL_OK is returned) or
- * an error message (if TCL_ERROR is returned).
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_ConfigureValueFromObj(
- Tcl_Interp *interp, /* Interpreter for error reporting. */
- Tk_Window tkwin, /* Window corresponding to widgRec. */
- Blt_ConfigSpec *specs, /* Describes legal options. */
- char *widgRec, /* Record whose fields contain current
- * values for options. */
- Tcl_Obj *objPtr, /* Gives the command-line name for the
- * option whose value is to be returned. */
- int flags) /* Used to specify additional flags
- * that must be present in config specs
- * for them to be considered. */
-{
- Blt_ConfigSpec *sp;
- int needFlags, hateFlags;
-
- needFlags = flags & ~(BLT_CONFIG_USER_BIT - 1);
- if (Tk_Depth(tkwin) <= 1) {
- hateFlags = BLT_CONFIG_COLOR_ONLY;
- } else {
- hateFlags = BLT_CONFIG_MONO_ONLY;
- }
- sp = FindConfigSpec(interp, specs, objPtr, needFlags, hateFlags);
- if (sp == NULL) {
- return TCL_ERROR;
- }
- objPtr = FormatConfigValue(interp, tkwin, sp, widgRec);
- Tcl_SetObjResult(interp, objPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FreeOptions --
- *
- * Free up all resources associated with configuration options.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Any resource in widgRec that is controlled by a configuration
- * option (e.g. a Tk_3DBorder or XColor) is freed in the appropriate
- * fashion.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FreeOptions(
- Blt_ConfigSpec *specs, /* Describes legal options. */
- char *widgRec, /* Record whose fields contain current
- * values for options. */
- Display *display, /* X display; needed for freeing some
- * resources. */
- int needFlags) /* Used to specify additional flags
- * that must be present in config specs
- * for them to be considered. */
-{
- Blt_ConfigSpec *sp;
-
- for (sp = specs; sp->type != BLT_CONFIG_END; sp++) {
- char *ptr;
-
- if ((sp->specFlags & needFlags) != needFlags) {
- continue;
- }
- ptr = widgRec + sp->offset;
- switch (sp->type) {
- case BLT_CONFIG_STRING:
- if (*((char **) ptr) != NULL) {
- Blt_Free(*((char **) ptr));
- *((char **) ptr) = NULL;
- }
- break;
-
- case BLT_CONFIG_COLOR:
- if (*((XColor **) ptr) != NULL) {
- Tk_FreeColor(*((XColor **) ptr));
- *((XColor **) ptr) = NULL;
- }
- break;
-
- case BLT_CONFIG_FONT:
- if (*((Blt_Font *) ptr) != None) {
- Blt_FreeFont(*((Blt_Font *) ptr));
- *((Blt_Font *) ptr) = NULL;
- }
- break;
-
- case BLT_CONFIG_TK_FONT:
- if (*((Tk_Font *) ptr) != None) {
- Tk_FreeFont(*((Tk_Font *) ptr));
- *((Tk_Font *) ptr) = NULL;
- }
- break;
-
- case BLT_CONFIG_BITMAP:
- if (*((Pixmap *) ptr) != None) {
- Tk_FreeBitmap(display, *((Pixmap *) ptr));
- *((Pixmap *) ptr) = None;
- }
- break;
-
- case BLT_CONFIG_BORDER:
- if (*((Tk_3DBorder *) ptr) != NULL) {
- Tk_Free3DBorder(*((Tk_3DBorder *) ptr));
- *((Tk_3DBorder *) ptr) = NULL;
- }
- break;
-
- case BLT_CONFIG_CURSOR:
- case BLT_CONFIG_ACTIVE_CURSOR:
- if (*((Tk_Cursor *) ptr) != None) {
- Tk_FreeCursor(display, *((Tk_Cursor *) ptr));
- *((Tk_Cursor *) ptr) = None;
- }
- break;
-
- case BLT_CONFIG_OBJ:
- if (*(Tcl_Obj **)ptr != NULL) {
- Tcl_DecrRefCount(*(Tcl_Obj **)ptr);
- *(Tcl_Obj **)ptr = NULL;
- }
- break;
-
- case BLT_CONFIG_LIST:
- if (*((char ***) ptr) != NULL) {
- Blt_Free(*((char ***) ptr));
- *((char ***) ptr) = NULL;
- }
- break;
-
- case BLT_CONFIG_UID:
- if (*(Blt_Uid *)ptr != NULL) {
- Blt_FreeUid(*(Blt_Uid *)ptr);
- *(Blt_Uid *)ptr = NULL;
- }
- break;
-
- case BLT_CONFIG_BACKGROUND:
- if (*((Blt_Background *)ptr) != NULL) {
- Blt_FreeBackground(*((Blt_Background *)ptr));
- *((Blt_Background *)ptr) = NULL;
- }
- break;
-
- case BLT_CONFIG_CUSTOM:
- if ((sp->customPtr->freeProc != NULL) && (*(char **)ptr != NULL)) {
- (*sp->customPtr->freeProc)(sp->customPtr->clientData,
- display, widgRec, sp->offset);
- }
- break;
-
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ConfigModified --
- *
- * Given the configuration specifications and one or more option
- * patterns (terminated by a NULL), indicate if any of the matching
- * configuration options has been reset.
- *
- * Results:
- * Returns 1 if one of the options has changed, 0 otherwise.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_ConfigModified TCL_VARARGS_DEF(Blt_ConfigSpec *, arg1)
-{
- va_list argList;
- Blt_ConfigSpec *specs;
- Blt_ConfigSpec *sp;
- const char *option;
-
- specs = TCL_VARARGS_START(Blt_ConfigSpec *, arg1, argList);
- while ((option = va_arg(argList, const char *)) != NULL) {
- for (sp = specs; sp->type != BLT_CONFIG_END; sp++) {
- if ((Tcl_StringMatch(sp->switchName, option)) &&
- (sp->specFlags & BLT_CONFIG_OPTION_SPECIFIED)) {
- va_end(argList);
- return 1;
- }
- }
- }
- va_end(argList);
- return 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ConfigureComponentFromObj --
- *
- * Configures a component of a widget. This is useful for
- * widgets that have multiple components which aren't uniquely
- * identified by a Tk_Window. It allows us, for example, set
- * resources for axes of the graph widget. The graph really has
- * only one window, but its convenient to specify components in a
- * hierarchy of options.
- *
- * *graph.x.logScale yes
- * *graph.Axis.logScale yes
- * *graph.temperature.scaleSymbols yes
- * *graph.Element.scaleSymbols yes
- *
- * This is really a hack to work around the limitations of the Tk
- * resource database. It creates a temporary window, needed to
- * call Tk_ConfigureWidget, using the name of the component.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * A temporary window is created merely to pass to Tk_ConfigureWidget.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_ConfigureComponentFromObj(
- Tcl_Interp *interp,
- Tk_Window parent, /* Window to associate with component */
- const char *name, /* Name of component */
- const char *className,
- Blt_ConfigSpec *sp,
- int objc,
- Tcl_Obj *const *objv,
- char *widgRec,
- int flags)
-{
- Tk_Window tkwin;
- int result;
- char *tmpName;
- int isTemporary = FALSE;
-
- tmpName = Blt_AssertStrdup(name);
-
- /* Window name can't start with an upper case letter */
- tmpName[0] = tolower(name[0]);
-
- /*
- * Create component if a child window by the component's name
- * doesn't already exist.
- */
- tkwin = Blt_FindChild(parent, tmpName);
- if (tkwin == NULL) {
- tkwin = Tk_CreateWindow(interp, parent, tmpName, (char *)NULL);
- isTemporary = TRUE;
- }
- if (tkwin == NULL) {
- Tcl_AppendResult(interp, "can't find window in \"",
- Tk_PathName(parent), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- assert(Tk_Depth(tkwin) == Tk_Depth(parent));
- Blt_Free(tmpName);
-
- Tk_SetClass(tkwin, className);
- result = Blt_ConfigureWidgetFromObj(interp, tkwin, sp, objc, objv, widgRec,
- flags);
- if (isTemporary) {
- Tk_DestroyWindow(tkwin);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ObjIsOption --
- *
- * Indicates whether objPtr is a valid configuration option
- * such as -background.
- *
- * Results:
- * Returns 1 is a matching option is found and 0 otherwise.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_ObjIsOption(
- Blt_ConfigSpec *specs, /* Describes legal options. */
- Tcl_Obj *objPtr, /* Command-line option name. */
- int flags) /* Used to specify additional flags
- * that must be present in config specs
- * for them to be considered. Also,
- * may have BLT_CONFIG_OBJV_ONLY set. */
-{
- Blt_ConfigSpec *sp;
- int needFlags; /* Specs must contain this set of flags
- * or else they are not considered. */
-
- needFlags = flags & ~(BLT_CONFIG_USER_BIT - 1);
- sp = FindConfigSpec((Tcl_Interp *)NULL, specs, objPtr, needFlags, 0);
- return (sp != NULL);
-}
diff --git a/blt3.0.1/src/bltConfig.h b/blt3.0.1/src/bltConfig.h
deleted file mode 100644
index 7a19e9d..0000000
--- a/blt3.0.1/src/bltConfig.h
+++ /dev/null
@@ -1,406 +0,0 @@
-
-/*
- * bltConfig.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef BLT_CONFIG_H
-#define BLT_CONFIG_H
-
-#ifdef HAVE_STDDEF_H
-# include <stddef.h>
-#endif /* HAVE_STDDEF_H */
-
-#ifndef Blt_Offset
-#ifdef offsetof
-#define Blt_Offset(type, field) ((int) offsetof(type, field))
-#else
-#define Blt_Offset(type, field) ((int) ((char *) &((type *) 0)->field))
-#endif
-#endif /* Blt_Offset */
-
-
-typedef int (Blt_OptionParseProc)(ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, Tcl_Obj *objPtr, char *widgRec, int offset, int flags);
-typedef Tcl_Obj *(Blt_OptionPrintProc)(ClientData clientData,
- Tcl_Interp *interp, Tk_Window tkwin, char *widgRec, int offset,
- int flags);
-typedef void (Blt_OptionFreeProc)(ClientData clientData, Display *display,
- char *widgRec, int offset);
-
-typedef struct Blt_CustomOption {
- Blt_OptionParseProc *parseProc; /* Procedure to call to parse
- * an option and store it in
- * converted form. */
-
- Blt_OptionPrintProc *printProc; /* Procedure to return a
- * Tcl_Obj representing an
- * existing option value. */
-
- Blt_OptionFreeProc *freeProc; /* Procedure used to free the
- * value. */
-
- ClientData clientData; /* Arbitrary one-word value
- * used by option parser:
- * passed to parseProc and
- * printProc. */
-} Blt_CustomOption;
-
-/*
- * Structure used to specify information for Tk_ConfigureWidget. Each
- * structure gives complete information for one option, including
- * how the option is specified on the command line, where it appears
- * in the option database, etc.
- */
-
-typedef struct {
- int type; /* Type of option, such as
- * BLT_CONFIG_COLOR; see definitions
- * below. Last option in table must
- * have type BLT_CONFIG_END. */
-
- const char *switchName; /* Switch used to specify option in
- * argv. NULL means this spec is part
- * of a group. */
-
- Tk_Uid dbName; /* Name for option in option
- * database. */
-
- Tk_Uid dbClass; /* Class for option in database. */
-
- Tk_Uid defValue; /* Default value for option if not
- * specified in command line or
- * database. */
-
- int offset; /* Where in widget record to store
- * value; use Blt_Offset macro to
- * generate values for this. */
-
- int specFlags; /* Any combination of the values
- * defined below; other bits are used
- * internally by tkConfig.c. */
-
- Blt_CustomOption *customPtr; /* If type is BLT_CONFIG_CUSTOM then
- * this is a pointer to info about how
- * to parse and print the option.
- * Otherwise it is irrelevant. */
-} Blt_ConfigSpec;
-
-/*
- * Type values for Blt_ConfigSpec structures. See the user
- * documentation for details.
- */
-typedef enum {
- BLT_CONFIG_ACTIVE_CURSOR,
- BLT_CONFIG_ANCHOR,
- BLT_CONFIG_BITMAP,
- BLT_CONFIG_BOOLEAN,
- BLT_CONFIG_BORDER,
- BLT_CONFIG_CAP_STYLE,
- BLT_CONFIG_COLOR,
- BLT_CONFIG_CURSOR,
- BLT_CONFIG_CUSTOM,
- BLT_CONFIG_DOUBLE,
- BLT_CONFIG_FONT,
- BLT_CONFIG_INT,
- BLT_CONFIG_JOIN_STYLE,
- BLT_CONFIG_JUSTIFY,
- BLT_CONFIG_MM,
- BLT_CONFIG_RELIEF,
- BLT_CONFIG_STRING,
- BLT_CONFIG_SYNONYM,
- BLT_CONFIG_UID,
- BLT_CONFIG_WINDOW,
-
- BLT_CONFIG_BITMASK,
- BLT_CONFIG_BITMASK_INVERT,
- BLT_CONFIG_DASHES,
- BLT_CONFIG_FILL,
- BLT_CONFIG_FLOAT,
- BLT_CONFIG_INT_NNEG, /* 0..N */
- BLT_CONFIG_INT_POS, /* 1..N */
- BLT_CONFIG_LIST,
- BLT_CONFIG_LONG,
- BLT_CONFIG_LONG_NNEG, /* 0..N */
- BLT_CONFIG_LONG_POS, /* 1..N */
- BLT_CONFIG_OBJ,
- BLT_CONFIG_PAD,
- BLT_CONFIG_PIXELS_NNEG, /* 1.1c 2m 3.2i excluding negative
- values. */
- BLT_CONFIG_PIXELS_POS, /* 1.1c 2m 3.2i excluding negative
- * values and zero. */
- BLT_CONFIG_PIXELS, /* 1.1c 2m 3.2i. */
- BLT_CONFIG_RESIZE,
- BLT_CONFIG_SIDE,
- BLT_CONFIG_STATE,
- BLT_CONFIG_BACKGROUND,
- BLT_CONFIG_PIX32,
-
- BLT_CONFIG_TK_FONT,
- BLT_CONFIG_END
-} Blt_ConfigTypes;
-
-/*
- * Possible values for flags argument to Tk_ConfigureWidget:
- */
-#define BLT_CONFIG_OBJV_ONLY 1
-
-/*
- * Possible flag values for Blt_ConfigSpec structures. Any bits at or
- * above BLT_CONFIG_USER_BIT may be used by clients for selecting
- * certain entries. Before changing any values here, coordinate with
- * tkOldConfig.c (internal-use-only flags are defined there).
- */
-/*
- * Values for "flags" field of Blt_ConfigSpec structures. Be sure to
- * coordinate these values with those defined in tk.h
- * (BLT_CONFIG_COLOR_ONLY, etc.). There must not be overlap!
- *
- * INIT - Non-zero means (char *) things have been
- * converted to Tk_Uid's.
- */
-#define INIT (1<<0)
-#define BLT_CONFIG_NULL_OK (1<<1)
-#define BLT_CONFIG_COLOR_ONLY (1<<2)
-#define BLT_CONFIG_MONO_ONLY (1<<3)
-#define BLT_CONFIG_DONT_SET_DEFAULT (1<<4)
-#define BLT_CONFIG_OPTION_SPECIFIED (1<<5)
-#define BLT_CONFIG_USER_BIT (1<<8)
-
-
-#define SIDE_LEFT (1<<0)
-#define SIDE_TOP (1<<1)
-#define SIDE_RIGHT (1<<2)
-#define SIDE_BOTTOM (1<<3)
-
-#define STATE_NORMAL (0)
-#define STATE_ACTIVE (1<<0)
-#define STATE_DISABLED (1<<1)
-#define STATE_EMPHASIS (1<<2)
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Pad --
- *
- * Specifies vertical and horizontal padding.
- *
- * Padding can be specified on a per side basis. The fields
- * side1 and side2 refer to the opposite sides, either
- * horizontally or vertically.
- *
- * side1 side2
- * ----- -----
- * x | left right
- * y | top bottom
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- unsigned short int side1, side2;
-} Blt_Pad;
-
-#define padLeft xPad.side1
-#define padRight xPad.side2
-#define padTop yPad.side1
-#define padBottom yPad.side2
-#define PADDING(x) ((x).side1 + (x).side2)
-
-/*
- *---------------------------------------------------------------------------
- *
- * The following enumerated values are used as bit flags.
- * FILL_NONE Neither coordinate plane is specified
- * FILL_X Horizontal plane.
- * FILL_Y Vertical plane.
- * FILL_BOTH Both vertical and horizontal planes.
- *
- *---------------------------------------------------------------------------
- */
-#define FILL_NONE 0
-#define FILL_X 1
-#define FILL_Y 2
-#define FILL_BOTH 3
-
-/*
- * Resize --
- *
- * These flags indicate in what ways each partition in a table can be
- * resized from its default dimensions. The normal size of a row/column
- * is the minimum amount of space needed to hold the widgets that span
- * it. The table may then be stretched or shrunk depending if the
- * container is larger or smaller than the table. This can occur if 1)
- * the user resizes the toplevel widget, or 2) the container is in turn
- * packed into a larger widget and the "fill" option is set.
- *
- * RESIZE_NONE - No resizing from normal size.
- * RESIZE_EXPAND - Do not allow the size to decrease.
- * The size may increase however.
- * RESIZE_SHRINK - Do not allow the size to increase.
- * The size may decrease however.
- * RESIZE_BOTH - Allow the size to increase or
- * decrease from the normal size.
- * RESIZE_VIRGIN - Special case of the resize flag. Used to
- * indicate the initial state of the flag.
- * Empty rows/columns are treated differently
- * if this row/column is set.
- */
-
-#define RESIZE_NONE 0
-#define RESIZE_EXPAND (1<<0)
-#define RESIZE_SHRINK (1<<1)
-#define RESIZE_BOTH (RESIZE_EXPAND | RESIZE_SHRINK)
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Dashes --
- *
- * List of dash values (maximum 11 based upon PostScript limit).
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- unsigned char values[12];
- int offset;
-} Blt_Dashes;
-
-#define LineIsDashed(d) ((d).values[0] != 0)
-
-/*
- * Blt_Limits --
- *
- * Defines the bounding of a size (width or height) in the paneset. It may
- * be related to the widget, pane or paneset size.
- */
-typedef struct {
- int flags; /* Flags indicate whether using default
- * values for limits or not. See flags
- * below. */
- int max, min; /* Values for respective limits. */
- int nom; /* Nominal starting value. */
-} Blt_Limits;
-
-#define LIMITS_MIN_SET (1<<0)
-#define LIMITS_MAX_SET (1<<1)
-#define LIMITS_NOM_SET (1<<2)
-
-#define LIMITS_MIN 0 /* Default minimum limit */
-#define LIMITS_MAX SHRT_MAX /* Default maximum limit */
-#define LIMITS_NOM -1000 /* Default nomimal value. Indicates
- * if a pane has received any space
- * yet */
-
-BLT_EXTERN void Blt_SetDashes (Display *display, GC gc, Blt_Dashes *dashesPtr);
-BLT_EXTERN Blt_Dashes *Blt_GetDashes (GC gc);
-
-BLT_EXTERN void Blt_ResetLimits(Blt_Limits *limitsPtr);
-BLT_EXTERN int Blt_GetLimitsFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Tcl_Obj *objPtr, Blt_Limits *limitsPtr);
-
-BLT_EXTERN int Blt_ConfigureInfoFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Blt_ConfigSpec *specs, char *widgRec, Tcl_Obj *objPtr, int flags);
-
-BLT_EXTERN int Blt_ConfigureValueFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Blt_ConfigSpec *specs, char *widgRec, Tcl_Obj *objPtr, int flags);
-
-BLT_EXTERN int Blt_ConfigureWidgetFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Blt_ConfigSpec *specs, int objc, Tcl_Obj *const *objv, char *widgRec,
- int flags);
-
-BLT_EXTERN int Blt_ConfigureComponentFromObj(Tcl_Interp *interp,
- Tk_Window tkwin, const char *name, const char *className,
- Blt_ConfigSpec *specs, int objc, Tcl_Obj *const *objv, char *widgRec,
- int flags);
-
-BLT_EXTERN int Blt_ConfigModified TCL_VARARGS(Blt_ConfigSpec *, specs);
-
-BLT_EXTERN const char *Blt_NameOfState(int state);
-BLT_EXTERN const char *Blt_NameOfSide(int side);
-
-BLT_EXTERN void Blt_FreeOptions(Blt_ConfigSpec *specs, char *widgRec,
- Display *display, int needFlags);
-
-BLT_EXTERN int Blt_ObjIsOption(Blt_ConfigSpec *specs, Tcl_Obj *objPtr,
- int flags);
-
-BLT_EXTERN int Blt_GetSideFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- int *sidePtr);
-
-BLT_EXTERN int Blt_GetPositionFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- long *indexPtr);
-
-BLT_EXTERN int Blt_GetPixelsFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Tcl_Obj *objPtr, int flags, int *valuePtr);
-
-BLT_EXTERN int Blt_GetPadFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Tcl_Obj *objPtr, Blt_Pad *padPtr);
-
-BLT_EXTERN int Blt_GetStateFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- int *statePtr);
-
-BLT_EXTERN int Blt_GetFillFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- int *fillPtr);
-
-BLT_EXTERN int Blt_GetResizeFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- int *fillPtr);
-
-BLT_EXTERN int Blt_GetDashesFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- Blt_Dashes *dashesPtr);
-
-#if (_TK_VERSION < _VERSION(8,1,0))
-BLT_EXTERN int Tk_GetAnchorFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- Tk_Anchor *anchorPtr);
-
-BLT_EXTERN int Tk_GetJustifyFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- Tk_Justify *justifyPtr);
-
-BLT_EXTERN int Tk_GetReliefFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- int *reliefPtr);
-
-BLT_EXTERN int Tk_GetMMFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Tcl_Obj *objPtr, double *doublePtr);
-
-BLT_EXTERN int Tk_GetPixelsFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Tcl_Obj *objPtr, int *intPtr);
-
-BLT_EXTERN Tk_3DBorder Tk_Alloc3DBorderFromObj(Tcl_Interp *interp,
- Tk_Window tkwin, Tcl_Obj *objPtr);
-
-BLT_EXTERN Pixmap Tk_AllocBitmapFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Tcl_Obj *objPtr);
-
-BLT_EXTERN Tk_Font Tk_AllocFontFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Tcl_Obj *objPtr);
-
-BLT_EXTERN Tk_Cursor Tk_AllocCursorFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Tcl_Obj *objPtr);
-
-BLT_EXTERN XColor *Tk_AllocColorFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Tcl_Obj *objPtr);
-#endif /* < 8.1 */
-
-#endif /* BLT_CONFIG_H */
diff --git a/blt3.0.1/src/bltContainer.c b/blt3.0.1/src/bltContainer.c
deleted file mode 100644
index aca8265..0000000
--- a/blt3.0.1/src/bltContainer.c
+++ /dev/null
@@ -1,2011 +0,0 @@
-
-/*
- * bltContainer.c --
- *
- * This module implements a container widget for the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_CONTAINER
-#include "bltOp.h"
-#include "bltChain.h"
-#include "bltTree.h"
-#if !defined(WIN32) && !defined(MACOSX)
-#include <X11/Xatom.h>
-#include <X11/Xproto.h>
-#include <X11/Xutil.h>
-#endif
-#include "tkDisplay.h"
-#define XDEBUG
-
-#define SEARCH_TRIES 100 /* Maximum number of attempts to check for
- * a given window before failing. */
-#define SEARCH_INTERVAL 20 /* Number milliseconds to wait after each
- * attempt to find a window. */
-
-#define SEARCH_TKWIN (1<<0) /* Search via Tk window pathname. */
-#define SEARCH_XID (1<<1) /* Search via an XID 0x0000000. */
-#define SEARCH_CMD (1<<2) /* Search via a command-line arguments. */
-#define SEARCH_NAME (1<<3) /* Search via the application name. */
-#define SEARCH_PROPERTY (1<<4) /* Search via the application name. */
-#define SEARCH_ALL (SEARCH_TKWIN | SEARCH_XID | SEARCH_CMD | SEARCH_NAME)
-
-#define CONTAINER_REDRAW (1<<1)
-#define CONTAINER_MAPPED (1<<2)
-#define CONTAINER_FOCUS (1<<4)
-#define CONTAINER_INIT (1<<5)
-#define CONTAINER_MOVE (1<<7)
-
-#define DEF_CONTAINER_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_CONTAINER_BORDERWIDTH STD_BORDERWIDTH
-#define DEF_CONTAINER_COMMAND (char *)NULL
-#define DEF_CONTAINER_CURSOR (char *)NULL
-#define DEF_CONTAINER_HEIGHT "0"
-#define DEF_CONTAINER_HIGHLIGHT_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_CONTAINER_HIGHLIGHT_COLOR RGB_BLACK
-#define DEF_CONTAINER_HIGHLIGHT_WIDTH "2"
-#define DEF_CONTAINER_RELIEF "sunken"
-#define DEF_CONTAINER_TAKE_FOCUS "0"
-#define DEF_CONTAINER_TIMEOUT "20"
-#define DEF_CONTAINER_WIDTH "0"
-#define DEF_CONTAINER_WINDOW (char *)NULL
-
-typedef struct _SearchInfo SearchInfo;
-typedef void (SearchProc)(Display *display, Window window,
- SearchInfo *searchPtr);
-
-struct _SearchInfo {
- SearchProc *proc;
- char *pattern; /* Search pattern. */
-
- Window window; /* XID of last window that matches criteria. */
- int nMatches; /* Number of windows that match the pattern. */
- int saveNames; /* Indicates to save the names of the
- * window XIDs that match the search
- * criteria. */
- Tcl_DString dString; /* Will contain the strings of the
- * window XIDs matching the search
- * criteria. */
- Atom atom;
-};
-
-typedef struct {
- Tk_Window tkwin; /* Window that embodies the widget.
- * NULL means that the window has been
- * destroyed but the data structures
- * haven't yet been cleaned up.*/
-
- Display *display; /* Display containing widget; needed,
- * among other things, to release
- * resources after tkwin has already
- * gone away. */
-
- Tcl_Interp *interp; /* Interpreter associated with widget. */
-
- Tcl_Command cmdToken; /* Token for widget's command. */
-
- unsigned int flags; /* For bit-field definitions, see above. */
-
- int inset; /* Total width of borders; focus
- * highlight and 3-D border. Indicates
- * the offset from outside edges to
- * leave room for borders. */
-
- Tk_Cursor cursor; /* X Cursor */
-
- Tk_3DBorder border; /* 3D border surrounding the adopted
- * window. */
- int borderWidth; /* Width of 3D border. */
- int relief; /* 3D border relief. */
-
- Tk_Window tkToplevel; /* Toplevel (wrapper) window of
- * container. It's used to track the
- * location of the container. If it
- * moves we need to notify the
- * embedded application. */
- /*
- * Focus highlight ring
- */
- int highlightWidth; /* Width in pixels of highlight to
- * draw around widget when it has the
- * focus. <= 0 means don't draw a
- * highlight. */
- XColor *highlightBgColor; /* Color for drawing traversal
- * highlight area when highlight is
- * off. */
- XColor *highlightColor; /* Color for drawing traversal highlight. */
-
- GC highlightGC; /* GC for focus highlight. */
-
- char *takeFocus; /* Says whether to select this widget during
- * tab traveral operations. This value isn't
- * used in C code, but for the widget's Tcl
- * bindings. */
-
- int reqWidth, reqHeight; /* Requested dimensions of the container
- * window. */
-
- Window adopted; /* X window Id or Win32 handle of adopted
- * window contained by the widget. If None,
- * no window has been reparented. */
- Tk_Window tkAdopted; /* Non-NULL if this is a Tk window that's
- * been adopted. */
- int adoptedX, adoptedY; /* Current position of the adopted window. */
- int adoptedWidth; /* Current width of the adopted window. */
- int adoptedHeight; /* Current height of the adopted window. */
-
- int origX, origY;
- int origWidth, origHeight; /* Dimensions of the window when it
- * was adopted. When the window is
- * released it's returned to it's
- * original dimensions. */
-
- int timeout;
- int nextId;
-} Container;
-
-
-static Blt_OptionParseProc ObjToXID;
-static Blt_OptionPrintProc XIDToObj;
-
-static Blt_CustomOption XIDOption = {
- ObjToXID, XIDToObj, NULL, (ClientData)(SEARCH_TKWIN | SEARCH_XID),
-};
-
-#ifndef WIN32
-static Blt_CustomOption XIDNameOption = {
- ObjToXID, XIDToObj, NULL, (ClientData)SEARCH_NAME,
-};
-
-static Blt_CustomOption XIDCmdOption = {
- ObjToXID, XIDToObj, NULL, (ClientData)SEARCH_CMD,
-};
-static Blt_CustomOption XIDPropertyOption = {
- ObjToXID, XIDToObj, NULL, (ClientData)SEARCH_PROPERTY,
-};
-#endif
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BORDER, "-background", "background", "Background",
- DEF_CONTAINER_BACKGROUND, Blt_Offset(Container, border), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_CONTAINER_BORDERWIDTH, Blt_Offset(Container, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
-#ifndef WIN32
- {BLT_CONFIG_CUSTOM, "-command", "command", "Command",
- DEF_CONTAINER_WINDOW, Blt_Offset(Container, adopted),
- BLT_CONFIG_DONT_SET_DEFAULT, &XIDCmdOption},
-#endif
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_CONTAINER_CURSOR, Blt_Offset(Container, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-height", "height", "Height",
- DEF_CONTAINER_HEIGHT, Blt_Offset(Container, reqHeight),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_CONTAINER_HIGHLIGHT_BACKGROUND,
- Blt_Offset(Container, highlightBgColor), 0},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_CONTAINER_HIGHLIGHT_COLOR,
- Blt_Offset(Container, highlightColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness",
- DEF_CONTAINER_HIGHLIGHT_WIDTH, Blt_Offset(Container, highlightWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
-#ifndef WIN32
- {BLT_CONFIG_CUSTOM, "-name", "name", "Name", DEF_CONTAINER_WINDOW,
- Blt_Offset(Container, adopted), BLT_CONFIG_DONT_SET_DEFAULT, &XIDNameOption},
- {BLT_CONFIG_CUSTOM, "-property", "property", "Property", DEF_CONTAINER_WINDOW,
- Blt_Offset(Container, adopted), BLT_CONFIG_DONT_SET_DEFAULT, &XIDPropertyOption},
-#endif
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_CONTAINER_RELIEF, Blt_Offset(Container, relief), 0},
- {BLT_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_CONTAINER_TAKE_FOCUS, Blt_Offset(Container, takeFocus),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_INT_POS, "-timeout", "timeout", "Timeout",
- DEF_CONTAINER_TIMEOUT, Blt_Offset(Container, timeout),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-width", "width", "Width",
- DEF_CONTAINER_WIDTH, Blt_Offset(Container, reqWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-window", "window", "Window",
- DEF_CONTAINER_WINDOW, Blt_Offset(Container, adopted),
- BLT_CONFIG_DONT_SET_DEFAULT, &XIDOption},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-/* Forward Declarations */
-static Tcl_CmdDeleteProc ContainerInstCmdDeleteProc;
-static Tcl_FreeProc DestroyContainer;
-static Tcl_IdleProc DisplayContainer;
-static Tcl_ObjCmdProc ContainerCmd;
-static Tcl_ObjCmdProc ContainerInstCmd;
-static Tk_EventProc ContainerEventProc;
-static Tk_EventProc ToplevelEventProc;
-static Tk_GenericProc AdoptedWindowEventProc;
-
-static void EventuallyRedraw(Container *cntrPtr);
-
-typedef int (ContainerCmdProc)(Container *comboPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * GetWindowId --
- *
- * Returns the XID for the Tk_Window given. Starting in Tk 8.0,
- * the toplevel widgets are wrapped by another window.
- * Currently there's no way to get at that window, other than
- * what is done here: query the X window hierarchy and grab the
- * parent.
- *
- * Results:
- * Returns the X Window ID of the widget. If it's a toplevel, then
- * the XID of the wrapper is returned.
- *
- *---------------------------------------------------------------------------
- */
-Window
-GetXID(Tk_Window tkwin)
-{
- HWND hWnd;
- TkWinWindow *twdPtr;
-
- hWnd = Tk_GetHWND(Tk_WindowId(tkwin));
- if (Tk_IsTopLevel(tkwin)) {
- hWnd = GetParent(hWnd);
- }
- twdPtr = Blt_AssertMalloc(sizeof(TkWinWindow));
- twdPtr->handle = hWnd;
- twdPtr->type = TWD_WINDOW;
- twdPtr->winPtr = tkwin;
- return (Window)twdPtr;
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * NameOfId --
- *
- * Returns a string representing the given XID.
- *
- * Results:
- * A static string containing either the hexidecimal number or
- * the pathname of a Tk window.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-NameOfId(
- Display *display, /* Display containing both the container widget
- * and the adopted window. */
- Window window) /* XID of the adopted window. */
-{
- if (window != None) {
- Tk_Window tkwin;
- static char string[200];
-
- /* See first if it's a window that Tk knows about. */
- /*
- * Note: If the wrapper window is reparented, Tk pretends it's
- * no longer connected to the toplevel, so if you look for
- * the child of the wrapper tkwin, it's NULL.
- */
- tkwin = Tk_IdToWindow(display, window);
- if ((tkwin != NULL) && (Tk_PathName(tkwin) != NULL)) {
- return Tk_PathName(tkwin);
- }
- sprintf_s(string, 200, "0x%lx", (unsigned long)window);
- return string;
- }
- return ""; /* Return empty string if XID is None. */
-}
-
-#ifndef WIN32
-/*
- *---------------------------------------------------------------------------
- *
- * XGeometryErrorProc --
- *
- * Flags errors generated from XGetGeometry calls to the X server.
- *
- * Results:
- * Always returns 0.
- *
- * Side Effects:
- * Sets a flag, indicating an error occurred.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-XGeometryErrorProc(
- ClientData clientData,
- XErrorEvent *eventPtr) /* Not used. */
-{
- int *errorPtr = clientData;
-
- *errorPtr = TCL_ERROR;
- return 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetAdoptedWindowGeometry --
- *
- * Computes the requested geometry of the container using the
- * size of adopted window as a reference.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Sets a flag, indicating an error occurred.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetAdoptedWindowGeometry(
- Tcl_Interp *interp,
- Container *cntrPtr)
-{
- int x, y, width, height, borderWidth, depth;
- int xOffset, yOffset;
- Window root, dummy;
- Tk_ErrorHandler handler;
- int result;
- int any = -1;
-
- width = height = 1;
- xOffset = yOffset = 0;
- if (cntrPtr->adopted != None) {
- handler = Tk_CreateErrorHandler(cntrPtr->display, any, X_GetGeometry,
- any, XGeometryErrorProc, &result);
- root = Tk_RootWindow(cntrPtr->tkwin);
- XTranslateCoordinates(cntrPtr->display, cntrPtr->adopted,
- root, 0, 0, &xOffset, &yOffset, &dummy);
- result = XGetGeometry(cntrPtr->display, cntrPtr->adopted, &root,
- &x, &y, (unsigned int *)&width, (unsigned int *)&height,
- (unsigned int *)&borderWidth, (unsigned int *)&depth);
- Tk_DeleteErrorHandler(handler);
- XSync(cntrPtr->display, False);
- if (result == 0) {
- Tcl_AppendResult(interp, "can't get geometry for \"",
- NameOfId(cntrPtr->display, cntrPtr->adopted), "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- cntrPtr->origX = xOffset;
- cntrPtr->origY = yOffset;
- cntrPtr->origWidth = width;
- cntrPtr->origHeight = height;
- } else {
- cntrPtr->origX = cntrPtr->origY = 0;
- cntrPtr->origWidth = cntrPtr->origHeight = 0;
- }
- cntrPtr->adoptedX = x;
- cntrPtr->adoptedY = y;
- cntrPtr->adoptedWidth = width;
- cntrPtr->adoptedHeight = height;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetChildren --
- *
- * Returns a chain of the child windows according to their stacking
- * order. The window ids are ordered from top to bottom.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-GetChildren(Display *display, Window window)
-{
- Window *children;
- unsigned int nChildren;
- Window parent, root;
-
- if (XQueryTree(display, window, &parent, &root, &children, &nChildren)) {
- if (nChildren > 0) {
- Blt_Chain chain;
- size_t i;
-
- chain = Blt_Chain_Create();
- for (i = 0; i < nChildren; i++) {
- /*
- * XQuery returns windows in bottom to top order. We'll
- * reverse the order.
- */
- Blt_Chain_Prepend(chain, (ClientData)children[i]);
- }
- XFree((char *)children);
- return chain;
- }
- }
- return NULL;
-}
-
-static int
-GetMaxPropertySize(Display *display)
-{
- int size;
-
- size = Blt_MaxRequestSize(display, sizeof(char));
- size -= 32;
- return size;
-}
-
-static unsigned char *
-GetProperty(Display *display, Window window, Atom atom)
-{
- unsigned char *data;
- int result, format;
- Atom typeAtom;
- unsigned long nItems, bytesAfter;
-
- if (window == None) {
- return NULL;
- }
- data = NULL;
- result = XGetWindowProperty(
- display, /* Display of window. */
- window, /* Window holding the property. */
- atom, /* Name of property. */
- 0, /* Offset of data (for multiple reads). */
- GetMaxPropertySize(display), /* Maximum number of items to read. */
- False, /* If true, delete the property. */
- XA_STRING, /* Desired type of property. */
- &typeAtom, /* (out) Actual type of the property. */
- &format, /* (out) Actual format of the property. */
- &nItems, /* (out) # of items in specified format. */
- &bytesAfter, /* (out) # of bytes remaining to be read. */
- &data);
- if ((result != Success) || (format != 8) /*|| (typeAtom != XA_STRING)*/) {
- if ((result == Success) && (format != None)) {
- fprintf(stderr, "format=%d typeAtom=%d\n", format, (int)typeAtom);
- }
- if (data != NULL) {
- XFree((char *)data);
- data = NULL;
- }
- }
- return data;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PropertySearch --
- *
- * Traverses the entire window hierarchy, searching for windows
- * matching the name field in the SearchInfo structure. This
- * routine is recursively called for each successive level in
- * the window hierarchy.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The SearchInfo structure will track the number of windows that
- * match the given criteria.
- *
- *---------------------------------------------------------------------------
- */
-static void
-PropertySearch(Display *display, Window window, SearchInfo *searchPtr)
-{
- Blt_Chain chain;
- char *data;
-
- data = (char *)GetProperty(display, window, searchPtr->atom);
- if (data != NULL) {
- /* Compare the name of the window to the search pattern. */
- if (Tcl_StringMatch(data, searchPtr->pattern)) {
- fprintf(stderr, "window 0x%x matched %s property (%s) with %s\n",
- (int)window, XGetAtomName(display, searchPtr->atom), data,
- searchPtr->pattern);
- if (searchPtr->saveNames) { /* Record names of matching windows. */
- Tcl_DStringAppendElement(&searchPtr->dString,
- NameOfId(display, window));
- Tcl_DStringAppendElement(&searchPtr->dString, data);
- }
- searchPtr->window = window;
- searchPtr->nMatches++;
- }
- XFree(data);
- }
- /* Process the window's descendants. */
- chain = GetChildren(display, window);
- if (chain != NULL) {
- Blt_ChainLink link;
- Window child;
-
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- child = (Window)Blt_Chain_GetValue(link);
- PropertySearch(display, child, searchPtr);
- }
- Blt_Chain_Destroy(chain);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NameSearch --
- *
- * Traverses the entire window hierarchy, searching for windows
- * matching the name field in the SearchInfo structure. This
- * routine is recursively called for each successive level in
- * the window hierarchy.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The SearchInfo structure will track the number of windows that
- * match the given criteria.
- *
- *---------------------------------------------------------------------------
- */
-static void
-NameSearch(
- Display *display,
- Window window,
- SearchInfo *searchPtr)
-{
- Blt_Chain chain;
- char *wmName;
-
- if (XFetchName(display, window, &wmName)) {
- /* Compare the name of the window to the search pattern. */
- if (Tcl_StringMatch(wmName, searchPtr->pattern)) {
- if (searchPtr->saveNames) { /* Record names of matching windows. */
- Tcl_DStringAppendElement(&searchPtr->dString,
- NameOfId(display, window));
- Tcl_DStringAppendElement(&searchPtr->dString, wmName);
- }
- searchPtr->window = window;
- searchPtr->nMatches++;
- }
- XFree(wmName);
- }
- /* Process the window's descendants. */
- chain = GetChildren(display, window);
- if (chain != NULL) {
- Blt_ChainLink link;
- Window child;
-
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- child = (Window)Blt_Chain_GetValue(link);
- NameSearch(display, child, searchPtr);
- }
- Blt_Chain_Destroy(chain);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CmdSearch --
- *
- * Traverses the entire window hierarchy, searching for windows
- * matching the command-line specified in the SearchInfo structure.
- * This routine is recursively called for each successive level
- * in the window hierarchy.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The SearchInfo structure will track the number of windows that
- * match the given command-line.
- *
- *---------------------------------------------------------------------------
- */
-static void
-CmdSearch(
- Display *display,
- Window window,
- SearchInfo *searchPtr)
-{
- Blt_Chain chain;
- int argc;
- char **argv;
-
- if (XGetCommand(display, window, &argv, &argc)) {
- char *string;
-
- string = Tcl_Merge(argc, (const char **)argv);
- XFreeStringList(argv);
- if (Tcl_StringMatch(string, searchPtr->pattern)) {
- if (searchPtr->saveNames) { /* Record names of matching windows. */
- Tcl_DStringAppendElement(&searchPtr->dString,
- NameOfId(display, window));
- Tcl_DStringAppendElement(&searchPtr->dString, string);
- }
- searchPtr->window = window;
- searchPtr->nMatches++;
- }
- Blt_Free(string);
- }
- /* Process the window's descendants. */
- chain = GetChildren(display, window);
- if (chain != NULL) {
- Blt_ChainLink link;
- Window child;
-
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- child = (Window)Blt_Chain_GetValue(link);
- CmdSearch(display, child, searchPtr);
- }
- Blt_Chain_Destroy(chain);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TimeoutProc --
- *
- * Procedure called when the timer event elapses. Used to wait
- * between attempts checking for the designated window.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Sets a flag, indicating the timeout occurred.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TimeoutProc(ClientData clientData)
-{
- int *expirePtr = clientData;
-
- *expirePtr = TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TestAndWaitForWindow --
- *
- * Searches, possibly multiple times, for windows matching the
- * criteria given, using the search proc also given.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Sets a flag, indicating the timeout occurred.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TestAndWaitForWindow(
- Container *cntrPtr, /* Container widget record. */
- SearchInfo *searchPtr) /* Search criteria. */
-{
- Window root;
- Tcl_TimerToken timerToken;
- int expire;
- int i;
-
- /* Get the root window to start the search. */
- root = Tk_RootWindow(cntrPtr->tkwin);
- timerToken = NULL;
- for (i = 0; i < SEARCH_TRIES; i++) {
- searchPtr->nMatches = 0;
- (*searchPtr->proc)(cntrPtr->display, root, searchPtr);
- if (searchPtr->nMatches > 0) {
- if (timerToken != NULL) {
- Tcl_DeleteTimerHandler(timerToken);
- }
- return;
- }
- expire = FALSE;
- /*
- * If the X11 application associated with the adopted window
- * was just started (via "exec" or "bgexec"), the window may
- * not exist yet. We have to wait a little bit for the program
- * to start up. Create a timer event break us out of an wait
- * loop. We'll wait for a given interval for the adopted window
- * to appear.
- */
- timerToken = Tcl_CreateTimerHandler(cntrPtr->timeout, TimeoutProc,
- &expire);
- while (!expire) {
- /* Should file events be allowed? */
- Tcl_DoOneEvent(TCL_TIMER_EVENTS | TCL_WINDOW_EVENTS |
- TCL_FILE_EVENTS);
- }
- }
-}
-#else
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetChildren --
- *
- * Returns a chain of the child windows according to their stacking
- * order. The window ids are ordered from top to bottom.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-GetChildren(Display *display, Window window)
-{
- Blt_Chain chain;
- HWND hWnd;
- HWND parent;
-
- parent = Tk_GetHWND(window);
- chain = Blt_Chain_Create();
- for (hWnd = GetTopWindow(parent); hWnd != NULL;
- hWnd = GetNextWindow(hWnd, GW_HWNDNEXT)) {
- Blt_Chain_Append(chain, (ClientData)hWnd);
- }
- return chain;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetAdoptedWindowGeometry --
- *
- * Computes the requested geometry of the container using the
- * size of adopted window as a reference.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Sets a flag, indicating an error occurred.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetAdoptedWindowGeometry(
- Tcl_Interp *interp,
- Container *cntrPtr)
-{
- int x, y, width, height;
- int xOffset, yOffset;
- Window root, dummy;
-
- width = height = 1;
- xOffset = yOffset = 0;
- x = y = 0;
- if (cntrPtr->adopted != None) {
- HWND hWnd;
- RECT rect;
-
- hWnd = Tk_GetHWND(cntrPtr->adopted);
- if (GetWindowRect(hWnd, &rect)) {
- x = rect.left;
- y = rect.top;
- width = rect.right - rect.left + 1;
- height = rect.bottom - rect.top + 1;
- } else {
- Tcl_AppendResult(interp, "can't get geometry for \"",
- NameOfId(cntrPtr->display, cntrPtr->adopted), "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- root = Tk_RootWindow(cntrPtr->tkwin);
- XTranslateCoordinates(cntrPtr->display, cntrPtr->adopted,
- root, 0, 0, &xOffset, &yOffset, &dummy);
- cntrPtr->origX = xOffset;
- cntrPtr->origY = yOffset;
- cntrPtr->origWidth = width;
- cntrPtr->origHeight = height;
- } else {
- cntrPtr->origX = cntrPtr->origY = 0;
- cntrPtr->origWidth = cntrPtr->origHeight = 0;
- }
- cntrPtr->adoptedX = x;
- cntrPtr->adoptedY = y;
- cntrPtr->adoptedWidth = width;
- cntrPtr->adoptedHeight = height;
- return TCL_OK;
-}
-
-#endif /*WIN32*/
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapTree --
- *
- * Maps each window in the hierarchy. This is needed because
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Each window in the hierarchy is mapped.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapTree(
- Display *display,
- Window window)
-{
- Blt_Chain chain;
-
- XMapWindow(display, window);
- chain = GetChildren(display, window);
- if (chain != NULL) {
- Blt_ChainLink link;
- Window child;
-
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- child = (Window)Blt_Chain_GetValue(link);
- MapTree(display, child);
- }
- Blt_Chain_Destroy(chain);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StringToXID --
- *
- * Converts a string into an X window Id.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToXID(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window parent, /* Parent window */
- Tcl_Obj *objPtr, /* String representation. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned long searchFlags = (unsigned long)clientData;
- Container *cntrPtr = (Container *)widgRec;
- Window *winPtr = (Window *) (widgRec + offset);
- Tk_Window tkAdopted;
- Window window;
- char *string;
-
- string = Tcl_GetString(objPtr);
- tkAdopted = NULL;
- window = None;
- if ((searchFlags & SEARCH_TKWIN) && (string[0] == '.')) {
- Tk_Window tkwin;
-
- tkwin = Tk_NameToWindow(interp, string, Tk_MainWindow(interp));
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (!Tk_IsTopLevel(tkwin)) {
- Tcl_AppendResult(interp, "can't reparent non-toplevel Tk windows",
- (char *)NULL);
- return TCL_ERROR;
- }
- tkAdopted = tkwin;
- Tk_MakeWindowExist(tkwin);
- window = Blt_GetWindowId(tkwin);
-#ifndef WIN32
- } else if ((searchFlags & SEARCH_XID) && (string[0] == '0') &&
- (string[1] == 'x')) {
- int token;
-
- /* Hexidecimal string specifying the Window token. */
- if (Tcl_GetInt(interp, string, &token) != TCL_OK) {
- return TCL_ERROR;
- }
- window = token;
- } else if ((string == NULL) || (string[0] == '\0')) {
- window = None;
- } else {
- SearchInfo search;
-
- memset(&search, 0, sizeof(search));
- if (searchFlags & (SEARCH_NAME | SEARCH_CMD | SEARCH_PROPERTY)) {
- if (searchFlags & SEARCH_NAME) {
- search.pattern = string;
- search.proc = NameSearch;
- } else if (searchFlags & SEARCH_CMD) {
- search.pattern = string;
- search.proc = CmdSearch;
- } else if (searchFlags & SEARCH_PROPERTY) {
- Tk_Window tkwin;
- char *atomName;
- int objc;
- Tcl_Obj **objv;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc != 2) {
- return TCL_ERROR;
- }
- tkwin = Tk_MainWindow(interp);
- atomName = Tcl_GetString(objv[0]);
- string = search.pattern = Tcl_GetString(objv[1]);
- search.atom = XInternAtom(Tk_Display(tkwin), atomName, False);
- search.proc = PropertySearch;
- }
- TestAndWaitForWindow(cntrPtr, &search);
- if (search.nMatches > 1) {
- Tcl_AppendResult(interp, "more than one window matches \"",
- search.pattern, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (search.nMatches == 0) {
- Tcl_AppendResult(interp, "can't find window from pattern \"",
- search.pattern, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- window = search.window;
-#endif /*WIN32*/
- }
- if (*winPtr != None) {
- Window root;
-
- root = Tk_RootWindow(cntrPtr->tkwin);
- if (Blt_ReparentWindow(cntrPtr->display, *winPtr, root,
- cntrPtr->origX, cntrPtr->origY)
- != TCL_OK) {
- Tcl_AppendResult(interp, "can't restore \"",
- NameOfId(cntrPtr->display, *winPtr),
- "\" window to root", (char *)NULL);
- return TCL_ERROR;
- }
- cntrPtr->flags &= ~CONTAINER_MAPPED;
- if (cntrPtr->tkAdopted == NULL) {
- /* This wasn't a Tk window. So deselect the event mask. */
- XSelectInput(cntrPtr->display, *winPtr, 0);
- } else {
- MapTree(cntrPtr->display, *winPtr);
- }
- XMoveResizeWindow(cntrPtr->display, *winPtr, cntrPtr->origX,
- cntrPtr->origY, cntrPtr->origWidth, cntrPtr->origHeight);
- }
- cntrPtr->tkAdopted = tkAdopted;
- *winPtr = window;
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * XIDToString --
- *
- * Converts the Tk window back to its string representation (i.e.
- * its name).
- *
- * Results:
- * The name of the window is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-XIDToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window parent, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Container *cntrPtr = (Container *) widgRec;
- Window window = *(Window *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (cntrPtr->tkAdopted != NULL) {
- objPtr = Tcl_NewStringObj(Tk_PathName(cntrPtr->tkAdopted), -1);
- } else {
- objPtr = Tcl_NewStringObj(NameOfId(cntrPtr->display, window), -1);
- }
- return objPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Queues a request to redraw the widget at the next idle point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets redisplayed. Right now we don't do selective
- * redisplays: the whole window will be redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(Container *cntrPtr)
-{
- if ((cntrPtr->tkwin != NULL) && !(cntrPtr->flags & CONTAINER_REDRAW)) {
- cntrPtr->flags |= CONTAINER_REDRAW;
- Tcl_DoWhenIdle(DisplayContainer, cntrPtr);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * AdoptedWindowEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various
- * events on the encapsulated window.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets resized or exposed, it's redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AdoptedWindowEventProc(
- ClientData clientData, /* Information about the tab window. */
- XEvent *eventPtr) /* Information about event. */
-{
- Container *cntrPtr = (Container *) clientData;
-
- if ((eventPtr->type == CreateNotify) && (cntrPtr->adopted == None)) {
- fprintf(stderr, "window found is %x\n",
- (unsigned int)eventPtr->xmaprequest.window);
- if (Blt_ReparentWindow(cntrPtr->display, eventPtr->xmaprequest.window,
- Tk_WindowId(cntrPtr->tkwin), cntrPtr->inset, cntrPtr->inset)
- != TCL_OK) {
- fprintf(stderr, "can't adopt window \"%s\"\n",
- NameOfId(cntrPtr->display, eventPtr->xmaprequest.window));
- return 0;
- }
- cntrPtr->adopted = eventPtr->xmaprequest.window;
- XSelectInput(cntrPtr->display, cntrPtr->adopted, StructureNotifyMask);
- XSelectInput(cntrPtr->display, Tk_RootWindow(cntrPtr->tkwin), 0);
- return 1;
- }
- if (eventPtr->xany.window != cntrPtr->adopted) {
- return 0;
- }
- if (eventPtr->type == DestroyNotify) {
- cntrPtr->adopted = None;
- EventuallyRedraw(cntrPtr);
- }
- return 1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ContainerEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various
- * events on container widgets.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ContainerEventProc(
- ClientData clientData, /* Information about window. */
- XEvent *eventPtr) /* Information about event. */
-{
- Container *cntrPtr = clientData;
-
- switch (eventPtr->type) {
- case Expose:
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(cntrPtr);
- }
- break;
-
- case FocusIn:
- case FocusOut:
- if (eventPtr->xfocus.detail != NotifyInferior) {
- if (eventPtr->type == FocusIn) {
- cntrPtr->flags |= CONTAINER_FOCUS;
- } else {
- cntrPtr->flags &= ~CONTAINER_FOCUS;
- }
- EventuallyRedraw(cntrPtr);
- }
- break;
-
- case ConfigureNotify:
- EventuallyRedraw(cntrPtr);
- break;
-
- case DestroyNotify:
- if (cntrPtr->tkwin != NULL) {
- cntrPtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(cntrPtr->interp, cntrPtr->cmdToken);
- }
- if (cntrPtr->flags & CONTAINER_REDRAW) {
- Tcl_CancelIdleCall(DisplayContainer, cntrPtr);
- }
- Tcl_EventuallyFree(cntrPtr, DestroyContainer);
- break;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ToplevelEventProc --
- *
- * Some applications assume that they are always a toplevel
- * window and play tricks accordingly. For example, Netscape
- * positions menus in relation to the toplevel. But if the
- * container's toplevel is moved, this positioning is wrong.
- * So watch if the toplevel is moved.
- *
- * [This would be easier and cleaner if Tk toplevels weren't so
- * botched by the addition of menubars. It's not enough to
- * track the )
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ToplevelEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Container *cntrPtr = clientData;
-
- if ((cntrPtr->adopted != None) && (cntrPtr->tkwin != NULL) &&
- (eventPtr->type == ConfigureNotify)) {
- cntrPtr->flags |= CONTAINER_MOVE;
- EventuallyRedraw(cntrPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyContainer --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of the widget at a safe
- * time (when no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyContainer(DestroyData dataPtr)
-{
- Container *cntrPtr = (Container *) dataPtr;
-
- if (cntrPtr->highlightGC != NULL) {
- Tk_FreeGC(cntrPtr->display, cntrPtr->highlightGC);
- }
- if (cntrPtr->flags & CONTAINER_INIT) {
- Tk_DeleteGenericHandler(AdoptedWindowEventProc, cntrPtr);
- }
- if (cntrPtr->tkToplevel != NULL) {
- Tk_DeleteEventHandler(cntrPtr->tkToplevel, StructureNotifyMask,
- ToplevelEventProc, cntrPtr);
- }
- Blt_FreeOptions(configSpecs, (char *)cntrPtr, cntrPtr->display, 0);
- Blt_Free(cntrPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureContainer --
- *
- * This procedure is called to process an objv/objc list, plus
- * the Tk option database, in order to configure (or reconfigure)
- * the widget.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is
- * returned, then interp->result contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for cntrPtr; old resources get freed, if there
- * were any. The widget is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureContainer(
- Tcl_Interp *interp, /* Interpreter to report errors. */
- Container *cntrPtr, /* Information about widget; may or
- * may not already have values for
- * some fields. */
- int objc,
- Tcl_Obj *const *objv,
- int flags)
-{
- XGCValues gcValues;
- unsigned long gcMask;
- GC newGC;
- int width, height;
-
- if (Blt_ConfigureWidgetFromObj(interp, cntrPtr->tkwin, configSpecs,
- objc, objv, (char *)cntrPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- cntrPtr->inset = cntrPtr->borderWidth + cntrPtr->highlightWidth;
- if (Tk_WindowId(cntrPtr->tkwin) == None) {
- Tk_MakeWindowExist(cntrPtr->tkwin);
- }
- if (GetAdoptedWindowGeometry(interp, cntrPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_ConfigModified(configSpecs, "-window", "-name", "-command",
- (char *)NULL)) {
- cntrPtr->flags &= ~CONTAINER_MAPPED;
- if (cntrPtr->adopted != None) {
- if (Blt_ReparentWindow(cntrPtr->display, cntrPtr->adopted,
- Tk_WindowId(cntrPtr->tkwin), cntrPtr->inset,
- cntrPtr->inset) != TCL_OK) {
- Tcl_AppendResult(interp, "can't adopt window \"",
- NameOfId(cntrPtr->display, cntrPtr->adopted),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- XSelectInput(cntrPtr->display, cntrPtr->adopted,
- StructureNotifyMask);
- if ((cntrPtr->flags & CONTAINER_INIT) == 0) {
- Tk_CreateGenericHandler(AdoptedWindowEventProc, cntrPtr);
- cntrPtr->flags |= CONTAINER_INIT;
- }
- }
- }
- /* Add the designated inset to the requested dimensions. */
- width = cntrPtr->origWidth + 2 * cntrPtr->inset;
- height = cntrPtr->origHeight + 2 * cntrPtr->inset;
-
- if (cntrPtr->reqWidth > 0) {
- width = cntrPtr->reqWidth;
- }
- if (cntrPtr->reqHeight > 0) {
- height = cntrPtr->reqHeight;
- }
- /* Set the requested width and height for the container. */
- if ((Tk_ReqWidth(cntrPtr->tkwin) != width) ||
- (Tk_ReqHeight(cntrPtr->tkwin) != height)) {
- Tk_GeometryRequest(cntrPtr->tkwin, width, height);
- }
-
- /*
- * GC for focus highlight.
- */
- gcMask = GCForeground;
- gcValues.foreground = cntrPtr->highlightColor->pixel;
- newGC = Tk_GetGC(cntrPtr->tkwin, gcMask, &gcValues);
- if (cntrPtr->highlightGC != NULL) {
- Tk_FreeGC(cntrPtr->display, cntrPtr->highlightGC);
- }
- cntrPtr->highlightGC = newGC;
-
- EventuallyRedraw(cntrPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ContainerInstCmdDeleteProc --
- *
- * This procedure can be called if the window was destroyed
- * (tkwin will be NULL) and the command was deleted
- * automatically. In this case, we need to do nothing.
- *
- * Otherwise this routine was called because the command was
- * deleted. Then we need to clean-up and destroy the widget.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ContainerInstCmdDeleteProc(
- ClientData clientData) /* Pointer to widget record for widget. */
-
-{
- Container *cntrPtr = clientData;
-
- if (cntrPtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = cntrPtr->tkwin;
- cntrPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ContainerCmd --
- *
- * This procedure is invoked to process the TCL command that
- * corresponds to a widget managed by this module. See the user
- * documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-ContainerCmd(
- ClientData clientData, /* Main window associated with interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- Container *cntrPtr;
- Tk_Window tkwin;
- unsigned int mask;
- char *path;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- tkwin = Tk_MainWindow(interp);
- path = Tcl_GetString(objv[1]);
- tkwin = Tk_CreateWindowFromPath(interp, tkwin, path, (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- cntrPtr = Blt_AssertCalloc(1, sizeof(Container));
- cntrPtr->tkwin = tkwin;
- cntrPtr->display = Tk_Display(tkwin);
- cntrPtr->interp = interp;
- cntrPtr->flags = 0;
- cntrPtr->timeout = SEARCH_INTERVAL;
- cntrPtr->borderWidth = cntrPtr->highlightWidth = 2;
- cntrPtr->relief = TK_RELIEF_SUNKEN;
- Tk_SetClass(tkwin, "Container");
- Blt_SetWindowInstanceData(tkwin, cntrPtr);
-
- if ((cntrPtr->flags & CONTAINER_INIT) == 0) {
- Tk_CreateGenericHandler(AdoptedWindowEventProc, cntrPtr);
- cntrPtr->flags |= CONTAINER_INIT;
- }
- {
-#ifdef notdef
- XSetWindowAttributes attr;
- attr.event_mask = SubstructureRedirectMask | SubstructureNotifyMask;
-
- XChangeWindowAttributes(cntrPtr->display, Tk_RootWindow(tkwin),
- CWEventMask, &attr);
-#endif
- XSelectInput(cntrPtr->display, DefaultRootWindow(cntrPtr->display),
- SubstructureNotifyMask |
- StructureNotifyMask);
- }
- if (ConfigureContainer(interp, cntrPtr, objc - 2, objv + 2, 0) != TCL_OK) {
- Tk_DestroyWindow(cntrPtr->tkwin);
- return TCL_ERROR;
- }
- mask = (StructureNotifyMask | ExposureMask | FocusChangeMask);
- Tk_CreateEventHandler(tkwin, mask, ContainerEventProc, cntrPtr);
- cntrPtr->cmdToken = Tcl_CreateObjCommand(interp, path, ContainerInstCmd,
- cntrPtr, ContainerInstCmdDeleteProc);
-
- Tk_MakeWindowExist(tkwin);
- Tcl_SetObjResult(interp, objv[1]);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayContainer --
- *
- * This procedure is invoked to display the widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayContainer(ClientData clientData)
-{
- Container *cntrPtr = clientData;
- Drawable drawable;
- int width, height;
-
- cntrPtr->flags &= ~CONTAINER_REDRAW;
- if (cntrPtr->tkwin == NULL) {
- return; /* Window has been destroyed. */
- }
- if (!Tk_IsMapped(cntrPtr->tkwin)) {
- return;
- }
- drawable = Tk_WindowId(cntrPtr->tkwin);
-#ifndef WIN32
- if (cntrPtr->tkToplevel == NULL) {
- Window window;
- Tk_Window tkToplevel;
-
- /* Create an event handler for the toplevel of the container. */
- tkToplevel = Blt_Toplevel(cntrPtr->tkwin);
- window = Blt_GetWindowId(tkToplevel);
- cntrPtr->tkToplevel = Tk_IdToWindow(cntrPtr->display, window);
- if (cntrPtr->tkToplevel != NULL) {
- Tk_CreateEventHandler(cntrPtr->tkToplevel, StructureNotifyMask,
- ToplevelEventProc, cntrPtr);
- }
- }
-#endif /* WIN32 */
- if (cntrPtr->adopted != None) {
-#ifndef WIN32
- if (cntrPtr->flags & CONTAINER_MOVE) {
- /*
- * Some applications like Netscape cache its location to
- * position its popup menus. But when it's reparented, it
- * thinks it's always at the same position. It doesn't
- * know when the container's moved. The hack here is to
- * force the application to update its coordinates by
- * moving the adopted window (over by 1 pixel and
- * then back in case the application is comparing the last
- * location).
- */
- XMoveWindow(cntrPtr->display, cntrPtr->adopted,
- cntrPtr->inset + 1, cntrPtr->inset + 1);
- XMoveWindow(cntrPtr->display, cntrPtr->adopted,
- cntrPtr->inset, cntrPtr->inset);
- cntrPtr->flags &= ~CONTAINER_MOVE;
- }
-#endif /* WIN32 */
- /* Compute the available space inside the container. */
- width = Tk_Width(cntrPtr->tkwin) - (2 * cntrPtr->inset);
- height = Tk_Height(cntrPtr->tkwin) - (2 * cntrPtr->inset);
-
- if ((cntrPtr->adoptedX != cntrPtr->inset) ||
- (cntrPtr->adoptedY != cntrPtr->inset) ||
- (cntrPtr->adoptedWidth != width) ||
- (cntrPtr->adoptedHeight != height)) {
- /* Resize the window to the new size */
- if (width < 1) {
- width = 1;
- }
- if (height < 1) {
- height = 1;
- }
- XMoveResizeWindow(cntrPtr->display, cntrPtr->adopted,
- cntrPtr->inset, cntrPtr->inset, width, height);
- cntrPtr->adoptedWidth = width;
- cntrPtr->adoptedHeight = height;
- cntrPtr->adoptedX = cntrPtr->adoptedY = cntrPtr->inset;
- if (cntrPtr->tkAdopted != NULL) {
- Tk_ResizeWindow(cntrPtr->tkAdopted, width, height);
- }
- }
-#ifndef WIN32
- if (!(cntrPtr->flags & CONTAINER_MAPPED)) {
- XMapWindow(cntrPtr->display, cntrPtr->adopted);
- cntrPtr->flags |= CONTAINER_MAPPED;
- }
-#endif
- if (cntrPtr->borderWidth > 0) {
- Blt_Draw3DRectangle(cntrPtr->tkwin, drawable, cntrPtr->border,
- cntrPtr->highlightWidth, cntrPtr->highlightWidth,
- Tk_Width(cntrPtr->tkwin) - 2 * cntrPtr->highlightWidth,
- Tk_Height(cntrPtr->tkwin) - 2 * cntrPtr->highlightWidth,
- cntrPtr->borderWidth, cntrPtr->relief);
- }
- } else {
- Blt_Fill3DRectangle(cntrPtr->tkwin, drawable, cntrPtr->border,
- cntrPtr->highlightWidth, cntrPtr->highlightWidth,
- Tk_Width(cntrPtr->tkwin) - 2 * cntrPtr->highlightWidth,
- Tk_Height(cntrPtr->tkwin) - 2 * cntrPtr->highlightWidth,
- cntrPtr->borderWidth, cntrPtr->relief);
- }
-
- /* Draw focus highlight ring. */
- if (cntrPtr->highlightWidth > 0) {
- XColor *color;
- GC gc;
-
- color = (cntrPtr->flags & CONTAINER_FOCUS)
- ? cntrPtr->highlightColor : cntrPtr->highlightBgColor;
- gc = Tk_GCForColor(color, drawable);
- Tk_DrawFocusHighlight(cntrPtr->tkwin, gc, cntrPtr->highlightWidth,
- drawable);
- }
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * SendOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SendOp(cntrPtr, interp, objc, objv)
- Container *cntrPtr;
- Tcl_Interp *interp;
- int objc; /* Not used. */
- Tcl_Obj *const *objv;
-{
-
- if (cntrPtr->adopted != None) {
- XEvent event;
- char *p;
- KeySym symbol;
- int xid;
- Window window;
-
- if (Tcl_GetIntFromObj(interp, objv[2], &xid) != TCL_OK) {
- return TCL_ERROR;
- }
- window = (Window)xid;
- event.xkey.type = KeyPress;
- event.xkey.serial = 0;
- event.xkey.display = cntrPtr->display;
- event.xkey.window = event.xkey.subwindow = window;
- event.xkey.time = CurrentTime;
- event.xkey.x = event.xkey.x = 100;
- event.xkey.root = Tk_RootWindow(cntrPtr->tkwin);
- event.xkey.x_root = Tk_X(cntrPtr->tkwin) + cntrPtr->inset;
- event.xkey.x_root = Tk_Y(cntrPtr->tkwin) + cntrPtr->inset;
- event.xkey.state = 0;
- event.xkey.same_screen = TRUE;
-
-
- for (p = Tcl_GetString(objv[3]); *p != '\0'; p++) {
- if (*p == '\r') {
- symbol = XStringToKeysym("Return");
- } else if (*p == ' ') {
- symbol = XStringToKeysym("space");
- } else {
- char save;
-
- save = *(p+1);
- *(p+1) = '\0';
- symbol = XStringToKeysym(p);
- *(p+1) = save;
- }
- event.xkey.keycode = XKeysymToKeycode(cntrPtr->display, symbol);
- event.xkey.type = KeyPress;
- if (!XSendEvent(cntrPtr->display, window, False, KeyPress, &event)) {
- fprintf(stderr, "send press event failed\n");
- }
- event.xkey.type = KeyRelease;
- if (!XSendEvent(cntrPtr->display, window, False, KeyRelease,
- &event)) {
- fprintf(stderr, "send release event failed\n");
- }
- }
- }
- return TCL_OK;
-}
-#endif
-
-#ifndef WIN32
-/*
- *---------------------------------------------------------------------------
- *
- * FindOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-FindOp(
- Container *cntrPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Window root;
- SearchInfo search;
- char *string;
-
- memset(&search, 0, sizeof(search));
- search.pattern = Tcl_GetString(objv[3]);
- Tcl_DStringInit(&search.dString);
-
- search.saveNames = TRUE; /* Indicates to record all matching XIDs. */
- string = Tcl_GetString(objv[2]);
- if (strcmp(string, "-name") == 0) {
- search.proc = NameSearch;
- } else if (strcmp(string, "-command") == 0) {
- search.proc = CmdSearch;
- } else {
- Tcl_AppendResult(interp, "missing \"-name\" or \"-command\" switch",
- (char *)NULL);
- return TCL_ERROR;
- }
- root = Tk_RootWindow(cntrPtr->tkwin);
- (*search.proc)(cntrPtr->display, root, &search);
- Tcl_DStringResult(interp, &search.dString);
- return TCL_OK;
-}
-#endif /*WIN32*/
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CgetOp(
- Container *cntrPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- return Blt_ConfigureValueFromObj(interp, cntrPtr->tkwin, configSpecs,
- (char *)cntrPtr, objv[2], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * This procedure is called to process an objv/objc list, plus
- * the Tk option database, in order to configure (or reconfigure)
- * the widget.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then
- * interp->result contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for cntrPtr; old resources get freed, if there
- * were any. The widget is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(
- Container *cntrPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, cntrPtr->tkwin, configSpecs,
- (char *)cntrPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, cntrPtr->tkwin, configSpecs,
- (char *)cntrPtr, objv[2], 0);
- }
- if (ConfigureContainer(interp, cntrPtr, objc - 2, objv + 2,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- EventuallyRedraw(cntrPtr);
- return TCL_OK;
-}
-
-
-#ifndef WIN32
-static int
-IgnoreErrors(Display *display, XErrorEvent *eventPtr)
-{
- return 0;
-}
-
-
-static int
-GetAtomName(Display *display, Atom atom, char **namePtr)
-{
- char *atomName;
- XErrorHandler handler;
- static char name[200];
- int result;
-
- handler = XSetErrorHandler(IgnoreErrors);
- atomName = XGetAtomName(display, atom);
- XSetErrorHandler(handler);
-
- name[0] = '\0';
- if (atomName == NULL) {
- sprintf(name, "undefined atom # 0x%lx", atom);
- result = FALSE;
- } else {
- size_t length = strlen(atomName);
-
- if (length > 200) {
- length = 200;
- }
- memcpy(name, atomName, length);
- name[length] = '\0';
- XFree(atomName);
- result = TRUE;
- }
- *namePtr = name;
- return result;
-}
-
-static void
-FillTree(Container *cntrPtr, Window window, Blt_Tree tree, Blt_TreeNode parent)
-{
- char string[200];
- Atom *atoms;
- int i;
- int nProps;
- Blt_Chain chain;
-
- /* Process the window's descendants. */
- atoms = XListProperties(cntrPtr->display, window, &nProps);
- for (i = 0; i < nProps; i++) {
- char *name;
-
- if (GetAtomName(cntrPtr->display, atoms[i], &name)) {
- char *data;
- int result, format;
- Atom typeAtom;
- unsigned long nItems, bytesAfter;
-
- result = XGetWindowProperty(
- cntrPtr->display, /* Display of window. */
- window, /* Window holding the property. */
- atoms[i], /* Name of property. */
- 0, /* Offset of data (for multiple reads). */
- GetMaxPropertySize(cntrPtr->display),
- /* Maximum number of items to read. */
- False, /* If true, delete the property. */
- XA_STRING, /* Desired type of property. */
- &typeAtom, /* (out) Actual type of the property. */
- &format, /* (out) Actual format of the property. */
- &nItems, /* (out) # of items in specified format. */
- &bytesAfter, /* (out) # of bytes remaining to be read. */
- (unsigned char **)&data);
-#ifdef notdef
- fprintf(stderr, "%x: property name is %s (format=%d(%d) type=%d result=%d)\n", window, name, format, nItems, typeAtom, result == Success);
-#endif
- if (result == Success) {
- if (format == 8) {
- if (data != NULL) {
- Blt_Tree_SetValue(cntrPtr->interp, tree, parent, name,
- Tcl_NewStringObj(data, nItems));
- }
- } else if (typeAtom == XA_WINDOW) {
- int *iPtr = (int *)&data;
- sprintf(string, "0x%x", *iPtr);
- Blt_Tree_SetValue(cntrPtr->interp, tree, parent, name,
- Tcl_NewStringObj(string, -1));
- } else {
- Blt_Tree_SetValue(cntrPtr->interp, tree, parent, name,
- Tcl_NewStringObj("???", -1));
- }
- XFree(data);
- }
- }
- }
- if (atoms != NULL) {
- XFree(atoms);
- }
- chain = GetChildren(cntrPtr->display, window);
- if (chain != NULL) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Blt_TreeNode child;
- char *wmName;
- Window w;
-
- w = (Window)Blt_Chain_GetValue(link);
- sprintf(string, "0x%x", (int)w);
- if (XFetchName(cntrPtr->display, w, &wmName)) {
- child = Blt_Tree_CreateNode(tree, parent, wmName, -1);
- if (w == 0x220001c) {
- fprintf(stderr, "found xterm (%s)\n", wmName);
- }
- XFree(wmName);
- } else {
- child = Blt_Tree_CreateNode(tree, parent, string, -1);
- }
- if (w == 0x220001c) {
- fprintf(stderr, "found xterm (%s) node=%ld\n", string,
- (long)Blt_Tree_NodeId(child));
- }
- Blt_Tree_SetValue(cntrPtr->interp, tree, child, "id",
- Tcl_NewStringObj(string, -1));
- FillTree(cntrPtr, w, tree, child);
- }
- Blt_Chain_Destroy(chain);
- }
-
-}
-/*
- *---------------------------------------------------------------------------
- *
- * TreeOp --
- *
- * .c tree $tree
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TreeOp(
- Container *cntrPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Window root;
- Blt_TreeNode node;
- char string[200];
- Blt_Tree tree;
-
- tree = Blt_Tree_Open(interp, Tcl_GetString(objv[2]), 0);
- if (tree == NULL) {
- return TCL_ERROR;
- }
- node = Blt_Tree_RootNode(tree);
- Blt_Tree_RelabelNode(tree, node, "root");
- root = Tk_RootWindow(cntrPtr->tkwin);
- sprintf(string, "0x%ux", (unsigned int)root);
- Blt_Tree_SetValue(interp, tree, node, "id", Tcl_NewStringObj(string, -1));
- FillTree(cntrPtr, root, tree, node);
- Blt_Tree_Close(tree);
- return TCL_OK;
-}
-#endif /*WIN32*/
-
-/*
- *---------------------------------------------------------------------------
- *
- * ContainerCmd --
- *
- * This procedure is invoked to process the "container" command.
- * See the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec opSpecs[] =
-{
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"configure", 2, ConfigureOp, 2, 0, "?option value?...",},
-#ifndef WIN32
- {"find", 1, FindOp, 3, 4, "?-command|-name? pattern",},
-#endif /*WIN32*/
-#ifdef notdef
- {"send", 1, SendOp, 4, 4, "window string",},
-#endif
-#ifndef WIN32
- {"tree", 1, TreeOp, 3, 3, "treeName",},
-#endif /*WIN32*/
-};
-
-static int nSpecs = sizeof(opSpecs) / sizeof(Blt_OpSpec);
-
-static int
-ContainerInstCmd(
- ClientData clientData, /* Information about the widget. */
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Vector of argument strings. */
-{
- ContainerCmdProc *proc;
- Container *cntrPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nSpecs, opSpecs, BLT_OP_ARG1, objc, objv,
- 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(cntrPtr);
- result = (*proc)(cntrPtr, interp, objc, objv);
- Tcl_Release(cntrPtr);
- return result;
-}
-
-int
-Blt_ContainerCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "container", ContainerCmd, };
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-#endif /* NO_CONTAINER */
-
diff --git a/blt3.0.1/src/bltCoreInit.c b/blt3.0.1/src/bltCoreInit.c
deleted file mode 100644
index ac4640c..0000000
--- a/blt3.0.1/src/bltCoreInit.c
+++ /dev/null
@@ -1,375 +0,0 @@
-
-/*
- * bltCoreInit.c --
- *
- * This module initials the non-Tk command of the BLT toolkit, registering the
- * commands with the TCL interpreter.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltNsUtil.h"
-#include "bltArrayObj.h"
-#include "bltMath.h"
-
-#ifndef BLT_LIBRARY
-# ifdef WIN32
-# define BLT_LIBRARY "c:/Program Files/Tcl/lib/blt"##BLT_VERSION
-# else
-# define BLT_LIBRARY "unknown"
-# endif
-#endif
-
-#if (_TCL_VERSION >= _VERSION(8,5,0))
-#define TCL_VERSION_LOADED TCL_PATCH_LEVEL
-#else
-#define TCL_VERSION_LOADED TCL_VERSION
-#endif
-
-static double bltNaN;
-
-BLT_EXTERN Tcl_AppInitProc Blt_core_Init;
-BLT_EXTERN Tcl_AppInitProc Blt_core_SafeInit;
-
-static Tcl_MathProc MinMathProc, MaxMathProc;
-static char libPath[1024] =
-{
- BLT_LIBRARY
-};
-
-/*
- * Script to set the BLT library path in the variable global "blt_library"
- *
- * Checks the usual locations for a file (bltGraph.pro) from the BLT library.
- * The places searched in order are
- *
- * $BLT_LIBRARY
- * $BLT_LIBRARY/blt2.4
- * $BLT_LIBRARY/..
- * $BLT_LIBRARY/../blt2.4
- * $blt_libPath
- * $blt_libPath/blt2.4
- * $blt_libPath/..
- * $blt_libPath/../blt2.4
- * $tcl_library
- * $tcl_library/blt2.4
- * $tcl_library/..
- * $tcl_library/../blt2.4
- * $env(TCL_LIBRARY)
- * $env(TCL_LIBRARY)/blt2.4
- * $env(TCL_LIBRARY)/..
- * $env(TCL_LIBRARY)/../blt2.4
- *
- * The TCL variable "blt_library" is set to the discovered path. If the file
- * wasn't found, no error is returned. The actual usage of $blt_library is
- * purposely deferred so that it can be set from within a script.
- */
-
-/* FIXME: Change this to a namespace procedure in 3.0 */
-
-static char initScript[] =
-{"\n\
-global blt_library blt_libPath blt_version tcl_library env\n\
-set blt_library {}\n\
-set path {}\n\
-foreach var { env(BLT_LIBRARY) blt_libPath tcl_library env(TCL_LIBRARY) } { \n\
- if { ![info exists $var] } { \n\
- continue \n\
- } \n\
- set path [set $var] \n\
- if { [file readable [file join $path bltGraph.pro]] } { \n\
- set blt_library $path\n\
- break \n\
- } \n\
- set path [file join $path blt$blt_version ] \n\
- if { [file readable [file join $path bltGraph.pro]] } { \n\
- set blt_library $path\n\
- break \n\
- } \n\
- set path [file dirname [set $var]] \n\
- if { [file readable [file join $path bltGraph.pro]] } { \n\
- set blt_library $path\n\
- break \n\
- } \n\
- set path [file join $path blt$blt_version ] \n\
- if { [file readable [file join $path bltGraph.pro]] } { \n\
- set blt_library $path\n\
- break \n\
- } \n\
-} \n\
-if { $blt_library != \"\" } { \n\
- global auto_path \n\
- lappend auto_path $blt_library \n\
-}\n\
-unset var path\n\
-\n"
-};
-
-
-static Tcl_AppInitProc *cmdProcs[] =
-{
-#ifndef NO_BASE64
- Blt_Base64CmdInitProc,
-#endif
-#ifndef NO_BGEXEC
- Blt_BgexecCmdInitProc,
-#endif
-#ifndef NO_PTYEXEC
- Blt_PtyExecCmdInitProc,
-#endif
-#ifndef NO_CRC32
- Blt_Crc32CmdInitProc,
-#endif
-#ifndef NO_CSV
- Blt_CsvCmdInitProc,
-#endif
-#ifndef NO_DATATABLE
- Blt_TableCmdInitProc,
-#endif
-#ifndef NO_DDE
- Blt_DdeCmdInitProc,
-#endif
-#ifndef NO_DEBUG
- Blt_DebugCmdInitProc,
-#endif
-#ifndef NO_SPLINE
- Blt_SplineCmdInitProc,
-#endif
-#ifndef NO_TREE
- Blt_TreeCmdInitProc,
-#endif
-#ifndef NO_VECTOR
- Blt_VectorCmdInitProc,
-#endif
-#ifndef NO_WATCH
- Blt_WatchCmdInitProc,
-#endif
- (Tcl_AppInitProc *) NULL
-};
-
-double
-Blt_NaN(void)
-{
- return bltNaN;
-}
-
-static double
-MakeNaN(void)
-{
- union DoubleValue {
- unsigned int words[2];
- double value;
- } result;
-
-#ifdef WORDS_BIGENDIAN
- result.words[0] = 0x7ff80000;
- result.words[1] = 0x00000000;
-#else
- result.words[0] = 0x00000000;
- result.words[1] = 0x7ff80000;
-#endif
- return result.value;
-}
-
-/* ARGSUSED */
-static int
-MinMathProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tcl_Value *argsPtr,
- Tcl_Value *resultPtr)
-{
- Tcl_Value *op1Ptr, *op2Ptr;
-
- op1Ptr = argsPtr, op2Ptr = argsPtr + 1;
- if ((op1Ptr->type == TCL_INT) && (op2Ptr->type == TCL_INT)) {
- resultPtr->intValue = MIN(op1Ptr->intValue, op2Ptr->intValue);
- resultPtr->type = TCL_INT;
- } else {
- double a, b;
-
- a = (op1Ptr->type == TCL_INT)
- ? (double)op1Ptr->intValue : op1Ptr->doubleValue;
- b = (op2Ptr->type == TCL_INT)
- ? (double)op2Ptr->intValue : op2Ptr->doubleValue;
- resultPtr->doubleValue = MIN(a, b);
- resultPtr->type = TCL_DOUBLE;
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-MaxMathProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tcl_Value *argsPtr,
- Tcl_Value *resultPtr)
-{
- Tcl_Value *op1Ptr, *op2Ptr;
-
- op1Ptr = argsPtr, op2Ptr = argsPtr + 1;
- if ((op1Ptr->type == TCL_INT) && (op2Ptr->type == TCL_INT)) {
- resultPtr->intValue = MAX(op1Ptr->intValue, op2Ptr->intValue);
- resultPtr->type = TCL_INT;
- } else {
- double a, b;
-
- a = (op1Ptr->type == TCL_INT)
- ? (double)op1Ptr->intValue : op1Ptr->doubleValue;
- b = (op2Ptr->type == TCL_INT)
- ? (double)op2Ptr->intValue : op2Ptr->doubleValue;
- resultPtr->doubleValue = MAX(a, b);
- resultPtr->type = TCL_DOUBLE;
- }
- return TCL_OK;
-}
-
-static int
-SetLibraryPath(Tcl_Interp *interp)
-{
- Tcl_DString dString;
- const char *value;
-
- Tcl_DStringInit(&dString);
- Tcl_DStringAppend(&dString, libPath, -1);
-#ifdef WIN32
- {
- HKEY key;
- DWORD result;
-# ifndef BLT_REGISTRY_KEY
-# define BLT_REGISTRY_KEY "Software\\BLT\\" BLT_VERSION "\\" TCL_VERSION
-# endif
- result = RegOpenKeyEx(
- HKEY_LOCAL_MACHINE, /* Parent key. */
- BLT_REGISTRY_KEY, /* Path to sub-key. */
- 0, /* Reserved. */
- KEY_READ, /* Security access mask. */
- &key); /* Resulting key.*/
-
- if (result == ERROR_SUCCESS) {
- DWORD size;
-
- /* Query once to get the size of the string needed */
- result = RegQueryValueEx(key, "BLT_LIBRARY", NULL, NULL, NULL,
- &size);
- if (result == ERROR_SUCCESS) {
- Tcl_DStringSetLength(&dString, size);
- /* And again to collect the string. */
- RegQueryValueEx(key, "BLT_LIBRARY", NULL, NULL,
- (LPBYTE)Tcl_DStringValue(&dString), &size);
- RegCloseKey(key);
- }
- }
- }
-#endif /* WIN32 */
- value = Tcl_SetVar(interp, "blt_libPath", Tcl_DStringValue(&dString),
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG);
- Tcl_DStringFree(&dString);
- if (value == NULL) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-
-/*LINTLIBRARY*/
-int
-Blt_core_Init(Tcl_Interp *interp) /* Interpreter to add extra commands */
-{
- Tcl_AppInitProc **p;
- Tcl_Namespace *nsPtr;
- Tcl_ValueType args[2];
- const char *result;
- const int isExact = 1;
-
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION_LOADED, isExact) == NULL) {
- return TCL_ERROR;
- };
-#endif
- Blt_AllocInit(NULL, NULL, NULL);
-
- /*
- * Check that the versions of TCL that have been loaded are the same ones
- * that BLT was compiled against.
- */
- if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION_LOADED, isExact) == NULL) {
- return TCL_ERROR;
- }
-
- /* Set the "blt_version", "blt_patchLevel", and "blt_libPath" Tcl
- * variables. We'll use them in the following script. */
-
- result = Tcl_SetVar(interp, "blt_version", BLT_VERSION, TCL_GLOBAL_ONLY);
- if (result == NULL) {
- return TCL_ERROR;
- }
- result = Tcl_SetVar(interp, "blt_patchLevel", BLT_PATCH_LEVEL,
- TCL_GLOBAL_ONLY);
- if (result == NULL) {
- return TCL_ERROR;
- }
- if (SetLibraryPath(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tcl_Eval(interp, initScript) != TCL_OK) {
- return TCL_ERROR;
- }
-
-
- nsPtr = Tcl_FindNamespace(interp, "::blt", (Tcl_Namespace *)NULL, 0);
- if (nsPtr == NULL) {
- nsPtr = Tcl_CreateNamespace(interp, "::blt", NULL, NULL);
- if (nsPtr == NULL) {
- return TCL_ERROR;
- }
- }
- /* Initialize the BLT commands that only require Tcl. */
- for (p = cmdProcs; *p != NULL; p++) {
- if ((**p) (interp) != TCL_OK) {
- Tcl_DeleteNamespace(nsPtr);
- return TCL_ERROR;
- }
- }
- args[0] = args[1] = TCL_EITHER;
- Tcl_CreateMathFunc(interp, "min", 2, args, MinMathProc, (ClientData)0);
- Tcl_CreateMathFunc(interp, "max", 2, args, MaxMathProc, (ClientData)0);
- Blt_RegisterArrayObj();
- bltNaN = MakeNaN();
- if (Tcl_PkgProvide(interp, "blt_core", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*LINTLIBRARY*/
-int
-Blt_core_SafeInit(Tcl_Interp *interp) /* Interpreter to add extra commands */
-{
- return Blt_core_Init(interp);
-}
-
-#ifdef USE_DLL
-# include "bltWinDll.c"
-#endif
diff --git a/blt3.0.1/src/bltCrc32.c b/blt3.0.1/src/bltCrc32.c
deleted file mode 100644
index 3ac2add..0000000
--- a/blt3.0.1/src/bltCrc32.c
+++ /dev/null
@@ -1,229 +0,0 @@
-
-/*
- * bltCrc32.c --
- *
- * This module implements a CRC32 procedure for the BLT toolkit.
- *
- * Copyright 1991-2005 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#include <stdio.h>
-
-/* open a file
- * calculate the CRC32 of the entire contents
- * return the CRC
- * if there is an error rdet the global variable Crcerror
- */
-
-/* -------------------------------------------------------------------------- */
-
-/*
- * this is the CRC32 lookup table
- * thanks Gary S. Brown
- * 64 lines of 4 values for a 256 dword table (1024 bytes)
- */
-static unsigned long crc32[256] =
-{ /* CRC polynomial 0xedb88320 */
- 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F,
- 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
- 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2,
- 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
- 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9,
- 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
- 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C,
- 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
- 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423,
- 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
- 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106,
- 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
- 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D,
- 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
- 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950,
- 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
- 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7,
- 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
- 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA,
- 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
- 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81,
- 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
- 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84,
- 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
- 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB,
- 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
- 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E,
- 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
- 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55,
- 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
- 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28,
- 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
- 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F,
- 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
- 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242,
- 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
- 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69,
- 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
- 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC,
- 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
- 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693,
- 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
- 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
-};
-
-#define CRC32(c, b) (crc32[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
-
-static int
-Crc32FromObj(Tcl_Obj *objPtr, unsigned long *sumPtr)
-{
- char *bp, *bend, *buffer;
- int nBytes;
- unsigned long sum;
-
- buffer = Tcl_GetStringFromObj(objPtr, &nBytes);
- sum = *sumPtr;
- for (bp = buffer, bend = bp + nBytes; bp < bend; bp++) {
- sum = CRC32(sum, *bp);
- }
- *sumPtr = sum;
- return TCL_OK;
-}
-
-static int
-Crc32File(Tcl_Interp *interp, char *fileName, unsigned long *sumPtr)
-{
- Tcl_Channel channel;
- int closeChannel;
- int done;
- unsigned long sum;
-#define BUFFSIZE 8192
-
- closeChannel = TRUE;
- if ((fileName[0] == '@') && (fileName[1] != '\0')) {
- int mode;
-
- channel = Tcl_GetChannel(interp, fileName+1, &mode);
- if (channel == NULL) {
- return TCL_ERROR;
- }
- if ((mode & TCL_WRITABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", fileName,
- "\" not opened for writing", (char *)NULL);
- return TCL_ERROR;
- }
- closeChannel = FALSE;
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "r", 0);
- if (channel == NULL) {
- return TCL_ERROR;
- }
- }
- if (Tcl_SetChannelOption(interp, channel, "-translation", "binary")
- != TCL_OK) {
- return TCL_ERROR;
- }
- done = FALSE;
- sum = *sumPtr;
- while (!done) {
- char *bp, *bend;
- int nBytes;
-#define BUFFSIZE 8192
- char buffer[BUFFSIZE];
-
- nBytes = Tcl_Read(channel, buffer, sizeof(char) * BUFFSIZE);
- if (nBytes < 0) {
- Tcl_AppendResult(interp, "\nread error: ", Tcl_PosixError(interp),
- (char *)NULL);
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- return TCL_ERROR;
- }
- done = Tcl_Eof(channel);
- for (bp = buffer, bend = bp + nBytes; bp < bend; bp++) {
- sum = CRC32(sum, *bp);
- }
- }
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- *sumPtr = sum;
- return TCL_OK;
-}
-
-
-/*ARGSUSED*/
-static int
-Crc32Cmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- unsigned long crc;
-
- crc = 0L;
- crc = crc ^ 0xffffffffUL;
- if (objc == 2) {
- if (Crc32File(interp, Tcl_GetString(objv[1]), &crc) != TCL_OK) {
- return TCL_ERROR;
- }
- } else if (objc == 3) {
- char *string;
-
- string = Tcl_GetString(objv[1]);
- if (strcmp(string, "-data") == 0) {
- if (Crc32FromObj(objv[2], &crc) != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ?fileName? ?-data dataString?",
- (char *)NULL);
- return TCL_ERROR;
- }
- } else {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ?fileName? ?-data dataString?",
- (char *)NULL);
- return TCL_ERROR;
- }
- crc = crc ^ 0xffffffffUL;
- {
- char buf[200];
-
- sprintf_s(buf, 200, "%lx", crc);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), buf, -1);
- }
- return TCL_OK;
-}
-
-int
-Blt_Crc32CmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {"crc32", Crc32Cmd,};
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
diff --git a/blt3.0.1/src/bltCsv.c b/blt3.0.1/src/bltCsv.c
deleted file mode 100644
index 3ef33b7..0000000
--- a/blt3.0.1/src/bltCsv.c
+++ /dev/null
@@ -1,414 +0,0 @@
-
-/*
- * bltCsv.c --
- *
- * This module implements a CSV reader procedure for the BLT toolkit.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-static int
-ParseCsvChannel(Tcl_Interp *interp, Tcl_Channel channel)
-{
- int inQuotes, isQuoted, isPath;
- char *fp, *field;
- Tcl_DString dString;
- Tcl_Obj *listObjPtr, *recordObjPtr;
- int fieldSize;
-
- isPath = isQuoted = inQuotes = FALSE;
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- recordObjPtr = NULL;
-
- Tcl_DStringInit(&dString);
- fieldSize = 128;
- Tcl_DStringSetLength(&dString, fieldSize + 1);
- fp = field = Tcl_DStringValue(&dString);
- for (;;) {
- char *bp, *bend;
-#define BUFFSIZE 8191
- char buffer[BUFFSIZE+1];
- int nBytes;
-
- nBytes = Tcl_Read(channel, buffer, sizeof(char) * BUFFSIZE);
- for (bp = buffer, bend = bp + nBytes; bp < bend; bp++) {
- switch (*bp) {
- case '\t':
- case ' ':
- /*
- * Add whitespace only if it's not leading or we're inside of
- * quotes or a path.
- */
- if ((fp != field) || (inQuotes) || (isPath)) {
- *fp++ = *bp;
- }
- break;
-
- case '\\':
- /*
- * Handle special case CSV files that allow unquoted paths.
- * Example: ...,\this\path " should\have been\quoted\,...
- */
- if (fp == field) {
- isPath = TRUE;
- }
- *fp++ = *bp;
- break;
-
- case '"':
- if (inQuotes) {
- if (*(bp+1) == '"') {
- *fp++ = '"';
- bp++;
- } else {
- inQuotes = FALSE;
- }
- } else {
- /*
- * If the quote doesn't start a field, then treat all
- * quotes in the field as ordinary characters.
- */
- if (fp == field) {
- isQuoted = inQuotes = TRUE;
- } else {
- *fp++ = *bp;
- }
- }
- break;
-
- case ',':
- case '\n':
- if (inQuotes) {
- *fp++ = *bp; /* Copy the comma or newline. */
- } else {
- char *last;
- Tcl_Obj *objPtr;
-
- if ((isPath) && (*bp == ',') && (fp != field) &&
- (*(fp - 1) != '\\')) {
- *fp++ = *bp; /* Copy the comma or newline. */
- break;
- }
- /* "last" points to the character after the last character
- * in the field. */
- last = fp;
-
- /* Remove trailing spaces only if the field wasn't
- * quoted. */
- if ((!isQuoted) && (!isPath)) {
- while ((last > field) && (isspace(*(last - 1)))) {
- last--;
- }
- }
- if (recordObjPtr == NULL) {
- if (*bp == '\n') {
- break; /* Ignore empty lines. */
- }
- recordObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- }
- /* End of field. Append field to record. */
- objPtr = Tcl_NewStringObj(field, last - field);
- Tcl_ListObjAppendElement(interp, recordObjPtr, objPtr);
- if (*bp == '\n') {
- /* On newlines append the record to the list. */
- Tcl_ListObjAppendElement(interp, listObjPtr,
- recordObjPtr);
- recordObjPtr = NULL;
- }
- fp = field;
- isPath = isQuoted = FALSE;
- }
- break;
-
- default:
- *fp++ = *bp; /* Copy the character. */
- }
- if ((fp - field) >= fieldSize) {
- int offset;
-
- /*
- * We've exceeded the current maximum size of the field.
- * Double the size of the field, but make sure to reset the
- * pointers (fp and field) to the (possibly) new memory
- * location.
- */
- offset = fp - field;
- fieldSize += fieldSize;
- Tcl_DStringSetLength(&dString, fieldSize + 1);
- field = Tcl_DStringValue(&dString);
- fp = field + offset;
- }
- }
- if (nBytes < 1) {
- /*
- * We're reached the end of input. But there may not have been a
- * final newline to trigger the final appends. So check if 1) a
- * last field is still needs appending the the last record and if
- * 2) a last record is still needs appending to the list.
- */
- if (fp != field) {
- char *last;
- Tcl_Obj *objPtr;
-
- last = fp;
- /* Remove trailing spaces */
- while (isspace(*(last - 1))) {
- last--;
- }
- objPtr = Tcl_NewStringObj(field, last - field);
- if (recordObjPtr == NULL) {
- recordObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- }
- }
- if (recordObjPtr != NULL) {
- Tcl_ListObjAppendElement(interp, listObjPtr, recordObjPtr);
- }
- break;
- }
- }
- Tcl_DStringFree(&dString);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-static int
-ParseCsvData(Tcl_Interp *interp, Tcl_Obj *objPtr)
-{
- int inQuotes, isQuoted, isPath;
- char *fp, *field;
- Tcl_DString dString;
- Tcl_Obj *listObjPtr, *recordObjPtr;
- int fieldSize;
-
- isPath = isQuoted = inQuotes = FALSE;
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- recordObjPtr = NULL;
-
- Tcl_DStringInit(&dString);
- fieldSize = 128;
- Tcl_DStringSetLength(&dString, fieldSize + 1);
- fp = field = Tcl_DStringValue(&dString);
- {
- char *bp, *bend;
- char *buffer;
- int nBytes;
-
- buffer = Tcl_GetStringFromObj(objPtr, &nBytes);
- for (bp = buffer, bend = bp + nBytes; bp < bend; bp++) {
- switch (*bp) {
- case '\t':
- case ' ':
- /*
- * Add whitespace only if it's not leading or we're inside of
- * quotes or a path.
- */
- if ((fp != field) || (inQuotes) || (isPath)) {
- *fp++ = *bp;
- }
- break;
-
- case '\\':
- if (fp == field) {
- isPath = TRUE;
- }
- *fp++ = *bp;
- break;
-
- case '"':
- if (inQuotes) {
- if (*(bp+1) == '"') {
- *fp++ = '"';
- bp++;
- } else {
- inQuotes = FALSE;
- }
- } else {
- /*
- * If the quote doesn't start a field, then treat all
- * quotes in the field as ordinary characters.
- */
- if (fp == field) {
- isQuoted = inQuotes = TRUE;
- } else {
- *fp++ = *bp;
- }
- }
- break;
-
- case ',':
- case '\n':
- if (inQuotes) {
- *fp++ = *bp; /* Copy the comma or newline. */
- } else {
- char *last;
- Tcl_Obj *objPtr;
-
- if ((isPath) && (*bp == ',') && (fp != field) &&
- (*(fp - 1) != '\\')) {
- *fp++ = *bp; /* Copy the comma or newline. */
- break;
- }
- /* "last" points to the character after the last character
- * in the field. */
- last = fp;
-
- /* Remove trailing spaces only if the field wasn't
- * quoted. */
- if ((!isQuoted) && (!isPath)) {
- while ((last > field) && (isspace(*(last - 1)))) {
- last--;
- }
- }
- if (recordObjPtr == NULL) {
- if (*bp == '\n') {
- break; /* Ignore empty lines. */
- }
- recordObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- }
- /* End of field. Append field to record. */
- objPtr = Tcl_NewStringObj(field, last - field);
- Tcl_ListObjAppendElement(interp, recordObjPtr, objPtr);
- if (*bp == '\n') {
- /* On newlines append the record to the list. */
- Tcl_ListObjAppendElement(interp, listObjPtr,
- recordObjPtr);
- recordObjPtr = NULL;
- }
- fp = field;
- isPath = isQuoted = FALSE;
- }
- break;
-
- default:
- *fp++ = *bp; /* Copy the character. */
- }
- if ((fp - field) >= fieldSize) {
- int offset;
-
- /*
- * We've exceeded the current maximum size of the field.
- * Double the size of the field, but make sure to reset the
- * pointers to the (possibly) new memory location.
- */
- offset = fp - field;
- fieldSize += fieldSize;
- Tcl_DStringSetLength(&dString, fieldSize + 1);
- field = Tcl_DStringValue(&dString);
- fp = field + offset;
- }
- }
-
- /*
- * We're reached the end of input. But there may not have been a final
- * newline to trigger the final appends. So check if 1) a last field
- * is still needs appending the the last record and if 2) a last
- * record is still needs appending to the list.
- */
- if (fp != field) {
- char *last;
- Tcl_Obj *objPtr;
-
- last = fp;
- /* Remove trailing spaces */
- while (isspace(*(last - 1))) {
- last--;
- }
- objPtr = Tcl_NewStringObj(field, last - field);
- if (recordObjPtr == NULL) {
- recordObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- }
- }
- if (recordObjPtr != NULL) {
- Tcl_ListObjAppendElement(interp, listObjPtr, recordObjPtr);
- }
- }
- Tcl_DStringFree(&dString);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-static int
-ParseCsvFile(Tcl_Interp *interp, const char *fileName)
-{
- int result;
- int closeChannel;
- Tcl_Channel channel;
-
- closeChannel = TRUE;
- if ((fileName[0] == '@') && (fileName[1] != '\0')) {
- int mode;
-
- channel = Tcl_GetChannel(interp, fileName+1, &mode);
- if (channel == NULL) {
- return TCL_ERROR;
- }
- if ((mode & TCL_READABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", fileName,
- "\" not opened for reading", (char *)NULL);
- return TCL_ERROR;
- }
- closeChannel = FALSE;
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "r", 0);
- if (channel == NULL) {
- return TCL_ERROR; /* Can't open dump file. */
- }
- }
- result = ParseCsvChannel(interp, channel);
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- return result;
-}
-
-static int
-CsvCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- if (objc == 2) {
- return ParseCsvFile(interp, Tcl_GetString(objv[1]));
- }
- if (objc == 3) {
- char *string;
-
- string = Tcl_GetString(objv[1]);
- if (strcmp(string, "-data") == 0) {
- return ParseCsvData(interp, objv[2]);
- }
- }
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ?fileName? ?-data dataString?", (char *)NULL);
- return TCL_ERROR;
-}
-
-int
-Blt_CsvCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {"csv", CsvCmd,};
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
diff --git a/blt3.0.1/src/bltCutbuffer.c b/blt3.0.1/src/bltCutbuffer.c
deleted file mode 100644
index 58dc0df..0000000
--- a/blt3.0.1/src/bltCutbuffer.c
+++ /dev/null
@@ -1,256 +0,0 @@
-
-/*
- * bltCutbuffer.c --
- *
- * Copyright 1993-1998 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_CUTBUFFER
-#include "bltOp.h"
-#ifndef WIN32
-#include <X11/Xproto.h>
-#endif
-
-static int
-GetCutNumberFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *bufferPtr)
-{
- int number;
-
- if (Tcl_GetIntFromObj(interp, objPtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((number < 0) || (number > 7)) {
- Tcl_AppendResult(interp, "bad buffer # \"", Tcl_GetString(objPtr),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- *bufferPtr = number;
- return TCL_OK;
-}
-
-/* ARGSUSED */
-static int
-RotateErrorProc(ClientData clientData, XErrorEvent *errEventPtr)
-{
- int *errorPtr = clientData;
-
- *errorPtr = TCL_ERROR;
- return 0;
-}
-
-static int
-GetOp(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tk_Window tkwin = clientData;
- char *string;
- int buffer;
- int nBytes;
-
- buffer = 0;
- if (objc == 3) {
- if (GetCutNumberFromObj(interp, objv[2], &buffer) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- string = XFetchBuffer(Tk_Display(tkwin), &nBytes, buffer);
- if (string != NULL) {
- int limit;
- char *p;
- int i;
-
- if (string[nBytes - 1] == '\0') {
- limit = nBytes - 1;
- } else {
- limit = nBytes;
- }
- for (p = string, i = 0; i < limit; i++, p++) {
- int c;
-
- c = (unsigned char)*p;
- if (c == 0) {
- *p = ' '; /* Convert embedded NUL bytes */
- }
- }
- if (limit == nBytes) {
- char *newPtr;
-
- /*
- * Need to copy the string into a bigger buffer so we can
- * add a NUL byte on the end.
- */
- newPtr = Blt_AssertMalloc(nBytes + 1);
- memcpy(newPtr, string, nBytes);
- newPtr[nBytes] = '\0';
- Blt_Free(string);
- string = newPtr;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), string, nBytes);
- }
- return TCL_OK;
-}
-
-static int
-RotateOp(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tk_Window tkwin = clientData;
- int count;
- int result;
- Tk_ErrorHandler handler;
-
- count = 1; /* Default: rotate one position */
- if (objc == 3) {
- if (Tcl_GetIntFromObj(interp, objv[2], &count) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((count < 0) || (count > 8)) {
- Tcl_AppendResult(interp, "bad rotate count \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- result = TCL_OK;
- handler = Tk_CreateErrorHandler(Tk_Display(tkwin), BadMatch,
- X_RotateProperties, -1, RotateErrorProc, &result);
- XRotateBuffers(Tk_Display(tkwin), count);
- Tk_DeleteErrorHandler(handler);
- XSync(Tk_Display(tkwin), False);
- if (result != TCL_OK) {
- Tcl_AppendResult(interp, "can't rotate cutbuffers unless all are set",
- (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-
-static int
-SetOp(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tk_Window tkwin = clientData;
- int buffer;
- char *string;
- int length;
-
- buffer = 0;
- if (objc == 4) {
- if (GetCutNumberFromObj(interp, objv[3], &buffer) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- string = Tcl_GetStringFromObj(objv[2], &length);
- XStoreBuffer(Tk_Display(tkwin), string, length + 1, buffer);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BLT Sub-command specification:
- *
- * - Name of the sub-command.
- * - Minimum number of characters needed to unambiguously
- * recognize the sub-command.
- * - Pointer to the function to be called for the sub-command.
- * - Minimum number of arguments accepted.
- * - Maximum number of arguments accepted.
- * - String to be displayed for usage.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec cbOps[] =
-{
- {"get", 1, GetOp, 2, 3, "?buffer?",},
- {"rotate", 1, RotateOp, 2, 3, "?count?",},
- {"set", 1, SetOp, 3, 4, "value ?buffer?",},
-};
-static int numCbOps = sizeof(cbOps) / sizeof(Blt_OpSpec);
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * CutBufferCmd --
- *
- * This procedure is invoked to process the "cutbuffer" Tcl
- * command. See the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-CutbufferCmd(
- ClientData clientData, /* Main window associated with
- * interpreter.*/
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- Tk_Window tkwin;
- Tcl_ObjCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, numCbOps, cbOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- tkwin = Tk_MainWindow(interp);
- result = (*proc) (tkwin, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_CutbufferCmdInitProc --
- *
- * This procedure is invoked to initialize the "cutbuffer" Tcl
- * command. See the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_CutbufferCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {"cutbuffer", CutbufferCmd,};
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-#endif /* NO_CUTBUFFER */
diff --git a/blt3.0.1/src/bltDBuffer.c b/blt3.0.1/src/bltDBuffer.c
deleted file mode 100644
index fddc2a3..0000000
--- a/blt3.0.1/src/bltDBuffer.c
+++ /dev/null
@@ -1,438 +0,0 @@
-
-/*
- * bltDBuffer.c --
- *
- * This module implements a dynamic buffer for the BLT toolkit.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include <bltDBuffer.h>
-
-typedef struct _Blt_DBuffer DBuffer;
-
-void
-Blt_DBuffer_Init(DBuffer *srcPtr)
-{
- srcPtr->bytes = NULL;
- srcPtr->cursor = srcPtr->count = srcPtr->nBytes = 0;
- srcPtr->chunk = 64;
-}
-
-void
-Blt_DBuffer_Free(DBuffer *srcPtr)
-{
- if ((srcPtr->bytes != NULL) && (srcPtr->nBytes > 0)) {
- Blt_Free(srcPtr->bytes);
- }
- Blt_DBuffer_Init(srcPtr);
-}
-
-Blt_DBuffer
-Blt_DBuffer_Create(void)
-{
- DBuffer *srcPtr;
-
- srcPtr = Blt_AssertMalloc(sizeof(DBuffer));
- Blt_DBuffer_Init(srcPtr);
- return srcPtr;
-}
-
-void
-Blt_DBuffer_Destroy(DBuffer *srcPtr)
-{
- Blt_DBuffer_Free(srcPtr);
- Blt_Free(srcPtr);
-}
-
-int
-Blt_DBuffer_Resize(DBuffer *srcPtr, size_t nBytes)
-{
- if (srcPtr->nBytes <= nBytes) {
- size_t size, wanted;
- unsigned char *bytes;
-
- wanted = nBytes + 1;
- size = srcPtr->chunk;
-
- /*
- * Double the buffer size until we have enough room or hit 64K. After
- * 64K, increase by multiples of 64K.
- */
- while ((size <= wanted) && (size < (1<<16))) {
- size += size;
- }
- srcPtr->chunk = size;
- while (size <= wanted) {
- size += srcPtr->chunk;
- }
- if (srcPtr->bytes == NULL) {
- bytes = Blt_Malloc(size);
- } else {
- bytes = Blt_Realloc(srcPtr->bytes, size);
- }
- if (bytes == NULL) {
- return FALSE;
- }
- srcPtr->bytes = bytes;
- srcPtr->nBytes = size;
- }
- return TRUE;
-}
-
-unsigned char *
-Blt_DBuffer_Extend(DBuffer *srcPtr, size_t nBytes)
-{
- unsigned char *bp;
-
- if (!Blt_DBuffer_Resize(srcPtr, srcPtr->count + nBytes)) {
- return NULL;
- }
- bp = srcPtr->bytes + srcPtr->count;
- srcPtr->count += nBytes;
- return bp;
-}
-
-void
-Blt_DBuffer_AppendByte(DBuffer *destPtr, unsigned char value)
-{
- if (Blt_DBuffer_Resize(destPtr, destPtr->count + sizeof(value))) {
- destPtr->bytes[destPtr->count] = value;
- destPtr->count++;
- }
-}
-
-void
-Blt_DBuffer_AppendShort(DBuffer *destPtr, unsigned short value)
-{
- if (Blt_DBuffer_Resize(destPtr, destPtr->count + sizeof(value))) {
- unsigned char *bp;
-
- bp = destPtr->bytes + destPtr->count;
-#ifdef WORDS_BIGENDIAN
- bp[0] = (value >> 8) & 0xFF;
- bp[1] = (value) & 0xFF;
-#else
- bp[0] = (value) & 0xFF;
- bp[1] = (value >> 8) & 0xFF;
-#endif
- destPtr->count += 2;
- }
-}
-
-void
-Blt_DBuffer_AppendLong(DBuffer *destPtr, unsigned int value)
-{
- if (Blt_DBuffer_Resize(destPtr, destPtr->count + sizeof(value))) {
- unsigned char *bp;
-
- bp = destPtr->bytes + destPtr->count;
-#ifdef WORDS_BIGENDIAN
- bp[0] = (value >> 24) & 0xFF;
- bp[1] = (value >> 16) & 0xFF;
- bp[2] = (value >> 8) & 0xFF;
- bp[3] = (value) & 0xFF;
-#else
- bp[0] = (value) & 0xFF;
- bp[1] = (value >> 8) & 0xFF;
- bp[2] = (value >> 16) & 0xFF;
- bp[3] = (value >> 24) & 0xFF;
-#endif
- destPtr->count += 4;
- }
-}
-
-Tcl_Obj *
-Blt_DBuffer_ByteArrayObj(DBuffer *srcPtr)
-{
- return Tcl_NewByteArrayObj(srcPtr->bytes, srcPtr->count);
-}
-
-Tcl_Obj *
-Blt_DBuffer_StringObj(DBuffer *srcPtr)
-{
- return Tcl_NewStringObj((char *)srcPtr->bytes, srcPtr->count);
-}
-
-int
-Blt_DBuffer_AppendData(DBuffer *srcPtr, const unsigned char *data,
- size_t nBytes)
-{
- unsigned char *bp;
-
- bp = Blt_DBuffer_Extend(srcPtr, nBytes);
- if (bp == NULL) {
- return FALSE;
- }
- memcpy(bp, data, nBytes);
- return TRUE;
-}
-
-void
-Blt_DBuffer_VarAppend
-TCL_VARARGS_DEF(DBuffer *, arg1)
-{
- DBuffer *srcPtr;
- va_list args;
-
- srcPtr = TCL_VARARGS_START(DBuffer, arg1, args);
- for (;;) {
- const unsigned char *string;
-
- string = va_arg(args, const unsigned char *);
- if (string == NULL) {
- break;
- }
- Blt_DBuffer_AppendData(srcPtr, string, strlen((const char *)string));
- }
-}
-
-void
-Blt_DBuffer_Print
-TCL_VARARGS_DEF(DBuffer *, arg1)
-{
- DBuffer *srcPtr;
- char *fmt;
- char string[BUFSIZ+4];
- int length;
- va_list args;
-
- srcPtr = TCL_VARARGS_START(DBuffer, arg1, args);
- fmt = va_arg(args, char *);
- length = vsnprintf(string, BUFSIZ, fmt, args);
- if (length > BUFSIZ) {
- strcat(string, "...");
- }
- va_end(args);
- Blt_DBuffer_AppendData(srcPtr, (unsigned char *)string, strlen(string));
-}
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifdef notdef
-int
-Blt_DBuffer_LoadFile(Tcl_Interp *interp, const char *fileName,
- Blt_DBuffer dBuffer)
-{
- FILE *f;
- size_t nBytes, nRead;
- struct stat sb;
- unsigned char *bytes;
-
-#ifdef WIN32
-#define READ_MODE "rb"
-#else
-#define READ_MODE "r"
-#endif
- f = Blt_OpenFile(interp, fileName, READ_MODE);
- if (f == NULL) {
- return TCL_ERROR;
- }
- if (fstat(fileno(f), &sb)) {
- Tcl_AppendResult(interp, "can't stat \"", fileName, "\": ",
- Tcl_PosixError(interp), (char *)NULL);
- return TCL_ERROR;
- }
- Blt_DBuffer_Init(dBuffer);
- nBytes = sb.st_size; /* Size of buffer */
- if (!Blt_DBuffer_Resize(dBuffer, nBytes)) {
- fclose(f);
- return TCL_ERROR;
- }
- bytes = Blt_DBuffer_Bytes(dBuffer);
- nRead = fread(bytes, sizeof(unsigned char), nBytes, f);
- Blt_DBuffer_SetLength(dBuffer, nRead);
- fclose(f);
- if (nRead != nBytes) {
- Tcl_AppendResult(interp, "short file \"", fileName, "\" : read ",
- Blt_Itoa(nBytes), " bytes.", (char *)NULL);
- Blt_DBuffer_Free(dBuffer);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-#else
-
-int
-Blt_DBuffer_LoadFile(
- Tcl_Interp *interp,
- const char *fileName,
- Blt_DBuffer dBuffer)
-{
- int nBytes;
- Tcl_Channel channel;
-
- if (fileName[0] == '@') {
- int mode;
-
- /* If the file name starts with a '@', then it represents the name of
- * a previously opened channel. Verify that the channel was opened
- * for reading. */
- fileName++;
- channel = Tcl_GetChannel(interp, fileName, &mode);
- if ((mode & TCL_READABLE) == 0) {
- Tcl_AppendResult(interp, "can't read from \"", fileName, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "r", 0);
- }
- if (channel == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_SetChannelOption(interp, channel, "-encoding", "binary")
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tcl_SetChannelOption(interp, channel, "-translation", "binary")
- != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_DBuffer_Init(dBuffer);
- nBytes = 0;
- while (!Tcl_Eof(channel)) {
- int nRead;
-#define BUFFER_SIZE (1<<16)
- char *bp;
-
- bp = (char *)Blt_DBuffer_Extend(dBuffer, BUFFER_SIZE);
- nRead = Tcl_ReadRaw(channel, bp, BUFFER_SIZE);
- if (nRead == -1) {
- Tcl_AppendResult(interp, "error reading ", fileName, ": ",
- Tcl_PosixError(interp), (char *)NULL);
- Blt_DBuffer_Free(dBuffer);
- return TCL_ERROR;
- }
- nBytes += nRead;
- Blt_DBuffer_SetLength(dBuffer, nBytes);
- }
- Tcl_Close(interp, channel);
- return TCL_OK;
-}
-
-#endif
-
-int
-Blt_DBuffer_SaveFile(Tcl_Interp *interp, const char *fileName,
- Blt_DBuffer dBuffer)
-{
- Tcl_Channel channel;
- size_t nWritten, nBytes;
- unsigned char *bytes;
-
- channel = Tcl_OpenFileChannel(interp, fileName, "w", 0660);
- if (channel == NULL) {
- return TCL_ERROR;
- }
- Tcl_SetChannelOption(interp, channel, "-translation", "binary");
- Tcl_SetChannelOption(interp, channel, "-encoding", "binary");
-
- nBytes = Blt_DBuffer_Length(dBuffer);
- bytes = Blt_DBuffer_Bytes(dBuffer);
- nWritten = Tcl_Write(channel, (char *)bytes, nBytes);
- Tcl_Close(interp, channel);
- if (nWritten != nBytes) {
- Tcl_AppendResult(interp, "short file \"", fileName, (char *)NULL);
- Tcl_AppendResult(interp, "\" : wrote ", Blt_Itoa(nWritten), " of ",
- (char *)NULL);
- Tcl_AppendResult(interp, Blt_Itoa(nBytes), " bytes.", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-#ifdef notdef
-static int
-ReadNextBlock(DBuffer *srcPtr)
-{
- if (srcPtr->channel == NULL) {
- return -1;
- }
- if (Tcl_Eof(srcPtr->channel)) {
- return 0;
- }
- nRead = Tcl_ReadRaw(srcPtr->channel, srcPtr->bytes, BUFFER_SIZE);
- if (nRead == -1) {
- Tcl_AppendResult(interp, "error reading channel: ",
- Tcl_PosixError(interp), (char *)NULL);
- return -1;
- }
- srcPtr->cursor = srcPtr->bytes;
- srcPtr->count = nRead;
- return 1;
-}
-
-int
-Blt_DBuffer_GetNext(DBuffer *srcPtr)
-{
- int byte;
-
- if ((srcPtr->cursor - srcPtr->bytes) >= srcPtr->count) {
- int result;
-
- result = 0;
- if (srcPtr->channel != NULL) {
- result = ReadNextBlock(srcPtr);
- }
- if (result <= 0) {
- return result;
- }
- }
- byte = *srcPtr->cursor;
- srcPtr->cursor++;
- return byte;
-}
-#endif
-
-int
-Blt_DBuffer_DecodeBase64(Tcl_Interp *interp, const char *string, size_t length,
- DBuffer *destPtr)
-{
- unsigned char *bp;
-
- bp = Blt_Base64_Decode(interp, string, &length);
- if (bp == NULL) {
- return TCL_ERROR;
- }
- if (destPtr->bytes != NULL) {
- Blt_Free(destPtr->bytes);
- }
- destPtr->bytes = bp;
- destPtr->nBytes = destPtr->count = length;
- destPtr->cursor = 0;
- destPtr->chunk = 64;
- return TCL_OK;
-}
-
-
-char *
-Blt_DBuffer_EncodeBase64(
- Tcl_Interp *interp, /* Interpreter to report errors to. */
- DBuffer *srcPtr) /* Input binary buffer. */
-{
- return Blt_Base64_Encode(interp, srcPtr->bytes, srcPtr->count);
-}
-
diff --git a/blt3.0.1/src/bltDBuffer.h b/blt3.0.1/src/bltDBuffer.h
deleted file mode 100644
index bf62bb6..0000000
--- a/blt3.0.1/src/bltDBuffer.h
+++ /dev/null
@@ -1,95 +0,0 @@
-
-/*
- * bltDBuffer.h --
- *
- * Copyright 2003-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_DBUFFER_H
-#define _BLT_DBUFFER_H
-
-typedef struct _Blt_DBuffer {
- unsigned char *bytes; /* Stores output (malloc-ed).*/
- size_t nBytes; /* Size of dynamically allocated buffer. */
-
- size_t count; /* # of bytes read into the buffer. Marks the
- * # current fill point of the buffer. */
- size_t cursor; /* Current position in buffer. */
- size_t chunk; /* Buffer growth size. */
-
-} *Blt_DBuffer;
-
-
-BLT_EXTERN void Blt_DBuffer_VarAppend TCL_VARARGS(Blt_DBuffer, buffer);
-
-BLT_EXTERN void Blt_DBuffer_Print TCL_VARARGS(Blt_DBuffer, buffer);
-
-BLT_EXTERN void Blt_DBuffer_Init(Blt_DBuffer buffer);
-BLT_EXTERN void Blt_DBuffer_Free(Blt_DBuffer buffer);
-BLT_EXTERN unsigned char *Blt_DBuffer_Extend(Blt_DBuffer buffer, size_t extra);
-BLT_EXTERN int Blt_DBuffer_AppendData(Blt_DBuffer buffer,
- const unsigned char *bytes, size_t extra);
-BLT_EXTERN int Blt_DBuffer_Resize(Blt_DBuffer buffer, size_t length);
-BLT_EXTERN Blt_DBuffer Blt_DBuffer_Create(void);
-BLT_EXTERN void Blt_DBuffer_Destroy(Blt_DBuffer buffer);
-
-BLT_EXTERN int Blt_DBuffer_LoadFile(Tcl_Interp *interp, const char *fileName,
- Blt_DBuffer buffer);
-BLT_EXTERN int Blt_DBuffer_SaveFile(Tcl_Interp *interp, const char *fileName,
- Blt_DBuffer buffer);
-
-BLT_EXTERN void Blt_DBuffer_AppendByte(Blt_DBuffer buffer, unsigned char byte);
-BLT_EXTERN void Blt_DBuffer_AppendShort(Blt_DBuffer buffer,
- unsigned short value);
-BLT_EXTERN void Blt_DBuffer_AppendLong(Blt_DBuffer buffer, unsigned int value);
-BLT_EXTERN Tcl_Obj *Blt_DBuffer_ByteArrayObj(Blt_DBuffer buffer);
-BLT_EXTERN Tcl_Obj *Blt_DBuffer_StringObj(Blt_DBuffer buffer);
-
-#define Blt_DBuffer_Bytes(s) ((s)->bytes)
-#define Blt_DBuffer_Size(s) ((s)->nBytes)
-
-#define Blt_DBuffer_BytesLeft(s) ((s)->count - (s)->cursor)
-#define Blt_DBuffer_NextByte(s) ((s)->bytes[(s)->cursor++])
-#define Blt_DBuffer_Pointer(s) ((s)->bytes + (s)->cursor)
-#define Blt_DBuffer_SetPointer(s,p) ((s)->cursor = (p) - (s)->bytes)
-
-#define Blt_DBuffer_ResetCursor(s) ((s)->cursor = 0)
-#define Blt_DBuffer_Cursor(s) ((s)->cursor)
-#define Blt_DBuffer_SetCursor(s,n) ((s)->cursor = (n))
-#define Blt_DBuffer_IncrCursor(s,i) ((s)->cursor += (i))
-
-#define Blt_DBuffer_End(s) ((s)->bytes + (s)->count)
-#define Blt_DBuffer_Length(s) ((s)->count)
-#define Blt_DBuffer_SetLengthFromPointer(s,p) \
- ((s)->count = ((p) - (s)->bytes))
-#define Blt_DBuffer_SetLength(s,i) \
- ((s)->count = (i), (s)->bytes[(s)->count] = '\0')
-#define Blt_DBuffer_IncrLength(s,i) ((s)->count += (i))
-
-BLT_EXTERN int Blt_DBuffer_DecodeBase64(Tcl_Interp *interp,
- const char *string, size_t length, Blt_DBuffer buffer);
-BLT_EXTERN char *Blt_DBuffer_EncodeBase64(Tcl_Interp *interp,
- Blt_DBuffer buffer);
-
-BLT_EXTERN int Blt_IsBase64(const unsigned char *bytes, size_t length);
-
-#endif /*_BLT_DBUFFER_H*/
diff --git a/blt3.0.1/src/bltDataTable.c b/blt3.0.1/src/bltDataTable.c
deleted file mode 100644
index f8e418b..0000000
--- a/blt3.0.1/src/bltDataTable.c
+++ /dev/null
@@ -1,5889 +0,0 @@
-
-/*
- *
- * bltDataTable.c --
- *
- * Copyright 1998-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <bltInt.h>
-#include <bltHash.h>
-#include <bltPool.h>
-#include <bltNsUtil.h>
-#include <bltArrayObj.h>
-#include <bltDataTable.h>
-
-/*
- * Row and Column Information Structures
- *
- * Map: Array of pointers to headers, representing the logical
- * view of row/column.
- *
- * x = pointer to row/column header.
- * y = row/column header.
- * label
- * index: logical location of row/column.
- * offset: physical location of row/column in table storage.
- * type: column type.
- * flags:
- *
- * [x] [x] [x] [x] [x] [x] [x] [x] [ ] [ ] [ ]
- * | | | | | | | |
- * v v v v v v v v
- * [y] [y] [y] [y] [y] [y] [y] [y]
- *
- *
- * Free list: Chain of free locations. Holds the physical offset
- * of next free row or column. The offsets of deleted
- * rows/columns are prepended to this list.
- *
- * x = offset of free row/column in table storage.
- *
- * [x]->[x]->[x]->[x]->[x]
- *
- * Header pool: Pool of row/column headers. Act as smart pointers
- * to row/column locations. Will remain valid even if
- * the logical view is changed (i.e. sorting) or physical
- * storage is compacted.
- *
- * Data Vectors.
- * Vectors: array of Value arrays.
- *
- * x = pointer to Value array.
- * y = array of Values.
- *
- * Array of vectors: [x] [x] [x] [x] [x] [ ] [x] [x] [x] [ ] [ ] [ ]
- * [y] [y] [y] [y] [y] [y] [y] [y]
- * [y] [y] [y] [y] [y] [y] [y] [y]
- * [y] [y] [ ] [y] [y] [y] [y] [y]
- * [y] [y] [y] [y] [y] [y] [y] [y]
- * [y] [y] [y] [y] [y] [y] [y] [y]
- * [y] [y] [y] [ ] [y] [y] [y] [y]
- * [y] [y] [y] [y] [y] [y] [y] [y]
- * [y] [y] [y] [y] [y] [y] [ ] [y]
- * [y] [y] [y] [y] [y] [y] [y] [y]
- * [y] [y] [y] [y] [y] [y] [y] [y]
- * [y] [y] [y] [y] [y] [y] [y] [y]
- * [y] [y] [y] [y] [y] [y] [y] [y]
- * [y] [y] [y] [y] [y] [y] [y] [y]
- * [y] [y] [y] [y] [y] [y] [y] [y]
- * [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
- * [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
- * [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
- * [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
- * [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
- *
- */
-
-#define NumColumnsAllocated(t) ((t)->corePtr->columns.nAllocated)
-#define NumRowsAllocated(t) ((t)->corePtr->rows.nAllocated)
-
-#define TABLE_THREAD_KEY "BLT DataTable Data"
-#define TABLE_MAGIC ((unsigned int) 0xfaceface)
-#define TABLE_DESTROYED (1<<0)
-
-#define TABLE_ALLOC_MAX_DOUBLE_SIZE (1<<16)
-#define TABLE_ALLOC_MAX_CHUNK (1<<16)
-#define TABLE_NOTIFY_ANY (NULL)
-
-#define TABLE_KEYS_DIRTY (1<<0)
-#define TABLE_KEYS_UNIQUE (1<<1)
-
-/* Column flag. */
-#define TABLE_COLUMN_PRIMARY_KEY (1<<0)
-
-typedef struct _Blt_TableValue Value;
-
-typedef struct {
- long nRows, nCols;
- long mtime, ctime;
- const char *fileName;
- long nLines;
- unsigned int flags;
- int argc;
- const char **argv;
- Blt_HashTable rowIndices, colIndices;
-} RestoreData;
-
-typedef struct _Blt_Table Table;
-typedef struct _Blt_TableTags Tags;
-typedef struct _Blt_TableTrace Trace;
-typedef struct _Blt_TableNotifier Notifier;
-
-const char *valueTypes[] = {
- "string", "int", "double", "long",
-};
-
-/*
- * _Blt_TableTags --
- *
- * Structure representing tags used by a client of the table.
- *
- * Table rows and columns may be tagged with strings. A row may have
- * many tags. The same tag may be used for many rows. Tags are used and
- * stored by clients of a table. Tags can also be shared between clients
- * of the same table.
- *
- * Both rowTable and columnTable are hash tables keyed by the physical
- * row or column location in the table respectively. This is not the
- * same as the client's view (the order of rows or columns as seen by the
- * client). This is so that clients (which may have different views) can
- * share tags without sharing the same view.
- */
-struct _Blt_TableTags {
- Blt_HashTable rowTable; /* Table of row indices. Each entry
- * is itself a hash table of tag
- * names. */
- Blt_HashTable columnTable; /* Table of column indices. Each
- * entry is itself a hash table of tag
- * names. */
- int refCount; /* Tracks the number of clients
- * currently using these tags. If
- * refCount goes to zero, this means
- * the table can safely be freed. */
-};
-
-typedef struct {
- Blt_HashTable clientTable; /* Tracks all table clients. */
- unsigned int nextId;
- Tcl_Interp *interp;
-} InterpData;
-
-typedef struct _Blt_TableHeader Header;
-typedef struct _Blt_TableRow Row;
-typedef struct _Blt_TableColumn Column;
-typedef struct _Blt_TableCore TableObject;
-typedef struct _Blt_TableRowColumn RowColumn;
-
-typedef struct {
- Blt_TableRow row;
- Blt_TableColumn column;
-} RowColumnKey;
-
-static Blt_TableRowColumnClass rowClass = {
- "row", sizeof(struct _Blt_TableRow)
-};
-
-static Blt_TableRowColumnClass columnClass = {
- "column", sizeof(struct _Blt_TableColumn)
-};
-
-static Tcl_InterpDeleteProc TableInterpDeleteProc;
-static void DestroyTable(Table *tablePtr);
-
-static void
-FreeRowColumn(RowColumn *rcPtr)
-{
- Header **hpp, **hend;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&rcPtr->labelTable, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(tablePtr);
- Blt_Free(tablePtr);
- }
- Blt_DeleteHashTable(&rcPtr->labelTable);
- Blt_Chain_Destroy(rcPtr->freeList);
-
- for (hpp = rcPtr->map, hend = hpp + rcPtr->nUsed; hpp < hend; hpp++) {
- Blt_PoolFreeItem(rcPtr->headerPool, *hpp);
- }
- Blt_PoolDestroy(rcPtr->headerPool);
- Blt_Free(rcPtr->map);
-}
-
-static void
-UnsetLabel(RowColumn *rcPtr, Header *headerPtr)
-{
- Blt_HashEntry *hPtr;
-
- if (headerPtr->label == NULL) {
- return;
- }
- hPtr = Blt_FindHashEntry(&rcPtr->labelTable, headerPtr->label);
- if (hPtr != NULL) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *h2Ptr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tablePtr, (char *)headerPtr);
- if (h2Ptr != NULL) {
- Blt_DeleteHashEntry(tablePtr, h2Ptr);
- }
- if (tablePtr->numEntries == 0) {
- Blt_DeleteHashEntry(&rcPtr->labelTable, hPtr);
- Blt_DeleteHashTable(tablePtr);
- Blt_Free(tablePtr);
- }
- }
- headerPtr->label = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetLabel --
- *
- * Changes the label for the row or column. Labels aren't necessarily
- * unique, it's not enforced. The rationale is that it is convenient
- * to be able to add rows/columns to a table, and then change the
- * labels. For example, when importing table data from a file,
- * you can't apriori change the labels. We could add #n to make the
- * label unique, but changing them is a pain.
- *
- *
- * Results:
- * Returns a pointer to the new object is successful, NULL otherwise. If
- * a table object can't be generated, interp->result will contain an
- * error message.
- *
- * --------------------------------------------------------------------------
- */
-static void
-SetLabel(RowColumn *rcPtr, Header *headerPtr, const char *newLabel)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- Blt_HashTable *tablePtr; /* Secondary table. */
-
- if (headerPtr->label != NULL) {
- UnsetLabel(rcPtr, headerPtr);
- }
- if (newLabel == NULL) {
- return;
- }
- /* Check the primary label table for the bucket. */
- hPtr = Blt_CreateHashEntry(&rcPtr->labelTable, newLabel, &isNew);
- if (isNew) {
- tablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(tablePtr, BLT_ONE_WORD_KEYS);
- Blt_SetHashValue(hPtr, tablePtr);
- } else {
- tablePtr = Blt_GetHashValue(hPtr);
- }
- /* Save the label as the hash entry key. */
- headerPtr->label = Blt_GetHashKey(&rcPtr->labelTable, hPtr);
- /* Now look the header in the secondary table. */
- hPtr = Blt_CreateHashEntry(tablePtr, (char *)headerPtr, &isNew);
- if (!isNew) {
- return; /* It's already there. */
- }
- /* Add it to the secondary table. */
- Blt_SetHashValue(hPtr, headerPtr);
-}
-
-static int
-CheckLabel(Tcl_Interp *interp, RowColumn *rcPtr, const char *label)
-{
- char c;
-
- c = label[0];
- /* This is so we know where switches end. */
- if (c == '-') {
- if (interp != NULL) {
- Tcl_AppendResult(interp, rcPtr->classPtr->name, " label \"",
- label, "\" can't start with a '-'.", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (isdigit(UCHAR(c))) {
- long index;
-
- if (TclGetLong(NULL, (char *)label, &index) == TCL_OK) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, rcPtr->classPtr->name, " label \"",
- label, "\" can't be a number.", (char *)NULL);
- }
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-static int
-SetHeaderLabel(Tcl_Interp *interp, RowColumn *rcPtr, Header *headerPtr,
- const char *newLabel)
-{
- if (CheckLabel(interp, rcPtr, newLabel) != TCL_OK) {
- return TCL_ERROR;
- }
- SetLabel(rcPtr, headerPtr, newLabel);
- return TCL_OK;
-}
-
-#if (SIZEOF_VOID_P == 8)
-#define LABEL_FMT "%c%ld"
-#else
-#define LABEL_FMT "%c%d"
-#endif
-
-static void
-GetNextLabel(RowColumn *rcPtr, Header *headerPtr)
-{
- char label[200];
-
- for(;;) {
- Blt_HashEntry *hPtr;
-
- sprintf_s(label, 200, LABEL_FMT, rcPtr->classPtr->name[0],
- rcPtr->nextId++);
- hPtr = Blt_FindHashEntry(&rcPtr->labelTable, label);
- if (hPtr == NULL) {
- SetLabel(rcPtr, headerPtr, label);
- return;
- }
- }
-}
-
-static long
-GetMapSize(long oldLen, long extra)
-{
- long newLen, reqLen;
-
- reqLen = oldLen + extra;
- newLen = oldLen;
- if (newLen == 0) {
- newLen = 1;
- }
- if (reqLen < TABLE_ALLOC_MAX_DOUBLE_SIZE) {
- while (newLen < reqLen) {
- newLen += newLen;
- }
- } else {
- while (newLen < reqLen) {
- newLen += TABLE_ALLOC_MAX_CHUNK;
- }
- }
- return newLen;
-}
-
-static int
-GrowHeaders(RowColumn *rcPtr, long extra)
-{
- long newSize, oldSize;
- Header **map;
-
- newSize = GetMapSize(rcPtr->nAllocated, extra);
- oldSize = rcPtr->nAllocated;
- map = rcPtr->map;
- if (map == NULL) {
- map = Blt_Malloc(sizeof(Header *) * newSize);
- } else {
- map = Blt_Realloc(rcPtr->map, sizeof(Header *) * newSize);
- }
- if (map == NULL) {
- return FALSE;
- }
- {
- Header **mp;
- long i;
-
- /* Initialize the new extra header slots in the map to NULL and add
- * them the free list. */
- for (i = oldSize, mp = map + oldSize; i < newSize; i++, mp++) {
- Blt_Chain_Append(rcPtr->freeList, (ClientData)i);
- *mp = NULL; /* Initialize new slots in the map. */
- }
- }
- rcPtr->map = map;
- rcPtr->nAllocated = newSize;
- return TRUE;
-}
-
-static int
-GrowColumns(Table *tablePtr, long extraCols)
-{
- if (extraCols > 0) {
- long oldCols, newCols;
- Value **data, **vp, **vend;
-
- oldCols = NumColumnsAllocated(tablePtr);
- if (!GrowHeaders(&tablePtr->corePtr->columns, extraCols)) {
- return FALSE;
- }
- newCols = NumColumnsAllocated(tablePtr);
-
- /* Resize the vector array to have as many slots as columns. */
- data = tablePtr->corePtr->data;
- if (data == NULL) {
- data = Blt_Malloc(newCols * sizeof(Value *));
- } else {
- data = Blt_Realloc(data, newCols * sizeof(Value *));
- }
- if (data == NULL) {
- return FALSE;
- }
- /* Initialize the new vector slots to NULL. */
- for (vp = data + oldCols, vend = data + newCols; vp < vend; vp++) {
- *vp = NULL;
- }
- tablePtr->corePtr->data = data;
- }
- return TRUE;
-}
-
-static int
-GrowRows(Table *tablePtr, long extraRows)
-{
- if (extraRows > 0) {
- long oldRows, newRows;
- Value **vpp, **vpend;
-
- oldRows = NumRowsAllocated(tablePtr);
- if (!GrowHeaders(&tablePtr->corePtr->rows, extraRows)) {
- return FALSE;
- }
- newRows = NumRowsAllocated(tablePtr);
-
- /* Resize all the vectors. Leave the empty vectors alone. They are
- * allocated when data is added to them. */
- for (vpp = tablePtr->corePtr->data,
- vpend = vpp + NumColumnsAllocated(tablePtr);
- vpp < vpend; vpp++) {
- if (*vpp != NULL) {
- Value *vector, *vp, *vend;
-
- vector = Blt_Realloc(*vpp, newRows * sizeof(Value));
- for (vp = vector + oldRows, vend = vector + newRows;
- vp < vend; vp++) {
- vp->string = NULL;
- }
- *vpp = vector;
- }
- }
- }
- return TRUE;
-}
-
-static void
-ExtendHeaders(RowColumn *rcPtr, long n, Blt_Chain chain)
-{
- Blt_ChainLink link;
- long nextIndex;
- long i;
-
- /*
- * At this point we're guaranteed to have as many free rows/columns in
- * the table as requested.
- */
- link = Blt_Chain_FirstLink(rcPtr->freeList);
- nextIndex = rcPtr->nUsed;
- for (i = 0; i < n; i++) {
- Blt_ChainLink next;
- Header *headerPtr;
-
- headerPtr = Blt_PoolAllocItem(rcPtr->headerPool,
- rcPtr->classPtr->headerSize);
- memset(headerPtr, 0, rcPtr->classPtr->headerSize);
- GetNextLabel(rcPtr, headerPtr);
- headerPtr->offset = (long)Blt_Chain_GetValue(link);
- rcPtr->map[nextIndex] = headerPtr;
- nextIndex++;
- headerPtr->index = nextIndex;
-
- /* Remove the link the freelist and append it to the output chain. */
- next = Blt_Chain_NextLink(link);
- Blt_Chain_UnlinkLink(rcPtr->freeList, link);
- Blt_Chain_AppendLink(chain, link);
- Blt_Chain_SetValue(link, headerPtr);
- link = next;
- }
- rcPtr->nUsed += n;
-}
-
-static int
-ExtendRows(Table *tablePtr, long n, Blt_Chain chain)
-{
- long nFree;
-
- nFree = Blt_Chain_GetLength(tablePtr->corePtr->rows.freeList);
- if (n > nFree) {
- long needed;
-
- needed = n - nFree;
- if (!GrowRows(tablePtr, needed)) {
- return FALSE;
- }
- }
- ExtendHeaders(&tablePtr->corePtr->rows, n, chain);
- tablePtr->flags |= TABLE_KEYS_DIRTY;
- return TRUE;
-}
-
-static int
-ExtendColumns(Table *tablePtr, long n, Blt_Chain chain)
-{
- long nFree;
-
- nFree = Blt_Chain_GetLength(tablePtr->corePtr->columns.freeList);
- if (n > nFree) {
- if (!GrowColumns(tablePtr, n - nFree)) {
- return FALSE;
- }
- }
- ExtendHeaders(&tablePtr->corePtr->columns, n, chain);
- return TRUE;
-}
-
-Blt_TableColumnType
-Blt_Table_GetColumnType(const char *typeName)
-{
- if (strcmp(typeName, "string") == 0) {
- return TABLE_COLUMN_TYPE_STRING;
- } else if (strcmp(typeName, "integer") == 0) {
- return TABLE_COLUMN_TYPE_INT;
- } else if (strcmp(typeName, "double") == 0) {
- return TABLE_COLUMN_TYPE_DOUBLE;
- } else if (strcmp(typeName, "long") == 0) {
- return TABLE_COLUMN_TYPE_LONG;
- } else {
- return TABLE_COLUMN_TYPE_UNKNOWN;
- }
-}
-
-static INLINE int
-IsEmpty(Value *valuePtr)
-{
- return ((valuePtr == NULL) || (valuePtr->string == NULL));
-}
-
-static INLINE void
-FreeValue(Value *valuePtr)
-{
- if (valuePtr->string != NULL) {
- Blt_Free(valuePtr->string);
- }
- valuePtr->string = NULL;
-}
-
-
-static void
-FreeVector(Value *vector, long length)
-{
- if (vector != NULL) {
- Value *vp, *vend;
-
- for (vp = vector, vend = vp + length; vp < vend; vp++) {
- FreeValue(vp);
- }
- Blt_Free(vector);
- }
-}
-
-static Value *
-AllocateVector(Table *tablePtr, long offset)
-{
- Value *vector;
-
- vector = tablePtr->corePtr->data[offset];
- if (vector == NULL) {
-
- vector = Blt_Calloc(NumRowsAllocated(tablePtr), sizeof(Value));
- if (vector == NULL) {
- return NULL;
- }
- tablePtr->corePtr->data[offset] = vector;
- }
- return vector;
-}
-
-static Value *
-GetValue(Table *tablePtr, Row *rowPtr, Column *colPtr)
-{
- Value *vector;
-
- vector = tablePtr->corePtr->data[colPtr->offset];
- if (vector == NULL) {
- vector = AllocateVector(tablePtr, colPtr->offset);
- }
- return vector + rowPtr->offset;
-}
-
-static Tcl_Obj *
-GetObjFromValue(Tcl_Interp *interp, Blt_TableColumnType type, Value *valuePtr)
-{
- Tcl_Obj *objPtr;
-
- if (IsEmpty(valuePtr)) {
- return NULL;
- }
- switch (type) {
- case TABLE_COLUMN_TYPE_UNKNOWN:
- case TABLE_COLUMN_TYPE_STRING: /* string */
- objPtr = Tcl_NewStringObj(valuePtr->string, -1);
- break;
- case TABLE_COLUMN_TYPE_DOUBLE: /* double */
- objPtr = Tcl_NewDoubleObj(valuePtr->datum.d);
- break;
- case TABLE_COLUMN_TYPE_LONG: /* long */
- objPtr = Tcl_NewLongObj(valuePtr->datum.l);
- break;
- case TABLE_COLUMN_TYPE_INT: /* int */
- objPtr = Tcl_NewIntObj((int)valuePtr->datum.l);
- break;
- }
- return objPtr;
-}
-
-static int
-SetValueFromObj(Tcl_Interp *interp, Blt_TableColumnType type, Tcl_Obj *objPtr,
- Value *valuePtr)
-{
- int length;
- const char *s;
-
- FreeValue(valuePtr);
- if (objPtr == NULL) {
- return TCL_OK;
- }
- switch (type) {
- case TABLE_COLUMN_TYPE_DOUBLE: /* double */
- if (Blt_GetDoubleFromObj(interp, objPtr, &valuePtr->datum.d)!=TCL_OK) {
- return TCL_ERROR;
- }
- break;
- case TABLE_COLUMN_TYPE_LONG: /* long */
- case TABLE_COLUMN_TYPE_INT: /* int */
- if (Tcl_GetLongFromObj(interp, objPtr, &valuePtr->datum.l) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
- default:
- break;
- }
- s = Tcl_GetStringFromObj(objPtr, &length);
- valuePtr->string = Blt_AssertMalloc(length + 1);
- strcpy(valuePtr->string, s);
- return TCL_OK;
-}
-
-
-static int
-SetValueFromString(Tcl_Interp *interp, Blt_TableColumnType type, const char *s,
- int length, Value *valuePtr)
-{
- double d;
- long l;
- char *string;
-
- if (length < 0) {
- length = strlen(s);
- }
- /* Make a copy of the string, eventually used for string rep. */
- string = Blt_AssertMalloc(length + 1);
- strncpy(string, s, length);
- string[length] = '\0';
-
- switch (type) {
- case TABLE_COLUMN_TYPE_DOUBLE: /* double */
- if (Blt_GetDoubleFromString(interp, string, &d) != TCL_OK) {
- Blt_Free(string);
- return TCL_ERROR;
- }
- valuePtr->datum.d = d;
- break;
- case TABLE_COLUMN_TYPE_LONG: /* long */
- case TABLE_COLUMN_TYPE_INT: /* int */
- if (TclGetLong(interp, string, &l) != TCL_OK) {
- Blt_Free(string);
- return TCL_ERROR;
- }
- valuePtr->datum.l = l;
- break;
- default:
- break;
- }
- FreeValue(valuePtr);
- valuePtr->string = string;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewTableObject --
- *
- * Creates and initializes a new table object.
- *
- * Results:
- * Returns a pointer to the new object is successful, NULL otherwise. If
- * a table object can't be generated, interp->result will contain an
- * error message.
- *
- * --------------------------------------------------------------------------
- */
-static TableObject *
-NewTableObject(void)
-{
- TableObject *corePtr;
-
- corePtr = Blt_Calloc(1, sizeof(TableObject));
- if (corePtr == NULL) {
- return NULL;
- }
- corePtr->clients = Blt_Chain_Create();
-
- Blt_InitHashTableWithPool(&corePtr->columns.labelTable, BLT_STRING_KEYS);
- Blt_InitHashTableWithPool(&corePtr->rows.labelTable, BLT_STRING_KEYS);
- corePtr->columns.classPtr = &columnClass;
- corePtr->columns.freeList = Blt_Chain_Create();
- corePtr->columns.headerPool = Blt_PoolCreate(BLT_FIXED_SIZE_ITEMS);
- corePtr->columns.nextId = 1;
- corePtr->rows.classPtr = &rowClass;
- corePtr->rows.freeList = Blt_Chain_Create();
- corePtr->rows.headerPool = Blt_PoolCreate(BLT_FIXED_SIZE_ITEMS);
- corePtr->rows.nextId = 1;
- return corePtr;
-}
-
-static void
-DestroyTraces(Blt_Chain chain)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Trace *tp;
-
- tp = Blt_Chain_GetValue(link);
- tp->link = NULL;
- Blt_Table_DeleteTrace(tp);
- }
- Blt_Chain_Destroy(chain);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyIdleProc --
- *
- * Used to invoke event handler routines at some idle point. This
- * routine is called from the TCL event loop. Errors generated by the
- * event handler routines are backgrounded.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-NotifyIdleProc(ClientData clientData)
-{
- Notifier *notifierPtr = clientData;
- int result;
-
- notifierPtr->flags &= ~TABLE_NOTIFY_PENDING;
-
- /* Protect the notifier in case it's deleted by the callback. */
- Tcl_Preserve(notifierPtr);
- notifierPtr->flags |= TABLE_NOTIFY_ACTIVE;
- result = (*notifierPtr->proc)(notifierPtr->clientData, ¬ifierPtr->event);
- notifierPtr->flags &= ~TABLE_NOTIFY_ACTIVE;
- if (result == TCL_ERROR) {
- Tcl_BackgroundError(notifierPtr->interp);
- }
- Tcl_Release(notifierPtr);
-}
-
-static void
-FreeNotifier(Notifier *notifierPtr)
-{
- if (notifierPtr->tag != NULL) {
- Blt_Free(notifierPtr->tag);
- }
- if (notifierPtr->link != NULL){
- Blt_Chain_DeleteLink(notifierPtr->chain, notifierPtr->link);
- }
- Blt_Free(notifierPtr);
-}
-
-static void
-DestroyNotifiers(Blt_Chain chain)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Notifier *notifierPtr;
-
- notifierPtr = Blt_Chain_GetValue(link);
- notifierPtr->link = NULL;
- Blt_Table_DeleteNotifier(notifierPtr);
- }
- Blt_Chain_Destroy(chain);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DumpTags --
- *
- * Retrieves all tags for a given row or column into a tcl list.
- *
- * Results:
- * Returns the number of tags in the list.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DumpTags(Blt_HashTable *tagTablePtr, Header *headerPtr, Blt_Chain chain)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(tagTablePtr, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_HashEntry *h2Ptr;
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tablePtr, (char *)headerPtr);
- if (h2Ptr != NULL) {
- Blt_Chain_Append(chain, Blt_GetHashKey(tagTablePtr, hPtr));
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClearTags --
- *
- * Removes all tags for a given row or column.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * All tags associcated with the row are freed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ClearTags(Blt_HashTable *tagTablePtr, Header *headerPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(tagTablePtr, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_HashEntry *h2Ptr;
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tablePtr, (char *)headerPtr);
- if (h2Ptr != NULL) {
- Blt_DeleteHashEntry(tablePtr, h2Ptr);
- }
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyTableObject --
- *
- * Destroys the table object. This is the final clean up of the object.
- * The object's entry is removed from the hash table of tables.
- *
- * Results:
- * None.
- *
- * --------------------------------------------------------------------------
- */
-static void
-DestroyTableObject(TableObject *corePtr)
-{
- corePtr->flags |= TABLE_DESTROYED;
-
- assert(Blt_Chain_GetLength(corePtr->clients) == 0);
- Blt_Chain_Destroy(corePtr->clients);
-
- /* Free the headers containing row and column info. */
- /* Free the data in each row. */
- if (corePtr->data != NULL) {
- Value **vp, **vend;
- long i;
-
- for (i = 0, vp = corePtr->data, vend = vp + corePtr->columns.nAllocated;
- vp < vend; vp++, i++) {
- if (*vp != NULL) {
- Column *colPtr;
-
- colPtr = (Blt_TableColumn)corePtr->columns.map[i];
- FreeVector(*vp, corePtr->rows.nAllocated);
- }
- }
- Blt_Free(corePtr->data);
- }
- FreeRowColumn(&corePtr->rows);
- FreeRowColumn(&corePtr->columns);
- Blt_Free(corePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableInterpDeleteProc --
- *
- * This is called when the interpreter hosting the table object is
- * deleted from the interpreter.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Destroys all remaining tables and removes the hash table used to
- * register table names.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-TableInterpDeleteProc(ClientData clientData, Tcl_Interp *interp)
-{
- InterpData *dataPtr;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- dataPtr = clientData;
- for (hPtr = Blt_FirstHashEntry(&dataPtr->clientTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_Chain chain;
- Blt_ChainLink link, next;
-
- chain = Blt_GetHashValue(hPtr);
- for (link = Blt_Chain_FirstLink(chain); link != NULL; link = next) {
- Table *tablePtr;
-
- next = Blt_Chain_NextLink(link);
- tablePtr = Blt_Chain_GetValue(link);
- tablePtr->corePtr = NULL;
- tablePtr->link2 = NULL;
- DestroyTable(tablePtr);
- }
- Blt_Chain_Destroy(chain);
- }
- Blt_DeleteHashTable(&dataPtr->clientTable);
- Tcl_DeleteAssocData(interp, TABLE_THREAD_KEY);
- Blt_Free(dataPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetInterpData --
- *
- * Creates or retrieves data associated with tuple data objects for a
- * particular interpreter.
- *
- * Results:
- * Returns a pointer to the tuple interpreter data.
- *
- * --------------------------------------------------------------------------
- */
-static InterpData *
-GetInterpData(Tcl_Interp *interp)
-{
- Tcl_InterpDeleteProc *proc;
- InterpData *dataPtr;
-
- dataPtr = (InterpData *)
- Tcl_GetAssocData(interp, TABLE_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(InterpData));
- dataPtr->interp = interp;
- Tcl_SetAssocData(interp, TABLE_THREAD_KEY, TableInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->clientTable, BLT_STRING_KEYS);
- }
- return dataPtr;
-}
-
-
-const char *
-Blt_Table_NameOfType(Blt_TableColumnType type)
-{
- return valueTypes[type];
-}
-
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewTags --
- *
- *---------------------------------------------------------------------------
- */
-static Blt_TableTags
-NewTags(void)
-{
- Tags *tagsPtr;
-
- tagsPtr = Blt_Malloc(sizeof(Tags));
- if (tagsPtr != NULL) {
- Blt_InitHashTable(&tagsPtr->rowTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&tagsPtr->columnTable, BLT_STRING_KEYS);
- tagsPtr->refCount = 1;
- }
- return tagsPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindClientInNamespace --
- *
- * Searches for a table client in a given namespace.
- *
- * Results:
- * Returns a pointer to the table client if found, otherwise NULL.
- *
- *---------------------------------------------------------------------------
- */
-static Table *
-FindClientInNamespace(InterpData *dataPtr, Blt_ObjectName *namePtr)
-{
- Blt_Chain chain;
- Blt_ChainLink link;
- Blt_HashEntry *hPtr;
- Tcl_DString ds;
- const char *qualName;
-
- qualName = Blt_MakeQualifiedName(namePtr, &ds);
- hPtr = Blt_FindHashEntry(&dataPtr->clientTable, qualName);
- Tcl_DStringFree(&ds);
- if (hPtr == NULL) {
- return NULL;
- }
- chain = Blt_GetHashValue(hPtr);
- link = Blt_Chain_FirstLink(chain);
- return Blt_Chain_GetValue(link);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTable --
- *
- * Searches for the table client associated by the name given.
- *
- * Results:
- * Returns a pointer to the table client if found, otherwise NULL.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Table
-GetTable(InterpData *dataPtr, const char *name, unsigned int flags)
-{
- Blt_ObjectName objName;
- Blt_Table table;
- Tcl_Interp *interp;
-
- table = NULL;
- interp = dataPtr->interp;
- if (!Blt_ParseObjectName(interp, name, &objName, BLT_NO_DEFAULT_NS)) {
- return NULL;
- }
- if (objName.nsPtr != NULL) {
- table = FindClientInNamespace(dataPtr, &objName);
- } else {
- if (flags & NS_SEARCH_CURRENT) {
- /* Look first in the current namespace. */
- objName.nsPtr = Tcl_GetCurrentNamespace(interp);
- table = FindClientInNamespace(dataPtr, &objName);
- }
- if ((table == NULL) && (flags & NS_SEARCH_GLOBAL)) {
- objName.nsPtr = Tcl_GetGlobalNamespace(interp);
- table = FindClientInNamespace(dataPtr, &objName);
- }
- }
- return table;
-}
-
-static void
-DestroyTable(Table *tablePtr)
-{
- if (tablePtr->magic != TABLE_MAGIC) {
- fprintf(stderr, "invalid table object token 0x%lx\n",
- (unsigned long)tablePtr);
- return;
- }
- /* Remove any traces that were set by this client. */
- DestroyTraces(tablePtr->traces);
- /* Also remove all event handlers created by this client. */
- DestroyNotifiers(tablePtr->rowNotifiers);
- DestroyNotifiers(tablePtr->columnNotifiers);
- Blt_Table_UnsetKeys(tablePtr);
- if (tablePtr->tags != NULL) {
- Blt_Table_ReleaseTags(tablePtr);
- }
- if ((tablePtr->corePtr != NULL) && (tablePtr->link != NULL)) {
- TableObject *corePtr;
-
- corePtr = tablePtr->corePtr;
- /* Remove the client from the server's list */
- Blt_Chain_DeleteLink(corePtr->clients, tablePtr->link);
- if (Blt_Chain_GetLength(corePtr->clients) == 0) {
- DestroyTableObject(corePtr);
- }
- }
- tablePtr->magic = 0;
- Blt_Free(tablePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewTable --
- *
- * Creates a new table client. Clients shared a tuple data object. They
- * individually manage traces and events on tuple objects. Returns a
- * pointer to the malloc'ed structure. This is passed to the client as a
- * tuple token.
- *
- * Results:
- * A pointer to a Table is returned. If one can't be allocated, NULL
- * is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Table *
-NewTable(
- InterpData *dataPtr,
- TableObject *corePtr, /* Table object serving this client. */
- const char *qualName) /* Full namespace qualified name of table. */
-{
- Blt_Chain chain;
- Table *tablePtr;
- int isNew;
-
- tablePtr = Blt_Calloc(1, sizeof(Table));
- if (tablePtr == NULL) {
- return NULL;
- }
- tablePtr->magic = TABLE_MAGIC;
- tablePtr->interp = dataPtr->interp;
- /* Add client to table object's list of clients. */
- tablePtr->link = Blt_Chain_Append(corePtr->clients, tablePtr);
-
- /* By default, use own sets of tags. */
- tablePtr->tags = NewTags();
- tablePtr->rowTags = &tablePtr->tags->rowTable;
- tablePtr->columnTags = &tablePtr->tags->columnTable;
-
- tablePtr->tablePtr = &dataPtr->clientTable;
- tablePtr->hPtr = Blt_CreateHashEntry(&dataPtr->clientTable, qualName,
- &isNew);
- if (isNew) {
- chain = Blt_Chain_Create();
- Blt_SetHashValue(tablePtr->hPtr, chain);
- } else {
- chain = Blt_GetHashValue(tablePtr->hPtr);
- }
- tablePtr->name = Blt_GetHashKey(&dataPtr->clientTable, tablePtr->hPtr);
- tablePtr->link2 = Blt_Chain_Append(chain, tablePtr);
- tablePtr->rowNotifiers = Blt_Chain_Create();
- tablePtr->columnNotifiers = Blt_Chain_Create();
- tablePtr->traces = Blt_Chain_Create();
-
- tablePtr->corePtr = corePtr;
- return tablePtr;
-}
-
-static Header *
-FindLabel(RowColumn *rcPtr, const char *label)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&rcPtr->labelTable, label);
- if (hPtr != NULL) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *h2Ptr;
- Blt_HashSearch iter;
-
- tablePtr = Blt_GetHashValue(hPtr);
- assert(tablePtr != NULL);
- h2Ptr = Blt_FirstHashEntry(tablePtr, &iter);
- if (h2Ptr != NULL) {
- return Blt_GetHashValue(h2Ptr);
- }
- }
- return NULL;
-}
-
-static int
-SetType(Table *tablePtr, struct _Blt_TableColumn *colPtr,
- Blt_TableColumnType type)
-{
- int i;
-
- if (type == colPtr->type) {
- return TCL_OK; /* Already the requested type. */
- }
- /* For each value in the column, try to convert it to the desired type. */
- for (i = 1; i <= Blt_Table_NumRows(tablePtr); i++) {
- Row *rowPtr;
- Value *valuePtr;
-
- rowPtr = Blt_Table_Row(tablePtr, i);
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- if (!IsEmpty(valuePtr)) {
- Value value;
-
- memset(&value, 0, sizeof(Value));
- if (SetValueFromString(tablePtr->interp, type, valuePtr->string, -1,
- &value) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- /* Now replace the column with the converted the values. */
- for (i = 1; i <= Blt_Table_NumRows(tablePtr); i++) {
- Row *rowPtr;
- Value *valuePtr;
-
- rowPtr = Blt_Table_Row(tablePtr, i);
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- if (!IsEmpty(valuePtr)) {
- if (SetValueFromString(tablePtr->interp, type, valuePtr->string, -1,
- valuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- colPtr->type = type;
- return TCL_OK;
-}
-
-
-static void
-ResetMap(RowColumn *rcPtr)
-{
- long i, j;
-
- /* Reset the reverse lookup: from header to index. */
- for (i = 0, j = 1; i < rcPtr->nUsed; i++, j++) {
- rcPtr->map[i]->index = j;
- }
-}
-
-static void
-DeleteHeader(RowColumn *rcPtr, Header *headerPtr)
-{
- /* If there is a label is associated with the column, free it. */
- if (headerPtr->label != NULL) {
- UnsetLabel(rcPtr, headerPtr);
- }
- {
- long p, q;
-
- /* Compress the index-to-offset map. */
- for (q = headerPtr->index, p = q - 1; q < rcPtr->nUsed; p++, q++) {
- /* Update the index as we slide down the headers in the map. */
- rcPtr->map[p] = rcPtr->map[q];
- rcPtr->map[p]->index = q;
- }
- rcPtr->map[p] = NULL;
- }
- /* Finally free the header. */
- Blt_PoolFreeItem(rcPtr->headerPool, headerPtr);
- rcPtr->nUsed--;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClearRowNotifiers --
- *
- * Removes all event handlers set for the designated row. Note that this
- * doesn't remove handlers triggered by row or column tags. Row and
- * column traces are stored in a chain.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ClearRowNotifiers(Table *tablePtr, Row *rowPtr)
-{
- Blt_ChainLink link, next;
-
- for (link = Blt_Chain_FirstLink(tablePtr->rowNotifiers); link != NULL;
- link = next) {
- Notifier *notifierPtr;
-
- next = Blt_Chain_NextLink(link);
- notifierPtr = Blt_Chain_GetValue(link);
- if (notifierPtr->header == (Header *)rowPtr) {
- Blt_Table_DeleteNotifier(notifierPtr);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClearColumnNotifiers --
- *
- * Removes all event handlers set for the designated row. Note that this
- * doesn't remove handlers triggered by row or column tags. Row and
- * column traces are stored in a chain.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ClearColumnNotifiers(Table *tablePtr, Column *colPtr)
-{
- Blt_ChainLink link, next;
-
- for (link = Blt_Chain_FirstLink(tablePtr->columnNotifiers); link != NULL;
- link = next) {
- Notifier *notifierPtr;
-
- next = Blt_Chain_NextLink(link);
- notifierPtr = Blt_Chain_GetValue(link);
- if (notifierPtr->header == (Header *)colPtr) {
- Blt_Table_DeleteNotifier(notifierPtr);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DoNotify --
- *
- * Traverses the list of event callbacks for a client and checks if one
- * matches the given event. A client may trigger an action that causes
- * the itself to be notified again. This can be prevented by setting the
- * TABLE_NOTIFY_FOREIGN_ONLY bit in the event handler.
- *
- * If a matching handler is found, a callback may be called either
- * immediately or at the next idle time depending upon the
- * TABLE_NOTIFY_WHENIDLE bit.
- *
- * Since a handler routine may trigger yet another call to itself,
- * callbacks are ignored while the event handler is executing.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DoNotify(Table *tablePtr, Blt_Chain chain,
- Blt_TableNotifyEvent *eventPtr)
-{
- Blt_ChainLink link;
- unsigned int eventMask;
-
- /* Check the client table for matching notifiers. Issue callbacks
- * indicating that the structure of the table has changed. */
- eventMask = eventPtr->type & TABLE_NOTIFY_MASK;
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Notifier *notifierPtr;
- int match;
-
- notifierPtr = Blt_Chain_GetValue(link);
- if ((notifierPtr->flags & eventMask) == 0) {
- continue; /* Event type doesn't match */
- }
- if ((eventPtr->self) && (notifierPtr->flags&TABLE_NOTIFY_FOREIGN_ONLY)){
- continue; /* Don't notify yourself. */
- }
- if (notifierPtr->flags & TABLE_NOTIFY_ACTIVE) {
- continue; /* Ignore callbacks that are generated inside
- * of a notify handler routine. */
- }
- match = FALSE;
- if (notifierPtr->tag != NULL) {
- if (notifierPtr->flags & TABLE_NOTIFY_ROW) {
- if (Blt_Table_HasRowTag(tablePtr,
- (Row *)eventPtr->header,
- notifierPtr->tag)) {
- match++;
- }
- } else {
- if (Blt_Table_HasColumnTag(tablePtr,
- (Column *)eventPtr->header,
- notifierPtr->tag)) {
- match++;
- }
- }
- } else if (notifierPtr->header == eventPtr->header) {
- match++; /* Offsets match. */
- } else if (eventPtr->header == NULL) {
- match++; /* Event matches any notifier offset. */
- } else if (notifierPtr->header == NULL) {
- match++; /* Notifier matches any event offset. */
- }
- if (!match) {
- continue; /* Row or column doesn't match. */
- }
- if (notifierPtr->flags & TABLE_NOTIFY_WHENIDLE) {
- if ((notifierPtr->flags & TABLE_NOTIFY_PENDING) == 0) {
- notifierPtr->flags |= TABLE_NOTIFY_PENDING;
- notifierPtr->event = *eventPtr;
- Tcl_DoWhenIdle(NotifyIdleProc, notifierPtr);
- }
- } else {
- NotifyIdleProc(notifierPtr);
- }
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyClients --
- *
- * Traverses the list of event callbacks and checks if one matches the
- * given event. A client may trigger an action that causes the table
- * object to notify it. This can be prevented by setting the
- * TABLE_NOTIFY_FOREIGN_ONLY bit in the event handler.
- *
- * If a matching handler is found, a callback may be called either
- * immediately or at the next idle time depending upon the
- * TABLE_NOTIFY_WHENIDLE bit.
- *
- * Since a handler routine may trigger yet another call to itself,
- * callbacks are ignored while the event handler is executing.
- *
- *---------------------------------------------------------------------------
- */
-static void
-NotifyClients(Table *tablePtr, Blt_Chain chain, Header *header,
- unsigned int flags)
-{
- Blt_ChainLink link, next;
-
- for (link = Blt_Chain_FirstLink(tablePtr->corePtr->clients); link != NULL;
- link = next) {
- Blt_Table table;
- Blt_TableNotifyEvent event;
-
- next = Blt_Chain_NextLink(link);
- table = Blt_Chain_GetValue(link);
- event.type = flags;
- event.table = tablePtr;
- event.header = header;
- event.interp = tablePtr->interp;
- event.self = (table == tablePtr);
- DoNotify(table, chain, &event);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TriggerColumnNotifiers --
- *
- * Traverses the list of event callbacks and checks if one matches the
- * given event. A client may trigger an action that causes the table
- * object to notify it. This can be prevented by setting the
- * TABLE_NOTIFY_FOREIGN_ONLY bit in the event handler.
- *
- * If a matching handler is found, a callback may be called either
- * immediately or at the next idle time depending upon the
- * TABLE_NOTIFY_WHENIDLE bit.
- *
- * Since a handler routine may trigger yet another call to itself,
- * callbacks are ignored while the event handler is executing.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TriggerColumnNotifiers(Table *tablePtr, Column *colPtr, unsigned int flags)
-{
- if (Blt_Chain_GetLength(tablePtr->columnNotifiers) == 0) {
- return; /* No notifiers registered. */
- }
- if (colPtr == NULL) { /* Indicates to trigger notifications
- * for all columns. */
- long i;
-
- for (i = 1; i <= Blt_Table_NumColumns(tablePtr); i++) {
- colPtr = Blt_Table_Column(tablePtr, i);
- NotifyClients(tablePtr, tablePtr->columnNotifiers, (Header *)colPtr,
- flags | TABLE_NOTIFY_COLUMN);
- }
- } else {
- NotifyClients(tablePtr, tablePtr->columnNotifiers, (Header *)colPtr,
- flags | TABLE_NOTIFY_COLUMN);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TriggerRowNotifiers --
- *
- * Traverses the list of event callbacks and checks if one matches the
- * given event. A client may trigger an action that causes the table
- * object to notify it. This can be prevented by setting the
- * TABLE_NOTIFY_FOREIGN_ONLY bit in the event handler.
- *
- * If a matching handler is found, a callback may be called either
- * immediately or at the next idle time depending upon the
- * TABLE_NOTIFY_WHENIDLE bit.
- *
- * Since a handler routine may trigger yet another call to itself,
- * callbacks are ignored while the event handler is executing.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TriggerRowNotifiers(Table *tablePtr, Row *rowPtr, unsigned int flags)
-{
- if (Blt_Chain_GetLength(tablePtr->rowNotifiers) == 0) {
- return; /* No notifiers registered. */
- }
- if (rowPtr == TABLE_NOTIFY_ALL) {
- long i;
-
- /* Trigger notifications for all rows. */
- for (i = 1; i <= Blt_Table_NumRows(tablePtr); i++) {
- rowPtr = Blt_Table_Row(tablePtr, i);
- NotifyClients(tablePtr, tablePtr->rowNotifiers, (Header *)rowPtr,
- flags | TABLE_NOTIFY_ROW);
- }
- } else {
- NotifyClients(tablePtr, tablePtr->rowNotifiers, (Header *)rowPtr,
- flags | TABLE_NOTIFY_ROW);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_ClearRowTraces --
- *
- * Removes all traces set for this row. Note that this doesn't remove
- * traces set for specific cells (row,column). Row traces are stored in
- * a chain, which in turn is held in a hash table, keyed by the row.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Table_ClearRowTraces(Table *tablePtr, Row *rowPtr)
-{
- Blt_ChainLink link, next;
-
- for (link = Blt_Chain_FirstLink(tablePtr->traces); link != NULL;
- link = next) {
- Trace *tracePtr;
-
- next = Blt_Chain_NextLink(link);
- tracePtr = Blt_Chain_GetValue(link);
- if (tracePtr->row == rowPtr) {
- Blt_Table_DeleteTrace(tracePtr);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_ClearColumnTraces --
- *
- * Removes all traces set for this column. Note that this doesn't remove
- * traces set for specific cells (row,column). Column traces are stored
- * in a chain, which in turn is held in a hash table, keyed by the
- * column.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Table_ClearColumnTraces(Table *tablePtr, Blt_TableColumn column)
-{
- Blt_ChainLink link, next;
-
- for (link = Blt_Chain_FirstLink(tablePtr->traces); link != NULL;
- link = next) {
- Trace *tracePtr;
-
- next = Blt_Chain_NextLink(link);
- tracePtr = Blt_Chain_GetValue(link);
- if (tracePtr->column == column) {
- Blt_Table_DeleteTrace(tracePtr);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DoTrace --
- *
- * Fires a trace set by a client of the table object. Trace procedures
- * should return a standard TCL result.
- *
- * TCL_OK procedure executed successfully.
- * TCL_ERROR procedure failed.
- * TCL_BREAK don't execute any further trace procedures.
- * TCL_CONTINUE treat like TCL_OK.
- *
- * A trace procedure can in turn trigger more traces. Traces are
- * prohibited from recursively reentering their own trace procedures. A
- * hash table in the trace structure tracks the cells currently actively
- * traced. If a cell is already being traced, the trace procedure is not
- * called and TCL_OK is blindly returned.
- *
- * Results:
- * Returns the result of trace procedure. If the trace is already
- * active, then TCL_OK is returned.
- *
- * Side Effects:
- * Traces on the table location may be fired.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DoTrace(Trace *tracePtr, Blt_TableTraceEvent *eventPtr)
-{
- int result;
-
- /*
- * Check for individual traces on a cell. Each trace has a hash table
- * that tracks what cells are actively being traced. This is to prevent
- * traces from triggering recursive callbacks.
- */
- Tcl_Preserve(tracePtr);
- tracePtr->flags |= TABLE_TRACE_ACTIVE;
- result = (*tracePtr->proc)(tracePtr->clientData, eventPtr);
- tracePtr->flags &= ~TABLE_TRACE_ACTIVE;
- Tcl_Release(tracePtr);
-
- if (result == TCL_ERROR) {
- fprintf(stderr, "error in trace callback: %s\n",
- Tcl_GetStringResult(eventPtr->interp));
- Tcl_BackgroundError(eventPtr->interp);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CallTraces --
- *
- * Examines the traces set for each client of the table object and fires
- * any matching traces.
- *
- * Traces match on row and column tag and indices and flags.
- * Traces can match on
- * flag type of trace (read, write, unset, create)
- * row index
- * column index
- * row tag
- * column tag
- *
- * If the TABLE_TRACE_FOREIGN_ONLY is set in the handler, it means to
- * ignore actions that are initiated by that client of the object. Only
- * actions by other clients are handled.
- *
- * Results:
- * Always returns TCL_OK.
- *
- * Side Effects:
- * Traces on the tuple table location may be fired.
- *
- *---------------------------------------------------------------------------
- */
-static void
-CallTraces(Table *tablePtr, Table *clientPtr, Row *rowPtr,
- Column *colPtr, unsigned int flags)
-{
- Blt_ChainLink link, next;
- Blt_TableTraceEvent event;
-
- /* Initialize trace event information. */
- event.table = clientPtr;
- event.row = rowPtr;
- event.column = colPtr;
- event.interp = clientPtr->interp;
- if (tablePtr == clientPtr) {
- flags |= TABLE_TRACE_SELF;
- }
- event.mask = flags;
- for (link = Blt_Chain_FirstLink(clientPtr->traces); link != NULL;
- link = next) {
- Trace *tracePtr;
- int rowMatch, colMatch;
-
- next = Blt_Chain_NextLink(link);
- tracePtr = Blt_Chain_GetValue(link);
- if ((tracePtr->flags & flags) == 0) {
- continue; /* Doesn't match trace flags. */
- }
- if (tracePtr->flags & TABLE_TRACE_ACTIVE) {
- continue; /* Ignore callbacks that were triggered from
- * the active trace handler routine. */
- }
- rowMatch = colMatch = FALSE;
- if (tracePtr->colTag != NULL) {
- if (Blt_Table_HasColumnTag(clientPtr, colPtr,
- tracePtr->colTag)) {
- colMatch++;
- }
- } else if ((tracePtr->column == colPtr) || (tracePtr->column == NULL)) {
- colMatch++;
- }
- if (tracePtr->rowTag != NULL) {
- if (Blt_Table_HasRowTag(clientPtr, rowPtr, tracePtr->rowTag)) {
- rowMatch++;
- }
- } else if ((tracePtr->row == rowPtr) || (tracePtr->row == NULL)) {
- rowMatch++;
- }
- if (!rowMatch || !colMatch) {
- continue;
- }
- if (DoTrace(tracePtr, &event) == TCL_BREAK) {
- return; /* Don't complete traces on break. */
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CallClientTraces --
- *
- * Examines the traces set for each client of the table object and fires
- * any matching traces.
- *
- * Traces match on row and column indices and flags.
- * The order is
- * 1. column traces.
- * 2. row traces.
- * 3. cell (row,column) traces.
- *
- * If no matching criteria is specified (no tag, key, or tuple address)
- * then only the bit flag has to match.
- *
- * If the TABLE_TRACE_FOREIGN_ONLY is set in the handler, it means to
- * ignore actions that are initiated by that client of the object. Only
- * actions by other clients are handled.
- *
- * Results:
- * Always returns TCL_OK.
- *
- * Side Effects:
- * Traces on the tuple table location may be fired.
- *
- *---------------------------------------------------------------------------
- */
-static void
-CallClientTraces(Table *tablePtr, Row *rowPtr, Column *colPtr,
- unsigned int flags)
-{
- Blt_ChainLink link, next;
-
- for (link = Blt_Chain_FirstLink(tablePtr->corePtr->clients); link != NULL;
- link = next) {
- Table *clientPtr;
-
- next = Blt_Chain_NextLink(link);
- clientPtr = Blt_Chain_GetValue(link);
- CallTraces(tablePtr, clientPtr, rowPtr, colPtr, flags);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnsetValue --
- *
- * Removes the value from the selected row, column location in the table.
- * The row, column location must be within the actual table limits, but
- * it's okay if there isn't a value there to remove.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The objPtr representing the value is released.
- *
- *---------------------------------------------------------------------------
- */
-static void
-UnsetValue(Table *tablePtr, Row *rowPtr, Column *colPtr)
-{
- Value *valuePtr;
-
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- if (!IsEmpty(valuePtr)) {
- /* Indicate the keytables need to be regenerated. */
- if (colPtr->flags & TABLE_COLUMN_PRIMARY_KEY) {
- tablePtr->flags |= TABLE_KEYS_DIRTY;
- }
- }
- FreeValue(valuePtr);
-}
-
-static void
-UnsetRowValues(Table *tablePtr, Row *rowPtr)
-{
- long i;
-
- for (i = 1; i <= Blt_Table_NumColumns(tablePtr); i++) {
- Column *colPtr;
-
- colPtr = Blt_Table_Column(tablePtr, i);
- UnsetValue(tablePtr, rowPtr, colPtr);
- }
-}
-
-static void
-UnsetColumnValues(Table *tablePtr, Column *colPtr)
-{
- Value *vector;
- long i;
-
- for (i = 1; i <= Blt_Table_NumRows(tablePtr); i++) {
- Row *rowPtr;
-
- rowPtr = Blt_Table_Row(tablePtr, i);
- UnsetValue(tablePtr, rowPtr, colPtr);
- }
- vector = tablePtr->corePtr->data[colPtr->offset];
- if (vector != NULL) {
- FreeVector(vector, tablePtr->corePtr->rows.nAllocated);
- tablePtr->corePtr->data[colPtr->offset] = NULL;
- }
-}
-
-static int
-CompareDictionaryStrings(ClientData clientData, Value *valuePtr1,
- Value *valuePtr2)
-{
- if (IsEmpty(valuePtr1)) {
- if (IsEmpty(valuePtr2)) {
- return 0;
- }
- return 1;
- } else if (IsEmpty(valuePtr2)) {
- return -1;
- }
- return Blt_DictionaryCompare(valuePtr1->string, valuePtr2->string);
-}
-
-static int
-CompareAsciiStrings(ClientData clientData, Value *valuePtr1, Value *valuePtr2)
-{
- if (IsEmpty(valuePtr1)) {
- if (IsEmpty(valuePtr2)) {
- return 0;
- }
- return 1;
- } else if (IsEmpty(valuePtr2)) {
- return -1;
- }
- return strcmp(valuePtr1->string, valuePtr2->string);
-}
-
-static int
-CompareIntegers(ClientData clientData, Value *valuePtr1, Value *valuePtr2)
-{
- if (IsEmpty(valuePtr1)) {
- if (IsEmpty(valuePtr2)) {
- return 0;
- }
- return 1;
- } else if (IsEmpty(valuePtr2)) {
- return -1;
- }
- return valuePtr1->datum.l - valuePtr2->datum.l;
-}
-
-static int
-CompareDoubles(ClientData clientData, Value *valuePtr1, Value *valuePtr2)
-{
- if (IsEmpty(valuePtr1)) {
- if (IsEmpty(valuePtr2)) {
- return 0;
- }
- return 1;
- } else if (IsEmpty(valuePtr2)) {
- return -1;
- }
- if (valuePtr1->datum.d < valuePtr2->datum.d) {
- return -1;
- } else if (valuePtr1->datum.d > valuePtr2->datum.d) {
- return 1;
- }
- return 0;
-}
-
-typedef struct {
- Blt_Table table;
- Blt_TableSortOrder *order;
- long nColumns;
- unsigned int flags;
-} TableSortData;
-
-static TableSortData sortData;
-
-static int
-CompareRows(void *a, void *b)
-{
- Table *tablePtr;
- Blt_TableSortOrder *sp, *send;
- Row *rowPtr1, *rowPtr2;
- long result;
-
- tablePtr = sortData.table;
-
- rowPtr1 = *(Row **)a;
- rowPtr2 = *(Row **)b;
- for (sp = sortData.order, send = sp + sortData.nColumns; sp < send; sp++) {
- Column *colPtr;
- Value *valuePtr1, *valuePtr2, *vector;
-
- colPtr = sp->column;
- valuePtr1 = valuePtr2 = NULL;
- vector = tablePtr->corePtr->data[colPtr->offset];
- if (vector != NULL) {
- valuePtr1 = vector + rowPtr1->offset;
- if (IsEmpty(valuePtr1)) {
- valuePtr1 = NULL;
- }
- valuePtr2 = vector + rowPtr2->offset;
- if (IsEmpty(valuePtr2)) {
- valuePtr2 = NULL;
- }
- }
- result = (*sp->sortProc)(sp->clientData, valuePtr1, valuePtr2);
- if (result != 0) {
- return (sortData.flags & SORT_DECREASING) ? -result : result;
- }
- }
- result = rowPtr1->index - rowPtr2->index;
- return (sortData.flags & SORT_DECREASING) ? -result : result;
-}
-
-static void
-InitSortProcs(Table *tablePtr, Blt_TableSortOrder *order, size_t n, int flags)
-{
- Blt_TableSortOrder *sp, *send;
-
- for (sp = order, send = sp + n; sp < send; sp++) {
- Column *colPtr;
-
- sp->clientData = tablePtr;
- colPtr = sp->column;
- switch (colPtr->type) {
- case TABLE_COLUMN_TYPE_INT:
- case TABLE_COLUMN_TYPE_LONG:
- sp->sortProc = CompareIntegers;
- break;
- case TABLE_COLUMN_TYPE_DOUBLE:
- sp->sortProc = CompareDoubles;
- break;
- case TABLE_COLUMN_TYPE_STRING:
- case TABLE_COLUMN_TYPE_UNKNOWN:
- default:
- if (flags & SORT_ASCII) {
- sp->sortProc = CompareAsciiStrings;
- } else {
- sp->sortProc = CompareDictionaryStrings;
- }
- break;
- }
- }
-}
-
-static Header **
-SortHeaders(RowColumn *rcPtr, QSortCompareProc *proc)
-{
- long i;
- Header **map;
-
- /* Make a copy of the current row map. */
- map = Blt_Malloc(sizeof(Header *) * rcPtr->nAllocated);
- if (map == NULL) {
- return NULL;
- }
- for (i = 0; i < rcPtr->nAllocated; i++) {
- map[i] = rcPtr->map[i];
- }
- /* Sort the map and return it. */
- qsort((char *)map, rcPtr->nUsed, sizeof(Header *), proc);
- return map;
-}
-
-
-static void
-ReplaceMap(RowColumn *rcPtr, Header **map)
-{
- Blt_Free(rcPtr->map);
- rcPtr->map = map;
- ResetMap(rcPtr);
-}
-
-static int
-MoveIndices(
- RowColumn *rcPtr,
- Header *srcPtr, /* Starting source index. */
- Header *destPtr, /* Starting destination index. */
- long count) /* # of rows or columns to move. */
-{
- Header **newMap; /* Resulting reordered map. */
- long src, dest;
-
-#ifdef notdef
- fprintf(stderr, "src=%ld, dest=%ld, count=%d\n", srcPtr->index,
- destPtr->index, count);
- fprintf(stderr, "%s nUsed=%d, nAllocated=%d\n", rcPtr->classPtr->name,
- rcPtr->nUsed, rcPtr->nAllocated);
-#endif
- if (srcPtr == destPtr) {
- return TRUE;
- }
- src = srcPtr->index, dest = destPtr->index;
- src--; dest--;
- newMap = Blt_Malloc(sizeof(Header *) * rcPtr->nAllocated);
- if (newMap == NULL) {
- return FALSE;
- }
- if (dest < src) {
- long i, j;
-
- /*
- * dest src
- * v v
- * | | | | | |x|x|x|x| |
- * A A B B B C C C C D
- * | | |x|x|x|x| | | | |
- *
- * Section C is the selected region to move.
- */
- /* Section A: copy everything from 0 to "dest" */
- for (i = 0; i < dest; i++) {
- newMap[i] = rcPtr->map[i];
- }
- /* Section C: append the selected region. */
- for (i = src, j = dest; i < (src + count); i++, j++) {
- newMap[j] = rcPtr->map[i];
- }
- /* Section B: shift the preceding indices from "dest" to "src". */
- for (i = dest; i < src; i++, j++) {
- newMap[j] = rcPtr->map[i];
- }
- /* Section D: append trailing indices until the end. */
- for (i = src + count; i < rcPtr->nUsed; i++, j++) {
- newMap[j] = rcPtr->map[i];
- }
- } else if (src < dest) {
- long i, j;
-
- /*
- * src dest
- * v v
- * | | |x|x|x|x| | | | |
- * A A C C C C B B B D
- * | | | | | |x|x|x|x| |
- *
- * Section C is the selected region to move.
- */
- /* Section A: copy everything from 0 to "src" */
- for (j = 0; j < src; j++) {
- newMap[j] = rcPtr->map[j];
- }
- /* Section B: shift the trailing indices from "src" to "dest". */
- for (i = (src + count); j < dest; i++, j++) {
- newMap[j] = rcPtr->map[i];
- }
- /* Section C: append the selected region. */
- for (i = src; i < (src + count); i++, j++) {
- newMap[j] = rcPtr->map[i];
- }
- /* Section D: append trailing indices until the end. */
- for (i = dest + count; i < rcPtr->nUsed; i++, j++) {
- newMap[j] = rcPtr->map[i];
- }
- }
- /* Reset the inverse offset-to-index map. */
- ReplaceMap(rcPtr, newMap);
- return TRUE;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ParseDumpRecord --
- *
- * Gets the next full record in the dump string, returning the
- * record as a list. Blank lines and comments are ignored.
- *
- * Results:
- * TCL_RETURN The end of the string is reached.
- * TCL_ERROR An error occurred and an error message
- * is left in the interpreter result.
- * TCL_OK The next record has been successfully parsed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ParseDumpRecord(
- Tcl_Interp *interp,
- char **stringPtr, /* (in/out) points to current location
- * in in dump string. Updated after
- * parsing record. */
- RestoreData *restorePtr)
-{
- char *entry, *eol;
- char saved;
- int result;
-
- entry = *stringPtr;
- /* Get first line, ignoring blank lines and comments. */
- for (;;) {
- char *first;
-
- first = NULL;
- restorePtr->nLines++;
- /* Find the end of the first line. */
- for (eol = entry; (*eol != '\n') && (*eol != '\0'); eol++) {
- if ((first == NULL) && (!isspace(UCHAR(*eol)))) {
- first = eol; /* Track first non-whitespace
- * character. */
- }
- }
- if (first == NULL) {
- if (*eol == '\0') {
- return TCL_RETURN;
- }
- } else if (*first != '#') {
- break; /* Not a comment or blank line. */
- }
- entry = eol + 1;
- }
- saved = *eol;
- *eol = '\0';
- while (!Tcl_CommandComplete(entry)) {
- *eol = saved;
- if (*eol == '\0') {
- Tcl_AppendResult(interp, "incomplete dump record: \"", entry,
- "\"", (char *)NULL);
- return TCL_ERROR; /* Found EOF (incomplete
- * entry) or error. */
- }
- /* Get the next line. */
- for (eol = eol + 1; (*eol != '\n') && (*eol != '\0'); eol++) {
- /*empty*/
- }
- restorePtr->nLines++;
- saved = *eol;
- *eol = '\0';
- }
- if (entry == eol) {
- return TCL_RETURN;
- }
- result = Tcl_SplitList(interp, entry, &restorePtr->argc, &restorePtr->argv);
- *eol = saved;
- *stringPtr = eol + 1;
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReadDumpRecord --
- *
- * Reads the next full record from the given channel, returning the
- * record as a list. Blank lines and comments are ignored.
- *
- * Results:
- * TCL_RETURN The end of the file has been reached.
- * TCL_ERROR A read error has occurred and an error message
- * is left in the interpreter result.
- * TCL_OK The next record has been successfully parsed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ReadDumpRecord(Tcl_Interp *interp, Tcl_Channel channel, RestoreData *restorePtr)
-{
- int result;
- Tcl_DString ds;
-
- Tcl_DStringInit(&ds);
- /* Get first line, ignoring blank lines and comments. */
- for (;;) {
- const char *cp;
- int nBytes;
-
- Tcl_DStringSetLength(&ds, 0);
- nBytes = Tcl_Gets(channel, &ds);
- if (nBytes < 0) {
- if (Tcl_Eof(channel)) {
- return TCL_RETURN;
- }
- return TCL_ERROR;
- }
- restorePtr->nLines++;
- for (cp = Tcl_DStringValue(&ds); *cp != '\0'; cp++) {
- if (!isspace(UCHAR(*cp))) {
- break;
- }
- }
- if ((*cp != '\0') && (*cp != '#')) {
- break; /* Not a comment or blank line. */
- }
- }
-
- Tcl_DStringAppend(&ds, "\n", 1);
- while (!Tcl_CommandComplete(Tcl_DStringValue(&ds))) {
- int nBytes;
-
- /* Process additional lines if needed */
- nBytes = Tcl_Gets(channel, &ds);
- if (nBytes < 0) {
- Tcl_AppendResult(interp, "error reading file: ",
- Tcl_PosixError(interp), (char *)NULL);
- Tcl_DStringFree(&ds);
- return TCL_ERROR; /* Found EOF (incomplete
- * entry) or error. */
- }
- restorePtr->nLines++;
- Tcl_DStringAppend(&ds, "\n", 1);
- }
- result = Tcl_SplitList(interp, Tcl_DStringValue(&ds), &restorePtr->argc,
- &restorePtr->argv);
- Tcl_DStringFree(&ds);
- return result;
-}
-
-static void
-RestoreError(Tcl_Interp *interp, RestoreData *restorePtr)
-{
- Tcl_DString ds;
-
- Tcl_DStringInit(&ds);
- Tcl_DStringGetResult(interp, &ds);
- Tcl_AppendResult(interp, restorePtr->fileName, ":",
- Blt_Ltoa(restorePtr->nLines), ": error: ", Tcl_DStringValue(&ds),
- (char *)NULL);
- Tcl_DStringFree(&ds);
-}
-
-static int
-RestoreHeader(Tcl_Interp *interp, Blt_Table table, RestoreData *restorePtr)
-{
- long nCols, nRows;
- long lval;
-
- /* i rows columns ctime mtime */
- if (restorePtr->argc != 5) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "wrong # elements in restore header.",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Tcl_GetLong(interp, restorePtr->argv[1], &lval) != TCL_OK) {
- RestoreError(interp, restorePtr);
- return TCL_ERROR;
- }
- if (lval < 1) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "bad # rows \"", restorePtr->argv[1], "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- nRows = lval;
- if (Tcl_GetLong(interp, restorePtr->argv[2], &lval) != TCL_OK) {
- RestoreError(interp, restorePtr);
- return TCL_ERROR;
- }
- if (lval < 1) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "bad # columns \"", restorePtr->argv[2], "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- nCols = lval;
- if ((restorePtr->flags & TABLE_RESTORE_OVERWRITE) == 0) {
- nRows += restorePtr->nRows;
- nCols += restorePtr->nCols;
- }
- if (nCols > Blt_Table_NumColumns(table)) {
- long n;
-
- n = nCols - Blt_Table_NumColumns(table);
- if (!GrowColumns(table, n)) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "can't allocate \"", Blt_Ltoa(n),
- "\"", " extra columns.", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (nRows > Blt_Table_NumRows(table)) {
- long n;
-
- n = nRows - Blt_Table_NumRows(table);
- if (!GrowRows(table, n)) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "can't allocate \"", Blt_Ltoa(n), "\"",
- " extra rows.", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (Tcl_GetLong(interp, restorePtr->argv[3], &lval) != TCL_OK) {
- RestoreError(interp, restorePtr);
- return TCL_ERROR;
- }
- restorePtr->ctime = (unsigned long)lval;
- if (Tcl_GetLong(interp, restorePtr->argv[4], &lval) != TCL_OK) {
- RestoreError(interp, restorePtr);
- return TCL_ERROR;
- }
- restorePtr->mtime = (unsigned long)lval;
- return TCL_OK;
-}
-
-static int
-RestoreColumn(Tcl_Interp *interp, Blt_Table table, RestoreData *restorePtr)
-{
- long lval;
- long n;
- Column *colPtr;
- int type;
- const char *label;
- int isNew;
- Blt_HashEntry *hPtr;
-
- /* c index label type ?tagList? */
- if ((restorePtr->argc < 4) || (restorePtr->argc > 5)) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "wrong # elements in restore column entry",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Tcl_GetLong(interp, restorePtr->argv[1], &lval) != TCL_OK) {
- RestoreError(interp, restorePtr);
- return TCL_ERROR;
- }
- if (lval < 1) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "bad column index \"", restorePtr->argv[1],
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- n = lval;
- label = restorePtr->argv[2];
- colPtr = Blt_Table_FindColumnByLabel(table, label);
- if ((colPtr == NULL) ||
- ((restorePtr->flags & TABLE_RESTORE_OVERWRITE) == 0)) {
- colPtr = Blt_Table_CreateColumn(interp, table, label);
- if (colPtr == NULL) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "can't append column \"", label, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- }
- hPtr = Blt_CreateHashEntry(&restorePtr->colIndices, (char *)n, &isNew);
- Blt_SetHashValue(hPtr, colPtr);
-
- type = Blt_Table_GetColumnType(restorePtr->argv[3]);
- if (type == TABLE_COLUMN_TYPE_UNKNOWN) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "bad column type \"", restorePtr->argv[3],
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- colPtr->type = type;
- if ((restorePtr->argc == 5) &&
- ((restorePtr->flags & TABLE_RESTORE_NO_TAGS) == 0)) {
- int i, elc;
- const char **elv;
-
- if (Tcl_SplitList(interp, restorePtr->argv[4], &elc, &elv) != TCL_OK) {
- RestoreError(interp, restorePtr);
- return TCL_ERROR;
- }
-
- for (i = 0; i < elc; i++) {
- if (Blt_Table_SetColumnTag(interp, table, colPtr, elv[i])
- != TCL_OK) {
- Blt_Free(elv);
- return TCL_ERROR;
- }
- }
- Blt_Free(elv);
- }
- return TCL_OK;
-}
-
-static int
-RestoreRow(Tcl_Interp *interp, Blt_Table table, RestoreData *restorePtr)
-{
- Blt_TableRow row;
- Blt_HashEntry *hPtr;
- const char **elv;
- const char *label;
- int elc;
- int isNew;
- long lval;
- long n;
-
- /* r index label ?tagList? */
- if ((restorePtr->argc < 3) || (restorePtr->argc > 4)) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "wrong # elements in restore row entry",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Tcl_GetLong(interp, restorePtr->argv[1], &lval) != TCL_OK) {
- RestoreError(interp, restorePtr);
- return TCL_ERROR;
- }
- if (lval < 1) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "bad row index \"", restorePtr->argv[1], "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- n = lval;
- label = restorePtr->argv[2];
- row = Blt_Table_FindRowByLabel(table, label);
- if ((row == NULL) || ((restorePtr->flags & TABLE_RESTORE_OVERWRITE) == 0)) {
- row = Blt_Table_CreateRow(interp, table, label);
- if (row == NULL) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "can't append row \"", label, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- }
- hPtr = Blt_CreateHashEntry(&restorePtr->rowIndices, (char *)n, &isNew);
- Blt_SetHashValue(hPtr, row);
- if ((restorePtr->argc == 5) &&
- ((restorePtr->flags & TABLE_RESTORE_NO_TAGS) == 0)) {
- int i;
-
- if (Tcl_SplitList(interp, restorePtr->argv[3], &elc, &elv) != TCL_OK) {
- RestoreError(interp, restorePtr);
- return TCL_ERROR;
- }
- for (i = 0; i < elc; i++) {
- if (Blt_Table_SetRowTag(interp, table, row, elv[i]) != TCL_OK) {
- Blt_Free(elv);
- return TCL_ERROR;
- }
- }
- Blt_Free(elv);
- }
- return TCL_OK;
-}
-
-static int
-RestoreValue(Tcl_Interp *interp, Blt_Table table, RestoreData *restorePtr)
-{
- Blt_HashEntry *hPtr;
- int result;
- Blt_TableRow row;
- Blt_TableColumn col;
- long lval;
-
- /* d row column value */
- if (restorePtr->argc != 4) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "wrong # elements in restore data entry",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Tcl_GetLong(interp, restorePtr->argv[1], &lval) != TCL_OK) {
- RestoreError(interp, restorePtr);
- return TCL_ERROR;
- }
- hPtr = Blt_FindHashEntry(&restorePtr->rowIndices, (char *)lval);
- if (hPtr == NULL) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "bad row index \"", restorePtr->argv[1], "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- row = Blt_GetHashValue(hPtr);
- if (Tcl_GetLong(interp, restorePtr->argv[2], &lval) != TCL_OK) {
- RestoreError(interp, restorePtr);
- return TCL_ERROR;
- }
- hPtr = Blt_FindHashEntry(&restorePtr->colIndices, (char *)lval);
- if (hPtr == NULL) {
- RestoreError(interp, restorePtr);
- Tcl_AppendResult(interp, "bad column index \"", restorePtr->argv[2],
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- col = Blt_GetHashValue(hPtr);
-
- result = Blt_Table_SetString(table, row, col, restorePtr->argv[3], -1);
- if (result != TCL_OK) {
- RestoreError(interp, restorePtr);
- }
- return result;
-}
-
-Blt_TableRow *
-Blt_Table_RowMap(Table *tablePtr)
-{
- return (Blt_TableRow *)tablePtr->corePtr->rows.map;
-}
-
-Blt_TableColumn *
-Blt_Table_ColumnMap(Table *tablePtr)
-{
- return (Blt_TableColumn *)tablePtr->corePtr->columns.map;
-}
-
-Blt_HashEntry *
-Blt_Table_FirstRowTag(Table *tablePtr, Blt_HashSearch *cursorPtr)
-{
- return Blt_FirstHashEntry(tablePtr->rowTags, cursorPtr);
-}
-
-Blt_HashEntry *
-Blt_Table_FirstColumnTag(Table *tablePtr, Blt_HashSearch *cursorPtr)
-{
- return Blt_FirstHashEntry(tablePtr->columnTags, cursorPtr);
-}
-
-int
-Blt_Table_SameTableObject(Table *tablePtr1, Table *tablePtr2)
-{
- return tablePtr1->corePtr == tablePtr2->corePtr;
-}
-
-Blt_Chain
-Blt_Table_RowTags(Table *tablePtr, Row *rowPtr)
-{
- Blt_Chain chain;
-
- chain = Blt_Chain_Create();
- DumpTags(tablePtr->rowTags, (Header *)rowPtr, chain);
- return chain;
-}
-
-Blt_TableRow
-Blt_Table_FindRowByIndex(Table *tablePtr, long index)
-{
- if ((index > 0) && (index <= Blt_Table_NumRows(tablePtr))) {
- return Blt_Table_Row(tablePtr, index);
- }
- return NULL;
-}
-
-Blt_TableColumn
-Blt_Table_FindColumnByIndex(Table *tablePtr, long index)
-{
- if ((index > 0) && (index <= Blt_Table_NumColumns(tablePtr))) {
- return Blt_Table_Column(tablePtr, index);
- }
- return NULL;
-}
-
-Blt_Chain
-Blt_Table_ColumnTags(Table *tablePtr, Blt_TableColumn col)
-{
- Blt_Chain chain;
-
- chain = Blt_Chain_Create();
- DumpTags(tablePtr->columnTags, (Header *)col, chain);
- return chain;
-}
-
-
-Blt_TableRowColumnSpec
-Blt_Table_RowSpec(Blt_Table table, Tcl_Obj *objPtr, const char **stringPtr)
-{
- const char *string, *p;
- long lval;
- char c;
-
- string = Tcl_GetString(objPtr);
- *stringPtr = string;
- c = string[0];
- if ((isdigit(UCHAR(c))) &&
- (Tcl_GetLongFromObj((Tcl_Interp *)NULL, objPtr, &lval) == TCL_OK)) {
- return TABLE_SPEC_INDEX;
- } else if ((c == 'e') && (strcmp(string, "end") == 0)) {
- return TABLE_SPEC_TAG;
- } else if ((c == 'a') && (strcmp(string, "all") == 0)) {
- return TABLE_SPEC_TAG;
- } else if ((c == 'r') && (strncmp(string, "range=", 6) == 0)) {
- *stringPtr = string + 6;
- return TABLE_SPEC_RANGE;
- } else if ((c == 'i') && (strncmp(string, "index=", 6) == 0)) {
- *stringPtr = string + 6;
- return TABLE_SPEC_INDEX;
- } else if ((c == 'l') && (strncmp(string, "label=", 6) == 0)) {
- *stringPtr = string + 6;
- return TABLE_SPEC_LABEL;
- } else if ((c == 't') && (strncmp(string, "tag=", 4) == 0)) {
- *stringPtr = string + 4;
- return TABLE_SPEC_TAG;
- } else if (Blt_Table_FindRowByLabel(table, string) != NULL) {
- return TABLE_SPEC_LABEL;
- } else if (Blt_Table_FindRowTagTable(table, string) != NULL) {
- return TABLE_SPEC_TAG;
- }
- p = strchr(string, '-');
- if (p != NULL) {
- Tcl_Obj *rangeObjPtr;
- Blt_TableRow row;
-
- rangeObjPtr = Tcl_NewStringObj(string, p - string);
- row = Blt_Table_FindRow((Tcl_Interp *)NULL, table, rangeObjPtr);
- Tcl_DecrRefCount(rangeObjPtr);
- if (row != NULL) {
- rangeObjPtr = Tcl_NewStringObj(p + 1, -1);
- row = Blt_Table_FindRow((Tcl_Interp *)NULL, table, rangeObjPtr);
- Tcl_DecrRefCount(rangeObjPtr);
- if (row != NULL) {
- return TABLE_SPEC_RANGE;
- }
- }
- }
- return TABLE_SPEC_UNKNOWN;
-}
-
-Blt_TableColumn
-Blt_Table_FirstColumn(Table *tablePtr)
-{
- if (tablePtr->corePtr->columns.nUsed == 0) {
- return NULL;
- }
- return (Blt_TableColumn)tablePtr->corePtr->columns.map[0];
-}
-
-Blt_TableColumn
-Blt_Table_NextColumn(Table *tablePtr, Column *colPtr)
-{
- long index;
-
- index = colPtr->index;
- if (index >= tablePtr->corePtr->columns.nUsed) {
- return NULL;
- }
- return (Blt_TableColumn)tablePtr->corePtr->columns.map[index];
-}
-
-Blt_TableRow
-Blt_Table_FirstRow(Table *tablePtr)
-{
- if (tablePtr->corePtr->rows.nUsed == 0) {
- return NULL;
- }
- return (Blt_TableRow)tablePtr->corePtr->rows.map[0];
-}
-
-Blt_TableRow
-Blt_Table_NextRow(Table *tablePtr, Row *rowPtr)
-{
- long index;
-
- index = rowPtr->index;
- if (index >= tablePtr->corePtr->rows.nUsed) {
- return NULL;
- }
- return (Blt_TableRow)tablePtr->corePtr->rows.map[index];
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_IterateRows --
- *
- * Returns the id of the first row derived from the given tag,
- * label or index represented in objPtr.
- *
- * Results:
- * Returns the row location of the first item. If no row
- * can be found, then -1 is returned and an error message is
- * left in the interpreter.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_IterateRows(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *objPtr,
- Blt_TableIterator *iterPtr)
-{
- Blt_TableRow row, from, to;
- const char *tagName, *p;
- int result;
- Tcl_Obj *rangeObjPtr;
- long lval;
- Blt_TableRowColumnSpec spec;
-
- memset(iterPtr, 0, sizeof(Blt_TableIterator));
- iterPtr->table = table;
- iterPtr->type = TABLE_ITERATOR_INDEX;
-
- spec = Blt_Table_RowSpec(table, objPtr, &tagName);
- switch (spec) {
- case TABLE_SPEC_INDEX:
- p = Tcl_GetString(objPtr);
- if (p == tagName) {
- result = Tcl_GetLongFromObj((Tcl_Interp *)NULL, objPtr, &lval);
- } else {
- result = Tcl_GetLong((Tcl_Interp *)NULL, (char *)tagName, &lval);
- }
- if (result != TCL_OK) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "badly formed row index \"",
- tagName, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if ((lval < 1) || (lval > Blt_Table_NumRows(table))) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "bad row index \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- iterPtr->start = iterPtr->end = lval;
- iterPtr->tagName = tagName;
- return TCL_OK;
-
- case TABLE_SPEC_LABEL:
- row = Blt_Table_FindRowByLabel(table, tagName);
- if (row == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find row label \"", tagName,
- "\" in ", Blt_Table_TableName(table), (char *)NULL);
- }
- return TCL_ERROR;
- }
- iterPtr->start = iterPtr->end = Blt_Table_RowIndex(row);
- return TCL_OK;
-
- case TABLE_SPEC_TAG:
- if (strcmp(tagName, "all") == 0) {
- iterPtr->type = TABLE_ITERATOR_ALL;
- iterPtr->start = 1;
- iterPtr->end = Blt_Table_NumRows(table);
- iterPtr->tagName = tagName;
- } else if (strcmp(tagName, "end") == 0) {
- iterPtr->tagName = tagName;
- iterPtr->start = iterPtr->end = Blt_Table_NumRows(table);
- } else {
- iterPtr->tablePtr = Blt_Table_FindRowTagTable(iterPtr->table,
- tagName);
- if (iterPtr->tablePtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find row tag \"", tagName,
- "\" in ", Blt_Table_TableName(table), (char *)NULL);
- }
- return TCL_ERROR;
- }
- iterPtr->type = TABLE_ITERATOR_TAG;
- iterPtr->tagName = tagName;
- }
- return TCL_OK;
-
- case TABLE_SPEC_RANGE:
- p = strchr(tagName, '-');
- if (p == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "bad range specification \"", tagName,
- "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- rangeObjPtr = Tcl_NewStringObj(tagName, p - tagName);
- from = Blt_Table_FindRow(interp, table, rangeObjPtr);
- Tcl_DecrRefCount(rangeObjPtr);
- if (from == NULL) {
- return TCL_ERROR;
- }
- rangeObjPtr = Tcl_NewStringObj(p + 1, -1);
- to = Blt_Table_FindRow(interp, table, rangeObjPtr);
- Tcl_DecrRefCount(rangeObjPtr);
- if (to == NULL) {
- return TCL_ERROR;
- }
- iterPtr->start = Blt_Table_RowIndex(from);
- iterPtr->end = Blt_Table_RowIndex(to);
- iterPtr->type = TABLE_ITERATOR_RANGE;
- iterPtr->tagName = tagName;
- return TCL_OK;
-
- default:
- if (interp != NULL) {
- Tcl_AppendResult(interp, "unknown row specification \"", tagName,
- "\" in ", Blt_Table_TableName(table), (char *)NULL);
- }
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_FirstTaggedRow --
- *
- * Returns the id of the next row derived from the given tag.
- *
- * Results:
- * Returns the row location of the first item. If no more rows
- * can be found, then -1 is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableRow
-Blt_Table_FirstTaggedRow(Blt_TableIterator *iterPtr)
-{
- if (iterPtr->type == TABLE_ITERATOR_TAG) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FirstHashEntry(iterPtr->tablePtr, &iterPtr->cursor);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
- } else if (iterPtr->type == TABLE_ITERATOR_CHAIN) {
- iterPtr->link = Blt_Chain_FirstLink(iterPtr->chain);
- if (iterPtr->link != NULL) {
- return Blt_Chain_GetValue(iterPtr->link);
- }
- } else if (iterPtr->start <= iterPtr->end) {
- Blt_TableRow row;
-
- row = Blt_Table_Row(iterPtr->table, iterPtr->start);
- iterPtr->next = iterPtr->start + 1;
- return row;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_NextTaggedRow --
- *
- * Returns the id of the next row derived from the given tag.
- *
- * Results:
- * Returns the row location of the first item. If no more rows
- * can be found, then -1 is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableRow
-Blt_Table_NextTaggedRow(Blt_TableIterator *iterPtr)
-{
- if (iterPtr->type == TABLE_ITERATOR_TAG) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_NextHashEntry(&iterPtr->cursor);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- } else if (iterPtr->type == TABLE_ITERATOR_CHAIN) {
- iterPtr->link = Blt_Chain_NextLink(iterPtr->link);
- if (iterPtr->link != NULL) {
- return Blt_Chain_GetValue(iterPtr->link);
- }
- } else if (iterPtr->next <= iterPtr->end) {
- Blt_TableRow row;
-
- row = Blt_Table_Row(iterPtr->table, iterPtr->next);
- iterPtr->next++;
- return row;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_FindRow --
- *
- * Gets the row offset associated the given row index, tag, or
- * label. This routine is used when you want only one row index.
- * It's an error if more than one row is specified (e.g. "all"
- * tag or range "1:4"). It's also an error if the row tag is
- * empty (no rows are currently tagged).
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableRow
-Blt_Table_FindRow(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *objPtr)
-{
- Blt_TableIterator iter;
- Blt_TableRow first, next;
-
- if (Blt_Table_IterateRows(interp, table, objPtr, &iter) != TCL_OK) {
- return NULL;
- }
- first = Blt_Table_FirstTaggedRow(&iter);
- if (first == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "no rows specified by \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return NULL;
- }
- next = Blt_Table_NextTaggedRow(&iter);
- if (next != NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "multiple rows specified by \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return NULL;
- }
- return first;
-}
-
-Blt_TableRowColumnSpec
-Blt_Table_ColumnSpec(Blt_Table table, Tcl_Obj *objPtr, const char **stringPtr)
-{
- const char *string, *p;
- long lval;
- char c;
-
- string = Tcl_GetString(objPtr);
- *stringPtr = string;
- c = string[0];
- if ((isdigit(c)) &&
- Tcl_GetLongFromObj((Tcl_Interp *)NULL, objPtr, &lval) == TCL_OK) {
- return TABLE_SPEC_INDEX;
- } else if ((c == 'e') && (strcmp(string, "end") == 0)) {
- return TABLE_SPEC_TAG;
- } else if ((c == 'a') && (strcmp(string, "all") == 0)) {
- return TABLE_SPEC_TAG;
- } else if ((c == 'r') && (strncmp(string, "range=", 6) == 0)) {
- *stringPtr = string + 6;
- return TABLE_SPEC_RANGE;
- } else if ((c == 'i') && (strncmp(string, "index=", 6) == 0)) {
- *stringPtr = string + 6;
- return TABLE_SPEC_INDEX;
- } else if ((c == 'l') && (strncmp(string, "label=", 6) == 0)) {
- *stringPtr = string + 6;
- return TABLE_SPEC_LABEL;
- } else if ((c == 't') && (strncmp(string, "tag=", 4) == 0)) {
- *stringPtr = string + 4;
- return TABLE_SPEC_TAG;
- } else if (Blt_Table_FindColumnTagTable(table, string) != NULL) {
- return TABLE_SPEC_TAG;
- } else if (Blt_Table_FindColumnByLabel(table, string) != NULL) {
- return TABLE_SPEC_LABEL;
- }
- p = strchr(string, '-');
- if (p != NULL) {
- Tcl_Obj *objPtr;
- Blt_TableColumn col;
-
- objPtr = Tcl_NewStringObj(string, p - string);
- Tcl_IncrRefCount(objPtr);
- col = Blt_Table_FindColumn(NULL, table, objPtr);
- Tcl_DecrRefCount(objPtr);
- if (col != NULL) {
- objPtr = Tcl_NewStringObj(p + 1, -1);
- col = Blt_Table_FindColumn(NULL, table, objPtr);
- Tcl_DecrRefCount(objPtr);
- if (col != NULL) {
- return TABLE_SPEC_RANGE;
- }
- }
- }
- return TABLE_SPEC_UNKNOWN;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_IterateColumns --
- *
- * Returns the id of the first column derived from the given tag,
- * label or index represented in objPtr.
- *
- * Results:
- * Returns the column location of the first item. If no column
- * can be found, then -1 is returned and an error message is
- * left in the interpreter.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_IterateColumns(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *objPtr,
- Blt_TableIterator *iterPtr)
-{
- Blt_TableColumn col, from, to;
- const char *tagName, *p;
- int result;
- Tcl_Obj *fromObjPtr, *toObjPtr;
- long lval;
- Blt_TableRowColumnSpec spec;
-
- iterPtr->table = table;
- iterPtr->type = TABLE_ITERATOR_INDEX;
-
- spec = Blt_Table_ColumnSpec(table, objPtr, &tagName);
- switch (spec) {
- case TABLE_SPEC_INDEX:
- p = Tcl_GetString(objPtr);
- if (p == tagName) {
- result = Tcl_GetLongFromObj((Tcl_Interp *)NULL, objPtr, &lval);
- } else {
- result = Tcl_GetLong((Tcl_Interp *)NULL, (char *)tagName, &lval);
- }
- if (result != TCL_OK) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "badly formed column index \"",
- tagName, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if ((lval < 1) || (lval > Blt_Table_NumColumns(table))) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "bad column index \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- iterPtr->start = iterPtr->end = lval;
- iterPtr->tagName = tagName;
- return TCL_OK;
-
- case TABLE_SPEC_LABEL:
- col = Blt_Table_FindColumnByLabel(table, tagName);
- if (col == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find column label \"", tagName,
- "\" in ", Blt_Table_TableName(table), (char *)NULL);
- }
- return TCL_ERROR;
- }
- iterPtr->start = iterPtr->end = Blt_Table_ColumnIndex(col);
- return TCL_OK;
-
- case TABLE_SPEC_TAG:
- if (strcmp(tagName, "all") == 0) {
- iterPtr->type = TABLE_ITERATOR_ALL;
- iterPtr->start = 1;
- iterPtr->end = Blt_Table_NumColumns(table);
- iterPtr->tagName = tagName;
- } else if (strcmp(tagName, "end") == 0) {
- iterPtr->tagName = tagName;
- iterPtr->start = iterPtr->end = Blt_Table_NumColumns(table);
- } else {
- iterPtr->tablePtr = Blt_Table_FindColumnTagTable(iterPtr->table,
- tagName);
- if (iterPtr->tablePtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find column tag \"",
- tagName, "\" in ", Blt_Table_TableName(table),
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- iterPtr->type = TABLE_ITERATOR_TAG;
- iterPtr->tagName = tagName;
- }
- return TCL_OK;
-
- case TABLE_SPEC_RANGE:
- p = strchr(tagName, '-');
- if (p == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "bad range specification \"", tagName,
- "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- fromObjPtr = Tcl_NewStringObj(tagName, p - tagName);
- from = Blt_Table_FindColumn(interp, table, fromObjPtr);
- Tcl_DecrRefCount(fromObjPtr);
- if (from == NULL) {
- return TCL_ERROR;
- }
- toObjPtr = Tcl_NewStringObj(p + 1, -1);
- to = Blt_Table_FindColumn(interp, table, toObjPtr);
- Tcl_DecrRefCount(toObjPtr);
- if (to == NULL) {
- return TCL_ERROR;
- }
- iterPtr->start = Blt_Table_ColumnIndex(from);
- iterPtr->end = Blt_Table_ColumnIndex(to);
- iterPtr->type = TABLE_ITERATOR_RANGE;
- iterPtr->tagName = tagName;
- return TCL_OK;
-
- default:
- if (interp != NULL) {
- Tcl_AppendResult(interp, "unknown column specification \"",
- tagName, "\" in ", Blt_Table_TableName(table),(char *)NULL);
- }
- }
- return TCL_ERROR;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_IterateColumns --
- *
- * Initials the table iterator to walk through the columns tagged by the
- * given tag, label, or index, as represented in objPtr.
- *
- * Notes:
- *
- * 1) A tag doesn't need to point to any columns. It can be empty. This
- * routine does not check if a tag represents any columns, only that the
- * tag itself exists.
- *
- * 2) If a column label and tag are the same string, the label always
- * wins.
- *
- * 3) A range of columns can be represented by "from x to y" x:y x-y {x y}
- *
- * Results:
- * A standard TCL result. If there is an error parsing the index or tag,
- * then TCL_ERROR is returned and an error message is left in the
- * interpreter.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_IterateColumns(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *objPtr,
- Blt_TableIterator *iterPtr)
-{
- long lval;
- const char *p, *rp, *pend;
- const char *tagName;
- int nBytes;
- int badrange;
-
- iterPtr->table = table;
- iterPtr->type = TABLE_ITERATOR_INDEX;
- iterPtr->next = -1;
-
- tagName = Tcl_GetStringFromObj(objPtr, &nBytes);
- rp = NULL;
- for (p = tagName, pend = p + nBytes; p < pend; p++) {
- if (*p != '-') {
- continue;
- }
- if (rp != NULL) {
- /* Found more than one range specifier. We'll assume it's
- * not a range and try is as a regular index, tag, or
- * label. */
- rp = NULL;
- break;
- }
- rp = p;
- }
- badrange = FALSE;
- if ((rp != NULL) && (rp != tagName) && (rp != (pend - 1))) {
- long length;
- Tcl_Obj *objPtr1, *objPtr2;
- Blt_TableColumn from, to;
- int result;
-
- length = rp - tagName;
- objPtr1 = Tcl_NewStringObj(tagName, length);
- rp++;
- objPtr2 = Tcl_NewStringObj(rp, pend - rp);
- from = Blt_Table_FindColumn(interp, table, objPtr1);
- if (from != NULL) {
- to = Blt_Table_FindColumn(interp, table, objPtr2);
- }
- Tcl_DecrRefCount(objPtr1);
- Tcl_DecrRefCount(objPtr2);
- if (to != NULL) {
- iterPtr->start = Blt_Table_ColumnIndex(from);
- iterPtr->end = Blt_Table_ColumnIndex(to);
- iterPtr->type = TABLE_ITERATOR_RANGE;
- return TCL_OK;
- }
- badrange = TRUE;
- }
- if (Tcl_GetLongFromObj((Tcl_Interp *)NULL, objPtr, &lval) == TCL_OK) {
- if ((lval < 1) || (lval > Blt_Table_NumColumns(table))) {
- if (interp != NULL) {
- Tcl_AppendResult(interp,
- "can't find column: bad column index \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- iterPtr->start = iterPtr->end = lval;
- return TCL_OK;
- } else if (strcmp(tagName, "all") == 0) {
- iterPtr->type = TABLE_ITERATOR_ALL;
- iterPtr->start = 1;
- iterPtr->end = Blt_Table_NumColumns(table);
- return TCL_OK;
- } else if (strcmp(tagName, "end") == 0) {
- iterPtr->start = iterPtr->end = Blt_Table_NumColumns(table);
- return TCL_OK;
- } else {
- Column *colPtr;
-
- colPtr = Blt_Table_FindColumnByLabel(table, tagName);
- if (colPtr != NULL) {
- iterPtr->start = iterPtr->end = colPtr->index;
- return TCL_OK;
- }
- iterPtr->tablePtr = Blt_Table_FindColumnTagTable(iterPtr->table,
- tagName);
- if (iterPtr->tablePtr != NULL) {
- iterPtr->type = TABLE_ITERATOR_TAG;
- return TCL_OK;
- }
- }
- if ((interp != NULL) && (!badrange)) {
- Tcl_AppendResult(interp, "can't find column tag \"", tagName,
- "\" in ", Blt_Table_TableName(table), (char *)NULL);
- }
- return TCL_ERROR;
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_FirstTaggedColumn --
- *
- * Returns the first column based upon given iterator.
- *
- * Results:
- * Returns the column location of the first item. If no more columns
- * can be found, then -1 is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableColumn
-Blt_Table_FirstTaggedColumn(Blt_TableIterator *iterPtr)
-{
- if (iterPtr->type == TABLE_ITERATOR_TAG) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FirstHashEntry(iterPtr->tablePtr, &iterPtr->cursor);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
- } else if (iterPtr->type == TABLE_ITERATOR_CHAIN) {
- iterPtr->link = Blt_Chain_FirstLink(iterPtr->chain);
- if (iterPtr->link != NULL) {
- return Blt_Chain_GetValue(iterPtr->link);
- }
- } else if (iterPtr->start <= iterPtr->end) {
- Blt_TableColumn col;
-
- col = Blt_Table_Column(iterPtr->table, iterPtr->start);
- iterPtr->next = iterPtr->start + 1;
- return col;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_NextTaggedColumn --
- *
- * Returns the column location of the next column using the given
- * iterator.
- *
- * Results:
- * Returns the column location of the next item. If no more columns can
- * be found, then -1 is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableColumn
-Blt_Table_NextTaggedColumn(Blt_TableIterator *iterPtr)
-{
- if (iterPtr->type == TABLE_ITERATOR_TAG) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_NextHashEntry(&iterPtr->cursor);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- } else if (iterPtr->type == TABLE_ITERATOR_CHAIN) {
- iterPtr->link = Blt_Chain_NextLink(iterPtr->link);
- if (iterPtr->link != NULL) {
- return Blt_Chain_GetValue(iterPtr->link);
- }
- } else if (iterPtr->next <= iterPtr->end) {
- Blt_TableColumn col;
-
- col = Blt_Table_Column(iterPtr->table, iterPtr->next);
- iterPtr->next++;
- return col;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_FindColumn --
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableColumn
-Blt_Table_FindColumn(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *objPtr)
-{
- Blt_TableIterator iter;
- Blt_TableColumn first, next;
-
- if (Blt_Table_IterateColumns(interp, table, objPtr, &iter) != TCL_OK) {
- return NULL;
- }
- first = Blt_Table_FirstTaggedColumn(&iter);
- if (first == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "no columns specified by \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return NULL;
- }
- next = Blt_Table_NextTaggedColumn(&iter);
- if (next != NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "multiple columns specified by \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return NULL;
- }
- return first;
-}
-
-
-int
-Blt_Table_ListColumns(Tcl_Interp *interp, Blt_Table table, int objc,
- Tcl_Obj *const *objv, Blt_Chain chain)
-{
- Blt_ChainLink link;
- Blt_HashTable cols;
- int i;
-
- Blt_InitHashTableWithPool(&cols, BLT_ONE_WORD_KEYS);
- /* Initialize the hash table with the existing entries. */
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- int isNew;
- Blt_TableColumn col;
-
- col = Blt_Chain_GetValue(link);
- Blt_CreateHashEntry(&cols, (char *)col, &isNew);
- }
- /* Collect the columns into a hash table. */
- for (i = 0; i < objc; i++) {
- Blt_TableIterator iter;
- Blt_TableColumn col;
-
- if (Blt_Table_IterateColumns(interp, table, objv[i], &iter)
- != TCL_OK) {
- Blt_DeleteHashTable(&cols);
- return TCL_ERROR;
- }
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- int isNew;
-
- Blt_CreateHashEntry(&cols, (char *)col, &isNew);
- if (isNew) {
- Blt_Chain_Append(chain, col);
- }
- }
- }
- Blt_DeleteHashTable(&cols);
- return TCL_OK;
-}
-
-int
-Blt_Table_ListRows(Tcl_Interp *interp, Blt_Table table, int objc,
- Tcl_Obj *const *objv, Blt_Chain chain)
-{
- Blt_ChainLink link;
- Blt_HashTable rows;
- int i;
-
- Blt_InitHashTableWithPool(&rows, BLT_ONE_WORD_KEYS);
- /* Initialize the hash table with the existing entries. */
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- int isNew;
- Blt_TableRow row;
-
- row = Blt_Chain_GetValue(link);
- Blt_CreateHashEntry(&rows, (char *)row, &isNew);
- }
- for (i = 0; i < objc; i++) {
- Blt_TableIterator iter;
- Blt_TableRow row;
-
- if (Blt_Table_IterateRows(interp, table, objv[i], &iter) != TCL_OK){
- Blt_DeleteHashTable(&rows);
- return TCL_ERROR;
- }
- /* Append the new rows onto the chain. */
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- int isNew;
-
- Blt_CreateHashEntry(&rows, (char *)row, &isNew);
- if (isNew) {
- Blt_Chain_Append(chain, row);
- }
- }
- }
- Blt_DeleteHashTable(&rows);
- return TCL_OK;
-}
-
-int
-Blt_Table_IterateRowsObjv(Tcl_Interp *interp, Blt_Table table, int objc,
- Tcl_Obj *const *objv, Blt_TableIterator *iterPtr)
-{
- Blt_Chain chain;
-
- chain = Blt_Chain_Create();
- if (Blt_Table_ListRows(interp, table, objc, objv, chain) != TCL_OK) {
- Blt_Chain_Destroy(chain);
- return TCL_ERROR;
- }
- iterPtr->type = TABLE_ITERATOR_CHAIN;
- iterPtr->start = 1;
- iterPtr->end = 1;
- iterPtr->chain = chain;
- iterPtr->tagName = "";
- return TCL_OK;
-}
-
-void
-Blt_Table_IterateAllRows(Blt_Table table, Blt_TableIterator *iterPtr)
-{
- iterPtr->table = table;
- iterPtr->type = TABLE_ITERATOR_ALL;
- iterPtr->start = 1;
- iterPtr->end = Blt_Table_NumRows(table);
- iterPtr->tagName = "all";
- iterPtr->chain = NULL;
-}
-
-int
-Blt_Table_IterateColumnsObjv(Tcl_Interp *interp, Blt_Table table, int objc,
- Tcl_Obj *const *objv, Blt_TableIterator *iterPtr)
-{
- Blt_Chain chain;
-
- chain = Blt_Chain_Create();
- if (Blt_Table_ListColumns(interp, table, objc, objv, chain) != TCL_OK) {
- Blt_Chain_Destroy(chain);
- return TCL_ERROR;
- }
- iterPtr->type = TABLE_ITERATOR_CHAIN;
- iterPtr->start = 1;
- iterPtr->end = 1;
- iterPtr->chain = chain;
- iterPtr->tagName = "";
- return TCL_OK;
-}
-
-void
-Blt_Table_IterateAllColumns(Blt_Table table, Blt_TableIterator *iterPtr)
-{
- iterPtr->table = table;
- iterPtr->type = TABLE_ITERATOR_ALL;
- iterPtr->start = 1;
- iterPtr->end = Blt_Table_NumColumns(table);
- iterPtr->tagName = "all";
- iterPtr->chain = NULL;
-}
-
-void
-Blt_Table_FreeIteratorObjv(Blt_TableIterator *iterPtr)
-{
- if ((iterPtr->type == TABLE_ITERATOR_CHAIN) && (iterPtr->chain != NULL)) {
- Blt_Chain_Destroy(iterPtr->chain);
- iterPtr->chain = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeTrace --
- *
- * Memory is deallocated for the trace.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeTrace(Trace *tracePtr)
-{
- if (tracePtr->rowTag != NULL) {
- Blt_Free(tracePtr->rowTag);
- }
- if (tracePtr->colTag != NULL) {
- Blt_Free(tracePtr->colTag);
- }
- if (tracePtr->link != NULL) {
- Blt_Chain_DeleteLink(tracePtr->chain, tracePtr->link);
- }
- Blt_Free(tracePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_DeleteTrace --
- *
- * Deletes a trace.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Memory is deallocated for the trace.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Table_DeleteTrace(Trace *tracePtr)
-{
- if ((tracePtr->flags & TABLE_TRACE_DESTROYED) == 0) {
- if (tracePtr->deleteProc != NULL) {
- (*tracePtr->deleteProc)(tracePtr->clientData);
- }
- /*
- * This accomplishes two things.
- * 1) It doesn't let it anything match the trace and
- * 2) marks the trace as invalid.
- */
- tracePtr->flags = TABLE_TRACE_DESTROYED;
-
- Tcl_EventuallyFree(tracePtr, (Tcl_FreeProc *)FreeTrace);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_Traces --
- *
- * Returns the chain of traces for a particular client.
- *
- * Results:
- * Returns a pointer to the chain containing the traces for the
- * given row. If the row has no traces, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Chain
-Blt_Table_Traces(Table *tablePtr)
-{
- return tablePtr->traces;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_CreateTrace --
- *
- * Creates a trace for one or more tuples with one or more column keys.
- * Whenever a matching action occurs in the table object, the specified
- * procedure is executed.
- *
- * Results:
- * Returns a token for the trace.
- *
- * Side Effects:
- * Memory is allocated for the trace.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableTrace
-Blt_Table_CreateTrace(
- Table *tablePtr, /* Table to be traced. */
- Row *rowPtr,
- Column *colPtr, /* Cell in table. */
- const char *rowTag,
- const char *colTag,
- unsigned int flags, /* Bit mask indicating what actions to
- * trace. */
- Blt_TableTraceProc *proc, /* Callback procedure for the trace. */
- Blt_TableTraceDeleteProc *deleteProc,
- ClientData clientData) /* One-word of data passed along when
- * the callback is executed. */
-{
- Trace *tracePtr;
-
- tracePtr = Blt_Calloc(1, sizeof (Trace));
- if (tracePtr == NULL) {
- return NULL;
- }
- tracePtr->row = rowPtr;
- tracePtr->column = colPtr;
- if (rowTag != NULL) {
- tracePtr->rowTag = Blt_AssertStrdup(rowTag);
- }
- if (colTag != NULL) {
- tracePtr->colTag = Blt_AssertStrdup(colTag);
- }
- tracePtr->flags = flags;
- tracePtr->proc = proc;
- tracePtr->deleteProc = deleteProc;
- tracePtr->clientData = clientData;
- tracePtr->chain = tablePtr->traces;
- tracePtr->link = Blt_Chain_Append(tablePtr->traces, tracePtr);
- return tracePtr;
-}
-
-Blt_TableTrace
-Blt_Table_CreateColumnTrace(
- Table *tablePtr, /* Table to be traced. */
- Column *colPtr, /* Cell in table. */
- unsigned int flags, /* Bit mask indicating what actions to
- * trace. */
- Blt_TableTraceProc *proc, /* Callback procedure for the trace. */
- Blt_TableTraceDeleteProc *deleteProc,
- ClientData clientData) /* One-word of data passed along when
- * the callback is executed. */
-{
- return Blt_Table_CreateTrace(tablePtr, NULL, colPtr, NULL, NULL, flags,
- proc, deleteProc, clientData);
-}
-
-Blt_TableTrace
-Blt_Table_CreateColumnTagTrace(
- Table *tablePtr, /* Table to be traced. */
- const char *colTag, /* Cell in table. */
- unsigned int flags, /* Bit mask indicating what actions to
- * trace. */
- Blt_TableTraceProc *proc, /* Callback procedure for the trace. */
- Blt_TableTraceDeleteProc *deleteProc,
- ClientData clientData) /* One-word of data passed along when
- * the callback is executed. */
-{
- return Blt_Table_CreateTrace(tablePtr, NULL, NULL, NULL, colTag, flags,
- proc, deleteProc, clientData);
-}
-
-Blt_TableTrace
-Blt_Table_CreateRowTrace(
- Table *tablePtr, /* Table to be traced. */
- Row *rowPtr, /* Cell in table. */
- unsigned int flags, /* Bit mask indicating what actions to
- * trace. */
- Blt_TableTraceProc *proc, /* Callback procedure for the trace. */
- Blt_TableTraceDeleteProc *deleteProc,
- ClientData clientData) /* One-word of data passed along when
- * the callback is executed. */
-{
- return Blt_Table_CreateTrace(tablePtr, rowPtr, NULL, NULL, NULL, flags,
- proc, deleteProc, clientData);
-}
-
-Blt_TableTrace
-Blt_Table_CreateRowTagTrace(
- Table *tablePtr, /* Table to be traced. */
- const char *rowTag, /* Cell in table. */
- unsigned int flags, /* Bit mask indicating what actions to
- * trace. */
- Blt_TableTraceProc *proc, /* Callback procedure for the trace. */
- Blt_TableTraceDeleteProc *deleteProc,
- ClientData clientData) /* One-word of data passed along when
- * the callback is executed. */
-{
- return Blt_Table_CreateTrace(tablePtr, NULL, NULL, rowTag, NULL, flags,
- proc, deleteProc, clientData);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_ReleaseTags --
- *
- * Releases the tag table used by this client.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * If no client is using the table, then it is freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Table_ReleaseTags(Table *tablePtr)
-{
- Tags *tagsPtr;
-
- tagsPtr = tablePtr->tags;
- tagsPtr->refCount--;
- if (tagsPtr->refCount <= 0) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&tagsPtr->rowTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(tablePtr);
- Blt_Free(tablePtr);
- }
- Blt_DeleteHashTable(&tagsPtr->rowTable);
- tablePtr->rowTags = NULL;
- for (hPtr = Blt_FirstHashEntry(&tagsPtr->columnTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(tablePtr);
- Blt_Free(tablePtr);
- }
- Blt_DeleteHashTable(&tagsPtr->columnTable);
- Blt_Free(tagsPtr);
- tablePtr->columnTags = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TableTagsAreShared --
- *
- * Returns whether the tag table is shared with another client.
- *
- * Results:
- * Returns TRUE if the current tag table is shared with another
- * client, FALSE otherwise.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_TagsAreShared(Table *tablePtr)
-{
- return (tablePtr->tags->refCount > 1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_FindRowTagTable --
- *
- * Returns the hash table containing row indices for a tag.
- *
- * Results:
- * Returns a pointer to the hash table containing indices for the given
- * tag. If the row has no tags, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_HashTable *
-Blt_Table_FindRowTagTable(Table *tablePtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(tablePtr->rowTags, tagName);
- if (hPtr == NULL) {
- return NULL; /* Row isn't tagged. */
- }
- return Blt_GetHashValue(hPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_FindColumnTagTable --
- *
- * Returns the hash table containing column indices for a tag.
- *
- * Results:
- * Returns a pointer to the hash table containing indices for the given
- * tag. If the tag has no indices, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_HashTable *
-Blt_Table_FindColumnTagTable(Table *tablePtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(tablePtr->columnTags, tagName);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_ForgetRowTag --
- *
- * Removes a tag from the row tag table. Row tags are contained in hash
- * tables keyed by the tag name. Each table is in turn hashed by the row
- * index in the row tag table.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Entries for the given tag in the corresponding row in hash tables may
- * be removed.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_ForgetRowTag(Tcl_Interp *interp, Table *tablePtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tagTablePtr;
-
- if ((strcmp(tagName, "all") == 0) || (strcmp(tagName, "end") == 0)) {
- return TCL_OK; /* Can't forget reserved tags. */
- }
- hPtr = Blt_FindHashEntry(tablePtr->rowTags, tagName);
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "unknown row tag \"", tagName, "\"",
- (char *)NULL);
- }
- return TCL_ERROR; /* No such row tag. */
- }
- tagTablePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(tagTablePtr);
- Blt_Free(tagTablePtr);
- Blt_DeleteHashEntry(tablePtr->rowTags, hPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_ForgetColumnTag --
- *
- * Removes a tag from the column tag table. Column tags are contained in
- * hash tables keyed by the tag name. Each table is in turn hashed by
- * the column offset in the column tag table.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Entries for the given tag in the corresponding column in hash tables
- * may be removed.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_ForgetColumnTag(Tcl_Interp *interp, Table *tablePtr,
- const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tagTablePtr;
-
- if ((strcmp(tagName, "all") == 0) || (strcmp(tagName, "end") == 0)) {
- return TCL_OK; /* Can't forget reserved tags. */
- }
- hPtr = Blt_FindHashEntry(tablePtr->columnTags, tagName);
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "unknown column tag \"", tagName, "\"",
- (char *)NULL);
- }
- return TCL_ERROR; /* No such column tag. */
- }
- tagTablePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(tagTablePtr);
- Blt_Free(tagTablePtr);
- Blt_DeleteHashEntry(tablePtr->columnTags, hPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_SetRowTag --
- *
- * Associates a tag with a given row. Individual row tags are stored in
- * hash tables keyed by the tag name. Each table is in turn stored in a
- * hash table keyed by the row location.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A tag is stored for a particular row.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_SetRowTag(Tcl_Interp *interp, Table *tablePtr, Row *rowPtr,
- const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tagTablePtr;
- int isNew;
- long dummy;
-
- if ((strcmp(tagName, "all") == 0) || (strcmp(tagName, "end") == 0)) {
- return TCL_OK; /* Don't need to create reserved tags. */
- }
- if (tagName[0] == '\0') {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "tag \"", tagName, "\" can't be empty.",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (tagName[0] == '-') {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "tag \"", tagName,
- "\" can't start with a '-'.", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (Tcl_GetLong(NULL, (char *)tagName, &dummy) == TCL_OK) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "tag \"", tagName, "\" can't be a number.",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- hPtr = Blt_CreateHashEntry(tablePtr->rowTags, tagName, &isNew);
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't add tag \"", tagName,
- "\": out of memory", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (isNew) {
- tagTablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(tagTablePtr, BLT_ONE_WORD_KEYS);
- Blt_SetHashValue(hPtr, tagTablePtr);
- } else {
- tagTablePtr = Blt_GetHashValue(hPtr);
- }
- if (rowPtr != NULL) {
- hPtr = Blt_CreateHashEntry(tagTablePtr, (char *)rowPtr, &isNew);
- if (isNew) {
- Blt_SetHashValue(hPtr, rowPtr);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_SetColumnTag --
- *
- * Associates a tag with a given column. Individual column tags
- * are stored in hash tables keyed by the tag name. Each table
- * is in turn stored in a hash table keyed by the column
- * location.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A tag is stored for a particular column.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_SetColumnTag(Tcl_Interp *interp, Table *tablePtr, Column *columnPtr,
- const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tagTablePtr;
- int isNew;
- long dummy;
-
- if ((strcmp(tagName, "all") == 0) || (strcmp(tagName, "end") == 0)) {
- return TCL_OK; /* Don't create reserved tags. */
- }
- if (tagName[0] == '\0') {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "tag \"", tagName, "\" can't be empty.",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (tagName[0] == '-') {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "tag \"", tagName,
- "\" can't start with a '-'.", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (Tcl_GetLong(NULL, (char *)tagName, &dummy) == TCL_OK) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "tag \"", tagName, "\" can't be a number.",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- hPtr = Blt_CreateHashEntry(tablePtr->columnTags, tagName, &isNew);
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't add tag \"", tagName,
- "\": out of memory", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (isNew) {
- tagTablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(tagTablePtr, BLT_ONE_WORD_KEYS);
- Blt_SetHashValue(hPtr, tagTablePtr);
- } else {
- tagTablePtr = Blt_GetHashValue(hPtr);
- }
- if (columnPtr != NULL) {
- hPtr = Blt_CreateHashEntry(tagTablePtr, (char *)columnPtr, &isNew);
- if (isNew) {
- Blt_SetHashValue(hPtr, columnPtr);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_HasRowTag --
- *
- * Checks if a tag is associated with the given row.
- *
- * Results:
- * Returns TRUE if the tag is found, FALSE otherwise.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_HasRowTag(Table *tablePtr, Row *rowPtr, const char *tagName)
-{
- Blt_HashTable *tagTablePtr;
- Blt_HashEntry *hPtr;
-
- if (strcmp(tagName, "all") == 0) {
- return TRUE; /* "all" tags matches every row. */
- }
- if (strcmp(tagName, "end") == 0) {
- return (Blt_Table_RowIndex(rowPtr) ==
- Blt_Table_NumRows(tablePtr));
- }
- tagTablePtr = Blt_Table_FindRowTagTable(tablePtr, tagName);
- if (tagTablePtr == NULL) {
- return FALSE;
- }
- hPtr = Blt_FindHashEntry(tagTablePtr, (char *)rowPtr);
- if (hPtr != NULL) {
- return TRUE; /* Found tag in row tag table. */
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_HasColumnTag --
- *
- * Checks if a tag is associated with the given column.
- *
- * Results:
- * Returns TRUE if the tag is found, FALSE otherwise.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_HasColumnTag(Table *tablePtr, Column *colPtr,
- const char *tagName)
-{
- Blt_HashTable *tagTablePtr;
- Blt_HashEntry *hPtr;
-
- if (strcmp(tagName, "all") == 0) {
- return TRUE; /* "all" tags matches every column. */
- }
- if (strcmp(tagName, "end") == 0) {
- return (Blt_Table_ColumnIndex(colPtr) ==
- Blt_Table_NumColumns(tablePtr));
- }
- tagTablePtr = Blt_Table_FindColumnTagTable(tablePtr, tagName);
- if (tagTablePtr == NULL) {
- return FALSE;
- }
- hPtr = Blt_FindHashEntry(tagTablePtr, (char *)colPtr);
- if (hPtr != NULL) {
- return TRUE; /* Found tag in column tag table. */
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_UnsetRowTag --
- *
- * Removes a tag from a given row.
- *
- * Results:
- * A standard TCL result. If an error occurred, TCL_ERROR
- * is returned and the interpreter result contains the error
- * message.
- *
- * Side Effects:
- * The tag associated with the row is freed.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_UnsetRowTag(Tcl_Interp *interp, Table *tablePtr, Row *rowPtr,
- const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tagTablePtr;
-
- if ((strcmp(tagName, "all") == 0) || (strcmp(tagName, "end") == 0)) {
- return TCL_OK; /* Can't remove reserved tags. */
- }
- tagTablePtr = Blt_Table_FindRowTagTable(tablePtr, tagName);
- if (tagTablePtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "unknown row tag \"", tagName, "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- hPtr = Blt_FindHashEntry(tagTablePtr, (char *)rowPtr);
- if (hPtr != NULL) {
- Blt_DeleteHashEntry(tagTablePtr, hPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_UnsetColumnTag --
- *
- * Removes a tag from a given column.
- *
- * Results:
- * A standard TCL result. If an error occurred, TCL_ERROR
- * is returned and the interpreter result contains the error
- * message.
- *
- * Side Effects:
- * The tag associated with the column is freed.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_UnsetColumnTag(Tcl_Interp *interp, Table *tablePtr, Column *colPtr,
- const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tagTablePtr;
-
- if ((strcmp(tagName, "all") == 0) || (strcmp(tagName, "end") == 0)) {
- return TCL_OK; /* Can't remove reserved tags. */
- }
- tagTablePtr = Blt_Table_FindColumnTagTable(tablePtr, tagName);
- if (tagTablePtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "unknown column tag \"", tagName, "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- hPtr = Blt_FindHashEntry(tagTablePtr, (char *)colPtr);
- if (hPtr != NULL) {
- Blt_DeleteHashEntry(tagTablePtr, hPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_ClearRowTags --
- *
- * Removes all tags for a given row.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * All tags associated with the row are freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Table_ClearRowTags(Table *tablePtr, Row *rowPtr)
-{
- ClearTags(tablePtr->rowTags, (Header *)rowPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_ClearColumnTags --
- *
- * Removes all tags for a given column.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * All tags associated with the column are freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Table_ClearColumnTags(Table *tablePtr, Column *colPtr)
-{
- ClearTags(tablePtr->columnTags, (Header *)colPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_GetValue --
- *
- * Gets a scalar Tcl_Obj value from the table at the designated
- * row, column location. "Read" traces may be fired *before* the
- * value is retrieved. If no value exists at that location,
- * *objPtrPtr is set to NULL.
- *
- * Results:
- * A standard TCL result. Returns TCL_OK if successful accessing
- * the table location. If an error occurs, TCL_ERROR is returned
- * and an error message is left in the interpreter.
- *
- * --------------------------------------------------------------------------
- */
-Blt_TableValue
-Blt_Table_GetValue(Table *tablePtr, Row *rowPtr, Column *colPtr)
-{
- return GetValue(tablePtr, rowPtr, colPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_SetValue --
- *
- * Sets a scalar Tcl_Obj value in the table at the designated row and
- * column. "Write" and possibly "create" or "unset" traces may be fired
- * *after* the value is set. If valuePtr is NULL, this indicates to
- * unset the old value.
- *
- * Results:
- * A standard TCL result. Returns TCL_OK if successful setting the value
- * at the table location. If an error occurs, TCL_ERROR is returned and
- * an error message is left in the interpreter.
- *
- * --------------------------------------------------------------------------
- */
-int
-Blt_Table_SetValue(Table *tablePtr, Row *rowPtr, Column *colPtr, Value *newPtr)
-{
- Value *valuePtr;
- int flags;
-
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- flags = TABLE_TRACE_WRITES;
- if (IsEmpty(newPtr)) { /* New value is empty. Effectively
- * unsetting the value. */
- flags |= TABLE_TRACE_UNSETS;
- } else if (IsEmpty(valuePtr)) {
- flags |= TABLE_TRACE_CREATES; /* Old value was empty. */
- }
- FreeValue(valuePtr);
- *valuePtr = *newPtr; /* Copy the value. */
- if (newPtr->string != NULL) {
- valuePtr->string = Blt_AssertStrdup(newPtr->string);
- }
- CallClientTraces(tablePtr, rowPtr, colPtr, flags);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_GetObj --
- *
- * Gets a scalar Tcl_Obj value from the table at the designated
- * row, column location. "Read" traces may be fired *before* the
- * value is retrieved. If no value exists at that location,
- * *objPtrPtr is set to NULL.
- *
- * Results:
- * A standard TCL result. Returns TCL_OK if successful accessing
- * the table location. If an error occurs, TCL_ERROR is returned
- * and an error message is left in the interpreter.
- *
- * --------------------------------------------------------------------------
- */
-Tcl_Obj *
-Blt_Table_GetObj(Table *tablePtr, Row *rowPtr, Column *colPtr)
-{
- Value *valuePtr;
- Tcl_Obj *objPtr;
-
- CallClientTraces(tablePtr, rowPtr, colPtr, TABLE_TRACE_READS);
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- if (IsEmpty(valuePtr)) {
- return NULL;
- }
- objPtr = GetObjFromValue(tablePtr->interp, colPtr->type, valuePtr);
- return objPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_SetObj --
- *
- * Sets a scalar Tcl_Obj value in the table at the designated row and
- * column. "Write" and possibly "create" or "unset" traces may be fired
- * *after* the value is set. If valueObjPtr is NULL, this indicates to
- * unset the old value.
- *
- * Results:
- * A standard TCL result. Returns TCL_OK if successful setting the value
- * at the table location. If an error occurs, TCL_ERROR is returned and
- * an error message is left in the interpreter.
- *
- * --------------------------------------------------------------------------
- */
-int
-Blt_Table_SetObj(Table *tablePtr, Row *rowPtr, Column *colPtr,
- Tcl_Obj *objPtr)
-{
- unsigned int flags;
- Value *valuePtr;
-
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- flags = TABLE_TRACE_WRITES;
- if (objPtr == NULL) { /* New value is empty. Effectively
- * unsetting the value. */
- flags |= TABLE_TRACE_UNSETS;
- } else if (IsEmpty(valuePtr)) {
- flags |= TABLE_TRACE_CREATES;
- }
- if (SetValueFromObj(tablePtr->interp, colPtr->type, objPtr, valuePtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- CallClientTraces(tablePtr, rowPtr, colPtr, flags);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_UnsetValue --
- *
- * Unsets a scalar Tcl_Obj value in the table at the designated row,
- * column location. It's okay is there is presently no value at the
- * location. Unset traces may be fired *before* the value is unset.
- *
- * Results:
- * A standard TCL result. Returns TCL_OK if successful unsetting the
- * value at the table location. If an error occurs, TCL_ERROR is
- * returned and an error message is left in the interpreter.
- *
- * --------------------------------------------------------------------------
- */
-int
-Blt_Table_UnsetValue(Table *tablePtr, Row *rowPtr, Column *colPtr)
-{
- Value *valuePtr;
-
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- if (!IsEmpty(valuePtr)) {
- CallClientTraces(tablePtr, rowPtr, colPtr, TABLE_TRACE_UNSETS);
- /* Indicate the keytables need to be regenerated. */
- if (colPtr->flags & TABLE_COLUMN_PRIMARY_KEY) {
- tablePtr->flags |= TABLE_KEYS_DIRTY;
- }
- FreeValue(valuePtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_CreateObject --
- *
- * Creates a table object by the designated name. It's an error if a
- * table object already exists by that name.
- *
- * Results:
- * A standard TCL result. If successful, a new table object is created
- * and TCL_OK is returned. If an object already exists or the table
- * object can't be allocated, then TCL_ERROR is returned and an error
- * message is left in the interpreter.
- *
- * Side Effects:
- * A new table object is created.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_CreateTable(
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- const char *name, /* Name of tuple in namespace. Object must
- * not already exist. */
- Table **tablePtrPtr) /* (out) Client token of newly created table
- * object. Releasing the token will free the
- * tuple. If NULL, no token is generated. */
-{
- InterpData *dataPtr;
- TableObject *corePtr;
- Blt_ObjectName objName;
- Table *newClientPtr;
- Tcl_DString ds;
- char *qualName;
- char string[200];
-
- dataPtr = GetInterpData(interp);
- if (name != NULL) {
- /* Check if a client by this name already exist in the current
- * namespace. */
- if (GetTable(dataPtr, name, NS_SEARCH_CURRENT) != NULL) {
- Tcl_AppendResult(interp, "a table object \"", name,
- "\" already exists", (char *)NULL);
- return TCL_ERROR;
- }
- } else {
- /* Generate a unique name in the current namespace. */
- do {
- sprintf_s(string, 200, "datatable%d", dataPtr->nextId++);
- } while (GetTable(dataPtr, name, NS_SEARCH_CURRENT) != NULL);
- name = string;
- }
- /*
- * Tear apart and put back together the namespace-qualified name of the
- * object. This is to ensure that naming is consistent.
- */
- if (!Blt_ParseObjectName(interp, name, &objName, 0)) {
- return TCL_ERROR;
- }
- corePtr = NewTableObject();
- if (corePtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate table object.", (char *)NULL);
- Tcl_DStringFree(&ds);
- return TCL_ERROR;
- }
- qualName = Blt_MakeQualifiedName(&objName, &ds);
- newClientPtr = NewTable(dataPtr, corePtr, qualName);
- Tcl_DStringFree(&ds);
- if (newClientPtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate table token", (char *)NULL);
- return TCL_ERROR;
- }
-
- if (tablePtrPtr != NULL) {
- *tablePtrPtr = newClientPtr;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_Open --
- *
- * Allocates a token for the table object designated by name. It's an
- * error if no table object exists by that name. The token returned is
- * passed to various routines to manipulate the object. Traces and event
- * notifications are also made through the token.
- *
- * Results:
- * A new token is returned representing the table object.
- *
- * Side Effects:
- * If this is the remaining client, then the table object itself is
- * freed.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_Open(
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- const char *name, /* Name of table object in namespace. */
- Table **tablePtrPtr)
-{
- Table *tablePtr, *newClientPtr;
- InterpData *dataPtr;
-
- dataPtr = GetInterpData(interp);
- tablePtr = GetTable(dataPtr, name, NS_SEARCH_BOTH);
- if ((tablePtr == NULL) || (tablePtr->corePtr == NULL)) {
- Tcl_AppendResult(interp, "can't find a table object \"", name, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- newClientPtr = NewTable(dataPtr, tablePtr->corePtr, name);
- if (newClientPtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate token for table \"", name,
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- *tablePtrPtr = newClientPtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_Close --
- *
- * Releases the tuple token, indicating this the client is no longer
- * using the object. The client is removed from the tuple object's client
- * list. If this is the last client, then the object itself is destroyed
- * and memory is freed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * If this is the remaining client, then the table object itself
- * is freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Table_Close(Table *tablePtr)
-{
- Blt_Chain chain;
-
- if (tablePtr->magic != TABLE_MAGIC) {
- fprintf(stderr, "invalid table object token 0x%lx\n",
- (unsigned long)tablePtr);
- return;
- }
- chain = Blt_GetHashValue(tablePtr->hPtr);
- Blt_Chain_DeleteLink(chain, tablePtr->link2);
- if (Blt_Chain_GetLength(chain) == 0) {
- Blt_DeleteHashEntry(tablePtr->tablePtr, tablePtr->hPtr);
- }
- DestroyTable(tablePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_TableExists --
- *
- * Indicates if a table object by the given name exists in either the
- * current or global namespace.
- *
- * Results:
- * Returns 1 if a table object exists and 0 otherwise.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_TableExists(Tcl_Interp *interp, const char *name)
-{
- InterpData *dataPtr;
-
- dataPtr = GetInterpData(interp);
- return (GetTable(dataPtr, name, NS_SEARCH_BOTH) != NULL);
-}
-
-static Notifier *
-AppendNotifier(Tcl_Interp *interp, Blt_Chain chain, unsigned int mask,
- Header *headerPtr, const char *tag,
- Blt_TableNotifyEventProc *proc,
- Blt_TableNotifierDeleteProc *deleteProc,
- ClientData clientData)
-{
- Notifier *notifierPtr;
-
- notifierPtr = Blt_AssertMalloc(sizeof (Notifier));
- notifierPtr->proc = proc;
- notifierPtr->deleteProc = deleteProc;
- notifierPtr->chain = chain;
- notifierPtr->clientData = clientData;
- notifierPtr->header = headerPtr;
- notifierPtr->tag = (tag != NULL) ? Blt_AssertStrdup(tag) : NULL;
- notifierPtr->flags = mask;
- notifierPtr->interp = interp;
- notifierPtr->link = Blt_Chain_Append(chain, notifierPtr);
- return notifierPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_CreateColumnNotifier --
- *
- * Creates an event handler using the following three pieces of
- * information:
- * 1. C function pointer,
- * 2. one-word of data passed on each call, and
- * 3. event mask indicating which events are of interest.
- * If an event already exists matching all of the above criteria,
- * it is repositioned on the end of the event handler list. This
- * means that it will be the last to fire.
- *
- * Results:
- * Returns a pointer to the event handler.
- *
- * Side Effects:
- * Memory for the event handler is possibly allocated.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableNotifier
-Blt_Table_CreateColumnNotifier(Tcl_Interp *interp, Table *tablePtr,
- Blt_TableColumn col, unsigned int mask,
- Blt_TableNotifyEventProc *proc,
- Blt_TableNotifierDeleteProc *deletedProc,
- ClientData clientData)
-{
- return AppendNotifier(interp, tablePtr->columnNotifiers,
- mask | TABLE_NOTIFY_COLUMN, (Header *)col, NULL, proc,
- deletedProc, clientData);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_CreateColumnTagNotifier --
- *
- * Creates an event handler using the following three pieces of
- * information:
- * 1. C function pointer,
- * 2. one-word of data passed on each call, and
- * 3. event mask indicating which events are of interest.
- * If an event already exists matching all of the above criteria,
- * it is repositioned on the end of the event handler list. This
- * means that it will be the last to fire.
- *
- * Results:
- * Returns a pointer to the event handler.
- *
- * Side Effects:
- * Memory for the event handler is possibly allocated.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableNotifier
-Blt_Table_CreateColumnTagNotifier(Tcl_Interp *interp, Table *tablePtr,
- const char *tag, unsigned int mask,
- Blt_TableNotifyEventProc *proc,
- Blt_TableNotifierDeleteProc *deletedProc,
- ClientData clientData)
-{
- return AppendNotifier(interp, tablePtr->columnNotifiers,
- mask | TABLE_NOTIFY_COLUMN, (Header *)NULL, tag, proc,
- deletedProc, clientData);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_CreateRowNotifier --
- *
- * Creates an event handler using the following three pieces of
- * information:
- * 1. C function pointer,
- * 2. one-word of data passed on each call, and
- * 3. event mask indicating which events are of interest.
- * If an event already exists matching all of the above criteria,
- * it is repositioned on the end of the event handler list. This
- * means that it will be the last to fire.
- *
- * Results:
- * Returns a pointer to the event handler.
- *
- * Side Effects:
- * Memory for the event handler is possibly allocated.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableNotifier
-Blt_Table_CreateRowNotifier(Tcl_Interp *interp, Table *tablePtr,
- Blt_TableRow row, unsigned int mask,
- Blt_TableNotifyEventProc *proc,
- Blt_TableNotifierDeleteProc *deletedProc,
- ClientData clientData)
-{
- return AppendNotifier(interp, tablePtr->rowNotifiers,
- mask | TABLE_NOTIFY_ROW, (Header *)row, NULL, proc, deletedProc,
- clientData);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_CreateColumnTagNotifier --
- *
- * Creates an event handler using the following three pieces of
- * information:
- * 1. C function pointer,
- * 2. one-word of data passed on each call, and
- * 3. event mask indicating which events are of interest.
- * If an event already exists matching all of the above criteria,
- * it is repositioned on the end of the event handler list. This
- * means that it will be the last to fire.
- *
- * Results:
- * Returns a pointer to the event handler.
- *
- * Side Effects:
- * Memory for the event handler is possibly allocated.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableNotifier
-Blt_Table_CreateRowTagNotifier(Tcl_Interp *interp, Table *tablePtr,
- const char *tag, unsigned int mask,
- Blt_TableNotifyEventProc *proc,
- Blt_TableNotifierDeleteProc *deletedProc,
- ClientData clientData)
-{
- return AppendNotifier(interp, tablePtr->rowNotifiers,
- mask | TABLE_NOTIFY_ROW, (Header *)NULL, tag, proc, deletedProc,
- clientData);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_DeleteNotifier --
- *
- * Removes the event handler designated by following three pieces
- * of information:
- * 1. C function pointer,
- * 2. one-word of data passed on each call, and
- * 3. event mask indicating which events are of interest.
- *
- * Results:
- * Nothing.
- *
- * Side Effects:
- * Memory for the event handler is freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Table_DeleteNotifier(Notifier *notifierPtr)
-{
- /* Check if notifier is already being deleted. */
- if ((notifierPtr->flags & TABLE_NOTIFY_DESTROYED) == 0) {
- if (notifierPtr->deleteProc != NULL) {
- (*notifierPtr->deleteProc)(notifierPtr->clientData);
- }
- if (notifierPtr->flags & TABLE_NOTIFY_PENDING) {
- Tcl_CancelIdleCall(NotifyIdleProc, notifierPtr);
- }
- notifierPtr->flags = TABLE_NOTIFY_DESTROYED;
- Tcl_EventuallyFree(notifierPtr, (Tcl_FreeProc *)FreeNotifier);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_FindRowByLabel --
- *
- * Returns the offset of the row given its label. If the row label is
- * invalid, then -1 is returned.
- *
- * Results:
- * Returns the offset of the row or -1 if not found.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableRow
-Blt_Table_FindRowByLabel(Table *tablePtr, const char *label)
-{
- return (Blt_TableRow)FindLabel(&tablePtr->corePtr->rows, label);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_FindColumnByLabel --
- *
- * Returns the offset of the column given its label. If the column label
- * is invalid, then -1 is returned.
- *
- * Results:
- * Returns the offset of the column or -1 if not found.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TableColumn
-Blt_Table_FindColumnByLabel(Table *tablePtr, const char *label)
-{
- return (Blt_TableColumn)FindLabel(&tablePtr->corePtr->columns, label);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_SetRowLabel --
- *
- * Returns the label of the row. If the row offset is invalid or the row
- * has no label, then NULL is returned.
- *
- * Results:
- * Returns the label of the row.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_SetRowLabel(Tcl_Interp *interp, Table *tablePtr,
- Row *rowPtr, const char *label)
-{
- return SetHeaderLabel(interp, &tablePtr->corePtr->rows, (Header *)rowPtr,
- label);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_SetColumnLabel --
- *
- * Sets the label of the column. If the column offset is invalid, then
- * no label is set.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_SetColumnLabel(Tcl_Interp *interp, Table *tablePtr, Column *colPtr,
- const char *label)
-{
- return SetHeaderLabel(interp, &tablePtr->corePtr->columns, (Header *)colPtr,
- label);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_SetColumnType --
- *
- * Sets the type of the given column.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_SetColumnType(Table *tablePtr, Column *colPtr,
- Blt_TableColumnType type)
-{
- return SetType(tablePtr, colPtr, type);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_ValueExists --
- *
- * Indicates if a value exists for a given row,column offset in the
- * tuple. Note that this routine does not fire read traces.
- *
- * Results:
- * Returns 1 is a value exists, 0 otherwise.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_ValueExists(Table *tablePtr, Row *rowPtr, Column *colPtr)
-{
- return !IsEmpty(GetValue(tablePtr, rowPtr, colPtr));
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_ExtendRows --
- *
- * Adds new rows to the table. Rows are slots in an array of Rows. The
- * array grows by doubling its size, so there may be more slots than
- * needed (# rows).
- *
- * Results:
- * Returns TCL_OK is the tuple is resized and TCL_ERROR if an not enough
- * memory was available.
- *
- * Side Effects:
- * If more rows are needed, the array which holds the tuples is
- * reallocated by doubling its size.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_ExtendRows(Tcl_Interp *interp, Blt_Table table, size_t n, Row **rows)
-{
- size_t i;
- Blt_Chain chain;
- Blt_ChainLink link;
-
- if (n == 0) {
- return TCL_OK;
- }
- chain = Blt_Chain_Create();
- if (!ExtendRows(table, n, chain)) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't extend table by ",
- Blt_Ltoa(n), " rows: out of memory.", (char *)NULL);
- }
- Blt_Chain_Destroy(chain);
- return TCL_ERROR;
- }
- for (i = 0, link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link), i++) {
- Blt_TableRow row;
-
- row = Blt_Chain_GetValue(link);
- if (rows != NULL) {
- rows[i] = row;
- }
- }
- TriggerColumnNotifiers(table, TABLE_NOTIFY_ALL, TABLE_NOTIFY_ROW_CREATED);
- Blt_Chain_Destroy(chain);
- return TCL_OK;
-}
-
-int
-Blt_Table_DeleteRow(Table *tablePtr, Row *rowPtr)
-{
- DeleteHeader(&tablePtr->corePtr->rows, (Header *)rowPtr);
- UnsetRowValues(tablePtr, rowPtr);
- TriggerColumnNotifiers(tablePtr, TABLE_NOTIFY_ALL,TABLE_NOTIFY_ROW_DELETED);
- TriggerRowNotifiers(tablePtr, rowPtr, TABLE_NOTIFY_ROW_DELETED);
- Blt_Table_ClearRowTags(tablePtr, rowPtr);
- Blt_Table_ClearRowTraces(tablePtr, rowPtr);
- ClearRowNotifiers(tablePtr, rowPtr);
- tablePtr->flags |= TABLE_KEYS_DIRTY;
- return TCL_OK;
-}
-
-Blt_TableRow
-Blt_Table_CreateRow(Tcl_Interp *interp, Blt_Table table, const char *label)
-{
- Row *rowPtr;
-
- if (Blt_Table_ExtendRows(interp, table, 1, &rowPtr) != TCL_OK) {
- return NULL;
- }
- if (label != NULL) {
- if (Blt_Table_SetRowLabel(interp, table, rowPtr, label) != TCL_OK) {
- Blt_Table_DeleteRow(table, rowPtr);
- return NULL;
- }
- }
- return rowPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_MoveRows --
- *
- * Move one of more rows to a new location in the tuple.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-Blt_Table_MoveRows(Tcl_Interp *interp, Table *tablePtr, Row *srcPtr,
- Row *destPtr, size_t count)
-{
- if (srcPtr == destPtr) {
- return TCL_OK; /* Move to the same location. */
- }
- if (!MoveIndices(&tablePtr->corePtr->rows, (Header *)srcPtr,
- (Header *)destPtr, count)) {
- Tcl_AppendResult(interp, "can't allocate new map for \"",
- Blt_Table_TableName(tablePtr), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- TriggerColumnNotifiers(tablePtr, TABLE_NOTIFY_ALL, TABLE_NOTIFY_ROW_MOVED);
- return TCL_OK;
-}
-
-void
-Blt_Table_SetRowMap(Table *tablePtr, Row **map)
-{
- TriggerColumnNotifiers(tablePtr, TABLE_NOTIFY_ALL, TABLE_NOTIFY_ROW_MOVED);
- ReplaceMap(&tablePtr->corePtr->rows, (Header **)map);
-}
-
-Blt_TableRow *
-Blt_Table_SortRows(Table *tablePtr, Blt_TableSortOrder *order, size_t nColumns,
- unsigned int flags)
-{
- sortData.table = tablePtr;
- sortData.order = order;
- sortData.nColumns = nColumns;
- sortData.flags = flags;
- InitSortProcs(tablePtr, order, nColumns, flags);
- return (Blt_TableRow *)SortHeaders(&tablePtr->corePtr->rows,
- (QSortCompareProc *)CompareRows);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_DeleteColumn --
- *
- * Remove the designated column from the table. The actual space
- * contained by the column isn't freed. The map is compressed. Tcl_Objs
- * stored as column values are released. Traces and tags associated with
- * the column are removed.
- *
- * Side Effects:
- * Traces may fire when column values are unset. Also notifier events
- * may be triggered, indicating the column has been deleted.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_DeleteColumn(Table *tablePtr, Column *colPtr)
-{
- /* If the deleted column is a primary key, the generated keytables
- * are now invalid. So remove them. */
- if (colPtr->flags & TABLE_COLUMN_PRIMARY_KEY) {
- Blt_Table_UnsetKeys(tablePtr);
- }
- UnsetColumnValues(tablePtr, colPtr);
- TriggerColumnNotifiers(tablePtr, colPtr, TABLE_NOTIFY_COLUMN_DELETED);
- TriggerRowNotifiers(tablePtr, TABLE_NOTIFY_ALL,TABLE_NOTIFY_COLUMN_DELETED);
-
- Blt_Table_ClearColumnTraces(tablePtr, colPtr);
- Blt_Table_ClearColumnTags(tablePtr, colPtr);
- ClearColumnNotifiers(tablePtr, colPtr);
- DeleteHeader(&tablePtr->corePtr->columns, (Header *)colPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_ExtendColumns --
- *
- * Adds new columns to the table. Columns are slots in an array of
- * Columns. The array columns by doubling its size, so there may be more
- * slots than needed (# columns).
- *
- * Results:
- * Returns TCL_OK is the tuple is resized and TCL_ERROR if an
- * not enough memory was available.
- *
- * Side Effects:
- * If more columns are needed, the array which holds the tuples is
- * reallocated by doubling its size.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_ExtendColumns(Tcl_Interp *interp, Blt_Table table, size_t n,
- Column **cols)
-{
- size_t i;
- Blt_Chain chain;
- Blt_ChainLink link;
-
- chain = Blt_Chain_Create();
- if (!ExtendColumns(table, n, chain)) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't extend table by ",
- Blt_Ltoa(n), " columns: out of memory.", (char *)NULL);
- }
- Blt_Chain_Destroy(chain);
- return TCL_ERROR;
- }
- for (i = 0, link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link), i++) {
- Column *colPtr;
-
- colPtr = Blt_Chain_GetValue(link);
- if (cols != NULL) {
- cols[i] = colPtr;
- }
- colPtr->type = TABLE_COLUMN_TYPE_STRING;
- }
- TriggerRowNotifiers(table, TABLE_NOTIFY_ALL, TABLE_NOTIFY_COLUMN_CREATED);
- Blt_Chain_Destroy(chain);
- return TCL_OK;
-}
-
-Blt_TableColumn
-Blt_Table_CreateColumn(Tcl_Interp *interp, Blt_Table table, const char *label)
-{
- Column *colPtr;
-
- if (Blt_Table_ExtendColumns(interp, table, 1, &colPtr) != TCL_OK) {
- return NULL;
- }
- if (label != NULL) {
- if (Blt_Table_SetColumnLabel(interp, table, colPtr, label) != TCL_OK) {
- Blt_Table_DeleteColumn(table, colPtr);
- return NULL;
- }
- }
- return colPtr;
-}
-
-void
-Blt_Table_SetColumnMap(Table *tablePtr, Column **map)
-{
- TriggerRowNotifiers(tablePtr, TABLE_NOTIFY_ALL, TABLE_NOTIFY_COLUMN_MOVED);
- ReplaceMap(&tablePtr->corePtr->columns, (Header **)map);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_MoveColumns --
- *
- * Move one of more rows to a new location in the tuple.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-Blt_Table_MoveColumns(Tcl_Interp *interp, Table *tablePtr, Column *srcPtr,
- Column *destPtr, size_t count)
-{
- if (srcPtr == destPtr) {
- return TCL_OK; /* Move to the same location. */
- }
- if (!MoveIndices(&tablePtr->corePtr->columns, (Header *)srcPtr,
- (Header *)destPtr, count)) {
- Tcl_AppendResult(interp, "can't allocate new map for \"",
- Blt_Table_TableName(tablePtr), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- TriggerRowNotifiers(tablePtr, TABLE_NOTIFY_ALL, TABLE_NOTIFY_COLUMN_MOVED);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_Restore --
- *
- * Restores data to the given table based upon the dump string.
- * The dump string should have been generated by Blt_Table_Dump.
- * Two bit flags may be set.
- *
- * TABLE_RESTORE_NO_TAGS Don't restore tag information.
- * TABLE_RESTORE_OVERWRITE Look for row and columns with the
- * same label. Overwrite if necessary.
- *
- * Results:
- * A standard TCL result. If the restore was successful, TCL_OK
- * is returned. Otherwise, TCL_ERROR is returned and an error
- * message is left in the interpreter result.
- *
- * Side Effects:
- * New row and columns are created in the table and may possibly
- * generate event notifier or trace callbacks.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_Restore(Tcl_Interp *interp, Blt_Table table, char *data,
- unsigned int flags)
-{
- RestoreData restore;
- int result;
-
- restore.argc = 0;
- restore.mtime = restore.ctime = 0L;
- restore.argv = NULL;
- restore.fileName = "data string";
- restore.nLines = 0;
- restore.flags = flags;
- restore.nCols = Blt_Table_NumColumns(table);
- restore.nRows = Blt_Table_NumRows(table);
- Blt_InitHashTableWithPool(&restore.rowIndices, BLT_ONE_WORD_KEYS);
- Blt_InitHashTableWithPool(&restore.colIndices, BLT_ONE_WORD_KEYS);
- result = TCL_ERROR;
- /* Read dump information */
- for (;;) {
- char c1, c2;
-
- result = ParseDumpRecord(interp, &data, &restore);
- if (result != TCL_OK) {
- break;
- }
- if (restore.argc == 0) {
- continue;
- }
- c1 = restore.argv[0][0], c2 = restore.argv[0][1];
- if ((c1 == 'i') && (c2 == '\0')) {
- result = RestoreHeader(interp, table, &restore);
- } else if ((c1 == 'r') && (c2 == '\0')) {
- result = RestoreRow(interp, table, &restore);
- } else if ((c1 == 'c') && (c2 == '\0')) {
- result = RestoreColumn(interp, table, &restore);
- } else if ((c1 == 'd') && (c2 == '\0')) {
- result = RestoreValue(interp, table, &restore);
- } else {
- Tcl_AppendResult(interp, restore.fileName, ":",
- Blt_Ltoa(restore.nLines), ": error: unknown entry \"",
- restore.argv[0], "\"", (char *)NULL);
- result = TCL_ERROR;
- }
- Blt_Free(restore.argv);
- if (result != TCL_OK) {
- break;
- }
- }
- Blt_DeleteHashTable(&restore.rowIndices);
- Blt_DeleteHashTable(&restore.colIndices);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_FileRestore --
- *
- * Restores data to the given table based upon the dump file
- * provided. The dump file should have been generated by
- * Blt_Table_Dump or Blt_Table_FileDump.
- *
- * If the filename starts with an '@', then it is the name of an
- * already opened channel to be used. Two bit flags may be set.
- *
- * TABLE_RESTORE_NO_TAGS Don't restore tag information.
- * TABLE_RESTORE_OVERWRITE Look for row and columns with
- * the same label. Overwrite if necessary.
- *
- * Results:
- * A standard TCL result. If the restore was successful, TCL_OK
- * is returned. Otherwise, TCL_ERROR is returned and an error
- * message is left in the interpreter result.
- *
- * Side Effects:
- * Row and columns are created in the table and may possibly
- * generate trace or notifier event callbacks.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_FileRestore(Tcl_Interp *interp, Blt_Table table, const char *fileName,
- unsigned int flags)
-{
- RestoreData restore;
- Tcl_Channel channel;
- int closeChannel;
- int result;
-
- closeChannel = TRUE;
- if ((fileName[0] == '@') && (fileName[1] != '\0')) {
- int mode;
-
- channel = Tcl_GetChannel(interp, fileName+1, &mode);
- if (channel == NULL) {
- return TCL_ERROR;
- }
- if ((mode & TCL_READABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", fileName,
- "\" not opened for reading", (char *)NULL);
- return TCL_ERROR;
- }
- closeChannel = FALSE;
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "r", 0);
- if (channel == NULL) {
- return TCL_ERROR; /* Can't open dump file. */
- }
- }
- restore.argc = 0;
- restore.mtime = restore.ctime = 0L;
- restore.argv = NULL;
- restore.fileName = fileName;
- restore.nLines = 0;
- restore.flags = flags;
- restore.nCols = Blt_Table_NumColumns(table);
- restore.nRows = Blt_Table_NumRows(table);
- Blt_InitHashTableWithPool(&restore.rowIndices, BLT_ONE_WORD_KEYS);
- Blt_InitHashTableWithPool(&restore.colIndices, BLT_ONE_WORD_KEYS);
-
- /* Process dump information record by record. */
- result = TCL_ERROR;
- for (;;) {
- char c1, c2;
-
- result = ReadDumpRecord(interp, channel, &restore);
- if (result != TCL_OK) {
- break;
- }
- if (restore.argc == 0) {
- continue;
- }
- c1 = restore.argv[0][0], c2 = restore.argv[0][1];
- if ((c1 == 'i') && (c2 == '\0')) {
- result = RestoreHeader(interp, table, &restore);
- } else if ((c1 == 'r') && (c2 == '\0')) {
- result = RestoreRow(interp, table, &restore);
- } else if ((c1 == 'c') && (c2 == '\0')) {
- result = RestoreColumn(interp, table, &restore);
- } else if ((c1 == 'd') && (c2 == '\0')) {
- result = RestoreValue(interp, table, &restore);
- } else {
- Tcl_AppendResult(interp, fileName, ":", Blt_Ltoa(restore.nLines),
- ": error: unknown entry \"", restore.argv[0], "\"",
- (char *)NULL);
- result = TCL_ERROR;
- }
- Blt_Free(restore.argv);
- if (result != TCL_OK) {
- break;
- }
- }
- Blt_DeleteHashTable(&restore.rowIndices);
- Blt_DeleteHashTable(&restore.colIndices);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static void
-FreePrimaryKeys(Table *tablePtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(tablePtr->primaryKeys); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Column *columnPtr;
-
- columnPtr = Blt_Chain_GetValue(link);
- columnPtr->flags &= ~TABLE_COLUMN_PRIMARY_KEY;
- }
- Blt_Chain_Destroy(tablePtr->primaryKeys);
- tablePtr->primaryKeys = NULL;
-}
-
-static void
-FreeKeyTables(Table *tablePtr)
-{
- long i;
-
- for (i = 0; i < tablePtr->nKeys; i++) {
- Blt_DeleteHashTable(tablePtr->keyTables + i);
- }
- if (tablePtr->keyTables != NULL) {
- Blt_Free(tablePtr->keyTables);
- }
- if (tablePtr->masterKey != NULL) {
- Blt_Free(tablePtr->masterKey);
- Blt_DeleteHashTable(&tablePtr->masterKeyTable);
- }
- tablePtr->keyTables = NULL;
- tablePtr->nKeys = 0;
- tablePtr->masterKey = NULL;
-}
-
-void
-Blt_Table_UnsetKeys(Table *tablePtr)
-{
- FreeKeyTables(tablePtr);
- FreePrimaryKeys(tablePtr);
- tablePtr->flags &= ~(TABLE_KEYS_DIRTY | TABLE_KEYS_UNIQUE);
-}
-
-Blt_Chain
-Blt_Table_GetKeys(Table *tablePtr)
-{
- return tablePtr->primaryKeys;
-}
-
-int
-Blt_Table_SetKeys(Table *tablePtr, Blt_Chain primaryKeys, int unique)
-{
- Blt_ChainLink link;
-
- if (tablePtr->primaryKeys != NULL) {
- FreePrimaryKeys(tablePtr);
- }
- tablePtr->primaryKeys = primaryKeys;
-
- /* Mark the designated columns as primary keys. This flag is used to
- * check if a primary column is deleted, it's rows are added or changed,
- * or it's values set or unset. The generated keytables are invalid and
- * need to be regenerated. */
- for (link = Blt_Chain_FirstLink(tablePtr->primaryKeys); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Column *columnPtr;
-
- columnPtr = Blt_Chain_GetValue(link);
- columnPtr->flags |= TABLE_COLUMN_PRIMARY_KEY;
- }
- tablePtr->flags |= TABLE_KEYS_DIRTY;
- if (unique) {
- tablePtr->flags |= TABLE_KEYS_UNIQUE;
- }
- return TCL_OK;
-}
-
-static int
-MakeKeyTables(Tcl_Interp *interp, Table *tablePtr)
-{
- size_t i;
- size_t masterKeySize;
- size_t nKeys;
-
- FreeKeyTables(tablePtr);
- tablePtr->flags &= ~TABLE_KEYS_DIRTY;
-
- nKeys = Blt_Chain_GetLength(tablePtr->primaryKeys);
-
- /* Create a hashtable for each key. */
- tablePtr->keyTables = Blt_Malloc(sizeof(Blt_HashTable) * nKeys);
- if (tablePtr->keyTables == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't allocated keytables for ",
- Blt_Itoa(nKeys), " keys.", (char *)NULL);
- }
- return TCL_ERROR;
- }
- tablePtr->nKeys = nKeys;
- for (i = 0; i < nKeys; i++) {
- Blt_InitHashTable(tablePtr->keyTables + i, BLT_STRING_KEYS);
- }
- masterKeySize = sizeof(Blt_TableRow) * nKeys;
- tablePtr->masterKey = Blt_AssertMalloc(masterKeySize);
- Blt_InitHashTable(&tablePtr->masterKeyTable, masterKeySize / sizeof(int));
-
- /* For each row, create hash entries the the individual key columns, but
- * also for the combined keys for the row. The hash of the combined keys
- * must be unique. */
- for (i = 1; i <= Blt_Table_NumRows(tablePtr); i++) {
- Blt_ChainLink link;
- Row *rowPtr;
- size_t j;
-
- rowPtr = Blt_Table_Row(tablePtr, i);
- for (j = 0, link = Blt_Chain_FirstLink(tablePtr->primaryKeys);
- link != NULL; link = Blt_Chain_NextLink(link), j++) {
- Column *colPtr;
- Blt_HashEntry *hPtr;
- int isNew;
- Value *valuePtr;
-
- colPtr = Blt_Chain_GetValue(link);
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- if (IsEmpty(valuePtr)) {
- break; /* Skip this row since one of the key values
- * is empty. */
- }
- hPtr = Blt_CreateHashEntry(tablePtr->keyTables + j,
- valuePtr->string, &isNew);
- if (isNew) {
- Blt_SetHashValue(hPtr, rowPtr);
- }
- tablePtr->masterKey[j] = Blt_GetHashValue(hPtr);
- }
- if (j == nKeys) {
- Blt_HashEntry *hPtr;
- int isNew;
-
- /* If we created all the hashkeys necessary for this row, then
- * generate an entry for the row in the master key table. */
- hPtr = Blt_CreateHashEntry(&tablePtr->masterKeyTable,
- (char *)tablePtr->masterKey, &isNew);
- if (isNew) {
- Blt_SetHashValue(hPtr, rowPtr);
- } else if (tablePtr->flags & TABLE_KEYS_UNIQUE) {
- Blt_TableRow dupRow;
-
- dupRow = Blt_GetHashValue(hPtr);
- if (interp != NULL) {
-
- dupRow = Blt_GetHashValue(hPtr);
- Tcl_AppendResult(interp, "primary keys are not unique:",
- "rows \"", Blt_Table_RowLabel(dupRow), "\" and \"",
- Blt_Table_RowLabel(rowPtr),
- "\" have the same keys.", (char *)NULL);
- }
- Blt_Table_UnsetKeys(tablePtr);
- return TCL_ERROR; /* Bail out. Keys aren't unique. */
- }
- }
- }
- tablePtr->flags &= ~TABLE_KEYS_UNIQUE;
- return TCL_OK;
-}
-
-int
-Blt_Table_KeyLookup(Tcl_Interp *interp, Table *tablePtr, int objc,
- Tcl_Obj *const *objv, Row **rowPtrPtr)
-{
- long i;
- Blt_HashEntry *hPtr;
-
- *rowPtrPtr = NULL;
- if (objc != Blt_Chain_GetLength(tablePtr->primaryKeys)) {
- if (interp != NULL) {
- Blt_ChainLink link;
-
- Tcl_AppendResult(interp, "wrong # of values: should be ",
- Blt_Itoa(tablePtr->nKeys), " value(s) of ", (char *)NULL);
- for (link = Blt_Chain_FirstLink(tablePtr->primaryKeys);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Blt_TableColumn col;
-
- col = Blt_Chain_GetValue(link);
- Tcl_AppendResult(interp, Blt_Table_ColumnLabel(col), " ",
- (char *)NULL);
- }
- }
- return TCL_ERROR; /* Bad number of keys supplied. */
- }
- if (tablePtr->primaryKeys == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "no primary keys designated",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- if ((tablePtr->flags & TABLE_KEYS_DIRTY) &&
- (MakeKeyTables(interp, tablePtr) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (tablePtr->nKeys == 0) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "failed to generate key tables",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- for (i = 0; i < tablePtr->nKeys; i++) {
- const char *string;
-
- string = Tcl_GetString(objv[i]);
- hPtr = Blt_FindHashEntry(tablePtr->keyTables + i, string);
- if (hPtr == NULL) {
- return TCL_OK; /* Can't find one of the keys, so
- * the whole search fails. */
- }
- tablePtr->masterKey[i] = Blt_GetHashValue(hPtr);
- }
- hPtr = Blt_FindHashEntry(&tablePtr->masterKeyTable,
- (char *)tablePtr->masterKey);
- if (hPtr == NULL) {
- fprintf(stderr, "can't find master key\n");
- return TCL_OK;
- }
- *rowPtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_SetLong --
- *
- * Sets the value of the selected row, column location in the table. The
- * row, column location must be within the actual table limits.
- *
- * Results:
- * Returns the objPtr representing the old value. If no previous value
- * was present, the NULL is returned.
- *
- * Side Effects:
- * New tuples may be allocated created.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_SetLong(Table *tablePtr, Row *rowPtr, Column *colPtr, long value)
-{
- Value *valuePtr;
- char string[200];
-
- if (colPtr->type != TABLE_COLUMN_TYPE_LONG) {
- Tcl_AppendResult(tablePtr->interp, "wrong column type \"",
- Blt_Table_NameOfType(colPtr->type), "\": should be \"int\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- FreeValue(valuePtr);
- valuePtr->datum.l = value;
- sprintf(string, "%ld", value);
- valuePtr->string = Blt_AssertStrdup(string);
-
- /* Indicate the keytables need to be regenerated. */
- if (colPtr->flags & TABLE_COLUMN_PRIMARY_KEY) {
- tablePtr->flags |= TABLE_KEYS_DIRTY;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_SetString --
- *
- * Sets the value of the selected row, column location in the table. The
- * row, column location must be within the actual table limits.
- *
- * Results:
- * Returns the objPtr representing the old value. If no previous value
- * was present, the NULL is returned.
- *
- * Side Effects:
- * New tuples may be allocated created.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_SetString(Table *tablePtr, Row *rowPtr, Column *colPtr,
- const char *string, int length)
-{
- Value *valuePtr;
-
- if (colPtr->type != TABLE_COLUMN_TYPE_STRING) {
- return TCL_ERROR;
- }
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- FreeValue(valuePtr);
- if (SetValueFromString(tablePtr->interp, colPtr->type, string, length,
- valuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Indicate the keytables need to be regenerated. */
- if (colPtr->flags & TABLE_COLUMN_PRIMARY_KEY) {
- tablePtr->flags |= TABLE_KEYS_DIRTY;
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_AppendString --
- *
- * Sets the value of the selected row, column location in the table. The
- * row, column location must be within the actual table limits.
- *
- * Results:
- * Returns the objPtr representing the old value. If no previous value
- * was present, the NULL is returned.
- *
- * Side Effects:
- * New tuples may be allocated created.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Table_AppendString(Tcl_Interp *interp, Table *tablePtr, Row *rowPtr,
- Column *colPtr, const char *s, int length)
-{
- Value *valuePtr;
- char *string;
- long l;
- double d;
-
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- if (IsEmpty(valuePtr)) {
- string = Blt_AssertStrdup(s);
- } else {
- int oldLen;
-
- oldLen = strlen(valuePtr->string);
- string = Blt_AssertMalloc(oldLen + length + 1);
- strcpy(string, valuePtr->string);
- strncpy(string + oldLen, s, length);
- string[oldLen + length] = '\0';
- }
- switch (colPtr->type) {
- case TABLE_COLUMN_TYPE_DOUBLE: /* double */
- if (Blt_GetDoubleFromString(interp, string, &d) != TCL_OK) {
- Blt_Free(string);
- return TCL_ERROR;
- }
- valuePtr->datum.d = d;
- break;
- case TABLE_COLUMN_TYPE_LONG: /* long */
- case TABLE_COLUMN_TYPE_INT: /* int */
- if (Tcl_GetLong(interp, string, &l) != TCL_OK) {
- Blt_Free(string);
- return TCL_ERROR;
- }
- valuePtr->datum.l = l;
- break;
- default:
- break;
- }
- FreeValue(valuePtr);
- valuePtr->string = string;
-
- /* Indicate the keytables need to be regenerated. */
- if (colPtr->flags & TABLE_COLUMN_PRIMARY_KEY) {
- tablePtr->flags |= TABLE_KEYS_DIRTY;
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_GetString --
- *
- * Sets the value of the selected row, column location in the table. The
- * row, column location must be within the actual table limits.
- *
- * Results:
- * Returns the objPtr representing the old value. If no previous value
- * was present, the NULL is returned.
- *
- * Side Effects:
- * New tuples may be allocated created.
- *
- *---------------------------------------------------------------------------
- */
-const char *
-Blt_Table_GetString(Table *tablePtr, Row *rowPtr, Column *colPtr)
-{
- Value *valuePtr;
-
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- if (IsEmpty(valuePtr)) {
- return NULL;
- }
- return valuePtr->string;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_GetDouble --
- *
- * Gets the double value of the selected row, column location in the
- * table. The row, column location must be within the actual table
- * limits.
- *
- * Results:
- * Returns the objPtr representing the old value. If no previous value
- * was present, the NULL is returned.
- *
- * Side Effects:
- * New tuples may be allocated created.
- *
- *---------------------------------------------------------------------------
- */
-double
-Blt_Table_GetDouble(Table *tablePtr, Row *rowPtr, Column *colPtr)
-{
- Value *valuePtr;
- double d;
-
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- if (IsEmpty(valuePtr)) {
- return Blt_NaN();
- }
- if (colPtr->type == TABLE_COLUMN_TYPE_DOUBLE) {
- return valuePtr->datum.d;
- }
- if (Blt_GetDoubleFromString(tablePtr->interp, valuePtr->string, &d)
- != TCL_OK) {
- return TCL_ERROR;
- }
- return d;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_GetLong --
- *
- * Gets the double value of the selected row, column location in the
- * table. The row, column location must be within the actual table
- * limits.
- *
- * Results:
- * Returns a long value. If the value is empty, the default value
- * is returned.
- *
- * Side Effects:
- * New tuples may be allocated created.
- *
- *---------------------------------------------------------------------------
- */
-long
-Blt_Table_GetLong(Table *tablePtr, Row *rowPtr, Column *colPtr, long defVal)
-{
- Value *valuePtr;
- long l;
-
- valuePtr = GetValue(tablePtr, rowPtr, colPtr);
- if (IsEmpty(valuePtr)) {
- return defVal;
- }
- if (colPtr->type == TABLE_COLUMN_TYPE_LONG) {
- return valuePtr->datum.l;
- }
- if (Tcl_GetLong(tablePtr->interp, valuePtr->string, &l) != TCL_OK) {
- return TCL_ERROR;
- }
- return l;
-}
diff --git a/blt3.0.1/src/bltDataTable.h b/blt3.0.1/src/bltDataTable.h
deleted file mode 100644
index 497ed67..0000000
--- a/blt3.0.1/src/bltDataTable.h
+++ /dev/null
@@ -1,729 +0,0 @@
-
-/*
- * bltDataTable.h --
- *
- * Copyright 1998-2004 George A. Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_DATATABLE_H
-#define _BLT_DATATABLE_H
-
-#include <bltChain.h>
-#include <bltHash.h>
-
-typedef struct _Blt_TableTags *Blt_TableTags;
-
-typedef enum {
- TABLE_COLUMN_TYPE_UNKNOWN=-1,
- TABLE_COLUMN_TYPE_STRING,
- TABLE_COLUMN_TYPE_INT,
- TABLE_COLUMN_TYPE_DOUBLE,
- TABLE_COLUMN_TYPE_LONG,
-} Blt_TableColumnType;
-
-
-typedef struct _Blt_TableValue {
- union {
- long l;
- double d;
- Tcl_WideInt w;
- } datum; /* Internal representation of data:
- * used to speed comparisons, sorting,
- * etc. */
- char *string; /* String representation of value. If
- * NULL, indicates empty value. */
-} *Blt_TableValue;
-
-typedef struct _Blt_TableHeader {
- const char *label; /* Label of row or column. */
- long index; /* Reverse lookup offset-to-index. */
- long offset;
- unsigned int flags;
-} *Blt_TableHeader;
-
-typedef struct _Blt_TableRow {
- const char *label; /* Label of row or column. */
- long index; /* Reverse lookup offset-to-index. */
- long offset;
- unsigned int flags;
-} *Blt_TableRow;
-
-typedef struct _Blt_TableColumn {
- const char *label; /* Label of row or column. */
- long index; /* Reverse lookup offset-to-index. */
- long offset;
- unsigned short flags;
- Blt_TableColumnType type;
-} *Blt_TableColumn;
-
-typedef struct {
- const char *name;
- long headerSize;
-} Blt_TableRowColumnClass;
-
-/*
- * Blt_TableRowColumn --
- *
- * Structure representing a row or column in the table.
- */
-typedef struct _Blt_TableRowColumn {
- Blt_TableRowColumnClass *classPtr;
- Blt_Pool headerPool;
- long nAllocated; /* Length of allocated array
- * below. May exceed the number of row
- * or column headers used. */
- long nUsed;
- Blt_TableHeader *map; /* Array of row or column headers. */
- Blt_Chain freeList; /* Tracks free row or column
- * headers. */
- Blt_HashTable labelTable; /* Hash table of labels. Maps labels
- * to table offsets. */
- long nextId; /* Used to generate default labels. */
-} Blt_TableRowColumn;
-
-/*
- * Blt_TableCore --
- *
- * Structure representing a table object.
- *
- * The table object is an array of column vectors. Each vector is an
- * array of Blt_TableValue's, representing the data for the column.
- * Empty row entries are designated by 0 length values. Column vectors are
- * allocated when needed. Every column in the table has the same length.
- *
- * Rows and columns are indexed by a map of pointers to headers. This
- * map represents the order of the rows or columns. A table object can
- * be shared by several clients. When a client wants to use a table
- * object, it is given a token that represents the table. The object
- * tracks its clients by its token. When all clients have released their
- * tokens, the tuple object is automatically destroyed.
- */
-typedef struct _Blt_TableCore {
- Blt_TableRowColumn rows, columns;
- Blt_TableValue *data; /* Array of column vector pointers */
- unsigned int flags; /* Internal flags. See definitions
- * below. */
- Blt_Chain clients; /* List of clients using this table */
- unsigned long mtime, ctime;
- unsigned int notifyFlags; /* Notification flags. See definitions
- * below. */
- int notifyHold;
-} Blt_TableCore;
-
-/*
- * Blt_Table --
- *
- * A client is uniquely identified by a combination of its name and the
- * originating namespace. Two table objects in the same interpreter can
- * have similar names but must reside in different namespaces.
- *
- * Two or more clients can share the same table object. Each client
- * structure which acts as a ticket for the underlying table object.
- * Clients can designate notifier routines that are automatically invoked
- * by the table object whenever the table is changed is specific ways by
- * other clients.
- */
-typedef struct _Blt_Table {
- unsigned int magic; /* Magic value indicating whether a
- * generic pointer is really a
- * datatable token or not. */
- const char *name; /* Fully namespace-qualified name of
- * the client. */
- Blt_TableCore *corePtr; /* Pointer to the structure containing
- * the master information about the
- * table used by the client. If NULL,
- * this indicates that the table has
- * been destroyed (but as of yet, this
- * client hasn't recognized it). */
- Tcl_Interp *interp;
- Blt_HashTable *tablePtr; /* Interpreter-specific global hash
- * table of all datatable clients.
- * Each entry is a chain of clients
- * that are sharing the same core
- * datatable. */
- Blt_HashEntry *hPtr; /* This client's entry in the above
- * hash table. This is a list of
- * clients that * all using the core
- * datatable. */
- Blt_ChainLink link2; /* This client's entry in the list
- * found in the above list (hashtable
- * entry). */
- Blt_ChainLink link; /* Pointer into the server's chain of
- * clients. */
-
- Blt_HashTable *rowTags;
- Blt_HashTable *columnTags;
-
- Blt_Chain traces; /* Chain of traces. */
- Blt_Chain columnNotifiers; /* Chain of event handlers. */
- Blt_Chain rowNotifiers; /* Chain of event handlers. */
- Blt_TableTags tags;
-
- Blt_HashTable *keyTables; /* Array of primary keys. */
- long nKeys; /* Length of the above array. */
-
- Blt_TableRow *masterKey; /* Master key entry. */
- Blt_HashTable masterKeyTable;
- Blt_Chain primaryKeys;
- unsigned int flags;
-} *Blt_Table;
-
-BLT_EXTERN void Blt_Table_ReleaseTags(Blt_Table table);
-
-BLT_EXTERN int Blt_Table_TableExists(Tcl_Interp *interp, const char *name);
-BLT_EXTERN int Blt_Table_CreateTable(Tcl_Interp *interp, const char *name,
- Blt_Table *tablePtr);
-BLT_EXTERN int Blt_Table_Open(Tcl_Interp *interp, const char *name,
- Blt_Table *tablePtr);
-BLT_EXTERN void Blt_Table_Close(Blt_Table table);
-
-BLT_EXTERN int Blt_Table_SameTableObject(Blt_Table table1, Blt_Table table2);
-
-BLT_EXTERN const char *Blt_Table_Name(Blt_Table table);
-
-BLT_EXTERN Blt_TableRow Blt_Table_FindRowByLabel(Blt_Table table,
- const char *label);
-BLT_EXTERN Blt_TableColumn Blt_Table_FindColumnByLabel(Blt_Table table,
- const char *label);
-BLT_EXTERN Blt_TableRow Blt_Table_FindRowByIndex(Blt_Table table, long index);
-BLT_EXTERN Blt_TableColumn Blt_Table_FindColumnByIndex(Blt_Table table,
- long index);
-
-BLT_EXTERN int Blt_Table_SetRowLabel(Tcl_Interp *interp, Blt_Table table,
- Blt_TableRow row, const char *label);
-BLT_EXTERN int Blt_Table_SetColumnLabel(Tcl_Interp *interp, Blt_Table table,
- Blt_TableColumn column, const char *label);
-
-BLT_EXTERN Blt_TableColumnType Blt_Table_ColumnType(Blt_TableColumn column);
-BLT_EXTERN Blt_TableColumnType Blt_Table_GetColumnType(const char *typeName);
-BLT_EXTERN int Blt_Table_SetColumnType(Blt_Table table, Blt_TableColumn column,
- Blt_TableColumnType type);
-BLT_EXTERN const char *Blt_Table_NameOfType(Blt_TableColumnType type);
-
-BLT_EXTERN int Blt_Table_SetColumnTag(Tcl_Interp *interp, Blt_Table table,
- Blt_TableColumn column, const char *tagName);
-BLT_EXTERN int Blt_Table_SetRowTag(Tcl_Interp *interp, Blt_Table table,
- Blt_TableRow row, const char *tagName);
-
-BLT_EXTERN Blt_TableRow Blt_Table_CreateRow(Tcl_Interp *interp, Blt_Table table,
- const char *label);
-BLT_EXTERN Blt_TableColumn Blt_Table_CreateColumn(Tcl_Interp *interp,
- Blt_Table table, const char *label);
-
-BLT_EXTERN int Blt_Table_ExtendRows(Tcl_Interp *interp, Blt_Table table,
- size_t n, Blt_TableRow *rows);
-BLT_EXTERN int Blt_Table_ExtendColumns(Tcl_Interp *interp, Blt_Table table,
- size_t n, Blt_TableColumn *columms);
-BLT_EXTERN int Blt_Table_DeleteRow(Blt_Table table, Blt_TableRow row);
-BLT_EXTERN int Blt_Table_DeleteColumn(Blt_Table table, Blt_TableColumn column);
-BLT_EXTERN int Blt_Table_MoveRows(Tcl_Interp *interp, Blt_Table table,
- Blt_TableRow from, Blt_TableRow to, size_t n);
-BLT_EXTERN int Blt_Table_MoveColumns(Tcl_Interp *interp, Blt_Table table,
- Blt_TableColumn from, Blt_TableColumn to, size_t n);
-
-BLT_EXTERN Tcl_Obj *Blt_Table_GetObj(Blt_Table table, Blt_TableRow row,
- Blt_TableColumn column);
-BLT_EXTERN int Blt_Table_SetObj(Blt_Table table, Blt_TableRow row,
- Blt_TableColumn column, Tcl_Obj *objPtr);
-
-BLT_EXTERN const char *Blt_Table_GetString(Blt_Table table, Blt_TableRow row,
- Blt_TableColumn column);
-BLT_EXTERN int Blt_Table_SetString(Blt_Table table, Blt_TableRow row,
- Blt_TableColumn column, const char *string, int length);
-BLT_EXTERN int Blt_Table_AppendString(Tcl_Interp *interp, Blt_Table table,
- Blt_TableRow row, Blt_TableColumn column, const char *string,
- int length);
-
-BLT_EXTERN double Blt_Table_GetDouble(Blt_Table table, Blt_TableRow row,
- Blt_TableColumn column);
-BLT_EXTERN int Blt_Table_SetDouble(Blt_Table table, Blt_TableRow row,
- Blt_TableColumn column, double value);
-BLT_EXTERN long Blt_Table_GetLong(Blt_Table table, Blt_TableRow row,
- Blt_TableColumn column, long defValue);
-BLT_EXTERN int Blt_Table_SetLong(Blt_Table table, Blt_TableRow row,
- Blt_TableColumn column, long value);
-
-BLT_EXTERN Blt_TableValue Blt_Table_GetValue(Blt_Table table, Blt_TableRow row,
- Blt_TableColumn column);
-BLT_EXTERN int Blt_Table_SetValue(Blt_Table table, Blt_TableRow row,
- Blt_TableColumn column, Blt_TableValue value);
-BLT_EXTERN int Blt_Table_UnsetValue(Blt_Table table, Blt_TableRow row,
- Blt_TableColumn column);
-BLT_EXTERN int Blt_Table_ValueExists(Blt_Table table, Blt_TableRow row,
- Blt_TableColumn column);
-
-BLT_EXTERN Blt_HashTable *Blt_Table_FindRowTagTable(Blt_Table table,
- const char *tagName);
-BLT_EXTERN Blt_HashTable *Blt_Table_FindColumnTagTable(Blt_Table table,
- const char *tagName);
-BLT_EXTERN Blt_Chain Blt_Table_RowTags(Blt_Table table, Blt_TableRow row);
-BLT_EXTERN Blt_Chain Blt_Table_ColumnTags(Blt_Table table,
- Blt_TableColumn column);
-
-BLT_EXTERN Blt_Chain Blt_Table_Traces(Blt_Table table);
-BLT_EXTERN int Blt_Table_TagsAreShared(Blt_Table table);
-
-BLT_EXTERN int Blt_Table_HasRowTag(Blt_Table table, Blt_TableRow row,
- const char *tagName);
-BLT_EXTERN int Blt_Table_HasColumnTag(Blt_Table table, Blt_TableColumn column,
- const char *tagName);
-BLT_EXTERN void Blt_Table_AddColumnTag(Blt_Table table, Blt_TableColumn column,
- const char *tagName);
-BLT_EXTERN void Blt_Table_AddRowTag(Blt_Table table, Blt_TableRow row,
- const char *tagName);
-BLT_EXTERN int Blt_Table_ForgetRowTag(Tcl_Interp *interp, Blt_Table table,
- const char *tagName);
-BLT_EXTERN int Blt_Table_ForgetColumnTag(Tcl_Interp *interp, Blt_Table table,
- const char *tagName);
-BLT_EXTERN int Blt_Table_UnsetRowTag(Tcl_Interp *interp, Blt_Table table,
- Blt_TableRow row, const char *tagName);
-BLT_EXTERN int Blt_Table_UnsetColumnTag(Tcl_Interp *interp, Blt_Table table,
- Blt_TableColumn column, const char *tagName);
-BLT_EXTERN Blt_HashEntry *Blt_Table_FirstRowTag(Blt_Table table,
- Blt_HashSearch *cursorPtr);
-BLT_EXTERN Blt_HashEntry *Blt_Table_FirstColumnTag(Blt_Table table,
- Blt_HashSearch *cursorPtr);
-
-BLT_EXTERN Blt_TableColumn Blt_Table_FirstColumn(Blt_Table table);
-BLT_EXTERN Blt_TableColumn Blt_Table_NextColumn(Blt_Table table,
- Blt_TableColumn column);
-BLT_EXTERN Blt_TableRow Blt_Table_FirstRow(Blt_Table table);
-BLT_EXTERN Blt_TableRow Blt_Table_NextRow(Blt_Table table, Blt_TableRow row);
-
-typedef enum {
- TABLE_SPEC_UNKNOWN,
- TABLE_SPEC_INDEX,
- TABLE_SPEC_RANGE,
- TABLE_SPEC_LABEL,
- TABLE_SPEC_TAG,
-} Blt_TableRowColumnSpec;
-
-BLT_EXTERN Blt_TableRowColumnSpec Blt_Table_RowSpec(Blt_Table table,
- Tcl_Obj *objPtr, const char **stringPtr);
-BLT_EXTERN Blt_TableRowColumnSpec Blt_Table_ColumnSpec(Blt_Table table,
- Tcl_Obj *objPtr, const char **stringPtr);
-
-/*
- * Blt_TableIterator --
- *
- * Structure representing a trace used by a client of the table.
- *
- * Table rows and columns may be tagged with strings. A row may
- * have many tags. The same tag may be used for many rows. Tags
- * are used and stored by clients of a table. Tags can also be
- * shared between clients of the same table.
- *
- * Both rowTable and columnTable are hash tables keyed by the
- * physical row or column location in the table respectively.
- * This is not the same as the client's view (the order of rows
- * or columns as seen by the client). This is so that clients
- * (which may have different views) can share tags without
- * sharing the same view.
- */
-
-
-typedef enum {
- TABLE_ITERATOR_INDEX,
- TABLE_ITERATOR_LABEL,
- TABLE_ITERATOR_TAG,
- TABLE_ITERATOR_RANGE,
- TABLE_ITERATOR_ALL,
- TABLE_ITERATOR_CHAIN
-} Blt_TableIteratorType;
-
-typedef struct _Blt_TableIterator {
- Blt_Table table; /* Table that we're iterating over. */
-
- Blt_TableIteratorType type; /* Type of iteration:
- * TABLE_ITERATOR_TAG by row or column tag.
- * TABLE_ITERATOR_ALL
- * by every row or column.
- * TABLE_ITERATOR_INDEX single item: either
- * label or index.
- * TABLE_ITERATOR_RANGE over a consecutive
- * range of indices.
- * TABLE_ITERATOR_CHAIN over an expanded,
- * non-overlapping
- * list of tags, labels,
- * and indices.
- */
-
- const char *tagName; /* Used by notification routines to
- * determine if a tag is being
- * used. */
- long start; /* Starting index. Starting point of
- * search, saved if iterator is
- * reused. Used for TABLE_ITERATOR_ALL and
- * TABLE_ITERATOR_INDEX searches. */
- long end; /* Ending index (inclusive). */
-
- long next; /* Next index. */
-
- /* For tag-based searches. */
- Blt_HashTable *tablePtr; /* Pointer to tag hash table. */
- Blt_HashSearch cursor; /* Iterator for tag hash table. */
-
- /* For chain-based searches (multiple tags). */
- Blt_Chain chain; /* This chain, unlike the above hash
- * table must be freed after its
- * use. */
- Blt_ChainLink link; /* Search iterator for chain. */
-} Blt_TableIterator;
-
-BLT_EXTERN int Blt_Table_IterateRows(Tcl_Interp *interp, Blt_Table table,
- Tcl_Obj *objPtr, Blt_TableIterator *iter);
-
-BLT_EXTERN int Blt_Table_IterateColumns(Tcl_Interp *interp, Blt_Table table,
- Tcl_Obj *objPtr, Blt_TableIterator *iter);
-
-BLT_EXTERN int Blt_Table_IterateRowsObjv(Tcl_Interp *interp, Blt_Table table,
- int objc, Tcl_Obj *const *objv, Blt_TableIterator *iterPtr);
-
-BLT_EXTERN int Blt_Table_IterateColumnsObjv(Tcl_Interp *interp, Blt_Table table,
- int objc, Tcl_Obj *const *objv, Blt_TableIterator *iterPtr);
-
-BLT_EXTERN void Blt_Table_FreeIteratorObjv(Blt_TableIterator *iterPtr);
-
-BLT_EXTERN void Blt_Table_IterateAllRows(Blt_Table table,
- Blt_TableIterator *iterPtr);
-
-BLT_EXTERN void Blt_Table_IterateAllColumns(Blt_Table table,
- Blt_TableIterator *iterPtr);
-
-BLT_EXTERN Blt_TableRow Blt_Table_FirstTaggedRow(Blt_TableIterator *iter);
-
-BLT_EXTERN Blt_TableColumn Blt_Table_FirstTaggedColumn(Blt_TableIterator *iter);
-
-BLT_EXTERN Blt_TableRow Blt_Table_NextTaggedRow(Blt_TableIterator *iter);
-
-BLT_EXTERN Blt_TableColumn Blt_Table_NextTaggedColumn(Blt_TableIterator *iter);
-
-BLT_EXTERN Blt_TableRow Blt_Table_FindRow(Tcl_Interp *interp, Blt_Table table,
- Tcl_Obj *objPtr);
-
-BLT_EXTERN Blt_TableColumn Blt_Table_FindColumn(Tcl_Interp *interp,
- Blt_Table table, Tcl_Obj *objPtr);
-
-BLT_EXTERN int Blt_Table_ListRows(Tcl_Interp *interp, Blt_Table table,
- int objc, Tcl_Obj *const *objv, Blt_Chain chain);
-
-BLT_EXTERN int Blt_Table_ListColumns(Tcl_Interp *interp, Blt_Table table,
- int objc, Tcl_Obj *const *objv, Blt_Chain chain);
-
-/*
- * Blt_TableTraceEvent --
- *
- * Structure representing an event matching a trace set by a client of
- * the table.
- *
- * Table rows and columns may be tagged with strings. A row may have
- * many tags. The same tag may be used for many rows. Tags are used and
- * stored by clients of a table. Tags can also be shared between clients
- * of the same table.
- *
- * Both rowTable and columnTable are hash tables keyed by the physical
- * row or column location in the table respectively. This is not the
- * same as the client's view (the order of rows or columns as seen by the
- * client). This is so that clients (which may have different views) can
- * share tags without sharing the same view.
- */
-typedef struct {
- Tcl_Interp *interp; /* Interpreter to report to */
- Blt_Table table; /* Table object client that received
- * the event. */
- Blt_TableRow row; /* Matching row and column. */
- Blt_TableColumn column;
- unsigned int mask; /* Type of event received. */
-} Blt_TableTraceEvent;
-
-typedef int (Blt_TableTraceProc)(ClientData clientData,
- Blt_TableTraceEvent *eventPtr);
-
-typedef void (Blt_TableTraceDeleteProc)(ClientData clientData);
-
-/*
- * Blt_TableTrace --
- *
- * Structure representing a trace used by a client of the table.
- *
- * Table rows and columns may be tagged with strings. A row may have
- * many tags. The same tag may be used for many rows. Tags are used and
- * stored by clients of a table. Tags can also be shared between clients
- * of the same table.
- *
- * Both rowTable and columnTable are hash tables keyed by the physical
- * row or column location in the table respectively. This is not the
- * same as the client's view (the order of rows or columns as seen by the
- * client). This is so that clients (which may have different views) can
- * share tags without sharing the same view.
- */
-typedef struct _Blt_TableTrace {
- unsigned int flags;
- const char *rowTag, *colTag;
- Blt_TableRow row;
- Blt_TableColumn column;
- Blt_TableTraceProc *proc;
- Blt_TableTraceDeleteProc *deleteProc;
- ClientData clientData;
- Blt_Chain chain;
- Blt_ChainLink link;
-} *Blt_TableTrace;
-
-
-#define TABLE_TRACE_READS (1<<0)
-#define TABLE_TRACE_CREATES (1<<1)
-#define TABLE_TRACE_WRITES (1<<2)
-#define TABLE_TRACE_UNSETS (1<<3)
-#define TABLE_TRACE_ALL (TABLE_TRACE_UNSETS | TABLE_TRACE_WRITES | \
- TABLE_TRACE_READS | TABLE_TRACE_CREATES)
-#define TABLE_TRACE_MASK (TRACE_ALL)
-
-#define TABLE_TRACE_FOREIGN_ONLY (1<<8)
-#define TABLE_TRACE_ACTIVE (1<<9)
-#define TABLE_TRACE_SELF (1<<10)
-#define TABLE_TRACE_DESTROYED (1<<11)
-
-BLT_EXTERN void Blt_Table_ClearRowTags(Blt_Table table, Blt_TableRow row);
-
-BLT_EXTERN void Blt_Table_ClearColumnTags(Blt_Table table,
- Blt_TableColumn column);
-
-BLT_EXTERN void Blt_Table_ClearRowTraces(Blt_Table table, Blt_TableRow row);
-
-BLT_EXTERN void Blt_Table_ClearColumnTraces(Blt_Table table,
- Blt_TableColumn column);
-
-BLT_EXTERN Blt_TableTrace Blt_Table_CreateTrace(Blt_Table table,
- Blt_TableRow row, Blt_TableColumn column, const char *rowTag,
- const char *columnTag, unsigned int mask, Blt_TableTraceProc *proc,
- Blt_TableTraceDeleteProc *deleteProc, ClientData clientData);
-
-BLT_EXTERN Blt_TableTrace Blt_Table_CreateColumnTrace(Blt_Table table,
- Blt_TableColumn column, unsigned int mask, Blt_TableTraceProc *proc,
- Blt_TableTraceDeleteProc *deleteProc, ClientData clientData);
-
-BLT_EXTERN Blt_TableTrace Blt_Table_CreateColumnTagTrace(Blt_Table table,
- const char *tag, unsigned int mask, Blt_TableTraceProc *proc,
- Blt_TableTraceDeleteProc *deleteProc, ClientData clientData);
-
-BLT_EXTERN Blt_TableTrace Blt_Table_CreateRowTrace(Blt_Table table,
- Blt_TableRow row, unsigned int mask, Blt_TableTraceProc *proc,
- Blt_TableTraceDeleteProc *deleteProc, ClientData clientData);
-
-BLT_EXTERN Blt_TableTrace Blt_Table_CreateRowTagTrace(Blt_Table table,
- const char *tag, unsigned int mask, Blt_TableTraceProc *proc,
- Blt_TableTraceDeleteProc *deleteProc, ClientData clientData);
-
-BLT_EXTERN void Blt_Table_DeleteTrace(Blt_TableTrace trace);
-
-/*
- * Blt_TableNotifyEvent --
- *
- * Structure representing a trace used by a client of the table.
- *
- * Table rows and columns may be tagged with strings. A row may have
- * many tags. The same tag may be used for many rows. Tags are used and
- * stored by clients of a table. Tags can also be shared between clients
- * of the same table.
- *
- * Both rowTable and columnTable are hash tables keyed by the physical
- * row or column location in the table respectively. This is not the
- * same as the client's view (the order of rows or columns as seen by the
- * client). This is so that clients (which may have different views) can
- * share tags without sharing the same view.
- */
-typedef struct {
- Tcl_Interp *interp; /* Interpreter to report results. */
- Blt_Table table; /* Table object client that received
- * the event. */
- Blt_TableHeader header; /* Matching row or column. */
- int self; /* Indicates if this table client
- * generated the event. */
- int type; /* Indicates type of event
- * received. */
-} Blt_TableNotifyEvent;
-
-typedef int (Blt_TableNotifyEventProc)(ClientData clientData,
- Blt_TableNotifyEvent *eventPtr);
-
-typedef void (Blt_TableNotifierDeleteProc)(ClientData clientData);
-
-typedef struct _Blt_TableNotifier {
- Blt_Table table;
- Blt_ChainLink link;
- Blt_Chain chain;
- Blt_TableNotifyEvent event;
- Blt_TableNotifyEventProc *proc;
- Blt_TableNotifierDeleteProc *deleteProc;
- ClientData clientData;
- Tcl_Interp *interp;
- Blt_TableHeader header;
- char *tag;
- unsigned int flags;
-} *Blt_TableNotifier;
-
-
-#define TABLE_NOTIFY_ROW_CREATED (1<<0)
-#define TABLE_NOTIFY_COLUMN_CREATED (1<<1)
-#define TABLE_NOTIFY_CREATE (TABLE_NOTIFY_COLUMN_CREATED | \
- TABLE_NOTIFY_ROW_CREATED)
-#define TABLE_NOTIFY_ROW_DELETED (1<<2)
-#define TABLE_NOTIFY_COLUMN_DELETED (1<<3)
-#define TABLE_NOTIFY_DELETE (TABLE_NOTIFY_COLUMN_DELETED | \
- TABLE_NOTIFY_ROW_DELETED)
-#define TABLE_NOTIFY_ROW_MOVED (1<<4)
-#define TABLE_NOTIFY_COLUMN_MOVED (1<<5)
-#define TABLE_NOTIFY_MOVE (TABLE_NOTIFY_COLUMN_MOVED | \
- TABLE_NOTIFY_ROW_MOVED)
-#define TABLE_NOTIFY_COLUMN_CHANGED \
- (TABLE_NOTIFY_COLUMN_CREATED | TABLE_NOTIFY_COLUMN_DELETED | \
- TABLE_NOTIFY_COLUMN_MOVED)
-#define TABLE_NOTIFY_ROW_CHANGED \
- (TABLE_NOTIFY_ROW_CREATED | TABLE_NOTIFY_ROW_DELETED | \
- TABLE_NOTIFY_ROW_MOVED)
-
-#define TABLE_NOTIFY_ALL_EVENTS (TABLE_NOTIFY_ROW_CHANGED | \
- TABLE_NOTIFY_COLUMN_CHANGED)
-#define TABLE_NOTIFY_ROW (1<<6)
-#define TABLE_NOTIFY_COLUMN (1<<7)
-#define TABLE_NOTIFY_TYPE_MASK (TABLE_NOTIFY_ROW | TABLE_NOTIFY_COLUMN)
-
-#define TABLE_NOTIFY_EVENT_MASK TABLE_NOTIFY_ALL_EVENTS
-#define TABLE_NOTIFY_MASK (TABLE_NOTIFY_EVENT_MASK | \
- TABLE_NOTIFY_TYPE_MASK)
-
-#define TABLE_NOTIFY_WHENIDLE (1<<10)
-#define TABLE_NOTIFY_FOREIGN_ONLY (1<<11)
-#define TABLE_NOTIFY_PENDING (1<<12)
-#define TABLE_NOTIFY_ACTIVE (1<<13)
-#define TABLE_NOTIFY_DESTROYED (1<<14)
-
-#define TABLE_NOTIFY_ALL (NULL)
-
-BLT_EXTERN Blt_TableNotifier Blt_Table_CreateRowNotifier(Tcl_Interp *interp,
- Blt_Table table, Blt_TableRow row, unsigned int mask,
- Blt_TableNotifyEventProc *proc, Blt_TableNotifierDeleteProc *deleteProc,
- ClientData clientData);
-
-BLT_EXTERN Blt_TableNotifier Blt_Table_CreateRowTagNotifier(Tcl_Interp *interp,
- Blt_Table table, const char *tag, unsigned int mask,
- Blt_TableNotifyEventProc *proc, Blt_TableNotifierDeleteProc *deleteProc,
- ClientData clientData);
-
-BLT_EXTERN Blt_TableNotifier Blt_Table_CreateColumnNotifier(
- Tcl_Interp *interp, Blt_Table table, Blt_TableColumn column,
- unsigned int mask, Blt_TableNotifyEventProc *proc,
- Blt_TableNotifierDeleteProc *deleteProc, ClientData clientData);
-
-BLT_EXTERN Blt_TableNotifier Blt_Table_CreateColumnTagNotifier(
- Tcl_Interp *interp, Blt_Table table, const char *tag,
- unsigned int mask, Blt_TableNotifyEventProc *proc,
- Blt_TableNotifierDeleteProc *deleteProc, ClientData clientData);
-
-
-BLT_EXTERN void Blt_Table_DeleteNotifier(Blt_TableNotifier notifier);
-
-/*
- * Blt_TableSortOrder --
- *
- */
-typedef int (Blt_TableSortProc)(ClientData clientData,
- Blt_TableValue value1, Blt_TableValue value2);
-
-typedef struct {
- int type; /* Type of sort to be performed: see
- * flags below. */
- Blt_TableSortProc *sortProc; /* Procedures to be called to compare
- * two entries in the same row or
- * column. */
- Blt_TableSortProc *userProc; /* Procedures to be called to compare
- * two entries in the same row or
- * column. */
- ClientData clientData; /* One word of data passed to the sort
- * comparison procedure above. */
- Blt_TableColumn column; /* Column to be compared. */
-} Blt_TableSortOrder;
-
-
-#define SORT_DECREASING (1<<0)
-#define SORT_LIST (1<<1)
-
-#define SORT_TYPE_MASK (3<<2)
-#define SORT_NONE (0)
-#define SORT_ASCII (1<<2)
-#define SORT_DICTIONARY (2<<2)
-#define SORT_FREQUENCY (3<<2)
-
-BLT_EXTERN Blt_TableRow *Blt_Table_SortRows(Blt_Table table,
- Blt_TableSortOrder *order, size_t nCompares, unsigned int flags);
-
-BLT_EXTERN Blt_TableRow *Blt_Table_RowMap(Blt_Table table);
-BLT_EXTERN Blt_TableColumn *Blt_Table_ColumnMap(Blt_Table table);
-
-BLT_EXTERN void Blt_Table_SetRowMap(Blt_Table table, Blt_TableRow *map);
-BLT_EXTERN void Blt_Table_SetColumnMap(Blt_Table table, Blt_TableColumn *map);
-
-#define TABLE_RESTORE_NO_TAGS (1<<0)
-#define TABLE_RESTORE_OVERWRITE (1<<1)
-
-BLT_EXTERN int Blt_Table_Restore(Tcl_Interp *interp, Blt_Table table,
- char *string, unsigned int flags);
-BLT_EXTERN int Blt_Table_FileRestore(Tcl_Interp *interp, Blt_Table table,
- const char *fileName, unsigned int flags);
-BLT_EXTERN int Blt_Table_Dump(Tcl_Interp *interp, Blt_Table table,
- Blt_TableRow *rowMap, Blt_TableColumn *colMap, Tcl_DString *dsPtr);
-BLT_EXTERN int Blt_Table_FileDump(Tcl_Interp *interp, Blt_Table table,
- Blt_TableRow *rowMap, Blt_TableColumn *colMap, const char *fileName);
-
-typedef int (Blt_TableImportProc)(Blt_Table table, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-typedef int (Blt_TableExportProc)(Blt_Table table, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-
-BLT_EXTERN int Blt_Table_RegisterFormat(Tcl_Interp *interp, const char *name,
- Blt_TableImportProc *importProc, Blt_TableExportProc *exportProc);
-
-BLT_EXTERN void Blt_Table_UnsetKeys(Blt_Table table);
-BLT_EXTERN Blt_Chain Blt_Table_GetKeys(Blt_Table table);
-BLT_EXTERN int Blt_Table_SetKeys(Blt_Table table, Blt_Chain keys, int unique);
-BLT_EXTERN int Blt_Table_KeyLookup(Tcl_Interp *interp, Blt_Table table,
- int objc, Tcl_Obj *const *objv, Blt_TableRow *rowPtr);
-
-
-#define Blt_Table_NumRows(t) ((t)->corePtr->rows.nUsed)
-#define Blt_Table_RowIndex(r) ((r)->index)
-#define Blt_Table_RowLabel(r) ((r)->label)
-#define Blt_Table_Row(t,i) \
- (Blt_TableRow)((t)->corePtr->rows.map[(i)-1])
-
-#define Blt_Table_NumColumns(t) ((t)->corePtr->columns.nUsed)
-#define Blt_Table_ColumnIndex(c) ((c)->index)
-#define Blt_Table_ColumnLabel(c) ((c)->label)
-#define Blt_Table_Column(t,i) \
- (Blt_TableColumn)((t)->corePtr->columns.map[(i)-1])
-
-#define Blt_Table_TableName(t) ((t)->name)
-#define Blt_Table_EmptyValue(t) ((t)->emptyValue)
-#define Blt_Table_ColumnType(c) ((c)->type)
-
-#endif /* BLT_DATATABLE_H */
diff --git a/blt3.0.1/src/bltDebug.c b/blt3.0.1/src/bltDebug.c
deleted file mode 100644
index 7e2c7a6..0000000
--- a/blt3.0.1/src/bltDebug.c
+++ /dev/null
@@ -1,427 +0,0 @@
-
-/*
- * bltDebug.c --
- *
- * Copyright 1993-1998 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_BLTDEBUG
-
-#define DEBUG_THREAD_KEY "BLT Debug Command Data"
-#define MAX_STACK 2048
-
-#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif /* HAVE_SYS_TIME_H */
-#endif /* TIME_WITH_SYS_TIME */
-
-#include "bltChain.h"
-
-static Tcl_CmdObjTraceProc DebugProc;
-static Tcl_ObjCmdProc DebugCmd;
-
-typedef struct {
- const char *pattern;
- Tcl_Obj *nameObjPtr;
-} Watch;
-
-typedef struct {
- Blt_Chain chain; /* Chain of watches. */
- Tcl_Interp *interp;
- unsigned char *stack;
-} DebugCmdInterpData;
-
-#define SETBIT(i) \
- dataPtr->stack[(i) >> 3] |= (1 << ((i) & 0x07))
-#define GETBIT(i) \
- (dataPtr->stack[(i) >> 3] & (1 << ((i) & 0x07)))
-#define UNSETBIT(i) \
- dataPtr->stack[(i) >> 3] &= ~(1 << ((i) & 0x07))
-
-/*
- *---------------------------------------------------------------------------
- *
- * DebugInterpDeleteProc --
- *
- * This is called when the interpreter hosting the "debug" command
- * is deleted.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Removes the hash table managing all debug names.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-DebugInterpDeleteProc(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp)
-{
- DebugCmdInterpData *dataPtr = clientData;
-
- /* All debug instances should already have been destroyed when
- * their respective TCL commands were deleted. */
- Blt_Chain_Destroy(dataPtr->chain);
- Tcl_DeleteAssocData(interp, DEBUG_THREAD_KEY);
- Blt_Free(dataPtr->stack);
- Blt_Free(dataPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetDebugCmdInterpData --
- *
- *---------------------------------------------------------------------------
- */
-static DebugCmdInterpData *
-GetDebugCmdInterpData(Tcl_Interp *interp)
-{
- DebugCmdInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (DebugCmdInterpData *)
- Tcl_GetAssocData(interp, DEBUG_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(DebugCmdInterpData));
- dataPtr->interp = interp;
- Tcl_SetAssocData(interp, DEBUG_THREAD_KEY, DebugInterpDeleteProc,
- dataPtr);
- dataPtr->chain = Blt_Chain_Create();
- dataPtr->stack = Blt_Malloc(MAX_STACK);
- }
- return dataPtr;
-}
-
-static Watch *
-GetWatch(DebugCmdInterpData *dataPtr, Tcl_Obj *objPtr)
-{
- Blt_ChainLink link;
- char c;
- Watch *watchPtr;
- char *name, *string;
-
- name = Tcl_GetString(objPtr);
- c = name[0];
- for (link = Blt_Chain_FirstLink(dataPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- watchPtr = Blt_Chain_GetValue(link);
- string = Tcl_GetString(watchPtr->nameObjPtr);
- if ((string[0] == c) && (strcmp(name, string) == 0)) {
- return watchPtr;
- }
- }
- link = Blt_Chain_AllocLink(sizeof(Watch));
- watchPtr = Blt_Chain_GetValue(link);
- watchPtr->nameObjPtr = objPtr;
- Tcl_IncrRefCount(objPtr);
- /* Prepend watch onto chain. */
- Blt_Chain_LinkBefore(dataPtr->chain, link, (Blt_ChainLink)NULL);
- return watchPtr;
-}
-
-static void
-DeleteWatch(DebugCmdInterpData *dataPtr, Tcl_Obj *objPtr)
-{
- Blt_ChainLink link;
- char c;
- char *name;
-
- name = Tcl_GetString(objPtr);
- c = name[0];
- for (link = Blt_Chain_FirstLink(dataPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Watch *watchPtr;
- char *string;
-
- watchPtr = Blt_Chain_GetValue(link);
- string = Tcl_GetString(watchPtr->nameObjPtr);
- if ((string[0] == c) && (strcmp(name, string) == 0)) {
- Tcl_DecrRefCount(watchPtr->nameObjPtr);
- Blt_Chain_DeleteLink(dataPtr->chain, link);
- return;
- }
- }
-}
-
-/*ARGSUSED*/
-static int
-DebugProc(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Not used. */
- int level, /* Current level */
- const char *command, /* Command before substitution */
- Tcl_Command token, /* Not used. */
- int objc,
- Tcl_Obj *const *objv) /* Command after parsing, but before
- * evaluation */
-{
- DebugCmdInterpData *dataPtr = clientData;
- Tcl_Channel errChannel;
- Tcl_DString dString;
- const char *lineStart;
- const char *string;
- char prompt[200];
- int count;
- const char *p;
- int i;
- Tcl_Obj *listObjPtr, *objPtr;
-
- /* This is pretty crappy, but there's no way to trigger stack pops */
- for (i = level + 1; i < MAX_STACK; i++) {
- UNSETBIT(i);
- }
- if (Blt_Chain_GetLength(dataPtr->chain) > 0) {
- int found;
- Blt_ChainLink link;
-
- found = FALSE;
- for (link = Blt_Chain_FirstLink(dataPtr->chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Watch *watchPtr;
- const char *cmd, *pattern;
-
- watchPtr = Blt_Chain_GetValue(link);
- cmd = Tcl_GetString(objv[0]);
- pattern = Tcl_GetString(watchPtr->nameObjPtr);
- if (Tcl_StringMatch(cmd, pattern)) {
- found = TRUE;
- break;
- }
- }
- if ((found) && (level < MAX_STACK)) {
- SETBIT(level), SETBIT(level + 1);
- }
- if ((level >= MAX_STACK) || (!GETBIT(level))) {
- return TCL_OK;
- }
- }
- /*
- * Use stderr channel, for compatibility with systems that don't have a
- * tty (like WIN32). In reality, it doesn't make a difference since Tk's
- * Win32 console can't handle large streams of data anyways.
- */
- errChannel = Tcl_GetStdChannel(TCL_STDERR);
- if (errChannel == NULL) {
- Tcl_AppendResult(interp, "can't get stderr channel", (char *)NULL);
- Tcl_BackgroundError(interp);
- return TCL_ERROR;
- }
- Tcl_DStringInit(&dString);
-
- sprintf_s(prompt, 200, "%-2d-> ", level);
- p = command;
- /* Skip leading spaces in command line. */
- while(isspace(UCHAR(*p))) {
- p++;
- }
- lineStart = p;
- count = 0;
- while (*p != '\0') {
- if (*p == '\n') {
- if (count > 0) {
- Tcl_DStringAppend(&dString, " ", -1);
- } else {
- Tcl_DStringAppend(&dString, prompt, -1);
- }
- Tcl_DStringAppend(&dString, lineStart, p - lineStart);
- Tcl_DStringAppend(&dString, "\n", -1);
- p++;
- lineStart = p;
- count++;
- if (count > 6) {
- break; /* Stop after 6 lines. */
- }
- } else {
- p++;
- }
- }
- while (isspace(UCHAR(*lineStart))) {
- lineStart++;
- }
- if (lineStart < p) {
- if (count > 0) {
- Tcl_DStringAppend(&dString, " ", -1);
- } else {
- Tcl_DStringAppend(&dString, prompt, -1);
- }
- Tcl_DStringAppend(&dString, lineStart, p - lineStart);
- if (count <= 6) {
- Tcl_DStringAppend(&dString, "\n", -1);
- }
- }
- if (count > 6) {
- Tcl_DStringAppend(&dString, " ...\n", -1);
- }
- listObjPtr = Tcl_NewListObj(objc, objv);
- Tcl_IncrRefCount(listObjPtr);
-#ifdef notdef
- objPtr = Tcl_SubstObj(interp, listObjPtr, TCL_SUBST_VARIABLES);
-#else
- objPtr = NULL;
-#endif
- if (objPtr == NULL) {
- string = Tcl_GetString(listObjPtr);
- } else {
- Tcl_IncrRefCount(objPtr);
- string = Tcl_GetString(objPtr);
- }
- lineStart = string;
- sprintf_s(prompt, 200, " <- ");
- count = 0;
- for (p = string; *p != '\0'; /* empty */) {
- if (*p == '\n') {
- if (count > 0) {
- Tcl_DStringAppend(&dString, " ", -1);
- } else {
- Tcl_DStringAppend(&dString, prompt, -1);
- }
- count++;
- Tcl_DStringAppend(&dString, lineStart, p - lineStart);
- Tcl_DStringAppend(&dString, "\n", -1);
- p++;
- lineStart = p;
- if (count > 6) {
- break;
- }
- } else {
- p++;
- }
- }
- if (lineStart < p) {
- if (count > 0) {
- Tcl_DStringAppend(&dString, " ", -1);
- } else {
- Tcl_DStringAppend(&dString, prompt, -1);
- }
- Tcl_DStringAppend(&dString, lineStart, p - lineStart);
- if (count <= 6) {
- Tcl_DStringAppend(&dString, "\n", -1);
- }
- }
- if (count > 6) {
- Tcl_DStringAppend(&dString, " ...\n", -1);
- }
- Tcl_DStringAppend(&dString, "\n", -1);
- Tcl_DecrRefCount(listObjPtr);
- if (objPtr != NULL) {
- Tcl_DecrRefCount(objPtr);
- }
- Tcl_Write(errChannel, (char *)Tcl_DStringValue(&dString), -1);
- Tcl_Flush(errChannel);
- Tcl_DStringFree(&dString);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-DebugCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_ChainLink link;
- DebugCmdInterpData *dataPtr = clientData;
- Tcl_Obj *listObjPtr;
- Watch *watchPtr;
- const char *string;
- char c;
- int newLevel;
- int i;
- int length;
- static Tcl_Trace token;
- static int level;
-
- if (objc == 1) {
- Tcl_SetIntObj(Tcl_GetObjResult(interp), level);
- return TCL_OK;
- }
- string = Tcl_GetStringFromObj(objv[1], &length);
- c = string[0];
- if ((c == 'w') && (strncmp(string, "watch", length) == 0)) {
- /* Add patterns of command names to watch to the chain */
- for (i = 2; i < objc; i++) {
- GetWatch(dataPtr, objv[i]);
- }
- } else if ((c == 'i') && (strncmp(string, "ignore", length) == 0)) {
- for (i = 2; i < objc; i++) {
- DeleteWatch(dataPtr, objv[i]);
- }
- } else {
- goto levelTest;
- }
- /* Return the current watch patterns */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (link = Blt_Chain_FirstLink(dataPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- watchPtr = Blt_Chain_GetValue(link);
- Tcl_ListObjAppendElement(interp, listObjPtr, watchPtr->nameObjPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-
- levelTest:
- if (Tcl_GetBooleanFromObj(interp, objv[1], &newLevel) == TCL_OK) {
- if (newLevel > 0) {
- newLevel = 10000; /* Max out the level */
- }
- } else if (Tcl_GetIntFromObj(interp, objv[1], &newLevel) == TCL_OK) {
- if (newLevel < 0) {
- newLevel = 0;
- }
- } else {
- return TCL_ERROR;
- }
- if (token != 0) {
- Tcl_DeleteTrace(interp, token);
- }
- if (newLevel > 0) {
- token = Tcl_CreateObjTrace(interp, newLevel, 0, DebugProc,
- dataPtr, NULL);
- }
- level = newLevel;
- Tcl_SetIntObj(Tcl_GetObjResult(interp), level);
- return TCL_OK;
-}
-
-int
-Blt_DebugCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {"debug", DebugCmd,};
-
- cmdSpec.clientData = GetDebugCmdInterpData(interp);
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-#endif /* NO_BLTDEBUG */
diff --git a/blt3.0.1/src/bltDragdrop.c b/blt3.0.1/src/bltDragdrop.c
deleted file mode 100644
index 2d86c78..0000000
--- a/blt3.0.1/src/bltDragdrop.c
+++ /dev/null
@@ -1,2747 +0,0 @@
-
-/*
- * bltDragdrop.c --
- *
- * This module implements a drag-and-drop mechanism for the Tk Toolkit.
- * Allows widgets to be registered as drag&drop sources and targets for
- * handling "drag-and-drop" operations between Tcl/Tk applications.
- *
- * The "drag&drop" command was created by Michael J. McLennan.
- *
- * Copyright 1993-1998 Lucent Technologies, Inc.
- *
- * Permission to use, copy, modify, and distribute this software
- * and its documentation for any purpose and without fee is
- * hereby granted, provided that the above copyright notice
- * appear in all copies and that both that the copyright notice
- * and warranty disclaimer appear in supporting documentation,
- * and that the names of Lucent Technologies any of their
- * entities not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission.
- *
- * Lucent Technologies disclaims all warranties with regard to
- * this software, including all implied warranties of
- * merchantability and fitness. In no event shall Lucent
- * Technologies be liable for any special, indirect or
- * consequential damages or any damages whatsoever resulting from
- * loss of use, data or profits, whether in an action of
- * contract, negligence or other tortuous action, arising out of
- * or in connection with the use or performance of this software.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-#include "bltInt.h"
-
-
-#ifndef NO_DRAGDROP
-#include "bltOp.h"
-#include "bltHash.h"
-#include "bltChain.h"
-#include <X11/Xatom.h>
-#include "tkDisplay.h"
-
-#define DRAGDROP_THREAD_KEY "BLT Dragdrop Command Data"
-
-#ifdef WIN32
-#define MAX_PROP_SIZE 255 /* Maximum size of property. */
-typedef HWND WINDOW;
-#else
-#define MAX_PROP_SIZE 1000 /* Maximum size of property. */
-typedef Window WINDOW;
-static Atom dndAtom;
-#endif
-
-/*
- * Each "drag&drop" target widget is tagged with a "BltDrag&DropTarget"
- * property in XA_STRING format. This property identifies the window
- * as a "drag&drop" target. It's formated as a TCL list and contains
- * the following information:
- *
- * "INTERP_NAME TARGET_NAME DATA_TYPE DATA_TYPE ..."
- *
- * INTERP_NAME Name of the target application's interpreter.
- * TARGET_NAME Path name of widget registered as the drop target.
- * DATA_TYPE One or more "types" handled by the target.
- *
- * When the user invokes the "drag" operation, the window hierarchy
- * is progressively examined. Window information is cached during
- * the operation, to minimize X server traffic. Windows carrying a
- * "BltDrag&DropTarget" property are identified. When the token is
- * dropped over a valid site, the drop information is sent to the
- * application
- * via the usual "send" command. If communication fails, the drag&drop
- * facility automatically posts a rejection symbol on the token window.
- */
-
-#define INTERP_NAME 0
-#define TARGET_NAME 1
-#define DATA_TYPE 2
-
-/* Error Proc used to report drag&drop background errors */
-#define DEF_ERROR_PROC "bgerror"
-/*
- * CONFIG PARAMETERS
- */
-#define DEF_DND_BUTTON_BACKGROUND RGB_YELLOW
-#define DEF_DND_BUTTON_NUMBER "3"
-#define DEF_DND_PACKAGE_COMMAND (char *)NULL
-#define DEF_DND_SELF_TARGET "no"
-#define DEF_DND_SEND "all"
-#define DEF_DND_SITE_COMMAND (char *)NULL
-#define DEF_TOKEN_ACTIVE_BACKGROUND STD_ACTIVE_BACKGROUND
-#define DEF_TOKEN_ACTIVE_BORDERWIDTH "3"
-#define DEF_TOKEN_ACTIVE_RELIEF "sunken"
-#define DEF_TOKEN_ANCHOR "se"
-#define DEF_TOKEN_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_TOKEN_BORDERWIDTH "3"
-#define DEF_TOKEN_CURSOR "arrow"
-#define DEF_TOKEN_OUTLINE_COLOR RGB_BLACK
-#define DEF_TOKEN_REJECT_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_TOKEN_REJECT_FOREGROUND RGB_RED
-#define DEF_TOKEN_REJECT_STIPPLE_COLOR (char *)NULL
-#define DEF_TOKEN_RELIEF "raised"
-
-static char dragDropCmd[] = "::blt::drag&drop";
-
-static char className[] = "DragDropToken"; /* CLASS NAME of token window */
-static char propName[] = "BltDrag&DropTarget"; /* Property name */
-
-#ifndef WIN32
-static int initialized = FALSE;
-#endif
-
-typedef struct {
- Blt_HashTable sourceTable;
- Blt_HashTable targetTable;
- int nActive;
- int locX, locY;
- Tcl_Interp *interp;
- Tk_Window tkMain; /* Main window of the interpreter. */
-} DragdropCmdInterpData;
-
-/*
- * Percent substitutions
- */
-typedef struct {
- char letter; /* character like 'x' in "%x" */
- const char *value; /* value to be substituted in place of "%x" */
-} SubstDescriptors;
-
-
-/*
- * AnyWindow --
- *
- * This structure represents a window hierarchy examined during
- * a single "drag" operation. It's used to cache information
- * to reduce the round-trip calls to the server needed to query
- * window geometry information and grab the target property.
- */
-typedef struct _AnyWindow AnyWindow;
-
-struct _AnyWindow {
- WINDOW nativeWindow; /* Native window: HWINDOW (Win32) or
- * Window (X11). */
-
- int initialized; /* If non-zero, the rest of this structure's
- * information had been previously built. */
-
- int x1, y1, x2, y2; /* Extents of the window (upper-left and
- * lower-right corners). */
-
- AnyWindow *parentPtr; /* Parent node. NULL if root. Used to
- * compute offset for X11 windows. */
-
- Blt_Chain chain; /* List of this window's children. If NULL,
- * there are no children. */
-
- const char **targetInfo; /* An array of target window drag&drop
- * information: target interpreter,
- * pathname, and optionally possible
- * type matches. NULL if the window is
- * not a drag&drop target or is not a
- * valid match for the drop source. */
-
-};
-
-/*
- * Drag&Drop Registration Data
- */
-typedef struct {
-
- /*
- * This is a goof in the Tk API. It assumes that only an official
- * Tk "toplevel" widget will ever become a toplevel window (i.e. a
- * window whose parent is the root window). Because under Win32,
- * Tk tries to use the widget record associated with the TopLevel
- * as a Tk frame widget, to read its menu name. What this means
- * is that any widget that's going to be a toplevel, must also look
- * like a frame. Therefore we've copied the frame widget structure
- * fields into the token.
- */
-
- Tk_Window tkwin; /* Window that embodies the frame. NULL
- * means that the window has been destroyed
- * but the data structures haven't yet been
- * cleaned up. */
- Display *display; /* Display containing widget. Used, among
- * other things, so that resources can be
- * freed even after tkwin has gone away. */
- Tcl_Interp *interp; /* Interpreter associated with widget. Used
- * to delete widget command. */
- Tcl_Command widgetCmd; /* Token for frame's widget command. */
- const char *className; /* Class name for widget (from configuration
- * option). Malloc-ed. */
- int mask; /* Either FRAME or TOPLEVEL; used to select
- * which configuration options are valid for
- * widget. */
- const char *screenName; /* Screen on which widget is created. Non-null
- * only for top-levels. Malloc-ed, may be
- * NULL. */
- const char *visualName; /* Textual description of visual for window,
- * from -visual option. Malloc-ed, may be
- * NULL. */
- const char *colormapName; /* Textual description of colormap for window,
- * from -colormap option. Malloc-ed, may be
- * NULL. */
- const char *menuName; /* Textual description of menu to use for
- * menubar. Malloc-ed, may be NULL. */
- Colormap colormap; /* If not None, identifies a colormap
- * allocated for this window, which must be
- * freed when the window is deleted. */
- Tk_3DBorder border; /* Structure used to draw 3-D border and
- * background. NULL means no background
- * or border. */
- int borderWidth; /* Width of 3-D border (if any). */
- int relief; /* 3-d effect: TK_RELIEF_RAISED etc. */
- int highlightWidth; /* Width in pixels of highlight to draw
- * around widget when it has the focus.
- * 0 means don't draw a highlight. */
- XColor *highlightBgColorPtr;
- /* Color for drawing traversal highlight
- * area when highlight is off. */
- XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
- int width; /* Width to request for window. <= 0 means
- * don't request any size. */
- int height; /* Height to request for window. <= 0 means
- * don't request any size. */
- Tk_Cursor cursor; /* Current cursor for window, or None. */
- const char *takeFocus; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
- int isContainer; /* 1 means this window is a container, 0 means
- * that it isn't. */
- const char *useThis; /* If the window is embedded, this points to
- * the name of the window in which it is
- * embedded (malloc'ed). For non-embedded
- * windows this is NULL. */
- int flags; /* Various flags; see below for
- * definitions. */
-
- /* Token specific fields */
-
- int lastX, lastY; /* last position of token window */
- int active; /* non-zero => over target window */
- Tcl_TimerToken timer; /* token for routine to hide tokenwin */
- GC rejectFgGC; /* GC used to draw rejection fg: (\) */
- GC rejectBgGC; /* GC used to draw rejection bg: (\) */
-
- /* User-configurable fields */
-
- Tk_Anchor anchor; /* Position of token win relative to mouse */
- Tk_3DBorder outline; /* Outline border around token window */
- Tk_3DBorder normalBorder; /* Border/background for token window */
- Tk_3DBorder activeBorder; /* Border/background for token window */
- int activeRelief;
- int activeBW; /* Border width in pixels */
- XColor *rejectFg; /* Color used to draw rejection fg: (\) */
- XColor *rejectBg; /* Color used to draw rejection bg: (\) */
- Pixmap rejectStipple; /* Stipple used to draw rejection: (\) */
-} Token;
-
-typedef struct {
- Tcl_Interp *interp; /* Interpreter associated with the Tk source
- * widget. */
-
- Tk_Window tkwin; /* Tk window registered as the drag&drop
- * source. */
-
- Display *display; /* Drag&drop source window display */
-
- Blt_HashTable handlerTable; /* Table of data handlers (converters)
- * registered for this source. */
-
- int button; /* Button used to invoke drag operation. */
-
- Token token; /* Token used to provide special cursor. */
-
- int pkgCmdInProgress; /* Indicates if a pkgCmd is currently active. */
- const char *pkgCmd; /* TCL command executed at start of "drag"
- * operation to gather information about
- * the source data. */
-
- const char *pkgCmdResult; /* Result returned by the most recent
- * pkgCmd. */
-
- const char *siteCmd; /* TCL command executed to update token
- * window. */
-
- AnyWindow *rootPtr; /* Cached window information: Gathered
- * and used during the "drag" operation
- * to see if the mouse pointer is over a
- * valid target. */
-
- int selfTarget; /* Indicated if the source should drop onto
- * itself. */
-
- Tk_Cursor cursor; /* cursor restored after dragging */
-
- const char **sendTypes; /* list of data handler names or "all" */
-
- Blt_HashEntry *hashPtr;
-
- AnyWindow *windowPtr; /* Last target examined. If NULL, mouse
- * pointer is not currently over a valid
- * target. */
- Tcl_Obj *errorCmdObjPtr;
- DragdropCmdInterpData *dataPtr;
-} Source;
-
-typedef struct {
- Tcl_Interp *interp;
- Tk_Window tkwin; /* drag&drop target window */
- Display *display; /* drag&drop target window display */
- Blt_HashTable handlerTable; /* Table of data handlers (converters)
- * registered for this target. */
- Blt_HashEntry *hashPtr;
- DragdropCmdInterpData *dataPtr;
-} Target;
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_INT, "-button", "buttonBinding", "ButtonBinding",
- DEF_DND_BUTTON_NUMBER, Blt_Offset(Source, button), 0},
- {BLT_CONFIG_OBJ, "-errorcmd", "errorCommand", "ErrorCommand",
- "bgerror", Blt_Offset(Source, errorCmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-packagecmd", "packageCommand", "PackageCommand",
- DEF_DND_PACKAGE_COMMAND, Blt_Offset(Source, pkgCmd),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-rejectbg", "rejectBackground", "Background",
- DEF_TOKEN_REJECT_BACKGROUND, Blt_Offset(Source, token.rejectBg), 0},
- {BLT_CONFIG_COLOR, "-rejectfg", "rejectForeground", "Foreground",
- DEF_TOKEN_REJECT_FOREGROUND, Blt_Offset(Source, token.rejectFg), 0},
- {BLT_CONFIG_BITMAP, "-rejectstipple", "rejectStipple", "Stipple",
- DEF_TOKEN_REJECT_STIPPLE_COLOR,
- Blt_Offset(Source, token.rejectStipple), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BOOLEAN, "-selftarget", "selfTarget", "SelfTarget",
- DEF_DND_SELF_TARGET, Blt_Offset(Source, selfTarget), 0},
- {BLT_CONFIG_LIST, "-send", "send", "Send", DEF_DND_SEND,
- Blt_Offset(Source, sendTypes), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-sitecmd", "siteCommand", "Command",
- DEF_DND_SITE_COMMAND, Blt_Offset(Source, siteCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ANCHOR, "-tokenanchor", "tokenAnchor", "Anchor",
- DEF_TOKEN_ANCHOR, Blt_Offset(Source, token.anchor), 0},
- {BLT_CONFIG_BORDER, "-tokenactivebackground", "tokenActiveBackground",
- "ActiveBackground", DEF_TOKEN_ACTIVE_BACKGROUND,
- Blt_Offset(Source, token.activeBorder), 0},
- {BLT_CONFIG_BORDER, "-tokenbg", "tokenBackground", "Background",
- DEF_TOKEN_BACKGROUND, Blt_Offset(Source, token.normalBorder), 0},
- {BLT_CONFIG_BORDER, "-tokenoutline", "tokenOutline", "Outline",
- DEF_TOKEN_OUTLINE_COLOR, Blt_Offset(Source, token.outline), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-tokenborderwidth", "tokenBorderWidth",
- "BorderWidth", DEF_TOKEN_BORDERWIDTH,
- Blt_Offset(Source, token.borderWidth), 0},
- {BLT_CONFIG_CURSOR, "-tokencursor", "tokenCursor", "Cursor",
- DEF_TOKEN_CURSOR, Blt_Offset(Source, token.cursor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0},
-};
-
-static Blt_ConfigSpec tokenConfigSpecs[] =
-{
- {BLT_CONFIG_BORDER, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_TOKEN_ACTIVE_BACKGROUND,
- Blt_Offset(Token, activeBorder), 0},
- {BLT_CONFIG_RELIEF, "-activerelief", "activeRelief", "activeRelief",
- DEF_TOKEN_ACTIVE_RELIEF, Blt_Offset(Token, activeRelief), 0},
- {BLT_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor",
- DEF_TOKEN_ANCHOR, Blt_Offset(Token, anchor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-activeborderwidth", "activeBorderWidth",
- "ActiveBorderWidth", DEF_TOKEN_ACTIVE_BORDERWIDTH,
- Blt_Offset(Token, activeBW), 0},
- {BLT_CONFIG_BORDER, "-background", "background", "Background",
- DEF_TOKEN_BACKGROUND, Blt_Offset(Token, normalBorder), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_TOKEN_BORDERWIDTH, Blt_Offset(Token, borderWidth), 0},
- {BLT_CONFIG_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_TOKEN_CURSOR, Blt_Offset(Token, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BORDER, "-outline", "outline", "Outline",
- DEF_TOKEN_OUTLINE_COLOR, Blt_Offset(Token, outline), 0},
- {BLT_CONFIG_COLOR, "-rejectbg", "rejectBackground", "Background",
- DEF_TOKEN_REJECT_BACKGROUND, Blt_Offset(Token, rejectBg), 0},
- {BLT_CONFIG_COLOR, "-rejectfg", "rejectForeground", "Foreground",
- DEF_TOKEN_REJECT_FOREGROUND, Blt_Offset(Token, rejectFg), 0},
- {BLT_CONFIG_BITMAP, "-rejectstipple", "rejectStipple", "Stipple",
- DEF_TOKEN_REJECT_STIPPLE_COLOR, Blt_Offset(Token, rejectStipple),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_TOKEN_RELIEF, Blt_Offset(Token, relief), 0},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0},
-};
-
-
-/*
- * Forward Declarations
- */
-static Tcl_ObjCmdProc DragDropCmd;
-static Tk_EventProc TokenEventProc;
-static Tk_EventProc TargetEventProc;
-
-static void MoveToken(Source * srcPtr, Token *tokenPtr);
-static void UpdateToken(ClientData clientData);
-static void HideToken(Token *tokenPtr);
-static void RejectToken(Token *tokenPtr);
-
-static int GetSourceFromObj(DragdropCmdInterpData *dataPtr, Tcl_Interp *interp,
- Tcl_Obj *objPtr, Source **srcPtrPtr);
-static Source *CreateSource(DragdropCmdInterpData *dataPtr, Tcl_Interp *interp,
- Tcl_Obj *objPtr, int *newEntry);
-static void DestroySource(Source * srcPtr);
-static void SourceEventProc(ClientData clientData, XEvent *eventPtr);
-static int ConfigureSource(Tcl_Interp *interp, Source * srcPtr, int objc,
- Tcl_Obj *const *objv, int flags);
-static int ConfigureToken(Tcl_Interp *interp, Source * srcPtr, int objc,
- Tcl_Obj *const *objv);
-
-static Target *CreateTarget(DragdropCmdInterpData *dataPtr, Tcl_Interp *interp,
- Tk_Window tkwin);
-static Target *FindTarget(DragdropCmdInterpData *dataPtr, Tk_Window tkwin);
-static void DestroyTarget(DestroyData data);
-static int OverTarget(Source * srcPtr, int x, int y);
-static void AddTargetProperty(Tcl_Interp *interp, Target *targetPtr);
-
-static void DndSend(Source *srcPtr);
-
-static void InitRoot(Source * srcPtr);
-static void RemoveWindow(AnyWindow *wr);
-static void QueryWindow(Display *display, AnyWindow * windowPtr);
-
-static const char *ExpandPercents(const char *str, SubstDescriptors *subs,
- int nsubs, Tcl_DString *resultPtr);
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DragdropInterpDeleteProc --
- *
- * This is called when the interpreter hosting the "dragdrop"
- * command is deleted.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Removes the hash table managing all dragdrop names.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-DragdropInterpDeleteProc(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp)
-{
- DragdropCmdInterpData *dataPtr = clientData;
-
- /* All dragdrop instances should already have been destroyed when
- * their respective TCL commands were deleted. */
- Blt_DeleteHashTable(&dataPtr->sourceTable);
- Blt_DeleteHashTable(&dataPtr->targetTable);
- Tcl_DeleteAssocData(interp, DRAGDROP_THREAD_KEY);
- Blt_Free(dataPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetDragdropdCmdInterpData --
- *
- *---------------------------------------------------------------------------
- */
-static DragdropCmdInterpData *
-GetDragdropCmdInterpData(Tcl_Interp *interp)
-{
- DragdropCmdInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (DragdropCmdInterpData *)
- Tcl_GetAssocData(interp, DRAGDROP_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(DragdropCmdInterpData));
- dataPtr->interp = interp;
- dataPtr->tkMain = Tk_MainWindow(interp);
- Tcl_SetAssocData(interp, DRAGDROP_THREAD_KEY, DragdropInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->sourceTable, BLT_ONE_WORD_KEYS);
- Blt_InitHashTable(&dataPtr->targetTable, BLT_ONE_WORD_KEYS);
- dataPtr->nActive = 0;
- dataPtr->locX = dataPtr->locY = 0;
- }
- return dataPtr;
-}
-
-
-#ifdef WIN32
-
-#if defined( _MSC_VER) || defined(__BORLANDC__)
-#include <tchar.h>
-#endif /* _MSC_VER || __BORLANDC__ */
-
-typedef struct {
- const char *prefix;
- int prefixSize;
- const char *propReturn;
-} PropertyInfo;
-
-
-#ifdef notdef
-static BOOL CALLBACK
-GetEnumWindowsProc(HWND hWnd, LPARAM clientData)
-{
- Blt_Chain chain = (Blt_Chain)clientData;
-
- Blt_Chain_Append(chain, (ClientData)hWnd);
- return TRUE;
-}
-#endif
-
-static WINDOW
-GetNativeWindow(Tk_Window tkwin)
-{
- return (WINDOW) Tk_GetHWND(Tk_WindowId(tkwin));
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetWindowZOrder --
- *
- * Returns a list of the child windows according to their stacking
- * order. The window handles are ordered from top to bottom.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-GetWindowZOrder(Display *display, HWND parent)
-{
- Blt_Chain chain;
- HWND hWnd;
-
- chain = Blt_Chain_Create();
- for (hWnd = GetTopWindow(parent); hWnd != NULL;
- hWnd = GetNextWindow(hWnd, GW_HWNDNEXT)) {
- Blt_Chain_Append(chain, (ClientData)hWnd);
- }
- return chain;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetEnumPropsExProc --
- *
- *---------------------------------------------------------------------------
- */
-static BOOL CALLBACK
-GetEnumPropsExProc(
- HWND hwnd,
- LPCTSTR atom,
- HANDLE hData,
- DWORD clientData)
-{
- PropertyInfo *infoPtr = (PropertyInfo *) clientData;
-
- if (strncmp(infoPtr->prefix, atom, infoPtr->prefixSize) == 0) {
- assert(infoPtr->propReturn == NULL);
- infoPtr->propReturn = (const char *)atom;
- return FALSE;
- }
- return TRUE;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * GetPropData --
- *
- * This is a bad Windows hack to pass property information between
- * applications. (Ab)Normally the property data (one-word value) is
- * stored in the data handle. But the data content is available only
- * within the application. The pointer value is meaningless outside
- * of the current application address space. Not really useful at all.
- *
- * So the trick here is to encode the property name with all the
- * necessary information and to loop through all the properties
- * of a window, looking for one that starts with our property name
- * prefix. The downside is that the property name is limited to
- * 255 bytes. But that should be enough. It's also slower since
- * we examine each property until we find ours.
- *
- * We'll plug in the OLE stuff later.
- *
- *---------------------------------------------------------------------------
- */
-
-static const char *
-GetPropData(HWND hWnd, char *atom)
-{
- PropertyInfo propInfo;
- if (hWnd == NULL) {
- return NULL;
- }
- propInfo.prefix = atom;
- propInfo.prefixSize = strlen(atom);
- propInfo.propReturn = NULL;
- EnumPropsEx(hWnd, (PROPENUMPROCEX)GetEnumPropsExProc, (DWORD)&propInfo);
- return propInfo.propReturn;
-}
-#endif
-
-static const unsigned char *
-GetProperty(Display *display, HWND hWnd)
-{
- HANDLE handle;
-
- handle = GetProp(hWnd, propName);
- if (handle != NULL) {
- ATOM atom;
- char buffer[MAX_PROP_SIZE + 1];
- UINT nBytes;
-
- atom = (ATOM)((int)handle);
- nBytes = GlobalGetAtomName(atom, buffer, MAX_PROP_SIZE);
- if (nBytes > 0) {
- buffer[nBytes] = '\0';
- return Blt_AssertStrdup(buffer);
- }
- }
- return NULL;
-}
-
-static void
-SetProperty(Tk_Window tkwin, const char *data)
-{
- HANDLE handle;
- HWND hWnd;
- ATOM atom;
-
- hWnd = Tk_GetHWND(Tk_WindowId(tkwin));
- if (hWnd == NULL) {
- return;
- }
- handle = GetProp(hWnd, propName);
- atom = (ATOM)((int)handle);
- if (atom != (ATOM)0) {
- GlobalDeleteAtom(atom);
- }
- atom = GlobalAddAtom((unsigned char *)data);
- if (atom != (ATOM)0) {
- handle = (HANDLE)((int)atom);
- SetProp(hWnd, propName, handle);
- }
-}
-
-static void
-RemoveProperty(Tk_Window tkwin)
-{
- HWND hWnd;
- HANDLE handle;
-
- hWnd = Tk_GetHWND(Tk_WindowId(tkwin));
- if (hWnd == NULL) {
- return;
- }
- handle = GetProp(hWnd, propName);
- if (handle != NULL) {
- ATOM atom;
-
- atom = (ATOM)((int)handle);
- GlobalDeleteAtom(atom);
- }
- RemoveProp(hWnd, propName);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetWindowRegion --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-GetWindowRegion(
- Display *display, /* Not used. */
- HWND hWnd,
- int *x1Ptr,
- int *y1Ptr,
- int *x2Ptr,
- int *y2Ptr)
-{
- RECT rect;
-
- if (GetWindowRect(hWnd, &rect)) {
- *x1Ptr = rect.left;
- *y1Ptr = rect.top;
- *x2Ptr = rect.right;
- *y2Ptr = rect.bottom;
- return IsWindowVisible(hWnd);
- }
- return FALSE;
-}
-
-#else
-
-static WINDOW
-GetNativeWindow(Tk_Window tkwin)
-{
- return Tk_WindowId(tkwin);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetWindowZOrder --
- *
- * Returns a chain of the child windows according to their stacking
- * order. The window ids are ordered from top to bottom.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-GetWindowZOrder(Display *display, Window window)
-{
- Blt_Chain chain;
- Window *winv;
- unsigned int winc;
- Window dummy;
-
- chain = NULL;
- if ((XQueryTree(display, window, &dummy, &dummy, &winv, &winc)) &&
- (winc > 0)) {
- unsigned int i;
-
- chain = Blt_Chain_Create();
- for (i = 0; i < winc; i++) {
- /*
- * XQuery returns windows in bottom to top order.
- * We only care about the top window.
- */
- Blt_Chain_Prepend(chain, (ClientData)winv[i]);
- }
- if (winv != NULL) {
- XFree((char *)winv); /* done with list of kids */
- }
- }
- return chain;
-}
-
-static const unsigned char *
-GetProperty(
- Display *display,
- Window window)
-{
- unsigned char *data;
- int result, actualFormat;
- Atom actualType;
- unsigned long nItems, bytesAfter;
-
- if (window == None) {
- return NULL;
- }
- data = NULL;
- result = XGetWindowProperty(display, window, dndAtom, 0, MAX_PROP_SIZE,
- False, XA_STRING, &actualType, &actualFormat, &nItems, &bytesAfter,
- &data);
- if ((result != Success) || (actualFormat != 8) ||
- (actualType != XA_STRING)) {
- if (data != NULL) {
- XFree(data);
- data = NULL;
- }
- }
- return data;
-}
-
-static void
-SetProperty(Tk_Window tkwin, char *data)
-{
- XChangeProperty(Tk_Display(tkwin), Tk_WindowId(tkwin), dndAtom, XA_STRING,
- 8, PropModeReplace, (unsigned char *)data, strlen(data) + 1);
-}
-
-static int
-GetWindowRegion(
- Display *display,
- Window window,
- int *x1Ptr, int *y1Ptr,
- int *x2Ptr, int *y2Ptr)
-{
- XWindowAttributes winAttrs;
-
- if (XGetWindowAttributes(display, window, &winAttrs)) {
- *x1Ptr = winAttrs.x;
- *y1Ptr = winAttrs.y;
- *x2Ptr = winAttrs.x + winAttrs.width - 1;
- *y2Ptr = winAttrs.y + winAttrs.height - 1;
- }
- return (winAttrs.map_state == IsViewable);
-}
-
-#endif /* WIN32 */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChangeToken --
- *
- *---------------------------------------------------------------------------
- */
-static void
-ChangeToken(Token *tokenPtr, int active)
-{
- int relief;
- Tk_3DBorder border;
- int borderWidth;
-
- Blt_Fill3DRectangle(tokenPtr->tkwin, Tk_WindowId(tokenPtr->tkwin),
- tokenPtr->outline, 0, 0, Tk_Width(tokenPtr->tkwin),
- Tk_Height(tokenPtr->tkwin), 0, TK_RELIEF_FLAT);
- if (active) {
- relief = tokenPtr->activeRelief;
- border = tokenPtr->activeBorder;
- borderWidth = tokenPtr->activeBW;
- } else {
- relief = tokenPtr->relief;
- border = tokenPtr->normalBorder;
- borderWidth = tokenPtr->borderWidth;
- }
- Blt_Fill3DRectangle(tokenPtr->tkwin, Tk_WindowId(tokenPtr->tkwin), border,
- 2, 2, Tk_Width(tokenPtr->tkwin) - 4, Tk_Height(tokenPtr->tkwin) - 4,
- borderWidth, relief);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TokenEventProc --
- *
- * Invoked by the Tk dispatcher to handle widget events.
- * Manages redraws for the drag&drop token window.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TokenEventProc(
- ClientData clientData, /* data associated with widget */
- XEvent *eventPtr) /* information about event */
-{
- Token *tokenPtr = clientData;
-
- if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
- if (tokenPtr->tkwin != NULL) {
- ChangeToken(tokenPtr, tokenPtr->active);
- }
- } else if (eventPtr->type == DestroyNotify) {
- tokenPtr->tkwin = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HideToken --
- *
- * Unmaps the drag&drop token. Invoked directly at the end of a
- * successful communication, or after a delay if the communication
- * fails (allowing the user to see a graphical picture of failure).
- *
- *---------------------------------------------------------------------------
- */
-static void
-HideToken(Token *tokenPtr)
-{
- if (tokenPtr->tkwin != NULL) {
- Tk_UnmapWindow(tokenPtr->tkwin);
- }
- tokenPtr->timer = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RaiseToken --
- *
- *---------------------------------------------------------------------------
- */
-static void
-RaiseToken(Token *tokenPtr)
-{
- Blt_MapToplevelWindow(tokenPtr->tkwin);
- Blt_RaiseToplevelWindow(tokenPtr->tkwin);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MoveToken --
- *
- * Invoked during "drag" operations to move a token window to its
- * current "drag" coordinate.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MoveToken(
- Source *srcPtr, /* drag&drop source window data */
- Token *tokenPtr)
-{
- int x, y;
- int maxX, maxY;
- int vx, vy, vw, vh;
- int screenWidth, screenHeight;
-
- Blt_SizeOfScreen(srcPtr->tkwin, &screenWidth, &screenHeight);
-
- /* Adjust current location for virtual root windows. */
- Tk_GetVRootGeometry(srcPtr->tkwin, &vx, &vy, &vw, &vh);
- x = tokenPtr->lastX + vx - 3;
- y = tokenPtr->lastY + vy - 3;
-
- maxX = screenWidth - Tk_Width(tokenPtr->tkwin);
- maxY = screenHeight - Tk_Height(tokenPtr->tkwin);
- Blt_TranslateAnchor(x, y, Tk_Width(tokenPtr->tkwin),
- Tk_Height(tokenPtr->tkwin), tokenPtr->anchor, &x, &y);
- if (x > maxX) {
- x = maxX;
- } else if (x < 0) {
- x = 0;
- }
- if (y > maxY) {
- y = maxY;
- } else if (y < 0) {
- y = 0;
- }
- if ((x != Tk_X(tokenPtr->tkwin)) || (y != Tk_Y(tokenPtr->tkwin))) {
- Tk_MoveToplevelWindow(tokenPtr->tkwin, x, y);
- }
- RaiseToken(tokenPtr);
-}
-
-static Tk_Cursor
-GetWidgetCursor(
- Tcl_Interp *interp,
- Tk_Window tkwin)
-{
- const char *cursorName;
- Tk_Cursor cursor;
-
- cursor = None;
- if (Tcl_VarEval(interp, Tk_PathName(tkwin), " cget -cursor",
- (char *)NULL) != TCL_OK) {
- return None;
- }
- cursorName = Tcl_GetStringResult(interp);
- if ((cursorName != NULL) && (cursorName[0] != '\0')) {
- cursor = Tk_GetCursor(interp, tkwin, Tk_GetUid((char *)cursorName));
- }
- Tcl_ResetResult(interp);
- return cursor;
-}
-
-static void
-Bgerror(Source *srcPtr)
-{
- if (srcPtr->errorCmdObjPtr != NULL) {
- Tcl_Obj *objv[2];
-
- objv[0] = srcPtr->errorCmdObjPtr;
- objv[1] = Tcl_GetObjResult(srcPtr->interp);
- Tcl_IncrRefCount(objv[0]);
- Tcl_IncrRefCount(objv[1]);
- Tcl_EvalObjv(srcPtr->interp, 2, objv, 0);
- Tcl_DecrRefCount(objv[1]);
- Tcl_DecrRefCount(objv[0]);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UpdateToken --
- *
- * Invoked when the event loop is idle to determine whether or not
- * the current drag&drop token position is over another drag&drop
- * target.
- *
- *---------------------------------------------------------------------------
- */
-static void
-UpdateToken(ClientData clientData) /* widget data */
-{
- Source *srcPtr = clientData;
- Token *tokenPtr = &srcPtr->token;
-
- ChangeToken(tokenPtr, tokenPtr->active);
- /*
- * If the source has a site command, then invoke it to
- * modify the appearance of the token window. Pass any
- * errors onto the drag&drop error handler.
- */
- if (srcPtr->siteCmd) {
- char buffer[200];
- Tcl_DString dString;
- int result;
- SubstDescriptors subs[2];
-
- sprintf_s(buffer, 200, "%d", tokenPtr->active);
- subs[0].letter = 's';
- subs[0].value = buffer;
- subs[1].letter = 't';
- subs[1].value = Tk_PathName(tokenPtr->tkwin);
-
- Tcl_DStringInit(&dString);
- result = Tcl_Eval(srcPtr->interp,
- ExpandPercents(srcPtr->siteCmd, subs, 2, &dString));
- Tcl_DStringFree(&dString);
- if (result != TCL_OK) {
- Bgerror(srcPtr);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RejectToken --
- *
- * Draws a rejection mark on the current drag&drop token, and arranges
- * for the token to be unmapped after a small delay.
- *
- *---------------------------------------------------------------------------
- */
-static void
-RejectToken(Token *tokenPtr)
-{
- int divisor = 6; /* controls size of rejection symbol */
- int w, h, lineWidth, x, y, margin;
-
- margin = 2 * tokenPtr->borderWidth;
- w = Tk_Width(tokenPtr->tkwin) - 2 * margin;
- h = Tk_Height(tokenPtr->tkwin) - 2 * margin;
- lineWidth = (w < h) ? w / divisor : h / divisor;
- lineWidth = (lineWidth < 1) ? 1 : lineWidth;
-
- w = h = lineWidth * (divisor - 1);
- x = (Tk_Width(tokenPtr->tkwin) - w) / 2;
- y = (Tk_Height(tokenPtr->tkwin) - h) / 2;
-
- /*
- * Draw the rejection symbol background (\) on the token window...
- */
- XSetLineAttributes(Tk_Display(tokenPtr->tkwin), tokenPtr->rejectBgGC,
- lineWidth + 4, LineSolid, CapButt, JoinBevel);
-
- XDrawArc(Tk_Display(tokenPtr->tkwin), Tk_WindowId(tokenPtr->tkwin),
- tokenPtr->rejectBgGC, x, y, w, h, 0, 23040);
-
- XDrawLine(Tk_Display(tokenPtr->tkwin), Tk_WindowId(tokenPtr->tkwin),
- tokenPtr->rejectBgGC, x + lineWidth, y + lineWidth, x + w - lineWidth,
- y + h - lineWidth);
-
- /*
- * Draw the rejection symbol foreground (\) on the token window...
- */
- XSetLineAttributes(Tk_Display(tokenPtr->tkwin), tokenPtr->rejectFgGC,
- lineWidth, LineSolid, CapButt, JoinBevel);
-
- XDrawArc(Tk_Display(tokenPtr->tkwin), Tk_WindowId(tokenPtr->tkwin),
- tokenPtr->rejectFgGC, x, y, w, h, 0, 23040);
-
- XDrawLine(Tk_Display(tokenPtr->tkwin), Tk_WindowId(tokenPtr->tkwin),
- tokenPtr->rejectFgGC, x + lineWidth, y + lineWidth, x + w - lineWidth,
- y + h - lineWidth);
-
- /*
- * Arrange for token window to disappear eventually.
- */
- tokenPtr->timer = Tcl_CreateTimerHandler(1000, (Tcl_TimerProc *) HideToken,
- tokenPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureToken --
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureToken(
- Tcl_Interp *interp,
- Source *srcPtr,
- int objc,
- Tcl_Obj *const *objv)
-{
- Token *tokenPtr;
-
- tokenPtr = &srcPtr->token;
- if (Blt_ConfigureWidgetFromObj(interp, srcPtr->tkwin, tokenConfigSpecs,
- objc, objv, (char *)tokenPtr, BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- return ConfigureSource(interp, srcPtr, 0, (Tcl_Obj **)NULL,
- BLT_CONFIG_OBJV_ONLY);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateToken --
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateToken(
- Tcl_Interp *interp,
- Source *srcPtr)
-{
- XSetWindowAttributes attrs;
- Tk_Window tkwin;
- char string[200];
- static int nextTokenId = 0;
- unsigned int mask;
- Token *tokenPtr = &srcPtr->token;
-
- sprintf_s(string, 200, "dd-token%d", ++nextTokenId);
-
- /* Create toplevel on parent's screen. */
- tkwin = Tk_CreateWindow(interp, srcPtr->tkwin, string, "");
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- Tk_SetClass(tkwin, className);
- Tk_CreateEventHandler(tkwin, ExposureMask | StructureNotifyMask,
- TokenEventProc, tokenPtr);
-
- attrs.override_redirect = True;
- attrs.backing_store = WhenMapped;
- attrs.save_under = True;
- mask = CWOverrideRedirect | CWSaveUnder | CWBackingStore;
- Tk_ChangeWindowAttributes(tkwin, mask, &attrs);
-
- Tk_SetInternalBorder(tkwin, tokenPtr->borderWidth + 2);
- tokenPtr->tkwin = tkwin;
-#ifdef WIN32
- {
- Tk_FakeWin *winPtr = (Tk_FakeWin *) tkwin;
- winPtr->dummy18 = tokenPtr;
- }
-#endif /* WIN32 */
- Tk_MakeWindowExist(tkwin);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateSource --
- *
- * Looks for a Source record in the hash table for drag&drop source
- * widgets. Creates a new record if the widget name is not already
- * registered. Returns a pointer to the desired record.
- *
- *---------------------------------------------------------------------------
- */
-static Source *
-CreateSource(
- DragdropCmdInterpData *dataPtr,
- Tcl_Interp *interp,
- Tcl_Obj *objPtr, /* widget pathname for desired record */
- int *newPtr) /* returns non-zero => new record created */
-{
- char *pathName; /* widget pathname for desired record */
- Blt_HashEntry *hPtr;
- Tk_Window tkwin;
- Source *srcPtr;
-
- pathName = Tcl_GetString(objPtr);
- tkwin = Tk_NameToWindow(interp, pathName, dataPtr->tkMain);
- if (tkwin == NULL) {
- return NULL;
- }
- hPtr = Blt_CreateHashEntry(&dataPtr->sourceTable, (char *)tkwin, newPtr);
- if (!(*newPtr)) {
- return Blt_GetHashValue(hPtr);
- }
- srcPtr = Blt_AssertCalloc(1, sizeof(Source));
- srcPtr->tkwin = tkwin;
- srcPtr->display = Tk_Display(tkwin);
- srcPtr->interp = interp;
- srcPtr->token.anchor = TK_ANCHOR_SE;
- srcPtr->token.relief = TK_RELIEF_RAISED;
- srcPtr->token.activeRelief = TK_RELIEF_SUNKEN;
- srcPtr->token.borderWidth = srcPtr->token.activeBW = 3;
- srcPtr->hashPtr = hPtr;
- srcPtr->dataPtr = dataPtr;
- Blt_InitHashTable(&srcPtr->handlerTable, BLT_STRING_KEYS);
- if (ConfigureSource(interp, srcPtr, 0, (Tcl_Obj **)NULL, 0) != TCL_OK) {
- DestroySource(srcPtr);
- return NULL;
- }
- Blt_SetHashValue(hPtr, srcPtr);
- /*
- * Arrange for the window to unregister itself when it
- * is destroyed.
- */
- Tk_CreateEventHandler(tkwin, StructureNotifyMask, SourceEventProc, srcPtr);
- return srcPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroySource --
- *
- * Looks for a Source record in the hash table for drag&drop source
- * widgets. Destroys the record if found.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroySource(Source *srcPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- Tcl_CancelIdleCall(UpdateToken, srcPtr);
- if (srcPtr->token.timer) {
- Tcl_DeleteTimerHandler(srcPtr->token.timer);
- }
- Blt_FreeOptions(configSpecs, (char *)srcPtr, srcPtr->display, 0);
-
- if (srcPtr->token.rejectFgGC != NULL) {
- Tk_FreeGC(srcPtr->display, srcPtr->token.rejectFgGC);
- }
- if (srcPtr->token.rejectBgGC != NULL) {
- Tk_FreeGC(srcPtr->display, srcPtr->token.rejectBgGC);
- }
- if (srcPtr->pkgCmdResult) {
- Blt_Free(srcPtr->pkgCmdResult);
- }
- if (srcPtr->rootPtr != NULL) {
- RemoveWindow(srcPtr->rootPtr);
- }
- if (srcPtr->cursor != None) {
- Tk_FreeCursor(srcPtr->display, srcPtr->cursor);
- }
- if (srcPtr->token.cursor != None) {
- Tk_FreeCursor(srcPtr->display, srcPtr->token.cursor);
- }
- Blt_Free(srcPtr->sendTypes);
-
- for (hPtr = Blt_FirstHashEntry(&srcPtr->handlerTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- const char *cmd;
-
- cmd = Blt_GetHashValue(hPtr);
- if (cmd != NULL) {
- Blt_Free(cmd);
- }
- }
- Blt_DeleteHashTable(&srcPtr->handlerTable);
- if (srcPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&srcPtr->dataPtr->sourceTable, srcPtr->hashPtr);
- }
- Blt_Free(srcPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetSourceFromObj --
- *
- * Looks for a Source record in the hash table for drag&drop source
- * widgets. Returns a pointer to the desired record.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetSourceFromObj(
- DragdropCmdInterpData *dataPtr,
- Tcl_Interp *interp,
- Tcl_Obj *objPtr, /* widget pathname for desired record */
- Source **srcPtrPtr)
-{
- Blt_HashEntry *hPtr;
- Tk_Window tkwin;
- char *pathName;
-
- pathName = Tcl_GetString(objPtr);
- tkwin = Tk_NameToWindow(interp, pathName, dataPtr->tkMain);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- hPtr = Blt_FindHashEntry(&dataPtr->sourceTable, (char *)tkwin);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "window \"", pathName,
- "\" has not been initialized as a drag&drop source", (char *)NULL);
- return TCL_ERROR;
- }
- *srcPtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-static char *
-ConcatArgs(int objc, Tcl_Obj *const *objv)
-{
- char *string;
-
- if (objc == 1) {
- string = Blt_AssertStrdup(Tcl_GetString(objv[0]));
- } else {
- Tcl_DString dString;
- int i;
-
- Tcl_DStringInit(&dString);
- for(i = 0; i < objc; i++) {
- Tcl_DStringAppendElement(&dString, Tcl_GetString(objv[i]));
- }
- string = Blt_AssertStrdup(Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- }
- return string;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureSource --
- *
- * Called to process an (objc,objv) list to configure (or
- * reconfigure) a drag&drop source widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureSource(
- Tcl_Interp *interp, /* current interpreter */
- Source *srcPtr, /* drag&drop source widget record */
- int objc, /* number of arguments */
- Tcl_Obj *const *objv, /* argument strings */
- int flags) /* flags controlling interpretation */
-{
- unsigned long gcMask;
- XGCValues gcValues;
- GC newGC;
- Tcl_DString dString;
- Tcl_CmdInfo cmdInfo;
- int result;
-
- /*
- * Handle the bulk of the options...
- */
- if (Blt_ConfigureWidgetFromObj(interp, srcPtr->tkwin, configSpecs,
- objc, objv, (char *)srcPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Check the button binding for valid range (0 or 1-5)
- */
- if ((srcPtr->button < 0) || (srcPtr->button > 5)) {
- Tcl_AppendResult(interp,
- "button number must be 1-5, or 0 for no bindings",
- (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * Set up the rejection foreground GC for the token window...
- */
- gcValues.foreground = srcPtr->token.rejectFg->pixel;
- gcValues.subwindow_mode = IncludeInferiors;
- gcValues.graphics_exposures = False;
- gcMask = GCForeground | GCSubwindowMode | GCGraphicsExposures;
-
- if (srcPtr->token.rejectStipple != None) {
- gcValues.stipple = srcPtr->token.rejectStipple;
- gcValues.fill_style = FillStippled;
- gcMask |= GCForeground | GCStipple | GCFillStyle;
- }
- newGC = Tk_GetGC(srcPtr->tkwin, gcMask, &gcValues);
-
- if (srcPtr->token.rejectFgGC != NULL) {
- Tk_FreeGC(srcPtr->display, srcPtr->token.rejectFgGC);
- }
- srcPtr->token.rejectFgGC = newGC;
-
- /*
- * Set up the rejection background GC for the token window...
- */
- gcValues.foreground = srcPtr->token.rejectBg->pixel;
- gcValues.subwindow_mode = IncludeInferiors;
- gcValues.graphics_exposures = False;
- gcMask = GCForeground | GCSubwindowMode | GCGraphicsExposures;
-
- newGC = Tk_GetGC(srcPtr->tkwin, gcMask, &gcValues);
-
- if (srcPtr->token.rejectBgGC != NULL) {
- Tk_FreeGC(srcPtr->display, srcPtr->token.rejectBgGC);
- }
- srcPtr->token.rejectBgGC = newGC;
-
- /*
- * Reset the border width in case it has changed...
- */
- if (srcPtr->token.tkwin) {
- Tk_SetInternalBorder(srcPtr->token.tkwin,
- srcPtr->token.borderWidth + 2);
- }
- if (!Tcl_GetCommandInfo(interp, "::blt::Drag&DropInit", &cmdInfo)) {
- static char cmd[] = "source [file join $blt_library dragdrop.tcl]";
-
- if (Tcl_GlobalEval(interp, cmd) != TCL_OK) {
- Tcl_AddErrorInfo(interp,
- "\n (while loading bindings for blt::drag&drop)");
- return TCL_ERROR;
- }
- }
- Tcl_DStringInit(&dString);
- Blt_DStringAppendElements(&dString, "::blt::Drag&DropInit",
- Tk_PathName(srcPtr->tkwin), Blt_Itoa(srcPtr->button), (char *)NULL);
- result = Tcl_Eval(interp, Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SourceEventProc --
- *
- * Invoked by Tk_HandleEvent whenever a DestroyNotify event is received
- * on a registered drag&drop source widget.
- *
- *---------------------------------------------------------------------------
- */
-static void
-SourceEventProc(
- ClientData clientData, /* drag&drop registration list */
- XEvent *eventPtr) /* event description */
-{
- Source *srcPtr = (Source *) clientData;
-
- if (eventPtr->type == DestroyNotify) {
- DestroySource(srcPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindTarget --
- *
- * Looks for a Target record in the hash table for drag&drop
- * target widgets. Creates a new record if the widget name is
- * not already registered. Returns a pointer to the desired
- * record.
- *
- *---------------------------------------------------------------------------
- */
-static Target *
-FindTarget(
- DragdropCmdInterpData *dataPtr,
- Tk_Window tkwin) /* Widget pathname for desired record */
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&dataPtr->targetTable, (char *)tkwin);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateTarget --
- *
- * Looks for a Target record in the hash table for drag&drop
- * target widgets. Creates a new record if the widget name is
- * not already registered. Returns a pointer to the desired
- * record.
- *
- *---------------------------------------------------------------------------
- */
-static Target *
-CreateTarget(
- DragdropCmdInterpData *dataPtr,
- Tcl_Interp *interp,
- Tk_Window tkwin) /* Widget pathname for desired record */
-{
- Target *targetPtr;
- int isNew;
-
- targetPtr = Blt_AssertCalloc(1, sizeof(Target));
- targetPtr->display = Tk_Display(tkwin);
- targetPtr->tkwin = tkwin;
- targetPtr->dataPtr = dataPtr;
- Blt_InitHashTable(&targetPtr->handlerTable, BLT_STRING_KEYS);
- targetPtr->hashPtr = Blt_CreateHashEntry(&dataPtr->targetTable,
- (char *)tkwin, &isNew);
- Blt_SetHashValue(targetPtr->hashPtr, targetPtr);
-
- /*
- * Arrange for the target to removed if the host window is destroyed.
- */
- Tk_CreateEventHandler(tkwin, StructureNotifyMask, TargetEventProc,
- targetPtr);
- /*
- * If this is a new target, attach a property to identify
- * window as "drag&drop" target, and arrange for the window
- * to un-register itself when it is destroyed.
- */
- Tk_MakeWindowExist(targetPtr->tkwin);
- AddTargetProperty(interp, targetPtr);
- return targetPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyTarget --
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyTarget(DestroyData data)
-{
- Target *targetPtr = (Target *)data;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&targetPtr->handlerTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- char *cmd;
-
- cmd = Blt_GetHashValue(hPtr);
- if (cmd != NULL) {
- Blt_Free(cmd);
- }
- }
- Blt_DeleteHashTable(&targetPtr->handlerTable);
- if (targetPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&targetPtr->dataPtr->targetTable,
- targetPtr->hashPtr);
- }
- Tk_DeleteEventHandler(targetPtr->tkwin, StructureNotifyMask,
- TargetEventProc, targetPtr);
- Blt_Free(targetPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TargetEventProc --
- *
- * Invoked by Tk_HandleEvent whenever a DestroyNotify event is received
- * on a registered drag&drop target widget.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TargetEventProc(
- ClientData clientData, /* drag&drop registration list */
- XEvent *eventPtr) /* event description */
-{
- Target *targetPtr = (Target *) clientData;
-
- if (eventPtr->type == DestroyNotify) {
-#ifdef WIN32
- /*
- * Under Win32 the properties must be removed before the window
- * can be destroyed.
- */
- RemoveProperty(targetPtr->tkwin);
-#endif
- DestroyTarget((DestroyData)targetPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DndSend --
- *
- * Invoked after a drop operation to send data to the drop
- * application.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DndSend(Source *srcPtr) /* drag&drop source record */
-{
- int status;
- SubstDescriptors subs[3];
- Tcl_DString dString;
- Blt_HashEntry *hPtr;
- const char *dataType;
- const char **targv;
- char *cmd;
-
- /* See if current position is over drop point. */
- if (!OverTarget(srcPtr, srcPtr->token.lastX, srcPtr->token.lastY)) {
- return;
- }
- targv = srcPtr->windowPtr->targetInfo;
- Tcl_DStringInit(&dString);
- Blt_DStringAppendElements(&dString, "send", targv[INTERP_NAME],
- dragDropCmd, "location", (char *)NULL);
- Tcl_DStringAppendElement(&dString, Blt_Itoa(srcPtr->token.lastX));
- Tcl_DStringAppendElement(&dString, Blt_Itoa(srcPtr->token.lastY));
- status = Tcl_Eval(srcPtr->interp, Tcl_DStringValue(&dString));
-
- Tcl_DStringFree(&dString);
- if (status != TCL_OK) {
- goto reject;
- }
- if (targv[DATA_TYPE] == NULL) {
- Blt_HashSearch cursor;
-
- hPtr = Blt_FirstHashEntry(&srcPtr->handlerTable, &cursor);
- dataType = Blt_GetHashKey(&srcPtr->handlerTable, hPtr);
- } else {
- hPtr = Blt_FindHashEntry(&srcPtr->handlerTable, targv[DATA_TYPE]);
- dataType = targv[DATA_TYPE];
- }
- /* Start building the command line here, before we invoke any Tcl
- * commands. The is because the TCL command may let in another
- * drag event and change the target property data. */
- Tcl_DStringInit(&dString);
- Blt_DStringAppendElements(&dString, "send", targv[INTERP_NAME],
- dragDropCmd, "target", targv[TARGET_NAME], "handle", dataType,
- (char *)NULL);
- cmd = NULL;
- if (hPtr != NULL) {
- cmd = Blt_GetHashValue(hPtr);
- }
- if (cmd != NULL) {
- Tcl_DString cmdString;
-
- subs[0].letter = 'i';
- subs[0].value = targv[INTERP_NAME];
- subs[1].letter = 'w';
- subs[1].value = targv[TARGET_NAME];
- subs[2].letter = 'v';
- subs[2].value = srcPtr->pkgCmdResult;
-
- Tcl_DStringInit(&cmdString);
- status = Tcl_Eval(srcPtr->interp,
- ExpandPercents(cmd, subs, 3, &cmdString));
- Tcl_DStringFree(&cmdString);
- if (status != TCL_OK) {
- goto reject;
- }
- Tcl_DStringAppendElement(&dString, Tcl_GetStringResult(srcPtr->interp));
- } else {
- Tcl_DStringAppendElement(&dString, srcPtr->pkgCmdResult);
- }
-
- /*
- * Part 2: Now tell target application to handle the data.
- */
- status = Tcl_Eval(srcPtr->interp, Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- if (status != TCL_OK) {
- goto reject;
- }
- HideToken(&srcPtr->token);
- return;
- reject:
- /*
- * Give failure information to user. If an error occurred and an
- * error proc is defined, then use it to handle the error.
- */
- RejectToken(&srcPtr->token);
- Bgerror(srcPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InitRoot --
- *
- * Invoked at the start of a "drag" operation to capture the
- * positions of all windows on the current root. Queries the
- * entire window hierarchy and determines the placement of each
- * window. Queries the "BltDrag&DropTarget" property info where
- * appropriate. This information is used during the drag
- * operation to determine when the drag&drop token is over a
- * valid drag&drop target.
- *
- * Results:
- * Returns the record for the root window, which contains records
- * for all other windows as children.
- *
- *---------------------------------------------------------------------------
- */
-static void
-InitRoot(Source *srcPtr)
-{
- srcPtr->rootPtr = Blt_AssertCalloc(1, sizeof(AnyWindow));
-#ifdef WIN32
- srcPtr->rootPtr->nativeWindow = GetDesktopWindow();
-#else
- srcPtr->rootPtr->nativeWindow = DefaultRootWindow(srcPtr->display);
-#endif
- srcPtr->windowPtr = NULL;
- QueryWindow(srcPtr->display, srcPtr->rootPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindTopWindow --
- *
- * Searches for the topmost window at a given pair of X-Y coordinates.
- *
- * Results:
- * Returns a pointer to the node representing the window containing
- * the point. If one can't be found, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static AnyWindow *
-FindTopWindow(
- Source *srcPtr,
- int x, int y)
-{
- AnyWindow *rootPtr;
- Blt_ChainLink link;
- AnyWindow *windowPtr;
- WINDOW nativeTokenWindow;
-
- rootPtr = srcPtr->rootPtr;
- if (!rootPtr->initialized) {
- QueryWindow(srcPtr->display, rootPtr);
- }
- if ((x < rootPtr->x1) || (x > rootPtr->x2) ||
- (y < rootPtr->y1) || (y > rootPtr->y2)) {
- return NULL; /* Point is not over window */
- }
- windowPtr = rootPtr;
-
- nativeTokenWindow = (WINDOW)Blt_GetWindowId(srcPtr->token.tkwin);
- /*
- * The window list is ordered top to bottom, so stop when we find
- * the first child that contains the X-Y coordinate. It will be
- * the topmost window in that hierarchy. If none exists, then we
- * already have the topmost window.
- */
- descend:
- for (link = Blt_Chain_FirstLink(rootPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- rootPtr = Blt_Chain_GetValue(link);
- if (!rootPtr->initialized) {
- QueryWindow(srcPtr->display, rootPtr);
- }
- if (rootPtr->nativeWindow == nativeTokenWindow) {
- continue; /* Don't examine the token window. */
- }
- if ((x >= rootPtr->x1) && (x <= rootPtr->x2) &&
- (y >= rootPtr->y1) && (y <= rootPtr->y2)) {
- /*
- * Remember the last window containing the pointer and
- * descend into its window hierarchy. We'll look for a
- * child that also contains the pointer.
- */
- windowPtr = rootPtr;
- goto descend;
- }
- }
- return windowPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OverTarget --
- *
- * Checks to see if a compatible drag&drop target exists at the
- * given position. A target is "compatible" if it is a drag&drop
- * window, and if it has a handler that is compatible with the
- * current source window.
- *
- * Results:
- * Returns a pointer to a structure describing the target, or NULL
- * if no compatible target is found.
- *
- *---------------------------------------------------------------------------
- */
-static int
-OverTarget(
- Source *srcPtr, /* drag&drop source window */
- int x, int y) /* current drag&drop location
- * (in virtual coords) */
-{
- int virtX, virtY;
- int dummy;
- AnyWindow *newPtr, *oldPtr;
- const char **argv;
- int argc;
- const unsigned char *data;
- int result;
-
- /*
- * If no window info has been been gathered yet for this target,
- * then abort this call. This probably means that the token is
- * moved before it has been properly built.
- */
- if (srcPtr->rootPtr == NULL) {
- return FALSE;
- }
- if (srcPtr->sendTypes == NULL) {
- return FALSE; /* Send is turned off. */
- }
-
- /* Adjust current location for virtual root windows. */
- Tk_GetVRootGeometry(srcPtr->tkwin, &virtX, &virtY, &dummy, &dummy);
- x += virtX;
- y += virtY;
-
- oldPtr = srcPtr->windowPtr;
- srcPtr->windowPtr = NULL;
-
- newPtr = FindTopWindow(srcPtr, x, y);
- if (newPtr == NULL) {
- return FALSE; /* Not over a window. */
- }
- if ((!srcPtr->selfTarget) &&
- (GetNativeWindow(srcPtr->tkwin) == newPtr->nativeWindow)) {
- return FALSE; /* If the self-target flag isn't set,
- * don't allow the source window to
- * drop onto itself. */
- }
- if (newPtr == oldPtr) {
- srcPtr->windowPtr = oldPtr;
- /* No need to collect the target information if we're still
- * over the same window. */
- return (newPtr->targetInfo != NULL);
- }
-
- /* See if this window has a "BltDrag&DropTarget" property. */
- data = GetProperty(srcPtr->display, newPtr->nativeWindow);
- if (data == NULL) {
- return FALSE; /* No such property on window. */
- }
- result = Tcl_SplitList(srcPtr->interp, (char *)data, &argc, &argv);
- XFree((char *)data);
- if (result != TCL_OK) {
- return FALSE; /* Malformed property list. */
- }
- srcPtr->windowPtr = newPtr;
- /* Interpreter name, target name, type1, type2, ... */
- if (argc > 2) {
- const char **s;
- int count;
- int i;
-
- /*
- * The candidate target has a list of possible types.
- * Compare this with what types the source is willing to
- * transmit and compress the list down to just the matching
- * types. It's up to the target to request the specific type
- * it wants.
- */
- count = 2;
- for (i = 2; i < argc; i++) {
- for (s = srcPtr->sendTypes; *s != NULL; s++) {
- if (((**s == 'a') && (strcmp(*s, "all") == 0)) ||
- ((**s == argv[i][0]) && (strcmp(*s, argv[i]) == 0))) {
- argv[count++] = argv[i];
- }
- }
- }
- if (count == 2) {
- Blt_Free(argv);
- fprintf(stderr, "source/target mismatch: No matching types\n");
- return FALSE; /* No matching data type. */
- }
- argv[count] = NULL;
- }
- newPtr->targetInfo = argv;
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RemoveWindow --
- *
- *---------------------------------------------------------------------------
- */
-static void
-RemoveWindow(AnyWindow *windowPtr) /* window rep to be freed */
-{
- AnyWindow *childPtr;
- Blt_ChainLink link;
-
- /* Throw away leftover slots. */
- for (link = Blt_Chain_FirstLink(windowPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- childPtr = Blt_Chain_GetValue(link);
- RemoveWindow(childPtr);
- }
- Blt_Chain_Destroy(windowPtr->chain);
- if (windowPtr->targetInfo != NULL) {
- Blt_Free(windowPtr->targetInfo);
- }
- Blt_Free(windowPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * QueryWindow --
- *
- * Invoked during "drag" operations. Digs into the root window
- * hierarchy and caches the resulting information.
- * If a point coordinate lies within an uninitialized AnyWindow,
- * this routine is called to query window coordinates and
- * drag&drop info. If this particular window has any children,
- * more uninitialized AnyWindow structures are allocated.
- * Further queries will cause these structures to be initialized
- * in turn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-QueryWindow(
- Display *display,
- AnyWindow *winPtr) /* window rep to be initialized */
-{
- int visible;
-
- if (winPtr->initialized) {
- return;
- }
- /*
- * Query for the window coordinates.
- */
- visible = GetWindowRegion(display, winPtr->nativeWindow,
- &winPtr->x1, &winPtr->y1, &winPtr->x2, &winPtr->y2);
- if (visible) {
- Blt_ChainLink link;
- Blt_Chain chain;
- AnyWindow *childPtr;
-
- /*
- * Collect a list of child windows, sorted in z-order. The
- * topmost window will be first in the list.
- */
- chain = GetWindowZOrder(display, winPtr->nativeWindow);
-
- /* Add and initialize extra slots if needed. */
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- childPtr = Blt_AssertCalloc(1, sizeof(AnyWindow));
- childPtr->initialized = FALSE;
- childPtr->nativeWindow = (WINDOW)Blt_Chain_GetValue(link);
- childPtr->parentPtr = winPtr;
- Blt_Chain_SetValue(link, childPtr);
- }
- winPtr->chain = chain;
- } else {
- /* If it's not viewable don't bother doing anything else. */
- winPtr->x1 = winPtr->y1 = winPtr->x2 = winPtr->y2 = -1;
- winPtr->chain = NULL;
- }
- winPtr->initialized = TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AddTargetProperty --
- *
- * Attaches a drag&drop property to the given target window.
- * This property allows us to recognize the window later as a
- * valid target. It also stores important information including
- * the interpreter managing the target and the pathname of the
- * target window. Usually this routine is called when the target
- * is first registered or first exposed (so that the X-window
- * really exists).
- *
- *---------------------------------------------------------------------------
- */
-static void
-AddTargetProperty(
- Tcl_Interp *interp,
- Target *targetPtr) /* drag&drop target window data */
-{
- Tcl_DString dString;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- if (targetPtr->tkwin == NULL) {
- return;
- }
- Tcl_DStringInit(&dString);
- /*
- * Each target window's dnd property contains
- *
- * 1. name of the application (ie. the interpreter's name).
- * 2. Tk path name of the target window.
- * 3. List of all the data types that can be handled. If none
- * are listed, then all can be handled.
- */
- Tcl_DStringAppendElement(&dString, Tk_Name(Tk_MainWindow(interp)));
- Tcl_DStringAppendElement(&dString, Tk_PathName(targetPtr->tkwin));
- for (hPtr = Blt_FirstHashEntry(&targetPtr->handlerTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Tcl_DStringAppendElement(&dString,
- Blt_GetHashKey(&targetPtr->handlerTable, hPtr));
- }
- SetProperty(targetPtr->tkwin, Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExpandPercents --
- *
- * Expands all percent substitutions found in the input "str"
- * that match specifications in the "subs" list. Any percent
- * field that is not found in the "subs" list is left alone.
- * Returns a string that remains valid until the next call to
- * this routine.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-ExpandPercents(
- const char *string, /* Incoming command string */
- SubstDescriptors *subsArr, /* Array of known substitutions */
- int nSubs, /* Number of elements in subs array */
- Tcl_DString *resultPtr)
-{
- const char *chunk, *p;
- char letter;
- int i;
-
- /*
- * Scan through the copy of the input string, look for
- * the next '%' character, and try to make the substitution.
- * Continue doing this to the end of the string.
- */
- chunk = p = string;
- while ((p = strchr(p, '%')) != NULL) {
-
- /* Copy up to the percent sign. Repair the string afterwards */
- Tcl_DStringAppend(resultPtr, chunk, p - chunk);
-
- /* Search for a matching substitution rule */
- letter = *(p + 1);
- for (i = 0; i < nSubs; i++) {
- if (subsArr[i].letter == letter) {
- break;
- }
- }
- if (i < nSubs) {
- /* Make the substitution */
- Tcl_DStringAppend(resultPtr, subsArr[i].value, -1);
- } else {
- /* Copy in the %letter verbatim */
- char verbatim[3];
-
- verbatim[0] = '%';
- verbatim[1] = letter;
- verbatim[2] = '\0';
- Tcl_DStringAppend(resultPtr, verbatim, -1);
- }
- p += 2; /* Skip % + letter */
- if (letter == '\0') {
- p += 1; /* Premature % substitution (end of string) */
- }
- chunk = p;
- }
- /* Pick up last chunk if a substition wasn't the last thing in the string */
- if (*chunk != '\0') {
- Tcl_DStringAppend(resultPtr, chunk, -1);
- }
- return Tcl_DStringValue(resultPtr);
-}
-
-
-/*ARGSUSED*/
-static int
-DragOp(
- ClientData clientData,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- DragdropCmdInterpData *dataPtr = clientData;
- int x, y;
- Token *tokenPtr;
- int status;
- Source *srcPtr;
- SubstDescriptors subst[2];
- int active;
- const char *result;
-
- /*
- * HANDLE: drag&drop drag <path> <x> <y>
- */
- if ((GetSourceFromObj(dataPtr, interp, objv[2], &srcPtr) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- tokenPtr = &srcPtr->token;
-
- tokenPtr->lastX = dataPtr->locX = x; /* Save drag&drop location */
- tokenPtr->lastY = dataPtr->locY = y;
-
- /* If HideToken() is pending, then do it now! */
- if (tokenPtr->timer != 0) {
- Tcl_DeleteTimerHandler(tokenPtr->timer);
- HideToken(tokenPtr);
- }
-
- /*
- * If pkgCmd is in progress, then ignore subsequent calls
- * until it completes. Only perform drag if pkgCmd
- * completed successfully and token window is mapped.
- */
- if ((!Tk_IsMapped(tokenPtr->tkwin)) && (!srcPtr->pkgCmdInProgress)) {
- Tcl_DString dString;
-
- /*
- * No list of send handlers? Then source is disabled.
- * Abort drag quietly.
- */
- if (srcPtr->sendTypes == NULL) {
- return TCL_OK;
- }
- /*
- * No token command? Then cannot build token.
- * Signal error.
- */
- if (srcPtr->pkgCmd == NULL) {
- Tcl_AppendResult(interp, "missing -packagecmd: ", objv[2],
- (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * Execute token command to initialize token window.
- */
- srcPtr->pkgCmdInProgress = TRUE;
- subst[0].letter = 'W';
- subst[0].value = Tk_PathName(srcPtr->tkwin);
- subst[1].letter = 't';
- subst[1].value = Tk_PathName(tokenPtr->tkwin);
-
- Tcl_DStringInit(&dString);
- status = Tcl_Eval(srcPtr->interp,
- ExpandPercents(srcPtr->pkgCmd, subst, 2, &dString));
- Tcl_DStringFree(&dString);
-
- srcPtr->pkgCmdInProgress = FALSE;
-
- result = Tcl_GetStringResult(interp);
- /*
- * Null string from the package command?
- * Then quietly abort the drag&drop operation.
- */
- if (result[0] == '\0') {
- return TCL_OK;
- }
-
- /* Save result of token command for send command. */
- if (srcPtr->pkgCmdResult != NULL) {
- Blt_Free(srcPtr->pkgCmdResult);
- }
- srcPtr->pkgCmdResult = Blt_AssertStrdup(result);
- if (status != TCL_OK) {
- /*
- * Token building failed. If an error handler is defined,
- * then signal the error. Otherwise, abort quietly.
- */
- Bgerror(srcPtr);
- return TCL_OK;
- }
- /* Install token cursor. */
- if (tokenPtr->cursor != None) {
- Tk_Cursor cursor;
-
- /* Save the old cursor */
- cursor = GetWidgetCursor(srcPtr->interp, srcPtr->tkwin);
- if (srcPtr->cursor != None) {
- Tk_FreeCursor(srcPtr->display, srcPtr->cursor);
- }
- srcPtr->cursor = cursor;
- /* Temporarily install the token cursor */
- Tk_DefineCursor(srcPtr->tkwin, tokenPtr->cursor);
- }
- /*
- * Get ready to drag token window...
- * 1) Cache info for all windows on root
- * 2) Map token window to begin drag operation
- */
- if (srcPtr->rootPtr != NULL) {
- RemoveWindow(srcPtr->rootPtr);
- }
- InitRoot(srcPtr);
-
- dataPtr->nActive++; /* One more drag&drop window active */
-
- if (Tk_WindowId(tokenPtr->tkwin) == None) {
- Tk_MakeWindowExist(tokenPtr->tkwin);
- }
- if (!Tk_IsMapped(tokenPtr->tkwin)) {
- Tk_MapWindow(tokenPtr->tkwin);
- }
- RaiseToken(tokenPtr);
- }
-
- /* Arrange to update status of token window. */
- Tcl_CancelIdleCall(UpdateToken, srcPtr);
-
- active = OverTarget(srcPtr, x, y);
- if (tokenPtr->active != active) {
- tokenPtr->active = active;
- Tcl_DoWhenIdle(UpdateToken, srcPtr);
- }
- MoveToken(srcPtr, tokenPtr); /* Move token window to current drag point. */
- return TCL_OK;
-}
-
-/*
- * HANDLE: drag&drop drop <path> <x> <y>
- */
-/*ARGSUSED*/
-static int
-DropOp(
- ClientData clientData,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- DragdropCmdInterpData *dataPtr = clientData;
- Source *srcPtr;
- Token *tokenPtr;
- int x, y;
-
- if ((GetSourceFromObj(dataPtr, interp, objv[2], &srcPtr) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- tokenPtr = &srcPtr->token;
- tokenPtr->lastX = dataPtr->locX = x; /* Save drag&drop location */
- tokenPtr->lastY = dataPtr->locY = y;
-
- /* Put the cursor back to its usual state. */
- if (srcPtr->cursor == None) {
- Tk_UndefineCursor(srcPtr->tkwin);
- } else {
- Tk_DefineCursor(srcPtr->tkwin, srcPtr->cursor);
- }
- Tcl_CancelIdleCall(UpdateToken, srcPtr);
-
- /*
- * Make sure that token window was not dropped before it
- * was either mapped or packed with info.
- */
- if ((Tk_IsMapped(tokenPtr->tkwin)) && (!srcPtr->pkgCmdInProgress)) {
- int active;
-
- active = OverTarget(srcPtr, tokenPtr->lastX, tokenPtr->lastY);
- if (tokenPtr->active != active) {
- tokenPtr->active = active;
- UpdateToken(srcPtr);
- }
- if (srcPtr->sendTypes != NULL) {
- if (tokenPtr->active) {
- DndSend(srcPtr);
- } else {
- HideToken(tokenPtr);
- }
- }
- dataPtr->nActive--; /* One less active token window. */
- }
- return TCL_OK;
-}
-
-/*
- * HANDLE: drag&drop active
- */
-/*ARGSUSED*/
-static int
-ActiveOp(
- ClientData clientData,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- DragdropCmdInterpData *dataPtr = clientData;
-
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), (dataPtr->nActive > 0));
- return TCL_OK;
-}
-
-/*
- * HANDLE: drag&drop location ?<x> <y>?
- */
-static int
-LocationOp(
- ClientData clientData,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- DragdropCmdInterpData *dataPtr = clientData;
- Tcl_Obj *listObjPtr;
-
- if ((objc != 2) && (objc != 4)) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " location ?x y?\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (objc == 4) {
- int x, y;
-
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- dataPtr->locX = x;
- dataPtr->locY = y;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(dataPtr->locX));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(dataPtr->locY));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- * HANDLE: drag&drop token <pathName>
- */
-static int
-TokenOp(
- ClientData clientData,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- DragdropCmdInterpData *dataPtr = clientData;
- Source *srcPtr;
-
- if (GetSourceFromObj(dataPtr, interp, objv[2], &srcPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((objc > 3) &&
- (ConfigureToken(interp, srcPtr, objc - 3, objv + 3) != TCL_OK)) {
- return TCL_ERROR;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- Tk_PathName(srcPtr->token.tkwin), -1);
- return TCL_OK;
-}
-
-static int
-HandlerOpOp(Source *srcPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- const char *cmd;
- int isNew;
-
- /*
- * HANDLE: drag&drop source <pathName> handler \
- * ?<data>? ?<scmd>...?
- */
- if (objc == 4) {
- /* Show source handler data types */
- for (hPtr = Blt_FirstHashEntry(&srcPtr->handlerTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Tcl_AppendElement(interp,
- Blt_GetHashKey(&srcPtr->handlerTable, hPtr));
- }
- return TCL_OK;
- }
- hPtr = Blt_CreateHashEntry(&srcPtr->handlerTable, Tcl_GetString(objv[4]),
- &isNew);
-
- /*
- * HANDLE: drag&drop source <pathName> handler <data>
- *
- * Create the new <data> type if it doesn't already
- * exist, and return the code associated with it.
- */
- if (objc == 5) {
- cmd = Blt_GetHashValue(hPtr);
- if (cmd == NULL) {
- cmd = "";
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), cmd, -1);
- return TCL_OK;
- }
- /*
- * HANDLE: drag&drop source <pathName> handler \
- * <data> <cmd> ?<arg>...?
- *
- * Create the new <data> type and set its command
- */
- cmd = ConcatArgs(objc - 5, objv + 5);
- Blt_SetHashValue(hPtr, cmd);
- return TCL_OK;
-}
-
-/*
- * HANDLE: drag&drop source
- * drag&drop source <pathName> ?options...?
- * drag&drop source <pathName> handler ?<data>? ?<scmd> <arg>...?
- */
-static int
-SourceOp(
- ClientData clientData,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- DragdropCmdInterpData *dataPtr = clientData;
- Source *srcPtr;
- int isNew;
- Token *tokenPtr;
-
- if (objc == 2) {
- Blt_HashSearch cursor;
- Blt_HashEntry *hPtr;
- Tk_Window tkwin;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->sourceTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- tkwin = (Tk_Window)Blt_GetHashKey(&dataPtr->sourceTable, hPtr);
- Tcl_AppendElement(interp, Tk_PathName(tkwin));
- }
- return TCL_OK;
- }
- /*
- * Find or create source info...
- */
- srcPtr = CreateSource(dataPtr, interp, objv[2], &isNew);
- if (srcPtr == NULL) {
- return TCL_ERROR;
- }
- tokenPtr = &srcPtr->token;
- if (objc > 3) {
- char c;
- int length;
- int status;
- char *string;
-
- /*
- * HANDLE: drag&drop source <pathName> ?options...?
- */
- string = Tcl_GetStringFromObj(objv[3], &length);
- c = string[0];
-
- if (c == '-') {
- if (objc == 3) {
- status = Blt_ConfigureInfoFromObj(interp, tokenPtr->tkwin,
- configSpecs, (char *)srcPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 4) {
- status = Blt_ConfigureInfoFromObj(interp, tokenPtr->tkwin,
- configSpecs, (char *)srcPtr, objv[3], 0);
- } else {
- status = ConfigureSource(interp, srcPtr, objc - 3, objv + 3,
- BLT_CONFIG_OBJV_ONLY);
- }
- if (status != TCL_OK) {
- return TCL_ERROR;
- }
- } else if ((c == 'h') && strncmp(string, "handler", length) == 0) {
- return HandlerOpOp(srcPtr, interp, objc, objv);
- } else {
- Tcl_AppendResult(interp, "bad operation \"", string,
- "\": must be \"handler\" or a configuration option",
- (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (isNew) {
- /*
- * Create the window for the drag&drop token...
- */
- if (CreateToken(interp, srcPtr) != TCL_OK) {
- DestroySource(srcPtr);
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- * HANDLE: drag&drop target ?<pathName>? ?handling info...?
- */
-static int
-TargetOp(
- ClientData clientData,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- DragdropCmdInterpData *dataPtr = clientData;
- SubstDescriptors subst[2];
- Tk_Window tkwin;
- Blt_HashEntry *hPtr;
- Target *targetPtr;
- int isNew;
- char *string;
-
- if (objc == 2) {
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->targetTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- tkwin = (Tk_Window)Blt_GetHashKey(&dataPtr->targetTable, hPtr);
- Tcl_AppendElement(interp, Tk_PathName(tkwin));
- }
- return TCL_OK;
- }
- string = Tcl_GetString(objv[2]);
- tkwin = Tk_NameToWindow(interp, string, dataPtr->tkMain);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- targetPtr = FindTarget(dataPtr, tkwin);
- if (targetPtr == NULL) {
- targetPtr = CreateTarget(dataPtr, interp, tkwin);
- }
- if (targetPtr == NULL) {
- return TCL_ERROR;
- }
-
- if (objc >= 4) {
- string = Tcl_GetString(objv[3]);
- if (strcmp(string, "handler") == 0) {
- /*
- * HANDLE: drag&drop target <pathName> handler drag&drop
- * target <pathName> handler ?<data> <cmd> <arg>...?
- */
-
- if (objc == 4) {
- Blt_HashSearch cursor;
-
- for (hPtr =Blt_FirstHashEntry(&targetPtr->handlerTable,&cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Tcl_AppendElement(interp,
- Blt_GetHashKey(&targetPtr->handlerTable, hPtr));
- }
- return TCL_OK;
- } else if (objc >= 6) {
- char *cmd;
-
- /*
- * Process handler definition
- */
- hPtr = Blt_CreateHashEntry(&targetPtr->handlerTable,
- Tcl_GetString(objv[4]), &isNew);
- cmd = ConcatArgs(objc - 5, objv + 5);
- if (hPtr != NULL) {
- const char *oldCmd;
-
- oldCmd = Blt_GetHashValue(hPtr);
- if (oldCmd != NULL) {
- Blt_Free(oldCmd);
- }
- }
- Blt_SetHashValue(hPtr, cmd);
- /*
- * Update the target property on the window.
- */
- AddTargetProperty(interp, targetPtr);
- return TCL_OK;
- }
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ",
- Tcl_GetString(objv[1]), " ",
- Tcl_GetString(objv[2]), " ",
- Tcl_GetString(objv[3]), " data command ?arg arg...?",
- (char *)NULL);
- return TCL_ERROR;
- } else if (strcmp(string, "handle") == 0) {
- /*
- * HANDLE: drag&drop target <pathName> handle <data> ?<value>?
- */
- Tcl_DString dString;
- int result;
- char *cmd;
-
- if (objc < 5 || objc > 6) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ",
- Tcl_GetString(objv[1]), " ",
- Tcl_GetString(objv[2]), " handle data ?value?",
- (char *)NULL);
- return TCL_ERROR;
- }
- hPtr = Blt_FindHashEntry(&targetPtr->handlerTable,
- Tcl_GetString(objv[4]));
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "target can't handle datatype: ",
- Tcl_GetString(objv[4]), (char *)NULL);
- return TCL_ERROR; /* no handler found */
- }
- cmd = Blt_GetHashValue(hPtr);
- if (cmd != NULL) {
- subst[0].letter = 'W';
- subst[0].value = Tk_PathName(targetPtr->tkwin);
- subst[1].letter = 'v';
- if (objc > 5) {
- subst[1].value = Tcl_GetString(objv[5]);
- } else {
- subst[1].value = "";
- }
- Tcl_DStringInit(&dString);
- result = Tcl_Eval(interp,
- ExpandPercents(cmd, subst, 2, &dString));
- Tcl_DStringFree(&dString);
- return result;
- }
- return TCL_OK;
- }
- }
- Tcl_AppendResult(interp, "usage: ", Tcl_GetString(objv[0]), " target ",
- Tcl_GetString(objv[2]), " handler ?data command arg arg...?\n or: ",
- Tcl_GetString(objv[0]), " target ",
- Tcl_GetString(objv[2]), " handle <data>", (char *)NULL);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DragDropCmd --
- *
- * Invoked by TCL whenever the user issues a drag&drop command.
- * Handles the following syntax:
- *
- * drag&drop source
- * drag&drop source <pathName> ?options...?
- * drag&drop source <pathName> handler ?<dataType>? ?<cmd> <arg>...?
- *
- * drag&drop target
- * drag&drop target <pathName> handler ?<dataType> <cmd> <arg>...?
- * drag&drop target <pathName> handle <dataType> ?<value>?
- *
- * drag&drop token <pathName>
- * drag&drop drag <pathName> <x> <y>
- * drag&drop drop <pathName> <x> <y>
- *
- * drag&drop active
- * drag&drop location ?<x> <y>?
- *
- *---------------------------------------------------------------------------
- */
-
-static Blt_OpSpec dndOps[] =
-{
- {"active", 1, ActiveOp, 2, 2, "",},
- {"drag", 2, DragOp, 5, 5, "pathname x y",},
- {"drop", 2, DropOp, 5, 5, "pathname x y",},
- {"location", 1, LocationOp, 2, 4, "?x y?",},
- {"source", 1, SourceOp, 2, 0, "?pathname? ?options...?",},
- {"target", 2, TargetOp, 2, 0, "?pathname? ?options...?",},
- {"token", 2, TokenOp, 2, 0, "?option value?...",},
-};
-
-static int nDndOps = sizeof(dndOps) / sizeof(Blt_OpSpec);
-
-/*ARGSUSED*/
-static int
-DragDropCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter */
- int objc, /* # of arguments */
- Tcl_Obj *const *objv) /* Argument strings */
-{
- Tcl_ObjCmdProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nDndOps, dndOps, BLT_OP_ARG1, objc, objv,0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (clientData, interp, objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DragDropCmdInitProc --
- *
- * Adds the drag&drop command to the given interpreter. Should
- * be invoked to properly install the command whenever a new
- * interpreter is created.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_DragDropCmdInitProc(Tcl_Interp *interp) /* interpreter to be updated */
-{
- static Blt_InitCmdSpec cmdSpec = { "drag&drop", DragDropCmd, };
-
- cmdSpec.clientData = GetDragdropCmdInterpData(interp);
-#ifndef WIN32
- if (!initialized) {
- dndAtom = XInternAtom(Tk_Display(Tk_MainWindow(interp)), propName,
- False);
- initialized = TRUE;
- }
-#endif
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-#endif /* NO_DRAGDROP */
diff --git a/blt3.0.1/src/bltDtCmd.c b/blt3.0.1/src/bltDtCmd.c
deleted file mode 100644
index d856705..0000000
--- a/blt3.0.1/src/bltDtCmd.c
+++ /dev/null
@@ -1,7776 +0,0 @@
-
-/*
- *
- * bltDtCmd.c --
- *
- * Copyright 1998-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- blt::datatable create t0 t1 t2
- blt::datatable names
- t0 destroy
- -or-
- blt::datatable destroy t0
- blt::datatable copy table at node table at node -recurse -tags
-
- table move node after|before|into t2 at node
-
- $t apply -recurse $root command arg arg
-
- $t attach tablename
-
- $t children $n
- t0 copy node1 node2 node3 node4 node5 destName
- $t delete $n...
- $t delete 0
- $t delete 0 10
- $t delete all
- $t depth $n
- $t dump
- $t dump -file fileName
- $t dup $t2
- $t find $root -name pat -name pattern
- $t firstchild $n
- $t get $n $key
- $t get $n $key(abc)
- $t index $n
- $t insert $parent $switches?
- $t isancestor $n1 $n2
- $t isbefore $n1 $n2
- $t isleaf $n
- $t lastchild $n
- $t move $n1 after|before|into $n2
- $t next $n
- $t nextsibling $n
- $t path $n1 $n2 $n3...
- $t parent $n
- $t previous $n
- $t prevsibling $n
- $t restore $root data -overwrite
- $t root ?$n?
-
- $t set $n $key $value ?$key $value?
- $t size $n
- $t slink $n $t2@$node ???
- $t sort -recurse $root
-
- $t tag delete tag1 tag2 tag3...
- $t tag names
- $t tag nodes $tag
- $t tag set $n tag1 tag2 tag3...
- $t tag unset $n tag1 tag2 tag3...
-
- $t trace create $n $key how command
- $t trace delete id1 id2 id3...
- $t trace names
- $t trace info $id
-
- $t unset $n key1 key2 key3...
-
- $t row notify $row ?flags? command
- $t column notify $column ?flags? command arg arg arg
- $t notify create -oncreate -ondelete -onmove command
- $t notify create -oncreate -ondelete -onmove -onsort command arg arg arg
- $t notify delete id1 id2 id3
- $t notify names
- $t notify info id
-
- for { set n [$t firstchild $node] } { $n >= 0 } {
- set n [$t nextsibling $n] } {
- }
- foreach n [$t children $node] {
-
- }
- set n [$t next $node]
- set n [$t previous $node]
-*/
-
-/*
- *
- * datatable create ?name?
- * datatable names
- * datatable destroy $table
- *
- * $t column label ?newLabel?
- * $t column labels ?index newLabel...?
- *
- * $t column index $c
- * $t column indices $c
- * $t column get $c
- * $t column delete $r $r $r $r
- * $t column extend label label label...
- * $t column get $column
- * $t column insert $column "label"
- * $t column select $expr
- * $t column set {1 20} $list
- * $t column set 1-20 $list
- * $t column set 1:20 $list
- * $t column trace $row rwu proc
- * $t column unset $column
- * $t copy fromTable
- * $t copy newTable
- * $t dup newTable -includerows $tag $tag $tag -excludecolumns $tag $tag
- * $t get $row $column $value ?$defValue?
- * $t pack
- * $t row delete row row row row
- * $t row create -tags $tags -label $label -before -after
- * $t row extend 1
- * $t row get $row -nolabels
- * $t row create $column "label" "label"
- * $t row select $expr
- * $t row set $row $list -nolabels
- * $t row trace $row rwu proc
- * $t row unset $row
- * $t row tag add where expr
- * $t row tag forget $tag $tag
- * $t row tag delete $tag $row $row $row
- * $t row tag find $row ?pattern*?
- * $t row tag add $row tag tag tag tag
- * $t row tag unset $row tag tag tag
- * $t row find $expr
- * $t row unique $rowexpr
- * $t select $expr
- * $t set $row $column $value
- * $t trace $row $column rwu proc
- * $t unset $row $column
- * $t column find $expr
- * $t import -format {csv} -overwrite fileName
- * $t export -format {csv,xml} fileName
- * $t dumpdata -deftags -deflabels -columns "tags" -rows "tags" string
- * $t dump -notags -nolabels -columns "tags" -rows "tags" fileName
- * $t dup $destTable -notags -nolabels -columns "tags" -rows "tags"
- * $t restore -overwrite -notags -nolabels string
- * $t restoredata -overwrite -notags -nolabels -data string
- * $t restore -overwrite -notags -nolabels fileName
- *
- * $t row hide label
- * $t row unhide label
- *
- * $t emptyvalue ?value?
- * $t key set ?key key key?
- * $t key lookup ?key key key?
- */
-/*
- * $t import -format tree {tree 10}
- * $t import -format csv $fileName.csv
- *
- * $t import tree $tree 10 ?switches?
- * $t import csv ?switches? fileName.xml
- * $t importdata csv -separator , -quote " $fileName.csv
- * $t import csv -separator , -quote " -data string
- * $t exportdata xml ?switches? ?$fileName.xml?
- * $t export csv -separator \t -quote ' $fileName.csv
- * $t export csv -separator \t -quote '
- * $t export -format dbm $fileName.dbm
- * $t export -format db $fileName.db
- * $t export -format csv $fileName.csv
- */
-/*
- * $vector attach "$t c $column"
- * $vector detach
- * $graph element create x -x "${table} column ${column}" \
- * "table0 r abc"
- * $tree attach 0 $t
- */
-
-#include <bltInt.h>
-#include "bltOp.h"
-#include <bltNsUtil.h>
-#include <bltSwitch.h>
-#include <bltHash.h>
-#include <bltVar.h>
-
-#include <bltDataTable.h>
-
-#include <ctype.h>
-
-#define TABLE_THREAD_KEY "BLT DataTable Command Interface"
-
-/*
- * TableCmdInterpData --
- *
- * Structure containing global data, used on a interpreter by interpreter
- * basis.
- *
- * This structure holds the hash table of instances of datatable commands
- * associated with a particular interpreter.
- */
-typedef struct {
- Blt_HashTable instTable; /* Tracks tables in use. */
- Tcl_Interp *interp;
- Blt_HashTable fmtTable;
- Blt_HashTable findTable; /* Tracks temporary "find" search
- * information keyed by a specific
- * namespace. */
-} TableCmdInterpData;
-
-typedef struct {
- long freq; /* Frequency of value */
- const char *value; /* String representation of value. */
-} UniqueValue;
-
-/*
- * Cmd --
- *
- * Structure representing the TCL command used to manipulate the
- * underlying table object.
- *
- * This structure acts as a shell for a table object. A table object
- * maybe shared by more than one client. This shell provides Tcl
- * commands to access and change values as well as the structure of the
- * table itself. It manages the traces and notifier events that it
- * creates, providing a TCL interface to those facilities. It also
- * provides a user-selectable value for empty-cell values.
- */
-typedef struct {
- Tcl_Interp *interp; /* Interpreter this command is
- * associated with. */
- Blt_Table table; /* Handle representing the client
- * table. */
- Tcl_Command cmdToken; /* Token for TCL command representing
- * this table. */
- const char *emptyValue; /* String representing an empty value in
- * the table. */
- Blt_HashTable *tablePtr; /* Pointer to hash table containing a
- * pointer to this structure. Used to
- * delete * this table entry from the
- * table. */
- Blt_HashEntry *hPtr; /* Pointer to the hash table entry for
- * this table in the interpreter
- * specific hash table. */
- int nextTraceId; /* Used to generate trace id
- * strings. */
- Blt_HashTable traceTable; /* Table of active traces. Maps trace
- * ids back to their TraceInfo
- * records. */
- int nextNotifyId; /* Used to generate notify id
- * strings. */
- Blt_HashTable notifyTable; /* Table of event handlers. Maps
- * notify ids back to their NotifyInfo
- * records. */
-} Cmd;
-
-typedef struct {
- const char *name; /* Name of format. */
- int isLoaded;
- Blt_TableImportProc *importProc;
- Blt_TableExportProc *exportProc;
-} DataFormat;
-
-
-typedef struct {
- Tcl_Obj *cmd0;
- Tcl_Interp *interp;
-} CompareData;
-
-/*
- * TraceInfo --
- *
- * Structure containing information about a trace set from this command
- * shell.
- *
- * This auxillary structure houses data to be used for a callback to a
- * Tcl procedure when a table object trace fires. It is stored in a hash
- * table in the Dt_Cmd structure to keep track of traces issued by this
- * shell.
- */
-typedef struct {
- Blt_TableTrace trace;
- Cmd *cmdPtr;
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
- int type;
- int cmdc;
- Tcl_Obj **cmdv;
-} TraceInfo;
-
-/*
- * NotifierInfo --
- *
- * Structure containing information about a notifier set from
- * this command shell.
- *
- * This auxillary structure houses data to be used for a callback
- * to a TCL procedure when a table object notify event fires. It
- * is stored in a hash table in the Dt_Cmd structure to keep
- * track of notifiers issued by this shell.
- */
-typedef struct {
- Blt_TableNotifier notifier;
- Cmd *cmdPtr;
- Blt_HashEntry *hPtr;
- int cmdc;
- Tcl_Obj **cmdv;
-} NotifierInfo;
-
-BLT_EXTERN Blt_SwitchFreeProc Blt_Table_ColumnIterFreeProc;
-BLT_EXTERN Blt_SwitchFreeProc Blt_Table_RowIterFreeProc;
-BLT_EXTERN Blt_SwitchParseProc Blt_Table_ColumnIterSwitchProc;
-BLT_EXTERN Blt_SwitchParseProc Blt_Table_RowIterSwitchProc;
-static Blt_SwitchParseProc TableSwitchProc;
-static Blt_SwitchFreeProc TableFreeProc;
-static Blt_SwitchParseProc PositionSwitch;
-static Blt_SwitchParseProc TypeSwitchProc;
-
-static Blt_SwitchCustom columnIterSwitch = {
- Blt_Table_ColumnIterSwitchProc, Blt_Table_ColumnIterFreeProc, 0,
-};
-static Blt_SwitchCustom rowIterSwitch = {
- Blt_Table_RowIterSwitchProc, Blt_Table_RowIterFreeProc, 0,
-};
-static Blt_SwitchCustom tableSwitch = {
- TableSwitchProc, TableFreeProc, 0,
-};
-static Blt_SwitchCustom typeSwitch = {
- TypeSwitchProc, NULL, 0,
-};
-
-#define INSERT_BEFORE (ClientData)(1<<0)
-#define INSERT_AFTER (ClientData)(1<<1)
-
-#define INSERT_ROW (BLT_SWITCH_USER_BIT<<1)
-#define INSERT_COL (BLT_SWITCH_USER_BIT<<2)
-
-static Blt_SwitchCustom beforeSwitch = {
- PositionSwitch, NULL, INSERT_BEFORE,
-};
-static Blt_SwitchCustom afterSwitch = {
- PositionSwitch, NULL, INSERT_AFTER,
-};
-
-typedef struct {
- Cmd *cmdPtr;
- Blt_TableRow row; /* Index where to install new row or
- * column. */
- Blt_TableColumn column;
- const char *label; /* New label. */
- Tcl_Obj *tags; /* List of tags to be applied to this
- * row or column. */
- Blt_TableColumnType type;
-} InsertSwitches;
-
-static Blt_SwitchSpec insertSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-after", "column",
- Blt_Offset(InsertSwitches, column), INSERT_COL, 0, &afterSwitch},
- {BLT_SWITCH_CUSTOM, "-after", "row",
- Blt_Offset(InsertSwitches, row), INSERT_ROW, 0, &afterSwitch},
- {BLT_SWITCH_CUSTOM, "-before", "column",
- Blt_Offset(InsertSwitches, column), INSERT_COL, 0, &beforeSwitch},
- {BLT_SWITCH_CUSTOM, "-before", "row",
- Blt_Offset(InsertSwitches, row), INSERT_ROW, 0, &beforeSwitch},
- {BLT_SWITCH_STRING, "-label", "string",
- Blt_Offset(InsertSwitches, label), INSERT_ROW | INSERT_COL},
- {BLT_SWITCH_OBJ, "-tags", "tags",
- Blt_Offset(InsertSwitches, tags), INSERT_ROW | INSERT_COL},
- {BLT_SWITCH_CUSTOM, "-type", "type",
- Blt_Offset(InsertSwitches, type), INSERT_COL, 0, &typeSwitch},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- unsigned int flags;
- Blt_Table table;
-} CopySwitches;
-
-#define COPY_NOTAGS (1<<1)
-#define COPY_LABEL (1<<3)
-
-static Blt_SwitchSpec copySwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-notags", "",
- Blt_Offset(CopySwitches, flags), 0, COPY_NOTAGS},
- {BLT_SWITCH_CUSTOM, "-table", "srcTable",
- Blt_Offset(CopySwitches, table), 0, 0, &tableSwitch},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- unsigned int flags;
-} AddSwitches;
-
-#define ADD_NOTAGS (1<<1)
-
-static Blt_SwitchSpec addSwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-notags", "",
- Blt_Offset(CopySwitches, flags), 0, ADD_NOTAGS},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- /* Private data */
- Tcl_Channel channel;
- Tcl_DString *dsPtr;
- unsigned int flags;
-
- /* Public fields */
- Blt_TableIterator ri, ci;
- Tcl_Obj *fileObjPtr;
-} DumpSwitches;
-
-static Blt_SwitchSpec dumpSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-rows", "rows",
- Blt_Offset(DumpSwitches, ri), 0, 0, &rowIterSwitch},
- {BLT_SWITCH_CUSTOM, "-columns", "columns",
- Blt_Offset(DumpSwitches, ci), 0, 0, &columnIterSwitch},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(DumpSwitches, fileObjPtr), 0},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- Blt_HashTable idTable;
-
- Tcl_Obj *fileObjPtr;
- Tcl_Obj *dataObjPtr;
- unsigned int flags;
-} RestoreSwitches;
-
-static Blt_SwitchSpec restoreSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "string",
- Blt_Offset(RestoreSwitches, dataObjPtr), 0, 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(RestoreSwitches, fileObjPtr), 0, 0},
- {BLT_SWITCH_BITMASK, "-notags", "",
- Blt_Offset(RestoreSwitches, flags), 0, TABLE_RESTORE_NO_TAGS},
- {BLT_SWITCH_BITMASK, "-overwrite", "",
- Blt_Offset(RestoreSwitches, flags), 0, TABLE_RESTORE_OVERWRITE},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- unsigned int flags;
-} SortSwitches;
-
-static Blt_SwitchSpec sortSwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-decreasing", "",
- Blt_Offset(SortSwitches, flags), 0, SORT_DECREASING},
- {BLT_SWITCH_BITMASK, "-list", "",
- Blt_Offset(SortSwitches, flags), 0, SORT_LIST},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- unsigned int flags;
-} NotifySwitches;
-
-static Blt_SwitchSpec notifySwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-allevents", "",
- Blt_Offset(NotifySwitches, flags), 0, TABLE_NOTIFY_ALL_EVENTS},
- {BLT_SWITCH_BITMASK, "-create", "",
- Blt_Offset(NotifySwitches, flags), 0, TABLE_NOTIFY_CREATE},
- {BLT_SWITCH_BITMASK, "-delete", "",
- Blt_Offset(NotifySwitches, flags), 0, TABLE_NOTIFY_DELETE},
- {BLT_SWITCH_BITMASK, "-move", "",
- Blt_Offset(NotifySwitches, flags), 0, TABLE_NOTIFY_MOVE},
- {BLT_SWITCH_BITMASK, "-whenidle", "",
- Blt_Offset(NotifySwitches, flags), 0, TABLE_NOTIFY_WHENIDLE},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- Blt_Table table; /* Table to be evaluated */
- Blt_TableRow row; /* Current row. */
- Blt_HashTable varTable; /* Variable cache. */
- Blt_TableIterator iter;
-
- /* Public values */
- Tcl_Obj *emptyValueObjPtr;
- const char *tag;
- unsigned int flags;
-} FindSwitches;
-
-#define FIND_INVERT (1<<0)
-
-static Blt_SwitchSpec findSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-rows", "rows",
- Blt_Offset(FindSwitches, iter), 0, 0, &rowIterSwitch},
- {BLT_SWITCH_OBJ, "-emptyvalue", "string",
- Blt_Offset(FindSwitches, emptyValueObjPtr), 0},
- {BLT_SWITCH_STRING, "-addtag", "tagName",
- Blt_Offset(FindSwitches, tag), 0},
- {BLT_SWITCH_BITMASK, "-invert", "",
- Blt_Offset(FindSwitches, flags), 0, FIND_INVERT},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- int flags;
-} UniqueSwitches;
-
-static Blt_SwitchSpec uniqueSwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-ascii", "",
- Blt_Offset(UniqueSwitches, flags), 0, SORT_ASCII},
- {BLT_SWITCH_BITMASK, "-decreasing", "",
- Blt_Offset(SortSwitches, flags), 0, SORT_DECREASING},
- {BLT_SWITCH_BITMASK, "-dictionary", "",
- Blt_Offset(UniqueSwitches, flags), 0, SORT_DICTIONARY},
- {BLT_SWITCH_BITMASK, "-freq", "",
- Blt_Offset(UniqueSwitches, flags), 0, SORT_FREQUENCY},
- {BLT_SWITCH_END}
-};
-
-static Blt_TableTraceProc TraceProc;
-static Blt_TableTraceDeleteProc TraceDeleteProc;
-
-static Blt_TableNotifyEventProc NotifyProc;
-static Blt_TableNotifierDeleteProc NotifierDeleteProc;
-
-static Tcl_CmdDeleteProc TableInstDeleteProc;
-static Tcl_InterpDeleteProc TableInterpDeleteProc;
-static Tcl_ObjCmdProc TableInstObjCmd;
-static Tcl_ObjCmdProc TableObjCmd;
-
-typedef int (CmdProc)(Cmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-#ifdef notdef
-static int
-FirstOption(int objc, Tcl_Obj *const *objv, int start)
-{
- int i;
-
- for (i = start; i < objc; i++) {
- const char *string;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] == '-') {
- break;
- }
- }
- return i;
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * PositionSwitch --
- *
- * Convert a Tcl_Obj representing an offset in the table.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PositionSwitch(
- ClientData clientData, /* Flag indicating if the node is
- * considered before or after the
- * insertion position. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Not used. */
- int flags) /* Indicates whether this is a row or
- * column index. */
-{
- InsertSwitches *insertPtr = (InsertSwitches *)record;
- Blt_Table table;
-
- table = insertPtr->cmdPtr->table;
- if (flags & INSERT_COL) {
- Blt_TableColumn col;
-
- col = Blt_Table_FindColumn(interp, table, objPtr);
- if (col == NULL) {
- return TCL_ERROR;
- }
- if (clientData == INSERT_AFTER) {
- col = Blt_Table_NextColumn(table, col);
- }
- insertPtr->column = col;
- } else if (flags & INSERT_ROW) {
- Blt_TableRow row;
-
- row = Blt_Table_FindRow(interp, table, objPtr);
- if (row == NULL) {
- return TCL_ERROR;
- }
- if (clientData == INSERT_AFTER) {
- row = Blt_Table_NextRow(table, row);
- }
- insertPtr->row = row;
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_ColumnIterFreeProc --
- *
- * Free the storage associated with the -columns switch.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-void
-Blt_Table_ColumnIterFreeProc(char *record, int offset, int flags)
-{
- Blt_TableIterator *iterPtr = (Blt_TableIterator *)(record + offset);
-
- Blt_Table_FreeIteratorObjv(iterPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Table_ColumnIterSwitchProc --
- *
- * Convert a Tcl_Obj representing an offset in the table.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-Blt_Table_ColumnIterSwitchProc(
- ClientData clientData, /* Flag indicating if the node is
- * considered before or after the
- * insertion position. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_TableIterator *iterPtr = (Blt_TableIterator *)(record + offset);
- Blt_Table table;
- Tcl_Obj **objv;
- int objc;
-
- table = clientData;
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_Table_IterateColumnsObjv(interp, table, objc, objv, iterPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeRowIter --
- *
- * Free the storage associated with the -rows switch.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-void
-Blt_Table_RowIterFreeProc(char *record, int offset, int flags)
-{
- Blt_TableIterator *iterPtr = (Blt_TableIterator *)(record + offset);
-
- Blt_Table_FreeIteratorObjv(iterPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowIterSwitch --
- *
- * Convert a Tcl_Obj representing an offset in the table.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-Blt_Table_RowIterSwitchProc(
- ClientData clientData, /* Flag indicating if the node is
- * considered before or after the
- * insertion position. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_TableIterator *iterPtr = (Blt_TableIterator *)(record + offset);
- Blt_Table table;
- Tcl_Obj **objv;
- int objc;
-
- table = clientData;
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_Table_IterateRowsObjv(interp, table, objc, objv, iterPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableSwitchProc --
- *
- * Convert a Tcl_Obj representing an offset in the table.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TableSwitchProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report result. */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_Table *tablePtr = (Blt_Table *)(record + offset);
- Blt_Table table;
-
- if (Blt_Table_Open(interp, Tcl_GetString(objPtr), &table) != TCL_OK) {
- return TCL_ERROR;
- }
- *tablePtr = table;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableFreeProc --
- *
- * Free the storage associated with the -table switch.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-TableFreeProc(char *record, int offset, int flags)
-{
- Blt_Table table = *(Blt_Table *)(record + offset);
-
- Blt_Table_Close(table);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TypeSwitchProc --
- *
- * Convert a Tcl_Obj representing the type of the values in a table
- * column.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TypeSwitchProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_TableColumnType *typePtr = (Blt_TableColumnType *)(record + offset);
- Blt_TableColumnType type;
-
- type = Blt_Table_GetColumnType(Tcl_GetString(objPtr));
- if (type == TABLE_COLUMN_TYPE_UNKNOWN) {
- Tcl_AppendResult(interp, "unknown table column type \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- return TCL_OK;
- }
- *typePtr = type;
- return TCL_OK;
-}
-
-static int
-MakeRows(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *objPtr)
-{
- const char *string;
- Blt_TableRowColumnSpec spec;
- long n;
-
- spec = Blt_Table_RowSpec(table, objPtr, &string);
- switch(spec) {
- case TABLE_SPEC_UNKNOWN:
- case TABLE_SPEC_LABEL:
- Tcl_ResetResult(interp);
- if (Blt_Table_CreateRow(interp, table, string) == NULL) {
- return TCL_ERROR;
- }
- break;
- case TABLE_SPEC_INDEX:
- Tcl_ResetResult(interp);
- if (Tcl_GetLong(interp, string, &n) != TCL_OK) {
- return TCL_ERROR;
- }
- n -= Blt_Table_NumRows(table);
- Blt_Table_ExtendRows(interp, table, n, NULL);
- break;
- default:
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-CompareValueFreq(const void *a, const void *b)
-{
- const UniqueValue *fPtr1, *fPtr2;
-
- fPtr1 = a;
- fPtr2 = b;
- return (fPtr1->freq - fPtr2->freq);
-}
-
-static int
-CompareValueAscii(const void *a, const void *b)
-{
- const UniqueValue *fPtr1, *fPtr2;
-
- fPtr1 = a;
- fPtr2 = b;
- return strcmp(fPtr1->value, fPtr2->value);
-}
-
-static int
-CompareValueDictionary(const void *a, const void *b)
-{
- const UniqueValue *fPtr1, *fPtr2;
-
- fPtr1 = a;
- fPtr2 = b;
- return Blt_DictionaryCompare(fPtr1->value, fPtr2->value);
-}
-
-static Tcl_Obj *
-SortColumnValues(Tcl_Interp *interp, Blt_HashTable *tablePtr, int flags)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- QSortCompareProc *proc;
- Tcl_Obj *listObjPtr;
- UniqueValue *p, *pend, *array;
- long i;
-
- i = 0;
- array = Blt_Malloc(tablePtr->numEntries * sizeof(UniqueValue));
- if (array == NULL) {
- return NULL;
- }
- p = array;
- for (hPtr = Blt_FirstHashEntry(tablePtr, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- p->value = Blt_GetHashKey(tablePtr, hPtr);
- p->freq = (long)Blt_GetHashValue(hPtr);
- p++;
- }
- switch (flags & SORT_TYPE_MASK) {
- case SORT_ASCII:
- proc = CompareValueAscii; break;
- case SORT_FREQUENCY:
- proc = CompareValueFreq; break;
-
- case SORT_DICTIONARY:
- proc = CompareValueDictionary; break;
- case SORT_NONE:
- proc = NULL; break;
- }
- if (proc != NULL) {
- qsort(array, tablePtr->numEntries, sizeof(UniqueValue), proc);
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- if (flags & SORT_DECREASING) {
- for (p = array + tablePtr->numEntries, pend = array; p > pend;) {
- Tcl_Obj *objPtr;
-
- p--;
- objPtr = Tcl_NewStringObj(p->value, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- } else {
- for (p = array, pend = p + tablePtr->numEntries; p < pend; p++) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(p->value, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Blt_Free(array);
- return listObjPtr;
-}
-
-
-static int
-IterateRows(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *objPtr,
- Blt_TableIterator *iterPtr)
-{
- if (Blt_Table_IterateRows(interp, table, objPtr, iterPtr) != TCL_OK) {
- /*
- * We could not parse the row descriptor. If the row specification is
- * a label or index that doesn't exist, create the new rows and try to
- * load the iterator again.
- */
- if (MakeRows(interp, table, objPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_Table_IterateRows(interp, table, objPtr, iterPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-static int
-MakeColumns(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *objPtr)
-{
- const char *string;
- Blt_TableRowColumnSpec spec;
- long n;
-
- spec = Blt_Table_ColumnSpec(table, objPtr, &string);
- switch(spec) {
- case TABLE_SPEC_UNKNOWN:
- case TABLE_SPEC_LABEL:
- Tcl_ResetResult(interp);
- if (Blt_Table_CreateColumn(interp, table, string) == NULL) {
- return TCL_ERROR;
- }
- break;
- case TABLE_SPEC_INDEX:
- Tcl_ResetResult(interp);
- if (Tcl_GetLong(interp, string, &n) != TCL_OK) {
- return TCL_ERROR;
- }
- n -= Blt_Table_NumColumns(table);
- Blt_Table_ExtendColumns(interp, table, n, NULL);
- break;
- default:
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-IterateColumns(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *objPtr,
- Blt_TableIterator *iterPtr)
-{
- if (Blt_Table_IterateColumns(interp, table, objPtr, iterPtr) != TCL_OK) {
- /*
- * We could not parse column descriptor. If the column specification
- * is a label that doesn't exist, create a new column with that label
- * and try to load the iterator again.
- */
- if (MakeColumns(interp, table, objPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_Table_IterateColumns(interp, table, objPtr, iterPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTableCmdInterpData --
- *
- *---------------------------------------------------------------------------
- */
-
-static TableCmdInterpData *
-GetTableCmdInterpData(Tcl_Interp *interp)
-{
- TableCmdInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (TableCmdInterpData *)
- Tcl_GetAssocData(interp, TABLE_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(TableCmdInterpData));
- dataPtr->interp = interp;
- Tcl_SetAssocData(interp, TABLE_THREAD_KEY, TableInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->instTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&dataPtr->fmtTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&dataPtr->findTable, BLT_ONE_WORD_KEYS);
- }
- return dataPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewTableCmd --
- *
- * This is a helper routine used by TableCreateOp. It create a
- * new instance of a table command. Memory is allocated for the
- * command structure and a new TCL command is created (same as
- * the instance name). All table commands have hash table
- * entries in a global (interpreter-specific) registry.
- *
- * Results:
- * Returns a pointer to the newly allocated table command structure.
- *
- * Side Effects:
- * Memory is allocated for the structure and a hash table entry is
- * added.
- *
- *---------------------------------------------------------------------------
- */
-static Cmd *
-NewTableCmd(Tcl_Interp *interp, Blt_Table table, const char *name)
-{
- Cmd *cmdPtr;
- TableCmdInterpData *dataPtr;
- int isNew;
-
- cmdPtr = Blt_AssertCalloc(1, sizeof(Cmd));
- cmdPtr->table = table;
- cmdPtr->interp = interp;
- cmdPtr->emptyValue = Blt_AssertStrdup("");
-
- Blt_InitHashTable(&cmdPtr->traceTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&cmdPtr->notifyTable, BLT_STRING_KEYS);
-
- cmdPtr->cmdToken = Tcl_CreateObjCommand(interp, name, TableInstObjCmd,
- cmdPtr, TableInstDeleteProc);
- dataPtr = GetTableCmdInterpData(interp);
- cmdPtr->tablePtr = &dataPtr->instTable;
- cmdPtr->hPtr = Blt_CreateHashEntry(&dataPtr->instTable, name, &isNew);
- Blt_SetHashValue(cmdPtr->hPtr, cmdPtr);
- return cmdPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GenerateName --
- *
- * Generates an unique table command name. Table names are in the form
- * "datatableN", where N is a non-negative integer. Check each name
- * generated to see if it is already a table. We want to recycle names if
- * possible.
- *
- * Results:
- * Returns the unique name. The string itself is stored in the dynamic
- * string passed into the routine.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-GenerateName(Tcl_Interp *interp, const char *prefix, const char *suffix,
- Tcl_DString *resultPtr)
-{
-
- int n;
- const char *instName;
-
- /*
- * Parse the command and put back so that it's in a consistent format.
- *
- * t1 <current namespace>::t1
- * n1::t1 <current namespace>::n1::t1
- * ::t1 ::t1
- * ::n1::t1 ::n1::t1
- */
- instName = NULL; /* Suppress compiler warning. */
- for (n = 0; n < INT_MAX; n++) {
- Blt_ObjectName objName;
- Tcl_CmdInfo cmdInfo;
- Tcl_DString ds;
- char string[200];
-
- Tcl_DStringInit(&ds);
- Tcl_DStringAppend(&ds, prefix, -1);
- sprintf_s(string, 200, "datatable%d", n);
- Tcl_DStringAppend(&ds, string, -1);
- Tcl_DStringAppend(&ds, suffix, -1);
- if (!Blt_ParseObjectName(interp, Tcl_DStringValue(&ds),
- &objName, 0)) {
- return NULL;
- }
- instName = Blt_MakeQualifiedName(&objName, resultPtr);
- Tcl_DStringFree(&ds);
- /*
- * Check if the command already exists.
- */
- if (Tcl_GetCommandInfo(interp, (char *)instName, &cmdInfo)) {
- continue;
- }
- if (!Blt_Table_TableExists(interp, instName)) {
- /*
- * We want the name of the table command and the underlying table
- * object to be the same. Check that the free command name isn't
- * an already a table object name.
- */
- break;
- }
- }
- return instName;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTableCmd --
- *
- * Find the table command associated with the TCL command "string".
- *
- * We have to perform multiple lookups to get this right.
- *
- * The first step is to generate a canonical command name. If an
- * unqualified command name (i.e. no namespace qualifier) is given, we
- * should search first the current namespace and then the global one.
- * Most TCL commands (like Tcl_GetCmdInfo) look only at the global
- * namespace.
- *
- * Next check if the string is
- * a) a TCL command and
- * b) really is a command for a table object.
- * Tcl_GetCommandInfo will get us the objClientData field that should be
- * a cmdPtr. We verify that by searching our hashtable of cmdPtr
- * addresses.
- *
- * Results:
- * A pointer to the table command. If no associated table command can be
- * found, NULL is returned. It's up to the calling routines to generate
- * an error message.
- *
- *---------------------------------------------------------------------------
- */
-static Cmd *
-GetTableCmd(Tcl_Interp *interp, const char *name)
-{
- Blt_HashEntry *hPtr;
- Tcl_DString ds;
- TableCmdInterpData *dataPtr;
- Blt_ObjectName objName;
- const char *qualName;
-
- /* Put apart the table name and put is back together in a standard
- * format. */
- if (!Blt_ParseObjectName(interp, name, &objName, BLT_NO_ERROR_MSG)) {
- return NULL; /* No such parent namespace. */
- }
- /* Rebuild the fully qualified name. */
- qualName = Blt_MakeQualifiedName(&objName, &ds);
- dataPtr = GetTableCmdInterpData(interp);
- hPtr = Blt_FindHashEntry(&dataPtr->instTable, qualName);
- Tcl_DStringFree(&ds);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTraceFlags --
- *
- * Parses a string representation of the trace bit flags and returns the
- * mask.
- *
- * Results:
- * The trace mask is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetTraceFlags(const char *string)
-{
- const char *p;
- unsigned int flags;
-
- flags = 0;
- for (p = string; *p != '\0'; p++) {
- switch (toupper(UCHAR(*p))) {
- case 'R':
- flags |= TABLE_TRACE_READS; break;
- case 'W':
- flags |= TABLE_TRACE_WRITES; break;
- case 'U':
- flags |= TABLE_TRACE_UNSETS; break;
- case 'C':
- flags |= TABLE_TRACE_CREATES; break;
- default:
- return -1;
- }
- }
- return flags;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PrintTraceFlags --
- *
- * Generates a string representation of the trace bit flags. It's
- * assumed that the provided string is at least 5 bytes.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The bitflag information is written to the provided string.
- *
- *---------------------------------------------------------------------------
- */
-static void
-PrintTraceFlags(unsigned int flags, char *string)
-{
- char *p;
-
- p = string;
- if (flags & TABLE_TRACE_READS) {
- *p++ = 'r';
- }
- if (flags & TABLE_TRACE_WRITES) {
- *p++ = 'w';
- }
- if (flags & TABLE_TRACE_UNSETS) {
- *p++ = 'u';
- }
- if (flags & TABLE_TRACE_CREATES) {
- *p++ = 'c';
- }
- *p = '\0';
-}
-
-static void
-PrintTraceInfo(Tcl_Interp *interp, TraceInfo *tiPtr, Tcl_Obj *listObjPtr)
-{
- Tcl_Obj *objPtr;
- int i;
- char string[5];
- struct _Blt_TableTrace *tracePtr;
- Blt_Table table;
-
- table = tiPtr->cmdPtr->table;
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("id", 2));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(tiPtr->hPtr->key.string, -1));
- tracePtr = tiPtr->trace;
- if (tracePtr->rowTag != NULL) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("row", 3));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(tracePtr->rowTag, -1));
- }
- if (tracePtr->row != NULL) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("row", 3));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewLongObj(Blt_Table_RowIndex(tracePtr->row)));
- }
- if (tracePtr->colTag != NULL) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("column", 6));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(tracePtr->colTag, -1));
- }
- if (tracePtr->column != NULL) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("column", 6));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewLongObj(Blt_Table_ColumnIndex(tracePtr->column)));
- }
- PrintTraceFlags(tracePtr->flags, string);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("flags", 5));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj(string, -1));
-
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("command", 7));
- objPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (i = 0; i < tiPtr->cmdc; i++) {
- Tcl_ListObjAppendElement(interp, objPtr, tiPtr->cmdv[i]);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeNotifierInfo --
- *
- * This is a helper routine used to delete notifiers. It releases the
- * Tcl_Objs used in the notification callback command and the actual
- * table notifier. Memory for the notifier is also freed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Memory is deallocated and the notitifer is no longer active.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeNotifierInfo(NotifierInfo *niPtr)
-{
- int i;
-
- for (i = 0; i < niPtr->cmdc; i++) {
- Tcl_DecrRefCount(niPtr->cmdv[i]);
- }
- Blt_Table_DeleteNotifier(niPtr->notifier);
- Blt_Free(niPtr->cmdv);
- Blt_Free(niPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceProc --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TraceProc(ClientData clientData, Blt_TableTraceEvent *eventPtr)
-{
- TraceInfo *tracePtr = clientData;
- char string[5];
- int result;
- int i;
-
- i = tracePtr->cmdc; /* Add extra command arguments starting at
- * this index. */
- tracePtr->cmdv[i+1]=Tcl_NewLongObj(Blt_Table_RowIndex(eventPtr->row));
- tracePtr->cmdv[i+2]=Tcl_NewLongObj(Blt_Table_ColumnIndex(eventPtr->column));
-
- PrintTraceFlags(eventPtr->mask, string);
- tracePtr->cmdv[i+3] = Tcl_NewStringObj(string, -1);
-
- Tcl_IncrRefCount(tracePtr->cmdv[i+1]);
- Tcl_IncrRefCount(tracePtr->cmdv[i+2]);
- Tcl_IncrRefCount(tracePtr->cmdv[i+3]);
- result = Tcl_EvalObjv(eventPtr->interp, i + 4, tracePtr->cmdv, 0);
- Tcl_DecrRefCount(tracePtr->cmdv[i+3]);
- Tcl_DecrRefCount(tracePtr->cmdv[i+2]);
- Tcl_DecrRefCount(tracePtr->cmdv[i+1]);
- if (result != TCL_OK) {
- Tcl_BackgroundError(eventPtr->interp);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceDeleteProc --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-TraceDeleteProc(ClientData clientData)
-{
- TraceInfo *tiPtr = clientData;
- int i;
-
- for (i = 0; i <= tiPtr->cmdc; i++) {
- Tcl_DecrRefCount(tiPtr->cmdv[i]);
- }
- Blt_Free(tiPtr->cmdv);
- if (tiPtr->hPtr != NULL) {
- Blt_DeleteHashEntry(tiPtr->tablePtr, tiPtr->hPtr);
- }
- Blt_Free(tiPtr);
-}
-
-static const char *
-GetEventName(int type)
-{
- if (type & TABLE_NOTIFY_CREATE) {
- return "-create";
- }
- if (type & TABLE_NOTIFY_DELETE) {
- return "-delete";
- }
- if (type & TABLE_NOTIFY_MOVE) {
- return "-move";
- }
- return "???";
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifierDeleteProc --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-NotifierDeleteProc(ClientData clientData)
-{
- NotifierInfo *niPtr;
-
- niPtr = clientData;
- FreeNotifierInfo(niPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyProc --
- *
- *---------------------------------------------------------------------------
- */
-static int
-NotifyProc(ClientData clientData, Blt_TableNotifyEvent *eventPtr)
-{
- NotifierInfo *niPtr;
- Tcl_Interp *interp;
- int i, result;
- long index;
-
- niPtr = clientData;
- interp = niPtr->cmdPtr->interp;
- i = niPtr->cmdc;
- niPtr->cmdv[i] = Tcl_NewStringObj(GetEventName(eventPtr->type), -1);
-
- if (eventPtr->type & TABLE_NOTIFY_ROW) {
- index = Blt_Table_RowIndex(eventPtr->header);
- } else {
- index = Blt_Table_ColumnIndex(eventPtr->header);
- }
- niPtr->cmdv[i+1] = Tcl_NewLongObj(index);
- Tcl_IncrRefCount(niPtr->cmdv[i]);
- Tcl_IncrRefCount(niPtr->cmdv[i+1]);
- Tcl_IncrRefCount(niPtr->cmdv[i+2]);
- result = Tcl_EvalObjv(interp, niPtr->cmdc + 3, niPtr->cmdv, 0);
- Tcl_DecrRefCount(niPtr->cmdv[i+2]);
- Tcl_DecrRefCount(niPtr->cmdv[i+1]);
- Tcl_DecrRefCount(niPtr->cmdv[i]);
- if (result != TCL_OK) {
- Tcl_BackgroundError(interp);
- return TCL_ERROR;
- }
- Tcl_ResetResult(interp);
- return TCL_OK;
-}
-
-static int
-ColumnVarResolver(
- Tcl_Interp *interp, /* Current interpreter. */
- const char *name, /* Variable name being resolved. */
- Tcl_Namespace *nsPtr, /* Current namespace context. */
- int flags, /* TCL_LEAVE_ERR_MSG => leave error
- * message. */
- Tcl_Var *varPtr) /* (out) Resolved variable. */
-{
- Blt_HashEntry *hPtr;
- Blt_TableColumn col;
- FindSwitches *findPtr;
- TableCmdInterpData *dataPtr;
- Tcl_Interp *errInterp;
- Tcl_Obj *valueObjPtr, *nameObjPtr;
-
- dataPtr = GetTableCmdInterpData(interp);
- hPtr = Blt_FindHashEntry(&dataPtr->findTable, nsPtr);
- if (hPtr == NULL) {
- /* This should never happen. We can't find in data associated with
- * the current namespace. But this routine should never be called
- * unless we're in a namespace that with linked with this variable
- * resolver. */
- return TCL_CONTINUE;
- }
- findPtr = Blt_GetHashValue(hPtr);
-
- if (flags & TCL_LEAVE_ERR_MSG) {
- errInterp = interp;
- } else {
- errInterp = NULL;
- }
- /* Look up the column from the variable name given. */
- nameObjPtr = Tcl_NewStringObj(name, -1);
- col = Blt_Table_FindColumn(NULL, findPtr->table, nameObjPtr);
- Tcl_DecrRefCount(nameObjPtr);
-
- if (col == NULL) {
- /* Variable name doesn't refer to any column. Pass it back to the Tcl
- * interpreter and let it resolve it normally. */
- return TCL_CONTINUE;
- }
- valueObjPtr = Blt_Table_GetObj(findPtr->table, findPtr->row, col);
- if (valueObjPtr == NULL) {
- valueObjPtr = findPtr->emptyValueObjPtr;
- if (valueObjPtr == NULL) {
- return TCL_CONTINUE;
- }
- }
- Tcl_IncrRefCount(valueObjPtr);
- *varPtr = Blt_GetCachedVar(&findPtr->varTable, name, valueObjPtr);
- return TCL_OK;
-}
-
-static int
-EvaluateExpr(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *exprObjPtr,
- FindSwitches *findPtr, int *boolPtr)
-{
- Tcl_Obj *resultObjPtr;
- int bool;
-
- if (Tcl_ExprObj(interp, exprObjPtr, &resultObjPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tcl_GetBooleanFromObj(interp, resultObjPtr, &bool) != TCL_OK) {
- return TCL_ERROR;
- }
- if (findPtr->flags & FIND_INVERT) {
- bool = !bool;
- }
- if ((bool) && (findPtr->tag != NULL)) {
- Blt_Table_SetRowTag(interp, table, findPtr->row, findPtr->tag);
- }
- Tcl_DecrRefCount(resultObjPtr);
- *boolPtr = bool;
- return TCL_OK;
-}
-
-static int
-FindRows(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *objPtr,
- FindSwitches *findPtr)
-{
- Blt_HashEntry *hPtr;
- TableCmdInterpData *dataPtr;
- Tcl_CallFrame frame;
- Tcl_Namespace *nsPtr;
- const char *name;
- int isNew;
- int result = TCL_OK;
-
- name = Blt_Table_TableName(table);
- nsPtr = Tcl_FindNamespace(interp, name, NULL, TCL_GLOBAL_ONLY);
- if (nsPtr != NULL) {
- /* This limits us to only one expression evaluated per table at a
- * time--no concurrent expressions in the same table. Otherwise we
- * need to generate unique namespace names. That's a bit harder with
- * the current TCL namespace API. */
- Tcl_AppendResult(interp, "can't evaluate expression: namespace \"",
- name, "\" exists.", (char *)NULL);
- return TCL_ERROR;
- }
-
- /* Create a namespace from which to evaluate the expression. */
- nsPtr = Tcl_CreateNamespace(interp, name, NULL, NULL);
- if (nsPtr == NULL) {
- return TCL_ERROR;
- }
- /* Register our variable resolver in this namespace to link table values
- * with TCL variables. */
- Tcl_SetNamespaceResolvers(nsPtr, (Tcl_ResolveCmdProc*)NULL,
- ColumnVarResolver, (Tcl_ResolveCompiledVarProc*)NULL);
-
- /* Make this namespace the current one. */
- Tcl_PushCallFrame(interp, &frame, nsPtr, /* isProcCallFrame */ FALSE);
-
- dataPtr = GetTableCmdInterpData(interp);
- hPtr = Blt_CreateHashEntry(&dataPtr->findTable, (char *)nsPtr, &isNew);
- assert(isNew);
- Blt_SetHashValue(hPtr, findPtr);
-
- /* Now process each row, evaluating the expression. */
- {
- Blt_TableRow row;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (row = Blt_Table_FirstTaggedRow(&findPtr->iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&findPtr->iter)) {
- int bool;
-
- findPtr->row = row;
- result = EvaluateExpr(interp, table, objPtr, findPtr, &bool);
- if (result != TCL_OK) {
- break;
- }
- if (bool) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewLongObj(Blt_Table_RowIndex(row)));
- }
- }
- if (result != TCL_OK) {
- Tcl_DecrRefCount(listObjPtr);
- } else {
- Tcl_SetObjResult(interp, listObjPtr);
- }
- }
- /* Clean up. */
- Tcl_PopCallFrame(interp);
- Tcl_DeleteNamespace(nsPtr);
- Blt_DeleteHashEntry(&dataPtr->findTable, hPtr);
- Blt_FreeCachedVars(&findPtr->varTable);
- return result;
-}
-
-static int
-CopyColumn(Tcl_Interp *interp, Blt_Table srcTable, Blt_Table destTable,
- Blt_TableColumn src, /* Column in the source table. */
- Blt_TableColumn dest) /* Column in the destination table. */
-{
- long i;
-
- if ((Blt_Table_SameTableObject(srcTable, destTable)) && (src == dest)) {
- return TCL_OK; /* Source and destination are the same. */
- }
- if (Blt_Table_NumRows(srcTable) > Blt_Table_NumRows(destTable)) {
- long need;
-
- need = (Blt_Table_NumRows(srcTable) - Blt_Table_NumRows(destTable));
- if (Blt_Table_ExtendRows(interp, destTable, need, NULL) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- Blt_Table_SetColumnType(destTable, dest, Blt_Table_ColumnType(src));
- for (i = 1; i <= Blt_Table_NumRows(srcTable); i++) {
- Blt_TableRow row;
- Blt_TableValue value;
-
- row = Blt_Table_Row(srcTable, i);
- value = Blt_Table_GetValue(srcTable, row, src);
- if (value == NULL) {
- continue;
- }
- row = Blt_Table_Row(destTable, i);
- if (Blt_Table_SetValue(destTable, row, dest, value) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-static void
-CopyColumnTags(Blt_Table srcTable, Blt_Table destTable,
- Blt_TableColumn src, /* Column in the source table. */
- Blt_TableColumn dest) /* Column in the destination table. */
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- /* Find all tags for with this column index. */
- for (hPtr = Blt_Table_FirstColumnTag(srcTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *h2Ptr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tablePtr, (char *)src);
- if (h2Ptr != NULL) {
- /* We know the tag tables are keyed by strings, so we don't need
- * to call Blt_GetHashKey or use the hash table pointer to
- * retrieve the key. */
- Blt_Table_SetColumnTag(NULL, destTable, dest, hPtr->key.string);
- }
- }
-}
-
-/************* Column Operations ****************/
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnCopyOp --
- *
- * Copies the specified columns to the table. A different table may be
- * selected as the source.
- *
- * Results:
- * A standard TCL result. If the tag or column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $dest column copy $srccol $destcol ?-table srcTable?
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnCopyOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- CopySwitches switches;
- Blt_Table srcTable, destTable;
- int result;
- Blt_TableColumn src, dest;
-
- /* Process switches following the column names. */
- memset(&switches, 0, sizeof(switches));
- result = TCL_ERROR;
- if (Blt_ParseSwitches(interp, copySwitches, objc - 5, objv + 5,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- goto error;
- }
- srcTable = destTable = cmdPtr->table;
- if (switches.table != NULL) {
- srcTable = switches.table;
- }
- src = Blt_Table_FindColumn(interp, srcTable, objv[3]);
- if (src == NULL) {
- goto error;
- }
- dest = Blt_Table_FindColumn(interp, destTable, objv[4]);
- if (dest == NULL) {
- dest = Blt_Table_CreateColumn(interp, destTable,
- Tcl_GetString(objv[4]));
- if (dest == NULL) {
- goto error;
- }
- }
- if (CopyColumn(interp, srcTable, destTable, src, dest) != TCL_OK) {
- goto error;
- }
- if ((switches.flags & COPY_NOTAGS) == 0) {
- CopyColumnTags(srcTable, destTable, src, dest);
- }
- result = TCL_OK;
- error:
- Blt_FreeSwitches(copySwitches, &switches, 0);
- return result;
-
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnDeleteOp --
- *
- * Deletes the columns designated. One or more columns may be deleted
- * using a tag.
- *
- * Results:
- * A standard TCL result. If the tag or column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column delete ?column?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnDeleteOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TableIterator iter;
- Blt_TableColumn col;
- int result;
-
- result = TCL_ERROR;
- if (Blt_Table_IterateColumnsObjv(interp, cmdPtr->table, objc - 3, objv + 3,
- &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Walk through the list of column offsets, deleting each column.
- */
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- if (Blt_Table_DeleteColumn(cmdPtr->table, col) != TCL_OK) {
- goto error;
- }
- }
- result = TCL_OK;
- error:
- Blt_Table_FreeIteratorObjv(&iter);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnDupOp --
- *
- * Duplicates the specified columns in the table. This differs from
- * ColumnCopyOp, since the same table is the source and destination.
- *
- * Results:
- * A standard TCL result. If the tag or column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $dest column dup column...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnDupOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Tcl_Obj *listObjPtr;
- Blt_TableIterator iter;
- Blt_TableColumn src;
-
- table = cmdPtr->table;
- listObjPtr = NULL;
- if (Blt_Table_IterateColumnsObjv(interp, table, objc - 3, objv + 3, &iter)
- != TCL_OK) {
- goto error;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (src = Blt_Table_FirstTaggedColumn(&iter); src != NULL;
- src = Blt_Table_NextTaggedColumn(&iter)) {
- long i;
- Blt_TableColumn dest;
-
- dest = Blt_Table_CreateColumn(interp, table,Blt_Table_ColumnLabel(src));
- if (dest == NULL) {
- goto error;
- }
- if (CopyColumn(interp, table, table, src, dest) != TCL_OK) {
- goto error;
- }
- CopyColumnTags(table, table, src, dest);
- i = Blt_Table_ColumnIndex(dest);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewLongObj(i));
- }
- Blt_Table_FreeIteratorObjv(&iter);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- error:
- Blt_Table_FreeIteratorObjv(&iter);
- if (listObjPtr != NULL) {
- Tcl_DecrRefCount(listObjPtr);
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnExistsOp --
- *
- * Indicates is the given column exists. The column description can be
- * either an index, label, or single tag.
- *
- * Problem: The Blt_Table_IterateColumns function checks both for
- * 1) valid/invalid indices, labels, and tags and 2)
- * syntax errors.
- *
- * Results:
- * A standard TCL result. If the tag or column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column exists n
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnExistsOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TableColumn col;
- int bool;
-
- col = Blt_Table_FindColumn(NULL, cmdPtr->table, objv[3]);
- bool = (col != NULL);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnExtendOp --
- *
- * Extends the table by the given number of columns.
- *
- * Results:
- * A standard TCL result. If the tag or column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column extend n
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnExtendOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Tcl_Obj *listObjPtr;
- Blt_TableColumn *cols;
- long i, n;
- int addLabels;
-
- table = cmdPtr->table;
- if (objc == 3) {
- return TCL_OK;
- }
- n = 0;
- addLabels = FALSE;
- if (objc == 4) {
- long lcount;
-
- if (Tcl_GetLongFromObj(NULL, objv[3], &lcount) == TCL_OK) {
- if (lcount < 0) {
- Tcl_AppendResult(interp, "bad count \"", Blt_Itoa(lcount),
- "\": # columns can't be negative.", (char *)NULL);
- return TCL_ERROR;
- }
- n = lcount;
- } else {
- addLabels = TRUE;
- n = 1;
- }
- } else {
- addLabels = TRUE;
- n = objc - 3;
- }
- if (n == 0) {
- return TCL_OK;
- }
- cols = Blt_AssertMalloc(n * sizeof(Blt_TableColumn));
- if (Blt_Table_ExtendColumns(interp, table, n, cols) != TCL_OK) {
- goto error;
- }
- if (addLabels) {
- long j;
-
- for (i = 0, j = 3; i < n; i++, j++) {
- if (Blt_Table_SetColumnLabel(interp, table, cols[i],
- Tcl_GetString(objv[j])) != TCL_OK) {
- goto error;
- }
- }
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (i = 0; i < n; i++) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewLongObj(Blt_Table_ColumnIndex(cols[i]));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- Blt_Free(cols);
- return TCL_OK;
- error:
- Blt_Free(cols);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnGetOp --
- *
- * Retrieves a column of values. The column argument can be either a
- * tag, label, or column index. If it is a tag, it must refer to exactly
- * one column. If row arguments exist they must refer to label or row.
- * We always return the row label.
- *
- * Results:
- * A standard TCL result. If successful, a list of values is returned in
- * the interpreter result. If the column index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t column get -labels $c ?row...?
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnGetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableColumn col;
- Tcl_Obj *listObjPtr;
- const char *string;
- int needLabels;
-
- string = Tcl_GetString(objv[3]);
- needLabels = FALSE;
- if (strcmp(string, "-labels") == 0) {
- objv++, objc--;
- needLabels = TRUE;
- }
- table = cmdPtr->table;
- col = Blt_Table_FindColumn(interp, cmdPtr->table, objv[3]);
- if (col == NULL) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- if (objc == 4) {
- Blt_TableRow row;
-
- for (row = Blt_Table_FirstRow(cmdPtr->table); row != NULL;
- row = Blt_Table_NextRow(cmdPtr->table, row)) {
- Tcl_Obj *objPtr;
-
- if (needLabels) {
- objPtr = Tcl_NewStringObj(Blt_Table_RowLabel(row), -1);
- } else {
- objPtr = Tcl_NewLongObj(Blt_Table_RowIndex(row));
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Blt_Table_GetObj(cmdPtr->table, row, col);
- if (objPtr == NULL) {
- objPtr = Tcl_NewStringObj(cmdPtr->emptyValue, -1);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- } else {
- Blt_TableIterator iter;
- Blt_TableRow row;
-
- if (Blt_Table_IterateRowsObjv(interp, table, objc - 4, objv + 4, &iter)
- != TCL_OK) {
- return TCL_ERROR;
- }
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- Tcl_Obj *objPtr;
-
- if (needLabels) {
- objPtr = Tcl_NewStringObj(Blt_Table_RowLabel(row), -1);
- } else {
- objPtr = Tcl_NewLongObj(Blt_Table_RowIndex(row));
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Blt_Table_GetObj(cmdPtr->table, row, col);
- if (objPtr == NULL) {
- objPtr = Tcl_NewStringObj(cmdPtr->emptyValue, -1);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnIndexOp --
- *
- * Returns the column index of the given column tag, label, or index. A
- * tag can't represent more than one column.
- *
- * Results:
- * A standard TCL result. If the tag or column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column index $column
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnIndexOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TableColumn col;
- long i;
-
- i = -1;
- col = Blt_Table_FindColumn(NULL, cmdPtr->table, objv[3]);
- if (col != NULL) {
- i = Blt_Table_ColumnIndex(col);
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), i);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnIndicesOp --
- *
- * Returns a list of indices for the given columns.
- *
- * Results:
- * A standard TCL result. If the tag or column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column indices $col $col
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnIndicesOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- Blt_TableIterator iter;
- Blt_TableColumn col;
-
- if (Blt_Table_IterateColumnsObjv(interp, cmdPtr->table, objc - 3, objv + 3,
- &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewLongObj(Blt_Table_ColumnIndex(col));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- Blt_Table_FreeIteratorObjv(&iter);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnCreateOp --
- *
- * Creates a single new column in the table. The location of the new
- * column may be specified by -before or -after switches. By default the
- * new column is added to the end of the table.
- *
- * Results:
- * A standard TCL result. If the tag or column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column create -before 0 -after 1 -label label
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnCreateOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- InsertSwitches switches;
- Blt_TableColumn col;
- unsigned int flags;
-
- memset(&switches, 0, sizeof(switches));
- switches.cmdPtr = cmdPtr;
- switches.type = TABLE_COLUMN_TYPE_STRING;
-
- flags = INSERT_COL;
- if (Blt_ParseSwitches(interp, insertSwitches, objc - 3, objv + 3,
- &switches, flags) < 0) {
- goto error;
- }
- col = Blt_Table_CreateColumn(interp, cmdPtr->table, switches.label);
- if (col == NULL) {
- goto error;
- }
- Blt_Table_SetColumnType(cmdPtr->table, col, switches.type);
- if (switches.column != NULL) {
- if (Blt_Table_MoveColumns(interp, cmdPtr->table, col,
- switches.column, 1) != TCL_OK) {
- goto error;
- }
- }
- if (switches.tags != NULL) {
- Tcl_Obj **elv;
- int elc;
- int i;
-
- if (Tcl_ListObjGetElements(interp, switches.tags, &elc, &elv)
- != TCL_OK) {
- goto error;
- }
- for (i = 0; i < elc; i++) {
- if (Blt_Table_SetColumnTag(interp, cmdPtr->table, col,
- Tcl_GetString(elv[i])) != TCL_OK) {
- goto error;
- }
- }
- }
- Tcl_SetObjResult(interp, Tcl_NewLongObj(Blt_Table_ColumnIndex(col)));
- Blt_FreeSwitches(insertSwitches, &switches, flags);
- return TCL_OK;
- error:
- Blt_FreeSwitches(insertSwitches, &switches, flags);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnLabelOp --
- *
- * Gets/sets one or more column labels.
- *
- * Results:
- * A standard TCL result. If successful, the old column label is
- * returned in the interpreter result. If the column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column label column ?label? ?column label?
- * $t column label 1
- * $t column label 1 newLabel
- * $t column label 1 lab1 2 lab2 3 lab3 5 lab5
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnLabelOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
-
- table = cmdPtr->table;
- if (objc == 4) {
- const char *label;
- Blt_TableColumn col;
-
- col = Blt_Table_FindColumn(interp, table, objv[3]);
- if (col == NULL) {
- return TCL_ERROR;
- }
- label = Blt_Table_ColumnLabel(col);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), label, -1);
- } else {
- int i;
-
- if ((objc - 3) & 1) {
- Tcl_AppendResult(interp,"odd # of column/label pairs: should be \"",
- Tcl_GetString(objv[0]), " column label ?column label?...",
- (char *)NULL);
- return TCL_ERROR;
- }
- for (i = 3; i < objc; i += 2) {
- Blt_TableColumn col;
-
- col = Blt_Table_FindColumn(interp, table, objv[i]);
- if (col == NULL) {
- return TCL_ERROR;
- }
- if (Blt_Table_SetColumnLabel(interp, table, col,
- Tcl_GetString(objv[i+1])) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnLabelsOp --
- *
- * Gets/sets all the column labels in the table.
- *
- * Results:
- * A standard TCL result. If successful, a list of values is returned in
- * the interpreter result.
- *
- * Example:
- * $t column labels ?labelList?
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnLabelsOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
-
- table = cmdPtr->table;
- if (objc == 3) {
- Blt_TableColumn col;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (col = Blt_Table_FirstColumn(cmdPtr->table); col != NULL;
- col = Blt_Table_NextColumn(cmdPtr->table, col)) {
- const char *label;
- Tcl_Obj *objPtr;
-
- label = Blt_Table_ColumnLabel(col);
- objPtr = Tcl_NewStringObj(label, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- } else {
- Tcl_Obj **elv;
- int elc, n;
- int i;
-
- if (Tcl_ListObjGetElements(interp, objv[3], &elc, &elv) != TCL_OK) {
- return TCL_ERROR;
- }
- n = MIN(elc, Blt_Table_NumColumns(table));
- for (i = 0; i < n; i++) {
- Blt_TableColumn col;
-
- col = Blt_Table_Column(table, i + 1);
- if (Blt_Table_SetColumnLabel(interp, table, col,
- Tcl_GetString(elv[i])) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnLengthOp --
- *
- * Returns the number of columns the client sees.
- *
- * Results:
- * A standard TCL result. If successful, the old column label is
- * returned in the interpreter result. If the column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column length
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnLengthOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_SetLongObj(Tcl_GetObjResult(interp),
- Blt_Table_NumColumns(cmdPtr->table));
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnMoveOp --
- *
- * Moves the given number of columns to another location in the table.
- *
- * Results:
- * A standard TCL result. If the column index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t column move from to ?n?
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnMoveOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TableColumn from, to;
- long count;
-
- from = Blt_Table_FindColumn(interp, cmdPtr->table, objv[3]);
- if (from == NULL) {
- return TCL_ERROR;
- }
- to = Blt_Table_FindColumn(interp, cmdPtr->table, objv[4]);
- if (to == NULL) {
- return TCL_ERROR;
- }
- count = 1;
- if (objc == 6) {
- long lcount;
-
- if (Tcl_GetLongFromObj(interp, objv[5], &lcount) != TCL_OK) {
- return TCL_ERROR;
- }
- if (lcount == 0) {
- return TCL_OK;
- }
- if (lcount < 0) {
- Tcl_AppendResult(interp,
- "can't move columns: # of columns can't be negative",
- (char *)NULL);
- return TCL_ERROR;
- }
- count = lcount;
- }
- return Blt_Table_MoveColumns(interp, cmdPtr->table, from, to, count);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnNamesOp --
- *
- * Reports the labels of all columns.
- *
- * Results:
- * Always returns TCL_OK. The interpreter result is a list of column
- * labels.
- *
- * Example:
- * $t column names pattern
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnNamesOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- Blt_TableColumn col;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (col = Blt_Table_FirstColumn(cmdPtr->table); col != NULL;
- col = Blt_Table_NextColumn(cmdPtr->table, col)) {
- const char *label;
- int match;
- int i;
-
- label = Blt_Table_ColumnLabel(col);
- match = (objc == 3);
- for (i = 3; i < objc; i++) {
- char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- if (Tcl_StringMatch(label, pattern)) {
- match = TRUE;
- break;
- }
- }
- if (match) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(label, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnNotifyOp --
- *
- * Creates a notifier for this instance. Notifiers represent a bitmask
- * of events and a command prefix to be invoked when a matching event
- * occurs.
- *
- * The command prefix is parsed and saved in an array of Tcl_Objs. Extra
- * slots are allocated for the
- *
- * Results:
- * A standard TCL result. The name of the new notifier is returned in
- * the interpreter result. Otherwise, if it failed to parse a switch,
- * then TCL_ERROR is returned and an error message is left in the
- * interpreter result.
- *
- * Example:
- * table0 column notify col ?flags? command arg
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnNotifyOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableColumn col;
- Blt_TableRowColumnSpec spec;
- NotifierInfo *niPtr;
- NotifySwitches switches;
- const char *tag, *string;
- int count, i;
- int nArgs;
-
- table = cmdPtr->table;
- spec = Blt_Table_ColumnSpec(table, objv[3], &string);
- col = NULL;
- tag = NULL;
- if (spec == TABLE_SPEC_TAG) {
- tag = string;
- } else {
- col = Blt_Table_FindColumn(interp, table, objv[3]);
- if (col == NULL) {
- return TCL_ERROR;
- }
- }
- count = 0;
- for (i = 4; i < objc; i++) {
- const char *string;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] != '-') {
- break;
- }
- count++;
- }
- switches.flags = 0;
- /* Process switches */
- if (Blt_ParseSwitches(interp, notifySwitches, count, objv + 4, &switches,
- 0) < 0) {
- return TCL_ERROR;
- }
- niPtr = Blt_AssertMalloc(sizeof(NotifierInfo));
- niPtr->cmdPtr = cmdPtr;
- if (tag == NULL) {
- niPtr->notifier = Blt_Table_CreateColumnNotifier(interp, cmdPtr->table,
- col, switches.flags, NotifyProc, NotifierDeleteProc, niPtr);
- } else {
- niPtr->notifier = Blt_Table_CreateColumnTagNotifier(interp,
- cmdPtr->table, tag, switches.flags, NotifyProc,
- NotifierDeleteProc, niPtr);
- }
- nArgs = (objc - i) + 2;
- /* Stash away the command in structure and pass that to the notifier. */
- niPtr->cmdv = Blt_AssertMalloc(nArgs * sizeof(Tcl_Obj *));
- for (count = 0; i < objc; i++, count++) {
- Tcl_IncrRefCount(objv[i]);
- niPtr->cmdv[count] = objv[i];
- }
- niPtr->cmdc = nArgs;
- if (switches.flags == 0) {
- switches.flags = TABLE_NOTIFY_ALL_EVENTS;
- }
- {
- char notifyId[200];
- Blt_HashEntry *hPtr;
- int isNew;
-
- sprintf_s(notifyId, 200, "notify%d", cmdPtr->nextNotifyId++);
- hPtr = Blt_CreateHashEntry(&cmdPtr->notifyTable, notifyId, &isNew);
- assert(isNew);
- Blt_SetHashValue(hPtr, niPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), notifyId, -1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnSetOp --
- *
- * Sets one of values in a column. One or more columns may be set using
- * a tag. The row order is always the table's current view of the table.
- * There may be less values than needed.
- *
- * Results:
- * A standard TCL result. If the tag or column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column set $column a 1 b 2 c 3
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnSetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TableIterator iter;
- Blt_TableColumn col;
- Blt_Table table;
-
- table = cmdPtr->table;
- /* May set more than one row with the same values. */
- if (IterateColumns(interp, table, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 4) {
- return TCL_OK;
- }
- if ((objc - 4) & 1) {
- Tcl_AppendResult(interp, "odd # of row/value pairs: should be \"",
- Tcl_GetString(objv[0]), " column assign col row value...",
- (char *)NULL);
- return TCL_ERROR;
- }
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- long i;
-
- /* The remaining arguments are index/value pairs. */
- for (i = 4; i < objc; i += 2) {
- Blt_TableRow row;
-
- row = Blt_Table_FindRow(interp, table, objv[i]);
- if (row == NULL) {
- /* Can't find the row. Create it and try to find it again. */
- if (MakeRows(interp, table, objv[i]) != TCL_OK) {
- return TCL_ERROR;
- }
- row = Blt_Table_FindRow(interp, table, objv[i]);
- }
- if (Blt_Table_SetObj(table, row, col, objv[i+1]) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTagAddOp --
- *
- * Adds a given tag to one or more columns. Tag names can't start with a
- * digit (to distinquish them from node ids) and can't be a reserved tag
- * ("all" or "end").
- *
- * .t column tag add tag ?column...?
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnTagAddOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- int i;
- const char *tagName;
-
- table = cmdPtr->table;
- tagName = Tcl_GetString(objv[4]);
- if (Blt_Table_SetColumnTag(interp, table, NULL, tagName) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 5; i < objc; i++) {
- Blt_TableColumn col;
- Blt_TableIterator iter;
-
- if (Blt_Table_IterateColumns(interp, table, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- if (Blt_Table_SetColumnTag(interp, table, col, tagName) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTagDeleteOp --
- *
- * Removes a given tag from one or more columns. If a tag doesn't exist or
- * is a reserved tag ("all" or "end"), nothing will be done and no error
- * message will be returned.
- *
- * .t column tag delete tag ?column...?
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnTagDeleteOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableIterator iter;
- int i;
- const char *tagName;
-
- table = cmdPtr->table;
- tagName = Tcl_GetString(objv[4]);
- for (i = 5; i < objc; i++) {
- Blt_TableColumn col;
-
- if (Blt_Table_IterateColumns(interp, table, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- if (Blt_Table_UnsetColumnTag(interp, table, col, tagName)!=TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTagExistsOp --
- *
- * Returns the existence of a tag in the table. If a column is
- * specified then the tag is search for for that column.
- *
- * .t tag column exists tag ?column?
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ColumnTagExistsOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int bool;
- const char *tagName;
- Blt_Table table;
-
- tagName = Tcl_GetString(objv[3]);
- table = cmdPtr->table;
- bool = (Blt_Table_FindColumnTagTable(table, tagName) != NULL);
- if (objc == 5) {
- Blt_TableColumn col;
-
- col = Blt_Table_FindColumn(interp, table, objv[4]);
- if (col == NULL) {
- bool = FALSE;
- } else {
- bool = Blt_Table_HasColumnTag(table, col, tagName);
- }
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTagForgetOp --
- *
- * Removes the given tags from all nodes.
- *
- * Example:
- * $t column tag forget tag1 tag2 tag3...
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ColumnTagForgetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 4; i < objc; i++) {
- if (Blt_Table_ForgetColumnTag(interp, cmdPtr->table,
- Tcl_GetString(objv[i])) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTagGetOp --
- *
- * Returns the tag names for a given column. If one of more pattern
- * arguments are provided, then only those matching tags are returned.
- *
- * .t column tag get column pat1 pat2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnTagGetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch hsearch;
- Blt_HashTable tagTable;
- Blt_Table table;
- Blt_TableColumn col;
- Blt_TableIterator iter;
- Tcl_Obj *listObjPtr;
-
- table = cmdPtr->table;
- if (Blt_Table_IterateColumns(interp, table, objv[4], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
-
- Blt_InitHashTable(&tagTable, BLT_STRING_KEYS);
-
- /* Collect all the tags into a hash table. */
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- Blt_Chain chain;
- Blt_ChainLink link;
-
- chain = Blt_Table_ColumnTags(table, col);
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- const char *tagName;
- int isNew;
-
- tagName = Blt_Chain_GetValue(link);
- Blt_CreateHashEntry(&tagTable, tagName, &isNew);
- }
- Blt_Chain_Destroy(chain);
- }
- for (hPtr = Blt_FirstHashEntry(&tagTable, &hsearch); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&hsearch)) {
- int match;
- const char *tagName;
-
- tagName = Blt_GetHashKey(&tagTable, hPtr);
- match = TRUE;
- if (objc > 5) {
- int i;
-
- match = FALSE;
- for (i = 5; i < objc; i++) {
- if (Tcl_StringMatch(tagName, Tcl_GetString(objv[i]))) {
- match = TRUE;
- }
- }
- }
- if (match) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(tagName, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Blt_DeleteHashTable(&tagTable);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-
-static unsigned char *
-GetColumnTagMatches(Tcl_Interp *interp, Blt_Table table, int objc,
- Tcl_Obj *const *objv)
-{
- long nCols;
- int i;
- unsigned char *matches;
-
- nCols = Blt_Table_NumColumns(table);
- matches = Blt_AssertCalloc(nCols + 1, sizeof(unsigned char));
- /* Handle the reserved tags "all" or "end". */
- for (i = 0; i < objc; i++) {
- char *tagName;
- long j;
-
- tagName = Tcl_GetString(objv[i]);
- if (strcmp("all", tagName) == 0) {
- for (j = 1; j <= nCols; j++) {
- matches[j] = TRUE;
- }
- return matches; /* Don't care other tags. */
- }
- if (strcmp("end", tagName) == 0) {
- matches[nCols] = TRUE;
- }
- }
- /* Now check user-defined tags. */
- for (i = 0; i < objc; i++) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Blt_HashTable *tagTablePtr;
- const char *tagName;
-
- tagName = Tcl_GetString(objv[i]);
- if ((strcmp("all", tagName) == 0) || (strcmp("end", tagName) == 0)) {
- continue;
- }
- tagTablePtr = Blt_Table_FindColumnTagTable(table, tagName);
- if (tagTablePtr == NULL) {
- Tcl_AppendResult(interp, "unknown column tag \"", tagName, "\"",
- (char *)NULL);
- Blt_Free(matches);
- return NULL;
- }
- for (hPtr = Blt_FirstHashEntry(tagTablePtr, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_TableColumn col;
- long j;
-
- col = Blt_GetHashValue(hPtr);
- j = Blt_Table_ColumnIndex(col);
- assert(j >= 0);
- matches[j] = TRUE;
- }
- }
- return matches;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTagIndicesOp --
- *
- * Returns column indices names for the given tags. If one of more tag
- * names are provided, then only those matching indices are returned.
- *
- * Example:
- * .t column tag indices tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnTagIndicesOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- long j;
- long nCols;
- unsigned char *matches;
-
- matches = GetColumnTagMatches(interp, cmdPtr->table, objc - 4, objv + 4);
- if (matches == NULL) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- nCols = Blt_Table_NumColumns(cmdPtr->table);
- for (j = 1; j <= nCols; j++) {
- if (matches[j]) {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewLongObj(j));
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- Blt_Free(matches);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTagLabelsOp --
- *
- * Returns column labels for the given tags. If one of more tag
- * names are provided, then only those matching indices are returned.
- *
- * Example:
- * .t column tag labels tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnTagLabelsOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- long j;
- long nCols;
- unsigned char *matches;
-
- matches = GetColumnTagMatches(interp, cmdPtr->table, objc - 4, objv + 4);
- if (matches == NULL) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- nCols = Blt_Table_NumColumns(cmdPtr->table);
- for (j = 1; j <= nCols; j++) {
- if (matches[j]) {
- Blt_TableColumn col;
- Tcl_Obj *objPtr;
-
- col = Blt_Table_Column(cmdPtr->table, j);
- objPtr = Tcl_NewStringObj(Blt_Table_ColumnLabel(col), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- Blt_Free(matches);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTagRangeOp --
- *
- * Adds one or more tags for a given column. Tag names can't start with
- * a digit (to distinquish them from node ids) and can't be a reserved
- * tag ("all" or "end").
- *
- * Example:
- * .t column tag range $from $to tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnTagRangeOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableColumn from, to;
- int i;
-
- table = cmdPtr->table;
- from = Blt_Table_FindColumn(interp, table, objv[4]);
- if (from == NULL) {
- return TCL_ERROR;
- }
- to = Blt_Table_FindColumn(interp, table, objv[5]);
- if (to == NULL) {
- return TCL_ERROR;
- }
- if (Blt_Table_ColumnIndex(from) > Blt_Table_ColumnIndex(to)) {
- Blt_TableColumn tmp;
- tmp = to, to = from, from = tmp;
- }
- for (i = 6; i < objc; i++) {
- const char *tagName;
- long j;
-
- tagName = Tcl_GetString(objv[i]);
- for (j = Blt_Table_ColumnIndex(from); j <= Blt_Table_ColumnIndex(to);
- j++) {
- Blt_TableColumn col;
-
- col = Blt_Table_Column(table, j);
- if (Blt_Table_SetColumnTag(interp, table, col, tagName) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTagSearchOp --
- *
- * Returns tag names for a given column. If one of more pattern
- * arguments are provided, then only those matching tags are returned.
- *
- * Example:
- * .t column tag find $column pat1 pat2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnTagSearchOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableIterator iter;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Tcl_Obj *listObjPtr;
-
- table = cmdPtr->table;
- if (Blt_Table_IterateColumns(interp, table, objv[4], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (hPtr = Blt_Table_FirstColumnTag(table, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_HashTable *tablePtr;
- Blt_TableColumn col;
-
- tablePtr = Blt_GetHashValue(hPtr);
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- Blt_HashEntry *h2Ptr;
-
- h2Ptr = Blt_FindHashEntry(tablePtr, (char *)col);
- if (h2Ptr != NULL) {
- const char *tagName;
- int match;
- int i;
-
- match = (objc == 5);
- tagName = hPtr->key.string;
- for (i = 5; i < objc; i++) {
- if (Tcl_StringMatch(tagName, Tcl_GetString(objv[i]))) {
- match = TRUE;
- break; /* Found match. */
- }
- }
- if (match) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(tagName, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- break; /* Tag matches this column. Don't care if it
- * matches any other columns. */
- }
- }
- }
- }
-
- /* Handle reserved tags specially. */
- {
- int i;
- int allMatch, endMatch;
-
- endMatch = allMatch = (objc == 5);
- for (i = 5; i < objc; i++) {
- if (Tcl_StringMatch("all", Tcl_GetString(objv[i]))) {
- allMatch = TRUE;
- }
- if (Tcl_StringMatch("end", Tcl_GetString(objv[i]))) {
- endMatch = TRUE;
- }
- }
- if (allMatch) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("all", 3));
- }
- if (endMatch) {
- Blt_TableColumn col, lastCol;
-
- lastCol = Blt_Table_Column(table, Blt_Table_NumColumns(table));
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- if (col == lastCol) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("end", 3));
- break;
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTagSetOp --
- *
- * Adds one or more tags for a given column. Tag names can't start with a
- * digit (to distinquish them from node ids) and can't be a reserved tag
- * ("all" or "end").
- *
- * .t column tag set $column tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnTagSetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableIterator iter;
- int i;
-
- table = cmdPtr->table;
- if (Blt_Table_IterateColumns(interp, table, objv[4], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 5; i < objc; i++) {
- const char *tagName;
- Blt_TableColumn col;
-
- tagName = Tcl_GetString(objv[i]);
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- if (Blt_Table_SetColumnTag(interp, table, col, tagName) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTagUnsetOp --
- *
- * Removes one or more tags from a given column. If a tag doesn't exist or
- * is a reserved tag ("all" or "end"), nothing will be done and no error
- * message will be returned.
- *
- * .t column tag unset $column tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnTagUnsetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableIterator iter;
- int i;
-
- table = cmdPtr->table;
- if (Blt_Table_IterateColumns(interp, table, objv[4], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 5; i < objc; i++) {
- const char *tagName;
- Blt_TableColumn col;
-
- tagName = Tcl_GetString(objv[i]);
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- if (Blt_Table_UnsetColumnTag(interp, table, col, tagName)!=TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTagOp --
- *
- * This procedure is invoked to process tag operations.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec columnTagOps[] =
-{
- {"add", 1, ColumnTagAddOp, 5, 0, "tag ?column...?",},
- {"delete", 1, ColumnTagDeleteOp, 5, 0, "tag ?column...?",},
- {"exists", 1, ColumnTagExistsOp, 4, 5, "tag ?column?",},
- {"forget", 1, ColumnTagForgetOp, 4, 0, "?tag...?",},
- {"get", 1, ColumnTagGetOp, 5, 0, "column ?pattern...?",},
- {"indices", 1, ColumnTagIndicesOp, 4, 0, "?tag...?",},
- {"labels", 1, ColumnTagLabelsOp, 4, 0, "?tag...?",},
- {"range", 1, ColumnTagRangeOp, 6, 0, "from to ?tag...?",},
- {"search", 3, ColumnTagSearchOp, 5, 6, "column ?pattern?",},
- {"set", 3, ColumnTagSetOp, 5, 0, "column tag...",},
- {"unset", 1, ColumnTagUnsetOp, 5, 0, "column tag...",},
-
-};
-
-static int nColumnTagOps = sizeof(columnTagOps) / sizeof(Blt_OpSpec);
-
-static int
-ColumnTagOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- CmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nColumnTagOps, columnTagOps, BLT_OP_ARG3,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc)(cmdPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTraceOp --
- *
- * Creates a trace for this instance. Traces represent list of keys, a
- * bitmask of trace flags, and a command prefix to be invoked when a
- * matching trace event occurs.
- *
- * The command prefix is parsed and saved in an array of Tcl_Objs. The
- * qualified name of the instance is saved also.
- *
- * Results:
- * A standard TCL result. The name of the new trace is returned in the
- * interpreter result. Otherwise, if it failed to parse a switch, then
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column trace tag rwx proc
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ColumnTraceOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TableIterator iter;
- Blt_TableTrace trace;
- TraceInfo *tiPtr;
- const char *tag;
- int flags;
- Blt_TableColumn col;
- Blt_Table table;
-
- table = cmdPtr->table;
- if (Blt_Table_IterateColumns(interp, table, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- flags = GetTraceFlags(Tcl_GetString(objv[4]));
- if (flags < 0) {
- Tcl_AppendResult(interp, "unknown flag in \"", Tcl_GetString(objv[4]),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- col = NULL;
- tag = NULL;
- if (iter.type == TABLE_ITERATOR_RANGE) {
- Tcl_AppendResult(interp, "can't trace range of columns: use a tag",
- (char *)NULL);
- return TCL_ERROR;
- }
- if ((iter.type == TABLE_ITERATOR_INDEX) ||
- (iter.type == TABLE_ITERATOR_LABEL)) {
- col = Blt_Table_FirstTaggedColumn(&iter);
- } else {
- tag = iter.tagName;
- }
- tiPtr = Blt_Malloc(sizeof(TraceInfo));
- if (tiPtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate trace: out of memory",
- (char *)NULL);
- return TCL_ERROR;
- }
- trace = Blt_Table_CreateTrace(table, NULL, col, NULL, tag, flags,
- TraceProc, TraceDeleteProc, tiPtr);
- if (trace == NULL) {
- Tcl_AppendResult(interp, "can't create column trace: out of memory",
- (char *)NULL);
- Blt_Free(tiPtr);
- return TCL_ERROR;
- }
- /* Initialize the trace information structure. */
- tiPtr->cmdPtr = cmdPtr;
- tiPtr->trace = trace;
- tiPtr->tablePtr = &cmdPtr->traceTable;
- {
- Tcl_Obj **elv, **cmdv;
- int elc, i;
-
- if (Tcl_ListObjGetElements(interp, objv[5], &elc, &elv) != TCL_OK) {
- return TCL_ERROR;
- }
- cmdv = Blt_AssertCalloc(elc + 1 + 3 + 1, sizeof(Tcl_Obj *));
- for(i = 0; i < elc; i++) {
- cmdv[i] = elv[i];
- Tcl_IncrRefCount(cmdv[i]);
- }
- cmdv[i] = Tcl_NewStringObj(cmdPtr->hPtr->key.string, -1);
- Tcl_IncrRefCount(cmdv[i]);
- tiPtr->cmdc = elc;
- tiPtr->cmdv = cmdv;
- }
- {
- char traceId[200];
- int isNew;
-
- sprintf_s(traceId, 200, "trace%d", cmdPtr->nextTraceId++);
- tiPtr->hPtr = Blt_CreateHashEntry(&cmdPtr->traceTable, traceId, &isNew);
- Blt_SetHashValue(tiPtr->hPtr, tiPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), traceId, -1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnTypeOp --
- *
- * Reports and/or sets the type of a column.
- *
- * Results:
- * A standard TCL result. If successful, the old column label is
- * returned in the interpreter result. If the column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column type column ?newType?
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnTypeOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TableIterator iter;
- Tcl_Obj *listObjPtr;
- Blt_TableColumn col;
- Blt_Table table;
- Blt_TableColumnType type;
-
- table = cmdPtr->table;
- if (Blt_Table_IterateColumns(interp, table, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- if (objc == 5) {
- type = Blt_Table_GetColumnType(Tcl_GetString(objv[4]));
- if (type == TABLE_COLUMN_TYPE_UNKNOWN) {
- Tcl_AppendResult(interp, "unknown column type \"",
- Tcl_GetString(objv[4]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- Tcl_Obj *objPtr;
-
- if (objc == 5) {
- if (Blt_Table_SetColumnType(table, col, type) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- type = Blt_Table_ColumnType(col);
- objPtr = Tcl_NewStringObj(Blt_Table_NameOfType(type), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnUnsetOp --
- *
- * Unsets one or more columns of values. One or more columns may be
- * unset (using tags or multiple arguments). It's an error if the column
- * doesn't exist.
- *
- * Results:
- * A standard TCL result. If the tag or column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column unset column ?column?
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnUnsetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
- Blt_Table table;
-
- table = cmdPtr->table;
- for (i = 3; i < objc; i++) {
- Blt_TableIterator iter;
- Blt_TableColumn col;
-
- if (Blt_Table_IterateColumns(interp, table, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- Blt_TableRow row;
-
- for (row = Blt_Table_FirstRow(table); row != NULL;
- row = Blt_Table_NextRow(table, row)) {
- if (Blt_Table_UnsetValue(table, row, col) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnUniqueOp --
- *
- * Reports the unique values for a given column.
- *
- * Results:
- * A standard TCL result. If the tag or column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t column unique column
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnUniqueOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashTable values;
- Blt_Table table;
- Tcl_Obj *listObjPtr;
- Blt_TableColumn col;
- Blt_TableRow row;
- UniqueSwitches switches;
-
- table = cmdPtr->table;
- col = Blt_Table_FindColumn(interp, table, objv[3]);
- if (col == NULL) {
- return TCL_ERROR;
- }
- switches.flags = 0;
- if (Blt_ParseSwitches(interp, uniqueSwitches, objc - 4, objv + 4,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- Blt_InitHashTableWithPool(&values, BLT_STRING_KEYS);
- for (row = Blt_Table_FirstRow(table); row != NULL;
- row = Blt_Table_NextRow(table, row)) {
- Blt_HashEntry *hPtr;
- const char *string;
- int isNew;
- long refCount;
-
- string = Blt_Table_GetString(table, row, col);
- if (string == NULL) {
- string = cmdPtr->emptyValue;
- }
- hPtr = Blt_CreateHashEntry(&values, string, &isNew);
- if (isNew) {
- refCount = 0;
- } else {
- refCount = (long)Blt_GetHashValue(hPtr);
- }
- refCount++;
- Blt_SetHashValue(hPtr, (long)refCount);
- }
- listObjPtr = SortColumnValues(interp, &values, switches.flags);
- Blt_DeleteHashTable(&values);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnValuesOp --
- *
- * Retrieves a column of values. The column argument can be either a
- * tag, label, or column index. If it is a tag, it must refer to exactly
- * one column.
- *
- * Results:
- * A standard TCL result. If successful, a list of values is returned in
- * the interpreter result. If the column index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t column values column ?valueList?
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnValuesOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableColumn col;
-
- table = cmdPtr->table;
- col = Blt_Table_FindColumn(interp, cmdPtr->table, objv[3]);
- if (col == NULL) {
- return TCL_ERROR;
- }
- if (objc == 4) {
- Blt_TableRow row;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (row = Blt_Table_FirstRow(cmdPtr->table); row != NULL;
- row = Blt_Table_NextRow(cmdPtr->table, row)) {
- Tcl_Obj *objPtr;
-
- objPtr = Blt_Table_GetObj(cmdPtr->table, row, col);
- if (objPtr == NULL) {
- objPtr = Tcl_NewStringObj(cmdPtr->emptyValue, -1);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- } else {
- Tcl_Obj **elv;
- int elc;
- int i;
-
- if (Tcl_ListObjGetElements(interp, objv[4], &elc, &elv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (elc > Blt_Table_NumRows(table)) {
- long needed;
-
- needed = elc - Blt_Table_NumRows(table);
- if (Blt_Table_ExtendRows(interp, table, needed, NULL) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- for (i = 0; i < elc; i++) {
- Blt_TableRow row;
-
- row = Blt_Table_Row(cmdPtr->table, i + 1);
- if (Blt_Table_SetObj(table, row, col, elv[i]) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnOp --
- *
- * Parses the given command line and calls one of several column-specific
- * operations.
- *
- * Results:
- * Returns a standard TCL result. It is the result of operation called.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec columnOps[] =
-{
- {"copy", 2, ColumnCopyOp, 4, 0, "src dest ?switches...?",},
- {"create", 2, ColumnCreateOp, 3, 0, "?switches?",},
- {"delete", 2, ColumnDeleteOp, 4, 0, "column...",},
- {"dup", 2, ColumnDupOp, 3, 0, "column...",},
- {"exists", 3, ColumnExistsOp, 4, 4, "column",},
- {"extend", 3, ColumnExtendOp, 4, 0, "label ?label...?",},
- {"get", 1, ColumnGetOp, 4, 0, "column ?switches?",},
- {"index", 4, ColumnIndexOp, 4, 4, "column",},
- {"indices",4, ColumnIndicesOp, 3, 0, "column ?column...?",},
- {"label", 5, ColumnLabelOp, 4, 0, "column ?label?",},
- {"labels", 6, ColumnLabelsOp, 3, 4, "?labelList?",},
- {"length", 2, ColumnLengthOp, 3, 3, "",},
- {"move", 1, ColumnMoveOp, 5, 6, "from to ?count?",},
- {"names", 2, ColumnNamesOp, 3, 0, "?pattern...?",},
- {"notify", 2, ColumnNotifyOp, 5, 0, "column ?flags? command",},
- {"set", 2, ColumnSetOp, 5, 0, "column row value...",},
- {"tag", 2, ColumnTagOp, 3, 0, "op args...",},
- {"trace", 2, ColumnTraceOp, 6, 6, "column how command",},
- {"type", 2, ColumnTypeOp, 4, 5, "column ?type?",},
- {"unique", 3, ColumnUniqueOp, 4, 0, "column ?switches?",},
- {"unset", 3, ColumnUnsetOp, 4, 0, "column...",},
- {"values", 1, ColumnValuesOp, 4, 5, "column ?valueList?",},
-};
-
-static int nColumnOps = sizeof(columnOps) / sizeof(Blt_OpSpec);
-
-static int
-ColumnOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- CmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nColumnOps, columnOps, BLT_OP_ARG2, objc,
- objv, BLT_OP_LINEAR_SEARCH);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (cmdPtr, interp, objc, objv);
- return result;
-}
-
-/************ Row Operations ***************/
-
-
-static int
-CopyRow(Tcl_Interp *interp, Blt_Table srcTable, Blt_Table destTable,
- Blt_TableRow srcRow, /* Row offset in the source table. */
- Blt_TableRow destRow) /* Row offset in the destination. */
-{
- long i;
-
- if ((Blt_Table_SameTableObject(srcTable, destTable)) &&
- (srcRow == destRow)) {
- return TCL_OK; /* Source and destination are the same. */
- }
- if (Blt_Table_NumColumns(srcTable) > Blt_Table_NumColumns(destTable)) {
- long needed;
-
- needed = Blt_Table_NumColumns(srcTable) -
- Blt_Table_NumColumns(destTable);
- if (Blt_Table_ExtendColumns(interp, destTable, needed, NULL)!=TCL_OK) {
- return TCL_ERROR;
- }
- }
- for (i = 1; i <= Blt_Table_NumColumns(srcTable); i++) {
- Blt_TableColumn col;
- Blt_TableValue value;
-
- col = Blt_Table_Column(srcTable, i);
- value = Blt_Table_GetValue(srcTable, srcRow, col);
- col = Blt_Table_Column(destTable, i);
- if (Blt_Table_SetValue(destTable, destRow, col, value)!= TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-static void
-CopyRowTags(Blt_Table srcTable, Blt_Table destTable,
- Blt_TableRow srcRow, /* Row offset in the source table. */
- Blt_TableRow destRow) /* Row offset in the destination. */
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- /* Find all tags for with this row index. */
- for (hPtr = Blt_Table_FirstRowTag(srcTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *h2Ptr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tablePtr, (char *)srcRow);
- if (h2Ptr != NULL) {
- /* We know the tag tables are keyed by strings, so we don't need
- * to call Blt_GetHashKey and hence the hash table pointer to
- * retrieve the key. */
- Blt_Table_SetRowTag(NULL, destTable, destRow, hPtr->key.string);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowCopyOp --
- *
- * Copies the specified rows to the table. A different table may be
- * selected as the source.
- *
- * Results:
- * A standard TCL result. If the tag or row index is invalid, TCL_ERROR
- * is returned and an error message is left in the interpreter result.
- *
- * Example:
- * $dest row copy $srcrow $destrow ?-table srcTable?
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowCopyOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- CopySwitches switches;
- Blt_Table srcTable, destTable;
- int result;
- Blt_TableRow src, dest;
-
- /* Process switches following the row names. */
- switches.flags = 0;
- switches.table = NULL;
- result = TCL_ERROR;
- if (Blt_ParseSwitches(interp, copySwitches, objc - 5, objv + 5,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- goto error;
- }
- srcTable = destTable = cmdPtr->table;
- if (switches.table != NULL) {
- srcTable = switches.table;
- }
- src = Blt_Table_FindRow(interp, srcTable, objv[3]);
- if (src == NULL) {
- goto error;
- }
- dest = Blt_Table_FindRow(interp, destTable, objv[4]);
- if (dest == NULL) {
- dest = Blt_Table_CreateRow(interp, destTable, Tcl_GetString(objv[4]));
- if (dest == NULL) {
- goto error;
- }
- }
- if (CopyRow(interp, srcTable, destTable, src, dest) != TCL_OK) {
- goto error;
- }
- if ((switches.flags & COPY_NOTAGS) == 0) {
- CopyRowTags(srcTable, destTable, src, dest);
- }
- result = TCL_OK;
- error:
- Blt_FreeSwitches(copySwitches, &switches, 0);
- return result;
-
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowDeleteOp --
- *
- * Deletes the rows designated. One or more rows may be deleted using a
- * tag.
- *
- * Results:
- * A standard TCL result. If the tag or row index is invalid, TCL_ERROR
- * is returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row delete ?row?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowDeleteOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TableIterator iter;
- Blt_TableRow row;
- int result;
-
- result = TCL_ERROR;
- if (Blt_Table_IterateRowsObjv(interp, cmdPtr->table, objc - 3, objv + 3,
- &iter) != TCL_OK) {
- goto error;
- }
- /* Walk through the list of row offsets, deleting each row. */
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- if (Blt_Table_DeleteRow(cmdPtr->table, row) != TCL_OK) {
- goto error;
- }
- }
- result = TCL_OK;
- error:
- Blt_Table_FreeIteratorObjv(&iter);
- return result;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowDupOp --
- *
- * Duplicates the specified rows in the table. This differs from
- * RowCopyOp, since the same table is always the source and destination.
- *
- * Results:
- * A standard TCL result. If the tag or row index is invalid, TCL_ERROR
- * is returned and an error message is left in the interpreter result.
- *
- * Example:
- * $dest row dup label ?label?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowDupOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- Blt_TableIterator iter;
- Blt_TableRow src;
- int result;
-
- if (Blt_Table_IterateRowsObjv(interp, cmdPtr->table, objc - 3, objv + 3,
- &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- result = TCL_ERROR;
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (src = Blt_Table_FirstTaggedRow(&iter); src != NULL;
- src = Blt_Table_NextTaggedRow(&iter)) {
- const char *label;
- long j;
- Blt_TableRow dest;
-
- label = Blt_Table_RowLabel(src);
- dest = Blt_Table_CreateRow(interp, cmdPtr->table, label);
- if (dest == NULL) {
- goto error;
- }
- if (CopyRow(interp, cmdPtr->table, cmdPtr->table, src, dest)!= TCL_OK) {
- goto error;
- }
- CopyRowTags(cmdPtr->table, cmdPtr->table, src, dest);
- j = Blt_Table_RowIndex(dest);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewLongObj(j));
- }
- Tcl_SetObjResult(interp, listObjPtr);
- result = TCL_OK;
- error:
- Blt_Table_FreeIteratorObjv(&iter);
- if (result != TCL_OK) {
- Tcl_DecrRefCount(listObjPtr);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowExistsOp --
- *
- * Indicates is the given row exists.
- *
- * Results:
- * A standard TCL result. If the tag or row index is invalid, TCL_ERROR
- * is returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row exists n
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowExistsOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int bool;
- Blt_TableRow row;
-
- row = Blt_Table_FindRow(NULL, cmdPtr->table, objv[3]);
- bool = (row != NULL);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowExtendOp --
- *
- * Extends the table by the given number of rows.
- *
- * Results:
- * A standard TCL result. If the tag or row index is invalid, TCL_ERROR
- * is returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row extend n
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowExtendOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- Blt_TableRow *rows;
- long i, n;
- int addLabels;
-
- addLabels = FALSE;
- if (objc == 3) {
- return TCL_OK;
- }
- n = 0;
- if ((objc > 4) || (Tcl_GetLongFromObj(NULL, objv[3], &n) != TCL_OK)) {
- n = objc - 3;
- addLabels = TRUE;
- }
- if (n == 0) {
- return TCL_OK;
- }
- if (n < 0) {
- Tcl_AppendResult(interp, "bad count \"", Blt_Itoa(n),
- "\": # rows can't be negative.", (char *)NULL);
- return TCL_ERROR;
- }
- rows = Blt_AssertMalloc(n * sizeof(Blt_TableRow));
- if (Blt_Table_ExtendRows(interp, cmdPtr->table, n, rows) != TCL_OK) {
- Blt_Free(rows);
- goto error;
- }
- if (addLabels) {
- long j;
-
- for (i = 0, j = 3; i < n; i++, j++) {
- if (Blt_Table_SetRowLabel(interp, cmdPtr->table, rows[i],
- Tcl_GetString(objv[j])) != TCL_OK) {
- goto error;
- }
- }
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (i = 0; i < n; i++) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewLongObj(Blt_Table_RowIndex(rows[i]));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- Blt_Free(rows);
- return TCL_OK;
- error:
- Blt_Free(rows);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowGetOp --
- *
- * Retrieves the values from a given row. The row argument can be either
- * a tag, label, or row index. If it is a tag, it must refer to exactly
- * one row. An optional argument specifies how to return empty values.
- * By default, the global empty value representation is used.
- *
- * Results:
- * A standard TCL result. If successful, a list of values is returned in
- * the interpreter result. If the row index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row get row ?col...?
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowGetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- Blt_TableRow row;
- Blt_Table table;
- const char *string;
- int needLabels;
-
- string = Tcl_GetString(objv[3]);
- needLabels = FALSE;
- if (strcmp(string, "-labels") == 0) {
- objv++, objc--;
- needLabels = TRUE;
- }
- table = cmdPtr->table;
- row = Blt_Table_FindRow(interp, table, objv[3]);
- if (row == NULL) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- if (objc == 4) {
- Blt_TableColumn col;
-
- for (col = Blt_Table_FirstColumn(table); col != NULL;
- col = Blt_Table_NextColumn(table, col)) {
- Tcl_Obj *objPtr;
-
- if (needLabels) {
- objPtr = Tcl_NewStringObj(Blt_Table_ColumnLabel(col), -1);
- } else {
- objPtr = Tcl_NewLongObj(Blt_Table_ColumnIndex(col));
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Blt_Table_GetObj(table, row, col);
- if (objPtr == NULL) {
- objPtr = Tcl_NewStringObj(cmdPtr->emptyValue, -1);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- } else {
- Blt_TableIterator iter;
- Blt_TableColumn col;
-
- if (Blt_Table_IterateColumnsObjv(interp, table, objc - 4, objv + 4,
- &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (col = Blt_Table_FirstTaggedColumn(&iter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&iter)) {
- Tcl_Obj *objPtr;
-
- if (needLabels) {
- objPtr = Tcl_NewStringObj(Blt_Table_ColumnLabel(col), -1);
- } else {
- objPtr = Tcl_NewLongObj(Blt_Table_ColumnIndex(col));
- }
- objPtr = Tcl_NewLongObj(Blt_Table_ColumnIndex(col));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Blt_Table_GetObj(table, row, col);
- if (objPtr == NULL) {
- objPtr = Tcl_NewStringObj(cmdPtr->emptyValue, -1);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowIndexOp --
- *
- * Returns the row index of the given row tag, label, or index. A tag
- * can't represent more than one row.
- *
- * Results:
- * A standard TCL result. If the tag or row index is invalid, TCL_ERROR
- * is returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row index $row
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowIndexOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TableRow row;
- long i;
-
- i = -1;
- row = Blt_Table_FindRow(NULL, cmdPtr->table, objv[3]);
- if (row != NULL) {
- i = Blt_Table_RowIndex(row);
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), i);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowIndicesOp --
- *
- * Returns a list of indices for the given rows.
- *
- * Results:
- * A standard TCL result. If the tag or row index is invalid, TCL_ERROR
- * is returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row indices $row $row
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowIndicesOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TableIterator iter;
- Blt_TableRow row;
- Tcl_Obj *listObjPtr;
-
- if (Blt_Table_IterateRowsObjv(interp, cmdPtr->table, objc - 3, objv + 3,
- &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewLongObj(Blt_Table_RowIndex(row));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- Blt_Table_FreeIteratorObjv(&iter);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowCreateOp --
- *
- * Creates a single new row into the table. The location of the new row
- * may be specified by -before or -after switches. By default the new
- * row is added to to the end of the table.
- *
- * Results:
- * A standard TCL result. If the tag or row index is invalid, TCL_ERROR
- * is returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row create -before 0 -after 1 -label label
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowCreateOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableRow row;
- InsertSwitches switches;
- unsigned int flags;
-
- switches.row = NULL;
- switches.label = NULL;
- switches.tags = NULL;
- switches.cmdPtr = cmdPtr;
- table = cmdPtr->table;
-
- flags = INSERT_ROW;
- if (Blt_ParseSwitches(interp, insertSwitches, objc - 3, objv + 3,
- &switches, flags) < 0) {
- goto error;
- }
- row = Blt_Table_CreateRow(interp, table, switches.label);
- if (row == NULL) {
- goto error;
- }
- if (switches.row != NULL) {
- if (Blt_Table_MoveRows(interp, table, row, switches.row, 1) != TCL_OK) {
- goto error;
- }
- }
- if (switches.tags != NULL) {
- Tcl_Obj **elv;
- int elc;
- int i;
-
- if (Tcl_ListObjGetElements(interp, switches.tags, &elc, &elv)
- != TCL_OK) {
- goto error;
- }
- for (i = 0; i < elc; i++) {
- if (Blt_Table_SetRowTag(interp, table, row, Tcl_GetString(elv[i]))
- != TCL_OK) {
- goto error;
- }
- }
- }
- Tcl_SetObjResult(interp, Tcl_NewLongObj(Blt_Table_RowIndex(row)));
- Blt_FreeSwitches(insertSwitches, &switches, flags);
- return TCL_OK;
- error:
- Blt_FreeSwitches(insertSwitches, &switches, flags);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowLabelOp --
- *
- * Gets/sets a label for one or more rows.
- *
- * Results:
- * A standard TCL result. If successful, the old row label is returned
- * in the interpreter result. If the row index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row label row ?label? ?row label?
- * $t row label 1
- * $t row label 1 newLabel
- * $t row label 1 lab1 2 lab2 3 lab3 5 lab5
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowLabelOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
-
- table = cmdPtr->table;
- if (objc == 4) {
- const char *label;
- Blt_TableRow row;
-
- row = Blt_Table_FindRow(interp, table, objv[3]);
- if (row == NULL) {
- return TCL_ERROR;
- }
- label = Blt_Table_RowLabel(row);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), label, -1);
- } else {
- int i;
-
- if ((objc - 3) & 1) {
- Tcl_AppendResult(interp,"odd # of row/label pairs: should be \"",
- Tcl_GetString(objv[0]), " row label ?row label?...",
- (char *)NULL);
- return TCL_ERROR;
- }
- for (i = 3; i < objc; i += 2) {
- Blt_TableRow row;
- const char *label;
-
- row = Blt_Table_FindRow(interp, table, objv[i]);
- if (row == NULL) {
- return TCL_ERROR;
- }
- label = Tcl_GetString(objv[i+1]);
- if (Blt_Table_SetRowLabel(interp, table, row, label) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowLabelsOp --
- *
- * Gets/sets all the row label in the table.
- *
- * Results:
- * A standard TCL result. If successful, a list of values is returned in
- * the interpreter result. If the row index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row labels ?labelList?
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowLabelsOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
-
- table = cmdPtr->table;
- if (objc == 3) {
- Blt_TableRow row;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (row = Blt_Table_FirstRow(table); row != NULL;
- row = Blt_Table_NextRow(table, row)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(Blt_Table_RowLabel(row), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- } else if (objc == 4) {
- Tcl_Obj **elv;
- int elc, n;
- int i;
- Blt_TableRow row;
-
- if (Tcl_ListObjGetElements(interp, objv[3], &elc, &elv) != TCL_OK) {
- return TCL_ERROR;
- }
- n = MIN(elc, Blt_Table_NumRows(table));
- for (i = 0, row = Blt_Table_FirstRow(table); (row != NULL) && (i < n);
- row = Blt_Table_NextRow(table, row), i++) {
- const char *label;
-
- label = Tcl_GetString(elv[i]);
- if (Blt_Table_SetRowLabel(interp, table, row, label) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowLengthOp --
- *
- * Returns the number of rows the client sees.
- *
- * Results:
- * A standard TCL result. If successful, the old row label is returned
- * in the interpreter result. If the row index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row label row ?newLabel?
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowLengthOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_SetLongObj(Tcl_GetObjResult(interp), Blt_Table_NumRows(cmdPtr->table));
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowMoveOp --
- *
- * Moves the given number of rows to another location in the table.
- *
- * Results:
- * A standard TCL result. If successful, a list of values is returned in
- * the interpreter result. If the row index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row move from to ?n?
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowMoveOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TableRow from, to;
- long count;
-
- from = Blt_Table_FindRow(interp, cmdPtr->table, objv[3]);
- if (from == NULL) {
- return TCL_ERROR;
- }
- to = Blt_Table_FindRow(interp, cmdPtr->table, objv[4]);
- if (to == NULL) {
- return TCL_ERROR;
- }
- count = 1;
- if (objc == 6) {
- long lcount;
-
- if (Tcl_GetLongFromObj(interp, objv[5], &lcount) != TCL_OK) {
- return TCL_ERROR;
-
- }
- if (lcount == 0) {
- return TCL_OK;
- }
- if (lcount < 0) {
- Tcl_AppendResult(interp, "# of rows can't be negative",
- (char *)NULL);
- return TCL_ERROR;
- }
- count = lcount;
- }
- return Blt_Table_MoveRows(interp, cmdPtr->table, from, to, count);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowNamesOp --
- *
- * Reports the labels of all rows.
- *
- * Results:
- * Always returns TCL_OK. The interpreter result is a list of row
- * labels.
- *
- * Example:
- * $t row names pattern...
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowNamesOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Tcl_Obj *listObjPtr;
- Blt_TableRow row;
-
- table = cmdPtr->table;
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (row = Blt_Table_FirstRow(table); row != NULL;
- row = Blt_Table_NextRow(table, row)) {
- const char *label;
- int match;
- int i;
-
- label = Blt_Table_RowLabel(row);
- match = (objc == 3);
- for (i = 3; i < objc; i++) {
- const char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- if (Tcl_StringMatch(label, pattern)) {
- match = TRUE;
- break;
- }
- }
- if (match) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(label, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowNotifyOp --
- *
- * Creates a notifier for this instance. Notifiers represent a bitmask
- * of events and a command prefix to be invoked when a matching event
- * occurs.
- *
- * The command prefix is parsed and saved in an array of Tcl_Objs. Extra
- * slots are allocated for the
- *
- * Results:
- * A standard TCL result. The name of the new notifier is returned in
- * the interpreter result. Otherwise, if it failed to parse a switch,
- * then TCL_ERROR is returned and an error message is left in the
- * interpreter result.
- *
- * Example:
- * table0 row notify row ?flags? command arg
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowNotifyOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- NotifierInfo *niPtr;
- NotifySwitches switches;
- const char *tag, *string;
- int count;
- int i;
- int nArgs;
- Blt_TableRow row;
- Blt_TableRowColumnSpec spec;
-
- table = cmdPtr->table;
- spec = Blt_Table_RowSpec(table, objv[3], &string);
- row = NULL;
- tag = NULL;
- if (spec == TABLE_SPEC_TAG) {
- tag = string;
- } else {
- row = Blt_Table_FindRow(interp, table, objv[3]);
- if (row == NULL) {
- return TCL_ERROR;
- }
- }
- count = 0;
- for (i = 4; i < objc; i++) {
- const char *string;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] != '-') {
- break;
- }
- count++;
- }
- switches.flags = 0;
- /* Process switches */
- if (Blt_ParseSwitches(interp, notifySwitches, count, objv + 4,
- &switches, 0) < 0) {
- return TCL_ERROR;
- }
- niPtr = Blt_AssertMalloc(sizeof(NotifierInfo));
- niPtr->cmdPtr = cmdPtr;
- if (tag == NULL) {
- niPtr->notifier = Blt_Table_CreateRowNotifier(interp, cmdPtr->table,
- row, switches.flags, NotifyProc, NotifierDeleteProc, niPtr);
- } else {
- niPtr->notifier = Blt_Table_CreateRowTagNotifier(interp,
- cmdPtr->table, tag, switches.flags, NotifyProc,
- NotifierDeleteProc, niPtr);
- }
- nArgs = (objc - i) + 2;
- /* Stash away the command in structure and pass that to the notifier. */
- niPtr->cmdv = Blt_AssertMalloc(nArgs * sizeof(Tcl_Obj *));
- for (count = 0; i < objc; i++, count++) {
- Tcl_IncrRefCount(objv[i]);
- niPtr->cmdv[count] = objv[i];
- }
- niPtr->cmdc = nArgs;
- if (switches.flags == 0) {
- switches.flags = TABLE_NOTIFY_ALL_EVENTS;
- }
- {
- char notifyId[200];
- Blt_HashEntry *hPtr;
- int isNew;
-
- sprintf_s(notifyId, 200, "notify%d", cmdPtr->nextNotifyId++);
- hPtr = Blt_CreateHashEntry(&cmdPtr->notifyTable, notifyId, &isNew);
- assert(isNew);
- Blt_SetHashValue(hPtr, niPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), notifyId, -1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowSetOp --
- *
- * Sets a row of values. One or more rows may be set using a tag. The
- * column order is always the table's current view of the table. There
- * may be less values than needed.
- *
- * Results:
- * A standard TCL result. If the tag or row index is invalid, TCL_ERROR
- * is returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row set row ?switches? ?column value?...
- * $t row set row ?switches? ?column value?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowSetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableIterator iter;
- long nCols;
- Blt_TableRow row;
-
- table = cmdPtr->table;
- /* May set more than one row with the same values. */
- if (IterateRows(interp, table, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 4) {
- return TCL_OK;
- }
- nCols = objc - 4;
- if (nCols & 1) {
- Tcl_AppendResult(interp, "odd # of column/value pairs: should be \"",
- Tcl_GetString(objv[0]), " row set column value...",
- (char *)NULL);
- return TCL_ERROR;
- }
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- long i;
-
- /* The remaining arguments are index/value pairs. */
- for (i = 4; i < objc; i += 2) {
- Blt_TableColumn col;
-
- col = Blt_Table_FindColumn(interp, table, objv[i]);
- if (col == NULL) {
- /* Can't find the column. Create it and try to find it
- * again. */
- if (MakeColumns(interp, table, objv[i]) != TCL_OK) {
- return TCL_ERROR;
- }
- col = Blt_Table_FindColumn(interp, table, objv[i]);
- }
- if (Blt_Table_SetObj(table, row, col, objv[i+1]) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowTagAddOp --
- *
- * Adds a given tag to one or more rows. Tag names can't start with a
- * digit (to distinquish them from node ids) and can't be a reserved tag
- * ("all" or "end").
- *
- * .t row tag add tag ?row...?
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowTagAddOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- int i;
- const char *tagName;
-
- table = cmdPtr->table;
- tagName = Tcl_GetString(objv[4]);
- if (Blt_Table_SetRowTag(interp, table, NULL, tagName) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 5; i < objc; i++) {
- Blt_TableRow row;
- Blt_TableIterator iter;
-
- if (Blt_Table_IterateRows(interp, table, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- if (Blt_Table_SetRowTag(interp, table, row, tagName) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowTagDeleteOp --
- *
- * Removes a given tag from one or more rows. If a tag doesn't exist or
- * is a reserved tag ("all" or "end"), nothing will be done and no error
- * message will be returned.
- *
- * .t row tag delete tag ?row...?
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowTagDeleteOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableIterator iter;
- int i;
- const char *tagName;
-
- table = cmdPtr->table;
- tagName = Tcl_GetString(objv[4]);
- for (i = 5; i < objc; i++) {
- Blt_TableRow row;
-
- if (Blt_Table_IterateRows(interp, table, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- if (Blt_Table_UnsetRowTag(interp, table, row, tagName)!=TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowTagExistsOp --
- *
- * Returns the existence of a tag in the table. If a row is specified
- * then the tag is search for for that row.
- *
- * .t tag row exists tag ?row?
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-RowTagExistsOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int bool;
- const char *tagName;
-
- tagName = Tcl_GetString(objv[3]);
- bool = (Blt_Table_FindRowTagTable(cmdPtr->table, tagName) != NULL);
- if (objc == 5) {
- Blt_TableRow row;
-
- row = Blt_Table_FindRow(interp, cmdPtr->table, objv[4]);
- if (row == NULL) {
- bool = FALSE;
- } else {
- bool = Blt_Table_HasRowTag(cmdPtr->table, row, tagName);
- }
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowTagForgetOp --
- *
- * Removes the given tags from all nodes.
- *
- * $t row tag forget tag1 tag2 tag3...
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-RowTagForgetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- int i;
-
- table = cmdPtr->table;
- for (i = 4; i < objc; i++) {
- if (Blt_Table_ForgetRowTag(interp, table, Tcl_GetString(objv[i]))
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowTagGetOp --
- *
- * Returns the tag names for a given row. If one of more pattern
- * arguments are provided, then only those matching tags are returned.
- *
- * .t row tag get row pat1 pat2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowTagGetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch hsearch;
- Blt_HashTable tagTable;
- Blt_Table table;
- Blt_TableIterator iter;
- Blt_TableRow row;
- Tcl_Obj *listObjPtr;
-
- table = cmdPtr->table;
- if (Blt_Table_IterateRows(interp, table, objv[4], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
-
- Blt_InitHashTable(&tagTable, BLT_STRING_KEYS);
-
- /* Collect all the tags into a hash table. */
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- Blt_Chain chain;
- Blt_ChainLink link;
-
- chain = Blt_Table_RowTags(table, row);
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- const char *tagName;
- int isNew;
-
- tagName = Blt_Chain_GetValue(link);
- Blt_CreateHashEntry(&tagTable, tagName, &isNew);
- }
- Blt_Chain_Destroy(chain);
- }
- for (hPtr = Blt_FirstHashEntry(&tagTable, &hsearch); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&hsearch)) {
- int match;
- const char *tagName;
-
- tagName = Blt_GetHashKey(&tagTable, hPtr);
- match = TRUE;
- if (objc > 5) {
- int i;
-
- match = FALSE;
- for (i = 5; i < objc; i++) {
- if (Tcl_StringMatch(tagName, Tcl_GetString(objv[i]))) {
- match = TRUE;
- }
- }
- }
- if (match) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(tagName, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Blt_DeleteHashTable(&tagTable);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-static unsigned char *
-GetRowTagMatches(Tcl_Interp *interp, Blt_Table table, int objc,
- Tcl_Obj *const *objv)
-{
- long nRows;
- int i;
- unsigned char *matches;
-
- nRows = Blt_Table_NumRows(table);
- matches = Blt_AssertCalloc(nRows + 1, sizeof(unsigned char));
- /* Handle the reserved tags "all" or "end". */
- for (i = 0; i < objc; i++) {
- char *tagName;
- long j;
-
- tagName = Tcl_GetString(objv[i]);
- if (strcmp("all", tagName) == 0) {
- for (j = 1; j <= nRows; j++) {
- matches[j] = TRUE;
- }
- return matches; /* Don't care other tags. */
- }
- if (strcmp("end", tagName) == 0) {
- matches[nRows] = TRUE;
- }
- }
- /* Now check user-defined tags. */
- for (i = 0; i < objc; i++) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Blt_HashTable *tagTablePtr;
- const char *tagName;
-
- tagName = Tcl_GetString(objv[i]);
- if ((strcmp("all", tagName) == 0) || (strcmp("end", tagName) == 0)) {
- continue;
- }
- tagTablePtr = Blt_Table_FindRowTagTable(table, tagName);
- if (tagTablePtr == NULL) {
- Tcl_AppendResult(interp, "unknown row tag \"", tagName, "\"",
- (char *)NULL);
- Blt_Free(matches);
- return NULL;
- }
- for (hPtr = Blt_FirstHashEntry(tagTablePtr, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_TableRow row;
- long j;
-
- row = Blt_GetHashValue(hPtr);
- j = Blt_Table_RowIndex(row);
- assert(j >= 0);
- matches[j] = TRUE;
- }
- }
- return matches;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowTagIndicesOp --
- *
- * Returns row indices names for the given tags. If one of more tag
- * names are provided, then only those matching indices are returned.
- *
- * .t row tag indices tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowTagIndicesOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- long j;
- long nRows;
- unsigned char *matches;
-
- matches = GetRowTagMatches(interp, cmdPtr->table, objc - 4, objv + 4);
- if (matches == NULL) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- nRows = Blt_Table_NumRows(cmdPtr->table);
- for (j = 1; j <= nRows; j++) {
- if (matches[j]) {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewLongObj(j));
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- Blt_Free(matches);
- return TCL_OK;
-}
-/*
- *---------------------------------------------------------------------------
- *
- * RowTagLabelsOp --
- *
- * Returns row labels for the given tags. If one of more tag
- * names are provided, then only those matching indices are returned.
- *
- * Example:
- * .t row tag labels tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowTagLabelsOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- long j;
- long nRows;
- unsigned char *matches;
-
- matches = GetRowTagMatches(interp, cmdPtr->table, objc - 4, objv + 4);
- if (matches == NULL) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- nRows = Blt_Table_NumRows(cmdPtr->table);
- for (j = 1; j <= nRows; j++) {
- if (matches[j]) {
- Blt_TableRow row;
- Tcl_Obj *objPtr;
-
- row = Blt_Table_Row(cmdPtr->table, j);
- objPtr = Tcl_NewStringObj(Blt_Table_RowLabel(row), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- Blt_Free(matches);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowTagRangeOp --
- *
- * Adds one or more tags for a given row. Tag names can't start with a
- * digit (to distinquish them from node ids) and can't be a reserved tag
- * ("all" or "end").
- *
- * .t row tag range $from $to tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowTagRangeOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- int i;
- Blt_TableRow from, to;
-
- table = cmdPtr->table;
- from = Blt_Table_FindRow(interp, table, objv[4]);
- if (from == NULL) {
- return TCL_ERROR;
- }
- to = Blt_Table_FindRow(interp, table, objv[5]);
- if (to == NULL) {
- return TCL_ERROR;
- }
- if (Blt_Table_RowIndex(from) > Blt_Table_RowIndex(to)) {
- Blt_TableRow tmp;
- tmp = to, to = from, from = tmp;
- }
- for (i = 6; i < objc; i++) {
- const char *tagName;
- long j;
-
- tagName = Tcl_GetString(objv[i]);
- for (j = Blt_Table_RowIndex(from); j <= Blt_Table_RowIndex(to); j++) {
- Blt_TableRow row;
-
- row = Blt_Table_Row(table, j);
- if (Blt_Table_SetRowTag(interp, table, row, tagName) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowTagSearchOp --
- *
- * Returns tag names for a given row. If one of more pattern arguments
- * are provided, then only those matching tags are returned.
- *
- * .t row tag find $row pat1 pat2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowTagSearchOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Blt_TableIterator iter;
- Tcl_Obj *listObjPtr;
-
- table = cmdPtr->table;
- if (Blt_Table_IterateRows(interp, table, objv[4], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (hPtr = Blt_Table_FirstRowTag(table, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_HashTable *tablePtr;
- Blt_TableRow row;
-
- tablePtr = Blt_GetHashValue(hPtr);
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- Blt_HashEntry *h2Ptr;
-
- h2Ptr = Blt_FindHashEntry(tablePtr, (char *)row);
- if (h2Ptr != NULL) {
- const char *tagName;
- int match;
- int i;
-
- match = (objc == 5);
- tagName = hPtr->key.string;
- for (i = 5; i < objc; i++) {
- if (Tcl_StringMatch(tagName, Tcl_GetString(objv[i]))) {
- match = TRUE;
- break; /* Found match. */
- }
- }
- if (match) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(tagName, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- break; /* Tag matches this row. Don't care if it
- * matches any other rows. */
- }
- }
- }
- }
-
- /* Handle reserved tags specially. */
- {
- int i;
- int allMatch, endMatch;
-
- endMatch = allMatch = (objc == 5);
- for (i = 5; i < objc; i++) {
- if (Tcl_StringMatch("all", Tcl_GetString(objv[i]))) {
- allMatch = TRUE;
- }
- if (Tcl_StringMatch("end", Tcl_GetString(objv[i]))) {
- endMatch = TRUE;
- }
- }
- if (allMatch) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("all", 3));
- }
- if (endMatch) {
- Blt_TableRow row, lastRow;
-
- lastRow = Blt_Table_Row(table, Blt_Table_NumRows(table));
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- if (row == lastRow) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("end", 3));
- break;
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowTagSetOp --
- *
- * Adds one or more tags for a given row.
- *
- * .t row tag set $row tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowTagSetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableIterator iter;
- int i;
-
- table = cmdPtr->table;
- if (Blt_Table_IterateRows(interp, table, objv[4], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 5; i < objc; i++) {
- const char *tagName;
- Blt_TableRow row;
-
- tagName = Tcl_GetString(objv[i]);
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- if (Blt_Table_SetRowTag(interp, table, row, tagName) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowTagUnsetOp --
- *
- * Removes one or more tags from a given row.
- *
- * .t row tag unset $row tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowTagUnsetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableIterator iter;
- int i;
-
- table = cmdPtr->table;
- if (Blt_Table_IterateRows(interp, table, objv[4], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 5; i < objc; i++) {
- const char *tagName;
- Blt_TableRow row;
-
- tagName = Tcl_GetString(objv[i]);
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- if (Blt_Table_UnsetRowTag(interp, table, row, tagName)!=TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowTagOp --
- *
- * This procedure is invoked to process tag operations.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec rowTagOps[] =
-{
- {"add", 1, RowTagAddOp, 5, 0, "tag ?row...?",},
- {"delete", 1, RowTagDeleteOp, 5, 0, "tag ?row...?",},
- {"exists", 1, RowTagExistsOp, 5, 6, "tag ?row?",},
- {"forget", 1, RowTagForgetOp, 4, 0, "?tag...?",},
- {"get", 1, RowTagGetOp, 5, 0, "row ?pattern...?",},
- {"indices", 1, RowTagIndicesOp, 4, 0, "?tag...?",},
- {"labels", 1, RowTagLabelsOp, 4, 0, "?tag...?",},
- {"range", 1, RowTagRangeOp, 6, 0, "from to ?tag...?",},
- {"search", 3, RowTagSearchOp, 5, 6, "row ?pattern?",},
- {"set", 3, RowTagSetOp, 5, 0, "row tag...",},
- {"unset", 1, RowTagUnsetOp, 5, 0, "row tag...",},
-};
-
-static int nRowTagOps = sizeof(rowTagOps) / sizeof(Blt_OpSpec);
-
-static int
-RowTagOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- CmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nRowTagOps, rowTagOps, BLT_OP_ARG3,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (cmdPtr, interp, objc, objv);
- return result;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowTraceOp --
- *
- * Creates a trace for this instance. Traces represent list of keys, a
- * bitmask of trace flags, and a command prefix to be invoked when a
- * matching trace event occurs.
- *
- * The command prefix is parsed and saved in an array of Tcl_Objs. The
- * qualified name of the instance is saved also.
- *
- * Results:
- * A standard TCL result. The name of the new trace is returned in the
- * interpreter result. Otherwise, if it failed to parse a switch, then
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t row trace tag rwx proc
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-RowTraceOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableIterator iter;
- Blt_TableTrace trace;
- TraceInfo *tiPtr;
- const char *tag;
- int flags;
- Blt_TableRow row;
-
- table = cmdPtr->table;
- if (Blt_Table_IterateRows(interp, table, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- flags = GetTraceFlags(Tcl_GetString(objv[4]));
- if (flags < 0) {
- Tcl_AppendResult(interp, "unknown flag in \"", Tcl_GetString(objv[4]),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- row = NULL;
- tag = NULL;
- if (iter.type == TABLE_ITERATOR_RANGE) {
- Tcl_AppendResult(interp, "can't trace range of rows: use a tag",
- (char *)NULL);
- return TCL_ERROR;
- }
- if ((iter.type == TABLE_ITERATOR_INDEX) ||
- (iter.type == TABLE_ITERATOR_LABEL)) {
- row = Blt_Table_FirstTaggedRow(&iter);
- } else {
- tag = iter.tagName;
- }
- tiPtr = Blt_Malloc(sizeof(TraceInfo));
- if (tiPtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate trace: out of memory",
- (char *)NULL);
- return TCL_ERROR;
- }
- trace = Blt_Table_CreateTrace(table, row, NULL, tag, NULL, flags,
- TraceProc, TraceDeleteProc, tiPtr);
- if (trace == NULL) {
- Tcl_AppendResult(interp, "can't create row trace: out of memory",
- (char *)NULL);
- Blt_Free(tiPtr);
- return TCL_ERROR;
- }
- /* Initialize the trace information structure. */
- tiPtr->cmdPtr = cmdPtr;
- tiPtr->trace = trace;
- tiPtr->tablePtr = &cmdPtr->traceTable;
- {
- Tcl_Obj **elv, **cmdv;
- int elc, i;
-
- if (Tcl_ListObjGetElements(interp, objv[5], &elc, &elv) != TCL_OK) {
- return TCL_ERROR;
- }
- cmdv = Blt_AssertCalloc(elc + 1 + 3 + 1, sizeof(Tcl_Obj *));
- for(i = 0; i < elc; i++) {
- cmdv[i] = elv[i];
- Tcl_IncrRefCount(cmdv[i]);
- }
- cmdv[i] = Tcl_NewStringObj(cmdPtr->hPtr->key.string, -1);
- Tcl_IncrRefCount(cmdv[i]);
- tiPtr->cmdc = elc;
- tiPtr->cmdv = cmdv;
- }
- {
- char traceId[200];
- int isNew;
-
- sprintf_s(traceId, 200, "trace%d", cmdPtr->nextTraceId++);
- tiPtr->hPtr = Blt_CreateHashEntry(&cmdPtr->traceTable, traceId, &isNew);
- Blt_SetHashValue(tiPtr->hPtr, tiPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), traceId, -1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowUnsetOp --
- *
- * Unsets one or more rows of values. One or more rows may be unset
- * (using tags or multiple arguments).
- *
- * Results:
- * A standard TCL result. If the tag or row index is invalid, TCL_ERROR
- * is returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row unset row ?row?
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowUnsetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- int i;
-
- table = cmdPtr->table;
- for (i = 3; i < objc; i++) {
- Blt_TableIterator iter;
- Blt_TableRow row;
-
- if (Blt_Table_IterateRows(interp, table, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- Blt_TableColumn col;
-
- for (col = Blt_Table_FirstColumn(table); col != NULL;
- col = Blt_Table_NextColumn(table, col)) {
- if (Blt_Table_UnsetValue(table, row, col) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowUniqueOp --
- *
- * Reports the unique values for a given row.
- *
- * Results:
- * A standard TCL result. If the tag or row index is invalid, TCL_ERROR
- * is returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row unique row
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowUniqueOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- int i;
- Blt_HashTable values;
-
- table = cmdPtr->table;
- Blt_InitHashTableWithPool(&values, BLT_STRING_KEYS);
- for (i = 3; i < objc; i++) {
- Blt_TableIterator iter;
- Blt_TableRow row;
-
- if (Blt_Table_IterateRows(interp, table, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (row = Blt_Table_FirstTaggedRow(&iter); row != NULL;
- row = Blt_Table_NextTaggedRow(&iter)) {
- Blt_TableColumn col;
-
- for (col = Blt_Table_FirstColumn(table); col != NULL;
- col = Blt_Table_NextColumn(table, col)) {
- const char *string;
- Blt_HashEntry *hPtr;
- int isNew;
-
- string = Blt_Table_GetString(table, row, col);
- if (string == NULL) {
- string = cmdPtr->emptyValue;
- }
- hPtr = Blt_CreateHashEntry(&values, string, &isNew);
- if (hPtr == NULL) {
- return TCL_ERROR;
- }
- }
- }
- }
- {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&values, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Tcl_AppendElement(interp, Blt_GetHashKey(&values, hPtr));
- }
- }
- Blt_DeleteHashTable(&values);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowValuesOp --
- *
- * Retrieves a row of values. The row argument can be either a tag,
- * label, or row index. If it is a tag, it must refer to exactly one
- * row.
- *
- * Results:
- * A standard TCL result. If successful, a list of values is returned in
- * the interpreter result. If the row index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t row listget row ?defValue?
- *
- *---------------------------------------------------------------------------
- */
-static int
-RowValuesOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableRow row;
- Tcl_Obj *listObjPtr;
-
- table = cmdPtr->table;
- row = Blt_Table_FindRow(interp, cmdPtr->table, objv[3]);
- if (row == NULL) {
- return TCL_ERROR;
- }
- if (objc == 4) {
- Blt_TableColumn col;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (col = Blt_Table_FirstColumn(cmdPtr->table); col != NULL;
- col = Blt_Table_NextColumn(cmdPtr->table, col)) {
- Tcl_Obj *objPtr;
-
- objPtr = Blt_Table_GetObj(cmdPtr->table, row, col);
- if (objPtr == NULL) {
- objPtr = Tcl_NewStringObj(cmdPtr->emptyValue, -1);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- } else {
- Tcl_Obj **elv;
- int elc;
- long i, j;
-
- if (Tcl_ListObjGetElements(interp, objv[4], &elc, &elv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (elc > Blt_Table_NumColumns(table)) {
- long n;
-
- n = elc - Blt_Table_NumColumns(table);
- if (Blt_Table_ExtendColumns(interp, table, n, NULL) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- for (i = 0, j = 1; i < elc; i++, j++) {
- Blt_TableColumn col;
-
- col = Blt_Table_Column(table, j);
- if (Blt_Table_SetObj(table, row, col, elv[i]) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowOp --
- *
- * Parses the given command line and calls one of several row-specific
- * operations.
- *
- * Results:
- * Returns a standard TCL result. It is the result of operation called.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec rowOps[] =
-{
- {"copy", 2, RowCopyOp, 4, 0, "src dest ?switches...?",},
- {"create", 2, RowCreateOp, 3, 0, "?switches...?",},
- {"delete", 2, RowDeleteOp, 4, 0, "row...",},
- {"dup", 2, RowDupOp, 3, 0, "row...",},
- {"exists", 3, RowExistsOp, 4, 4, "row",},
- {"extend", 3, RowExtendOp, 4, 0, "label ?label...?",},
- {"get", 1, RowGetOp, 4, 0, "row ?switches?",},
- {"index", 4, RowIndexOp, 4, 4, "row",},
- {"indices", 4, RowIndicesOp,3, 0, "row ?row...?",},
- {"label", 5, RowLabelOp, 4, 0, "row ?label?",},
- {"labels", 6, RowLabelsOp, 3, 4, "?labelList?",},
- {"length", 2, RowLengthOp, 3, 3, "",},
- {"move", 1, RowMoveOp, 5, 6, "from to ?count?",},
- {"names", 2, RowNamesOp, 3, 0, "?pattern...?",},
- {"notify", 2, RowNotifyOp, 5, 0, "row ?flags? command",},
- {"set", 2, RowSetOp, 5, 0, "row column value...",},
- {"tag", 2, RowTagOp, 3, 0, "op args...",},
- {"trace", 2, RowTraceOp, 6, 6, "row how command",},
- {"unique", 3, RowUniqueOp, 4, 4, "row",},
- {"unset", 3, RowUnsetOp, 4, 0, "row...",},
- {"values", 1, RowValuesOp, 4, 5, "row ?valueList?",},
-};
-
-static int nRowOps = sizeof(rowOps) / sizeof(Blt_OpSpec);
-
-static int
-RowOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- CmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nRowOps, rowOps, BLT_OP_ARG2, objc,
- objv, BLT_OP_LINEAR_SEARCH);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (cmdPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AddOp --
- *
- * Concatenates the source table onto the destination.
- *
- * Results:
- * A standard TCL result. If the tag or column index is invalid,
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- *
- * $dest add $src ?switches?
- *
- *---------------------------------------------------------------------------
- */
-static int
-AddOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- AddSwitches switches;
- Blt_Table srcTable;
- size_t oldSize, extra;
- int result;
- Blt_TableColumn src;
-
- /* Process switches following the column names. */
- if (Blt_Table_Open(interp, Tcl_GetString(objv[2]), &srcTable) != TCL_OK) {
- return TCL_ERROR;
- }
- switches.flags = 0;
- result = TCL_ERROR;
- if (Blt_ParseSwitches(interp, addSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- goto error;
- }
- oldSize = Blt_Table_NumRows(cmdPtr->table);
- extra = Blt_Table_NumRows(srcTable);
- Blt_Table_ExtendRows(interp, cmdPtr->table, extra, NULL);
- for (src = Blt_Table_FirstColumn(srcTable); src != NULL;
- src = Blt_Table_NextColumn(srcTable, src)) {
- const char *label;
- Blt_TableColumn dest;
- long i;
-
- label = Blt_Table_ColumnLabel(src);
- dest = Blt_Table_FindColumnByLabel(cmdPtr->table, label);
- if (dest == NULL) {
- /* If column doesn't exist in destination table, create a new
- * column, copying the label and the column type. */
- if (Blt_Table_ExtendColumns(interp, cmdPtr->table, 1, &dest)
- != TCL_OK) {
- goto error;
- }
- if (Blt_Table_SetColumnLabel(interp, cmdPtr->table, dest, label)
- != TCL_OK) {
- goto error;
- }
- Blt_Table_SetColumnType(cmdPtr->table, dest,
- Blt_Table_ColumnType(src));
- }
- for (i = 1; i <= Blt_Table_NumRows(srcTable); i++) {
- Blt_TableRow row;
- Blt_TableValue value;
-
- row = Blt_Table_Row(srcTable, i);
- value = Blt_Table_GetValue(srcTable, row, src);
- if (value == NULL) {
- continue;
- }
- row = Blt_Table_Row(cmdPtr->table, i+oldSize);
- if (Blt_Table_SetValue(cmdPtr->table, row, dest, value) != TCL_OK) {
- goto error;
- }
- }
- if ((switches.flags & COPY_NOTAGS) == 0) {
- CopyColumnTags(srcTable, cmdPtr->table, src, dest);
- }
- }
- result = TCL_OK;
- error:
- Blt_Table_Close(srcTable);
- Blt_FreeSwitches(addSwitches, &switches, 0);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AppendOp --
- *
- *
- * Appends one or more values to the current value at the given
- * location. If the column or row doesn't already exist, it will
- * automatically be created.
- *
- * Results:
- * A standard TCL result. If the tag or index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t append $row $column $value ?value...?
- *
- *---------------------------------------------------------------------------
- */
-static int
-AppendOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableIterator ri, ci;
- Blt_TableColumn col;
- int i, extra;
-
- table = cmdPtr->table;
- if (IterateRows(interp, table, objv[2], &ri) != TCL_OK) {
- return TCL_ERROR;
- }
- if (IterateColumns(interp, table, objv[3], &ci) != TCL_OK) {
- return TCL_ERROR;
- }
- extra = 0;
- for (i = 4; i < objc; i++) {
- int length;
-
- Tcl_GetStringFromObj(objv[i], &length);
- extra += length;
- }
- if (extra == 0) {
- return TCL_OK;
- }
- for (col = Blt_Table_FirstTaggedColumn(&ci); col != NULL;
- col = Blt_Table_NextTaggedColumn(&ci)) {
- Blt_TableRow row;
-
- for (row = Blt_Table_FirstTaggedRow(&ri); row != NULL;
- row = Blt_Table_NextTaggedRow(&ri)) {
- int i;
-
- for (i = 4; i < objc; i++) {
- const char *s;
- int length;
-
- s = Tcl_GetStringFromObj(objv[i], &length);
- if (Blt_Table_AppendString(interp, table, row, col, s, length)
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExportOp --
- *
- * Parses the given command line and calls one of several export-specific
- * operations.
- *
- * Results:
- * Returns a standard TCL result. It is the result of operation called.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-ExportOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- DataFormat *fmtPtr;
- TableCmdInterpData *dataPtr;
-
- dataPtr = GetTableCmdInterpData(interp);
- if (objc == 2) {
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->fmtTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- fmtPtr = Blt_GetHashValue(hPtr);
- if (fmtPtr->exportProc != NULL) {
- Tcl_AppendElement(interp, fmtPtr->name);
- }
- }
- return TCL_OK;
- }
- hPtr = Blt_FindHashEntry(&dataPtr->fmtTable, Tcl_GetString(objv[2]));
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "can't export \"", Tcl_GetString(objv[2]),
- "\": format not registered", (char *)NULL);
- return TCL_ERROR;
- }
- fmtPtr = Blt_GetHashValue(hPtr);
- if (fmtPtr->exportProc == NULL) {
- Tcl_AppendResult(interp, "no export procedure registered for \"",
- fmtPtr->name, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- return (*fmtPtr->exportProc) (cmdPtr->table, interp, objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * KeysOp --
- *
- * This procedure is invoked to process key operations.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- * Example:
- * $t keys key key key key
- * $t keys
- *
- *---------------------------------------------------------------------------
- */
-static int
-KeysOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Chain keys;
- Blt_Table table;
- int i;
-
- if (objc == 2) {
- Tcl_Obj *listObjPtr;
- Blt_ChainLink link;
-
- keys = Blt_Table_GetKeys(cmdPtr->table);
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (link = Blt_Chain_FirstLink(keys); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Blt_TableColumn col;
- Tcl_Obj *objPtr;
-
- col = Blt_Chain_GetValue(link);
- objPtr = Tcl_NewStringObj(Blt_Table_ColumnLabel(col), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- table = cmdPtr->table;
- keys = Blt_Chain_Create();
- for (i = 2; i < objc; i++) {
- Blt_TableColumn col;
-
- col = Blt_Table_FindColumn(interp, table, objv[i]);
- if (col == NULL) {
- Blt_Chain_Destroy(keys);
- return TCL_ERROR;
- }
- Blt_Chain_Append(keys, col);
- }
- Blt_Table_SetKeys(table, keys, 0);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * LappendOp --
- *
- *
- * Appends one or more elements to the list at the given row, column
- * location. If the column or row doesn't already exist, it will
- * automatically be created.
- *
- * Results:
- * A standard TCL result. If the tag or index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t append $row $column $value ?value...?
- *
- *---------------------------------------------------------------------------
- */
-static int
-LappendOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableIterator ri, ci;
- Blt_TableColumn col;
-
- table = cmdPtr->table;
- if (IterateRows(interp, table, objv[2], &ri) != TCL_OK) {
- return TCL_ERROR;
- }
- if (IterateColumns(interp, table, objv[3], &ci) != TCL_OK) {
- return TCL_ERROR;
- }
- for (col = Blt_Table_FirstTaggedColumn(&ci); col != NULL;
- col = Blt_Table_NextTaggedColumn(&ci)) {
- Blt_TableRow row;
-
- for (row = Blt_Table_FirstTaggedRow(&ri); row != NULL;
- row = Blt_Table_NextTaggedRow(&ri)) {
- Tcl_Obj *listObjPtr;
- int i, result;
-
- listObjPtr = Blt_Table_GetObj(table, row, col);
- if (listObjPtr == NULL) {
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- }
- Tcl_IncrRefCount(listObjPtr);
- for (i = 4; i < objc; i++) {
- Tcl_ListObjAppendElement(interp, listObjPtr, objv[i]);
- }
- result = Blt_Table_SetObj(table, row, col, listObjPtr);
- Tcl_DecrRefCount(listObjPtr);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-static int
-LookupOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- long nKeys;
- Blt_Chain keys;
- Blt_TableRow row;
- Blt_Table table;
- long i;
-
- keys = Blt_Table_GetKeys(cmdPtr->table);
- nKeys = Blt_Chain_GetLength(keys);
- if ((objc - 2) != nKeys) {
- Blt_ChainLink link;
-
- Tcl_AppendResult(interp, "wrong # of keys: should be \"", (char *)NULL);
- for (link = Blt_Chain_FirstLink(keys); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Blt_TableColumn col;
-
- col = Blt_Chain_GetValue(link);
- Tcl_AppendResult(interp, Blt_Table_ColumnLabel(col), " ",
- (char *)NULL);
- }
- Tcl_AppendResult(interp, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- table = cmdPtr->table;
- if (Blt_Table_KeyLookup(interp, table, objc - 2, objv + 2, &row)!=TCL_OK) {
- return TCL_ERROR;
- }
- i = (row == NULL) ? -1 : Blt_Table_RowIndex(row);
- Tcl_SetLongObj(Tcl_GetObjResult(interp), i);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImportOp --
- *
- * Parses the given command line and calls one of several import-specific
- * operations.
- *
- * Results:
- * Returns a standard TCL result. It is the result of operation called.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ImportOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- DataFormat *fmtPtr;
- TableCmdInterpData *dataPtr;
-
- dataPtr = GetTableCmdInterpData(interp);
- if (objc == 2) {
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->fmtTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- fmtPtr = Blt_GetHashValue(hPtr);
- if (fmtPtr->importProc != NULL) {
- Tcl_AppendElement(interp, fmtPtr->name);
- }
- }
- return TCL_OK;
- }
- hPtr = Blt_FindHashEntry(&dataPtr->fmtTable, Tcl_GetString(objv[2]));
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "can't import \"", Tcl_GetString(objv[2]),
- "\": format not registered", (char *)NULL);
- return TCL_ERROR;
- }
- fmtPtr = Blt_GetHashValue(hPtr);
- if (fmtPtr->importProc == NULL) {
- Tcl_AppendResult(interp, "no import procedure registered for \"",
- fmtPtr->name, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- return (*fmtPtr->importProc) (cmdPtr->table, interp, objc, objv);
-}
-
-/**************** Notify Operations *******************/
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyDeleteOp --
- *
- * Deletes one or more notifiers.
- *
- * Results:
- * A standard TCL result. If a name given doesn't represent a notifier,
- * then TCL_ERROR is returned and an error message is left in the
- * interpreter result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-NotifyDeleteOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- Blt_HashEntry *hPtr;
- NotifierInfo *niPtr;
-
- hPtr = Blt_FindHashEntry(&cmdPtr->notifyTable, Tcl_GetString(objv[i]));
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "unknown notifier id \"",
- Tcl_GetString(objv[i]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- niPtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashEntry(&cmdPtr->notifyTable, hPtr);
- FreeNotifierInfo(niPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifierInfoOp --
- *
- * Returns the details for a given notifier. The string id of the
- * notifier is passed as an argument.
- *
- * Results:
- * A standard TCL result. If the name given doesn't represent a
- * notifier, then TCL_ERROR is returned and an error message is left in
- * the interpreter result. Otherwise the details of the notifier handler
- * are returned as a list of three elements: notifier id, flags, and
- * command.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NotifyInfoOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_HashEntry *hPtr;
- NotifierInfo *niPtr;
- const char *what;
- Tcl_Obj *listObjPtr, *subListObjPtr, *objPtr;
- int i;
- struct _Blt_TableNotifier *notifierPtr;
-
- table = cmdPtr->table;
- hPtr = Blt_FindHashEntry(&cmdPtr->notifyTable, Tcl_GetString(objv[3]));
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "unknown notifier id \"",
- Tcl_GetString(objv[3]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
-
- niPtr = Blt_GetHashValue(hPtr);
- notifierPtr = niPtr->notifier;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, objv[3]); /* Copy notify Id */
-
- subListObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- if (notifierPtr->flags & TABLE_NOTIFY_CREATE) {
- objPtr = Tcl_NewStringObj("-create", -1);
- Tcl_ListObjAppendElement(interp, subListObjPtr, objPtr);
- }
- if (notifierPtr->flags & TABLE_NOTIFY_DELETE) {
- objPtr = Tcl_NewStringObj("-delete", -1);
- Tcl_ListObjAppendElement(interp, subListObjPtr, objPtr);
- }
- if (notifierPtr->flags & TABLE_NOTIFY_WHENIDLE) {
- objPtr = Tcl_NewStringObj("-whenidle", -1);
- Tcl_ListObjAppendElement(interp, subListObjPtr, objPtr);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, subListObjPtr);
-
- what = (notifierPtr->flags & TABLE_NOTIFY_ROW) ? "row" : "column";
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj(what, -1));
- if (notifierPtr->tag != NULL) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(notifierPtr->tag, -1));
- } else {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewLongObj(Blt_Table_RowIndex(notifierPtr->header)));
- }
- subListObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (i = 0; i < niPtr->cmdc; i++) {
- Tcl_ListObjAppendElement(interp, subListObjPtr, niPtr->cmdv[i]);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, subListObjPtr);
-
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyNamesOp --
- *
- * Returns the names of all the notifiers in use by this instance.
- * Notifiers issues by other instances or object clients are not
- * reported.
- *
- * Results:
- * Always TCL_OK. A list of notifier names is left in the interpreter
- * result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NotifyNamesOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (hPtr = Blt_FirstHashEntry(&cmdPtr->notifyTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Tcl_Obj *objPtr;
- const char *name;
-
- name = Blt_GetHashKey(&cmdPtr->notifyTable, hPtr);
- objPtr = Tcl_NewStringObj(name, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyOp --
- *
- * Parses the given command line and calls one of several notifier
- * specific operations.
- *
- * Results:
- * Returns a standard TCL result. It is the result of operation called.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec notifyOps[] =
-{
- {"delete", 1, NotifyDeleteOp, 3, 0, "notifyId...",},
- {"info", 1, NotifyInfoOp, 4, 4, "notifyId",},
- {"names", 1, NotifyNamesOp, 3, 3, "",},
-};
-
-static int nNotifyOps = sizeof(notifyOps) / sizeof(Blt_OpSpec);
-
-static int
-NotifyOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- CmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nNotifyOps, notifyOps, BLT_OP_ARG2, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc)(cmdPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SortOp --
- *
- * $t sort -dictionary -decreasing -list -ascii a b c
- *
- *---------------------------------------------------------------------------
- */
-static int
-SortOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableSortOrder *sp, *order;
- SortSwitches switches;
- int i;
- int result;
- long n;
- Blt_TableRow *map;
-
- table = cmdPtr->table;
- result = TCL_ERROR;
-
- /* Process switches */
- switches.flags = 0;
- i = Blt_ParseSwitches(interp, sortSwitches, objc - 2, objv + 2, &switches,
- BLT_SWITCH_OBJV_PARTIAL);
- if (i < 0) {
- return TCL_ERROR;
- }
- n = objc - i;
- sp = order = Blt_AssertCalloc(n, sizeof(Blt_TableSortOrder));
- for (/*empty*/; i < objc; i++) {
- Blt_TableColumn col;
-
- col = Blt_Table_FindColumn(interp, table, objv[i]);
- if (col == NULL) {
- goto error;
- }
- sp->column = col;
- }
- map = Blt_Table_SortRows(table, order, sp - order, switches.flags);
- if (map == NULL) {
- Tcl_AppendResult(interp, "out of memory: can't allocate sort map",
- (char *)NULL);
- goto error;
- }
- if (switches.flags & SORT_LIST) {
- Tcl_Obj *listObjPtr;
- Blt_TableRow *ip, *iend;
-
- /* Return the new row order as a list. */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (ip = map, iend = ip + Blt_Table_NumRows(table); ip < iend; ip++) {
- Tcl_Obj *objPtr;
-
- /* Convert the table offset back to a client index. */
- objPtr = Tcl_NewLongObj(Blt_Table_RowIndex(*ip));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- Blt_Free(map);
- } else {
- /* Make row order permanent. */
- Blt_Table_SetRowMap(table, map);
- }
- result = TCL_OK;
- error:
- Blt_Free(order);
- return result;
-}
-
-
-/************* Trace Operations *****************/
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceCreateOp --
- *
- * Creates a trace for this instance. Traces represent list of keys, a
- * bitmask of trace flags, and a command prefix to be invoked when a
- * matching trace event occurs.
- *
- * The command prefix is parsed and saved in an array of Tcl_Objs. The
- * qualified name of the instance is saved also.
- *
- * Results:
- * A standard TCL result. The name of the new trace is returned in the
- * interpreter result. Otherwise, if it failed to parse a switch, then
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- * Example:
- * $t trace create row column how command
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TraceCreateOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- Blt_TableIterator ri, ci;
- Blt_TableTrace trace;
- TraceInfo *tiPtr;
- const char *rowTag, *colTag;
- int flags;
- Blt_TableRow row;
- Blt_TableColumn col;
-
- table = cmdPtr->table;
- if (Blt_Table_IterateRows(interp, table, objv[3], &ri) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_Table_IterateColumns(interp, table, objv[4], &ci) != TCL_OK) {
- return TCL_ERROR;
- }
- flags = GetTraceFlags(Tcl_GetString(objv[5]));
- if (flags < 0) {
- Tcl_AppendResult(interp, "unknown flag in \"", Tcl_GetString(objv[5]),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- row = NULL;
- col = NULL;
- colTag = rowTag = NULL;
- if (ri.type == TABLE_ITERATOR_RANGE) {
- Tcl_AppendResult(interp, "can't trace range of rows: use a tag",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (ci.type == TABLE_ITERATOR_RANGE) {
- Tcl_AppendResult(interp, "can't trace range of columns: use a tag",
- (char *)NULL);
- return TCL_ERROR;
- }
- if ((ri.type == TABLE_ITERATOR_INDEX) ||
- (ri.type == TABLE_ITERATOR_LABEL)) {
- row = Blt_Table_FirstTaggedRow(&ri);
- } else {
- rowTag = ri.tagName;
- }
- if ((ci.type == TABLE_ITERATOR_INDEX) ||
- (ci.type == TABLE_ITERATOR_LABEL)) {
- col = Blt_Table_FirstTaggedColumn(&ci);
- } else {
- colTag = ci.tagName;
- }
- tiPtr = Blt_Malloc(sizeof(TraceInfo));
- if (tiPtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate trace: out of memory",
- (char *)NULL);
- return TCL_ERROR;
- }
- trace = Blt_Table_CreateTrace(table, row, col, rowTag, colTag,
- flags, TraceProc, TraceDeleteProc, tiPtr);
- if (trace == NULL) {
- Tcl_AppendResult(interp, "can't create individual trace: out of memory",
- (char *)NULL);
- Blt_Free(tiPtr);
- return TCL_ERROR;
- }
- /* Initialize the trace information structure. */
- tiPtr->cmdPtr = cmdPtr;
- tiPtr->trace = trace;
- tiPtr->tablePtr = &cmdPtr->traceTable;
- {
- Tcl_Obj **elv, **cmdv;
- int elc, i;
-
- if (Tcl_ListObjGetElements(interp, objv[6], &elc, &elv) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Command + tableName + row + column + flags + NULL
- */
- cmdv = Blt_AssertCalloc(elc + 1 + 3 + 1, sizeof(Tcl_Obj *));
- for(i = 0; i < elc; i++) {
- cmdv[i] = elv[i];
- Tcl_IncrRefCount(cmdv[i]);
- }
- cmdv[i] = Tcl_NewStringObj(cmdPtr->hPtr->key.string, -1);
- Tcl_IncrRefCount(cmdv[i]);
- tiPtr->cmdc = elc;
- tiPtr->cmdv = cmdv;
- }
- {
- int isNew;
- char traceId[200];
- Blt_HashEntry *hPtr;
-
- do {
- sprintf_s(traceId, 200, "trace%d", cmdPtr->nextTraceId++);
- hPtr = Blt_CreateHashEntry(&cmdPtr->traceTable, traceId, &isNew);
- } while (!isNew);
- tiPtr->hPtr = hPtr;
- Blt_SetHashValue(hPtr, tiPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), traceId, -1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceDeleteOp --
- *
- * Deletes one or more traces. Can be any type of trace.
- *
- * Results:
- * A standard TCL result. If a name given doesn't represent a trace,
- * then TCL_ERROR is returned and an error message is left in the
- * interpreter result.
- *
- * Example:
- * $t trace delete $id...
- *---------------------------------------------------------------------------
- */
-static int
-TraceDeleteOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- Blt_HashEntry *hPtr;
- TraceInfo *tiPtr;
-
- hPtr = Blt_FindHashEntry(&cmdPtr->traceTable, Tcl_GetString(objv[i]));
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "unknown trace \"",
- Tcl_GetString(objv[i]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- tiPtr = Blt_GetHashValue(hPtr);
- Blt_Table_DeleteTrace(tiPtr->trace);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceInfoOp --
- *
- * Returns the details for a given trace. The name of the trace is
- * passed as an argument. The details are returned as a list of
- * key-value pairs: trace name, tag, row index, keys, flags, and the
- * command prefix.
- *
- * Results:
- * A standard TCL result. If the name given doesn't represent a trace,
- * then TCL_ERROR is returned and an error message is left in the
- * interpreter result.
- *
- * Example:
- * $t trace info $trace
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TraceInfoOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- TraceInfo *tiPtr;
- Tcl_Obj *listObjPtr;
-
- hPtr = Blt_FindHashEntry(&cmdPtr->traceTable, Tcl_GetString(objv[3]));
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "unknown trace \"", Tcl_GetString(objv[3]),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- tiPtr = Blt_GetHashValue(hPtr);
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- PrintTraceInfo(interp, tiPtr, listObjPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceNamesOp --
- *
- * Returns the names of all the traces in use by this instance. Traces
- * created by other instances or object clients are not reported.
- *
- * Results:
- * Always TCL_OK. A list of trace names is left in the interpreter
- * result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TraceNamesOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (hPtr = Blt_FirstHashEntry(&cmdPtr->traceTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(Blt_GetHashKey(&cmdPtr->traceTable, hPtr),-1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceOp --
- *
- * This procedure is invoked to process trace operations.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec traceOps[] =
-{
- {"create", 1, TraceCreateOp, 7, 7, "row column how command",},
- {"delete", 1, TraceDeleteOp, 3, 0, "traceId...",},
- {"info", 1, TraceInfoOp, 4, 4, "traceId",},
- {"names", 1, TraceNamesOp, 3, 3, "",},
-};
-
-static int nTraceOps = sizeof(traceOps) / sizeof(Blt_OpSpec);
-
-static int
-TraceOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- CmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTraceOps, traceOps, BLT_OP_ARG2, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (cmdPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetOp --
- *
- * Sets one or more key-value pairs for tables. One or more tables may
- * be set. If any of the columns (keys) given don't already exist, the
- * columns will be automatically created. The same holds true for rows.
- * If a row index is beyond the end of the table (tags are always in
- * range), new rows are allocated.
- *
- * Results:
- * A standard TCL result. If the tag or index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t set $row $column $value ?row column value?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-SetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- int i;
-
- if (((objc - 2) % 3) != 0) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]),
- " set ?row column value?...\"", (char *)NULL);
- return TCL_ERROR;
- }
- table = cmdPtr->table;
- for (i = 2; i < objc; i += 3) {
- Blt_TableIterator ri, ci;
- Blt_TableColumn col;
-
- if (IterateRows(interp, table, objv[i], &ri) != TCL_OK) {
- return TCL_ERROR;
- }
- if (IterateColumns(interp, table, objv[i + 1], &ci) != TCL_OK) {
- return TCL_ERROR;
- }
- for (col = Blt_Table_FirstTaggedColumn(&ci); col != NULL;
- col = Blt_Table_NextTaggedColumn(&ci)) {
- Blt_TableRow row;
-
- for (row = Blt_Table_FirstTaggedRow(&ri); row != NULL;
- row = Blt_Table_NextTaggedRow(&ri)) {
- if (Blt_Table_SetObj(table, row, col, objv[i+2]) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnsetOp --
- *
- * $t unset row column ?row column?
- *
- * Unsets one or more values. One or more tables may be unset (using
- * tags). It's not an error if one of the key names (columns) doesn't
- * exist. The same holds true for rows. If a row index is beyond the
- * end of the table (tags are always in range), it is also ignored.
- *
- * Results:
- * A standard TCL result. If the tag or index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-UnsetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- int i;
-
- if ((objc - 2) & 1) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " unset ?row column?...",
- (char *)NULL);
- return TCL_ERROR;
- }
- table = cmdPtr->table;
- for (i = 2; i < objc; i += 2) {
- Blt_TableIterator ri, ci;
- Blt_TableColumn col;
-
- if (Blt_Table_IterateRows(NULL, table, objv[i], &ri) != TCL_OK) {
- return TCL_OK;
- }
- if (Blt_Table_IterateColumns(NULL, table, objv[i+1], &ci) != TCL_OK) {
- return TCL_OK;
- }
- for (col = Blt_Table_FirstTaggedColumn(&ci); col != NULL;
- col = Blt_Table_NextTaggedColumn(&ci)) {
- Blt_TableRow row;
-
- for (row = Blt_Table_FirstTaggedRow(&ri); row != NULL;
- row = Blt_Table_NextTaggedRow(&ri)) {
-
- if (Blt_Table_UnsetValue(table, row, col) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RestoreOp --
- *
- * $t restore $string -overwrite -notags
- * $t restorefile $fileName -overwrite -notags
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-RestoreOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- RestoreSwitches switches;
- int result;
-
- memset((char *)&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, restoreSwitches, objc - 2, objv + 2,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "can't set both -file and -data switches.",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (switches.dataObjPtr != NULL) {
- result = Blt_Table_Restore(interp, cmdPtr->table,
- Tcl_GetString(switches.dataObjPtr), switches.flags);
- } else if (switches.fileObjPtr != NULL) {
- result = Blt_Table_FileRestore(interp, cmdPtr->table,
- Tcl_GetString(switches.fileObjPtr), switches.flags);
- } else {
- result = Blt_Table_FileRestore(interp, cmdPtr->table, "out.dump",
- switches.flags);
- }
- Blt_FreeSwitches(restoreSwitches, &switches, 0);
- return result;
-}
-
-static int
-WriteRecord(Tcl_Channel channel, Tcl_DString *dsPtr)
-{
- int length, nWritten;
- char *line;
-
- length = Tcl_DStringLength(dsPtr);
- line = Tcl_DStringValue(dsPtr);
-#if HAVE_UTF
-#ifdef notdef
- nWritten = Tcl_WriteChars(channel, line, length);
-#endif
- nWritten = Tcl_Write(channel, line, length);
-#else
- nWritten = Tcl_Write(channel, line, length);
-#endif
- if (nWritten != length) {
- return FALSE;
- }
- Tcl_DStringSetLength(dsPtr, 0);
- return TRUE;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DumpHeader --
- *
- * Prints the info associated with a column into a dynamic
- * string.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DumpHeader(DumpSwitches *dumpPtr, long nRows, long nCols)
-{
- /* i rows columns ctime mtime \n */
- Tcl_DStringAppendElement(dumpPtr->dsPtr, "i");
-
- /* # of rows and columns may be a subset of the table. */
- Tcl_DStringAppendElement(dumpPtr->dsPtr, Blt_Ltoa(nRows));
- Tcl_DStringAppendElement(dumpPtr->dsPtr, Blt_Ltoa(nCols));
-
- Tcl_DStringAppendElement(dumpPtr->dsPtr, Blt_Ltoa(0));
- Tcl_DStringAppendElement(dumpPtr->dsPtr, Blt_Ltoa(0));
- Tcl_DStringAppend(dumpPtr->dsPtr, "\n", 1);
- if (dumpPtr->channel != NULL) {
- return WriteRecord(dumpPtr->channel, dumpPtr->dsPtr);
- }
- return TRUE;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DumpValue --
- *
- * Retrieves all tags for a given row or column into a tcl list.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DumpValue(Blt_Table table, DumpSwitches *dumpPtr, Blt_TableRow row,
- Blt_TableColumn col)
-{
- const char *string;
-
- string = Blt_Table_GetString(table, row, col);
- if (string == NULL) {
- return TRUE;
- }
- /* d row column value \n */
- Tcl_DStringAppendElement(dumpPtr->dsPtr, "d");
- Tcl_DStringAppendElement(dumpPtr->dsPtr, Blt_Ltoa(Blt_Table_RowIndex(row)));
- Tcl_DStringAppendElement(dumpPtr->dsPtr, Blt_Ltoa(Blt_Table_ColumnIndex(col)));
- Tcl_DStringAppendElement(dumpPtr->dsPtr, string);
- Tcl_DStringAppend(dumpPtr->dsPtr, "\n", 1);
- if (dumpPtr->channel != NULL) {
- return WriteRecord(dumpPtr->channel, dumpPtr->dsPtr);
- }
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DumpColumn --
- *
- * Prints the info associated with a column into a dynamic string.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DumpColumn(Blt_Table table, DumpSwitches *dumpPtr, Blt_TableColumn col)
-{
- Blt_Chain colTags;
- Blt_ChainLink link;
- const char *name;
-
- /* c index label type tags \n */
- Tcl_DStringAppendElement(dumpPtr->dsPtr, "c");
- Tcl_DStringAppendElement(dumpPtr->dsPtr, Blt_Ltoa(Blt_Table_ColumnIndex(col)));
- Tcl_DStringAppendElement(dumpPtr->dsPtr, Blt_Table_ColumnLabel(col));
- name = Blt_Table_NameOfType(Blt_Table_ColumnType(col));
- if (name == NULL) {
- name = "";
- }
- Tcl_DStringAppendElement(dumpPtr->dsPtr, name);
-
- colTags = Blt_Table_ColumnTags(table, col);
- Tcl_DStringStartSublist(dumpPtr->dsPtr);
- for (link = Blt_Chain_FirstLink(colTags); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- const char *tagName;
-
- tagName = Blt_Chain_GetValue(link);
- Tcl_DStringAppendElement(dumpPtr->dsPtr, tagName);
- }
- Blt_Chain_Destroy(colTags);
- Tcl_DStringEndSublist(dumpPtr->dsPtr);
- Tcl_DStringAppend(dumpPtr->dsPtr, "\n", 1);
- if (dumpPtr->channel != NULL) {
- return WriteRecord(dumpPtr->channel, dumpPtr->dsPtr);
- }
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DumpRow --
- *
- * Prints the info associated with a row into a dynamic string.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DumpRow(Blt_Table table, DumpSwitches *dumpPtr, Blt_TableRow row)
-{
- Blt_Chain rowTags;
- Blt_ChainLink link;
-
- /* r index label tags \n */
- Tcl_DStringAppendElement(dumpPtr->dsPtr, "r");
- Tcl_DStringAppendElement(dumpPtr->dsPtr, Blt_Ltoa(Blt_Table_RowIndex(row)));
- Tcl_DStringAppendElement(dumpPtr->dsPtr, (char *)Blt_Table_RowLabel(row));
- Tcl_DStringStartSublist(dumpPtr->dsPtr);
- rowTags = Blt_Table_RowTags(table, row);
- for (link = Blt_Chain_FirstLink(rowTags); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- const char *tagName;
-
- tagName = Blt_Chain_GetValue(link);
- Tcl_DStringAppendElement(dumpPtr->dsPtr, tagName);
- }
- Blt_Chain_Destroy(rowTags);
- Tcl_DStringEndSublist(dumpPtr->dsPtr);
- Tcl_DStringAppend(dumpPtr->dsPtr, "\n", 1);
- if (dumpPtr->channel != NULL) {
- return WriteRecord(dumpPtr->channel, dumpPtr->dsPtr);
- }
- return TRUE;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DumpTable --
- *
- * Dumps data from the given table based upon the row and column maps
- * provided which describe what rows and columns are to be dumped. The
- * dump information is written to the file named. If the file name starts
- * with an '@', then it is the name of an already opened channel to be
- * used.
- *
- * Results:
- * A standard TCL result. If the dump was successful, TCL_OK is
- * returned. Otherwise, TCL_ERROR is returned and an error message is
- * left in the interpreter result.
- *
- * Side Effects:
- * Dump information is written to the named file.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DumpTable(Blt_Table table, DumpSwitches *dumpPtr)
-{
- int result;
- long nCols, nRows;
- Blt_TableColumn col;
- Blt_TableRow row;
-
- if (dumpPtr->ri.chain != NULL) {
- nRows = Blt_Chain_GetLength(dumpPtr->ri.chain);
- } else {
- nRows = Blt_Table_NumRows(table);
- }
- if (dumpPtr->ci.chain != NULL) {
- nCols = Blt_Chain_GetLength(dumpPtr->ci.chain);
- } else {
- nCols = Blt_Table_NumColumns(table);
- }
- result = DumpHeader(dumpPtr, nRows, nCols);
- for (col = Blt_Table_FirstTaggedColumn(&dumpPtr->ci);
- (result) && (col != NULL);
- col = Blt_Table_NextTaggedColumn(&dumpPtr->ci)) {
- result = DumpColumn(table, dumpPtr, col);
- }
- for (row = Blt_Table_FirstTaggedRow(&dumpPtr->ri);
- (result) && (row != NULL);
- row = Blt_Table_NextTaggedRow(&dumpPtr->ri)) {
- result = DumpRow(table, dumpPtr, row);
- }
- for (col = Blt_Table_FirstTaggedColumn(&dumpPtr->ci);
- (result) && (col != NULL);
- col = Blt_Table_NextTaggedColumn(&dumpPtr->ci)) {
- for (row = Blt_Table_FirstTaggedRow(&dumpPtr->ri);
- (result) && (row != NULL);
- row = Blt_Table_NextTaggedRow(&dumpPtr->ri)) {
- result = DumpValue(table, dumpPtr, row, col);
- }
- }
- return (result) ? TCL_OK : TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DumpOp --
- *
- * set data [$t dump -rows {} -columns {}]
- * $t dump -file fileName -rows {} -columns {}
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DumpOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Table table;
- DumpSwitches switches;
- int result;
- Tcl_DString ds;
- int closeChannel;
- Tcl_Channel channel;
-
- closeChannel = FALSE;
- channel = NULL;
- table = cmdPtr->table;
- result = TCL_ERROR;
- memset(&switches, 0, sizeof(switches));
- switches.channel = channel;
- switches.dsPtr = &ds;
- rowIterSwitch.clientData = cmdPtr->table;
- columnIterSwitch.clientData = cmdPtr->table;
- Blt_Table_IterateAllRows(table, &switches.ri);
- Blt_Table_IterateAllColumns(table, &switches.ci);
- if (Blt_ParseSwitches(interp, dumpSwitches, objc - 2, objv + 2, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- goto error;
- }
- if (switches.fileObjPtr != NULL) {
- const char *fileName;
-
- fileName = Tcl_GetString(switches.fileObjPtr);
-
- closeChannel = TRUE;
- if ((fileName[0] == '@') && (fileName[1] != '\0')) {
- int mode;
-
- channel = Tcl_GetChannel(interp, fileName+1, &mode);
- if (channel == NULL) {
- goto error;
- }
- if ((mode & TCL_WRITABLE) == 0) {
- Tcl_AppendResult(interp, "can't dump table: channel \"",
- fileName, "\" not opened for writing", (char *)NULL);
- goto error;
- }
- closeChannel = FALSE;
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "w", 0666);
- if (channel == NULL) {
- goto error;
- }
- }
- switches.channel = channel;
- }
- Tcl_DStringInit(&ds);
- result = DumpTable(table, &switches);
- if ((switches.channel == NULL) && (result == TCL_OK)) {
- Tcl_DStringResult(interp, &ds);
- }
- Tcl_DStringFree(&ds);
- error:
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- Blt_FreeSwitches(dumpSwitches, &switches, 0);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EmptyValueOp --
- *
- * $t emptyvalue ?$value?
- *
- *---------------------------------------------------------------------------
- */
-static int
-EmptyValueOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_SetStringObj(Tcl_GetObjResult(interp), cmdPtr->emptyValue, -1);
- if (objc == 3) {
- if (cmdPtr->emptyValue != NULL) {
- Blt_Free(cmdPtr->emptyValue);
- cmdPtr->emptyValue = Blt_AssertStrdup(Tcl_GetString(objv[2]));
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExistsOp --
- *
- * $t exists $row $column
- *
- *---------------------------------------------------------------------------
- */
-static int
-ExistsOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int bool;
- Blt_TableRow row;
- Blt_TableColumn col;
-
- bool = FALSE;
- row = Blt_Table_FindRow(NULL, cmdPtr->table, objv[2]);
- col = Blt_Table_FindColumn(NULL, cmdPtr->table, objv[3]);
- if ((row != NULL) && (col != NULL)) {
- bool = Blt_Table_ValueExists(cmdPtr->table, row, col);
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindOp --
- *
- * Parses the given command line and calls one of several export-specific
- * operations.
- *
- * Results:
- * Returns a standard TCL result. It is the result of operation called.
- *
- * Example:
- * $t find expr ?switches?
- *
- *---------------------------------------------------------------------------
- */
-static int
-FindOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- FindSwitches switches;
- int result;
-
- memset(&switches, 0, sizeof(switches));
- rowIterSwitch.clientData = cmdPtr->table;
- Blt_Table_IterateAllRows(cmdPtr->table, &switches.iter);
-
- if (Blt_ParseSwitches(interp, findSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- switches.table = cmdPtr->table;
- Blt_InitHashTable(&switches.varTable, BLT_ONE_WORD_KEYS);
- result = FindRows(interp, cmdPtr->table, objv[2], &switches);
- Blt_FreeSwitches(findSwitches, &switches, 0);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetOp --
- *
- * Retrieves the value from a given table for a designated row,column
- * location.
- *
- * Normally it's an error if the column or row key is invalid or the data
- * slot is empty (the Tcl_Obj is NULL). But if an extra argument is
- * provided, then it is returned as a default value.
- *
- * Results:
- * A standard TCL result. If the tag or index is invalid, TCL_ERROR is
- * returned and an error message is left in the interpreter result.
- *
- * Example:
- * $t get row column ?defValue?
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *objPtr;
- Blt_TableRow row;
- Blt_TableColumn col;
-
- row = Blt_Table_FindRow(interp, cmdPtr->table, objv[2]);
- if (row == NULL) {
- if (objc == 5) {
- objPtr = objv[4];
- goto done;
- }
- return TCL_ERROR;
- }
- col = Blt_Table_FindColumn(interp, cmdPtr->table, objv[3]);
- if (col == NULL) {
- if (objc == 5) {
- objPtr = objv[4];
- goto done;
- }
- return TCL_ERROR;
- }
- objPtr = Blt_Table_GetObj(cmdPtr->table, row, col);
- if (objPtr == NULL) {
- if (objc == 5) {
- objPtr = objv[4];
- } else {
- objPtr = Tcl_NewStringObj(cmdPtr->emptyValue, -1);
- }
- }
- done:
- Tcl_SetObjResult(interp, objPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AttachOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-AttachOp(Cmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (objc == 3) {
- const char *qualName;
- Blt_ObjectName objName;
- Blt_Table table;
- Tcl_DString ds;
- int result;
-
- if (!Blt_ParseObjectName(interp, Tcl_GetString(objv[2]), &objName, 0)) {
- return TCL_ERROR;
- }
- qualName = Blt_MakeQualifiedName(&objName, &ds);
- result = Blt_Table_Open(interp, qualName, &table);
- Tcl_DStringFree(&ds);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- if (cmdPtr->table != NULL) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- Blt_Table_Close(cmdPtr->table);
- /* Free the current set of tags, traces, and notifiers. */
- for (hPtr = Blt_FirstHashEntry(&cmdPtr->traceTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- TraceInfo *tiPtr;
-
- tiPtr = Blt_GetHashValue(hPtr);
- Blt_Table_DeleteTrace(tiPtr->trace);
- }
- Blt_DeleteHashTable(&cmdPtr->traceTable);
- Blt_InitHashTable(&cmdPtr->traceTable, TCL_STRING_KEYS);
- for (hPtr = Blt_FirstHashEntry(&cmdPtr->notifyTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- NotifierInfo *niPtr;
-
- niPtr = Blt_GetHashValue(hPtr);
- FreeNotifierInfo(niPtr);
- }
- Blt_DeleteHashTable(&cmdPtr->notifyTable);
- Blt_InitHashTable(&cmdPtr->notifyTable, TCL_STRING_KEYS);
- }
- cmdPtr->table = table;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- Blt_Table_TableName(cmdPtr->table), -1);
- return TCL_OK;
-}
-
-static Blt_OpSpec tableOps[] =
-{
- {"add", 2, AddOp, 3, 0, "table ?switches?",},
- {"append", 2, AppendOp, 5, 0, "row column value ?value...?",},
- {"attach", 2, AttachOp, 3, 0, "args...",},
- {"column", 3, ColumnOp, 3, 0, "op args...",},
-#ifdef notdef
- {"dup", 1, DupOp, 3, 0, "args...",},
-#endif
- {"dump", 1, DumpOp, 2, 0, "?switches?",},
- {"emptyvalue", 2, EmptyValueOp, 2, 3, "?newValue?",},
- {"exists", 3, ExistsOp, 4, 4, "row column",},
- {"export", 3, ExportOp, 2, 0, "format args...",},
- {"find", 1, FindOp, 3, 0, "expr ?switches?",},
- {"get", 1, GetOp, 4, 5, "row column ?defValue?",},
- {"import", 1, ImportOp, 2, 0, "format args...",},
- {"keys", 1, KeysOp, 2, 0, "?column...?",},
- {"lappend", 2, LappendOp, 5, 0, "row column value ?value...?",},
- {"lookup", 2, LookupOp, 2, 0, "?value...?",},
- {"notify", 1, NotifyOp, 2, 0, "op args...",},
- {"restore", 2, RestoreOp, 2, 0, "?switches?",},
- {"row", 2, RowOp, 3, 0, "op args...",},
- {"set", 2, SetOp, 3, 0, "?row column value?...",},
- {"sort", 2, SortOp, 3, 0, "?flags...?",},
- {"trace", 2, TraceOp, 2, 0, "op args...",},
- {"unset", 1, UnsetOp, 4, 0, "row column ?row column?",},
-#ifdef notplanned
- {"-apply", 1, ApplyOp, 3, 0, "first last ?switches?",},
- {"copy", 2, CopyOp, 4, 0,
- "srcNode ?destTable? destNode ?switches?",},
-#endif
-};
-
-static int nTableOps = sizeof(tableOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableInstObjCmd --
- *
- * This procedure is invoked to process commands on behalf of * the
- * instance of the table-object.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TableInstObjCmd(
- ClientData clientData, /* Pointer to the datatable command
- * structure. */
- Tcl_Interp *interp, /* Interpreter to report errors. */
- int objc, /* # of arguments. */
- Tcl_Obj *const *objv) /* Vector of argument strings. */
-{
- CmdProc *proc;
- Cmd *cmdPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTableOps, tableOps, BLT_OP_ARG1, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(cmdPtr);
- result = (*proc) (cmdPtr, interp, objc, objv);
- Tcl_Release(cmdPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableInstDeleteProc --
- *
- * Deletes the command associated with the table. This is called only
- * when the command associated with the table is destroyed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The table object is released and bookkeeping data for traces and
- * notifiers are freed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TableInstDeleteProc(ClientData clientData)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Cmd *cmdPtr = clientData;
-
- for (hPtr = Blt_FirstHashEntry(&cmdPtr->traceTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- TraceInfo *tiPtr;
-
- tiPtr = Blt_GetHashValue(hPtr);
- Blt_Table_DeleteTrace(tiPtr->trace);
- }
- Blt_DeleteHashTable(&cmdPtr->traceTable);
- for (hPtr = Blt_FirstHashEntry(&cmdPtr->notifyTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- NotifierInfo *niPtr;
-
- niPtr = Blt_GetHashValue(hPtr);
- FreeNotifierInfo(niPtr);
- }
- if (cmdPtr->emptyValue != NULL) {
- Blt_Free(cmdPtr->emptyValue);
- }
- Blt_DeleteHashTable(&cmdPtr->notifyTable);
- if (cmdPtr->hPtr != NULL) {
- Blt_DeleteHashEntry(cmdPtr->tablePtr, cmdPtr->hPtr);
- }
- Blt_Table_Close(cmdPtr->table);
- Blt_Free(cmdPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableCreateOp --
- *
- * Creates a new instance of a table object.
- *
- * This routine insures that instance and object names are the same. For
- * example, you can't create an instance with the name of an object that
- * already exists. And because each instance has a TCL command
- * associated with it (used to access the object), we additionally check
- * more that it's not an existing TCL command.
- *
- * Instance names are namespace-qualified. If the given name doesn't
- * have a namespace qualifier, that instance will be created in the
- * current namespace (not the global namespace).
- *
- * Results:
- * A standard TCL result. If the instance is successfully created, the
- * namespace-qualified name of the instance is returned. If not, then
- * TCL_ERROR is returned and an error message is left in the interpreter
- * result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TableCreateOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- const char *instName;
- Tcl_DString ds;
- Blt_Table table;
-
- instName = NULL;
- if (objc == 3) {
- instName = Tcl_GetString(objv[2]);
- }
- Tcl_DStringInit(&ds);
- if (instName == NULL) {
- instName = GenerateName(interp, "", "", &ds);
- } else {
- char *p;
-
- p = strstr(instName, "#auto");
- if (p != NULL) {
- *p = '\0';
- instName = GenerateName(interp, instName, p + 5, &ds);
- *p = '#';
- } else {
- Blt_ObjectName objName;
- Tcl_CmdInfo cmdInfo;
-
- /*
- * Parse the command and put back so that it's in a consistent
- * format.
- *
- * t1 <current namespace>::t1
- * n1::t1 <current namespace>::n1::t1
- * ::t1 ::t1
- * ::n1::t1 ::n1::t1
- */
- if (!Blt_ParseObjectName(interp, instName, &objName, 0)) {
- return TCL_ERROR;
- }
- instName = Blt_MakeQualifiedName(&objName, &ds);
- /*
- * Check if the command already exists.
- */
- if (Tcl_GetCommandInfo(interp, (char *)instName, &cmdInfo)) {
- Tcl_AppendResult(interp, "a command \"", instName,
- "\" already exists", (char *)NULL);
- goto error;
- }
- if (Blt_Table_TableExists(interp, instName)) {
- Tcl_AppendResult(interp, "a table \"", instName,
- "\" already exists", (char *)NULL);
- goto error;
- }
- }
- }
- if (instName == NULL) {
- goto error;
- }
- if (Blt_Table_CreateTable(interp, instName, &table) == TCL_OK) {
- Cmd *cmdPtr;
-
- cmdPtr = NewTableCmd(interp, table, instName);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), instName, -1);
- Tcl_DStringFree(&ds);
- return TCL_OK;
- }
- error:
- Tcl_DStringFree(&ds);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableDestroyOp --
- *
- * Deletes one or more instances of table objects. The deletion process
- * is done by deleting the TCL command associated with the object.
- *
- * Results:
- * A standard TCL result. If one of the names given doesn't represent an
- * instance, TCL_ERROR is returned and an error message is left in the
- * interpreter result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TableDestroyOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 2; i < objc; i++) {
- Cmd *cmdPtr;
-
- cmdPtr = GetTableCmd(interp, Tcl_GetString(objv[i]));
- if (cmdPtr == NULL) {
- Tcl_AppendResult(interp, "can't find table \"",
- Tcl_GetString(objv[i]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_DeleteCommandFromToken(interp, cmdPtr->cmdToken);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableNamesOp --
- *
- * Returns the names of all the table-object instances matching a given
- * pattern. If no pattern argument is provided, then all object names
- * are returned. The names returned are namespace qualified.
- *
- * Results:
- * Always returns TCL_OK. The names of the matching objects is returned
- * via the interpreter result.
- *
- * Example:
- * $t names ?pattern?
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TableNamesOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TableCmdInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (hPtr = Blt_FirstHashEntry(&dataPtr->instTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- const char *name;
- int match;
- int i;
-
- name = Blt_GetHashKey(&dataPtr->instTable, hPtr);
- match = TRUE;
- for (i = 2; i < objc; i++) {
- match = Tcl_StringMatch(name, Tcl_GetString(objv[i]));
- if (match) {
- break;
- }
- }
- if (!match) {
- continue;
- }
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(name, -1));
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-TableLoadOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- TableCmdInterpData *dataPtr = clientData;
- Tcl_DString libName;
- const char *fmt;
- char *safeProcName, *initProcName;
- int result;
- int length;
-
- fmt = Tcl_GetStringFromObj(objv[2], &length);
- hPtr = Blt_FindHashEntry(&dataPtr->fmtTable, fmt);
- if (hPtr != NULL) {
- return TCL_OK; /* Converter is already loaded. */
- }
- Tcl_DStringInit(&libName);
- {
- Tcl_DString pathName;
- const char *path;
-
- Tcl_DStringInit(&pathName);
- path = Tcl_TranslateFileName(interp, Tcl_GetString(objv[3]), &pathName);
- if (path == NULL) {
- Tcl_DStringFree(&pathName);
- return TCL_ERROR;
- }
- Tcl_DStringAppend(&libName, path, -1);
- Tcl_DStringFree(&pathName);
- }
- Tcl_DStringAppend(&libName, "/", -1);
- Tcl_UtfToTitle((char *)fmt);
- Tcl_DStringAppend(&libName, "Table", 5);
- Tcl_DStringAppend(&libName, fmt, -1);
- Tcl_DStringAppend(&libName, Blt_Itoa(BLT_MAJOR_VERSION), 1);
- Tcl_DStringAppend(&libName, Blt_Itoa(BLT_MINOR_VERSION), 1);
- Tcl_DStringAppend(&libName, BLT_LIB_SUFFIX, -1);
- Tcl_DStringAppend(&libName, BLT_SO_EXT, -1);
-
- initProcName = Blt_AssertMalloc(10 + length + 4 + 1);
- sprintf_s(initProcName, 10 + length + 4 + 1, "Blt_Table_%sInit", fmt);
- safeProcName = Blt_AssertMalloc(10 + length + 8 + 1);
- sprintf_s(safeProcName, 10 + length + 8 + 1, "Blt_Table_%sSafeInit",fmt);
-
- result = Blt_LoadLibrary(interp, Tcl_DStringValue(&libName), initProcName,
- safeProcName);
- Tcl_DStringFree(&libName);
- if (safeProcName != NULL) {
- Blt_Free(safeProcName);
- }
- if (initProcName != NULL) {
- Blt_Free(initProcName);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableObjCmd --
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec tableCmdOps[] =
-{
- {"create", 1, TableCreateOp, 2, 3, "?name?",},
- {"destroy", 1, TableDestroyOp, 3, 0, "name...",},
- {"load", 1, TableLoadOp, 4, 4, "name libpath",},
- {"names", 1, TableNamesOp, 2, 3, "?pattern?...",},
-};
-
-static int nCmdOps = sizeof(tableCmdOps) / sizeof(Blt_OpSpec);
-
-/*ARGSUSED*/
-static int
-TableObjCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- CmdProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nCmdOps, tableCmdOps, BLT_OP_ARG1, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (clientData, interp, objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableInterpDeleteProc --
- *
- * This is called when the interpreter registering the "datatable"
- * command is deleted.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Removes the hash table managing all table names.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-TableInterpDeleteProc(ClientData clientData, Tcl_Interp *interp)
-{
- TableCmdInterpData *dataPtr = clientData;
-
- /* All table instances should already have been destroyed when their
- * respective TCL commands were deleted. */
- Blt_DeleteHashTable(&dataPtr->instTable);
- Blt_DeleteHashTable(&dataPtr->fmtTable);
- Blt_DeleteHashTable(&dataPtr->findTable);
- Tcl_DeleteAssocData(interp, TABLE_THREAD_KEY);
- Blt_Free(dataPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TableCmdInitProc --
- *
- * This procedure is invoked to initialize the "dtable" command.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Creates the new command and adds a new entry into a global Tcl
- * associative array.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_TableCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "datatable", TableObjCmd, };
-
- cmdSpec.clientData = GetTableCmdInterpData(interp);
- if (Blt_InitCmd(interp, "::blt", &cmdSpec) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/* Dump table to dbm */
-/* Convert node data to datablock */
-
-int
-Blt_Table_RegisterFormat(Tcl_Interp *interp, const char *fmt,
- Blt_TableImportProc *importProc,
- Blt_TableExportProc *exportProc)
-{
- Blt_HashEntry *hPtr;
- DataFormat *fmtPtr;
- TableCmdInterpData *dataPtr;
- int isNew;
-
- dataPtr = GetTableCmdInterpData(interp);
- hPtr = Blt_CreateHashEntry(&dataPtr->fmtTable, fmt, &isNew);
- if (isNew) {
- fmtPtr = Blt_AssertMalloc(sizeof(DataFormat));
- fmtPtr->name = Blt_AssertStrdup(fmt);
- Blt_SetHashValue(hPtr, fmtPtr);
- } else {
- fmtPtr = Blt_GetHashValue(hPtr);
- }
- fmtPtr->isLoaded = TRUE;
- fmtPtr->importProc = importProc;
- fmtPtr->exportProc = exportProc;
- return TCL_OK;
-}
-
diff --git a/blt3.0.1/src/bltDtCsv.c b/blt3.0.1/src/bltDtCsv.c
deleted file mode 100644
index 8c4d32d..0000000
--- a/blt3.0.1/src/bltDtCsv.c
+++ /dev/null
@@ -1,740 +0,0 @@
-
-/*
- *
- * bltDtCsv.c --
- *
- * Copyright 1998-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <blt.h>
-
-#ifndef NO_DATATABLE
-
-#include "config.h"
-#include <tcl.h>
-#include <bltSwitch.h>
-#include <bltHash.h>
-#include <bltDataTable.h>
-#include <bltAlloc.h>
-
-#ifdef HAVE_CTYPE_H
-# include <ctype.h>
-#endif /* HAVE_CTYPE_H */
-
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif /* HAVE_MEMORY_H */
-
-DLLEXPORT extern Tcl_AppInitProc Blt_Table_CsvInit;
-
-#define TRUE 1
-#define FALSE 0
-
-#define EXPORT_ROWLABELS (1<<0)
-#define EXPORT_COLUMNLABELS (1<<1)
-
-/*
- * Format Import Export
- * csv file/data file/data
- * tree data data
- * vector data data
- * xml file/data file/data
- * sql data data
- *
- * $table import csv -file fileName -data dataString
- * $table export csv -file defaultFileName
- * $table import tree $treeName $node ?switches?
- * $table export tree $treeName $node "label" "label" "label"
- * $table import vector $vecName label $vecName label...
- * $table export vector label $vecName label $vecName..
- * $table import xml -file fileName -data dataString ?switches?
- * $table export xml -file fileName -data dataString ?switches?
- * $table import sql -host $host -password $pw -db $db -port $port
- */
-
-/*
- * ImportSwitches --
- */
-typedef struct {
- unsigned int flags;
- Tcl_Channel channel; /* If non-NULL, channel to read
- * from. */
- char *buffer; /* Buffer to read data into. */
- int nBytes; /* # of bytes in the buffer. */
- Tcl_DString ds; /* Dynamic string used to read the
- * file line by line. */
- Tcl_Interp *interp;
- Blt_HashTable dataTable;
- Tcl_Obj *fileObjPtr; /* Name of file representing the
- * channel used as the input
- * source. */
- Tcl_Obj *dataObjPtr; /* If non-NULL, data object to use as
- * input source. */
- const char *quote; /* Quoted string delimiter. */
- const char *separators; /* Separator characters. */
- const char *comment; /* Comment character. */
- int maxRows; /* Stop processing after this many
- * rows have been found. */
-} ImportSwitches;
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_STRING, "-comment", "char",
- Blt_Offset(ImportSwitches, comment), 0},
- {BLT_SWITCH_OBJ, "-data", "string",
- Blt_Offset(ImportSwitches, dataObjPtr), 0, 0, NULL},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(ImportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_INT_NNEG, "-maxrows", "integer",
- Blt_Offset(ImportSwitches, maxRows), 0},
- {BLT_SWITCH_STRING, "-quote", "char",
- Blt_Offset(ImportSwitches, quote), 0},
- {BLT_SWITCH_STRING, "-separators", "characters",
- Blt_Offset(ImportSwitches, separators), 0},
- {BLT_SWITCH_END}
-};
-
-/*
- * ExportSwitches --
- */
-typedef struct {
- Blt_TableIterator ri, ci;
- unsigned int flags;
- Tcl_Obj *fileObjPtr;
- Tcl_Channel channel; /* If non-NULL, channel to write
- * output to. */
- Tcl_DString *dsPtr;
- int length; /* Length of dynamic string. */
- int count; /* # of fields in current record. */
- Tcl_Interp *interp;
- char *quote; /* Quoted string delimiter. */
- char *separator; /* Separator character. */
-} ExportSwitches;
-
-extern Blt_SwitchFreeProc Blt_Table_ColumnIterFreeProc;
-extern Blt_SwitchFreeProc Blt_Table_RowIterFreeProc;
-extern Blt_SwitchParseProc Blt_Table_ColumnIterSwitchProc;
-extern Blt_SwitchParseProc Blt_Table_RowIterSwitchProc;
-
-static Blt_SwitchCustom columnIterSwitch = {
- Blt_Table_ColumnIterSwitchProc, Blt_Table_ColumnIterFreeProc, 0,
-};
-static Blt_SwitchCustom rowIterSwitch = {
- Blt_Table_RowIterSwitchProc, Blt_Table_RowIterFreeProc, 0,
-};
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-columns", "columns",
- Blt_Offset(ExportSwitches, ci), 0, 0, &columnIterSwitch},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(ExportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_BITMASK, "-rowlabels", "",
- Blt_Offset(ExportSwitches, flags), 0, EXPORT_ROWLABELS},
- {BLT_SWITCH_BITMASK, "-columnlabels", "",
- Blt_Offset(ExportSwitches, flags), 0, EXPORT_COLUMNLABELS},
- {BLT_SWITCH_STRING, "-quote", "char",
- Blt_Offset(ExportSwitches, quote), 0},
- {BLT_SWITCH_CUSTOM, "-rows", "rows",
- Blt_Offset(ExportSwitches, ri), 0, 0, &rowIterSwitch},
- {BLT_SWITCH_STRING, "-separator", "char",
- Blt_Offset(ExportSwitches, separator), 0},
- {BLT_SWITCH_END}
-};
-
-static Blt_TableImportProc ImportCsvProc;
-static Blt_TableExportProc ExportCsvProc;
-
-static void
-StartCsvRecord(ExportSwitches *exportPtr)
-{
- if (exportPtr->channel != NULL) {
- Tcl_DStringSetLength(exportPtr->dsPtr, 0);
- exportPtr->length = 0;
- }
- exportPtr->count = 0;
-}
-
-static int
-EndCsvRecord(ExportSwitches *exportPtr)
-{
- int nWritten;
- char *line;
-
- Tcl_DStringAppend(exportPtr->dsPtr, "\n", 1);
- exportPtr->length++;
- line = Tcl_DStringValue(exportPtr->dsPtr);
- if (exportPtr->channel != NULL) {
- nWritten = Tcl_Write(exportPtr->channel, line, exportPtr->length);
- if (nWritten != exportPtr->length) {
- Tcl_AppendResult(exportPtr->interp, "can't write csv record: ",
- Tcl_PosixError(exportPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-static void
-AppendCsvRecord(ExportSwitches *exportPtr, const char *field, int length,
- Blt_TableColumnType type)
-{
- const char *fp;
- char *p;
- int extra, doQuote;
-
- doQuote = (type == TABLE_COLUMN_TYPE_STRING);
- extra = 0;
- if (field == NULL) {
- length = 0;
- } else {
- for (fp = field; *fp != '\0'; fp++) {
- if ((*fp == '\n') || (*fp == exportPtr->separator[0]) ||
- (*fp == ' ') || (*fp == '\t')) {
- doQuote = TRUE;
- } else if (*fp == exportPtr->quote[0]) {
- doQuote = TRUE;
- extra++;
- }
- }
- if (doQuote) {
- extra += 2;
- }
- if (length < 0) {
- length = fp - field;
- }
- }
- if (exportPtr->count > 0) {
- Tcl_DStringAppend(exportPtr->dsPtr, exportPtr->separator, 1);
- exportPtr->length++;
- }
- length = length + extra + exportPtr->length;
- Tcl_DStringSetLength(exportPtr->dsPtr, length);
- p = Tcl_DStringValue(exportPtr->dsPtr) + exportPtr->length;
- exportPtr->length = length;
- if (field != NULL) {
- if (doQuote) {
- *p++ = exportPtr->quote[0];
- }
- for (fp = field; *fp != '\0'; fp++) {
- if (*fp == exportPtr->quote[0]) {
- *p++ = exportPtr->quote[0];
- }
- *p++ = *fp;
- }
- if (doQuote) {
- *p++ = exportPtr->quote[0];
- }
- }
- exportPtr->count++;
-}
-
-static int
-ExportCsvRows(Blt_Table table, ExportSwitches *exportPtr)
-{
- Blt_TableRow row;
-
- for (row = Blt_Table_FirstTaggedRow(&exportPtr->ri); row != NULL;
- row = Blt_Table_NextTaggedRow(&exportPtr->ri)) {
- Blt_TableColumn col;
-
- StartCsvRecord(exportPtr);
- if (exportPtr->flags & EXPORT_ROWLABELS) {
- const char *field;
-
- field = Blt_Table_RowLabel(row);
- AppendCsvRecord(exportPtr, field, -1, TABLE_COLUMN_TYPE_STRING);
- }
- for (col = Blt_Table_FirstTaggedColumn(&exportPtr->ci); col != NULL;
- col = Blt_Table_NextTaggedColumn(&exportPtr->ci)) {
- const char *string;
- Blt_TableColumnType type;
-
- type = Blt_Table_ColumnType(col);
- string = Blt_Table_GetString(table, row, col);
- AppendCsvRecord(exportPtr, string, -1, type);
- }
- if (EndCsvRecord(exportPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-static int
-ExportCsvColumns(ExportSwitches *exportPtr)
-{
- if (exportPtr->flags & EXPORT_COLUMNLABELS) {
- Blt_TableColumn col;
-
- StartCsvRecord(exportPtr);
- if (exportPtr->flags & EXPORT_ROWLABELS) {
- AppendCsvRecord(exportPtr, "*BLT*", 5, TABLE_COLUMN_TYPE_STRING);
- }
- for (col = Blt_Table_FirstTaggedColumn(&exportPtr->ci); col != NULL;
- col = Blt_Table_NextTaggedColumn(&exportPtr->ci)) {
- AppendCsvRecord(exportPtr, Blt_Table_ColumnLabel(col), -1,
- TABLE_COLUMN_TYPE_STRING);
- }
- return EndCsvRecord(exportPtr);
- }
- return TCL_OK;
-}
-
-/*
- * $table exportfile fileName ?switches...?
- * $table exportdata ?switches...?
- */
-static int
-ExportCsvProc(Blt_Table table, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- ExportSwitches switches;
- Tcl_Channel channel;
- Tcl_DString ds;
- int closeChannel;
- int result;
-
- closeChannel = FALSE;
- channel = NULL;
-
- Tcl_DStringInit(&ds);
- memset(&switches, 0, sizeof(switches));
- switches.separator = Blt_AssertStrdup(",");
- switches.quote = Blt_AssertStrdup("\"");
- rowIterSwitch.clientData = table;
- columnIterSwitch.clientData = table;
- Blt_Table_IterateAllRows(table, &switches.ri);
- Blt_Table_IterateAllColumns(table, &switches.ci);
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- result = TCL_ERROR;
- if (switches.fileObjPtr != NULL) {
- const char *fileName;
-
- closeChannel = TRUE;
- fileName = Tcl_GetString(switches.fileObjPtr);
- if ((fileName[0] == '@') && (fileName[1] != '\0')) {
- int mode;
-
- channel = Tcl_GetChannel(interp, fileName+1, &mode);
- if (channel == NULL) {
- goto error;
- }
- if ((mode & TCL_WRITABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", fileName,
- "\" not opened for writing", (char *)NULL);
- goto error;
- }
- closeChannel = FALSE;
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "w", 0666);
- if (channel == NULL) {
- goto error; /* Can't open export file. */
- }
- }
- }
- switches.interp = interp;
- switches.dsPtr = &ds;
- switches.channel = channel;
- result = ExportCsvColumns(&switches);
- if (result == TCL_OK) {
- result = ExportCsvRows(table, &switches);
- }
- if ((switches.channel == NULL) && (result == TCL_OK)) {
- Tcl_DStringResult(interp, &ds);
- }
- error:
- Tcl_DStringFree(&ds);
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return result;
-}
-
-/*
- * ImportGetLine --
- *
- * Get a single line from the input buffer or file. The resulting buffer
- * always contains a new line unless an error occurs or we hit EOF.
- *
- */
-static int
-ImportGetLine(Tcl_Interp *interp, ImportSwitches *importPtr, char **bufferPtr,
- int *nBytesPtr)
-{
- if (importPtr->channel != NULL) {
- int nBytes;
-
- if (Tcl_Eof(importPtr->channel)) {
- *nBytesPtr = 0;
- return TCL_OK;
- }
- Tcl_DStringSetLength(&importPtr->ds, 0);
- nBytes = Tcl_Gets(importPtr->channel, &importPtr->ds);
- if (nBytes < 0) {
- if (Tcl_Eof(importPtr->channel)) {
- *nBytesPtr = 0;
- return TCL_OK;
- }
- *nBytesPtr = nBytes;
- Tcl_AppendResult(interp, "error reading file: ",
- Tcl_PosixError(interp), (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_DStringAppend(&importPtr->ds, "\n", 1);
- *nBytesPtr = nBytes + 1;
- *bufferPtr = Tcl_DStringValue(&importPtr->ds);
- } else {
- const char *bp, *bend;
- int nBytes;
-
- for (bp = importPtr->buffer, bend = bp + importPtr->nBytes; bp < bend;
- bp++) {
- if (*bp == '\n') {
- bp++;
- break;
- }
- }
- nBytes = bp - importPtr->buffer;
- *nBytesPtr = nBytes;
- *bufferPtr = importPtr->buffer;
- importPtr->nBytes -= nBytes;
- importPtr->buffer += nBytes;
- }
- return TCL_OK;
-}
-
-static INLINE int
-IsSeparator(ImportSwitches *importPtr, const char c)
-{
- const char *p;
-
- for (p = importPtr->separators; *p != '\0'; p++) {
- if (*p == c) {
- return TRUE;
- }
- }
- return FALSE;
-}
-
-static int
-ImportCsv(Tcl_Interp *interp, Blt_Table table, ImportSwitches *importPtr)
-{
- Tcl_DString dString;
- char *fp, *field;
- int fieldSize;
- int inQuotes, isQuoted, isPath;
- int result;
- size_t i;
- Blt_TableRow row;
- Blt_TableColumn col;
- int tabIsSeparator;
- const char quote = importPtr->quote[0];
- const char comment = importPtr->comment[0];
-
- result = TCL_ERROR;
- isPath = isQuoted = inQuotes = FALSE;
- row = NULL;
- i = 1;
- Tcl_DStringInit(&dString);
- fieldSize = 128;
- Tcl_DStringSetLength(&dString, fieldSize + 1);
- fp = field = Tcl_DStringValue(&dString);
- tabIsSeparator = IsSeparator(importPtr, '\t');
- for (;;) {
- char *bp, *bend;
- int nBytes;
-
- result = ImportGetLine(interp, importPtr, &bp, &nBytes);
- if (result != TCL_OK) {
- goto error; /* I/O Error. */
- }
- if (nBytes == 0) {
- break; /* EOF */
- }
- bend = bp + nBytes;
- while ((bp < bend) && (isspace(*bp))) {
- bp++; /* Skip leading spaces. */
- }
- if ((*bp == '\0') || (*bp == comment)) {
- continue; /* Ignore blank or comment lines */
- }
- for (/*empty*/; bp < bend; bp++) {
- if ((*bp == ' ') || ((*bp == '\t') && (!tabIsSeparator))) {
- /*
- * Include whitespace in the field only if it's not leading or
- * we're inside of quotes or a path.
- */
- if ((fp != field) || (inQuotes) || (isPath)) {
- *fp++ = *bp;
- }
- } else if (*bp == '\\') {
- /*
- * Handle special case CSV files that allow unquoted paths.
- * Example: ...,\this\path " should\have been\quoted\,...
- */
- if (fp == field) {
- isPath = TRUE;
- }
- *fp++ = *bp;
- } else if (*bp == quote) {
- if (inQuotes) {
- if (*(bp+1) == quote) {
- *fp++ = quote;
- bp++;
- } else {
- inQuotes = FALSE;
- }
- } else {
- /*
- * If the quote doesn't start a field, then treat all
- * quotes in the field as ordinary characters.
- */
- if (fp == field) {
- isQuoted = inQuotes = TRUE;
- } else {
- *fp++ = *bp;
- }
- }
- } else if ((IsSeparator(importPtr, *bp)) || (*bp == '\n')) {
- if (inQuotes) {
- *fp++ = *bp; /* Copy the comma or newline. */
- } else {
- Blt_TableColumn col;
- char *last;
-
- if ((isPath) && (IsSeparator(importPtr, *bp)) &&
- (fp != field) && (*(fp - 1) != '\\')) {
- *fp++ = *bp; /* Copy the comma or newline. */
- goto done;
- }
- /* "last" points to the character after the last character
- * in the field. */
- last = fp;
-
- /* Remove trailing spaces only if the field wasn't
- * quoted. */
- if ((!isQuoted) && (!isPath)) {
- while ((last > field) && (isspace(*(last - 1)))) {
- last--;
- }
- }
- if (row == NULL) {
- if ((*bp == '\n') && (fp == field)) {
- goto done; /* Ignore empty lines. */
- }
- if (Blt_Table_ExtendRows(interp, table, 1, &row)
- != TCL_OK) {
- goto error;
- }
- if ((importPtr->maxRows > 0) &&
- (Blt_Table_NumRows(table) > importPtr->maxRows)) {
- bp = bend;
- goto done;
- }
- }
- /* End of field. Append field to row. */
- if (i > Blt_Table_NumColumns(table)) {
- if (Blt_Table_ExtendColumns(interp, table, 1, &col)
- != TCL_OK) {
- goto error;
- }
- } else {
- col = Blt_Table_Column(table, i);
- }
- if ((last > field) || (isQuoted)) {
- if (Blt_Table_SetString(table, row, col, field,
- last - field) != TCL_OK) {
- goto error;
- }
- }
- i++;
- if (*bp == '\n') {
- row = NULL;
- i = 1;
- }
- fp = field;
- isPath = isQuoted = FALSE;
- }
- done:
- ;
- } else {
- *fp++ = *bp; /* Copy the character. */
- }
- if ((fp - field) >= fieldSize) {
- int offset;
-
- /*
- * We've exceeded the current maximum size of the field.
- * Double the size of the field, but make sure to reset the
- * pointers to the (possibly) new memory location.
- */
- offset = fp - field;
- fieldSize += fieldSize;
- Tcl_DStringSetLength(&dString, fieldSize + 1);
- field = Tcl_DStringValue(&dString);
- fp = field + offset;
- }
- }
- if (nBytes < 1) {
- /*
- * We're reached the end of input. But there may not have been a
- * final newline to trigger the final append. So check if a last
- * field is still needs appending the the last row.
- */
- if (fp != field) {
- char *last;
-
- last = fp;
- /* Remove trailing spaces */
- while (isspace(*(last - 1))) {
- last--;
- }
- if (row == NULL) {
- if (Blt_Table_ExtendRows(interp, table, 1, &row)
- != TCL_OK) {
- goto error;
- }
- }
- col = Blt_Table_FindColumnByIndex(table, i);
- if (col == NULL) {
- if (Blt_Table_ExtendColumns(interp, table, 1, &col)
- != TCL_OK) {
- goto error;
- }
- }
- if ((last > field) || (isQuoted)) {
- if (Blt_Table_SetString(table, row, col, field,
- last - field) != TCL_OK) {
- goto error;
- }
- }
- }
- break;
- }
- }
- result = TCL_OK;
- error:
- Tcl_DStringFree(&dString);
- return result;
-}
-
-static int
-ImportCsvProc(Blt_Table table, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int result;
- ImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- switches.separators = Blt_AssertStrdup(",\t");
- switches.quote = Blt_AssertStrdup("\"");
- switches.comment = Blt_AssertStrdup("");
- Blt_InitHashTable(&switches.dataTable, BLT_STRING_KEYS);
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3 , objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- result = TCL_ERROR;
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "can't set both -file and -data switches.",
- (char *)NULL);
- goto error;
- }
- if (switches.dataObjPtr != NULL) {
- int nBytes;
-
- switches.channel = NULL;
- switches.buffer = Tcl_GetStringFromObj(switches.dataObjPtr, &nBytes);
- switches.nBytes = nBytes;
- switches.fileObjPtr = NULL;
- result = ImportCsv(interp, table, &switches);
- } else {
- int closeChannel;
- Tcl_Channel channel;
- const char *fileName;
-
- closeChannel = TRUE;
- if (switches.fileObjPtr == NULL) {
- fileName = "out.csv";
- } else {
- fileName = Tcl_GetString(switches.fileObjPtr);
- }
- if ((fileName[0] == '@') && (fileName[1] != '\0')) {
- int mode;
-
- channel = Tcl_GetChannel(interp, fileName+1, &mode);
- if (channel == NULL) {
- goto error;
- }
- if ((mode & TCL_READABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", fileName,
- "\" not opened for reading", (char *)NULL);
- goto error;
- }
- closeChannel = FALSE;
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "r", 0);
- if (channel == NULL) {
- goto error;
- }
- }
- switches.channel = channel;
- Tcl_DStringInit(&switches.ds);
- result = ImportCsv(interp, table, &switches);
- Tcl_DStringFree(&switches.ds);
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- }
- error:
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- Blt_DeleteHashTable(&switches.dataTable);
- return result;
-}
-
-int
-Blt_Table_CsvInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_core", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_datatable_csv", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_Table_RegisterFormat(interp,
- "csv", /* Name of format. */
- ImportCsvProc, /* Import procedure. */
- ExportCsvProc); /* Export procedure. */
-
-}
-#endif /* NO_DATATABLE */
-
diff --git a/blt3.0.1/src/bltDtMysql.c b/blt3.0.1/src/bltDtMysql.c
deleted file mode 100644
index 64eff97..0000000
--- a/blt3.0.1/src/bltDtMysql.c
+++ /dev/null
@@ -1,445 +0,0 @@
-
-/*
- *
- * bltDtMysql.c --
- *
- * Copyright 1998-2005 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <blt.h>
-
-#ifndef NO_DATATABLE
-
-#include "config.h"
-#ifdef HAVE_LIBMYSQL
-#include <tcl.h>
-#include <bltDataTable.h>
-#include <bltAlloc.h>
-#include <bltSwitch.h>
-#include <mysql/mysql.h>
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif /* HAVE_MEMORY_H */
-
-DLLEXPORT extern Tcl_AppInitProc Blt_Table_MysqlInit;
-
-/*
- * Format Import Export
- * csv file/data file/data
- * tree data data
- * vector data data
- * xml file/data file/data
- * mysql data data
- *
- * $table import csv -file fileName -data dataString
- * $table export csv -file defaultFileName
- * $table import tree $treeName $node ?switches?
- * $table export tree $treeName $node "label" "label" "label"
- * $table import vector $vecName label $vecName label...
- * $table export vector label $vecName label $vecName...
- * $table import xml -file fileName -data dataString ?switches?
- * $table export xml -file fileName -data dataString ?switches?
- * $table import mysql -host $host -password $pw -db $db -port $port
- */
-/*
- * ImportSwitches --
- */
-typedef struct {
- char *host; /* If non-NULL, name of remote host of
- * MySql server. Otherwise "localhost"
- * is used. */
- char *user; /* If non-NULL, name of user account
- * to access MySql server. Otherwise
- * the current username is used. */
- char *pw; /* If non-NULL, is password to use to
- * access MySql server. */
- char *db; /* If non-NULL, name of MySql database
- * to access. */
- Tcl_Obj *query; /* If non-NULL, query to make. */
- int port; /* Port number to use. */
-
- /* Private data. */
- Tcl_Interp *interp;
- unsigned int flags;
- char *buffer; /* Buffer to read data into. */
- int nBytes; /* # of bytes in the buffer. */
-} ImportSwitches;
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_STRING, "-db", "dbName",
- Blt_Offset(ImportSwitches, db), 0, 0},
- {BLT_SWITCH_STRING, "-host", "hostName",
- Blt_Offset(ImportSwitches, host), 0, 0},
- {BLT_SWITCH_STRING, "-user", "userName",
- Blt_Offset(ImportSwitches, user), 0, 0},
- {BLT_SWITCH_STRING, "-password", "password",
- Blt_Offset(ImportSwitches, pw), 0, 0},
- {BLT_SWITCH_INT_NNEG, "-port", "number",
- Blt_Offset(ImportSwitches, port), 0, 0},
- {BLT_SWITCH_OBJ, "-query", "string",
- Blt_Offset(ImportSwitches, query), 0, 0},
- {BLT_SWITCH_END}
-};
-
-#ifdef EXPORT_MYSQL
-/*
- * ExportSwitches --
- */
-typedef struct {
- Blt_Chain rowChain;
- Blt_Chain colChain;
- Tcl_Obj *rows, *cols; /* Selected rows and columns to export. */
- unsigned int flags;
- Tcl_Obj *fileObj;
- Tcl_Channel channel; /* If non-NULL, channel to write output to. */
- Tcl_DString *dsPtr;
- int length; /* Length of dynamic string. */
- int count; /* Number of fields in current record. */
- Tcl_Interp *interp;
- char *quote; /* Quoted string delimiter. */
- char *sep; /* Separator character. */
-} ExportSwitches;
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-columns", "columns",
- Blt_Offset(ExportSwitches, cols), 0, 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(ExportSwitches, fileObj), 0, 0},
- {BLT_SWITCH_STRING, "-quote", "char",
- Blt_Offset(ExportSwitches, quote), 0, 0},
- {BLT_SWITCH_OBJ, "-rows", "rows",
- Blt_Offset(ExportSwitches, rows), 0, 0},
- {BLT_SWITCH_STRING, "-separator", "char",
- Blt_Offset(ExportSwitches, sep), 0, 0},
- {BLT_SWITCH_END}
-};
-
-static Blt_TableExportProc ExportMysqlProc;
-#endif
-
-#define DEF_CLIENT_FLAGS (CLIENT_MULTI_STATEMENTS|CLIENT_MULTI_RESULTS)
-
-static Blt_TableImportProc ImportMysqlProc;
-
-static Blt_TableColumnType
-MySqlFieldToColumnType(int type)
-{
- switch (type) {
- case FIELD_TYPE_LONG:
- case FIELD_TYPE_LONGLONG:
- return TABLE_COLUMN_TYPE_LONG;
- case FIELD_TYPE_DECIMAL:
- case FIELD_TYPE_TINY:
- case FIELD_TYPE_SHORT:
- case FIELD_TYPE_INT24:
- return TABLE_COLUMN_TYPE_INT;
- case FIELD_TYPE_FLOAT:
- case FIELD_TYPE_DOUBLE:
- return TABLE_COLUMN_TYPE_DOUBLE;
- case FIELD_TYPE_TINY_BLOB:
- case FIELD_TYPE_MEDIUM_BLOB:
- case FIELD_TYPE_LONG_BLOB:
- case FIELD_TYPE_BLOB:
- return TABLE_COLUMN_TYPE_UNKNOWN;
- case FIELD_TYPE_NULL:
- case FIELD_TYPE_TIMESTAMP:
- case FIELD_TYPE_DATE:
- case FIELD_TYPE_TIME:
- case FIELD_TYPE_DATETIME:
- case FIELD_TYPE_YEAR:
- case FIELD_TYPE_NEWDATE:
- case FIELD_TYPE_ENUM:
- case FIELD_TYPE_SET:
- case FIELD_TYPE_VAR_STRING:
- case FIELD_TYPE_STRING:
- default:
- return TABLE_COLUMN_TYPE_STRING;
- }
-}
-
-static int
-MySqlImportLabels(Tcl_Interp *interp, Blt_Table table, MYSQL_RES *myResults,
- size_t nCols, Blt_TableColumn *cols)
-{
- size_t i;
-
- for (i = 0; i < nCols; i++) {
- MYSQL_FIELD *fp;
- Blt_TableColumnType type;
-
- fp = mysql_fetch_field(myResults);
- if (Blt_Table_SetColumnLabel(interp, table, cols[i], fp->name)
- != TCL_OK) {
- return TCL_ERROR;
- }
- type = MySqlFieldToColumnType(fp->type);
- if (Blt_Table_SetColumnType(table, cols[i], type) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-static int
-MySqlImportRows(Tcl_Interp *interp, Blt_Table table, MYSQL_RES *myResults,
- size_t nCols, Blt_TableColumn *cols)
-{
- size_t nRows;
- size_t i;
-
- nRows = mysql_num_rows(myResults);
- if (nRows > Blt_Table_NumRows(table)) {
- size_t needed;
-
- /* Add the number of rows needed */
- needed = nRows - Blt_Table_NumRows(table);
- if (Blt_Table_ExtendRows(interp, table, needed, NULL) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- for (i = 1; /*empty*/; i++) {
- Blt_TableRow row;
- size_t j;
- MYSQL_ROW myRow;
- unsigned long *fieldLengths;
-
- myRow = mysql_fetch_row(myResults);
- if (myRow == NULL) {
- if (i < nRows) {
- Tcl_AppendResult(interp, "didn't complete fetching all rows",
- (char *)NULL);
- return TCL_ERROR;
- }
- break;
- }
- fieldLengths = mysql_fetch_lengths(myResults);
- row = Blt_Table_FindRowByIndex(table, i);
- for (j = 0; j < nCols; j++) {
- int result;
- Tcl_Obj *objPtr;
-
- if (myRow[j] == NULL) {
- continue; /* Empty value. */
- }
- objPtr = Tcl_NewByteArrayObj((unsigned char *)myRow[j],
- (int)fieldLengths[j]);
- Tcl_IncrRefCount(objPtr);
- result = Blt_Table_SetObj(table, row, cols[j], objPtr);
- Tcl_DecrRefCount(objPtr);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-static void
-MySqlDisconnect(MYSQL *cp)
-{
- mysql_close(cp);
-}
-
-static int
-MySqlQueryFromObj(Tcl_Interp *interp, MYSQL *cp, Tcl_Obj *objPtr)
-{
- int nBytes;
- const char *query;
-
- query = Tcl_GetStringFromObj(objPtr, &nBytes);
- if (mysql_real_query(cp, query, (unsigned long)nBytes) != 0) {
- Tcl_AppendResult(interp, "error in query \"", query, "\": ",
- mysql_error(cp), (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static void
-MySqlFreeResults(MYSQL_RES *myResults)
-{
- mysql_free_result (myResults);
-}
-
-static int
-MySqlResults(Tcl_Interp *interp, MYSQL *cp, MYSQL_RES **resultsPtr,
- long *nFieldsPtr)
-{
- MYSQL_RES *results;
-
- results = mysql_store_result(cp);
- if (results != NULL) {
- *nFieldsPtr = mysql_num_fields(results);
- } else if (mysql_field_count(cp) == 0) {
- *nFieldsPtr = 0;
- } else {
- Tcl_AppendResult(interp, "error collecting results: ", mysql_error(cp),
- (char *)NULL);
- return TCL_ERROR;
- }
- *resultsPtr = results;
- return TCL_OK;
-}
-
-static int
-MySqlConnect(Tcl_Interp *interp, const char *host, const char *user,
- const char *pw, const char *db, unsigned int port,
- unsigned long flags, MYSQL **cpPtr)
-{
- MYSQL *cp; /* Connection handler. */
-
- cp = mysql_init(NULL);
- if (cp == NULL) {
- Tcl_AppendResult(interp, "can't initialize mysql connection.",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (host == NULL) {
- host = "localhost";
- }
- cp->reconnect = 1;
-#if defined(MYSQL_VERSION_ID) && MYSQL_VERSION_ID >= 32200 /* 3.22 and up */
- if (mysql_real_connect(cp, host, user, pw, db, port, NULL, flags) == NULL) {
- Tcl_AppendResult(interp, "can't connect to mysql server on \"", host,
- "\": ", mysql_error(cp), (char *)NULL);
- return TCL_ERROR;
- }
-#else /* pre-3.22 */
- if (mysql_real_connect (cp, host, user, pw, port, NULL, flags) == NULL) {
- Tcl_AppendResult(interp, "can't connect to mysql server on \"",
- host, "\": ", mysql_error(cp), (char *)NULL);
- return TCL_ERROR;
- }
- if (db != NULL) {
- if (mysql_select_db(cp, db) != 0) {
- Tcl_AppendResult(interp, "can't select database \"", db, "\": ",
- mysql_error(cp), (char *)NULL);
- mysql_close(cp);
- cp = NULL;
- return TCL_ERROR;
- }
- }
-#endif
- *cpPtr = cp;
- return TCL_OK;
-}
-
-static int
-ImportMysqlProc(Blt_Table table, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- ImportSwitches switches;
- MYSQL *cp;
- MYSQL_RES *myResults;
- long nCols;
- Blt_TableColumn *cols;
-
- myResults = NULL;
- cp = NULL;
- cols = NULL;
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (MySqlConnect(interp, switches.host, switches.user, switches.pw,
- switches.db, switches.port, DEF_CLIENT_FLAGS, &cp) != TCL_OK) {
- goto error;
- }
- if (switches.query == NULL) {
- goto done;
- }
- if (MySqlQueryFromObj(interp, cp, switches.query) != TCL_OK) {
- goto error;
- }
- if (MySqlResults(interp, cp, &myResults, &nCols) != TCL_OK) {
- goto error;
- }
- /* Step 1. Create columns to hold the new values. Label
- * the columns using the title. */
- cols = Blt_AssertMalloc(nCols * sizeof(Blt_TableColumn));
- if (Blt_Table_ExtendColumns(interp, table, nCols, cols) != TCL_OK) {
- goto error;
- }
- if (MySqlImportLabels(interp, table, myResults, nCols, cols) != TCL_OK) {
- goto error;
- }
- if (MySqlImportRows(interp, table, myResults, nCols, cols) != TCL_OK) {
- goto error;
- }
- Blt_Free(cols);
- MySqlFreeResults(myResults);
- done:
- MySqlDisconnect(cp);
- Blt_FreeSwitches(importSwitches, &switches, 0);
- return TCL_OK;
- error:
- if (myResults != NULL) {
- MySqlFreeResults(myResults);
- }
- if (cols != NULL) {
- Blt_Free(cols);
- }
- if (cp != NULL) {
- MySqlDisconnect(cp);
- }
- Blt_FreeSwitches(importSwitches, &switches, 0);
- return TCL_ERROR;
-}
-
-#ifdef EXPORT_MYSQL
-static int
-ExportMysqlProc(Blt_Table table, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- return TCL_OK;
-}
-#endif
-
-int
-Blt_Table_MysqlInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_core", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_datatable_mysql", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_Table_RegisterFormat(interp,
- "mysql", /* Name of format. */
- ImportMysqlProc, /* Import procedure. */
- NULL); /* Export procedure. */
-
-}
-#endif /* HAVE_LIBMYSQL */
-#endif /* NO_DATATABLE */
-
diff --git a/blt3.0.1/src/bltDtTree.c b/blt3.0.1/src/bltDtTree.c
deleted file mode 100644
index f4f0e37..0000000
--- a/blt3.0.1/src/bltDtTree.c
+++ /dev/null
@@ -1,315 +0,0 @@
-
-/*
- *
- * bltDtTree.c --
- *
- * Copyright 1998-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <blt.h>
-
-#include "config.h"
-#ifndef NO_DATATABLE
-
-#include <tcl.h>
-#include <bltDataTable.h>
-#include <bltTree.h>
-#include <bltSwitch.h>
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif /* HAVE_MEMORY_H */
-
-/*
- * Format Import Export
- * csv file/data file/data
- * tree data data
- * vector data data
- * xml file/data file/data
- * sql data data
- *
- * $table import csv -file fileName -data dataString
- * $table export csv -file defaultFileName
- * $table import tree $treeName $node ?switches?
- * $table export tree $treeName $node "label" "label" "label"
- * $table import vector $vecName label $vecName label...
- * $table export vector label $vecName label $vecName...
- * $table import xml -file fileName -data dataString ?switches?
- * $table export xml -file fileName -data dataString ?switches?
- * $table import sql -host $host -password $pw -db $db -port $port
- */
-
-/*
- * ExportSwitches --
- */
-typedef struct {
- /* Private data. */
- Blt_TreeNode node;
-
- /* Public fields */
- Blt_TableIterator rIter, cIter;
- Blt_TableIterator hIter;
- Tcl_Obj *nodeObjPtr;
-} ExportSwitches;
-
-BLT_EXTERN Blt_SwitchFreeProc Blt_Table_ColumnIterFreeProc;
-BLT_EXTERN Blt_SwitchFreeProc Blt_Table_RowIterFreeProc;
-BLT_EXTERN Blt_SwitchParseProc Blt_Table_ColumnIterSwitchProc;
-BLT_EXTERN Blt_SwitchParseProc Blt_Table_RowIterSwitchProc;
-
-static Blt_SwitchCustom columnIterSwitch = {
- Blt_Table_ColumnIterSwitchProc, Blt_Table_ColumnIterFreeProc, 0,
-};
-static Blt_SwitchCustom rowIterSwitch = {
- Blt_Table_RowIterSwitchProc, Blt_Table_RowIterFreeProc, 0,
-};
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-columns", "columns",
- Blt_Offset(ExportSwitches, cIter), 0, 0, &columnIterSwitch},
- {BLT_SWITCH_CUSTOM, "-hierarchy", "columns",
- Blt_Offset(ExportSwitches, hIter), 0, 0, &columnIterSwitch},
- {BLT_SWITCH_OBJ, "-node", "node",
- Blt_Offset(ExportSwitches, nodeObjPtr), 0},
- {BLT_SWITCH_CUSTOM, "-rows", "rows",
- Blt_Offset(ExportSwitches, rIter), 0, 0, &rowIterSwitch},
- {BLT_SWITCH_END}
-};
-
-DLLEXPORT extern Tcl_AppInitProc Blt_Table_TreeInit;
-
-static Blt_TableImportProc ImportTreeProc;
-static Blt_TableExportProc ExportTreeProc;
-
-static int
-ImportTree(Tcl_Interp *interp, Blt_Table table, Blt_Tree tree,
- Blt_TreeNode top)
-{
- Blt_TreeNode node;
- int maxDepth, topDepth;
- long iRow, nCols;
-
- /*
- * Fill in the table data in 2 passes. We need to know the
- * maximum depth of the leaf nodes, to generate columns for each
- * level of the hierarchy. We have to do this before adding
- * node data values.
- */
-
- /* Pass 1. Create entries for all the nodes. Add entries for
- * the node and it's ancestor's labels. */
- maxDepth = topDepth = Blt_Tree_NodeDepth(top);
- nCols = Blt_Table_NumColumns(table);
- for (node = Blt_Tree_NextNode(top, top); node != NULL;
- node = Blt_Tree_NextNode(top, node)) {
- Blt_TreeNode parent;
- int depth;
- Blt_TableRow row;
- size_t iCol;
-
- depth = Blt_Tree_NodeDepth(node);
- if (depth > maxDepth) {
- Blt_TableColumn col;
-
- if (Blt_Table_ExtendColumns(interp, table, 1, &col) != TCL_OK) {
- return TCL_ERROR;
- }
- iCol = Blt_Table_ColumnIndex(col);
- maxDepth = depth;
- } else {
- iCol = depth - topDepth;
- }
- if (Blt_Table_ExtendRows(interp, table, 1, &row) != TCL_OK) {
- return TCL_ERROR;
- }
- for (parent = node; parent != top;
- parent = Blt_Tree_ParentNode(parent)){
- const char *label;
- Blt_TableColumn col;
-
- col = Blt_Table_FindColumnByIndex(table, iCol);
- label = Blt_Tree_NodeLabel(parent);
- if (Blt_Table_SetString(table, row, col, label, -1)!=TCL_OK) {
- return TCL_ERROR;
- }
- iCol--;
- }
- }
- /* Pass 2. Fill in entries for all the data fields found. */
- for (iRow = 1, node = Blt_Tree_NextNode(top, top); node != NULL;
- node = Blt_Tree_NextNode(top, node), iRow++) {
- Blt_TreeKey key;
- Blt_TreeKeyIterator iter;
- Blt_TableRow row;
-
- row = Blt_Table_FindRowByIndex(table, iRow);
- for (key = Blt_Tree_FirstKey(tree, node, &iter); key != NULL;
- key = Blt_Tree_NextKey(tree, &iter)) {
- Blt_TableColumn col;
- Tcl_Obj *objPtr;
-
- if (Blt_Tree_GetValue(interp, tree, node, key, &objPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- col = Blt_Table_FindColumnByLabel(table, key);
- if (col == NULL) {
- col = Blt_Table_CreateColumn(interp, table, key);
- if (col == NULL) {
- return TCL_ERROR;
- }
- }
- if (Blt_Table_SetObj(table, row, col, objPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-static int
-ImportTreeProc(Blt_Table table, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_Tree tree;
- Blt_TreeNode node;
-
- /* FIXME:
- * 2. Export *GetNode tag parsing routines from bltTreeCmd.c,
- * instead of using node id to select the top node.
- */
- tree = Blt_Tree_Open(interp, Tcl_GetString(objv[3]), 0);
- if (tree == NULL) {
- return TCL_ERROR;
- }
- if (objc == 5) {
- long inode;
-
- if (Tcl_GetLongFromObj(interp, objv[4], &inode) != TCL_OK) {
- return TCL_ERROR;
- }
- node = Blt_Tree_GetNode(tree, inode);
- if (node == NULL) {
- return TCL_ERROR;
- }
- } else {
- node = Blt_Tree_RootNode(tree);
- }
- return ImportTree(interp, table, tree, node);
-}
-
-static int
-ExportTree(Tcl_Interp *interp, Blt_Table table, Blt_Tree tree,
- Blt_TreeNode parent, ExportSwitches *switchesPtr)
-{
- Blt_TableRow row;
-
- for (row = Blt_Table_FirstTaggedRow(&switchesPtr->rIter); row != NULL;
- row = Blt_Table_NextTaggedRow(&switchesPtr->rIter)) {
- Blt_TableColumn col;
- Blt_TreeNode node;
- const char *label;
-
- label = Blt_Table_RowLabel(row);
- node = Blt_Tree_CreateNode(tree, parent, label, -1);
- for (col = Blt_Table_FirstTaggedColumn(&switchesPtr->cIter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&switchesPtr->cIter)) {
- Tcl_Obj *objPtr;
- const char *key;
-
- objPtr = Blt_Table_GetObj(table, row, col);
- key = Blt_Table_ColumnLabel(col);
- if (Blt_Tree_SetValue(interp, tree, node, key, objPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-static int
-ExportTreeProc(Blt_Table table, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_Tree tree;
- Blt_TreeNode node;
- ExportSwitches switches;
- int result;
-
- if (objc < 4) {
- Tcl_AppendResult(interp, "wrong # arguments: should be \"",
- Tcl_GetString(objv[0]), " export tree treeName ?switches?\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- tree = Blt_Tree_Open(interp, Tcl_GetString(objv[3]), 0);
- if (tree == NULL) {
- return TCL_ERROR;
- }
- memset(&switches, 0, sizeof(switches));
- rowIterSwitch.clientData = table;
- columnIterSwitch.clientData = table;
- Blt_Table_IterateAllRows(table, &switches.rIter);
- Blt_Table_IterateAllColumns(table, &switches.cIter);
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 4, objv + 4, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (switches.nodeObjPtr != NULL) {
- long inode;
-
- if (Tcl_GetLongFromObj(interp, switches.nodeObjPtr, &inode) != TCL_OK) {
- return TCL_ERROR;
- }
- node = Blt_Tree_GetNode(tree, inode);
- if (node == NULL) {
- return TCL_ERROR;
- }
- } else {
- node = Blt_Tree_RootNode(tree);
- }
- result = ExportTree(interp, table, tree, node, &switches);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return result;
-}
-
-int
-Blt_Table_TreeInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_core", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_datatable_tree", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_Table_RegisterFormat(interp,
- "tree", /* Name of format. */
- ImportTreeProc, /* Import procedure. */
- ExportTreeProc); /* Export procedure. */
-
-}
-#endif /* NO_DATATABLE */
-
diff --git a/blt3.0.1/src/bltDtVec.c b/blt3.0.1/src/bltDtVec.c
deleted file mode 100644
index b36c9fa..0000000
--- a/blt3.0.1/src/bltDtVec.c
+++ /dev/null
@@ -1,243 +0,0 @@
-
-/*
- *
- * bltDtVec.c --
- *
- * Copyright 1998-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <blt.h>
-
-#include "config.h"
-#include <assert.h>
-#include <tcl.h>
-#include <bltSwitch.h>
-#include <bltDataTable.h>
-#include <bltVector.h>
-
-extern double Blt_NaN(void);
-extern int Blt_GetDoubleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- double *valuePtr);
-
-DLLEXPORT extern Tcl_AppInitProc Blt_Table_VectorInit;
-
-/*
- * Format Import Export
- * csv file/data file/data
- * tree data data
- * vector data data
- * xml file/data file/data
- * sql data data
- *
- * $table import csv -file fileName -data dataString
- * $table export csv -file defaultFileName
- * $table import tree $treeName $node ?switches?
- * $table export tree $treeName $node "label" "label" "label"
- * $table import vector $vecName label $vecName label...
- * $table export vector label $vecName label $vecName...
- * $table import xml -file fileName -data dataString ?switches?
- * $table export xml -file fileName -data dataString ?switches?
- * $table import sql -host $host -password $pw -db $db -port $port
- */
-
-static Blt_TableImportProc ImportVecProc;
-static Blt_TableExportProc ExportVecProc;
-
-/*
- * $table export vector -file fileName ?switches...?
- * $table export vector ?switches...?
- */
-static int
-ExportVecProc(Blt_Table table, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int i;
- long nRows;
-
- if ((objc - 3) & 1) {
- Tcl_AppendResult(interp, "odd # of column/vector pairs: should be \"",
- Tcl_GetString(objv[0]),
- " export vector col vecName ?col vecName?...", (char *)NULL);
- return TCL_ERROR;
- }
- nRows = Blt_Table_NumRows(table);
- for (i = 3; i < objc; i += 2) {
- Blt_Vector *vector;
- size_t size;
- double *array;
- int k;
- Blt_TableColumn col;
-
- col = Blt_Table_FindColumn(interp, table, objv[i]);
- if (col == NULL) {
- return TCL_ERROR;
- }
- if (Blt_GetVectorFromObj(interp, objv[i+1], &vector) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_VecLength(vector) != nRows) {
- if (Blt_ResizeVector(vector, nRows) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- array = Blt_VecData(vector);
- size = Blt_VecSize(vector);
- for (k = 1; k <= Blt_VecLength(vector); k++) {
- Blt_TableRow row;
- Tcl_Obj *objPtr;
-
- row = Blt_Table_FindRowByIndex(table, k);
- assert(row != NULL);
- objPtr = Blt_Table_GetObj(table, row, col);
- if (objPtr == NULL) {
- array[k-1] = Blt_NaN();
- } else {
- double value;
-
- if (Blt_GetDoubleFromObj(interp, objPtr, &value) != TCL_OK) {
- return TCL_ERROR;
- }
- array[k-1] = value;
- }
- }
- if (Blt_ResetVector(vector, array, nRows, size, TCL_STATIC) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImportVecProc --
- *
- * Parses the given command line and calls one of several
- * export-specific operations.
- *
- * Results:
- * Returns a standard TCL result. It is the result of
- * operation called.
- *
- * $table import vector v1 col v2 col v3 col
- *
- *---------------------------------------------------------------------------
- */
-static int
-ImportVecProc(Blt_Table table, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int maxLen;
- int i;
-
- if ((objc - 3) & 1) {
- Tcl_AppendResult(interp, "odd # of vector/column pairs: should be \"",
- Tcl_GetString(objv[0]),
- " import vector vecName col vecName col...", (char *)NULL);
- return TCL_ERROR;
- }
- maxLen = 0;
- for (i = 3; i < objc; i += 2) {
- Blt_TableColumn col;
- Blt_Vector *vector;
-
- if (Blt_GetVectorFromObj(interp, objv[i], &vector) != TCL_OK) {
- return TCL_ERROR;
- }
- col = Blt_Table_FindColumn(NULL, table, objv[i+1]);
- if (col == NULL) {
- const char *label;
-
- label = Tcl_GetString(objv[i+1]);
- col = Blt_Table_CreateColumn(interp, table, label);
- if (col == NULL) {
- return TCL_ERROR;
- }
- Blt_Table_SetColumnType(table, col, TABLE_COLUMN_TYPE_DOUBLE);
- }
- if (Blt_VecLength(vector) > maxLen) {
- maxLen = Blt_VecLength(vector);
- }
- }
- if (maxLen > Blt_Table_NumRows(table)) {
- size_t needed;
-
- needed = maxLen - Blt_Table_NumRows(table);
- if (Blt_Table_ExtendRows(interp, table, needed, NULL) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- for (i = 3; i < objc; i += 2) {
- Blt_TableColumn col;
- Blt_Vector *vector;
- double *array;
- size_t j, k;
- size_t nElems;
-
- if (Blt_GetVectorFromObj(interp, objv[i], &vector) != TCL_OK) {
- return TCL_ERROR;
- }
- col = Blt_Table_FindColumn(interp, table, objv[i+1]);
- if (col == NULL) {
- return TCL_ERROR;
- }
- array = Blt_VecData(vector);
- nElems = Blt_VecLength(vector);
- for (j = 0, k = 1; j < nElems; j++, k++) {
- Blt_TableRow row;
-
- row = Blt_Table_FindRowByIndex(table, k);
- if (array[j] == Blt_NaN()) {
- if (Blt_Table_UnsetValue(table, row, col) != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- if (Blt_Table_SetObj(table, row, col,
- Tcl_NewDoubleObj(array[j])) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- }
- return TCL_OK;
-}
-
-int
-Blt_Table_VectorInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_core", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_datatable_vector", BLT_VERSION) != TCL_OK){
- return TCL_ERROR;
- }
- return Blt_Table_RegisterFormat(interp,
- "vector", /* Name of format. */
- ImportVecProc, /* Import procedure. */
- ExportVecProc); /* Export procedure. */
-}
-
diff --git a/blt3.0.1/src/bltDtXml.c b/blt3.0.1/src/bltDtXml.c
deleted file mode 100644
index e5f7b13..0000000
--- a/blt3.0.1/src/bltDtXml.c
+++ /dev/null
@@ -1,825 +0,0 @@
-
-/*
- *
- * bltDtXml.c --
- *
- * Copyright 1998-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <blt.h>
-
-#include "config.h"
-#define USE_NON_const 1
-#include <tcl.h>
-
-#include <bltSwitch.h>
-#include <bltDataTable.h>
-#include <bltTree.h>
-#include <bltList.h>
-#include <bltAlloc.h>
-#include <bltAssert.h>
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif /* HAVE_STRING_H */
-
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif /* HAVE_MEMORY_H */
-
-DLLEXPORT extern Tcl_AppInitProc Blt_Table_XmlInit;
-
-extern const char *Blt_Itoa(int);
-
-#define TRUE 1
-#define FALSE 0
-
-static Blt_TableImportProc ImportXmlProc;
-static Blt_TableExportProc ExportXmlProc;
-
-/*
- * Format Import Export
- * csv file/data file/data
- * tree data data
- * vector data data
- * xml file/data file/data
- * sql data data
- *
- * $table import csv -file fileName -data dataString
- * $table export csv -file defaultFileName
- * $table import tree $treeName $node ?switches?
- * $table export tree $treeName $node "label" "label" "label"
- * $table import vector $vecName label $vecName label...
- * $table export vector label $vecName label $vecName...
- * $table import xml -file fileName -data dataString ?switches?
- * $table export xml -file fileName -data dataString ?switches?
- * $table import sql -host $host -password $pw -db $db -port $port
- */
-
-/*
- * ImportSwitches --
- */
-typedef struct {
- Tcl_Obj *fileObj; /* Name of file representing the channel. */
- Tcl_Obj *dataObj;
- Tcl_Interp *interp;
- unsigned int flags;
-} ImportSwitches;
-
-#define IMPORT_ATTRIBUTES (1<<0)
-#define IMPORT_ELEMENTS (1<<1)
-#define IMPORT_CDATA (1<<2)
-#define IMPORT_MASK (IMPORT_ATTRIBUTES | IMPORT_CDATA | IMPORT_ELEMENTS)
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "string",
- Blt_Offset(ImportSwitches, dataObj), 0, 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(ImportSwitches, fileObj), 0, 0},
- {BLT_SWITCH_BITMASK_INVERT,"-noattrs", "",
- Blt_Offset(ImportSwitches, flags), 0, IMPORT_ATTRIBUTES},
- {BLT_SWITCH_BITMASK_INVERT,"-noelems", "",
- Blt_Offset(ImportSwitches, flags), 0, IMPORT_ELEMENTS},
- {BLT_SWITCH_BITMASK_INVERT,"-nocdata", "",
- Blt_Offset(ImportSwitches, flags), 0, IMPORT_CDATA},
- {BLT_SWITCH_END}
-};
-
-/*
- * ExportSwitches --
- */
-typedef struct {
- Blt_TableIterator rIter, cIter;
- Tcl_Obj *fileObj;
-
- /* Private fields. */
- Tcl_Interp *interp;
- unsigned int flags;
- Tcl_Channel channel; /* If non-NULL, channel to write output to. */
- Tcl_DString *dsPtr;
-} ExportSwitches;
-
-extern Blt_SwitchFreeProc Blt_Table_ColumnIterFreeProc;
-extern Blt_SwitchFreeProc Blt_Table_RowIterFreeProc;
-extern Blt_SwitchParseProc Blt_Table_ColumnIterSwitchProc;
-extern Blt_SwitchParseProc Blt_Table_RowIterSwitchProc;
-
-static Blt_SwitchCustom columnIterSwitch = {
- Blt_Table_ColumnIterSwitchProc, Blt_Table_ColumnIterFreeProc, 0,
-};
-static Blt_SwitchCustom rowIterSwitch = {
- Blt_Table_RowIterSwitchProc, Blt_Table_RowIterFreeProc, 0,
-};
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-columns", "columns",
- Blt_Offset(ExportSwitches, cIter), 0, 0, &columnIterSwitch},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(ExportSwitches, fileObj), 0, 0},
- {BLT_SWITCH_CUSTOM, "-rows", "rows",
- Blt_Offset(ExportSwitches, rIter), 0, 0, &rowIterSwitch},
- {BLT_SWITCH_END}
-};
-
-#ifdef HAVE_LIBEXPAT
-
-#include <expat.h>
-
-typedef struct {
- Blt_TableRow row;
- Blt_TableColumn col;
- Blt_Table table;
- Tcl_Interp *interp;
- int flags;
- Blt_HashTable attrTable;
- Blt_HashTable elemTable;
- Blt_HashTable stringTable;
- Blt_List elemList;
- Blt_ListNode node;
-} ImportData;
-
-static Tcl_Obj *
-GetStringObj(ImportData *importPtr, const char *string, size_t length)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- char *key;
-#define MAX_STATIC_STRING 1023
- char store[MAX_STATIC_STRING+1];
-
- if (length > MAX_STATIC_STRING) {
- key = Blt_AssertMalloc(length + 1);
- } else {
- key = store;
- }
- memcpy(key, string, length);
- key[length] = '\0';
- hPtr = Blt_CreateHashEntry(&importPtr->stringTable, key, &isNew);
- if (length > MAX_STATIC_STRING) {
- Blt_Free(key);
- }
- if (isNew) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(string, length);
- Tcl_IncrRefCount(objPtr);
- Blt_SetHashValue(hPtr, objPtr);
- return objPtr;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-static void
-DumpStringTable(Blt_HashTable *tablePtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(tablePtr, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- Tcl_Obj *objPtr;
-
- objPtr = Blt_GetHashValue(hPtr);
- Tcl_DecrRefCount(objPtr);
- }
- Blt_DeleteHashTable(tablePtr);
-}
-
-static void
-GetXmlCharacterData(void *userData, const XML_Char *string, int length)
-{
- ImportData *importPtr = userData;
-
- assert(length >= 0);
- if (importPtr->flags & IMPORT_CDATA) {
- Tcl_Obj *objPtr;
- Blt_ListNode node;
-
- /* Replicate the data for each sub-element. */
- objPtr = GetStringObj(importPtr, string, length);
- assert(importPtr->node != NULL);
- Blt_List_SetValue(importPtr->node, objPtr);
- for (node = Blt_List_FirstNode(importPtr->elemList); node != NULL;
- node = Blt_List_NextNode(node)) {
- Blt_TableColumn col;
-
- objPtr = Blt_List_GetValue(node);
- col = (Blt_TableColumn)Blt_List_GetKey(node);
- if (Blt_Table_SetObj(importPtr->table, importPtr->row, col,
- objPtr) != TCL_OK) {
- Tcl_BackgroundError(importPtr->interp);
- }
- }
- }
-}
-
-static void
-StartXmlTag(void *userData, const char *element, const char **attr)
-{
- Blt_Table table;
- Blt_TableRow row;
- ImportData *importPtr = userData;
- Tcl_Interp *interp;
-
- interp = importPtr->interp;
- table = importPtr->table;
- importPtr->node = NULL;
- if (importPtr->flags & IMPORT_ELEMENTS) {
- Blt_TableColumn col;
- Blt_HashEntry *hPtr;
- int isNew;
-
- /*
- * If this is the first time we're seeing this element, create a new
- * column labeled as the element. This is different than the table's
- * set of labels, because the table may already have a label by the
- * same name. We want to create a new column in this case.
- */
- hPtr = Blt_CreateHashEntry(&importPtr->elemTable, element, &isNew);
- if (isNew) {
- col = Blt_Table_CreateColumn(interp, table, element);
- if (col == NULL) {
- goto error;
- }
- Blt_SetHashValue(hPtr, col);
- } else {
- col = Blt_GetHashValue(hPtr);
- }
- importPtr->col = col;
- importPtr->node = Blt_List_Append(importPtr->elemList, (char *)col,NULL);
- }
- if (Blt_Table_ExtendRows(interp, table, 1, &row) != TCL_OK) {
- goto error;
- }
- importPtr->row = row;
- if (importPtr->flags & IMPORT_ATTRIBUTES) {
- const char **p;
-
- for (p = attr; *p != NULL; p += 2) {
- Blt_TableColumn col;
- Blt_HashEntry *hPtr;
- const char *name, *value;
- int isNew;
-
- name = *p, value = *(p+1);
- /*
- * If this is the first time we're seeing this attribute, create a
- * new column labeled as the attribute.
- */
- hPtr = Blt_CreateHashEntry(&importPtr->attrTable, name, &isNew);
- if (isNew) {
- col = Blt_Table_CreateColumn(interp, table, name);
- if (col == NULL) {
- goto error;
- }
- Blt_SetHashValue(hPtr, col);
- } else {
- col = Blt_GetHashValue(hPtr);
- }
- /* Set the attribute value as the cell value. */
- if (Blt_Table_SetString(table, row, col, value, -1)!=TCL_OK) {
- goto error;
- }
- }
- }
- return;
- error:
- Tcl_BackgroundError(importPtr->interp);
-}
-
-static void
-EndXmlTag(void *userData, const char *element)
-{
- ImportData *importPtr = userData;
-
- if (importPtr->node != NULL) {
- Blt_ListNode prev;
-
- /* Pop the tag from the stack. */
- prev = Blt_List_PrevNode(importPtr->node);
- Blt_List_DeleteNode(importPtr->node);
- importPtr->node = prev;
- }
-}
-
-static int
-ReadXmlFromFile(Tcl_Interp *interp, XML_Parser parser, const char *fileName)
-{
- int closeChannel;
- int done;
- Tcl_Channel channel;
-
- closeChannel = TRUE;
- if ((fileName[0] == '@') && (fileName[1] != '\0')) {
- int mode;
-
- channel = Tcl_GetChannel(interp, fileName+1, &mode);
- if (channel == NULL) {
- return FALSE;
- }
- if ((mode & TCL_READABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", fileName,
- "\" not opened for reading", (char *)NULL);
- return FALSE;
- }
- closeChannel = FALSE;
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "r", 0);
- if (channel == NULL) {
- return FALSE; /* Can't open dump file. */
- }
- }
- done = FALSE;
- while (!done) {
- int length;
-#define BUFFSIZE 8192
- char buffer[BUFFSIZE];
-
- length = Tcl_Read(channel, buffer, sizeof(char) * BUFFSIZE);
- if (length < 0) {
- Tcl_AppendResult(interp, "\nread error: ", Tcl_PosixError(interp),
- (char *)NULL);
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- return FALSE;
- }
- done = Tcl_Eof(channel);
- if (!XML_Parse(parser, buffer, length, done)) {
- Tcl_AppendResult(interp, "\n", fileName, ":",
- Blt_Itoa(XML_GetCurrentLineNumber(parser)), ": ",
- "error: ",
- XML_ErrorString(XML_GetErrorCode(parser)),
- (char *)NULL);
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- return FALSE;
- }
- }
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- return TRUE;
-}
-
-static int
-GetXmlExternalEntityRef(XML_Parser parser, const XML_Char *context,
- const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId)
-{
- ImportData *dataPtr;
- Tcl_DString dString;
- Tcl_Interp *interp;
- XML_Parser newParser;
- int result;
-
- dataPtr = XML_GetUserData(parser);
- assert(dataPtr != NULL);
- interp = dataPtr->interp;
- Tcl_DStringInit(&dString);
- if ((base != NULL) && (Tcl_GetPathType(systemId) == TCL_PATH_RELATIVE)) {
- const char **argv;
- const char **baseArr, **sysIdArr;
- int argc;
- int i, j;
- int nBase, nSysId;
-
- Tcl_SplitPath(base, &nBase, &baseArr);
- Tcl_SplitPath(systemId, &nSysId, &sysIdArr);
- argc = nBase + nSysId;
- argv = Blt_Malloc(sizeof(char *) * (argc + 1));
- if (argv == NULL) {
- return FALSE;
- }
- for (i = 0; i < nBase; i++) {
- argv[i] = baseArr[i];
- }
- for (j = 0; j < nSysId; j++, i++) {
- argv[i] = sysIdArr[j];
- }
- argv[i] = NULL;
- Tcl_JoinPath(argc, argv, &dString);
- Blt_Free(baseArr);
- Blt_Free(sysIdArr);
- Blt_Free(argv);
- } else {
- Tcl_DStringAppend(&dString, systemId, -1);
- }
- newParser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (newParser == NULL) {
- Tcl_AppendResult(interp, "can't create external entity ref parser",
- (char *)NULL);
- return FALSE;
- }
- result = ReadXmlFromFile(interp, newParser, Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- XML_ParserFree(newParser);
- return result;
-}
-
-static int
-ImportXmlFile(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *fileObjPtr,
- unsigned int flags)
-{
- ImportData import;
- XML_Parser parser;
- int result;
- char *fileName;
-
- parser = XML_ParserCreate(NULL);
- if (parser == NULL) {
- Tcl_AppendResult(interp, "can't create XML parser", (char *)NULL);
- return TCL_ERROR;
- }
- import.table = table;
- import.row = NULL;
- import.interp = interp;
- import.flags = flags;
- Blt_InitHashTable(&import.stringTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&import.attrTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&import.elemTable, BLT_STRING_KEYS);
- import.elemList = Blt_List_Create(BLT_ONE_WORD_KEYS);
-
- XML_SetUserData(parser, &import);
-
- fileName = Tcl_GetString(fileObjPtr);
- {
- Tcl_DString dString;
- int argc;
- const char **argv;
-
- Tcl_DStringInit(&dString);
- Tcl_SplitPath(fileName, &argc, &argv);
- Tcl_JoinPath(argc - 1, argv, &dString);
- XML_SetBase(parser, Tcl_DStringValue(&dString));
- Blt_Free(argv);
- Tcl_DStringFree(&dString);
- }
- XML_SetElementHandler(parser, StartXmlTag, EndXmlTag);
- XML_SetCharacterDataHandler(parser, GetXmlCharacterData);
- XML_SetExternalEntityRefHandler(parser, GetXmlExternalEntityRef);
- result = ReadXmlFromFile(interp, parser, fileName);
- XML_ParserFree(parser);
- Blt_DeleteHashTable(&import.attrTable);
- Blt_DeleteHashTable(&import.elemTable);
- DumpStringTable(&import.stringTable);
- Blt_List_Destroy(import.elemList);
- return (result) ? TCL_OK : TCL_ERROR;
-}
-
-
-static int
-ImportXmlData(Tcl_Interp *interp, Blt_Table table, Tcl_Obj *dataObjPtr,
- unsigned int flags)
-{
- ImportData import;
- XML_Parser parser;
- char *string;
- int length;
- int result;
-
- parser = XML_ParserCreate(NULL);
- if (parser == NULL) {
- Tcl_AppendResult(interp, "can't create parser", (char *)NULL);
- return TCL_ERROR;
- }
- import.table = table;
- import.row = NULL;
- import.interp = interp;
- import.flags = flags;
- Blt_InitHashTable(&import.attrTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&import.elemTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&import.stringTable, BLT_STRING_KEYS);
- import.elemList = Blt_List_Create(BLT_ONE_WORD_KEYS);
-
- XML_SetUserData(parser, &import);
- XML_SetElementHandler(parser, StartXmlTag, EndXmlTag);
- XML_SetCharacterDataHandler(parser, GetXmlCharacterData);
- string = Tcl_GetStringFromObj(dataObjPtr, &length);
- result = XML_Parse(parser, string, length, 1);
- if (!result) {
- Tcl_AppendResult(interp, "\nparse error at line ",
- Blt_Itoa(XML_GetCurrentLineNumber(parser)), ": ",
- XML_ErrorString(XML_GetErrorCode(parser)),
- (char *)NULL);
- }
- XML_ParserFree(parser);
- Blt_DeleteHashTable(&import.attrTable);
- Blt_DeleteHashTable(&import.elemTable);
- DumpStringTable(&import.stringTable);
- Blt_List_Destroy(import.elemList);
- return (result) ? TCL_OK : TCL_ERROR;
-}
-
-static int
-ImportXmlProc(Blt_Table table, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int result;
- ImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- switches.flags = IMPORT_MASK;
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- result = TCL_ERROR;
- if ((switches.dataObj != NULL) && (switches.fileObj != NULL)) {
- Tcl_AppendResult(interp, "can't set both -file and -data switches.",
- (char *)NULL);
- goto error;
- }
- if ((switches.flags & IMPORT_MASK) == 0) {
- Tcl_AppendResult(interp,
- "can't set both -noelems and -noattrs switches.", (char *)NULL);
- goto error;
- }
- if (switches.fileObj != NULL) {
- result = ImportXmlFile(interp, table, switches.fileObj, switches.flags);
- } else {
- result = ImportXmlData(interp, table, switches.dataObj, switches.flags);
- }
- error:
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return result;
-}
-
-#endif /* HAVE_LIBEXPAT */
-
-static int
-XmlFlush(ExportSwitches *exportPtr)
-{
- int nWritten;
- char *line;
- int length;
-
- line = Tcl_DStringValue(exportPtr->dsPtr);
- length = Tcl_DStringLength(exportPtr->dsPtr);
- nWritten = Tcl_Write(exportPtr->channel, line, length);
- if (nWritten != length) {
- Tcl_AppendResult(exportPtr->interp, "can't write xml element: ",
- Tcl_PosixError(exportPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_DStringSetLength(exportPtr->dsPtr, 0);
- return TCL_OK;
-}
-
-static void
-XmlPutEscapeString(const char *from, size_t length, ExportSwitches *exportPtr)
-{
- const char *p, *pend;
-
- for (p = from, pend = from + length; p < pend; /*empty*/) {
- switch (*p) {
- case '\'':
- if (p > from) {
- Tcl_DStringAppend(exportPtr->dsPtr, from, p - from);
- }
- from = ++p;
- Tcl_DStringAppend(exportPtr->dsPtr, "'", 6);
- break;
- case '&':
- if (p > from) {
- Tcl_DStringAppend(exportPtr->dsPtr, from, p - from);
- }
- from = ++p;
- Tcl_DStringAppend(exportPtr->dsPtr, "&", 5);
- break;
- case '>':
- if (p > from) {
- Tcl_DStringAppend(exportPtr->dsPtr, from, p - from);
- }
- from = ++p;
- Tcl_DStringAppend(exportPtr->dsPtr, ">", 4);
- break;
- case '<':
- if (p > from) {
- Tcl_DStringAppend(exportPtr->dsPtr, from, p - from);
- }
- from = ++p;
- Tcl_DStringAppend(exportPtr->dsPtr, "<", 4);
- break;
- case '"':
- if (p > from) {
- Tcl_DStringAppend(exportPtr->dsPtr, from, p - from);
- }
- from = ++p;
- Tcl_DStringAppend(exportPtr->dsPtr, """, 6);
- break;
- default:
- p++;
- break;
- }
- }
- if (p > from) {
- Tcl_DStringAppend(exportPtr->dsPtr, from, p - from);
- }
-}
-
-static int
-XmlStartTable(ExportSwitches *exportPtr, const char *tableName)
-{
- Tcl_DStringSetLength(exportPtr->dsPtr, 0);
- Tcl_DStringAppend(exportPtr->dsPtr, "<", 1);
- Tcl_DStringAppend(exportPtr->dsPtr, tableName, -1);
- Tcl_DStringAppend(exportPtr->dsPtr, ">\n", 2);
- if (exportPtr->channel != NULL) {
- return XmlFlush(exportPtr);
- }
- return TCL_OK;
-}
-
-static int
-XmlEndTable(ExportSwitches *exportPtr, const char *tableName)
-{
- Tcl_DStringAppend(exportPtr->dsPtr, "</", 2);
- Tcl_DStringAppend(exportPtr->dsPtr, tableName, -1);
- Tcl_DStringAppend(exportPtr->dsPtr, ">\n", 2);
- if (exportPtr->channel != NULL) {
- return XmlFlush(exportPtr);
- }
- return TCL_OK;
-}
-
-static void
-XmlStartElement(ExportSwitches *exportPtr, const char *elemName)
-{
- if (exportPtr->channel != NULL) {
- Tcl_DStringSetLength(exportPtr->dsPtr, 0);
- }
- Tcl_DStringAppend(exportPtr->dsPtr, " <", 3);
- Tcl_DStringAppend(exportPtr->dsPtr, elemName, -1);
-}
-
-static int
-XmlEndElement(ExportSwitches *exportPtr)
-{
- Tcl_DStringAppend(exportPtr->dsPtr, "/>\n", 3);
- if (exportPtr->channel != NULL) {
- return XmlFlush(exportPtr);
- }
- return TCL_OK;
-}
-
-static void
-XmlAppendAttrib(ExportSwitches *exportPtr, const char *attrName,
- const char *value, int length)
-{
- size_t valueLen;
-
- if (length < 0) {
- valueLen = strlen(value);
- } else {
- valueLen = (size_t)length;
- }
- Tcl_DStringAppend(exportPtr->dsPtr, " ", 1);
- Tcl_DStringAppend(exportPtr->dsPtr, attrName, -1);
- Tcl_DStringAppend(exportPtr->dsPtr, "=", 1);
- Tcl_DStringAppend(exportPtr->dsPtr, "\"", 1);
- XmlPutEscapeString(value, valueLen, exportPtr);
- Tcl_DStringAppend(exportPtr->dsPtr, "\"", 1);
-}
-
-static int
-XmlExport(Blt_Table table, ExportSwitches *exportPtr)
-{
- Blt_TableRow row;
-
- XmlStartTable(exportPtr, "root");
- for (row = Blt_Table_FirstTaggedRow(&exportPtr->rIter); row != NULL;
- row = Blt_Table_NextTaggedRow(&exportPtr->rIter)) {
- Blt_TableColumn col;
- const char *label;
-
- XmlStartElement(exportPtr, "row");
- label = Blt_Table_RowLabel(row);
- XmlAppendAttrib(exportPtr, "name", label, -1);
- for (col = Blt_Table_FirstTaggedColumn(&exportPtr->cIter); col != NULL;
- col = Blt_Table_NextTaggedColumn(&exportPtr->cIter)) {
- const char *string;
-
- label = Blt_Table_ColumnLabel(col);
- string = Blt_Table_GetString(table, row, col);
- if (string != NULL) {
- XmlAppendAttrib(exportPtr, label, string, -1);
- }
- }
- if (XmlEndElement(exportPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- XmlEndTable(exportPtr, "root");
- return TCL_OK;
-}
-
-static int
-ExportXmlProc(Blt_Table table, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- ExportSwitches switches;
- Tcl_Channel channel;
- Tcl_DString ds;
- int closeChannel;
- int result;
-
- closeChannel = FALSE;
- channel = NULL;
-
- Tcl_DStringInit(&ds);
- memset(&switches, 0, sizeof(switches));
- rowIterSwitch.clientData = table;
- columnIterSwitch.clientData = table;
- Blt_Table_IterateAllRows(table, &switches.rIter);
- Blt_Table_IterateAllColumns(table, &switches.cIter);
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- result = TCL_ERROR;
- if (switches.fileObj != NULL) {
- char *fileName;
-
- closeChannel = TRUE;
- fileName = Tcl_GetString(switches.fileObj);
- if ((fileName[0] == '@') && (fileName[1] != '\0')) {
- int mode;
-
- channel = Tcl_GetChannel(interp, fileName+1, &mode);
- if (channel == NULL) {
- goto error;
- }
- if ((mode & TCL_WRITABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", fileName,
- "\" not opened for writing", (char *)NULL);
- goto error;
- }
- closeChannel = FALSE;
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "w", 0666);
- if (channel == NULL) {
- goto error; /* Can't open export file. */
- }
- }
- }
- switches.interp = interp;
- switches.dsPtr = &ds;
- switches.channel = channel;
- result = XmlExport(table, &switches);
- if ((switches.channel == NULL) && (result == TCL_OK)) {
- Tcl_DStringResult(interp, &ds);
- }
- error:
- Tcl_DStringFree(&ds);
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return result;
-}
-
-int
-Blt_Table_XmlInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_core", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_datatable_xml", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_Table_RegisterFormat(interp,
- "xml", /* Name of format. */
-#ifdef HAVE_LIBEXPAT
- ImportXmlProc, /* Import procedure. */
-#else
- NULL, /* Import procedure. */
-#endif /* HAVE_LIBEXPAT */
- ExportXmlProc); /* Export procedure. */
-
-}
-
diff --git a/blt3.0.1/src/bltExtInit.c b/blt3.0.1/src/bltExtInit.c
deleted file mode 100644
index 736b89f..0000000
--- a/blt3.0.1/src/bltExtInit.c
+++ /dev/null
@@ -1,219 +0,0 @@
-
-/*
- * BltExInit.c --
- *
- * This module initials the Tk-related commands of BLT toolkit, registering
- * the commands with the TCL interpreter.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltNsUtil.h"
-
-#if (_TCL_VERSION >= _VERSION(8,5,0))
-#define TCL_VERSION_LOADED TCL_PATCH_LEVEL
-#else
-#define TCL_VERSION_LOADED TCL_VERSION
-#endif
-#if (_TK_VERSION >= _VERSION(8,5,0))
-#define TK_VERSION_LOADED TK_PATCH_LEVEL
-#else
-#define TK_VERSION_LOADED TK_VERSION
-#endif
-
-
-BLT_EXTERN Tcl_AppInitProc Blt_x_Init;
-BLT_EXTERN Tcl_AppInitProc Blt_x_SafeInit;
-BLT_EXTERN Tcl_AppInitProc Blt_core_Init;
-BLT_EXTERN Tcl_AppInitProc Blt_Init;
-
-static Tcl_AppInitProc *cmdProcs[] =
-{
-#ifndef NO_BGPATTERN
- Blt_BgPatternCmdInitProc,
-#endif
-#ifndef NO_GRAPH
- Blt_GraphCmdInitProc,
-#endif
-#ifndef NO_PICTURE
- Blt_PictureCmdInitProc,
-#endif
-#ifndef NO_TABLEMGR
- Blt_TableMgrCmdInitProc,
-#endif
-#ifndef NO_TABSET
- Blt_TabsetCmdInitProc,
-#endif
-#ifndef NO_HTEXT
- Blt_HtextCmdInitProc,
-#endif
-#ifndef NO_BUSY
- Blt_BusyCmdInitProc,
-#endif
-#ifndef NO_WINOP
- Blt_WinopCmdInitProc,
-#endif
-#ifndef NO_BITMAP
- Blt_BitmapCmdInitProc,
-#endif
-#ifndef NO_DRAGDROP
- Blt_DragDropCmdInitProc,
-#endif
-#ifndef NO_DND
- Blt_DndCmdInitProc,
-#endif
-#ifndef NO_CONTAINER
- Blt_ContainerCmdInitProc,
-#endif
-#ifndef NO_BEEP
- Blt_BeepCmdInitProc,
-#endif
-#ifndef NO_CUTBUFFER
- Blt_CutbufferCmdInitProc,
-#endif
-#ifndef NO_PRINTER
- Blt_PrinterCmdInitProc,
-#endif
-#ifndef NO_TKFRAME
- Blt_FrameCmdInitProc,
-#endif
-#ifndef NO_TKBUTTON
- Blt_ButtonCmdInitProc,
-#endif
-#ifndef NO_TKSCROLLBAR
- Blt_ScrollbarCmdInitProc,
-#endif
-#ifndef NO_SCROLLSET
- Blt_ScrollsetCmdInitProc,
-#endif
-#ifndef NO_PANESET
- Blt_PanesetCmdInitProc,
-#endif
-#ifndef NO_TREEVIEW
- Blt_TreeViewCmdInitProc,
-#endif
-#if (BLT_MAJOR_VERSION > 3)
-#ifndef NO_MOUNTAIN
- Blt_MountainCmdInitProc,
-#endif
-#endif
-#ifndef NO_TED
- Blt_TedCmdInitProc,
-#endif
-#ifndef NO_COMBOTREE
- Blt_ComboButtonInitProc,
- Blt_ComboEntryInitProc,
- Blt_ComboMenuInitProc,
- Blt_ComboTreeInitProc,
- Blt_ListViewInitProc,
-#endif
-#ifndef NO_AFM
- Blt_AfmCmdInitProc,
-#endif
-#ifndef NO_SENDEVENT
- Blt_SendEventCmdInitProc,
-#endif
- (Tcl_AppInitProc *) NULL
-};
-
-/*LINTLIBRARY*/
-int
-Blt_x_Init(Tcl_Interp *interp) /* Interpreter to add extra commands */
-{
- Tcl_Namespace *nsPtr;
- Tcl_AppInitProc **p;
- const int isExact = 1;
-
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION_LOADED, isExact) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_core", BLT_VERSION, isExact) == NULL) {
- return TCL_ERROR;
- }
-
-#if (_TCL_VERSION >= _VERSION(8,1,0))
-#ifdef USE_TK_STUBS
- if (Tk_InitStubs(interp, TK_VERSION_LOADED, isExact) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgPresent(interp, "Tk", TK_VERSION_LOADED, isExact) == NULL) {
- return TCL_OK;
- }
-#else
- if (Tcl_PkgRequire(interp, "Tk", TK_VERSION_LOADED, isExact) == NULL) {
- Tcl_ResetResult(interp);
- return TCL_OK;
- }
-#endif
- nsPtr = Tcl_CreateNamespace(interp, "::blt::tk", NULL, NULL);
- if (nsPtr == NULL) {
- return TCL_ERROR;
- }
- nsPtr = Tcl_FindNamespace(interp, "::blt", NULL, TCL_LEAVE_ERR_MSG);
- if (nsPtr == NULL) {
- return TCL_ERROR;
- }
- /*
- Blt_RegisterPictureImageType(interp);
- Blt_RegisterEpsCanvasItem();
- Blt_InitXRandrConfig(interp);
- */
- /* Initialize the BLT commands that only use Tk. */
- for (p = cmdProcs; *p != NULL; p++) {
- if ((**p) (interp) != TCL_OK) {
- Tcl_DeleteNamespace(nsPtr);
- return TCL_ERROR;
- }
- }
- if (Tcl_PkgProvide(interp, "blt_extra", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*LINTLIBRARY*/
-int
-Blt_x_SafeInit(Tcl_Interp *interp) /* Interpreter to add extra commands */
-{
- return Blt_x_Init(interp);
-}
-
-int
-Blt_Init(Tcl_Interp *interp)
-{
- if (Blt_core_Init(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_x_Init(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-#ifdef USE_DLL
-# include "bltWinDll.c"
-#endif
-
diff --git a/blt3.0.1/src/bltFont.h b/blt3.0.1/src/bltFont.h
deleted file mode 100644
index c45b49a..0000000
--- a/blt3.0.1/src/bltFont.h
+++ /dev/null
@@ -1,139 +0,0 @@
-
-/*
- * bltFont.h --
- *
- * Copyright 1993-2004 George A Howlett.v
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_FONT_H
-#define _BLT_FONT_H
-
-#define FONT_ITALIC (1<<0)
-#define FONT_BOLD (1<<1)
-
-typedef struct {
- int ascent; /* The amount in pixels that the tallest
- * letter sticks up above the baseline, plus
- * any extra blank space added by the designer
- * of the font. */
- int descent; /* The largest amount in pixels that any
- * letter sticks below the baseline, plus any
- * extra blank space added by the designer of
- * the font. */
- int linespace; /* The sum of the ascent and descent. How
- * far apart two lines of text in the same
- * font should be placed so that none of the
- * characters in one line overlap any of the
- * characters in the other line. */
- int tabWidth; /* Width of tabs in this font (pixels). */
- int underlinePos; /* Offset from baseline to origin of
- * underline bar (used for drawing underlines
- * on a non-underlined font). */
- int underlineHeight; /* Height of underline bar (used for drawing
- * underlines on a non-underlined font). */
-} Blt_FontMetrics;
-
-
-typedef struct _Blt_Font *Blt_Font;
-typedef struct Blt_FontClass Blt_FontClass;
-
-typedef const char *(Blt_NameOfFontProc)(Blt_Font font);
-typedef void (Blt_GetFontMetricsProc)(Blt_Font font,
- Blt_FontMetrics *metricsPtr);
-typedef Font (Blt_FontIdProc)(Blt_Font font);
-typedef int (Blt_TextStringWidthProc)(Blt_Font font, const char *string,
- int nBytes);
-typedef void (Blt_FreeFontProc)(Blt_Font font);
-typedef int (Blt_MeasureCharsProc)(Blt_Font font, const char *text, int nBytes,
- int maxLength, int flags, int *lengthPtr);
-typedef void (Blt_DrawCharsProc)(Display *display, Drawable drawable, GC gc,
- Blt_Font font, int depth, float angle, const char *text, int length,
- int x, int y);
-typedef int (Blt_PostscriptFontNameProc)(Blt_Font font, Tcl_DString *resultPtr);
-typedef const char *(Blt_FamilyOfFontProc)(Blt_Font font);
-typedef int (Blt_CanRotateFontProc)(Blt_Font font, float angle);
-typedef void (Blt_UnderlineCharsProc)(Display *display, Drawable drawable,
- GC gc, Blt_Font font, const char *text, int textLen, int x, int y,
- int first, int last, int xMax);
-
-struct Blt_FontClass {
- int type; /* Indicates the type of font used. */
- Blt_NameOfFontProc *nameOfFont;
- Blt_FamilyOfFontProc *familyOfFont;
- Blt_FontIdProc *fontId;
- Blt_GetFontMetricsProc *getFontMetrics;
- Blt_MeasureCharsProc *measureChars;
- Blt_TextStringWidthProc *textWidth;
- Blt_CanRotateFontProc *canRotateFont;
- Blt_DrawCharsProc *drawChars;
- Blt_PostscriptFontNameProc *postscriptFontName;
- Blt_FreeFontProc *freeFont;
- Blt_UnderlineCharsProc *underlineChars;
-};
-
-struct _Blt_Font {
- void *clientData;
- Tcl_Interp *interp;
- Display *display;
- Blt_FontClass *classPtr;
-};
-
-#define Blt_NameOfFont(f) (*(f)->classPtr->nameOfFont)(f)
-#define Blt_FontId(f) (*(f)->classPtr->fontId)(f)
-#define Blt_MeasureChars(f,s,l,ml,fl,lp) \
- (*(f)->classPtr->measureChars)(f,s,l,ml,fl,lp)
-#define Blt_DrawChars(d,w,gc,f,dp,a,t,l,x,y) \
- (*(f)->classPtr->drawChars)(d,w,gc,f,dp,a,t,l,x,y)
-#define Blt_PostscriptFontName(f,rp) (*(f)->classPtr->postscriptFontName)(f,rp)
-#define Blt_FamilyOfFont(f) (*(f)->classPtr->familyOfFont)(f)
-#define Blt_CanRotateFont(f,a) (*(f)->classPtr->canRotateFont)(f,a)
-#define Blt_FreeFont(f) (*(f)->classPtr->freeFont)(f)
-#define Blt_UnderlineChars(d,w,g,f,s,l,x,y,a,b,m) \
- (*(f)->classPtr->underlineChars)(d,w,g,f,s,l,x,y,a,b,m)
-
-BLT_EXTERN Blt_Font Blt_GetFont(Tcl_Interp *interp, Tk_Window tkwin,
- const char *string);
-BLT_EXTERN Blt_Font Blt_AllocFontFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Tcl_Obj *objPtr);
-
-BLT_EXTERN void Blt_DrawCharsWithEllipsis(Tk_Window tkwin, Drawable drawable,
- GC gc, Blt_Font font, int depth, float angle, const char *string,
- int nBytes, int x, int y, int maxLength);
-
-BLT_EXTERN Blt_Font Blt_GetFontFromObj(Tcl_Interp *interp, Tk_Window tkwin,
- Tcl_Obj *objPtr);
-
-BLT_EXTERN void Blt_GetFontMetrics(Blt_Font font, Blt_FontMetrics *fmPtr);
-BLT_EXTERN int Blt_TextWidth(Blt_Font font, const char *string, int length);
-BLT_EXTERN Tcl_Interp *Blt_GetFontInterp(Blt_Font font);
-
-#ifdef _XFT_H_
-BLT_EXTERN const char *Blt_GetFontFileFromObj(Tcl_Interp *interp,
- Tcl_Obj *objPtr, double *sizePtr);
-BLT_EXTERN const char *Blt_GetFontFile(Tcl_Interp *interp, const char *spec,
- double *sizePtr);
-#endif /*_XFT_H_*/
-
-#endif /* _BLT_FONT_H */
diff --git a/blt3.0.1/src/bltGrAxis.c b/blt3.0.1/src/bltGrAxis.c
deleted file mode 100644
index f6f54e9..0000000
--- a/blt3.0.1/src/bltGrAxis.c
+++ /dev/null
@@ -1,5765 +0,0 @@
-
-/*
- * bltGrAxis.c --
- *
- * This module implements coordinate axes for the BLT graph widget.
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltGraph.h"
-#include "bltOp.h"
-#include "bltGrElem.h"
-#include <X11/Xutil.h>
-
-#define MAXTICKS 10001
-
-#define FCLAMP(x) ((((x) < 0.0) ? 0.0 : ((x) > 1.0) ? 1.0 : (x)))
-
-/*
- * Round x in terms of units
- */
-#define UROUND(x,u) (Round((x)/(u))*(u))
-#define UCEIL(x,u) (ceil((x)/(u))*(u))
-#define UFLOOR(x,u) (floor((x)/(u))*(u))
-
-#define NUMDIGITS 15 /* Specifies the number of digits of
- * accuracy used when outputting axis
- * tick labels. */
-enum TickRange {
- AXIS_TIGHT, AXIS_LOOSE, AXIS_ALWAYS_LOOSE
-};
-
-#define AXIS_PAD_TITLE 2 /* Padding for axis title. */
-
-/* Axis flags: */
-
-#define AXIS_AUTO_MAJOR (1<<16) /* Auto-generate major ticks. */
-#define AXIS_AUTO_MINOR (1<<17) /* Auto-generate minor ticks. */
-#define AXIS_USE (1<<18) /* Axis is displayed on the screen via
- * the "use" operation */
-#define AXIS_GRID (1<<19) /* Display grid lines. */
-#define AXIS_GRIDMINOR (1<<20) /* Display grid lines for minor
- * ticks. */
-#define AXIS_SHOWTICKS (1<<21) /* Display axis ticks. */
-#define AXIS_EXTERIOR (1<<22) /* Axis is exterior to the plot. */
-#define AXIS_CHECK_LIMITS (1<<23) /* Validate user-defined axis limits. */
-
-#define HORIZMARGIN(m) (!((m)->site & 0x1)) /* Even sites are horizontal */
-
-typedef struct {
- int axis; /* Length of the axis. */
- int t1; /* Length of a major tick (in
- * pixels). */
- int t2; /* Length of a minor tick (in
- * pixels). */
- int label; /* Distance from axis to tick label. */
-} AxisInfo;
-
-typedef struct {
- const char *name;
- ClassId classId;
- int margin, invertMargin;
-} AxisName;
-
-static AxisName axisNames[] = {
- { "x", CID_AXIS_X, MARGIN_BOTTOM, MARGIN_LEFT },
- { "y", CID_AXIS_Y, MARGIN_LEFT, MARGIN_BOTTOM },
- { "x2", CID_AXIS_X, MARGIN_TOP, MARGIN_RIGHT },
- { "y2", CID_AXIS_Y, MARGIN_RIGHT, MARGIN_TOP }
-} ;
-static int nAxisNames = sizeof(axisNames) / sizeof(AxisName);
-
-static Blt_OptionParseProc ObjToLimitProc;
-static Blt_OptionPrintProc LimitToObjProc;
-static Blt_CustomOption limitOption = {
- ObjToLimitProc, LimitToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeTicksProc;
-static Blt_OptionParseProc ObjToTicksProc;
-static Blt_OptionPrintProc TicksToObjProc;
-static Blt_CustomOption majorTicksOption = {
- ObjToTicksProc, TicksToObjProc, FreeTicksProc, (ClientData)AXIS_AUTO_MAJOR,
-};
-static Blt_CustomOption minorTicksOption = {
- ObjToTicksProc, TicksToObjProc, FreeTicksProc, (ClientData)AXIS_AUTO_MINOR,
-};
-static Blt_OptionFreeProc FreeAxisProc;
-static Blt_OptionPrintProc AxisToObjProc;
-static Blt_OptionParseProc ObjToAxisProc;
-Blt_CustomOption bltXAxisOption = {
- ObjToAxisProc, AxisToObjProc, FreeAxisProc, (ClientData)CID_AXIS_X
-};
-Blt_CustomOption bltYAxisOption = {
- ObjToAxisProc, AxisToObjProc, FreeAxisProc, (ClientData)CID_AXIS_Y
-};
-
-static Blt_OptionFreeProc FreeFormatProc;
-static Blt_OptionParseProc ObjToFormatProc;
-static Blt_OptionPrintProc FormatToObjProc;
-static Blt_CustomOption formatOption = {
- ObjToFormatProc, FormatToObjProc, FreeFormatProc, (ClientData)0,
-};
-static Blt_OptionParseProc ObjToLooseProc;
-static Blt_OptionPrintProc LooseToObjProc;
-static Blt_CustomOption looseOption = {
- ObjToLooseProc, LooseToObjProc, NULL, (ClientData)0,
-};
-
-static Blt_OptionParseProc ObjToUseProc;
-static Blt_OptionPrintProc UseToObjProc;
-static Blt_CustomOption useOption = {
- ObjToUseProc, UseToObjProc, NULL, (ClientData)0
-};
-
-#define DEF_AXIS_ACTIVEBACKGROUND STD_ACTIVE_BACKGROUND
-#define DEF_AXIS_ACTIVEFOREGROUND STD_ACTIVE_FOREGROUND
-#define DEF_AXIS_ACTIVERELIEF "flat"
-#define DEF_AXIS_ANGLE "0.0"
-#define DEF_AXIS_BACKGROUND (char *)NULL
-#define DEF_AXIS_BORDERWIDTH "0"
-#define DEF_AXIS_CHECKLIMITS "0"
-#define DEF_AXIS_COMMAND (char *)NULL
-#define DEF_AXIS_DESCENDING "0"
-#define DEF_AXIS_FOREGROUND RGB_BLACK
-#define DEF_AXIS_GRID_BARCHART "1"
-#define DEF_AXIS_GRIDCOLOR RGB_GREY64
-#define DEF_AXIS_GRIDDASHES "dot"
-#define DEF_AXIS_GRID_GRAPH "0"
-#define DEF_AXIS_GRIDLINEWIDTH "0"
-#define DEF_AXIS_GRIDMINOR "1"
-#define DEF_AXIS_GRIDMINOR_COLOR RGB_GREY64
-#define DEF_AXIS_HIDE "0"
-#define DEF_AXIS_JUSTIFY "c"
-#define DEF_AXIS_LIMITS_FORMAT (char *)NULL
-#define DEF_AXIS_LINEWIDTH "1"
-#define DEF_AXIS_LOGSCALE "0"
-#define DEF_AXIS_LOOSE "0"
-#define DEF_AXIS_RANGE "0.0"
-#define DEF_AXIS_RELIEF "flat"
-#define DEF_AXIS_SCROLL_INCREMENT "10"
-#define DEF_AXIS_SHIFTBY "0.0"
-#define DEF_AXIS_SHOWTICKS "1"
-#define DEF_AXIS_STEP "0.0"
-#define DEF_AXIS_STEP "0.0"
-#define DEF_AXIS_SUBDIVISIONS "2"
-#define DEF_AXIS_TAGS "all"
-#define DEF_AXIS_EXTERIOR "1"
-#define DEF_AXIS_TICK_ANCHOR "c"
-#define DEF_AXIS_LIMITS_FONT STD_FONT_NUMBERS
-#define DEF_AXIS_TICKFONT_GRAPH STD_FONT_NUMBERS
-#define DEF_AXIS_TICKFONT_BARCHART STD_FONT_SMALL
-#define DEF_AXIS_TICKLENGTH "4"
-#define DEF_AXIS_DIVISIONS "10"
-#define DEF_AXIS_TITLE_ALTERNATE "0"
-#define DEF_AXIS_TITLE_FG RGB_BLACK
-#define DEF_AXIS_TITLE_FONT "{Sans Serif} 10"
-#define DEF_AXIS_X_STEP_BARCHART "1.0"
-#define DEF_AXIS_X_SUBDIVISIONS_BARCHART "0"
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_AXIS_ACTIVEBACKGROUND,
- Blt_Offset(Axis, activeBg), ALL_GRAPHS | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "ActiveForeground", DEF_AXIS_ACTIVEFOREGROUND,
- Blt_Offset(Axis, activeFgColor), ALL_GRAPHS},
- {BLT_CONFIG_RELIEF, "-activerelief", "activeRelief", "Relief",
- DEF_AXIS_ACTIVERELIEF, Blt_Offset(Axis, activeRelief),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_DOUBLE, "-autorange", "autoRange", "AutoRange",
- DEF_AXIS_RANGE, Blt_Offset(Axis, windowSize),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_AXIS_BACKGROUND, Blt_Offset(Axis, normalBg),
- ALL_GRAPHS | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_LIST, "-bindtags", "bindTags", "BindTags", DEF_AXIS_TAGS,
- Blt_Offset(Axis, obj.tags), ALL_GRAPHS | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL,
- 0, ALL_GRAPHS},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_AXIS_BORDERWIDTH, Blt_Offset(Axis, borderWidth),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-checklimits", "checkLimits", "CheckLimits",
- DEF_AXIS_CHECKLIMITS, Blt_Offset(Axis, flags),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)AXIS_CHECK_LIMITS},
- {BLT_CONFIG_COLOR, "-color", "color", "Color",
- DEF_AXIS_FOREGROUND, Blt_Offset(Axis, tickColor), ALL_GRAPHS},
- {BLT_CONFIG_STRING, "-command", "command", "Command",
- DEF_AXIS_COMMAND, Blt_Offset(Axis, formatCmd),
- BLT_CONFIG_NULL_OK | ALL_GRAPHS},
- {BLT_CONFIG_BOOLEAN, "-descending", "descending", "Descending",
- DEF_AXIS_DESCENDING, Blt_Offset(Axis, descending),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-exterior", "exterior", "exterior", DEF_AXIS_EXTERIOR,
- Blt_Offset(Axis, flags), ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)AXIS_EXTERIOR},
- {BLT_CONFIG_SYNONYM, "-fg", "color", (char *)NULL,
- (char *)NULL, 0, ALL_GRAPHS},
- {BLT_CONFIG_SYNONYM, "-foreground", "color", (char *)NULL,
- (char *)NULL, 0, ALL_GRAPHS},
- {BLT_CONFIG_BITMASK, "-grid", "grid", "Grid", DEF_AXIS_GRID_BARCHART,
- Blt_Offset(Axis, flags), BARCHART, (Blt_CustomOption *)AXIS_GRID},
- {BLT_CONFIG_BITMASK, "-grid", "grid", "Grid", DEF_AXIS_GRID_GRAPH,
- Blt_Offset(Axis, flags), GRAPH | STRIPCHART,
- (Blt_CustomOption *)AXIS_GRID},
- {BLT_CONFIG_COLOR, "-gridcolor", "gridColor", "GridColor",
- DEF_AXIS_GRIDCOLOR, Blt_Offset(Axis, major.color), ALL_GRAPHS},
- {BLT_CONFIG_DASHES, "-griddashes", "gridDashes", "GridDashes",
- DEF_AXIS_GRIDDASHES, Blt_Offset(Axis, major.dashes),
- BLT_CONFIG_NULL_OK | ALL_GRAPHS},
- {BLT_CONFIG_PIXELS_NNEG, "-gridlinewidth", "gridLineWidth",
- "GridLineWidth", DEF_AXIS_GRIDLINEWIDTH,
- Blt_Offset(Axis, major.lineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT | ALL_GRAPHS},
- {BLT_CONFIG_BITMASK, "-gridminor", "gridMinor", "GridMinor",
- DEF_AXIS_GRIDMINOR, Blt_Offset(Axis, flags),
- BLT_CONFIG_DONT_SET_DEFAULT | ALL_GRAPHS,
- (Blt_CustomOption *)AXIS_GRIDMINOR},
- {BLT_CONFIG_COLOR, "-gridminorcolor", "gridMinorColor", "GridColor",
- DEF_AXIS_GRIDMINOR_COLOR, Blt_Offset(Axis, minor.color), ALL_GRAPHS},
- {BLT_CONFIG_DASHES, "-gridminordashes", "gridMinorDashes", "GridDashes",
- DEF_AXIS_GRIDDASHES, Blt_Offset(Axis, minor.dashes),
- BLT_CONFIG_NULL_OK | ALL_GRAPHS},
- {BLT_CONFIG_PIXELS_NNEG, "-gridminorlinewidth", "gridMinorLineWidth",
- "GridLineWidth", DEF_AXIS_GRIDLINEWIDTH,
- Blt_Offset(Axis, minor.lineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT | ALL_GRAPHS},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_AXIS_HIDE,
- Blt_Offset(Axis, flags), ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE},
- {BLT_CONFIG_JUSTIFY, "-justify", "justify", "Justify",
- DEF_AXIS_JUSTIFY, Blt_Offset(Axis, titleJustify),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-labeloffset", "labelOffset", "LabelOffset",
- (char *)NULL, Blt_Offset(Axis, labelOffset), ALL_GRAPHS},
- {BLT_CONFIG_COLOR, "-limitscolor", "limitsColor", "Color",
- DEF_AXIS_FOREGROUND, Blt_Offset(Axis, limitsTextStyle.color),
- ALL_GRAPHS},
- {BLT_CONFIG_FONT, "-limitsfont", "limitsFont", "Font", DEF_AXIS_LIMITS_FONT,
- Blt_Offset(Axis, limitsTextStyle.font), ALL_GRAPHS},
- {BLT_CONFIG_CUSTOM, "-limitsformat", "limitsFormat", "LimitsFormat",
- (char *)NULL, Blt_Offset(Axis, limitsFormats),
- BLT_CONFIG_NULL_OK | ALL_GRAPHS, &formatOption},
- {BLT_CONFIG_PIXELS_NNEG, "-linewidth", "lineWidth", "LineWidth",
- DEF_AXIS_LINEWIDTH, Blt_Offset(Axis, lineWidth),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-logscale", "logScale", "LogScale",
- DEF_AXIS_LOGSCALE, Blt_Offset(Axis, logScale),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-loose", "loose", "Loose", DEF_AXIS_LOOSE, 0,
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT, &looseOption},
- {BLT_CONFIG_CUSTOM, "-majorticks", "majorTicks", "MajorTicks",
- (char *)NULL, Blt_Offset(Axis, t1Ptr),
- BLT_CONFIG_NULL_OK | ALL_GRAPHS, &majorTicksOption},
- {BLT_CONFIG_CUSTOM, "-max", "max", "Max", (char *)NULL,
- Blt_Offset(Axis, reqMax), ALL_GRAPHS, &limitOption},
- {BLT_CONFIG_CUSTOM, "-min", "min", "Min", (char *)NULL,
- Blt_Offset(Axis, reqMin), ALL_GRAPHS, &limitOption},
- {BLT_CONFIG_CUSTOM, "-minorticks", "minorTicks", "MinorTicks",
- (char *)NULL, Blt_Offset(Axis, t2Ptr),
- BLT_CONFIG_NULL_OK | ALL_GRAPHS, &minorTicksOption},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_AXIS_RELIEF, Blt_Offset(Axis, relief),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FLOAT, "-rotate", "rotate", "Rotate", DEF_AXIS_ANGLE,
- Blt_Offset(Axis, tickAngle), ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-scrollcommand", "scrollCommand", "ScrollCommand",
- (char *)NULL, Blt_Offset(Axis, scrollCmdObjPtr),
- ALL_GRAPHS | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_POS, "-scrollincrement", "scrollIncrement",
- "ScrollIncrement", DEF_AXIS_SCROLL_INCREMENT,
- Blt_Offset(Axis, scrollUnits), ALL_GRAPHS|BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-scrollmax", "scrollMax", "ScrollMax", (char *)NULL,
- Blt_Offset(Axis, reqScrollMax), ALL_GRAPHS, &limitOption},
- {BLT_CONFIG_CUSTOM, "-scrollmin", "scrollMin", "ScrollMin", (char *)NULL,
- Blt_Offset(Axis, reqScrollMin), ALL_GRAPHS, &limitOption},
- {BLT_CONFIG_DOUBLE, "-shiftby", "shiftBy", "ShiftBy",
- DEF_AXIS_SHIFTBY, Blt_Offset(Axis, shiftBy),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-showticks", "showTicks", "ShowTicks",
- DEF_AXIS_SHOWTICKS, Blt_Offset(Axis, flags),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)AXIS_SHOWTICKS},
- {BLT_CONFIG_DOUBLE, "-stepsize", "stepSize", "StepSize",
- DEF_AXIS_STEP, Blt_Offset(Axis, reqStep),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_INT, "-subdivisions", "subdivisions", "Subdivisions",
- DEF_AXIS_SUBDIVISIONS, Blt_Offset(Axis, reqNumMinorTicks), ALL_GRAPHS},
- {BLT_CONFIG_ANCHOR, "-tickanchor", "tickAnchor", "Anchor",
- DEF_AXIS_TICK_ANCHOR, Blt_Offset(Axis, reqTickAnchor), ALL_GRAPHS},
- {BLT_CONFIG_FONT, "-tickfont", "tickFont", "Font",
- DEF_AXIS_TICKFONT_GRAPH, Blt_Offset(Axis, tickFont),
- GRAPH | STRIPCHART},
- {BLT_CONFIG_FONT, "-tickfont", "tickFont", "Font",
- DEF_AXIS_TICKFONT_BARCHART, Blt_Offset(Axis, tickFont), BARCHART},
- {BLT_CONFIG_PIXELS_NNEG, "-ticklength", "tickLength", "TickLength",
- DEF_AXIS_TICKLENGTH, Blt_Offset(Axis, tickLength),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_INT, "-tickdefault", "tickDefault", "TickDefault",
- DEF_AXIS_DIVISIONS, Blt_Offset(Axis, reqNumMajorTicks),
- ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-title", "title", "Title",
- (char *)NULL, Blt_Offset(Axis, title),
- BLT_CONFIG_DONT_SET_DEFAULT | BLT_CONFIG_NULL_OK | ALL_GRAPHS},
- {BLT_CONFIG_BOOLEAN, "-titlealternate", "titleAlternate", "TitleAlternate",
- DEF_AXIS_TITLE_ALTERNATE, Blt_Offset(Axis, titleAlternate),
- BLT_CONFIG_DONT_SET_DEFAULT | ALL_GRAPHS},
- {BLT_CONFIG_COLOR, "-titlecolor", "titleColor", "Color",
- DEF_AXIS_FOREGROUND, Blt_Offset(Axis, titleColor),
- ALL_GRAPHS},
- {BLT_CONFIG_FONT, "-titlefont", "titleFont", "Font", DEF_AXIS_TITLE_FONT,
- Blt_Offset(Axis, titleFont), ALL_GRAPHS},
- {BLT_CONFIG_CUSTOM, "-use", "use", "Use", (char *)NULL, 0, ALL_GRAPHS,
- &useOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-/* Forward declarations */
-static void DestroyAxis(Axis *axisPtr);
-static Tcl_FreeProc FreeAxis;
-static int GetAxisByClass(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr,
- ClassId classId, Axis **axisPtrPtr);
-static void TimeScaleAxis(Axis *axisPtr, double min, double max);
-
-static int lastMargin;
-typedef int (GraphAxisProc)(Tcl_Interp *interp, Axis *axisPtr, int objc,
- Tcl_Obj *const *objv);
-typedef int (GraphVirtualAxisProc)(Tcl_Interp *interp, Graph *graphPtr,
- int objc, Tcl_Obj *const *objv);
-
-INLINE static double
-Clamp(double x)
-{
- return (x < 0.0) ? 0.0 : (x > 1.0) ? 1.0 : x;
-}
-
-INLINE static int
-Round(double x)
-{
- return (int) (x + ((x < 0.0) ? -0.5 : 0.5));
-}
-
-static void
-SetAxisRange(AxisRange *rangePtr, double min, double max)
-{
- rangePtr->min = min;
- rangePtr->max = max;
- rangePtr->range = max - min;
- if (FABS(rangePtr->range) < DBL_EPSILON) {
- rangePtr->range = 1.0;
- }
- rangePtr->scale = 1.0 / rangePtr->range;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InRange --
- *
- * Determines if a value lies within a given range.
- *
- * The value is normalized and compared against the interval [0..1],
- * where 0.0 is the minimum and 1.0 is the maximum. DBL_EPSILON is the
- * smallest number that can be represented on the host machine, such that
- * (1.0 + epsilon) != 1.0.
- *
- * Please note, *max* can't equal *min*.
- *
- * Results:
- * If the value is within the interval [min..max], 1 is returned; 0
- * otherwise.
- *
- *---------------------------------------------------------------------------
- */
-INLINE static int
-InRange(double x, AxisRange *rangePtr)
-{
- if (rangePtr->range < DBL_EPSILON) {
- return (FABS(rangePtr->max - x) >= DBL_EPSILON);
- } else {
- double norm;
-
- norm = (x - rangePtr->min) * rangePtr->scale;
- return ((norm >= -DBL_EPSILON) && ((norm - 1.0) < DBL_EPSILON));
- }
-}
-
-INLINE static int
-AxisIsHorizontal(Axis *axisPtr)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
-
- return ((axisPtr->obj.classId == CID_AXIS_Y) == graphPtr->inverted);
-}
-
-
-static void
-ReleaseAxis(Axis *axisPtr)
-{
- if (axisPtr != NULL) {
- axisPtr->refCount--;
- assert(axisPtr->refCount >= 0);
- if (axisPtr->refCount == 0) {
- axisPtr->flags |= DELETE_PENDING;
- Tcl_EventuallyFree(axisPtr, FreeAxis);
- }
- }
-}
-
-/*
- *-----------------------------------------------------------------------------
- * Custom option parse and print procedures
- *-----------------------------------------------------------------------------
- */
-
-/*ARGSUSED*/
-static void
-FreeAxisProc(
- ClientData clientData, /* Not used. */
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Axis **axisPtrPtr = (Axis **)(widgRec + offset);
-
- if (*axisPtrPtr != NULL) {
- ReleaseAxis(*axisPtrPtr);
- *axisPtrPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToAxisProc --
- *
- * Converts the name of an axis to a pointer to its axis structure.
- *
- * Results:
- * The return value is a standard TCL result. The axis flags are written
- * into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToAxisProc(
- ClientData clientData, /* Class identifier of the type of
- * axis we are looking for. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window tkwin, /* Used to look up pointer to graph. */
- Tcl_Obj *objPtr, /* String representing new value. */
- char *widgRec, /* Pointer to structure record. */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ClassId classId = (ClassId)clientData;
- Axis **axisPtrPtr = (Axis **)(widgRec + offset);
- Axis *axisPtr;
- Graph *graphPtr;
-
- if (flags & BLT_CONFIG_NULL_OK) {
- const char *string;
-
- string = Tcl_GetString(objPtr);
- if (string[0] == '\0') {
- ReleaseAxis(*axisPtrPtr);
- *axisPtrPtr = NULL;
- return TCL_OK;
- }
- }
- graphPtr = Blt_GetGraphFromWindowData(tkwin);
- assert(graphPtr);
- if (GetAxisByClass(interp, graphPtr, objPtr, classId, &axisPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- ReleaseAxis(*axisPtrPtr);
- *axisPtrPtr = axisPtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisToObjProc --
- *
- * Convert the window coordinates into a string.
- *
- * Results:
- * The string representing the coordinate position is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-AxisToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Pointer to structure record .*/
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Axis *axisPtr = *(Axis **)(widgRec + offset);
- const char *name;
-
- name = (axisPtr == NULL) ? "" : axisPtr->obj.name;
- return Tcl_NewStringObj(name, -1);
-}
-
-/*ARGSUSED*/
-static void
-FreeFormatProc(
- ClientData clientData, /* Not used. */
- Display *display, /* Not used. */
- char *widgRec,
- int offset) /* Not used. */
-{
- Axis *axisPtr = (Axis *)(widgRec);
-
- if (axisPtr->limitsFormats != NULL) {
- Blt_Free(axisPtr->limitsFormats);
- axisPtr->limitsFormats = NULL;
- }
- axisPtr->nFormats = 0;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToFormatProc --
- *
- * Convert the name of virtual axis to an pointer.
- *
- * Results:
- * The return value is a standard TCL result. The axis flags are written
- * into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToFormatProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing new value. */
- char *widgRec, /* Pointer to structure record. */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- Axis *axisPtr = (Axis *)(widgRec);
- const char **argv;
- int argc;
-
- if (Tcl_SplitList(interp, Tcl_GetString(objPtr), &argc, &argv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (argc > 2) {
- Tcl_AppendResult(interp, "too many elements in limits format list \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- Blt_Free(argv);
- return TCL_ERROR;
- }
- if (axisPtr->limitsFormats != NULL) {
- Blt_Free(axisPtr->limitsFormats);
- }
- axisPtr->limitsFormats = argv;
- axisPtr->nFormats = argc;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FormatToObjProc --
- *
- * Convert the window coordinates into a string.
- *
- * Results:
- * The string representing the coordinate position is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-FormatToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- Axis *axisPtr = (Axis *)(widgRec);
- Tcl_Obj *objPtr;
-
- if (axisPtr->nFormats == 0) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- const char *string;
-
- string = Tcl_Merge(axisPtr->nFormats, axisPtr->limitsFormats);
- objPtr = Tcl_NewStringObj(string, -1);
- Blt_Free(string);
- }
- return objPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToLimitProc --
- *
- * Convert the string representation of an axis limit into its numeric
- * form.
- *
- * Results:
- * The return value is a standard TCL result. The symbol type is written
- * into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToLimitProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing new value. */
- char *widgRec, /* Pointer to structure record. */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- double *limitPtr = (double *)(widgRec + offset);
- const char *string;
-
- string = Tcl_GetString(objPtr);
- if (string[0] == '\0') {
- *limitPtr = Blt_NaN();
- } else if (Blt_ExprDoubleFromObj(interp, objPtr, limitPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LimitToObjProc --
- *
- * Convert the floating point axis limits into a string.
- *
- * Results:
- * The string representation of the limits is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-LimitToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- double limit = *(double *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (DEFINED(limit)) {
- objPtr = Tcl_NewDoubleObj(limit);
- } else {
- objPtr = Tcl_NewStringObj("", -1);
- }
- return objPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToUseProc --
- *
- * Convert the string representation of the margin to use into its
- * numeric form.
- *
- * Results:
- * The return value is a standard TCL result. The use type is written
- * into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToUseProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing new value. */
- char *widgRec, /* Pointer to structure record. */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Axis *axisPtr = (Axis *)(widgRec);
- AxisName *p, *pend;
- Blt_Chain chain;
- Graph *graphPtr;
- const char *string;
- int margin;
-
- graphPtr = axisPtr->obj.graphPtr;
- if (axisPtr->refCount == 0) {
- /* Clear the axis class if it's not currently used by an element.*/
- Blt_GraphSetObjectClass(&axisPtr->obj, CID_NONE);
- }
- /* Remove the axis from the margin's use list and clear its use flag. */
- if (axisPtr->link != NULL) {
- Blt_Chain_UnlinkLink(axisPtr->chain, axisPtr->link);
- }
- axisPtr->flags &= ~AXIS_USE;
- string = Tcl_GetString(objPtr);
- if ((string == NULL) || (string[0] == '\0')) {
- goto done;
- }
- for (p = axisNames, pend = axisNames + nAxisNames; p < pend; p++) {
- if (strcmp(p->name, string) == 0) {
- break; /* Found the axis name. */
- }
- }
- if (p == pend) {
- Tcl_AppendResult(interp, "unknown axis type \"", string, "\": "
- "should be x, y, x1, y2, or \"\".", (char *)NULL);
- return TCL_ERROR;
- }
- /* Check the axis class. Can't use the axis if it's already being used as
- * another type. */
- if (axisPtr->obj.classId == CID_NONE) {
- Blt_GraphSetObjectClass(&axisPtr->obj, p->classId);
- } else if (axisPtr->obj.classId != p->classId) {
- Tcl_AppendResult(interp, "wrong type for axis \"",
- axisPtr->obj.name, "\": can't use ",
- axisPtr->obj.className, " type axis.", (char *)NULL);
- return TCL_ERROR;
- }
- margin = (graphPtr->inverted) ? p->invertMargin : p->margin;
- chain = graphPtr->margins[margin].axes;
- if (axisPtr->link != NULL) {
- /* Move the axis from the old margin's "use" list to the new. */
- Blt_Chain_AppendLink(chain, axisPtr->link);
- } else {
- axisPtr->link = Blt_Chain_Append(chain, axisPtr);
- }
- axisPtr->chain = chain;
- axisPtr->flags |= AXIS_USE;
- axisPtr->margin = margin;
- done:
- graphPtr->flags |= (GET_AXIS_GEOMETRY | LAYOUT_NEEDED | RESET_AXES);
- /* When any axis changes, we need to layout the entire graph. */
- graphPtr->flags |= (MAP_WORLD | REDRAW_WORLD);
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UseToObjProc --
- *
- * Convert the floating point axis limits into a string.
- *
- * Results:
- * The string representation of the limits is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-UseToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Axis *axisPtr = (Axis *)(widgRec);
-
- if (axisPtr->margin == MARGIN_NONE) {
- return Tcl_NewStringObj("", -1);
- }
- return Tcl_NewStringObj(axisNames[axisPtr->margin].name, -1);
-}
-
-/*ARGSUSED*/
-static void
-FreeTicksProc(
- ClientData clientData, /* Either AXIS_AUTO_MAJOR or
- * AXIS_AUTO_MINOR. */
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Axis *axisPtr = (Axis *)widgRec;
- Ticks **ticksPtrPtr = (Ticks **) (widgRec + offset);
- unsigned long mask = (unsigned long)clientData;
-
- axisPtr->flags |= mask;
- if (*ticksPtrPtr != NULL) {
- Blt_Free(*ticksPtrPtr);
- }
- *ticksPtrPtr = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToTicksProc --
- *
- *
- * Results:
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTicksProc(
- ClientData clientData, /* Either AXIS_AUTO_MAJOR or
- * AXIS_AUTO_MINOR. */
- Tcl_Interp *interp, /* Interpreter to send results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing new value. */
- char *widgRec, /* Pointer to structure record. */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Axis *axisPtr = (Axis *)widgRec;
- Tcl_Obj **objv;
- Ticks **ticksPtrPtr = (Ticks **) (widgRec + offset);
- Ticks *ticksPtr;
- int objc;
- unsigned long mask = (unsigned long)clientData;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- axisPtr->flags |= mask;
- ticksPtr = NULL;
- if (objc > 0) {
- int i;
-
- ticksPtr = Blt_AssertMalloc(sizeof(Ticks) + (objc*sizeof(double)));
- for (i = 0; i < objc; i++) {
- double value;
-
- if (Blt_ExprDoubleFromObj(interp, objv[i], &value) != TCL_OK) {
- Blt_Free(ticksPtr);
- return TCL_ERROR;
- }
- ticksPtr->values[i] = value;
- }
- ticksPtr->nTicks = objc;
- axisPtr->flags &= ~mask;
- }
- FreeTicksProc(clientData, Tk_Display(tkwin), widgRec, offset);
- *ticksPtrPtr = ticksPtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TicksToObjProc --
- *
- * Convert array of tick coordinates to a list.
- *
- * Results:
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TicksToObjProc(
- ClientData clientData, /* Either AXIS_AUTO_MAJOR or
- * AXIS_AUTO_MINOR. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Axis *axisPtr;
- Tcl_Obj *listObjPtr;
- Ticks *ticksPtr;
- unsigned long mask;
-
- axisPtr = (Axis *)widgRec;
- ticksPtr = *(Ticks **) (widgRec + offset);
- mask = (unsigned long)clientData;
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if ((ticksPtr != NULL) && ((axisPtr->flags & mask) == 0)) {
- unsigned int i;
-
- for (i = 0; i < ticksPtr->nTicks; i++) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewDoubleObj(ticksPtr->values[i]);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- return listObjPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToLooseProc --
- *
- * Convert a string to one of three values.
- * 0 - false, no, off
- * 1 - true, yes, on
- * 2 - always
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToLooseProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing new value. */
- char *widgRec, /* Pointer to structure record. */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- Axis *axisPtr = (Axis *)(widgRec);
- Tcl_Obj **objv;
- int i;
- int objc;
- int values[2];
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((objc < 1) || (objc > 2)) {
- Tcl_AppendResult(interp, "wrong # elements in loose value \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- for (i = 0; i < objc; i++) {
- const char *string;
-
- string = Tcl_GetString(objv[i]);
- if ((string[0] == 'a') && (strcmp(string, "always") == 0)) {
- values[i] = AXIS_ALWAYS_LOOSE;
- } else {
- int bool;
-
- if (Tcl_GetBooleanFromObj(interp, objv[i], &bool) != TCL_OK) {
- return TCL_ERROR;
- }
- values[i] = bool;
- }
- }
- axisPtr->looseMin = axisPtr->looseMax = values[0];
- if (objc > 1) {
- axisPtr->looseMax = values[1];
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LooseToObjProc --
- *
- * Results:
- * The string representation of the auto boolean is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-LooseToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- Axis *axisPtr = (Axis *)widgRec;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (axisPtr->looseMin == AXIS_TIGHT) {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewBooleanObj(FALSE));
- } else if (axisPtr->looseMin == AXIS_LOOSE) {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewBooleanObj(TRUE));
- } else if (axisPtr->looseMin == AXIS_ALWAYS_LOOSE) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("always", 6));
- }
- if (axisPtr->looseMin != axisPtr->looseMax) {
- if (axisPtr->looseMax == AXIS_TIGHT) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewBooleanObj(FALSE));
- } else if (axisPtr->looseMax == AXIS_LOOSE) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewBooleanObj(TRUE));
- } else if (axisPtr->looseMax == AXIS_ALWAYS_LOOSE) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("always", 6));
- }
- }
- return listObjPtr;
-}
-
-static void
-FreeTickLabels(Blt_Chain chain)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TickLabel *labelPtr;
-
- labelPtr = Blt_Chain_GetValue(link);
- Blt_Free(labelPtr);
- }
- Blt_Chain_Reset(chain);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MakeLabel --
- *
- * Converts a floating point tick value to a string to be used as its
- * label.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Returns a new label in the string character buffer. The formatted
- * tick label will be displayed on the graph.
- *
- * --------------------------------------------------------------------------
- */
-static TickLabel *
-MakeLabel(Axis *axisPtr, double value)
-{
-#define TICK_LABEL_SIZE 200
- char string[TICK_LABEL_SIZE + 1];
- TickLabel *labelPtr;
-
- /* Generate a default tick label based upon the tick value. */
- if (axisPtr->logScale) {
- sprintf_s(string, TICK_LABEL_SIZE, "1E%d", ROUND(value));
- } else {
- sprintf_s(string, TICK_LABEL_SIZE, "%.*G", NUMDIGITS, value);
- }
-
- if (axisPtr->formatCmd != NULL) {
- Graph *graphPtr;
- Tcl_Interp *interp;
- Tk_Window tkwin;
-
- graphPtr = axisPtr->obj.graphPtr;
- interp = graphPtr->interp;
- tkwin = graphPtr->tkwin;
- /*
- * A TCL proc was designated to format tick labels. Append the path
- * name of the widget and the default tick label as arguments when
- * invoking it. Copy and save the new label from interp->result.
- */
- Tcl_ResetResult(interp);
- if (Tcl_VarEval(interp, axisPtr->formatCmd, " ", Tk_PathName(tkwin),
- " ", string, (char *)NULL) != TCL_OK) {
- Tcl_BackgroundError(interp);
- } else {
- /*
- * The proc could return a string of any length, so arbitrarily
- * limit it to what will fit in the return string.
- */
- strncpy(string, Tcl_GetStringResult(interp), TICK_LABEL_SIZE);
- string[TICK_LABEL_SIZE] = '\0';
-
- Tcl_ResetResult(interp); /* Clear the interpreter's result. */
- }
- }
- labelPtr = Blt_AssertMalloc(sizeof(TickLabel) + strlen(string));
- strcpy(labelPtr->string, string);
- labelPtr->anchorPos.x = labelPtr->anchorPos.y = DBL_MAX;
- return labelPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_InvHMap --
- *
- * Maps the given screen coordinate back to a graph coordinate. Called
- * by the graph locater routine.
- *
- * Results:
- * Returns the graph coordinate value at the given window
- * y-coordinate.
- *
- *---------------------------------------------------------------------------
- */
-double
-Blt_InvHMap(Axis *axisPtr, double x)
-{
- double value;
-
- x = (double)(x - axisPtr->screenMin) * axisPtr->screenScale;
- if (axisPtr->descending) {
- x = 1.0 - x;
- }
- value = (x * axisPtr->axisRange.range) + axisPtr->axisRange.min;
- if (axisPtr->logScale) {
- value = EXP10(value);
- }
- return value;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_InvVMap --
- *
- * Maps the given screen y-coordinate back to the graph coordinate
- * value. Called by the graph locater routine.
- *
- * Results:
- * Returns the graph coordinate value for the given screen
- * coordinate.
- *
- *---------------------------------------------------------------------------
- */
-double
-Blt_InvVMap(Axis *axisPtr, double y) /* Screen coordinate */
-{
- double value;
-
- y = (double)(y - axisPtr->screenMin) * axisPtr->screenScale;
- if (axisPtr->descending) {
- y = 1.0 - y;
- }
- value = ((1.0 - y) * axisPtr->axisRange.range) + axisPtr->axisRange.min;
- if (axisPtr->logScale) {
- value = EXP10(value);
- }
- return value;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_HMap --
- *
- * Map the given graph coordinate value to its axis, returning a window
- * position.
- *
- * Results:
- * Returns a double precision number representing the window coordinate
- * position on the given axis.
- *
- *---------------------------------------------------------------------------
- */
-double
-Blt_HMap(Axis *axisPtr, double x)
-{
- if ((axisPtr->logScale) && (x != 0.0)) {
- x = log10(FABS(x));
- }
- /* Map graph coordinate to normalized coordinates [0..1] */
- x = (x - axisPtr->axisRange.min) * axisPtr->axisRange.scale;
- if (axisPtr->descending) {
- x = 1.0 - x;
- }
- return (x * axisPtr->screenRange + axisPtr->screenMin);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_VMap --
- *
- * Map the given graph coordinate value to its axis, returning a window
- * position.
- *
- * Results:
- * Returns a double precision number representing the window coordinate
- * position on the given axis.
- *
- *---------------------------------------------------------------------------
- */
-double
-Blt_VMap(Axis *axisPtr, double y)
-{
- if ((axisPtr->logScale) && (y != 0.0)) {
- y = log10(FABS(y));
- }
- /* Map graph coordinate to normalized coordinates [0..1] */
- y = (y - axisPtr->axisRange.min) * axisPtr->axisRange.scale;
- if (axisPtr->descending) {
- y = 1.0 - y;
- }
- return ((1.0 - y) * axisPtr->screenRange + axisPtr->screenMin);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Map2D --
- *
- * Maps the given graph x,y coordinate values to a window position.
- *
- * Results:
- * Returns a XPoint structure containing the window coordinates of
- * the given graph x,y coordinate.
- *
- *---------------------------------------------------------------------------
- */
-Point2d
-Blt_Map2D(
- Graph *graphPtr,
- double x, double y, /* Graph x and y coordinates */
- Axis2d *axesPtr) /* Specifies which axes to use */
-{
- Point2d point;
-
- if (graphPtr->inverted) {
- point.x = Blt_HMap(axesPtr->y, y);
- point.y = Blt_VMap(axesPtr->x, x);
- } else {
- point.x = Blt_HMap(axesPtr->x, x);
- point.y = Blt_VMap(axesPtr->y, y);
- }
- return point;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_InvMap2D --
- *
- * Maps the given window x,y coordinates to graph values.
- *
- * Results:
- * Returns a structure containing the graph coordinates of the given
- * window x,y coordinate.
- *
- *---------------------------------------------------------------------------
- */
-Point2d
-Blt_InvMap2D(
- Graph *graphPtr,
- double x, double y, /* Window x and y coordinates */
- Axis2d *axesPtr) /* Specifies which axes to use */
-{
- Point2d point;
-
- if (graphPtr->inverted) {
- point.x = Blt_InvVMap(axesPtr->x, y);
- point.y = Blt_InvHMap(axesPtr->y, x);
- } else {
- point.x = Blt_InvHMap(axesPtr->x, x);
- point.y = Blt_InvVMap(axesPtr->y, y);
- }
- return point;
-}
-
-
-static void
-GetDataLimits(Axis *axisPtr, double min, double max)
-{
- if (axisPtr->valueRange.min > min) {
- axisPtr->valueRange.min = min;
- }
- if (axisPtr->valueRange.max < max) {
- axisPtr->valueRange.max = max;
- }
-}
-
-static void
-FixAxisRange(Axis *axisPtr)
-{
- double min, max;
-
- /*
- * When auto-scaling, the axis limits are the bounds of the element data.
- * If no data exists, set arbitrary limits (wrt to log/linear scale).
- */
- min = axisPtr->valueRange.min;
- max = axisPtr->valueRange.max;
-
- /* Check the requested axis limits. Can't allow -min to be greater
- * than -max, or have undefined log scale limits. */
- if (((DEFINED(axisPtr->reqMin)) && (DEFINED(axisPtr->reqMax))) &&
- (axisPtr->reqMin >= axisPtr->reqMax)) {
- axisPtr->reqMin = axisPtr->reqMax = Blt_NaN();
- }
- if (axisPtr->logScale) {
- if ((DEFINED(axisPtr->reqMin)) && (axisPtr->reqMin <= 0.0)) {
- axisPtr->reqMin = Blt_NaN();
- }
- if ((DEFINED(axisPtr->reqMax)) && (axisPtr->reqMax <= 0.0)) {
- axisPtr->reqMax = Blt_NaN();
- }
- }
-
- if (min == DBL_MAX) {
- if (DEFINED(axisPtr->reqMin)) {
- min = axisPtr->reqMin;
- } else {
- min = (axisPtr->logScale) ? 0.001 : 0.0;
- }
- }
- if (max == -DBL_MAX) {
- if (DEFINED(axisPtr->reqMax)) {
- max = axisPtr->reqMax;
- } else {
- max = 1.0;
- }
- }
- if (min >= max) {
- /*
- * There is no range of data (i.e. min is not less than max), so
- * manufacture one.
- */
- if (min == 0.0) {
- min = 0.0, max = 1.0;
- } else {
- max = min + (FABS(min) * 0.1);
- }
- }
- SetAxisRange(&axisPtr->valueRange, min, max);
-
- /*
- * The axis limits are either the current data range or overridden by the
- * values selected by the user with the -min or -max options.
- */
- axisPtr->min = min;
- axisPtr->max = max;
- if (DEFINED(axisPtr->reqMin)) {
- axisPtr->min = axisPtr->reqMin;
- }
- if (DEFINED(axisPtr->reqMax)) {
- axisPtr->max = axisPtr->reqMax;
- }
- if (axisPtr->max < axisPtr->min) {
- /*
- * If the limits still don't make sense, it's because one limit
- * configuration option (-min or -max) was set and the other default
- * (based upon the data) is too small or large. Remedy this by making
- * up a new min or max from the user-defined limit.
- */
- if (!DEFINED(axisPtr->reqMin)) {
- axisPtr->min = axisPtr->max - (FABS(axisPtr->max) * 0.1);
- }
- if (!DEFINED(axisPtr->reqMax)) {
- axisPtr->max = axisPtr->min + (FABS(axisPtr->max) * 0.1);
- }
- }
- /*
- * If a window size is defined, handle auto ranging by shifting the axis
- * limits.
- */
- if ((axisPtr->windowSize > 0.0) &&
- (!DEFINED(axisPtr->reqMin)) && (!DEFINED(axisPtr->reqMax))) {
- if (axisPtr->shiftBy < 0.0) {
- axisPtr->shiftBy = 0.0;
- }
- max = axisPtr->min + axisPtr->windowSize;
- if (axisPtr->max >= max) {
- if (axisPtr->shiftBy > 0.0) {
- max = UCEIL(axisPtr->max, axisPtr->shiftBy);
- }
- axisPtr->min = max - axisPtr->windowSize;
- }
- axisPtr->max = max;
- }
- if ((axisPtr->max != axisPtr->prevMax) ||
- (axisPtr->min != axisPtr->prevMin)) {
- /* Indicate if the axis limits have changed */
- axisPtr->flags |= DIRTY;
- /* and save the previous minimum and maximum values */
- axisPtr->prevMin = axisPtr->min;
- axisPtr->prevMax = axisPtr->max;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NiceNum --
- *
- * Reference: Paul Heckbert, "Nice Numbers for Graph Labels",
- * Graphics Gems, pp 61-63.
- *
- * Finds a "nice" number approximately equal to x.
- *
- *---------------------------------------------------------------------------
- */
-static double
-NiceNum(double x, int round) /* If non-zero, round. Otherwise take
- * ceiling of value. */
-{
- double expt; /* Exponent of x */
- double frac; /* Fractional part of x */
- double nice; /* Nice, rounded fraction */
-
- expt = floor(log10(x));
- frac = x / EXP10(expt); /* between 1 and 10 */
- if (round) {
- if (frac < 1.5) {
- nice = 1.0;
- } else if (frac < 3.0) {
- nice = 2.0;
- } else if (frac < 7.0) {
- nice = 5.0;
- } else {
- nice = 10.0;
- }
- } else {
- if (frac <= 1.0) {
- nice = 1.0;
- } else if (frac <= 2.0) {
- nice = 2.0;
- } else if (frac <= 5.0) {
- nice = 5.0;
- } else {
- nice = 10.0;
- }
- }
- return nice * EXP10(expt);
-}
-
-static Ticks *
-GenerateTicks(TickSweep *sweepPtr)
-{
- Ticks *ticksPtr;
-
- ticksPtr = Blt_AssertMalloc(sizeof(Ticks) +
- (sweepPtr->nSteps * sizeof(double)));
- ticksPtr->nTicks = 0;
-
- if (sweepPtr->step == 0.0) {
- /* Hack: A zero step indicates to use log values. */
- int i;
- /* Precomputed log10 values [1..10] */
- static double logTable[] = {
- 0.0,
- 0.301029995663981,
- 0.477121254719662,
- 0.602059991327962,
- 0.698970004336019,
- 0.778151250383644,
- 0.845098040014257,
- 0.903089986991944,
- 0.954242509439325,
- 1.0
- };
- for (i = 0; i < sweepPtr->nSteps; i++) {
- ticksPtr->values[i] = logTable[i];
- }
- } else {
- double value;
- int i;
-
- value = sweepPtr->initial; /* Start from smallest axis tick */
- for (i = 0; i < sweepPtr->nSteps; i++) {
- value = UROUND(value, sweepPtr->step);
- ticksPtr->values[i] = value;
- value += sweepPtr->step;
- }
- }
- ticksPtr->nTicks = sweepPtr->nSteps;
- return ticksPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LogScaleAxis --
- *
- * Determine the range and units of a log scaled axis.
- *
- * Unless the axis limits are specified, the axis is scaled
- * automatically, where the smallest and largest major ticks encompass
- * the range of actual data values. When an axis limit is specified,
- * that value represents the smallest(min)/largest(max) value in the
- * displayed range of values.
- *
- * Both manual and automatic scaling are affected by the step used. By
- * default, the step is the largest power of ten to divide the range in
- * more than one piece.
- *
- * Automatic scaling:
- * Find the smallest number of units which contain the range of values.
- * The minimum and maximum major tick values will be represent the
- * range of values for the axis. This greatest number of major ticks
- * possible is 10.
- *
- * Manual scaling:
- * Make the minimum and maximum data values the represent the range of
- * the values for the axis. The minimum and maximum major ticks will be
- * inclusive of this range. This provides the largest area for plotting
- * and the expected results when the axis min and max values have be set
- * by the user (.e.g zooming). The maximum number of major ticks is 20.
- *
- * For log scale, there's the possibility that the minimum and
- * maximum data values are the same magnitude. To represent the
- * points properly, at least one full decade should be shown.
- * However, if you zoom a log scale plot, the results should be
- * predictable. Therefore, in that case, show only minor ticks.
- * Lastly, there should be an appropriate way to handle numbers
- * <=0.
- *
- * maxY
- * | units = magnitude (of least significant digit)
- * | high = largest unit tick < max axis value
- * high _| low = smallest unit tick > min axis value
- * |
- * | range = high - low
- * | # ticks = greatest factor of range/units
- * _|
- * U |
- * n |
- * i |
- * t _|
- * |
- * |
- * |
- * low _|
- * |
- * |_minX________________maxX__
- * | | | | |
- * minY low high
- * minY
- *
- *
- * numTicks = Number of ticks
- * min = Minimum value of axis
- * max = Maximum value of axis
- * range = Range of values (max - min)
- *
- * If the number of decades is greater than ten, it is assumed
- * that the full set of log-style ticks can't be drawn properly.
- *
- * Results:
- * None
- *
- * -------------------------------------------------------------------------- */
-static void
-LogScaleAxis(Axis *axisPtr, double min, double max)
-{
- double range;
- double tickMin, tickMax;
- double majorStep, minorStep;
- int nMajor, nMinor;
-
- nMajor = nMinor = 0;
- /* Suppress compiler warnings. */
- majorStep = minorStep = 0.0;
- tickMin = tickMax = Blt_NaN();
- if (min < max) {
- min = (min != 0.0) ? log10(FABS(min)) : 0.0;
- max = (max != 0.0) ? log10(FABS(max)) : 1.0;
-
- tickMin = floor(min);
- tickMax = ceil(max);
- range = tickMax - tickMin;
-
- if (range > 10) {
- /* There are too many decades to display a major tick at every
- * decade. Instead, treat the axis as a linear scale. */
- range = NiceNum(range, 0);
- majorStep = NiceNum(range / axisPtr->reqNumMajorTicks, 1);
- tickMin = UFLOOR(tickMin, majorStep);
- tickMax = UCEIL(tickMax, majorStep);
- nMajor = (int)((tickMax - tickMin) / majorStep) + 1;
- minorStep = EXP10(floor(log10(majorStep)));
- if (minorStep == majorStep) {
- nMinor = 4, minorStep = 0.2;
- } else {
- nMinor = Round(majorStep / minorStep) - 1;
- }
- } else {
- if (tickMin == tickMax) {
- tickMax++;
- }
- majorStep = 1.0;
- nMajor = (int)(tickMax - tickMin + 1); /* FIXME: Check this. */
-
- minorStep = 0.0; /* This is a special hack to pass
- * information to the GenerateTicks
- * routine. An interval of 0.0 tells 1)
- * this is a minor sweep and 2) the axis
- * is log scale. */
- nMinor = 10;
- }
- if ((axisPtr->looseMin == AXIS_TIGHT) ||
- ((axisPtr->looseMin == AXIS_LOOSE) &&
- (DEFINED(axisPtr->reqMin)))) {
- tickMin = min;
- nMajor++;
- }
- if ((axisPtr->looseMax == AXIS_TIGHT) ||
- ((axisPtr->looseMax == AXIS_LOOSE) &&
- (DEFINED(axisPtr->reqMax)))) {
- tickMax = max;
- }
- }
- axisPtr->majorSweep.step = majorStep;
- axisPtr->majorSweep.initial = floor(tickMin);
- axisPtr->majorSweep.nSteps = nMajor;
- axisPtr->minorSweep.initial = axisPtr->minorSweep.step = minorStep;
- axisPtr->minorSweep.nSteps = nMinor;
-
- SetAxisRange(&axisPtr->axisRange, tickMin, tickMax);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LinearScaleAxis --
- *
- * Determine the units of a linear scaled axis.
- *
- * The axis limits are either the range of the data values mapped
- * to the axis (autoscaled), or the values specified by the -min
- * and -max options (manual).
- *
- * If autoscaled, the smallest and largest major ticks will
- * encompass the range of data values. If the -loose option is
- * selected, the next outer ticks are choosen. If tight, the
- * ticks are at or inside of the data limits are used.
- *
- * If manually set, the ticks are at or inside the data limits
- * are used. This makes sense for zooming. You want the
- * selected range to represent the next limit, not something a
- * bit bigger.
- *
- * Note: I added an "always" value to the -loose option to force
- * the manually selected axes to be loose. It's probably
- * not a good idea.
- *
- * maxY
- * | units = magnitude (of least significant digit)
- * | high = largest unit tick < max axis value
- * high _| low = smallest unit tick > min axis value
- * |
- * | range = high - low
- * | # ticks = greatest factor of range/units
- * _|
- * U |
- * n |
- * i |
- * t _|
- * |
- * |
- * |
- * low _|
- * |
- * |_minX________________maxX__
- * | | | | |
- * minY low high
- * minY
- *
- * numTicks = Number of ticks
- * min = Minimum value of axis
- * max = Maximum value of axis
- * range = Range of values (max - min)
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The axis tick information is set. The actual tick values will
- * be generated later.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LinearScaleAxis(Axis *axisPtr, double min, double max)
-{
- double step;
- double tickMin, tickMax;
- double axisMin, axisMax;
- unsigned int nTicks;
-
- nTicks = 0;
- step = 1.0;
- /* Suppress compiler warning. */
- axisMin = axisMax = tickMin = tickMax = Blt_NaN();
- if (min < max) {
- double range;
-
- range = max - min;
- /* Calculate the major tick stepping. */
- if (axisPtr->reqStep > 0.0) {
- /* An interval was designated by the user. Keep scaling it until
- * it fits comfortably within the current range of the axis. */
- step = axisPtr->reqStep;
- while ((2 * step) >= range) {
- step *= 0.5;
- }
- } else {
- range = NiceNum(range, 0);
- step = NiceNum(range / axisPtr->reqNumMajorTicks, 1);
- }
-
- /* Find the outer tick values. Add 0.0 to prevent getting -0.0. */
- axisMin = tickMin = floor(min / step) * step + 0.0;
- axisMax = tickMax = ceil(max / step) * step + 0.0;
-
- nTicks = Round((tickMax - tickMin) / step) + 1;
- }
- axisPtr->majorSweep.step = step;
- axisPtr->majorSweep.initial = tickMin;
- axisPtr->majorSweep.nSteps = nTicks;
-
- /*
- * The limits of the axis are either the range of the data ("tight") or at
- * the next outer tick interval ("loose"). The looseness or tightness has
- * to do with how the axis fits the range of data values. This option is
- * overridden when the user sets an axis limit (by either -min or -max
- * option). The axis limit is always at the selected limit (otherwise we
- * assume that user would have picked a different number).
- */
- if ((axisPtr->looseMin == AXIS_TIGHT) ||
- ((axisPtr->looseMin == AXIS_LOOSE) &&
- (DEFINED(axisPtr->reqMin)))) {
- axisMin = min;
- }
- if ((axisPtr->looseMax == AXIS_TIGHT) ||
- ((axisPtr->looseMax == AXIS_LOOSE) &&
- (DEFINED(axisPtr->reqMax)))) {
- axisMax = max;
- }
- SetAxisRange(&axisPtr->axisRange, axisMin, axisMax);
-
- /* Now calculate the minor tick step and number. */
-
- if ((axisPtr->reqNumMinorTicks > 0) && (axisPtr->flags & AXIS_AUTO_MAJOR)) {
- nTicks = axisPtr->reqNumMinorTicks - 1;
- step = 1.0 / (nTicks + 1);
- } else {
- nTicks = 0; /* No minor ticks. */
- step = 0.5; /* Don't set the minor tick interval to
- * 0.0. It makes the GenerateTicks
- * routine * create minor log-scale tick
- * marks. */
- }
- axisPtr->minorSweep.initial = axisPtr->minorSweep.step = step;
- axisPtr->minorSweep.nSteps = nTicks;
-}
-
-
-static void
-SweepTicks(Axis *axisPtr)
-{
- if (axisPtr->flags & AXIS_AUTO_MAJOR) {
- if (axisPtr->t1Ptr != NULL) {
- Blt_Free(axisPtr->t1Ptr);
- }
- axisPtr->t1Ptr = GenerateTicks(&axisPtr->majorSweep);
- }
- if (axisPtr->flags & AXIS_AUTO_MINOR) {
- if (axisPtr->t2Ptr != NULL) {
- Blt_Free(axisPtr->t2Ptr);
- }
- axisPtr->t2Ptr = GenerateTicks(&axisPtr->minorSweep);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ResetAxes --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ResetAxes(Graph *graphPtr)
-{
- Blt_ChainLink link;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- /* FIXME: This should be called whenever the display list of
- * elements change. Maybe yet another flag INIT_STACKS to
- * indicate that the element display list has changed.
- * Needs to be done before the axis limits are set.
- */
- Blt_InitBarSetTable(graphPtr);
- if ((graphPtr->mode == BARS_STACKED) && (graphPtr->nBarGroups > 0)) {
- Blt_ComputeBarStacks(graphPtr);
- }
- /*
- * Step 1: Reset all axes. Initialize the data limits of the axis to
- * impossible values.
- */
- for (hPtr = Blt_FirstHashEntry(&graphPtr->axes.table, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Axis *axisPtr;
-
- axisPtr = Blt_GetHashValue(hPtr);
- axisPtr->min = axisPtr->valueRange.min = DBL_MAX;
- axisPtr->max = axisPtr->valueRange.max = -DBL_MAX;
- }
-
- /*
- * Step 2: For each element that's to be displayed, get the smallest
- * and largest data values mapped to each X and Y-axis. This
- * will be the axis limits if the user doesn't override them
- * with -min and -max options.
- */
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
- Region2d exts;
-
- elemPtr = Blt_Chain_GetValue(link);
- if ((graphPtr->flags & UNMAP_HIDDEN) && (elemPtr->flags & HIDE)) {
- continue;
- }
- (*elemPtr->procsPtr->extentsProc) (elemPtr, &exts);
- GetDataLimits(elemPtr->axes.x, exts.left, exts.right);
- GetDataLimits(elemPtr->axes.y, exts.top, exts.bottom);
- }
- /*
- * Step 3: Now that we know the range of data values for each axis,
- * set axis limits and compute a sweep to generate tick values.
- */
- for (hPtr = Blt_FirstHashEntry(&graphPtr->axes.table, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Axis *axisPtr;
- double min, max;
-
- axisPtr = Blt_GetHashValue(hPtr);
- FixAxisRange(axisPtr);
-
- /* Calculate min/max tick (major/minor) layouts */
- min = axisPtr->min;
- max = axisPtr->max;
- if ((DEFINED(axisPtr->scrollMin)) && (min < axisPtr->scrollMin)) {
- min = axisPtr->scrollMin;
- }
- if ((DEFINED(axisPtr->scrollMax)) && (max > axisPtr->scrollMax)) {
- max = axisPtr->scrollMax;
- }
- if (axisPtr->logScale) {
- LogScaleAxis(axisPtr, min, max);
- } else if (axisPtr->timeScale) {
- TimeScaleAxis(axisPtr, min, max);
- } else {
- LinearScaleAxis(axisPtr, min, max);
- }
-
- if ((axisPtr->flags & (DIRTY|AXIS_USE)) == (DIRTY|AXIS_USE)) {
- graphPtr->flags |= CACHE_DIRTY;
- }
- }
-
- graphPtr->flags &= ~RESET_AXES;
-
- /*
- * When any axis changes, we need to layout the entire graph.
- */
- graphPtr->flags |= (GET_AXIS_GEOMETRY | LAYOUT_NEEDED | MAP_ALL |
- REDRAW_WORLD);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResetTextStyles --
- *
- * Configures axis attributes (font, line width, label, etc) and
- * allocates a new (possibly shared) graphics context. Line cap style is
- * projecting. This is for the problem of when a tick sits directly at
- * the end point of the axis.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- * Side Effects:
- * Axis resources are allocated (GC, font). Axis layout is deferred until
- * the height and width of the window are known.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ResetTextStyles(Axis *axisPtr)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
-
- Blt_Ts_ResetStyle(graphPtr->tkwin, &axisPtr->limitsTextStyle);
-
- gcMask = (GCForeground | GCLineWidth | GCCapStyle);
- gcValues.foreground = axisPtr->tickColor->pixel;
- gcValues.font = Blt_FontId(axisPtr->tickFont);
- gcValues.line_width = LineWidth(axisPtr->lineWidth);
- gcValues.cap_style = CapProjecting;
-
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (axisPtr->tickGC != NULL) {
- Tk_FreeGC(graphPtr->display, axisPtr->tickGC);
- }
- axisPtr->tickGC = newGC;
-
- /* Assuming settings from above GC */
- gcValues.foreground = axisPtr->activeFgColor->pixel;
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (axisPtr->activeTickGC != NULL) {
- Tk_FreeGC(graphPtr->display, axisPtr->activeTickGC);
- }
- axisPtr->activeTickGC = newGC;
-
- gcValues.background = gcValues.foreground = axisPtr->major.color->pixel;
- gcValues.line_width = LineWidth(axisPtr->major.lineWidth);
- gcMask = (GCForeground | GCBackground | GCLineWidth);
- if (LineIsDashed(axisPtr->major.dashes)) {
- gcValues.line_style = LineOnOffDash;
- gcMask |= GCLineStyle;
- }
- newGC = Blt_GetPrivateGC(graphPtr->tkwin, gcMask, &gcValues);
- if (LineIsDashed(axisPtr->major.dashes)) {
- Blt_SetDashes(graphPtr->display, newGC, &axisPtr->major.dashes);
- }
- if (axisPtr->major.gc != NULL) {
- Blt_FreePrivateGC(graphPtr->display, axisPtr->major.gc);
- }
- axisPtr->major.gc = newGC;
-
- gcValues.background = gcValues.foreground = axisPtr->minor.color->pixel;
- gcValues.line_width = LineWidth(axisPtr->minor.lineWidth);
- gcMask = (GCForeground | GCBackground | GCLineWidth);
- if (LineIsDashed(axisPtr->minor.dashes)) {
- gcValues.line_style = LineOnOffDash;
- gcMask |= GCLineStyle;
- }
- newGC = Blt_GetPrivateGC(graphPtr->tkwin, gcMask, &gcValues);
- if (LineIsDashed(axisPtr->minor.dashes)) {
- Blt_SetDashes(graphPtr->display, newGC, &axisPtr->minor.dashes);
- }
- if (axisPtr->minor.gc != NULL) {
- Blt_FreePrivateGC(graphPtr->display, axisPtr->minor.gc);
- }
- axisPtr->minor.gc = newGC;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyAxis --
- *
- * Results:
- * None.
- *
- * Side effects:
- * Resources (font, color, gc, labels, etc.) associated with the axis are
- * deallocated.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyAxis(Axis *axisPtr)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
- int flags;
-
- flags = Blt_GraphType(graphPtr);
- Blt_FreeOptions(configSpecs, (char *)axisPtr, graphPtr->display, flags);
- if (graphPtr->bindTable != NULL) {
- Blt_DeleteBindings(graphPtr->bindTable, axisPtr);
- }
- if (axisPtr->link != NULL) {
- Blt_Chain_DeleteLink(axisPtr->chain, axisPtr->link);
- }
- if (axisPtr->obj.name != NULL) {
- Blt_Free(axisPtr->obj.name);
- }
- if (axisPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&graphPtr->axes.table, axisPtr->hashPtr);
- }
- Blt_Ts_FreeStyle(graphPtr->display, &axisPtr->limitsTextStyle);
-
- if (axisPtr->tickGC != NULL) {
- Tk_FreeGC(graphPtr->display, axisPtr->tickGC);
- }
- if (axisPtr->activeTickGC != NULL) {
- Tk_FreeGC(graphPtr->display, axisPtr->activeTickGC);
- }
- if (axisPtr->major.gc != NULL) {
- Blt_FreePrivateGC(graphPtr->display, axisPtr->major.gc);
- }
- if (axisPtr->minor.gc != NULL) {
- Blt_FreePrivateGC(graphPtr->display, axisPtr->minor.gc);
- }
- FreeTickLabels(axisPtr->tickLabels);
- Blt_Chain_Destroy(axisPtr->tickLabels);
- if (axisPtr->segments != NULL) {
- Blt_Free(axisPtr->segments);
- }
- Blt_Free(axisPtr);
-}
-
-static void
-FreeAxis(DestroyData data)
-{
- Axis *axisPtr = (Axis *)data;
- DestroyAxis(axisPtr);
-}
-
-static float titleAngle[4] = /* Rotation for each axis title */
-{
- 0.0, 90.0, 0.0, 270.0
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisOffsets --
- *
- * Determines the sites of the axis, major and minor ticks, and title of
- * the axis.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-AxisOffsets(
- Axis *axisPtr,
- int margin,
- int offset,
- AxisInfo *infoPtr)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
- Margin *marginPtr;
- int pad; /* Offset of axis from interior
- * region. This includes a possible
- * border and the axis line width. */
- int axisLine;
- int t1, t2, labelOffset;
- int tickLabel, axisPad;
- int inset, mark;
- int x, y;
- float fangle;
-
- axisPtr->titleAngle = titleAngle[margin];
- marginPtr = graphPtr->margins + margin;
-
- tickLabel = axisLine = t1 = t2 = 0;
- labelOffset = AXIS_PAD_TITLE;
- if (axisPtr->lineWidth > 0) {
- if (axisPtr->flags & AXIS_SHOWTICKS) {
- t1 = axisPtr->tickLength;
- t2 = (t1 * 10) / 15;
- }
- labelOffset = t1 + AXIS_PAD_TITLE;
- if (axisPtr->flags & AXIS_EXTERIOR) {
- labelOffset += axisPtr->lineWidth;
- }
- }
- axisPad = 0;
- if (graphPtr->plotRelief != TK_RELIEF_SOLID) {
- axisPad = 0;
- }
- /* Adjust offset for the interior border width and the line width */
- pad = 1;
- if (graphPtr->plotBW > 0) {
- pad += graphPtr->plotBW + 1;
- }
- pad = 0; /* FIXME: test */
- /*
- * Pre-calculate the x-coordinate positions of the axis, tick labels, and
- * the individual major and minor ticks.
- */
- inset = pad + axisPtr->lineWidth / 2;
- switch (margin) {
- case MARGIN_TOP:
- axisLine = graphPtr->top;
- if (axisPtr->flags & AXIS_EXTERIOR) {
- axisLine -= graphPtr->plotBW + axisPad + axisPtr->lineWidth / 2;
- tickLabel = axisLine - 2;
- if (axisPtr->lineWidth > 0) {
- tickLabel -= axisPtr->tickLength;
- }
-#ifdef notdef
- fprintf(stderr, "axisLine=%d, axisPad=%d plotBW=%d axisPtr->lineWidth/2=%d\n", axisLine, axisPad, graphPtr->plotBW, axisPtr->lineWidth /2 );
-#endif
- } else {
- if (graphPtr->plotRelief == TK_RELIEF_SOLID) {
- axisLine--;
- }
- axisLine -= axisPad + axisPtr->lineWidth / 2;
- tickLabel = graphPtr->top - graphPtr->plotBW - 2;
-#ifdef notdef
- fprintf(stderr, "axisLine=%d, axisPad=%d plotBW=%d axisPtr->lineWidth/2=%d\n", axisLine, axisPad, graphPtr->plotBW, axisPtr->lineWidth /2 );
-#endif
- }
- mark = graphPtr->top - offset - pad;
- axisPtr->tickAnchor = TK_ANCHOR_S;
- axisPtr->left = axisPtr->screenMin - inset - 2;
- axisPtr->right = axisPtr->screenMin + axisPtr->screenRange + inset - 1;
- if (graphPtr->stackAxes) {
- axisPtr->top = mark - marginPtr->axesOffset;
- } else {
- axisPtr->top = mark - axisPtr->height;
- }
- axisPtr->bottom = mark;
- if (axisPtr->titleAlternate) {
- x = graphPtr->right + AXIS_PAD_TITLE;
- y = mark - (axisPtr->height / 2);
- axisPtr->titleAnchor = TK_ANCHOR_W;
- } else {
- x = (axisPtr->right + axisPtr->left) / 2;
- if (graphPtr->stackAxes) {
- y = mark - marginPtr->axesOffset + AXIS_PAD_TITLE;
- } else {
- y = mark - axisPtr->height + AXIS_PAD_TITLE;
- }
- axisPtr->titleAnchor = TK_ANCHOR_N;
- }
- axisPtr->titlePos.x = x;
- axisPtr->titlePos.y = y;
- break;
-
- case MARGIN_BOTTOM:
- /*
- * ----------- bottom + plot borderwidth
- * mark --------------------------------------------
- * ===================== axisLine (linewidth)
- * tick
- * title
- *
- * ===================== axisLine (linewidth)
- * ----------- bottom + plot borderwidth
- * mark --------------------------------------------
- * tick
- * title
- */
- axisLine = graphPtr->bottom;
- if (graphPtr->plotRelief == TK_RELIEF_SOLID) {
- axisLine++;
- }
- if (axisPtr->flags & AXIS_EXTERIOR) {
- axisLine += graphPtr->plotBW + axisPad + axisPtr->lineWidth / 2;
- tickLabel = axisLine + 2;
- if (axisPtr->lineWidth > 0) {
- tickLabel += axisPtr->tickLength;
- }
- } else {
- axisLine -= axisPad + axisPtr->lineWidth / 2;
- tickLabel = graphPtr->bottom + graphPtr->plotBW + 2;
- }
- mark = graphPtr->bottom + offset;
- fangle = FMOD(axisPtr->tickAngle, 90.0);
- if (fangle == 0.0) {
- axisPtr->tickAnchor = TK_ANCHOR_N;
- } else {
- int quadrant;
-
- quadrant = (int)(axisPtr->tickAngle / 90.0);
- if ((quadrant == 0) || (quadrant == 2)) {
- axisPtr->tickAnchor = TK_ANCHOR_NE;
- } else {
- axisPtr->tickAnchor = TK_ANCHOR_NW;
- }
- }
- axisPtr->left = axisPtr->screenMin - inset - 2;
- axisPtr->right = axisPtr->screenMin + axisPtr->screenRange + inset - 1;
- axisPtr->top = graphPtr->bottom + labelOffset - t1;
- if (graphPtr->stackAxes) {
- axisPtr->bottom = mark + marginPtr->axesOffset - 1;
- } else {
- axisPtr->bottom = mark + axisPtr->height - 1;
- }
- if (axisPtr->titleAlternate) {
- x = graphPtr->right + AXIS_PAD_TITLE;
- y = mark + (axisPtr->height / 2);
- axisPtr->titleAnchor = TK_ANCHOR_W;
- } else {
- x = (axisPtr->right + axisPtr->left) / 2;
- if (graphPtr->stackAxes) {
- y = mark + marginPtr->axesOffset - AXIS_PAD_TITLE;
- } else {
- y = mark + axisPtr->height - AXIS_PAD_TITLE;
- }
- axisPtr->titleAnchor = TK_ANCHOR_S;
- }
- axisPtr->titlePos.x = x;
- axisPtr->titlePos.y = y;
- break;
-
- case MARGIN_LEFT:
- /*
- * mark
- * | :
- * | :
- * | :
- * | :
- * | :
- * axisLine
- */
- /*
- * Exterior axis
- * + plotarea right
- * |A|B|C|D|E|F|G|H
- * |right
- * A = plot pad
- * B = plot border width
- * C = axis pad
- * D = axis line
- * E = tick length
- * F = tick label
- * G = graph border width
- * H = highlight thickness
- */
- /*
- * Interior axis
- * + plotarea right
- * |A|B|C|D|E|F|G|H
- * |right
- * A = plot pad
- * B = tick length
- * C = axis line width
- * D = axis pad
- * E = plot border width
- * F = tick label
- * G = graph border width
- * H = highlight thickness
- */
- axisLine = graphPtr->left;
- if (axisPtr->flags & AXIS_EXTERIOR) {
- axisLine -= graphPtr->plotBW + axisPad + axisPtr->lineWidth / 2;
- tickLabel = axisLine - 2;
- if (axisPtr->lineWidth > 0) {
- tickLabel -= axisPtr->tickLength;
- }
- } else {
- if (graphPtr->plotRelief == TK_RELIEF_SOLID) {
- axisLine--;
- }
- axisLine += axisPad + axisPtr->lineWidth / 2;
- tickLabel = graphPtr->left - graphPtr->plotBW - 2;
- }
- mark = graphPtr->left - offset;
- axisPtr->tickAnchor = TK_ANCHOR_E;
- if (graphPtr->stackAxes) {
- axisPtr->left = mark - marginPtr->axesOffset;
- } else {
- axisPtr->left = mark - axisPtr->width;
- }
- axisPtr->right = mark - 3;
- axisPtr->top = axisPtr->screenMin - inset - 2;
- axisPtr->bottom = axisPtr->screenMin + axisPtr->screenRange + inset - 1;
- if (axisPtr->titleAlternate) {
- x = mark - (axisPtr->width / 2);
- y = graphPtr->top - AXIS_PAD_TITLE;
- axisPtr->titleAnchor = TK_ANCHOR_SW;
- } else {
- if (graphPtr->stackAxes) {
- x = mark - marginPtr->axesOffset;
- } else {
- x = mark - axisPtr->width + AXIS_PAD_TITLE;
- }
- y = (axisPtr->bottom + axisPtr->top) / 2;
- axisPtr->titleAnchor = TK_ANCHOR_W;
- }
- axisPtr->titlePos.x = x;
- axisPtr->titlePos.y = y;
- break;
-
- case MARGIN_RIGHT:
- axisLine = graphPtr->right;
- if (graphPtr->plotRelief == TK_RELIEF_SOLID) {
- axisLine++; /* Draw axis line within solid plot
- * border. */
- }
- if (axisPtr->flags & AXIS_EXTERIOR) {
- axisLine += graphPtr->plotBW + axisPad + axisPtr->lineWidth / 2;
- tickLabel = axisLine + 2;
- if (axisPtr->lineWidth > 0) {
- tickLabel += axisPtr->tickLength;
- }
- } else {
- axisLine -= axisPad + axisPtr->lineWidth / 2;
- tickLabel = graphPtr->right + graphPtr->plotBW + 2;
- }
- mark = graphPtr->right + offset + pad;
- axisPtr->tickAnchor = TK_ANCHOR_W;
- axisPtr->left = mark;
- if (graphPtr->stackAxes) {
- axisPtr->right = mark + marginPtr->axesOffset - 1;
- } else {
- axisPtr->right = mark + axisPtr->width - 1;
- }
- axisPtr->top = axisPtr->screenMin - inset - 2;
- axisPtr->bottom = axisPtr->screenMin + axisPtr->screenRange + inset -1;
- if (axisPtr->titleAlternate) {
- x = mark + (axisPtr->width / 2);
- y = graphPtr->top - AXIS_PAD_TITLE;
- axisPtr->titleAnchor = TK_ANCHOR_SE;
- } else {
- if (graphPtr->stackAxes) {
- x = mark + marginPtr->axesOffset - AXIS_PAD_TITLE;
- } else {
- x = mark + axisPtr->width - AXIS_PAD_TITLE;
- }
- y = (axisPtr->bottom + axisPtr->top) / 2;
- axisPtr->titleAnchor = TK_ANCHOR_E;
- }
- axisPtr->titlePos.x = x;
- axisPtr->titlePos.y = y;
- break;
-
- case MARGIN_NONE:
- axisLine = 0;
- break;
- }
- if ((margin == MARGIN_LEFT) || (margin == MARGIN_TOP)) {
- t1 = -t1, t2 = -t2;
- labelOffset = -labelOffset;
- }
- infoPtr->axis = axisLine;
- infoPtr->t1 = axisLine + t1;
- infoPtr->t2 = axisLine + t2;
- if (tickLabel > 0) {
- infoPtr->label = tickLabel;
- } else {
- infoPtr->label = axisLine + labelOffset;
- }
- if ((axisPtr->flags & AXIS_EXTERIOR) == 0) {
- /*infoPtr->label = axisLine + labelOffset - t1; */
- infoPtr->t1 = axisLine - t1;
- infoPtr->t2 = axisLine - t2;
- }
-}
-
-static void
-MakeAxisLine(Axis *axisPtr, int line, Segment2d *sp)
-{
- double min, max;
-
- min = axisPtr->axisRange.min;
- max = axisPtr->axisRange.max;
- if (axisPtr->logScale) {
- min = EXP10(min);
- max = EXP10(max);
- }
- if (AxisIsHorizontal(axisPtr)) {
- sp->p.x = Blt_HMap(axisPtr, min);
- sp->q.x = Blt_HMap(axisPtr, max);
- sp->p.y = sp->q.y = line;
- } else {
- sp->q.x = sp->p.x = line;
- sp->p.y = Blt_VMap(axisPtr, min);
- sp->q.y = Blt_VMap(axisPtr, max);
- }
-}
-
-
-static void
-MakeTick(Axis *axisPtr, double value, int tick, int line, Segment2d *sp)
-{
- if (axisPtr->logScale) {
- value = EXP10(value);
- }
- if (AxisIsHorizontal(axisPtr)) {
- sp->p.x = sp->q.x = Blt_HMap(axisPtr, value);
- sp->p.y = line;
- sp->q.y = tick;
- } else {
- sp->p.x = line;
- sp->p.y = sp->q.y = Blt_VMap(axisPtr, value);
- sp->q.x = tick;
- }
-}
-
-static void
-MakeSegments(Axis *axisPtr, AxisInfo *infoPtr)
-{
- int arraySize;
- int nMajorTicks, nMinorTicks;
- Segment2d *segments;
- Segment2d *sp;
-
- if (axisPtr->segments != NULL) {
- Blt_Free(axisPtr->segments);
- }
- nMajorTicks = nMinorTicks = 0;
- if (axisPtr->t1Ptr != NULL) {
- nMajorTicks = axisPtr->t1Ptr->nTicks;
- }
- if (axisPtr->t2Ptr != NULL) {
- nMinorTicks = axisPtr->t2Ptr->nTicks;
- }
- arraySize = 1 + (nMajorTicks * (nMinorTicks + 1));
- segments = Blt_AssertMalloc(arraySize * sizeof(Segment2d));
- sp = segments;
- if (axisPtr->lineWidth > 0) {
- /* Axis baseline */
- MakeAxisLine(axisPtr, infoPtr->axis, sp);
- sp++;
- }
- if (axisPtr->flags & AXIS_SHOWTICKS) {
- Blt_ChainLink link;
- double labelPos;
- int i;
- int isHoriz;
-
- isHoriz = AxisIsHorizontal(axisPtr);
- for (i = 0; i < nMajorTicks; i++) {
- double t1, t2;
- int j;
-
- t1 = axisPtr->t1Ptr->values[i];
- /* Minor ticks */
- for (j = 0; j < nMinorTicks; j++) {
- t2 = t1 + (axisPtr->majorSweep.step *
- axisPtr->t2Ptr->values[j]);
- if (InRange(t2, &axisPtr->axisRange)) {
- MakeTick(axisPtr, t2, infoPtr->t2, infoPtr->axis, sp);
- sp++;
- }
- }
- if (!InRange(t1, &axisPtr->axisRange)) {
- continue;
- }
- /* Major tick */
- MakeTick(axisPtr, t1, infoPtr->t1, infoPtr->axis, sp);
- sp++;
- }
-
- link = Blt_Chain_FirstLink(axisPtr->tickLabels);
- labelPos = (double)infoPtr->label;
-
- for (i = 0; i < nMajorTicks; i++) {
- double t1;
- TickLabel *labelPtr;
- Segment2d seg;
-
- t1 = axisPtr->t1Ptr->values[i];
- if (axisPtr->labelOffset) {
- t1 += axisPtr->majorSweep.step * 0.5;
- }
- if (!InRange(t1, &axisPtr->axisRange)) {
- continue;
- }
- labelPtr = Blt_Chain_GetValue(link);
- link = Blt_Chain_NextLink(link);
- MakeTick(axisPtr, t1, infoPtr->t1, infoPtr->axis, &seg);
- /* Save tick label X-Y position. */
- if (isHoriz) {
- labelPtr->anchorPos.x = seg.p.x;
- labelPtr->anchorPos.y = labelPos;
- } else {
- labelPtr->anchorPos.x = labelPos;
- labelPtr->anchorPos.y = seg.p.y;
- }
- }
- }
- axisPtr->segments = segments;
- axisPtr->nSegments = sp - segments;
- assert(axisPtr->nSegments <= arraySize);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapAxis --
- *
- * Pre-calculates positions of the axis, ticks, and labels (to be used
- * later when displaying the axis). Calculates the values for each major
- * and minor tick and checks to see if they are in range (the outer ticks
- * may be outside of the range of plotted values).
- *
- * Line segments for the minor and major ticks are saved into one
- * XSegment array so that they can be drawn by a single XDrawSegments
- * call. The positions of the tick labels are also computed and saved.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Line segments and tick labels are saved and used later to draw the
- * axis.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapAxis(Axis *axisPtr, int offset, int margin)
-{
- AxisInfo info;
- Graph *graphPtr = axisPtr->obj.graphPtr;
-
- if (AxisIsHorizontal(axisPtr)) {
- axisPtr->screenMin = graphPtr->hOffset;
- axisPtr->width = graphPtr->right - graphPtr->left;
- axisPtr->screenRange = graphPtr->hRange;
- } else {
- axisPtr->screenMin = graphPtr->vOffset;
- axisPtr->height = graphPtr->bottom - graphPtr->top;
- axisPtr->screenRange = graphPtr->vRange;
- }
- axisPtr->screenScale = 1.0 / axisPtr->screenRange;
- AxisOffsets(axisPtr, margin, offset, &info);
- MakeSegments(axisPtr, &info);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapStackedAxis --
- *
- * Pre-calculates positions of the axis, ticks, and labels (to be used
- * later when displaying the axis). Calculates the values for each major
- * and minor tick and checks to see if they are in range (the outer ticks
- * may be outside of the range of plotted values).
- *
- * Line segments for the minor and major ticks are saved into one XSegment
- * array so that they can be drawn by a single XDrawSegments call. The
- * positions of the tick labels are also computed and saved.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Line segments and tick labels are saved and used later to draw the
- * axis.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapStackedAxis(Axis *axisPtr, int count, int margin)
-{
- AxisInfo info;
- Graph *graphPtr = axisPtr->obj.graphPtr;
- unsigned int slice, w, h;
-
- if ((graphPtr->margins[axisPtr->margin].axes->nLinks > 1) ||
- (axisPtr->reqNumMajorTicks <= 0)) {
- axisPtr->reqNumMajorTicks = 4;
- }
- if (AxisIsHorizontal(axisPtr)) {
- slice = graphPtr->hRange / graphPtr->margins[margin].axes->nLinks;
- axisPtr->screenMin = graphPtr->hOffset;
- axisPtr->width = slice;
- } else {
- slice = graphPtr->vRange / graphPtr->margins[margin].axes->nLinks;
- axisPtr->screenMin = graphPtr->vOffset;
- axisPtr->height = slice;
- }
-#define AXIS_PAD 2
- Blt_GetTextExtents(axisPtr->tickFont, 0, "0", 1, &w, &h);
- axisPtr->screenMin += (slice * count) + AXIS_PAD + h / 2;
- axisPtr->screenRange = slice - 2 * AXIS_PAD - h;
- axisPtr->screenScale = 1.0f / axisPtr->screenRange;
- AxisOffsets(axisPtr, margin, 0, &info);
- MakeSegments(axisPtr, &info);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AdjustViewport --
- *
- * Adjusts the offsets of the viewport according to the scroll mode. This
- * is to accommodate both "listbox" and "canvas" style scrolling.
- *
- * "canvas" The viewport scrolls within the range of world
- * coordinates. This way the viewport always displays
- * a full page of the world. If the world is smaller
- * than the viewport, then (bizarrely) the world and
- * viewport are inverted so that the world moves up
- * and down within the viewport.
- *
- * "listbox" The viewport can scroll beyond the range of world
- * coordinates. Every entry can be displayed at the
- * top of the viewport. This also means that the
- * scrollbar thumb weirdly shrinks as the last entry
- * is scrolled upward.
- *
- * Results:
- * The corrected offset is returned.
- *
- *---------------------------------------------------------------------------
- */
-static double
-AdjustViewport(double offset, double windowSize)
-{
- /*
- * Canvas-style scrolling allows the world to be scrolled within the window.
- */
- if (windowSize > 1.0) {
- if (windowSize < (1.0 - offset)) {
- offset = 1.0 - windowSize;
- }
- if (offset > 0.0) {
- offset = 0.0;
- }
- } else {
- if ((offset + windowSize) > 1.0) {
- offset = 1.0 - windowSize;
- }
- if (offset < 0.0) {
- offset = 0.0;
- }
- }
- return offset;
-}
-
-static int
-GetAxisScrollInfo(
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv,
- double *offsetPtr,
- double windowSize,
- double scrollUnits,
- double scale)
-{
- const char *string;
- char c;
- double offset;
- int length;
-
- offset = *offsetPtr;
- string = Tcl_GetStringFromObj(objv[0], &length);
- c = string[0];
- scrollUnits *= scale;
- if ((c == 's') && (strncmp(string, "scroll", length) == 0)) {
- int count;
- double fract;
-
- assert(objc == 3);
- /* Scroll number unit/page */
- if (Tcl_GetIntFromObj(interp, objv[1], &count) != TCL_OK) {
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- if ((c == 'u') && (strncmp(string, "units", length) == 0)) {
- fract = count * scrollUnits;
- } else if ((c == 'p') && (strncmp(string, "pages", length) == 0)) {
- /* A page is 90% of the view-able window. */
- fract = (int)(count * windowSize * 0.9 + 0.5);
- } else if ((c == 'p') && (strncmp(string, "pixels", length) == 0)) {
- fract = count * scale;
- } else {
- Tcl_AppendResult(interp, "unknown \"scroll\" units \"", string,
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- offset += fract;
- } else if ((c == 'm') && (strncmp(string, "moveto", length) == 0)) {
- double fract;
-
- assert(objc == 2);
- /* moveto fraction */
- if (Blt_GetDoubleFromObj(interp, objv[1], &fract) != TCL_OK) {
- return TCL_ERROR;
- }
- offset = fract;
- } else {
- int count;
- double fract;
-
- /* Treat like "scroll units" */
- if (Tcl_GetIntFromObj(interp, objv[0], &count) != TCL_OK) {
- return TCL_ERROR;
- }
- fract = (double)count * scrollUnits;
- offset += fract;
- /* CHECK THIS: return TCL_OK; */
- }
- *offsetPtr = AdjustViewport(offset, windowSize);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawAxis --
- *
- * Draws the axis, ticks, and labels onto the canvas.
- *
- * Initializes and passes text attribute information through TextStyle
- * structure.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Axis gets drawn on window.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawAxis(Axis *axisPtr, Drawable drawable)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
-
- if (axisPtr->normalBg != NULL) {
- Blt_FillBackgroundRectangle(graphPtr->tkwin, drawable,
- axisPtr->normalBg,
- axisPtr->left, axisPtr->top,
- axisPtr->right - axisPtr->left,
- axisPtr->bottom - axisPtr->top, axisPtr->borderWidth,
- axisPtr->relief);
- }
- if (axisPtr->title != NULL) {
- TextStyle ts;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetAngle(ts, axisPtr->titleAngle);
- Blt_Ts_SetFont(ts, axisPtr->titleFont);
- Blt_Ts_SetPadding(ts, 1, 2, 0, 0);
- Blt_Ts_SetAnchor(ts, axisPtr->titleAnchor);
- Blt_Ts_SetJustify(ts, axisPtr->titleJustify);
- if (axisPtr->flags & ACTIVE) {
- Blt_Ts_SetForeground(ts, axisPtr->activeFgColor);
- } else {
- Blt_Ts_SetForeground(ts, axisPtr->titleColor);
- }
- Blt_Ts_SetForeground(ts, axisPtr->titleColor);
- if ((axisPtr->titleAngle == 90.0) || (axisPtr->titleAngle == 270.0)) {
- Blt_Ts_SetMaxLength(ts, axisPtr->height);
- } else {
- Blt_Ts_SetMaxLength(ts, axisPtr->width);
- }
- Blt_Ts_DrawText(graphPtr->tkwin, drawable, axisPtr->title, -1, &ts,
- (int)axisPtr->titlePos.x, (int)axisPtr->titlePos.y);
- }
- if (axisPtr->scrollCmdObjPtr != NULL) {
- double viewWidth, viewMin, viewMax;
- double worldWidth, worldMin, worldMax;
- double fract;
- int isHoriz;
-
- worldMin = axisPtr->valueRange.min;
- worldMax = axisPtr->valueRange.max;
- if (DEFINED(axisPtr->scrollMin)) {
- worldMin = axisPtr->scrollMin;
- }
- if (DEFINED(axisPtr->scrollMax)) {
- worldMax = axisPtr->scrollMax;
- }
- viewMin = axisPtr->min;
- viewMax = axisPtr->max;
- if (viewMin < worldMin) {
- viewMin = worldMin;
- }
- if (viewMax > worldMax) {
- viewMax = worldMax;
- }
- if (axisPtr->logScale) {
- worldMin = log10(worldMin);
- worldMax = log10(worldMax);
- viewMin = log10(viewMin);
- viewMax = log10(viewMax);
- }
- worldWidth = worldMax - worldMin;
- viewWidth = viewMax - viewMin;
- isHoriz = AxisIsHorizontal(axisPtr);
-
- if (isHoriz != axisPtr->descending) {
- fract = (viewMin - worldMin) / worldWidth;
- } else {
- fract = (worldMax - viewMax) / worldWidth;
- }
- fract = AdjustViewport(fract, viewWidth / worldWidth);
-
- if (isHoriz != axisPtr->descending) {
- viewMin = (fract * worldWidth);
- axisPtr->min = viewMin + worldMin;
- axisPtr->max = axisPtr->min + viewWidth;
- viewMax = viewMin + viewWidth;
- if (axisPtr->logScale) {
- axisPtr->min = EXP10(axisPtr->min);
- axisPtr->max = EXP10(axisPtr->max);
- }
- Blt_UpdateScrollbar(graphPtr->interp, axisPtr->scrollCmdObjPtr,
- viewMin, viewMax, worldWidth);
- } else {
- viewMax = (fract * worldWidth);
- axisPtr->max = worldMax - viewMax;
- axisPtr->min = axisPtr->max - viewWidth;
- viewMin = viewMax + viewWidth;
- if (axisPtr->logScale) {
- axisPtr->min = EXP10(axisPtr->min);
- axisPtr->max = EXP10(axisPtr->max);
- }
- Blt_UpdateScrollbar(graphPtr->interp, axisPtr->scrollCmdObjPtr,
- viewMax, viewMin, worldWidth);
- }
- }
- if (axisPtr->flags & AXIS_SHOWTICKS) {
- Blt_ChainLink link;
- TextStyle ts;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetAngle(ts, axisPtr->tickAngle);
- Blt_Ts_SetFont(ts, axisPtr->tickFont);
- Blt_Ts_SetPadding(ts, 2, 0, 0, 0);
- Blt_Ts_SetAnchor(ts, axisPtr->tickAnchor);
- if (axisPtr->flags & ACTIVE) {
- Blt_Ts_SetForeground(ts, axisPtr->activeFgColor);
- } else {
- Blt_Ts_SetForeground(ts, axisPtr->tickColor);
- }
- for (link = Blt_Chain_FirstLink(axisPtr->tickLabels); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TickLabel *labelPtr;
-
- labelPtr = Blt_Chain_GetValue(link);
- /* Draw major tick labels */
- Blt_DrawText(graphPtr->tkwin, drawable, labelPtr->string, &ts,
- (int)labelPtr->anchorPos.x, (int)labelPtr->anchorPos.y);
- }
- }
- if ((axisPtr->nSegments > 0) && (axisPtr->lineWidth > 0)) {
- GC gc;
-
- if (axisPtr->flags & ACTIVE) {
- gc = axisPtr->activeTickGC;
- } else {
- gc = axisPtr->tickGC;
- }
- /* Draw the tick marks and axis line. */
- Blt_Draw2DSegments(graphPtr->display, drawable, gc, axisPtr->segments,
- axisPtr->nSegments);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisToPostScript --
- *
- * Generates PostScript output to draw the axis, ticks, and labels.
- *
- * Initializes and passes text attribute information through TextStyle
- * structure.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * PostScript output is left in graphPtr->interp->result;
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-AxisToPostScript(Blt_Ps ps, Axis *axisPtr)
-{
- Blt_Ps_Format(ps, "%% Axis \"%s\"\n", axisPtr->obj.name);
- if (axisPtr->normalBg != NULL) {
- Tk_3DBorder border;
-
- border = Blt_BackgroundBorder(axisPtr->normalBg);
- Blt_Ps_Fill3DRectangle(ps, border,
- (double)axisPtr->left, (double)axisPtr->top,
- axisPtr->right - axisPtr->left, axisPtr->bottom - axisPtr->top,
- axisPtr->borderWidth, axisPtr->relief);
- }
- if (axisPtr->title != NULL) {
- TextStyle ts;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetAngle(ts, axisPtr->titleAngle);
- Blt_Ts_SetFont(ts, axisPtr->titleFont);
- Blt_Ts_SetPadding(ts, 1, 2, 0, 0);
- Blt_Ts_SetAnchor(ts, axisPtr->titleAnchor);
- Blt_Ts_SetJustify(ts, axisPtr->titleJustify);
- Blt_Ts_SetForeground(ts, axisPtr->titleColor);
- Blt_Ps_DrawText(ps, axisPtr->title, &ts, axisPtr->titlePos.x,
- axisPtr->titlePos.y);
- }
- if (axisPtr->flags & AXIS_SHOWTICKS) {
- Blt_ChainLink link;
- TextStyle ts;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetAngle(ts, axisPtr->tickAngle);
- Blt_Ts_SetFont(ts, axisPtr->tickFont);
- Blt_Ts_SetPadding(ts, 2, 0, 0, 0);
- Blt_Ts_SetAnchor(ts, axisPtr->tickAnchor);
- Blt_Ts_SetForeground(ts, axisPtr->tickColor);
-
- for (link = Blt_Chain_FirstLink(axisPtr->tickLabels); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TickLabel *labelPtr;
-
- labelPtr = Blt_Chain_GetValue(link);
- Blt_Ps_DrawText(ps, labelPtr->string, &ts, labelPtr->anchorPos.x,
- labelPtr->anchorPos.y);
- }
- }
- if ((axisPtr->nSegments > 0) && (axisPtr->lineWidth > 0)) {
- Blt_Ps_XSetLineAttributes(ps, axisPtr->tickColor, axisPtr->lineWidth,
- (Blt_Dashes *)NULL, CapButt, JoinMiter);
- Blt_Ps_Draw2DSegments(ps, axisPtr->segments, axisPtr->nSegments);
- }
-}
-
-static void
-MakeGridLine(Axis *axisPtr, double value, Segment2d *sp)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
-
- if (axisPtr->logScale) {
- value = EXP10(value);
- }
- /* Grid lines run orthogonally to the axis */
- if (AxisIsHorizontal(axisPtr)) {
- sp->p.y = graphPtr->top;
- sp->q.y = graphPtr->bottom;
- sp->p.x = sp->q.x = Blt_HMap(axisPtr, value);
- } else {
- sp->p.x = graphPtr->left;
- sp->q.x = graphPtr->right;
- sp->p.y = sp->q.y = Blt_VMap(axisPtr, value);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapGridlines --
- *
- * Assembles the grid lines associated with an axis. Generates tick
- * positions if necessary (this happens when the axis is not a logical axis
- * too).
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapGridlines(Axis *axisPtr)
-{
- Segment2d *s1, *s2;
- Ticks *t1Ptr, *t2Ptr;
- int needed;
- int i;
-
- if (axisPtr == NULL) {
- return;
- }
- t1Ptr = axisPtr->t1Ptr;
- if (t1Ptr == NULL) {
- t1Ptr = GenerateTicks(&axisPtr->majorSweep);
- }
- t2Ptr = axisPtr->t2Ptr;
- if (t2Ptr == NULL) {
- t2Ptr = GenerateTicks(&axisPtr->minorSweep);
- }
- needed = t1Ptr->nTicks;
- if (axisPtr->flags & AXIS_GRIDMINOR) {
- needed += (t1Ptr->nTicks * t2Ptr->nTicks);
- }
- if (needed == 0) {
- return;
- }
- needed = t1Ptr->nTicks;
- if (needed != axisPtr->major.nAllocated) {
- if (axisPtr->major.segments != NULL) {
- Blt_Free(axisPtr->major.segments);
- }
- axisPtr->major.segments = Blt_AssertMalloc(sizeof(Segment2d) * needed);
- axisPtr->major.nAllocated = needed;
- }
- needed = (t1Ptr->nTicks * t2Ptr->nTicks);
- if (needed != axisPtr->minor.nAllocated) {
- if (axisPtr->minor.segments != NULL) {
- Blt_Free(axisPtr->minor.segments);
- }
- axisPtr->minor.segments = Blt_AssertMalloc(sizeof(Segment2d) * needed);
- axisPtr->minor.nAllocated = needed;
- }
- s1 = axisPtr->major.segments, s2 = axisPtr->minor.segments;
- for (i = 0; i < t1Ptr->nTicks; i++) {
- double value;
-
- value = t1Ptr->values[i];
- if (axisPtr->flags & AXIS_GRIDMINOR) {
- int j;
-
- for (j = 0; j < t2Ptr->nTicks; j++) {
- double subValue;
-
- subValue = value + (axisPtr->majorSweep.step *
- t2Ptr->values[j]);
- if (InRange(subValue, &axisPtr->axisRange)) {
- MakeGridLine(axisPtr, subValue, s2);
- s2++;
- }
- }
- }
- if (InRange(value, &axisPtr->axisRange)) {
- MakeGridLine(axisPtr, value, s1);
- s1++;
- }
- }
- if (t1Ptr != axisPtr->t1Ptr) {
- Blt_Free(t1Ptr); /* Free generated ticks. */
- }
- if (t2Ptr != axisPtr->t2Ptr) {
- Blt_Free(t2Ptr); /* Free generated ticks. */
- }
- axisPtr->major.nUsed = s1 - axisPtr->major.segments;
- axisPtr->minor.nUsed = s2 - axisPtr->minor.segments;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetAxisGeometry --
- *
- * Results:
- * None.
- *
- * Exterior axis:
- * l r
- * |a|b|c|d|e|f|g|h|i| j |i|h|g|f|e|d|c|d|a|
- *
- * Interior axis:
- * l r
- * |a|b|c|d|h|g|f|e| j |e|f|g|h|d|c|b|a|
- * i.. ..i
- * a = highlight thickness
- * b = graph borderwidth
- * c = axis title
- * d = tick label
- * e = tick
- * f = axis line
- * g = 1 pixel pad
- * h = plot borderwidth
- * i = plot pad
- * j = plot area
- *---------------------------------------------------------------------------
- */
-static void
-GetAxisGeometry(Graph *graphPtr, Axis *axisPtr)
-{
- unsigned int y;
-
- FreeTickLabels(axisPtr->tickLabels);
- y = 0;
-
- if ((axisPtr->flags & AXIS_EXTERIOR) &&
- (graphPtr->plotRelief != TK_RELIEF_SOLID)) {
- /* Leave room for axis baseline and padding */
- y += axisPtr->lineWidth + 2;
- }
-
- axisPtr->maxTickHeight = axisPtr->maxTickWidth = 0;
- if (axisPtr->flags & AXIS_SHOWTICKS) {
- unsigned int pad;
- unsigned int i, nLabels, nTicks;
-
- SweepTicks(axisPtr);
-
- nTicks = 0;
- if (axisPtr->t1Ptr != NULL) {
- nTicks = axisPtr->t1Ptr->nTicks;
- }
- assert(nTicks <= MAXTICKS);
-
- nLabels = 0;
- for (i = 0; i < nTicks; i++) {
- TickLabel *labelPtr;
- double x, x2;
- unsigned int lw, lh; /* Label width and height. */
-
- x2 = x = axisPtr->t1Ptr->values[i];
- if (axisPtr->labelOffset) {
- x2 += axisPtr->majorSweep.step * 0.5;
- }
- if (!InRange(x2, &axisPtr->axisRange)) {
- continue;
- }
- labelPtr = MakeLabel(axisPtr, x);
- Blt_Chain_Append(axisPtr->tickLabels, labelPtr);
- nLabels++;
- /*
- * Get the dimensions of each tick label. Remember tick labels
- * can be multi-lined and/or rotated.
- */
- Blt_GetTextExtents(axisPtr->tickFont, 0, labelPtr->string, -1,
- &lw, &lh);
- labelPtr->width = lw;
- labelPtr->height = lh;
-
- if (axisPtr->tickAngle != 0.0f) {
- double rlw, rlh; /* Rotated label width and height. */
- Blt_GetBoundingBox(lw, lh, axisPtr->tickAngle, &rlw, &rlh,NULL);
- lw = ROUND(rlw), lh = ROUND(rlh);
- }
- if (axisPtr->maxTickWidth < lw) {
- axisPtr->maxTickWidth = lw;
- }
- if (axisPtr->maxTickHeight < lh) {
- axisPtr->maxTickHeight = lh;
- }
- }
- assert(nLabels <= nTicks);
-
- pad = 0;
- if (axisPtr->flags & AXIS_EXTERIOR) {
- /* Because the axis cap style is "CapProjecting", we need to
- * account for an extra 1.5 linewidth at the end of each line. */
- pad = ((axisPtr->lineWidth * 12) / 8);
- }
- if (AxisIsHorizontal(axisPtr)) {
- y += axisPtr->maxTickHeight + pad;
- } else {
- y += axisPtr->maxTickWidth + pad;
- if (axisPtr->maxTickWidth > 0) {
- y += 5; /* Pad either size of label. */
- }
- }
- y += 2 * AXIS_PAD_TITLE;
- if ((axisPtr->lineWidth > 0) && (axisPtr->flags & AXIS_EXTERIOR)) {
- /* Distance from axis line to tick label. */
- y += axisPtr->tickLength;
- }
- }
-
- if (axisPtr->title != NULL) {
- if (axisPtr->titleAlternate) {
- if (y < axisPtr->titleHeight) {
- y = axisPtr->titleHeight;
- }
- } else {
- y += axisPtr->titleHeight + AXIS_PAD_TITLE;
- }
- }
-
- /* Correct for orientation of the axis. */
- if (AxisIsHorizontal(axisPtr)) {
- axisPtr->height = y;
- } else {
- axisPtr->width = y;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetMarginGeometry --
- *
- * Examines all the axes in the given margin and determines the area
- * required to display them.
- *
- * Note: For multiple axes, the titles are displayed in another
- * margin. So we must keep track of the widest title.
- *
- * Results:
- * Returns the width or height of the margin, depending if it runs
- * horizontally along the graph or vertically.
- *
- * Side Effects:
- * The area width and height set in the margin. Note again that this may
- * be corrected later (mulitple axes) to adjust for the longest title in
- * another margin.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetMarginGeometry(Graph *graphPtr, Margin *marginPtr)
-{
- Blt_ChainLink link;
- unsigned int l, w, h; /* Length, width, and height. */
- int isHoriz;
- unsigned int nVisible;
-
- isHoriz = HORIZMARGIN(marginPtr);
-
- /* Count the visible axes. */
- nVisible = 0;
- l = w = h = 0;
- marginPtr->maxTickWidth = marginPtr->maxTickHeight = 0;
- if (graphPtr->stackAxes) {
- for (link = Blt_Chain_FirstLink(marginPtr->axes); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Axis *axisPtr;
-
- axisPtr = Blt_Chain_GetValue(link);
- if ((axisPtr->flags & (HIDE|AXIS_USE)) == AXIS_USE) {
- nVisible++;
- if (graphPtr->flags & GET_AXIS_GEOMETRY) {
- GetAxisGeometry(graphPtr, axisPtr);
- }
- if (isHoriz) {
- if (h < axisPtr->height) {
- h = axisPtr->height;
- }
- } else {
- if (w < axisPtr->width) {
- w = axisPtr->width;
- }
- }
- if (axisPtr->maxTickWidth > marginPtr->maxTickWidth) {
- marginPtr->maxTickWidth = axisPtr->maxTickWidth;
- }
- if (axisPtr->maxTickHeight > marginPtr->maxTickHeight) {
- marginPtr->maxTickHeight = axisPtr->maxTickHeight;
- }
- }
- }
- } else {
- for (link = Blt_Chain_FirstLink(marginPtr->axes); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Axis *axisPtr;
-
- axisPtr = Blt_Chain_GetValue(link);
- if ((axisPtr->flags & (HIDE|AXIS_USE)) == AXIS_USE) {
- nVisible++;
- if (graphPtr->flags & GET_AXIS_GEOMETRY) {
- GetAxisGeometry(graphPtr, axisPtr);
- }
- if ((axisPtr->titleAlternate) && (l < axisPtr->titleWidth)) {
- l = axisPtr->titleWidth;
- }
- if (isHoriz) {
- h += axisPtr->height;
- } else {
- w += axisPtr->width;
- }
- if (axisPtr->maxTickWidth > marginPtr->maxTickWidth) {
- marginPtr->maxTickWidth = axisPtr->maxTickWidth;
- }
- if (axisPtr->maxTickHeight > marginPtr->maxTickHeight) {
- marginPtr->maxTickHeight = axisPtr->maxTickHeight;
- }
- }
- }
- }
- /* Enforce a minimum size for margins. */
- if (w < 3) {
- w = 3;
- }
- if (h < 3) {
- h = 3;
- }
- marginPtr->nAxes = nVisible;
- marginPtr->axesTitleLength = l;
- marginPtr->width = w;
- marginPtr->height = h;
- marginPtr->axesOffset = (isHoriz) ? h : w;
- return marginPtr->axesOffset;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_LayoutGraph --
- *
- * Calculate the layout of the graph. Based upon the data, axis limits,
- * X and Y titles, and title height, determine the cavity left which is
- * the plotting surface. The first step get the data and axis limits for
- * calculating the space needed for the top, bottom, left, and right
- * margins.
- *
- * 1) The LEFT margin is the area from the left border to the Y axis
- * (not including ticks). It composes the border width, the width an
- * optional Y axis label and its padding, and the tick numeric labels.
- * The Y axis label is rotated 90 degrees so that the width is the
- * font height.
- *
- * 2) The RIGHT margin is the area from the end of the graph
- * to the right window border. It composes the border width,
- * some padding, the font height (this may be dubious. It
- * appears to provide a more even border), the max of the
- * legend width and 1/2 max X tick number. This last part is
- * so that the last tick label is not clipped.
- *
- * Window Width
- * ___________________________________________________________
- * | | | |
- * | | TOP height of title | |
- * | | | |
- * | | x2 title | |
- * | | | |
- * | | height of x2-axis | |
- * |__________|_______________________________|_______________| W
- * | | -plotpady | | i
- * |__________|_______________________________|_______________| n
- * | | top right | | d
- * | | | | o
- * | LEFT | | RIGHT | w
- * | | | |
- * | y | Free area = 104% | y2 | H
- * | | Plotting surface = 100% | | e
- * | t | Tick length = 2 + 2% | t | i
- * | i | | i | g
- * | t | | t legend| h
- * | l | | l width| t
- * | e | | e |
- * | height| |height |
- * | of | | of |
- * | y-axis| |y2-axis |
- * | | | |
- * | |origin 0,0 | |
- * |__________|_left_________________bottom___|_______________|
- * | |-plotpady | |
- * |__________|_______________________________|_______________|
- * | | (xoffset, yoffset) | |
- * | | | |
- * | | height of x-axis | |
- * | | | |
- * | | BOTTOM x title | |
- * |__________|_______________________________|_______________|
- *
- * 3) The TOP margin is the area from the top window border to the top
- * of the graph. It composes the border width, twice the height of
- * the title font (if one is given) and some padding between the
- * title.
- *
- * 4) The BOTTOM margin is area from the bottom window border to the
- * X axis (not including ticks). It composes the border width, the height
- * an optional X axis label and its padding, the height of the font
- * of the tick labels.
- *
- * The plotting area is between the margins which includes the X and Y axes
- * including the ticks but not the tick numeric labels. The length of the
- * ticks and its padding is 5% of the entire plotting area. Hence the entire
- * plotting area is scaled as 105% of the width and height of the area.
- *
- * The axis labels, ticks labels, title, and legend may or may not be
- * displayed which must be taken into account.
- *
- * if reqWidth > 0 : set outer size
- * if reqPlotWidth > 0 : set plot size
- *---------------------------------------------------------------------------
- */
-void
-Blt_LayoutGraph(Graph *graphPtr)
-{
- unsigned int titleY;
- unsigned int left, right, top, bottom;
- unsigned int plotWidth, plotHeight;
- unsigned int inset, inset2;
- int width, height;
- int pad;
-
- width = graphPtr->width;
- height = graphPtr->height;
-
- /*
- * Step 1: Compute the amount of space needed to display the axes
- * associated with each margin. They can be overridden by
- * -leftmargin, -rightmargin, -bottommargin, and -topmargin
- * graph options, respectively.
- */
- left = GetMarginGeometry(graphPtr, &graphPtr->leftMargin);
- right = GetMarginGeometry(graphPtr, &graphPtr->rightMargin);
- top = GetMarginGeometry(graphPtr, &graphPtr->topMargin);
- bottom = GetMarginGeometry(graphPtr, &graphPtr->bottomMargin);
-
- pad = graphPtr->bottomMargin.maxTickWidth;
- if (pad < graphPtr->topMargin.maxTickWidth) {
- pad = graphPtr->topMargin.maxTickWidth;
- }
- pad = pad / 2 + 3;
- if (right < pad) {
- right = pad;
- }
- if (left < pad) {
- left = pad;
- }
- pad = graphPtr->leftMargin.maxTickHeight;
- if (pad < graphPtr->rightMargin.maxTickHeight) {
- pad = graphPtr->rightMargin.maxTickHeight;
- }
- pad = pad / 2;
- if (top < pad) {
- top = pad;
- }
- if (bottom < pad) {
- bottom = pad;
- }
-
- if (graphPtr->leftMargin.reqSize > 0) {
- left = graphPtr->leftMargin.reqSize;
- }
- if (graphPtr->rightMargin.reqSize > 0) {
- right = graphPtr->rightMargin.reqSize;
- }
- if (graphPtr->topMargin.reqSize > 0) {
- top = graphPtr->topMargin.reqSize;
- }
- if (graphPtr->bottomMargin.reqSize > 0) {
- bottom = graphPtr->bottomMargin.reqSize;
- }
-
- /*
- * Step 2: Add the graph title height to the top margin.
- */
- if (graphPtr->title != NULL) {
- top += graphPtr->titleHeight + 6;
- }
- inset = (graphPtr->inset + graphPtr->plotBW);
- inset2 = 2 * inset;
-
- /*
- * Step 3: Estimate the size of the plot area from the remaining
- * space. This may be overridden by the -plotwidth and
- * -plotheight graph options. We use this to compute the
- * size of the legend.
- */
- if (width == 0) {
- width = 400;
- }
- if (height == 0) {
- height = 400;
- }
- plotWidth = (graphPtr->reqPlotWidth > 0) ? graphPtr->reqPlotWidth :
- width - (inset2 + left + right); /* Plot width. */
- plotHeight = (graphPtr->reqPlotHeight > 0) ? graphPtr->reqPlotHeight :
- height - (inset2 + top + bottom); /* Plot height. */
- Blt_MapLegend(graphPtr, plotWidth, plotHeight);
-
- /*
- * Step 2: Add the legend to the appropiate margin.
- */
- if (!Blt_Legend_IsHidden(graphPtr)) {
- switch (Blt_Legend_Site(graphPtr)) {
- case LEGEND_RIGHT:
- right += Blt_Legend_Width(graphPtr) + 2;
- break;
- case LEGEND_LEFT:
- left += Blt_Legend_Width(graphPtr) + 2;
- break;
- case LEGEND_TOP:
- top += Blt_Legend_Height(graphPtr) + 2;
- break;
- case LEGEND_BOTTOM:
- bottom += Blt_Legend_Height(graphPtr) + 2;
- break;
- case LEGEND_XY:
- case LEGEND_PLOT:
- case LEGEND_WINDOW:
- /* Do nothing. */
- break;
- }
- }
-
- /*
- * Recompute the plotarea or graph size, now accounting for the legend.
- */
- if (graphPtr->reqPlotWidth == 0) {
- plotWidth = width - (inset2 + left + right);
- if (plotWidth < 1) {
- plotWidth = 1;
- }
- }
- if (graphPtr->reqPlotHeight == 0) {
- plotHeight = height - (inset2 + top + bottom);
- if (plotHeight < 1) {
- plotHeight = 1;
- }
- }
-
- /*
- * Step 5: If necessary, correct for the requested plot area aspect
- * ratio.
- */
- if ((graphPtr->reqPlotWidth == 0) && (graphPtr->reqPlotHeight == 0) &&
- (graphPtr->aspect > 0.0f)) {
- float ratio;
-
- /*
- * Shrink one dimension of the plotarea to fit the requested
- * width/height aspect ratio.
- */
- ratio = (float)plotWidth / (float)plotHeight;
- if (ratio > graphPtr->aspect) {
- int scaledWidth;
-
- /* Shrink the width. */
- scaledWidth = (int)(plotHeight * graphPtr->aspect);
- if (scaledWidth < 1) {
- scaledWidth = 1;
- }
- /* Add the difference to the right margin. */
- /* CHECK THIS: w = scaledWidth; */
- right += (plotWidth - scaledWidth);
- } else {
- int scaledHeight;
-
- /* Shrink the height. */
- scaledHeight = (int)(plotWidth / graphPtr->aspect);
- if (scaledHeight < 1) {
- scaledHeight = 1;
- }
- /* Add the difference to the top margin. */
- /* CHECK THIS: h = scaledHeight; */
- top += (plotHeight - scaledHeight);
- }
- }
-
- /*
- * Step 6: If there's multiple axes in a margin, the axis titles will be
- * displayed in the adjoining margins. Make sure there's room
- * for the longest axis titles.
- */
-
- if (top < graphPtr->leftMargin.axesTitleLength) {
- top = graphPtr->leftMargin.axesTitleLength;
- }
- if (right < graphPtr->bottomMargin.axesTitleLength) {
- right = graphPtr->bottomMargin.axesTitleLength;
- }
- if (top < graphPtr->rightMargin.axesTitleLength) {
- top = graphPtr->rightMargin.axesTitleLength;
- }
- if (right < graphPtr->topMargin.axesTitleLength) {
- right = graphPtr->topMargin.axesTitleLength;
- }
-
- /*
- * Step 7: Override calculated values with requested margin sizes.
- */
- if (graphPtr->leftMargin.reqSize > 0) {
- left = graphPtr->leftMargin.reqSize;
- }
- if (graphPtr->rightMargin.reqSize > 0) {
- right = graphPtr->rightMargin.reqSize;
- }
- if (graphPtr->topMargin.reqSize > 0) {
- top = graphPtr->topMargin.reqSize;
- }
- if (graphPtr->bottomMargin.reqSize > 0) {
- bottom = graphPtr->bottomMargin.reqSize;
- }
- if (graphPtr->reqPlotWidth > 0) {
- int w;
-
- /*
- * Width of plotarea is constained. If there's extra space, add it to
- * th left and/or right margins. If there's too little, grow the
- * graph width to accomodate it.
- */
- w = plotWidth + inset2 + left + right;
- if (width > w) { /* Extra space in window. */
- int extra;
-
- extra = (width - w) / 2;
- if (graphPtr->leftMargin.reqSize == 0) {
- left += extra;
- if (graphPtr->rightMargin.reqSize == 0) {
- right += extra;
- } else {
- left += extra;
- }
- } else if (graphPtr->rightMargin.reqSize == 0) {
- right += extra + extra;
- }
- } else if (width < w) {
- width = w;
- }
- }
- if (graphPtr->reqPlotHeight > 0) { /* Constrain the plotarea height. */
- int h;
-
- /*
- * Height of plotarea is constained. If there's extra space,
- * add it to th top and/or bottom margins. If there's too little,
- * grow the graph height to accomodate it.
- */
- h = plotHeight + inset2 + top + bottom;
- if (height > h) { /* Extra space in window. */
- int extra;
-
- extra = (height - h) / 2;
- if (graphPtr->topMargin.reqSize == 0) {
- top += extra;
- if (graphPtr->bottomMargin.reqSize == 0) {
- bottom += extra;
- } else {
- top += extra;
- }
- } else if (graphPtr->bottomMargin.reqSize == 0) {
- bottom += extra + extra;
- }
- } else if (height < h) {
- height = h;
- }
- }
- graphPtr->width = width;
- graphPtr->height = height;
- graphPtr->left = left + inset;
- graphPtr->top = top + inset;
- graphPtr->right = width - right - inset;
- graphPtr->bottom = height - bottom - inset;
-
- graphPtr->leftMargin.width = left + graphPtr->inset;
- graphPtr->rightMargin.width = right + graphPtr->inset;
- graphPtr->topMargin.height = top + graphPtr->inset;
- graphPtr->bottomMargin.height = bottom + graphPtr->inset;
-
- graphPtr->vOffset = graphPtr->top + graphPtr->padTop;
- graphPtr->vRange = plotHeight - PADDING(graphPtr->yPad);
- graphPtr->hOffset = graphPtr->left + graphPtr->padLeft;
- graphPtr->hRange = plotWidth - PADDING(graphPtr->xPad);
-
- if (graphPtr->vRange < 1) {
- graphPtr->vRange = 1;
- }
- if (graphPtr->hRange < 1) {
- graphPtr->hRange = 1;
- }
- graphPtr->hScale = 1.0f / (float)graphPtr->hRange;
- graphPtr->vScale = 1.0f / (float)graphPtr->vRange;
-
- /*
- * Calculate the placement of the graph title so it is centered within the
- * space provided for it in the top margin
- */
- titleY = graphPtr->titleHeight;
- graphPtr->titleY = 3 + graphPtr->inset;
- graphPtr->titleX = (graphPtr->right + graphPtr->left) / 2;
-
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureAxis --
- *
- * Configures axis attributes (font, line width, label, etc).
- *
- * Results:
- * The return value is a standard TCL result.
- *
- * Side Effects:
- * Axis layout is deferred until the height and width of the window are
- * known.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureAxis(Axis *axisPtr)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
- float angle;
-
- /* Check the requested axis limits. Can't allow -min to be greater than
- * -max. Do this regardless of -checklimits option. We want to always
- * detect when the user has zoomed in beyond the precision of the data.*/
- if (((DEFINED(axisPtr->reqMin)) && (DEFINED(axisPtr->reqMax))) &&
- (axisPtr->reqMin >= axisPtr->reqMax)) {
- char msg[200];
- sprintf_s(msg, 200,
- "impossible axis limits (-min %g >= -max %g) for \"%s\"",
- axisPtr->reqMin, axisPtr->reqMax, axisPtr->obj.name);
- Tcl_AppendResult(graphPtr->interp, msg, (char *)NULL);
- return TCL_ERROR;
- }
- axisPtr->scrollMin = axisPtr->reqScrollMin;
- axisPtr->scrollMax = axisPtr->reqScrollMax;
- if (axisPtr->logScale) {
- if (axisPtr->flags & AXIS_CHECK_LIMITS) {
- /* Check that the logscale limits are positive. */
- if ((DEFINED(axisPtr->reqMin)) && (axisPtr->reqMin <= 0.0)) {
- Tcl_AppendResult(graphPtr->interp,"bad logscale -min limit \"",
- Blt_Dtoa(graphPtr->interp, axisPtr->reqMin),
- "\" for axis \"", axisPtr->obj.name, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- }
- if ((DEFINED(axisPtr->scrollMin)) && (axisPtr->scrollMin <= 0.0)) {
- axisPtr->scrollMin = Blt_NaN();
- }
- if ((DEFINED(axisPtr->scrollMax)) && (axisPtr->scrollMax <= 0.0)) {
- axisPtr->scrollMax = Blt_NaN();
- }
- }
- angle = FMOD(axisPtr->tickAngle, 360.0);
- if (angle < 0.0f) {
- angle += 360.0f;
- }
- if (axisPtr->normalBg != NULL) {
- Blt_SetBackgroundChangedProc(axisPtr->normalBg, Blt_UpdateGraph,
- graphPtr);
- }
- if (axisPtr->activeBg != NULL) {
- Blt_SetBackgroundChangedProc(axisPtr->activeBg, Blt_UpdateGraph,
- graphPtr);
- }
- axisPtr->tickAngle = angle;
- ResetTextStyles(axisPtr);
-
- axisPtr->titleWidth = axisPtr->titleHeight = 0;
- if (axisPtr->title != NULL) {
- unsigned int w, h;
-
- Blt_GetTextExtents(axisPtr->titleFont, 0, axisPtr->title, -1, &w, &h);
- axisPtr->titleWidth = (unsigned short int)w;
- axisPtr->titleHeight = (unsigned short int)h;
- }
-
- /*
- * Don't bother to check what configuration options have changed. Almost
- * every option changes the size of the plotting area (except for -color
- * and -titlecolor), requiring the graph and its contents to be completely
- * redrawn.
- *
- * Recompute the scale and offset of the axis in case -min, -max options
- * have changed.
- */
- graphPtr->flags |= REDRAW_WORLD;
- graphPtr->flags |= MAP_WORLD | RESET_AXES | CACHE_DIRTY;
- axisPtr->flags |= DIRTY;
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewAxis --
- *
- * Create and initialize a structure containing information to display
- * a graph axis.
- *
- * Results:
- * The return value is a pointer to an Axis structure.
- *
- *---------------------------------------------------------------------------
- */
-static Axis *
-NewAxis(Graph *graphPtr, const char *name, int margin)
-{
- Axis *axisPtr;
- Blt_HashEntry *hPtr;
- int isNew;
-
- if (name[0] == '-') {
- Tcl_AppendResult(graphPtr->interp, "name of axis \"", name,
- "\" can't start with a '-'", (char *)NULL);
- return NULL;
- }
- hPtr = Blt_CreateHashEntry(&graphPtr->axes.table, name, &isNew);
- if (!isNew) {
- axisPtr = Blt_GetHashValue(hPtr);
- if ((axisPtr->flags & DELETE_PENDING) == 0) {
- Tcl_AppendResult(graphPtr->interp, "axis \"", name,
- "\" already exists in \"", Tk_PathName(graphPtr->tkwin), "\"",
- (char *)NULL);
- return NULL;
- }
- axisPtr->flags &= ~DELETE_PENDING;
- } else {
- axisPtr = Blt_Calloc(1, sizeof(Axis));
- if (axisPtr == NULL) {
- Tcl_AppendResult(graphPtr->interp,
- "can't allocate memory for axis \"", name, "\"", (char *)NULL);
- return NULL;
- }
- axisPtr->obj.name = Blt_AssertStrdup(name);
- axisPtr->hashPtr = hPtr;
- Blt_GraphSetObjectClass(&axisPtr->obj, CID_NONE);
- axisPtr->obj.graphPtr = graphPtr;
- axisPtr->looseMin = axisPtr->looseMax = AXIS_TIGHT;
- axisPtr->reqNumMinorTicks = 2;
- axisPtr->reqNumMajorTicks = 4 /*10*/;
- axisPtr->margin = MARGIN_NONE;
- axisPtr->tickLength = 8;
- axisPtr->scrollUnits = 10;
- axisPtr->reqMin = axisPtr->reqMax = Blt_NaN();
- axisPtr->reqScrollMin = axisPtr->reqScrollMax = Blt_NaN();
- axisPtr->flags = (AXIS_SHOWTICKS|AXIS_GRIDMINOR|AXIS_AUTO_MAJOR|
- AXIS_AUTO_MINOR | AXIS_EXTERIOR);
- if (graphPtr->classId == CID_ELEM_BAR) {
- axisPtr->flags |= AXIS_GRID;
- }
- if ((graphPtr->classId == CID_ELEM_BAR) &&
- ((margin == MARGIN_TOP) || (margin == MARGIN_BOTTOM))) {
- axisPtr->reqStep = 1.0;
- axisPtr->reqNumMinorTicks = 0;
- }
- if ((margin == MARGIN_RIGHT) || (margin == MARGIN_TOP)) {
- axisPtr->flags |= HIDE;
- }
- Blt_Ts_InitStyle(axisPtr->limitsTextStyle);
- axisPtr->tickLabels = Blt_Chain_Create();
- axisPtr->lineWidth = 1;
- Blt_SetHashValue(hPtr, axisPtr);
- }
- return axisPtr;
-}
-
-static int
-GetAxisFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr,
- Axis **axisPtrPtr)
-{
- Blt_HashEntry *hPtr;
- const char *name;
-
- *axisPtrPtr = NULL;
- name = Tcl_GetString(objPtr);
- hPtr = Blt_FindHashEntry(&graphPtr->axes.table, name);
- if (hPtr != NULL) {
- Axis *axisPtr;
-
- axisPtr = Blt_GetHashValue(hPtr);
- if ((axisPtr->flags & DELETE_PENDING) == 0) {
- *axisPtrPtr = axisPtr;
- return TCL_OK;
- }
- }
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find axis \"", name, "\" in \"",
- Tk_PathName(graphPtr->tkwin), "\"", (char *)NULL);
- }
- return TCL_ERROR;
-}
-
-static int
-GetAxisByClass(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr,
- ClassId classId, Axis **axisPtrPtr)
-{
- Axis *axisPtr;
-
- if (GetAxisFromObj(interp, graphPtr, objPtr, &axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (classId != CID_NONE) {
- if ((axisPtr->refCount == 0) || (axisPtr->obj.classId == CID_NONE)) {
- /* Set the axis type on the first use of it. */
- Blt_GraphSetObjectClass(&axisPtr->obj, classId);
- } else if (axisPtr->obj.classId != classId) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "axis \"", Tcl_GetString(objPtr),
- "\" is already in use on an opposite ",
- axisPtr->obj.className, "-axis",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- axisPtr->refCount++;
- }
- *axisPtrPtr = axisPtr;
- return TCL_OK;
-}
-
-void
-Blt_DestroyAxes(Graph *graphPtr)
-{
- {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->axes.table, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Axis *axisPtr;
-
- axisPtr = Blt_GetHashValue(hPtr);
- axisPtr->hashPtr = NULL;
- DestroyAxis(axisPtr);
- }
- }
- Blt_DeleteHashTable(&graphPtr->axes.table);
- {
- int i;
-
- for (i = 0; i < 4; i++) {
- Blt_Chain_Destroy(graphPtr->axisChain[i]);
- }
- }
- Blt_DeleteHashTable(&graphPtr->axes.tagTable);
- Blt_Chain_Destroy(graphPtr->axes.displayList);
-}
-
-void
-Blt_ConfigureAxes(Graph *graphPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->axes.table, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Axis *axisPtr;
-
- axisPtr = Blt_GetHashValue(hPtr);
- ConfigureAxis(axisPtr);
- }
-}
-
-int
-Blt_DefaultAxes(Graph *graphPtr)
-{
- int i;
- int flags;
-
- flags = Blt_GraphType(graphPtr);
- for (i = 0; i < 4; i++) {
- Blt_Chain chain;
- Axis *axisPtr;
-
- chain = Blt_Chain_Create();
- graphPtr->axisChain[i] = chain;
-
- /* Create a default axis for each chain. */
- axisPtr = NewAxis(graphPtr, axisNames[i].name, i);
- if (axisPtr == NULL) {
- return TCL_ERROR;
- }
- axisPtr->refCount = 1; /* Default axes are assumed in use. */
- axisPtr->margin = i;
- axisPtr->flags |= AXIS_USE;
- Blt_GraphSetObjectClass(&axisPtr->obj, axisNames[i].classId);
- /*
- * Blt_ConfigureComponentFromObj creates a temporary child window
- * by the name of the axis. It's used so that the Tk routines
- * that access the X resource database can describe a single
- * component and not the entire graph.
- */
- if (Blt_ConfigureComponentFromObj(graphPtr->interp, graphPtr->tkwin,
- axisPtr->obj.name, "Axis", configSpecs, 0, (Tcl_Obj **)NULL,
- (char *)axisPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- if (ConfigureAxis(axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- axisPtr->link = Blt_Chain_Append(chain, axisPtr);
- axisPtr->chain = chain;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateOp --
- *
- * Activates the axis, drawing the axis with its -activeforeground,
- * -activebackgound, -activerelief attributes.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new axis attributes.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ActivateOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
- const char *string;
-
- string = Tcl_GetString(objv[2]);
- if (string[0] == 'a') {
- axisPtr->flags |= ACTIVE;
- } else {
- axisPtr->flags &= ~ACTIVE;
- }
- if ((axisPtr->flags & (AXIS_USE|HIDE)) == AXIS_USE) {
- graphPtr->flags |= DRAW_MARGINS | CACHE_DIRTY;
- Blt_EventuallyRedrawGraph(graphPtr);
- }
- return TCL_OK;
-}
-
-/*-------------------------------------------------------------------------------
- *
- * BindOp --
- *
- * .g axis bind axisName sequence command
- *
- *---------------------------------------------------------------------------
- */
-static int
-BindOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
-
- return Blt_ConfigureBindingsFromObj(interp, graphPtr->bindTable,
- Blt_MakeAxisTag(graphPtr, axisPtr->obj.name), objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Queries axis attributes (font, line width, label, etc).
- *
- * Results:
- * Return value is a standard TCL result. If querying configuration
- * values, interp->result will contain the results.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-CgetOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
-
- return Blt_ConfigureValueFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)axisPtr, objv[0], Blt_GraphType(graphPtr));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Queries or resets axis attributes (font, line width, label, etc).
- *
- * Results:
- * Return value is a standard TCL result. If querying configuration
- * values, interp->result will contain the results.
- *
- * Side Effects:
- * Axis resources are possibly allocated (GC, font). Axis layout is
- * deferred until the height and width of the window are known.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
- int flags;
-
- flags = BLT_CONFIG_OBJV_ONLY | Blt_GraphType(graphPtr);
- if (objc == 0) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)axisPtr, (Tcl_Obj *)NULL, flags);
- } else if (objc == 1) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)axisPtr, objv[0], flags);
- }
- if (Blt_ConfigureWidgetFromObj(interp, graphPtr->tkwin, configSpecs,
- objc, objv, (char *)axisPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- if (ConfigureAxis(axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (axisPtr->flags & AXIS_USE) {
- if (!Blt_ConfigModified(configSpecs, "-*color", "-background", "-bg",
- (char *)NULL)) {
- graphPtr->flags |= CACHE_DIRTY;
- }
- Blt_EventuallyRedrawGraph(graphPtr);
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * LimitsOp --
- *
- * This procedure returns a string representing the axis limits
- * of the graph. The format of the string is { left top right bottom}.
- *
- * Results:
- * Always returns TCL_OK. The interp->result field is
- * a list of the graph axis limits.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-LimitsOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
- Tcl_Obj *listObjPtr;
- double min, max;
-
- if (graphPtr->flags & RESET_AXES) {
- Blt_ResetAxes(graphPtr);
- }
- if (axisPtr->logScale) {
- min = EXP10(axisPtr->axisRange.min);
- max = EXP10(axisPtr->axisRange.max);
- } else {
- min = axisPtr->axisRange.min;
- max = axisPtr->axisRange.max;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(min));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(max));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InvTransformOp --
- *
- * Maps the given window coordinate into an axis-value.
- *
- * Results:
- * Returns a standard TCL result. interp->result contains
- * the axis value. If an error occurred, TCL_ERROR is returned
- * and interp->result will contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InvTransformOp(Tcl_Interp *interp, Axis *axisPtr, int objc,
- Tcl_Obj *const *objv)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
- double y; /* Real graph coordinate */
- int sy; /* Integer window coordinate*/
-
- if (graphPtr->flags & RESET_AXES) {
- Blt_ResetAxes(graphPtr);
- }
- if (Tcl_GetIntFromObj(interp, objv[0], &sy) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Is the axis vertical or horizontal?
- *
- * Check the site where the axis was positioned. If the axis is
- * virtual, all we have to go on is how it was mapped to an
- * element (using either -mapx or -mapy options).
- */
- if (AxisIsHorizontal(axisPtr)) {
- y = Blt_InvHMap(axisPtr, (double)sy);
- } else {
- y = Blt_InvVMap(axisPtr, (double)sy);
- }
- Tcl_SetDoubleObj(Tcl_GetObjResult(interp), y);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * MarginOp --
- *
- * This procedure returns a string representing the margin the axis
- * resides. The format of the string is { left top right bottom}.
- *
- * Results:
- * Always returns TCL_OK. The interp->result field is
- * a list of the graph axis limits.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-MarginOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv)
-{
- const char *marginName;
-
- marginName = "";
- if (axisPtr->flags & AXIS_USE) {
- marginName = axisNames[axisPtr->margin].name;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), marginName, -1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TransformOp --
- *
- * Maps the given axis-value to a window coordinate.
- *
- * Results:
- * Returns a standard TCL result. interp->result contains
- * the window coordinate. If an error occurred, TCL_ERROR
- * is returned and interp->result will contain an error
- * message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TransformOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv)
-{
- Graph *graphPtr = axisPtr->obj.graphPtr;
- double x;
-
- if (graphPtr->flags & RESET_AXES) {
- Blt_ResetAxes(graphPtr);
- }
- if (Blt_ExprDoubleFromObj(interp, objv[0], &x) != TCL_OK) {
- return TCL_ERROR;
- }
- if (AxisIsHorizontal(axisPtr)) {
- x = Blt_HMap(axisPtr, x);
- } else {
- x = Blt_VMap(axisPtr, x);
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), (int)x);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TypeOp --
- *
- * This procedure returns a string representing the margin the axis
- * resides. The format of the string is "x", "y", or "".
- *
- * Results:
- * Always returns TCL_OK. The interp->result field is the type of
- * axis.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TypeOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv)
-{
- const char *typeName;
-
- typeName = "";
- if (axisPtr->flags & AXIS_USE) {
- if (axisNames[axisPtr->margin].classId == CID_AXIS_X) {
- typeName = "x";
- } else if (axisNames[axisPtr->margin].classId == CID_AXIS_Y) {
- typeName = "y";
- }
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), typeName, -1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UseOp --
- *
- * Sets the default axis for a margin.
- *
- * Results:
- * A standard TCL result. If the named axis doesn't exist
- * an error message is put in interp->result.
- *
- * .g xaxis use "abc def gah"
- * .g xaxis use [lappend abc [.g axis use]]
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-UseOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv)
-{
- Graph *graphPtr = (Graph *)axisPtr;
- Blt_Chain chain;
- Blt_ChainLink link;
- Tcl_Obj **axisObjv;
- ClassId classId;
- int axisObjc;
- int i;
-
- chain = graphPtr->margins[lastMargin].axes;
- if (objc == 0) {
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Axis *axisPtr;
-
- axisPtr = Blt_Chain_GetValue(link);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(axisPtr->obj.name, -1));
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if ((lastMargin == MARGIN_BOTTOM) || (lastMargin == MARGIN_TOP)) {
- classId = (graphPtr->inverted) ? CID_AXIS_Y : CID_AXIS_X;
- } else {
- classId = (graphPtr->inverted) ? CID_AXIS_X : CID_AXIS_Y;
- }
- if (Tcl_ListObjGetElements(interp, objv[0], &axisObjc, &axisObjv)
- != TCL_OK) {
- return TCL_ERROR;
- }
- for (link = Blt_Chain_FirstLink(chain); link!= NULL;
- link = Blt_Chain_NextLink(link)) {
- Axis *axisPtr;
-
- axisPtr = Blt_Chain_GetValue(link);
- axisPtr->link = NULL;
- axisPtr->flags &= ~AXIS_USE;
- /* Clear the axis type if it's not currently used.*/
- if (axisPtr->refCount == 0) {
- Blt_GraphSetObjectClass(&axisPtr->obj, CID_NONE);
- }
- }
- Blt_Chain_Reset(chain);
- for (i = 0; i < axisObjc; i++) {
- Axis *axisPtr;
-
- if (GetAxisFromObj(interp, graphPtr, axisObjv[i], &axisPtr) != TCL_OK){
- return TCL_ERROR;
- }
- if (axisPtr->obj.classId == CID_NONE) {
- Blt_GraphSetObjectClass(&axisPtr->obj, classId);
- } else if (axisPtr->obj.classId != classId) {
- Tcl_AppendResult(interp, "wrong type axis \"",
- axisPtr->obj.name, "\": can't use ",
- axisPtr->obj.className, " type axis.", (char *)NULL);
- return TCL_ERROR;
- }
- if (axisPtr->link != NULL) {
- /* Move the axis from the old margin's "use" list to the new. */
- Blt_Chain_UnlinkLink(axisPtr->chain, axisPtr->link);
- Blt_Chain_AppendLink(chain, axisPtr->link);
- } else {
- axisPtr->link = Blt_Chain_Append(chain, axisPtr);
- }
- axisPtr->chain = chain;
- axisPtr->flags |= AXIS_USE;
- }
- graphPtr->flags |= (GET_AXIS_GEOMETRY | LAYOUT_NEEDED | RESET_AXES);
- /* When any axis changes, we need to layout the entire graph. */
- graphPtr->flags |= (MAP_WORLD | REDRAW_WORLD);
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-static int
-ViewOp(Tcl_Interp *interp, Axis *axisPtr, int objc, Tcl_Obj *const *objv)
-{
- Graph *graphPtr;
- double axisOffset, axisScale;
- double fract;
- double viewMin, viewMax, worldMin, worldMax;
- double viewWidth, worldWidth;
-
- graphPtr = axisPtr->obj.graphPtr;
- worldMin = axisPtr->valueRange.min;
- worldMax = axisPtr->valueRange.max;
- /* Override data dimensions with user-selected limits. */
- if (DEFINED(axisPtr->scrollMin)) {
- worldMin = axisPtr->scrollMin;
- }
- if (DEFINED(axisPtr->scrollMax)) {
- worldMax = axisPtr->scrollMax;
- }
- viewMin = axisPtr->min;
- viewMax = axisPtr->max;
- /* Bound the view within scroll region. */
- if (viewMin < worldMin) {
- viewMin = worldMin;
- }
- if (viewMax > worldMax) {
- viewMax = worldMax;
- }
- if (axisPtr->logScale) {
- worldMin = log10(worldMin);
- worldMax = log10(worldMax);
- viewMin = log10(viewMin);
- viewMax = log10(viewMax);
- }
- worldWidth = worldMax - worldMin;
- viewWidth = viewMax - viewMin;
-
- /* Unlike horizontal axes, vertical axis values run opposite of the
- * scrollbar first/last values. So instead of pushing the axis minimum
- * around, we move the maximum instead. */
- if (AxisIsHorizontal(axisPtr) != axisPtr->descending) {
- axisOffset = viewMin - worldMin;
- axisScale = graphPtr->hScale;
- } else {
- axisOffset = worldMax - viewMax;
- axisScale = graphPtr->vScale;
- }
- if (objc == 4) {
- Tcl_Obj *listObjPtr;
- double first, last;
-
- first = Clamp(axisOffset / worldWidth);
- last = Clamp((axisOffset + viewWidth) / worldWidth);
- listObjPtr = Tcl_NewListObj(0, NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(first));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(last));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- fract = axisOffset / worldWidth;
- if (GetAxisScrollInfo(interp, objc, objv, &fract,
- viewWidth / worldWidth, axisPtr->scrollUnits, axisScale) != TCL_OK) {
- return TCL_ERROR;
- }
- if (AxisIsHorizontal(axisPtr) != axisPtr->descending) {
- axisPtr->reqMin = (fract * worldWidth) + worldMin;
- axisPtr->reqMax = axisPtr->reqMin + viewWidth;
- } else {
- axisPtr->reqMax = worldMax - (fract * worldWidth);
- axisPtr->reqMin = axisPtr->reqMax - viewWidth;
- }
- if (axisPtr->logScale) {
- axisPtr->reqMin = EXP10(axisPtr->reqMin);
- axisPtr->reqMax = EXP10(axisPtr->reqMax);
- }
- graphPtr->flags |= (GET_AXIS_GEOMETRY | LAYOUT_NEEDED | RESET_AXES);
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisCreateOp --
- *
- * Creates a new axis.
- *
- * Results:
- * Returns a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-AxisCreateOp(Tcl_Interp *interp, Graph *graphPtr, int objc,
- Tcl_Obj *const *objv)
-{
- Axis *axisPtr;
- int flags;
-
- axisPtr = NewAxis(graphPtr, Tcl_GetString(objv[3]), MARGIN_NONE);
- if (axisPtr == NULL) {
- return TCL_ERROR;
- }
- flags = Blt_GraphType(graphPtr);
- if ((Blt_ConfigureComponentFromObj(interp, graphPtr->tkwin,
- axisPtr->obj.name, "Axis", configSpecs, objc - 4, objv + 4,
- (char *)axisPtr, flags) != TCL_OK) ||
- (ConfigureAxis(axisPtr) != TCL_OK)) {
- DestroyAxis(axisPtr);
- return TCL_ERROR;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), axisPtr->obj.name, -1);
- return TCL_OK;
-}
-/*
- *---------------------------------------------------------------------------
- *
- * AxisActivateOp --
- *
- * Activates the axis, drawing the axis with its -activeforeground,
- * -activebackgound, -activerelief attributes.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new axis attributes.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AxisActivateOp(Tcl_Interp *interp, Graph *graphPtr, int objc,
- Tcl_Obj *const *objv)
-{
- Axis *axisPtr;
-
- if (GetAxisFromObj(interp, graphPtr, objv[3], &axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return ActivateOp(interp, axisPtr, objc, objv);
-}
-
-
-/*-------------------------------------------------------------------------------
- *
- * AxisBindOp --
- *
- * .g axis bind axisName sequence command
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-AxisBindOp(Tcl_Interp *interp, Graph *graphPtr, int objc,
- Tcl_Obj *const *objv)
-{
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&graphPtr->axes.tagTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- const char *tagName;
- Tcl_Obj *objPtr;
-
- tagName = Blt_GetHashKey(&graphPtr->axes.tagTable, hPtr);
- objPtr = Tcl_NewStringObj(tagName, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- return Blt_ConfigureBindingsFromObj(interp, graphPtr->bindTable,
- Blt_MakeAxisTag(graphPtr, Tcl_GetString(objv[3])), objc - 4, objv + 4);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisCgetOp --
- *
- * Queries axis attributes (font, line width, label, etc).
- *
- * Results:
- * Return value is a standard TCL result. If querying configuration
- * values, interp->result will contain the results.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-AxisCgetOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv)
-{
- Axis *axisPtr;
-
- if (GetAxisFromObj(interp, graphPtr, objv[3], &axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return CgetOp(interp, axisPtr, objc - 4, objv + 4);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisConfigureOp --
- *
- * Queries or resets axis attributes (font, line width, label, etc).
- *
- * Results:
- * Return value is a standard TCL result. If querying configuration
- * values, interp->result will contain the results.
- *
- * Side Effects:
- * Axis resources are possibly allocated (GC, font). Axis layout is
- * deferred until the height and width of the window are known.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AxisConfigureOp(Tcl_Interp *interp, Graph *graphPtr, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_Obj *const *options;
- int i;
- int nNames, nOpts;
-
- /* Figure out where the option value pairs begin */
- objc -= 3;
- objv += 3;
- for (i = 0; i < objc; i++) {
- Axis *axisPtr;
- const char *string;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] == '-') {
- break;
- }
- if (GetAxisFromObj(interp, graphPtr, objv[i], &axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- nNames = i; /* Number of pen names specified */
- nOpts = objc - i; /* Number of options specified */
- options = objv + i; /* Start of options in objv */
-
- for (i = 0; i < nNames; i++) {
- Axis *axisPtr;
-
- if (GetAxisFromObj(interp, graphPtr, objv[i], &axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (ConfigureOp(interp, axisPtr, nOpts, options) != TCL_OK) {
- break;
- }
- }
- if (i < nNames) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisDeleteOp --
- *
- * Deletes one or more axes. The actual removal may be deferred until the
- * axis is no longer used by any element. The axis can't be referenced by
- * its name any longer and it may be recreated.
- *
- * Results:
- * Returns a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-AxisDeleteOp(Tcl_Interp *interp, Graph *graphPtr, int objc,
- Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- Axis *axisPtr;
-
- if (GetAxisFromObj(interp, graphPtr, objv[i], &axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- axisPtr->flags |= DELETE_PENDING;
- if (axisPtr->refCount == 0) {
- Tcl_EventuallyFree(axisPtr, FreeAxis);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisFocusOp --
- *
- * Activates the axis, drawing the axis with its -activeforeground,
- * -activebackgound, -activerelief attributes.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new axis attributes.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AxisFocusOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv)
-{
- if (objc > 3) {
- Axis *axisPtr;
- const char *string;
-
- axisPtr = NULL;
- string = Tcl_GetString(objv[3]);
- if ((string[0] != '\0') &&
- (GetAxisFromObj(interp, graphPtr, objv[3], &axisPtr) != TCL_OK)) {
- return TCL_ERROR;
- }
- graphPtr->focusPtr = NULL;
- if ((axisPtr != NULL) &&
- ((axisPtr->flags & (AXIS_USE|HIDE)) == AXIS_USE)) {
- graphPtr->focusPtr = axisPtr;
- }
- Blt_SetFocusItem(graphPtr->bindTable, graphPtr->focusPtr, NULL);
- }
- /* Return the name of the axis that has focus. */
- if (graphPtr->focusPtr != NULL) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- graphPtr->focusPtr->obj.name, -1);
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisGetOp --
- *
- * Returns the name of the picked axis (using the axis bind operation).
- * Right now, the only name accepted is "current".
- *
- * Results:
- * A standard TCL result. The interpreter result will contain the name of
- * the axis.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-AxisGetOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv)
-{
- Axis *axisPtr;
-
- axisPtr = Blt_GetCurrentItem(graphPtr->bindTable);
- /* Report only on axes. */
- if ((axisPtr != NULL) &&
- ((axisPtr->obj.classId == CID_AXIS_X) ||
- (axisPtr->obj.classId == CID_AXIS_Y) ||
- (axisPtr->obj.classId == CID_NONE))) {
- char c;
- char *string;
-
- string = Tcl_GetString(objv[3]);
- c = string[0];
- if ((c == 'c') && (strcmp(string, "current") == 0)) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), axisPtr->obj.name,-1);
- } else if ((c == 'd') && (strcmp(string, "detail") == 0)) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), axisPtr->detail, -1);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisInvTransformOp --
- *
- * Maps the given window coordinate into an axis-value.
- *
- * Results:
- * Returns a standard TCL result. interp->result contains
- * the axis value. If an error occurred, TCL_ERROR is returned
- * and interp->result will contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AxisInvTransformOp(Tcl_Interp *interp, Graph *graphPtr, int objc,
- Tcl_Obj *const *objv)
-{
- Axis *axisPtr;
-
- if (GetAxisFromObj(interp, graphPtr, objv[3], &axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return InvTransformOp(interp, axisPtr, objc - 4, objv + 4);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisLimitsOp --
- *
- * This procedure returns a string representing the axis limits of the
- * graph. The format of the string is { left top right bottom}.
- *
- * Results:
- * Always returns TCL_OK. The interp->result field is
- * a list of the graph axis limits.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AxisLimitsOp(Tcl_Interp *interp, Graph *graphPtr, int objc,
- Tcl_Obj *const *objv)
-{
- Axis *axisPtr;
-
- if (GetAxisFromObj(interp, graphPtr, objv[3], &axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return LimitsOp(interp, axisPtr, objc - 4, objv + 4);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisMarginOp --
- *
- * This procedure returns a string representing the axis limits of the
- * graph. The format of the string is { left top right bottom}.
- *
- * Results:
- * Always returns TCL_OK. The interp->result field is
- * a list of the graph axis limits.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AxisMarginOp(Tcl_Interp *interp, Graph *graphPtr, int objc,
- Tcl_Obj *const *objv)
-{
- Axis *axisPtr;
-
- if (GetAxisFromObj(interp, graphPtr, objv[3], &axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return MarginOp(interp, axisPtr, objc - 4, objv + 4);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisNamesOp --
- *
- * Return a list of the names of all the axes.
- *
- * Results:
- * Returns a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-
-/*ARGSUSED*/
-static int
-AxisNamesOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->axes.table, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Axis *axisPtr;
-
- axisPtr = Blt_GetHashValue(hPtr);
- if (axisPtr->flags & DELETE_PENDING) {
- continue;
- }
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(axisPtr->obj.name, -1));
- }
- } else {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->axes.table, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Axis *axisPtr;
- int i;
-
- axisPtr = Blt_GetHashValue(hPtr);
- for (i = 3; i < objc; i++) {
- const char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- if (Tcl_StringMatch(axisPtr->obj.name, pattern)) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(axisPtr->obj.name, -1));
- break;
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisTransformOp --
- *
- * Maps the given axis-value to a window coordinate.
- *
- * Results:
- * Returns the window coordinate via interp->result. If an error occurred,
- * TCL_ERROR is returned and interp->result will contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AxisTransformOp(Tcl_Interp *interp, Graph *graphPtr, int objc,
- Tcl_Obj *const *objv)
-{
- Axis *axisPtr;
-
- if (GetAxisFromObj(interp, graphPtr, objv[3], &axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TransformOp(interp, axisPtr, objc - 4, objv + 4);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisMarginOp --
- *
- * This procedure returns a string representing the axis limits of the
- * graph. The format of the string is { left top right bottom}.
- *
- * Results:
- * Always returns TCL_OK. The interp->result field is
- * a list of the graph axis limits.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AxisTypeOp(Tcl_Interp *interp, Graph *graphPtr, int objc,
- Tcl_Obj *const *objv)
-{
- Axis *axisPtr;
-
- if (GetAxisFromObj(interp, graphPtr, objv[3], &axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TypeOp(interp, axisPtr, objc - 4, objv + 4);
-}
-
-
-static int
-AxisViewOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv)
-{
- Axis *axisPtr;
-
- if (GetAxisFromObj(interp, graphPtr, objv[3], &axisPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return ViewOp(interp, axisPtr, objc - 4, objv + 4);
-}
-
-static Blt_OpSpec virtAxisOps[] = {
- {"activate", 1, AxisActivateOp, 4, 4, "axisName"},
- {"bind", 1, AxisBindOp, 3, 6, "axisName sequence command"},
- {"cget", 2, AxisCgetOp, 5, 5, "axisName option"},
- {"configure", 2, AxisConfigureOp, 4, 0, "axisName ?axisName?... "
- "?option value?..."},
- {"create", 2, AxisCreateOp, 4, 0, "axisName ?option value?..."},
- {"deactivate", 3, AxisActivateOp, 4, 4, "axisName"},
- {"delete", 3, AxisDeleteOp, 3, 0, "?axisName?..."},
- {"focus", 1, AxisFocusOp, 3, 4, "?axisName?"},
- {"get", 1, AxisGetOp, 4, 4, "name"},
- {"invtransform", 1, AxisInvTransformOp, 5, 5, "axisName value"},
- {"limits", 1, AxisLimitsOp, 4, 4, "axisName"},
- {"margin", 1, AxisMarginOp, 4, 4, "axisName"},
- {"names", 1, AxisNamesOp, 3, 0, "?pattern?..."},
- {"transform", 2, AxisTransformOp, 5, 5, "axisName value"},
- {"type", 2, AxisTypeOp, 4, 4, "axisName"},
- {"view", 1, AxisViewOp, 4, 7, "axisName ?moveto fract? "
- "?scroll number what?"},
-};
-static int nVirtAxisOps = sizeof(virtAxisOps) / sizeof(Blt_OpSpec);
-
-int
-Blt_VirtualAxisOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- GraphVirtualAxisProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nVirtAxisOps, virtAxisOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (interp, graphPtr, objc, objv);
- return result;
-}
-
-static Blt_OpSpec axisOps[] = {
- {"activate", 1, ActivateOp, 3, 3, "",},
- {"bind", 1, BindOp, 2, 5, "sequence command",},
- {"cget", 2, CgetOp, 4, 4, "option",},
- {"configure", 2, ConfigureOp, 3, 0, "?option value?...",},
- {"deactivate", 1, ActivateOp, 3, 3, "",},
- {"invtransform", 1, InvTransformOp, 4, 4, "value",},
- {"limits", 1, LimitsOp, 3, 3, "",},
- {"transform", 1, TransformOp, 4, 4, "value",},
- {"use", 1, UseOp, 3, 4, "?axisName?",},
- {"view", 1, ViewOp, 3, 6, "?moveto fract? ",},
-};
-
-static int nAxisOps = sizeof(axisOps) / sizeof(Blt_OpSpec);
-
-int
-Blt_AxisOp(Tcl_Interp *interp, Graph *graphPtr, int margin, int objc,
- Tcl_Obj *const *objv)
-{
- int result;
- GraphAxisProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nAxisOps, axisOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- if (proc == UseOp) {
- lastMargin = margin; /* Set global variable to the margin
- * in the argument list. Needed only
- * for UseOp. */
- result = (*proc)(interp, (Axis *)graphPtr, objc - 3, objv + 3);
- } else {
- Axis *axisPtr;
-
- axisPtr = Blt_GetFirstAxis(graphPtr->margins[margin].axes);
- if (axisPtr == NULL) {
- return TCL_OK;
- }
- result = (*proc)(interp, axisPtr, objc - 3, objv + 3);
- }
- return result;
-}
-
-void
-Blt_MapAxes(Graph *graphPtr)
-{
- int margin;
-
- for (margin = 0; margin < 4; margin++) {
- Blt_Chain chain;
- Blt_ChainLink link;
- int count, offset;
-
- chain = graphPtr->margins[margin].axes;
- count = offset = 0;
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Axis *axisPtr;
-
- axisPtr = Blt_Chain_GetValue(link);
- if ((axisPtr->flags & (AXIS_USE|DELETE_PENDING)) != AXIS_USE) {
- continue;
- }
- if (graphPtr->stackAxes) {
- if (axisPtr->reqNumMajorTicks <= 0) {
- axisPtr->reqNumMajorTicks = 4;
- }
- MapStackedAxis(axisPtr, count, margin);
- } else {
- if (axisPtr->reqNumMajorTicks <= 0) {
- axisPtr->reqNumMajorTicks = 4;
- }
- MapAxis(axisPtr, offset, margin);
- }
- if (axisPtr->flags & AXIS_GRID) {
- MapGridlines(axisPtr);
- }
- offset += (AxisIsHorizontal(axisPtr))
- ? axisPtr->height : axisPtr->width;
- count++;
- }
- }
-}
-
-void
-Blt_DrawAxes(Graph *graphPtr, Drawable drawable)
-{
- int i;
-
- for (i = 0; i < 4; i++) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_LastLink(graphPtr->margins[i].axes);
- link != NULL; link = Blt_Chain_PrevLink(link)) {
- Axis *axisPtr;
-
- axisPtr = Blt_Chain_GetValue(link);
- if ((axisPtr->flags & (DELETE_PENDING|HIDE|AXIS_USE)) == AXIS_USE) {
- DrawAxis(axisPtr, drawable);
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawGrids --
- *
- * Draws the grid lines associated with each axis.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DrawGrids(Graph *graphPtr, Drawable drawable)
-{
- int i;
-
- for (i = 0; i < 4; i++) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(graphPtr->margins[i].axes); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Axis *axisPtr;
-
- axisPtr = Blt_Chain_GetValue(link);
- if (axisPtr->flags & (DELETE_PENDING|HIDE)) {
- continue;
- }
- if ((axisPtr->flags & AXIS_USE) && (axisPtr->flags & AXIS_GRID)) {
- Blt_Draw2DSegments(graphPtr->display, drawable,
- axisPtr->major.gc, axisPtr->major.segments,
- axisPtr->major.nUsed);
- if (axisPtr->flags & AXIS_GRIDMINOR) {
- Blt_Draw2DSegments(graphPtr->display, drawable,
- axisPtr->minor.gc, axisPtr->minor.segments,
- axisPtr->minor.nUsed);
- }
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GridsToPostScript --
- *
- * Draws the grid lines associated with each axis.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_GridsToPostScript(Graph *graphPtr, Blt_Ps ps)
-{
- int i;
-
- for (i = 0; i < 4; i++) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(graphPtr->margins[i].axes); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Axis *axisPtr;
-
- axisPtr = Blt_Chain_GetValue(link);
- if ((axisPtr->flags & (DELETE_PENDING|HIDE|AXIS_USE|AXIS_GRID)) !=
- (AXIS_GRID|AXIS_USE)) {
- continue;
- }
- Blt_Ps_Format(ps, "%% Axis %s: grid line attributes\n",
- axisPtr->obj.name);
- Blt_Ps_XSetLineAttributes(ps, axisPtr->major.color,
- axisPtr->major.lineWidth, &axisPtr->major.dashes, CapButt,
- JoinMiter);
- Blt_Ps_Format(ps, "%% Axis %s: major grid line segments\n",
- axisPtr->obj.name);
- Blt_Ps_Draw2DSegments(ps, axisPtr->major.segments,
- axisPtr->major.nUsed);
- if (axisPtr->flags & AXIS_GRIDMINOR) {
- Blt_Ps_XSetLineAttributes(ps, axisPtr->minor.color,
- axisPtr->minor.lineWidth, &axisPtr->minor.dashes, CapButt,
- JoinMiter);
- Blt_Ps_Format(ps, "%% Axis %s: minor grid line segments\n",
- axisPtr->obj.name);
- Blt_Ps_Draw2DSegments(ps, axisPtr->minor.segments,
- axisPtr->minor.nUsed);
- }
- }
- }
-}
-
-void
-Blt_AxesToPostScript(Graph *graphPtr, Blt_Ps ps)
-{
- Margin *mp, *mend;
-
- for (mp = graphPtr->margins, mend = mp + 4; mp < mend; mp++) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(mp->axes); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Axis *axisPtr;
-
- axisPtr = Blt_Chain_GetValue(link);
- if ((axisPtr->flags & (DELETE_PENDING|HIDE|AXIS_USE)) == AXIS_USE) {
- AxisToPostScript(ps, axisPtr);
- }
- }
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawAxisLimits --
- *
- * Draws the min/max values of the axis in the plotting area. The text
- * strings are formatted according to the "sprintf" format descriptors in
- * the limitsFormats array.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Draws the numeric values of the axis limits into the outer regions of
- * the plotting area.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DrawAxisLimits(Graph *graphPtr, Drawable drawable)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- char minString[200], maxString[200];
- int vMin, hMin, vMax, hMax;
-
-#define SPACING 8
- vMin = vMax = graphPtr->left + graphPtr->padLeft + 2;
- hMin = hMax = graphPtr->bottom - graphPtr->padBottom - 2; /* Offsets */
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->axes.table, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Axis *axisPtr;
- Dim2D textDim;
- const char *minFmt, *maxFmt;
- char *minPtr, *maxPtr;
- int isHoriz;
-
- axisPtr = Blt_GetHashValue(hPtr);
- if (axisPtr->flags & DELETE_PENDING) {
- continue;
- }
- if (axisPtr->nFormats == 0) {
- continue;
- }
- isHoriz = AxisIsHorizontal(axisPtr);
- minPtr = maxPtr = NULL;
- minFmt = maxFmt = axisPtr->limitsFormats[0];
- if (axisPtr->nFormats > 1) {
- maxFmt = axisPtr->limitsFormats[1];
- }
- if (minFmt[0] != '\0') {
- minPtr = minString;
- sprintf_s(minString, 200, minFmt, axisPtr->axisRange.min);
- }
- if (maxFmt[0] != '\0') {
- maxPtr = maxString;
- sprintf_s(maxString, 200, maxFmt, axisPtr->axisRange.max);
- }
- if (axisPtr->descending) {
- char *tmp;
-
- tmp = minPtr, minPtr = maxPtr, maxPtr = tmp;
- }
- if (maxPtr != NULL) {
- if (isHoriz) {
- Blt_Ts_SetAngle(axisPtr->limitsTextStyle, 90.0);
- Blt_Ts_SetAnchor(axisPtr->limitsTextStyle, TK_ANCHOR_SE);
- Blt_DrawText2(graphPtr->tkwin, drawable, maxPtr,
- &axisPtr->limitsTextStyle, graphPtr->right, hMax, &textDim);
- hMax -= (textDim.height + SPACING);
- } else {
- Blt_Ts_SetAngle(axisPtr->limitsTextStyle, 0.0);
- Blt_Ts_SetAnchor(axisPtr->limitsTextStyle, TK_ANCHOR_NW);
- Blt_DrawText2(graphPtr->tkwin, drawable, maxPtr,
- &axisPtr->limitsTextStyle, vMax, graphPtr->top, &textDim);
- vMax += (textDim.width + SPACING);
- }
- }
- if (minPtr != NULL) {
- Blt_Ts_SetAnchor(axisPtr->limitsTextStyle, TK_ANCHOR_SW);
- if (isHoriz) {
- Blt_Ts_SetAngle(axisPtr->limitsTextStyle, 90.0);
- Blt_DrawText2(graphPtr->tkwin, drawable, minPtr,
- &axisPtr->limitsTextStyle, graphPtr->left, hMin, &textDim);
- hMin -= (textDim.height + SPACING);
- } else {
- Blt_Ts_SetAngle(axisPtr->limitsTextStyle, 0.0);
- Blt_DrawText2(graphPtr->tkwin, drawable, minPtr,
- &axisPtr->limitsTextStyle, vMin, graphPtr->bottom, &textDim);
- vMin += (textDim.width + SPACING);
- }
- }
- } /* Loop on axes */
-}
-
-void
-Blt_AxisLimitsToPostScript(Graph *graphPtr, Blt_Ps ps)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- double vMin, hMin, vMax, hMax;
- char string[200];
-
-#define SPACING 8
- vMin = vMax = graphPtr->left + graphPtr->padLeft + 2;
- hMin = hMax = graphPtr->bottom - graphPtr->padBottom - 2; /* Offsets */
- for (hPtr = Blt_FirstHashEntry(&graphPtr->axes.table, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Axis *axisPtr;
- const char *minFmt, *maxFmt;
- unsigned int textWidth, textHeight;
-
- axisPtr = Blt_GetHashValue(hPtr);
- if (axisPtr->flags & DELETE_PENDING) {
- continue;
- }
- if (axisPtr->nFormats == 0) {
- continue;
- }
- minFmt = maxFmt = axisPtr->limitsFormats[0];
- if (axisPtr->nFormats > 1) {
- maxFmt = axisPtr->limitsFormats[1];
- }
- if (*maxFmt != '\0') {
- sprintf_s(string, 200, maxFmt, axisPtr->axisRange.max);
- Blt_GetTextExtents(axisPtr->tickFont, 0, string, -1, &textWidth,
- &textHeight);
- if ((textWidth > 0) && (textHeight > 0)) {
- if (axisPtr->obj.classId == CID_AXIS_X) {
- Blt_Ts_SetAngle(axisPtr->limitsTextStyle, 90.0);
- Blt_Ts_SetAnchor(axisPtr->limitsTextStyle, TK_ANCHOR_SE);
- Blt_Ps_DrawText(ps, string, &axisPtr->limitsTextStyle,
- (double)graphPtr->right, hMax);
- hMax -= (textWidth + SPACING);
- } else {
- Blt_Ts_SetAngle(axisPtr->limitsTextStyle, 0.0);
- Blt_Ts_SetAnchor(axisPtr->limitsTextStyle, TK_ANCHOR_NW);
- Blt_Ps_DrawText(ps, string, &axisPtr->limitsTextStyle,
- vMax, (double)graphPtr->top);
- vMax += (textWidth + SPACING);
- }
- }
- }
- if (*minFmt != '\0') {
- sprintf_s(string, 200, minFmt, axisPtr->axisRange.min);
- Blt_GetTextExtents(axisPtr->tickFont, 0, string, -1, &textWidth,
- &textHeight);
- if ((textWidth > 0) && (textHeight > 0)) {
- Blt_Ts_SetAnchor(axisPtr->limitsTextStyle, TK_ANCHOR_SW);
- if (axisPtr->obj.classId == CID_AXIS_X) {
- Blt_Ts_SetAngle(axisPtr->limitsTextStyle, 90.0);
- Blt_Ps_DrawText(ps, string, &axisPtr->limitsTextStyle,
- (double)graphPtr->left, hMin);
- hMin -= (textWidth + SPACING);
- } else {
- Blt_Ts_SetAngle(axisPtr->limitsTextStyle, 0.0);
- Blt_Ps_DrawText(ps, string, &axisPtr->limitsTextStyle,
- vMin, (double)graphPtr->bottom);
- vMin += (textWidth + SPACING);
- }
- }
- }
- }
-}
-
-Axis *
-Blt_GetFirstAxis(Blt_Chain chain)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_FirstLink(chain);
- if (link == NULL) {
- return NULL;
- }
- return Blt_Chain_GetValue(link);
-}
-
-Axis *
-Blt_NearestAxis(Graph *graphPtr, int x, int y)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->axes.table, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Axis *axisPtr;
-
- axisPtr = Blt_GetHashValue(hPtr);
- if ((axisPtr->flags & (DELETE_PENDING|HIDE|AXIS_USE)) != AXIS_USE) {
- continue;
- }
- if (axisPtr->flags & AXIS_SHOWTICKS) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(axisPtr->tickLabels); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TickLabel *labelPtr;
- Point2d t;
- double rw, rh;
- Point2d bbox[5];
-
- labelPtr = Blt_Chain_GetValue(link);
- Blt_GetBoundingBox(labelPtr->width, labelPtr->height,
- axisPtr->tickAngle, &rw, &rh, bbox);
- t = Blt_AnchorPoint(labelPtr->anchorPos.x,
- labelPtr->anchorPos.y, rw, rh, axisPtr->tickAnchor);
- t.x = x - t.x - (rw * 0.5);
- t.y = y - t.y - (rh * 0.5);
-
- bbox[4] = bbox[0];
- if (Blt_PointInPolygon(&t, bbox, 5)) {
- axisPtr->detail = "label";
- return axisPtr;
- }
- }
- }
- if (axisPtr->title != NULL) { /* and then the title string. */
- Point2d bbox[5];
- Point2d t;
- double rw, rh;
- unsigned int w, h;
-
- Blt_GetTextExtents(axisPtr->titleFont, 0, axisPtr->title,-1,&w,&h);
- Blt_GetBoundingBox(w, h, axisPtr->titleAngle, &rw, &rh, bbox);
- t = Blt_AnchorPoint(axisPtr->titlePos.x, axisPtr->titlePos.y,
- rw, rh, axisPtr->titleAnchor);
- /* Translate the point so that the 0,0 is the upper left
- * corner of the bounding box. */
- t.x = x - t.x - (rw * 0.5);
- t.y = y - t.y - (rh * 0.5);
-
- bbox[4] = bbox[0];
- if (Blt_PointInPolygon(&t, bbox, 5)) {
- axisPtr->detail = "title";
- return axisPtr;
- }
- }
- if (axisPtr->lineWidth > 0) { /* Check for the axis region */
- if ((x <= axisPtr->right) && (x >= axisPtr->left) &&
- (y <= axisPtr->bottom) && (y >= axisPtr->top)) {
- axisPtr->detail = "line";
- return axisPtr;
- }
- }
- }
- return NULL;
-}
-
-ClientData
-Blt_MakeAxisTag(Graph *graphPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&graphPtr->axes.tagTable, tagName, &isNew);
- return Blt_GetHashKey(&graphPtr->axes.tagTable, hPtr);
-}
-
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TimeScaleAxis --
- *
- * Determine the units of a linear scaled axis.
- *
- * The axis limits are either the range of the data values mapped
- * to the axis (autoscaled), or the values specified by the -min
- * and -max options (manual).
- *
- * If autoscaled, the smallest and largest major ticks will
- * encompass the range of data values. If the -loose option is
- * selected, the next outer ticks are choosen. If tight, the
- * ticks are at or inside of the data limits are used.
- *
- * If manually set, the ticks are at or inside the data limits
- * are used. This makes sense for zooming. You want the
- * selected range to represent the next limit, not something a
- * bit bigger.
- *
- * Note: I added an "always" value to the -loose option to force
- * the manually selected axes to be loose. It's probably
- * not a good idea.
- *
- * maxY
- * | units = magnitude (of least significant digit)
- * | high = largest unit tick < max axis value
- * high _| low = smallest unit tick > min axis value
- * |
- * | range = high - low
- * | # ticks = greatest factor of range/units
- * _|
- * U |
- * n |
- * i |
- * t _|
- * |
- * |
- * |
- * low _|
- * |
- * |_minX________________maxX__
- * | | | | |
- * minY low high
- * minY
- *
- * numTicks = Number of ticks
- * min = Minimum value of axis
- * max = Maximum value of axis
- * range = Range of values (max - min)
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The axis tick information is set. The actual tick values will
- * be generated later.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TimeScaleAxis(Axis *axisPtr, double min, double max)
-{
-#ifdef notdef
- double step;
- double tickMin, tickMax;
- double axisMin, axisMax;
- unsigned int nTicks;
-
- range = max - min;
-
-
-#define SECONDS_MIN (60)
-#define SECONDS_HOUR (SECONDS_MIN * 60)
-#define SECONDS_DAY (SECONDS_HOUR * 24)
-#define SECONDS_MONTH (SECONDS_DAY * 30)
-#define SECONDS_YEAR (SECONDS_MONTH * 12)
- div = nTicks - 1;
- if (range > (SECONDS_MONTH * 6 * div)) {
- unit = TICK_YEAR;
- } else if (range > (SECONDS_MONTH * 3 * div)) {
- unit = TICKS_6MONTH;
- first = timefloor(min, unit);
- last = timeceil(max, unit);
- } else if (range > (SECONDS_MONTH * 2 * div)) {
- unit = TICKS_3MONTH;
- first = timefloor(min, unit);
- last = timeceil(max, unit);
- } else if (range > (SECONDS_MONTH * div)) {
- unit = TICKS_2MONTH;
- first = timefloor(min, unit);
- last = timeceil(max, unit);
- } else if (range > (SECONDS_DAY * 15 * div)) {
- unit = TICKS_1MONTH;
- } else if (range > (SECONDS_DAY * 10 * div)) {
- unit = TICKS_15DAY;
- } else if (range > (SECONDS_DAY * div)) {
- unit = TICKS_10DAY;
- } else if (range > (SECONDS_HOUR * 12 * div)) {
- unit = TICKS_1DAY;
- } else if (range > (SECONDS_HOUR * 6 * div)) {
- unit = TICKS_12HOUR;
- } else if (range > (SECONDS_HOUR * 3 * div)) {
- unit = TICKS_6HOUR;
- } else if (range > (SECONDS_HOUR * div)) {
- unit = TICKS_3HOUR;
- } else if (range > (SECONDS_MIN * 30 * div)) {
- unit = TICKS_HOUR;
- } else if (range > (SECONDS_MIN * 20 * div)) {
- unit = TICKS_30MIN;
- } else if (range > (SECONDS_MIN * 15 * div)) {
- unit = TICKS_20MIN;
- } else if (range > (SECONDS_MIN * 10 * div)) {
- unit = TICKS_15MIN;
- } else if (range > (SECONDS_MIN * div)) {
- unit = TICKS_10MIN;
- } else if (range > (SECONDS_SEC * 30 * div)) {
- unit = TICKS_1MIN;
- } else if (range > (SECONDS_SEC * 20 * div)) {
- unit = TICKS_30SEC;
- } else if (range > (SECONDS_SEC * 15 * div)) {
- unit = TICKS_20SEC;
- } else if (range > (SECONDS_SEC * 10 * div)) {
- unit = TICKS_15SEC;
- } else if (range > (SECONDS_SEC * div)) {
- unit = TICKS_10SEC;
- } else {
- unit = TICKS_1SEC;
- }
-
- } else {
- unit = TICKS_SECS;
- }
- nTicks = 0;
- step = 1.0;
- /* Suppress compiler warning. */
- axisMin = axisMax = tickMin = tickMax = Blt_NaN();
- if (min < max) {
- double range;
-
- range = max - min;
- /* Calculate the major tick stepping. */
- if (axisPtr->reqStep > 0.0) {
- /* An interval was designated by the user. Keep scaling it until
- * it fits comfortably within the current range of the axis. */
- step = axisPtr->reqStep;
- while ((2 * step) >= range) {
- step *= 0.5;
- }
- } else {
- range = NiceNum(range, 0);
- step = NiceNum(range / axisPtr->reqNumMajorTicks, 1);
- }
-
- /* Find the outer tick values. Add 0.0 to prevent getting -0.0. */
- axisMin = tickMin = floor(min / step) * step + 0.0;
- axisMax = tickMax = ceil(max / step) * step + 0.0;
-
- nTicks = Round((tickMax - tickMin) / step) + 1;
- }
- axisPtr->majorSweep.step = step;
- axisPtr->majorSweep.initial = tickMin;
- axisPtr->majorSweep.nSteps = nTicks;
-
- /*
- * The limits of the axis are either the range of the data ("tight") or at
- * the next outer tick interval ("loose"). The looseness or tightness has
- * to do with how the axis fits the range of data values. This option is
- * overridden when the user sets an axis limit (by either -min or -max
- * option). The axis limit is always at the selected limit (otherwise we
- * assume that user would have picked a different number).
- */
- if ((axisPtr->looseMin == AXIS_TIGHT) ||
- ((axisPtr->looseMin == AXIS_LOOSE) &&
- (DEFINED(axisPtr->reqMin)))) {
- axisMin = min;
- }
- if ((axisPtr->looseMax == AXIS_TIGHT) ||
- ((axisPtr->looseMax == AXIS_LOOSE) &&
- (DEFINED(axisPtr->reqMax)))) {
- axisMax = max;
- }
- SetAxisRange(&axisPtr->axisRange, axisMin, axisMax);
-
- /* Now calculate the minor tick step and number. */
-
- if ((axisPtr->reqNumMinorTicks > 0) && (axisPtr->flags & AXIS_AUTO_MAJOR)) {
- nTicks = axisPtr->reqNumMinorTicks - 1;
- step = 1.0 / (nTicks + 1);
- } else {
- nTicks = 0; /* No minor ticks. */
- step = 0.5; /* Don't set the minor tick interval to
- * 0.0. It makes the GenerateTicks
- * routine * create minor log-scale tick
- * marks. */
- }
- axisPtr->minorSweep.initial = axisPtr->minorSweep.step = step;
- axisPtr->minorSweep.nSteps = nTicks;
-#endif
-}
-
-#ifdef notdef
-static Ticks *
-TimeGenerateTicks(TickSweep *sweepPtr)
-{
- Ticks *ticksPtr;
-
- ticksPtr = Blt_AssertMalloc(sizeof(Ticks) +
- (sweepPtr->nSteps * sizeof(double)));
- ticksPtr->nTicks = 0;
-
- if (sweepPtr->step == 0.0) {
- /* Hack: A zero step indicates to use log values. */
- int i;
- /* Precomputed log10 values [1..10] */
- static double logTable[] = {
- 0.0,
- 0.301029995663981,
- 0.477121254719662,
- 0.602059991327962,
- 0.698970004336019,
- 0.778151250383644,
- 0.845098040014257,
- 0.903089986991944,
- 0.954242509439325,
- 1.0
- };
- for (i = 0; i < sweepPtr->nSteps; i++) {
- ticksPtr->values[i] = logTable[i];
- }
- } else {
- double value;
- int i;
-
- value = sweepPtr->initial; /* Start from smallest axis tick */
- for (i = 0; i < sweepPtr->nSteps; i++) {
- value = UROUND(value, sweepPtr->step);
- ticksPtr->values[i] = value;
- value += sweepPtr->step;
- }
- }
- ticksPtr->nTicks = sweepPtr->nSteps;
- return ticksPtr;
-}
-
-static double
-TimeFloor(double min, int unit)
-{
- unsigned long ticks;
-
- ticks = (long)floor(min);
- localtime_r(&ticks, &tm);
- switch(unit) {
- case TICK_6MONTHS:
- tm.sec = 0;
- tm.min = 0;
- tm.day = 0;
- tm.
- }
-}
-static double
-TimeCeil(double max, int unit)
-{
-
-}
-
-#endif
-
diff --git a/blt3.0.1/src/bltGrAxis.h b/blt3.0.1/src/bltGrAxis.h
deleted file mode 100644
index a009aec..0000000
--- a/blt3.0.1/src/bltGrAxis.h
+++ /dev/null
@@ -1,332 +0,0 @@
-
-/*
- * bltGrAxis.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_GR_AXIS_H
-#define _BLT_GR_AXIS_H
-
-#include "bltList.h"
-
-/*
- *---------------------------------------------------------------------------
- *
- * Grid --
- *
- * Contains attributes of describing how to draw grids (at major ticks)
- * in the graph. Grids may be mapped to either/both X and Y axis.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- Blt_Dashes dashes; /* Dash style of the grid. This represents an
- * array of alternatingly drawn pixel
- * values. */
- int lineWidth; /* Width of the grid lines */
- XColor *color; /* Color of the grid lines */
- GC gc; /* Graphics context for the grid. */
-
- Segment2d *segments; /* Array of line segments representing the
- * grid lines */
- int nUsed; /* # of axis segments in use. */
- int nAllocated; /* # of axis segments allocated. */
-} Grid;
-
-/*
- *---------------------------------------------------------------------------
- *
- * AxisRange --
- *
- * Designates a range of values by a minimum and maximum limit.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- double min, max, range, scale;
-} AxisRange;
-
-/*
- *---------------------------------------------------------------------------
- *
- * TickLabel --
- *
- * Structure containing the X-Y screen coordinates of the tick
- * label (anchored at its center).
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- Point2d anchorPos;
- unsigned int width, height;
- char string[1];
-} TickLabel;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Ticks --
- *
- * Structure containing information where the ticks (major or
- * minor) will be displayed on the graph.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- unsigned int nTicks; /* # of ticks on axis */
- double values[1]; /* Array of tick values (malloc-ed). */
-} Ticks;
-
-/*
- *---------------------------------------------------------------------------
- *
- * TickSweep --
- *
- * Structure containing information where the ticks (major or
- * minor) will be displayed on the graph.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- double initial; /* Initial value */
- double step; /* Size of interval */
- unsigned int nSteps; /* Number of intervals. */
-} TickSweep;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Axis --
- *
- * Structure contains options controlling how the axis will be
- * displayed.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- GraphObj obj; /* Must be first field in axis. */
-
- unsigned int flags;
-
- Blt_HashEntry *hashPtr;
-
- /* Fields specific to axes. */
-
- const char *detail;
-
- int refCount; /* Number of elements referencing this
- * axis. */
- int logScale; /* If non-zero, generate log scale
- * ticks for the axis. */
- int timeScale; /* If non-zero, generate time scale
- * ticks for the axis. This option is
- * overridden by -logscale. */
- int descending; /* If non-zero, display the range of
- * values on the axis in descending
- * order, from high to low. */
-
- int looseMin, looseMax; /* If non-zero, axis range extends to
- * the outer major ticks, otherwise at
- * the limits of the data values. This
- * is overriddened by setting the -min
- * and -max options. */
-
- const char *title; /* Title of the axis. */
-
- int titleAlternate; /* Indicates whether to position the
- * title above/left of the axis. */
-
- Point2d titlePos; /* Position of the title */
-
- unsigned short int titleWidth, titleHeight;
-
-
- int lineWidth; /* Width of lines representing axis
- * (including ticks). If zero, then
- * no axis lines or ticks are
- * drawn. */
-
- const char **limitsFormats; /* One or two strings of sprintf-like
- * formats describing how to display
- * virtual axis limits. If NULL,
- * display no limits. */
- int nFormats;
-
- TextStyle limitsTextStyle; /* Text attributes (color, font,
- * rotation, etc.) of the limits. */
-
- double windowSize; /* Size of a sliding window of values
- * used to scale the axis
- * automatically as new data values
- * are added. The axis will always
- * display the latest values in this
- * range. */
-
- double shiftBy; /* Shift maximum by this interval. */
-
- int tickLength; /* Length of major ticks in pixels */
-
- const char *formatCmd; /* Specifies a TCL command, to be
- * invoked by the axis whenever it has
- * to generate tick labels. */
-
- Tcl_Obj *scrollCmdObjPtr;
- int scrollUnits;
-
- double min, max; /* The actual axis range. */
-
- double reqMin, reqMax; /* Requested axis bounds. Consult the
- * axisPtr->flags field for
- * AXIS_CONFIG_MIN and AXIS_CONFIG_MAX
- * to see if the requested bound have
- * been set. They override the
- * computed range of the axis
- * (determined by auto-scaling). */
-
- double reqScrollMin, reqScrollMax;
-
- double scrollMin, scrollMax; /* Defines the scrolling reqion of the
- * axis. Normally the region is
- * determined from the data limits. If
- * specified, these values override
- * the data-range. */
-
- AxisRange valueRange; /* Range of data values of elements
- * mapped to this axis. This is used
- * to auto-scale the axis in "tight"
- * mode. */
- AxisRange axisRange; /* Smallest and largest major tick
- * values for the axis. The tick
- * values lie outside the range of
- * data values. This is used to
- * auto-scale the axis in "loose"
- * mode. */
-
- double prevMin, prevMax;
-
- double reqStep; /* If > 0.0, overrides the computed major
- * tick interval. Otherwise a stepsize
- * is automatically calculated, based
- * upon the range of elements mapped to the
- * axis. The default value is 0.0. */
-
- Ticks *t1Ptr; /* Array of major tick positions. May be
- * set by the user or generated from the
- * major sweep below. */
-
- Ticks *t2Ptr; /* Array of minor tick positions. May be
- * set by the user or generated from the
- * minor sweep below. */
-
- TickSweep minorSweep, majorSweep;
-
- int reqNumMajorTicks; /* Default number of ticks to be displayed. */
- int reqNumMinorTicks; /* If non-zero, represents the
- * requested the number of minor ticks
- * to be uniformally displayed along
- * each major tick. */
-
-
- int labelOffset; /* If non-zero, indicates that the tick
- * label should be offset to sit in the
- * middle of the next interval. */
-
- /* The following fields are specific to logical axes */
-
- int margin; /* Margin that contains this axis. */
- Blt_ChainLink link; /* Axis link in margin list. */
- Blt_Chain chain;
- Segment2d *segments; /* Array of line segments representing
- * the major and minor ticks, but also
- * the * axis line itself. The segment
- * coordinates * are relative to the
- * axis. */
- int nSegments; /* Number of segments in the above
- * array. */
- Blt_Chain tickLabels; /* Contains major tick label strings
- * and their offsets along the
- * axis. */
- short int left, right, top, bottom; /* Region occupied by the of axis. */
- short int width, height; /* Extents of axis */
- short int maxTickWidth, maxTickHeight;
- Blt_Background normalBg;
- Blt_Background activeBg;
- XColor *activeFgColor;
-
- int relief;
- int borderWidth;
- int activeRelief;
-
- float tickAngle;
- Blt_Font tickFont;
- Tk_Anchor tickAnchor;
- Tk_Anchor reqTickAnchor;
- XColor *tickColor;
- GC tickGC; /* Graphics context for axis and tick
- * labels */
- GC activeTickGC;
-
- double titleAngle;
- Blt_Font titleFont;
- Tk_Anchor titleAnchor;
- Tk_Justify titleJustify;
- XColor *titleColor;
-
- Grid major, minor; /* Axis grid information. */
-
- double screenScale;
- int screenMin, screenRange;
-
-} Axis;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Axis2d --
- *
- * The pair of axes mapping a point onto the graph.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- Axis *x, *y;
-} Axis2d;
-
-/* Axis flags: */
-
-#define AXIS_AUTO_MAJOR (1<<16) /* Auto-generate major ticks. */
-#define AXIS_AUTO_MINOR (1<<17) /* Auto-generate minor ticks. */
-#define AXIS_ONSCREEN (1<<18) /* Axis is displayed on the screen via
- * the "use" operation */
-#define AXIS_GRID (1<<19)
-#define AXIS_GRID_MINOR (1<<20)
-#define AXIS_TICKS (1<<21)
-#define AXIS_TICKS_INTERIOR (1<<22)
-#define AXIS_CHECK_LIMITS (1<<23)
-#define AXIS_LOGSCALE (1<<24)
-#define AXIS_DECREASING (1<<25)
-
-#endif /* _BLT_GR_AXIS_H */
diff --git a/blt3.0.1/src/bltGrBar.c b/blt3.0.1/src/bltGrBar.c
deleted file mode 100644
index 328275a..0000000
--- a/blt3.0.1/src/bltGrBar.c
+++ /dev/null
@@ -1,2543 +0,0 @@
-
-/*
- * bltGrBar.c --
- *
- * This module implements barchart elements for the BLT graph widget.
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltGraph.h"
-#include <X11/Xutil.h>
-
-#include "bltGrElem.h"
-
-#define CLAMP(x,l,h) ((x) = (((x)<(l))? (l) : ((x)>(h)) ? (h) : (x)))
-
-typedef struct {
- float x1, y1, x2, y2;
-} BarRegion;
-
-typedef struct {
- Point2f ul, lr;
- Segment2d segments[4];
- int nSegments;
-} Bar;
-
-typedef struct {
- const char *name; /* Pen style identifier. If NULL, pen
- * was statically allocated. */
- ClassId classId; /* Type of pen */
- const char *typeId; /* String token identifying the type of
- * pen */
- unsigned int flags; /* Indicates if the pen element is
- * active or normal */
- int refCount; /* Reference count for elements using
- * this pen. */
- Blt_HashEntry *hashPtr;
- Blt_ConfigSpec *configSpecs; /* Configuration specifications */
- PenConfigureProc *configProc;
- PenDestroyProc *destroyProc;
- Graph *graphPtr; /* Graph that the pen is associated
- * with. */
- /* Barchart specific pen fields start here. */
- XColor *outlineColor; /* Outline (foreground) color of bar */
- Blt_Background fill; /* 3D border and fill (background)
- * color */
- int borderWidth; /* 3D border width of bar */
- int relief; /* Relief of the bar */
- Pixmap stipple; /* Stipple */
- GC fillGC; /* Graphics context */
- GC outlineGC; /* GC for outline of bar. */
-
- /* Error bar attributes. */
- int errorBarShow; /* Describes which error bars to
- * display: none, x, y, or * both. */
-
- int errorBarLineWidth; /* Width of the error bar segments. */
-
- int errorBarCapWidth;
- XColor *errorBarColor; /* Color of the error bar. */
-
- GC errorBarGC; /* Error bar graphics context. */
-
- /* Show value attributes. */
- int valueShow; /* Indicates whether to display data
- * value. Values are x, y, or none. */
-
- const char *valueFormat; /* A printf format string. */
- TextStyle valueStyle; /* Text attributes (color, font,
- * rotation, etc.) of the value. */
-
-} BarPen;
-
-typedef struct {
- Weight weight; /* Weight range where this pen is
- * valid. */
- BarPen *penPtr; /* Pen to use. */
-
- XRectangle *bars; /* Indicates starting location in bar
- * array for this pen. */
- int nBars; /* # of bar segments for this pen. */
-
- GraphSegments xeb, yeb; /* X and Y error bars. */
-
- int symbolSize; /* Size of the pen's symbol scaled to
- * the current graph size. */
- int errorBarCapWidth; /* Length of the cap ends on each error
- * bar. */
-
-} BarStyle;
-
-typedef struct {
- GraphObj obj; /* Must be first field in element. */
- unsigned int flags;
- Blt_HashEntry *hashPtr;
-
- /* Fields specific to elements. */
- const char *label; /* Label displayed in legend */
- unsigned short row, col; /* Position of the entry in the
- * legend. */
- int legendRelief; /* Relief of label in legend. */
- Axis2d axes; /* X-axis and Y-axis mapping the
- * element */
- ElemValues x, y, w; /* Contains array of floating point
- * graph coordinate values. Also holds
- * min/max and the number of
- * coordinates */
- int *activeIndices; /* Array of indices (malloc-ed) which
- * indicate which data points are active
- * (drawn * with "active" colors). */
- int nActiveIndices; /* Number of active data points.
- * Special case: if nActiveIndices < 0
- * and the active bit is set in "flags",
- * then all data * points are drawn
- * active. */
- ElementProcs *procsPtr;
- Blt_ConfigSpec *configSpecs; /* Configuration specifications. */
- BarPen *activePenPtr; /* Standard Pens */
- BarPen *normalPenPtr;
- BarPen *builtinPenPtr;
- Blt_Chain stylePalette; /* Palette of pens. */
-
- /* Symbol scaling */
- int scaleSymbols; /* If non-zero, the symbols will scale
- * in size as the graph is zoomed
- * in/out. */
- double xRange, yRange; /* Initial X-axis and Y-axis ranges:
- * used to scale the size of element's
- * symbol. */
- int state;
- Blt_ChainLink link;
-
- /* Fields specific to the barchart element */
-
- float barWidth;
- const char *groupName;
-
- int *barToData;
- XRectangle *bars; /* Array of rectangles comprising the bar
- * segments of the element. */
- int *activeToData;
- XRectangle *activeRects;
-
- int nBars; /* # of visible bar segments for
- * element */
- int nActive;
-
- int xPad; /* Spacing on either side of bar */
-
- ElemValues xError; /* Relative/symmetric X error values. */
- ElemValues yError; /* Relative/symmetric Y error values. */
- ElemValues xHigh, xLow; /* Absolute/asymmetric X-coordinate
- * high/low error values. */
- ElemValues yHigh, yLow; /* Absolute/asymmetric Y-coordinate
- * high/low error values. */
- BarPen builtinPen;
-
- GraphSegments xeb, yeb;
-
- int errorBarCapWidth; /* Length of cap on error bars */
-} BarElement;
-
-BLT_EXTERN Blt_CustomOption bltBarPenOption;
-BLT_EXTERN Blt_CustomOption bltValuesOption;
-BLT_EXTERN Blt_CustomOption bltValuePairsOption;
-BLT_EXTERN Blt_CustomOption bltXAxisOption;
-BLT_EXTERN Blt_CustomOption bltYAxisOption;
-BLT_EXTERN Blt_CustomOption bltColorOption;
-BLT_EXTERN Blt_CustomOption bltBarStylesOption;
-
-static Blt_OptionParseProc ObjToBarMode;
-static Blt_OptionPrintProc BarModeToObj;
-Blt_CustomOption bltBarModeOption =
-{
- ObjToBarMode, BarModeToObj, NULL, (ClientData)0
-};
-
-#define DEF_BAR_ACTIVE_PEN "activeBar"
-#define DEF_BAR_AXIS_X "x"
-#define DEF_BAR_AXIS_Y "y"
-#define DEF_BAR_BACKGROUND "navyblue"
-#define DEF_BAR_BORDERWIDTH "2"
-#define DEF_BAR_ERRORBAR_COLOR "defcolor"
-#define DEF_BAR_ERRORBAR_LINE_WIDTH "1"
-#define DEF_BAR_ERRORBAR_CAP_WIDTH "1"
-#define DEF_BAR_FOREGROUND "blue"
-#define DEF_BAR_HIDE "no"
-#define DEF_BAR_LABEL_RELIEF "flat"
-#define DEF_BAR_NORMAL_STIPPLE ""
-#define DEF_BAR_RELIEF "raised"
-#define DEF_BAR_SHOW_ERRORBARS "both"
-#define DEF_BAR_STATE "normal"
-#define DEF_BAR_STACK (char *)NULL
-#define DEF_BAR_STYLES ""
-#define DEF_BAR_TAGS "all"
-#define DEF_BAR_WIDTH "0.0"
-
-#define DEF_PEN_ACTIVE_BACKGROUND "red"
-#define DEF_PEN_ACTIVE_FOREGROUND "pink"
-#define DEF_PEN_BORDERWIDTH "2"
-#define DEF_PEN_NORMAL_BACKGROUND "navyblue"
-#define DEF_PEN_NORMAL_FOREGROUND "blue"
-#define DEF_PEN_RELIEF "raised"
-#define DEF_PEN_STIPPLE ""
-#define DEF_PEN_TYPE "bar"
-#define DEF_PEN_VALUE_ANCHOR "s"
-#define DEF_PEN_VALUE_COLOR RGB_BLACK
-#define DEF_PEN_VALUE_FONT STD_FONT_SMALL
-#define DEF_PEN_VALUE_FORMAT "%g"
-#define DEF_PEN_SHOW_VALUES "no"
-
-static Blt_ConfigSpec barPenConfigSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_PEN_ACTIVE_BACKGROUND, Blt_Offset(BarPen, fill),
- BLT_CONFIG_NULL_OK | ACTIVE_PEN},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_PEN_NORMAL_BACKGROUND, Blt_Offset(BarPen, fill),
- BLT_CONFIG_NULL_OK | NORMAL_PEN},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL,
- (char *)NULL, 0, ALL_PENS},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL,
- (char *)NULL, 0, ALL_PENS},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_PEN_BORDERWIDTH, Blt_Offset(BarPen, borderWidth), ALL_PENS},
- {BLT_CONFIG_CUSTOM, "-errorbarcolor", "errorBarColor", "ErrorBarColor",
- DEF_BAR_ERRORBAR_COLOR, Blt_Offset(BarPen, errorBarColor), ALL_PENS,
- &bltColorOption},
- {BLT_CONFIG_PIXELS_NNEG, "-errorbarwidth", "errorBarWidth","ErrorBarWidth",
- DEF_BAR_ERRORBAR_LINE_WIDTH, Blt_Offset(BarPen, errorBarLineWidth),
- ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-errorbarcap", "errorBarCap", "ErrorBarCap",
- DEF_BAR_ERRORBAR_CAP_WIDTH, Blt_Offset(BarPen, errorBarCapWidth),
- ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL,
- (char *)NULL, 0, ALL_PENS},
- {BLT_CONFIG_SYNONYM, "-fill", "background", (char *)NULL,
- (char *)NULL, 0, ALL_PENS},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_PEN_ACTIVE_FOREGROUND, Blt_Offset(BarPen, outlineColor),
- ACTIVE_PEN | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_PEN_NORMAL_FOREGROUND, Blt_Offset(BarPen, outlineColor),
- NORMAL_PEN | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-outline", "foreground", (char *)NULL,
- (char *)NULL, 0, ALL_PENS},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_PEN_RELIEF, Blt_Offset(BarPen, relief), ALL_PENS},
- {BLT_CONFIG_FILL, "-showerrorbars", "showErrorBars", "ShowErrorBars",
- DEF_BAR_SHOW_ERRORBARS, Blt_Offset(BarPen, errorBarShow),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FILL, "-showvalues", "showValues", "ShowValues",
- DEF_PEN_SHOW_VALUES, Blt_Offset(BarPen, valueShow),
- ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMAP, "-stipple", "stipple", "Stipple", DEF_PEN_STIPPLE,
- Blt_Offset(BarPen, stipple), ALL_PENS | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-type", (char *)NULL, (char *)NULL, DEF_PEN_TYPE,
- Blt_Offset(BarPen, typeId), ALL_PENS | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ANCHOR, "-valueanchor", "valueAnchor", "ValueAnchor",
- DEF_PEN_VALUE_ANCHOR, Blt_Offset(BarPen, valueStyle.anchor),
- ALL_PENS},
- {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor",
- DEF_PEN_VALUE_COLOR, Blt_Offset(BarPen, valueStyle.color),
- ALL_PENS},
- {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont",
- DEF_PEN_VALUE_FONT, Blt_Offset(BarPen, valueStyle.font),
- ALL_PENS},
- {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat",
- DEF_PEN_VALUE_FORMAT, Blt_Offset(BarPen, valueFormat),
- ALL_PENS | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FLOAT, "-valuerotate", "valueRotate", "ValueRotate",
- (char *)NULL, Blt_Offset(BarPen, valueStyle.angle), ALL_PENS},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-
-static Blt_ConfigSpec barElemConfigSpecs[] = {
- {BLT_CONFIG_CUSTOM, "-activepen", "activePen", "ActivePen",
- DEF_BAR_ACTIVE_PEN, Blt_Offset(BarElement, activePenPtr),
- BLT_CONFIG_NULL_OK, &bltBarPenOption},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_BAR_BACKGROUND, Blt_Offset(BarElement, builtinPen.fill),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FLOAT, "-barwidth", "barWidth", "BarWidth",
- DEF_BAR_WIDTH, Blt_Offset(BarElement, barWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_LIST, "-bindtags", "bindTags", "BindTags", DEF_BAR_TAGS,
- Blt_Offset(BarElement, obj.tags), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_BAR_BORDERWIDTH, Blt_Offset(BarElement, builtinPen.borderWidth), 0},
- {BLT_CONFIG_SYNONYM, "-color", "background", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_CUSTOM, "-errorbarcolor", "errorBarColor", "ErrorBarColor",
- DEF_BAR_ERRORBAR_COLOR,
- Blt_Offset(BarElement, builtinPen.errorBarColor), 0, &bltColorOption},
- {BLT_CONFIG_PIXELS_NNEG,"-errorbarwidth", "errorBarWidth", "ErrorBarWidth",
- DEF_BAR_ERRORBAR_LINE_WIDTH,
- Blt_Offset(BarElement, builtinPen.errorBarLineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-errorbarcap", "errorBarCap", "ErrorBarCap",
- DEF_BAR_ERRORBAR_CAP_WIDTH,
- Blt_Offset(BarElement, builtinPen.errorBarCapWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_CUSTOM, "-data", "data", "Data", (char *)NULL, 0, 0,
- &bltValuePairsOption},
- {BLT_CONFIG_SYNONYM, "-fill", "background", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_BAR_FOREGROUND, Blt_Offset(BarElement, builtinPen.outlineColor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-label", "label", "Label", (char *)NULL,
- Blt_Offset(BarElement, label), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-legendrelief", "legendRelief", "LegendRelief",
- DEF_BAR_LABEL_RELIEF, Blt_Offset(BarElement, legendRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_BAR_HIDE,
- Blt_Offset(BarElement, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE},
- {BLT_CONFIG_CUSTOM, "-mapx", "mapX", "MapX", DEF_BAR_AXIS_X,
- Blt_Offset(BarElement, axes.x), 0, &bltXAxisOption},
- {BLT_CONFIG_CUSTOM, "-mapy", "mapY", "MapY", DEF_BAR_AXIS_Y,
- Blt_Offset(BarElement, axes.y), 0, &bltYAxisOption},
- {BLT_CONFIG_SYNONYM, "-outline", "foreground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_CUSTOM, "-pen", "pen", "Pen", (char *)NULL,
- Blt_Offset(BarElement, normalPenPtr), BLT_CONFIG_NULL_OK,
- &bltBarPenOption},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_BAR_RELIEF, Blt_Offset(BarElement, builtinPen.relief), 0},
- {BLT_CONFIG_FILL, "-showerrorbars", "showErrorBars", "ShowErrorBars",
- DEF_BAR_SHOW_ERRORBARS, Blt_Offset(BarElement, builtinPen.errorBarShow),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FILL, "-showvalues", "showValues", "ShowValues",
- DEF_PEN_SHOW_VALUES, Blt_Offset(BarElement, builtinPen.valueShow),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-stack", "stack", "Stack", DEF_BAR_STACK,
- Blt_Offset(BarElement, groupName), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STATE, "-state", "state", "State", DEF_BAR_STATE,
- Blt_Offset(BarElement, state), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMAP, "-stipple", "stipple", "Stipple",
- DEF_BAR_NORMAL_STIPPLE, Blt_Offset(BarElement, builtinPen.stipple),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-styles", "styles", "Styles", DEF_BAR_STYLES,
- Blt_Offset(BarElement, stylePalette), 0, &bltBarStylesOption},
- {BLT_CONFIG_ANCHOR, "-valueanchor", "valueAnchor", "ValueAnchor",
- DEF_PEN_VALUE_ANCHOR,
- Blt_Offset(BarElement, builtinPen.valueStyle.anchor), 0},
- {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor",
- DEF_PEN_VALUE_COLOR,
- Blt_Offset(BarElement, builtinPen.valueStyle.color), 0},
- {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont",
- DEF_PEN_VALUE_FONT,
- Blt_Offset(BarElement, builtinPen.valueStyle.font), 0},
- {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat",
- DEF_PEN_VALUE_FORMAT, Blt_Offset(BarElement, builtinPen.valueFormat),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FLOAT, "-valuerotate", "valueRotate", "ValueRotate",
- (char *)NULL, Blt_Offset(BarElement, builtinPen.valueStyle.angle), 0},
- {BLT_CONFIG_CUSTOM, "-weights", "weights", "Weights", (char *)NULL,
- Blt_Offset(BarElement, w), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-x", "xdata", "Xdata", (char *)NULL,
- Blt_Offset(BarElement, x), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-y", "ydata", "Ydata", (char *)NULL,
- Blt_Offset(BarElement, y), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xdata", "xdata", "Xdata", (char *)NULL,
- Blt_Offset(BarElement, x), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-ydata", "ydata", "Ydata", (char *)NULL,
- Blt_Offset(BarElement, y), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xerror", "xError", "XError", (char *)NULL,
- Blt_Offset(BarElement, xError), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xhigh", "xHigh", "XHigh", (char *)NULL,
- Blt_Offset(BarElement, xHigh), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xlow", "xLow", "XLow", (char *)NULL,
- Blt_Offset(BarElement, xLow), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-yerror", "yError", "YError", (char *)NULL,
- Blt_Offset(BarElement, yError), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-yhigh", "yHigh", "YHigh", (char *)NULL,
- Blt_Offset(BarElement, yHigh), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-ylow", "yLow", "YLow", (char *)NULL,
- Blt_Offset(BarElement, yLow), 0, &bltValuesOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-/* Forward declarations */
-static PenConfigureProc ConfigureBarPenProc;
-static PenDestroyProc DestroyBarPenProc;
-static ElementClosestProc ClosestBarProc;
-static ElementConfigProc ConfigureBarProc;
-static ElementDestroyProc DestroyBarProc;
-static ElementDrawProc DrawActiveBarProc;
-static ElementDrawProc DrawNormalBarProc;
-static ElementDrawSymbolProc DrawSymbolProc;
-static ElementExtentsProc GetBarExtentsProc;
-static ElementToPostScriptProc ActiveBarToPostScriptProc;
-static ElementToPostScriptProc NormalBarToPostScriptProc;
-static ElementSymbolToPostScriptProc SymbolToPostScriptProc;
-static ElementMapProc MapBarProc;
-
-INLINE static int
-Round(double x)
-{
- return (int) (x + ((x < 0.0) ? -0.5 : 0.5));
-}
-
-/*
- *---------------------------------------------------------------------------
- * Custom option parse and print procedures
- *---------------------------------------------------------------------------
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * NameOfBarMode --
- *
- * Converts the integer representing the mode style into a string.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-NameOfBarMode(BarMode mode)
-{
- switch (mode) {
- case BARS_INFRONT:
- return "infront";
- case BARS_OVERLAP:
- return "overlap";
- case BARS_STACKED:
- return "stacked";
- case BARS_ALIGNED:
- return "aligned";
- default:
- return "unknown mode value";
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToMode --
- *
- * Converts the mode string into its numeric representation.
- *
- * Valid mode strings are:
- *
- * "infront" Draw a full bar at each point in the element.
- *
- * "stacked" Stack bar segments vertically. Each stack is defined
- * by each ordinate at a particular abscissa. The height
- * of each segment is represented by the sum the previous
- * ordinates.
- *
- * "aligned" Align bar segments as smaller slices one next to
- * the other. Like "stacks", aligned segments are
- * defined by each ordinate at a particular abscissa.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToBarMode(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Mode style string */
- char *widgRec, /* Cubicle structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- BarMode *modePtr = (BarMode *)(widgRec + offset);
- int length;
- char c;
- char *string;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'n') && (strncmp(string, "normal", length) == 0)) {
- *modePtr = BARS_INFRONT;
- } else if ((c == 'i') && (strncmp(string, "infront", length) == 0)) {
- *modePtr = BARS_INFRONT;
- } else if ((c == 's') && (strncmp(string, "stacked", length) == 0)) {
- *modePtr = BARS_STACKED;
- } else if ((c == 'a') && (strncmp(string, "aligned", length) == 0)) {
- *modePtr = BARS_ALIGNED;
- } else if ((c == 'o') && (strncmp(string, "overlap", length) == 0)) {
- *modePtr = BARS_OVERLAP;
- } else {
- Tcl_AppendResult(interp, "bad mode argument \"", string, "\": should"
- "be \"infront\", \"stacked\", \"overlap\", or \"aligned\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BarModeToObj --
- *
- * Returns the mode style string based upon the mode flags.
- *
- * Results:
- * The mode style string is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-BarModeToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Row/column structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- BarMode mode = *(BarMode *)(widgRec + offset);
-
- return Tcl_NewStringObj(NameOfBarMode(mode), -1);
-}
-
-
-/*
- * Zero out the style's number of bars and errorbars.
- */
-static void
-ResetStylePalette(Blt_Chain stylePalette)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(stylePalette); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- BarStyle *stylePtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->xeb.length = stylePtr->yeb.length = 0;
- stylePtr->nBars = 0;
- }
-}
-
-static int
-ConfigureBarPen(Graph *graphPtr, BarPen *penPtr)
-{
- XGCValues gcValues;
- unsigned long gcMask;
- GC newGC;
- long defColor;
- int screenNum;
-
- screenNum = Tk_ScreenNumber(graphPtr->tkwin);
- gcMask = GCForeground | GCLineWidth;
- gcValues.line_width = LineWidth(penPtr->errorBarLineWidth);
-
- if (penPtr->outlineColor != NULL) {
- defColor = penPtr->outlineColor->pixel;
- gcValues.foreground = penPtr->outlineColor->pixel;
- } else if (penPtr->fill != NULL) {
- defColor = Blt_BackgroundBorderColor(penPtr->fill)->pixel;
- gcValues.foreground = defColor;
- } else {
- defColor = BlackPixel(graphPtr->display, screenNum);
- }
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (penPtr->outlineGC != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->outlineGC);
- }
- penPtr->outlineGC = newGC;
-
- newGC = NULL;
- if (penPtr->stipple != None) {
- /* Handle old-style -stipple specially. */
- gcMask = GCForeground | GCBackground | GCFillStyle | GCStipple;
- gcValues.foreground = BlackPixel(graphPtr->display, screenNum);
- gcValues.background = WhitePixel(graphPtr->display, screenNum);
- if (penPtr->fill != NULL) {
- gcValues.foreground =
- Blt_BackgroundBorderColor(penPtr->fill)->pixel;
- } else if (penPtr->outlineColor != NULL) {
- gcValues.foreground = penPtr->outlineColor->pixel;
- }
- gcValues.stipple = penPtr->stipple;
- gcValues.fill_style = FillStippled;
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- }
- if (penPtr->fillGC != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->fillGC);
- }
- penPtr->fillGC = newGC;
-
- gcMask = GCForeground | GCLineWidth;
- if (penPtr->errorBarColor == COLOR_DEFAULT) {
- gcValues.foreground = defColor;
- } else {
- gcValues.foreground = penPtr->errorBarColor->pixel;
- }
- gcValues.line_width = LineWidth(penPtr->errorBarLineWidth);
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (penPtr->errorBarGC != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->errorBarGC);
- }
- penPtr->errorBarGC = newGC;
- return TCL_OK;
-}
-
-static void
-DestroyBarPen(Graph *graphPtr, BarPen *penPtr)
-{
- Blt_Ts_FreeStyle(graphPtr->display, &penPtr->valueStyle);
- if (penPtr->outlineGC != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->outlineGC);
- }
- if (penPtr->fillGC != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->fillGC);
- }
- if (penPtr->errorBarGC != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->errorBarGC);
- }
-}
-
-static int
-ConfigureBarPenProc(Graph *graphPtr, Pen *basePtr)
-{
- return ConfigureBarPen(graphPtr, (BarPen *)basePtr);
-}
-
-static void
-DestroyBarPenProc(Graph *graphPtr, Pen *basePtr)
-{
- DestroyBarPen(graphPtr, (BarPen *)basePtr);
-}
-
-
-static void
-InitializeBarPen(BarPen *penPtr)
-{
- /* Generic fields common to all pen types. */
- penPtr->configProc = ConfigureBarPenProc;
- penPtr->destroyProc = DestroyBarPenProc;
- penPtr->flags = NORMAL_PEN;
- penPtr->configSpecs = barPenConfigSpecs;
-
- /* Initialize fields specific to bar pens. */
- Blt_Ts_InitStyle(penPtr->valueStyle);
- penPtr->relief = TK_RELIEF_RAISED;
- penPtr->valueShow = SHOW_NONE;
- penPtr->borderWidth = 2;
- penPtr->errorBarShow = SHOW_BOTH;
-}
-
-Pen *
-Blt_BarPen(const char *penName)
-{
- BarPen *penPtr;
-
- penPtr = Blt_AssertCalloc(1, sizeof(BarPen));
- InitializeBarPen(penPtr);
- penPtr->name = Blt_AssertStrdup(penName);
- if (strcmp(penName, "activeBar") == 0) {
- penPtr->flags = ACTIVE_PEN;
- }
- return (Pen *)penPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CheckBarStacks --
- *
- * Check that the data limits are not superseded by the heights of
- * stacked bar segments. The heights are calculated by
- * Blt_ComputeStacks.
- *
- * Results:
- * If the y-axis limits need to be adjusted for stacked segments,
- * *minPtr* or *maxPtr* are updated.
- *
- * Side effects:
- * Autoscaling of the y-axis is affected.
- *
- *---------------------------------------------------------------------------
- */
-static void
-CheckBarStacks(Graph *graphPtr, Axis2d *pairPtr, double *minPtr, double *maxPtr)
-{
- BarGroup *gp, *gend;
-
- if ((graphPtr->mode != BARS_STACKED) || (graphPtr->nBarGroups == 0)) {
- return;
- }
- for (gp = graphPtr->barGroups, gend = gp + graphPtr->nBarGroups; gp < gend;
- gp++) {
- if ((gp->axes.x == pairPtr->x) && (gp->axes.y == pairPtr->y)) {
- /*
- * Check if any of the y-values (because of stacking) are greater
- * than the current limits of the graph.
- */
- if (gp->sum < 0.0f) {
- if (*minPtr > gp->sum) {
- *minPtr = gp->sum;
- }
- } else {
- if (*maxPtr < gp->sum) {
- *maxPtr = gp->sum;
- }
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureBarProc --
- *
- * Sets up the appropriate configuration parameters in the GC. It is
- * assumed the parameters have been previously set by a call to
- * Blt_ConfigureWidget.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result contains an error message.
- *
- * Side effects:
- * Configuration information such as bar foreground/background color and
- * stipple etc. get set in a new GC.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ConfigureBarProc(Graph *graphPtr, Element *basePtr)
-{
- BarElement *elemPtr = (BarElement *)basePtr;
- Blt_ChainLink link;
- BarStyle *stylePtr;
-
- if (ConfigureBarPen(graphPtr, elemPtr->builtinPenPtr)!= TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Point to the static normal pen if no external pens have been selected.
- */
- link = Blt_Chain_FirstLink(elemPtr->stylePalette);
- if (link == NULL) {
- link = Blt_Chain_AllocLink(sizeof(BarStyle));
- Blt_Chain_LinkAfter(elemPtr->stylePalette, link, NULL);
- }
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->penPtr = NORMALPEN(elemPtr);
-
- if (Blt_ConfigModified(elemPtr->configSpecs, "-barwidth", "-*data",
- "-map*", "-label", "-hide", "-x", "-y", (char *)NULL)) {
- elemPtr->flags |= MAP_ITEM;
- }
- return TCL_OK;
-}
-
-static void
-GetBarExtentsProc(Element *basePtr, Region2d *regPtr)
-{
- BarElement *elemPtr = (BarElement *)basePtr;
- Graph *graphPtr;
- double middle, barWidth;
- int nPoints;
-
- graphPtr = elemPtr->obj.graphPtr;
- regPtr->top = regPtr->left = DBL_MAX;
- regPtr->bottom = regPtr->right = -DBL_MAX;
-
- nPoints = NUMBEROFPOINTS(elemPtr);
- if (nPoints < 1) {
- return; /* No data points */
- }
- barWidth = graphPtr->barWidth;
- if (elemPtr->barWidth > 0.0f) {
- barWidth = elemPtr->barWidth;
- }
- middle = 0.5;
- regPtr->left = elemPtr->x.min - middle;
- regPtr->right = elemPtr->x.max + middle;
-
- regPtr->top = elemPtr->y.min;
- regPtr->bottom = elemPtr->y.max;
- if (regPtr->bottom < graphPtr->baseline) {
- regPtr->bottom = graphPtr->baseline;
- }
- /*
- * Handle stacked bar elements specially.
- *
- * If element is stacked, the sum of its ordinates may be outside the
- * minimum/maximum limits of the element's data points.
- */
- if ((graphPtr->mode == BARS_STACKED) && (graphPtr->nBarGroups > 0)) {
- CheckBarStacks(graphPtr, &elemPtr->axes, ®Ptr->top, ®Ptr->bottom);
- }
- /* Warning: You get what you deserve if the x-axis is logScale */
- if (elemPtr->axes.x->logScale) {
- regPtr->left = Blt_FindElemValuesMinimum(&elemPtr->x, DBL_MIN) +
- middle;
- }
- /* Fix y-min limits for barchart */
- if (elemPtr->axes.y->logScale) {
- if ((regPtr->top <= 0.0) || (regPtr->top > 1.0)) {
- regPtr->top = 1.0;
- }
- } else {
- if (regPtr->top > 0.0) {
- regPtr->top = 0.0;
- }
- }
- /* Correct the extents for error bars if they exist. */
- if (elemPtr->xError.nValues > 0) {
- int i;
-
- /* Correct the data limits for error bars */
- nPoints = MIN(elemPtr->xError.nValues, nPoints);
- for (i = 0; i < nPoints; i++) {
- double x;
-
- x = elemPtr->x.values[i] + elemPtr->xError.values[i];
- if (x > regPtr->right) {
- regPtr->right = x;
- }
- x = elemPtr->x.values[i] - elemPtr->xError.values[i];
- if (elemPtr->axes.x->logScale) {
- if (x < 0.0) {
- x = -x; /* Mirror negative values, instead of
- * ignoring them. */
- }
- if ((x > DBL_MIN) && (x < regPtr->left)) {
- regPtr->left = x;
- }
- } else if (x < regPtr->left) {
- regPtr->left = x;
- }
- }
- } else {
- if ((elemPtr->xHigh.nValues > 0) &&
- (elemPtr->xHigh.max > regPtr->right)) {
- regPtr->right = elemPtr->xHigh.max;
- }
- if (elemPtr->xLow.nValues > 0) {
- double left;
-
- if ((elemPtr->xLow.min <= 0.0) &&
- (elemPtr->axes.x->logScale)) {
- left = Blt_FindElemValuesMinimum(&elemPtr->xLow, DBL_MIN);
- } else {
- left = elemPtr->xLow.min;
- }
- if (left < regPtr->left) {
- regPtr->left = left;
- }
- }
- }
- if (elemPtr->yError.nValues > 0) {
- int i;
-
- nPoints = MIN(elemPtr->yError.nValues, nPoints);
- for (i = 0; i < nPoints; i++) {
- double y;
-
- y = elemPtr->y.values[i] + elemPtr->yError.values[i];
- if (y > regPtr->bottom) {
- regPtr->bottom = y;
- }
- y = elemPtr->y.values[i] - elemPtr->yError.values[i];
- if (elemPtr->axes.y->logScale) {
- if (y < 0.0) {
- y = -y; /* Mirror negative values, instead of
- * ignoring them. */
- }
- if ((y > DBL_MIN) && (y < regPtr->left)) {
- regPtr->top = y;
- }
- } else if (y < regPtr->top) {
- regPtr->top = y;
- }
- }
- } else {
- if ((elemPtr->yHigh.nValues > 0) &&
- (elemPtr->yHigh.max > regPtr->bottom)) {
- regPtr->bottom = elemPtr->yHigh.max;
- }
- if (elemPtr->yLow.nValues > 0) {
- double top;
-
- if ((elemPtr->yLow.min <= 0.0) &&
- (elemPtr->axes.y->logScale)) {
- top = Blt_FindElemValuesMinimum(&elemPtr->yLow, DBL_MIN);
- } else {
- top = elemPtr->yLow.min;
- }
- if (top < regPtr->top) {
- regPtr->top = top;
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClosestBar --
- *
- * Find the bar segment closest to the window coordinates point
- * specified.
- *
- * Note: This does not return the height of the stacked segment
- * (in graph coordinates) properly.
- *
- * Results:
- * Returns 1 if the point is width any bar segment, otherwise 0.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-ClosestBarProc(
- Graph *graphPtr, /* Not used. */
- Element *basePtr, /* Bar element */
- ClosestSearch *searchPtr) /* Information about closest point in
- * element */
-{
- BarElement *elemPtr = (BarElement *)basePtr;
- XRectangle *bp;
- double minDist;
- int imin;
- int i;
-
- minDist = searchPtr->dist;
- imin = 0;
-
- for (bp = elemPtr->bars, i = 0; i < elemPtr->nBars; i++, bp++) {
- Point2d *pp, *pend;
- Point2d outline[5];
- double left, right, top, bottom;
-
- if (PointInRectangle(bp, searchPtr->x, searchPtr->y)) {
- imin = elemPtr->barToData[i];
- minDist = 0.0;
- break;
- }
- left = bp->x, top = bp->y;
- right = (double)(bp->x + bp->width);
- bottom = (double)(bp->y + bp->height);
- outline[4].x = outline[3].x = outline[0].x = left;
- outline[4].y = outline[1].y = outline[0].y = top;
- outline[2].x = outline[1].x = right;
- outline[3].y = outline[2].y = bottom;
-
- for (pp = outline, pend = outline + 4; pp < pend; pp++) {
- Point2d t;
- double dist;
-
- t = Blt_GetProjection(searchPtr->x, searchPtr->y, pp, pp + 1);
- if (t.x > right) {
- t.x = right;
- } else if (t.x < left) {
- t.x = left;
- }
- if (t.y > bottom) {
- t.y = bottom;
- } else if (t.y < top) {
- t.y = top;
- }
- dist = hypot((t.x - searchPtr->x), (t.y - searchPtr->y));
- if (dist < minDist) {
- minDist = dist;
- imin = elemPtr->barToData[i];
- }
- }
- }
- if (minDist < searchPtr->dist) {
- searchPtr->elemPtr = (Element *)elemPtr;
- searchPtr->dist = minDist;
- searchPtr->index = imin;
- searchPtr->point.x = (double)elemPtr->x.values[imin];
- searchPtr->point.y = (double)elemPtr->y.values[imin];
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MergePens --
- *
- * Reorders the both arrays of points and errorbars to merge pens.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The old arrays are freed and new ones allocated containing
- * the reordered points and errorbars.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MergePens(BarElement *elemPtr, BarStyle **dataToStyle)
-{
- if (Blt_Chain_GetLength(elemPtr->stylePalette) < 2) {
- Blt_ChainLink link;
- BarStyle *stylePtr;
-
- link = Blt_Chain_FirstLink(elemPtr->stylePalette);
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->nBars = elemPtr->nBars;
- stylePtr->bars = elemPtr->bars;
- stylePtr->symbolSize = elemPtr->bars->width / 2;
- stylePtr->xeb.length = elemPtr->xeb.length;
- stylePtr->xeb.segments = elemPtr->xeb.segments;
- stylePtr->yeb.length = elemPtr->yeb.length;
- stylePtr->yeb.segments = elemPtr->yeb.segments;
- return;
- }
- /* We have more than one style. Group bar segments of like pen styles
- * together. */
-
- if (elemPtr->nBars > 0) {
- Blt_ChainLink link;
- XRectangle *bars, *bp;
- int *ip, *barToData;
-
- bars = Blt_AssertMalloc(elemPtr->nBars * sizeof(XRectangle));
- barToData = Blt_AssertMalloc(elemPtr->nBars * sizeof(int));
- bp = bars, ip = barToData;
- for (link = Blt_Chain_FirstLink(elemPtr->stylePalette); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- BarStyle *stylePtr;
- int i;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->symbolSize = bp->width / 2;
- stylePtr->bars = bp;
- for (i = 0; i < elemPtr->nBars; i++) {
- int iData;
-
- iData = elemPtr->barToData[i];
- if (dataToStyle[iData] == stylePtr) {
- *bp++ = elemPtr->bars[i];
- *ip++ = iData;
- }
- }
- stylePtr->nBars = bp - stylePtr->bars;
- }
- Blt_Free(elemPtr->bars);
- Blt_Free(elemPtr->barToData);
- elemPtr->bars = bars;
- elemPtr->barToData = barToData;
- }
-
- if (elemPtr->xeb.length > 0) {
- Blt_ChainLink link;
- Segment2d *bars, *sp;
- int *map, *ip;
-
- bars = Blt_AssertMalloc(elemPtr->xeb.length * sizeof(Segment2d));
- map = Blt_AssertMalloc(elemPtr->xeb.length * sizeof(int));
- sp = bars, ip = map;
- for (link = Blt_Chain_FirstLink(elemPtr->stylePalette);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- BarStyle *stylePtr;
- int i;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->xeb.segments = sp;
- for (i = 0; i < elemPtr->xeb.length; i++) {
- int iData;
-
- iData = elemPtr->xeb.map[i];
- if (dataToStyle[iData] == stylePtr) {
- *sp++ = elemPtr->xeb.segments[i];
- *ip++ = iData;
- }
- }
- stylePtr->xeb.length = sp - stylePtr->xeb.segments;
- }
- Blt_Free(elemPtr->xeb.segments);
- elemPtr->xeb.segments = bars;
- Blt_Free(elemPtr->xeb.map);
- elemPtr->xeb.map = map;
- }
- if (elemPtr->yeb.length > 0) {
- Blt_ChainLink link;
- Segment2d *bars, *sp;
- int *map, *ip;
-
- bars = Blt_AssertMalloc(elemPtr->yeb.length * sizeof(Segment2d));
- map = Blt_AssertMalloc(elemPtr->yeb.length * sizeof(int));
- sp = bars, ip = map;
- for (link = Blt_Chain_FirstLink(elemPtr->stylePalette); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- BarStyle *stylePtr;
- int i;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->yeb.segments = sp;
- for (i = 0; i < elemPtr->yeb.length; i++) {
- int iData;
-
- iData = elemPtr->yeb.map[i];
- if (dataToStyle[iData] == stylePtr) {
- *sp++ = elemPtr->yeb.segments[i];
- *ip++ = iData;
- }
- }
- stylePtr->yeb.length = sp - stylePtr->yeb.segments;
- }
- Blt_Free(elemPtr->yeb.segments);
- elemPtr->yeb.segments = bars;
- Blt_Free(elemPtr->yeb.map);
- elemPtr->yeb.map = map;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapActiveBars --
- *
- * Creates an array of points of the active graph coordinates.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is freed and allocated for the active point array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapActiveBars(BarElement *elemPtr)
-{
- if (elemPtr->activeRects != NULL) {
- Blt_Free(elemPtr->activeRects);
- elemPtr->activeRects = NULL;
- }
- if (elemPtr->activeToData != NULL) {
- Blt_Free(elemPtr->activeToData);
- elemPtr->activeToData = NULL;
- }
- elemPtr->nActive = 0;
-
- if (elemPtr->nActiveIndices > 0) {
- XRectangle *activeRects;
- int *activeToData;
- int i;
- int count;
-
- activeRects = Blt_AssertMalloc(sizeof(XRectangle) *
- elemPtr->nActiveIndices);
- activeToData = Blt_AssertMalloc(sizeof(int) *
- elemPtr->nActiveIndices);
- count = 0;
- for (i = 0; i < elemPtr->nBars; i++) {
- int *ip, *iend;
-
- for (ip = elemPtr->activeIndices,
- iend = ip + elemPtr->nActiveIndices; ip < iend; ip++) {
- if (elemPtr->barToData[i] == *ip) {
- activeRects[count] = elemPtr->bars[i];
- activeToData[count] = i;
- count++;
- }
- }
- }
- elemPtr->nActive = count;
- elemPtr->activeRects = activeRects;
- elemPtr->activeToData = activeToData;
- }
- elemPtr->flags &= ~ACTIVE_PENDING;
-}
-
-static void
-ResetBar(BarElement *elemPtr)
-{
- /* Release any storage associated with the display of the bar */
- ResetStylePalette(elemPtr->stylePalette);
- if (elemPtr->activeRects != NULL) {
- Blt_Free(elemPtr->activeRects);
- }
- if (elemPtr->activeToData != NULL) {
- Blt_Free(elemPtr->activeToData);
- }
- if (elemPtr->xeb.segments != NULL) {
- Blt_Free(elemPtr->xeb.segments);
- }
- if (elemPtr->xeb.map != NULL) {
- Blt_Free(elemPtr->xeb.map);
- }
- if (elemPtr->yeb.segments != NULL) {
- Blt_Free(elemPtr->yeb.segments);
- }
- if (elemPtr->yeb.map != NULL) {
- Blt_Free(elemPtr->yeb.map);
- }
- if (elemPtr->bars != NULL) {
- Blt_Free(elemPtr->bars);
- }
- if (elemPtr->barToData != NULL) {
- Blt_Free(elemPtr->barToData);
- }
- elemPtr->activeToData = elemPtr->xeb.map = elemPtr->yeb.map =
- elemPtr->barToData = NULL;
- elemPtr->activeRects = elemPtr->bars = NULL;
- elemPtr->xeb.segments = elemPtr->yeb.segments = NULL;
- elemPtr->nActive = elemPtr->xeb.length = elemPtr->yeb.length =
- elemPtr->nBars = 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MapErrorBars --
- *
- * Creates two arrays of points and pen indices, filled with the screen
- * coordinates of the visible
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is freed and allocated for the index array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapErrorBars(Graph *graphPtr, BarElement *elemPtr, BarStyle **dataToStyle)
-{
- int n, nPoints;
- Region2d reg;
-
- Blt_GraphExtents(graphPtr, ®);
- nPoints = NUMBEROFPOINTS(elemPtr);
- if (elemPtr->xError.nValues > 0) {
- n = MIN(elemPtr->xError.nValues, nPoints);
- } else {
- n = MIN3(elemPtr->xHigh.nValues, elemPtr->xLow.nValues, nPoints);
- }
- if (n > 0) {
- Segment2d *bars;
- Segment2d *segPtr;
- int *map;
- int *indexPtr;
- int i;
-
- segPtr = bars = Blt_AssertMalloc(n * 3 * sizeof(Segment2d));
- indexPtr = map = Blt_AssertMalloc(n * 3 * sizeof(int));
- for (i = 0; i < n; i++) {
- double x, y;
- double high, low;
- BarStyle *stylePtr;
-
- x = elemPtr->x.values[i];
- y = elemPtr->y.values[i];
- stylePtr = dataToStyle[i];
- if ((FINITE(x)) && (FINITE(y))) {
- if (elemPtr->xError.nValues > 0) {
- high = x + elemPtr->xError.values[i];
- low = x - elemPtr->xError.values[i];
- } else {
- high = elemPtr->xHigh.values[i];
- low = elemPtr->xLow.values[i];
- }
- if ((FINITE(high)) && (FINITE(low))) {
- Point2d p, q;
-
- p = Blt_Map2D(graphPtr, high, y, &elemPtr->axes);
- q = Blt_Map2D(graphPtr, low, y, &elemPtr->axes);
- segPtr->p = p;
- segPtr->q = q;
- if (Blt_LineRectClip(®, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- /* Left cap */
- segPtr->p.x = segPtr->q.x = p.x;
- segPtr->p.y = p.y - stylePtr->errorBarCapWidth;
- segPtr->q.y = p.y + stylePtr->errorBarCapWidth;
- if (Blt_LineRectClip(®, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- /* Right cap */
- segPtr->p.x = segPtr->q.x = q.x;
- segPtr->p.y = q.y - stylePtr->errorBarCapWidth;
- segPtr->q.y = q.y + stylePtr->errorBarCapWidth;
- if (Blt_LineRectClip(®, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- }
- }
- }
- elemPtr->xeb.segments = bars;
- elemPtr->xeb.length = segPtr - bars;
- elemPtr->xeb.map = map;
- }
- if (elemPtr->yError.nValues > 0) {
- n = MIN(elemPtr->yError.nValues, nPoints);
- } else {
- n = MIN3(elemPtr->yHigh.nValues, elemPtr->yLow.nValues, nPoints);
- }
- if (n > 0) {
- Segment2d *bars;
- Segment2d *segPtr;
- int *map;
- int *indexPtr;
- int i;
-
- segPtr = bars = Blt_AssertMalloc(n * 3 * sizeof(Segment2d));
- indexPtr = map = Blt_AssertMalloc(n * 3 * sizeof(int));
- for (i = 0; i < n; i++) {
- double x, y;
- double high, low;
- BarStyle *stylePtr;
-
- x = elemPtr->x.values[i];
- y = elemPtr->y.values[i];
- stylePtr = dataToStyle[i];
- if ((FINITE(x)) && (FINITE(y))) {
- if (elemPtr->yError.nValues > 0) {
- high = y + elemPtr->yError.values[i];
- low = y - elemPtr->yError.values[i];
- } else {
- high = elemPtr->yHigh.values[i];
- low = elemPtr->yLow.values[i];
- }
- if ((FINITE(high)) && (FINITE(low))) {
- Point2d p, q;
-
- p = Blt_Map2D(graphPtr, x, high, &elemPtr->axes);
- q = Blt_Map2D(graphPtr, x, low, &elemPtr->axes);
- segPtr->p = p;
- segPtr->q = q;
- if (Blt_LineRectClip(®, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- /* Top cap. */
- segPtr->p.y = segPtr->q.y = p.y;
- segPtr->p.x = p.x - stylePtr->errorBarCapWidth;
- segPtr->q.x = p.x + stylePtr->errorBarCapWidth;
- if (Blt_LineRectClip(®, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- /* Bottom cap. */
- segPtr->p.y = segPtr->q.y = q.y;
- segPtr->p.x = q.x - stylePtr->errorBarCapWidth;
- segPtr->q.x = q.x + stylePtr->errorBarCapWidth;
- if (Blt_LineRectClip(®, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- }
- }
- }
- elemPtr->yeb.segments = bars;
- elemPtr->yeb.length = segPtr - bars;
- elemPtr->yeb.map = map;
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapBarProc --
- *
- * Calculates the actual window coordinates of the bar element. The
- * window coordinates are saved in the bar element structure.
- *
- * Results:
- * None.
- *
- * Notes:
- * A bar can have multiple segments (more than one x,y pairs). In this
- * case, the bar can be represented as either a set of non-contiguous
- * bars or a single multi-segmented (stacked) bar.
- *
- * The x-axis layout for a barchart may be presented in one of two ways.
- * If abscissas are used, the bars are placed at those coordinates.
- * Otherwise, the range will represent the number of values.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapBarProc(Graph *graphPtr, Element *basePtr)
-{
- BarElement *elemPtr = (BarElement *)basePtr;
- BarStyle **dataToStyle;
- double *x, *y;
- double barWidth, barOffset;
- double baseline, ybot;
- int *barToData; /* Maps bars to data point indices */
- int invertBar;
- int nPoints, count;
- XRectangle *rp, *bars;
- int i;
- int size;
-
- ResetBar(elemPtr);
- nPoints = NUMBEROFPOINTS(elemPtr);
- if (nPoints < 1) {
- return; /* No data points */
- }
- barWidth = graphPtr->barWidth;
- barWidth = (elemPtr->barWidth > 0.0f)
- ? elemPtr->barWidth : graphPtr->barWidth;
- baseline = (elemPtr->axes.y->logScale) ? 0.0 : graphPtr->baseline;
- barOffset = barWidth * 0.5;
-
- /*
- * Create an array of bars representing the screen coordinates of all the
- * segments in the bar.
- */
- bars = Blt_AssertCalloc(nPoints, sizeof(XRectangle));
- barToData = Blt_AssertCalloc(nPoints, sizeof(int));
-
- x = elemPtr->x.values, y = elemPtr->y.values;
- count = 0;
- for (rp = bars, i = 0; i < nPoints; i++) {
- Point2d c1, c2; /* Two opposite corners of the rectangle
- * in graph coordinates. */
- double dx, dy;
- int height;
- double right, left, top, bottom;
-
- if (((x[i] - barWidth) > elemPtr->axes.x->axisRange.max) ||
- ((x[i] + barWidth) < elemPtr->axes.x->axisRange.min)) {
- continue; /* Abscissa is out of range of the
- * x-axis */
- }
- c1.x = x[i] - barOffset;
- c1.y = y[i];
- c2.x = c1.x + barWidth;
- c2.y = baseline;
-
- /*
- * If the mode is "aligned" or "stacked" we need to adjust the x or y
- * coordinates of the two corners.
- */
-
- if ((graphPtr->nBarGroups > 0) && (graphPtr->mode != BARS_INFRONT) &&
- (!graphPtr->stackAxes)) {
- Blt_HashEntry *hPtr;
- BarSetKey key;
-
- key.value = (float)x[i];
- key.axes = elemPtr->axes;
- key.axes.y = NULL;
- hPtr = Blt_FindHashEntry(&graphPtr->setTable, (char *)&key);
- if (hPtr != NULL) {
- Blt_HashTable *tablePtr;
- const char *name;
-
- tablePtr = Blt_GetHashValue(hPtr);
- name = (elemPtr->groupName != NULL) ? elemPtr->groupName :
- elemPtr->axes.y->obj.name;
- hPtr = Blt_FindHashEntry(tablePtr, name);
- if (hPtr != NULL) {
- BarGroup *groupPtr;
- double slice, width, offset;
-
- groupPtr = Blt_GetHashValue(hPtr);
- slice = barWidth / (double)graphPtr->maxBarSetSize;
- offset = (slice * groupPtr->index);
- if (graphPtr->maxBarSetSize > 1) {
- offset += slice * 0.05;
- slice *= 0.90;
- }
- switch (graphPtr->mode) {
- case BARS_STACKED:
- groupPtr->count++;
- c2.y = groupPtr->lastY;
- c1.y += c2.y;
- groupPtr->lastY = c1.y;
- c1.x += offset;
- c2.x = c1.x + slice;
- break;
-
- case BARS_ALIGNED:
- slice /= groupPtr->nSegments;
- c1.x += offset + (slice * groupPtr->count);
- c2.x = c1.x + slice;
- groupPtr->count++;
- break;
-
- case BARS_OVERLAP:
- slice /= (groupPtr->nSegments + 1);
- width = slice + slice;
- groupPtr->count++;
- c1.x += offset +
- (slice * (groupPtr->nSegments - groupPtr->count));
- c2.x = c1.x + width;
- break;
-
- case BARS_INFRONT:
- break;
- }
- }
- }
- }
- invertBar = FALSE;
- if (c1.y < c2.y) {
- double temp;
-
- /* Handle negative bar values by swapping ordinates */
- temp = c1.y, c1.y = c2.y, c2.y = temp;
- invertBar = TRUE;
- }
- /*
- * Get the two corners of the bar segment and compute the rectangle
- */
- ybot = c2.y;
- c1 = Blt_Map2D(graphPtr, c1.x, c1.y, &elemPtr->axes);
- c2 = Blt_Map2D(graphPtr, c2.x, c2.y, &elemPtr->axes);
- if ((ybot == 0.0) && (elemPtr->axes.y->logScale)) {
- c2.y = graphPtr->bottom;
- }
-
- if (c2.y < c1.y) {
- double t;
- t = c1.y, c1.y = c2.y, c2.y = t;
- }
- if (c2.x < c1.x) {
- double t;
- t = c1.x, c1.x = c2.x, c2.x = t;
- }
- if ((c1.x > graphPtr->right) || (c2.x < graphPtr->left) ||
- (c1.y > graphPtr->bottom) || (c2.y < graphPtr->top)) {
- continue;
- }
- /* Bound the bars horizontally by the width of the graph window */
- /* Bound the bars vertically by the position of the axis. */
- if (graphPtr->stackAxes) {
- top = elemPtr->axes.y->screenMin;
- bottom = elemPtr->axes.y->screenMin + elemPtr->axes.y->screenRange;
- left = graphPtr->left;
- right = graphPtr->right;
- } else {
- left = top = 0;
- bottom = right = 10000;
- /* Shouldn't really have a call to Tk_Width or Tk_Height in
- * mapping routine. We only want to clamp the bar segment to the
- * size of the window if we're actually mapped onscreen. */
- if (Tk_Height(graphPtr->tkwin) > 1) {
- bottom = Tk_Height(graphPtr->tkwin);
- }
- if (Tk_Width(graphPtr->tkwin) > 1) {
- right = Tk_Width(graphPtr->tkwin);
- }
- }
- CLAMP(c1.y, top, bottom);
- CLAMP(c2.y, top, bottom);
- CLAMP(c1.x, left, right);
- CLAMP(c2.x, left, right);
- dx = FABS(c1.x - c2.x);
- dy = FABS(c1.y - c2.y);
- if ((dx == 0) || (dy == 0)) {
- continue;
- }
- height = (int)dy;
- if (invertBar) {
- rp->y = (short int)MIN(c1.y, c2.y);
- } else {
- rp->y = (short int)(MAX(c1.y, c2.y)) - height;
- }
- rp->x = (short int)MIN(c1.x, c2.x);
- rp->width = (short int)dx + 1;
- rp->width |= 0x1;
- if (rp->width < 1) {
- rp->width = 1;
- }
- rp->height = height + 1;
- if (rp->height < 1) {
- rp->height = 1;
- }
- barToData[count] = i; /* Save the data index corresponding to
- * the rectangle */
- count++;
- rp++;
- }
- elemPtr->nBars = count;
- elemPtr->bars = bars;
- elemPtr->barToData = barToData;
- if (elemPtr->nActiveIndices > 0) {
- MapActiveBars(elemPtr);
- }
-
- size = 20;
- if (count > 0) {
- size = bars->width;
- }
- {
- Blt_ChainLink link;
-
- /* Set the symbol size of all the pen styles. */
- for (link = Blt_Chain_FirstLink(elemPtr->stylePalette); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- BarStyle *stylePtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->symbolSize = size;
- stylePtr->errorBarCapWidth =
- (stylePtr->penPtr->errorBarCapWidth > 0)
- ? stylePtr->penPtr->errorBarCapWidth : (size * 66666) / 100000;
- stylePtr->errorBarCapWidth /= 2;
- }
- }
- dataToStyle = (BarStyle **)Blt_StyleMap((Element *)elemPtr);
- if (((elemPtr->yHigh.nValues > 0) && (elemPtr->yLow.nValues > 0)) ||
- ((elemPtr->xHigh.nValues > 0) && (elemPtr->xLow.nValues > 0)) ||
- (elemPtr->xError.nValues > 0) || (elemPtr->yError.nValues > 0)) {
- MapErrorBars(graphPtr, elemPtr, dataToStyle);
- }
- MergePens(elemPtr, dataToStyle);
- Blt_Free(dataToStyle);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawSymbolProc --
- *
- * Draw a symbol centered at the given x,y window coordinate based upon
- * the element symbol type and size.
- *
- * Results:
- * None.
- *
- * Problems:
- * Most notable is the round-off errors generated when calculating the
- * centered position of the symbol.
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-DrawSymbolProc(Graph *graphPtr, Drawable drawable, Element *basePtr,
- int x, int y, int size)
-{
- BarElement *elemPtr = (BarElement *)basePtr;
- BarPen *penPtr;
- int radius;
-
- penPtr = NORMALPEN(elemPtr);
- if ((penPtr->fill == NULL) && (penPtr->outlineColor == NULL)) {
- return;
- }
- radius = (size / 2);
- size--;
-
- x -= radius;
- y -= radius;
- if (penPtr->fillGC != NULL) {
- XSetTSOrigin(graphPtr->display, penPtr->fillGC, x, y);
- }
- if (penPtr->stipple != None) {
- XFillRectangle(graphPtr->display, drawable, penPtr->fillGC, x, y,
- size, size);
- } else {
- Blt_FillBackgroundRectangle(graphPtr->tkwin, drawable, penPtr->fill,
- x, y, size, size, penPtr->borderWidth, penPtr->relief);
- }
- XDrawRectangle(graphPtr->display, drawable, penPtr->outlineGC, x, y,
- size, size);
- if (penPtr->fillGC != NULL) {
- XSetTSOrigin(graphPtr->display, penPtr->fillGC, 0, 0);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawBarSegments --
- *
- * Draws each of the rectangular segments for the element.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawBarSegments(Graph *graphPtr, Drawable drawable, BarPen *penPtr,
- XRectangle *bars, int nBars)
-{
- TkRegion rgn;
-
- {
- XRectangle clip;
- clip.x = graphPtr->left;
- clip.y = graphPtr->top;
- clip.width = graphPtr->right - graphPtr->left + 1;
- clip.height = graphPtr->bottom - graphPtr->top + 1;
- rgn = TkCreateRegion();
- TkUnionRectWithRegion(&clip, rgn, rgn);
- }
- if (penPtr->fill != NULL) {
- XRectangle *rp, *rend;
- int hasOutline;
- int relief;
-
- relief = (penPtr->relief == TK_RELIEF_SOLID)
- ? TK_RELIEF_FLAT: penPtr->relief;
- hasOutline = ((relief == TK_RELIEF_FLAT) &&
- (penPtr->outlineColor != NULL));
- if (penPtr->stipple != None) {
- TkSetRegion(graphPtr->display, penPtr->fillGC, rgn);
- }
- Blt_SetBackgroundClipRegion(graphPtr->tkwin, penPtr->fill, rgn);
- if (hasOutline) {
- TkSetRegion(graphPtr->display, penPtr->outlineGC, rgn);
- }
- for (rp = bars, rend = rp + nBars; rp < rend; rp++) {
- if (penPtr->stipple != None) {
- XFillRectangle(graphPtr->display, drawable, penPtr->fillGC,
- rp->x, rp->y, rp->width, rp->height);
- } else {
- Blt_FillBackgroundRectangle(graphPtr->tkwin, drawable,
- penPtr->fill, rp->x, rp->y, rp->width, rp->height,
- penPtr->borderWidth, relief);
- }
- if (hasOutline) {
- XDrawRectangle(graphPtr->display, drawable, penPtr->outlineGC,
- rp->x, rp->y, rp->width, rp->height);
- }
- }
- Blt_UnsetBackgroundClipRegion(graphPtr->tkwin, penPtr->fill);
- if (hasOutline) {
- XSetClipMask(graphPtr->display, penPtr->outlineGC, None);
- }
- if (penPtr->stipple != None) {
- XSetClipMask(graphPtr->display, penPtr->fillGC, None);
- }
- } else if (penPtr->outlineColor != NULL) {
- TkSetRegion(graphPtr->display, penPtr->outlineGC, rgn);
- XDrawRectangles(graphPtr->display, drawable, penPtr->outlineGC, bars,
- nBars);
- XSetClipMask(graphPtr->display, penPtr->outlineGC, None);
- }
- TkDestroyRegion(rgn);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawBarValues --
- *
- * Draws the numeric value of the bar.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawBarValues(Graph *graphPtr, Drawable drawable, BarElement *elemPtr,
- BarPen *penPtr, XRectangle *bars, int nBars, int *barToData)
-{
- XRectangle *rp, *rend;
- int count;
- const char *fmt;
-
- fmt = penPtr->valueFormat;
- if (fmt == NULL) {
- fmt = "%g";
- }
- count = 0;
- for (rp = bars, rend = rp + nBars; rp < rend; rp++) {
- Point2d anchorPos;
- double x, y;
- char string[TCL_DOUBLE_SPACE * 2 + 2];
-
- x = elemPtr->x.values[barToData[count]];
- y = elemPtr->y.values[barToData[count]];
-
- count++;
- if (penPtr->valueShow == SHOW_X) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, x);
- } else if (penPtr->valueShow == SHOW_Y) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, y);
- } else if (penPtr->valueShow == SHOW_BOTH) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, x);
- strcat(string, ",");
- sprintf_s(string + strlen(string), TCL_DOUBLE_SPACE, fmt, y);
- }
- if (graphPtr->inverted) {
- anchorPos.y = rp->y + rp->height * 0.5;
- anchorPos.x = rp->x + rp->width;
- if (x < graphPtr->baseline) {
- anchorPos.x -= rp->width;
- }
- } else {
- anchorPos.x = rp->x + rp->width * 0.5;
- anchorPos.y = rp->y;
- if (y < graphPtr->baseline) {
- anchorPos.y += rp->height;
- }
- }
- Blt_DrawText(graphPtr->tkwin, drawable, string, &penPtr->valueStyle,
- (int)anchorPos.x, (int)anchorPos.y);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawNormalBar --
- *
- * Draws the rectangle representing the bar element. If the relief
- * option is set to "raised" or "sunken" and the bar borderwidth is set
- * (borderwidth > 0), a 3D border is drawn around the bar.
- *
- * Don't draw bars that aren't visible (i.e. within the limits of the
- * axis).
- *
- * Results:
- * None.
- *
- * Side effects:
- * X drawing commands are output.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawNormalBarProc(Graph *graphPtr, Drawable drawable, Element *basePtr)
-{
- BarElement *elemPtr = (BarElement *)basePtr;
- int count;
- Blt_ChainLink link;
-
- count = 0;
- for (link = Blt_Chain_FirstLink(elemPtr->stylePalette); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- BarStyle *stylePtr;
- BarPen *penPtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- penPtr = stylePtr->penPtr;
- if (stylePtr->nBars > 0) {
- DrawBarSegments(graphPtr, drawable, penPtr, stylePtr->bars,
- stylePtr->nBars);
- }
- if ((stylePtr->xeb.length > 0) && (penPtr->errorBarShow & SHOW_X)) {
- Blt_Draw2DSegments(graphPtr->display, drawable, penPtr->errorBarGC,
- stylePtr->xeb.segments, stylePtr->xeb.length);
- }
- if ((stylePtr->yeb.length > 0) && (penPtr->errorBarShow & SHOW_Y)) {
- Blt_Draw2DSegments(graphPtr->display, drawable, penPtr->errorBarGC,
- stylePtr->yeb.segments, stylePtr->yeb.length);
- }
- if (penPtr->valueShow != SHOW_NONE) {
- DrawBarValues(graphPtr, drawable, elemPtr, penPtr,
- stylePtr->bars, stylePtr->nBars,
- elemPtr->barToData + count);
- }
- count += stylePtr->nBars;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawActiveBar --
- *
- * Draws bars representing the active segments of the bar element. If
- * the -relief option is set (other than "flat") and the borderwidth is
- * greater than 0, a 3D border is drawn around the each bar segment.
- *
- * Results:
- * None.
- *
- * Side effects:
- * X drawing commands are output.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawActiveBarProc(Graph *graphPtr, Drawable drawable, Element *basePtr)
-{
- BarElement *elemPtr = (BarElement *)basePtr;
-
- if (elemPtr->activePenPtr != NULL) {
- BarPen *penPtr = elemPtr->activePenPtr;
-
- if (elemPtr->nActiveIndices > 0) {
- if (elemPtr->flags & ACTIVE_PENDING) {
- MapActiveBars(elemPtr);
- }
- DrawBarSegments(graphPtr, drawable, penPtr, elemPtr->activeRects,
- elemPtr->nActive);
- if (penPtr->valueShow != SHOW_NONE) {
- DrawBarValues(graphPtr, drawable, elemPtr, penPtr,
- elemPtr->activeRects, elemPtr->nActive,
- elemPtr->activeToData);
- }
- } else if (elemPtr->nActiveIndices < 0) {
- DrawBarSegments(graphPtr, drawable, penPtr, elemPtr->bars,
- elemPtr->nBars);
- if (penPtr->valueShow != SHOW_NONE) {
- DrawBarValues(graphPtr, drawable, elemPtr, penPtr,
- elemPtr->bars, elemPtr->nBars, elemPtr->barToData);
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SymbolToPostScript --
- *
- * Draw a symbol centered at the given x,y window coordinate based upon
- * the element symbol type and size.
- *
- * Results:
- * None.
- *
- * Problems:
- * Most notable is the round-off errors generated when calculating the
- * centered position of the symbol.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-SymbolToPostScriptProc(
- Graph *graphPtr,
- Blt_Ps ps,
- Element *basePtr,
- double x, double y,
- int size)
-{
- BarElement *elemPtr = (BarElement *)basePtr;
- BarPen *penPtr;
-
- penPtr = NORMALPEN(elemPtr);
- if ((penPtr->fill == NULL) && (penPtr->outlineColor == NULL)) {
- return;
- }
- /*
- * Build a PostScript procedure to draw the fill and outline of the symbol
- * after the path of the symbol shape has been formed
- */
- Blt_Ps_Append(ps, "\n"
- "/DrawSymbolProc {\n"
- "gsave\n ");
- if (penPtr->stipple != None) {
- if (penPtr->fill != NULL) {
- Blt_Ps_XSetBackground(ps, Blt_BackgroundBorderColor(penPtr->fill));
- Blt_Ps_Append(ps, " gsave fill grestore\n ");
- }
- if (penPtr->outlineColor != NULL) {
- Blt_Ps_XSetForeground(ps, penPtr->outlineColor);
- } else {
- Blt_Ps_XSetForeground(ps, Blt_BackgroundBorderColor(penPtr->fill));
- }
- Blt_Ps_XSetStipple(ps, graphPtr->display, penPtr->stipple);
- } else if (penPtr->outlineColor != NULL) {
- Blt_Ps_XSetForeground(ps, penPtr->outlineColor);
- Blt_Ps_Append(ps, " fill\n");
- }
- Blt_Ps_Append(ps, " grestore\n");
- Blt_Ps_Append(ps, "} def\n\n");
- Blt_Ps_Format(ps, "%g %g %d Sq\n", x, y, size);
-}
-
-static void
-SegmentsToPostScript(Graph *graphPtr, Blt_Ps ps, BarPen *penPtr,
- XRectangle *bars, int nBars)
-{
- XRectangle *rp, *rend;
-
- if ((penPtr->fill == NULL) && (penPtr->outlineColor == NULL)) {
- return;
- }
- for (rp = bars, rend = rp + nBars; rp < rend; rp++) {
- if ((rp->width < 1) || (rp->height < 1)) {
- continue;
- }
- if (penPtr->stipple != None) {
- Blt_Ps_Rectangle(ps, rp->x, rp->y, rp->width - 1, rp->height - 1);
- if (penPtr->fill != NULL) {
- Blt_Ps_XSetBackground(ps,Blt_BackgroundBorderColor(penPtr->fill));
- Blt_Ps_Append(ps, "gsave fill grestore\n");
- }
- if (penPtr->outlineColor != NULL) {
- Blt_Ps_XSetForeground(ps, penPtr->outlineColor);
- } else {
- Blt_Ps_XSetForeground(ps,Blt_BackgroundBorderColor(penPtr->fill));
- }
- Blt_Ps_XSetStipple(ps, graphPtr->display, penPtr->stipple);
- } else if (penPtr->outlineColor != NULL) {
- Blt_Ps_XSetForeground(ps, penPtr->outlineColor);
- Blt_Ps_XFillRectangle(ps, (double)rp->x, (double)rp->y,
- (int)rp->width - 1, (int)rp->height - 1);
- }
- if ((penPtr->fill != NULL) && (penPtr->borderWidth > 0) &&
- (penPtr->relief != TK_RELIEF_FLAT)) {
- Blt_Ps_Draw3DRectangle(ps, Blt_BackgroundBorder(penPtr->fill),
- (double)rp->x, (double)rp->y, (int)rp->width, (int)rp->height,
- penPtr->borderWidth, penPtr->relief);
- }
- }
-}
-
-static void
-BarValuesToPostScript(Graph *graphPtr, Blt_Ps ps, BarElement *elemPtr,
- BarPen *penPtr, XRectangle *bars, int nBars,
- int *barToData)
-{
- XRectangle *rp, *rend;
- int count;
- const char *fmt;
- char string[TCL_DOUBLE_SPACE * 2 + 2];
- double x, y;
- Point2d anchorPos;
-
- count = 0;
- fmt = penPtr->valueFormat;
- if (fmt == NULL) {
- fmt = "%g";
- }
- for (rp = bars, rend = rp + nBars; rp < rend; rp++) {
- x = elemPtr->x.values[barToData[count]];
- y = elemPtr->y.values[barToData[count]];
- count++;
- if (penPtr->valueShow == SHOW_X) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, x);
- } else if (penPtr->valueShow == SHOW_Y) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, y);
- } else if (penPtr->valueShow == SHOW_BOTH) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, x);
- strcat(string, ",");
- sprintf_s(string + strlen(string), TCL_DOUBLE_SPACE, fmt, y);
- }
- if (graphPtr->inverted) {
- anchorPos.y = rp->y + rp->height * 0.5;
- anchorPos.x = rp->x + rp->width;
- if (x < graphPtr->baseline) {
- anchorPos.x -= rp->width;
- }
- } else {
- anchorPos.x = rp->x + rp->width * 0.5;
- anchorPos.y = rp->y;
- if (y < graphPtr->baseline) {
- anchorPos.y += rp->height;
- }
- }
- Blt_Ps_DrawText(ps, string, &penPtr->valueStyle, anchorPos.x,
- anchorPos.y);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActiveBarToPostScript --
- *
- * Similar to the NormalBarToPostScript procedure, generates PostScript
- * commands to display the bars representing the active bar segments of
- * the element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * PostScript pen width, dashes, and color settings are changed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-ActiveBarToPostScriptProc(Graph *graphPtr, Blt_Ps ps, Element *basePtr)
-{
- BarElement *elemPtr = (BarElement *)basePtr;
-
- if (elemPtr->activePenPtr != NULL) {
- BarPen *penPtr = elemPtr->activePenPtr;
-
- if (elemPtr->nActiveIndices > 0) {
- if (elemPtr->flags & ACTIVE_PENDING) {
- MapActiveBars(elemPtr);
- }
- SegmentsToPostScript(graphPtr, ps, penPtr, elemPtr->activeRects,
- elemPtr->nActive);
- if (penPtr->valueShow != SHOW_NONE) {
- BarValuesToPostScript(graphPtr, ps, elemPtr, penPtr,
- elemPtr->activeRects, elemPtr->nActive, elemPtr->activeToData);
- }
- } else if (elemPtr->nActiveIndices < 0) {
- SegmentsToPostScript(graphPtr, ps, penPtr, elemPtr->bars,
- elemPtr->nBars);
- if (penPtr->valueShow != SHOW_NONE) {
- BarValuesToPostScript(graphPtr, ps, elemPtr, penPtr,
- elemPtr->bars, elemPtr->nBars, elemPtr->barToData);
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NormalBarToPostScript --
- *
- * Generates PostScript commands to form the bars representing the
- * segments of the bar element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * PostScript pen width, dashes, and color settings are changed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-NormalBarToPostScriptProc(Graph *graphPtr, Blt_Ps ps, Element *basePtr)
-{
- BarElement *elemPtr = (BarElement *)basePtr;
- Blt_ChainLink link;
- int count;
-
- count = 0;
- for (link = Blt_Chain_FirstLink(elemPtr->stylePalette); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- BarStyle *stylePtr;
- BarPen *penPtr;
- XColor *colorPtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- penPtr = stylePtr->penPtr;
- if (stylePtr->nBars > 0) {
- SegmentsToPostScript(graphPtr, ps, penPtr, stylePtr->bars,
- stylePtr->nBars);
- }
- colorPtr = penPtr->errorBarColor;
- if (colorPtr == COLOR_DEFAULT) {
- colorPtr = penPtr->outlineColor;
- }
- if ((stylePtr->xeb.length > 0) && (penPtr->errorBarShow & SHOW_X)) {
- Blt_Ps_XSetLineAttributes(ps, colorPtr, penPtr->errorBarLineWidth,
- NULL, CapButt, JoinMiter);
- Blt_Ps_Draw2DSegments(ps, stylePtr->xeb.segments,
- stylePtr->xeb.length);
- }
- if ((stylePtr->yeb.length > 0) && (penPtr->errorBarShow & SHOW_Y)) {
- Blt_Ps_XSetLineAttributes(ps, colorPtr, penPtr->errorBarLineWidth,
- NULL, CapButt, JoinMiter);
- Blt_Ps_Draw2DSegments(ps, stylePtr->yeb.segments,
- stylePtr->yeb.length);
- }
- if (penPtr->valueShow != SHOW_NONE) {
- BarValuesToPostScript(graphPtr, ps, elemPtr, penPtr,
- stylePtr->bars, stylePtr->nBars, elemPtr->barToData + count);
- }
- count += stylePtr->nBars;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyBar --
- *
- * Release memory and resources allocated for the bar element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the bar element is freed up.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-DestroyBarProc(Graph *graphPtr, Element *basePtr)
-{
- BarElement *elemPtr = (BarElement *)basePtr;
-
- DestroyBarPen(graphPtr, elemPtr->builtinPenPtr);
- if (elemPtr->activePenPtr != NULL) {
- Blt_FreePen((Pen *)elemPtr->activePenPtr);
- }
- ResetBar(elemPtr);
- if (elemPtr->stylePalette != NULL) {
- Blt_FreeStylePalette(elemPtr->stylePalette);
- Blt_Chain_Destroy(elemPtr->stylePalette);
- }
- if (elemPtr->activeIndices != NULL) {
- Blt_Free(elemPtr->activeIndices);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_BarElement --
- *
- * Allocate memory and initialize methods for the new bar element.
- *
- * Results:
- * The pointer to the newly allocated element structure is returned.
- *
- * Side effects:
- * Memory is allocated for the bar element structure.
- *
- *---------------------------------------------------------------------------
- */
-
-static ElementProcs barProcs = {
- ClosestBarProc,
- ConfigureBarProc,
- DestroyBarProc,
- DrawActiveBarProc,
- DrawNormalBarProc,
- DrawSymbolProc,
- GetBarExtentsProc,
- ActiveBarToPostScriptProc,
- NormalBarToPostScriptProc,
- SymbolToPostScriptProc,
- MapBarProc,
-};
-
-
-Element *
-Blt_BarElement(Graph *graphPtr, const char *name, ClassId classId)
-{
- BarElement *elemPtr;
-
- elemPtr = Blt_AssertCalloc(1, sizeof(BarElement));
- elemPtr->procsPtr = &barProcs;
- elemPtr->configSpecs = barElemConfigSpecs;
- elemPtr->legendRelief = TK_RELIEF_FLAT;
- Blt_GraphSetObjectClass(&elemPtr->obj, classId);
- elemPtr->obj.name = Blt_AssertStrdup(name);
- elemPtr->obj.graphPtr = graphPtr;
- /* By default, an element's name and label are the same. */
- elemPtr->label = Blt_AssertStrdup(name);
- elemPtr->builtinPenPtr = &elemPtr->builtinPen;
- InitializeBarPen(elemPtr->builtinPenPtr);
- elemPtr->stylePalette = Blt_Chain_Create();
- bltBarStylesOption.clientData = (ClientData)sizeof(BarStyle);
- return (Element *)elemPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_InitBarSetTable --
- *
- * Generate a table of abscissa frequencies. Duplicate x-coordinates
- * (depending upon the bar drawing mode) indicate that something special
- * should be done with each bar segment mapped to the same abscissa
- * (i.e. it should be stacked, aligned, or overlay-ed with other segments)
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is allocated for the bar element structure.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_InitBarSetTable(Graph *graphPtr)
-{
- Blt_ChainLink link;
- int nStacks, nSegs;
- Blt_HashTable setTable;
- int sum, max;
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- /*
- * Free resources associated with a previous frequency table. This includes
- * the array of frequency information and the table itself
- */
- Blt_DestroyBarSets(graphPtr);
- if (graphPtr->mode == BARS_INFRONT) {
- return; /* No set table is needed for
- * "infront" mode */
- }
- Blt_InitHashTable(&graphPtr->setTable, sizeof(BarSetKey) / sizeof(int));
-
- /*
- * Initialize a hash table and fill it with unique abscissas. Keep track
- * of the frequency of each x-coordinate and how many abscissas have
- * duplicate mappings.
- */
- Blt_InitHashTable(&setTable, sizeof(BarSetKey) / sizeof(int));
- nSegs = nStacks = 0;
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- BarElement *elemPtr;
- double *x, *xend;
- int nPoints;
-
- elemPtr = Blt_Chain_GetValue(link);
- if ((elemPtr->flags & HIDE) || (elemPtr->obj.classId != CID_ELEM_BAR)) {
- continue;
- }
- nSegs++;
- nPoints = NUMBEROFPOINTS(elemPtr);
- for (x = elemPtr->x.values, xend = x + nPoints; x < xend; x++) {
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
- BarSetKey key;
- int isNew;
- size_t count;
- const char *name;
-
- key.value = *x;
- key.axes = elemPtr->axes;
- key.axes.y = NULL;
- hPtr = Blt_CreateHashEntry(&setTable, (char *)&key, &isNew);
- if (isNew) {
- tablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(tablePtr, BLT_STRING_KEYS);
- Blt_SetHashValue(hPtr, tablePtr);
- } else {
- tablePtr = Blt_GetHashValue(hPtr);
- }
- name = (elemPtr->groupName != NULL) ? elemPtr->groupName :
- elemPtr->axes.y->obj.name;
- hPtr = Blt_CreateHashEntry(tablePtr, name, &isNew);
- if (isNew) {
- count = 1;
- } else {
- count = (size_t)Blt_GetHashValue(hPtr);
- count++;
- }
- Blt_SetHashValue(hPtr, (ClientData)count);
- }
- }
- if (setTable.numEntries == 0) {
- return; /* No bar elements to be displayed */
- }
- sum = max = 0;
- for (hPtr = Blt_FirstHashEntry(&setTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *hPtr2;
- BarSetKey *keyPtr;
- int isNew;
-
- keyPtr = (BarSetKey *)Blt_GetHashKey(&setTable, hPtr);
- hPtr2 = Blt_CreateHashEntry(&graphPtr->setTable, (char *)keyPtr,&isNew);
- tablePtr = Blt_GetHashValue(hPtr);
- Blt_SetHashValue(hPtr2, tablePtr);
- if (max < tablePtr->numEntries) {
- max = tablePtr->numEntries; /* # of stacks in group. */
- }
- sum += tablePtr->numEntries;
- }
- Blt_DeleteHashTable(&setTable);
- if (sum > 0) {
- BarGroup *groupPtr;
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- graphPtr->barGroups = Blt_AssertCalloc(sum, sizeof(BarGroup));
- groupPtr = graphPtr->barGroups;
- for (hPtr = Blt_FirstHashEntry(&graphPtr->setTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- BarSetKey *keyPtr;
- Blt_HashTable *tablePtr;
- Blt_HashEntry *hPtr2;
- Blt_HashSearch iter2;
- size_t xcount;
-
- tablePtr = Blt_GetHashValue(hPtr);
- keyPtr = (BarSetKey *)Blt_GetHashKey(&setTable, hPtr);
- xcount = 0;
- for (hPtr2 = Blt_FirstHashEntry(tablePtr, &iter2); hPtr2!=NULL;
- hPtr2 = Blt_NextHashEntry(&iter2)) {
- size_t count;
-
- count = (size_t)Blt_GetHashValue(hPtr2);
- groupPtr->nSegments = count;
- groupPtr->axes = keyPtr->axes;
- Blt_SetHashValue(hPtr2, groupPtr);
- groupPtr->index = xcount++;
- groupPtr++;
- }
- }
- }
- graphPtr->maxBarSetSize = max;
- graphPtr->nBarGroups = sum;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ComputeStacks --
- *
- * Determine the height of each stack of bar segments. A stack is created
- * by designating two or more points with the same abscissa. Each ordinate
- * defines the height of a segment in the stack. This procedure simply
- * looks at all the data points summing the heights of each stacked
- * segment. The sum is saved in the frequency information table. This
- * value will be used to calculate the y-axis limits (data limits aren't
- * sufficient).
- *
- * Results:
- * None.
- *
- * Side effects:
- * The heights of each stack is computed. CheckBarGroups will use this
- * information to adjust the y-axis limits if necessary.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ComputeBarStacks(Graph *graphPtr)
-{
- Blt_ChainLink link;
-
- if ((graphPtr->mode != BARS_STACKED) || (graphPtr->nBarGroups == 0)) {
- return;
- }
-
- /* Initialize the stack sums to zero. */
- {
- BarGroup *gp, *gend;
-
- for (gp = graphPtr->barGroups, gend = gp + graphPtr->nBarGroups;
- gp < gend; gp++) {
- gp->sum = 0.0;
- }
- }
-
- /* Consider each bar x-y coordinate. Add the ordinates of duplicate
- * abscissas. */
-
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- BarElement *elemPtr;
- double *x, *y, *xend;
-
- elemPtr = Blt_Chain_GetValue(link);
- if ((elemPtr->flags & HIDE) || (elemPtr->obj.classId != CID_ELEM_BAR)) {
- continue;
- }
- for (x = elemPtr->x.values, y = elemPtr->y.values,
- xend = x + NUMBEROFPOINTS(elemPtr); x < xend; x++, y++) {
- BarSetKey key;
- BarGroup *groupPtr;
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
- const char *name;
-
- key.value = *x;
- key.axes = elemPtr->axes;
- key.axes.y = NULL;
- hPtr = Blt_FindHashEntry(&graphPtr->setTable, (char *)&key);
- if (hPtr == NULL) {
- continue;
- }
- tablePtr = Blt_GetHashValue(hPtr);
- name = (elemPtr->groupName != NULL) ? elemPtr->groupName :
- elemPtr->axes.y->obj.name;
- hPtr = Blt_FindHashEntry(tablePtr, name);
- if (hPtr == NULL) {
- continue;
- }
- groupPtr = Blt_GetHashValue(hPtr);
- groupPtr->sum += *y;
- }
- }
-}
-
-void
-Blt_ResetBarGroups(Graph *graphPtr)
-{
- BarGroup *gp, *gend;
-
- for (gp = graphPtr->barGroups, gend = gp + graphPtr->nBarGroups; gp < gend;
- gp++) {
- gp->lastY = 0.0;
- gp->count = 0;
- }
-}
-
-void
-Blt_DestroyBarSets(Graph *graphPtr)
-{
- Blt_HashSearch iter;
- Blt_HashEntry *hPtr;
-
- if (graphPtr->barGroups != NULL) {
- Blt_Free(graphPtr->barGroups);
- graphPtr->barGroups = NULL;
- }
- graphPtr->nBarGroups = 0;
- for (hPtr = Blt_FirstHashEntry(&graphPtr->setTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(tablePtr);
- Blt_Free(tablePtr);
- }
- Blt_DeleteHashTable(&graphPtr->setTable);
- Blt_InitHashTable(&graphPtr->setTable, sizeof(BarSetKey) / sizeof(int));
-}
diff --git a/blt3.0.1/src/bltGrContour.c b/blt3.0.1/src/bltGrContour.c
deleted file mode 100644
index 76251b3..0000000
--- a/blt3.0.1/src/bltGrContour.c
+++ /dev/null
@@ -1,2798 +0,0 @@
-
-/*
- * bltGrContour.c --
- *
- * This module implements contour elements for the BLT graph widget.
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltGraph.h"
-#include <X11/Xutil.h>
-
-#include "bltGrElem.h"
-
-/*
- * .c element create
- * .c level create name 0 0 -min -max -foreground -linewidth -background -color
- * .c level configure
- * .c level closest x y
- * .c element closest x y
- * .c element level add x y z
- */
-typedef struct {
- float x, y;
-} MeshKey;
-
-typedef struct {
- float x, y, z;
-} Point3;
-
-typedef struct {
- Point3 *A, Point3 *B; /* Index of two edge points in x, y, and
- * z vectors. */
-} Edge;
-
-typedef struct {
- Edge *AB, *BC, *AC;
-} Triangle;
-
-typedef struct {
- double min, max; /* Minimum and maximum values for the triangle
- * indexed at the same value. */
-} Limits;
-
-typedef struct {
- ElemValues *x, *y;
-} MeshKey;
-
-typedef struct {
- int refCount; /* Indicates how many contour elements are
- * using this mesh. When refCount is zero, it
- * means that this mesh can be destroyed. */
-
- ElemValues *x, *y; /* The x and y vectors containing the points
- * of the mesh. */
-
- long nPoints; /* The number of points in the mesh */
-
- Edge *edges; /* Array of edges generated from the points. */
- long nEdges; /* # of edges in above array. */
-
- Triangle *triangles; /* Array of triangles generated from the
- * edges. */
- long nTriangles; /* # of triangles in the above array. */
-} TriMesh;
-
-typedef struct {
- Point2d a, b, c; /* Filled triangle. */
- struct Polygon3 *next;
-} Polygon3;
-
-typedef struct {
- Point2d a, b, c, d; /* Filled quadrilateral. */
- struct Polygon4 *next;
-} Polygon4;
-
-typedef struct {
- char *name; /* */
- char *label; /* Label to be displayed in the legend. */
- double min, max;
-
- int symbol; /* Symbol to be displayed at each point. */
- int lineWidth; /* Width of contour line. */
- Dashes dashes;
- XColor *bgColor, *fgColor;
- GC fillGC;
- GC lineGC;
-
- Polygon4 *quadilaterals;
- int nQuads;
- Polygon3 *triangles;
- int nTriangles;
- Segment2d *segments;
- int nSegments;
-} ContourLevel;
-
-typedef struct {
- GraphObj obj; /* Must be first field in element. */
-
- unsigned int flags;
-
- Blt_HashEntry *hashPtr;
-
- /* Fields specific to elements. */
-
- char *label; /* Label displayed in legend. There may be
- * sub-labels for each contour range/value. */
- unsigned short row, col; /* Position of the entry in the legend. */
-
- int legendRelief; /* Relief of label in legend. */
-
- Axis2d axes; /* X-axis and Y-axis mapping the element */
-
- ElemValues x, y, w; /* Contains array of floating point graph
- * coordinate values. Also holds min/max and
- * the number of coordinates */
-
-
- int *activeIndices; /* Array of indices (malloc-ed) which indicate
- * which data points are active (drawn with
- * "active" colors). */
-
- int nActiveIndices; /* Number of active data points. Special
- * case: if nActiveIndices < 0 and the active
- * bit is set in "flags", then all data points
- * are drawn active. */
-
- ElementProcs *procsPtr;
-
- Blt_ConfigSpec *configSpecs; /* Configuration specifications. */
-
- Pen *activePenPtr; /* Standard Pens */
- Pen *normalPenPtr;
- Pen *builtinPenPtr;
-
- /* There is no style for a particular x, y */
- Blt_Chain stylePalette; /* Palette of pens. */
-
- /* Symbol scaling */
- int scaleSymbols; /* If non-zero, the symbols will scale in size
- * as the graph is zoomed in/out. */
-
- double xRange, yRange; /* Initial X-axis and Y-axis ranges: used to
- * scale the size of element's symbol. */
- int state;
-
- TriMesh *meshPtr; /* Mesh associated with contour data set. */
- ElemValues z;
- Limits *limits; /* Array of limits (min/max) associated with
- * each triangle in the above mesh. */
-
-} ContourElement;
-
-
-typedef struct {
- float x1, y1, x2, y2;
-} BarRegion;
-
-typedef struct {
- char *name; /* Pen style identifier. If NULL pen was
- * statically allocated. */
- ClassId classId; /* Type of pen */
- char *typeId; /* String token identifying the type of pen */
- unsigned int flags; /* Indicates if the pen element is active or
- * normal */
- int refCount; /* Reference count for elements using
- * this pen. */
- Blt_HashEntry *hashPtr;
-
- Blt_ConfigSpec *configSpecs; /* Configuration specifications */
-
- PenConfigureProc *configProc;
- PenDestroyProc *destroyProc;
- Graph *graphPtr; /* Graph that the pen is associated with. */
-
- /* Contour Plot specific pen fields start here. */
-
- XColor *fgColor; /* Foreground color of bar */
- Blt_Background bg; /* 3D border and background color */
- int borderWidth; /* 3D border width of bar */
- int relief; /* Relief of the bar */
- Pixmap stipple; /* Stipple */
- GC gc; /* Graphics context */
-
- /* Error bar attributes. */
- int errorBarShow; /* Describes which error bars to display:
- * none, x, y, or * both. */
-
- int errorBarLineWidth; /* Width of the error bar segments. */
-
- int errorBarCapWidth;
- XColor *errorBarColor; /* Color of the error bar. */
-
- GC errorBarGC; /* Error bar graphics context. */
-
- /* Show value attributes. */
- int valueShow; /* Indicates whether to display data value.
- * Values are x, y, or none. */
-
- char *valueFormat; /* A printf format string. */
- TextStyle valueStyle; /* Text attributes (color, font, rotation,
- * etc.) of the value. */
-
-} ContourPen;
-
-typedef struct {
- Weight weight; /* Weight range where this pen is valid. */
- ContourPen *penPtr; /* Pen to use. */
-
- XRectangle *bars; /* Indicates starting location in bar array
- * for this pen. */
- int nBars; /* Number of bar segments for this pen. */
-
- GraphSegments xeb, yeb; /* X and Y error bars. */
-
- int symbolSize; /* Size of the pen's symbol scaled to the
- * current graph size. */
- int errorBarCapWidth; /* Length of the cap ends on each error
- * bar. */
-
-} ContourStyle;
-
-
-typedef struct {
- GraphObj obj; /* Must be first field in element. */
- unsigned int flags;
- Blt_HashEntry *hashPtr;
-
- /* Fields specific to elements. */
-
- char *label; /* Label displayed in legend */
-
- int legendRelief; /* Relief of label in legend. */
-
- Axis2d axes; /* X-axis and Y-axis mapping the element */
-
- ElemValues x, y, w; /* Contains array of floating point graph
- * coordinate values. Also holds min/max and
- * the number of coordinates */
-
- int *activeIndices; /* Array of indices (malloc-ed) which indicate
- * which data points are active (drawn with
- * "active" colors). */
-
- int nActiveIndices; /* Number of active data points. Special
- * case: if nActiveIndices < 0 and the active
- * bit is set in "flags", then all data points
- * are drawn active. */
-
- ElementProcs *procsPtr;
-
- Blt_ConfigSpec *configSpecs; /* Configuration specifications. */
-
- ContourPen *activePenPtr; /* Standard Pens */
- ContourPen *normalPenPtr;
- ContourPen *builtinPenPtr;
-
- Blt_Chain stylePalette; /* Palette of pens. */
-
- /* Symbol scaling */
- int scaleSymbols; /* If non-zero, the symbols will scale in size
- * as the graph is zoomed in/out. */
-
- double xRange, yRange; /* Initial X-axis and Y-axis ranges: used to
- * scale the size of element's symbol. */
- int state;
-
- /* Fields specific to the contour element */
-
- float barWidth;
-
- int *barToData;
- XRectangle *bars; /* Array of rectangles comprising the bar
- * segments of the element. */
- int *activeToData;
- XRectangle *activeRects;
-
- int nBars; /* # of visible bar segments for element */
- int nActive;
-
- ContourPen builtinPen;
-
- ElemValues z; /* Contains array of floating point graph
- * coordinate values. Also holds min/max and
- * the number of coordinates */
- Triangle *triangles;
- int nTriangles;
-
-} ContourElement;
-
-BLT_EXTERN Blt_CustomOption bltContourPenOption;
-BLT_EXTERN Blt_CustomOption bltValuesOption;
-BLT_EXTERN Blt_CustomOption bltValuePairsOption;
-BLT_EXTERN Blt_CustomOption bltXAxisOption;
-BLT_EXTERN Blt_CustomOption bltYAxisOption;
-BLT_EXTERN Blt_CustomOption bltColorOption;
-BLT_EXTERN Blt_CustomOption bltContourStylesOption;
-
-static Blt_OptionParseProc ObjToBarMode;
-static Blt_OptionPrintProc BarModeToObj;
-Blt_CustomOption bltBarModeOption =
-{
- ObjToBarMode, BarModeToObj, NULL, (ClientData)0
-};
-
-#define DEF_CONTOUR_ACTIVE_PEN "activeBar"
-#define DEF_CONTOUR_AXIS_X "x"
-#define DEF_CONTOUR_AXIS_Y "y"
-#define DEF_CONTOUR_BACKGROUND "navyblue"
-#define DEF_CONTOUR_BORDERWIDTH "2"
-#define DEF_CONTOUR_ERRORBAR_COLOR "defcolor"
-#define DEF_CONTOUR_ERRORBAR_LINE_WIDTH "1"
-#define DEF_CONTOUR_ERRORBAR_CAP_WIDTH "1"
-#define DEF_CONTOUR_FOREGROUND "blue"
-#define DEF_CONTOUR_HIDE "no"
-#define DEF_CONTOUR_LABEL_RELIEF "flat"
-#define DEF_CONTOUR_NORMAL_STIPPLE ""
-#define DEF_CONTOUR_RELIEF "raised"
-#define DEF_CONTOUR_SHOW_ERRORBARS "both"
-#define DEF_CONTOUR_STATE "normal"
-#define DEF_CONTOUR_STYLES ""
-#define DEF_CONTOUR_TAGS "all"
-#define DEF_CONTOUR_WIDTH "0.0"
-
-#define DEF_PEN_ACTIVE_BACKGROUND "red"
-#define DEF_PEN_ACTIVE_FOREGROUND "pink"
-#define DEF_PEN_BORDERWIDTH "2"
-#define DEF_PEN_NORMAL_BACKGROUND "navyblue"
-#define DEF_PEN_NORMAL_FOREGROUND "blue"
-#define DEF_PEN_RELIEF "raised"
-#define DEF_PEN_STIPPLE ""
-#define DEF_PEN_TYPE "bar"
-#define DEF_PEN_VALUE_ANCHOR "s"
-#define DEF_PEN_VALUE_COLOR RGB_BLACK
-#define DEF_PEN_VALUE_FONT STD_FONT_SMALL
-#define DEF_PEN_VALUE_FORMAT "%g"
-#define DEF_PEN_SHOW_VALUES "no"
-
-static Blt_ConfigSpec contourPenConfigSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_PEN_ACTIVE_BACKGROUND, Blt_Offset(ContourPen, bg),
- BLT_CONFIG_NULL_OK | ACTIVE_PEN},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_PEN_NORMAL_BACKGROUND, Blt_Offset(ContourPen, bg),
- BLT_CONFIG_NULL_OK | NORMAL_PEN},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL,
- (char *)NULL, 0, ALL_PENS},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL,
- (char *)NULL, 0, ALL_PENS},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_PEN_BORDERWIDTH, Blt_Offset(ContourPen, borderWidth), ALL_PENS},
- {BLT_CONFIG_CUSTOM, "-errorbarcolor", "errorBarColor", "ErrorBarColor",
- DEF_CONTOUR_ERRORBAR_COLOR, Blt_Offset(ContourPen, errorBarColor),
- ALL_PENS, &bltColorOption},
- {BLT_CONFIG_PIXELS_NNEG, "-errorbarwidth", "errorBarWidth","ErrorBarWidth",
- DEF_CONTOUR_ERRORBAR_LINE_WIDTH, Blt_Offset(ContourPen, errorBarLineWidth),
- ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-errorbarcap", "errorBarCap", "ErrorBarCap",
- DEF_CONTOUR_ERRORBAR_CAP_WIDTH, Blt_Offset(ContourPen, errorBarCapWidth),
- ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL,
- (char *)NULL, 0, ALL_PENS},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_PEN_ACTIVE_FOREGROUND, Blt_Offset(ContourPen, fgColor),
- ACTIVE_PEN | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_PEN_NORMAL_FOREGROUND, Blt_Offset(ContourPen, fgColor),
- NORMAL_PEN | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_PEN_RELIEF, Blt_Offset(ContourPen, relief), ALL_PENS},
- {BLT_CONFIG_FILL, "-showerrorbars", "showErrorBars", "ShowErrorBars",
- DEF_CONTOUR_SHOW_ERRORBARS, Blt_Offset(ContourPen, errorBarShow),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FILL, "-showvalues", "showValues", "ShowValues",
- DEF_PEN_SHOW_VALUES, Blt_Offset(ContourPen, valueShow),
- ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMAP, "-stipple", "stipple", "Stipple", DEF_PEN_STIPPLE,
- Blt_Offset(ContourPen, stipple), ALL_PENS | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-type", (char *)NULL, (char *)NULL, DEF_PEN_TYPE,
- Blt_Offset(ContourPen, typeId), ALL_PENS | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ANCHOR, "-valueanchor", "valueAnchor", "ValueAnchor",
- DEF_PEN_VALUE_ANCHOR, Blt_Offset(ContourPen, valueStyle.anchor),
- ALL_PENS},
- {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor",
- DEF_PEN_VALUE_COLOR, Blt_Offset(ContourPen, valueStyle.color),
- ALL_PENS},
- {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont",
- DEF_PEN_VALUE_FONT, Blt_Offset(ContourPen, valueStyle.font),
- ALL_PENS},
- {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat",
- DEF_PEN_VALUE_FORMAT, Blt_Offset(ContourPen, valueFormat),
- ALL_PENS | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FLOAT, "-valuerotate", "valueRotate", "ValueRotate",
- (char *)NULL, Blt_Offset(ContourPen, valueStyle.angle), ALL_PENS},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-
-static Blt_ConfigSpec contourElemConfigSpecs[] =
-{
- {BLT_CONFIG_CUSTOM, "-activepen", "activePen", "ActivePen",
- DEF_CONTOUR_ACTIVE_PEN, Blt_Offset(ContourElement, activePenPtr),
- BLT_CONFIG_NULL_OK, &bltContourPenOption},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_CONTOUR_BACKGROUND, Blt_Offset(ContourElement, builtinPen.bg),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FLOAT, "-barwidth", "barWidth", "BarWidth", DEF_CONTOUR_WIDTH,
- Blt_Offset(ContourElement, barWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL,(char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_LIST, "-bindtags", "bindTags", "BindTags", DEF_CONTOUR_TAGS,
- Blt_Offset(ContourElement, obj.tags), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_CONTOUR_BORDERWIDTH,
- Blt_Offset(ContourElement, builtinPen.borderWidth), 0},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_CUSTOM, "-data", "data", "Data", (char *)NULL, 0, 0,
- &bltValuePairsOption},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_CONTOUR_FOREGROUND, Blt_Offset(ContourElement, builtinPen.fgColor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-label", "label", "Label", (char *)NULL,
- Blt_Offset(ContourElement, label), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-legendrelief", "legendRelief", "LegendRelief",
- DEF_CONTOUR_LABEL_RELIEF, Blt_Offset(ContourElement, legendRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_CONTOUR_HIDE,
- Blt_Offset(ContourElement, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE},
- {BLT_CONFIG_CUSTOM, "-mapx", "mapX", "MapX", DEF_CONTOUR_AXIS_X,
- Blt_Offset(ContourElement, axes.x), 0, &bltXAxisOption},
- {BLT_CONFIG_CUSTOM, "-mapy", "mapY", "MapY", DEF_CONTOUR_AXIS_Y,
- Blt_Offset(ContourElement, axes.y), 0, &bltYAxisOption},
- {BLT_CONFIG_CUSTOM, "-pen", "pen", "Pen", (char *)NULL,
- Blt_Offset(ContourElement, normalPenPtr), BLT_CONFIG_NULL_OK,
- &bltContourPenOption},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_CONTOUR_RELIEF,
- Blt_Offset(ContourElement, builtinPen.relief), 0},
- {BLT_CONFIG_FILL, "-showvalues", "showValues", "ShowValues",
- DEF_PEN_SHOW_VALUES, Blt_Offset(ContourElement, builtinPen.valueShow),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STATE, "-state", "state", "State", DEF_CONTOUR_STATE,
- Blt_Offset(ContourElement, state), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMAP, "-stipple", "stipple", "Stipple",
- DEF_CONTOUR_NORMAL_STIPPLE,
- Blt_Offset(ContourElement, builtinPen.stipple), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-styles", "styles", "Styles", DEF_CONTOUR_STYLES,
- Blt_Offset(ContourElement, stylePalette), 0, &bltContourStylesOption},
- {BLT_CONFIG_ANCHOR, "-valueanchor", "valueAnchor", "ValueAnchor",
- DEF_PEN_VALUE_ANCHOR, Blt_Offset(ContourElement, builtinPen.valueStyle.anchor), 0},
- {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor",
- DEF_PEN_VALUE_COLOR,
- Blt_Offset(ContourElement, builtinPen.valueStyle.color), 0},
- {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont",
- DEF_PEN_VALUE_FONT,
- Blt_Offset(ContourElement, builtinPen.valueStyle.font), 0},
- {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat",
- DEF_PEN_VALUE_FORMAT,
- Blt_Offset(ContourElement, builtinPen.valueFormat),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FLOAT, "-valuerotate", "valueRotate", "ValueRotate",
- (char *)NULL, Blt_Offset(ContourElement, builtinPen.valueStyle.angle),
- 0},
- {BLT_CONFIG_CUSTOM, "-weights", "weights", "Weights", (char *)NULL,
- Blt_Offset(ContourElement, w), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-x", "xdata", "Xdata", (char *)NULL,
- Blt_Offset(ContourElement, x), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-y", "ydata", "Ydata", (char *)NULL,
- Blt_Offset(ContourElement, y), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-z", "zdata", "Zdata", (char *)NULL,
- Blt_Offset(ContourElement, z), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xdata", "xdata", "Xdata", (char *)NULL,
- Blt_Offset(ContourElement, x), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-ydata", "ydata", "Ydata", (char *)NULL,
- Blt_Offset(ContourElement, y), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-zdata", "zdata", "Zdata", (char *)NULL,
- Blt_Offset(ContourElement, z), 0, &bltValuesOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-/* Forward declarations */
-static PenConfigureProc ConfigureContourPenProc;
-static PenDestroyProc DestroyContourPenProc;
-static ElementClosestProc ClosestBarProc;
-static ElementConfigProc ConfigureBarProc;
-static ElementDestroyProc DestroyBarProc;
-static ElementDrawProc DrawActiveBarProc;
-static ElementDrawProc DrawNormalBarProc;
-static ElementDrawSymbolProc DrawSymbolProc;
-static ElementExtentsProc GetContourExtentsProc;
-static ElementToPostScriptProc ActiveBarToPostScriptProc;
-static ElementToPostScriptProc NormalBarToPostScriptProc;
-static ElementSymbolToPostScriptProc SymbolToPostScriptProc;
-static ElementMapProc MapBarProc;
-
-INLINE static int
-Round(double x)
-{
- return (int) (x + ((x < 0.0) ? -0.5 : 0.5));
-}
-
-/*
- *---------------------------------------------------------------------------
- * Custom option parse and print procedures
- *---------------------------------------------------------------------------
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * NameOfBarMode --
- *
- * Converts the integer representing the mode style into a string.
- *
- *---------------------------------------------------------------------------
- */
-static char *
-NameOfBarMode(BarMode mode)
-{
- switch (mode) {
- case MODE_INFRONT:
- return "infront";
- case MODE_OVERLAP:
- return "overlap";
- case MODE_STACKED:
- return "stacked";
- case MODE_ALIGNED:
- return "aligned";
- default:
- return "unknown mode value";
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToMode --
- *
- * Converts the mode string into its numeric representation.
- *
- * Valid mode strings are:
- *
- * "infront" Draw a full bar at each point in the element.
- *
- * "stacked" Stack bar segments vertically. Each stack is defined
- * by each ordinate at a particular abscissa. The height
- * of each segment is represented by the sum the previous
- * ordinates.
- *
- * "aligned" Align bar segments as smaller slices one next to
- * the other. Like "stacks", aligned segments are
- * defined by each ordinate at a particular abscissa.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToBarMode(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Mode style string */
- char *widgRec, /* Cubicle structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- BarMode *modePtr = (BarMode *)(widgRec + offset);
- int length;
- char c;
- char *string;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'n') && (strncmp(string, "normal", length) == 0)) {
- *modePtr = MODE_INFRONT;
- } else if ((c == 'i') && (strncmp(string, "infront", length) == 0)) {
- *modePtr = MODE_INFRONT;
- } else if ((c == 's') && (strncmp(string, "stacked", length) == 0)) {
- *modePtr = MODE_STACKED;
- } else if ((c == 'a') && (strncmp(string, "aligned", length) == 0)) {
- *modePtr = MODE_ALIGNED;
- } else if ((c == 'o') && (strncmp(string, "overlap", length) == 0)) {
- *modePtr = MODE_OVERLAP;
- } else {
- Tcl_AppendResult(interp, "bad mode argument \"", string,
- "\": should be \"infront\", \"stacked\", \"overlap\", or \"aligned\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BarModeToObj --
- *
- * Returns the mode style string based upon the mode flags.
- *
- * Results:
- * The mode style string is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-BarModeToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Row/column structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- BarMode mode = *(BarMode *)(widgRec + offset);
-
- return Tcl_NewStringObj(NameOfBarMode(mode), -1);
-}
-
-
-/*
- * Zero out the style's number of bars and errorbars.
- */
-static void
-ResetStylePalette(Blt_Chain stylePalette)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(stylePalette); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- ContourStyle *stylePtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->xeb.length = stylePtr->yeb.length = 0;
- stylePtr->nBars = 0;
- }
-}
-
-static int
-ConfigureContourPen(Graph *graphPtr, ContourPen *penPtr)
-{
- XGCValues gcValues;
- unsigned long gcMask;
- GC newGC;
- long defColor;
-
- gcMask = GCForeground;
- if (penPtr->fgColor != NULL) {
- defColor = penPtr->fgColor->pixel;
- gcValues.foreground = penPtr->fgColor->pixel;
- } else if (penPtr->bg != NULL) {
- defColor = Blt_BackgroundBorderColor(penPtr->bg)->pixel;
- gcValues.foreground = defColor;
- } else {
- defColor = BlackPixel(graphPtr->display,
- Tk_ScreenNumber(graphPtr->tkwin));
- }
- if (penPtr->stipple != None) {
- gcValues.stipple = penPtr->stipple;
- gcValues.fill_style = FillStippled;
- gcMask |= (GCStipple | GCFillStyle);
- }
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (penPtr->gc != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->gc);
- }
- penPtr->gc = newGC;
-
- gcMask = GCForeground | GCLineWidth;
- if (penPtr->errorBarColor == COLOR_DEFAULT) {
- gcValues.foreground = defColor;
- } else {
- gcValues.foreground = penPtr->errorBarColor->pixel;
- }
- gcValues.line_width = LineWidth(penPtr->errorBarLineWidth);
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (penPtr->errorBarGC != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->errorBarGC);
- }
- penPtr->errorBarGC = newGC;
- return TCL_OK;
-}
-
-static void
-DestroyContourPen(Graph *graphPtr, ContourPen *penPtr)
-{
- Blt_Ts_FreeStyle(graphPtr->display, &penPtr->valueStyle);
- if (penPtr->gc != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->gc);
- }
- if (penPtr->errorBarGC != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->errorBarGC);
- }
-}
-
-static int
-ConfigureContourPenProc(Graph *graphPtr, Pen *basePtr)
-{
- return ConfigureContourPen(graphPtr, (ContourPen *)basePtr);
-}
-
-static void
-DestroyContourPenProc(Graph *graphPtr, Pen *basePtr)
-{
- DestroyContourPen(graphPtr, (ContourPen *)basePtr);
-}
-
-
-static void
-InitContourPen(ContourPen *penPtr)
-{
- /* Generic fields common to all pen types. */
- penPtr->configProc = ConfigureContourPenProc;
- penPtr->destroyProc = DestroyContourPenProc;
- penPtr->flags = NORMAL_PEN;
- penPtr->configSpecs = contourPenConfigSpecs;
-
- /* Initialize fields specific to contour pens. */
- Blt_Ts_InitStyle(penPtr->valueStyle);
- penPtr->relief = TK_RELIEF_RAISED;
- penPtr->valueShow = SHOW_NONE;
- penPtr->borderWidth = 2;
- penPtr->errorBarShow = SHOW_BOTH;
-}
-
-Pen *
-Blt_ContourPen(char *penName)
-{
- ContourPen *penPtr;
-
- penPtr = Blt_AssertCalloc(1, sizeof(ContourPen));
- InitContourPen(penPtr);
- penPtr->name = Blt_AssertStrdup(penName);
- if (strcmp(penName, "activeBar") == 0) {
- penPtr->flags = ACTIVE_PEN;
- }
- return (Pen *)penPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CheckStacks --
- *
- * Check that the data limits are not superseded by the heights
- * of stacked bar segments. The heights are calculated by
- * Blt_ComputeStacks.
- *
- * Results:
- * If the y-axis limits need to be adjusted for stacked segments,
- * *minPtr* or *maxPtr* are updated.
- *
- * Side effects:
- * Autoscaling of the y-axis is affected.
- *
- *---------------------------------------------------------------------------
- */
-static void
-CheckStacks(Graph *graphPtr, Axis2d *pairPtr, double *minPtr, double *maxPtr)
-{
- BarGroup *stackPtr;
- int i;
-
- if ((graphPtr->mode != MODE_STACKED) || (graphPtr->nStacks == 0)) {
- return;
- }
- infoPtr = graphPtr->freqArr;
- for (i = 0; i < graphPtr->nStacks; i++) {
- if ((infoPtr->axes.x == pairPtr->x) &&
- (infoPtr->axes.y == pairPtr->y)) {
- /*
-
- * Check if any of the y-values (because of stacking) are
- * greater than the current limits of the graph.
- */
- if (infoPtr->sum < 0.0) {
- if (*minPtr > infoPtr->sum) {
- *minPtr = infoPtr->sum;
- }
- } else {
- if (*maxPtr < infoPtr->sum) {
- *maxPtr = infoPtr->sum;
- }
- }
- }
- infoPtr++;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureBarProc --
- *
- * Sets up the appropriate configuration parameters in the GC.
- * It is assumed the parameters have been previously set by
- * a call to Blt_ConfigureWidget.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is
- * returned, then interp->result contains an error message.
- *
- * Side effects:
- * Configuration information such as bar foreground/background
- * color and stipple etc. get set in a new GC.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ConfigureBarProc(Graph *graphPtr, Element *basePtr)
-{
- ContourElement *elemPtr = (ContourElement *)basePtr;
- Blt_ChainLink link;
- ContourStyle *stylePtr;
-
- if (ConfigureContourPen(graphPtr, elemPtr->builtinPenPtr)!= TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Point to the static normal pen if no external pens have
- * been selected.
- */
- link = Blt_Chain_FirstLink(elemPtr->stylePalette);
- if (link == NULL) {
- link = Blt_Chain_AllocLink(sizeof(ContourStyle));
- Blt_Chain_LinkAfter(elemPtr->stylePalette, link, NULL);
- }
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->penPtr = NORMALPEN(elemPtr);
-
- if (Blt_ConfigModified(elemPtr->configSpecs, "-barwidth", "-*data",
- "-map*", "-label", "-hide", "-x", "-y", (char *)NULL)) {
- elemPtr->flags |= MAP_ITEM;
- }
- return TCL_OK;
-}
-
-static void
-GetContourExtentsProc(Element *basePtr, Region2d *extsPtr)
-{
- ContourElement *elemPtr = (ContourElement *)basePtr;
- Mesh *meshPtr;
-
- extsPtr->top = extsPtr->left = DBL_MAX;
- extsPtr->bottom = extsPtr->right = -DBL_MAX;
-
- meshPtr = elemPtr->meshPtr;
- if ((meshPtr == NULL) || (elemPtr->values == NULL)) {
- return; /* No mesh or values configured. */
- }
- if (meshPtr->nPoints < 3) {
- return;
- }
- extsPtr->left = (elemPtr->axes.x->logScale) ?
- meshPtr->xLogMin : meshPtr->xMin;
- extsPtr->top = (elemPtr->axes.y->logScale) ?
- meshPtr->yLogMin : meshPtr->yMin;
- extsPtr->right = meshPtr->xMax;
- extsPtr->bottom = meshPtr->yMax;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClosestBar --
- *
- * Find the bar segment closest to the window coordinates point
- * specified.
- *
- * Note: This does not return the height of the stacked segment
- * (in graph coordinates) properly.
- *
- * Results:
- * Returns 1 if the point is width any bar segment, otherwise 0.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-ClosestBarProc(
- Graph *graphPtr, /* Graph widget record */
- Element *basePtr, /* Bar element */
- ClosestSearch *searchPtr) /* Info of closest point in element */
-{
- ContourElement *elemPtr = (ContourElement *)basePtr;
- XRectangle *bp;
- double minDist;
- int imin;
- int i;
-
- minDist = searchPtr->dist;
- imin = 0;
-
- for (bp = elemPtr->bars, i = 0; i < elemPtr->nBars; i++, bp++) {
- Point2d *pp, *pend;
- Point2d outline[5];
- double left, right, top, bottom;
-
- if (PointInRectangle(bp, searchPtr->x, searchPtr->y)) {
- imin = elemPtr->barToData[i];
- minDist = 0.0;
- break;
- }
- left = bp->x, top = bp->y;
- right = (double)(bp->x + bp->width);
- bottom = (double)(bp->y + bp->height);
- outline[4].x = outline[3].x = outline[0].x = left;
- outline[4].y = outline[1].y = outline[0].y = top;
- outline[2].x = outline[1].x = right;
- outline[3].y = outline[2].y = bottom;
-
- for (pp = outline, pend = outline + 4; pp < pend; pp++) {
- Point2d t;
- double dist;
-
- t = Blt_GetProjection(searchPtr->x, searchPtr->y, pp, pp + 1);
- if (t.x > right) {
- t.x = right;
- } else if (t.x < left) {
- t.x = left;
- }
- if (t.y > bottom) {
- t.y = bottom;
- } else if (t.y < top) {
- t.y = top;
- }
- dist = hypot((t.x - searchPtr->x), (t.y - searchPtr->y));
- if (dist < minDist) {
- minDist = dist;
- imin = elemPtr->barToData[i];
- }
- }
- }
- if (minDist < searchPtr->dist) {
- searchPtr->elemPtr = (Element *)elemPtr;
- searchPtr->dist = minDist;
- searchPtr->index = imin;
- searchPtr->point.x = (double)elemPtr->x.values[imin];
- searchPtr->point.y = (double)elemPtr->y.values[imin];
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MergePens --
- *
- * Reorders the both arrays of points and errorbars to merge pens.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The old arrays are freed and new ones allocated containing
- * the reordered points and errorbars.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MergePens(ContourElement *elemPtr, ContourStyle **dataToStyle)
-{
- if (Blt_Chain_GetLength(elemPtr->stylePalette) < 2) {
- Blt_ChainLink link;
- ContourStyle *stylePtr;
-
- link = Blt_Chain_FirstLink(elemPtr->stylePalette);
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->nBars = elemPtr->nBars;
- stylePtr->bars = elemPtr->bars;
- stylePtr->symbolSize = elemPtr->bars->width / 2;
- stylePtr->xeb.length = elemPtr->xeb.length;
- stylePtr->xeb.segments = elemPtr->xeb.segments;
- stylePtr->yeb.length = elemPtr->yeb.length;
- stylePtr->yeb.segments = elemPtr->yeb.segments;
- return;
- }
- /* We have more than one style. Group bar segments of like pen
- * styles together. */
-
- if (elemPtr->nBars > 0) {
- Blt_ChainLink link;
- XRectangle *bars, *bp;
- int *ip, *barToData;
-
- bars = Blt_AssertMalloc(elemPtr->nBars * sizeof(XRectangle));
- barToData = Blt_AssertMalloc(elemPtr->nBars * sizeof(int));
- bp = bars, ip = barToData;
- for (link = Blt_Chain_FirstLink(elemPtr->stylePalette); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- ContourStyle *stylePtr;
- int i;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->symbolSize = bp->width / 2;
- stylePtr->bars = bp;
- for (i = 0; i < elemPtr->nBars; i++) {
- int iData;
-
- iData = elemPtr->barToData[i];
- if (dataToStyle[iData] == stylePtr) {
- *bp++ = elemPtr->bars[i];
- *ip++ = iData;
- }
- }
- stylePtr->nBars = bp - stylePtr->bars;
- }
- Blt_Free(elemPtr->bars);
- Blt_Free(elemPtr->barToData);
- elemPtr->bars = bars;
- elemPtr->barToData = barToData;
- }
-
- if (elemPtr->xeb.length > 0) {
- Blt_ChainLink link;
- Segment2d *bars, *sp;
- int *map, *ip;
-
- bars = Blt_AssertMalloc(elemPtr->xeb.length * sizeof(Segment2d));
- map = Blt_AssertMalloc(elemPtr->xeb.length * sizeof(int));
- sp = bars, ip = map;
- for (link = Blt_Chain_FirstLink(elemPtr->stylePalette);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- ContourStyle *stylePtr;
- int i;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->xeb.segments = sp;
- for (i = 0; i < elemPtr->xeb.length; i++) {
- int iData;
-
- iData = elemPtr->xeb.map[i];
- if (dataToStyle[iData] == stylePtr) {
- *sp++ = elemPtr->xeb.segments[i];
- *ip++ = iData;
- }
- }
- stylePtr->xeb.length = sp - stylePtr->xeb.segments;
- }
- Blt_Free(elemPtr->xeb.segments);
- elemPtr->xeb.segments = bars;
- Blt_Free(elemPtr->xeb.map);
- elemPtr->xeb.map = map;
- }
- if (elemPtr->yeb.length > 0) {
- Blt_ChainLink link;
- Segment2d *bars, *sp;
- int *map, *ip;
-
- bars = Blt_AssertMalloc(elemPtr->yeb.length * sizeof(Segment2d));
- map = Blt_AssertMalloc(elemPtr->yeb.length * sizeof(int));
- sp = bars, ip = map;
- for (link = Blt_Chain_FirstLink(elemPtr->stylePalette); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- ContourStyle *stylePtr;
- int i;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->yeb.segments = sp;
- for (i = 0; i < elemPtr->yeb.length; i++) {
- int iData;
-
- iData = elemPtr->yeb.map[i];
- if (dataToStyle[iData] == stylePtr) {
- *sp++ = elemPtr->yeb.segments[i];
- *ip++ = iData;
- }
- }
- stylePtr->yeb.length = sp - stylePtr->yeb.segments;
- }
- Blt_Free(elemPtr->yeb.segments);
- elemPtr->yeb.segments = bars;
- Blt_Free(elemPtr->yeb.map);
- elemPtr->yeb.map = map;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapActiveBars --
- *
- * Creates an array of points of the active graph coordinates.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is freed and allocated for the active point array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapActiveBars(ContourElement *elemPtr)
-{
- if (elemPtr->activeRects != NULL) {
- Blt_Free(elemPtr->activeRects);
- elemPtr->activeRects = NULL;
- }
- if (elemPtr->activeToData != NULL) {
- Blt_Free(elemPtr->activeToData);
- elemPtr->activeToData = NULL;
- }
- elemPtr->nActive = 0;
-
- if (elemPtr->nActiveIndices > 0) {
- XRectangle *activeRects;
- int *activeToData;
- int i;
- int count;
-
- activeRects = Blt_AssertMalloc(sizeof(XRectangle) *
- elemPtr->nActiveIndices);
- activeToData = Blt_AssertMalloc(sizeof(int) *
- elemPtr->nActiveIndices);
- count = 0;
- for (i = 0; i < elemPtr->nBars; i++) {
- int *ip, *iend;
-
- for (ip = elemPtr->activeIndices,
- iend = ip + elemPtr->nActiveIndices; ip < iend; ip++) {
- if (elemPtr->barToData[i] == *ip) {
- activeRects[count] = elemPtr->bars[i];
- activeToData[count] = i;
- count++;
- }
- }
- }
- elemPtr->nActive = count;
- elemPtr->activeRects = activeRects;
- elemPtr->activeToData = activeToData;
- }
- elemPtr->flags &= ~ACTIVE_PENDING;
-}
-
-static void
-ResetBar(ContourElement *elemPtr)
-{
- /* Release any storage associated with the display of the bar */
- ResetStylePalette(elemPtr->stylePalette);
- if (elemPtr->activeRects != NULL) {
- Blt_Free(elemPtr->activeRects);
- }
- if (elemPtr->activeToData != NULL) {
- Blt_Free(elemPtr->activeToData);
- }
- if (elemPtr->xeb.segments != NULL) {
- Blt_Free(elemPtr->xeb.segments);
- }
- if (elemPtr->xeb.map != NULL) {
- Blt_Free(elemPtr->xeb.map);
- }
- if (elemPtr->yeb.segments != NULL) {
- Blt_Free(elemPtr->yeb.segments);
- }
- if (elemPtr->yeb.map != NULL) {
- Blt_Free(elemPtr->yeb.map);
- }
- if (elemPtr->bars != NULL) {
- Blt_Free(elemPtr->bars);
- }
- if (elemPtr->barToData != NULL) {
- Blt_Free(elemPtr->barToData);
- }
- elemPtr->activeToData = elemPtr->xeb.map = elemPtr->yeb.map =
- elemPtr->barToData = NULL;
- elemPtr->activeRects = elemPtr->bars = NULL;
- elemPtr->xeb.segments = elemPtr->yeb.segments = NULL;
- elemPtr->nActive = elemPtr->xeb.length = elemPtr->yeb.length =
- elemPtr->nBars = 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MapErrorBars --
- *
- * Creates two arrays of points and pen indices, filled with
- * the screen coordinates of the visible
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is freed and allocated for the index array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapErrorBars(Graph *graphPtr, ContourElement *elemPtr, ContourStyle **dataToStyle)
-{
- int n, nPoints;
- Region2d exts;
-
- Blt_GraphExtents(graphPtr, &exts);
- nPoints = NUMBEROFPOINTS(elemPtr);
- if (elemPtr->xError.nValues > 0) {
- n = MIN(elemPtr->xError.nValues, nPoints);
- } else {
- n = MIN3(elemPtr->xHigh.nValues, elemPtr->xLow.nValues, nPoints);
- }
- if (n > 0) {
- Segment2d *bars;
- Segment2d *segPtr;
- int *map;
- int *indexPtr;
- int i;
-
- segPtr = bars = Blt_AssertMalloc(n * 3 * sizeof(Segment2d));
- indexPtr = map = Blt_AssertMalloc(n * 3 * sizeof(int));
- for (i = 0; i < n; i++) {
- double x, y;
- double high, low;
- ContourStyle *stylePtr;
-
- x = elemPtr->x.values[i];
- y = elemPtr->y.values[i];
- stylePtr = dataToStyle[i];
- if ((FINITE(x)) && (FINITE(y))) {
- if (elemPtr->xError.nValues > 0) {
- high = x + elemPtr->xError.values[i];
- low = x - elemPtr->xError.values[i];
- } else {
- high = elemPtr->xHigh.values[i];
- low = elemPtr->xLow.values[i];
- }
- if ((FINITE(high)) && (FINITE(low))) {
- Point2d p, q;
-
- p = Blt_Map2D(graphPtr, high, y, &elemPtr->axes);
- q = Blt_Map2D(graphPtr, low, y, &elemPtr->axes);
- segPtr->p = p;
- segPtr->q = q;
- if (Blt_LineRectClip(&exts, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- /* Left cap */
- segPtr->p.x = segPtr->q.x = p.x;
- segPtr->p.y = p.y - stylePtr->errorBarCapWidth;
- segPtr->q.y = p.y + stylePtr->errorBarCapWidth;
- if (Blt_LineRectClip(&exts, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- /* Right cap */
- segPtr->p.x = segPtr->q.x = q.x;
- segPtr->p.y = q.y - stylePtr->errorBarCapWidth;
- segPtr->q.y = q.y + stylePtr->errorBarCapWidth;
- if (Blt_LineRectClip(&exts, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- }
- }
- }
- elemPtr->xeb.segments = bars;
- elemPtr->xeb.length = segPtr - bars;
- elemPtr->xeb.map = map;
- }
- if (elemPtr->yError.nValues > 0) {
- n = MIN(elemPtr->yError.nValues, nPoints);
- } else {
- n = MIN3(elemPtr->yHigh.nValues, elemPtr->yLow.nValues, nPoints);
- }
- if (n > 0) {
- Segment2d *bars;
- Segment2d *segPtr;
- int *map;
- int *indexPtr;
- int i;
-
- segPtr = bars = Blt_AssertMalloc(n * 3 * sizeof(Segment2d));
- indexPtr = map = Blt_AssertMalloc(n * 3 * sizeof(int));
- for (i = 0; i < n; i++) {
- double x, y;
- double high, low;
- ContourStyle *stylePtr;
-
- x = elemPtr->x.values[i];
- y = elemPtr->y.values[i];
- stylePtr = dataToStyle[i];
- if ((FINITE(x)) && (FINITE(y))) {
- if (elemPtr->yError.nValues > 0) {
- high = y + elemPtr->yError.values[i];
- low = y - elemPtr->yError.values[i];
- } else {
- high = elemPtr->yHigh.values[i];
- low = elemPtr->yLow.values[i];
- }
- if ((FINITE(high)) && (FINITE(low))) {
- Point2d p, q;
-
- p = Blt_Map2D(graphPtr, x, high, &elemPtr->axes);
- q = Blt_Map2D(graphPtr, x, low, &elemPtr->axes);
- segPtr->p = p;
- segPtr->q = q;
- if (Blt_LineRectClip(&exts, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- /* Top cap. */
- segPtr->p.y = segPtr->q.y = p.y;
- segPtr->p.x = p.x - stylePtr->errorBarCapWidth;
- segPtr->q.x = p.x + stylePtr->errorBarCapWidth;
- if (Blt_LineRectClip(&exts, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- /* Bottom cap. */
- segPtr->p.y = segPtr->q.y = q.y;
- segPtr->p.x = q.x - stylePtr->errorBarCapWidth;
- segPtr->q.x = q.x + stylePtr->errorBarCapWidth;
- if (Blt_LineRectClip(&exts, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- }
- }
- }
- elemPtr->yeb.segments = bars;
- elemPtr->yeb.length = segPtr - bars;
- elemPtr->yeb.map = map;
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapContourElementProc --
- *
- * Calculates the actual window coordinates of the bar element.
- * The window coordinates are saved in the bar element structure.
- *
- * Results:
- * None.
- *
- * Notes:
- * A bar can have multiple segments (more than one x,y pairs).
- * In this case, the bar can be represented as either a set of
- * non-contiguous bars or a single multi-segmented (stacked) bar.
- *
- * The x-axis layout for a contour plot may be presented in one of
- * two ways. If abscissas are used, the bars are placed at those
- * coordinates. Otherwise, the range will represent the number
- * of values.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapContourElementProc(Graph *graphPtr, Element *basePtr)
-{
- ContourElement *elemPtr = (ContourElement *)basePtr;
- ContourStyle **dataToStyle;
- double *x, *y;
- double barWidth, barOffset;
- double baseline;
- int *barToData; /* Maps bars to data point indices */
- int invertBar;
- int nPoints, count;
- XRectangle *rp, *bars;
- int i;
- int size;
-
- ResetBar(elemPtr);
- nPoints = NUMBEROFPOINTS(elemPtr);
- if (nPoints < 1) {
- return; /* No data points */
- }
- barWidth = graphPtr->barWidth;
- if (elemPtr->barWidth > 0.0) {
- barWidth = elemPtr->barWidth;
- }
- baseline = (elemPtr->axes.y->logScale) ? 1.0 : graphPtr->baseline;
- barOffset = barWidth * 0.5;
-
- /*
- * Create an array of bars representing the screen coordinates
- * of all the segments in the bar.
- */
- bars = Blt_AssertCalloc(nPoints, sizeof(XRectangle));
- barToData = Blt_AssertCalloc(nPoints, sizeof(int));
-
- x = elemPtr->x.values, y = elemPtr->y.values;
- count = 0;
- for (rp = bars, i = 0; i < nPoints; i++) {
- Point2d c1, c2; /* Two opposite corners of the rectangle
- * in graph coordinates. */
- double dx, dy;
- int height;
-
- if (((x[i] - barWidth) > elemPtr->axes.x->axisRange.max) ||
- ((x[i] + barWidth) < elemPtr->axes.x->axisRange.min)) {
- continue; /* Abscissa is out of range of the x-axis */
- }
- c1.x = x[i] - barOffset;
- c1.y = y[i];
- c2.x = c1.x + barWidth;
- c2.y = baseline;
-
- /*
- * If the mode is "aligned" or "stacked" we need to adjust the
- * x or y coordinates of the two corners.
- */
-
- if ((graphPtr->nStacks > 0) && (graphPtr->mode != MODE_INFRONT)) {
- Blt_HashEntry *hPtr;
- FreqKey key;
-
- key.value = x[i];
- key.axes = elemPtr->axes;
- hPtr = Blt_FindHashEntry(&graphPtr->freqTable, (char *)&key);
- if (hPtr != NULL) {
- FreqInfo *infoPtr;
- double slice, width;
-
- infoPtr = Blt_GetHashValue(hPtr);
- switch (graphPtr->mode) {
- case MODE_STACKED:
- c2.y = infoPtr->lastY;
- c1.y += c2.y;
- infoPtr->lastY = c1.y;
- break;
-
- case MODE_ALIGNED:
- infoPtr->count++;
- slice = barWidth / (double)infoPtr->freq;
- c1.x += slice * (infoPtr->freq - infoPtr->count);
- c2.x = c1.x + slice;
- break;
-
- case MODE_OVERLAP:
- infoPtr->count++;
- slice = barWidth / (double)(infoPtr->freq * 2);
- width = slice * (infoPtr->freq + 1);
- c1.x += slice * (infoPtr->freq - infoPtr->count);
- c2.x = c1.x + width;
- break;
- case MODE_INFRONT:
- break;
- }
- }
- }
- invertBar = FALSE;
- if (c1.y < c2.y) {
- double temp;
-
- /* Handle negative bar values by swapping ordinates */
- temp = c1.y, c1.y = c2.y, c2.y = temp;
- invertBar = TRUE;
- }
- /*
- * Get the two corners of the bar segment and compute the rectangle
- */
- c1 = Blt_Map2D(graphPtr, c1.x, c1.y, &elemPtr->axes);
- c2 = Blt_Map2D(graphPtr, c2.x, c2.y, &elemPtr->axes);
-
- /* Bound the bars horizontally by the width of the graph window */
- /* Bound the bars vertically by the position of the axis. */
- if (graphPtr->stackAxes) {
- int right, left, top, bottom;
-
- if (graphPtr->inverted) {
- left = elemPtr->axes.y->screenMin;
- right = elemPtr->axes.y->screenMin +
- elemPtr->axes.y->screenRange;
- top = graphPtr->top;
- bottom = graphPtr->bottom;
- } else {
- top = elemPtr->axes.y->screenMin;
- bottom = elemPtr->axes.y->screenMin +
- elemPtr->axes.y->screenRange;
- left = graphPtr->left;
- right = graphPtr->right;
- }
- if (c1.y < (double)top) {
- c1.y = (double)top;
- } else if (c1.y > (double)bottom) {
- c1.y = (double)bottom;
- }
- if (c2.y < (double)top) {
- c2.y = (double)top;
- } else if (c2.y > (double)bottom) {
- c2.y = (double)bottom;
- }
- if (c1.x < (double)left) {
- c1.x = (double)left;
- } else if (c1.x > (double)right) {
- c1.x = (double)right;
- }
- if (c2.x < (double)left) {
- c2.x = (double)left;
- } else if (c2.x > (double)right) {
- c2.x = (double)right;
- }
- } else {
- int right, left, top, bottom;
-
- if (graphPtr->inverted) {
- top = graphPtr->left;
- bottom = graphPtr->right;
- left = graphPtr->top;
- right = graphPtr->bottom;
- } else {
- top = graphPtr->top;
- bottom = graphPtr->bottom;
- left = graphPtr->left;
- right = graphPtr->right;
- }
-
- if (c1.y < 0.0) {
- c1.y = 0.0;
- } else if (c1.y > (double)graphPtr->height) {
- c1.y = (double)graphPtr->height;
- }
- if (c2.y < 0.0) {
- c2.y = 0.0;
- } else if (c2.y > (double)graphPtr->height) {
- c2.y = (double)graphPtr->height;
- }
- }
- dx = FABS(c1.x - c2.x);
- dy = FABS(c1.y - c2.y);
- if ((dx == 0) || (dy == 0)) {
- continue;
- }
- height = (int)dy;
- if (invertBar) {
- rp->y = (short int)MIN(c1.y, c2.y);
- } else {
- rp->y = (short int)(MAX(c1.y, c2.y)) - height;
- }
- rp->x = (short int)MIN(c1.x, c2.x);
- rp->width = (short int)dx + 1;
- if (rp->width < 1) {
- rp->width = 1;
- }
- rp->height = height + 1;
- if (rp->height < 1) {
- rp->height = 1;
- }
- barToData[count] = i; /* Save the data index corresponding to the
- * rectangle */
- count++;
- rp++;
- }
- elemPtr->nBars = count;
- elemPtr->bars = bars;
- elemPtr->barToData = barToData;
- if (elemPtr->nActiveIndices > 0) {
- MapActiveBars(elemPtr);
- }
-
- size = 20;
- if (count > 0) {
- size = bars->width;
- }
- {
- Blt_ChainLink link;
-
- /* Set the symbol size of all the pen styles. */
- for (link = Blt_Chain_FirstLink(elemPtr->stylePalette); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- ContourStyle *stylePtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->symbolSize = size;
- stylePtr->errorBarCapWidth =
- (stylePtr->penPtr->errorBarCapWidth > 0)
- ? stylePtr->penPtr->errorBarCapWidth : (size * 66666) / 100000;
- stylePtr->errorBarCapWidth /= 2;
- }
- }
- dataToStyle = (ContourStyle **)Blt_StyleMap((Element *)elemPtr);
- if (((elemPtr->yHigh.nValues > 0) && (elemPtr->yLow.nValues > 0)) ||
- ((elemPtr->xHigh.nValues > 0) && (elemPtr->xLow.nValues > 0)) ||
- (elemPtr->xError.nValues > 0) || (elemPtr->yError.nValues > 0)) {
- MapErrorBars(graphPtr, elemPtr, dataToStyle);
- }
- MergePens(elemPtr, dataToStyle);
- Blt_Free(dataToStyle);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawSymbolProc --
- *
- * Draw a symbol centered at the given x,y window coordinate
- * based upon the element symbol type and size.
- *
- * Results:
- * None.
- *
- * Problems:
- * Most notable is the round-off errors generated when
- * calculating the centered position of the symbol.
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-DrawSymbolProc(
- Graph *graphPtr,
- Drawable drawable, /* Pixmap or window to draw into */
- Element *basePtr,
- int x, int y,
- int size)
-{
- ContourElement *elemPtr = (ContourElement *)basePtr;
- ContourPen *penPtr;
- int radius;
-
- penPtr = NORMALPEN(elemPtr);
- if ((penPtr->bg == NULL) && (penPtr->fgColor == NULL)) {
- return;
- }
- radius = (size / 2);
- size--;
-
- x -= radius;
- y -= radius;
- XSetTSOrigin(graphPtr->display, penPtr->gc, x, y);
- XFillRectangle(graphPtr->display, drawable, penPtr->gc, x, y, size, size);
- XSetTSOrigin(graphPtr->display, penPtr->gc, 0, 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawContourSegments --
- *
- * Draws each of the rectangular segments for the element.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawContourSegments(
- Graph *graphPtr,
- Drawable drawable, /* Pixmap or window to draw into */
- ContourPen *penPtr,
- XRectangle *bars,
- int nBars)
-{
-
- if ((penPtr->bg == NULL) && (penPtr->fgColor == NULL)) {
- return;
- }
- if (penPtr->bg != NULL) {
- XRectangle *rp, *rend;
-
- for (rp = bars, rend = rp + nBars; rp < rend; rp++) {
- Blt_FillBackgroundRectangle(graphPtr->tkwin, drawable, penPtr->bg,
- rp->x, rp->y, rp->width, rp->height, penPtr->borderWidth,
- penPtr->relief);
- }
- }
- if (penPtr->fgColor != NULL) {
- XFillRectangles(graphPtr->display, drawable, penPtr->gc, bars, nBars);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawContourValues --
- *
- * Draws the numeric value of the bar.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawContourValues(
- Graph *graphPtr,
- Drawable drawable,
- ContourElement *elemPtr,
- ContourPen *penPtr,
- XRectangle *bars,
- int nBars,
- int *barToData)
-{
- XRectangle *rp, *rend;
- int count;
- char *fmt;
-
- fmt = penPtr->valueFormat;
- if (fmt == NULL) {
- fmt = "%g";
- }
- count = 0;
- for (rp = bars, rend = rp + nBars; rp < rend; rp++) {
- Point2d anchorPos;
- double x, y;
- char string[TCL_DOUBLE_SPACE * 2 + 2];
-
- x = elemPtr->x.values[barToData[count]];
- y = elemPtr->y.values[barToData[count]];
-
- count++;
- if (penPtr->valueShow == SHOW_X) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, x);
- } else if (penPtr->valueShow == SHOW_Y) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, y);
- } else if (penPtr->valueShow == SHOW_BOTH) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, x);
- strcat(string, ",");
- sprintf_s(string + strlen(string), TCL_DOUBLE_SPACE, fmt, y);
- }
- if (graphPtr->inverted) {
- anchorPos.y = rp->y + rp->height * 0.5;
- anchorPos.x = rp->x + rp->width;
- if (y < graphPtr->baseline) {
- anchorPos.x -= rp->width;
- }
- } else {
- anchorPos.x = rp->x + rp->width * 0.5;
- anchorPos.y = rp->y;
- if (y < graphPtr->baseline) {
- anchorPos.y += rp->height;
- }
- }
- Blt_DrawText(graphPtr->tkwin, drawable, string, &penPtr->valueStyle,
- (int)anchorPos.x, (int)anchorPos.y);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawNormalContourProc --
- *
- * Draws the rectangle representing the bar element. If the
- * relief option is set to "raised" or "sunken" and the bar
- * borderwidth is set (borderwidth > 0), a 3D border is drawn
- * around the bar.
- *
- * Don't draw bars that aren't visible (i.e. within the limits
- * of the axis).
- *
- * Results:
- * None.
- *
- * Side effects:
- * X drawing commands are output.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawNormalContourProc(Graph *graphPtr, Drawable drawable, Element *basePtr)
-{
- ContourElement *elemPtr = (ContourElement *)basePtr;
- int count;
- Blt_ChainLink link;
-
- count = 0;
- for (link = Blt_Chain_FirstLink(elemPtr->stylePalette); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- ContourStyle *stylePtr;
- ContourPen *penPtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- penPtr = stylePtr->penPtr;
- if (stylePtr->nBars > 0) {
- DrawBarSegments(graphPtr, drawable, penPtr, stylePtr->bars,
- stylePtr->nBars);
- }
- if ((stylePtr->xeb.length > 0) && (penPtr->errorBarShow & SHOW_X)) {
- Blt_Draw2DSegments(graphPtr->display, drawable, penPtr->errorBarGC,
- stylePtr->xeb.segments, stylePtr->xeb.length);
- }
- if ((stylePtr->yeb.length > 0) && (penPtr->errorBarShow & SHOW_Y)) {
- Blt_Draw2DSegments(graphPtr->display, drawable, penPtr->errorBarGC,
- stylePtr->yeb.segments, stylePtr->yeb.length);
- }
- if (penPtr->valueShow != SHOW_NONE) {
- DrawBarValues(graphPtr, drawable, elemPtr, penPtr,
- stylePtr->bars, stylePtr->nBars,
- elemPtr->barToData + count);
- }
- count += stylePtr->nBars;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawActiveContourProc --
- *
- * Draws contours representing the active segments of the
- * bar element. If the -relief option is set (other than "flat")
- * and the borderwidth is greater than 0, a 3D border is drawn
- * around the each bar segment.
- *
- * Results:
- * None.
- *
- * Side effects:
- * X drawing commands are output.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawActiveContourProc(Graph *graphPtr, Drawable drawable, Element *basePtr)
-{
- ContourElement *elemPtr = (ContourElement *)basePtr;
-
- if (elemPtr->activePenPtr != NULL) {
- ContourPen *penPtr = elemPtr->activePenPtr;
-
- if (elemPtr->nActiveIndices > 0) {
- if (elemPtr->flags & ACTIVE_PENDING) {
- MapActiveBars(elemPtr);
- }
- DrawBarSegments(graphPtr, drawable, penPtr, elemPtr->activeRects,
- elemPtr->nActive);
- if (penPtr->valueShow != SHOW_NONE) {
- DrawBarValues(graphPtr, drawable, elemPtr, penPtr,
- elemPtr->activeRects, elemPtr->nActive,
- elemPtr->activeToData);
- }
- } else if (elemPtr->nActiveIndices < 0) {
- DrawBarSegments(graphPtr, drawable, penPtr, elemPtr->bars,
- elemPtr->nBars);
- if (penPtr->valueShow != SHOW_NONE) {
- DrawBarValues(graphPtr, drawable, elemPtr, penPtr,
- elemPtr->bars, elemPtr->nBars, elemPtr->barToData);
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SymbolToPostScript --
- *
- * Draw a symbol centered at the given x,y window coordinate
- * based upon the element symbol type and size.
- *
- * Results:
- * None.
- *
- * Problems:
- * Most notable is the round-off errors generated when
- * calculating the centered position of the symbol.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-SymbolToPostScriptProc(
- Graph *graphPtr,
- Blt_Ps ps,
- Element *basePtr,
- double x, double y,
- int size)
-{
- ContourElement *elemPtr = (ContourElement *)basePtr;
- ContourPen *penPtr;
-
- penPtr = NORMALPEN(elemPtr);
- if ((penPtr->bg == NULL) && (penPtr->fgColor == NULL)) {
- return;
- }
- /*
- * Build a PostScript procedure to draw the fill and outline of
- * the symbol after the path of the symbol shape has been formed
- */
- Blt_Ps_VarAppend(ps, "\n",
- "/DrawSymbolProc {\n",
- " gsave\n ", (char *)NULL);
- if (penPtr->stipple != None) {
- if (penPtr->bg != NULL) {
- Blt_Ps_XSetBackground(ps, Blt_BackgroundBorderColor(penPtr->bg));
- Blt_Ps_Append(ps, " gsave fill grestore\n ");
- }
- if (penPtr->fgColor != NULL) {
- Blt_Ps_XSetForeground(ps, penPtr->fgColor);
- } else {
- Blt_Ps_XSetForeground(ps, Blt_BackgroundBorderColor(penPtr->bg));
- }
- Blt_Ps_XSetStipple(ps, graphPtr->display, penPtr->stipple);
- } else if (penPtr->fgColor != NULL) {
- Blt_Ps_XSetForeground(ps, penPtr->fgColor);
- Blt_Ps_Append(ps, " fill\n");
- }
- Blt_Ps_Append(ps, " grestore\n");
- Blt_Ps_Append(ps, "} def\n\n");
- Blt_Ps_Format(ps, "%g %g %d Sq\n", x, y, size);
-}
-
-static void
-SegmentsToPostScript(
- Graph *graphPtr,
- Blt_Ps ps,
- ContourPen *penPtr,
- XRectangle *bars,
- int nBars)
-{
- XRectangle *rp, *rend;
-
- if ((penPtr->bg == NULL) && (penPtr->fgColor == NULL)) {
- return;
- }
- for (rp = bars, rend = rp + nBars; rp < rend; rp++) {
- if ((rp->width < 1) || (rp->height < 1)) {
- continue;
- }
- if (penPtr->stipple != None) {
- Blt_Ps_Rectangle(ps, rp->x, rp->y, rp->width - 1, rp->height - 1);
- if (penPtr->bg != NULL) {
- Blt_Ps_XSetBackground(ps,Blt_BackgroundBorderColor(penPtr->bg));
- Blt_Ps_Append(ps, "gsave fill grestore\n");
- }
- if (penPtr->fgColor != NULL) {
- Blt_Ps_XSetForeground(ps, penPtr->fgColor);
- } else {
- Blt_Ps_XSetForeground(ps,Blt_BackgroundBorderColor(penPtr->bg));
- }
- Blt_Ps_XSetStipple(ps, graphPtr->display, penPtr->stipple);
- } else if (penPtr->fgColor != NULL) {
- Blt_Ps_XSetForeground(ps, penPtr->fgColor);
- Blt_Ps_XFillRectangle(ps, (double)rp->x, (double)rp->y,
- (int)rp->width - 1, (int)rp->height - 1);
- }
- if ((penPtr->bg != NULL) && (penPtr->borderWidth > 0) &&
- (penPtr->relief != TK_RELIEF_FLAT)) {
- Blt_Ps_Draw3DRectangle(ps, Blt_BackgroundBorder(penPtr->bg),
- (double)rp->x, (double)rp->y, (int)rp->width, (int)rp->height,
- penPtr->borderWidth, penPtr->relief);
- }
- }
-}
-
-static void
-BarValuesToPostScript(
- Graph *graphPtr,
- Blt_Ps ps,
- ContourElement *elemPtr,
- ContourPen *penPtr,
- XRectangle *bars,
- int nBars,
- int *barToData)
-{
- XRectangle *rp, *rend;
- int count;
- char *fmt;
- char string[TCL_DOUBLE_SPACE * 2 + 2];
- double x, y;
- Point2d anchorPos;
-
- count = 0;
- fmt = penPtr->valueFormat;
- if (fmt == NULL) {
- fmt = "%g";
- }
- for (rp = bars, rend = rp + nBars; rp < rend; rp++) {
- x = elemPtr->x.values[barToData[count]];
- y = elemPtr->y.values[barToData[count]];
- count++;
- if (penPtr->valueShow == SHOW_X) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, x);
- } else if (penPtr->valueShow == SHOW_Y) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, y);
- } else if (penPtr->valueShow == SHOW_BOTH) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, x);
- strcat(string, ",");
- sprintf_s(string + strlen(string), TCL_DOUBLE_SPACE, fmt, y);
- }
- if (graphPtr->inverted) {
- anchorPos.y = rp->y + rp->height * 0.5;
- anchorPos.x = rp->x + rp->width;
- if (y < graphPtr->baseline) {
- anchorPos.x -= rp->width;
- }
- } else {
- anchorPos.x = rp->x + rp->width * 0.5;
- anchorPos.y = rp->y;
- if (y < graphPtr->baseline) {
- anchorPos.y += rp->height;
- }
- }
- Blt_Ps_DrawText(ps, string, &penPtr->valueStyle, anchorPos.x,
- anchorPos.y);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActiveBarToPostScript --
- *
- * Similar to the NormalBarToPostScript procedure, generates
- * PostScript commands to display the bars representing the
- * active bar segments of the element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * PostScript pen width, dashes, and color settings are changed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-ActiveBarToPostScriptProc(
- Graph *graphPtr,
- Blt_Ps ps,
- Element *basePtr)
-{
- ContourElement *elemPtr = (ContourElement *)basePtr;
-
- if (elemPtr->activePenPtr != NULL) {
- ContourPen *penPtr = elemPtr->activePenPtr;
-
- if (elemPtr->nActiveIndices > 0) {
- if (elemPtr->flags & ACTIVE_PENDING) {
- MapActiveBars(elemPtr);
- }
- SegmentsToPostScript(graphPtr, ps, penPtr, elemPtr->activeRects,
- elemPtr->nActive);
- if (penPtr->valueShow != SHOW_NONE) {
- BarValuesToPostScript(graphPtr, ps, elemPtr, penPtr,
- elemPtr->activeRects, elemPtr->nActive, elemPtr->activeToData);
- }
- } else if (elemPtr->nActiveIndices < 0) {
- SegmentsToPostScript(graphPtr, ps, penPtr, elemPtr->bars,
- elemPtr->nBars);
- if (penPtr->valueShow != SHOW_NONE) {
- BarValuesToPostScript(graphPtr, ps, elemPtr, penPtr,
- elemPtr->bars, elemPtr->nBars, elemPtr->barToData);
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NormalBarToPostScript --
- *
- * Generates PostScript commands to form the bars
- * representing the segments of the bar element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * PostScript pen width, dashes, and color settings are changed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-NormalBarToPostScriptProc(
- Graph *graphPtr,
- Blt_Ps ps,
- Element *basePtr)
-{
- ContourElement *elemPtr = (ContourElement *)basePtr;
- Blt_ChainLink link;
- int count;
-
- count = 0;
- for (link = Blt_Chain_FirstLink(elemPtr->stylePalette); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- ContourStyle *stylePtr;
- ContourPen *penPtr;
- XColor *colorPtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- penPtr = stylePtr->penPtr;
- if (stylePtr->nBars > 0) {
- SegmentsToPostScript(graphPtr, ps, penPtr, stylePtr->bars,
- stylePtr->nBars);
- }
- colorPtr = penPtr->errorBarColor;
- if (colorPtr == COLOR_DEFAULT) {
- colorPtr = penPtr->fgColor;
- }
- if ((stylePtr->xeb.length > 0) && (penPtr->errorBarShow & SHOW_X)) {
- Blt_Ps_XSetLineAttributes(ps, colorPtr,
- penPtr->errorBarLineWidth, NULL, CapButt, JoinMiter);
- Blt_Ps_Draw2DSegments(ps, stylePtr->xeb.segments,
- stylePtr->xeb.length);
- }
- if ((stylePtr->yeb.length > 0) && (penPtr->errorBarShow & SHOW_Y)) {
- Blt_Ps_XSetLineAttributes(ps, colorPtr,
- penPtr->errorBarLineWidth, NULL, CapButt, JoinMiter);
- Blt_Ps_Draw2DSegments(ps, stylePtr->yeb.segments,
- stylePtr->yeb.length);
- }
- if (penPtr->valueShow != SHOW_NONE) {
- BarValuesToPostScript(graphPtr, ps, elemPtr, penPtr,
- stylePtr->bars, stylePtr->nBars, elemPtr->barToData + count);
- }
- count += stylePtr->nBars;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyBar --
- *
- * Release memory and resources allocated for the bar element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the bar element is freed up.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-DestroyBarProc(Graph *graphPtr, Element *basePtr)
-{
- ContourElement *elemPtr = (ContourElement *)basePtr;
-
- DestroyContourPen(graphPtr, elemPtr->builtinPenPtr);
- if (elemPtr->activePenPtr != NULL) {
- Blt_FreePen((Pen *)elemPtr->activePenPtr);
- }
- ResetBar(elemPtr);
- if (elemPtr->stylePalette != NULL) {
- Blt_FreeStylePalette(elemPtr->stylePalette);
- Blt_Chain_Destroy(elemPtr->stylePalette);
- }
- if (elemPtr->activeIndices != NULL) {
- Blt_Free(elemPtr->activeIndices);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ContourElement --
- *
- * Allocate memory and initialize methods for the new bar element.
- *
- * Results:
- * The pointer to the newly allocated element structure is returned.
- *
- * Side effects:
- * Memory is allocated for the bar element structure.
- *
- *---------------------------------------------------------------------------
- */
-
-static ElementProcs barProcs =
-{
- ClosestBarProc,
- ConfigureBarProc,
- DestroyBarProc,
- DrawActiveBarProc,
- DrawNormalBarProc,
- DrawSymbolProc,
- GetBarExtentsProc,
- ActiveBarToPostScriptProc,
- NormalBarToPostScriptProc,
- SymbolToPostScriptProc,
- MapBarProc,
-};
-
-
-Element *
-Blt_ContourElement(Graph *graphPtr, char *name, ClassId classId)
-{
- ContourElement *elemPtr;
-
- elemPtr = Blt_AssertCalloc(1, sizeof(ContourElement));
- elemPtr->procsPtr = &barProcs;
- elemPtr->configSpecs = contourElemConfigSpecs;
- elemPtr->legendRelief = TK_RELIEF_FLAT;
- Blt_GraphSetObjectClass(&elemPtr->object, classId);
- elemPtr->obj.name = Blt_AssertStrdup(name);
- elemPtr->obj.graphPtr = graphPtr;
-
- /* By default, an element's name and label are the same. */
- elemPtr->label = Blt_AssertStrdup(name);
- elemPtr->builtinPenPtr = &elemPtr->builtinPen;
- InitContourPen(elemPtr->builtinPenPtr);
- elemPtr->stylePalette = Blt_Chain_Create();
- bltContourStylesOption.clientData = (ClientData)sizeof(ContourStyle);
- return (Element *)elemPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_InitFreqTable --
- *
- * Generate a table of abscissa frequencies. Duplicate
- * x-coordinates (depending upon the bar drawing mode) indicate
- * that something special should be done with each bar segment
- * mapped to the same abscissa (i.e. it should be stacked,
- * aligned, or overlay-ed with other segments)
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is allocated for the bar element structure.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_InitFreqTable(Graph *graphPtr)
-{
- Blt_ChainLink link;
- int nStacks, nSegs;
- Blt_HashTable freqTable;
-
- /*
- * Free resources associated with a previous frequency table. This
- * includes the array of frequency information and the table itself
- */
- if (graphPtr->freqArr != NULL) {
- Blt_Free(graphPtr->freqArr);
- graphPtr->freqArr = NULL;
- }
- if (graphPtr->nStacks > 0) {
- Blt_DeleteHashTable(&graphPtr->freqTable);
- graphPtr->nStacks = 0;
- }
- if (graphPtr->mode == MODE_INFRONT) {
- return; /* No frequency table is needed for
- * "infront" mode */
- }
- Blt_InitHashTable(&graphPtr->freqTable, sizeof(FreqKey) / sizeof(int));
-
- /*
- * Initialize a hash table and fill it with unique abscissas.
- * Keep track of the frequency of each x-coordinate and how many
- * abscissas have duplicate mappings.
- */
- Blt_InitHashTable(&freqTable, sizeof(FreqKey) / sizeof(int));
- nSegs = nStacks = 0;
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- ContourElement *elemPtr;
- double *xArr;
- int nPoints;
- int i;
-
- elemPtr = Blt_Chain_GetValue(link);
- if ((elemPtr->flags & (HIDE|DELETE_PENDING) ||
- (elemPtr->obj.classId != CID_ELEM_CONTOUR)) {
- continue;
- }
- nSegs++;
- xArr = elemPtr->x.values;
- nPoints = NUMBEROFPOINTS(elemPtr);
- for (i = 0; i < nPoints; i++) {
- Blt_HashEntry *hPtr;
- FreqKey key;
- int isNew;
- size_t count;
-
- key.value = xArr[i];
- key.axes = elemPtr->axes;
- hPtr = Blt_CreateHashEntry(&freqTable, (char *)&key, &isNew);
- if (isNew) {
- count = 1;
- } else {
- count = (size_t)Blt_GetHashValue(hPtr);
- if (count == 1) {
- nStacks++;
- }
- count++;
- }
- Blt_SetHashValue(hPtr, (ClientData)count);
- }
- }
- if (nSegs == 0) {
- return; /* No bar elements to be displayed */
- }
- if (nStacks > 0) {
- FreqInfo *fp;
- Blt_HashEntry *h1;
- Blt_HashSearch cursor;
-
- graphPtr->freqArr = Blt_AssertCalloc(nStacks, sizeof(FreqInfo));
- fp = graphPtr->freqArr;
- for (h1 = Blt_FirstHashEntry(&freqTable, &cursor); h1 != NULL;
- h1 = Blt_NextHashEntry(&cursor)) {
- FreqKey *keyPtr;
- size_t count;
-
- count = (size_t)Blt_GetHashValue(h1);
- keyPtr = (FreqKey *)Blt_GetHashKey(&freqTable, h1);
- if (count > 1) {
- Blt_HashEntry *h2;
- int isNew;
-
- h2 = Blt_CreateHashEntry(&graphPtr->freqTable, (char *)keyPtr,
- &isNew);
- count = (size_t)Blt_GetHashValue(h1);
- fp->freq = count;
- fp->axes = keyPtr->axes;
- Blt_SetHashValue(h2, fp);
- fp++;
- }
- }
- }
- Blt_DeleteHashTable(&freqTable);
- graphPtr->nStacks = nStacks;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ComputeStacks --
- *
- * Determine the height of each stack of bar segments. A stack
- * is created by designating two or more points with the same
- * abscissa. Each ordinate defines the height of a segment in
- * the stack. This procedure simply looks at all the data points
- * summing the heights of each stacked segment. The sum is saved
- * in the frequency information table. This value will be used
- * to calculate the y-axis limits (data limits aren't sufficient).
- *
- * Results:
- * None.
- *
- * Side effects:
- * The heights of each stack is computed. CheckStacks will
- * use this information to adjust the y-axis limits if necessary.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ComputeStacks(Graph *graphPtr)
-{
- Blt_ChainLink link;
-
- if ((graphPtr->mode != MODE_STACKED) || (graphPtr->nStacks == 0)) {
- return;
- }
-
- /* Reset the sums for all duplicate values to zero. */
- {
- FreqInfo *infoPtr;
- int i;
-
- infoPtr = graphPtr->freqArr;
- for (i = 0; i < graphPtr->nStacks; i++) {
- infoPtr->sum = 0.0;
- infoPtr++;
- }
- }
-
- /* Look at each bar point, adding the ordinates of duplicate abscissas */
-
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- ContourElement *elemPtr;
- double *xArr, *yArr;
- int nPoints;
- int i;
-
- elemPtr = Blt_Chain_GetValue(link);
- if ((elemPtr->flags & (HIDE|DELETE_PENDING) ||
- (elemPtr->obj.classId != CID_ELEM_CONTOUR)) {
- continue;
- }
- xArr = elemPtr->x.values;
- yArr = elemPtr->y.values;
- nPoints = NUMBEROFPOINTS(elemPtr);
- for (i = 0; i < nPoints; i++) {
- Blt_HashEntry *hPtr;
- FreqKey key;
- FreqInfo *infoPtr;
-
- key.value = xArr[i];
- key.axes = elemPtr->axes;
- hPtr = Blt_FindHashEntry(&graphPtr->freqTable, (char *)&key);
- if (hPtr == NULL) {
- continue;
- }
- infoPtr = Blt_GetHashValue(hPtr);
- infoPtr->sum += yArr[i];
- }
- }
-}
-
-void
-Blt_ResetBarGroups(Graph *graphPtr)
-{
- FreqInfo *fp, *fend;
-
- for (fp = graphPtr->freqArr, fend = fp+graphPtr->nStacks; fp < fend; fp++) {
- fp->lastY = 0.0;
- fp->count = 0;
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetScreenPoints --
- *
- * Generates a coordinate array of transformed screen coordinates from
- * the data points.
- *
- * Results:
- * The transformed screen coordinates are returned.
- *
- * Side effects:
- * Memory is allocated for the coordinate array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GetScreenPoints(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr)
-{
- double *x, *y;
- int i, n;
- int count;
- Point3 *points;
- int *map;
- MeshKey key;
-
- n = MIN3(elemPtr->x.nValues, elemPtr->y.nValues, elemPtr->z.nValues);
- x = elemPtr->x.values;
- y = elemPtr->y.values;
- z = elemPtr->z.values;
- points = Blt_AssertMalloc(sizeof(Point3) * n);
- map = Blt_AssertMalloc(sizeof(int) * n);
- count = 0; /* Count the valid screen coordinates */
-
- next = 0;
- zmin = zmax = 0.0; /* Suppress compiler warning. */
-
- Blt_InitHashTable(&table, sizeof(MeshKey) / sizeof(int));
- p = points;
- p->x = x[0];
- p->y = y[0];
- p->z = z[0];
- zmin = zmax = p->z;
- p++;
- /*
- * Generate array of points. Check for duplicates. This is a quick+dirty
- * (slow) solution.
- */
- hPtr = Blt_CreateHashEntry(&table, (char *)&key, &isNew);
- for (i = 1; i < n; i++) {
- Blt_HashEntry *hPtr;
- MeshKey key;
-
- key.x = x[i];
- key.y = y[i];
-
- hPtr = Blt_CreateHashEntry(&table, (char *)&key, &isNew);
- if (!isNew) {
- continue; /* Already have coordinate pair. */
- }
- p->x = key.x;
- p->y = key.y;
- p->z = z[i];
- if (p->z < zMin) {
- zMin = p->z;
- } else if (p->z > zMax) {
- zMax = p->z;
- }
- p++;
- }
- Tcl_DeleteHashTable(&table);
- nPnts = points - p;
- tol = (zMax - zMin) * tol;
-
- /*
- * Mesh the points to get triangles
- */
- R = Blt_Malloc(2 * nPnts * sizeof(Triplet));
- if (R == NULL) {
- Tcl_AppendResult(interp, "can't allocate ", Itoa(nPnts), " triplets",
- (char *)NULL);
- return TCL_ERROR;
- }
- nTriangles = Triangulate(nPnts, points, R);
- assert(nTriangles <= 2 * nPnts);
-
- if (graphPtr->inverted) {
- for (i = 0; i < n; i++) {
- if ((FINITE(x[i])) && (FINITE(y[i]))) {
- points[count].x = Blt_HMap(elemPtr->axes.y, y[i]);
- points[count].y = Blt_VMap(elemPtr->axes.x, x[i]);
- map[count] = i;
- count++;
- }
- }
- } else {
- for (i = 0; i < n; i++) {
- if ((FINITE(x[i])) && (FINITE(y[i]))) {
- points[count].x = Blt_HMap(elemPtr->axes.x, x[i]);
- points[count].y = Blt_VMap(elemPtr->axes.y, y[i]);
- map[count] = i;
- count++;
- }
- }
- }
- mapPtr->screenPts = points;
- mapPtr->nScreenPts = count;
- mapPtr->map = map;
-}
-
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsolineOp --
- *
- * .g isoline create -name $name -value $value -color $color -pen $pen
- * .g isoline configure $name -value $value -color $color -hide no
- * .g isoline delete $name
- * .g isoline names
- *
- *---------------------------------------------------------------------------
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsolineOp --
- *
- * .g isoline create -name $name -value $value -color $color
- * .g isoline configure $name -value $value -color $color -hide no
- * .g isoline
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IsolineOp(
- Graph *graphPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- char *tagName;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&graphPtr->elements.tagTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- tagName = Blt_GetHashKey(&graphPtr->elements.tagTable, hPtr);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(tagName, -1));
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- return Blt_ConfigureBindingsFromObj(interp, graphPtr->bindTable,
- Blt_MakeElementTag(graphPtr, Tcl_GetString(objv[3])),
- objc - 4, objv + 4);
-}
-
-
-/* make up an edge */
-static INLINE void
-MakeEdgeKey(Edge *keyPtr, int a, int b)
-{
- if (a < b) {
- keyPtr->a = a;
- keyPtr->b = b;
- } else {
- keyPtr->a = b;
- keyPtr->b = a;
- }
-}
-
-/* interpolate 2 points and add possible result to points array */
-static int
-Interpolate(ContourElement *contPtr, int a, int b, double isovalue)
-{
- int ab, junk;
- Edge *edgePtr;
- EdgeInfo *eiPtr;
- Blt_HashEntry *hPtr;
- double zA, zB, r, absr;
- Point2f *points = contPtr->meshPtr->points;
- EdgeKey key;
-
- /* Create the edge key. */
- MakeEdgeKey(&key, a, b);
-
- hPtr = Blt_CreateHashEntry(contPtr->edgeTable, (char *)key, &isNew);
- if (!isNew) {
- int index;
-
- index = (int)Blt_GetHashValue(hPtr);
-#if DEBUG
- printf("A=%d(%g,%g,%g) B=%d(%g,%g,%g) isovalue=%g -> old %d\n",
- a, points[a].x, points[a].y, values[a],
- b, points[b].x, points[b].y, values[b],
- isovalue, index);
-#endif
- return index;
- }
-
- /* No, then do the interpolation */
- zA = contPtr->values[a] - isovalue;
- if (fabs(zA/isovalue) < contPtr->fuzz) {
- zA = 0.0;
- }
- zB = contPtr->values[b] - isovalue;
- if (fabs(zB/isovalue) < contPtr->fuzz) {
- zB = 0.0;
- }
- /* Does there exist an intermediate point? */
- if (sign(zA) != sign(zB)) {
- double t;
- int i;
-
- i = contPtr->nAdditional;
- t = zA / (zA - zB);
- points[i].x = points[a].x + t * (points[b].x - points[a].x);
- points[i].y = points[a].y + t * (points[b].y - points[a].y);
- values[i] = isovalue;
- ab = i;
- contPtr->nAdditional++;
- } else {
- ab = 0;
- }
-#if DEBUG
- printf("A=%d(%g,%g,%g) B=%d(%g,%g,%g) isovalue=%g -> new %d\n",
- a, points[a].x, points[a].y, values[a],
- b, points[b].x, points[b].y, values[b],
- isovalue, ab);
-#endif
- /* add the new point to the hash table */
- Blt_SetHashValue(hPtr, (ClientData)ab);
- return ab;
-}
-
-/* process a Cont triangle */
-void
-ProcessTriangle(ContourElement *contPtr, Triangle *t, float isovalue)
-{
- int ab, bc, ca;
-
- if (isovalue <= t->min) {
- if ((t->a != t->b) && (t->b != t->c) && (t->a != t->c)) {
- AddTriangle(t->a, t->b, t->c);
- }
- return;
- }
- /* Interpolate the three sides of the triangle. */
- ab = Interpolate(contPtr, t->a, t->b, isovalue);
- bc = Interpolate(contPtr, t->b, t->c, isovalue);
- ca = Interpolate(contPtr, t->c, t->a, isovalue);
- if ((ab) && (bc) && (!ca)) {
- if (contPtr->values[t->b] > isovalue) {
- AddTriangle(ab, t->b, bc);
- } else {
- AddQuadrilateral(t->a, ab, bc, t->c);
- }
- return;
- }
- if ((ab) && (!bc) && (ca)) {
- if (contPtr->values[t->a] > isovalue) {
- AddTriangle(t->a, ab, ca);
- } else {
- AddQuadrilateral(ab, t->b, t->c, ca);
- }
- return;
- }
- if ((!ab) && (bc) && (ca)) {
- if (contPtr->values[t->c] > isovalue) {
- AddTriangle(bc, t->c, ca);
- } else {
- AddQuadrilateral(t->b, bc, ca, t->a);
- }
- return;
- }
-}
-
-
-static int
-CompareTriangles(const void *a, const void *b)
-{
- const Triangle *t1 = a;
- const Triangle *t2 = b;
-
- /* Sort by the minimum. */
- if (t1->min < t2->min) {
- return -1;
- } else if (t1->min > t2->min) {
- return 1;
- }
- /* Secondarily sort by the maximum. */
- if (t1->max < t2->max) {
- return -1;
- } else if (t1->max > t2->max) {
- return 1;
- }
- return 0;
-}
-
-static void
-SortTriangles(Mesh *meshPtr, int nValues, float *values)
-{
- /* Compute the min/max of the z-values of the triangle */
- for (i = 0; i < meshPtr->nTriangles; i++) {
- Triangle *t;
-
- t = meshPtr->triangles + i;
- t->min = t->max = values[t->a];
- if (values[t->b] > t->max) {
- t->max = values[t->b];
- } else if (values[t->b] < t->min) {
- t->min = values[t->b];
- }
- if (values[t->c] > t->max) {
- t->max = values[t->c];
- } else if (values[t->c] < t->min) {
- t->min = values[t->c];
- }
- }
- /* Sort the triangles by the current set of values associates with the
- * mesh. */
- qsort(meshPtr->triangles, meshPtr->nTriangles, sizeof(Triangle),
- CompareTriangles);
-}
-
-/* Display a cont widget */
-static int
-MapContour(Tcl_Interp *interp, Element *elemPtr)
-{
- ContourElement *contPtr = (ContourElement *)elemPtr;
- Polygon *P;
- int i, k, N, M;
- Tcl_Obj *listObjPtr, *subListObjPtr, *objPtr;
-
- init_extra_points(contPtr);
- init_poly_table();
-
- SortTriangles(contPtr->meshPtr, contPtr->nValues, contPtr->values);
- for (i = 0; i < contPtr->nIsolines; i++) {
- double z;
-
- z = contPtr->isolines[i];
- for (j = 0; j < contPtr->meshPtr->nTriangles; j++) {
- Triangle *t;
-
- t = contPtr->meshPtr->triangles + j;
- if (z < t->min) {
- break; /* No more triangles in range. */
- }
- if (z > t->max) {
- continue; /* Not in range. */
- }
- ProcessTriangle(contPtr, t, z);
- }
- }
-}
diff --git a/blt3.0.1/src/bltGrElem.c b/blt3.0.1/src/bltGrElem.c
deleted file mode 100644
index 6f509ac..0000000
--- a/blt3.0.1/src/bltGrElem.c
+++ /dev/null
@@ -1,2456 +0,0 @@
-
-/*
- * bltGrElem.c --
- *
- * This module implements generic elements for the BLT graph widget.
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltGraph.h"
-#include "bltOp.h"
-#include "bltChain.h"
-#include <X11/Xutil.h>
-#include <bltDataTable.h>
-
-#define GRAPH_KEY "BLT Graph Data"
-
-/* Ignore elements that aren't in the display list or have been deleted. */
-#define IGNORE_ELEMENT(e) (((e)->link == NULL) || ((e)->flags & DELETE_PENDING))
-
-typedef struct {
- Blt_Table table;
- int refCount;
-} TableClient;
-
-static Blt_OptionParseProc ObjToAlong;
-static Blt_OptionPrintProc AlongToObj;
-static Blt_CustomOption alongOption =
-{
- ObjToAlong, AlongToObj, NULL, (ClientData)0
-};
-static Blt_OptionFreeProc FreeValues;
-static Blt_OptionParseProc ObjToValues;
-static Blt_OptionPrintProc ValuesToObj;
-Blt_CustomOption bltValuesOption =
-{
- ObjToValues, ValuesToObj, FreeValues, (ClientData)0
-};
-static Blt_OptionFreeProc FreeValuePairs;
-static Blt_OptionParseProc ObjToValuePairs;
-static Blt_OptionPrintProc ValuePairsToObj;
-Blt_CustomOption bltValuePairsOption =
-{
- ObjToValuePairs, ValuePairsToObj, FreeValuePairs, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeStyles;
-static Blt_OptionParseProc ObjToStyles;
-static Blt_OptionPrintProc StylesToObj;
-Blt_CustomOption bltLineStylesOption =
-{
- ObjToStyles, StylesToObj, FreeStyles, (ClientData)0,
-};
-
-Blt_CustomOption bltBarStylesOption =
-{
- ObjToStyles, StylesToObj, FreeStyles, (ClientData)0,
-};
-
-#include "bltGrElem.h"
-
-static Blt_VectorChangedProc VectorChangedProc;
-
-static void FindRange(ElemValues *valuesPtr);
-static void FreeDataValues(ElemValues *valuesPtr);
-static Tcl_FreeProc FreeElement;
-
-typedef int (GraphElementProc)(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DestroyTableClients --
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-void
-Blt_DestroyTableClients(Graph *graphPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->dataTables, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- TableClient *clientPtr;
-
- clientPtr = Blt_GetHashValue(hPtr);
- if (clientPtr->table != NULL) {
- Blt_Table_Close(clientPtr->table);
- }
- Blt_Free(clientPtr);
- }
- Blt_DeleteHashTable(&graphPtr->dataTables);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- * Custom option parse and print procedures
- *---------------------------------------------------------------------------
- */
-static int
-GetPenStyleFromObj(
- Tcl_Interp *interp,
- Graph *graphPtr,
- Tcl_Obj *objPtr,
- ClassId classId,
- PenStyle *stylePtr)
-{
- Pen *penPtr;
- Tcl_Obj **objv;
- int objc;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((objc != 1) && (objc != 3)) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "bad style entry \"",
- Tcl_GetString(objPtr),
- "\": should be \"penName\" or \"penName min max\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (Blt_GetPenFromObj(interp, graphPtr, objv[0], classId, &penPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 3) {
- double min, max;
-
- if ((Tcl_GetDoubleFromObj(interp, objv[1], &min) != TCL_OK) ||
- (Tcl_GetDoubleFromObj(interp, objv[2], &max) != TCL_OK)) {
- return TCL_ERROR;
- }
- SetWeight(stylePtr->weight, min, max);
- }
- stylePtr->penPtr = penPtr;
- return TCL_OK;
-}
-
-static void
-FreeVectorSource(ElemValues *valuesPtr)
-{
- if (valuesPtr->vectorSource.vector != NULL) {
- Blt_SetVectorChangedProc(valuesPtr->vectorSource.vector, NULL, NULL);
- Blt_FreeVectorId(valuesPtr->vectorSource.vector);
- valuesPtr->vectorSource.vector = NULL;
- }
-}
-
-static int
-FetchVectorValues(Tcl_Interp *interp, ElemValues *valuesPtr, Blt_Vector *vector)
-{
- double *array;
-
- if (valuesPtr->values == NULL) {
- array = Blt_Malloc(Blt_VecLength(vector) * sizeof(double));
- } else {
- array = Blt_Realloc(valuesPtr->values,
- Blt_VecLength(vector) * sizeof(double));
- }
- if (array == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't allocate new vector", (char *)NULL);
- }
- return TCL_ERROR;
- }
- memcpy(array, Blt_VecData(vector), sizeof(double) * Blt_VecLength(vector));
- valuesPtr->min = Blt_VecMin(vector);
- valuesPtr->max = Blt_VecMax(vector);
- valuesPtr->values = array;
- valuesPtr->nValues = Blt_VecLength(vector);
- /* FindRange(valuesPtr); */
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * VectorChangedProc --
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Graph is redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-VectorChangedProc(
- Tcl_Interp *interp,
- ClientData clientData,
- Blt_VectorNotify notify)
-{
- ElemValues *valuesPtr = clientData;
-
- if (notify == BLT_VECTOR_NOTIFY_DESTROY) {
- FreeDataValues(valuesPtr);
- } else {
- Blt_Vector *vector;
-
- Blt_GetVectorById(interp, valuesPtr->vectorSource.vector, &vector);
- if (FetchVectorValues(NULL, valuesPtr, vector) != TCL_OK) {
- return;
- }
- }
- {
- Element *elemPtr = valuesPtr->elemPtr;
- Graph *graphPtr;
-
- graphPtr = elemPtr->obj.graphPtr;
- graphPtr->flags |= RESET_AXES;
- elemPtr->flags |= MAP_ITEM;
- if (!IGNORE_ELEMENT(elemPtr)) {
- graphPtr->flags |= CACHE_DIRTY;
- Blt_EventuallyRedrawGraph(graphPtr);
- }
- }
-}
-
-static int
-GetVectorData(Tcl_Interp *interp, ElemValues *valuesPtr, const char *vecName)
-{
- Blt_Vector *vecPtr;
- VectorDataSource *srcPtr;
-
- srcPtr = &valuesPtr->vectorSource;
- srcPtr->vector = Blt_AllocVectorId(interp, vecName);
- if (Blt_GetVectorById(interp, srcPtr->vector, &vecPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (FetchVectorValues(interp, valuesPtr, vecPtr) != TCL_OK) {
- FreeVectorSource(valuesPtr);
- return TCL_ERROR;
- }
- Blt_SetVectorChangedProc(srcPtr->vector, VectorChangedProc, valuesPtr);
- valuesPtr->type = ELEM_SOURCE_VECTOR;
- return TCL_OK;
-}
-
-static int
-FetchTableValues(Tcl_Interp *interp, ElemValues *valuesPtr, Blt_TableColumn col)
-{
- long i, j;
- double *array;
- Blt_Table table;
-
- table = valuesPtr->tableSource.table;
- array = Blt_Malloc(sizeof(double) * Blt_Table_NumRows(table));
- if (array == NULL) {
- return TCL_ERROR;
- }
- for (j = 0, i = 1; i <= Blt_Table_NumRows(table); i++) {
- Blt_TableRow row;
- double value;
-
- row = Blt_Table_FindRowByIndex(table, i);
- value = Blt_Table_GetDouble(table, row, col);
- if (FINITE(value)) {
- array[j] = value;
- j++;
- }
- }
- if (valuesPtr->values != NULL) {
- Blt_Free(valuesPtr->values);
- }
- valuesPtr->nValues = j;
- valuesPtr->values = array;
- FindRange(valuesPtr);
- return TCL_OK;
-}
-
-static void
-FreeTableSource(ElemValues *valuesPtr)
-{
- TableDataSource *srcPtr;
-
- srcPtr = &valuesPtr->tableSource;
- if (srcPtr->trace != NULL) {
- Blt_Table_DeleteTrace(srcPtr->trace);
- }
- if (srcPtr->notifier != NULL) {
- Blt_Table_DeleteNotifier(srcPtr->notifier);
- }
- if (srcPtr->hashPtr != NULL) {
- TableClient *clientPtr;
-
- clientPtr = Blt_GetHashValue(srcPtr->hashPtr);
- clientPtr->refCount--;
- if (clientPtr->refCount == 0) {
- Graph *graphPtr;
-
- graphPtr = valuesPtr->elemPtr->obj.graphPtr;
- if (srcPtr->table != NULL) {
- Blt_Table_Close(srcPtr->table);
- }
- Blt_Free(clientPtr);
- Blt_DeleteHashEntry(&graphPtr->dataTables, srcPtr->hashPtr);
- srcPtr->hashPtr = NULL;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableNotifyProc --
- *
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Graph is redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TableNotifyProc(ClientData clientData, Blt_TableNotifyEvent *eventPtr)
-{
- ElemValues *valuesPtr = clientData;
- Element *elemPtr;
- Graph *graphPtr;
-
- elemPtr = valuesPtr->elemPtr;
- graphPtr = elemPtr->obj.graphPtr;
- if ((eventPtr->type == TABLE_NOTIFY_COLUMN_DELETED) ||
- (FetchTableValues(graphPtr->interp, valuesPtr,
- (Blt_TableColumn)eventPtr->header)) != TCL_OK) {
- FreeTableSource(valuesPtr);
- return TCL_ERROR;
- }
- /* Always redraw the element. */
- graphPtr->flags |= RESET_AXES;
- elemPtr->flags |= MAP_ITEM;
- if (!IGNORE_ELEMENT(elemPtr)) {
- graphPtr->flags |= CACHE_DIRTY;
- Blt_EventuallyRedrawGraph(graphPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableTraceProc --
- *
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Graph is redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TableTraceProc(ClientData clientData, Blt_TableTraceEvent *eventPtr)
-{
- ElemValues *valuesPtr = clientData;
- Element *elemPtr;
- Graph *graphPtr;
-
- elemPtr = valuesPtr->elemPtr;
- graphPtr = elemPtr->obj.graphPtr;
- assert((Blt_TableColumn)eventPtr->column == valuesPtr->tableSource.column);
-
- if (FetchTableValues(eventPtr->interp, valuesPtr, eventPtr->column)
- != TCL_OK) {
- FreeTableSource(valuesPtr);
- return TCL_ERROR;
- }
- graphPtr->flags |= RESET_AXES;
- elemPtr->flags |= MAP_ITEM;
- if (!IGNORE_ELEMENT(elemPtr)) {
- graphPtr->flags |= CACHE_DIRTY;
- Blt_EventuallyRedrawGraph(graphPtr);
- }
- return TCL_OK;
-}
-
-static int
-GetTableData(Tcl_Interp *interp, ElemValues *valuesPtr, const char *tableName,
- Tcl_Obj *colObjPtr)
-{
- TableDataSource *srcPtr;
- TableClient *clientPtr;
- int isNew;
- Graph *graphPtr;
-
- memset(&valuesPtr->tableSource, 0, sizeof(TableDataSource));
- srcPtr = &valuesPtr->tableSource;
- graphPtr = valuesPtr->elemPtr->obj.graphPtr;
- /* See if the graph is already using this table. */
- srcPtr->hashPtr = Blt_CreateHashEntry(&graphPtr->dataTables, tableName,
- &isNew);
- if (isNew) {
- if (Blt_Table_Open(interp, tableName, &srcPtr->table) != TCL_OK) {
- return TCL_ERROR;
- }
- clientPtr = Blt_AssertMalloc(sizeof(TableClient));
- clientPtr->table = srcPtr->table;
- clientPtr->refCount = 1;
- Blt_SetHashValue(srcPtr->hashPtr, clientPtr);
- } else {
- clientPtr = Blt_GetHashValue(srcPtr->hashPtr);
- srcPtr->table = clientPtr->table;
- clientPtr->refCount++;
- }
- srcPtr->column = Blt_Table_FindColumn(interp, srcPtr->table, colObjPtr);
- if (srcPtr->column == NULL) {
- goto error;
- }
- if (FetchTableValues(interp, valuesPtr, srcPtr->column) != TCL_OK) {
- goto error;
- }
- srcPtr->notifier = Blt_Table_CreateColumnNotifier(interp, srcPtr->table,
- srcPtr->column, TABLE_NOTIFY_COLUMN_CHANGED, TableNotifyProc,
- (Blt_TableNotifierDeleteProc *)NULL, valuesPtr);
- srcPtr->trace = Blt_Table_CreateColumnTrace(srcPtr->table, srcPtr->column,
- (TABLE_TRACE_WRITES | TABLE_TRACE_UNSETS | TABLE_TRACE_CREATES), TableTraceProc,
- (Blt_TableTraceDeleteProc *)NULL, valuesPtr);
- valuesPtr->type = ELEM_SOURCE_TABLE;
- return TCL_OK;
- error:
- FreeTableSource(valuesPtr);
- return TCL_ERROR;
-}
-
-static int
-ParseValues(Tcl_Interp *interp, Tcl_Obj *objPtr, int *nValuesPtr,
- double **arrayPtr)
-{
- int objc;
- Tcl_Obj **objv;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- *arrayPtr = NULL;
- *nValuesPtr = 0;
- if (objc > 0) {
- double *array;
- double *p;
- int i;
-
- array = Blt_Malloc(sizeof(double) * objc);
- if (array == NULL) {
- Tcl_AppendResult(interp, "can't allocate new vector", (char *)NULL);
- return TCL_ERROR;
- }
- for (p = array, i = 0; i < objc; i++, p++) {
- if (Blt_ExprDoubleFromObj(interp, objv[i], p) != TCL_OK) {
- Blt_Free(array);
- return TCL_ERROR;
- }
- }
- *arrayPtr = array;
- *nValuesPtr = objc;
- }
- return TCL_OK;
-}
-
-static void
-FreeDataValues(ElemValues *valuesPtr)
-{
- switch (valuesPtr->type) {
- case ELEM_SOURCE_VECTOR:
- FreeVectorSource(valuesPtr); break;
- case ELEM_SOURCE_TABLE:
- FreeTableSource(valuesPtr); break;
- case ELEM_SOURCE_VALUES:
- break;
- }
- if (valuesPtr->values != NULL) {
- Blt_Free(valuesPtr->values);
- }
- valuesPtr->values = NULL;
- valuesPtr->nValues = 0;
- valuesPtr->type = ELEM_SOURCE_VALUES;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindRange --
- *
- * Find the minimum, positive minimum, and maximum values in a given
- * vector and store the results in the vector structure.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Minimum, positive minimum, and maximum values are stored in the
- * vector.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FindRange(ElemValues *valuesPtr)
-{
- int i;
- double *x;
- double min, max;
-
- if ((valuesPtr->nValues < 1) || (valuesPtr->values == NULL)) {
- return; /* This shouldn't ever happen. */
- }
- x = valuesPtr->values;
-
- min = DBL_MAX, max = -DBL_MAX;
- for(i = 0; i < valuesPtr->nValues; i++) {
- if (FINITE(x[i])) {
- min = max = x[i];
- break;
- }
- }
- /* Initialize values to track the vector range */
- for (/* empty */; i < valuesPtr->nValues; i++) {
- if (FINITE(x[i])) {
- if (x[i] < min) {
- min = x[i];
- } else if (x[i] > max) {
- max = x[i];
- }
- }
- }
- valuesPtr->min = min, valuesPtr->max = max;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FindElemValuesMinimum --
- *
- * Find the minimum, positive minimum, and maximum values in a given
- * vector and store the results in the vector structure.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Minimum, positive minimum, and maximum values are stored in the
- * vector.
- *
- *---------------------------------------------------------------------------
- */
-double
-Blt_FindElemValuesMinimum(ElemValues *valuesPtr, double minLimit)
-{
- int i;
- double min;
-
- min = DBL_MAX;
- for (i = 0; i < valuesPtr->nValues; i++) {
- double x;
-
- x = valuesPtr->values[i];
- if (x < 0.0) {
- /* What do you do about negative values when using log
- * scale values seems like a grey area. Mirror. */
- x = -x;
- }
- if ((x > minLimit) && (min > x)) {
- min = x;
- }
- }
- if (min == DBL_MAX) {
- min = minLimit;
- }
- return min;
-}
-
-/*ARGSUSED*/
-static void
-FreeValues(
- ClientData clientData, /* Not used. */
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- ElemValues *valuesPtr = (ElemValues *)(widgRec + offset);
-
- FreeDataValues(valuesPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToValues --
- *
- * Given a TCL list of numeric expression representing the element
- * values, convert into an array of double precision values. In addition,
- * the minimum and maximum values are saved. Since elastic values are
- * allow (values which translate to the min/max of the graph), we must
- * try to get the non-elastic minimum and maximum.
- *
- * Results:
- * The return value is a standard TCL result. The vector is passed
- * back via the valuesPtr.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToValues(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* TCL list of expressions */
- char *widgRec, /* Element record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- ElemValues *valuesPtr = (ElemValues *)(widgRec + offset);
- Element *elemPtr = (Element *)widgRec;
- Tcl_Obj **objv;
- int objc;
- int result;
- const char *string;
-
- valuesPtr->elemPtr = elemPtr;
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- elemPtr->flags |= MAP_ITEM;
-
- /* Release the current data sources. */
- FreeDataValues(valuesPtr);
- if (objc == 0) {
- return TCL_OK; /* Empty list of values. */
- }
- string = Tcl_GetString(objv[0]);
- if ((objc == 1) && (Blt_VectorExists2(interp, string))) {
- result = GetVectorData(interp, valuesPtr, string);
- } else if ((objc == 2) && (Blt_Table_TableExists(interp, string))) {
- result = GetTableData(interp, valuesPtr, string, objv[1]);
- } else {
- double *values;
- int nValues;
-
- result = ParseValues(interp, objPtr, &nValues, &values);
- if (result != TCL_OK) {
- return TCL_ERROR; /* Can't parse the values as numbers. */
- }
- FreeDataValues(valuesPtr);
- if (nValues > 0) {
- valuesPtr->values = values;
- }
- valuesPtr->nValues = nValues;
- FindRange(valuesPtr);
- valuesPtr->type = ELEM_SOURCE_VALUES;
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ValuesToObj --
- *
- * Convert the vector of floating point values into a TCL list.
- *
- * Results:
- * The string representation of the vector is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ValuesToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Element record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- ElemValues *valuesPtr = (ElemValues *)(widgRec + offset);
-
- switch (valuesPtr->type) {
- case ELEM_SOURCE_VECTOR:
- {
- const char *vecName;
-
- vecName = Blt_NameOfVectorId(valuesPtr->vectorSource.vector);
- return Tcl_NewStringObj(vecName, -1);
- }
- case ELEM_SOURCE_TABLE:
- {
- Tcl_Obj *listObjPtr;
- const char *tableName;
- long i;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- tableName = Blt_Table_TableName(valuesPtr->tableSource.table);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(tableName, -1));
-
- i = Blt_Table_ColumnIndex(valuesPtr->tableSource.column);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewLongObj(i));
- return listObjPtr;
- }
- case ELEM_SOURCE_VALUES:
- {
- Tcl_Obj *listObjPtr;
- double *vp, *vend;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (vp = valuesPtr->values, vend = vp + valuesPtr->nValues;
- vp < vend; vp++) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(*vp));
- }
- return listObjPtr;
- }
- default:
- abort();
- }
- return Tcl_NewStringObj("", 0);
-}
-
-/*ARGSUSED*/
-static void
-FreeValuePairs(
- ClientData clientData, /* Not used. */
- Display *display, /* Not used. */
- char *widgRec,
- int offset) /* Not used. */
-{
- Element *elemPtr = (Element *)widgRec;
-
- FreeDataValues(&elemPtr->x);
- FreeDataValues(&elemPtr->y);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToValuePairs --
- *
- * This procedure is like ObjToValues except that it interprets
- * the list of numeric expressions as X Y coordinate pairs. The
- * minimum and maximum for both the X and Y vectors are
- * determined.
- *
- * Results:
- * The return value is a standard TCL result. The vectors are
- * passed back via the widget record (elemPtr).
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToValuePairs(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* TCL list of numeric expressions */
- char *widgRec, /* Element record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- Element *elemPtr = (Element *)widgRec;
- double *values;
- int nValues;
- size_t newSize;
-
- if (ParseValues(interp, objPtr, &nValues, &values) != TCL_OK) {
- return TCL_ERROR;
- }
- if (nValues & 1) {
- Tcl_AppendResult(interp, "odd number of data points", (char *)NULL);
- Blt_Free(values);
- return TCL_ERROR;
- }
- nValues /= 2;
- newSize = nValues * sizeof(double);
- FreeDataValues(&elemPtr->x); /* Release the current data sources. */
- FreeDataValues(&elemPtr->y);
- if (newSize > 0) {
- double *p;
- int i;
-
- elemPtr->x.values = Blt_AssertMalloc(newSize);
- elemPtr->y.values = Blt_AssertMalloc(newSize);
- elemPtr->x.nValues = elemPtr->y.nValues = nValues;
- for (p = values, i = 0; i < nValues; i++) {
- elemPtr->x.values[i] = *p++;
- elemPtr->y.values[i] = *p++;
- }
- Blt_Free(values);
- FindRange(&elemPtr->x);
- FindRange(&elemPtr->y);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ValuePairsToObj --
- *
- * Convert pairs of floating point values in the X and Y arrays
- * into a TCL list.
- *
- * Results:
- * The return value is a string (Tcl list).
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ValuePairsToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Element information record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- Element *elemPtr = (Element *)widgRec;
- Tcl_Obj *listObjPtr;
- int i;
- int length;
-
- length = NUMBEROFPOINTS(elemPtr);
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (i = 0; i < length; i++) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(elemPtr->x.values[i]));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(elemPtr->y.values[i]));
- }
- return listObjPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToAlong --
- *
- * Given a TCL list of numeric expression representing the element
- * values, convert into an array of double precision values. In
- * addition, the minimum and maximum values are saved. Since
- * elastic values are allow (values which translate to the
- * min/max of the graph), we must try to get the non-elastic
- * minimum and maximum.
- *
- * Results:
- * The return value is a standard TCL result. The vector is passed
- * back via the valuesPtr.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToAlong(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- int *intPtr = (int *)(widgRec + offset);
- char *string;
-
- string = Tcl_GetString(objPtr);
- if ((string[0] == 'x') && (string[1] == '\0')) {
- *intPtr = SEARCH_X;
- } else if ((string[0] == 'y') && (string[1] == '\0')) {
- *intPtr = SEARCH_Y;
- } else if ((string[0] == 'b') && (strcmp(string, "both") == 0)) {
- *intPtr = SEARCH_BOTH;
- } else {
- Tcl_AppendResult(interp, "bad along value \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AlongToObj --
- *
- * Convert the vector of floating point values into a TCL list.
- *
- * Results:
- * The string representation of the vector is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-AlongToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- int along = *(int *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- switch (along) {
- case SEARCH_X:
- objPtr = Tcl_NewStringObj("x", 1);
- break;
- case SEARCH_Y:
- objPtr = Tcl_NewStringObj("y", 1);
- break;
- case SEARCH_BOTH:
- objPtr = Tcl_NewStringObj("both", 4);
- break;
- default:
- objPtr = Tcl_NewStringObj("unknown along value", 4);
- break;
- }
- return objPtr;
-}
-
-void
-Blt_FreeStylePalette(Blt_Chain stylePalette)
-{
- Blt_ChainLink link;
-
- /* Skip the first slot. It contains the built-in "normal" pen of
- * the element. */
- link = Blt_Chain_FirstLink(stylePalette);
- if (link != NULL) {
- Blt_ChainLink next;
-
- for (link = Blt_Chain_NextLink(link); link != NULL; link = next) {
- PenStyle *stylePtr;
-
- next = Blt_Chain_NextLink(link);
- stylePtr = Blt_Chain_GetValue(link);
- Blt_FreePen(stylePtr->penPtr);
- Blt_Chain_DeleteLink(stylePalette, link);
- }
- }
-}
-
-/*ARGSUSED*/
-static void
-FreeStyles(
- ClientData clientData, /* Not used. */
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Blt_Chain stylePalette = *(Blt_Chain *)(widgRec + offset);
-
- Blt_FreeStylePalette(stylePalette);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ObjToStyles --
- *
- * Parse the list of style names.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToStyles(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style list */
- char *widgRec, /* Element information record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_Chain stylePalette = *(Blt_Chain *)(widgRec + offset);
- Blt_ChainLink link;
- Element *elemPtr = (Element *)(widgRec);
- PenStyle *stylePtr;
- Tcl_Obj **objv;
- int objc;
- int i;
- size_t size = (size_t)clientData;
-
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Reserve the first entry for the "normal" pen. We'll set the
- * style later */
- Blt_FreeStylePalette(stylePalette);
- link = Blt_Chain_FirstLink(stylePalette);
- if (link == NULL) {
- link = Blt_Chain_AllocLink(size);
- Blt_Chain_LinkAfter(stylePalette, link, NULL);
- }
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->penPtr = elemPtr->normalPenPtr;
- for (i = 0; i < objc; i++) {
- link = Blt_Chain_AllocLink(size);
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->weight.min = (double)i;
- stylePtr->weight.max = (double)i + 1.0;
- stylePtr->weight.range = 1.0;
- if (GetPenStyleFromObj(interp, elemPtr->obj.graphPtr, objv[i],
- elemPtr->obj.classId, (PenStyle *)stylePtr) != TCL_OK) {
- Blt_FreeStylePalette(stylePalette);
- return TCL_ERROR;
- }
- Blt_Chain_LinkAfter(stylePalette, link, NULL);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StylesToObj --
- *
- * Convert the style information into a Tcl_Obj.
- *
- * Results:
- * The string representing the style information is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-StylesToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Element information record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_Chain stylePalette = *(Blt_Chain *)(widgRec + offset);
- Blt_ChainLink link;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- link = Blt_Chain_FirstLink(stylePalette);
- if (link != NULL) {
- /* Skip the first style (it's the default) */
- for (link = Blt_Chain_NextLink(link); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- PenStyle *stylePtr;
- Tcl_Obj *subListObjPtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- subListObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, subListObjPtr,
- Tcl_NewStringObj(stylePtr->penPtr->name, -1));
- Tcl_ListObjAppendElement(interp, subListObjPtr,
- Tcl_NewDoubleObj(stylePtr->weight.min));
- Tcl_ListObjAppendElement(interp, subListObjPtr,
- Tcl_NewDoubleObj(stylePtr->weight.max));
- Tcl_ListObjAppendElement(interp, listObjPtr, subListObjPtr);
- }
- }
- return listObjPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_StyleMap --
- *
- * Creates an array of style indices and fills it based on the weight
- * of each data point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is freed and allocated for the index array.
- *
- *---------------------------------------------------------------------------
- */
-
-PenStyle **
-Blt_StyleMap(Element *elemPtr)
-{
- int i;
- int nWeights; /* Number of weights to be examined.
- * If there are more data points than
- * weights, they will default to the
- * normal pen. */
-
- PenStyle **dataToStyle; /* Directory of styles. Each array
- * element represents the style for
- * the data point at that index */
- Blt_ChainLink link;
- PenStyle *stylePtr;
- double *w; /* Weight vector */
- int nPoints;
-
- nPoints = NUMBEROFPOINTS(elemPtr);
- nWeights = MIN(elemPtr->w.nValues, nPoints);
- w = elemPtr->w.values;
- link = Blt_Chain_FirstLink(elemPtr->stylePalette);
- stylePtr = Blt_Chain_GetValue(link);
-
- /*
- * Create a style mapping array (data point index to style),
- * initialized to the default style.
- */
- dataToStyle = Blt_AssertMalloc(nPoints * sizeof(PenStyle *));
- for (i = 0; i < nPoints; i++) {
- dataToStyle[i] = stylePtr;
- }
-
- for (i = 0; i < nWeights; i++) {
- for (link = Blt_Chain_LastLink(elemPtr->stylePalette); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- stylePtr = Blt_Chain_GetValue(link);
-
- if (stylePtr->weight.range > 0.0) {
- double norm;
-
- norm = (w[i] - stylePtr->weight.min) / stylePtr->weight.range;
- if (((norm - 1.0) <= DBL_EPSILON) &&
- (((1.0 - norm) - 1.0) <= DBL_EPSILON)) {
- dataToStyle[i] = stylePtr;
- break; /* Done: found range that matches. */
- }
- }
- }
- }
- return dataToStyle;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetIndex --
- *
- * Given a string representing the index of a pair of x,y
- * coordinates, return the numeric index.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetIndex(Tcl_Interp *interp, Element *elemPtr, Tcl_Obj *objPtr, int *indexPtr)
-{
- char *string;
-
- string = Tcl_GetString(objPtr);
- if ((*string == 'e') && (strcmp("end", string) == 0)) {
- *indexPtr = NUMBEROFPOINTS(elemPtr) - 1;
- } else if (Blt_ExprIntFromObj(interp, objPtr, indexPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetElement --
- *
- * Find the element represented the given name, returning a pointer to
- * its data structure via elemPtrPtr.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetElement(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr,
- Element **elemPtrPtr)
-{
- Blt_HashEntry *hPtr;
- char *name;
-
- name = Tcl_GetString(objPtr);
- hPtr = Blt_FindHashEntry(&graphPtr->elements.table, name);
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find element \"", name,
- "\" in \"", Tk_PathName(graphPtr->tkwin), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- *elemPtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyElement --
- *
- * Add a new element to the graph.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyElement(Element *elemPtr)
-{
- Graph *graphPtr = elemPtr->obj.graphPtr;
-
- Blt_DeleteBindings(graphPtr->bindTable, elemPtr);
- Blt_Legend_RemoveElement(graphPtr, elemPtr);
-
- Blt_FreeOptions(elemPtr->configSpecs, (char *)elemPtr,graphPtr->display, 0);
- /*
- * Call the element's own destructor to release the memory and
- * resources allocated for it.
- */
- (*elemPtr->procsPtr->destroyProc) (graphPtr, elemPtr);
-
- /* Remove it also from the element display list */
- if (elemPtr->link != NULL) {
- Blt_Chain_DeleteLink(graphPtr->elements.displayList, elemPtr->link);
- if (!IGNORE_ELEMENT(elemPtr)) {
- graphPtr->flags |= RESET_WORLD;
- Blt_EventuallyRedrawGraph(graphPtr);
- }
- }
- /* Remove the element for the graph's hash table of elements */
- if (elemPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&graphPtr->elements.table, elemPtr->hashPtr);
- }
- if (elemPtr->obj.name != NULL) {
- Blt_Free(elemPtr->obj.name);
- }
- if (elemPtr->label != NULL) {
- Blt_Free(elemPtr->label);
- }
- Blt_Free(elemPtr);
-}
-
-static void
-FreeElement(DestroyData data)
-{
- Element *elemPtr = (Element *)data;
- DestroyElement(elemPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateElement --
- *
- * Add a new element to the graph.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateElement(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv, ClassId classId)
-{
- Element *elemPtr;
- Blt_HashEntry *hPtr;
- int isNew;
- char *string;
-
- string = Tcl_GetString(objv[3]);
- if (string[0] == '-') {
- Tcl_AppendResult(graphPtr->interp, "name of element \"", string,
- "\" can't start with a '-'", (char *)NULL);
- return TCL_ERROR;
- }
- hPtr = Blt_CreateHashEntry(&graphPtr->elements.table, string, &isNew);
- if (!isNew) {
- Tcl_AppendResult(interp, "element \"", string,
- "\" already exists in \"", Tcl_GetString(objv[0]),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (classId == CID_ELEM_BAR) {
- elemPtr = Blt_BarElement(graphPtr, string, classId);
- } else {
- /* Stripcharts are line graphs with some options enabled. */
- elemPtr = Blt_LineElement(graphPtr, string, classId);
- }
- assert(elemPtr->configSpecs != NULL);
- elemPtr->hashPtr = hPtr;
- Blt_SetHashValue(hPtr, elemPtr);
-
- if (Blt_ConfigureComponentFromObj(interp, graphPtr->tkwin,
- elemPtr->obj.name, "Element", elemPtr->configSpecs, objc - 4, objv + 4,
- (char *)elemPtr, 0) != TCL_OK) {
- DestroyElement(elemPtr);
- return TCL_ERROR;
- }
- (*elemPtr->procsPtr->configProc) (graphPtr, elemPtr);
- elemPtr->link = Blt_Chain_Append(graphPtr->elements.displayList, elemPtr);
- graphPtr->flags |= CACHE_DIRTY;
- Blt_EventuallyRedrawGraph(graphPtr);
- elemPtr->flags |= MAP_ITEM;
- graphPtr->flags |= RESET_AXES;
- Tcl_SetObjResult(interp, objv[3]);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DestroyElements --
- *
- * Removes all the graph's elements. This routine is called when
- * the graph is destroyed.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory allocated for the graph's elements is freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DestroyElements(Graph *graphPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Element *elemPtr;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->elements.table, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- elemPtr = Blt_GetHashValue(hPtr);
- elemPtr->hashPtr = NULL;
- DestroyElement(elemPtr);
- }
- Blt_DeleteHashTable(&graphPtr->elements.table);
- Blt_DeleteHashTable(&graphPtr->elements.tagTable);
- Blt_Chain_Destroy(graphPtr->elements.displayList);
-}
-
-void
-Blt_ConfigureElements(Graph *graphPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- (*elemPtr->procsPtr->configProc) (graphPtr, elemPtr);
- }
-}
-
-void
-Blt_MapElements(Graph *graphPtr)
-{
- Blt_ChainLink link;
-
- if (graphPtr->mode != BARS_INFRONT) {
- Blt_ResetBarGroups(graphPtr);
- }
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (IGNORE_ELEMENT(elemPtr)) {
- continue;
- }
- if ((graphPtr->flags & MAP_ALL) || (elemPtr->flags & MAP_ITEM)) {
- (*elemPtr->procsPtr->mapProc) (graphPtr, elemPtr);
- elemPtr->flags &= ~MAP_ITEM;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawElements --
- *
- * Calls the individual element drawing routines for each
- * element.
- *
- * Results:
- * None
- *
- * Side Effects:
- * Elements are drawn into the drawable (pixmap) which will
- * eventually be displayed in the graph window.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DrawElements(Graph *graphPtr, Drawable drawable)
-{
- Blt_ChainLink link;
-
- /* Draw with respect to the stacking order. */
- for (link = Blt_Chain_LastLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_PrevLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if ((elemPtr->flags & (HIDE|DELETE_PENDING)) == 0) {
- (*elemPtr->procsPtr->drawNormalProc)(graphPtr, drawable, elemPtr);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawActiveElements --
- *
- * Calls the individual element drawing routines to display
- * the active colors for each element.
- *
- * Results:
- * None
- *
- * Side Effects:
- * Elements are drawn into the drawable (pixmap) which will
- * eventually be displayed in the graph window.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DrawActiveElements(Graph *graphPtr, Drawable drawable)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_LastLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_PrevLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if ((elemPtr->flags & (HIDE|ACTIVE|DELETE_PENDING)) == ACTIVE) {
- (*elemPtr->procsPtr->drawActiveProc)(graphPtr, drawable, elemPtr);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ElementsToPostScript --
- *
- * Generates PostScript output for each graph element in the
- * element display list.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ElementsToPostScript(Graph *graphPtr, Blt_Ps ps)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_LastLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_PrevLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->flags & (HIDE|DELETE_PENDING)) {
- continue;
- }
- /* Comment the PostScript to indicate the start of the element */
- Blt_Ps_Format(ps, "\n%% Element \"%s\"\n\n", elemPtr->obj.name);
- (*elemPtr->procsPtr->printNormalProc) (graphPtr, ps, elemPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ActiveElementsToPostScript --
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ActiveElementsToPostScript( Graph *graphPtr, Blt_Ps ps)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_LastLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_PrevLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if ((elemPtr->flags & (DELETE_PENDING|HIDE|ACTIVE)) == ACTIVE) {
- Blt_Ps_Format(ps, "\n%% Active Element \"%s\"\n\n",
- elemPtr->obj.name);
- (*elemPtr->procsPtr->printActiveProc)(graphPtr, ps, elemPtr);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateOp --
- *
- * Marks data points of elements (given by their index) as active.
- *
- * Results:
- * Returns TCL_OK if no errors occurred.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ActivateOp(
- Graph *graphPtr, /* Graph widget */
- Tcl_Interp *interp, /* Interpreter to report errors to */
- int objc, /* Number of element names */
- Tcl_Obj *const *objv) /* List of element names */
-{
- Element *elemPtr;
- int i;
- int *indices;
- int nIndices;
-
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- /* List all the currently active elements */
- for (hPtr = Blt_FirstHashEntry(&graphPtr->elements.table, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- elemPtr = Blt_GetHashValue(hPtr);
- if (elemPtr->flags & ACTIVE) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(elemPtr->obj.name, -1));
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetElement(interp, graphPtr, objv[3], &elemPtr) != TCL_OK) {
- return TCL_ERROR; /* Can't find named element */
- }
- elemPtr->flags |= ACTIVE | ACTIVE_PENDING;
-
- indices = NULL;
- nIndices = -1;
- if (objc > 4) {
- int *activePtr;
-
- nIndices = objc - 4;
- activePtr = indices = Blt_AssertMalloc(sizeof(int) * nIndices);
- for (i = 4; i < objc; i++) {
- if (GetIndex(interp, elemPtr, objv[i], activePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- activePtr++;
- }
- }
- if (elemPtr->activeIndices != NULL) {
- Blt_Free(elemPtr->activeIndices);
- }
- elemPtr->nActiveIndices = nIndices;
- elemPtr->activeIndices = indices;
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-ClientData
-Blt_MakeElementTag(Graph *graphPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&graphPtr->elements.tagTable, tagName, &isNew);
- return Blt_GetHashKey(&graphPtr->elements.tagTable, hPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BindOp --
- *
- * .g element bind elemName sequence command
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BindOp(
- Graph *graphPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- char *tagName;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&graphPtr->elements.tagTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- tagName = Blt_GetHashKey(&graphPtr->elements.tagTable, hPtr);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(tagName, -1));
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- return Blt_ConfigureBindingsFromObj(interp, graphPtr->bindTable,
- Blt_MakeElementTag(graphPtr, Tcl_GetString(objv[3])),
- objc - 4, objv + 4);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateOp --
- *
- * Add a new element to the graph (using the default type of the
- * graph).
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateOp(
- Graph *graphPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv,
- ClassId classId)
-{
- return CreateElement(graphPtr, interp, objc, objv, classId);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CgetOp(
- Graph *graphPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Element *elemPtr;
-
- if (Blt_GetElement(interp, graphPtr, objv[3], &elemPtr) != TCL_OK) {
- return TCL_ERROR; /* Can't find named element */
- }
- if (Blt_ConfigureValueFromObj(interp, graphPtr->tkwin, elemPtr->configSpecs,
- (char *)elemPtr, objv[4], 0) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClosestOp --
- *
- * Find the element closest to the specified screen coordinates.
- * Options:
- * -halo Consider points only with this maximum distance
- * from the picked coordinate.
- * -interpolate Find closest point along element traces, not just
- * data points.
- * -along
- *
- * Results:
- * A standard TCL result. If an element could be found within
- * the halo distance, the interpreter result is "1", otherwise
- * "0". If a closest element exists, the designated TCL array
- * variable will be set with the following information:
- *
- * 1) the element name,
- * 2) the index of the closest point,
- * 3) the distance (in screen coordinates) from the picked X-Y
- * coordinate and the closest point,
- * 4) the X coordinate (graph coordinate) of the closest point,
- * 5) and the Y-coordinate.
- *
- *---------------------------------------------------------------------------
- */
-
-static Blt_ConfigSpec closestSpecs[] = {
- {BLT_CONFIG_PIXELS_NNEG, "-halo", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(ClosestSearch, halo), 0},
- {BLT_CONFIG_BOOLEAN, "-interpolate", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(ClosestSearch, mode), 0 },
- {BLT_CONFIG_CUSTOM, "-along", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(ClosestSearch, along), 0, &alongOption},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-static int
-ClosestOp(
- Graph *graphPtr, /* Graph widget */
- Tcl_Interp *interp, /* Interpreter to report results to */
- int objc, /* Number of element names */
- Tcl_Obj *const *objv) /* List of element names */
-{
- Element *elemPtr;
- ClosestSearch search;
- int i, x, y;
- char *string;
-
- if (graphPtr->flags & RESET_AXES) {
- Blt_ResetAxes(graphPtr);
- }
- if (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) {
- Tcl_AppendResult(interp, ": bad window x-coordinate", (char *)NULL);
- return TCL_ERROR;
- }
- if (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) {
- Tcl_AppendResult(interp, ": bad window y-coordinate", (char *)NULL);
- return TCL_ERROR;
- }
- for (i = 5; i < objc; i += 2) { /* Count switches-value pairs */
- string = Tcl_GetString(objv[i]);
- if ((string[0] != '-') ||
- ((string[1] == '-') && (string[2] == '\0'))) {
- break;
- }
- }
- if (i > objc) {
- i = objc;
- }
-
- search.mode = SEARCH_POINTS;
- search.halo = graphPtr->halo;
- search.index = -1;
- search.along = SEARCH_BOTH;
- search.x = x;
- search.y = y;
-
- if (Blt_ConfigureWidgetFromObj(interp, graphPtr->tkwin, closestSpecs, i - 5,
- objv + 5, (char *)&search, BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR; /* Error occurred processing an option. */
- }
- if (i < objc) {
- string = Tcl_GetString(objv[i]);
- if (string[0] == '-') {
- i++; /* Skip "--" */
- }
- }
- search.dist = (double)(search.halo + 1);
-
- if (i < objc) {
- for ( /* empty */ ; i < objc; i++) {
- if (Blt_GetElement(interp, graphPtr, objv[i], &elemPtr) != TCL_OK) {
- return TCL_ERROR; /* Can't find named element */
- }
- if (IGNORE_ELEMENT(elemPtr)) {
- continue;
- }
- if (elemPtr->flags & (HIDE|MAP_ITEM)) {
- continue;
- }
- (*elemPtr->procsPtr->closestProc) (graphPtr, elemPtr, &search);
- }
- } else {
- Blt_ChainLink link;
-
- /*
- * Find the closest point from the set of displayed elements,
- * searching the display list from back to front. That way if
- * the points from two different elements overlay each other
- * exactly, the last one picked will be the topmost.
- */
- for (link = Blt_Chain_LastLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_PrevLink(link)) {
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->flags & (HIDE|MAP_ITEM|DELETE_PENDING)) {
- continue;
- }
- (*elemPtr->procsPtr->closestProc) (graphPtr, elemPtr, &search);
- }
- }
- if (search.dist < (double)search.halo) {
- Tcl_Obj *listObjPtr;
- /*
- * Return a list of name value pairs.
- */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("name", -1));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(search.elemPtr->obj.name, -1));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("index", -1));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(search.index));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("x", -1));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(search.point.x));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("y", -1));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(search.point.y));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("dist", -1));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(search.dist));
- Tcl_SetObjResult(interp, listObjPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Sets the element specifications by the given the command line
- * arguments and calls the element specification configuration
- * routine. If zero or one command line options are given, only
- * information about the option(s) is returned in interp->result.
- * If the element configuration has changed and the element is
- * currently displayed, the axis limits are updated and
- * recomputed.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new display list.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(
- Graph *graphPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int nNames, nOpts;
- Tcl_Obj *const *options;
- int i;
-
- /* Figure out where the option value pairs begin */
- objc -= 3;
- objv += 3;
- for (i = 0; i < objc; i++) {
- Element *elemPtr;
- char *string;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] == '-') {
- break;
- }
- if (Blt_GetElement(interp, graphPtr, objv[i], &elemPtr) != TCL_OK) {
- return TCL_ERROR; /* Can't find named element */
- }
- }
- nNames = i; /* Number of element names specified */
- nOpts = objc - i; /* Number of options specified */
- options = objv + nNames; /* Start of options in objv */
-
- for (i = 0; i < nNames; i++) {
- Element *elemPtr;
- int flags;
-
- if (Blt_GetElement(interp, graphPtr, objv[i], &elemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- flags = BLT_CONFIG_OBJV_ONLY;
- if (nOpts == 0) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin,
- elemPtr->configSpecs, (char *)elemPtr, (Tcl_Obj *)NULL, flags);
- } else if (nOpts == 1) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin,
- elemPtr->configSpecs, (char *)elemPtr, options[0], flags);
- }
- if (Blt_ConfigureWidgetFromObj(interp, graphPtr->tkwin,
- elemPtr->configSpecs, nOpts, options, (char *)elemPtr, flags)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if ((*elemPtr->procsPtr->configProc) (graphPtr, elemPtr) != TCL_OK) {
- return TCL_ERROR; /* Failed to configure element */
- }
- if (Blt_ConfigModified(elemPtr->configSpecs, "-hide", (char *)NULL)) {
- graphPtr->flags |= RESET_AXES;
- elemPtr->flags |= MAP_ITEM;
- }
- /* If data points or axes have changed, reset the axes (may
- * affect autoscaling) and recalculate the screen points of
- * the element. */
-
- if (Blt_ConfigModified(elemPtr->configSpecs, "-*data", "-map*", "-x",
- "-y", (char *)NULL)) {
- graphPtr->flags |= RESET_WORLD;
- elemPtr->flags |= MAP_ITEM;
- }
- /* The new label may change the size of the legend */
- if (Blt_ConfigModified(elemPtr->configSpecs, "-label", (char *)NULL)) {
- graphPtr->flags |= (MAP_WORLD | REDRAW_WORLD);
- }
- }
- /* Update the pixmap if any configuration option changed */
- graphPtr->flags |= CACHE_DIRTY;
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeactivateOp --
- *
- * Clears the active bit for the named elements.
- *
- * Results:
- * Returns TCL_OK if no errors occurred.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DeactivateOp(
- Graph *graphPtr, /* Graph widget */
- Tcl_Interp *interp, /* Not used. */
- int objc, /* Number of element names */
- Tcl_Obj *const *objv) /* List of element names */
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- Element *elemPtr;
-
- if (Blt_GetElement(interp, graphPtr, objv[i], &elemPtr) != TCL_OK) {
- return TCL_ERROR; /* Can't find named element */
- }
- elemPtr->flags &= ~(ACTIVE | ACTIVE_PENDING);
- if (elemPtr->activeIndices != NULL) {
- Blt_Free(elemPtr->activeIndices);
- elemPtr->activeIndices = NULL;
- }
- elemPtr->nActiveIndices = 0;
- }
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Delete the named elements from the graph.
- *
- * Results:
- * TCL_ERROR is returned if any of the named elements can not be
- * found. Otherwise TCL_OK is returned;
- *
- * Side Effects:
- * If the element is currently displayed, the plotting area of
- * the graph is redrawn. Memory and resources allocated by the
- * elements are released.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DeleteOp(
- Graph *graphPtr, /* Graph widget */
- Tcl_Interp *interp, /* Not used. */
- int objc, /* Number of element names */
- Tcl_Obj *const *objv) /* List of element names */
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- Element *elemPtr;
-
- if (Blt_GetElement(interp, graphPtr, objv[i], &elemPtr) != TCL_OK) {
- return TCL_ERROR; /* Can't find named element */
- }
- elemPtr->flags |= DELETE_PENDING;
- Tcl_EventuallyFree(elemPtr, FreeElement);
- }
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExistsOp --
- *
- * Indicates if the named element exists in the graph.
- *
- * Results:
- * The return value is a standard TCL result. The interpreter
- * result will contain "1" or "0".
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-ExistsOp(
- Graph *graphPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&graphPtr->elements.table, Tcl_GetString(objv[3]));
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), (hPtr != NULL));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetOp --
- *
- * Returns the name of the picked element (using the element
- * bind operation). Right now, the only name accepted is
- * "current".
- *
- * Results:
- * A standard TCL result. The interpreter result will contain
- * the name of the element.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-GetOp(
- Graph *graphPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- char *string;
-
- string = Tcl_GetString(objv[3]);
- if ((string[0] == 'c') && (strcmp(string, "current") == 0)) {
- Element *elemPtr;
-
- elemPtr = Blt_GetCurrentItem(graphPtr->bindTable);
- /* Report only on elements. */
- if ((elemPtr != NULL) && ((elemPtr->flags & DELETE_PENDING) == 0) &&
- (elemPtr->obj.classId >= CID_ELEM_BAR) &&
- (elemPtr->obj.classId <= CID_ELEM_STRIP)) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), elemPtr->obj.name,-1);
- }
- }
- return TCL_OK;
-}
-
-static Tcl_Obj *
-DisplayListObj(Graph *graphPtr)
-{
- Tcl_Obj *listObjPtr;
- Blt_ChainLink link;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
- Tcl_Obj *objPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- objPtr = Tcl_NewStringObj(elemPtr->obj.name, -1);
- Tcl_ListObjAppendElement(graphPtr->interp, listObjPtr, objPtr);
- }
- return listObjPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LowerOp --
- *
- * Lowers the named elements to the bottom of the display list.
- *
- * Results:
- * A standard TCL result. The interpreter result will contain the new
- * display list of element names.
- *
- * .g element lower elem ?elem...?
- *
- *---------------------------------------------------------------------------
- */
-static int
-LowerOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Chain chain;
- Blt_ChainLink link, next;
- int i;
-
- /* Move the links of lowered elements out of the display list into
- * a temporary list. */
- chain = Blt_Chain_Create();
- for (i = 3; i < objc; i++) {
- Element *elemPtr;
-
- if (Blt_GetElement(interp, graphPtr, objv[i], &elemPtr) != TCL_OK) {
- return TCL_ERROR; /* Can't find named element */
- }
- Blt_Chain_UnlinkLink(graphPtr->elements.displayList, elemPtr->link);
- Blt_Chain_LinkAfter(chain, elemPtr->link, NULL);
- }
- /* Append the links to end of the display list. */
- for (link = Blt_Chain_FirstLink(chain); link != NULL; link = next) {
- next = Blt_Chain_NextLink(link);
- Blt_Chain_UnlinkLink(chain, link);
- Blt_Chain_LinkAfter(graphPtr->elements.displayList, link, NULL);
- }
- Blt_Chain_Destroy(chain);
- Tcl_SetObjResult(interp, DisplayListObj(graphPtr));
- graphPtr->flags |= RESET_WORLD;
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * Returns the names of the elements is the graph matching
- * one of more patterns provided. If no pattern arguments
- * are given, then all element names will be returned.
- *
- * Results:
- * The return value is a standard TCL result. The interpreter
- * result will contain a TCL list of the element names.
- *
- *---------------------------------------------------------------------------
- */
-static int
-NamesOp(
- Graph *graphPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->elements.table, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Element *elemPtr;
- Tcl_Obj *objPtr;
-
- elemPtr = Blt_GetHashValue(hPtr);
- objPtr = Tcl_NewStringObj(elemPtr->obj.name, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- } else {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->elements.table, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Element *elemPtr;
- int i;
-
- elemPtr = Blt_GetHashValue(hPtr);
- for (i = 3; i < objc; i++) {
- if (Tcl_StringMatch(elemPtr->obj.name,Tcl_GetString(objv[i]))) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(elemPtr->obj.name, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- break;
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RaiseOp --
- *
- * Reset the element within the display list.
- *
- * Results:
- * The return value is a standard TCL result. The interpreter
- * result will contain the new display list of element names.
- *
- * .g element raise ?elem...?
- *
- *---------------------------------------------------------------------------
- */
-static int
-RaiseOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Chain chain;
- Blt_ChainLink link, prev;
- int i;
-
- /* Move the links of lowered elements out of the display list into
- * a temporary list. */
- chain = Blt_Chain_Create();
- for (i = 3; i < objc; i++) {
- Element *elemPtr;
-
- if (Blt_GetElement(interp, graphPtr, objv[i], &elemPtr) != TCL_OK) {
- return TCL_ERROR; /* Can't find named element */
- }
- Blt_Chain_UnlinkLink(graphPtr->elements.displayList, elemPtr->link);
- Blt_Chain_LinkAfter(chain, elemPtr->link, NULL);
- }
- /* Prepend the links to beginning of the display list in reverse order. */
- for (link = Blt_Chain_LastLink(chain); link != NULL; link = prev) {
- prev = Blt_Chain_PrevLink(link);
- Blt_Chain_UnlinkLink(chain, link);
- Blt_Chain_LinkBefore(graphPtr->elements.displayList, link, NULL);
- }
- Blt_Chain_Destroy(chain);
- Tcl_SetObjResult(interp, DisplayListObj(graphPtr));
- graphPtr->flags |= RESET_WORLD;
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShowOp --
- *
- * Queries or resets the element display list.
- *
- * Results:
- * The return value is a standard TCL result. The interpreter
- * result will contain the new display list of element names.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ShowOp(
- Graph *graphPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- if (objc == 4) {
- Blt_Chain chain;
- Blt_ChainLink link;
- Tcl_Obj **elem;
- int i, n;
-
- if (Tcl_ListObjGetElements(interp, objv[3], &n, &elem) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Collect the named elements into a list. */
- chain = Blt_Chain_Create();
- for (i = 0; i < n; i++) {
- Element *elemPtr; /* Element information record */
-
- if (Blt_GetElement(interp, graphPtr, elem[i], &elemPtr) != TCL_OK) {
- Blt_Chain_Destroy(chain);
- return TCL_ERROR;
- }
- Blt_Chain_Append(chain, elemPtr);
- }
- /* Clear the links from the currently displayed elements. */
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- elemPtr->link = NULL;
- }
- Blt_Chain_Destroy(graphPtr->elements.displayList);
- graphPtr->elements.displayList = chain;
- /* Set links on all the displayed elements. */
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- elemPtr->link = link;
- }
- graphPtr->flags |= RESET_WORLD;
- Blt_EventuallyRedrawGraph(graphPtr);
- }
- Tcl_SetObjResult(interp, DisplayListObj(graphPtr));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TypeOp --
- *
- * Returns the name of the type of the element given by some
- * element name.
- *
- * Results:
- * A standard TCL result. Returns the type of the element in
- * interp->result. If the identifier given doesn't represent an
- * element, then an error message is left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TypeOp(
- Graph *graphPtr, /* Graph widget */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Element name */
-{
- Element *elemPtr;
- const char *string;
-
- if (Blt_GetElement(interp, graphPtr, objv[3], &elemPtr) != TCL_OK) {
- return TCL_ERROR; /* Can't find named element */
- }
- switch (elemPtr->obj.classId) {
- case CID_ELEM_BAR: string = "bar"; break;
- case CID_ELEM_CONTOUR: string = "contour"; break;
- case CID_ELEM_LINE: string = "line"; break;
- case CID_ELEM_STRIP: string = "strip"; break;
- default: string = "???"; break;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), string, -1);
- return TCL_OK;
-}
-
-/*
- * Global routines:
- */
-static Blt_OpSpec elemOps[] = {
- {"activate", 1, ActivateOp, 3, 0, "?elemName? ?index...?",},
- {"bind", 1, BindOp, 3, 6, "elemName sequence command",},
- {"cget", 2, CgetOp, 5, 5, "elemName option",},
- {"closest", 2, ClosestOp, 5, 0,
- "x y ?option value?... ?elemName?...",},
- {"configure", 2, ConfigureOp, 4, 0,
- "elemName ?elemName?... ?option value?...",},
- {"create", 2, CreateOp, 4, 0, "elemName ?option value?...",},
- {"deactivate", 3, DeactivateOp, 3, 0, "?elemName?...",},
- {"delete", 3, DeleteOp, 3, 0, "?elemName?...",},
- {"exists", 1, ExistsOp, 4, 4, "elemName",},
- {"get", 1, GetOp, 4, 4, "name",},
- {"lower", 1, LowerOp, 3, 0, "?elemName?...",},
- {"names", 1, NamesOp, 3, 0, "?pattern?...",},
- {"raise", 1, RaiseOp, 3, 0, "?elemName?...",},
- {"show", 1, ShowOp, 3, 4, "?elemList?",},
- {"type", 1, TypeOp, 4, 4, "elemName",},
-};
-static int numElemOps = sizeof(elemOps) / sizeof(Blt_OpSpec);
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ElementOp --
- *
- * This procedure is invoked to process the TCL command that
- * corresponds to a widget managed by this module. See the user
- * documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_ElementOp(
- Graph *graphPtr, /* Graph widget record */
- Tcl_Interp *interp,
- int objc, /* # arguments */
- Tcl_Obj *const *objv, /* Argument list */
- ClassId classId)
-{
- void *ptr;
- int result;
-
- ptr = Blt_GetOpFromObj(interp, numElemOps, elemOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (ptr == NULL) {
- return TCL_ERROR;
- }
- if (ptr == CreateOp) {
- result = CreateOp(graphPtr, interp, objc, objv, classId);
- } else {
- GraphElementProc *proc;
-
- proc = ptr;
- result = (*proc) (graphPtr, interp, objc, objv);
- }
- return result;
-}
diff --git a/blt3.0.1/src/bltGrElem.h b/blt3.0.1/src/bltGrElem.h
deleted file mode 100644
index f0e3969..0000000
--- a/blt3.0.1/src/bltGrElem.h
+++ /dev/null
@@ -1,271 +0,0 @@
-
-/*
- * bltGrElem.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_GR_ELEM_H
-#define _BLT_GR_ELEM_H
-
-#include <bltVector.h>
-#include <bltDataTable.h>
-
-#define ELEM_SOURCE_VALUES 0
-#define ELEM_SOURCE_VECTOR 1
-#define ELEM_SOURCE_TABLE 2
-
-#define SEARCH_X 0
-#define SEARCH_Y 1
-#define SEARCH_BOTH 2
-
-#define SHOW_NONE 0
-#define SHOW_X 1
-#define SHOW_Y 2
-#define SHOW_BOTH 3
-
-#define SEARCH_POINTS 0 /* Search for closest data point. */
-#define SEARCH_TRACES 1 /* Search for closest point on trace.
- * Interpolate the connecting line segments if
- * necessary. */
-#define SEARCH_AUTO 2 /* Automatically determine whether to search
- * for data points or traces. Look for traces
- * if the linewidth is > 0 and if there is
- * more than one data point. */
-
-#define LABEL_ACTIVE (1<<9) /* Non-zero indicates that the element's entry
- * in the legend should be drawn in its active
- * foreground and background colors. */
-#define SCALE_SYMBOL (1<<10)
-
-#define NUMBEROFPOINTS(e) MIN((e)->x.nValues, (e)->y.nValues)
-
-#define NORMALPEN(e) ((((e)->normalPenPtr == NULL) ? \
- (e)->builtinPenPtr : \
- (e)->normalPenPtr))
-
-/*
- *---------------------------------------------------------------------------
- *
- * Weight --
- *
- * Designates a range of values by a minimum and maximum limit.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- double min, max, range;
-} Weight;
-
-#define SetRange(l) \
- ((l).range = ((l).max > (l).min) ? ((l).max - (l).min) : DBL_EPSILON)
-#define SetScale(l) \
- ((l).scale = 1.0 / (l).range)
-#define SetWeight(l, lo, hi) \
- ((l).min = (lo), (l).max = (hi), SetRange(l))
-
-typedef struct {
- Segment2d *segments; /* Point to start of this pen's X-error bar
- * segments in the element's array. */
- int nSegments;
-} ErrorBarSegments;
-
-/*
- * An element has one or more vectors plus several attributes, such as line
- * style, thickness, color, and symbol type. It has an identifier which
- * distinguishes it among the list of all elements.
- */
-typedef struct {
- Weight weight; /* Weight range where this pen is valid. */
- Pen *penPtr; /* Pen to use. */
-} PenStyle;
-
-
-typedef struct {
- XColor *color; /* Color of error bar */
- int lineWidth; /* Width of the error bar segments. */
- GC gc;
- int show; /* Flags for errorbars: none, x, y, or both */
-} ErrorBarAttributes;
-
-typedef struct {
- /* Inputs */
- int halo; /* Maximal screen distance a candidate point
- * can be from the sample window coordinate */
-
- int mode; /* Indicates whether to find the closest data
- * point or the closest point on the trace by
- * interpolating the line segments. Can also
- * be SEARCH_AUTO, indicating to choose how to
- * search.*/
-
- int x, y; /* Screen coordinates of test point */
-
- int along; /* Indicates to let search run along a
- * particular axis: x, y, or both. */
-
- /* Outputs */
- Element *elemPtr; /* Name of the closest element */
-
- Point2d point; /* Graph coordinates of closest point */
-
- int index; /* Index of closest data point */
-
- double dist; /* Distance in screen coordinates */
-
-} ClosestSearch;
-
-typedef void (ElementDrawProc) (Graph *graphPtr, Drawable drawable,
- Element *elemPtr);
-
-typedef void (ElementToPostScriptProc) (Graph *graphPtr, Blt_Ps ps,
- Element *elemPtr);
-
-typedef void (ElementDestroyProc) (Graph *graphPtr, Element *elemPtr);
-
-typedef int (ElementConfigProc) (Graph *graphPtr, Element *elemPtr);
-
-typedef void (ElementMapProc) (Graph *graphPtr, Element *elemPtr);
-
-typedef void (ElementExtentsProc) (Element *elemPtr, Region2d *extsPtr);
-
-typedef void (ElementClosestProc) (Graph *graphPtr, Element *elemPtr,
- ClosestSearch *searchPtr);
-
-typedef void (ElementDrawSymbolProc) (Graph *graphPtr, Drawable drawable,
- Element *elemPtr, int x, int y, int symbolSize);
-
-typedef void (ElementSymbolToPostScriptProc) (Graph *graphPtr,
- Blt_Ps ps, Element *elemPtr, double x, double y, int symSize);
-
-typedef struct {
- ElementClosestProc *closestProc;
- ElementConfigProc *configProc;
- ElementDestroyProc *destroyProc;
- ElementDrawProc *drawActiveProc;
- ElementDrawProc *drawNormalProc;
- ElementDrawSymbolProc *drawSymbolProc;
- ElementExtentsProc *extentsProc;
- ElementToPostScriptProc *printActiveProc;
- ElementToPostScriptProc *printNormalProc;
- ElementSymbolToPostScriptProc *printSymbolProc;
- ElementMapProc *mapProc;
-} ElementProcs;
-
-typedef struct {
- Blt_VectorId vector;
-} VectorDataSource;
-
-typedef struct {
- Blt_Table table; /* Data table. */
- Blt_TableColumn column; /* Column of data used. */
- Blt_TableNotifier notifier; /* Notifier used for column destroy
- * event. */
- Blt_TableTrace trace; /* Trace used for column
- * (set/get/unset). */
- Blt_HashEntry *hashPtr; /* Pointer to the entry of the data
- * source in graph's hash table of
- * datatables. One graph may use
- * multiple columns from the same data
- * table. */
-} TableDataSource;
-
-/*
- * The data structure below contains information pertaining to a line vector.
- * It consists of an array of floating point data values and for convenience,
- * the number and minimum/maximum values.
- */
-typedef struct {
- int type; /* Selects the type of data populating this
- * vector: ELEM_SOURCE_VECTOR,
- * ELEM_SOURCE_TABLE, or ELEM_SOURCE_VALUES
- */
- Element *elemPtr; /* Element associated with vector. */
- union {
- TableDataSource tableSource;
- VectorDataSource vectorSource;
- };
- double *values;
- int nValues;
- int arraySize;
- double min, max;
-} ElemValues;
-
-
-struct _Element {
- GraphObj obj; /* Must be first field in element. */
- unsigned int flags;
- Blt_HashEntry *hashPtr;
-
- /* Fields specific to elements. */
- const char *label; /* Label displayed in legend */
- unsigned short row, col; /* Position of the entry in the
- * legend. */
- int legendRelief; /* Relief of label in legend. */
- Axis2d axes; /* X-axis and Y-axis mapping the
- * element */
- ElemValues x, y, w; /* Contains array of floating point
- * graph coordinate values. Also holds
- * min/max and the number of
- * coordinates */
- int *activeIndices; /* Array of indices (malloc-ed) which
- * indicate which data points are
- * active (drawn with "active"
- * colors). */
- int nActiveIndices; /* Number of active data points.
- * Special case: if nActiveIndices < 0
- * and the active bit is set in
- * "flags", then all data points are
- * drawn active. */
- ElementProcs *procsPtr;
- Blt_ConfigSpec *configSpecs; /* Configuration specifications. */
- Pen *activePenPtr; /* Standard Pens */
- Pen *normalPenPtr;
- Pen *builtinPenPtr;
- Blt_Chain stylePalette; /* Palette of pens. */
-
- /* Symbol scaling */
- int scaleSymbols; /* If non-zero, the symbols will scale
- * in size as the graph is zoomed
- * in/out. */
- double xRange, yRange; /* Initial X-axis and Y-axis ranges:
- * used to scale the size of element's
- * symbol. */
- int state;
- Blt_ChainLink link; /* Element's link in display list. */
-};
-
-
-BLT_EXTERN double Blt_FindElemValuesMinimum(ElemValues *vecPtr, double minLimit);
-BLT_EXTERN void Blt_ResizeStatusArray(Element *elemPtr, int nPoints);
-BLT_EXTERN int Blt_GetPenStyle(Graph *graphPtr, char *name, size_t classId,
- PenStyle *stylePtr);
-BLT_EXTERN void Blt_FreeStylePalette (Blt_Chain stylePalette);
-BLT_EXTERN PenStyle **Blt_StyleMap (Element *elemPtr);
-BLT_EXTERN void Blt_MapErrorBars(Graph *graphPtr, Element *elemPtr,
- PenStyle **dataToStyle);
-BLT_EXTERN void Blt_FreeDataValues(ElemValues *evPtr);
-BLT_EXTERN int Blt_GetElement(Tcl_Interp *interp, Graph *graphPtr,
- Tcl_Obj *objPtr, Element **elemPtrPtr);
-BLT_EXTERN void Blt_DestroyTableClients(Graph *graphPtr);
-
-#endif /* _BLT_GR_ELEM_H */
diff --git a/blt3.0.1/src/bltGrHairs.c b/blt3.0.1/src/bltGrHairs.c
deleted file mode 100644
index 86ebb57..0000000
--- a/blt3.0.1/src/bltGrHairs.c
+++ /dev/null
@@ -1,534 +0,0 @@
-
-/*
- * bltGrHairs.c --
- *
- * This module implements crosshairs for the BLT graph widget.
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltGraph.h"
-#include "bltOp.h"
-
-typedef int (GraphCrosshairProc)(Graph *graphPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-
-/*
- *---------------------------------------------------------------------------
- *
- * Crosshairs
- *
- * Contains the line segments positions and graphics context used
- * to simulate crosshairs (by XORing) on the graph.
- *
- *---------------------------------------------------------------------------
- */
-
-struct _Crosshairs {
-
- XPoint hotSpot; /* Hot spot for crosshairs */
- int visible; /* Internal state of crosshairs. If non-zero,
- * crosshairs are displayed. */
- int hidden; /* If non-zero, crosshairs are not displayed.
- * This is not necessarily consistent with the
- * internal state variable. This is true when
- * the hot spot is off the graph. */
- Blt_Dashes dashes; /* Dashstyle of the crosshairs. This represents
- * an array of alternatingly drawn pixel
- * values. If NULL, the hairs are drawn as a
- * solid line */
- int lineWidth; /* Width of the simulated crosshair lines */
- XSegment segArr[2]; /* Positions of line segments representing the
- * simulated crosshairs. */
- XColor *colorPtr; /* Foreground color of crosshairs */
- GC gc; /* Graphics context for crosshairs. Set to
- * GXxor to not require redraws of graph */
-};
-
-#define DEF_HAIRS_DASHES (char *)NULL
-#define DEF_HAIRS_FOREGROUND RGB_BLACK
-#define DEF_HAIRS_LINE_WIDTH "0"
-#define DEF_HAIRS_HIDE "yes"
-#define DEF_HAIRS_POSITION (char *)NULL
-
-BLT_EXTERN Blt_CustomOption bltPointOption;
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_COLOR, "-color", "color", "Color", DEF_HAIRS_FOREGROUND,
- Blt_Offset(Crosshairs, colorPtr), 0},
- {BLT_CONFIG_DASHES, "-dashes", "dashes", "Dashes", DEF_HAIRS_DASHES,
- Blt_Offset(Crosshairs, dashes), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BOOLEAN, "-hide", "hide", "Hide", DEF_HAIRS_HIDE,
- Blt_Offset(Crosshairs, hidden), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-linewidth", "lineWidth", "Linewidth",
- DEF_HAIRS_LINE_WIDTH, Blt_Offset(Crosshairs, lineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-position", "position", "Position",
- DEF_HAIRS_POSITION, Blt_Offset(Crosshairs, hotSpot), 0, &bltPointOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * TurnOffHairs --
- *
- * XOR's the existing line segments (representing the crosshairs),
- * thereby erasing them. The internal state of the crosshairs is
- * tracked.
- *
- * Results:
- * None
- *
- * Side Effects:
- * Crosshairs are erased.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TurnOffHairs(Tk_Window tkwin, Crosshairs *chPtr)
-{
- if (Tk_IsMapped(tkwin) && (chPtr->visible)) {
- XDrawSegments(Tk_Display(tkwin), Tk_WindowId(tkwin), chPtr->gc,
- chPtr->segArr, 2);
- chPtr->visible = FALSE;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TurnOnHairs --
- *
- * Draws (by XORing) new line segments, creating the effect of
- * crosshairs. The internal state of the crosshairs is tracked.
- *
- * Results:
- * None
- *
- * Side Effects:
- * Crosshairs are displayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TurnOnHairs(Graph *graphPtr, Crosshairs *chPtr)
-{
- if (Tk_IsMapped(graphPtr->tkwin) && (!chPtr->visible)) {
- if (!PointInGraph(graphPtr, chPtr->hotSpot.x, chPtr->hotSpot.y)) {
- return; /* Coordinates are off the graph */
- }
- XDrawSegments(graphPtr->display, Tk_WindowId(graphPtr->tkwin),
- chPtr->gc, chPtr->segArr, 2);
- chPtr->visible = TRUE;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureCrosshairs --
- *
- * Configures attributes of the crosshairs such as line width,
- * dashes, and position. The crosshairs are first turned off
- * before any of the attributes changes.
- *
- * Results:
- * None
- *
- * Side Effects:
- * Crosshair GC is allocated.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ConfigureCrosshairs(Graph *graphPtr)
-{
- XGCValues gcValues;
- unsigned long gcMask;
- GC newGC;
- unsigned long int pixel;
- Crosshairs *chPtr = graphPtr->crosshairs;
-
- /*
- * Turn off the crosshairs temporarily. This is in case the new
- * configuration changes the size, style, or position of the lines.
- */
- TurnOffHairs(graphPtr->tkwin, chPtr);
-
- gcValues.function = GXxor;
-
- if (graphPtr->plotBg == NULL) {
- /* The graph's color option may not have been set yet */
- pixel = WhitePixelOfScreen(Tk_Screen(graphPtr->tkwin));
- } else {
- pixel = Blt_BackgroundBorderColor(graphPtr->plotBg)->pixel;
- }
- gcValues.background = pixel;
- gcValues.foreground = (pixel ^ chPtr->colorPtr->pixel);
-
- gcValues.line_width = LineWidth(chPtr->lineWidth);
- gcMask = (GCForeground | GCBackground | GCFunction | GCLineWidth);
- if (LineIsDashed(chPtr->dashes)) {
- gcValues.line_style = LineOnOffDash;
- gcMask |= GCLineStyle;
- }
- newGC = Blt_GetPrivateGC(graphPtr->tkwin, gcMask, &gcValues);
- if (LineIsDashed(chPtr->dashes)) {
- Blt_SetDashes(graphPtr->display, newGC, &chPtr->dashes);
- }
- if (chPtr->gc != NULL) {
- Blt_FreePrivateGC(graphPtr->display, chPtr->gc);
- }
- chPtr->gc = newGC;
-
- /*
- * Are the new coordinates on the graph?
- */
- chPtr->segArr[0].x2 = chPtr->segArr[0].x1 = chPtr->hotSpot.x;
- chPtr->segArr[0].y1 = graphPtr->bottom;
- chPtr->segArr[0].y2 = graphPtr->top;
- chPtr->segArr[1].y2 = chPtr->segArr[1].y1 = chPtr->hotSpot.y;
- chPtr->segArr[1].x1 = graphPtr->left;
- chPtr->segArr[1].x2 = graphPtr->right;
-
- if (!chPtr->hidden) {
- TurnOnHairs(graphPtr, chPtr);
- }
-}
-
-void
-Blt_EnableCrosshairs(Graph *graphPtr)
-{
- if (!graphPtr->crosshairs->hidden) {
- TurnOnHairs(graphPtr, graphPtr->crosshairs);
- }
-}
-
-void
-Blt_DisableCrosshairs(Graph *graphPtr)
-{
- if (!graphPtr->crosshairs->hidden) {
- TurnOffHairs(graphPtr->tkwin, graphPtr->crosshairs);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UpdateCrosshairs --
- *
- * Update the length of the hairs (not the hot spot).
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_UpdateCrosshairs(Graph *graphPtr)
-{
- Crosshairs *chPtr = graphPtr->crosshairs;
-
- chPtr->segArr[0].y1 = graphPtr->bottom;
- chPtr->segArr[0].y2 = graphPtr->top;
- chPtr->segArr[1].x1 = graphPtr->left;
- chPtr->segArr[1].x2 = graphPtr->right;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DestroyCrosshairs --
- *
- * Results:
- * None
- *
- * Side Effects:
- * Crosshair GC is allocated.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DestroyCrosshairs(Graph *graphPtr)
-{
- if (graphPtr->crosshairs != NULL) {
- Crosshairs *chPtr = graphPtr->crosshairs;
-
- Blt_FreeOptions(configSpecs, (char *)chPtr, graphPtr->display, 0);
- if (chPtr->gc != NULL) {
- Blt_FreePrivateGC(graphPtr->display, chPtr->gc);
- }
- Blt_Free(chPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_CreateCrosshairs --
- *
- * Creates and initializes a new crosshair structure.
- *
- * Results:
- * Returns TCL_ERROR if the crosshair structure can't be created,
- * otherwise TCL_OK.
- *
- * Side Effects:
- * Crosshair GC is allocated.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_CreateCrosshairs(Graph *graphPtr)
-{
- Crosshairs *chPtr;
-
- chPtr = Blt_AssertCalloc(1, sizeof(Crosshairs));
- chPtr->hidden = TRUE;
- chPtr->hotSpot.x = chPtr->hotSpot.y = -1;
- graphPtr->crosshairs = chPtr;
-
- if (Blt_ConfigureComponentFromObj(graphPtr->interp, graphPtr->tkwin,
- "crosshairs", "Crosshairs", configSpecs, 0, (Tcl_Obj **)NULL,
- (char *)chPtr, 0) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Queries configuration attributes of the crosshairs such as
- * line width, dashes, and position.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-CgetOp(
- Graph *graphPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Crosshairs *chPtr = graphPtr->crosshairs;
-
- return Blt_ConfigureValueFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)chPtr, objv[3], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Queries or resets configuration attributes of the crosshairs
- * such as line width, dashes, and position.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Crosshairs are reset.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(
- Graph *graphPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Crosshairs *chPtr = graphPtr->crosshairs;
-
- if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)chPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)chPtr, objv[3], 0);
- }
- if (Blt_ConfigureWidgetFromObj(interp, graphPtr->tkwin, configSpecs,
- objc - 3, objv + 3, (char *)chPtr, BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_ConfigureCrosshairs(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OnOp --
- *
- * Maps the crosshairs.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Crosshairs are reset if necessary.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-OnOp(
- Graph *graphPtr,
- Tcl_Interp *interp, /* Not used. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Not used. */
-{
- Crosshairs *chPtr = graphPtr->crosshairs;
-
- if (chPtr->hidden) {
- TurnOnHairs(graphPtr, chPtr);
- chPtr->hidden = FALSE;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OffOp --
- *
- * Unmaps the crosshairs.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Crosshairs are reset if necessary.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-OffOp(
- Graph *graphPtr,
- Tcl_Interp *interp, /* Not used. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Not used. */
-{
- Crosshairs *chPtr = graphPtr->crosshairs;
-
- if (!chPtr->hidden) {
- TurnOffHairs(graphPtr->tkwin, chPtr);
- chPtr->hidden = TRUE;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ToggleOp --
- *
- * Toggles the state of the crosshairs.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Crosshairs are reset.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ToggleOp(
- Graph *graphPtr,
- Tcl_Interp *interp, /* Not used. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Not used. */
-{
- Crosshairs *chPtr = graphPtr->crosshairs;
-
- chPtr->hidden = (chPtr->hidden == 0);
- if (chPtr->hidden) {
- TurnOffHairs(graphPtr->tkwin, chPtr);
- } else {
- TurnOnHairs(graphPtr, chPtr);
- }
- return TCL_OK;
-}
-
-
-static Blt_OpSpec xhairOps[] =
-{
- {"cget", 2, CgetOp, 4, 4, "option",},
- {"configure", 2, ConfigureOp, 3, 0, "?options...?",},
- {"off", 2, OffOp, 3, 3, "",},
- {"on", 2, OnOp, 3, 3, "",},
- {"toggle", 1, ToggleOp, 3, 3, "",},
-};
-static int nXhairOps = sizeof(xhairOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_CrosshairsOp --
- *
- * User routine to configure crosshair simulation. Crosshairs
- * are simulated by drawing line segments parallel to both axes
- * using the XOR drawing function. The allows the lines to be
- * erased (by drawing them again) without redrawing the entire
- * graph. Care must be taken to erase crosshairs before redrawing
- * the graph and redraw them after the graph is redraw.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- * Side Effects:
- * Crosshairs may be drawn in the plotting area.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_CrosshairsOp(
- Graph *graphPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- GraphCrosshairProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nXhairOps, xhairOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (graphPtr, interp, objc, objv);
-}
diff --git a/blt3.0.1/src/bltGrLegd.c b/blt3.0.1/src/bltGrLegd.c
deleted file mode 100644
index 9ed3169..0000000
--- a/blt3.0.1/src/bltGrLegd.c
+++ /dev/null
@@ -1,3047 +0,0 @@
-
-/*
- * bltGrLegd.c --
- *
- * This module implements the legend for the BLT graph widget.
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltGraph.h"
-#include "bltOp.h"
-#include "bltGrElem.h"
-#include "bltPicture.h"
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-
-/*
- * Selection related flags:
- *
- * SELECT_EXPORT Export the selection to X11.
- *
- * SELECT_PENDING A "selection" command idle task is pending.
- *
- * SELECT_CLEAR Clear selection flag of entry.
- *
- * SELECT_SET Set selection flag of entry.
- *
- * SELECT_TOGGLE Toggle selection flag of entry.
- *
- * SELECT_MASK Mask of selection set/clear/toggle flags.
- *
- * SELECT_SORTED Indicates if the entries in the selection
- * should be sorted or displayed in the order
- * they were selected.
- *
- */
-
-#define SELECT_CLEAR (1<<16)
-#define SELECT_EXPORT (1<<17)
-#define SELECT_PENDING (1<<18)
-#define SELECT_SET (1<<19)
-#define SELECT_TOGGLE (SELECT_SET | SELECT_CLEAR)
-#define SELECT_MASK (SELECT_SET | SELECT_CLEAR)
-#define SELECT_SORTED (1<<20)
-
-#define RAISED (1<<21)
-
-#define SELECT_MODE_SINGLE (1<<0)
-#define SELECT_MODE_MULTIPLE (1<<1)
-
-typedef int (GraphLegendProc)(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-/*
- * Legend --
- *
- * Contains information specific to how the legend will be displayed.
- */
-struct _Legend {
- unsigned int flags;
- ClassId classId; /* Type: Element or Marker. */
-
- int nEntries; /* Number of element entries in
- * table. */
- short int nColumns, nRows; /* Number of columns and rows in
- * legend */
- short int width, height; /* Dimensions of the legend */
- short int entryWidth, entryHeight;
-
- int site;
- short int xReq, yReq; /* User-requested site of legend, not
- * the final actual position. Used in
- * conjunction with the anchor below
- * to determine location of the
- * legend. */
-
- Tk_Anchor anchor; /* Anchor of legend. Used to interpret
- * the positioning point of the legend
- * in the graph*/
-
- int x, y; /* Computed origin of legend. */
-
- Graph *graphPtr;
- Tcl_Command cmdToken; /* Token for graph's widget command. */
- int reqColumns, reqRows;
-
- Blt_Pad ixPad, iyPad; /* # of pixels interior padding around
- * legend entries */
- Blt_Pad xPad, yPad; /* # of pixels padding to exterior of
- * legend */
- Tk_Window tkwin; /* If non-NULL, external window to draw
- * legend. */
- TextStyle style;
-
- int maxSymSize; /* Size of largest symbol to be
- * displayed. Used to calculate size
- * of legend */
- XColor *fgColor;
- Blt_Background activeBg; /* Active legend entry background
- * color. */
- XColor *activeFgColor;
- int activeRelief; /* 3-D effect on active entry. */
- int entryBW; /* Border width around each entry in
- * legend. */
- Blt_Background normalBg; /* 3-D effect of legend. */
- int borderWidth; /* Width of legend 3-D border */
- int relief; /* 3-d effect of border around the
- * legend: TK_RELIEF_RAISED etc. */
-
- Blt_BindTable bindTable;
-
- int selRelief;
- int selBW;
-
- XColor *selInFocusFgColor; /* Text color of a selected entry. */
- XColor *selOutFocusFgColor;
-
- Blt_Background selInFocusBg;
- Blt_Background selOutFocusBg;
-
- XColor *focusColor;
- Blt_Dashes focusDashes; /* Dash on-off value. */
- GC focusGC; /* Graphics context for the active
- * label. */
-
- const char *takeFocus;
- int focus; /* Position of the focus entry. */
-
- int cursorX, cursorY; /* Position of the insertion cursor in
- * the textbox window. */
- short int cursorWidth; /* Size of the insertion cursor
- * symbol. */
- short int cursorHeight;
- Element *focusPtr; /* Element that currently has the
- * focus. If NULL, no legend entry has
- * the focus. */
- Element *selAnchorPtr; /* Fixed end of selection. Used to
- * extend the selection while
- * maintaining the other end of the
- * selection. */
- Element *selMarkPtr;
- Element *selFirstPtr; /* First element selected in current
- * pick. */
- Element *selLastPtr; /* Last element selected in current
- * pick. */
- int exportSelection;
- int active;
- int cursorOn; /* Indicates if the cursor is
- * displayed. */
- int onTime, offTime; /* Time in milliseconds to wait before
- * changing the cursor from off-to-on
- * and on-to-off. Setting offTime to 0
- * makes the * cursor steady. */
- Tcl_TimerToken timerToken; /* Handle for a timer event called
- * periodically to blink the cursor. */
- const char *selectCmd; /* TCL script that's invoked whenever
- * the selection changes. */
- int selectMode; /* Mode of selection: single or
- * multiple. */
- Blt_HashTable selectTable; /* Table of selected elements. Used to
- * quickly determine whether an element
- * is selected. */
- Blt_Chain selected; /* List of selected elements. */
-
- const char *title;
- unsigned int titleWidth, titleHeight;
- TextStyle titleStyle; /* Legend title attributes */
-};
-
-#define padLeft xPad.side1
-#define padRight xPad.side2
-#define padTop yPad.side1
-#define padBottom yPad.side2
-#define PADDING(x) ((x).side1 + (x).side2)
-#define LABEL_PAD 2
-
-#define DEF_LEGEND_ACTIVEBACKGROUND RGB_SKYBLUE4
-#define DEF_LEGEND_ACTIVEBORDERWIDTH "2"
-#define DEF_LEGEND_ACTIVEFOREGROUND RGB_WHITE
-#define DEF_LEGEND_ACTIVERELIEF "flat"
-#define DEF_LEGEND_ANCHOR "n"
-#define DEF_LEGEND_BACKGROUND (char *)NULL
-#define DEF_LEGEND_BORDERWIDTH STD_BORDERWIDTH
-#define DEF_LEGEND_COLUMNS "0"
-#define DEF_LEGEND_EXPORTSELECTION "no"
-#define DEF_LEGEND_FONT "{Sans Serif} 8"
-#define DEF_LEGEND_FOREGROUND STD_NORMAL_FOREGROUND
-#define DEF_LEGEND_HIDE "no"
-#define DEF_LEGEND_IPADX "1"
-#define DEF_LEGEND_IPADY "1"
-#define DEF_LEGEND_PADX "1"
-#define DEF_LEGEND_PADY "1"
-#define DEF_LEGEND_POSITION "rightmargin"
-#define DEF_LEGEND_RAISED "no"
-#define DEF_LEGEND_RELIEF "flat"
-#define DEF_LEGEND_ROWS "0"
-#define DEF_LEGEND_SELECTBACKGROUND RGB_SKYBLUE4
-#define DEF_LEGEND_SELECT_BG_MONO STD_SELECT_BG_MONO
-#define DEF_LEGEND_SELECTBORDERWIDTH "1"
-#define DEF_LEGEND_SELECTMODE "multiple"
-#define DEF_LEGEND_SELECT_FG_MONO STD_SELECT_FG_MONO
-#define DEF_LEGEND_SELECTFOREGROUND RGB_WHITE /*STD_SELECT_FOREGROUND*/
-#define DEF_LEGEND_SELECTRELIEF "flat"
-#define DEF_LEGEND_FOCUSDASHES "dot"
-#define DEF_LEGEND_FOCUSEDIT "no"
-#define DEF_LEGEND_FOCUSFOREGROUND STD_ACTIVE_FOREGROUND
-#define DEF_LEGEND_FOCUS_FG_MONO STD_ACTIVE_FG_MONO
-#define DEF_LEGEND_TAKEFOCUS "1"
-#define DEF_LEGEND_TITLE (char *)NULL
-#define DEF_LEGEND_TITLECOLOR STD_NORMAL_FOREGROUND
-#define DEF_LEGEND_TITLEFONT "{Sans Serif} 8 bold"
-
-static Blt_OptionParseProc ObjToPosition;
-static Blt_OptionPrintProc PositionToObj;
-static Blt_CustomOption legendPositionOption =
-{
- ObjToPosition, PositionToObj, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToSelectmode;
-static Blt_OptionPrintProc SelectmodeToObj;
-static Blt_CustomOption selectmodeOption = {
- ObjToSelectmode, SelectmodeToObj, NULL, NULL,
-};
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_LEGEND_ACTIVEBACKGROUND,
- Blt_Offset(Legend, activeBg), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-activeborderwidth", "activeBorderWidth",
- "BorderWidth", DEF_LEGEND_BORDERWIDTH,
- Blt_Offset(Legend, entryBW), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "ActiveForeground", DEF_LEGEND_ACTIVEFOREGROUND,
- Blt_Offset(Legend, activeFgColor), 0},
- {BLT_CONFIG_RELIEF, "-activerelief", "activeRelief", "Relief",
- DEF_LEGEND_ACTIVERELIEF, Blt_Offset(Legend, activeRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor", DEF_LEGEND_ANCHOR,
- Blt_Offset(Legend, anchor), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_LEGEND_BACKGROUND, Blt_Offset(Legend, normalBg),BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_LEGEND_BORDERWIDTH, Blt_Offset(Legend, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_INT_NNEG, "-columns", "columns", "columns",
- DEF_LEGEND_COLUMNS, Blt_Offset(Legend, reqColumns),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-exportselection", "exportSelection",
- "ExportSelection", DEF_LEGEND_EXPORTSELECTION,
- Blt_Offset(Legend, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)SELECT_EXPORT},
- {BLT_CONFIG_DASHES, "-focusdashes", "focusDashes", "FocusDashes",
- DEF_LEGEND_FOCUSDASHES, Blt_Offset(Legend, focusDashes),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-focusforeground", "focusForeground", "FocusForeground",
- DEF_LEGEND_FOCUSFOREGROUND, Blt_Offset(Legend, focusColor),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-focusforeground", "focusForeground", "FocusForeground",
- DEF_LEGEND_FOCUS_FG_MONO, Blt_Offset(Legend, focusColor),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_LEGEND_FONT,
- Blt_Offset(Legend, style.font), 0},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_LEGEND_FOREGROUND, Blt_Offset(Legend, fgColor), 0},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_LEGEND_HIDE,
- Blt_Offset(Legend, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE},
- {BLT_CONFIG_PAD, "-ipadx", "iPadX", "Pad", DEF_LEGEND_IPADX,
- Blt_Offset(Legend, ixPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-ipady", "iPadY", "Pad", DEF_LEGEND_IPADY,
- Blt_Offset(Legend, iyPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-nofocusselectbackground",
- "noFocusSelectBackground", "NoFocusSelectBackground",
- DEF_LEGEND_SELECTBACKGROUND, Blt_Offset(Legend, selOutFocusBg), 0},
- {BLT_CONFIG_COLOR, "-nofocusselectforeground", "noFocusSelectForeground",
- "NoFocusSelectForeground", DEF_LEGEND_SELECTFOREGROUND,
- Blt_Offset(Legend, selOutFocusFgColor), 0},
- {BLT_CONFIG_PAD, "-padx", "padX", "Pad", DEF_LEGEND_PADX,
- Blt_Offset(Legend, xPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-pady", "padY", "Pad", DEF_LEGEND_PADY,
- Blt_Offset(Legend, yPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-position", "position", "Position",
- DEF_LEGEND_POSITION, 0, BLT_CONFIG_DONT_SET_DEFAULT,
- &legendPositionOption},
- {BLT_CONFIG_BITMASK, "-raised", "raised", "Raised", DEF_LEGEND_RAISED,
- Blt_Offset(Legend, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)RAISED},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_LEGEND_RELIEF,
- Blt_Offset(Legend, relief), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_INT_NNEG, "-rows", "rows", "rows", DEF_LEGEND_ROWS,
- Blt_Offset(Legend, reqRows),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-selectbackground", "selectBackground",
- "Background", DEF_LEGEND_SELECTBACKGROUND,
- Blt_Offset(Legend, selInFocusBg), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-selectborderwidth", "selectBorderWidth",
- "BorderWidth", DEF_LEGEND_SELECTBORDERWIDTH,
- Blt_Offset(Legend, selBW), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-selectcommand", "selectCommand", "SelectCommand",
- (char *)NULL, Blt_Offset(Legend, selectCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground", "Foreground",
- DEF_LEGEND_SELECT_FG_MONO, Blt_Offset(Legend, selInFocusFgColor),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground", "Foreground",
- DEF_LEGEND_SELECTFOREGROUND, Blt_Offset(Legend, selInFocusFgColor),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_CUSTOM, "-selectmode", "selectMode", "SelectMode",
- DEF_LEGEND_SELECTMODE, Blt_Offset(Legend, selectMode),
- BLT_CONFIG_DONT_SET_DEFAULT, &selectmodeOption},
- {BLT_CONFIG_RELIEF, "-selectrelief", "selectRelief", "Relief",
- DEF_LEGEND_SELECTRELIEF, Blt_Offset(Legend, selRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_LEGEND_TAKEFOCUS, Blt_Offset(Legend, takeFocus),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-title", "title", "Title", DEF_LEGEND_TITLE,
- Blt_Offset(Legend, title), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-titlecolor", "titleColor", "Foreground",
- DEF_LEGEND_TITLECOLOR, Blt_Offset(Legend, titleStyle.color), 0},
- {BLT_CONFIG_FONT, "-titlefont", "titleFont", "Font",
- DEF_LEGEND_TITLEFONT, Blt_Offset(Legend, titleStyle.font), 0},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static Tcl_IdleProc DisplayLegend;
-static Blt_BindPickProc PickEntryProc;
-static Tk_EventProc LegendEventProc;
-static Tcl_TimerProc BlinkCursorProc;
-static Tk_LostSelProc LostSelectionProc;
-static Tk_SelectionProc SelectionProc;
-
-BLT_EXTERN Tcl_ObjCmdProc Blt_GraphInstCmdProc;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Legend_EventuallyRedraw --
- *
- * Tells the Tk dispatcher to call the graph display routine at the next
- * idle point. This request is made only if the window is displayed and
- * no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Legend_EventuallyRedraw(Graph *graphPtr)
-{
- Legend *legendPtr = graphPtr->legend;
-
- if ((legendPtr->tkwin != NULL) && !(legendPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayLegend, legendPtr);
- legendPtr->flags |= REDRAW_PENDING;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectCmdProc --
- *
- * Invoked at the next idle point whenever the current selection changes.
- * Executes some application-specific code in the -selectcommand option.
- * This provides a way for applications to handle selection changes.
- *
- * Results:
- * None.
- *
- * Side effects:
- * TCL code gets executed for some application-specific task.
- *
- *---------------------------------------------------------------------------
- */
-static void
-SelectCmdProc(ClientData clientData)
-{
- Legend *legendPtr = clientData;
-
- Tcl_Preserve(legendPtr);
- legendPtr->flags &= ~SELECT_PENDING;
- if (legendPtr->selectCmd != NULL) {
- Tcl_Interp *interp;
-
- interp = legendPtr->graphPtr->interp;
- if (Tcl_GlobalEval(interp, legendPtr->selectCmd) != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
- }
- Tcl_Release(legendPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyInvokeSelectCmd --
- *
- * Queues a request to execute the -selectcommand code associated with
- * the widget at the next idle point. Invoked whenever the selection
- * changes.
- *
- * Results:
- * None.
- *
- * Side effects:
- * TCL code gets executed for some application-specific task.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyInvokeSelectCmd(Legend *legendPtr)
-{
- if ((legendPtr->flags & SELECT_PENDING) == 0) {
- legendPtr->flags |= SELECT_PENDING;
- Tcl_DoWhenIdle(SelectCmdProc, legendPtr);
- }
-}
-
-static void
-ClearSelection(Legend *legendPtr)
-{
- Blt_DeleteHashTable(&legendPtr->selectTable);
- Blt_InitHashTable(&legendPtr->selectTable, BLT_ONE_WORD_KEYS);
- Blt_Chain_Reset(legendPtr->selected);
- Blt_Legend_EventuallyRedraw(legendPtr->graphPtr);
- if (legendPtr->selectCmd != NULL) {
- EventuallyInvokeSelectCmd(legendPtr);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * LostSelectionProc --
- *
- * This procedure is called back by Tk when the selection is grabbed away
- * from a Text widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The existing selection is unhighlighted, and the window is marked as
- * not containing a selection.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LostSelectionProc(ClientData clientData)
-{
- Legend *legendPtr = clientData;
-
- if (legendPtr->flags & SELECT_EXPORT) {
- ClearSelection(legendPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LegendEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * graphs.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, the graph is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LegendEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Graph *graphPtr = clientData;
- Legend *legendPtr;
-
- legendPtr = graphPtr->legend;
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- Blt_Legend_EventuallyRedraw(graphPtr);
- }
- } else if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
- if (eventPtr->xfocus.detail == NotifyInferior) {
- return;
- }
- if (eventPtr->type == FocusIn) {
- legendPtr->flags |= FOCUS;
- } else {
- legendPtr->flags &= ~FOCUS;
- }
- Tcl_DeleteTimerHandler(legendPtr->timerToken);
- if ((legendPtr->active) && (legendPtr->flags & FOCUS)) {
- legendPtr->cursorOn = TRUE;
- if (legendPtr->offTime != 0) {
- legendPtr->timerToken = Tcl_CreateTimerHandler(
- legendPtr->onTime, BlinkCursorProc, graphPtr);
- }
- } else {
- legendPtr->cursorOn = FALSE;
- legendPtr->timerToken = (Tcl_TimerToken)NULL;
- }
- Blt_Legend_EventuallyRedraw(graphPtr);
- } else if (eventPtr->type == DestroyNotify) {
- Graph *graphPtr = legendPtr->graphPtr;
-
- if (legendPtr->site == LEGEND_WINDOW) {
- Blt_DeleteWindowInstanceData(legendPtr->tkwin);
- if (legendPtr->cmdToken != NULL) {
- Tcl_DeleteCommandFromToken(graphPtr->interp,
- legendPtr->cmdToken);
- legendPtr->cmdToken = NULL;
- }
- legendPtr->tkwin = graphPtr->tkwin;
- }
- if (legendPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayLegend, legendPtr);
- legendPtr->flags &= ~REDRAW_PENDING;
- }
- legendPtr->site = LEGEND_RIGHT;
- legendPtr->flags |= HIDE;
- graphPtr->flags |= (MAP_WORLD | REDRAW_WORLD);
- Blt_MoveBindingTable(legendPtr->bindTable, graphPtr->tkwin);
- Blt_EventuallyRedrawGraph(graphPtr);
- } else if (eventPtr->type == ConfigureNotify) {
- Blt_Legend_EventuallyRedraw(graphPtr);
- }
-}
-
-static int
-CreateLegendWindow(Tcl_Interp *interp, Legend *legendPtr, const char *pathName)
-{
- Graph *graphPtr;
- Tk_Window tkwin;
-
- graphPtr = legendPtr->graphPtr;
- tkwin = Tk_CreateWindowFromPath(interp, graphPtr->tkwin, pathName, NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- Blt_SetWindowInstanceData(tkwin, legendPtr);
- Tk_CreateEventHandler(tkwin, ExposureMask | StructureNotifyMask,
- LegendEventProc, graphPtr);
- /* Move the legend's binding table to the new window. */
- Blt_MoveBindingTable(legendPtr->bindTable, tkwin);
- if (legendPtr->tkwin != graphPtr->tkwin) {
- Tk_DestroyWindow(legendPtr->tkwin);
- }
- /* Create a command by the same name as the legend window so that Legend
- * bindings can use %W interchangably. */
- legendPtr->cmdToken = Tcl_CreateObjCommand(interp, pathName,
- Blt_GraphInstCmdProc, graphPtr, NULL);
- legendPtr->tkwin = tkwin;
- legendPtr->site = LEGEND_WINDOW;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToPosition --
- *
- * Convert the string representation of a legend XY position into window
- * coordinates. The form of the string must be "@x,y" or none.
- *
- * Results:
- * The return value is a standard TCL result. The symbol type is written
- * into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToPosition(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* New legend position string */
- char *widgRec, /* Widget record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- Graph *graphPtr;
- Legend *legendPtr = (Legend *)widgRec;
- char c;
- int length;
- const char *string;
-
- graphPtr = legendPtr->graphPtr;
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if (c == '\0') {
- legendPtr->site = LEGEND_RIGHT;
- } else if ((c == 'l') && (strncmp(string, "leftmargin", length) == 0)) {
- legendPtr->site = LEGEND_LEFT;
- } else if ((c == 'r') && (strncmp(string, "rightmargin", length) == 0)) {
- legendPtr->site = LEGEND_RIGHT;
- } else if ((c == 't') && (strncmp(string, "topmargin", length) == 0)) {
- legendPtr->site = LEGEND_TOP;
- } else if ((c == 'b') && (strncmp(string, "bottommargin", length) == 0)) {
- legendPtr->site = LEGEND_BOTTOM;
- } else if ((c == 'p') && (strncmp(string, "plotarea", length) == 0)) {
- legendPtr->site = LEGEND_PLOT;
- } else if (c == '@') {
- char *comma;
- long x, y;
- int result;
-
- comma = strchr(string + 1, ',');
- if (comma == NULL) {
- Tcl_AppendResult(interp, "bad screen position \"", string,
- "\": should be @x,y", (char *)NULL);
- return TCL_ERROR;
- }
- x = y = 0;
- *comma = '\0';
- result = ((Tcl_ExprLong(interp, string + 1, &x) == TCL_OK) &&
- (Tcl_ExprLong(interp, comma + 1, &y) == TCL_OK));
- *comma = ',';
- if (!result) {
- return TCL_ERROR;
- }
- legendPtr->xReq = x;
- legendPtr->yReq = y;
- legendPtr->site = LEGEND_XY;
- } else if (c == '.') {
- if (CreateLegendWindow(interp, legendPtr, string) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_Legend_EventuallyRedraw(graphPtr);
- } else {
- Tcl_AppendResult(interp, "bad position \"", string, "\": should be \
-\"leftmargin\", \"rightmargin\", \"topmargin\", \"bottommargin\", \
-\"plotarea\", windowName or @x,y", (char *)NULL);
- return TCL_ERROR;
- }
- graphPtr->flags |= RESET_WORLD;
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PositionToObj --
- *
- * Convert the window coordinates into a string.
- *
- * Results:
- * The string representing the coordinate position is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-PositionToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- Legend *legendPtr = (Legend *)widgRec;
- Tcl_Obj *objPtr;
-
- switch (legendPtr->site) {
- case LEGEND_LEFT:
- objPtr = Tcl_NewStringObj("leftmargin", -1);
- break;
-
- case LEGEND_RIGHT:
- objPtr = Tcl_NewStringObj("rightmargin", -1);
- break;
-
- case LEGEND_TOP:
- objPtr = Tcl_NewStringObj("topmargin", -1);
- break;
-
- case LEGEND_BOTTOM:
- objPtr = Tcl_NewStringObj("bottommargin", -1);
- break;
-
- case LEGEND_PLOT:
- objPtr = Tcl_NewStringObj("plotarea", -1);
- break;
-
- case LEGEND_WINDOW:
- objPtr = Tcl_NewStringObj(Tk_PathName(legendPtr->tkwin), -1);
- break;
-
- case LEGEND_XY:
- {
- char string[200];
-
- sprintf_s(string, 200, "@%d,%d", legendPtr->xReq, legendPtr->yReq);
- objPtr = Tcl_NewStringObj(string, -1);
- }
- default:
- objPtr = Tcl_NewStringObj("unknown legend position", -1);
- }
- return objPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToSelectmode --
- *
- * Convert the string reprsenting a select mode, to its numeric form.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToSelectmode(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- char *string;
- char c;
- int *modePtr = (int *)(widgRec + offset);
-
- string = Tcl_GetString(objPtr);
- c = string[0];
- if ((c == 's') && (strcmp(string, "single") == 0)) {
- *modePtr = SELECT_MODE_SINGLE;
- } else if ((c == 'm') && (strcmp(string, "multiple") == 0)) {
- *modePtr = SELECT_MODE_MULTIPLE;
- } else if ((c == 'a') && (strcmp(string, "active") == 0)) {
- *modePtr = SELECT_MODE_SINGLE;
- } else {
- Tcl_AppendResult(interp, "bad select mode \"", string,
- "\": should be \"single\" or \"multiple\"", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectmodeToObj --
- *
- * Results:
- * The string representation of the select mode is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-SelectmodeToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- int mode = *(int *)(widgRec + offset);
-
- switch (mode) {
- case SELECT_MODE_SINGLE:
- return Tcl_NewStringObj("single", -1);
- case SELECT_MODE_MULTIPLE:
- return Tcl_NewStringObj("multiple", -1);
- default:
- return Tcl_NewStringObj("unknown scroll mode", -1);
- }
-}
-
-
-static void
-SetLegendOrigin(Legend *legendPtr)
-{
- Graph *graphPtr;
- int x, y, w, h;
-
- graphPtr = legendPtr->graphPtr;
- x = y = w = h = 0; /* Suppress compiler warning. */
- switch (legendPtr->site) {
- case LEGEND_RIGHT:
- w = graphPtr->rightMargin.width - graphPtr->rightMargin.axesOffset;
- h = graphPtr->bottom - graphPtr->top;
- x = graphPtr->right + graphPtr->rightMargin.axesOffset;
- y = graphPtr->top;
- break;
-
- case LEGEND_LEFT:
- w = graphPtr->leftMargin.width - graphPtr->leftMargin.axesOffset;
- h = graphPtr->bottom - graphPtr->top;
- x = graphPtr->inset;
- y = graphPtr->top;
- break;
-
- case LEGEND_TOP:
- w = graphPtr->right - graphPtr->left;
- h = graphPtr->topMargin.height - graphPtr->topMargin.axesOffset;
- if (graphPtr->title != NULL) {
- h -= graphPtr->titleHeight;
- }
- x = graphPtr->left;
- y = graphPtr->inset;
- if (graphPtr->title != NULL) {
- y += graphPtr->titleHeight;
- }
- break;
-
- case LEGEND_BOTTOM:
- w = graphPtr->right - graphPtr->left;
- h = graphPtr->bottomMargin.height - graphPtr->bottomMargin.axesOffset;
- x = graphPtr->left;
- y = graphPtr->bottom + graphPtr->bottomMargin.axesOffset;
- break;
-
- case LEGEND_PLOT:
- w = graphPtr->right - graphPtr->left;
- h = graphPtr->bottom - graphPtr->top;
- x = graphPtr->left;
- y = graphPtr->top;
- break;
-
- case LEGEND_XY:
- w = legendPtr->width;
- h = legendPtr->height;
- x = legendPtr->xReq;
- y = legendPtr->yReq;
- if (x < 0) {
- x += graphPtr->width;
- }
- if (y < 0) {
- y += graphPtr->height;
- }
- break;
-
- case LEGEND_WINDOW:
- legendPtr->anchor = TK_ANCHOR_NW;
- legendPtr->x = legendPtr->y = 0;
- return;
- }
-
- switch (legendPtr->anchor) {
- case TK_ANCHOR_NW: /* Upper left corner */
- break;
- case TK_ANCHOR_W: /* Left center */
- if (h > legendPtr->height) {
- y += (h - legendPtr->height) / 2;
- }
- break;
- case TK_ANCHOR_SW: /* Lower left corner */
- if (h > legendPtr->height) {
- y += (h - legendPtr->height);
- }
- break;
- case TK_ANCHOR_N: /* Top center */
- if (w > legendPtr->width) {
- x += (w - legendPtr->width) / 2;
- }
- break;
- case TK_ANCHOR_CENTER: /* Center */
- if (h > legendPtr->height) {
- y += (h - legendPtr->height) / 2;
- }
- if (w > legendPtr->width) {
- x += (w - legendPtr->width) / 2;
- }
- break;
- case TK_ANCHOR_S: /* Bottom center */
- if (w > legendPtr->width) {
- x += (w - legendPtr->width) / 2;
- }
- if (h > legendPtr->height) {
- y += (h - legendPtr->height);
- }
- break;
- case TK_ANCHOR_NE: /* Upper right corner */
- if (w > legendPtr->width) {
- x += w - legendPtr->width;
- }
- break;
- case TK_ANCHOR_E: /* Right center */
- if (w > legendPtr->width) {
- x += w - legendPtr->width;
- }
- if (h > legendPtr->height) {
- y += (h - legendPtr->height) / 2;
- }
- break;
- case TK_ANCHOR_SE: /* Lower right corner */
- if (w > legendPtr->width) {
- x += w - legendPtr->width;
- }
- if (h > legendPtr->height) {
- y += (h - legendPtr->height);
- }
- break;
- }
- legendPtr->x = x + legendPtr->padLeft;
- legendPtr->y = y + legendPtr->padTop;
-}
-
-static int
-EntryIsSelected(Legend *legendPtr, Element *elemPtr)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&legendPtr->selectTable, (char *)elemPtr);
- return (hPtr != NULL);
-}
-
-static void
-SelectElement(Legend *legendPtr, Element *elemPtr)
-{
- int isNew;
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_CreateHashEntry(&legendPtr->selectTable, (char *)elemPtr,&isNew);
- if (isNew) {
- Blt_ChainLink link;
-
- link = Blt_Chain_Append(legendPtr->selected, elemPtr);
- Blt_SetHashValue(hPtr, link);
- }
-}
-
-static void
-DeselectElement(Legend *legendPtr, Element *elemPtr)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&legendPtr->selectTable, (char *)elemPtr);
- if (hPtr != NULL) {
- Blt_ChainLink link;
-
- link = Blt_GetHashValue(hPtr);
- Blt_Chain_DeleteLink(legendPtr->selected, link);
- Blt_DeleteHashEntry(&legendPtr->selectTable, hPtr);
- }
-}
-
-static void
-SelectEntry(Legend *legendPtr, Element *elemPtr)
-{
- Blt_HashEntry *hPtr;
-
- switch (legendPtr->flags & SELECT_MASK) {
- case SELECT_CLEAR:
- DeselectElement(legendPtr, elemPtr);
- break;
-
- case SELECT_SET:
- SelectElement(legendPtr, elemPtr);
- break;
-
- case SELECT_TOGGLE:
- hPtr = Blt_FindHashEntry(&legendPtr->selectTable, (char *)elemPtr);
- if (hPtr != NULL) {
- DeselectElement(legendPtr, elemPtr);
- } else {
- SelectElement(legendPtr, elemPtr);
- }
- break;
- }
-}
-
-#ifdef notdef
-static Element *
-PointerToElement(Legend *legendPtr, int x, int y)
-{
- Graph *graphPtr = legendPtr->graphPtr;
- int w, h;
- int n;
-
- w = legendPtr->width;
- h = legendPtr->height;
-
- x -= legendPtr->x + legendPtr->borderWidth;
- y -= legendPtr->y + legendPtr->borderWidth;
- w -= 2 * legendPtr->borderWidth + PADDING(legendPtr->xPad);
- h -= 2 * legendPtr->borderWidth + PADDING(legendPtr->yPad);
-
- if ((x < 0) || (x >= w) || (y < 0) || (y >= h)) {
- return NULL;
- }
-
- /* It's in the bounding box, so compute the index. */
- {
- int row, column;
-
- row = y / legendPtr->entryHeight;
- column = x / legendPtr->entryWidth;
- n = (column * legendPtr->nRows) + row;
- }
- if (n < legendPtr->nEntries) {
- Blt_ChainLink link;
- int count;
-
- count = 0;
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->label == NULL) {
- continue;
- }
- if (count > n) {
- return NULL;
- } else if (count == n) {
- return elemPtr;
- }
- count++;
- }
- }
- return NULL;
-}
-#endif
-
-/*ARGSUSED*/
-static ClientData
-PickEntryProc(ClientData clientData, int x, int y, ClientData *contextPtr)
-{
- Graph *graphPtr = clientData;
- Legend *legendPtr;
- int w, h;
-
- legendPtr = graphPtr->legend;
- w = legendPtr->width;
- h = legendPtr->height;
-
- if (legendPtr->titleHeight > 0) {
- y -= legendPtr->titleHeight + legendPtr->yPad.side1;
- }
- x -= legendPtr->x + legendPtr->borderWidth;
- y -= legendPtr->y + legendPtr->borderWidth;
- w -= 2 * legendPtr->borderWidth + PADDING(legendPtr->xPad);
- h -= 2 * legendPtr->borderWidth + PADDING(legendPtr->yPad);
-
- if ((x >= 0) && (x < w) && (y >= 0) && (y < h)) {
- int row, column;
- int n;
-
- /*
- * It's in the bounding box, so compute the index.
- */
- row = y / legendPtr->entryHeight;
- column = x / legendPtr->entryWidth;
- n = (column * legendPtr->nRows) + row;
- if (n < legendPtr->nEntries) {
- Blt_ChainLink link;
- int count;
-
- /* Legend entries are stored in bottom-to-top. */
- count = 0;
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->label != NULL) {
- if (count == n) {
- return elemPtr;
- }
- count++;
- }
- }
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MapLegend --
- *
- * Calculates the dimensions (width and height) needed for the legend.
- * Also determines the number of rows and columns necessary to list all
- * the valid element labels.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The following fields of the legend are calculated and set.
- *
- * nEntries - number of valid labels of elements in the
- * display list.
- * nRows - number of rows of entries
- * nColumns - number of columns of entries
- * entryHeight - height of each entry
- * entryWidth - width of each entry
- * height - width of legend (includes borders and padding)
- * width - height of legend (includes borders and padding)
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MapLegend(
- Graph *graphPtr,
- int plotWidth, /* Maximum width available in window
- * to draw the legend. Will calculate
- * # of columns from this. */
- int plotHeight) /* Maximum height available in window
- * to draw the legend. Will calculate
- * # of rows from this. */
-{
- Legend *legendPtr = graphPtr->legend;
- Blt_ChainLink link;
- int nRows, nColumns, nEntries;
- int lw, lh;
- int maxWidth, maxHeight;
- int symbolWidth;
- Blt_FontMetrics fontMetrics;
-
- /* Initialize legend values to default (no legend displayed) */
- legendPtr->entryWidth = legendPtr->entryHeight = 0;
- legendPtr->nRows = legendPtr->nColumns = legendPtr->nEntries = 0;
- legendPtr->height = legendPtr->width = 0;
-
- if (legendPtr->site == LEGEND_WINDOW) {
- if (Tk_Width(legendPtr->tkwin) > 1) {
- plotWidth = Tk_Width(legendPtr->tkwin);
- }
- if (Tk_Height(legendPtr->tkwin) > 1) {
- plotHeight = Tk_Height(legendPtr->tkwin);
- }
- }
- Blt_Ts_GetExtents(&legendPtr->titleStyle, legendPtr->title,
- &legendPtr->titleWidth, &legendPtr->titleHeight);
- /*
- * Count the number of legend entries and determine the widest and tallest
- * label. The number of entries would normally be the number of elements,
- * but elements can have no legend entry (-label "").
- */
- nEntries = 0;
- maxWidth = maxHeight = 0;
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- unsigned int w, h;
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->label == NULL) {
- continue; /* Element has no legend entry. */
- }
- Blt_Ts_GetExtents(&legendPtr->style, elemPtr->label, &w, &h);
- if (maxWidth < w) {
- maxWidth = w;
- }
- if (maxHeight < h) {
- maxHeight = h;
- }
- nEntries++;
- }
- if (nEntries == 0) {
- return; /* No visible legend entries. */
- }
-
-
- Blt_GetFontMetrics(legendPtr->style.font, &fontMetrics);
- symbolWidth = 2 * fontMetrics.ascent;
-
- maxWidth += 2 * legendPtr->entryBW + PADDING(legendPtr->ixPad) +
- + symbolWidth + 3 * LABEL_PAD;
-
- maxHeight += 2 * legendPtr->entryBW + PADDING(legendPtr->iyPad);
-
- maxWidth |= 0x01;
- maxHeight |= 0x01;
-
- lw = plotWidth - 2 * legendPtr->borderWidth - PADDING(legendPtr->xPad);
- lh = plotHeight - 2 * legendPtr->borderWidth - PADDING(legendPtr->yPad);
-
- /*
- * The number of rows and columns is computed as one of the following:
- *
- * both options set User defined.
- * -rows Compute columns from rows.
- * -columns Compute rows from columns.
- * neither set Compute rows and columns from
- * size of plot.
- */
- if (legendPtr->reqRows > 0) {
- nRows = MIN(legendPtr->reqRows, nEntries);
- if (legendPtr->reqColumns > 0) {
- nColumns = MIN(legendPtr->reqColumns, nEntries);
- } else {
- nColumns = ((nEntries - 1) / nRows) + 1; /* Only -rows. */
- }
- } else if (legendPtr->reqColumns > 0) { /* Only -columns. */
- nColumns = MIN(legendPtr->reqColumns, nEntries);
- nRows = ((nEntries - 1) / nColumns) + 1;
- } else {
- /* Compute # of rows and columns from the legend size. */
- nRows = lh / maxHeight;
- nColumns = lw / maxWidth;
- if (nRows < 1) {
- nRows = nEntries;
- }
- if (nColumns < 1) {
- nColumns = nEntries;
- }
- if (nRows > nEntries) {
- nRows = nEntries;
- }
- switch (legendPtr->site) {
- case LEGEND_TOP:
- case LEGEND_BOTTOM:
- nRows = ((nEntries - 1) / nColumns) + 1;
- break;
- case LEGEND_LEFT:
- case LEGEND_RIGHT:
- default:
- nColumns = ((nEntries - 1) / nRows) + 1;
- break;
- }
- }
- if (nColumns < 1) {
- nColumns = 1;
- }
- if (nRows < 1) {
- nRows = 1;
- }
-
- lh = (nRows * maxHeight);
- if (legendPtr->titleHeight > 0) {
- lh += legendPtr->titleHeight + legendPtr->yPad.side1;
- }
- lw = nColumns * maxWidth;
- if (lw < legendPtr->titleWidth) {
- lw = legendPtr->titleWidth;
- }
- legendPtr->width = lw + 2 * legendPtr->borderWidth +
- PADDING(legendPtr->xPad);
- legendPtr->height = lh + 2 * legendPtr->borderWidth +
- PADDING(legendPtr->yPad);
- legendPtr->nRows = nRows;
- legendPtr->nColumns = nColumns;
- legendPtr->nEntries = nEntries;
- legendPtr->entryHeight = maxHeight;
- legendPtr->entryWidth = maxWidth;
-
- {
- int row, col, count;
-
- row = col = count = 0;
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- count++;
- elemPtr->row = row;
- elemPtr->col = col;
- row++;
- if ((count % nRows) == 0) {
- col++;
- row = 0;
- }
- }
- }
- if ((legendPtr->site == LEGEND_WINDOW) &&
- ((Tk_ReqWidth(legendPtr->tkwin) != legendPtr->width) ||
- (Tk_ReqHeight(legendPtr->tkwin) != legendPtr->height))) {
- Tk_GeometryRequest(legendPtr->tkwin,legendPtr->width,legendPtr->height);
- }
-}
-
-void
-Blt_DrawLegend(Graph *graphPtr, Drawable drawable)
-{
- Blt_Background bg;
- Blt_ChainLink link;
- Blt_FontMetrics fontMetrics;
- Legend *legendPtr = graphPtr->legend;
- Pixmap pixmap;
- Tk_Window tkwin;
- int count;
- int symbolSize, xMid, yMid;
- int x, y, w, h;
- int xLabel, yStart, xSymbol, ySymbol;
-
- if ((legendPtr->flags & HIDE) || (legendPtr->nEntries == 0)) {
- return;
- }
-
- SetLegendOrigin(legendPtr);
- graphPtr = legendPtr->graphPtr;
- tkwin = legendPtr->tkwin;
- if (legendPtr->site == LEGEND_WINDOW) {
- w = Tk_Width(tkwin);
- h = Tk_Height(tkwin);
- } else {
- w = legendPtr->width;
- h = legendPtr->height;
- }
-
- pixmap = Tk_GetPixmap(graphPtr->display, Tk_WindowId(tkwin), w, h,
- Tk_Depth(tkwin));
-
- if (legendPtr->normalBg != NULL) {
- Blt_FillBackgroundRectangle(tkwin, pixmap, legendPtr->normalBg, 0, 0,
- w, h, 0, TK_RELIEF_FLAT);
- } else if (legendPtr->site & LEGEND_PLOTAREA_MASK) {
- /*
- * Legend background is transparent and is positioned over the the
- * plot area. Either copy the part of the background from the backing
- * store pixmap or (if no backing store exists) just fill it with the
- * background color of the plot.
- */
- if (graphPtr->cache != None) {
- XCopyArea(graphPtr->display, graphPtr->cache, pixmap,
- graphPtr->drawGC, legendPtr->x, legendPtr->y, w, h, 0, 0);
- } else {
- Blt_FillBackgroundRectangle(tkwin, pixmap, graphPtr->plotBg, 0, 0,
- w, h, TK_RELIEF_FLAT, 0);
- }
- } else {
- int xOrigin, yOrigin;
- /*
- * The legend is located in one of the margins or the external window.
- */
- Blt_GetBackgroundOrigin(graphPtr->normalBg, &xOrigin, &yOrigin);
- Blt_SetBackgroundOrigin(graphPtr->tkwin, graphPtr->normalBg,
- xOrigin - legendPtr->x,yOrigin - legendPtr->y);
- Blt_FillBackgroundRectangle(tkwin, pixmap, graphPtr->normalBg, 0, 0,
- w, h, 0, TK_RELIEF_FLAT);
- Blt_SetBackgroundOrigin(tkwin, graphPtr->normalBg, xOrigin, yOrigin);
- }
- Blt_GetFontMetrics(legendPtr->style.font, &fontMetrics);
-
- symbolSize = fontMetrics.ascent;
- xMid = symbolSize + 1 + legendPtr->entryBW;
- yMid = (symbolSize / 2) + 1 + legendPtr->entryBW;
- xLabel = 2 * symbolSize + legendPtr->entryBW +
- legendPtr->ixPad.side1 + 2 * LABEL_PAD;
- ySymbol = yMid + legendPtr->iyPad.side1;
- xSymbol = xMid + LABEL_PAD;
-
- x = legendPtr->padLeft + legendPtr->borderWidth;
- y = legendPtr->padTop + legendPtr->borderWidth;
- Blt_DrawText(tkwin, pixmap, legendPtr->title, &legendPtr->titleStyle, x, y);
- if (legendPtr->titleHeight > 0) {
- y += legendPtr->titleHeight + legendPtr->yPad.side1;
- }
- count = 0;
- yStart = y;
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
- int isSelected;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->label == NULL) {
- continue; /* Skip this entry */
- }
- isSelected = EntryIsSelected(legendPtr, elemPtr);
- if (elemPtr->flags & LABEL_ACTIVE) {
- int xOrigin, yOrigin;
-
- Blt_GetBackgroundOrigin(legendPtr->activeBg, &xOrigin, &yOrigin);
- Blt_SetBackgroundOrigin(tkwin, legendPtr->activeBg,
- xOrigin - legendPtr->x, yOrigin - legendPtr->y);
- Blt_Ts_SetForeground(legendPtr->style, legendPtr->activeFgColor);
- Blt_FillBackgroundRectangle(tkwin, pixmap, legendPtr->activeBg,
- x, y, legendPtr->entryWidth, legendPtr->entryHeight,
- legendPtr->entryBW, legendPtr->activeRelief);
- Blt_SetBackgroundOrigin(tkwin, legendPtr->activeBg,
- xOrigin, yOrigin);
- } else if (isSelected) {
- int xOrigin, yOrigin;
- Blt_Background bg;
- XColor *fg;
-
- fg = (legendPtr->flags & FOCUS) ?
- legendPtr->selInFocusFgColor : legendPtr->selOutFocusFgColor;
- bg = (legendPtr->flags & FOCUS) ?
- legendPtr->selInFocusBg : legendPtr->selOutFocusBg;
- Blt_GetBackgroundOrigin(bg, &xOrigin, &yOrigin);
- Blt_SetBackgroundOrigin(tkwin, bg, xOrigin - legendPtr->x,
- yOrigin - legendPtr->y);
- Blt_Ts_SetForeground(legendPtr->style, fg);
- Blt_FillBackgroundRectangle(tkwin, pixmap, bg, x, y,
- legendPtr->entryWidth, legendPtr->entryHeight,
- legendPtr->selBW, legendPtr->selRelief);
- Blt_SetBackgroundOrigin(tkwin, bg, xOrigin, yOrigin);
- } else {
- Blt_Ts_SetForeground(legendPtr->style, legendPtr->fgColor);
- if (elemPtr->legendRelief != TK_RELIEF_FLAT) {
- Blt_FillBackgroundRectangle(tkwin, pixmap, graphPtr->normalBg,
- x, y, legendPtr->entryWidth,
- legendPtr->entryHeight, legendPtr->entryBW,
- elemPtr->legendRelief);
- }
- }
- (*elemPtr->procsPtr->drawSymbolProc) (graphPtr, pixmap, elemPtr,
- x + xSymbol, y + ySymbol, symbolSize);
- Blt_DrawText(tkwin, pixmap, elemPtr->label, &legendPtr->style,
- x + xLabel,
- y + legendPtr->entryBW + legendPtr->iyPad.side1);
- count++;
- if (legendPtr->focusPtr == elemPtr) { /* Focus outline */
- if (isSelected) {
- XColor *color;
-
- color = (legendPtr->flags & FOCUS) ?
- legendPtr->selInFocusFgColor :
- legendPtr->selOutFocusFgColor;
- XSetForeground(graphPtr->display, legendPtr->focusGC,
- color->pixel);
- }
- XDrawRectangle(graphPtr->display, pixmap, legendPtr->focusGC,
- x + 1, y + 1, legendPtr->entryWidth - 3,
- legendPtr->entryHeight - 3);
- if (isSelected) {
- XSetForeground(graphPtr->display, legendPtr->focusGC,
- legendPtr->focusColor->pixel);
- }
- }
- /* Check when to move to the next column */
- if ((count % legendPtr->nRows) > 0) {
- y += legendPtr->entryHeight;
- } else {
- x += legendPtr->entryWidth;
- y = yStart;
- }
- }
- /*
- * Draw the border and/or background of the legend.
- */
- bg = legendPtr->normalBg;
- if (bg == NULL) {
- bg = graphPtr->normalBg;
- }
- /* Disable crosshairs before redisplaying to the screen */
- if (legendPtr->site & LEGEND_PLOTAREA_MASK) {
- Blt_DisableCrosshairs(graphPtr);
- }
- Blt_DrawBackgroundRectangle(tkwin, pixmap, bg, 0, 0, w, h,
- legendPtr->borderWidth, legendPtr->relief);
- XCopyArea(graphPtr->display, pixmap, drawable, graphPtr->drawGC, 0, 0, w, h,
- legendPtr->x, legendPtr->y);
- if (legendPtr->site & LEGEND_PLOTAREA_MASK) {
- Blt_EnableCrosshairs(graphPtr);
- }
- Tk_FreePixmap(graphPtr->display, pixmap);
- graphPtr->flags &= ~DRAW_LEGEND;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_LegendToPostScript --
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_LegendToPostScript(Graph *graphPtr, Blt_Ps ps)
-{
- Legend *legendPtr = graphPtr->legend;
- double x, y, yStart;
- int xLabel, xSymbol, ySymbol;
- int count;
- Blt_ChainLink link;
- int symbolSize, xMid, yMid;
- int width, height;
- Blt_FontMetrics fontMetrics;
-
- if ((legendPtr->flags & HIDE) || (legendPtr->nEntries == 0)) {
- return;
- }
- SetLegendOrigin(legendPtr);
-
- x = legendPtr->x, y = legendPtr->y;
- width = legendPtr->width - PADDING(legendPtr->xPad);
- height = legendPtr->height - PADDING(legendPtr->yPad);
-
- Blt_Ps_Append(ps, "% Legend\n");
- graphPtr = legendPtr->graphPtr;
- if (graphPtr->pageSetup->flags & PS_DECORATIONS) {
- if (legendPtr->normalBg != NULL) {
- Tk_3DBorder border;
-
- border = Blt_BackgroundBorder(legendPtr->normalBg);
- Blt_Ps_Fill3DRectangle(ps, border, x, y, width, height,
- legendPtr->borderWidth, legendPtr->relief);
- } else {
- Tk_3DBorder border;
-
- border = Blt_BackgroundBorder(graphPtr->normalBg);
- Blt_Ps_Draw3DRectangle(ps, border, x, y, width, height,
- legendPtr->borderWidth, legendPtr->relief);
- }
- } else {
- Blt_Ps_SetClearBackground(ps);
- Blt_Ps_XFillRectangle(ps, x, y, width, height);
- }
- Blt_GetFontMetrics(legendPtr->style.font, &fontMetrics);
- symbolSize = fontMetrics.ascent;
- xMid = symbolSize + 1 + legendPtr->entryBW;
- yMid = (symbolSize / 2) + 1 + legendPtr->entryBW;
- xLabel = 2 * symbolSize + legendPtr->entryBW + legendPtr->ixPad.side1 + 5;
- xSymbol = xMid + legendPtr->ixPad.side1;
- ySymbol = yMid + legendPtr->iyPad.side1;
-
- x += legendPtr->borderWidth;
- y += legendPtr->borderWidth;
- Blt_Ps_DrawText(ps, legendPtr->title, &legendPtr->titleStyle, x, y);
- if (legendPtr->titleHeight > 0) {
- y += legendPtr->titleHeight + legendPtr->yPad.side1;
- }
-
- count = 0;
- yStart = y;
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->label == NULL) {
- continue; /* Skip this label */
- }
- if (elemPtr->flags & LABEL_ACTIVE) {
- Tk_3DBorder border;
-
- border = Blt_BackgroundBorder(legendPtr->activeBg);
- Blt_Ts_SetForeground(legendPtr->style, legendPtr->activeFgColor);
- Blt_Ps_Fill3DRectangle(ps, border, x, y, legendPtr->entryWidth,
- legendPtr->entryHeight, legendPtr->entryBW,
- legendPtr->activeRelief);
- } else {
- Blt_Ts_SetForeground(legendPtr->style, legendPtr->fgColor);
- if (elemPtr->legendRelief != TK_RELIEF_FLAT) {
- Tk_3DBorder border;
-
- border = Blt_BackgroundBorder(graphPtr->normalBg);
- Blt_Ps_Draw3DRectangle(ps, border, x, y, legendPtr->entryWidth,
- legendPtr->entryHeight, legendPtr->entryBW,
- elemPtr->legendRelief);
- }
- }
- (*elemPtr->procsPtr->printSymbolProc) (graphPtr, ps, elemPtr,
- x + xSymbol, y + ySymbol, symbolSize);
- Blt_Ps_DrawText(ps, elemPtr->label, &legendPtr->style,
- x + xLabel, y + legendPtr->entryBW + legendPtr->iyPad.side1);
- count++;
- if ((count % legendPtr->nRows) > 0) {
- y += legendPtr->entryHeight;
- } else {
- x += legendPtr->entryWidth;
- y = yStart;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayLegend --
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayLegend(ClientData clientData)
-{
- Legend *legendPtr = clientData;
- Graph *graphPtr;
-
- legendPtr->flags &= ~REDRAW_PENDING;
- if (legendPtr->tkwin == NULL) {
- return; /* Window has been destroyed. */
- }
- graphPtr = legendPtr->graphPtr;
- if (legendPtr->site == LEGEND_WINDOW) {
- int w, h;
-
- w = Tk_Width(legendPtr->tkwin);
- h = Tk_Height(legendPtr->tkwin);
- if ((w != legendPtr->width) || (h != legendPtr->height)) {
- Blt_MapLegend(graphPtr, w, h);
- }
- }
- if (Tk_IsMapped(legendPtr->tkwin)) {
- Blt_DrawLegend(graphPtr, Tk_WindowId(legendPtr->tkwin));
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ConfigureLegend --
- *
- * Routine to configure the legend.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new legend attributes.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ConfigureLegend(Graph *graphPtr)
-{
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
- Legend *legendPtr;
-
- legendPtr = graphPtr->legend;
- /* GC for active label. Dashed outline. */
- gcMask = GCForeground | GCLineStyle;
- gcValues.foreground = legendPtr->focusColor->pixel;
- gcValues.line_style = (LineIsDashed(legendPtr->focusDashes))
- ? LineOnOffDash : LineSolid;
- newGC = Blt_GetPrivateGC(legendPtr->tkwin, gcMask, &gcValues);
- if (LineIsDashed(legendPtr->focusDashes)) {
- legendPtr->focusDashes.offset = 2;
- Blt_SetDashes(graphPtr->display, newGC, &legendPtr->focusDashes);
- }
- if (legendPtr->focusGC != NULL) {
- Blt_FreePrivateGC(graphPtr->display, legendPtr->focusGC);
- }
- legendPtr->focusGC = newGC;
-
- /*
- * Update the layout of the graph (and redraw the elements) if any of
- * the following legend options (all of which affect the size of the
- * legend) have changed.
- *
- * -activeborderwidth, -borderwidth
- * -border
- * -font
- * -hide
- * -ipadx, -ipady, -padx, -pady
- * -rows
- *
- * If the position of the legend changed to/from the default
- * position, also indicate that a new layout is needed.
- *
- */
- if (legendPtr->site == LEGEND_WINDOW) {
- Blt_Legend_EventuallyRedraw(graphPtr);
- } else if (Blt_ConfigModified(configSpecs, "-*border*", "-*pad?",
- "-hide", "-font", "-rows", (char *)NULL)) {
- graphPtr->flags |= RESET_WORLD;
- graphPtr->flags |= (REDRAW_WORLD | CACHE_DIRTY);
- Blt_EventuallyRedrawGraph(graphPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DestroyLegend --
- *
- * Results:
- * None.
- *
- * Side effects:
- * Resources associated with the legend are freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DestroyLegend(Graph *graphPtr)
-{
- Legend *legendPtr = graphPtr->legend;
-
- if (graphPtr->legend == NULL) {
- return;
- }
-
- Blt_FreeOptions(configSpecs, (char *)legendPtr, graphPtr->display, 0);
- Blt_Ts_FreeStyle(graphPtr->display, &legendPtr->style);
- Blt_Ts_FreeStyle(graphPtr->display, &legendPtr->titleStyle);
- Blt_DestroyBindingTable(legendPtr->bindTable);
-
- if (legendPtr->focusGC != NULL) {
- Blt_FreePrivateGC(graphPtr->display, legendPtr->focusGC);
- }
- if (legendPtr->timerToken != NULL) {
- Tcl_DeleteTimerHandler(legendPtr->timerToken);
- }
- if (legendPtr->tkwin != NULL) {
- Tk_DeleteSelHandler(legendPtr->tkwin, XA_PRIMARY, XA_STRING);
- }
- if (legendPtr->site == LEGEND_WINDOW) {
- Tk_Window tkwin;
-
- /* The graph may be in the process of being torn down */
- if (legendPtr->cmdToken != NULL) {
- Tcl_DeleteCommandFromToken(graphPtr->interp, legendPtr->cmdToken);
- }
- if (legendPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayLegend, legendPtr);
- legendPtr->flags &= ~REDRAW_PENDING;
- }
- tkwin = legendPtr->tkwin;
- legendPtr->tkwin = NULL;
- if (tkwin != NULL) {
- Tk_DeleteEventHandler(tkwin, ExposureMask | StructureNotifyMask,
- LegendEventProc, graphPtr);
- Blt_DeleteWindowInstanceData(tkwin);
- Tk_DestroyWindow(tkwin);
- }
- }
- Blt_Free(legendPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_CreateLegend --
- *
- * Creates and initializes a legend structure with default settings
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-Blt_CreateLegend(Graph *graphPtr)
-{
- Legend *legendPtr;
-
- legendPtr = Blt_AssertCalloc(1, sizeof(Legend));
- graphPtr->legend = legendPtr;
- legendPtr->graphPtr = graphPtr;
- legendPtr->tkwin = graphPtr->tkwin;
- legendPtr->xReq = legendPtr->yReq = -SHRT_MAX;
- legendPtr->relief = TK_RELIEF_SUNKEN;
- legendPtr->activeRelief = TK_RELIEF_FLAT;
- legendPtr->entryBW = 2;
- legendPtr->borderWidth = 2;
- legendPtr->ixPad.side1 = legendPtr->ixPad.side2 = 1;
- legendPtr->iyPad.side1 = legendPtr->iyPad.side2 = 1;
- legendPtr->xPad.side1 = legendPtr->xPad.side2 = 1;
- legendPtr->yPad.side1 = legendPtr->yPad.side2 = 1;
- legendPtr->anchor = TK_ANCHOR_N;
- legendPtr->site = LEGEND_RIGHT;
- legendPtr->selectMode = SELECT_MODE_MULTIPLE;
- Blt_Ts_InitStyle(legendPtr->style);
- Blt_Ts_InitStyle(legendPtr->titleStyle);
- legendPtr->style.justify = TK_JUSTIFY_LEFT;
- legendPtr->style.anchor = TK_ANCHOR_NW;
- legendPtr->titleStyle.justify = TK_JUSTIFY_LEFT;
- legendPtr->titleStyle.anchor = TK_ANCHOR_NW;
- legendPtr->bindTable = Blt_CreateBindingTable(graphPtr->interp,
- graphPtr->tkwin, graphPtr, PickEntryProc, Blt_GraphTags);
-
- Blt_InitHashTable(&legendPtr->selectTable, BLT_ONE_WORD_KEYS);
- legendPtr->selected = Blt_Chain_Create();
- Tk_CreateSelHandler(legendPtr->tkwin, XA_PRIMARY, XA_STRING,
- SelectionProc, legendPtr, XA_STRING);
- legendPtr->selRelief = TK_RELIEF_FLAT;
- legendPtr->selBW = 1;
- legendPtr->onTime = 600;
- legendPtr->offTime = 300;
- if (Blt_ConfigureComponentFromObj(graphPtr->interp, graphPtr->tkwin,
- "legend", "Legend", configSpecs, 0, (Tcl_Obj **)NULL,
- (char *)legendPtr, 0) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_ConfigureLegend(graphPtr);
- return TCL_OK;
-}
-
-static Element *
-GetNextRow(Graph *graphPtr, Element *focusPtr)
-{
- Blt_ChainLink link;
- int row, col;
-
- col = focusPtr->col;
- row = focusPtr->row + 1;
- for (link = focusPtr->link; link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->label == NULL) {
- continue;
- }
- if ((elemPtr->col == col) && (elemPtr->row == row)) {
- return elemPtr;
- }
- }
- return NULL;
-}
-
-static Element *
-GetNextColumn(Graph *graphPtr, Element *focusPtr)
-{
- Blt_ChainLink link;
- int row, col;
-
- col = focusPtr->col + 1;
- row = focusPtr->row;
- for (link = focusPtr->link; link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->label == NULL) {
- continue;
- }
- if ((elemPtr->col == col) && (elemPtr->row == row)) {
- return elemPtr; /* Don't go beyond legend boundaries. */
- }
- }
- return NULL;
-}
-
-static Element *
-GetPreviousRow(Graph *graphPtr, Element *focusPtr)
-{
- Blt_ChainLink link;
- int row, col;
-
- col = focusPtr->col;
- row = focusPtr->row - 1;
- for (link = focusPtr->link; link != NULL; link = Blt_Chain_PrevLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->label == NULL) {
- continue;
- }
- if ((elemPtr->col == col) && (elemPtr->row == row)) {
- return elemPtr;
- }
- }
- return NULL;
-}
-
-static Element *
-GetPreviousColumn(Graph *graphPtr, Element *focusPtr)
-{
- Blt_ChainLink link;
- int row, col;
-
- col = focusPtr->col - 1;
- row = focusPtr->row;
- for (link = focusPtr->link; link != NULL; link = Blt_Chain_PrevLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->label == NULL) {
- continue;
- }
- if ((elemPtr->col == col) && (elemPtr->row == row)) {
- return elemPtr;
- }
- }
- return NULL;
-}
-
-static Element *
-GetFirstElement(Graph *graphPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->label != NULL) {
- return elemPtr;
- }
- }
- return NULL;
-}
-
-static Element *
-GetLastElement(Graph *graphPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_LastLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_PrevLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->label != NULL) {
- return elemPtr;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetElementFromObj --
- *
- * Parse an index into an entry and return either its value or an error.
- *
- * Results:
- * A standard TCL result. If all went well, then *indexPtr is filled in
- * with the character index (into entryPtr) corresponding to string. The
- * index value is guaranteed to lie between 0 and the number of characters
- * in the string, inclusive. If an error occurs then an error message is
- * left in the interp's result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetElementFromObj(Graph *graphPtr, Tcl_Obj *objPtr, Element **elemPtrPtr)
-{
- Element *elemPtr;
- Legend *legendPtr;
- Tcl_Interp *interp;
- char c;
- const char *string;
- int last;
- int index;
-
- legendPtr = graphPtr->legend;
- interp = graphPtr->interp;
- string = Tcl_GetString(objPtr);
- c = string[0];
- elemPtr = NULL;
-
- last = Blt_Chain_GetLength(graphPtr->elements.displayList) - 1;
- if ((c == 'a') && (strcmp(string, "anchor") == 0)) {
- elemPtr = legendPtr->selAnchorPtr;
- } else if ((c == 'c') && (strcmp(string, "current") == 0)) {
- elemPtr = (Element *)Blt_GetCurrentItem(legendPtr->bindTable);
- } else if ((c == 'f') && (strcmp(string, "first") == 0)) {
- elemPtr = GetFirstElement(graphPtr);
- } else if ((c == 'f') && (strcmp(string, "focus") == 0)) {
- elemPtr = legendPtr->focusPtr;
- } else if ((c == 'l') && (strcmp(string, "last") == 0)) {
- elemPtr = GetLastElement(graphPtr);
- } else if ((c == 'e') && (strcmp(string, "end") == 0)) {
- elemPtr = GetLastElement(graphPtr);
- } else if ((c == 'n') && (strcmp(string, "next.row") == 0)) {
- elemPtr = GetNextRow(graphPtr, legendPtr->focusPtr);
- } else if ((c == 'n') && (strcmp(string, "next.column") == 0)) {
- elemPtr = GetNextColumn(graphPtr, legendPtr->focusPtr);
- } else if ((c == 'p') && (strcmp(string, "previous.row") == 0)) {
- elemPtr = GetPreviousRow(graphPtr, legendPtr->focusPtr);
- } else if ((c == 'p') && (strcmp(string, "previous.column") == 0)) {
- elemPtr = GetPreviousColumn(graphPtr, legendPtr->focusPtr);
- } else if ((c == 's') && (strcmp(string, "sel.first") == 0)) {
- elemPtr = legendPtr->selFirstPtr;
- } else if ((c == 's') && (strcmp(string, "sel.last") == 0)) {
- elemPtr = legendPtr->selLastPtr;
- } else if (c == '@') {
- int x, y;
-
- if (Blt_GetXY(interp, legendPtr->tkwin, string, &x, &y) != TCL_OK) {
- return TCL_ERROR;
- }
- elemPtr = (Element *)PickEntryProc(graphPtr, x, y, NULL);
- } else {
- if (Blt_GetElement(interp, graphPtr, objPtr, &elemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (elemPtr->link == NULL) {
- Tcl_AppendResult(interp, "bad legend index \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (elemPtr->label == NULL) {
- elemPtr = NULL;
- }
- }
- *elemPtrPtr = elemPtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectRange --
- *
- * Sets the selection flag for a range of nodes. The range is determined
- * by two pointers which designate the first/last nodes of the range.
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectRange(Legend *legendPtr, Element *fromPtr, Element *toPtr)
-{
-
- if (Blt_Chain_IsBefore(fromPtr->link, toPtr->link)) {
- Blt_ChainLink link;
-
- for (link = fromPtr->link; link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- SelectEntry(legendPtr, elemPtr);
- if (link == toPtr->link) {
- break;
- }
- }
- } else {
- Blt_ChainLink link;
-
- for (link = fromPtr->link; link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- SelectEntry(legendPtr, elemPtr);
- if (link == toPtr->link) {
- break;
- }
- }
- }
- return TCL_OK;
-}
-
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * SelectText --
- *
- * Modify the selection by moving its un-anchored end. This could make
- * the selection either larger or smaller.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectText(Legend *legendPtr, Element *elemPtr)
-{
- Element *firstPtr, *lastPtr;
- Graph *graphPtr = legendPtr->graphPtr;
-
- /* Grab the selection if we don't own it already. */
- if ((legendPtr->flags&SELECT_EXPORT) && (legendPtr->selFirstPtr == NULL)) {
- Tk_OwnSelection(legendPtr->tkwin, XA_PRIMARY, LostSelectionProc,
- legendPtr);
- }
- /* If the anchor hasn't been set, assume the beginning of the legend. */
- if (legendPtr->selAnchorPtr == NULL) {
- legendPtr->selAnchorPtr = GetFirstElement(graphPtr);
- }
- if (legendPtr->selAnchorPtr != elemPtr) {
- firstPtr = legendPtr->selAnchorPtr;
- lastPtr = elemPtr;
- } else {
- firstPtr = elemPtr;
- lastPtr = legendPtr->selAnchorPtr;
- }
- if ((legendPtr->selFirstPtr != firstPtr) ||
- (legendPtr->selLastPtr != lastPtr)) {
- legendPtr->selFirstPtr = firstPtr;
- legendPtr->selLastPtr = lastPtr;
- SelectRange(legendPtr, firstPtr, lastPtr);
- Blt_Legend_EventuallyRedraw(graphPtr);
- }
- return TCL_OK;
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateOp --
- *
- * Activates a particular label in the legend.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new legend attributes.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ActivateOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Legend *legendPtr = graphPtr->legend;
- unsigned int active, redraw;
- const char *string;
- int i;
-
- string = Tcl_GetString(objv[2]);
- active = (string[0] == 'a') ? LABEL_ACTIVE : 0;
- redraw = FALSE;
- for (i = 3; i < objc; i++) {
- Blt_ChainLink link;
- const char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (Tcl_StringMatch(elemPtr->obj.name, pattern)) {
- fprintf(stderr, "legend %s(%s) %s is currently %d\n",
- string, pattern, elemPtr->obj.name,
- (elemPtr->flags & LABEL_ACTIVE));
- if (active) {
- if ((elemPtr->flags & LABEL_ACTIVE) == 0) {
- elemPtr->flags |= LABEL_ACTIVE;
- redraw = TRUE;
- }
- } else {
- if (elemPtr->flags & LABEL_ACTIVE) {
- elemPtr->flags &= ~LABEL_ACTIVE;
- redraw = TRUE;
- }
- }
- fprintf(stderr, "legend %s(%s) %s is now %d\n",
- string, pattern, elemPtr->obj.name,
- (elemPtr->flags & LABEL_ACTIVE));
- }
- }
- }
- if ((redraw) && ((legendPtr->flags & HIDE) == 0)) {
- /*
- * See if how much we need to draw. If the graph is already scheduled
- * for a redraw, just make sure the right flags are set. Otherwise
- * redraw only the legend: it's either in an external window or it's
- * the only thing that need updating.
- */
- if ((legendPtr->site != LEGEND_WINDOW) &&
- (graphPtr->flags & REDRAW_PENDING)) {
- graphPtr->flags |= CACHE_DIRTY;
- graphPtr->flags |= REDRAW_WORLD; /* Redraw entire graph. */
- } else {
- Blt_Legend_EventuallyRedraw(graphPtr);
- }
- }
- {
- Blt_ChainLink link;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- /* List active elements in stacking order. */
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->flags & LABEL_ACTIVE) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(elemPtr->obj.name, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BindOp --
- *
- * .t bind index sequence command
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BindOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&graphPtr->elements.tagTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- const char *tagName;
- Tcl_Obj *objPtr;
-
- tagName = Blt_GetHashKey(&graphPtr->elements.tagTable, hPtr);
- objPtr = Tcl_NewStringObj(tagName, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- return Blt_ConfigureBindingsFromObj(interp, graphPtr->legend->bindTable,
- Blt_MakeElementTag(graphPtr, Tcl_GetString(objv[3])), objc - 4,
- objv + 4);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Queries or resets options for the legend.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new legend attributes.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-CgetOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- return Blt_ConfigureValueFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)graphPtr->legend, objv[3], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Queries or resets options for the legend.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new legend attributes.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int flags = BLT_CONFIG_OBJV_ONLY;
- Legend *legendPtr;
-
- legendPtr = graphPtr->legend;
- if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)legendPtr, (Tcl_Obj *)NULL, flags);
- } else if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)legendPtr, objv[3], flags);
- }
- if (Blt_ConfigureWidgetFromObj(interp, graphPtr->tkwin, configSpecs,
- objc - 3, objv + 3, (char *)legendPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_ConfigureLegend(graphPtr);
- return TCL_OK;
-}
-
-
-/*ARGSUSED*/
-static int
-CurselectionOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Legend *legendPtr = graphPtr->legend;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (legendPtr->flags & SELECT_SORTED) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(legendPtr->selected); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
- Tcl_Obj *objPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- objPtr = Tcl_NewStringObj(elemPtr->obj.name, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- } else {
- Blt_ChainLink link;
-
- /* List of selected entries is in stacking order. */
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
-
- if (EntryIsSelected(legendPtr, elemPtr)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(elemPtr->obj.name, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-FocusOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Legend *legendPtr = graphPtr->legend;
-
- if (objc == 4) {
- Element *elemPtr;
-
- if (GetElementFromObj(graphPtr, objv[3], &elemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((elemPtr != NULL) && (elemPtr != legendPtr->focusPtr)) {
- /* Changing focus can only affect the visible entries. The entry
- * layout stays the same. */
- legendPtr->focusPtr = elemPtr;
- }
- Blt_SetFocusItem(legendPtr->bindTable, legendPtr->focusPtr,
- CID_LEGEND_ENTRY);
- Blt_Legend_EventuallyRedraw(graphPtr);
- }
- if (legendPtr->focusPtr != NULL) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- legendPtr->focusPtr->obj.name, -1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetOp --
- *
- * Find the legend entry from the given argument. The argument can be
- * either a screen position "@x,y" or the name of an element.
- *
- * I don't know how useful it is to test with the name of an element.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new legend attributes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-GetOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Legend *legendPtr = graphPtr->legend;
-
- if (((legendPtr->flags & HIDE) == 0) && (legendPtr->nEntries > 0)) {
- Element *elemPtr;
-
- if (GetElementFromObj(graphPtr, objv[3], &elemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (elemPtr != NULL) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), elemPtr->obj.name,-1);
- }
- }
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * IconOp --
- *
- * Find the legend entry from the given argument. The argument
- * can be either a screen position "@x,y" or the name of an
- * element.
- *
- * I don't know how useful it is to test with the name of an
- * element.
- *
- * Results:
- * A standard Tcl result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new legend attributes.
- *
- * .g legend icon elemName image
- *
- *----------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IconOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Picture picture;
- Element *elemPtr;
- Legend *legendPtr = graphPtr->legend;
- Pixmap pixmap;
- Blt_FontMetrics fontMetrics;
- Tk_PhotoHandle photo;
- const char *imageName;
- int isPicture;
- int w, h, x, y, s;
-
- if (GetElementFromObj(graphPtr, objv[3], &elemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (elemPtr == NULL) {
- return TCL_OK; /* Unknown index. */
- }
- imageName = Tcl_GetString(objv[4]);
- photo = Tk_FindPhoto(interp, imageName);
- if (photo != NULL) {
- isPicture = FALSE;
- } else if (Blt_GetPicture(interp, imageName, &picture) == TCL_OK) {
- isPicture = TRUE;
- } else {
- return TCL_ERROR;
- }
- Blt_GetFontMetrics(legendPtr->style.font, &fontMetrics);
- s = fontMetrics.ascent;
- h = s + PADDING(legendPtr->iyPad) + 1;
- w = s + s + 1 + PADDING(legendPtr->ixPad);
- x = (w / 2);
- y = (h / 2);
-
- pixmap = Tk_GetPixmap(graphPtr->display, Tk_RootWindow(graphPtr->tkwin),
- w, h, Tk_Depth(graphPtr->tkwin));
- Blt_FillBackgroundRectangle(graphPtr->tkwin, pixmap, graphPtr->plotBg,
- 0, 0, w, h, TK_RELIEF_FLAT, 0);
- (*elemPtr->procsPtr->drawSymbolProc) (graphPtr, pixmap, elemPtr, x, y, s);
- picture = Blt_DrawableToPicture(graphPtr->tkwin, pixmap, 0, 0, w, h, 1.0);
- Tk_FreePixmap(graphPtr->display, pixmap);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "can't get picture of symbol.", (char *)NULL);
- return TCL_ERROR;
- }
- /* Make the background transparent. */
- {
- int y;
- Blt_Pixel bg;
- Blt_Pixel *destRowPtr;
- XColor *colorPtr;
-
- colorPtr = Blt_BackgroundBorderColor(graphPtr->plotBg);
- bg.Red = colorPtr->red >> 8;
- bg.Green = colorPtr->green >> 8;
- bg.Blue = colorPtr->blue >> 8;
- bg.Alpha = 0xFF;
-
- destRowPtr = Blt_PictureBits(picture);
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp, *dend;
-
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- if (dp->u32 == bg.u32) {
- dp->Alpha = 0x0;
- }
- }
- destRowPtr += Blt_PictureStride(picture);
- }
- }
- Blt_ClassifyPicture(picture);
- if (isPicture) {
- Blt_ResetPicture(interp, imageName, picture);
- } else {
- Blt_PictureToPhoto(picture, photo);
- Blt_FreePicture(picture);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionAnchorOp --
- *
- * Sets the selection anchor to the element given by a index. The
- * selection anchor is the end of the selection that is fixed while
- * dragging out a selection with the mouse. The index "anchor" may be
- * used to refer to the anchor element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionAnchorOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Legend *legendPtr = graphPtr->legend;
- Element *elemPtr;
-
- if (GetElementFromObj(graphPtr, objv[4], &elemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Set both the anchor and the mark. Indicates that a single entry
- * is selected. */
- legendPtr->selAnchorPtr = elemPtr;
- legendPtr->selMarkPtr = NULL;
- if (elemPtr != NULL) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), elemPtr->obj.name, -1);
- }
- Blt_Legend_EventuallyRedraw(graphPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionClearallOp
- *
- * Clears the entire selection.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionClearallOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Legend *legendPtr = graphPtr->legend;
-
- ClearSelection(legendPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionIncludesOp
- *
- * Returns 1 if the element indicated by index is currently
- * selected, 0 if it isn't.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionIncludesOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Legend *legendPtr = graphPtr->legend;
- Element *elemPtr;
- int bool;
-
- if (GetElementFromObj(graphPtr, objv[4], &elemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- bool = EntryIsSelected(legendPtr, elemPtr);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionMarkOp --
- *
- * Sets the selection mark to the element given by a index. The
- * selection anchor is the end of the selection that is movable while
- * dragging out a selection with the mouse. The index "mark" may be used
- * to refer to the anchor element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionMarkOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Legend *legendPtr = graphPtr->legend;
- Element *elemPtr;
-
- if (GetElementFromObj(graphPtr, objv[4], &elemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (legendPtr->selAnchorPtr == NULL) {
- Tcl_AppendResult(interp, "selection anchor must be set first",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (legendPtr->selMarkPtr != elemPtr) {
- Blt_ChainLink link, next;
-
- /* Deselect entry from the list all the way back to the anchor. */
- for (link = Blt_Chain_LastLink(legendPtr->selected); link != NULL;
- link = next) {
- Element *selectPtr;
-
- next = Blt_Chain_PrevLink(link);
- selectPtr = Blt_Chain_GetValue(link);
- if (selectPtr == legendPtr->selAnchorPtr) {
- break;
- }
- DeselectElement(legendPtr, selectPtr);
- }
- legendPtr->flags &= ~SELECT_MASK;
- legendPtr->flags |= SELECT_SET;
- SelectRange(legendPtr, legendPtr->selAnchorPtr, elemPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), elemPtr->obj.name, -1);
- legendPtr->selMarkPtr = elemPtr;
-
- Blt_Legend_EventuallyRedraw(graphPtr);
- if (legendPtr->selectCmd != NULL) {
- EventuallyInvokeSelectCmd(legendPtr);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionPresentOp
- *
- * Returns 1 if there is a selection and 0 if it isn't.
- *
- * Results:
- * A standard TCL result. interp->result will contain a boolean string
- * indicating if there is a selection.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionPresentOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Legend *legendPtr = graphPtr->legend;
- int bool;
-
- bool = (Blt_Chain_GetLength(legendPtr->selected) > 0);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionSetOp
- *
- * Selects, deselects, or toggles all of the elements in the range
- * between first and last, inclusive, without affecting the selection
- * state of elements outside that range.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- * .g legend selection set first last
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionSetOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Legend *legendPtr = graphPtr->legend;
- Element *firstPtr, *lastPtr;
- const char *string;
-
- legendPtr->flags &= ~SELECT_MASK;
- string = Tcl_GetString(objv[3]);
- switch (string[0]) {
- case 's':
- legendPtr->flags |= SELECT_SET;
- break;
- case 'c':
- legendPtr->flags |= SELECT_CLEAR;
- break;
- case 't':
- legendPtr->flags |= SELECT_TOGGLE;
- break;
- }
- if (GetElementFromObj(graphPtr, objv[4], &firstPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((firstPtr->flags & HIDE) && ((legendPtr->flags & SELECT_CLEAR)==0)) {
- Tcl_AppendResult(interp, "can't select hidden node \"",
- Tcl_GetString(objv[4]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- lastPtr = firstPtr;
- if (objc > 5) {
- if (GetElementFromObj(graphPtr, objv[5], &lastPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((lastPtr->flags & HIDE) &&
- ((legendPtr->flags & SELECT_CLEAR) == 0)) {
- Tcl_AppendResult(interp, "can't select hidden node \"",
- Tcl_GetString(objv[5]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (firstPtr == lastPtr) {
- SelectEntry(legendPtr, firstPtr);
- } else {
- SelectRange(legendPtr, firstPtr, lastPtr);
- }
- /* Set both the anchor and the mark. Indicates that a single entry is
- * selected. */
- if (legendPtr->selAnchorPtr == NULL) {
- legendPtr->selAnchorPtr = firstPtr;
- }
- if (legendPtr->flags & SELECT_EXPORT) {
- Tk_OwnSelection(legendPtr->tkwin, XA_PRIMARY, LostSelectionProc,
- legendPtr);
- }
- Blt_Legend_EventuallyRedraw(graphPtr);
- if (legendPtr->selectCmd != NULL) {
- EventuallyInvokeSelectCmd(legendPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionOp --
- *
- * This procedure handles the individual options for text selections.
- * The selected text is designated by start and end indices into the text
- * pool. The selected segment has both a anchored and unanchored ends.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- * .g legend selection anchor
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec selectionOps[] =
-{
- {"anchor", 1, SelectionAnchorOp, 5, 5, "elem",},
- {"clear", 5, SelectionSetOp, 5, 6, "firstElem ?lastElem?",},
- {"clearall", 6, SelectionClearallOp, 4, 4, "",},
- {"includes", 1, SelectionIncludesOp, 5, 5, "elem",},
- {"mark", 1, SelectionMarkOp, 5, 5, "elem",},
- {"present", 1, SelectionPresentOp, 4, 4, "",},
- {"set", 1, SelectionSetOp, 5, 6, "firstElem ?lastElem?",},
- {"toggle", 1, SelectionSetOp, 5, 6, "firstElem ?lastElem?",},
-};
-static int nSelectionOps = sizeof(selectionOps) / sizeof(Blt_OpSpec);
-
-static int
-SelectionOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- GraphLegendProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nSelectionOps, selectionOps, BLT_OP_ARG3,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (graphPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_LegendOp --
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Legend is possibly redrawn.
- *
- *---------------------------------------------------------------------------
- */
-
-static Blt_OpSpec legendOps[] =
-{
- {"activate", 1, ActivateOp, 3, 0, "?pattern?...",},
- {"bind", 1, BindOp, 3, 6, "elem sequence command",},
- {"cget", 2, CgetOp, 4, 4, "option",},
- {"configure", 2, ConfigureOp, 3, 0, "?option value?...",},
- {"curselection", 2, CurselectionOp, 3, 3, "",},
- {"deactivate", 1, ActivateOp, 3, 0, "?pattern?...",},
- {"focus", 1, FocusOp, 4, 4, "elem",},
- {"get", 1, GetOp, 4, 4, "elem",},
- {"icon", 1, IconOp, 5, 5, "elem image",},
- {"selection", 1, SelectionOp, 3, 0, "args"},
-};
-static int nLegendOps = sizeof(legendOps) / sizeof(Blt_OpSpec);
-
-int
-Blt_LegendOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- GraphLegendProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nLegendOps, legendOps, BLT_OP_ARG2,
- objc, objv,0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (graphPtr, interp, objc, objv);
-}
-
-int
-Blt_Legend_Site(Graph *graphPtr)
-{
- return graphPtr->legend->site;
-}
-
-int
-Blt_Legend_Width(Graph *graphPtr)
-{
- return graphPtr->legend->width;
-}
-
-int
-Blt_Legend_Height(Graph *graphPtr)
-{
- return graphPtr->legend->height;
-}
-
-int
-Blt_Legend_IsHidden(Graph *graphPtr)
-{
- return (graphPtr->legend->flags & HIDE);
-}
-
-int
-Blt_Legend_IsRaised(Graph *graphPtr)
-{
- return (graphPtr->legend->flags & RAISED);
-}
-
-int
-Blt_Legend_X(Graph *graphPtr)
-{
- return graphPtr->legend->x;
-}
-
-int
-Blt_Legend_Y(Graph *graphPtr)
-{
- return graphPtr->legend->y;
-}
-
-void
-Blt_Legend_RemoveElement(Graph *graphPtr, Element *elemPtr)
-{
- Blt_DeleteBindings(graphPtr->legend->bindTable, elemPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionProc --
- *
- * This procedure is called back by Tk when the selection is requested by
- * someone. It returns part or all of the selection in a buffer provided
- * by the caller.
- *
- * Results:
- * The return value is the number of non-NULL bytes stored at buffer.
- * Buffer is filled (or partially filled) with a NUL-terminated string
- * containing part or all of the selection, as given by offset and
- * maxBytes.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectionProc(
- ClientData clientData, /* Information about the widget. */
- int offset, /* Offset within selection of first
- * character to be returned. */
- char *buffer, /* Location in which to place
- * selection. */
- int maxBytes) /* Maximum number of bytes to place at
- * buffer, not including terminating
- * NULL character. */
-{
- Legend *legendPtr = clientData;
- int nBytes;
- Tcl_DString dString;
-
- if ((legendPtr->flags & SELECT_EXPORT) == 0) {
- return -1;
- }
- /* Retrieve the names of the selected entries. */
- Tcl_DStringInit(&dString);
- if (legendPtr->flags & SELECT_SORTED) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(legendPtr->selected);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- Tcl_DStringAppend(&dString, elemPtr->obj.name, -1);
- Tcl_DStringAppend(&dString, "\n", -1);
- }
- } else {
- Blt_ChainLink link;
- Graph *graphPtr;
-
- graphPtr = legendPtr->graphPtr;
- /* List of selected entries is in stacking order. */
- for (link = Blt_Chain_FirstLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Element *elemPtr;
-
- elemPtr = Blt_Chain_GetValue(link);
- if (EntryIsSelected(legendPtr, elemPtr)) {
- Tcl_DStringAppend(&dString, elemPtr->obj.name, -1);
- Tcl_DStringAppend(&dString, "\n", -1);
- }
- }
- }
- nBytes = Tcl_DStringLength(&dString) - offset;
- strncpy(buffer, Tcl_DStringValue(&dString) + offset, maxBytes);
- Tcl_DStringFree(&dString);
- buffer[maxBytes] = '\0';
- return MIN(nBytes, maxBytes);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * BlinkCursorProc --
- *
- * This procedure is called as a timer handler to blink the insertion
- * cursor off and on.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The cursor gets turned on or off, redisplay gets invoked, and this
- * procedure reschedules itself.
- *
- *---------------------------------------------------------------------------
- */
-static void
-BlinkCursorProc(ClientData clientData)
-{
- Graph *graphPtr = clientData;
- Legend *legendPtr;
-
- legendPtr = graphPtr->legend;
- if (!(legendPtr->flags & FOCUS) || (legendPtr->offTime == 0)) {
- return;
- }
- if (legendPtr->active) {
- int time;
-
- legendPtr->cursorOn ^= 1;
- time = (legendPtr->cursorOn) ? legendPtr->onTime : legendPtr->offTime;
- legendPtr->timerToken = Tcl_CreateTimerHandler(time, BlinkCursorProc,
- graphPtr);
- Blt_Legend_EventuallyRedraw(graphPtr);
- }
-}
diff --git a/blt3.0.1/src/bltGrLegd.h b/blt3.0.1/src/bltGrLegd.h
deleted file mode 100644
index 0ba1cb3..0000000
--- a/blt3.0.1/src/bltGrLegd.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * bltGrLegd.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_GR_LEGEND_H
-#define _BLT_GR_LEGEND_H
-
-#define LEGEND_RIGHT (1<<0) /* Right margin */
-#define LEGEND_LEFT (1<<1) /* Left margin */
-#define LEGEND_BOTTOM (1<<2) /* Bottom margin */
-#define LEGEND_TOP (1<<3) /* Top margin, below the graph title. */
-#define LEGEND_PLOT (1<<4) /* Plot area */
-#define LEGEND_XY (1<<5) /* Screen coordinates in the plotting
- * area. */
-#define LEGEND_WINDOW (1<<6) /* External window. */
-#define LEGEND_MARGIN_MASK \
- (LEGEND_RIGHT | LEGEND_LEFT | LEGEND_BOTTOM | LEGEND_TOP)
-#define LEGEND_PLOTAREA_MASK (LEGEND_PLOT | LEGEND_XY)
-
-BLT_EXTERN int Blt_CreateLegend(Graph *graphPtr);
-BLT_EXTERN void Blt_DestroyLegend(Graph *graphPtr);
-BLT_EXTERN void Blt_DrawLegend(Graph *graphPtr, Drawable drawable);
-BLT_EXTERN void Blt_MapLegend(Graph *graphPtr, int width, int height);
-BLT_EXTERN int Blt_LegendOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-BLT_EXTERN int Blt_Legend_Site(Graph *graphPtr);
-BLT_EXTERN int Blt_Legend_Width(Graph *graphPtr);
-BLT_EXTERN int Blt_Legend_Height(Graph *graphPtr);
-BLT_EXTERN int Blt_Legend_IsHidden(Graph *graphPtr);
-BLT_EXTERN int Blt_Legend_IsRaised(Graph *graphPtr);
-BLT_EXTERN int Blt_Legend_X(Graph *graphPtr);
-BLT_EXTERN int Blt_Legend_Y(Graph *graphPtr);
-BLT_EXTERN void Blt_Legend_RemoveElement(Graph *graphPtr, Element *elemPtr);
-BLT_EXTERN void Blt_Legend_EventuallyRedraw(Graph *graphPtr);
-
-#endif /* BLT_GR_LEGEND_H */
diff --git a/blt3.0.1/src/bltGrLine.c b/blt3.0.1/src/bltGrLine.c
deleted file mode 100644
index 82234da..0000000
--- a/blt3.0.1/src/bltGrLine.c
+++ /dev/null
@@ -1,5347 +0,0 @@
-
-/*
- * bltGrLine.c --
- *
- * This module implements line graph and stripchart elements for the BLT graph
- * widget.
- *
- * Copyright (c) 1993 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltGraph.h"
-#include "bltChain.h"
-#include <X11/Xutil.h>
-#include "bltGrElem.h"
-#include "tkDisplay.h"
-#include "bltBgStyle.h"
-#include "bltImage.h"
-#include "bltBitmap.h"
-
-#define COLOR_DEFAULT (XColor *)1
-#define PATTERN_SOLID ((Pixmap)1)
-
-#define PEN_INCREASING 1 /* Draw line segments for only those
- * data points whose abscissas are
- * monotonically increasing in
- * order. */
-#define PEN_DECREASING 2 /* Lines will be drawn between only
- * those points whose abscissas are
- * decreasing in order. */
-
-#define PEN_BOTH_DIRECTIONS (PEN_INCREASING | PEN_DECREASING)
-
-/* Lines will be drawn between points regardless of the ordering of the
- * abscissas */
-
-#define BROKEN_TRACE(dir,last,next) \
- (((((dir) & PEN_DECREASING) == 0) && ((next) < (last))) || \
- ((((dir) & PEN_INCREASING) == 0) && ((next) > (last))))
-
-#define DRAW_SYMBOL(linePtr) \
- (((linePtr)->symbolCounter % (linePtr)->symbolInterval) == 0)
-
-typedef enum {
- PEN_SMOOTH_LINEAR, /* Line segments */
- PEN_SMOOTH_STEP, /* Step-and-hold */
- PEN_SMOOTH_NATURAL, /* Natural cubic spline */
- PEN_SMOOTH_QUADRATIC, /* Quadratic spline */
- PEN_SMOOTH_CATROM, /* Catrom parametric spline */
- PEN_SMOOTH_LAST /* Sentinel */
-} Smoothing;
-
-typedef struct {
- const char *name;
- Smoothing value;
-} SmoothingInfo;
-
-static SmoothingInfo smoothingInfo[] = {
- { "none", PEN_SMOOTH_LINEAR },
- { "linear", PEN_SMOOTH_LINEAR },
- { "step", PEN_SMOOTH_STEP },
- { "natural", PEN_SMOOTH_NATURAL },
- { "cubic", PEN_SMOOTH_NATURAL },
- { "quadratic", PEN_SMOOTH_QUADRATIC },
- { "catrom", PEN_SMOOTH_CATROM },
- { (char *)NULL, PEN_SMOOTH_LAST }
-};
-
-
-typedef struct {
- Point2d *screenPts; /* Array of transformed coordinates */
- int nScreenPts; /* Number of coordinates */
- int *styleMap; /* Index of pen styles */
- int *map; /* Maps segments/traces to data
- * points */
-} MapInfo;
-
-/* Symbol types for line elements */
-typedef enum {
- SYMBOL_NONE,
- SYMBOL_SQUARE,
- SYMBOL_CIRCLE,
- SYMBOL_DIAMOND,
- SYMBOL_PLUS,
- SYMBOL_CROSS,
- SYMBOL_SPLUS,
- SYMBOL_SCROSS,
- SYMBOL_TRIANGLE,
- SYMBOL_ARROW,
- SYMBOL_BITMAP,
- SYMBOL_IMAGE
-} SymbolType;
-
-typedef struct {
- const char *name;
- unsigned int minChars;
- SymbolType type;
-} GraphSymbolType;
-
-static GraphSymbolType graphSymbols[] = {
- { "arrow", 1, SYMBOL_ARROW, },
- { "circle", 2, SYMBOL_CIRCLE, },
- { "cross", 2, SYMBOL_CROSS, },
- { "diamond", 1, SYMBOL_DIAMOND, },
- { "none", 1, SYMBOL_NONE, },
- { "plus", 1, SYMBOL_PLUS, },
- { "scross", 2, SYMBOL_SCROSS, },
- { "splus", 2, SYMBOL_SPLUS, },
- { "square", 2, SYMBOL_SQUARE, },
- { "triangle", 1, SYMBOL_TRIANGLE, },
- { NULL, 0, 0 },
-};
-
-typedef struct {
- SymbolType type; /* Type of symbol to be drawn/printed */
-
- int size; /* Requested size of symbol in pixels */
-
- XColor *outlineColor; /* Outline color */
-
- int outlineWidth; /* Width of the outline */
-
- GC outlineGC; /* Outline graphics context */
-
- XColor *fillColor; /* Normal fill color */
-
- GC fillGC; /* Fill graphics context */
-
- Tk_Image image; /* This is used of image symbols. */
-
- /* The last two fields are used only for bitmap symbols. */
-
- Pixmap bitmap; /* Bitmap to determine
- * foreground/background pixels of the
- * symbol */
- Pixmap mask; /* Bitmap representing the transparent
- * pixels of the symbol */
-} Symbol;
-
-typedef struct {
- int start; /* Index into the X-Y coordinate arrays
- * indicating where trace starts. */
- GraphPoints screenPts; /* Array of screen coordinates
- * (malloc-ed) representing the
- * trace. */
-} Trace;
-
-typedef struct {
- const char *name; /* Pen style identifier. If NULL pen
- * was statically allocated. */
- ClassId classId; /* Type of pen */
- const char *typeId; /* String token identifying the type of
- * pen */
- unsigned int flags; /* Indicates if the pen element is
- * active or normal */
- int refCount; /* Reference count for elements using
- * this pen. */
- Blt_HashEntry *hashPtr;
-
- Blt_ConfigSpec *configSpecs; /* Configuration specifications */
-
- PenConfigureProc *configProc;
- PenDestroyProc *destroyProc;
- Graph *graphPtr; /* Graph that the pen is associated
- * with. */
-
- /* Symbol attributes. */
- Symbol symbol; /* Element symbol type */
-
- /* Trace attributes. */
- int traceWidth; /* Width of the line segments. If
- * lineWidth is 0, no line will be
- * drawn, only symbols. */
-
- Blt_Dashes traceDashes; /* Dash on-off list value */
-
- XColor *traceColor; /* Line segment color */
-
- XColor *traceOffColor; /* Line segment dash gap color */
-
- GC traceGC; /* Line segment graphics context */
-
- /* Error bar attributes. */
- int errorBarShow; /* Describes which error bars to display:
- * none, x, y, or * both. */
-
- int errorBarLineWidth; /* Width of the error bar segments. */
-
- int errorBarCapWidth; /* Width of the cap on error bars. */
-
- XColor *errorBarColor; /* Color of the error bar. */
-
- GC errorBarGC; /* Error bar graphics context. */
-
- /* Show value attributes. */
- int valueShow; /* Indicates whether to display data
- * value. Values are x, y, both, or
- * none. */
- const char *valueFormat; /* A printf format string. */
-
- TextStyle valueStyle; /* Text attributes (color, font,
- * rotation, etc.) of the value. */
-} LinePen;
-
-typedef struct {
- Weight weight; /* Weight range where this pen is
- * valid. */
- LinePen *penPtr; /* Pen to use. */
- GraphPoints symbolPts;
-
- GraphSegments lines; /* Points to start of the line segments
- * for this pen. */
- GraphSegments xeb, yeb; /* X and Y axis error bars. */
-
- int symbolSize; /* Size of the pen's symbol scaled to
- * the current graph size. */
- int errorBarCapWidth; /* Length of the cap ends on each error
- * bar. */
-} LineStyle;
-
-typedef struct {
- GraphObj obj; /* Must be first field in element. */
- unsigned int flags;
- Blt_HashEntry *hashPtr;
-
- /* Fields specific to elements. */
- const char *label; /* Label displayed in legend */
- unsigned short row, col; /* Position of the entry in the
- * legend. */
- int legendRelief; /* Relief of label in legend. */
- Axis2d axes; /* X-axis and Y-axis mapping the
- * element */
- ElemValues x, y, w; /* Contains array of floating point
- * graph coordinate values. Also holds
- * min/max * and the number of
- * coordinates */
- int *activeIndices; /* Array of indices (malloc-ed) which
- * indicate which data points are active
- * (drawn * with "active" colors). */
- int nActiveIndices; /* Number of active data points.
- * Special case: if nActiveIndices < 0
- * and the * active bit is set in
- * "flags", then all data points are
- * drawn active. */
- ElementProcs *procsPtr;
- Blt_ConfigSpec *configSpecs; /* Configuration specifications. */
- LinePen *activePenPtr; /* Standard Pens */
- LinePen *normalPenPtr;
- LinePen *builtinPenPtr;
- Blt_Chain styles; /* Palette of pens. */
-
- /* Symbol scaling */
- int scaleSymbols; /* If non-zero, the symbols will scale
- * in size as the graph is zoomed
- * in/out. */
-
- double xRange, yRange; /* Initial X-axis and Y-axis ranges:
- * used to scale the size of element's
- * symbol. */
- int state;
- Blt_ChainLink link; /* Element's link in display list. */
-
- /* The line element specific fields start here. */
-
- ElemValues xError; /* Relative/symmetric X error values. */
- ElemValues yError; /* Relative/symmetric Y error values. */
- ElemValues xHigh, xLow; /* Absolute/asymmetric X-coordinate
- * high/low error values. */
- ElemValues yHigh, yLow; /* Absolute/asymmetric Y-coordinate
- * high/low error values. */
- LinePen builtinPen;
- int errorBarCapWidth; /* Length of cap on error bars */
-
- /* Line smoothing */
- Smoothing reqSmooth; /* Requested smoothing function to use
- * for connecting the data points */
- Smoothing smooth; /* Smoothing function used. */
- float rTolerance; /* Tolerance to reduce the number of
- * points displayed. */
-
- /* Drawing-related data structures. */
-
- /* Area-under-curve fill attributes. */
- XColor *fillFgColor;
- XColor *fillBgColor;
- GC fillGC;
-
- Blt_Background fillBg; /* Background for fill area. */
-
- Point2d *fillPts; /* Array of points used to draw polygon
- * to fill area under the curve */
- int nFillPts;
-
- /* Symbol points */
- GraphPoints symbolPts;
-
- /* Active symbol points */
- GraphPoints activePts;
- GraphSegments xeb, yeb; /* Point to start of this pen's X-error
- * bar segments in the element's
- * array. */
- int reqMaxSymbols;
- int symbolInterval;
- int symbolCounter;
-
- /* X-Y graph-specific fields */
-
- int penDir; /* Indicates if a change in the pen
- * direction should be considered a
- * retrace (line segment is not
- * drawn). */
- Blt_Chain traces; /* List of traces (a trace is a series
- * of contiguous line segments). New
- * traces are generated when either
- * the next segment changes the pen
- * direction, or the end point is
- * clipped by the plotting area. */
-
- /* Stripchart-specific fields */
-
- GraphSegments lines; /* Holds the the line segments of the
- * element trace. The segments are
- * grouped by pen style. */
-} LineElement;
-
-static Blt_OptionParseProc ObjToSmoothProc;
-static Blt_OptionPrintProc SmoothToObjProc;
-static Blt_CustomOption smoothOption =
-{
- ObjToSmoothProc, SmoothToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToPenDirProc;
-static Blt_OptionPrintProc PenDirToObjProc;
-static Blt_CustomOption penDirOption =
-{
- ObjToPenDirProc, PenDirToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeSymbolProc;
-static Blt_OptionParseProc ObjToSymbolProc;
-static Blt_OptionPrintProc SymbolToObjProc;
-static Blt_CustomOption symbolOption =
-{
- ObjToSymbolProc, SymbolToObjProc, FreeSymbolProc, (ClientData)0
-};
-
-BLT_EXTERN Blt_CustomOption bltLineStylesOption;
-BLT_EXTERN Blt_CustomOption bltColorOption;
-BLT_EXTERN Blt_CustomOption bltValuesOption;
-BLT_EXTERN Blt_CustomOption bltValuePairsOption;
-BLT_EXTERN Blt_CustomOption bltLinePenOption;
-BLT_EXTERN Blt_CustomOption bltXAxisOption;
-BLT_EXTERN Blt_CustomOption bltYAxisOption;
-
-#define DEF_LINE_ACTIVE_PEN "activeLine"
-#define DEF_LINE_AXIS_X "x"
-#define DEF_LINE_AXIS_Y "y"
-#define DEF_LINE_DASHES (char *)NULL
-#define DEF_LINE_DATA (char *)NULL
-#define DEF_LINE_FILL_COLOR "defcolor"
-#define DEF_LINE_HIDE "no"
-#define DEF_LINE_LABEL (char *)NULL
-#define DEF_LINE_LABEL_RELIEF "flat"
-#define DEF_LINE_MAX_SYMBOLS "0"
-#define DEF_LINE_OFFDASH_COLOR (char *)NULL
-#define DEF_LINE_OUTLINE_COLOR "defcolor"
-#define DEF_LINE_OUTLINE_WIDTH "1"
-#define DEF_LINE_PATTERN_BG (char *)NULL
-#define DEF_LINE_PATTERN_FG "black"
-#define DEF_LINE_PEN_COLOR RGB_NAVYBLUE
-#define DEF_LINE_PEN_DIRECTION "both"
-#define DEF_LINE_PEN_WIDTH "1"
-#define DEF_LINE_PIXELS "0.1i"
-#define DEF_LINE_REDUCE "0.0"
-#define DEF_LINE_SCALE_SYMBOLS "yes"
-#define DEF_LINE_SMOOTH "linear"
-#define DEF_LINE_STATE "normal"
-#define DEF_LINE_STIPPLE (char *)NULL
-#define DEF_LINE_STYLES ""
-#define DEF_LINE_SYMBOL "circle"
-#define DEF_LINE_TAGS "all"
-#define DEF_LINE_X_DATA (char *)NULL
-#define DEF_LINE_Y_DATA (char *)NULL
-
-#define DEF_LINE_ERRORBAR_COLOR "defcolor"
-#define DEF_LINE_ERRORBAR_LINE_WIDTH "2"
-#define DEF_LINE_ERRORBAR_CAP_WIDTH "2"
-#define DEF_LINE_SHOW_ERRORBARS "both"
-
-#define DEF_PEN_ACTIVE_COLOR RGB_BLUE
-#define DEF_PEN_DASHES (char *)NULL
-#define DEF_PEN_FILL_COLOR "defcolor"
-#define DEF_PEN_LINE_WIDTH "1"
-#define DEF_PEN_NORMAL_COLOR RGB_NAVYBLUE
-#define DEF_PEN_OFFDASH_COLOR (char *)NULL
-#define DEF_PEN_OUTLINE_COLOR "defcolor"
-#define DEF_PEN_OUTLINE_WIDTH "1"
-#define DEF_PEN_PIXELS "0.1i"
-#define DEF_PEN_SYMBOL "circle"
-#define DEF_PEN_TYPE "line"
-#define DEF_PEN_VALUE_ANCHOR "s"
-#define DEF_PEN_VALUE_COLOR RGB_BLACK
-#define DEF_PEN_VALUE_FONT STD_FONT_NUMBERS
-#define DEF_PEN_VALUE_FORMAT "%g"
-#define DEF_PEN_VALUE_ANGLE (char *)NULL
-#define DEF_PEN_SHOW_VALUES "no"
-
-static Blt_ConfigSpec lineElemConfigSpecs[] =
-{
- {BLT_CONFIG_CUSTOM, "-activepen", "activePen", "ActivePen",
- DEF_LINE_ACTIVE_PEN, Blt_Offset(LineElement, activePenPtr),
- BLT_CONFIG_NULL_OK, &bltLinePenOption},
- {BLT_CONFIG_COLOR, "-areaforeground", "areaForeground", "AreaForeground",
- DEF_LINE_PATTERN_FG, Blt_Offset(LineElement, fillFgColor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BACKGROUND, "-areabackground", "areaBackground",
- "AreaBackground", DEF_LINE_PATTERN_BG, Blt_Offset(LineElement, fillBg),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_LIST, "-bindtags", "bindTags", "BindTags", DEF_LINE_TAGS,
- Blt_Offset(LineElement, obj.tags), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-color", "color", "Color", DEF_LINE_PEN_COLOR,
- Blt_Offset(LineElement, builtinPen.traceColor), 0},
- {BLT_CONFIG_DASHES, "-dashes", "dashes", "Dashes", DEF_LINE_DASHES,
- Blt_Offset(LineElement, builtinPen.traceDashes), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-data", "data", "Data", DEF_LINE_DATA, 0, 0,
- &bltValuePairsOption},
- {BLT_CONFIG_CUSTOM, "-errorbarcolor", "errorBarColor", "ErrorBarColor",
- DEF_LINE_ERRORBAR_COLOR,
- Blt_Offset(LineElement, builtinPen.errorBarColor), 0, &bltColorOption},
- {BLT_CONFIG_PIXELS_NNEG,"-errorbarwidth", "errorBarWidth", "ErrorBarWidth",
- DEF_LINE_ERRORBAR_LINE_WIDTH,
- Blt_Offset(LineElement, builtinPen.errorBarLineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-errorbarcap", "errorBarCap", "ErrorBarCap",
- DEF_LINE_ERRORBAR_CAP_WIDTH,
- Blt_Offset(LineElement, builtinPen.errorBarCapWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-fill", "fill", "Fill", DEF_LINE_FILL_COLOR,
- Blt_Offset(LineElement, builtinPen.symbol.fillColor),
- BLT_CONFIG_NULL_OK, &bltColorOption},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_LINE_HIDE,
- Blt_Offset(LineElement, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE},
- {BLT_CONFIG_STRING, "-label", "label", "Label", (char *)NULL,
- Blt_Offset(LineElement, label), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-legendrelief", "legendRelief", "LegendRelief",
- DEF_LINE_LABEL_RELIEF, Blt_Offset(LineElement, legendRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-linewidth", "lineWidth", "LineWidth",
- DEF_LINE_PEN_WIDTH, Blt_Offset(LineElement, builtinPen.traceWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-mapx", "mapX", "MapX",
- DEF_LINE_AXIS_X, Blt_Offset(LineElement, axes.x), 0, &bltXAxisOption},
- {BLT_CONFIG_CUSTOM, "-mapy", "mapY", "MapY",
- DEF_LINE_AXIS_Y, Blt_Offset(LineElement, axes.y), 0, &bltYAxisOption},
- {BLT_CONFIG_INT_NNEG, "-maxsymbols", "maxSymbols", "MaxSymbols",
- DEF_LINE_MAX_SYMBOLS, Blt_Offset(LineElement, reqMaxSymbols),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-offdash", "offDash", "OffDash",
- DEF_LINE_OFFDASH_COLOR,
- Blt_Offset(LineElement, builtinPen.traceOffColor),
- BLT_CONFIG_NULL_OK, &bltColorOption},
- {BLT_CONFIG_CUSTOM, "-outline", "outline", "Outline",
- DEF_LINE_OUTLINE_COLOR,
- Blt_Offset(LineElement, builtinPen.symbol.outlineColor),
- 0, &bltColorOption},
- {BLT_CONFIG_PIXELS_NNEG, "-outlinewidth", "outlineWidth", "OutlineWidth",
- DEF_LINE_OUTLINE_WIDTH,
- Blt_Offset(LineElement, builtinPen.symbol.outlineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-pen", "pen", "Pen", (char *)NULL,
- Blt_Offset(LineElement, normalPenPtr), BLT_CONFIG_NULL_OK,
- &bltLinePenOption},
- {BLT_CONFIG_PIXELS_NNEG, "-pixels", "pixels", "Pixels", DEF_LINE_PIXELS,
- Blt_Offset(LineElement, builtinPen.symbol.size), GRAPH | STRIPCHART},
- {BLT_CONFIG_FLOAT, "-reduce", "reduce", "Reduce",
- DEF_LINE_REDUCE, Blt_Offset(LineElement, rTolerance),
- GRAPH | STRIPCHART | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-scalesymbols", "scaleSymbols", "ScaleSymbols",
- DEF_LINE_SCALE_SYMBOLS, Blt_Offset(LineElement, scaleSymbols),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FILL, "-showerrorbars", "showErrorBars", "ShowErrorBars",
- DEF_LINE_SHOW_ERRORBARS,
- Blt_Offset(LineElement, builtinPen.errorBarShow),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FILL, "-showvalues", "showValues", "ShowValues",
- DEF_PEN_SHOW_VALUES, Blt_Offset(LineElement, builtinPen.valueShow),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-smooth", "smooth", "Smooth", DEF_LINE_SMOOTH,
- Blt_Offset(LineElement, reqSmooth), BLT_CONFIG_DONT_SET_DEFAULT,
- &smoothOption},
- {BLT_CONFIG_STATE, "-state", "state", "State", DEF_LINE_STATE,
- Blt_Offset(LineElement, state), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-styles", "styles", "Styles", DEF_LINE_STYLES,
- Blt_Offset(LineElement, styles), 0, &bltLineStylesOption},
- {BLT_CONFIG_CUSTOM, "-symbol", "symbol", "Symbol", DEF_LINE_SYMBOL,
- Blt_Offset(LineElement, builtinPen.symbol),
- BLT_CONFIG_DONT_SET_DEFAULT, &symbolOption},
- {BLT_CONFIG_CUSTOM, "-trace", "trace", "Trace", DEF_LINE_PEN_DIRECTION,
- Blt_Offset(LineElement, penDir),
- BLT_CONFIG_DONT_SET_DEFAULT, &penDirOption},
- {BLT_CONFIG_ANCHOR, "-valueanchor", "valueAnchor", "ValueAnchor",
- DEF_PEN_VALUE_ANCHOR,
- Blt_Offset(LineElement, builtinPen.valueStyle.anchor), 0},
- {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor",
- DEF_PEN_VALUE_COLOR,
- Blt_Offset(LineElement, builtinPen.valueStyle.color), 0},
- {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont",
- DEF_PEN_VALUE_FONT,
- Blt_Offset(LineElement, builtinPen.valueStyle.font), 0},
- {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat",
- DEF_PEN_VALUE_FORMAT, Blt_Offset(LineElement, builtinPen.valueFormat),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FLOAT, "-valuerotate", "valueRotate", "ValueRotate",
- DEF_PEN_VALUE_ANGLE,
- Blt_Offset(LineElement, builtinPen.valueStyle.angle), 0},
- {BLT_CONFIG_CUSTOM, "-weights", "weights", "Weights", (char *)NULL,
- Blt_Offset(LineElement, w), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-x", "xData", "XData", (char *)NULL,
- Blt_Offset(LineElement, x), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xdata", "xData", "XData", (char *)NULL,
- Blt_Offset(LineElement, x), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xerror", "xError", "XError", (char *)NULL,
- Blt_Offset(LineElement, xError), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xhigh", "xHigh", "XHigh", (char *)NULL,
- Blt_Offset(LineElement, xHigh), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xlow", "xLow", "XLow", (char *)NULL,
- Blt_Offset(LineElement, xLow), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-y", "yData", "YData", (char *)NULL,
- Blt_Offset(LineElement, y), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-ydata", "yData", "YData", (char *)NULL,
- Blt_Offset(LineElement, y), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-yerror", "yError", "YError", (char *)NULL,
- Blt_Offset(LineElement, yError), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-yhigh", "yHigh", "YHigh", (char *)NULL,
- Blt_Offset(LineElement, yHigh), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-ylow", "yLow", "YLow", (char *)NULL,
- Blt_Offset(LineElement, yLow), 0, &bltValuesOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-
-static Blt_ConfigSpec stripElemConfigSpecs[] =
-{
- {BLT_CONFIG_CUSTOM, "-activepen", "activePen", "ActivePen",
- DEF_LINE_ACTIVE_PEN, Blt_Offset(LineElement, activePenPtr),
- BLT_CONFIG_NULL_OK, &bltLinePenOption},
- {BLT_CONFIG_COLOR, "-areaforeground", "areaForeground", "areaForeground",
- DEF_LINE_PATTERN_FG, Blt_Offset(LineElement, fillFgColor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BACKGROUND, "-areabackground", "areaBackground",
- "areaBackground", DEF_LINE_PATTERN_BG, Blt_Offset(LineElement, fillBg),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_LIST, "-bindtags", "bindTags", "BindTags", DEF_LINE_TAGS,
- Blt_Offset(LineElement, obj.tags), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-color", "color", "Color",
- DEF_LINE_PEN_COLOR, Blt_Offset(LineElement, builtinPen.traceColor), 0},
- {BLT_CONFIG_DASHES, "-dashes", "dashes", "Dashes",
- DEF_LINE_DASHES, Blt_Offset(LineElement, builtinPen.traceDashes),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-data", "data", "Data", DEF_LINE_DATA, 0, 0,
- &bltValuePairsOption},
- {BLT_CONFIG_CUSTOM, "-errorbarcolor", "errorBarColor", "ErrorBarColor",
- DEF_LINE_ERRORBAR_COLOR,
- Blt_Offset(LineElement, builtinPen.errorBarColor), 0, &bltColorOption},
- {BLT_CONFIG_PIXELS_NNEG, "-errorbarwidth", "errorBarWidth", "ErrorBarWidth",
- DEF_LINE_ERRORBAR_LINE_WIDTH,
- Blt_Offset(LineElement, builtinPen.errorBarLineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-errorbarcap", "errorBarCap", "ErrorBarCap",
- DEF_LINE_ERRORBAR_CAP_WIDTH,
- Blt_Offset(LineElement, builtinPen.errorBarCapWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-fill", "fill", "Fill", DEF_LINE_FILL_COLOR,
- Blt_Offset(LineElement, builtinPen.symbol.fillColor),
- BLT_CONFIG_NULL_OK, &bltColorOption},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_LINE_HIDE,
- Blt_Offset(LineElement, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE},
- {BLT_CONFIG_STRING, "-label", "label", "Label", (char *)NULL,
- Blt_Offset(LineElement, label), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-legendrelief", "legendRelief", "LegendRelief",
- DEF_LINE_LABEL_RELIEF, Blt_Offset(LineElement, legendRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-linewidth", "lineWidth", "LineWidth",
- DEF_LINE_PEN_WIDTH, Blt_Offset(LineElement, builtinPen.traceWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-mapx", "mapX", "MapX", DEF_LINE_AXIS_X,
- Blt_Offset(LineElement, axes.x), 0, &bltXAxisOption},
- {BLT_CONFIG_CUSTOM, "-mapy", "mapY", "MapY", DEF_LINE_AXIS_Y,
- Blt_Offset(LineElement, axes.y), 0, &bltYAxisOption},
- {BLT_CONFIG_INT_NNEG, "-maxsymbols", "maxSymbols", "MaxSymbols",
- DEF_LINE_MAX_SYMBOLS, Blt_Offset(LineElement, reqMaxSymbols),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-offdash", "offDash", "OffDash",
- DEF_LINE_OFFDASH_COLOR, Blt_Offset(LineElement, builtinPen.traceOffColor),
- BLT_CONFIG_NULL_OK, &bltColorOption},
- {BLT_CONFIG_CUSTOM, "-outline", "outline", "Outline",
- DEF_LINE_OUTLINE_COLOR,
- Blt_Offset(LineElement, builtinPen.symbol.outlineColor), 0,
- &bltColorOption},
- {BLT_CONFIG_PIXELS_NNEG, "-outlinewidth", "outlineWidth", "OutlineWidth",
- DEF_LINE_OUTLINE_WIDTH,
- Blt_Offset(LineElement, builtinPen.symbol.outlineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-pen", "pen", "Pen", (char *)NULL,
- Blt_Offset(LineElement, normalPenPtr), BLT_CONFIG_NULL_OK,
- &bltLinePenOption},
- {BLT_CONFIG_PIXELS_NNEG, "-pixels", "pixels", "Pixels", DEF_LINE_PIXELS,
- Blt_Offset(LineElement, builtinPen.symbol.size), 0},
- {BLT_CONFIG_BOOLEAN, "-scalesymbols", "scaleSymbols", "ScaleSymbols",
- DEF_LINE_SCALE_SYMBOLS, Blt_Offset(LineElement, scaleSymbols),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FILL, "-showerrorbars", "showErrorBars", "ShowErrorBars",
- DEF_LINE_SHOW_ERRORBARS,
- Blt_Offset(LineElement, builtinPen.errorBarShow),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FILL, "-showvalues", "showValues", "ShowValues",
- DEF_PEN_SHOW_VALUES, Blt_Offset(LineElement, builtinPen.valueShow),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-smooth", "smooth", "Smooth", DEF_LINE_SMOOTH,
- Blt_Offset(LineElement, reqSmooth), BLT_CONFIG_DONT_SET_DEFAULT,
- &smoothOption},
- {BLT_CONFIG_CUSTOM, "-styles", "styles", "Styles", DEF_LINE_STYLES,
- Blt_Offset(LineElement, styles), 0, &bltLineStylesOption},
- {BLT_CONFIG_CUSTOM, "-symbol", "symbol", "Symbol", DEF_LINE_SYMBOL,
- Blt_Offset(LineElement, builtinPen.symbol),
- BLT_CONFIG_DONT_SET_DEFAULT, &symbolOption},
- {BLT_CONFIG_ANCHOR, "-valueanchor", "valueAnchor", "ValueAnchor",
- DEF_PEN_VALUE_ANCHOR,
- Blt_Offset(LineElement, builtinPen.valueStyle.anchor), 0},
- {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor",
- DEF_PEN_VALUE_COLOR,
- Blt_Offset(LineElement, builtinPen.valueStyle.color), 0},
- {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont",
- DEF_PEN_VALUE_FONT,
- Blt_Offset(LineElement, builtinPen.valueStyle.font), 0},
- {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat",
- DEF_PEN_VALUE_FORMAT, Blt_Offset(LineElement, builtinPen.valueFormat),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FLOAT, "-valuerotate", "valueRotate", "ValueRotate",
- DEF_PEN_VALUE_ANGLE,
- Blt_Offset(LineElement, builtinPen.valueStyle.angle),0},
- {BLT_CONFIG_CUSTOM, "-weights", "weights", "Weights", (char *)NULL,
- Blt_Offset(LineElement, w), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-x", "xData", "XData", (char *)NULL,
- Blt_Offset(LineElement, x), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xdata", "xData", "XData", (char *)NULL,
- Blt_Offset(LineElement, x), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-y", "yData", "YData", (char *)NULL,
- Blt_Offset(LineElement, y), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xerror", "xError", "XError", (char *)NULL,
- Blt_Offset(LineElement, xError), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-ydata", "yData", "YData", (char *)NULL,
- Blt_Offset(LineElement, y), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-yerror", "yError", "YError", (char *)NULL,
- Blt_Offset(LineElement, yError), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xhigh", "xHigh", "XHigh", (char *)NULL,
- Blt_Offset(LineElement, xHigh), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-xlow", "xLow", "XLow", (char *)NULL,
- Blt_Offset(LineElement, xLow), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-yhigh", "yHigh", "YHigh", (char *)NULL,
- Blt_Offset(LineElement, xHigh), 0, &bltValuesOption},
- {BLT_CONFIG_CUSTOM, "-ylow", "yLow", "YLow", (char *)NULL,
- Blt_Offset(LineElement, yLow), 0, &bltValuesOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static Blt_ConfigSpec linePenConfigSpecs[] =
-{
- {BLT_CONFIG_COLOR, "-color", "color", "Color", DEF_PEN_ACTIVE_COLOR,
- Blt_Offset(LinePen, traceColor), ACTIVE_PEN},
- {BLT_CONFIG_COLOR, "-color", "color", "Color", DEF_PEN_NORMAL_COLOR,
- Blt_Offset(LinePen, traceColor), NORMAL_PEN},
- {BLT_CONFIG_DASHES, "-dashes", "dashes", "Dashes", DEF_PEN_DASHES,
- Blt_Offset(LinePen, traceDashes), BLT_CONFIG_NULL_OK | ALL_PENS},
- {BLT_CONFIG_CUSTOM, "-errorbarcolor", "errorBarColor", "ErrorBarColor",
- DEF_LINE_ERRORBAR_COLOR, Blt_Offset(LinePen, errorBarColor),
- ALL_PENS, &bltColorOption},
- {BLT_CONFIG_PIXELS_NNEG, "-errorbarwidth", "errorBarWidth", "ErrorBarWidth",
- DEF_LINE_ERRORBAR_LINE_WIDTH, Blt_Offset(LinePen, errorBarLineWidth),
- ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-errorbarcap", "errorBarCap", "ErrorBarCap",
- DEF_LINE_ERRORBAR_CAP_WIDTH, Blt_Offset(LinePen, errorBarCapWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-fill", "fill", "Fill", DEF_PEN_FILL_COLOR,
- Blt_Offset(LinePen, symbol.fillColor), BLT_CONFIG_NULL_OK | ALL_PENS,
- &bltColorOption},
- {BLT_CONFIG_PIXELS_NNEG, "-linewidth", "lineWidth", "LineWidth",
- (char *)NULL, Blt_Offset(LinePen, traceWidth),
- ALL_PENS| BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-offdash", "offDash", "OffDash", DEF_PEN_OFFDASH_COLOR,
- Blt_Offset(LinePen, traceOffColor), BLT_CONFIG_NULL_OK | ALL_PENS,
- &bltColorOption},
- {BLT_CONFIG_CUSTOM, "-outline", "outline", "Outline", DEF_PEN_OUTLINE_COLOR,
- Blt_Offset(LinePen, symbol.outlineColor), ALL_PENS, &bltColorOption},
- {BLT_CONFIG_PIXELS_NNEG, "-outlinewidth", "outlineWidth", "OutlineWidth",
- DEF_PEN_OUTLINE_WIDTH, Blt_Offset(LinePen, symbol.outlineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT | ALL_PENS},
- {BLT_CONFIG_PIXELS_NNEG, "-pixels", "pixels", "Pixels", DEF_PEN_PIXELS,
- Blt_Offset(LinePen, symbol.size), ALL_PENS},
- {BLT_CONFIG_FILL, "-showerrorbars", "showErrorBars", "ShowErrorBars",
- DEF_LINE_SHOW_ERRORBARS, Blt_Offset(LinePen, errorBarShow),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FILL, "-showvalues", "showValues", "ShowValues",
- DEF_PEN_SHOW_VALUES, Blt_Offset(LinePen, valueShow),
- ALL_PENS | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-symbol", "symbol", "Symbol", DEF_PEN_SYMBOL,
- Blt_Offset(LinePen, symbol), BLT_CONFIG_DONT_SET_DEFAULT | ALL_PENS,
- &symbolOption},
- {BLT_CONFIG_STRING, "-type", (char *)NULL, (char *)NULL, DEF_PEN_TYPE,
- Blt_Offset(Pen, typeId), ALL_PENS | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ANCHOR, "-valueanchor", "valueAnchor", "ValueAnchor",
- DEF_PEN_VALUE_ANCHOR, Blt_Offset(LinePen, valueStyle.anchor), ALL_PENS},
- {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor",
- DEF_PEN_VALUE_COLOR, Blt_Offset(LinePen, valueStyle.color), ALL_PENS},
- {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont",
- DEF_PEN_VALUE_FONT, Blt_Offset(LinePen, valueStyle.font), ALL_PENS},
- {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat",
- DEF_PEN_VALUE_FORMAT, Blt_Offset(LinePen, valueFormat),
- ALL_PENS | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FLOAT, "-valuerotate", "valueRotate", "ValueRotate",
- DEF_PEN_VALUE_ANGLE, Blt_Offset(LinePen, valueStyle.angle), ALL_PENS},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-typedef double (DistanceProc)(int x, int y, Point2d *p, Point2d *q, Point2d *t);
-
-/* Forward declarations */
-static PenConfigureProc ConfigurePenProc;
-static PenDestroyProc DestroyPenProc;
-static ElementClosestProc ClosestLineProc;
-static ElementConfigProc ConfigureLineProc;
-static ElementDestroyProc DestroyLineProc;
-static ElementDrawProc DrawActiveLineProc;
-static ElementDrawProc DrawNormalLineProc;
-static ElementDrawSymbolProc DrawSymbolProc;
-static ElementExtentsProc GetLineExtentsProc;
-static ElementToPostScriptProc ActiveLineToPostScriptProc;
-static ElementToPostScriptProc NormalLineToPostScriptProc;
-static ElementSymbolToPostScriptProc SymbolToPostScriptProc;
-static ElementMapProc MapLineProc;
-static DistanceProc DistanceToYProc;
-static DistanceProc DistanceToXProc;
-static DistanceProc DistanceToLineProc;
-static Blt_BackgroundChangedProc BackgroundChangedProc;
-
-#ifdef WIN32
-
-static int tkpWinRopModes[] =
-{
- R2_BLACK, /* GXclear */
- R2_MASKPEN, /* GXand */
- R2_MASKPENNOT, /* GXandReverse */
- R2_COPYPEN, /* GXcopy */
- R2_MASKNOTPEN, /* GXandInverted */
- R2_NOT, /* GXnoop */
- R2_XORPEN, /* GXxor */
- R2_MERGEPEN, /* GXor */
- R2_NOTMERGEPEN, /* GXnor */
- R2_NOTXORPEN, /* GXequiv */
- R2_NOT, /* GXinvert */
- R2_MERGEPENNOT, /* GXorReverse */
- R2_NOTCOPYPEN, /* GXcopyInverted */
- R2_MERGENOTPEN, /* GXorInverted */
- R2_NOTMASKPEN, /* GXnand */
- R2_WHITE /* GXset */
-};
-
-#endif
-
-#ifndef notdef
-INLINE static int
-Round(double x)
-{
- return (int) (x + ((x < 0.0) ? -0.5 : 0.5));
-}
-#else
-#define Round Round
-#endif
-/*
- *---------------------------------------------------------------------------
- * Custom configuration option (parse and print) routines
- *---------------------------------------------------------------------------
- */
-
-static void
-DestroySymbol(Display *display, Symbol *symbolPtr)
-{
- if (symbolPtr->image != NULL) {
- Tk_FreeImage(symbolPtr->image);
- symbolPtr->image = NULL;
- }
- if (symbolPtr->bitmap != None) {
- Tk_FreeBitmap(display, symbolPtr->bitmap);
- symbolPtr->bitmap = None;
- }
- if (symbolPtr->mask != None) {
- Tk_FreeBitmap(display, symbolPtr->mask);
- symbolPtr->mask = None;
- }
- symbolPtr->type = SYMBOL_NONE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImageChangedProc
- *
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-ImageChangedProc(
- ClientData clientData,
- int x, int y, int w, int h, /* Not used. */
- int imageWidth, int imageHeight) /* Not used. */
-{
- Element *elemPtr;
- Graph *graphPtr;
-
- elemPtr = clientData;
- elemPtr->flags |= MAP_ITEM;
- graphPtr = elemPtr->obj.graphPtr;
- graphPtr->flags |= CACHE_DIRTY;
- Blt_EventuallyRedrawGraph(graphPtr);
-}
-
-/*ARGSUSED*/
-static void
-FreeSymbolProc(
- ClientData clientData, /* Not used. */
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Symbol *symbolPtr = (Symbol *)(widgRec + offset);
-
- DestroySymbol(display, symbolPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToSymbol --
- *
- * Convert the string representation of a line style or symbol name into
- * its numeric form.
- *
- * Results:
- * The return value is a standard TCL result. The symbol type is written
- * into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToSymbolProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing symbol type */
- char *widgRec, /* Element information record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Symbol *symbolPtr = (Symbol *)(widgRec + offset);
- const char *string;
-
- {
- int length;
- GraphSymbolType *p;
- char c;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- if (length == 0) {
- DestroySymbol(Tk_Display(tkwin), symbolPtr);
- symbolPtr->type = SYMBOL_NONE;
- return TCL_OK;
- }
- c = string[0];
- for (p = graphSymbols; p->name != NULL; p++) {
- if (length < p->minChars) {
- continue;
- }
- if ((c == p->name[0]) && (strncmp(string, p->name, length) == 0)) {
- DestroySymbol(Tk_Display(tkwin), symbolPtr);
- symbolPtr->type = p->type;
- return TCL_OK;
- }
- }
- }
- {
- Tk_Image tkImage;
- Element *elemPtr = (Element *)widgRec;
-
- tkImage = Tk_GetImage(interp, tkwin, string, ImageChangedProc, elemPtr);
- if (tkImage != NULL) {
- DestroySymbol(Tk_Display(tkwin), symbolPtr);
- symbolPtr->image = tkImage;
- symbolPtr->type = SYMBOL_IMAGE;
- return TCL_OK;
- }
- }
- {
- Pixmap bitmap, mask;
- Tcl_Obj **objv;
- int objc;
-
- if ((Tcl_ListObjGetElements(NULL, objPtr, &objc, &objv) != TCL_OK) ||
- (objc > 2)) {
- goto error;
- }
- bitmap = mask = None;
- if (objc > 0) {
- bitmap = Tk_AllocBitmapFromObj((Tcl_Interp *)NULL, tkwin, objv[0]);
- if (bitmap == None) {
- goto error;
- }
- }
- if (objc > 1) {
- mask = Tk_AllocBitmapFromObj((Tcl_Interp *)NULL, tkwin, objv[1]);
- if (mask == None) {
- goto error;
- }
- }
- DestroySymbol(Tk_Display(tkwin), symbolPtr);
- symbolPtr->bitmap = bitmap;
- symbolPtr->mask = mask;
- symbolPtr->type = SYMBOL_BITMAP;
- return TCL_OK;
- }
- error:
- Tcl_AppendResult(interp, "bad symbol \"", string,
- "\": should be \"none\", \"circle\", \"square\", \"diamond\", "
- "\"plus\", \"cross\", \"splus\", \"scross\", \"triangle\", "
- "\"arrow\" or the name of a bitmap", (char *)NULL);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SymbolToObj --
- *
- * Convert the symbol value into a string.
- *
- * Results:
- * The string representing the symbol type or line style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-SymbolToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin,
- char *widgRec, /* Element information record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Symbol *symbolPtr = (Symbol *)(widgRec + offset);
-
- if (symbolPtr->type == SYMBOL_BITMAP) {
- Tcl_Obj *listObjPtr, *objPtr;
- const char *name;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- name = Tk_NameOfBitmap(Tk_Display(tkwin), symbolPtr->bitmap);
- objPtr = Tcl_NewStringObj(name, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- if (symbolPtr->mask == None) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- name = Tk_NameOfBitmap(Tk_Display(tkwin), symbolPtr->mask);
- objPtr = Tcl_NewStringObj(name, -1);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- return listObjPtr;
- } else {
- GraphSymbolType *p;
-
- for (p = graphSymbols; p->name != NULL; p++) {
- if (p->type == symbolPtr->type) {
- return Tcl_NewStringObj(p->name, -1);
- }
- }
- return Tcl_NewStringObj("?unknown symbol type?", -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NameOfSmooth --
- *
- * Converts the smooth value into its string representation.
- *
- * Results:
- * The static string representing the smooth type is returned.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-NameOfSmooth(Smoothing value)
-{
- SmoothingInfo *siPtr;
-
- for (siPtr = smoothingInfo; siPtr->name != NULL; siPtr++) {
- if (siPtr->value == value) {
- return siPtr->name;
- }
- }
- return "unknown smooth value";
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToSmooth --
- *
- * Convert the string representation of a line style or smooth name
- * into its numeric form.
- *
- * Results:
- * The return value is a standard TCL result. The smooth type is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToSmoothProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing smooth type */
- char *widgRec, /* Element information record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Smoothing *valuePtr = (Smoothing *)(widgRec + offset);
- SmoothingInfo *siPtr;
- const char *string;
- char c;
-
- string = Tcl_GetString(objPtr);
- c = string[0];
- for (siPtr = smoothingInfo; siPtr->name != NULL; siPtr++) {
- if ((c == siPtr->name[0]) && (strcmp(string, siPtr->name) == 0)) {
- *valuePtr = siPtr->value;
- return TCL_OK;
- }
- }
- Tcl_AppendResult(interp, "bad smooth value \"", string, "\": should be \
-linear, step, natural, or quadratic", (char *)NULL);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SmoothToObj --
- *
- * Convert the smooth value into a string.
- *
- * Results:
- * The string representing the smooth type or line style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-SmoothToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Element information record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- int smooth = *(int *)(widgRec + offset);
-
- return Tcl_NewStringObj(NameOfSmooth(smooth), -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToPenDir --
- *
- * Convert the string representation of a line style or symbol name
- * into its numeric form.
- *
- * Results:
- * The return value is a standard TCL result. The symbol type is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToPenDirProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing pen direction */
- char *widgRec, /* Element information record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- int *penDirPtr = (int *)(widgRec + offset);
- int length;
- char c;
- char *string;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'i') && (strncmp(string, "increasing", length) == 0)) {
- *penDirPtr = PEN_INCREASING;
- } else if ((c == 'd') && (strncmp(string, "decreasing", length) == 0)) {
- *penDirPtr = PEN_DECREASING;
- } else if ((c == 'b') && (strncmp(string, "both", length) == 0)) {
- *penDirPtr = PEN_BOTH_DIRECTIONS;
- } else {
- Tcl_AppendResult(interp, "bad trace value \"", string,
- "\" : should be \"increasing\", \"decreasing\", or \"both\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NameOfPenDir --
- *
- * Convert the pen direction into a string.
- *
- * Results:
- * The static string representing the pen direction is returned.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-NameOfPenDir(int penDir)
-{
- switch (penDir) {
- case PEN_INCREASING:
- return "increasing";
- case PEN_DECREASING:
- return "decreasing";
- case PEN_BOTH_DIRECTIONS:
- return "both";
- default:
- return "unknown trace direction";
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PenDirToObj --
- *
- * Convert the pen direction into a string.
- *
- * Results:
- * The string representing the pen drawing direction is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-PenDirToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Element information record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- int penDir = *(int *)(widgRec + offset);
-
- return Tcl_NewStringObj(NameOfPenDir(penDir), -1);
-}
-
-
-/*
- * Reset the number of points and segments, in case there are no segments or
- * points
- */
-static void
-ResetStylePalette(Blt_Chain styles)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(styles); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- LineStyle *stylePtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->lines.length = stylePtr->symbolPts.length = 0;
- stylePtr->xeb.length = stylePtr->yeb.length = 0;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigurePenProc --
- *
- * Sets up the appropriate configuration parameters in the GC. It is
- * assumed the parameters have been previously set by a call to
- * Blt_ConfigureWidget.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result contains an error message.
- *
- * Side effects:
- * Configuration information such as line width, line style, color
- * etc. get set in a new GC.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ConfigurePenProc(Graph *graphPtr, Pen *penPtr)
-{
- LinePen *lpPtr = (LinePen *)penPtr;
- unsigned long gcMask;
- GC newGC;
- XGCValues gcValues;
- XColor *colorPtr;
-
- /*
- * Set the outline GC for this pen: GCForeground is outline color.
- * GCBackground is the fill color (only used for bitmap symbols).
- */
- gcMask = (GCLineWidth | GCForeground);
- colorPtr = lpPtr->symbol.outlineColor;
- if (colorPtr == COLOR_DEFAULT) {
- colorPtr = lpPtr->traceColor;
- }
- gcValues.foreground = colorPtr->pixel;
- if (lpPtr->symbol.type == SYMBOL_BITMAP) {
- colorPtr = lpPtr->symbol.fillColor;
- if (colorPtr == COLOR_DEFAULT) {
- colorPtr = lpPtr->traceColor;
- }
- /*
- * Set a clip mask if either
- * 1) no background color was designated or
- * 2) a masking bitmap was specified.
- *
- * These aren't necessarily the bitmaps we'll be using for clipping. But
- * this makes it unlikely that anyone else will be sharing this GC when
- * we set the clip origin (at the time the bitmap is drawn).
- */
- if (colorPtr != NULL) {
- gcValues.background = colorPtr->pixel;
- gcMask |= GCBackground;
- if (lpPtr->symbol.mask != None) {
- gcValues.clip_mask = lpPtr->symbol.mask;
- gcMask |= GCClipMask;
- }
- } else {
- gcValues.clip_mask = lpPtr->symbol.bitmap;
- gcMask |= GCClipMask;
- }
- }
- gcValues.line_width = LineWidth(lpPtr->symbol.outlineWidth);
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (lpPtr->symbol.outlineGC != NULL) {
- Tk_FreeGC(graphPtr->display, lpPtr->symbol.outlineGC);
- }
- lpPtr->symbol.outlineGC = newGC;
-
- /* Fill GC for symbols: GCForeground is fill color */
-
- gcMask = (GCLineWidth | GCForeground);
- colorPtr = lpPtr->symbol.fillColor;
- if (colorPtr == COLOR_DEFAULT) {
- colorPtr = lpPtr->traceColor;
- }
- newGC = NULL;
- if (colorPtr != NULL) {
- gcValues.foreground = colorPtr->pixel;
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- }
- if (lpPtr->symbol.fillGC != NULL) {
- Tk_FreeGC(graphPtr->display, lpPtr->symbol.fillGC);
- }
- lpPtr->symbol.fillGC = newGC;
-
- /* Line segments */
-
- gcMask = (GCLineWidth | GCForeground | GCLineStyle | GCCapStyle |
- GCJoinStyle);
- gcValues.cap_style = CapButt;
- gcValues.join_style = JoinRound;
- gcValues.line_style = LineSolid;
- gcValues.line_width = LineWidth(lpPtr->traceWidth);
-
- colorPtr = lpPtr->traceOffColor;
- if (colorPtr == COLOR_DEFAULT) {
- colorPtr = lpPtr->traceColor;
- }
- if (colorPtr != NULL) {
- gcMask |= GCBackground;
- gcValues.background = colorPtr->pixel;
- }
- gcValues.foreground = lpPtr->traceColor->pixel;
- if (LineIsDashed(lpPtr->traceDashes)) {
- gcValues.line_width = lpPtr->traceWidth;
- gcValues.line_style =
- (colorPtr == NULL) ? LineOnOffDash : LineDoubleDash;
- }
- newGC = Blt_GetPrivateGC(graphPtr->tkwin, gcMask, &gcValues);
- if (lpPtr->traceGC != NULL) {
- Blt_FreePrivateGC(graphPtr->display, lpPtr->traceGC);
- }
- if (LineIsDashed(lpPtr->traceDashes)) {
- lpPtr->traceDashes.offset = lpPtr->traceDashes.values[0] / 2;
- Blt_SetDashes(graphPtr->display, newGC, &lpPtr->traceDashes);
- }
- lpPtr->traceGC = newGC;
-
- gcMask = (GCLineWidth | GCForeground);
- colorPtr = lpPtr->errorBarColor;
- if (colorPtr == COLOR_DEFAULT) {
- colorPtr = lpPtr->traceColor;
- }
- gcValues.line_width = LineWidth(lpPtr->errorBarLineWidth);
- gcValues.foreground = colorPtr->pixel;
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (lpPtr->errorBarGC != NULL) {
- Tk_FreeGC(graphPtr->display, lpPtr->errorBarGC);
- }
- lpPtr->errorBarGC = newGC;
-
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyPenProc --
- *
- * Release memory and resources allocated for the style.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the pen style is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyPenProc(Graph *graphPtr, Pen *basePtr)
-{
- LinePen *penPtr = (LinePen *)basePtr;
-
- Blt_Ts_FreeStyle(graphPtr->display, &penPtr->valueStyle);
- if (penPtr->symbol.outlineGC != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->symbol.outlineGC);
- }
- if (penPtr->symbol.fillGC != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->symbol.fillGC);
- }
- if (penPtr->errorBarGC != NULL) {
- Tk_FreeGC(graphPtr->display, penPtr->errorBarGC);
- }
- if (penPtr->traceGC != NULL) {
- Blt_FreePrivateGC(graphPtr->display, penPtr->traceGC);
- }
- if (penPtr->symbol.bitmap != None) {
- Tk_FreeBitmap(graphPtr->display, penPtr->symbol.bitmap);
- penPtr->symbol.bitmap = None;
- }
- if (penPtr->symbol.mask != None) {
- Tk_FreeBitmap(graphPtr->display, penPtr->symbol.mask);
- penPtr->symbol.mask = None;
- }
-}
-
-
-static void
-InitLinePen(LinePen *penPtr)
-{
- Blt_Ts_InitStyle(penPtr->valueStyle);
- penPtr->errorBarLineWidth = 2;
- penPtr->errorBarShow = SHOW_BOTH;
- penPtr->configProc = ConfigurePenProc;
- penPtr->configSpecs = linePenConfigSpecs;
- penPtr->destroyProc = DestroyPenProc;
- penPtr->flags = NORMAL_PEN;
- penPtr->name = "";
- penPtr->symbol.bitmap = penPtr->symbol.mask = None;
- penPtr->symbol.outlineColor = penPtr->symbol.fillColor = COLOR_DEFAULT;
- penPtr->symbol.outlineWidth = penPtr->traceWidth = 1;
- penPtr->symbol.type = SYMBOL_CIRCLE;
- penPtr->valueShow = SHOW_NONE;
-}
-
-Pen *
-Blt_LinePen(const char *penName)
-{
- LinePen *penPtr;
-
- penPtr = Blt_AssertCalloc(1, sizeof(LinePen));
- InitLinePen(penPtr);
- penPtr->name = Blt_AssertStrdup(penName);
- penPtr->classId = CID_ELEM_LINE;
- if (strcmp(penName, "activeLine") == 0) {
- penPtr->flags = ACTIVE_PEN;
- }
- return (Pen *)penPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * In this section, the routines deal with building and filling the
- * element's data structures with transformed screen coordinates. They are
- * triggered from TranformLine which is called whenever the data or
- * coordinates axes have changed and new screen coordinates need to be
- * calculated.
- *
- *---------------------------------------------------------------------------
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScaleSymbol --
- *
- * Returns the scaled size for the line element. Scaling depends upon when
- * the base line ranges for the element were set and the current range of
- * the graph.
- *
- * Results:
- * The new size of the symbol, after considering how much the graph has
- * been scaled, is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ScaleSymbol(LineElement *elemPtr, int normalSize)
-{
- int maxSize;
- double scale;
- int newSize;
-
- scale = 1.0;
- if (elemPtr->scaleSymbols) {
- double xRange, yRange;
-
- xRange = (elemPtr->axes.x->max - elemPtr->axes.x->min);
- yRange = (elemPtr->axes.y->max - elemPtr->axes.y->min);
- if (elemPtr->flags & SCALE_SYMBOL) {
- /* Save the ranges as a baseline for future scaling. */
- elemPtr->xRange = xRange;
- elemPtr->yRange = yRange;
- elemPtr->flags &= ~SCALE_SYMBOL;
- } else {
- double xScale, yScale;
-
- /* Scale the symbol by the smallest change in the X or Y axes */
- xScale = elemPtr->xRange / xRange;
- yScale = elemPtr->yRange / yRange;
- scale = MIN(xScale, yScale);
- }
- }
- newSize = Round(normalSize * scale);
-
- /*
- * Don't let the size of symbols go unbounded. Both X and Win32 drawing
- * routines assume coordinates to be a signed short int.
- */
- maxSize = (int)MIN(elemPtr->obj.graphPtr->hRange,
- elemPtr->obj.graphPtr->vRange);
- if (newSize > maxSize) {
- newSize = maxSize;
- }
-
- /* Make the symbol size odd so that its center is a single pixel. */
- newSize |= 0x01;
- return newSize;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetScreenPoints --
- *
- * Generates a coordinate array of transformed screen coordinates from
- * the data points. Coordinates with Inf, -Inf, or NaN values are
- * removed.
- *
- * Results:
- * The transformed screen coordinates are returned.
- *
- * Side effects:
- * Memory is allocated for the coordinate array.
- *
- *
- * Future ideas:
- * Allow bad values to be removed (as done currently) or break
- * into separate traces. Smoothing would be affected.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GetScreenPoints(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr)
-{
- double *x, *y;
- int i, np;
- int count;
- Point2d *points;
- int *map;
-
- np = NUMBEROFPOINTS(elemPtr);
- x = elemPtr->x.values;
- y = elemPtr->y.values;
- points = Blt_AssertMalloc(sizeof(Point2d) * np);
- map = Blt_AssertMalloc(sizeof(int) * np);
-
- count = 0; /* Count the valid screen coordinates */
- if (graphPtr->inverted) {
- for (i = 0; i < np; i++) {
- if ((FINITE(x[i])) && (FINITE(y[i]))) {
- points[count].x = Blt_HMap(elemPtr->axes.y, y[i]);
- points[count].y = Blt_VMap(elemPtr->axes.x, x[i]);
- map[count] = i;
- count++;
- }
- }
- } else {
- for (i = 0; i < np; i++) {
- if ((FINITE(x[i])) && (FINITE(y[i]))) {
- points[count].x = Blt_HMap(elemPtr->axes.x, x[i]);
- points[count].y = Blt_VMap(elemPtr->axes.y, y[i]);
- map[count] = i;
- count++;
- }
- }
- }
- mapPtr->screenPts = points;
- mapPtr->nScreenPts = count;
- mapPtr->map = map;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReducePoints --
- *
- * Generates a coordinate array of transformed screen coordinates from
- * the data points.
- *
- * Results:
- * The transformed screen coordinates are returned.
- *
- * Side effects:
- * Memory is allocated for the coordinate array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ReducePoints(MapInfo *mapPtr, double tolerance)
-{
- int i, np;
- Point2d *screenPts;
- int *map, *simple;
-
- simple = Blt_AssertMalloc(mapPtr->nScreenPts * sizeof(int));
- map = Blt_AssertMalloc(mapPtr->nScreenPts * sizeof(int));
- screenPts = Blt_AssertMalloc(mapPtr->nScreenPts * sizeof(Point2d));
- np = Blt_SimplifyLine(mapPtr->screenPts, 0, mapPtr->nScreenPts - 1,
- tolerance, simple);
- for (i = 0; i < np; i++) {
- int k;
-
- k = simple[i];
- screenPts[i] = mapPtr->screenPts[k];
- map[i] = mapPtr->map[k];
- }
-#ifdef notdef
- if (np < mapPtr->nScreenPts) {
- fprintf(stderr, "reduced from %d to %d\n", mapPtr->nScreenPts, np);
- }
-#endif
- Blt_Free(mapPtr->screenPts);
- Blt_Free(mapPtr->map);
- Blt_Free(simple);
- mapPtr->screenPts = screenPts;
- mapPtr->map = map;
- mapPtr->nScreenPts = np;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GenerateSteps --
- *
- * Resets the coordinate and pen index arrays adding new points for
- * step-and-hold type smoothing.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The temporary arrays for screen coordinates and pen indices
- * are updated.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GenerateSteps(MapInfo *mapPtr)
-{
- int newSize;
- int i, count;
- Point2d *screenPts;
- int *map;
-
- newSize = ((mapPtr->nScreenPts - 1) * 2) + 1;
- screenPts = Blt_AssertMalloc(newSize * sizeof(Point2d));
- map = Blt_AssertMalloc(sizeof(int) * newSize);
- screenPts[0] = mapPtr->screenPts[0];
- map[0] = 0;
-
- count = 1;
- for (i = 1; i < mapPtr->nScreenPts; i++) {
- screenPts[count + 1] = mapPtr->screenPts[i];
-
- /* Hold last y-coordinate, use new x-coordinate */
- screenPts[count].x = screenPts[count + 1].x;
- screenPts[count].y = screenPts[count - 1].y;
-
- /* Use the same style for both the hold and the step points */
- map[count] = map[count + 1] = mapPtr->map[i];
- count += 2;
- }
- Blt_Free(mapPtr->screenPts);
- Blt_Free(mapPtr->map);
- mapPtr->map = map;
- mapPtr->screenPts = screenPts;
- mapPtr->nScreenPts = newSize;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GenerateSpline --
- *
- * Computes a spline based upon the data points, returning a new (larger)
- * coordinate array or points.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The temporary arrays for screen coordinates and data map are updated
- * based upon spline.
- *
- * FIXME: Can't interpolate knots along the Y-axis. Need to break
- * up point array into interchangable X and Y vectors earlier.
- * Pass extents (left/right or top/bottom) as parameters.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GenerateSpline(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr)
-{
- Point2d *origPts, *iPts;
- int *map;
- int extra;
- int niPts, nOrigPts;
- int result;
- int i, j, count;
-
- nOrigPts = mapPtr->nScreenPts;
- origPts = mapPtr->screenPts;
- assert(mapPtr->nScreenPts > 0);
- for (i = 0, j = 1; j < nOrigPts; i++, j++) {
- if (origPts[j].x <= origPts[i].x) {
- return; /* Points are not monotonically
- * increasing */
- }
- }
- if (((origPts[0].x > (double)graphPtr->right)) ||
- ((origPts[mapPtr->nScreenPts - 1].x < (double)graphPtr->left))) {
- return; /* All points are clipped */
- }
-
- /*
- * The spline is computed in screen coordinates instead of data points so
- * that we can select the abscissas of the interpolated points from each
- * pixel horizontally across the plotting area.
- */
- extra = (graphPtr->right - graphPtr->left) + 1;
- if (extra < 1) {
- return;
- }
- niPts = nOrigPts + extra + 1;
- iPts = Blt_AssertMalloc(niPts * sizeof(Point2d));
- map = Blt_AssertMalloc(sizeof(int) * niPts);
- /* Populate the x2 array with both the original X-coordinates and extra
- * X-coordinates for each horizontal pixel that the line segment
- * contains. */
- count = 0;
- for (i = 0, j = 1; j < nOrigPts; i++, j++) {
-
- /* Add the original x-coordinate */
- iPts[count].x = origPts[i].x;
-
- /* Include the starting offset of the point in the offset array */
- map[count] = mapPtr->map[i];
- count++;
-
- /* Is any part of the interval (line segment) in the plotting area? */
- if ((origPts[j].x >= (double)graphPtr->left) ||
- (origPts[i].x <= (double)graphPtr->right)) {
- double x, last;
-
- x = origPts[i].x + 1.0;
-
- /*
- * Since the line segment may be partially clipped on the left or
- * right side, the points to interpolate are always interior to
- * the plotting area.
- *
- * left right
- * x1----|---------------------------|---x2
- *
- * Pick the max of the starting X-coordinate and the left edge and
- * the min of the last X-coordinate and the right edge.
- */
- x = MAX(x, (double)graphPtr->left);
- last = MIN(origPts[j].x, (double)graphPtr->right);
-
- /* Add the extra x-coordinates to the interval. */
- while (x < last) {
- map[count] = mapPtr->map[i];
- iPts[count++].x = x;
- x++;
- }
- }
- }
- niPts = count;
- result = FALSE;
- if (elemPtr->smooth == PEN_SMOOTH_NATURAL) {
- result = Blt_NaturalSpline(origPts, nOrigPts, iPts, niPts);
- } else if (elemPtr->smooth == PEN_SMOOTH_QUADRATIC) {
- result = Blt_QuadraticSpline(origPts, nOrigPts, iPts, niPts);
- }
- if (!result) {
- /* The spline interpolation failed. We'll fallback to the current
- * coordinates and do no smoothing (standard line segments). */
- elemPtr->smooth = PEN_SMOOTH_LINEAR;
- Blt_Free(iPts);
- Blt_Free(map);
- } else {
- Blt_Free(mapPtr->screenPts);
- Blt_Free(mapPtr->map);
- mapPtr->map = map;
- mapPtr->screenPts = iPts;
- mapPtr->nScreenPts = niPts;
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GenerateParametricSpline --
- *
- * Computes a spline based upon the data points, returning a new (larger)
- * coordinate array or points.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The temporary arrays for screen coordinates and data map are updated
- * based upon spline.
- *
- * FIXME: Can't interpolate knots along the Y-axis. Need to break
- * up point array into interchangable X and Y vectors earlier.
- * Pass extents (left/right or top/bottom) as parameters.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GenerateParametricSpline(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr)
-{
- Region2d exts;
- Point2d *origPts, *iPts;
- int *map;
- int niPts, nOrigPts;
- int result;
- int i, j, count;
-
- nOrigPts = mapPtr->nScreenPts;
- origPts = mapPtr->screenPts;
- assert(mapPtr->nScreenPts > 0);
-
- Blt_GraphExtents(graphPtr, &exts);
-
- /*
- * Populate the x2 array with both the original X-coordinates and extra
- * X-coordinates for each horizontal pixel that the line segment contains.
- */
- count = 1;
- for (i = 0, j = 1; j < nOrigPts; i++, j++) {
- Point2d p, q;
-
- p = origPts[i];
- q = origPts[j];
- count++;
- if (Blt_LineRectClip(&exts, &p, &q)) {
- count += (int)(hypot(q.x - p.x, q.y - p.y) * 0.5);
- }
- }
- niPts = count;
- iPts = Blt_AssertMalloc(niPts * sizeof(Point2d));
- map = Blt_AssertMalloc(sizeof(int) * niPts);
-
- /*
- * FIXME: This is just plain wrong. The spline should be computed
- * and evaluated in separate steps. This will mean breaking
- * up this routine since the catrom coefficients can be
- * independently computed for original data point. This
- * also handles the problem of allocating enough points
- * since evaluation is independent of the number of points
- * to be evalualted. The interpolated
- * line segments should be clipped, not the original segments.
- */
- count = 0;
- for (i = 0, j = 1; j < nOrigPts; i++, j++) {
- Point2d p, q;
- double d;
-
- p = origPts[i];
- q = origPts[j];
-
- d = hypot(q.x - p.x, q.y - p.y);
- /* Add the original x-coordinate */
- iPts[count].x = (double)i;
- iPts[count].y = 0.0;
-
- /* Include the starting offset of the point in the offset array */
- map[count] = mapPtr->map[i];
- count++;
-
- /* Is any part of the interval (line segment) in the plotting
- * area? */
-
- if (Blt_LineRectClip(&exts, &p, &q)) {
- double dp, dq;
-
- /* Distance of original point to p. */
- dp = hypot(p.x - origPts[i].x, p.y - origPts[i].y);
- /* Distance of original point to q. */
- dq = hypot(q.x - origPts[i].x, q.y - origPts[i].y);
- dp += 2.0;
- while(dp <= dq) {
- /* Point is indicated by its interval and parameter t. */
- iPts[count].x = (double)i;
- iPts[count].y = dp / d;
- map[count] = mapPtr->map[i];
- count++;
- dp += 2.0;
- }
- }
- }
- iPts[count].x = (double)i;
- iPts[count].y = 0.0;
- map[count] = mapPtr->map[i];
- count++;
- niPts = count;
- result = FALSE;
- if (elemPtr->smooth == PEN_SMOOTH_NATURAL) {
- result = Blt_NaturalParametricSpline(origPts, nOrigPts, &exts, FALSE,
- iPts, niPts);
- } else if (elemPtr->smooth == PEN_SMOOTH_CATROM) {
- result = Blt_CatromParametricSpline(origPts, nOrigPts, iPts, niPts);
- }
- if (!result) {
- /* The spline interpolation failed. We will fall back to the current
- * coordinates and do no smoothing (standard line segments). */
- elemPtr->smooth = PEN_SMOOTH_LINEAR;
- Blt_Free(iPts);
- Blt_Free(map);
- } else {
- Blt_Free(mapPtr->screenPts);
- Blt_Free(mapPtr->map);
- mapPtr->map = map;
- mapPtr->screenPts = iPts;
- mapPtr->nScreenPts = niPts;
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapSymbols --
- *
- * Creates two arrays of points and pen map, filled with the screen
- * coordinates of the visible
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is freed and allocated for the index array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapSymbols(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr)
-{
- Region2d exts;
- Point2d *pp, *points;
- int *map;
- int i, count;
-
- points = Blt_AssertMalloc(sizeof(Point2d) * mapPtr->nScreenPts);
- map = Blt_AssertMalloc(sizeof(int) * mapPtr->nScreenPts);
-
- Blt_GraphExtents(graphPtr, &exts);
- count = 0; /* Count the number of visible points */
-
- for (pp = mapPtr->screenPts, i = 0; i < mapPtr->nScreenPts; i++, pp++) {
- if (PointInRegion(&exts, pp->x, pp->y)) {
- points[count].x = pp->x;
- points[count].y = pp->y;
- map[count] = mapPtr->map[i];
- count++;
- }
- }
- elemPtr->symbolPts.points = points;
- elemPtr->symbolPts.length = count;
- elemPtr->symbolPts.map = map;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapActiveSymbols --
- *
- * Creates an array of points of the active graph coordinates.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is freed and allocated for the active point array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapActiveSymbols(Graph *graphPtr, LineElement *elemPtr)
-{
- Point2d *points;
- Region2d exts;
- int *map;
- int count, i, np;
-
- if (elemPtr->activePts.points != NULL) {
- Blt_Free(elemPtr->activePts.points);
- elemPtr->activePts.points = NULL;
- }
- if (elemPtr->activePts.map != NULL) {
- Blt_Free(elemPtr->activePts.map);
- elemPtr->activePts.map = NULL;
- }
- Blt_GraphExtents(graphPtr, &exts);
- points = Blt_AssertMalloc(sizeof(Point2d) * elemPtr->nActiveIndices);
- map = Blt_AssertMalloc(sizeof(int) * elemPtr->nActiveIndices);
- np = NUMBEROFPOINTS(elemPtr);
- count = 0; /* Count the visible active points */
- for (i = 0; i < elemPtr->nActiveIndices; i++) {
- double x, y;
- int iPoint;
-
- iPoint = elemPtr->activeIndices[i];
- if (iPoint >= np) {
- continue; /* Index not available */
- }
- x = elemPtr->x.values[iPoint];
- y = elemPtr->y.values[iPoint];
- points[count] = Blt_Map2D(graphPtr, x, y, &elemPtr->axes);
- map[count] = iPoint;
- if (PointInRegion(&exts, points[count].x, points[count].y)) {
- count++;
- }
- }
- if (count > 0) {
- elemPtr->activePts.points = points;
- elemPtr->activePts.map = map;
- } else {
- /* No active points were visible. */
- Blt_Free(points);
- Blt_Free(map);
- }
- elemPtr->activePts.length = count;
- elemPtr->flags &= ~ACTIVE_PENDING;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapStrip --
- *
- * Creates an array of line segments of the graph coordinates.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is allocated for the line segment array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapStrip(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr)
-{
- Region2d exts;
- Segment2d *lines;
- int *indices, *indexPtr;
- Point2d *pend, *pp;
- Segment2d *sp;
- int count;
-
- indices = Blt_AssertMalloc(sizeof(int) * mapPtr->nScreenPts);
-
- /*
- * Create array to hold points for line segments (not polyline
- * coordinates). So allocate twice the number of points.
- */
- sp = lines = Blt_AssertMalloc(mapPtr->nScreenPts * sizeof(Segment2d));
- Blt_GraphExtents(graphPtr, &exts);
- count = 0; /* Count the number of segments. */
- indexPtr = mapPtr->map;
- for (pp = mapPtr->screenPts, pend = pp + (mapPtr->nScreenPts - 1);
- pp < pend; pp++, indexPtr++) {
- sp->p = pp[0], sp->q = pp[1];
- if (Blt_LineRectClip(&exts, &sp->p, &sp->q)) {
- sp++;
- indices[count] = *indexPtr;
- count++;
- }
- }
- elemPtr->lines.map = indices;
- elemPtr->lines.length = count;
- elemPtr->lines.segments = lines;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MergePens --
- *
- * Reorders the both arrays of points and segments to merge pens.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The old arrays are freed and new ones allocated containing
- * the reordered points and segments.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MergePens(LineElement *elemPtr, LineStyle **styleMap)
-{
- if (Blt_Chain_GetLength(elemPtr->styles) < 2) {
- Blt_ChainLink link;
- LineStyle *stylePtr;
-
- link = Blt_Chain_FirstLink(elemPtr->styles);
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->errorBarCapWidth = elemPtr->errorBarCapWidth;
- stylePtr->lines.length = elemPtr->lines.length;
- stylePtr->lines.segments = elemPtr->lines.segments;
- stylePtr->symbolPts.length = elemPtr->symbolPts.length;
- stylePtr->symbolPts.points = elemPtr->symbolPts.points;
- stylePtr->xeb.length = elemPtr->xeb.length;
- stylePtr->xeb.segments = elemPtr->xeb.segments;
- stylePtr->yeb.length = elemPtr->yeb.length;
- stylePtr->yeb.segments = elemPtr->yeb.segments;
- return;
- }
-
- /* We have more than one style. Group line segments and points of like pen
- * styles. */
- if (elemPtr->lines.length > 0) {
- Blt_ChainLink link;
- Segment2d *sp, *segments;
- int *ip;
- int *map;
-
- segments = Blt_AssertMalloc(elemPtr->lines.length * sizeof(Segment2d));
- map = Blt_AssertMalloc(elemPtr->lines.length * sizeof(int));
- sp = segments, ip = map;
- for (link = Blt_Chain_FirstLink(elemPtr->styles);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- LineStyle *stylePtr;
- int i;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->lines.segments = sp;
- for (i = 0; i < elemPtr->lines.length; i++) {
- int iData;
-
- iData = elemPtr->lines.map[i];
- if (styleMap[iData] == stylePtr) {
- *sp++ = elemPtr->lines.segments[i];
- *ip++ = iData;
- }
- }
- stylePtr->lines.length = sp - stylePtr->lines.segments;
- }
- Blt_Free(elemPtr->lines.segments);
- elemPtr->lines.segments = segments;
- Blt_Free(elemPtr->lines.map);
- elemPtr->lines.map = map;
- }
- if (elemPtr->symbolPts.length > 0) {
- Blt_ChainLink link;
- int *ip;
- Point2d *points, *pp;
- int *map;
-
- points = Blt_AssertMalloc(elemPtr->symbolPts.length * sizeof(Point2d));
- map = Blt_AssertMalloc(elemPtr->symbolPts.length * sizeof(int));
- pp = points, ip = map;
- for (link = Blt_Chain_FirstLink(elemPtr->styles);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- LineStyle *stylePtr;
- int i;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->symbolPts.points = pp;
- for (i = 0; i < elemPtr->symbolPts.length; i++) {
- int iData;
-
- iData = elemPtr->symbolPts.map[i];
- if (styleMap[iData] == stylePtr) {
- *pp++ = elemPtr->symbolPts.points[i];
- *ip++ = iData;
- }
- }
- stylePtr->symbolPts.length = pp - stylePtr->symbolPts.points;
- }
- Blt_Free(elemPtr->symbolPts.points);
- Blt_Free(elemPtr->symbolPts.map);
- elemPtr->symbolPts.points = points;
- elemPtr->symbolPts.map = map;
- }
- if (elemPtr->xeb.length > 0) {
- Segment2d *segments, *sp;
- int *map, *ip;
- Blt_ChainLink link;
-
- segments = Blt_AssertMalloc(elemPtr->xeb.length * sizeof(Segment2d));
- map = Blt_AssertMalloc(elemPtr->xeb.length * sizeof(int));
- sp = segments, ip = map;
- for (link = Blt_Chain_FirstLink(elemPtr->styles);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- LineStyle *stylePtr;
- int i;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->xeb.segments = sp;
- for (i = 0; i < elemPtr->xeb.length; i++) {
- int iData;
-
- iData = elemPtr->xeb.map[i];
- if (styleMap[iData] == stylePtr) {
- *sp++ = elemPtr->xeb.segments[i];
- *ip++ = iData;
- }
- }
- stylePtr->xeb.length = sp - stylePtr->xeb.segments;
- }
- Blt_Free(elemPtr->xeb.segments);
- Blt_Free(elemPtr->xeb.map);
- elemPtr->xeb.segments = segments;
- elemPtr->xeb.map = map;
- }
- if (elemPtr->yeb.length > 0) {
- Segment2d *segments, *sp;
- int *map, *ip;
- Blt_ChainLink link;
-
- segments = Blt_AssertMalloc(elemPtr->yeb.length * sizeof(Segment2d));
- map = Blt_AssertMalloc(elemPtr->yeb.length * sizeof(int));
- sp = segments, ip = map;
- for (link = Blt_Chain_FirstLink(elemPtr->styles);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- LineStyle *stylePtr;
- int i;
-
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->yeb.segments = sp;
- for (i = 0; i < elemPtr->yeb.length; i++) {
- int iData;
-
- iData = elemPtr->yeb.map[i];
- if (styleMap[iData] == stylePtr) {
- *sp++ = elemPtr->yeb.segments[i];
- *ip++ = iData;
- }
- }
- stylePtr->yeb.length = sp - stylePtr->yeb.segments;
- }
- Blt_Free(elemPtr->yeb.segments);
- elemPtr->yeb.segments = segments;
- Blt_Free(elemPtr->yeb.map);
- elemPtr->yeb.map = map;
- }
-}
-
-#define CLIP_TOP (1<<0)
-#define CLIP_BOTTOM (1<<1)
-#define CLIP_RIGHT (1<<2)
-#define CLIP_LEFT (1<<3)
-
-INLINE static int
-OutCode(Region2d *extsPtr, Point2d *p)
-{
- int code;
-
- code = 0;
- if (p->x > extsPtr->right) {
- code |= CLIP_RIGHT;
- } else if (p->x < extsPtr->left) {
- code |= CLIP_LEFT;
- }
- if (p->y > extsPtr->bottom) {
- code |= CLIP_BOTTOM;
- } else if (p->y < extsPtr->top) {
- code |= CLIP_TOP;
- }
- return code;
-}
-
-static int
-ClipSegment(
- Region2d *extsPtr,
- int code1, int code2,
- Point2d *p, Point2d *q)
-{
- int inside, outside;
-
- inside = ((code1 | code2) == 0);
- outside = ((code1 & code2) != 0);
-
- /*
- * In the worst case, we'll clip the line segment against each of the four
- * sides of the bounding rectangle.
- */
- while ((!outside) && (!inside)) {
- if (code1 == 0) {
- Point2d *tmp;
- int code;
-
- /* Swap pointers and out codes */
- tmp = p, p = q, q = tmp;
- code = code1, code1 = code2, code2 = code;
- }
- if (code1 & CLIP_LEFT) {
- p->y += (q->y - p->y) *
- (extsPtr->left - p->x) / (q->x - p->x);
- p->x = extsPtr->left;
- } else if (code1 & CLIP_RIGHT) {
- p->y += (q->y - p->y) *
- (extsPtr->right - p->x) / (q->x - p->x);
- p->x = extsPtr->right;
- } else if (code1 & CLIP_BOTTOM) {
- p->x += (q->x - p->x) *
- (extsPtr->bottom - p->y) / (q->y - p->y);
- p->y = extsPtr->bottom;
- } else if (code1 & CLIP_TOP) {
- p->x += (q->x - p->x) *
- (extsPtr->top - p->y) / (q->y - p->y);
- p->y = extsPtr->top;
- }
- code1 = OutCode(extsPtr, p);
-
- inside = ((code1 | code2) == 0);
- outside = ((code1 & code2) != 0);
- }
- return (!inside);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SaveTrace --
- *
- * Creates a new trace and inserts it into the line's list of traces.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-SaveTrace(
- LineElement *elemPtr,
- int start, /* Starting index of the trace in data point
- * array. Used to figure out closest point */
- int length, /* Number of points forming the trace */
- MapInfo *mapPtr)
-{
- Trace *tracePtr;
- Point2d *screenPts;
- int *map;
- int i, j;
-
- tracePtr = Blt_AssertMalloc(sizeof(Trace));
- screenPts = Blt_AssertMalloc(sizeof(Point2d) * length);
- map = Blt_AssertMalloc(sizeof(int) * length);
-
- /* Copy the screen coordinates of the trace into the point array */
-
- if (mapPtr->map != NULL) {
- for (i = 0, j = start; i < length; i++, j++) {
- screenPts[i].x = mapPtr->screenPts[j].x;
- screenPts[i].y = mapPtr->screenPts[j].y;
- map[i] = mapPtr->map[j];
- }
- } else {
- for (i = 0, j = start; i < length; i++, j++) {
- screenPts[i].x = mapPtr->screenPts[j].x;
- screenPts[i].y = mapPtr->screenPts[j].y;
- map[i] = j;
- }
- }
- tracePtr->screenPts.length = length;
- tracePtr->screenPts.points = screenPts;
- tracePtr->screenPts.map = map;
- tracePtr->start = start;
- if (elemPtr->traces == NULL) {
- elemPtr->traces = Blt_Chain_Create();
- }
- Blt_Chain_Append(elemPtr->traces, tracePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeTraces --
- *
- * Deletes all the traces for the line.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeTraces(LineElement *elemPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(elemPtr->traces); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Trace *tracePtr;
-
- tracePtr = Blt_Chain_GetValue(link);
- Blt_Free(tracePtr->screenPts.map);
- Blt_Free(tracePtr->screenPts.points);
- Blt_Free(tracePtr);
- }
- Blt_Chain_Destroy(elemPtr->traces);
- elemPtr->traces = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapTraces --
- *
- * Creates an array of line segments of the graph coordinates.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is allocated for the line segment array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapTraces(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr)
-{
- Point2d *p, *q;
- Region2d exts;
- int code1;
- int i;
- int start, count;
-
- Blt_GraphExtents(graphPtr, &exts);
- count = 1;
- code1 = OutCode(&exts, mapPtr->screenPts);
- p = mapPtr->screenPts;
- q = p + 1;
- for (i = 1; i < mapPtr->nScreenPts; i++, p++, q++) {
- Point2d s;
- int code2;
- int broken, offscreen;
-
- s.x = s.y = 0;
- code2 = OutCode(&exts, q);
- if (code2 != 0) {
- /* Save the coordinates of the last point, before clipping */
- s = *q;
- }
- broken = BROKEN_TRACE(elemPtr->penDir, p->x, q->x);
- offscreen = ClipSegment(&exts, code1, code2, p, q);
- if (broken || offscreen) {
-
- /*
- * The last line segment is either totally clipped by the plotting
- * area or the x-direction is wrong, breaking the trace. Either
- * way, save information about the last trace (if one exists),
- * discarding the current line segment
- */
-
- if (count > 1) {
- start = i - count;
- SaveTrace(elemPtr, start, count, mapPtr);
- count = 1;
- }
- } else {
- count++; /* Add the point to the trace. */
- if (code2 != 0) {
-
- /*
- * If the last point is clipped, this means that the trace is
- * broken after this point. Restore the original coordinate
- * (before clipping) after saving the trace.
- */
-
- start = i - (count - 1);
- SaveTrace(elemPtr, start, count, mapPtr);
- mapPtr->screenPts[i] = s;
- count = 1;
- }
- }
- code1 = code2;
- }
- if (count > 1) {
- start = i - count;
- SaveTrace(elemPtr, start, count, mapPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapFillArea --
- *
- * Creates an array of points that represent a polygon that fills
- * the area under the element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is allocated for the polygon point array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapFillArea(Graph *graphPtr, LineElement *elemPtr, MapInfo *mapPtr)
-{
- Point2d *origPts, *clipPts;
- Region2d exts;
- int np;
-
- if (elemPtr->fillPts != NULL) {
- Blt_Free(elemPtr->fillPts);
- elemPtr->fillPts = NULL;
- elemPtr->nFillPts = 0;
- }
- if (mapPtr->nScreenPts < 3) {
- return;
- }
- np = mapPtr->nScreenPts + 3;
- Blt_GraphExtents(graphPtr, &exts);
-
- origPts = Blt_AssertMalloc(sizeof(Point2d) * np);
- if (graphPtr->inverted) {
- double minX;
- int i;
-
- minX = (double)elemPtr->axes.y->screenMin;
- for (i = 0; i < mapPtr->nScreenPts; i++) {
- origPts[i].x = mapPtr->screenPts[i].x + 1;
- origPts[i].y = mapPtr->screenPts[i].y;
- if (origPts[i].x < minX) {
- minX = origPts[i].x;
- }
- }
- /* Add edges to make (if necessary) the polygon fill to the bottom of
- * plotting window */
- origPts[i].x = minX;
- origPts[i].y = origPts[i - 1].y;
- i++;
- origPts[i].x = minX;
- origPts[i].y = origPts[0].y;
- i++;
- origPts[i] = origPts[0];
- } else {
- double maxY;
- int i;
-
- maxY = (double)elemPtr->axes.y->bottom;
- for (i = 0; i < mapPtr->nScreenPts; i++) {
- origPts[i].x = mapPtr->screenPts[i].x + 1;
- origPts[i].y = mapPtr->screenPts[i].y;
- if (origPts[i].y > maxY) {
- maxY = origPts[i].y;
- }
- }
- /* Add edges to extend the fill polygon to the bottom of plotting
- * window */
- origPts[i].x = origPts[i - 1].x;
- origPts[i].y = maxY;
- i++;
- origPts[i].x = origPts[0].x;
- origPts[i].y = maxY;
- i++;
- origPts[i] = origPts[0];
- }
-
- clipPts = Blt_AssertMalloc(sizeof(Point2d) * np * 3);
- np = Blt_PolyRectClip(&exts, origPts, np - 1, clipPts);
-
- Blt_Free(origPts);
- if (np < 3) {
- Blt_Free(clipPts);
- } else {
- elemPtr->fillPts = clipPts;
- elemPtr->nFillPts = np;
- }
-}
-
-static void
-ResetLine(LineElement *elemPtr)
-{
- FreeTraces(elemPtr);
- ResetStylePalette(elemPtr->styles);
- if (elemPtr->symbolPts.points != NULL) {
- Blt_Free(elemPtr->symbolPts.points);
- }
- if (elemPtr->symbolPts.map != NULL) {
- Blt_Free(elemPtr->symbolPts.map);
- }
- if (elemPtr->lines.segments != NULL) {
- Blt_Free(elemPtr->lines.segments);
- }
- if (elemPtr->lines.map != NULL) {
- Blt_Free(elemPtr->lines.map);
- }
- if (elemPtr->activePts.points != NULL) {
- Blt_Free(elemPtr->activePts.points);
- }
- if (elemPtr->activePts.map != NULL) {
- Blt_Free(elemPtr->activePts.map);
- }
- if (elemPtr->xeb.segments != NULL) {
- Blt_Free(elemPtr->xeb.segments);
- }
- if (elemPtr->xeb.map != NULL) {
- Blt_Free(elemPtr->xeb.map);
- }
- if (elemPtr->yeb.segments != NULL) {
- Blt_Free(elemPtr->yeb.segments);
- }
- if (elemPtr->yeb.map != NULL) {
- Blt_Free(elemPtr->yeb.map);
- }
- elemPtr->xeb.segments = elemPtr->yeb.segments = elemPtr->lines.segments = NULL;
- elemPtr->symbolPts.points = elemPtr->activePts.points = NULL;
- elemPtr->lines.map = elemPtr->symbolPts.map = elemPtr->xeb.map =
- elemPtr->yeb.map = elemPtr->activePts.map = NULL;
- elemPtr->activePts.length = elemPtr->symbolPts.length =
- elemPtr->lines.length = elemPtr->xeb.length = elemPtr->yeb.length = 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapErrorBars --
- *
- * Creates two arrays of points and pen indices, filled with the screen
- * coordinates of the visible
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is freed and allocated for the index array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapErrorBars(Graph *graphPtr, LineElement *elemPtr, LineStyle **styleMap)
-{
- int n, np;
- Region2d exts;
-
- Blt_GraphExtents(graphPtr, &exts);
- np = NUMBEROFPOINTS(elemPtr);
- if (elemPtr->xError.nValues > 0) {
- n = MIN(elemPtr->xError.nValues, np);
- } else {
- n = MIN3(elemPtr->xHigh.nValues, elemPtr->xLow.nValues, np);
- }
- if (n > 0) {
- Segment2d *errorBars;
- Segment2d *segPtr;
- int *errorToData;
- int *indexPtr;
- int i;
-
- segPtr = errorBars = Blt_AssertMalloc(n * 3 * sizeof(Segment2d));
- indexPtr = errorToData = Blt_AssertMalloc(n * 3 * sizeof(int));
- for (i = 0; i < n; i++) {
- double x, y;
- double high, low;
- LineStyle *stylePtr;
-
- x = elemPtr->x.values[i];
- y = elemPtr->y.values[i];
- stylePtr = styleMap[i];
- if ((FINITE(x)) && (FINITE(y))) {
- if (elemPtr->xError.nValues > 0) {
- high = x + elemPtr->xError.values[i];
- low = x - elemPtr->xError.values[i];
- } else {
- high = elemPtr->xHigh.values[i];
- low = elemPtr->xLow.values[i];
- }
- if ((FINITE(high)) && (FINITE(low))) {
- Point2d p, q;
-
- p = Blt_Map2D(graphPtr, high, y, &elemPtr->axes);
- q = Blt_Map2D(graphPtr, low, y, &elemPtr->axes);
- segPtr->p = p;
- segPtr->q = q;
- if (Blt_LineRectClip(&exts, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- /* Left cap */
- segPtr->p.x = segPtr->q.x = p.x;
- segPtr->p.y = p.y - stylePtr->errorBarCapWidth;
- segPtr->q.y = p.y + stylePtr->errorBarCapWidth;
- if (Blt_LineRectClip(&exts, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- /* Right cap */
- segPtr->p.x = segPtr->q.x = q.x;
- segPtr->p.y = q.y - stylePtr->errorBarCapWidth;
- segPtr->q.y = q.y + stylePtr->errorBarCapWidth;
- if (Blt_LineRectClip(&exts, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- }
- }
- }
- elemPtr->xeb.segments = errorBars;
- elemPtr->xeb.length = segPtr - errorBars;
- elemPtr->xeb.map = errorToData;
- }
- if (elemPtr->yError.nValues > 0) {
- n = MIN(elemPtr->yError.nValues, np);
- } else {
- n = MIN3(elemPtr->yHigh.nValues, elemPtr->yLow.nValues, np);
- }
- if (n > 0) {
- Segment2d *errorBars;
- Segment2d *segPtr;
- int *errorToData;
- int *indexPtr;
- int i;
-
- segPtr = errorBars = Blt_AssertMalloc(n * 3 * sizeof(Segment2d));
- indexPtr = errorToData = Blt_AssertMalloc(n * 3 * sizeof(int));
- for (i = 0; i < n; i++) {
- double x, y;
- double high, low;
- LineStyle *stylePtr;
-
- x = elemPtr->x.values[i];
- y = elemPtr->y.values[i];
- stylePtr = styleMap[i];
- if ((FINITE(x)) && (FINITE(y))) {
- if (elemPtr->yError.nValues > 0) {
- high = y + elemPtr->yError.values[i];
- low = y - elemPtr->yError.values[i];
- } else {
- high = elemPtr->yHigh.values[i];
- low = elemPtr->yLow.values[i];
- }
- if ((FINITE(high)) && (FINITE(low))) {
- Point2d p, q;
-
- p = Blt_Map2D(graphPtr, x, high, &elemPtr->axes);
- q = Blt_Map2D(graphPtr, x, low, &elemPtr->axes);
- segPtr->p = p;
- segPtr->q = q;
- if (Blt_LineRectClip(&exts, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- /* Top cap. */
- segPtr->p.y = segPtr->q.y = p.y;
- segPtr->p.x = p.x - stylePtr->errorBarCapWidth;
- segPtr->q.x = p.x + stylePtr->errorBarCapWidth;
- if (Blt_LineRectClip(&exts, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- /* Bottom cap. */
- segPtr->p.y = segPtr->q.y = q.y;
- segPtr->p.x = q.x - stylePtr->errorBarCapWidth;
- segPtr->q.x = q.x + stylePtr->errorBarCapWidth;
- if (Blt_LineRectClip(&exts, &segPtr->p, &segPtr->q)) {
- segPtr++;
- *indexPtr++ = i;
- }
- }
- }
- }
- elemPtr->yeb.segments = errorBars;
- elemPtr->yeb.length = segPtr - errorBars;
- elemPtr->yeb.map = errorToData;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapLineProc --
- *
- * Calculates the actual window coordinates of the line element. The
- * window coordinates are saved in an allocated point array.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is (re)allocated for the point array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapLineProc(Graph *graphPtr, Element *basePtr)
-{
- LineElement *elemPtr = (LineElement *)basePtr;
- MapInfo mi;
- int size, np;
- LineStyle **styleMap;
- Blt_ChainLink link;
-
- ResetLine(elemPtr);
- np = NUMBEROFPOINTS(elemPtr);
- if (np < 1) {
- return; /* No data points */
- }
- GetScreenPoints(graphPtr, elemPtr, &mi);
- MapSymbols(graphPtr, elemPtr, &mi);
-
- if ((elemPtr->flags & ACTIVE_PENDING) && (elemPtr->nActiveIndices > 0)) {
- MapActiveSymbols(graphPtr, elemPtr);
- }
- /*
- * Map connecting line segments if they are to be displayed.
- */
- elemPtr->smooth = elemPtr->reqSmooth;
- if ((np > 1) && ((graphPtr->classId == CID_ELEM_STRIP) ||
- (elemPtr->builtinPen.traceWidth > 0))) {
- /*
- * Do smoothing if necessary. This can extend the coordinate array,
- * so both mi.points and mi.nPoints may change.
- */
- switch (elemPtr->smooth) {
- case PEN_SMOOTH_STEP:
- GenerateSteps(&mi);
- break;
-
- case PEN_SMOOTH_NATURAL:
- case PEN_SMOOTH_QUADRATIC:
- if (mi.nScreenPts < 3) {
- /* Can't interpolate with less than three points. */
- elemPtr->smooth = PEN_SMOOTH_LINEAR;
- } else {
- GenerateSpline(graphPtr, elemPtr, &mi);
- }
- break;
-
- case PEN_SMOOTH_CATROM:
- if (mi.nScreenPts < 3) {
- /* Can't interpolate with less than three points. */
- elemPtr->smooth = PEN_SMOOTH_LINEAR;
- } else {
- GenerateParametricSpline(graphPtr, elemPtr, &mi);
- }
- break;
-
- default:
- break;
- }
- if (elemPtr->rTolerance > 0.0) {
- ReducePoints(&mi, elemPtr->rTolerance);
- }
- if (elemPtr->fillBg != NULL) {
- MapFillArea(graphPtr, elemPtr, &mi);
- }
- if (graphPtr->classId == CID_ELEM_STRIP) {
- MapStrip(graphPtr, elemPtr, &mi);
- } else {
- MapTraces(graphPtr, elemPtr, &mi);
- }
- }
- Blt_Free(mi.screenPts);
- Blt_Free(mi.map);
-
- /* Set the symbol size of all the pen styles. */
- for (link = Blt_Chain_FirstLink(elemPtr->styles); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- LineStyle *stylePtr;
- LinePen *penPtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- penPtr = (LinePen *)stylePtr->penPtr;
- size = ScaleSymbol(elemPtr, penPtr->symbol.size);
- stylePtr->symbolSize = size;
- stylePtr->errorBarCapWidth = (penPtr->errorBarCapWidth > 0)
- ? penPtr->errorBarCapWidth : Round(size * 0.6666666);
- stylePtr->errorBarCapWidth /= 2;
- }
- styleMap = (LineStyle **)Blt_StyleMap((Element *)elemPtr);
- if (((elemPtr->yHigh.nValues > 0) && (elemPtr->yLow.nValues > 0)) ||
- ((elemPtr->xHigh.nValues > 0) && (elemPtr->xLow.nValues > 0)) ||
- (elemPtr->xError.nValues > 0) || (elemPtr->yError.nValues > 0)) {
- MapErrorBars(graphPtr, elemPtr, styleMap);
- }
- MergePens(elemPtr, styleMap);
- Blt_Free(styleMap);
-}
-
-static double
-DistanceToLineProc(
- int x, int y, /* Sample X-Y coordinate. */
- Point2d *p, Point2d *q, /* End points of the line segment. */
- Point2d *t) /* (out) Point on line segment. */
-{
- double right, left, top, bottom;
-
- *t = Blt_GetProjection(x, y, p, q);
- if (p->x > q->x) {
- right = p->x, left = q->x;
- } else {
- left = p->x, right = q->x;
- }
- if (p->y > q->y) {
- bottom = p->y, top = q->y;
- } else {
- top = p->y, bottom = q->y;
- }
- if (t->x > right) {
- t->x = right;
- } else if (t->x < left) {
- t->x = left;
- }
- if (t->y > bottom) {
- t->y = bottom;
- } else if (t->y < top) {
- t->y = top;
- }
- return hypot((t->x - x), (t->y - y));
-}
-
-static double
-DistanceToXProc(
- int x, int y, /* Search X-Y coordinate. */
- Point2d *p,
- Point2d *q, /* End points of the line segment. */
- Point2d *t) /* (out) Point on line segment. */
-{
- double dx, dy;
- double d;
-
- if (p->x > q->x) {
- if ((x > p->x) || (x < q->x)) {
- return DBL_MAX; /* X-coordinate outside line segment. */
- }
- } else {
- if ((x > q->x) || (x < p->x)) {
- return DBL_MAX; /* X-coordinate outside line segment. */
- }
- }
- dx = p->x - q->x;
- dy = p->y - q->y;
- t->x = (double)x;
- if (FABS(dx) < DBL_EPSILON) {
- double d1, d2;
- /*
- * Same X-coordinate indicates a vertical line. Pick the closest end
- * point.
- */
- d1 = p->y - y;
- d2 = q->y - y;
- if (FABS(d1) < FABS(d2)) {
- t->y = p->y, d = d1;
- } else {
- t->y = q->y, d = d2;
- }
- } else if (FABS(dy) < DBL_EPSILON) {
- /* Horizontal line. */
- t->y = p->y, d = p->y - y;
- } else {
- double m, b;
-
- m = dy / dx;
- b = p->y - (m * p->x);
- t->y = (x * m) + b;
- d = y - t->y;
- }
- return FABS(d);
-}
-
-static double
-DistanceToYProc(
- int x, int y, /* Search X-Y coordinate. */
- Point2d *p, Point2d *q, /* End points of the line segment. */
- Point2d *t) /* (out) Point on line segment. */
-{
- double dx, dy;
- double d;
-
- if (p->y > q->y) {
- if ((y > p->y) || (y < q->y)) {
- return DBL_MAX;
- }
- } else {
- if ((y > q->y) || (y < p->y)) {
- return DBL_MAX;
- }
- }
- dx = p->x - q->x;
- dy = p->y - q->y;
- t->y = y;
- if (FABS(dy) < DBL_EPSILON) {
- double d1, d2;
-
- /* Save Y-coordinate indicates an horizontal line. Pick the closest end
- * point. */
- d1 = p->x - x;
- d2 = q->x - x;
- if (FABS(d1) < FABS(d2)) {
- t->x = p->x, d = d1;
- } else {
- t->x = q->x, d = d2;
- }
- } else if (FABS(dx) < DBL_EPSILON) {
- /* Vertical line. */
- t->x = p->x, d = p->x - x;
- } else {
- double m, b;
-
- m = dy / dx;
- b = p->y - (m * p->x);
- t->x = (y - b) / m;
- d = x - t->x;
- }
- return FABS(d);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClosestTrace --
- *
- * Find the line segment closest to the given window coordinate in the
- * element.
- *
- * Results:
- * If a new minimum distance is found, the information regarding it is
- * returned via searchPtr.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ClosestTrace(
- Graph *graphPtr, /* Graph widget record */
- LineElement *elemPtr,
- ClosestSearch *searchPtr, /* Info about closest point in
- * element */
- DistanceProc *distProc)
-{
- Blt_ChainLink link;
- Point2d closest;
- double dMin;
- int iClose;
-
- iClose = -1; /* Suppress compiler warning. */
- dMin = searchPtr->dist;
- closest.x = closest.y = 0; /* Suppress compiler warning. */
- for (link = Blt_Chain_FirstLink(elemPtr->traces); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Trace *tracePtr;
- Point2d *p, *pend;
-
- tracePtr = Blt_Chain_GetValue(link);
- for (p = tracePtr->screenPts.points,
- pend = p + (tracePtr->screenPts.length - 1); p < pend; p++) {
- Point2d b;
- double d;
-
- d = (*distProc)(searchPtr->x, searchPtr->y, p, p + 1, &b);
- if (d < dMin) {
- closest = b;
- iClose = tracePtr->screenPts.map[p-tracePtr->screenPts.points];
- dMin = d;
- }
- }
- }
- if (dMin < searchPtr->dist) {
- searchPtr->dist = dMin;
- searchPtr->elemPtr = (Element *)elemPtr;
- searchPtr->index = iClose;
- searchPtr->point = Blt_InvMap2D(graphPtr, closest.x, closest.y,
- &elemPtr->axes);
- return TRUE;
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClosestStrip --
- *
- * Find the line segment closest to the given window coordinate in the
- * element.
- *
- * Results:
- * If a new minimum distance is found, the information regarding it is
- * returned via searchPtr.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ClosestStrip(
- Graph *graphPtr, /* Graph widget record */
- LineElement *elemPtr, /* Line element record */
- ClosestSearch *searchPtr, /* Info about closest point in
- * element */
- DistanceProc *distProc)
-{
- Point2d closest;
- double dMin;
- int count;
- int iClose;
- Segment2d *sp;
-
- iClose = 0;
- dMin = searchPtr->dist;
- closest.x = closest.y = 0;
- for (sp = elemPtr->lines.segments, count = 0;
- count < elemPtr->lines.length; count++, sp++) {
- double d;
- Point2d b;
-
- d = (*distProc)(searchPtr->x, searchPtr->y, &sp->p, &sp->q, &b);
- if (d < dMin) {
- closest = b;
- iClose = elemPtr->lines.map[count];
- dMin = d;
- }
- }
- if (dMin < searchPtr->dist) {
- searchPtr->dist = dMin;
- searchPtr->elemPtr = (Element *)elemPtr;
- searchPtr->index = iClose;
- searchPtr->point = Blt_InvMap2D(graphPtr, closest.x, closest.y,
- &elemPtr->axes);
- return TRUE;
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClosestPoint --
- *
- * Find the element whose data point is closest to the given screen
- * coordinate.
- *
- * Results:
- * If a new minimum distance is found, the information regarding
- * it is returned via searchPtr.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ClosestPoint(
- LineElement *elemPtr, /* Line element to be searched. */
- ClosestSearch *searchPtr) /* Assorted information related to
- * searching for the closest point */
-{
- double dMin;
- int count, iClose;
- Point2d *pp;
-
- dMin = searchPtr->dist;
- iClose = 0;
-
- /*
- * Instead of testing each data point in graph coordinates, look at the
- * array of mapped screen coordinates. The advantages are
- * 1) only examine points that are visible (unclipped), and
- * 2) the computed distance is already in screen coordinates.
- */
- for (pp = elemPtr->symbolPts.points, count = 0;
- count < elemPtr->symbolPts.length; count++, pp++) {
- double dx, dy;
- double d;
-
- dx = (double)(searchPtr->x - pp->x);
- dy = (double)(searchPtr->y - pp->y);
- if (searchPtr->along == SEARCH_BOTH) {
- d = hypot(dx, dy);
- } else if (searchPtr->along == SEARCH_X) {
- d = dx;
- } else if (searchPtr->along == SEARCH_Y) {
- d = dy;
- } else {
- /* This can't happen */
- continue;
- }
- if (d < dMin) {
- iClose = elemPtr->symbolPts.map[count];
- dMin = d;
- }
- }
- if (dMin < searchPtr->dist) {
- searchPtr->elemPtr = (Element *)elemPtr;
- searchPtr->dist = dMin;
- searchPtr->index = iClose;
- searchPtr->point.x = elemPtr->x.values[iClose];
- searchPtr->point.y = elemPtr->y.values[iClose];
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetLineExtentsProc --
- *
- * Retrieves the range of the line element
- *
- * Results:
- * Returns the number of data points in the element.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GetLineExtentsProc(Element *basePtr, Region2d *extsPtr)
-{
- LineElement *elemPtr = (LineElement *)basePtr;
- int np;
-
- extsPtr->top = extsPtr->left = DBL_MAX;
- extsPtr->bottom = extsPtr->right = -DBL_MAX;
-
- np = NUMBEROFPOINTS(elemPtr);
- if (np < 1) {
- return;
- }
- extsPtr->right = elemPtr->x.max;
- if ((elemPtr->x.min <= 0.0) && (elemPtr->axes.x->logScale)) {
- extsPtr->left = Blt_FindElemValuesMinimum(&elemPtr->x, DBL_MIN);
- } else {
- extsPtr->left = elemPtr->x.min;
- }
- extsPtr->bottom = elemPtr->y.max;
- if ((elemPtr->y.min <= 0.0) && (elemPtr->axes.y->logScale)) {
- extsPtr->top = Blt_FindElemValuesMinimum(&elemPtr->y, DBL_MIN);
- } else {
- extsPtr->top = elemPtr->y.min;
- }
-
- /* Correct the data limits for error bars */
-
- if (elemPtr->xError.nValues > 0) {
- int i;
-
- np = MIN(elemPtr->xError.nValues, np);
- for (i = 0; i < np; i++) {
- double x;
-
- x = elemPtr->x.values[i] + elemPtr->xError.values[i];
- if (x > extsPtr->right) {
- extsPtr->right = x;
- }
- x = elemPtr->x.values[i] - elemPtr->xError.values[i];
- if (elemPtr->axes.x->logScale) {
- if (x < 0.0) {
- x = -x; /* Mirror negative values, instead of
- * ignoring them. */
- }
- if ((x > DBL_MIN) && (x < extsPtr->left)) {
- extsPtr->left = x;
- }
- } else if (x < extsPtr->left) {
- extsPtr->left = x;
- }
- }
- } else {
- if ((elemPtr->xHigh.nValues > 0) &&
- (elemPtr->xHigh.max > extsPtr->right)) {
- extsPtr->right = elemPtr->xHigh.max;
- }
- if (elemPtr->xLow.nValues > 0) {
- double left;
-
- if ((elemPtr->xLow.min <= 0.0) &&
- (elemPtr->axes.x->logScale)) {
- left = Blt_FindElemValuesMinimum(&elemPtr->xLow, DBL_MIN);
- } else {
- left = elemPtr->xLow.min;
- }
- if (left < extsPtr->left) {
- extsPtr->left = left;
- }
- }
- }
-
- if (elemPtr->yError.nValues > 0) {
- int i;
-
- np = MIN(elemPtr->yError.nValues, np);
- for (i = 0; i < np; i++) {
- double y;
-
- y = elemPtr->y.values[i] + elemPtr->yError.values[i];
- if (y > extsPtr->bottom) {
- extsPtr->bottom = y;
- }
- y = elemPtr->y.values[i] - elemPtr->yError.values[i];
- if (elemPtr->axes.y->logScale) {
- if (y < 0.0) {
- y = -y; /* Mirror negative values, instead of
- * ignoring them. */
- }
- if ((y > DBL_MIN) && (y < extsPtr->left)) {
- extsPtr->top = y;
- }
- } else if (y < extsPtr->top) {
- extsPtr->top = y;
- }
- }
- } else {
- if ((elemPtr->yHigh.nValues > 0) &&
- (elemPtr->yHigh.max > extsPtr->bottom)) {
- extsPtr->bottom = elemPtr->yHigh.max;
- }
- if (elemPtr->yLow.nValues > 0) {
- double top;
-
- if ((elemPtr->yLow.min <= 0.0) &&
- (elemPtr->axes.y->logScale)) {
- top = Blt_FindElemValuesMinimum(&elemPtr->yLow, DBL_MIN);
- } else {
- top = elemPtr->yLow.min;
- }
- if (top < extsPtr->top) {
- extsPtr->top = top;
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BackgroundChangedProc
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-BackgroundChangedProc(ClientData clientData)
-{
- Element *elemPtr = clientData;
- Graph *graphPtr;
-
- graphPtr = elemPtr->obj.graphPtr;
- if (graphPtr->tkwin != NULL) {
- graphPtr->flags |= REDRAW_WORLD;
- Blt_EventuallyRedrawGraph(graphPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureLineProc --
- *
- * Sets up the appropriate configuration parameters in the GC. It is
- * assumed the parameters have been previously set by a call to
- * Blt_ConfigureWidget.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result contains an error message.
- *
- * Side effects:
- * Configuration information such as line width, line style, color
- * etc. get set in a new GC.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ConfigureLineProc(Graph *graphPtr, Element *basePtr)
-{
- LineElement *elemPtr = (LineElement *)basePtr;
- unsigned long gcMask;
- XGCValues gcValues;
- GC newGC;
- Blt_ChainLink link;
- LineStyle *stylePtr;
-
- if (ConfigurePenProc(graphPtr, (Pen *)&elemPtr->builtinPen) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Point to the static normal/active pens if no external pens have been
- * selected.
- */
- link = Blt_Chain_FirstLink(elemPtr->styles);
- if (link == NULL) {
- link = Blt_Chain_AllocLink(sizeof(LineStyle));
- Blt_Chain_LinkAfter(elemPtr->styles, link, NULL);
- }
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->penPtr = NORMALPEN(elemPtr);
-
- if (elemPtr->fillBg != NULL) {
- Blt_SetBackgroundChangedProc(elemPtr->fillBg, BackgroundChangedProc,
- elemPtr);
- }
- /*
- * Set the outline GC for this pen: GCForeground is outline color.
- * GCBackground is the fill color (only used for bitmap symbols).
- */
- gcMask = 0;
- if (elemPtr->fillFgColor != NULL) {
- gcMask |= GCForeground;
- gcValues.foreground = elemPtr->fillFgColor->pixel;
- }
- if (elemPtr->fillBgColor != NULL) {
- gcMask |= GCBackground;
- gcValues.background = elemPtr->fillBgColor->pixel;
- }
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (elemPtr->fillGC != NULL) {
- Tk_FreeGC(graphPtr->display, elemPtr->fillGC);
- }
- elemPtr->fillGC = newGC;
-
- if (Blt_ConfigModified(elemPtr->configSpecs, "-scalesymbols",
- (char *)NULL)) {
- elemPtr->flags |= (MAP_ITEM | SCALE_SYMBOL);
- }
- if (Blt_ConfigModified(elemPtr->configSpecs, "-pixels", "-trace",
- "-*data", "-smooth", "-map*", "-label", "-hide", "-x", "-y",
- "-areabackground", (char *)NULL)) {
- elemPtr->flags |= MAP_ITEM;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClosestLineProc --
- *
- * Find the closest point or line segment (if interpolated) to the given
- * window coordinate in the line element.
- *
- * Results:
- * Returns the distance of the closest point among other information.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ClosestLineProc(Graph *graphPtr, Element *basePtr, ClosestSearch *searchPtr)
-{
- LineElement *elemPtr = (LineElement *)basePtr;
- int mode;
-
- mode = searchPtr->mode;
- if (mode == SEARCH_AUTO) {
- LinePen *penPtr;
-
- penPtr = NORMALPEN(elemPtr);
- mode = SEARCH_POINTS;
- if ((NUMBEROFPOINTS(elemPtr) > 1) && (penPtr->traceWidth > 0)) {
- mode = SEARCH_TRACES;
- }
- }
- if (mode == SEARCH_POINTS) {
- ClosestPoint(elemPtr, searchPtr);
- } else {
- DistanceProc *distProc;
- int found;
-
- if (searchPtr->along == SEARCH_X) {
- distProc = DistanceToXProc;
- } else if (searchPtr->along == SEARCH_Y) {
- distProc = DistanceToYProc;
- } else {
- distProc = DistanceToLineProc;
- }
- if (elemPtr->obj.classId == CID_ELEM_STRIP) {
- found = ClosestStrip(graphPtr, elemPtr, searchPtr, distProc);
- } else {
- found = ClosestTrace(graphPtr, elemPtr, searchPtr, distProc);
- }
- if ((!found) && (searchPtr->along != SEARCH_BOTH)) {
- ClosestPoint(elemPtr, searchPtr);
- }
- }
-}
-
-/*
- * XDrawLines() points: XMaxRequestSize(dpy) - 3
- * XFillPolygon() points: XMaxRequestSize(dpy) - 4
- * XDrawSegments() segments: (XMaxRequestSize(dpy) - 3) / 2
- * XDrawRectangles() rectangles: (XMaxRequestSize(dpy) - 3) / 2
- * XFillRectangles() rectangles: (XMaxRequestSize(dpy) - 3) / 2
- * XDrawArcs() or XFillArcs() arcs: (XMaxRequestSize(dpy) - 3) / 3
- */
-
-#define MAX_DRAWLINES(d) Blt_MaxRequestSize(d, sizeof(XPoint))
-#define MAX_DRAWPOLYGON(d) Blt_MaxRequestSize(d, sizeof(XPoint))
-#define MAX_DRAWSEGMENTS(d) Blt_MaxRequestSize(d, sizeof(XSegment))
-#define MAX_DRAWRECTANGLES(d) Blt_MaxRequestSize(d, sizeof(XRectangle))
-#define MAX_DRAWARCS(d) Blt_MaxRequestSize(d, sizeof(XArc))
-
-#ifdef WIN32
-
-static void
-DrawCircles(
- Display *display,
- Drawable drawable,
- LineElement *elemPtr,
- LinePen *penPtr,
- int nSymbolPts,
- Point2d *symbolPts,
- int radius)
-{
- HBRUSH brush, oldBrush;
- HPEN pen, oldPen;
- HDC dc;
- TkWinDCState state;
-
- if (drawable == None) {
- return; /* Huh? */
- }
- if ((penPtr->symbol.fillGC == NULL) &&
- (penPtr->symbol.outlineWidth == 0)) {
- return;
- }
- dc = TkWinGetDrawableDC(display, drawable, &state);
- /* SetROP2(dc, tkpWinRopModes[penPtr->symbol.fillGC->function]); */
- if (penPtr->symbol.fillGC != NULL) {
- brush = CreateSolidBrush(penPtr->symbol.fillGC->foreground);
- } else {
- brush = GetStockBrush(NULL_BRUSH);
- }
- if (penPtr->symbol.outlineWidth > 0) {
- pen = Blt_GCToPen(dc, penPtr->symbol.outlineGC);
- } else {
- pen = GetStockPen(NULL_PEN);
- }
- oldPen = SelectPen(dc, pen);
- oldBrush = SelectBrush(dc, brush);
- {
- Point2d *pp, *pend;
-
- for (pp = symbolPts, pend = pp + nSymbolPts; pp < pend; pp++) {
- int rndx, rndy;
- rndx = Round(pp->x), rndy = Round(pp->y);
- Ellipse(dc, rndx - radius, rndy - radius, rndx + radius + 1,
- rndy + radius + 1);
- }
- }
- DeleteBrush(SelectBrush(dc, oldBrush));
- DeletePen(SelectPen(dc, oldPen));
- TkWinReleaseDrawableDC(drawable, dc, &state);
-}
-
-#else
-
-static void
-DrawCircles(Display *display, Drawable drawable, LineElement *elemPtr,
- LinePen *penPtr, int nSymbolPts, Point2d *symbolPts, int radius)
-{
- int i;
- XArc *arcs; /* Array of arcs (circle) */
- int reqSize;
- int s;
- int count;
-
- s = radius + radius;
- arcs = Blt_AssertMalloc(nSymbolPts * sizeof(XArc));
-
- if (elemPtr->symbolInterval > 0) {
- Point2d *pp, *pend;
- XArc *ap;
-
- ap = arcs;
- count = 0;
- for (pp = symbolPts, pend = pp + nSymbolPts; pp < pend; pp++) {
- if (DRAW_SYMBOL(elemPtr)) {
- ap->x = Round(pp->x) - radius;
- ap->y = Round(pp->y) - radius;
- ap->width = ap->height = (unsigned short)s;
- ap->angle1 = 0;
- ap->angle2 = 23040;
- ap++, count++;
- }
- elemPtr->symbolCounter++;
- }
- } else {
- Point2d *pp, *pend;
- XArc *ap;
-
- ap = arcs;
- for (pp = symbolPts, pend = pp + nSymbolPts; pp < pend; pp++) {
- ap->x = Round(pp->x) - radius;
- ap->y = Round(pp->y) - radius;
- ap->width = ap->height = (unsigned short)s;
- ap->angle1 = 0;
- ap->angle2 = 23040;
- ap++;
- }
- count = nSymbolPts;
- }
- reqSize = MAX_DRAWARCS(display);
- for (i = 0; i < count; i += reqSize) {
- int n;
-
- n = ((i + reqSize) > count) ? (count - i) : reqSize;
- if (penPtr->symbol.fillGC != NULL) {
- XFillArcs(display, drawable, penPtr->symbol.fillGC, arcs + i, n);
- }
- if (penPtr->symbol.outlineWidth > 0) {
- XDrawArcs(display, drawable, penPtr->symbol.outlineGC, arcs + i, n);
- }
- }
- Blt_Free(arcs);
-}
-
-#endif
-
-static void
-DrawSquares(Display *display, Drawable drawable, LineElement *elemPtr,
- LinePen *penPtr, int nSymbolPts, Point2d *symbolPts, int r)
-{
- XRectangle *rectangles;
- XRectangle *rp, *rend;
- int reqSize;
- int s, count;
-
- s = r + r;
- rectangles = Blt_AssertMalloc(nSymbolPts * sizeof(XRectangle));
- if (elemPtr->symbolInterval > 0) {
- Point2d *pp, *pend;
- XRectangle *rp;
-
- count = 0;
- rp = rectangles;
- for (pp = symbolPts, pend = pp + nSymbolPts; pp < pend; pp++) {
- if (DRAW_SYMBOL(elemPtr)) {
- rp->x = Round(pp->x) - r;
- rp->y = Round(pp->y) - r;
- rp->width = rp->height = (unsigned short)s;
- rp++, count++;
- }
- elemPtr->symbolCounter++;
- }
- } else {
- Point2d *pp, *pend;
- XRectangle *rp;
-
- rp = rectangles;
- for (pp = symbolPts, pend = pp + nSymbolPts; pp < pend; pp++) {
- rp->x = Round(pp->x) - r;
- rp->y = Round(pp->y) - r;
- rp->width = rp->height = (unsigned short)s;
- rp++;
- }
- count = nSymbolPts;
- }
- reqSize = MAX_DRAWRECTANGLES(display) - 3;
- for (rp = rectangles, rend = rp + count; rp < rend; rp += reqSize) {
- int n;
-
- n = rend - rp;
- if (n > reqSize) {
- n = reqSize;
- }
- if (penPtr->symbol.fillGC != NULL) {
- XFillRectangles(display, drawable, penPtr->symbol.fillGC, rp, n);
- }
- if (penPtr->symbol.outlineWidth > 0) {
- XDrawRectangles(display, drawable, penPtr->symbol.outlineGC, rp, n);
- }
- }
- Blt_Free(rectangles);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawSymbols --
- *
- * Draw the symbols centered at the each given x,y coordinate in the array
- * of points.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Draws a symbol at each coordinate given. If active, only those
- * coordinates which are currently active are drawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawSymbols(
- Graph *graphPtr, /* Graph widget record */
- Drawable drawable, /* Pixmap or window to draw into */
- LineElement *elemPtr,
- LinePen *penPtr,
- int size, /* Size of element */
- int nSymbolPts, /* Number of coordinates in array */
- Point2d *symbolPts) /* Array of x,y coordinates for line */
-{
- XPoint pattern[13]; /* Template for polygon symbols */
- int r1, r2;
- int count;
-#define SQRT_PI 1.77245385090552
-#define S_RATIO 0.886226925452758
-
- if (size < 3) {
- if (penPtr->symbol.fillGC != NULL) {
- Point2d *pp, *endp;
- XPoint *points, *xpp;
-
- xpp = points = Blt_AssertMalloc(nSymbolPts * sizeof(XPoint));
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- xpp->x = Round(pp->x);
- xpp->y = Round(pp->y);
- xpp++;
- }
- XDrawPoints(graphPtr->display, drawable, penPtr->symbol.fillGC,
- points, nSymbolPts, CoordModeOrigin);
- Blt_Free(points);
- }
- return;
- }
- r1 = (int)ceil(size * 0.5);
- r2 = (int)ceil(size * S_RATIO * 0.5);
-
- switch (penPtr->symbol.type) {
- case SYMBOL_NONE:
- break;
-
- case SYMBOL_SQUARE:
- DrawSquares(graphPtr->display, drawable, elemPtr, penPtr, nSymbolPts,
- symbolPts, r2);
- break;
-
- case SYMBOL_CIRCLE:
- DrawCircles(graphPtr->display, drawable, elemPtr, penPtr, nSymbolPts,
- symbolPts, r1);
- break;
-
- case SYMBOL_SPLUS:
- case SYMBOL_SCROSS:
- {
- XSegment *segments; /* Array of line segments (splus,
- * scross) */
- int i;
- int reqSize, nSegs;
-
- if (penPtr->symbol.type == SYMBOL_SCROSS) {
- r2 = Round((double)r2 * M_SQRT1_2);
- pattern[3].y = pattern[2].x = pattern[0].x = pattern[0].y = -r2;
- pattern[3].x = pattern[2].y = pattern[1].y = pattern[1].x = r2;
- } else {
- pattern[0].y = pattern[1].y = pattern[2].x = pattern[3].x = 0;
- pattern[0].x = pattern[2].y = -r2;
- pattern[1].x = pattern[3].y = r2;
- }
- segments = Blt_AssertMalloc(nSymbolPts * 2 * sizeof(XSegment));
- if (elemPtr->symbolInterval > 0) {
- Point2d *pp, *endp;
- XSegment *sp;
-
- sp = segments;
- count = 0;
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- if (DRAW_SYMBOL(elemPtr)) {
- int rndx, rndy;
- rndx = Round(pp->x), rndy = Round(pp->y);
- sp->x1 = pattern[0].x + rndx;
- sp->y1 = pattern[0].y + rndy;
- sp->x2 = pattern[1].x + rndx;
- sp->y2 = pattern[1].y + rndy;
- sp++;
- sp->x1 = pattern[2].x + rndx;
- sp->y1 = pattern[2].y + rndy;
- sp->x2 = pattern[3].x + rndx;
- sp->y2 = pattern[3].y + rndy;
- sp++;
- count++;
- }
- elemPtr->symbolCounter++;
- }
- } else {
- Point2d *pp, *endp;
- XSegment *sp;
-
- sp = segments;
- count = nSymbolPts;
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- int rndx, rndy;
- rndx = Round(pp->x), rndy = Round(pp->y);
- sp->x1 = pattern[0].x + rndx;
- sp->y1 = pattern[0].y + rndy;
- sp->x2 = pattern[1].x + rndx;
- sp->y2 = pattern[1].y + rndy;
- sp++;
- sp->x1 = pattern[2].x + rndx;
- sp->y1 = pattern[2].y + rndy;
- sp->x2 = pattern[3].x + rndx;
- sp->y2 = pattern[3].y + rndy;
- sp++;
- }
- }
- nSegs = count * 2;
- /* Always draw skinny symbols regardless of the outline width */
- reqSize = MAX_DRAWSEGMENTS(graphPtr->display);
- for (i = 0; i < nSegs; i += reqSize) {
- int chunk;
-
- chunk = ((i + reqSize) > nSegs) ? (nSegs - i) : reqSize;
- XDrawSegments(graphPtr->display, drawable,
- penPtr->symbol.outlineGC, segments + i, chunk);
- }
- Blt_Free(segments);
- }
- break;
-
- case SYMBOL_PLUS:
- case SYMBOL_CROSS:
- {
- XPoint *polygon;
- int d; /* Small delta for cross/plus
- * thickness */
-
- d = (r2 / 3);
-
- /*
- *
- * 2 3 The plus/cross symbol is a closed polygon
- * of 12 points. The diagram to the left
- * 0,12 1 4 5 represents the positions of the points
- * x,y which are computed below. The extra
- * 11 10 7 6 (thirteenth) point connects the first and
- * last points.
- * 9 8
- */
-
- pattern[0].x = pattern[11].x = pattern[12].x = -r2;
- pattern[2].x = pattern[1].x = pattern[10].x = pattern[9].x = -d;
- pattern[3].x = pattern[4].x = pattern[7].x = pattern[8].x = d;
- pattern[5].x = pattern[6].x = r2;
- pattern[2].y = pattern[3].y = -r2;
- pattern[0].y = pattern[1].y = pattern[4].y = pattern[5].y =
- pattern[12].y = -d;
- pattern[11].y = pattern[10].y = pattern[7].y = pattern[6].y = d;
- pattern[9].y = pattern[8].y = r2;
-
- if (penPtr->symbol.type == SYMBOL_CROSS) {
- int i;
-
- /* For the cross symbol, rotate the points by 45 degrees. */
- for (i = 0; i < 12; i++) {
- double dx, dy;
-
- dx = (double)pattern[i].x * M_SQRT1_2;
- dy = (double)pattern[i].y * M_SQRT1_2;
- pattern[i].x = Round(dx - dy);
- pattern[i].y = Round(dx + dy);
- }
- pattern[12] = pattern[0];
- }
- polygon = Blt_AssertMalloc(nSymbolPts * 13 * sizeof(XPoint));
- if (elemPtr->symbolInterval > 0) {
- Point2d *pp, *endp;
- XPoint *xpp;
-
- count = 0;
- xpp = polygon;
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- if (DRAW_SYMBOL(elemPtr)) {
- int i;
- int rndx, rndy;
-
- rndx = Round(pp->x), rndy = Round(pp->y);
- for (i = 0; i < 13; i++) {
- xpp->x = pattern[i].x + rndx;
- xpp->y = pattern[i].y + rndy;
- xpp++;
- }
- count++;
- }
- elemPtr->symbolCounter++;
- }
- } else {
- Point2d *pp, *endp;
- XPoint *xpp;
-
- xpp = polygon;
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- int i;
- int rndx, rndy;
-
- rndx = Round(pp->x), rndy = Round(pp->y);
- for (i = 0; i < 13; i++) {
- xpp->x = pattern[i].x + rndx;
- xpp->y = pattern[i].y + rndy;
- xpp++;
- }
- }
- count = nSymbolPts;
- }
- if (penPtr->symbol.fillGC != NULL) {
- int i;
- XPoint *xpp;
-
- for (xpp = polygon, i = 0; i < count; i++, xpp += 13) {
- XFillPolygon(graphPtr->display, drawable,
- penPtr->symbol.fillGC, xpp, 13, Complex,
- CoordModeOrigin);
- }
- }
- if (penPtr->symbol.outlineWidth > 0) {
- int i;
- XPoint *xpp;
-
- for (xpp = polygon, i = 0; i < count; i++, xpp += 13) {
- XDrawLines(graphPtr->display, drawable,
- penPtr->symbol.outlineGC, xpp, 13, CoordModeOrigin);
- }
- }
- Blt_Free(polygon);
- }
- break;
-
- case SYMBOL_DIAMOND:
- {
- XPoint *polygon;
-
- /*
- *
- * The plus symbol is a closed polygon
- * 1 of 4 points. The diagram to the left
- * represents the positions of the points
- * 0,4 x,y 2 which are computed below. The extra
- * (fifth) point connects the first and
- * 3 last points.
- *
- */
- pattern[1].y = pattern[0].x = -r1;
- pattern[2].y = pattern[3].x = pattern[0].y = pattern[1].x = 0;
- pattern[3].y = pattern[2].x = r1;
- pattern[4] = pattern[0];
-
- polygon = Blt_AssertMalloc(nSymbolPts * 5 * sizeof(XPoint));
- if (elemPtr->symbolInterval > 0) {
- Point2d *pp, *endp;
- XPoint *xpp;
-
- xpp = polygon;
- count = 0;
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- int i;
-
- if (DRAW_SYMBOL(elemPtr)) {
- int rndx, rndy;
-
- rndx = Round(pp->x), rndy = Round(pp->y);
- for (i = 0; i < 5; i++) {
- xpp->x = pattern[i].x + rndx;
- xpp->y = pattern[i].y + rndy;
- xpp++;
- }
- count++;
- }
- elemPtr->symbolCounter++;
- }
- } else {
- Point2d *pp, *endp;
- XPoint *xpp;
-
- xpp = polygon;
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- int i;
- int rndx, rndy;
-
- rndx = Round(pp->x), rndy = Round(pp->y);
- for (i = 0; i < 5; i++) {
- xpp->x = pattern[i].x + rndx;
- xpp->y = pattern[i].y + rndy;
- xpp++;
- }
- }
- count = nSymbolPts;
- }
- if (penPtr->symbol.fillGC != NULL) {
- XPoint *xpp;
- int i;
-
- for (xpp = polygon, i = 0; i < count; i++, xpp += 5) {
- XFillPolygon(graphPtr->display, drawable,
- penPtr->symbol.fillGC, xpp, 5, Convex, CoordModeOrigin);
-
- }
- }
- if (penPtr->symbol.outlineWidth > 0) {
- XPoint *xpp;
- int i;
-
- for (xpp = polygon, i = 0; i < count; i++, xpp += 5) {
- XDrawLines(graphPtr->display, drawable,
- penPtr->symbol.outlineGC, xpp, 5, CoordModeOrigin);
- }
- }
- Blt_Free(polygon);
- }
- break;
-
- case SYMBOL_TRIANGLE:
- case SYMBOL_ARROW:
- {
- XPoint *polygon;
- double b;
- int b2, h1, h2;
-#define H_RATIO 1.1663402261671607
-#define B_RATIO 1.3467736870885982
-#define TAN30 0.57735026918962573
-#define COS30 0.86602540378443871
-
- b = Round(size * B_RATIO * 0.7);
- b2 = Round(b * 0.5);
- h2 = Round(TAN30 * b2);
- h1 = Round(b2 / COS30);
- /*
- *
- * The triangle symbol is a closed polygon
- * 0,3 of 3 points. The diagram to the left
- * represents the positions of the points
- * x,y which are computed below. The extra
- * (fourth) point connects the first and
- * 2 1 last points.
- *
- */
-
- if (penPtr->symbol.type == SYMBOL_ARROW) {
- pattern[3].x = pattern[0].x = 0;
- pattern[3].y = pattern[0].y = h1;
- pattern[1].x = b2;
- pattern[2].y = pattern[1].y = -h2;
- pattern[2].x = -b2;
- } else {
- pattern[3].x = pattern[0].x = 0;
- pattern[3].y = pattern[0].y = -h1;
- pattern[1].x = b2;
- pattern[2].y = pattern[1].y = h2;
- pattern[2].x = -b2;
- }
- polygon = Blt_AssertMalloc(nSymbolPts * 4 * sizeof(XPoint));
- if (elemPtr->symbolInterval > 0) {
- Point2d *pp, *endp;
- XPoint *xpp;
-
- xpp = polygon;
- count = 0;
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- int i;
-
- if (DRAW_SYMBOL(elemPtr)) {
- int rndx, rndy;
-
- rndx = Round(pp->x), rndy = Round(pp->y);
- for (i = 0; i < 4; i++) {
- xpp->x = pattern[i].x + rndx;
- xpp->y = pattern[i].y + rndy;
- xpp++;
- }
- count++;
- }
- elemPtr->symbolCounter++;
- }
- } else {
- Point2d *pp, *endp;
- XPoint *xpp;
-
- xpp = polygon;
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- int i;
- int rndx, rndy;
-
- rndx = Round(pp->x), rndy = Round(pp->y);
- for (i = 0; i < 4; i++) {
- xpp->x = pattern[i].x + rndx;
- xpp->y = pattern[i].y + rndy;
- xpp++;
- }
- }
- count = nSymbolPts;
- }
- if (penPtr->symbol.fillGC != NULL) {
- XPoint *xpp;
- int i;
-
- xpp = polygon;
- for (xpp = polygon, i = 0; i < count; i++, xpp += 4) {
- XFillPolygon(graphPtr->display, drawable,
- penPtr->symbol.fillGC, xpp, 4, Convex, CoordModeOrigin);
- }
- }
- if (penPtr->symbol.outlineWidth > 0) {
- XPoint *xpp;
- int i;
-
- xpp = polygon;
- for (xpp = polygon, i = 0; i < count; i++, xpp += 4) {
- XDrawLines(graphPtr->display, drawable,
- penPtr->symbol.outlineGC, xpp, 4, CoordModeOrigin);
- }
- }
- Blt_Free(polygon);
- }
- break;
-
- case SYMBOL_IMAGE:
- {
- int w, h;
- int dx, dy;
-
- Tk_SizeOfImage(penPtr->symbol.image, &w, &h);
-
- dx = w / 2;
- dy = h / 2;
- if (elemPtr->symbolInterval > 0) {
- Point2d *pp, *endp;
-
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- if (DRAW_SYMBOL(elemPtr)) {
- int x, y;
-
- x = Round(pp->x) - dx;
- y = Round(pp->y) - dy;
- Tk_RedrawImage(penPtr->symbol.image, 0, 0, w, h,
- drawable, x, y);
- }
- elemPtr->symbolCounter++;
- }
- } else {
- Point2d *pp, *endp;
-
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- int x, y;
-
- x = Round(pp->x) - dx;
- y = Round(pp->y) - dy;
- Tk_RedrawImage(penPtr->symbol.image, 0, 0, w, h,
- drawable, x, y);
- }
- }
- }
- break;
-
- case SYMBOL_BITMAP:
- {
- Pixmap bitmap, mask;
- int w, h, bw, bh;
- double scale, sx, sy;
- int dx, dy;
-
- Tk_SizeOfBitmap(graphPtr->display, penPtr->symbol.bitmap, &w, &h);
- mask = None;
-
- /*
- * Compute the size of the scaled bitmap. Stretch the bitmap to fit
- * a nxn bounding box.
- */
- sx = (double)size / (double)w;
- sy = (double)size / (double)h;
- scale = MIN(sx, sy);
- bw = (int)(w * scale);
- bh = (int)(h * scale);
-
- XSetClipMask(graphPtr->display, penPtr->symbol.outlineGC, None);
- if (penPtr->symbol.mask != None) {
- mask = Blt_ScaleBitmap(graphPtr->tkwin, penPtr->symbol.mask,
- w, h, bw, bh);
- XSetClipMask(graphPtr->display, penPtr->symbol.outlineGC, mask);
- }
- bitmap = Blt_ScaleBitmap(graphPtr->tkwin, penPtr->symbol.bitmap,
- w, h, bw, bh);
- if (penPtr->symbol.fillGC == NULL) {
- XSetClipMask(graphPtr->display, penPtr->symbol.outlineGC,
- bitmap);
- }
- dx = bw / 2;
- dy = bh / 2;
- if (elemPtr->symbolInterval > 0) {
- Point2d *pp, *endp;
-
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- if (DRAW_SYMBOL(elemPtr)) {
- int x, y;
-
- x = Round(pp->x) - dx;
- y = Round(pp->y) - dy;
- if ((penPtr->symbol.fillGC == NULL) || (mask !=None)) {
- XSetClipOrigin(graphPtr->display,
- penPtr->symbol.outlineGC, x, y);
- }
- XCopyPlane(graphPtr->display, bitmap, drawable,
- penPtr->symbol.outlineGC, 0, 0, bw, bh, x, y, 1);
- }
- elemPtr->symbolCounter++;
- }
- } else {
- Point2d *pp, *endp;
-
- for (pp = symbolPts, endp = pp + nSymbolPts; pp < endp; pp++) {
- int x, y;
-
- x = Round(pp->x) - dx;
- y = Round(pp->y) - dy;
- if ((penPtr->symbol.fillGC == NULL) || (mask != None)) {
- XSetClipOrigin(graphPtr->display,
- penPtr->symbol.outlineGC, x, y);
- }
- XCopyPlane(graphPtr->display, bitmap, drawable,
- penPtr->symbol.outlineGC, 0, 0, bw, bh, x, y, 1);
- }
- }
- Tk_FreePixmap(graphPtr->display, bitmap);
- if (mask != None) {
- Tk_FreePixmap(graphPtr->display, mask);
- }
- }
- break;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawSymbolProc --
- *
- * Draw the symbol centered at the each given x,y coordinate.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Draws a symbol at the coordinate given.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawSymbolProc(
- Graph *graphPtr, /* Graph widget record */
- Drawable drawable, /* Pixmap or window to draw into */
- Element *basePtr, /* Line element information */
- int x, int y, /* Center position of symbol */
- int size) /* Size of symbol. */
-{
- LineElement *elemPtr = (LineElement *)basePtr;
- LinePen *penPtr;
-
- penPtr = NORMALPEN(elemPtr);
- if (penPtr->traceWidth > 0) {
- /*
- * Draw an extra line offset by one pixel from the previous to give a
- * thicker appearance. This is only for the legend entry. This routine
- * is never called for drawing the actual line segments.
- */
- XDrawLine(graphPtr->display, drawable, penPtr->traceGC, x - size, y,
- x + size, y);
- XDrawLine(graphPtr->display, drawable, penPtr->traceGC, x - size, y + 1,
- x + size, y + 1);
- }
- if (penPtr->symbol.type != SYMBOL_NONE) {
- Point2d point;
-
- point.x = x, point.y = y;
- DrawSymbols(graphPtr, drawable, elemPtr, penPtr, size, 1, &point);
- }
-}
-
-#ifdef WIN32
-
-static void
-DrawTraces(
- Graph *graphPtr,
- Drawable drawable, /* Pixmap or window to draw into */
- LineElement *elemPtr,
- LinePen *penPtr)
-{
- Blt_ChainLink link;
- HBRUSH brush, oldBrush;
- HDC dc;
- HPEN pen, oldPen;
- POINT *points;
- TkWinDCState state;
- int np;
-
- /*
- * Depending if the line is wide (> 1 pixel), arbitrarily break the line in
- * sections of 100 points. This bit of weirdness has to do with wide
- * geometric pens. The longer the polyline, the slower it draws. The trade
- * off is that we lose dash and cap uniformity for unbearably slow polyline
- * draws.
- */
- if (penPtr->traceGC->line_width > 1) {
- np = 100;
- } else {
- np = Blt_MaxRequestSize(graphPtr->display, sizeof(POINT)) - 1;
- }
- points = Blt_AssertMalloc((np + 1) * sizeof(POINT));
-
- dc = TkWinGetDrawableDC(graphPtr->display, drawable, &state);
-
- pen = Blt_GCToPen(dc, penPtr->traceGC);
- oldPen = SelectPen(dc, pen);
- brush = CreateSolidBrush(penPtr->traceGC->foreground);
- oldBrush = SelectBrush(dc, brush);
- SetROP2(dc, tkpWinRopModes[penPtr->traceGC->function]);
-
- for (link = Blt_Chain_FirstLink(elemPtr->traces); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- POINT *p;
- Trace *tracePtr;
- int count, remaining;
-
- tracePtr = Blt_Chain_GetValue(link);
-
- /*
- * If the trace has to be split into separate XDrawLines calls, then the
- * end point of the current trace is also the starting point of the new
- * split.
- */
-
- /* Step 1. Convert and draw the first section of the trace.
- * It may contain the entire trace. */
-
- for (p = points, count = 0;
- count < MIN(np, tracePtr->screenPts.length);
- count++, p++) {
- p->x = Round(tracePtr->screenPts.points[count].x);
- p->y = Round(tracePtr->screenPts.points[count].y);
- }
- Polyline(dc, points, count);
-
- /* Step 2. Next handle any full-size chunks left. */
-
- while ((count + np) < tracePtr->screenPts.length) {
- int j;
-
- /* Start with the last point of the previous trace. */
- points[0].x = points[np - 1].x;
- points[0].y = points[np - 1].y;
-
- for (p = points + 1, j = 0; j < np; j++, count++, p++) {
- p->x = Round(tracePtr->screenPts.points[count].x);
- p->y = Round(tracePtr->screenPts.points[count].y);
- }
- Polyline(dc, points, np + 1);
- }
-
- /* Step 3. Convert and draw the remaining points. */
-
- remaining = tracePtr->screenPts.length - count;
- if (remaining > 0) {
- /* Start with the last point of the previous trace. */
- points[0].x = points[np - 1].x;
- points[0].y = points[np - 1].y;
-
- for (p = points + 1; count < tracePtr->screenPts.length;
- count++, p++) {
- p->x = Round(tracePtr->screenPts.points[count].x);
- p->y = Round(tracePtr->screenPts.points[count].y);
- }
- Polyline(dc, points, remaining + 1);
- }
- }
- Blt_Free(points);
- DeletePen(SelectPen(dc, oldPen));
- DeleteBrush(SelectBrush(dc, oldBrush));
- TkWinReleaseDrawableDC(drawable, dc, &state);
-}
-
-#else
-
-static void
-DrawTraces(Graph *graphPtr, Drawable drawable, LineElement *elemPtr,
- LinePen *penPtr)
-{
- Blt_ChainLink link;
- XPoint *points;
- int np;
-
- np = Blt_MaxRequestSize(graphPtr->display, sizeof(XPoint)) - 1;
- points = Blt_AssertMalloc((np + 1) * sizeof(XPoint));
-
- for (link = Blt_Chain_FirstLink(elemPtr->traces); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- XPoint *xpp;
- Trace *tracePtr;
- int remaining, count;
- int n;
-
- tracePtr = Blt_Chain_GetValue(link);
-
- /*
- * If the trace has to be split into separate XDrawLines calls, then the
- * end point of the current trace is also the starting point of the new
- * split.
- */
- /* Step 1. Convert and draw the first section of the trace.
- * It may contain the entire trace. */
-
- n = MIN(np, tracePtr->screenPts.length);
- for (xpp = points, count = 0; count < n; count++, xpp++) {
- xpp->x = Round(tracePtr->screenPts.points[count].x);
- xpp->y = Round(tracePtr->screenPts.points[count].y);
- }
- XDrawLines(graphPtr->display, drawable, penPtr->traceGC, points,
- count, CoordModeOrigin);
-
- /* Step 2. Next handle any full-size chunks left. */
-
- while ((count + np) < tracePtr->screenPts.length) {
- int j;
-
- /* Start with the last point of the previous trace. */
- points[0].x = points[np - 1].x;
- points[0].y = points[np - 1].y;
-
- for (xpp = points + 1, j = 0; j < np; j++, count++, xpp++) {
- xpp->x = Round(tracePtr->screenPts.points[count].x);
- xpp->y = Round(tracePtr->screenPts.points[count].y);
- }
- XDrawLines(graphPtr->display, drawable, penPtr->traceGC, points,
- np + 1, CoordModeOrigin);
- }
-
- /* Step 3. Convert and draw the remaining points. */
-
- remaining = tracePtr->screenPts.length - count;
- if (remaining > 0) {
- /* Start with the last point of the previous trace. */
- points[0].x = points[np - 1].x;
- points[0].y = points[np - 1].y;
- for (xpp = points + 1; count < tracePtr->screenPts.length; count++,
- xpp++) {
- xpp->x = Round(tracePtr->screenPts.points[count].x);
- xpp->y = Round(tracePtr->screenPts.points[count].y);
- }
- XDrawLines(graphPtr->display, drawable, penPtr->traceGC, points,
- remaining + 1, CoordModeOrigin);
- }
- }
- Blt_Free(points);
-}
-#endif /* WIN32 */
-
-static void
-DrawValues(Graph *graphPtr, Drawable drawable, LineElement *elemPtr,
- LinePen *penPtr, int length, Point2d *points, int *map)
-{
- Point2d *pp, *endp;
- double *xval, *yval;
- const char *fmt;
- char string[TCL_DOUBLE_SPACE * 2 + 2];
- int count;
-
- fmt = penPtr->valueFormat;
- if (fmt == NULL) {
- fmt = "%g";
- }
- count = 0;
- xval = elemPtr->x.values, yval = elemPtr->y.values;
- for (pp = points, endp = points + length; pp < endp; pp++) {
- double x, y;
-
- x = xval[map[count]];
- y = yval[map[count]];
- count++;
- if (penPtr->valueShow == SHOW_X) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, x);
- } else if (penPtr->valueShow == SHOW_Y) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, y);
- } else if (penPtr->valueShow == SHOW_BOTH) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, x);
- strcat(string, ",");
- sprintf_s(string + strlen(string), TCL_DOUBLE_SPACE, fmt, y);
- }
- Blt_DrawText(graphPtr->tkwin, drawable, string, &penPtr->valueStyle,
- Round(pp->x), Round(pp->y));
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawActiveLineProc --
- *
- * Draws the connected line(s) representing the element. If the line is
- * made up of non-line symbols and the line width parameter has been set
- * (linewidth > 0), the element will also be drawn as a line (with the
- * linewidth requested). The line may consist of separate line segments.
- *
- * Results:
- * None.
- *
- * Side effects:
- * X drawing commands are output.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawActiveLineProc(Graph *graphPtr, Drawable drawable, Element *basePtr)
-{
- LineElement *elemPtr = (LineElement *)basePtr;
- LinePen *penPtr = (LinePen *)elemPtr->activePenPtr;
- int symbolSize;
-
- if (penPtr == NULL) {
- return;
- }
- symbolSize = ScaleSymbol(elemPtr, penPtr->symbol.size);
-
- /*
- * nActiveIndices
- * > 0 Some points are active. Uses activeArr.
- * < 0 All points are active.
- * == 0 No points are active.
- */
- if (elemPtr->nActiveIndices > 0) {
- if (elemPtr->flags & ACTIVE_PENDING) {
- MapActiveSymbols(graphPtr, elemPtr);
- }
- if (penPtr->symbol.type != SYMBOL_NONE) {
- DrawSymbols(graphPtr, drawable, elemPtr, penPtr, symbolSize,
- elemPtr->activePts.length, elemPtr->activePts.points);
- }
- if (penPtr->valueShow != SHOW_NONE) {
- DrawValues(graphPtr, drawable, elemPtr, penPtr,
- elemPtr->activePts.length,
- elemPtr->activePts.points,
- elemPtr->activePts.map);
- }
- } else if (elemPtr->nActiveIndices < 0) {
- if (penPtr->traceWidth > 0) {
- if (elemPtr->lines.length > 0) {
- Blt_Draw2DSegments(graphPtr->display, drawable,
- penPtr->traceGC, elemPtr->lines.segments,
- elemPtr->lines.length);
- } else if (Blt_Chain_GetLength(elemPtr->traces) > 0) {
- DrawTraces(graphPtr, drawable, elemPtr, penPtr);
- }
- }
- if (penPtr->symbol.type != SYMBOL_NONE) {
- DrawSymbols(graphPtr, drawable, elemPtr, penPtr, symbolSize,
- elemPtr->symbolPts.length, elemPtr->symbolPts.points);
- }
- if (penPtr->valueShow != SHOW_NONE) {
- DrawValues(graphPtr, drawable, elemPtr, penPtr,
- elemPtr->symbolPts.length, elemPtr->symbolPts.points,
- elemPtr->symbolPts.map);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawNormalLine --
- *
- * Draws the connected line(s) representing the element. If the line is
- * made up of non-line symbols and the line width parameter has been set
- * (linewidth > 0), the element will also be drawn as a line (with the
- * linewidth requested). The line may consist of separate line segments.
- *
- * Results:
- * None.
- *
- * Side effects:
- * X drawing commands are output.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawNormalLineProc(Graph *graphPtr, Drawable drawable, Element *basePtr)
-{
- LineElement *elemPtr = (LineElement *)basePtr;
- Blt_ChainLink link;
- unsigned int count;
-
- /* Fill area under the curve */
- if (elemPtr->fillPts != NULL) {
- XPoint *points;
- Point2d *endp, *pp;
-
- points = Blt_AssertMalloc(sizeof(XPoint) * elemPtr->nFillPts);
- count = 0;
- for (pp = elemPtr->fillPts, endp = pp + elemPtr->nFillPts;
- pp < endp; pp++) {
- points[count].x = Round(pp->x);
- points[count].y = Round(pp->y);
- count++;
- }
- if (elemPtr->fillBg != NULL) {
- Blt_SetBackgroundOrigin(graphPtr->tkwin, elemPtr->fillBg, 0, 0);
- Blt_FillBackgroundPolygon(graphPtr->tkwin, drawable,
- elemPtr->fillBg, points, elemPtr->nFillPts, 0, TK_RELIEF_FLAT);
- }
- Blt_Free(points);
- }
-
- /* Lines: stripchart segments or graph traces. */
- if (elemPtr->lines.length > 0) {
- for (link = Blt_Chain_FirstLink(elemPtr->styles);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- LineStyle *stylePtr;
- LinePen *penPtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- penPtr = (LinePen *)stylePtr->penPtr;
- if ((stylePtr->lines.length > 0) &&
- (penPtr->errorBarLineWidth > 0)) {
- Blt_Draw2DSegments(graphPtr->display, drawable, penPtr->traceGC,
- stylePtr->lines.segments, stylePtr->lines.length);
- }
- }
- } else {
- LinePen *penPtr;
-
- penPtr = NORMALPEN(elemPtr);
- if ((Blt_Chain_GetLength(elemPtr->traces) > 0) &&
- (penPtr->traceWidth > 0)) {
- DrawTraces(graphPtr, drawable, elemPtr, penPtr);
- }
- }
-
- if (elemPtr->reqMaxSymbols > 0) {
- int total;
-
- total = 0;
- for (link = Blt_Chain_FirstLink(elemPtr->styles);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- LineStyle *stylePtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- total += stylePtr->symbolPts.length;
- }
- elemPtr->symbolInterval = total / elemPtr->reqMaxSymbols;
- elemPtr->symbolCounter = 0;
- }
-
- /* Symbols, error bars, values. */
-
- count = 0;
- for (link = Blt_Chain_FirstLink(elemPtr->styles); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- LineStyle *stylePtr;
- LinePen *penPtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- penPtr = (LinePen *)stylePtr->penPtr;
- if ((stylePtr->xeb.length > 0) && (penPtr->errorBarShow & SHOW_X)) {
- Blt_Draw2DSegments(graphPtr->display, drawable, penPtr->errorBarGC,
- stylePtr->xeb.segments, stylePtr->xeb.length);
- }
- if ((stylePtr->yeb.length > 0) && (penPtr->errorBarShow & SHOW_Y)) {
- Blt_Draw2DSegments(graphPtr->display, drawable, penPtr->errorBarGC,
- stylePtr->yeb.segments, stylePtr->yeb.length);
- }
- if ((stylePtr->symbolPts.length > 0) &&
- (penPtr->symbol.type != SYMBOL_NONE)) {
- DrawSymbols(graphPtr, drawable, elemPtr, penPtr,
- stylePtr->symbolSize, stylePtr->symbolPts.length,
- stylePtr->symbolPts.points);
- }
- if (penPtr->valueShow != SHOW_NONE) {
- DrawValues(graphPtr, drawable, elemPtr, penPtr,
- stylePtr->symbolPts.length, stylePtr->symbolPts.points,
- elemPtr->symbolPts.map + count);
- }
- count += stylePtr->symbolPts.length;
- }
- elemPtr->symbolInterval = 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetSymbolPostScriptInfo --
- *
- * Set up the PostScript environment with the macros and attributes needed
- * to draw the symbols of the element.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GetSymbolPostScriptInfo(
- Graph *graphPtr,
- Blt_Ps ps,
- LinePen *penPtr,
- int size)
-{
- XColor *outlineColor, *fillColor, *defaultColor;
-
- /* Set line and foreground attributes */
- outlineColor = penPtr->symbol.outlineColor;
- fillColor = penPtr->symbol.fillColor;
- defaultColor = penPtr->traceColor;
-
- if (fillColor == COLOR_DEFAULT) {
- fillColor = defaultColor;
- }
- if (outlineColor == COLOR_DEFAULT) {
- outlineColor = defaultColor;
- }
- if (penPtr->symbol.type == SYMBOL_NONE) {
- Blt_Ps_XSetLineAttributes(ps, defaultColor, penPtr->traceWidth + 2,
- &penPtr->traceDashes, CapButt, JoinMiter);
- } else {
- Blt_Ps_XSetLineWidth(ps, penPtr->symbol.outlineWidth);
- Blt_Ps_XSetDashes(ps, (Blt_Dashes *)NULL);
- }
-
- /*
- * Build a PostScript procedure to draw the symbols. For bitmaps, paint
- * both the bitmap and its mask. Otherwise fill and stroke the path formed
- * already.
- */
- Blt_Ps_Append(ps, "\n/DrawSymbolProc {\n");
- switch (penPtr->symbol.type) {
- case SYMBOL_NONE:
- break; /* Do nothing */
- case SYMBOL_BITMAP:
- {
- int w, h;
- double sx, sy, scale;
-
- /*
- * Compute how much to scale the bitmap. Don't let the scaled
- * bitmap exceed the bounding square for the symbol.
- */
- Tk_SizeOfBitmap(graphPtr->display, penPtr->symbol.bitmap, &w, &h);
- sx = (double)size / (double)w;
- sy = (double)size / (double)h;
- scale = MIN(sx, sy);
-
- if ((penPtr->symbol.mask != None) && (fillColor != NULL)) {
- Blt_Ps_VarAppend(ps, "\n % Bitmap mask is \"",
- Tk_NameOfBitmap(graphPtr->display, penPtr->symbol.mask),
- "\"\n\n ", (char *)NULL);
- Blt_Ps_XSetBackground(ps, fillColor);
- Blt_Ps_DrawBitmap(ps, graphPtr->display, penPtr->symbol.mask,
- scale, scale);
- }
- Blt_Ps_VarAppend(ps, "\n % Bitmap symbol is \"",
- Tk_NameOfBitmap(graphPtr->display, penPtr->symbol.bitmap),
- "\"\n\n ", (char *)NULL);
- Blt_Ps_XSetForeground(ps, outlineColor);
- Blt_Ps_DrawBitmap(ps, graphPtr->display, penPtr->symbol.bitmap,
- scale, scale);
- }
- break;
- default:
- if (fillColor != NULL) {
- Blt_Ps_Append(ps, " ");
- Blt_Ps_XSetBackground(ps, fillColor);
- Blt_Ps_Append(ps, " gsave fill grestore\n");
- }
- if ((outlineColor != NULL) && (penPtr->symbol.outlineWidth > 0)) {
- Blt_Ps_Append(ps, " ");
- Blt_Ps_XSetForeground(ps, outlineColor);
- Blt_Ps_Append(ps, " stroke\n");
- }
- break;
- }
- Blt_Ps_Append(ps, "} def\n\n");
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SymbolsToPostScript --
- *
- * Draw a symbol centered at the given x,y window coordinate based upon the
- * element symbol type and size.
- *
- * Results:
- * None.
- *
- * Problems:
- * Most notable is the round-off errors generated when calculating the
- * centered position of the symbol.
- *
- *---------------------------------------------------------------------------
- */
-static void
-SymbolsToPostScript(
- Graph *graphPtr,
- Blt_Ps ps,
- LinePen *penPtr,
- int size,
- int nSymbolPts,
- Point2d *symbolPts)
-{
- double symbolSize;
- static const char *symbolMacros[] =
- {
- "Li", "Sq", "Ci", "Di", "Pl", "Cr", "Sp", "Sc", "Tr", "Ar", "Bm",
- (char *)NULL,
- };
- GetSymbolPostScriptInfo(graphPtr, ps, penPtr, size);
-
- symbolSize = (double)size;
- switch (penPtr->symbol.type) {
- case SYMBOL_SQUARE:
- case SYMBOL_CROSS:
- case SYMBOL_PLUS:
- case SYMBOL_SCROSS:
- case SYMBOL_SPLUS:
- symbolSize = (double)Round(size * S_RATIO);
- break;
- case SYMBOL_TRIANGLE:
- case SYMBOL_ARROW:
- symbolSize = (double)Round(size * 0.7);
- break;
- case SYMBOL_DIAMOND:
- symbolSize = (double)Round(size * M_SQRT1_2);
- break;
-
- default:
- break;
- }
- {
- Point2d *pp, *endp;
-
- for (pp = symbolPts, endp = symbolPts + nSymbolPts; pp < endp; pp++) {
- Blt_Ps_Format(ps, "%g %g %g %s\n", pp->x, pp->y,
- symbolSize, symbolMacros[penPtr->symbol.type]);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SymbolToPostScriptProc --
- *
- * Draw the symbol centered at the each given x,y coordinate.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Draws a symbol at the coordinate given.
- *
- *---------------------------------------------------------------------------
- */
-static void
-SymbolToPostScriptProc(
- Graph *graphPtr, /* Graph widget record */
- Blt_Ps ps,
- Element *basePtr, /* Line element information */
- double x, double y, /* Center position of symbol */
- int size) /* Size of element */
-{
- LineElement *elemPtr = (LineElement *)basePtr;
- LinePen *penPtr;
-
- penPtr = NORMALPEN(elemPtr);
- if (penPtr->traceWidth > 0) {
- /*
- * Draw an extra line offset by one pixel from the previous to give a
- * thicker appearance. This is only for the legend entry. This routine
- * is never called for drawing the actual line segments.
- */
- Blt_Ps_XSetLineAttributes(ps, penPtr->traceColor,
- penPtr->traceWidth, &penPtr->traceDashes, CapButt, JoinMiter);
- Blt_Ps_Format(ps, "%g %g %d Li\n", x, y, size + size);
- }
- if (penPtr->symbol.type != SYMBOL_NONE) {
- Point2d point;
-
- point.x = x, point.y = y;
- SymbolsToPostScript(graphPtr, ps, penPtr, size, 1, &point);
- }
-}
-
-static void
-SetLineAttributes(Blt_Ps ps, LinePen *penPtr)
-{
- /* Set the attributes of the line (color, dashes, linewidth) */
- Blt_Ps_XSetLineAttributes(ps, penPtr->traceColor,
- penPtr->traceWidth, &penPtr->traceDashes, CapButt, JoinMiter);
- if ((LineIsDashed(penPtr->traceDashes)) &&
- (penPtr->traceOffColor != NULL)) {
- Blt_Ps_Append(ps, "/DashesProc {\n gsave\n ");
- Blt_Ps_XSetBackground(ps, penPtr->traceOffColor);
- Blt_Ps_Append(ps, " ");
- Blt_Ps_XSetDashes(ps, (Blt_Dashes *)NULL);
- Blt_Ps_Append(ps, "stroke\n grestore\n} def\n");
- } else {
- Blt_Ps_Append(ps, "/DashesProc {} def\n");
- }
-}
-
-static void
-TracesToPostScript(Blt_Ps ps, LineElement *elemPtr, LinePen *penPtr)
-{
- Blt_ChainLink link;
-
- SetLineAttributes(ps, penPtr);
- for (link = Blt_Chain_FirstLink(elemPtr->traces); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Trace *tracePtr;
-
- tracePtr = Blt_Chain_GetValue(link);
- if (tracePtr->screenPts.length > 0) {
- Blt_Ps_Append(ps, "% start trace\n");
- Blt_Ps_DrawPolyline(ps, tracePtr->screenPts.points,
- tracePtr->screenPts.length);
- Blt_Ps_Append(ps, "% end trace\n");
- }
- }
-}
-
-
-static void
-ValuesToPostScript(Blt_Ps ps, LineElement *elemPtr, LinePen *penPtr,
- int nSymbolPts, Point2d *symbolPts, int *pointToData)
-{
- Point2d *pp, *endp;
- int count;
- char string[TCL_DOUBLE_SPACE * 2 + 2];
- const char *fmt;
-
- fmt = penPtr->valueFormat;
- if (fmt == NULL) {
- fmt = "%g";
- }
- count = 0;
- for (pp = symbolPts, endp = symbolPts + nSymbolPts; pp < endp; pp++) {
- double x, y;
-
- x = elemPtr->x.values[pointToData[count]];
- y = elemPtr->y.values[pointToData[count]];
- count++;
- if (penPtr->valueShow == SHOW_X) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, x);
- } else if (penPtr->valueShow == SHOW_Y) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, y);
- } else if (penPtr->valueShow == SHOW_BOTH) {
- sprintf_s(string, TCL_DOUBLE_SPACE, fmt, x);
- strcat(string, ",");
- sprintf_s(string + strlen(string), TCL_DOUBLE_SPACE, fmt, y);
- }
- Blt_Ps_DrawText(ps, string, &penPtr->valueStyle, pp->x, pp->y);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActiveLineToPostScript --
- *
- * Generates PostScript commands to draw as "active" the points (symbols)
- * and or line segments (trace) representing the element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * PostScript pen width, dashes, and color settings are changed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ActiveLineToPostScriptProc(Graph *graphPtr, Blt_Ps ps, Element *basePtr)
-{
- LineElement *elemPtr = (LineElement *)basePtr;
- LinePen *penPtr = (LinePen *)elemPtr->activePenPtr;
- int symbolSize;
-
- if (penPtr == NULL) {
- return;
- }
- symbolSize = ScaleSymbol(elemPtr, penPtr->symbol.size);
- if (elemPtr->nActiveIndices > 0) {
- if (elemPtr->flags & ACTIVE_PENDING) {
- MapActiveSymbols(graphPtr, elemPtr);
- }
- if (penPtr->symbol.type != SYMBOL_NONE) {
- SymbolsToPostScript(graphPtr, ps, penPtr, symbolSize,
- elemPtr->activePts.length, elemPtr->activePts.points);
- }
- if (penPtr->valueShow != SHOW_NONE) {
- ValuesToPostScript(ps, elemPtr, penPtr, elemPtr->activePts.length,
- elemPtr->activePts.points, elemPtr->activePts.map);
- }
- } else if (elemPtr->nActiveIndices < 0) {
- if (penPtr->traceWidth > 0) {
- if (elemPtr->lines.length > 0) {
- SetLineAttributes(ps, penPtr);
- Blt_Ps_Draw2DSegments(ps, elemPtr->lines.segments,
- elemPtr->lines.length);
- }
- if (Blt_Chain_GetLength(elemPtr->traces) > 0) {
- TracesToPostScript(ps, elemPtr, (LinePen *)penPtr);
- }
- }
- if (penPtr->symbol.type != SYMBOL_NONE) {
- SymbolsToPostScript(graphPtr, ps, penPtr, symbolSize,
- elemPtr->symbolPts.length, elemPtr->symbolPts.points);
- }
- if (penPtr->valueShow != SHOW_NONE) {
- ValuesToPostScript(ps, elemPtr, penPtr, elemPtr->symbolPts.length,
- elemPtr->symbolPts.points, elemPtr->symbolPts.map);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NormalLineToPostScriptProc --
- *
- * Similar to the DrawLine procedure, prints PostScript related commands to
- * form the connected line(s) representing the element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * PostScript pen width, dashes, and color settings are changed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-NormalLineToPostScriptProc(Graph *graphPtr, Blt_Ps ps, Element *basePtr)
-{
- LineElement *elemPtr = (LineElement *)basePtr;
- Blt_ChainLink link;
- unsigned int count;
-
- /* Draw fill area */
- if (elemPtr->fillPts != NULL) {
- /* Create a path to use for both the polygon and its outline. */
- Blt_Ps_Append(ps, "% start fill area\n");
- Blt_Ps_Polyline(ps, elemPtr->fillPts, elemPtr->nFillPts);
-
- /* If the background fill color was specified, draw the polygon in a
- * solid fashion with that color. */
- if (elemPtr->fillBgColor != NULL) {
- Blt_Ps_XSetBackground(ps, elemPtr->fillBgColor);
- Blt_Ps_Append(ps, "gsave fill grestore\n");
- }
- Blt_Ps_XSetForeground(ps, elemPtr->fillFgColor);
- if (elemPtr->fillBg != NULL) {
- Blt_Ps_Append(ps, "gsave fill grestore\n");
- /* TBA: Transparent tiling is the hard part. */
- } else {
- Blt_Ps_Append(ps, "gsave fill grestore\n");
- }
- Blt_Ps_Append(ps, "% end fill area\n");
- }
-
- /* Draw lines (strip chart) or traces (xy graph) */
- if (elemPtr->lines.length > 0) {
- for (link = Blt_Chain_FirstLink(elemPtr->styles); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- LineStyle *stylePtr;
- LinePen *penPtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- penPtr = (LinePen *)stylePtr->penPtr;
- if ((stylePtr->lines.length > 0) && (penPtr->traceWidth > 0)) {
- SetLineAttributes(ps, penPtr);
- Blt_Ps_Append(ps, "% start segments\n");
- Blt_Ps_Draw2DSegments(ps, stylePtr->lines.segments,
- stylePtr->lines.length);
- Blt_Ps_Append(ps, "% end segments\n");
- }
- }
- } else {
- LinePen *penPtr;
-
- penPtr = NORMALPEN(elemPtr);
- if ((Blt_Chain_GetLength(elemPtr->traces) > 0) &&
- (penPtr->traceWidth > 0)) {
- TracesToPostScript(ps, elemPtr, penPtr);
- }
- }
-
- /* Draw symbols, error bars, values. */
-
- count = 0;
- for (link = Blt_Chain_FirstLink(elemPtr->styles); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- LineStyle *stylePtr;
- LinePen *penPtr;
- XColor *colorPtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- penPtr = (LinePen *)stylePtr->penPtr;
- colorPtr = penPtr->errorBarColor;
- if (colorPtr == COLOR_DEFAULT) {
- colorPtr = penPtr->traceColor;
- }
- if ((stylePtr->xeb.length > 0) && (penPtr->errorBarShow & SHOW_X)) {
- Blt_Ps_XSetLineAttributes(ps, colorPtr, penPtr->errorBarLineWidth,
- NULL, CapButt, JoinMiter);
- Blt_Ps_Draw2DSegments(ps, stylePtr->xeb.segments,
- stylePtr->xeb.length);
- }
- if ((stylePtr->yeb.length > 0) && (penPtr->errorBarShow & SHOW_Y)) {
- Blt_Ps_XSetLineAttributes(ps, colorPtr, penPtr->errorBarLineWidth,
- NULL, CapButt, JoinMiter);
- Blt_Ps_Draw2DSegments(ps, stylePtr->yeb.segments,
- stylePtr->yeb.length);
- }
- if ((stylePtr->symbolPts.length > 0) &&
- (penPtr->symbol.type != SYMBOL_NONE)) {
- SymbolsToPostScript(graphPtr, ps, penPtr, stylePtr->symbolSize,
- stylePtr->symbolPts.length, stylePtr->symbolPts.points);
- }
- if (penPtr->valueShow != SHOW_NONE) {
- ValuesToPostScript(ps, elemPtr, penPtr, stylePtr->symbolPts.length,
- stylePtr->symbolPts.points, elemPtr->symbolPts.map + count);
- }
- count += stylePtr->symbolPts.length;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyLineProc --
- *
- * Release memory and resources allocated for the line element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the line element is freed up.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-DestroyLineProc(Graph *graphPtr, Element *basePtr)
-{
- LineElement *elemPtr = (LineElement *)basePtr;
-
- DestroyPenProc(graphPtr, (Pen *)&elemPtr->builtinPen);
- if (elemPtr->activePenPtr != NULL) {
- Blt_FreePen((Pen *)elemPtr->activePenPtr);
- }
- ResetLine(elemPtr);
- if (elemPtr->styles != NULL) {
- Blt_FreeStylePalette(elemPtr->styles);
- Blt_Chain_Destroy(elemPtr->styles);
- }
- if (elemPtr->activeIndices != NULL) {
- Blt_Free(elemPtr->activeIndices);
- }
- if (elemPtr->fillPts != NULL) {
- Blt_Free(elemPtr->fillPts);
- }
- if (elemPtr->fillGC != NULL) {
- Tk_FreeGC(graphPtr->display, elemPtr->fillGC);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_LineElement --
- *
- * Allocate memory and initialize methods for the new line element.
- *
- * Results:
- * The pointer to the newly allocated element structure is returned.
- *
- * Side effects:
- * Memory is allocated for the line element structure.
- *
- *---------------------------------------------------------------------------
- */
-
-static ElementProcs lineProcs =
-{
- ClosestLineProc, /* Finds the closest element/data
- * point */
- ConfigureLineProc, /* Configures the element. */
- DestroyLineProc, /* Destroys the element. */
- DrawActiveLineProc, /* Draws active element */
- DrawNormalLineProc, /* Draws normal element */
- DrawSymbolProc, /* Draws the element symbol. */
- GetLineExtentsProc, /* Find the extents of the element's
- * data. */
- ActiveLineToPostScriptProc, /* Prints active element. */
- NormalLineToPostScriptProc, /* Prints normal element. */
- SymbolToPostScriptProc, /* Prints the line's symbol. */
- MapLineProc /* Compute element's screen
- * coordinates. */
-};
-
-Element *
-Blt_LineElement(Graph *graphPtr, const char *name, ClassId classId)
-{
- LineElement *elemPtr;
-
- elemPtr = Blt_AssertCalloc(1, sizeof(LineElement));
- elemPtr->procsPtr = &lineProcs;
- if (classId == CID_ELEM_LINE) {
- elemPtr->configSpecs = lineElemConfigSpecs;
- } else {
- elemPtr->configSpecs = stripElemConfigSpecs;
- }
- elemPtr->obj.name = Blt_AssertStrdup(name);
- Blt_GraphSetObjectClass(&elemPtr->obj, classId);
- elemPtr->flags = SCALE_SYMBOL;
- elemPtr->obj.graphPtr = graphPtr;
- /* By default an element's name and label are the same. */
- elemPtr->label = Blt_AssertStrdup(name);
- elemPtr->legendRelief = TK_RELIEF_FLAT;
- elemPtr->penDir = PEN_BOTH_DIRECTIONS;
- elemPtr->styles = Blt_Chain_Create();
- elemPtr->builtinPenPtr = &elemPtr->builtinPen;
- elemPtr->reqSmooth = PEN_SMOOTH_LINEAR;
- InitLinePen(elemPtr->builtinPenPtr);
- bltLineStylesOption.clientData = (ClientData)sizeof(LineStyle);
- return (Element *)elemPtr;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * MapLineProc --
- *
- * Calculates the actual window coordinates of the line element. The
- * window coordinates are saved in an allocated point array.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is (re)allocated for the point array.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapLineProc(Graph *graphPtr, Element *basePtr)
-{
- LineElement *elemPtr = (LineElement *)basePtr;
- MapInfo mi;
- int size, np;
- LineStyle **styleMap;
- Blt_ChainLink link;
-
- ResetLine(elemPtr);
- np = NUMBEROFPOINTS(elemPtr);
- if (np < 1) {
- return; /* No data points */
- }
- GetScreenPoints(graphPtr, elemPtr, &mi);
- MapSymbols(graphPtr, elemPtr, &mi);
-
- if ((elemPtr->flags & ACTIVE_PENDING) && (elemPtr->nActiveIndices > 0)) {
- MapActiveSymbols(graphPtr, elemPtr);
- }
- /*
- * Map connecting line segments if they are to be displayed.
- */
- elemPtr->smooth = elemPtr->reqSmooth;
- if ((np > 1) && ((graphPtr->classId == CID_ELEM_STRIP) ||
- (elemPtr->builtinPen.traceWidth > 0))) {
-
- /*
- * Do smoothing if necessary. This can extend the coordinate array,
- * so both mi.points and mi.nPoints may change.
- */
- switch (elemPtr->smooth) {
- case PEN_SMOOTH_STEP:
- GenerateSteps(&mi);
- break;
-
- case PEN_SMOOTH_NATURAL:
- case PEN_SMOOTH_QUADRATIC:
- if (mi.nScreenPts < 3) {
- /* Can't interpolate with less than three points. */
- elemPtr->smooth = PEN_SMOOTH_LINEAR;
- } else {
- GenerateSpline(graphPtr, elemPtr, &mi);
- }
- break;
-
- case PEN_SMOOTH_CATROM:
- if (mi.nScreenPts < 3) {
- /* Can't interpolate with less than three points. */
- elemPtr->smooth = PEN_SMOOTH_LINEAR;
- } else {
- GenerateParametricSpline(graphPtr, elemPtr, &mi);
- }
- break;
-
- default:
- break;
- }
- if (elemPtr->rTolerance > 0.0) {
- ReducePoints(&mi, elemPtr->rTolerance);
- }
- if (elemPtr->fillBg != NULL) {
- MapFillArea(graphPtr, elemPtr, &mi);
- }
- if (graphPtr->classId == CID_ELEM_STRIP) {
- MapStrip(graphPtr, elemPtr, &mi);
- } else {
- MapTraces(graphPtr, elemPtr, &mi);
- }
- }
- Blt_Free(mi.screenPts);
- Blt_Free(mi.map);
-
- /* Set the symbol size of all the pen styles. */
- for (link = Blt_Chain_FirstLink(elemPtr->styles); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- LineStyle *stylePtr;
- LinePen *penPtr;
-
- stylePtr = Blt_Chain_GetValue(link);
- penPtr = (LinePen *)stylePtr->penPtr;
- size = ScaleSymbol(elemPtr, penPtr->symbol.size);
- stylePtr->symbolSize = size;
- stylePtr->errorBarCapWidth = (penPtr->errorBarCapWidth > 0)
- ? penPtr->errorBarCapWidth : Round(size * 0.6666666);
- stylePtr->errorBarCapWidth /= 2;
- }
- styleMap = (LineStyle **)Blt_StyleMap((Element *)elemPtr);
- if (((elemPtr->yHigh.nValues > 0) && (elemPtr->yLow.nValues > 0)) ||
- ((elemPtr->xHigh.nValues > 0) && (elemPtr->xLow.nValues > 0)) ||
- (elemPtr->xError.nValues > 0) || (elemPtr->yError.nValues > 0)) {
- MapErrorBars(graphPtr, elemPtr, styleMap);
- }
- MergePens(elemPtr, styleMap);
- Blt_Free(styleMap);
-}
-#endif
diff --git a/blt3.0.1/src/bltGrMarker.c b/blt3.0.1/src/bltGrMarker.c
deleted file mode 100644
index c9546f6..0000000
--- a/blt3.0.1/src/bltGrMarker.c
+++ /dev/null
@@ -1,5196 +0,0 @@
-
-/*
- * bltGrMarker.c --
- *
- * This module implements markers for the BLT graph widget.
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltGraph.h"
-#include "bltOp.h"
-#include "bltImage.h"
-#include "bltPicture.h"
-#include "bltPainter.h"
-#include "bltChain.h"
-#include "bltGrElem.h"
-#include "bltBitmap.h"
-
-typedef int (GraphMarkerProc)(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-#define GETBITMAP(b) \
- (((b)->destBitmap == None) ? (b)->srcBitmap : (b)->destBitmap)
-
-#define MAX_OUTLINE_POINTS 12
-
-#define IMAGE_PHOTO (1<<7)
-
-/* Map graph coordinates to normalized coordinates [0..1] */
-#define NORMALIZE(A,x) (((x) - (A)->axisRange.min) * (A)->axisRange.scale)
-
-#define DEF_MARKER_ANCHOR "center"
-#define DEF_MARKER_BACKGROUND RGB_WHITE
-#define DEF_MARKER_BITMAP (char *)NULL
-#define DEF_MARKER_CAP_STYLE "butt"
-#define DEF_MARKER_COORDS (char *)NULL
-#define DEF_MARKER_DASHES (char *)NULL
-#define DEF_MARKER_DASH_OFFSET "0"
-#define DEF_MARKER_ELEMENT (char *)NULL
-#define DEF_MARKER_FOREGROUND RGB_BLACK
-#define DEF_MARKER_FILL_COLOR RGB_RED
-#define DEF_MARKER_FONT STD_FONT
-#define DEF_MARKER_GAP_COLOR RGB_PINK
-#define DEF_MARKER_HEIGHT "0"
-#define DEF_MARKER_HIDE "no"
-#define DEF_MARKER_JOIN_STYLE "miter"
-#define DEF_MARKER_JUSTIFY "left"
-#define DEF_MARKER_LINE_WIDTH "1"
-#define DEF_MARKER_MAP_X "x"
-#define DEF_MARKER_MAP_Y "y"
-#define DEF_MARKER_NAME (char *)NULL
-#define DEF_MARKER_OUTLINE_COLOR RGB_BLACK
-#define DEF_MARKER_PAD "4"
-#define DEF_MARKER_ANGLE "0.0"
-#define DEF_MARKER_SCALE "1.0"
-#define DEF_MARKER_STATE "normal"
-#define DEF_MARKER_STIPPLE (char *)NULL
-#define DEF_MARKER_TEXT (char *)NULL
-#define DEF_MARKER_UNDER "no"
-#define DEF_MARKER_WIDTH "0"
-#define DEF_MARKER_WINDOW (char *)NULL
-#define DEF_MARKER_XOR "no"
-#define DEF_MARKER_X_OFFSET "0"
-#define DEF_MARKER_Y_OFFSET "0"
-#define DEF_MARKER_FILTER "box"
-
-#define DEF_TEXT_TAGS "Text all"
-#define DEF_IMAGE_TAGS "Image all"
-#define DEF_BITMAP_TAGS "Bitmap all"
-#define DEF_WINDOW_TAGS "Window all"
-#define DEF_POLYGON_TAGS "Polygon all"
-#define DEF_LINE_TAGS "Line all"
-
-static Blt_OptionParseProc ObjToCoordsProc;
-static Blt_OptionPrintProc CoordsToObjProc;
-static Blt_OptionFreeProc FreeCoordsProc;
-static Blt_CustomOption coordsOption =
-{
- ObjToCoordsProc, CoordsToObjProc, FreeCoordsProc, (ClientData)0
-};
-static Blt_OptionFreeProc FreeColorPairProc;
-static Blt_OptionParseProc ObjToColorPairProc;
-static Blt_OptionPrintProc ColorPairToObjProc;
-static Blt_CustomOption colorPairOption =
-{
- ObjToColorPairProc, ColorPairToObjProc, FreeColorPairProc, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToPictImageProc;
-static Blt_OptionPrintProc PictImageToObjProc;
-static Blt_OptionFreeProc FreePictImageProc;
-static Blt_CustomOption pictImageOption =
-{
- ObjToPictImageProc, PictImageToObjProc, FreePictImageProc, (ClientData)0
-};
-
-BLT_EXTERN Blt_CustomOption bltXAxisOption;
-BLT_EXTERN Blt_CustomOption bltYAxisOption;
-BLT_EXTERN Blt_CustomOption bltFilterOption;
-
-typedef Marker *(MarkerCreateProc)(void);
-typedef void (MarkerDrawProc)(Marker *markerPtr, Drawable drawable);
-typedef void (MarkerFreeProc)(Marker *markerPtr);
-typedef int (MarkerConfigProc)(Marker *markerPtr);
-typedef void (MarkerMapProc)(Marker *markerPtr);
-typedef void (MarkerPostscriptProc)(Marker *markerPtr, Blt_Ps ps);
-typedef int (MarkerPointProc)(Marker *markerPtr, Point2d *samplePtr);
-typedef int (MarkerRegionProc)(Marker *markerPtr, Region2d *extsPtr,
- int enclosed);
-
-static Tcl_FreeProc FreeMarker;
-
-typedef struct {
- Blt_ConfigSpec *configSpecs; /* Marker configuration
- * specifications */
- MarkerConfigProc *configProc;
- MarkerDrawProc *drawProc;
- MarkerFreeProc *freeProc;
- MarkerMapProc *mapProc;
- MarkerPointProc *pointProc;
- MarkerRegionProc *regionProc;
- MarkerPostscriptProc *postscriptProc;
-
-} MarkerClass;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Marker --
- *
- * Structure defining the generic marker. In C++ parlance this would be
- * the base class from which all markers are derived.
- *
- * This structure corresponds with the specific types of markers. Don't
- * change this structure without changing the individual marker
- * structures of each type below.
- *
- * --------------------------------------------------------------------------
- */
-struct _Marker {
- GraphObj obj; /* Must be first field in marker. */
-
- MarkerClass *classPtr;
-
- Blt_HashEntry *hashPtr;
-
- Blt_ChainLink link;
-
- const char *elemName; /* Element associated with marker. Let's
- * you link a marker to an element. The
- * marker is drawn only if the element
- * is also visible. */
- Axis2d axes;
- Point2d *worldPts; /* Coordinate array to position
- * marker */
- int nWorldPts; /* Number of points in above array */
- int drawUnder; /* If non-zero, draw the marker
- * underneath any elements. This can be
- * a performance penalty because the
- * graph must be redraw entirely each
- * time the marker is redrawn. */
-
- int clipped; /* Indicates if the marker is totally
- * clipped by the plotting area. */
-
- unsigned int flags;
-
-
- int xOffset, yOffset; /* Pixel offset from graph position */
-
- int state;
-};
-/*
- *---------------------------------------------------------------------------
- *
- * BitmapMarker --
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- GraphObj obj; /* Must be first field in marker. */
-
- MarkerClass *classPtr;
-
- Blt_HashEntry *hashPtr;
-
- Blt_ChainLink link;
-
- const char *elemName; /* Element associated with marker. Let's
- * you link a marker to an element. The
- * marker is drawn only if the element
- * is also visible. */
- Axis2d axes;
-
- Point2d *worldPts; /* Coordinate array to position
- * marker. */
- int nWorldPts; /* # of points in above array. */
-
- int drawUnder; /* If non-zero, draw the marker
- * underneath any elements. This can be
- * a performance penalty because the
- * graph must be redraw entirely each
- * time the marker is redrawn. */
-
- int clipped; /* Indicates if the marker is totally
- * clipped by the plotting area. */
-
- unsigned int flags;
-
-
- int xOffset, yOffset; /* Pixel offset from graph position */
-
- int state;
-
- /* Fields specific to bitmap markers. */
-
- Pixmap srcBitmap; /* Original bitmap. May be further
- * scaled or rotated. */
- float reqAngle; /* Requested rotation of the bitmap */
- float angle; /* Normalized rotation (0..360
- * degrees) */
- Tk_Anchor anchor; /* If only one X-Y coordinate is given,
- * indicates how to translate the given
- * marker position. Otherwise, if there
- * are two X-Y coordinates, then this
- * value is ignored. */
- Point2d anchorPt; /* Translated anchor point. */
-
- XColor *outlineColor; /* Foreground color */
- XColor *fillColor; /* Background color */
-
- GC gc; /* Private graphic context */
- GC fillGC; /* Shared graphic context */
- Pixmap destBitmap; /* Bitmap to be drawn. */
- int destWidth, destHeight; /* Dimensions of the final bitmap */
-
- Point2d outline[MAX_OUTLINE_POINTS];/* Polygon representing the background
- * of the bitmap. */
- int nOutlinePts;
-} BitmapMarker;
-
-static Blt_ConfigSpec bitmapConfigSpecs[] =
-{
- {BLT_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MARKER_ANCHOR,
- Blt_Offset(BitmapMarker, anchor), 0},
- {BLT_CONFIG_COLOR, "-background", "background", "Background",
- DEF_MARKER_BACKGROUND, Blt_Offset(BitmapMarker, fillColor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_LIST, "-bindtags", "bindTags", "BindTags", DEF_BITMAP_TAGS,
- Blt_Offset(BitmapMarker, obj.tags), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_MARKER_BITMAP,
- Blt_Offset(BitmapMarker, srcBitmap), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-coords", "coords", "Coords", DEF_MARKER_COORDS,
- Blt_Offset(BitmapMarker, worldPts), BLT_CONFIG_NULL_OK,
- &coordsOption},
- {BLT_CONFIG_STRING, "-element", "element", "Element", DEF_MARKER_ELEMENT,
- Blt_Offset(BitmapMarker, elemName), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-fill", "background", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_MARKER_FOREGROUND, Blt_Offset(BitmapMarker, outlineColor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_MARKER_HIDE,
- Blt_Offset(BitmapMarker, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE},
- {BLT_CONFIG_CUSTOM, "-mapx", "mapX", "MapX", DEF_MARKER_MAP_X,
- Blt_Offset(BitmapMarker, axes.x), 0, &bltXAxisOption},
- {BLT_CONFIG_CUSTOM, "-mapy", "mapY", "MapY", DEF_MARKER_MAP_Y,
- Blt_Offset(BitmapMarker, axes.y), 0, &bltYAxisOption},
- {BLT_CONFIG_STRING, "-name", (char *)NULL, (char *)NULL, DEF_MARKER_NAME,
- Blt_Offset(BitmapMarker, obj.name), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-outline", "foreground", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_FLOAT, "-rotate", "rotate", "Rotate", DEF_MARKER_ANGLE,
- Blt_Offset(BitmapMarker, reqAngle), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STATE, "-state", "state", "State", DEF_MARKER_STATE,
- Blt_Offset(BitmapMarker, state), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-under", "under", "Under", DEF_MARKER_UNDER,
- Blt_Offset(BitmapMarker, drawUnder), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-xoffset", "xOffset", "XOffset", DEF_MARKER_X_OFFSET,
- Blt_Offset(BitmapMarker, xOffset), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-yoffset", "yOffset", "YOffset", DEF_MARKER_Y_OFFSET,
- Blt_Offset(BitmapMarker, yOffset), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static MarkerConfigProc ConfigureBitmapProc;
-static MarkerCreateProc CreateBitmapProc;
-static MarkerDrawProc DrawBitmapProc;
-static MarkerFreeProc FreeBitmapProc;
-static MarkerMapProc MapBitmapProc;
-static MarkerPointProc PointInBitmapProc;
-static MarkerPostscriptProc BitmapToPostscriptProc;
-static MarkerRegionProc RegionInBitmapProc;
-
-static MarkerClass bitmapMarkerClass = {
- bitmapConfigSpecs,
- ConfigureBitmapProc,
- DrawBitmapProc,
- FreeBitmapProc,
- MapBitmapProc,
- PointInBitmapProc,
- RegionInBitmapProc,
- BitmapToPostscriptProc,
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImageMarker --
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- GraphObj obj; /* Must be first field in marker. */
-
- MarkerClass *classPtr;
-
- Blt_HashEntry *hashPtr;
-
- Blt_ChainLink link;
-
- const char *elemName; /* Element associated with marker. Let's
- * you link a marker to an element. The
- * marker is drawn only if the element
- * is also visible. */
- Axis2d axes;
-
- Point2d *worldPts; /* Coordinate array to position
- * marker. */
-
- int nWorldPts; /* # of points in above array. */
-
- int drawUnder; /* If non-zero, draw the marker
- * underneath any elements. This can be
- * a performance penalty because the
- * graph must be redraw entirely each
- * time the marker is redrawn. */
-
- int clipped; /* Indicates if the marker is totally
- * clipped by the plotting area. */
-
- unsigned int flags;
-
-
- int xOffset, yOffset; /* Pixel offset from graph position */
-
- int state;
-
- Tk_Image tkImage; /* Tk image to be displayed. */
- Tk_Anchor anchor; /* Indicates how to translate the given
- * marker position. */
- Point2d anchorPt; /* Translated anchor point. */
- int width, height; /* Dimensions of the possibly scaled
- * image. */
- Blt_Painter painter;
- Blt_Picture picture;
- Blt_ResampleFilter filter;
- int pictX, pictY; /* */
- Blt_Picture scaled; /* Pixmap containing the scaled image */
- GC gc;
-
-} ImageMarker;
-
-static Blt_ConfigSpec imageConfigSpecs[] =
-{
- {BLT_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MARKER_ANCHOR,
- Blt_Offset(ImageMarker, anchor), 0},
- {BLT_CONFIG_LIST, "-bindtags", "bindTags", "BindTags", DEF_IMAGE_TAGS,
- Blt_Offset(ImageMarker, obj.tags), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-coords", "coords", "Coords", DEF_MARKER_COORDS,
- Blt_Offset(ImageMarker, worldPts), BLT_CONFIG_NULL_OK, &coordsOption},
- {BLT_CONFIG_STRING, "-element", "element", "Element", DEF_MARKER_ELEMENT,
- Blt_Offset(ImageMarker, elemName), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_MARKER_HIDE,
- Blt_Offset(ImageMarker, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE},
- {BLT_CONFIG_CUSTOM, "-image", "image", "Image", (char *)NULL,
- Blt_Offset(ImageMarker, picture), BLT_CONFIG_NULL_OK, &pictImageOption},
- {BLT_CONFIG_CUSTOM, "-mapx", "mapX", "MapX", DEF_MARKER_MAP_X,
- Blt_Offset(ImageMarker, axes.x), 0, &bltXAxisOption},
- {BLT_CONFIG_CUSTOM, "-mapy", "mapY", "MapY", DEF_MARKER_MAP_Y,
- Blt_Offset(ImageMarker, axes.y), 0, &bltYAxisOption},
- {BLT_CONFIG_STRING, "-name", (char *)NULL, (char *)NULL, DEF_MARKER_NAME,
- Blt_Offset(ImageMarker, obj.name), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-resamplefilter", "resampleFilter", "ResampleFilter",
- DEF_MARKER_FILTER, Blt_Offset(ImageMarker, filter),
- BLT_CONFIG_NULL_OK | BLT_CONFIG_DONT_SET_DEFAULT, &bltFilterOption},
- {BLT_CONFIG_STATE, "-state", "state", "State", DEF_MARKER_STATE,
- Blt_Offset(ImageMarker, state), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-under", "under", "Under", DEF_MARKER_UNDER,
- Blt_Offset(ImageMarker, drawUnder), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-xoffset", "xOffset", "XOffset", DEF_MARKER_X_OFFSET,
- Blt_Offset(ImageMarker, xOffset), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-yoffset", "yOffset", "YOffset", DEF_MARKER_Y_OFFSET,
- Blt_Offset(ImageMarker, yOffset), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static MarkerConfigProc ConfigureImageProc;
-static MarkerCreateProc CreateImageProc;
-static MarkerDrawProc DrawImageProc;
-static MarkerFreeProc FreeImageProc;
-static MarkerMapProc MapImageProc;
-static MarkerPointProc PointInImageProc;
-static MarkerPostscriptProc ImageToPostscriptProc;
-static MarkerRegionProc RegionInImageProc;
-
-static MarkerClass imageMarkerClass = {
- imageConfigSpecs,
- ConfigureImageProc,
- DrawImageProc,
- FreeImageProc,
- MapImageProc,
- PointInImageProc,
- RegionInImageProc,
- ImageToPostscriptProc,
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * LineMarker --
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- GraphObj obj; /* Must be first field in marker. */
-
- MarkerClass *classPtr;
-
- Blt_HashEntry *hashPtr;
-
- Blt_ChainLink link;
-
- const char *elemName; /* Element associated with marker. Let's
- * you link a marker to an element. The
- * marker is drawn only if the element
- * is also visible. */
- Axis2d axes;
-
- Point2d *worldPts; /* Coordinate array to position
- * marker. */
-
- int nWorldPts; /* Number of points in above array */
-
- int drawUnder; /* If non-zero, draw the marker
- * underneath any elements. This can be
- * a performance penalty because the
- * graph must be redraw entirely each
- * time the marker is redrawn. */
-
- int clipped; /* Indicates if the marker is totally
- * clipped by the plotting area. */
-
- unsigned int flags;
-
-
- int xOffset, yOffset; /* Pixel offset from graph position */
-
- int state;
-
- XColor *fillColor;
- XColor *outlineColor; /* Foreground and background colors */
-
- int lineWidth; /* Line width. */
- int capStyle; /* Cap style. */
- int joinStyle; /* Join style.*/
- Blt_Dashes dashes; /* Dash list values (max 11) */
-
- GC gc; /* Private graphic context */
-
- Segment2d *segments; /* Malloc'ed array of points.
- * Represents individual line segments
- * (2 points per segment) comprising the
- * mapped line. The segments may not
- * necessarily be connected after
- * clipping. */
- int nSegments; /* # segments in the above array. */
- int xor;
- int xorState; /* State of the XOR drawing. Indicates
- * if the marker is currently drawn. */
-} LineMarker;
-
-static Blt_ConfigSpec lineConfigSpecs[] =
-{
- {BLT_CONFIG_LIST, "-bindtags", "bindTags", "BindTags", DEF_LINE_TAGS,
- Blt_Offset(LineMarker, obj.tags), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CAP_STYLE, "-cap", "cap", "Cap", DEF_MARKER_CAP_STYLE,
- Blt_Offset(LineMarker, capStyle), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-coords", "coords", "Coords", DEF_MARKER_COORDS,
- Blt_Offset(LineMarker, worldPts), BLT_CONFIG_NULL_OK, &coordsOption},
- {BLT_CONFIG_DASHES, "-dashes", "dashes", "Dashes", DEF_MARKER_DASHES,
- Blt_Offset(LineMarker, dashes), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-dashoffset", "dashOffset", "DashOffset",
- DEF_MARKER_DASH_OFFSET, Blt_Offset(LineMarker, dashes.offset),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-element", "element", "Element", DEF_MARKER_ELEMENT,
- Blt_Offset(LineMarker, elemName), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-fill", "fill", "Fill", (char *)NULL,
- Blt_Offset(LineMarker, fillColor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_JOIN_STYLE, "-join", "join", "Join", DEF_MARKER_JOIN_STYLE,
- Blt_Offset(LineMarker, joinStyle), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-linewidth", "lineWidth", "LineWidth",
- DEF_MARKER_LINE_WIDTH, Blt_Offset(LineMarker, lineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_MARKER_HIDE,
- Blt_Offset(LineMarker, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE},
- {BLT_CONFIG_CUSTOM, "-mapx", "mapX", "MapX", DEF_MARKER_MAP_X,
- Blt_Offset(LineMarker, axes.x), 0, &bltXAxisOption},
- {BLT_CONFIG_CUSTOM, "-mapy", "mapY", "MapY", DEF_MARKER_MAP_Y,
- Blt_Offset(LineMarker, axes.y), 0, &bltYAxisOption},
- {BLT_CONFIG_STRING, "-name", (char *)NULL, (char *)NULL, DEF_MARKER_NAME,
- Blt_Offset(LineMarker, obj.name), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-outline", "outline", "Outline",
- DEF_MARKER_OUTLINE_COLOR, Blt_Offset(LineMarker, outlineColor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STATE, "-state", "state", "State", DEF_MARKER_STATE,
- Blt_Offset(LineMarker, state), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-under", "under", "Under", DEF_MARKER_UNDER,
- Blt_Offset(LineMarker, drawUnder), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-xoffset", "xOffset", "XOffset", DEF_MARKER_X_OFFSET,
- Blt_Offset(LineMarker, xOffset), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-xor", "xor", "Xor", DEF_MARKER_XOR,
- Blt_Offset(LineMarker, xor), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-yoffset", "yOffset", "YOffset", DEF_MARKER_Y_OFFSET,
- Blt_Offset(LineMarker, yOffset), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static MarkerConfigProc ConfigureLineProc;
-static MarkerCreateProc CreateLineProc;
-static MarkerDrawProc DrawLineProc;
-static MarkerFreeProc FreeLineProc;
-static MarkerMapProc MapLineProc;
-static MarkerPointProc PointInLineProc;
-static MarkerPostscriptProc LineToPostscriptProc;
-static MarkerRegionProc RegionInLineProc;
-
-static MarkerClass lineMarkerClass = {
- lineConfigSpecs,
- ConfigureLineProc,
- DrawLineProc,
- FreeLineProc,
- MapLineProc,
- PointInLineProc,
- RegionInLineProc,
- LineToPostscriptProc,
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * PolygonMarker --
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- GraphObj obj; /* Must be first field in marker. */
-
- MarkerClass *classPtr;
-
- Blt_HashEntry *hashPtr;
-
- Blt_ChainLink link;
-
- const char *elemName; /* Element associated with marker. Let's
- * you link a marker to an element. The
- * marker is drawn only if the element
- * is also visible. */
- Axis2d axes;
-
- Point2d *worldPts; /* Coordinate array to position
- * marker. */
-
- int nWorldPts; /* Number of points in above array */
-
- int drawUnder; /* If non-zero, draw the marker
- * underneath any elements. This can be
- * a performance penalty because the
- * graph must be redraw entirely each
- * time the marker is redrawn. */
-
- int clipped; /* Indicates if the marker is totally
- * clipped by the plotting area. */
-
- unsigned int flags;
-
-
- int xOffset, yOffset; /* Pixel offset from graph position */
-
- int state;
-
- Point2d *screenPts; /* Array of points representing the
- * polygon in screen coordinates. It's
- * not used for drawing, but to generate
- * the outlinePts and fillPts arrays
- * that are the coordinates of the
- * possibly clipped outline and filled
- * polygon. */
-
- ColorPair outline;
- ColorPair fill;
-
- Pixmap stipple; /* Stipple pattern to fill the
- * polygon. */
- int lineWidth; /* Width of polygon outline. */
- int capStyle;
- int joinStyle;
- Blt_Dashes dashes; /* List of dash values. Indicates how
- * to draw the dashed line. If no dash
- * values are provided, or the first
- * value is zero, then the line is drawn
- * solid. */
-
- GC outlineGC; /* Graphics context to draw the outline
- * of the polygon. */
- GC fillGC; /* Graphics context to draw the filled
- * polygon. */
-
- Point2d *fillPts; /* Malloc'ed array of points used to
- * draw the filled polygon. These points
- * may form a degenerate polygon after
- * clipping. */
- int nFillPts; /* # points in the above array. */
- Segment2d *outlinePts; /* Malloc'ed array of points.
- * Represents individual line segments
- * (2 points per segment) comprising the
- * outline of the polygon. The segments
- * may not necessarily be closed or
- * connected after clipping. */
- int nOutlinePts; /* # points in the above array. */
- int xor;
- int xorState; /* State of the XOR drawing. Indicates
- * if the marker is visible. We have to
- * drawn it again to erase it. */
-} PolygonMarker;
-
-static Blt_ConfigSpec polygonConfigSpecs[] =
-{
- {BLT_CONFIG_LIST, "-bindtags", "bindTags", "BindTags", DEF_POLYGON_TAGS,
- Blt_Offset(PolygonMarker, obj.tags), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CAP_STYLE, "-cap", "cap", "Cap", DEF_MARKER_CAP_STYLE,
- Blt_Offset(PolygonMarker, capStyle), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-coords", "coords", "Coords", DEF_MARKER_COORDS,
- Blt_Offset(PolygonMarker, worldPts), BLT_CONFIG_NULL_OK, &coordsOption},
- {BLT_CONFIG_DASHES, "-dashes", "dashes", "Dashes", DEF_MARKER_DASHES,
- Blt_Offset(PolygonMarker, dashes), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-element", "element", "Element", DEF_MARKER_ELEMENT,
- Blt_Offset(PolygonMarker, elemName), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-fill", "fill", "Fill", DEF_MARKER_FILL_COLOR,
- Blt_Offset(PolygonMarker, fill), BLT_CONFIG_NULL_OK, &colorPairOption},
- {BLT_CONFIG_JOIN_STYLE, "-join", "join", "Join", DEF_MARKER_JOIN_STYLE,
- Blt_Offset(PolygonMarker, joinStyle), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-linewidth", "lineWidth", "LineWidth",
- DEF_MARKER_LINE_WIDTH, Blt_Offset(PolygonMarker, lineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_MARKER_HIDE,
- Blt_Offset(PolygonMarker, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE},
- {BLT_CONFIG_CUSTOM, "-mapx", "mapX", "MapX", DEF_MARKER_MAP_X,
- Blt_Offset(PolygonMarker, axes.x), 0, &bltXAxisOption},
- {BLT_CONFIG_CUSTOM, "-mapy", "mapY", "MapY", DEF_MARKER_MAP_Y,
- Blt_Offset(PolygonMarker, axes.y), 0, &bltYAxisOption},
- {BLT_CONFIG_STRING, "-name", (char *)NULL, (char *)NULL, DEF_MARKER_NAME,
- Blt_Offset(PolygonMarker, obj.name), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-outline", "outline", "Outline",
- DEF_MARKER_OUTLINE_COLOR, Blt_Offset(PolygonMarker, outline),
- BLT_CONFIG_NULL_OK, &colorPairOption},
- {BLT_CONFIG_STATE, "-state", "state", "State", DEF_MARKER_STATE,
- Blt_Offset(PolygonMarker, state), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMAP, "-stipple", "stipple", "Stipple", DEF_MARKER_STIPPLE,
- Blt_Offset(PolygonMarker, stipple), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BOOLEAN, "-under", "under", "Under", DEF_MARKER_UNDER,
- Blt_Offset(PolygonMarker, drawUnder),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-xoffset", "xOffset", "XOffset", DEF_MARKER_X_OFFSET,
- Blt_Offset(PolygonMarker, xOffset), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-xor", "xor", "Xor", DEF_MARKER_XOR,
- Blt_Offset(PolygonMarker, xor), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-yoffset", "yOffset", "YOffset", DEF_MARKER_Y_OFFSET,
- Blt_Offset(PolygonMarker, yOffset), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static MarkerConfigProc ConfigurePolygonProc;
-static MarkerCreateProc CreatePolygonProc;
-static MarkerDrawProc DrawPolygonProc;
-static MarkerFreeProc FreePolygonProc;
-static MarkerMapProc MapPolygonProc;
-static MarkerPointProc PointInPolygonProc;
-static MarkerPostscriptProc PolygonToPostscriptProc;
-static MarkerRegionProc RegionInPolygonProc;
-
-static MarkerClass polygonMarkerClass = {
- polygonConfigSpecs,
- ConfigurePolygonProc,
- DrawPolygonProc,
- FreePolygonProc,
- MapPolygonProc,
- PointInPolygonProc,
- RegionInPolygonProc,
- PolygonToPostscriptProc,
-};
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextMarker --
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- GraphObj obj; /* Must be first field in marker. */
- MarkerClass *classPtr;
- Blt_HashEntry *hashPtr;
- Blt_ChainLink link;
- const char *elemName; /* Element associated with marker. Let's
- * you link a marker to an element. The
- * marker is drawn only if the element
- * is also visible. */
- Axis2d axes;
- Point2d *worldPts; /* Coordinate array to position
- * marker. */
- int nWorldPts; /* # of points in above array */
- int drawUnder; /* If non-zero, draw the marker
- * underneath any elements. This can be
- * a performance penalty because the
- * graph must be redraw entirely each
- * time the marker is redrawn. */
- int clipped; /* Indicates if the marker is totally
- * clipped by the plotting area. */
- unsigned int flags;
-
-
- int xOffset, yOffset; /* Pixel offset from graph position */
- int state;
-
- /* Fields specific to text markers. */
-#ifdef notdef
- const char *textVarName; /* Name of variable (malloc'ed) or
- * NULL. If non-NULL, graph displays the
- * contents of this variable. */
-#endif
- const char *string; /* Text string to be display. The
- * string make contain newlines. */
- Tk_Anchor anchor; /* Indicates how to translate the given
- * marker position. */
- Point2d anchorPt; /* Translated anchor point. */
- int width, height; /* Dimension of bounding box. */
- TextStyle style; /* Text attributes (font, fg, anchor,
- * etc) */
- Point2d outline[5];
- XColor *fillColor;
- GC fillGC;
-} TextMarker;
-
-
-static Blt_ConfigSpec textConfigSpecs[] =
-{
- {BLT_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MARKER_ANCHOR,
- Blt_Offset(TextMarker, anchor), 0},
- {BLT_CONFIG_COLOR, "-background", "background", "MarkerBackground",
- (char *)NULL, Blt_Offset(TextMarker, fillColor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-bg", "background", "Background", (char *)NULL, 0, 0},
- {BLT_CONFIG_LIST, "-bindtags", "bindTags", "BindTags", DEF_TEXT_TAGS,
- Blt_Offset(TextMarker, obj.tags), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-coords", "coords", "Coords", DEF_MARKER_COORDS,
- Blt_Offset(TextMarker, worldPts), BLT_CONFIG_NULL_OK,
- &coordsOption},
- {BLT_CONFIG_STRING, "-element", "element", "Element",
- DEF_MARKER_ELEMENT, Blt_Offset(TextMarker, elemName),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", "Foreground", (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-fill", "background", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_MARKER_FONT,
- Blt_Offset(TextMarker, style.font), 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_MARKER_FOREGROUND, Blt_Offset(TextMarker, style.color), 0},
- {BLT_CONFIG_JUSTIFY, "-justify", "justify", "Justify",
- DEF_MARKER_JUSTIFY, Blt_Offset(TextMarker, style.justify),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_MARKER_HIDE,
- Blt_Offset(TextMarker, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE},
- {BLT_CONFIG_CUSTOM, "-mapx", "mapX", "MapX", DEF_MARKER_MAP_X,
- Blt_Offset(TextMarker, axes.x), 0, &bltXAxisOption},
- {BLT_CONFIG_CUSTOM, "-mapy", "mapY", "MapY", DEF_MARKER_MAP_Y,
- Blt_Offset(TextMarker, axes.y), 0, &bltYAxisOption},
- {BLT_CONFIG_STRING, "-name", (char *)NULL, (char *)NULL, DEF_MARKER_NAME,
- Blt_Offset(TextMarker, obj.name), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-outline", "foreground", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_PAD, "-padx", "padX", "PadX", DEF_MARKER_PAD,
- Blt_Offset(TextMarker, style.xPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-pady", "padY", "PadY", DEF_MARKER_PAD,
- Blt_Offset(TextMarker, style.yPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FLOAT, "-rotate", "rotate", "Rotate", DEF_MARKER_ANGLE,
- Blt_Offset(TextMarker, style.angle), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STATE, "-state", "state", "State", DEF_MARKER_STATE,
- Blt_Offset(TextMarker, state), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-text", "text", "Text", DEF_MARKER_TEXT,
- Blt_Offset(TextMarker, string), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BOOLEAN, "-under", "under", "Under", DEF_MARKER_UNDER,
- Blt_Offset(TextMarker, drawUnder), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-xoffset", "xOffset", "XOffset", DEF_MARKER_X_OFFSET,
- Blt_Offset(TextMarker, xOffset), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-yoffset", "yOffset", "YOffset", DEF_MARKER_Y_OFFSET,
- Blt_Offset(TextMarker, yOffset), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static MarkerConfigProc ConfigureTextProc;
-static MarkerCreateProc CreateTextProc;
-static MarkerDrawProc DrawTextProc;
-static MarkerFreeProc FreeTextProc;
-static MarkerMapProc MapTextProc;
-static MarkerPointProc PointInTextProc;
-static MarkerPostscriptProc TextToPostscriptProc;
-static MarkerRegionProc RegionInTextProc;
-
-static MarkerClass textMarkerClass = {
- textConfigSpecs,
- ConfigureTextProc,
- DrawTextProc,
- FreeTextProc,
- MapTextProc,
- PointInTextProc,
- RegionInTextProc,
- TextToPostscriptProc,
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * WindowMarker --
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- GraphObj obj; /* Must be first field in marker. */
-
- MarkerClass *classPtr;
-
- Blt_HashEntry *hashPtr;
-
- Blt_ChainLink link;
-
- const char *elemName; /* Element associated with marker. Let's
- * you link a marker to an element. The
- * marker is drawn only if the element
- * is also visible. */
- Axis2d axes;
-
- Point2d *worldPts; /* Coordinate array to position
- * marker */
-
- int nWorldPts; /* # of points in above array */
-
- int drawUnder; /* If non-zero, draw the marker
- * underneath any elements. This can be
- * a performance penalty because the
- * graph must be redraw entirely each
- * time the marker is redrawn. */
-
- int clipped; /* Indicates if the marker is totally
- * clipped by the plotting area. */
-
- unsigned int flags;
-
-
- int xOffset, yOffset; /* Pixel offset from graph position */
-
- int state;
-
- /* Fields specific to window markers. */
-
- const char *childName; /* Name of child widget. */
- Tk_Window child; /* Window to display. */
- int reqWidth, reqHeight; /* If non-zero, this overrides the size
- * requested by the child widget. */
-
- Tk_Anchor anchor; /* Indicates how to translate the given
- * marker position. */
-
- Point2d anchorPt; /* Translated anchor point. */
- int width, height; /* Current size of the child window. */
-
-} WindowMarker;
-
-static Blt_ConfigSpec windowConfigSpecs[] =
-{
- {BLT_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MARKER_ANCHOR,
- Blt_Offset(WindowMarker, anchor), 0},
- {BLT_CONFIG_LIST, "-bindtags", "bindTags", "BindTags", DEF_WINDOW_TAGS,
- Blt_Offset(WindowMarker, obj.tags), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-coords", "coords", "Coords", DEF_MARKER_COORDS,
- Blt_Offset(WindowMarker, worldPts), BLT_CONFIG_NULL_OK,
- &coordsOption},
- {BLT_CONFIG_STRING, "-element", "element", "Element", DEF_MARKER_ELEMENT,
- Blt_Offset(WindowMarker, elemName), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_POS, "-height", "height", "Height", DEF_MARKER_HEIGHT,
- Blt_Offset(WindowMarker, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_MARKER_HIDE,
- Blt_Offset(WindowMarker, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE},
- {BLT_CONFIG_CUSTOM, "-mapx", "mapX", "MapX", DEF_MARKER_MAP_X,
- Blt_Offset(WindowMarker, axes.x), 0, &bltXAxisOption},
- {BLT_CONFIG_CUSTOM, "-mapy", "mapY", "MapY", DEF_MARKER_MAP_Y,
- Blt_Offset(WindowMarker, axes.y), 0, &bltYAxisOption},
- {BLT_CONFIG_STRING, "-name", (char *)NULL, (char *)NULL, DEF_MARKER_NAME,
- Blt_Offset(WindowMarker, obj.name), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STATE, "-state", "state", "State", DEF_MARKER_STATE,
- Blt_Offset(WindowMarker, state), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-under", "under", "Under", DEF_MARKER_UNDER,
- Blt_Offset(WindowMarker, drawUnder), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_POS, "-width", "width", "Width", DEF_MARKER_WIDTH,
- Blt_Offset(WindowMarker, reqWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-window", "window", "Window", DEF_MARKER_WINDOW,
- Blt_Offset(WindowMarker, childName), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS, "-xoffset", "xOffset", "XOffset", DEF_MARKER_X_OFFSET,
- Blt_Offset(WindowMarker, xOffset), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-yoffset", "yOffset", "YOffset", DEF_MARKER_Y_OFFSET,
- Blt_Offset(WindowMarker, yOffset), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static MarkerConfigProc ConfigureWindowProc;
-static MarkerCreateProc CreateWindowProc;
-static MarkerDrawProc DrawWindowProc;
-static MarkerFreeProc FreeWindowProc;
-static MarkerMapProc MapWindowProc;
-static MarkerPointProc PointInWindowProc;
-static MarkerPostscriptProc WindowToPostscriptProc;
-static MarkerRegionProc RegionInWindowProc;
-
-static MarkerClass windowMarkerClass = {
- windowConfigSpecs,
- ConfigureWindowProc,
- DrawWindowProc,
- FreeWindowProc,
- MapWindowProc,
- PointInWindowProc,
- RegionInWindowProc,
- WindowToPostscriptProc,
-};
-
-static Tk_ImageChangedProc ImageChangedProc;
-
-
-
-#ifdef notdef
-static MarkerClass rectangleMarkerClass = {
- rectangleConfigSpecs,
- ConfigureRectangleProc,
- DrawRectangleProc,
- FreeRectangleProc,
- MapRectangleProc,
- PointInRectangleProc,
- RegionInRectangleProc,
- RectangleToPostscriptProc,
-};
-
-static MarkerClass ovalMarkerClass = {
- ovalConfigSpecs,
- ConfigureOvalProc,
- DrawOvalProc,
- FreeOvalProc,
- MapOvalProc,
- PointInOvalProc,
- RegionInOvalProc,
- OvalToPostscriptProc,
-};
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * BoxesDontOverlap --
- *
- * Tests if the bounding box of a marker overlaps the plotting area in
- * any way. If so, the marker will be drawn. Just do a min/max test on
- * the extents of both boxes.
- *
- * Note: It's assumed that the extents of the bounding box lie
- * within the area. So for a 10x10 rectangle, bottom and
- * left would be 9.
- *
- * Results:
- * Returns 0 is the marker is visible in the plotting area, and 1
- * otherwise (marker is clipped).
- *
- *---------------------------------------------------------------------------
- */
-static int
-BoxesDontOverlap(Graph *graphPtr, Region2d *extsPtr)
-{
- assert(extsPtr->right >= extsPtr->left);
- assert(extsPtr->bottom >= extsPtr->top);
- assert(graphPtr->right >= graphPtr->left);
- assert(graphPtr->bottom >= graphPtr->top);
-
- return (((double)graphPtr->right < extsPtr->left) ||
- ((double)graphPtr->bottom < extsPtr->top) ||
- (extsPtr->right < (double)graphPtr->left) ||
- (extsPtr->bottom < (double)graphPtr->top));
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetCoordinate --
- *
- * Convert the expression string into a floating point value. The * only
- * reason we use this routine instead of Blt_ExprDouble is to * handle
- * "elastic" bounds. That is, convert the strings "-Inf", * "Inf" into
- * -(DBL_MAX) and DBL_MAX respectively.
- *
- * Results:
- * The return value is a standard TCL result. The value of the
- * expression is passed back via valuePtr.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetCoordinate(
- Tcl_Interp *interp, /* Interpreter to return results */
- Tcl_Obj *objPtr, /* Numeric expression string to
- * parse */
- double *valuePtr) /* Real-valued result of expression */
-{
- char c;
- const char *expr;
-
- expr = Tcl_GetString(objPtr);
- c = expr[0];
- if ((c == 'I') && (strcmp(expr, "Inf") == 0)) {
- *valuePtr = DBL_MAX; /* Elastic upper bound */
- } else if ((c == '-') && (expr[1] == 'I') && (strcmp(expr, "-Inf") == 0)) {
- *valuePtr = -DBL_MAX; /* Elastic lower bound */
- } else if ((c == '+') && (expr[1] == 'I') && (strcmp(expr, "+Inf") == 0)) {
- *valuePtr = DBL_MAX; /* Elastic upper bound */
- } else if (Blt_ExprDoubleFromObj(interp, objPtr, valuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * PrintCoordinate --
- *
- * Convert the floating point value into its string representation. The
- * only reason this routine is used in instead of sprintf, is to handle
- * the "elastic" bounds. That is, convert the values DBL_MAX and
- * -(DBL_MAX) into "+Inf" and "-Inf" respectively.
- *
- * Results:
- * The return value is a standard TCL result. The string of the *
- * expression is passed back via string.
- *
- * -------------------------------------------------------------------------- */
-static Tcl_Obj *
-PrintCoordinate(double x)
-{
- if (x == DBL_MAX) {
- return Tcl_NewStringObj("+Inf", -1);
- } else if (x == -DBL_MAX) {
- return Tcl_NewStringObj("-Inf", -1);
- } else {
- return Tcl_NewDoubleObj(x);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ParseCoordinates --
- *
- * The TCL coordinate list is converted to their floating point
- * values. It will then replace the current marker coordinates.
- *
- * Since different marker types require different number of coordinates
- * this must be checked here.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- * Side effects:
- * If the marker coordinates are reset, the graph is eventually redrawn
- * with at the new marker coordinates.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ParseCoordinates(
- Tcl_Interp *interp,
- Marker *markerPtr,
- int objc,
- Tcl_Obj *const *objv)
-{
- int nWorldPts;
- int minArgs, maxArgs;
- Point2d *worldPts;
- int i;
-
- if (objc == 0) {
- return TCL_OK;
- }
- if (objc & 1) {
- Tcl_AppendResult(interp, "odd number of marker coordinates specified",
- (char *)NULL);
- return TCL_ERROR;
- }
- switch (markerPtr->obj.classId) {
- case CID_MARKER_LINE:
- minArgs = 4, maxArgs = 0;
- break;
- case CID_MARKER_POLYGON:
- minArgs = 6, maxArgs = 0;
- break;
- case CID_MARKER_WINDOW:
- case CID_MARKER_TEXT:
- minArgs = 2, maxArgs = 2;
- break;
- case CID_MARKER_IMAGE:
- case CID_MARKER_BITMAP:
- minArgs = 2, maxArgs = 4;
- break;
- default:
- Tcl_AppendResult(interp, "unknown marker type", (char *)NULL);
- return TCL_ERROR;
- }
-
- if (objc < minArgs) {
- Tcl_AppendResult(interp, "too few marker coordinates specified",
- (char *)NULL);
- return TCL_ERROR;
- }
- if ((maxArgs > 0) && (objc > maxArgs)) {
- Tcl_AppendResult(interp, "too many marker coordinates specified",
- (char *)NULL);
- return TCL_ERROR;
- }
- nWorldPts = objc / 2;
- worldPts = Blt_Malloc(nWorldPts * sizeof(Point2d));
- if (worldPts == NULL) {
- Tcl_AppendResult(interp, "can't allocate new coordinate array",
- (char *)NULL);
- return TCL_ERROR;
- }
-
- {
- Point2d *pp;
-
- pp = worldPts;
- for (i = 0; i < objc; i += 2) {
- double x, y;
-
- if ((GetCoordinate(interp, objv[i], &x) != TCL_OK) ||
- (GetCoordinate(interp, objv[i + 1], &y) != TCL_OK)) {
- Blt_Free(worldPts);
- return TCL_ERROR;
- }
- pp->x = x, pp->y = y, pp++;
- }
- }
- /* Don't free the old coordinate array until we've parsed the new
- * coordinates without errors. */
- if (markerPtr->worldPts != NULL) {
- Blt_Free(markerPtr->worldPts);
- }
- markerPtr->worldPts = worldPts;
- markerPtr->nWorldPts = nWorldPts;
- markerPtr->flags |= MAP_ITEM;
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static void
-FreeCoordsProc(
- ClientData clientData, /* Not used. */
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Marker *markerPtr = (Marker *)widgRec;
- Point2d **pointsPtr = (Point2d **)(widgRec + offset);
-
- if (*pointsPtr != NULL) {
- Blt_Free(*pointsPtr);
- *pointsPtr = NULL;
- }
- markerPtr->nWorldPts = 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToCoordsProc --
- *
- * Given a TCL list of numeric expression representing the element
- * values, convert into an array of floating point values. In addition,
- * the minimum and maximum values are saved. Since elastic values are
- * allow (values which translate to the min/max of the graph), we must
- * try to get the non-elastic minimum and maximum.
- *
- * Results:
- * The return value is a standard TCL result. The vector is
- * passed back via the vecPtr.
- *
- * --------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToCoordsProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to return results */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* TCL list of numeric expressions */
- char *widgRec, /* Marker record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- Marker *markerPtr = (Marker *)widgRec;
- int objc;
- Tcl_Obj **objv;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 0) {
- return TCL_OK;
- }
- return ParseCoordinates(interp, markerPtr, objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CoordsToObjProc --
- *
- * Convert the vector of floating point values into a TCL list.
- *
- * Results:
- * The string representation of the vector is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-CoordsToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Marker record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- Marker *markerPtr = (Marker *)widgRec;
- Tcl_Obj *listObjPtr;
- Point2d *pp, *pend;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (pp = markerPtr->worldPts, pend = pp + markerPtr->nWorldPts; pp < pend;
- pp++) {
- Tcl_ListObjAppendElement(interp, listObjPtr, PrintCoordinate(pp->x));
- Tcl_ListObjAppendElement(interp, listObjPtr, PrintCoordinate(pp->y));
- }
- return listObjPtr;
-}
-
-/*LINTLIBRARY*/
-static int
-GetColorPair(
- Tcl_Interp *interp,
- Tk_Window tkwin,
- Tcl_Obj *fgObjPtr, Tcl_Obj *bgObjPtr,
- ColorPair *pairPtr,
- int allowDefault)
-{
- XColor *fgColor, *bgColor;
- const char *string;
-
- fgColor = bgColor = NULL;
- if (fgObjPtr != NULL) {
- int length;
-
- string = Tcl_GetStringFromObj(fgObjPtr, &length);
- if (string[0] == '\0') {
- fgColor = NULL;
- } else if ((allowDefault) && (string[0] == 'd') &&
- (strncmp(string, "defcolor", length) == 0)) {
- fgColor = COLOR_DEFAULT;
- } else {
- fgColor = Tk_AllocColorFromObj(interp, tkwin, fgObjPtr);
- if (fgColor == NULL) {
- return TCL_ERROR;
- }
- }
- }
- if (bgObjPtr != NULL) {
- int length;
-
- string = Tcl_GetStringFromObj(bgObjPtr, &length);
- if (string[0] == '\0') {
- bgColor = NULL;
- } else if ((allowDefault) && (string[0] == 'd') &&
- (strncmp(string, "defcolor", length) == 0)) {
- bgColor = COLOR_DEFAULT;
- } else {
- bgColor = Tk_AllocColorFromObj(interp, tkwin, bgObjPtr);
- if (bgColor == NULL) {
- return TCL_ERROR;
- }
- }
- }
- if (pairPtr->fgColor != NULL) {
- Tk_FreeColor(pairPtr->fgColor);
- }
- if (pairPtr->bgColor != NULL) {
- Tk_FreeColor(pairPtr->bgColor);
- }
- pairPtr->fgColor = fgColor;
- pairPtr->bgColor = bgColor;
- return TCL_OK;
-}
-
-void
-Blt_FreeColorPair(ColorPair *pairPtr)
-{
- if ((pairPtr->bgColor != NULL) && (pairPtr->bgColor != COLOR_DEFAULT)) {
- Tk_FreeColor(pairPtr->bgColor);
- }
- if ((pairPtr->fgColor != NULL) && (pairPtr->fgColor != COLOR_DEFAULT)) {
- Tk_FreeColor(pairPtr->fgColor);
- }
- pairPtr->bgColor = pairPtr->fgColor = NULL;
-}
-
-static void
-FreeColorPairProc(
- ClientData clientData, /* Not used. */
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- ColorPair *pairPtr = (ColorPair *)(widgRec + offset);
-
- Blt_FreeColorPair(pairPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToColorPairProc --
- *
- * Convert the color names into pair of XColor pointers.
- *
- * Results:
- * A standard TCL result. The color pointer is written into the
- * widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToColorPairProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to return results */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing color */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- ColorPair *pairPtr = (ColorPair *)(widgRec + offset);
- long longValue = (long)clientData;
- int bool;
- int objc;
- Tcl_Obj **objv;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc > 2) {
- Tcl_AppendResult(interp, "too many names in colors list",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (objc == 0) {
- Blt_FreeColorPair(pairPtr);
- return TCL_OK;
- }
- bool = (int)longValue;
- if (objc == 1) {
- if (GetColorPair(interp, tkwin, objv[0], NULL, pairPtr, bool)
- != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- if (GetColorPair(interp, tkwin, objv[0], objv[1], pairPtr, bool)
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NameOfColor --
- *
- * Convert the color option value into a string.
- *
- * Results:
- * The static string representing the color option is returned.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-NameOfColor(XColor *colorPtr)
-{
- if (colorPtr == NULL) {
- return "";
- } else if (colorPtr == COLOR_DEFAULT) {
- return "defcolor";
- } else {
- return Tk_NameOfColor(colorPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColorPairToObjProc --
- *
- * Convert the color pairs into color names.
- *
- * Results:
- * The string representing the symbol color is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ColorPairToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Element information record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- ColorPair *pairPtr = (ColorPair *)(widgRec + offset);
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(NameOfColor(pairPtr->fgColor), -1));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(NameOfColor(pairPtr->bgColor), -1));
- return listObjPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImageChangedProc
- *
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-ImageChangedProc(
- ClientData clientData,
- int x, int y, int w, int h, /* Not used. */
- int imageWidth, int imageHeight) /* Not used. */
-{
- Graph *graphPtr;
- ImageMarker *imPtr = clientData;
- int isPhoto;
-
- graphPtr = imPtr->obj.graphPtr;
- if ((imPtr->picture != NULL) && (imPtr->flags & IMAGE_PHOTO)) {
- Blt_FreePicture(imPtr->picture);
- }
- imPtr->picture = NULL;
- imPtr->flags &= ~IMAGE_PHOTO;
- if (Blt_Image_IsDeleted(imPtr->tkImage)) {
- Tk_FreeImage(imPtr->tkImage);
- imPtr->tkImage = NULL;
- return;
- }
- imPtr->picture = Blt_GetPictureFromImage(graphPtr->interp, imPtr->tkImage,
- &isPhoto);
- if (isPhoto) {
- imPtr->flags |= IMAGE_PHOTO;
- }
- graphPtr->flags |= CACHE_DIRTY;
- imPtr->flags |= MAP_ITEM;
- Blt_EventuallyRedrawGraph(graphPtr);
-}
-
-/*ARGSUSED*/
-static void
-FreePictImageProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- ImageMarker *imPtr = (ImageMarker *)widgRec;
-
- if ((imPtr->picture != NULL) && (imPtr->flags & IMAGE_PHOTO)) {
- Blt_FreePicture(imPtr->picture);
- }
- imPtr->picture = NULL;
- if (imPtr->tkImage != NULL) {
- Tk_FreeImage(imPtr->tkImage);
- }
- imPtr->tkImage = NULL;
- imPtr->flags &= ~IMAGE_PHOTO;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToPictImageProc --
- *
- * Given an image name, get the Tk image associated with it.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToPictImageProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to return results */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_Picture *picturePtr = (Blt_Picture *)(widgRec + offset);
- Graph *graphPtr;
- ImageMarker *imPtr = (ImageMarker *)widgRec;
- Tk_Image tkImage;
- const char *name;
- int isPhoto;
-
- name = Tcl_GetString(objPtr);
- tkImage = Tk_GetImage(interp, tkwin, name, ImageChangedProc, imPtr);
- if (tkImage == NULL) {
- return TCL_ERROR;
- }
- if (imPtr->tkImage != NULL) {
- Tk_FreeImage(imPtr->tkImage);
- }
- imPtr->flags &= ~IMAGE_PHOTO;
- if (*picturePtr != NULL) {
- Blt_FreePicture(*picturePtr);
- }
- *picturePtr = NULL;
- imPtr->tkImage = tkImage;
- graphPtr = imPtr->obj.graphPtr;
- *picturePtr = Blt_GetPictureFromImage(graphPtr->interp, tkImage, &isPhoto);
- if (isPhoto) {
- imPtr->flags |= IMAGE_PHOTO;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictImageToObjProc --
- *
- * Convert the image name into a string Tcl_Obj.
- *
- * Results:
- * The string representation of the image is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-PictImageToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ImageMarker *imPtr = (ImageMarker *)(widgRec);
-
- if (imPtr->tkImage == NULL) {
- return Tcl_NewStringObj("", -1);
- }
- return Tcl_NewStringObj(Blt_Image_Name(imPtr->tkImage), -1);
-}
-
-static INLINE int
-IsElementHidden(Marker *markerPtr)
-{
- Blt_HashEntry *hPtr;
- Graph *graphPtr = markerPtr->obj.graphPtr;
-
- /* Look up the named element and see if it's hidden */
- hPtr = Blt_FindHashEntry(&graphPtr->elements.table, markerPtr->elemName);
- if (hPtr != NULL) {
- Element *elemPtr;
-
- elemPtr = Blt_GetHashValue(hPtr);
- if ((elemPtr->link == NULL) || (elemPtr->flags & HIDE)) {
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HMap --
- *
- * Maps the given graph coordinate value to its axis, returning a window
- * position. This is a slight variation on the normal Blt_HMap routine.
- * It treats -Inf as the minimum axis value and Inf as the maximum.
- *
- * Results:
- * Returns a floating point number representing the window coordinate
- * position on the given axis.
- *
- * --------------------------------------------------------------------------
- */
-static double
-HMap(Axis *axisPtr, double x)
-{
- if (x == DBL_MAX) {
- x = 1.0;
- } else if (x == -DBL_MAX) {
- x = 0.0;
- } else {
- if (axisPtr->logScale) {
- if (x > 0.0) {
- x = log10(x);
- } else if (x < 0.0) {
- x = 0.0;
- }
- }
- x = NORMALIZE(axisPtr, x);
- }
- if (axisPtr->descending) {
- x = 1.0 - x;
- }
- /* Horizontal transformation */
- return (x * axisPtr->screenRange + axisPtr->screenMin);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * VMap --
- *
- * Map the given graph coordinate value to its axis, returning a window
- * position. This is a slight variation on the normal Blt_VMap routine.
- * It treats -Inf as the minimum axis value and Inf as the maximum.
- *
- * Results:
- * Returns a double precision number representing the window coordinate
- * position on the given axis.
- *
- *---------------------------------------------------------------------------
- */
-static double
-VMap(Axis *axisPtr, double y)
-{
- if (y == DBL_MAX) {
- y = 1.0;
- } else if (y == -DBL_MAX) {
- y = 0.0;
- } else {
- if (axisPtr->logScale) {
- if (y > 0.0) {
- y = log10(y);
- } else if (y < 0.0) {
- y = 0.0;
- }
- }
- y = NORMALIZE(axisPtr, y);
- }
- if (axisPtr->descending) {
- y = 1.0 - y;
- }
- /* Vertical transformation. */
- return (((1.0 - y) * axisPtr->screenRange) + axisPtr->screenMin);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapPoint --
- *
- * Maps the given graph x,y coordinate values to a window position.
- *
- * Results:
- * Returns a XPoint structure containing the window coordinates of the
- * given graph x,y coordinate.
- *
- *---------------------------------------------------------------------------
- */
-static Point2d
-MapPoint(
- Point2d *pointPtr, /* Graph X-Y coordinate. */
- Axis2d *axesPtr) /* Specifies which axes to use */
-{
- Point2d result;
- Graph *graphPtr = axesPtr->y->obj.graphPtr;
-
- if (graphPtr->inverted) {
- result.x = HMap(axesPtr->y, pointPtr->y);
- result.y = VMap(axesPtr->x, pointPtr->x);
- } else {
- result.x = HMap(axesPtr->x, pointPtr->x);
- result.y = VMap(axesPtr->y, pointPtr->y);
- }
- return result; /* Result is screen coordinate. */
-}
-
-static Marker *
-CreateMarker(
- Graph *graphPtr,
- const char *name,
- ClassId classId)
-{
- Marker *markerPtr;
-
- /* Create the new marker based upon the given type */
- switch (classId) {
- case CID_MARKER_BITMAP:
- markerPtr = CreateBitmapProc(); /* bitmap */
- break;
- case CID_MARKER_LINE:
- markerPtr = CreateLineProc(); /* line */
- break;
- case CID_MARKER_IMAGE:
- markerPtr = CreateImageProc(); /* image */
- break;
- case CID_MARKER_TEXT:
- markerPtr = CreateTextProc(); /* text */
- break;
- case CID_MARKER_POLYGON:
- markerPtr = CreatePolygonProc(); /* polygon */
- break;
- case CID_MARKER_WINDOW:
- markerPtr = CreateWindowProc(); /* window */
- break;
- default:
- return NULL;
- }
- markerPtr->obj.graphPtr = graphPtr;
- markerPtr->drawUnder = FALSE;
- markerPtr->flags |= MAP_ITEM;
- markerPtr->obj.name = Blt_AssertStrdup(name);
- Blt_GraphSetObjectClass(&markerPtr->obj, classId);
- return markerPtr;
-}
-
-
-static void
-DestroyMarker(Marker *markerPtr)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
-
- if (markerPtr->drawUnder) {
- /* If the marker to be deleted is currently displayed below the
- * elements, then backing store needs to be repaired. */
- graphPtr->flags |= CACHE_DIRTY;
- }
- /*
- * Call the marker's type-specific deallocation routine. We do it first
- * while all the marker fields are still valid.
- */
- (*markerPtr->classPtr->freeProc)(markerPtr);
-
- /* Dump any bindings that might be registered for the marker. */
- Blt_DeleteBindings(graphPtr->bindTable, markerPtr);
-
- /* Release all the X resources associated with the marker. */
- Blt_FreeOptions(markerPtr->classPtr->configSpecs, (char *)markerPtr,
- graphPtr->display, 0);
-
- if (markerPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&graphPtr->markers.table,
- markerPtr->hashPtr);
- }
- if (markerPtr->link != NULL) {
- Blt_Chain_DeleteLink(graphPtr->markers.displayList, markerPtr->link);
- }
- if (markerPtr->obj.name != NULL) {
- Blt_Free(markerPtr->obj.name);
- }
- Blt_Free(markerPtr);
-}
-
-static void
-FreeMarker(DestroyData dataPtr)
-{
- Marker *markerPtr = (Marker *)dataPtr;
- DestroyMarker(markerPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureBitmapProc --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) a bitmap
- * marker.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as bitmap pixmap, colors, rotation,
- * etc. get set for markerPtr; old resources get freed, if there were
- * any. The marker is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-ConfigureBitmapProc(Marker *markerPtr)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
- BitmapMarker *bmPtr = (BitmapMarker *)markerPtr;
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
-
- if (bmPtr->srcBitmap == None) {
- return TCL_OK;
- }
- bmPtr->angle = FMOD(bmPtr->reqAngle, 360.0);
- if (bmPtr->angle < 0.0) {
- bmPtr->angle += 360.0;
- }
- gcMask = 0;
-
- if (bmPtr->outlineColor != NULL) {
- gcMask |= GCForeground;
- gcValues.foreground = bmPtr->outlineColor->pixel;
- }
-
- if (bmPtr->fillColor != NULL) {
- /* Opaque bitmap: both foreground and background (fill) colors
- * are used. */
- gcValues.background = bmPtr->fillColor->pixel;
- gcMask |= GCBackground;
- } else {
- /* Transparent bitmap: set the clip mask to the current bitmap. */
- gcValues.clip_mask = bmPtr->srcBitmap;
- gcMask |= GCClipMask;
- }
-
- /*
- * This is technically a shared GC, but we're going to set/change the clip
- * origin anyways before we draw the bitmap. This relies on the fact that
- * no other client will be allocated this GC with the GCClipMask set to
- * this particular bitmap.
- */
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (bmPtr->gc != NULL) {
- Tk_FreeGC(graphPtr->display, bmPtr->gc);
- }
- bmPtr->gc = newGC;
-
- /* Create the background GC containing the fill color. */
-
- if (bmPtr->fillColor != NULL) {
- gcValues.foreground = bmPtr->fillColor->pixel;
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (bmPtr->fillGC != NULL) {
- Tk_FreeGC(graphPtr->display, bmPtr->fillGC);
- }
- bmPtr->fillGC = newGC;
- }
-
- markerPtr->flags |= MAP_ITEM;
- if (markerPtr->drawUnder) {
- graphPtr->flags |= CACHE_DIRTY;
- }
-
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-#ifdef notdef
-static void
-PrintPolyPoint(char *mesg, Point2d *points, int nPoints)
-{
- int i;
-
- fprintf(stderr, "%s:\t\tpoint[0]=%g,%g\n", mesg, points[0].x, points[0].y);
- for (i = 1; i < nPoints; i++) {
- fprintf(stderr, "\t\tpoint[%d]=%g,%g\n", i, points[i].x, points[i].y);
- }
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapBitmapProc --
- *
- * This procedure gets called each time the layout of the graph changes.
- * The x, y window coordinates of the bitmap marker are saved in the
- * marker structure.
- *
- * Additionly, if no background color was specified, the
- * GCTileStipXOrigin and GCTileStipYOrigin attributes are set in the
- * private GC.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Window coordinates are saved and if no background color was set, the
- * GC stipple origins are changed to calculated window coordinates.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapBitmapProc(Marker *markerPtr)
-{
- BitmapMarker *bmPtr = (BitmapMarker *)markerPtr;
- Region2d extents;
- Graph *graphPtr = markerPtr->obj.graphPtr;
- Point2d anchorPt;
- Point2d corner1, corner2;
- int destWidth, destHeight;
- int srcWidth, srcHeight;
- int i;
-
- if (bmPtr->srcBitmap == None) {
- return;
- }
- if (bmPtr->destBitmap != None) {
- Tk_FreePixmap(graphPtr->display, bmPtr->destBitmap);
- bmPtr->destBitmap = None;
- }
- /*
- * Collect the coordinates. The number of coordinates will determine the
- * calculations to be made.
- *
- * x1 y1 A single pair of X-Y coordinates. They represent
- * the anchor position of the bitmap.
- *
- * x1 y1 x2 y2 Two pairs of X-Y coordinates. They represent
- * two opposite corners of a bounding rectangle. The
- * bitmap is possibly rotated and scaled to fit into
- * this box.
- *
- */
- Tk_SizeOfBitmap(graphPtr->display, bmPtr->srcBitmap, &srcWidth,
- &srcHeight);
- corner1 = MapPoint(markerPtr->worldPts, &markerPtr->axes);
- if (markerPtr->nWorldPts > 1) {
- double hold;
-
- corner2 = MapPoint(markerPtr->worldPts + 1, &markerPtr->axes);
- /* Flip the corners if necessary */
- if (corner1.x > corner2.x) {
- hold = corner1.x, corner1.x = corner2.x, corner2.x = hold;
- }
- if (corner1.y > corner2.y) {
- hold = corner1.y, corner1.y = corner2.y, corner2.y = hold;
- }
- } else {
- corner2.x = corner1.x + srcWidth - 1;
- corner2.y = corner1.y + srcHeight - 1;
- }
- destWidth = (int)(corner2.x - corner1.x) + 1;
- destHeight = (int)(corner2.y - corner1.y) + 1;
-
- if (markerPtr->nWorldPts == 1) {
- anchorPt = Blt_AnchorPoint(corner1.x, corner1.y, (double)destWidth,
- (double)destHeight, bmPtr->anchor);
- } else {
- anchorPt = corner1;
- }
- anchorPt.x += markerPtr->xOffset;
- anchorPt.y += markerPtr->yOffset;
-
- /* Check if the bitmap sits at least partially in the plot area. */
- extents.left = anchorPt.x;
- extents.top = anchorPt.y;
- extents.right = anchorPt.x + destWidth - 1;
- extents.bottom = anchorPt.y + destHeight - 1;
- markerPtr->clipped = BoxesDontOverlap(graphPtr, &extents);
- if (markerPtr->clipped) {
- return; /* Bitmap is offscreen. Don't generate
- * rotated or scaled bitmaps. */
- }
-
- /*
- * Scale the bitmap if necessary. It's a little tricky because we only
- * want to scale what's visible on the screen, not the entire bitmap.
- */
- if ((bmPtr->angle != 0.0f) || (destWidth != srcWidth) ||
- (destHeight != srcHeight)) {
- int regionX, regionY, regionWidth, regionHeight;
- double left, right, top, bottom;
-
- /* Ignore parts of the bitmap outside of the plot area. */
- left = MAX(graphPtr->left, extents.left);
- right = MIN(graphPtr->right, extents.right);
- top = MAX(graphPtr->top, extents.top);
- bottom = MIN(graphPtr->bottom, extents.bottom);
-
- /* Determine the portion of the scaled bitmap to display. */
- regionX = regionY = 0;
- if (graphPtr->left > extents.left) {
- regionX = (int)(graphPtr->left - extents.left);
- }
- if (graphPtr->top > extents.top) {
- regionY = (int)(graphPtr->top - extents.top);
- }
- regionWidth = (int)(right - left) + 1;
- regionHeight = (int)(bottom - top) + 1;
-
- anchorPt.x = left;
- anchorPt.y = top;
- bmPtr->destBitmap = Blt_ScaleRotateBitmapArea(graphPtr->tkwin,
- bmPtr->srcBitmap, srcWidth, srcHeight, regionX, regionY,
- regionWidth, regionHeight, destWidth, destHeight, bmPtr->angle);
- bmPtr->destWidth = regionWidth;
- bmPtr->destHeight = regionHeight;
- } else {
- bmPtr->destWidth = srcWidth;
- bmPtr->destHeight = srcHeight;
- bmPtr->destBitmap = None;
- }
- bmPtr->anchorPt = anchorPt;
- {
- double xScale, yScale;
- double tx, ty;
- double rotWidth, rotHeight;
- Point2d polygon[5];
- int n;
-
- /*
- * Compute a polygon to represent the background area of the bitmap.
- * This is needed for backgrounds of arbitrarily rotated bitmaps. We
- * also use it to print a background in PostScript.
- */
- Blt_GetBoundingBox(srcWidth, srcHeight, bmPtr->angle, &rotWidth,
- &rotHeight, polygon);
- xScale = (double)destWidth / rotWidth;
- yScale = (double)destHeight / rotHeight;
-
- /*
- * Adjust each point of the polygon. Both scale it to the new size and
- * translate it to the actual screen position of the bitmap.
- */
- tx = extents.left + destWidth * 0.5;
- ty = extents.top + destHeight * 0.5;
- for (i = 0; i < 4; i++) {
- polygon[i].x = (polygon[i].x * xScale) + tx;
- polygon[i].y = (polygon[i].y * yScale) + ty;
- }
- Blt_GraphExtents(graphPtr, &extents);
- n = Blt_PolyRectClip(&extents, polygon, 4, bmPtr->outline);
- assert(n <= MAX_OUTLINE_POINTS);
- if (n < 3) {
- memcpy(&bmPtr->outline, polygon, sizeof(Point2d) * 4);
- bmPtr->nOutlinePts = 4;
- } else {
- bmPtr->nOutlinePts = n;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PointInBitmapProc --
- *
- * Indicates if the given point is over the bitmap marker. The area of
- * the bitmap is the rectangle.
- *
- * Results:
- * Returns 1 is the point is over the bitmap marker, 0 otherwise.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PointInBitmapProc(Marker *markerPtr, Point2d *samplePtr)
-{
- BitmapMarker *bmPtr = (BitmapMarker *)markerPtr;
-
- if (bmPtr->srcBitmap == None) {
- return 0;
- }
- if (bmPtr->angle != 0.0f) {
- Point2d points[MAX_OUTLINE_POINTS];
- int i;
-
- /*
- * Generate the bounding polygon (isolateral) for the bitmap and see
- * if the point is inside of it.
- */
- for (i = 0; i < bmPtr->nOutlinePts; i++) {
- points[i].x = bmPtr->outline[i].x + bmPtr->anchorPt.x;
- points[i].y = bmPtr->outline[i].y + bmPtr->anchorPt.y;
- }
- return Blt_PointInPolygon(samplePtr, points, bmPtr->nOutlinePts);
- }
- return ((samplePtr->x >= bmPtr->anchorPt.x) &&
- (samplePtr->x < (bmPtr->anchorPt.x + bmPtr->destWidth)) &&
- (samplePtr->y >= bmPtr->anchorPt.y) &&
- (samplePtr->y < (bmPtr->anchorPt.y + bmPtr->destHeight)));
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RegionInBitmapProc --
- *
- *---------------------------------------------------------------------------
- */
-static int
-RegionInBitmapProc(Marker *markerPtr, Region2d *extsPtr, int enclosed)
-{
- BitmapMarker *bmPtr = (BitmapMarker *)markerPtr;
-
- if (markerPtr->nWorldPts < 1) {
- return FALSE;
- }
- if (bmPtr->angle != 0.0f) {
- Point2d points[MAX_OUTLINE_POINTS];
- int i;
-
- /*
- * Generate the bounding polygon (isolateral) for the bitmap and see
- * if the point is inside of it.
- */
- for (i = 0; i < bmPtr->nOutlinePts; i++) {
- points[i].x = bmPtr->outline[i].x + bmPtr->anchorPt.x;
- points[i].y = bmPtr->outline[i].y + bmPtr->anchorPt.y;
- }
- return Blt_RegionInPolygon(extsPtr, points, bmPtr->nOutlinePts,
- enclosed);
- }
- if (enclosed) {
- return ((bmPtr->anchorPt.x >= extsPtr->left) &&
- (bmPtr->anchorPt.y >= extsPtr->top) &&
- ((bmPtr->anchorPt.x + bmPtr->destWidth) <= extsPtr->right) &&
- ((bmPtr->anchorPt.y + bmPtr->destHeight) <= extsPtr->bottom));
- }
- return !((bmPtr->anchorPt.x >= extsPtr->right) ||
- (bmPtr->anchorPt.y >= extsPtr->bottom) ||
- ((bmPtr->anchorPt.x + bmPtr->destWidth) <= extsPtr->left) ||
- ((bmPtr->anchorPt.y + bmPtr->destHeight) <= extsPtr->top));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawBitmapProc --
- *
- * Draws the bitmap marker that have a transparent of filled background.
- *
- * Results:
- * None.
- *
- * Side effects:
- * GC stipple origins are changed to current window coordinates.
- * Commands are output to X to draw the marker in its current mode.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawBitmapProc(Marker *markerPtr, Drawable drawable)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
- BitmapMarker *bmPtr = (BitmapMarker *)markerPtr;
- double rangle;
- Pixmap bitmap;
-
- bitmap = GETBITMAP(bmPtr);
- if ((bitmap == None) || (bmPtr->destWidth < 1) || (bmPtr->destHeight < 1)) {
- return;
- }
- rangle = FMOD(bmPtr->angle, 90.0);
- if ((bmPtr->fillColor == NULL) || (rangle != 0.0)) {
-
- /*
- * If the bitmap is rotated and a filled background is required, then
- * a filled polygon is drawn before the bitmap.
- */
- if (bmPtr->fillColor != NULL) {
- int i;
- XPoint polygon[MAX_OUTLINE_POINTS];
-
- for (i = 0; i < bmPtr->nOutlinePts; i++) {
- polygon[i].x = (short int)bmPtr->outline[i].x;
- polygon[i].y = (short int)bmPtr->outline[i].y;
- }
- XFillPolygon(graphPtr->display, drawable, bmPtr->fillGC,
- polygon, bmPtr->nOutlinePts, Convex, CoordModeOrigin);
- }
- XSetClipMask(graphPtr->display, bmPtr->gc, bitmap);
- XSetClipOrigin(graphPtr->display, bmPtr->gc, (int)bmPtr->anchorPt.x,
- (int)bmPtr->anchorPt.y);
- } else {
- XSetClipMask(graphPtr->display, bmPtr->gc, None);
- XSetClipOrigin(graphPtr->display, bmPtr->gc, 0, 0);
- }
- XCopyPlane(graphPtr->display, bitmap, drawable, bmPtr->gc, 0, 0,
- bmPtr->destWidth, bmPtr->destHeight, (int)bmPtr->anchorPt.x,
- (int)bmPtr->anchorPt.y, 1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BitmapToPostscriptProc --
- *
- * Generates PostScript to print a bitmap marker.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-BitmapToPostscriptProc(Marker *markerPtr, Blt_Ps ps)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
- BitmapMarker *bmPtr = (BitmapMarker *)markerPtr;
- Pixmap bitmap;
-
- bitmap = GETBITMAP(bmPtr);
- if ((bitmap == None) || (bmPtr->destWidth < 1) || (bmPtr->destHeight < 1)) {
- return; /* No bitmap to display. */
- }
- if (bmPtr->fillColor != NULL) {
- Blt_Ps_XSetBackground(ps, bmPtr->fillColor);
- Blt_Ps_XFillPolygon(ps, bmPtr->outline, 4);
- }
- Blt_Ps_XSetForeground(ps, bmPtr->outlineColor);
-
- Blt_Ps_Format(ps,
- " gsave\n %g %g translate\n %d %d scale\n",
- bmPtr->anchorPt.x, bmPtr->anchorPt.y + bmPtr->destHeight,
- bmPtr->destWidth, -bmPtr->destHeight);
- Blt_Ps_Format(ps, " %d %d true [%d 0 0 %d 0 %d] {",
- bmPtr->destWidth, bmPtr->destHeight, bmPtr->destWidth,
- -bmPtr->destHeight, bmPtr->destHeight);
- Blt_Ps_XSetBitmapData(ps, graphPtr->display, bitmap,
- bmPtr->destWidth, bmPtr->destHeight);
- Blt_Ps_VarAppend(ps,
- " } imagemask\n",
- "grestore\n", (char *)NULL);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeBitmapProc --
- *
- * Releases the memory and attributes of the bitmap marker.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Bitmap attributes (GCs, colors, bitmap, etc) get destroyed. Memory is
- * released, X resources are freed, and the graph is redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeBitmapProc(Marker *markerPtr)
-{
- BitmapMarker *bmPtr = (BitmapMarker *)markerPtr;
- Graph *graphPtr = markerPtr->obj.graphPtr;
-
- if (bmPtr->gc != NULL) {
- Tk_FreeGC(graphPtr->display, bmPtr->gc);
- }
- if (bmPtr->fillGC != NULL) {
- Tk_FreeGC(graphPtr->display, bmPtr->fillGC);
- }
- if (bmPtr->destBitmap != None) {
- Tk_FreePixmap(graphPtr->display, bmPtr->destBitmap);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateBitmapProc --
- *
- * Allocate memory and initialize methods for the new bitmap marker.
- *
- * Results:
- * The pointer to the newly allocated marker structure is returned.
- *
- * Side effects:
- * Memory is allocated for the bitmap marker structure.
- *
- *---------------------------------------------------------------------------
- */
-static Marker *
-CreateBitmapProc(void)
-{
- BitmapMarker *bmPtr;
-
- bmPtr = Blt_AssertCalloc(1, sizeof(BitmapMarker));
- bmPtr->classPtr = &bitmapMarkerClass;
- return (Marker *)bmPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureImageProc --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) a image
- * marker.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as image pixmap, colors, rotation,
- * etc. get set for markerPtr; old resources get freed, if there were
- * any. The marker is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureImageProc(Marker *markerPtr)
-{
- ImageMarker *imPtr = (ImageMarker *)markerPtr;
- Graph *graphPtr = markerPtr->obj.graphPtr;
- Blt_Painter painter;
- GC newGC;
-
- newGC = Tk_GetGC(graphPtr->tkwin, 0L, (XGCValues *)NULL);
- if (imPtr->gc != NULL) {
- Tk_FreeGC(graphPtr->display, imPtr->gc);
- }
- imPtr->gc = newGC;
-
- painter = Blt_GetPainter(graphPtr->tkwin, 1.0);
- if (imPtr->painter != NULL) {
- Blt_FreePainter(painter);
- }
- imPtr->painter = painter;
- markerPtr->flags |= MAP_ITEM;
- if (markerPtr->drawUnder) {
- graphPtr->flags |= CACHE_DIRTY;
- }
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapImageProc --
- *
- * This procedure gets called each time the layout of the graph changes.
- * The x, y window coordinates of the image marker are saved in the
- * marker structure.
- *
- * In addition, if no background color was specified, the
- * GCTileStipXOrigin and GCTileStipYOrigin attributes will not set in the
- * private GC.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Window coordinates are saved and if no background color was set, the
- * GC stipple origins are changed to calculated window coordinates.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapImageProc(Marker *markerPtr)
-{
- Region2d extents;
- Graph *graphPtr;
- ImageMarker *imPtr;
- Point2d anchorPt;
- Point2d c1, c2;
- int newWidth, newHeight;
- int srcWidth, srcHeight;
- int x, y, w, h;
- int left, right, top, bottom;
-
- imPtr = (ImageMarker *)markerPtr;
- if (imPtr->picture == NULL) {
- return;
- }
- if (imPtr->scaled != NULL) {
- Blt_FreePicture(imPtr->scaled);
- imPtr->scaled = NULL;
- }
- graphPtr = markerPtr->obj.graphPtr;
- c1 = MapPoint(markerPtr->worldPts, &markerPtr->axes);
-
- imPtr->width = srcWidth = Blt_PictureWidth(imPtr->picture);
- imPtr->height = srcHeight = Blt_PictureHeight(imPtr->picture);
-
- if ((srcWidth == 0) || (srcHeight == 0)) {
- markerPtr->clipped = TRUE;
- return; /* Empty image. */
- }
- if (markerPtr->nWorldPts > 1) {
- double hold;
-
- c2 = MapPoint(markerPtr->worldPts + 1, &markerPtr->axes);
- /* Flip the corners if necessary */
- if (c1.x > c2.x) {
- hold = c1.x, c1.x = c2.x, c2.x = hold;
- }
- if (c1.y > c2.y) {
- hold = c1.y, c1.y = c2.y, c2.y = hold;
- }
- } else {
- c2.x = c1.x + srcWidth - 1;
- c2.y = c1.y + srcHeight - 1;
- }
- newWidth = (int)(c2.x - c1.x) + 1;
- newHeight = (int)(c2.y - c1.y) + 1;
-
- if (markerPtr->nWorldPts == 1) {
- anchorPt = Blt_AnchorPoint(c1.x, c1.y, (double)newWidth,
- (double)newHeight, imPtr->anchor);
- } else {
- anchorPt = c1;
- }
- anchorPt.x += markerPtr->xOffset;
- anchorPt.y += markerPtr->yOffset;
-
- /* Check if the image sits at least partially in the plot area. */
- extents.left = anchorPt.x;
- extents.top = anchorPt.y;
- extents.right = anchorPt.x + newWidth - 1;
- extents.bottom = anchorPt.y + newHeight - 1;
-
- markerPtr->clipped = BoxesDontOverlap(graphPtr, &extents);
- if (markerPtr->clipped) {
- return; /* Image is offscreen. Don't generate
- * rotated or scaled images. */
- }
-
- /* Determine the extents of the subimage inside of the destination
- * image. */
- left = MAX((int)extents.left, graphPtr->left);
- top = MAX((int)extents.top, graphPtr->top);
- right = MIN((int)extents.right, graphPtr->right);
- bottom = MIN((int)extents.bottom, graphPtr->bottom);
-
- /* Reset image location and coordinates to that of the region */
- anchorPt.x = left;
- anchorPt.y = top;
-
- x = y = 0;
- if (graphPtr->left > (int)extents.left) {
- x = graphPtr->left - (int)extents.left;
- }
- if (graphPtr->top > (int)extents.top) {
- y = graphPtr->top - (int)extents.top;
- }
- w = (int)(right - left + 1);
- h = (int)(bottom - top + 1);
-
- if (markerPtr->nWorldPts > 1) {
- Blt_Picture scaled;
-
- scaled = Blt_ScalePictureArea(imPtr->picture, x, y, w, h,
- newWidth, newHeight);
- imPtr->scaled = scaled;
- imPtr->pictX = 0;
- imPtr->pictY = 0;
- } else {
- imPtr->pictX = x;
- imPtr->pictY = y;
- }
- imPtr->width = newWidth;
- imPtr->height = newHeight;
- imPtr->anchorPt = anchorPt;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PointInWindowProc --
- *
- * Indicates if the given point is over the window marker. The area of
- * the window is the rectangle.
- *
- * Results:
- * Returns 1 is the point is over the window marker, 0 otherwise.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PointInImageProc(Marker *markerPtr, Point2d *samplePtr)
-{
- ImageMarker *imPtr = (ImageMarker *)markerPtr;
- double left, right, top, bottom;
-
- left = imPtr->anchorPt.x;
- right = imPtr->anchorPt.x + imPtr->width;
- top = imPtr->anchorPt.y;
- bottom = imPtr->anchorPt.y + imPtr->height;
-
- return ((samplePtr->x >= left) && (samplePtr->x < right) &&
- (samplePtr->y >= top) && (samplePtr->y < bottom));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RegionInImageProc --
- *
- *---------------------------------------------------------------------------
- */
-static int
-RegionInImageProc(Marker *markerPtr, Region2d *regPtr, int enclosed)
-{
- ImageMarker *imPtr = (ImageMarker *)markerPtr;
-
- if (markerPtr->nWorldPts > 0) {
- double left, right, top, bottom;
-
- left = imPtr->anchorPt.x;
- right = imPtr->anchorPt.x + imPtr->width;
- top = imPtr->anchorPt.y;
- bottom = imPtr->anchorPt.y + imPtr->height;
- if (enclosed) {
- return ((left >= regPtr->left) && (top >= regPtr->top) &&
- (right <= regPtr->right) && (bottom <= regPtr->bottom));
- }
- return !((left >= regPtr->right) || (top >= regPtr->bottom) ||
- (right <= regPtr->left) || (bottom <= regPtr->top));
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawImageProc --
- *
- * This procedure is invoked to draw a image marker.
- *
- * Results:
- * None.
- *
- * Side effects:
- * GC stipple origins are changed to current window coordinates.
- * Commands are output to X to draw the marker in its current mode.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawImageProc(Marker *markerPtr, Drawable drawable)
-{
- ImageMarker *imPtr = (ImageMarker *)markerPtr;
- Blt_Picture picture;
-
- picture = (imPtr->scaled != NULL) ? imPtr->scaled : imPtr->picture;
- if (picture != NULL) {
- Blt_PaintPictureWithBlend(imPtr->painter, drawable, picture,
- imPtr->pictX, imPtr->pictY, imPtr->width, imPtr->height,
- (int)imPtr->anchorPt.x, (int)imPtr->anchorPt.y, 0, 0.4);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImageToPostscriptProc --
- *
- * This procedure is invoked to print a image marker.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ImageToPostscriptProc(Marker *markerPtr, Blt_Ps ps)
-{
- ImageMarker *imPtr = (ImageMarker *)markerPtr;
- Blt_Picture picture;
-
- picture = (imPtr->scaled != NULL) ? imPtr->scaled : imPtr->picture;
- if (picture != NULL) {
- Blt_Ps_DrawPicture(ps, picture, imPtr->anchorPt.x, imPtr->anchorPt.y);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeImageProc --
- *
- * Destroys the structure containing the attributes of the image marker.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Image attributes (GCs, colors, image, etc) get destroyed. Memory is
- * released, X resources are freed, and the graph is redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeImageProc(Marker *markerPtr)
-{
- ImageMarker *imPtr = (ImageMarker *)markerPtr;
- Graph *graphPtr = markerPtr->obj.graphPtr;
-
- if (imPtr->painter != NULL) {
- Blt_FreePainter(imPtr->painter);
- }
- if (imPtr->scaled != NULL) {
- Blt_FreePicture(imPtr->scaled);
- }
- if (imPtr->gc != NULL) {
- Tk_FreeGC(graphPtr->display, imPtr->gc);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateImageProc --
- *
- * Allocate memory and initialize methods for the new image marker.
- *
- * Results:
- * The pointer to the newly allocated marker structure is returned.
- *
- * Side effects:
- * Memory is allocated for the image marker structure.
- *
- *---------------------------------------------------------------------------
- */
-static Marker *
-CreateImageProc(void)
-{
- ImageMarker *imPtr;
-
- imPtr = Blt_AssertCalloc(1, sizeof(ImageMarker));
- imPtr->classPtr = &imageMarkerClass;
- return (Marker *)imPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureTextProc --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) a text marker.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for markerPtr; old resources get freed, if there were any. The
- * marker is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureTextProc(Marker *markerPtr)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
- TextMarker *tmPtr = (TextMarker *)markerPtr;
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
-
- tmPtr->style.angle = (float)FMOD(tmPtr->style.angle, 360.0);
- if (tmPtr->style.angle < 0.0f) {
- tmPtr->style.angle += 360.0f;
- }
- newGC = NULL;
- if (tmPtr->fillColor != NULL) {
- gcMask = GCForeground;
- gcValues.foreground = tmPtr->fillColor->pixel;
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- }
- if (tmPtr->fillGC != NULL) {
- Tk_FreeGC(graphPtr->display, tmPtr->fillGC);
- }
- tmPtr->fillGC = newGC;
-
- markerPtr->flags |= MAP_ITEM;
- if (markerPtr->drawUnder) {
- graphPtr->flags |= CACHE_DIRTY;
- }
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapTextProc --
- *
- * Calculate the layout position for a text marker. Positional information
- * is saved in the marker. If the text is rotated, a bitmap containing the
- * text is created.
- *
- * Results:
- * None.
- *
- * Side effects:
- * If no background color has been specified, the GC stipple origins are
- * changed to current window coordinates. For both rotated and
- * non-rotated text, if any old bitmap is leftover, it is freed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapTextProc(Marker *markerPtr)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
- TextMarker *tmPtr = (TextMarker *)markerPtr;
- Region2d extents;
- Point2d anchorPt;
- int i;
- unsigned int w, h;
- double rw, rh;
-
- tmPtr->width = tmPtr->height = 0;
- if (tmPtr->string == NULL) {
- return;
- }
- Blt_Ts_GetExtents(&tmPtr->style, tmPtr->string, &w, &h);
- Blt_GetBoundingBox(w, h, tmPtr->style.angle, &rw, &rh, tmPtr->outline);
- tmPtr->width = ROUND(rw);
- tmPtr->height = ROUND(rh);
- for (i = 0; i < 4; i++) {
- tmPtr->outline[i].x += ROUND(rw * 0.5);
- tmPtr->outline[i].y += ROUND(rh * 0.5);
- }
- tmPtr->outline[4].x = tmPtr->outline[0].x;
- tmPtr->outline[4].y = tmPtr->outline[0].y;
- anchorPt = MapPoint(markerPtr->worldPts, &markerPtr->axes);
- anchorPt = Blt_AnchorPoint(anchorPt.x, anchorPt.y, (double)(tmPtr->width),
- (double)(tmPtr->height), tmPtr->anchor);
- anchorPt.x += markerPtr->xOffset;
- anchorPt.y += markerPtr->yOffset;
- /*
- * Determine the bounding box of the text and test to see if it is at
- * least partially contained within the plotting area.
- */
- extents.left = anchorPt.x;
- extents.top = anchorPt.y;
- extents.right = anchorPt.x + tmPtr->width - 1;
- extents.bottom = anchorPt.y + tmPtr->height - 1;
- markerPtr->clipped = BoxesDontOverlap(graphPtr, &extents);
- tmPtr->anchorPt = anchorPt;
-
-}
-
-static int
-PointInTextProc(Marker *markerPtr, Point2d *samplePtr)
-{
- TextMarker *tmPtr = (TextMarker *)markerPtr;
-
- if (tmPtr->string == NULL) {
- return 0;
- }
- if (tmPtr->style.angle != 0.0f) {
- Point2d points[5];
- int i;
-
- /*
- * Figure out the bounding polygon (isolateral) for the text and see
- * if the point is inside of it.
- */
- for (i = 0; i < 5; i++) {
- points[i].x = tmPtr->outline[i].x + tmPtr->anchorPt.x;
- points[i].y = tmPtr->outline[i].y + tmPtr->anchorPt.y;
- }
- return Blt_PointInPolygon(samplePtr, points, 5);
- }
- return ((samplePtr->x >= tmPtr->anchorPt.x) &&
- (samplePtr->x < (tmPtr->anchorPt.x + tmPtr->width)) &&
- (samplePtr->y >= tmPtr->anchorPt.y) &&
- (samplePtr->y < (tmPtr->anchorPt.y + tmPtr->height)));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RegionInTextProc --
- *
- *---------------------------------------------------------------------------
- */
-static int
-RegionInTextProc(Marker *markerPtr, Region2d *extsPtr, int enclosed)
-{
- TextMarker *tmPtr = (TextMarker *)markerPtr;
-
- if (markerPtr->nWorldPts < 1) {
- return FALSE;
- }
- if (tmPtr->style.angle != 0.0f) {
- Point2d points[5];
- int i;
-
- /*
- * Generate the bounding polygon (isolateral) for the bitmap and see
- * if the point is inside of it.
- */
- for (i = 0; i < 4; i++) {
- points[i].x = tmPtr->outline[i].x + tmPtr->anchorPt.x;
- points[i].y = tmPtr->outline[i].y + tmPtr->anchorPt.y;
- }
- return Blt_RegionInPolygon(extsPtr, points, 4, enclosed);
- }
- if (enclosed) {
- return ((tmPtr->anchorPt.x >= extsPtr->left) &&
- (tmPtr->anchorPt.y >= extsPtr->top) &&
- ((tmPtr->anchorPt.x + tmPtr->width) <= extsPtr->right) &&
- ((tmPtr->anchorPt.y + tmPtr->height) <= extsPtr->bottom));
- }
- return !((tmPtr->anchorPt.x >= extsPtr->right) ||
- (tmPtr->anchorPt.y >= extsPtr->bottom) ||
- ((tmPtr->anchorPt.x + tmPtr->width) <= extsPtr->left) ||
- ((tmPtr->anchorPt.y + tmPtr->height) <= extsPtr->top));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawTextProc --
- *
- * Draws the text marker on the graph.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to draw the marker in its current mode.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawTextProc(Marker *markerPtr, Drawable drawable)
-{
- TextMarker *tmPtr = (TextMarker *)markerPtr;
- Graph *graphPtr = markerPtr->obj.graphPtr;
-
- if (tmPtr->string == NULL) {
- return;
- }
- if (tmPtr->fillGC != NULL) {
- XPoint points[4];
- int i;
-
- /*
- * Simulate the rotated background of the bitmap by filling a bounding
- * polygon with the background color.
- */
- for (i = 0; i < 4; i++) {
- points[i].x = (short int)(tmPtr->outline[i].x + tmPtr->anchorPt.x);
- points[i].y = (short int)(tmPtr->outline[i].y + tmPtr->anchorPt.y);
- }
- XFillPolygon(graphPtr->display, drawable, tmPtr->fillGC, points, 4,
- Convex, CoordModeOrigin);
- }
- if (tmPtr->style.color != NULL) {
- Blt_Ts_DrawText(graphPtr->tkwin, drawable, tmPtr->string, -1,
- &tmPtr->style, (int)tmPtr->anchorPt.x, (int)tmPtr->anchorPt.y);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextToPostscriptProc --
- *
- * Outputs PostScript commands to draw a text marker at a given x,y
- * coordinate, rotation, anchor, and font.
- *
- * Results:
- * None.
- *
- * Side effects:
- * PostScript font and color settings are changed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TextToPostscriptProc(Marker *markerPtr, Blt_Ps ps)
-{
- TextMarker *tmPtr = (TextMarker *)markerPtr;
-
- if (tmPtr->string == NULL) {
- return;
- }
- if (tmPtr->fillGC != NULL) {
- Point2d points[4];
- int i;
-
- /*
- * Simulate the rotated background of the bitmap by filling a bounding
- * polygon with the background color.
- */
- for (i = 0; i < 4; i++) {
- points[i].x = tmPtr->outline[i].x + tmPtr->anchorPt.x;
- points[i].y = tmPtr->outline[i].y + tmPtr->anchorPt.y;
- }
- Blt_Ps_XSetBackground(ps, tmPtr->fillColor);
- Blt_Ps_XFillPolygon(ps, points, 4);
- }
- Blt_Ps_DrawText(ps, tmPtr->string, &tmPtr->style, tmPtr->anchorPt.x,
- tmPtr->anchorPt.y);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeTextProc --
- *
- * Destroys the structure containing the attributes of the text marker.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Text attributes (GCs, colors, stipple, font, etc) get destroyed.
- * Memory is released, X resources are freed, and the graph is redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeTextProc(Marker *markerPtr)
-{
- TextMarker *tmPtr = (TextMarker *)markerPtr;
- Graph *graphPtr = markerPtr->obj.graphPtr;
-
- Blt_Ts_FreeStyle(graphPtr->display, &tmPtr->style);
-}
-
-/*
- *---------------------------------------------------------------------------
-
- * CreateTextProc --
- *
- * Allocate memory and initialize methods for the new text marker.
- *
- * Results:
- * The pointer to the newly allocated marker structure is returned.
- *
- * Side effects:
- * Memory is allocated for the text marker structure.
- *
- *---------------------------------------------------------------------------
- */
-static Marker *
-CreateTextProc(void)
-{
- TextMarker *tmPtr;
-
- tmPtr = Blt_AssertCalloc(1, sizeof(TextMarker));
- tmPtr->classPtr = &textMarkerClass;
- Blt_Ts_InitStyle(tmPtr->style);
- tmPtr->style.anchor = TK_ANCHOR_NW;
- tmPtr->style.padLeft = tmPtr->style.padRight = 4;
- tmPtr->style.padTop = tmPtr->style.padBottom = 4;
- return (Marker *)tmPtr;
-}
-
-static Tk_EventProc ChildEventProc;
-static Tk_GeomRequestProc ChildGeometryProc;
-static Tk_GeomLostSlaveProc ChildCustodyProc;
-static Tk_GeomMgr winMarkerMgrInfo =
-{
- (char *)"graph", /* Name of geometry manager used by
- * winfo */
- ChildGeometryProc, /* Procedure to for new geometry
- * requests. */
- ChildCustodyProc, /* Procedure when window is taken
- * away. */
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureWindowProc --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) a window
- * marker.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as window pathname, placement,
- * etc. get set for markerPtr; old resources get freed, if there were
- * any. The marker is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureWindowProc(Marker *markerPtr)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
- WindowMarker *wmPtr = (WindowMarker *)markerPtr;
- Tk_Window tkwin;
-
- if (wmPtr->childName == NULL) {
- return TCL_OK;
- }
- tkwin = Tk_NameToWindow(graphPtr->interp, wmPtr->childName,
- graphPtr->tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_Parent(tkwin) != graphPtr->tkwin) {
- Tcl_AppendResult(graphPtr->interp, "\"", wmPtr->childName,
- "\" is not a child of \"", Tk_PathName(graphPtr->tkwin), "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (tkwin != wmPtr->child) {
- if (wmPtr->child != NULL) {
- Tk_DeleteEventHandler(wmPtr->child, StructureNotifyMask,
- ChildEventProc, wmPtr);
- Tk_ManageGeometry(wmPtr->child, (Tk_GeomMgr *) 0, (ClientData)0);
- Tk_UnmapWindow(wmPtr->child);
- }
- Tk_CreateEventHandler(tkwin, StructureNotifyMask, ChildEventProc,
- wmPtr);
- Tk_ManageGeometry(tkwin, &winMarkerMgrInfo, wmPtr);
- }
- wmPtr->child = tkwin;
- markerPtr->flags |= MAP_ITEM;
- if (markerPtr->drawUnder) {
- graphPtr->flags |= CACHE_DIRTY;
- }
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapWindowProc --
- *
- * Calculate the layout position for a window marker. Positional
- * information is saved in the marker.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapWindowProc(Marker *markerPtr)
-{
- WindowMarker *wmPtr = (WindowMarker *)markerPtr;
- Graph *graphPtr = markerPtr->obj.graphPtr;
- Point2d anchorPt;
- Region2d extents;
- int width, height;
-
- if (wmPtr->child == (Tk_Window)NULL) {
- return;
- }
- anchorPt = MapPoint(markerPtr->worldPts, &markerPtr->axes);
-
- width = Tk_ReqWidth(wmPtr->child);
- height = Tk_ReqHeight(wmPtr->child);
- if (wmPtr->reqWidth > 0) {
- width = wmPtr->reqWidth;
- }
- if (wmPtr->reqHeight > 0) {
- height = wmPtr->reqHeight;
- }
- wmPtr->anchorPt = Blt_AnchorPoint(anchorPt.x, anchorPt.y, (double)width,
- (double)height, wmPtr->anchor);
- wmPtr->anchorPt.x += markerPtr->xOffset;
- wmPtr->anchorPt.y += markerPtr->yOffset;
- wmPtr->width = width;
- wmPtr->height = height;
-
- /*
- * Determine the bounding box of the window and test to see if it is at
- * least partially contained within the plotting area.
- */
- extents.left = wmPtr->anchorPt.x;
- extents.top = wmPtr->anchorPt.y;
- extents.right = wmPtr->anchorPt.x + wmPtr->width - 1;
- extents.bottom = wmPtr->anchorPt.y + wmPtr->height - 1;
- markerPtr->clipped = BoxesDontOverlap(graphPtr, &extents);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PointInWindowProc --
- *
- *---------------------------------------------------------------------------
- */
-static int
-PointInWindowProc(Marker *markerPtr, Point2d *samplePtr)
-{
- WindowMarker *wmPtr = (WindowMarker *)markerPtr;
-
- return ((samplePtr->x >= wmPtr->anchorPt.x) &&
- (samplePtr->x < (wmPtr->anchorPt.x + wmPtr->width)) &&
- (samplePtr->y >= wmPtr->anchorPt.y) &&
- (samplePtr->y < (wmPtr->anchorPt.y + wmPtr->height)));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RegionInWindowProc --
- *
- *---------------------------------------------------------------------------
- */
-static int
-RegionInWindowProc(Marker *markerPtr, Region2d *extsPtr, int enclosed)
-{
- WindowMarker *wmPtr = (WindowMarker *)markerPtr;
-
- if (markerPtr->nWorldPts < 1) {
- return FALSE;
- }
- if (enclosed) {
- return ((wmPtr->anchorPt.x >= extsPtr->left) &&
- (wmPtr->anchorPt.y >= extsPtr->top) &&
- ((wmPtr->anchorPt.x + wmPtr->width) <= extsPtr->right) &&
- ((wmPtr->anchorPt.y + wmPtr->height) <= extsPtr->bottom));
- }
- return !((wmPtr->anchorPt.x >= extsPtr->right) ||
- (wmPtr->anchorPt.y >= extsPtr->bottom) ||
- ((wmPtr->anchorPt.x + wmPtr->width) <= extsPtr->left) ||
- ((wmPtr->anchorPt.y + wmPtr->height) <= extsPtr->top));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawWindowProc --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-DrawWindowProc(Marker *markerPtr, Drawable drawable)
-{
- WindowMarker *wmPtr = (WindowMarker *)markerPtr;
-
- if (wmPtr->child == NULL) {
- return;
- }
- if ((wmPtr->height != Tk_Height(wmPtr->child)) ||
- (wmPtr->width != Tk_Width(wmPtr->child)) ||
- ((int)wmPtr->anchorPt.x != Tk_X(wmPtr->child)) ||
- ((int)wmPtr->anchorPt.y != Tk_Y(wmPtr->child))) {
- Tk_MoveResizeWindow(wmPtr->child, (int)wmPtr->anchorPt.x,
- (int)wmPtr->anchorPt.y, wmPtr->width, wmPtr->height);
- }
- if (!Tk_IsMapped(wmPtr->child)) {
- Tk_MapWindow(wmPtr->child);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WindowToPostscriptProc --
- *
- *---------------------------------------------------------------------------
- */
-static void
-WindowToPostscriptProc(Marker *markerPtr, Blt_Ps ps)
-{
- WindowMarker *wmPtr = (WindowMarker *)markerPtr;
-
- if (wmPtr->child == NULL) {
- return;
- }
- if (Tk_IsMapped(wmPtr->child)) {
- Blt_Ps_XDrawWindow(ps, wmPtr->child, wmPtr->anchorPt.x,
- wmPtr->anchorPt.y);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeWindowProc --
- *
- * Destroys the structure containing the attributes of the window *
- * marker.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Window is destroyed and removed from the screen.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeWindowProc(Marker *markerPtr)
-{
- WindowMarker *wmPtr = (WindowMarker *)markerPtr;
-
- if (wmPtr->child != NULL) {
- Tk_DeleteEventHandler(wmPtr->child, StructureNotifyMask,
- ChildEventProc, wmPtr);
- Tk_ManageGeometry(wmPtr->child, (Tk_GeomMgr *) 0, (ClientData)0);
- Tk_DestroyWindow(wmPtr->child);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateWindowProc --
- *
- * Allocate memory and initialize methods for the new window marker.
- *
- * Results:
- * The pointer to the newly allocated marker structure is returned.
- *
- * Side effects:
- * Memory is allocated for the window marker structure.
- *
- *---------------------------------------------------------------------------
- */
-static Marker *
-CreateWindowProc(void)
-{
- WindowMarker *wmPtr;
-
- wmPtr = Blt_AssertCalloc(1, sizeof(WindowMarker));
- wmPtr->classPtr = &windowMarkerClass;
- return (Marker *)wmPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChildEventProc --
- *
- * This procedure is invoked whenever StructureNotify events occur for a
- * window that's managed as part of a graph window marker. This
- * procedure's only purpose is to clean up when windows are deleted.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The window is disassociated from the window item when it is
- * deleted.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ChildEventProc(ClientData clientData, XEvent *eventPtr)
-{
- WindowMarker *wmPtr = clientData;
-
- if (eventPtr->type == DestroyNotify) {
- wmPtr->child = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChildGeometryProc --
- *
- * This procedure is invoked whenever a window that's associated with a
- * window item changes its requested dimensions.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The size and location on the window of the window may change,
- * depending on the options specified for the window item.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-ChildGeometryProc(ClientData clientData, Tk_Window tkwin)
-{
- WindowMarker *wmPtr = clientData;
-
- if (wmPtr->reqWidth == 0) {
- wmPtr->width = Tk_ReqWidth(tkwin);
- }
- if (wmPtr->reqHeight == 0) {
- wmPtr->height = Tk_ReqHeight(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChildCustodyProc --
- *
- * This procedure is invoked when an embedded window has been stolen by
- * another geometry manager. The information and memory associated with
- * the widget is released.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the graph to be redrawn without the embedded widget at
- * the next idle point.
- *
- *---------------------------------------------------------------------------
- */
- /* ARGSUSED */
-static void
-ChildCustodyProc(ClientData clientData, Tk_Window tkwin)
-{
- Marker *markerPtr = clientData;
- Graph *graphPtr;
-
- graphPtr = markerPtr->obj.graphPtr;
- markerPtr->flags |= DELETE_PENDING;
- Tcl_EventuallyFree(markerPtr, FreeMarker);
- /*
- * Not really needed. We should get an Expose event when the child window
- * is unmapped.
- */
- Blt_EventuallyRedrawGraph(graphPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapLineProc --
- *
- * Calculate the layout position for a line marker. Positional
- * information is saved in the marker. The line positions are stored in
- * an array of points (malloc'ed).
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapLineProc(Marker *markerPtr)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
- LineMarker *lmPtr = (LineMarker *)markerPtr;
- Point2d *srcPtr, *pend;
- Segment2d *segments, *segPtr;
- Point2d p, q;
- Region2d extents;
-
- lmPtr->nSegments = 0;
- if (lmPtr->segments != NULL) {
- Blt_Free(lmPtr->segments);
- }
- if (markerPtr->nWorldPts < 2) {
- return; /* Too few points */
- }
- Blt_GraphExtents(graphPtr, &extents);
-
- /*
- * Allow twice the number of world coordinates. The line will represented
- * as series of line segments, not one continous polyline. This is
- * because clipping against the plot area may chop the line into several
- * disconnected segments.
- */
- segments = Blt_AssertMalloc(markerPtr->nWorldPts * sizeof(Segment2d));
- srcPtr = markerPtr->worldPts;
- p = MapPoint(srcPtr, &markerPtr->axes);
- p.x += markerPtr->xOffset;
- p.y += markerPtr->yOffset;
-
- segPtr = segments;
- for (srcPtr++, pend = markerPtr->worldPts + markerPtr->nWorldPts;
- srcPtr < pend; srcPtr++) {
- Point2d next;
-
- next = MapPoint(srcPtr, &markerPtr->axes);
- next.x += markerPtr->xOffset;
- next.y += markerPtr->yOffset;
- q = next;
- if (Blt_LineRectClip(&extents, &p, &q)) {
- segPtr->p = p;
- segPtr->q = q;
- segPtr++;
- }
- p = next;
- }
- lmPtr->nSegments = segPtr - segments;
- lmPtr->segments = segments;
- markerPtr->clipped = (lmPtr->nSegments == 0);
-}
-
-static int
-PointInLineProc(Marker *markerPtr, Point2d *samplePtr)
-{
- LineMarker *lmPtr = (LineMarker *)markerPtr;
-
- return Blt_PointInSegments(samplePtr, lmPtr->segments, lmPtr->nSegments,
- (double)markerPtr->obj.graphPtr->halo);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RegionInLineProc --
- *
- *---------------------------------------------------------------------------
- */
-static int
-RegionInLineProc(Marker *markerPtr, Region2d *extsPtr, int enclosed)
-{
- if (markerPtr->nWorldPts < 2) {
- return FALSE;
- }
- if (enclosed) {
- Point2d *pp, *pend;
-
- for (pp = markerPtr->worldPts, pend = pp + markerPtr->nWorldPts;
- pp < pend; pp++) {
- Point2d p;
-
- p = MapPoint(pp, &markerPtr->axes);
- if ((p.x < extsPtr->left) && (p.x > extsPtr->right) &&
- (p.y < extsPtr->top) && (p.y > extsPtr->bottom)) {
- return FALSE;
- }
- }
- return TRUE; /* All points inside bounding box. */
- } else {
- int count;
- Point2d *pp, *pend;
-
- count = 0;
- for (pp = markerPtr->worldPts, pend = pp + (markerPtr->nWorldPts - 1);
- pp < pend; pp++) {
- Point2d p, q;
-
- p = MapPoint(pp, &markerPtr->axes);
- q = MapPoint(pp + 1, &markerPtr->axes);
- if (Blt_LineRectClip(extsPtr, &p, &q)) {
- count++;
- }
- }
- return (count > 0); /* At least 1 segment passes through
- * region. */
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawLineProc --
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawLineProc(Marker *markerPtr, Drawable drawable)
-{
- LineMarker *lmPtr = (LineMarker *)markerPtr;
-
- if (lmPtr->nSegments > 0) {
- Graph *graphPtr = markerPtr->obj.graphPtr;
-
- Blt_Draw2DSegments(graphPtr->display, drawable, lmPtr->gc,
- lmPtr->segments, lmPtr->nSegments);
- if (lmPtr->xor) { /* Toggle the drawing state */
- lmPtr->xorState = (lmPtr->xorState == 0);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureLineProc --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) a line marker.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as line width, colors, dashes,
- * etc. get set for markerPtr; old resources get freed, if there were
- * any. The marker is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ConfigureLineProc(Marker *markerPtr)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
- LineMarker *lmPtr = (LineMarker *)markerPtr;
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
- Drawable drawable;
-
- drawable = Tk_WindowId(graphPtr->tkwin);
- gcMask = (GCLineWidth | GCLineStyle | GCCapStyle | GCJoinStyle);
- if (lmPtr->outlineColor != NULL) {
- gcMask |= GCForeground;
- gcValues.foreground = lmPtr->outlineColor->pixel;
- }
- if (lmPtr->fillColor != NULL) {
- gcMask |= GCBackground;
- gcValues.background = lmPtr->fillColor->pixel;
- }
- gcValues.cap_style = lmPtr->capStyle;
- gcValues.join_style = lmPtr->joinStyle;
- gcValues.line_width = LineWidth(lmPtr->lineWidth);
- gcValues.line_style = LineSolid;
- if (LineIsDashed(lmPtr->dashes)) {
- gcValues.line_style =
- (gcMask & GCBackground) ? LineDoubleDash : LineOnOffDash;
- }
- if (lmPtr->xor) {
- unsigned long pixel;
- gcValues.function = GXxor;
-
- gcMask |= GCFunction;
- if (graphPtr->plotBg == NULL) {
- pixel = WhitePixelOfScreen(Tk_Screen(graphPtr->tkwin));
- } else {
- pixel = Blt_BackgroundBorderColor(graphPtr->plotBg)->pixel;
- }
- if (gcMask & GCBackground) {
- gcValues.background ^= pixel;
- }
- gcValues.foreground ^= pixel;
- if (drawable != None) {
- DrawLineProc(markerPtr, drawable);
- }
- }
- newGC = Blt_GetPrivateGC(graphPtr->tkwin, gcMask, &gcValues);
- if (lmPtr->gc != NULL) {
- Blt_FreePrivateGC(graphPtr->display, lmPtr->gc);
- }
- if (LineIsDashed(lmPtr->dashes)) {
- Blt_SetDashes(graphPtr->display, newGC, &lmPtr->dashes);
- }
- lmPtr->gc = newGC;
- if (lmPtr->xor) {
- if (drawable != None) {
- MapLineProc(markerPtr);
- DrawLineProc(markerPtr, drawable);
- }
- return TCL_OK;
- }
- markerPtr->flags |= MAP_ITEM;
- if (markerPtr->drawUnder) {
- graphPtr->flags |= CACHE_DIRTY;
- }
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LineToPostscriptProc --
- *
- * Prints postscript commands to display the connect line. Dashed lines
- * need to be handled specially, especially if a background color is
- * designated.
- *
- * Results:
- * None.
- *
- * Side effects:
- * PostScript output commands are saved in the interpreter
- * (infoPtr->interp) result field.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LineToPostscriptProc(Marker *markerPtr, Blt_Ps ps)
-{
- LineMarker *lmPtr = (LineMarker *)markerPtr;
-
- if (lmPtr->nSegments > 0) {
- Blt_Ps_XSetLineAttributes(ps, lmPtr->outlineColor,
- lmPtr->lineWidth, &lmPtr->dashes, lmPtr->capStyle,
- lmPtr->joinStyle);
- if ((LineIsDashed(lmPtr->dashes)) && (lmPtr->fillColor != NULL)) {
- Blt_Ps_Append(ps, "/DashesProc {\n gsave\n ");
- Blt_Ps_XSetBackground(ps, lmPtr->fillColor);
- Blt_Ps_Append(ps, " ");
- Blt_Ps_XSetDashes(ps, (Blt_Dashes *)NULL);
- Blt_Ps_VarAppend(ps,
- "stroke\n",
- " grestore\n",
- "} def\n", (char *)NULL);
- } else {
- Blt_Ps_Append(ps, "/DashesProc {} def\n");
- }
- Blt_Ps_Draw2DSegments(ps, lmPtr->segments, lmPtr->nSegments);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeLineProc --
- *
- * Destroys the structure and attributes of a line marker.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Line attributes (GCs, colors, stipple, etc) get released. Memory is
- * deallocated, X resources are freed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeLineProc(Marker *markerPtr)
-{
- LineMarker *lmPtr = (LineMarker *)markerPtr;
- Graph *graphPtr = markerPtr->obj.graphPtr;
-
- if (lmPtr->gc != NULL) {
- Blt_FreePrivateGC(graphPtr->display, lmPtr->gc);
- }
- if (lmPtr->segments != NULL) {
- Blt_Free(lmPtr->segments);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateLineProc --
- *
- * Allocate memory and initialize methods for a new line marker.
- *
- * Results:
- * The pointer to the newly allocated marker structure is returned.
- *
- * Side effects:
- * Memory is allocated for the line marker structure.
- *
- *---------------------------------------------------------------------------
- */
-static Marker *
-CreateLineProc(void)
-{
- LineMarker *lmPtr;
-
- lmPtr = Blt_AssertCalloc(1, sizeof(LineMarker));
- lmPtr->classPtr = &lineMarkerClass;
- lmPtr->xor = FALSE;
- lmPtr->capStyle = CapButt;
- lmPtr->joinStyle = JoinMiter;
- return (Marker *)lmPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapPolygonProc --
- *
- * Calculate the layout position for a polygon marker. Positional
- * information is saved in the polygon in an array of points (malloc'ed).
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapPolygonProc(Marker *markerPtr)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
- PolygonMarker *pmPtr = (PolygonMarker *)markerPtr;
- Point2d *screenPts;
- Region2d extents;
- int nScreenPts;
-
- if (pmPtr->outlinePts != NULL) {
- Blt_Free(pmPtr->outlinePts);
- pmPtr->outlinePts = NULL;
- pmPtr->nOutlinePts = 0;
- }
- if (pmPtr->fillPts != NULL) {
- Blt_Free(pmPtr->fillPts);
- pmPtr->fillPts = NULL;
- pmPtr->nFillPts = 0;
- }
- if (pmPtr->screenPts != NULL) {
- Blt_Free(pmPtr->screenPts);
- pmPtr->screenPts = NULL;
- }
- if (markerPtr->nWorldPts < 3) {
- return; /* Too few points */
- }
-
- /*
- * Allocate and fill a temporary array to hold the screen coordinates of
- * the polygon.
- */
- nScreenPts = markerPtr->nWorldPts + 1;
- screenPts = Blt_AssertMalloc((nScreenPts + 1) * sizeof(Point2d));
- {
- Point2d *sp, *dp, *send;
-
- dp = screenPts;
- for (sp = markerPtr->worldPts, send = sp + markerPtr->nWorldPts;
- sp < send; sp++) {
- *dp = MapPoint(sp, &markerPtr->axes);
- dp->x += markerPtr->xOffset;
- dp->y += markerPtr->yOffset;
- dp++;
- }
- *dp = screenPts[0];
- }
- Blt_GraphExtents(graphPtr, &extents);
- markerPtr->clipped = TRUE;
- if (pmPtr->fill.fgColor != NULL) { /* Polygon fill required. */
- Point2d *fillPts;
- int n;
-
- fillPts = Blt_AssertMalloc(sizeof(Point2d) * nScreenPts * 3);
- n = Blt_PolyRectClip(&extents, screenPts, markerPtr->nWorldPts,fillPts);
- if (n < 3) {
- Blt_Free(fillPts);
- } else {
- pmPtr->nFillPts = n;
- pmPtr->fillPts = fillPts;
- markerPtr->clipped = FALSE;
- }
- }
- if ((pmPtr->outline.fgColor != NULL) && (pmPtr->lineWidth > 0)) {
- Segment2d *outlinePts;
- Segment2d *segPtr;
- Point2d *sp, *send;
-
- /*
- * Generate line segments representing the polygon outline. The
- * resulting outline may or may not be closed from viewport clipping.
- */
- outlinePts = Blt_Malloc(nScreenPts * sizeof(Segment2d));
- if (outlinePts == NULL) {
- return; /* Can't allocate point array */
- }
- /*
- * Note that this assumes that the point array contains an extra point
- * that closes the polygon.
- */
- segPtr = outlinePts;
- for (sp = screenPts, send = sp + (nScreenPts - 1); sp < send; sp++) {
- segPtr->p = sp[0];
- segPtr->q = sp[1];
- if (Blt_LineRectClip(&extents, &segPtr->p, &segPtr->q)) {
- segPtr++;
- }
- }
- pmPtr->nOutlinePts = segPtr - outlinePts;
- pmPtr->outlinePts = outlinePts;
- if (pmPtr->nOutlinePts > 0) {
- markerPtr->clipped = FALSE;
- }
- }
- pmPtr->screenPts = screenPts;
-}
-
-static int
-PointInPolygonProc(Marker *markerPtr, Point2d *samplePtr)
-{
- PolygonMarker *pmPtr = (PolygonMarker *)markerPtr;
-
- if ((markerPtr->nWorldPts >= 3) && (pmPtr->screenPts != NULL)) {
- return Blt_PointInPolygon(samplePtr, pmPtr->screenPts,
- markerPtr->nWorldPts + 1);
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RegionInPolygonProc --
- *
- *---------------------------------------------------------------------------
- */
-static int
-RegionInPolygonProc(Marker *markerPtr, Region2d *extsPtr, int enclosed)
-{
- PolygonMarker *pmPtr = (PolygonMarker *)markerPtr;
-
- if ((markerPtr->nWorldPts >= 3) && (pmPtr->screenPts != NULL)) {
- return Blt_RegionInPolygon(extsPtr, pmPtr->screenPts,
- markerPtr->nWorldPts, enclosed);
- }
- return FALSE;
-}
-
-static void
-DrawPolygonProc(Marker *markerPtr, Drawable drawable)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
- PolygonMarker *pmPtr = (PolygonMarker *)markerPtr;
-
- /* Draw polygon fill region */
- if ((pmPtr->nFillPts > 0) && (pmPtr->fill.fgColor != NULL)) {
- XPoint *dp, *points;
- Point2d *sp, *send;
-
- points = Blt_Malloc(pmPtr->nFillPts * sizeof(XPoint));
- if (points == NULL) {
- return;
- }
- dp = points;
- for (sp = pmPtr->fillPts, send = sp + pmPtr->nFillPts; sp < send;
- sp++) {
- dp->x = (short int)sp->x;
- dp->y = (short int)sp->y;
- dp++;
- }
-
- XFillPolygon(graphPtr->display, drawable, pmPtr->fillGC, points,
- pmPtr->nFillPts, Complex, CoordModeOrigin);
- Blt_Free(points);
- }
- /* and then the outline */
- if ((pmPtr->nOutlinePts > 0) && (pmPtr->lineWidth > 0) &&
- (pmPtr->outline.fgColor != NULL)) {
- Blt_Draw2DSegments(graphPtr->display, drawable, pmPtr->outlineGC,
- pmPtr->outlinePts, pmPtr->nOutlinePts);
- }
-}
-
-
-static void
-PolygonToPostscriptProc(Marker *markerPtr, Blt_Ps ps)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
- PolygonMarker *pmPtr = (PolygonMarker *)markerPtr;
-
- if (pmPtr->fill.fgColor != NULL) {
-
- /*
- * Options: fg bg
- * Draw outline only.
- * x Draw solid or stipple.
- * x x Draw solid or stipple.
- */
-
- /* Create a path to use for both the polygon and its outline. */
- Blt_Ps_Polyline(ps, pmPtr->fillPts, pmPtr->nFillPts);
-
- /* If the background fill color was specified, draw the polygon in a
- * solid fashion with that color. */
- if (pmPtr->fill.bgColor != NULL) {
- /* Draw the solid background as the background layer of the opaque
- * stipple */
- Blt_Ps_XSetBackground(ps, pmPtr->fill.bgColor);
- /* Retain the path. We'll need it for the foreground layer. */
- Blt_Ps_Append(ps, "gsave fill grestore\n");
- }
- Blt_Ps_XSetForeground(ps, pmPtr->fill.fgColor);
- if (pmPtr->stipple != None) {
- /* Draw the stipple in the foreground color. */
- Blt_Ps_XSetStipple(ps, graphPtr->display, pmPtr->stipple);
- } else {
- Blt_Ps_Append(ps, "fill\n");
- }
- }
-
- /* Draw the outline in the foreground color. */
- if ((pmPtr->lineWidth > 0) && (pmPtr->outline.fgColor != NULL)) {
-
- /* Set up the line attributes. */
- Blt_Ps_XSetLineAttributes(ps, pmPtr->outline.fgColor,
- pmPtr->lineWidth, &pmPtr->dashes, pmPtr->capStyle,
- pmPtr->joinStyle);
-
- /*
- * Define on-the-fly a PostScript macro "DashesProc" that will be
- * executed for each call to the Polygon drawing routine. If the line
- * isn't dashed, simply make this an empty definition.
- */
- if ((pmPtr->outline.bgColor != NULL) && (LineIsDashed(pmPtr->dashes))) {
- Blt_Ps_Append(ps, "/DashesProc {\ngsave\n ");
- Blt_Ps_XSetBackground(ps, pmPtr->outline.bgColor);
- Blt_Ps_Append(ps, " ");
- Blt_Ps_XSetDashes(ps, (Blt_Dashes *)NULL);
- Blt_Ps_Append(ps, "stroke\n grestore\n} def\n");
- } else {
- Blt_Ps_Append(ps, "/DashesProc {} def\n");
- }
- Blt_Ps_Draw2DSegments(ps, pmPtr->outlinePts, pmPtr->nOutlinePts);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigurePolygonProc --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) a polygon
- * marker.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as polygon color, dashes, fillstyle,
- * etc. get set for markerPtr; old resources get freed, if there were
- * any. The marker is eventually redisplayed.
- *
- * --------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ConfigurePolygonProc(Marker *markerPtr)
-{
- Graph *graphPtr = markerPtr->obj.graphPtr;
- PolygonMarker *pmPtr = (PolygonMarker *)markerPtr;
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
- Drawable drawable;
-
- drawable = Tk_WindowId(graphPtr->tkwin);
- gcMask = (GCLineWidth | GCLineStyle);
- if (pmPtr->outline.fgColor != NULL) {
- gcMask |= GCForeground;
- gcValues.foreground = pmPtr->outline.fgColor->pixel;
- }
- if (pmPtr->outline.bgColor != NULL) {
- gcMask |= GCBackground;
- gcValues.background = pmPtr->outline.bgColor->pixel;
- }
- gcMask |= (GCCapStyle | GCJoinStyle);
- gcValues.cap_style = pmPtr->capStyle;
- gcValues.join_style = pmPtr->joinStyle;
- gcValues.line_style = LineSolid;
- gcValues.dash_offset = 0;
- gcValues.line_width = LineWidth(pmPtr->lineWidth);
- if (LineIsDashed(pmPtr->dashes)) {
- gcValues.line_style = (pmPtr->outline.bgColor == NULL)
- ? LineOnOffDash : LineDoubleDash;
- }
- if (pmPtr->xor) {
- unsigned long pixel;
- gcValues.function = GXxor;
-
- gcMask |= GCFunction;
- if (graphPtr->plotBg == NULL) {
- /* The graph's color option may not have been set yet */
- pixel = WhitePixelOfScreen(Tk_Screen(graphPtr->tkwin));
- } else {
- pixel = Blt_BackgroundBorderColor(graphPtr->plotBg)->pixel;
- }
- if (gcMask & GCBackground) {
- gcValues.background ^= pixel;
- }
- gcValues.foreground ^= pixel;
- if (drawable != None) {
- DrawPolygonProc(markerPtr, drawable);
- }
- }
- newGC = Blt_GetPrivateGC(graphPtr->tkwin, gcMask, &gcValues);
- if (LineIsDashed(pmPtr->dashes)) {
- Blt_SetDashes(graphPtr->display, newGC, &pmPtr->dashes);
- }
- if (pmPtr->outlineGC != NULL) {
- Blt_FreePrivateGC(graphPtr->display, pmPtr->outlineGC);
- }
- pmPtr->outlineGC = newGC;
-
- gcMask = 0;
- if (pmPtr->fill.fgColor != NULL) {
- gcMask |= GCForeground;
- gcValues.foreground = pmPtr->fill.fgColor->pixel;
- }
- if (pmPtr->fill.bgColor != NULL) {
- gcMask |= GCBackground;
- gcValues.background = pmPtr->fill.bgColor->pixel;
- }
- if (pmPtr->stipple != None) {
- gcValues.stipple = pmPtr->stipple;
- gcValues.fill_style = (pmPtr->fill.bgColor != NULL)
- ? FillOpaqueStippled : FillStippled;
- gcMask |= (GCStipple | GCFillStyle);
- }
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (pmPtr->fillGC != NULL) {
- Tk_FreeGC(graphPtr->display, pmPtr->fillGC);
- }
- pmPtr->fillGC = newGC;
-
- if ((gcMask == 0) && !(graphPtr->flags & RESET_AXES) && (pmPtr->xor)) {
- if (drawable != None) {
- MapPolygonProc(markerPtr);
- DrawPolygonProc(markerPtr, drawable);
- }
- return TCL_OK;
- }
- markerPtr->flags |= MAP_ITEM;
- if (markerPtr->drawUnder) {
- graphPtr->flags |= CACHE_DIRTY;
- }
- graphPtr->flags |= RESET_WORLD;
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreePolygonProc --
- *
- * Release memory and resources allocated for the polygon element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the polygon element is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreePolygonProc(Marker *markerPtr)
-{
- PolygonMarker *pmPtr = (PolygonMarker *)markerPtr;
- Graph *graphPtr = markerPtr->obj.graphPtr;
-
- if (pmPtr->fillGC != NULL) {
- Tk_FreeGC(graphPtr->display, pmPtr->fillGC);
- }
- if (pmPtr->outlineGC != NULL) {
- Blt_FreePrivateGC(graphPtr->display, pmPtr->outlineGC);
- }
- if (pmPtr->fillPts != NULL) {
- Blt_Free(pmPtr->fillPts);
- }
- if (pmPtr->outlinePts != NULL) {
- Blt_Free(pmPtr->outlinePts);
- }
- if (pmPtr->screenPts != NULL) {
- Blt_Free(pmPtr->screenPts);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreatePolygonProc --
- *
- * Allocate memory and initialize methods for the new polygon marker.
- *
- * Results:
- * The pointer to the newly allocated marker structure is returned.
- *
- * Side effects:
- * Memory is allocated for the polygon marker structure.
- *
- * --------------------------------------------------------------------------
- */
-static Marker *
-CreatePolygonProc(void)
-{
- PolygonMarker *pmPtr;
-
- pmPtr = Blt_AssertCalloc(1, sizeof(PolygonMarker));
- pmPtr->classPtr = &polygonMarkerClass;
- pmPtr->capStyle = CapButt;
- pmPtr->joinStyle = JoinMiter;
- return (Marker *)pmPtr;
-}
-
-static int
-GetMarkerFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr,
- Marker **markerPtrPtr)
-{
- Blt_HashEntry *hPtr;
- const char *string;
-
- string = Tcl_GetString(objPtr);
- hPtr = Blt_FindHashEntry(&graphPtr->markers.table, string);
- if (hPtr != NULL) {
- *markerPtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
- }
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find marker \"", string,
- "\" in \"", Tk_PathName(graphPtr->tkwin), (char *)NULL);
- }
- return TCL_ERROR;
-}
-
-
-static int
-RenameMarker(Graph *graphPtr, Marker *markerPtr, const char *oldName,
- const char *newName)
-{
- int isNew;
- Blt_HashEntry *hPtr;
-
- /* Rename the marker only if no marker already exists by that name */
- hPtr = Blt_CreateHashEntry(&graphPtr->markers.table, newName, &isNew);
- if (!isNew) {
- Tcl_AppendResult(graphPtr->interp, "can't rename marker: \"", newName,
- "\" already exists", (char *)NULL);
- return TCL_ERROR;
- }
- markerPtr->obj.name = Blt_AssertStrdup(newName);
- markerPtr->hashPtr = hPtr;
- Blt_SetHashValue(hPtr, (char *)markerPtr);
-
- /* Delete the old hash entry */
- hPtr = Blt_FindHashEntry(&graphPtr->markers.table, oldName);
- Blt_DeleteHashEntry(&graphPtr->markers.table, hPtr);
- if (oldName != NULL) {
- Blt_Free(oldName);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * Returns a list of marker identifiers in interp->result;
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-NamesOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (objc == 3) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(graphPtr->markers.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Marker *markerPtr;
-
- markerPtr = Blt_Chain_GetValue(link);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(markerPtr->obj.name, -1));
- }
- } else {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(graphPtr->markers.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Marker *markerPtr;
- int i;
-
- markerPtr = Blt_Chain_GetValue(link);
- for (i = 3; i < objc; i++) {
- const char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- if (Tcl_StringMatch(markerPtr->obj.name, pattern)) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(markerPtr->obj.name, -1));
- break;
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BindOp --
- *
- * .g element bind elemName sequence command
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BindOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (objc == 3) {
- Blt_HashEntry *hp;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hp = Blt_FirstHashEntry(&graphPtr->markers.tagTable, &iter);
- hp != NULL; hp = Blt_NextHashEntry(&iter)) {
- const char *tag;
- Tcl_Obj *objPtr;
-
- tag = Blt_GetHashKey(&graphPtr->markers.tagTable, hp);
- objPtr = Tcl_NewStringObj(tag, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- return Blt_ConfigureBindingsFromObj(interp, graphPtr->bindTable,
- Blt_MakeMarkerTag(graphPtr, Tcl_GetString(objv[3])),
- objc - 4, objv + 4);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CgetOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Marker *markerPtr;
-
- if (GetMarkerFromObj(interp, graphPtr, objv[3], &markerPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_ConfigureValueFromObj(interp, graphPtr->tkwin,
- markerPtr->classPtr->configSpecs, (char *)markerPtr, objv[4], 0)
- != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Results:
- * The return value is a standard TCL result.
- *
- * Side Effects:
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Marker *markerPtr;
- Tcl_Obj *const *options;
- const char *oldName;
- const char *string;
- int flags = BLT_CONFIG_OBJV_ONLY;
- int nNames, nOpts;
- int i;
- int under;
-
- markerPtr = NULL; /* Suppress compiler warning. */
-
- /* Figure out where the option value pairs begin */
- objc -= 3;
- objv += 3;
- for (i = 0; i < objc; i++) {
- string = Tcl_GetString(objv[i]);
- if (string[0] == '-') {
- break;
- }
- if (GetMarkerFromObj(interp, graphPtr, objv[i], &markerPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- nNames = i; /* # of element names specified */
- nOpts = objc - i; /* # of options specified */
- options = objv + nNames; /* Start of options in objv */
-
- for (i = 0; i < nNames; i++) {
- GetMarkerFromObj(interp, graphPtr, objv[i], &markerPtr);
- if (nOpts == 0) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin,
- markerPtr->classPtr->configSpecs, (char *)markerPtr,
- (Tcl_Obj *)NULL, flags);
- } else if (nOpts == 1) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin,
- markerPtr->classPtr->configSpecs, (char *)markerPtr,
- options[0], flags);
- }
- /* Save the old marker name. */
- oldName = markerPtr->obj.name;
- under = markerPtr->drawUnder;
- if (Blt_ConfigureWidgetFromObj(interp, graphPtr->tkwin,
- markerPtr->classPtr->configSpecs, nOpts, options,
- (char *)markerPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- if (oldName != markerPtr->obj.name) {
- if (RenameMarker(graphPtr, markerPtr, oldName, markerPtr->obj.name)
- != TCL_OK) {
- markerPtr->obj.name = oldName;
- return TCL_ERROR;
- }
- }
- if ((*markerPtr->classPtr->configProc) (markerPtr) != TCL_OK) {
-
- return TCL_ERROR;
- }
- if (markerPtr->drawUnder != under) {
- graphPtr->flags |= CACHE_DIRTY;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateOp --
- *
- * This procedure creates and initializes a new marker.
- *
- * Results:
- * The return value is a pointer to a structure describing the new
- * element. If an error occurred, then the return value is NULL and an
- * error message is left in interp->result.
- *
- * Side effects:
- * Memory is allocated, etc.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Marker *markerPtr;
- Blt_HashEntry *hPtr;
- int isNew;
- ClassId classId;
- int i;
- const char *name;
- char ident[200];
- const char *string;
- char c;
-
- string = Tcl_GetString(objv[3]);
- c = string[0];
- /* Create the new marker based upon the given type */
- if ((c == 't') && (strcmp(string, "text") == 0)) {
- classId = CID_MARKER_TEXT;
- } else if ((c == 'l') && (strcmp(string, "line") == 0)) {
- classId = CID_MARKER_LINE;
- } else if ((c == 'p') && (strcmp(string, "polygon") == 0)) {
- classId = CID_MARKER_POLYGON;
- } else if ((c == 'i') && (strcmp(string, "image") == 0)) {
- classId = CID_MARKER_IMAGE;
- } else if ((c == 'b') && (strcmp(string, "bitmap") == 0)) {
- classId = CID_MARKER_BITMAP;
- } else if ((c == 'w') && (strcmp(string, "window") == 0)) {
- classId = CID_MARKER_WINDOW;
- } else {
- Tcl_AppendResult(interp, "unknown marker type \"", string,
- "\": should be \"text\", \"line\", \"polygon\", \"bitmap\", \"image\", or \
-\"window\"", (char *)NULL);
- return TCL_ERROR;
- }
- /* Scan for "-name" option. We need it for the component name */
- name = NULL;
- for (i = 4; i < objc; i += 2) {
- int length;
-
- string = Tcl_GetStringFromObj(objv[i], &length);
- if ((length > 1) && (strncmp(string, "-name", length) == 0)) {
- name = Tcl_GetString(objv[i + 1]);
- break;
- }
- }
- /* If no name was given for the marker, make up one. */
- if (name == NULL) {
- sprintf_s(ident, 200, "marker%d", graphPtr->nextMarkerId++);
- name = ident;
- } else if (name[0] == '-') {
- Tcl_AppendResult(interp, "name of marker \"", name,
- "\" can't start with a '-'", (char *)NULL);
- return TCL_ERROR;
- }
- markerPtr = CreateMarker(graphPtr, name, classId);
- if (Blt_ConfigureComponentFromObj(interp, graphPtr->tkwin, name,
- markerPtr->obj.className, markerPtr->classPtr->configSpecs,
- objc - 4, objv + 4, (char *)markerPtr, 0) != TCL_OK) {
- DestroyMarker(markerPtr);
- return TCL_ERROR;
- }
- if ((*markerPtr->classPtr->configProc) (markerPtr) != TCL_OK) {
- DestroyMarker(markerPtr);
- return TCL_ERROR;
- }
- hPtr = Blt_CreateHashEntry(&graphPtr->markers.table, name, &isNew);
- if (!isNew) {
- Marker *oldPtr;
- /*
- * Marker by the same name already exists. Delete the old marker and
- * it's list entry. But save the hash entry.
- */
- oldPtr = Blt_GetHashValue(hPtr);
- oldPtr->hashPtr = NULL;
- DestroyMarker(oldPtr);
- }
- Blt_SetHashValue(hPtr, markerPtr);
- markerPtr->hashPtr = hPtr;
- /* Unlike elements, new markers are drawn on top of old markers. */
- markerPtr->link = Blt_Chain_Prepend(graphPtr->markers.displayList,markerPtr);
- if (markerPtr->drawUnder) {
- graphPtr->flags |= CACHE_DIRTY;
- }
- Blt_EventuallyRedrawGraph(graphPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), name, -1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Deletes the marker given by markerId.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new display list.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DeleteOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- Marker *markerPtr;
-
- if (GetMarkerFromObj(NULL, graphPtr, objv[i], &markerPtr) == TCL_OK) {
- markerPtr->flags |= DELETE_PENDING;
- Tcl_EventuallyFree(markerPtr, FreeMarker);
- }
- }
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetOp --
- *
- * Find the legend entry from the given argument. The argument can be
- * either a screen position "@x,y" or the name of an element.
- *
- * I don't know how useful it is to test with the name of an element.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new legend attributes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-GetOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Marker *markerPtr;
- const char *string;
-
- string = Tcl_GetString(objv[3]);
- if ((string[0] == 'c') && (strcmp(string, "current") == 0)) {
- markerPtr = (Marker *)Blt_GetCurrentItem(graphPtr->bindTable);
- if (markerPtr == NULL) {
- return TCL_OK; /* Report only on markers. */
-
- }
- if ((markerPtr->obj.classId >= CID_MARKER_BITMAP) &&
- (markerPtr->obj.classId <= CID_MARKER_WINDOW)) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- markerPtr->obj.name, -1);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RelinkOp --
- *
- * Reorders the marker (given by the first name) before/after the another
- * marker (given by the second name) in the marker display list. If no
- * second name is given, the marker is placed at the beginning/end of the
- * list.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Graph will be redrawn to reflect the new display list.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-RelinkOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_ChainLink link, place;
- Marker *markerPtr;
- const char *string;
-
- /* Find the marker to be raised or lowered. */
- if (GetMarkerFromObj(interp, graphPtr, objv[3], &markerPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Right now it's assumed that all markers are always in the display
- list. */
- link = markerPtr->link;
- Blt_Chain_UnlinkLink(graphPtr->markers.displayList, markerPtr->link);
-
- place = NULL;
- if (objc == 5) {
- if (GetMarkerFromObj(interp, graphPtr, objv[4], &markerPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- place = markerPtr->link;
- }
-
- /* Link the marker at its new position. */
- string = Tcl_GetString(objv[2]);
- if (string[0] == 'l') {
- Blt_Chain_LinkAfter(graphPtr->markers.displayList, link, place);
- } else {
- Blt_Chain_LinkBefore(graphPtr->markers.displayList, link, place);
- }
- if (markerPtr->drawUnder) {
- graphPtr->flags |= CACHE_DIRTY;
- }
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindOp --
- *
- * Returns if marker by a given ID currently exists.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-FindOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_ChainLink link;
- Region2d extents;
- const char *string;
- int enclosed;
- int left, right, top, bottom;
- int mode;
-
-#define FIND_ENCLOSED (1<<0)
-#define FIND_OVERLAPPING (1<<1)
- string = Tcl_GetString(objv[3]);
- if (strcmp(string, "enclosed") == 0) {
- mode = FIND_ENCLOSED;
- } else if (strcmp(string, "overlapping") == 0) {
- mode = FIND_OVERLAPPING;
- } else {
- Tcl_AppendResult(interp, "bad search type \"", string,
- ": should be \"enclosed\", or \"overlapping\"", (char *)NULL);
- return TCL_ERROR;
- }
-
- if ((Tcl_GetIntFromObj(interp, objv[4], &left) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[5], &top) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[6], &right) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[7], &bottom) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (left < right) {
- extents.left = (double)left;
- extents.right = (double)right;
- } else {
- extents.left = (double)right;
- extents.right = (double)left;
- }
- if (top < bottom) {
- extents.top = (double)top;
- extents.bottom = (double)bottom;
- } else {
- extents.top = (double)bottom;
- extents.bottom = (double)top;
- }
- enclosed = (mode == FIND_ENCLOSED);
- for (link = Blt_Chain_FirstLink(graphPtr->markers.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Marker *markerPtr;
-
- markerPtr = Blt_Chain_GetValue(link);
- if (markerPtr->flags & (HIDE|DELETE_PENDING)) {
- continue;
- }
- if ((markerPtr->elemName != NULL) && (IsElementHidden(markerPtr))) {
- continue;
- }
- if ((*markerPtr->classPtr->regionProc)(markerPtr, &extents, enclosed)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_GetObjResult(interp);
- Tcl_SetStringObj(objPtr, markerPtr->obj.name, -1);
- return TCL_OK;
- }
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), "", -1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExistsOp --
- *
- * Returns if marker by a given ID currently exists.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ExistsOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&graphPtr->markers.table, Tcl_GetString(objv[3]));
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), (hPtr != NULL));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TypeOp --
- *
- * Returns a symbolic name for the type of the marker whose ID is given.
- *
- * Results:
- * A standard TCL result. interp->result will contain the symbolic type
- * of the marker.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TypeOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Marker *markerPtr;
- const char *type;
-
- if (GetMarkerFromObj(interp, graphPtr, objv[3], &markerPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- switch (markerPtr->obj.classId) {
- case CID_MARKER_BITMAP: type = "bitmap"; break;
- case CID_MARKER_IMAGE: type = "image"; break;
- case CID_MARKER_LINE: type = "line"; break;
- case CID_MARKER_POLYGON: type = "polygon"; break;
- case CID_MARKER_TEXT: type = "text"; break;
- case CID_MARKER_WINDOW: type = "window"; break;
- default: type = "???"; break;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), type, -1);
- return TCL_OK;
-}
-
-/* Public routines */
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MarkerOp --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-static Blt_OpSpec markerOps[] =
-{
- {"bind", 1, BindOp, 3, 6, "marker sequence command",},
- {"cget", 2, CgetOp, 5, 5, "marker option",},
- {"configure", 2, ConfigureOp, 4, 0,"marker ?marker?... ?option value?...",},
- {"create", 2, CreateOp, 4, 0, "type ?option value?...",},
- {"delete", 1, DeleteOp, 3, 0, "?marker?...",},
- {"exists", 1, ExistsOp, 4, 4, "marker",},
- {"find", 1, FindOp, 8, 8, "enclosed|overlapping x1 y1 x2 y2",},
- {"get", 1, GetOp, 4, 4, "name",},
- {"lower", 1, RelinkOp, 4, 5, "marker ?afterMarker?",},
- {"names", 1, NamesOp, 3, 0, "?pattern?...",},
- {"raise", 1, RelinkOp, 4, 5, "marker ?beforeMarker?",},
- {"type", 1, TypeOp, 4, 4, "marker",},
-};
-static int nMarkerOps = sizeof(markerOps) / sizeof(Blt_OpSpec);
-
-/*ARGSUSED*/
-int
-Blt_MarkerOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- GraphMarkerProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nMarkerOps, markerOps, BLT_OP_ARG2,
- objc, objv,0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (graphPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MarkersToPostScript --
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MarkersToPostScript(Graph *graphPtr, Blt_Ps ps, int under)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_LastLink(graphPtr->markers.displayList);
- link != NULL; link = Blt_Chain_PrevLink(link)) {
- Marker *markerPtr;
-
- markerPtr = Blt_Chain_GetValue(link);
- if ((markerPtr->classPtr->postscriptProc == NULL) ||
- (markerPtr->nWorldPts == 0)) {
- continue;
- }
- if (markerPtr->drawUnder != under) {
- continue;
- }
- if (markerPtr->flags & (HIDE|DELETE_PENDING)) {
- continue;
- }
- if ((markerPtr->elemName != NULL) && (IsElementHidden(markerPtr))) {
- continue;
- }
- Blt_Ps_VarAppend(ps, "\n% Marker \"", markerPtr->obj.name,
- "\" is a ", markerPtr->obj.className, ".\n", (char *)NULL);
- (*markerPtr->classPtr->postscriptProc) (markerPtr, ps);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawMarkers --
- *
- * Calls the individual drawing routines (based on marker type) for each
- * marker in the display list.
- *
- * A marker will not be drawn if
- *
- * 1) An element linked to the marker (indicated by elemName) is
- * currently hidden.
- *
- * 2) No coordinates have been specified for the marker.
- *
- * 3) The marker is requesting to be drawn at a different level
- * (above/below the elements) from the current mode.
- *
- * 4) The marker is configured as hidden (-hide option).
- *
- * 5) The marker isn't visible in the current viewport (i.e. clipped).
- *
- * Results:
- * None
- *
- * Side Effects:
- * Markers are drawn into the drawable (pixmap) which will eventually
- * be displayed in the graph window.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DrawMarkers(Graph *graphPtr, Drawable drawable, int under)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_LastLink(graphPtr->markers.displayList);
- link != NULL; link = Blt_Chain_PrevLink(link)) {
- Marker *markerPtr;
-
- markerPtr = Blt_Chain_GetValue(link);
-
- if ((markerPtr->nWorldPts == 0) ||
- (markerPtr->drawUnder != under) ||
- (markerPtr->clipped) ||
- (markerPtr->flags & (DELETE_PENDING|HIDE))) {
- continue;
- }
- if ((markerPtr->elemName != NULL) && (IsElementHidden(markerPtr))) {
- continue;
- }
- (*markerPtr->classPtr->drawProc) (markerPtr, drawable);
- }
-}
-
-void
-Blt_ConfigureMarkers(Graph *graphPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(graphPtr->markers.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Marker *markerPtr;
-
- markerPtr = Blt_Chain_GetValue(link);
- (*markerPtr->classPtr->configProc) (markerPtr);
- }
-}
-
-void
-Blt_MapMarkers(Graph *graphPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(graphPtr->markers.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Marker *markerPtr;
-
- markerPtr = Blt_Chain_GetValue(link);
- if (markerPtr->nWorldPts == 0) {
- continue;
- }
- if (markerPtr->flags & (HIDE|DELETE_PENDING)) {
- continue;
- }
- if ((graphPtr->flags & MAP_ALL) || (markerPtr->flags & MAP_ITEM)) {
- (*markerPtr->classPtr->mapProc) (markerPtr);
- markerPtr->flags &= ~MAP_ITEM;
- }
- }
-}
-
-void
-Blt_DestroyMarkers(Graph *graphPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->markers.table, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Marker *markerPtr;
-
- markerPtr = Blt_GetHashValue(hPtr);
- /*
- * Dereferencing the pointer to the hash table prevents the hash table
- * entry from being automatically deleted.
- */
- markerPtr->hashPtr = NULL;
- DestroyMarker(markerPtr);
- }
- Blt_DeleteHashTable(&graphPtr->markers.table);
- Blt_DeleteHashTable(&graphPtr->markers.tagTable);
- Blt_Chain_Destroy(graphPtr->markers.displayList);
-}
-
-Marker *
-Blt_NearestMarker(
- Graph *graphPtr,
- int x, int y, /* Screen coordinates */
- int under)
-{
- Blt_ChainLink link;
- Point2d point;
-
- point.x = (double)x;
- point.y = (double)y;
- for (link = Blt_Chain_FirstLink(graphPtr->markers.displayList);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- Marker *markerPtr;
-
- markerPtr = Blt_Chain_GetValue(link);
- if ((markerPtr->nWorldPts == 0) ||
- (markerPtr->flags & (HIDE|DELETE_PENDING|MAP_ITEM))) {
- continue; /* Don't consider markers that are
- * pending to be mapped. Even if the
- * marker has already been mapped, the
- * coordinates could be invalid now.
- * Better to pick no marker than the
- * wrong marker. */
-
- }
- if ((markerPtr->elemName != NULL) && (IsElementHidden(markerPtr))) {
- continue;
- }
- if ((markerPtr->drawUnder == under) &&
- (markerPtr->state == STATE_NORMAL)) {
- if ((*markerPtr->classPtr->pointProc) (markerPtr, &point)) {
- return markerPtr;
- }
- }
- }
- return NULL;
-}
-
-ClientData
-Blt_MakeMarkerTag(Graph *graphPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- int isNew;
-
- assert(tagName != NULL);
- hPtr = Blt_CreateHashEntry(&graphPtr->markers.tagTable, tagName, &isNew);
- return Blt_GetHashKey(&graphPtr->markers.tagTable, hPtr);
-}
-
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureArrows --
- *
- * If arrowheads have been requested for a line, this procedure makes
- * arrangements for the arrowheads.
- *
- * Results:
- * Always returns TCL_OK.
- *
- * Side effects:
- * Information in linePtr is set up for one or two arrowheads. the
- * firstArrowPtr and lastArrowPtr polygons are allocated and initialized,
- * if need be, and the end points of the line are adjusted so that a
- * thick line doesn't stick out past the arrowheads.
- *
- *---------------------------------------------------------------------------
- */
-
- /* ARGSUSED */
-static int
-ConfigureArrows(canvas, linePtr)
- Tk_Canvas canvas; /* Canvas in which arrows will be
- * displayed (interp and tkwin fields
- * are needed). */
- LineItem *linePtr; /* Item to configure for arrows. */
-{
- double *poly, *coordPtr;
- double dx, dy, length, sinTheta, cosTheta, temp;
- double fracHeight; /* Line width as fraction of arrowhead
- * width. */
- double backup; /* Distance to backup end points so
- * the line ends in the middle of the
- * arrowhead. */
- double vertX, vertY; /* Position of arrowhead vertex. */
- double shapeA, shapeB, shapeC; /* Adjusted coordinates (see
- * explanation below). */
- double width;
- Tk_State state = linePtr->header.state;
-
- if (linePtr->numPoints <2) {
- return TCL_OK;
- }
-
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
- }
-
- width = linePtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)linePtr) {
- if (linePtr->outline.activeWidth>width) {
- width = linePtr->outline.activeWidth;
- }
- } else if (state==TK_STATE_DISABLED) {
- if (linePtr->outline.disabledWidth>0) {
- width = linePtr->outline.disabledWidth;
- }
- }
-
- /*
- * The code below makes a tiny increase in the shape parameters for the
- * line. This is a bit of a hack, but it seems to result in displays that
- * more closely approximate the specified parameters. Without the
- * adjustment, the arrows come out smaller than expected.
- */
-
- shapeA = linePtr->arrowShapeA + 0.001;
- shapeB = linePtr->arrowShapeB + 0.001;
- shapeC = linePtr->arrowShapeC + width/2.0 + 0.001;
-
- /*
- * If there's an arrowhead on the first point of the line, compute its
- * polygon and adjust the first point of the line so that the line doesn't
- * stick out past the leading edge of the arrowhead.
- */
-
- fracHeight = (width/2.0)/shapeC;
- backup = fracHeight*shapeB + shapeA*(1.0 - fracHeight)/2.0;
- if (linePtr->arrow != ARROWS_LAST) {
- poly = linePtr->firstArrowPtr;
- if (poly == NULL) {
- poly = (double *) ckalloc((unsigned)
- (2*PTS_IN_ARROW*sizeof(double)));
- poly[0] = poly[10] = linePtr->coordPtr[0];
- poly[1] = poly[11] = linePtr->coordPtr[1];
- linePtr->firstArrowPtr = poly;
- }
- dx = poly[0] - linePtr->coordPtr[2];
- dy = poly[1] - linePtr->coordPtr[3];
- length = hypot(dx, dy);
- if (length == 0) {
- sinTheta = cosTheta = 0.0;
- } else {
- sinTheta = dy/length;
- cosTheta = dx/length;
- }
- vertX = poly[0] - shapeA*cosTheta;
- vertY = poly[1] - shapeA*sinTheta;
- temp = shapeC*sinTheta;
- poly[2] = poly[0] - shapeB*cosTheta + temp;
- poly[8] = poly[2] - 2*temp;
- temp = shapeC*cosTheta;
- poly[3] = poly[1] - shapeB*sinTheta - temp;
- poly[9] = poly[3] + 2*temp;
- poly[4] = poly[2]*fracHeight + vertX*(1.0-fracHeight);
- poly[5] = poly[3]*fracHeight + vertY*(1.0-fracHeight);
- poly[6] = poly[8]*fracHeight + vertX*(1.0-fracHeight);
- poly[7] = poly[9]*fracHeight + vertY*(1.0-fracHeight);
-
- /*
- * Polygon done. Now move the first point towards the second so that
- * the corners at the end of the line are inside the arrowhead.
- */
-
- linePtr->coordPtr[0] = poly[0] - backup*cosTheta;
- linePtr->coordPtr[1] = poly[1] - backup*sinTheta;
- }
-
- /*
- * Similar arrowhead calculation for the last point of the line.
- */
-
- if (linePtr->arrow != ARROWS_FIRST) {
- coordPtr = linePtr->coordPtr + 2*(linePtr->numPoints-2);
- poly = linePtr->lastArrowPtr;
- if (poly == NULL) {
- poly = (double *) ckalloc((unsigned)
- (2*PTS_IN_ARROW*sizeof(double)));
- poly[0] = poly[10] = coordPtr[2];
- poly[1] = poly[11] = coordPtr[3];
- linePtr->lastArrowPtr = poly;
- }
- dx = poly[0] - coordPtr[0];
- dy = poly[1] - coordPtr[1];
- length = hypot(dx, dy);
- if (length == 0) {
- sinTheta = cosTheta = 0.0;
- } else {
- sinTheta = dy/length;
- cosTheta = dx/length;
- }
- vertX = poly[0] - shapeA*cosTheta;
- vertY = poly[1] - shapeA*sinTheta;
- temp = shapeC*sinTheta;
- poly[2] = poly[0] - shapeB*cosTheta + temp;
- poly[8] = poly[2] - 2*temp;
- temp = shapeC*cosTheta;
- poly[3] = poly[1] - shapeB*sinTheta - temp;
- poly[9] = poly[3] + 2*temp;
- poly[4] = poly[2]*fracHeight + vertX*(1.0-fracHeight);
- poly[5] = poly[3]*fracHeight + vertY*(1.0-fracHeight);
- poly[6] = poly[8]*fracHeight + vertX*(1.0-fracHeight);
- poly[7] = poly[9]*fracHeight + vertY*(1.0-fracHeight);
- coordPtr[2] = poly[0] - backup*cosTheta;
- coordPtr[3] = poly[1] - backup*sinTheta;
- }
-
- return TCL_OK;
-}
-#endif
diff --git a/blt3.0.1/src/bltGrMesh.c b/blt3.0.1/src/bltGrMesh.c
deleted file mode 100644
index de7fd2b..0000000
--- a/blt3.0.1/src/bltGrMesh.c
+++ /dev/null
@@ -1,1747 +0,0 @@
-
-typedef unsigned int PointIndex;
-
-typedef struct {
- float x, y;
- int index;
-} MeshPoint;
-
-typedef struct {
- PointIndex a, b; /* Index of two points in x, y, point array */
-} Edge;
-
-typedef struct {
- PointIndex ab, bc, ac; /* Index of three edges representing a
- * triangle in the edge array. */
- float min, max;
-} Triangle;
-
-typedef Mesh *(MeshCreateProc)(void);
-typedef void (MeshDestroyProc)(Mesh *meshPtr);
-typedef void (MeshConfigureProc)(Mesh *meshPtr);
-
-typedef enum MeshTypes {
- MESH_CLOUD, MESH_REGULAR, MESH_IRREGULAR, MESH_TRIANGULAR
-} MeshType;
-
-typedef struct {
- enum MeshTypes type; /* Indicates type of mesh. */
- const char *name; /* String representation for type of class. */
- Blt_ConfigSpec *configSpecs; /* Mesh configuration specifications. */
- MeshDestroyProc *destroyProc;
- MeshConfigureProc *configProc;
-} MeshClass;
-
-typedef enum SourceTypes {
- SOURCE_LIST, SOURCE_VECTOR, SOURCE_TABLE, SOURCE_NONE
-} SourceType;
-
-typedef struct {
- enum SourceTypes type; /* Selects the type of data populating this
- * vector: SOURCE_VECTOR,
- * SOURCE_TABLE, or SOURCE_LIST */
- SourceGetProc *getProc;
- SourceDestroyProc *destroyProc;
- SourcePrintProc *printProc;
-} DataSourceClass;
-
-typedef struct {
- float min, max, logMin;
- float *values;
- float nValues;
-} DataSourceResult;
-
-typedef struct {
- DataSourceClass *classPtr;
- DataSourceChangedProc *proc;
- ClientData clientData;
-} DataSource;
-
-typedef int (SourceGetProc)(Tcl_Interp *interp, DataSource *srcPtr,
- DataSourceResult *resultPtr);
-typedef int (SourceDestroyProc)(DataSource *srcPtr);
-typedef Tcl_Obj * (SourcePrintProc)(DataSource *srcPtr);
-
-typedef struct {
- DataSourceClass *classPtr;
- DataSourceChangedProc *proc;
- ClientData clientData;
- Blt_VectorId vector;
-} VectorDataSource;
-
-typedef struct {
- DataSourceClass *classPtr;
- DataSourceChangedProc *proc;
- ClientData clientData;
- float *values;
- int nValues;
-} ListDataSource;
-
-typedef struct {
- Blt_Table table;
- int refCount;
-} TableClient;
-
-typedef struct {
- DataSourceClass *classPtr;
- DataSourceChangedProc *proc;
- ClientData clientData;
-
- Blt_Table table; /* Data table. */
- Blt_TableColumn column; /* Column of data used. */
- Blt_TableNotifier notifier; /* Notifier used for column (destroy). */
- Blt_TableTrace trace; /* Trace used for column (set/get/unset). */
- Blt_HashEntry *hashPtr; /* Pointer to entry of source in graph's hash
- * table of datatables. One graph may use
- * multiple columns from the same data
- * table. */
-} TableDataSource;
-
-typedef struct {
- const char *name; /* Mesh identifier. */
- MeshClass *classPtr;
- Graph *graphPtr; /* Graph that the mesh is associated with. */
- unsigned int flags; /* Indicates if the mesh element is active or
- * normal */
- int refCount; /* Reference count for elements using this
- * mesh. */
- Blt_HashEntry *hashPtr;
-
- /* Resulting mesh is a triangular grid. */
- MeshPoint *points; /* Array of points representing the mesh. */
- int nPoints; /* # of points in array. */
- int *hull; /* Array of indices of points representing the
- * convex hull of the mesh. */
- int nHullPts;
- float xMin, yMin, xMax, yMax, xLogMin, yLogMin;
-
- Edges *edges; /* Array of edges. */
- int nEdges; /* # of edges in array. */
- Triangles *triangles; /* Array of triangles. */
- int nTriangles; /* # of triangles in array. */
- DataSource *x, *y;
-} Mesh;
-
-typedef struct {
- const char *name; /* Mesh identifier. */
- MeshClass *classPtr;
- Graph *graphPtr; /* Graph that the mesh is associated with. */
-
- unsigned int flags; /* Indicates if the mesh element is active or
- * normal */
- int refCount; /* Reference count for elements using this
- * mesh. */
- Blt_HashEntry *hashPtr;
-
- /* Resulting mesh is a triangular grid. */
- MeshPoint *points; /* Array of points representing the mesh. */
- int nPoints; /* # of points in array. */
- int *hull; /* Array of indices of points representing the
- * convex hull of the mesh. */
- int nHullPts;
- float xMin, yMin, xMax, yMax, xLogMin, yLogMin;
-
- Edges *edges; /* Array of edges. */
- int nEdges; /* # of edges in array. */
- Triangles *triangles; /* Array of triangles. */
- int nTriangles; /* # of triangles in array. */
-
- DataSource *x, *y;
-} RegularMesh;
-
-typedef struct {
- const char *name; /* Mesh identifier. */
- MeshClass *classPtr;
- Graph *graphPtr; /* Graph that the mesh is associated with. */
-
- unsigned int flags; /* Indicates if the mesh element is active or
- * normal */
- int refCount; /* Reference count for elements using this
- * mesh. */
- Blt_HashEntry *hashPtr;
-
- /* Resulting mesh is a triangular grid. */
- MeshPoint *points; /* Array of points representing the mesh. */
- int nPoints; /* # of points in array. */
- int *hull; /* Array of indices of points representing the
- * convex hull of the mesh. */
- int nHullPts;
- float xMin, yMin, xMax, yMax, xLogMin, yLogMin;
-
- Edges *edges; /* Array of edges. */
- int nEdges; /* # of edges in array. */
- Triangles *triangles; /* Array of triangles. */
- int nTriangles; /* # of triangles in array. */
-
- DataSource *x, *y;
-} IrregularMesh;
-
-typedef struct {
- const char *name; /* Mesh identifier. */
- MeshClass *classPtr;
- Graph *graphPtr; /* Graph that the mesh is associated with. */
-
- unsigned int flags; /* Indicates if the mesh element is active or
- * normal */
- int refCount; /* Reference count for elements using this
- * mesh. */
- Blt_HashEntry *hashPtr;
-
- /* Resulting mesh is a triangular grid. */
- MeshPoint *points; /* Array of points representing the mesh. */
- int nPoints; /* # of points in array. */
- int *hull; /* Array of indices of points representing the
- * convex hull of the mesh. */
- int nHullPts;
- float xMin, yMin, xMax, yMax, xLogMin, yLogMin;
-
- Edges *edges; /* Array of edges. */
- int nEdges; /* # of edges in array. */
- Triangles *triangles; /* Array of triangles. */
- int nTriangles; /* # of triangles in array. */
-
- DataSource *x, *y;
-} CloudMesh;
-
-static MeshConfigureProc CloudMeshConfigureProc;
-static MeshDestroyProc CloudMeshDestroyProc;
-
-static MeshConfigureProc IrregularMeshConfigureProc;
-static MeshDestroyProc IrregularMeshDestroyProc;
-
-static MeshConfigureProc RegularMeshConfigureProc;
-static MeshDestroyProc RegularMeshDestroyProc;
-
-static MeshConfigureProc TriangularMeshConfigureProc;
-static MeshDestroyProc TriangularMeshDestroyProc;
-
-static MeshClass cloudMeshClass = {
- MESH_CLOUD, "Cloud",
- CloudMeshConfigureProc,
- CloudMeshDestroyProc,
-};
-
-static MeshClass regularMeshClass = {
- MESH_REGULAR, "Regular",
- RegularMeshConfigureProc,
- RegularMeshDestroyProc,
-};
-
-static MeshClass triangularMeshClass = {
- MESH_TRIANGULAR, "Triangular",
- TriangularMeshConfigureProc,
- TriangularMeshDestroyProc,
-};
-
-static MeshClass irregularMeshClass = {
- MESH_IRREGULAR, "Irregular",
- IrregularMeshConfigureProc,
- IrregularMeshDestroyProc,
-};
-
-static SourceGetProc ListDataSourceGetProc;
-static SourcePrintProc ListDataSourcePrintProc;
-static SourceDestroyProc ListDataSourceDestroyProc;
-
-static SourceGetProc TableDataSourceGetProc;
-static SourcePrintProc TableDataSourcePrintProc;
-static SourceDestroyProc TableDataSourceDestroyProc;
-
-static SourceGetProc VectorDataSourceGetProc;
-static SourcePrintProc VectorDataSourcePrintProc;
-static SourceDestroyProc VectorDataSourceDestroyProc;
-
-static DataSourceClass listDataSourceClass = {
- SOURCE_LIST, "List",
- ListDataSourceGetProc,
- ListDataSourceDestroyProc,
- ListDataSourcePrintProc
-};
-
-static DataSourceClass vectorDataSourceClass = {
- SOURCE_VECTOR, "Vector",
- VectorDataSourceGetProc,
- VectorDataSourceDestroyProc,
- VectorDataSourcePrintProc
-};
-
-static DataSourceClass tableDataSourceClass = {
- SOURCE_TABLE, "Table",
- TableDataSourceGetProc,
- TableDataSourceDestroyProc,
- TableDataSourcePrintProc
-};
-
-static Blt_OptionFreeProc FreeDataSource;
-static Blt_OptionParseProc ObjToDataSource;
-static Blt_OptionPrintProc DataSourceToObj;
-Blt_CustomOption bltDataSourceOption =
-{
- ObjToDataSourceProc, DataSourceToObjProc, FreeDataSourceProc, (ClientData)0
-};
-
-static Blt_ConfigSpec cloudMeshSpecs[] =
-{
- {BLT_CONFIG_STRING, "-name", "name", "name", (char *)NULL,
- Blt_Offset(Cloud, name), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-x", "xData", "XData", (char *)NULL,
- Blt_Offset(Cloud, x), 0, &bltDataSourceOption},
- {BLT_CONFIG_CUSTOM, "-y", "yData", "YData", (char *)NULL,
- Blt_Offset(Cloud, y), 0, &bltDataSourceOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static Blt_ConfigSpec regularMeshSpecs[] =
-{
- {BLT_CONFIG_STRING, "-name", "name", "name", (char *)NULL,
- Blt_Offset(Cloud, name), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-x", "xData", "XData", (char *)NULL,
- Blt_Offset(Cloud, x), 0, &bltDataSourceOption},
- {BLT_CONFIG_CUSTOM, "-y", "yData", "YData", (char *)NULL,
- Blt_Offset(Cloud, y), 0, &bltDataSourceOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static Blt_ConfigSpec irregularMeshSpecs[] =
-{
- {BLT_CONFIG_STRING, "-name", "name", "name", (char *)NULL,
- Blt_Offset(Cloud, name), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-x", "xData", "XData", (char *)NULL,
- Blt_Offset(Cloud, x), 0, &bltDataSourceOption},
- {BLT_CONFIG_CUSTOM, "-y", "yData", "YData", (char *)NULL,
- Blt_Offset(Cloud, y), 0, &bltDataSourceOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static Blt_ConfigSpec triangularMeshSpecs[] =
-{
- {BLT_CONFIG_STRING, "-name", "name", "name", (char *)NULL,
- Blt_Offset(Cloud, name), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-x", "xData", "XData", (char *)NULL,
- Blt_Offset(Cloud, x), 0, &bltDataSourceOption},
- {BLT_CONFIG_CUSTOM, "-y", "yData", "YData", (char *)NULL,
- Blt_Offset(Cloud, y), 0, &bltDataSourceOption},
- {BLT_CONFIG_CUSTOM, "-triangles", "triangles", "Triangles", (char *)NULL,
- Blt_Offset(Cloud, triangles), 0, &trianglesOption},
- {BLT_CONFIG_CUSTOM, "-edges", "edges", "Edges", (char *)NULL,
- Blt_Offset(Cloud, edges), 0, &edgesOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static Tcl_Obj *
-VectorDataSourcePrintProc(DataSource *dataSrcPtr)
-{
- VectorDataSource *srcPtr = (VectorDataSource *)dataSrcPtr;
-
- return Tcl_NewStringObj(Blt_NameOfVectorId(srcPtr->vector), -1);
-}
-
-static void
-VectorDataSourceDestroyProc(DataSource *dataSrcPtr)
-{
- VectorDataSource *srcPtr = (VectorDataSource *)dataSrcPtr;
-
- Blt_SetVectorChangedProc(srcPtr->vector, NULL, NULL);
- if (srcPtr->vector != NULL) {
- Blt_FreeVectorId(srcPtr->vector);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * VectorChangedProc --
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Graph is redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-VectorChangedProc(Tcl_Interp *interp, ClientData clientData,
- Blt_VectorNotify notify)
-{
- VectorDataSource *srcPtr = clientData;
-
- if (notify == BLT_VECTOR_NOTIFY_DESTROY) {
- DestroyDataSource(srcPtr);
- return;
- }
- (*srcPtr->proc)(srcPtr->clientData);
-}
-
-static DataSource *
-CreateVectorDataSource(Tcl_Interp *interp, const char *name)
-{
- Blt_Vector *vecPtr;
- VectorDataSource *srcPtr;
-
- srcPtr = Blt_AssertCalloc(sizeof(VectorDataSource));
- srcPtr->type = SOURCE_VECTOR;
- srcPtr->vector = Blt_AllocVectorId(interp, name);
- if (Blt_GetVectorById(interp, srcPtr->vector, &vecPtr) != TCL_OK) {
- Blt_Free(srcPtr);
- return NULL;
- }
- Blt_SetVectorChangedProc(srcPtr->vector, VectorChangedProc, srcPtr);
- return (DataSource *)srcPtr;
-}
-
-static int
-VectorDataSourceGetProc(Tcl_Interp *interp, DataSource *dataSrcPtr,
- DataSourceResult *resultPtr)
-{
- VectorDataSource *srcPtr = (VectorDataSource *)dataSrcPtr;
- size_t nBytes;
- Blt_Vector *vector;
-
- if (Blt_GetVectorById(interp, srcPtr->vector, &vector) != TCL_OK) {
- return TCL_ERROR;
- }
- nBytes = Blt_VecLength(vector) * sizeof(float);
- values = Blt_Malloc(nBytes);
- if (values == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't allocate new vector", (char *)NULL);
- }
- return TCL_ERROR;
- }
- {
- float *values;
- float min, max, logMin;
- double *data;
- double *p;
- int i;
-
- p = Blt_VecData(vector);
- logMin = min = max = (float)*p++;
- for (i = 0; i < Blt_VecLength(vector); i++, p++) {
- values[i] = (float)*p;
- if (*p > max) {
- max = (float)*p;
- } else if (*p < min) {
- min = (float)*p;
- }
- if ((*p > 0.0f) && (*p < logMin)) {
- logMin = (float)*p;
- }
- }
- resultPtr->min = min;
- resultPtr->max = max;
- resultPtr->logMin = logMin;
- }
- resultPtr->values = values;
- resultPtr->nValues = Blt_VecLength(vector);
- return TCL_OK;
-}
-
-static Tcl_Obj *
-ListDataSourcePrintProc(DataSource *dataSrcPtr)
-{
- ListDataSource *srcPtr = (ListDataSource *)dataSrcPtr;
- Tcl_Obj *listObjPtr;
- float *vp, *vend;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (vp = srcPtr->values, vend = vp + srcPtr->nValues; vp < vend; vp++) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj((double)*vp));
- }
- return listObjPtr;
-}
-
-static void
-ListDataSourceDestroyProc(DataSource *dataSrcPtr)
-{
- ListDataSource *srcPtr = (ListDataSource *)dataSrcPtr;
-
- if (srcPtr->values != NULL) {
- Blt_Free(srcPtr->values);
- }
- (*srcPtr->proc)(srcPtr, srcPtr->clientData);
-}
-
-static DataSource *
-CreateListDataSource(Tcl_Interp *interp, int objc, Tcl_Obj **objv)
-{
- float *values;
- int nValues;
- ListDataSource *srcPtr;
-
- srcPtr = Blt_AssertMalloc(sizeof(ListDataSource));
- srcPtr->type = SOURCE_LIST;
-
- nValues = 0;
- values = NULL;
-
- if (objc > 0) {
- float *p;
- int i;
-
- values = Blt_Malloc(sizeof(float) * objc);
- if (values == NULL) {
- Tcl_AppendResult(interp, "can't allocate new vector", (char *)NULL);
- return NULL;
- }
- for (p = values, i = 0; i < objc; i++, p++) {
- double value;
-
- if (Blt_ExprDoubleFromObj(interp, objv[i], &value) != TCL_OK) {
- Blt_Free(array);
- return TCL_ERROR;
- }
- *p = (float)value;
- }
- srcPtr->values = values;
- srcPtr->nValues = objc;
- }
- return (DataSource *)srcPtr;
-}
-
-static int
-ListDataSourceGetProc(Tcl_Interp *interp, SourceData *dataSrcPtr, float *minPtr,
- DataSourceResult *resultPtr)
-{
- long i, j;
- float *values;
- float min, max, logMin;
- ListDataSource *srcPtr = (ListDataSource *)dataSrcPtr;
-
- values = Blt_Malloc(sizeof(float) * srcPtr->nValues);
- if (values == NULL) {
- return TCL_ERROR;
- }
- sp = srcPtr->values;
- logMin = min = max = values[0] = *sp++;
- for (send = srcPtr->values + srcPtr->nValues; sp < send; sp++) {
- if (*sp > max) {
- max = *sp;
- } else if (*sp < min) {
- min = *sp;
- }
- if ((*sp > 0.0f) && (*sp < logMin)) {
- logMin = *sp;
- }
- values[j] = *sp;
- }
- resultPtr->min = min;
- resultPtr->max = max;
- resultPtr->logMin = logMin;
- resultPtr->values = values;
- resultPtr->nValues = srcPtr->nValues;
- return TCL_OK;
-}
-
-
-static void
-TableDataSourceDestroyProc(DataSource *dataSrcPtr)
-{
- TableDataSource *srcPtr = (TableDataSource *)dataSrcPtr;
-
- if (srcPtr->trace != NULL) {
- Blt_Table_DeleteTrace(srcPtr->trace);
- }
- if (srcPtr->notifier != NULL) {
- Blt_Table_DeleteNotifier(srcPtr->notifier);
- }
- if (srcPtr->hashPtr != NULL) {
- TableClient *clientPtr;
-
- clientPtr = Blt_GetHashValue(srcPtr->hashPtr);
- clientPtr->refCount--;
- if (clientPtr->refCount == 0) {
- if (srcPtr->table != NULL) {
- Blt_Table_Close(srcPtr->table);
- }
- Blt_Free(clientPtr);
- Blt_DeleteHashEntry(&graphPtr->dataTables, srcPtr->hashPtr);
- }
- (*srcPtr->proc)(srcPtr, srcPtr->clientData);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableNotifyProc --
- *
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Graph is redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TableNotifyProc(ClientData clientData, Blt_TableNotifyEvent *eventPtr)
-{
- TableDataSource *srcPtr = clientData;
-
- if (eventPtr->type == TABLE_NOTIFY_COLUMN_DELETED) {
- (*srcPtr->classPtr->destroyProc)(srcPtr);
- srcPtr->classPtr = NULL;
- return TCL_ERROR;
- }
- (*srcPtr->proc)(srcPtr->clientData);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableTraceProc --
- *
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Graph is redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TableTraceProc(ClientData clientData, Blt_TableTraceEvent *eventPtr)
-{
- TableDataSource *srcPtr = clientData;
-
- assert(eventPtr->column == srcPtr->column);
- (*srcPtr->proc)(srcPtr->clientData);
- return TCL_OK;
-}
-
-
-static DataSource *
-CreateTableDataSource(Tcl_Interp *interp, const char *name, Tcl_Obj *colObjPtr)
-{
- TableDataSource *srcPtr;
- TableClient *clientPtr;
- int isNew;
-
- srcPtr = Blt_AssertMalloc(sizeof(TableDataSource));
- srcPtr->type = SOURCE_TABLE;
-
- /* See if the graph is already using this table. */
- srcPtr->hashPtr = Blt_CreateHashEntry(&graphPtr->dataTables, name, &isNew);
- if (isNew) {
- if (Blt_Table_Open(interp, name, &srcPtr->table) != TCL_OK) {
- return TCL_ERROR;
- }
- clientPtr = Blt_AssertMalloc(sizeof(TableClient));
- clientPtr->table = srcPtr->table;
- clientPtr->refCount = 1;
- Blt_SetHashValue(srcPtr->hashPtr, clientPtr);
- } else {
- clientPtr = Blt_GetHashValue(srcPtr->hashPtr);
- srcPtr->table = clientPtr->table;
- clientPtr->refCount++;
- }
- srcPtr->column = Blt_Table_FindColumn(interp, srcPtr->table, colObjPtr);
- if (srcPtr->column == NULL) {
- goto error;
- }
- srcPtr->notifier = Blt_Table_CreateColumnNotifier(interp, srcPtr->table,
- srcPtr->column, TABLE_NOTIFY_COLUMN_CHANGED, TableNotifyProc,
- (Blt_TableNotifierDeleteProc *)NULL, srcPtr);
- srcPtr->trace = Blt_Table_CreateColumnTrace(srcPtr->table,
- srcPtr->column,
- (TABLE_TRACE_WRITES | TABLE_TRACE_UNSETS | TABLE_TRACE_CREATES), TableTraceProc,
- (Blt_TableTraceDeleteProc *)NULL, srcPtr);
- return (DataSource *)srcPtr;
- error:
- DestroyDataSource(srcPtr);
- return NULL;
-}
-
-static Tcl_Obj *
-TableDataSourcePrintProc(DataSource *dataSrcPtr)
-{
- TableDataSource *srcPtr = (TableDataSource *)dataSrcPtr;
- Tcl_Obj *listObjPtr;
- const char *name;
- long index;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- name = Blt_Table_TableName(srcPtr->table);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj(name, -1));
-
- index = Blt_Table_ColumnIndex(srcPtr->column);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewLongObj(index));
- return listObjPtr;
-}
-
-static int
-TableDataSourceGetProc(Tcl_Interp *interp, SourceData *dataSrcPtr,
- DataSourceResult *resultPtr)
-{
- Blt_Table table;
- float *values;
- float min, max, logMin;
- long i, j;
-
- table = srcPtr->table;
- values = Blt_Malloc(sizeof(float) * Blt_Table_NumRows(table));
- if (values == NULL) {
- return TCL_ERROR;
- }
- logMin = min = FLT_MAX, max = -FLT_MAX;
- for (j = 0, i = 1; i <= Blt_Table_NumRows(table); i++) {
- Blt_TableRow row;
- Tcl_Obj *objPtr;
- double value;
-
- row = Blt_Table_GetRowByIndex(table, i);
- objPtr = Blt_Table_GetObj(table, row, col);
- if (objPtr == NULL) {
- continue; /* Ignore empty values. */
- }
- if (Tcl_GetDoubleFromObj(interp, objPtr, &value) != TCL_OK) {
- return TCL_ERROR;
- }
- values[j] = (float)value;
- if (values[j] < min) {
- min = values[j];
- }
- if (values[j] > max) {
- max = values[j];
- }
- if ((values[j] > 0.0f) && (values[j] < logMin)) {
- logMin = values[j];
- }
- j++;
- }
- resultPtr->min = min;
- resultPtr->max = max;
- resultPtr->logMin = logMin;
- resultPtr->values = values;
- resultPtr->nValues = j;
- return TCL_OK;
-}
-
-static void
-DestroyDataSource(DataSource *dataSrcPtr)
-{
- if ((dataSrcPtr->classPtr != NULL) &&
- (dataSrcPtr->classPtr->destroyProc != NULL)) {
- (*dataSrcPtr->classPtr->destroyProc)(dataSrcPtr);
- }
- Blt_Free(dataSrcPtr);
-}
-
-
-/*ARGSUSED*/
-static void
-FreeDataSourceProc(
- ClientData clientData, /* Not used. */
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- DataSource *srcPtr = (DataSource *)(widgRec + offset);
-
- DestroyDataSource(srcPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToDataSourceProc --
- *
- * Given a string representation of a data source, converts it into its
- * equivalent data source. A data source may be a list of numbers, a
- * vector name, or a two element list of table name and column.
- *
- * Results:
- * The return value is a standard TCL result. The data source is passed
- * back via the srcPtr.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToDataSourceProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* TCL list of expressions */
- char *widgRec, /* Element record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Mesh *meshPtr = clientData;
- DataSource *srcPtr;
- DataSource **dataSrcPtrPtr = (DataSource **)(widgRec + offset);
- Tcl_Obj **objv;
- int objc;
- const char *string;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 0) {
- if (*dataSrcPtrPtr != NULL) {
- DestroyDataSource(*dataSrcPtrPtr);
- }
- *dataSrcPtrPtr = NULL;
- return TCL_OK;
- }
- string = Tcl_GetString(objv[0]);
- if ((objc == 1) && (Blt_VectorExists2(interp, string))) {
- srcPtr = CreateVectorDataSource(interp, string);
- } else if ((objc == 2) && (Blt_Table_TableExists(interp, string))) {
- srcPtr = CreateTableDataSource(interp, string, objv[1]);
- } else {
- srcPtr = CreateListDataSource(interp, objc, objv);
- }
- srcPtr->clientData = meshPtr;
- srcPtr->proc = meshPtr->classPtr->configProc;
- if (*dataSrcPtrPtr != NULL) {
- DestroyDataSource(*dataSrcPtrPtr);
- }
- *dataSrcPtrPtr = srcPtr;
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DataSourceToObjProc --
- *
- * Converts the data source to its equivalent string representation.
- * The data source may be a table, vector, or list.
- *
- * Results:
- * The string representation of the data source is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-DataSourceToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Element record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- DataSource *srcPtr = (DataSource *)(widgRec + offset);
-
- return (srcPtr->classPtr->printProc)(srcPtr);
-}
-
-static void
-DestroyMesh(Mesh *meshPtr)
-{
- Graph *graphPtr = meshPtr->graphPtr;
-
- if (meshPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&graphPtr->meshTable, meshPtr->hashPtr);
- }
- if (meshPtr->link != NULL) {
- Blt_Chain_DeleteLink(&graphPtr->meshChain, meshPtr->link);
- }
- if (meshPtr->classPtr->destroyProc != NULL) {
- (*meshPtr->classPtr->destroyProc)(meshPtr);
- }
- Blt_FreeOptions(meshPtr->classPtr->configSpecs, (char *)meshPtr,
- graphPtr->display, 0);
- if (meshPtr->triangles != NULL) {
- Blt_Free(meshPtr->triangles);
- }
- if (meshPtr->edges != NULL) {
- Blt_Free(meshPtr->edges);
- }
- if (meshPtr->points != NULL) {
- Blt_Free(meshPtr->points);
- }
- if (meshPtr->hull != NULL) {
- Blt_Free(meshPtr->hull);
- }
- if (meshPtr->x != NULL) {
- DestroyDataSource(meshPtr->x);
- }
- if (meshPtr->y != NULL) {
- DestroyDataSource(meshPtr->y);
- }
- Blt_Free(meshPtr);
- return TCL_OK;
-}
-
-static Mesh *
-GetMeshFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr,
- Mesh **meshPtrPtr)
-{
- const char *string;
- Blt_HashEntry *hPtr;
-
- string = Tcl_GetString(objPtr);
- hPtr = Blt_FindHashEntry(&graphPtr->meshTable, string);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "can't find mesh \"", string,
- "\" in graph \"", Tk_PathName(graphPtr->tkwin), "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- *meshPtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-static int
-RegularMeshConfigureProc(Mesh *meshPtr)
-{
- Tcl_Interp *interp;
- RegularMesh *regPtr = (RegularMesh *)meshPtr;
- MeshPoint *points;
- int i;
- float xStep, yStep;
- int count;
- DataSourceResult x, y;
-
- interp = meshPtr->interp;
- if ((regPtr->x->classPtr == NULL) || (regPtr->y->classPtr == NULL)) {
- return TCL_OK;
- }
- if ((*regPtr->x->classPtr->getProc)(interp, regPtr->x, &x) != TCL_OK) {
- return TCL_ERROR;
- }
- if (x.nValues != 3) {
- Tcl_AppendResult(interp,
- "wrong # of elements for x regular mesh description.",
- (char *)NULL);
- return TCL_ERROR;
- }
- if ((*regPtr->y->classPtr->getProc)(interp, regPtr->y, &y) != TCL_OK) {
- return TCL_ERROR;
- }
- if (y.nValues != 3) {
- Tcl_AppendResult(interp,
- "wrong # of elements for y rectangular mesh description.",
- (char *)NULL);
- return TCL_ERROR;
- }
-
- regPtr->xMin = x.values[0];
- regPtr->xMax = x.values[1];
- regPtr->xNum = (int)x.values[2];
- regPtr->yMin = y.values[0];
- regPtr->yMax = y.values[1];
- regPtr->yNum = (int)y.values[2];
- regPtr->xLogMin = x.logMin;
- regPtr->yLogMin = y.logMin;
- Blt_Free(x.values);
- Blt_Free(y.values);
-
- if (regPtr->xNum) {
- Tcl_AppendResult(interp, "# of x-values for rectangular mesh",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (regPtr->yNum) {
- Tcl_AppendResult(interp, "# of y-values for rectangular mesh",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (regPtr->xMin == regPtr->xMax) {
- return TCL_ERROR;
- }
- if (regPtr->yMin == regPtr->yMax) {
- return TCL_ERROR;
- }
- nPoints = x.nValues * y.nValues;
- points = Blt_Malloc(nPoints * sizeof(MeshPoint));
- if (points == NULL) {
- Tcl_AppendResult(interp, "can't allocate ", Itoa(nPoints),
- " points", (char *)NULL);
- return TCL_ERROR;
- }
- xStep = (regPtr->xMax - regPtr->xMin) / (float)(regPtr->xNum - 1);
- yStep = (regPtr->yMax - regPtr->yMin) / (float)(regPtr->yNum - 1);
- {
- int count;
- MeshPoint *p;
-
- p = points;
- count = 0;
- for (i = 0; i < regPtr->yNum; i++) {
- float y0;
- int j;
-
- y0 = regPtr->yMin + (yStep * i);
- for (j = 0; j < regPtr->xNum; j++) {
- p->x = regPtr->xMin + (xStep * j);
- p->y = y;
- p->index = count;
- count++;
- p++;
- }
- }
- }
- if (regPtr->points != NULL) {
- Blt_Free(regPtr->points);
- }
- regPtr->points = points;
- regPtr->nPoints = nPoints;
-
- if (Triangulate(interp, regPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-IrregularMeshConfigureProc(Mesh *meshPtr)
-{
- IrregularMesh *irregPtr = (IrregularMesh *)meshPtr;
- MeshPoint *points;
- int i;
- DataSourceResult x, y;
-
- if ((irregPtr->x->classPtr == NULL) || (irregPtr->y->classPtr == NULL)) {
- return TCL_OK;
- }
- if ((*irregPtr->x->classPtr->getProc)(irregPtr->interp, irregPtr->x, &x)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (x.nValues < 2) {
- Tcl_AppendResult(interp,
- "wrong # of elements for x rectangular mesh description.",
- (char *)NULL);
- return TCL_ERROR;
- }
- irregPtr->xMin = x.min;
- irregPtr->xMax = x.max;
- irregPtr->xLogMin = x.logMin;
- if ((*irregPtr->y->classPtr->getProc)(irregPtr->interp, irregPtr->y, &y)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (y.nValues != 2) {
- Tcl_AppendResult(interp,
- "wrong # of elements for y rectangular mesh description.",
- (char *)NULL);
- return TCL_ERROR;
- }
- irregPtr->yMin = y.min;
- irregPtr->yMax = y.max;
- irregPtr->yLogMin = y.logMin;
-
- nPoints = x.nValues * y.nValues;
- points = Blt_Malloc(nPoints * sizeof(MeshPoint));
- if (points == NULL) {
- Tcl_AppendResult(interp, "can't allocate ", Itoa(nPoints),
- " points", (char *)NULL);
- return TCL_ERROR;
- }
- {
- int i, count;
- MeshPoint *p;
-
- p = points;
- count = 0;
- for (i = 0; i < y.nValues; i++) {
- int j;
-
- for (j = 0; j < x.nValues; j++) {
- p->x = x.values[j];
- p->y = y.values[i];
- p->index = count;
- count++;
- p++;
- }
- }
- }
- Blt_Free(x.values);
- Blt_Free(y.values);
- if (irregPtr->points != NULL) {
- Blt_Free(irregPtr->points);
- }
- irregPtr->points = points;
- irregPtr->nPoints = nPoints;
- irregPtr->xMin = x.min;
- irregPtr->xLogMin = x.logMin;
- irregPtr->xMax = x.max;
- irregPtr->yMin = y.min;
- irregPtr->yLogMin = y.logMin;
- irregPtr->yMax = y.max;
- if (Triangulate(interp, irregPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-CloudMeshConfigureProc(Mesh *meshPtr)
-{
- CloudMesh *cloudPtr = (CloudMesh *)meshPtr;
- MeshPoint *points;
- DataSourceResult x, y;
- int i, nPoints;
-
- if ((cloudPtr->x->classPtr == NULL) || (cloudPtr->y->classPtr == NULL)) {
- return TCL_OK;
- }
- if ((*cloudPtr->x->classPtr->getProc)(cloudPtr->interp, cloudPtr->x, &x)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (x.nValues < 3) {
- Tcl_AppendResult(interp, "too few values for x cloud mesh description.",
- (char *)NULL);
- return TCL_ERROR;
- }
- cloudPtr->xMin = x.min, cloudPtr->xMax = x.max;
- cloudPtr->logMin = x.logMin;
- if ((*cloudPtr->y->classPtr->getProc)(cloudPtr->interp, cloudPtr->y, &y)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (y.nValues < 3) {
- Tcl_AppendResult(interp,
- "too few values for y cloud mesh description.",
- (char *)NULL);
- return TCL_ERROR;
- }
- cloudPtr->yMin = y.min, cloudPtr->yMax = y.max;
- cloudPtr->logMin = y.logMin;
- if (x.nValues != y.nValues) {
- Tcl_AppendResult(interp, " # of values for x and y do not match.",
- (char *)NULL);
- return TCL_ERROR;
- }
- nPoints = x.nValues;
- points = Blt_Malloc(nPoints * sizeof(MeshPoint));
- if (points == NULL) {
- Tcl_AppendResult(interp, "can't allocate ", Itoa(nPoints),
- " points", (char *)NULL);
- return TCL_ERROR;
- }
- if (cloudPtr->points != NULL) {
- Blt_Free(cloudPtr->points);
- }
- for (i = 0; i < nPoints; i++) {
- p->x = x.values[i];
- p->y = y.values[i];
- p->index = i;
- p++;
- }
- Blt_Free(x.values);
- Blt_Free(y.values);
- if (cloudPtr->points != NULL) {
- Blt_Free(cloudPtr->points);
- }
- cloudPtr->points = points;
- cloudPtr->nPoints = nPoints;
-
- if (Triangulate(interp, cloudPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-TriangularMeshConfigureProc(Mesh *meshPtr)
-{
- return TCL_OK;
-}
-
-static Mesh *
-CreateTriangularMesh(const char *name)
-{
- TriangularMesh *meshPtr;
-
- /* Allocate memory for the new mesh. */
- meshPtr = Blt_AssertCalloc(1, sizeof(TriangularMesh));
- meshPtr->classPtr = &triangularMeshClass;
- meshPtr->name = Blt_AssertStrdup(name);
- return (Mesh *)meshPtr;
-}
-
-static Mesh *
-CreateRegularMesh(const char *name)
-{
- RegularMesh *meshPtr;
-
- /* Allocate memory for the new mesh. */
- meshPtr = Blt_AssertCalloc(1, sizeof(RegularMesh));
- meshPtr->classPtr = ®ularMeshClass;
- meshPtr->name = Blt_AssertStrdup(name);
- return (Mesh *)meshPtr;
-}
-
-static Mesh *
-CreateIrregularMesh(const char *name)
-{
- IrregularMesh *meshPtr;
-
- /* Allocate memory for the new mesh. */
- meshPtr = Blt_AssertCalloc(1, sizeof(IrregularMesh));
- meshPtr->classPtr = &irregularMeshClass;
- meshPtr->name = Blt_AssertStrdup(name);
- return (Mesh *)meshPtr;
-}
-
-static Mesh *
-CreateCloudMesh(const char *name)
-{
- CloudMesh *meshPtr;
-
- /* Allocate memory for the new mesh. */
- meshPtr = Blt_AssertCalloc(1, sizeof(CloudMesh));
- meshPtr->classPtr = &cloudMeshClass;
- meshPtr->name = Blt_AssertStrdup(name);
- return (Mesh *)meshPtr;
-}
-
-static int
-TypeOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Mesh *meshPtr;
-
- if (GetMeshFromObj(interp, graphPtr, objv[3], &meshPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), meshPtr->classPtr->type, -1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * Returns a list of marker identifiers in interp->result;
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-NamesOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->meshTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Mesh *meshPtr;
-
- meshPtr = Blt_GetHashValue(hPtr);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(meshPtr->name, -1));
- }
- } else {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->meshTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Marker *markerPtr;
- int i;
-
- markerPtr = Blt_GetHashValue(hPtr);
- for (i = 3; i < objc; i++) {
- const char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- if (Tcl_StringMatch(meshPtr->name, pattern)) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(meshPtr->name, -1));
- break;
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-static int
-ConfigureOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Mesh *meshPtr;
-
- if (GetMeshFromObj(interp, graphPtr, objv[3], &meshPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 0) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin,
- meshPtr->classPtr->configSpecs, (char *)meshPtr,
- (Tcl_Obj *)NULL, flags);
- } else if (objc == 1) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin,
- meshPtr->classPtr->configSpecs, (char *)meshPtr,
- objv[4], flags);
- }
- bltDataSourceOption.clientData = meshPtr;
- if (Blt_ConfigureWidgetFromObj(interp, graphPtr->tkwin,
- meshPtr->classPtr->configSpecs, objc - 3, objv + 3,
- (char *)meshPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((*meshPtr->classPtr->configProc)(meshPtr) != TCL_OK) {
- return TCL_ERROR; /* Failed to configure element */
- }
- return TCL_OK;
-}
-
-static int
-CreateOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Mesh *meshPtr;
- Blt_HashEntry *hPtr;
- char ident[200];
- char *name;
- int i;
- char c;
- char *string;
- int length;
-
- /* Scan for "-name" option. We need it for the component name */
- name = NULL;
- for (i = 4; i < objc; i += 2) {
- string = Tcl_GetStringFromObj(objv[i], &length);
- if ((length > 1) && (strncmp(string, "-name", length) == 0)) {
- name = Tcl_GetString(objv[i + 1]);
- break;
- }
- }
- /* If no name was given for the marker, make up one. */
- if (name == NULL) {
- sprintf_s(ident, 200, "mesh%d", graphPtr->nextMeshId++);
- name = ident;
- } else if (name[0] == '-') {
- Tcl_AppendResult(interp, "name of marker \"", name,
- "\" can't start with a '-'", (char *)NULL);
- return TCL_ERROR;
- }
-
- string = Tcl_GetString(objv[3]);
- c = string[0];
- length = strlen(string);
- if ((c == 't') && (strncmp(string, "triangle", length) == 0)) {
- meshPtr = CreateTrigangularMesh(name);
- } else if ((c == 'r') && (strncmp(string, "regular", length) == 0)) {
- meshPtr = CreateRegularMesh(name);
- } else if ((c == 'i') && (strncmp(string, "irregular", length) == 0)) {
- meshPtr = CreateIrregularMesh(name);
- } else if ((c == 'c') && (strncmp(string, "cloud", length) == 0)) {
- meshPtr = CreateCloudMesh(name);
- } else {
- Tcl_AppendResult(interp, "unknown mesh type \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- meshPtr->graphPtr = graphPtr;
- meshPtr->interp = interp;
- meshPtr->refCount = 1;
-
- /* Parse the configuration options. */
- if (Blt_ConfigureComponentFromObj(interp, graphPtr->tkwin, name,
- meshPtr->classPtr->name, meshPtr->classPtr->configSpecs,
- objc - 4, objv + 4, (char *)meshPtr, 0) != TCL_OK) {
- DestroyMesh(meshPtr);
- return TCL_ERROR;
- }
- hPtr = Blt_CreateHashEntry(&graphPtr->meshTable, meshPtr->name, &isNew);
- if (!isNew) {
- Mesh *oldMeshPtr;
- oldMeshPtr = Blt_GetHashValue(hPtr);
- if ((oldMeshPtr->flags & DELETE_PENDING) == 0) {
- Tcl_AppendResult(graphPtr->interp, "mesh \"", meshPtr->name,
- "\" already exists in \"", Tk_PathName(graphPtr->tkwin), "\"",
- (char *)NULL);
- DestroyMesh(meshPtr);
- return TCL_ERROR;
- }
- oldMeshPtr->hashPtr = NULL; /* Remove the mesh from the table. */
- }
- Blt_SetHashValue(hPtr, meshPtr);
- meshPtr->hashPtr = hPtr;
- if ((meshPtr->classPtr->configProc)(meshPtr) != TCL_OK) {
- DestroyMesh(meshPtr);
- return TCL_ERROR;
- }
- meshPtr->link = Blt_Chain_Append(graphPtr->meshChain, meshPtr);
- return TCL_OK;
-}
-
-static int
-DeleteOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- Mesh *meshPtr;
-
- if (GetMeshFromObj(interp, graphPtr, objv[i], &meshPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (meshPtr->flags & DELETE_PENDING) {
- Tcl_AppendResult(interp, "can't find mesh \"",
- Tcl_GetString(objv[i]), "\" in \"",
- Tk_PathName(graphPtr->tkwin), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- meshPtr->flags |= DELETE_PENDING;
- if (meshPtr->refCount == 0) {
- DestroyMesh(meshPtr);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MeshOp --
- *
- * .g mesh create regular -name $name -x {x0 xN n} -y {y0 yN n}
- * .g mesh create irregular -name $name -x $xvalues -y $yvalues
- * .g mesh create triangular -name $name -x x -y y -edges $edges \
- * -triangles $triangles
- * .g mesh create cloud -name $name -x x -y y
- * .g mesh type $name
- * .g mesh names ?pattern?
- * .g mesh delete $name
- * .g mesh configure $name -hide no -linewidth 1 -color black
- *
- *---------------------------------------------------------------------------
- */
-
-static Blt_OpSpec meshOps[] =
-{
- {"cget", 2, CgetOp, 4, 4, "meshName option",},
- {"create", 2, CreateOp, 4, 0, "type ?option value?...",},
- {"configure", 2, ConfigureOp, 3, 0, "meshName ?option value?...",},
- {"delete", 1, DeleteOp, 3, 0, "?meshName?...",},
- {"names", 1, NamesOp, 3, 0, "?pattern?...",},
- {"type", 2, TypeOp, 4, 4, "meshName",},
-};
-static int nMeshOps = sizeof(meshOps) / sizeof(Blt_OpSpec);
-
-int
-Blt_MeshOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nMeshOps, meshOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (interp, graphPtr, objc, objv);
-}
-
-void
-Blt_DestroyMeshes(Graph *graphPtr)
-{
- Blt_ChainLink link, next;
-
- for (link = Blt_Chain_FirstLink(graphPtr->meshChain); link != NULL;
- link = next) {
- Mesh *meshPtr;
-
- next = Blt_Chain_NextLink(link);
- meshPtr = Blt_Chain_GetValue(link);
- DestroyMesh(meshPtr);
- }
-}
-
-void
-Blt_FreeMesh(Mesh *meshPtr)
-{
- if (meshPtr != NULL) {
- meshPtr->refCount--;
- if ((meshPtr->refCount == 0) && (meshPtr->flags & DELETE_PENDING)) {
- DestroyMesh(meshPtr);
- }
- }
-}
-
-int
-Blt_GetMeshFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr,
- Mesh **meshPtrPtr)
-{
- Mesh *meshPtr;
-
- if (GetMeshFromObj(interp, graphPtr, objPtr, &meshPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- meshPtr->refCount++;
- *meshPtrPtr = meshPtr;
- return TCL_OK;
-}
-
-
-static void
-ComputeRanges(int nTriangles, Triangle *triangles, float *values)
-{
- Triangle *p, *tend;
-
- for (p = triangles, tend = triangles + nTriangles; p < tend; p++) {
- float za, zb, zc;
-
- za = values[points[p->a].index].z;
- zb = values[points[p->b].index].z;
- zc = values[points[p->c].index].z;
-
- p->min = p->max = za;
- if (zb < p->min) {
- p->min = zb;
- }
- if (zc < p->min) {
- p->min = zc;
- }
- if (zb > p->max) {
- p->max = zb;
- }
- if (zc > p->max) {
- p->max = zc;
- }
- }
-}
-
-static INLINE float
-IsLeft(MeshPoint *points, int i, int j, int k)
-{
- return (((points[i].x - points[j].x) * (points[k].y - points[j].y)) -
- ((points[i].y - points[j].y) * (points[k].x - points[j].x)));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChainHull2d --
- *
- * Computes the convex hull from the points of the mesh.
- *
- * Notes: 1. The array of points is assumed to be sorted.
- * 2. An array to contain the points is assumed. This is
- * allocated by the caller.
- *
- * Results:
- * The number of points in the convex hull is returned. The coordinates
- * of the hull will be written in the given point array.
- *
- * Copyright 2001, softSurfer (www.softsurfer.com)
- * This code may be freely used and modified for any purpose
- * providing that this copyright notice is included with it.
- * SoftSurfer makes no warranty for this code, and cannot be held
- * liable for any real or imagined damage resulting from its use.
- * Users of this code must verify correctness for their application.
- *
- *---------------------------------------------------------------------------
- */
-
-#define Push(index) (hull[top] = (index), top++)
-#define Pop() (top--)
-
-static int
-ChainHull2d(int nPts, MeshPoint *pts, int *hull)
-{
- int bot, top, i;
- int minMin, minMax;
- int maxMin, maxMax;
- float xMin, xMax;
-
- bot = top = 0; /* Points to next location on stack. */
- minMin = 0;
-
- /*
- * Step 1. Get the indices of points with max x-coord and min|max
- * y-coord .
- */
-
- xMin = pts[0].x;
- for (i = 1; i < nPts; i++) {
- if (pts[i].x != xMin) {
- break;
- }
- }
- minMax = i - 1;
-
- if (minMax == (nPts - 1)) {
- /* Degenerate case: all x-coords == xMin */
- Push(minMin)
- if (pts[minMax].y != pts[minMin].y) {
- Push(minMax); /* A nontrivial segment. */
- }
- Push(minMin);
- return top;
- }
-
- maxMax = nPts - 1;
- xMax = pts[maxMax].x;
- for (i = maxMax - 1; i >= 0; i--) {
- if (pts[i].x != xMax) {
- break;
- }
- }
- maxMin = i+1;
-
- /*
- * Step 2. Compute the lower hull on the stack.
- */
- Push(minMin); /* push minMin point onto stack */
- i = minMax;
-
- while (++i <= maxMin) {
- /* The lower line joins pts[minMin] with pts[maxMin]. */
- if ((IsLeft(pts[minMin], pts[maxMin], pts[i]) >= 0.0f) &&
- (i < maxMin)) {
- continue; /* Ignore pts[i] above or on the lower line */
- }
- while (top > 1) {
- /* There are at least 2 pts on the stack. */
-
- /* Test if pts[i] is left of the line at the stack top. */
- if (IsLeft(pts[hull[top-2]], pts[hull[top-1]], pts[i]) > 0.0f) {
- break; /* Pts[i] is a new hull vertex. */
- } else {
- Pop(); /* Pop top point off stack */
- }
- }
- Push(i); /* Push point[i] onto stack. */
- }
-
- /*
- * Step 3. Compute the upper hull on the stack above the bottom hull.
- */
-
- if (maxMax != maxMin) {
- // if distinct xMax points
- Push(maxMax); /* Push maxMax point onto stack. */
- }
-
- bot = top - 1; /* The bottom point of the upper hull stack. */
- i = maxMin;
-
- while (--i >= minMax) {
- /* The upper line joins pts[maxMax] with pts[minMax]. */
- if ((IsLeft(pts[maxMax], pts[minMax], pts[i]) >= 0) &&
- (i > minMax)) {
- continue; /* Ignore pts[i] below or on the upper
- * line. */
- }
- while (top >= bot) {
- /* There are at least 2 points on the upper stack. */
-
- /* Test if points[i] is left of the line at the stack top. */
- if (Isleft(pts[hull[top-2]], pts[hull[top-1]], pts[i]) > 0) {
- break; /* pts[i] is a new hull vertex. */
- } else {
- Pop(); /* Pop top point off stack. */
- }
- }
- Push(i); /* Push pts[i] onto stack. */
- }
- if (minMax != minMin) {
- Push(minMin); /* Push joining endpoint onto stack. */
- }
- return top;
-}
-
-static int
-ConvexHull(Tcl_Interp *interp, Mesh *meshPtr)
-{
- int *hull;
- int n;
-
- /* Allocate worst-case storage initially for the hull. */
- hull = Blt_Malloc(meshPtr->nPoints * sizeof(int));
- if (hull == NULL) {
- Tcl_AppendResult(interp, "can't allocate memory for convex hull ",
- (char *)NULL);
- return TCL_ERROR;
- }
-
- /* Compute the convex hull. */
- n = ChainHull2d(meshPtr->nPoints, meshPtr->points, hull);
-
- /* Resize the hull array to the actual # of boundary points. */
- if (n < meshPtr->nPoints) {
- hull = Blt_Realloc(hull, n * sizeof(int));
- if (hull == NULL) {
- Tcl_AppendResult(interp, "can't reallocate memory for convex hull ",
- (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (meshPtr->hull != NULL) {
- Blt_Free(meshPtr->hull);
- }
- meshPtr->hull = hull;
- meshPtr->nHullPts = n;
- return TCL_OK;
-}
-
-static int
-ComparePoints(const void *a, const void *b)
-{
- const MeshPoint *s1 = a;
- const MeshPoint *s2 = b;
-
- if (s1->y < s2->y) {
- return -1;
- }
- if (s1->y > s2->y) {
- return 1;
- }
- if (s1->x < s2->x) {
- return -1;
- }
- if (s1->x > s2->x) {
- return 1;
- }
- return 0;
-}
-
-static void
-Triangulate(Tcl_Interp *interp, Mesh *meshPtr)
-{
- Triangle *triangles;
- int nTriangles;
-
- /* Sort the points in the mesh. This is useful for both computing the
- * convex hull and triangulating the mesh. */
- qsort(meshPtr->points, meshPtr->nPoints, sizeof(MeshPoint), ComparePoints);
-
- /* Compute the convex hull first, this will provide an estimate for the
- * boundary points and therefore the number of triangles and edges. */
- if (ConvexHull(interp, meshPtr) != TCL_OK) {
- return TCL_ERROR;
- }
-
- /* Determine the number of triangles and edges. */
- meshPtr->nTriangles = 2 * meshPtr->nPoints - 2 - meshPtr->nHullPts;
- meshPtr->nEdges = 3 * meshPtr->nPoints - 3 - meshPtr->nHullPts;
- triangles = Blt_Malloc(meshPtr->nTriangles * sizeof(Triangle));
- if (triangles == NULL) {
- Tcl_AppendResult(interp, "can't allocate ",
- Blt_Itoa(meshPtr->nTriangles), " triplets", (char *)NULL);
- return TCL_ERROR;
- }
-
- /*
- * Mesh the points to get triangles.
- */
- nTriangles = Blt_Triangulate(meshPtr->nPoints, meshPtr->points, TRUE,
- triangles);
- if (meshPtr->triangles != NULL) {
- Blt_Free(meshPtr->triangles);
- }
- meshPtr->nTriangles = nTriangles;
- meshPtr->triangles = triangles;
-}
diff --git a/blt3.0.1/src/bltGrMisc.c b/blt3.0.1/src/bltGrMisc.c
deleted file mode 100644
index 101273e..0000000
--- a/blt3.0.1/src/bltGrMisc.c
+++ /dev/null
@@ -1,2024 +0,0 @@
-
-
-/*
- * bltGrMisc.c --
- *
- * This module implements miscellaneous routines for the BLT graph widget.
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltGraph.h"
-#include <X11/Xutil.h>
-#include <bltAlloc.h>
-#include <bltOp.h>
-#include <stdarg.h>
-
-static Blt_OptionParseProc ObjToPoint;
-static Blt_OptionPrintProc PointToObj;
-Blt_CustomOption bltPointOption =
-{
- ObjToPoint, PointToObj, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToLimitsProc;
-static Blt_OptionPrintProc LimitsToObjProc;
-Blt_CustomOption bltLimitsOption =
-{
- ObjToLimitsProc, LimitsToObjProc, NULL, (ClientData)0
-};
-
-
-/*
- *---------------------------------------------------------------------------
- * Custom option parse and print procedures
- *---------------------------------------------------------------------------
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetXY --
- *
- * Converts a string in the form "@x,y" into an XPoint structure of the x
- * and y coordinates.
- *
- * Results:
- * A standard TCL result. If the string represents a valid position
- * *pointPtr* will contain the converted x and y coordinates and TCL_OK
- * is returned. Otherwise, TCL_ERROR is returned and interp->result will
- * contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetXY(Tcl_Interp *interp, Tk_Window tkwin, const char *string,
- int *xPtr, int *yPtr)
-{
- char *comma;
- int result;
- int x, y;
-
- if ((string == NULL) || (*string == '\0')) {
- *xPtr = *yPtr = -SHRT_MAX;
- return TCL_OK;
- }
- if (*string != '@') {
- goto badFormat;
- }
- comma = strchr(string + 1, ',');
- if (comma == NULL) {
- goto badFormat;
- }
- *comma = '\0';
- result = ((Tk_GetPixels(interp, tkwin, string + 1, &x) == TCL_OK) &&
- (Tk_GetPixels(interp, tkwin, comma + 1, &y) == TCL_OK));
- *comma = ',';
- if (!result) {
- Tcl_AppendResult(interp, ": can't parse position \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- *xPtr = x, *yPtr = y;
- return TCL_OK;
-
- badFormat:
- Tcl_AppendResult(interp, "bad position \"", string,
- "\": should be \"@x,y\"", (char *)NULL);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToPoint --
- *
- * Convert the string representation of a legend XY position into window
- * coordinates. The form of the string must be "@x,y" or none.
- *
- * Results:
- * A standard TCL result. The symbol type is written into the
- * widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToPoint(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* New legend position string */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- XPoint *pointPtr = (XPoint *)(widgRec + offset);
- int x, y;
-
- if (Blt_GetXY(interp, tkwin, Tcl_GetString(objPtr), &x, &y) != TCL_OK) {
- return TCL_ERROR;
- }
- pointPtr->x = x, pointPtr->y = y;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PointToObj --
- *
- * Convert the window coordinates into a string.
- *
- * Results:
- * The string representing the coordinate position is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-PointToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- XPoint *pointPtr = (XPoint *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if ((pointPtr->x != -SHRT_MAX) && (pointPtr->y != -SHRT_MAX)) {
- char string[200];
-
- sprintf_s(string, 200, "@%d,%d", pointPtr->x, pointPtr->y);
- objPtr = Tcl_NewStringObj(string, -1);
- } else {
- objPtr = Tcl_NewStringObj("", -1);
- }
- return objPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToLimitsProc --
- *
- * Converts the list of elements into zero or more pixel values which
- * determine the range of pixel values possible. An element can be in any
- * form accepted by Tk_GetPixels. The list has a different meaning based
- * upon the number of elements.
- *
- * # of elements:
- *
- * 0 - the limits are reset to the defaults.
- * 1 - the minimum and maximum values are set to this
- * value, freezing the range at a single value.
- * 2 - first element is the minimum, the second is the
- * maximum.
- * 3 - first element is the minimum, the second is the
- * maximum, and the third is the nominal value.
- *
- * Any element may be the empty string which indicates the default.
- *
- * Results:
- * The return value is a standard TCL result. The min and max fields
- * of the range are set.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToLimitsProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Widget of paneset */
- Tcl_Obj *objPtr, /* New width list */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_Limits *limitsPtr = (Blt_Limits *)(widgRec + offset);
-
- if (Blt_GetLimitsFromObj(interp, tkwin, objPtr, limitsPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * LimitsToObjProc --
- *
- * Convert the limits of the pixel values allowed into a list.
- *
- * Results:
- * The string representation of the limits is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-LimitsToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Row/column structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_Limits *limitsPtr = (Blt_Limits *)(widgRec + offset);
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (limitsPtr->flags & LIMITS_MIN_SET) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(limitsPtr->min));
- } else {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("", -1));
- }
- if (limitsPtr->flags & LIMITS_MAX_SET) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(limitsPtr->max));
- } else {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("", -1));
- }
- if (limitsPtr->flags & LIMITS_NOM_SET) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(limitsPtr->nom));
- } else {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("", -1));
- }
- return listObjPtr;
-}
-
-int
-Blt_PointInSegments(
- Point2d *samplePtr,
- Segment2d *segments,
- int nSegments,
- double halo)
-{
- Segment2d *sp, *send;
- double minDist;
-
- minDist = DBL_MAX;
- for (sp = segments, send = sp + nSegments; sp < send; sp++) {
- double dist;
- double left, right, top, bottom;
- Point2d p, t;
-
- t = Blt_GetProjection((int)samplePtr->x, (int)samplePtr->y,
- &sp->p, &sp->q);
- if (sp->p.x > sp->q.x) {
- right = sp->p.x, left = sp->q.x;
- } else {
- right = sp->q.x, left = sp->p.x;
- }
- if (sp->p.y > sp->q.y) {
- bottom = sp->p.y, top = sp->q.y;
- } else {
- bottom = sp->q.y, top = sp->p.y;
- }
- p.x = BOUND(t.x, left, right);
- p.y = BOUND(t.y, top, bottom);
- dist = hypot(p.x - samplePtr->x, p.y - samplePtr->y);
- if (dist < minDist) {
- minDist = dist;
- }
- }
- return (minDist < halo);
-}
-
-int
-Blt_PointInPolygon(
- Point2d *s, /* Sample point. */
- Point2d *points, /* Points representing the polygon. */
- int nPoints) /* # of points in above array. */
-{
- Point2d *p, *q, *qend;
- int count;
-
- count = 0;
- for (p = points, q = p + 1, qend = p + nPoints; q < qend; p++, q++) {
- if (((p->y <= s->y) && (s->y < q->y)) ||
- ((q->y <= s->y) && (s->y < p->y))) {
- double b;
-
- b = (q->x - p->x) * (s->y - p->y) / (q->y - p->y) + p->x;
- if (s->x < b) {
- count++; /* Count the number of intersections. */
- }
- }
- }
- return (count & 0x01);
-}
-
-int
-Blt_RegionInPolygon(
- Region2d *regionPtr,
- Point2d *points,
- int nPoints,
- int enclosed)
-{
- Point2d *pp, *pend;
-
- if (enclosed) {
- /*
- * All points of the polygon must be inside the rectangle.
- */
- for (pp = points, pend = pp + nPoints; pp < pend; pp++) {
- if ((pp->x < regionPtr->left) || (pp->x > regionPtr->right) ||
- (pp->y < regionPtr->top) || (pp->y > regionPtr->bottom)) {
- return FALSE; /* One point is exterior. */
- }
- }
- return TRUE;
- } else {
- Point2d r;
- /*
- * If any segment of the polygon clips the bounding region, the
- * polygon overlaps the rectangle.
- */
- points[nPoints] = points[0];
- for (pp = points, pend = pp + nPoints; pp < pend; pp++) {
- Point2d p, q;
-
- p = *pp;
- q = *(pp + 1);
- if (Blt_LineRectClip(regionPtr, &p, &q)) {
- return TRUE;
- }
- }
- /*
- * Otherwise the polygon and rectangle are either disjoint or
- * enclosed. Check if one corner of the rectangle is inside the
- * polygon.
- */
- r.x = regionPtr->left;
- r.y = regionPtr->top;
- return Blt_PointInPolygon(&r, points, nPoints);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GraphExtents --
- *
- * Generates a bounding box representing the plotting area of the
- * graph. This data structure is used to clip the points and line
- * segments of the line element.
- *
- * The clip region is the plotting area plus such arbitrary extra space.
- * The reason we clip with a bounding box larger than the plot area is so
- * that symbols will be drawn even if their center point isn't in the
- * plotting area.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The bounding box is filled with the dimensions of the plotting area.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_GraphExtents(Graph *graphPtr, Region2d *regionPtr)
-{
- regionPtr->left = (double)(graphPtr->hOffset - graphPtr->xPad.side1);
- regionPtr->top = (double)(graphPtr->vOffset - graphPtr->yPad.side1);
- regionPtr->right = (double)(graphPtr->hOffset + graphPtr->hRange +
- graphPtr->xPad.side2);
- regionPtr->bottom = (double)(graphPtr->vOffset + graphPtr->vRange +
- graphPtr->yPad.side2);
-}
-
-static int
-ClipTest (double ds, double dr, double *t1, double *t2)
-{
- double t;
-
- if (ds < 0.0) {
- t = dr / ds;
- if (t > *t2) {
- return FALSE;
- }
- if (t > *t1) {
- *t1 = t;
- }
- } else if (ds > 0.0) {
- t = dr / ds;
- if (t < *t1) {
- return FALSE;
- }
- if (t < *t2) {
- *t2 = t;
- }
- } else {
- /* d = 0, so line is parallel to this clipping edge */
- if (dr < 0.0) { /* Line is outside clipping edge */
- return FALSE;
- }
- }
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_LineRectClip --
- *
- * Clips the given line segment to a rectangular region. The coordinates
- * of the clipped line segment are returned. The original coordinates
- * are overwritten.
- *
- * Reference:
- * Liang, Y-D., and B. Barsky, A new concept and method for
- * Line Clipping, ACM, TOG,3(1), 1984, pp.1-22.
- *
- * Results:
- * Returns if line segment is visible within the region. The coordinates
- * of the original line segment are overwritten by the clipped
- * coordinates.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_LineRectClip(
- Region2d *regionPtr, /* Rectangular region to clip. */
- Point2d *p, Point2d *q) /* (in/out) Coordinates of original and
- * clipped line segment. */
-{
- double t1, t2;
- double dx, dy;
-
- t1 = 0.0, t2 = 1.0;
- dx = q->x - p->x;
- if ((ClipTest (-dx, p->x - regionPtr->left, &t1, &t2)) &&
- (ClipTest (dx, regionPtr->right - p->x, &t1, &t2))) {
- dy = q->y - p->y;
- if ((ClipTest (-dy, p->y - regionPtr->top, &t1, &t2)) &&
- (ClipTest (dy, regionPtr->bottom - p->y, &t1, &t2))) {
- if (t2 < 1.0) {
- q->x = p->x + t2 * dx;
- q->y = p->y + t2 * dy;
- }
- if (t1 > 0.0) {
- p->x += t1 * dx;
- p->y += t1 * dy;
- }
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PolyRectClip --
- *
- * Clips the given polygon to a rectangular region. The resulting
- * polygon is returned. Note that the resulting polyon may be complex,
- * connected by zero width/height segments. The drawing routine (such as
- * XFillPolygon) will not draw a connecting segment.
- *
- * Reference:
- * Liang Y. D. and Brian A. Barsky, "Analysis and Algorithm for
- * Polygon Clipping", Communications of ACM, Vol. 26,
- * p.868-877, 1983
- *
- * Results:
- * Returns the number of points in the clipped polygon. The points of the
- * clipped polygon are stored in *outputPts*.
- *
- *---------------------------------------------------------------------------
- */
-#define EPSILON FLT_EPSILON
-#define AddVertex(vx, vy) r->x=(vx), r->y=(vy), r++, count++
-#define LastVertex(vx, vy) r->x=(vx), r->y=(vy), count++
-
-int
-Blt_PolyRectClip(
- Region2d *regionPtr, /* Rectangular region clipping the polygon. */
- Point2d *points, /* Points of polygon to be clipped. */
- int nPoints, /* # of points in polygon. */
- Point2d *clipPts) /* (out) Points of clipped polygon. */
-{
- Point2d *p; /* First vertex of input polygon edge. */
- Point2d *pend;
- Point2d *q; /* Last vertex of input polygon edge. */
- Point2d *r;
- int count;
-
- r = clipPts;
- count = 0; /* Counts # of vertices in output polygon. */
-
- points[nPoints] = points[0];
- for (p = points, q = p + 1, pend = p + nPoints; p < pend; p++, q++) {
- double dx, dy;
- double tin1, tin2, tinx, tiny;
- double xin, yin, xout, yout;
-
- dx = q->x - p->x; /* X-direction */
- dy = q->y - p->y; /* Y-direction */
-
- if (FABS(dx) < EPSILON) {
- dx = (p->x > regionPtr->left) ? -EPSILON : EPSILON ;
- }
- if (FABS(dy) < EPSILON) {
- dy = (p->y > regionPtr->top) ? -EPSILON : EPSILON ;
- }
-
- if (dx > 0.0) { /* Left */
- xin = regionPtr->left;
- xout = regionPtr->right + 1.0;
- } else { /* Right */
- xin = regionPtr->right + 1.0;
- xout = regionPtr->left;
- }
- if (dy > 0.0) { /* Top */
- yin = regionPtr->top;
- yout = regionPtr->bottom + 1.0;
- } else { /* Bottom */
- yin = regionPtr->bottom + 1.0;
- yout = regionPtr->top;
- }
-
- tinx = (xin - p->x) / dx;
- tiny = (yin - p->y) / dy;
-
- if (tinx < tiny) { /* Hits x first */
- tin1 = tinx;
- tin2 = tiny;
- } else { /* Hits y first */
- tin1 = tiny;
- tin2 = tinx;
- }
-
- if (tin1 <= 1.0) {
- if (tin1 > 0.0) {
- AddVertex(xin, yin);
- }
- if (tin2 <= 1.0) {
- double toutx, touty, tout1;
-
- toutx = (xout - p->x) / dx;
- touty = (yout - p->y) / dy;
- tout1 = MIN(toutx, touty);
-
- if ((tin2 > 0.0) || (tout1 > 0.0)) {
- if (tin2 <= tout1) {
- if (tin2 > 0.0) {
- if (tinx > tiny) {
- AddVertex(xin, p->y + tinx * dy);
- } else {
- AddVertex(p->x + tiny * dx, yin);
- }
- }
- if (tout1 < 1.0) {
- if (toutx < touty) {
- AddVertex(xout, p->y + toutx * dy);
- } else {
- AddVertex(p->x + touty * dx, yout);
- }
- } else {
- AddVertex(q->x, q->y);
- }
- } else {
- if (tinx > tiny) {
- AddVertex(xin, yout);
- } else {
- AddVertex(xout, yin);
- }
-
- }
- }
- }
- }
- }
- if (count > 0) {
- LastVertex(clipPts[0].x, clipPts[0].y);
- }
- return count;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetProjection --
- *
- * Computes the projection of a point on a line. The line (given by two
- * points), is assumed the be infinite.
- *
- * Compute the slope (angle) of the line and rotate it 90 degrees. Using
- * the slope-intercept method (we know the second line from the sample
- * test point and the computed slope), then find the intersection of both
- * lines. This will be the projection of the sample point on the first
- * line.
- *
- * Results:
- * Returns the coordinates of the projection on the line.
- *
- *---------------------------------------------------------------------------
- */
-Point2d
-Blt_GetProjection(
- int x, int y, /* Screen coordinates of the sample point. */
- Point2d *p, Point2d *q) /* Line segment to project point onto */
-{
- double dx, dy;
- Point2d t;
-
- dx = p->x - q->x;
- dy = p->y - q->y;
-
- /* Test for horizontal and vertical lines */
- if (FABS(dx) < DBL_EPSILON) {
- t.x = p->x, t.y = (double)y;
- } else if (FABS(dy) < DBL_EPSILON) {
- t.x = (double)x, t.y = p->y;
- } else {
- double m1, m2; /* Slope of both lines */
- double b1, b2; /* y-intercepts */
- double midX, midY; /* Midpoint of line segment. */
- double ax, ay, bx, by;
-
- /* Compute the slope and intercept of PQ. */
- m1 = (dy / dx);
- b1 = p->y - (p->x * m1);
-
- /*
- * Compute the slope and intercept of a second line segment: one that
- * intersects through sample X-Y coordinate with a slope perpendicular
- * to original line.
- */
-
- /* Find midpoint of PQ. */
- midX = (p->x + q->x) * 0.5;
- midY = (p->y + q->y) * 0.5;
-
- /* Rotate the line 90 degrees */
- ax = midX - (0.5 * dy);
- ay = midY - (0.5 * -dx);
- bx = midX + (0.5 * dy);
- by = midY + (0.5 * -dx);
-
- m2 = (ay - by) / (ax - bx);
- b2 = y - (x * m2);
-
- /*
- * Given the equations of two lines which contain the same point,
- *
- * y = m1 * x + b1
- * y = m2 * x + b2
- *
- * solve for the intersection.
- *
- * x = (b2 - b1) / (m1 - m2)
- * y = m1 * x + b1
- *
- */
-
- t.x = (b2 - b1) / (m1 - m2);
- t.y = m1 * t.x + b1;
- }
- return t;
-}
-
-typedef struct {
- double hue, sat, val;
-} HSV;
-
-#define SetColor(c,r,g,b) ((c)->red = (int)((r) * 65535.0), \
- (c)->green = (int)((g) * 65535.0), \
- (c)->blue = (int)((b) * 65535.0))
-
-#ifdef notdef
-void
-Blt_XColorToHSV(XColor *colorPtr, HSV *hsvPtr)
-{
- unsigned short max, min;
- double range;
- unsigned short *colorValues;
-
- /* Find the minimum and maximum RGB intensities */
- colorValues = (unsigned short *)&colorPtr->red;
- max = MAX3(colorValues[0], colorValues[1], colorValues[2]);
- min = MIN3(colorValues[0], colorValues[1], colorValues[2]);
-
- hsvPtr->val = (double)max / 65535.0;
- hsvPtr->hue = hsvPtr->sat = 0.0;
-
- range = (double)(max - min);
- if (max != min) {
- hsvPtr->sat = range / (double)max;
- }
- if (hsvPtr->sat > 0.0) {
- double red, green, blue;
-
- /* Normalize the RGB values */
- red = (double)(max - colorPtr->red) / range;
- green = (double)(max - colorPtr->green) / range;
- blue = (double)(max - colorPtr->blue) / range;
-
- if (colorPtr->red == max) {
- hsvPtr->hue = (blue - green);
- } else if (colorPtr->green == max) {
- hsvPtr->hue = 2 + (red - blue);
- } else if (colorPtr->blue == max) {
- hsvPtr->hue = 4 + (green - red);
- }
- hsvPtr->hue *= 60.0;
- } else {
- hsvPtr->sat = 0.5;
- }
- if (hsvPtr->hue < 0.0) {
- hsvPtr->hue += 360.0;
- }
-}
-
-void
-Blt_HSVToXColor(HSV *hsvPtr, XColor *colorPtr)
-{
- double hue, p, q, t;
- double frac;
- int quadrant;
-
- if (hsvPtr->val < 0.0) {
- hsvPtr->val = 0.0;
- } else if (hsvPtr->val > 1.0) {
- hsvPtr->val = 1.0;
- }
- if (hsvPtr->sat == 0.0) {
- SetColor(colorPtr, hsvPtr->val, hsvPtr->val, hsvPtr->val);
- return;
- }
- hue = FMOD(hsvPtr->hue, 360.0) / 60.0;
- quadrant = (int)floor(hue);
- frac = hsvPtr->hue - quadrant;
- p = hsvPtr->val * (1 - (hsvPtr->sat));
- q = hsvPtr->val * (1 - (hsvPtr->sat * frac));
- t = hsvPtr->val * (1 - (hsvPtr->sat * (1 - frac)));
-
- switch (quadrant) {
- case 0:
- SetColor(colorPtr, hsvPtr->val, t, p);
- break;
- case 1:
- SetColor(colorPtr, q, hsvPtr->val, p);
- break;
- case 2:
- SetColor(colorPtr, p, hsvPtr->val, t);
- break;
- case 3:
- SetColor(colorPtr, p, q, hsvPtr->val);
- break;
- case 4:
- SetColor(colorPtr, t, p, hsvPtr->val);
- break;
- case 5:
- SetColor(colorPtr, hsvPtr->val, p, q);
- break;
- }
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_AdjustViewport --
- *
- * Adjusts the offsets of the viewport according to the scroll mode.
- * This is to accommodate both "listbox" and "canvas" style scrolling.
- *
- * "canvas" The viewport scrolls within the range of world
- * coordinates. This way the viewport always displays
- * a full page of the world. If the world is smaller
- * than the viewport, then (bizarrely) the world and
- * viewport are inverted so that the world moves up
- * and down within the viewport.
- *
- * "listbox" The viewport can scroll beyond the range of world
- * coordinates. Every entry can be displayed at the
- * top of the viewport. This also means that the
- * scrollbar thumb weirdly shrinks as the last entry
- * is scrolled upward.
- *
- * Results:
- * The corrected offset is returned.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_AdjustViewport(int offset, int worldSize, int windowSize, int scrollUnits,
- int scrollMode)
-{
- switch (scrollMode) {
- case BLT_SCROLL_MODE_CANVAS:
-
- /*
- * Canvas-style scrolling allows the world to be scrolled within the
- * window.
- */
- if (worldSize < windowSize) {
- if ((worldSize - offset) > windowSize) {
- offset = worldSize - windowSize;
- }
- if (offset > 0) {
- offset = 0;
- }
- } else {
- if ((offset + windowSize) > worldSize) {
- offset = worldSize - windowSize;
- }
- if (offset < 0) {
- offset = 0;
- }
- }
- break;
-
- case BLT_SCROLL_MODE_LISTBOX:
- if (offset < 0) {
- offset = 0;
- }
- if (offset >= worldSize) {
- offset = worldSize - scrollUnits;
- }
- break;
-
- case BLT_SCROLL_MODE_HIERBOX:
-
- /*
- * Hierbox-style scrolling allows the world to be scrolled within the
- * window.
- */
- if ((offset + windowSize) > worldSize) {
- offset = worldSize - windowSize;
- }
- if (offset < 0) {
- offset = 0;
- }
- break;
- }
- return offset;
-}
-
-int
-Blt_GetScrollInfoFromObj(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv,
- int *offsetPtr, int worldSize, int windowSize,
- int scrollUnits, int scrollMode)
-{
- char c;
- const char *string;
- int length;
- int offset;
-
- offset = *offsetPtr;
- string = Tcl_GetStringFromObj(objv[0], &length);
- c = string[0];
- if ((c == 's') && (strncmp(string, "scroll", length) == 0)) {
- double fract;
- int count;
-
- if (objc != 3) {
- return TCL_ERROR;
- }
- /* Scroll number unit/page */
- if (Tcl_GetIntFromObj(interp, objv[1], &count) != TCL_OK) {
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- if ((c == 'u') && (strncmp(string, "units", length) == 0)) {
- fract = (double)count *scrollUnits;
- } else if ((c == 'p') && (strncmp(string, "pages", length) == 0)) {
- /* A page is 90% of the view-able window. */
- fract = (double)count * windowSize * 0.9;
- } else {
- Tcl_AppendResult(interp, "unknown \"scroll\" units \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- offset += (int)fract;
- } else if ((c == 'm') && (strncmp(string, "moveto", length) == 0)) {
- double fract;
-
- if (objc != 2) {
- return TCL_ERROR;
- }
- /* moveto fraction */
- if (Tcl_GetDoubleFromObj(interp, objv[1], &fract) != TCL_OK) {
- return TCL_ERROR;
- }
- offset = (int)(worldSize * fract);
- } else {
- double fract;
- int count;
-
- /* Treat like "scroll units" */
- if (Tcl_GetIntFromObj(interp, objv[0], &count) != TCL_OK) {
- return TCL_ERROR;
- }
- fract = (double)count *scrollUnits;
- offset += (int)fract;
- }
- *offsetPtr = Blt_AdjustViewport(offset, worldSize, windowSize, scrollUnits,
- scrollMode);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_UpdateScrollbar --
- *
- * Invoke a TCL command to the scrollbar, defining the new position and
- * length of the scroll. See the Tk documentation for further information
- * on the scrollbar. It is assumed the scrollbar command prefix is
- * valid.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Scrollbar is commanded to change position and/or size.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_UpdateScrollbar(
- Tcl_Interp *interp,
- Tcl_Obj *scrollCmdObjPtr, /* Scrollbar command prefix. May be
- * several words */
- int first, int last, int width)
-{
- Tcl_Obj *cmdObjPtr;
- double firstFract, lastFract;
-
- firstFract = 0.0, lastFract = 1.0;
- if (width > 0) {
- firstFract = (double)first / (double)width;
- lastFract = (double)last / (double)width;
- }
- cmdObjPtr = Tcl_DuplicateObj(scrollCmdObjPtr);
- Tcl_ListObjAppendElement(interp, cmdObjPtr, Tcl_NewDoubleObj(firstFract));
- Tcl_ListObjAppendElement(interp, cmdObjPtr, Tcl_NewDoubleObj(lastFract));
- Tcl_IncrRefCount(cmdObjPtr);
- if (Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL) != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
- Tcl_DecrRefCount(cmdObjPtr);
-
-}
-
-/* -------------------------------------------------------------------------- */
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPrivateGCFromDrawable --
- *
- * Like Tk_GetGC, but doesn't share the GC with any other widget. This
- * is needed because the certain GC parameters (like dashes) can not be
- * set via XCreateGC, therefore there is no way for Tk's hashing
- * mechanism to recognize that two such GCs differ.
- *
- * Results:
- * A new GC is returned.
- *
- *---------------------------------------------------------------------------
- */
-GC
-Blt_GetPrivateGCFromDrawable(
- Display *display,
- Drawable drawable,
- unsigned long gcMask,
- XGCValues *valuePtr)
-{
- GC newGC;
-
-#ifdef WIN32
- newGC = Blt_EmulateXCreateGC(display, drawable, gcMask, valuePtr);
-#else
- newGC = XCreateGC(display, drawable, gcMask, valuePtr);
-#endif
- return newGC;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPrivateGC --
- *
- * Like Tk_GetGC, but doesn't share the GC with any other widget. This
- * is needed because the certain GC parameters (like dashes) can not be
- * set via XCreateGC, therefore there is no way for Tk's hashing
- * mechanism to recognize that two such GCs differ.
- *
- * Results:
- * A new GC is returned.
- *
- *---------------------------------------------------------------------------
- */
-GC
-Blt_GetPrivateGC(
- Tk_Window tkwin,
- unsigned long gcMask,
- XGCValues *valuePtr)
-{
- GC gc;
- Pixmap pixmap;
- Drawable drawable;
- Display *display;
-
- pixmap = None;
- drawable = Tk_WindowId(tkwin);
- display = Tk_Display(tkwin);
- if (drawable == None) {
- Drawable root;
- int depth;
-
- root = Tk_RootWindow(tkwin);
- depth = Tk_Depth(tkwin);
-
- if (depth == DefaultDepth(display, Tk_ScreenNumber(tkwin))) {
- drawable = root;
- } else {
- pixmap = Tk_GetPixmap(display, root, 1, 1, depth);
- drawable = pixmap;
- Blt_SetDrawableAttribs(display, drawable, 1, 1, depth,
- Tk_Colormap(tkwin), Tk_Visual(tkwin));
- }
- }
- gc = Blt_GetPrivateGCFromDrawable(display, drawable, gcMask, valuePtr);
- if (pixmap != None) {
- Tk_FreePixmap(display, pixmap);
- }
- return gc;
-}
-
-void
-Blt_FreePrivateGC(Display *display, GC gc)
-{
- Tk_FreeXId(display, (XID) XGContextFromGC(gc));
- XFreeGC(display, gc);
-}
-
-#ifndef WIN32
-void
-Blt_SetDashes(Display *display, GC gc, Blt_Dashes *dashesPtr)
-{
- XSetDashes(display, gc, dashesPtr->offset, (const char *)dashesPtr->values,
- (int)strlen((char *)dashesPtr->values));
-}
-#endif
-
-void
-Blt_ScreenDPI(Tk_Window tkwin, unsigned int *xPtr, unsigned int *yPtr)
-{
- Screen *screen;
-
-#define MM_INCH 25.4
- screen = Tk_Screen(tkwin);
- *xPtr = (unsigned int)((WidthOfScreen(screen) * MM_INCH) /
- WidthMMOfScreen(screen));
- *yPtr = (unsigned int)((HeightOfScreen(screen) * MM_INCH) /
- HeightMMOfScreen(screen));
-}
-
-void
-Blt_Draw2DSegments(
- Display *display,
- Drawable drawable,
- GC gc,
- Segment2d *segments,
- int nSegments)
-{
- XSegment *dp, *xsegments;
- Segment2d *sp, *send;
-
- xsegments = Blt_Malloc(nSegments * sizeof(XSegment));
- if (xsegments == NULL) {
- return;
- }
- dp = xsegments;
- for (sp = segments, send = sp + nSegments; sp < send; sp++) {
- dp->x1 = (short int)sp->p.x;
- dp->y1 = (short int)sp->p.y;
- dp->x2 = (short int)sp->q.x;
- dp->y2 = (short int)sp->q.y;
- dp++;
- }
- XDrawSegments(display, drawable, gc, xsegments, nSegments);
- Blt_Free(xsegments);
-}
-
-void
-Blt_DrawArrowOld(Display *display, Drawable drawable, GC gc, int x, int y, int w,
- int h, int borderWidth, int orientation)
-{
- XPoint arrow[4];
- int s2, s;
- int ax, ay;
-
-#define ARROW_IPAD 1
- w -= 2 * (ARROW_IPAD + borderWidth);
- h -= 2 * (ARROW_IPAD + borderWidth);
- x += ARROW_IPAD + borderWidth;
- y += ARROW_IPAD + borderWidth;
-
- w |= 0x01;
- h |= 0x01;
- s = MIN(w, h);
- s2 = s / 2;
- ax = x + w / 2;
- ay = y + h / 2;
-
- switch (orientation) {
- case ARROW_UP:
- ay -= s2/2 + 1;
- arrow[2].x = arrow[0].x = ax;
- arrow[2].y = arrow[0].y = ay;
- arrow[0].x = ax + s2 + 1;
- arrow[1].x = ax - s2;
- arrow[0].y = arrow[1].y = ay + s2 + 1;
- fprintf(stderr, "up arrow %d,%d %d,%d %d,%d\n",
- arrow[0].x, arrow[0].y,
- arrow[1].x, arrow[1].y,
- arrow[2].x, arrow[2].y);
- break;
- case ARROW_DOWN:
- ay -= s2/2;
- arrow[3].x = arrow[0].x = ax;
- arrow[3].y = arrow[0].y = ay + s2 + 1;
- arrow[1].x = ax + s2 + 1;
- arrow[2].x = ax - s2;
- arrow[2].y = arrow[1].y = ay;
- fprintf(stderr, "down arrow %d,%d %d,%d %d,%d\n",
- arrow[0].x, arrow[0].y,
- arrow[1].x, arrow[1].y,
- arrow[2].x, arrow[2].y);
- break;
- case ARROW_LEFT:
- ax -= s2 / 2;
- arrow[3].x = arrow[0].x = ax;
- arrow[3].y = arrow[0].y = ay;
- arrow[1].y = ay - s2;
- arrow[2].y = ay + s2 + 1;
- arrow[2].x = arrow[1].x = ax + s2 + 1;
- break;
- case ARROW_RIGHT:
- ax -= s2 / 2;
- arrow[3].x = arrow[0].x = ax + s2 + 1;
- arrow[3].y = arrow[0].y = ay;
- arrow[1].y = ay - s2;
- arrow[2].y = ay + s2;
- arrow[2].x = arrow[1].x = ax;
- break;
- }
- XFillPolygon(display, drawable, gc, arrow, 3, Convex, CoordModeOrigin);
-}
-
-void
-Blt_DrawArrow(Display *display, Drawable drawable, XColor *color, int x, int y,
- int w, int h, int borderWidth, int orientation)
-{
- int s;
- int s2;
- int ax, ay;
- int dx, dy;
- GC gc;
-
-#define ARROW_IPAD 1
- w -= 2 * (ARROW_IPAD + borderWidth);
- h -= 2 * (ARROW_IPAD + borderWidth);
- x += ARROW_IPAD + borderWidth;
- y += ARROW_IPAD + borderWidth;
-
- s = MIN(w, h);
- s2 = (s / 2) + 1;
- ax = x + w / 2;
- ay = y + h / 2;
-
- gc = Tk_GCForColor(color, drawable);
- switch (orientation) {
- case ARROW_UP:
- ay -= s2 / 2;
- for (dx = 0; dx < s2; dx++, ay++) {
- XDrawLine(display, drawable, gc, ax - dx, ay, ax + dx, ay);
- }
- break;
- case ARROW_DOWN:
- ay += s2 / 2;
- for (dx = 0; dx < s2; dx++, ay--) {
- XDrawLine(display, drawable, gc, ax - dx, ay, ax + dx, ay);
- }
- break;
- case ARROW_LEFT:
- ax -= s2 / 2;
- for (dy = 0; dy < s2; dy++, ax++) {
- XDrawLine(display, drawable, gc, ax, ay - dy, ax, ay + dy);
- }
- break;
- case ARROW_RIGHT:
- ax += s2 / 2;
- for (dy = 0; dy < s2; dy++, ax--) {
- XDrawLine(display, drawable, gc, ax, ay - dy, ax, ay + dy);
- }
- break;
- }
-}
-
-long
-Blt_MaxRequestSize(Display *display, size_t elemSize)
-{
- static long maxSizeBytes = 0L;
-
- if (maxSizeBytes == 0L) {
- long size;
-#ifndef WIN32
- size = XExtendedMaxRequestSize(display);
- if (size == 0) {
- size = XMaxRequestSize(display);
- }
-#else
- size = XMaxRequestSize(display);
-#endif
- size -= (4 * elemSize);
- /* maxSizeBytes = (size * 4); */
- maxSizeBytes = size;
- }
- return (maxSizeBytes / elemSize);
-}
-
-void
-Blt_GetLineExtents(size_t nPoints, Point2d *points, Region2d *r)
-{
- Point2d *p, *pend;
- r->top = r->left = DBL_MAX;
- r->bottom = r->right = -DBL_MAX;
- for (p = points, pend = p + nPoints; p < pend; p++) {
- if (r->top > p->y) {
- r->top = p->y;
- }
- if (r->bottom < p->y) {
- r->bottom = p->y;
- }
- if (r->left > p->x) {
- r->left = p->x;
- }
- if (r->right < p->x) {
- r->right = p->x;
- }
- }
-}
-
-#undef Blt_Fill3DRectangle
-void
-Blt_Fill3DRectangle(
- Tk_Window tkwin, /* Window for which border was allocated. */
- Drawable drawable, /* X window or pixmap in which to draw. */
- Tk_3DBorder border, /* Token for border to draw. */
- int x, int y,
- int width, int height, /* Outside area of rectangular region. */
- int borderWidth, /* Desired width for border, in pixels. Border
- * will be *inside* region. */
- int relief) /* Indicates 3D effect: TK_RELIEF_FLAT,
- * TK_RELIEF_RAISED, or TK_RELIEF_SUNKEN. */
-{
-#ifndef notdef
- if ((borderWidth > 1) && (width > 2) && (height > 2) &&
- ((relief == TK_RELIEF_SUNKEN) || (relief == TK_RELIEF_RAISED))) {
- GC lightGC, darkGC;
- int x2, y2;
-
- x2 = x + width - 1;
- y2 = y + height - 1;
-#define TK_3D_LIGHT2_GC TK_3D_DARK_GC+1
-#define TK_3D_DARK2_GC TK_3D_DARK_GC+2
- if (relief == TK_RELIEF_RAISED) {
- lightGC = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC);
- darkGC = Tk_3DBorderGC(tkwin, border, TK_3D_DARK_GC);
-#ifdef notdef
- darkGC = DefaultGC(Tk_Display(tkwin), Tk_ScreenNumber(tkwin));
-#endif
- } else {
-
- lightGC = Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC);
-#ifdef notdef
- lightGC = DefaultGC(Tk_Display(tkwin), Tk_ScreenNumber(tkwin));
-#endif
- darkGC = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC);
- }
- XDrawLine(Tk_Display(tkwin), drawable, lightGC, x, y, x2, y);
- XDrawLine(Tk_Display(tkwin), drawable, darkGC, x2, y2, x2, y);
- XDrawLine(Tk_Display(tkwin), drawable, darkGC, x2, y2, x, y2);
- XDrawLine(Tk_Display(tkwin), drawable, lightGC, x, y, x, y2);
- x++, y++, width -= 2, height -= 2, borderWidth--;
- }
-#endif
- Tk_Fill3DRectangle(tkwin, drawable, border, x, y, width, height,
- borderWidth, relief);
-}
-
-
-#undef Blt_Draw3DRectangle
-void
-Blt_Draw3DRectangle(
- Tk_Window tkwin, /* Window for which border was allocated. */
- Drawable drawable, /* X window or pixmap in which to draw. */
- Tk_3DBorder border, /* Token for border to draw. */
- int x, int y,
- int width, int height, /* Outside area of rectangular region. */
- int borderWidth, /* Desired width for border, in pixels. Border
- * will be *inside* region. */
- int relief) /* Indicates 3D effect: TK_RELIEF_FLAT,
- * TK_RELIEF_RAISED, or TK_RELIEF_SUNKEN. */
-{
-#ifndef notdef
- if ((borderWidth > 1) && (width > 2) && (height > 2) &&
- ((relief == TK_RELIEF_SUNKEN) || (relief == TK_RELIEF_RAISED))) {
- GC lightGC, darkGC;
- int x2, y2;
-
- x2 = x + width - 1;
- y2 = y + height - 1;
- if (relief == TK_RELIEF_RAISED) {
- lightGC = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC);
- darkGC = Tk_3DBorderGC(tkwin, border, TK_3D_DARK_GC);
-#ifdef notdef
- darkGC = DefaultGC(Tk_Display(tkwin), Tk_ScreenNumber(tkwin));
-#endif
- } else {
- lightGC = Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC);
-#ifdef notdef
- lightGC = DefaultGC(Tk_Display(tkwin), Tk_ScreenNumber(tkwin));
-#endif
- darkGC = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC);
- }
- XDrawLine(Tk_Display(tkwin), drawable, darkGC, x2, y2, x2, y);
- XDrawLine(Tk_Display(tkwin), drawable, lightGC, x, y, x2, y);
- XDrawLine(Tk_Display(tkwin), drawable, darkGC, x2, y2, x, y2);
- XDrawLine(Tk_Display(tkwin), drawable, lightGC, x, y, x, y2);
- x++, y++, width -= 2, height -= 2, borderWidth--;
- }
-#endif
- Tk_Draw3DRectangle(tkwin, drawable, border, x, y, width, height,
- borderWidth, relief);
-}
-
-#ifdef notdef
-typedef struct {
- Screen *screen;
- Visual *visual;
- Colormap colormap;
- Tk_Uid nameUid;
-} BorderKey;
-
-typedef struct {
- Screen *screen; /* Screen on which the border will be used. */
- Visual *visual; /* Visual for all windows and pixmaps using
- * the border. */
- int depth; /* Number of bits per pixel of drawables where
- * the border will be used. */
- Colormap colormap; /* Colormap out of which pixels are
- * allocated. */
- int refCount; /* Number of active uses of this color (each
- * active use corresponds to a call to
- * Blt_Get3DBorder). If this count is 0, then
- * this structure is no longer valid and it
- * isn't present in borderTable: it is being
- * kept around only because there are objects
- * referring to it. The structure is freed
- * when refCount is 0. */
-
- XColor *bgColorPtr; /* Color of face. */
- XColor *shadows[4];
-
- Pixmap darkStipple; /* Stipple pattern to use for drawing shadows
- * areas. Used for displays with <= 64 colors
- * or where colormap has filled up. */
- Pixmap lightStipple; /* Stipple pattern to use for drawing shadows
- * areas. Used for displays with <= 64 colors
- * or where colormap has filled up. */
- GC bgGC; /* Used (if necessary) to draw areas in the
- * background color. */
- GC lightGC, darkGC;
- Tcl_HashEntry *hashPtr; /* Entry in borderTable (needed in order to
- * delete structure). */
-
- struct _Blt_3DBorder *nextPtr;
-} Border, *Blt_3DBorder;
-
-
-void
-Blt_Draw3DRectangle(tkwin, drawable, border, x, y, width,
- height, borderWidth, relief)
- Tk_Window tkwin; /* Window for which border was allocated. */
- Drawable drawable; /* X window or pixmap in which to draw. */
- Blt_3DBorder *borderPtr; /* Border to draw. */
- int x, y, width, height; /* Outside area of rectangular region. */
- int borderWidth; /* Desired width for border, in
- * pixels. Border will be *inside* region. */
- int relief; /* Indicates 3D effect: TK_RELIEF_FLAT,
- * TK_RELIEF_RAISED, or TK_RELIEF_SUNKEN. */
-{
- if ((width > (2 * borderWidth)) && (height > (2 * borderWidth))) {
- int x2, y2;
- int i;
-
- x2 = x + width - 1;
- y2 = y + height - 1;
-
- XSetForeground(borderPtr->lightGC, borderPtr->shadows[0]);
- XSetForeground(borderPtr->darkGC, borderPtr->shadows[3]);
- XDrawLine(Tk_Display(tkwin), drawable, borderPtr->lightGC,
- x, y, x2, y);
- XDrawLine(Tk_Display(tkwin), drawable, borderPtr->lightGC,
- x, y, x, y2);
- XDrawLine(Tk_Display(tkwin), drawable, borderPtr->darkGC,
- x2, y, x2, y2);
- XDrawLine(Tk_Display(tkwin), drawable, borderPtr->darkGC,
- x2, y2, x, y2);
- XSetForeground(borderPtr->lightGC, borderPtr->shadows[1]);
- XSetForeground(borderPtr->darkGC, borderPtr->shadows[2]);
- for (i = 1; i < (borderWidth - 1); i++) {
-
- /*
- * +----------
- * |+-------
- * ||+-----
- * |||
- * |||
- * ||
- * |
- */
- x++, y++, x2--, y2--;
- XDrawLine(Tk_Display(tkwin), drawable, borderPtr->lightGC,
- x, y, x2, y);
- XDrawLine(Tk_Display(tkwin), drawable, borderPtr->lightGC,
- x, y, x, y2);
- XDrawLine(Tk_Display(tkwin), drawable, borderPtr->darkGC,
- x2, y, x2, y2);
- XDrawLine(Tk_Display(tkwin), drawable, borderPtr->darkGC,
- x2, y2, x, y2);
- }
- }
-}
-
-void
-Blt_Fill3DRectangle(tkwin, drawable, border, x, y, width, height, borderWidth,
- relief)
- Tk_Window tkwin; /* Window for which border was allocated. */
- Drawable drawable; /* X window or pixmap in which to draw. */
- Tk_3DBorder border; /* Token for border to draw. */
- int x, y, width, height; /* Outside area of rectangular region. */
- int borderWidth; /* Desired width for border, in
- * pixels. Border will be *inside* region. */
- int relief; /* Indicates 3D effect: TK_RELIEF_FLAT,
- * TK_RELIEF_RAISED, or TK_RELIEF_SUNKEN. */
-{
- Blt_3DBorder *borderPtr;
-
- XFillRectangle(Tk_Display(tkwin), drawable, borderPtr->bgGC, x, y, width,
- height);
- if ((borderWidth > 0) && (relief != BLT_RELIEF_FLAT)) {
- Blt_Draw3DRectangle(tkwin, drawable, borderPtr, x, y, width, height,
- borderWidth, relief);
- }
-}
-
-
-void
-FreeBorder(display, borderPtr)
- Display *display;
- Border *borderPtr;
-{
- int i;
-
- if (borderPtr->bgColorPtr != NULL) {
- Tk_FreeColor(display, borderPtr->bgColorPtr);
- }
- for (i = 0; i < 4; i++) {
- Tk_FreeColor(display, borderPtr->shadows[i]);
- }
- if (borderPtr->darkGC != NULL) {
- Blt_FreePrivateGC(display, borderPtr->darkGC);
- }
- if (borderPtr->lightGC != NULL) {
- Blt_FreePrivateGC(tkwin, borderPtr->lightGC);
- }
- if (borderPtr->bgGC != NULL) {
- Blt_FreePrivateGC(tkwin, borderPtr->bgGC);
- }
- Blt_Free(borderPtr);
-}
-
-void
-Blt_Free3DBorder(display, border)
- Display *display;
- Blt_3DBorder border;
-{
- Border *borderPtr = (Border *)border;
-
- borderPtr->refCount--;
- if (borderPtr->refCount >= 0) {
- /* Search for the border in the bucket. Start at the head. */
- headPtr = Blt_GetHashValue(borderPtr->hashPtr);
- lastPtr = NULL;
- while ((headPtr != borderPtr) && (headPtr != NULL)) {
- lastPtr = headPtr;
- headPtr = headPtr->next;
- }
- if (headPtr == NULL) {
- return; /* This can't happen. It means that we could
- * not find the border. */
- }
- if (lastPtr != NULL) {
- lastPtr->next = borderPtr->next;
- } else {
- Tcl_DeleteHashEntry(borderPtr->hashPtr);
- }
- FreeBorder(display, borderPtr);
- }
-}
-
-Blt_3DBorder *
-Blt_Get3DBorder(Tcl_Interp *interp, Tk_Window tkwin, const char *borderName)
-{
- Blt_3DBorder *borderPtr, *lastBorderPtr;
- Blt_HashEntry *hPtr;
- XColor *bgColorPtr;
- char **argv;
- const char *colorName;
- int argc;
- int isNew;
-
- lastBorderPtr = NULL;
- hPtr = Tcl_CreateHashEntry(&dataPtr->borderTable, borderName, &isNew);
- if (!isNew) {
- borderPtr = lastBorderPtr = Blt_GetHashValue(hPtr);
- while (borderPtr != NULL) {
- if ((Tk_Screen(tkwin) == borderPtr->screen) &&
- (Tk_Colormap(tkwin) == borderPtr->colormap)) {
- borderPtr->refCount++;
- return borderPtr;
- }
- borderPtr = borderPtr->nextPtr;
- }
- }
- /* Create a new border. */
- argv = NULL;
- bgColorPtr = NULL;
-
- if (Tcl_SplitList(interp, borderName, &argc, &argv) != TCL_OK) {
- goto error;
- }
- colorName = borderName;
- bgColorPtr = Tk_GetColor(interp, tkwin, colorName);
- if (bgColorPtr == NULL) {
- goto error;
- }
-
- /* Create a new border */
- borderPtr = Blt_AssertCalloc(1, sizeof(Blt_3DBorder));
- borderPtr->screen = Tk_Screen(tkwin);
- borderPtr->visual = Tk_Visual(tkwin);
- borderPtr->depth = Tk_Depth(tkwin);
- borderPtr->colormap = Tk_Colormap(tkwin);
- borderPtr->refCount = 1;
- borderPtr->bgColorPtr = bgColorPtr;
- borderPtr->darkGC = Blt_GetPrivateGC(tkwin, 0, NULL);
- borderPtr->lightGC = Blt_GetPrivateGC(tkwin, 0, NULL);
- borderPtr->hashPtr = lastBorderPtr->hashPtr;
- lastBorderPtr->nextPtr = lastBorderPtr;
- {
- HSV hsv;
- XColor color;
- double sat, sat0, diff, step, hstep;
- int count;
-
- /* Convert the face (background) color to HSV */
- Blt_XColorToHSV(borderPtr->bgColorPtr, &hsv);
-
- /* Using the color as the baseline intensity, pick a set of colors
- * around the intensity. */
-#define UFLOOR(x,u) (floor((x)*(u))/(u))
- diff = hsv.sat - UFLOOR(hsv.sat, 0.2);
- sat = 0.1 + (diff - 0.1);
- sat0 = hsv.sat;
- count = 0;
- for (sat = 0.1 + (diff - 0.1); sat <= 1.0; sat += 0.2) {
- if (FABS(sat0 - sat) >= 0.1) {
- hsv.sat = sat;
- Blt_HSVToXColor(&hsv, &color);
- borderPtr->shadows[count] = Tk_GetColorByValue(tkwin, &color);
- count++;
- }
- }
- }
- Blt_SetHashValue(hPtr, borderPtr);
- if (argv != NULL) {
- Blt_Free(argv);
- }
- return TCL_OK;
-
- error:
- if (argv != NULL) {
- Blt_Free(argv);
- }
- if (bgColorPtr != NULL) {
- Tk_FreeColor(bgColorPtr);
- }
- if (isNew) {
- Blt_DeleteHashEntry(&borderTable, hPtr);
- }
- return NULL;
-}
-
-
-#endif
-
-typedef struct {
- float x, y, z;
-} Vector3f;
-
-typedef struct {
- float x, y, z, w;
-} Vector4f;
-
-typedef Vector4f Quaternion;
-
-typedef float Matrix3x3f[3][3];
-
-typedef struct _ArcBall {
- Vector3f click;
- Vector3f drag;
- float xScale;
- float yScale;
-} ArcBall;
-
-/*
- * Arcball sphere constants:
- * Diameter is 2.0f
- * Radius is 1.0f
- * Radius squared is 1.0f
- */
-
-/* assuming IEEE-754 (float), which i believe has max precision of 7 bits */
-#define EPSILON FLT_EPSILON
-static INLINE float
-LengthVector3f(Vector3f *a)
-{
- return sqrtf((a->x * a->x) + (a->y * a->y) + (a->z * a->z));
-}
-
-static INLINE float DotProductVector3f(Vector3f *a, Vector3f *b)
-{
- return (a->x * b->x) + (a->y * b->y) + (a->z * b->z);
-}
-
-/**
- * Calculate the cross product of two 3D vectors: c = a x b.
- * "c" must not refer to the same memory location as "a" or "b".
- */
-static INLINE void
-CrossProductVector3f(Vector3f *a, Vector3f *b, Vector3f *c)
-{
- c->x = (a->y * b->z) - (b->y * a->z);
- c->y = (a->z * b->x) - (b->z * a->x);
- c->z = (a->x * b->y) - (b->x * a->y);
-}
-
-static void
-PointOnSphere (ArcBall *arcPtr, float x, float y, Vector3f *outPtr)
-{
- float sx, sy;
- float d;
-
- /* Adjust point coords and scale down to range of [-1 ... 1] */
- sx = (x * arcPtr->xScale) - 1.0f;
- sy = 1.0f - (y * arcPtr->yScale);
-
- /* Compute the square of the length of the vector to the point from the
- * center. */
- d = (sx * sx) + (sy * sy);
-
- /* If the point is mapped outside of the sphere ...
- * (length > radius squared)
- */
- if (d > 1.0f) {
- float scale;
-
- /* Compute a normalizing factor (radius / sqrt(length)) */
- scale = 1.0f / sqrt (d);
-
- /* Return the "normalized" vector, a point on the sphere */
- outPtr->x = sx * scale;
- outPtr->y = sy * scale;
- outPtr->z = 0.0f;
- } else { /* else it's on the inside */
- /* Return a vector to a point mapped inside the sphere
- * sqrt(radius squared - length) */
- outPtr->x = sx;
- outPtr->y = sy;
- outPtr->z = sqrtf(1.0f - d);
- }
-}
-
-static void
-SetArcBallBounds(ArcBall *arcPtr, float w, float h)
-{
- if (w <= 1.0f ) {
- w = 2.0f;
- }
- if (h <= 1.0f ) {
- h = 2.0f;
- }
- /* Set adjustment factor for width/height */
- arcPtr->xScale = 1.0f / ((w - 1.0f) * 0.5f);
- arcPtr->yScale = 1.0f / ((h - 1.0f) * 0.5f);
-}
-
-static ArcBall *
-CreateArcBall (float w, float h)
-{
- ArcBall *arcPtr;
-
- arcPtr = Blt_AssertCalloc(1, sizeof(ArcBall));
- SetArcBallBounds (arcPtr, w, h);
- return arcPtr;
-}
-
-static void
-DestroyArcBall(ArcBall *arcPtr)
-{
- if (arcPtr != NULL) {
- Blt_Free(arcPtr);
- }
-}
-
-/* Mouse down: Supply mouse position in x and y */
-static void
-ArcBallOnClick(ArcBall *arcPtr, float x, float y)
-{
- PointOnSphere (arcPtr, x, y, &arcPtr->click);
-}
-
-/* Mouse drag, calculate rotation: Supply mouse position in x and y */
-static void
-ArcBallOnDrag(ArcBall *arcPtr, float x, float y, Quaternion *outPtr)
-{
- /* Map the point to the sphere */
- PointOnSphere(arcPtr, x, y, &arcPtr->drag);
-
- /* Return the quaternion equivalent to the rotation */
- if (outPtr != NULL) {
- Vector3f perp;
-
- /* Compute the vector perpendicular to the begin and end vectors */
- CrossProductVector3f(&arcPtr->drag, &arcPtr->click, &perp);
-
- /* Compute the length of the perpendicular vector */
- if (LengthVector3f(&perp) > FLT_EPSILON) {
- /* If its non-zero, we're ok, so return the perpendicular
- * vector as the transform after all
- */
- outPtr->x = perp.x;
- outPtr->y = perp.y;
- outPtr->z = perp.z;
- /* In the quaternion values, w is cosine (theta / 2),
- * where theta is rotation angle
- */
- outPtr->w = DotProductVector3f(&arcPtr->click, &arcPtr->drag);
- } else {
- /* If it is zero, the begin and end vectors coincide,
- * so return an identity transform
- */
- outPtr->x = outPtr->y = outPtr->z = outPtr->z = 0.0f;
- }
- }
-}
-
-
-static INLINE void
-SetRotationMatrix(const Quaternion* q, Matrix3x3f mat)
-{
- float n, s;
- float xs, ys, zs;
- float wx, wy, wz;
- float xx, xy, xz;
- float yy, yz, zz;
-
- assert(mat && q);
-
- n = (q->x * q->x) + (q->y * q->y) + (q->z * q->z) + (q->w * q->w);
-
- s = (n > 0.0f) ? (2.0f / n) : 0.0f;
-
- xs = q->x * s;
- ys = q->y * s;
- zs = q->z * s;
- wx = q->w * xs;
- wy = q->w * ys;
- wz = q->w * zs;
- xx = q->x * xs;
- xy = q->x * ys;
- xz = q->x * zs;
- yy = q->y * ys;
- yz = q->y * zs;
- zz = q->z * zs;
-
- mat[0][0] = 1.0f - (yy + zz);
- mat[0][1] = xy - wz;
- mat[0][2] = xz + wy;
- mat[1][0] = xy + wz;
- mat[1][1] = 1.0f - (xx + zz);
- mat[1][2] = yz - wx;
- mat[2][0] = xz - wy;
- mat[2][1] = yz + wx;
- mat[2][2] = 1.0f - (xx + yy);
-}
-
-/* Return quaternion product qL * qR. Note: order is important!
- * To combine rotations, use the product Mul(Second, First),
- * which gives the effect of rotating by First then Second. */
-static INLINE void
-CombineRotations(Quaternion *a, Quaternion *b, Quaternion *result)
-{
- result->w = (a->w * b->w) - (a->x * b->x) - (a->y * b->y) - (a->z * b->z);
- result->x = (a->w * b->x) + (a->x * b->w) + (a->y * b->z) - (a->z * b->y);
- result->y = (a->w * b->y) + (a->y * b->w) + (a->z * b->x) - (a->x * b->z);
- result->z = (a->w * b->z) + (a->z * b->w) + (a->x * b->y) - (a->y * b->x);
-}
-
-
-static int
-GetQuaternionFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Quaternion *q)
-{
- Tcl_Obj **objv;
- int objc;
- double x, y, z, w;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc != 4) {
- Tcl_AppendResult(interp, "wrong number of elements in quaternion \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if ((Tcl_GetDoubleFromObj(interp, objv[0], &x) != TCL_OK) ||
- (Tcl_GetDoubleFromObj(interp, objv[1], &y) != TCL_OK) ||
- (Tcl_GetDoubleFromObj(interp, objv[2], &z) != TCL_OK) ||
- (Tcl_GetDoubleFromObj(interp, objv[3], &w) != TCL_OK)) {
- return TCL_ERROR;
- }
- q->x = x, q->y = y, q->z = z, q->w = w;
- return TCL_OK;
-}
-
-static int
-ArcBallCombineOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- Quaternion q1, q2, r;
-
- if (GetQuaternionFromObj(interp, objv[2], &q1) != TCL_OK) {
- return TCL_ERROR;
- }
- if (GetQuaternionFromObj(interp, objv[3], &q2) != TCL_OK) {
- return TCL_ERROR;
- }
- CombineRotations(&q2, &q1, &r);
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(r.x));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(r.y));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(r.w));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(r.z));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-static int
-ArcBallRotateOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- ArcBall *arcPtr;
- Tcl_Obj *listObjPtr;
- Quaternion q;
- double x1, y1, x2, y2;
- int w, h;
-
- if ((Tcl_GetIntFromObj(interp, objv[2], &w) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &h) != TCL_OK)) {
- return TCL_ERROR;
- }
- if ((Tcl_GetDoubleFromObj(interp, objv[4], &x1) != TCL_OK) ||
- (Tcl_GetDoubleFromObj(interp, objv[5], &y1) != TCL_OK) ||
- (Tcl_GetDoubleFromObj(interp, objv[6], &x2) != TCL_OK) ||
- (Tcl_GetDoubleFromObj(interp, objv[7], &y2) != TCL_OK)) {
- return TCL_ERROR;
- }
- arcPtr = CreateArcBall((float)w, (float)h);
- ArcBallOnClick(arcPtr, x1, y1);
- ArcBallOnDrag(arcPtr, x2, y2, &q);
- DestroyArcBall(arcPtr);
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(q.x));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(q.y));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(q.w));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(q.z));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-static int
-ArcBallMatrixOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Matrix3x3f rot;
- Tcl_Obj *listObjPtr;
- Quaternion q;
-
- if (GetQuaternionFromObj(interp, objv[2], &q) != TCL_OK) {
- return TCL_ERROR;
- }
- SetRotationMatrix(&q, rot);
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(rot[0][0]));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(rot[0][1]));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(rot[0][2]));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(rot[1][0]));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(rot[1][1]));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(rot[1][2]));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(rot[2][0]));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(rot[2][1]));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(rot[2][2]));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-static Blt_OpSpec arcBallOps[] =
-{
- {"combine", 1, ArcBallCombineOp, 4, 4, "quat1 quat2",},
- {"matrix", 1, ArcBallMatrixOp, 3, 3, "quat",},
- {"rotate", 1, ArcBallRotateOp, 8, 8, "w h x1 y1 x2 y2",},
-};
-static int nArcBallOps = sizeof(arcBallOps) / sizeof(Blt_OpSpec);
-
-static int
-ArcBallCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nArcBallOps, arcBallOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (clientData, interp, objc, objv);
-}
-
-#undef Tk_GetPixmap
-Pixmap
-Blt_GetPixmap(Display *display, Drawable drawable, int w, int h, int depth,
- int lineNum, const char *fileName)
-{
- if (w <= 0) {
- fprintf(stderr, "line %d of %s: width is %d\n",
- lineNum, fileName, w);
- abort();
- }
- if (h <= 0) {
- fprintf(stderr, "line %d of %s: height is %d\n",
- lineNum, fileName, h);
- abort();
- }
- return Tk_GetPixmap(display, drawable, w, h, depth);
-}
diff --git a/blt3.0.1/src/bltGrPen.c b/blt3.0.1/src/bltGrPen.c
deleted file mode 100644
index 2e13b3a..0000000
--- a/blt3.0.1/src/bltGrPen.c
+++ /dev/null
@@ -1,765 +0,0 @@
-
-/*
- * bltGrPen.c --
- *
- * This module implements pens for the BLT graph widget.
- *
- * Copyright 1996-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltGraph.h"
-#include "bltOp.h"
-#include <X11/Xutil.h>
-
-typedef int (GraphPenProc)(Tcl_Interp *interp, Graph *graphPtr, int objc,
- Tcl_Obj *const *objv);
-
-static Blt_OptionFreeProc FreeColor;
-static Blt_OptionParseProc ObjToColor;
-static Blt_OptionPrintProc ColorToObj;
-Blt_CustomOption bltColorOption = {
- ObjToColor, ColorToObj, FreeColor, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreePen;
-static Blt_OptionParseProc ObjToPen;
-static Blt_OptionPrintProc PenToObj;
-Blt_CustomOption bltBarPenOption = {
- ObjToPen, PenToObj, FreePen, (ClientData)CID_ELEM_BAR
-};
-Blt_CustomOption bltLinePenOption = {
- ObjToPen, PenToObj, FreePen, (ClientData)CID_ELEM_LINE
-};
-
-/*ARGSUSED*/
-static void
-FreeColor(
- ClientData clientData, /* Not used. */
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- XColor *colorPtr = *(XColor **)(widgRec + offset);
-
- if ((colorPtr != NULL) && (colorPtr != COLOR_DEFAULT)) {
- Tk_FreeColor(colorPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
-
- * ObjToColor --
- *
- * Convert the string representation of a color into a XColor pointer.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToColor(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing color */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- XColor **colorPtrPtr = (XColor **)(widgRec + offset);
- XColor *colorPtr;
- const char *string;
- char c;
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
-
- if ((c == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- if ((*colorPtrPtr != NULL) && (*colorPtrPtr != COLOR_DEFAULT)) {
- Tk_FreeColor(*colorPtrPtr);
- }
- *colorPtrPtr = NULL;
- return TCL_OK;
- }
- if ((c == 'd') && (strncmp(string, "defcolor", length) == 0)) {
- if ((*colorPtrPtr != NULL) && (*colorPtrPtr != COLOR_DEFAULT)) {
- Tk_FreeColor(*colorPtrPtr);
- }
- *colorPtrPtr = COLOR_DEFAULT;
- return TCL_OK;
- }
- colorPtr = Tk_AllocColorFromObj(interp, tkwin, objPtr);
- if (colorPtr == NULL) {
- return TCL_ERROR;
- }
- if ((*colorPtrPtr != NULL) && (*colorPtrPtr != COLOR_DEFAULT)) {
- Tk_FreeColor(*colorPtrPtr);
- }
- *colorPtrPtr = colorPtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColorToObj --
- *
- * Convert the color value into a string.
- *
- * Results:
- * The string representing the symbol color is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ColorToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- XColor *colorPtr = *(XColor **)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (colorPtr == NULL) {
- objPtr = Tcl_NewStringObj("", -1);
- } else if (colorPtr == COLOR_DEFAULT) {
- objPtr = Tcl_NewStringObj("defcolor", -1);
- } else {
- objPtr = Tcl_NewStringObj(Tk_NameOfColor(colorPtr), -1);
- }
- return objPtr;
-}
-
-/*ARGSUSED*/
-static void
-FreePen(
- ClientData clientData, /* Not used. */
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Pen **penPtrPtr = (Pen **)(widgRec + offset);
-
- if (*penPtrPtr != NULL) {
- Blt_FreePen(*penPtrPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToPen --
- *
- * Convert the color value into a string.
- *
- * Results:
- * The string representing the symbol color is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToPen(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing pen */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Pen **penPtrPtr = (Pen **)(widgRec + offset);
- const char *string;
-
- string = Tcl_GetString(objPtr);
- if ((string[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- Blt_FreePen(*penPtrPtr);
- *penPtrPtr = NULL;
- } else {
- Pen *penPtr;
- Graph *graphPtr;
- ClassId classId = (ClassId)clientData; /* Element type. */
-
- graphPtr = Blt_GetGraphFromWindowData(tkwin);
- assert(graphPtr);
-
- if (classId == CID_NONE) {
- classId = graphPtr->classId;
- }
- if (Blt_GetPenFromObj(interp, graphPtr, objPtr, classId, &penPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_FreePen(*penPtrPtr);
- *penPtrPtr = penPtr;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PenToObj --
- *
- * Parse the name of the name.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-PenToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Pen *penPtr = *(Pen **)(widgRec + offset);
-
- if (penPtr == NULL) {
- return Tcl_NewStringObj("", -1);
- } else {
- return Tcl_NewStringObj(penPtr->name, -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetPenFromObj --
- *
- * Find and return the pen style from a given name.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetPenFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr,
- Pen **penPtrPtr)
-{
- Blt_HashEntry *hPtr;
- Pen *penPtr;
- const char *name;
-
- penPtr = NULL;
- name = Tcl_GetString(objPtr);
- hPtr = Blt_FindHashEntry(&graphPtr->penTable, name);
- if (hPtr != NULL) {
- penPtr = Blt_GetHashValue(hPtr);
- if (penPtr->flags & DELETE_PENDING) {
- penPtr = NULL;
- }
- }
- if (penPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find pen \"", name, "\" in \"",
- Tk_PathName(graphPtr->tkwin), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- *penPtrPtr = penPtr;
- return TCL_OK;
-}
-
-static void
-DestroyPen(Pen *penPtr)
-{
- Graph *graphPtr = penPtr->graphPtr;
-
- Blt_FreeOptions(penPtr->configSpecs, (char *)penPtr, graphPtr->display, 0);
- (*penPtr->destroyProc) (graphPtr, penPtr);
- if ((penPtr->name != NULL) && (penPtr->name[0] != '\0')) {
- Blt_Free(penPtr->name);
- }
- if (penPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&graphPtr->penTable, penPtr->hashPtr);
- }
- Blt_Free(penPtr);
-}
-
-void
-Blt_FreePen(Pen *penPtr)
-{
- if (penPtr != NULL) {
- penPtr->refCount--;
- if ((penPtr->refCount == 0) && (penPtr->flags & DELETE_PENDING)) {
- DestroyPen(penPtr);
- }
- }
-}
-
-Pen *
-Blt_CreatePen(Graph *graphPtr, const char *penName, ClassId classId,
- int objc, Tcl_Obj *const *objv)
-{
- Pen *penPtr;
- Blt_HashEntry *hPtr;
- unsigned int configFlags;
- int isNew;
- int i;
-
- /*
- * Scan the option list for a "-type" entry. This will indicate what type
- * of pen we are creating. Otherwise we'll default to the suggested type.
- * Last -type option wins.
- */
- for (i = 0; i < objc; i += 2) {
- char *string;
- int length;
-
- string = Tcl_GetStringFromObj(objv[i], &length);
- if ((length > 2) && (strncmp(string, "-type", length) == 0)) {
- char *arg;
-
- arg = Tcl_GetString(objv[i + 1]);
- if (strcmp(arg, "bar") == 0) {
- classId = CID_ELEM_BAR;
- } else if (strcmp(arg, "line") == 0) {
- classId = CID_ELEM_LINE;
- } else if (strcmp(arg, "strip") == 0) {
- classId = CID_ELEM_LINE;
- } else if (strcmp(arg, "contour") == 0) {
- classId = CID_ELEM_CONTOUR;
- } else {
- Tcl_AppendResult(graphPtr->interp, "unknown pen type \"",
- arg, "\" specified", (char *)NULL);
- return NULL;
- }
- }
- }
- if (classId == CID_ELEM_STRIP) {
- classId = CID_ELEM_LINE;
- }
- hPtr = Blt_CreateHashEntry(&graphPtr->penTable, penName, &isNew);
- if (!isNew) {
- penPtr = Blt_GetHashValue(hPtr);
- if ((penPtr->flags & DELETE_PENDING) == 0) {
- Tcl_AppendResult(graphPtr->interp, "pen \"", penName,
- "\" already exists in \"", Tk_PathName(graphPtr->tkwin), "\"",
- (char *)NULL);
- return NULL;
- }
- if (penPtr->classId != classId) {
- Tcl_AppendResult(graphPtr->interp, "pen \"", penName,
- "\" in-use: can't change pen type from \"",
- Blt_GraphClassName(penPtr->classId), "\" to \"",
- Blt_GraphClassName(classId), "\"", (char *)NULL);
- return NULL;
- }
- penPtr->flags &= ~DELETE_PENDING; /* Undelete the pen. */
- } else {
- if (classId == CID_ELEM_BAR) {
- penPtr = Blt_BarPen(penName);
- } else {
- penPtr = Blt_LinePen(penName);
- }
- penPtr->classId = classId;
- penPtr->hashPtr = hPtr;
- penPtr->graphPtr = graphPtr;
- Blt_SetHashValue(hPtr, penPtr);
- }
- configFlags = (penPtr->flags & (ACTIVE_PEN | NORMAL_PEN));
- if (Blt_ConfigureComponentFromObj(graphPtr->interp, graphPtr->tkwin,
- penPtr->name, "Pen", penPtr->configSpecs, objc, objv,
- (char *)penPtr, configFlags) != TCL_OK) {
- if (isNew) {
- DestroyPen(penPtr);
- }
- return NULL;
- }
- (*penPtr->configProc) (graphPtr, penPtr);
- return penPtr;
-}
-
-int
-Blt_GetPenFromObj(Tcl_Interp *interp, Graph *graphPtr, Tcl_Obj *objPtr,
- ClassId classId, Pen **penPtrPtr)
-{
- Blt_HashEntry *hPtr;
- Pen *penPtr;
- const char *name;
-
- penPtr = NULL;
- name = Tcl_GetString(objPtr);
- hPtr = Blt_FindHashEntry(&graphPtr->penTable, name);
- if (hPtr != NULL) {
- penPtr = Blt_GetHashValue(hPtr);
- if (penPtr->flags & DELETE_PENDING) {
- penPtr = NULL;
- }
- }
- if (penPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find pen \"", name, "\" in \"",
- Tk_PathName(graphPtr->tkwin), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (classId == CID_ELEM_STRIP) {
- classId = CID_ELEM_LINE;
- }
- if (penPtr->classId != classId) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "pen \"", name,
- "\" is the wrong type (is \"",
- Blt_GraphClassName(penPtr->classId), "\"", ", wanted \"",
- Blt_GraphClassName(classId), "\")", (char *)NULL);
- }
- return TCL_ERROR;
- }
- penPtr->refCount++;
- *penPtrPtr = penPtr;
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DestroyPens --
- *
- * Release memory and resources allocated for the style.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the pen style is freed up.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DestroyPens(Graph *graphPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->penTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Pen *penPtr;
-
- penPtr = Blt_GetHashValue(hPtr);
- penPtr->hashPtr = NULL;
- DestroyPen(penPtr);
- }
- Blt_DeleteHashTable(&graphPtr->penTable);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Queries axis attributes (font, line width, label, etc).
- *
- * Results:
- * A standard TCL result. If querying configuration values,
- * interp->result will contain the results.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-CgetOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv)
-{
- Pen *penPtr;
- unsigned int configFlags;
-
- if (GetPenFromObj(interp, graphPtr, objv[3], &penPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- configFlags = (penPtr->flags & (ACTIVE_PEN | NORMAL_PEN));
- return Blt_ConfigureValueFromObj(interp, graphPtr->tkwin,
- penPtr->configSpecs, (char *)penPtr, objv[4], configFlags);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Queries or resets pen attributes (font, line width, color, etc).
- *
- * Results:
- * A standard TCL result. If querying configuration values,
- * interp->result will contain the results.
- *
- * Side Effects:
- * Pen resources are possibly allocated (GC, font).
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv)
-{
- Pen *penPtr;
- int nNames, nOpts;
- int redraw;
- Tcl_Obj *const *options;
- int i;
-
- /* Figure out where the option value pairs begin */
- objc -= 3;
- objv += 3;
- for (i = 0; i < objc; i++) {
- char *string;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] == '-') {
- break;
- }
- if (GetPenFromObj(interp, graphPtr, objv[i], &penPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- nNames = i; /* Number of pen names specified */
- nOpts = objc - i; /* Number of options specified */
- options = objv + i; /* Start of options in objv */
-
- redraw = 0;
- for (i = 0; i < nNames; i++) {
- int flags;
-
- if (GetPenFromObj(interp, graphPtr, objv[i], &penPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- flags = BLT_CONFIG_OBJV_ONLY | (penPtr->flags&(ACTIVE_PEN|NORMAL_PEN));
- if (nOpts == 0) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin,
- penPtr->configSpecs, (char *)penPtr, (Tcl_Obj *)NULL, flags);
- } else if (nOpts == 1) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin,
- penPtr->configSpecs, (char *)penPtr, options[0], flags);
- }
- if (Blt_ConfigureWidgetFromObj(interp, graphPtr->tkwin,
- penPtr->configSpecs, nOpts, options, (char *)penPtr, flags)
- != TCL_OK) {
- break;
- }
- (*penPtr->configProc) (graphPtr, penPtr);
- if (penPtr->refCount > 0) {
- redraw++;
- }
- }
- if (redraw) {
- graphPtr->flags |= CACHE_DIRTY;
- Blt_EventuallyRedrawGraph(graphPtr);
- }
- if (i < nNames) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateOp --
- *
- * Adds a new penstyle to the graph.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv)
-{
- Pen *penPtr;
-
- penPtr = Blt_CreatePen(graphPtr, Tcl_GetString(objv[3]), graphPtr->classId,
- objc - 4, objv + 4);
- if (penPtr == NULL) {
- return TCL_ERROR;
- }
- Tcl_SetObjResult(interp, objv[3]);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Delete the given pen.
- *
- * Results:
- * Always returns TCL_OK. The interp->result field is a list of the
- * graph axis limits.
- *
- *---------------------------------------------------------------------------
- */
-
-/*ARGSUSED*/
-static int
-DeleteOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- Pen *penPtr;
-
- if (GetPenFromObj(interp, graphPtr, objv[i], &penPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (penPtr->flags & DELETE_PENDING) {
- Tcl_AppendResult(interp, "can't find pen \"",
- Tcl_GetString(objv[i]), "\" in \"",
- Tk_PathName(graphPtr->tkwin), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- penPtr->flags |= DELETE_PENDING;
- if (penPtr->refCount == 0) {
- DestroyPen(penPtr);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * Return a list of the names of all the axes.
- *
- * Results:
- * Returns a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NamesOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->penTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Pen *penPtr;
-
- penPtr = Blt_GetHashValue(hPtr);
- if ((penPtr->flags & DELETE_PENDING) == 0) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(penPtr->name, -1));
- }
- }
- } else {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&graphPtr->penTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Pen *penPtr;
-
- penPtr = Blt_GetHashValue(hPtr);
- if ((penPtr->flags & DELETE_PENDING) == 0) {
- int i;
-
- for (i = 3; i < objc; i++) {
- char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- if (Tcl_StringMatch(penPtr->name, pattern)) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(penPtr->name, -1));
- break;
- }
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TypeOp --
- *
- * Return the type of pen.
- *
- * Results:
- * Returns a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TypeOp(Tcl_Interp *interp, Graph *graphPtr, int objc, Tcl_Obj *const *objv)
-{
- Pen *penPtr;
-
- if (GetPenFromObj(interp, graphPtr, objv[3], &penPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- Blt_GraphClassName(penPtr->classId), -1);
- return TCL_OK;
-}
-
-static Blt_OpSpec penOps[] =
-{
- {"cget", 2, CgetOp, 5, 5, "penName option",},
- {"configure", 2, ConfigureOp, 4, 0,
- "penName ?penName?... ?option value?...",},
- {"create", 2, CreateOp, 4, 0, "penName ?option value?...",},
- {"delete", 2, DeleteOp, 3, 0, "?penName?...",},
- {"names", 1, NamesOp, 3, 0, "?pattern?...",},
- {"type", 1, TypeOp, 4, 4, "penName",},
-};
-static int nPenOps = sizeof(penOps) / sizeof(Blt_OpSpec);
-
-int
-Blt_PenOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- GraphPenProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nPenOps, penOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (interp, graphPtr, objc, objv);
-}
diff --git a/blt3.0.1/src/bltGrPs.c b/blt3.0.1/src/bltGrPs.c
deleted file mode 100644
index f0cfc99..0000000
--- a/blt3.0.1/src/bltGrPs.c
+++ /dev/null
@@ -1,731 +0,0 @@
-
-/*
- * bltGrPs.c --
- *
- * This module implements the "postscript" operation for BLT graph widget.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * PostScript routines to print a graph
- *
- *---------------------------------------------------------------------------
- */
-#include "bltGraph.h"
-#include "bltOp.h"
-#include "bltPsInt.h"
-#include "bltPicture.h"
-#include <X11/Xutil.h>
-#include "tkDisplay.h"
-#include <stdarg.h>
-
-#define MM_INCH 25.4
-#define PICA_INCH 72.0
-
-typedef int (GraphPsProc)(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-static Blt_OptionParseProc ObjToPicaProc;
-static Blt_OptionPrintProc PicaToObjProc;
-static Blt_CustomOption picaOption =
-{
- ObjToPicaProc, PicaToObjProc, NULL, (ClientData)0,
-};
-
-static Blt_OptionParseProc ObjToPad;
-static Blt_OptionPrintProc PadToObj;
-static Blt_CustomOption padOption =
-{
- ObjToPad, PadToObj, NULL, (ClientData)0,
-};
-
-#define DEF_PS_CENTER "yes"
-#define DEF_PS_COLOR_MAP (char *)NULL
-#define DEF_PS_GREYSCALE "no"
-#define DEF_PS_DECORATIONS "no"
-#define DEF_PS_FONT_MAP (char *)NULL
-#define DEF_PS_FOOTER "no"
-#define DEF_PS_LEVEL "2"
-#define DEF_PS_HEIGHT "0"
-#define DEF_PS_LANDSCAPE "no"
-#define DEF_PS_PADX "1.0i"
-#define DEF_PS_PADY "1.0i"
-#define DEF_PS_PAPERHEIGHT "11.0i"
-#define DEF_PS_PAPERWIDTH "8.5i"
-#define DEF_PS_WIDTH "0"
-#define DEF_PS_COMMENTS ""
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BITMASK, "-center", "center", "Center", DEF_PS_CENTER,
- Blt_Offset(PageSetup, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)PS_CENTER},
- {BLT_CONFIG_STRING, "-colormap", "colorMap", "ColorMap",
- DEF_PS_COLOR_MAP, Blt_Offset(PageSetup, colorVarName),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_LIST, "-comments", "comments", "Comments",
- DEF_PS_COMMENTS, Blt_Offset(PageSetup, comments), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMASK, "-decorations", "decorations", "Decorations",
- DEF_PS_DECORATIONS, Blt_Offset(PageSetup, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)PS_DECORATIONS},
- {BLT_CONFIG_STRING, "-fontmap", "fontMap", "FontMap",
- DEF_PS_FONT_MAP, Blt_Offset(PageSetup, fontVarName),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMASK, "-footer", "footer", "Footer", DEF_PS_FOOTER,
- Blt_Offset(PageSetup, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)PS_FOOTER},
- {BLT_CONFIG_BITMASK, "-greyscale", "greyscale", "Greyscale",
- DEF_PS_GREYSCALE, Blt_Offset(PageSetup, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)PS_GREYSCALE},
- {BLT_CONFIG_CUSTOM, "-height", "height", "Height", DEF_PS_HEIGHT,
- Blt_Offset(PageSetup, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT,
- &picaOption},
- {BLT_CONFIG_BITMASK, "-landscape", "landscape", "Landscape",
- DEF_PS_LANDSCAPE, Blt_Offset(PageSetup, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)PS_LANDSCAPE},
- {BLT_CONFIG_INT_POS, "-level", "level", "Level", DEF_PS_LEVEL,
- Blt_Offset(PageSetup, level), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-padx", "padX", "PadX", DEF_PS_PADX,
- Blt_Offset(PageSetup, xPad), 0, &padOption},
- {BLT_CONFIG_CUSTOM, "-pady", "padY", "PadY", DEF_PS_PADY,
- Blt_Offset(PageSetup, yPad), 0, &padOption},
- {BLT_CONFIG_CUSTOM, "-paperheight", "paperHeight", "PaperHeight",
- DEF_PS_PAPERHEIGHT, Blt_Offset(PageSetup, reqPaperHeight), 0,
- &picaOption},
- {BLT_CONFIG_CUSTOM, "-paperwidth", "paperWidth", "PaperWidth",
- DEF_PS_PAPERWIDTH, Blt_Offset(PageSetup, reqPaperWidth), 0,
- &picaOption},
- {BLT_CONFIG_CUSTOM, "-width", "width", "Width", DEF_PS_WIDTH,
- Blt_Offset(PageSetup, reqWidth), BLT_CONFIG_DONT_SET_DEFAULT,
- &picaOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToPicaProc --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToPicaProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* New value. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- int *picaPtr = (int *)(widgRec + offset);
-
- return Blt_Ps_GetPicaFromObj(interp, objPtr, picaPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PicaToObj --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-PicaToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* PostScript structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- int pica = *(int *)(widgRec + offset);
-
- return Tcl_NewIntObj(pica);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToPad --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToPad(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* New value. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_Pad *padPtr = (Blt_Pad *) (widgRec + offset);
-
- return Blt_Ps_GetPadFromObj(interp, objPtr, padPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PadToObj --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-PadToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* PostScript structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_Pad *padPtr = (Blt_Pad *)(widgRec + offset);
- Tcl_Obj *objPtr, *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- objPtr = Tcl_NewIntObj(padPtr->side1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewIntObj(padPtr->side2);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- return listObjPtr;
-}
-
-static void
-AddComments(Blt_Ps ps, const char **comments)
-{
- const char **p;
-
- for (p = comments; *p != NULL; p += 2) {
- if (*(p+1) == NULL) {
- break;
- }
- Blt_Ps_Format(ps, "%% %s: %s\n", *p, *(p+1));
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PostScriptPreamble
- *
- * The PostScript preamble calculates the needed translation and scaling
- * to make X11 coordinates compatible with PostScript.
- *
- *---------------------------------------------------------------------------
- */
-
-#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif /* HAVE_SYS_TIME_H */
-#endif /* TIME_WITH_SYS_TIME */
-
-
-static int
-PostScriptPreamble(Graph *graphPtr, const char *fileName, Blt_Ps ps)
-{
- PageSetup *setupPtr = graphPtr->pageSetup;
- time_t ticks;
- char date[200]; /* Holds the date string from ctime() */
- const char *version;
- char *newline;
-
- if (fileName == NULL) {
- fileName = Tk_PathName(graphPtr->tkwin);
- }
- Blt_Ps_Append(ps, "%!PS-Adobe-3.0 EPSF-3.0\n");
-
- /*
- * The "BoundingBox" comment is required for EPS files. The box
- * coordinates are integers, so we need round away from the center of the
- * box.
- */
- Blt_Ps_Format(ps, "%%%%BoundingBox: %d %d %d %d\n",
- setupPtr->left, setupPtr->paperHeight - setupPtr->top,
- setupPtr->right, setupPtr->paperHeight - setupPtr->bottom);
-
- Blt_Ps_Append(ps, "%%Pages: 0\n");
-
- version = Tcl_GetVar(graphPtr->interp, "blt_version", TCL_GLOBAL_ONLY);
- if (version == NULL) {
- version = "???";
- }
- Blt_Ps_Format(ps, "%%%%Creator: (BLT %s %s)\n", version,
- Tk_Class(graphPtr->tkwin));
-
- ticks = time((time_t *) NULL);
- strcpy(date, ctime(&ticks));
- newline = date + strlen(date) - 1;
- if (*newline == '\n') {
- *newline = '\0';
- }
- Blt_Ps_Format(ps, "%%%%CreationDate: (%s)\n", date);
- Blt_Ps_Format(ps, "%%%%Title: (%s)\n", fileName);
- Blt_Ps_Append(ps, "%%DocumentData: Clean7Bit\n");
- if (setupPtr->flags & PS_LANDSCAPE) {
- Blt_Ps_Append(ps, "%%Orientation: Landscape\n");
- } else {
- Blt_Ps_Append(ps, "%%Orientation: Portrait\n");
- }
- Blt_Ps_Append(ps, "%%DocumentNeededResources: font Helvetica Courier\n");
- AddComments(ps, setupPtr->comments);
- Blt_Ps_Append(ps, "%%EndComments\n\n");
- if (Blt_Ps_IncludeFile(graphPtr->interp, ps, "bltGraph.pro") != TCL_OK) {
- return TCL_ERROR;
- }
- if (setupPtr->flags & PS_FOOTER) {
- const char *who;
-
- who = getenv("LOGNAME");
- if (who == NULL) {
- who = "???";
- }
- Blt_Ps_VarAppend(ps,
- "8 /Helvetica SetFont\n",
- "10 30 moveto\n",
- "(Date: ", date, ") show\n",
- "10 20 moveto\n",
- "(File: ", fileName, ") show\n",
- "10 10 moveto\n",
- "(Created by: ", who, "@", Tcl_GetHostName(), ") show\n",
- "0 0 moveto\n",
- (char *)NULL);
- }
- /*
- * Set the conversion from PostScript to X11 coordinates. Scale pica to
- * pixels and flip the y-axis (the origin is the upperleft corner).
- */
- Blt_Ps_VarAppend(ps,
- "% Transform coordinate system to use X11 coordinates\n\n",
- "% 1. Flip y-axis over by reversing the scale,\n",
- "% 2. Translate the origin to the other side of the page,\n",
- "% making the origin the upper left corner\n", (char *)NULL);
- Blt_Ps_Format(ps, "1 -1 scale\n");
- /* Papersize is in pixels. Translate the new origin *after* changing the
- * scale. */
- Blt_Ps_Format(ps, "0 %d translate\n\n", -setupPtr->paperHeight);
- Blt_Ps_VarAppend(ps, "% User defined page layout\n\n",
- "% Set color level\n", (char *)NULL);
- Blt_Ps_Format(ps, "%% Set origin\n%d %d translate\n\n",
- setupPtr->left, setupPtr->bottom);
- if (setupPtr->flags & PS_LANDSCAPE) {
- Blt_Ps_Format(ps,
- "%% Landscape orientation\n0 %g translate\n-90 rotate\n",
- ((double)graphPtr->width * setupPtr->scale));
- }
-#ifdef notdef
- if (setupPtr->scale != 1.0f) {
- Blt_Ps_Append(ps, "\n% Setting graph scale factor\n");
- Blt_Ps_Format(ps, " %g %g scale\n", setupPtr->scale, setupPtr->scale);
- }
-#endif
- Blt_Ps_Append(ps, "\n%%EndSetup\n\n");
- return TCL_OK;
-}
-
-
-static void
-MarginsToPostScript(Graph *graphPtr, Blt_Ps ps)
-{
- PageSetup *setupPtr = graphPtr->pageSetup;
- XRectangle margin[4];
-
- margin[0].x = margin[0].y = margin[3].x = margin[1].x = 0;
- margin[0].width = margin[3].width = graphPtr->width;
- margin[0].height = graphPtr->top;
- margin[3].y = graphPtr->bottom;
- margin[3].height = graphPtr->height - graphPtr->bottom;
- margin[2].y = margin[1].y = graphPtr->top;
- margin[1].width = graphPtr->left;
- margin[2].height = margin[1].height = graphPtr->bottom - graphPtr->top;
- margin[2].x = graphPtr->right;
- margin[2].width = graphPtr->width - graphPtr->right;
-
- /* Clear the surrounding margins and clip the plotting surface */
- if (setupPtr->flags & PS_DECORATIONS) {
- Blt_Ps_XSetBackground(ps,Blt_BackgroundBorderColor(graphPtr->normalBg));
- } else {
- Blt_Ps_SetClearBackground(ps);
- }
- Blt_Ps_Append(ps, "% Margins\n");
- Blt_Ps_XFillRectangles(ps, margin, 4);
-
- Blt_Ps_Append(ps, "% Interior 3D border\n");
- /* Interior 3D border */
- if (graphPtr->plotBW > 0) {
- Tk_3DBorder border;
- int x, y, w, h;
-
- x = graphPtr->left - graphPtr->plotBW;
- y = graphPtr->top - graphPtr->plotBW;
- w = (graphPtr->right - graphPtr->left) + (2*graphPtr->plotBW);
- h = (graphPtr->bottom - graphPtr->top) + (2*graphPtr->plotBW);
- border = Blt_BackgroundBorder(graphPtr->normalBg);
- Blt_Ps_Draw3DRectangle(ps, border, (double)x, (double)y, w, h,
- graphPtr->plotBW, graphPtr->plotRelief);
- }
- if (Blt_Legend_Site(graphPtr) & LEGEND_MARGIN_MASK) {
- /*
- * Print the legend if we're using a site which lies in one of the
- * margins (left, right, top, or bottom) of the graph.
- */
- Blt_LegendToPostScript(graphPtr, ps);
- }
- if (graphPtr->title != NULL) {
- Blt_Ps_Append(ps, "% Graph title\n");
- Blt_Ps_DrawText(ps, graphPtr->title, &graphPtr->titleTextStyle,
- (double)graphPtr->titleX, (double)graphPtr->titleY);
- }
- Blt_AxesToPostScript(graphPtr, ps);
-}
-
-
-static int
-GraphToPostScript(Graph *graphPtr, const char *ident, Blt_Ps ps)
-{
- int x, y, w, h;
- int result;
- PageSetup *setupPtr = graphPtr->pageSetup;
-
- /*
- * We need to know how big a graph to print. If the graph hasn't been drawn
- * yet, the width and height will be 1. Instead use the requested size of
- * the widget. The user can still override this with the -width and -height
- * postscript options.
- */
- if (setupPtr->reqWidth > 0) {
- graphPtr->width = setupPtr->reqWidth;
- } else if (graphPtr->width < 2) {
- graphPtr->width = Tk_ReqWidth(graphPtr->tkwin);
- }
- if (setupPtr->reqHeight > 0) {
- graphPtr->height = setupPtr->reqHeight;
- } else if (graphPtr->height < 2) {
- graphPtr->height = Tk_ReqHeight(graphPtr->tkwin);
- }
- Blt_Ps_ComputeBoundingBox(setupPtr, graphPtr->width, graphPtr->height);
- graphPtr->flags |= LAYOUT_NEEDED | RESET_WORLD;
-
- /* Turn on PostScript measurements when computing the graph's layout. */
- Blt_Ps_SetPrinting(ps, TRUE);
- Blt_ReconfigureGraph(graphPtr);
- Blt_MapGraph(graphPtr);
-
- result = PostScriptPreamble(graphPtr, ident, ps);
- if (result != TCL_OK) {
- goto error;
- }
- /* Determine rectangle of the plotting area for the graph window */
- x = graphPtr->left - graphPtr->plotBW;
- y = graphPtr->top - graphPtr->plotBW;
-
- w = (graphPtr->right - graphPtr->left + 1) + (2*graphPtr->plotBW);
- h = (graphPtr->bottom - graphPtr->top + 1) + (2*graphPtr->plotBW);
-
- Blt_Ps_XSetFont(ps, Blt_Ts_GetFont(graphPtr->titleTextStyle));
- if (graphPtr->pageSetup->flags & PS_DECORATIONS) {
- Blt_Ps_XSetBackground(ps, Blt_BackgroundBorderColor(graphPtr->plotBg));
- } else {
- Blt_Ps_SetClearBackground(ps);
- }
- Blt_Ps_XFillRectangle(ps, x, y, w, h);
- Blt_Ps_Rectangle(ps, x, y, w, h);
- Blt_Ps_Append(ps, "gsave clip\n\n");
- /* Draw the grid, elements, and markers in the plotting area. */
- Blt_GridsToPostScript(graphPtr, ps);
- Blt_MarkersToPostScript(graphPtr, ps, TRUE);
- if ((Blt_Legend_Site(graphPtr) & LEGEND_PLOTAREA_MASK) &&
- (!Blt_Legend_IsRaised(graphPtr))) {
- /* Print legend underneath elements and markers */
- Blt_LegendToPostScript(graphPtr, ps);
- }
- Blt_AxisLimitsToPostScript(graphPtr, ps);
- Blt_ElementsToPostScript(graphPtr, ps);
- if ((Blt_Legend_Site(graphPtr) & LEGEND_PLOTAREA_MASK) &&
- (Blt_Legend_IsRaised(graphPtr))) {
- /* Print legend above elements (but not markers) */
- Blt_LegendToPostScript(graphPtr, ps);
- }
- Blt_MarkersToPostScript(graphPtr, ps, FALSE);
- Blt_ActiveElementsToPostScript(graphPtr, ps);
- Blt_Ps_VarAppend(ps, "\n",
- "% Unset clipping\n",
- "grestore\n\n", (char *)NULL);
- MarginsToPostScript(graphPtr, ps);
- Blt_Ps_VarAppend(ps,
- "showpage\n",
- "%Trailer\n",
- "grestore\n",
- "end\n",
- "%EOF\n", (char *)NULL);
- error:
- /* Reset height and width of graph window */
- graphPtr->width = Tk_Width(graphPtr->tkwin);
- graphPtr->height = Tk_Height(graphPtr->tkwin);
- graphPtr->flags |= MAP_WORLD;
- Blt_Ps_SetPrinting(ps, FALSE);
- Blt_ReconfigureGraph(graphPtr);
- Blt_MapGraph(graphPtr);
- /*
- * Redraw the graph in order to re-calculate the layout as soon as
- * possible. This is in the case the crosshairs are active.
- */
- Blt_EventuallyRedrawGraph(graphPtr);
- return result;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CgetOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- PageSetup *setupPtr = graphPtr->pageSetup;
-
- if (Blt_ConfigureValueFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)setupPtr, objv[3], 0) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * This procedure is invoked to print the graph in a file.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * A new PostScript file is created.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int flags = BLT_CONFIG_OBJV_ONLY;
- PageSetup *setupPtr = graphPtr->pageSetup;
-
- if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)setupPtr, (Tcl_Obj *)NULL, flags);
- } else if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)setupPtr, objv[3], flags);
- }
- if (Blt_ConfigureWidgetFromObj(interp, graphPtr->tkwin, configSpecs,
- objc - 3, objv + 3, (char *)setupPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OutputOp --
- *
- * This procedure is invoked to print the graph in a file.
- *
- * Results:
- * Standard TCL result. TCL_OK if plot was successfully printed,
- * TCL_ERROR otherwise.
- *
- * Side effects:
- * A new PostScript file is created.
- *
- *---------------------------------------------------------------------------
- */
-static int
-OutputOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- const char *buffer;
- PostScript *psPtr;
- Tcl_Channel channel;
- const char *fileName; /* Name of file to write PostScript
- * output If NULL, output is returned
- * via interp->result. */
- int length;
-
- fileName = NULL; /* Used to identify the output sink. */
- channel = NULL;
- if (objc > 3) {
- fileName = Tcl_GetString(objv[3]);
- if (fileName[0] != '-') {
- objv++, objc--; /* First argument is the file name. */
- channel = Tcl_OpenFileChannel(interp, fileName, "w", 0666);
- if (channel == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_SetChannelOption(interp, channel, "-translation", "binary")
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
-
- psPtr = Blt_Ps_Create(graphPtr->interp, graphPtr->pageSetup);
- if (Blt_ConfigureWidgetFromObj(interp, graphPtr->tkwin, configSpecs,
- objc - 3, objv + 3, (char *)graphPtr->pageSetup, BLT_CONFIG_OBJV_ONLY)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (GraphToPostScript(graphPtr, fileName, psPtr) != TCL_OK) {
- goto error;
- }
- buffer = Blt_Ps_GetValue(psPtr, &length);
- if (channel != NULL) {
- int nBytes;
- /*
- * If a file name was given, write the results to that file
- */
- nBytes = Tcl_Write(channel, buffer, length);
- if (nBytes < 0) {
- Tcl_AppendResult(interp, "error writing file \"", fileName, "\": ",
- Tcl_PosixError(interp), (char *)NULL);
- goto error;
- }
- Tcl_Close(interp, channel);
- } else {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), buffer, length);
- }
- Blt_Ps_Free(psPtr);
- return TCL_OK;
-
- error:
- if (channel != NULL) {
- Tcl_Close(interp, channel);
- }
- Blt_Ps_Free(psPtr);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_CreatePostScript --
- *
- * Creates a postscript structure.
- *
- * Results:
- * Always TCL_OK.
- *
- * Side effects:
- * A new PostScript structure is created.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_CreatePageSetup(Graph *graphPtr)
-{
- PageSetup *setupPtr;
-
- setupPtr = Blt_AssertCalloc(1, sizeof(PostScript));
- setupPtr->flags = PS_CENTER;
- setupPtr->level = 2;
- graphPtr->pageSetup = setupPtr;
-
- if (Blt_ConfigureComponentFromObj(graphPtr->interp, graphPtr->tkwin,
- "postscript", "Postscript", configSpecs, 0, (Tcl_Obj **)NULL,
- (char *)setupPtr, 0) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PostScriptOp --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec psOps[] =
-{
- {"cget", 2, CgetOp, 4, 4, "option",},
- {"configure", 2, ConfigureOp, 3, 0, "?option value?...",},
- {"output", 1, OutputOp, 3, 0, "?fileName? ?option value?...",},
-};
-
-static int nPsOps = sizeof(psOps) / sizeof(Blt_OpSpec);
-
-int
-Blt_PostScriptOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- GraphPsProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nPsOps, psOps, BLT_OP_ARG2, objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (graphPtr, interp, objc, objv);
- return result;
-}
-
-void
-Blt_DestroyPageSetup(Graph *graphPtr)
-{
- if (graphPtr->pageSetup != NULL) {
- Blt_FreeOptions(configSpecs, (char *)graphPtr->pageSetup,
- graphPtr->display, 0);
- Blt_Free(graphPtr->pageSetup);
- }
-}
diff --git a/blt3.0.1/src/bltGraph.c b/blt3.0.1/src/bltGraph.c
deleted file mode 100644
index de768f1..0000000
--- a/blt3.0.1/src/bltGraph.c
+++ /dev/null
@@ -1,2381 +0,0 @@
-
-/*
- * bltGraph.c --
- *
- * This module implements a graph widget for the BLT toolkit.
- *
- * The graph widget was created by Sani Nassif and George Howlett.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * To do:
- *
- * 2) Update manual pages.
- *
- * 3) Update comments.
- *
- * 5) Surface, contour, and flow graphs
- *
- * 7) Arrows for line markers
- *
- */
-
-#include "bltGraph.h"
-#include "bltOp.h"
-#include "bltBind.h"
-#include "bltGrElem.h"
-#include "bltGrLegd.h"
-#include "bltSwitch.h"
-#include <X11/Xutil.h>
-#include "tkDisplay.h"
-#include "bltPicture.h"
-
-typedef int (GraphCmdProc)(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-/*
- * Objects in the graph have their own class names. These class names are
- * used for the resource database and bindings. Example.
- *
- * option add *X.title "X Axis Title" widgetDefault
- * .g marker bind BitmapMarker <Enter> { ... }
- *
- * The option database trick is performed by creating a temporary window when
- * an object is initially configured. The class name of the temporary window
- * will be from the list below.
- */
-static const char *objectClassNames[] = {
- "unknown",
- "XAxis",
- "YAxis",
- "BarElement",
- "ContourElement",
- "LineElement",
- "StripElement",
- "BitmapMarker",
- "ImageMarker",
- "LineMarker",
- "PolygonMarker",
- "TextMarker",
- "WindowMarker",
-};
-
-BLT_EXTERN Blt_CustomOption bltLinePenOption;
-BLT_EXTERN Blt_CustomOption bltBarPenOption;
-BLT_EXTERN Blt_CustomOption bltBarModeOption;
-
-#define DEF_GRAPH_ASPECT_RATIO "0.0"
-#define DEF_GRAPH_BAR_BASELINE "0.0"
-#define DEF_GRAPH_BAR_MODE "normal"
-#define DEF_GRAPH_BAR_WIDTH "0.9"
-#define DEF_GRAPH_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_GRAPH_BORDERWIDTH STD_BORDERWIDTH
-#define DEF_GRAPH_BUFFER_ELEMENTS "yes"
-#define DEF_GRAPH_BUFFER_GRAPH "1"
-#define DEF_GRAPH_CURSOR "crosshair"
-#define DEF_GRAPH_FONT "{Sans Serif} 12"
-#define DEF_GRAPH_HALO "2m"
-#define DEF_GRAPH_HALO_BAR "0.1i"
-#define DEF_GRAPH_HEIGHT "4i"
-#define DEF_GRAPH_HIGHLIGHT_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_GRAPH_HIGHLIGHT_COLOR RGB_BLACK
-#define DEF_GRAPH_HIGHLIGHT_WIDTH "2"
-#define DEF_GRAPH_INVERT_XY "0"
-#define DEF_GRAPH_JUSTIFY "center"
-#define DEF_GRAPH_MARGIN "0"
-#define DEF_GRAPH_MARGIN_VAR (char *)NULL
-#define DEF_GRAPH_PLOT_BACKGROUND RGB_WHITE
-#define DEF_GRAPH_PLOT_BORDERWIDTH "1"
-#define DEF_GRAPH_PLOT_PADX "0"
-#define DEF_GRAPH_PLOT_PADY "0"
-#define DEF_GRAPH_PLOT_RELIEF "solid"
-#define DEF_GRAPH_RELIEF "flat"
-#define DEF_GRAPH_SHOW_VALUES "no"
-#define DEF_GRAPH_STACK_AXES "no"
-#define DEF_GRAPH_TAKE_FOCUS ""
-#define DEF_GRAPH_TITLE (char *)NULL
-#define DEF_GRAPH_TITLE_COLOR STD_NORMAL_FOREGROUND
-#define DEF_GRAPH_WIDTH "5i"
-#define DEF_GRAPH_DATA (char *)NULL
-#define DEF_GRAPH_DATA_COMMAND (char *)NULL
-#define DEF_GRAPH_UNMAP_HIDDEN_ELEMENTS "0"
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_FLOAT, "-aspect", "aspect", "Aspect", DEF_GRAPH_ASPECT_RATIO,
- Blt_Offset(Graph, aspect), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_GRAPH_BACKGROUND, Blt_Offset(Graph, normalBg), 0},
- {BLT_CONFIG_CUSTOM, "-barmode", "barMode", "BarMode", DEF_GRAPH_BAR_MODE,
- Blt_Offset(Graph, mode), BLT_CONFIG_DONT_SET_DEFAULT,
- &bltBarModeOption},
- {BLT_CONFIG_FLOAT, "-barwidth", "barWidth", "BarWidth",
- DEF_GRAPH_BAR_WIDTH, Blt_Offset(Graph, barWidth), 0},
- {BLT_CONFIG_FLOAT, "-baseline", "baseline", "Baseline",
- DEF_GRAPH_BAR_BASELINE, Blt_Offset(Graph, baseline), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL,0, 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-bm", "bottomMargin", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_GRAPH_BORDERWIDTH, Blt_Offset(Graph, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-bottommargin", "bottomMargin", "Margin",
- DEF_GRAPH_MARGIN, Blt_Offset(Graph, bottomMargin.reqSize), 0},
- {BLT_CONFIG_STRING, "-bottomvariable", "bottomVariable", "BottomVariable",
- DEF_GRAPH_MARGIN_VAR, Blt_Offset(Graph, bottomMargin.varName),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BOOLEAN, "-bufferelements", "bufferElements", "BufferElements",
- DEF_GRAPH_BUFFER_ELEMENTS, Blt_Offset(Graph, backingStore),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-buffergraph", "bufferGraph", "BufferGraph",
- DEF_GRAPH_BUFFER_GRAPH, Blt_Offset(Graph, doubleBuffer),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_GRAPH_CURSOR, Blt_Offset(Graph, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-data", "data", "Data",
- (char *)NULL, Blt_Offset(Graph, data), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-datacommand", "dataCommand", "DataCommand",
- (char *)NULL, Blt_Offset(Graph, dataCmd), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font",
- DEF_GRAPH_FONT, Blt_Offset(Graph, titleTextStyle.font), 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_GRAPH_TITLE_COLOR, Blt_Offset(Graph, titleTextStyle.color), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-halo", "halo", "Halo", DEF_GRAPH_HALO,
- Blt_Offset(Graph, halo), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-height", "height", "Height", DEF_GRAPH_HEIGHT,
- Blt_Offset(Graph, reqHeight), 0},
- {BLT_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_GRAPH_HIGHLIGHT_BACKGROUND,
- Blt_Offset(Graph, highlightBgColor), 0},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_GRAPH_HIGHLIGHT_COLOR, Blt_Offset(Graph, highlightColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_GRAPH_HIGHLIGHT_WIDTH,
- Blt_Offset(Graph, highlightWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-unmaphiddenelements", "unmapHiddenElements",
- "UnmapHiddenElements", DEF_GRAPH_UNMAP_HIDDEN_ELEMENTS,
- Blt_Offset(Graph, flags), ALL_GRAPHS | BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)UNMAP_HIDDEN},
- {BLT_CONFIG_BOOLEAN, "-invertxy", "invertXY", "InvertXY",
- DEF_GRAPH_INVERT_XY, Blt_Offset(Graph, inverted),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_JUSTIFY, "-justify", "justify", "Justify", DEF_GRAPH_JUSTIFY,
- Blt_Offset(Graph, titleTextStyle.justify), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-leftmargin", "leftMargin", "Margin",
- DEF_GRAPH_MARGIN, Blt_Offset(Graph, leftMargin.reqSize),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-leftvariable", "leftVariable", "LeftVariable",
- DEF_GRAPH_MARGIN_VAR, Blt_Offset(Graph, leftMargin.varName),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-lm", "leftMargin", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_BACKGROUND, "-plotbackground", "plotBackground", "Background",
- DEF_GRAPH_PLOT_BACKGROUND, Blt_Offset(Graph, plotBg), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-plotborderwidth", "plotBorderWidth",
- "PlotBorderWidth", DEF_GRAPH_PLOT_BORDERWIDTH,
- Blt_Offset(Graph, plotBW), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-plotpadx", "plotPadX", "PlotPad", DEF_GRAPH_PLOT_PADX,
- Blt_Offset(Graph, xPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-plotpady", "plotPadY", "PlotPad", DEF_GRAPH_PLOT_PADY,
- Blt_Offset(Graph, yPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-plotrelief", "plotRelief", "Relief",
- DEF_GRAPH_PLOT_RELIEF, Blt_Offset(Graph, plotRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_GRAPH_RELIEF,
- Blt_Offset(Graph, relief), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-rightmargin", "rightMargin", "Margin",
- DEF_GRAPH_MARGIN, Blt_Offset(Graph, rightMargin.reqSize),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-rightvariable", "rightVariable", "RightVariable",
- DEF_GRAPH_MARGIN_VAR, Blt_Offset(Graph, rightMargin.varName),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-rm", "rightMargin", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_BOOLEAN, "-stackaxes", "stackAxes", "StackAxes",
- DEF_GRAPH_STACK_AXES, Blt_Offset(Graph, stackAxes),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_GRAPH_TAKE_FOCUS, Blt_Offset(Graph, takeFocus), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-title", "title", "Title", DEF_GRAPH_TITLE,
- Blt_Offset(Graph, title), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-tm", "topMargin", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-topmargin", "topMargin", "Margin",
- DEF_GRAPH_MARGIN, Blt_Offset(Graph, topMargin.reqSize),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-topvariable", "topVariable", "TopVariable",
- DEF_GRAPH_MARGIN_VAR, Blt_Offset(Graph, topMargin.varName),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-width", "width", "Width", DEF_GRAPH_WIDTH,
- Blt_Offset(Graph, reqWidth), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-plotwidth", "plotWidth", "PlotWidth",
- (char *)NULL, Blt_Offset(Graph, reqPlotWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-plotheight", "plotHeight", "PlotHeight",
- (char *)NULL, Blt_Offset(Graph, reqPlotHeight),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static Blt_SwitchParseProc ObjToFormat;
-static Blt_SwitchCustom formatSwitch =
-{
- ObjToFormat, NULL, (ClientData)0,
-};
-
-typedef struct {
- const char *name;
- int width, height;
- int format;
-} SnapSwitches;
-
-enum SnapFormats { FORMAT_PICTURE, FORMAT_PHOTO, FORMAT_EMF, FORMAT_WMF };
-
-static Blt_SwitchSpec snapSwitches[] =
-{
- {BLT_SWITCH_INT_POS, "-width", "width",
- Blt_Offset(SnapSwitches, width), 0},
- {BLT_SWITCH_INT_POS, "-height", "height",
- Blt_Offset(SnapSwitches, height), 0},
- {BLT_SWITCH_CUSTOM, "-format", "format",
- Blt_Offset(SnapSwitches, format), 0, 0, &formatSwitch},
- {BLT_SWITCH_END}
-};
-
-static Tcl_IdleProc DisplayGraph;
-static Tcl_FreeProc DestroyGraph;
-static Tk_EventProc GraphEventProc;
-Tcl_ObjCmdProc Blt_GraphInstCmdProc;
-
-static Blt_BindPickProc PickEntry;
-static Tcl_ObjCmdProc StripchartCmd;
-static Tcl_ObjCmdProc BarchartCmd;
-static Tcl_ObjCmdProc GraphCmd;
-static Tcl_CmdDeleteProc GraphInstCmdDeleteProc;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_UpdateGraph --
- *
- * Tells the Tk dispatcher to call the graph display routine at the next
- * idle point. This request is made only if the window is displayed and
- * no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_UpdateGraph(ClientData clientData)
-{
- Graph *graphPtr = clientData;
-
- graphPtr->flags |= REDRAW_WORLD;
- if ((graphPtr->tkwin != NULL) && !(graphPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayGraph, graphPtr);
- graphPtr->flags |= REDRAW_PENDING;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_EventuallyRedrawGraph --
- *
- * Tells the Tk dispatcher to call the graph display routine at the next
- * idle point. This request is made only if the window is displayed and
- * no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EventuallyRedrawGraph(Graph *graphPtr)
-{
- if ((graphPtr->tkwin != NULL) && !(graphPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayGraph, graphPtr);
- graphPtr->flags |= REDRAW_PENDING;
- }
-}
-
-const char *
-Blt_GraphClassName(ClassId classId)
-{
- if ((classId >= CID_NONE) && (classId <= CID_MARKER_WINDOW)) {
- return objectClassNames[classId];
- }
- return NULL;
-}
-
-void
-Blt_GraphSetObjectClass(GraphObj *graphObjPtr, ClassId classId)
-{
- graphObjPtr->classId = classId;
- graphObjPtr->className = Blt_GraphClassName(classId);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GraphEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * graphs.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, the graph is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GraphEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Graph *graphPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- graphPtr->flags |= REDRAW_WORLD;
- Blt_EventuallyRedrawGraph(graphPtr);
- }
- } else if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- if (eventPtr->type == FocusIn) {
- graphPtr->flags |= FOCUS;
- } else {
- graphPtr->flags &= ~FOCUS;
- }
- graphPtr->flags |= REDRAW_WORLD;
- Blt_EventuallyRedrawGraph(graphPtr);
- }
- } else if (eventPtr->type == DestroyNotify) {
- if (graphPtr->tkwin != NULL) {
- Blt_DeleteWindowInstanceData(graphPtr->tkwin);
- graphPtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(graphPtr->interp, graphPtr->cmdToken);
- }
- if (graphPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayGraph, graphPtr);
- }
- Tcl_EventuallyFree(graphPtr, DestroyGraph);
- } else if (eventPtr->type == ConfigureNotify) {
- graphPtr->flags |= (MAP_WORLD | REDRAW_WORLD);
- Blt_EventuallyRedrawGraph(graphPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GraphInstCmdDeleteProc --
- *
- * This procedure is invoked when a widget command is deleted. If the
- * widget isn't already in the process of being destroyed, this command
- * destroys it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GraphInstCmdDeleteProc(ClientData clientData) /* Pointer to widget record. */
-{
- Graph *graphPtr = clientData;
-
- if (graphPtr->tkwin != NULL) { /* NULL indicates window has already
- * been destroyed. */
- Tk_Window tkwin;
-
- tkwin = graphPtr->tkwin;
- graphPtr->tkwin = NULL;
- Blt_DeleteWindowInstanceData(tkwin);
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AdjustAxisPointers --
- *
- * Sets the axis pointers according to whether the axis is inverted on
- * not. The axis sites are also reset.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-AdjustAxisPointers(Graph *graphPtr)
-{
- if (graphPtr->inverted) {
- graphPtr->leftMargin.axes = graphPtr->axisChain[0];
- graphPtr->bottomMargin.axes = graphPtr->axisChain[1];
- graphPtr->rightMargin.axes = graphPtr->axisChain[2];
- graphPtr->topMargin.axes = graphPtr->axisChain[3];
- } else {
- graphPtr->leftMargin.axes = graphPtr->axisChain[1];
- graphPtr->bottomMargin.axes = graphPtr->axisChain[0];
- graphPtr->rightMargin.axes = graphPtr->axisChain[3];
- graphPtr->topMargin.axes = graphPtr->axisChain[2];
- }
-}
-
-static int
-InitPens(Graph *graphPtr)
-{
- Blt_InitHashTable(&graphPtr->penTable, BLT_STRING_KEYS);
- if (Blt_CreatePen(graphPtr, "activeLine", CID_ELEM_LINE, 0, NULL) == NULL) {
- return TCL_ERROR;
- }
- if (Blt_CreatePen(graphPtr, "activeBar", CID_ELEM_BAR, 0, NULL) == NULL) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GraphTags --
- *
- * Sets the binding tags for a graph obj. This routine is called by Tk
- * when an event occurs in the graph. It fills an array of pointers with
- * bind tag addresses.
- *
- * The object addresses are strings hashed in one of two tag tables: one
- * for elements and the another for markers. Note that there's only one
- * binding table for elements and markers. [We don't want to trigger
- * both a marker and element bind command for the same event.] But we
- * don't want a marker and element with the same tag name to activate the
- * others bindings. A tag "all" for markers should mean all markers, not
- * all markers and elements. As a result, element and marker tags are
- * stored in separate hash tables, which means we can't generate the same
- * tag address for both an elements and marker, even if they have the
- * same name.
- *
- * Results:
- * None.
- *
- * Side effects:
- * This information will be used by the binding code in bltUtil.c to
- * determine what graph objects match the current event. The tags are
- * placed in tagArr and *nTagsPtr is set with the number of tags found.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-void
-Blt_GraphTags(
- Blt_BindTable table,
- ClientData object,
- ClientData context, /* Not used. */
- Blt_List list)
-{
- GraphObj *graphObjPtr;
- MakeTagProc *tagProc;
- Graph *graphPtr;
-
- graphPtr = (Graph *)Blt_GetBindingData(table);
-
- /*
- * All graph objects (markers, elements, axes, etc) have the same starting
- * fields in their structures, such as "classId", "name", "className", and
- * "tags".
- */
- graphObjPtr = (GraphObj *)object;
-
- switch (graphObjPtr->classId) {
- case CID_ELEM_BAR:
- case CID_ELEM_CONTOUR:
- case CID_ELEM_LINE:
- case CID_ELEM_STRIP:
- tagProc = Blt_MakeElementTag;
- break;
- case CID_AXIS_X:
- case CID_AXIS_Y:
- tagProc = Blt_MakeAxisTag;
- break;
- case CID_MARKER_BITMAP:
- case CID_MARKER_IMAGE:
- case CID_MARKER_LINE:
- case CID_MARKER_POLYGON:
- case CID_MARKER_TEXT:
- case CID_MARKER_WINDOW:
- tagProc = Blt_MakeMarkerTag;
- break;
- case CID_NONE:
- panic("unknown object type");
- tagProc = NULL;
- break;
- default:
- panic("bogus object type");
- tagProc = NULL;
- break;
- }
- assert(graphObjPtr->name != NULL);
-
- /* Always add the name of the object to the tag array. */
- Blt_List_Append(list, (*tagProc)(graphPtr, graphObjPtr->name), 0);
- Blt_List_Append(list, (*tagProc)(graphPtr, graphObjPtr->className), 0);
- if (graphObjPtr->tags != NULL) {
- const char **p;
-
- for (p = graphObjPtr->tags; *p != NULL; p++) {
- Blt_List_Append(list, (*tagProc) (graphPtr, *p), 0);
- }
- }
-}
-
-/*
- * Find the closest point from the set of displayed elements, searching
- * the display list from back to front. That way, if the points from
- * two different elements overlay each other exactly, the one that's on
- * top (visible) is picked.
- */
-/*ARGSUSED*/
-static ClientData
-PickEntry(ClientData clientData, int x, int y, ClientData *contextPtr)
-{
- Graph *graphPtr = clientData;
- Blt_ChainLink link;
- Element *elemPtr;
- Marker *markerPtr;
- Region2d exts;
-
- if (graphPtr->flags & MAP_ALL) {
- return NULL; /* Don't pick anything until the next
- * redraw occurs. */
- }
- Blt_GraphExtents(graphPtr, &exts);
-
- if ((x >= exts.right) || (x < exts.left) ||
- (y >= exts.bottom) || (y < exts.top)) {
- /*
- * Sample coordinate is in one of the graph margins. Can only pick an
- * axis.
- */
- return Blt_NearestAxis(graphPtr, x, y);
- }
- /*
- * From top-to-bottom check:
- * 1. markers drawn on top (-under false).
- * 2. elements using its display list back to front.
- * 3. markers drawn under element (-under true).
- */
- markerPtr = Blt_NearestMarker(graphPtr, x, y, FALSE);
- if (markerPtr != NULL) {
- return markerPtr; /* Found a marker (-under false). */
- }
- {
- ClosestSearch search;
-
- search.along = SEARCH_BOTH;
- search.halo = graphPtr->halo;
- search.index = -1;
- search.x = x;
- search.y = y;
- search.dist = (double)(search.halo + 1);
- search.mode = SEARCH_AUTO;
-
- for (link = Blt_Chain_LastLink(graphPtr->elements.displayList);
- link != NULL; link = Blt_Chain_PrevLink(link)) {
- elemPtr = Blt_Chain_GetValue(link);
- if (elemPtr->flags & (HIDE|MAP_ITEM)) {
- continue;
- }
- if (elemPtr->state == STATE_NORMAL) {
- (*elemPtr->procsPtr->closestProc) (graphPtr, elemPtr, &search);
- }
- }
- if (search.dist <= (double)search.halo) {
- return search.elemPtr; /* Found an element within the minimum
- * halo distance. */
- }
- }
- markerPtr = Blt_NearestMarker(graphPtr, x, y, TRUE);
- if (markerPtr != NULL) {
- return markerPtr; /* Found a marker (-under true) */
- }
- return NULL; /* Nothing found. */
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureGraph --
- *
- * Allocates resources for the graph.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for graphPtr; old resources get freed, if there were any. The
- * graph is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ConfigureGraph(Graph *graphPtr)
-{
- XColor *colorPtr;
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
-
- /* Don't allow negative bar widths. Reset to an arbitrary value (0.1) */
- if (graphPtr->barWidth <= 0.0f) {
- graphPtr->barWidth = 0.8f;
- }
- graphPtr->inset = graphPtr->borderWidth + graphPtr->highlightWidth;
- if ((graphPtr->reqHeight != Tk_ReqHeight(graphPtr->tkwin)) ||
- (graphPtr->reqWidth != Tk_ReqWidth(graphPtr->tkwin))) {
- Tk_GeometryRequest(graphPtr->tkwin, graphPtr->reqWidth,
- graphPtr->reqHeight);
- }
- Tk_SetInternalBorder(graphPtr->tkwin, graphPtr->borderWidth);
- colorPtr = Blt_BackgroundBorderColor(graphPtr->normalBg);
-
- graphPtr->titleWidth = graphPtr->titleHeight = 0;
- if (graphPtr->title != NULL) {
- unsigned int w, h;
-
- Blt_Ts_GetExtents(&graphPtr->titleTextStyle, graphPtr->title, &w, &h);
- graphPtr->titleHeight = h;
- }
-
- /*
- * Create GCs for interior and exterior regions, and a background GC for
- * clearing the margins with XFillRectangle
- */
-
- /* Margin GC */
-
- gcValues.foreground =
- Blt_Ts_GetForeground(graphPtr->titleTextStyle)->pixel;
- gcValues.background = colorPtr->pixel;
- gcMask = (GCForeground | GCBackground);
- newGC = Tk_GetGC(graphPtr->tkwin, gcMask, &gcValues);
- if (graphPtr->drawGC != NULL) {
- Tk_FreeGC(graphPtr->display, graphPtr->drawGC);
- }
- graphPtr->drawGC = newGC;
-
- if (graphPtr->plotBg != NULL) {
- Blt_SetBackgroundChangedProc(graphPtr->plotBg, Blt_UpdateGraph,
- graphPtr);
- }
- if (graphPtr->normalBg != NULL) {
- Blt_SetBackgroundChangedProc(graphPtr->normalBg, Blt_UpdateGraph,
- graphPtr);
- }
- if (Blt_ConfigModified(configSpecs, "-invertxy", (char *)NULL)) {
-
- /*
- * If the -inverted option changed, we need to readjust the pointers
- * to the axes and recompute the their scales.
- */
-
- AdjustAxisPointers(graphPtr);
- graphPtr->flags |= RESET_AXES;
- }
- if ((!graphPtr->backingStore) && (graphPtr->cache != None)) {
- /*
- * Free the pixmap if we're not buffering the display of elements
- * anymore.
- */
- Tk_FreePixmap(graphPtr->display, graphPtr->cache);
- graphPtr->cache = None;
- }
- /*
- * Reconfigure the crosshairs, just in case the background color of the
- * plotarea has been changed.
- */
- Blt_ConfigureCrosshairs(graphPtr);
-
- /*
- * Update the layout of the graph (and redraw the elements) if any of the
- * following graph options which affect the size of * the plotting area
- * has changed.
- *
- * -aspect
- * -borderwidth, -plotborderwidth
- * -font, -title
- * -width, -height
- * -invertxy
- * -bottommargin, -leftmargin, -rightmargin, -topmargin,
- * -barmode, -barwidth
- */
- if (Blt_ConfigModified(configSpecs, "-invertxy", "-title", "-font",
- "-*margin", "-*width", "-height", "-barmode", "-*pad*",
- "-aspect", "-*borderwidth", "-plot*", "-*width", "-*height",
- "-unmaphiddenelements", (char *)NULL)) {
- graphPtr->flags |= RESET_WORLD | CACHE_DIRTY;
- }
- if (Blt_ConfigModified(configSpecs, "-plot*", "-*background",
- (char *)NULL)) {
- graphPtr->flags |= CACHE_DIRTY;
- }
- graphPtr->flags |= REDRAW_WORLD;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyGraph --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the internal structure of a graph at a safe time (when no-one
- * is using it anymore).
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyGraph(DestroyData dataPtr)
-{
- Graph *graphPtr = (Graph *)dataPtr;
-
- Blt_FreeOptions(configSpecs, (char *)graphPtr, graphPtr->display, 0);
- /*
- * Destroy the individual components of the graph: elements, markers,
- * axes, legend, display lists etc. Be careful to remove them in
- * order. For example, axes are used by elements and markers, so they have
- * to be removed after the markers and elements. Same it true with the
- * legend and pens (they use elements), so can't be removed until the
- * elements are destroyed.
- */
- Blt_DestroyMarkers(graphPtr);
- Blt_DestroyElements(graphPtr);
- Blt_DestroyLegend(graphPtr);
- Blt_DestroyAxes(graphPtr);
- Blt_DestroyPens(graphPtr);
- Blt_DestroyCrosshairs(graphPtr);
- Blt_DestroyPageSetup(graphPtr);
- Blt_DestroyBarSets(graphPtr);
- /* Destroy table clients after elements are destroyed. */
- Blt_DestroyTableClients(graphPtr);
- if (graphPtr->bindTable != NULL) {
- Blt_DestroyBindingTable(graphPtr->bindTable);
- }
-
- /* Release allocated X resources and memory. */
- if (graphPtr->drawGC != NULL) {
- Tk_FreeGC(graphPtr->display, graphPtr->drawGC);
- }
- Blt_Ts_FreeStyle(graphPtr->display, &graphPtr->titleTextStyle);
- if (graphPtr->cache != None) {
- Tk_FreePixmap(graphPtr->display, graphPtr->cache);
- }
- Blt_Free(graphPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateGraph --
- *
- * This procedure creates and initializes a new widget.
- *
- * Results:
- * The return value is a pointer to a structure describing the new
- * widget. If an error occurred, then the return value is NULL and an
- * error message is left in interp->result.
- *
- * Side effects:
- * Memory is allocated, a Tk_Window is created, etc.
- *
- *---------------------------------------------------------------------------
- */
-
-static Graph *
-CreateGraph(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv, ClassId classId)
-{
- Graph *graphPtr;
- Tk_Window tkwin;
-
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
- Tcl_GetString(objv[1]), (char *)NULL);
- if (tkwin == NULL) {
- return NULL;
- }
- graphPtr = Blt_AssertCalloc(1, sizeof(Graph));
-
- /* Initialize the graph data structure. */
-
- graphPtr->tkwin = tkwin;
- graphPtr->display = Tk_Display(tkwin);
- graphPtr->interp = interp;
- graphPtr->classId = classId;
- graphPtr->backingStore = TRUE;
- graphPtr->doubleBuffer = TRUE;
- graphPtr->borderWidth = 2;
- graphPtr->plotBW = 1;
- graphPtr->highlightWidth = 2;
- graphPtr->plotRelief = TK_RELIEF_SOLID;
- graphPtr->relief = TK_RELIEF_FLAT;
- graphPtr->flags = RESET_WORLD;
- graphPtr->nextMarkerId = 1;
- graphPtr->padLeft = graphPtr->padRight = 0;
- graphPtr->padTop = graphPtr->padBottom = 0;
- graphPtr->bottomMargin.site = MARGIN_BOTTOM;
- graphPtr->leftMargin.site = MARGIN_LEFT;
- graphPtr->topMargin.site = MARGIN_TOP;
- graphPtr->rightMargin.site = MARGIN_RIGHT;
- Blt_Ts_InitStyle(graphPtr->titleTextStyle);
- Blt_Ts_SetAnchor(graphPtr->titleTextStyle, TK_ANCHOR_N);
-
- Blt_InitHashTable(&graphPtr->axes.table, BLT_STRING_KEYS);
- Blt_InitHashTable(&graphPtr->axes.tagTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&graphPtr->elements.table, BLT_STRING_KEYS);
- Blt_InitHashTable(&graphPtr->elements.tagTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&graphPtr->markers.table, BLT_STRING_KEYS);
- Blt_InitHashTable(&graphPtr->markers.tagTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&graphPtr->dataTables, BLT_STRING_KEYS);
- graphPtr->elements.displayList = Blt_Chain_Create();
- graphPtr->markers.displayList = Blt_Chain_Create();
- graphPtr->axes.displayList = Blt_Chain_Create();
-
- switch (classId) {
- case CID_ELEM_LINE:
- Tk_SetClass(tkwin, "Graph");
- break;
- case CID_ELEM_BAR:
- Tk_SetClass(tkwin, "Barchart");
- break;
- case CID_ELEM_STRIP:
- Tk_SetClass(tkwin, "Stripchart");
- default:
- Tk_SetClass(tkwin, "???");
- break;
- }
- Blt_SetWindowInstanceData(tkwin, graphPtr);
-
- if (InitPens(graphPtr) != TCL_OK) {
- goto error;
- }
- if (Blt_ConfigureWidgetFromObj(interp, tkwin, configSpecs, objc - 2,
- objv + 2, (char *)graphPtr, 0) != TCL_OK) {
- goto error;
- }
- if (Blt_DefaultAxes(graphPtr) != TCL_OK) {
- goto error;
- }
- AdjustAxisPointers(graphPtr);
-
- if (Blt_CreatePageSetup(graphPtr) != TCL_OK) {
- goto error;
- }
- if (Blt_CreateCrosshairs(graphPtr) != TCL_OK) {
- goto error;
- }
- if (Blt_CreateLegend(graphPtr) != TCL_OK) {
- goto error;
- }
- Tk_CreateEventHandler(graphPtr->tkwin,
- ExposureMask | StructureNotifyMask | FocusChangeMask, GraphEventProc,
- graphPtr);
-
- graphPtr->cmdToken = Tcl_CreateObjCommand(interp, Tcl_GetString(objv[1]),
- Blt_GraphInstCmdProc, graphPtr, GraphInstCmdDeleteProc);
- ConfigureGraph(graphPtr);
- graphPtr->bindTable = Blt_CreateBindingTable(interp, tkwin, graphPtr,
- PickEntry, Blt_GraphTags);
-
- Tcl_SetObjResult(interp, objv[1]);
- return graphPtr;
-
- error:
- DestroyGraph((DestroyData)graphPtr);
- return NULL;
-}
-
-/* Widget sub-commands */
-
-/*ARGSUSED*/
-static int
-XAxisOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int margin;
-
- margin = (graphPtr->inverted) ? MARGIN_LEFT : MARGIN_BOTTOM;
- return Blt_AxisOp(interp, graphPtr, margin, objc, objv);
-}
-
-static int
-X2AxisOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int margin;
-
- margin = (graphPtr->inverted) ? MARGIN_RIGHT : MARGIN_TOP;
- return Blt_AxisOp(interp, graphPtr, margin, objc, objv);
-}
-
-static int
-YAxisOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int margin;
-
- margin = (graphPtr->inverted) ? MARGIN_BOTTOM : MARGIN_LEFT;
- return Blt_AxisOp(interp, graphPtr, margin, objc, objv);
-}
-
-static int
-Y2AxisOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int margin;
-
- margin = (graphPtr->inverted) ? MARGIN_TOP : MARGIN_RIGHT;
- return Blt_AxisOp(interp, graphPtr, margin, objc, objv);
-}
-
-static int
-BarOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- return Blt_ElementOp(graphPtr, interp, objc, objv, CID_ELEM_BAR);
-}
-
-/*ARGSUSED*/
-static int
-LineOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- return Blt_ElementOp(graphPtr, interp, objc, objv, CID_ELEM_LINE);
-}
-
-static int
-ElementOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- return Blt_ElementOp(graphPtr, interp, objc, objv, graphPtr->classId);
-}
-
-static int
-ConfigureOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int flags;
-
- flags = BLT_CONFIG_OBJV_ONLY;
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)graphPtr, (Tcl_Obj *)NULL, flags);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)graphPtr, objv[2], flags);
- } else {
- if (Blt_ConfigureWidgetFromObj(interp, graphPtr->tkwin, configSpecs,
- objc - 2, objv + 2, (char *)graphPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- ConfigureGraph(graphPtr);
- Blt_EventuallyRedrawGraph(graphPtr);
- return TCL_OK;
- }
-}
-
-/* ARGSUSED*/
-static int
-CgetOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- return Blt_ConfigureValueFromObj(interp, graphPtr->tkwin, configSpecs,
- (char *)graphPtr, objv[2], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExtentsOp --
- *
- * Reports the size of one of several items within the graph. The
- * following are valid items:
- *
- * "bottommargin" Height of the bottom margin
- * "leftmargin" Width of the left margin
- * "legend" x y w h of the legend
- * "plotarea" x y w h of the plotarea
- * "plotheight" Height of the plot area
- * "rightmargin" Width of the right margin
- * "topmargin" Height of the top margin
- * "plotwidth" Width of the plot area
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED*/
-static int
-ExtentsOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- const char *string;
- char c;
- int length;
-
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- if ((c == 'p') && (length > 4) &&
- (strncmp("plotheight", string, length) == 0)) {
- int height;
-
- height = graphPtr->bottom - graphPtr->top + 1;
- Tcl_SetIntObj(Tcl_GetObjResult(interp), height);
- } else if ((c == 'p') && (length > 4) &&
- (strncmp("plotwidth", string, length) == 0)) {
- int width;
-
- width = graphPtr->right - graphPtr->left + 1;
- Tcl_SetIntObj(Tcl_GetObjResult(interp), width);
- } else if ((c == 'p') && (length > 4) &&
- (strncmp("plotarea", string, length) == 0)) {
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(graphPtr->left));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(graphPtr->top));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(graphPtr->right - graphPtr->left + 1));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(graphPtr->bottom - graphPtr->top + 1));
- Tcl_SetObjResult(interp, listObjPtr);
- } else if ((c == 'l') && (length > 2) &&
- (strncmp("legend", string, length) == 0)) {
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(Blt_Legend_X(graphPtr)));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(Blt_Legend_Y(graphPtr)));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(Blt_Legend_Width(graphPtr)));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(Blt_Legend_Height(graphPtr)));
- Tcl_SetObjResult(interp, listObjPtr);
- } else if ((c == 'l') && (length > 2) &&
- (strncmp("leftmargin", string, length) == 0)) {
- Tcl_SetIntObj(Tcl_GetObjResult(interp), graphPtr->leftMargin.width);
- } else if ((c == 'r') && (length > 1) &&
- (strncmp("rightmargin", string, length) == 0)) {
- Tcl_SetIntObj(Tcl_GetObjResult(interp), graphPtr->rightMargin.width);
- } else if ((c == 't') && (length > 1) &&
- (strncmp("topmargin", string, length) == 0)) {
- Tcl_SetIntObj(Tcl_GetObjResult(interp), graphPtr->topMargin.height);
- } else if ((c == 'b') && (length > 1) &&
- (strncmp("bottommargin", string, length) == 0)) {
- Tcl_SetIntObj(Tcl_GetObjResult(interp), graphPtr->bottomMargin.height);
- } else {
- Tcl_AppendResult(interp, "bad extent item \"", objv[2],
- "\": should be plotheight, plotwidth, leftmargin, rightmargin, \
-topmargin, bottommargin, plotarea, or legend", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InsideOp --
- *
- * Returns true of false whether the given point is inside the plotting
- * area (defined by left,bottom right, top).
- *
- * Results:
- * Always returns TCL_OK. interp->result will contain the boolean string
- * representation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED*/
-static int
-InsideOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int x, y;
- Region2d exts;
- int result;
-
- if (Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_GraphExtents(graphPtr, &exts);
- result = PointInRegion(&exts, x, y);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), result);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InvtransformOp --
- *
- * This procedure returns a list of the graph coordinate values
- * corresponding with the given window X and Y coordinate positions.
- *
- * Results:
- * Returns a standard TCL result. If an error occurred while parsing the
- * window positions, TCL_ERROR is returned, and interp->result will
- * contain the error message. Otherwise interp->result will contain a
- * Tcl list of the x and y coordinates.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InvtransformOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- double x, y;
- Point2d point;
- Axis2d axes;
- Tcl_Obj *listObjPtr;
-
- if ((Blt_ExprDoubleFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Blt_ExprDoubleFromObj(interp, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (graphPtr->flags & RESET_AXES) {
- Blt_ResetAxes(graphPtr);
- }
- /* Perform the reverse transformation, converting from window coordinates
- * to graph data coordinates. Note that the point is always mapped to the
- * bottom and left axes (which may not be what the user wants). */
-
- /* Pick the first pair of axes */
- axes.x = Blt_GetFirstAxis(graphPtr->axisChain[0]);
- axes.y = Blt_GetFirstAxis(graphPtr->axisChain[1]);
- point = Blt_InvMap2D(graphPtr, x, y, &axes);
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(point.x));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(point.y));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TransformOp --
- *
- * This procedure returns a list of the window coordinates corresponding
- * with the given graph x and y coordinates.
- *
- * Results:
- * Returns a standard TCL result. interp->result contains the list of
- * the graph coordinates. If an error occurred while parsing the window
- * positions, TCL_ERROR is returned, then interp->result will contain an
- * error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TransformOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- double x, y;
- Point2d point;
- Axis2d axes;
- Tcl_Obj *listObjPtr;
-
- if ((Blt_ExprDoubleFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Blt_ExprDoubleFromObj(interp, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (graphPtr->flags & RESET_AXES) {
- Blt_ResetAxes(graphPtr);
- }
- /*
- * Perform the transformation from window to graph coordinates. Note that
- * the points are always mapped onto the bottom and left axes (which may
- * not be the what the user wants).
- */
- axes.x = Blt_GetFirstAxis(graphPtr->axisChain[0]);
- axes.y = Blt_GetFirstAxis(graphPtr->axisChain[1]);
-
- point = Blt_Map2D(graphPtr, x, y, &axes);
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(ROUND(point.x)));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(ROUND(point.y)));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-#ifndef NO_PRINTER
-
-/*
- *---------------------------------------------------------------------------
- *
- * Print1Op --
- *
- * Prints the equivalent of a screen snapshot of the graph to the
- * designated printer.
- *
- * Results:
- * Returns a standard TCL result. If an error occurred TCL_ERROR is
- * returned and interp->result will contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-Print1Op(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- BITMAPINFO info;
- void *data;
- TkWinDCState state;
- TkWinBitmap bd;
- DIBSECTION ds;
- Drawable drawable;
- HBITMAP hBitmap;
- HDC hDC;
- DOCINFO di;
- double pageWidth, pageHeight;
- int result;
- double scale, sx, sy;
- int jobId;
-
- graphPtr->width = Tk_Width(graphPtr->tkwin);
- graphPtr->height = Tk_Height(graphPtr->tkwin);
- if ((graphPtr->width < 2) && (graphPtr->reqWidth > 0)) {
- graphPtr->width = graphPtr->reqWidth;
- }
- if ((graphPtr->height < 2) && (graphPtr->reqHeight > 0)) {
- graphPtr->height = graphPtr->reqHeight;
- }
- if (objc == 2) {
- result = Blt_PrintDialog(interp, &drawable);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (result == TCL_RETURN) {
- return TCL_OK;
- }
- } else {
- if (Blt_GetOpenPrinter(interp, Tcl_GetString(objv[2]), &drawable)
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- /*
- * This is a taken from Blt_SnapPhoto. The difference is that here we're
- * using the DIBSection directly, without converting the section into a
- * Picture.
- */
- ZeroMemory(&info, sizeof(info));
- info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- info.bmiHeader.biWidth = graphPtr->width;
- info.bmiHeader.biHeight = graphPtr->height;
- info.bmiHeader.biPlanes = 1;
- info.bmiHeader.biBitCount = 32;
- info.bmiHeader.biCompression = BI_RGB;
- hDC = TkWinGetDrawableDC(graphPtr->display, Tk_WindowId(graphPtr->tkwin),
- &state);
- hBitmap = CreateDIBSection(hDC, &info, DIB_RGB_COLORS, &data, NULL, 0);
- TkWinReleaseDrawableDC(Tk_WindowId(graphPtr->tkwin), hDC, &state);
-
- /*
- * Create our own drawable by hand using the DIB we just created. We'll
- * then draw into it using the standard drawing functions.
- */
- bd.type = TWD_BITMAP;
- bd.handle = hBitmap;
- bd.colormap = DefaultColormap(graphPtr->display,
- DefaultScreen(graphPtr->display));
- bd.depth = Tk_Depth(graphPtr->tkwin);
-
- graphPtr->flags |= RESET_WORLD;
- Blt_DrawGraph(graphPtr, (Drawable)&bd);
-
- /*
- * Now that the DIB contains the image of the graph, get the the data bits
- * and write them to the printer device, stretching the image to the fit
- * the printer's resolution.
- */
- result = TCL_ERROR;
- if (GetObject(hBitmap, sizeof(DIBSECTION), &ds) == 0) {
- Tcl_AppendResult(interp, "can't get object: ", Blt_LastError(),
- (char *)NULL);
- goto done;
- }
- hDC = ((TkWinDC *) drawable)->hdc;
- /* Get the resolution of the printer device. */
- sx = (double)GetDeviceCaps(hDC, HORZRES) / (double)graphPtr->width;
- sy = (double)GetDeviceCaps(hDC, VERTRES) / (double)graphPtr->height;
- scale = MIN(sx, sy);
- pageWidth = scale * graphPtr->width;
- pageHeight = scale * graphPtr->height;
-
- ZeroMemory(&di, sizeof(di));
- di.cbSize = sizeof(di);
- di.lpszDocName = "Graph Contents";
- jobId = StartDoc(hDC, &di);
- if (jobId <= 0) {
- Tcl_AppendResult(interp, "can't start document: ", Blt_LastError(),
- (char *)NULL);
- goto done;
- }
- if (StartPage(hDC) <= 0) {
- Tcl_AppendResult(interp, "error starting page: ", Blt_LastError(),
- (char *)NULL);
- goto done;
- }
- StretchDIBits(hDC, 0, 0, ROUND(pageWidth), ROUND(pageHeight), 0, 0,
- graphPtr->width, graphPtr->height, ds.dsBm.bmBits,
- (LPBITMAPINFO)&ds.dsBmih, DIB_RGB_COLORS, SRCCOPY);
- EndPage(hDC);
- EndDoc(hDC);
- result = TCL_OK;
- done:
- DeleteBitmap(hBitmap);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Print2Op --
- *
- * Prints directly to the designated printer device.
- *
- * Results:
- * Returns a standard TCL result. If an error occurred, TCL_ERROR is
- * returned and interp->result will contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-Print2Op(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Drawable drawable;
- int result;
-
- graphPtr->width = Tk_Width(graphPtr->tkwin);
- graphPtr->height = Tk_Height(graphPtr->tkwin);
- if ((graphPtr->width < 2) && (graphPtr->reqWidth > 0)) {
- graphPtr->width = graphPtr->reqWidth;
- }
- if ((graphPtr->height < 2) && (graphPtr->reqHeight > 0)) {
- graphPtr->height = graphPtr->reqHeight;
- }
- if (objc == 2) {
- result = Blt_PrintDialog(interp, &drawable);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (result == TCL_RETURN) {
- return TCL_OK;
- }
- } else {
- result = Blt_GetOpenPrinter(interp, Tcl_GetString(objv[2]), &drawable);
- }
- if (result == TCL_OK) {
- int oldMode;
- HDC hDC;
- double xRatio, yRatio;
- TkWinDC *drawPtr;
- int w, h;
-
- drawPtr = (TkWinDC *) drawable;
- hDC = drawPtr->hdc;
- Blt_GetPrinterScale(hDC, &xRatio, &yRatio);
- oldMode = SetMapMode(hDC, MM_ISOTROPIC);
- if (oldMode == 0) {
- Tcl_AppendResult(interp, "can't set mode for printer DC: ",
- Blt_LastError(), (char *)NULL);
- return TCL_ERROR;
- }
- w = (int)round(graphPtr->width * xRatio);
- h = (int)round(graphPtr->height * yRatio);
- SetViewportExtEx(hDC, w, h, NULL);
- SetWindowExtEx(hDC, graphPtr->width, graphPtr->height, NULL);
-
- Blt_StartPrintJob(interp, drawable);
- graphPtr->flags |= RESET_WORLD;
- Blt_DrawGraph(graphPtr, drawable);
- Blt_EndPrintJob(interp, drawable);
- }
- return result;
-}
-
-#endif /* NO_PRINTER */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToFormat --
- *
- * Convert a string represent a node number into its integer value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToFormat(
- ClientData clientData, /* Not used.*/
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- int *formatPtr = (int *)(record + offset);
- char c;
- const char *string;
-
- string = Tcl_GetString(objPtr);
- c = string[0];
- if ((c == 'p') && (strcmp(string, "picture") == 0)) {
- *formatPtr = FORMAT_PHOTO;
- } else if ((c == 'p') && (strcmp(string, "photo") == 0)) {
- *formatPtr = FORMAT_PHOTO;
-#ifdef WIN32
- } else if ((c == 'e') && (strcmp(string, "emf") == 0)) {
- *formatPtr = FORMAT_EMF;
- } else if ((c == 'w') && (strcmp(string, "wmf") == 0)) {
- *formatPtr = FORMAT_WMF;
-#endif /* WIN32 */
- } else {
-#ifdef WIN32
- Tcl_AppendResult(interp, "bad format \"", string,
- "\": should be picture, photo, emf, or wmf.", (char *)NULL);
-#else
- Tcl_AppendResult(interp, "bad format \"", string,
- "\": should be picture or photo.", (char *)NULL);
-#endif /* WIN32 */
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-#ifdef WIN32
-static int InitMetaFileHeader(
- Tk_Window tkwin,
- int width, int height,
- APMHEADER *mfhPtr)
-{
- unsigned int *p;
- unsigned int sum;
-#define MM_INCH 25.4
- int xdpi, ydpi;
-
- mfhPtr->key = 0x9ac6cdd7L;
- mfhPtr->hmf = 0;
- mfhPtr->inch = 1440;
-
- Blt_ScreenDPI(tkwin, &xdpi, &ydpi);
- mfhPtr->bbox.Left = mfhPtr->bbox.Top = 0;
- mfhPtr->bbox.Bottom = (SHORT)((width * 1440)/ (float)xdpi);
- mfhPtr->bbox.Right = (SHORT)((height * 1440) / (float)ydpi);
- mfhPtr->reserved = 0;
- sum = 0;
- for (p = (unsigned int *)mfhPtr;
- p < (unsigned int *)&(mfhPtr->checksum); p++) {
- sum ^= *p;
- }
- mfhPtr->checksum = sum;
- return TCL_OK;
-}
-
-static int
-CreateAPMetaFile(Tcl_Interp *interp, HANDLE hMetaFile, HDC hDC,
- APMHEADER *mfhPtr, const char *fileName)
-{
- HANDLE hFile;
- HANDLE hMem;
- LPVOID buffer;
- int result;
- DWORD count, nBytes;
-
- result = TCL_ERROR;
- hMem = NULL;
- hFile = CreateFile(
- fileName, /* File path */
- GENERIC_WRITE, /* Access mode */
- 0, /* No sharing. */
- NULL, /* Security attributes */
- CREATE_ALWAYS, /* Overwrite any existing file */
- FILE_ATTRIBUTE_NORMAL,
- NULL); /* No template file */
- if (hFile == INVALID_HANDLE_VALUE) {
- Tcl_AppendResult(interp, "can't create metafile \"", fileName,
- "\":", Blt_LastError(), (char *)NULL);
- return TCL_ERROR;
- }
- if ((!WriteFile(hFile, (LPVOID)mfhPtr, sizeof(APMHEADER), &count,
- NULL)) || (count != sizeof(APMHEADER))) {
- Tcl_AppendResult(interp, "can't create metafile header to \"",
- fileName, "\":", Blt_LastError(), (char *)NULL);
- goto error;
- }
- nBytes = GetWinMetaFileBits(hMetaFile, 0, NULL, MM_ANISOTROPIC, hDC);
- hMem = GlobalAlloc(GHND, nBytes);
- if (hMem == NULL) {
- Tcl_AppendResult(interp, "can't create allocate global memory:",
- Blt_LastError(), (char *)NULL);
- goto error;
- }
- buffer = (LPVOID)GlobalLock(hMem);
- if (!GetWinMetaFileBits(hMetaFile, nBytes, buffer, MM_ANISOTROPIC, hDC)) {
- Tcl_AppendResult(interp, "can't get metafile bits:",
- Blt_LastError(), (char *)NULL);
- goto error;
- }
- if ((!WriteFile(hFile, buffer, nBytes, &count, NULL)) ||
- (count != nBytes)) {
- Tcl_AppendResult(interp, "can't write metafile bits:",
- Blt_LastError(), (char *)NULL);
- goto error;
- }
- result = TCL_OK;
- error:
- CloseHandle(hFile);
- if (hMem != NULL) {
- GlobalUnlock(hMem);
- GlobalFree(hMem);
- }
- return result;
-}
-#endif /*WIN32*/
-
-/*
- *---------------------------------------------------------------------------
- *
- * SnapOp --
- *
- * Snaps a picture of the graph and stores it in the specified image.
- *
- * Results:
- * Returns a standard TCL result. interp->result contains
- * the list of the graph coordinates. If an error occurred
- * while parsing the window positions, TCL_ERROR is returned,
- * then interp->result will contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SnapOp(Graph *graphPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int result;
- Pixmap drawable;
- int i;
- SnapSwitches switches;
-
- /* .g snap ?switches? name */
- switches.height = Tk_Height(graphPtr->tkwin);
- if ((switches.height < 2) && (graphPtr->reqHeight > 0)) {
- switches.height = graphPtr->reqHeight;
- }
- switches.width = Tk_Width(graphPtr->tkwin);
- if ((switches.width < 2) && (graphPtr->reqWidth > 0)) {
- switches.width = graphPtr->reqWidth;
- }
- switches.format = FORMAT_PICTURE;
- /* Process switches */
- i = Blt_ParseSwitches(interp, snapSwitches, objc - 2, objv + 2, &switches,
- BLT_SWITCH_OBJV_PARTIAL);
- if (i < 0) {
- return TCL_ERROR;
- }
- i += 2;
- if (i >= objc) {
- Tcl_AppendResult(interp, "missing name argument: should be \"",
- Tcl_GetString(objv[0]), "snap ?switches? name\"", (char *)NULL);
- return TCL_ERROR;
- }
- switches.name = Tcl_GetString(objv[i]);
- if (switches.width < 2) {
- switches.width = Tk_ReqWidth(graphPtr->tkwin);
- }
- if (switches.height < 2) {
- switches.width = Tk_ReqHeight(graphPtr->tkwin);
- }
- /* Always re-compute the layout of the graph before snapping the picture. */
- graphPtr->width = switches.width;
- graphPtr->height = switches.height;
- Blt_MapGraph(graphPtr);
-
- drawable = Tk_WindowId(graphPtr->tkwin);
- switch (switches.format) {
- case FORMAT_PICTURE:
- case FORMAT_PHOTO:
- drawable = Tk_GetPixmap(graphPtr->display, drawable, graphPtr->width,
- graphPtr->height, Tk_Depth(graphPtr->tkwin));
-#ifdef WIN32
- assert(drawable != None);
-#endif
- graphPtr->flags |= RESET_WORLD;
- Blt_DrawGraph(graphPtr, drawable);
- if (switches.format == FORMAT_PICTURE) {
- result = Blt_SnapPicture(interp, graphPtr->tkwin, drawable, 0, 0,
- switches.width, switches.height, switches.width,
- switches.height, switches.name, 1.0);
- } else {
- result = Blt_SnapPhoto(interp, graphPtr->tkwin, drawable, 0, 0,
- switches.width, switches.height, switches.width,
- switches.height, switches.name, 1.0);
- }
- Tk_FreePixmap(graphPtr->display, drawable);
- break;
-
-#ifdef WIN32
- case FORMAT_WMF:
- case FORMAT_EMF:
- {
- TkWinDC drawableDC;
- TkWinDCState state;
- HDC hRefDC, hDC;
- HENHMETAFILE hMetaFile;
- Tcl_DString dString;
- const char *title;
-
- hRefDC = TkWinGetDrawableDC(graphPtr->display, drawable, &state);
-
- Tcl_DStringInit(&dString);
- Tcl_DStringAppend(&dString, "BLT Graph ", -1);
- Tcl_DStringAppend(&dString, BLT_VERSION, -1);
- Tcl_DStringAppend(&dString, "\0", -1);
- Tcl_DStringAppend(&dString, Tk_PathName(graphPtr->tkwin), -1);
- Tcl_DStringAppend(&dString, "\0", -1);
- title = Tcl_DStringValue(&dString);
- hDC = CreateEnhMetaFile(hRefDC, NULL, NULL, title);
- Tcl_DStringFree(&dString);
-
- if (hDC == NULL) {
- Tcl_AppendResult(interp, "can't create metafile: ",
- Blt_LastError(), (char *)NULL);
- return TCL_ERROR;
- }
-
- drawableDC.hdc = hDC;
- drawableDC.type = TWD_WINDC;
-
- graphPtr->width = switches.width;
- graphPtr->height = switches.height;
- Blt_MapGraph(graphPtr);
- graphPtr->flags |= RESET_WORLD;
- Blt_DrawGraph(graphPtr, (Drawable)&drawableDC);
- hMetaFile = CloseEnhMetaFile(hDC);
- if (strcmp(switches.name, "CLIPBOARD") == 0) {
- HWND hWnd;
-
- hWnd = Tk_GetHWND(drawable);
- OpenClipboard(hWnd);
- EmptyClipboard();
- SetClipboardData(CF_ENHMETAFILE, hMetaFile);
- CloseClipboard();
- result = TCL_OK;
- } else {
- result = TCL_ERROR;
- if (switches.format == FORMAT_WMF) {
- APMHEADER mfh;
-
- assert(sizeof(mfh) == 22);
- InitMetaFileHeader(graphPtr->tkwin, switches.width,
- switches.height, &mfh);
- result = CreateAPMetaFile(interp, hMetaFile, hRefDC, &mfh,
- switches.name);
- } else {
- HENHMETAFILE hMetaFile2;
-
- hMetaFile2 = CopyEnhMetaFile(hMetaFile, switches.name);
- if (hMetaFile2 != NULL) {
- result = TCL_OK;
- DeleteEnhMetaFile(hMetaFile2);
- }
- }
- DeleteEnhMetaFile(hMetaFile);
- }
- TkWinReleaseDrawableDC(drawable, hRefDC, &state);
- }
- break;
-#endif /*WIN32*/
- default:
- Tcl_AppendResult(interp, "bad snapshot format", (char *)NULL);
- return TCL_ERROR;
- }
- graphPtr->flags |= MAP_WORLD;
- Blt_EventuallyRedrawGraph(graphPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GraphWidgetCmd --
- *
- * This procedure is invoked to process the TCL command that
- * corresponds to a widget managed by this module. See the user
- * documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec graphOps[] =
-{
- {"axis", 1, Blt_VirtualAxisOp, 2, 0, "oper ?args?",},
- {"bar", 2, BarOp, 2, 0, "oper ?args?",},
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"configure", 2, ConfigureOp, 2, 0, "?option value?...",},
- {"crosshairs", 2, Blt_CrosshairsOp, 2, 0, "oper ?args?",},
- {"element", 2, ElementOp, 2, 0, "oper ?args?",},
- {"extents", 2, ExtentsOp, 3, 3, "item",},
- {"inside", 3, InsideOp, 4, 4, "winX winY",},
- {"invtransform", 3, InvtransformOp, 4, 4, "winX winY",},
- {"legend", 2, Blt_LegendOp, 2, 0, "oper ?args?",},
- {"line", 2, LineOp, 2, 0, "oper ?args?",},
- {"marker", 2, Blt_MarkerOp, 2, 0, "oper ?args?",},
- {"pen", 2, Blt_PenOp, 2, 0, "oper ?args?",},
- {"postscript", 2, Blt_PostScriptOp, 2, 0, "oper ?args?",},
-#ifndef NO_PRINTER
- {"print1", 2, Print1Op, 2, 3, "?printerName?",},
- {"print2", 2, Print2Op, 2, 3, "?printerName?",},
-#endif /*NO_PRINTER*/
- {"snap", 1, SnapOp, 3, 0, "?switches? name",},
- {"transform", 1, TransformOp, 4, 4, "x y",},
- {"x2axis", 2, X2AxisOp, 2, 0, "oper ?args?",},
- {"xaxis", 2, XAxisOp, 2, 0, "oper ?args?",},
- {"y2axis", 2, Y2AxisOp, 2, 0, "oper ?args?",},
- {"yaxis", 2, YAxisOp, 2, 0, "oper ?args?",},
-};
-static int nGraphOps = sizeof(graphOps) / sizeof(Blt_OpSpec);
-
-int
-Blt_GraphInstCmdProc(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- GraphCmdProc *proc;
- int result;
- Graph *graphPtr = clientData;
-
- proc = Blt_GetOpFromObj(interp, nGraphOps, graphOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(graphPtr);
- result = (*proc) (graphPtr, interp, objc, objv);
- Tcl_Release(graphPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewGraph --
- *
- * Creates a new window and TCL command representing an instance of a
- * graph widget.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static int
-NewGraph(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv, ClassId classId)
-{
- Graph *graphPtr;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- graphPtr = CreateGraph(interp, objc, objv, classId);
- if (graphPtr == NULL) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GraphCmd --
- *
- * Creates a new window and TCL command representing an instance of a
- * graph widget.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-GraphCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- return NewGraph(interp, objc, objv, CID_ELEM_LINE);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BarchartCmd --
- *
- * Creates a new window and TCL command representing an instance of a
- * barchart widget.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BarchartCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- return NewGraph(interp, objc, objv, CID_ELEM_BAR);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StripchartCmd --
- *
- * Creates a new window and TCL command representing an instance of a
- * barchart widget.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-StripchartCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- return NewGraph(interp, objc, objv, CID_ELEM_STRIP);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawMargins --
- *
- * Draws the exterior region of the graph (axes, ticks, titles, etc)
- * onto a pixmap. The interior region is defined by the given rectangle
- * structure.
- *
- * ---------------------------------
- * | |
- * | rectArr[0] |
- * | |
- * ---------------------------------
- * | |top right| |
- * | | | |
- * | | | |
- * | [1] | | [2] |
- * | | | |
- * | | | |
- * | | | |
- * | | | |
- * | | | |
- * | |left bottom| |
- * ---------------------------------
- * | |
- * | rectArr[3] |
- * | |
- * ---------------------------------
- *
- * X coordinate axis
- * Y coordinate axis
- * legend
- * interior border
- * exterior border
- * titles (X and Y axis, graph)
- *
- * Returns:
- * None.
- *
- * Side Effects:
- * Exterior of graph is displayed in its window.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawMargins(Graph *graphPtr, Drawable drawable)
-{
- XRectangle rects[4];
- int site;
-
- /*
- * Draw the four outer rectangles which encompass the plotting
- * surface. This clears the surrounding area and clips the plot.
- */
- rects[0].x = rects[0].y = rects[3].x = rects[1].x = 0;
- rects[0].width = rects[3].width = (short int)graphPtr->width;
- rects[0].height = (short int)graphPtr->top;
- rects[3].y = graphPtr->bottom;
- rects[3].height = graphPtr->height - graphPtr->bottom;
- rects[2].y = rects[1].y = graphPtr->top;
- rects[1].width = graphPtr->left;
- rects[2].height = rects[1].height = graphPtr->bottom - graphPtr->top;
- rects[2].x = graphPtr->right;
- rects[2].width = graphPtr->width - graphPtr->right;
-
- Blt_FillBackgroundRectangle(graphPtr->tkwin, drawable, graphPtr->normalBg,
- rects[0].x, rects[0].y, rects[0].width, rects[0].height,
- 0, TK_RELIEF_FLAT);
- Blt_FillBackgroundRectangle(graphPtr->tkwin, drawable, graphPtr->normalBg,
- rects[1].x, rects[1].y, rects[1].width, rects[1].height,
- 0, TK_RELIEF_FLAT);
- Blt_FillBackgroundRectangle(graphPtr->tkwin, drawable, graphPtr->normalBg,
- rects[2].x, rects[2].y, rects[2].width, rects[2].height,
- 0, TK_RELIEF_FLAT);
- Blt_FillBackgroundRectangle(graphPtr->tkwin, drawable, graphPtr->normalBg,
- rects[3].x, rects[3].y, rects[3].width, rects[3].height,
- 0, TK_RELIEF_FLAT);
-
- /* Draw 3D border around the plotting area */
-
- if (graphPtr->plotBW > 0) {
- int x, y, w, h;
-
- x = graphPtr->left - graphPtr->plotBW;
- y = graphPtr->top - graphPtr->plotBW;
- w = (graphPtr->right - graphPtr->left) + (2*graphPtr->plotBW);
- h = (graphPtr->bottom - graphPtr->top) + (2*graphPtr->plotBW);
- Blt_DrawBackgroundRectangle(graphPtr->tkwin, drawable,
- graphPtr->normalBg, x, y, w, h, graphPtr->plotBW,
- graphPtr->plotRelief);
- }
- site = Blt_Legend_Site(graphPtr);
- if (site & LEGEND_MARGIN_MASK) {
- /* Legend is drawn on one of the graph margins */
- Blt_DrawLegend(graphPtr, drawable);
- } else if (site == LEGEND_WINDOW) {
- Blt_Legend_EventuallyRedraw(graphPtr);
- }
- if (graphPtr->title != NULL) {
- Blt_DrawText(graphPtr->tkwin, drawable, graphPtr->title,
- &graphPtr->titleTextStyle, graphPtr->titleX, graphPtr->titleY);
- }
- Blt_DrawAxes(graphPtr, drawable);
- graphPtr->flags &= ~DRAW_MARGINS;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * DrawPlotRegion --
- *
- * Draws the contents of the plotting area. This consists of the
- * elements, markers (draw under elements), axis limits, and possibly the
- * legend. Typically, the output will be cached into a backing store
- * pixmap, so that redraws can occur quickly.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawPlotRegion(Graph *graphPtr, Drawable drawable)
-{
- int site;
-
- /* Clear the background of the plotting area. */
- Blt_FillBackgroundRectangle(graphPtr->tkwin, drawable, graphPtr->plotBg,
- graphPtr->left, graphPtr->top, graphPtr->right - graphPtr->left + 1,
- graphPtr->bottom - graphPtr->top + 1, TK_RELIEF_FLAT, 0);
-
- /* Draw the elements, markers, legend, and axis limits. */
-
- Blt_DrawGrids(graphPtr, drawable);
- Blt_DrawMarkers(graphPtr, drawable, MARKER_UNDER);
- site = Blt_Legend_Site(graphPtr);
- if ((site & LEGEND_PLOTAREA_MASK) &&
- (!Blt_Legend_IsRaised(graphPtr))) {
- Blt_DrawLegend(graphPtr, drawable);
- } else if (site == LEGEND_WINDOW) {
- Blt_Legend_EventuallyRedraw(graphPtr);
- }
- Blt_DrawAxisLimits(graphPtr, drawable);
- DrawMargins(graphPtr, drawable);
- Blt_DrawElements(graphPtr, drawable);
- Blt_DrawAxes(graphPtr, drawable);
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawPlot --
- *
- * Draws the contents of the plotting area. This consists of the
- * elements, markers (draw under elements), axis limits, and possibly the
- * legend. Typically, the output will be cached into a backing store
- * pixmap, so that redraws can occur quickly.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawPlot(Graph *graphPtr, Drawable drawable)
-{
- int site;
-
- DrawMargins(graphPtr, drawable);
-
- /* Draw the background of the plotting area with 3D border. */
- Blt_FillBackgroundRectangle(graphPtr->tkwin, drawable, graphPtr->plotBg,
- graphPtr->left - graphPtr->plotBW,
- graphPtr->top - graphPtr->plotBW,
- graphPtr->right - graphPtr->left + 1 + 2 * graphPtr->plotBW,
- graphPtr->bottom - graphPtr->top + 1 + 2 * graphPtr->plotBW,
- graphPtr->plotBW, graphPtr->plotRelief);
-
- /* Draw the elements, markers, legend, and axis limits. */
- Blt_DrawAxes(graphPtr, drawable);
- Blt_DrawGrids(graphPtr, drawable);
- Blt_DrawMarkers(graphPtr, drawable, MARKER_UNDER);
-
- site = Blt_Legend_Site(graphPtr);
- if ((site & LEGEND_PLOTAREA_MASK) && (!Blt_Legend_IsRaised(graphPtr))) {
- Blt_DrawLegend(graphPtr, drawable);
- } else if (site == LEGEND_WINDOW) {
- Blt_Legend_EventuallyRedraw(graphPtr);
- }
- Blt_DrawAxisLimits(graphPtr, drawable);
- Blt_DrawElements(graphPtr, drawable);
- /* Blt_DrawAxes(graphPtr, drawable); */
-}
-
-void
-Blt_MapGraph(Graph *graphPtr)
-{
- if (graphPtr->flags & RESET_AXES) {
- Blt_ResetAxes(graphPtr);
- }
- if (graphPtr->flags & LAYOUT_NEEDED) {
- Blt_LayoutGraph(graphPtr);
- graphPtr->flags &= ~LAYOUT_NEEDED;
- }
- /* Compute coordinate transformations for graph components */
- if ((graphPtr->vRange > 1) && (graphPtr->hRange > 1)) {
- if (graphPtr->flags & MAP_WORLD) {
- Blt_MapAxes(graphPtr);
- }
- Blt_MapElements(graphPtr);
- Blt_MapMarkers(graphPtr);
- graphPtr->flags &= ~(MAP_ALL);
- }
-}
-
-void
-Blt_DrawGraph(Graph *graphPtr, Drawable drawable)
-{
- DrawPlot(graphPtr, drawable);
- /* Draw markers above elements */
- Blt_DrawMarkers(graphPtr, drawable, MARKER_ABOVE);
- Blt_DrawActiveElements(graphPtr, drawable);
-
- /* Don't draw legend in the plot area. */
- if ((Blt_Legend_Site(graphPtr) & LEGEND_PLOTAREA_MASK) &&
- (Blt_Legend_IsRaised(graphPtr))) {
- Blt_DrawLegend(graphPtr, drawable);
- }
- /* Draw 3D border just inside of the focus highlight ring. */
- if ((graphPtr->borderWidth > 0) && (graphPtr->relief != TK_RELIEF_FLAT)) {
- Blt_DrawBackgroundRectangle(graphPtr->tkwin, drawable,
- graphPtr->normalBg, graphPtr->highlightWidth,
- graphPtr->highlightWidth,
- graphPtr->width - 2 * graphPtr->highlightWidth,
- graphPtr->height - 2 * graphPtr->highlightWidth,
- graphPtr->borderWidth, graphPtr->relief);
- }
- /* Draw focus highlight ring. */
- if ((graphPtr->highlightWidth > 0) && (graphPtr->flags & FOCUS)) {
- GC gc;
-
- gc = Tk_GCForColor(graphPtr->highlightColor, drawable);
- Tk_DrawFocusHighlight(graphPtr->tkwin, gc, graphPtr->highlightWidth,
- drawable);
- }
-}
-
-static void
-UpdateMarginTraces(Graph *graphPtr)
-{
- Margin *marginPtr, *endPtr;
-
- for (marginPtr = graphPtr->margins, endPtr = marginPtr + 4;
- marginPtr < endPtr; marginPtr++) {
- if (marginPtr->varName != NULL) { /* Trigger variable traces */
- int size;
-
- if ((marginPtr->site == MARGIN_LEFT) ||
- (marginPtr->site == MARGIN_RIGHT)) {
- size = marginPtr->width;
- } else {
- size = marginPtr->height;
- }
- Tcl_SetVar(graphPtr->interp, marginPtr->varName, Blt_Itoa(size),
- TCL_GLOBAL_ONLY);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayGraph --
- *
- * This procedure is invoked to display a graph widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the graph in its current mode.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayGraph(ClientData clientData)
-{
- Graph *graphPtr = clientData;
- Pixmap drawable;
- Tk_Window tkwin;
- int site;
-
- graphPtr->flags &= ~REDRAW_PENDING;
- if (graphPtr->tkwin == NULL) {
- return; /* Window has been destroyed (we
- * should not get here) */
- }
- tkwin = graphPtr->tkwin;
-#ifdef notdef
- fprintf(stderr, "Calling DisplayGraph(%s)\n", Tk_PathName(tkwin));
-#endif
- if ((Tk_Width(tkwin) <= 1) || (Tk_Height(tkwin) <= 1)) {
- /* Don't bother computing the layout until the size of the window is
- * something reasonable. */
- return;
- }
- graphPtr->width = Tk_Width(tkwin);
- graphPtr->height = Tk_Height(tkwin);
- Blt_MapGraph(graphPtr);
- if (!Tk_IsMapped(tkwin)) {
- /* The graph's window isn't displayed, so don't bother drawing
- * anything. By getting this far, we've at least computed the
- * coordinates of the graph's new layout. */
- return;
- }
- /* Create a pixmap the size of the window for double buffering. */
- if (graphPtr->doubleBuffer) {
- drawable = Tk_GetPixmap(graphPtr->display, Tk_WindowId(tkwin),
- graphPtr->width, graphPtr->height, Tk_Depth(tkwin));
- } else {
- drawable = Tk_WindowId(tkwin);
- }
- if (graphPtr->backingStore) {
- if ((graphPtr->cache == None) ||
- (graphPtr->cacheWidth != graphPtr->width) ||
- (graphPtr->cacheHeight != graphPtr->height)) {
- if (graphPtr->cache != None) {
- Tk_FreePixmap(graphPtr->display, graphPtr->cache);
- }
-
-
- graphPtr->cache = Tk_GetPixmap(graphPtr->display,
- Tk_WindowId(tkwin), graphPtr->width, graphPtr->height,
- Tk_Depth(tkwin));
- graphPtr->cacheWidth = graphPtr->width;
- graphPtr->cacheHeight = graphPtr->height;
- graphPtr->flags |= CACHE_DIRTY;
- }
- }
-#ifdef WIN32
- assert(drawable != None);
-#endif
- if (graphPtr->backingStore) {
- if (graphPtr->flags & CACHE_DIRTY) {
- /* The backing store is new or out-of-date. */
- DrawPlot(graphPtr, graphPtr->cache);
- graphPtr->flags &= ~CACHE_DIRTY;
- }
- /* Copy the pixmap to the one used for drawing the entire graph. */
- XCopyArea(graphPtr->display, graphPtr->cache, drawable,
- graphPtr->drawGC, 0, 0, Tk_Width(graphPtr->tkwin),
- Tk_Height(graphPtr->tkwin), 0, 0);
- } else {
- DrawPlot(graphPtr, drawable);
- }
- /* Draw markers above elements */
- Blt_DrawMarkers(graphPtr, drawable, MARKER_ABOVE);
- Blt_DrawActiveElements(graphPtr, drawable);
- /* Don't draw legend in the plot area. */
- site = Blt_Legend_Site(graphPtr);
- if ((site & LEGEND_PLOTAREA_MASK) && (Blt_Legend_IsRaised(graphPtr))) {
- Blt_DrawLegend(graphPtr, drawable);
- }
- if (site == LEGEND_WINDOW) {
- Blt_Legend_EventuallyRedraw(graphPtr);
- }
- /* Draw 3D border just inside of the focus highlight ring. */
- if ((graphPtr->borderWidth > 0) && (graphPtr->relief != TK_RELIEF_FLAT)) {
- Blt_DrawBackgroundRectangle(graphPtr->tkwin, drawable,
- graphPtr->normalBg, graphPtr->highlightWidth,
- graphPtr->highlightWidth,
- graphPtr->width - 2 * graphPtr->highlightWidth,
- graphPtr->height - 2 * graphPtr->highlightWidth,
- graphPtr->borderWidth, graphPtr->relief);
- }
- /* Draw focus highlight ring. */
- if ((graphPtr->highlightWidth > 0) && (graphPtr->flags & FOCUS)) {
- GC gc;
-
- gc = Tk_GCForColor(graphPtr->highlightColor, drawable);
- Tk_DrawFocusHighlight(graphPtr->tkwin, gc, graphPtr->highlightWidth,
- drawable);
- }
- /* Disable crosshairs before redisplaying to the screen */
- Blt_DisableCrosshairs(graphPtr);
- XCopyArea(graphPtr->display, drawable, Tk_WindowId(tkwin),
- graphPtr->drawGC, 0, 0, graphPtr->width, graphPtr->height, 0, 0);
- Blt_EnableCrosshairs(graphPtr);
- if (graphPtr->doubleBuffer) {
- Tk_FreePixmap(graphPtr->display, drawable);
- }
- graphPtr->flags &= ~RESET_WORLD;
- UpdateMarginTraces(graphPtr);
-}
-
-/*LINTLIBRARY*/
-int
-Blt_GraphCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpecs[] = {
- {"graph", GraphCmd,},
- {"barchart", BarchartCmd,},
- {"stripchart", StripchartCmd,},
- };
- return Blt_InitCmds(interp, "::blt", cmdSpecs, 3);
-}
-
-Graph *
-Blt_GetGraphFromWindowData(Tk_Window tkwin)
-{
- Graph *graphPtr;
-
- while (tkwin != NULL) {
- graphPtr = (Graph *)Blt_GetWindowInstanceData(tkwin);
- if (graphPtr != NULL) {
- return graphPtr;
- }
- tkwin = Tk_Parent(tkwin);
- }
- return NULL;
-}
-
-int
-Blt_GraphType(Graph *graphPtr)
-{
- switch (graphPtr->classId) {
- case CID_ELEM_LINE:
- return GRAPH;
- case CID_ELEM_BAR:
- return BARCHART;
- case CID_ELEM_STRIP:
- return STRIPCHART;
- default:
- return 0;
- }
- return 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ReconfigureGraph --
- *
- * Allocates resources for the graph.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ReconfigureGraph(Graph *graphPtr)
-{
- ConfigureGraph(graphPtr);
- Blt_ConfigureLegend(graphPtr);
- Blt_ConfigureElements(graphPtr);
- Blt_ConfigureAxes(graphPtr);
- Blt_ConfigureMarkers(graphPtr);
-}
diff --git a/blt3.0.1/src/bltGraph.h b/blt3.0.1/src/bltGraph.h
deleted file mode 100644
index 62ab031..0000000
--- a/blt3.0.1/src/bltGraph.h
+++ /dev/null
@@ -1,699 +0,0 @@
-
-/*
- * bltGraph.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_GRAPH_H
-#define _BLT_GRAPH_H
-
-#include "bltInt.h"
-#include "bltHash.h"
-#include "bltBind.h"
-#include "bltChain.h"
-#include "bltPs.h"
-#include "bltBgStyle.h"
-
-typedef struct _Graph Graph;
-typedef struct _Element Element;
-typedef struct _Legend Legend;
-
-typedef enum {
- CID_NONE,
- CID_AXIS_X,
- CID_AXIS_Y,
- CID_ELEM_BAR,
- CID_ELEM_CONTOUR,
- CID_ELEM_LINE,
- CID_ELEM_STRIP,
- CID_MARKER_BITMAP,
- CID_MARKER_IMAGE,
- CID_MARKER_LINE,
- CID_MARKER_POLYGON,
- CID_MARKER_TEXT,
- CID_MARKER_WINDOW,
- CID_LEGEND_ENTRY,
-} ClassId;
-
-typedef struct {
- /* Generic fields common to all graph objects. */
- ClassId classId; /* Class type of object. */
- const char *name; /* Identifier to refer the object. */
- const char *className; /* Class name of object. */
-
- Graph *graphPtr; /* Graph containing of the object. */
-
- const char **tags; /* Binding tags for the object. */
-} GraphObj;
-
-#include "bltGrAxis.h"
-#include "bltGrLegd.h"
-
-#define MARKER_UNDER 1 /* Draw markers designated to lie underneath
- * elements, grids, legend, etc. */
-#define MARKER_ABOVE 0 /* Draw markers designated to rest above
- * elements, grids, legend, etc. */
-
-#define PADX 2 /* Padding between labels/titles */
-#define PADY 2 /* Padding between labels */
-
-#define MINIMUM_MARGIN 20 /* Minimum margin size */
-
-
-#define BOUND(x, lo, hi) \
- (((x) > (hi)) ? (hi) : ((x) < (lo)) ? (lo) : (x))
-
-/*
- *---------------------------------------------------------------------------
- *
- * Graph component structure definitions
- *
- *---------------------------------------------------------------------------
- */
-#define PointInGraph(g,x,y) \
- (((x) <= (g)->right) && ((x) >= (g)->left) && \
- ((y) <= (g)->bottom) && ((y) >= (g)->top))
-
-/*
- * Mask values used to selectively enable GRAPH or BARCHART entries in the
- * various configuration specs.
- */
-#define GRAPH (BLT_CONFIG_USER_BIT << 1)
-#define STRIPCHART (BLT_CONFIG_USER_BIT << 2)
-#define BARCHART (BLT_CONFIG_USER_BIT << 3)
-#define LINE_GRAPHS (GRAPH | STRIPCHART)
-#define ALL_GRAPHS (GRAPH | BARCHART | STRIPCHART)
-
-#define ACTIVE_PEN (BLT_CONFIG_USER_BIT << 16)
-#define NORMAL_PEN (BLT_CONFIG_USER_BIT << 17)
-#define ALL_PENS (NORMAL_PEN | ACTIVE_PEN)
-
-typedef struct {
- Segment2d *segments;
- int length;
- int *map;
-} GraphSegments;
-
-typedef struct {
- Point2d *points;
- int length;
- int *map;
-} GraphPoints;
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * BarGroup --
- *
- * Represents a sets of bars with the same abscissa. This structure is
- * used to track the display of the bars in the group.
- *
- * Each unique abscissa has at least one group. Groups can be
- * defined by the bar element's -group option. Multiple groups are
- * needed when you are displaying/comparing similar sets of data (same
- * abscissas) but belong to a separate group.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- int nSegments; /* Number of occurrences of
- * x-coordinate */
- Axis2d axes; /* The axes associated with this
- * group. (mapped to the x-value) */
- float sum; /* Sum of the ordinates (y-coorinate) of
- * each duplicate abscissa. Used to
- * determine height of stacked bars. */
- int count; /* Current number of bars seen. Used to
- * position of the next bar in the
- * group. */
- float lastY; /* y-cooridinate position of the
- * last bar seen. */
- size_t index; /* Order of group in set (an unique
- * abscissa may have more than one
- * group). */
-} BarGroup;
-
-/*
- *---------------------------------------------------------------------------
- *
- * BarSetKey --
- *
- * Key for hash table of set of bars. The bar set is defined by
- * coordinates with the same abscissa (x-coordinate).
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- float value; /* Duplicated abscissa */
- Axis2d axes; /* Axis mapping of element */
-} BarSetKey;
-
-/*
- * BarModes --
- *
- * Bar elements are displayed according to their x-y coordinates. If two
- * bars have the same abscissa (x-coordinate), the bar segments will be
- * drawn according to one of the following modes:
- */
-
-typedef enum BarModes {
- BARS_INFRONT, /* Each successive bar in a group is
- * drawn in front of the previous. */
- BARS_STACKED, /* Each successive bar in a group is
- * drawn stacked on top of the previous
- * bar. */
- BARS_ALIGNED, /* Each successive bar in a group is
- * drawn aligned side-by-side to the
- * previous from right-to-left. */
- BARS_OVERLAP /* Like "aligned", each successive bar
- * in a group is drawn from
- * right-to-left. The bars will overlap
- * each other by ~50%. */
-} BarMode;
-
-typedef struct _Pen Pen;
-typedef struct _Marker Marker;
-
-typedef Pen *(PenCreateProc)(void);
-typedef int (PenConfigureProc)(Graph *graphPtr, Pen *penPtr);
-typedef void (PenDestroyProc)(Graph *graphPtr, Pen *penPtr);
-
-struct _Pen {
- const char *name; /* Pen style identifier. If NULL pen
- * was statically allocated. */
- ClassId classId; /* Type element using this pen. */
- const char *typeId; /* String token identifying the type of
- * pen. */
- unsigned int flags; /* Indicates if the pen element is
- * active or normal. */
- int refCount; /* Reference count for elements using
- * this pen. */
- Blt_HashEntry *hashPtr;
-
- Blt_ConfigSpec *configSpecs; /* Configuration specifications */
-
- PenConfigureProc *configProc;
- PenDestroyProc *destroyProc;
- Graph *graphPtr; /* Graph that the pen is associated
- * with. */
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * Crosshairs
- *
- * Contains the line segments positions and graphics context used to
- * simulate crosshairs (by XOR-ing) on the graph.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct _Crosshairs Crosshairs;
-
-typedef struct {
- short int width, height; /* Dimensions of the margin */
- short int axesOffset;
- short int axesTitleLength; /* Width of the widest title to be
- * shown. Multiple titles are displayed
- * in another margin. This is the
- * minimum space requirement. */
- short int maxTickWidth;
- short int maxTickHeight;
- unsigned int nAxes; /* # of axes to be displayed */
- Blt_Chain axes; /* Axes associated with this margin */
- const char *varName; /* If non-NULL, name of variable to be
- * updated when the margin size
- * changes */
- int reqSize; /* Requested size of margin */
- int site; /* Indicates where margin is located:
- * left, right, top, or bottom. */
-} Margin;
-
-#define MARGIN_NONE -1
-#define MARGIN_BOTTOM 0 /* x */
-#define MARGIN_LEFT 1 /* y */
-#define MARGIN_TOP 2 /* x2 */
-#define MARGIN_RIGHT 3 /* y2 */
-
-#define rightMargin margins[MARGIN_RIGHT]
-#define leftMargin margins[MARGIN_LEFT]
-#define topMargin margins[MARGIN_TOP]
-#define bottomMargin margins[MARGIN_BOTTOM]
-
-/*
- *---------------------------------------------------------------------------
- *
- * Graph --
- *
- * Top level structure containing everything pertaining to the graph.
- *
- *---------------------------------------------------------------------------
- */
-struct _Graph {
- unsigned int flags; /* Flags; see below for definitions. */
- Tcl_Interp *interp; /* Interpreter associated with graph */
- Tk_Window tkwin; /* Window that embodies the graph.
- * NULL means that the window has been
- * destroyed but the data structures
- * haven't yet been cleaned up. */
- Display *display; /* Display containing widget; used to
- * release resources after tkwin has
- * already gone away. */
- Tcl_Command cmdToken; /* Token for graph's widget command. */
- const char *data; /* This value isn't used in C code.
- * It may be used in TCL bindings to
- * associate extra data. */
- Tk_Cursor cursor;
- int inset; /* Sum of focus highlight and 3-D
- * border. Indicates how far to
- * offset the graph from outside edge
- * of the window. */
- int borderWidth; /* Width of the exterior border */
- int relief; /* Relief of the exterior border. */
- Blt_Background normalBg; /* 3-D border used to delineate the
- * plot surface and outer edge of
- * window. */
- int highlightWidth; /* Width in pixels of highlight to
- * draw around widget when it has the
- * focus. <= 0 means don't draw a
- * highlight. */
- XColor *highlightBgColor; /* Color for drawing traversal
- * highlight area when highlight is
- * off. */
- XColor *highlightColor; /* Color for drawing traversal
- * highlight. */
- const char *title; /* Graph title */
- short int titleX, titleY; /* Position of title on graph. */
- short int titleWidth, titleHeight; /* Dimensions of title. */
- TextStyle titleTextStyle; /* Title attributes: font, color,
- * etc.*/
-
- const char *takeFocus; /* Not used in C code, indicates if
- * widget should be included in focus
- * traversal. */
- Axis *focusPtr; /* The axis that currently has focus. */
-
- int reqWidth, reqHeight; /* Requested size of graph window */
- int reqPlotWidth, reqPlotHeight; /* Requested size of plot area. Zero
- * means to adjust the dimension
- * according to the available space
- * left in the window. */
- int width, height; /* Actual size (in pixels) of graph
- * window or PostScript page. */
- Blt_HashTable penTable; /* Table of pens */
- struct Component {
- Blt_HashTable table; /* Hash table of ids. */
- Blt_Chain displayList; /* Display list. */
- Blt_HashTable tagTable; /* Table of bind tags. */
- } elements, markers, axes;
-
- Blt_HashTable dataTables; /* Hash table of datatable clients. */
- ClassId classId; /* Default element type */
- Blt_BindTable bindTable;
- int nextMarkerId; /* Tracks next marker identifier
- * available */
- Blt_Chain axisChain[4]; /* Chain of axes for each of the
- * margins. They're separate from the
- * margin structures to make it easier
- * to invert the X-Y axes by simply
- * switching chain pointers. */
- Margin margins[4];
- PageSetup *pageSetup; /* Page layout options: see bltGrPS.c */
- Legend *legend; /* Legend information: see
- * bltGrLegd.c */
- Crosshairs *crosshairs; /* Crosshairs information: see
- * bltGrHairs.c */
- int halo; /* Maximum distance allowed between
- * points when searching for a point */
- int inverted; /* If non-zero, indicates the x and y
- * axis positions should be inverted. */
- int stackAxes; /* If non-zero, indicates to stack
- * mulitple axes in a margin, rather
- * than layering them one on top of
- * another. */
- GC drawGC; /* GC for drawing on the margins. This
- * includes the axis lines */
- int plotBW; /* Width of interior 3-D border. */
- int plotRelief; /* 3-d effect: TK_RELIEF_RAISED etc. */
- Blt_Background plotBg; /* Color of plotting surface */
-
- /* If non-zero, force plot to conform to aspect ratio W/H */
- float aspect;
-
- short int left, right; /* Coordinates of plot bbox */
- short int top, bottom;
-
- Blt_Pad xPad; /* Vertical padding for plotarea */
- int vRange, vOffset; /* Vertical axis range and offset from
- * the left side of the graph
- * window. Used to transform coordinates
- * to vertical axes. */
- Blt_Pad yPad; /* Horizontal padding for plotarea */
- int hRange, hOffset; /* Horizontal axis range and offset from
- * the top of the graph window. Used to
- * transform horizontal axes */
- float vScale, hScale;
-
- int doubleBuffer; /* If non-zero, draw the graph into a
- * pixmap first to reduce flashing. */
- int backingStore; /* If non-zero, cache elements by
- * drawing them into a pixmap */
- Pixmap cache; /* Pixmap used to cache elements
- * displayed. If *backingStore* is
- * non-zero, each element is drawn into
- * this pixmap before it is copied onto
- * the screen. The pixmap then acts as
- * a cache (only the pixmap is
- * redisplayed if the none of elements
- * have changed). This is done so that
- * markers can be redrawn quickly over
- * elements without redrawing each
- * element. */
- short int cacheWidth, cacheHeight; /* Size of element backing store
- * pixmap. */
-
- /*
- * barchart specific information
- */
- float baseline; /* Baseline from bar chart. */
- float barWidth; /* Default width of each bar in graph
- * units. The default width is 1.0
- * units. */
- BarMode mode; /* Mode describing how to display bars
- * with the same x-coordinates. Mode can
- * be "stacked", "aligned", "overlap",
- * or "infront" */
- BarGroup *barGroups; /* Contains information about duplicate
- * x-values in bar elements (malloc-ed).
- * This information can also be accessed
- * by the group hash table */
- int nBarGroups; /* # of entries in barGroups array. If
- * zero, indicates nothing special
- * needs to be * done for "stack" or
- * "align" modes */
- Blt_HashTable setTable; /* Table managing sets of bars with
- * the same abscissas. The bars in a
- * set may be displayed is various
- * ways: aligned, overlap, infront, or
- * stacked. */
- int maxBarSetSize;
- const char *dataCmd; /* New data callback? */
-
-};
-
-/*
- * Bit flags definitions:
- *
- * All kinds of state information kept here. All these things happen
- * when the window is available to draw into (DisplayGraph). Need the
- * window width and height before we can calculate graph layout (i.e. the
- * screen coordinates of the axes, elements, titles, etc). But we want to
- * do this only when we have to, not every time the graph is redrawn.
- *
- * Same goes for maintaining a pixmap to double buffer graph elements.
- * Need to mark when the pixmap needs to updated.
- *
- *
- * MAP_ITEM Indicates that the element/marker/axis
- * configuration has changed such that
- * its layout of the item (i.e. its
- * position in the graph window) needs
- * to be recalculated.
- *
- * MAP_ALL Indicates that the layout of the axes and
- * all elements and markers and the graph need
- * to be recalculated. Otherwise, the layout
- * of only those markers and elements that
- * have changed will be reset.
- *
- * GET_AXIS_GEOMETRY Indicates that the size of the axes needs
- * to be recalculated.
- *
- * RESET_AXES Flag to call to Blt_ResetAxes routine.
- * This routine recalculates the scale offset
- * (used for mapping coordinates) of each axis.
- * If an axis limit has changed, then it sets
- * flags to re-layout and redraw the entire
- * graph. This needs to happend before the axis
- * can compute transformations between graph and
- * screen coordinates.
- *
- * LAYOUT_NEEDED
- *
- * CACHE_DIRTY If set, redraw all elements into the pixmap
- * used for buffering elements.
- *
- * REDRAW_PENDING Non-zero means a DoWhenIdle handler has
- * already been queued to redraw this window.
- *
- * DRAW_LEGEND Non-zero means redraw the legend. If this is
- * the only DRAW_* flag, the legend display
- * routine is called instead of the graph
- * display routine.
- *
- * DRAW_MARGINS Indicates that the margins bordering
- * the plotting area need to be redrawn.
- * The possible reasons are:
- *
- * 1) an axis configuration changed
- * 2) an axis limit changed
- * 3) titles have changed
- * 4) window was resized.
- *
- * GRAPH_FOCUS
- */
-
-#define HIDE (1<<0) /* 0x0001 */
-#define DELETE_PENDING (1<<1) /* 0x0002 */
-#define REDRAW_PENDING (1<<2) /* 0x0004 */
-#define ACTIVE_PENDING (1<<3) /* 0x0008 */
-#define MAP_ITEM (1<<4) /* 0x0010 */
-#define DIRTY (1<<5) /* 0x0020 */
-#define ACTIVE (1<<6) /* 0x0040 */
-#define FOCUS (1<<7) /* 0x0080 */
-
-#define MAP_ALL (1<<8) /* 0x0100 */
-#define LAYOUT_NEEDED (1<<9) /* 0x0200 */
-#define RESET_AXES (1<<10)/* 0x0400 */
-#define GET_AXIS_GEOMETRY (1<<11)/* 0x0800 */
-
-#define DRAW_LEGEND (1<<12)/* 0x1000 */
-#define DRAW_MARGINS (1<<13)/* 0x2000 */
-#define CACHE_DIRTY (1<<14)/* 0x4000 */
-#define REQ_BACKING_STORE (1<<15)/* 0x8000 */
-#define UNMAP_HIDDEN (1<<16)
-
-#define MAP_WORLD (MAP_ALL|RESET_AXES|GET_AXIS_GEOMETRY)
-#define REDRAW_WORLD (DRAW_LEGEND)
-#define RESET_WORLD (REDRAW_WORLD | MAP_WORLD)
-
-/*
- * ---------------------- Forward declarations ------------------------
- */
-
-BLT_EXTERN int Blt_CreatePageSetup(Graph *graphPtr);
-
-BLT_EXTERN int Blt_CreateCrosshairs(Graph *graphPtr);
-
-BLT_EXTERN double Blt_InvHMap(Axis *axisPtr, double x);
-
-BLT_EXTERN double Blt_InvVMap(Axis *axisPtr, double x);
-
-BLT_EXTERN double Blt_HMap(Axis *axisPtr, double x);
-
-BLT_EXTERN double Blt_VMap(Axis *axisPtr, double y);
-
-BLT_EXTERN Point2d Blt_InvMap2D(Graph *graphPtr, double x, double y,
- Axis2d *pairPtr);
-
-BLT_EXTERN Point2d Blt_Map2D(Graph *graphPtr, double x, double y,
- Axis2d *pairPtr);
-
-BLT_EXTERN Graph *Blt_GetGraphFromWindowData(Tk_Window tkwin);
-
-BLT_EXTERN void Blt_AdjustAxisPointers(Graph *graphPtr);
-
-BLT_EXTERN int Blt_PolyRectClip(Region2d *extsPtr, Point2d *inputPts,
- int nInputPts, Point2d *outputPts);
-
-BLT_EXTERN void Blt_ComputeBarStacks(Graph *graphPtr);
-
-BLT_EXTERN void Blt_ConfigureCrosshairs(Graph *graphPtr);
-BLT_EXTERN void Blt_ConfigureLegend(Graph *graphPtr);
-BLT_EXTERN void Blt_ConfigureElements(Graph *graphPtr);
-BLT_EXTERN void Blt_ConfigureAxes(Graph *graphPtr);
-BLT_EXTERN void Blt_ConfigureMarkers(Graph *graphPtr);
-BLT_EXTERN void Blt_ReconfigureGraph(Graph *graphPtr);
-
-BLT_EXTERN void Blt_DestroyAxes(Graph *graphPtr);
-
-BLT_EXTERN void Blt_DestroyCrosshairs(Graph *graphPtr);
-
-BLT_EXTERN void Blt_DestroyElements(Graph *graphPtr);
-
-BLT_EXTERN void Blt_DestroyMarkers(Graph *graphPtr);
-
-BLT_EXTERN void Blt_DestroyPageSetup(Graph *graphPtr);
-
-BLT_EXTERN void Blt_DrawAxes(Graph *graphPtr, Drawable drawable);
-
-BLT_EXTERN void Blt_DrawAxisLimits(Graph *graphPtr, Drawable drawable);
-
-BLT_EXTERN void Blt_DrawElements(Graph *graphPtr, Drawable drawable);
-
-BLT_EXTERN void Blt_DrawActiveElements(Graph *graphPtr, Drawable drawable);
-
-BLT_EXTERN void Blt_DrawGraph(Graph *graphPtr, Drawable drawable);
-
-BLT_EXTERN void Blt_DrawMarkers(Graph *graphPtr, Drawable drawable, int under);
-
-BLT_EXTERN void Blt_Draw2DSegments(Display *display, Drawable drawable, GC gc,
- Segment2d *segments, int nSegments);
-
-BLT_EXTERN int Blt_GetCoordinate(Tcl_Interp *interp, const char *string,
- double *valuePtr);
-
-BLT_EXTERN void Blt_InitBarSetTable(Graph *graphPtr);
-
-BLT_EXTERN void Blt_LayoutGraph(Graph *graphPtr);
-
-BLT_EXTERN void Blt_EventuallyRedrawGraph(Graph *graphPtr);
-
-BLT_EXTERN void Blt_ResetAxes(Graph *graphPtr);
-
-BLT_EXTERN void Blt_ResetBarGroups(Graph *graphPtr);
-
-BLT_EXTERN void Blt_GraphExtents(Graph *graphPtr, Region2d *extsPtr);
-
-BLT_EXTERN void Blt_DisableCrosshairs(Graph *graphPtr);
-
-BLT_EXTERN void Blt_EnableCrosshairs(Graph *graphPtr);
-
-BLT_EXTERN void Blt_MapGraph(Graph *graphPtr);
-
-BLT_EXTERN void Blt_MapAxes(Graph *graphPtr);
-
-BLT_EXTERN void Blt_MapElements(Graph *graphPtr);
-
-BLT_EXTERN void Blt_MapMarkers(Graph *graphPtr);
-
-BLT_EXTERN void Blt_UpdateCrosshairs(Graph *graphPtr);
-
-BLT_EXTERN void Blt_DestroyPens(Graph *graphPtr);
-
-BLT_EXTERN int Blt_GetPenFromObj(Tcl_Interp *interp, Graph *graphPtr,
- Tcl_Obj *objPtr, ClassId classId, Pen **penPtrPtr);
-
-BLT_EXTERN Pen *Blt_BarPen(const char *penName);
-
-BLT_EXTERN Pen *Blt_LinePen(const char *penName);
-
-BLT_EXTERN Pen *Blt_CreatePen(Graph *graphPtr, const char *penName,
- ClassId classId, int objc, Tcl_Obj *const *objv);
-
-BLT_EXTERN int Blt_InitLinePens(Graph *graphPtr);
-
-BLT_EXTERN int Blt_InitBarPens(Graph *graphPtr);
-
-BLT_EXTERN void Blt_FreePen(Pen *penPtr);
-
-BLT_EXTERN int Blt_VirtualAxisOp(Graph *graphPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-
-BLT_EXTERN int Blt_AxisOp(Tcl_Interp *interp, Graph *graphPtr, int margin,
- int objc, Tcl_Obj *const *objv);
-
-BLT_EXTERN int Blt_ElementOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv, ClassId classId);
-
-BLT_EXTERN int Blt_CrosshairsOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-BLT_EXTERN int Blt_MarkerOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-BLT_EXTERN int Blt_PenOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-BLT_EXTERN int Blt_PointInPolygon(Point2d *samplePtr, Point2d *screenPts,
- int nScreenPts);
-
-BLT_EXTERN int Blt_RegionInPolygon(Region2d *extsPtr, Point2d *points,
- int nPoints, int enclosed);
-
-BLT_EXTERN int Blt_PointInSegments(Point2d *samplePtr, Segment2d *segments,
- int nSegments, double halo);
-
-BLT_EXTERN int Blt_PostScriptOp(Graph *graphPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-BLT_EXTERN int Blt_GraphUpdateNeeded(Graph *graphPtr);
-
-BLT_EXTERN int Blt_DefaultAxes(Graph *graphPtr);
-
-BLT_EXTERN Axis *Blt_GetFirstAxis(Blt_Chain chain);
-
-BLT_EXTERN void Blt_UpdateAxisBackgrounds(Graph *graphPtr);
-
-BLT_EXTERN Marker *Blt_NearestMarker(Graph *graphPtr, int x, int y, int under);
-
-BLT_EXTERN Axis *Blt_NearestAxis(Graph *graphPtr, int x, int y);
-
-typedef ClientData (MakeTagProc)(Graph *graphPtr, const char *tagName);
-
-BLT_EXTERN MakeTagProc Blt_MakeElementTag;
-BLT_EXTERN MakeTagProc Blt_MakeMarkerTag;
-BLT_EXTERN MakeTagProc Blt_MakeAxisTag;
-BLT_EXTERN Blt_BindTagProc Blt_GraphTags;
-BLT_EXTERN Blt_BindTagProc Blt_AxisTags;
-
-BLT_EXTERN int Blt_GraphType(Graph *graphPtr);
-
-BLT_EXTERN void Blt_UpdateGraph(ClientData clientData);
-
-BLT_EXTERN void Blt_GraphSetObjectClass(GraphObj *graphObjPtr,ClassId classId);
-
-BLT_EXTERN void Blt_MarkersToPostScript(Graph *graphPtr, Blt_Ps ps, int under);
-BLT_EXTERN void Blt_ElementsToPostScript(Graph *graphPtr, Blt_Ps ps);
-BLT_EXTERN void Blt_ActiveElementsToPostScript(Graph *graphPtr, Blt_Ps ps);
-BLT_EXTERN void Blt_LegendToPostScript(Graph *graphPtr, Blt_Ps ps);
-BLT_EXTERN void Blt_AxesToPostScript(Graph *graphPtr, Blt_Ps ps);
-BLT_EXTERN void Blt_AxisLimitsToPostScript(Graph *graphPtr, Blt_Ps ps);
-
-BLT_EXTERN Element *Blt_LineElement(Graph *graphPtr, const char *name,
- ClassId classId);
-BLT_EXTERN Element *Blt_BarElement(Graph *graphPtr, const char *name,
- ClassId classId);
-
-BLT_EXTERN void Blt_DrawGrids(Graph *graphPtr, Drawable drawable);
-
-BLT_EXTERN void Blt_GridsToPostScript(Graph *graphPtr, Blt_Ps ps);
-BLT_EXTERN void Blt_InitBarSetTable(Graph *graphPtr);
-BLT_EXTERN void Blt_DestroyBarSets(Graph *graphPtr);
-
-/* ---------------------- Global declarations ------------------------ */
-
-BLT_EXTERN const char *Blt_GraphClassName(ClassId classId);
-
-#endif /* _BLT_GRAPH_H */
diff --git a/blt3.0.1/src/bltHash.c b/blt3.0.1/src/bltHash.c
deleted file mode 100644
index 06d27a5..0000000
--- a/blt3.0.1/src/bltHash.c
+++ /dev/null
@@ -1,1281 +0,0 @@
-
-/*
- * bltHash.c --
- *
- * This module implements an in-memory hash table for the BLT toolkit. Built
- * upon the TCL hash table, it adds pool allocation 64-bit address handling,
- * improved array hash function.
- *
- * Copyright 2001 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Both the MIX32 and MIX64 routine are from Bob Jenkins.
- *
- * Bob Jenkins, 1996. hash.c. Public Domain.
- * Bob Jenkins, 1997. lookup8.c. Public Domain.
- *
- * The hash table implementation is base upon the one in the Tcl distribution.
- *
- * Copyright (c) 1991-1993 The Regents of the University of
- * California.
- *
- * Copyright (c) 1994 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and
- * redistribution of this file, and for a DISCLAIMER OF ALL
- * WARRANTIES.
- *
- */
-
-#include <bltInt.h>
-
-#include <stdio.h>
-#include <string.h>
-/* The following header is required for LP64 compilation */
-#include <stdlib.h>
-
-#include "bltHash.h"
-
-/*
- * When there are this many entries per bucket, on average, rebuild the hash
- * table to make it larger.
- */
-
-#define REBUILD_MULTIPLIER 3
-
-#if (SIZEOF_VOID_P == 8)
-#define RANDOM_INDEX HashOneWord
-#define DOWNSHIFT_START 62
-static Blt_Hash HashOneWord(Blt_HashTable *tablePtr, const void *key);
-#else
-
-/*
- * The following macro takes a preliminary integer hash value and produces an
- * index into a hash tables bucket list. The idea is to make it so that
- * preliminary values that are arbitrarily similar will end up in different
- * buckets. The hash function was taken from a random-number generator.
- */
-#define RANDOM_INDEX(tablePtr, i) \
- (((((long) (i))*1103515245) >> (tablePtr)->downShift) & (tablePtr)->mask)
-#define DOWNSHIFT_START 28
-#endif
-
-/*
- * Procedure prototypes for static procedures in this file:
- */
-static Blt_Hash HashArray(const void *key, size_t length);
-static Blt_HashEntry *ArrayFind(Blt_HashTable *tablePtr, const void *key);
-static Blt_HashEntry *ArrayCreate(Blt_HashTable *tablePtr, const void *key,
- int *isNewPtr);
-static Blt_HashEntry *BogusFind(Blt_HashTable *tablePtr, const void *key);
-static Blt_HashEntry *BogusCreate(Blt_HashTable *tablePtr, const void *key,
- int *isNewPtr);
-static Blt_Hash HashString(const char *string);
-static void RebuildTable(Blt_HashTable *tablePtr);
-static Blt_HashEntry *StringFind(Blt_HashTable *tablePtr, const void *key);
-static Blt_HashEntry *StringCreate(Blt_HashTable *tablePtr, const void *key,
- int *isNewPtr);
-static Blt_HashEntry *OneWordFind(Blt_HashTable *tablePtr, const void *key);
-static Blt_HashEntry *OneWordCreate(Blt_HashTable *tablePtr, const void *key,
- int *isNewPtr);
-
-/*
- *---------------------------------------------------------------------------
- *
- * HashString --
- *
- * Compute a one-word summary of a text string, which can be used to
- * generate a hash index.
- *
- * Results:
- * The return value is a one-word summary of the information in string.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Hash
-HashString(const char *string) /* String from which to compute hash
- * value. */
-{
- Blt_Hash result;
- Blt_Hash c;
-
- /*
- * I tried a zillion different hash functions and asked many other
- * people for advice. Many people had their own favorite functions,
- * all different, but no-one had much idea why they were good ones.
- * I chose the one below (multiply by 9 and add new character)
- * because of the following reasons:
- *
- * 1. Multiplying by 10 is perfect for keys that are decimal strings,
- * and multiplying by 9 is just about as good.
- * 2. Times-9 is (shift-left-3) plus (old). This means that each
- * character's bits hang around in the low-order bits of the
- * hash value for ever, plus they spread fairly rapidly up to
- * the high-order bits to fill out the hash value. This seems
- * to work well both for decimal and non-decimal strings.
- */
-
- result = 0;
- while ((c = *string++) != 0) {
- result += (result << 3) + c;
- }
- return (Blt_Hash)result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StringFind --
- *
- * Given a hash table with string keys, and a string key, find the entry
- * with a matching key.
- *
- * Results:
- * The return value is a token for the matching entry in the hash table,
- * or NULL if there was no matching entry.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_HashEntry *
-StringFind(
- Blt_HashTable *tablePtr, /* Table in which to lookup entry. */
- const void *key) /* Key to find matching entry. */
-{
- Blt_Hash hval;
- Blt_HashEntry *hPtr;
- size_t hindex;
-
- hval = HashString((const char *)key);
- hindex = hval & tablePtr->mask;
-
- /*
- * Search all of the entries in the appropriate bucket.
- */
- for (hPtr = tablePtr->buckets[hindex]; hPtr != NULL; hPtr = hPtr->nextPtr) {
- if (hPtr->hval == hval) {
- const char *p1, *p2;
-
- for (p1 = key, p2 = hPtr->key.string; ; p1++, p2++) {
- if (*p1 != *p2) {
- break;
- }
- if (*p1 == '\0') {
- return hPtr;
- }
- }
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StringCreate --
- *
- * Given a hash table with string keys, and a string key, find the entry
- * with a matching key. If there is no matching entry, then create a new
- * entry that does match.
- *
- * Results:
- * The return value is a pointer to the matching entry. If this is a
- * newly-created entry, then *isNewPtr will be set to a non-zero value;
- * otherwise *isNewPtr will be set to 0. If this is a new entry the
- * value stored in the entry will initially be 0.
- *
- * Side effects:
- * A new entry may be added to the hash table.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_HashEntry *
-StringCreate(
- Blt_HashTable *tablePtr, /* Table in which to lookup entry. */
- const void *key, /* Key to use to find or create
- * matching entry. */
- int *isNewPtr) /* Store info here telling whether a
- * new entry was created. */
-{
- Blt_Hash hval;
- Blt_HashEntry **bucketPtr;
- Blt_HashEntry *hPtr;
- size_t size, hindex;
-
- hval = HashString(key);
- hindex = hval & tablePtr->mask;
-
- /* Search all of the entries in this bucket. */
-
- for (hPtr = tablePtr->buckets[hindex]; hPtr != NULL;
- hPtr = hPtr->nextPtr) {
- if (hPtr->hval == hval) {
- const char *p1, *p2;
-
- for (p1 = key, p2 = hPtr->key.string; ; p1++, p2++) {
- if (*p1 != *p2) {
- break;
- }
- if (*p1 == '\0') {
- *isNewPtr = FALSE;
- return hPtr;
- }
- }
- }
- }
-
- /* Entry not found. Add a new one to the bucket. */
-
- *isNewPtr = TRUE;
- size = sizeof(Blt_HashEntry) + strlen(key) - sizeof(Blt_HashKey) + 1;
- if (tablePtr->hPool != NULL) {
- hPtr = Blt_PoolAllocItem(tablePtr->hPool, size);
- } else {
- hPtr = Blt_AssertMalloc(size);
- }
- bucketPtr = tablePtr->buckets + hindex;
- hPtr->nextPtr = *bucketPtr;
- hPtr->hval = hval;
- hPtr->clientData = 0;
- strcpy(hPtr->key.string, key);
- *bucketPtr = hPtr;
- tablePtr->numEntries++;
-
- /*
- * If the table has exceeded a decent size, rebuild it with many more
- * buckets.
- */
-
- if (tablePtr->numEntries >= tablePtr->rebuildSize) {
- RebuildTable(tablePtr);
- }
- return hPtr;
-}
-
-#if (SIZEOF_VOID_P == 8)
-/*
- *---------------------------------------------------------------------------
- *
- * HashOneWord --
- *
- * Compute a one-word hash value of a 64-bit word, which then can be used
- * to generate a hash index.
- *
- * From Knuth, it's a multiplicative hash. Multiplies an unsigned 64-bit
- * value with the golden ratio (sqrt(5) - 1) / 2. The downshift value is
- * 64 - n, where n is the log2 of the size of the hash table.
- *
- * Results:
- * The return value is a one-word summary of the information in 64 bit
- * word.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Hash
-HashOneWord(
- Blt_HashTable *tablePtr,
- const void *key)
-{
- uint64_t a0, a1;
- uint64_t y0, y1;
- uint64_t y2, y3;
- uint64_t p1, p2;
- uint64_t result;
- /* Compute key * GOLDEN_RATIO in 128-bit arithmetic */
- a0 = (uint64_t)key & 0x00000000FFFFFFFF;
- a1 = (uint64_t)key >> 32;
-
- y0 = a0 * 0x000000007f4a7c13;
- y1 = a0 * 0x000000009e3779b9;
- y2 = a1 * 0x000000007f4a7c13;
- y3 = a1 * 0x000000009e3779b9;
- y1 += y0 >> 32; /* Can't carry */
- y1 += y2; /* Might carry */
- if (y1 < y2) {
- y3 += (1LL << 32); /* Propagate */
- }
-
- /* 128-bit product: p1 = loword, p2 = hiword */
- p1 = ((y1 & 0x00000000FFFFFFFF) << 32) + (y0 & 0x00000000FFFFFFFF);
- p2 = y3 + (y1 >> 32);
-
- /* Left shift the value downward by the size of the table */
- if (tablePtr->downShift > 0) {
- if (tablePtr->downShift < 64) {
- result = ((p2 << (64 - tablePtr->downShift)) |
- (p1 >> (tablePtr->downShift & 63)));
- } else {
- result = p2 >> (tablePtr->downShift & 63);
- }
- } else {
- result = p1;
- }
- /* Finally mask off the high bits */
- return (Blt_Hash)(result & tablePtr->mask);
-}
-
-#endif /* SIZEOF_VOID_P == 8 */
-
-/*
- *---------------------------------------------------------------------------
- *
- * OneWordFind --
- *
- * Given a hash table with one-word keys, and a one-word key, find the
- * entry with a matching key.
- *
- * Results:
- * The return value is a token for the matching entry in the hash table,
- * or NULL if there was no matching entry.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_HashEntry *
-OneWordFind(
- Blt_HashTable *tablePtr, /* Table where to lookup entry. */
- const void *key) /* Key that we're searching for. */
-{
- Blt_HashEntry *hPtr;
- size_t hindex;
-
- hindex = RANDOM_INDEX(tablePtr, key);
-
- /* Search all of the entries in the appropriate bucket. */
- for (hPtr = tablePtr->buckets[hindex]; hPtr != NULL;
- hPtr = hPtr->nextPtr) {
- if (hPtr->key.oneWordValue == key) {
- return hPtr;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OneWordCreate --
- *
- * Given a hash table with one-word keys, and a one-word key, find the
- * entry with a matching key. If there is no matching entry, then create
- * a new entry that does match.
- *
- * Results:
- * The return value is a pointer to the matching entry. If this is a
- * newly-created entry, then *isNewPtr will be set to a non-zero value;
- * otherwise *isNewPtr will be set to 0. If this is a new entry the value
- * stored in the entry will initially be 0.
- *
- * Side effects:
- * A new entry may be added to the hash table.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_HashEntry *
-OneWordCreate(
- Blt_HashTable *tablePtr, /* Table in which to lookup entry. */
- const void *key, /* Key to use to find or create
- * matching entry. */
- int *isNewPtr) /* Store info here telling whether a
- * new entry was created. */
-{
- Blt_HashEntry **bucketPtr;
- Blt_HashEntry *hPtr;
- size_t hindex;
-
- hindex = RANDOM_INDEX(tablePtr, key);
-
- /* Search all of the entries in this bucket. */
-
- for (hPtr = tablePtr->buckets[hindex]; hPtr != NULL; hPtr = hPtr->nextPtr) {
- if (hPtr->key.oneWordValue == key) {
- *isNewPtr = FALSE;
- return hPtr;
- }
- }
-
- /* Entry not found. Add a new one to the bucket. */
-
- *isNewPtr = TRUE;
- if (tablePtr->hPool != NULL) {
- hPtr = Blt_PoolAllocItem(tablePtr->hPool, sizeof(Blt_HashEntry));
- } else {
- hPtr = Blt_AssertMalloc(sizeof(Blt_HashEntry));
- }
- bucketPtr = tablePtr->buckets + hindex;
- hPtr->nextPtr = *bucketPtr;
- hPtr->hval = (Blt_Hash)key;
- hPtr->clientData = 0;
- hPtr->key.oneWordValue = (void *)key; /* const XXXX */
- *bucketPtr = hPtr;
- tablePtr->numEntries++;
-
- /*
- * If the table has exceeded a decent size, rebuild it with many more
- * buckets.
- */
-
- if (tablePtr->numEntries >= tablePtr->rebuildSize) {
- RebuildTable(tablePtr);
- }
- return hPtr;
-}
-
-
-#if (SIZEOF_VOID_P == 4)
-/*
- *---------------------------------------------------------------------------
- *
- * MIX32 --
- *
- * Bob Jenkins, 1996. Public Domain.
- *
- * Mix 3 32/64-bit values reversibly. For every delta with one or two
- * bit set, and the deltas of all three high bits or all three low bits,
- * whether the original value of a,b,c is almost all zero or is uniformly
- * distributed, If mix() is run forward or backward, at least 32 bits in
- * a,b,c have at least 1/4 probability of changing. * If mix() is run
- * forward, every bit of c will change between 1/3 and 2/3 of the time.
- * (Well, 22/100 and 78/100 for some 2-bit deltas.) mix() was built out
- * of 36 single-cycle latency instructions in a structure that could
- * supported 2x parallelism, like so:
- *
- * a -= b;
- * a -= c; x = (c>>13);
- * b -= c; a ^= x;
- * b -= a; x = (a<<8);
- * c -= a; b ^= x;
- * c -= b; x = (b>>13);
- * ...
- *
- * Unfortunately, superscalar Pentiums and Sparcs can't take advantage
- * of that parallelism. They've also turned some of those single-cycle
- * latency instructions into multi-cycle latency instructions. Still,
- * this is the fastest good hash I could find. There were about 2^^68
- * to choose from. I only looked at a billion or so.
- *
- * --------------------------------------------------------------------------
- */
-#define MIX32(a,b,c) \
- a -= b, a -= c, a ^= (c >> 13), \
- b -= c, b -= a, b ^= (a << 8), \
- c -= a, c -= b, c ^= (b >> 13), \
- a -= b, a -= c, a ^= (c >> 12), \
- b -= c, b -= a, b ^= (a << 16), \
- c -= a, c -= b, c ^= (b >> 5), \
- a -= b, a -= c, a ^= (c >> 3), \
- b -= c, b -= a, b ^= (a << 10), \
- c -= a, c -= b, c ^= (b >> 15)
-
-#define GOLDEN_RATIO32 0x9e3779b9 /* An arbitrary value */
-
-/*
- *---------------------------------------------------------------------------
- *
- * HashArray --
- *
- * Bob Jenkins, 1996. Public Domain.
- *
- * This works on all machines. Length has to be measured in unsigned
- * longs instead of bytes. It requires that
- *
- * o The key be an array of unsigned ints.
- * o All your machines have the same endianness
- * o The length be the number of unsigned ints in the key.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Hash
-HashArray(const void *key, size_t length)
-{
- uint32_t a, b, c, len;
- uint32_t *arrayPtr = (uint32_t *)key;
- /* Set up the internal state */
- len = length;
- a = b = GOLDEN_RATIO32; /* An arbitrary value */
- c = 0; /* Previous hash value */
-
- while (len >= 3) { /* Handle most of the key */
- a += arrayPtr[0];
- b += arrayPtr[1];
- c += arrayPtr[2];
- MIX32(a, b, c);
- arrayPtr += 3; len -= 3;
- }
- c += length;
- /* And now the last 2 words */
- /* Note that all the case statements fall through */
- switch(len) {
- /* c is reserved for the length */
- case 2 : b += arrayPtr[1];
- case 1 : a += arrayPtr[0];
- /* case 0: nothing left to add */
- }
- MIX32(a, b, c);
- return (Blt_Hash)c;
-}
-#endif /* SIZEOF_VOID_P == 4 */
-
-#if (SIZEOF_VOID_P == 8)
-
-/*
- *---------------------------------------------------------------------------
- *
- * MIX64 --
- *
- * Bob Jenkins, January 4 1997, Public Domain. You can use this free for
- * any purpose. It has no warranty.
- *
- * Returns a 64-bit value. Every bit of the key affects every bit of the
- * return value. No funnels. Every 1-bit and 2-bit delta achieves
- * avalanche. About 41+5len instructions.
- *
- * The best hash table sizes are powers of 2. There is no need to do mod
- * a prime (mod is sooo slow!). If you need less than 64 bits, use a
- * bitmask. For example, if you need only 10 bits, do h = (h &
- * hashmask(10)); In which case, the hash table should have hashsize(10)
- * elements.
- *
- * By Bob Jenkins, Jan 4 1997. bob_jenkins at burtleburtle.net. You may
- * use this code any way you wish, private, educational, or commercial,
- * as long as this whole comment accompanies it.
- *
- * See http://burtleburtle.net/bob/hash/evahash.html Use for hash table
- * lookup, or anything where one collision in 2^^64 * is acceptable. Do
- * NOT use for cryptographic purposes.
- *
- *---------------------------------------------------------------------------
- */
-
-#define MIX64(a,b,c) \
- a -= b, a -= c, a ^= (c >> 43), \
- b -= c, b -= a, b ^= (a << 9), \
- c -= a, c -= b, c ^= (b >> 8), \
- a -= b, a -= c, a ^= (c >> 38), \
- b -= c, b -= a, b ^= (a << 23), \
- c -= a, c -= b, c ^= (b >> 5), \
- a -= b, a -= c, a ^= (c >> 35), \
- b -= c, b -= a, b ^= (a << 49), \
- c -= a, c -= b, c ^= (b >> 11), \
- a -= b, a -= c, a ^= (c >> 12), \
- b -= c, b -= a, b ^= (a << 18), \
- c -= a, c -= b, c ^= (b >> 22)
-
-#define GOLDEN_RATIO64 0x9e3779b97f4a7c13LL
-
-/*
- *---------------------------------------------------------------------------
- *
- * HashArray --
- *
- * Bob Jenkins, January 4 1997, Public Domain. You can use this free for
- * any purpose. It has no warranty.
- *
- * This works on all machines. The length has to be measured in 64 bit
- * words, instead of bytes. It requires that
- *
- * o The key be an array of 64 bit words (unsigned longs).
- * o All your machines have the same endianness.
- * o The length be the number of 64 bit words in the key.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Hash
-HashArray(const void *key, size_t length)
-{
- uint64_t a, b, c, len;
- uint32_t *ip = (uint32_t *)key;
-
-#ifdef WORDS_BIGENDIAN
-#define PACK(a,b) ((uint64_t)(b) | ((uint64_t)(a) << 32))
-#else
-#define PACK(a,b) ((uint64_t)(a) | ((uint64_t)(b) << 32))
-#endif
- /* Set up the internal state */
- len = length; /* Length is the number of 64-bit
- * words. */
- a = b = GOLDEN_RATIO64; /* An arbitrary value */
- c = 0; /* Previous hash value */
-
- while (len >= 6) { /* Handle most of the key */
- a += PACK(ip[0], ip[1]);
- b += PACK(ip[2], ip[3]);
- c += PACK(ip[4], ip[5]);
- MIX64(a,b,c);
- ip += 6; len -= 6;
- }
- c += length;
- /* And now the last 2 words */
- /* Note that all the case statements fall through */
- switch(len) {
- /* c is reserved for the length */
- case 5 :
- case 4 :
- a += PACK(ip[0], ip[1]);
- b += PACK(ip[2], ip[3]);
- ip += 4; len -= 4;
- break;
- case 3 :
- case 2 :
- a += PACK(ip[0], ip[1]);
- ip += 2; len -= 2;
- /* case 0: nothing left to add */
- }
- if (len > 0) {
- b += ip[0];
- }
- MIX64(a,b,c);
- return (Blt_Hash)c;
-}
-#endif /* SIZEOF_VOID_P == 8 */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ArrayFind --
- *
- * Given a hash table with array-of-int keys, and a key, find the entry
- * with a matching key.
- *
- * Results:
- * The return value is a token for the matching entry in the hash table,
- * or NULL if there was no matching entry.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_HashEntry *
-ArrayFind(
- Blt_HashTable *tablePtr, /* Table in which to lookup entry. */
- const void *key) /* Key to use to find matching entry. */
-{
- Blt_Hash hval;
- Blt_HashEntry *hPtr;
- size_t hindex;
-
- hval = HashArray(key, tablePtr->keyType);
- hindex = hval & tablePtr->mask;
-
- /* Search all of the entries in the appropriate bucket. */
- for (hPtr = tablePtr->buckets[hindex]; hPtr != NULL;
- hPtr = hPtr->nextPtr) {
- if (hPtr->hval == hval) {
- uint32_t *ip1, *ip2;
- size_t count;
-
- for (ip1 = (uint32_t *)key, ip2 = (uint32_t *)hPtr->key.words,
- count = tablePtr->keyType; ; count--, ip1++, ip2++) {
- if (count == 0) {
- return hPtr;
- }
- if (*ip1 != *ip2) {
- break;
- }
- }
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ArrayCreate --
- *
- * Given a hash table with one-word keys, and a one-word key, find the
- * entry with a matching key. If there is no matching entry, then create a
- * new entry that does match.
- *
- * Results:
- * The return value is a pointer to the matching entry. If this is a
- * newly-created entry, then *isNewPtr will be set to a non-zero value;
- * otherwise *isNewPtr will be set to 0. If this is a new entry the value
- * stored in the entry will initially be 0.
- *
- * Side effects:
- * A new entry may be added to the hash table.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_HashEntry *
-ArrayCreate(
- Blt_HashTable *tablePtr, /* Table in which to lookup entry. */
- const void *key, /* Key to use to find or create
- * matching entry. */
- int *isNewPtr) /* Store info here telling whether a
- * new entry was created. */
-{
- Blt_Hash hval;
- Blt_HashEntry **bucketPtr;
- size_t count;
- Blt_HashEntry *hPtr;
- uint32_t *ip1, *ip2;
- size_t size, hindex;
-
- hval = HashArray(key, tablePtr->keyType);
- hindex = hval & tablePtr->mask;
-
- /* Search all of the entries in the appropriate bucket. */
-
- for (hPtr = tablePtr->buckets[hindex]; hPtr != NULL;
- hPtr = hPtr->nextPtr) {
- if (hPtr->hval == hval) {
- for (ip1 = (uint32_t *)key, ip2 = (uint32_t *)hPtr->key.words,
- count = tablePtr->keyType; ; count--, ip1++, ip2++) {
- if (count == 0) {
- *isNewPtr = FALSE;
- return hPtr;
- }
- if (*ip1 != *ip2) {
- break;
- }
- }
- }
- }
-
- /* Entry not found. Add a new one to the bucket. */
-
- *isNewPtr = TRUE;
- /* We assume here that the size of the key is at least 2 words */
- size = sizeof(Blt_HashEntry) + tablePtr->keyType * sizeof(uint32_t) -
- sizeof(Blt_HashKey);
- if (tablePtr->hPool != NULL) {
- hPtr = Blt_PoolAllocItem(tablePtr->hPool, size);
- } else {
- hPtr = Blt_AssertMalloc(size);
- }
- bucketPtr = tablePtr->buckets + hindex;
- hPtr->nextPtr = *bucketPtr;
- hPtr->hval = hval;
- hPtr->clientData = 0;
- count = tablePtr->keyType;
- for (ip1 = (uint32_t *)key, ip2 = (uint32_t *)hPtr->key.words;
- count > 0; count--, ip1++, ip2++) {
- *ip2 = *ip1;
- }
- *bucketPtr = hPtr;
- tablePtr->numEntries++;
-
- /*
- * If the table has exceeded a decent size, rebuild it with many more
- * buckets.
- */
- if (tablePtr->numEntries >= tablePtr->rebuildSize) {
- RebuildTable(tablePtr);
- }
- return hPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BogusFind --
- *
- * This procedure is invoked when an Blt_FindHashEntry is called on a
- * table that has been deleted.
- *
- * Results:
- * If panic returns (which it shouldn't) this procedure returns NULL.
- *
- * Side effects:
- * Generates a panic.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static Blt_HashEntry *
-BogusFind(
- Blt_HashTable *tablePtr, /* Not used. */
- const void *key) /* Not used.*/
-{
- Blt_Panic("called Blt_FindHashEntry on deleted table");
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BogusCreate --
- *
- * This procedure is invoked when an Blt_CreateHashEntry is called on a
- * table that has been deleted.
- *
- * Results:
- * If panic returns (which it shouldn't) this procedure returns NULL.
- *
- * Side effects:
- * Generates a panic.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static Blt_HashEntry *
-BogusCreate(
- Blt_HashTable *tablePtr, /* Not used. */
- const void *key, /* Not used. */
- int *isNewPtr) /* Not used. */
-{
- Blt_Panic("called Blt_CreateHashEntry on deleted table");
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RebuildTable --
- *
- * This procedure is invoked when the ratio of entries to hash buckets
- * becomes too large. It creates a new table with a larger bucket array
- * and moves all of the entries into the new table.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory gets reallocated and entries get re-hashed to new buckets.
- *
- *---------------------------------------------------------------------------
- */
-static void
-RebuildTable(Blt_HashTable *tablePtr) /* Table to enlarge. */
-{
- Blt_HashEntry **oldBuckets;
- int oldNumBuckets;
-
- oldBuckets = tablePtr->buckets;
- oldNumBuckets = tablePtr->numBuckets;
- /*
- * Allocate and initialize the new bucket array, and set up hashing
- * constants for new array size.
- */
- tablePtr->numBuckets <<= 2;
- tablePtr->buckets = Blt_AssertCalloc(tablePtr->numBuckets,
- sizeof(Blt_HashEntry *));
- tablePtr->rebuildSize <<= 2;
- tablePtr->downShift -= 2;
- tablePtr->mask = tablePtr->numBuckets - 1;
-
- /*
- * Move all of the existing entries into the new bucket array, based on
- * their hash values.
- */
- if (tablePtr->keyType == BLT_ONE_WORD_KEYS) {
- Blt_HashEntry **hpp, **hend;
-
- /*
- * BLT_ONE_WORD_KEYS are handled slightly differently because they use
- * the current table size (number of buckets) to distribute the entries.
- */
- for (hpp = oldBuckets, hend = hpp + oldNumBuckets; hpp < hend; hpp++) {
- Blt_HashEntry *hPtr, *nextPtr;
-
- for (hPtr = *hpp; hPtr != NULL; hPtr = nextPtr) {
- Blt_HashEntry **bucketPtr;
- size_t hindex;
-
- nextPtr = hPtr->nextPtr;
- hindex = RANDOM_INDEX(tablePtr, hPtr->key.oneWordValue);
- bucketPtr = tablePtr->buckets + hindex;
- hPtr->nextPtr = *bucketPtr;
- *bucketPtr = hPtr;
- }
- }
- } else {
- Blt_HashEntry **hpp, **hend;
-
- for (hpp = oldBuckets, hend = hpp + oldNumBuckets; hpp < hend; hpp++) {
- Blt_HashEntry *hPtr, *nextPtr;
-
- for (hPtr = *hpp; hPtr != NULL; hPtr = nextPtr) {
- Blt_HashEntry **bucketPtr;
- size_t hindex;
-
- nextPtr = hPtr->nextPtr;
- hindex = hPtr->hval & tablePtr->mask;
- bucketPtr = tablePtr->buckets + hindex;
- hPtr->nextPtr = *bucketPtr;
- *bucketPtr = hPtr;
- }
- }
- }
-
- /*
- * Free up the old bucket array, if it was dynamically allocated.
- */
- if (oldBuckets != tablePtr->staticBuckets) {
- Blt_Free(oldBuckets);
- }
-}
-
-
-/* Public hash table routines */
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_InitHashTable --
- *
- * Given storage for a hash table, set up the fields to prepare the hash
- * table for use.
- *
- * Results:
- * None.
- *
- * Side effects:
- * TablePtr is now ready to be passed to Blt_FindHashEntry and
- * Blt_CreateHashEntry.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_InitHashTable(Blt_HashTable *tablePtr, size_t keyType)
-{
-#if (BLT_SMALL_HASH_TABLE != 4)
- Blt_Panic("Blt_InitHashTable: BLT_SMALL_HASH_TABLE is %d, not 4\n",
- BLT_SMALL_HASH_TABLE);
-#endif
- tablePtr->buckets = tablePtr->staticBuckets;
- tablePtr->numBuckets = BLT_SMALL_HASH_TABLE;
- tablePtr->staticBuckets[0] = tablePtr->staticBuckets[1] = 0;
- tablePtr->staticBuckets[2] = tablePtr->staticBuckets[3] = 0;
- tablePtr->numEntries = 0;
- tablePtr->rebuildSize = BLT_SMALL_HASH_TABLE * REBUILD_MULTIPLIER;
- tablePtr->downShift = DOWNSHIFT_START;
-
- /* The number of buckets is always a power of 2, so we can generate the mask
- * by simply subtracting 1 from the number of buckets. */
- tablePtr->mask = (Blt_Hash)(tablePtr->numBuckets - 1);
- tablePtr->keyType = keyType;
-
- switch (keyType) {
- case BLT_STRING_KEYS: /* NUL terminated string keys. */
- tablePtr->findProc = StringFind;
- tablePtr->createProc = StringCreate;
- break;
-
- case BLT_ONE_WORD_KEYS: /* 32 or 64-bit atomic keys. */
- tablePtr->findProc = OneWordFind;
- tablePtr->createProc = OneWordCreate;
- break;
-
- default: /* Structures/arrays. */
- if (keyType == 0) {
- Blt_Panic("Blt_InitHashTable: Key size can't be %d, must be > 0\n",
- keyType);
- }
- tablePtr->findProc = ArrayFind;
- tablePtr->createProc = ArrayCreate;
- break;
- }
- tablePtr->hPool = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_InitHashTableWithPool --
- *
- * Given storage for a hash table, set up the fields to prepare the hash
- * table for use. The only difference between this routine and
- * Blt_InitHashTable is that is uses a pool allocator to allocate memory
- * for hash table entries. The type of pool is either fixed or variable
- * size (string) keys.
- *
- * Results:
- * None.
- *
- * Side effects:
- * TablePtr is now ready to be passed to Blt_FindHashEntry and
- * Blt_CreateHashEntry.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_InitHashTableWithPool(Blt_HashTable *tablePtr, size_t keyType)
-{
- Blt_InitHashTable(tablePtr, keyType);
- if (keyType == BLT_STRING_KEYS) {
- tablePtr->hPool = Blt_PoolCreate(BLT_VARIABLE_SIZE_ITEMS);
- } else {
- tablePtr->hPool = Blt_PoolCreate(BLT_FIXED_SIZE_ITEMS);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DeleteHashEntry --
- *
- * Remove a single entry from a hash table.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The entry given by entryPtr is deleted from its table and should never
- * again be used by the caller. It is up to the caller to free the
- * clientData field of the entry, if that is relevant.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DeleteHashEntry(Blt_HashTable *tablePtr, Blt_HashEntry *entryPtr)
-{
- Blt_HashEntry **bucketPtr;
- size_t hindex;
-
- if (tablePtr->keyType == BLT_ONE_WORD_KEYS) {
- hindex = RANDOM_INDEX(tablePtr, (const void *)entryPtr->hval);
- } else {
- hindex = (entryPtr->hval & tablePtr->mask);
- }
- bucketPtr = tablePtr->buckets + hindex;
- if (*bucketPtr == entryPtr) {
- *bucketPtr = entryPtr->nextPtr;
- } else {
- Blt_HashEntry *prevPtr;
-
- for (prevPtr = *bucketPtr; /*empty*/; prevPtr = prevPtr->nextPtr) {
- if (prevPtr == NULL) {
- Blt_Panic("malformed bucket chain in Blt_DeleteHashEntry");
- }
- if (prevPtr->nextPtr == entryPtr) {
- prevPtr->nextPtr = entryPtr->nextPtr;
- break;
- }
- }
- }
- tablePtr->numEntries--;
- if (tablePtr->hPool != NULL) {
- Blt_PoolFreeItem(tablePtr->hPool, entryPtr);
- } else {
- Blt_Free(entryPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DeleteHashTable --
- *
- * Free up everything associated with a hash table except for the record
- * for the table itself.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The hash table is no longer useable.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DeleteHashTable(Blt_HashTable *tablePtr) /* Table to delete. */
-{
- /* Free up all the entries in the table. */
- if (tablePtr->hPool != NULL) {
- Blt_PoolDestroy(tablePtr->hPool);
- tablePtr->hPool = NULL;
- } else {
- size_t i;
-
- for (i = 0; i < tablePtr->numBuckets; i++) {
- Blt_HashEntry *hPtr;
-
- hPtr = tablePtr->buckets[i];
- while (hPtr != NULL) {
- Blt_HashEntry *nextPtr;
-
- nextPtr = hPtr->nextPtr;
- Blt_Free(hPtr);
- hPtr = nextPtr;
- }
- }
- }
-
- /* Free up the bucket array, if it was dynamically allocated. */
- if (tablePtr->buckets != tablePtr->staticBuckets) {
- Blt_Free(tablePtr->buckets);
- }
-
- /*
- * Arrange for panics if the table is used again without re-initialization.
- */
- tablePtr->findProc = BogusFind;
- tablePtr->createProc = BogusCreate;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FirstHashEntry --
- *
- * Locate the first entry in a hash table and set up a record that can be
- * used to step through all the remaining entries of the table.
- *
- * Results:
- * The return value is a pointer to the first entry in tablePtr, or NULL
- * if tablePtr has no entries in it. The memory at *searchPtr is
- * initialized so that subsequent calls to Blt_NextHashEntry will return
- * all of the entries in the table, one at a time.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-Blt_HashEntry *
-Blt_FirstHashEntry(
- Blt_HashTable *tablePtr, /* Table to search. */
- Blt_HashSearch *searchPtr) /* Place to store information about
- * progress through the table. */
-{
- searchPtr->tablePtr = tablePtr;
- searchPtr->nextIndex = 0;
- searchPtr->nextEntryPtr = NULL;
- return Blt_NextHashEntry(searchPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_NextHashEntry --
- *
- * Once a hash table enumeration has been initiated by calling
- * Blt_FirstHashEntry, this procedure may be called to return successive
- * elements of the table.
- *
- * Results:
- * The return value is the next entry in the hash table being enumerated,
- * or NULL if the end of the table is reached.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-Blt_HashEntry *
-Blt_NextHashEntry(Blt_HashSearch *searchPtr)
-{
- Blt_HashEntry *hPtr;
-
- while (searchPtr->nextEntryPtr == NULL) {
- if (searchPtr->nextIndex >= searchPtr->tablePtr->numBuckets) {
- return NULL;
- }
- searchPtr->nextEntryPtr =
- searchPtr->tablePtr->buckets[searchPtr->nextIndex];
- searchPtr->nextIndex++;
- }
- hPtr = searchPtr->nextEntryPtr;
- searchPtr->nextEntryPtr = hPtr->nextPtr;
- return hPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_HashStats --
- *
- * Return statistics describing the layout of the hash table in its hash
- * buckets.
- *
- * Results:
- * The return value is a malloc-ed string containing information about
- * tablePtr. It is the caller's responsibility to free this string.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-const char *
-Blt_HashStats(Blt_HashTable *tablePtr) /* Table for which to produce stats. */
-{
- Blt_HashEntry **bp, **bend;
- char *result, *p;
- double average, tmp;
-#define NUM_COUNTERS 10
- size_t count[NUM_COUNTERS], overflow, i, max;
-
- /* Compute a histogram of bucket usage. */
- for (i = 0; i < NUM_COUNTERS; i++) {
- count[i] = 0;
- }
- overflow = 0;
- average = 0.0;
- max = 0;
-
- for (bp = tablePtr->buckets, bend = bp + tablePtr->numBuckets; bp < bend;
- bp++) {
- Blt_HashEntry *hPtr;
- size_t j;
-
- j = 0;
- for (hPtr = *bp; hPtr != NULL; hPtr = hPtr->nextPtr) {
- j++;
- }
- if (j > max) {
- max = j;
- }
- if (j < NUM_COUNTERS) {
- count[j]++;
- } else {
- overflow++;
- }
- tmp = j;
- average += (tmp+1.0)*(tmp/tablePtr->numEntries)/2.0;
- }
-
- /* Print out the histogram and a few other pieces of information. */
- result = Blt_AssertMalloc((unsigned) ((NUM_COUNTERS*60) + 300));
- sprintf(result, "%lu entries in table, %lu buckets\n",
- (unsigned long)tablePtr->numEntries,
- (unsigned long)tablePtr->numBuckets);
- p = result + strlen(result);
- for (i = 0; i < NUM_COUNTERS; i++) {
- sprintf(p, "number of buckets with %lu entries: %lu\n",
- (unsigned long)i, (unsigned long)count[i]);
- p += strlen(p);
- }
- sprintf(p, "number of buckets with %d or more entries: %lu\n",
- NUM_COUNTERS, (unsigned long)overflow);
- p += strlen(p);
- sprintf(p, "average search distance for entry: %.2f\n", average);
- p += strlen(p);
- sprintf(p, "maximum search distance for entry: %lu", (unsigned long)max);
- return result;
-}
diff --git a/blt3.0.1/src/bltHash.h.in b/blt3.0.1/src/bltHash.h.in
deleted file mode 100644
index 67a567b..0000000
--- a/blt3.0.1/src/bltHash.h.in
+++ /dev/null
@@ -1,212 +0,0 @@
-
-/*
- * bltHash.h --
- *
- * Copyright 2000-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The hash table data structures are based upon the ones in the public header
- * file tcl.h in the Tcl library distribution.
- *
- * Copyright (c) 1991-1993 The Regents of the University of California.
- *
- * Copyright (c) 1994 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and
- * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- */
-
-#ifndef BLT_HASH_H
-# define BLT_HASH_H 1
-
-# ifndef BLT_INT_H
-# ifndef SIZEOF_LONG
-# define SIZEOF_LONG @SIZEOF_LONG@
-# endif
-# ifndef SIZEOF_LONG_LONG
-# define SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
-# endif
-# ifndef SIZEOF_INT
-# define SIZEOF_INT @SIZEOF_INT@
-# endif
-# ifndef SIZEOF_VOID_P
-# define SIZEOF_VOID_P @SIZEOF_VOID_P@
-# endif
-#endif /* !BLT_INT_H */
-
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#else
-# if (SIZEOF_VOID_P == 8)
-# if (SIZEOF_LONG == 8)
-typedef signed long int64_t;
-typedef unsigned long uint64_t;
-# else
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-# endif /* SIZEOF_LONG == 8 */
-# else
-# ifndef __CYGWIN__
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-# endif /* __CYGWIN__ */
-# endif /* SIZEOF_VOID_P == 8 */
-#endif /* HAVE_INTTYPES_H */
-
-#if (SIZEOF_VOID_P == 8)
-typedef uint64_t Blt_Hash;
-#else
-typedef uint32_t Blt_Hash;
-#endif /* SIZEOF_VOID_P == 8 */
-
-#include "bltPool.h"
-
-/*
- * Acceptable key types for hash tables:
- */
-#ifndef BLT_STRING_KEYS
-# define BLT_STRING_KEYS 0L
-#endif
-#ifndef BLT_ONE_WORD_KEYS
-# define BLT_ONE_WORD_KEYS ((size_t)-1L)
-#endif
-/*
- * Forward declaration of Blt_HashTable. Needed by some C++ compilers to
- * prevent errors when the forward reference to Blt_HashTable is encountered
- * in the Blt_HashEntry structure.
- */
-
-#ifdef __cplusplus
-struct Blt_HashTable;
-#endif
-
-typedef union { /* Key has one of these forms: */
- void *oneWordValue; /* One-word value for key. */
- unsigned long words[1]; /* Multiple integer words for key. The actual
- * size will be as large as necessary for this
- * table's keys. */
- char string[4]; /* String for key. The actual size will be as
- * large as needed to hold the key. */
-} Blt_HashKey;
-
-/*
- * Structure definition for an entry in a hash table. No one outside BLT
- * should access any of these fields directly; use the macros defined below.
- */
-typedef struct Blt_HashEntry {
- struct Blt_HashEntry *nextPtr; /* Pointer to next entry in this hash
- * bucket, or NULL for end of chain.*/
- Blt_Hash hval;
-
- ClientData clientData; /* Application stores something here with
- * Blt_SetHashValue. */
- Blt_HashKey key; /* MUST BE LAST FIELD IN RECORD!! */
-} Blt_HashEntry;
-
-/*
- * Structure definition for a hash table. Must be in blt.h so clients can
- * allocate space for these structures, but clients should never access any
- * fields in this structure.
- */
-#define BLT_SMALL_HASH_TABLE 4
-typedef struct Blt_HashTable {
- Blt_HashEntry **buckets; /* Pointer to bucket array. Each element
- * points to first entry in bucket's hash
- * chain, or NULL. */
- Blt_HashEntry *staticBuckets[BLT_SMALL_HASH_TABLE];
- /* Bucket array used for small tables (to
- * avoid mallocs and frees). */
- size_t numBuckets; /* Total number of buckets allocated at
- * buckets. */
- size_t numEntries; /* Total # of entries present in table. */
- size_t rebuildSize; /* Enlarge table when numEntries gets to be
- * this large. */
- Blt_Hash mask; /* Mask value used in hashing function. */
- unsigned int downShift; /* Shift count used in hashing function.
- * Designed to use high- order bits of
- * randomized keys. */
- size_t keyType; /* Type of keys used in this table. It's
- * either BLT_STRING_KEYS, BLT_ONE_WORD_KEYS,
- * or an integer giving the number of ints
- * that is the size of the key. */
- Blt_HashEntry *(*findProc) _ANSI_ARGS_((struct Blt_HashTable *tablePtr,
- CONST void *key));
- Blt_HashEntry *(*createProc) _ANSI_ARGS_((struct Blt_HashTable *tablePtr,
- CONST void *key, int *newPtr));
-
- Blt_Pool hPool; /* Pointer to the pool allocator used for
- * entries in this hash table. If NULL, the
- * standard Tcl_Alloc, Tcl_Free routines will
- * be used instead. */
-} Blt_HashTable;
-
-/*
- * Structure definition for information used to keep track of searches through
- * hash tables:
- */
-
-typedef struct {
- Blt_HashTable *tablePtr; /* Table being searched. */
- unsigned long nextIndex; /* Index of next bucket to be enumerated after
- * present one. */
- Blt_HashEntry *nextEntryPtr; /* Next entry to be enumerated in the current
- * bucket. */
-} Blt_HashSearch;
-
-/*
- * Macros for clients to use to access fields of hash entries:
- */
-
-#define Blt_GetHashValue(h) ((h)->clientData)
-#define Blt_SetHashValue(h, value) ((h)->clientData = (ClientData)(value))
-#define Blt_GetHashKey(tablePtr, h) \
- ((void *) (((tablePtr)->keyType == BLT_ONE_WORD_KEYS) ? \
- (void *)(h)->key.oneWordValue : (h)->key.string))
-
-/*
- * Macros to use for clients to use to invoke find and create procedures for
- * hash tables:
- */
-#define Blt_FindHashEntry(tablePtr, key) \
- (*((tablePtr)->findProc))(tablePtr, key)
-#define Blt_CreateHashEntry(tablePtr, key, newPtr) \
- (*((tablePtr)->createProc))(tablePtr, key, newPtr)
-
-BLT_EXTERN void Blt_InitHashTable _ANSI_ARGS_((Blt_HashTable *tablePtr,
- size_t keyType));
-
-BLT_EXTERN void Blt_InitHashTableWithPool _ANSI_ARGS_((Blt_HashTable *tablePtr,
- size_t keyType));
-
-BLT_EXTERN void Blt_DeleteHashTable _ANSI_ARGS_((Blt_HashTable *tablePtr));
-
-BLT_EXTERN void Blt_DeleteHashEntry _ANSI_ARGS_((Blt_HashTable *tablePtr,
- Blt_HashEntry *entryPtr));
-
-BLT_EXTERN Blt_HashEntry *Blt_FirstHashEntry _ANSI_ARGS_((
- Blt_HashTable *tablePtr, Blt_HashSearch *searchPtr));
-
-BLT_EXTERN Blt_HashEntry *Blt_NextHashEntry _ANSI_ARGS_((
- Blt_HashSearch *srchPtr));
-
-BLT_EXTERN const char *Blt_HashStats _ANSI_ARGS_((Blt_HashTable *tablePtr));
-
-#endif /* BLT_HASH_H */
diff --git a/blt3.0.1/src/bltHtext.c b/blt3.0.1/src/bltHtext.c
deleted file mode 100644
index 542d101..0000000
--- a/blt3.0.1/src/bltHtext.c
+++ /dev/null
@@ -1,4451 +0,0 @@
-/*
- * bltHtext.c --
- *
- * This module implements a hypertext widget for the BLT toolkit.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * To do:
- *
- * 1) Fix scroll unit round off errors.
- *
- * 2) Better error checking.
- *
- * 3) Use html format.
- *
- * 4) The dimension of cavities using -relwidth and -relheight
- * should be 0 when computing initial estimates for the size
- * of the virtual text.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_HTEXT
-#include "bltOp.h"
-#include <bltChain.h>
-#include <bltHash.h>
-#include "bltFont.h"
-#include "bltText.h"
-#include "bltBgStyle.h"
-
-#include <sys/stat.h>
-#include <X11/Xatom.h>
-
-#define DEF_LINES_ALLOC 512 /* Default block of lines allocated */
-#define CLAMP(val,low,hi) \
- (((val) < (low)) ? (low) : ((val) > (hi)) ? (hi) : (val))
-
-/*
- * Justify option values
- */
-typedef enum {
- JUSTIFY_CENTER, JUSTIFY_TOP, JUSTIFY_BOTTOM
-} Justify;
-
-static Blt_OptionParseProc ObjToWidth, ObjToHeight;
-static Blt_OptionPrintProc WidthHeightToObj;
-static Blt_CustomOption widthOption =
-{
- ObjToWidth, WidthHeightToObj, NULL, (ClientData)0
-};
-
-static Blt_CustomOption heightOption =
-{
- ObjToHeight, WidthHeightToObj, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToJustify;
-static Blt_OptionPrintProc JustifyToObj;
-static Blt_CustomOption justifyOption =
-{
- ObjToJustify, JustifyToObj, NULL, (ClientData)0
-};
-
-static Tk_GeomRequestProc EmbeddedWidgetGeometryProc;
-static Tk_GeomLostSlaveProc EmbeddedWidgetCustodyProc;
-static Tk_GeomMgr htextMgrInfo =
-{
- (char *)"htext", /* Name of geometry manager used by
- * winfo */
- EmbeddedWidgetGeometryProc, /* Procedure to for new geometry
- * requests */
- EmbeddedWidgetCustodyProc, /* Procedure when window is taken
- * away */
-};
-
-
-/*
- * Line --
- *
- * Structure to contain the contents of a single line of text and the
- * widgets on that line.
- *
- * Individual lines are not configurable, although changes to the size of
- * widgets do effect its values.
- */
-typedef struct {
- int offset; /* Offset of line from y-origin (0) in
- * world coordinates */
- int baseline; /* Baseline y-coordinate of the
- * text */
- short int width, height; /* Dimensions of the line */
- int textStart, textEnd; /* Start and end indices of characters
- * forming the line in the text array */
- Blt_Chain chain; /* Chain of embedded widgets on the
- * line of text */
-} Line;
-
-typedef struct {
- int textStart;
- int textEnd;
-} Segment;
-
-typedef struct {
- int x, y;
-} Position;
-
-/*
- * Hypertext widget.
- */
-typedef struct {
- Tk_Window tkwin; /* Window that embodies the widget.
- * NULL means that the window has been
- * destroyed but the data structures
- * haven't yet been cleaned up.*/
- Display *display; /* Display containing widget; needed,
- * among other things, to release
- * resources after tkwin has already
- * gone away. */
- Tcl_Interp *interp; /* Interpreter associated with
- * widget. */
- Tcl_Command cmdToken; /* Token for htext's widget command. */
- int flags;
-
- /* User-configurable fields */
-
- XColor *normalFg;
- Blt_Background normalBg;
- Blt_Font font; /* Font for normal text. May affect
- * the size of the viewport if the
- * width/height is specified in
- * columns/rows */
- GC drawGC; /* Graphics context for normal text */
- int tileOffsetPage; /* Set tile offset to top of page
- * instead of toplevel window */
- GC fillGC; /* GC for clearing the window in the
- * designated background color. The
- * background color is the foreground
- * attribute in GC. */
-
- int nRows, nColumns; /* # of characters of the current font
- * for a row or column of the viewport.
- * Used to determine the width and height
- * of the text window (i.e. viewport) */
- int reqWidth, reqHeight; /* Requested dimensions of the
- * viewport */
- int maxWidth, maxHeight; /* Maximum dimensions allowed for the
- * viewport, regardless of the size of
- * the text */
-
- Tk_Cursor cursor; /* X Cursor */
-
- char *fileName; /* If non-NULL, indicates the name of a
- * hypertext file to be read into the
- * widget. If NULL, the *text* field is
- * considered instead */
- char *text; /* Hypertext to be loaded into the
- * widget. This value is ignored if
- * *fileName* * is non-NULL */
- int specChar; /* Special character designating a TCL
- * command block in a hypertext
- * file. */
- int leader; /* # of pixels between lines */
-
- Tcl_Obj *yScrollCmdObjPtr; /* Name of vertical scrollbar to invoke */
- int yScrollUnits; /* # of pixels per vertical scroll */
- Tcl_Obj *xScrollCmdObjPtr; /* Name of horizontal scroll bar to invoke */
- int xScrollUnits; /* # of pixels per horizontal
- # scroll */
-
- int reqLineNum; /* Line requested by "goto" command */
-
- /*
- * The view port is the width and height of the window and the
- * origin of the viewport (upper left corner) in world coordinates.
- */
- int worldWidth, worldHeight;/* Size of view text in world coordinates */
- int xOffset, yOffset; /* Position of viewport in world coordinates */
-
- int pendingX, pendingY; /* New upper-left corner (origin) of
- * the viewport (not yet posted) */
-
- int first, last; /* Range of lines displayed */
-
- int lastWidth, lastHeight;
- /* Last known size of the window: saved to
- * recognize when the viewport is resized. */
-
- Blt_HashTable widgetTable; /* Table of embedded widgets. */
-
- /*
- * Selection display information:
- */
- Blt_Background selBg; /* Border and background color */
- int selBW; /* Border width */
- XColor *selFgColor; /* Text foreground color */
- GC selectGC; /* GC for drawing selected text */
- int selAnchor; /* Fixed end of selection
- * (i.e. "selection to" operation will
- * use this as one end of the selection).*/
- int selFirst; /* The index of first character in the
- * text array selected */
- int selLast; /* The index of the last character selected */
- int exportSelection; /* Non-zero means to export the internal text
- * selection to the X server. */
- char *takeFocus;
-
- /*
- * Scanning information:
- */
- XPoint scanMark; /* Anchor position of scan */
- XPoint scanPt; /* x,y position where the scan started. */
-
- char *charArr; /* Pool of characters representing the text
- * to be displayed */
- int nChars; /* Length of the text pool */
-
- Line *lineArr; /* Array of pointers to text lines */
- int nLines; /* # of line entered into array. */
- int arraySize; /* Size of array allocated. */
-
-} HText;
-
-/*
- * Bit flags for the hypertext widget:
- */
-#define REDRAW_PENDING (1<<0) /* A DoWhenIdle handler has already
- * been queued to redraw the window */
-#define IGNORE_EXPOSURES (1<<1) /* Ignore exposure events in the text
- * window. Potentially many expose
- * events can occur while rearranging
- * embedded widgets during a single call to
- * the DisplayText. */
-
-#define REQUEST_LAYOUT (1<<4) /* Something has happened which
- * requires the layout of text and
- * embedded widget positions to be
- * recalculated. The following
- * actions may cause this:
- *
- * 1) the contents of the hypertext
- * has changed by either the -file or
- * -text options.
- *
- * 2) a text attribute has changed
- * (line spacing, font, etc)
- *
- * 3) a embedded widget has been resized or
- * moved.
- *
- * 4) a widget configuration option has
- * changed.
- */
-#define TEXT_DIRTY (1<<5) /* The layout was recalculated and the
- * size of the world (text layout) has
- * changed. */
-#define GOTO_PENDING (1<<6) /* Indicates the starting text line
- * number has changed. To be reflected
- * the next time the widget is redrawn. */
-#define WIDGET_APPENDED (1<<7) /* Indicates a embedded widget has just
- * been appended to the text. This is
- * used to determine when to add a
- * space to the text array */
-
-#define DEF_HTEXT_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_HTEXT_CURSOR "arrow"
-#define DEF_HTEXT_EXPORT_SELECTION "1"
-
-#define DEF_HTEXT_FOREGROUND STD_NORMAL_FOREGROUND
-#define DEF_HTEXT_FILE_NAME (char *)NULL
-#define DEF_HTEXT_FONT STD_FONT
-#define DEF_HTEXT_HEIGHT "0"
-#define DEF_HTEXT_LINE_SPACING "1"
-#define DEF_HTEXT_MAX_HEIGHT (char *)NULL
-#define DEF_HTEXT_MAX_WIDTH (char *)NULL
-#define DEF_HTEXT_SCROLL_UNITS "10"
-#define DEF_HTEXT_SPEC_CHAR "0x25"
-#define DEF_HTEXT_SELECT_BORDERWIDTH STD_SELECT_BORDERWIDTH
-#define DEF_HTEXT_SELECT_BACKGROUND STD_SELECT_BACKGROUND
-#define DEF_HTEXT_SELECT_FOREGROUND STD_SELECT_FOREGROUND
-#define DEF_HTEXT_TAKE_FOCUS "1"
-#define DEF_HTEXT_TEXT (char *)NULL
-#define DEF_HTEXT_TILE_OFFSET "1"
-#define DEF_HTEXT_WIDTH "0"
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_HTEXT_BACKGROUND, Blt_Offset(HText, normalBg), 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_HTEXT_CURSOR, Blt_Offset(HText, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BOOLEAN, "-exportselection", "exportSelection", "ExportSelection",
- DEF_HTEXT_EXPORT_SELECTION, Blt_Offset(HText, exportSelection), 0},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_STRING, "-file", "file", "File",
- DEF_HTEXT_FILE_NAME, Blt_Offset(HText, fileName), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FONT, "-font", "font", "Font",
- DEF_HTEXT_FONT, Blt_Offset(HText, font), 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_HTEXT_FOREGROUND, Blt_Offset(HText, normalFg), 0},
- {BLT_CONFIG_CUSTOM, "-height", "height", "Height", DEF_HTEXT_HEIGHT,
- Blt_Offset(HText, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT,
- &heightOption},
- {BLT_CONFIG_PIXELS_NNEG, "-linespacing", "lineSpacing", "LineSpacing",
- DEF_HTEXT_LINE_SPACING, Blt_Offset(HText, leader),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-maxheight", "maxHeight", "MaxHeight",
- DEF_HTEXT_MAX_HEIGHT, Blt_Offset(HText, maxHeight),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-maxwidth", "maxWidth", "MaxWidth",
- DEF_HTEXT_MAX_WIDTH, Blt_Offset(HText, maxWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BORDER, "-selectbackground", "selectBackground", "Background",
- DEF_HTEXT_SELECT_BACKGROUND, Blt_Offset(HText, selBg), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-selectborderwidth", "selectBorderWidth",
- "BorderWidth", DEF_HTEXT_SELECT_BORDERWIDTH,
- Blt_Offset(HText, selBW), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground", "Foreground",
- DEF_HTEXT_SELECT_FOREGROUND, Blt_Offset(HText, selFgColor), 0},
- {BLT_CONFIG_INT, "-specialchar", "specialChar", "SpecialChar",
- DEF_HTEXT_SPEC_CHAR, Blt_Offset(HText, specChar), 0},
- {BLT_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_HTEXT_TAKE_FOCUS, Blt_Offset(HText, takeFocus),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BOOLEAN, "-tileoffset", "tileOffset", "TileOffset",
- DEF_HTEXT_TILE_OFFSET, Blt_Offset(HText, tileOffsetPage), 0},
- {BLT_CONFIG_STRING, "-text", "text", "Text",
- DEF_HTEXT_TEXT, Blt_Offset(HText, text), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-width", "width", "Width", DEF_HTEXT_WIDTH,
- Blt_Offset(HText, reqWidth), BLT_CONFIG_DONT_SET_DEFAULT, &widthOption},
- {BLT_CONFIG_OBJ, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
- (char *)NULL, Blt_Offset(HText, xScrollCmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-xscrollunits", "xScrollUnits", "ScrollUnits",
- DEF_HTEXT_SCROLL_UNITS, Blt_Offset(HText, xScrollUnits),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
- (char *)NULL, Blt_Offset(HText, yScrollCmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-yscrollunits", "yScrollUnits", "yScrollUnits",
- DEF_HTEXT_SCROLL_UNITS, Blt_Offset(HText, yScrollUnits),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-typedef struct {
- HText *htPtr; /* Pointer to parent's Htext structure */
- Tk_Window tkwin; /* Widget window */
- int flags;
-
- int x, y; /* Origin of embedded widget in text */
-
- int cavityWidth, cavityHeight; /* Dimensions of the cavity
- * surrounding the embedded widget */
- /*
- * Dimensions of the embedded widget. Compared against actual
- * embedded widget sizes when checking for resizing.
- */
- int winWidth, winHeight;
-
- int precedingTextEnd; /* Index (in charArr) of the the last
- * character immediatedly preceding
- * the embedded widget */
- int precedingTextWidth; /* Width of normal text preceding widget. */
-
- Tk_Anchor anchor;
- Justify justify; /* Justification of region wrt to line */
-
- /*
- * Requested dimensions of the cavity (includes padding). If non-zero,
- * it overrides the calculated dimension of the cavity.
- */
- int reqCavityWidth, reqCavityHeight;
-
- /*
- * Relative dimensions of cavity wrt the size of the viewport. If
- * greater than 0.0.
- */
- double relCavityWidth, relCavityHeight;
-
- int reqWidth, reqHeight; /* If non-zero, overrides the requested
- * dimension of the embedded widget */
-
- double relWidth, relHeight; /* Relative dimensions of embedded
- * widget wrt the size of the viewport */
-
- Blt_Pad xPad, yPad; /* Extra padding to frame around */
-
- int ixPad, iyPad; /* internal padding for window */
-
- int fill; /* Fill style flag */
-
-} EmbeddedWidget;
-
-/*
- * Flag bits embedded widgets:
- */
-#define WIDGET_VISIBLE (1<<2) /* Widget is currently visible in the
- * viewport. */
-#define WIDGET_NOT_CHILD (1<<3) /* Widget is not a child of hypertext. */
-/*
- * Defaults for embedded widgets:
- */
-#define DEF_WIDGET_ANCHOR "center"
-#define DEF_WIDGET_FILL "none"
-#define DEF_WIDGET_HEIGHT "0"
-#define DEF_WIDGET_JUSTIFY "center"
-#define DEF_WIDGET_PAD_X "0"
-#define DEF_WIDGET_PAD_Y "0"
-#define DEF_WIDGET_REL_HEIGHT "0.0"
-#define DEF_WIDGET_REL_WIDTH "0.0"
-#define DEF_WIDGET_WIDTH "0"
-
-static Blt_ConfigSpec widgetConfigSpecs[] =
-{
- {BLT_CONFIG_ANCHOR, "-anchor", (char *)NULL, (char *)NULL,
- DEF_WIDGET_ANCHOR, Blt_Offset(EmbeddedWidget, anchor),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FILL, "-fill", (char *)NULL, (char *)NULL,
- DEF_WIDGET_FILL, Blt_Offset(EmbeddedWidget, fill),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-cavityheight", (char *)NULL, (char *)NULL,
- DEF_WIDGET_HEIGHT, Blt_Offset(EmbeddedWidget, reqCavityHeight),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-cavitywidth", (char *)NULL, (char *)NULL,
- DEF_WIDGET_WIDTH, Blt_Offset(EmbeddedWidget, reqCavityWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-height", (char *)NULL, (char *)NULL,
- DEF_WIDGET_HEIGHT, Blt_Offset(EmbeddedWidget, reqHeight),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-justify", (char *)NULL, (char *)NULL,
- DEF_WIDGET_JUSTIFY, Blt_Offset(EmbeddedWidget, justify),
- BLT_CONFIG_DONT_SET_DEFAULT, &justifyOption},
- {BLT_CONFIG_PAD, "-padx", (char *)NULL, (char *)NULL,
- DEF_WIDGET_PAD_X, Blt_Offset(EmbeddedWidget, xPad),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-pady", (char *)NULL, (char *)NULL,
- DEF_WIDGET_PAD_Y, Blt_Offset(EmbeddedWidget, yPad),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_DOUBLE, "-relcavityheight", (char *)NULL, (char *)NULL,
- DEF_WIDGET_REL_HEIGHT, Blt_Offset(EmbeddedWidget, relCavityHeight),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_DOUBLE, "-relcavitywidth", (char *)NULL, (char *)NULL,
- DEF_WIDGET_REL_WIDTH, Blt_Offset(EmbeddedWidget, relCavityWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_DOUBLE, "-relheight", (char *)NULL, (char *)NULL,
- DEF_WIDGET_REL_HEIGHT, Blt_Offset(EmbeddedWidget, relHeight),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_DOUBLE, "-relwidth", (char *)NULL, (char *)NULL,
- DEF_WIDGET_REL_WIDTH, Blt_Offset(EmbeddedWidget, relWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-width", (char *)NULL, (char *)NULL,
- DEF_WIDGET_WIDTH, Blt_Offset(EmbeddedWidget, reqWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-
-/* Forward Declarations */
-static Tcl_FreeProc DestroyText;
-static Tk_EventProc EmbeddedWidgetEventProc;
-static Tcl_IdleProc DisplayText;
-static Tcl_CmdDeleteProc TextDeleteCmdProc;
-
-static Tcl_VarTraceProc TextVarProc;
-static Blt_BackgroundChangedProc BackgroundChangedProc;
-static Tk_LostSelProc TextLostSelection;
-static Tk_SelectionProc TextSelectionProc;
-static Tk_EventProc TextEventProc;
-static Tcl_ObjCmdProc TextWidgetCmd;
-static Tcl_ObjCmdProc TextCmd;
-
-typedef int (HTextCmdProc)(HText *htextPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-
-
-/* end of Forward Declarations */
-
-
- /* Custom options */
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToJustify --
- *
- * Converts the justification string into its numeric
- * representation. This configuration option affects how the
- * embedded widget is positioned with respect to the line on which
- * it sits.
- *
- * Valid style strings are:
- *
- * "top" Uppermost point of region is top of the line's
- * text
- * "center" Center point of region is line's baseline.
- * "bottom" Lowermost point of region is bottom of the
- * line's text
- *
- * Returns:
- * A standard TCL result. If the value was not valid
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToJustify(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Justification string */
- char *widgRec, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Justify *justPtr = (Justify *)(widgRec + offset);
- char *string;
- char c;
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'c') && (strncmp(string, "center", length) == 0)) {
- *justPtr = JUSTIFY_CENTER;
- } else if ((c == 't') && (strncmp(string, "top", length) == 0)) {
- *justPtr = JUSTIFY_TOP;
- } else if ((c == 'b') && (strncmp(string, "bottom", length) == 0)) {
- *justPtr = JUSTIFY_BOTTOM;
- } else {
- Tcl_AppendResult(interp, "bad justification argument \"", string,
- "\": should be \"center\", \"top\", or \"bottom\"", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NameOfJustify --
- *
- * Returns the justification style string based upon the value.
- *
- * Results:
- * The static justification style string is returned.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-NameOfJustify(Justify justify)
-{
- switch (justify) {
- case JUSTIFY_CENTER:
- return "center";
- case JUSTIFY_TOP:
- return "top";
- case JUSTIFY_BOTTOM:
- return "bottom";
- default:
- return "unknown justification value";
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * JustifyToObj --
- *
- * Returns the justification style string based upon the value.
- *
- * Results:
- * The justification style string is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-JustifyToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Justify justify = *(Justify *)(widgRec + offset);
-
- return Tcl_NewStringObj(NameOfJustify(justify), -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetScreenDistance --
- *
- * Converts the given string into the screen distance or number
- * of characters. The valid formats are
- *
- * N - pixels Nm - millimeters
- * Ni - inches Np - pica
- * Nc - centimeters N# - number of characters
- *
- * where N is a non-negative decimal number.
- *
- * Results:
- * A standard TCL result. The screen distance and the number of
- * characters are returned. If the string can't be converted,
- * TCL_ERROR is returned and interp->result will contain an error
- * message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetScreenDistance(
- Tcl_Interp *interp,
- Tk_Window tkwin,
- Tcl_Obj *objPtr,
- int *sizePtr,
- int *countPtr)
-{
- int nPixels, nChars;
- char *endPtr; /* Pointer to last character scanned */
- double value;
- int rounded;
- char *string;
-
-
- string = Tcl_GetString(objPtr);
- value = strtod(string, &endPtr);
- if (endPtr == string) {
- Tcl_AppendResult(interp, "bad screen distance \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (value < 0.0) {
- Tcl_AppendResult(interp, "screen distance \"", string,
- "\" must be non-negative value", (char *)NULL);
- return TCL_ERROR;
- }
- while (isspace(UCHAR(*endPtr))) {
- if (*endPtr == '\0') {
- break;
- }
- endPtr++;
- }
- nPixels = nChars = 0;
- rounded = ROUND(value);
- switch (*endPtr) {
- case '\0': /* Distance in pixels */
- nPixels = rounded;
- break;
- case '#': /* Number of characters */
- nChars = rounded;
- break;
- default: /* cm, mm, pica, inches */
- if (Tk_GetPixelsFromObj(interp, tkwin, objPtr, &rounded) != TCL_OK) {
- return TCL_ERROR;
- }
- nPixels = rounded;
- break;
- }
- *sizePtr = nPixels;
- *countPtr = nChars;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StringToHeight --
- *
- * Like BLT_CONFIG_PIXELS, but adds an extra check for negative
- * values.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToHeight(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Window */
- Tcl_Obj *objPtr, /* Pixel value string */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- HText *htPtr = (HText *)widgRec;
- int height, nRows;
-
- if (GetScreenDistance(interp, tkwin, objPtr, &height, &nRows) != TCL_OK) {
- return TCL_ERROR;
- }
- htPtr->nRows = nRows;
- htPtr->reqHeight = height;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StringToWidth --
- *
- * Like BLT_CONFIG_PIXELS, but adds an extra check for negative
- * values.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToWidth(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Window */
- Tcl_Obj *objPtr, /* Pixel value string */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- HText *htPtr = (HText *)widgRec;
- int width, nColumns;
-
- if (GetScreenDistance(interp, tkwin, objPtr, &width, &nColumns) != TCL_OK) {
- return TCL_ERROR;
- }
- htPtr->nColumns = nColumns;
- htPtr->reqWidth = width;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WidthHeightToObj --
- *
- * Returns the string representing the positive pixel size.
- *
- * Results:
- * The pixel size string is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-WidthHeightToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Row/column structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int pixels = *(int *)(widgRec + offset);
-
- return Tcl_NewIntObj(pixels);
-}
-
-/* General routines */
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Queues a request to redraw the text window at the next idle
- * point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets redisplayed. Right now we don't do selective
- * redisplays: the whole window will be redrawn. This doesn't
- * seem to hurt performance noticeably, but if it does then this
- * could be changed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(HText *htPtr)
-{
- if ((htPtr->tkwin != NULL) && !(htPtr->flags & REDRAW_PENDING)) {
- htPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayText, htPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResizeArray --
- *
- * Reallocates memory to the new size given. New memory
- * is also cleared (zeros).
- *
- * Results:
- * Returns a pointer to the new object or NULL if an error occurred.
- *
- * Side Effects:
- * Memory is re/allocated.
- *
- *---------------------------------------------------------------------------
- */
-static void *
-ResizeArray(
- void *array,
- int elemSize,
- int newSize,
- int prevSize)
-{
- void *newArray;
-
- if (newSize == prevSize) {
- return array;
- }
- if (newSize == 0) { /* Free entire array */
- return NULL;
- }
- newArray = Blt_AssertCalloc(elemSize, newSize);
- if ((prevSize > 0) && (array != NULL)) {
- int size;
-
- size = MIN(prevSize, newSize) * elemSize;
- if (size > 0) {
- memcpy(newArray, array, size);
- }
- Blt_Free(array);
- }
- return newArray;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LineSearch --
- *
- * Performs a binary search for the line of text located at some
- * world y-coordinate (not screen y-coordinate). The search is
- * inclusive of those lines from low to high.
- *
- * Results:
- * Returns the array index of the line found at the given
- * y-coordinate. If the y-coordinate is outside of the given range
- * of lines, -1 is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-LineSearch(
- HText *htPtr, /* HText widget */
- int yCoord, /* Search y-coordinate */
- int low, int high) /* Range of lines to search */
-{
- int median;
- Line *linePtr;
-
- while (low <= high) {
- median = (low + high) >> 1;
- linePtr = htPtr->lineArr + median;
- if (yCoord < linePtr->offset) {
- high = median - 1;
- } else if (yCoord >= (linePtr->offset + linePtr->height)) {
- low = median + 1;
- } else {
- return median;
- }
- }
- return -1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexSearch --
- *
- * Try to find what line contains a given text index. Performs
- * a binary search for the text line which contains the given index.
- * The search is inclusive of those lines from low and high.
- *
- * Results:
- * Returns the line number containing the given index. If the index
- * is outside the range of lines, -1 is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-IndexSearch(
- HText *htPtr, /* HText widget */
- int key, /* Search index */
- int low, int high) /* Range of lines to search */
-{
- int median;
- Line *linePtr;
-
- while (low <= high) {
- median = (low + high) >> 1;
- linePtr = htPtr->lineArr + median;
- if (key < linePtr->textStart) {
- high = median - 1;
- } else if (key > linePtr->textEnd) {
- low = median + 1;
- } else {
- return median;
- }
- }
- return -1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetXYPosIndex --
- *
- * Converts a string in the form "@x,y", where x and y are
- * window coordinates, to a text index.
- *
- * Window coordinates are first translated into world coordinates.
- * Any coordinate outside of the bounds of the virtual text is
- * silently set the nearest boundary.
- *
- * Results:
- * A standard TCL result. If "string" is a valid index, then
- * *indexPtr is filled with the numeric index corresponding.
- * Otherwise an error message is left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetXYPosIndex(
- HText *htPtr,
- Tcl_Obj *objPtr,
- int *indexPtr)
-{
- int x, y, curX, dummy;
- int textLength, textStart;
- int cindex, lindex;
- Line *linePtr;
- char *string;
-
- string = Tcl_GetString(objPtr);
- if (Blt_GetXY(htPtr->interp, htPtr->tkwin, string, &x, &y) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Locate the line corresponding to the window y-coordinate position */
-
- y += htPtr->yOffset;
- if (y < 0) {
- lindex = htPtr->first;
- } else if (y >= htPtr->worldHeight) {
- lindex = htPtr->last;
- } else {
- lindex = LineSearch(htPtr, y, 0, htPtr->nLines - 1);
- }
- if (lindex < 0) {
- Tcl_AppendResult(htPtr->interp, "can't find line at \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- x += htPtr->xOffset;
- if (x < 0) {
- x = 0;
- } else if (x > htPtr->worldWidth) {
- x = htPtr->worldWidth;
- }
- linePtr = htPtr->lineArr + lindex;
- curX = 0;
- textStart = linePtr->textStart;
- textLength = linePtr->textEnd - linePtr->textStart;
- if (Blt_Chain_GetLength(linePtr->chain) > 0) {
- Blt_ChainLink link;
- int deltaX;
- EmbeddedWidget *winPtr;
-
- for (link = Blt_Chain_FirstLink(linePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- winPtr = Blt_Chain_GetValue(link);
- deltaX = winPtr->precedingTextWidth + winPtr->cavityWidth;
- if ((curX + deltaX) > x) {
- textLength = (winPtr->precedingTextEnd - textStart);
- break;
- }
- curX += deltaX;
- /*
- * Skip over the trailing space. It designates the position of
- * a embedded widget in the text
- */
- textStart = winPtr->precedingTextEnd + 1;
- }
- }
- cindex = Blt_MeasureChars(htPtr->font, htPtr->charArr + textStart,
- textLength, 10000, DEF_TEXT_FLAGS, &dummy);
- *indexPtr = textStart + cindex;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ParseIndex --
- *
- * Parse a string representing a text index into numeric
- * value. A text index can be in one of the following forms.
- *
- * "anchor" - anchor position of the selection.
- * "sel.first" - index of the first character in the selection.
- * "sel.last" - index of the last character in the selection.
- * "page.top" - index of the first character on the page.
- * "page.bottom" - index of the last character on the page.
- * "@x,y" - x and y are window coordinates.
- * "number - raw index of text
- * "line.char" - line number and character position
- *
- * Results:
- * A standard TCL result. If "string" is a valid index, then
- * *indexPtr is filled with the corresponding numeric index.
- * Otherwise an error message is left in interp->result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ParseIndex(
- HText *htPtr, /* Text for which the index is being
- * specified. */
- Tcl_Obj *objPtr, /* Numerical index into htPtr's element
- * list, or "end" to refer to last element. */
- int *indexPtr) /* Where to store converted relief. */
-{
- Tcl_Interp *interp = htPtr->interp;
- char *string;
- char c;
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'a') && (strncmp(string, "anchor", length) == 0)) {
- *indexPtr = htPtr->selAnchor;
- } else if ((c == 's') && (length > 4)) {
- if (strncmp(string, "sel.first", length) == 0) {
- *indexPtr = htPtr->selFirst;
- } else if (strncmp(string, "sel.last", length) == 0) {
- *indexPtr = htPtr->selLast;
- } else {
- goto badIndex; /* Not a valid index */
- }
- if (*indexPtr < 0) {
- Tcl_AppendResult(interp, "bad index \"", string,
- "\": nothing selected in \"",
- Tk_PathName(htPtr->tkwin), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- } else if ((c == 'p') && (length > 5) &&
- (strncmp(string, "page.top", length) == 0)) {
- int first;
-
- first = htPtr->first;
- if (first < 0) {
- first = 0;
- }
- *indexPtr = htPtr->lineArr[first].textStart;
- } else if ((c == 'p') && (length > 5) &&
- (strncmp(string, "page.bottom", length) == 0)) {
- *indexPtr = htPtr->lineArr[htPtr->last].textEnd;
- } else if (c == '@') { /* Screen position */
- if (GetXYPosIndex(htPtr, objPtr, indexPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- char *period;
-
- period = strchr(string, '.');
- if (period == NULL) { /* Raw index */
- int tindex;
-
- if ((string[0] == 'e') && (strcmp(string, "end") == 0)) {
- tindex = htPtr->nChars - 1;
- } else if (Tcl_GetIntFromObj(interp, objPtr, &tindex) != TCL_OK) {
- goto badIndex;
- }
- if (tindex < 0) {
- tindex = 0;
- } else if (tindex > (htPtr->nChars - 1)) {
- tindex = htPtr->nChars - 1;
- }
- *indexPtr = tindex;
- } else {
- int lindex, cindex, offset;
- Line *linePtr;
- int result;
-
- *period = '\0';
- result = TCL_OK;
- if ((string[0] == 'e') && (strcmp(string, "end") == 0)) {
- lindex = htPtr->nLines - 1;
- } else {
- result = Tcl_GetIntFromObj(interp, objPtr, &lindex);
- }
- *period = '.'; /* Repair index string before returning */
- if (result != TCL_OK) {
- goto badIndex; /* Bad line number */
- }
- if (lindex < 0) {
- lindex = 0; /* Silently repair bad line numbers */
- }
- if (htPtr->nChars == 0) {
- *indexPtr = 0;
- return TCL_OK;
- }
- if (lindex >= htPtr->nLines) {
- lindex = htPtr->nLines - 1;
- }
- linePtr = htPtr->lineArr + lindex;
- cindex = 0;
- if ((*(period + 1) != '\0')) {
- string = period + 1;
- if ((string[0] == 'e') && (strcmp(string, "end") == 0)) {
- cindex = linePtr->textEnd - linePtr->textStart;
- } else if (Tcl_GetInt(interp, string, &cindex) != TCL_OK) {
- goto badIndex;
- }
- }
- if (cindex < 0) {
- cindex = 0; /* Silently fix bogus indices */
- }
- offset = 0;
- if (htPtr->nChars > 0) {
- offset = linePtr->textStart + cindex;
- if (offset > linePtr->textEnd) {
- offset = linePtr->textEnd;
- }
- }
- *indexPtr = offset;
- }
- }
- if (htPtr->nChars == 0) {
- *indexPtr = 0;
- }
- return TCL_OK;
-
- badIndex:
-
- /*
- * Some of the paths here leave messages in interp->result, so we
- * have to clear it out before storing our own message.
- */
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad index \"", string, "\": \
-should be one of the following: anchor, sel.first, sel.last, page.bottom, \
-page.top, @x,y, index, line.char", (char *)NULL);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetIndex --
- *
- * Get the index from a string representing a text index.
- *
- *
- * Results:
- * A standard TCL result. If "string" is a valid index, then
- * *indexPtr is filled with the numeric index corresponding.
- * Otherwise an error message is left in interp->result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetIndex(
- HText *htPtr, /* Text for which the index is being
- * specified. */
- Tcl_Obj *objPtr, /* Numerical index into htPtr's element
- * list, or "end" to refer to last element. */
- int *indexPtr) /* Where to store converted relief. */
-{
- int tindex;
-
- if (ParseIndex(htPtr, objPtr, &tindex) != TCL_OK) {
- return TCL_ERROR;
- }
- *indexPtr = tindex;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTextPosition --
- *
- * Performs a binary search for the index located on line in
- * the text. The search is limited to those lines between
- * low and high inclusive.
- *
- * Results:
- * Returns the line number at the given Y coordinate. If position
- * does not correspond to any of the lines in the given the set,
- * -1 is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetTextPosition(
- HText *htPtr,
- int tindex,
- int *lindexPtr,
- int *cindexPtr)
-{
- int lindex, cindex;
-
- lindex = cindex = 0;
- if (htPtr->nChars > 0) {
- Line *linePtr;
-
- lindex = IndexSearch(htPtr, tindex, 0, htPtr->nLines - 1);
- if (lindex < 0) {
- char string[200];
-
- sprintf_s(string, 200,
- "can't determine line number from index \"%d\"", tindex);
- Tcl_AppendResult(htPtr->interp, string, (char *)NULL);
- return TCL_ERROR;
- }
- linePtr = htPtr->lineArr + lindex;
- if (tindex > linePtr->textEnd) {
- tindex = linePtr->textEnd;
- }
- cindex = tindex - linePtr->textStart;
- }
- *lindexPtr = lindex;
- *cindexPtr = cindex;
- return TCL_OK;
-}
-
-/* EmbeddedWidget Procedures */
-/*
- *---------------------------------------------------------------------------
- *
- * GetEmbeddedWidgetWidth --
- *
- * Returns the width requested by the embedded widget. The requested
- * space also includes any internal padding which has been designated
- * for this window.
- *
- * Results:
- * Returns the requested width of the embedded widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetEmbeddedWidgetWidth(EmbeddedWidget *winPtr)
-{
- int width;
-
- if (winPtr->reqWidth > 0) {
- width = winPtr->reqWidth;
- } else if (winPtr->relWidth > 0.0) {
- width = (int)
- ((double)Tk_Width(winPtr->htPtr->tkwin) * winPtr->relWidth + 0.5);
- } else {
- width = Tk_ReqWidth(winPtr->tkwin);
- }
- width += (2 * winPtr->ixPad);
- return width;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetEmbeddedWidgetHeight --
- *
- * Returns the height requested by the embedded widget. The requested
- * space also includes any internal padding which has been designated
- * for this window.
- *
- * Results:
- * Returns the requested height of the embedded widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetEmbeddedWidgetHeight(EmbeddedWidget *winPtr)
-{
- int height;
-
- if (winPtr->reqHeight > 0) {
- height = winPtr->reqHeight;
- } else if (winPtr->relHeight > 0.0) {
- height = (int)((double)Tk_Height(winPtr->htPtr->tkwin) *
- winPtr->relHeight + 0.5);
- } else {
- height = Tk_ReqHeight(winPtr->tkwin);
- }
- height += (2 * winPtr->iyPad);
- return height;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EmbeddedWidgetEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various
- * events on hypertext widgets.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EmbeddedWidgetEventProc(
- ClientData clientData, /* Information about the embedded widget. */
- XEvent *eventPtr) /* Information about event. */
-{
- EmbeddedWidget *winPtr = clientData;
- HText *htPtr;
-
- if ((winPtr == NULL) || (winPtr->tkwin == NULL)) {
- return;
- }
- htPtr = winPtr->htPtr;
-
- if (eventPtr->type == DestroyNotify) {
- Blt_HashEntry *hPtr;
- /*
- * Mark the widget as deleted by dereferencing the Tk window
- * pointer. Zero out the height and width to collapse the area
- * used by the widget. Redraw the window only if the widget is
- * currently visible.
- */
- winPtr->htPtr->flags |= REQUEST_LAYOUT;
- if (Tk_IsMapped(winPtr->tkwin) && (winPtr->flags & WIDGET_VISIBLE)) {
- EventuallyRedraw(htPtr);
- }
- Tk_DeleteEventHandler(winPtr->tkwin, StructureNotifyMask,
- EmbeddedWidgetEventProc, winPtr);
- hPtr = Blt_FindHashEntry(&htPtr->widgetTable, (char *)winPtr->tkwin);
- Blt_DeleteHashEntry(&htPtr->widgetTable, hPtr);
- winPtr->cavityWidth = winPtr->cavityHeight = 0;
- winPtr->tkwin = NULL;
-
- } else if (eventPtr->type == ConfigureNotify) {
- /*
- * EmbeddedWidgets can't request new positions. Worry only about resizing.
- */
- if (winPtr->winWidth != Tk_Width(winPtr->tkwin) ||
- winPtr->winHeight != Tk_Height(winPtr->tkwin)) {
- EventuallyRedraw(htPtr);
- htPtr->flags |= REQUEST_LAYOUT;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EmbeddedWidgetCustodyProc --
- *
- * This procedure is invoked when a embedded widget has been
- * stolen by another geometry manager. The information and
- * memory associated with the embedded widget is released.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the widget formerly associated with the widget
- * to have its layout re-computed and arranged at the
- * next idle point.
- *
- *---------------------------------------------------------------------------
- */
- /* ARGSUSED */
-static void
-EmbeddedWidgetCustodyProc(
- ClientData clientData, /* Information about the former
- * embedded widget. */
- Tk_Window tkwin) /* Not used. */
-{
- Blt_HashEntry *hPtr;
- EmbeddedWidget *winPtr = clientData;
- /*
- * Mark the widget as deleted by dereferencing the Tk window
- * pointer. Zero out the height and width to collapse the area
- * used by the widget. Redraw the window only if the widget is
- * currently visible.
- */
- winPtr->htPtr->flags |= REQUEST_LAYOUT;
- if (Tk_IsMapped(winPtr->tkwin) && (winPtr->flags & WIDGET_VISIBLE)) {
- EventuallyRedraw(winPtr->htPtr);
- }
- Tk_DeleteEventHandler(winPtr->tkwin, StructureNotifyMask,
- EmbeddedWidgetEventProc, winPtr);
- hPtr = Blt_FindHashEntry(&winPtr->htPtr->widgetTable,
- (char *)winPtr->tkwin);
- Blt_DeleteHashEntry(&winPtr->htPtr->widgetTable, hPtr);
- winPtr->cavityWidth = winPtr->cavityHeight = 0;
- winPtr->tkwin = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EmbeddedWidgetGeometryProc --
- *
- * This procedure is invoked by Tk_GeometryRequest for
- * embedded widgets managed by the hypertext widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for tkwin, and all its managed siblings, to
- * be repacked and drawn at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
- /* ARGSUSED */
-static void
-EmbeddedWidgetGeometryProc(
- ClientData clientData, /* Information about window that got new
- * preferred geometry. */
- Tk_Window tkwin) /* Not used. */
-{
- EmbeddedWidget *winPtr = clientData;
-
- winPtr->htPtr->flags |= REQUEST_LAYOUT;
- EventuallyRedraw(winPtr->htPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindEmbeddedWidget --
- *
- * Searches for a widget matching the path name given
- * If found, the pointer to the widget structure is returned,
- * otherwise NULL.
- *
- * Results:
- * The pointer to the widget structure. If not found, NULL.
- *
- *---------------------------------------------------------------------------
- */
-static EmbeddedWidget *
-FindEmbeddedWidget(
- HText *htPtr, /* Hypertext widget structure */
- Tk_Window tkwin) /* Path name of embedded widget */
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&htPtr->widgetTable, (char *)tkwin);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateEmbeddedWidget --
- *
- * This procedure creates and initializes a new embedded widget
- * in the hyper text widget.
- *
- * Results:
- * The return value is a pointer to a structure describing the
- * new embedded widget. If an error occurred, then the return
- * value is NULL and an error message is left in interp->result.
- *
- * Side effects:
- * Memory is allocated. EmbeddedWidget window is mapped.
- * Callbacks are set up for embedded widget resizes and geometry
- * requests.
- *
- *---------------------------------------------------------------------------
- */
-static EmbeddedWidget *
-CreateEmbeddedWidget(
- HText *htPtr, /* Hypertext widget */
- char *name) /* Name of embedded widget */
-{
- EmbeddedWidget *winPtr;
- Tk_Window tkwin;
- Blt_HashEntry *hPtr;
- int isNew;
-
- tkwin = Tk_NameToWindow(htPtr->interp, name, htPtr->tkwin);
- if (tkwin == NULL) {
- return NULL;
- }
- if (Tk_Parent(tkwin) != htPtr->tkwin) {
- Tcl_AppendResult(htPtr->interp, "parent window of \"", name,
- "\" must be \"", Tk_PathName(htPtr->tkwin), "\"", (char *)NULL);
- return NULL;
- }
- hPtr = Blt_CreateHashEntry(&htPtr->widgetTable, (char *)tkwin, &isNew);
- /* Check is the widget is already embedded into this widget */
- if (!isNew) {
- Tcl_AppendResult(htPtr->interp, "\"", name,
- "\" is already appended to ", Tk_PathName(htPtr->tkwin),
- (char *)NULL);
- return NULL;
- }
- winPtr = Blt_AssertCalloc(1, sizeof(EmbeddedWidget));
- winPtr->flags = 0;
- winPtr->tkwin = tkwin;
- winPtr->htPtr = htPtr;
- winPtr->x = winPtr->y = 0;
- winPtr->fill = FILL_NONE;
- winPtr->justify = JUSTIFY_CENTER;
- winPtr->anchor = TK_ANCHOR_CENTER;
- Blt_SetHashValue(hPtr, winPtr);
-
- Tk_ManageGeometry(tkwin, &htextMgrInfo, winPtr);
- Tk_CreateEventHandler(tkwin, StructureNotifyMask, EmbeddedWidgetEventProc,
- winPtr);
- return winPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyEmbeddedWidget --
- *
- * This procedure is invoked by DestroyLine to clean up the
- * internal structure of a widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyEmbeddedWidget(EmbeddedWidget *winPtr)
-{
- /* Destroy the embedded widget if it still exists */
- if (winPtr->tkwin != NULL) {
- Blt_HashEntry *hPtr;
-
- Tk_DeleteEventHandler(winPtr->tkwin, StructureNotifyMask,
- EmbeddedWidgetEventProc, winPtr);
- hPtr = Blt_FindHashEntry(&winPtr->htPtr->widgetTable,
- (char *)winPtr->tkwin);
- Blt_DeleteHashEntry(&winPtr->htPtr->widgetTable, hPtr);
- Tk_DestroyWindow(winPtr->tkwin);
- }
- Blt_Free(winPtr);
-}
-
-/* Line Procedures */
-/*
- *---------------------------------------------------------------------------
- *
- * CreateLine --
- *
- * This procedure creates and initializes a new line of text.
- *
- * Results:
- * The return value is a pointer to a structure describing the new
- * line of text. If an error occurred, then the return value is NULL
- * and an error message is left in interp->result.
- *
- * Side effects:
- * Memory is allocated.
- *
- *---------------------------------------------------------------------------
- */
-static Line *
-CreateLine(HText *htPtr)
-{
- Line *linePtr;
-
- if (htPtr->nLines >= htPtr->arraySize) {
- if (htPtr->arraySize == 0) {
- htPtr->arraySize = DEF_LINES_ALLOC;
- } else {
- htPtr->arraySize += htPtr->arraySize;
- }
- htPtr->lineArr = ResizeArray(htPtr->lineArr, sizeof(Line),
- htPtr->arraySize, htPtr->nLines);
- }
- /* Initialize values in the new entry */
-
- linePtr = htPtr->lineArr + htPtr->nLines;
- linePtr->offset = 0;
- linePtr->height = linePtr->width = 0;
- linePtr->textStart = 0;
- linePtr->textEnd = -1;
- linePtr->baseline = 0;
- linePtr->chain = Blt_Chain_Create();
-
- htPtr->nLines++;
- return linePtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyLine --
- *
- * This procedure is invoked to clean up the internal structure
- * of a line.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the line (text and widgets) is
- * freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyLine(Line *linePtr)
-{
- Blt_ChainLink link;
- EmbeddedWidget *winPtr;
-
- /* Free the list of embedded widget structures */
- for (link = Blt_Chain_FirstLink(linePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- winPtr = Blt_Chain_GetValue(link);
- DestroyEmbeddedWidget(winPtr);
- }
- Blt_Chain_Destroy(linePtr->chain);
-}
-
-static void
-FreeText(HText *htPtr)
-{
- int i;
-
- for (i = 0; i < htPtr->nLines; i++) {
- DestroyLine(htPtr->lineArr + i);
- }
- htPtr->nLines = 0;
- htPtr->nChars = 0;
- if (htPtr->charArr != NULL) {
- Blt_Free(htPtr->charArr);
- htPtr->charArr = NULL;
- }
-}
-
-/* Text Procedures */
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyText --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of a HText at a safe time
- * (when no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyText(DestroyData dataPtr) /* Info about hypertext widget. */
-{
- HText *htPtr = (HText *)dataPtr;
-
- Blt_FreeOptions(configSpecs, (char *)htPtr, htPtr->display, 0);
- if (htPtr->drawGC != NULL) {
- Tk_FreeGC(htPtr->display, htPtr->drawGC);
- }
- if (htPtr->fillGC != NULL) {
- Tk_FreeGC(htPtr->display, htPtr->fillGC);
- }
- if (htPtr->selectGC != NULL) {
- Tk_FreeGC(htPtr->display, htPtr->selectGC);
- }
- FreeText(htPtr);
- if (htPtr->lineArr != NULL) {
- Blt_Free(htPtr->lineArr);
- }
- Blt_DeleteHashTable(&htPtr->widgetTable);
- Blt_Free(htPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various
- * events on hypertext widgets.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TextEventProc(
- ClientData clientData, /* Information about window. */
- XEvent *eventPtr) /* Information about event. */
-{
- HText *htPtr = clientData;
-
- if (eventPtr->type == ConfigureNotify) {
- if ((htPtr->lastWidth != Tk_Width(htPtr->tkwin)) ||
- (htPtr->lastHeight != Tk_Height(htPtr->tkwin))) {
- htPtr->flags |= (REQUEST_LAYOUT | TEXT_DIRTY);
- EventuallyRedraw(htPtr);
- }
- } else if (eventPtr->type == Expose) {
-
- /*
- * If the Expose event was synthetic (i.e. we manufactured it
- * ourselves during a redraw operation), toggle the bit flag
- * which controls redraws.
- */
-
- if (eventPtr->xexpose.send_event) {
- htPtr->flags ^= IGNORE_EXPOSURES;
- return;
- }
- if ((eventPtr->xexpose.count == 0) &&
- !(htPtr->flags & IGNORE_EXPOSURES)) {
- htPtr->flags |= TEXT_DIRTY;
- EventuallyRedraw(htPtr);
- }
- } else if (eventPtr->type == DestroyNotify) {
- if (htPtr->tkwin != NULL) {
- htPtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(htPtr->interp, htPtr->cmdToken);
- }
- if (htPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayText, htPtr);
- }
- Tcl_EventuallyFree(htPtr, DestroyText);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextDeleteCmdProc --
- *
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-TextDeleteCmdProc(ClientData clientData) /* Pointer to widget record. */
-{
- HText *htPtr = clientData;
-
- /*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin
- * is NULL) or because the command was deleted, and then this procedure
- * destroys the widget.
- */
-
- if (htPtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = htPtr->tkwin;
- htPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BackgroundChangedProc
- *
- * Stub for image change notifications. Since we immediately draw
- * the image into a pixmap, we don't care about image changes.
- *
- * It would be better if Tk checked for NULL proc pointers.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-BackgroundChangedProc(ClientData clientData)
-{
- HText *htPtr = clientData;
-
- if (htPtr->tkwin != NULL) {
- EventuallyRedraw(htPtr);
- }
-}
-
-/* Configuration Procedures */
-static void
-ResetTextInfo(HText *htPtr)
-{
- htPtr->first = 0;
- htPtr->last = htPtr->nLines - 1;
- htPtr->selFirst = htPtr->selLast = -1;
- htPtr->selAnchor = 0;
- htPtr->pendingX = htPtr->pendingY = 0;
- htPtr->worldWidth = htPtr->worldHeight = 0;
- htPtr->xOffset = htPtr->yOffset = 0;
-}
-
-static Line *
-GetLastLine(HText *htPtr)
-{
- if (htPtr->nLines == 0) {
- return CreateLine(htPtr);
- }
- return (htPtr->lineArr + (htPtr->nLines - 1));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReadNamedFile --
- *
- * Read the named file into a newly allocated buffer.
- *
- * Results:
- * Returns the size of the allocated buffer if the file was
- * read correctly. Otherwise -1 is returned and "interp->result"
- * will contain an error message.
- *
- * Side Effects:
- * If successful, the contents of "bufferPtr" will point
- * to the allocated buffer.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ReadNamedFile(Tcl_Interp *interp, char *fileName, char **bufferPtr)
-{
- FILE *f;
- int nRead;
- size_t fileSize;
- int count, bytesLeft;
- char *buffer;
- struct stat fileInfo;
-
- f = Blt_OpenFile(interp, fileName, "r");
- if (f == NULL) {
- return -1;
- }
- if (fstat(fileno(f), &fileInfo) < 0) {
- Tcl_AppendResult(interp, "can't stat \"", fileName, "\": ",
- Tcl_PosixError(interp), (char *)NULL);
- fclose(f);
- return -1;
- }
- fileSize = fileInfo.st_size + 1;
- buffer = Blt_Malloc(sizeof(char) * fileSize);
- if (buffer == NULL) {
- fclose(f);
- return -1; /* Can't allocate memory for file buffer */
- }
- count = 0;
- for (bytesLeft = fileInfo.st_size; bytesLeft > 0; bytesLeft -= nRead) {
- nRead = fread(buffer + count, sizeof(char), bytesLeft, f);
- if (nRead < 0) {
- Tcl_AppendResult(interp, "error reading \"", fileName, "\": ",
- Tcl_PosixError(interp), (char *)NULL);
- fclose(f);
- Blt_Free(buffer);
- return -1;
- } else if (nRead == 0) {
- break;
- }
- count += nRead;
- }
- fclose(f);
- buffer[count] = '\0';
- *bufferPtr = buffer;
- return count;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CollectCommand --
- *
- * Collect the characters representing a TCL command into a
- * given buffer.
- *
- * Results:
- * Returns the number of bytes examined. If an error occurred,
- * -1 is returned and "interp->result" will contain an error
- * message.
- *
- * Side Effects:
- * If successful, the "cmdArr" will be filled with the string
- * representing the TCL command.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-CollectCommand(
- HText *htPtr, /* Widget record */
- char inputArr[], /* Array of bytes representing the
- * htext input */
- int maxBytes, /* Maximum number of bytes left in input */
- char cmdArr[]) /* Output buffer to be filled with the Tcl
- * command */
-{
- int c;
- int i;
- int state, count;
-
- /* Simply collect the all the characters until %% into a buffer */
-
- state = count = 0;
- for (i = 0; i < maxBytes; i++) {
- c = inputArr[i];
- if (c == htPtr->specChar) {
- state++;
- } else if ((state == 0) && (c == '\\')) {
- state = 3;
- } else {
- state = 0;
- }
- switch (state) {
- case 2: /* End of command block found */
- cmdArr[count - 1] = '\0';
- return i;
-
- case 4: /* Escaped block designator */
- cmdArr[count] = c;
- state = 0;
- break;
-
- default: /* Add to command buffer */
- cmdArr[count++] = c;
- break;
- }
- }
- Tcl_AppendResult(htPtr->interp, "premature end of TCL command block",
- (char *)NULL);
- return -1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ParseInput --
- *
- * Parse the input to the HText structure into an array of lines.
- * Each entry contains the beginning index and end index of the
- * characters in the text array which comprise the line.
- *
- * |*|*|*|\n|T|h|i|s| |a| |l|i|n|e| |o|f| |t|e|x|t|.|\n|*|*|*|
- * ^ ^
- * textStart textEnd
- *
- * Note that the end index contains the '\n'.
- *
- * Results:
- * Returns TCL_OK or error depending if the file was read correctly.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ParseInput(
- Tcl_Interp *interp,
- HText *htPtr,
- char input[],
- int nBytes)
-{
- int c;
- int i;
- char *textArr;
- char *cmdArr;
- int count, nLines;
- int length;
- int state;
- Line *linePtr;
-
- linePtr = CreateLine(htPtr);
- if (linePtr == NULL) {
- return TCL_ERROR; /* Error allocating the line structure */
- }
- /* Right now, we replace the text array instead of appending to it */
-
- linePtr->textStart = 0;
-
- /* In the worst case, assume the entire input could be TCL commands */
- cmdArr = Blt_AssertMalloc(sizeof(char) * (nBytes + 1));
- textArr = Blt_AssertMalloc(sizeof(char) * (nBytes + 1));
- if (htPtr->charArr != NULL) {
- Blt_Free(htPtr->charArr);
- }
- htPtr->charArr = textArr;
- htPtr->nChars = 0;
-
- nLines = count = state = 0;
- htPtr->flags &= ~WIDGET_APPENDED;
-
- for (i = 0; i < nBytes; i++) {
- c = input[i];
- if (c == htPtr->specChar) {
- state++;
- } else if (c == '\n') {
- state = -1;
- } else if ((state == 0) && (c == '\\')) {
- state = 3;
- } else {
- state = 0;
- }
- switch (state) {
- case 2: /* Block of TCL commands found */
- count--, i++;
- length = CollectCommand(htPtr, input + i, nBytes - i, cmdArr);
- if (length < 0) {
- goto error;
- }
- i += length;
- linePtr->textEnd = count;
- htPtr->nChars = count + 1;
- if (Tcl_Eval(interp, cmdArr) != TCL_OK) {
- goto error;
- }
- if (htPtr->flags & WIDGET_APPENDED) {
- /* Indicates the location a embedded widget in the text array */
- textArr[count++] = ' ';
- htPtr->flags &= ~WIDGET_APPENDED;
- }
- state = 0;
- break;
-
- case 4: /* Escaped block designator */
- textArr[count - 1] = c;
- state = 0;
- break;
-
- case -1: /* End of line or input */
- linePtr->textEnd = count;
- textArr[count++] = '\n';
- nLines++;
- linePtr = CreateLine(htPtr);
- if (linePtr == NULL) {
- goto error;
- }
- linePtr->textStart = count;
- state = 0;
- break;
-
- default: /* Default action, add to text buffer */
- textArr[count++] = c;
- break;
- }
- }
- if (count > linePtr->textStart) {
- linePtr->textEnd = count;
- textArr[count++] = '\n';/* Every line must end with a '\n' */
- nLines++;
- }
- Blt_Free(cmdArr);
- /* Reset number of lines allocated */
- htPtr->lineArr = ResizeArray(htPtr->lineArr, sizeof(Line), nLines,
- htPtr->arraySize);
- htPtr->nLines = htPtr->arraySize = nLines;
- /* and the size of the character array */
- htPtr->charArr = ResizeArray(htPtr->charArr, sizeof(char), count, nBytes);
- htPtr->nChars = count;
- return TCL_OK;
- error:
- Blt_Free(cmdArr);
- return TCL_ERROR;
-}
-
-static int
-IncludeText(
- Tcl_Interp *interp,
- HText *htPtr,
- char *fileName)
-{
- char *buffer;
- int result;
- int nBytes;
-
- if ((htPtr->text == NULL) && (fileName == NULL)) {
- return TCL_OK; /* Empty text string */
- }
- if (fileName != NULL) {
- nBytes = ReadNamedFile(interp, fileName, &buffer);
- if (nBytes < 0) {
- return TCL_ERROR;
- }
- } else {
- buffer = htPtr->text;
- nBytes = strlen(htPtr->text);
- }
- result = ParseInput(interp, htPtr, buffer, nBytes);
- if (fileName != NULL) {
- Blt_Free(buffer);
- }
- return result;
-}
-
-/* ARGSUSED */
-static char *
-TextVarProc(
- ClientData clientData, /* Information about widget. */
- Tcl_Interp *interp, /* Interpreter containing variable. */
- const char *name1, /* Name of variable. */
- const char *name2, /* Second part of variable name. */
- int flags) /* Information about what happened. */
-{
- HText *htPtr = clientData;
- HText *lasthtPtr;
-
- /* Check to see of this is the most recent trace */
- lasthtPtr = (HText *)Tcl_VarTraceInfo2(interp, name1, name2, flags,
- TextVarProc, NULL);
- if (lasthtPtr != htPtr) {
- return NULL; /* Ignore all but most current trace */
- }
- if (flags & TCL_TRACE_READS) {
- char c;
-
- c = name2[0];
- if ((c == 'w') && (strcmp(name2, "widget") == 0)) {
- Tcl_SetVar2(interp, name1, name2, Tk_PathName(htPtr->tkwin),
- flags);
- } else if ((c == 'l') && (strcmp(name2, "line") == 0)) {
- char buf[200];
- int lineNum;
-
- lineNum = htPtr->nLines - 1;
- if (lineNum < 0) {
- lineNum = 0;
- }
- sprintf_s(buf, 200, "%d", lineNum);
- Tcl_SetVar2(interp, name1, name2, buf, flags);
- } else if ((c == 'i') && (strcmp(name2, "index") == 0)) {
- char buf[200];
-
- sprintf_s(buf, 200, "%d", htPtr->nChars - 1);
- Tcl_SetVar2(interp, name1, name2, buf, flags);
- } else if ((c == 'f') && (strcmp(name2, "file") == 0)) {
- const char *fileName;
-
- fileName = htPtr->fileName;
- if (fileName == NULL) {
- fileName = "";
- }
- Tcl_SetVar2(interp, name1, name2, fileName, flags);
- } else {
- return (char *)"?unknown?";
- }
- }
- return NULL;
-}
-
-static const char *varNames[] = {
- "widget", "line", "file", "index", (char *)NULL
-};
-
-static void
-CreateTraces(HText *htPtr)
-{
- const char **p;
- static char globalCmd[] = "global htext";
-
- /*
- * Make the traced variables global to the widget
- */
- Tcl_Eval(htPtr->interp, globalCmd);
- for (p = varNames; *p != NULL; p++) {
- Tcl_TraceVar2(htPtr->interp, "htext", *p,
- (TCL_GLOBAL_ONLY | TCL_TRACE_READS), TextVarProc, htPtr);
- }
-}
-
-static void
-DeleteTraces(HText *htPtr)
-{
- const char **p;
-
- for (p = varNames; *p != NULL; p++) {
- Tcl_UntraceVar2(htPtr->interp, "htext", *p,
- (TCL_GLOBAL_ONLY | TCL_TRACE_READS), TextVarProc, htPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureText --
- *
- * This procedure is called to process an objv/objc list, plus
- * the Tk option database, in order to configure (or reconfigure)
- * a hypertext widget.
- *
- * The layout of the text must be calculated (by ComputeLayout)
- * whenever particular options change; -font, -file, -linespacing
- * and -text options. If the user has changes one of these options,
- * it must be detected so that the layout can be recomputed. Since the
- * coordinates of the layout are virtual, there is no need to adjust
- * them if physical window attributes (window size, etc.)
- * change.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is
- * returned, then interp->result contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for htPtr; old resources get freed, if there were any.
- * The hypertext is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureText(
- Tcl_Interp *interp, /* Used for error reporting. */
- HText *htPtr) /* Information about widget; may or may not
- * already have values for some fields. */
-{
- XGCValues gcValues;
- unsigned long gcMask;
- GC newGC;
-
- if (Blt_ConfigModified(configSpecs, "-font", "-linespacing", "-file",
- "-text", "-width", "-height", (char *)NULL)) {
- /*
- * These options change the layout of the text. Width/height
- * and rows/columns may change a relatively sized window or cavity.
- */
- htPtr->flags |= (REQUEST_LAYOUT | TEXT_DIRTY); /* Mark for update */
- }
- gcMask = GCForeground | GCFont;
- gcValues.font = Blt_FontId(htPtr->font);
- gcValues.foreground = htPtr->normalFg->pixel;
- newGC = Tk_GetGC(htPtr->tkwin, gcMask, &gcValues);
- if (htPtr->drawGC != NULL) {
- Tk_FreeGC(htPtr->display, htPtr->drawGC);
- }
- htPtr->drawGC = newGC;
-
- gcValues.foreground = htPtr->selFgColor->pixel;
- newGC = Tk_GetGC(htPtr->tkwin, gcMask, &gcValues);
- if (htPtr->selectGC != NULL) {
- Tk_FreeGC(htPtr->display, htPtr->selectGC);
- }
- htPtr->selectGC = newGC;
-
- if (htPtr->xScrollUnits < 1) {
- htPtr->xScrollUnits = 1;
- }
- if (htPtr->yScrollUnits < 1) {
- htPtr->yScrollUnits = 1;
- }
- if (htPtr->normalBg != NULL) {
- Blt_SetBackgroundChangedProc(htPtr->normalBg, BackgroundChangedProc,
- htPtr);
- }
- if (htPtr->selBg != NULL) {
- Blt_SetBackgroundChangedProc(htPtr->selBg, BackgroundChangedProc,
- htPtr);
- }
- gcValues.foreground = Blt_BackgroundBorderColor(htPtr->normalBg)->pixel;
- newGC = Tk_GetGC(htPtr->tkwin, gcMask, &gcValues);
- if (htPtr->fillGC != NULL) {
- Tk_FreeGC(htPtr->display, htPtr->fillGC);
- }
- htPtr->fillGC = newGC;
-
- if (htPtr->nColumns > 0) {
- htPtr->reqWidth =
- htPtr->nColumns * Blt_TextWidth(htPtr->font, "0", 1);
- }
- if (htPtr->nRows > 0) {
- Blt_FontMetrics fontMetrics;
-
- Blt_GetFontMetrics(htPtr->font, &fontMetrics);
- htPtr->reqHeight = htPtr->nRows * fontMetrics.linespace;
- }
- /*
- * If the either the -text or -file option changed, read in the
- * new text. The -text option supersedes any -file option.
- */
- if (Blt_ConfigModified(configSpecs, "-file", "-text", (char *)NULL)) {
- int result;
-
- FreeText(htPtr);
- CreateTraces(htPtr); /* Create variable traces */
-
- result = IncludeText(interp, htPtr, htPtr->fileName);
-
- DeleteTraces(htPtr);
- if (result == TCL_ERROR) {
- FreeText(htPtr);
- return TCL_ERROR;
- }
- ResetTextInfo(htPtr);
- }
- EventuallyRedraw(htPtr);
- return TCL_OK;
-}
-
-/* Layout Procedures */
-/*
- *---------------------------------------------------------------------------
- *
- * TranslateAnchor --
- *
- * Translate the coordinates of a given bounding box based
- * upon the anchor specified. The anchor indicates where
- * the given xy position is in relation to the bounding box.
- *
- * nw --- n --- ne
- * | | x,y ---+
- * w center e | |
- * | | +-----+
- * sw --- s --- se
- *
- * Results:
- * The translated coordinates of the bounding box are returned.
- *
- *---------------------------------------------------------------------------
- */
-static XPoint
-TranslateAnchor(
- int deltaX, int deltaY, /* Difference between outer/inner regions */
- Tk_Anchor anchor) /* Direction of the anchor */
-{
- XPoint point;
-
- point.x = point.y = 0;
- switch (anchor) {
- case TK_ANCHOR_NW: /* Upper left corner */
- break;
- case TK_ANCHOR_W: /* Left center */
- point.y = (deltaY / 2);
- break;
- case TK_ANCHOR_SW: /* Lower left corner */
- point.y = deltaY;
- break;
- case TK_ANCHOR_N: /* Top center */
- point.x = (deltaX / 2);
- break;
- case TK_ANCHOR_CENTER: /* Centered */
- point.x = (deltaX / 2);
- point.y = (deltaY / 2);
- break;
- case TK_ANCHOR_S: /* Bottom center */
- point.x = (deltaX / 2);
- point.y = deltaY;
- break;
- case TK_ANCHOR_NE: /* Upper right corner */
- point.x = deltaX;
- break;
- case TK_ANCHOR_E: /* Right center */
- point.x = deltaX;
- point.y = (deltaY / 2);
- break;
- case TK_ANCHOR_SE: /* Lower right corner */
- point.x = deltaX;
- point.y = deltaY;
- break;
- }
- return point;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeCavitySize --
- *
- * Sets the width and height of the cavity based upon the
- * requested size of the embedded widget. The requested space also
- * includes any external padding which has been designated for
- * this window.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of the cavity is set in the embedded widget information
- * structure. These values can effect how the embedded widget is
- * packed into the master window.
-
- *---------------------------------------------------------------------------
- */
-static void
-ComputeCavitySize(EmbeddedWidget *winPtr)
-{
- int width, height;
- int twiceBW;
-
- twiceBW = 2 * Tk_Changes(winPtr->tkwin)->border_width;
- if (winPtr->reqCavityWidth > 0) {
- width = winPtr->reqCavityWidth;
- } else if (winPtr->relCavityWidth > 0.0) {
- width = (int)((double)Tk_Width(winPtr->htPtr->tkwin) *
- winPtr->relCavityWidth + 0.5);
- } else {
- width = GetEmbeddedWidgetWidth(winPtr) + PADDING(winPtr->xPad) +
- twiceBW;
- }
- winPtr->cavityWidth = width;
-
- if (winPtr->reqCavityHeight > 0) {
- height = winPtr->reqCavityHeight;
- } else if (winPtr->relCavityHeight > 0.0) {
- height = (int)((double)Tk_Height(winPtr->htPtr->tkwin) *
- winPtr->relCavityHeight + 0.5);
- } else {
- height = GetEmbeddedWidgetHeight(winPtr) + PADDING(winPtr->yPad) +
- twiceBW;
- }
- winPtr->cavityHeight = height;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LayoutLine --
- *
- * This procedure computes the total width and height needed
- * to contain the text and widgets for a particular line.
- * It also calculates the baseline of the text on the line with
- * respect to the other widgets on the line.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LayoutLine(HText *htPtr, Line *linePtr)
-{
- EmbeddedWidget *winPtr;
- int textStart, textLength;
- int maxAscent, maxDescent, maxHeight;
- int ascent, descent;
- int median; /* Difference of font ascent/descent values */
- Blt_ChainLink link;
- int x, y;
- int newX;
- Blt_FontMetrics fontMetrics;
-
- /* Initialize line defaults */
- Blt_GetFontMetrics(htPtr->font, &fontMetrics);
- maxAscent = fontMetrics.ascent;
- maxDescent = fontMetrics.descent;
- median = fontMetrics.ascent - fontMetrics.descent;
- ascent = descent = 0; /* Suppress compiler warnings */
-
- /*
- * Pass 1: Determine the maximum ascent (baseline) and descent
- * needed for the line. We'll need this for figuring the top,
- * bottom, and center anchors.
- */
- for (link = Blt_Chain_FirstLink(linePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- winPtr = Blt_Chain_GetValue(link);
- if (winPtr->tkwin == NULL) {
- continue;
- }
- ComputeCavitySize(winPtr);
-
- switch (winPtr->justify) {
- case JUSTIFY_TOP:
- ascent = fontMetrics.ascent + winPtr->padTop;
- descent = winPtr->cavityHeight - fontMetrics.ascent;
- break;
- case JUSTIFY_CENTER:
- ascent = (winPtr->cavityHeight + median) / 2;
- descent = (winPtr->cavityHeight - median) / 2;
- break;
- case JUSTIFY_BOTTOM:
- ascent = winPtr->cavityHeight - fontMetrics.descent;
- descent = fontMetrics.descent;
- break;
- }
- if (descent > maxDescent) {
- maxDescent = descent;
- }
- if (ascent > maxAscent) {
- maxAscent = ascent;
- }
- }
-
- maxHeight = maxAscent + maxDescent + htPtr->leader;
- x = 0; /* Always starts from x=0 */
- y = 0; /* Suppress compiler warning */
- textStart = linePtr->textStart;
-
- /*
- * Pass 2: Find the placements of the text and widgets along each
- * line.
- */
- for (link = Blt_Chain_FirstLink(linePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- winPtr = Blt_Chain_GetValue(link);
- if (winPtr->tkwin == NULL) {
- continue;
- }
- /* Get the width of the text leading to the widget. */
- textLength = (winPtr->precedingTextEnd - textStart);
- if (textLength > 0) {
- Blt_MeasureChars(htPtr->font, htPtr->charArr + textStart,
- textLength, 10000, TK_AT_LEAST_ONE, &newX);
- winPtr->precedingTextWidth = newX;
- x += newX;
- }
- switch (winPtr->justify) {
- case JUSTIFY_TOP:
- y = maxAscent - fontMetrics.ascent;
- break;
- case JUSTIFY_CENTER:
- y = maxAscent - (winPtr->cavityHeight + median) / 2;
- break;
- case JUSTIFY_BOTTOM:
- y = maxAscent + fontMetrics.descent - winPtr->cavityHeight;
- break;
- }
- winPtr->x = x, winPtr->y = y;
-
- /* Skip over trailing space */
- textStart = winPtr->precedingTextEnd + 1;
-
- x += winPtr->cavityWidth;
- }
-
- /*
- * This can be either the trailing piece of a line after the last widget
- * or the entire line if no widgets are embedded in it.
- */
- textLength = (linePtr->textEnd - textStart) + 1;
- if (textLength > 0) {
- Blt_MeasureChars(htPtr->font, htPtr->charArr + textStart,
- textLength, 10000, DEF_TEXT_FLAGS, &newX);
- x += newX;
- }
- /* Update line parameters */
- if ((linePtr->width != x) || (linePtr->height != maxHeight) ||
- (linePtr->baseline != maxAscent)) {
- htPtr->flags |= TEXT_DIRTY;
- }
- linePtr->width = x;
- linePtr->height = maxHeight;
- linePtr->baseline = maxAscent;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeLayout --
- *
- * This procedure computes the total width and height needed
- * to contain the text and widgets from all the lines of text.
- * It merely sums the heights and finds the maximum width of
- * all the lines. The width and height are needed for scrolling.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComputeLayout(HText *htPtr)
-{
- int count;
- Line *linePtr;
- int height, width;
-
- width = height = 0;
- for (count = 0; count < htPtr->nLines; count++) {
- linePtr = htPtr->lineArr + count;
-
- linePtr->offset = height;
- LayoutLine(htPtr, linePtr);
- height += linePtr->height;
- if (linePtr->width > width) {
- width = linePtr->width;
- }
- }
- /*
- * Set changed flag if new layout changed size of virtual text.
- */
- if ((height != htPtr->worldHeight) || (width != htPtr->worldWidth)) {
- htPtr->worldHeight = height, htPtr->worldWidth = width;
- htPtr->flags |= TEXT_DIRTY;
- }
-}
-
-/* Display Procedures */
-/*
- *---------------------------------------------------------------------------
- *
- * GetVisibleLines --
- *
- * Calculates which lines are visible using the height
- * of the viewport and y offset from the top of the text.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Only those line between first and last inclusive are
- * redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetVisibleLines(HText *htPtr)
-{
- int topLine, bottomLine;
- int firstY, lastY;
- int lastLine;
-
- if (htPtr->nLines == 0) {
- htPtr->first = 0;
- htPtr->last = -1;
- return TCL_OK;
- }
- firstY = htPtr->pendingY;
- lastLine = htPtr->nLines - 1;
-
- /* First line */
- topLine = LineSearch(htPtr, firstY, 0, lastLine);
- if (topLine < 0) {
- /*
- * This can't be. The y-coordinate offset must be corrupted.
- */
- fprintf(stderr, "internal error: First position not found `%d'\n",
- firstY);
- return TCL_ERROR;
- }
- htPtr->first = topLine;
-
- /*
- * If there is less text than window space, the bottom line is the
- * last line of text. Otherwise search for the line at the bottom
- * of the window.
- */
- lastY = firstY + Tk_Height(htPtr->tkwin) - 1;
- if (lastY < htPtr->worldHeight) {
- bottomLine = LineSearch(htPtr, lastY, topLine, lastLine);
- } else {
- bottomLine = lastLine;
- }
- if (bottomLine < 0) {
- /*
- * This can't be. The newY offset must be corrupted.
- */
- fprintf(stderr, "internal error: Last position not found `%d'\n",
- lastY);
-#ifdef notdef
- fprintf(stderr, "worldHeight=%d,height=%d,top=%d,first=%d,last=%d\n",
- htPtr->worldHeight, Tk_Height(htPtr->tkwin), firstY,
- htPtr->lineArr[topLine].offset, htPtr->lineArr[lastLine].offset);
-#endif
- return TCL_ERROR;
- }
- htPtr->last = bottomLine;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawSegment --
- *
- * Draws a line segment, designated by the segment structure.
- * This routine handles the display of selected text by drawing
- * a raised 3D border underneath the selected text.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The line segment is drawn on *draw*.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawSegment(
- HText *htPtr,
- Drawable draw,
- Line *linePtr,
- int x, int y,
- Segment *segPtr)
-{
- int lastX, curPos, nChars;
- int textLength;
- int selStart, selEnd, selLength;
- Blt_FontMetrics fontMetrics;
-
-#ifdef notdef
- fprintf(stderr, "DS select: first=%d,last=%d text: first=%d,last=%d\n",
- htPtr->selFirst, htPtr->selLast, segPtr->textStart, segPtr->textEnd);
-#endif
- textLength = (segPtr->textEnd - segPtr->textStart) + 1;
- if (textLength < 1) {
- return;
- }
- Blt_GetFontMetrics(htPtr->font, &fontMetrics);
- if ((segPtr->textEnd < htPtr->selFirst) ||
- (segPtr->textStart > htPtr->selLast)) { /* No selected text */
- Blt_DrawChars(Tk_Display(htPtr->tkwin), draw, htPtr->drawGC,
- htPtr->font, Tk_Depth(htPtr->tkwin), 0.0f,
- htPtr->charArr + segPtr->textStart, textLength - 1,
- x, y + linePtr->baseline);
- return;
- }
- /*
- * Text in a segment (with selected text) may have
- * up to three regions:
- *
- * 1) the text before the start the selection
- * 2) the selected text itself (drawn in a raised border)
- * 3) the text following the selection.
- */
-
- selStart = segPtr->textStart;
- selEnd = segPtr->textEnd;
- if (htPtr->selFirst > segPtr->textStart) {
- selStart = htPtr->selFirst;
- }
- if (htPtr->selLast < segPtr->textEnd) {
- selEnd = htPtr->selLast;
- }
- selLength = (selEnd - selStart) + 1;
- lastX = x;
- curPos = segPtr->textStart;
-
- if (selStart > segPtr->textStart) { /* Text preceding selection */
- nChars = (selStart - segPtr->textStart);
- Blt_MeasureChars(htPtr->font, htPtr->charArr + segPtr->textStart,
- nChars, 10000, DEF_TEXT_FLAGS, &lastX);
- lastX += x;
- Blt_DrawChars(Tk_Display(htPtr->tkwin), draw, htPtr->drawGC,
- htPtr->font, Tk_Depth(htPtr->tkwin), 0.0f,
- htPtr->charArr + segPtr->textStart, nChars,
- x, y + linePtr->baseline);
- curPos = selStart;
- }
- if (selLength > 0) { /* The selection itself */
- int width, nextX;
-
- Blt_MeasureChars(htPtr->font, htPtr->charArr + selStart,
- selLength, 10000, DEF_TEXT_FLAGS, &nextX);
- nextX += x;
- width = (selEnd == linePtr->textEnd)
- ? htPtr->worldWidth - htPtr->xOffset - lastX :
- nextX - lastX;
- Blt_FillBackgroundRectangle(htPtr->tkwin, draw, htPtr->selBg,
- lastX, y + linePtr->baseline - fontMetrics.ascent,
- width, fontMetrics.linespace, htPtr->selBW,
- TK_RELIEF_RAISED);
- Blt_DrawChars(Tk_Display(htPtr->tkwin), draw, htPtr->selectGC,
- htPtr->font, Tk_Depth(htPtr->tkwin), 0.0f,
- htPtr->charArr + selStart, selLength, lastX,
- y + linePtr->baseline);
- lastX = nextX;
- curPos = selStart + selLength;
- }
- nChars = segPtr->textEnd - curPos;
- if (nChars > 0) { /* Text following the selection */
- Blt_DrawChars(Tk_Display(htPtr->tkwin), draw, htPtr->drawGC,
- htPtr->font, Tk_Depth(htPtr->tkwin), 0.0f,
- htPtr->charArr + curPos, nChars - 1, lastX,
- y + linePtr->baseline);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MoveEmbeddedWidget --
- *
- * Move a embedded widget to a new location in the hypertext
- * parent window. If the window has no geometry (i.e. width,
- * or height is 0), simply unmap to window.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Each embedded widget is moved to its new location, generating
- * Expose events in the parent for each embedded widget moved.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MoveEmbeddedWidget(EmbeddedWidget *winPtr, int offset)
-{
- int winWidth, winHeight;
- int width, height;
- int deltaX, deltaY;
- int x, y;
- int intBW;
-
- winWidth = GetEmbeddedWidgetWidth(winPtr);
- winHeight = GetEmbeddedWidgetHeight(winPtr);
- if ((winWidth < 1) || (winHeight < 1)) {
- if (Tk_IsMapped(winPtr->tkwin)) {
- Tk_UnmapWindow(winPtr->tkwin);
- }
- return;
- }
- intBW = Tk_Changes(winPtr->tkwin)->border_width;
- x = (winPtr->x + intBW + winPtr->padLeft) -
- winPtr->htPtr->xOffset;
- y = offset + (winPtr->y + intBW + winPtr->padTop) -
- winPtr->htPtr->yOffset;
-
- width = winPtr->cavityWidth - (2 * intBW + PADDING(winPtr->xPad));
- if (width < 0) {
- width = 0;
- }
- if ((width < winWidth) || (winPtr->fill & FILL_X)) {
- winWidth = width;
- }
- deltaX = width - winWidth;
-
- height = winPtr->cavityHeight - (2 * intBW + PADDING(winPtr->yPad));
- if (height < 0) {
- height = 0;
- }
- if ((height < winHeight) || (winPtr->fill & FILL_Y)) {
- winHeight = height;
- }
- deltaY = height - winHeight;
-
- if ((deltaX > 0) || (deltaY > 0)) {
- XPoint point;
-
- point = TranslateAnchor(deltaX, deltaY, winPtr->anchor);
- x += point.x, y += point.y;
- }
- winPtr->winWidth = winWidth;
- winPtr->winHeight = winHeight;
-
- if ((x != Tk_X(winPtr->tkwin)) || (y != Tk_Y(winPtr->tkwin)) ||
- (winWidth != Tk_Width(winPtr->tkwin)) ||
- (winHeight != Tk_Height(winPtr->tkwin))) {
- Tk_MoveResizeWindow(winPtr->tkwin, x, y, winWidth, winHeight);
- }
- if (!Tk_IsMapped(winPtr->tkwin)) {
- Tk_MapWindow(winPtr->tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawPage --
- *
- * This procedure displays the lines of text and moves the widgets
- * to their new positions. It draws lines with regard to
- * the direction of the scrolling. The idea here is to make the
- * text and buttons appear to move together. Otherwise you will
- * get a "jiggling" effect where the windows appear to bump into
- * the next line before that line is moved. In the worst case, where
- * every line has at least one widget, you can get an aquarium effect
- * (lines appear to ripple up).
- *
- * The text area may start between line boundaries (to accommodate
- * both variable height lines and constant scrolling). Subtract the
- * difference of the page offset and the line offset from the starting
- * coordinates. For horizontal scrolling, simply subtract the offset
- * of the viewport. The window will clip the top of the first line,
- * the bottom of the last line, whatever text extends to the left
- * or right of the viewport on any line.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the line in its current
- * mode.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawPage(HText *htPtr, int deltaY) /* Change from previous Y coordinate */
-{
- Line *linePtr;
- EmbeddedWidget *winPtr;
- Tk_Window tkwin = htPtr->tkwin;
- Segment sgmt;
- Pixmap pixmap;
- int forceCopy;
- int i;
- int lineNum;
- int x, y, lastY;
- Blt_ChainLink link;
- int width, height;
- Display *display;
-
- display = htPtr->display;
- width = Tk_Width(tkwin);
- height = Tk_Height(tkwin);
-
- /* Create an off-screen pixmap for semi-smooth scrolling. */
- pixmap = Tk_GetPixmap(display, Tk_WindowId(tkwin), width, height,
- Tk_Depth(tkwin));
-
- x = -(htPtr->xOffset);
- y = -(htPtr->yOffset);
-
- if (htPtr->tileOffsetPage) {
- Blt_SetBackgroundOrigin(htPtr->tkwin, htPtr->normalBg, x, y);
- } else {
- Blt_SetBackgroundOrigin(htPtr->tkwin, htPtr->normalBg, 0, 0);
- }
- Blt_FillBackgroundRectangle(htPtr->tkwin, pixmap, htPtr->normalBg, 0, 0,
- width, height, TK_RELIEF_FLAT, 0);
-
- if (deltaY >= 0) {
- y += htPtr->lineArr[htPtr->first].offset;
- lineNum = htPtr->first;
- lastY = 0;
- } else {
- y += htPtr->lineArr[htPtr->last].offset;
- lineNum = htPtr->last;
- lastY = height;
- }
- forceCopy = 0;
-
- /* Draw each line */
- for (i = htPtr->first; i <= htPtr->last; i++) {
-
- /* Initialize character position in text buffer to start */
- linePtr = htPtr->lineArr + lineNum;
- sgmt.textStart = linePtr->textStart;
- sgmt.textEnd = linePtr->textEnd;
-
- /* Initialize X position */
- x = -(htPtr->xOffset);
- for (link = Blt_Chain_FirstLink(linePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- winPtr = Blt_Chain_GetValue(link);
-
- if (winPtr->tkwin != NULL) {
- winPtr->flags |= WIDGET_VISIBLE;
- MoveEmbeddedWidget(winPtr, linePtr->offset);
- }
- sgmt.textEnd = winPtr->precedingTextEnd - 1;
- if (sgmt.textEnd >= sgmt.textStart) {
- DrawSegment(htPtr, pixmap, linePtr, x, y, &sgmt);
- x += winPtr->precedingTextWidth;
- }
- /* Skip over the extra trailing space which designates the widget */
- sgmt.textStart = winPtr->precedingTextEnd + 1;
- x += winPtr->cavityWidth;
- forceCopy++;
- }
-
- /*
- * This may be the text trailing the last widget or the entire
- * line if no widgets occur on it.
- */
- sgmt.textEnd = linePtr->textEnd;
- if (sgmt.textEnd >= sgmt.textStart) {
- DrawSegment(htPtr, pixmap, linePtr, x, y, &sgmt);
- }
- /* Go to the top of the next line */
- if (deltaY >= 0) {
- y += htPtr->lineArr[lineNum].height;
- lineNum++;
- }
- if ((forceCopy > 0) && !(htPtr->flags & TEXT_DIRTY)) {
- if (deltaY >= 0) {
- XCopyArea(display, pixmap, Tk_WindowId(tkwin), htPtr->drawGC,
- 0, lastY, width, y - lastY, 0, lastY);
- } else {
- XCopyArea(display, pixmap, Tk_WindowId(tkwin), htPtr->drawGC,
- 0, y, width, lastY - y, 0, y);
- }
- forceCopy = 0; /* Reset drawing flag */
- lastY = y; /* Record last Y position */
- }
- if ((deltaY < 0) && (lineNum > 0)) {
- --lineNum;
- y -= htPtr->lineArr[lineNum].height;
- }
- }
- /*
- * If the viewport was resized, draw the page in one operation.
- * Otherwise draw any left-over block of text (either at the top
- * or bottom of the page)
- */
- if (htPtr->flags & TEXT_DIRTY) {
- XCopyArea(display, pixmap, Tk_WindowId(tkwin),
- htPtr->drawGC, 0, 0, width, height, 0, 0);
- } else if (lastY != y) {
- if (deltaY >= 0) {
- height -= lastY;
- XCopyArea(display, pixmap, Tk_WindowId(tkwin),
- htPtr->drawGC, 0, lastY, width, height, 0, lastY);
- } else {
- height = lastY;
- XCopyArea(display, pixmap, Tk_WindowId(tkwin),
- htPtr->drawGC, 0, 0, width, height, 0, 0);
- }
- }
- Tk_FreePixmap(display, pixmap);
-}
-
-
-static void
-SendBogusEvent(Tk_Window tkwin)
-{
-#define DONTPROPAGATE 0
- XEvent event;
-
- event.type = event.xexpose.type = Expose;
- event.xexpose.window = Tk_WindowId(tkwin);
- event.xexpose.display = Tk_Display(tkwin);
- event.xexpose.count = 0;
- event.xexpose.x = event.xexpose.y = 0;
- event.xexpose.width = Tk_Width(tkwin);
- event.xexpose.height = Tk_Height(tkwin);
-
- XSendEvent(Tk_Display(tkwin), Tk_WindowId(tkwin), DONTPROPAGATE,
- ExposureMask, &event);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayText --
- *
- * This procedure is invoked to display a hypertext widget.
- * Many of the operations which might ordinarily be performed
- * elsewhere (e.g. in a configuration routine) are done here
- * because of the somewhat unusual interactions occurring between
- * the parent and embedded widgets.
- *
- * Recompute the layout of the text if necessary. This is
- * necessary if the world coordinate system has changed.
- * Specifically, the following may have occurred:
- *
- * 1. a text attribute has changed (font, linespacing, etc.).
- * 2. widget option changed (anchor, width, height).
- * 3. actual embedded widget was resized.
- * 4. new text string or file.
- *
- * This is deferred to the display routine since potentially
- * many of these may occur (especially embedded widget changes).
- *
- * Set the vertical and horizontal scrollbars (if they are
- * designated) by issuing a TCL command. Done here since
- * the text window width and height are needed.
- *
- * If the viewport position or contents have changed in the
- * vertical direction, the now out-of-view embedded widgets
- * must be moved off the viewport. Since embedded widgets will
- * obscure the text window, it is imperative that the widgets
- * are moved off before we try to redraw text in the same area.
- * This is necessary only for vertical movements. Horizontal
- * embedded widget movements are handled automatically in the
- * page drawing routine.
- *
- * Get the new first and last line numbers for the viewport.
- * These line numbers may have changed because either a)
- * the viewport changed size or position, or b) the text
- * (embedded widget sizes or text attributes) have changed.
- *
- * If the viewport has changed vertically (i.e. the first or
- * last line numbers have changed), move the now out-of-view
- * embedded widgets off the viewport.
- *
- * Potentially many expose events may be generated when the
- * the individual embedded widgets are moved and/or resized.
- * These events need to be ignored. Since (I think) expose
- * events are guaranteed to happen in order, we can bracket
- * them by sending phony events (via XSendEvent). The phony
- * events turn on and off flags indicating which events
-* should be ignored.
- *
- * Finally, the page drawing routine is called.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the hypertext in its
- * current mode.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayText(ClientData clientData) /* Information about widget. */
-{
- HText *htPtr = clientData;
- Tk_Window tkwin = htPtr->tkwin;
- int oldFirst; /* First line of old viewport */
- int oldLast; /* Last line of old viewport */
- int deltaY; /* Change in viewport in Y direction */
- int reqWidth, reqHeight;
-
-#ifdef notdef
- fprintf(stderr, "calling DisplayText(%s)\n", Tk_PathName(htPtr->tkwin));
-#endif
- htPtr->flags &= ~REDRAW_PENDING;
- if (tkwin == NULL) {
- return; /* Window has been destroyed */
- }
- if (htPtr->flags & REQUEST_LAYOUT) {
- /*
- * Recompute the layout when widgets are created, deleted,
- * moved, or resized. Also when text attributes (such as
- * font, linespacing) have changed.
- */
- ComputeLayout(htPtr);
- }
- htPtr->lastWidth = Tk_Width(tkwin);
- htPtr->lastHeight = Tk_Height(tkwin);
-
- /*
- * Check the requested width and height. We allow two modes:
- * 1) If the user requested value is greater than zero, use it.
- * 2) Otherwise, let the window be as big as the virtual text.
- * This could be too large to display, so constrain it by
- * the maxWidth and maxHeight values.
- *
- * In any event, we need to calculate the size of the virtual
- * text and then make a geometry request. This is so that widgets
- * whose size is relative to the master, will be set once.
- */
- if (htPtr->reqWidth > 0) {
- reqWidth = htPtr->reqWidth;
- } else {
- reqWidth = MIN(htPtr->worldWidth, htPtr->maxWidth);
- if (reqWidth < 1) {
- reqWidth = 1;
- }
- }
- if (htPtr->reqHeight > 0) {
- reqHeight = htPtr->reqHeight;
- } else {
- reqHeight = MIN(htPtr->worldHeight, htPtr->maxHeight);
- if (reqHeight < 1) {
- reqHeight = 1;
- }
- }
- if ((reqWidth != Tk_ReqWidth(tkwin)) || (reqHeight != Tk_ReqHeight(tkwin))) {
- Tk_GeometryRequest(tkwin, reqWidth, reqHeight);
-
- EventuallyRedraw(htPtr);
- return; /* Try again with new geometry */
- }
- if (!Tk_IsMapped(tkwin)) {
- return;
- }
- /*
- * Turn off layout requests here, after the text window has been
- * mapped. Otherwise, relative embedded widget size requests wrt
- * to the size of parent text window will be wrong.
- */
- htPtr->flags &= ~REQUEST_LAYOUT;
-
- /* Is there a pending goto request? */
- if (htPtr->flags & GOTO_PENDING) {
- htPtr->pendingY = htPtr->lineArr[htPtr->reqLineNum].offset;
- htPtr->flags &= ~GOTO_PENDING;
- }
- deltaY = htPtr->pendingY - htPtr->yOffset;
- oldFirst = htPtr->first, oldLast = htPtr->last;
-
- /*
- * If the viewport has changed size or position, or the text
- * and/or embedded widgets have changed, adjust the scrollbars to
- * new positions.
- */
- if (htPtr->flags & TEXT_DIRTY) {
- int width, height;
-
- width = Tk_Width(htPtr->tkwin);
- height = Tk_Height(htPtr->tkwin);
-
- /* Reset viewport origin and world extents */
- htPtr->xOffset = Blt_AdjustViewport(htPtr->pendingX,
- htPtr->worldWidth, width,
- htPtr->xScrollUnits, BLT_SCROLL_MODE_LISTBOX);
- htPtr->yOffset = Blt_AdjustViewport(htPtr->pendingY,
- htPtr->worldHeight, height,
- htPtr->yScrollUnits, BLT_SCROLL_MODE_LISTBOX);
- if (htPtr->xScrollCmdObjPtr != NULL) {
- Blt_UpdateScrollbar(htPtr->interp, htPtr->xScrollCmdObjPtr,
- htPtr->xOffset, htPtr->xOffset + width, htPtr->worldWidth);
- }
- if (htPtr->yScrollCmdObjPtr != NULL) {
- Blt_UpdateScrollbar(htPtr->interp, htPtr->yScrollCmdObjPtr,
- htPtr->yOffset, htPtr->yOffset + height, htPtr->worldHeight);
- }
- /*
- * Given a new viewport or text height, find the first and
- * last line numbers of the new viewport.
- */
- if (GetVisibleLines(htPtr) != TCL_OK) {
- return;
- }
- }
- /*
- * This is a kludge: Send an expose event before and after
- * drawing the page of text. Since moving and resizing of the
- * embedded widgets will cause redundant expose events in the parent
- * window, the phony events will bracket them indicating no
- * action should be taken.
- */
- SendBogusEvent(tkwin);
-
- /*
- * If either the position of the viewport has changed or the size
- * of width or height of the entire text have changed, move the
- * widgets from the previous viewport out of the current
- * viewport. Worry only about the vertical embedded widget movements.
- * The page is always draw at full width and the viewport will clip
- * the text.
- */
- if ((htPtr->first != oldFirst) || (htPtr->last != oldLast)) {
- int offset;
- int i;
- int first, last;
- Blt_ChainLink link;
- EmbeddedWidget *winPtr;
-
- /* Figure out which lines are now out of the viewport */
-
- if ((htPtr->first > oldFirst) && (htPtr->first <= oldLast)) {
- first = oldFirst, last = htPtr->first;
- } else if ((htPtr->last < oldLast) && (htPtr->last >= oldFirst)) {
- first = htPtr->last, last = oldLast;
- } else {
- first = oldFirst, last = oldLast;
- }
-
- for (i = first; i <= last; i++) {
- offset = htPtr->lineArr[i].offset;
- for (link = Blt_Chain_FirstLink(htPtr->lineArr[i].chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- winPtr = Blt_Chain_GetValue(link);
- if (winPtr->tkwin != NULL) {
- MoveEmbeddedWidget(winPtr, offset);
- winPtr->flags &= ~WIDGET_VISIBLE;
- }
- }
- }
- }
- DrawPage(htPtr, deltaY);
- SendBogusEvent(tkwin);
-
- /* Reset flags */
- htPtr->flags &= ~TEXT_DIRTY;
-}
-
-/* Selection Procedures */
-/*
- *---------------------------------------------------------------------------
- *
- * TextSelectionProc --
- *
- * This procedure is called back by Tk when the selection is
- * requested by someone. It returns part or all of the selection
- * in a buffer provided by the caller.
- *
- * Results:
- * The return value is the number of non-NULL bytes stored
- * at buffer. Buffer is filled (or partially filled) with a
- * NULL-terminated string containing part or all of the selection,
- * as given by offset and maxBytes.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TextSelectionProc(
- ClientData clientData, /* Information about Text widget. */
- int offset, /* Offset within selection of first
- * character to be returned. */
- char *buffer, /* Location in which to place
- * selection. */
- int maxBytes) /* Maximum number of bytes to place
- * at buffer, not including terminating
- * NULL character. */
-{
- HText *htPtr = clientData;
- int size;
-
- if ((htPtr->selFirst < 0) || (!htPtr->exportSelection)) {
- return -1;
- }
- size = (htPtr->selLast - htPtr->selFirst) + 1 - offset;
- if (size > maxBytes) {
- size = maxBytes;
- }
- if (size <= 0) {
- return 0; /* huh? */
- }
- strncpy(buffer, htPtr->charArr + htPtr->selFirst + offset, size);
- buffer[size] = '\0';
- return size;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextLostSelection --
- *
- * This procedure is called back by Tk when the selection is
- * grabbed away from a Text widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The existing selection is unhighlighted, and the window is
- * marked as not containing a selection.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TextLostSelection(ClientData clientData) /* Information about Text widget. */
-{
- HText *htPtr = clientData;
-
- if ((htPtr->selFirst >= 0) && (htPtr->exportSelection)) {
- htPtr->selFirst = htPtr->selLast = -1;
- EventuallyRedraw(htPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectLine --
- *
- * Modify the selection by moving both its anchored and un-anchored
- * ends. This could make the selection either larger or smaller.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectLine(
- HText *htPtr, /* Information about widget. */
- int tindex) /* Index of element that is to
- * become the "other" end of the
- * selection. */
-{
- int selFirst, selLast;
- int lineNum;
- Line *linePtr;
-
- lineNum = IndexSearch(htPtr, tindex, 0, htPtr->nLines - 1);
- if (lineNum < 0) {
- char string[200];
-
- sprintf_s(string, 200, "can't determine line number from index \"%d\"",
- tindex);
- Tcl_AppendResult(htPtr->interp, string, (char *)NULL);
- return TCL_ERROR;
- }
- linePtr = htPtr->lineArr + lineNum;
- /*
- * Grab the selection if we don't own it already.
- */
- if ((htPtr->exportSelection) && (htPtr->selFirst == -1)) {
- Tk_OwnSelection(htPtr->tkwin, XA_PRIMARY, TextLostSelection, htPtr);
- }
- selFirst = linePtr->textStart;
- selLast = linePtr->textEnd;
- htPtr->selAnchor = tindex;
- if ((htPtr->selFirst != selFirst) ||
- (htPtr->selLast != selLast)) {
- htPtr->selFirst = selFirst;
- htPtr->selLast = selLast;
- EventuallyRedraw(htPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectWord --
- *
- * Modify the selection by moving both its anchored and un-anchored
- * ends. This could make the selection either larger or smaller.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectWord(
- HText *htPtr, /* Information about widget. */
- int tindex) /* Index of element that is to
- * become the "other" end of the
- * selection. */
-{
- int selFirst, selLast;
- int i;
-
- for (i = tindex; i < htPtr->nChars; i++) {
- if (isspace(UCHAR(htPtr->charArr[i]))) {
- break;
- }
- }
- selLast = i - 1;
- for (i = tindex; i >= 0; i--) {
- if (isspace(UCHAR(htPtr->charArr[i]))) {
- break;
- }
- }
- selFirst = i + 1;
- if (selFirst > selLast) {
- selFirst = selLast = tindex;
- }
- /*
- * Grab the selection if we don't own it already.
- */
- if ((htPtr->exportSelection) && (htPtr->selFirst == -1)) {
- Tk_OwnSelection(htPtr->tkwin, XA_PRIMARY, TextLostSelection, htPtr);
- }
- htPtr->selAnchor = tindex;
- if ((htPtr->selFirst != selFirst) || (htPtr->selLast != selLast)) {
- htPtr->selFirst = selFirst, htPtr->selLast = selLast;
- EventuallyRedraw(htPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectTextBlock --
- *
- * Modify the selection by moving its un-anchored end. This
- * could make the selection either larger or smaller.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectTextBlock(
- HText *htPtr, /* Information about widget. */
- int tindex) /* Index of element that is to
- * become the "other" end of the
- * selection. */
-{
- int selFirst, selLast;
-
- /*
- * Grab the selection if we don't own it already.
- */
-
- if ((htPtr->exportSelection) && (htPtr->selFirst == -1)) {
- Tk_OwnSelection(htPtr->tkwin, XA_PRIMARY, TextLostSelection, htPtr);
- }
- /* If the anchor hasn't been set yet, assume the beginning of the text*/
- if (htPtr->selAnchor < 0) {
- htPtr->selAnchor = 0;
- }
- if (htPtr->selAnchor <= tindex) {
- selFirst = htPtr->selAnchor;
- selLast = tindex;
- } else {
- selFirst = tindex;
- selLast = htPtr->selAnchor;
- }
- if ((htPtr->selFirst != selFirst) || (htPtr->selLast != selLast)) {
- htPtr->selFirst = selFirst, htPtr->selLast = selLast;
- EventuallyRedraw(htPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectOp --
- *
- * This procedure handles the individual options for text
- * selections. The selected text is designated by start and end
- * indices into the text pool. The selected segment has both a
- * anchored and unanchored ends. The following selection
- * operations are implemented:
- *
- * "adjust" - resets either the first or last index
- * of the selection.
- * "clear" - clears the selection. Sets first/last
- * indices to -1.
- * "from" - sets the index of the selection anchor.
- * "line" - sets the first of last indices to the
- * start and end of the line at the
- * designated point.
- * "present" - return "1" if a selection is available,
- * "0" otherwise.
- * "range" - sets the first and last indices.
- * "to" - sets the index of the un-anchored end.
- * "word" - sets the first of last indices to the
- * start and end of the word at the
- * designated point.
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectOp(
- HText *htPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- char *string;
- char c;
- int iselection;
- int length;
- int result = TCL_OK;
-
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- if ((c == 'c') && (strncmp(string, "clear", length) == 0)) {
- if (objc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " selection clear\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (htPtr->selFirst != -1) {
- htPtr->selFirst = htPtr->selLast = -1;
- EventuallyRedraw(htPtr);
- }
- return TCL_OK;
- } else if ((c == 'p') && (strncmp(string, "present", length) == 0)) {
- if (objc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " selection present\"", (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_AppendResult(interp, (htPtr->selFirst != -1) ? "0" : "1",
- (char *)NULL);
- return TCL_OK;
- } else if ((c == 'r') && (strncmp(string, "range", length) == 0)) {
- int selFirst, selLast;
-
- if (objc != 5) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " selection range first last\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (GetIndex(htPtr, objv[3], &selFirst) != TCL_OK) {
- return TCL_ERROR;
- }
- if (GetIndex(htPtr, objv[4], &selLast) != TCL_OK) {
- return TCL_ERROR;
- }
- htPtr->selAnchor = selFirst;
- SelectTextBlock(htPtr, selLast);
- return TCL_OK;
- }
- if (objc != 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " selection ",
- Tcl_GetString(objv[2]), " index\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (GetIndex(htPtr, objv[3], &iselection) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((c == 'f') && (strncmp(string, "from", length) == 0)) {
- htPtr->selAnchor = iselection;
- } else if ((c == 'a') && (strncmp(string, "adjust", length) == 0)) {
- int half1, half2;
-
- half1 = (htPtr->selFirst + htPtr->selLast) / 2;
- half2 = (htPtr->selFirst + htPtr->selLast + 1) / 2;
- if (iselection < half1) {
- htPtr->selAnchor = htPtr->selLast;
- } else if (iselection > half2) {
- htPtr->selAnchor = htPtr->selFirst;
- }
- result = SelectTextBlock(htPtr, iselection);
- } else if ((c == 't') && (strncmp(string, "to", length) == 0)) {
- result = SelectTextBlock(htPtr, iselection);
- } else if ((c == 'w') && (strncmp(string, "word", length) == 0)) {
- result = SelectWord(htPtr, iselection);
- } else if ((c == 'l') && (strncmp(string, "line", length) == 0)) {
- result = SelectLine(htPtr, iselection);
- } else {
- Tcl_AppendResult(interp, "bad selection operation \"", string,
- "\": should be \"adjust\", \"clear\", \"from\", \"line\", \
-\"present\", \"range\", \"to\", or \"word\"", (char *)NULL);
- return TCL_ERROR;
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GotoOp --
- *
- * Move the top line of the viewport to the new location based
- * upon the given line number. Force out-of-range requests to the
- * top or bottom of text.
- *
- * Results:
- * A standard TCL result. If TCL_OK, interp->result contains the
- * current line number.
- *
- * Side effects:
- * At the next idle point, the text viewport will be move to the
- * new line.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-GotoOp(
- HText *htPtr,
- Tcl_Interp *interp, /* Not used. */
- int objc,
- Tcl_Obj *const *objv)
-{
- int line;
-
- line = htPtr->first;
- if (objc == 3) {
- int tindex;
-
- if (GetIndex(htPtr, objv[2], &tindex) != TCL_OK) {
- return TCL_ERROR;
- }
- line = IndexSearch(htPtr, tindex, 0, htPtr->nLines - 1);
- if (line < 0) {
- char string[200];
-
- sprintf_s(string, 200,
- "can't determine line number from index \"%d\"", tindex);
- Tcl_AppendResult(htPtr->interp, string, (char *)NULL);
- return TCL_ERROR;
- }
- htPtr->reqLineNum = line;
- htPtr->flags |= TEXT_DIRTY;
-
- /*
- * Make only a request for a change in the viewport. Defer
- * the actual scrolling until the text layout is adjusted at
- * the next idle point.
- */
- if (line != htPtr->first) {
- htPtr->flags |= GOTO_PENDING;
- EventuallyRedraw(htPtr);
- }
- }
- Tcl_SetIntObj(Tcl_GetObjResult(htPtr->interp), line);
- return TCL_OK;
-}
-
-
-static int
-XViewOp(
- HText *htPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int width, worldWidth;
-
- width = Tk_Width(htPtr->tkwin);
- worldWidth = htPtr->worldWidth;
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- /* Report first and last fractions */
- fract = (double)htPtr->xOffset / worldWidth;
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(CLAMP(fract, 0.0, 1.0)));
- fract = (double)(htPtr->xOffset + width) / worldWidth;
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(CLAMP(fract, 0.0, 1.0)));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- htPtr->pendingX = htPtr->xOffset;
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2, &htPtr->pendingX,
- worldWidth, width, htPtr->xScrollUnits, BLT_SCROLL_MODE_LISTBOX)
- != TCL_OK) {
- return TCL_ERROR;
- }
- htPtr->flags |= TEXT_DIRTY;
- EventuallyRedraw(htPtr);
- return TCL_OK;
-}
-
-static int
-YViewOp(
- HText *htPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int height, worldHeight;
-
- height = Tk_Height(htPtr->tkwin);
- worldHeight = htPtr->worldHeight;
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr;
-
- /* Report first and last fractions */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- fract = (double)htPtr->yOffset / worldHeight;
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(CLAMP(fract, 0.0, 1.0)));
- fract = (double)(htPtr->yOffset + height) / worldHeight;
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(CLAMP(fract, 0.0, 1.0)));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- htPtr->pendingY = htPtr->yOffset;
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2, &htPtr->pendingY,
- worldHeight, height, htPtr->yScrollUnits, BLT_SCROLL_MODE_LISTBOX)
- != TCL_OK) {
- return TCL_ERROR;
- }
- htPtr->flags |= TEXT_DIRTY;
- EventuallyRedraw(htPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AppendOp --
- *
- * This procedure embeds a Tk widget into the hypertext.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * Memory is allocated. EmbeddedWidget gets configured.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AppendOp(
- HText *htPtr, /* Hypertext widget */
- Tcl_Interp *interp, /* Interpreter associated with widget */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- Line *linePtr;
- EmbeddedWidget *winPtr;
-
- winPtr = CreateEmbeddedWidget(htPtr, Tcl_GetString(objv[2]));
- if (winPtr == NULL) {
- return TCL_ERROR;
- }
- if (Blt_ConfigureWidgetFromObj(interp, htPtr->tkwin, widgetConfigSpecs,
- objc - 3, objv + 3, (char *)winPtr, 0) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Append widget to list of embedded widgets of the last line.
- */
- linePtr = GetLastLine(htPtr);
- if (linePtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate line structure", (char *)NULL);
- return TCL_ERROR;
- }
- Blt_Chain_Append(linePtr->chain, winPtr);
- linePtr->width += winPtr->cavityWidth;
- winPtr->precedingTextEnd = linePtr->textEnd;
-
- htPtr->flags |= (WIDGET_APPENDED | REQUEST_LAYOUT);
- EventuallyRedraw(htPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WindowsOp --
- *
- * Returns a list of all the pathNames of embedded widgets of the
- * HText widget. If a pattern argument is given, only the names
- * of windows matching it will be placed into the list.
- *
- * Results:
- * Standard TCL result. If TCL_OK, interp->result will contain
- * the list of the embedded widget pathnames. Otherwise it will
- * contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-WindowsOp(
- HText *htPtr, /* Hypertext widget record */
- Tcl_Interp *interp, /* Interpreter associated with widget */
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- char *name;
- char *pattern;
-
- pattern = (objc == 2) ? NULL : Tcl_GetString(objv[2]);
- for (hPtr = Blt_FirstHashEntry(&htPtr->widgetTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- EmbeddedWidget *winPtr;
-
- winPtr = Blt_GetHashValue(hPtr);
- if (winPtr->tkwin == NULL) {
- fprintf(stderr, "window `%s' is null\n",
- Tk_PathName(Blt_GetHashKey(&htPtr->widgetTable, hPtr)));
- continue;
- }
- name = Tk_PathName(winPtr->tkwin);
- if ((pattern == NULL) || (Tcl_StringMatch(name, pattern))) {
- Tcl_AppendElement(interp, name);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CgetOp(
- HText *htPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- char *itemPtr;
- Blt_ConfigSpec *specsPtr;
- char *string;
-
- if (objc > 3) {
- string = Tcl_GetString(objv[2]);
- if (string[0] == '.') {
- Tk_Window tkwin;
- EmbeddedWidget *winPtr;
-
- /* EmbeddedWidget window to be configured */
- tkwin = Tk_NameToWindow(interp, string, htPtr->tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- winPtr = FindEmbeddedWidget(htPtr, tkwin);
- if (winPtr == NULL) {
- Tcl_AppendResult(interp, "window \"", string,
- "\" is not managed by \"",
- Tcl_GetString(objv[0]), "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- specsPtr = widgetConfigSpecs;
- itemPtr = (char *)winPtr;
- return Blt_ConfigureValueFromObj(interp, htPtr->tkwin, specsPtr,
- itemPtr, objv[3], 0);
- }
- }
- specsPtr = configSpecs;
- itemPtr = (char *)htPtr;
- return Blt_ConfigureValueFromObj(interp, htPtr->tkwin, specsPtr,
- itemPtr, objv[2], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * This procedure is called to process an objv/objc list, plus
- * the Tk option database, in order to configure (or reconfigure)
- * a hypertext widget.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then
- * interp->result contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for htPtr; old resources get freed, if there were any.
- * The hypertext is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(
- HText *htPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- char *itemPtr;
- Blt_ConfigSpec *specsPtr;
-
- if (objc > 2) {
- char *string;
-
- string = Tcl_GetString(objv[2]);
- if (string[0] == '.') {
- Tk_Window tkwin;
- EmbeddedWidget *winPtr;
-
- /* EmbeddedWidget window to be configured */
- tkwin = Tk_NameToWindow(interp, string, htPtr->tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- winPtr = FindEmbeddedWidget(htPtr, tkwin);
- if (winPtr == NULL) {
- Tcl_AppendResult(interp, "window \"", string,
- "\" is not managed by \"", Tcl_GetString(objv[0]),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- specsPtr = widgetConfigSpecs;
- itemPtr = (char *)winPtr;
- objv++;
- objc--;
- goto config;
- }
- }
- specsPtr = configSpecs;
- itemPtr = (char *)htPtr;
- config:
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, htPtr->tkwin, specsPtr, itemPtr,
- (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, htPtr->tkwin, specsPtr, itemPtr,
- objv[2], 0);
- }
- if (Blt_ConfigureWidgetFromObj(interp, htPtr->tkwin, specsPtr, objc - 2,
- objv + 2, itemPtr, BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == (char *)htPtr) {
- /* Reconfigure the master */
- if (ConfigureText(interp, htPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- htPtr->flags |= REQUEST_LAYOUT;
- }
- EventuallyRedraw(htPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScanOp --
- *
- * Implements the quick scan for hypertext widgets.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ScanOp(
- HText *htPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- char *string;
- char c;
- int length;
- int x, y;
-
- string = Tcl_GetString(objv[3]);
- if (Blt_GetXY(interp, htPtr->tkwin, string, &x, &y) != TCL_OK) {
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- if ((c == 'm') && (strncmp(string, "mark", length) == 0)) {
- htPtr->scanMark.x = x, htPtr->scanMark.y = y;
- htPtr->scanPt.x = htPtr->xOffset;
- htPtr->scanPt.y = htPtr->yOffset;
-
- } else if ((c == 'd') && (strncmp(string, "dragto", length) == 0)) {
- int px, py;
-
- px = htPtr->scanPt.x - (10 * (x - htPtr->scanMark.x));
- py = htPtr->scanPt.y - (10 * (y - htPtr->scanMark.y));
-
- if (px < 0) {
- px = htPtr->scanPt.x = 0;
- htPtr->scanMark.x = x;
- } else if (px >= htPtr->worldWidth) {
- px = htPtr->scanPt.x = htPtr->worldWidth - htPtr->xScrollUnits;
- htPtr->scanMark.x = x;
- }
- if (py < 0) {
- py = htPtr->scanPt.y = 0;
- htPtr->scanMark.y = y;
- } else if (py >= htPtr->worldHeight) {
- py = htPtr->scanPt.y = htPtr->worldHeight - htPtr->yScrollUnits;
- htPtr->scanMark.y = y;
- }
- if ((py != htPtr->pendingY) || (px != htPtr->pendingX)) {
- htPtr->pendingX = px, htPtr->pendingY = py;
- htPtr->flags |= TEXT_DIRTY;
- EventuallyRedraw(htPtr);
- }
- } else {
- Tcl_AppendResult(interp, "bad scan operation \"", string,
- "\": should be either \"mark\" or \"dragto\"", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SearchOp --
- *
- * Returns the linenumber of the next line matching the given
- * pattern within the range of lines provided. If the first
- * line number is greater than the last, the search is done in
- * reverse.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SearchOp(
- HText *htPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- const char *startPtr;
- Tcl_RegExp regExpToken;
- int iFirst, iLast;
- int matchStart, matchEnd;
- int match;
- char *string;
-
- string = Tcl_GetString(objv[2]);
- regExpToken = Tcl_RegExpCompile(interp, string);
- if (regExpToken == NULL) {
- return TCL_ERROR;
- }
- iFirst = 0;
- iLast = htPtr->nChars;
- if (objc > 3) {
- if (GetIndex(htPtr, objv[3], &iFirst) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (objc == 4) {
- if (GetIndex(htPtr, objv[4], &iLast) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (iLast < iFirst) {
- return TCL_ERROR;
- }
- matchStart = matchEnd = -1;
- startPtr = htPtr->charArr + iFirst;
- {
- char *p;
- char saved;
-
- p = htPtr->charArr + (iLast + 1);
- saved = *p;
- *p = '\0'; /* Make the line a string by changing the
- * '\n' into a NUL byte before searching */
- match = Tcl_RegExpExec(interp, regExpToken, startPtr, startPtr);
- *p = saved;
- }
- if (match < 0) {
- return TCL_ERROR;
- } else if (match > 0) {
- const char *endPtr;
-
- Tcl_RegExpRange(regExpToken, 0, &startPtr, &endPtr);
- if ((startPtr != NULL) || (endPtr != NULL)) {
- matchStart = startPtr - htPtr->charArr;
- matchEnd = endPtr - htPtr->charArr - 1;
- }
- }
- if (match > 0) {
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(matchStart));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(matchEnd));
- Tcl_SetObjResult(interp, listObjPtr);
- } else {
- Tcl_ResetResult(interp);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RangeOp --
- *
- * Returns the characters designated by the range of elements.
- *
- *---------------------------------------------------------------------------
- */
-static int
-RangeOp(
- HText *htPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- char *startPtr, *endPtr;
- char saved;
- int textFirst, textLast;
-
- textFirst = htPtr->selFirst;
- textLast = htPtr->selLast;
- if (textFirst < 0) {
- textFirst = 0;
- textLast = htPtr->nChars - 1;
- }
- if (objc > 2) {
- if (GetIndex(htPtr, objv[2], &textFirst) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (objc == 4) {
- if (GetIndex(htPtr, objv[3], &textLast) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (textLast < textFirst) {
- Tcl_AppendResult(interp, "first index is greater than last",
- (char *)NULL);
- return TCL_ERROR;
- }
- startPtr = htPtr->charArr + textFirst;
- endPtr = htPtr->charArr + (textLast + 1);
- saved = *endPtr;
- *endPtr = '\0'; /* Make the line into a string by
- * changing the * '\n' into a '\0'
- * before copying */
- Tcl_SetStringObj(Tcl_GetObjResult(interp), startPtr, -1);
- *endPtr = saved;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IndexOp(
- HText *htPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- int tindex;
-
- if (GetIndex(htPtr, objv[2], &tindex) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), tindex);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LinePosOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-LinePosOp(
- HText *htPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- int line, cpos, tindex;
- char string[200];
-
- if (GetIndex(htPtr, objv[2], &tindex) != TCL_OK) {
- return TCL_ERROR;
- }
- if (GetTextPosition(htPtr, tindex, &line, &cpos) != TCL_OK) {
- return TCL_ERROR;
- }
- sprintf_s(string, 200, "%d.%d", line, cpos);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), string, -1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextWidgetCmd --
- *
- * This procedure is invoked to process the TCL command that
- * corresponds to a widget managed by this module. See the user
- * documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-static Blt_OpSpec textOps[] =
-{
- {"append", 1, AppendOp, 3, 0, "window ?option value?...",},
- {"cget", 2, CgetOp, 3, 3, "?window? option",},
- {"configure", 2, ConfigureOp, 2, 0,
- "?window? ?option value?...",},
- {"gotoline", 2, GotoOp, 2, 3, "?line?",},
- {"index", 1, IndexOp, 3, 3, "string",},
- {"linepos", 1, LinePosOp, 3, 3, "string",},
- {"range", 2, RangeOp, 2, 4, "?from? ?to?",},
- {"scan", 2, ScanOp, 4, 4, "oper @x,y",},
- {"search", 3, SearchOp, 3, 5, "pattern ?from? ?to?",},
- {"selection", 3, SelectOp, 3, 5, "oper ?index?",},
- {"windows", 6, WindowsOp, 2, 3, "?pattern?",},
- {"xview", 1, XViewOp, 2, 5,
- "?moveto fract? ?scroll number what?",},
- {"yview", 1, YViewOp, 2, 5,
- "?moveto fract? ?scroll number what?",},
-};
-static int nTextOps = sizeof(textOps) / sizeof(Blt_OpSpec);
-
-static int
-TextWidgetCmd(
- ClientData clientData, /* Information about hypertext widget. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- HTextCmdProc *proc;
- int result;
- HText *htPtr = clientData;
-
- proc = Blt_GetOpFromObj(interp, nTextOps, textOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(htPtr);
- result = (*proc) (htPtr, interp, objc, objv);
- Tcl_Release(htPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextCmd --
- *
- * This procedure is invoked to process the "htext" TCL command.
- * See the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-TextCmd(
- ClientData clientData, /* Main window associated with interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- HText *htPtr;
- Tk_Window tkwin;
- int screenWidth, screenHeight;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- htPtr = Blt_AssertCalloc(1, sizeof(HText));
- tkwin = Tk_MainWindow(interp);
- tkwin = Tk_CreateWindowFromPath(interp, tkwin, Tcl_GetString(objv[1]),
- (char *)NULL);
- if (tkwin == NULL) {
- Blt_Free(htPtr);
- return TCL_ERROR;
- }
- /* Initialize the new hypertext widget */
-
- Tk_SetClass(tkwin, "Htext");
- htPtr->tkwin = tkwin;
- htPtr->display = Tk_Display(tkwin);
- htPtr->interp = interp;
- htPtr->nLines = htPtr->arraySize = 0;
- htPtr->leader = 1;
- htPtr->xScrollUnits = htPtr->yScrollUnits = 10;
- htPtr->nRows = htPtr->nColumns = 0;
- htPtr->selFirst = htPtr->selLast = -1;
- htPtr->selAnchor = 0;
- htPtr->exportSelection = TRUE;
- htPtr->selBW = 2;
- Blt_SizeOfScreen(tkwin, &screenWidth, &screenHeight);
- htPtr->maxWidth = screenWidth;
- htPtr->maxHeight = screenHeight;
- Blt_InitHashTable(&htPtr->widgetTable, BLT_ONE_WORD_KEYS);
-
- Tk_CreateSelHandler(tkwin, XA_PRIMARY, XA_STRING, TextSelectionProc,
- htPtr, XA_STRING);
- Tk_CreateEventHandler(tkwin, ExposureMask | StructureNotifyMask,
- TextEventProc, htPtr);
- Blt_SetWindowInstanceData(tkwin, htPtr);
-
- /*
- *------------------------------------------------------------------------
- *
- * Create the widget command before configuring the widget. This
- * is because the "-file" and "-text" options may have embedded
- * commands that self-reference the widget through the
- * "$blt_htext(widget)" variable.
- *
- *------------------------------------------------------------------------
- */
- htPtr->cmdToken = Tcl_CreateObjCommand(interp, Tcl_GetString(objv[1]),
- TextWidgetCmd, htPtr, TextDeleteCmdProc);
- if ((Blt_ConfigureWidgetFromObj(interp, htPtr->tkwin, configSpecs, objc - 2,
- objv + 2, (char *)htPtr, 0) != TCL_OK) ||
- (ConfigureText(interp, htPtr) != TCL_OK)) {
- Tk_DestroyWindow(htPtr->tkwin);
- return TCL_ERROR;
- }
- Tcl_SetObjResult(interp, objv[1]);
- return TCL_OK;
-}
-
-int
-Blt_HtextCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {"htext", TextCmd,};
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-#endif /* NO_HTEXT */
diff --git a/blt3.0.1/src/bltImage.c b/blt3.0.1/src/bltImage.c
deleted file mode 100644
index 9f80e1a..0000000
--- a/blt3.0.1/src/bltImage.c
+++ /dev/null
@@ -1,155 +0,0 @@
-
-/*
- * bltImage.c --
- *
- * This module implements image processing procedures for the BLT toolkit.
- *
- * Copyright 1997-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltImage.h"
-#include <X11/Xutil.h>
-
-/*
- * Each call to Tk_GetImage returns a pointer to one of the following
- * structures, which is used as a token by clients (widgets) that display
- * images.
- */
-typedef struct _TkImage {
- Tk_Window tkwin; /* Window passed to Tk_GetImage (needed
- * to "re-get" the image later if the *
- * manager changes). */
- Display *display; /* Display for tkwin. Needed because
- * when the image is eventually freed
- * tkwin may not exist anymore. */
- struct _TkImageMaster *masterPtr; /* Master for this image (identifiers
- * image manager, for example). */
- ClientData instanceData; /* One word argument to pass to image
- * manager when dealing with this image
- * instance. */
- Tk_ImageChangedProc *changeProc; /* Code in widget to call when image
- * changes in a way that affects
- * redisplay. */
- ClientData widgetClientData; /* Argument to pass to changeProc. */
- struct _TkImage *nextPtr; /* Next in list of all image instances
- * associated with the same name. */
-} TkImage;
-
-/*
- * For each image master there is one of the following structures, which
- * represents a name in the image table and all of the images instantiated from
- * it. Entries in mainPtr->imageTable point to these structures.
- */
-typedef struct _TkImageMaster {
- Tk_ImageType *typePtr; /* Information about image type. NULL
- * means that no image manager owns this
- * image: the image was deleted. */
- ClientData masterData; /* One-word argument to pass to image
- * mgr when dealing with the master, as
- * opposed to instances. */
- int width, height; /* Last known dimensions for image. */
- void *tablePtr; /* Pointer to hash table containing
- * image (the imageTable field in some
- * TkMainInfo structure). */
- void *hPtr; /* Hash entry in mainPtr->imageTable for
- * this structure (used to delete the
- * hash entry). */
- void *instancePtr; /* Pointer to first in list of instances
- * derived from this name. */
- int deleted; /* Flag set when image is being
- * deleted. */
- Tk_Window tkwin; /* Main window of interpreter (used to
- * detect when the world is falling
- * apart.) */
-} TkImageMaster;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Image_IsDeleted --
- *
- * Is there any other way to determine if an image has been deleted?
- *
- * Results:
- * Returns 1 if the image has been deleted, 0 otherwise.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-int
-Blt_Image_IsDeleted(Tk_Image tkImage) /* Token for image. */
-{
- TkImage *imagePtr = (TkImage *) tkImage;
-
- if (imagePtr->masterPtr == NULL) {
- return TRUE;
- }
- return (imagePtr->masterPtr->typePtr == NULL);
-}
-
-/*LINTLIBRARY*/
-Tk_ImageMaster
-Blt_Image_GetMaster(Tk_Image tkImage) /* Token for image. */
-{
- TkImage *imagePtr = (TkImage *)tkImage;
-
- return (Tk_ImageMaster)imagePtr->masterPtr;
-}
-
-/*LINTLIBRARY*/
-ClientData
-Blt_Image_GetInstanceData(Tk_Image tkImage) /* Token for image. */
-{
- TkImage *imagePtr = (TkImage *)tkImage;
-
- return imagePtr->instanceData;
-}
-
-/*LINTLIBRARY*/
-Tk_ImageType *
-Blt_Image_GetType(Tk_Image tkImage) /* Token for image. */
-{
- TkImageMaster *masterPtr;
-
- masterPtr = (TkImageMaster *)Blt_Image_GetMaster(tkImage);
- return masterPtr->typePtr;
-}
-
-const char *
-Blt_Image_Name(Tk_Image tkImage)
-{
- Tk_ImageMaster master;
-
- master = Blt_Image_GetMaster(tkImage);
- return Tk_NameOfImage(master);
-}
-
-const char *
-Blt_Image_NameOfType(Tk_Image tkImage)
-{
- TkImageMaster *masterPtr;
-
- masterPtr = (TkImageMaster *)Blt_Image_GetMaster(tkImage);
- return masterPtr->typePtr->name;
-}
-
diff --git a/blt3.0.1/src/bltImage.h b/blt3.0.1/src/bltImage.h
deleted file mode 100644
index 1f5d553..0000000
--- a/blt3.0.1/src/bltImage.h
+++ /dev/null
@@ -1,53 +0,0 @@
-
-/*
- * bltImage.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_IMAGE_H
-#define _BLT_IMAGE_H
-
-#define ROTATE_0 0
-#define ROTATE_90 1
-#define ROTATE_180 2
-#define ROTATE_270 3
-
-BLT_EXTERN int Blt_IsPicture(Tk_Image tkImage);
-
-/* Routines that really should be in the Tk image C API. */
-
-BLT_EXTERN int Blt_Image_IsDeleted(Tk_Image tkImage);
-
-BLT_EXTERN Tk_ImageMaster Blt_Image_GetMaster(Tk_Image tkImage);
-
-BLT_EXTERN Tk_ImageType *Blt_Image_GetType(Tk_Image tkImage);
-
-BLT_EXTERN ClientData Blt_Image_GetInstanceData(Tk_Image tkImage);
-
-BLT_EXTERN const char *Blt_Image_Name(Tk_Image tkImage);
-BLT_EXTERN const char *Blt_Image_NameOfType(Tk_Image tkImage);
-
-#endif /*_BLT_IMAGE_H*/
diff --git a/blt3.0.1/src/bltInit.c b/blt3.0.1/src/bltInit.c
deleted file mode 100644
index e0d1088..0000000
--- a/blt3.0.1/src/bltInit.c
+++ /dev/null
@@ -1,124 +0,0 @@
-
-/*
- * bltInit.c --
- *
- * This module initials the BLT toolkit, registering its commands with the
- * Tcl/Tk interpreter.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltNsUtil.h"
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_InitCmd --
- *
- * Given the name of a command, return a pointer to the clientData field
- * of the command.
- *
- * Results:
- * A standard TCL result. If the command is found, TCL_OK is returned
- * and clientDataPtr points to the clientData field of the command (if
- * the clientDataPtr in not NULL).
- *
- * Side effects:
- * If the command is found, clientDataPtr is set to the address of the
- * clientData of the command. If not found, an error message is left
- * in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-Blt_InitCmd(Tcl_Interp *interp, const char *nsName, Blt_InitCmdSpec *specPtr)
-{
- const char *cmdPath;
- Tcl_DString dString;
- Tcl_Command cmdToken;
- Tcl_Namespace *nsPtr;
-
- Tcl_DStringInit(&dString);
- if (nsName != NULL) {
- Tcl_DStringAppend(&dString, nsName, -1);
- }
- Tcl_DStringAppend(&dString, "::", -1);
- Tcl_DStringAppend(&dString, specPtr->name, -1);
-
- cmdPath = Tcl_DStringValue(&dString);
- cmdToken = Tcl_FindCommand(interp, cmdPath, (Tcl_Namespace *)NULL, 0);
- if (cmdToken != NULL) {
- Tcl_DStringFree(&dString);
- return TCL_OK; /* Assume command was already initialized */
- }
- cmdToken = Tcl_CreateObjCommand(interp, cmdPath, specPtr->cmdProc,
- specPtr->clientData, specPtr->cmdDeleteProc);
- Tcl_DStringFree(&dString);
- nsPtr = Tcl_FindNamespace(interp, nsName, (Tcl_Namespace *)NULL,
- TCL_LEAVE_ERR_MSG);
- if (nsPtr == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_Export(interp, nsPtr, specPtr->name, FALSE) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_InitCmds --
- *
- * Given the name of a command, return a pointer to the clientData field
- * of the command.
- *
- * Results:
- * A standard TCL result. If the command is found, TCL_OK is returned and
- * clientDataPtr points to the clientData field of the command (if the
- * clientDataPtr in not NULL).
- *
- * Side effects:
- * If the command is found, clientDataPtr is set to the address of the
- * clientData of the command. If not found, an error message is left in
- * interp->result.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_InitCmds(
- Tcl_Interp *interp,
- const char *nsName,
- Blt_InitCmdSpec *specs,
- int nCmds)
-{
- Blt_InitCmdSpec *sp, *endPtr;
-
- for (sp = specs, endPtr = specs + nCmds; sp < endPtr; sp++) {
- if (Blt_InitCmd(interp, nsName, sp) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
diff --git a/blt3.0.1/src/bltInt.h b/blt3.0.1/src/bltInt.h
deleted file mode 100644
index 6449ea5..0000000
--- a/blt3.0.1/src/bltInt.h
+++ /dev/null
@@ -1,1000 +0,0 @@
-
-/*
- * bltInt.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_INT_H
-#define _BLT_INT_H
-
-#undef SIZEOF_LONG
-#include "config.h"
-#include "blt.h"
-
-#undef BLT_STORAGE_CLASS
-#define BLT_STORAGE_CLASS DLLEXPORT
-
-#define _VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-
-#define _TCL_VERSION _VERSION(TCL_MAJOR_VERSION, TCL_MINOR_VERSION, TCL_RELEASE_SERIAL)
-#define _TK_VERSION _VERSION(TK_MAJOR_VERSION, TK_MINOR_VERSION, TK_RELEASE_SERIAL)
-
-#ifndef __WIN32__
-# if defined(_WIN32) || defined(WIN32) || defined(__MINGW32__) || defined(__BORLANDC__)
-# define __WIN32__
-# ifndef WIN32
-# define WIN32
-# endif
-# endif
-#endif
-
-#ifdef _MSC_VER
-# define _CRT_SECURE_NO_DEPRECATE
-# define _CRT_NONSTDC_NO_DEPRECATE
-#endif
-#ifdef WIN32
-# define STRICT
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# undef STRICT
-# undef WIN32_LEAN_AND_MEAN
-# include <windowsx.h>
-#endif /* WIN32 */
-
-#include <tcl.h>
-
-#ifdef USE_TCL_STUBS
-# include "tclIntDecls.h"
-# ifdef WIN32
-# include "tclIntPlatDecls.h"
-# endif
-#endif /* USE_TCL_STUBS */
-
-#define USE_COMPOSITELESS_PHOTO_PUT_BLOCK
-#include <tk.h>
-
-#ifdef USE_TK_STUBS
-# include "tkIntDecls.h"
-# ifdef WIN32
-# include "tkPlatDecls.h"
-# include "tkIntXlibDecls.h"
-# endif
-#endif /* USE_TK_STUBS */
-
-#include <stdio.h>
-
-#ifdef WIN32
-# ifndef __GNUC__
-# ifdef O_NONBLOCK
-# define O_NONBLOCK 1
-# endif
-# endif /* __GNUC__ */
-
-#endif /* WIN32 */
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif /* HAVE_STDLIB_H */
-
-#ifdef HAVE_STDDEF_H
-# include <stddef.h>
-#endif /* HAVE_STDDEF_H */
-
-#ifdef HAVE_ERRNO_H
-# include <errno.h>
-#endif /* HAVE_ERRNO_H */
-
-#ifdef HAVE_CTYPE_H
-# include <ctype.h>
-#endif /* HAVE_CTYPE_H */
-
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif /* HAVE_MEMORY_H */
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#include "bltMath.h"
-#include "bltString.h"
-
-#undef INLINE
-
-#ifdef __GNUC__
-# define INLINE __inline__
-#else
-# define INLINE
-#endif
-
-#if defined(__GNUC__) && defined(HAVE_X86) && defined(__OPTIMIZE__)
-# define HAVE_X86_ASM
-#endif
-
-#undef VARARGS
-#ifdef __cplusplus
-# define ANYARGS (...)
-# define VARARGS(first) (first, ...)
-# define VARARGS2(first, second) (first, second, ...)
-#else
-# define ANYARGS ()
-# define VARARGS(first) ()
-# define VARARGS2(first, second) ()
-#endif /* __cplusplus */
-
-#undef MIN
-#define MIN(a,b) (((a)<(b))?(a):(b))
-
-#undef MAX
-#define MAX(a,b) (((a)>(b))?(a):(b))
-
-#undef MIN3
-#define MIN3(a,b,c) (((a)<(b))?(((a)<(c))?(a):(c)):(((b)<(c))?(b):(c)))
-
-#undef MAX3
-#define MAX3(a,b,c) (((a)>(b))?(((a)>(c))?(a):(c)):(((b)>(c))?(b):(c)))
-
-#define TRUE 1
-#define FALSE 0
-
-/*
- * The macro below is used to modify a "char" value (e.g. by casting
- * it to an unsigned character) so that it can be used safely with
- * macros such as isspace.
- */
-#define UCHAR(c) ((unsigned char) (c))
-
-#define BLT_ANCHOR_TOP (TK_ANCHOR_CENTER+1)
-#define BLT_ANCHOR_BOTTOM (TK_ANCHOR_CENTER+2)
-#define BLT_ANCHOR_LEFT (TK_ANCHOR_CENTER+3)
-#define BLT_ANCHOR_RIGHT (TK_ANCHOR_CENTER+4)
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_InitCmdSpec --
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- const char *name; /* Name of command */
- Tcl_ObjCmdProc *cmdProc;
- Tcl_CmdDeleteProc *cmdDeleteProc;
- ClientData clientData;
-} Blt_InitCmdSpec;
-
-BLT_EXTERN int Blt_DictionaryCompare (const char *s1, const char *s2);
-
-BLT_EXTERN void Blt_Draw3DRectangle(Tk_Window tkwin, Drawable drawable,
- Tk_3DBorder border, int x, int y, int width, int height,
- int borderWidth, int relief);
-BLT_EXTERN void Blt_Fill3DRectangle(Tk_Window tkwin, Drawable drawable,
- Tk_3DBorder border, int x, int y, int width, int height,
- int borderWidth, int relief);
-
-/* ---------------------------------------------------------------- */
-
-#define PIXELS_NNEG 0
-#define PIXELS_POS 1
-#define PIXELS_ANY 2
-
-#define COUNT_NNEG 0
-#define COUNT_POS 1
-#define COUNT_ANY 2
-
-#define BLT_SCROLL_MODE_CANVAS (1<<0)
-#define BLT_SCROLL_MODE_LISTBOX (1<<1)
-#define BLT_SCROLL_MODE_HIERBOX (1<<2)
-
-#define RGB_ANTIQUEWHITE1 "#ffefdb"
-#define RGB_BISQUE1 "#ffe4c4"
-#define RGB_BISQUE2 "#eed5b7"
-#define RGB_BISQUE3 "#cdb79e"
-#define RGB_BLACK "#000000"
-#define RGB_BLUE "#0000ff"
-#define RGB_GREEN "#00ff00"
-#define RGB_GREY "#b0b0b0"
-#define RGB_GREY15 "#262626"
-#define RGB_GREY20 "#333333"
-#define RGB_GREY25 "#404040"
-#define RGB_GREY30 "#4d4d4d"
-#define RGB_GREY35 "#595959"
-#define RGB_GREY40 "#666666"
-#define RGB_GREY50 "#7f7f7f"
-#define RGB_GREY64 "#a3a3a3"
-#define RGB_GREY70 "#b3b3b3"
-#define RGB_GREY75 "#bfbfbf"
-#define RGB_GREY77 "#c3c3c3"
-#define RGB_GREY82 "#d1d1d1"
-#define RGB_GREY85 "#d9d9d9"
-#define RGB_GREY90 "#e5e5e5"
-#define RGB_GREY93 "#ececec"
-#define RGB_GREY95 "#f2f2f2"
-#define RGB_GREY97 "#f7f7f7"
-#define RGB_LIGHTBLUE0 "#e4f7ff"
-#define RGB_LIGHTBLUE00 "#D9F5FF"
-#define RGB_LIGHTBLUE1 "#bfefff"
-#define RGB_LIGHTBLUE2 "#b2dfee"
-#define RGB_LIGHTSKYBLUE1 "#b0e2ff"
-#define RGB_MAROON "#b03060"
-#define RGB_NAVYBLUE "#000080"
-#define RGB_PINK "#ffc0cb"
-#define RGB_BISQUE1 "#ffe4c4"
-#define RGB_RED "#ff0000"
-#define RGB_RED3 "#cd0000"
-#define RGB_WHITE "#ffffff"
-#define RGB_YELLOW "#ffff00"
-#define RGB_SKYBLUE4 "#4a708b"
-
-#ifdef OLD_TK_COLORS
-#define STD_NORMAL_BACKGROUND RGB_BISQUE1
-#define STD_ACTIVE_BACKGROUND RGB_BISQUE2
-#define STD_SELECT_BACKGROUND RGB_LIGHTBLUE1
-#define STD_SELECT_FOREGROUND RGB_BLACK
-#else
-#define STD_NORMAL_BACKGROUND RGB_GREY85
-#define STD_ACTIVE_BACKGROUND RGB_GREY90
-#define STD_SELECT_BACKGROUND RGB_SKYBLUE4
-#define STD_SELECT_FOREGROUND RGB_WHITE
-#endif /* OLD_TK_COLORS */
-
-#define STD_ACTIVE_BG_MONO RGB_BLACK
-#define STD_ACTIVE_FOREGROUND RGB_BLACK
-#define STD_ACTIVE_FG_MONO RGB_WHITE
-#define STD_BORDERWIDTH "2"
-#define STD_FONT_HUGE "{Sans Serif} 18"
-#define STD_FONT_LARGE "{Sans Serif} 14"
-#define STD_FONT_MEDIUM "{Sans Serif} 11"
-#define STD_FONT_NORMAL "{Sans Serif} 9"
-#define STD_FONT_SMALL "{Sans Serif} 8"
-#define STD_FONT_NUMBERS "Math 8"
-#define STD_FONT STD_FONT_NORMAL
-#define STD_INDICATOR_COLOR RGB_RED3
-#define STD_NORMAL_BG_MONO RGB_WHITE
-#define STD_NORMAL_FOREGROUND RGB_BLACK
-#define STD_NORMAL_FG_MONO RGB_BLACK
-#define STD_SELECT_BG_MONO RGB_BLACK
-#define STD_SELECT_BORDERWIDTH "2"
-#define STD_SELECT_FG_MONO RGB_WHITE
-#define STD_SHADOW_MONO RGB_BLACK
-#define STD_SELECT_FONT_HUGE "{Sans Serif} 18 Bold"
-#define STD_SELECT_FONT_LARGE "{Sans Serif} 14 Bold"
-#define STD_SELECT_FONT_MEDIUM "{Sans Serif} 11 Bold"
-#define STD_SELECT_FONT_NORMAL "{Sans Serif} 9 Bold"
-#define STD_SELECT_FONT_SMALL "{Sans Serif} 8 Bold"
-#define STD_SELECT_FONT STD_SELECT_FONT_NORMAL
-#define STD_DISABLED_FOREGROUND RGB_GREY70
-#define STD_DISABLED_BACKGROUND RGB_GREY90
-
-#define LineWidth(w) (((w) > 1) ? (w) : 0)
-
-typedef char *Blt_Uid;
-
-BLT_EXTERN Blt_Uid Blt_GetUid(const char *string);
-BLT_EXTERN void Blt_FreeUid(Blt_Uid uid);
-BLT_EXTERN Blt_Uid Blt_FindUid(const char *string);
-
-#ifdef TCL_UTF_MAX
-# define HAVE_UTF 1
-#else
-# define HAVE_UTF 0
-#endif /* TCL_UTF_MAX */
-
-#include <bltAlloc.h>
-
-typedef char *DestroyData;
-
-#ifndef TK_RELIEF_SOLID
-# define TK_RELIEF_SOLID TK_RELIEF_FLAT
-#endif
-
-
-typedef int (QSortCompareProc) (const void *, const void *);
-
-/*
- *---------------------------------------------------------------------------
- *
- * Point2 --
- *
- * 2-D coordinate.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- double x, y;
-} Point2d;
-
-typedef struct {
- float x, y;
-} Point2f;
-
-typedef struct {
- int x, y;
-} Point2i;
-
-typedef struct {
- size_t nValues;
- void *values;
-} Array;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Point3D --
- *
- * 3-D coordinate.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- double x, y, z;
-} Point3D;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Segment2 --
- *
- * 2-D line segment.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- Point2f p, q; /* The two end points of the segment. */
-} Segment2f;
-
-typedef struct {
- Point2d p, q; /* The two end points of the segment. */
-} Segment2d;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Dim2D --
- *
- * 2-D dimension.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- short int width, height;
-} Dim2D;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Region2d --
- *
- * 2-D region. Used to copy parts of images.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- float left, right, top, bottom;
-} Region2f;
-
-typedef struct {
- double left, right, top, bottom;
-} Region2d;
-
-typedef struct {
- double left, right, top, bottom, front, back;
-} Region3D;
-
-#define RegionWidth(r) ((r)->right - (r)->left + 1)
-#define RegionHeight(r) ((r)->bottom - (r)->top + 1)
-
-#define PointInRegion(e,x,y) \
- (((x) <= (e)->right) && ((x) >= (e)->left) && \
- ((y) <= (e)->bottom) && ((y) >= (e)->top))
-
-#define PointInRectangle(r,x0,y0) \
- (((x0) <= (int)((r)->x + (r)->width - 1)) && ((x0) >= (int)(r)->x) && \
- ((y0) <= (int)((r)->y + (r)->height - 1)) && ((y0) >= (int)(r)->y))
-
-/*-------------------------------------------------------------------------------
- *
- * ColorPair --
- *
- * Holds a pair of foreground, background colors.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- XColor *fgColor, *bgColor;
-} ColorPair;
-
-#define COLOR_NONE (XColor *)0
-#define COLOR_DEFAULT (XColor *)1
-#define COLOR_ALLOW_DEFAULTS 1
-
-BLT_EXTERN int Blt_GetColorPair (Tcl_Interp *interp, Tk_Window tkwin,
- char *fgColor, char *bgColor, ColorPair *pairPtr, int colorFlag);
-
-BLT_EXTERN void Blt_FreeColorPair (ColorPair *pairPtr);
-
-
-#define ARROW_LEFT (0)
-#define ARROW_UP (1)
-#define ARROW_RIGHT (2)
-#define ARROW_DOWN (3)
-#define ARROW_OFFSET 4
-#define STD_ARROW_HEIGHT 3
-#define STD_ARROW_WIDTH ((2 * (ARROW_OFFSET - 1)) + 1)
-
-/*
- *---------------------------------------------------------------------------
- *
- * X11/Xosdefs.h requires XNOSTDHDRS be set for some systems. This is a
- * guess. If I can't find STDC headers or unistd.h, assume that this is
- * non-POSIX and non-STDC environment. (needed for Encore Umax 3.4 ?)
- *
- *---------------------------------------------------------------------------
- */
-#if !defined(STDC_HEADERS) && !defined(HAVE_UNISTD_H)
-# define XNOSTDHDRS 1
-#endif
-
-BLT_EXTERN FILE *Blt_OpenFile(Tcl_Interp *interp, const char *fileName,
- const char *mode);
-
-BLT_EXTERN int Blt_ExprDoubleFromObj (Tcl_Interp *interp, Tcl_Obj *objPtr,
- double *valuePtr);
-
-BLT_EXTERN int Blt_ExprIntFromObj (Tcl_Interp *interp, Tcl_Obj *objPtr,
- int *valuePtr);
-
-BLT_EXTERN const char *Blt_Itoa(int value);
-
-BLT_EXTERN const char *Blt_Ltoa(long value);
-
-BLT_EXTERN const char *Blt_Utoa(unsigned int value);
-
-BLT_EXTERN const char *Blt_Dtoa(Tcl_Interp *interp, double value);
-
-BLT_EXTERN unsigned char *Blt_Base64_Decode(Tcl_Interp *interp,
- const char *string, size_t *lengthPtr);
-
-BLT_EXTERN char *Blt_Base64_Encode(Tcl_Interp *interp,
- const unsigned char *buffer, size_t bufsize);
-
-BLT_EXTERN int Blt_IsBase64(const unsigned char *buf, size_t length);
-
-BLT_EXTERN int Blt_InitCmd (Tcl_Interp *interp, const char *namespace,
- Blt_InitCmdSpec *specPtr);
-
-BLT_EXTERN int Blt_InitCmds (Tcl_Interp *interp, const char *namespace,
- Blt_InitCmdSpec *specPtr, int nCmds);
-
-BLT_EXTERN int Blt_GlobalEvalObjv(Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-BLT_EXTERN int Blt_GlobalEvalListObj(Tcl_Interp *interp, Tcl_Obj *cmdObjPtr);
-
-BLT_EXTERN int Blt_GetDoubleFromString(Tcl_Interp *interp, const char *s,
- double *valuePtr);
-BLT_EXTERN int Blt_GetDoubleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- double *valuePtr);
-
-#ifdef WIN32
-
-typedef struct {
- DWORD pid;
- HANDLE hProcess;
-} ProcessId;
-
-#else
-typedef pid_t ProcessId;
-#endif
-
-BLT_EXTERN int Blt_CreatePipeline(Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv, ProcessId **pidArrayPtr, int *stdinPipePtr,
- int *stdoutPipePtr, int *stderrPipePtr);
-
-BLT_EXTERN void Blt_GetLineExtents(size_t nPoints, Point2d *points,
- Region2d *r);
-
-BLT_EXTERN int Blt_LineRectClip(Region2d *regionPtr, Point2d *p, Point2d *q);
-
-#if (_TCL_VERSION < _VERSION(8,1,0))
-BLT_EXTERN const char *Tcl_GetString (Tcl_Obj *objPtr);
-
-BLT_EXTERN int Tcl_EvalObjv (Tcl_Interp *interp, int objc, Tcl_Obj **objv,
- int flags);
-
-BLT_EXTERN int Tcl_WriteObj (Tcl_Channel channel, Tcl_Obj *objPtr);
-
-BLT_EXTERN char *Tcl_SetVar2Ex (Tcl_Interp *interp, const char *part1,
- const char *part2, Tcl_Obj *objPtr, int flags);
-
-BLT_EXTERN Tcl_Obj *Tcl_GetVar2Ex (Tcl_Interp *interp, const char *part1,
- const char *part2, int flags);
-#endif /* _TCL_VERSION < 8.1.0 */
-
-BLT_EXTERN int Blt_NaturalSpline (Point2d *origPts, int nOrigPts, Point2d *intpPts,
- int nIntpPts);
-
-BLT_EXTERN int Blt_QuadraticSpline (Point2d *origPts, int nOrigPts,
- Point2d *intpPts, int nIntpPts);
-
-BLT_EXTERN int Blt_SimplifyLine (Point2d *origPts, int low, int high,
- double tolerance, int *indices);
-
-BLT_EXTERN int Blt_NaturalParametricSpline (Point2d *origPts, int nOrigPts,
- Region2d *extsPtr, int isClosed, Point2d *intpPts, int nIntpPts);
-
-BLT_EXTERN int Blt_CatromParametricSpline (Point2d *origPts, int nOrigPts,
- Point2d *intpPts, int nIntpPts);
-
-BLT_EXTERN int Blt_StringToFlag (ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, char *string, char *widgRec, int flags);
-
-BLT_EXTERN char *Blt_FlagToString (ClientData clientData, Tk_Window tkwin,
- char *string, int offset, Tcl_FreeProc **freeProc);
-
-BLT_EXTERN void Blt_InitHexTable (unsigned char *table);
-
-BLT_EXTERN GC Blt_GetPrivateGC(Tk_Window tkwin, unsigned long gcMask,
- XGCValues *valuePtr);
-
-BLT_EXTERN GC Blt_GetPrivateGCFromDrawable(Display *display, Drawable drawable,
- unsigned long gcMask, XGCValues *valuePtr);
-
-BLT_EXTERN void Blt_FreePrivateGC(Display *display, GC gc);
-
-BLT_EXTERN int Blt_GetWindowFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- Window *windowPtr);
-
-BLT_EXTERN Window Blt_GetParentWindow(Display *display, Window window);
-
-BLT_EXTERN Tk_Window Blt_FindChild(Tk_Window parent, char *name);
-
-BLT_EXTERN Tk_Window Blt_FirstChild(Tk_Window parent);
-
-BLT_EXTERN Tk_Window Blt_NextChild(Tk_Window tkwin);
-
-BLT_EXTERN void Blt_RelinkWindow (Tk_Window tkwin, Tk_Window newParent, int x,
- int y);
-
-BLT_EXTERN Tk_Window Blt_Toplevel(Tk_Window tkwin);
-
-BLT_EXTERN Tk_Window Blt_GetToplevelWindow(Tk_Window tkwin);
-
-BLT_EXTERN int Blt_GetPixels(Tcl_Interp *interp, Tk_Window tkwin,
- const char *string, int check, int *valuePtr);
-
-BLT_EXTERN int Blt_GetPosition(Tcl_Interp *interp, const char *string,
- long *valuePtr);
-
-BLT_EXTERN int Blt_GetCount(Tcl_Interp *interp, const char *string, int check,
- long *valuePtr);
-
-BLT_EXTERN int Blt_GetCountFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- int check, long *valuePtr);
-
-BLT_EXTERN const char *Blt_NameOfFill(int fill);
-
-BLT_EXTERN const char *Blt_NameOfResize(int resize);
-
-BLT_EXTERN int Blt_GetXY (Tcl_Interp *interp, Tk_Window tkwin,
- const char *string, int *xPtr, int *yPtr);
-
-BLT_EXTERN Point2d Blt_GetProjection (int x, int y, Point2d *p, Point2d *q);
-
-BLT_EXTERN void Blt_DrawArrowOld(Display *display, Drawable drawable, GC gc,
- int x, int y, int w, int h, int borderWidth, int orientation);
-
-BLT_EXTERN void Blt_DrawArrow (Display *display, Drawable drawable, XColor *color,
- int x, int y, int w, int h, int borderWidth, int orientation);
-
-BLT_EXTERN int Blt_OldConfigModified TCL_VARARGS(Tk_ConfigSpec *, specs);
-
-BLT_EXTERN void Blt_DStringAppendElements TCL_VARARGS(Tcl_DString *, args);
-
-BLT_EXTERN void Blt_MakeTransparentWindowExist (Tk_Window tkwin, Window parent,
- int isBusy);
-
-BLT_EXTERN Window Blt_GetParent (Display *display, Window tkwin);
-
-BLT_EXTERN void Blt_GetBoundingBox (int width, int height, float angle,
- double *widthPtr, double *heightPtr, Point2d *points);
-
-BLT_EXTERN void Blt_InitEpsCanvasItem (Tcl_Interp *interp);
-
-BLT_EXTERN void Blt_TranslateAnchor (int x, int y, int width, int height,
- Tk_Anchor anchor, int *transXPtr, int *transYPtr);
-
-BLT_EXTERN Point2d Blt_AnchorPoint (double x, double y, double width,
- double height, Tk_Anchor anchor);
-
-BLT_EXTERN void Blt_HSV (XColor *colorPtr, double *huePtr, double *valPtr,
- double *satPtr);
-
-BLT_EXTERN void Blt_RGB (double hue, double sat, double val, XColor *colorPtr);
-
-BLT_EXTERN int Blt_ParseFlag (ClientData, Tcl_Interp *, Tk_Window, char *,
- char *, int);
-BLT_EXTERN char *Blt_FlagPrint (ClientData, Tk_Window, char *, int,
- Tcl_FreeProc **);
-
-BLT_EXTERN long Blt_MaxRequestSize (Display *display, size_t elemSize);
-
-BLT_EXTERN Window Blt_GetWindowId (Tk_Window tkwin);
-
-BLT_EXTERN void Blt_InitXRandrConfig(Tcl_Interp *interp);
-BLT_EXTERN void Blt_SizeOfScreen(Tk_Window tkwin, int *widthPtr,int *heightPtr);
-
-BLT_EXTERN int Blt_RootX (Tk_Window tkwin);
-
-BLT_EXTERN int Blt_RootY (Tk_Window tkwin);
-
-BLT_EXTERN void Blt_RootCoordinates (Tk_Window tkwin, int x, int y,
- int *rootXPtr, int *rootYPtr);
-
-BLT_EXTERN void Blt_MapToplevelWindow(Tk_Window tkwin);
-
-BLT_EXTERN void Blt_UnmapToplevelWindow(Tk_Window tkwin);
-
-BLT_EXTERN void Blt_RaiseToplevelWindow(Tk_Window tkwin);
-
-BLT_EXTERN void Blt_LowerToplevelWindow(Tk_Window tkwin);
-
-BLT_EXTERN void Blt_ResizeToplevelWindow(Tk_Window tkwin, int w, int h);
-
-BLT_EXTERN void Blt_MoveToplevelWindow(Tk_Window tkwin, int x, int y);
-
-BLT_EXTERN void Blt_MoveResizeToplevelWindow(Tk_Window tkwin, int x, int y,
- int w, int h);
-
-BLT_EXTERN int Blt_GetWindowRegion(Display *display, Window window, int *xPtr,
- int *yPtr, int *widthPtr, int *heightPtr);
-
-BLT_EXTERN ClientData Blt_GetWindowInstanceData (Tk_Window tkwin);
-
-BLT_EXTERN void Blt_SetWindowInstanceData (Tk_Window tkwin,
- ClientData instanceData);
-
-BLT_EXTERN void Blt_DeleteWindowInstanceData (Tk_Window tkwin);
-
-BLT_EXTERN int Blt_AdjustViewport (int offset, int worldSize, int windowSize,
- int scrollUnits, int scrollMode);
-
-BLT_EXTERN int Blt_GetScrollInfoFromObj (Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv, int *offsetPtr, int worldSize, int windowSize,
- int scrollUnits, int scrollMode);
-
-BLT_EXTERN void Blt_UpdateScrollbar(Tcl_Interp *interp,
- Tcl_Obj *scrollCmdObjPtr, int first, int last, int width);
-
-BLT_EXTERN int Blt_ReparentWindow (Display *display, Window window,
- Window newParent, int x, int y);
-
-BLT_EXTERN int Blt_LoadLibrary(Tcl_Interp *interp, const char *libPath,
- const char *initProcName, const char *safeProcName);
-
-extern void Blt_RegisterPictureImageType(Tcl_Interp *interp);
-extern int Blt_CpuFeatures(Tcl_Interp *interp, int *featuresPtr);
-extern void Blt_RegisterEpsCanvasItem(void);
-
-typedef struct {
- Drawable id;
- unsigned short int width, height;
- int depth;
- Colormap colormap;
- Visual *visual;
-} Blt_DrawableAttributes;
-
-BLT_EXTERN Blt_DrawableAttributes *Blt_GetDrawableAttribs(Display *display,
- Drawable drawable);
-
-BLT_EXTERN void Blt_SetDrawableAttribs(Display *display, Drawable drawable,
- int width, int height, int depth, Colormap colormap, Visual *visual);
-
-BLT_EXTERN void Blt_SetDrawableAttribsFromWindow(Tk_Window tkwin,
- Drawable drawable);
-
-BLT_EXTERN void Blt_FreeDrawableAttribs(Display *display, Drawable drawable);
-
-BLT_EXTERN GC Blt_GetBitmapGC(Tk_Window tkwin);
-
-#define Tk_RootWindow(tkwin) \
- RootWindow(Tk_Display(tkwin),Tk_ScreenNumber(tkwin))
-
-#ifndef WIN32
-# define PurifyPrintf printf
-#endif /* WIN32 */
-
-#include "bltConfig.h"
-
-#define NO_AFM 1
-#define NO_BASE64 1
-#define NO_BEEP 1
-#define NO_BGEXEC 1
-#define NO_BGPATTER 1
-#define NO_BITMAP 1
-#define NO_COMBOTREE 1
-#define NO_CONTAINER 1
-#define NO_CRC32 1
-#define NO_CSV 1
-#define NO_CUTBUFFER 1
-#define NO_DATATABLE 1
-#define NO_DEBUG 1
-#define NO_DDE 1
-#define NO_DND 1
-#define NO_DRAGDROP 1
-#define NO_HIERBOX 1
-#define NO_HIERTABLE 1
-#define NO_HTEXT 1
-#define NO_MOUNTAIN 1
-#define NO_PANESET 1
-#define NO_PICTURE 1
-#define NO_PRINTER 1
-#define NO_PTYEXEC 1
-#define NO_SENDEVENT 1
-#define NO_SCROLLSET 1
-#define NO_SPLINE 1
-#define NO_TABSET 1
-#define NO_TABLEMGR 1
-#define NO_TED
-#define NO_TKFRAME 1
-#define NO_TKBUTTON 1
-#define NO_TKSCROLLBAR 1
-#define NO_TREE 1
-#define NO_TREEVIEW 1
-#define NO_WATCH 1
-#define NO_WINOP 1
-
-/*
- * Define this if you want to be able to tile to the main window "." This
- * will cause a conflict with Tk if you try to compile and link statically.
- */
-#undef TK_MAINWINDOW
-
-#ifdef WIN32
-# define NO_PTYEXEC 1
-# define NO_CUTBUFFER 1
-# define NO_DND 1
-#else
-# define NO_DDE 1
-# define NO_PRINTER 1
-# ifdef MACOSX
-# define NO_BUSY 1
-# define NO_CONTAINER 1
-# endif
-#endif /* WIN32 */
-
-#ifndef NO_BASE64
-BLT_EXTERN Tcl_AppInitProc Blt_Base64CmdInitProc;
-#endif
-#ifndef NO_BEEP
-BLT_EXTERN Tcl_AppInitProc Blt_BeepCmdInitProc;
-#endif
-#ifndef NO_BGEXEC
-BLT_EXTERN Tcl_AppInitProc Blt_BgexecCmdInitProc;
-#endif
-#ifndef NO_PTYEXEC
-BLT_EXTERN Tcl_AppInitProc Blt_PtyExecCmdInitProc;
-#endif
-#ifndef NO_BITMAP
-BLT_EXTERN Tcl_AppInitProc Blt_BitmapCmdInitProc;
-#endif
-#ifndef NO_BUSY
-BLT_EXTERN Tcl_AppInitProc Blt_BusyCmdInitProc;
-#endif
-#ifndef NO_CONTAINER
-BLT_EXTERN Tcl_AppInitProc Blt_ContainerCmdInitProc;
-#endif
-#ifndef NO_CRC32
-BLT_EXTERN Tcl_AppInitProc Blt_Crc32CmdInitProc;
-#endif
-#ifndef NO_CSV
-BLT_EXTERN Tcl_AppInitProc Blt_CsvCmdInitProc;
-#endif
-#ifndef NO_CUTBUFFER
-BLT_EXTERN Tcl_AppInitProc Blt_CutbufferCmdInitProc;
-#endif
-#ifndef NO_DEBUG
-BLT_EXTERN Tcl_AppInitProc Blt_DebugCmdInitProc;
-#endif
-#ifndef NO_DRAGDROP
-BLT_EXTERN Tcl_AppInitProc Blt_DragDropCmdInitProc;
-#endif
-#ifndef NO_DND
-BLT_EXTERN Tcl_AppInitProc Blt_DndCmdInitProc;
-#endif
-#ifndef NO_GRAPH
-BLT_EXTERN Tcl_AppInitProc Blt_GraphCmdInitProc;
-#endif
-#ifndef NO_HIERBOX
-BLT_EXTERN Tcl_AppInitProc Blt_HierboxCmdInitProc;
-#endif
-#ifndef NO_HIERTABLE
-BLT_EXTERN Tcl_AppInitProc Blt_HiertableCmdInitProc;
-#endif
-#ifndef NO_HTEXT
-BLT_EXTERN Tcl_AppInitProc Blt_HtextCmdInitProc;
-#endif
-#ifdef WIN32
-# ifndef NO_PRINTER
-BLT_EXTERN Tcl_AppInitProc Blt_PrinterCmdInitProc;
-# endif
-#endif
-#ifndef NO_AFM
-BLT_EXTERN Tcl_AppInitProc Blt_AfmCmdInitProc;
-#endif
-#ifndef NO_PICTURE
-BLT_EXTERN Tcl_AppInitProc Blt_PictureCmdInitProc;
-#endif
-#ifndef NO_TABLEMGR
-BLT_EXTERN Tcl_AppInitProc Blt_TableMgrCmdInitProc;
-#endif
-#ifndef NO_VECTOR
-BLT_EXTERN Tcl_AppInitProc Blt_VectorCmdInitProc;
-#endif
-#ifndef NO_WINOP
-BLT_EXTERN Tcl_AppInitProc Blt_WinopCmdInitProc;
-#endif
-#ifndef NO_WATCH
-BLT_EXTERN Tcl_AppInitProc Blt_WatchCmdInitProc;
-#endif
-#ifndef NO_SPLINE
-BLT_EXTERN Tcl_AppInitProc Blt_SplineCmdInitProc;
-#endif
-#ifndef NO_TABSET
-BLT_EXTERN Tcl_AppInitProc Blt_TabsetCmdInitProc;
-#endif
-#ifndef NO_DATATABLE
-BLT_EXTERN Tcl_AppInitProc Blt_TableCmdInitProc;
-#endif
-#ifndef NO_TREE
-BLT_EXTERN Tcl_AppInitProc Blt_TreeCmdInitProc;
-#endif
-#ifndef NO_TREEVIEW
-BLT_EXTERN Tcl_AppInitProc Blt_TreeViewCmdInitProc;
-#endif
-#ifndef NO_TKFRAME
-BLT_EXTERN Tcl_AppInitProc Blt_FrameCmdInitProc;
-#endif
-#ifndef NO_TKBUTTON
-BLT_EXTERN Tcl_AppInitProc Blt_ButtonCmdInitProc;
-#endif
-#ifndef NO_SCROLLSET
-BLT_EXTERN Tcl_AppInitProc Blt_ScrollsetCmdInitProc;
-#endif
-#ifndef NO_PANESET
-BLT_EXTERN Tcl_AppInitProc Blt_PanesetCmdInitProc;
-#endif
-#ifndef NO_TKSCROLLBAR
-BLT_EXTERN Tcl_AppInitProc Blt_ScrollbarCmdInitProc;
-#endif
-#ifndef NO_BGPATTERN
-BLT_EXTERN Tcl_AppInitProc Blt_BgPatternCmdInitProc;
-#endif
-
-#if (BLT_MAJOR_VERSION == 3)
-# ifndef NO_MOUNTAIN
-BLT_EXTERN Tcl_AppInitProc Blt_MountainCmdInitProc;
-# endif
-#endif
-#ifndef NO_TED
-BLT_EXTERN Tcl_AppInitProc Blt_TedCmdInitProc;
-#endif
-
-#ifndef NO_COMBOTREE
-BLT_EXTERN Tcl_AppInitProc Blt_ComboButtonInitProc;
-BLT_EXTERN Tcl_AppInitProc Blt_ComboEntryInitProc;
-BLT_EXTERN Tcl_AppInitProc Blt_ComboMenuInitProc;
-BLT_EXTERN Tcl_AppInitProc Blt_ComboTreeInitProc;
-BLT_EXTERN Tcl_AppInitProc Blt_ListViewInitProc;
-#endif
-
-#ifndef NO_SENDEVENT
-BLT_EXTERN Tcl_AppInitProc Blt_SendEventCmdInitProc;
-#endif
-
-#ifndef NO_DDE
-BLT_EXTERN Tcl_AppInitProc Blt_DdeCmdInitProc;
-#endif
-
-
-#define Tcl_GetLong(i,s,p) TclGetLong(i,s,p)
-
-#ifndef USE_TCL_STUBS
-BLT_EXTERN int TclGetLong(Tcl_Interp *interp, const char *s, long *longPtr);
-#endif
-
-#ifndef HAVE_SPRINTF_S
-BLT_EXTERN int sprintf_s(char *s, size_t size, const char *fmt, /*args*/ ...);
-#endif /* HAVE_SPRINTF_S */
-
-
-BLT_EXTERN Pixmap Blt_GetPixmap(Display *dpy, Drawable draw, int w, int h,
- int depth, int lineNum, const char *fileName);
-
-#define Tk_GetPixmap(dpy, draw, w, h, depth) \
- Blt_GetPixmap(dpy, draw, w, h, depth, __LINE__, __FILE__)
-
-#if defined(HAVE_LIBXRANDR) && defined(HAVE_X11_EXTENSIONS_RANDR_H)
-#define HAVE_RANDR 1
-#else
-#define HAVE_RANDR 0
-#endif
-
-#undef panic
-#define panic(mesg) Blt_Panic("%s:%d %s", __FILE__, __LINE__, (mesg))
-BLT_EXTERN void Blt_Panic TCL_VARARGS(const char *, args);
-
-#ifdef WIN32
-# include "bltWin.h"
-#else
-
-#ifdef MACOSX
-# include "bltMacOSX.h"
-#endif /* MACOSX */
-
-#endif /* WIN32 */
-
-BLT_EXTERN double Blt_NaN(void);
-
-BLT_EXTERN void Blt_ScreenDPI(Tk_Window tkwin, unsigned int *xPtr,
- unsigned int *yPtr);
-
-#include <bltAlloc.h>
-#include <bltAssert.h>
-
-#if defined (WIN32) || defined(MAC_TCL) || defined(MAC_OSX_TCL)
-typedef struct _TkRegion *TkRegion; /* Opaque type */
-
-/* 114 */
-extern TkRegion TkCreateRegion(void);
-/* 115 */
-extern void TkDestroyRegion (TkRegion rgn);
-/* 116 */
-extern void TkIntersectRegion (TkRegion sra, TkRegion srcb, TkRegion dr_return);
-/* 117 */
-extern int TkRectInRegion(TkRegion rgn, int x, int y, unsigned int width,
- unsigned int height);
-/* 118 */
-extern void TkSetRegion(Display* display, GC gc, TkRegion rgn);
-/* 119 */
-extern void TkUnionRectWithRegion(XRectangle* rect, TkRegion src,
- TkRegion dr_return);
-#else
-typedef struct _TkRegion *TkRegion; /* Opaque type */
-#define TkClipBox(rgn, rect) XClipBox((Region) rgn, rect)
-#define TkCreateRegion() (TkRegion) XCreateRegion()
-#define TkDestroyRegion(rgn) XDestroyRegion((Region) rgn)
-#define TkIntersectRegion(a, b, r) XIntersectRegion((Region) a, \
- (Region) b, (Region) r)
-#define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) r, x, y, w, h)
-#define TkSetRegion(d, gc, rgn) XSetRegion(d, gc, (Region) rgn)
-#define TkSubtractRegion(a, b, r) XSubtractRegion((Region) a, \
- (Region) b, (Region) r)
-#define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \
- (Region) src, (Region) ret)
-#endif
-
-#endif /*_BLT_INT_H*/
diff --git a/blt3.0.1/src/bltList.c b/blt3.0.1/src/bltList.c
deleted file mode 100644
index 05d2bba..0000000
--- a/blt3.0.1/src/bltList.c
+++ /dev/null
@@ -1,557 +0,0 @@
-
-/*
- * bltList.c --
- *
- * The module implements generic linked lists for the BLT toolkit.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include <bltHash.h>
-#include "bltList.h"
-
-typedef struct _Blt_ListNode Node;
-typedef struct _Blt_List List;
-
-static Node *
-FindString(List *listPtr, const char *key)
-{
- Node *np;
- char c;
-
- c = key[0];
- for (np = listPtr->head; np != NULL; np = np->next) {
- if ((c == np->key.string[0]) && (strcmp(key, np->key.string) == 0)) {
- return np;
- }
- }
- return NULL;
-}
-
-static Blt_ListNode
-FindOneWord(List *listPtr, const char *key)
-{
- Node *np;
-
- for (np = listPtr->head; np != NULL; np = np->next) {
- if (key == np->key.oneWordValue) {
- return np;
- }
- }
- return NULL;
-}
-
-static Blt_ListNode
-FindArray(List *listPtr, const char *key)
-{
- Node *np;
- size_t nBytes;
-
- nBytes = sizeof(uint32_t) * listPtr->type;
- for (np = listPtr->head; np != NULL; np = np->next) {
- if (memcmp(key, np->key.words, nBytes) == 0) {
- return np;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeNode --
- *
- * Free the memory allocated for the node.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeNode(Blt_ListNode node)
-{
- Blt_Free(node);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_Create --
- *
- * Creates a new linked list structure and initializes its pointers
- *
- * Results:
- * Returns a pointer to the newly created list structure.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-Blt_List
-Blt_List_Create(size_t type)
-{
- List *listPtr;
-
- listPtr = Blt_Malloc(sizeof(List));
- if (listPtr != NULL) {
- Blt_List_Init(listPtr, type);
- }
- return listPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_CreateNode --
- *
- * Creates a list node holder. This routine does not insert the node
- * into the list, nor does it no attempt to maintain consistency of the
- * keys. For example, more than one node may use the same key.
- *
- * Results:
- * The return value is the pointer to the newly created node.
- *
- * Side Effects:
- * The key is not copied, only the Uid is kept. It is assumed this key
- * will not change in the life of the node.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-Blt_ListNode
-Blt_List_CreateNode(List *listPtr, const char *key)
-{
- Node *np;
- size_t keySize;
-
- if (listPtr->type == BLT_STRING_KEYS) {
- keySize = strlen(key) + 1;
- } else if (listPtr->type == BLT_ONE_WORD_KEYS) {
- keySize = sizeof(void *);
- } else {
- keySize = sizeof(uint32_t) * listPtr->type;
- }
- np = Blt_AssertCalloc(1, sizeof(Node) + keySize - 4);
- np->clientData = NULL;
- np->next = np->prev = NULL;
- np->list = listPtr;
- switch (listPtr->type) {
- case BLT_STRING_KEYS:
- strcpy(np->key.string, key);
- break;
- case BLT_ONE_WORD_KEYS:
- np->key.oneWordValue = key;
- break;
- default:
- memcpy(np->key.words, key, keySize);
- break;
- }
- return np;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_Reset --
- *
- * Removes all the entries from a list, removing pointers to the objects
- * and keys (not the objects or keys themselves). The node counter is
- * reset to zero.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_List_Reset(List *listPtr) /* List to clear */
-{
- if (listPtr != NULL) {
- Node *nextPtr, *np;
-
- for (np = listPtr->head; np != NULL; np = nextPtr) {
- nextPtr = np->next;
- FreeNode(np);
- }
- Blt_List_Init(listPtr, listPtr->type);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_Destroy
- *
- * Frees the list structure.
- *
- * Results:
- * Returns a pointer to the newly created list structure.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_List_Destroy(Blt_List list)
-{
- if (list != NULL) {
- Blt_List_Reset(list);
- Blt_Free(list);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_Init --
- *
- * Initializes a linked list.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_List_Init(List *listPtr, size_t type)
-{
- listPtr->nNodes = 0;
- listPtr->head = listPtr->tail = NULL;
- listPtr->type = type;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_LinkAfter --
- *
- * Inserts an node following a given node.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_List_LinkAfter(List *listPtr, Node *np, Node *afterPtr)
-{
- if (listPtr->head == NULL) {
- listPtr->tail = listPtr->head = np;
- } else {
- if (afterPtr == NULL) {
- /* Prepend to the front of the list */
- np->next = listPtr->head;
- np->prev = NULL;
- listPtr->head->prev = np;
- listPtr->head = np;
- } else {
- np->next = afterPtr->next;
- np->prev = afterPtr;
- if (afterPtr == listPtr->tail) {
- listPtr->tail = np;
- } else {
- afterPtr->next->prev = np;
- }
- afterPtr->next = np;
- }
- }
- np->list = listPtr;
- listPtr->nNodes++;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_LinkBefore --
- *
- * Inserts an node preceding a given node.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_List_LinkBefore(List *listPtr, Node *np, Node *beforePtr)
-{
- if (listPtr->head == NULL) {
- listPtr->tail = listPtr->head = np;
- } else {
- if (beforePtr == NULL) {
- /* Append onto the end of the list */
- np->next = NULL;
- np->prev = listPtr->tail;
- listPtr->tail->next = np;
- listPtr->tail = np;
- } else {
- np->prev = beforePtr->prev;
- np->next = beforePtr;
- if (beforePtr == listPtr->head) {
- listPtr->head = np;
- } else {
- beforePtr->prev->next = np;
- }
- beforePtr->prev = np;
- }
- }
- np->list = listPtr;
- listPtr->nNodes++;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_UnlinkNode --
- *
- * Unlinks an node from the given list. The node itself is not
- * deallocated, but only removed from the list.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_List_UnlinkNode(Node *np)
-{
- List *listPtr;
-
- listPtr = np->list;
- if (listPtr != NULL) {
- int unlinked = 0;
-
- if (listPtr->head == np) {
- listPtr->head = np->next;
- unlinked++;
- }
- if (listPtr->tail == np) {
- listPtr->tail = np->prev;
- unlinked++;
- }
- if (np->next != NULL) {
- np->next->prev = np->prev;
- unlinked++;
- }
- if (np->prev != NULL) {
- np->prev->next = np->next;
- unlinked++;
- }
- np->list = NULL;
- if (unlinked) {
- assert(listPtr->nNodes > 0);
- listPtr->nNodes--;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_GetNode --
- *
- * Find the first node matching the key given.
- *
- * Results:
- * Returns the pointer to the node. If no node matching the key given is
- * found, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-
-/*LINTLIBRARY*/
-Blt_ListNode
-Blt_List_GetNode(List *listPtr, const char *key)
-{
- if (listPtr != NULL) {
- switch (listPtr->type) {
- case BLT_STRING_KEYS:
- return FindString(listPtr, key);
- case BLT_ONE_WORD_KEYS:
- return FindOneWord(listPtr, key);
- default:
- return FindArray(listPtr, key);
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_DeleteNode --
- *
- * Unlinks and deletes the given node.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_List_DeleteNode(Blt_ListNode node)
-{
- Blt_List_UnlinkNode(node);
- FreeNode(node);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_DeleteNodeByKey --
- *
- * Find the node and free the memory allocated for the node.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_List_DeleteNodeByKey(Blt_List list, const char *key)
-{
- Blt_ListNode node;
-
- node = Blt_List_GetNode(list, key);
- if (node != NULL) {
- Blt_List_DeleteNode(node);
- }
-}
-
-/*LINTLIBRARY*/
-Blt_ListNode
-Blt_List_Append(Blt_List list, const char *key, ClientData clientData)
-{
- Blt_ListNode node;
-
- node = Blt_List_CreateNode(list, key);
- Blt_List_SetValue(node, clientData);
- Blt_List_AppendNode(list, node);
- return node;
-}
-
-/*LINTLIBRARY*/
-Blt_ListNode
-Blt_List_Prepend(Blt_List list, const char *key, ClientData clientData)
-{
- Blt_ListNode node;
-
- node = Blt_List_CreateNode(list, key);
- Blt_List_SetValue(node, clientData);
- Blt_List_PrependNode(list, node);
- return node;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_GetNthNode --
- *
- * Find the node based upon a given position in list.
- *
- * Results:
- * Returns the pointer to the node, if that numbered element
- * exists. Otherwise NULL.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-Blt_ListNode
-Blt_List_GetNthNode(List *listPtr, long position, int direction)
-{
- if (listPtr == NULL) {
- return NULL;
- }
- if (direction > 0) {
- Node *np;
-
- for (np = listPtr->head; np != NULL; np = np->next) {
- if (position == 0) {
- return np;
- }
- position--;
- }
- } else {
- Node *np;
-
- for (np = listPtr->tail; np != NULL; np = np->prev) {
- if (position == 0) {
- return np;
- }
- position--;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_List_Sort --
- *
- * Find the node based upon a given position in list.
- *
- * Results:
- * Returns the pointer to the node, if that numbered element
- * exists. Otherwise NULL.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_List_Sort(List *listPtr, Blt_ListCompareProc *proc)
-{
- Node **nodes;
- Node *np;
- size_t i;
-
- if (listPtr->nNodes < 2) {
- return;
- }
- nodes = Blt_Malloc(sizeof(Node *) * (listPtr->nNodes + 1));
- if (nodes == NULL) {
- return; /* Out of memory. */
- }
- for (i = 0, np = listPtr->head; np != NULL; np = np->next) {
- nodes[i++] = np;
- }
- qsort(nodes, listPtr->nNodes, sizeof(Node *), (QSortCompareProc *)proc);
-
- /* Rethread the list. */
- np = nodes[0];
- listPtr->head = np;
- np->prev = NULL;
- for (i = 1; i < listPtr->nNodes; i++) {
- np->next = nodes[i];
- np->next->prev = np;
- np = np->next;
- }
- listPtr->tail = np;
- np->next = NULL;
- Blt_Free(nodes);
-}
diff --git a/blt3.0.1/src/bltList.h b/blt3.0.1/src/bltList.h
deleted file mode 100644
index c7331e0..0000000
--- a/blt3.0.1/src/bltList.h
+++ /dev/null
@@ -1,116 +0,0 @@
-
-/*
- * bltList.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#ifndef _BLT_LIST_H
-#define _BLT_LIST_H
-
-/*
- * Acceptable key types for hash tables:
- */
-#ifndef BLT_STRING_KEYS
-#define BLT_STRING_KEYS 0
-#endif
-#ifndef BLT_ONE_WORD_KEYS
-#define BLT_ONE_WORD_KEYS ((size_t)-1)
-#endif
-
-typedef struct _Blt_List *Blt_List;
-typedef struct _Blt_ListNode *Blt_ListNode;
-
-typedef union { /* Key has one of these forms: */
- const void *oneWordValue; /* One-word value for key. */
- unsigned int words[1]; /* Multiple integer words for key. The actual
- * size will be as large as necessary for this
- * table's keys. */
- char string[4]; /* String for key. The actual size will be as
- * large as needed to hold the key. */
-} Blt_ListKey;
-
-/*
- * A Blt_ListNode is the container structure for the Blt_List.
- */
-struct _Blt_ListNode {
- Blt_ListNode prev; /* Link to the previous node */
- Blt_ListNode next; /* Link to the next node */
- Blt_List list; /* List to eventually insert node */
- ClientData clientData; /* Pointer to the data object */
- Blt_ListKey key; /* MUST BE LAST FIELD IN RECORD!! */
-};
-
-typedef int (Blt_ListCompareProc)(Blt_ListNode *node1Ptr,
- Blt_ListNode *node2Ptr);
-
-/*
- * A Blt_List is a doubly chained list structure.
- */
-struct _Blt_List {
- Blt_ListNode head; /* Pointer to first element in list */
- Blt_ListNode tail; /* Pointer to last element in list */
- size_t nNodes; /* Number of node currently in the list. */
- size_t type; /* Type of keys in list. */
-};
-
-BLT_EXTERN void Blt_List_Init(Blt_List list, size_t type);
-BLT_EXTERN void Blt_List_Reset(Blt_List list);
-BLT_EXTERN Blt_List Blt_List_Create(size_t type);
-BLT_EXTERN void Blt_List_Destroy(Blt_List list);
-BLT_EXTERN Blt_ListNode Blt_List_CreateNode(Blt_List list, const char *key);
-BLT_EXTERN void Blt_List_DeleteNode(Blt_ListNode node);
-
-BLT_EXTERN Blt_ListNode Blt_List_Append(Blt_List list, const char *key,
- ClientData clientData);
-BLT_EXTERN Blt_ListNode Blt_List_Prepend(Blt_List list, const char *key,
- ClientData clientData);
-BLT_EXTERN void Blt_List_LinkAfter(Blt_List list, Blt_ListNode node,
- Blt_ListNode afterNode);
-BLT_EXTERN void Blt_List_LinkBefore(Blt_List list, Blt_ListNode node,
- Blt_ListNode beforeNode);
-BLT_EXTERN void Blt_List_UnlinkNode(Blt_ListNode node);
-BLT_EXTERN Blt_ListNode Blt_List_GetNode(Blt_List list, const char *key);
-BLT_EXTERN void Blt_List_DeleteNodeByKey(Blt_List list, const char *key);
-BLT_EXTERN Blt_ListNode Blt_List_GetNthNode(Blt_List list, long position,
- int direction);
-BLT_EXTERN void Blt_List_Sort(Blt_List list, Blt_ListCompareProc *proc);
-
-#define Blt_List_GetLength(list) \
- (((list) == NULL) ? 0 : ((struct _Blt_List *)list)->nNodes)
-#define Blt_List_FirstNode(list) \
- (((list) == NULL) ? NULL : ((struct _Blt_List *)list)->head)
-#define Blt_List_LastNode(list) \
- (((list) == NULL) ? NULL : ((struct _Blt_List *)list)->tail)
-#define Blt_List_PrevNode(node) ((node)->prev)
-#define Blt_List_NextNode(node) ((node)->next)
-#define Blt_List_GetKey(node) \
- (((node)->list->type == BLT_STRING_KEYS) \
- ? (node)->key.string : (node)->key.oneWordValue)
-#define Blt_List_GetValue(node) ((node)->clientData)
-#define Blt_List_SetValue(node, value) \
- ((node)->clientData = (ClientData)(value))
-#define Blt_List_AppendNode(list, node) \
- (Blt_List_LinkBefore((list), (node), (Blt_ListNode)NULL))
-#define Blt_List_PrependNode(list, node) \
- (Blt_List_LinkAfter((list), (node), (Blt_ListNode)NULL))
-
-#endif /* _BLT_LIST_H */
diff --git a/blt3.0.1/src/bltListView.c b/blt3.0.1/src/bltListView.c
deleted file mode 100644
index 01de3e6..0000000
--- a/blt3.0.1/src/bltListView.c
+++ /dev/null
@@ -1,6283 +0,0 @@
-
-/*
- * bltListView.c --
- *
- * This module implements a listview widget for the BLT toolkit.
- *
- * Copyright 2006 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include "bltBind.h"
-#include "bltImage.h"
-#include "bltPicture.h"
-#include "bltFont.h"
-#include "bltText.h"
-#include "bltChain.h"
-#include "bltHash.h"
-#include "bltBgStyle.h"
-#include "bltPainter.h"
-#include "bltSwitch.h"
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-
-static const char emptyString[] = "";
-
-#define REDRAW_PENDING (1<<0) /* The widget needs to be redrawn. */
-#define LAYOUT_PENDING (1<<1) /* The layout of widget needs to be
- * recomputed. */
-#define SORT_PENDING (1<<3) /* The items in the need to be
- * sorted. */
-#define FOCUS (1<<4) /* The widget currently has focus. */
-#define SORTED (1<<5) /* The items are currently sorted. */
-#define SCROLLX (1<<6) /* The widget needs to be scrolled in
- * the x direction. */
-#define SCROLLY (1<<7) /* The widget needs to be scrolled in
- * the y direction. */
-#define SCROLL_PENDING (SCROLLX|SCROLLY)
-
-#define RESTRICT_MIN (1<<10)
-#define RESTRICT_MAX (1<<11)
-#define RESTRICT_NONE (0)
-
-#define SELECT_SINGLE (1<<12) /* Single mode: Select only one item
- * at a time.*/
-#define SELECT_MULTIPLE (1<<13) /* Multiple mode: Select one or more
- * items. */
-#define SELECT_MODE_MASK (SELECT_MULTIPLE|SELECT_SINGLE)
-
-#define SELECT_EXPORT (1<<16) /* Export the selection to X11. */
-#define SELECT_ORDERED (1<<17) /* Indicates that the selection should
- * be set in the order that the items
- * were selected. */
-#define SELECT_PENDING (1<<18) /* A "selection" command idle task is
- * pending. */
-#define SELECT_SET (1<<19) /* Select the item. */
-#define SELECT_CLEAR (1<<20) /* Deselect the item. */
-#define SELECT_TOGGLE (SELECT_SET | SELECT_CLEAR)
-#define SELECT_MASK (SELECT_SET | SELECT_CLEAR)
-
-#define SORT_AUTO (1<<26) /* Automatically sort the items as
- * items are added or deleted. */
-#define SORT_DECREASING (1<<27) /* Sort items in decreasing order. */
-#define SORT_DICTIONARY (1<<28) /* Sort the items in dictionary
- * order. */
-#define SORT_TYPE (1<<29) /* Sort the items by their type. */
-#define SORT_LABEL (1<<30) /* Sort the items by their label. */
-#define SORT_MODE_MASK (SORT_TYPE|SORT_LABEL)
-
-
-#define VAR_FLAGS (TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS)
-
-#define PIXMAPX(l, wx) ((wx) - (l)->xOffset)
-#define PIXMAPY(l, wy) ((wy) - (l)->yOffset)
-
-#define SCREENX(l, wx) ((wx) - (l)->xOffset + (l)->inset)
-#define SCREENY(l, wy) ((wy) - (l)->yOffset + (l)->inset)
-
-#define WORLDX(l, sx) ((sx) - (l)->inset + (l)->xOffset)
-#define WORLDY(l, sy) ((sy) - (l)->inset + (l)->yOffset)
-
-#define VPORTWIDTH(l) \
- (Tk_Width((l)->tkwin) - 2 * (l)->inset)
-#define VPORTHEIGHT(l) \
- (Tk_Height((l)->tkwin) - 2 * (l)->inset)
-
-#define FCLAMP(x) ((((x) < 0.0) ? 0.0 : ((x) > 1.0) ? 1.0 : (x)))
-#define CLAMP(x,min,max) ((((x) < (min)) ? (min) : ((x) > (max)) ? (max) : (x)))
-
-#define ITEM_IPAD 5
-#define ITEM_XPAD 0
-#define ITEM_YPAD 0
-
-#define ITEM_REDRAW (1<<2) /* Item needs to be redrawn. */
-#define ITEM_HIDE (1<<5) /* The item is hidden. */
-
-/* Item state. */
-#define ITEM_NORMAL (1<<8) /* Draw item normally. */
-#define ITEM_DISABLED (1<<9) /* Item is disabled. */
-#define ITEM_STATE_MASK ((ITEM_DISABLED)|(ITEM_NORMAL))
-
-#define DEF_MAXWIDTH "1i"
-#define DEF_AUTO_SORT "0"
-#define DEF_BORDERWIDTH "1"
-#define DEF_CURSOR ((char *)NULL)
-#define DEF_EXPORT_SELECTION "1"
-#define DEF_HEIGHT "0"
-#define DEF_HIGHLIGHT_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_HIGHLIGHT_COLOR RGB_BLACK
-#define DEF_HIGHLIGHT_WIDTH "2"
-#define DEF_ICON_VARIABLE ((char *)NULL)
-#define DEF_LAYOUTMODE "column"
-#define DEF_RELIEF "sunken"
-#define DEF_SELECTMODE "single"
-#define DEF_SORT_DICTIONARY "0"
-#define DEF_SORT_COMMAND ((char *)NULL)
-#define DEF_SORT_DECREASING "0"
-#define DEF_SORT_SELECTION "1"
-#define DEF_SORT_TYPE "label"
-#define DEF_TAKEFOCUS "1"
-#define DEF_TEXTVARIABLE ((char *)NULL)
-#define DEF_WIDTH "0"
-#define DEF_XSCROLLCOMMAND ((char *)NULL)
-#define DEF_XSCROLLINCREMENT "20"
-#define DEF_YSCROLLCOMMAND ((char *)NULL)
-#define DEF_YSCROLLINCREMENT "20"
-
-
-#define DEF_ITEM_COMMAND ((char *)NULL)
-#define DEF_ITEM_DATA ((char *)NULL)
-#define DEF_ITEM_ICON ((char *)NULL)
-#define DEF_ITEM_IMAGE ((char *)NULL)
-#define DEF_ITEM_INDENT "0"
-#define DEF_ITEM_MENU ((char *)NULL)
-#define DEF_ITEM_STATE "normal"
-#define DEF_ITEM_STYLE "default"
-#define DEF_ITEM_TAGS ((char *)NULL)
-#define DEF_ITEM_TEXT ((char *)NULL)
-#define DEF_ITEM_TIP ((char *)NULL)
-#define DEF_ITEM_TYPE ((char *)NULL)
-#define DEF_STYLE_ACTIVE_BG RGB_WHITE
-#define DEF_STYLE_ACTIVE_FG RGB_BLACK
-#define DEF_STYLE_ACTIVE_RELIEF "flat"
-#define DEF_STYLE_BG RGB_WHITE
-#define DEF_STYLE_BORDERWIDTH "0"
-#define DEF_STYLE_DISABLED_ACCEL_FG STD_DISABLED_FOREGROUND
-#define DEF_STYLE_DISABLED_BG DISABLED_BACKGROUND
-#define DEF_STYLE_DISABLED_FG DISABLED_FOREGROUND
-#define DEF_STYLE_FG RGB_BLACK
-#define DEF_STYLE_FONT STD_FONT_SMALL
-#define DEF_STYLE_RELIEF "flat"
-#define DEF_STYLE_SELECT_BG RGB_SKYBLUE4
-#define DEF_STYLE_SELECT_FG RGB_WHITE
-#define DEF_STYLE_SELECT_RELIEF "flat"
-#define DISABLED_BACKGROUND RGB_GREY90
-#define DISABLED_FOREGROUND RGB_GREY70
-
-
-static Blt_OptionFreeProc FreeStyleProc;
-static Blt_OptionParseProc ObjToStyleProc;
-static Blt_OptionPrintProc StyleToObjProc;
-static Blt_CustomOption styleOption = {
- ObjToStyleProc, StyleToObjProc, FreeStyleProc, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeTagsProc;
-static Blt_OptionParseProc ObjToTagsProc;
-static Blt_OptionPrintProc TagsToObjProc;
-static Blt_CustomOption tagsOption = {
- ObjToTagsProc, TagsToObjProc, FreeTagsProc, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeLabelProc;
-static Blt_OptionParseProc ObjToLabelProc;
-static Blt_OptionPrintProc LabelToObjProc;
-static Blt_CustomOption labelOption = {
- ObjToLabelProc, LabelToObjProc, FreeLabelProc, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeIconProc;
-static Blt_OptionParseProc ObjToIconProc;
-static Blt_OptionPrintProc IconToObjProc;
-static Blt_CustomOption iconOption = {
- ObjToIconProc, IconToObjProc, FreeIconProc, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToStateProc;
-static Blt_OptionPrintProc StateToObjProc;
-static Blt_CustomOption stateOption = {
- ObjToStateProc, StateToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToRestrictProc;
-static Blt_OptionPrintProc RestrictToObjProc;
-static Blt_CustomOption restrictOption = {
- ObjToRestrictProc, RestrictToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToSelectmode;
-static Blt_OptionPrintProc SelectmodeToObj;
-static Blt_CustomOption selectModeOption = {
- ObjToSelectmode, SelectmodeToObj, NULL, NULL,
-};
-
-static Blt_OptionParseProc ObjToLayoutmode;
-static Blt_OptionPrintProc LayoutmodeToObj;
-static Blt_CustomOption layoutModeOption = {
- ObjToLayoutmode, LayoutmodeToObj, NULL, NULL,
-};
-
-static Blt_OptionParseProc ObjToSortType;
-static Blt_OptionPrintProc SortTypeToObj;
-static Blt_CustomOption sortTypeOption = {
- ObjToSortType, SortTypeToObj, NULL, NULL,
-};
-
-extern Blt_CustomOption bltLimitsOption;
-
-typedef struct _ListView ListView;
-
-typedef enum LayoutModes {
- LAYOUT_LIST_COLUMN, /* Layout items in a single list,
- * one item per row. */
- LAYOUT_LIST_ROW, /* Layout items in multiple columns. */
- LAYOUT_ICONS, /* Layout items in multiple rows
- * using the big icon with the label
- * underneath. */
- LAYOUT_TILES /* Layout items using the big icon
- * with 3 lines of text on the
- * right. */
-} LayoutMode;
-
-/*
- * Icon --
- *
- * Since instances of the same Tk image can be displayed in different
- * windows with possibly different color palettes, Tk internally stores
- * each instance in a linked list. But if the instances are used in the
- * same widget and therefore use the same color palette, this adds a lot
- * of overhead, especially when deleting instances from the linked list.
- *
- * For the listview widget, we never need more than a single instance of
- * an image, regardless of how many times it's used. Cache the image,
- * maintaining a reference count for each image used in the widget. It's
- * likely that the listview widget will use many instances of the same
- * image.
- */
-
-typedef struct _Icon {
- Tk_Image tkImage; /* The Tk image being cached. */
- Blt_HashEntry *hPtr; /* Hash table pointer to the image. */
- int refCount; /* Reference count for this image. */
- short int width, height; /* Dimensions of the cached image. */
-} *Icon;
-
-#define IconHeight(i) ((i)->height)
-#define IconWidth(i) ((i)->width)
-#define IconImage(i) ((i)->tkImage)
-#define IconName(i) (Blt_Image_Name(IconImage(i)))
-
-typedef struct {
- const char *name;
- Blt_HashEntry *hPtr;
- ListView *viewPtr;
- int refCount; /* Indicates if the style is currently
- * in use in the listview. */
- int borderWidth;
- int relief;
- int activeRelief;
- int selectRelief;
-
- Blt_Background normalBg;
- Blt_Background activeBg;
- Blt_Background selectBg;
- Blt_Background disabledBg;
-
- Blt_Font labelFont; /* Font of the label */
- XColor *labelNormalColor; /* Color of label text. */
- XColor *labelDisabledColor; /* Color of label background. */
- XColor *labelActiveColor; /* Color of label background. */
- XColor *labelSelectColor; /* Color of label background. */
-
-} Style;
-
-static Blt_ConfigSpec styleSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", (char *)NULL, (char *)NULL,
- DEF_STYLE_ACTIVE_BG, Blt_Offset(Style, activeBg), 0},
- {BLT_CONFIG_COLOR, "-activeforeground", (char *)NULL, (char *)NULL,
- DEF_STYLE_ACTIVE_FG, Blt_Offset(Style, labelActiveColor), 0},
- {BLT_CONFIG_RELIEF, "-activerelief", (char *)NULL, (char *)NULL,
- DEF_STYLE_ACTIVE_RELIEF, Blt_Offset(Style, activeRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-background", (char *)NULL, (char *)NULL,
- DEF_STYLE_BG, Blt_Offset(Style, normalBg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_SYNONYM, "-bg", (char *)NULL, (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", (char *)NULL, (char *)NULL,
- DEF_STYLE_BORDERWIDTH, Blt_Offset(Style, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-disabledbackground", (char *)NULL, (char *)NULL,
- DEF_STYLE_DISABLED_BG, Blt_Offset(Style, disabledBg), 0},
- {BLT_CONFIG_COLOR, "-disabledforeground", (char *)NULL, (char *)NULL,
- DEF_STYLE_DISABLED_FG, Blt_Offset(Style, labelDisabledColor), 0},
- {BLT_CONFIG_SYNONYM, "-fg", (char *)NULL, (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-foreground", (char *)NULL, (char *)NULL, DEF_STYLE_FG,
- Blt_Offset(Style, labelNormalColor), 0},
- {BLT_CONFIG_FONT, "-font", (char *)NULL, (char *)NULL, DEF_STYLE_FONT,
- Blt_Offset(Style, labelFont), 0},
- {BLT_CONFIG_RELIEF, "-relief", (char *)NULL, (char *)NULL,
- DEF_STYLE_RELIEF, Blt_Offset(Style, relief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-selectbackground", (char *)NULL, (char *)NULL,
- DEF_STYLE_SELECT_BG, Blt_Offset(Style, selectBg), 0},
- {BLT_CONFIG_COLOR, "-selectforeground", (char *)NULL, (char *)NULL,
- DEF_STYLE_SELECT_FG, Blt_Offset(Style, labelSelectColor), 0},
- {BLT_CONFIG_RELIEF, "-selectrelief", (char *)NULL, (char *)NULL,
- DEF_STYLE_ACTIVE_RELIEF, Blt_Offset(Style, selectRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-/*
- *
- * [icon] [label]
- *
- * icon: all entries.
- * label: all entries.
- */
-typedef struct {
- ListView *viewPtr; /* ListView containing this item. */
- long index; /* Index of the item (numbered from 0)*/
- int worldX, worldY; /* Upper left world-coordinate of item
- * in menu. */
- Style *stylePtr; /* Style used by this item. */
- unsigned int flags; /* Contains various bits of
- * information about the item, such as
- * type, state. */
- Blt_ChainLink link;
- int relief;
- int indent; /* # of pixels to indent the icon. */
- Icon image; /* If non-NULL, image to be displayed
- * instead of text label. */
- Icon icon; /* Small icon. */
- Icon bigIcon; /* Big icon. */
- const char *label; /* Label to be displayed. */
- Tcl_Obj *cmdObjPtr; /* Command to be invoked when item is
- * clicked. */
- Tcl_Obj *dataObjPtr; /* User-data associated with this
- * item. */
- Tcl_Obj *tagsObjPtr;
-
- Tcl_Obj *tipObjPtr;
- const char *type;
-
- short int labelX, labelY, labelWidth, labelHeight;
- short int iconX, iconY, iconWidth, iconHeight;
- short int width, height;
- short int worldWidth, worldHeight;
-} Item;
-
-static Blt_ConfigSpec itemSpecs[] =
-{
- {BLT_CONFIG_CUSTOM, "-bigicon", (char *)NULL, (char *)NULL, DEF_ITEM_ICON,
- Blt_Offset(Item, bigIcon), BLT_CONFIG_NULL_OK, &iconOption},
- {BLT_CONFIG_OBJ, "-command", (char *)NULL, (char *)NULL, DEF_ITEM_COMMAND,
- Blt_Offset(Item, cmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-data", (char *)NULL, (char *)NULL, DEF_ITEM_DATA,
- Blt_Offset(Item, dataObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-icon", (char *)NULL, (char *)NULL, DEF_ITEM_ICON,
- Blt_Offset(Item, icon), BLT_CONFIG_NULL_OK, &iconOption},
- {BLT_CONFIG_CUSTOM, "-image", (char *)NULL, (char *)NULL, DEF_ITEM_IMAGE,
- Blt_Offset(Item, image), BLT_CONFIG_NULL_OK, &iconOption},
- {BLT_CONFIG_PIXELS_NNEG, "-indent", (char *)NULL, (char *)NULL,
- DEF_ITEM_INDENT, Blt_Offset(Item, indent), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-state", (char *)NULL, (char *)NULL, DEF_ITEM_STATE,
- Blt_Offset(Item, flags), BLT_CONFIG_DONT_SET_DEFAULT, &stateOption},
- {BLT_CONFIG_CUSTOM, "-style", (char *)NULL, (char *)NULL, DEF_ITEM_STYLE,
- Blt_Offset(Item, stylePtr), 0, &styleOption},
- {BLT_CONFIG_CUSTOM, "-tags", (char *)NULL, (char *)NULL,
- DEF_ITEM_TAGS, 0, BLT_CONFIG_NULL_OK, &tagsOption},
- {BLT_CONFIG_CUSTOM, "-text", (char *)NULL, (char *)NULL, DEF_ITEM_TEXT,
- Blt_Offset(Item, label), BLT_CONFIG_NULL_OK, &labelOption},
- {BLT_CONFIG_OBJ, "-tooltip", (char *)NULL, (char *)NULL, DEF_ITEM_TIP,
- Blt_Offset(Item, tipObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-type", (char *)NULL, (char *)NULL, DEF_ITEM_TYPE,
- Blt_Offset(Item, type), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-struct _ListView {
-
- /*
- * This works around a bug in the Tk API. Under Win32, Tk tries to
- * read the widget record of toplevel windows (TopLevel or Frame widget),
- * to get its menu name field. What this means is that we must carefully
- * arrange the fields of this widget so that the menuName field is at the
- * same offset in the structure.
- */
-
- Tk_Window tkwin; /* Window that embodies the frame.
- * NULL means that the window has been
- * destroyed but the data structures
- * haven't yet been cleaned up. */
- Display *display; /* Display containing widget. Used,
- * among other things, so that
- * resources can be freed even after
- * tkwin has gone away. */
- Tcl_Interp *interp; /* Interpreter associated with widget.
- * Used to delete widget command. */
- Tcl_Command cmdToken; /* Token for widget's command. */
-
- LayoutMode layoutMode;
-
- unsigned int flags;
- Tcl_Obj *iconVarObjPtr; /* Name of TCL variable. If non-NULL,
- * this variable will be set to the
- * name of the Tk image representing
- * the icon of the selected item. */
- Tcl_Obj *textVarObjPtr; /* Name of TCL variable. If non-NULL,
- * this variable will be set to the
- * text string of the label of the
- * selected item. */
- Tcl_Obj *takeFocusObjPtr; /* Value of -takefocus option; not
- * used in the C code, but used by
- * keyboard * traversal scripts. */
- Tk_Cursor cursor; /* Current cursor for window or None. */
-
- Blt_Limits reqWidth, reqHeight;
- int relief;
- int borderWidth;
-
- int highlightWidth; /* Width in pixels of highlight to
- * draw around widget when it has the
- * focus. <= 0 means don't draw a
- * highlight. */
-
- XColor *highlightColor; /* Color for drawing traversal
- * highlight. */
- int inset; /* Sum of highlight thickness and
- * borderwidth. */
-
- XColor *focusColor; /* Color of focus highlight
- * rectangle. */
- GC focusGC;
-
- Style defStyle; /* Default style. */
-
- int maxWidth;
-
- int xScrollUnits, yScrollUnits;
-
- /* Commands to control horizontal and vertical scrollbars. */
- Tcl_Obj *xScrollCmdObjPtr, *yScrollCmdObjPtr;
-
- Blt_HashTable tagTable; /* Table of tags. */
- Blt_HashTable labelTable; /* Table of labels (hashtables). */
- Blt_HashTable iconTable; /* Table of icons. */
-
- Blt_Chain chain;
-
- Item *activePtr; /* If non-NULL, item that is currently
- * active. */
- Item *focusPtr; /* If non-NULL, item that currently
- * has focus. */
-
- int xOffset, yOffset; /* Scroll offsets of viewport in
- * world. */
- int worldWidth, worldHeight; /* Dimension of entire menu. */
-
- short int labelWidth, iconWidth;
- short int labelHeight, iconHeight;
- int itemHeight;
-
- Blt_HashTable styleTable; /* Table of styles used. */
- /*
- * Scanning Information:
- */
- short int scanAnchorX; /* Horizontal scan anchor in screen
- * x-coordinates. */
- short int scanAnchorY; /* Vertical scan anchor in screen
- * y-coordinates. */
- int scanX; /* x-offset of the start of the
- * horizontal scan in world
- * coordinates.*/
- int scanY; /* y-offset of the start of the
- * vertical scan in world
- * coordinates.*/
-
- /*
- * Selection Information:
- */
- Item *selAnchorPtr; /* Fixed end of selection (i.e. item
- * at which selection was started.) */
- Item *selMarkPtr;
-
- Tcl_Obj *selectCmdObjPtr; /* TCL script that's invoked whenever
- * the selection changes. */
-
- Blt_HashTable selectTable; /* Hash table of currently selected
- * entries. */
-
- Blt_Chain selected; /* Chain of currently selected entries.
- * Contains the same information as the
- * above hash table, but maintains the
- * order in which entries are
- * selected. */
-
- Tcl_Obj *sortCmdPtr;
-
- short int width, height;
- Blt_Painter painter;
-};
-
-static Blt_ConfigSpec listViewSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_STYLE_ACTIVE_BG,
- Blt_Offset(ListView, defStyle.activeBg), 0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "ActiveForeground", DEF_STYLE_ACTIVE_FG,
- Blt_Offset(ListView, defStyle.labelActiveColor), 0},
- {BLT_CONFIG_RELIEF, "-activerelief", "activeRelief", "ActiveRelief",
- DEF_STYLE_ACTIVE_RELIEF, Blt_Offset(ListView, defStyle.activeRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_STYLE_BG, Blt_Offset(ListView, defStyle.normalBg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_BORDERWIDTH, Blt_Offset(ListView, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", DEF_CURSOR,
- Blt_Offset(ListView, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BACKGROUND, "-disabledbackground", "disabledBackground",
- "DisabledBackground", DEF_STYLE_DISABLED_BG,
- Blt_Offset(ListView, defStyle.disabledBg), 0},
- {BLT_CONFIG_COLOR, "-disabledforeground", "disabledForeground",
- "DisabledForeground", DEF_STYLE_DISABLED_FG,
- Blt_Offset(ListView, defStyle.labelDisabledColor), 0},
- {BLT_CONFIG_BITMASK, "-exportselection", "exportSelection",
- "ExportSelection", DEF_EXPORT_SELECTION, Blt_Offset(ListView, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)SELECT_EXPORT},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-focuscolor", "focusColor", "FocusColor",
- DEF_HIGHLIGHT_COLOR, Blt_Offset(ListView, focusColor), 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_STYLE_FG, Blt_Offset(ListView, defStyle.labelNormalColor), 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_STYLE_FONT,
- Blt_Offset(ListView, defStyle.labelFont), 0},
- {BLT_CONFIG_CUSTOM, "-height", "height", "Height", DEF_HEIGHT,
- Blt_Offset(ListView, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT,
- &bltLimitsOption},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_HIGHLIGHT_COLOR, Blt_Offset(ListView, highlightColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_HIGHLIGHT_WIDTH,
- Blt_Offset(ListView, highlightWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-maxwidth", "maxWidth", "MaxWidth",
- DEF_MAXWIDTH, Blt_Offset(ListView, maxWidth), 0},
- {BLT_CONFIG_OBJ, "-iconvariable", "iconVariable", "IconVariable",
- DEF_ICON_VARIABLE, Blt_Offset(ListView, iconVarObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-itemborderwidth", "itemBorderWidth",
- "ItemBorderWidth", DEF_STYLE_BORDERWIDTH,
- Blt_Offset(ListView, defStyle.borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-layoutmode", "layoutMode", "LayoutMode",
- DEF_LAYOUTMODE, Blt_Offset(ListView, layoutMode),
- BLT_CONFIG_DONT_SET_DEFAULT, &layoutModeOption},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_RELIEF,
- Blt_Offset(ListView, relief), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-restrictwidth", "restrictWidth", "RestrictWidth",
- (char *)NULL, Blt_Offset(ListView, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- &restrictOption},
- {BLT_CONFIG_BACKGROUND, "-selectbackground", (char *)NULL, (char *)NULL,
- DEF_STYLE_SELECT_BG, Blt_Offset(ListView, defStyle.selectBg), 0},
- {BLT_CONFIG_OBJ, "-selectcommand", "selectCommand", "SelectCommand",
- (char *)NULL, Blt_Offset(ListView, selectCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-selectforeground", (char *)NULL, (char *)NULL,
- DEF_STYLE_SELECT_FG, Blt_Offset(ListView, defStyle.labelSelectColor),0},
- {BLT_CONFIG_RELIEF, "-selectrelief", (char *)NULL, (char *)NULL,
- DEF_STYLE_ACTIVE_RELIEF, Blt_Offset(ListView, defStyle.selectRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-selectmode", "selectMode", "SelectMode",
- DEF_SELECTMODE, Blt_Offset(ListView, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, &selectModeOption},
- {BLT_CONFIG_BITMASK, "-orderselection", "orderSelection", "OrderSelection",
- DEF_SORT_SELECTION, Blt_Offset(ListView, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)SELECT_ORDERED},
- {BLT_CONFIG_OBJ, "-textvariable", "textVariable", "TextVariable",
- DEF_TEXTVARIABLE, Blt_Offset(ListView, textVarObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
- DEF_XSCROLLCOMMAND, Blt_Offset(ListView, xScrollCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_POS, "-xscrollincrement", "xScrollIncrement",
- "ScrollIncrement", DEF_XSCROLLINCREMENT,
- Blt_Offset(ListView, xScrollUnits), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
- DEF_YSCROLLCOMMAND, Blt_Offset(ListView, yScrollCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_POS, "-yscrollincrement", "yScrollIncrement",
- "ScrollIncrement", DEF_YSCROLLINCREMENT,
- Blt_Offset(ListView, yScrollUnits),BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-takefocus", "takeFocus", "TakeFocus",
- DEF_TAKEFOCUS, Blt_Offset(ListView, takeFocusObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-width", "width", "Width", DEF_WIDTH,
- Blt_Offset(ListView, reqWidth), BLT_CONFIG_DONT_SET_DEFAULT,
- &bltLimitsOption},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-static Blt_ConfigSpec sortSpecs[] = {
- {BLT_CONFIG_BITMASK, "-autosort", "autoSort", "AutoSort", DEF_AUTO_SORT,
- Blt_Offset(ListView, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)SORT_AUTO},
- {BLT_CONFIG_BITMASK, "-dictionary", "dictionary", "Dictionary",
- DEF_SORT_DICTIONARY, Blt_Offset(ListView, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)SORT_DICTIONARY},
- {BLT_CONFIG_OBJ, "-command", "command", "Command", DEF_SORT_COMMAND,
- Blt_Offset(ListView, sortCmdPtr),
- BLT_CONFIG_DONT_SET_DEFAULT | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMASK, "-decreasing", "decreasing", "Decreasing",
- DEF_SORT_DECREASING, Blt_Offset(ListView, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)SORT_DECREASING},
- {BLT_CONFIG_CUSTOM, "-by", "by", "By", DEF_SORT_TYPE,
- Blt_Offset(ListView, flags), 0, &sortTypeOption},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-/*
- * ItemIterator --
- *
- * Items may be tagged with strings. An item may have many tags. The
- * same tag may be used for many items.
- *
- */
-
-typedef enum {
- ITER_SINGLE, ITER_ALL, ITER_TAG, ITER_PATTERN
-} IteratorType;
-
-typedef struct _Iterator {
- ListView *viewPtr; /* ListView that we're iterating
- * over. */
-
- IteratorType type; /* Type of iteration:
- * ITER_TAG By item tag.
- * ITER_ALL By every item.
- * ITER_SINGLE Single item: either
- * tag or index.
- */
-
- Item *startPtr, *last; /* Starting and ending item. Starting
- * point of search, saved if iterator
- * is reused. Used for ITER_ALL and
- * ITER_SINGLE searches. */
- Item *endPtr; /* Ending item (inclusive). */
- Item *nextPtr; /* Next item. */
- char *tagName; /* If non-NULL, is the tag that we are
- * currently iterating over. */
-
- Blt_HashTable *tablePtr; /* Pointer to tag hash table. */
-
- Blt_HashSearch cursor; /* Search iterator for tag hash
- * table. */
- Blt_ChainLink link;
-} ItemIterator;
-
-static Blt_SwitchParseProc ItemSwitch;
-static Blt_SwitchCustom itemSwitch = {
- ItemSwitch, NULL, NULL,
-};
-
-static Blt_SwitchParseProc PatternSwitch;
-static Blt_SwitchCustom patternSwitch = {
- PatternSwitch, NULL, NULL,
-};
-
-#define FIND_GLOB (0) /* Default pattern type. */
-#define FIND_REGEXP (1<<0)
-#define FIND_EXACT (1<<1)
-#define FIND_PATTERN_MASK (FIND_EXACT|FIND_GLOB|FIND_REGEXP)
-#define FIND_HIDDEN (1<<2)
-#define FIND_DISABLED (1<<3)
-#define FIND_ANY (FIND_HIDDEN|FIND_DISABLED)
-#define FIND_WRAP (1<<4)
-#define FIND_REVERSE (1<<5)
-
-typedef struct {
- unsigned int flags;
- int count;
- Item *fromPtr, *toPtr;
-} FindSwitches;
-
-static Blt_SwitchSpec findSwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-any", "",
- Blt_Offset(FindSwitches, flags), 0, FIND_ANY},
- {BLT_SWITCH_INT_NNEG, "-count", "number",
- Blt_Offset(FindSwitches, count), 0, 0},
- {BLT_SWITCH_BITMASK, "-disabled", "",
- Blt_Offset(FindSwitches, flags), 0, FIND_DISABLED},
- {BLT_SWITCH_CUSTOM, "-from", "item",
- Blt_Offset(FindSwitches, fromPtr), 0, 0, &itemSwitch},
- {BLT_SWITCH_BITMASK, "-hidden", "",
- Blt_Offset(FindSwitches, flags), 0, FIND_HIDDEN},
- {BLT_SWITCH_BITMASK, "-reverse", "",
- Blt_Offset(FindSwitches, flags), 0, FIND_REVERSE},
- {BLT_SWITCH_CUSTOM, "-to", "item",
- Blt_Offset(FindSwitches, toPtr), 0, 0, &itemSwitch},
- {BLT_SWITCH_CUSTOM, "-type", "glob|regexp|exact",
- Blt_Offset(FindSwitches, flags), 0, 0, &patternSwitch},
- {BLT_SWITCH_BITMASK, "-wrap", "",
- Blt_Offset(FindSwitches, flags), 0, FIND_WRAP},
- {BLT_SWITCH_END}
-};
-
-typedef int (ListViewCmdProc)(ListView *viewPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-static int GetItemIterator(Tcl_Interp *interp, ListView *viewPtr,
- Tcl_Obj *objPtr, ItemIterator *iterPtr);
-static int GetItemFromObj(Tcl_Interp *interp, ListView *viewPtr,
- Tcl_Obj *objPtr, Item **itemPtrPtr);
-
-static Tcl_IdleProc DisplayItem;
-static Tcl_IdleProc DisplayListView;
-static Tcl_FreeProc DestroyListView;
-static Tk_EventProc ListViewEventProc;
-static Tcl_ObjCmdProc ListViewInstCmdProc;
-static Tcl_CmdDeleteProc ListViewInstCmdDeletedProc;
-static Tk_ImageChangedProc IconChangedProc;
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChildSwitch --
- *
- * Convert a Tcl_Obj representing the label of a child node into its
- * integer node id.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PatternSwitch(
- ClientData clientData, /* Flag indicating if the node is considered
- * before or after the insertion position. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- char c;
- const char *string;
- int length;
- unsigned int *flagsPtr = (unsigned int *)(record + offset);
- unsigned int flag;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'g') && (strncmp(string, "glob", length) == 0)) {
- flag = FIND_GLOB;
- } else if ((c == 'r') && (strncmp(string, "regexp", length) == 0)) {
- flag = FIND_REGEXP;
- } else if ((c == 'e') && (strncmp(string, "exact", length) == 0)) {
- flag = FIND_EXACT;
- } else {
- Tcl_AppendResult(interp, "unknown pattern type \"", string,
- "\": should be glob, regexp, or exact.", (char *)NULL);
- return TCL_ERROR;
- }
- *flagsPtr &= ~FIND_PATTERN_MASK;
- *flagsPtr |= flag;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToLayoutmode --
- *
- * Convert the string reprsenting a layout mode, to its numeric
- * form.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToLayoutmode(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- ListView *viewPtr = (ListView *)widgRec;
- char *string;
- char c;
- int *modePtr = (int *)(widgRec + offset);
-
- string = Tcl_GetString(objPtr);
- c = string[0];
- if ((c == 'c') && (strcmp(string, "column") == 0)) {
- *modePtr = LAYOUT_LIST_COLUMN;
- } else if ((c == 'r') && (strcmp(string, "row") == 0)) {
- *modePtr = LAYOUT_LIST_ROW;
- } else if ((c == 'i') && (strcmp(string, "icons") == 0)) {
- *modePtr = LAYOUT_ICONS;
- } else if ((c == 't') && (strcmp(string, "tiles") == 0)) {
- *modePtr = LAYOUT_TILES;
- } else {
- Tcl_AppendResult(interp, "bad select mode \"", string,
- "\": should be column, row, icons, or tiles.", (char *)NULL);
- return TCL_ERROR;
- }
- viewPtr->flags |= LAYOUT_PENDING;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LayoutmodeToObj --
- *
- * Results:
- * The string representation of the button boolean is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-LayoutmodeToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- int mode = *(int *)(widgRec + offset);
-
- switch (mode) {
- case LAYOUT_LIST_COLUMN:
- return Tcl_NewStringObj("column", -1);
- case LAYOUT_LIST_ROW:
- return Tcl_NewStringObj("row", -1);
- case LAYOUT_ICONS:
- return Tcl_NewStringObj("icons", -1);
- case LAYOUT_TILES:
- return Tcl_NewStringObj("tiles", -1);
- default:
- return Tcl_NewStringObj("???", -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToSelectmode --
- *
- * Convert the string reprsenting a scroll mode, to its numeric
- * form.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToSelectmode(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- char *string;
- char c;
- int flag;
- int *flagsPtr = (int *)(widgRec + offset);
-
- string = Tcl_GetString(objPtr);
- c = string[0];
- if ((c == 's') && (strcmp(string, "single") == 0)) {
- flag = SELECT_SINGLE;
- } else if ((c == 'm') && (strcmp(string, "multiple") == 0)) {
- flag = SELECT_MULTIPLE;
- } else {
- Tcl_AppendResult(interp, "bad select mode \"", string,
- "\": should be \"single\" or \"multiple\"", (char *)NULL);
- return TCL_ERROR;
- }
- *flagsPtr &= ~SELECT_MODE_MASK;
- *flagsPtr |= flag;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectmodeToObj --
- *
- * Results:
- * The string representation of the button boolean is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-SelectmodeToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- int mask = *(int *)(widgRec + offset);
-
- switch (mask & SELECT_MODE_MASK) {
- case SELECT_SINGLE:
- return Tcl_NewStringObj("single", -1);
- case SELECT_MULTIPLE:
- return Tcl_NewStringObj("multiple", -1);
- default:
- return Tcl_NewStringObj("???", -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToSortType --
- *
- * Convert the string reprsenting a scroll mode, to its numeric
- * form.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToSortType(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- char *string;
- char c;
- int flag;
- int *flagsPtr = (int *)(widgRec + offset);
-
- string = Tcl_GetString(objPtr);
- c = string[0];
- if ((c == 'l') && (strcmp(string, "label") == 0)) {
- flag = SORT_LABEL;
- } else if ((c == 't') && (strcmp(string, "type") == 0)) {
- flag = SORT_TYPE;
- } else {
- Tcl_AppendResult(interp, "bad sort mode \"", string,
- "\": should be \"label\" or \"type\"", (char *)NULL);
- return TCL_ERROR;
- }
- *flagsPtr &= ~SORT_MODE_MASK;
- *flagsPtr |= flag;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SortTypeToObj --
- *
- * Results:
- * The string representation of the button boolean is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-SortTypeToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- int mask = *(int *)(widgRec + offset);
-
- switch (mask & SORT_MODE_MASK) {
- case SORT_TYPE:
- return Tcl_NewStringObj("type", -1);
- case SORT_LABEL:
- return Tcl_NewStringObj("label", -1);
- default:
- return Tcl_NewStringObj("???", -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Tells the Tk dispatcher to call the listview display routine at the
- * next idle point. This request is made only if the window is displayed
- * and no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(ListView *viewPtr)
-{
- if ((viewPtr->tkwin != NULL) && !(viewPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayListView, viewPtr);
- viewPtr->flags |= REDRAW_PENDING;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectCmdProc --
- *
- * Invoked at the next idle point whenever the current selection changes.
- * Executes some application-specific code in the -selectcommand option.
- * This provides a way for applications to handle selection changes.
- *
- * Results:
- * None.
- *
- * Side effects:
- * TCL code gets executed for some application-specific task.
- *
- *---------------------------------------------------------------------------
- */
-static void
-SelectCmdProc(ClientData clientData)
-{
- ListView *viewPtr = clientData;
-
- viewPtr->flags &= ~SELECT_PENDING;
- Tcl_Preserve(viewPtr);
- if (viewPtr->selectCmdObjPtr != NULL) {
- if (Tcl_EvalObjEx(viewPtr->interp, viewPtr->selectCmdObjPtr,
- TCL_EVAL_GLOBAL) != TCL_OK) {
- Tcl_BackgroundError(viewPtr->interp);
- }
- }
- Tcl_Release(viewPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyInvokeSelectCmd --
- *
- * Queues a request to execute the -selectcommand code associated with
- * the widget at the next idle point. Invoked whenever the selection
- * changes.
- *
- * Results:
- * None.
- *
- * Side effects:
- * TCL code gets executed for some application-specific task.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyInvokeSelectCmd(ListView *viewPtr)
-{
- if ((viewPtr->flags & SELECT_PENDING) == 0) {
- viewPtr->flags |= SELECT_PENDING;
- Tcl_DoWhenIdle(SelectCmdProc, viewPtr);
- }
-}
-
-
-static INLINE Item *
-FirstItem(ListView *viewPtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_FirstLink(viewPtr->chain);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- return NULL;
-}
-
-static INLINE Item *
-LastItem(ListView *viewPtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_LastLink(viewPtr->chain);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- return NULL;
-}
-
-
-static Item *
-NextItem(Item *itemPtr)
-{
- if (itemPtr != NULL) {
- Blt_ChainLink link;
-
- link = Blt_Chain_NextLink(itemPtr->link);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- }
- return NULL;
-}
-
-static INLINE Item *
-PrevItem(Item *itemPtr)
-{
- if (itemPtr != NULL) {
- Blt_ChainLink link;
-
- link = Blt_Chain_PrevLink(itemPtr->link);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- }
- return NULL;
-}
-
-static Item *
-NextItemAvailable(Item *itemPtr)
-{
- for (itemPtr = NextItem(itemPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- if ((itemPtr->flags & (ITEM_HIDE|ITEM_DISABLED)) == 0) {
- return itemPtr;
- }
- }
- return NULL;
-}
-
-static Item *
-PrevItemAvailable(Item *itemPtr)
-{
- for (itemPtr = PrevItem(itemPtr); itemPtr != NULL;
- itemPtr = PrevItem(itemPtr)) {
- if ((itemPtr->flags & (ITEM_HIDE|ITEM_DISABLED)) == 0) {
- return itemPtr;
- }
- }
- return NULL;
-}
-
-static int
-ItemIsSelected(ListView *viewPtr, Item *itemPtr)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->selectTable, (char *)itemPtr);
- return (hPtr != NULL);
-}
-
-static void
-SelectItem(ListView *viewPtr, Item *itemPtr)
-{
- int isNew;
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_CreateHashEntry(&viewPtr->selectTable, (char *)itemPtr, &isNew);
- if (isNew) {
- Blt_ChainLink link;
-
- link = Blt_Chain_Append(viewPtr->selected, itemPtr);
- Blt_SetHashValue(hPtr, link);
- }
- if ((viewPtr->textVarObjPtr != NULL) && (itemPtr->label != NULL)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(itemPtr->label, -1);
- if (Tcl_ObjSetVar2(viewPtr->interp, viewPtr->textVarObjPtr, NULL,
- objPtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- return;
- }
- }
- if ((viewPtr->iconVarObjPtr != NULL) && (itemPtr->icon != NULL)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(IconName(itemPtr->icon), -1);
- if (Tcl_ObjSetVar2(viewPtr->interp, viewPtr->iconVarObjPtr, NULL,
- objPtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- return;
- }
- }
-}
-
-static void
-DeselectItem(ListView *viewPtr, Item *itemPtr)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->selectTable, (char *)itemPtr);
- if (hPtr != NULL) {
- Blt_ChainLink link;
-
- link = Blt_GetHashValue(hPtr);
- Blt_Chain_DeleteLink(viewPtr->selected, link);
- Blt_DeleteHashEntry(&viewPtr->selectTable, hPtr);
- }
-}
-
-static void
-SelectItemUsingFlags(ListView *viewPtr, Item *itemPtr)
-{
- switch (viewPtr->flags & SELECT_MASK) {
- case SELECT_CLEAR:
- DeselectItem(viewPtr, itemPtr);
- break;
-
- case SELECT_SET:
- SelectItem(viewPtr, itemPtr);
- break;
-
- case SELECT_TOGGLE:
- if (ItemIsSelected(viewPtr, itemPtr)) {
- DeselectItem(viewPtr, itemPtr);
- } else {
- SelectItem(viewPtr, itemPtr);
- }
- break;
- }
-}
-
-
-static void
-ClearSelection(ListView *viewPtr)
-{
- Blt_DeleteHashTable(&viewPtr->selectTable);
- Blt_InitHashTable(&viewPtr->selectTable, BLT_ONE_WORD_KEYS);
- Blt_Chain_Reset(viewPtr->selected);
- EventuallyRedraw(viewPtr);
- if (viewPtr->selectCmdObjPtr != NULL) {
- EventuallyInvokeSelectCmd(viewPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LostSelection --
- *
- * This procedure is called back by Tk when the selection is grabbed
- * away.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The existing selection is unhighlighted, and the window is
- * marked as not containing a selection.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LostSelection(ClientData clientData)
-{
- ListView *viewPtr = clientData;
-
- if (viewPtr->flags & SELECT_EXPORT) {
- ClearSelection(viewPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectRange --
- *
- * Sets the selection flag for a range of nodes. The range is
- * determined by two pointers which designate the first/last
- * nodes of the range.
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectRange(ListView *viewPtr, Item *fromPtr, Item *toPtr)
-{
- Blt_ChainLink link;
-
- if (fromPtr->index > toPtr->index) {
- Item *tmpPtr;
-
- tmpPtr = fromPtr;
- fromPtr = toPtr;
- toPtr = tmpPtr;
- }
- for (link = fromPtr->link; link != NULL; link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- if ((itemPtr->flags & ITEM_DISABLED) == 0) {
- SelectItemUsingFlags(viewPtr, itemPtr);
- }
- if (itemPtr->index >= toPtr->index) {
- break;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionProc --
- *
- * This procedure is called back by Tk when the selection is requested by
- * someone. It returns part or all of the selection in a buffer provided
- * by the caller.
- *
- * Results:
- * The return value is the number of non-NULL bytes stored at buffer.
- * Buffer is filled (or partially filled) with a NUL-terminated string
- * containing part or all of the selection, as given by offset and
- * maxBytes.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectionProc(
- ClientData clientData, /* Information about the widget. */
- int offset, /* Offset within selection of first
- * character to be returned. */
- char *buffer, /* Location in which to place
- * selection. */
- int maxBytes) /* Maximum number of bytes to place at
- * buffer, not including terminating
- * NULL character. */
-{
- ListView *viewPtr = clientData;
- Tcl_DString dString;
- int size;
-
- if ((viewPtr->flags & SELECT_EXPORT) == 0) {
- return -1;
- }
- /*
- * Retrieve the names of the selected entries.
- */
- Tcl_DStringInit(&dString);
- if (viewPtr->flags & SELECT_ORDERED) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(viewPtr->selected); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- Tcl_DStringAppend(&dString, itemPtr->label, -1);
- Tcl_DStringAppend(&dString, "\n", -1);
- }
- } else {
- Item *itemPtr;
-
- for (itemPtr = FirstItem(viewPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- if (ItemIsSelected(viewPtr, itemPtr)) {
- Tcl_DStringAppend(&dString, itemPtr->label, -1);
- Tcl_DStringAppend(&dString, "\n", -1);
- }
- }
-
- }
- size = Tcl_DStringLength(&dString) - offset;
- strncpy(buffer, Tcl_DStringValue(&dString) + offset, maxBytes);
- Tcl_DStringFree(&dString);
- buffer[maxBytes] = '\0';
- return (size > maxBytes) ? maxBytes : size;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedrawItem --
- *
- * Tells the Tk dispatcher to call the listview display routine at the
- * next idle point. This request is made only if the window is displayed
- * and no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedrawItem(Item *itemPtr)
-{
- ListView *viewPtr;
-
- if (itemPtr->flags & (ITEM_HIDE|ITEM_REDRAW)) {
- return;
- }
- viewPtr = itemPtr->viewPtr;
- if (viewPtr->flags & REDRAW_PENDING) {
- return;
- }
- if (viewPtr->tkwin != NULL) {
- Tcl_DoWhenIdle(DisplayItem, itemPtr);
- itemPtr->flags |= ITEM_REDRAW;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReleaseTags --
- *
- * Releases the tags used by this item.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ReleaseTags(ListView *viewPtr, Item *itemPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&viewPtr->tagTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tagTablePtr;
- Blt_HashEntry *h2Ptr;
-
- tagTablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tagTablePtr, (char *)itemPtr->index);
- if (h2Ptr != NULL) {
- Blt_DeleteHashEntry(tagTablePtr, h2Ptr);
- }
- }
-}
-
-static void
-DestroyItem(Item *itemPtr)
-{
- ListView *viewPtr = itemPtr->viewPtr;
-
- DeselectItem(viewPtr, itemPtr);
- ReleaseTags(viewPtr, itemPtr);
- iconOption.clientData = viewPtr;
- Blt_FreeOptions(itemSpecs, (char *)itemPtr, viewPtr->display, 0);
- if (viewPtr->activePtr == itemPtr) {
- viewPtr->activePtr = NULL;
- }
- if (viewPtr->flags & SORT_AUTO) {
- viewPtr->flags |= SORT_PENDING;
- }
- viewPtr->flags |= LAYOUT_PENDING;
- Blt_Chain_DeleteLink(viewPtr->chain, itemPtr->link);
-}
-
-static void
-DestroyItems(ListView *viewPtr)
-{
- Blt_ChainLink link, next;
-
- for (link = Blt_Chain_FirstLink(viewPtr->chain); link != NULL;
- link = next) {
- Item *itemPtr;
-
- next = Blt_Chain_NextLink(link);
- itemPtr = Blt_Chain_GetValue(link);
- DestroyItem(itemPtr);
- }
- if (viewPtr->flags & SORT_AUTO) {
- viewPtr->flags |= SORT_PENDING;
- }
- viewPtr->flags |= LAYOUT_PENDING;
- Blt_Chain_Destroy(viewPtr->chain);
-}
-
-static Item *
-NewItem(ListView *viewPtr)
-{
- Item *itemPtr;
- Blt_ChainLink link;
-
- link = Blt_Chain_AllocLink(sizeof(Item));
- itemPtr = Blt_Chain_GetValue(link);
- itemPtr->viewPtr = viewPtr;
- itemPtr->flags |= ITEM_NORMAL;
- itemPtr->link = link;
- itemPtr->index = Blt_Chain_GetLength(viewPtr->chain);
- Blt_Chain_LinkAfter(viewPtr->chain, link, NULL);
- itemPtr->label = emptyString;
- return itemPtr;
-}
-
-static INLINE Item *
-FindItemByIndex(ListView *viewPtr, long index)
-{
- Blt_ChainLink link;
-
- if ((index < 1) || (index > Blt_Chain_GetLength(viewPtr->chain))) {
- return NULL;
- }
- link = Blt_Chain_GetNthLink(viewPtr->chain, index - 1);
- return Blt_Chain_GetValue(link);
-}
-
-
-static INLINE Item *
-BeginItem(ListView *viewPtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_FirstLink(viewPtr->chain);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- return NULL;
-}
-
-static INLINE Item *
-EndItem(ListView *viewPtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_LastLink(viewPtr->chain);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateItem --
- *
- * Marks the designated item as active. The item is redrawn with its
- * active colors. The previously active item is deactivated. If the new
- * item is NULL, then this means that no new item is to be activated.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Menu items may be scheduled to be drawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ActivateItem(ListView *viewPtr, Item *itemPtr)
-{
- if ((viewPtr->activePtr == itemPtr) && (itemPtr != NULL)) {
- return; /* Item is already active. */
- }
- if (viewPtr->activePtr != NULL) {
- EventuallyRedrawItem(viewPtr->activePtr);
- }
- viewPtr->activePtr = itemPtr;
- if (itemPtr != NULL) {
- EventuallyRedrawItem(itemPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetBoundedWidth --
- *
- * Bounds a given width value to the limits described in the limit
- * structure. The initial starting value may be overridden by the nominal
- * value in the limits.
- *
- * Results:
- * Returns the constrained value.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetBoundedWidth(ListView *viewPtr, int w)
-{
- /*
- * Check widgets for requested width values;
- */
- if (viewPtr->reqWidth.flags & LIMITS_NOM_SET) {
- w = viewPtr->reqWidth.nom; /* Override initial value */
- }
- if (w < viewPtr->reqWidth.min) {
- w = viewPtr->reqWidth.min; /* Bounded by minimum value */
- }
- if (w > viewPtr->reqWidth.max) {
- w = viewPtr->reqWidth.max; /* Bounded by maximum value */
- }
- if (viewPtr->flags & (RESTRICT_MIN|RESTRICT_MAX)) {
- Tk_Window parent;
-
- parent = Tk_Parent(viewPtr->tkwin);
- if ((viewPtr->flags & RESTRICT_MIN) && (w < Tk_Width(parent))) {
- w = Tk_Width(parent);
- }
- if ((viewPtr->flags & RESTRICT_MAX) && (w > Tk_Width(parent))) {
- w = Tk_Width(parent);
- }
- }
- {
- int screenWidth, screenHeight;
-
- Blt_SizeOfScreen(viewPtr->tkwin, &screenWidth, &screenHeight);
- if (w > screenWidth) {
- w = screenWidth;
- }
- }
- return w;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetBoundedHeight --
- *
- * Bounds a given value to the limits described in the limit structure.
- * The initial starting value may be overridden by the nominal value in
- * the limits.
- *
- * Results:
- * Returns the constrained value.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetBoundedHeight(ListView *viewPtr, int h)
-{
- /*
- * Check widgets for requested height values;
- */
- if (viewPtr->reqHeight.flags & LIMITS_NOM_SET) {
- h = viewPtr->reqHeight.nom; /* Override initial value */
- }
- if (h < viewPtr->reqHeight.min) {
- h = viewPtr->reqHeight.min; /* Bounded by minimum value */
- }
- if (h > viewPtr->reqHeight.max) {
- h = viewPtr->reqHeight.max; /* Bounded by maximum value */
- }
- if (h > HeightOfScreen(Tk_Screen(viewPtr->tkwin))) {
- h = HeightOfScreen(Tk_Screen(viewPtr->tkwin));
- }
- return h;
-}
-
-static void
-ComputeIconsItemGeometry(ListView *viewPtr, Item *itemPtr)
-{
- Icon icon;
-
- /* Determine the height of the item. It's the maximum height of all it's
- * components: left gadget (radiobutton or checkbutton), icon, label,
- * right gadget (cascade), and accelerator. */
- itemPtr->labelWidth = itemPtr->labelHeight = 0;
- itemPtr->iconWidth = itemPtr->iconHeight = 0;
- itemPtr->height = itemPtr->width = 0;
-
- if (itemPtr->flags & ITEM_HIDE) {
- return;
- }
- icon = itemPtr->bigIcon;
- if (icon != NULL) {
- itemPtr->iconWidth = IconWidth(icon) + 2;
- itemPtr->iconHeight = IconHeight(icon) + 2;
- }
- if (itemPtr->image != NULL) {
- itemPtr->labelWidth = IconWidth(itemPtr->image);
- itemPtr->labelHeight = IconHeight(itemPtr->image);
- itemPtr->labelWidth += 2 * itemPtr->stylePtr->borderWidth;
- itemPtr->labelHeight += 2 * itemPtr->stylePtr->borderWidth;
- itemPtr->labelWidth |= 0x1;
- itemPtr->labelHeight |= 0x1;
- } else if (itemPtr->label != emptyString) {
- unsigned int w, h;
-
- Blt_GetTextExtents(itemPtr->stylePtr->labelFont, 0, itemPtr->label,
- -1, &w, &h);
- w += 2 * itemPtr->stylePtr->borderWidth;
- h += 2 * itemPtr->stylePtr->borderWidth;
- itemPtr->labelWidth = w | 0x1;
- itemPtr->labelHeight = h | 0x1;
- }
- if ((itemPtr->iconWidth > 0) && (itemPtr->iconHeight > 0)) {
- itemPtr->height += itemPtr->iconHeight;
- if (itemPtr->width < itemPtr->iconWidth) {
- itemPtr->width = itemPtr->iconWidth;
- }
- }
- if ((itemPtr->labelWidth > 0) && (itemPtr->labelHeight > 0)) {
- int w;
- w = itemPtr->labelWidth + 6;
- itemPtr->height += itemPtr->labelHeight + 6;
- if (itemPtr->width < w) {
- itemPtr->width = w;
- }
- }
- if ((itemPtr->labelHeight > 0) && (itemPtr->iconHeight > 0)) {
- itemPtr->width += ITEM_IPAD;
- }
-}
-
-static void
-ComputeListItemGeometry(ListView *viewPtr, Item *itemPtr)
-{
- Icon icon;
-
- /* Determine the height of the item. It's the maximum height of all it's
- * components: left gadget (radiobutton or checkbutton), icon, label,
- * right gadget (cascade), and accelerator. */
- itemPtr->labelWidth = itemPtr->labelHeight = 0;
- itemPtr->iconWidth = itemPtr->iconHeight = 0;
- itemPtr->height = itemPtr->width = 0;
- itemPtr->worldWidth = itemPtr->worldHeight = 0;
- if (itemPtr->flags & ITEM_HIDE) {
- return;
- }
- icon = (viewPtr->layoutMode == LAYOUT_ICONS) ? itemPtr->bigIcon :
- itemPtr->icon;
- if (icon != NULL) {
- itemPtr->iconWidth = IconWidth(icon) + 2;
- itemPtr->iconHeight = IconHeight(icon) + 2;
- }
- if (itemPtr->image != NULL) {
- itemPtr->labelWidth = IconWidth(itemPtr->image);
- itemPtr->labelHeight = IconHeight(itemPtr->image);
- itemPtr->labelWidth += 2 * itemPtr->stylePtr->borderWidth;
- itemPtr->labelHeight += 2 * itemPtr->stylePtr->borderWidth;
- itemPtr->labelWidth |= 0x1;
- itemPtr->labelHeight |= 0x1;
- } else if (itemPtr->label != emptyString) {
- unsigned int w, h;
-
- Blt_GetTextExtents(itemPtr->stylePtr->labelFont, 0, itemPtr->label,
- -1, &w, &h);
- w += 2 * itemPtr->stylePtr->borderWidth;
- h += 2 * itemPtr->stylePtr->borderWidth;
- itemPtr->labelWidth = w | 0x1;
- itemPtr->labelHeight = h | 0x1;
- }
- if ((itemPtr->iconWidth > 0) && (itemPtr->iconHeight > 0)) {
- itemPtr->width += itemPtr->iconWidth;
- if (itemPtr->height < itemPtr->iconHeight) {
- itemPtr->height = itemPtr->iconHeight;
- }
- if (viewPtr->iconWidth < itemPtr->iconWidth) {
- viewPtr->iconWidth = itemPtr->iconWidth;
- }
-
- }
- if ((itemPtr->labelWidth > 0) && (itemPtr->labelHeight > 0)) {
- int h;
-
- itemPtr->width += itemPtr->labelWidth + 6;
- h = itemPtr->labelHeight + 6;
- if (itemPtr->height < h) {
- itemPtr->height = h;
- }
- }
- if ((itemPtr->labelWidth > 0) && (itemPtr->iconWidth > 0)) {
- itemPtr->width += ITEM_IPAD;
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeRowLayout --
- *
- * Computes the layout of the widget with the items displayed
- * one per row.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComputeRowLayout(ListView *viewPtr)
-{
- int x, y, w, h;
- int reqWidth, reqHeight;
- Item *itemPtr;
-
- /*
- * Step 1. Get the maximum width of all the items.
- */
- x = y = 0;
- for (itemPtr = FirstItem(viewPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- if (itemPtr->flags & ITEM_HIDE) {
- continue;
- }
- itemPtr->worldX = 0;
- itemPtr->worldY = viewPtr->worldHeight;
- itemPtr->worldWidth = itemPtr->width;
- itemPtr->worldHeight = itemPtr->height;
- ComputeListItemGeometry(viewPtr, itemPtr);
- if (viewPtr->worldWidth < itemPtr->width) {
- viewPtr->worldWidth = itemPtr->width;
- }
- viewPtr->worldHeight += itemPtr->height;
- }
- /* Figure out the requested size of the widget. This will also tell us if
- * we need scrollbars. */
-
- reqWidth = viewPtr->worldWidth + 2 * viewPtr->inset;
- reqHeight = viewPtr->worldHeight + 2 * viewPtr->inset;
-
- w = GetBoundedWidth(viewPtr, reqWidth);
- h = GetBoundedHeight(viewPtr, reqHeight);
-
- if ((w != Tk_ReqWidth(viewPtr->tkwin)) ||
- (h != Tk_ReqHeight(viewPtr->tkwin))) {
- Tk_GeometryRequest(viewPtr->tkwin, w, h);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeColumnLayout --
- *
- * Computes the layout of the widget with the items displayed multiple
- * columns. The current height of the widget is used as a basis for the
- * number of rows in a column.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComputeColumnLayout(ListView *viewPtr)
-{
- int x, y, w, h;
- int reqWidth, reqHeight;
- int maxWidth, maxHeight;
- int winHeight;
- int nRows, nColumns, nEntries;
- int count, lastMaxWidth, maxIconWidth;
- Item *itemPtr;
-
- nEntries = maxWidth = maxHeight = maxIconWidth = 0;
- viewPtr->itemHeight = 0;
- for (itemPtr = FirstItem(viewPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- if (itemPtr->flags & ITEM_HIDE) {
- continue;
- }
- ComputeListItemGeometry(viewPtr, itemPtr);
- if (maxIconWidth < itemPtr->iconWidth) {
- maxIconWidth = itemPtr->iconWidth;
- }
- if (maxWidth < itemPtr->width) {
- maxWidth = itemPtr->width;
- }
- if (maxHeight < itemPtr->height) {
- maxHeight = itemPtr->height;
- }
- nEntries++;
- }
- if (nEntries == 0) {
- return;
- }
- winHeight = VPORTHEIGHT(viewPtr);
- if (winHeight <= 1) {
- winHeight = Tk_ReqHeight(viewPtr->tkwin) - 2 * viewPtr->inset;
- }
- nRows = winHeight / maxHeight;
- if (nRows <= 0) {
- nRows = 1;
- }
- nColumns = nEntries / nRows;
-
- /* Now compute the worldX positions */
- x = y = 0;
- count = 0;
- lastMaxWidth = 0;
- for (itemPtr = FirstItem(viewPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- if (itemPtr->flags & ITEM_HIDE) {
- continue;
- }
- itemPtr->worldX = x;
- itemPtr->worldY = y;
- itemPtr->worldWidth = itemPtr->width;
- itemPtr->worldHeight = maxHeight;
- if (itemPtr->width > lastMaxWidth) {
- lastMaxWidth = itemPtr->width;
- }
- itemPtr->iconX = 1 + (maxIconWidth - itemPtr->iconWidth) / 2;
- itemPtr->iconY = 1 + (maxHeight - itemPtr->iconHeight) / 2;
-
- itemPtr->labelX = 2 + maxIconWidth;
- if ((itemPtr->labelWidth > 0) && (itemPtr->iconWidth > 0)) {
- itemPtr->labelX += ITEM_IPAD;
- }
- itemPtr->labelY = 1 + (maxHeight - itemPtr->labelHeight) / 2;
- y += maxHeight;
- count++;
- if ((count % nRows) == 0) {
- x += lastMaxWidth;
- y = 0;
- lastMaxWidth = 0;
- }
- }
- if (count > 0) {
- x += lastMaxWidth;
- }
- viewPtr->worldWidth = x;
- viewPtr->worldHeight = nRows * maxHeight;
-
- reqWidth = viewPtr->worldWidth + 2 * viewPtr->inset;
- reqHeight = viewPtr->worldHeight + 2 * viewPtr->inset;
-
- w = GetBoundedWidth(viewPtr, reqWidth);
- h = GetBoundedHeight(viewPtr, reqHeight);
-
- if ((w != Tk_ReqWidth(viewPtr->tkwin)) ||
- (h != Tk_ReqHeight(viewPtr->tkwin))) {
- Tk_GeometryRequest(viewPtr->tkwin, w, h);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeIconsLayout --
- *
- * Computes the layout of the widget with the items displayed multiple
- * columns. The current height of the widget is used as a basis for the
- * number of rows in a column.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComputeIconsLayout(ListView *viewPtr)
-{
- int x, y, w, h;
- int reqWidth, reqHeight;
- int maxHeight, maxWidth;
- int winWidth;
- int nRows, nColumns, nEntries;
- int count;
- Item *itemPtr;
-
- maxHeight = maxWidth = 0;
- nEntries = 0;
- for (itemPtr = FirstItem(viewPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- if (itemPtr->flags & ITEM_HIDE) {
- continue;
- }
- ComputeIconsItemGeometry(viewPtr, itemPtr);
- if (maxWidth < itemPtr->width) {
- maxWidth = itemPtr->width;
- }
- if (maxHeight < itemPtr->height) {
- maxHeight = itemPtr->height;
- }
- if (itemPtr->height > viewPtr->itemHeight) {
- viewPtr->itemHeight = itemPtr->height;
- }
- nEntries++;
- }
- if (nEntries == 0) {
- return;
- }
- winWidth = VPORTWIDTH(viewPtr);
- if (winWidth <= 1) {
- winWidth = Tk_ReqWidth(viewPtr->tkwin) - 2 * viewPtr->inset;
- }
- if ((viewPtr->maxWidth > 0) && (viewPtr->maxWidth < maxWidth)) {
- maxWidth = viewPtr->maxWidth;
- }
- nColumns = winWidth / maxWidth;
- if (nColumns <= 0) {
- nColumns = 1;
- }
- maxWidth = winWidth / nColumns;
- viewPtr->labelWidth = maxWidth - 6;
- nRows = nEntries / nColumns;
-
- /* Now compute the worldX positions */
- x = y = 0;
- count = 0;
- maxHeight = 0;
- for (itemPtr = FirstItem(viewPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- if (itemPtr->flags & ITEM_HIDE) {
- continue;
- }
- if (itemPtr->height > maxHeight) {
- maxHeight = itemPtr->height;
- }
- itemPtr->worldX = x;
- itemPtr->worldY = y;
- itemPtr->worldWidth = maxWidth;
- itemPtr->worldHeight = maxHeight;
- itemPtr->iconX = (maxWidth - itemPtr->iconWidth) / 2;
- itemPtr->iconY = 1;
- itemPtr->labelX = 1;
- if (maxWidth > itemPtr->labelWidth) {
- itemPtr->labelX = (maxWidth - itemPtr->labelWidth) / 2;
- }
- itemPtr->labelY = itemPtr->iconHeight;
- if ((itemPtr->labelHeight > 0) && (itemPtr->iconHeight > 0)) {
- /* itemPtr->labelY += ITEM_IPAD; */
- }
- x += maxWidth;
- count++;
- if ((count % nColumns) == 0) {
- y += maxHeight;
- viewPtr->worldHeight += maxHeight;
- maxHeight = 0;
- x = 0;
- }
- }
- if (count > 0) {
- x += maxWidth;
- viewPtr->worldHeight += maxHeight;
- }
- viewPtr->worldWidth = nColumns * maxWidth;
-
- reqWidth = viewPtr->worldWidth + 2 * viewPtr->inset;
- reqHeight = viewPtr->worldHeight + 2 * viewPtr->inset;
-
- w = GetBoundedWidth(viewPtr, reqWidth);
- h = GetBoundedHeight(viewPtr, reqHeight);
-
- if ((w != Tk_ReqWidth(viewPtr->tkwin)) ||
- (h != Tk_ReqHeight(viewPtr->tkwin))) {
- Tk_GeometryRequest(viewPtr->tkwin, w, h);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeLayout --
- *
- * Computes the layout of the widget with the items displayed multiple
- * columns. The current height of the widget is used as a basis for the
- * number of rows in a column.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComputeLayout(ListView *viewPtr)
-{
- int viewWidth, viewHeight;
-
- viewPtr->worldWidth = viewPtr->worldHeight = 0;
- viewPtr->iconWidth = viewPtr->labelWidth = 0;
- viewPtr->labelWidth = -1;
- viewPtr->itemHeight = 0;
- switch (viewPtr->layoutMode) {
- case LAYOUT_LIST_ROW:
- ComputeRowLayout(viewPtr);
- break;
- case LAYOUT_LIST_COLUMN:
- ComputeColumnLayout(viewPtr);
- break;
- case LAYOUT_ICONS:
- ComputeIconsLayout(viewPtr);
- break;
- case LAYOUT_TILES:
- fprintf(stderr, "layout not implemented\n");
- break;
- }
- viewWidth = VPORTWIDTH(viewPtr);
- if (viewPtr->xOffset > (viewPtr->worldWidth - viewWidth)) {
- viewPtr->xOffset = viewPtr->worldWidth - viewWidth;
- }
- if (viewPtr->xOffset < 0) {
- viewPtr->xOffset = 0;
- }
- viewHeight = VPORTHEIGHT(viewPtr);
- if (viewPtr->yOffset > (viewPtr->worldHeight - viewHeight)) {
- viewPtr->yOffset = viewPtr->worldHeight - viewHeight;
- }
- if (viewPtr->yOffset < 0) {
- viewPtr->yOffset = 0;
- }
- viewPtr->flags &= ~LAYOUT_PENDING;
- viewPtr->flags |= SCROLL_PENDING;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * SearchForItem --
- *
- * Performs a binary search for the item at the given y-offset in world
- * coordinates. The range of items is specified by menu indices (high
- * and low). The item must be (visible) in the viewport.
- *
- * Results:
- * Returns 0 if no item is found, other the index of the item (menu
- * indices start from 1).
- *
- *---------------------------------------------------------------------------
- */
-static Item *
-SearchForItem(ListView *viewPtr, int x, int y)
-{
- Item *itemPtr;
-
-
- for (itemPtr = FirstItem(viewPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- if (itemPtr->flags & ITEM_HIDE) {
- continue;
- }
- if ((x >= itemPtr->worldX) &&
- (x < (itemPtr->worldX+itemPtr->worldWidth)) &&
- (y >= itemPtr->worldY) &&
- (y < (itemPtr->worldY+itemPtr->worldHeight))) {
- return itemPtr;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NearestItem --
- *
- * Find the item closest to the x-y screen coordinate given. The item
- * must be (visible) in the viewport.
- *
- * Results:
- * Returns the closest item. If selectOne is set, then always returns an
- * item (unless the menu is empty). Otherwise, NULL is returned is the
- * pointer is not over an item.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Item *
-NearestItem(ListView *viewPtr, int x, int y, int selectOne)
-{
- Item *itemPtr;
-
- if ((x < 0) || (x >= Tk_Width(viewPtr->tkwin)) ||
- (y < 0) || (y >= Tk_Height(viewPtr->tkwin))) {
- return NULL; /* Screen coordinates are outside of
- * menu. */
- }
- /*
- * Item positions are saved in world coordinates. Convert the text point
- * screen y-coordinate to a world coordinate.
- */
- itemPtr = SearchForItem(viewPtr, WORLDX(viewPtr, x), WORLDY(viewPtr, y));
- if (itemPtr == NULL) {
- if (!selectOne) {
- return NULL;
- }
- if (y < viewPtr->inset) {
- return FirstItem(viewPtr);
- }
- return LastItem(viewPtr);
- }
- return itemPtr;
-}
-
-
-static void
-DestroyStyle(Style *stylePtr)
-{
- ListView *viewPtr;
-
- stylePtr->refCount--;
- if (stylePtr->refCount > 0) {
- return;
- }
- viewPtr = stylePtr->viewPtr;
- iconOption.clientData = viewPtr;
- Blt_FreeOptions(styleSpecs, (char *)stylePtr, viewPtr->display, 0);
- if (stylePtr->hPtr != NULL) {
- Blt_DeleteHashEntry(&stylePtr->viewPtr->styleTable, stylePtr->hPtr);
- }
- if (stylePtr != &stylePtr->viewPtr->defStyle) {
- Blt_Free(stylePtr);
- }
-
-}
-
-static Style *
-AddDefaultStyle(Tcl_Interp *interp, ListView *viewPtr)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- Style *stylePtr;
-
- hPtr = Blt_CreateHashEntry(&viewPtr->styleTable, "default", &isNew);
- if (!isNew) {
- Tcl_AppendResult(interp, "listview style \"", "default",
- "\" already exists.", (char *)NULL);
- return NULL;
- }
- stylePtr = &viewPtr->defStyle;
- assert(stylePtr);
- stylePtr->refCount = 1;
- stylePtr->name = Blt_GetHashKey(&viewPtr->styleTable, hPtr);
- stylePtr->hPtr = hPtr;
- stylePtr->viewPtr = viewPtr;
- stylePtr->borderWidth = 0;
- stylePtr->activeRelief = TK_RELIEF_FLAT;
- Blt_SetHashValue(hPtr, stylePtr);
- return TCL_OK;
-}
-
-static void
-DestroyStyles(ListView *viewPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&viewPtr->styleTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Style *stylePtr;
-
- stylePtr = Blt_GetHashValue(hPtr);
- stylePtr->hPtr = NULL;
- stylePtr->refCount = 0;
- DestroyStyle(stylePtr);
- }
- Blt_DeleteHashTable(&viewPtr->styleTable);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetStyleFromObj --
- *
- * Gets the style associated with the given name.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetStyleFromObj(Tcl_Interp *interp, ListView *viewPtr, Tcl_Obj *objPtr,
- Style **stylePtrPtr)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->styleTable, Tcl_GetString(objPtr));
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find style \"",
- Tcl_GetString(objPtr), "\" in listview \"",
- Tk_PathName(viewPtr->tkwin), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- *stylePtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetTag --
- *
- * Associates a tag with a given row. Individual row tags are
- * stored in hash tables keyed by the tag name. Each table is in
- * turn stored in a hash table keyed by the row location.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A tag is stored for a particular row.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SetTag(Tcl_Interp *interp, Item *itemPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tagTablePtr;
- ListView *viewPtr;
- int isNew;
- long dummy;
-
- if ((strcmp(tagName, "all") == 0) || (strcmp(tagName, "end") == 0)) {
- return TCL_OK; /* Don't need to create reserved
- * tags. */
- }
- if (tagName[0] == '\0') {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "tag \"", tagName, "\" can't be empty.",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (tagName[0] == '-') {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "tag \"", tagName,
- "\" can't start with a '-'.", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (Tcl_GetLong(NULL, (char *)tagName, &dummy) == TCL_OK) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "tag \"", tagName, "\" can't be a number.",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- viewPtr = itemPtr->viewPtr;
- hPtr = Blt_CreateHashEntry(&viewPtr->tagTable, tagName, &isNew);
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't add tag \"", tagName,
- "\": out of memory", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (isNew) {
- tagTablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(tagTablePtr, BLT_ONE_WORD_KEYS);
- Blt_SetHashValue(hPtr, tagTablePtr);
- } else {
- tagTablePtr = Blt_GetHashValue(hPtr);
- }
- hPtr = Blt_CreateHashEntry(tagTablePtr, (char *)itemPtr->index, &isNew);
- if (isNew) {
- Blt_SetHashValue(hPtr, itemPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTagTable --
- *
- * Returns the hash table containing row indices for a tag.
- *
- * Results:
- * Returns a pointer to the hash table containing indices for the
- * given tag. If the row has no tags, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_HashTable *
-GetTagTable(ListView *viewPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->tagTable, tagName);
- if (hPtr == NULL) {
- return NULL; /* No tag by that name. */
- }
- return Blt_GetHashValue(hPtr);
-}
-
-static int
-GetIconFromObj(Tcl_Interp *interp, ListView *viewPtr, Tcl_Obj *objPtr,
- Icon *iconPtr)
-{
- Blt_HashEntry *hPtr;
- struct _Icon *iPtr;
- int isNew;
- const char *iconName;
-
- iconName = Tcl_GetString(objPtr);
- if (iconName[0] == '\0') {
- *iconPtr = NULL;
- return TCL_OK;
- }
- hPtr = Blt_CreateHashEntry(&viewPtr->iconTable, iconName, &isNew);
- if (isNew) {
- Tk_Image tkImage;
- int w, h;
-
- tkImage = Tk_GetImage(interp, viewPtr->tkwin, (char *)iconName,
- IconChangedProc, viewPtr);
- if (tkImage == NULL) {
- Blt_DeleteHashEntry(&viewPtr->iconTable, hPtr);
- return TCL_ERROR;
- }
- Tk_SizeOfImage(tkImage, &w, &h);
- iPtr = Blt_AssertMalloc(sizeof(struct _Icon ));
- iPtr->tkImage = tkImage;
- iPtr->hPtr = hPtr;
- iPtr->refCount = 1;
- iPtr->width = w;
- iPtr->height = h;
- Blt_SetHashValue(hPtr, iPtr);
- } else {
- iPtr = Blt_GetHashValue(hPtr);
- iPtr->refCount++;
- }
- *iconPtr = iPtr;
- return TCL_OK;
-}
-
-static void
-FreeIcon(ListView *viewPtr, struct _Icon *iPtr)
-{
- iPtr->refCount--;
- if (iPtr->refCount == 0) {
- Blt_DeleteHashEntry(&viewPtr->iconTable, iPtr->hPtr);
- Tk_FreeImage(iPtr->tkImage);
- Blt_Free(iPtr);
- }
-}
-
-static void
-DestroyIcons(ListView *viewPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&viewPtr->iconTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Icon icon;
-
- icon = Blt_GetHashValue(hPtr);
- Tk_FreeImage(IconImage(icon));
- Blt_Free(icon);
- }
- Blt_DeleteHashTable(&viewPtr->iconTable);
-}
-
-static INLINE Item *
-FindItemByLabel(ListView *viewPtr, const char *label)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->labelTable, label);
- if (hPtr != NULL) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *h2Ptr;
- Blt_HashSearch iter;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FirstHashEntry(tablePtr, &iter);
- if (h2Ptr != NULL) {
- return Blt_GetHashValue(h2Ptr);
- }
- }
- return NULL;
-}
-
-static char *
-NewLabel(Item *itemPtr, const char *label)
-{
- Blt_HashEntry *hPtr, *h2Ptr;
- Blt_HashTable *tablePtr;
- int isNew;
- ListView *viewPtr;
-
- viewPtr = itemPtr->viewPtr;
- hPtr = Blt_CreateHashEntry(&viewPtr->labelTable, label, &isNew);
- if (isNew) {
- tablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(tablePtr, BLT_ONE_WORD_KEYS);
- Blt_SetHashValue(hPtr, tablePtr);
- } else {
- tablePtr = Blt_GetHashValue(hPtr);
- }
- h2Ptr = Blt_CreateHashEntry(tablePtr, (char *)itemPtr, &isNew);
- Blt_SetHashValue(h2Ptr, itemPtr);
- return Blt_GetHashKey(&viewPtr->labelTable, hPtr);
-}
-
-static void
-RemoveLabel(ListView *viewPtr, Item *itemPtr)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->labelTable, itemPtr->label);
- if (hPtr != NULL) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *h2Ptr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tablePtr, (char *)itemPtr);
- if (h2Ptr != NULL) {
- itemPtr->label = emptyString;
- Blt_DeleteHashEntry(tablePtr, h2Ptr);
- if (tablePtr->numEntries == 0) {
- Blt_DeleteHashEntry(&viewPtr->labelTable, hPtr);
- Blt_DeleteHashTable(tablePtr);
- Blt_Free(tablePtr);
- }
- }
- }
-}
-
-static void
-DestroyLabels(ListView *viewPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&viewPtr->labelTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(tablePtr);
- Blt_Free(tablePtr);
- }
- Blt_DeleteHashTable(&viewPtr->labelTable);
-}
-
-static void
-MoveItem(ListView *viewPtr, Item *itemPtr, int dir, Item *wherePtr)
-{
- if (Blt_Chain_GetLength(viewPtr->chain) == 1) {
- return; /* Can't rearrange one item. */
- }
- Blt_Chain_UnlinkLink(viewPtr->chain, itemPtr->link);
- switch(dir) {
- case 0: /* After */
- Blt_Chain_LinkAfter(viewPtr->chain, itemPtr->link, wherePtr->link);
- break;
- case 1: /* At */
- Blt_Chain_LinkAfter(viewPtr->chain, itemPtr->link, wherePtr->link);
- break;
- default:
- case 2: /* Before */
- Blt_Chain_LinkBefore(viewPtr->chain, itemPtr->link, wherePtr->link);
- break;
- }
- {
- long count;
-
- for (count = 0, itemPtr = FirstItem(viewPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr), count++) {
- itemPtr->index = count;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextTaggedItem --
- *
- * Returns the next item derived from the given tag.
- *
- * Results:
- * Returns the row location of the first item. If no more rows can be
- * found, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Item *
-NextTaggedItem(ItemIterator *iterPtr)
-{
- Item *itemPtr;
-
- switch (iterPtr->type) {
- case ITER_TAG:
- {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_NextHashEntry(&iterPtr->cursor);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- }
- break;
-
- case ITER_ALL:
- if (iterPtr->link != NULL) {
- itemPtr = Blt_Chain_GetValue(iterPtr->link);
- iterPtr->link = Blt_Chain_NextLink(iterPtr->link);
- return itemPtr;
- }
- break;
-
- case ITER_PATTERN:
- {
- Blt_ChainLink link;
-
- for (link = iterPtr->link; link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(iterPtr->link);
- if (Tcl_StringMatch(itemPtr->label, iterPtr->tagName)) {
- iterPtr->link = Blt_Chain_NextLink(link);
- return itemPtr;
- }
- }
- break;
- }
- default:
- break;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FirstTaggedItem --
- *
- * Returns the first item derived from the given tag.
- *
- * Results:
- * Returns the row location of the first item. If no more rows can be
- * found, then -1 is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Item *
-FirstTaggedItem(ItemIterator *iterPtr)
-{
- Item *itemPtr;
-
- switch (iterPtr->type) {
- case ITER_TAG:
- {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FirstHashEntry(iterPtr->tablePtr, &iterPtr->cursor);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
- }
- break;
-
- case ITER_ALL:
- if (iterPtr->link != NULL) {
- itemPtr = Blt_Chain_GetValue(iterPtr->link);
- iterPtr->link = Blt_Chain_NextLink(iterPtr->link);
- return itemPtr;
- }
- break;
-
- case ITER_PATTERN:
- {
- Blt_ChainLink link;
-
- for (link = iterPtr->link; link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(iterPtr->link);
- if (Tcl_StringMatch(itemPtr->label, iterPtr->tagName)) {
- iterPtr->link = Blt_Chain_NextLink(link);
- return itemPtr;
- }
- }
- }
- break;
-
- case ITER_SINGLE:
- itemPtr = iterPtr->startPtr;
- iterPtr->nextPtr = NextTaggedItem(iterPtr);
- return itemPtr;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetItemFromObj --
- *
- * Get the item associated the given index, tag, or label. This routine
- * is used when you want only one item. It's an error if more than one
- * item is specified (e.g. "all" tag). It's also an error if the tag is
- * empty (no items are currently tagged).
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetItemFromObj(Tcl_Interp *interp, ListView *viewPtr, Tcl_Obj *objPtr,
- Item **itemPtrPtr)
-{
- ItemIterator iter;
- Item *firstPtr;
-
- if (GetItemIterator(interp, viewPtr, objPtr, &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- firstPtr = FirstTaggedItem(&iter);
- if (firstPtr != NULL) {
- Item *nextPtr;
-
- nextPtr = NextTaggedItem(&iter);
- if (nextPtr != NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "multiple items specified by \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- }
- *itemPtrPtr = firstPtr;
- return TCL_OK;
-}
-
-static int
-GetItemByIndex(Tcl_Interp *interp, ListView *viewPtr, const char *string,
- int length, Item **itemPtrPtr)
-{
- Item *itemPtr;
- char c;
- long pos;
-
- itemPtr = NULL;
- c = string[0];
- if ((isdigit(c)) && (Tcl_GetLong(NULL, string, &pos) == TCL_OK)) {
- Blt_ChainLink link;
-
- link = Blt_Chain_GetNthLink(viewPtr->chain, pos);
- if (link != NULL) {
- itemPtr = Blt_Chain_GetValue(link);
- }
- if (itemPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find item: bad index \"",
- string, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- } else if ((c == 'n') && (strcmp(string, "next") == 0)) {
- itemPtr = NextItemAvailable(viewPtr->focusPtr);
- if (itemPtr == NULL) {
- itemPtr = viewPtr->focusPtr;
- }
- } else if ((c == 'p') && (strcmp(string, "previous") == 0)) {
- itemPtr = PrevItemAvailable(viewPtr->focusPtr);
- if (itemPtr == NULL) {
- itemPtr = viewPtr->focusPtr;
- }
- } else if ((c == 'e') && (strcmp(string, "end") == 0)) {
- itemPtr = LastItem(viewPtr);
- } else if ((c == 'f') && (strcmp(string, "first") == 0)) {
- itemPtr = FirstItem(viewPtr);
- } else if ((c == 'l') && (strcmp(string, "last") == 0)) {
- itemPtr = LastItem(viewPtr);
- } else if ((c == 'n') && (strcmp(string, "none") == 0)) {
- itemPtr = NULL;
- } else if ((c == 'a') && (strcmp(string, "active") == 0)) {
- itemPtr = viewPtr->activePtr;
- } else if ((c == 'f') && (strcmp(string, "focus") == 0)) {
- itemPtr = viewPtr->focusPtr;
- } else if (c == '@') {
- int x, y;
-
- if (Blt_GetXY(viewPtr->interp, viewPtr->tkwin, string, &x, &y)
- != TCL_OK) {
- return TCL_ERROR;
- }
- itemPtr = NearestItem(viewPtr, x, y, FALSE);
- } else {
- return TCL_CONTINUE;
- }
- *itemPtrPtr = itemPtr;
- return TCL_OK;
-}
-
-static Item *
-GetItemByLabel(ListView *viewPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->labelTable, string);
- if (hPtr != NULL) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *h2Ptr;
- Blt_HashSearch iter;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FirstHashEntry(tablePtr, &iter);
- if (h2Ptr != NULL) {
- return Blt_GetHashValue(h2Ptr);
- }
- }
- return NULL;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetItemIterator --
- *
- * Converts a string representing a item index into an item pointer. The
- * index may be in one of the following forms:
- *
- * number Item at index in the list of items.
- * @x,y Item closest to the specified X-Y screen coordinates.
- * "active" Item where mouse pointer is located.
- * "posted" Item is the currently posted cascade item.
- * "next" Next item from the focus item.
- * "previous" Previous item from the focus item.
- * "end" Last item.
- * "none" No item.
- *
- * number Item at position in the list of items.
- * @x,y Item closest to the specified X-Y screen coordinates.
- * "active" Item mouse is located over.
- * "focus" Item is the widget's focus.
- * "select" Currently selected item.
- * "right" Next item from the focus item.
- * "left" Previous item from the focus item.
- * "up" Next item from the focus item.
- * "down" Previous item from the focus item.
- * "end" Last item in list.
- * "index:number" Item at index number in list of items.
- * "tag:string" Item(s) tagged by "string".
- * "label:pattern" Item(s) with label matching "pattern".
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned. The
- * pointer to the node is returned via itemPtrPtr. Otherwise, TCL_ERROR
- * is returned and an error message is left in interpreter's result
- * field.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetItemIterator(Tcl_Interp *interp, ListView *viewPtr, Tcl_Obj *objPtr,
- ItemIterator *iterPtr)
-{
- Item *itemPtr, *startPtr, *endPtr;
- Blt_HashTable *tablePtr;
- char *string;
- char c;
- int nBytes;
- int length;
- int result;
-
- iterPtr->viewPtr = viewPtr;
- iterPtr->type = ITER_SINGLE;
- iterPtr->tagName = Tcl_GetStringFromObj(objPtr, &nBytes);
- iterPtr->nextPtr = NULL;
- iterPtr->startPtr = iterPtr->endPtr = NULL;
-
- if (viewPtr->flags & LAYOUT_PENDING) {
- ComputeLayout(viewPtr);
- }
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- iterPtr->startPtr = iterPtr->endPtr = viewPtr->activePtr;
- startPtr = endPtr = itemPtr = NULL;
- if (c == '\0') {
- startPtr = endPtr = NULL;
- }
- iterPtr->type = ITER_SINGLE;
- result = GetItemByIndex(interp, viewPtr, string, length, &itemPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (result == TCL_OK) {
- iterPtr->startPtr = iterPtr->endPtr = itemPtr;
- return TCL_OK;
- }
- if ((c == 'a') && (strcmp(iterPtr->tagName, "all") == 0)) {
- iterPtr->type = ITER_ALL;
- iterPtr->link = Blt_Chain_FirstLink(viewPtr->chain);
- } else if ((c == 'i') && (length > 6) &&
- (strncmp(string, "index:", 6) == 0)) {
- if (GetItemByIndex(interp, viewPtr, string + 6, length - 6, &itemPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- iterPtr->startPtr = iterPtr->endPtr = itemPtr;
- } else if ((c == 't') && (length > 4) &&
- (strncmp(string, "tag:", 4) == 0)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = GetTagTable(viewPtr, string + 4);
- if (tablePtr == NULL) {
- Tcl_AppendResult(interp, "can't find a tag \"", string + 5,
- "\" in \"", Tk_PathName(viewPtr->tkwin), "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- iterPtr->tagName = string + 4;
- iterPtr->tablePtr = tablePtr;
- iterPtr->type = ITER_TAG;
- } else if ((c == 'l') && (length > 6) &&
- (strncmp(string, "label:", 6) == 0)) {
- iterPtr->link = Blt_Chain_FirstLink(viewPtr->chain);
- iterPtr->tagName = string + 6;
- iterPtr->type = ITER_PATTERN;
- } else if ((itemPtr = GetItemByLabel(viewPtr, string)) != NULL) {
- iterPtr->startPtr = iterPtr->endPtr = itemPtr;
- } else if ((tablePtr = GetTagTable(viewPtr, string)) != NULL) {
- iterPtr->tagName = string;
- iterPtr->tablePtr = tablePtr;
- iterPtr->type = ITER_TAG;
- } else {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find item index, label, or tag \"",
- string, "\" in \"", Tk_PathName(viewPtr->tkwin), "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-ConfigureItem(Tcl_Interp *interp, Item *itemPtr, int objc, Tcl_Obj *const *objv,
- int flags)
-{
- ListView *viewPtr;
-
- viewPtr = itemPtr->viewPtr;
- iconOption.clientData = viewPtr;
- if (Blt_ConfigureWidgetFromObj(interp, viewPtr->tkwin, itemSpecs,
- objc, objv, (char *)itemPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- viewPtr->flags |= LAYOUT_PENDING;
- return TCL_OK;
-}
-
-static int
-ConfigureStyle(Tcl_Interp *interp, Style *stylePtr, int objc,
- Tcl_Obj *const *objv, int flags)
-{
- ListView *viewPtr = stylePtr->viewPtr;
-
- if (Blt_ConfigureWidgetFromObj(interp, viewPtr->tkwin, styleSpecs,
- objc, objv, (char *)stylePtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-ConfigureListView(Tcl_Interp *interp, ListView *viewPtr, int objc,
- Tcl_Obj *const *objv, int flags)
-{
- unsigned int gcMask;
- XGCValues gcValues;
- GC newGC;
-
- if (Blt_ConfigureWidgetFromObj(interp, viewPtr->tkwin, listViewSpecs,
- objc, objv, (char *)viewPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- if (ConfigureStyle(interp, &viewPtr->defStyle, 0, NULL,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- viewPtr->inset = viewPtr->borderWidth + viewPtr->highlightWidth;
-
- /* Focus rectangle */
- gcMask = GCForeground | GCLineWidth | GCLineStyle | GCDashList;
- gcValues.line_width = 0;
- gcValues.foreground = viewPtr->focusColor->pixel;
- gcValues.line_style = LineOnOffDash;
- gcValues.dashes = 1;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (viewPtr->focusGC != NULL) {
- Tk_FreeGC(viewPtr->display, viewPtr->focusGC);
- }
- viewPtr->focusGC = newGC;
-
- return TCL_OK;
-}
-
-/* Widget Callbacks */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListViewEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * listview widgets.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ListViewEventProc(ClientData clientData, XEvent *eventPtr)
-{
- ListView *viewPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(viewPtr);
- }
- } else if (eventPtr->type == UnmapNotify) {
- EventuallyRedraw(viewPtr);
- } else if (eventPtr->type == ConfigureNotify) {
- viewPtr->flags |= (SCROLL_PENDING | LAYOUT_PENDING);
- EventuallyRedraw(viewPtr);
- } else if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
- if (eventPtr->xfocus.detail == NotifyInferior) {
- return;
- }
- if (eventPtr->type == FocusIn) {
- viewPtr->flags |= FOCUS;
- } else {
- viewPtr->flags &= ~FOCUS;
- }
- EventuallyRedraw(viewPtr);
- } else if (eventPtr->type == DestroyNotify) {
- if (viewPtr->tkwin != NULL) {
- viewPtr->tkwin = NULL;
- }
- if (viewPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayListView, viewPtr);
- }
- Tcl_EventuallyFree(viewPtr, DestroyListView);
- }
-}
-
-/*ARGSUSED*/
-static void
-FreeStyleProc(ClientData clientData, Display *display, char *widgRec,
- int offset)
-{
- Style *stylePtr = *(Style **)(widgRec + offset);
-
- if ((stylePtr != NULL) && (stylePtr != &stylePtr->viewPtr->defStyle)) {
- DestroyStyle(stylePtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToStyleProc --
- *
- * Convert the string representation of a color into a XColor pointer.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToStyleProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ListView *viewPtr;
- Item *itemPtr = (Item *)widgRec;
- Style **stylePtrPtr = (Style **)(widgRec + offset);
- Style *stylePtr;
- char *string;
-
- string = Tcl_GetString(objPtr);
- viewPtr = itemPtr->viewPtr;
- if ((string[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- stylePtr = NULL;
- } else if (GetStyleFromObj(interp, viewPtr, objPtr, &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Release the old style. */
- if ((*stylePtrPtr != NULL) && (*stylePtrPtr != &viewPtr->defStyle)) {
- DestroyStyle(*stylePtrPtr);
- }
- stylePtr->refCount++;
- *stylePtrPtr = stylePtr;
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-StyleToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Style *stylePtr = *(Style **)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (stylePtr == NULL) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- objPtr = Tcl_NewStringObj(stylePtr->name, -1);
- }
- return objPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToRestrictProc --
- *
- * Convert the string representation of an item state into a flag.
- *
- * Results:
- * The return value is a standard TCL result. The state flags are
- * updated.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToRestrictProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing state. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int *flagsPtr = (unsigned int *)(widgRec + offset);
- char *string;
- int flag;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "min") == 0) {
- flag = RESTRICT_MIN;
- } else if (strcmp(string, "max") == 0) {
- flag = RESTRICT_MAX;
- } else if (strcmp(string, "both") == 0) {
- flag = RESTRICT_MIN|RESTRICT_MAX;
- } else if (strcmp(string, "none") == 0) {
- flag = 0;
- } else {
- Tcl_AppendResult(interp, "unknown state \"", string,
- "\": should be active, disabled, or normal.", (char *)NULL);
- return TCL_ERROR;
- }
- *flagsPtr &= ~(RESTRICT_MIN|RESTRICT_MAX);
- *flagsPtr |= flag;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RestrictToObjProc --
- *
- * Return the string representation of the restrict flags.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-RestrictToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int *flagsPtr = (unsigned int *)(widgRec + offset);
- int restrict;
- const char *string;
-
- restrict = *flagsPtr & (RESTRICT_MIN|RESTRICT_MAX);
- switch (restrict) {
- case RESTRICT_MIN: string = "min"; break;
- case RESTRICT_MAX: string = "max"; break;
- case RESTRICT_NONE: string = "none"; break;
- case (RESTRICT_MIN|RESTRICT_MAX):
- string = "both"; break;
- }
- return Tcl_NewStringObj(string, -1);
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToStateProc --
- *
- * Convert the string representation of an item state into a flag.
- *
- * Results:
- * The return value is a standard TCL result. The state flags are
- * updated.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToStateProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing state. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Item *itemPtr = (Item *)(widgRec);
- unsigned int *flagsPtr = (unsigned int *)(widgRec + offset);
- char *string;
- ListView *viewPtr;
- int flag;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "disabled") == 0) {
- flag = ITEM_DISABLED;
- } else if (strcmp(string, "normal") == 0) {
- flag = ITEM_NORMAL;
- } else {
- Tcl_AppendResult(interp, "unknown state \"", string,
- "\": should be active, disabled, or normal.", (char *)NULL);
- return TCL_ERROR;
- }
- if (itemPtr->flags & flag) {
- return TCL_OK; /* State is already set to value. */
- }
- viewPtr = itemPtr->viewPtr;
- if (viewPtr->activePtr != itemPtr) {
- ActivateItem(viewPtr, NULL);
- viewPtr->activePtr = NULL;
- }
- *flagsPtr &= ~ITEM_STATE_MASK;
- *flagsPtr |= flag;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StateToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-StateToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int state = *(unsigned int *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (state & ITEM_NORMAL) {
- objPtr = Tcl_NewStringObj("normal", -1);
- } else if (state & ITEM_DISABLED) {
- objPtr = Tcl_NewStringObj("disabled", -1);
- } else {
- objPtr = Tcl_NewStringObj("???", -1);
- }
- return objPtr;
-}
-
-
-/*ARGSUSED*/
-static void
-FreeTagsProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- ListView *viewPtr;
- Item *itemPtr = (Item *)widgRec;
-
- viewPtr = itemPtr->viewPtr;
- ReleaseTags(viewPtr, itemPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToTagsProc --
- *
- * Convert the string representation of a list of tags.
- *
- * Results:
- * The return value is a standard TCL result. The tags are
- * save in the widget.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTagsProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- ListView *viewPtr;
- Item *itemPtr = (Item *)widgRec;
- int i;
- char *string;
- int objc;
- Tcl_Obj **objv;
-
- viewPtr = itemPtr->viewPtr;
- ReleaseTags(viewPtr, itemPtr);
- string = Tcl_GetString(objPtr);
- if ((string[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- return TCL_OK;
- }
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 0; i < objc; i++) {
- SetTag(interp, itemPtr, Tcl_GetString(objv[i]));
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagsToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TagsToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- ListView *viewPtr;
- Item *itemPtr = (Item *)widgRec;
- Tcl_Obj *listObjPtr;
-
- viewPtr = itemPtr->viewPtr;
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&viewPtr->tagTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tagTablePtr;
- Blt_HashEntry *h2Ptr;
-
- tagTablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tagTablePtr, (char *)itemPtr->index);
- if (h2Ptr != NULL) {
- Tcl_Obj *objPtr;
- const char *name;
-
- name = Tcl_GetHashKey(&viewPtr->tagTable, hPtr);
- objPtr = Tcl_NewStringObj(name, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- return listObjPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconChangedProc
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-IconChangedProc(
- ClientData clientData,
- int x, int y, int w, int h, /* Not used. */
- int imageWidth, int imageHeight) /* Not used. */
-{
- ListView *viewPtr = clientData;
-
- viewPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(viewPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToIconProc --
- *
- * Convert a image into a hashed icon.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToIconProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- ListView *viewPtr = clientData;
- Icon *iconPtr = (Icon *)(widgRec + offset);
- Icon icon;
-
- if (GetIconFromObj(interp, viewPtr, objPtr, &icon) != TCL_OK) {
- return TCL_ERROR;
- }
- if (*iconPtr != NULL) {
- FreeIcon(viewPtr, *iconPtr);
- }
- *iconPtr = icon;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconToObjProc --
- *
- * Converts the icon into its string representation (its name).
- *
- * Results:
- * The name of the icon is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-IconToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Icon icon = *(Icon *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (icon == NULL) {
- objPtr = Tcl_NewStringObj("", 0);
- } else {
- objPtr =Tcl_NewStringObj(Blt_Image_Name(IconImage(icon)), -1);
- }
- return objPtr;
-}
-
-/*ARGSUSED*/
-static void
-FreeIconProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Icon *iconPtr = (Icon *)(widgRec + offset);
-
- if (*iconPtr != NULL) {
- ListView *viewPtr = clientData;
-
- FreeIcon(viewPtr, *iconPtr);
- *iconPtr = NULL;
- }
-}
-
-/*ARGSUSED*/
-static void
-FreeLabelProc(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Item *itemPtr = (Item *)widgRec;
-
- if (itemPtr->label != emptyString) {
- RemoveLabel(itemPtr->viewPtr, itemPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToLabelProc --
- *
- * Save the label and add the item to the label hashtable.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToLabelProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Item *itemPtr = (Item *)(widgRec);
- char *string;
-
- if (itemPtr->label != emptyString) {
- RemoveLabel(itemPtr->viewPtr, itemPtr);
- }
- string = Tcl_GetString(objPtr);
- if ((string[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- return TCL_OK;
- }
- itemPtr->label = NewLabel(itemPtr, string);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LabelToObjProc --
- *
- * Return the label of the item.
- *
- * Results:
- * The label is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-LabelToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Item *itemPtr = (Item *)(widgRec);
- Tcl_Obj *objPtr;
-
- if (itemPtr->label == emptyString) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- objPtr = Tcl_NewStringObj(itemPtr->label, -1);
- }
- return objPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ItemSwitch --
- *
- * Convert a string representing an item into its pointer.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ItemSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Item **itemPtrPtr = (Item **)(record + offset);
- ListView *viewPtr = clientData;
- Item *itemPtr;
-
- if (GetItemFromObj(interp, viewPtr, objPtr, &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- *itemPtrPtr = itemPtr;
- return TCL_OK;
-}
-
-
-/* Widget Operations */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm activate item
- *
- *---------------------------------------------------------------------------
- */
-static int
-ActivateOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
-
- if (GetItemFromObj(NULL, viewPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (viewPtr->activePtr == itemPtr) {
- return TCL_OK; /* Item is already active. */
- }
- ActivateItem(viewPtr, NULL);
- viewPtr->activePtr = NULL;
- if ((itemPtr != NULL) && ((itemPtr->flags & (ITEM_DISABLED|ITEM_HIDE))==0)){
- ActivateItem(viewPtr, itemPtr);
- viewPtr->activePtr = itemPtr;
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * AddOp --
- *
- * Appends a new item to the listview.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The listview entry may become selected or deselected.
- *
- * .cm add -text "fred" -tags ""
- *
- *---------------------------------------------------------------------------
- */
-static int
-AddOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Item *itemPtr;
-
- itemPtr = NewItem(viewPtr);
- if (ConfigureItem(interp, itemPtr, objc - 2, objv + 2, 0) != TCL_OK) {
- DestroyItem(itemPtr);
- return TCL_ERROR; /* Error configuring the entry. */
- }
- if (viewPtr->flags & SORT_AUTO) {
- viewPtr->flags |= SORT_PENDING;
- }
- viewPtr->flags |= LAYOUT_PENDING;
- viewPtr->flags &= ~SORTED;
- EventuallyRedraw(viewPtr);
- Tcl_SetLongObj(Tcl_GetObjResult(interp), itemPtr->index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AddListOp --
- *
- * Appends a list of items to the listview.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * New items are added to the listview.
- *
- * .cm add labelList -text "fred" -tags ""
- *
- *---------------------------------------------------------------------------
- */
-static int
-AddListOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int i;
- int iobjc;
- Tcl_Obj **iobjv;
- Tcl_Obj *listObjPtr;
-
- if (Tcl_ListObjGetElements(interp, objv[2], &iobjc, &iobjv) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (i = 0; i < iobjc; i++) {
- Tcl_Obj *objPtr;
- Item *itemPtr;
-
- itemPtr = NewItem(viewPtr);
- if (ConfigureItem(interp, itemPtr, objc - 3, objv + 3, 0) != TCL_OK) {
- DestroyItem(itemPtr);
- return TCL_ERROR;
- }
- itemPtr->label = NewLabel(itemPtr, Tcl_GetString(iobjv[i]));
- objPtr = Tcl_NewLongObj(itemPtr->index);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- if (viewPtr->flags & SORT_AUTO) {
- viewPtr->flags |= SORT_PENDING;
- }
- viewPtr->flags |= LAYOUT_PENDING;
- viewPtr->flags &= ~SORTED;
- EventuallyRedraw(viewPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm configure ?option value?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int result;
-
- iconOption.clientData = viewPtr;
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin, listViewSpecs,
- (char *)viewPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin, listViewSpecs,
- (char *)viewPtr, objv[2], 0);
- }
- Tcl_Preserve(viewPtr);
- result = ConfigureListView(interp, viewPtr, objc - 2, objv + 2,
- BLT_CONFIG_OBJV_ONLY);
- Tcl_Release(viewPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- viewPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm cget option
- *
- *---------------------------------------------------------------------------
- */
-static int
-CgetOp(
- ListView *viewPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- iconOption.clientData = viewPtr;
- return Blt_ConfigureValueFromObj(interp, viewPtr->tkwin, listViewSpecs,
- (char *)viewPtr, objv[2], 0);
-}
-
-/*ARGSUSED*/
-static int
-CurselectionOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (viewPtr->flags & SELECT_ORDERED) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(viewPtr->selected); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
- Tcl_Obj *objPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- objPtr = Tcl_NewLongObj(itemPtr->index);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- } else {
- Item *itemPtr;
-
- for (itemPtr = FirstItem(viewPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- if (ItemIsSelected(viewPtr, itemPtr)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewLongObj(itemPtr->index);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm delete item...
- *
- *---------------------------------------------------------------------------
- */
-static int
-DeleteOp(
- ListView *viewPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 2; i < objc; i++) {
- ItemIterator iter;
- Item *itemPtr, *nextPtr;
-
- if (GetItemIterator(interp, viewPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (itemPtr = FirstTaggedItem(&iter); itemPtr != NULL;
- itemPtr = nextPtr) {
- nextPtr = NextTaggedItem(&iter);
- DestroyItem(itemPtr);
- }
- }
- EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExistsOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm exists item
- *
- *---------------------------------------------------------------------------
- */
-static int
-ExistsOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- int bool;
-
- bool = FALSE;
- if (GetItemFromObj(NULL, viewPtr, objv[2], &itemPtr) == TCL_OK) {
- if (itemPtr != NULL) {
- bool = TRUE;
- }
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindOp --
- *
- * Search for an item according to the string given.
- *
- * Results:
- * The index of the found item is returned. If no item is found
- * -1 is returned.
- *
- * .cm find string -from active -previous -all -count 1
- * .cm find pattern \
- * -type glob|regexp|exact \
- * -from item -to item \
- * -previous -wrap \
- * -count 1
- *
- *---------------------------------------------------------------------------
- */
-static int
-FindOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- FindSwitches switches;
- Tcl_Obj *listObjPtr;
- const char *pattern;
- long count;
-
- /* Process switches */
- pattern = Tcl_GetString(objv[2]);
- itemSwitch.clientData = viewPtr;
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, findSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (switches.fromPtr == NULL) {
- switches.fromPtr = FirstItem(viewPtr);
- }
- if (switches.toPtr == NULL) {
- switches.toPtr = LastItem(viewPtr);
- }
- if ((switches.fromPtr->index > switches.toPtr->index) &&
- ((switches.flags & FIND_REVERSE) == 0)) {
- switches.flags |= FIND_WRAP;
- }
- if ((switches.fromPtr->index < switches.toPtr->index) &&
- (switches.flags & FIND_REVERSE)) {
- switches.flags |= FIND_WRAP;
- }
- count = 0;
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (switches.flags & FIND_REVERSE) {
- Item *itemPtr, *prevPtr;
-
- for (itemPtr = switches.fromPtr; itemPtr != NULL; itemPtr = prevPtr) {
- int found;
-
- prevPtr = PrevItem(itemPtr);
- if ((prevPtr == NULL) && (switches.flags & FIND_WRAP)) {
- itemPtr = LastItem(viewPtr);
- }
- if ((itemPtr->flags & ITEM_HIDE) &&
- ((switches.flags & FIND_HIDDEN) == 0)) {
- continue;
- }
- if ((itemPtr->flags & ITEM_DISABLED) &&
- ((switches.flags & FIND_DISABLED) == 0)) {
- continue;
- }
- if (switches.flags & FIND_EXACT) {
- found = (strcmp(itemPtr->label, pattern) == 0);
- } else if (switches.flags & FIND_REGEXP) {
- found = Tcl_RegExpMatch(NULL, itemPtr->label, pattern);
- } else {
- found = Tcl_StringMatch(itemPtr->label, pattern);
- }
- if (found) {
- count++;
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewLongObj(itemPtr->index));
- if (switches.count == count) {
- break;
- }
- }
- if ((itemPtr == switches.toPtr) &&
- ((switches.flags & FIND_WRAP) == 0)) {
- break;
- }
- if (prevPtr == switches.fromPtr) {
- break;
- }
- }
- } else {
- Item *itemPtr, *nextPtr;
-
- for (itemPtr = switches.fromPtr; itemPtr != NULL; itemPtr = nextPtr) {
- int found;
-
- nextPtr = NextItem(itemPtr);
- if ((nextPtr == NULL) && (switches.flags & FIND_WRAP)) {
- nextPtr = FirstItem(viewPtr);
- }
- if ((itemPtr->flags & ITEM_HIDE) &&
- ((switches.flags & FIND_HIDDEN) == 0)) {
- continue;
- }
- if ((itemPtr->flags & ITEM_DISABLED) &&
- ((switches.flags & FIND_DISABLED) == 0)) {
- continue;
- }
- if (switches.flags & FIND_EXACT) {
- found = (strcmp(itemPtr->label, pattern) == 0);
- } else if (switches.flags & FIND_REGEXP) {
- found = Tcl_RegExpMatch(NULL, itemPtr->label, pattern);
- } else {
- found = Tcl_StringMatch(itemPtr->label, pattern);
- }
- if (found) {
- count++;
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewLongObj(itemPtr->index));
- if (switches.count == count) {
- break;
- }
- }
- if ((itemPtr == switches.toPtr) &&
- ((switches.flags & FIND_WRAP) == 0)) {
- break;
- }
- if (nextPtr == switches.fromPtr) {
- break;
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FocusOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm index item
- *
- *---------------------------------------------------------------------------
- */
-static int
-FocusOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- int index;
-
- index = -1;
- if (GetItemFromObj(NULL, viewPtr, objv[2], &itemPtr) == TCL_OK) {
- viewPtr->focusPtr = itemPtr;
- if (itemPtr != NULL) {
- index = itemPtr->index;
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm index item
- *
- *---------------------------------------------------------------------------
- */
-static int
-IndexOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- int index;
-
- index = -1;
- if (GetItemFromObj(NULL, viewPtr, objv[2], &itemPtr) == TCL_OK) {
- if (itemPtr != NULL) {
- index = itemPtr->index;
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InvokeOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm invoke item
- *
- *---------------------------------------------------------------------------
- */
-static int
-InvokeOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int result;
- Item *itemPtr;
-
- if (GetItemFromObj(interp, viewPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((itemPtr == NULL) || (itemPtr->flags & ITEM_DISABLED)) {
- return TCL_OK; /* Item is currently disabled. */
- }
- Tcl_Preserve(itemPtr);
- SelectItem(viewPtr, itemPtr);
- /*
- * We check nItems in addition to whether the item has a command because
- * that goes to zero if the listview is deleted (e.g., during command
- * evaluation).
- */
- if ((Blt_Chain_GetLength(viewPtr->chain) > 0) &&
- (itemPtr->cmdObjPtr != NULL)) {
- Tcl_IncrRefCount(itemPtr->cmdObjPtr);
- result = Tcl_EvalObjEx(interp, itemPtr->cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(itemPtr->cmdObjPtr);
- }
- Tcl_Release(itemPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InsertOp --
- *
- * Inserts a new item into the listview at the given index.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The listview gets a new item.
- *
- * .cm insert before 0 after 1 -text label
- *
- *---------------------------------------------------------------------------
- */
-static int
-InsertOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr, *wherePtr;
- int dir;
- static const char *dirs[] = { "after", "at", "before" , NULL};
-
- if (Tcl_GetIndexFromObj(interp, objv[2], dirs, "key", 0, &dir) != TCL_OK) {
- return TCL_ERROR;
- }
- if (GetItemFromObj(interp, viewPtr, objv[3], &wherePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (wherePtr == NULL) {
- Tcl_AppendResult(interp, "can't insert item: no index \"",
- Tcl_GetString(objv[3]), "\"", (char *)NULL);
- return TCL_ERROR; /* No item. */
- }
- itemPtr = NewItem(viewPtr);
- if (ConfigureItem(interp, itemPtr, objc - 4, objv + 4, 0) != TCL_OK) {
- DestroyItem(itemPtr);
- return TCL_ERROR; /* Error configuring the entry. */
- }
- MoveItem(viewPtr, itemPtr, dir, wherePtr);
- if (viewPtr->flags & SORT_AUTO) {
- viewPtr->flags |= SORT_PENDING;
- }
- viewPtr->flags |= LAYOUT_PENDING;
- viewPtr->flags &= ~SORTED;
- EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ItemConfigureOp --
- *
- * This procedure handles item operations.
- *
- * Results:
- * A standard TCL result.
- *
- * .cm item configure item ?option value?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ItemConfigureOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- ItemIterator iter;
-
- if (GetItemIterator(interp, viewPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- iconOption.clientData = viewPtr;
- for (itemPtr = FirstTaggedItem(&iter); itemPtr != NULL;
- itemPtr = NextTaggedItem(&iter)) {
- int result;
- unsigned int flags;
-
- flags = BLT_CONFIG_OBJV_ONLY;
- if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin, itemSpecs,
- (char *)itemPtr, (Tcl_Obj *)NULL, flags);
- } else if (objc == 5) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin, itemSpecs,
- (char *)itemPtr, objv[4], flags);
- }
- Tcl_Preserve(itemPtr);
- result = ConfigureItem(interp, itemPtr, objc - 4, objv + 4, flags);
- Tcl_Release(itemPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- }
- viewPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ItemCgetOp --
- *
- * This procedure handles item operations.
- *
- * Results:
- * A standard TCL result.
- *
- * .cm item cget item option
- *
- *---------------------------------------------------------------------------
- */
-static int
-ItemCgetOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
-
- if (GetItemFromObj(interp, viewPtr, objv[3], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- Tcl_AppendResult(interp, "can't retrieve item \"",
- Tcl_GetString(objv[3]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- iconOption.clientData = viewPtr;
- return Blt_ConfigureValueFromObj(interp, viewPtr->tkwin, itemSpecs,
- (char *)itemPtr, objv[4], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ItemOp --
- *
- * This procedure handles item operations.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec itemOps[] = {
- {"cget", 2, ItemCgetOp, 5, 5, "item option",},
- {"configure", 2, ItemConfigureOp, 4, 0, "item ?option value?...",},
-};
-
-static int nItemOps = sizeof(itemOps) / sizeof(Blt_OpSpec);
-
-static int
-ItemOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- ListViewCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nItemOps, itemOps, BLT_OP_ARG2, objc, objv,
- 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (viewPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * .cm names pattern...
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NamesOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- int i;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (i = 2; i < objc; i++) {
- const char *pattern;
- Item *itemPtr;
-
- pattern = Tcl_GetString(objv[i]);
- for (itemPtr = FirstItem(viewPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- if (Tcl_StringMatch(itemPtr->label, pattern)) {
- Tcl_Obj *objPtr;
-
- if (itemPtr->label == emptyString) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- objPtr = Tcl_NewStringObj(itemPtr->label, -1);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-NearestOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int x, y;
- int wx, wy;
- Item *itemPtr;
- int isRoot;
- char *string;
-
- isRoot = FALSE;
- string = Tcl_GetString(objv[2]);
- if (strcmp("-root", string) == 0) {
- isRoot = TRUE;
- objv++, objc--;
- }
- if (objc < 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ", Tcl_GetString(objv[1]),
- " ?-root? x y\"", (char *)NULL);
- return TCL_ERROR;
-
- }
- if ((Tk_GetPixelsFromObj(interp, viewPtr->tkwin, objv[2], &x) != TCL_OK) ||
- (Tk_GetPixelsFromObj(interp, viewPtr->tkwin, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (isRoot) {
- int rootX, rootY;
-
- Tk_GetRootCoords(viewPtr->tkwin, &rootX, &rootY);
- x -= rootX;
- y -= rootY;
- }
- itemPtr = NearestItem(viewPtr, x, y, TRUE);
- if (itemPtr == NULL) {
- return TCL_OK;
- }
- x = WORLDX(viewPtr, x);
- y = WORLDY(viewPtr, y);
- wx = itemPtr->worldX + ITEM_XPAD;
- wy = itemPtr->worldY + ITEM_XPAD;
- if (objc > 4) {
- const char *where;
-
- where = "";
- if (itemPtr->icon != NULL) {
- int ix, iy, iw, ih;
-
- ih = IconHeight(itemPtr->icon);
- iw = IconWidth(itemPtr->icon);
- ix = wx;
- iy = wy;
- wx += viewPtr->iconWidth;
- if ((x >= ix) && (x <= (ix + iw)) && (y >= iy) && (y < (iy + ih))) {
- where = "icon";
- goto done;
- }
- }
- if ((itemPtr->label != emptyString) || (itemPtr->image != NULL)) {
- int lx, ly;
-
- lx = wx;
- ly = wy;
-
- wx += itemPtr->labelWidth + ITEM_IPAD;
- if ((x >= lx) && (x < (lx + itemPtr->labelWidth)) &&
- (y >= ly) && (y < (ly + itemPtr->labelHeight))) {
- where = "label";
- goto done;
- }
- }
- done:
- if (Tcl_SetVar(interp, Tcl_GetString(objv[4]), where,
- TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), itemPtr->index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm next item
- *
- *---------------------------------------------------------------------------
- */
-static int
-NextOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- int index;
-
- index = -1;
- if (GetItemFromObj(NULL, viewPtr, objv[2], &itemPtr) == TCL_OK) {
- for (itemPtr = NextItem(itemPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- if ((itemPtr->flags & (ITEM_HIDE|ITEM_DISABLED)) == 0) {
- break;
- }
- }
- if (itemPtr != NULL) {
- index = itemPtr->index;
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PreviousOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm previous item
- *
- *---------------------------------------------------------------------------
- */
-static int
-PreviousOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- int index;
-
- index = -1;
- if (GetItemFromObj(NULL, viewPtr, objv[2], &itemPtr) == TCL_OK) {
- for (itemPtr = PrevItem(itemPtr); itemPtr != NULL;
- itemPtr = PrevItem(itemPtr)) {
- if ((itemPtr->flags & (ITEM_HIDE|ITEM_DISABLED)) == 0) {
- break;
- }
- }
- if (itemPtr != NULL) {
- index = itemPtr->index;
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScanOp --
- *
- * Implements the quick scan.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ScanOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int oper;
- int x, y;
-
-#define SCAN_MARK 1
-#define SCAN_DRAGTO 2
- {
- char *string;
- char c;
- int length;
-
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- if ((c == 'm') && (strncmp(string, "mark", length) == 0)) {
- oper = SCAN_MARK;
- } else if ((c == 'd') && (strncmp(string, "dragto", length) == 0)) {
- oper = SCAN_DRAGTO;
- } else {
- Tcl_AppendResult(interp, "bad scan operation \"", string,
- "\": should be either \"mark\" or \"dragto\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if ((Blt_GetPixelsFromObj(interp, viewPtr->tkwin, objv[3], PIXELS_ANY, &x)
- != TCL_OK) ||
- (Blt_GetPixelsFromObj(interp, viewPtr->tkwin, objv[4], PIXELS_ANY, &y)
- != TCL_OK)) {
- return TCL_ERROR;
- }
- if (oper == SCAN_MARK) {
- viewPtr->scanAnchorX = x;
- viewPtr->scanAnchorY = y;
- viewPtr->scanX = viewPtr->xOffset;
- viewPtr->scanY = viewPtr->yOffset;
- } else {
- int xWorld, yWorld;
- int viewWidth, viewHeight;
- int dx, dy;
-
- dx = viewPtr->scanAnchorX - x;
- dy = viewPtr->scanAnchorY - y;
- xWorld = viewPtr->scanX + (10 * dx);
- yWorld = viewPtr->scanY + (10 * dy);
-
- viewWidth = VPORTWIDTH(viewPtr);
- if (xWorld > (viewPtr->worldWidth - viewWidth)) {
- xWorld = viewPtr->worldWidth - viewWidth;
- }
- if (xWorld < 0) {
- xWorld = 0;
- }
- viewHeight = VPORTHEIGHT(viewPtr);
- if (yWorld > (viewPtr->worldHeight - viewHeight)) {
- yWorld = viewPtr->worldHeight - viewHeight;
- }
- if (yWorld < 0) {
- yWorld = 0;
- }
- viewPtr->xOffset = xWorld;
- viewPtr->yOffset = yWorld;
- viewPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(viewPtr);
- }
- return TCL_OK;
-}
-
-
-/*ARGSUSED*/
-static int
-SeeOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- int x, y, width, height;
- int left, right, top, bottom;
- int maxWidth;
-
- if (GetItemFromObj(interp, viewPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- return TCL_OK;
- }
- if (itemPtr->flags & ITEM_HIDE) {
- return TCL_OK;
- }
- width = VPORTWIDTH(viewPtr);
- height = VPORTHEIGHT(viewPtr);
- x = viewPtr->xOffset;
- y = viewPtr->yOffset;
-
- /*
- * XVIEW: If the entry is left or right of the current view, adjust
- * the offset. If the entry is nearby, adjust the view just
- * a bit. Otherwise, center the entry.
- */
- left = viewPtr->xOffset;
- right = viewPtr->xOffset + width;
- top = viewPtr->yOffset;
- bottom = viewPtr->yOffset + height;
-
- maxWidth = itemPtr->width;
- if (viewPtr->maxWidth < maxWidth) {
- maxWidth = viewPtr->maxWidth;
- }
- if (itemPtr->worldX < left) {
- /* Adjust the scroll so that item starts at the left border. */
- x = itemPtr->worldX;
- } else if ((itemPtr->worldX + maxWidth) > right) {
- /* Adjust the scroll so that item ends at the right border. */
- x = itemPtr->worldX + maxWidth - width;
- }
- if (itemPtr->worldY < top) {
- /* Adjust the scroll so that item starts at the top border. */
- y = itemPtr->worldY;
- } else if ((itemPtr->worldY + itemPtr->height) > bottom) {
- /* Adjust the scroll so that item ends at the right border. */
- y = itemPtr->worldY + itemPtr->height - height;
- }
- if ((y != viewPtr->yOffset) || (x != viewPtr->xOffset)) {
- viewPtr->xOffset = x;
- viewPtr->yOffset = y;
- }
- EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionAnchorOp --
- *
- * Sets the selection anchor to the element given by a index. The
- * selection anchor is the end of the selection that is fixed while
- * dragging out a selection with the mouse. The index "anchor" may be
- * used to refer to the anchor element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionAnchorOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- long index;
-
- index = -1;
- if (objc == 3) {
- if (viewPtr->selAnchorPtr != NULL) {
- index = viewPtr->selAnchorPtr->index;
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
- }
- if (GetItemFromObj(interp, viewPtr, objv[3], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Set both the anchor and the mark. Indicates that a single entry
- * is selected. */
- viewPtr->selAnchorPtr = itemPtr;
- viewPtr->selMarkPtr = NULL;
- if (itemPtr != NULL) {
- index = itemPtr->index;
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionClearallOp
- *
- * Clears the entire selection.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionClearallOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- ClearSelection(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionIncludesOp
- *
- * Returns 1 if the element indicated by index is currently selected, 0
- * if it isn't.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionIncludesOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- int bool;
-
- if (GetItemFromObj(interp, viewPtr, objv[3], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- bool = FALSE;
- if (itemPtr == NULL) {
- bool = ItemIsSelected(viewPtr, itemPtr);
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionMarkOp --
- *
- * Sets the selection mark to the element given by a index. The
- * selection anchor is the end of the selection that is movable while
- * dragging out a selection with the mouse. The index "mark" may be used
- * to refer to the anchor element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionMarkOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
- long index;
-
- index = -1;
- if (objc == 3) {
- if (viewPtr->selMarkPtr != NULL) {
- index = viewPtr->selMarkPtr->index;
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
- }
- if (GetItemFromObj(interp, viewPtr, objv[3], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (viewPtr->selAnchorPtr == NULL) {
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK; /* The selection anchor must be set
- * first. But don't flag this as
- * an error. */
- }
- if ((itemPtr != NULL) && (viewPtr->selMarkPtr != itemPtr)) {
- Blt_ChainLink link, prev;
-
- /* Deselect entry from the list all the way back to the anchor. */
- for (link = Blt_Chain_LastLink(viewPtr->selected); link != NULL;
- link = prev) {
- Item *selectPtr;
-
- prev = Blt_Chain_PrevLink(link);
- selectPtr = Blt_Chain_GetValue(link);
- if (selectPtr == viewPtr->selAnchorPtr) {
- break;
- }
- DeselectItem(viewPtr, selectPtr);
- }
- viewPtr->flags &= ~SELECT_MASK;
- viewPtr->flags |= SELECT_SET;
- SelectRange(viewPtr, viewPtr->selAnchorPtr, itemPtr);
- viewPtr->selMarkPtr = itemPtr;
- EventuallyRedraw(viewPtr);
- index = itemPtr->index;
- if (viewPtr->selectCmdObjPtr != NULL) {
- EventuallyInvokeSelectCmd(viewPtr);
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionPresentOp
- *
- * Returns 1 if there is a selection and 0 if it isn't.
- *
- * Results:
- * A standard TCL result. interp->result will contain a boolean string
- * indicating if there is a selection.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionPresentOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int bool;
-
- bool = (Blt_Chain_GetLength(viewPtr->selected) > 0);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionSetOp
- *
- * Selects, deselects, or toggles all of the elements in the range
- * between first and last, inclusive, without affecting the selection
- * state of elements outside that range.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionSetOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- char *string;
-
- viewPtr->flags &= ~SELECT_MASK;
- if (viewPtr->flags & LAYOUT_PENDING) {
- /*
- * The layout is dirty. Recompute it now so that we can use
- * view.top and view.bottom for nodes.
- */
- ComputeLayout(viewPtr);
- }
- string = Tcl_GetString(objv[2]);
- switch (string[0]) {
- case 's':
- viewPtr->flags |= SELECT_SET;
- break;
- case 'c':
- viewPtr->flags |= SELECT_CLEAR;
- break;
- case 't':
- viewPtr->flags |= SELECT_TOGGLE;
- break;
- }
- if (objc > 4) {
- Item *firstPtr, *lastPtr;
-
- if (GetItemFromObj(interp, viewPtr, objv[3], &firstPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (firstPtr == NULL) {
- return TCL_OK; /* Didn't pick an entry. */
- }
- if ((firstPtr->flags & ITEM_HIDE) &&
- (!(viewPtr->flags & SELECT_CLEAR))) {
- if (objc > 4) {
- Tcl_AppendResult(interp, "can't select hidden node \"",
- Tcl_GetString(objv[3]), "\"", (char *)NULL);
- return TCL_ERROR;
- } else {
- return TCL_OK;
- }
- }
- lastPtr = firstPtr;
- if (objc > 4) {
- if (GetItemFromObj(interp, viewPtr, objv[4], &lastPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (lastPtr == NULL) {
- return TCL_OK;
- }
- if ((lastPtr->flags & ITEM_HIDE) &&
- (!(viewPtr->flags & SELECT_CLEAR))) {
- Tcl_AppendResult(interp, "can't select hidden node \"",
- Tcl_GetString(objv[4]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (firstPtr == lastPtr) {
- SelectItemUsingFlags(viewPtr, firstPtr);
- } else {
- SelectRange(viewPtr, firstPtr, lastPtr);
- }
- /* Set both the anchor and the mark. Indicates that a single entry is
- * selected. */
- if (viewPtr->selAnchorPtr == NULL) {
- viewPtr->selAnchorPtr = firstPtr;
- }
- } else {
- Item *itemPtr;
- ItemIterator iter;
-
- if (GetItemIterator(interp, viewPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (itemPtr = FirstTaggedItem(&iter); itemPtr != NULL;
- itemPtr = NextTaggedItem(&iter)) {
- if ((itemPtr->flags & ITEM_HIDE) &&
- ((viewPtr->flags & SELECT_CLEAR) == 0)) {
- continue;
- }
- SelectItemUsingFlags(viewPtr, itemPtr);
- }
- /* Set both the anchor and the mark. Indicates that a single entry is
- * selected. */
- if (viewPtr->selAnchorPtr == NULL) {
- viewPtr->selAnchorPtr = itemPtr;
- }
- }
- if (viewPtr->flags & SELECT_EXPORT) {
- Tk_OwnSelection(viewPtr->tkwin, XA_PRIMARY, LostSelection, viewPtr);
- }
- EventuallyRedraw(viewPtr);
- if (viewPtr->selectCmdObjPtr != NULL) {
- EventuallyInvokeSelectCmd(viewPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionOp --
- *
- * This procedure handles the individual options for text selections.
- * The selected text is designated by start and end indices into the text
- * pool. The selected segment has both a anchored and unanchored ends.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec selectionOps[] =
-{
- {"anchor", 1, SelectionAnchorOp, 3, 4, "?item?",},
- {"clear", 5, SelectionSetOp, 4, 5, "first ?last?",},
- {"clearall", 6, SelectionClearallOp, 3, 3, "",},
- {"includes", 1, SelectionIncludesOp, 4, 4, "item",},
- {"mark", 1, SelectionMarkOp, 3, 4, "?item?",},
- {"present", 1, SelectionPresentOp, 3, 3, "",},
- {"set", 1, SelectionSetOp, 4, 5, "first ?last?",},
- {"toggle", 1, SelectionSetOp, 4, 5, "first ?last?",},
-};
-static int nSelectionOps = sizeof(selectionOps) / sizeof(Blt_OpSpec);
-
-static int
-SelectionOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- ListViewCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nSelectionOps, selectionOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (viewPtr, interp, objc, objv);
- return result;
-}
-
-/*ARGSUSED*/
-static int
-SizeOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_SetLongObj(Tcl_GetObjResult(interp),
- Blt_Chain_GetLength(viewPtr->chain));
- return TCL_OK;
-}
-
-
-static int
-InvokeCompare(ListView *viewPtr, const char *s1, const char *s2,
- Tcl_Obj *cmdPtr)
-{
- Tcl_Interp *interp;
- int result;
- Tcl_Obj *objv[4];
-
- interp = viewPtr->interp;
- objv[0] = cmdPtr;
- objv[1] = Tcl_NewStringObj(Tk_PathName(viewPtr->tkwin), -1);
- objv[2] = Tcl_NewStringObj(s1, -1);
- objv[3] = Tcl_NewStringObj(s2, -1);
- result = Blt_GlobalEvalObjv(interp, 4, objv);
- if ((result != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, Tcl_GetObjResult(interp),&result)!=TCL_OK)) {
- Tcl_BackgroundError(interp);
- }
- Tcl_ResetResult(interp);
- return result;
-}
-
-static ListView *listViewInstance;
-
-static int
-CompareLinks(Blt_ChainLink *aPtr, Blt_ChainLink *bPtr)
-{
- ListView *viewPtr;
- Item *i1Ptr, *i2Ptr;
- const char *s1, *s2;
- int result;
-
- i1Ptr = (Item *)Blt_Chain_GetValue(*aPtr);
- i2Ptr = (Item *)Blt_Chain_GetValue(*bPtr);
- viewPtr = i1Ptr->viewPtr;
- if (viewPtr->flags & SORT_TYPE) {
- s1 = i1Ptr->type;
- s2 = i2Ptr->type;
- } else {
- s1 = i1Ptr->label;
- s2 = i2Ptr->label;
- }
- if (s1 == NULL) {
- s1 = "";
- }
- if (s2 == NULL) {
- s2 = "";
- }
- result = 0;
- if (viewPtr->sortCmdPtr != NULL) {
- result = InvokeCompare(viewPtr, s1, s2, viewPtr->sortCmdPtr);
- if (viewPtr->flags & SORT_DECREASING) {
- result = -result;
- }
- return result;
- }
- if (viewPtr->flags & SORT_DICTIONARY) {
- result = Blt_DictionaryCompare(s1, s2);
- } else {
- result = strcmp(s1, s2);
- }
- if (result == 0) {
- if (viewPtr->flags & SORT_TYPE) {
- s1 = i1Ptr->label;
- s2 = i2Ptr->label;
- } else {
- s1 = i1Ptr->type;
- s2 = i2Ptr->type;
- }
- if (viewPtr->flags & SORT_DICTIONARY) {
- result = Blt_DictionaryCompare(s1, s2);
- } else {
- result = strcmp(s1, s2);
- }
- }
- if (viewPtr->flags & SORT_DECREASING) {
- return -result;
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SortCgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SortCgetOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- return Blt_ConfigureValueFromObj(interp, viewPtr->tkwin, sortSpecs,
- (char *)viewPtr, objv[3], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SortConfigureOp --
- *
- * This procedure is called to process a list of configuration
- * options database, in order to reconfigure the one of more
- * entries in the widget.
- *
- * .h sort configure option value
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then
- * interp->result contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for viewPtr; old resources get freed, if there
- * were any. The hypertext is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SortConfigureOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int oldType;
- Tcl_Obj *oldCmdPtr;
-
- if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin, sortSpecs,
- (char *)viewPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin, sortSpecs,
- (char *)viewPtr, objv[3], 0);
- }
- oldType = viewPtr->flags & SORT_MODE_MASK;
- oldCmdPtr = viewPtr->sortCmdPtr;
- if (Blt_ConfigureWidgetFromObj(interp, viewPtr->tkwin, sortSpecs,
- objc - 3, objv + 3, (char *)viewPtr, BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((oldType != (viewPtr->flags & SORT_MODE_MASK)) ||
- (oldCmdPtr != viewPtr->sortCmdPtr)) {
- viewPtr->flags &= ~SORTED;
- }
- if (viewPtr->flags & SORT_AUTO) {
- viewPtr->flags |= SORT_PENDING;
- }
- EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-SortNowOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (Blt_ConfigureWidgetFromObj(interp, viewPtr->tkwin, sortSpecs,
- objc - 3, objv + 3, (char *)viewPtr, BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- viewPtr->flags |= SORT_PENDING;
- EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SortOp --
- *
- * Comparison routine (used by qsort) to sort a chain of subnodes.
- * A simple string comparison is performed on each node name.
- *
- * .h sort now
- *
- * Results:
- * 1 is the first is greater, -1 is the second is greater, 0
- * if equal.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec sortOps[] =
-{
- {"cget", 2, SortCgetOp, 4, 4, "option",},
- {"configure", 2, SortConfigureOp, 3, 0, "?option value?...",},
- {"now", 1, SortNowOp, 3, 0, "?option value?",},
-};
-static int nSortOps = sizeof(sortOps) / sizeof(Blt_OpSpec);
-
-/*ARGSUSED*/
-static int
-SortOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- ListViewCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nSortOps, sortOps, BLT_OP_ARG2, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (viewPtr, interp, objc, objv);
- return result;
-}
-
-/* .m style create name option value option value */
-
-static int
-StyleCreateOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Style *stylePtr;
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&viewPtr->styleTable, Tcl_GetString(objv[3]),
- &isNew);
- if (!isNew) {
- Tcl_AppendResult(interp, "listview style \"", Tcl_GetString(objv[3]),
- "\" already exists.", (char *)NULL);
- return TCL_ERROR;
- }
- stylePtr = Blt_AssertCalloc(1, sizeof(Style));
- stylePtr->name = Blt_GetHashKey(&viewPtr->styleTable, hPtr);
- stylePtr->hPtr = hPtr;
- stylePtr->viewPtr = viewPtr;
- stylePtr->borderWidth = 0;
- stylePtr->activeRelief = TK_RELIEF_RAISED;
- Blt_SetHashValue(hPtr, stylePtr);
- iconOption.clientData = viewPtr;
- if (ConfigureStyle(interp, stylePtr, objc - 4, objv + 4, 0) != TCL_OK) {
- DestroyStyle(stylePtr);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-StyleCgetOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Style *stylePtr;
-
- if (GetStyleFromObj(interp, viewPtr, objv[3], &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- iconOption.clientData = viewPtr;
- return Blt_ConfigureValueFromObj(interp, viewPtr->tkwin, styleSpecs,
- (char *)stylePtr, objv[4], 0);
-}
-
-static int
-StyleConfigureOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int result, flags;
- Style *stylePtr;
-
- if (GetStyleFromObj(interp, viewPtr, objv[3], &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- iconOption.clientData = viewPtr;
- flags = BLT_CONFIG_OBJV_ONLY;
- if (objc == 1) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin,
- styleSpecs, (char *)stylePtr, (Tcl_Obj *)NULL, flags);
- } else if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin,
- styleSpecs, (char *)stylePtr, objv[2], flags);
- }
- Tcl_Preserve(stylePtr);
- result = ConfigureStyle(interp, stylePtr, objc - 4, objv + 4, flags);
- Tcl_Release(stylePtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- viewPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-static int
-StyleDeleteOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Style *stylePtr;
-
- if (GetStyleFromObj(interp, viewPtr, objv[3], &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (stylePtr->refCount > 0) {
- Tcl_AppendResult(interp, "can't destroy listview style \"",
- stylePtr->name, "\": style in use.", (char *)NULL);
- return TCL_ERROR;
- }
- DestroyStyle(stylePtr);
- return TCL_OK;
-}
-
-static int
-StyleNamesOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&viewPtr->styleTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Style *stylePtr;
- int found;
- int i;
-
- found = TRUE;
- stylePtr = Blt_GetHashValue(hPtr);
- for (i = 3; i < objc; i++) {
- const char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- found = Tcl_StringMatch(stylePtr->name, pattern);
- if (found) {
- break;
- }
- }
- if (found) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(stylePtr->name, -1));
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-static Blt_OpSpec styleOps[] =
-{
- {"cget", 2, StyleCgetOp, 5, 5, "name option",},
- {"configure", 2, StyleConfigureOp, 4, 0, "name ?option value?...",},
- {"create", 2, StyleCreateOp, 4, 0, "name ?option value?...",},
- {"delete", 1, StyleDeleteOp, 3, 0, "?name...?",},
- {"names", 1, StyleNamesOp, 3, 0, "?pattern...?",},
-};
-
-static int nStyleOps = sizeof(styleOps) / sizeof(Blt_OpSpec);
-
-static int
-StyleOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- ListViewCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nStyleOps, styleOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (viewPtr, interp, objc, objv);
- return result;
-}
-
-
-static int
-XpositionOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
-
- if (GetItemFromObj(interp, viewPtr, objv[3], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- Tcl_AppendResult(interp, "can't get x-position of item: no item \"",
- Tcl_GetString(objv[3]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), itemPtr->worldX-viewPtr->xOffset);
- return TCL_OK;
-}
-
-static int
-XviewOp(ListView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int w;
-
- w = VPORTWIDTH(viewPtr);
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr, *objPtr;
-
- /* Report first and last fractions */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- /*
- * Note: we are bounding the fractions between 0.0 and 1.0 to support
- * the "canvas"-style of scrolling.
- */
- fract = (double)viewPtr->xOffset / (viewPtr->worldWidth+1);
- objPtr = Tcl_NewDoubleObj(FCLAMP(fract));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- fract = (double)(viewPtr->xOffset + w) / (viewPtr->worldWidth+1);
- objPtr = Tcl_NewDoubleObj(FCLAMP(fract));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2, &viewPtr->xOffset,
- viewPtr->worldWidth, w, viewPtr->xScrollUnits,
- BLT_SCROLL_MODE_HIERBOX) != TCL_OK) {
- return TCL_ERROR;
- }
- viewPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-static int
-YpositionOp(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Item *itemPtr;
-
- if (GetItemFromObj(interp, viewPtr, objv[3], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- Tcl_AppendResult(interp, "can't get y-position of item: such index \"",
- Tcl_GetString(objv[3]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), itemPtr->worldY-viewPtr->yOffset);
- return TCL_OK;
-}
-
-static int
-YviewOp(
- ListView *viewPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int height;
-
- height = VPORTHEIGHT(viewPtr);
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr, *objPtr;
-
- /* Report first and last fractions */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- /*
- * Note: we are bounding the fractions between 0.0 and 1.0 to support
- * the "canvas"-style of scrolling.
- */
- fract = (double)viewPtr->yOffset / (viewPtr->worldHeight+1);
- objPtr = Tcl_NewDoubleObj(FCLAMP(fract));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- fract = (double)(viewPtr->yOffset + height) /(viewPtr->worldHeight+1);
- objPtr = Tcl_NewDoubleObj(FCLAMP(fract));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2, &viewPtr->yOffset,
- viewPtr->worldHeight, height, viewPtr->yScrollUnits,
- BLT_SCROLL_MODE_HIERBOX) != TCL_OK) {
- return TCL_ERROR;
- }
- viewPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyListView --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the internal structure of the widget at a safe time (when
- * no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyListView(DestroyData dataPtr) /* Pointer to the widget record. */
-{
- ListView *viewPtr = (ListView *)dataPtr;
-
- DestroyItems(viewPtr);
- DestroyStyles(viewPtr);
- DestroyLabels(viewPtr);
- Blt_DeleteHashTable(&viewPtr->tagTable);
- DestroyIcons(viewPtr);
- if (viewPtr->painter != NULL) {
- Blt_FreePainter(viewPtr->painter);
- }
- if (viewPtr->focusGC != NULL) {
- Tk_FreeGC(viewPtr->display, viewPtr->focusGC);
- }
- iconOption.clientData = viewPtr;
- Blt_FreeOptions(listViewSpecs, (char *)viewPtr, viewPtr->display, 0);
- Tcl_DeleteCommandFromToken(viewPtr->interp, viewPtr->cmdToken);
- Blt_Free(viewPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewListView --
- *
- *---------------------------------------------------------------------------
- */
-static ListView *
-NewListView(Tcl_Interp *interp, Tk_Window tkwin)
-{
- ListView *viewPtr;
-
- viewPtr = Blt_AssertCalloc(1, sizeof(ListView));
-
- Tk_SetClass(tkwin, "ListView");
-
- viewPtr->tkwin = tkwin;
- viewPtr->display = Tk_Display(tkwin);
- viewPtr->interp = interp;
- viewPtr->flags = LAYOUT_PENDING | SCROLL_PENDING | SELECT_EXPORT |
- SELECT_ORDERED;
- viewPtr->relief = TK_RELIEF_SUNKEN;
- viewPtr->xScrollUnits = viewPtr->yScrollUnits = 20;
- viewPtr->borderWidth = 1;
- viewPtr->highlightWidth = 2;
- viewPtr->chain = Blt_Chain_Create();
- viewPtr->layoutMode = LAYOUT_LIST_COLUMN;
- viewPtr->painter = Blt_GetPainter(tkwin, 1.0);
- Blt_ResetLimits(&viewPtr->reqWidth);
- Blt_ResetLimits(&viewPtr->reqHeight);
- Blt_InitHashTable(&viewPtr->iconTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&viewPtr->labelTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&viewPtr->styleTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&viewPtr->tagTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&viewPtr->selectTable, BLT_ONE_WORD_KEYS);
- viewPtr->selected = Blt_Chain_Create();
- AddDefaultStyle(interp, viewPtr);
- Blt_SetWindowInstanceData(tkwin, viewPtr);
- return viewPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListViewCmd --
- *
- * This procedure is invoked to process the "listview" command. See the
- * user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec listViewOps[] =
-{
- {"activate", 2, ActivateOp, 3, 3, "item",},
- {"add", 2, AddOp, 2, 0, "?option value?",},
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"configure", 2, ConfigureOp, 2, 0, "?option value?...",},
- {"curselection",2, CurselectionOp,2, 2, "",},
- {"delete", 3, DeleteOp, 2, 0, "items...",},
- {"exists", 3, ExistsOp, 3, 3, "item",},
- {"find", 2, FindOp, 3, 0, "string ?switches?",},
- {"focus", 2, FocusOp, 3, 3, "item",},
- {"index", 3, IndexOp, 3, 3, "item",},
- {"insert", 3, InsertOp, 3, 0,
- "after|at|before index ?option value?",},
- {"invoke", 3, InvokeOp, 3, 3, "item",},
- {"item", 2, ItemOp, 2, 0, "oper args",},
- {"listadd", 1, AddListOp, 3, 0, "labelList ?option value?",},
- {"names", 2, NamesOp, 2, 0, "?pattern...?",},
- {"nearest", 3, NearestOp, 4, 4, "x y",},
- {"next", 3, NextOp, 3, 3, "item",},
- {"previous", 2, PreviousOp, 3, 3, "item",},
- {"scan", 2, ScanOp, 5, 5, "dragto|mark x y",},
- {"see", 3, SeeOp, 3, 3, "item",},
- {"selection", 3, SelectionOp, 2, 0, "op ?args?",},
- {"size", 2, SizeOp, 2, 2, "",},
- {"sort", 2, SortOp, 2, 0, "op ?args...?",},
- {"style", 2, StyleOp, 2, 0, "op ?args...?",},
- {"xposition", 2, XpositionOp, 3, 3, "item",},
- {"xview", 2, XviewOp, 2, 5,
- "?moveto fract? ?scroll number what?",},
- {"yposition", 2, YpositionOp, 3, 3, "item",},
- {"yview", 2, YviewOp, 2, 5,
- "?moveto fract? ?scroll number what?",},
-};
-
-static int nListViewOps = sizeof(listViewOps) / sizeof(Blt_OpSpec);
-
-typedef int (ListViewInstOp)(ListView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-static int
-ListViewInstCmdProc(
- ClientData clientData, /* Information about the widget. */
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to. */
- int objc, /* # of arguments. */
- Tcl_Obj *const *objv) /* Argument vector. */
-{
- ListViewInstOp *proc;
- ListView *viewPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nListViewOps, listViewOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(viewPtr);
- result = (*proc) (viewPtr, interp, objc, objv);
- Tcl_Release(viewPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListViewInstCmdDeletedProc --
- *
- * This procedure can be called if the window was destroyed (tkwin will
- * be NULL) and the command was deleted automatically. In this case, we
- * need to do nothing.
- *
- * Otherwise this routine was called because the command was deleted.
- * Then we need to clean-up and destroy the widget.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ListViewInstCmdDeletedProc(ClientData clientData)
-{
- ListView *viewPtr = clientData; /* Pointer to widget record. */
-
- if (viewPtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = viewPtr->tkwin;
- viewPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListViewCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-ListViewCmd(
- ClientData clientData, /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- ListView *viewPtr;
- Tcl_CmdInfo cmdInfo;
- Tk_Window tkwin;
- char *path;
- unsigned int mask;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * First time in this interpreter, invoke a procedure to initialize
- * various bindings on the listview widget. If the procedure doesn't
- * already exist, source it from "$blt_library/listview.tcl". We
- * deferred sourcing the file until now so that the variable $blt_library
- * could be set within a script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::ListView::AutoScroll", &cmdInfo)) {
- if (Tcl_GlobalEval(interp,
- "source [file join $blt_library listview.tcl]") != TCL_OK) {
- char info[200];
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- return TCL_ERROR;
- }
- }
- path = Tcl_GetString(objv[1]);
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), path, NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- viewPtr = NewListView(interp, tkwin);
- if (ConfigureListView(interp, viewPtr, objc - 2, objv + 2, 0) != TCL_OK) {
- Tk_DestroyWindow(viewPtr->tkwin);
- return TCL_ERROR;
- }
- mask = (ExposureMask | StructureNotifyMask | FocusChangeMask);
- Tk_CreateEventHandler(tkwin, mask, ListViewEventProc, viewPtr);
- Tk_CreateSelHandler(tkwin, XA_PRIMARY, XA_STRING, SelectionProc, viewPtr,
- XA_STRING);
- viewPtr->cmdToken = Tcl_CreateObjCommand(interp, path,
- ListViewInstCmdProc, viewPtr, ListViewInstCmdDeletedProc);
-
- Tcl_SetObjResult(interp, objv[1]);
- return TCL_OK;
-}
-
-int
-Blt_ListViewInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec[1] = {
- { "listview", ListViewCmd },
- };
- return Blt_InitCmds(interp, "::blt", cmdSpec, 1);
-}
-
-static void
-DrawItemBackground(Item *itemPtr, Drawable drawable, int x, int y)
-{
- Blt_Background bg;
- Style *stylePtr;
- ListView *viewPtr;
- int relief;
- int w, h;
-
- stylePtr = itemPtr->stylePtr;
- viewPtr = itemPtr->viewPtr;
- relief = itemPtr->relief;
- if (itemPtr->flags & ITEM_DISABLED) {
- bg = stylePtr->disabledBg;
- } else if (viewPtr->activePtr == itemPtr) {
- bg = stylePtr->activeBg;
- } else {
- bg = stylePtr->normalBg;
- }
- w = itemPtr->worldWidth;
- h = itemPtr->worldHeight;
-#ifndef notdef
- if (y == 0) {
- int xOrigin, yOrigin;
- int px, py;
-
- Blt_GetBackgroundOrigin(bg, &xOrigin, &yOrigin);
- Blt_SetBackgroundOrigin(viewPtr->tkwin, bg, px, py);
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, x, y,
- w, h, stylePtr->borderWidth, relief);
- Blt_SetBackgroundOrigin(viewPtr->tkwin, bg, xOrigin, yOrigin);
- } else {
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, x, y,
- w, h, stylePtr->borderWidth, relief);
- }
-#else
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, x, y, w, h,
- stylePtr->borderWidth, relief);
-#endif
-}
-
-static void
-DrawItem(Item *itemPtr, Drawable drawable, int x, int y)
-{
- ListView *viewPtr;
- Style *stylePtr;
- int x0, y0, w, h;
- int labelWidth;
- Icon icon;
-
- itemPtr->flags &= ~ITEM_REDRAW;
- stylePtr = itemPtr->stylePtr;
- viewPtr = itemPtr->viewPtr;
- x0 = x, y0 = y;
-
- labelWidth = itemPtr->labelWidth;
- if ((viewPtr->labelWidth>0) && (viewPtr->labelWidth<itemPtr->labelWidth)) {
- labelWidth = viewPtr->labelWidth;
- }
- w = itemPtr->width;
- h = itemPtr->height;
- x += itemPtr->indent;
- /* Icon. */
- icon = (viewPtr->layoutMode == LAYOUT_ICONS) ? itemPtr->bigIcon :
- itemPtr->icon;
- if (icon != NULL) {
- if ((Blt_IsPicture(IconImage(icon))) &&
- (itemPtr->flags & ITEM_DISABLED)) {
- Blt_Picture picture;
- Blt_Painter painter;
-
- painter = Blt_GetPainter(viewPtr->tkwin, 1.0);
- picture = Blt_GetPictureFromPictureImage(viewPtr->interp,
- IconImage(icon));
- picture = Blt_GreyscalePicture(picture);
- Blt_PaintPicture(painter, drawable, picture, 0, 0,
- IconWidth(icon), IconHeight(icon),
- x + itemPtr->iconX, y + itemPtr->iconY, 0);
- Blt_FreePicture(picture);
- } else {
- Tk_RedrawImage(IconImage(icon), 0, 0, IconWidth(icon),
- IconHeight(icon), drawable, x + itemPtr->iconX,
- y + itemPtr->iconY);
- }
- }
- /* Image or label. */
- if (ItemIsSelected(viewPtr, itemPtr)) {
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable,
- stylePtr->selectBg,
- x + itemPtr->labelX - 3, y + itemPtr->labelY - 1,
- labelWidth + 6, itemPtr->labelHeight + 3,
- stylePtr->borderWidth, stylePtr->selectRelief);
- }
- if (itemPtr->image != NULL) {
- Tk_RedrawImage(IconImage(itemPtr->image), 0, 0,
- IconWidth(itemPtr->image), IconHeight(itemPtr->image),
- drawable, x + itemPtr->labelX, y + itemPtr->labelY);
- } else if (itemPtr->label != emptyString) {
- TextStyle ts;
- XColor *fg;
- TextLayout *layoutPtr;
-
- if (itemPtr->flags & ITEM_DISABLED) {
- fg = stylePtr->labelDisabledColor;
- } else if (ItemIsSelected(viewPtr, itemPtr)) {
- fg = stylePtr->labelSelectColor;
- } else if (viewPtr->activePtr == itemPtr) {
- fg = stylePtr->labelActiveColor;
- } else {
- fg = stylePtr->labelNormalColor;
- }
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, stylePtr->labelFont);
- Blt_Ts_SetForeground(ts, fg);
- Blt_Ts_SetAnchor(ts, TK_ANCHOR_NW);
- Blt_Ts_SetJustify(ts, TK_JUSTIFY_LEFT);
- Blt_Ts_SetMaxLength(ts, labelWidth);
- layoutPtr = Blt_Ts_CreateLayout(itemPtr->label, -1, &ts);
- Blt_Ts_DrawLayout(viewPtr->tkwin, drawable, layoutPtr, &ts,
- x + stylePtr->borderWidth + itemPtr->labelX,
- y + stylePtr->borderWidth + itemPtr->labelY);
- if (itemPtr == viewPtr->activePtr) {
- Blt_Ts_UnderlineLayout(viewPtr->tkwin, drawable, layoutPtr, &ts,
- x + stylePtr->borderWidth + itemPtr->labelX,
- y + stylePtr->borderWidth + itemPtr->labelY);
- }
- Blt_Free(layoutPtr);
- }
- if ((viewPtr->flags & FOCUS) && (viewPtr->focusPtr == itemPtr)) {
- if (ItemIsSelected(viewPtr, itemPtr)) {
- XSetForeground(viewPtr->display, viewPtr->focusGC,
- stylePtr->labelSelectColor->pixel);
- } else {
- XSetForeground(viewPtr->display, viewPtr->focusGC,
- stylePtr->labelNormalColor->pixel);
- }
- XDrawRectangle(viewPtr->display, drawable, viewPtr->focusGC,
- x - 2 + stylePtr->borderWidth + itemPtr->labelX,
- y - 2 + stylePtr->borderWidth + itemPtr->labelY,
- labelWidth + 3 - 2 * stylePtr->borderWidth,
- itemPtr->labelHeight + 3 - 2 * stylePtr->borderWidth);
- }
-}
-
-static void
-DrawListView(ListView *viewPtr, Drawable drawable)
-{
- int left, right, top, bottom;
-
- /* Draw each visible item. */
- Item *itemPtr;
-
- left = viewPtr->inset;
- right = VPORTWIDTH(viewPtr);
- top = viewPtr->inset;
- bottom = VPORTHEIGHT(viewPtr);
-
- for (itemPtr = FirstItem(viewPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
- int x, y;
-
- if (itemPtr->flags & ITEM_HIDE) {
- continue;
- }
- x = SCREENX(viewPtr, itemPtr->worldX);
- y = SCREENY(viewPtr, itemPtr->worldY);
- if ((x > right) || ((x + itemPtr->width) < left) ||
- (y > bottom) || ((y + itemPtr->height) < top)) {
- continue;
- }
- DrawItemBackground(itemPtr, drawable, x, y);
- DrawItem(itemPtr, drawable, x, y);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayItem --
- *
- * This procedure is invoked to display an item in the listview widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the item.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayItem(ClientData clientData)
-{
- Item *itemPtr = clientData;
- int x, y, w, h;
- Pixmap drawable;
- ListView *viewPtr;
- int sx, sy, x1, x2, y1, y2;
-
- /*
- * Create a pixmap the size of the item for double buffering.
- */
- viewPtr = itemPtr->viewPtr;
- h = itemPtr->worldHeight;
- w = itemPtr->worldWidth;
- if ((w < 1) || (h < 1)) {
- fprintf(stderr, "w=%d h=%d\n", w, h);
- return;
- }
- drawable = Tk_GetPixmap(viewPtr->display, Tk_WindowId(viewPtr->tkwin),
- w, h, Tk_Depth(viewPtr->tkwin));
-#ifdef WIN32
- assert(drawable != None);
-#endif
- DrawItemBackground(itemPtr, drawable, 0, 0);
- DrawItem(itemPtr, drawable, 0, 0);
- x = SCREENX(viewPtr, itemPtr->worldX);
- y = SCREENY(viewPtr, itemPtr->worldY);
-
- /* Don't let the item overlap the widget's border. Reduce the pixmap
- * accordingly. */
- x1 = y1 = viewPtr->inset;
- x2 = Tk_Width(viewPtr->tkwin) - viewPtr->inset;
- y2 = Tk_Height(viewPtr->tkwin) - viewPtr->inset;
- sx = sy = 0;
- if (x < x1) { /* Overlaps on the left. */
- sx = x1 - x;
- w -= sx;
- x = x1;
- }
- if ((x + w) > x2) { /* Overlaps on the right. */
- w = x2 - x;
- }
- if (y < y1) { /* Overlaps on the top. */
- sy = y1 - y;
- h -= sy;
- y = y1;
- }
- if ((y + h) > y2) { /* Overlaps on the bottom. */
- h = y2 - y;
- }
- XCopyArea(viewPtr->display, drawable, Tk_WindowId(viewPtr->tkwin),
- viewPtr->focusGC, sx, sy, w, h, x, y);
- Tk_FreePixmap(viewPtr->display, drawable);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SortItems --
- *
- * Sorts the items in the list.
- *
- *---------------------------------------------------------------------------
- */
-static void
-SortItems(ListView *viewPtr)
-{
- Item *itemPtr;
- long count;
-
- listViewInstance = viewPtr;
- viewPtr->flags &= ~SORT_PENDING;
- Blt_Chain_Sort(viewPtr->chain, CompareLinks);
- viewPtr->flags |= SORTED;
- for (count = 0, itemPtr = FirstItem(viewPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr), count++) {
- itemPtr->index = count;
- }
- viewPtr->flags |= LAYOUT_PENDING;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayListView --
- *
- * This procedure is invoked to display a listview widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the menu.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayListView(ClientData clientData)
-{
- ListView *viewPtr = clientData;
- Pixmap drawable;
- int w, h; /* Window width and height. */
-
- viewPtr->flags &= ~REDRAW_PENDING;
- if (viewPtr->tkwin == NULL) {
- return; /* Window destroyed (should not get
- * here) */
- }
-#ifdef notdef
- fprintf(stderr, "Calling DisplayListView(%s) w=%d h=%d\n",
- Tk_PathName(viewPtr->tkwin), Tk_Width(viewPtr->tkwin),
- Tk_Height(viewPtr->tkwin));
-#endif
- if (viewPtr->flags & SORT_PENDING) {
- SortItems(viewPtr);
- }
- if (viewPtr->flags & LAYOUT_PENDING) {
- ComputeLayout(viewPtr);
- }
- viewPtr->width = Tk_Width(viewPtr->tkwin);
- viewPtr->height = Tk_Height(viewPtr->tkwin);
- if ((Tk_Width(viewPtr->tkwin) <= 1) || (Tk_Height(viewPtr->tkwin) <= 1)){
- /* Don't bother computing the layout until the window size is
- * something reasonable. */
- return;
- }
- if (!Tk_IsMapped(viewPtr->tkwin)) {
- /* The menu's window isn't displayed, so don't bother drawing
- * anything. By getting this far, we've at least computed the
- * coordinates of the listview's new layout. */
- return;
- }
- if (viewPtr->flags & SCROLL_PENDING) {
- int vw, vh; /* Viewport width and height. */
- /*
- * The view port has changed. The visible items need to be recomputed
- * and the scrollbars updated.
- */
- vw = VPORTWIDTH(viewPtr);
- vh = VPORTHEIGHT(viewPtr);
- if ((viewPtr->xScrollCmdObjPtr != NULL) &&
- (viewPtr->flags & SCROLLX)) {
- Blt_UpdateScrollbar(viewPtr->interp, viewPtr->xScrollCmdObjPtr,
- viewPtr->xOffset, viewPtr->xOffset + vw, viewPtr->worldWidth);
- }
- if ((viewPtr->yScrollCmdObjPtr != NULL) &&
- (viewPtr->flags & SCROLLY)) {
- Blt_UpdateScrollbar(viewPtr->interp, viewPtr->yScrollCmdObjPtr,
- viewPtr->yOffset, viewPtr->yOffset+vh, viewPtr->worldHeight);
- }
- viewPtr->flags &= ~SCROLL_PENDING;
- }
- /*
- * Create a pixmap the size of the window for double buffering.
- */
- w = Tk_Width(viewPtr->tkwin);
- h = Tk_Height(viewPtr->tkwin);
- drawable = Tk_GetPixmap(viewPtr->display, Tk_WindowId(viewPtr->tkwin),
- w, h, Tk_Depth(viewPtr->tkwin));
-#ifdef WIN32
- assert(drawable != None);
-#endif
- /* Background */
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable,
- viewPtr->defStyle.normalBg, 0, 0, w, h, 0, TK_RELIEF_FLAT);
- DrawListView(viewPtr, drawable);
- Blt_DrawBackgroundRectangle(viewPtr->tkwin, drawable,
- viewPtr->defStyle.normalBg, 0, 0, Tk_Width(viewPtr->tkwin),
- Tk_Height(viewPtr->tkwin), viewPtr->borderWidth, viewPtr->relief);
- /* Draw focus highlight ring. */
- if ((viewPtr->highlightWidth > 0) && (viewPtr->flags & FOCUS)) {
- GC gc;
-
- gc = Tk_GCForColor(viewPtr->highlightColor, drawable);
- Tk_DrawFocusHighlight(viewPtr->tkwin, gc, viewPtr->highlightWidth,
- drawable);
- }
- XCopyArea(viewPtr->display, drawable, Tk_WindowId(viewPtr->tkwin),
- viewPtr->focusGC, 0, 0, w, h, 0, 0);
- Tk_FreePixmap(viewPtr->display, drawable);
-}
diff --git a/blt3.0.1/src/bltMacBitmap.c b/blt3.0.1/src/bltMacBitmap.c
deleted file mode 100644
index a249582..0000000
--- a/blt3.0.1/src/bltMacBitmap.c
+++ /dev/null
@@ -1,685 +0,0 @@
-
-/*
- * bltMacOSXBitmap.c --
- *
- * This module implements MacOSX-specific bitmap processing procedures
- * for the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The color allocation routines are adapted from tkImgPhoto.c of the
- * Tk library distrubution. The photo image type was designed and
- * implemented by Paul Mackerras.
- *
- * Copyright (c) 1987-1993 The Regents of the University of
- * California.
- *
- * Copyright (c) 19941998 Sun Microsystems, Inc.
- *
- */
-
-#include "bltInt.h"
-#include "bltHash.h"
-#ifdef notdef
-#include "bltPicture.h"
-#endif
-#include <X11/Xutil.h>
-
-#define ROTATE_0 0
-#define ROTATE_90 1
-#define ROTATE_180 2
-#define ROTATE_270 3
-
-Pixmap
-Blt_PhotoImageMask(Tk_Window tkwin, Tk_PhotoImageBlock src)
-{
- Pixmap bitmap;
- int arraySize, bytes_per_line;
- int offset, count;
- int y;
- unsigned char *bits;
- unsigned char *dp;
-
-#ifdef notdef
- bytes_per_line = (src.width + 7) / 8;
- arraySize = src.height * bytes_per_line;
- bits = Blt_AssertMalloc(sizeof(unsigned char) * arraySize);
- dp = bits;
- offset = count = 0;
- for (y = 0; y < src.height; y++) {
- int value, bitMask;
- int x;
- unsigned char *sp;
-
- value = 0, bitMask = 1;
- sp = src.pixelPtr + offset;
- for (x = 0; x < src.width; /*empty*/ ) {
- unsigned long pixel;
-
- pixel = (sp[src.offset[3]] != 0x00);
- if (pixel) {
- value |= bitMask;
- } else {
- count++; /* Count the number of transparent pixels. */
- }
- bitMask <<= 1;
- x++;
- if (!(x & 7)) {
- *dp++ = (unsigned char)value;
- value = 0, bitMask = 1;
- }
- sp += src.pixelSize;
- }
- if (x & 7) {
- *dp++ = (unsigned char)value;
- }
- offset += src.pitch;
- }
- if (count > 0) {
- Tk_MakeWindowExist(tkwin);
- bitmap = XCreateBitmapFromData(Tk_Display(tkwin), Tk_WindowId(tkwin),
- (char *)bits, (unsigned int)src.width, (unsigned int)src.height);
- } else {
- bitmap = None; /* Image is opaque. */
- }
- Blt_Free(bits);
-#endif
- return bitmap;
-}
-
-#ifdef notdef
-Pixmap
-Blt_PictureMask(Tk_Window tkwin, Picture *srcPtr)
-{
- Blt_Pixel *srcRowPtr;
- Pixmap bitmap;
- int bytesPerLine;
- int count;
- int x, y;
- unsigned char *bits;
- unsigned char *destRowPtr;
-
- bytesPerLine = (srcPtr->width + 7) / 8;
- bits = Blt_AssertMalloc(sizeof(unsigned char)*srcPtr->height*bytesPerLine);
- count = 0;
- srcRowPtr = srcPtr->bits;
- destRowPtr = bits;
- for (y = 0; y < srcPtr->height; y++) {
- int value, bitMask;
- Blt_Pixel *sp;
- unsigned char *dp;
-
- sp = srcRowPtr, dp = destRowPtr;
- value = 0, bitMask = 1;
- for (x = 0; x < srcPtr->width; /*empty*/ ) {
- unsigned long pixel;
-
- pixel = (sp->Alpha != ALPHA_TRANSPARENT);
- if (pixel) {
- value |= bitMask;
- } else {
- count++; /* Count the number of transparent pixels. */
- }
- bitMask <<= 1;
- x++;
- if (!(x & 7)) {
- *dp++ = (unsigned char)value;
- value = 0, bitMask = 1;
- }
- sp++;
- }
- if (x & 7) {
- *dp++ = (unsigned char)value;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += bytesPerLine;
- }
- if (count > 0) {
- Tk_MakeWindowExist(tkwin);
- bitmap = XCreateBitmapFromData(Tk_Display(tkwin), Tk_WindowId(tkwin),
- (char *)bits, (unsigned int)srcPtr->width,
- (unsigned int)srcPtr->height);
- } else {
- bitmap = None; /* Image is opaque. */
- }
- Blt_Free(bits);
- return bitmap;
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RotateBitmap --
- *
- * Creates a new bitmap containing the rotated image of the given
- * bitmap. We also need a special GC of depth 1, so that we do
- * not need to rotate more than one plane of the bitmap.
- *
- * Results:
- * Returns a new bitmap containing the rotated image.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_RotateBitmap(
- Tk_Window tkwin,
- Pixmap srcBitmap, /* Source bitmap to be rotated */
- int srcWidth, int srcHeight, /* Width and height of the source bitmap */
- float angle, /* # of degrees to rotate the bitmap. */
- int *destWidthPtr,
- int *destHeightPtr)
-{
- Display *display; /* X display */
- GC bitmapGC;
- Pixmap destBitmap;
- Window root; /* Root window drawable */
- XImage *srcImgPtr, *destImgPtr;
- double rotWidth, rotHeight;
- int destWidth, destHeight;
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
-
-#ifdef notdef
- /* Create a bitmap and image big enough to contain the rotated text */
- Blt_GetBoundingBox(srcWidth, srcHeight, angle, &rotWidth, &rotHeight,
- (Point2d *)NULL);
- destWidth = ROUND(rotWidth);
- destHeight = ROUND(rotHeight);
- destBitmap = Tk_GetPixmap(display, root, destWidth, destHeight, 1);
- bitmapGC = Blt_GetBitmapGC(tkwin);
- XSetForeground(display, bitmapGC, 0x0);
- XFillRectangle(display, destBitmap, bitmapGC, 0, 0, destWidth, destHeight);
-
- srcImgPtr = XGetImage(display, srcBitmap, 0, 0, srcWidth, srcHeight, 1,
- ZPixmap);
- destImgPtr = XGetImage(display, destBitmap, 0, 0, destWidth, destHeight,
- 1, ZPixmap);
- angle = FMOD(angle, 360.0);
- if (FMOD(angle, 90.0) == 0.0) {
- int quadrant;
- int y;
-
- /* Handle right-angle rotations specifically */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- for (y = 0; y < destHeight; y++) {
- int x, sx;
-
- sx = y;
- for (x = 0; x < destWidth; x++) {
- int sy;
- unsigned long pixel;
-
- sy = destWidth - x - 1;
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- case ROTATE_180: /* 180 degrees */
- for (y = 0; y < destHeight; y++) {
- int x, sy;
-
- sy = destHeight - y - 1;
- for (x = 0; x < destWidth; x++) {
- int sx;
- unsigned long pixel;
-
- sx = destWidth - x - 1,
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- case ROTATE_90: /* 90 degrees */
- for (y = 0; y < destHeight; y++) {
- int x, sx;
-
- sx = destHeight - y - 1;
- for (x = 0; x < destWidth; x++) {
- int sy;
- unsigned long pixel;
-
- sy = x;
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- case ROTATE_0: /* 0 degrees */
- for (y = 0; y < destHeight; y++) {
- int x;
-
- for (x = 0; x < destWidth; x++) {
- unsigned long pixel;
-
- pixel = XGetPixel(srcImgPtr, x, y);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- default:
- /* The calling routine should never let this happen. */
- break;
- }
- } else {
- double radians, sinTheta, cosTheta;
- double sox, soy; /* Offset from the center of
- * the source rectangle. */
- double destCX, destCY; /* Offset to the center of the destination
- * rectangle. */
- int y;
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
-
- /*
- * Coordinates of the centers of the source and destination rectangles
- */
- sox = srcWidth * 0.5;
- soy = srcHeight * 0.5;
- destCX = destWidth * 0.5;
- destCY = destHeight * 0.5;
-
- /* For each pixel of the destination image, transform back to the
- * associated pixel in the source image. */
-
- for (y = 0; y < destHeight; y++) {
- double ty;
- int x;
-
- ty = y - destCY;
- for (x = 0; x < destWidth; x++) {
- double tx, rx, ry, sx, sy;
- unsigned long pixel;
-
- /* Translate origin to center of destination image. */
- tx = x - destCX;
-
- /* Rotate the coordinates about the origin. */
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source image. */
- rx += sox;
- ry += soy;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination image can be
- * bigger than the source.
- */
-
- if ((sx >= srcWidth) || (sx < 0) || (sy >= srcHeight) ||
- (sy < 0)) {
- continue;
- }
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- }
- /* Write the rotated image into the destination bitmap. */
- XPutImage(display, destBitmap, bitmapGC, destImgPtr, 0, 0, 0, 0,
- destWidth, destHeight);
-
- /* Clean up the temporary resources used. */
- XDestroyImage(srcImgPtr), XDestroyImage(destImgPtr);
- *destWidthPtr = destWidth;
- *destHeightPtr = destHeight;
-#endif
- return destBitmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ScaleBitmap --
- *
- * Creates a new scaled bitmap from another bitmap. The new bitmap
- * is bounded by a specified region. Only this portion of the bitmap
- * is scaled from the original bitmap.
- *
- * By bounding scaling to a region we can generate a new bitmap
- * which is no bigger than the specified viewport.
- *
- * Results:
- * The new scaled bitmap is returned.
- *
- * Side Effects:
- * A new pixmap is allocated. The caller must release this.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_ScaleBitmap(
- Tk_Window tkwin,
- Pixmap srcBitmap,
- int srcWidth, int srcHeight,
- int destWidth, int destHeight)
-{
- Display *display;
- GC bitmapGC;
- Pixmap destBitmap;
- Window root;
- XImage *srcImgPtr, *destImgPtr;
- double xScale, yScale;
- int y; /* Destination bitmap coordinates */
-
- /* Create a new bitmap the size of the region and clear it */
-
- display = Tk_Display(tkwin);
-
- root = Tk_RootWindow(tkwin);
-#ifdef notdef
- destBitmap = Tk_GetPixmap(display, root, destWidth, destHeight, 1);
- bitmapGC = Blt_GetBitmapGC(tkwin);
- XSetForeground(display, bitmapGC, 0x0);
- XFillRectangle(display, destBitmap, bitmapGC, 0, 0, destWidth, destHeight);
-
- srcImgPtr = XGetImage(display, srcBitmap, 0, 0, srcWidth, srcHeight, 1,
- ZPixmap);
- destImgPtr = XGetImage(display, destBitmap, 0, 0, destWidth, destHeight,
- 1, ZPixmap);
-
- /*
- * Scale each pixel of destination image from results of source
- * image. Verify the coordinates, since the destination image can
- * be bigger than the source
- */
- xScale = (double)srcWidth / (double)destWidth;
- yScale = (double)srcHeight / (double)destHeight;
-
- /* Map each pixel in the destination image back to the source. */
- for (y = 0; y < destHeight; y++) {
- int x, sy;
-
- sy = (int)(yScale * (double)y);
- for (x = 0; x < destWidth; x++) {
- int sx;
- unsigned long pixel;
-
- sx = (int)(xScale * (double)x);
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- /* Write the scaled image into the destination bitmap */
-
- XPutImage(display, destBitmap, bitmapGC, destImgPtr, 0, 0, 0, 0,
- destWidth, destHeight);
- XDestroyImage(srcImgPtr), XDestroyImage(destImgPtr);
-#endif
- return destBitmap;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RotateScaleBitmapArea --
- *
- * Creates a scaled and rotated bitmap from a given bitmap. The
- * caller also provides (offsets and dimensions) the region of
- * interest in the destination bitmap. This saves having to
- * process the entire destination bitmap is only part of it is
- * showing in the viewport.
- *
- * This uses a simple rotation/scaling of each pixel in the
- * destination image. For each pixel, the corresponding
- * pixel in the source bitmap is used. This means that
- * destination coordinates are first scaled to the size of
- * the rotated source bitmap. These coordinates are then
- * rotated back to their original orientation in the source.
- *
- * Results:
- * The new rotated and scaled bitmap is returned.
- *
- * Side Effects:
- * A new pixmap is allocated. The caller must release this.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_ScaleRotateBitmapArea(
- Tk_Window tkwin,
- Pixmap srcBitmap, /* Source bitmap. */
- unsigned int srcWidth,
- unsigned int srcHeight, /* Size of source bitmap */
- int regionX, int regionY, /* Offset of region in virtual
- * destination bitmap. */
- unsigned int regionWidth,
- unsigned int regionHeight, /* Desire size of bitmap region. */
- unsigned int destWidth,
- unsigned int destHeight, /* Virtual size of destination bitmap. */
- float angle) /* Angle to rotate bitmap. */
-{
- Display *display; /* X display */
- Window root; /* Root window drawable */
- Pixmap destBitmap;
- XImage *srcImgPtr, *destImgPtr;
- double xScale, yScale;
- double rotWidth, rotHeight;
- GC bitmapGC;
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
-
-#ifdef notdef
- /* Create a bitmap and image big enough to contain the rotated text */
- bitmapGC = Blt_GetBitmapGC(tkwin);
- destBitmap = Tk_GetPixmap(display, root, regionWidth, regionHeight, 1);
- XSetForeground(display, bitmapGC, 0x0);
- XFillRectangle(display, destBitmap, bitmapGC, 0, 0, regionWidth,
- regionHeight);
-
- srcImgPtr = XGetImage(display, srcBitmap, 0, 0, srcWidth, srcHeight, 1,
- ZPixmap);
- destImgPtr = XGetImage(display, destBitmap, 0, 0, regionWidth,
- regionHeight, 1, ZPixmap);
- angle = FMOD(angle, 360.0);
-
- Blt_GetBoundingBox(srcWidth, srcHeight, angle, &rotWidth, &rotHeight,
- (Point2d *)NULL);
-
- xScale = rotWidth / (double)destWidth;
- yScale = rotHeight / (double)destHeight;
-
- if (FMOD(angle, (double)90.0) == 0.0) {
- int quadrant;
- int x, y;
-
- /* Handle right-angle rotations specifically */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- for (y = 0; y < regionHeight; y++) {
- int sx;
-
- sx = (int)(yScale * (double)(y + regionY));
- for (x = 0; x < regionWidth; x++) {
- int sy;
- unsigned long pixel;
-
- sy = (int)(xScale *(double)(destWidth - (x + regionX) - 1));
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- case ROTATE_180: /* 180 degrees */
- for (y = 0; y < regionHeight; y++) {
- int sy;
-
- sy = (int)(yScale * (double)(destHeight - (y + regionY) - 1));
- for (x = 0; x < regionWidth; x++) {
- int sx;
- unsigned long pixel;
-
- sx = (int)(xScale *(double)(destWidth - (x + regionX) - 1));
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- case ROTATE_90: /* 90 degrees */
- for (y = 0; y < regionHeight; y++) {
- int sx;
-
- sx = (int)(yScale * (double)(destHeight - (y + regionY) - 1));
- for (x = 0; x < regionWidth; x++) {
- int sy;
- unsigned long pixel;
-
- sy = (int)(xScale * (double)(x + regionX));
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- case ROTATE_0: /* 0 degrees */
- for (y = 0; y < regionHeight; y++) {
- int sy;
-
- sy = (int)(yScale * (double)(y + regionY));
- for (x = 0; x < regionWidth; x++) {
- int sx;
- unsigned long pixel;
-
- sx = (int)(xScale * (double)(x + regionX));
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- default:
- /* The calling routine should never let this happen. */
- break;
- }
- } else {
- double radians, sinTheta, cosTheta;
- double sox, soy; /* Offset from the center of the
- * source rectangle. */
- double rox, roy; /* Offset to the center of the
- * rotated rectangle. */
- int x, y;
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
-
- /*
- * Coordinates of the centers of the source and destination rectangles
- */
- sox = srcWidth * 0.5;
- soy = srcHeight * 0.5;
- rox = rotWidth * 0.5;
- roy = rotHeight * 0.5;
-
- /* For each pixel of the destination image, transform back to the
- * associated pixel in the source image. */
-
- for (y = 0; y < regionHeight; y++) {
- double ty;
-
- ty = (yScale * (double)(y + regionY)) - roy;
- for (x = 0; x < regionWidth; x++) {
- double tx, rx, ry;
- int sx, sy;
- unsigned long pixel;
-
- /* Translate origin to center of destination image. */
- tx = (xScale * (double)(x + regionX)) - rox;
-
- /* Rotate the coordinates about the origin. */
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source image. */
- rx += sox;
- ry += soy;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination image can be
- * bigger than the source.
- */
-
- if ((sx >= srcWidth) || (sx < 0) || (sy >= srcHeight) ||
- (sy < 0)) {
- continue;
- }
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- }
- /* Write the rotated image into the destination bitmap. */
- XPutImage(display, destBitmap, bitmapGC, destImgPtr, 0, 0, 0, 0,
- regionWidth, regionHeight);
-
- /* Clean up the temporary resources used. */
- XDestroyImage(srcImgPtr), XDestroyImage(destImgPtr);
-#endif
- return destBitmap;
-}
diff --git a/blt3.0.1/src/bltMacImage.c b/blt3.0.1/src/bltMacImage.c
deleted file mode 100644
index 6f416e2..0000000
--- a/blt3.0.1/src/bltMacImage.c
+++ /dev/null
@@ -1,2430 +0,0 @@
-
-/*
- * bltMacOSXImage.c --
- *
- * This module implements MacOSX-specific image processing procedures
- * for the BLT toolkit.
- *
- * Copyright 1997-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltImage.h"
-/* #include <X11/Xutil.h> */
-#include "tkDisplay.h"
-
-typedef struct _Blt_Picture _Picture;
-
-#define Cursor MacOSX_Cursor
-#define Picture MacOSX_Picture
-#define TextStyle MacOSX_TextStyle
-#include <Carbon/Carbon.h>
-#undef Picture
-#undef Cursor
-#undef TextStyle
-
-struct TkWindow;
-
-struct _MacDrawable {
- TkWindow *winPtr; /* Ptr to tk window or NULL if Pixmap */
- CGrafPtr grafPtr;
- ControlRef rootControl;
- int xOffset; /* X offset from toplevel window. */
- int yOffset; /* Y offset from toplevel window. */
- RgnHandle clipRgn; /* Visable region of window. */
- RgnHandle aboveClipRgn; /* Visable region of window and its
- * children. */
- int referenceCount; /* Don't delete toplevel until
- * children are gone. */
-
- /* Pointer to the toplevel datastruct. */
- struct _MacDrawable *toplevel;
- int flags; /* Various state see defines below. */
-};
-
-typedef struct _MacDrawable *MacDrawable;
-
-
-#define COLOR_WINDOW (1<<0)
-#define BLACK_AND_WHITE (1<<1)
-#define MAP_COLORS (1<<2)
-
-static Blt_HashTable painterTable;
-static int initialized = 0;
-
-/*
- * PainterKey --
- *
- * This structure represents the key used to uniquely identify
- * painters. A painter is specified by a combination of display,
- * visual, colormap, depth, and monitor gamma value.
- */
-typedef struct {
- Display *display; /* Display of painter. Used to free
- * colors allocated. */
-
- Visual *visualPtr; /* Visual information for the class of
- * windows displaying the image. */
-
- Colormap colormap; /* Colormap used. This may be the
- * default colormap, or an allocated
- * private map. */
-
- int depth; /* Pixel depth of the display. */
-
- double gamma; /* Gamma correction value of monitor. */
-
-} PainterKey;
-
-
-/*
- * Painter --
- *
- * This structure represents a painter used to display picture images.
- * A painter is specified by a combination of display, visual,
- * colormap, depth, and monitor gamma value. Painters contain
- * information necessary to display a picture. This includes both an
- * RGB to pixel map, and a RGB to allocated color map.
- *
- * Painters may be shared by more than one client and are reference
- * counted. When no clients are using the painter, it is freed.
- */
-typedef struct _Blt_Painter {
- Display *display; /* Display of painter. Used to free
- * colors allocated. */
-
- Visual *visualPtr; /* Visual information for the class of
- * windows displaying the image. */
-
- Colormap colormap; /* Colormap used. This may be the default
- * colormap, or an allocated private map. */
-
- int depth; /* Pixel depth of the display. */
-
- double gamma; /* Gamma correction value of monitor. */
-
- unsigned int flags; /* Flags listed below. */
-
- int refCount; /* # of clients using this painter. If
- * zero, the painter is freed. */
-
- Blt_HashEntry *hashPtr; /* Used to delete the painter entry
- * from the hash table of painters. */
-
- int nColors; /* # of colors allocated. */
- int nRed, nGreen, nBlue; /* # of intensities for each RGB component. */
-
- unsigned long pixels[256]; /* Array of pixel values. Needed to
- * deallocate the color palette. Also
- * contains the mapping between linear
- * pixel values (rBits, gBits, bBits)
- * and the actual pixel for
- * PsuedoColor, StaticColor,
- * Greyscale, and StaticGrey visuals.
- */
-
- int nPixels; /* # of pixels allocated in above array. */
-
-
- GC gc; /* GC used to draw the image. */
-
- /*
- * The following arrays are used for DirectColor, PsuedoColor,
- * StaticColor, Greyscale, and StaticGrey visuals to convert RGB
- * triplets to a parts of a pixel index.
- */
- unsigned int rBits[256], gBits[256], bBits[256];
-
- /*
- * This following as used for TrueColor and DirectColor visuals
- * only. They are used to directly compute of pixel values from
- * picture RGB components.
- */
- unsigned int rAdjust, gAdjust, bAdjust;
- unsigned int rShift, gShift, bShift;
- unsigned int rMask, gMask, bMask;
-
- unsigned char gammaTable[256]; /* Input gamma lookup table. Used to
- * map non-linear monitor values back
- * to RGB values. This is used
- * whenever we take a snapshot of the
- * screen (e.g. alpha blending).
- * Computes the power mapping.
- * D = I^gamma. */
-
- unsigned char igammaTable[256]; /* Output gamma lookup table. Used to
- * map RGB values to non-linear
- * monitor values. Computes the
- * inverse power mapping.
- * I~ = D^1/gamma. */
-
- int isMonochrome; /* Indicates if the display uses a single
- * color component (e.g. 4-bit grayscale). */
-
- Blt_Pixel palette[256]; /* Maps the picture's 8-bit RGB values to the
- * RGB values of the colors actually
- * allocated. This is used for dithering the
- * picture. */
-
-} Painter;
-
-#define GC_PRIVATE 1 /* Indicates if the GC in the painter
- * was shared (allocated by Tk_GetGC)
- * or private (by XCreateGC). */
-
-static Tcl_FreeProc FreePainter;
-
-typedef struct _Blt_Picture Picture;
-
-#define GetBit(x, y) \
- srcBits[(srcBytesPerRow * (srcHeight - y - 1)) + (x>>3)] & (0x80 >> (x&7))
-#define SetBit(x, y) \
- destBits[(destBytesPerRow * (destHeight - y - 1)) + (x>>3)] |= (0x80 >>(x&7))
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindShift --
- *
- * Returns the position of the least significant (low) bit in
- * the given mask.
- *
- * For TrueColor and DirectColor visuals, a pixel value is
- * formed by OR-ing the red, green, and blue colormap indices
- * into a single 32-bit word. The visual's color masks tell
- * you where in the word the indices are supposed to be. The
- * masks contain bits only where the index is found. By counting
- * the leading zeros in the mask, we know how many bits to shift
- * to the individual red, green, and blue values to form a pixel.
- *
- * Results:
- * The number of the least significant bit.
- *
- *---------------------------------------------------------------------------
- */
-static int
-FindShift(unsigned int mask) /* 32-bit word */
-{
- int bit;
-
- for (bit = 0; bit < 32; bit++) {
- if (mask & (1 << bit)) {
- break;
- }
- }
- return bit;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CountBits --
- *
- * Returns the number of bits set in the given 32-bit mask.
- *
- * Reference: Graphics Gems Volume II.
- *
- * Results:
- * The number of bits to set in the mask.
- *
- *
- *---------------------------------------------------------------------------
- */
-static int
-CountBits(unsigned long mask) /* 32 1-bit tallies */
-{
- /* 16 2-bit tallies */
- mask = (mask & 0x55555555) + ((mask >> 1) & (0x55555555));
- /* 8 4-bit tallies */
- mask = (mask & 0x33333333) + ((mask >> 2) & (0x33333333));
- /* 4 8-bit tallies */
- mask = (mask & 0x07070707) + ((mask >> 4) & (0x07070707));
- /* 2 16-bit tallies */
- mask = (mask & 0x000F000F) + ((mask >> 8) & (0x000F000F));
- /* 1 32-bit tally */
- mask = (mask & 0x0000001F) + ((mask >> 16) & (0x0000001F));
- return mask;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeGammaTables --
- *
- * Initializes both the power and inverse power tables for the
- * painter with a given gamma value. These tables are used
- * to/from map linear RGB values to/from non-linear monitor
- * intensities.
- *
- * Results:
- * The *gammaTable* and *igammaTable* arrays are filled out to
- * contain the mapped values.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComputeGammaTables(Painter *painterPtr)
-{
- int i;
- double igamma, gamma;
-
- gamma = painterPtr->gamma;
- igamma = 1.0 / gamma;
- for (i = 0; i < 256; i++) {
- double x, y;
-
- y = i / 255.0;
- x = pow(y, gamma) * 255.0 + 0.5;
- painterPtr->gammaTable[i] = (unsigned char)CLAMP(x);
- x = pow(y, igamma) * 255.0 + 0.5;
- painterPtr->igammaTable[i] = (unsigned char)CLAMP(x);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * QueryPalette --
- *
- * Queries the X display server for the colors currently used in
- * the colormap. These values will then be used to map screen
- * pixels back to RGB values (see Blt_DrawableToPicture). The
- * queried non-linear color intensities are reverse mapped back
- * to to linear RGB values.
- *
- * Results:
- * The *palette* array is filled in with the RGB color values
- * of the colors allocated.
- *
- *---------------------------------------------------------------------------
- */
-static void
-QueryPalette(Painter *painterPtr, Blt_Pixel *palette)
-{
- Visual *visualPtr;
- XColor colors[256];
-
- visualPtr = painterPtr->visualPtr;
- assert(visualPtr->map_entries <= 256);
-
- if ((visualPtr->class == DirectColor) || (visualPtr->class == TrueColor)) {
- XColor *cp, *cend;
- unsigned int nRed, nGreen, nBlue;
- unsigned int r, g, b;
-
- r = g = b = 0;
- nRed = (painterPtr->rMask >> painterPtr->rShift) + 1;
- nGreen = (painterPtr->gMask >> painterPtr->gShift) + 1;
- nBlue = (painterPtr->bMask >> painterPtr->bShift) + 1;
-
- for (cp = colors, cend = cp + visualPtr->map_entries; cp < cend;
- cp++) {
- cp->pixel = ((r << painterPtr->rShift) |
- (g << painterPtr->gShift) |
- (b << painterPtr->bShift));
- cp->pad = 0;
- r++, b++, g++;
- if (r >= nRed) {
- r = 0;
- }
- if (g >= nGreen) {
- g = 0;
- }
- if (b >= nBlue) {
- b = 0;
- }
- }
- } else {
- XColor *cp;
- int i;
-
- for (cp = colors, i = 0; i < visualPtr->map_entries; i++, cp++) {
- cp->pixel = i;
- cp->pad = 0;
- }
- }
-
-#ifdef notdef
- /* FIXME */
- XQueryColors(painterPtr->display, painterPtr->colormap, colors,
- visualPtr->map_entries);
-#endif
- /* Scale to convert XColor component value (0..65535) to unsigned
- * char (0..255). */
- if (painterPtr->gamma == 1.0) {
- Blt_Pixel *dp, *dend;
- XColor *cp;
- double a;
-
- a = 1.0 / 257.0;
- cp = colors;
- for (dp = palette, dend = dp + visualPtr->map_entries; dp < dend;
- dp++) {
- dp->Red = (unsigned char)(cp->red * a + 0.5);
- dp->Green = (unsigned char)(cp->green * a + 0.5);
- dp->Blue = (unsigned char)(cp->blue * a + 0.5);
- cp++;
- }
- } else {
- Blt_Pixel *dp, *dend;
- XColor *cp;
- double a;
-
- a = 1.0 / 257.0;
- cp = colors;
- for (dp = palette, dend = dp + visualPtr->map_entries; dp < dend;
- dp++) {
- dp->Red = painterPtr->gammaTable[(int)(cp->red * a + 0.5)];
- dp->Green = painterPtr->gammaTable[(int)(cp->green * a + 0.5)];
- dp->Blue = painterPtr->gammaTable[(int)(cp->blue * a + 0.5)];
- cp++;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColorRamp --
- *
- * Computes a color ramp based upon the number of colors
- * available for each color component. It returns an array of
- * the desired colors (XColor structures). The screen gamma is
- * factored into the desired colors.
- *
- * Results:
- * Returns the number of colors desired. The *colors* array
- * is filled out to contain the component values.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColorRamp(Painter *painterPtr, XColor *colors)
-{
- int nColors;
- XColor *cp;
- double rScale, gScale, bScale;
- double igamma;
- int i;
-
- nColors = 0; /* Suppress compiler warning. */
-
- /*
- * Calculate the RGB coordinates of the colors we want to allocate
- * and store them in *colors.
- */
- igamma = 1.0 / painterPtr->gamma;
-
- rScale = 255.0 / (painterPtr->nRed - 1);
- gScale = 255.0 / (painterPtr->nGreen - 1);
- bScale = 255.0 / (painterPtr->nBlue - 1);
-
- switch (painterPtr->visualPtr->class) {
- case TrueColor:
- case DirectColor:
-
- nColors = MAX3(painterPtr->nRed, painterPtr->nGreen,painterPtr->nBlue);
- if (painterPtr->isMonochrome) {
- nColors = painterPtr->nBlue = painterPtr->nGreen = painterPtr->nRed;
- }
-
- /* Compute the 16-bit RGB values from each possible 8-bit
- * value. */
- cp = colors;
- for (i = 0; i < nColors; i++) {
- int r, g, b;
-
- r = (int)(i * rScale + 0.5);
- g = (int)(i * gScale + 0.5);
- b = (int)(i * bScale + 0.5);
-
- r = painterPtr->igammaTable[r];
- g = painterPtr->igammaTable[g];
- b = painterPtr->igammaTable[b];
-
- cp->red = (r << 8) + r;
- cp->green = (g << 8) + g;
- cp->blue = (b << 8) + b;
- cp++;
- }
- break;
-
- case PseudoColor:
- case StaticColor:
- case GrayScale:
- case StaticGray:
-
- nColors = (painterPtr->nRed * painterPtr->nGreen * painterPtr->nBlue);
- if (painterPtr->isMonochrome) {
- nColors = painterPtr->nRed;
- }
- if (!painterPtr->isMonochrome) {
- XColor *cp;
- int i;
-
- cp = colors;
- for (i = 0; i < painterPtr->nRed; i++) {
- int j;
- unsigned char r;
-
- r = (unsigned char)(i * rScale + 0.5);
- r = painterPtr->igammaTable[r];
- for (j = 0; j < painterPtr->nGreen; j++) {
- int k;
- unsigned int g;
-
- g = (unsigned char)(j * gScale + 0.5);
- g = painterPtr->igammaTable[g];
- for (k = 0; k < painterPtr->nBlue; k++) {
- unsigned int b;
-
- b = (unsigned char)(k * bScale + 0.5);
- b = painterPtr->igammaTable[b];
- cp->red = (r << 8) | r;
- cp->green = (g << 8) | g;
- cp->blue = (b << 8) | b;
- cp++;
- }
- }
- }
- }
- break;
-
- default: /* Monochrome */
- {
- XColor *cp;
- double scale;
- int i;
-
- scale = 255.0 / (nColors - 1);
-
- cp = colors;
- for (i = 0; i < nColors; ++i) {
- int c;
-
- c = (int)(i * scale + 0.5);
- c = painterPtr->igammaTable[c];
- cp->red = cp->green = cp->blue = (c << 8) | c;
- cp++;
- }
- }
- } /* end switch */
- return nColors;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AllocateColors --
- *
- * Individually allocates each of the desired colors (as
- * specified by the *colors* array). If a color can't be
- * allocated the desired colors allocated to that point as
- * released, the number of component intensities is reduced,
- * and 0 is returned.
- *
- * For TrueColor visuals, we don't need to allocate colors
- * at all, since we can compute them directly.
- *
- * Results:
- * Returns 1 if all desired colors were allocated successfully.
- * If unsuccessful, returns 0. All colors allocated up to that
- * point are freed and a smaller color palette size is computed
- * and reset in the painter structure.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AllocateColors(Painter *painterPtr, XColor *colors, int nColors)
-{
- if (painterPtr->visualPtr->class == TrueColor) {
- XColor *cp, *cend;
-
- /*
- * For TrueColor visuals, don't call XAllocColor, compute the
- * pixel value directly.
- */
- for (cp = colors, cend = cp + nColors; cp < cend; cp++) {
- unsigned int r, g, b;
-
- r = ((cp->red >> 8) >> painterPtr->rAdjust);
- g = ((cp->green >> 8) >> painterPtr->gAdjust);
- b = ((cp->blue >> 8) >> painterPtr->bAdjust);
-
- /* Shift each color into the proper location of the pixel index. */
- r = (r << painterPtr->rShift) & painterPtr->rMask;
- g = (g << painterPtr->gShift) & painterPtr->gMask;
- b = (b << painterPtr->bShift) & painterPtr->bMask;
- cp->pixel = (r | g | b);
- }
- painterPtr->nPixels = 0; /* This will indicate that we didn't
- * use XAllocColor to obtain pixel
- * values. */
- return TRUE;
- } else {
- int i;
- XColor *cp;
-
- cp = colors;
- for (i = 0; i < nColors; i++) {
- if (!XAllocColor(painterPtr->display, painterPtr->colormap, cp)){
- fprintf(stderr, "can't allocate color #%d: r=%x g=%x b=%x\n",
- i, cp->red, cp->green, cp->blue);
- break;
- }
-#ifdef notdef
- fprintf(stderr, "picture: allocated r=%x g=%x b=%x\n",
- colors[i].red, colors[i].green, colors[i].blue);
-#endif
- painterPtr->pixels[i] = cp->pixel;
- cp++;
- }
- painterPtr->nPixels = i; /* # of pixels in array */
- if (i == nColors) {
- fprintf(stderr, "painter palette %d/%d/%d colors okay\n",
- painterPtr->nRed, painterPtr->nGreen, painterPtr->nBlue);
- return TRUE; /* Success. */
- }
- }
- /*
- * If we didn't get all of the colors, free the current palette,
- * reduce the palette RGB component sizes.
- */
- fprintf(stderr, "can't allocate %d/%d/%d colors\n", painterPtr->nRed,
- painterPtr->nGreen, painterPtr->nBlue);
- XFreeColors(painterPtr->display, painterPtr->colormap, painterPtr->pixels,
- painterPtr->nPixels, 0);
-
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FillPalette --
- *
- * Base upon the colors allocated, generate two mappings from
- * the picture's 8-bit RGB components.
- *
- * 1) Map 8-bit RGB values to the bits of the pixel. Each component
- * contains a portion of the pixel value. For mapped visuals
- * (pseudocolor, staticcolor, grayscale, and staticgray) this
- * pixel value will be translated to the actual pixel used by
- * the display.
- *
- * 2) Map 8-bit RGB values to the actual color values used. The
- * color ramp generated may be only a subset of the possible
- * color values. The resulting palette is used in dithering the
- * image, using the error between the desired picture RGB value
- * and the actual value used.
- *
- * Results:
- * Color palette and pixel maps are filled in.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FillPalette(Painter *painterPtr, XColor *colors, int nColors)
-{
- painterPtr->nColors = nColors;
- if (!painterPtr->isMonochrome) {
- painterPtr->flags |= PAINER_COLOR_WINDOW;
-
- if ((painterPtr->visualPtr->class != DirectColor) &&
- (painterPtr->visualPtr->class != TrueColor)) {
- painterPtr->flags |= PAINTER_MAP_COLORS;
- }
- }
- if (painterPtr->isMonochrome) {
- int i;
-
- for (i = 0; i < 256; i++) {
- int c;
-
- c = (i + 127) / 255;
- painterPtr->rBits[i] = colors[c].pixel;
- painterPtr->palette[i].Blue = painterPtr->palette[i].Green =
- painterPtr->palette[i].Red = (unsigned char)(c * 255 + 0.5);
- }
- } else {
- int i, rMult;
- double rScale, gScale, bScale;
-
- rMult = painterPtr->nGreen * painterPtr->nBlue;
-
- rScale = 255.0 / (painterPtr->nRed - 1);
- gScale = 255.0 / (painterPtr->nGreen - 1);
- bScale = 255.0 / (painterPtr->nBlue - 1);
-
- for (i = 0; i < 256; i++) {
- int r, g, b;
-
- r = (i * (painterPtr->nRed - 1) + 127) / 255;
- g = (i * (painterPtr->nGreen - 1) + 127) / 255;
- b = (i * (painterPtr->nBlue - 1) + 127) / 255;
-
- if ((painterPtr->visualPtr->class == DirectColor) ||
- (painterPtr->visualPtr->class == TrueColor)) {
- painterPtr->rBits[i] = colors[r].pixel & painterPtr->rMask;
- painterPtr->gBits[i] = colors[g].pixel & painterPtr->gMask;
- painterPtr->bBits[i] = colors[b].pixel & painterPtr->bMask;
- } else {
- painterPtr->rBits[i] = r * rMult;
- painterPtr->gBits[i] = g * painterPtr->nBlue;
- painterPtr->bBits[i] = b;
- }
- painterPtr->palette[i].Red = (unsigned char)(r * rScale + 0.5);
- painterPtr->palette[i].Green = (unsigned char)(g * gScale + 0.5);
- painterPtr->palette[i].Blue = (unsigned char)(b * bScale + 0.5);
-#ifdef notdef
- fprintf(stderr, "picture: %d color=%x %x %x\n",
- i,
- painterPtr->palette[i].Red,
- painterPtr->palette[i].Green,
- painterPtr->palette[i].Blue);
-#endif
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AllocatePalette --
- *
- * This procedure allocates the colors required by a color table,
- * and sets up the fields in the color table data structure which
- * are used in dithering.
- *
- * This routine essentially mimics what is done in tkImgPhoto.c.
- * It's purpose is to allocate exactly the same color ramp as the
- * photo image. That way both image types can co-exist without
- * fighting over available colors.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Colors are allocated from the X server. The color palette
- * and pixel indices are updated.
- *
- *---------------------------------------------------------------------------
- */
-static void
-AllocatePalette(
- Painter *painterPtr) /* Pointer to the color table requiring
- * colors to be allocated. */
-{
- XColor colors[256];
- int nColors;
- static int stdPalettes[13][3] = {
- /* nRed, nGreen, nBlue */
- { 2, 2, 2 }, /* 3 bits, 8 colors */
- { 2, 3, 2 }, /* 4 bits, 12 colors */
- { 3, 4, 2 }, /* 5 bits, 24 colors */
- { 4, 5, 3 }, /* 6 bits, 60 colors */
- { 5, 6, 4 }, /* 7 bits, 120 colors */
- { 7, 7, 4 }, /* 8 bits, 198 colors */
- { 8, 10, 6 }, /* 9 bits, 480 colors */
- { 10, 12, 8 }, /* 10 bits, 960 colors */
- { 14, 15, 9 }, /* 11 bits, 1890 colors */
- { 16, 20, 12 }, /* 12 bits, 3840 colors */
- { 20, 24, 16 }, /* 13 bits, 7680 colors */
- { 26, 30, 20 }, /* 14 bits, 15600 colors */
- { 32, 32, 30 }, /* 15 bits, 30720 colors */
- };
-
- painterPtr->isMonochrome = FALSE;
- switch (painterPtr->visualPtr->class) {
- case TrueColor:
- case DirectColor:
- painterPtr->nRed = 1 << CountBits(painterPtr->rMask);
- painterPtr->nGreen = 1 << CountBits(painterPtr->gMask);
- painterPtr->nBlue = 1 << CountBits(painterPtr->bMask);
- break;
-
- case GrayScale:
- case StaticGray:
- case PseudoColor:
- case StaticColor:
- if (painterPtr->depth > 15) {
- painterPtr->nRed = painterPtr->nGreen = painterPtr->nBlue = 32;
- } else if (painterPtr->depth >= 3) {
- int *ip = stdPalettes[painterPtr->depth - 3];
- painterPtr->nRed = ip[0];
- painterPtr->nGreen = ip[1];
- painterPtr->nBlue = ip[2];
- }
- break;
-
- default:
- painterPtr->nGreen = painterPtr->nBlue = 0;
- painterPtr->nRed = 1 << painterPtr->depth;
- painterPtr->isMonochrome = TRUE;
- break;
- }
-
- /*
- * Each time around this loop, we reduce the number of colors
- * we're trying to allocate until we succeed in allocating all of
- * the colors we need.
- */
- for (;;) {
- /*
- * If we are using 1 bit/pixel, we don't need to allocate any
- * colors (we just use the foreground and background colors in
- * the GC).
- */
- if ((painterPtr->isMonochrome) && (painterPtr->nRed <= 2)) {
- painterPtr->flags |= BLACK_AND_WHITE;
- /* return; */
- }
- /*
- * Calculate the RGB values of a color ramp, given the some
- * number of red, green, blue intensities available.
- */
- nColors = ColorRamp(painterPtr, colors);
-
- /* Now try to allocate the colors we've calculated. */
-
- if (AllocateColors(painterPtr, colors, nColors)) {
- break; /* Success. */
- }
- if (!painterPtr->isMonochrome) {
- if ((painterPtr->nRed == 2) && (painterPtr->nGreen == 2) &&
- (painterPtr->nBlue == 2)) {
- break;
- /* Fall back to 1-bit monochrome display. */
- /* painterPtr->mono = TRUE; */
- } else {
- /*
- * Reduce the number of shades of each primary to
- * about 3/4 of the previous value. This will reduce
- * the total number of colors required to less than
- * half (27/64) the previous value for PseudoColor
- * displays.
- */
- painterPtr->nRed = (painterPtr->nRed * 3 + 2) / 4;
- painterPtr->nGreen = (painterPtr->nGreen * 3 + 2) / 4;
- painterPtr->nBlue = (painterPtr->nBlue * 3 + 2) / 4;
- }
- } else {
- painterPtr->nRed /= 2;
- }
- }
- FillPalette(painterPtr, colors, nColors);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewPainter --
- *
- * Creates a new painter to be used to paint pictures. Painters
- * are keyed by the combination of display, colormap, visual,
- * depth, and gamma value used.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- * Side Effects:
- * A color ramp is allocated (not true for TrueColor visuals).
- * Gamma tables are computed and filled.
- *
- *---------------------------------------------------------------------------
- */
-static Painter *
-NewPainter(PainterKey *keyPtr)
-{
- Painter *painterPtr;
-
- painterPtr = Blt_AssertCalloc(1, sizeof(Painter));
-
- painterPtr->colormap = keyPtr->colormap;
- painterPtr->depth = keyPtr->depth;
- painterPtr->display = keyPtr->display;
- painterPtr->gamma = keyPtr->gamma;
- painterPtr->visualPtr = keyPtr->visualPtr;
-
- painterPtr->refCount = 0;
- painterPtr->rMask = (unsigned int)painterPtr->visualPtr->red_mask;
- painterPtr->gMask = (unsigned int)painterPtr->visualPtr->green_mask;
- painterPtr->bMask = (unsigned int)painterPtr->visualPtr->blue_mask;
-
- painterPtr->rShift = FindShift(painterPtr->rMask);
- painterPtr->gShift = FindShift(painterPtr->gMask);
- painterPtr->bShift = FindShift(painterPtr->bMask);
-
- painterPtr->rAdjust = painterPtr->gAdjust = painterPtr->bAdjust = 0;
-
- {
- int nRedBits, nGreenBits, nBlueBits;
-
- nRedBits = CountBits(painterPtr->rMask);
- nGreenBits = CountBits(painterPtr->gMask);
- nBlueBits = CountBits(painterPtr->bMask);
- if (nRedBits < 8) {
- painterPtr->rAdjust = 8 - nRedBits;
- }
- if (nGreenBits < 8) {
- painterPtr->gAdjust = 8 - nGreenBits;
- }
- if (nBlueBits < 8) {
- painterPtr->bAdjust = 8 - nBlueBits;
- }
- }
- ComputeGammaTables(painterPtr);
- AllocatePalette(painterPtr);
- return painterPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreePainter --
- *
- * Called when the TCL interpreter is idle, this routine frees the
- * painter. Painters are reference counted. Only when no clients
- * are using the painter (the count is zero) is the painter
- * actually freed. By deferring its deletion, this allows client
- * code to call Blt_GetPainter after Blt_FreePainter without
- * incurring a performance penalty.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreePainter(DestroyData data)
-{
- Painter *painterPtr = (Painter *)data;
-
- if (painterPtr->refCount <= 0) {
- if (painterPtr->nColors > 0) {
- XFreeColors(painterPtr->display, painterPtr->colormap,
- painterPtr->pixels, painterPtr->nPixels, 0);
- }
- Blt_DeleteHashEntry(&painterTable, painterPtr->hashPtr);
- if (painterPtr->gc != NULL) {
- if (painterPtr->flags & GC_PRIVATE) {
- XFreeGC(painterPtr->display, painterPtr->gc);
- } else {
- Tk_FreeGC(painterPtr->display, painterPtr->gc);
- }
- painterPtr->gc = NULL;
- }
- Blt_Free(painterPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetPainter --
- *
- * Attempts to retrieve a painter for a particular combination of
- * display, colormap, visual, depth, and gamma value. If no
- * specific painter exists, then one is created.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- * Side Effects:
- * If no current painter exists, a new painter is added to the
- * hash table of painters. Otherwise, the current painter's
- * reference count is incremented indicated how many clients
- * are using the painter.
- *
- *---------------------------------------------------------------------------
- */
-static Painter *
-GetPainter(
- Display *display,
- Colormap colormap,
- Visual *visualPtr,
- int depth,
- double gamma)
-{
- Painter *painterPtr;
- PainterKey key;
- int isNew;
- Blt_HashEntry *hPtr;
-
- if (!initialized) {
- Blt_InitHashTable(&painterTable, sizeof(PainterKey) / sizeof(int));
- initialized = TRUE;
- }
- key.display = display;
- key.colormap = colormap;
- key.visualPtr = visualPtr;
- key.depth = depth;
- key.gamma = gamma;
-
- hPtr = Blt_CreateHashEntry(&painterTable, (char *)&key, &isNew);
- if (isNew) {
- painterPtr = NewPainter(&key);
- painterPtr->hashPtr = hPtr;
- Blt_SetHashValue(hPtr, painterPtr);
- } else {
- painterPtr = Blt_GetHashValue(hPtr);
- }
- painterPtr->refCount++;
- return painterPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPainterFromDrawable --
- *
- * Gets a painter for a particular combination of display,
- * colormap, visual, depth, and gamma value. This information is
- * retrieved from the drawable which is assumed to be a window.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- *---------------------------------------------------------------------------
- */
-Painter *
-Blt_GetPainterFromDrawable(
- Display *display,
- Drawable drawable,
- double gamma)
-{
- XGCValues gcValues;
- unsigned long gcMask;
- Painter *painterPtr;
- Colormap colormap;
- int screenNum;
- Visual *visual;
- int depth;
-
- screenNum = 0;
- /* Need colormap, visual, depth. */
- colormap = DefaultColormap(display, DefaultScreen(display));
- visual = DefaultVisual(display, screenNum);
- depth = DefaultDepth(display, screenNum);
- painterPtr = GetPainter(display, colormap, visual, depth, gamma);
-
- /*
- * Make a GC with background = black and foreground = white.
- */
- gcMask = GCGraphicsExposures;
- gcValues.graphics_exposures = False;
-
- painterPtr->gc = XCreateGC(display, drawable, gcMask, &gcValues);
- painterPtr->flags |= GC_PRIVATE;
- return painterPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPainter --
- *
- * Gets a painter for a particular combination of display,
- * colormap, visual, depth, and gamma value. This information
- * (except for the monitor's gamma value) is retrieved from the
- * given Tk window.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- *---------------------------------------------------------------------------
- */
-Painter *
-Blt_GetPainter(Tk_Window tkwin, double gamma)
-{
- Painter *painterPtr;
- XGCValues gcValues;
- unsigned long gcMask;
-
- painterPtr = GetPainter(Tk_Display(tkwin), Tk_Colormap(tkwin),
- Tk_Visual(tkwin), Tk_Depth(tkwin), gamma);
-
- /*
- * Make a GC with background = black and foreground = white.
- */
- gcMask = GCGraphicsExposures;
- gcValues.graphics_exposures = False;
- painterPtr->gc = Tk_GetGC(tkwin, gcMask, &gcValues);
- painterPtr->flags &= ~GC_PRIVATE;
- return painterPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FreePainter --
- *
- * Frees the painter. Painters are reference counted. Only when
- * no clients are using the painter (the count is zero) is the
- * painter actually freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FreePainter(Painter *painterPtr)
-{
- painterPtr->refCount--;
- if (painterPtr->refCount <= 0) {
- Tcl_EventuallyFree(painterPtr, FreePainter);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawableToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and
- * converts it to a picture.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred,
- * NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Picture
-DrawableToPicture(
- Painter *painterPtr,
- Drawable drawable,
- int x, int y,
- int width, int height) /* Dimension of the drawable. */
-{
- CGrafPtr saveWorld;
- GDHandle saveDevice;
- GWorldPtr srcPort, destPort;
- Picture *destPtr;
-
- srcPort = TkMacOSXGetDrawablePort(drawable);
- destPtr = Blt_CreatePicture(width, height);
- {
- Rect srcRect, destRect;
- MacDrawable dstDraw = (MacDrawable)drawable;
- PixMap pm;
-
- SetRect(&srcRect, x, y, x + width, y + height);
- SetRect(&destRect, 0, 0, width, height);
-
- GetGWorld(&saveWorld, &saveDevice);
- SetGWorld(srcPort, NULL);
-
- TkMacOSXSetUpClippingRgn(drawable);
-
- pm.bounds.left = pm.bounds.top = 0;
- pm.bounds.right = (short)width;
- pm.bounds.bottom = (short)height;
-
- pm.pixelType = RGBDirect;
- pm.pmVersion = baseAddr32; /* 32bit clean */
-
- pm.packType = pm.packSize = 0;
- pm.hRes = pm.vRes = 0x00480000; /* 72 dpi */
-
- pm.pixelSize = sizeof(Blt_Pixel) * 8; /* Bits per pixel. */
- pm.cmpCount = 3; /* 3 components for direct. */
- pm.cmpSize = 8; /* 8 bits per component. */
-
- pm.pixelFormat = k32ARGBPixelFormat;
- pm.pmTable = NULL;
- pm.pmExt = 0;
-
- pm.baseAddr = (Ptr)destPtr->bits;
- pm.rowBytes = destPtr->pixelsPerRow * sizeof(Blt_Pixel);
-
- pm.rowBytes |= 0x8000; /* Indicates structure a PixMap,
- * not a BitMap. */
-
- CopyBits(GetPortBitMapForCopyBits(destPort),
- (BitMap *)&pm, &srcRect, &destRect, srcCopy, NULL);
- }
- SetGWorld(saveWorld, saveDevice);
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_WindowToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and
- * converts it to a picture.
- *
- * This routine is used to snap foreign (non-Tk) windows. For
- * pixmaps and Tk windows, Blt_DrawableToPicture is preferred.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred,
- * NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Picture *
-Blt_WindowToPicture(
- Display *display,
- Drawable drawable,
- int x, int y, /* Offset of image from the drawable's
- * origin. */
- int width, int height, /* Dimension of the image. Image must
- * be completely contained by the
- * drawable. */
- double gamma)
-{
- Blt_Painter painter;
- Blt_Picture picture;
-
- painter = Blt_GetPainterFromDrawable(display, drawable, gamma);
- picture = DrawableToPicture(painter, drawable, x, y, width, height);
- Blt_FreePainter(painter);
- return picture;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawableToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and
- * converts it to a picture.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred,
- * NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Picture *
-Blt_DrawableToPicture(
- Tk_Window tkwin,
- Drawable drawable,
- int x, int y, /* Offset of image from the drawable's
- * origin. */
- int width, int height, /* Dimension of the image. Image must
- * be completely contained by the
- * drawable. */
- double gamma)
-{
- Blt_Painter painter;
- Blt_Picture picture;
-
- painter = Blt_GetPainter(tkwin, gamma);
- picture = DrawableToPicture(painter, drawable, x, y, width, height);
- Blt_FreePainter(painter);
- return picture;
-}
-
-
-Pixmap
-Blt_PhotoImageMask(
- Tk_Window tkwin,
- Tk_PhotoImageBlock src)
-{
- TkWinBitmap *twdPtr;
- int offset, count;
- int x, y;
- unsigned char *srcPtr;
- int destBytesPerRow;
- int destHeight;
- unsigned char *destBits;
-
- destBytesPerRow = ((src.width + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(src.height, destBytesPerRow);
- destHeight = src.height;
-
- offset = count = 0;
-
- /* FIXME: figure out why this is so! */
- for (y = src.height - 1; y >= 0; y--) {
- srcPtr = src.pixelPtr + offset;
- for (x = 0; x < src.width; x++) {
- if (srcPtr[src.offset[3]] == 0x00) {
- SetBit(x, y);
- count++;
- }
- srcPtr += src.pixelSize;
- }
- offset += src.pitch;
- }
- if (count > 0) {
- HBITMAP hBitmap;
- BITMAP bm;
-
- bm.bmType = 0;
- bm.bmWidth = src.width;
- bm.bmHeight = src.height;
- bm.bmWidthBytes = destBytesPerRow;
- bm.bmPlanes = 1;
- bm.bmBitsPixel = 1;
- bm.bmBits = destBits;
- hBitmap = CreateBitmapIndirect(&bm);
-
- twdPtr = Blt_AssertMalloc(sizeof(TkWinBitmap));
- twdPtr->type = TWD_BITMAP;
- twdPtr->handle = hBitmap;
- twdPtr->depth = 1;
- if (Tk_WindowId(tkwin) == None) {
- twdPtr->colormap = DefaultColormap(Tk_Display(tkwin),
- DefaultScreen(Tk_Display(tkwin)));
- } else {
- twdPtr->colormap = Tk_Colormap(tkwin);
- }
- } else {
- twdPtr = NULL;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- return (Pixmap)twdPtr;
-}
-
-Pixmap
-Blt_PictureMask(
- Tk_Window tkwin,
- Blt_Picture pict)
-{
- TkWinBitmap *twdPtr;
- int count;
- int x, y;
- Blt_Pixel *sp;
- int destBytesPerRow;
- int destWidth, destHeight;
- unsigned char *destBits;
-
- destWidth = Blt_PictureWidth(pict);
- destHeight = Blt_PictureHeight(pict);
- destBytesPerRow = ((destWidth + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(destHeight, destBytesPerRow);
- count = 0;
- sp = Blt_PictureBits(pict);
- for (y = 0; y < destHeight; y++) {
- for (x = 0; x < destWidth; x++) {
- if (sp->Alpha == 0x00) {
- SetBit(x, y);
- count++;
- }
- sp++;
- }
- }
- if (count > 0) {
- HBITMAP hBitmap;
- BITMAP bm;
-
- bm.bmType = 0;
- bm.bmWidth = Blt_PictureWidth(pict);
- bm.bmHeight = Blt_PictureHeight(pict);
- bm.bmWidthBytes = destBytesPerRow;
- bm.bmPlanes = 1;
- bm.bmBitsPixel = 1;
- bm.bmBits = destBits;
- hBitmap = CreateBitmapIndirect(&bm);
-
- twdPtr = Blt_AssertMalloc(sizeof(TkWinBitmap));
- twdPtr->type = TWD_BITMAP;
- twdPtr->handle = hBitmap;
- twdPtr->depth = 1;
- if (Tk_WindowId(tkwin) == None) {
- twdPtr->colormap = DefaultColormap(Tk_Display(tkwin),
- DefaultScreen(Tk_Display(tkwin)));
- } else {
- twdPtr->colormap = Tk_Colormap(tkwin);
- }
- } else {
- twdPtr = NULL;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- return (Pixmap)twdPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RotateBitmap --
- *
- * Creates a new bitmap containing the rotated image of the given
- * bitmap. We also need a special GC of depth 1, so that we do
- * not need to rotate more than one plane of the bitmap.
- *
- * Note that under Windows, monochrome bitmaps are stored
- * bottom-to-top. This is why the right angle rotations 0/180
- * and 90/270 look reversed.
- *
- * Results:
- * Returns a new bitmap containing the rotated image.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_RotateBitmap(
- Tk_Window tkwin,
- Pixmap srcBitmap, /* Source bitmap to be rotated */
- int srcWidth,
- int srcHeight, /* Width and height of the source bitmap */
- float angle, /* Right angle rotation to perform */
- int *destWidthPtr,
- int *destHeightPtr)
-{
- Display *display; /* X display */
- Window root; /* Root window drawable */
- Pixmap destBitmap;
- double rotWidth, rotHeight;
- HDC hDC;
- TkWinDCState state;
- int x, y; /* Destination bitmap coordinates */
- int sx, sy; /* Source bitmap coordinates */
- unsigned long pixel;
- HBITMAP hBitmap;
- int result;
- struct MonoBitmap {
- BITMAPINFOHEADER bi;
- RGBQUAD colors[2];
- } mb;
- int srcBytesPerRow, destBytesPerRow;
- int destWidth, destHeight;
- unsigned char *srcBits, *destBits;
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
- Blt_GetBoundingBox(srcWidth, srcHeight, angle, &rotWidth, &rotHeight,
- (Point2d *)NULL);
-
- destWidth = (int)ceil(rotWidth);
- destHeight = (int)ceil(rotHeight);
- destBitmap = Tk_GetPixmap(display, root, destWidth, destHeight, 1);
- if (destBitmap == None) {
- return None; /* Can't allocate pixmap. */
- }
- srcBits = Blt_GetBitmapData(display, srcBitmap, srcWidth, srcHeight,
- &srcBytesPerRow);
- if (srcBits == NULL) {
- OutputDebugString("Blt_GetBitmapData failed");
- return None;
- }
- destBytesPerRow = ((destWidth + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(destHeight, destBytesPerRow);
-
- angle = FMOD(angle, 360.0);
- if (FMOD(angle, (double)90.0) == 0.0) {
- int quadrant;
-
- /* Handle right-angle rotations specially. */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- for (y = 0; y < destHeight; y++) {
- sx = y;
- for (x = 0; x < destWidth; x++) {
- sy = destWidth - x - 1;
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_180: /* 180 degrees */
- for (y = 0; y < destHeight; y++) {
- sy = destHeight - y - 1;
- for (x = 0; x < destWidth; x++) {
- sx = destWidth - x - 1;
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_90: /* 90 degrees */
- for (y = 0; y < destHeight; y++) {
- sx = destHeight - y - 1;
- for (x = 0; x < destWidth; x++) {
- sy = x;
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_0: /* 0 degrees */
- for (y = 0; y < destHeight; y++) {
- for (x = 0; x < destWidth; x++) {
- pixel = GetBit(x, y);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- default:
- /* The calling routine should never let this happen. */
- break;
- }
- } else {
- double radians, sinTheta, cosTheta;
- double srcCX, srcCY; /* Center of source rectangle */
- double destCX, destCY; /* Center of destination rectangle */
- double tx, ty;
- double rx, ry; /* Angle of rotation for x and y coordinates */
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
-
- /*
- * Coordinates of the centers of the source and destination rectangles
- */
- srcCX = srcWidth * 0.5;
- srcCY = srcHeight * 0.5;
- destCX = destWidth * 0.5;
- destCY = destHeight * 0.5;
-
- /* Rotate each pixel of dest image, placing results in source image */
-
- for (y = 0; y < destHeight; y++) {
- ty = y - destCY;
- for (x = 0; x < destWidth; x++) {
-
- /* Translate origin to center of destination image */
- tx = x - destCX;
-
- /* Rotate the coordinates about the origin */
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source image */
- rx += srcCX;
- ry += srcCY;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination image can be
- * bigger than the source
- */
-
- if ((sx >= srcWidth) || (sx < 0) || (sy >= srcHeight) ||
- (sy < 0)) {
- continue;
- }
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- }
- hBitmap = ((TkWinDrawable *)destBitmap)->bitmap.handle;
- ZeroMemory(&mb, sizeof(mb));
- mb.bi.biSize = sizeof(BITMAPINFOHEADER);
- mb.bi.biPlanes = 1;
- mb.bi.biBitCount = 1;
- mb.bi.biCompression = BI_RGB;
- mb.bi.biWidth = destWidth;
- mb.bi.biHeight = destHeight;
- mb.bi.biSizeImage = destBytesPerRow * destHeight;
- mb.colors[0].rgbBlue = mb.colors[0].rgbRed = mb.colors[0].rgbGreen = 0x0;
- mb.colors[1].rgbBlue = mb.colors[1].rgbRed = mb.colors[1].rgbGreen = 0xFF;
- hDC = TkWinGetDrawableDC(display, destBitmap, &state);
- result = SetDIBits(hDC, hBitmap, 0, destHeight, (LPVOID)destBits,
- (BITMAPINFO *)&mb, DIB_RGB_COLORS);
- TkWinReleaseDrawableDC(destBitmap, hDC, &state);
- if (!result) {
-#if WINDEBUG
- PurifyPrintf("can't setDIBits: %s\n", Blt_LastError());
-#endif
- destBitmap = None;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- if (srcBits != NULL) {
- Blt_Free(srcBits);
- }
-
- *destWidthPtr = destWidth;
- *destHeightPtr = destHeight;
- return destBitmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ScaleBitmap --
- *
- * Creates a new scaled bitmap from another bitmap.
- *
- * Results:
- * The new scaled bitmap is returned.
- *
- * Side Effects:
- * A new pixmap is allocated. The caller must release this.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_ScaleBitmap(
- Tk_Window tkwin,
- Pixmap srcBitmap,
- int srcWidth,
- int srcHeight,
- int destWidth,
- int destHeight)
-{
- TkWinDCState srcState, destState;
- HDC src, dest;
- Pixmap destBitmap;
- Window root;
- Display *display;
-
- /* Create a new bitmap the size of the region and clear it */
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
- destBitmap = Tk_GetPixmap(display, root, destWidth, destHeight, 1);
- if (destBitmap == None) {
- return None;
- }
- src = TkWinGetDrawableDC(display, srcBitmap, &srcState);
- dest = TkWinGetDrawableDC(display, destBitmap, &destState);
-
- StretchBlt(dest, 0, 0, destWidth, destHeight, src, 0, 0,
- srcWidth, srcHeight, SRCCOPY);
-
- TkWinReleaseDrawableDC(srcBitmap, src, &srcState);
- TkWinReleaseDrawableDC(destBitmap, dest, &destState);
- return destBitmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ScaleRotateBitmapRegion --
- *
- * Creates a scaled and rotated bitmap from a given bitmap. The
- * caller also provides (offsets and dimensions) the region of
- * interest in the destination bitmap. This saves having to
- * process the entire destination bitmap is only part of it is
- * showing in the viewport.
- *
- * This uses a simple rotation/scaling of each pixel in the
- * destination image. For each pixel, the corresponding
- * pixel in the source bitmap is used. This means that
- * destination coordinates are first scaled to the size of
- * the rotated source bitmap. These coordinates are then
- * rotated back to their original orientation in the source.
- *
- * Results:
- * The new rotated and scaled bitmap is returned.
- *
- * Side Effects:
- * A new pixmap is allocated. The caller must release this.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_ScaleRotateBitmapRegion(
- Tk_Window tkwin,
- Pixmap srcBitmap, /* Source bitmap. */
- unsigned int srcWidth,
- unsigned int srcHeight, /* Size of source bitmap */
- int regionX,
- int regionY, /* Offset of region in virtual
- * destination bitmap. */
- unsigned int regionWidth,
- unsigned int regionHeight, /* Desire size of bitmap region. */
- unsigned int virtWidth,
- unsigned int virtHeight, /* Virtual size of destination bitmap. */
- float angle) /* Angle to rotate bitmap. */
-{
- Display *display; /* X display */
- Pixmap destBitmap;
- Window root; /* Root window drawable */
- double rWidth, rHeight;
- double xScale, yScale;
- int srcBytesPerRow, destBytesPerRow;
- int destHeight;
- int result;
- unsigned char *srcBits, *destBits;
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
-
- /* Create a bitmap and image big enough to contain the rotated text */
- destBitmap = Tk_GetPixmap(display, root, regionWidth, regionHeight, 1);
- if (destBitmap == None) {
- return None; /* Can't allocate pixmap. */
- }
- srcBits = Blt_GetBitmapData(display, srcBitmap, srcWidth, srcHeight,
- &srcBytesPerRow);
- if (srcBits == NULL) {
- OutputDebugString("Blt_GetBitmapData failed");
- return None;
- }
- destBytesPerRow = ((regionWidth + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(regionHeight, destBytesPerRow);
- destHeight = regionHeight;
-
- angle = FMOD(angle, 360.0);
- Blt_GetBoundingBox(srcWidth, srcHeight, angle, &rWidth, &rHeight,
- (Point2d *)NULL);
- xScale = rWidth / (double)virtWidth;
- yScale = rHeight / (double)virtHeight;
-
- if (FMOD(angle, (double)90.0) == 0.0) {
- int quadrant;
- int y;
-
- /* Handle right-angle rotations specifically */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sx, x;
-
- sx = (int)(yScale * (double)(y+regionY));
- for (x = 0; x < (int)regionWidth; x++) {
- unsigned long pixel;
- int sy;
-
- sy = (int)(xScale *(double)(virtWidth - (x+regionX) - 1));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_180: /* 180 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sy, x;
-
- sy = (int)(yScale * (double)(virtHeight - (y + regionY) - 1));
- for (x = 0; x < (int)regionWidth; x++) {
- unsigned long pixel;
- int sx;
-
- sx = (int)(xScale *(double)(virtWidth - (x+regionX) - 1));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_90: /* 90 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sx, x;
-
- sx = (int)(yScale * (double)(virtHeight - (y + regionY) - 1));
- for (x = 0; x < (int)regionWidth; x++) {
- int sy;
- unsigned long pixel;
-
- sy = (int)(xScale * (double)(x + regionX));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_0: /* 0 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sy, x;
-
- sy = (int)(yScale * (double)(y + regionY));
- for (x = 0; x < (int)regionWidth; x++) {
- int sx;
- unsigned long pixel;
-
- sx = (int)(xScale * (double)(x + regionX));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- default:
- /* The calling routine should never let this happen. */
- break;
- }
- } else {
- double radians, sinTheta, cosTheta;
- double scx, scy; /* Offset from the center of the
- * source rectangle. */
- double rcx, rcy; /* Offset to the center of the
- * rotated rectangle. */
- int y;
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
-
- /*
- * Coordinates of the centers of the source and destination rectangles
- */
- scx = srcWidth * 0.5;
- scy = srcHeight * 0.5;
- rcx = rWidth * 0.5;
- rcy = rHeight * 0.5;
-
- /* For each pixel of the destination image, transform back to the
- * associated pixel in the source image. */
-
- for (y = 0; y < (int)regionHeight; y++) {
- int x;
- double ty; /* Translated coordinates from center */
-
- ty = (yScale * (double)(y + regionY)) - rcy;
- for (x = 0; x < (int)regionWidth; x++) {
- double rx, ry; /* Angle of rotation for x and y coordinates */
- double tx; /* Translated coordinates from center */
- int sx, sy;
- unsigned long pixel;
-
- /* Translate origin to center of destination image. */
- tx = (xScale * (double)(x + regionX)) - rcx;
-
- /* Rotate the coordinates about the origin. */
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source image. */
- rx += scx;
- ry += scy;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination image can be
- * bigger than the source.
- */
-
- if ((sx >= (int)srcWidth) || (sx < 0) ||
- (sy >= (int)srcHeight) || (sy < 0)) {
- continue;
- }
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- }
- {
- HBITMAP hBitmap;
- HDC hDC;
- TkWinDCState state;
- struct MonoBitmap {
- BITMAPINFOHEADER bmiHeader;
- RGBQUAD colors[2];
- } mb;
-
- /* Write the rotated image into the destination bitmap. */
- hBitmap = ((TkWinDrawable *)destBitmap)->bitmap.handle;
- ZeroMemory(&mb, sizeof(mb));
- mb.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- mb.bmiHeader.biPlanes = 1;
- mb.bmiHeader.biBitCount = 1;
- mb.bmiHeader.biCompression = BI_RGB;
- mb.bmiHeader.biWidth = regionWidth;
- mb.bmiHeader.biHeight = regionHeight;
- mb.bmiHeader.biSizeImage = destBytesPerRow * regionHeight;
- mb.colors[0].rgbBlue = mb.colors[0].rgbRed = mb.colors[0].rgbGreen =
- 0x0;
- mb.colors[1].rgbBlue = mb.colors[1].rgbRed = mb.colors[1].rgbGreen =
- 0xFF;
- hDC = TkWinGetDrawableDC(display, destBitmap, &state);
- result = SetDIBits(hDC, hBitmap, 0, regionHeight, (LPVOID)destBits,
- (BITMAPINFO *)&mb, DIB_RGB_COLORS);
- TkWinReleaseDrawableDC(destBitmap, hDC, &state);
- }
- if (!result) {
-#if WINDEBUG
- PurifyPrintf("can't setDIBits: %s\n", Blt_LastError());
-#endif
- destBitmap = None;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- if (srcBits != NULL) {
- Blt_Free(srcBits);
- }
- return destBitmap;
-}
-
-#ifdef HAVE_IJL_H
-
-#include <ijl.h>
-
-Blt_Picture
-Blt_JPEGToPicture(interp, fileName)
- Tcl_Interp *interp;
- char *fileName;
-{
- JPEG_CORE_PROPERTIES jpgProps;
- Blt_Picture pict;
-
- ZeroMemory(&jpgProps, sizeof(JPEG_CORE_PROPERTIES));
- if(ijlInit(&jpgProps) != IJL_OK) {
- Tcl_AppendResult(interp, "can't initialize Intel JPEG library",
- (char *)NULL);
- return NULL;
- }
- jpgProps.JPGFile = fileName;
- if (ijlRead(&jpgProps, IJL_JFILE_READPARAMS) != IJL_OK) {
- Tcl_AppendResult(interp, "can't read JPEG file header from \"",
- fileName, "\" file.", (char *)NULL);
- goto error;
- }
-
- // !dudnik: to fix bug case 584680, [OT:287A305B]
- // Set the JPG color space ... this will always be
- // somewhat of an educated guess at best because JPEG
- // is "color blind" (i.e., nothing in the bit stream
- // tells you what color space the data was encoded from).
- // However, in this example we assume that we are
- // reading JFIF files which means that 3 channel images
- // are in the YCbCr color space and 1 channel images are
- // in the Y color space.
- switch(jpgProps.JPGChannels) {
- case 1:
- jpgProps.JPGColor = IJL_G;
- jpgProps.DIBChannels = 4;
- jpgProps.DIBColor = IJL_RGBA_FPX;
- break;
-
- case 3:
- jpgProps.JPGColor = IJL_YCBCR;
- jpgProps.DIBChannels = 4;
- jpgProps.DIBColor = IJL_RGBA_FPX;
- break;
-
- case 4:
- jpgProps.JPGColor = IJL_YCBCRA_FPX;
- jpgProps.DIBChannels = 4;
- jpgProps.DIBColor = IJL_RGBA_FPX;
- break;
-
- default:
- /* This catches everything else, but no color twist will be
- performed by the IJL. */
- jpgProps.DIBColor = (IJL_COLOR)IJL_OTHER;
- jpgProps.JPGColor = (IJL_COLOR)IJL_OTHER;
- jpgProps.DIBChannels = jpgProps.JPGChannels;
- break;
- }
-
- jpgProps.DIBWidth = jpgProps.JPGWidth;
- jpgProps.DIBHeight = jpgProps.JPGHeight;
- jpgProps.DIBPadBytes = IJL_DIB_PAD_BYTES(jpgProps.DIBWidth,
- jpgProps.DIBChannels);
-
- pict = Blt_CreatePicture(jpgProps.JPGWidth, jpgProps.JPGHeight);
-
- jpgProps.DIBBytes = (BYTE *)Blt_PictureBits(pict);
- if (ijlRead(&jpgProps, IJL_JFILE_READWHOLEIMAGE) != IJL_OK) {
- Tcl_AppendResult(interp, "can't read image data from \"", fileName,
- "\"", (char *)NULL);
- goto error;
- }
- if (ijlFree(&jpgProps) != IJL_OK) {
- Tcl_AppendResult(interp, "can't free Intel(R) JPEG library.",
- (char *)NULL);
- }
- return pict;
-
- error:
- ijlFree(&jpgProps);
- if (pict != NULL) {
- Blt_FreePicture(pict);
- }
- ijlFree(&jpgProps);
- return NULL;
-}
-
-#else
-
-#ifdef HAVE_JPEGLIB_H
-
-#undef HAVE_STDLIB_H
-#ifdef WIN32
-#define XMD_H 1
-#endif
-#include "jpeglib.h"
-#include <setjmp.h>
-
-typedef struct {
- struct jpeg_error_mgr pub; /* "public" fields */
- jmp_buf jmpBuf;
- Tcl_DString dString;
-} ReaderHandler;
-
-static void ErrorProc(j_common_ptr jpegInfo);
-static void MessageProc(j_common_ptr jpegInfo);
-
-/*
- * Here's the routine that will replace the standard error_exit method:
- */
-
-static void
-ErrorProc(jpgPtr)
- j_common_ptr jpgPtr;
-{
- ReaderHandler *handlerPtr = (ReaderHandler *)jpgPtr->err;
-
- (*handlerPtr->pub.output_message) (jpgPtr);
- longjmp(handlerPtr->jmpBuf, 1);
-}
-
-static void
-MessageProc(jpgPtr)
- j_common_ptr jpgPtr;
-{
- ReaderHandler *handlerPtr = (ReaderHandler *)jpgPtr->err;
- char buffer[JMSG_LENGTH_MAX];
-
- /* Create the message and append it into the dynamic string. */
- (*handlerPtr->pub.format_message) (jpgPtr, buffer);
- Tcl_DStringAppend(&handlerPtr->dString, " ", -1);
- Tcl_DStringAppend(&handlerPtr->dString, buffer, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_JPEGToPicture --
- *
- * Reads a JPEG file and converts it into a picture.
- *
- * Results:
- * The picture is returned. If an error occured, such
- * as the designated file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_JPEGToPicture(interp, fileName)
- Tcl_Interp *interp;
- char *fileName;
-{
- struct jpeg_decompress_struct jpg;
- Blt_Picture pict;
- unsigned int pictWidth, pictHeight;
- Blt_Pixel *dp;
- ReaderHandler handler;
- FILE *f;
- JSAMPLE **readBuffer;
- int row_stride;
- int i;
- JSAMPLE *bufPtr;
-
- f = Blt_OpenFile(interp, fileName, "rb");
- if (f == NULL) {
- return NULL;
- }
- pict = NULL;
-
- /* Step 1: allocate and initialize JPEG decompression object */
-
- /* We set up the normal JPEG error routines, then override error_exit. */
- jpg.dct_method = JDCT_IFAST;
- jpg.err = jpeg_std_error(&handler.pub);
- handler.pub.error_exit = ErrorProc;
- handler.pub.output_message = MessageProc;
-
- Tcl_DStringInit(&handler.dString);
- Tcl_DStringAppend(&handler.dString, "error reading \"", -1);
- Tcl_DStringAppend(&handler.dString, fileName, -1);
- Tcl_DStringAppend(&handler.dString, "\": ", -1);
-
- if (setjmp(handler.jmpBuf)) {
- jpeg_destroy_decompress(&jpg);
- fclose(f);
- Tcl_DStringResult(interp, &handler.dString);
- return NULL;
- }
- jpeg_create_decompress(&jpg);
- jpeg_stdio_src(&jpg, f);
-
- jpeg_read_header(&jpg, TRUE); /* Step 3: read file parameters */
-
- jpeg_start_decompress(&jpg); /* Step 5: Start decompressor */
- pictWidth = jpg.output_width;
- pictHeight = jpg.output_height;
- if ((pictWidth < 1) || (pictHeight < 1)) {
- Tcl_AppendResult(interp, "bad JPEG image size", (char *)NULL);
- fclose(f);
- return NULL;
- }
- /* JSAMPLEs per row in output buffer */
- row_stride = pictWidth * jpg.output_components;
-
- /* Make a one-row-high sample array that will go away when done
- * with image */
- readBuffer = (*jpg.mem->alloc_sarray) ((j_common_ptr)&jpg, JPOOL_IMAGE,
- row_stride, 1);
- pict = Blt_CreatePicture(pictWidth, pictHeight);
- dp = Blt_PictureBits(pict);
-
- if (jpg.output_components == 1) {
- while (jpg.output_scanline < pictHeight) {
- jpeg_read_scanlines(&jpg, readBuffer, 1);
- bufPtr = readBuffer[0];
- for (i = 0; i < (int)pictWidth; i++) {
- dp->Red = dp->Green = dp->Blue = *bufPtr++;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- }
- } else {
- while (jpg.output_scanline < pictHeight) {
- jpeg_read_scanlines(&jpg, readBuffer, 1);
- bufPtr = readBuffer[0];
- for (i = 0; i < (int)pictWidth; i++) {
- dp->Red = *bufPtr++;
- dp->Green = *bufPtr++;
- dp->Blue = *bufPtr++;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- }
- }
- jpeg_finish_decompress(&jpg); /* We can ignore the return value
- * since suspension is not
- * possible with the stdio data
- * source. */
- jpeg_destroy_decompress(&jpg);
-
-
- /*
- * After finish_decompress, we can close the input file. Here we
- * postpone it until after no more JPEG errors are possible, so as
- * to simplify the setjmp error logic above. (Actually, I don't
- * think that jpeg_destroy can do an error exit, but why assume
- * anything...)
- */
- fclose(f);
-
- /*
- * At this point you may want to check to see whether any corrupt-data
- * warnings occurred (test whether jerr.pub.num_warnings is nonzero).
- */
- if (handler.pub.num_warnings > 0) {
- Tcl_SetErrorCode(interp, "IMAGE", "JPEG",
- Tcl_DStringValue(&handler.dString), (char *)NULL);
- } else {
- Tcl_SetErrorCode(interp, "NONE", (char *)NULL);
- }
- /*
- * We're ready to call the Tk_Photo routines. They'll take the RGB
- * array we've processed to build the Tk image of the JPEG.
- */
- Tcl_DStringFree(&handler.dString);
- return pict;
-}
-
-#endif /* HAVE_JPEGLIB_H */
-#endif /* HAVE_IJL_H */
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaintPicture --
- *
- * Paints the picture to the given drawable. The region of
- * the picture is specified and the coordinates where in the
- * destination drawable is the image to be displayed.
- *
- * The image may be dithered depending upon the bit set in
- * the flags parameter: 0 no dithering, 1 for dithering.
- *
- * Results:
- * Returns TRUE is the picture was successfully display,
- * Otherwise FALSE is returned if the particular combination
- * visual and image depth is not handled.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PaintPicture(
- Painter *painterPtr,
- Drawable drawable,
- Picture *srcPtr,
- int srcX, int srcY, /* Coordinates of region in the
- * picture. */
- int width, int height, /* Dimension of the region. Region
- * cannot extend beyond the end of the
- * picture. */
- int destX, int destY, /* Coordinates of region in the
- * drawable. */
- unsigned int flags)
-{
- CGrafPtr saveWorld;
- GDHandle saveDevice;
- GWorldPtr destPort;
- Picture *ditherPtr;
-
- ditherPtr = NULL;
- if (flags & BLT_PAINTER_DITHER) {
- ditherPtr = Blt_DitherPicture(srcPtr, painterPtr->palette);
- if (ditherPtr != NULL) {
- srcPtr = ditherPtr;
- }
- }
-
- destPort = TkMacOSXGetDrawablePort(drawable);
- {
- Rect srcRect, destRect;
- MacDrawable dstDraw = (MacDrawable)drawable;
- PixMap pm;
-
- SetRect(&srcRect, srcX, srcY, srcX + width, srcY + height);
- SetRect(&destRect,
- destX + dstDraw->xOffset,
- destY + dstDraw->yOffset,
- destX + width + dstDraw->xOffset,
- destY + height + dstDraw->yOffset);
-
- GetGWorld(&saveWorld, &saveDevice);
- SetGWorld(destPort, NULL);
-
- TkMacOSXSetUpClippingRgn(drawable);
-
- pm.bounds.left = pm.bounds.top = 0;
- pm.bounds.right = (short)width;
- pm.bounds.bottom = (short)height;
-
- pm.pixelType = RGBDirect;
- pm.pmVersion = baseAddr32; /* 32bit clean */
-
- pm.packType = pm.packSize = 0;
- pm.hRes = pm.vRes = 0x00480000; /* 72 dpi */
-
- pm.pixelSize = sizeof(Blt_Pixel) * 8; /* Bits per pixel. */
- pm.cmpCount = 3; /* 3 components for direct. */
- pm.cmpSize = 8; /* 8 bits per component. */
-
- pm.pixelFormat = k32ARGBPixelFormat;
- pm.pmTable = NULL;
- pm.pmExt = 0;
-
- pm.baseAddr = (Ptr)srcPtr->bits;
- pm.rowBytes = srcPtr->pixelsPerRow * sizeof(Blt_Pixel);
-
- pm.rowBytes |= 0x8000; /* Indicates structure a PixMap,
- * not a BitMap. */
-
- CopyBits((BitMap *)&pm,
- GetPortBitMapForCopyBits(destPort),
- &srcRect, &destRect, srcCopy, NULL);
- }
- if (ditherPtr != NULL) {
- Blt_FreePicture(ditherPtr);
- }
- SetGWorld(saveWorld, saveDevice);
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaintPictureWithBlend --
- *
- * Blends and paints the picture with the given drawable. The
- * region of the picture is specified and the coordinates where
- * in the destination drawable is the image to be displayed.
- *
- * The background is snapped from the drawable and converted into
- * a picture. This picture is then blended with the current
- * picture (the background always assumed to be 100% opaque).
- *
- * Results:
- * Returns TRUE is the picture was successfully display,
- * Otherwise FALSE is returned. This may happen if the
- * background can not be obtained from the drawable.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PaintPictureWithBlend(
- Painter *painterPtr,
- Drawable drawable,
- Blt_Picture fg,
- int x, int y, /* Coordinates of region in the
- * picture. */
- int width, int height, /* Dimension of the region. Region
- * cannot extend beyond the end of the
- * picture. */
- int destX, int destY, /* Coordinates of region in the
- * drawable. */
- unsigned int flags,
- int alpha)
-{
- Blt_Picture bg;
-
- if (destX < 0) {
- width += destX;
- destX = 0;
- }
- if (destY < 0) {
- height += destY;
- destY = 0;
- }
- if ((width < 0) || (height < 0)) {
- return FALSE;
- }
- bg = DrawableToPicture(painterPtr, drawable, destX, destY, width, height);
- if (bg == NULL) {
- return FALSE;
- }
-#ifdef notdef
- Blt_FadePicture(bg, fg, x, y, width, height, 0, 0, alpha);
-#else
- Blt_BlendPictures(bg, fg, x, y, bg->width, bg->height, 0, 0);
-#endif
- PaintPicture(painterPtr, drawable, bg, 0, 0, bg->width, bg->height, destX,
- destY, flags);
- Blt_FreePicture(bg);
- return TRUE;
-}
-
-
-int
-Blt_PaintPicture(
- Blt_Painter painter,
- Drawable drawable,
- Blt_Picture picture,
- int x, int y, /* Coordinates of region in the
- * picture. */
- int width, int height, /* Dimension of the region. Region
- * cannot extend beyond the end of the
- * picture. */
- int destX, int destY, /* Coordinates of region in the
- * drawable. */
- unsigned int flags)
-{
- if ((picture == NULL) || (x >= Blt_PictureWidth(picture)) ||
- (y >= Blt_PictureHeight(picture))) {
- /* Nothing to draw. The region offset starts beyond the end of
- * the picture. */
- return TRUE;
- }
- if ((width + x) > Blt_PictureWidth(picture)) {
- width = Blt_PictureWidth(picture) - x;
- }
- if ((height + y) > Blt_PictureHeight(picture)) {
- height = Blt_PictureHeight(picture) - y;
- }
- if ((width <= 0) || (height <= 0)) {
- return TRUE;
- }
- if (Blt_IsOpaquePicture(picture)) {
- return PaintPicture(painter, drawable, picture, x, y, width, height,
- destX, destY, flags);
- } else {
- int alpha = 128;
-
- return PaintPictureWithBlend(painter, drawable, picture, x, y,
- width, height, destX, destY, flags, alpha);
- }
-}
-
-
-int
-Blt_PaintPictureWithBlend(
- Blt_Painter painter,
- Drawable drawable,
- Blt_Picture picture,
- int x, int y, /* Coordinates of region in the
- * picture. */
- int width, int height, /* Dimension of the region. Region
- * cannot extend beyond the end of the
- * picture. */
- int destX, int destY, /* Coordinates of region in the
- * drawable. */
- unsigned int flags, /* Indicates whether to dither the
- * picture before displaying. */
- double falpha)
-{
- int alpha;
-
- alpha = (int)(falpha * 255.0 + 0.5);
-
- assert((x >= 0) && (y >= 0));
- /* assert((destX >= 0) && (destY >= 0)); */
- assert((width >= 0) && (height >= 0));
-
- if ((x >= Blt_PictureWidth(picture)) || (y >= Blt_PictureHeight(picture))){
- /* Nothing to draw. The region offset starts beyond the end of
- * the picture. */
- return TRUE;
- }
- /*
- * Check that the region defined does not extend beyond the end of
- * the picture.
- *
- * Clip the end of the region if it is too big.
- */
- if ((width + x) > Blt_PictureWidth(picture)) {
- width = Blt_PictureWidth(picture) - x;
- }
- if ((height + y) > Blt_PictureHeight(picture)) {
- height = Blt_PictureHeight(picture) - y;
- }
- return PaintPictureWithBlend(painter, drawable, picture, x, y, width,
- height, destX, destY, flags, alpha);
-}
-
-
-GC
-Blt_PainterGC(Painter *painterPtr)
-{
- return painterPtr->gc;
-}
-
-int
-Blt_PainterDepth(Painter *painterPtr)
-{
- return painterPtr->depth;
-}
diff --git a/blt3.0.1/src/bltMacOSX.h b/blt3.0.1/src/bltMacOSX.h
deleted file mode 100644
index f4871d8..0000000
--- a/blt3.0.1/src/bltMacOSX.h
+++ /dev/null
@@ -1,71 +0,0 @@
-
-/*
- * bltMacOSX.h --
- *
- * Copyright 2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_MACOSX_H
-#define _BLT_MACOSX_H
-
-#ifdef MACOSX
-#define NO_CUTBUFFER 1
-#define NO_DND 1
-#define NO_BUSY 1
-#define NO_CONTAINER 1
-#endif
-/* #define NO_TED */
-
-#define XFlush(display)
-#define XFree(data) Blt_Free(data)
-
-
-#include <sys/cdefs.h>
-
-#ifdef __BIG_ENDIAN__
-#define WORDS_BIGENDIAN 1
-#else /* !__BIG_ENDIAN__ */
-/* #undef WORDS_BIGENDIAN */
-#endif /* __BIG_ENDIAN__ */
-
-#ifdef __LP64__
-#define SIZEOF_FLOAT 8
-#define SIZEOF_LONG 8
-#define SIZEOF_INT 4
-#define SIZEOF_LONG_LONG 8
-#define SIZEOF_VOID_P 8
-#else /* !__LP64__ */
-#define SIZEOF_FLOAT 4
-#define SIZEOF_LONG 4
-#define SIZEOF_INT 4
-#define SIZEOF_LONG_LONG 8
-#define SIZEOF_VOID_P 4
-#endif /* __LP64__ */
-
-#if defined (__i386__) || defined(__x86_64__)
-#define HAVE_X86 1
-#endif
-
-#endif /*_BLT_MACOSX_H*/
diff --git a/blt3.0.1/src/bltMacOSXPainter.c b/blt3.0.1/src/bltMacOSXPainter.c
deleted file mode 100644
index 3e715bb..0000000
--- a/blt3.0.1/src/bltMacOSXPainter.c
+++ /dev/null
@@ -1,1394 +0,0 @@
-
-/*
- * bltMacOSXPainter.c --
- *
- * This module implements MacOSX-specific image processing procedures
- * for the BLT toolkit.
- *
- * Copyright 1997-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltPicture.h"
-#include "bltPainter.h"
-#include <X11/Xutil.h>
-#include "tkDisplay.h"
-
-typedef struct _Blt_Picture Picture;
-
-#include <Carbon/Carbon.h>
-
-struct TkWindow;
-
-struct _MacDrawable {
- TkWindow *winPtr; /* Ptr to tk window or NULL if Pixmap */
- CGrafPtr grafPtr;
- ControlRef rootControl;
- int xOffset; /* X offset from toplevel window. */
- int yOffset; /* Y offset from toplevel window. */
- RgnHandle clipRgn; /* Visable region of window. */
- RgnHandle aboveClipRgn; /* Visable region of window and its
- * children. */
- int referenceCount; /* Don't delete toplevel until
- * children are gone. */
-
- /* Pointer to the toplevel datastruct. */
- struct _MacDrawable *toplevel;
- int flags; /* Various state see defines below. */
-};
-
-typedef struct _MacDrawable *MacDrawable;
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawableToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and
- * converts it to a picture.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred,
- * NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Picture
-DrawableToPicture(
- Painter *painterPtr,
- Drawable drawable,
- int x, int y,
- int width, int height) /* Dimension of the drawable. */
-{
- CGrafPtr saveWorld;
- GDHandle saveDevice;
- GWorldPtr srcPort;
- Picture *destPtr;
-
- srcPort = TkMacOSXGetDrawablePort(drawable);
- destPtr = Blt_CreatePicture(width, height);
- {
- Rect srcRect, destRect;
- MacDrawable dstDraw = (MacDrawable)drawable;
- PixMap pm;
-
- SetRect(&srcRect, x, y, x + width, y + height);
- SetRect(&destRect, 0, 0, width, height);
-
- GetGWorld(&saveWorld, &saveDevice);
- SetGWorld(srcPort, NULL);
-
- TkMacOSXSetUpClippingRgn(drawable);
-
- pm.bounds.left = pm.bounds.top = 0;
- pm.bounds.right = (short)width;
- pm.bounds.bottom = (short)height;
-
- pm.pixelType = RGBDirect;
- pm.pmVersion = baseAddr32; /* 32bit clean */
-
- pm.packType = pm.packSize = 0;
- pm.hRes = pm.vRes = 0x00480000; /* 72 dpi */
-
- pm.pixelSize = sizeof(Blt_Pixel) * 8; /* Bits per pixel. */
- pm.cmpCount = 3; /* 3 components for direct. */
- pm.cmpSize = 8; /* 8 bits per component. */
-
- pm.pixelFormat = k32ARGBPixelFormat;
- pm.pmTable = NULL;
- pm.pmExt = 0;
-
- pm.baseAddr = (Ptr)destPtr->bits;
- pm.rowBytes = destPtr->pixelsPerRow * sizeof(Blt_Pixel);
-
- pm.rowBytes |= 0x8000; /* Indicates structure a PixMap, not a
- * BitMap. */
-
- CopyBits(GetPortBitMapForCopyBits(destPort),
- (BitMap *)&pm, &srcRect, &destRect, srcCopy, NULL);
- }
- SetGWorld(saveWorld, saveDevice);
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_WindowToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and
- * converts it to a picture.
- *
- * This routine is used to snap foreign (non-Tk) windows. For
- * pixmaps and Tk windows, Blt_DrawableToPicture is preferred.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred,
- * NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Picture *
-Blt_WindowToPicture(
- Display *display,
- Drawable drawable,
- int x, int y, /* Offset of image from the drawable's
- * origin. */
- int width, int height, /* Dimension of the image. Image must
- * be completely contained by the
- * drawable. */
- double gamma)
-{
- Blt_Painter painter;
- Blt_Picture picture;
-
- painter = Blt_GetPainterFromDrawable(display, drawable, gamma);
- picture = DrawableToPicture(painter, drawable, x, y, width, height);
- Blt_FreePainter(painter);
- return picture;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawableToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and
- * converts it to a picture.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred,
- * NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Picture *
-Blt_DrawableToPicture(
- Tk_Window tkwin,
- Drawable drawable,
- int x, int y, /* Offset of image from the drawable's
- * origin. */
- int width, int height, /* Dimension of the image. Image must
- * be completely contained by the
- * drawable. */
- double gamma)
-{
- Blt_Painter painter;
- Blt_Picture picture;
-
- painter = Blt_GetPainter(tkwin, gamma);
- picture = DrawableToPicture(painter, drawable, x, y, width, height);
- Blt_FreePainter(painter);
- return picture;
-}
-
-
-Pixmap
-Blt_PhotoImageMask(
- Tk_Window tkwin,
- Tk_PhotoImageBlock src)
-{
- TkWinBitmap *twdPtr;
- int offset, count;
- int x, y;
- unsigned char *srcPtr;
- int destBytesPerRow;
- int destHeight;
- unsigned char *destBits;
-
- destBytesPerRow = ((src.width + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(src.height, destBytesPerRow);
- destHeight = src.height;
-
- offset = count = 0;
-
- /* FIXME: figure out why this is so! */
- for (y = src.height - 1; y >= 0; y--) {
- srcPtr = src.pixelPtr + offset;
- for (x = 0; x < src.width; x++) {
- if (srcPtr[src.offset[3]] == 0x00) {
- SetBit(x, y);
- count++;
- }
- srcPtr += src.pixelSize;
- }
- offset += src.pitch;
- }
- if (count > 0) {
- HBITMAP hBitmap;
- BITMAP bm;
-
- bm.bmType = 0;
- bm.bmWidth = src.width;
- bm.bmHeight = src.height;
- bm.bmWidthBytes = destBytesPerRow;
- bm.bmPlanes = 1;
- bm.bmBitsPixel = 1;
- bm.bmBits = destBits;
- hBitmap = CreateBitmapIndirect(&bm);
-
- twdPtr = Blt_AssertMalloc(sizeof(TkWinBitmap));
- twdPtr->type = TWD_BITMAP;
- twdPtr->handle = hBitmap;
- twdPtr->depth = 1;
- if (Tk_WindowId(tkwin) == None) {
- twdPtr->colormap = DefaultColormap(Tk_Display(tkwin),
- DefaultScreen(Tk_Display(tkwin)));
- } else {
- twdPtr->colormap = Tk_Colormap(tkwin);
- }
- } else {
- twdPtr = NULL;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- return (Pixmap)twdPtr;
-}
-
-Pixmap
-Blt_PictureMask(
- Tk_Window tkwin,
- Blt_Picture pict)
-{
- TkWinBitmap *twdPtr;
- int count;
- int x, y;
- Blt_Pixel *sp;
- int destBytesPerRow;
- int destWidth, destHeight;
- unsigned char *destBits;
-
- destWidth = Blt_PictureWidth(pict);
- destHeight = Blt_PictureHeight(pict);
- destBytesPerRow = ((destWidth + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(destHeight, destBytesPerRow);
- count = 0;
- sp = Blt_PictureBits(pict);
- for (y = 0; y < destHeight; y++) {
- for (x = 0; x < destWidth; x++) {
- if (sp->Alpha == 0x00) {
- SetBit(x, y);
- count++;
- }
- sp++;
- }
- }
- if (count > 0) {
- HBITMAP hBitmap;
- BITMAP bm;
-
- bm.bmType = 0;
- bm.bmWidth = Blt_PictureWidth(pict);
- bm.bmHeight = Blt_PictureHeight(pict);
- bm.bmWidthBytes = destBytesPerRow;
- bm.bmPlanes = 1;
- bm.bmBitsPixel = 1;
- bm.bmBits = destBits;
- hBitmap = CreateBitmapIndirect(&bm);
-
- twdPtr = Blt_AssertMalloc(sizeof(TkWinBitmap));
- twdPtr->type = TWD_BITMAP;
- twdPtr->handle = hBitmap;
- twdPtr->depth = 1;
- if (Tk_WindowId(tkwin) == None) {
- twdPtr->colormap = DefaultColormap(Tk_Display(tkwin),
- DefaultScreen(Tk_Display(tkwin)));
- } else {
- twdPtr->colormap = Tk_Colormap(tkwin);
- }
- } else {
- twdPtr = NULL;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- return (Pixmap)twdPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RotateBitmap --
- *
- * Creates a new bitmap containing the rotated image of the given
- * bitmap. We also need a special GC of depth 1, so that we do
- * not need to rotate more than one plane of the bitmap.
- *
- * Note that under Windows, monochrome bitmaps are stored
- * bottom-to-top. This is why the right angle rotations 0/180
- * and 90/270 look reversed.
- *
- * Results:
- * Returns a new bitmap containing the rotated image.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_RotateBitmap(
- Tk_Window tkwin,
- Pixmap srcBitmap, /* Source bitmap to be rotated */
- int srcWidth,
- int srcHeight, /* Width and height of the source bitmap */
- float angle, /* Right angle rotation to perform */
- int *destWidthPtr,
- int *destHeightPtr)
-{
- Display *display; /* X display */
- Window root; /* Root window drawable */
- Pixmap destBitmap;
- double rotWidth, rotHeight;
- HDC hDC;
- TkWinDCState state;
- int x, y; /* Destination bitmap coordinates */
- int sx, sy; /* Source bitmap coordinates */
- unsigned long pixel;
- HBITMAP hBitmap;
- int result;
- struct MonoBitmap {
- BITMAPINFOHEADER bi;
- RGBQUAD colors[2];
- } mb;
- int srcBytesPerRow, destBytesPerRow;
- int destWidth, destHeight;
- unsigned char *srcBits, *destBits;
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
- Blt_GetBoundingBox(srcWidth, srcHeight, angle, &rotWidth, &rotHeight,
- (Point2d *)NULL);
-
- destWidth = (int)ceil(rotWidth);
- destHeight = (int)ceil(rotHeight);
- destBitmap = Tk_GetPixmap(display, root, destWidth, destHeight, 1);
- if (destBitmap == None) {
- return None; /* Can't allocate pixmap. */
- }
- srcBits = Blt_GetBitmapData(display, srcBitmap, srcWidth, srcHeight,
- &srcBytesPerRow);
- if (srcBits == NULL) {
- OutputDebugString("Blt_GetBitmapData failed");
- return None;
- }
- destBytesPerRow = ((destWidth + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(destHeight, destBytesPerRow);
-
- angle = FMOD(angle, 360.0);
- if (FMOD(angle, (double)90.0) == 0.0) {
- int quadrant;
-
- /* Handle right-angle rotations specially. */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- for (y = 0; y < destHeight; y++) {
- sx = y;
- for (x = 0; x < destWidth; x++) {
- sy = destWidth - x - 1;
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_180: /* 180 degrees */
- for (y = 0; y < destHeight; y++) {
- sy = destHeight - y - 1;
- for (x = 0; x < destWidth; x++) {
- sx = destWidth - x - 1;
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_90: /* 90 degrees */
- for (y = 0; y < destHeight; y++) {
- sx = destHeight - y - 1;
- for (x = 0; x < destWidth; x++) {
- sy = x;
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_0: /* 0 degrees */
- for (y = 0; y < destHeight; y++) {
- for (x = 0; x < destWidth; x++) {
- pixel = GetBit(x, y);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- default:
- /* The calling routine should never let this happen. */
- break;
- }
- } else {
- double radians, sinTheta, cosTheta;
- double srcCX, srcCY; /* Center of source rectangle */
- double destCX, destCY; /* Center of destination rectangle */
- double tx, ty;
- double rx, ry; /* Angle of rotation for x and y coordinates */
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
-
- /*
- * Coordinates of the centers of the source and destination rectangles
- */
- srcCX = srcWidth * 0.5;
- srcCY = srcHeight * 0.5;
- destCX = destWidth * 0.5;
- destCY = destHeight * 0.5;
-
- /* Rotate each pixel of dest image, placing results in source image */
-
- for (y = 0; y < destHeight; y++) {
- ty = y - destCY;
- for (x = 0; x < destWidth; x++) {
-
- /* Translate origin to center of destination image */
- tx = x - destCX;
-
- /* Rotate the coordinates about the origin */
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source image */
- rx += srcCX;
- ry += srcCY;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination image can be
- * bigger than the source
- */
-
- if ((sx >= srcWidth) || (sx < 0) || (sy >= srcHeight) ||
- (sy < 0)) {
- continue;
- }
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- }
- hBitmap = ((TkWinDrawable *)destBitmap)->bitmap.handle;
- ZeroMemory(&mb, sizeof(mb));
- mb.bi.biSize = sizeof(BITMAPINFOHEADER);
- mb.bi.biPlanes = 1;
- mb.bi.biBitCount = 1;
- mb.bi.biCompression = BI_RGB;
- mb.bi.biWidth = destWidth;
- mb.bi.biHeight = destHeight;
- mb.bi.biSizeImage = destBytesPerRow * destHeight;
- mb.colors[0].rgbBlue = mb.colors[0].rgbRed = mb.colors[0].rgbGreen = 0x0;
- mb.colors[1].rgbBlue = mb.colors[1].rgbRed = mb.colors[1].rgbGreen = 0xFF;
- hDC = TkWinGetDrawableDC(display, destBitmap, &state);
- result = SetDIBits(hDC, hBitmap, 0, destHeight, (LPVOID)destBits,
- (BITMAPINFO *)&mb, DIB_RGB_COLORS);
- TkWinReleaseDrawableDC(destBitmap, hDC, &state);
- if (!result) {
-#if WINDEBUG
- PurifyPrintf("can't setDIBits: %s\n", Blt_LastError());
-#endif
- destBitmap = None;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- if (srcBits != NULL) {
- Blt_Free(srcBits);
- }
-
- *destWidthPtr = destWidth;
- *destHeightPtr = destHeight;
- return destBitmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ScaleBitmap --
- *
- * Creates a new scaled bitmap from another bitmap.
- *
- * Results:
- * The new scaled bitmap is returned.
- *
- * Side Effects:
- * A new pixmap is allocated. The caller must release this.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_ScaleBitmap(
- Tk_Window tkwin,
- Pixmap srcBitmap,
- int srcWidth,
- int srcHeight,
- int destWidth,
- int destHeight)
-{
- TkWinDCState srcState, destState;
- HDC src, dest;
- Pixmap destBitmap;
- Window root;
- Display *display;
-
- /* Create a new bitmap the size of the region and clear it */
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
- destBitmap = Tk_GetPixmap(display, root, destWidth, destHeight, 1);
- if (destBitmap == None) {
- return None;
- }
- src = TkWinGetDrawableDC(display, srcBitmap, &srcState);
- dest = TkWinGetDrawableDC(display, destBitmap, &destState);
-
- StretchBlt(dest, 0, 0, destWidth, destHeight, src, 0, 0,
- srcWidth, srcHeight, SRCCOPY);
-
- TkWinReleaseDrawableDC(srcBitmap, src, &srcState);
- TkWinReleaseDrawableDC(destBitmap, dest, &destState);
- return destBitmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ScaleRotateBitmapArea --
- *
- * Creates a scaled and rotated bitmap from a given bitmap. The
- * caller also provides (offsets and dimensions) the region of
- * interest in the destination bitmap. This saves having to
- * process the entire destination bitmap is only part of it is
- * showing in the viewport.
- *
- * This uses a simple rotation/scaling of each pixel in the
- * destination image. For each pixel, the corresponding
- * pixel in the source bitmap is used. This means that
- * destination coordinates are first scaled to the size of
- * the rotated source bitmap. These coordinates are then
- * rotated back to their original orientation in the source.
- *
- * Results:
- * The new rotated and scaled bitmap is returned.
- *
- * Side Effects:
- * A new pixmap is allocated. The caller must release this.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_ScaleRotateBitmapArea(
- Tk_Window tkwin,
- Pixmap srcBitmap, /* Source bitmap. */
- unsigned int srcWidth,
- unsigned int srcHeight, /* Size of source bitmap */
- int regionX,
- int regionY, /* Offset of region in virtual
- * destination bitmap. */
- unsigned int regionWidth,
- unsigned int regionHeight, /* Desire size of bitmap region. */
- unsigned int virtWidth,
- unsigned int virtHeight, /* Virtual size of destination bitmap. */
- float angle) /* Angle to rotate bitmap. */
-{
- Display *display; /* X display */
- Pixmap destBitmap;
- Window root; /* Root window drawable */
- double rWidth, rHeight;
- double xScale, yScale;
- int srcBytesPerRow, destBytesPerRow;
- int destHeight;
- int result;
- unsigned char *srcBits, *destBits;
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
-
- /* Create a bitmap and image big enough to contain the rotated text */
- destBitmap = Tk_GetPixmap(display, root, regionWidth, regionHeight, 1);
- if (destBitmap == None) {
- return None; /* Can't allocate pixmap. */
- }
- srcBits = Blt_GetBitmapData(display, srcBitmap, srcWidth, srcHeight,
- &srcBytesPerRow);
- if (srcBits == NULL) {
- OutputDebugString("Blt_GetBitmapData failed");
- return None;
- }
- destBytesPerRow = ((regionWidth + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(regionHeight, destBytesPerRow);
- destHeight = regionHeight;
-
- angle = FMOD(angle, 360.0);
- Blt_GetBoundingBox(srcWidth, srcHeight, angle, &rWidth, &rHeight,
- (Point2d *)NULL);
- xScale = rWidth / (double)virtWidth;
- yScale = rHeight / (double)virtHeight;
-
- if (FMOD(angle, (double)90.0) == 0.0) {
- int quadrant;
- int y;
-
- /* Handle right-angle rotations specifically */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sx, x;
-
- sx = (int)(yScale * (double)(y+regionY));
- for (x = 0; x < (int)regionWidth; x++) {
- unsigned long pixel;
- int sy;
-
- sy = (int)(xScale *(double)(virtWidth - (x+regionX) - 1));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_180: /* 180 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sy, x;
-
- sy = (int)(yScale * (double)(virtHeight - (y + regionY) - 1));
- for (x = 0; x < (int)regionWidth; x++) {
- unsigned long pixel;
- int sx;
-
- sx = (int)(xScale *(double)(virtWidth - (x+regionX) - 1));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_90: /* 90 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sx, x;
-
- sx = (int)(yScale * (double)(virtHeight - (y + regionY) - 1));
- for (x = 0; x < (int)regionWidth; x++) {
- int sy;
- unsigned long pixel;
-
- sy = (int)(xScale * (double)(x + regionX));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_0: /* 0 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sy, x;
-
- sy = (int)(yScale * (double)(y + regionY));
- for (x = 0; x < (int)regionWidth; x++) {
- int sx;
- unsigned long pixel;
-
- sx = (int)(xScale * (double)(x + regionX));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- default:
- /* The calling routine should never let this happen. */
- break;
- }
- } else {
- double radians, sinTheta, cosTheta;
- double scx, scy; /* Offset from the center of the
- * source rectangle. */
- double rcx, rcy; /* Offset to the center of the
- * rotated rectangle. */
- int y;
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
-
- /*
- * Coordinates of the centers of the source and destination rectangles
- */
- scx = srcWidth * 0.5;
- scy = srcHeight * 0.5;
- rcx = rWidth * 0.5;
- rcy = rHeight * 0.5;
-
- /* For each pixel of the destination image, transform back to the
- * associated pixel in the source image. */
-
- for (y = 0; y < (int)regionHeight; y++) {
- int x;
- double ty; /* Translated coordinates from center */
-
- ty = (yScale * (double)(y + regionY)) - rcy;
- for (x = 0; x < (int)regionWidth; x++) {
- double rx, ry; /* Angle of rotation for x and y coordinates */
- double tx; /* Translated coordinates from center */
- int sx, sy;
- unsigned long pixel;
-
- /* Translate origin to center of destination image. */
- tx = (xScale * (double)(x + regionX)) - rcx;
-
- /* Rotate the coordinates about the origin. */
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source image. */
- rx += scx;
- ry += scy;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination image can be
- * bigger than the source.
- */
-
- if ((sx >= (int)srcWidth) || (sx < 0) ||
- (sy >= (int)srcHeight) || (sy < 0)) {
- continue;
- }
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- }
- {
- HBITMAP hBitmap;
- HDC hDC;
- TkWinDCState state;
- struct MonoBitmap {
- BITMAPINFOHEADER bmiHeader;
- RGBQUAD colors[2];
- } mb;
-
- /* Write the rotated image into the destination bitmap. */
- hBitmap = ((TkWinDrawable *)destBitmap)->bitmap.handle;
- ZeroMemory(&mb, sizeof(mb));
- mb.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- mb.bmiHeader.biPlanes = 1;
- mb.bmiHeader.biBitCount = 1;
- mb.bmiHeader.biCompression = BI_RGB;
- mb.bmiHeader.biWidth = regionWidth;
- mb.bmiHeader.biHeight = regionHeight;
- mb.bmiHeader.biSizeImage = destBytesPerRow * regionHeight;
- mb.colors[0].rgbBlue = mb.colors[0].rgbRed = mb.colors[0].rgbGreen =
- 0x0;
- mb.colors[1].rgbBlue = mb.colors[1].rgbRed = mb.colors[1].rgbGreen =
- 0xFF;
- hDC = TkWinGetDrawableDC(display, destBitmap, &state);
- result = SetDIBits(hDC, hBitmap, 0, regionHeight, (LPVOID)destBits,
- (BITMAPINFO *)&mb, DIB_RGB_COLORS);
- TkWinReleaseDrawableDC(destBitmap, hDC, &state);
- }
- if (!result) {
-#if WINDEBUG
- PurifyPrintf("can't setDIBits: %s\n", Blt_LastError());
-#endif
- destBitmap = None;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- if (srcBits != NULL) {
- Blt_Free(srcBits);
- }
- return destBitmap;
-}
-
-#ifdef HAVE_IJL_H
-
-#include <ijl.h>
-
-Blt_Picture
-Blt_JPEGToPicture(interp, fileName)
- Tcl_Interp *interp;
- char *fileName;
-{
- JPEG_CORE_PROPERTIES jpgProps;
- Blt_Picture pict;
-
- ZeroMemory(&jpgProps, sizeof(JPEG_CORE_PROPERTIES));
- if(ijlInit(&jpgProps) != IJL_OK) {
- Tcl_AppendResult(interp, "can't initialize Intel JPEG library",
- (char *)NULL);
- return NULL;
- }
- jpgProps.JPGFile = fileName;
- if (ijlRead(&jpgProps, IJL_JFILE_READPARAMS) != IJL_OK) {
- Tcl_AppendResult(interp, "can't read JPEG file header from \"",
- fileName, "\" file.", (char *)NULL);
- goto error;
- }
-
- // !dudnik: to fix bug case 584680, [OT:287A305B]
- // Set the JPG color space ... this will always be
- // somewhat of an educated guess at best because JPEG
- // is "color blind" (i.e., nothing in the bit stream
- // tells you what color space the data was encoded from).
- // However, in this example we assume that we are
- // reading JFIF files which means that 3 channel images
- // are in the YCbCr color space and 1 channel images are
- // in the Y color space.
- switch(jpgProps.JPGChannels) {
- case 1:
- jpgProps.JPGColor = IJL_G;
- jpgProps.DIBChannels = 4;
- jpgProps.DIBColor = IJL_RGBA_FPX;
- break;
-
- case 3:
- jpgProps.JPGColor = IJL_YCBCR;
- jpgProps.DIBChannels = 4;
- jpgProps.DIBColor = IJL_RGBA_FPX;
- break;
-
- case 4:
- jpgProps.JPGColor = IJL_YCBCRA_FPX;
- jpgProps.DIBChannels = 4;
- jpgProps.DIBColor = IJL_RGBA_FPX;
- break;
-
- default:
- /* This catches everything else, but no color twist will be
- performed by the IJL. */
- jpgProps.DIBColor = (IJL_COLOR)IJL_OTHER;
- jpgProps.JPGColor = (IJL_COLOR)IJL_OTHER;
- jpgProps.DIBChannels = jpgProps.JPGChannels;
- break;
- }
-
- jpgProps.DIBWidth = jpgProps.JPGWidth;
- jpgProps.DIBHeight = jpgProps.JPGHeight;
- jpgProps.DIBPadBytes = IJL_DIB_PAD_BYTES(jpgProps.DIBWidth,
- jpgProps.DIBChannels);
-
- pict = Blt_CreatePicture(jpgProps.JPGWidth, jpgProps.JPGHeight);
-
- jpgProps.DIBBytes = (BYTE *)Blt_PictureBits(pict);
- if (ijlRead(&jpgProps, IJL_JFILE_READWHOLEIMAGE) != IJL_OK) {
- Tcl_AppendResult(interp, "can't read image data from \"", fileName,
- "\"", (char *)NULL);
- goto error;
- }
- if (ijlFree(&jpgProps) != IJL_OK) {
- Tcl_AppendResult(interp, "can't free Intel(R) JPEG library.",
- (char *)NULL);
- }
- return pict;
-
- error:
- ijlFree(&jpgProps);
- if (pict != NULL) {
- Blt_FreePicture(pict);
- }
- ijlFree(&jpgProps);
- return NULL;
-}
-
-#else
-
-#ifdef HAVE_JPEGLIB_H
-
-#undef HAVE_STDLIB_H
-#ifdef WIN32
-#define XMD_H 1
-#endif
-#include "jpeglib.h"
-#include <setjmp.h>
-
-typedef struct {
- struct jpeg_error_mgr pub; /* "public" fields */
- jmp_buf jmpBuf;
- Tcl_DString dString;
-} ReaderHandler;
-
-static void ErrorProc(j_common_ptr jpegInfo);
-static void MessageProc(j_common_ptr jpegInfo);
-
-/*
- * Here's the routine that will replace the standard error_exit method:
- */
-
-static void
-ErrorProc(jpgPtr)
- j_common_ptr jpgPtr;
-{
- ReaderHandler *handlerPtr = (ReaderHandler *)jpgPtr->err;
-
- (*handlerPtr->pub.output_message) (jpgPtr);
- longjmp(handlerPtr->jmpBuf, 1);
-}
-
-static void
-MessageProc(jpgPtr)
- j_common_ptr jpgPtr;
-{
- ReaderHandler *handlerPtr = (ReaderHandler *)jpgPtr->err;
- char buffer[JMSG_LENGTH_MAX];
-
- /* Create the message and append it into the dynamic string. */
- (*handlerPtr->pub.format_message) (jpgPtr, buffer);
- Tcl_DStringAppend(&handlerPtr->dString, " ", -1);
- Tcl_DStringAppend(&handlerPtr->dString, buffer, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_JPEGToPicture --
- *
- * Reads a JPEG file and converts it into a picture.
- *
- * Results:
- * The picture is returned. If an error occured, such
- * as the designated file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_JPEGToPicture(interp, fileName)
- Tcl_Interp *interp;
- char *fileName;
-{
- struct jpeg_decompress_struct jpg;
- Blt_Picture pict;
- unsigned int pictWidth, pictHeight;
- Blt_Pixel *dp;
- ReaderHandler handler;
- FILE *f;
- JSAMPLE **readBuffer;
- int row_stride;
- int i;
- JSAMPLE *bufPtr;
-
- f = Blt_OpenFile(interp, fileName, "rb");
- if (f == NULL) {
- return NULL;
- }
- pict = NULL;
-
- /* Step 1: allocate and initialize JPEG decompression object */
-
- /* We set up the normal JPEG error routines, then override error_exit. */
- jpg.dct_method = JDCT_IFAST;
- jpg.err = jpeg_std_error(&handler.pub);
- handler.pub.error_exit = ErrorProc;
- handler.pub.output_message = MessageProc;
-
- Tcl_DStringInit(&handler.dString);
- Tcl_DStringAppend(&handler.dString, "error reading \"", -1);
- Tcl_DStringAppend(&handler.dString, fileName, -1);
- Tcl_DStringAppend(&handler.dString, "\": ", -1);
-
- if (setjmp(handler.jmpBuf)) {
- jpeg_destroy_decompress(&jpg);
- fclose(f);
- Tcl_DStringResult(interp, &handler.dString);
- return NULL;
- }
- jpeg_create_decompress(&jpg);
- jpeg_stdio_src(&jpg, f);
-
- jpeg_read_header(&jpg, TRUE); /* Step 3: read file parameters */
-
- jpeg_start_decompress(&jpg); /* Step 5: Start decompressor */
- pictWidth = jpg.output_width;
- pictHeight = jpg.output_height;
- if ((pictWidth < 1) || (pictHeight < 1)) {
- Tcl_AppendResult(interp, "bad JPEG image size", (char *)NULL);
- fclose(f);
- return NULL;
- }
- /* JSAMPLEs per row in output buffer */
- row_stride = pictWidth * jpg.output_components;
-
- /* Make a one-row-high sample array that will go away when done
- * with image */
- readBuffer = (*jpg.mem->alloc_sarray) ((j_common_ptr)&jpg, JPOOL_IMAGE,
- row_stride, 1);
- pict = Blt_CreatePicture(pictWidth, pictHeight);
- dp = Blt_PictureBits(pict);
-
- if (jpg.output_components == 1) {
- while (jpg.output_scanline < pictHeight) {
- jpeg_read_scanlines(&jpg, readBuffer, 1);
- bufPtr = readBuffer[0];
- for (i = 0; i < (int)pictWidth; i++) {
- dp->Red = dp->Green = dp->Blue = *bufPtr++;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- }
- } else {
- while (jpg.output_scanline < pictHeight) {
- jpeg_read_scanlines(&jpg, readBuffer, 1);
- bufPtr = readBuffer[0];
- for (i = 0; i < (int)pictWidth; i++) {
- dp->Red = *bufPtr++;
- dp->Green = *bufPtr++;
- dp->Blue = *bufPtr++;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- }
- }
- jpeg_finish_decompress(&jpg); /* We can ignore the return value
- * since suspension is not
- * possible with the stdio data
- * source. */
- jpeg_destroy_decompress(&jpg);
-
-
- /*
- * After finish_decompress, we can close the input file. Here we
- * postpone it until after no more JPEG errors are possible, so as
- * to simplify the setjmp error logic above. (Actually, I don't
- * think that jpeg_destroy can do an error exit, but why assume
- * anything...)
- */
- fclose(f);
-
- /*
- * At this point you may want to check to see whether any corrupt-data
- * warnings occurred (test whether jerr.pub.num_warnings is nonzero).
- */
- if (handler.pub.num_warnings > 0) {
- Tcl_SetErrorCode(interp, "IMAGE", "JPEG",
- Tcl_DStringValue(&handler.dString), (char *)NULL);
- } else {
- Tcl_SetErrorCode(interp, "NONE", (char *)NULL);
- }
- /*
- * We're ready to call the Tk_Photo routines. They'll take the RGB
- * array we've processed to build the Tk image of the JPEG.
- */
- Tcl_DStringFree(&handler.dString);
- return pict;
-}
-
-#endif /* HAVE_JPEGLIB_H */
-#endif /* HAVE_IJL_H */
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaintPicture --
- *
- * Paints the picture to the given drawable. The region of
- * the picture is specified and the coordinates where in the
- * destination drawable is the image to be displayed.
- *
- * The image may be dithered depending upon the bit set in
- * the flags parameter: 0 no dithering, 1 for dithering.
- *
- * Results:
- * Returns TRUE is the picture was successfully display,
- * Otherwise FALSE is returned if the particular combination
- * visual and image depth is not handled.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PaintPicture(
- Painter *painterPtr,
- Drawable drawable,
- Picture *srcPtr,
- int srcX, int srcY, /* Coordinates of region in the
- * picture. */
- int width, int height, /* Dimension of the region. Area
- * cannot extend beyond the end of the
- * picture. */
- int destX, int destY, /* Coordinates of region in the
- * drawable. */
- unsigned int flags)
-{
- CGrafPtr saveWorld;
- GDHandle saveDevice;
- GWorldPtr destPort;
- Picture *ditherPtr;
-
- ditherPtr = NULL;
- if (flags & BLT_PAINTER_DITHER) {
- ditherPtr = Blt_DitherPicture(srcPtr, painterPtr->palette);
- if (ditherPtr != NULL) {
- srcPtr = ditherPtr;
- }
- }
-
- destPort = TkMacOSXGetDrawablePort(drawable);
- {
- Rect srcRect, destRect;
- MacDrawable dstDraw = (MacDrawable)drawable;
- PixMap pm;
-
- SetRect(&srcRect, srcX, srcY, srcX + width, srcY + height);
- SetRect(&destRect,
- destX + dstDraw->xOffset,
- destY + dstDraw->yOffset,
- destX + width + dstDraw->xOffset,
- destY + height + dstDraw->yOffset);
-
- GetGWorld(&saveWorld, &saveDevice);
- SetGWorld(destPort, NULL);
-
- TkMacOSXSetUpClippingRgn(drawable);
-
- pm.bounds.left = pm.bounds.top = 0;
- pm.bounds.right = (short)width;
- pm.bounds.bottom = (short)height;
-
- pm.pixelType = RGBDirect;
- pm.pmVersion = baseAddr32; /* 32bit clean */
-
- pm.packType = pm.packSize = 0;
- pm.hRes = pm.vRes = 0x00480000; /* 72 dpi */
-
- pm.pixelSize = sizeof(Blt_Pixel) * 8; /* Bits per pixel. */
- pm.cmpCount = 3; /* 3 components for direct. */
- pm.cmpSize = 8; /* 8 bits per component. */
-
- pm.pixelFormat = k32ARGBPixelFormat;
- pm.pmTable = NULL;
- pm.pmExt = 0;
-
- pm.baseAddr = (Ptr)srcPtr->bits;
- pm.rowBytes = srcPtr->pixelsPerRow * sizeof(Blt_Pixel);
-
- pm.rowBytes |= 0x8000; /* Indicates structure a PixMap,
- * not a BitMap. */
- CopyBits((BitMap *)&pm,
- GetPortBitMapForCopyBits(destPort),
- &srcRect, &destRect, srcCopy, NULL);
- }
- if (ditherPtr != NULL) {
- Blt_FreePicture(ditherPtr);
- }
- SetGWorld(saveWorld, saveDevice);
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaintPictureWithBlend --
- *
- * Blends and paints the picture with the given drawable. The
- * region of the picture is specified and the coordinates where
- * in the destination drawable is the image to be displayed.
- *
- * The background is snapped from the drawable and converted into
- * a picture. This picture is then blended with the current
- * picture (the background always assumed to be 100% opaque).
- *
- * Results:
- * Returns TRUE is the picture was successfully display,
- * Otherwise FALSE is returned. This may happen if the
- * background can not be obtained from the drawable.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PaintPictureWithBlend(
- Painter *painterPtr,
- Drawable drawable,
- Blt_Picture fg,
- int x, int y, /* Coordinates of region in the
- * picture. */
- int width, int height, /* Dimension of the region. Area
- * cannot extend beyond the end of the
- * picture. */
- int destX, int destY, /* Coordinates of region in the
- * drawable. */
- unsigned int flags,
- int alpha)
-{
- Blt_Picture bg;
-
- if (destX < 0) {
- width += destX;
- destX = 0;
- }
- if (destY < 0) {
- height += destY;
- destY = 0;
- }
- if ((width < 0) || (height < 0)) {
- return FALSE;
- }
- bg = DrawableToPicture(painterPtr, drawable, destX, destY, width, height);
- if (bg == NULL) {
- return FALSE;
- }
-#ifdef notdef
- Blt_FadePicture(bg, fg, x, y, width, height, 0, 0, alpha);
-#else
- Blt_BlendPictures(bg, fg, x, y, bg->width, bg->height, 0, 0);
-#endif
- PaintPicture(painterPtr, drawable, bg, 0, 0, bg->width, bg->height, destX,
- destY, flags);
- Blt_FreePicture(bg);
- return TRUE;
-}
-
-
-int
-Blt_PaintPicture(
- Blt_Painter painter,
- Drawable drawable,
- Blt_Picture picture,
- int x, int y, /* Coordinates of region in the
- * picture. */
- int width, int height, /* Dimension of the region. Area
- * cannot extend beyond the end of the
- * picture. */
- int destX, int destY, /* Coordinates of region in the
- * drawable. */
- unsigned int flags)
-{
- if ((picture == NULL) || (x >= Blt_PictureWidth(picture)) ||
- (y >= Blt_PictureHeight(picture))) {
- /* Nothing to draw. The region offset starts beyond the end of
- * the picture. */
- return TRUE;
- }
- if ((width + x) > Blt_PictureWidth(picture)) {
- width = Blt_PictureWidth(picture) - x;
- }
- if ((height + y) > Blt_PictureHeight(picture)) {
- height = Blt_PictureHeight(picture) - y;
- }
- if ((width <= 0) || (height <= 0)) {
- return TRUE;
- }
- if (Blt_PictureIsOpaque(picture)) {
- return PaintPicture(painter, drawable, picture, x, y, width, height,
- destX, destY, flags);
- } else {
- int alpha = 128;
-
- return PaintPictureWithBlend(painter, drawable, picture, x, y,
- width, height, destX, destY, flags, alpha);
- }
-}
-
-
-int
-Blt_PaintPictureWithBlend(
- Blt_Painter painter,
- Drawable drawable,
- Blt_Picture picture,
- int x, int y, /* Coordinates of region in the
- * picture. */
- int width, int height, /* Dimension of the region. Area
- * cannot extend beyond the end of the
- * picture. */
- int destX, int destY, /* Coordinates of region in the
- * drawable. */
- unsigned int flags, /* Indicates whether to dither the
- * picture before displaying. */
- double falpha)
-{
- int alpha;
-
- alpha = (int)(falpha * 255.0 + 0.5);
-
- assert((x >= 0) && (y >= 0));
- /* assert((destX >= 0) && (destY >= 0)); */
- assert((width >= 0) && (height >= 0));
-
- if ((x >= Blt_PictureWidth(picture)) || (y >= Blt_PictureHeight(picture))){
- /* Nothing to draw. The region offset starts beyond the end of
- * the picture. */
- return TRUE;
- }
- /*
- * Check that the region defined does not extend beyond the end of
- * the picture.
- *
- * Clip the end of the region if it is too big.
- */
- if ((width + x) > Blt_PictureWidth(picture)) {
- width = Blt_PictureWidth(picture) - x;
- }
- if ((height + y) > Blt_PictureHeight(picture)) {
- height = Blt_PictureHeight(picture) - y;
- }
- return PaintPictureWithBlend(painter, drawable, picture, x, y, width,
- height, destX, destY, flags, alpha);
-}
-
-
-GC
-Blt_PainterGC(Painter *painterPtr)
-{
- return painterPtr->gc;
-}
-
-int
-Blt_PainterDepth(Painter *painterPtr)
-{
- return painterPtr->depth;
-}
diff --git a/blt3.0.1/src/bltMacPainter.c b/blt3.0.1/src/bltMacPainter.c
deleted file mode 100644
index 0f2c0d6..0000000
--- a/blt3.0.1/src/bltMacPainter.c
+++ /dev/null
@@ -1,1394 +0,0 @@
-
-/*
- * bltMacOSXPainter.c --
- *
- * This module implements MacOSX-specific image processing procedures
- * for the BLT toolkit.
- *
- * Copyright 1997-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltPicture.h"
-#include "bltPainter.h"
-#include <X11/Xutil.h>
-#include "tkDisplay.h"
-
-typedef struct _Blt_Picture Picture;
-
-#include <Carbon/Carbon.h>
-
-struct TkWindow;
-
-struct _MacDrawable {
- TkWindow *winPtr; /* Ptr to tk window or NULL if Pixmap */
- CGrafPtr grafPtr;
- ControlRef rootControl;
- int xOffset; /* X offset from toplevel window. */
- int yOffset; /* Y offset from toplevel window. */
- RgnHandle clipRgn; /* Visable region of window. */
- RgnHandle aboveClipRgn; /* Visable region of window and its
- * children. */
- int referenceCount; /* Don't delete toplevel until
- * children are gone. */
-
- /* Pointer to the toplevel datastruct. */
- struct _MacDrawable *toplevel;
- int flags; /* Various state see defines below. */
-};
-
-typedef struct _MacDrawable *MacDrawable;
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawableToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and
- * converts it to a picture.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred,
- * NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Picture
-DrawableToPicture(
- Painter *painterPtr,
- Drawable drawable,
- int x, int y,
- int width, int height) /* Dimension of the drawable. */
-{
- CGrafPtr saveWorld;
- GDHandle saveDevice;
- GWorldPtr srcPort;
- Picture *destPtr;
-
- srcPort = TkMacOSXGetDrawablePort(drawable);
- destPtr = Blt_CreatePicture(width, height);
- {
- Rect srcRect, destRect;
- MacDrawable dstDraw = (MacDrawable)drawable;
- PixMap pm;
-
- SetRect(&srcRect, x, y, x + width, y + height);
- SetRect(&destRect, 0, 0, width, height);
-
- GetGWorld(&saveWorld, &saveDevice);
- SetGWorld(srcPort, NULL);
-
- TkMacOSXSetUpClippingRgn(drawable);
-
- pm.bounds.left = pm.bounds.top = 0;
- pm.bounds.right = (short)width;
- pm.bounds.bottom = (short)height;
-
- pm.pixelType = RGBDirect;
- pm.pmVersion = baseAddr32; /* 32bit clean */
-
- pm.packType = pm.packSize = 0;
- pm.hRes = pm.vRes = 0x00480000; /* 72 dpi */
-
- pm.pixelSize = sizeof(Blt_Pixel) * 8; /* Bits per pixel. */
- pm.cmpCount = 3; /* 3 components for direct. */
- pm.cmpSize = 8; /* 8 bits per component. */
-
- pm.pixelFormat = k32ARGBPixelFormat;
- pm.pmTable = NULL;
- pm.pmExt = 0;
-
- pm.baseAddr = (Ptr)destPtr->bits;
- pm.rowBytes = destPtr->pixelsPerRow * sizeof(Blt_Pixel);
-
- pm.rowBytes |= 0x8000; /* Indicates structure a PixMap,
- * not a BitMap. */
-
- CopyBits(GetPortBitMapForCopyBits(destPort),
- (BitMap *)&pm, &srcRect, &destRect, srcCopy, NULL);
- }
- SetGWorld(saveWorld, saveDevice);
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_WindowToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and
- * converts it to a picture.
- *
- * This routine is used to snap foreign (non-Tk) windows. For
- * pixmaps and Tk windows, Blt_DrawableToPicture is preferred.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred,
- * NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Picture *
-Blt_WindowToPicture(
- Display *display,
- Drawable drawable,
- int x, int y, /* Offset of image from the drawable's
- * origin. */
- int width, int height, /* Dimension of the image. Image must
- * be completely contained by the
- * drawable. */
- double gamma)
-{
- Blt_Painter painter;
- Blt_Picture picture;
-
- painter = Blt_GetPainterFromDrawable(display, drawable, gamma);
- picture = DrawableToPicture(painter, drawable, x, y, width, height);
- Blt_FreePainter(painter);
- return picture;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawableToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and
- * converts it to a picture.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred,
- * NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Picture *
-Blt_DrawableToPicture(
- Tk_Window tkwin,
- Drawable drawable,
- int x, int y, /* Offset of image from the drawable's
- * origin. */
- int width, int height, /* Dimension of the image. Image must
- * be completely contained by the
- * drawable. */
- double gamma)
-{
- Blt_Painter painter;
- Blt_Picture picture;
-
- painter = Blt_GetPainter(tkwin, gamma);
- picture = DrawableToPicture(painter, drawable, x, y, width, height);
- Blt_FreePainter(painter);
- return picture;
-}
-
-
-Pixmap
-Blt_PhotoImageMask(
- Tk_Window tkwin,
- Tk_PhotoImageBlock src)
-{
- TkWinBitmap *twdPtr;
- int offset, count;
- int x, y;
- unsigned char *srcPtr;
- int destBytesPerRow;
- int destHeight;
- unsigned char *destBits;
-
- destBytesPerRow = ((src.width + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(src.height, destBytesPerRow);
- destHeight = src.height;
-
- offset = count = 0;
-
- /* FIXME: figure out why this is so! */
- for (y = src.height - 1; y >= 0; y--) {
- srcPtr = src.pixelPtr + offset;
- for (x = 0; x < src.width; x++) {
- if (srcPtr[src.offset[3]] == 0x00) {
- SetBit(x, y);
- count++;
- }
- srcPtr += src.pixelSize;
- }
- offset += src.pitch;
- }
- if (count > 0) {
- HBITMAP hBitmap;
- BITMAP bm;
-
- bm.bmType = 0;
- bm.bmWidth = src.width;
- bm.bmHeight = src.height;
- bm.bmWidthBytes = destBytesPerRow;
- bm.bmPlanes = 1;
- bm.bmBitsPixel = 1;
- bm.bmBits = destBits;
- hBitmap = CreateBitmapIndirect(&bm);
-
- twdPtr = Blt_AssertMalloc(sizeof(TkWinBitmap));
- twdPtr->type = TWD_BITMAP;
- twdPtr->handle = hBitmap;
- twdPtr->depth = 1;
- if (Tk_WindowId(tkwin) == None) {
- twdPtr->colormap = DefaultColormap(Tk_Display(tkwin),
- DefaultScreen(Tk_Display(tkwin)));
- } else {
- twdPtr->colormap = Tk_Colormap(tkwin);
- }
- } else {
- twdPtr = NULL;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- return (Pixmap)twdPtr;
-}
-
-Pixmap
-Blt_PictureMask(
- Tk_Window tkwin,
- Blt_Picture pict)
-{
- TkWinBitmap *twdPtr;
- int count;
- int x, y;
- Blt_Pixel *sp;
- int destBytesPerRow;
- int destWidth, destHeight;
- unsigned char *destBits;
-
- destWidth = Blt_PictureWidth(pict);
- destHeight = Blt_PictureHeight(pict);
- destBytesPerRow = ((destWidth + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(destHeight, destBytesPerRow);
- count = 0;
- sp = Blt_PictureBits(pict);
- for (y = 0; y < destHeight; y++) {
- for (x = 0; x < destWidth; x++) {
- if (sp->Alpha == 0x00) {
- SetBit(x, y);
- count++;
- }
- sp++;
- }
- }
- if (count > 0) {
- HBITMAP hBitmap;
- BITMAP bm;
-
- bm.bmType = 0;
- bm.bmWidth = Blt_PictureWidth(pict);
- bm.bmHeight = Blt_PictureHeight(pict);
- bm.bmWidthBytes = destBytesPerRow;
- bm.bmPlanes = 1;
- bm.bmBitsPixel = 1;
- bm.bmBits = destBits;
- hBitmap = CreateBitmapIndirect(&bm);
-
- twdPtr = Blt_AssertMalloc(sizeof(TkWinBitmap));
- twdPtr->type = TWD_BITMAP;
- twdPtr->handle = hBitmap;
- twdPtr->depth = 1;
- if (Tk_WindowId(tkwin) == None) {
- twdPtr->colormap = DefaultColormap(Tk_Display(tkwin),
- DefaultScreen(Tk_Display(tkwin)));
- } else {
- twdPtr->colormap = Tk_Colormap(tkwin);
- }
- } else {
- twdPtr = NULL;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- return (Pixmap)twdPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RotateBitmap --
- *
- * Creates a new bitmap containing the rotated image of the given
- * bitmap. We also need a special GC of depth 1, so that we do
- * not need to rotate more than one plane of the bitmap.
- *
- * Note that under Windows, monochrome bitmaps are stored
- * bottom-to-top. This is why the right angle rotations 0/180
- * and 90/270 look reversed.
- *
- * Results:
- * Returns a new bitmap containing the rotated image.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_RotateBitmap(
- Tk_Window tkwin,
- Pixmap srcBitmap, /* Source bitmap to be rotated */
- int srcWidth,
- int srcHeight, /* Width and height of the source bitmap */
- float angle, /* Right angle rotation to perform */
- int *destWidthPtr,
- int *destHeightPtr)
-{
- Display *display; /* X display */
- Window root; /* Root window drawable */
- Pixmap destBitmap;
- double rotWidth, rotHeight;
- HDC hDC;
- TkWinDCState state;
- int x, y; /* Destination bitmap coordinates */
- int sx, sy; /* Source bitmap coordinates */
- unsigned long pixel;
- HBITMAP hBitmap;
- int result;
- struct MonoBitmap {
- BITMAPINFOHEADER bi;
- RGBQUAD colors[2];
- } mb;
- int srcBytesPerRow, destBytesPerRow;
- int destWidth, destHeight;
- unsigned char *srcBits, *destBits;
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
- Blt_GetBoundingBox(srcWidth, srcHeight, angle, &rotWidth, &rotHeight,
- (Point2d *)NULL);
-
- destWidth = (int)ceil(rotWidth);
- destHeight = (int)ceil(rotHeight);
- destBitmap = Tk_GetPixmap(display, root, destWidth, destHeight, 1);
- if (destBitmap == None) {
- return None; /* Can't allocate pixmap. */
- }
- srcBits = Blt_GetBitmapData(display, srcBitmap, srcWidth, srcHeight,
- &srcBytesPerRow);
- if (srcBits == NULL) {
- OutputDebugString("Blt_GetBitmapData failed");
- return None;
- }
- destBytesPerRow = ((destWidth + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(destHeight, destBytesPerRow);
-
- angle = FMOD(angle, 360.0);
- if (FMOD(angle, (double)90.0) == 0.0) {
- int quadrant;
-
- /* Handle right-angle rotations specially. */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- for (y = 0; y < destHeight; y++) {
- sx = y;
- for (x = 0; x < destWidth; x++) {
- sy = destWidth - x - 1;
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_180: /* 180 degrees */
- for (y = 0; y < destHeight; y++) {
- sy = destHeight - y - 1;
- for (x = 0; x < destWidth; x++) {
- sx = destWidth - x - 1;
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_90: /* 90 degrees */
- for (y = 0; y < destHeight; y++) {
- sx = destHeight - y - 1;
- for (x = 0; x < destWidth; x++) {
- sy = x;
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_0: /* 0 degrees */
- for (y = 0; y < destHeight; y++) {
- for (x = 0; x < destWidth; x++) {
- pixel = GetBit(x, y);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- default:
- /* The calling routine should never let this happen. */
- break;
- }
- } else {
- double radians, sinTheta, cosTheta;
- double srcCX, srcCY; /* Center of source rectangle */
- double destCX, destCY; /* Center of destination rectangle */
- double tx, ty;
- double rx, ry; /* Angle of rotation for x and y coordinates */
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
-
- /*
- * Coordinates of the centers of the source and destination rectangles
- */
- srcCX = srcWidth * 0.5;
- srcCY = srcHeight * 0.5;
- destCX = destWidth * 0.5;
- destCY = destHeight * 0.5;
-
- /* Rotate each pixel of dest image, placing results in source image */
-
- for (y = 0; y < destHeight; y++) {
- ty = y - destCY;
- for (x = 0; x < destWidth; x++) {
-
- /* Translate origin to center of destination image */
- tx = x - destCX;
-
- /* Rotate the coordinates about the origin */
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source image */
- rx += srcCX;
- ry += srcCY;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination image can be
- * bigger than the source
- */
-
- if ((sx >= srcWidth) || (sx < 0) || (sy >= srcHeight) ||
- (sy < 0)) {
- continue;
- }
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- }
- hBitmap = ((TkWinDrawable *)destBitmap)->bitmap.handle;
- ZeroMemory(&mb, sizeof(mb));
- mb.bi.biSize = sizeof(BITMAPINFOHEADER);
- mb.bi.biPlanes = 1;
- mb.bi.biBitCount = 1;
- mb.bi.biCompression = BI_RGB;
- mb.bi.biWidth = destWidth;
- mb.bi.biHeight = destHeight;
- mb.bi.biSizeImage = destBytesPerRow * destHeight;
- mb.colors[0].rgbBlue = mb.colors[0].rgbRed = mb.colors[0].rgbGreen = 0x0;
- mb.colors[1].rgbBlue = mb.colors[1].rgbRed = mb.colors[1].rgbGreen = 0xFF;
- hDC = TkWinGetDrawableDC(display, destBitmap, &state);
- result = SetDIBits(hDC, hBitmap, 0, destHeight, (LPVOID)destBits,
- (BITMAPINFO *)&mb, DIB_RGB_COLORS);
- TkWinReleaseDrawableDC(destBitmap, hDC, &state);
- if (!result) {
-#if WINDEBUG
- PurifyPrintf("can't setDIBits: %s\n", Blt_LastError());
-#endif
- destBitmap = None;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- if (srcBits != NULL) {
- Blt_Free(srcBits);
- }
-
- *destWidthPtr = destWidth;
- *destHeightPtr = destHeight;
- return destBitmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ScaleBitmap --
- *
- * Creates a new scaled bitmap from another bitmap.
- *
- * Results:
- * The new scaled bitmap is returned.
- *
- * Side Effects:
- * A new pixmap is allocated. The caller must release this.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_ScaleBitmap(
- Tk_Window tkwin,
- Pixmap srcBitmap,
- int srcWidth,
- int srcHeight,
- int destWidth,
- int destHeight)
-{
- TkWinDCState srcState, destState;
- HDC src, dest;
- Pixmap destBitmap;
- Window root;
- Display *display;
-
- /* Create a new bitmap the size of the region and clear it */
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
- destBitmap = Tk_GetPixmap(display, root, destWidth, destHeight, 1);
- if (destBitmap == None) {
- return None;
- }
- src = TkWinGetDrawableDC(display, srcBitmap, &srcState);
- dest = TkWinGetDrawableDC(display, destBitmap, &destState);
-
- StretchBlt(dest, 0, 0, destWidth, destHeight, src, 0, 0,
- srcWidth, srcHeight, SRCCOPY);
-
- TkWinReleaseDrawableDC(srcBitmap, src, &srcState);
- TkWinReleaseDrawableDC(destBitmap, dest, &destState);
- return destBitmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ScaleRotateBitmapArea --
- *
- * Creates a scaled and rotated bitmap from a given bitmap. The
- * caller also provides (offsets and dimensions) the region of
- * interest in the destination bitmap. This saves having to
- * process the entire destination bitmap is only part of it is
- * showing in the viewport.
- *
- * This uses a simple rotation/scaling of each pixel in the
- * destination image. For each pixel, the corresponding
- * pixel in the source bitmap is used. This means that
- * destination coordinates are first scaled to the size of
- * the rotated source bitmap. These coordinates are then
- * rotated back to their original orientation in the source.
- *
- * Results:
- * The new rotated and scaled bitmap is returned.
- *
- * Side Effects:
- * A new pixmap is allocated. The caller must release this.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_ScaleRotateBitmapArea(
- Tk_Window tkwin,
- Pixmap srcBitmap, /* Source bitmap. */
- unsigned int srcWidth,
- unsigned int srcHeight, /* Size of source bitmap */
- int regionX,
- int regionY, /* Offset of region in virtual
- * destination bitmap. */
- unsigned int regionWidth,
- unsigned int regionHeight, /* Desire size of bitmap region. */
- unsigned int virtWidth,
- unsigned int virtHeight, /* Virtual size of destination bitmap. */
- float angle) /* Angle to rotate bitmap. */
-{
- Display *display; /* X display */
- Pixmap destBitmap;
- Window root; /* Root window drawable */
- double rWidth, rHeight;
- double xScale, yScale;
- int srcBytesPerRow, destBytesPerRow;
- int destHeight;
- int result;
- unsigned char *srcBits, *destBits;
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
-
- /* Create a bitmap and image big enough to contain the rotated text */
- destBitmap = Tk_GetPixmap(display, root, regionWidth, regionHeight, 1);
- if (destBitmap == None) {
- return None; /* Can't allocate pixmap. */
- }
- srcBits = Blt_GetBitmapData(display, srcBitmap, srcWidth, srcHeight,
- &srcBytesPerRow);
- if (srcBits == NULL) {
- OutputDebugString("Blt_GetBitmapData failed");
- return None;
- }
- destBytesPerRow = ((regionWidth + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(regionHeight, destBytesPerRow);
- destHeight = regionHeight;
-
- angle = FMOD(angle, 360.0);
- Blt_GetBoundingBox(srcWidth, srcHeight, angle, &rWidth, &rHeight,
- (Point2d *)NULL);
- xScale = rWidth / (double)virtWidth;
- yScale = rHeight / (double)virtHeight;
-
- if (FMOD(angle, (double)90.0) == 0.0) {
- int quadrant;
- int y;
-
- /* Handle right-angle rotations specifically */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sx, x;
-
- sx = (int)(yScale * (double)(y+regionY));
- for (x = 0; x < (int)regionWidth; x++) {
- unsigned long pixel;
- int sy;
-
- sy = (int)(xScale *(double)(virtWidth - (x+regionX) - 1));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_180: /* 180 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sy, x;
-
- sy = (int)(yScale * (double)(virtHeight - (y + regionY) - 1));
- for (x = 0; x < (int)regionWidth; x++) {
- unsigned long pixel;
- int sx;
-
- sx = (int)(xScale *(double)(virtWidth - (x+regionX) - 1));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_90: /* 90 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sx, x;
-
- sx = (int)(yScale * (double)(virtHeight - (y + regionY) - 1));
- for (x = 0; x < (int)regionWidth; x++) {
- int sy;
- unsigned long pixel;
-
- sy = (int)(xScale * (double)(x + regionX));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_0: /* 0 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sy, x;
-
- sy = (int)(yScale * (double)(y + regionY));
- for (x = 0; x < (int)regionWidth; x++) {
- int sx;
- unsigned long pixel;
-
- sx = (int)(xScale * (double)(x + regionX));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- default:
- /* The calling routine should never let this happen. */
- break;
- }
- } else {
- double radians, sinTheta, cosTheta;
- double scx, scy; /* Offset from the center of the
- * source rectangle. */
- double rcx, rcy; /* Offset to the center of the
- * rotated rectangle. */
- int y;
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
-
- /*
- * Coordinates of the centers of the source and destination rectangles
- */
- scx = srcWidth * 0.5;
- scy = srcHeight * 0.5;
- rcx = rWidth * 0.5;
- rcy = rHeight * 0.5;
-
- /* For each pixel of the destination image, transform back to the
- * associated pixel in the source image. */
-
- for (y = 0; y < (int)regionHeight; y++) {
- int x;
- double ty; /* Translated coordinates from center */
-
- ty = (yScale * (double)(y + regionY)) - rcy;
- for (x = 0; x < (int)regionWidth; x++) {
- double rx, ry; /* Angle of rotation for x and y coordinates */
- double tx; /* Translated coordinates from center */
- int sx, sy;
- unsigned long pixel;
-
- /* Translate origin to center of destination image. */
- tx = (xScale * (double)(x + regionX)) - rcx;
-
- /* Rotate the coordinates about the origin. */
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source image. */
- rx += scx;
- ry += scy;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination image can be
- * bigger than the source.
- */
-
- if ((sx >= (int)srcWidth) || (sx < 0) ||
- (sy >= (int)srcHeight) || (sy < 0)) {
- continue;
- }
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- }
- {
- HBITMAP hBitmap;
- HDC hDC;
- TkWinDCState state;
- struct MonoBitmap {
- BITMAPINFOHEADER bmiHeader;
- RGBQUAD colors[2];
- } mb;
-
- /* Write the rotated image into the destination bitmap. */
- hBitmap = ((TkWinDrawable *)destBitmap)->bitmap.handle;
- ZeroMemory(&mb, sizeof(mb));
- mb.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- mb.bmiHeader.biPlanes = 1;
- mb.bmiHeader.biBitCount = 1;
- mb.bmiHeader.biCompression = BI_RGB;
- mb.bmiHeader.biWidth = regionWidth;
- mb.bmiHeader.biHeight = regionHeight;
- mb.bmiHeader.biSizeImage = destBytesPerRow * regionHeight;
- mb.colors[0].rgbBlue = mb.colors[0].rgbRed = mb.colors[0].rgbGreen =
- 0x0;
- mb.colors[1].rgbBlue = mb.colors[1].rgbRed = mb.colors[1].rgbGreen =
- 0xFF;
- hDC = TkWinGetDrawableDC(display, destBitmap, &state);
- result = SetDIBits(hDC, hBitmap, 0, regionHeight, (LPVOID)destBits,
- (BITMAPINFO *)&mb, DIB_RGB_COLORS);
- TkWinReleaseDrawableDC(destBitmap, hDC, &state);
- }
- if (!result) {
-#if WINDEBUG
- PurifyPrintf("can't setDIBits: %s\n", Blt_LastError());
-#endif
- destBitmap = None;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- if (srcBits != NULL) {
- Blt_Free(srcBits);
- }
- return destBitmap;
-}
-
-#ifdef HAVE_IJL_H
-
-#include <ijl.h>
-
-Blt_Picture
-Blt_JPEGToPicture(interp, fileName)
- Tcl_Interp *interp;
- char *fileName;
-{
- JPEG_CORE_PROPERTIES jpgProps;
- Blt_Picture pict;
-
- ZeroMemory(&jpgProps, sizeof(JPEG_CORE_PROPERTIES));
- if(ijlInit(&jpgProps) != IJL_OK) {
- Tcl_AppendResult(interp, "can't initialize Intel JPEG library",
- (char *)NULL);
- return NULL;
- }
- jpgProps.JPGFile = fileName;
- if (ijlRead(&jpgProps, IJL_JFILE_READPARAMS) != IJL_OK) {
- Tcl_AppendResult(interp, "can't read JPEG file header from \"",
- fileName, "\" file.", (char *)NULL);
- goto error;
- }
-
- // !dudnik: to fix bug case 584680, [OT:287A305B]
- // Set the JPG color space ... this will always be
- // somewhat of an educated guess at best because JPEG
- // is "color blind" (i.e., nothing in the bit stream
- // tells you what color space the data was encoded from).
- // However, in this example we assume that we are
- // reading JFIF files which means that 3 channel images
- // are in the YCbCr color space and 1 channel images are
- // in the Y color space.
- switch(jpgProps.JPGChannels) {
- case 1:
- jpgProps.JPGColor = IJL_G;
- jpgProps.DIBChannels = 4;
- jpgProps.DIBColor = IJL_RGBA_FPX;
- break;
-
- case 3:
- jpgProps.JPGColor = IJL_YCBCR;
- jpgProps.DIBChannels = 4;
- jpgProps.DIBColor = IJL_RGBA_FPX;
- break;
-
- case 4:
- jpgProps.JPGColor = IJL_YCBCRA_FPX;
- jpgProps.DIBChannels = 4;
- jpgProps.DIBColor = IJL_RGBA_FPX;
- break;
-
- default:
- /* This catches everything else, but no color twist will be
- performed by the IJL. */
- jpgProps.DIBColor = (IJL_COLOR)IJL_OTHER;
- jpgProps.JPGColor = (IJL_COLOR)IJL_OTHER;
- jpgProps.DIBChannels = jpgProps.JPGChannels;
- break;
- }
-
- jpgProps.DIBWidth = jpgProps.JPGWidth;
- jpgProps.DIBHeight = jpgProps.JPGHeight;
- jpgProps.DIBPadBytes = IJL_DIB_PAD_BYTES(jpgProps.DIBWidth,
- jpgProps.DIBChannels);
-
- pict = Blt_CreatePicture(jpgProps.JPGWidth, jpgProps.JPGHeight);
-
- jpgProps.DIBBytes = (BYTE *)Blt_PictureBits(pict);
- if (ijlRead(&jpgProps, IJL_JFILE_READWHOLEIMAGE) != IJL_OK) {
- Tcl_AppendResult(interp, "can't read image data from \"", fileName,
- "\"", (char *)NULL);
- goto error;
- }
- if (ijlFree(&jpgProps) != IJL_OK) {
- Tcl_AppendResult(interp, "can't free Intel(R) JPEG library.",
- (char *)NULL);
- }
- return pict;
-
- error:
- ijlFree(&jpgProps);
- if (pict != NULL) {
- Blt_FreePicture(pict);
- }
- ijlFree(&jpgProps);
- return NULL;
-}
-
-#else
-
-#ifdef HAVE_JPEGLIB_H
-
-#undef HAVE_STDLIB_H
-#ifdef WIN32
-#define XMD_H 1
-#endif
-#include "jpeglib.h"
-#include <setjmp.h>
-
-typedef struct {
- struct jpeg_error_mgr pub; /* "public" fields */
- jmp_buf jmpBuf;
- Tcl_DString dString;
-} ReaderHandler;
-
-static void ErrorProc(j_common_ptr jpegInfo);
-static void MessageProc(j_common_ptr jpegInfo);
-
-/*
- * Here's the routine that will replace the standard error_exit method:
- */
-
-static void
-ErrorProc(jpgPtr)
- j_common_ptr jpgPtr;
-{
- ReaderHandler *handlerPtr = (ReaderHandler *)jpgPtr->err;
-
- (*handlerPtr->pub.output_message) (jpgPtr);
- longjmp(handlerPtr->jmpBuf, 1);
-}
-
-static void
-MessageProc(jpgPtr)
- j_common_ptr jpgPtr;
-{
- ReaderHandler *handlerPtr = (ReaderHandler *)jpgPtr->err;
- char buffer[JMSG_LENGTH_MAX];
-
- /* Create the message and append it into the dynamic string. */
- (*handlerPtr->pub.format_message) (jpgPtr, buffer);
- Tcl_DStringAppend(&handlerPtr->dString, " ", -1);
- Tcl_DStringAppend(&handlerPtr->dString, buffer, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_JPEGToPicture --
- *
- * Reads a JPEG file and converts it into a picture.
- *
- * Results:
- * The picture is returned. If an error occured, such
- * as the designated file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_JPEGToPicture(interp, fileName)
- Tcl_Interp *interp;
- char *fileName;
-{
- struct jpeg_decompress_struct jpg;
- Blt_Picture pict;
- unsigned int pictWidth, pictHeight;
- Blt_Pixel *dp;
- ReaderHandler handler;
- FILE *f;
- JSAMPLE **readBuffer;
- int row_stride;
- int i;
- JSAMPLE *bufPtr;
-
- f = Blt_OpenFile(interp, fileName, "rb");
- if (f == NULL) {
- return NULL;
- }
- pict = NULL;
-
- /* Step 1: allocate and initialize JPEG decompression object */
-
- /* We set up the normal JPEG error routines, then override error_exit. */
- jpg.dct_method = JDCT_IFAST;
- jpg.err = jpeg_std_error(&handler.pub);
- handler.pub.error_exit = ErrorProc;
- handler.pub.output_message = MessageProc;
-
- Tcl_DStringInit(&handler.dString);
- Tcl_DStringAppend(&handler.dString, "error reading \"", -1);
- Tcl_DStringAppend(&handler.dString, fileName, -1);
- Tcl_DStringAppend(&handler.dString, "\": ", -1);
-
- if (setjmp(handler.jmpBuf)) {
- jpeg_destroy_decompress(&jpg);
- fclose(f);
- Tcl_DStringResult(interp, &handler.dString);
- return NULL;
- }
- jpeg_create_decompress(&jpg);
- jpeg_stdio_src(&jpg, f);
-
- jpeg_read_header(&jpg, TRUE); /* Step 3: read file parameters */
-
- jpeg_start_decompress(&jpg); /* Step 5: Start decompressor */
- pictWidth = jpg.output_width;
- pictHeight = jpg.output_height;
- if ((pictWidth < 1) || (pictHeight < 1)) {
- Tcl_AppendResult(interp, "bad JPEG image size", (char *)NULL);
- fclose(f);
- return NULL;
- }
- /* JSAMPLEs per row in output buffer */
- row_stride = pictWidth * jpg.output_components;
-
- /* Make a one-row-high sample array that will go away when done
- * with image */
- readBuffer = (*jpg.mem->alloc_sarray) ((j_common_ptr)&jpg, JPOOL_IMAGE,
- row_stride, 1);
- pict = Blt_CreatePicture(pictWidth, pictHeight);
- dp = Blt_PictureBits(pict);
-
- if (jpg.output_components == 1) {
- while (jpg.output_scanline < pictHeight) {
- jpeg_read_scanlines(&jpg, readBuffer, 1);
- bufPtr = readBuffer[0];
- for (i = 0; i < (int)pictWidth; i++) {
- dp->Red = dp->Green = dp->Blue = *bufPtr++;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- }
- } else {
- while (jpg.output_scanline < pictHeight) {
- jpeg_read_scanlines(&jpg, readBuffer, 1);
- bufPtr = readBuffer[0];
- for (i = 0; i < (int)pictWidth; i++) {
- dp->Red = *bufPtr++;
- dp->Green = *bufPtr++;
- dp->Blue = *bufPtr++;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- }
- }
- jpeg_finish_decompress(&jpg); /* We can ignore the return value
- * since suspension is not
- * possible with the stdio data
- * source. */
- jpeg_destroy_decompress(&jpg);
-
-
- /*
- * After finish_decompress, we can close the input file. Here we
- * postpone it until after no more JPEG errors are possible, so as
- * to simplify the setjmp error logic above. (Actually, I don't
- * think that jpeg_destroy can do an error exit, but why assume
- * anything...)
- */
- fclose(f);
-
- /*
- * At this point you may want to check to see whether any corrupt-data
- * warnings occurred (test whether jerr.pub.num_warnings is nonzero).
- */
- if (handler.pub.num_warnings > 0) {
- Tcl_SetErrorCode(interp, "IMAGE", "JPEG",
- Tcl_DStringValue(&handler.dString), (char *)NULL);
- } else {
- Tcl_SetErrorCode(interp, "NONE", (char *)NULL);
- }
- /*
- * We're ready to call the Tk_Photo routines. They'll take the RGB
- * array we've processed to build the Tk image of the JPEG.
- */
- Tcl_DStringFree(&handler.dString);
- return pict;
-}
-
-#endif /* HAVE_JPEGLIB_H */
-#endif /* HAVE_IJL_H */
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaintPicture --
- *
- * Paints the picture to the given drawable. The region of
- * the picture is specified and the coordinates where in the
- * destination drawable is the image to be displayed.
- *
- * The image may be dithered depending upon the bit set in
- * the flags parameter: 0 no dithering, 1 for dithering.
- *
- * Results:
- * Returns TRUE if the picture was successfully display,
- * Otherwise FALSE is returned if the particular combination
- * visual and image depth is not handled.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PaintPicture(
- Painter *painterPtr,
- Drawable drawable,
- Picture *srcPtr,
- int srcX, int srcY, /* Coordinates of region in the
- * picture. */
- int width, int height, /* Dimension of the region. Area
- * cannot extend beyond the end of the
- * picture. */
- int destX, int destY, /* Coordinates of region in the
- * drawable. */
- unsigned int flags)
-{
- CGrafPtr saveWorld;
- GDHandle saveDevice;
- GWorldPtr destPort;
- Picture *ditherPtr;
-
- ditherPtr = NULL;
- if (flags & BLT_PAINTER_DITHER) {
- ditherPtr = Blt_DitherPicture(srcPtr, painterPtr->palette);
- if (ditherPtr != NULL) {
- srcPtr = ditherPtr;
- }
- }
-
- destPort = TkMacOSXGetDrawablePort(drawable);
- {
- Rect srcRect, destRect;
- MacDrawable dstDraw = (MacDrawable)drawable;
- PixMap pm;
-
- SetRect(&srcRect, srcX, srcY, srcX + width, srcY + height);
- SetRect(&destRect,
- destX + dstDraw->xOffset,
- destY + dstDraw->yOffset,
- destX + width + dstDraw->xOffset,
- destY + height + dstDraw->yOffset);
-
- GetGWorld(&saveWorld, &saveDevice);
- SetGWorld(destPort, NULL);
-
- TkMacOSXSetUpClippingRgn(drawable);
-
- pm.bounds.left = pm.bounds.top = 0;
- pm.bounds.right = (short)width;
- pm.bounds.bottom = (short)height;
-
- pm.pixelType = RGBDirect;
- pm.pmVersion = baseAddr32; /* 32bit clean */
-
- pm.packType = pm.packSize = 0;
- pm.hRes = pm.vRes = 0x00480000; /* 72 dpi */
-
- pm.pixelSize = sizeof(Blt_Pixel) * 8; /* Bits per pixel. */
- pm.cmpCount = 3; /* 3 components for direct. */
- pm.cmpSize = 8; /* 8 bits per component. */
-
- pm.pixelFormat = k32ARGBPixelFormat;
- pm.pmTable = NULL;
- pm.pmExt = 0;
-
- pm.baseAddr = (Ptr)srcPtr->bits;
- pm.rowBytes = srcPtr->pixelsPerRow * sizeof(Blt_Pixel);
-
- pm.rowBytes |= 0x8000; /* Indicates structure a PixMap,
- * not a BitMap. */
- CopyBits((BitMap *)&pm,
- GetPortBitMapForCopyBits(destPort),
- &srcRect, &destRect, srcCopy, NULL);
- }
- if (ditherPtr != NULL) {
- Blt_FreePicture(ditherPtr);
- }
- SetGWorld(saveWorld, saveDevice);
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaintPictureWithBlend --
- *
- * Blends and paints the picture with the given drawable. The
- * region of the picture is specified and the coordinates where
- * in the destination drawable is the image to be displayed.
- *
- * The background is snapped from the drawable and converted into
- * a picture. This picture is then blended with the current
- * picture (the background always assumed to be 100% opaque).
- *
- * Results:
- * Returns TRUE is the picture was successfully display,
- * Otherwise FALSE is returned. This may happen if the
- * background can not be obtained from the drawable.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PaintPictureWithBlend(
- Painter *painterPtr,
- Drawable drawable,
- Blt_Picture fg,
- int x, int y, /* Coordinates of region in the
- * picture. */
- int width, int height, /* Dimension of the region. Area
- * cannot extend beyond the end of the
- * picture. */
- int destX, int destY, /* Coordinates of region in the
- * drawable. */
- unsigned int flags,
- int alpha)
-{
- Blt_Picture bg;
-
- if (destX < 0) {
- width += destX;
- destX = 0;
- }
- if (destY < 0) {
- height += destY;
- destY = 0;
- }
- if ((width < 0) || (height < 0)) {
- return FALSE;
- }
- bg = DrawableToPicture(painterPtr, drawable, destX, destY, width, height);
- if (bg == NULL) {
- return FALSE;
- }
-#ifdef notdef
- Blt_FadePicture(bg, fg, x, y, width, height, 0, 0, alpha);
-#else
- Blt_BlendPictures(bg, fg, x, y, bg->width, bg->height, 0, 0);
-#endif
- PaintPicture(painterPtr, drawable, bg, 0, 0, bg->width, bg->height, destX,
- destY, flags);
- Blt_FreePicture(bg);
- return TRUE;
-}
-
-
-int
-Blt_PaintPicture(
- Blt_Painter painter,
- Drawable drawable,
- Blt_Picture picture,
- int x, int y, /* Coordinates of region in the
- * picture. */
- int width, int height, /* Dimension of the region. Area
- * cannot extend beyond the end of the
- * picture. */
- int destX, int destY, /* Coordinates of region in the
- * drawable. */
- unsigned int flags)
-{
- if ((picture == NULL) || (x >= Blt_PictureWidth(picture)) ||
- (y >= Blt_PictureHeight(picture))) {
- /* Nothing to draw. The region offset starts beyond the end of
- * the picture. */
- return TRUE;
- }
- if ((width + x) > Blt_PictureWidth(picture)) {
- width = Blt_PictureWidth(picture) - x;
- }
- if ((height + y) > Blt_PictureHeight(picture)) {
- height = Blt_PictureHeight(picture) - y;
- }
- if ((width <= 0) || (height <= 0)) {
- return TRUE;
- }
- if (Blt_PictureIsOpaque(picture)) {
- return PaintPicture(painter, drawable, picture, x, y, width, height,
- destX, destY, flags);
- } else {
- int alpha = 128;
-
- return PaintPictureWithBlend(painter, drawable, picture, x, y,
- width, height, destX, destY, flags, alpha);
- }
-}
-
-
-int
-Blt_PaintPictureWithBlend(
- Blt_Painter painter,
- Drawable drawable,
- Blt_Picture picture,
- int x, int y, /* Coordinates of region in the
- * picture. */
- int width, int height, /* Dimension of the region. Area
- * cannot extend beyond the end of the
- * picture. */
- int destX, int destY, /* Coordinates of region in the
- * drawable. */
- unsigned int flags, /* Indicates whether to dither the
- * picture before displaying. */
- double falpha)
-{
- int alpha;
-
- alpha = (int)(falpha * 255.0 + 0.5);
-
- assert((x >= 0) && (y >= 0));
- /* assert((destX >= 0) && (destY >= 0)); */
- assert((width >= 0) && (height >= 0));
-
- if ((x >= Blt_PictureWidth(picture)) || (y >= Blt_PictureHeight(picture))){
- /* Nothing to draw. The region offset starts beyond the end of
- * the picture. */
- return TRUE;
- }
- /*
- * Check that the region defined does not extend beyond the end of
- * the picture.
- *
- * Clip the end of the region if it is too big.
- */
- if ((width + x) > Blt_PictureWidth(picture)) {
- width = Blt_PictureWidth(picture) - x;
- }
- if ((height + y) > Blt_PictureHeight(picture)) {
- height = Blt_PictureHeight(picture) - y;
- }
- return PaintPictureWithBlend(painter, drawable, picture, x, y, width,
- height, destX, destY, flags, alpha);
-}
-
-
-GC
-Blt_PainterGC(Painter *painterPtr)
-{
- return painterPtr->gc;
-}
-
-int
-Blt_PainterDepth(Painter *painterPtr)
-{
- return painterPtr->depth;
-}
diff --git a/blt3.0.1/src/bltMacWindow.c b/blt3.0.1/src/bltMacWindow.c
deleted file mode 100644
index 502a0c3..0000000
--- a/blt3.0.1/src/bltMacWindow.c
+++ /dev/null
@@ -1,487 +0,0 @@
-
-/*
- * bltMacOSXWindow.c --
- *
- * This module implements additional window functionality for the BLT
- * toolkit, such as transparent Tk windows, and reparenting Tk
- * windows.
- *
- * Copyright 1997-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "bltInt.h"
-
-#include <X11/Xlib.h>
-#include "tkDisplay.h"
-
-/*
- *---------------------------------------------------------------------------
- *
- * DoConfigureNotify --
- *
- * Generate a ConfigureNotify event describing the current
- * configuration of a window.
- *
- * Results:
- * None.
- *
- * Side effects:
- * An event is generated and processed by Tk_HandleEvent.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DoConfigureNotify(winPtr)
- Tk_FakeWin *winPtr; /* Window whose configuration was just
- * changed. */
-{
- XEvent event;
-
- event.type = ConfigureNotify;
- event.xconfigure.serial = LastKnownRequestProcessed(winPtr->display);
- event.xconfigure.send_event = False;
- event.xconfigure.display = winPtr->display;
- event.xconfigure.event = winPtr->window;
- event.xconfigure.window = winPtr->window;
- event.xconfigure.x = winPtr->changes.x;
- event.xconfigure.y = winPtr->changes.y;
- event.xconfigure.width = winPtr->changes.width;
- event.xconfigure.height = winPtr->changes.height;
- event.xconfigure.border_width = winPtr->changes.border_width;
- if (winPtr->changes.stack_mode == Above) {
- event.xconfigure.above = winPtr->changes.sibling;
- } else {
- event.xconfigure.above = None;
- }
- event.xconfigure.override_redirect = winPtr->atts.override_redirect;
- Tk_HandleEvent(&event);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MakeTransparentWindowExist --
- *
- * Similar to Tk_MakeWindowExist but instead creates a
- * transparent window to block for user events from sibling
- * windows.
- *
- * Differences from Tk_MakeWindowExist.
- *
- * 1. This is always a "busy" window. There's never a
- * platform-specific class procedure to execute instead.
- * 2. The window is transparent and never will contain children,
- * so colormap information is irrelevant.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the procedure returns, the internal window associated
- * with tkwin is guaranteed to exist. This may require the
- * window's ancestors to be created too.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MakeTransparentWindowExist(Tk_Window tkwin, Window parent, int isBusy)
-{
- TkWindow *winPtr = (TkWindow *)tkwin;
- TkWindow *winPtr2;
- Tcl_HashEntry *hPtr;
- int notUsed;
- TkDisplay *dispPtr;
- long int mask;
-
- if (winPtr->window != None) {
- return; /* Window already exists. */
- }
-
- /* Create a transparent window and put it on top. */
-
- mask = (!isBusy) ? 0 : (CWDontPropagate | CWEventMask);
- /* Ignore the important events while the window is mapped. */
-#define USER_EVENTS (EnterWindowMask | LeaveWindowMask | KeyPressMask | \
- KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | \
- PointerMotionMask)
-#define PROP_EVENTS (KeyPressMask | KeyReleaseMask | ButtonPressMask | \
- ButtonReleaseMask | PointerMotionMask)
-
- winPtr->atts.do_not_propagate_mask = PROP_EVENTS;
- winPtr->atts.event_mask = USER_EVENTS;
- winPtr->changes.border_width = 0;
- winPtr->depth = 0;
-
-#ifdef notdef
- winPtr->window = XCreateWindow(winPtr->display, parent,
- winPtr->changes.x, winPtr->changes.y,
- (unsigned)winPtr->changes.width, /* width */
- (unsigned)winPtr->changes.height, /* height */
- (unsigned)winPtr->changes.border_width, /* border_width */
- winPtr->depth, /* depth */
- InputOnly, /* class */
- winPtr->visual, /* visual */
- mask, /* valuemask */
- &winPtr->atts /* attributes */ );
-#endif
- dispPtr = winPtr->dispPtr;
- hPtr = Tcl_CreateHashEntry(&dispPtr->winTable, (char *)winPtr->window,
- ¬Used);
- Tcl_SetHashValue(hPtr, winPtr);
- winPtr->dirtyAtts = 0;
- winPtr->dirtyChanges = 0;
-#ifdef TK_USE_INPUT_METHODS
- winPtr->inputContext = NULL;
-#endif /* TK_USE_INPUT_METHODS */
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
- /*
- * If any siblings higher up in the stacking order have already
- * been created then move this window to its rightful position
- * in the stacking order.
- *
- * NOTE: this code ignores any changes anyone might have made
- * to the sibling and stack_mode field of the window's attributes,
- * so it really isn't safe for these to be manipulated except
- * by calling Tk_RestackWindow.
- */
- for (winPtr2 = winPtr->nextPtr; winPtr2 != NULL;
- winPtr2 = winPtr2->nextPtr) {
- if ((winPtr2->window != None) && !(winPtr2->flags & TK_TOP_LEVEL)) {
- XWindowChanges changes;
- changes.sibling = winPtr2->window;
- changes.stack_mode = Below;
- XConfigureWindow(winPtr->display, winPtr->window,
- CWSibling | CWStackMode, &changes);
- break;
- }
- }
- }
-
- /*
- * Issue a ConfigureNotify event if there were deferred configuration
- * changes (but skip it if the window is being deleted; the
- * ConfigureNotify event could cause problems if we're being called
- * from Tk_DestroyWindow under some conditions).
- */
- if ((winPtr->flags & TK_NEED_CONFIG_NOTIFY)
- && !(winPtr->flags & TK_ALREADY_DEAD)) {
- winPtr->flags &= ~TK_NEED_CONFIG_NOTIFY;
- DoConfigureNotify((Tk_FakeWin *) tkwin);
- }
-}
-
-Window
-Blt_GetParentWindow(Display *display, Window window)
-{
- Window root, parent;
- Window *dummy;
- unsigned int count;
-
- if (XQueryTree(display, window, &root, &parent, &dummy, &count) > 0) {
- XFree(dummy);
- return parent;
- }
- return None;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetWindowId --
- *
- * Returns the XID for the Tk_Window given. Starting in Tk 8.0,
- * the toplevel widgets are wrapped by another window. Currently
- * there's no way to get at that window, other than what is done
- * here: query the X window hierarchy and retrieve the parent.
- *
- * Results:
- * Returns the X Window ID of the widget. If it's a toplevel, then
- * the XID of the wrapper is returned.
- *
- *---------------------------------------------------------------------------
- */
-Window
-Blt_GetWindowId(Tk_Window tkwin)
-{
- Window window;
-
- Tk_MakeWindowExist(tkwin);
- window = Tk_WindowId(tkwin);
- if (Tk_IsTopLevel(tkwin)) {
- Window parent;
-
- parent = Blt_GetParentWindow(Tk_Display(tkwin), window);
- if (parent != None) {
- window = parent;
- }
- window = parent;
- }
- return window;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XGeometryErrorProc --
- *
- * Flags errors generated from XGetGeometry calls to the X server.
- *
- * Results:
- * Always returns 0.
- *
- * Side Effects:
- * Sets a flag, indicating an error occurred.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-XGeometryErrorProc(clientData, errEventPtr)
- ClientData clientData;
- XErrorEvent *errEventPtr;
-{
- int *errorPtr = clientData;
-
- *errorPtr = FALSE;
- return 0;
-}
-
-int
-Blt_GetWindowRegion(
- Display *display,
- Window window,
- int *xPtr, int *yPtr,
- int *widthPtr, int *heightPtr)
-{
- Tk_ErrorHandler handler;
- Window root;
- int any = -1;
- int result;
- int x, y;
- unsigned int width, height, borderWidth, depth;
-
-#ifdef notdef
- handler = Tk_CreateErrorHandler(display, any, X_GetGeometry, any,
- XGeometryErrorProc, &result);
-#endif
- result = XGetGeometry(display, window, &root, &x, &y, &width, &height,
- &borderWidth, &depth);
- Tk_DeleteErrorHandler(handler);
- XSync(display, False);
- if (!result) {
- return TCL_ERROR;
- }
- if (xPtr != NULL) {
- *xPtr = x;
- }
- if (yPtr != NULL) {
- *yPtr = y;
- }
- if (widthPtr != NULL) {
- *widthPtr = (int)width;
- }
- if (heightPtr != NULL) {
- *heightPtr = (int)height;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RaiseToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_RaiseToplevelWindow(Tk_Window tkwin)
-{
- XRaiseWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_LowerToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_LowerToplevelWindow(Tk_Window tkwin)
-{
- XLowerWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ResizeToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ResizeToplevelWindow(Tk_Window tkwin, int width, int height)
-{
- XResizeWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin), width, height);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MoveResizeToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MoveResizeToplevelWindow(Tk_Window tkwin, int x, int y, int w, int h)
-{
- XMoveResizeWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin), x, y, w, h);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ResizeToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MoveToplevelWindow(Tk_Window tkwin, int x, int y)
-{
- XMoveWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin), x, y);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MapToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MapToplevelWindow(Tk_Window tkwin)
-{
- XMapWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_UnmapToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_UnmapToplevelWindow(Tk_Window tkwin)
-{
- XUnmapWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin));
-}
-
-/* ARGSUSED */
-static int
-XReparentWindowErrorProc(clientData, errEventPtr)
- ClientData clientData;
- XErrorEvent *errEventPtr;
-{
- int *errorPtr = clientData;
-
- *errorPtr = TCL_ERROR;
- return 0;
-}
-
-int
-Blt_ReparentWindow(
- Display *display,
- Window window,
- Window newParent,
- int x, int y)
-{
- Tk_ErrorHandler handler;
- int result;
- int any = -1;
-
- result = TCL_OK;
-#ifdef notdef
- handler = Tk_CreateErrorHandler(display, any, X_ReparentWindow, any,
- XReparentWindowErrorProc, &result);
-#endif
- XReparentWindow(display, window, newParent, x, y);
- Tk_DeleteErrorHandler(handler);
- XSync(display, False);
- return result;
-}
-
-int
-Blt_GetWindowFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Window *windowPtr)
-{
- char *string;
-
- string = Tcl_GetString(objPtr);
- if (string[0] == '.') {
- Tk_Window tkwin;
-
- tkwin = Tk_NameToWindow(Tcl_GetString(objPtr), interp,
- Tk_MainWindow(interp));
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_WindowId(tkwin) == None) {
- Tk_MakeWindowExist(tkwin);
- }
- *windowPtr = (Tk_IsTopLevel(tkwin)) ? Blt_GetWindowId(tkwin) :
- Tk_WindowId(tkwin);
- } else {
- int id;
-
- if (Tcl_GetIntFromObj(interp, objPtr, &id) != TCL_OK) {
- return TCL_ERROR;
- }
- *windowPtr = (Window)id;
- }
- return TCL_OK;
-}
-
diff --git a/blt3.0.1/src/bltMath.h b/blt3.0.1/src/bltMath.h
deleted file mode 100644
index 113b761..0000000
--- a/blt3.0.1/src/bltMath.h
+++ /dev/null
@@ -1,202 +0,0 @@
-
-/*
- * bltMath.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_MATH_H
-#define _BLT_MATH_H
-
-#include <math.h>
-
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif /* HAVE_FLOAT_H */
-
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif /* HAVE_IEEEFP_H */
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif /* M_PI */
-
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661923
-#endif /* M_PI_2 */
-
-#ifndef M_SQRT2
-#define M_SQRT2 1.41421356237309504880
-#endif /* M_SQRT2 */
-
-#ifndef M_SQRT1_2
-#define M_SQRT1_2 0.70710678118654752440
-#endif /* M_SQRT1_2 */
-
-#ifndef SHRT_MAX
-#define SHRT_MAX 0x7FFF
-#endif /* SHRT_MAX */
-
-#ifndef SHRT_MIN
-#define SHRT_MIN -(SHRT_MAX)
-#endif /* SHRT_MAX */
-
-#ifndef USHRT_MAX
-#define USHRT_MAX 0xFFFF
-#endif /* USHRT_MAX */
-
-#ifndef INT_MAX
-#define INT_MAX 2147483647
-#endif /* INT_MAX */
-
-#ifndef HAVE_FLOAT_H
-/*
- *---------------------------------------------------------------------------
- *
- * DBL_MIN, DBL_MAX --
- *
- * DBL_MAX and DBL_MIN are the largest and smaller double
- * precision numbers that can be represented by the floating
- * point hardware. If the compiler is ANSI, they can be found in
- * float.h. Otherwise, we use HUGE_VAL or HUGE to determine
- * them.
- *
- *---------------------------------------------------------------------------
- */
-/*
- * Don't want to include __infinity (definition of HUGE_VAL (SC1.x))
- */
-#ifdef sun
-#define DBL_MAX 1.7976931348623157E+308
-#define DBL_MIN 2.2250738585072014E-308
-#define DBL_EPSILON 2.2204460492503131e-16
-#else
-#ifndef DBL_EPSILON
-#define DBL_EPSILON BLT_DBL_EPSILON
-#endif
-#ifdef HUGE_VAL
-#define DBL_MAX HUGE_VAL
-#define DBL_MIN (1/HUGE_VAL)
-#else
-#ifdef HUGE
-#define DBL_MAX HUGE
-#define DBL_MIN (1/HUGE)
-#else
-/*
- * Punt: Assume relatively small values
- */
-#define DBL_MAX 3.40282347E+38
-#define DBL_MIN 1.17549435E-38
-#endif /*HUGE*/
-#endif /*HUGE_VAL*/
-#endif /*sun*/
-#endif /*!HAVE_FLOAT_H*/
-
-/*
- *---------------------------------------------------------------------------
- *
- * The following are macros replacing math library functions:
- * "fabs", "fmod", "abs", "rint", and "exp10".
- *
- * Although many of these routines may exist in your math
- * library, they aren't used in libtcl.a or libtk.a. This makes
- * it difficult to dynamically load the BLT library as a shared
- * object unless the math library is also shared (which isn't
- * true on several systems). We can avoid the problem by
- * replacing the "exotic" math routines with macros.
- *
- *---------------------------------------------------------------------------
- */
-#undef ABS
-#define ABS(x) (((x)<0)?(-(x)):(x))
-
-#undef EXP10
-#define EXP10(x) (pow(10.0,(x)))
-
-#undef FABS
-#define FABS(x) (((x)<0.0)?(-(x)):(x))
-
-#undef SIGN
-#define SIGN(x) (((x) < 0.0) ? -1 : 1)
-
-/*
- * Be careful when using the next two macros. They both assume the floating
- * point number is less than the size of an int. That means, for example, you
- * can't use these macros with numbers bigger than than 2^31-1.
- */
-#undef FMOD
-#define FMOD(x,y) ((x)-(((int)((x)/(y)))*y))
-
-#undef ROUND
-#define ROUND(x) ((int)((x) + (((x)<0.0) ? -0.5 : 0.5)))
-
-#ifdef HAVE_FINITE
-#define FINITE(x) finite(x)
-#else
-#ifdef HAVE_ISFINITE
-#define FINITE(x) isfinite(x)
-#else
-#ifdef HAVE_ISNAN
-#define FINITE(x) (!isnan(x))
-#else
-#define FINITE(x) (TRUE)
-#endif /* HAVE_ISNAN */
-#endif /* HAVE_ISFINITE */
-#endif /* HAVE_FINITE */
-
-#define DEFINED(x) (!isnan(x))
-#define UNDEFINED(x) (isnan(x))
-
-#if !HAVE_DECL_DRAND48
-BLT_EXTERN double drand48(void);
-#endif /* !HAVE_DECL_DRAND48 */
-
-#if !HAVE_DECL_SRAND48
-BLT_EXTERN void srand48(long seed);
-#endif /* !HAVE_DECL_SRAND48 */
-
-#if !HAVE_DECL_J1
-BLT_EXTERN double j1(double x);
-#endif /* !HAVE_DECL_J1 */
-
-#if !HAVE_DECL_HYPOT
-BLT_EXTERN double hypot(double x, double y);
-#endif /* !HAVE_DECL_HYPOT */
-
-#ifdef HAVE_ISNAN
-#if !HAVE_DECL_ISNAN
-BLT_EXTERN int isnan(double x);
-#endif /* !HAVE_DECL_ISNAN */
-#endif /* HAVE_ISNAN */
-
-#ifdef HAVE_FINITE
-#if !HAVE_DECL_FINITE
-BLT_EXTERN int finite(double x);
-#endif /* !HAVE_DECL_FINITE */
-#endif /* HAVE_FINITE */
-
-#endif /* BLT_MATH_H */
-
diff --git a/blt3.0.1/src/bltMenubar.c b/blt3.0.1/src/bltMenubar.c
deleted file mode 100644
index eb4a88f..0000000
--- a/blt3.0.1/src/bltMenubar.c
+++ /dev/null
@@ -1,3030 +0,0 @@
-
-/*
- * bltMenubar.c --
- *
- * This module implements a menubar widget for the BLT toolkit.
- *
- * Copyright 2006 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include "bltFont.h"
-#include "bltText.h"
-#include "bltChain.h"
-#include "bltImage.h"
-#include "bltHash.h"
-#include "bltBgStyle.h"
-
-#define IPAD 2 /* Internal pad between components. */
-#define YPAD 2 /* External pad between components. */
-#define XPAD 2 /* External pad between border and item. */
-
-#define STATE_NORMAL (0) /* Draw widget normally. */
-#define STATE_ACTIVE (1<<0) /* Widget is currently active. */
-#define STATE_DISABLED (1<<1) /* Widget is disabled. */
-#define STATE_POSTED (1<<2) /* Widget is currently posting its menu. */
-#define STATE_MASK (STATE_ACTIVE|STATE_DISABLED|STATE_POSTED)
-
-#define REDRAW_PENDING (1<<3) /* Widget is scheduled to be redrawn. */
-#define LAYOUT_PENDING (1<<4) /* Widget layout needs to be recomputed. */
-#define FOCUS (1<<5) /* Widget has focus. */
-#define VERTICAL (1<<6)
-
-#define ITEM_BUTTON (1<<7)
-#define ITEM_SEPARATOR (1<<8)
-#define ITEM_FILLER (1<<9)
-#define ITEM_MASK (ITEM_BUTTON|ITEM_SEPARATOR|ITEM_FILLER)
-
-#define DEF_ACTIVE_BG STD_ACTIVE_BACKGROUND
-#define DEF_ACTIVE_FG STD_ACTIVE_FOREGROUND
-#define DEF_BORDERWIDTH "2"
-#define DEF_CMD ((char *)NULL)
-#define DEF_CURSOR ((char *)NULL)
-#define DEF_DIRECTION ((char *)NULL)
-#define DEF_DISABLED_BG STD_DISABLED_BACKGROUND
-#define DEF_DISABLED_FG STD_DISABLED_FOREGROUND
-#define DEF_ENTRY_BG RGB_GREY90
-#define DEF_FONT STD_FONT
-#define DEF_HEIGHT "0"
-#define DEF_HIGHLIGHT_BG_COLOR ""
-#define DEF_HIGHLIGHT_COLOR "black"
-#define DEF_HIGHLIGHT_WIDTH "2"
-#define DEF_ICON ((char *)NULL)
-#define DEF_IMAGE ((char *)NULL)
-#define DEF_JUSTIFY "left"
-#define DEF_MENU ((char *)NULL)
-#define DEF_MENU_ANCHOR "sw"
-#define DEF_NORMAL_BG STD_NORMAL_BACKGROUND
-#define DEF_NORMAL_FG STD_NORMAL_FOREGROUND
-#define DEF_ORIENT "horizonatal"
-#define DEF_POSTED_BG RGB_SKYBLUE4
-#define DEF_POSTED_FG RGB_WHITE
-#define DEF_NORMAL_RELIEF "raised"
-#define DEF_POSTED_RELIEF "flat"
-#define DEF_ACTIVE_RELIEF "raised"
-#define DEF_STATE "normal"
-#define DEF_TAKE_FOCUS "1"
-#define DEF_TEXT ((char *)NULL)
-#define DEF_TYPE "button"
-#define DEF_UNDERLINE "-1"
-#define DEF_WIDTH "0"
-
-static Blt_OptionFreeProc FreeTextProc;
-static Blt_OptionParseProc ObjToTextProc;
-static Blt_OptionPrintProc TextToObjProc;
-static Blt_CustomOption textOption = {
- ObjToTextProc, TextToObjProc, FreeTextProc, (ClientData)0
-};
-
-static Blt_OptionFreeProc FreeIconProc;
-static Blt_OptionParseProc ObjToIconProc;
-static Blt_OptionPrintProc IconToObjProc;
-static Blt_CustomOption iconOption = {
- ObjToIconProc, IconToObjProc, FreeIconProc, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToStateProc;
-static Blt_OptionPrintProc StateToObjProc;
-static Blt_CustomOption stateOption = {
- ObjToStateProc, StateToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToOrientProc;
-static Blt_OptionPrintProc OrientToObjProc;
-static Blt_CustomOption orientOption = {
- ObjToOrientProc, OrientToObjProc, NULL, (ClientData)0
-};
-
-static const char emptyString[] = "";
-
-/*
- * Icon --
- *
- * Since instances of the same Tk image can be displayed in different
- * windows with possibly different color palettes, Tk internally stores
- * each instance in a linked list. But if the instances are used in the
- * same widget and therefore use the same color palette, this adds a lot
- * of overhead, especially when deleting instances from the linked list.
- *
- * For the menubar widget, we never need more than a single instance
- * of an image, regardless of how many times it's used. Cache the image,
- * maintaining a reference count for each image used in the widget. It's
- * likely that the menubar widget will use many instances of the same
- * image.
- */
-
-typedef struct Icon {
- Tk_Image tkImage; /* The Tk image being cached. */
- short int width, height; /* Dimensions of the cached image. */
-} *Icon;
-
-#define IconHeight(i) ((i)->height)
-#define IconWidth(i) ((i)->width)
-#define IconImage(i) ((i)->tkImage)
-#define IconName(i) (Blt_Image_Name((i)->tkImage))
-
-typedef struct _Menubar Menubar;
-
-typedef struct {
- Menubar *mbPtr;
- Blt_ChainLink link;
- Blt_HashEntry *hashPtr;
- unsigned int flags;
- /*
- * The item contains optionally an icon and a text string.
- */
- Icon icon; /* If non-NULL, image to be displayed
- * in item. */
- Icon image; /* If non-NULL, image to be displayed
- * instead of text in the item. */
- const char *text; /* Text string to be displayed in the
- * item if an image has no been
- * designated. */
- Tk_Justify justify; /* Justification to use for text
- * within the item. */
- short int textLen; /* # bytes of text. */
- short int underline; /* Character index of character to be
- * underlined. If -1, no character is
- * underlined. */
- Tcl_Obj *takeFocusObjPtr; /* Value of -takefocus option; not
- * used in the C code, but used by
- * keyboard traversal scripts. */
- short int iconWidth, iconHeight;
- short int entryWidth, entryHeight;
- short int textWidth, textHeight;
-
- int reqWidth, reqHeight;
-
- Tcl_Obj *cmdObjPtr; /* If non-NULL, command to be executed when
- * this menu is posted. */
- Tcl_Obj *menuObjPtr;
-
- Tcl_Obj *postCmdObjPtr; /* If non-NULL, command to be executed when
- * this menu is posted. */
- int menuAnchor;
- short int inset;
- short int index;
- short int x, y, width, height;
- Blt_Pad xPad, yPad;
-} Item;
-
-
-struct _Menubar {
- Tcl_Interp *interp; /* Interpreter associated with menubar. */
- Tk_Window tkwin; /* Window that embodies the menubar. If
- * NULL, indicates the window has been
- * destroyed but the data structures haven't
- * yet been cleaned up.*/
- Tk_Window parent; /* Original parent of the menubar. */
- XRectangle region;
- Display *display; /* Display containing widget. Used, among
- * other things, so that resources can be
- * freed even after tkwin has gone away. */
-
- Tcl_Command cmdToken; /* Token for widget command. */
- Tk_Window floatWin; /* Toplevel window used to hold the menubar
- * when it's floating. */
- Item *activePtr; /* Currently active item. */
- Item *postedPtr; /* Currently posted item. */
- Item *focusPtr; /* Item with focus. */
-
- int reqWidth, reqHeight;
-
- int relief, postedRelief, activeRelief;
- int borderWidth;
- Blt_Background normalBg;
- Blt_Background activeBg;
- Blt_Background postedBg;
- Blt_Background disabledBg;
-
- Tcl_Obj *takeFocusObjPtr; /* Value of -takefocus option; not used in the
- * C code, but used by keyboard traversal
- * scripts. */
-
- /*
- * In/Out Focus Highlight Ring:
- */
- XColor *highlightColor;
- GC highlightGC;
- XColor *highlightBgColor;
- GC highlightBgGC;
- int highlightWidth;
-
- /*
- * The item contains optionally an icon and a text string.
- */
- Icon icon; /* If non-NULL, image to be displayed in
- * item. */
-
- Icon image; /* If non-NULL, image to be displayed instead
- * of text in the item. */
-
- const char *text; /* Text string to be displayed in the item
- * if an image has no been designated. */
-
- Blt_Font font; /* Font of text to be display in item. */
-
- Tk_Justify justify; /* Justification to use for text within the
- * item. */
-
- int textLen; /* # bytes of text. */
-
- int underline; /* Character index of character to be
- * underlined. If -1, no character is
- * underlined. */
-
- XColor *textNormalColor;
- XColor *textActiveColor;
- XColor *textPostedColor;
- XColor *textDisabledColor;
-
- GC textActiveGC;
- GC textNormalGC;
- GC textPostedGC;
- GC textDisabledGC;
-
- Tk_Cursor cursor; /* Current cursor for window or None. */
-
- int inset;
- short int width, height;
-
- unsigned int flags;
-
- Blt_Chain chain; /* List of menu items. */
- unsigned int nextId;
- Blt_HashTable itemTable;
-
-};
-
-
-static Blt_ConfigSpec itemSpecs[] =
-{
- {BLT_CONFIG_OBJ, "-command", "command", "Command",
- DEF_CMD, Blt_Offset(Item, cmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-height", "height", "Height", DEF_HEIGHT,
- Blt_Offset(Item, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-icon", "icon", "Icon", DEF_ICON,
- Blt_Offset(Item, icon), BLT_CONFIG_NULL_OK, &iconOption},
- {BLT_CONFIG_CUSTOM, "-image", "image", "Image", DEF_IMAGE,
- Blt_Offset(Item, image), BLT_CONFIG_NULL_OK, &iconOption},
- {BLT_CONFIG_JUSTIFY, "-justify", "justify", "Justify", DEF_JUSTIFY,
- Blt_Offset(Item, justify), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-menu", "menu", "Menu", DEF_MENU,
- Blt_Offset(Item, menuObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ANCHOR, "-menuanchor", "menuAnchor", "MenuAnchor",
- DEF_MENU_ANCHOR, Blt_Offset(Item, menuAnchor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-postcommand", "postCommand", "PostCommand",
- DEF_CMD, Blt_Offset(Item, postCmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-state", "state", "State", DEF_STATE,
- Blt_Offset(Item, flags), BLT_CONFIG_DONT_SET_DEFAULT, &stateOption},
- {BLT_CONFIG_OBJ, "-takefocus", "takeFocus", "TakeFocus", DEF_TAKE_FOCUS,
- Blt_Offset(Item, takeFocusObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-text", "text", "Text", DEF_TEXT,
- Blt_Offset(Item, text), 0, &textOption},
- {BLT_CONFIG_INT, "-underline", "underline", "Underline", DEF_UNDERLINE,
- Blt_Offset(Item, underline), BLT_CONFIG_DONT_SET_DEFAULT },
- {BLT_CONFIG_PIXELS_NNEG, "-width", "width", "Width", DEF_WIDTH,
- Blt_Offset(Item, reqWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-static Blt_ConfigSpec menubarSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_ACTIVE_BG, Blt_Offset(Menubar, activeBg),0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "ActiveForeground", DEF_ACTIVE_FG,
- Blt_Offset(Menubar, textActiveColor), 0},
- {BLT_CONFIG_RELIEF, "-activerelief", "activeRelief", "Relief",
- DEF_POSTED_RELIEF, Blt_Offset(Menubar, activeRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_NORMAL_BG, Blt_Offset(Menubar, normalBg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_BORDERWIDTH, Blt_Offset(Menubar, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_CURSOR, Blt_Offset(Menubar, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BACKGROUND, "-disabledbackground", "disabledBackground",
- "DisabledBackground", DEF_DISABLED_BG,
- Blt_Offset(Menubar, disabledBg), 0},
- {BLT_CONFIG_COLOR, "-disabledforeground", "disabledForeground",
- "DisabledForeground", DEF_DISABLED_FG,
- Blt_Offset(Menubar, textDisabledColor), 0},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_FONT,
- Blt_Offset(Menubar, font), 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_NORMAL_FG, Blt_Offset(Menubar, textNormalColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-height", "height", "Height", DEF_HEIGHT,
- Blt_Offset(Menubar, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_HIGHLIGHT_BG_COLOR,
- Blt_Offset(Menubar, highlightBgColor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_HIGHLIGHT_COLOR, Blt_Offset(Menubar, highlightColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_HIGHLIGHT_WIDTH,
- Blt_Offset(Menubar, highlightWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-orient", "orient", "Orient", DEF_ORIENT,
- Blt_Offset(Menubar, flags), BLT_CONFIG_DONT_SET_DEFAULT, &orientOption},
- {BLT_CONFIG_BACKGROUND, "-postedbackground", "postedBackground",
- "PostedBackground", DEF_POSTED_BG, Blt_Offset(Menubar, postedBg),0},
- {BLT_CONFIG_COLOR, "-postedforeground", "postedForeground",
- "PostedForeground", DEF_POSTED_FG,
- Blt_Offset(Menubar, textPostedColor), 0},
- {BLT_CONFIG_RELIEF, "-postedrelief", "postedRelief", "PostedRelief",
- DEF_POSTED_RELIEF, Blt_Offset(Menubar, postedRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_NORMAL_RELIEF,
- Blt_Offset(Menubar, relief), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-takefocus", "takeFocus", "TakeFocus", DEF_TAKE_FOCUS,
- Blt_Offset(Menubar, takeFocusObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-width", "width", "Width", DEF_WIDTH,
- Blt_Offset(Menubar, reqWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-static Tk_EventProc FloatEventProc;
-static Tk_GeomRequestProc FloatGeometryProc;
-static Tk_GeomLostSlaveProc FloatCustodyProc;
-static Tk_GeomMgr menubarMgrInfo =
-{
- (char *)"menubar", /* Name of geometry manager used by winfo */
- FloatGeometryProc, /* Procedure to for new geometry requests */
- FloatCustodyProc, /* Procedure when window is taken away */
-};
-
-static Tcl_IdleProc DisplayMenubar;
-static Tcl_FreeProc DestroyMenubar;
-static Tcl_FreeProc FreeFloatProc;
-static Tk_EventProc MenubarEventProc;
-static Tcl_ObjCmdProc MenubarInstCmdProc;
-static Tcl_CmdDeleteProc MenubarInstCmdDeletedProc;
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Tells the Tk dispatcher to call the menubar display routine at the
- * next idle point. This request is made only if the window is displayed
- * and no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(Menubar *mbPtr)
-{
- if ((mbPtr->tkwin != NULL) && ((mbPtr->flags & REDRAW_PENDING) == 0)) {
- mbPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayMenubar, mbPtr);
- }
-}
-
-
-static void
-FreeIcon(Menubar *mbPtr, Icon icon)
-{
- Tk_FreeImage(IconImage(icon));
- Blt_Free(icon);
-}
-
-#ifdef notdef
-static char *
-GetInterpResult(Tcl_Interp *interp)
-{
-#define MAX_ERR_MSG 1023
- static char mesg[MAX_ERR_MSG+1];
-
- strncpy(mesg, Tcl_GetStringResult(interp), MAX_ERR_MSG);
- mesg[MAX_ERR_MSG] = '\0';
- return mesg;
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconChangedProc
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-IconChangedProc(
- ClientData clientData,
- int x, int y, int w, int h, /* Not used. */
- int imageWidth, int imageHeight) /* Not used. */
-{
- Menubar *mbPtr = clientData;
-
- mbPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(mbPtr);
-}
-
-static int
-GetIconFromObj(Tcl_Interp *interp, Menubar *mbPtr, Tcl_Obj *objPtr,
- Icon *iconPtr)
-{
- Tk_Image tkImage;
- const char *iconName;
-
- iconName = Tcl_GetString(objPtr);
- if (iconName[0] == '\0') {
- *iconPtr = NULL;
- return TCL_OK;
- }
- tkImage = Tk_GetImage(interp, mbPtr->tkwin, iconName, IconChangedProc,
- mbPtr);
- if (tkImage != NULL) {
- struct Icon *ip;
- int width, height;
-
- ip = Blt_AssertMalloc(sizeof(struct Icon));
- Tk_SizeOfImage(tkImage, &width, &height);
- ip->tkImage = tkImage;
- ip->width = width;
- ip->height = height;
- *iconPtr = ip;
- return TCL_OK;
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MenubarEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * menubar widgets.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MenubarEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Menubar *mbPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(mbPtr);
- }
- } else if (eventPtr->type == ConfigureNotify) {
- EventuallyRedraw(mbPtr);
- } else if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
- if (eventPtr->xfocus.detail == NotifyInferior) {
- return;
- }
- if (eventPtr->type == FocusIn) {
- mbPtr->flags |= FOCUS;
- } else {
- mbPtr->flags &= ~FOCUS;
- }
- EventuallyRedraw(mbPtr);
- } else if (eventPtr->type == DestroyNotify) {
- if (mbPtr->tkwin != NULL) {
- mbPtr->tkwin = NULL;
- }
- if (mbPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayMenubar, mbPtr);
- }
- Tcl_EventuallyFree(mbPtr, DestroyMenubar);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToStateProc --
- *
- * Converts the string representing a state into a bitflag.
- *
- * Results:
- * The return value is a standard TCL result. The state flags are
- * updated.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToStateProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing state. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Item *itemPtr = (Item *)(widgRec);
- unsigned int *flagsPtr = (unsigned int *)(widgRec + offset);
- const char *string;
- int flag;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "disabled") == 0) {
- flag = STATE_DISABLED;
- } else if (strcmp(string, "normal") == 0) {
- flag = STATE_NORMAL;
- } else if (strcmp(string, "active") == 0) {
- Menubar *mbPtr;
-
- mbPtr = itemPtr->mbPtr;
- if (mbPtr->activePtr != NULL) {
- mbPtr->activePtr->flags &= ~STATE_ACTIVE;
- }
- flag = STATE_ACTIVE;
- mbPtr->activePtr = itemPtr;
- } else {
- Tcl_AppendResult(interp, "unknown state \"", string,
- "\": should be active, disabled, or normal.", (char *)NULL);
- return TCL_ERROR;
- }
- if (itemPtr->flags & flag) {
- return TCL_OK; /* State is already set to value. */
- }
- *flagsPtr &= ~STATE_MASK;
- *flagsPtr |= flag;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StateToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-StateToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int state = *(unsigned int *)(widgRec + offset);
- const char *string;
-
- switch (state & STATE_MASK) {
- case STATE_NORMAL: string = "normal"; break;
- case STATE_ACTIVE: string = "active"; break;
- case STATE_POSTED: string = "posted"; break;
- case STATE_DISABLED: string = "disabled"; break;
- default: string = Blt_Itoa(state & STATE_MASK);
- break;
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-/*ARGSUSED*/
-static void
-FreeIconProc(ClientData clientData, Display *display, char *widgRec, int offset)
-{
- Icon icon = *(Icon *)(widgRec + offset);
-
- if (icon != NULL) {
- Menubar *mbPtr = (Menubar *)widgRec;
-
- FreeIcon(mbPtr, icon);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToOrientProc --
- *
- * Converts the string representing a state into a bitflag.
- *
- * Results:
- * The return value is a standard TCL result. The state flags are
- * updated.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToOrientProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing state. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Menubar *mbPtr = (Menubar *)(widgRec);
- unsigned int *flagsPtr = (unsigned int *)(widgRec + offset);
- const char *string;
- int length;
-
- string = Tcl_GetString(objPtr);
- length = strlen(string);
- if (strncmp(string, "vertical", length) == 0) {
- *flagsPtr |= VERTICAL;
- } else if (strncmp(string, "horizontal", length) == 0) {
- *flagsPtr &= ~VERTICAL;
- } else {
- Tcl_AppendResult(interp, "bad orientation \"", string,
- "\": must be vertical or horizontal", (char *)NULL);
- return TCL_ERROR;
- }
- mbPtr->flags |= LAYOUT_PENDING;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OrientToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-OrientToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int mask = *(unsigned int *)(widgRec + offset);
- const char *string;
-
- string = (mask & VERTICAL) ? "vertical" : "horizontal";
- return Tcl_NewStringObj(string, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToIconProc --
- *
- * Convert a image into a hashed icon.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToIconProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Menubar *mbPtr = (Menubar *)widgRec;
- Icon *iconPtr = (Icon *)(widgRec + offset);
- Icon icon;
-
- if (GetIconFromObj(interp, mbPtr, objPtr, &icon) != TCL_OK) {
- return TCL_ERROR;
- }
- if (*iconPtr != NULL) {
- FreeIcon(mbPtr, *iconPtr);
- }
- *iconPtr = icon;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconToObjProc --
- *
- * Converts the icon into its string representation (its name).
- *
- * Results:
- * The name of the icon is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-IconToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Icon icon = *(Icon *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (icon == NULL) {
- objPtr = Tcl_NewStringObj("", 0);
- } else {
- objPtr = Tcl_NewStringObj(Blt_Image_Name(IconImage(icon)), -1);
- }
- return objPtr;
-}
-
-
-/*ARGSUSED*/
-static void
-FreeTextProc(ClientData clientData, Display *display, char *widgRec, int offset)
-{
- Item *itemPtr = (Item *)(widgRec);
-
- if (itemPtr->hashPtr != NULL) {
- Menubar *mbPtr = itemPtr->mbPtr;
-
- Blt_DeleteHashEntry(&mbPtr->itemTable, itemPtr->hashPtr);
- itemPtr->hashPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToTextProc --
- *
- * Save the text and add the item to the text hashtable.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTextProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Item *itemPtr = (Item *)(widgRec);
- Menubar *mbPtr;
- int isNew;
- Blt_HashEntry *hPtr;
- const char *string;
-
- mbPtr = itemPtr->mbPtr;
- string = Tcl_GetString(objPtr);
- hPtr = Blt_CreateHashEntry(&mbPtr->itemTable, string, &isNew);
- if (!isNew) {
- Tcl_AppendResult(interp, "item \"", string, "\" already exists in ",
- Tk_PathName(mbPtr->tkwin), (char *)NULL);
- return TCL_ERROR;
- }
- if (itemPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&mbPtr->itemTable, itemPtr->hashPtr);
- }
- itemPtr->hashPtr = hPtr;
- itemPtr->text = Blt_GetHashKey(&mbPtr->itemTable, hPtr);
- Blt_SetHashValue(hPtr, itemPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextToObjProc --
- *
- * Return the text of the item.
- *
- * Results:
- * The text is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TextToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Item *itemPtr = (Item *)(widgRec);
-
- return Tcl_NewStringObj(itemPtr->text, -1);
-}
-
-static INLINE Item *
-FirstItem(Menubar *mbPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(mbPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- if ((itemPtr->flags & (ITEM_BUTTON|STATE_DISABLED)) == ITEM_BUTTON) {
- return itemPtr;
- }
- }
- return NULL;
-}
-
-static INLINE Item *
-LastItem(Menubar *mbPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_LastLink(mbPtr->chain); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- if ((itemPtr->flags & (ITEM_BUTTON|STATE_DISABLED)) == ITEM_BUTTON) {
- return itemPtr;
- }
- }
- return NULL;
-}
-
-static Item *
-NextItem(Item *itemPtr)
-{
- Blt_ChainLink link;
-
- if (itemPtr == NULL) {
- return NULL;
- }
- for (link = Blt_Chain_NextLink(itemPtr->link); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- itemPtr = Blt_Chain_GetValue(link);
- if ((itemPtr->flags & (ITEM_BUTTON|STATE_DISABLED)) == ITEM_BUTTON) {
- return itemPtr;
- }
- }
- return NULL;
-}
-
-static INLINE Item *
-PrevItem(Item *itemPtr)
-{
- Blt_ChainLink link;
-
- if (itemPtr == NULL) {
- return NULL;
- }
- for (link = Blt_Chain_PrevLink(itemPtr->link); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- itemPtr = Blt_Chain_GetValue(link);
- if ((itemPtr->flags & (ITEM_BUTTON|STATE_DISABLED)) == ITEM_BUTTON) {
- return itemPtr;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SearchForItem --
- *
- * Performs a binary search for the item at the given y-offset in world
- * coordinates. The range of items is specified by menu indices (high
- * and low). The item must be (visible) in the viewport.
- *
- * Results:
- * Returns 0 if no item is found, other the index of the item (menu
- * indices start from 1).
- *
- *---------------------------------------------------------------------------
- */
-static Item *
-SearchForItem(Menubar *mbPtr, int x, int y)
-{
- Item *itemPtr;
-
- for (itemPtr = FirstItem(mbPtr); itemPtr != NULL;
- itemPtr = NextItem(itemPtr)) {
-
- if ((x >= itemPtr->x) && (x < (itemPtr->x + itemPtr->width))) {
- return itemPtr;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NearestItem --
- *
- * Find the item closest to the x-y screen coordinate given. The
- * item must be (visible) in the viewport.
- *
- * Results:
- * Returns the closest item. If selectOne is set, then always returns
- * an item (unless the menu is empty). Otherwise, NULL is returned is
- * the pointer is not over an item.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Item *
-NearestItem(Menubar *mbPtr, int x, int y, int selectOne)
-{
- Item *itemPtr;
-
- if ((x < 0) || (x >= Tk_Width(mbPtr->tkwin)) ||
- (y < 0) || (y >= Tk_Height(mbPtr->tkwin))) {
- return NULL; /* Screen coordinates are outside of menu. */
- }
- itemPtr = SearchForItem(mbPtr, x, y);
- if (itemPtr == NULL) {
- if (!selectOne) {
- return NULL;
- }
- if (x < mbPtr->borderWidth) {
- return FirstItem(mbPtr);
- }
- return LastItem(mbPtr);
- }
- return itemPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- * H
- * C
- * L
- * P
- * max of icon/text/image/item
- * P
- * L
- * C
- * H
- *
- * |H|C|L|P| icon |P| text/image |P|L|B| item |B|C|H|
- *
- * H = highlight thickness
- * C = menubar borderwidth
- * L = label borderwidth
- * P = pad
- * I = icon
- * T = text or image
- *---------------------------------------------------------------------------
- */
-static void
-ComputeItemGeometry(Item *itemPtr)
-{
- Menubar *mbPtr = itemPtr->mbPtr;
-
- /* Determine the height of the item. It's the maximum height of all
- * it's components: icon, label, and item. */
- itemPtr->iconWidth = itemPtr->iconHeight = 0;
- itemPtr->entryWidth = itemPtr->entryHeight = 0;
- itemPtr->textWidth = itemPtr->textHeight = 0;
- itemPtr->inset = mbPtr->highlightWidth;
-
- if (itemPtr->icon != NULL) {
- itemPtr->iconWidth = IconWidth(itemPtr->icon);
- itemPtr->iconHeight = IconHeight(itemPtr->icon);
- }
- itemPtr->entryWidth += itemPtr->iconWidth;
- if (itemPtr->entryHeight < itemPtr->iconHeight) {
- itemPtr->entryHeight = itemPtr->iconHeight;
- }
- if (itemPtr->image != NULL) {
- itemPtr->textWidth = IconWidth(itemPtr->image);
- itemPtr->textHeight = IconHeight(itemPtr->image);
- } else if (itemPtr->text != NULL) {
- unsigned int w, h;
-
- Blt_GetTextExtents(mbPtr->font, 0, itemPtr->text, itemPtr->textLen,
- &w, &h);
- itemPtr->textWidth = w + 2 * IPAD;
- itemPtr->textHeight = h;
- }
- itemPtr->entryWidth += itemPtr->textWidth + IPAD;
- if (itemPtr->iconWidth == 0) {
- itemPtr->entryWidth += IPAD;
- }
- if (itemPtr->entryHeight < itemPtr->textHeight) {
- itemPtr->entryHeight = itemPtr->textHeight;
- }
- itemPtr->entryHeight += 2 * YPAD;
- itemPtr->entryWidth += 2 * XPAD;
- itemPtr->width = itemPtr->entryWidth + 2 * itemPtr->inset;
- itemPtr->height = itemPtr->entryHeight + 2 * itemPtr->inset;
- itemPtr->flags &= ~LAYOUT_PENDING;
-}
-
-static void
-ComputeMenubarGeometry(Menubar *mbPtr)
-{
- Blt_ChainLink link;
- int maxWidth, maxHeight;
- int totalWidth, totalHeight;
-
- mbPtr->width = mbPtr->height = 0;
- mbPtr->inset = mbPtr->borderWidth + mbPtr->highlightWidth;
- if (mbPtr->flags & LAYOUT_PENDING) {
- for (link = Blt_Chain_FirstLink(mbPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- ComputeItemGeometry(itemPtr);
- }
- }
- totalWidth = totalHeight = 0;
- maxWidth = maxHeight = 0;
- for (link = Blt_Chain_FirstLink(mbPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- ComputeItemGeometry(itemPtr);
- if (itemPtr->width > maxWidth) {
- maxWidth = itemPtr->width;
- }
- if (itemPtr->height > maxHeight) {
- maxHeight = itemPtr->height;
- }
- totalWidth += itemPtr->width + IPAD;
- totalHeight += itemPtr->height + IPAD;
- }
- if (mbPtr->flags & VERTICAL) {
- mbPtr->height = totalHeight;
- mbPtr->width = maxWidth;
- } else {
- mbPtr->height = totalHeight;
- mbPtr->width = maxWidth;
- }
- if (mbPtr->reqHeight > 0) {
- mbPtr->width = mbPtr->reqHeight;
- }
- if (mbPtr->reqWidth > 0) {
- mbPtr->height = mbPtr->reqWidth;
- }
- mbPtr->height += 2 * mbPtr->inset;
- mbPtr->width += 2 * mbPtr->inset;
- if ((mbPtr->width != Tk_ReqWidth(mbPtr->tkwin)) ||
- (mbPtr->height != Tk_ReqHeight(mbPtr->tkwin))) {
- Tk_GeometryRequest(mbPtr->tkwin, mbPtr->width, mbPtr->height);
- }
- mbPtr->flags &= ~LAYOUT_PENDING;
-}
-
-static int
-ConfigureMenubar(Tcl_Interp *interp, Menubar *mbPtr, int objc,
- Tcl_Obj *const *objv, int flags)
-{
- unsigned int gcMask;
- XGCValues gcValues;
- GC newGC;
-
- if (Blt_ConfigureWidgetFromObj(interp, mbPtr->tkwin, menubarSpecs, objc,
- objv, (char *)mbPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- gcMask = GCForeground | GCFont;
- gcValues.font = Blt_FontId(mbPtr->font);
- /* Text GCs. */
- gcValues.foreground = mbPtr->textNormalColor->pixel;
- newGC = Tk_GetGC(mbPtr->tkwin, gcMask, &gcValues);
- if (mbPtr->textNormalGC != NULL) {
- Tk_FreeGC(mbPtr->display, mbPtr->textNormalGC);
- }
- mbPtr->textNormalGC = newGC;
-
- gcValues.foreground = mbPtr->textActiveColor->pixel;
- newGC = Tk_GetGC(mbPtr->tkwin, gcMask, &gcValues);
- if (mbPtr->textActiveGC != NULL) {
- Tk_FreeGC(mbPtr->display, mbPtr->textActiveGC);
- }
- mbPtr->textActiveGC = newGC;
-
- gcValues.foreground = mbPtr->textPostedColor->pixel;
- newGC = Tk_GetGC(mbPtr->tkwin, gcMask, &gcValues);
- if (mbPtr->textPostedGC != NULL) {
- Tk_FreeGC(mbPtr->display, mbPtr->textPostedGC);
- }
- mbPtr->textPostedGC = newGC;
-
- gcValues.foreground = mbPtr->textDisabledColor->pixel;
- newGC = Tk_GetGC(mbPtr->tkwin, gcMask, &gcValues);
- if (mbPtr->textDisabledGC != NULL) {
- Tk_FreeGC(mbPtr->display, mbPtr->textDisabledGC);
- }
- mbPtr->textDisabledGC = newGC;
-
- /* Focus highlight GCs */
- gcMask = GCForeground;
- gcValues.foreground = mbPtr->highlightColor->pixel;
- newGC = Tk_GetGC(mbPtr->tkwin, gcMask, &gcValues);
- if (mbPtr->highlightGC != NULL) {
- Tk_FreeGC(mbPtr->display, mbPtr->highlightGC);
- }
- mbPtr->highlightGC = newGC;
- if (mbPtr->highlightBgColor != NULL) {
- gcValues.foreground = mbPtr->highlightBgColor->pixel;
- newGC = Tk_GetGC(mbPtr->tkwin, gcMask, &gcValues);
- } else {
- newGC = NULL;
- }
- if (mbPtr->highlightBgGC != NULL) {
- Tk_FreeGC(mbPtr->display, mbPtr->highlightBgGC);
- }
- mbPtr->highlightBgGC = newGC;
- ComputeMenubarGeometry(mbPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyMenubar --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the internal structure of the widget at a safe time (when
- * no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyMenubar(DestroyData dataPtr) /* Pointer to the widget record. */
-{
- Menubar *mbPtr = (Menubar *)dataPtr;
-
- iconOption.clientData = mbPtr;
- Blt_FreeOptions(menubarSpecs, (char *)mbPtr, mbPtr->display, 0);
- if (mbPtr->textNormalGC != NULL) {
- Tk_FreeGC(mbPtr->display, mbPtr->textNormalGC);
- }
- if (mbPtr->textActiveGC != NULL) {
- Tk_FreeGC(mbPtr->display, mbPtr->textActiveGC);
- }
- if (mbPtr->textDisabledGC != NULL) {
- Tk_FreeGC(mbPtr->display, mbPtr->textDisabledGC);
- }
- if (mbPtr->textPostedGC != NULL) {
- Tk_FreeGC(mbPtr->display, mbPtr->textPostedGC);
- }
- if (mbPtr->highlightGC != NULL) {
- Tk_FreeGC(mbPtr->display, mbPtr->highlightGC);
- }
- if (mbPtr->highlightBgGC != NULL) {
- Tk_FreeGC(mbPtr->display, mbPtr->highlightBgGC);
- }
- Tcl_DeleteCommandFromToken(mbPtr->interp, mbPtr->cmdToken);
- Blt_Free(mbPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewMenubar --
- *
- *---------------------------------------------------------------------------
- */
-static Menubar *
-NewMenubar(Tcl_Interp *interp, Tk_Window tkwin)
-{
- Menubar *mbPtr;
-
- mbPtr = Blt_AssertCalloc(1, sizeof(Menubar));
-
- mbPtr->borderWidth = 1;
- mbPtr->display = Tk_Display(tkwin);
- mbPtr->flags = (LAYOUT_PENDING | STATE_NORMAL);
- mbPtr->highlightWidth = 2;
- mbPtr->interp = interp;
- mbPtr->relief = TK_RELIEF_RAISED;
- mbPtr->postedRelief = TK_RELIEF_FLAT;
- mbPtr->activeRelief = TK_RELIEF_RAISED;
- mbPtr->tkwin = tkwin;
- mbPtr->parent = Tk_Parent(tkwin);
- return mbPtr;
-}
-
-static INLINE Item *
-FindItemByIndex(Menubar *mbPtr, long index)
-{
- Blt_ChainLink link;
-
- if ((index < 1) || (index > Blt_Chain_GetLength(mbPtr->chain))) {
- return NULL;
- }
- link = Blt_Chain_GetNthLink(mbPtr->chain, index - 1);
- return Blt_Chain_GetValue(link);
-}
-
-static INLINE Item *
-FindItemByLabel(Menubar *mbPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&mbPtr->itemTable, string);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetItemFromObj --
- *
- * Gets the item associated the given index or label. Converts a
- * string representing a item index into an item pointer. The index
- * may be in one of the following forms:
- *
- * number Item at index in the list of items.
- * @x,y Item closest to the specified X-Y screen coordinates.
- * "active" Item where mouse pointer is located.
- * "posted" Item is the currently posted cascade item.
- * "next" Next item from the focus item.
- * "previous" Previous item from the focus item.
- * "end" Last item.
- * "none" No item.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned. The
- * pointer to the node is returned via itemPtrPtr. Otherwise, TCL_ERROR
- * is returned and an error message is left in interpreter's result
- * field.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetItemFromObj(Tcl_Interp *interp, Menubar *mbPtr, Tcl_Obj *objPtr,
- Item **itemPtrPtr)
-{
- Item *itemPtr;
- const char *string;
- char c;
- long lval;
-
- if (mbPtr->flags & LAYOUT_PENDING) {
- ComputeMenubarGeometry(mbPtr);
- }
- string = Tcl_GetString(objPtr);
- c = string[0];
-
- itemPtr = NULL;
- if (c == '\0') {
- itemPtr = NULL;
- } else if (Tcl_GetLongFromObj(NULL, objPtr, &lval) == TCL_OK) {
- if (lval < 0) {
- itemPtr = NULL;
- } else {
- itemPtr = FindItemByIndex(mbPtr, (long)lval);
- }
- if (itemPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find item: bad index \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- } else if ((c == 'a') && (strcmp(string, "active") == 0)) {
- itemPtr = mbPtr->activePtr;
- } else if ((c == 'n') && (strcmp(string, "next") == 0)) {
- itemPtr = NextItem(mbPtr->activePtr);
- if (itemPtr == NULL) {
- itemPtr = mbPtr->activePtr;
- }
- } else if ((c == 'p') && (strcmp(string, "item_previous") == 0)) {
- itemPtr = PrevItem(mbPtr->activePtr);
- if (itemPtr == NULL) {
- itemPtr = mbPtr->activePtr;
- }
- } else if ((c == 'e') && (strcmp(string, "end") == 0)) {
- itemPtr = LastItem(mbPtr);
- } else if ((c == 'f') && (strcmp(string, "first") == 0)) {
- itemPtr = FirstItem(mbPtr);
- } else if ((c == 'l') && (strcmp(string, "last") == 0)) {
- itemPtr = LastItem(mbPtr);
- } else if ((c == 'n') && (strcmp(string, "none") == 0)) {
- itemPtr = NULL;
- } else if (c == '@') {
- int x, y;
-
- if (Blt_GetXY(mbPtr->interp, mbPtr->tkwin, string, &x, &y)
- != TCL_OK) {
- return TCL_ERROR;
- }
- itemPtr = NearestItem(mbPtr, x, y, TRUE);
- if ((itemPtr != NULL) && (itemPtr->flags & STATE_DISABLED)) {
- itemPtr = NextItem(itemPtr);
- }
- } else {
- itemPtr = FindItemByLabel(mbPtr, string);
- if (itemPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find item \"", string,
- "\" in \"", Tk_PathName(mbPtr->tkwin), "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- }
- *itemPtrPtr = itemPtr;
- return TCL_OK;
-}
-
-static void
-RenumberItems(Menubar *mbPtr)
-{
- int count = 0;
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(mbPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- itemPtr->index = count;
- count++;
- }
-}
-
-static Item *
-NewItem(Menubar *mbPtr, int type)
-{
- Item *itemPtr;
- Blt_ChainLink link;
- Blt_HashEntry *hPtr;
- int isNew;
-
- link = Blt_Chain_AllocLink(sizeof(Item));
- itemPtr = Blt_Chain_GetValue(link);
- memset(itemPtr, 0, sizeof(Item));
- do {
- char string[200];
-
- sprintf(string, "item%d", mbPtr->nextId++);
- hPtr = Blt_CreateHashEntry(&mbPtr->itemTable, string, &isNew);
- } while (!isNew);
- itemPtr->hashPtr = hPtr;
- itemPtr->text = Blt_GetHashKey(&mbPtr->itemTable, hPtr);
- itemPtr->textLen = strlen(itemPtr->text);
- itemPtr->mbPtr = mbPtr;
- itemPtr->flags = STATE_NORMAL | type;
- itemPtr->link = link;
- itemPtr->index = Blt_Chain_GetLength(mbPtr->chain) + 1;
- itemPtr->menuAnchor = TK_ANCHOR_SW;
- itemPtr->underline = -1;
- return itemPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyItem --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the internal structure of the widget at a safe time (when
- * no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyItem(Item *itemPtr)
-{
- Menubar *mbPtr = itemPtr->mbPtr;
-
- iconOption.clientData = mbPtr;
- Blt_FreeOptions(itemSpecs, (char *)itemPtr, mbPtr->display, 0);
- Blt_Chain_DeleteLink(mbPtr->chain, itemPtr->link);
-}
-
-static int
-ConfigureItem(Tcl_Interp *interp, Item *itemPtr, int objc,
- Tcl_Obj *const *objv, int flags)
-{
- Menubar *mbPtr;
-
- mbPtr = itemPtr->mbPtr;
- iconOption.clientData = mbPtr;
- if (Blt_ConfigureWidgetFromObj(interp, mbPtr->tkwin, itemSpecs,
- objc, objv, (char *)itemPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- ComputeItemGeometry(itemPtr);
- return TCL_OK;
-}
-
-static int
-PostMenu(Item *itemPtr)
-{
- const char *menuName;
- Tk_Window menuWin;
- Menubar *mbPtr;
- Tcl_Interp *interp;
-
- mbPtr = itemPtr->mbPtr;
- interp = itemPtr->mbPtr->interp;
- if (itemPtr->menuObjPtr == NULL) {
- return TCL_OK;
- }
- if ((itemPtr->flags & (ITEM_BUTTON|STATE_DISABLED|STATE_POSTED)) !=
- ITEM_BUTTON) {
- return TCL_OK;
- }
- menuName = Tcl_GetString(itemPtr->menuObjPtr);
- menuWin = Tk_NameToWindow(interp, menuName, mbPtr->tkwin);
- if (menuWin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_Parent(menuWin) != mbPtr->tkwin) {
- Tcl_AppendResult(interp, "can't post \"", Tk_PathName(menuWin),
- "\": it isn't a descendant of ", Tk_PathName(mbPtr->tkwin),
- (char *)NULL);
- return TCL_ERROR;
- }
- if (itemPtr->postCmdObjPtr) {
- int result;
-
- Tcl_Preserve(itemPtr);
- Tcl_IncrRefCount(itemPtr->postCmdObjPtr);
- result = Tcl_EvalObjEx(interp, itemPtr->postCmdObjPtr,
- TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(itemPtr->postCmdObjPtr);
- Tcl_Release(itemPtr);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (Tk_IsMapped(mbPtr->tkwin)) {
- Tcl_Obj *cmd[2];
- int result;
-
- Tcl_Preserve(mbPtr);
- cmd[0] = itemPtr->menuObjPtr;
- cmd[1] = Tcl_NewStringObj("post", 4);
- Tcl_IncrRefCount(cmd[0]);
- Tcl_IncrRefCount(cmd[1]);
- result = Tcl_EvalObjv(interp, 2, cmd, 0);
- Tcl_DecrRefCount(cmd[1]);
- Tcl_DecrRefCount(cmd[0]);
- Tcl_Release(mbPtr);
- if (result == TCL_OK) {
- itemPtr->flags &= ~STATE_MASK;
- itemPtr->flags |= STATE_POSTED;
- mbPtr->postedPtr = itemPtr;
- }
- EventuallyRedraw(mbPtr);
- return result;
- }
- return TCL_OK;
-}
-
-static int
-UnpostMenu(Item *itemPtr)
-{
- const char *menuName;
- Tk_Window menuWin;
- Menubar *mbPtr;
- Tcl_Interp *interp;
-
- if ((itemPtr->menuObjPtr == NULL) ||
- ((itemPtr->flags & STATE_POSTED) == 0)) {
- return TCL_OK;
- }
- mbPtr = itemPtr->mbPtr;
- interp = mbPtr->interp;
- itemPtr->flags &= ~STATE_MASK;
- itemPtr->flags |= STATE_NORMAL;
- menuName = Tcl_GetString(itemPtr->menuObjPtr);
- menuWin = Tk_NameToWindow(interp, menuName, mbPtr->tkwin);
- if (menuWin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_Parent(menuWin) != mbPtr->tkwin) {
- Tcl_AppendResult(interp, "can't unpost \"", Tk_PathName(menuWin),
- "\": it isn't a descendant of ", Tk_PathName(mbPtr->tkwin),
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Tk_IsMapped(menuWin)) {
- Tk_UnmapWindow(menuWin);
- }
- return TCL_OK;
-}
-
-
-
-static void
-DestroyFloat(Menubar *mbPtr)
-{
- if (mbPtr->floatWin != NULL) {
- if (mbPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayMenubar, mbPtr);
- }
- Tk_DeleteEventHandler(mbPtr->floatWin, StructureNotifyMask,
- FloatEventProc, mbPtr);
- if (mbPtr->tkwin != NULL) {
-
- Blt_RelinkWindow(mbPtr->tkwin, mbPtr->parent, 0, 0);
- Tk_MoveResizeWindow(mbPtr->tkwin,
- mbPtr->region.x, mbPtr->region.y,
- mbPtr->region.width, mbPtr->region.height);
- if (!Tk_IsMapped(mbPtr->tkwin)) {
- Tk_MapWindow(mbPtr->tkwin);
- }
- }
- Tk_DestroyWindow(mbPtr->floatWin);
- mbPtr->floatWin = NULL;
- }
-}
-
-static void
-FreeFloatProc(DestroyData dataPtr)
-{
- Menubar *mbPtr = (Menubar *)dataPtr;
- DestroyFloat(mbPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FloatEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * the floating menubar.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the tearoff gets deleted, internal structures get
- * cleaned up. When it gets resized or exposed, it's redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FloatEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Menubar *mbPtr = clientData;
-
- if ((mbPtr == NULL) || (mbPtr->tkwin == NULL) ||
- (mbPtr->floatWin == NULL)) {
- return;
- }
- switch (eventPtr->type) {
- case Expose:
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(mbPtr);
- }
- break;
-
- case ConfigureNotify:
- EventuallyRedraw(mbPtr);
- break;
-
- case DestroyNotify:
- DestroyFloat(mbPtr);
- mbPtr->floatWin = NULL;
- break;
-
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FloatCustodyProc --
- *
- * This procedure is invoked when the menubar has been stolen by another
- * geometry manager. The information and memory associated with the
- * window is released.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the widget formerly associated with the menubar to
- * have its layout re-computed and arranged at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
- /* ARGSUSED */
-static void
-FloatCustodyProc(ClientData clientData, Tk_Window tkwin)
-{
- Menubar *mbPtr = clientData;
-
- if ((mbPtr == NULL) || (mbPtr->tkwin == NULL)) {
- return;
- }
- if (mbPtr->floatWin != NULL) {
- Tcl_EventuallyFree(mbPtr, FreeFloatProc);
- }
- /*
- * Mark the floating dock as deleted by dereferencing the Tk window
- * pointer.
- */
- if (mbPtr->tkwin != NULL) {
- if (Tk_IsMapped(mbPtr->tkwin)) {
- mbPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(mbPtr);
- }
- Tk_DeleteEventHandler(mbPtr->floatWin, StructureNotifyMask,
- FloatEventProc, mbPtr);
- mbPtr->floatWin = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FloatGeometryProc --
- *
- * This procedure is invoked by Tk_GeometryRequest for the floating
- * menubar managed by the widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for tkwin, and all its managed siblings, to be repacked and
- * drawn at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
- /* ARGSUSED */
-static void
-FloatGeometryProc(ClientData clientData, Tk_Window tkwin)
-{
- Menubar *mbPtr = clientData;
-
- if ((mbPtr == NULL) || (mbPtr->tkwin == NULL)) {
- fprintf(stderr, "%s: line %d \"tkwin is null\"", __FILE__, __LINE__);
- return;
- }
- mbPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(mbPtr);
-}
-
-static void
-FloatMenubar(ClientData clientData)
-{
- Menubar *mbPtr = clientData;
-
- Blt_RelinkWindow(mbPtr->tkwin, mbPtr->floatWin, 0, 0);
- Tk_MapWindow(mbPtr->tkwin);
-}
-
-static int
-CreateFloat(Menubar *mbPtr, const char *name)
-{
- Tk_Window tkwin;
- int width, height;
-
- tkwin = Tk_CreateWindowFromPath(mbPtr->interp, mbPtr->tkwin, name,
- (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- mbPtr->floatWin = tkwin;
- if (Tk_WindowId(tkwin) == None) {
- Tk_MakeWindowExist(tkwin);
- }
- Tk_SetClass(tkwin, "MenubarDock");
- Tk_CreateEventHandler(tkwin, (ExposureMask | StructureNotifyMask),
- FloatEventProc, mbPtr);
- if (Tk_WindowId(mbPtr->tkwin) == None) {
- Tk_MakeWindowExist(mbPtr->tkwin);
- }
- Tk_ManageGeometry(mbPtr->tkwin, &menubarMgrInfo, mbPtr);
- mbPtr->region.height = height = Tk_Height(mbPtr->tkwin);
- mbPtr->region.width = width = Tk_Width(mbPtr->tkwin);
- mbPtr->region.x = Tk_X(mbPtr->tkwin);
- mbPtr->region.y = Tk_Y(mbPtr->tkwin);
- if (width < 2) {
- width = (mbPtr->reqWidth > 0)
- ? mbPtr->reqWidth : Tk_ReqWidth(mbPtr->tkwin);
- }
- width += 2 * Tk_Changes(mbPtr->tkwin)->border_width;
- width += 2 * mbPtr->inset;
-
- if (height < 2) {
- height = (mbPtr->reqHeight > 0)
- ? mbPtr->reqHeight : Tk_ReqHeight(mbPtr->tkwin);
- }
- height += 2 * Tk_Changes(mbPtr->tkwin)->border_width;
- height += 2 * mbPtr->inset;
- Tk_GeometryRequest(tkwin, width, height);
- /* Tk_MoveWindow(mbPtr->tkwin, 0, 0); */
- Tcl_SetStringObj(Tcl_GetObjResult(mbPtr->interp), Tk_PathName(tkwin), -1);
- Tk_UnmapWindow(mbPtr->tkwin);
-#ifdef WIN32
- FloatMenubar(mbPtr);
-#else
- Tcl_DoWhenIdle(FloatMenubar, mbPtr);
-#endif
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawLabel --
- *
- * Draws the text associated with the label. This is used when the
- * widget acts like a standard label.
- *
- * Results:
- * Nothing.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawLabel(Item *itemPtr, Drawable drawable, int x, int y, int w, int h)
-{
- if (itemPtr->image != NULL) {
- int iw, ih;
-
- iw = MIN(w, itemPtr->textWidth) - IPAD;
- ih = MIN(h, itemPtr->textHeight);
- Tk_RedrawImage(IconImage(itemPtr->image), 0, 0, iw, ih, drawable,
- x + IPAD, y);
- } else {
- GC gc;
- Menubar *mbPtr;
- TextLayout *layoutPtr;
- TextStyle ts;
-
- mbPtr = itemPtr->mbPtr;
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, mbPtr->font);
- Blt_Ts_SetAnchor(ts, TK_ANCHOR_NW);
- Blt_Ts_SetJustify(ts, itemPtr->justify);
- Blt_Ts_SetUnderline(ts, itemPtr->underline);
- layoutPtr = Blt_Ts_CreateLayout(itemPtr->text, -1, &ts);
- if (itemPtr->flags & STATE_POSTED) {
- gc = mbPtr->textPostedGC;
- } else if (itemPtr->flags & STATE_ACTIVE) {
- gc = mbPtr->textActiveGC;
- } else if (itemPtr->flags & STATE_DISABLED) {
- gc = mbPtr->textDisabledGC;
- } else {
- gc = mbPtr->textNormalGC;
- }
- Blt_DrawLayout(mbPtr->tkwin, drawable, gc, mbPtr->font,
- Tk_Depth(mbPtr->tkwin), 0.0f, x + IPAD, y, layoutPtr, w);
- Blt_Free(layoutPtr);
- }
-}
-
-static void
-DrawSeparator(Item *itemPtr, Drawable drawable, int x, int y, int w, int h)
-{
- Menubar *mbPtr = itemPtr->mbPtr;
- XPoint points[2];
- Tk_3DBorder border;
-
- points[1].x = points[0].x = x + w / 2;
- points[0].y = y + YPAD;
- points[1].y = h - 2 * YPAD;
-
- border = Blt_BackgroundBorder(mbPtr->normalBg);
- Tk_Draw3DPolygon(mbPtr->tkwin, drawable, border, points, 2, 1,
- TK_RELIEF_SUNKEN);
-}
-
-static void
-DrawItem(Item *itemPtr, Drawable drawable)
-{
- Menubar *mbPtr = itemPtr->mbPtr;
- Blt_Background bg;
- int relief;
- int x, y, w, h;
-
- if (itemPtr->flags & ITEM_FILLER) {
- return; /* No need to do anything. */
- }
- x = itemPtr->x;
- y = itemPtr->y;
- w = itemPtr->width;
- h = mbPtr->height;
-
- if (itemPtr->flags & ITEM_SEPARATOR) {
- DrawSeparator(itemPtr, drawable, x, y, w, h);
- return;
- }
-
- /* Menubar background (just inside of focus highlight ring). */
-
- if (itemPtr->flags & STATE_POSTED) {
- bg = mbPtr->postedBg;
- } else if (itemPtr->flags & STATE_ACTIVE) {
- bg = mbPtr->activeBg;
- } else if (itemPtr->flags & STATE_DISABLED) {
- bg = mbPtr->disabledBg;
- } else {
- bg = mbPtr->normalBg;
- }
- Blt_FillBackgroundRectangle(mbPtr->tkwin, drawable, bg, 0, 0,
- itemPtr->width, mbPtr->height, mbPtr->borderWidth,
- TK_RELIEF_FLAT);
-
- /* Label: includes icon and text. */
- if (h > itemPtr->entryHeight) {
- y += (h - itemPtr->entryHeight) / 2;
- }
- x += XPAD;
- /* Draw Icon. */
- if (itemPtr->icon != NULL) {
- int ix, iy, iw, ih;
-
- ix = x;
- iy = y;
- if (itemPtr->iconHeight < itemPtr->entryHeight) {
- iy += (itemPtr->entryHeight - itemPtr->iconHeight) / 2;
- }
- iw = MIN(w, itemPtr->iconWidth);
- ih = MIN(h, itemPtr->iconHeight);
- Tk_RedrawImage(IconImage(itemPtr->icon), 0, 0, iw, ih,
- drawable, ix, iy);
- x += itemPtr->iconWidth + IPAD;
- w -= itemPtr->iconWidth + IPAD;
- }
- if ((w > 0) && (h > 0)) {
- int tx, ty, tw, th;
-
- tx = x + IPAD;
- ty = y;
- if (itemPtr->entryHeight > itemPtr->textHeight) {
- ty += (itemPtr->entryHeight - itemPtr->textHeight) / 2;
- }
- tw = MIN(w, itemPtr->textWidth);
- th = MIN(h, itemPtr->textHeight);
- DrawLabel(itemPtr, drawable, tx, ty, tw, th);
- }
- /* Draw focus highlight ring. */
- if (mbPtr->highlightWidth > 0) {
- GC gc;
-
- if (itemPtr->flags & FOCUS) {
- gc = mbPtr->highlightGC;
- } else {
- gc = mbPtr->highlightBgGC;
- }
- if (gc == NULL) {
- Blt_DrawFocusBackground(mbPtr->tkwin, bg,
- mbPtr->highlightWidth, drawable);
- } else {
- Tk_DrawFocusHighlight(mbPtr->tkwin, gc, mbPtr->highlightWidth,
- drawable);
- }
- }
- if (itemPtr->flags & STATE_POSTED) {
- relief = mbPtr->postedRelief;
- } else if (itemPtr->flags & STATE_ACTIVE) {
- relief = mbPtr->activeRelief;
- } else {
- relief = mbPtr->relief;
- }
- if (relief != TK_RELIEF_FLAT) {
- Blt_DrawBackgroundRectangle(mbPtr->tkwin, drawable, bg,
- mbPtr->highlightWidth, mbPtr->highlightWidth,
- itemPtr->width - 2 * mbPtr->highlightWidth,
- itemPtr->height - 2 * mbPtr->highlightWidth,
- mbPtr->borderWidth, relief);
- }
-}
-
-static void
-DrawItems(Menubar *mbPtr, Drawable drawable)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(mbPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
- int x, y, w, h;
-
- itemPtr = Blt_Chain_GetValue(link);
- x = y = itemPtr->inset;
- w = itemPtr->width - (2 * mbPtr->inset);
- h = itemPtr->height - (2 * mbPtr->inset);
- DrawItem(itemPtr, drawable);
- x += itemPtr->width + IPAD;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateOp --
- *
- * Activates the designated button.
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .mbar activate $item
- *
- *---------------------------------------------------------------------------
- */
-static int
-ActivateOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
- Item *itemPtr;
-
- if (GetItemFromObj(interp, mbPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((itemPtr == NULL) || ((itemPtr->flags & ITEM_BUTTON) == 0)) {
- goto done;
- }
- if (itemPtr->flags & (STATE_POSTED|STATE_DISABLED)) {
- return TCL_OK; /* Writing is currently disabled. */
- }
- itemPtr->flags |= STATE_ACTIVE;
- done:
- mbPtr->activePtr->flags &= ~STATE_ACTIVE;
- mbPtr->activePtr = itemPtr;
- EventuallyRedraw(mbPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AddOp --
- *
- * Appends a new item to the menubar.
- *
- * Results:
- * NULL is always returned.
- *
- * .mbar add ?type? -text "fred" -tags ""
- *
- *---------------------------------------------------------------------------
- */
-static int
-AddOp(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
- Item *itemPtr;
- int length, type;
- char c;
- const char *string;
-
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- type = ITEM_BUTTON;
- if ((c == 'b') && (strncmp(string, "button", length) == 0)) {
- type = ITEM_BUTTON;
- objc--, objv--;
- } else if ((c == 's') && (strncmp(string, "separator", length) == 0)) {
- type = ITEM_SEPARATOR;
- objc--, objv--;
- } else if ((c == 's') && (strncmp(string, "filler", length) == 0)) {
- type = ITEM_FILLER;
- objc--, objv--;
- }
- itemPtr = NewItem(mbPtr, type);
- if (ConfigureItem(interp, itemPtr, objc - 2, objv + 2, 0) != TCL_OK) {
- DestroyItem(itemPtr);
- return TCL_ERROR; /* Error configuring the entry. */
- }
- EventuallyRedraw(mbPtr);
- Blt_Chain_LinkAfter(mbPtr->chain, itemPtr->link, NULL);
- Tcl_SetLongObj(Tcl_GetObjResult(interp), itemPtr->index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .menubar cget option
- *
- *---------------------------------------------------------------------------
- */
-static int
-CgetOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
- iconOption.clientData = mbPtr;
- return Blt_ConfigureValueFromObj(interp, mbPtr->tkwin, menubarSpecs,
- (char *)mbPtr, objv[2], BLT_CONFIG_OBJV_ONLY);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .menubar configure ?option value?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int result;
- Menubar *mbPtr = clientData;
-
- iconOption.clientData = mbPtr;
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, mbPtr->tkwin, menubarSpecs,
- (char *)mbPtr, (Tcl_Obj *)NULL, BLT_CONFIG_OBJV_ONLY);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, mbPtr->tkwin, menubarSpecs,
- (char *)mbPtr, objv[2], BLT_CONFIG_OBJV_ONLY);
- }
- Tcl_Preserve(mbPtr);
- result = ConfigureMenubar(interp, mbPtr, objc - 2, objv + 2,
- BLT_CONFIG_OBJV_ONLY);
- Tcl_Release(mbPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- mbPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(mbPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DockOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .menubar dock
- * .menubar undock
- *---------------------------------------------------------------------------
- */
-static int
-DockOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
-
- if (mbPtr->floatWin == NULL) {
- CreateFloat(mbPtr, "dock");
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ItemCgetOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .mbar item cget $button option
- *
- *---------------------------------------------------------------------------
- */
-static int
-ItemCgetOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
- Item *itemPtr;
-
- if (GetItemFromObj(interp, mbPtr, objv[3], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- return TCL_OK;
- }
- iconOption.clientData = mbPtr;
- return Blt_ConfigureValueFromObj(interp, mbPtr->tkwin, itemSpecs,
- (char *)itemPtr, objv[4], BLT_CONFIG_OBJV_ONLY);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ItemConfigureOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .mbar item configure $button ?option value?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ItemConfigureOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
- Item *itemPtr;
- int result;
-
- if (GetItemFromObj(interp, mbPtr, objv[3], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- return TCL_OK;
- }
- iconOption.clientData = mbPtr;
- if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, mbPtr->tkwin, itemSpecs,
- (char *)itemPtr, (Tcl_Obj *)NULL, BLT_CONFIG_OBJV_ONLY);
- } else if (objc == 5) {
- return Blt_ConfigureInfoFromObj(interp, mbPtr->tkwin, itemSpecs,
- (char *)itemPtr, objv[4], BLT_CONFIG_OBJV_ONLY);
- }
- Tcl_Preserve(itemPtr);
- result = ConfigureItem(interp, itemPtr, objc - 4, objv + 4,
- BLT_CONFIG_OBJV_ONLY);
- Tcl_Release(itemPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- mbPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(mbPtr);
- return TCL_OK;
-}
-
-
-static Blt_OpSpec itemOps[] =
-{
- {"cget", 2, ItemCgetOp, 5, 5, "item option",},
- {"configure", 2, ItemConfigureOp, 4, 0, "item ?option value?...",},
-};
-
-static int nItemOps = sizeof(itemOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * ItemOp --
- *
- * This procedure handles item operations.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ItemOp(
- ClientData clientData, /* Information about the widget. */
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument vector. */
-{
- Tcl_ObjCmdProc *proc;
- Menubar *mbPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nItemOps, itemOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(mbPtr);
- result = (*proc) (clientData, interp, objc, objv);
- Tcl_Release(mbPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Deletes one or more item from the menubar.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * The menubar is redrawn.
- *
- * .mbar delete but1 but2 but3 but4...
- *
- *---------------------------------------------------------------------------
- */
-static int
-DeleteOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
- int i;
-
- for (i = 2; i < objc; i++) {
- Item *itemPtr;
-
- if (GetItemFromObj(interp, mbPtr, objv[i], &itemPtr) != TCL_OK) {
- RenumberItems(mbPtr);
- EventuallyRedraw(mbPtr);
- return TCL_ERROR;
- }
- if (itemPtr != NULL) {
- DestroyItem(itemPtr);
- }
- }
- RenumberItems(mbPtr);
- EventuallyRedraw(mbPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- * Returns the index of the designated item or -1 if it doesn't
- * exist.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * The menubar is redrawn.
- *
- * .mbar index $item
- *
- *---------------------------------------------------------------------------
- */
-static int
-IndexOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
- Item *itemPtr;
- int index;
-
- index = -1;
- if (GetItemFromObj(interp, mbPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr != NULL) {
- index = itemPtr->index;
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InsertOp --
- *
- * Inserts a new item into the menubar.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * The menubar is redrawn.
- *
- * .mbar insert ?type? -1 -text "fred" -tags ""
- *
- *---------------------------------------------------------------------------
- */
-static int
-InsertOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_ChainLink before;
- Item *itemPtr;
- Menubar *mbPtr = clientData;
- char c;
- const char *string;
- int length, type;
- long insertPos;
-
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- type = ITEM_BUTTON;
- if ((c == 'b') && (strncmp(string, "button", length) == 0)) {
- type = ITEM_BUTTON;
- objc--, objv--;
- } else if ((c == 's') && (strncmp(string, "separator", length) == 0)) {
- type = ITEM_SEPARATOR;
- objc--, objv--;
- } else if ((c == 's') && (strncmp(string, "filler", length) == 0)) {
- type = ITEM_FILLER;
- objc--, objv--;
- }
- if (Blt_GetPositionFromObj(interp, objv[2], &insertPos) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((insertPos == -1) ||
- (insertPos >= Blt_Chain_GetLength(mbPtr->chain))) {
- before = NULL; /* Insert at end of list. */
- } else {
- before = Blt_Chain_GetNthLink(mbPtr->chain, insertPos);
- }
- itemPtr = NewItem(mbPtr, type);
- if (ConfigureItem(interp, itemPtr, objc - 3, objv + 3, 0) != TCL_OK) {
- DestroyItem(itemPtr);
- return TCL_ERROR; /* Error configuring the entry. */
- }
- EventuallyRedraw(mbPtr);
- Blt_Chain_LinkBefore(mbPtr->chain, itemPtr->link, before);
- RenumberItems(mbPtr);
- Tcl_SetLongObj(Tcl_GetObjResult(interp), itemPtr->index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InvokeOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .mbar invoke $item
- *
- *---------------------------------------------------------------------------
- */
-static int
-InvokeOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
- Item *itemPtr;
- int result;
-
- if (GetItemFromObj(interp, mbPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((itemPtr == NULL) ||
- ((itemPtr->flags & (STATE_DISABLED|ITEM_BUTTON)) != ITEM_BUTTON)) {
- return TCL_OK; /* Item is currently disabled. */
- }
- result = TCL_OK;
- if (itemPtr->cmdObjPtr != NULL) {
- Tcl_Preserve(itemPtr);
- Tcl_IncrRefCount(itemPtr->cmdObjPtr);
- result = Tcl_EvalObjEx(interp, itemPtr->cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(itemPtr->cmdObjPtr);
- Tcl_Release(itemPtr);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MoveOp --
- *
- * Moves a item to a new location.
- *
- * .mbar move but1 after|before but2
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-MoveOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
- Item *itemPtr, *b2Ptr;
- char c;
- const char *string;
- int isBefore;
- int length;
-
- if (GetItemFromObj(interp, mbPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- return TCL_OK;
- }
- string = Tcl_GetStringFromObj(objv[3], &length);
- c = string[0];
- if ((c == 'b') && (strncmp(string, "before", length) == 0)) {
- isBefore = TRUE;
- } else if ((c == 'a') && (strncmp(string, "after", length) == 0)) {
- isBefore = FALSE;
- } else {
- Tcl_AppendResult(interp, "bad key word \"", string,
- "\": should be \"after\" or \"before\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (GetItemFromObj(interp, mbPtr, objv[4], &b2Ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- return TCL_OK;
- }
- Blt_Chain_UnlinkLink(mbPtr->chain, itemPtr->link);
- if (isBefore) {
- Blt_Chain_LinkBefore(mbPtr->chain, itemPtr->link, b2Ptr->link);
- } else {
- Blt_Chain_LinkAfter(mbPtr->chain, itemPtr->link, b2Ptr->link);
- }
- RenumberItems(mbPtr);
- EventuallyRedraw(mbPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * Lists the names of the items in the menubar.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * The menubar is redrawn.
- *
- * .mbar names ?pattern?
- *
- *---------------------------------------------------------------------------
- */
-static int
-NamesOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
- Tcl_Obj *listObjPtr;
- int i;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (i = 2; i < objc; i++) {
- const char *pattern;
- Blt_ChainLink link;
-
- pattern = Tcl_GetString(objv[i]);
- for (link = Blt_Chain_FirstLink(mbPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Item *itemPtr;
- Tcl_Obj *objPtr;
-
- itemPtr = Blt_Chain_GetValue(link);
- if (Tcl_StringMatch(itemPtr->text, pattern)) {
- if (itemPtr->text == emptyString) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- objPtr = Tcl_NewStringObj(itemPtr->text, -1);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PostOp --
- *
- * Posts the menu associated with this item.
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .mbar post $item
- *
- *---------------------------------------------------------------------------
- */
-static int
-PostOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
- Item *itemPtr;
-
- if (GetItemFromObj(interp, mbPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- if (mbPtr->postedPtr != NULL) {
- UnpostMenu(mbPtr->postedPtr);
- }
- return TCL_OK;
- }
- if ((itemPtr->flags & (STATE_POSTED|STATE_DISABLED|ITEM_BUTTON)) !=
- ITEM_BUTTON) {
- return TCL_OK; /* Item's menu is currently posted or entry
- * is disabled. */
- }
- if (itemPtr->menuObjPtr == NULL) {
- return TCL_OK;
- }
- if (mbPtr->postedPtr != NULL) {
- UnpostMenu(mbPtr->postedPtr);
- }
- if (itemPtr != NULL) {
- PostMenu(itemPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UndockOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .menubar dock
- * .menubar undock
- *---------------------------------------------------------------------------
- */
-static int
-UndockOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
-
- if (mbPtr->floatWin != NULL) {
- DestroyFloat(mbPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnpostOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .mbar unpost $item
- *
- *---------------------------------------------------------------------------
- */
-static int
-UnpostOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Menubar *mbPtr = clientData;
- Item *itemPtr;
-
- if (GetItemFromObj(interp, mbPtr, objv[2], &itemPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (itemPtr == NULL) {
- return TCL_OK;
- }
- if ((itemPtr->flags & (STATE_POSTED|STATE_DISABLED|ITEM_BUTTON)) !=
- ITEM_BUTTON) {
- return TCL_OK; /* Item's menu is currently posted or entry
- * is disabled. */
- }
- if (itemPtr->menuObjPtr == NULL) {
- return TCL_OK;
- }
- UnpostMenu(itemPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MenubarCmd --
- *
- * This procedure is invoked to process the "menubar" command. See
- * the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-static Blt_OpSpec menubarOps[] =
-{
- {"activate", 2, ActivateOp, 3, 3, "item",},
- {"add", 2, AddOp, 3, 3, "?option value...?",},
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"configure", 2, ConfigureOp, 2, 0, "?option value?...",},
- {"delete", 2, DeleteOp, 2, 0, "item ?item?",},
- {"dock", 2, DockOp, 2, 2, "",},
- {"index", 3, IndexOp, 3, 3, "item",},
- {"insert", 3, InsertOp, 2, 2, "position ?option value...?",},
- {"invoke", 3, InvokeOp, 3, 3, "item",},
- {"item", 3, ItemOp, 2, 0, "args",},
- {"move", 1, MoveOp, 2, 2, "position item ?item?",},
- {"names", 1, NamesOp, 2, 0, "?pattern...?",},
- {"post", 1, PostOp, 3, 3, "item",},
- {"undock", 3, UndockOp, 2, 2, "",},
- {"unpost", 3, UnpostOp, 3, 3, "item",},
-};
-
-static int nMenubarOps = sizeof(menubarOps) / sizeof(Blt_OpSpec);
-
-static int
-MenubarInstCmdProc(
- ClientData clientData, /* Information about the widget. */
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument vector. */
-{
- Tcl_ObjCmdProc *proc;
- Menubar *mbPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nMenubarOps, menubarOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(mbPtr);
- result = (*proc) (clientData, interp, objc, objv);
- Tcl_Release(mbPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MenubarInstCmdDeletedProc --
- *
- * This procedure can be called if the window was destroyed (tkwin will
- * be NULL) and the command was deleted automatically. In this case, we
- * need to do nothing.
- *
- * Otherwise this routine was called because the command was deleted.
- * Then we need to clean-up and destroy the widget.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MenubarInstCmdDeletedProc(ClientData clientData)
-{
- Menubar *mbPtr = clientData; /* Pointer to widget record. */
-
- if (mbPtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = mbPtr->tkwin;
- mbPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MenubarCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-MenubarCmd(
- ClientData clientData, /* Main window associated with interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- Menubar *mbPtr;
- Tcl_CmdInfo cmdInfo;
- Tk_Window tkwin;
- char *path;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * First time in this interpreter, set up procs and initialize various
- * bindings for the widget. If the proc doesn't already exist, source it
- * from "$blt_library/menubar.tcl". We've deferred sourcing this file
- * until now so that the user could reset the variable $blt_library from
- * within her script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::Menubar::PostMenu", &cmdInfo)) {
- static char cmd[] = "source [file join $blt_library menubar.tcl]";
-
- if (Tcl_GlobalEval(interp, cmd) != TCL_OK) {
- char info[200];
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- return TCL_ERROR;
- }
- }
- path = Tcl_GetString(objv[1]);
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), path,
- (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- mbPtr = NewMenubar(interp, tkwin);
-#define EVENT_MASK (ExposureMask|StructureNotifyMask|FocusChangeMask)
- Tk_CreateEventHandler(tkwin, EVENT_MASK, MenubarEventProc, mbPtr);
- Tk_SetClass(tkwin, "Menubar");
- mbPtr->cmdToken = Tcl_CreateObjCommand(interp, path,
- MenubarInstCmdProc, mbPtr, MenubarInstCmdDeletedProc);
- Blt_SetWindowInstanceData(tkwin, mbPtr);
- if (ConfigureMenubar(interp, mbPtr, objc-2, objv+2, 0) != TCL_OK) {
- Tk_DestroyWindow(mbPtr->tkwin);
- return TCL_ERROR;
- }
- Tcl_SetObjResult(interp, objv[1]);
- return TCL_OK;
-}
-
-int
-Blt_MenubarInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "menubar", MenubarCmd, };
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * DrawLabel --
- *
- * Draws the text associated with the label. This is used when the
- * widget acts like a standard label.
- *
- * Results:
- * Nothing.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawLabel(Menubar *mbPtr, Drawable drawable, int x, int y, int w, int h)
-{
- if (mbPtr->image != NULL) {
- int imgWidth, imgHeight;
-
- imgWidth = MIN(w, itemPtr->textWidth) - IPAD;
- imgHeight = MIN(h, itemPtr->textHeight);
- Tk_RedrawImage(IconImage(mbPtr->image), 0, 0, imgWidth, imgHeight,
- drawable, x + IPAD, y);
- } else {
- TextStyle ts;
- TextLayout *layoutPtr;
- GC gc;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, mbPtr->font);
- Blt_Ts_SetAnchor(ts, TK_ANCHOR_NW);
- Blt_Ts_SetJustify(ts, mbPtr->justify);
- Blt_Ts_SetUnderline(ts, mbPtr->underline);
- layoutPtr = Blt_Ts_CreateLayout(mbPtr->text, mbPtr->textLen, &ts);
- if (mbPtr->flags & STATE_POSTED) {
- gc = mbPtr->textPostedGC;
- } else if (mbPtr->flags & STATE_ACTIVE) {
- gc = mbPtr->textActiveGC;
- } else if (mbPtr->flags & STATE_DISABLED) {
- gc = mbPtr->textDisabledGC;
- } else {
- gc = mbPtr->textNormalGC;
- }
- Blt_DrawLayout(mbPtr->tkwin, drawable, gc, mbPtr->font,
- Tk_Depth(mbPtr->tkwin), 0.0f, x + IPAD, y, layoutPtr, w);
- Blt_Free(layoutPtr);
- }
-}
-#endif
-
-static void
-DrawMenubar(Menubar *mbPtr, Drawable drawable)
-{
- Blt_Background bg;
- int x, y;
- int w, h;
-
- /* Menubar background (just inside of focus highlight ring). */
-
- if (mbPtr->flags & STATE_POSTED) {
- bg = mbPtr->postedBg;
- } else if (mbPtr->flags & STATE_ACTIVE) {
- bg = mbPtr->activeBg;
- } else if (mbPtr->flags & STATE_DISABLED) {
- bg = mbPtr->disabledBg;
- } else {
- bg = mbPtr->normalBg;
- }
- Blt_FillBackgroundRectangle(mbPtr->tkwin, drawable, bg, 0, 0,
- Tk_Width(mbPtr->tkwin), Tk_Height(mbPtr->tkwin),
- mbPtr->borderWidth, TK_RELIEF_FLAT);
-
- x = y = mbPtr->inset;
- w = Tk_Width(mbPtr->tkwin) - (2 * mbPtr->inset);
- h = Tk_Height(mbPtr->tkwin) - (2 * mbPtr->inset);
-
- DrawItems(mbPtr, drawable);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayMenubar --
- *
- * This procedure is invoked to display a menubar widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the menubar.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayMenubar(ClientData clientData)
-{
- Menubar *mbPtr = clientData;
- Pixmap drawable;
- int ww, wh; /* Window width and height. */
-
- mbPtr->flags &= ~REDRAW_PENDING;
- if (mbPtr->tkwin == NULL) {
- return; /* Window destroyed (should not get here) */
- }
-#ifdef notdef
- fprintf(stderr, "Calling DisplayMenubar(%s)\n",
- Tk_PathName(mbPtr->tkwin));
-#endif
- ww = Tk_Width(mbPtr->tkwin);
- wh = Tk_Height(mbPtr->tkwin);
- if ((ww <= 1) || (wh <=1)) {
- /* Don't bother computing the layout until the window size is
- * something reasonable. */
- return;
- }
- if (mbPtr->flags & LAYOUT_PENDING) {
- ComputeMenubarGeometry(mbPtr);
- }
- if (!Tk_IsMapped(mbPtr->tkwin)) {
- /* The widget's window isn't displayed, so don't bother drawing
- * anything. By getting this far, we've at least computed the
- * coordinates of the menubar's new layout. */
- return;
- }
-
- /*
- * Create a pixmap the size of the window for double buffering.
- */
- drawable = Tk_GetPixmap(mbPtr->display, Tk_WindowId(mbPtr->tkwin),
- ww, wh, Tk_Depth(mbPtr->tkwin));
-#ifdef WIN32
- assert(drawable != None);
-#endif
- DrawMenubar(mbPtr, drawable);
- XCopyArea(mbPtr->display, drawable, Tk_WindowId(mbPtr->tkwin),
- mbPtr->textNormalGC, 0, 0, ww, wh, 0, 0);
- Tk_FreePixmap(mbPtr->display, drawable);
-}
diff --git a/blt3.0.1/src/bltNsUtil.c b/blt3.0.1/src/bltNsUtil.c
deleted file mode 100644
index 62f727d..0000000
--- a/blt3.0.1/src/bltNsUtil.c
+++ /dev/null
@@ -1,174 +0,0 @@
-
-/*
- * bltNsUtil.c --
- *
- * This module implements utility namespace procedures for the BLT toolkit.
- *
- * Copyright 1997-2008 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltNsUtil.h"
-
-/*
- * A Command structure exists for each command in a namespace. The Tcl_Command
- * opaque type actually refers to these structures.
- */
-
-typedef struct CompileProc CompileProc;
-typedef struct ImportRef ImportRef;
-typedef struct CommandTrace CommandTrace;
-
-typedef struct {
- Tcl_HashEntry *hPtr; /* Pointer to the hash table entry that refers
- * to this command. The hash table is either a
- * namespace's command table or an
- * interpreter's hidden command table. This
- * pointer is used to get a command's name
- * from its Tcl_Command handle. NULL means
- * that the hash table entry has been removed
- * already (this can happen if deleteProc
- * causes the command to be deleted or
- * recreated). */
- Tcl_Namespace *nsPtr; /* Points to the namespace containing this
- * command. */
- int refCount; /* 1 if in command hashtable plus 1 for each
- * reference from a CmdName TCL object
- * representing a command's name in a ByteCode
- * instruction sequence. This structure can be
- * freed when refCount becomes zero. */
- int cmdEpoch; /* Incremented to invalidate any references
- * that point to this command when it is
- * renamed, deleted, hidden, or exposed. */
- CompileProc *compileProc; /* Procedure called to compile command. NULL
- * if no compile proc exists for command. */
- Tcl_ObjCmdProc *objProc; /* Object-based command procedure. */
- ClientData objClientData; /* Arbitrary value passed to object proc. */
- Tcl_CmdProc *proc; /* String-based command procedure. */
- ClientData clientData; /* Arbitrary value passed to string proc. */
- Tcl_CmdDeleteProc *deleteProc;
- /* Procedure invoked when deleting command
- * to, e.g., free all client data. */
- ClientData deleteData; /* Arbitrary value passed to deleteProc. */
- int flags; /* Means that the command is in the process of
- * being deleted (its deleteProc is currently
- * executing). Other attempts to delete the
- * command should be ignored. */
- ImportRef *importRefPtr; /* List of each imported Command created in
- * another namespace when this command is
- * imported. These imported commands redirect
- * invocations back to this command. The list
- * is used to remove all those imported
- * commands when deleting this "real"
- * command. */
- CommandTrace *tracePtr; /* First in list of all traces set for this
- * command. */
-} Command;
-
-/*ARGSUSED*/
-Tcl_Namespace *
-Blt_GetCommandNamespace(Tcl_Command cmdToken)
-{
- Command *cmdPtr = (Command *)cmdToken;
-
- return (Tcl_Namespace *)cmdPtr->nsPtr;
-}
-
-Tcl_CallFrame *
-Blt_EnterNamespace(Tcl_Interp *interp, Tcl_Namespace *nsPtr)
-{
- Tcl_CallFrame *framePtr;
-
- framePtr = Blt_AssertMalloc(sizeof(Tcl_CallFrame));
- if (Tcl_PushCallFrame(interp, framePtr, (Tcl_Namespace *)nsPtr, 0)
- != TCL_OK) {
- Blt_Free(framePtr);
- return NULL;
- }
- return framePtr;
-}
-
-void
-Blt_LeaveNamespace(Tcl_Interp *interp, Tcl_CallFrame *framePtr)
-{
- Tcl_PopCallFrame(interp);
- Blt_Free(framePtr);
-}
-
-int
-Blt_ParseObjectName(Tcl_Interp *interp, const char *path,
- Blt_ObjectName *namePtr, unsigned int flags)
-{
- char *last, *colon;
-
- namePtr->nsPtr = NULL;
- namePtr->name = NULL;
- colon = NULL;
-
- /* Find the last namespace separator in the qualified name. */
- last = (char *)(path + strlen(path));
- while (--last > path) {
- if ((*last == ':') && (*(last - 1) == ':')) {
- last++; /* just after the last "::" */
- colon = last - 2;
- break;
- }
- }
- if (colon == NULL) {
- namePtr->name = path;
- if ((flags & BLT_NO_DEFAULT_NS) == 0) {
- namePtr->nsPtr = Tcl_GetCurrentNamespace(interp);
- }
- return TRUE; /* No namespace designated in name. */
- }
-
- /* Separate the namespace and the object name. */
- *colon = '\0';
- if (path[0] == '\0') {
- namePtr->nsPtr = Tcl_GetGlobalNamespace(interp);
- } else {
- namePtr->nsPtr = Tcl_FindNamespace(interp, (char *)path, NULL,
- (flags & BLT_NO_ERROR_MSG) ? 0 : TCL_LEAVE_ERR_MSG);
- }
- /* Repair the string. */ *colon = ':';
-
- if (namePtr->nsPtr == NULL) {
- return FALSE; /* Namespace doesn't exist. */
- }
- namePtr->name =last;
- return TRUE;
-}
-
-char *
-Blt_MakeQualifiedName(Blt_ObjectName *namePtr, Tcl_DString *resultPtr)
-{
- Tcl_DStringInit(resultPtr);
- if ((namePtr->nsPtr->fullName[0] != ':') ||
- (namePtr->nsPtr->fullName[1] != ':') ||
- (namePtr->nsPtr->fullName[2] != '\0')) {
- Tcl_DStringAppend(resultPtr, namePtr->nsPtr->fullName, -1);
- }
- Tcl_DStringAppend(resultPtr, "::", -1);
- Tcl_DStringAppend(resultPtr, (char *)namePtr->name, -1);
- return Tcl_DStringValue(resultPtr);
-}
-
diff --git a/blt3.0.1/src/bltNsUtil.h b/blt3.0.1/src/bltNsUtil.h
deleted file mode 100644
index 00769f3..0000000
--- a/blt3.0.1/src/bltNsUtil.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * bltNsUtil.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef BLT_NS_UTIL_H
-#define BLT_NS_UTIL_H 1
-
-#ifndef TCL_NAMESPACE_ONLY
-#define TCL_NAMESPACE_ONLY TCL_GLOBAL_ONLY
-#endif
-
-#define NS_SEARCH_NONE (0)
-#define NS_SEARCH_CURRENT (1<<0)
-#define NS_SEARCH_GLOBAL (1<<1)
-#define NS_SEARCH_BOTH (NS_SEARCH_GLOBAL | NS_SEARCH_CURRENT)
-
-typedef struct {
- const char *name;
- Tcl_Namespace *nsPtr;
-} Blt_ObjectName;
-
-#define BLT_NO_DEFAULT_NS (1<<0)
-#define BLT_NO_ERROR_MSG (1<<1)
-
-#ifndef USE_TCL_STUBS
-
-BLT_EXTERN Tcl_Command Tcl_FindCommand(Tcl_Interp *interp, const char *name,
- Tcl_Namespace *nsPtr, int flags);
-/*
- * Namespace procedures not prototyped defined in Tcl.h
- */
-BLT_EXTERN Tcl_Namespace *Tcl_GetCurrentNamespace(Tcl_Interp *interp);
-
-BLT_EXTERN Tcl_Namespace *Tcl_GetGlobalNamespace(Tcl_Interp *interp);
-
-BLT_EXTERN Tcl_Namespace *Tcl_CreateNamespace(Tcl_Interp *interp,
- const char *name, ClientData clientData,
- Tcl_NamespaceDeleteProc *nsDelProc);
-
-BLT_EXTERN void Tcl_DeleteNamespace(Tcl_Namespace *nsPtr);
-
-BLT_EXTERN Tcl_Namespace *Tcl_FindNamespace(Tcl_Interp *interp,
- const char *name, Tcl_Namespace *context, int flags);
-
-BLT_EXTERN int Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
- const char *name, int resetFlag);
-
-BLT_EXTERN Tcl_Var Tcl_FindNamespaceVar(Tcl_Interp *interp, const char *name,
- Tcl_Namespace *contextNsPtr, int flags);
-
-BLT_EXTERN void Tcl_PopCallFrame(Tcl_Interp *interp);
-
-BLT_EXTERN int Tcl_PushCallFrame(Tcl_Interp *interp, Tcl_CallFrame *framePtr,
- Tcl_Namespace *nsPtr, int isProcCallFrame);
-
-#endif /* USE_TCL_STUBS */
-
-/*
- * Auxillary procedures
- */
-BLT_EXTERN Tcl_Namespace *Blt_GetVariableNamespace(Tcl_Interp *interp,
- const char *varName);
-
-BLT_EXTERN Tcl_Namespace *Blt_GetCommandNamespace(Tcl_Command cmdToken);
-
-BLT_EXTERN Tcl_CallFrame *Blt_EnterNamespace(Tcl_Interp *interp,
- Tcl_Namespace *nsPtr);
-
-BLT_EXTERN void Blt_LeaveNamespace(Tcl_Interp *interp, Tcl_CallFrame *framePtr);
-
-BLT_EXTERN int Blt_ParseObjectName(Tcl_Interp *interp, const char *name,
- Blt_ObjectName *objNamePtr, unsigned int flags);
-
-BLT_EXTERN char *Blt_MakeQualifiedName(Blt_ObjectName *objNamePtr,
- Tcl_DString *resultPtr);
-
-#endif /* BLT_NS_UTIL_H */
diff --git a/blt3.0.1/src/bltOldConfig.c b/blt3.0.1/src/bltOldConfig.c
deleted file mode 100644
index 3aa0ebc..0000000
--- a/blt3.0.1/src/bltOldConfig.c
+++ /dev/null
@@ -1,293 +0,0 @@
-
-/*
- * bltOldConfig.c --
- *
- * This module implements custom configuration options for the BLT
- * toolkit.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include <stdarg.h>
-
-static int StringToPad(ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, const char *string, char *widgRec, int offset);
-static char *PadToString(ClientData clientData, Tk_Window tkwin, char *widgRec,
- int offset, Tcl_FreeProc **freeProcPtr);
-
-Tk_CustomOption bltPadOption =
-{
- StringToPad, PadToString, (ClientData)0
-};
-
-static int StringToDistance(ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, const char *string, char *widgRec, int flags);
-static char *DistanceToString(ClientData, Tk_Window, char *widgRec, int offset,
- Tcl_FreeProc **freeProcPtr);
-
-Tk_CustomOption bltDistanceOption =
-{
- StringToDistance, DistanceToString, (ClientData)PIXELS_NNEG
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPixels --
- *
- * Like Tk_GetPixels, but checks for negative, zero.
- * Can be PIXELS_POS, PIXELS_NNEG, or PIXELS_ANY.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetPixels(Tcl_Interp *interp, Tk_Window tkwin, const char *string,
- int check, int *valuePtr)
-{
- int length;
-
- if (Tk_GetPixels(interp, tkwin, string, &length) != TCL_OK) {
- return TCL_ERROR;
- }
- if (length >= SHRT_MAX) {
- Tcl_AppendResult(interp, "bad distance \"", string, "\": ",
- "too big to represent", (char *)NULL);
- return TCL_ERROR;
- }
- switch (check) {
- case PIXELS_NNEG:
- if (length < 0) {
- Tcl_AppendResult(interp, "bad distance \"", string, "\": ",
- "can't be negative", (char *)NULL);
- return TCL_ERROR;
- }
- break;
- case PIXELS_POS:
- if (length <= 0) {
- Tcl_AppendResult(interp, "bad distance \"", string, "\": ",
- "must be positive", (char *)NULL);
- return TCL_ERROR;
- }
- break;
- case PIXELS_ANY:
- break;
- }
- *valuePtr = length;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StringToDistance --
- *
- * Like TK_CONFIG_PIXELS, but adds an extra check for negative
- * values.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-StringToDistance(
- ClientData clientData, /* Indicated how to check distance */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Window */
- const char *string, /* Pixel value string */
- char *widgRec, /* Widget record */
- int offset) /* Offset of pixel size in record */
-{
- int *valuePtr = (int *)(widgRec + offset);
- return Blt_GetPixels(interp, tkwin, string, (unsigned long)clientData,
- valuePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DistanceToString --
- *
- * Returns the string representing the positive pixel size.
- *
- * Results:
- * The pixel size string is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static char *
-DistanceToString(
- ClientData clientData, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget structure record */
- int offset, /* Offset in widget record */
- Tcl_FreeProc **freeProcPtr) /* Not used. */
-{
- int value = *(int *)(widgRec + offset);
- char *result;
-
- result = Blt_AssertStrdup(Blt_Itoa(value));
- *freeProcPtr = (Tcl_FreeProc *)Blt_Free;
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StringToPad --
- *
- * Convert a string into two pad values. The string may be in one of
- * the following forms:
- *
- * n - n is a non-negative integer. This sets both
- * pad values to n.
- * {n m} - both n and m are non-negative integers. side1
- * is set to n, side2 is set to m.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interp->result.
- *
- * Side Effects:
- * The padding structure passed is updated with the new values.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-StringToPad(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Window */
- const char *string, /* Pixel value string */
- char *widgRec, /* Widget record */
- int offset) /* Offset of pad in widget */
-{
- Blt_Pad *padPtr = (Blt_Pad *)(widgRec + offset);
- const char **argv;
- int argc;
- int pad, result;
-
- if (Tcl_SplitList(interp, string, &argc, &argv) != TCL_OK) {
- return TCL_ERROR;
- }
- result = TCL_ERROR;
- if ((argc < 1) || (argc > 2)) {
- Tcl_AppendResult(interp, "wrong # elements in padding list",
- (char *)NULL);
- goto error;
- }
- if (Blt_GetPixels(interp, tkwin, argv[0], PIXELS_NNEG, &pad)
- != TCL_OK) {
- goto error;
- }
- padPtr->side1 = pad;
- if ((argc > 1) && (Blt_GetPixels(interp, tkwin, argv[1], PIXELS_NNEG, &pad)
- != TCL_OK)) {
- goto error;
- }
- padPtr->side2 = pad;
- result = TCL_OK;
-
- error:
- Blt_Free(argv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PadToString --
- *
- * Converts the two pad values into a TCL list. Each pad has two
- * pixel values. For vertical pads, they represent the top and bottom
- * margins. For horizontal pads, they're the left and right margins.
- * All pad values are non-negative integers.
- *
- * Results:
- * The padding list is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static char *
-PadToString(
- ClientData clientData, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Structure record */
- int offset, /* Offset of pad in record */
- Tcl_FreeProc **freeProcPtr) /* Not used. */
-{
- Blt_Pad *padPtr = (Blt_Pad *)(widgRec + offset);
- char *result;
- char string[200];
-
- sprintf_s(string, 200, "%d %d", padPtr->side1, padPtr->side2);
- result = Blt_AssertStrdup(string);
- *freeProcPtr = (Tcl_FreeProc *)Blt_Free;
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_OldConfigModified --
- *
- * Given the configuration specifications and one or more option
- * patterns (terminated by a NULL), indicate if any of the matching
- * configuration options has been reset.
- *
- * Results:
- * Returns 1 if one of the options has changed, 0 otherwise.
- *
- *---------------------------------------------------------------------------
- */
-int Blt_OldConfigModified
-TCL_VARARGS_DEF(Tk_ConfigSpec *, arg1)
-{
- va_list argList;
- Tk_ConfigSpec *specs;
- char *option;
-
- specs = TCL_VARARGS_START(Tk_ConfigSpec *, arg1, argList);
- while ((option = va_arg(argList, char *)) != NULL) {
- Tk_ConfigSpec *specPtr;
-
- for (specPtr = specs; specPtr->type != TK_CONFIG_END; specPtr++) {
- if ((Tcl_StringMatch(specPtr->argvName, option)) &&
- (specPtr->specFlags & TK_CONFIG_OPTION_SPECIFIED)) {
- va_end(argList);
- return 1;
- }
- }
- }
- va_end(argList);
- return 0;
-}
-
diff --git a/blt3.0.1/src/bltOp.h b/blt3.0.1/src/bltOp.h
deleted file mode 100644
index 5887a46..0000000
--- a/blt3.0.1/src/bltOp.h
+++ /dev/null
@@ -1,37 +0,0 @@
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_OpSpec --
- *
- * Structure to specify a set of operations for a TCL command.
- * This is passed to the Blt_GetOp procedure to look
- * for a function pointer associated with the operation name.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- const char *name; /* Name of operation */
- int minChars; /* Minimum # characters to disambiguate */
- void *proc;
- int minArgs; /* Minimum # args required */
- int maxArgs; /* Maximum # args required */
- const char *usage; /* Usage message */
-} Blt_OpSpec;
-
-typedef enum {
- BLT_OP_ARG0, /* Op is the first argument. */
- BLT_OP_ARG1, /* Op is the second argument. */
- BLT_OP_ARG2, /* Op is the third argument. */
- BLT_OP_ARG3, /* Op is the fourth argument. */
- BLT_OP_ARG4 /* Op is the fifth argument. */
-
-} Blt_OpIndex;
-
-#define BLT_OP_BINARY_SEARCH 0
-#define BLT_OP_LINEAR_SEARCH 1
-
-BLT_EXTERN void *Blt_GetOpFromObj(Tcl_Interp *interp, int nSpecs,
- Blt_OpSpec *specs, int operPos, int objc, Tcl_Obj *const *objv,
- int flags);
-
diff --git a/blt3.0.1/src/bltPaintDraw.c b/blt3.0.1/src/bltPaintDraw.c
deleted file mode 100644
index 62c27a5..0000000
--- a/blt3.0.1/src/bltPaintDraw.c
+++ /dev/null
@@ -1,1464 +0,0 @@
-
-#ifdef notdef
-
-typedef struct {
- int type;
- union {
- Blt_Gradient *gradientPtr;
- Blt_Picture picture; /* Picture used to tile background. */
- } background;
- Blt_Pixel color1, color2; /* Gradient colors. */
-} Paint;
-
-#endif
-
-typedef struct {
- int left, right;
-} ScanLine;
-
-static ScanLine *
-MakeScanLines(size_t nLines)
-{
- ScanLine *coords;
- int i;
-
- coords = Blt_AssertMalloc(sizeof(ScanLine) * nLines);
- for(i = 0; i < nLines; i++) {
- coords[i].left = INT_MAX;
- coords[i].right = -INT_MAX;
- }
- return coords;
-}
-
-static void
-AddEllipseCoord(ScanLine *coords, int x, int y)
-{
- if (x < coords[y].left) {
- coords[y].left = x;
- }
- if (x > coords[y].right) {
- coords[y].right = x;
- }
-}
-
-static ScanLine *
-ComputeEllipseQuadrant(int a, int b)
-{
- ScanLine *coords;
- double t;
- int dx, dy;
- double a2, b2;
- double p, px, py;
- a2 = a * a;
- b2 = b * b;
-
- dx = 0;
- dy = b;
- px = 0; /* b2 * (dx + 1) */
- py = (double)(a2 + a2) * dy; /* a2 * (dy - 0.5) */
-
- coords = MakeScanLines(b + 1);
- if (coords == NULL) {
- return NULL;
- }
- AddEllipseCoord(coords, dx, dy);
-
- t = (b2 - (a2 * b) + (0.25 * a2));
- p = (int)ROUND(t);
- while (py > px) {
- dx++;
- px += b2 + b2;
- if (dy <= 0) {
- continue;
- }
- if (p < 0) {
- p += b2 + px;
- } else {
- dy--;
- py -= a2 + a2;
- p += b2 + px - py;
- }
- AddEllipseCoord(coords, dx, dy);
- }
- {
- double dx2, dy2;
-
- dx2 = (dx + 0.5) * (dx + 0.5);
- dy2 = (dy - 1) * (dy - 1);
- t = (b2 * dx2 + a2 * dy2 - (a2 * b2));
- p = (int)ROUND(t);
- }
- while (dy > 0) {
- dy--;
- py -= a2 + a2;
- if (p > 0) {
- p += a2 - py;
- } else {
- dx++;
- px += b2 + b2;
- p += a2 - py + px;
- }
- AddEllipseCoord(coords, dx, dy);
- }
- AddEllipseCoord(coords, dx, dy);
- return coords;
-}
-
-static INLINE void
-MixColors(Blt_Pixel *bp, Blt_Pixel *colorPtr)
-{
- if ((bp->Alpha == 0x00) || (colorPtr->Alpha == 0xFF)) {
- bp->u32 = colorPtr->u32;
- } else if (colorPtr->Alpha != 0x00) {
- unsigned char beta;
- int a, r, g, b, t;
-
- /* beta = 1 - alpha */
- beta = colorPtr->Alpha ^ 0xFF;
- r = colorPtr->Red + imul8x8(beta, bp->Red, t);
- g = colorPtr->Green + imul8x8(beta, bp->Green, t);
- b = colorPtr->Blue + imul8x8(beta, bp->Blue, t);
- a = colorPtr->Alpha + imul8x8(beta, bp->Alpha, t);
- bp->Red = (r > 255) ? 255 : ((r < 0) ? 0 : r);
- bp->Green = (g > 255) ? 255 : ((g < 0) ? 0 : g);
- bp->Blue = (b > 255) ? 255 : ((b < 0) ? 0 : b);
- bp->Alpha = 0xFF;
- }
-}
-
-static void INLINE
-PaintPixel(Pict *destPtr, int x, int y, Blt_Pixel *colorPtr)
-{
- if ((x >= 0) && (x < destPtr->width) && (y >= 0) && (y < destPtr->height)) {
- MixColors(Blt_PicturePixel(destPtr, x, y), colorPtr);
- }
-}
-
-static void INLINE
-FillHorizontalLine(Pict *destPtr, int x1, int x2, int y, Blt_Pixel *colorPtr,
- int blend)
-{
- if ((y >= 0) && (y < destPtr->height)) {
- Blt_Pixel *dp, *dend;
-
- if (x1 > x2) {
- int tmp;
-
- tmp = x1, x1 = x2, x2 = tmp;
- }
- x1 = MAX(x1, 0);
- x2 = MIN(x2, destPtr->width - 1);
- dp = destPtr->bits + (y * destPtr->pixelsPerRow) + x1;
- dend = destPtr->bits + (y * destPtr->pixelsPerRow) + x2;
- if (blend) {
- for (/*empty*/; dp <= dend; dp++) {
- MixColors(dp, colorPtr);
- }
- } else {
- for (/*empty*/; dp < dend; dp++) {
- dp->u32 = colorPtr->u32;
- }
- }
- }
-}
-
-static void INLINE
-FillVerticalLine(Pict *destPtr, int x, int y1, int y2, Blt_Pixel *colorPtr,
- int blend)
-{
- if ((x >= 0) && (x < destPtr->width)) {
- Blt_Pixel *dp, *dend;
-
- if (y1 > y2) {
- int tmp;
-
- tmp = y1, y1 = y2, y2 = tmp;
- }
- y1 = MAX(y1, 0);
- y2 = MIN(y2, destPtr->height - 1);
- dp = destPtr->bits + (y1 * destPtr->pixelsPerRow) + x;
- dend = destPtr->bits + (y2 * destPtr->pixelsPerRow) + x;
- if (blend) {
- for (/*empty*/; dp <= dend; dp += destPtr->pixelsPerRow) {
- MixColors(dp, colorPtr);
- }
- } else {
- for (/*empty*/; dp <= dend; dp += destPtr->pixelsPerRow) {
- dp->u32 = colorPtr->u32;
- }
- }
- }
-}
-
-static void
-PaintThickRoundedRectangle(
- Blt_Picture picture,
- int xOrigin, int yOrigin, /* Upper left corner of rectangle. */
- int w, int h, int r,
- int lineWidth,
- Blt_Pixel *colorPtr)
-{
- Blt_Pixel fill, edge;
- int x1, x2, y1, y2;
- int blend = 1;
-
- fill = PremultiplyAlpha(colorPtr, 255);
- edge.u32 = 0xFF000000;
- {
- int d;
-
- d = MIN(w, h) / 2;
- if (r > d) {
- r = d;
- }
- if ((r > 0) && (r < lineWidth)) {
- r = lineWidth;
- }
- }
-#ifdef notdef
- fprintf(stderr, "Paint Thick Rounded Rectangle\n");
-#endif
- /* Compute the coordinates of the four corner radii. */
- x1 = xOrigin + r;
- y1 = yOrigin + r;
- x2 = xOrigin + w - r - 1;
- y2 = yOrigin + h - r - 1;
-
- if (lineWidth > r) {
- int left, right;
- int dy;
-
- /* Draw the extra width (not including the radius). */
- left = xOrigin;
- right = xOrigin + w - 1;
- for (dy = 0; dy < (lineWidth - r); dy++) {
- FillHorizontalLine(picture, left, right, y1 + dy, &fill, blend);
- FillHorizontalLine(picture, left, right, y2 - dy, &fill, blend);
- }
- }
-
- {
- int y;
- int left, right, midleft, midright, midtop, midbottom;
- int mid;
-
- left = xOrigin;
- midleft = xOrigin + (lineWidth - 1);
- right = xOrigin + w - 1;
- midright = right - (lineWidth - 1);
-
- mid = MAX(r, lineWidth - 1);
- /* Draw the left/right edges of the interior rectangle */
- if (lineWidth > r) {
- midtop = yOrigin + mid + 1;
- midbottom = yOrigin + h - mid - 1;
- } else {
- midtop = yOrigin + mid;
- midbottom = yOrigin + h - mid;
- }
- for (y = midtop; y < midbottom; y++) {
- FillHorizontalLine(picture, left, midleft, y, &fill, blend);
- FillHorizontalLine(picture, midright, right, y, &fill, blend);
- }
- }
-
- if (r > 0) {
- ScanLine *outer, *inner;
- int dy;
- int dx1, dx2;
-
- lineWidth--;
- outer = ComputeEllipseQuadrant(r, r);
- inner = ComputeEllipseQuadrant(r - lineWidth, r - lineWidth);
-
- dy = 1;
- if (lineWidth <= r) {
- /* Draw the bend from the left/right edge to each radius. */
- for (dy = 1; dy < (r - lineWidth); dy++) {
- dx1 = outer[dy].right, dx2 = inner[dy].left;
- FillHorizontalLine(picture, x1-dx1, x1-dx2, y1-dy, &fill,blend);
- FillHorizontalLine(picture, x2+dx2, x2+dx1, y1-dy, &fill,blend);
- FillHorizontalLine(picture, x1-dx1, x1-dx2, y2+dy, &fill,blend);
- FillHorizontalLine(picture, x2+dx2, x2+dx1, y2+dy, &fill,blend);
- }
- }
- /* Draw the top/bottom bend from the line width to the radius */
- for (/* empty */; dy <= r; dy++) {
- int dx;
-
- dx = outer[dy].right;
-#ifdef notdef
- fprintf(stderr, "r=%d, dx=%d w=%d x1=%d x2=%d\n", r, dx, w, x1, x2);
- fprintf(stderr, "x0=%d\n", xOrigin);
-#endif
- FillHorizontalLine(picture, x1 - dx, x2 + dx, y1 - dy, &fill,blend);
- FillHorizontalLine(picture, x1 - dx, x2 + dx, y2 + dy, &fill,blend);
- }
- Blt_Free(outer);
- Blt_Free(inner);
- }
-}
-
-static void
-PaintRoundedRectangle(
- Blt_Picture picture,
- int xOrigin, int yOrigin,
- int width, int height,
- int r,
- Blt_Pixel *colorPtr)
-{
- Blt_Pixel fill;
- int x1, x2, y1, y2; /* Centers of each corner */
- int blend = 1;
- {
- int w2, h2;
-
- /* Radius of each rounded corner can't be bigger than half the width
- * or height of the rectangle. */
- w2 = width / 2;
- h2 = height / 2;
- if (r > w2) {
- r = w2;
- }
- if (r > h2) {
- r = h2;
- }
- }
-
- x1 = xOrigin + r;
- y1 = yOrigin + r;
- x2 = xOrigin + width - r - 1;
- y2 = yOrigin + height - r - 1;
-
- fill = PremultiplyAlpha(colorPtr, 255);
-
- {
- /* Rectangular interior. */
- int left, right;
- int y;
-
- left = xOrigin;
- right = xOrigin + width - 1;
- for (y = y1; y <= y2; y++) {
- FillHorizontalLine(picture, left, right, y, &fill, blend);
- }
- }
- if (r > 0) {
- ScanLine *outer;
- int dy;
-
- outer = ComputeEllipseQuadrant(r, r);
- for (dy = 1; dy <= r; dy++) {
- int dx;
-
- dx = outer[dy].right;
- FillHorizontalLine(picture, x1 - dx, x2 + dx, y1 - dy, &fill, blend);
- FillHorizontalLine(picture, x1 - dx, x2 + dx, y2 + dy, &fill, blend);
- }
- Blt_Free(outer);
- }
-}
-#ifdef notdef
-static Pict *
-FilledCircle(int diam, Blt_Pixel *colorPtr)
-{
- Pict *destPtr;
- Blt_Pixel edge, interior;
- double t;
- int r, r2;
- int x, y;
- int y1, y2;
-
- diam |= 0x01;
- r = diam / 2;
- r2 = r * r;
- destPtr = Blt_CreatePicture(diam, diam);
- t = 0.0;
- x = r;
- interior = PremultiplyAlpha(color, 255);
- HorizLine(destPtr, x - r, x + r, r, interior); /* Center line */
- y = 0;
- while (x > y) {
- double z;
- double d, q;
- unsigned char a;
-
- y++;
- z = sqrt(r2 - (y * y));
- d = floor(z) - z;
- if (d < t) {
- x--;
- }
- q = FABS(d * 255.0);
- a = (unsigned int)CLAMP(q);
- edge = PremultiplyAlpha(color, (unsigned int)CLAMP(q));
-
- /* By symmetry we can fill upper and lower scan lines. */
- PutPixel(destPtr, r - x - 1, r + y, edge);
- HorizLine(destPtr, r - x, r + x, r + y, interior);
- PutPixel(destPtr, r + x + 1, r + y, edge);
-
-
- PutPixel(destPtr, r - x - 1, r - y, edge);
- HorizLine(destPtr, r - x, r + x, r - y, interior);
- PutPixel(destPtr, r + x + 1, r - y, edge);
-
- t = d;
- }
- y1 = r - y;
- y2 = r + y;
- x = 0;
- y = r;
- t = 0;
- VertLine(destPtr, r, 0, y1, interior); /* Center line */
- VertLine(destPtr, r, y2, r + r, interior); /* Center line */
- while (y > x) {
- double z;
- double d, q;
-
- x++;
- z = sqrt(r2 - (x * x));
- d = floor(z) - z;
- if (d < t) {
- y--;
- }
- q = FABS(d * 255.0);
- edge = PremultiplyAlpha(color, (unsigned int)CLAMP(q));
-
- /* By symmetry we can fill upper and lower scan lines. */
- PutPixel(destPtr, r - x, r - y - 1, edge);
- VertLine(destPtr, r - x, r - y, y1, interior);
- VertLine(destPtr, r - x, y2, r + y, interior);
- PutPixel(destPtr, r - x, r + y + 1, edge);
-
- PutPixel(destPtr, r + x, r - y - 1, edge);
- VertLine(destPtr, r + x, r - y, y1, interior);
- VertLine(destPtr, r + x, y2, r + y, interior);
- PutPixel(destPtr, r + x, r + y + 1, edge);
-
- t = d;
- }
- return destPtr;
-}
-
-static Pict *
-FilledOval(int width, int height, Color color)
-{
- Pict *destPtr;
- Color edge, interior;
- double t;
- int r, r2;
- int x, y;
- int diam, offset;
- int x1, x2, y1, y2;
-
- t = 0.0;
- interior = PremultiplyAlpha(color, 255);
- if (width < height) {
- diam = width;
- diam |= 0x1;
- r = diam / 2;
- r2 = r * r;
- width = diam;
- offset = height - width;
- destPtr = Blt_CreatePicture(width, height);
- /* Fill the center rectangle */
- y1 = r, y2 = height - r - 1;
- for (y = y1; y <= y2; y++) {
- HorizLine(destPtr, 0, width - 1, y, interior);
- }
- x1 = x2 = r;
- } else {
- diam = height;
- diam |= 0x1;
- r = diam / 2;
- r2 = r * r;
- height = diam;
- offset = width - height;
- destPtr = Blt_CreatePicture(width, height);
- y1 = y2 = r;
- x1 = r, x2 = width - r - 1;
- HorizLine(destPtr, 0, width - 1, r, interior); /* Center line */
- for (y = 0; y < y1; y++) {
- HorizLine(destPtr, x1, x2, y, interior);
- }
- for (y = y2; y < height; y++) {
- HorizLine(destPtr, x1, x2, y, interior);
- }
- }
- y = 0;
- x = r;
- while (x > y) {
- double z;
- double d, q;
- unsigned char a;
- y++;
- z = sqrt(r2 - (y * y));
- d = floor(z) - z;
- if (d < t) {
- x--;
- }
- q = FABS(d * 255.0);
- a = (unsigned int)CLAMP(q);
- edge = PremultiplyAlpha(color, (unsigned int)CLAMP(q));
-
- /* By symmetry we can fill upper and lower scan lines. */
- PutPixel(destPtr, x1 - x - 1, y2 + y, edge);
- HorizLine(destPtr, x1 - x, x2 + x, y2 + y, interior);
- PutPixel(destPtr, x2 + x + 1, y2 + y, edge);
-
- PutPixel(destPtr, x1 - x - 1, y1 - y, edge);
- HorizLine(destPtr, x1 - x, x2 + x, y1 - y, interior);
- PutPixel(destPtr, x2 + x + 1, y1 - y, edge);
- t = d;
- }
- x = 0;
- y = r;
- t = 0;
- VertLine(destPtr, r, 0, y1, interior); /* Center line */
- VertLine(destPtr, r, y2, height - 1, interior); /* Center line */
- while (y > x) {
- double z;
- double d, q;
-
- x++;
- z = sqrt(r2 - (x * x));
- d = floor(z) - z;
- if (d < t) {
- y--;
- }
- q = FABS(d * 255.0);
- edge = PremultiplyAlpha(color, (unsigned int)CLAMP(q));
-
- /* By symmetry we can fill upper and lower scan lines. */
- PutPixel(destPtr, x1 - x, y1 - y - 1, edge);
- VertLine(destPtr, x1 - x, y1 - y, y1, interior);
- VertLine(destPtr, x1 - x, y2, y2 + y, interior);
- PutPixel(destPtr, x1 - x, y2 + y + 1, edge);
-
- PutPixel(destPtr, x2 + x, y1 - y - 1, edge);
- VertLine(destPtr, x2 + x, y1 - y, y1, interior);
- VertLine(destPtr, x2 + x, y2, y2 + y, interior);
- PutPixel(destPtr, x2 + x, y2 + y + 1, edge);
-
- t = d;
- }
- return destPtr;
-}
-#endif
-
-static void
-PaintCircle3(Blt_Picture src, int x, int y, int r, Blt_Pixel *colorPtr)
-{
- Blt_Pixel edge, interior;
- double t;
- int r2;
- int y1, y2;
-
- r2 = r * r;
- t = 0.0;
- x = r;
-
- interior.u32 = edge.u32 = colorPtr->u32;
- /* Center line */
- PutPixel(src, r - x, r, &edge);
- PutPixel(src, r + x, r, &edge);
- y = 0;
- while (x > y) {
- double z;
- double d, q;
- unsigned char a;
-
- y++;
- z = sqrt(r2 - (y * y));
- d = floor(z) - z;
- if (d < t) {
- x--;
- }
- q = FABS(d * 255.0);
- a = (unsigned char)CLAMP(q);
- edge.Alpha = a;
- interior.Alpha = ~a;
-
- /* By symmetry we can fill upper and lower scan lines. */
- PaintPixel(src, r - x - 1, r + y, &interior);
- PaintPixel(src, r + x + 1, r + y, &edge);
-
- PaintPixel(src, r - x - 1, r - y, &edge);
- PaintPixel(src, r + x + 1, r - y, &interior);
-
- t = d;
- }
- y1 = r - y;
- y2 = r + y;
- x = 0;
- y = r;
- t = 0;
- interior.u32 = edge.u32 = colorPtr->u32;
- VertLine(src, r, 0, y1, &edge); /* Center line */
- VertLine(src, r, y2, r + r, &edge);
- while (y > x) {
- unsigned char a;
- double z;
- double d, q;
-
- x++;
- z = sqrt(r2 - (x * x));
- d = floor(z) - z;
- if (d < t) {
- y--;
- }
- q = FABS(d * 255.0);
- a = (unsigned int)CLAMP(q);
- edge.Alpha = a;
- interior.Alpha = ~a;
-
- /* By symmetry we can fill upper and lower scan lines. */
- PaintPixel(src, r - x, r - y - 1, &edge);
- PaintPixel(src, r - x, r + y + 1, &interior);
-
- PaintPixel(src, r + x, r - y - 1, &interior);
- PaintPixel(src, r + x, r + y + 1, &edge);
-
- t = d;
- }
-}
-
-static INLINE float
-sqr(float x)
-{
- return x * x;
-}
-
-static void
-PaintCircle4(Pict *srcPtr, int x, int y, int r, Blt_Pixel *colorPtr)
-{
- int cx, cy;
- int x1, x2, y1, y2;
- int Fact;
- float RPF2, RMF2;
- float sqY, sqDist;
- float *sqX;
- float feather = 4.0;
- Blt_Pixel *srcRowPtr;
-
- cx = x, cy = y;
- // Determine some helpful values (singles)
- RPF2 = sqr(r + feather/2);
- RMF2 = sqr(r - feather/2);
-
- // Determine bounds:
- x1 = MAX(floor(cx - RPF2), 0);
- x2 = MIN(ceil (cx + RPF2), srcPtr->width - 1);
- y1 = MAX(floor(cy - RPF2), 0);
- y2 = MIN(ceil (cy + RPF2), srcPtr->height - 1);
-
- // Optimization run: find squares of X first
- sqX = Blt_AssertMalloc(sizeof(float) * (x2 - x1 + 1));
- for (x = x1; x <= x2; x++) {
- sqX[x - x1] = sqr(x - cx);
- }
- // Loop through Y values
- srcRowPtr = srcPtr->bits + (y1 * srcPtr->pixelsPerRow) + x1;
- for (y = y1; y <= y2; y++) {
- Blt_Pixel *sp;
-
- sqY = sqr(y - cy);
- // Loop through X values
- sp = srcRowPtr;
- for (x = x1; x <= x2; x++, sp++) {
- // determine squared distance from center for this pixel
- sqDist = sqY + sqX[x - x1];
- // inside inner circle? Most often..
- if (sqDist < RMF2) {
- // inside the inner circle.. just give the scanline the
- // new color
- sp->u32 = colorPtr->u32;
- } else if (sqDist < RPF2) { // inside outer circle?
- unsigned int a;
- // We are inbetween the inner and outer bound, now
- // mix the color
- Fact = ROUND(((r - sqrt(sqDist)) * 2 / feather)*127.5 + 127.5);
- // just in case limit to [0, 255]
- a = MAX(0, MIN(Fact, 255));
-#ifndef notdef
- BlendPixel(sp, colorPtr, a);
-#else
- sp->u32 = colorPtr->u32;
- sp->Alpha = a;
-#endif
- } else {
- /* do nothing */
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- srcPtr->flags &= ~BLT_PIC_ASSOCIATED_COLORS;
- Blt_Free(sqX);
-}
-
-static Pict *
-xFilledCircle(int diam, Blt_Pixel *colorPtr)
-{
- Pict *destPtr;
- Blt_Pixel edge, interior;
- double t;
- int r, r2;
- int x, y;
- int y1, y2;
-
- diam |= 0x01;
- r = diam / 2;
- r2 = r * r;
- destPtr = Blt_CreatePicture(diam, diam);
- t = 0.0;
- x = r;
- interior = PremultiplyAlpha(colorPtr, 255);
- HorizLine(destPtr, x - r, x + r, r, &interior); /* Center line */
- y = 0;
- while (x > y) {
- double z;
- double d, q;
- unsigned char a;
-
- y++;
- z = sqrt(r2 - (y * y));
- d = floor(z) - z;
- if (d < t) {
- x--;
- }
- q = FABS(d * 255.0);
- a = (unsigned int)CLAMP(q);
- edge = PremultiplyAlpha(colorPtr, (unsigned int)CLAMP(q));
-
- /* By symmetry we can fill upper and lower scan lines. */
- PutPixel(destPtr, r - x - 1, r + y, &edge);
- HorizLine(destPtr, r - x, r + x, r + y, &interior);
- PutPixel(destPtr, r + x + 1, r + y, &edge);
-
-
- PutPixel(destPtr, r - x - 1, r - y, &edge);
- HorizLine(destPtr, r - x, r + x, r - y, &interior);
- PutPixel(destPtr, r + x + 1, r - y, &edge);
-
- t = d;
- }
- y1 = r - y;
- y2 = r + y;
- x = 0;
- y = r;
- t = 0;
- VertLine(destPtr, r, 0, y1, &interior); /* Center line */
- VertLine(destPtr, r, y2, r + r, &interior); /* Center line */
- while (y > x) {
- double z;
- double d, q;
-
- x++;
- z = sqrt(r2 - (x * x));
- d = floor(z) - z;
- if (d < t) {
- y--;
- }
- q = FABS(d * 255.0);
- edge = PremultiplyAlpha(colorPtr, (unsigned int)CLAMP(q));
-
- /* By symmetry we can fill upper and lower scan lines. */
- PutPixel(destPtr, r - x, r - y - 1, &edge);
- VertLine(destPtr, r - x, r - y, y1, &interior);
- VertLine(destPtr, r - x, y2, r + y, &interior);
- PutPixel(destPtr, r - x, r + y + 1, &edge);
-
- PutPixel(destPtr, r + x, r - y - 1, &edge);
- VertLine(destPtr, r + x, r - y, y1, &interior);
- VertLine(destPtr, r + x, y2, r + y, &interior);
- PutPixel(destPtr, r + x, r + y + 1, &edge);
-
- t = d;
- }
- return destPtr;
-}
-
-static void
-FilledOval(Pict *destPtr, int destX, int destY, int ovalWidth, int ovalHeight,
- Blt_Pixel *colorPtr)
-{
- Blt_Pixel edge, interior;
- double t;
- int r, r2;
- int x, y;
- int diam, offset;
- int x1, x2, y1, y2;
- int blend = 1;
- t = 0.0;
-
- interior = PremultiplyAlpha(colorPtr, 255);
- if (ovalWidth < ovalHeight) {
- diam = ovalWidth;
- diam |= 0x1;
- r = diam / 2;
- r2 = r * r;
- ovalWidth = diam;
-
- offset = ovalHeight - ovalWidth;
-
- /* Fill the center rectangle */
- x1 = destX;
- x2 = destX + ovalWidth - 1;
- y1 = destY + r;
- y2 = destY + ovalHeight - r - 1;
- for (y = y1; y <= y2; y++) {
- FillHorizontalLine(destPtr, x1, x2, y, &interior, blend);
- }
- x1 = x2 = r;
- } else if (ovalWidth > ovalHeight) {
- diam = ovalHeight;
- diam |= 0x1;
- r = diam / 2;
- r2 = r * r;
- ovalHeight = diam;
- offset = ovalWidth - ovalHeight;
- y1 = y2 = destY + r;
- x1 = destX + r, x2 = destY + ovalWidth - r - 1;
- FillHorizontalLine(destPtr, destX, destX + ovalWidth - 1, y1,
- &interior, blend);
- for (y = destY; y < y1; y++) {
- FillHorizontalLine(destPtr, x1, x2, y, &interior, blend);
- }
- for (y = y2; y < destY + ovalHeight; y++) {
- FillHorizontalLine(destPtr, x1, x2, y, &interior, blend);
- }
- } else {
- diam = ovalWidth;
- diam |= 0x1;
- ovalHeight = ovalWidth = diam;
- r = diam / 2;
- r2 = r * r;
- /* Fill the center rectangle */
- x1 = destX;
- x2 = destX + ovalWidth - 1;
- y1 = destY + r;
- y2 = destY + ovalHeight - r - 1;
- }
- y = 0;
- x = r;
- while (x > y) {
- double z;
- double d, q;
- unsigned char a;
-
- y++;
- z = sqrt(r2 - (y * y));
- d = floor(z) - z;
- if (d < t) {
- x--;
- }
- q = FABS(d * 255.0);
- a = (unsigned int)CLAMP(q);
- edge = PremultiplyAlpha(colorPtr, (unsigned int)CLAMP(q));
-
- /* By symmetry we can fill upper and lower scan lines. */
- PaintPixel(destPtr, x1 - x - 1, y2 + y, &edge);
- FillHorizontalLine(destPtr, x1 - x, x2 + x, y2 + y, &interior, blend);
- PaintPixel(destPtr, x2 + x + 1, y2 + y, &edge);
-
- PaintPixel(destPtr, x1 - x - 1, y1 - y, &edge);
- FillHorizontalLine(destPtr, x1 - x, x2 + x, y1 - y, &interior, blend);
- PaintPixel(destPtr, x2 + x + 1, y1 - y, &edge);
- t = d;
- }
- x = 0;
- y = r;
- t = 0;
-
- FillVerticalLine(destPtr, destX + r, destY, y1, &interior, blend);
- FillVerticalLine(destPtr, destX + r, y2, destY + ovalHeight - 1, &interior,
- blend);
- while (y > x) {
- double z;
- double d, q;
-
- x++;
- z = sqrt(r2 - (x * x));
- d = floor(z) - z;
- if (d < t) {
- y--;
- }
- q = FABS(d * 255.0);
- edge = PremultiplyAlpha(colorPtr, (unsigned int)CLAMP(q));
-
- /* By symmetry we can fill upper and lower scan lines. */
- PaintPixel(destPtr, x1 - x, y1 - y - 1, &edge);
- FillVerticalLine(destPtr, x1 - x, y1 - y, y1, &interior, blend);
- FillVerticalLine(destPtr, x1 - x, y2, y2 + y, &interior, blend);
- PaintPixel(destPtr, x1 - x, y2 + y + 1, &edge);
-
- PaintPixel(destPtr, x2 + x, y1 - y - 1, &edge);
- FillVerticalLine(destPtr, x2 + x, y1 - y, y1, &interior, blend);
- FillVerticalLine(destPtr, x2 + x, y2, y2 + y, &interior, blend);
- PaintPixel(destPtr, x2 + x, y2 + y + 1, &edge);
-
- t = d;
- }
-}
-
-static void
-PaintArc(Pict *destPtr, int x1, int y1, int x2, int y2, int lineWidth,
- Blt_Pixel *colorPtr)
-{
- Blt_Pixel *dp;
- double t;
- int r2;
- int radius;
- int dx, dy;
- int x, y;
- int xoff, yoff;
- int fill = 1;
-
- t = 0.0;
- dx = x2 - x1;
- dy = y2 - y1;
- radius = MIN(dx, dy) / 2;
- xoff = x1;
- yoff = y1;
- x = radius;
- y = 0;
- dp = Blt_PicturePixel(destPtr, x + xoff - 1, y + yoff);
- dp->u32 = colorPtr->u32;
- r2 = radius * radius;
- if (fill) {
- PaintLineSegment(destPtr, x1, y + yoff, x + xoff - 2, y + yoff, 1,
- colorPtr);
- }
- while (x > y) {
- double z;
- double d, q;
- unsigned char a;
-
- y++;
- z = sqrt(r2 - (y * y));
- d = floor(z) - z;
- if (d < t) {
- x--;
- }
- dp = Blt_PicturePixel(destPtr, x + xoff, y + yoff);
- q = FABS(d * 255.0);
- a = (unsigned int)CLAMP(q);
- BlendPixel(dp, colorPtr, a);
- dp--; /* x - 1 */
- a = (unsigned int)CLAMP(255.0 - q);
- BlendPixel(dp, colorPtr, a);
- t = d;
- x1++;
- if (fill) {
- PaintLineSegment(destPtr, x1, y + yoff, x + xoff - 1, y + yoff, 1,
- colorPtr);
- }
- }
-}
-
-static void
-PaintFilledCircle(Pict *destPtr, int x, int y, int r, Blt_Pixel *colorPtr)
-{
- Blt_Pixel *destRowPtr;
- Blt_Pixel fill;
- int dy, d2;
- int inner, outer;
- int count;
-
- count = 0;
-
- inner = (r - 1) * (r - 1);
- outer = (r + 1) * (r + 1);
-
- fill = PremultiplyAlpha(colorPtr, 255);
- destRowPtr = destPtr->bits + ((y - r) * destPtr->pixelsPerRow) + (x - r);
- for (y = -r; y <= r; y++) {
- Blt_Pixel *dp, *dend;
- int dy2;
-
- dy2 = y * y;
- for (dp = destRowPtr, dend = dp + destPtr->width, x = -r;
- (x <= r) && (dp < dend); x++, dp++) {
- double d, z;
- int d2;
-
- d2 = dy2 + x * x;
- if (d2 > outer) {
- continue;
- }
- if (d2 < inner) {
- MixColors(dp, &fill); /* Interior */
- continue;
- }
- z = (double)r - sqrt((double)d2);
- count++;
- if (z > 1.0) {
- MixColors(dp, &fill); /* Interior */
- } else if (z > 0.0) {
- double q;
- unsigned char a;
- Blt_Pixel edge;
-
- q = z * 255.0;
- a = (unsigned int)CLAMP(q);
- edge = PremultiplyAlpha(colorPtr, a);
- MixColors(dp, &edge); /* Edge */
- }
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
-#ifdef notdef
- fprintf(stderr, "%d pixels %d sqrts\n", (r + r + 1) * (r + r + 1), count);
-#endif
-}
-
-static void
-PaintThinCircle(Pict *destPtr, int x, int y, int r, Blt_Pixel *colorPtr)
-{
- Blt_Pixel edge, fill;
- double r2;
- double t;
- int dx, dy;
-
- fill = PremultiplyAlpha(colorPtr, 255);
-
- PaintPixel(destPtr, x, y + r - 1, &fill);
- PaintPixel(destPtr, x, y - r + 1, &fill);
- PaintPixel(destPtr, x + r - 1, y, &fill);
- PaintPixel(destPtr, x - r + 1, y, &fill);
-
- r2 = r * r;
-
- dx = r, dy = 0;
- t = 0.0;
- while (dx > dy) {
- double z;
- double dist;
- double d, q;
- unsigned char a;
-
- dy++;
- z = sqrt(r2 - (dy * dy));
- d = floor(z) - z;
- if (d < t) {
- dx--;
- }
- dist = sqrt((dx * dx) + (dy * dy));
- q = FABS(d * 255.0);
- a = (unsigned int)CLAMP(q);
- edge = PremultiplyAlpha(colorPtr, a);
- fill = PremultiplyAlpha(colorPtr, ~a);
-
- /* By symmetry we can add pixels in 4 octants. */
- PaintPixel(destPtr, x + dx, y + dy, &edge);
- PaintPixel(destPtr, x + dx - 1, y + dy, &fill);
- PaintPixel(destPtr, x + dx, y - dy, &edge);
- PaintPixel(destPtr, x + dx - 1, y - dy, &fill);
- PaintPixel(destPtr, x - dx, y + dy, &edge);
- PaintPixel(destPtr, x - dx + 1, y + dy, &fill);
- PaintPixel(destPtr, x - dx, y - dy, &edge);
- PaintPixel(destPtr, x - dx + 1, y - dy, &fill);
- t = d;
- }
-
- dx = 0, dy = r;
- t = 0.0;
- while (dy > dx) {
- double z;
- double d, q;
- unsigned char a;
-
- dx++;
- z = sqrt(r2 - (dx * dx));
- d = floor(z) - z;
- if (d < t) {
- dy--;
- }
- q = FABS(d * 255.0);
- a = (unsigned char)CLAMP(q);
- edge = PremultiplyAlpha(colorPtr, a);
- fill = PremultiplyAlpha(colorPtr, ~a);
-
- PaintPixel(destPtr, x + dx, y + dy, &edge);
- PaintPixel(destPtr, x + dx, y + dy - 1, &fill);
- PaintPixel(destPtr, x - dx, y + dy, &edge);
- PaintPixel(destPtr, x - dx, y + dy - 1, &fill);
- PaintPixel(destPtr, x + dx, y - dy, &edge);
- PaintPixel(destPtr, x + dx, y - dy + 1, &fill);
- PaintPixel(destPtr, x - dx, y - dy, &edge);
- PaintPixel(destPtr, x - dx, y - dy + 1, &fill);
- t = d;
- }
-}
-
-
-static void
-PaintThinEllipse(
- Pict *destPtr,
- int x, int y, int a, int b,
- Blt_Pixel *colorPtr,
- int blend)
-{
- ScanLine *coords;
- Blt_Pixel fill;
- int dy;
- int dx1, dx2;
-
- coords = ComputeEllipseQuadrant(a, b);
- if (blend) {
- fill = PremultiplyAlpha(colorPtr, 255);
- } else {
- fill.u32 = colorPtr->u32;
- }
- if (coords == NULL) {
- return;
- }
- dx1 = coords[0].right;
- dx2 = coords[0].left;
- FillHorizontalLine(destPtr, x + dx2, x + dx1, y, &fill, blend);
- FillHorizontalLine(destPtr, x - dx1, x - dx2, y, &fill, blend);
- dx1 = coords[b].right;
- FillHorizontalLine(destPtr, x - dx1, x + dx1, y - b, &fill, blend);
- FillHorizontalLine(destPtr, x - dx1, x + dx1, y + b, &fill, blend);
- for (dy = 1; dy < b; dy++) {
- dx1 = coords[dy].right;
- dx2 = coords[dy].left;
- FillHorizontalLine(destPtr, x + dx2, x + dx1, y - dy, &fill, blend);
- FillHorizontalLine(destPtr, x + dx2, x + dx1, y + dy, &fill, blend);
- FillHorizontalLine(destPtr, x - dx1, x - dx2, y - dy, &fill, blend);
- FillHorizontalLine(destPtr, x - dx1, x - dx2, y + dy, &fill, blend);
- }
- Blt_Free(coords);
-}
-
-static void
-PaintThickEllipse(
- Blt_Picture picture,
- int x, int y, /* Center of the ellipse. */
- int a, /* Half the width of the ellipse. */
- int b, /* Half the height of the ellipse. */
- int lineWidth, /* Line width of the ellipse. Must be 1 or
- * greater. */
- Blt_Pixel *colorPtr,
- int blend)
-{
- ScanLine *outer, *inner;
- Blt_Pixel fill;
- int dy;
- int dx1, dx2;
-
- lineWidth--;
- outer = ComputeEllipseQuadrant(a, b);
- if (outer == NULL) {
- return;
- }
- inner = ComputeEllipseQuadrant(a - lineWidth, b - lineWidth);
- if (blend) {
- fill = PremultiplyAlpha(colorPtr, 255);
- } else {
- fill.u32 = colorPtr->u32;
- }
- dx1 = outer[0].right;
- dx2 = inner[0].left;
- FillHorizontalLine(picture, x + dx2, x + dx1, y, &fill, blend);
- FillHorizontalLine(picture, x - dx1, x - dx2, y, &fill, blend);
- for (dy = 1; dy < (b - lineWidth); dy++) {
- dx1 = outer[dy].right;
- dx2 = inner[dy].left;
- FillHorizontalLine(picture, x + dx2, x + dx1, y - dy, &fill, blend);
- FillHorizontalLine(picture, x + dx2, x + dx1, y + dy, &fill, blend);
- FillHorizontalLine(picture, x - dx1, x - dx2, y - dy, &fill, blend);
- FillHorizontalLine(picture, x - dx1, x - dx2, y + dy, &fill, blend);
- }
- for (/* empty */; dy <= b; dy++) {
- int dx;
-
- dx = outer[dy].right;
- FillHorizontalLine(picture, x - dx, x + dx, y + dy, &fill, blend);
- FillHorizontalLine(picture, x - dx, x + dx, y - dy, &fill, blend);
- }
- Blt_Free(outer);
- Blt_Free(inner);
-}
-
-
-static void
-PaintFilledEllipse(
- Blt_Picture picture,
- int x, int y, /* Center of the ellipse. */
- int a, /* Half the width of the ellipse. */
- int b, /* Half the height of the ellipse. */
- Blt_Pixel *colorPtr,
- int blend)
-{
- ScanLine *coords;
- Blt_Pixel fill;
- int dx, dy;
-
- coords = ComputeEllipseQuadrant(a, b);
- if (blend) {
- fill = PremultiplyAlpha(colorPtr, 255);
- } else {
- fill.u32 = colorPtr->u32;
- }
- if (coords == NULL) {
- return;
- }
- FillHorizontalLine(picture, x - a, x + a, y, &fill, blend);
- for (dy = 1; dy <= b; dy++) {
- dx = coords[dy].right;
- FillHorizontalLine(picture, x - dx, x + dx, y + dy, &fill, blend);
- FillHorizontalLine(picture, x - dx, x + dx, y - dy, &fill, blend);
- }
- Blt_Free(coords);
-}
-
-static void
-PaintEllipse(
- Blt_Picture picture,
- int x, int y, /* Center of the ellipse. */
- int a, /* Half the width of the ellipse. */
- int b, /* Half the height of the ellipse. */
- int lineWidth, /* Line width of the ellipse. If zero,
- * then draw a solid filled ellipse. */
- Blt_Pixel *colorPtr,
- int blend)
-{
- if ((lineWidth >= a) || (lineWidth >= b)) {
- lineWidth = 0;
- }
- if (lineWidth < 1) {
- PaintFilledEllipse(picture, x, y, a, b, colorPtr, blend);
- } else {
- PaintThickEllipse(picture, x, y, a, b, lineWidth, colorPtr, blend);
- }
-}
-
-static void
-PaintEllipseAA(
- Blt_Picture picture,
- int x, int y, /* Center of the ellipse. */
- int a, /* Half the width of the ellipse. */
- int b, /* Half the height of the ellipse. */
- int lineWidth, /* Line thickness of the ellipse. If zero,
- * then draw a solid filled ellipse. */
- Blt_Pixel *colorPtr)
-{
- PictRegion region;
- Blt_Picture big;
- int nSamples = 3;
- int ellipseWidth, ellipseHeight;
- int blend = 1;
-
- if ((lineWidth >= a) || (lineWidth >= b)) {
- lineWidth = 0;
- }
- ellipseWidth = a + a + 3;
- ellipseHeight = b + b + 3;
- region.x = x - (a + 1);
- region.y = y - (b + 1);
- region.w = ellipseWidth;
- region.h = ellipseHeight;
-
- if (!Blt_AdjustRegionToPicture(picture, ®ion)) {
- return; /* Ellipse is totally clipped. */
- }
- /* Scale the region forming the bounding box of the ellipse into a new
- * picture. The bounding box is scaled by *nSamples* times. */
- big = Blt_CreatePicture(ellipseWidth * nSamples, ellipseHeight * nSamples);
- if (big != NULL) {
- Blt_Picture tmp;
- int cx, cy;
- Blt_Pixel color;
-
- cx = a + 1;
- cy = b + 1;
- /* Now draw an ellipse scaled by the same amount. The center of the
- * ellipse is the center of the picture. */
- color.u32 = 0x00000000;
- Blt_BlankPicture(big, &color);
- color.u32 = 0xFF000000;
- PaintEllipse(big,
- cx * nSamples, /* Center of ellipse. */
- cy * nSamples,
- a * nSamples,
- b * nSamples,
- lineWidth * nSamples, /* Scaled line width. */
- &color,
- blend);
-
- /* Reduce the picture back to the original size using a simple box
- * filter for smoothing. */
- tmp = Blt_CreatePicture(ellipseWidth, ellipseHeight);
- Blt_ResamplePicture(tmp, big, bltBoxFilter, bltBoxFilter);
- Blt_FreePicture(big);
- Blt_ApplyColorToPicture(tmp, colorPtr);
- /* Replace the bounding box in the original with the new. */
- Blt_BlendPictures(picture, tmp, 0, 0, region.w, region.h,
- region.x, region.y);
- Blt_FreePicture(tmp);
- }
-}
-
-static void
-PaintCircle(
- Blt_Picture picture,
- int x, int y, /* Center of the circle in picture. */
- int r, /* Radius of the circle. */
- int lineWidth, /* Line width of the circle. */
- Blt_Pixel *colorPtr)
-{
- int blend = 1;
- if (lineWidth >= r) {
- lineWidth = 0;
- }
- if (lineWidth < 1) {
- PaintFilledEllipse(picture, x, y, r, r, colorPtr, blend);
- } else if (lineWidth == 1) {
- PaintThinEllipse(picture, x, y, r, r, colorPtr, blend);
- } else {
- PaintThickEllipse(picture, x, y, r, r, lineWidth, colorPtr, blend);
- }
-}
-
-
-static void
-PaintRectangle(
- Blt_Picture picture,
- int x, int y, /* Upper left corner of rectangle. */
- int width, int height, /* Dimension of rectangle. */
- int r, /* Radius of rounded corner. If zero, draw
- * square corners. */
- int lineWidth, /* Line width of the rectangle. If zero, then
- * draw a solid fill rectangle. */
- Blt_Pixel *colorPtr)
-{
- if (((lineWidth*2) >= width) || ((lineWidth*2) >= height)) {
- lineWidth = 0; /* Paint solid rectangle instead.*/
- }
- if (lineWidth == 0) {
- PaintRoundedRectangle(picture, x, y, width, height, r, colorPtr);
- } else {
- PaintThickRoundedRectangle(picture, x, y, width, height, r,
- lineWidth, colorPtr);
- }
-}
-
-static void
-PaintRectangleAA(
- Blt_Picture picture,
- int x, int y, /* Upper left corner of rectangle. */
- int w, int h, /* Dimension of rectangle. */
- int r, /* Radius of rounded corner. If zero,
- * draw square corners. */
- int lineWidth, /* Line width of the rectangle. If
- * zero, then draw a solid fill
- * rectangle. */
- Blt_Pixel *colorPtr)
-{
- Blt_Picture big; /* Super-sampled background. */
- int nSamples = 4;
- Blt_Picture tmp;
- int offset = 4;
- Blt_Pixel color;
-
- if (((lineWidth*2) >= w) || ((lineWidth*2) >= h)) {
- lineWidth = 0; /* Paint solid rectangle instead.*/
- }
- if (r < 0) {
- PaintRectangle(picture, x, y, w, h, r, lineWidth, colorPtr);
- return;
- }
- /*
- * Scale the region forming the bounding box of the ellipse into a new
- * picture. The bounding box is scaled by *nSamples* times.
- */
- big = Blt_CreatePicture((w+2*offset) * nSamples,
- (h+2*offset) * nSamples);
- color.u32 = 0x00;
- Blt_BlankPicture(big, &color);
- if (big == NULL) {
- return;
- }
- PaintRectangle(big, /* Contains super-sampled original
- * background. */
- 0, 0,
- w * nSamples, /* Scaled width */
- h * nSamples, /* Scaled height */
- r * nSamples, /* Scaled radius. */
- lineWidth * nSamples, /* Scaled line width. */
- colorPtr);
-
- /* Reduce the picture back to its original size using a simple box
- * filter for smoothing. */
- tmp = Blt_CreatePicture(w+2*offset, h+2*offset);
- Blt_ResamplePicture(tmp, big, bltBoxFilter, bltBoxFilter);
-
- /* Replace the bounding box in the original with the new. */
- Blt_BlendPictures(picture, tmp, 0, 0, w+offset, h+offset, x, y);
- Blt_FreePicture(big);
- Blt_FreePicture(tmp);
-}
-
-static void
-PaintRectangleShadow(
- Blt_Picture picture,
- int x, int y, /* Upper left corner of rectangle. */
- int w, int h, /* Dimension of rectangle. */
- int r, /* Radius of rounded corner. If zero, draw
- * square corners. */
- int lineWidth,
- Shadow *shadowPtr)
-{
- int dw, dh;
- Blt_Picture blur, tmp;
- Blt_Pixel color;
-
- dw = (w + shadowPtr->offset*2);
- dh = (h + shadowPtr->offset*2);
- blur = Blt_CreatePicture(dw, dh);
- color.u32 = 0x00;
- Blt_BlankPicture(blur, &color);
- color.Alpha = shadowPtr->alpha;
-#ifdef notdef
- /*
- * draw the rectangle.
- * blur into a slightly bigger picture (for blur width).
- * mask off original rectangle, leaving fringe blur.
- * blend into destination.
- */
- tmp = Blt_CreatePicture(dw, dh);
- color.u32 = 0x00;
- Blt_BlankPicture(tmp, &color);
- color.Alpha = 0xFF;
- PaintRectangle(tmp, 0, 0, w, h, r, lineWidth, &color);
- Blt_CopyPictureBits(blur, tmp, 0, 0, w, h, shadowPtr->offset*2,
- shadowPtr->offset*2);
- Blt_BlurPicture(blur, blur, shadowPtr->offset);
- color.u32 = 0x00;
- Blt_MaskPicture(blur, tmp, 0, 0, w, h, 0, 0, &color);
- Blt_BlendPictures(picture, blur, 0, 0, dw, dh, x, y);
- Blt_FreePicture(blur);
-#else
- PaintRectangle(blur, shadowPtr->offset, shadowPtr->offset, w, h, r,
- lineWidth, &color);
- Blt_BlurPicture(blur, blur, shadowPtr->offset/2);
- Blt_BlendPictures(picture, blur, 0, 0, dw, dh, x, y);
- Blt_FreePicture(blur);
-#endif
-}
-
-void
-Blt_PaintRectangle(
- Blt_Picture picture,
- int x, int y, /* Upper left corner of rectangle. */
- int w, int h, /* Dimension of rectangle. */
- int r, /* Radius of rounded corner. If zero, draw
- * square corners. */
- int lineWidth, /* Line width of the rectangle. If zero, then
- * draw a solid fill rectangle. */
- Blt_Pixel *colorPtr)
-{
- PaintRectangle(picture, x, y, w, h, r, lineWidth, colorPtr);
-}
diff --git a/blt3.0.1/src/bltPainter.c b/blt3.0.1/src/bltPainter.c
deleted file mode 100644
index eb772b4..0000000
--- a/blt3.0.1/src/bltPainter.c
+++ /dev/null
@@ -1,968 +0,0 @@
-
-/*
- * bltPainter.c --
- *
- * This module implements generic painting procedures for pictures in
- * the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The color allocation routines are adapted from tkImgPhoto.c of the Tk
- * library distrubution. The photo image type was designed and implemented by
- * Paul Mackerras.
- *
- * Copyright (c) 1987-1993 The Regents of the University of
- * California.
- *
- * Copyright (c) 19941998 Sun Microsystems, Inc.
- *
- */
-
-#include "bltInt.h"
-#include "bltHash.h"
-#include "bltPicture.h"
-#include "bltPainterInt.h"
-
-typedef struct _Blt_Picture Picture;
-
-#define CFRAC(i, n) ((i) * 65535 / (n))
-/* As for CFRAC, but apply exponent of g. */
-#define CGFRAC(i, n, g) ((int)(65535 * pow((double)(i) / (n), (g))))
-
-#define MAXIMAGESIZE(dpy) (XMaxRequestSize(dpy) << 2) - 24
-
-#define CLAMP(c) ((((c) < 0.0) ? 0.0 : ((c) > 255.0) ? 255.0 : (c)))
-
-
-static Blt_HashTable painterTable;
-static int initialized = 0;
-
-#define COLOR_WINDOW (1<<0)
-#define BLACK_AND_WHITE (1<<1)
-#define MAP_COLORS (1<<2)
-
-/*
- * PainterKey --
- *
- * This structure represents the key used to uniquely identify painters. A
- * painter is specified by a combination of display, visual, colormap, depth,
- * and monitor gamma value.
- */
-typedef struct {
- Display *display; /* Display of painter. Used to free colors
- * allocated. */
-
- Visual *visualPtr; /* Visual information for the class of windows
- * displaying the image. */
-
- Colormap colormap; /* Colormap used. This may be the default
- * colormap, or an allocated private map. */
-
- int depth; /* Pixel depth of the display. */
-
- float gamma; /* Gamma correction value of monitor. */
-
-} PainterKey;
-
-
-#define GC_PRIVATE 1 /* Indicates if the GC in the painter was
- * shared (allocated by Tk_GetGC) or private
- * (by XCreateGC). */
-
-static Tcl_FreeProc FreePainter;
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindShift --
- *
- * Returns the position of the least significant (low) bit in the given
- * mask.
- *
- * For TrueColor and DirectColor visuals, a pixel value is formed by
- * OR-ing the red, green, and blue colormap indices into a single 32-bit
- * word. The visual's color masks tell you where in the word the indices
- * are supposed to be. The masks contain bits only where the index is
- * found. By counting the leading zeros in the mask, we know how many
- * bits to shift to the individual red, green, and blue values to form a
- * pixel.
- *
- * Results:
- * The number of the least significant bit.
- *
- *---------------------------------------------------------------------------
- */
-static int
-FindShift(unsigned int mask) /* 32-bit word */
-{
- int bit;
-
- for (bit = 0; bit < 32; bit++) {
- if (mask & (1 << bit)) {
- break;
- }
- }
- return bit;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CountBits --
- *
- * Returns the number of bits set in the given 32-bit mask.
- *
- * Reference: Graphics Gems Volume II.
- *
- * Results:
- * The number of bits to set in the mask.
- *
- *
- *---------------------------------------------------------------------------
- */
-static int
-CountBits(unsigned long mask) /* 32 1-bit tallies */
-{
- /* 16 2-bit tallies */
- mask = (mask & 0x55555555) + ((mask >> 1) & (0x55555555));
- /* 8 4-bit tallies */
- mask = (mask & 0x33333333) + ((mask >> 2) & (0x33333333));
- /* 4 8-bit tallies */
- mask = (mask & 0x07070707) + ((mask >> 4) & (0x07070707));
- /* 2 16-bit tallies */
- mask = (mask & 0x000F000F) + ((mask >> 8) & (0x000F000F));
- /* 1 32-bit tally */
- mask = (mask & 0x0000001F) + ((mask >> 16) & (0x0000001F));
- return mask;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeGammaTables --
- *
- * Initializes both the power and inverse power tables for the painter
- * with a given gamma value. These tables are used to/from map linear
- * RGB values to/from non-linear monitor intensities.
- *
- * Results:
- * The *gammaTable* and *igammaTable* arrays are filled out to
- * contain the mapped values.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComputeGammaTables(Painter *p)
-{
- int i;
- double igamma, gamma;
-
- gamma = (double)p->gamma;
- igamma = 1.0 / gamma;
- for (i = 0; i < 256; i++) {
- double value, y;
-
- y = i / 255.0;
- value = pow(y, gamma) * 255.0 + 0.5;
- p->gammaTable[i] = (unsigned char)CLAMP(value);
- value = pow(y, igamma) * 255.0 + 0.5;
- p->igammaTable[i] = (unsigned char)CLAMP(value);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_QueryPalette --
- *
- * Queries the X display server for the colors currently used in the
- * colormap. These values will then be used to map screen pixels back to
- * RGB values (see Blt_DrawableToPicture). The queried non-linear color
- * intensities are reverse mapped back to to linear RGB values.
- *
- * Results:
- * The *palette* array is filled in with the RGB color values of the
- * colors allocated.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_QueryPalette(Painter *p, Blt_Pixel *palette)
-{
- Visual *visualPtr;
- XColor colors[256];
-
- visualPtr = p->visualPtr;
- assert(visualPtr->map_entries <= 256);
-
- if ((visualPtr->class == DirectColor) || (visualPtr->class == TrueColor)) {
- XColor *cp, *cend;
- int nRed, nGreen, nBlue;
- unsigned int r, g, b;
-
- r = g = b = 0;
- nRed = (p->rMask >> p->rShift) + 1;
- nGreen = (p->gMask >> p->gShift) + 1;
- nBlue = (p->bMask >> p->bShift) + 1;
-
- for (cp = colors, cend = cp + visualPtr->map_entries; cp < cend; cp++) {
- cp->pixel = ((r << p->rShift)|(g << p->gShift) | (b << p->bShift));
- cp->pad = 0;
- r++, b++, g++;
- if (r >= nRed) {
- r = 0;
- }
- if (g >= nGreen) {
- g = 0;
- }
- if (b >= nBlue) {
- b = 0;
- }
- }
- } else {
- XColor *cp;
- int i;
-
- for (cp = colors, i = 0; i < visualPtr->map_entries; i++, cp++) {
- cp->pixel = i;
- cp->pad = 0;
- }
- }
-
- XQueryColors(p->display, p->colormap, colors, visualPtr->map_entries);
-
- /* Scale to convert XColor component value (0..65535) to unsigned
- * char (0..255). */
- if (p->gamma == 1.0f) {
- Blt_Pixel *dp;
- XColor *cp;
- int i;
- double a;
-
- a = 1.0 / 257.0;
- cp = colors, dp = palette;
- for (i = 0; i < visualPtr->map_entries; i++) {
- dp->Red = (unsigned char)(cp->red * a + 0.5);
- dp->Green = (unsigned char)(cp->green * a + 0.5);
- dp->Blue = (unsigned char)(cp->blue * a + 0.5);
- cp++, dp++;
- }
- } else {
- Blt_Pixel *dp;
- XColor *cp;
- int i;
- double a;
-
- a = 1.0 / 257.0;
- cp = colors, dp = palette;
- for (i = 0; i < visualPtr->map_entries; i++) {
- dp->Red = p->gammaTable[(int)(cp->red * a + 0.5)];
- dp->Green = p->gammaTable[(int)(cp->green * a + 0.5)];
- dp->Blue = p->gammaTable[(int)(cp->blue * a + 0.5)];
- cp++, dp++;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColorRamp --
- *
- * Computes a smooth color ramp based upon the number of colors available
- * for each color component. It returns an array of the desired colors
- * (XColor structures). The screen gamma is factored into the desired
- * colors.
- *
- * Results:
- * Returns the number of colors desired. The *colors* array is filled
- * out to contain the component values.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColorRamp(Painter *p, XColor *colors)
-{
- int nColors;
- XColor *cp;
- double rScale, gScale, bScale;
- double igamma;
- int i;
-
- nColors = 0; /* Suppress compiler warning. */
-
- /*
- * Calculate the RGB coordinates of the colors we want to allocate and
- * store them in *colors.
- */
- igamma = 1.0 / (double)p->gamma;
-
- rScale = 255.0 / (p->nRed - 1);
- gScale = 255.0 / (p->nGreen - 1);
- bScale = 255.0 / (p->nBlue - 1);
-
- switch (p->visualPtr->class) {
- case TrueColor:
- case DirectColor:
-
- nColors = MAX3(p->nRed, p->nGreen, p->nBlue);
- if (p->isMonochrome) {
- nColors = p->nBlue = p->nGreen = p->nRed;
- }
-
- /* Compute the 16-bit RGB values from each possible 8-bit value. */
- cp = colors;
- for (i = 0; i < nColors; i++) {
- int r, g, b;
-
- r = (int)(i * rScale + 0.5);
- g = (int)(i * gScale + 0.5);
- b = (int)(i * bScale + 0.5);
-
- r = p->igammaTable[r];
- g = p->igammaTable[g];
- b = p->igammaTable[b];
-
- cp->red = (r << 8) + r;
- cp->green = (g << 8) + g;
- cp->blue = (b << 8) + b;
- cp++;
- }
- break;
-
- case PseudoColor:
- case StaticColor:
- case GrayScale:
- case StaticGray:
-
- nColors = (p->nRed * p->nGreen * p->nBlue);
- if (p->isMonochrome) {
- nColors = p->nRed;
- }
- if (!p->isMonochrome) {
- XColor *cp;
- int i;
-
- cp = colors;
- for (i = 0; i < p->nRed; i++) {
- int j;
- unsigned char r;
-
- r = (unsigned char)(i * rScale + 0.5);
- r = p->igammaTable[r];
- for (j = 0; j < p->nGreen; j++) {
- int k;
- unsigned int g;
-
- g = (unsigned char)(j * gScale + 0.5);
- g = p->igammaTable[g];
- for (k = 0; k < p->nBlue; k++) {
- unsigned int b;
-
- b = (unsigned char)(k * bScale + 0.5);
- b = p->igammaTable[b];
- cp->red = (r << 8) | r;
- cp->green = (g << 8) | g;
- cp->blue = (b << 8) | b;
- cp++;
- }
- }
- }
- }
- break;
-
- default: /* Monochrome */
- {
- XColor *cp;
- double scale;
- int i;
-
- scale = 255.0 / (nColors - 1);
-
- cp = colors;
- for (i = 0; i < nColors; ++i) {
- int c;
-
- c = (int)(i * scale + 0.5);
- c = p->igammaTable[c];
- cp->red = cp->green = cp->blue = (c << 8) | c;
- cp++;
- }
- }
- } /* end switch */
- return nColors;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AllocateColors --
- *
- * Individually allocates each of the desired colors (as specified by the
- * *colors* array). If a color can't be allocated the desired colors
- * allocated to that point as released, the number of component
- * intensities is reduced, and 0 is returned.
- *
- * For TrueColor visuals, we don't need to allocate colors at all, since
- * we can compute them directly.
- *
- * Results:
- * Returns 1 if all desired colors were allocated successfully. If
- * unsuccessful, returns 0. All colors allocated up to that point are
- * freed and a smaller color palette size is computed and reset in the
- * painter structure.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AllocateColors(Painter *p, XColor *colors, int nColors)
-{
- if (p->visualPtr->class == TrueColor) {
- XColor *cp, *cend;
-
- /*
- * For TrueColor visuals, don't call XAllocColor, compute the pixel
- * value directly.
- */
- for (cp = colors, cend = cp + nColors; cp < cend; cp++) {
- unsigned int r, g, b;
-
- r = ((cp->red >> 8) >> p->rAdjust);
- g = ((cp->green >> 8) >> p->gAdjust);
- b = ((cp->blue >> 8) >> p->bAdjust);
-
- /* Shift each color into the proper location of the pixel index. */
- r = (r << p->rShift) & p->rMask;
- g = (g << p->gShift) & p->gMask;
- b = (b << p->bShift) & p->bMask;
- cp->pixel = (r | g | b);
- }
- p->nPixels = 0; /* This will indicate that we didn't use
- * XAllocColor to obtain pixel values. */
- return TRUE;
- } else {
- int i;
- XColor *cp;
-
- cp = colors;
- for (i = 0; i < nColors; i++) {
- if (!XAllocColor(p->display, p->colormap, cp)){
-#ifdef notdef
- fprintf(stderr, "can't allocate color #%d: r=%x g=%x b=%x\n",
- i, cp->red, cp->green, cp->blue);
-#endif
- break;
- }
-#ifdef notdef
- fprintf(stderr, "picture: allocated r=%x g=%x b=%x\n",
- colors[i].red, colors[i].green, colors[i].blue);
-#endif
- p->pixels[i] = cp->pixel;
- cp++;
- }
- p->nPixels = i; /* # of pixels in array */
- if (i == nColors) {
- fprintf(stderr, "painter palette %d/%d/%d colors okay\n", p->nRed,
- p->nGreen, p->nBlue);
- return TRUE; /* Success. */
- }
- }
- /*
- * If we didn't get all of the colors, free the current palette, reduce
- * the palette RGB component sizes.
- */
-#ifdef notdef
- fprintf(stderr, "can't allocate %d/%d/%d colors\n", p->nRed, p->nGreen,
- p->nBlue);
-#endif
- XFreeColors(p->display, p->colormap, p->pixels, p->nPixels, 0);
-
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FillPalette --
- *
- * Base upon the colors allocated, generate two mappings from the
- * picture's 8-bit RGB components.
- *
- * 1) Map 8-bit RGB values to the bits of the pixel. Each component
- * contains a portion of the pixel value. For mapped visuals
- * (pseudocolor, staticcolor, grayscale, and staticgray) this pixel
- * value will be translated to the actual pixel used by the display.
- *
- * 2) Map 8-bit RGB values to the actual color values used. The
- * color ramp generated may be only a subset of the possible
- * color values. The resulting palette is used in dithering the
- * image, using the error between the desired picture RGB value
- * and the actual value used.
- *
- * Results:
- * Color palette and pixel maps are filled in.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FillPalette(Painter *p, XColor *colors, int nColors)
-{
- p->nColors = nColors;
- if (!p->isMonochrome) {
- p->flags |= COLOR_WINDOW;
-
- if ((p->visualPtr->class != DirectColor) &&
- (p->visualPtr->class != TrueColor)) {
- p->flags |= MAP_COLORS;
- }
- }
- if (p->isMonochrome) {
- int i;
-
- for (i = 0; i < 256; i++) {
- int c;
-
- c = (i + 127) / 255;
- p->rBits[i] = colors[c].pixel;
- p->palette[i].Blue = p->palette[i].Green = p->palette[i].Red =
- (unsigned char)(c * 255 + 0.5);
- }
- } else {
- int i, rMult;
- double rScale, gScale, bScale;
-
- rMult = p->nGreen * p->nBlue;
-
- rScale = 255.0 / (p->nRed - 1);
- gScale = 255.0 / (p->nGreen - 1);
- bScale = 255.0 / (p->nBlue - 1);
-
- for (i = 0; i < 256; i++) {
- int r, g, b;
-
- r = (i * (p->nRed - 1) + 127) / 255;
- g = (i * (p->nGreen - 1) + 127) / 255;
- b = (i * (p->nBlue - 1) + 127) / 255;
-
- if ((p->visualPtr->class == DirectColor) ||
- (p->visualPtr->class == TrueColor)) {
- p->rBits[i] = colors[r].pixel & p->rMask;
- p->gBits[i] = colors[g].pixel & p->gMask;
- p->bBits[i] = colors[b].pixel & p->bMask;
- } else {
- p->rBits[i] = r * rMult;
- p->gBits[i] = g * p->nBlue;
- p->bBits[i] = b;
- }
- p->palette[i].Red = (unsigned char)(r * rScale + 0.5);
- p->palette[i].Green = (unsigned char)(g * gScale + 0.5);
- p->palette[i].Blue = (unsigned char)(b * bScale + 0.5);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AllocatePalette --
- *
- * This procedure allocates the colors required by a color table, and
- * sets up the fields in the color table data structure which are used in
- * dithering.
- *
- * This routine essentially mimics what is done in tkImgPhoto.c. It's
- * purpose is to allocate exactly the same color ramp as the photo
- * image. That way both image types can co-exist without fighting over
- * available colors.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Colors are allocated from the X server. The color palette and pixel
- * indices are updated.
- *
- *---------------------------------------------------------------------------
- */
-static void
-AllocatePalette(
- Painter *p) /* Pointer to the color table requiring
- * colors to be allocated. */
-{
- XColor colors[256];
- int nColors;
- static int stdPalettes[13][3] = {
- /* nRed, nGreen, nBlue */
- { 2, 2, 2 }, /* 3 bits, 8 colors */
- { 2, 3, 2 }, /* 4 bits, 12 colors */
- { 3, 4, 2 }, /* 5 bits, 24 colors */
- { 4, 5, 3 }, /* 6 bits, 60 colors */
- { 5, 6, 4 }, /* 7 bits, 120 colors */
- { 7, 7, 4 }, /* 8 bits, 198 colors */
- { 8, 10, 6 }, /* 9 bits, 480 colors */
- { 10, 12, 8 }, /* 10 bits, 960 colors */
- { 14, 15, 9 }, /* 11 bits, 1890 colors */
- { 16, 20, 12 }, /* 12 bits, 3840 colors */
- { 20, 24, 16 }, /* 13 bits, 7680 colors */
- { 26, 30, 20 }, /* 14 bits, 15600 colors */
- { 32, 32, 30 }, /* 15 bits, 30720 colors */
- };
-
- p->isMonochrome = FALSE;
- switch (p->visualPtr->class) {
- case TrueColor:
- case DirectColor:
- p->nRed = 1 << CountBits(p->rMask);
- p->nGreen = 1 << CountBits(p->gMask);
- p->nBlue = 1 << CountBits(p->bMask);
- break;
-
- case GrayScale:
- case StaticGray:
- case PseudoColor:
- case StaticColor:
- if (p->depth > 15) {
- p->nRed = p->nGreen = p->nBlue = 32;
- } else if (p->depth >= 3) {
- int *ip = stdPalettes[p->depth - 3];
- p->nRed = ip[0];
- p->nGreen = ip[1];
- p->nBlue = ip[2];
- }
- break;
-
- default:
- p->nGreen = p->nBlue = 0;
- p->nRed = 1 << p->depth;
- p->isMonochrome = TRUE;
- break;
- }
-
- /*
- * Each time around this loop, we reduce the number of colors
- * we're trying to allocate until we succeed in allocating all of
- * the colors we need.
- */
- for (;;) {
- /*
- * If we are using 1 bit/pixel, we don't need to allocate any
- * colors (we just use the foreground and background colors in
- * the GC).
- */
- if ((p->isMonochrome) && (p->nRed <= 2)) {
- p->flags |= BLACK_AND_WHITE;
- /* return; */
- }
- /*
- * Calculate the RGB values of a color ramp, given the some
- * number of red, green, blue intensities available.
- */
- nColors = ColorRamp(p, colors);
-
- /* Now try to allocate the colors we've calculated. */
-
- if (AllocateColors(p, colors, nColors)) {
- break; /* Success. */
- }
- if (!p->isMonochrome) {
- if ((p->nRed == 2) && (p->nGreen == 2) && (p->nBlue == 2)) {
- break;
- /* Fall back to 1-bit monochrome display. */
- /* p->mono = TRUE; */
- } else {
- /*
- * Reduce the number of shades of each primary to
- * about 3/4 of the previous value. This will reduce
- * the total number of colors required to less than
- * half (27/64) the previous value for PseudoColor
- * displays.
- */
- p->nRed = (p->nRed * 3 + 2) / 4;
- p->nGreen = (p->nGreen * 3 + 2) / 4;
- p->nBlue = (p->nBlue * 3 + 2) / 4;
- }
- } else {
- p->nRed /= 2;
- }
- }
- FillPalette(p, colors, nColors);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewPainter --
- *
- * Creates a new painter to be used to paint pictures. Painters are keyed
- * by the combination of display, colormap, visual, depth, and gamma
- * value used.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- * Side Effects:
- * A color ramp is allocated (not true for TrueColor visuals). Gamma
- * tables are computed and filled.
- *
- *---------------------------------------------------------------------------
- */
-static Painter *
-NewPainter(PainterKey *keyPtr)
-{
- Painter *p;
-
- p = Blt_AssertCalloc(1, sizeof(Painter));
-
- p->colormap = keyPtr->colormap;
- p->depth = keyPtr->depth;
- p->display = keyPtr->display;
- p->gamma = keyPtr->gamma;
- p->visualPtr = keyPtr->visualPtr;
-
- p->refCount = 0;
- p->rMask = (unsigned int)p->visualPtr->red_mask;
- p->gMask = (unsigned int)p->visualPtr->green_mask;
- p->bMask = (unsigned int)p->visualPtr->blue_mask;
-
- p->rShift = FindShift(p->rMask);
- p->gShift = FindShift(p->gMask);
- p->bShift = FindShift(p->bMask);
-
- p->rAdjust = p->gAdjust = p->bAdjust = 0;
-
- {
- int nRedBits, nGreenBits, nBlueBits;
-
- nRedBits = CountBits(p->rMask);
- nGreenBits = CountBits(p->gMask);
- nBlueBits = CountBits(p->bMask);
- if (nRedBits < 8) {
- p->rAdjust = 8 - nRedBits;
- }
- if (nGreenBits < 8) {
- p->gAdjust = 8 - nGreenBits;
- }
- if (nBlueBits < 8) {
- p->bAdjust = 8 - nBlueBits;
- }
- }
- ComputeGammaTables(p);
- AllocatePalette(p);
- return p;
-}
-
-GC
-Blt_PainterGC(Painter *p)
-{
- return p->gc;
-}
-
-int
-Blt_PainterDepth(Painter *p)
-{
- return p->depth;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreePainter --
- *
- * Called when the TCL interpreter is idle, this routine frees the
- * painter. Painters are reference counted. Only when no clients are using
- * the painter (the count is zero) is the painter actually freed. By
- * deferring its deletion, this allows client code to call Blt_GetPainter
- * after Blt_FreePainter without incurring a performance penalty.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreePainter(DestroyData data)
-{
- Painter *p = (Painter *)data;
-
- if (p->refCount <= 0) {
- if (p->nColors > 0) {
- XFreeColors(p->display, p->colormap,
- p->pixels, p->nPixels, 0);
- }
- Blt_DeleteHashEntry(&painterTable, p->hashPtr);
- if (p->gc != NULL) {
- if (p->flags & GC_PRIVATE) {
- XFreeGC(p->display, p->gc);
- } else {
- Tk_FreeGC(p->display, p->gc);
- }
- p->gc = NULL;
- }
- Blt_Free(p);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetPainter --
- *
- * Attempts to retrieve a painter for a particular combination of
- * display, colormap, visual, depth, and gamma value. If no specific
- * painter exists, then one is created.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- * Side Effects:
- * If no current painter exists, a new painter is added to the hash table
- * of painters. Otherwise, the current painter's reference count is
- * incremented indicated how many clients are using the painter.
- *
- *---------------------------------------------------------------------------
- */
-static Painter *
-GetPainter(
- Display *display,
- Colormap colormap,
- Visual *visualPtr,
- int depth,
- float gamma)
-{
- Painter *p;
- PainterKey key;
- int isNew;
- Blt_HashEntry *hPtr;
-
- if (!initialized) {
- Blt_InitHashTable(&painterTable, sizeof(PainterKey) / sizeof(int));
- initialized = TRUE;
- }
- key.display = display;
- key.colormap = colormap;
- key.visualPtr = visualPtr;
- key.depth = depth;
- key.gamma = gamma;
-
- hPtr = Blt_CreateHashEntry(&painterTable, (char *)&key, &isNew);
- if (isNew) {
- p = NewPainter(&key);
- p->hashPtr = hPtr;
- Blt_SetHashValue(hPtr, p);
- } else {
- p = Blt_GetHashValue(hPtr);
- }
- p->refCount++;
- return p;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPainterFromDrawable --
- *
- * Gets a painter for a particular combination of display, colormap,
- * visual, depth, and gamma value. This information is retrieved from
- * the drawable which is assumed to be a window.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- *---------------------------------------------------------------------------
- */
-Painter *
-Blt_GetPainterFromDrawable(Display *display, Drawable drawable, float gamma)
-{
- XGCValues gcValues;
- unsigned long gcMask;
- Painter *p;
- Visual *visual;
- Colormap colormap;
- int depth;
-
-
- Blt_GetDrawableInfo(display, drawable, &visual, &colormap, &depth);
- p = GetPainter(display, colormap, visual, depth, gamma);
-
- /*
- * Make a GC with background = black and foreground = white.
- */
- gcMask = GCGraphicsExposures;
- gcValues.graphics_exposures = False;
-
- p->gc = XCreateGC(display, drawable, gcMask, &gcValues);
- p->flags |= GC_PRIVATE;
- return p;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPainter --
- *
- * Gets a painter for a particular combination of display, colormap,
- * visual, depth, and gamma value. This information (except for the
- * monitor's gamma value) is retrieved from the given Tk window.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- *---------------------------------------------------------------------------
- */
-Painter *
-Blt_GetPainter(Tk_Window tkwin, float gamma)
-{
- Painter *p;
- XGCValues gcValues;
- unsigned long gcMask;
-
- p = GetPainter(Tk_Display(tkwin), Tk_Colormap(tkwin),
- Tk_Visual(tkwin), Tk_Depth(tkwin), gamma);
-
- /*
- * Make a GC with background = black and foreground = white.
- */
- gcMask = GCGraphicsExposures;
- gcValues.graphics_exposures = False;
- p->gc = Tk_GetGC(tkwin, gcMask, &gcValues);
- p->flags &= ~GC_PRIVATE;
- return p;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FreePainter --
- *
- * Frees the painter. Painters are reference counted. Only when no
- * clients are using the painter (the count is zero) is the painter
- * actually freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FreePainter(Painter *p)
-{
- p->refCount--;
- if (p->refCount <= 0) {
- Tcl_EventuallyFree(p, FreePainter);
- }
-}
-
diff --git a/blt3.0.1/src/bltPainter.h b/blt3.0.1/src/bltPainter.h
deleted file mode 100644
index f956285..0000000
--- a/blt3.0.1/src/bltPainter.h
+++ /dev/null
@@ -1,85 +0,0 @@
-
-/*
- * bltPainter.h --
- *
- * This module implements generic image painting procedures for
- * the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The color allocation routines are adapted from tkImgPhoto.c of the
- * Tk library distrubution. The photo image type was designed and
- * implemented by Paul Mackerras.
- *
- * Copyright (c) 1987-1993 The Regents of the University of
- * California.
- *
- * Copyright (c) 19941998 Sun Microsystems, Inc.
- *
- */
-
-#ifndef _BLT_PAINTER_H
-#define _BLT_PAINTER_H
-
-typedef struct _Blt_Painter *Blt_Painter;
-
-BLT_EXTERN void Blt_FreePainter(Blt_Painter painter);
-
-BLT_EXTERN Blt_Painter Blt_GetPainter(Tk_Window tkwin, float gamma);
-
-BLT_EXTERN Blt_Painter Blt_GetPainterFromDrawable(Display *display,
- Drawable drawable, float gamma);
-
-BLT_EXTERN GC Blt_PainterGC(Blt_Painter painter);
-
-BLT_EXTERN int Blt_PainterDepth(Blt_Painter painter);
-
-BLT_EXTERN Visual *Blt_PainterVisual(Blt_Painter painter);
-
-BLT_EXTERN Colormap Blt_PainterColormap(Blt_Painter painter);
-
-BLT_EXTERN int Blt_PaintPicture(Blt_Painter painter, Drawable drawable,
- Blt_Picture src, int srcX, int srcY, int width, int height,
- int destX, int destY, unsigned int flags);
-
-BLT_EXTERN int Blt_PaintPictureWithBlend(Blt_Painter painter, Drawable drawable,
- Blt_Picture src, int srcX, int srcY, int width, int height,
- int destX, int destY, unsigned int flags, double falpha);
-
-BLT_EXTERN Blt_Picture Blt_PaintCheckbox(int width, int height,
- XColor *fillColor, XColor *outlineColor, XColor *checkColor, int isOn);
-
-BLT_EXTERN Blt_Picture Blt_PaintRadioButton(int width, int height,
- XColor *fillColor, XColor *outlineColor, XColor *checkColor, int isOn);
-
-BLT_EXTERN Blt_Picture Blt_PaintDelete(int width, int height,
- XColor *bgColor, XColor *fgColor);
-
-BLT_EXTERN void Blt_PaintRectangle(Blt_Picture picture, int x, int y, int w,
- int h, int dx, int dy, Blt_Pixel *colorPtr);
-
-BLT_EXTERN void Blt_PaintPolygon(Blt_Picture picture, int n, Point2f *vertices,
- Blt_Pixel *colorPtr);
-#endif /* _BLT_PAINTER_H */
diff --git a/blt3.0.1/src/bltPainterInt.h b/blt3.0.1/src/bltPainterInt.h
deleted file mode 100644
index 63749a1..0000000
--- a/blt3.0.1/src/bltPainterInt.h
+++ /dev/null
@@ -1,143 +0,0 @@
-
-/*
- * bltUnixPainter.h --
- *
- * This header contains the private definitions for a painter in
- * the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The color allocation routines are adapted from tkImgPhoto.c of the
- * Tk library distrubution. The photo image type was designed and
- * implemented by Paul Mackerras.
- *
- * Copyright (c) 1987-1993 The Regents of the University of
- * California.
- *
- * Copyright (c) 19941998 Sun Microsystems, Inc.
- *
- */
-
-#ifndef _BLT_UNIX_PAINTER_H
-#define _BLT_UNIX_PAINTER_H
-
-#ifdef notdef
-#define PAINTER_COLOR_WINDOW (1<<0)
-#define PAINTER_BW (1<<1)
-#define PAINTER_MAP_COLORS (1<<2)
-#endif
-
-/*
- * Painter --
- *
- * This structure represents a painter used to display picture images. A
- * painter is specified by a combination of display, visual, colormap, depth,
- * and monitor gamma value. Painters contain information necessary to display
- * a picture. This includes both an RGB to pixel map, and a RGB to allocated
- * color map.
- *
- * Painters may be shared by more than one client and are reference counted.
- * When no clients are using the painter, it is freed.
- */
-
-struct _Blt_Painter {
- Display *display; /* Display of painter. Used to free colors
- * allocated. */
-
- Visual *visualPtr; /* Visual information for the class of windows
- * displaying the image. */
-
- Colormap colormap; /* Colormap used. This may be the default
- * colormap, or an allocated private map. */
-
- int depth; /* Pixel depth of the display. */
-
- float gamma; /* Gamma correction value of monitor. */
-
- unsigned int flags; /* Flags listed below. */
-
- int refCount; /* # of clients using this painter. If zero,
- * # the painter is freed. */
-
- Blt_HashEntry *hashPtr; /* Used to delete the painter entry from the
- * hash table of painters. */
-
- int nColors; /* # of colors allocated. */
- int nRed, nGreen, nBlue; /* # of intensities for each RGB component. */
-
- unsigned long pixels[256]; /* Array of pixel values. Needed to deallocate
- * the color palette. Also contains the
- * mapping between linear pixel values (rBits,
- * gBits, bBits) and the actual pixel for
- * PsuedoColor, StaticColor, Greyscale, and
- * StaticGrey visuals.
- */
-
- int nPixels; /* # of pixels allocated in above array. */
-
-
- GC gc; /* GC used to draw the image. */
-
- /*
- * The following arrays are used for DirectColor, PsuedoColor,
- * StaticColor, Greyscale, and StaticGrey visuals to convert RGB triplets
- * to a parts of a pixel index.
- */
- unsigned int rBits[256], gBits[256], bBits[256];
-
- /*
- * This following as used for TrueColor and DirectColor visuals only.
- * They are used to directly compute of pixel values from picture RGB
- * components.
- */
- unsigned int rAdjust, gAdjust, bAdjust;
- unsigned int rShift, gShift, bShift;
- unsigned int rMask, gMask, bMask;
-
- unsigned char gammaTable[256]; /* Input gamma lookup table. Used to map
- * non-linear monitor values back to RGB
- * values. This is used whenever we take a
- * snapshot of the screen (e.g. alpha
- * blending). Computes the power mapping. D
- * = I^gamma. */
-
- unsigned char igammaTable[256]; /* Output gamma lookup table. Used to map
- * RGB values to non-linear monitor
- * values. Computes the inverse power mapping.
- * I~ = D^1/gamma. */
-
- int isMonochrome; /* Indicates if the display uses a single
- * color component (e.g. 4-bit grayscale). */
-
- Blt_Pixel palette[256]; /* Maps the picture's 8-bit RGB values to the
- * RGB values of the colors actually
- * allocated. This is used for dithering the
- * picture. */
-
-};
-
-typedef struct _Blt_Painter Painter;
-
-#endif /* _BLT_UNIX_PAINTER_H */
diff --git a/blt3.0.1/src/bltPaneset.c b/blt3.0.1/src/bltPaneset.c
deleted file mode 100644
index 1b58520..0000000
--- a/blt3.0.1/src/bltPaneset.c
+++ /dev/null
@@ -1,7529 +0,0 @@
-
-/*
- * bltPaneset.c --
- *
- * Copyright 2009 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Modes
- *
- * 1. enlarge/reduce: change only the panes touching the anchor.
- * 2. slinky: change all panes on both sides of the anchor.
- * 3. hybrid: one side slinky, the other enlarge/reduce
- * 4. locked minus 1 changed only the pane to the left of the anchor.
- * 5. filmstrip move the panes left or right.
- */
-#include "bltInt.h"
-#include "bltChain.h"
-#include "bltList.h"
-#include "bltHash.h"
-#include "bltOp.h"
-#include "bltSwitch.h"
-#include "bltBgStyle.h"
-
-#define GETATTR(t,attr) \
- (((t)->attr != NULL) ? (t)->attr : (t)->setPtr->attr)
-#define VPORTWIDTH(s) \
- (ISVERT(s)) ? Tk_Height((s)->tkwin) : Tk_Width((s)->tkwin);
-
-#define TRACE 0
-#define TRACE1 0
-
-#define SCREEN(x) ((x) - setPtr->scrollOffset)
-#define ISVERT(s) ((s)->flags & VERTICAL)
-#define ISHORIZ(s) (((s)->flags & VERTICAL) == 0)
-
-/*
- * The following are the adjustment modes for the paneset widget.
- */
-typedef enum AdjustModes {
- MODE_SLINKY, /* Adjust all panes when resizing */
- MODE_GIVETAKE, /* Adjust panes to immediate left/right
- * or top/bottom of active handle. */
- MODE_SPREADSHEET, /* Adjust only the left pane and the
- * last pane. */
-} AdjustMode;
-
-typedef struct _Paneset Paneset;
-typedef struct _Pane Pane;
-typedef int (LimitsProc)(int value, Blt_Limits *limitsPtr);
-typedef int (SizeProc)(Pane *panePtr);
-typedef int (PanesetCmdProc)(Paneset *setPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-typedef int (HandleCmdProc)(Pane *panePtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-/*
- * Default values for widget attributes.
- */
-#define DEF_ACTIVEHANDLECOLOR STD_ACTIVE_BACKGROUND
-#define DEF_ACTIVEHANDLERELIEF "flat"
-#define DEF_ANIMATE "0"
-#define DEF_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_BORDERWIDTH "0"
-#define DEF_HANDLEBORDERWIDTH "1"
-#define DEF_HANDLECOLOR STD_NORMAL_BACKGROUND
-#define DEF_HANDLEPAD "0"
-#define DEF_HANDLERELIEF "flat"
-#define DEF_HANDLETHICKNESS "2"
-#define DEF_HCURSOR "sb_h_double_arrow"
-#define DEF_HEIGHT "0"
-#define DEF_HIGHLIGHT_THICKNESS "1"
-#define DEF_MODE "givetake"
-#define DEF_ORIENT "horizontal"
-#define DEF_DRAWER_SHRINK "0"
-#define DEF_DRAWER_FILL "1"
-#define DEF_PAD "0"
-#define DEF_PANE_ANCHOR "nw"
-#define DEF_PANE_ANCHOR "nw"
-#define DEF_PANE_BORDERWIDTH "0"
-#define DEF_PANE_CURSOR (char *)NULL
-#define DEF_PANE_FILL "none"
-#define DEF_PANE_HIDE "0"
-#define DEF_PANE_HIGHLIGHT_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_PANE_HIGHLIGHT_COLOR RGB_BLACK
-#define DEF_PANE_PAD "0"
-#define DEF_PANE_PADX "0"
-#define DEF_PANE_PADY "0"
-#define DEF_PANE_RESIZE "shrink"
-#define DEF_PANE_SHOWHANDLE "1"
-#define DEF_PANE_WEIGHT "1.0"
-#define DEF_PANE_OPENVALUE "1"
-#define DEF_PANE_CLOSEVALUE "0"
-#define DEF_PANE_VARIABLE (char *)NULL
-#define DEF_SCROLLCOMMAND "0"
-#define DEF_SCROLLDELAY "30"
-#define DEF_SCROLLINCREMENT "10"
-#define DEF_SIDE "right"
-#define DEF_TAKEFOCUS "1"
-#define DEF_VCURSOR "sb_v_double_arrow"
-#define DEF_WEIGHT "0"
-#define DEF_WIDTH "0"
-
-#define PANE_DEF_ANCHOR TK_ANCHOR_NW
-#define PANE_DEF_FILL FILL_NONE
-#define PANE_DEF_IPAD 0
-#define PANE_DEF_PAD 0
-#define PANE_DEF_PAD 0
-#define PANE_DEF_RESIZE RESIZE_BOTH
-#define PANE_DEF_WEIGHT 1.0
-
-#define FCLAMP(x) ((((x) < 0.0) ? 0.0 : ((x) > 1.0) ? 1.0 : (x)))
-#define VAR_FLAGS (TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS)
-
-/*
- * Paneset structure
- *
- * The paneset is a set of windows (panes) that may be resized in one
- * dimension (horizontally or vertically). How the panes are resized is
- * dependent upon the paneset's bearing and the adjustment mode in place.
- *
- * The bearing is the position of the handle last moved. By default it's
- * the last handle. The position is the just outside of the handle. So
- * if the window starting at 100 has a width of 200 and the handle size
- * is 10, the bearing is 310.
- *
- * The bearing divides the panes into two. Each side is resized
- * according to the adjustment mode.
- *
- * givetake The panes immediately to the left and right of
- * the bearing are grown/shrunk.
- * slinky All the panes on either side of the bearing are
- * grown/shrunk.
- * spreadsheet The pane to the left of the bearing and the last
- * pane on the right side are grown/shrunk. Intervening
- * panes are unaffected.
- */
-
-struct _Paneset {
- int flags; /* See the flags definitions below. */
- int type; /* Type of widget: PANESET, DRAWER, or
- * FILMSTRIP. */
- Display *display; /* Display of the widget. */
- Tk_Window tkwin; /* The container window into which
- * other widgets are arranged. For the
- * paneset and filmstrip, this window
- * is created. For the drawer we use
- * an existing window. */
- Tcl_Interp *interp; /* Interpreter associated with all
- * widgets and handles. */
- Tcl_Command cmdToken; /* Command token associated with this
- * widget. For panesets and filmstrips
- * this is the path name of the window
- * created. For drawers, this is a
- * generated name. */
- char *name; /* The generated name of the drawer
- * or the pathname of the window
- * created (panesets and
- * filmstrips). */
- AdjustMode mode; /* Panesets only: Mode to use to
- resize panes when the user adjusts
- a handle. */
- int highlightThickness; /* Width in pixels of highlight to
- * draw around the handle when it has
- * the focus. <= 0 means don't draw a
- * highlight. */
- int normalWidth; /* Normal dimensions of the paneset */
- int normalHeight;
- int reqWidth, reqHeight; /* Constraints on the paneset's normal
- * width and height. Overrides the
- * requested width of the window. */
-
- Tk_Cursor defVertCursor; /* Default vertical X cursor */
- Tk_Cursor defHorzCursor; /* Default horizontal X cursor */
-
- short int width, height; /* Requested size of the widget. */
-
- Blt_Background bg; /* 3D border surrounding the window
- * (viewport). */
- /*
- * Scrolling information (filmstrip only):
- */
- int worldWidth;
- int scrollOffset; /* Offset of viewport in world
- * coordinates. */
- Tcl_Obj *scrollCmdObjPtr; /* Command strings to control
- * scrollbar.*/
-
- /*
- * Automated scrolling information (filmstrip or drawer).
- */
- int scrollUnits; /* Smallest unit of scrolling for
- * tabs. */
- int scrollTarget; /* Target offset to scroll to. */
- int scrollIncr; /* Current increment. */
- int interval; /* Current increment. */
- Tcl_TimerToken timerToken; /* Token for timer to automatically
- * scroll the pane or drawer. */
-
- /*
- * Focus highlight ring
- */
- XColor *highlightColor; /* Color for drawing traversal
- * highlight. */
- int relief;
- int activeRelief;
- Blt_Pad handlePad;
- int handleBW;
- int handleThickness; /* */
- int handleSize;
- Blt_Background handleBg;
- Blt_Background activeHandleBg;
- int handleAnchor; /* Last known location of handle
- * during a move. */
-
- Blt_Chain chain; /* List of panes/drawers. In paneset
- * and filmstrip widgets, describes
- * the order of the panes in the
- * widget. In the drawer widget,
- * represents the stacking order of
- * the drawers. */
-
- Blt_HashTable paneTable; /* Table of panes. Serves as a
- * directory to look up panes from
- * windows. */
- Blt_HashTable tagTable; /* Table of tags. */
- Pane *activePtr; /* Indicates the pane with the active
- * handle. */
- Pane *anchorPtr; /* Pane that is currently anchored */
- int bearing; /* Location of the split (paneset).
- * the drawer (drawer). */
- Tcl_Obj *cmdObjPtr; /* Command to invoke when the "invoke"
- * operation is performed. */
- size_t nVisible; /* # of visible panes. */
- GC gc;
- size_t nextId; /* Counter to generate unique
- * pane/drawer names. */
- size_t nextHandleId; /* Counter to generate unique
- * pane/drawer names. */
-};
-
-/*
- * Paneset flags definitions
- */
-#define REDRAW_PENDING (1<<0) /* A redraw request is pending. */
-#define LAYOUT_PENDING (1<<1) /* Get the requested sizes of the
- * widgets before expanding/shrinking
- * the size of the container. It's
- * necessary to recompute the layout
- * every time a pane is added,
- * reconfigured, or deleted, but not
- * when the container is resized. */
-#define SCROLL_PENDING (1<<2) /* Get the requested sizes of the
- * widgets before expanding/shrinking
- * the size of the container. It's
- * necessary to recompute the layout
- * every time a pane is added,
- * reconfigured, or deleted, but not
- * when the container is resized. */
-#define ANIMATE (1<<3) /* Animate pane moves and drawer
- * open/closes */
-
-#define FOCUS (1<<6)
-
-#define VERTICAL (1<<7)
-
-#define PANESET (BLT_CONFIG_USER_BIT << 1)
-#define DRAWER (BLT_CONFIG_USER_BIT << 2)
-#define FILMSTRIP (BLT_CONFIG_USER_BIT << 3)
-#define ALL (PANESET|DRAWER|FILMSTRIP)
-
-/*
- * Pane --
- *
- * A pane holds a window and a possibly a handle. It describes how the
- * window should appear in the pane. The handle is a rectangle on the
- * far edge of the pane (horizontal right, vertical bottom). Normally
- * the last pane does not have a handle. Handles may be hidden.
- *
- * Initially, the size of a pane consists of
- * 1. the requested size embedded window,
- * 2. any requested internal padding, and
- * 3. the size of the handle (if one is displayed).
- *
- * Note: There is no 3D border around the pane. This can be added
- * by embedding a frame. This simplifies the widget so that
- * there is only one window for the widget. Windows outside of
- * the boundary of the pane are occluded.
- */
-struct _Pane {
- Tk_Window tkwin; /* Widget to be managed. */
- Tk_Window handle; /* Handle subwindow. */
- Tcl_Command cmdToken;
-
- Tk_Cursor cursor; /* X Cursor */
-
- const char *name; /* Name of pane */
-
- unsigned int side; /* The side of the widget where this
- * drawer is attached. */
- unsigned int flags;
-
- Paneset *setPtr; /* Paneset widget managing this pane. */
-
- int borderWidth; /* The external border width of the
- * widget. This is needed to check if
- * Tk_Changes(tkwin)->border_width
- * changes. */
-
- XColor *highlightBgColor; /* Color for drawing traversal
- * highlight area when highlight is
- * off. */
- XColor *highlightColor; /* Color for drawing traversal
- * highlight. */
-
- const char *takeFocus; /* Says whether to select this widget
- * during tab traveral operations.
- * This value isn't used in C code,
- * but for the widget's TCL
- * bindings. */
-
- Blt_Limits reqWidth, reqHeight; /* Bounds for width and height
- * requests made by the widget. */
- Tk_Anchor anchor; /* Anchor type: indicates how the
- * widget is positioned if extra space
- * is available in the pane. */
-
- Blt_Pad xPad; /* Extra padding placed left and right
- * of the widget. */
- Blt_Pad yPad; /* Extra padding placed above and below
- * the widget */
-
- int iPadX, iPadY; /* Extra padding added to the interior
- * of the widget (i.e. adds to the
- * requested size of the widget) */
-
- int fill; /* Indicates how the widget should fill
- * the pane it occupies. */
- int resize; /* Indicates if the pane should
- * expand/shrink. */
-
- int x, y; /* Origin of pane wrt container. */
-
- short int width, height; /* Size of pane, including handle. */
-
- Blt_ChainLink link; /* Pointer of this pane into the list
- * of panes. */
-
- Blt_HashEntry *hashPtr; /* Pointer of this pane into hashtable
- * of panes. */
-
- int index; /* Index of the pane. */
-
- int size; /* Current size of the pane. This size
- * is bounded by min and max. */
-
- /*
- * nom and size perform similar duties. I need to keep track of the
- * amount of space allocated to the pane (using size). But at the same
- * time, I need to indicate that space can be parcelled out to this pane.
- * If a nominal size was set for this pane, I don't want to add space.
- */
-
- int nom; /* The nominal size (neither expanded
- * nor shrunk) of the pane based upon
- * the requested size of the widget
- * embedded in this pane. */
-
- int min, max; /* Size constraints on the pane */
-
- float weight; /* Weight of pane. */
-
- Blt_Limits reqSize; /* Requested bounds for the size of
- * the pane. The pane will not expand
- * or shrink beyond these limits,
- * regardless of how it was specified
- * (max widget size). This includes
- * any extra padding which may be
- * specified. */
- Blt_Background handleBg;
- Blt_Background activeHandleBg;
- Blt_Background bg; /* 3D background border surrounding
- * the widget */
- Tcl_Obj *cmdObjPtr;
-
- Tcl_TimerToken timerToken;
- int scrollTarget; /* Target offset to scroll to. */
- int scrollIncr; /* Current increment. */
-
- Tcl_Obj *variableObjPtr; /* Name of TCL variable. If non-NULL,
- * this variable will be set to the
- * value string of the selected
- * item. */
-
- /* Checkbutton on and off values. */
- Tcl_Obj *openValueObjPtr; /* Drawer open-value. */
- Tcl_Obj *closeValueObjPtr; /* Drawer close-value. */
-};
-
-/* Pane/handle flags. */
-
-#define HIDE (1<<8) /* Do not display the pane. */
-#define CLOSED (1<<8) /* Do not display the pane. */
-#define DISABLED (1<<9) /* Handle is disabled. */
-#define ONSCREEN (1<<10) /* Pane is on-screen. */
-#define HANDLE_ACTIVE (1<<11) /* Handle is currently active. */
-#define HANDLE (1<<12) /* The pane has a handle. */
-#define SHOW_HANDLE (1<<13) /* Display the pane. */
-#define SHRINK (1<<14) /* Shrink the window to fit the
- * drawer, instead of moving it. */
-#define VIRGIN (1<<24)
-
-/* Orientation. */
-#define SIDE_VERTICAL (SIDE_TOP|SIDE_BOTTOM)
-#define SIDE_HORIZONTAL (SIDE_LEFT|SIDE_RIGHT)
-
-/* Handle positions. */
-#define HANDLE_LEFT SIDE_RIGHT
-#define HANDLE_RIGHT SIDE_LEFT
-#define HANDLE_TOP SIDE_BOTTOM
-#define HANDLE_BOTTOM SIDE_TOP
-
-#define HANDLE_FARSIDE (HANDLE_RIGHT|HANDLE_BOTTOM)
-#define HANDLE_NEARSIDE (HANDLE_LEFT|HANDLE_TOP)
-
-
-static Tk_GeomRequestProc PaneGeometryProc;
-static Tk_GeomLostSlaveProc PaneCustodyProc;
-static Tk_GeomMgr panesetMgrInfo =
-{
- (char *)"paneset", /* Name of geometry manager used by
- * winfo */
- PaneGeometryProc, /* Procedure to for new geometry
- * requests */
- PaneCustodyProc, /* Procedure when widget is taken
- * away */
-};
-
-static Blt_OptionParseProc ObjToChild;
-static Blt_OptionPrintProc ChildToObj;
-static Blt_CustomOption childOption = {
- ObjToChild, ChildToObj, NULL, (ClientData)0,
-};
-
-extern Blt_CustomOption bltLimitsOption;
-
-static Blt_OptionParseProc ObjToOrientProc;
-static Blt_OptionPrintProc OrientToObjProc;
-static Blt_CustomOption orientOption = {
- ObjToOrientProc, OrientToObjProc, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToMode;
-static Blt_OptionPrintProc ModeToObj;
-static Blt_CustomOption adjustOption = {
- ObjToMode, ModeToObj, NULL, (ClientData)0,
-};
-
-static Blt_OptionFreeProc FreeTraceVarProc;
-static Blt_OptionParseProc ObjToTraceVarProc;
-static Blt_OptionPrintProc TraceVarToObjProc;
-static Blt_CustomOption traceVarOption = {
- ObjToTraceVarProc, TraceVarToObjProc, FreeTraceVarProc, (ClientData)0
-};
-
-static Blt_ConfigSpec paneSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activehandlecolor", "activeHandleColor",
- "HandleColor", DEF_ACTIVEHANDLECOLOR, Blt_Offset(Pane, activeHandleBg),
- BLT_CONFIG_DONT_SET_DEFAULT | BLT_CONFIG_NULL_OK | FILMSTRIP | DRAWER},
- {BLT_CONFIG_BACKGROUND, "-activesashcolor", "activeSashColor",
- "SashColor", DEF_ACTIVEHANDLECOLOR, Blt_Offset(Pane, activeHandleBg),
- BLT_CONFIG_DONT_SET_DEFAULT | BLT_CONFIG_NULL_OK | PANESET},
- {BLT_CONFIG_ANCHOR, "-anchor", (char *)NULL, (char *)NULL, DEF_PANE_ANCHOR,
- Blt_Offset(Pane, anchor), BLT_CONFIG_DONT_SET_DEFAULT | PANESET},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- (char *)NULL, Blt_Offset(Pane, bg),
- BLT_CONFIG_NULL_OK | BLT_CONFIG_DONT_SET_DEFAULT | ALL},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL,
- 0, ALL},
- {BLT_CONFIG_OBJ, "-closevalue", "closeValue", "CloseValue",
- DEF_PANE_CLOSEVALUE, Blt_Offset(Pane, closeValueObjPtr),
- BLT_CONFIG_NULL_OK | DRAWER },
- {BLT_CONFIG_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_PANE_CURSOR, Blt_Offset(Pane, cursor), BLT_CONFIG_NULL_OK | ALL},
- {BLT_CONFIG_FILL, "-fill", "fill", "Fill", DEF_PANE_FILL,
- Blt_Offset(Pane, fill),
- BLT_CONFIG_DONT_SET_DEFAULT | PANESET | FILMSTRIP },
- {BLT_CONFIG_BOOLEAN, "-fill", "fill", "Fill", DEF_DRAWER_FILL,
- Blt_Offset(Pane, fill), BLT_CONFIG_DONT_SET_DEFAULT | DRAWER },
- {BLT_CONFIG_BACKGROUND, "-handlecolor", "handleColor", "HandleColor",
- DEF_HANDLECOLOR, Blt_Offset(Pane, handleBg),
- BLT_CONFIG_DONT_SET_DEFAULT | BLT_CONFIG_NULL_OK | FILMSTRIP|DRAWER},
- {BLT_CONFIG_SYNONYM, "-height", "reqHeight", (char *)NULL, (char *)NULL,
- Blt_Offset(Pane, reqHeight), 0},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_PANE_HIDE,
- Blt_Offset(Pane, flags),
- BLT_CONFIG_DONT_SET_DEFAULT | FILMSTRIP | PANESET,
- (Blt_CustomOption *)HIDE },
- {BLT_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_PANE_HIGHLIGHT_BACKGROUND,
- Blt_Offset(Pane, highlightBgColor), ALL},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_PANE_HIGHLIGHT_COLOR, Blt_Offset(Pane, highlightColor), ALL},
- {BLT_CONFIG_PIXELS_NNEG, "-ipadx", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(Pane, iPadX), ALL},
- {BLT_CONFIG_PIXELS_NNEG, "-ipady", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(Pane, iPadY), ALL},
- {BLT_CONFIG_OBJ, "-opennvalue", "openValue", "OpenValue",
- DEF_PANE_OPENVALUE, Blt_Offset(Pane, openValueObjPtr),
- BLT_CONFIG_NULL_OK | DRAWER },
- {BLT_CONFIG_CUSTOM, "-reqheight", "reqHeight", (char *)NULL, (char *)NULL,
- Blt_Offset(Pane, reqHeight), ALL, &bltLimitsOption},
- {BLT_CONFIG_CUSTOM, "-reqwidth", "reqWidth", (char *)NULL, (char *)NULL,
- Blt_Offset(Pane, reqWidth), ALL, &bltLimitsOption},
- {BLT_CONFIG_RESIZE, "-resize", "resize", "Resize", DEF_PANE_RESIZE,
- Blt_Offset(Pane, resize), BLT_CONFIG_DONT_SET_DEFAULT | ALL},
- {BLT_CONFIG_BACKGROUND, "-sashcolor", "sashColor", "SashColor",
- DEF_HANDLECOLOR, Blt_Offset(Pane, handleBg),
- BLT_CONFIG_DONT_SET_DEFAULT | BLT_CONFIG_NULL_OK | PANESET},
- {BLT_CONFIG_BITMASK, "-showhandle", "showHandle", "showHandle",
- DEF_PANE_SHOWHANDLE, Blt_Offset(Pane, flags),
- BLT_CONFIG_DONT_SET_DEFAULT | FILMSTRIP | DRAWER,
- (Blt_CustomOption *)SHOW_HANDLE },
- {BLT_CONFIG_BITMASK, "-showsash", "showSash", "showSash",
- DEF_PANE_SHOWHANDLE, Blt_Offset(Pane, flags),
- BLT_CONFIG_DONT_SET_DEFAULT | PANESET, (Blt_CustomOption *)SHOW_HANDLE},
- {BLT_CONFIG_BITMASK, "-shrink", "shrink", "Shrink",
- DEF_DRAWER_SHRINK, Blt_Offset(Pane, flags),
- BLT_CONFIG_DONT_SET_DEFAULT | DRAWER, (Blt_CustomOption *)SHRINK },
- {BLT_CONFIG_SIDE, "-side", (char *)NULL, (char *)NULL, DEF_SIDE,
- Blt_Offset(Pane, side), BLT_CONFIG_DONT_SET_DEFAULT | DRAWER},
- {BLT_CONFIG_CUSTOM, "-size", (char *)NULL, (char *)NULL, (char *)NULL,
- Blt_Offset(Pane, reqSize), ALL, &bltLimitsOption},
- {BLT_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_TAKEFOCUS, Blt_Offset(Pane, takeFocus), BLT_CONFIG_NULL_OK | ALL},
- {BLT_CONFIG_CUSTOM, "-variable", (char *)NULL, (char *)NULL,
- DEF_PANE_VARIABLE, Blt_Offset(Pane, variableObjPtr),
- BLT_CONFIG_NULL_OK | DRAWER, &traceVarOption},
- {BLT_CONFIG_FLOAT, "-weight", "weight", "Weight", DEF_PANE_WEIGHT,
- Blt_Offset(Pane, weight), BLT_CONFIG_DONT_SET_DEFAULT | PANESET},
- {BLT_CONFIG_SYNONYM, "-width", "reqWidth", (char *)NULL, (char *)NULL,
- Blt_Offset(Pane, reqWidth), 0},
- {BLT_CONFIG_CUSTOM, "-window", "window", "Window", (char *)NULL,
- Blt_Offset(Pane, tkwin), BLT_CONFIG_NULL_OK | ALL, &childOption },
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-/*
- * Hide the handle.
- *
- * .p configure -handlethickness 0
- * .p pane configure -hide yes
- * Put all the drawers in the paneset widget, hidden by default.
- * Reveal/hide drawers to pop them out.
- * plotarea | sidebar | scroller
- */
-static Blt_ConfigSpec panesetSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activehandlecolor", "activeHandleColor",
- "HandleColor", DEF_ACTIVEHANDLECOLOR,
- Blt_Offset(Paneset, activeHandleBg), DRAWER|FILMSTRIP},
- {BLT_CONFIG_RELIEF, "-activehandlerelief", "activeHandleRelief",
- "HandleRelief", DEF_ACTIVEHANDLERELIEF,
- Blt_Offset(Paneset, activeRelief),
- BLT_CONFIG_DONT_SET_DEFAULT | FILMSTRIP | DRAWER },
- {BLT_CONFIG_BACKGROUND, "-activesashcolor", "activeSashColor",
- "SashColor", DEF_ACTIVEHANDLECOLOR,
- Blt_Offset(Paneset, activeHandleBg), PANESET},
- {BLT_CONFIG_RELIEF, "-activesashrelief", "activeSashRelief",
- "SashRelief", DEF_ACTIVEHANDLERELIEF,
- Blt_Offset(Paneset, activeRelief), BLT_CONFIG_DONT_SET_DEFAULT|PANESET},
- {BLT_CONFIG_BITMASK, "-animate", "animate", "Animate", DEF_ANIMATE,
- Blt_Offset(Paneset, flags),
- BLT_CONFIG_DONT_SET_DEFAULT | FILMSTRIP | DRAWER,
- (Blt_CustomOption *)ANIMATE },
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_BACKGROUND, Blt_Offset(Paneset, bg), ALL },
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL,
- 0, ALL},
- {BLT_CONFIG_PIXELS_NNEG, "-height", "height", "Height", DEF_HEIGHT,
- Blt_Offset(Paneset, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT | ALL },
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_HIGHLIGHT_THICKNESS,
- Blt_Offset(Paneset, highlightThickness),
- BLT_CONFIG_DONT_SET_DEFAULT | ALL},
- {BLT_CONFIG_CUSTOM, "-orient", "orient", "Orient", DEF_ORIENT,
- Blt_Offset(Paneset, flags),
- BLT_CONFIG_DONT_SET_DEFAULT | PANESET | FILMSTRIP, &orientOption},
- {BLT_CONFIG_CUSTOM, "-mode", "mode", "Mode", DEF_MODE,
- Blt_Offset(Paneset, mode), BLT_CONFIG_DONT_SET_DEFAULT | PANESET,
- &adjustOption},
- {BLT_CONFIG_CUSTOM, "-reqheight", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(Paneset, reqHeight), ALL, &bltLimitsOption},
- {BLT_CONFIG_CUSTOM, "-reqwidth", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(Paneset, reqWidth), ALL, &bltLimitsOption},
- {BLT_CONFIG_PIXELS_NNEG, "-handleborderwidth", "handleBorderWidth",
- "HandleBorderWidth", DEF_HANDLEBORDERWIDTH,
- Blt_Offset(Paneset, handleBW),
- BLT_CONFIG_DONT_SET_DEFAULT | FILMSTRIP | DRAWER },
- {BLT_CONFIG_BACKGROUND, "-handlecolor", "handleColor", "HandleColor",
- DEF_HANDLECOLOR, Blt_Offset(Paneset, handleBg), FILMSTRIP | DRAWER},
- {BLT_CONFIG_PAD, "-handlepad", "handlePad", "HandlePad", DEF_HANDLEPAD,
- Blt_Offset(Paneset, handlePad),
- BLT_CONFIG_DONT_SET_DEFAULT | FILMSTRIP | DRAWER},
- {BLT_CONFIG_RELIEF, "-handlerelief", "handleRelief", "HandleRelief",
- DEF_HANDLERELIEF, Blt_Offset(Paneset, relief),
- BLT_CONFIG_DONT_SET_DEFAULT | FILMSTRIP | DRAWER },
- {BLT_CONFIG_PIXELS_NNEG, "-handlethickness", "handleThickness",
- "HandleThickness", DEF_HANDLETHICKNESS,
- Blt_Offset(Paneset, handleThickness),
- BLT_CONFIG_DONT_SET_DEFAULT| FILMSTRIP | DRAWER },
- {BLT_CONFIG_PIXELS_NNEG, "-sashborderwidth", "sashBorderWidth",
- "SashBorderWidth", DEF_HANDLEBORDERWIDTH,
- Blt_Offset(Paneset, handleBW), BLT_CONFIG_DONT_SET_DEFAULT | PANESET},
- {BLT_CONFIG_BACKGROUND, "-sashcolor", "sashColor", "SashColor",
- DEF_HANDLECOLOR, Blt_Offset(Paneset, handleBg), PANESET},
- {BLT_CONFIG_PAD, "-sashpad", "sashPad", "SashPad", DEF_HANDLEPAD,
- Blt_Offset(Paneset, handlePad), BLT_CONFIG_DONT_SET_DEFAULT | PANESET},
- {BLT_CONFIG_RELIEF, "-sashrelief", "sashRelief", "SashRelief",
- DEF_HANDLERELIEF, Blt_Offset(Paneset, relief),
- BLT_CONFIG_DONT_SET_DEFAULT | PANESET },
- {BLT_CONFIG_PIXELS_NNEG, "-sashthickness", "sashThickness",
- "SashThickness", DEF_HANDLETHICKNESS,
- Blt_Offset(Paneset, handleThickness),
- BLT_CONFIG_DONT_SET_DEFAULT| PANESET },
- {BLT_CONFIG_OBJ, "-scrollcommand", "scrollCommand", "ScrollCommand",
- (char *)NULL, Blt_Offset(Paneset, scrollCmdObjPtr),
- BLT_CONFIG_NULL_OK | FILMSTRIP },
- {BLT_CONFIG_PIXELS_POS, "-scrollincrement", "scrollIncrement",
- "ScrollIncrement", DEF_SCROLLINCREMENT, Blt_Offset(Paneset,scrollUnits),
- BLT_CONFIG_DONT_SET_DEFAULT | FILMSTRIP | DRAWER },
- {BLT_CONFIG_INT_NNEG, "-scrolldelay", "scrollDelay", "ScrollDelay",
- DEF_SCROLLDELAY, Blt_Offset(Paneset, interval),
- BLT_CONFIG_DONT_SET_DEFAULT | FILMSTRIP | DRAWER },
- {BLT_CONFIG_PIXELS_NNEG, "-width", "width", "Width", DEF_WIDTH,
- Blt_Offset(Paneset, reqWidth), BLT_CONFIG_DONT_SET_DEFAULT | ALL},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-
-/*
- * PaneIterator --
- *
-v * Panes may be tagged with strings. A pane may have many tags. The same
- * tag may be used for many panes.
- *
- */
-typedef enum {
- ITER_SINGLE, ITER_ALL, ITER_TAG, ITER_PATTERN,
-} IteratorType;
-
-typedef struct _Iterator {
- Paneset *setPtr; /* Paneset that we're iterating over. */
-
- IteratorType type; /* Type of iteration:
- * ITER_TAG By item tag.
- * ITER_ALL By every item.
- * ITER_SINGLE Single item: either
- * tag or index.
- * ITER_PATTERN Over a consecutive
- * range of indices.
- */
-
- Pane *startPtr; /* Starting pane. Starting point of
- * search, saved if iterator is reused.
- * Used for ITER_ALL and ITER_SINGLE
- * searches. */
- Pane *endPtr; /* Ending pend (inclusive). */
-
- Pane *nextPtr; /* Next pane. */
-
- /* For tag-based searches. */
- char *tagName; /* If non-NULL, is the tag that we are
- * currently iterating over. */
-
- Blt_HashTable *tablePtr; /* Pointer to tag hash table. */
-
- Blt_HashSearch cursor; /* Search iterator for tag hash
- * table. */
- Blt_ChainLink link;
-} PaneIterator;
-
-/*
- * Forward declarations
- */
-static Tcl_FreeProc PanesetFreeProc;
-static Tcl_IdleProc DisplayPaneset;
-static Tcl_IdleProc DisplayHandle;
-static Tcl_ObjCmdProc PanesetCmd;
-static Tcl_ObjCmdProc DrawersetCmd;
-static Tcl_ObjCmdProc FilmstripCmd;
-static Tk_EventProc PanesetEventProc;
-static Tk_EventProc PaneEventProc;
-static Tk_EventProc HandleEventProc;
-static Tcl_FreeProc PaneFreeProc;
-static Tcl_ObjCmdProc PanesetInstCmdProc;
-static Tcl_ObjCmdProc DrawerInstCmdProc;
-static Tcl_ObjCmdProc HandleInstCmdProc;
-static Tcl_CmdDeleteProc PanesetInstCmdDeleteProc;
-static Tcl_CmdDeleteProc DrawerInstCmdDeleteProc;
-static Tcl_CmdDeleteProc HandleInstCmdDeleteProc;
-static Tcl_TimerProc MotionTimerProc;
-static Tcl_TimerProc DrawerTimerProc;
-static Tcl_VarTraceProc DrawerVarTraceProc;
-
-static int GetPaneIterator(Tcl_Interp *interp, Paneset *setPtr, Tcl_Obj *objPtr,
- PaneIterator *iterPtr);
-static int GetPaneFromObj(Tcl_Interp *interp, Paneset *setPtr, Tcl_Obj *objPtr,
- Pane **panePtrPtr);
-
-static int
-ScreenX(Pane *panePtr)
-{
- Paneset *setPtr;
- int x;
-
- x = panePtr->x;
- setPtr = panePtr->setPtr;
- if (setPtr->type == DRAWER) {
- if (panePtr->side & SIDE_RIGHT) {
- x = Tk_Width(setPtr->tkwin) - x;
- } else if (panePtr->side & SIDE_LEFT) {
- x -= panePtr->size;
- }
- } else if ((setPtr->type == FILMSTRIP) && (ISHORIZ(setPtr))) {
- x -= setPtr->scrollOffset;
- }
- return x;
-}
-
-static int
-ScreenY(Pane *panePtr)
-{
- Paneset *setPtr;
- int y;
-
- setPtr = panePtr->setPtr;
- y = panePtr->y;
- if (setPtr->type == DRAWER) {
- if (panePtr->side & SIDE_BOTTOM) {
- y = Tk_Height(setPtr->tkwin) - y;
- } else if (panePtr->side & SIDE_TOP) {
- y -= panePtr->size;
- }
- } else if ((setPtr->type == FILMSTRIP) && (ISVERT(setPtr))) {
- y -= setPtr->scrollOffset;
- }
- return y;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RaiseDrawer --
- *
- * Raises the drawer to the top of the stack of drawers.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Drawer is redrawn at the top of the stack.
- *
- *---------------------------------------------------------------------------
- */
-static void
-RaiseDrawer(Pane *panePtr)
-{
- if (panePtr->link != NULL) {
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- Blt_Chain_UnlinkLink(setPtr->chain, panePtr->link);
- Blt_Chain_AppendLink(setPtr->chain, panePtr->link);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LowerDrawer --
- *
- * Lowers the drawer to the bottom of the stack of drawers.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Drawer is redraw at the bottom of the stack.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LowerDrawer(Pane *panePtr)
-{
- if (panePtr->link != NULL) {
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- Blt_Chain_UnlinkLink(setPtr->chain, panePtr->link);
- Blt_Chain_PrependLink(setPtr->chain, panePtr->link);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * BoundWidth --
- *
- * Bounds a given width value to the limits described in the limit
- * structure. The initial starting value may be overridden by the
- * nominal value in the limits.
- *
- * Results:
- * Returns the constrained value.
- *
- *---------------------------------------------------------------------------
- */
-static int
-BoundWidth(int width, Blt_Limits *limitsPtr)
-{
- /*
- * Check widgets for requested width values;
- */
- if (limitsPtr->flags & LIMITS_NOM_SET) {
- width = limitsPtr->nom; /* Override initial value */
- }
- if (width < limitsPtr->min) {
- width = limitsPtr->min; /* Bounded by minimum value */
- }
- if (width > limitsPtr->max) {
- width = limitsPtr->max; /* Bounded by maximum value */
- }
- return width;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BoundHeight --
- *
- * Bounds a given value to the limits described in the limit structure.
- * The initial starting value may be overridden by the nominal value in
- * the limits.
- *
- * Results:
- * Returns the constrained value.
- *
- *---------------------------------------------------------------------------
- */
-static int
-BoundHeight(int height, Blt_Limits *limitsPtr)
-{
- /*
- * Check widgets for requested height values;
- */
- if (limitsPtr->flags & LIMITS_NOM_SET) {
- height = limitsPtr->nom; /* Override initial value */
- }
- if (height < limitsPtr->min) {
- height = limitsPtr->min; /* Bounded by minimum value */
- }
- if (height > limitsPtr->max) {
- height = limitsPtr->max; /* Bounded by maximum value */
- }
- return height;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetReqWidth --
- *
- * Returns the width requested by the window embedded in the given pane.
- * The requested space also includes any internal padding which has been
- * designated for this widget.
- *
- * The requested width of the widget is always bounded by the limits set
- * in panePtr->reqWidth.
- *
- * Results:
- * Returns the requested width of the widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetReqWidth(Pane *panePtr)
-{
- int w;
-
- w = (2 * panePtr->iPadX); /* Start with any addition padding
- * requested for the pane. */
- if (panePtr->tkwin != NULL) { /* Add in the requested width. */
- w += Tk_ReqWidth(panePtr->tkwin);
- }
- return BoundWidth(w, &panePtr->reqWidth);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetReqHeight --
- *
- * Returns the height requested by the widget starting in the given pane.
- * The requested space also includes any internal padding which has been
- * designated for this widget.
- *
- * The requested height of the widget is always bounded by the limits set
- * in panePtr->reqHeight.
- *
- * Results:
- * Returns the requested height of the widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetReqHeight(Pane *panePtr)
-{
- int h;
-
- h = 2 * panePtr->iPadY;
- if (panePtr->tkwin != NULL) {
- h += Tk_ReqHeight(panePtr->tkwin);
- }
- h = BoundHeight(h, &panePtr->reqHeight);
- return h;
-}
-
-static int
-GetReqDrawerWidth(Pane *panePtr)
-{
- int w;
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- w = GetReqWidth(panePtr);
- if ((panePtr->side & SIDE_HORIZONTAL) && (panePtr->flags & HANDLE)) {
- w += setPtr->handleSize;
- }
- if ((Tk_Width(setPtr->tkwin) > 1) && (Tk_Width(setPtr->tkwin) < w)) {
- w = Tk_Width(setPtr->tkwin);
- }
- return w;
-}
-
-static int
-GetReqDrawerHeight(Pane *panePtr)
-{
- int h;
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- h = GetReqHeight(panePtr);
- if ((panePtr->side & SIDE_VERTICAL) && (panePtr->flags & HANDLE)) {
- h += panePtr->setPtr->handleSize;
- }
- if ((Tk_Height(setPtr->tkwin) > 1) && (Tk_Height(setPtr->tkwin) < h)) {
- h = Tk_Height(setPtr->tkwin);
- }
- return h;
-}
-
-static void
-EventuallyRedraw(Paneset *setPtr)
-{
- if ((setPtr->flags & REDRAW_PENDING) == 0) {
- setPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayPaneset, setPtr);
- }
-}
-
-static int
-SetDrawerVariable(Pane *panePtr)
-{
- Paneset *setPtr;
- Tcl_Obj *objPtr;
- int state;
- int result;
-
- result = TCL_OK;
- state = (panePtr->flags & CLOSED) ? FALSE : TRUE;
- objPtr = (state) ? panePtr->openValueObjPtr : panePtr->closeValueObjPtr;
- if (objPtr == NULL) {
- objPtr = Tcl_NewBooleanObj(state);
- }
- setPtr = panePtr->setPtr;
- Tcl_IncrRefCount(objPtr);
- if (Tcl_ObjSetVar2(setPtr->interp, panePtr->variableObjPtr, NULL,
- objPtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- result = TCL_ERROR;
- }
- Tcl_DecrRefCount(objPtr);
- return result;
-}
-
-static void
-ClearTags(Pane *panePtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *h2Ptr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tablePtr, (char *)panePtr);
- if (h2Ptr != NULL) {
- Blt_DeleteHashEntry(tablePtr, h2Ptr);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyPane --
- *
- * Removes the Pane structure from the hash table and frees the memory
- * allocated by it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the pane is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyPane(Pane *panePtr)
-{
- Paneset *setPtr;
-
- ClearTags(panePtr);
- setPtr = panePtr->setPtr;
- Blt_FreeOptions(paneSpecs, (char *)panePtr, setPtr->display, 0);
- if (panePtr->timerToken != (Tcl_TimerToken)0) {
- Tcl_DeleteTimerHandler(panePtr->timerToken);
- panePtr->timerToken = 0;
- }
- if (panePtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&setPtr->paneTable, panePtr->hashPtr);
- panePtr->hashPtr = NULL;
- }
- if (panePtr->link != NULL) {
- Blt_Chain_DeleteLink(setPtr->chain, panePtr->link);
- panePtr->link = NULL;
- }
- if (panePtr->cmdToken != NULL) {
- Tcl_DeleteCommandFromToken(setPtr->interp, panePtr->cmdToken);
- }
- if (panePtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = panePtr->tkwin;
- Tk_DeleteEventHandler(tkwin, StructureNotifyMask, PaneEventProc,
- panePtr);
- Tk_ManageGeometry(tkwin, (Tk_GeomMgr *)NULL, panePtr);
- Tk_DestroyWindow(tkwin);
- }
- if (panePtr->handle != NULL) {
- Tk_Window tkwin;
-
- tkwin = panePtr->handle;
- Tk_DeleteEventHandler(tkwin,
- ExposureMask|FocusChangeMask|StructureNotifyMask,
- HandleEventProc, panePtr);
- Tk_ManageGeometry(tkwin, (Tk_GeomMgr *)NULL, panePtr);
- panePtr->handle = NULL;
- Tk_DestroyWindow(tkwin);
- }
- Blt_Free(panePtr);
-}
-
-static void
-CloseDrawer(Pane *panePtr)
-{
- Paneset *setPtr;
-
- if (panePtr->flags & (CLOSED|DISABLED)) {
- return; /* Already closed or disabled. */
- }
- if (Tk_IsMapped(panePtr->tkwin)) {
- Tk_UnmapWindow(panePtr->tkwin);
- }
- if (Tk_IsMapped(panePtr->handle)) {
- Tk_UnmapWindow(panePtr->handle);
- }
- setPtr = panePtr->setPtr;
- if (panePtr->side & SIDE_VERTICAL) {
- panePtr->y = -1;
- } else {
- panePtr->x = -1;
- }
- if (panePtr->timerToken != (Tcl_TimerToken)0) {
- Tcl_DeleteTimerHandler(panePtr->timerToken);
- panePtr->timerToken = 0;
- }
- panePtr->flags |= CLOSED;
- SetDrawerVariable(panePtr);
-}
-
-
-static void
-EventuallyOpenDrawer(Pane *panePtr)
-{
- Paneset *setPtr;
-
- if ((panePtr->flags & (CLOSED|DISABLED)) != HIDE) {
- return; /* Already open or disabled. */
- }
- setPtr = panePtr->setPtr;
- panePtr->flags &= ~CLOSED;
- SetDrawerVariable(panePtr);
- if (setPtr->flags & ANIMATE) {
- int anchor;
-
- if (panePtr->side & SIDE_VERTICAL) {
- panePtr->scrollTarget = GetReqDrawerHeight(panePtr);
- if (panePtr->y < 0) {
- panePtr->y = 0;
- }
- anchor = panePtr->y;
- } else {
- panePtr->scrollTarget = GetReqDrawerWidth(panePtr);
- if (panePtr->x < 0) {
- panePtr->x = 0;
- }
- anchor = panePtr->x;
- }
- if (panePtr->timerToken != (Tcl_TimerToken)0) {
- Tcl_DeleteTimerHandler(panePtr->timerToken);
- panePtr->timerToken = 0;
- }
- panePtr->scrollIncr = (panePtr->nom > anchor) ? -setPtr->scrollUnits :
- setPtr->scrollUnits;
- panePtr->timerToken = Tcl_CreateTimerHandler(setPtr->interval,
- DrawerTimerProc, panePtr);
- } else {
- if (panePtr->side & SIDE_VERTICAL) {
- panePtr->size = panePtr->y = GetReqDrawerHeight(panePtr);
- } else {
- panePtr->size = panePtr->x = GetReqDrawerWidth(panePtr);
- }
- SetDrawerVariable(panePtr);
- }
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
-}
-
-static void
-EventuallyCloseDrawer(Pane *panePtr)
-{
- Paneset *setPtr;
-
- if (panePtr->flags & (DISABLED|CLOSED)) {
- return; /* Already closed or disabled. */
- }
- setPtr = panePtr->setPtr;
- if (setPtr->flags & ANIMATE) {
- panePtr->scrollTarget = -1;
- if (panePtr->timerToken != (Tcl_TimerToken)0) {
- Tcl_DeleteTimerHandler(panePtr->timerToken);
- panePtr->timerToken = 0;
- }
- panePtr->scrollIncr = -setPtr->scrollUnits;
- panePtr->timerToken = Tcl_CreateTimerHandler(setPtr->interval,
- DrawerTimerProc, panePtr);
- } else {
- CloseDrawer(panePtr);
- }
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawerTimerProc --
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawerTimerProc(ClientData clientData)
-{
- Pane *panePtr = clientData;
- int *anchorPtr;
- Paneset *setPtr;
-
- assert((panePtr->flags & CLOSED) == 0);
- setPtr = panePtr->setPtr;
- anchorPtr = (panePtr->side & SIDE_VERTICAL) ? &panePtr->y : &panePtr->x;
- if (*anchorPtr != panePtr->scrollTarget) {
- *anchorPtr += panePtr->scrollIncr;
- if (((panePtr->scrollIncr > 0) && (*anchorPtr>panePtr->scrollTarget)) ||
- ((panePtr->scrollIncr < 0) && (*anchorPtr<panePtr->scrollTarget))) {
- *anchorPtr = panePtr->scrollTarget;
- }
- }
- if (panePtr->scrollTarget == *anchorPtr) {
- if (panePtr->timerToken != (Tcl_TimerToken)0) {
- Tcl_DeleteTimerHandler(panePtr->timerToken);
- panePtr->timerToken = 0;
- }
- if (*anchorPtr < 0) {
- CloseDrawer(panePtr);
- }
- } else if (setPtr->flags & ANIMATE) {
- panePtr->scrollIncr += panePtr->scrollIncr;
- panePtr->timerToken = Tcl_CreateTimerHandler(setPtr->interval,
- DrawerTimerProc, panePtr);
- }
- EventuallyRedraw(setPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawerVarTraceProc --
- *
- * This procedure is invoked when someone changes the state variable
- * associated with a radiobutton or checkbutton entry. The entry's
- * selected state is set to match the value of the variable.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The drawer may become opened or closed.
- *
- *---------------------------------------------------------------------------
- */
-static char *
-DrawerVarTraceProc(
- ClientData clientData, /* Information about the item. */
- Tcl_Interp *interp, /* Interpreter containing variable. */
- const char *name1, /* First part of variable's name. */
- const char *name2, /* Second part of variable's name. */
- int flags) /* Describes what just happened. */
-{
- Pane *panePtr = clientData;
- Tcl_Obj *objPtr;
- int bool;
-
- assert(panePtr->variableObjPtr != NULL);
- if (flags & TCL_INTERP_DESTROYED) {
- return NULL; /* Interpreter is going away. */
- }
- /*
- * If the variable is being unset, then re-establish the trace.
- */
- if (flags & TCL_TRACE_UNSETS) {
- panePtr->flags &= ~CLOSED;
- if (flags & TCL_TRACE_DESTROYED) {
- char *varName;
-
- varName = Tcl_GetString(panePtr->variableObjPtr);
- Tcl_TraceVar(interp, varName, VAR_FLAGS, DrawerVarTraceProc,
- clientData);
- }
- goto done;
- }
-
- /*
- * Use the value of the variable to update the selected status of the
- * item.
- */
- objPtr = Tcl_ObjGetVar2(interp, panePtr->variableObjPtr, NULL,
- TCL_GLOBAL_ONLY);
- if (objPtr == NULL) {
- return NULL; /* Can't get value of variable. */
- }
- bool = 0;
- if (panePtr->openValueObjPtr == NULL) {
- if (Tcl_GetBooleanFromObj(NULL, objPtr, &bool) != TCL_OK) {
- return NULL;
- }
- } else {
- bool = (strcmp(Tcl_GetString(objPtr),
- Tcl_GetString(panePtr->openValueObjPtr)) == 0);
- }
- if (bool) {
- EventuallyOpenDrawer(panePtr);
- } else {
- EventuallyCloseDrawer(panePtr);
- }
- done:
- EventuallyRedraw(panePtr->setPtr);
- return NULL; /* Done. */
-}
-
-/*ARGSUSED*/
-static void
-FreeTraceVarProc(ClientData clientData, Display *display, char *widgRec,
- int offset)
-{
- Tcl_Obj **varObjPtrPtr = (Tcl_Obj **)(widgRec + offset);
-
- if (*varObjPtrPtr != NULL) {
- Pane *panePtr = (Pane *)(widgRec);
- Paneset *setPtr;
- const char *varName;
-
- setPtr = panePtr->setPtr;
- varName = Tcl_GetString(*varObjPtrPtr);
- Tcl_UntraceVar(setPtr->interp, varName, VAR_FLAGS, DrawerVarTraceProc,
- panePtr);
- Tcl_DecrRefCount(*varObjPtrPtr);
- *varObjPtrPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
-
- * ObjToTraceVarProc --
- *
- * Convert the string representation of a color into a XColor pointer.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTraceVarProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing style. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tcl_Obj **varObjPtrPtr = (Tcl_Obj **)(widgRec + offset);
- Pane *panePtr = (Pane *)(widgRec);
- const char *varName;
-
- /* Remove the current trace on the variable. */
- if (*varObjPtrPtr != NULL) {
- varName = Tcl_GetString(*varObjPtrPtr);
- Tcl_UntraceVar(interp, varName, VAR_FLAGS, DrawerVarTraceProc, panePtr);
- Tcl_DecrRefCount(*varObjPtrPtr);
- *varObjPtrPtr = NULL;
- }
- varName = Tcl_GetString(objPtr);
- if ((varName[0] == '\0') && (flags & BLT_CONFIG_NULL_OK)) {
- return TCL_OK;
- }
- *varObjPtrPtr = objPtr;
- Tcl_IncrRefCount(objPtr);
- Tcl_TraceVar(interp, varName, VAR_FLAGS, DrawerVarTraceProc, panePtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceVarToObjProc --
- *
- * Return the name of the trace variable.
- *
- * Results:
- * The name of the variable representing the drawer is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TraceVarToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tcl_Obj *objPtr = *(Tcl_Obj **)(widgRec + offset);
-
- if (objPtr != NULL) {
- return objPtr;
- }
- return Tcl_NewStringObj("", -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToChild --
- *
- * Converts a window name into Tk window.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToChild(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results */
- Tk_Window parent, /* Parent window */
- Tcl_Obj *objPtr, /* String representation. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Pane *panePtr = (Pane *)widgRec;
- Paneset *setPtr;
- Tk_Window *tkwinPtr = (Tk_Window *)(widgRec + offset);
- Tk_Window old, tkwin;
- char *string;
-
- old = *tkwinPtr;
- tkwin = NULL;
- setPtr = panePtr->setPtr;
- string = Tcl_GetString(objPtr);
- if (string[0] != '\0') {
- tkwin = Tk_NameToWindow(interp, string, setPtr->tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (tkwin == old) {
- return TCL_OK;
- }
- /*
- * Allow only widgets that are children of the paneset/drawer window
- * to be used. We are using the window as viewport to clip the
- * children are necessary.
- */
- parent = Tk_Parent(tkwin);
- if (parent != setPtr->tkwin) {
- Tcl_AppendResult(interp, "can't manage \"", Tk_PathName(tkwin),
- "\" in paneset \"", Tk_PathName(setPtr->tkwin), "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- Tk_ManageGeometry(tkwin, &panesetMgrInfo, panePtr);
- Tk_CreateEventHandler(tkwin, StructureNotifyMask, PaneEventProc,
- panePtr);
- /*
- * We need to make the window to exist immediately. If the window is
- * torn off (placed into another container window), the timing between
- * the container and the its new child (this window) gets tricky.
- * This should work for Tk 4.2.
- */
- Tk_MakeWindowExist(tkwin);
- }
- if (old != NULL) {
- Tk_DeleteEventHandler(old, StructureNotifyMask, PaneEventProc, panePtr);
- Tk_ManageGeometry(old, (Tk_GeomMgr *)NULL, panePtr);
- Tk_UnmapWindow(old);
- }
- *tkwinPtr = tkwin;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChildToObj --
- *
- * Converts the Tk window back to a Tcl_Obj (i.e. its name).
- *
- * Results:
- * The name of the window is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ChildToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window parent, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tk_Window tkwin = *(Tk_Window *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (tkwin == NULL) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- objPtr = Tcl_NewStringObj(Tk_PathName(tkwin), -1);
- }
- return objPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToMode --
- *
- * Converts an adjust mode name into a enum.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToMode(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window parent, /* Parent window */
- Tcl_Obj *objPtr, /* String representation. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- AdjustMode *modePtr = (AdjustMode *)(widgRec + offset);
- const char *string;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "slinky") == 0) {
- *modePtr = MODE_SLINKY;
- } else if (strcmp(string, "givetake") == 0) {
- *modePtr = MODE_GIVETAKE;
- } else if (strcmp(string, "spreadsheet") == 0) {
- *modePtr = MODE_SPREADSHEET;
- } else {
- Tcl_AppendResult(interp, "unknown mode \"", string, "\": should be "
- "givetake, slinky, or spreadsheet\"", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChildToObj --
- *
- * Converts the enum back to a mode string (i.e. its name).
- *
- * Results:
- * The name of the mode is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ModeToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window parent, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- AdjustMode mode = *(AdjustMode *)(widgRec + offset);
- const char *string;
-
- switch (mode) {
- case MODE_SLINKY:
- string = "slinky";
- break;
- case MODE_GIVETAKE:
- string = "givetake";
- break;
- case MODE_SPREADSHEET:
- string = "spreadsheet";
- break;
- default:
- string = "???";
- break;
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToOrientProc --
- *
- * Converts the string representing a state into a bitflag.
- *
- * Results:
- * The return value is a standard TCL result. The state flags are
- * updated.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToOrientProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing state. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Paneset *setPtr = (Paneset *)(widgRec);
- unsigned int *flagsPtr = (unsigned int *)(widgRec + offset);
- const char *string;
- int orient;
- int length;
-
- string = Tcl_GetString(objPtr);
- length = strlen(string);
- if (strncmp(string, "vertical", length) == 0) {
- orient = VERTICAL;
- } else if (strncmp(string, "horizontal", length) == 0) {
- orient = 0;
- } else {
- Tcl_AppendResult(interp, "bad orientation \"", string,
- "\": must be vertical or horizontal", (char *)NULL);
- return TCL_ERROR;
- }
- *flagsPtr &= ~VERTICAL;
- *flagsPtr |= orient;
- setPtr->flags |= LAYOUT_PENDING;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OrientToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-OrientToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int orient = *(unsigned int *)(widgRec + offset);
- const char *string;
-
- if (orient & VERTICAL) {
- string = "vertical";
- } else {
- string = "horizontal";
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-
-
-static void
-EventuallyRedrawHandle(Pane *panePtr)
-{
- if ((panePtr->flags & REDRAW_PENDING) == 0) {
- panePtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayHandle, panePtr);
- }
-}
-
-
-static Pane *
-FirstPane(Paneset *setPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- if ((panePtr->flags & (HIDE|DISABLED)) == 0) {
- return panePtr;
- }
- }
- return NULL;
-}
-
-static Pane *
-LastPane(Paneset *setPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_LastLink(setPtr->chain); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- if ((panePtr->flags & (HIDE|DISABLED)) == 0) {
- return panePtr;
- }
- }
- return NULL;
-}
-
-
-static Pane *
-NextPane(Pane *panePtr)
-{
- if (panePtr != NULL) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_NextLink(panePtr->link); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- panePtr = Blt_Chain_GetValue(link);
- if ((panePtr->flags & (HIDE|DISABLED)) == 0) {
- return panePtr;
- }
- }
- }
- return NULL;
-}
-
-static Pane *
-PrevPane(Pane *panePtr)
-{
- if (panePtr != NULL) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_PrevLink(panePtr->link); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- panePtr = Blt_Chain_GetValue(link);
- if ((panePtr->flags & HIDE) == 0) {
- return panePtr;
- }
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PanesetEventProc --
- *
- * This procedure is invoked by the Tk event handler when the container
- * widget is reconfigured or destroyed.
- *
- * The paneset will be rearranged at the next idle point if the container
- * widget has been resized or moved. There's a distinction made between
- * parent and non-parent container arrangements. When the container is
- * the parent of the embedded widgets, the widgets will automatically
- * keep their positions relative to the container, even when the
- * container is moved. But if the container is not the parent, those
- * widgets have to be moved manually. This can be a performance hit in
- * rare cases where we're scrolling the container (by moving the window)
- * and there are lots of non-child widgets arranged inside.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the paneset associated with tkwin to have its layout
- * re-computed and drawn at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
-static void
-PanesetEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Paneset *setPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(setPtr);
- }
- } else if (eventPtr->type == DestroyNotify) {
- if (setPtr->tkwin != NULL) {
- Blt_DeleteWindowInstanceData(setPtr->tkwin);
- setPtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(setPtr->interp, setPtr->cmdToken);
- }
- if (setPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayPaneset, setPtr);
- }
- Tcl_EventuallyFree(setPtr, PanesetFreeProc);
- } else if (eventPtr->type == ConfigureNotify) {
- setPtr->anchorPtr = LastPane(setPtr); /* Reset anchor pane. */
- setPtr->flags |= SCROLL_PENDING;
- setPtr->anchorPtr = LastPane(setPtr);
- EventuallyRedraw(setPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaneEventProc --
- *
- * This procedure is invoked by the Tk event handler when StructureNotify
- * events occur in a widget managed by the paneset.
- *
- * For example, when a managed widget is destroyed, it frees the
- * corresponding pane structure and arranges for the paneset layout to be
- * re-computed at the next idle point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * If the managed widget was deleted, the Pane structure gets cleaned up
- * and the paneset is rearranged.
- *
- *---------------------------------------------------------------------------
- */
-static void
-PaneEventProc(
- ClientData clientData, /* Pointer to Pane structure for
- * widget referred to by eventPtr. */
- XEvent *eventPtr) /* Describes what just happened. */
-{
- Pane *panePtr = (Pane *)clientData;
- Paneset *setPtr = panePtr->setPtr;
-
- if (eventPtr->type == ConfigureNotify) {
- int borderWidth;
-
- if (panePtr->tkwin == NULL) {
- return;
- }
- borderWidth = Tk_Changes(panePtr->tkwin)->border_width;
- if (panePtr->borderWidth != borderWidth) {
- panePtr->borderWidth = borderWidth;
- EventuallyRedraw(setPtr);
- }
- } else if (eventPtr->type == DestroyNotify) {
- panePtr->tkwin = NULL;
- Tcl_EventuallyFree(panePtr, PaneFreeProc);
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaneCustodyProc --
- *
- * This procedure is invoked when a widget has been stolen by another
- * geometry manager. The information and memory associated with the
- * widget is released.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the paneset to have its layout recomputed at the next
- * idle point.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-PaneCustodyProc(ClientData clientData, Tk_Window tkwin)
-{
- Pane *panePtr = (Pane *)clientData;
- Paneset *setPtr = panePtr->setPtr;
-
- if (Tk_IsMapped(panePtr->tkwin)) {
- Tk_UnmapWindow(panePtr->tkwin);
- }
- DestroyPane(panePtr);
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaneGeometryProc --
- *
- * This procedure is invoked by Tk_GeometryRequest for widgets managed by
- * the paneset geometry manager.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the paneset to have its layout re-computed and re-arranged
- * at the next idle point.
- *
- * ----------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-PaneGeometryProc(ClientData clientData, Tk_Window tkwin)
-{
- Pane *panePtr = (Pane *)clientData;
-
- panePtr->setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(panePtr->setPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleEventProc --
- *
- * This procedure is invoked by the Tk event handler when various events
- * occur in the pane/drawer handle subwindow maintained by this widget.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-HandleEventProc(
- ClientData clientData, /* Pointer to Pane structure for
- * handle referred to by eventPtr. */
- XEvent *eventPtr) /* Describes what just happened. */
-{
- Pane *panePtr = (Pane *)clientData;
- Paneset *setPtr = panePtr->setPtr;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedrawHandle(panePtr);
- }
- } else if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- if (eventPtr->type == FocusIn) {
- panePtr->flags |= FOCUS;
- } else {
- panePtr->flags &= ~FOCUS;
- }
- EventuallyRedrawHandle(panePtr);
- }
- } else if (eventPtr->type == ConfigureNotify) {
- if (panePtr->handle == NULL) {
- return;
- }
- EventuallyRedrawHandle(panePtr);
- } else if (eventPtr->type == DestroyNotify) {
- panePtr->handle = NULL;
- Tcl_DeleteCommandFromToken(setPtr->interp, panePtr->cmdToken);
- }
-}
-
-static Blt_HashTable *
-GetTagTable(Paneset *setPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&setPtr->tagTable, tagName);
- if (hPtr == NULL) {
- return NULL; /* No tag by name. */
- }
- return Blt_GetHashValue(hPtr);
-}
-
-static int
-HasTag(Pane *panePtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
-
- if (strcmp(tagName, "all") == 0) {
- return TRUE;
- }
- tablePtr = GetTagTable(panePtr->setPtr, tagName);
- if (tablePtr == NULL) {
- return FALSE;
- }
- hPtr = Blt_FindHashEntry(tablePtr, (char *)panePtr);
- if (hPtr == NULL) {
- return FALSE;
- }
- return TRUE;
-}
-
-static Blt_HashTable *
-AddTagTable(Paneset *setPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&setPtr->tagTable, tagName, &isNew);
- if (isNew) {
- tablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(tablePtr, BLT_ONE_WORD_KEYS);
- Blt_SetHashValue(hPtr, tablePtr);
- } else {
- tablePtr = Blt_GetHashValue(hPtr);
- }
- return tablePtr;
-}
-
-static void
-AddTag(Paneset *setPtr, Pane *panePtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
- int isNew;
-
- tablePtr = AddTagTable(setPtr, tagName);
- hPtr = Blt_CreateHashEntry(tablePtr, (char *)panePtr, &isNew);
- if (isNew) {
- Blt_SetHashValue(hPtr, panePtr);
- }
-}
-
-
-static void
-ForgetTag(Paneset *setPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
-
- if (strcmp(tagName, "all") == 0) {
- return; /* Can't remove tag "all". */
- }
- hPtr = Blt_FindHashEntry(&setPtr->tagTable, tagName);
- if (hPtr == NULL) {
- return; /* No tag by name. */
- }
- tablePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(tablePtr);
- Blt_Free(tablePtr);
- Blt_DeleteHashEntry(&setPtr->tagTable, hPtr);
-}
-
-static void
-DestroyTags(Paneset *setPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(tablePtr);
- }
-}
-
-static void
-RemoveTag(Pane *panePtr, const char *tagName)
-{
- Blt_HashTable *tablePtr;
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- tablePtr = GetTagTable(setPtr, tagName);
- if (tablePtr != NULL) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(tablePtr, (char *)panePtr);
- if (hPtr != NULL) {
- Blt_DeleteHashEntry(tablePtr, hPtr);
- }
- }
-}
-
-static INLINE Pane *
-BeginPane(Paneset *setPtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_FirstLink(setPtr->chain);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- return NULL;
-}
-
-static INLINE Pane *
-EndPane(Paneset *setPtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_LastLink(setPtr->chain);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- return NULL;
-}
-
-static Pane *
-StepPane(Pane *panePtr)
-{
- if (panePtr != NULL) {
- Blt_ChainLink link;
-
- link = Blt_Chain_NextLink(panePtr->link);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextTaggedPane --
- *
- * Returns the next pane derived from the given tag.
- *
- * Results:
- * Returns the pointer to the next pane in the iterator. If no more panes
- * are available, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Pane *
-NextTaggedPane(PaneIterator *iterPtr)
-{
- switch (iterPtr->type) {
- case ITER_TAG:
- {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_NextHashEntry(&iterPtr->cursor);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- break;
- }
- case ITER_ALL:
- if (iterPtr->link != NULL) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(iterPtr->link);
- iterPtr->link = Blt_Chain_NextLink(iterPtr->link);
- return panePtr;
- }
- break;
- case ITER_PATTERN:
- {
- Blt_ChainLink link;
-
- for (link = iterPtr->link; link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(iterPtr->link);
- if (Tcl_StringMatch(panePtr->name, iterPtr->tagName)) {
- iterPtr->link = Blt_Chain_NextLink(link);
- return panePtr;
- }
- }
- break;
- }
- default:
- break;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FirstTaggedPane --
- *
- * Returns the first pane derived from the given tag.
- *
- * Results:
- * Returns the first pane in the sequence. If no more panes are in the
- * list, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Pane *
-FirstTaggedPane(PaneIterator *iterPtr)
-{
- switch (iterPtr->type) {
- case ITER_TAG:
- {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FirstHashEntry(iterPtr->tablePtr, &iterPtr->cursor);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- }
- break
-;
- case ITER_ALL:
- if (iterPtr->link != NULL) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(iterPtr->link);
- iterPtr->link = Blt_Chain_NextLink(iterPtr->link);
- return panePtr;
- }
- break;
-
- case ITER_PATTERN:
- {
- Blt_ChainLink link;
-
- for (link = iterPtr->link; link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(iterPtr->link);
- if (Tcl_StringMatch(panePtr->name, iterPtr->tagName)) {
- iterPtr->link = Blt_Chain_NextLink(link);
- return panePtr;
- }
- }
- break;
- }
- case ITER_SINGLE:
- return iterPtr->startPtr;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetPaneFromObj --
- *
- * Gets the pane associated the given index, tag, or label. This routine
- * is used when you want only one pane. It's an error if more than one
- * pane is specified (e.g. "all" tag or range "1:4"). It's also an error
- * if the tag is empty (no panes are currently tagged).
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetPaneFromObj(Tcl_Interp *interp, Paneset *setPtr, Tcl_Obj *objPtr,
- Pane **panePtrPtr)
-{
- PaneIterator iter;
- Pane *firstPtr;
-
- if (GetPaneIterator(interp, setPtr, objPtr, &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- firstPtr = FirstTaggedPane(&iter);
- if (firstPtr != NULL) {
- Pane *nextPtr;
-
- nextPtr = NextTaggedPane(&iter);
- if (nextPtr != NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "multiple panes specified by \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- }
- *panePtrPtr = firstPtr;
- return TCL_OK;
-}
-
-static int
-GetPaneByIndex(Tcl_Interp *interp, Paneset *setPtr, const char *string,
- int length, Pane **panePtrPtr)
-{
- Pane *panePtr;
- char c;
- long pos;
-
- panePtr = NULL;
- c = string[0];
- if (Tcl_GetLong(NULL, string, &pos) == TCL_OK) {
- Blt_ChainLink link;
-
- link = Blt_Chain_GetNthLink(setPtr->chain, pos);
- if (link != NULL) {
- panePtr = Blt_Chain_GetValue(link);
- }
- if (panePtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find pane: bad index \"",
- string, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- } else if ((c == 'a') && (strcmp(string, "active") == 0)) {
- panePtr = setPtr->activePtr;
- } else if ((c == 'f') && (strcmp(string, "first") == 0)) {
- panePtr = FirstPane(setPtr);
- } else if ((c == 'l') && (strcmp(string, "last") == 0)) {
- panePtr = LastPane(setPtr);
- } else if ((c == 'e') && (strcmp(string, "end") == 0)) {
- panePtr = LastPane(setPtr);
- } else if ((c == 'n') && (strcmp(string, "none") == 0)) {
- panePtr = NULL;
- } else {
- return TCL_CONTINUE;
- }
- *panePtrPtr = panePtr;
- return TCL_OK;
-}
-
-static Pane *
-GetPaneByName(Paneset *setPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&setPtr->paneTable, string);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetPaneIterator --
- *
- * Converts a string representing a pane index into an pane pointer. The
- * index may be in one of the following forms:
- *
- * number Pane at index in the list of panes.
- * @x,y Pane closest to the specified X-Y screen coordinates.
- * "active" Pane where mouse pointer is located.
- * "posted" Pane is the currently posted cascade pane.
- * "next" Next pane from the focus pane.
- * "previous" Previous pane from the focus pane.
- * "end" Last pane.
- * "none" No pane.
- *
- * number Pane at position in the list of panes.
- * @x,y Pane closest to the specified X-Y screen coordinates.
- * "active" Pane mouse is located over.
- * "focus" Pane is the widget's focus.
- * "select" Currently selected pane.
- * "right" Next pane from the focus pane.
- * "left" Previous pane from the focus pane.
- * "up" Next pane from the focus pane.
- * "down" Previous pane from the focus pane.
- * "end" Last pane in list.
- * "name:string" Pane named "string".
- * "index:number" Pane at index number in list of panes.
- * "tag:string" Pane(s) tagged by "string".
- * "label:pattern" Pane(s) with label matching "pattern".
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned. The
- * pointer to the node is returned via panePtrPtr. Otherwise, TCL_ERROR
- * is returned and an error message is left in interpreter's result
- * field.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetPaneIterator(Tcl_Interp *interp, Paneset *setPtr, Tcl_Obj *objPtr,
- PaneIterator *iterPtr)
-{
- Pane *panePtr, *startPtr, *endPtr;
- Blt_HashTable *tablePtr;
- char *string;
- char c;
- int nBytes;
- int length;
- int result;
-
- iterPtr->setPtr = setPtr;
- iterPtr->type = ITER_SINGLE;
- iterPtr->tagName = Tcl_GetStringFromObj(objPtr, &nBytes);
- iterPtr->nextPtr = NULL;
- iterPtr->startPtr = iterPtr->endPtr = NULL;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- iterPtr->startPtr = iterPtr->endPtr = setPtr->activePtr;
- startPtr = endPtr = panePtr = NULL;
- if (c == '\0') {
- startPtr = endPtr = NULL;
- }
- iterPtr->type = ITER_SINGLE;
- result = GetPaneByIndex(interp, setPtr, string, length, &panePtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (result == TCL_OK) {
- iterPtr->startPtr = iterPtr->endPtr = panePtr;
- return TCL_OK;
- }
- if ((c == 'a') && (strcmp(iterPtr->tagName, "all") == 0)) {
- iterPtr->type = ITER_ALL;
- iterPtr->link = Blt_Chain_FirstLink(setPtr->chain);
- } else if ((c == 'i') && (length > 6) &&
- (strncmp(string, "index:", 6) == 0)) {
- if (GetPaneByIndex(interp, setPtr, string + 6, length - 6, &panePtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- iterPtr->startPtr = iterPtr->endPtr = panePtr;
- } else if ((c == 'n') && (length > 5) &&
- (strncmp(string, "name:", 5) == 0)) {
- panePtr = GetPaneByName(setPtr, string + 5);
- if (panePtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find a pane named \"",
- string + 5, "\" in \"", Tk_PathName(setPtr->tkwin),
- "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- iterPtr->startPtr = iterPtr->endPtr = panePtr;
- } else if ((c == 't') && (length > 4) &&
- (strncmp(string, "tag:", 4) == 0)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = GetTagTable(setPtr, string + 4);
- if (tablePtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find a tag \"", string + 5,
- "\" in \"", Tk_PathName(setPtr->tkwin), "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- iterPtr->tagName = string + 4;
- iterPtr->tablePtr = tablePtr;
- iterPtr->type = ITER_TAG;
- } else if ((c == 'l') && (length > 6) &&
- (strncmp(string, "label:", 6) == 0)) {
- iterPtr->link = Blt_Chain_FirstLink(setPtr->chain);
- iterPtr->tagName = string + 6;
- iterPtr->type = ITER_PATTERN;
- } else if ((panePtr = GetPaneByName(setPtr, string)) != NULL) {
- iterPtr->startPtr = iterPtr->endPtr = panePtr;
- } else if ((tablePtr = GetTagTable(setPtr, string)) != NULL) {
- iterPtr->tagName = string;
- iterPtr->tablePtr = tablePtr;
- iterPtr->type = ITER_TAG;
- } else {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find pane index, name, or tag \"",
- string, "\" in \"", Tk_PathName(setPtr->tkwin), "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewPane --
- *
- * This procedure creates and initializes a new Pane structure to hold a
- * widget. A valid widget has a parent widget that is either a) the
- * container widget itself or b) a mutual ancestor of the container widget.
- *
- * Results:
- * Returns a pointer to the new structure describing the new widget pane.
- * If an error occurred, then the return value is NULL and an error message
- * is left in interp->result.
- *
- * Side effects:
- * Memory is allocated and initialized for the Pane structure.
- *
- * ----------------------------------------------------------------------------
- */
-static Pane *
-NewPane(Tcl_Interp *interp, Paneset *setPtr, const char *name)
-{
- Blt_HashEntry *hPtr;
- Pane *panePtr;
- int isNew;
- const char *object, *className;
- char *handleName;
- char string[200];
-
- if (setPtr->type == DRAWER) {
- className = "DrawerHandle";
- object = "drawer";
- } else if (setPtr->type == PANESET) {
- className = "PanesetSash";
- object = "pane";
- } else if (setPtr->type == FILMSTRIP) {
- className = "FilmstripHandle";
- object = "frame";
- }
- {
- char *path;
-
- /* Generate an unique subwindow name. In theory you could have more
- * than one drawer widget assigned to the same window. */
- path = Blt_AssertMalloc(strlen(Tk_PathName(setPtr->tkwin)) + 200);
- do {
- sprintf(string, "%s%lu", object, setPtr->nextId++);
- sprintf(path, "%s.%s", Tk_PathName(setPtr->tkwin), string);
- } while (Tk_NameToWindow(interp, path, setPtr->tkwin) != NULL);
- Blt_Free(path);
- handleName = string;
- }
- if (name == NULL) {
- name = handleName;
- }
- hPtr = Blt_CreateHashEntry(&setPtr->paneTable, name, &isNew);
- if (!isNew) {
- Tcl_AppendResult(interp, object, " \"", name, "\" already exists.",
- (char *)NULL);
- return NULL;
- }
- panePtr = Blt_AssertCalloc(1, sizeof(Pane));
- Blt_ResetLimits(&panePtr->reqWidth);
- Blt_ResetLimits(&panePtr->reqHeight);
- Blt_ResetLimits(&panePtr->reqSize);
- panePtr->setPtr = setPtr;
- panePtr->name = Blt_GetHashKey(&setPtr->paneTable, hPtr);
- panePtr->hashPtr = hPtr;
- panePtr->anchor = TK_ANCHOR_CENTER;
- panePtr->fill = FILL_NONE;
- panePtr->nom = LIMITS_NOM;
- panePtr->size = panePtr->index = 0;
- panePtr->flags = VIRGIN | SHOW_HANDLE;
- if (setPtr->type == DRAWER) {
- panePtr->flags |= CLOSED | HANDLE;
- panePtr->resize = RESIZE_SHRINK;
- panePtr->fill = TRUE;
- } else {
- panePtr->resize = RESIZE_BOTH;
- panePtr->side = HANDLE_FARSIDE;
- }
- panePtr->weight = 1.0f;
- Blt_SetHashValue(hPtr, panePtr);
-
- panePtr->handle = Tk_CreateWindow(interp, setPtr->tkwin, handleName,
- (char *)NULL);
- if (panePtr->handle == NULL) {
- return NULL;
- }
- Tk_CreateEventHandler(panePtr->handle,
- ExposureMask|FocusChangeMask|StructureNotifyMask,
- HandleEventProc, panePtr);
- Tk_SetClass(panePtr->handle, className);
- panePtr->cmdToken = Tcl_CreateObjCommand(interp,
- Tk_PathName(panePtr->handle), HandleInstCmdProc, panePtr,
- HandleInstCmdDeleteProc);
- return panePtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaneFreeProc --
- *
- * Removes the Pane structure from the hash table and frees the memory
- * allocated by it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the pane is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-PaneFreeProc(DestroyData dataPtr)
-{
- Pane *panePtr = (Pane *)dataPtr;
-
- DestroyPane(panePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewPaneset --
- *
- * This procedure creates and initializes a new Paneset structure with
- * tkwin as its container widget. The internal structures associated with
- * the paneset are initialized.
- *
- * Results:
- * Returns the pointer to the new Paneset structure describing the new
- * paneset geometry manager. If an error occurred, the return value will
- * be NULL and an error message is left in interp->result.
- *
- * Side effects:
- * Memory is allocated and initialized, an event handler is set up to
- * watch tkwin, etc.
- *
- *---------------------------------------------------------------------------
- */
-static Paneset *
-NewPaneset(Tcl_Interp *interp, Tcl_Obj *objPtr, int type)
-{
- Paneset *setPtr;
- Tk_Window tkwin;
-
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
- Tcl_GetString(objPtr), (char *)NULL);
- if (tkwin == NULL) {
- return NULL;
- }
- if (type == PANESET) {
- Tk_SetClass(tkwin, (char *)"Paneset");
- } else if (type == FILMSTRIP) {
- Tk_SetClass(tkwin, (char *)"Filmstrip");
- }
- setPtr = Blt_AssertCalloc(1, sizeof(Paneset));
- setPtr->type = type;
- setPtr->tkwin = tkwin;
- setPtr->interp = interp;
- setPtr->display = Tk_Display(tkwin);
- setPtr->chain = Blt_Chain_Create();
- setPtr->handleThickness = 2;
- setPtr->handlePad.side1 = setPtr->handlePad.side2 = 2;
- setPtr->relief = TK_RELIEF_FLAT;
- setPtr->activeRelief = TK_RELIEF_RAISED;
- setPtr->handleBW = 1;
- setPtr->flags = LAYOUT_PENDING;
- setPtr->mode = MODE_GIVETAKE;
- setPtr->interval = 30;
- setPtr->scrollUnits = 10;
- setPtr->highlightThickness = 2;
- Blt_SetWindowInstanceData(tkwin, setPtr);
- Blt_InitHashTable(&setPtr->paneTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&setPtr->tagTable, BLT_STRING_KEYS);
- Tk_CreateEventHandler(tkwin, ExposureMask|StructureNotifyMask,
- PanesetEventProc, setPtr);
- setPtr->chain = Blt_Chain_Create();
- setPtr->cmdToken = Tcl_CreateObjCommand(interp, Tk_PathName(tkwin),
- PanesetInstCmdProc, setPtr, PanesetInstCmdDeleteProc);
- setPtr->defVertCursor = Tk_GetCursor(interp, tkwin, DEF_VCURSOR);
- setPtr->defHorzCursor = Tk_GetCursor(interp, tkwin, DEF_HCURSOR);
- return setPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewDrawerset --
- *
- * This procedure creates and initializes a new Paneset structure with
- * tkwin as its container widget. The internal structures associated with
- * the paneset are initialized.
- *
- * Results:
- * Returns the pointer to the new Paneset structure describing the new
- * paneset geometry manager. If an error occurred, the return value will
- * be NULL and an error message is left in interp->result.
- *
- * Side effects:
- * Memory is allocated and initialized, an event handler is set up to
- * watch tkwin, etc.
- *
- *---------------------------------------------------------------------------
- */
-static Paneset *
-NewDrawerset(Tcl_Interp *interp, Tcl_Obj *objPtr)
-{
- Paneset *setPtr;
- Tk_Window tkwin;
- const char *string;
- unsigned long count;
-
- string = Tcl_GetString(objPtr);
- tkwin = Tk_NameToWindow(interp, string, Tk_MainWindow(interp));
- if (tkwin == NULL) {
- return NULL;
- }
- setPtr = Blt_AssertCalloc(1, sizeof(Paneset));
- setPtr->tkwin = tkwin;
- setPtr->type = DRAWER;
- setPtr->interp = interp;
- setPtr->display = Tk_Display(tkwin);
- setPtr->chain = Blt_Chain_Create();
- setPtr->handleThickness = 2;
- setPtr->handlePad.side1 = setPtr->handlePad.side2 = 2;
- setPtr->relief = TK_RELIEF_FLAT;
- setPtr->activeRelief = TK_RELIEF_RAISED;
- setPtr->handleBW = 1;
- setPtr->flags = 0;
- setPtr->interval = 30;
- setPtr->scrollUnits = 10;
- setPtr->highlightThickness = 2;
- Blt_SetWindowInstanceData(tkwin, setPtr);
- Blt_InitHashTable(&setPtr->paneTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&setPtr->tagTable, BLT_STRING_KEYS);
- Tk_CreateEventHandler(tkwin, ExposureMask|StructureNotifyMask,
- PanesetEventProc, setPtr);
- setPtr->chain = Blt_Chain_Create();
- setPtr->name = Blt_AssertMalloc(strlen(string) + 200);
- count = 1;
- do {
- sprintf(setPtr->name, "%s_drawerset%lu", string, count++);
- }
- while (Tcl_FindCommand(interp, setPtr->name,
- (Tcl_Namespace *)NULL, 0) != NULL);
- setPtr->cmdToken = Tcl_CreateObjCommand(interp, setPtr->name,
- DrawerInstCmdProc, setPtr, DrawerInstCmdDeleteProc);
- setPtr->defVertCursor = Tk_GetCursor(interp, tkwin, DEF_VCURSOR);
- setPtr->defHorzCursor = Tk_GetCursor(interp, tkwin, DEF_HCURSOR);
- return setPtr;
-}
-
-
-static void
-RenumberPanes(Paneset *setPtr)
-{
- int count;
- Blt_ChainLink link;
-
- count = 0;
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- panePtr->index = count;
- count++;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyPaneset --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the Paneset structure at a safe time (when no-one is using it
- * anymore).
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the paneset geometry manager is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyPaneset(Paneset *setPtr) /* Paneset structure */
-{
- Blt_ChainLink link;
-
- Blt_FreeOptions(panesetSpecs, (char *)setPtr, setPtr->display, 0);
- /* Release the chain of entries. */
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- panePtr->link = NULL; /* Don't disrupt this chain of
- * entries. */
- panePtr->hashPtr = NULL;
- DestroyPane(panePtr);
- }
- Tk_FreeCursor(setPtr->display, setPtr->defHorzCursor);
- Tk_FreeCursor(setPtr->display, setPtr->defVertCursor);
- DestroyTags(setPtr);
- Blt_Chain_Destroy(setPtr->chain);
- Blt_DeleteHashTable(&setPtr->paneTable);
- Blt_Free(setPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PanesetFreeProc --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the Paneset structure at a safe time (when no-one is using it
- * anymore).
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the paneset geometry manager is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-PanesetFreeProc(DestroyData dataPtr) /* Paneset structure */
-{
- Paneset *setPtr = (Paneset *)dataPtr;
-
- DestroyPaneset(setPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TranslateAnchor --
- *
- * Translate the coordinates of a given bounding box based upon the
- * anchor specified. The anchor indicates where the given xy position is
- * in relation to the bounding box.
- *
- * nw --- n --- ne
- * | | x,y ---+
- * w center e | |
- * | | +-----+
- * sw --- s --- se
- *
- * Results:
- * The translated coordinates of the bounding box are returned.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TranslateAnchor(
- int dx, int dy, /* Difference between outer and inner
- * regions. */
- Tk_Anchor anchor, /* Direction of the anchor */
- int *xPtr, int *yPtr)
-{
- int x, y;
-
- x = y = 0;
- switch (anchor) {
- case TK_ANCHOR_NW: /* Upper left corner */
- break;
- case TK_ANCHOR_W: /* Left center */
- y = (dy / 2);
- break;
- case TK_ANCHOR_SW: /* Lower left corner */
- y = dy;
- break;
- case TK_ANCHOR_N: /* Top center */
- x = (dx / 2);
- break;
- case TK_ANCHOR_CENTER: /* Centered */
- x = (dx / 2);
- y = (dy / 2);
- break;
- case TK_ANCHOR_S: /* Bottom center */
- x = (dx / 2);
- y = dy;
- break;
- case TK_ANCHOR_NE: /* Upper right corner */
- x = dx;
- break;
- case TK_ANCHOR_E: /* Right center */
- x = dx;
- y = (dy / 2);
- break;
- case TK_ANCHOR_SE: /* Lower right corner */
- x = dx;
- y = dy;
- break;
- }
- *xPtr = (*xPtr) + x;
- *yPtr = (*yPtr) + y;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LeftSpan --
- *
- * Sums the space requirements of all the panes.
- *
- * Results:
- * Returns the space currently used by the paneset widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-LeftSpan(Paneset *setPtr)
-{
- int total;
- Pane *panePtr;
-
- total = 0;
- /* The left span is every pane before and including) the anchor pane. */
- for (panePtr = setPtr->anchorPtr; panePtr != NULL;
- panePtr = PrevPane(panePtr)) {
- total += panePtr->size;
- }
- return total;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RightSpan --
- *
- * Sums the space requirements of all the panes.
- *
- * Results:
- * Returns the space currently used by the paneset widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-RightSpan(Paneset *setPtr)
-{
- int total;
- Pane *panePtr;
-
- total = 0;
- for (panePtr = NextPane(setPtr->anchorPtr); panePtr != NULL;
- panePtr = NextPane(panePtr)) {
- total += panePtr->size;
- }
- return total;
-}
-
-
-static int
-LeftSpanLimits(Paneset *setPtr, int *minPtr, int *maxPtr)
-{
- int total, min, max;
- Pane *panePtr;
-
- total = min = max = 0;
- /* The left span is every pane before and including) the anchor pane. */
- for (panePtr = setPtr->anchorPtr; panePtr != NULL;
- panePtr = PrevPane(panePtr)) {
- total += panePtr->size;
- max += panePtr->max;
- min += panePtr->min;
- }
- *minPtr = min;
- *maxPtr = max;
- return total;
-}
-
-
-static int
-RightSpanLimits(Paneset *setPtr, int *minPtr, int *maxPtr)
-{
- int min, max, total;
- Pane *panePtr;
-
- total = min = max = 0;
- for (panePtr = NextPane(setPtr->anchorPtr); panePtr != NULL;
- panePtr = NextPane(panePtr)) {
- total += panePtr->size;
- max += panePtr->max;
- min += panePtr->min;
- }
- *minPtr = min;
- *maxPtr = max;
- return total;
-}
-
-
-static int
-GetReqPaneWidth(Pane *panePtr)
-{
- int w;
-
- w = GetReqWidth(panePtr) + PADDING(panePtr->xPad);
- if ((ISHORIZ(panePtr->setPtr)) && (panePtr->flags & HANDLE)) {
- w += panePtr->setPtr->handleSize;
- }
- return w;
-}
-
-static int
-GetReqPaneHeight(Pane *panePtr)
-{
- int h;
-
- h = GetReqHeight(panePtr) + PADDING(panePtr->yPad);
- if ((ISVERT(panePtr->setPtr)) && (panePtr->flags & HANDLE)) {
- h += panePtr->setPtr->handleSize;
- }
- return h;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GrowPane --
- *
- * Expand the span by the amount of the extra space needed. This
- * procedure is used in Layout*Panes to grow the panes to their minimum
- * nominal size, starting from a zero width and height space.
- *
- * On the first pass we try to add space to panes which have not been
- * touched yet (i.e. have no nominal size).
- *
- * If there is still extra space after the first pass, this means that
- * there were no panes could be expanded. This pass will try to remedy
- * this by parcelling out the left over space evenly among the rest of
- * the panes.
- *
- * On each pass, we have to keep iterating over the list, evenly doling
- * out slices of extra space, because we may hit pane limits as space is
- * donated. In addition, if there are left over pixels because of
- * round-off, this will distribute them as evenly as possible.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The panes in the span may be expanded.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GrowPane(Pane *panePtr, int extra)
-{
- if ((panePtr->nom == LIMITS_NOM) && (panePtr->max > panePtr->size)) {
- int avail;
-
- avail = panePtr->max - panePtr->size;
- if (avail > extra) {
- panePtr->size += extra;
- return;
- } else {
- extra -= avail;
- panePtr->size += avail;
- }
- }
- /* Find out how many panes still have space available */
- if ((panePtr->resize & RESIZE_EXPAND) && (panePtr->max > panePtr->size)) {
- int avail;
-
- avail = panePtr->max - panePtr->size;
- if (avail > extra) {
- panePtr->size += extra;
- return;
- } else {
- extra -= avail;
- panePtr->size += avail;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GrowSpan --
- *
- * Grow the span by the designated amount. Size constraints on the panes
- * may prevent any or all of the spacing adjustments.
- *
- * This is very much like the GrowPane procedure, but in this case we are
- * expanding all the panes. It uses a two pass approach, first giving
- * space to panes which are smaller than their nominal sizes. This is
- * because constraints on the panes may cause resizing to be non-linear.
- *
- * If there is still extra space, this means that all panes are at least
- * to their nominal sizes. The second pass will try to add the left over
- * space evenly among all the panes which still have space available
- * (i.e. haven't reached their specified max sizes).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of the pane may be increased.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GrowSpan(Blt_Chain chain, int adjustment)
-{
- int delta; /* Amount of space needed */
- int nAdjust; /* Number of rows/columns that still can
- * be adjusted. */
- Blt_ChainLink link;
- float totalWeight;
-
- /*
- * Pass 1: First adjust the size of panes that still haven't reached their
- * nominal size.
- */
- delta = adjustment;
-
- nAdjust = 0;
- totalWeight = 0.0f;
- for (link = Blt_Chain_LastLink(chain); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- if ((panePtr->weight > 0.0f) && (panePtr->nom > panePtr->size)) {
- nAdjust++;
- totalWeight += panePtr->weight;
- }
- }
-
- while ((nAdjust > 0) && (totalWeight > 0.0f) && (delta > 0)) {
- Blt_ChainLink link;
- int ration; /* Amount of space to add to each
- * row/column. */
- ration = (int)(delta / totalWeight);
- if (ration == 0) {
- ration = 1;
- }
- for (link = Blt_Chain_LastLink(chain); (link != NULL) && (delta > 0);
- link = Blt_Chain_PrevLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- if (panePtr->weight > 0.0f) {
- int avail; /* Amount of space still available. */
-
- avail = panePtr->nom - panePtr->size;
- if (avail > 0) {
- int size; /* Amount of space requested for a
- * particular row/column. */
- size = (int)(ration * panePtr->weight);
- if (size > delta) {
- size = delta;
- }
- if (size < avail) {
- delta -= size;
- panePtr->size += size;
- } else {
- delta -= avail;
- panePtr->size += avail;
- nAdjust--;
- totalWeight -= panePtr->weight;
- }
- }
- }
- }
- }
-
- /*
- * Pass 2: Adjust the panes with space still available
- */
- nAdjust = 0;
- totalWeight = 0.0f;
- for (link = Blt_Chain_LastLink(chain); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- if ((panePtr->weight > 0.0f) && (panePtr->max > panePtr->size)) {
- nAdjust++;
- totalWeight += panePtr->weight;
- }
- }
- while ((nAdjust > 0) && (totalWeight > 0.0f) && (delta > 0)) {
- Blt_ChainLink link;
- int ration; /* Amount of space to add to each
- * row/column. */
-
- ration = (int)(delta / totalWeight);
- if (ration == 0) {
- ration = 1;
- }
- for (link = Blt_Chain_LastLink(chain); (link != NULL) && (delta > 0);
- link = Blt_Chain_PrevLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- if (panePtr->weight > 0.0f) {
- int avail; /* Amount of space still available */
-
- avail = (panePtr->max - panePtr->size);
- if (avail > 0) {
- int size; /* Amount of space requested for a
- * particular row/column. */
- size = (int)(ration * panePtr->weight);
- if (size > delta) {
- size = delta;
- }
- if (size < avail) {
- delta -= size;
- panePtr->size += size;
- } else {
- delta -= avail;
- panePtr->size += avail;
- nAdjust--;
- totalWeight -= panePtr->weight;
- }
- }
- }
- }
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShrinkSpan --
- *
- * Shrink the span by the amount specified. Size constraints on the
- * panes may prevent any or all of the spacing adjustments.
- *
- * This is very much like the GrowPane procedure, but in this case we are
- * shrinking the panes. It uses a two pass approach, first subtracting
- * space to panes which are larger than their nominal sizes. This is
- * because constraints on the panes may cause resizing to be non-linear.
- *
- * After pass 1, if there is still extra to be removed, this means that
- * all panes are at least to their nominal sizes. The second pass will
- * try to remove the extra space evenly among all the panes which still
- * have space available (i.e haven't reached their respective min sizes).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of the panes may be decreased.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ShrinkSpan(Blt_Chain chain, int adjustment)
-{
- Blt_ChainLink link;
- int extra; /* Amount of space needed */
- int nAdjust; /* Number of panes that still can be
- * adjusted. */
- float totalWeight;
-
- extra = -adjustment;
- /*
- * Pass 1: First adjust the size of panes that still aren't at their
- * nominal size.
- */
-
- nAdjust = 0;
- totalWeight = 0.0f;
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- if ((panePtr->weight > 0.0f) && (panePtr->nom < panePtr->size)) {
- nAdjust++;
- totalWeight += panePtr->weight;
- }
- }
-
- while ((nAdjust > 0) && (totalWeight > 0.0f) && (extra > 0)) {
- Blt_ChainLink link;
- int ration; /* Amount of space to subtract from each
- * row/column. */
- ration = (int)(extra / totalWeight);
- if (ration == 0) {
- ration = 1;
- }
- for (link = Blt_Chain_FirstLink(chain); (link != NULL) && (extra > 0);
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- if (panePtr->weight > 0.0f) {
- int avail; /* Amount of space still available */
-
- avail = panePtr->size - panePtr->nom;
- if (avail > 0) {
- int slice; /* Amount of space requested for a
- * particular row/column. */
- slice = (int)(ration * panePtr->weight);
- if (slice > extra) {
- slice = extra;
- }
- if (avail > slice) {
- extra -= slice;
- panePtr->size -= slice;
- } else {
- extra -= avail;
- panePtr->size -= avail;
- nAdjust--; /* Goes to zero (nominal). */
- totalWeight -= panePtr->weight;
- }
- }
- }
- }
- }
- /*
- * Pass 2: Now adjust the panes with space still available (i.e.
- * are bigger than their minimum size).
- */
- nAdjust = 0;
- totalWeight = 0.0f;
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
- int avail;
-
- panePtr = Blt_Chain_GetValue(link);
- avail = panePtr->size - panePtr->min;
- if ((panePtr->weight > 0.0f) && (avail > 0)) {
- nAdjust++;
- totalWeight += panePtr->weight;
- }
- }
- while ((nAdjust > 0) && (totalWeight > 0.0f) && (extra > 0)) {
- Blt_ChainLink link;
- int ration; /* Amount of space to subtract from each
- * pane. */
- ration = (int)(extra / totalWeight);
- if (ration == 0) {
- ration = 1;
- }
- for (link = Blt_Chain_FirstLink(chain); (link != NULL) && (extra > 0);
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- if (panePtr->weight > 0.0f) {
- int avail; /* Amount of space still available */
-
- avail = panePtr->size - panePtr->min;
- if (avail > 0) {
- int slice; /* Amount of space requested for a
- * particular pane. */
- slice = (int)(ration * panePtr->weight);
- if (slice > extra) {
- slice = extra;
- }
- if (avail > slice) {
- extra -= slice;
- panePtr->size -= slice;
- } else {
- extra -= avail;
- panePtr->size -= avail;
- nAdjust--;
- totalWeight -= panePtr->weight;
- }
- }
- }
- }
- }
-}
-
-
-/* |pos anchor| */
-static void
-ShrinkLeftGrowRight(Paneset *setPtr, Pane *leftPtr, Pane *rightPtr, int delta)
-{
- int extra;
- Pane *panePtr;
-
- extra = delta;
- for (panePtr = leftPtr; (panePtr != NULL) && (extra > 0);
- panePtr = PrevPane(panePtr)) {
- int avail; /* Space available to shrink */
-
- avail = panePtr->size - panePtr->min;
- if (avail > 0) {
- if (avail > extra) {
- panePtr->size -= extra;
- extra = 0;
- } else {
- panePtr->size -= avail;
- extra -= avail;
- }
- }
- }
- extra = delta - extra;
- for (panePtr = rightPtr; (panePtr != NULL) && (extra > 0);
- panePtr = NextPane(panePtr)) {
- int avail; /* Space available to grow. */
-
- avail = panePtr->max - panePtr->size;
- if (avail > 0) {
- if (avail > extra) {
- panePtr->size += extra;
- extra = 0;
- } else {
- panePtr->size += avail;
- extra -= avail;
- }
- }
- }
-}
-
-/* |anchor pos| */
-static void
-GrowLeftShrinkRight(Paneset *setPtr, Pane *leftPtr, Pane *rightPtr, int delta)
-{
- int extra;
- Pane *panePtr;
-
- extra = delta;
- for (panePtr = rightPtr; (panePtr != NULL) && (extra > 0);
- panePtr = NextPane(panePtr)) {
- int avail; /* Space available to shrink */
-
- avail = panePtr->size - panePtr->min;
- if (avail > 0) {
- if (avail > extra) {
- panePtr->size -= extra;
- extra = 0;
- } else {
- panePtr->size -= avail;
- extra -= avail;
- }
- }
- }
- extra = delta - extra;
- for (panePtr = leftPtr; (panePtr != NULL) && (extra > 0);
- panePtr = PrevPane(panePtr)) {
- int avail; /* Space available to grow. */
-
- avail = panePtr->max - panePtr->size;
- if (avail > 0) {
- if (avail > extra) {
- panePtr->size += extra;
- extra = 0;
- } else {
- panePtr->size += avail;
- extra -= avail;
- }
- }
- }
-}
-
-
-/* |pos anchor| */
-static void
-ShrinkLeftGrowLast(Paneset *setPtr, Pane *leftPtr, Pane *rightPtr, int delta)
-{
- int extra;
- Pane *panePtr;
-
- extra = delta;
- for (panePtr = leftPtr; (panePtr != NULL) && (extra > 0);
- panePtr = PrevPane(panePtr)) {
- int avail; /* Space available to shrink */
-
- avail = panePtr->size - panePtr->min;
- if (avail > 0) {
- if (avail > extra) {
- panePtr->size -= extra;
- extra = 0;
- } else {
- panePtr->size -= avail;
- extra -= avail;
- }
- }
- }
-#ifdef notdef
- extra = delta - extra;
- for (panePtr = LastPane(setPtr);(panePtr != leftPtr) && (extra > 0);
- panePtr = PrevPane(panePtr)) {
- int avail; /* Space available to grow. */
-
- avail = panePtr->max - panePtr->size;
- if (avail > 0) {
- if (avail > extra) {
- panePtr->size += extra;
- extra = 0;
- } else {
- panePtr->size += avail;
- extra -= avail;
- }
- }
- }
-#endif
-}
-
-/* |anchor pos| */
-static void
-GrowLeftShrinkLast(Paneset *setPtr, Pane *leftPtr, Pane *rightPtr, int delta)
-{
- int extra;
- Pane *panePtr;
-
- extra = delta;
-#ifdef notdef
- for (panePtr = LastPane(setPtr);(panePtr != leftPtr) && (extra > 0);
- panePtr = PrevPane(panePtr)) {
- int avail; /* Space available to shrink */
-
- avail = panePtr->size - panePtr->min;
- if (avail > 0) {
- if (avail > extra) {
- panePtr->size -= extra;
- extra = 0;
- } else {
- panePtr->size -= avail;
- extra -= avail;
- }
- }
- }
- extra = delta - extra;
-#endif
- for (panePtr = leftPtr; (panePtr != NULL) && (extra > 0);
- panePtr = PrevPane(panePtr)) {
- int avail; /* Space available to grow. */
-
- avail = panePtr->max - panePtr->size;
- if (avail > 0) {
- if (avail > extra) {
- panePtr->size += extra;
- extra = 0;
- } else {
- panePtr->size += avail;
- extra -= avail;
- }
- }
- }
-}
-
-static Blt_Chain
-SortedSpan(Paneset *setPtr, Pane *firstPtr, Pane *lastPtr)
-{
- Blt_Chain chain;
- SizeProc *proc;
- Pane *panePtr;
-
- proc = ISVERT(setPtr) ? GetReqPaneHeight : GetReqPaneWidth;
- chain = Blt_Chain_Create();
- for (panePtr = firstPtr; panePtr != lastPtr;
- panePtr = NextPane(panePtr)) {
- int d1;
- Blt_ChainLink link, before, newLink;
-
- d1 = (*proc)(panePtr) - panePtr->size;
- before = NULL;
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *pane2Ptr;
- int d2;
-
- pane2Ptr = Blt_Chain_GetValue(link);
- d2 = (*proc)(pane2Ptr) - pane2Ptr->size;
- if (d2 >= d1) {
- before = link;
- break;
- }
- }
- newLink = Blt_Chain_NewLink();
- Blt_Chain_SetValue(newLink, panePtr);
- if (before != NULL) {
- Blt_Chain_LinkBefore(chain, newLink, before);
- } else {
- Blt_Chain_LinkAfter(chain, newLink, NULL);
- }
- }
- return chain;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResetDrawers --
- *
- * Sets/resets the size of each pane to the minimum limit of the pane
- * (this is usually zero). This routine gets called when new widgets are
- * added, deleted, or resized.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of each pane is re-initialized to its minimum size.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ResetDrawers(Paneset *setPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
- int extra, size;
-
- panePtr = Blt_Chain_GetValue(link);
- /*
- * The constraint procedure below also has the desired side-effect of
- * setting the minimum, maximum, and nominal values to the requested
- * size of its associated widget (if one exists).
- */
- extra = 0;
- if (panePtr->side & SIDE_VERTICAL) {
- size = BoundHeight(0, &panePtr->reqSize);
- } else {
- size = BoundWidth(0, &panePtr->reqSize);
- }
- if (panePtr->flags & HANDLE) {
- extra += setPtr->handleSize;
- }
- if (panePtr->reqSize.flags & LIMITS_NOM_SET) {
- /*
- * This could be done more cleanly. We want to ensure that the
- * requested nominal size is not overridden when determining the
- * normal sizes. So temporarily fix min and max to the nominal
- * size and reset them back later.
- */
- panePtr->min = panePtr->max = panePtr->size = panePtr->nom =
- size + extra;
- } else {
- /* The range defaults to 0..MAXINT */
- panePtr->min = panePtr->reqSize.min + extra;
- panePtr->max = panePtr->reqSize.max + extra;
- panePtr->nom = LIMITS_NOM;
- panePtr->size = size + extra;
- }
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResetPanes --
- *
- * Sets/resets the size of each pane to the minimum limit of the pane
- * (this is usually zero). This routine gets called when new widgets are
- * added, deleted, or resized.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of each pane is re-initialized to its minimum size.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ResetPanes(Paneset *setPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
- int extra, size;
-
- panePtr = Blt_Chain_GetValue(link);
- /*
- * The constraint procedure below also has the desired side-effect of
- * setting the minimum, maximum, and nominal values to the requested
- * size of its associated widget (if one exists).
- */
- if (ISVERT(setPtr)) {
- size = BoundHeight(0, &panePtr->reqSize);
- extra = PADDING(panePtr->yPad);
- } else {
- size = BoundWidth(0, &panePtr->reqSize);
- extra = PADDING(panePtr->xPad);
- }
- if (panePtr->flags & HANDLE) {
- extra += setPtr->handleSize;
- }
- if (panePtr->reqSize.flags & LIMITS_NOM_SET) {
- /*
- * This could be done more cleanly. We want to ensure that the
- * requested nominal size is not overridden when determining the
- * normal sizes. So temporarily fix min and max to the nominal
- * size and reset them back later.
- */
- panePtr->min = panePtr->max = panePtr->size = panePtr->nom =
- size + extra;
- } else {
- /* The range defaults to 0..MAXINT */
- panePtr->min = panePtr->reqSize.min + extra;
- panePtr->max = panePtr->reqSize.max + extra;
- panePtr->nom = LIMITS_NOM;
- panePtr->size = size + extra;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetNominalSizes
- *
- * Sets the normal sizes for each pane. The pane size is the requested
- * widget size plus an amount of padding. In addition, adjust the
- * min/max bounds of the pane depending upon the resize flags (whether
- * the pane can be expanded or shrunk from its normal size).
- *
- * Results:
- * Returns the total space needed for the all the panes.
- *
- * Side Effects:
- * The nominal size of each pane is set. This is later used to determine
- * how to shrink or grow the table if the container can't be resized to
- * accommodate the exact size requirements of all the panes.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SetNominalSizes(Paneset *setPtr)
-{
- Blt_ChainLink link;
- int total;
-
- total = 0;
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
- int extra;
-
- panePtr = Blt_Chain_GetValue(link);
- if (ISVERT(setPtr)) {
- extra = PADDING(panePtr->yPad);
- } else {
- extra = PADDING(panePtr->xPad);
- }
- if (panePtr->flags & HANDLE) {
- extra += setPtr->handleSize;
- }
- /*
- * Restore the real bounds after temporarily setting nominal size.
- * These values may have been set in ResetPanes to restrict the size
- * of the pane to the requested range.
- */
- panePtr->min = panePtr->reqSize.min + extra;
- panePtr->max = panePtr->reqSize.max + extra;
- if (panePtr->size > panePtr->max) {
- panePtr->size = panePtr->max;
- }
- if (panePtr->size < panePtr->min) {
- panePtr->size = panePtr->min;
- }
- panePtr->nom = panePtr->size;
- /*
- * If a pane can't be resized (to either expand or shrink), hold its
- * respective limit at its normal size.
- */
- if ((panePtr->resize & RESIZE_EXPAND) == 0) {
- panePtr->max = panePtr->nom;
- }
- if ((panePtr->resize & RESIZE_SHRINK) == 0) {
- panePtr->min = panePtr->nom;
- }
- total += panePtr->nom;
- }
- return total;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LayoutHorizontalPanes --
- *
- * Calculates the normal space requirements for panes.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The sum of normal sizes set here will be used as the normal size for
- * the container widget.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LayoutHorizontalPanes(Paneset *setPtr)
-{
- Blt_ChainLink link, next;
- int total;
- int maxHeight;
- int x, y;
-
- maxHeight = 0;
- ResetPanes(setPtr);
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL; link = next) {
- Pane *panePtr;
- int width, height;
-
- next = Blt_Chain_NextLink(link);
- panePtr = Blt_Chain_GetValue(link);
- panePtr->flags &= ~HANDLE;
- if (panePtr->flags & HIDE) {
- if (Tk_IsMapped(panePtr->tkwin)) {
- Tk_UnmapWindow(panePtr->tkwin);
- }
- if (Tk_IsMapped(panePtr->handle)) {
- Tk_UnmapWindow(panePtr->handle);
- }
- continue;
- }
- if ((next != NULL) || (setPtr->mode == MODE_SPREADSHEET)) {
- /* Add the size of the handle to the pane. */
- /* width += setPtr->handleSize; */
- if (panePtr->flags & SHOW_HANDLE) {
- panePtr->flags |= HANDLE;
- }
- }
- width = GetReqPaneWidth(panePtr);
- if (width <= 0) {
- /* continue; */
- }
- height = GetReqPaneHeight(panePtr);
- if (maxHeight < height) {
- maxHeight = height;
- }
- if (width > panePtr->size) {
- GrowPane(panePtr, width - panePtr->size);
- }
- }
- x = y = 0;
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- panePtr->height = maxHeight;
- panePtr->width = panePtr->size;
- panePtr->x = x;
- panePtr->y = y;
- x += panePtr->size;
- }
- total = SetNominalSizes(setPtr);
- setPtr->worldWidth = total;
- setPtr->normalWidth = total + 2 * Tk_InternalBorderWidth(setPtr->tkwin);
- setPtr->normalHeight = maxHeight + 2*Tk_InternalBorderWidth(setPtr->tkwin);
- if (setPtr->normalWidth < 1) {
- setPtr->normalWidth = 1;
- }
- if (setPtr->normalHeight < 1) {
- setPtr->normalHeight = 1;
- }
- setPtr->flags &= ~LAYOUT_PENDING;
- setPtr->flags |= SCROLL_PENDING;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LayoutVerticalPanes --
- *
- * Calculates the normal space requirements for panes.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The sum of normal sizes set here will be used as the normal size for
- * the container widget.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LayoutVerticalPanes(Paneset *setPtr)
-{
- Blt_ChainLink link, next;
- int total;
- int maxWidth;
- int x, y;
-
- maxWidth = 0;
-#if TRACE
- fprintf(stderr, "LayoutVerticalPanes\n");
-#endif
- ResetPanes(setPtr);
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL; link = next) {
- Pane *panePtr;
- int width, height;
-
- next = Blt_Chain_NextLink(link);
- panePtr = Blt_Chain_GetValue(link);
- if (panePtr->flags & HIDE) {
- if (Tk_IsMapped(panePtr->tkwin)) {
- Tk_UnmapWindow(panePtr->tkwin);
- }
- if (Tk_IsMapped(panePtr->handle)) {
- Tk_UnmapWindow(panePtr->handle);
- }
- continue;
- }
- panePtr->flags &= ~HANDLE;
- if ((next != NULL) || (setPtr->mode == MODE_SPREADSHEET)) {
- /* height += setPtr->handleSize; */
- if (panePtr->flags & SHOW_HANDLE) {
- panePtr->flags |= HANDLE;
- }
- }
- height = GetReqPaneHeight(panePtr);
- if (height <= 0) {
- continue;
- }
- width = GetReqPaneWidth(panePtr);
- if (maxWidth < width) {
- maxWidth = width;
- }
- if (height > panePtr->size) {
- GrowPane(panePtr, height - panePtr->size);
- }
- }
- x = y = 0;
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- panePtr->width = maxWidth;
- panePtr->height = panePtr->size;
- panePtr->x = x;
- panePtr->y = y;
- y += panePtr->size;
- }
- total = SetNominalSizes(setPtr);
- setPtr->worldWidth = total;
- setPtr->normalHeight = total + 2*Tk_InternalBorderWidth(setPtr->tkwin);
- setPtr->normalWidth = maxWidth + 2*Tk_InternalBorderWidth(setPtr->tkwin);
- if (setPtr->normalWidth < 1) {
- setPtr->normalWidth = 1;
- }
- if (setPtr->normalHeight < 1) {
- setPtr->normalHeight = 1;
- }
- setPtr->flags &= ~LAYOUT_PENDING;
- setPtr->flags |= SCROLL_PENDING;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * LayoutDrawers --
- *
- * Calculates the normal space requirements for panes.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The sum of normal sizes set here will be used as the normal size for
- * the container widget.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LayoutDrawers(Paneset *setPtr)
-{
- Blt_ChainLink link, next;
-
- ResetDrawers(setPtr);
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL; link = next) {
- Pane *panePtr;
- int anchor;
-
- next = Blt_Chain_NextLink(link);
- panePtr = Blt_Chain_GetValue(link);
-
- if (panePtr->side & SIDE_VERTICAL) {
- panePtr->size = GetReqDrawerHeight(panePtr);
- anchor = panePtr->y;
- } else {
- panePtr->size = GetReqDrawerWidth(panePtr);
- anchor = panePtr->x;
- }
- if (anchor < 0) {
-#ifdef notdef
- panePtr->flags |= CLOSED; /* Auto-close */
-#endif
- }
- if (panePtr->flags & SHOW_HANDLE) {
- panePtr->flags |= HANDLE;
- } else {
- panePtr->flags &= ~HANDLE;
- }
- if (panePtr->flags & CLOSED) {
- if (Tk_IsMapped(panePtr->tkwin)) {
- Tk_UnmapWindow(panePtr->tkwin);
- }
- if (Tk_IsMapped(panePtr->handle)) {
- Tk_UnmapWindow(panePtr->handle);
- }
- continue;
- }
- if (panePtr->flags & VIRGIN) {
-#ifdef notdef
- panePtr->x = panePtr->y = 0;
- if (panePtr->side & SIDE_VERTICAL) {
- panePtr->y = panePtr->size = GetReqDrawerHeight(panePtr);
- } else {
- panePtr->x = panePtr->size = GetReqDrawerWidth(panePtr);
- }
-#endif
- }
- if ((panePtr->resize & RESIZE_EXPAND) == 0) {
- panePtr->max = panePtr->size;
- }
- if ((panePtr->resize & RESIZE_SHRINK) == 0) {
- panePtr->min = panePtr->size;
- }
- }
-}
-static void
-ArrangeWindow(Pane *panePtr, int x, int y)
-{
- Paneset *setPtr;
- int cavityWidth, cavityHeight;
-
- setPtr = panePtr->setPtr;
- if (ISVERT(setPtr)) {
- panePtr->height = panePtr->size;
- panePtr->width = Tk_Width(setPtr->tkwin);
- } else {
- panePtr->width = panePtr->size;
- panePtr->height = Tk_Height(setPtr->tkwin);
- }
- cavityWidth = panePtr->width;
- cavityHeight = panePtr->height;
- if (panePtr->tkwin != NULL) {
- int w, h;
- int xMax, yMax;
- int dx, dy;
-
- xMax = x + panePtr->width;
- yMax = y + panePtr->height;
- x += Tk_Changes(panePtr->tkwin)->border_width;
- y += Tk_Changes(panePtr->tkwin)->border_width;
- if (panePtr->flags & HANDLE) {
- if (ISVERT(setPtr)) {
- cavityHeight -= setPtr->handleSize;
- if (panePtr->side & HANDLE_FARSIDE) {
- yMax -= setPtr->handleSize;
- } else {
- y += setPtr->handleSize;
- }
- } else {
- cavityWidth -= setPtr->handleSize;
- if (panePtr->side & HANDLE_FARSIDE) {
- xMax -= setPtr->handleSize;
- } else {
- x += setPtr->handleSize;
- }
- }
- }
-
- /*
- * Unmap any widgets that start beyond of the right edge of the
- * container.
- */
- if ((x >= xMax) || (y >= yMax)) {
- if (Tk_IsMapped(panePtr->tkwin)) {
- Tk_UnmapWindow(panePtr->tkwin);
- }
- return;
- }
- w = GetReqWidth(panePtr);
- h = GetReqHeight(panePtr);
-
- /*
- *
- * Compare the widget's requested size to the size of the cavity.
- *
- * 1) If the widget is larger than the cavity or if the fill flag is
- * set, make the widget the size of the cavity. Check that the new size
- * is within the bounds set for the widget.
- *
- * 2) Otherwise, position the widget in the space according to its
- * anchor.
- *
- */
- if ((cavityWidth <= w) || (panePtr->fill & FILL_X)) {
- w = cavityWidth;
- }
- if (w > panePtr->reqWidth.max) {
- w = panePtr->reqWidth.max;
- }
- if ((cavityHeight <= h) || (panePtr->fill & FILL_Y)) {
- h = cavityHeight;
- }
- if (h > panePtr->reqHeight.max) {
- h = panePtr->reqHeight.max;
- }
- /*
- * Clip the widget at the bottom and/or right edge of the container.
- */
- if (h > (yMax - y)) {
- h = (yMax - y);
- }
- if (w > (xMax - x)) {
- w = (xMax - x);
- }
- dx = dy = 0;
- if (cavityWidth > w) {
- dx = (cavityWidth - w);
- }
- if (cavityHeight > h) {
- dy = (cavityHeight - h);
- }
-#ifdef notdef
- if ((dx > 0) || (dy > 0)) {
- TranslateAnchor(dx, dy, panePtr->anchor, &x, &y);
- }
- TranslateAnchor(w, h, panePtr->anchor, &x, &y);
- fprintf(stderr, "pane=%s x=%d,y=%d, w=%d h=%d\n",
- panePtr->name, x, y, w, h);
-#endif
- /*
- * If the widget is too small (i.e. it has only an external border)
- * then unmap it.
- */
- if ((w < 1) || (h < 1)) {
- if (Tk_IsMapped(panePtr->tkwin)) {
- Tk_UnmapWindow(panePtr->tkwin);
- }
- return;
- }
- /*
- * Resize and/or move the widget as necessary.
- */
- if ((x != Tk_X(panePtr->tkwin)) ||
- (y != Tk_Y(panePtr->tkwin)) ||
- (w != Tk_Width(panePtr->tkwin)) ||
- (h != Tk_Height(panePtr->tkwin))) {
- Tk_MoveResizeWindow(panePtr->tkwin, x, y, w, h);
- }
- if (!Tk_IsMapped(panePtr->tkwin)) {
- Tk_MapWindow(panePtr->tkwin);
- }
- }
-}
-
-static void
-ArrangeHandle(Pane *panePtr, int x, int y)
-{
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- if (panePtr->flags & HANDLE) {
- int w, h;
-
- if (ISVERT(setPtr)) {
- x = 0;
- if (panePtr->side & HANDLE_FARSIDE) {
- y += panePtr->size - setPtr->handleSize;
- }
- w = Tk_Width(setPtr->tkwin);
- h = setPtr->handleSize;
- } else {
- y = 0;
- if (panePtr->side & HANDLE_FARSIDE) {
- x += panePtr->size - setPtr->handleSize;
- }
- h = Tk_Height(setPtr->tkwin);
- w = setPtr->handleSize;
- }
- if ((x != Tk_X(panePtr->tkwin)) ||
- (y != Tk_Y(panePtr->tkwin)) ||
- (w != Tk_Width(panePtr->tkwin)) ||
- (h != Tk_Height(panePtr->tkwin))) {
- Tk_MoveResizeWindow(panePtr->handle, x, y, w, h);
- }
- if (!Tk_IsMapped(panePtr->handle)) {
- Tk_MapWindow(panePtr->handle);
- }
- XRaiseWindow(setPtr->display, Tk_WindowId(panePtr->handle));
- } else if (Tk_IsMapped(panePtr->handle)) {
- Tk_UnmapWindow(panePtr->handle);
- }
-}
-
-
-static void
-ArrangeDrawer(Pane *panePtr)
-{
- Paneset *setPtr;
- int cavityWidth, cavityHeight;
- int x0, y0;
- int x, y;
- int w, h;
- int anchor;
-
- if ((panePtr->flags & CLOSED) || (panePtr->tkwin == NULL)) {
- if (Tk_IsMapped(panePtr->handle)) {
- Tk_UnmapWindow(panePtr->handle);
- }
- return;
- }
- setPtr = panePtr->setPtr;
- x0 = ScreenX(panePtr);
- y0 = ScreenY(panePtr);
- if (panePtr->side & SIDE_VERTICAL) {
- if (panePtr->y > Tk_Height(setPtr->tkwin)) {
- panePtr->y = Tk_Height(setPtr->tkwin);
- }
- cavityHeight = panePtr->y;
- cavityWidth = Tk_Width(setPtr->tkwin);
- panePtr->height = panePtr->size;
- panePtr->width = GetReqDrawerWidth(panePtr);
- } else {
- if (panePtr->x > Tk_Width(setPtr->tkwin)) {
- panePtr->x = Tk_Width(setPtr->tkwin);
- }
- cavityWidth = panePtr->x;
- cavityHeight = Tk_Height(setPtr->tkwin);
- panePtr->width = panePtr->size;
- panePtr->height = GetReqDrawerHeight(panePtr);
- }
- x = ScreenX(panePtr) + Tk_Changes(panePtr->tkwin)->border_width;
- y = ScreenY(panePtr) + Tk_Changes(panePtr->tkwin)->border_width;
-
- w = GetReqDrawerWidth(panePtr);
- h = GetReqDrawerHeight(panePtr);
-
- /*
- *
- * Compare the widget's requested size to the size of the cavity.
- *
- * 1) If the widget is larger than the cavity or if the fill flag is
- * set, make the widget the size of the cavity. Check that the new size
- * is within the bounds set for the widget.
- *
- * 2) Otherwise, position the widget in the space according to its
- * anchor.
- *
- */
- anchor = (panePtr->side & SIDE_VERTICAL) ? panePtr->y : panePtr->x;
-
- if (panePtr->side & SIDE_VERTICAL) {
- if (cavityHeight > h) {
- h = cavityHeight; /* Automatically grow the window. */
- }
- if ((cavityHeight < h) && (panePtr->flags & SHRINK)) {
- h = cavityHeight;
- }
- if (h > panePtr->reqHeight.max) {
- h = panePtr->reqHeight.max;
- }
- panePtr->size = h;
- if ((cavityWidth < w) || (panePtr->fill)) {
- w = cavityWidth;
- if (w > panePtr->reqWidth.max) {
- w = panePtr->reqWidth.max;
- }
- }
- } else {
- if (cavityWidth > w) {
- w = cavityWidth; /* Automatically grow the window. */
- }
- if ((cavityWidth < w) && (panePtr->flags & SHRINK)) {
- w = cavityWidth; /* Allow window to be shrunk. */
- }
- if (w > panePtr->reqWidth.max) {
- w = panePtr->reqWidth.max;
- }
- panePtr->size = w;
- if ((cavityHeight < h) || (panePtr->fill)) {
- h = cavityHeight;
- if (h > panePtr->reqHeight.max) {
- h = panePtr->reqHeight.max;
- }
- }
- }
- x = ScreenX(panePtr) + Tk_Changes(panePtr->tkwin)->border_width;
- y = ScreenY(panePtr) + Tk_Changes(panePtr->tkwin)->border_width;
-
- if ((panePtr->side & SIDE_VERTICAL) && (cavityWidth > w)) {
- x += (cavityWidth - w) / 2;
- }
- if ((panePtr->side & SIDE_HORIZONTAL) && (cavityHeight > h)) {
- y += (cavityHeight - h) / 2;
- }
-
- if (panePtr->flags & HANDLE) {
- /* Make room for the handle if one if needed. Adjust the window's
- * position if the handle is on the near side. */
- if (panePtr->side & SIDE_VERTICAL) {
- h -= setPtr->handleSize;
- if (panePtr->side & HANDLE_NEARSIDE) {
- y += setPtr->handleSize;
- }
- } else {
- w -= setPtr->handleSize;
- if (panePtr->side & HANDLE_NEARSIDE) {
- x += setPtr->handleSize;
- }
- }
- }
-
- /*
- * If the widget is too small (i.e. it has only an external border)
- * then unmap it.
- */
-
- if (anchor < 0) {
- CloseDrawer(panePtr);
- }
- if ((w < 1) || (h < 1)) {
- if (Tk_IsMapped(panePtr->tkwin)) {
- Tk_UnmapWindow(panePtr->tkwin);
- }
- } else {
- /*
- * Resize and/or move the widget as necessary.
- */
- if ((x != Tk_X(panePtr->tkwin)) ||
- (y != Tk_Y(panePtr->tkwin)) ||
- (w != Tk_Width(panePtr->tkwin)) ||
- (h != Tk_Height(panePtr->tkwin))) {
- Tk_MoveResizeWindow(panePtr->tkwin, x, y, w, h);
- }
- if (!Tk_IsMapped(panePtr->tkwin)) {
- Tk_MapWindow(panePtr->tkwin);
- }
- XRaiseWindow(setPtr->display, Tk_WindowId(panePtr->tkwin));
- panePtr->flags &= ~VIRGIN;
- }
-
- if (panePtr->flags & HANDLE) {
- if (panePtr->side & SIDE_VERTICAL) {
- if (panePtr->side & HANDLE_FARSIDE) {
- y += h;
- } else {
- y -= setPtr->handleSize;
- }
- h = setPtr->handleSize;
- } else {
- if (panePtr->side & HANDLE_FARSIDE) {
- x += w;
- } else {
- x -= setPtr->handleSize;
- }
- w = setPtr->handleSize;
- }
- if ((x != Tk_X(panePtr->tkwin)) ||
- (y != Tk_Y(panePtr->tkwin)) ||
- (w != Tk_Width(panePtr->tkwin)) ||
- (h != Tk_Height(panePtr->tkwin))) {
- Tk_MoveResizeWindow(panePtr->handle, x, y, w, h);
- }
- if (!Tk_IsMapped(panePtr->handle)) {
- Tk_MapWindow(panePtr->handle);
- }
- XRaiseWindow(setPtr->display, Tk_WindowId(panePtr->handle));
- } else if (Tk_IsMapped(panePtr->handle)) {
- Tk_UnmapWindow(panePtr->handle);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ArrangePane
- *
- * Places each window at its proper location. First determines the size
- * and position of the each window. It then considers the following:
- *
- * 1. translation of widget position its parent widget.
- * 2. fill style
- * 3. anchor
- * 4. external and internal padding
- * 5. widget size must be greater than zero
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of each pane is re-initialized its minimum size.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ArrangePane(Pane *panePtr, int x, int y)
-{
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- if (ISVERT(setPtr)) {
- panePtr->height = panePtr->size;
- panePtr->width = Tk_Width(setPtr->tkwin);
- } else {
- panePtr->width = panePtr->size;
- panePtr->height = Tk_Height(setPtr->tkwin);
- }
- ArrangeWindow(panePtr, x, y);
- ArrangeHandle(panePtr, x, y);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * VerticalPanes --
- *
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widgets in the paneset are possibly resized and redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-VerticalPanes(Paneset *setPtr)
-{
- int height;
- int top, bottom;
- int y;
- int xPad, yPad;
- Pane *panePtr;
-
- /*
- * If the paneset has no children anymore, then don't do anything at all:
- * just leave the container widget's size as-is.
- */
-#if TRACE
- fprintf(stderr, "VerticalPanes\n");
-#endif
- panePtr = LastPane(setPtr);
- if (panePtr == NULL) {
- fprintf(stderr, "VPanes: last pane is null\n");
- return;
- }
- if (setPtr->anchorPtr == NULL) {
- setPtr->anchorPtr = panePtr;
- }
- if (setPtr->anchorPtr == panePtr) {
- setPtr->bearing = Tk_Height(setPtr->tkwin);
-#if TRACE
- fprintf(stderr, "VerticalPanes: bearing = %d\n", setPtr->bearing);
-#endif
- }
- if (setPtr->flags & LAYOUT_PENDING) {
- fprintf(stderr, "layout v panes\n");
- LayoutVerticalPanes(setPtr);
- }
- /*
- * Save the width and height of the container so we know when its size has
- * changed during ConfigureNotify events.
- */
- xPad = yPad = 2 * Tk_InternalBorderWidth(setPtr->tkwin);
-
- top = LeftSpan(setPtr);
- bottom = RightSpan(setPtr);
- setPtr->worldWidth = height = top + bottom;
-
- /*
- * If the previous geometry request was not fulfilled (i.e. the size of
- * the container is different from paneset space requirements), try to
- * adjust size of the panes to fit the widget.
- */
- if (setPtr->type == PANESET) {
- Pane *firstPtr, *lastPtr;
- Blt_Chain span;
- int dy;
-
- dy = setPtr->bearing - top;
- firstPtr = FirstPane(setPtr);
- lastPtr = NextPane(setPtr->anchorPtr);
- if (firstPtr != lastPtr) {
- span = SortedSpan(setPtr, firstPtr, lastPtr);
- if (dy > 0) {
- GrowSpan(span, dy);
- } else if (dy < 0) {
- ShrinkSpan(span, dy);
- }
- top = LeftSpan(setPtr) + yPad;
- Blt_Chain_Destroy(span);
- }
- dy = (Tk_Height(setPtr->tkwin) - setPtr->bearing) - bottom;
- span = SortedSpan(setPtr, lastPtr, NULL);
- if (dy > 0) {
- GrowSpan(span, dy);
- } else if (dy < 0) {
- ShrinkSpan(span, dy);
- }
- Blt_Chain_Destroy(span);
- bottom = RightSpan(setPtr) + yPad;
- setPtr->worldWidth = height = top + bottom;
- }
-
- /*
- * If after adjusting the size of the panes the space required does not
- * equal the size of the widget, do one of the following:
- *
- * 1) If it's smaller, center the paneset in the widget.
- * 2) If it's bigger, clip the panes that extend beyond the edge of the
- * container.
- *
- * Set the row and column offsets (including the container's internal
- * border width). To be used later when positioning the widgets.
- */
-
-#ifdef notdef
- if (height < setPtr->containerHeight) {
- y += (setPtr->containerHeight - height) / 2;
- }
-#endif
- y = 0;
- for (panePtr = FirstPane(setPtr); panePtr != NULL;
- panePtr = NextPane(panePtr)) {
- panePtr->y = y;
- ArrangePane(panePtr, 0, SCREEN(y));
- y += panePtr->size;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HorizontalPanes --
- *
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widgets in the paneset are possibly resized and redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-HorizontalPanes(Paneset *setPtr)
-{
- int width;
- int left, right;
- int x;
- int xPad, yPad;
- Pane *panePtr;
-
- /*
- * If the paneset has no children anymore, then don't do anything at all:
- * just leave the container widget's size as-is.
- */
- panePtr = LastPane(setPtr);
- if (panePtr == NULL) {
- fprintf(stderr, "HPanes: first pane is null\n");
- return;
- }
- if (setPtr->anchorPtr == NULL) {
- setPtr->anchorPtr = panePtr;
- }
- if (setPtr->anchorPtr == panePtr) {
- setPtr->bearing = Tk_Width(setPtr->tkwin);
-#if TRACE
- fprintf(stderr, "HorizontalPanes: bearing = %d\n", setPtr->bearing);
-#endif
- }
- if (setPtr->flags & LAYOUT_PENDING) {
- fprintf(stderr, "layout h panes\n");
- LayoutHorizontalPanes(setPtr);
- }
- /*
- * Save the width and height of the container so we know when its size has
- * changed during ConfigureNotify events.
- */
- xPad = yPad = 2 * Tk_InternalBorderWidth(setPtr->tkwin);
-
- left = LeftSpan(setPtr);
- right = RightSpan(setPtr);
- setPtr->worldWidth = width = left + right;
-
- /*
- * If the previous geometry request was not fulfilled (i.e. the size of
- * the paneset is different from the total panes space requirements), try
- * to adjust size of the panes to fit the widget.
- */
- if (setPtr->type == PANESET) {
- Pane *firstPtr, *lastPtr;
- Blt_Chain span;
- int dx;
-
- dx = setPtr->bearing - left;
- firstPtr = FirstPane(setPtr);
- lastPtr = NextPane(setPtr->anchorPtr);
- if (firstPtr != lastPtr) {
- span = SortedSpan(setPtr, firstPtr, lastPtr);
- if (dx > 0) {
- GrowSpan(span, dx);
- } else if (dx < 0) {
- ShrinkSpan(span, dx);
- }
- left = LeftSpan(setPtr) + xPad;
- Blt_Chain_Destroy(span);
- }
- dx = (Tk_Width(setPtr->tkwin) - setPtr->bearing) - right;
- span = SortedSpan(setPtr, lastPtr, NULL);
- if (dx > 0) {
- GrowSpan(span, dx);
- } else if (dx < 0) {
- ShrinkSpan(span, dx);
- }
- Blt_Chain_Destroy(span);
- right = RightSpan(setPtr) + xPad;
- setPtr->worldWidth = width = left + right;
- }
-
- /*
- * If after adjusting the size of the panes the space required does not
- * equal the size of the widget, do one of the following:
- *
- * 1) If it's smaller, center the paneset in the widget.
- * 2) If it's bigger, clip the panes that extend beyond the edge of the
- * container.
- *
- * Set the row and column offsets (including the container's internal
- * border width). To be used later when positioning the widgets.
- */
-
- x = 0;
- for (panePtr = FirstPane(setPtr); panePtr != NULL;
- panePtr = NextPane(panePtr)) {
- panePtr->x = x;
- ArrangePane(panePtr, SCREEN(x), 0);
- x += panePtr->size;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OpenDrawers --
- *
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widgets in the paneset are possibly resized and redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ArrangeDrawers(Paneset *setPtr)
-{
- Blt_ChainLink link, next;
-
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL; link = next) {
- Pane *panePtr;
-
- next = Blt_Chain_NextLink(link);
- panePtr = Blt_Chain_GetValue(link);
- ArrangeDrawer(panePtr);
- }
-}
-
-static void
-ComputeGeometry(Paneset *setPtr)
-{
- if (setPtr->type == DRAWER) {
- setPtr->normalWidth = setPtr->normalHeight = 0;
- if (setPtr->tkwin != NULL) {
- setPtr->normalWidth = Tk_ReqWidth(setPtr->tkwin) +
- 2 * Tk_InternalBorderWidth(setPtr->tkwin);
- setPtr->normalHeight = Tk_ReqHeight(setPtr->tkwin) +
- 2 * Tk_InternalBorderWidth(setPtr->tkwin);
- }
- if (setPtr->normalWidth < 1) {
- setPtr->normalWidth = 1;
- }
- if (setPtr->normalHeight < 1) {
- setPtr->normalHeight = 1;
- }
- LayoutDrawers(setPtr);
- } else {
- if (ISVERT(setPtr)) {
- LayoutVerticalPanes(setPtr);
- } else {
- LayoutHorizontalPanes(setPtr);
- }
- }
- setPtr->flags &= ~LAYOUT_PENDING;
-}
-
-static void
-ConfigurePaneset(Paneset *setPtr)
-{
- setPtr->handleSize = MAX(PADDING(setPtr->handlePad),setPtr->highlightThickness) + setPtr->handleThickness;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AddOp --
- *
- * Appends a pane into the widget.
- *
- * Results:
- * Returns a standard TCL result. The index of the pane is left in
- * interp->result.
- *
- * .p add ?name? ?option value...?
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-AddOp(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
- Pane *panePtr;
- const char *name;
-
- name = NULL;
- if (objc > 2) {
- const char *string;
-
- string = Tcl_GetString(objv[2]);
- if (string[0] != '-') {
- if (GetPaneFromObj(NULL, setPtr, objv[2], &panePtr) == TCL_OK) {
- Tcl_AppendResult(interp, "pane \"", string,
- "\" already exists", (char *)NULL);
- return TCL_ERROR;
- }
- name = string;
- objc--, objv++;
- }
- }
- panePtr = NewPane(interp, setPtr, name);
- if (panePtr == NULL) {
- return TCL_ERROR;
- }
- if (Blt_ConfigureWidgetFromObj(interp, panePtr->handle, paneSpecs, objc - 2,
- objv + 2, (char *)panePtr, setPtr->type) != TCL_OK) {
- return TCL_ERROR;
- }
- panePtr->link = Blt_Chain_Append(setPtr->chain, panePtr);
- RenumberPanes(setPtr);
- EventuallyRedraw(setPtr);
- Tcl_SetIntObj(Tcl_GetObjResult(interp), panePtr->index);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Returns the name, position and options of a widget in the paneset.
- *
- * Results:
- * Returns a standard TCL result. A list of the widget attributes is
- * left in interp->result.
- *
- * .p cget option
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CgetOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
-
- return Blt_ConfigureValueFromObj(interp, setPtr->tkwin, panesetSpecs,
- (char *)setPtr, objv[2], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CloseOp --
- *
- * Opens the specified pane.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * .p open pane
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CloseOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Pane *panePtr;
- PaneIterator iter;
- Paneset *setPtr = clientData;
-
- if (GetPaneIterator(interp, setPtr, objv[2], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (panePtr = FirstTaggedPane(&iter); panePtr != NULL;
- panePtr = NextTaggedPane(&iter)) {
- EventuallyCloseDrawer(panePtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Returns the name, position and options of a widget in the paneset.
- *
- * Results:
- * Returns a standard TCL result. A list of the paneset configuration
- * option information is left in interp->result.
- *
- * .p configure option value
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ConfigureOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
-
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, setPtr->tkwin, panesetSpecs,
- (char *)setPtr, (Tcl_Obj *)NULL, setPtr->type);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, setPtr->tkwin, panesetSpecs,
- (char *)setPtr, objv[2], setPtr->type);
- }
- if (Blt_ConfigureWidgetFromObj(interp, setPtr->tkwin, panesetSpecs,
- objc - 2, objv + 2, (char *)setPtr, BLT_CONFIG_OBJV_ONLY|setPtr->type)
- != TCL_OK) {
- return TCL_ERROR;
- }
- ConfigurePaneset(setPtr);
- /* Arrange for the paneset layout to be computed at the next idle point. */
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Deletes the specified panes from the widget. Note that the pane
- * indices can be fixed only after all the deletions have occurred.
- *
- * .p delete widget
- *
- * Results:
- * Returns a standard TCL result.
- *
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DeleteOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
- PaneIterator iter;
- Pane *panePtr;
-
- if (GetPaneIterator(interp, setPtr, objv[2], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (panePtr = FirstTaggedPane(&iter); panePtr != NULL;
- panePtr = NextTaggedPane(&iter)) {
- Tcl_EventuallyFree(panePtr, PaneFreeProc);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- * Indicates if drawer is open or closed.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * widget index pane
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ExistsOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
- Pane *panePtr;
- int state;
-
- state = FALSE;
- if (GetPaneFromObj(NULL, setPtr, objv[2], &panePtr) == TCL_OK) {
- if (panePtr != NULL) {
- state = TRUE;
- }
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), state);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- * Indicates if drawer is open or closed.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * widget index pane
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IndexOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
- Pane *panePtr;
- int index;
-
- index = -1;
- if (GetPaneFromObj(NULL, setPtr, objv[2], &panePtr) == TCL_OK) {
- if (panePtr != NULL) {
- index = panePtr->index;
- }
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InsertOp --
- *
- * Add new entries into a pane set.
- *
- * .t insert position ?label? option-value label option-value...
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InsertOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Pane *panePtr;
- Blt_ChainLink link, before;
- char c;
- const char *string;
- const char *name;
-
- string = Tcl_GetString(objv[2]);
- c = string[0];
- if ((c == 'e') && (strcmp(string, "end") == 0)) {
- before = NULL;
- } else if (isdigit(UCHAR(c))) {
- int pos;
-
- if (Tcl_GetIntFromObj(interp, objv[2], &pos) != TCL_OK) {
- return TCL_ERROR;
- }
- if (pos < 0) {
- before = Blt_Chain_FirstLink(setPtr->chain);
- } else if (pos > Blt_Chain_GetLength(setPtr->chain)) {
- before = NULL;
- } else {
- before = Blt_Chain_GetNthLink(setPtr->chain, pos);
- }
- } else {
- Pane *beforePtr;
-
- if (GetPaneFromObj(interp, setPtr, objv[2], &beforePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (beforePtr == NULL) {
- Tcl_AppendResult(interp, "can't find a pane \"",
- Tcl_GetString(objv[2]), "\" in \"", Tk_PathName(setPtr->tkwin),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- before = beforePtr->link;
- }
- name = NULL;
- if (objc > 3) {
- string = Tcl_GetString(objv[3]);
- if (name[0] != '-') {
- name = string;
- objc--, objv++;
- }
- }
- panePtr = NewPane(interp, setPtr, name);
- if (panePtr == NULL) {
- return TCL_ERROR;
- }
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
- if (Blt_ConfigureWidgetFromObj(interp, panePtr->handle, paneSpecs, objc - 3,
- objv + 3, (char *)panePtr, setPtr->type) != TCL_OK) {
- DestroyPane(panePtr);
- return TCL_ERROR;
- }
- link = Blt_Chain_NewLink();
- if (before != NULL) {
- Blt_Chain_LinkBefore(setPtr->chain, link, before);
- } else {
- Blt_Chain_AppendLink(setPtr->chain, link);
- }
- panePtr->link = link;
- Blt_Chain_SetValue(link, panePtr);
- RenumberPanes(setPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), panePtr->name, -1);
- return TCL_OK;
-
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InvokeOp --
- *
- * This procedure is called to invoke a selection command.
- *
- * .ps invoke pane
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set; old resources get freed, if there were any. The widget is
- * redisplayed if needed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InvokeOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Pane *panePtr;
- Tcl_Obj *cmdObjPtr;
-
- if (GetPaneFromObj(interp, setPtr, objv[2], &panePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((panePtr == NULL) || (panePtr->flags & (DISABLED|HIDE))) {
- return TCL_OK;
- }
- cmdObjPtr = GETATTR(panePtr, cmdObjPtr);
- if (cmdObjPtr != NULL) {
- Tcl_Obj **args;
- Tcl_Obj **cmdv;
- int cmdc;
- int i;
- int result;
-
- if (Tcl_ListObjGetElements(interp, cmdObjPtr, &cmdc, &cmdv) != TCL_OK) {
- return TCL_ERROR;
- }
- args = Blt_AssertMalloc(sizeof(Tcl_Obj *) * (cmdc + 1));
- for (i = 0; i < cmdc; i++) {
- args[i] = cmdv[i];
- }
- args[i] = Tcl_NewIntObj(panePtr->index);
- result = Blt_GlobalEvalObjv(interp, cmdc + 1, args);
- Blt_Free(args);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsOpenOp --
- *
- * Indicates if drawer is open or closed.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * widget isopen pane
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IsOpenOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
- Pane *panePtr;
- int state;
-
- if (GetPaneFromObj(interp, setPtr, objv[2], &panePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- state = FALSE;
- if (panePtr != NULL) {
- state = (panePtr->flags & CLOSED) ? 0 : 1;
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), state);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MoveOp --
- *
- * Moves a pane to a new location.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-MoveOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Pane *panePtr, *fromPtr;
- char c;
- const char *string;
- int isBefore;
- int length;
-
- if (GetPaneFromObj(interp, setPtr, objv[2], &panePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((panePtr == NULL) || (panePtr->flags & DISABLED)) {
- return TCL_OK;
- }
- string = Tcl_GetStringFromObj(objv[3], &length);
- c = string[0];
- if ((c == 'b') && (strncmp(string, "before", length) == 0)) {
- isBefore = TRUE;
- } else if ((c == 'a') && (strncmp(string, "after", length) == 0)) {
- isBefore = FALSE;
- } else {
- Tcl_AppendResult(interp, "bad key word \"", string,
- "\": should be \"after\" or \"before\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (GetPaneFromObj(interp, setPtr, objv[4], &fromPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (fromPtr == NULL) {
- Tcl_AppendResult(interp, "can't find a pane \"",
- Tcl_GetString(objv[4]), "\" in \"", Tk_PathName(setPtr->tkwin),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (panePtr == fromPtr) {
- return TCL_OK;
- }
- Blt_Chain_UnlinkLink(setPtr->chain, panePtr->link);
- if (isBefore) {
- Blt_Chain_LinkBefore(setPtr->chain, panePtr->link, fromPtr->link);
- } else {
- Blt_Chain_LinkAfter(setPtr->chain, panePtr->link, fromPtr->link);
- }
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * .ps names pattern
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NamesOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (objc == 2) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
-
- panePtr = Blt_Chain_GetValue(link);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(panePtr->name, -1));
- }
- } else {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pane *panePtr;
- int i;
-
- panePtr = Blt_Chain_GetValue(link);
- for (i = 2; i < objc; i++) {
- if (Tcl_StringMatch(panePtr->name, Tcl_GetString(objv[i]))) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(panePtr->name, -1));
- break;
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OpenOp --
- *
- * Opens the specified pane.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * .p open pane
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-OpenOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
- Pane *panePtr;
- PaneIterator iter;
-
- if (GetPaneIterator(interp, setPtr, objv[2], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (panePtr = FirstTaggedPane(&iter); panePtr != NULL;
- panePtr = NextTaggedPane(&iter)) {
- EventuallyOpenDrawer(panePtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RaiseOp --
- *
- * Raises the specified pane to the top of the stack of panes.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * .p raise pane
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-RaiseOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
- Pane *panePtr;
- PaneIterator iter;
-
- if (GetPaneIterator(interp, setPtr, objv[2], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (panePtr = FirstTaggedPane(&iter); panePtr != NULL;
- panePtr = NextTaggedPane(&iter)) {
- RaiseDrawer(panePtr);
- }
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LowerOp --
- *
- * Lowers the specified pane to bottom of the stack of panes.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * .p raise pane
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-LowerOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
- Pane *panePtr;
- PaneIterator iter;
-
- if (GetPaneIterator(interp, setPtr, objv[2], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (panePtr = FirstTaggedPane(&iter); panePtr != NULL;
- panePtr = NextTaggedPane(&iter)) {
- LowerDrawer(panePtr);
- }
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaneCgetOp --
- *
- * Returns the name, position and options of a widget in the paneset.
- *
- * Results:
- * Returns a standard TCL result. A list of the widget attributes is
- * left in interp->result.
- *
- * .p pane cget pane option
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PaneCgetOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
- Pane *panePtr;
-
- if (GetPaneFromObj(interp, setPtr, objv[3], &panePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_ConfigureValueFromObj(interp, setPtr->tkwin, paneSpecs,
- (char *)panePtr, objv[4], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaneConfigureOp --
- *
- * Returns the name, position and options of a widget in the paneset.
- *
- * Results:
- * Returns a standard TCL result. A list of the paneset configuration
- * option information is left in interp->result.
- *
- * .p pane configure pane option value
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PaneConfigureOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
- Pane *panePtr;
-
- if (GetPaneFromObj(interp, setPtr, objv[3], &panePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, panePtr->handle, paneSpecs,
- (char *)panePtr, (Tcl_Obj *)NULL, setPtr->type);
- } else if (objc == 5) {
- return Blt_ConfigureInfoFromObj(interp, panePtr->handle, paneSpecs,
- (char *)panePtr, objv[4], setPtr->type);
- }
- if (Blt_ConfigureWidgetFromObj(interp, panePtr->handle, paneSpecs, objc-4,
- objv+4, (char *)panePtr, BLT_CONFIG_OBJV_ONLY|setPtr->type) != TCL_OK) {
- return TCL_ERROR;
- }
- setPtr->anchorPtr = NULL;
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-static Blt_OpSpec paneOps[] =
-{
- {"cget", 2, PaneCgetOp, 5, 5, "pane option",},
- {"configure", 2, PaneConfigureOp, 4, 0, "pane ?option value?",},
-};
-
-static int nPaneOps = sizeof(paneOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaneOp --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to the paneset geometry manager. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PaneOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nPaneOps, paneOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc)(clientData, interp, objc, objv);
-}
-
-
-/*ARGSUSED*/
-static int
-SizeOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
- Pane *panePtr;
- int size;
-
- if (GetPaneFromObj(interp, setPtr, objv[3], &panePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 3) {
- size = panePtr->size;
- } else {
- int newSize;
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- if (Blt_GetPixelsFromObj(interp, setPtr->tkwin, objv[3], PIXELS_NNEG,
- &newSize) != TCL_OK) {
- return TCL_ERROR;
- }
- panePtr->size = newSize;
- if (panePtr->side & SIDE_VERTICAL) {
- panePtr->y = newSize;
- } else {
- panePtr->x = newSize;
- }
- EventuallyRedraw(setPtr);
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), size);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CloseOp --
- *
- * Opens the specified pane.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * .p open pane
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ToggleOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr = clientData;
- Pane *panePtr;
-
- if (GetPaneFromObj(interp, setPtr, objv[2], &panePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((panePtr->tkwin == NULL) || (panePtr->flags & DISABLED)) {
- return TCL_OK;
- }
- if (panePtr->flags & CLOSED) {
- EventuallyOpenDrawer(panePtr);
- } else {
- EventuallyCloseDrawer(panePtr);
- }
- return TCL_OK;
-}
-
-static int
-AdjustDrawerDelta(Paneset *setPtr, int delta)
-{
- int oldBearing;
- int total, min, max, size;
- Pane *panePtr;
-
- total = min = max = 0;
- /* The left span is every pane before and including) the anchor pane. */
- panePtr = setPtr->anchorPtr;
- size = (panePtr->side & SIDE_VERTICAL)
- ? Tk_Height(setPtr->tkwin) : Tk_Width(setPtr->tkwin);
- switch (panePtr->side) {
- case SIDE_BOTTOM:
- case SIDE_RIGHT:
- max = MIN(panePtr->max, size);
- min = size + panePtr->size - max;
- max = size + panePtr->size - panePtr->min;
- break;
- case SIDE_TOP:
- case SIDE_LEFT:
- min = panePtr->min;
- max = MIN(panePtr->max, size);
- break;
- }
- oldBearing = setPtr->bearing;
- setPtr->bearing += delta;
- if (setPtr->bearing < min) {
- setPtr->bearing = min;
- } else if (setPtr->bearing > max) {
- setPtr->bearing = max;
- }
- return setPtr->bearing - oldBearing;
-}
-
-
-static int
-AdjustPanesetDelta(Paneset *setPtr, int delta)
-{
- int total;
- int lmin, lmax, rmin, rmax;
- int oldBearing;
- Pane *panePtr;
-
- total = (ISVERT(setPtr))
- ? Tk_Height(setPtr->tkwin) : Tk_Width(setPtr->tkwin);
-
- LeftSpanLimits(setPtr, &lmin, &lmax);
- RightSpanLimits(setPtr, &rmin, &rmax);
-
- rmin = total - rmin;
- rmax = total - rmax;
- oldBearing = setPtr->bearing;
- setPtr->bearing += delta;
- if (setPtr->bearing < lmin) {
- setPtr->bearing = lmin;
- } else if (setPtr->bearing > lmax) {
- setPtr->bearing = lmax;
- }
- if (setPtr->bearing >= rmin) {
- setPtr->bearing = rmin;
- } else if (setPtr->bearing < rmax) {
- setPtr->bearing = rmax;
- }
- for (panePtr = FirstPane(setPtr); panePtr != NULL;
- panePtr = NextPane(panePtr)) {
- panePtr->nom = panePtr->size;
- }
- return setPtr->bearing - oldBearing;
-}
-
-
-static void
-AdjustHandle(Paneset *setPtr, int delta)
-{
- Pane *panePtr;
-
- if (setPtr->type != FILMSTRIP) {
- if (setPtr->type == DRAWER) {
- delta = AdjustDrawerDelta(setPtr, delta);
- } else {
- delta = AdjustPanesetDelta(setPtr, delta);
- }
- for (panePtr = FirstPane(setPtr); panePtr != NULL;
- panePtr = NextPane(panePtr)) {
- panePtr->nom = panePtr->size;
- }
- }
- if (setPtr->type == DRAWER) {
- switch (setPtr->anchorPtr->side) {
- case SIDE_TOP:
- setPtr->anchorPtr->y += delta;
- break;
- case SIDE_BOTTOM:
- setPtr->anchorPtr->y -= delta;
- break;
- case SIDE_LEFT:
- setPtr->anchorPtr->x += delta;
- break;
- case SIDE_RIGHT:
- setPtr->anchorPtr->x -= delta;
- break;
- }
- } else if (setPtr->type == FILMSTRIP) {
- setPtr->scrollOffset -= delta;
- setPtr->flags |= SCROLL_PENDING;
- } else {
- switch (setPtr->mode) {
- case MODE_GIVETAKE:
- {
- Pane *leftPtr, *rightPtr;
-
- leftPtr = setPtr->anchorPtr;
- rightPtr = NextPane(leftPtr);
- if (delta > 0) {
- GrowLeftShrinkRight(setPtr, leftPtr, rightPtr, delta);
- } else if (delta < 0) {
- ShrinkLeftGrowRight(setPtr, leftPtr, rightPtr, -delta);
- }
- }
- break;
- case MODE_SPREADSHEET:
- {
- Pane *leftPtr, *rightPtr;
-
- leftPtr = setPtr->anchorPtr;
- rightPtr = NextPane(leftPtr);
- if (delta > 0) {
- GrowLeftShrinkLast(setPtr, leftPtr, rightPtr, delta);
- } else if (delta < 0) {
- ShrinkLeftGrowLast(setPtr, leftPtr, rightPtr, -delta);
- }
- }
- break;
- case MODE_SLINKY:
- break;
- }
- for (panePtr = FirstPane(setPtr); panePtr != NULL;
- panePtr = NextPane(panePtr)) {
- panePtr->nom = panePtr->size;
- }
- }
- EventuallyRedraw(setPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * MotionTimerProc --
- *
- *---------------------------------------------------------------------------
- */
-static void
-MotionTimerProc(ClientData clientData)
-{
- Paneset *setPtr = clientData;
-
- if (setPtr->scrollTarget > setPtr->scrollOffset) {
- setPtr->scrollOffset += setPtr->scrollIncr;
- if (setPtr->scrollOffset > setPtr->scrollTarget) {
- setPtr->scrollOffset = setPtr->scrollTarget;
- }
- } else if (setPtr->scrollTarget < setPtr->scrollOffset) {
- setPtr->scrollOffset -= setPtr->scrollIncr;
- if (setPtr->scrollOffset < setPtr->scrollTarget) {
- setPtr->scrollOffset = setPtr->scrollTarget;
- }
- }
- setPtr->scrollIncr += setPtr->scrollIncr;
- if (setPtr->scrollTarget == setPtr->scrollOffset) {
- if (setPtr->timerToken != (Tcl_TimerToken)0) {
- Tcl_DeleteTimerHandler(setPtr->timerToken);
- setPtr->timerToken = 0;
- setPtr->scrollIncr = setPtr->scrollUnits;
- }
- } else {
- setPtr->timerToken = Tcl_CreateTimerHandler(setPtr->interval,
- MotionTimerProc, setPtr);
- }
- setPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(setPtr);
-}
-
-
-/*ARGSUSED*/
-static int
-SeeOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Pane *panePtr;
- int left, right, width, margin;
-
- if (GetPaneFromObj(interp, setPtr, objv[2], &panePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((panePtr == NULL) || (panePtr->flags & (HIDE|DISABLED))) {
- return TCL_OK;
- }
-
- width = VPORTWIDTH(setPtr);
- left = setPtr->scrollOffset;
- right = setPtr->scrollOffset + width;
- margin = 20;
-
- /* If the pane is partially obscured, scroll so that it's entirely in
- * view. */
- if (panePtr->x < left) {
- setPtr->scrollTarget = panePtr->x - (width - panePtr->size)/2;
- if ((panePtr->size + margin) < width) {
- setPtr->scrollTarget -= margin;
- }
- } else if ((panePtr->x + panePtr->size) >= right) {
- setPtr->scrollTarget = panePtr->x - (width - panePtr->size)/2;
- if ((panePtr->size + margin) < width) {
- setPtr->scrollTarget += margin;
- }
- }
- if (setPtr->flags & ANIMATE) {
- setPtr->scrollIncr = setPtr->scrollUnits;
- setPtr->timerToken = Tcl_CreateTimerHandler(setPtr->interval,
- MotionTimerProc, setPtr);
- } else {
- setPtr->scrollOffset = setPtr->scrollTarget;
- }
- setPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagAddOp --
- *
- * .t tag add tagName pane1 pane2 pane2 pane4
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagAddOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- const char *tag;
- long paneId;
-
- tag = Tcl_GetString(objv[3]);
- if (Tcl_GetLongFromObj(NULL, objv[3], &paneId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", tag,
- "\": can't be a number.", (char *)NULL);
- return TCL_ERROR;
- }
- if (strcmp(tag, "all") == 0) {
- Tcl_AppendResult(interp, "can't add reserved tag \"", tag, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (objc == 4) {
- /* No nodes specified. Just add the tag. */
- AddTag(setPtr, NULL, tag);
- } else {
- int i;
-
- for (i = 4; i < objc; i++) {
- Pane *panePtr;
- PaneIterator iter;
-
- if (GetPaneIterator(interp, setPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (panePtr = FirstTaggedPane(&iter); panePtr != NULL;
- panePtr = NextTaggedPane(&iter)) {
- AddTag(setPtr, panePtr, tag);
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagDeleteOp --
- *
- * .t delete tagName pane1 pane2 pane3
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagDeleteOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- const char *tag;
- Blt_HashTable *tablePtr;
- long paneId;
-
- tag = Tcl_GetString(objv[3]);
- if (Tcl_GetLongFromObj(NULL, objv[3], &paneId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", tag,
- "\": can't be a number.", (char *)NULL);
- return TCL_ERROR;
- }
- if (strcmp(tag, "all") == 0) {
- Tcl_AppendResult(interp, "can't delete reserved tag \"", tag, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- tablePtr = GetTagTable(setPtr, tag);
- if (tablePtr != NULL) {
- int i;
-
- for (i = 4; i < objc; i++) {
- Pane *panePtr;
- PaneIterator iter;
-
- if (GetPaneIterator(interp, setPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (panePtr = FirstTaggedPane(&iter); panePtr != NULL;
- panePtr = NextTaggedPane(&iter)) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(tablePtr, (char *)panePtr);
- if (hPtr != NULL) {
- Blt_DeleteHashEntry(tablePtr, hPtr);
- }
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagExistsOp --
- *
- * Returns the existence of the one or more tags in the given node. If
- * the node has any the tags, true is return in the interpreter.
- *
- * .t tag exists pane tag1 tag2 tag3...
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TagExistsOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
- PaneIterator iter;
-
- if (GetPaneIterator(interp, setPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 4; i < objc; i++) {
- const char *tag;
- Pane *panePtr;
-
- tag = Tcl_GetString(objv[i]);
- for (panePtr = FirstTaggedPane(&iter); panePtr != NULL;
- panePtr = NextTaggedPane(&iter)) {
- if (HasTag(panePtr, tag)) {
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), TRUE);
- return TCL_OK;
- }
- }
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), FALSE);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagForgetOp --
- *
- * Removes the given tags from all panes.
- *
- * .ts tag forget tag1 tag2 tag3...
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TagForgetOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- const char *tag;
- long paneId;
-
- tag = Tcl_GetString(objv[i]);
- if (Tcl_GetLongFromObj(NULL, objv[i], &paneId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", tag,
- "\": can't be a number.", (char *)NULL);
- return TCL_ERROR;
- }
- ForgetTag(setPtr, tag);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagGetOp --
- *
- * Returns tag names for a given node. If one of more pattern arguments
- * are provided, then only those matching tags are returned.
- *
- * .t tag get pane pat1 pat2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagGetOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Pane *panePtr;
- PaneIterator iter;
- Tcl_Obj *listObjPtr;
-
- if (GetPaneIterator(interp, setPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (panePtr = FirstTaggedPane(&iter); panePtr != NULL;
- panePtr = NextTaggedPane(&iter)) {
- if (objc == 4) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch hiter;
-
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &hiter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&hiter)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- if (Blt_FindHashEntry(tablePtr, (char *)panePtr) != NULL) {
- const char *tag;
- Tcl_Obj *objPtr;
-
- tag = Blt_GetHashKey(&setPtr->tagTable, hPtr);
- objPtr = Tcl_NewStringObj(tag, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("all", 3));
- } else {
- int i;
-
- /* Check if we need to add the special tags "all" */
- for (i = 4; i < objc; i++) {
- const char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- if (Tcl_StringMatch("all", pattern)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj("all", 3);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- break;
- }
- }
- /* Now process any standard tags. */
- for (i = 4; i < objc; i++) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch hiter;
- const char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &hiter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&hiter)) {
- const char *tag;
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- tag = Blt_GetHashKey(&setPtr->tagTable, hPtr);
- if (!Tcl_StringMatch(tag, pattern)) {
- continue;
- }
- if (Blt_FindHashEntry(tablePtr, (char *)panePtr) != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(tag, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr,objPtr);
- }
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagNamesOp --
- *
- * Returns the names of all the tags in the paneset. If one of more node
- * arguments are provided, then only the tags found in those nodes are
- * returned.
- *
- * .t tag names pane pane pane...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagNamesOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr, *objPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- objPtr = Tcl_NewStringObj("all", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- const char *tag;
- tag = Blt_GetHashKey(&setPtr->tagTable, hPtr);
- objPtr = Tcl_NewStringObj(tag, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- } else {
- Blt_HashTable uniqTable;
- int i;
-
- Blt_InitHashTable(&uniqTable, BLT_STRING_KEYS);
- for (i = 3; i < objc; i++) {
- PaneIterator iter;
- Pane *panePtr;
-
- if (GetPaneIterator(interp, setPtr, objPtr, &iter) != TCL_OK) {
- goto error;
- }
- for (panePtr = FirstTaggedPane(&iter); panePtr != NULL;
- panePtr = NextTaggedPane(&iter)) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch hiter;
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &hiter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&hiter)) {
- const char *tag;
- Blt_HashTable *tablePtr;
-
- tag = Blt_GetHashKey(&setPtr->tagTable, hPtr);
- tablePtr = Blt_GetHashValue(hPtr);
- if (Blt_FindHashEntry(tablePtr, panePtr) != NULL) {
- int isNew;
-
- Blt_CreateHashEntry(&uniqTable, tag, &isNew);
- }
- }
- }
- }
- {
- Blt_HashEntry *hPtr;
- Blt_HashSearch hiter;
-
- for (hPtr = Blt_FirstHashEntry(&uniqTable, &hiter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&hiter)) {
- objPtr = Tcl_NewStringObj(Blt_GetHashKey(&uniqTable, hPtr), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Blt_DeleteHashTable(&uniqTable);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- error:
- Tcl_DecrRefCount(listObjPtr);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagIndicesOp --
- *
- * Returns the indices associated with the given tags. The indices
- * returned will represent the union of panes for all the given tags.
- *
- * .t tag indices tag1 tag2 tag3...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagIndicesOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashTable paneTable;
- int i;
-
- Blt_InitHashTable(&paneTable, BLT_ONE_WORD_KEYS);
- for (i = 3; i < objc; i++) {
- long paneId;
- const char *tag;
-
- tag = Tcl_GetString(objv[i]);
- if (Tcl_GetLongFromObj(NULL, objv[i], &paneId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", tag,
- "\": can't be a number.", (char *)NULL);
- goto error;
- }
- if (strcmp(tag, "all") == 0) {
- break;
- } else {
- Blt_HashTable *tablePtr;
-
- tablePtr = GetTagTable(setPtr, tag);
- if (tablePtr != NULL) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(tablePtr, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Pane *panePtr;
- int isNew;
-
- panePtr = Blt_GetHashValue(hPtr);
- if (panePtr != NULL) {
- Blt_CreateHashEntry(&paneTable, (char *)panePtr, &isNew);
- }
- }
- continue;
- }
- }
- Tcl_AppendResult(interp, "can't find a tag \"", tag, "\"",
- (char *)NULL);
- goto error;
- }
- {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (hPtr = Blt_FirstHashEntry(&paneTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Pane *panePtr;
- Tcl_Obj *objPtr;
-
- panePtr = (Pane *)Blt_GetHashKey(&paneTable, hPtr);
- objPtr = Tcl_NewLongObj(panePtr->index);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- }
- Blt_DeleteHashTable(&paneTable);
- return TCL_OK;
-
- error:
- Blt_DeleteHashTable(&paneTable);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagSetOp --
- *
- * Sets one or more tags for a given pane. Tag names can't start with a
- * digit (to distinquish them from node ids) and can't be a reserved tag
- * ("all").
- *
- * .t tag set pane tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagSetOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
- PaneIterator iter;
-
- if (GetPaneIterator(interp, setPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 4; i < objc; i++) {
- const char *tag;
- Pane *panePtr;
- long paneId;
-
- tag = Tcl_GetString(objv[i]);
- if (Tcl_GetLongFromObj(NULL, objv[i], &paneId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", tag,
- "\": can't be a number.", (char *)NULL);
- return TCL_ERROR;
- }
- if (strcmp(tag, "all") == 0) {
- Tcl_AppendResult(interp, "can't add reserved tag \"", tag, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- for (panePtr = FirstTaggedPane(&iter); panePtr != NULL;
- panePtr = NextTaggedPane(&iter)) {
- AddTag(setPtr, panePtr, tag);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagUnsetOp --
- *
- * Removes one or more tags from a given pane. If a tag doesn't exist or
- * is a reserved tag ("all"), nothing will be done and no error
- * message will be returned.
- *
- * .t tag unset pane tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagUnsetOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Pane *panePtr;
- PaneIterator iter;
-
- if (GetPaneIterator(interp, setPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (panePtr = FirstTaggedPane(&iter); panePtr != NULL;
- panePtr = NextTaggedPane(&iter)) {
- int i;
- for (i = 4; i < objc; i++) {
- RemoveTag(panePtr, Tcl_GetString(objv[i]));
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagOp --
- *
- * This procedure is invoked to process tag operations.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec tagOps[] =
-{
- {"add", 1, TagAddOp, 2, 0, "?name? ?option value...?",},
- {"delete", 1, TagDeleteOp, 2, 0, "?pane...?",},
- {"exists", 1, TagExistsOp, 4, 0, "pane ?tag...?",},
- {"forget", 1, TagForgetOp, 3, 0, "?tag...?",},
- {"get", 1, TagGetOp, 4, 0, "pane ?pattern...?",},
- {"indices", 1, TagIndicesOp, 3, 0, "?tag...?",},
- {"names", 2, TagNamesOp, 3, 0, "?pane...?",},
- {"set", 1, TagSetOp, 4, 0, "pane ?tag...",},
- {"unset", 1, TagUnsetOp, 4, 0, "pane ?tag...",},
-};
-
-static int nTagOps = sizeof(tagOps) / sizeof(Blt_OpSpec);
-
-static int
-TagOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- PanesetCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTagOps, tagOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc)(setPtr, interp, objc, objv);
- return result;
-}
-
-static int
-ViewOp(Paneset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int width;
-
- width = VPORTWIDTH(setPtr);
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr, *objPtr;
-
- /* Report first and last fractions */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- /*
- * Note: we are bounding the fractions between 0.0 and 1.0 to support
- * the "canvas"-style of scrolling.
- */
- fract = (double)setPtr->scrollOffset / setPtr->worldWidth;
- objPtr = Tcl_NewDoubleObj(FCLAMP(fract));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- fract = (double)(setPtr->scrollOffset + width) / setPtr->worldWidth;
- objPtr = Tcl_NewDoubleObj(FCLAMP(fract));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2,
- &setPtr->scrollOffset, setPtr->worldWidth, width,
- setPtr->scrollUnits, BLT_SCROLL_MODE_HIERBOX) != TCL_OK) {
- return TCL_ERROR;
- }
- setPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Paneset operations.
- *
- * The fields for Blt_OpSpec are as follows:
- *
- * - operation name
- * - minimum number of characters required to disambiguate the operation name.
- * - function associated with operation.
- * - minimum number of arguments required.
- * - maximum number of arguments allowed (0 indicates no limit).
- * - usage string
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec panesetOps[] =
-{
- {"add", 1, AddOp, 2, 0, "?name? ?option value?...",},
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"configure", 2, ConfigureOp, 2, 0, "?option value?",},
- {"delete", 1, DeleteOp, 3, 3, "pane",},
- {"exists", 1, ExistsOp, 3, 3, "pane",},
- {"index", 3, IndexOp, 3, 3, "pane",},
- {"insert", 3, InsertOp, 3, 0, "position ?name? ?option value?...",},
- {"invoke", 3, InvokeOp, 3, 3, "pane",},
- {"move", 1, MoveOp, 3, 0, "pane after|before pane",},
- {"names", 1, NamesOp, 2, 0, "?pattern...?",},
- {"pane", 1, PaneOp, 2, 0, "oper ?args?",},
- {"see", 1, SeeOp, 3, 3, "pane",},
- {"tag", 1, TagOp, 2, 0, "oper args",},
- {"view", 1, ViewOp, 2, 5,
- "?moveto fract? ?scroll number what?",},
-};
-
-static int nPanesetOps = sizeof(panesetOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * PanesetInstCmdDeleteProc --
- *
- * This procedure is invoked when a widget command is deleted. If the
- * widget isn't already in the process of being destroyed, this command
- * destroys it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-PanesetInstCmdDeleteProc(ClientData clientData)
-{
- Paneset *setPtr = clientData;
-
- /*
- * This procedure could be invoked either because the window was destroyed
- * and the command was then deleted (in which case tkwin is NULL) or
- * because the command was deleted, and then this procedure destroys the
- * widget.
- */
- if (setPtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = setPtr->tkwin;
- setPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PanesetInstCmdProc --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to the paneset geometry manager. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PanesetInstCmdProc(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- PanesetCmdProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nPanesetOps, panesetOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc)(clientData, interp, objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawerInstCmdDeleteProc --
- *
- * This procedure is invoked when a widget command is deleted. If the
- * widget isn't already in the process of being destroyed, this command
- * destroys it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawerInstCmdDeleteProc(ClientData clientData)
-{
- Paneset *setPtr = clientData;
-
- /*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin is
- * NULL) or because the command was deleted, and then this procedure
- * destroys the widget.
- */
- if (setPtr->tkwin != NULL) {
- DestroyPaneset(setPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Drawer operations.
- *
- * The fields for Blt_OpSpec are as follows:
- *
- * - operation name
- * - minimum number of characters required to disambiguate the operation name.
- * - function associated with operation.
- * - minimum number of arguments required.
- * - maximum number of arguments allowed (0 indicates no limit).
- * - usage string
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec drawerOps[] =
-{
- {"add", 1, AddOp, 2, 0, "?name? ?option value?...",},
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"close", 2, CloseOp, 3, 3, "drawer",},
- {"configure", 2, ConfigureOp, 2, 0, "?option value?",},
- {"delete", 2, DeleteOp, 3, 3, "drawer",},
- {"drawer", 2, PaneOp, 2, 0, "oper ?args?",},
- {"insert", 3, InsertOp, 4, 0, "position ?name? ?option value?...",},
- {"invoke", 3, InvokeOp, 3, 3, "drawer",},
- {"isopen", 2, IsOpenOp, 3, 3, "drawer",},
- {"lower", 1, LowerOp, 3, 3, "drawer",},
- {"move", 1, MoveOp, 3, 0, "drawer before|after drawer",},
- {"names", 1, NamesOp, 2, 0, "?pattern...?",},
- {"open", 1, OpenOp, 3, 3, "drawer",},
- {"raise", 1, RaiseOp, 3, 3, "drawer",},
- {"size", 2, SizeOp, 2, 4, "?drawer? ?size?",},
- {"tag", 2, TagOp, 2, 0, "oper args",},
- {"toggle", 2, ToggleOp, 3, 3, "drawer",},
-};
-
-static int nDrawerOps = sizeof(drawerOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawerInstCmdProc --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to the paneset geometry manager. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DrawerInstCmdProc(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- PanesetCmdProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nDrawerOps, drawerOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc)(clientData, interp, objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleActivateOp --
- *
- * Changes the cursor and schedules to redraw the handle in
- * its activate state (different relief, colors, etc).
- *
- * .s activate
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleActivateOp(Pane *panePtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- if (panePtr != setPtr->activePtr) {
- Tk_Cursor cursor;
- int vert;
-
- if (setPtr->activePtr != NULL) {
- EventuallyRedrawHandle(setPtr->activePtr);
- }
- if (panePtr != NULL) {
- EventuallyRedrawHandle(panePtr);
- }
- setPtr->activePtr = panePtr;
- if (setPtr->type == DRAWER) {
- vert = panePtr->side & SIDE_VERTICAL;
- } else {
- vert = ISVERT(setPtr);
- }
- if (panePtr->cursor != None) {
- cursor = panePtr->cursor;
- } else if (vert) {
- cursor = setPtr->defVertCursor;
- } else {
- cursor = setPtr->defHorzCursor;
- }
- Tk_DefineCursor(panePtr->handle, cursor);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleAnchorOp --
- *
- * Set the anchor for the resize/moving the pane/drawer. Only one of the
- * x and y coordinates are used depending upon the orientation of the
- * drawer or pane.
- *
- * drawer anchor x y
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleAnchorOp(Pane *panePtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr;
- int x, y;
- int vert;
-
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- setPtr = panePtr->setPtr;
- setPtr->anchorPtr = setPtr->activePtr = panePtr;
- setPtr->flags |= HANDLE_ACTIVE;
- if (setPtr->type == DRAWER) {
- vert = panePtr->side & SIDE_VERTICAL;
- } else {
- vert = ISVERT(setPtr);
- }
- if (vert) {
- setPtr->bearing = ScreenY(panePtr);
- setPtr->handleAnchor = y;
- } else {
- setPtr->bearing = ScreenX(panePtr);
- setPtr->handleAnchor = x;
- }
- setPtr->bearing += panePtr->size;
- AdjustHandle(setPtr, 0);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleCgetOp --
- *
- * Returns the value of the named option in the handle.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * .p cget option
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleCgetOp(Pane *panePtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- return Blt_ConfigureValueFromObj(interp, setPtr->tkwin, paneSpecs,
- (char *)panePtr, objv[2], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleCloseOp --
- *
- * Used only for drawers. Closes the specified drawer.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * drawer open
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleCloseOp(Pane *panePtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if ((panePtr->tkwin == NULL) || (panePtr->flags & (DISABLED|CLOSED))) {
- return TCL_OK;
- }
- EventuallyCloseDrawer(panePtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleConfigureOp --
- *
- * Returns the name, position and options of a widget in the paneset.
- *
- * Results:
- * Returns a standard TCL result. A list of the paneset configuration
- * option information is left in interp->result.
- *
- * drawer configure option value
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleConfigureOp(Pane *panePtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, panePtr->handle, paneSpecs,
- (char *)panePtr, (Tcl_Obj *)NULL, setPtr->type);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, panePtr->handle, paneSpecs,
- (char *)panePtr, objv[2], setPtr->type);
- }
- if (Blt_ConfigureWidgetFromObj(interp, panePtr->handle, paneSpecs, objc-2,
- objv+2, (char *)panePtr, BLT_CONFIG_OBJV_ONLY|setPtr->type) != TCL_OK) {
- return TCL_ERROR;
- }
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleDeactivateOp --
- *
- * Changes the cursor and schedules to redraw the handle in its
- * inactivate state (different relief, colors, etc).
- *
- * drawer deactivate
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleDeactivateOp(Pane *panePtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- if (panePtr == setPtr->activePtr) {
- EventuallyRedrawHandle(panePtr);
- setPtr->activePtr = NULL;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleIsOpenOp --
- *
- * Indicates if the drawer is open or closed.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * drawer isopen
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleIsOpenOp(Pane *panePtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int state;
-
- state = (panePtr->flags & CLOSED) ? FALSE : TRUE;
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), state);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleLowerOp --
- *
- * Lowers the specified pane to bottom of the stack of panes.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * .p lower
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleLowerOp(Pane *panePtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- LowerDrawer(panePtr);
- EventuallyRedraw(panePtr->setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleMarkOp --
- *
- * Sets the current mark for moving the handle. The change between the
- * mark and the anchor is the amount to move the handle from its previous
- * location.
- *
- * drawer mark x y
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleMarkOp(Pane *panePtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Paneset *setPtr;
- int x, y; /* Root coordinates of the pointer
- * over the handle. */
- int delta, mark, vert;
-
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- setPtr = panePtr->setPtr;
- setPtr->anchorPtr = panePtr;
- if (setPtr->type == DRAWER) {
- vert = panePtr->side & SIDE_VERTICAL;
- } else {
- vert = ISVERT(setPtr);
- }
- mark = (vert) ? y : x;
- delta = mark - setPtr->handleAnchor;
- AdjustHandle(setPtr, delta);
- setPtr->handleAnchor = mark;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleMoveOp --
- *
- * Moves the handle. The handle is moved the given distance from its
- * previous location.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleMoveOp(Pane *panePtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Paneset *setPtr;
- int delta, x, y;
- int vert;
-
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- setPtr = panePtr->setPtr;
- setPtr->anchorPtr = panePtr;
- if (setPtr->type == DRAWER) {
- vert = panePtr->side & SIDE_VERTICAL;
- } else {
- vert = ISVERT(setPtr);
- }
- if (vert) {
- delta = y;
- setPtr->bearing = ScreenY(panePtr);
- } else {
- delta = x;
- setPtr->bearing = ScreenX(panePtr);
- }
- setPtr->bearing += panePtr->size;
- AdjustHandle(setPtr, delta);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleOpenOp --
- *
- * Used only for drawers. Opens the specified drawer. The drawer is
- * opened to the widget's requested size.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * drawer open
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleOpenOp(Pane *panePtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if ((panePtr->flags & (DISABLED|CLOSED)) != CLOSED) {
- return TCL_OK; /* Already open or disabled. */
- }
- EventuallyOpenDrawer(panePtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleSetOp --
- *
- * Sets the location of the handle to coordinate (x or y) specified. The
- * windows are move and/or arranged according to the mode.
- *
- * drawer set $x $y
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleSetOp(Pane *panePtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Paneset *setPtr;
- int x, y;
- int delta, mark, vert;
-
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- setPtr = panePtr->setPtr;
- setPtr->flags &= ~HANDLE_ACTIVE;
- if (setPtr->type == DRAWER) {
- vert = panePtr->side & SIDE_VERTICAL;
- } else {
- vert = ISVERT(setPtr);
- }
- mark = (vert) ? y : x;
- delta = mark - setPtr->handleAnchor;
- AdjustHandle(setPtr, delta);
- setPtr->handleAnchor = mark;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleSizeOp --
- *
- * Only used for drawers, set and/or gets the size of the opening for the
- * drawer. This does not affect the size of the window.
- *
- * drawer size $size
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleSizeOp(Pane *panePtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int size;
-
- if (objc == 2) {
- size = panePtr->size;
- } else {
- int newSize;
- Paneset *setPtr;
-
- setPtr = panePtr->setPtr;
- if (Blt_GetPixelsFromObj(interp, setPtr->tkwin, objv[2], PIXELS_NNEG,
- &newSize) != TCL_OK) {
- return TCL_ERROR;
- }
- panePtr->size = newSize;
- if (panePtr->side & SIDE_VERTICAL) {
- panePtr->y = newSize;
- } else {
- panePtr->x = newSize;
- }
- EventuallyRedraw(setPtr);
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), size);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleRaiseOp --
- *
- * Raises the specified pane to the top of the stack of panes.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * drawer raise
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HandleRaiseOp(Pane *panePtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- RaiseDrawer(panePtr);
- EventuallyRedraw(panePtr->setPtr);
- return TCL_OK;
-}
-
-static Blt_OpSpec drawerHandleOps[] =
-{
- {"activate", 2, HandleActivateOp, 2, 2, ""},
- {"anchor", 2, HandleAnchorOp, 4, 4, "x y"},
- {"cget", 2, HandleCgetOp, 3, 3, "option",},
- {"close", 2, HandleCloseOp, 3, 3, "",},
- {"configure", 2, HandleConfigureOp, 2, 0, "?option value?",},
- {"deactivate", 1, HandleDeactivateOp, 2, 2, ""},
- {"isopen", 1, HandleIsOpenOp, 2, 2, "",},
- {"lower", 1, HandleLowerOp, 2, 2, "",},
- {"mark", 1, HandleMarkOp, 4, 4, "x y"},
- {"move", 1, HandleMoveOp, 4, 4, "x y"},
- {"open", 1, HandleOpenOp, 2, 2, "",},
- {"raise", 1, HandleRaiseOp, 2, 2, "",},
- {"set", 2, HandleSetOp, 4, 4, "x y"},
- {"size", 2, HandleSizeOp, 2, 3, "?size?"},
-};
-
-static int nDrawerHandleOps = sizeof(drawerHandleOps) / sizeof(Blt_OpSpec);
-
-static Blt_OpSpec paneHandleOps[] =
-{
- {"activate", 2, HandleActivateOp, 2, 2, ""},
- {"anchor", 2, HandleAnchorOp, 4, 4, "x y"},
- {"cget", 2, HandleCgetOp, 3, 3, "option",},
- {"configure", 2, HandleConfigureOp, 2, 0, "?option value?",},
- {"deactivate", 1, HandleDeactivateOp, 2, 2, ""},
- {"mark", 1, HandleMarkOp, 4, 4, "x y"},
- {"move", 1, HandleMoveOp, 4, 4, "x y"},
- {"set", 1, HandleSetOp, 4, 4, "x y"},
-};
-
-static int nPaneHandleOps = sizeof(paneHandleOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleInstCmdProc --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to the paneset geometry manager. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static int
-HandleInstCmdProc(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_OpSpec *specs;
- HandleCmdProc *proc;
- Pane *panePtr = clientData;
- Paneset *setPtr;
- int nSpecs;
-
- setPtr = panePtr->setPtr;
-
- if (setPtr->type == DRAWER) {
- specs = drawerHandleOps;
- nSpecs = nDrawerHandleOps;
- } else {
- specs = paneHandleOps;
- nSpecs = nPaneHandleOps;
- }
- proc = Blt_GetOpFromObj(interp, nSpecs, specs, BLT_OP_ARG1, objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- if (panePtr->flags & (DISABLED|HIDE)) {
- return TCL_OK;
- }
- return (*proc)(panePtr, interp, objc, objv);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleInstCmdDeleteProc --
- *
- * This procedure is invoked when a widget command is deleted. If the
- * widget isn't already in the process of being destroyed, this command
- * destroys it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-HandleInstCmdDeleteProc(ClientData clientData)
-{
- Pane *panePtr = clientData;
-
- /*
- * This procedure could be invoked either because the window was destroyed
- * and the command was then deleted (in which case tkwin is NULL) or
- * because the command was deleted, and then this procedure destroys the
- * widget.
- */
- if (panePtr->handle != NULL) {
- Tk_Window tkwin;
-
- tkwin = panePtr->handle;
- panePtr->handle = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PanesetCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-PanesetCmd(
- ClientData clientData, /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* # of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- Paneset *setPtr;
- Tcl_CmdInfo cmdInfo;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * Invoke a procedure to initialize various bindings on treeview entries.
- * If the procedure doesn't already exist, source it from
- * "$blt_library/paneset.tcl". We deferred sourcing the file until now so
- * that the variable $blt_library could be set within a script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::paneset::Initialize", &cmdInfo)) {
- char cmd[200];
- sprintf_s(cmd, 200, "source [file join $blt_library paneset.tcl]\n");
- if (Tcl_GlobalEval(interp, cmd) != TCL_OK) {
- char info[200];
-
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- return TCL_ERROR;
- }
- }
- setPtr = NewPaneset(interp, objv[1], PANESET);
- if (setPtr == NULL) {
- goto error;
- }
- if (Blt_ConfigureWidgetFromObj(interp, setPtr->tkwin, panesetSpecs,
- objc - 2, objv + 2, (char *)setPtr, setPtr->type) != TCL_OK) {
- goto error;
- }
- ConfigurePaneset(setPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(setPtr->tkwin),-1);
- return TCL_OK;
- error:
- if (setPtr != NULL) {
- Tk_DestroyWindow(setPtr->tkwin);
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FilmstripCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-FilmstripCmd(
- ClientData clientData, /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* # of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- Paneset *setPtr;
- Tcl_CmdInfo cmdInfo;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
-
- /*
- * Invoke a procedure to initialize various bindings on treeview entries.
- * If the procedure doesn't already exist, source it from
- * "$blt_library/paneset.tcl". We deferred sourcing the file until now so
- * that the variable $blt_library could be set within a script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::Filmstrip::Initialize", &cmdInfo)) {
- char cmd[200];
- sprintf_s(cmd, 200, "source [file join $blt_library filmstrip.tcl]\n");
- if (Tcl_GlobalEval(interp, cmd) != TCL_OK) {
- char info[200];
-
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- goto error;
- }
- }
-
- setPtr = NewPaneset(interp, objv[1], FILMSTRIP);
- if (setPtr == NULL) {
- goto error;
- }
-
- if (Blt_ConfigureWidgetFromObj(interp, setPtr->tkwin, panesetSpecs,
- objc - 2, objv + 2, (char *)setPtr, setPtr->type) != TCL_OK) {
- goto error;
- }
- ConfigurePaneset(setPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(setPtr->tkwin),-1);
- return TCL_OK;
- error:
- if (setPtr != NULL) {
- Tk_DestroyWindow(setPtr->tkwin);
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawersetCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-DrawersetCmd(
- ClientData clientData, /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* # of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- Paneset *setPtr;
- Tcl_CmdInfo cmdInfo;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * Invoke a procedure to initialize various bindings on treeview entries.
- * If the procedure doesn't already exist, source it from
- * "$blt_library/paneset.tcl". We deferred sourcing the file until now so
- * that the variable $blt_library could be set within a script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::Drawer::Initialize", &cmdInfo)) {
- char cmd[200];
- sprintf_s(cmd, 200, "source [file join $blt_library drawer.tcl]\n");
- if (Tcl_GlobalEval(interp, cmd) != TCL_OK) {
- char info[200];
-
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- return TCL_ERROR;
- }
- }
- setPtr = NewDrawerset(interp, objv[1]);
- if (setPtr == NULL) {
- goto error;
- }
-
- if (Blt_ConfigureWidgetFromObj(interp, setPtr->tkwin, panesetSpecs,
- objc - 2, objv + 2, (char *)setPtr, setPtr->type) != TCL_OK) {
- goto error;
- }
- ConfigurePaneset(setPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), setPtr->name, -1);
- return TCL_OK;
- error:
- if (setPtr != NULL) {
- Tk_DestroyWindow(setPtr->tkwin);
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PanesetCmdInitProc --
- *
- * This procedure is invoked to initialize the TCL command that
- * corresponds to the paneset geometry manager.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates the new TCL command.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_PanesetCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpecs[] = {
- { "drawerset", DrawersetCmd },
- { "filmstrip", FilmstripCmd },
- { "paneset", PanesetCmd }
- };
- return Blt_InitCmds(interp, "::blt", cmdSpecs, 3);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayPaneset --
- *
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widgets in the paneset are possibly resized and redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayPaneset(ClientData clientData)
-{
- Paneset *setPtr = clientData;
-
- setPtr->flags &= ~REDRAW_PENDING;
-#if TRACE
- fprintf(stderr, "DisplayPaneset(%s)\n", Tk_PathName(setPtr->tkwin));
-#endif
- if (setPtr->flags & LAYOUT_PENDING) {
- ComputeGeometry(setPtr);
- }
- if (setPtr->reqWidth > 0) {
- setPtr->normalWidth = setPtr->reqWidth;
- }
- if (setPtr->reqHeight > 0) {
- setPtr->normalHeight = setPtr->reqHeight;
- }
- if (setPtr->type & (FILMSTRIP|PANESET)) {
- if ((setPtr->normalWidth != Tk_ReqWidth(setPtr->tkwin)) ||
- (setPtr->normalHeight != Tk_ReqHeight(setPtr->tkwin))) {
- Tk_GeometryRequest(setPtr->tkwin, setPtr->normalWidth,
- setPtr->normalHeight);
- EventuallyRedraw(setPtr);
- return;
- }
- }
- if ((Tk_Width(setPtr->tkwin) <= 1) || (Tk_Height(setPtr->tkwin) <=1)) {
- /* Don't bother computing the layout until the size of the window is
- * something reasonable. */
- return;
- }
- if (!Tk_IsMapped(setPtr->tkwin)) {
- /* The paneset's window isn't displayed, so don't bother drawing
- * anything. By getting this far, we've at least computed the
- * coordinates of the new layout. */
- return;
- }
-
- if ((setPtr->type == FILMSTRIP) && (setPtr->flags & SCROLL_PENDING)) {
- int width;
-
- width = VPORTWIDTH(setPtr);
- setPtr->scrollOffset = Blt_AdjustViewport(setPtr->scrollOffset,
- setPtr->worldWidth, width, setPtr->scrollUnits,
- BLT_SCROLL_MODE_HIERBOX);
- if (setPtr->scrollCmdObjPtr != NULL) {
- Blt_UpdateScrollbar(setPtr->interp, setPtr->scrollCmdObjPtr,
- setPtr->scrollOffset, setPtr->scrollOffset + width,
- setPtr->worldWidth);
- }
- setPtr->flags &= ~SCROLL_PENDING;
- }
- setPtr->nVisible = Blt_Chain_GetLength(setPtr->chain);
- if (setPtr->type & (FILMSTRIP|PANESET)) {
-#ifndef notdef
- Blt_FillBackgroundRectangle(setPtr->tkwin, Tk_WindowId(setPtr->tkwin),
- setPtr->bg, 0, 0, Tk_Width(setPtr->tkwin),
- Tk_Height(setPtr->tkwin), 0, TK_RELIEF_FLAT);
-#endif
- if (setPtr->nVisible > 0) {
- if (ISVERT(setPtr)) {
- VerticalPanes(setPtr);
- } else {
- HorizontalPanes(setPtr);
- }
- }
- } else {
- if (setPtr->nVisible > 0) {
- ArrangeDrawers(setPtr);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayHandle
- *
- * Draws the pane's handle at its proper location. First determines the
- * size and position of the each window. It then considers the
- * following:
- *
- * 1. translation of widget position its parent widget.
- * 2. fill style
- * 3. anchor
- * 4. external and internal padding
- * 5. widget size must be greater than zero
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of each pane is re-initialized its minimum size.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayHandle(ClientData clientData)
-{
- Pane *panePtr = clientData;
- Blt_Background bg;
- int relief;
- Paneset *setPtr;
- Drawable drawable;
-
- panePtr->flags &= ~REDRAW_PENDING;
- if (panePtr->handle == NULL) {
- return;
- }
- setPtr = panePtr->setPtr;
- if (setPtr->activePtr == panePtr) {
- bg = GETATTR(panePtr, activeHandleBg);
- relief = setPtr->activeRelief;
- } else {
- bg = GETATTR(panePtr, handleBg);
- relief = setPtr->relief;
- }
- drawable = Tk_WindowId(panePtr->handle);
- Blt_FillBackgroundRectangle(panePtr->handle, drawable, bg,
- 0, 0, Tk_Width(panePtr->handle), Tk_Height(panePtr->handle),
- 0, TK_RELIEF_FLAT);
- Blt_DrawBackgroundRectangle(panePtr->handle, drawable, bg,
- setPtr->handlePad.side1, setPtr->handlePad.side1,
- Tk_Width(panePtr->handle) - PADDING(setPtr->handlePad),
- Tk_Height(panePtr->handle) - PADDING(setPtr->handlePad),
- setPtr->handleBW, relief);
-
- if ((setPtr->highlightThickness > 0) && (panePtr->flags & FOCUS)) {
- GC gc;
-
- gc = Tk_GCForColor(panePtr->highlightColor, drawable);
- Tk_DrawFocusHighlight(panePtr->handle, gc, setPtr->highlightThickness,
- drawable);
- }
-}
diff --git a/blt3.0.1/src/bltParse.c b/blt3.0.1/src/bltParse.c
deleted file mode 100644
index 10703f3..0000000
--- a/blt3.0.1/src/bltParse.c
+++ /dev/null
@@ -1,546 +0,0 @@
-
-/*
- * bltParse.c --
- *
- * Contains a collection of procedures that are used to parse Tcl
- * commands or parts of commands (like quoted strings or nested
- * sub-commands).
- *
- * This file is copied from tclParse.c in the TCL library distribution.
- *
- * Copyright (c) 1987-1993 The Regents of the University of
- * California.
- *
- * Copyright (c) 1994-1998 Sun Microsystems, Inc.
- *
- */
-
-/*
- * Since TCL 8.1.0 these routines have been replaced by ones that
- * generate byte-codes. But since these routines are used in vector
- * expressions, where no such byte-compilation is necessary, I now
- * include them. In fact, the byte-compiled versions would be slower
- * since the compiled code typically runs only one time.
- */
-#include <bltInt.h>
-
-#include "bltParse.h"
-
-/*
- * A table used to classify input characters to assist in parsing
- * TCL commands. The table should be indexed with a signed character
- * using the CHAR_TYPE macro. The character may have a negative
- * value. The CHAR_TYPE macro takes a pointer to a signed character
- * and a pointer to the last character in the source string. If the
- * src pointer is pointing at the terminating null of the string,
- * CHAR_TYPE returns TCL_COMMAND_END.
- */
-
-#define STATIC_STRING_SPACE 150
-#define UCHAR(c) ((unsigned char) (c))
-#define TCL_NORMAL 0x01
-#define TCL_SPACE 0x02
-#define TCL_COMMAND_END 0x04
-#define TCL_QUOTE 0x08
-#define TCL_OPEN_BRACKET 0x10
-#define TCL_OPEN_BRACE 0x20
-#define TCL_CLOSE_BRACE 0x40
-#define TCL_BACKSLASH 0x80
-#define TCL_DOLLAR 0x00
-
-/*
- * The following table assigns a type to each character. Only types
- * meaningful to TCL parsing are represented here. The table is
- * designed to be referenced with either signed or unsigned characters,
- * so it has 384 entries. The first 128 entries correspond to negative
- * character values, the next 256 correspond to positive character
- * values. The last 128 entries are identical to the first 128. The
- * table is always indexed with a 128-byte offset (the 128th entry
- * corresponds to a 0 character value).
- */
-
-static unsigned char tclTypeTable[] =
-{
- /*
- * Negative character values, from -128 to -1:
- */
-
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
-
- /*
- * Positive character values, from 0-127:
- */
-
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_SPACE, TCL_COMMAND_END, TCL_SPACE,
- TCL_SPACE, TCL_SPACE, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_SPACE, TCL_NORMAL, TCL_QUOTE, TCL_NORMAL,
- TCL_DOLLAR, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_COMMAND_END,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_OPEN_BRACKET,
- TCL_BACKSLASH, TCL_COMMAND_END, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_OPEN_BRACE,
- TCL_NORMAL, TCL_CLOSE_BRACE, TCL_NORMAL, TCL_NORMAL,
-
- /*
- * Large unsigned character values, from 128-255:
- */
-
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
- TCL_NORMAL, TCL_NORMAL, TCL_NORMAL, TCL_NORMAL,
-};
-
-#define CHAR_TYPE(src,last) \
- (((src)==(last))?TCL_COMMAND_END:(tclTypeTable+128)[(int)*(src)])
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ParseNestedCmd --
- *
- * This procedure parses a nested TCL command between
- * brackets, returning the result of the command.
- *
- * Results:
- * The return value is a standard TCL result, which is
- * TCL_OK unless there was an error while executing the
- * nested command. If an error occurs then interp->result
- * contains a standard error message. *TermPtr is filled
- * in with the address of the character just after the
- * last one processed; this is usually the character just
- * after the matching close-bracket, or the null character
- * at the end of the string if the close-bracket was missing
- * (a missing close bracket is an error). The result returned
- * by the command is stored in standard fashion in *parsePtr,
- * null-terminated, with parsePtr->next pointing to the null
- * character.
- *
- * Side effects:
- * The storage space at *parsePtr may be expanded.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_ParseNestedCmd(
- Tcl_Interp *interp, /* Interpreter to use for nested command
- * evaluations and error messages. */
- const char *string, /* Character just after opening bracket. */
- int flags, /* Flags to pass to nested Tcl_Eval. */
- const char **termPtr, /* Store address of terminating character
- * here. */
- ParseValue *parsePtr) /* Information about where to place
- * result of command. */
-{
- int result, length, shortfall;
- Interp *iPtr = (Interp *)interp;
-
- iPtr->evalFlags = flags | TCL_BRACKET_TERM;
- result = Tcl_Eval(interp, string);
- *termPtr = (string + iPtr->termOffset);
- if (result != TCL_OK) {
- /*
- * The increment below results in slightly cleaner message in
- * the errorInfo variable (the close-bracket will appear).
- */
-
- if (**termPtr == ']') {
- *termPtr += 1;
- }
- return result;
- }
- (*termPtr) += 1;
- length = (int)strlen(iPtr->result);
- shortfall = length + 1 - (parsePtr->end - parsePtr->next);
- if (shortfall > 0) {
- (*parsePtr->expandProc) (parsePtr, shortfall);
- }
- strcpy(parsePtr->next, iPtr->result);
- parsePtr->next += length;
-
- Tcl_FreeResult(interp);
- iPtr->result = iPtr->resultSpace;
- iPtr->resultSpace[0] = '\0';
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ParseBraces --
- *
- * This procedure scans the information between matching
- * curly braces.
- *
- * Results:
- * The return value is a standard TCL result, which is
- * TCL_OK unless there was an error while parsing string.
- * If an error occurs then interp->result contains a
- * standard error message. *TermPtr is filled
- * in with the address of the character just after the
- * last one successfully processed; this is usually the
- * character just after the matching close-brace. The
- * information between curly braces is stored in standard
- * fashion in *parsePtr, null-terminated with parsePtr->next
- * pointing to the terminating null character.
- *
- * Side effects:
- * The storage space at *parsePtr may be expanded.
- *
- *---------------------------------------------------------------------------
- */
-
-int
-Blt_ParseBraces(
- Tcl_Interp *interp, /* Interpreter to use for nested command
- * evaluations and error messages. */
- const char *string, /* Character just after opening bracket. */
- const char **termPtr, /* Store address of terminating character
- * here. */
- ParseValue *parsePtr) /* Information about where to place
- * result of command. */
-{
- int level;
- const char *src;
- char *dest, *end;
- char c;
- const char *lastChar = string + strlen(string);
-
- src = string;
- dest = parsePtr->next;
- end = parsePtr->end;
- level = 1;
-
- /*
- * Copy the characters one at a time to the result area, stopping
- * when the matching close-brace is found.
- */
-
- for (;;) {
- c = *src;
- src++;
-
- if (dest == end) {
- parsePtr->next = dest;
- (*parsePtr->expandProc) (parsePtr, 20);
- dest = parsePtr->next;
- end = parsePtr->end;
- }
- *dest = c;
- dest++;
-
- if (CHAR_TYPE(src - 1, lastChar) == TCL_NORMAL) {
- continue;
- } else if (c == '{') {
- level++;
- } else if (c == '}') {
- level--;
- if (level == 0) {
- dest--; /* Don't copy the last close brace. */
- break;
- }
- } else if (c == '\\') {
- int count;
-
- /*
- * Must always squish out backslash-newlines, even when in
- * braces. This is needed so that this sequence can appear
- * anywhere in a command, such as the middle of an expression.
- */
-
- if (*src == '\n') {
- dest[-1] = Tcl_Backslash(src - 1, &count);
- src += count - 1;
- } else {
- Tcl_Backslash(src - 1, &count);
- while (count > 1) {
- if (dest == end) {
- parsePtr->next = dest;
- (*parsePtr->expandProc) (parsePtr, 20);
- dest = parsePtr->next;
- end = parsePtr->end;
- }
- *dest = *src;
- dest++;
- src++;
- count--;
- }
- }
- } else if (c == '\0') {
- Tcl_AppendResult(interp, "missing close-brace", (char *)NULL);
- *termPtr = string - 1;
- return TCL_ERROR;
- }
- }
-
- *dest = '\0';
- parsePtr->next = dest;
- *termPtr = src;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ExpandParseValue --
- *
- * This procedure is commonly used as the value of the
- * expandProc in a ParseValue. It uses malloc to allocate
- * more space for the result of a parse.
- *
- * Results:
- * The buffer space in *parsePtr is reallocated to something
- * larger, and if parsePtr->clientData is non-zero the old
- * buffer is freed. Information is copied from the old
- * buffer to the new one.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ExpandParseValue(
- ParseValue *parsePtr, /* Information about buffer that
- * must be expanded. If the clientData
- * in the structure is non-zero, it
- * means that the current buffer is
- * dynamically allocated. */
- int needed) /* Minimum amount of additional space
- * to allocate. */
-{
- int size;
- char *buffer;
-
- /*
- * Either double the size of the buffer or add enough new space
- * to meet the demand, whichever produces a larger new buffer.
- */
- size = (parsePtr->end - parsePtr->buffer) + 1;
- if (size < needed) {
- size += needed;
- } else {
- size += size;
- }
- buffer = Blt_AssertMalloc((unsigned int)size);
-
- /*
- * Copy from old buffer to new, free old buffer if needed, and
- * mark new buffer as malloc-ed.
- */
- memcpy((VOID *) buffer, (VOID *) parsePtr->buffer,
- (size_t) (parsePtr->next - parsePtr->buffer));
- parsePtr->next = buffer + (parsePtr->next - parsePtr->buffer);
- if (parsePtr->clientData != 0) {
- Blt_Free(parsePtr->buffer);
- }
- parsePtr->buffer = buffer;
- parsePtr->end = buffer + size - 1;
- parsePtr->clientData = (ClientData)1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ParseQuotes --
- *
- * This procedure parses a double-quoted string such as a
- * quoted TCL command argument or a quoted value in a Tcl
- * expression. This procedure is also used to parse array
- * element names within parentheses, or anything else that
- * needs all the substitutions that happen in quotes.
- *
- * Results:
- * The return value is a standard TCL result, which is
- * TCL_OK unless there was an error while parsing the
- * quoted string. If an error occurs then interp->result
- * contains a standard error message. *TermPtr is filled
- * in with the address of the character just after the
- * last one successfully processed; this is usually the
- * character just after the matching close-quote. The
- * fully-substituted contents of the quotes are stored in
- * standard fashion in *parsePtr, null-terminated with
- * parsePtr->next pointing to the terminating null character.
- *
- * Side effects:
- * The buffer space in parsePtr may be enlarged by calling its
- * expandProc.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_ParseQuotes(
- Tcl_Interp *interp, /* Interpreter to use for nested command
- * evaluations and error messages. */
- const char *string, /* Character just after opening double-
- * quote. */
- int termChar, /* Character that terminates "quoted" string
- * (usually double-quote, but sometimes
- * right-paren or something else). */
- int flags, /* Flags to pass to nested Tcl_Eval calls. */
- const char **termPtr, /* Store address of terminating character
- * here. */
- ParseValue *parsePtr) /* Information about where to place
- * fully-substituted result of parse. */
-{
- const char *src;
- char *dest, c;
- const char *lastChar = string + strlen(string);
-
- src = string;
- dest = parsePtr->next;
-
- for (;;) {
- if (dest == parsePtr->end) {
- /*
- * Target buffer space is about to run out. Make more space.
- */
- parsePtr->next = dest;
- (*parsePtr->expandProc) (parsePtr, 1);
- dest = parsePtr->next;
- }
- c = *src;
- src++;
- if (c == termChar) {
- *dest = '\0';
- parsePtr->next = dest;
- *termPtr = src;
- return TCL_OK;
- } else if (CHAR_TYPE(src - 1, lastChar) == TCL_NORMAL) {
- copy:
- *dest = c;
- dest++;
- continue;
- } else if (c == '$') {
- int length;
- const char *value;
-
- value = Tcl_ParseVar(interp, src - 1, termPtr);
- if (value == NULL) {
- return TCL_ERROR;
- }
- src = *termPtr;
- length = strlen(value);
- if ((parsePtr->end - dest) <= length) {
- parsePtr->next = dest;
- (*parsePtr->expandProc) (parsePtr, length);
- dest = parsePtr->next;
- }
- strcpy(dest, value);
- dest += length;
- continue;
- } else if (c == '[') {
- int result;
-
- parsePtr->next = dest;
- result = Blt_ParseNestedCmd(interp, src, flags, termPtr, parsePtr);
- if (result != TCL_OK) {
- return result;
- }
- src = *termPtr;
- dest = parsePtr->next;
- continue;
- } else if (c == '\\') {
- int nRead;
-
- src--;
- *dest = Tcl_Backslash(src, &nRead);
- dest++;
- src += nRead;
- continue;
- } else if (c == '\0') {
- char buf[10];
-
- Tcl_ResetResult(interp);
- sprintf_s(buf, 10, "missing %c", termChar);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), buf, 9);
- *termPtr = string - 1;
- return TCL_ERROR;
- } else {
- goto copy;
- }
- }
-}
-
diff --git a/blt3.0.1/src/bltParse.h b/blt3.0.1/src/bltParse.h
deleted file mode 100644
index 3ff26cb..0000000
--- a/blt3.0.1/src/bltParse.h
+++ /dev/null
@@ -1,43 +0,0 @@
-
-/*
- * bltParse.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_PARSE_H
-#define _BLT_PARSE_H
-
-#include "tclInterp.h"
-
-BLT_EXTERN int Blt_ParseBraces(Tcl_Interp *interp, const char *string,
- const char **termPtr, ParseValue *pvPtr);
-
-BLT_EXTERN int Blt_ParseNestedCmd(Tcl_Interp *interp, const char *string,
- int flags, const char **termPtr, ParseValue *pvPtr);
-
-BLT_EXTERN int Blt_ParseQuotes(Tcl_Interp *interp, const char *string,
- int termChar, int flags, const char **termPtr, ParseValue * pvPtr);
-
-BLT_EXTERN void Blt_ExpandParseValue(ParseValue *pvPtr, int needed);
-
-#endif
diff --git a/blt3.0.1/src/bltPictBmp.c b/blt3.0.1/src/bltPictBmp.c
deleted file mode 100644
index 7f1e471..0000000
--- a/blt3.0.1/src/bltPictBmp.c
+++ /dev/null
@@ -1,1643 +0,0 @@
-
-/*
- * bltPictBmp.c --
- *
- * This module implements BMP file format conversion routines for the picture
- * image type in the BLT toolkit.
- *
- * Copyright 2003-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include "blt.h"
-
-#include "config.h"
-#include <tcl.h>
-#include <bltAlloc.h>
-#include <bltSwitch.h>
-#include <bltDBuffer.h>
-#include <bltHash.h>
-#include "bltPicture.h"
-#include "bltPictFmts.h"
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif /* HAVE_STRING_H */
-
-#ifdef _MSC_VER
-#define vsnprintf _vsnprintf
-#endif
-
-#include <setjmp.h>
-
-typedef struct _Blt_Picture Picture;
-
-#define TRUE 1
-#define FALSE 0
-
-
-#define OFF_TYPE 0
-#define OFF_FILE_SIZE 2
-#define OFF_RESERVED1 6
-#define OFF_RESERVED2 8
-#define OFF_OFFBITS 10
-
-#define OFF_SIZE 14
-#define OFF_WIDTH 18
-#define OFF_HEIGHT 22
-#define OFF_PLANES 26
-#define OFF_BIT_COUNT 28
-#define OFF_COMPRESSION 30
-#define OFF_SIZE_IMAGE 34
-#define OFF_X_PELS_PER_METER 38
-#define OFF_Y_PELS_PER_METER 42
-#define OFF_CLR_USED 46
-#define OFF_CLR_IMPORTANT 50
-#define OFF_RED_MASK 54
-#define OFF_GREEN_MASK 58
-#define OFF_BLUE_MASK 62
-#define OFF_ALPHA_MASK 66
-#define OFF_CS_TYPE 70
-#define OFF_END_POINTS 74
-#define OFF_GAMMA_RED 110
-#define OFF_GAMMA_GREEN 114
-#define OFF_GAMMA_BLUE 118
-#define OFF_INTENT 122
-#define OFF_PROFILE_DATA 126
-#define OFF_PROFILE_SIZE 130
-#define OFF_RESERVED3 134
-
-#define OFF_OSV1_SIZE 14
-#define OFF_OSV1_WIDTH 18
-#define OFF_OSV1_HEIGHT 20
-#define OFF_OSV1_PLANES 22
-#define OFF_OSV1_BIT_COUNT 24
-
-#define SIZEOF_BITMAPOS2V1HEADER 12
-#define SIZEOF_BITMAPOS2V2HEADER 64
-#define SIZEOF_BITMAPV3HEADER 40
-#define SIZEOF_BITMAPV4HEADER 108
-#define SIZEOF_BITMAPV5HEADER 124
-
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
-} BmpImportSwitches;
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- int flags; /* Flag. */
- Blt_Pixel bg;
- int index;
-} BmpExportSwitches;
-
-#define EXPORT_ALPHA (1<<0)
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(BmpImportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(BmpImportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_END}
-};
-
-BLT_EXTERN Blt_SwitchParseProc Blt_ColorSwitchProc;
-static Blt_SwitchCustom colorSwitch = {
- Blt_ColorSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(BmpExportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(BmpExportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_CUSTOM, "-bg", "color",
- Blt_Offset(BmpExportSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_BITMASK, "-alpha", "",
- Blt_Offset(BmpExportSwitches, flags), 0, EXPORT_ALPHA},
- {BLT_SWITCH_INT_NNEG, "-index", "int",
- Blt_Offset(BmpExportSwitches, index), 0},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- jmp_buf jmpbuf;
- Tcl_DString errors;
- Tcl_DString warnings;
- int nWarnings, nErrors;
-} BmpMessage;
-
-static BmpMessage *bmpMessagePtr;
-
-static const char *compression_types[] = {
- "RGB", "RLE8", "RLE4", "BITFIELDS", "JPEG", "PNG"
-};
-
-enum CompressionTypes {
- BI_RGB, /* No compression. */
- BI_RLE8, /* RLE 8-bits/pixel. Only used with
- * 8-bit/pixel bitmaps */
- BI_RLE4, /* RLE 4-bits/pixel. Can be used only with
- * 4-bit/pixel bitmaps */
- BI_BITFIELDS, /* Bit fields. Can be used only with 16 and
- * 32-bit/pixel bitmaps. */
- BI_JPEG, /* The bitmap contains a JPEG image. */
- BI_PNG, /* The bitmap contains a PNG image. */
-};
-
-typedef struct {
- unsigned short bfType;
- unsigned int bfSize;
- unsigned short bfReserved1;
- unsigned short bfReserved2;
- unsigned int bfOffBits;
-} BitmapFileHeader;
-
-typedef struct {
- int RedX; /* X coordinate of red endpoint */
- int RedY; /* Y coordinate of red endpoint */
- int RedZ; /* Z coordinate of red endpoint */
- int GreenX; /* X coordinate of green endpoint */
- int GreenY; /* Y coordinate of green endpoint */
- int GreenZ; /* Z coordinate of green endpoint */
- int BlueX; /* X coordinate of blue endpoint */
- int BlueY; /* Y coordinate of blue endpoint */
- int BlueZ; /* Z coordinate of blue endpoint */
-} CieXyzTriple;
-
-typedef struct {
- unsigned int biSize; /* Size of this structure. This determines
- * what version of the header is used. */
- int biWidth;
- int biHeight;
- unsigned short biPlanes;
- unsigned short biBitCount;
- unsigned int biCompression;
- unsigned int biSizeImage;
- int biXPelsPerMeter;
- int biYPelsPerMeter;
- unsigned int biClrUsed;
- unsigned int biClrImportant;
-
- /* Fields related to Version 4 of header. */
- unsigned int biRedMask;
- unsigned int biGreenMask;
- unsigned int biBlueMask;
- unsigned int biAlphaMask;
- unsigned int biCSType;
- CieXyzTriple biEndpoints;
- unsigned int biGammaRed;
- unsigned int biGammaGreen;
- unsigned int biGammaBlue;
-
- /* Fields related to Version 5 of header. */
- unsigned int biIntent;
- unsigned int biProfileData;
- unsigned int biProfileSize;
- unsigned int biReserved;
-} BitmapInfoHeader;
-
-#define MAXCOLORS 256
-
-typedef struct {
- BitmapFileHeader bmfh;
- BitmapInfoHeader bmih;
- Blt_Pixel colorTable[MAXCOLORS];
- const char *name;
-} Bmp;
-
-DLLEXPORT extern Tcl_AppInitProc Blt_PictureBmpInit;
-
-/*ARGSUSED*/
-static void
-BmpError TCL_VARARGS_DEF(const char *, arg1)
-{
- const char *fmt;
- char string[BUFSIZ+4];
- int length;
- va_list args;
-
- fmt = TCL_VARARGS_START(const char *, arg1, args);
- length = vsnprintf(string, BUFSIZ, fmt, args);
- if (length > BUFSIZ) {
- strcat(string, "...");
- }
- Tcl_DStringAppend(&bmpMessagePtr->errors, string, -1);
- va_end(args);
- longjmp(bmpMessagePtr->jmpbuf, 0);
-}
-
-/*ARGSUSED*/
-static void
-BmpWarning TCL_VARARGS_DEF(const char *, arg1)
-{
- const char *fmt;
- char string[BUFSIZ+4];
- int length;
- va_list args;
-
- fmt = TCL_VARARGS_START(const char *, arg1, args);
- length = vsnprintf(string, BUFSIZ, fmt, args);
- if (length > BUFSIZ) {
- strcat(string, "...");
- }
- Tcl_DStringAppend(&bmpMessagePtr->warnings, string, -1);
- va_end(args);
- bmpMessagePtr->nWarnings++;
-}
-
-static INLINE unsigned int
-BmpGetLong(unsigned char *buf)
-{
-#ifdef WORDS_BIGENDIAN
- return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
-#else
- return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
-#endif
-}
-
-static INLINE unsigned short
-BmpGetShort(unsigned char *buf)
-{
-#ifdef WORDS_BIGENDIAN
- return (buf[0] << 8) | buf[1];
-#else
- return buf[0] | (buf[1] << 8);
-#endif
-}
-
-static INLINE unsigned char *
-BmpSetLong(unsigned char *buf, unsigned long value)
-{
-#ifdef WORDS_BIGENDIAN
- buf[0] = (value >> 24) & 0xFF;
- buf[1] = (value >> 16) & 0xFF;
- buf[2] = (value >> 8) & 0xFF;
- buf[3] = (value) & 0xFF;
-#else
- buf[0] = (value) & 0xFF;
- buf[1] = (value >> 8) & 0xFF;
- buf[2] = (value >> 16) & 0xFF;
- buf[3] = (value >> 24) & 0xFF;
-#endif
- return buf + 4;
-}
-
-static INLINE unsigned char *
-BmpSetShort(unsigned char *buf, unsigned long value)
-{
-#ifdef WORDS_BIGENDIAN
- buf[0] = (value >> 8) & 0xFF;
- buf[1] = (value) & 0xFF;
-#else
- buf[0] = (value) & 0xFF;
- buf[1] = (value >> 8) & 0xFF;
-#endif
- return buf + 2;
-}
-
-/*
- * Field Name Type
- * | 0| 1| bfType 2 Bytes
- * | 2| 3| 4| 5| bfSize 4 Bytes
- * | 6| 7| bfReserved1 4 Bytes
- * | 8| 9| bfReserved2 4 Bytes
- * |10|11|12|13| bfOffBits 4 Bytes
- *
- */
-static int
-BmpHeader(Blt_DBuffer dbuffer, Bmp *bmpPtr)
-{
- unsigned char *bp;
- size_t fileSize;
-
- Blt_DBuffer_ResetCursor(dbuffer);
- fileSize = Blt_DBuffer_BytesLeft(dbuffer);
- if (fileSize < 14) {
- return FALSE;
- }
- bp = Blt_DBuffer_Pointer(dbuffer);
- if ((bp[0] != 'B') || (bp[1] != 'M')) {
- return FALSE;
- }
- bmpPtr->bmfh.bfSize = BmpGetLong (bp + OFF_FILE_SIZE);
- bmpPtr->bmfh.bfReserved1 = BmpGetShort(bp + OFF_RESERVED1);
- bmpPtr->bmfh.bfReserved2 = BmpGetShort(bp + OFF_RESERVED2);
- bmpPtr->bmfh.bfOffBits = BmpGetLong (bp + OFF_OFFBITS);
- return TRUE;
-}
-
-/*
- * Version 2 Field Name Size
- * | 0| 1| 2| 3| biSize 4 Bytes
- * | 4| 5| biWidth 2 Bytes
- * | 6| 7| biHeight 2 Bytes
- * | 8| 9| biPlanes 2 Bytes
- * |10|11| biBitCount 2 Bytes
-
- * Version 3
- * | 0| 1| 2| 3| biSize 4 Bytes
- * | 4| 5| 6| 7| biWidth 4 Bytes
- * | 8| 9|10|11| biHeight 4 Bytes
- * |12|13| biPlanes 2 Bytes
- * |14|15| biBitCount 2 Bytes
- * |16|17|18|19| biCompression 4 Bytes
- * |20|21|22|23| biSizeImage 4 Bytes
- * |24|25|26|27| biXPelsPerMeter 4 Bytes
- * |28|29|30|31| biYPelsPerMeter 4 Bytes
- * |32|33|34|35| biClrUsed 4 Bytes
- * |36|37|38|39| biClrImportant 4 Bytes
- * Version 4
- * |40|41|42|43| biRedMask 4 Bytes
- * |44|45|46|47| biGreenMask 4 Bytes
- * |48|49|50|51| biBlueMask 4 Bytes
- * |52|53|54|55| biAlphaMask 4 Bytes
- * |56|57|58|59| biCSType 4 Bytes
- * |60--95| biEndpoints 36 Bytes
- * |96|97|98|99| biGammaRed 4 Bytes
- * |00|01|02|03| biGammaGreen 4 Bytes
- * |04|05|06|07| biGammaBlue 4 Bytes
- * Version 5
- * |08|09|10|11| bV5Intent 4 Bytes
- * |12|13|14|15| bV5ProfileData 4 Bytes
- * |16|17|18|19| bV5ProfileSize 4 Bytes
- * |20|21|22|23| bV5Reserved 4 Bytes
- */
-
-static int
-BmpHeaderInfo(Blt_DBuffer dbuffer, Bmp *bmpPtr)
-{
- unsigned char *bp;
-
- bp = Blt_DBuffer_Pointer(dbuffer);
- bmpPtr->bmih.biSize = BmpGetLong(bp + OFF_SIZE);
-
- /* Verify header size. */
- switch (bmpPtr->bmih.biSize) {
- case SIZEOF_BITMAPOS2V1HEADER:
- case SIZEOF_BITMAPOS2V2HEADER:
- case SIZEOF_BITMAPV3HEADER:
- case SIZEOF_BITMAPV4HEADER:
- case SIZEOF_BITMAPV5HEADER:
- break;
- default:
- BmpError("unknown BMP bitmap header (size=%d).", bmpPtr->bmih.biSize);
- }
- if (bmpPtr->bmih.biSize == SIZEOF_BITMAPOS2V1HEADER) {
- bmpPtr->bmih.biWidth = (int)BmpGetShort(bp + OFF_OSV1_WIDTH);
- bmpPtr->bmih.biHeight = (int)BmpGetShort(bp + OFF_OSV1_HEIGHT);
- bmpPtr->bmih.biPlanes = BmpGetShort(bp + OFF_OSV1_PLANES);
- bmpPtr->bmih.biBitCount = BmpGetShort(bp + OFF_OSV1_BIT_COUNT);
- bmpPtr->bmih.biCompression = BI_RGB;
- } else {
- bmpPtr->bmih.biWidth = (int)BmpGetLong(bp + OFF_WIDTH);
- bmpPtr->bmih.biHeight = (int)BmpGetLong(bp + OFF_HEIGHT);
- bmpPtr->bmih.biPlanes = BmpGetShort(bp + OFF_PLANES);
- bmpPtr->bmih.biBitCount = BmpGetShort(bp + OFF_BIT_COUNT);
- bmpPtr->bmih.biCompression = BmpGetLong(bp + OFF_COMPRESSION);
- bmpPtr->bmih.biSizeImage = BmpGetLong(bp + OFF_SIZE_IMAGE);
- bmpPtr->bmih.biXPelsPerMeter = (int)BmpGetLong(bp + OFF_X_PELS_PER_METER);
- bmpPtr->bmih.biYPelsPerMeter = (int)BmpGetLong(bp + OFF_Y_PELS_PER_METER);
- bmpPtr->bmih.biClrUsed = BmpGetLong(bp + OFF_CLR_USED);
- bmpPtr->bmih.biClrImportant = BmpGetLong(bp + OFF_CLR_IMPORTANT);
- }
-
-#ifdef notdef
- fprintf(stderr, "fileName=%s\n", bmpPtr->name);
- fprintf(stderr, " biSize=%d\n", bmpPtr->bmih.biSize);
- fprintf(stderr, " biWidth=%d\n", bmpPtr->bmih.biWidth);
- fprintf(stderr, " biHeight=%d\n", bmpPtr->bmih.biHeight);
- fprintf(stderr, " biPlanes=%d\n", bmpPtr->bmih.biPlanes);
- fprintf(stderr, " biBitCount=%d\n", bmpPtr->bmih.biBitCount);
- fprintf(stderr, " biCompression=%d\n", bmpPtr->bmih.biCompression);
- fprintf(stderr, " biSizeImage=%d\n", bmpPtr->bmih.biSizeImage);
- fprintf(stderr, " biClrUsed=%d\n", bmpPtr->bmih.biClrUsed);
-#endif
-
- if (Blt_DBuffer_BytesLeft(dbuffer) < bmpPtr->bmih.biSize) {
- BmpError("bad BMP header, short file");
- }
- if (bmpPtr->bmih.biWidth <= 0) {
- BmpError("invalid image width %d.", bmpPtr->bmih.biWidth);
- }
- if (bmpPtr->bmih.biHeight == 0) {
- BmpError("invalid image height %d.", bmpPtr->bmih.biHeight);
- }
- /* According to the MicroSoft documentation, if the image height is
- * negative, the image data is in top-down order. Since virtually no one
- * does this, read the image data bottom-up. The user can always flip the
- * resulting image. */
- if (bmpPtr->bmih.biHeight < 0) {
- bmpPtr->bmih.biHeight = -bmpPtr->bmih.biHeight;
- }
- if (Blt_DBuffer_Length(dbuffer) < bmpPtr->bmfh.bfSize) {
- int old;
-
- old = Blt_DBuffer_Length(dbuffer);
- Blt_DBuffer_Resize(dbuffer, bmpPtr->bmfh.bfSize);
- memset(bp + old, 0, bmpPtr->bmfh.bfSize - old);
- Blt_DBuffer_SetLength(dbuffer, bmpPtr->bmfh.bfSize);
- }
- if (bmpPtr->bmih.biSize >= SIZEOF_BITMAPV4HEADER) {
- bmpPtr->bmih.biRedMask = BmpGetLong(bp + OFF_RED_MASK);
- bmpPtr->bmih.biGreenMask = BmpGetLong(bp + OFF_GREEN_MASK);
- bmpPtr->bmih.biBlueMask = BmpGetLong(bp + OFF_BLUE_MASK);
- bmpPtr->bmih.biAlphaMask = BmpGetLong(bp + OFF_ALPHA_MASK);
- bmpPtr->bmih.biCSType = BmpGetLong(bp + OFF_CS_TYPE);
- /* Skip CIEXYZ endpoints */
- bmpPtr->bmih.biGammaRed = BmpGetLong(bp + OFF_GAMMA_RED);
- bmpPtr->bmih.biGammaGreen = BmpGetLong(bp + OFF_GAMMA_GREEN);
- bmpPtr->bmih.biGammaBlue = BmpGetLong(bp + OFF_GAMMA_BLUE);
- }
- if (bmpPtr->bmih.biSize >= SIZEOF_BITMAPV5HEADER) {
- bmpPtr->bmih.biIntent = BmpGetLong(bp + OFF_INTENT);
- bmpPtr->bmih.biProfileData = BmpGetLong(bp + OFF_PROFILE_DATA);
- bmpPtr->bmih.biProfileSize = BmpGetLong(bp + OFF_PROFILE_SIZE);
- bmpPtr->bmih.biReserved = BmpGetLong(bp + OFF_RESERVED3);
- }
-
-#ifdef notdef
- if (bmpPtr->bmih.biCSType != 0) {
- fprintf(stderr, "fileName=%s\n", bmpPtr->name);
- fprintf(stderr, " biRedMask=%x\n", bmpPtr->bmih.biRedMask);
- fprintf(stderr, " biGreenMask=%x\n", bmpPtr->bmih.biGreenMask);
- fprintf(stderr, " biBlueMask=%x\n", bmpPtr->bmih.biBlueMask);
- fprintf(stderr, " biAlphaMask=%x\n", bmpPtr->bmih.biAlphaMask);
- fprintf(stderr, " biCSType=%d\n", bmpPtr->bmih.biCSType);
- fprintf(stderr, " biGammaRed=%d\n", bmpPtr->bmih.biGammaRed);
- fprintf(stderr, " biGammaGreen=%d\n", bmpPtr->bmih.biGammaGreen);
- fprintf(stderr, " biGammaBlue=%d\n", bmpPtr->bmih.biGammaBlue);
- fprintf(stderr, " biIntent=%d\n", bmpPtr->bmih.biIntent);
- fprintf(stderr, " biProfileData=%d\n", bmpPtr->bmih.biProfileData);
- fprintf(stderr, " biProfileSize=%d\n", bmpPtr->bmih.biProfileSize);
- fprintf(stderr, " biReserved=%d\n", bmpPtr->bmih.biReserved);
- }
-#endif
-
- /* Verify bits per pixel count and colors used. */
- switch (bmpPtr->bmih.biBitCount) {
- case 1: /* 2-bits, Monochrome */
- if (bmpPtr->bmih.biClrUsed > 2) {
- BmpError("wrong # colors (%d), expecting <= 2 colors.",
- bmpPtr->bmih.biClrUsed);
- }
- if (bmpPtr->bmih.biClrUsed == 0) {
- bmpPtr->bmih.biClrUsed = 2;
- }
- break;
- case 4: /* 4-bits, 16 colors. */
- if (bmpPtr->bmih.biClrUsed > 16) {
- BmpError("wrong # colors (%d), expecting <= 16 colors.",
- bmpPtr->bmih.biClrUsed);
- }
- if (bmpPtr->bmih.biClrUsed == 0) {
- bmpPtr->bmih.biClrUsed = 16;
- }
- break;
- case 8: /* 8-bits, 256 colors */
- if (bmpPtr->bmih.biClrUsed > 256) {
- BmpError("wrong # colors (%d), expecting <= 256 colors.",
- bmpPtr->bmih.biClrUsed);
- }
- if (bmpPtr->bmih.biClrUsed == 0) {
- bmpPtr->bmih.biClrUsed = 256;
- }
- break;
- case 16:
- case 24:
- case 32: /* True color. */
- if (bmpPtr->bmih.biClrUsed != 0) {
- BmpWarning("# colors is %d, expecting 0 colors in %d-bit image.",
- bmpPtr->bmih.biClrUsed, bmpPtr->bmih.biBitCount);
- bmpPtr->bmih.biClrUsed = 0;
- }
- break;
- default:
- BmpError("invalid # bits per pixel (%d)", bmpPtr->bmih.biBitCount);
- break;
- }
-
- /* Verify compression type. */
- switch (bmpPtr->bmih.biCompression) {
- case BI_RGB:
- break;
- case BI_RLE4:
- if (bmpPtr->bmih.biBitCount != 4) {
- BmpError("wrong # bits per pixel (%d) for RLE4 compression",
- bmpPtr->bmih.biBitCount);
- }
- break;
- case BI_RLE8:
- if (bmpPtr->bmih.biBitCount != 8) {
- BmpError("wrong # bits per pixel (%d) for RLE8 compression",
- bmpPtr->bmih.biBitCount);
- }
- break;
- case BI_BITFIELDS:
- if ((bmpPtr->bmih.biBitCount != 16)&&(bmpPtr->bmih.biBitCount != 32)) {
- BmpError("wrong # bits per pixel (%d) for BITFIELD compression",
- bmpPtr->bmih.biBitCount);
- }
- break;
- case BI_PNG:
- case BI_JPEG:
- BmpError("compression type \"%s\" not implemented",
- compression_types[bmpPtr->bmih.biCompression]);
- break;
- default:
- BmpError("unknown compression type (%d)", bmpPtr->bmih.biCompression);
- }
- Blt_DBuffer_SetPointer(dbuffer, bp + bmpPtr->bmih.biSize + 14);
- return TRUE;
-}
-
-static int
-BmpPalette(Blt_DBuffer dbuffer, Bmp *bmpPtr)
-{
- unsigned char *bp;
-
- bp = Blt_DBuffer_Pointer(dbuffer);
- if (bmpPtr->bmih.biClrUsed == 0) {
- if (bmpPtr->bmih.biSize == SIZEOF_BITMAPV3HEADER) {
- bmpPtr->bmih.biRedMask = BmpGetLong(bp);
- bmpPtr->bmih.biGreenMask = BmpGetLong(bp + 4);
- bmpPtr->bmih.biBlueMask = BmpGetLong(bp + 8);
- bmpPtr->bmih.biAlphaMask = 0;
- }
- } else {
- int sizeElem;
- int i;
-
- assert(bmpPtr->bmih.biClrUsed <= 256);
- sizeElem = (bmpPtr->bmih.biSize == SIZEOF_BITMAPOS2V1HEADER) ? 3 : 4;
- if (Blt_DBuffer_BytesLeft(dbuffer) <
- (bmpPtr->bmih.biClrUsed * sizeElem)) {
- BmpError("short file");
- }
- for (i = 0; i < bmpPtr->bmih.biClrUsed; i++, bp += sizeElem) {
- /* Colormap components are ordered BGBA. */
- bmpPtr->colorTable[i].Blue = bp[0];
- bmpPtr->colorTable[i].Green = bp[1];
- bmpPtr->colorTable[i].Red = bp[2];
- bmpPtr->colorTable[i].Alpha = ALPHA_OPAQUE;
- }
- }
- Blt_DBuffer_SetPointer(dbuffer, bp);
- return TRUE;
-}
-
-static Blt_Picture
-BmpRgbImageData(Blt_DBuffer dbuffer, Bmp *bmpPtr)
-{
- Blt_Pixel *destRowPtr;
- Picture *destPtr;
- unsigned char *srcBits;
- unsigned int bytesPerRow, wordsPerRow;
- int w, h;
-
- w = bmpPtr->bmih.biWidth;
- h = bmpPtr->bmih.biHeight;
-
- wordsPerRow = (w * bmpPtr->bmih.biBitCount + 31) / 32;
- bytesPerRow = wordsPerRow * 4;
-
- srcBits = Blt_DBuffer_Pointer(dbuffer);
- if (Blt_DBuffer_BytesLeft(dbuffer) < (bytesPerRow * h)) {
- BmpError("image size is %d, need %u bytes",
- Blt_DBuffer_BytesLeft(dbuffer), bytesPerRow * (unsigned int)h);
- }
- destPtr = Blt_CreatePicture(w, h);
- destRowPtr = destPtr->bits + (destPtr->pixelsPerRow * h);
- switch (bmpPtr->bmih.biBitCount) {
- case 1:
- {
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = srcBits;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp, *dend;
-
- destRowPtr -= destPtr->pixelsPerRow;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- int x;
- unsigned char byte;
- x = dp - destRowPtr;
-
- byte = srcRowPtr[x>>3];
- dp->u32 = (byte & (0x80 >> (x & 7))) ?
- bmpPtr->colorTable[1].u32 :
- bmpPtr->colorTable[0].u32;
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += bytesPerRow;
- }
- }
- break;
- case 4:
- {
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = srcBits;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp, *dend;
- unsigned char *sp;
-
- destRowPtr -= destPtr->pixelsPerRow;
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; /*empty*/) {
- unsigned int pixel;
-
- pixel = ((sp[0] >> 4) & 0x0F);
- dp->u32 = bmpPtr->colorTable[pixel].u32;
- dp++;
- pixel = (sp[0] & 0x0F);
- dp->u32 = bmpPtr->colorTable[pixel].u32;
- dp++;
- sp++;
- }
- srcRowPtr += bytesPerRow;
- }
- }
- break;
- case 8:
- {
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = srcBits;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp, *dend;
- unsigned char *sp;
-
- destRowPtr -= destPtr->pixelsPerRow;
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- dp->u32 = bmpPtr->colorTable[*sp].u32;
- sp++;
- }
- srcRowPtr += bytesPerRow;
- }
- break;
- }
- case 16:
- {
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = srcBits;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp, *dend;
- unsigned char *sp;
-
- destRowPtr -= destPtr->pixelsPerRow;
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- unsigned int pixel;
-
- pixel = BmpGetShort(sp);
- dp->Blue = (pixel & 0x001f) << 3;
- dp->Green = (pixel & 0x03e0) >> 2;
- dp->Red = (pixel & 0x7c00) >> 7;
- dp->Alpha = ALPHA_OPAQUE;
- sp += 2;
- }
- srcRowPtr += bytesPerRow;
- }
- }
- break;
- case 24:
- {
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = srcBits;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp, *dend;
- unsigned char *sp;
-
- destRowPtr -= destPtr->pixelsPerRow;
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- dp->Blue = sp[0];
- dp->Green = sp[1];
- dp->Red = sp[2];
- dp->Alpha = ALPHA_OPAQUE;
- sp += 3;
- }
- srcRowPtr += bytesPerRow;
- }
- }
- break;
- case 32:
- {
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = srcBits;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp, *dend;
- unsigned char *sp;
-
- destRowPtr -= destPtr->pixelsPerRow;
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- dp->Blue = sp[0];
- dp->Green = sp[1];
- dp->Red = sp[2];
- dp->Alpha = ALPHA_OPAQUE;
- sp += 4;
- }
- srcRowPtr += bytesPerRow;
- }
- }
- break;
- }
- return destPtr;
-}
-
-/*-------------------------------------------------------------------------------
- *
- * CountBits --
- *
- * Returns the number of bits set in the given 32-bit mask.
- *
- * Reference: Graphics Gems Volume II.
- *
- * Results:
- * The number of bits to set in the mask.
- *
- *
- *---------------------------------------------------------------------------
- */
-static int
-CountBits(unsigned long mask) /* 32 1-bit tallies */
-{
- /* 16 2-bit tallies */
- mask = (mask & 0x55555555) + ((mask >> 1) & (0x55555555));
- /* 8 4-bit tallies */
- mask = (mask & 0x33333333) + ((mask >> 2) & (0x33333333));
- /* 4 8-bit tallies */
- mask = (mask & 0x07070707) + ((mask >> 4) & (0x07070707));
- /* 2 16-bit tallies */
- mask = (mask & 0x000F000F) + ((mask >> 8) & (0x000F000F));
- /* 1 32-bit tally */
- mask = (mask & 0x0000001F) + ((mask >> 16) & (0x0000001F));
- return mask;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindShift --
- *
- * Returns the position of the least significant (low) bit in the given
- * mask.
- *
- * Results:
- * The number of the least significant bit.
- *
- *---------------------------------------------------------------------------
- */
-static int
-FindShift(unsigned int mask)
-{
- int bit;
-
- for (bit = 0; bit < 32; bit++) {
- if (mask & (1 << bit)) {
- break;
- }
- }
- return bit;
-}
-
-static int
-GetAdjust(unsigned int mask)
-{
- int n;
- int adjust = 0;
-
- n = CountBits(mask);
- if (n < 8) {
- adjust = 8 - n;
- }
- return adjust;
-}
-
-static Blt_Picture
-BmpBitfieldImageData(Blt_DBuffer dbuffer, Bmp *bmpPtr)
-{
- Picture *destPtr;
- unsigned char *srcBits;
- unsigned int bytesPerRow, wordsPerRow;
- int w, h;
- unsigned int rShift, gShift, bShift, aShift;
- unsigned int rMask, gMask, bMask, aMask;
- unsigned int rAdjust, gAdjust, bAdjust, aAdjust;
-
- rMask = bmpPtr->bmih.biRedMask;
- gMask = bmpPtr->bmih.biGreenMask;
- bMask = bmpPtr->bmih.biBlueMask;
- aMask = bmpPtr->bmih.biAlphaMask;
-
- rShift = FindShift(rMask);
- gShift = FindShift(gMask);
- bShift = FindShift(bMask);
- aShift = FindShift(aMask);
-
- rAdjust = GetAdjust(rMask);
- gAdjust = GetAdjust(gMask);
- bAdjust = GetAdjust(bMask);
- aAdjust = GetAdjust(aMask);
-
- w = bmpPtr->bmih.biWidth;
- h = bmpPtr->bmih.biHeight;
- wordsPerRow = (w * bmpPtr->bmih.biBitCount + 31) / 32;
- bytesPerRow = wordsPerRow * 4;
-
- srcBits = Blt_DBuffer_Pointer(dbuffer);
- destPtr = Blt_CreatePicture(w, h);
- if (bmpPtr->bmih.biBitCount == 32) {
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- destRowPtr = destPtr->bits + (destPtr->pixelsPerRow * h);
- srcRowPtr = srcBits;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp, *dend;
- unsigned char *sp;
-
- destRowPtr -= destPtr->pixelsPerRow;
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- unsigned int pixel;
-
- pixel = BmpGetLong(sp);
- dp->Red = ((pixel & rMask) >> rShift) << rAdjust;
- dp->Green = ((pixel & gMask) >> gShift) << gAdjust;
- dp->Blue = ((pixel & bMask) >> bShift) << bAdjust;
- dp->Alpha = ((pixel & aMask) >> aShift) << aAdjust;
- sp += 4;
- }
- srcRowPtr += bytesPerRow;
- }
- } else if (bmpPtr->bmih.biBitCount == 16) {
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- destRowPtr = destPtr->bits + (destPtr->pixelsPerRow * h);
- srcRowPtr = srcBits;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp, *dend;
- unsigned char *sp;
-
- destRowPtr -= destPtr->pixelsPerRow;
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- unsigned int pixel;
-
- pixel = BmpGetShort(sp);
- dp->Red = ((pixel & rMask) >> rShift) << rAdjust;
- dp->Green = ((pixel & gMask) >> gShift) << gAdjust;
- dp->Blue = ((pixel & bMask) >> bShift) << bAdjust;
- dp->Alpha = ((pixel & aMask) >> aShift) << aAdjust;
- sp += 2;
- }
- srcRowPtr += bytesPerRow;
- }
- } else {
- return NULL;
- }
- if (aMask != 0) {
- /* The image may or may not be transparent. Check */
- Blt_ClassifyPicture(destPtr);
- }
- return destPtr;
-}
-
-static Blt_Picture
-BmpRleImageData(Blt_DBuffer dbuffer, Bmp *bmpPtr)
-{
- Picture *destPtr;
- unsigned char *srcBits, *sp;
- unsigned int bytesPerRow, wordsPerRow;
- int w, h;
-
- w = bmpPtr->bmih.biWidth;
- h = bmpPtr->bmih.biHeight;
- wordsPerRow = (w * bmpPtr->bmih.biBitCount + 31) / 32;
- bytesPerRow = wordsPerRow * 4;
-
- srcBits = Blt_DBuffer_Pointer(dbuffer);
- destPtr = Blt_CreatePicture(w, h);
- Blt_BlankPicture(destPtr, bmpPtr->colorTable);
- sp = srcBits;
- if (bmpPtr->bmih.biBitCount == 8) {
- int x, y;
-
- x = 0, y = h - 1;
- for (;;) {
- unsigned int index, count;
-
- count = sp[0];
- index = sp[1];
- sp += 2;
- if (count == 0) {
- switch (index) {
- case 0: /* End-of-line */
- x = 0;
- y--;
- if (y < 0) {
- goto done;
- }
- break;
-
- case 1: /* End-of-bitmap */
- goto done;
-
- case 2: /* Delta */
- x += sp[2];
- y -= sp[3];
- if (y < 0) {
- goto done;
- }
- sp += 2;
- break;
-
- default: /* Absolute mode. index is # of bytes. */
- {
- int i;
- Blt_Pixel *dp;
-
- count = index;
-
- if ((x + count) > w) {
- Blt_FreePicture(destPtr);
- BmpError("invalid image data: abs run of %d pixels will overrun row (%d,%d) %d index=%d", count, x, y, w, index);
- }
- /* The run is always padded to an even number of bytes
- * (16-bit boundary). This loop relies on the fact
- * that picture data is also padded. */
- dp = Blt_PicturePixel(destPtr, x, y);
- for (i = 0; i < count; i += 2) {
- dp->u32 = bmpPtr->colorTable[sp[0]].u32;
- dp++;
- dp->u32 = bmpPtr->colorTable[sp[1]].u32;
- dp++, sp += 2;
- }
- x += count;
- }
- break;
- }
- } else {
- int i;
- Blt_Pixel *dp;
-
- dp = Blt_PicturePixel(destPtr, x, y);
- for (i = 0; (x < w) && (i < count); i++, x++) {
- dp->u32 = bmpPtr->colorTable[index].u32;
- dp++;
- }
- }
- }
- } else if (bmpPtr->bmih.biBitCount == 4) {
- int x, y;
-
- x = 0, y = h - 1;
- for (;;) {
- unsigned int index, count;
-
- count = sp[0];
- index = sp[1];
- sp += 2;
- if (count == 0) {
- switch (index) {
- case 0: /* End-of-line */
- x = 0;
- y--;
- if (y < 0) {
- goto done;
- }
- break;
-
- case 1: /* End-of-bitmap */
- goto done;
-
- case 2: /* Delta */
- x += sp[2];
- y -= sp[3];
- if (y < 0) {
- goto done;
- }
- sp += 2;
- break;
-
- default: /* Absolute mode. index is # of pixels. */
- {
- int i;
- Blt_Pixel *dp;
- unsigned char *send;
-
- count = index;
- dp = Blt_PicturePixel(destPtr, x, y);
- /* The run may be padded up to 12 bits. */
- send = sp + ((count + 3) / 4) * 2;
-
- if ((x + count) > w) {
- Blt_FreePicture(destPtr);
- BmpError("invalid image data: abs run of %d pixels will overrun row (%d,%d) %d index=%d", count, x, y, w, index);
- }
-
- for (i = 0; i < count; i += 2) {
- int i1, i2;
- i1 = (sp[0] >> 4) & 0x0F;
- i2 = sp[0] & 0x0F;
- sp++;
- dp->u32 = bmpPtr->colorTable[i1].u32;
- dp++;
- dp->u32 = bmpPtr->colorTable[i2].u32;
- dp++;
- }
- x += count;
- sp = send;
- }
- break;
- }
- } else {
- /* Encoded mode */
- int i;
- Blt_Pixel *dp;
- unsigned int c1, c2;
-
- c1 = bmpPtr->colorTable[(index >> 4) & 0x0F].u32;
- c2 = bmpPtr->colorTable[index & 0x0F].u32;
- dp = Blt_PicturePixel(destPtr, x, y);
- for (i = 0; (x < w) && (i < count); i++, x++) {
- dp->u32 = (i & 0x1) ? c2 : c1;
- dp++;
- }
- }
- }
- }
- done:
- return destPtr;
-}
-
-
-static Blt_Picture
-BmpImageData(Blt_DBuffer dbuffer, Bmp *bmpPtr)
-{
- Blt_Picture picture;
-
- picture = NULL;
- Blt_DBuffer_SetCursor(dbuffer, bmpPtr->bmfh.bfOffBits);
- if (Blt_DBuffer_BytesLeft(dbuffer) < (bmpPtr->bmih.biSizeImage)) {
- BmpError("short file: not enough bytes for image data");
- }
- switch(bmpPtr->bmih.biCompression) {
- case BI_RGB:
- picture = BmpRgbImageData(dbuffer, bmpPtr);
- break;
- case BI_BITFIELDS:
- picture = BmpBitfieldImageData(dbuffer, bmpPtr);
- break;
- case BI_RLE4:
- case BI_RLE8:
- picture = BmpRleImageData(dbuffer, bmpPtr);
- break;
- case BI_PNG:
- case BI_JPEG:
- break;
- }
- return picture;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BmpToPicture --
- *
- * Reads a BMP file, converts it into a picture, and appends it
- * to the list of images. We only handle only single BMP images.
- *
- * Results:
- * The picture is returned. If an error occured, such
- * as the designated file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-BmpToPicture(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer,
- BmpImportSwitches *switchesPtr)
-{
- Blt_Chain chain;
- Blt_Picture picture;
- Bmp bmp;
- BmpMessage message;
-
- bmpMessagePtr = &message;
- memset(&bmp, 0, sizeof(bmp)); /* Clear the structure. */
- message.nWarnings = 0;
- bmp.name = fileName;
-
- Tcl_DStringInit(&message.errors);
- Tcl_DStringInit(&message.warnings);
- Tcl_DStringAppend(&message.errors, "error reading \"", -1);
- Tcl_DStringAppend(&message.errors, fileName, -1);
- Tcl_DStringAppend(&message.errors, "\": ", -1);
-
- Tcl_DStringAppend(&message.warnings, "\"", -1);
- Tcl_DStringAppend(&message.warnings, fileName, -1);
- Tcl_DStringAppend(&message.warnings, "\": ", -1);
-
- if (setjmp(message.jmpbuf)) {
- Tcl_DStringResult(interp, &message.errors);
- Tcl_DStringFree(&message.warnings);
- return NULL;
- }
- chain = NULL;
- if (!BmpHeader(dbuffer, &bmp)) {
- BmpError("bad BMP header");
- }
- if (!BmpHeaderInfo(dbuffer, &bmp)) {
- BmpError("bad BMP logical screen descriptor");
- }
- if (!BmpPalette(dbuffer, &bmp)) {
- BmpError("bad BMP color table");
- }
- picture = BmpImageData(dbuffer, &bmp);
- if (message.nWarnings > 0) {
- Tcl_SetErrorCode(interp, "PICTURE", "BMP_READ_WARNINGS",
- Tcl_DStringValue(&message.warnings), (char *)NULL);
- } else {
- Tcl_SetErrorCode(interp, "NONE", (char *)NULL);
- }
- Tcl_DStringFree(&message.warnings);
- Tcl_DStringFree(&message.errors);
- if (picture != NULL) {
- chain = Blt_Chain_Create();
- Blt_Chain_Append(chain, picture);
- }
- return chain;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictureToBmp --
- *
- * Reads an BMP file and converts it into a picture.
- *
- * Results:
- * The picture is returned. If an error occured, such as the designated
- * file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PictureToBmp(Tcl_Interp *interp, Blt_Picture original, Blt_DBuffer dbuffer,
- BmpExportSwitches *switchesPtr)
-{
- int nColors;
- int format;
- int bitsPerPixel;
- Picture *srcPtr;
- Blt_HashTable colorTable;
- unsigned int wordsPerRow, bytesPerRow;
- unsigned int imageSize, fileSize, infoHeaderSize, offsetToData;
- unsigned char *bp, *destBits;
-
- srcPtr = original;
- if (switchesPtr->flags & EXPORT_ALPHA) {
- bitsPerPixel = 32;
- format = BI_BITFIELDS;
- nColors = 0;
- infoHeaderSize = SIZEOF_BITMAPV4HEADER;
- } else {
- if (!Blt_PictureIsOpaque(srcPtr)) {
- Blt_Picture background;
-
- /* Blend picture with solid color background. */
- background = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- Blt_BlankPicture(background, &switchesPtr->bg);
- Blt_BlendPictures(background, srcPtr, 0, 0, srcPtr->width,
- srcPtr->height, 0, 0);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- srcPtr = background;
- }
- nColors = Blt_QueryColors(srcPtr, (Blt_HashTable *)NULL);
- format = BI_RGB;
- infoHeaderSize = SIZEOF_BITMAPV3HEADER;
- if (nColors <= 256) {
- bitsPerPixel = 8;
- Blt_InitHashTable(&colorTable, BLT_ONE_WORD_KEYS);
- nColors = Blt_QueryColors(srcPtr, &colorTable);
- } else {
- bitsPerPixel = 24;
- nColors = 0;
- }
- }
- wordsPerRow = (srcPtr->width * bitsPerPixel + 31) / 32;
- bytesPerRow = wordsPerRow * 4;
- imageSize = bytesPerRow * srcPtr->height;
-
- /*
- * Compute the size of the structure.
- *
- * header + infoheader + colortable + imagedata
- *
- * 14 + 108 + 0-256 * 4 + bytesPerRow * height;
- */
- fileSize = imageSize + (nColors * 4) + infoHeaderSize + 14;
- offsetToData = 14 + infoHeaderSize + (nColors * 4);
-
- bp = Blt_DBuffer_Extend(dbuffer, fileSize);
- memset(bp, 0, fileSize);
-
- /* File header. */
- bp[0] = 'B', bp[1] = 'M';
- BmpSetLong(bp + OFF_FILE_SIZE, fileSize);
- BmpSetLong(bp + OFF_OFFBITS, offsetToData);
-
- /* Image header. */
- BmpSetLong (bp + OFF_SIZE, infoHeaderSize);
- BmpSetLong (bp + OFF_WIDTH, srcPtr->width);
- BmpSetLong (bp + OFF_HEIGHT, srcPtr->height);
- BmpSetShort(bp + OFF_PLANES, 1);
- BmpSetShort(bp + OFF_BIT_COUNT, bitsPerPixel);
- BmpSetLong (bp + OFF_COMPRESSION, format);
- BmpSetLong (bp + OFF_SIZE_IMAGE, bytesPerRow * srcPtr->height);
- BmpSetLong (bp + OFF_X_PELS_PER_METER, 0);
- BmpSetLong (bp + OFF_Y_PELS_PER_METER, 0);
- BmpSetLong (bp + OFF_CLR_USED, nColors);
- BmpSetLong (bp + OFF_CLR_IMPORTANT, 0);
-
- if (bitsPerPixel == 32) {
- BmpSetLong(bp + OFF_RED_MASK, 0x00FF0000); /* biRedMask */
- BmpSetLong(bp + OFF_GREEN_MASK, 0x0000FF00); /* biGreenMask */
- BmpSetLong(bp + OFF_BLUE_MASK, 0x000000FF); /* biBlueMask */
- BmpSetLong(bp + OFF_ALPHA_MASK, 0xFF000000); /* biAlphaMask */
- }
-
- /* Color table. */
- if (bitsPerPixel == 8) {
- unsigned long i;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- i = 0;
- bp += 14 + infoHeaderSize;
- for (hPtr = Blt_FirstHashEntry(&colorTable, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_Pixel pixel;
- unsigned long key;
-
- Blt_SetHashValue(hPtr, i);
- key = (unsigned long)Blt_GetHashKey(&colorTable, hPtr);
- pixel.u32 = (unsigned int)key;
-
- /* Colormap components are ordered BGBA. */
- bp[0] = pixel.Blue;
- bp[1] = pixel.Green;
- bp[2] = pixel.Red;
- bp[3] = pixel.Alpha;
- bp += 4;
- i++;
- }
- assert(i == nColors);
- }
-
- destBits = Blt_DBuffer_Pointer(dbuffer) + offsetToData;
-
- /* Image data. */
- switch (bitsPerPixel) {
- case 32:
- {
- Blt_Pixel *srcRowPtr;
- int y;
- unsigned char *destRowPtr;
-
- destRowPtr = destBits;
- srcRowPtr = srcPtr->bits+((srcPtr->height-1)*srcPtr->pixelsPerRow);
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp+srcPtr->width; sp < send; sp++) {
- BmpSetLong(dp, sp->u32);
- dp += 4;
- }
- destRowPtr += bytesPerRow;
- srcRowPtr -= srcPtr->pixelsPerRow;
- }
- assert((destRowPtr - Blt_DBuffer_Pointer(dbuffer)) == fileSize);
- }
- break;
-
- case 24:
- {
- Blt_Pixel *srcRowPtr;
- int y;
- unsigned char *destRowPtr;
-
- destRowPtr = destBits;
- srcRowPtr = srcPtr->bits+((srcPtr->height-1)*srcPtr->pixelsPerRow);
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp+srcPtr->width; sp < send; sp++) {
- dp[0] = sp->Blue;
- dp[1] = sp->Green;
- dp[2] = sp->Red;
- dp += 3;
- }
- destRowPtr += bytesPerRow;
- srcRowPtr -= srcPtr->pixelsPerRow;
- }
- assert((destRowPtr - Blt_DBuffer_Pointer(dbuffer)) == fileSize);
- }
- break;
-
- case 8:
- {
- Blt_Pixel *srcRowPtr;
- int y;
- unsigned char *destRowPtr;
-
- destRowPtr = destBits;
- srcRowPtr = srcPtr->bits+((srcPtr->height-1)*srcPtr->pixelsPerRow);
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp+srcPtr->width; sp < send; sp++) {
- Blt_HashEntry *hPtr;
- unsigned long index;
- union {
- Blt_Pixel color;
- char *key;
- } value;
-
- value.color.u32 = sp->u32;
- value.color.Alpha = 0xFF;
- hPtr = Blt_FindHashEntry(&colorTable, value.key);
- if (hPtr == NULL) {
- fprintf(stderr, "can't find %x\n", sp->u32);
- continue;
- }
- index = (unsigned long)Blt_GetHashValue(hPtr);
- *dp = (unsigned char)(index & 0xFF);
- dp++;
- }
- destRowPtr += bytesPerRow;
- srcRowPtr -= srcPtr->pixelsPerRow;
- }
- assert((destRowPtr - Blt_DBuffer_Pointer(dbuffer)) == fileSize);
- }
- break;
- }
- if (bitsPerPixel == 8) {
- Blt_DeleteHashTable(&colorTable);
- }
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsBmp --
- *
- * Attempts to parse a BMP file header.
- *
- * Results:
- * Returns 1 is the header is BMP and 0 otherwise. Note that
- * the validity of the header contents is not checked here. That's
- * done in BmpToPicture.
- *
- *---------------------------------------------------------------------------
- */
-static int
-IsBmp(Blt_DBuffer dbuffer)
-{
- Bmp bmp;
-
- return BmpHeader(dbuffer, &bmp);
-}
-
-static Blt_Chain
-ReadBmp(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer)
-{
- BmpImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- return BmpToPicture(interp, fileName, dbuffer, &switches);
-}
-
-static Tcl_Obj *
-WriteBmp(Tcl_Interp *interp, Blt_Picture picture)
-{
- Blt_DBuffer dbuffer;
- BmpExportSwitches switches;
- Tcl_Obj *objPtr;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF; /* white */
-
- dbuffer = Blt_DBuffer_Create();
- objPtr = NULL;
- if (PictureToBmp(interp, picture, dbuffer, &switches) == TCL_OK) {
- char *bytes;
-
- bytes = Blt_DBuffer_EncodeBase64(interp, dbuffer);
- if (bytes != NULL) {
- objPtr = Tcl_NewStringObj(bytes, -1);
- Blt_Free(bytes);
- }
- }
- return objPtr;
-}
-
-static Blt_Chain
-ImportBmp(
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv,
- const char **fileNamePtr)
-{
- Blt_DBuffer dbuffer;
- Blt_Chain chain;
- const char *string;
- BmpImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one import source: ",
- "use only one -file or -data flag.", (char *)NULL);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- dbuffer = Blt_DBuffer_Create();
- chain = NULL;
- if (switches.dataObjPtr != NULL) {
- unsigned char *bytes;
- int nBytes;
-
- bytes = Tcl_GetByteArrayFromObj(switches.dataObjPtr, &nBytes);
- if (Blt_IsBase64(bytes, nBytes)) {
- if (Blt_DBuffer_DecodeBase64(interp, string, nBytes, dbuffer)
- != TCL_OK) {
- goto error;
- }
- } else {
- Blt_DBuffer_AppendData(dbuffer, bytes, nBytes);
- }
- string = "data buffer";
- *fileNamePtr = NULL;
- } else {
- string = Tcl_GetString(switches.fileObjPtr);
- *fileNamePtr = string;
- if (Blt_DBuffer_SaveFile(interp, string, dbuffer) != TCL_OK) {
- goto error;
- }
- }
- chain = BmpToPicture(interp, string, dbuffer, &switches);
- if (chain == NULL) {
- return NULL;
- }
- error:
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(dbuffer);
- return chain;
-}
-
-static int
-ExportBmp(Tcl_Interp *interp, unsigned int index, Blt_Chain chain,
- int objc, Tcl_Obj *const *objv)
-{
- Blt_DBuffer dbuffer;
- Blt_Picture picture;
- BmpExportSwitches switches;
- int result;
-
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF; /* Default bgcolor is white. */
- switches.index = index;
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one export destination: ",
- "use only one -file or -data switch.", (char *)NULL);
- return TCL_ERROR;
- }
- picture = Blt_GetNthPicture(chain, switches.index);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "bad picture index.", (char *)NULL);
- return TCL_ERROR;
- }
- dbuffer = Blt_DBuffer_Create();
- result = PictureToBmp(interp, picture, dbuffer, &switches);
- if (result != TCL_OK) {
- Tcl_AppendResult(interp, "can't convert \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- goto error;
- }
- if (switches.fileObjPtr != NULL) {
- const char *fileName;
-
- /* Write the image into the designated file. */
- fileName = Tcl_GetString(switches.fileObjPtr);
- result = Blt_DBuffer_SaveFile(interp, fileName, dbuffer);
- } else if (switches.dataObjPtr != NULL) {
- Tcl_Obj *objPtr;
-
- /* Write the image into the designated TCL variable. */
- objPtr = Tcl_ObjSetVar2(interp, switches.dataObjPtr, NULL,
- Blt_DBuffer_ByteArrayObj(dbuffer), 0);
- result = (objPtr == NULL) ? TCL_ERROR : TCL_OK;
- } else {
- char *string;
-
- /* Return the image as a base64 string in the interpreter result. */
- result = TCL_ERROR;
- string = Blt_DBuffer_EncodeBase64(interp, dbuffer);
- if (string != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(string, -1);
- Blt_Free(string);
- Tcl_SetObjResult(interp, objPtr);
- result = TCL_OK;
- }
- }
- error:
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(dbuffer);
- return result;
-}
-
-int
-Blt_PictureBmpInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_extra", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_picture_bmp", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_PictureRegisterFormat(interp,
- "bmp", /* Name of format. */
- IsBmp, /* Discovery routine. */
- ReadBmp, /* Read format procedure. */
- WriteBmp, /* Write format procedure. */
- ImportBmp, /* Import format procedure. */
- ExportBmp); /* Export format switches. */
-}
diff --git a/blt3.0.1/src/bltPictCmd.c b/blt3.0.1/src/bltPictCmd.c
deleted file mode 100644
index 43e02f6..0000000
--- a/blt3.0.1/src/bltPictCmd.c
+++ /dev/null
@@ -1,4546 +0,0 @@
-
-/*
- * bltPictCmd.c --
- *
- * This module implements the Tk image interface for picture images.
- *
- * Copyright 2003-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include <bltHash.h>
-#include <bltImage.h>
-#include <bltDBuffer.h>
-#include "bltSwitch.h"
-#include "bltPicture.h"
-#include "bltPictInt.h"
-#include "bltPictFmts.h"
-#include "bltPainter.h"
-
-#include "bltPs.h"
-#include <X11/Xutil.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-typedef struct _Blt_DBuffer DBuffer;
-
-typedef int (PictCmdProc)(Blt_Picture picture, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-#if (_TCL_VERSION < _VERSION(8,2,0))
-typedef struct _Tk_PostscriptInfo *Tk_PostscriptInfo;
-#endif
-
-/*
- * PictureCmdInterpData --
- *
- * Structure containing global data, used on a interpreter by interpreter
- * basis.
- *
- * This structure holds the hash table of instances of datatable commands
- * associated with a particular interpreter.
- */
-typedef struct {
- Tcl_Interp *interp;
-} PictureCmdInterpData;
-
-/*
- * Various external file/string formats handled by the picture image.
- */
-
-enum PictureFormats {
- FMT_JPG, /* Joint Photographic Experts Group r/w */
- FMT_PNG, /* Portable Network Graphics r/w */
- FMT_TIF, /* Tagged Image File Format r/w */
- FMT_XPM, /* X Pixmap r/w */
- FMT_XBM, /* X Bitmap r/w */
- FMT_GIF, /* Graphics Interchange Format r/w */
- FMT_PS, /* PostScript r/w */
- FMT_PDF, /* Portable Document Format r/TBA */
- FMT_BMP, /* Device-independent bitmap r/w */
- FMT_PBM, /* Portable Bitmap Format r/w */
-#ifdef WIN32
- FMT_EMF, /* Enhanced Metafile Format r/w (Windows only) TBA */
- FMT_WMF, /* Windows Metafile Format r/w (Windows only) TBA */
-#endif
- FMT_PHO, /* Tk Photo Image r/w */
- NUMFMTS
-};
-
-typedef struct {
- const char *name; /* Name of format. */
- unsigned int flags;
- Blt_PictureIsFmtProc *isFmtProc;
- Blt_PictureReadDataProc *readProc; /* Used for -file and -data
- * configuration options. */
- Blt_PictureWriteDataProc *writeProc; /* Used for cget -data. */
- Blt_PictureImportProc *importProc;
- Blt_PictureExportProc *exportProc;
-} PictFormat;
-
-static PictFormat pictFormats[] = {
- { "jpg" },
- { "png" },
- { "tif" }, /* Multi-page */
- { "xpm" },
- { "xbm" },
- { "gif" }, /* Multi-page */
- { "ps" }, /* Multi-page */
- { "pdf" }, /* Not implemented yet. */
- { "photo" },
- { "bmp" },
- { "pbm" }, /* Multi-page */
-#ifdef WIN32
- { "emf" },
- { "wmf" },
-#endif
-};
-
-static Blt_HashTable fmtTable;
-
-
-/*
- * Default configuration options for picture images.
- */
-#define DEF_ANGLE "0.0"
-#define DEF_MAXPECT "0"
-#define DEF_AUTOSCALE "0"
-#define DEF_CACHE "0"
-#define DEF_DITHER "0"
-#define DEF_DATA (char *)NULL
-#define DEF_FILE (char *)NULL
-#define DEF_FILTER (char *)NULL
-#define DEF_GAMMA "1.0"
-#define DEF_HEIGHT "0"
-#define DEF_WIDTH "0"
-#define DEF_WINDOW (char *)NULL
-#define DEF_IMAGE (char *)NULL
-#define DEF_SHARPEN "no"
-
-#define DEF_OPAQUE "0"
-#define DEF_OPAQUE_BACKGROUND "white"
-
-#define IMPORTED_NONE 0
-#define IMPORTED_FILE (1<<0)
-#define IMPORTED_IMAGE (1<<1)
-#define IMPORTED_WINDOW (1<<2)
-#define IMPORTED_DATA (1<<3)
-#define IMPORTED_MASK \
- (IMPORTED_FILE|IMPORTED_IMAGE|IMPORTED_WINDOW|IMPORTED_DATA)
-
-#define NOTIFY_PENDING (1<<8)
-
-/*
- * A PictImage implements a Tk_ImageMaster for the "picture" image type. It
- * represents a set of bits (i.e. the picture), some options, and operations
- * (sub-commands) to manipulate the picture.
- *
- * The PictImage manages the TCL interface to a picture (using Tk's "image"
- * command). Pictures and the mechanics of drawing the picture to the display
- * (painters) are orthogonal. The PictImage knows nothing about the display
- * type (the display is stored only to free options when it's destroyed).
- * Information specific to the visual context (combination of display, visual,
- * depth, colormap, and gamma) is stored in each cache entry. The picture
- * image manages the various picture transformations: reading, writing,
- * scaling, rotation, etc.
- */
-typedef struct _Blt_PictureImage {
- Tk_ImageMaster imgToken; /* Tk's token for image master. If
- * NULL, the image has been deleted. */
-
- Tcl_Interp *interp; /* Interpreter associated with the
- * application using this image. */
-
- Display *display; /* Display associated with this picture
- * image. This is used to free the
- * configuration options. */
- Colormap colormap;
-
- Tcl_Command cmdToken; /* Token for image command (used to
- * delete the command when the image
- * goes away). NULL means the image
- * command has already been deleted. */
-
- unsigned int flags; /* Various bit-field flags defined
- * below. */
-
- Blt_Chain chain; /* List of pictures. (multi-page
- * formats) */
-
- Blt_Picture picture; /* Current picture displayed. */
-
- /* User-requested options. */
- float angle; /* Angle in degrees to rotate the
- * image. */
-
- int reqWidth, reqHeight; /* User-requested size of picture. The
- * picture is scaled accordingly. These
- * dimensions may or may not be used,
- * depending * upon the -maxpect
- * option. */
-
- int maxpect; /* If non-zero, indicates to maintain
- * the aspect ratio while scaling. The
- * larger dimension is discarded. */
-
- int dither; /* If non-zero, dither the picture
- * before drawing. */
- int sharpen; /* If non-zero, indicates to sharpen the
- * image. */
- int autoscale; /* Automatically scale the picture
- * from a saved original picture when
- * the size of the picture changes. */
- Blt_Picture original;
-
- Blt_ResampleFilter filter; /* 1D Filter to use when the picture is
- * resampled (resized). The same filter
- * is applied both horizontally and
- * vertically. */
-
- float gamma; /* Gamma correction value of the
- * monitor. In theory, the same picture
- * image may be displayed on two
- * monitors simultaneously (using
- * xinerama). Here we're assuming
- * (almost certainly wrong) that both
- * monitors will have the same gamma
- * value. */
-
- const char *name; /* Name of the image, file, or window
- * read into the picture image. */
-
- unsigned int index; /* Index of the picture in the above
- * list. */
-
- Tcl_TimerToken timerToken; /* Token for timer handler which polls
- * for the exit status of each
- * sub-process. If zero, there's no
- * timer handler queued. */
- int interval;
-
- PictFormat *fmtPtr; /* External format of last image read
- * into the picture image. We use this
- * to write back the same format if the
- * user doesn't specify the format. */
-
- int doCache; /* If non-zero, indicates to generate a
- * pixmap of the picture. The pixmap is
- * cached * in the table below. */
-
- Blt_HashTable cacheTable; /* Table of cache entries specific to
- * each visual context where this
- * picture is displayed. */
-
-} PictImage;
-
-
-/*
- * A PictCacheKey represents the visual context of a cache entry. type. It
- * contains information specific to the visual context (combination of display,
- * visual, depth, colormap, and gamma). It is used as a hash table key for
- * cache entries of picture images. The same picture may be displayed in more
- * than one visual context.
- */
-typedef struct {
- Display *display; /* Display where the picture will be
- * drawn. Used to free colors allocated
- * by the painter. */
-
- Visual *visualPtr; /* Visual information of window
- * displaying the image. */
-
- Colormap colormap; /* Colormap used. This may be the
- * default colormap, or an allocated
- * private map. */
-
- int depth; /* Depth of the display. */
-
- unsigned int index; /* Index of the picture in the list. */
-
- float gamma; /* Gamma correction value */
-} PictCacheKey;
-
-
-/*
- * PictInstances (image instances in the Tk parlance) represent a picture
- * image in some specific combination of visual, display, colormap, depth, and
- * output gamma. Cache entries are stored by each picture image.
- *
- * The purpose is to 1) allocate and hold the painter-specific to the visual
- * and 2) provide caching of XImage's (drawn pictures) into pixmaps. This
- * feature is enabled only for 100% opaque pictures. If the picture must be
- * blended with the current background, there is no guarantee (between
- * redraws) that the background will not have changed. This feature is widget
- * specific. There's no simple way to detect when the pixmap must be redrawn.
- * In general, we should rely on the widget itself to perform its own caching
- * of complex scenes.
- */
-typedef struct {
- Blt_PictureImage image; /* The picture image represented by this
- * entry. */
-
- Blt_Painter painter; /* The painter allocated for this
- * particular combination of visual,
- * display, colormap, depth, and
- * gamma. */
-
- Display *display; /* Used to free the pixmap below when
- * the entry is destroyed. */
-
- Blt_HashEntry *hashPtr; /* These two fields allow the cache */
- Blt_HashTable *tablePtr; /* entry to be deleted from the picture
- * image's table of entries. */
-
- Pixmap pixmap; /* If non-NULL, is a cached pixmap of
- * the picture. It's recreated each time
- * the * picture changes. */
-
- int refCount; /* This entry may be shared by all
- * clients displaying this picture image
- * with the same painter. */
- unsigned int flags;
-} PictInstance;
-
-
-static Blt_OptionParseProc ObjToFile;
-static Blt_OptionPrintProc FileToObj;
-static Blt_CustomOption fileOption =
-{
- ObjToFile, FileToObj, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToData;
-static Blt_OptionPrintProc DataToObj;
-static Blt_CustomOption dataOption =
-{
- ObjToData, DataToObj, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToFilter;
-static Blt_OptionPrintProc FilterToObj;
-Blt_CustomOption bltFilterOption =
-{
- ObjToFilter, FilterToObj, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToImage;
-static Blt_OptionPrintProc ImageToObj;
-static Blt_CustomOption imageOption =
-{
- ObjToImage, ImageToObj, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToWindow;
-static Blt_OptionPrintProc WindowToObj;
-static Blt_CustomOption windowOption =
-{
- ObjToWindow, WindowToObj, NULL, (ClientData)0
-};
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BOOLEAN, "-autoscale", (char *)NULL, (char *)NULL,
- DEF_AUTOSCALE, Blt_Offset(PictImage, autoscale),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-data", (char *)NULL, (char *)NULL, DEF_DATA,
- Blt_Offset(PictImage, picture), 0, &dataOption},
- {BLT_CONFIG_BOOLEAN, "-dither", (char *)NULL, (char *)NULL,
- DEF_DITHER, Blt_Offset(PictImage, dither), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-file", (char *)NULL, (char *)NULL, DEF_DATA,
- Blt_Offset(PictImage, picture), 0, &fileOption},
- {BLT_CONFIG_CUSTOM, "-filter", (char *)NULL, (char *)NULL,
- DEF_FILTER, Blt_Offset(PictImage, filter), 0, &bltFilterOption},
- {BLT_CONFIG_FLOAT, "-gamma", (char *)NULL, (char *)NULL, DEF_GAMMA,
- Blt_Offset(PictImage, gamma), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-height", (char *)NULL, (char *)NULL,
- DEF_HEIGHT, Blt_Offset(PictImage, reqHeight), 0},
- {BLT_CONFIG_CUSTOM, "-image", (char *)NULL, (char *)NULL, DEF_IMAGE,
- Blt_Offset(PictImage, picture), 0, &imageOption},
- {BLT_CONFIG_BOOLEAN, "-maxpect", (char *)NULL, (char *)NULL,
- DEF_MAXPECT, Blt_Offset(PictImage, maxpect),BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FLOAT, "-rotate", (char *)NULL, (char *)NULL,
- DEF_ANGLE, Blt_Offset(PictImage, angle),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-sharpen", (char *)NULL, (char *)NULL,
- DEF_SHARPEN, Blt_Offset(PictImage, sharpen),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-width", (char *)NULL, (char *)NULL,
- DEF_WIDTH, Blt_Offset(PictImage, reqWidth), 0},
- {BLT_CONFIG_CUSTOM, "-window", (char *)NULL, (char *)NULL,
- DEF_WINDOW, Blt_Offset(PictImage, picture), 0, &windowOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-BLT_EXTERN Blt_SwitchParseProc Blt_ColorSwitchProc;
-static Blt_SwitchCustom colorSwitch = {
- Blt_ColorSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc BBoxSwitch;
-static Blt_SwitchCustom bboxSwitch = {
- BBoxSwitch, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc FilterSwitch;
-static Blt_SwitchCustom filterSwitch = {
- FilterSwitch, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc BlendingModeSwitch;
-static Blt_SwitchCustom blendModeSwitch = {
- BlendingModeSwitch, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc ShapeSwitch;
-static Blt_SwitchCustom shapeSwitch = {
- ShapeSwitch, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc PathSwitch;
-static Blt_SwitchCustom pathSwitch = {
- PathSwitch, NULL, (ClientData)0,
-};
-
-typedef struct {
- Blt_Pixel bg, fg; /* Fg and bg colors. */
- Blt_Gradient gradient;
-} GradientSwitches;
-
-static Blt_SwitchSpec gradientSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-direction", "direction",
- Blt_Offset(GradientSwitches, gradient.path), 0, 0, &pathSwitch},
- {BLT_SWITCH_CUSTOM, "-shape", "shape",
- Blt_Offset(GradientSwitches, gradient.shape), 0, 0, &shapeSwitch},
- {BLT_SWITCH_CUSTOM, "-high", "color",
- Blt_Offset(GradientSwitches, fg), 0, 0, &colorSwitch},
- {BLT_SWITCH_CUSTOM, "-low", "color",
- Blt_Offset(GradientSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_BOOLEAN,"-logscale", "bool",
- Blt_Offset(GradientSwitches, gradient.logScale), 0},
- {BLT_SWITCH_BOOLEAN, "-jitter", "bool",
- Blt_Offset(GradientSwitches, gradient.jitter), 0},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- PictRegion region; /* Area to tile. */
- int xOrigin;
- int yOrigin;
-} TileSwitches;
-
-static Blt_SwitchSpec tileSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-region", "bbox",
- Blt_Offset(TileSwitches, region), 0, 0, &bboxSwitch},
- {BLT_SWITCH_INT, "-xorigin", "x",
- Blt_Offset(TileSwitches, xOrigin), 0},
- {BLT_SWITCH_INT, "-yorigin", "y",
- Blt_Offset(TileSwitches, yOrigin), 0},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- int invert; /* Flag. */
- Tcl_Obj *maskObjPtr;
-} ArithSwitches;
-
-static Blt_SwitchSpec arithSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-mask", "mask",
- Blt_Offset(ArithSwitches, maskObjPtr), 0},
- {BLT_SWITCH_BOOLEAN, "-invert", "bool",
- Blt_Offset(ArithSwitches, invert), 0},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- PictRegion region; /* Area to crop. */
- int nocopy; /* If non-zero, don't copy the source
- * image. */
-} DupSwitches;
-
-#define DUP_NOCOPY 1
-
-static Blt_SwitchSpec dupSwitches[] =
-{
- {BLT_SWITCH_BITMASK,"-nocopy", "",
- Blt_Offset(DupSwitches, nocopy), 0, DUP_NOCOPY},
- {BLT_SWITCH_CUSTOM, "-region", "bbox",
- Blt_Offset(DupSwitches, region), 0, 0, &bboxSwitch},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- PictRegion from, to;
- Blt_BlendingMode mode; /* Blending mode. */
-} BlendSwitches;
-
-static Blt_SwitchSpec blendSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-mode", "blendingmode",
- Blt_Offset(BlendSwitches, mode), 0, 0, &blendModeSwitch},
- {BLT_SWITCH_CUSTOM, "-from", "bbox",
- Blt_Offset(BlendSwitches,from), 0, 0, &bboxSwitch},
- {BLT_SWITCH_CUSTOM, "-to", "bbox",
- Blt_Offset(BlendSwitches, to), 0, 0, &bboxSwitch},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- Blt_ResampleFilter vFilter; /* Color of rectangle. */
- Blt_ResampleFilter hFilter; /* Width of outline. */
- Blt_ResampleFilter filter;
-} ConvolveSwitches;
-
-static Blt_SwitchSpec convolveSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-filter", "filter",
- Blt_Offset(ConvolveSwitches, filter), 0, 0, &filterSwitch},
- {BLT_SWITCH_CUSTOM, "-hfilter", "filter",
- Blt_Offset(ConvolveSwitches, hFilter), 0, 0, &filterSwitch},
- {BLT_SWITCH_CUSTOM, "-vfilter", "filter",
- Blt_Offset(ConvolveSwitches, vFilter), 0, 0, &filterSwitch},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- PictRegion from, to;
- int blend;
-} CopySwitches;
-
-static Blt_SwitchSpec copySwitches[] =
-{
- {BLT_SWITCH_BOOLEAN,"-blend", "",
- Blt_Offset(CopySwitches, blend), 0, 0},
- {BLT_SWITCH_CUSTOM, "-from", "bbox",
- Blt_Offset(CopySwitches,from), 0, 0, &bboxSwitch},
- {BLT_SWITCH_CUSTOM, "-to", "bbox",
- Blt_Offset(CopySwitches, to), 0, 0, &bboxSwitch},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- Blt_ResampleFilter filter;
- PictRegion region;
- int width, height;
-} ResampleSwitches;
-
-static Blt_SwitchSpec resampleSwitches[] = {
- {BLT_SWITCH_CUSTOM, "-filter", "filter",
- Blt_Offset(ResampleSwitches, filter), 0, 0, &filterSwitch},
- {BLT_SWITCH_CUSTOM, "-from", "bbox",
- Blt_Offset(ResampleSwitches, region), 0, 0, &bboxSwitch},
- {BLT_SWITCH_INT, "-width", "int",
- Blt_Offset(ResampleSwitches, width), 0},
- {BLT_SWITCH_INT, "-height", "int",
- Blt_Offset(ResampleSwitches, height), 0},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- PictRegion region;
- int raise;
-} SnapSwitches;
-
-static Blt_SwitchSpec snapSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-region", "bbox",
- Blt_Offset(SnapSwitches, region), 0, 0, &bboxSwitch},
- {BLT_SWITCH_BITMASK, "-raise", "",
- Blt_Offset(SnapSwitches, raise), 0, TRUE},
- {BLT_SWITCH_END}
-};
-
-/*
- * Forward references for TCL command callbacks used below.
- */
-static Tcl_ObjCmdProc PictureInstCmdProc;
-static Tcl_CmdDeleteProc PictureInstCmdDeletedProc;
-
-Blt_Picture
-Blt_GetNthPicture(Blt_Chain chain, size_t index)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_GetNthLink(chain, index);
- if (link == NULL) {
- return NULL;
- }
- return Blt_Chain_GetValue(link);
-}
-
-static Blt_Picture
-PictureFromPictImage(PictImage *imgPtr)
-{
- imgPtr->picture = Blt_GetNthPicture(imgPtr->chain, imgPtr->index);
- return imgPtr->picture;
-}
-
-static void
-ReplacePicture(PictImage *imgPtr, Blt_Picture picture)
-{
- Blt_ChainLink link;
-
- if (imgPtr->chain == NULL) {
- imgPtr->chain = Blt_Chain_Create();
- }
- link = Blt_Chain_GetNthLink(imgPtr->chain, imgPtr->index);
- if (link == NULL) {
- int n;
-
- n = Blt_Chain_GetLength(imgPtr->chain);
- link = Blt_Chain_Append(imgPtr->chain, picture);
- imgPtr->index = n;
- } else {
- Blt_Picture old;
-
- old = Blt_Chain_GetValue(link);
- Blt_FreePicture(old);
- }
- Blt_Chain_SetValue(link, picture);
- imgPtr->picture = picture;
-}
-
-static void
-FreePictures(PictImage *imgPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(imgPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Blt_Picture picture;
-
- picture = Blt_Chain_GetValue(link);
- Blt_FreePicture(picture);
- }
- Blt_Chain_Destroy(imgPtr->chain);
- imgPtr->chain = NULL;
- imgPtr->index = 0;
- imgPtr->picture = NULL;
-}
-
-Blt_Picture
-Blt_GetPictureFromPictureImage(Tcl_Interp *interp, Tk_Image tkImage)
-{
- PictInstance *instancePtr;
-
- if (!Blt_IsPicture(tkImage)) {
- Tcl_AppendResult(interp, "image is not a picture", (char *)NULL);
- return NULL;
- }
- instancePtr = Blt_Image_GetInstanceData(tkImage);
- return PictureFromPictImage(instancePtr->image);
-}
-
-Blt_Picture
-Blt_GetPictureFromPhotoImage(Tcl_Interp *interp, Tk_Image tkImage)
-{
- const char *name;
- Tk_PhotoHandle photo;
-
- name = Blt_Image_Name(tkImage);
- photo = Tk_FindPhoto(interp, name);
- if (photo == NULL) {
- return NULL;
- }
- return Blt_PhotoToPicture(photo);
-}
-
-void
-Blt_NotifyImageChanged(PictImage *imgPtr)
-{
- if (imgPtr->picture != NULL) {
- int w, h;
-
- w = Blt_PictureWidth(imgPtr->picture);
- h = Blt_PictureHeight(imgPtr->picture);
- Tk_ImageChanged(imgPtr->imgToken, 0, 0, w, h, w, h);
- }
-}
-
-Blt_Pixel
-Blt_XColorToPixel(XColor *colorPtr)
-{
- Blt_Pixel new;
-
- /* Convert X Color with 3 channel, 16-bit components to Blt_Pixel
- * (8-bit, with alpha component) */
- new.Red = colorPtr->red / 257;
- new.Green = colorPtr->green / 257;
- new.Blue = colorPtr->blue / 257;
- new.Alpha = ALPHA_OPAQUE;
- return new;
-}
-
-int
-Blt_GetPixel(Tcl_Interp *interp, const char *string, Blt_Pixel *pixelPtr)
-{
- int length;
-
- length = strlen(string);
- if ((string[0] == '0') && (string[1] == 'x')) {
- unsigned int value;
- char *term;
-
- value = strtoul(string + 2, &term, 16);
- if ((term == (string + 1)) || (*term != '\0')) {
- Tcl_AppendResult(interp, "expected color value but got \"", string,
- "\"", (char *) NULL);
- return TCL_ERROR;
- }
- pixelPtr->u32 = value;
- } else {
- XColor color;
- Tk_Window tkwin;
-
- tkwin = Tk_MainWindow(interp);
- if (!XParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), string,
- &color)) {
- Tcl_AppendResult(interp, "unknown color name \"", string, "\"",
- (char *) NULL);
- return TCL_ERROR;
- }
- *pixelPtr = Blt_XColorToPixel(&color);
- }
- return TCL_OK;
-}
-
-int
-Blt_GetPixelFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Blt_Pixel *pixelPtr)
-{
- return Blt_GetPixel(interp, Tcl_GetString(objPtr), pixelPtr);
-}
-
-const char *
-Blt_NameOfPixel(Blt_Pixel *pixelPtr)
-{
- static char string[10];
-
- sprintf_s(string, 10, "%02x%02x%02x%02x", pixelPtr->Alpha,
- pixelPtr->Red, pixelPtr->Green, pixelPtr->Blue);
- return string;
-}
-
-int
-Blt_GetBBoxFromObjv(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv,
- PictRegion *regionPtr)
-{
- double left, top, right, bottom;
-
- if ((objc != 2) && (objc != 4)) {
- Tcl_AppendResult(interp, "wrong # elements in bounding box ",
- (char *)NULL);
- return TCL_ERROR;
- }
- regionPtr->x = regionPtr->y = regionPtr->w = regionPtr->h = 0;
- if ((Tcl_GetDoubleFromObj(interp, objv[0], &left) != TCL_OK) ||
- (Tcl_GetDoubleFromObj(interp, objv[1], &top) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (objc == 2) {
- regionPtr->x = ROUND(left), regionPtr->y = ROUND(top);
- return TCL_OK;
- }
- if ((Tcl_GetDoubleFromObj(interp, objv[2], &right) != TCL_OK) ||
- (Tcl_GetDoubleFromObj(interp, objv[3], &bottom) != TCL_OK)) {
- return TCL_ERROR;
- }
-
- /* Flip the coordinates of the bounding box if necessary so that its the
- * upper-left and lower-right corners */
- if (left > right) {
- double tmp;
-
- tmp = left, left = right, right = tmp;
- }
- if (top > bottom) {
- double tmp;
-
- tmp = top, top = bottom, bottom = tmp;
- }
- top = floor(top), left = floor(left);
- bottom = ceil(bottom), right = ceil(right);
- regionPtr->x = (int)left, regionPtr->y = (int)top;
- regionPtr->w = (int)right - regionPtr->x + 1;
- regionPtr->h = (int)bottom - regionPtr->y + 1;
- return TCL_OK;
-}
-
-static int
-GetBBoxFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, PictRegion *regionPtr)
-{
- int objc;
- Tcl_Obj **objv;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_GetBBoxFromObjv(interp, objc, objv, regionPtr);
-}
-
-int
-Blt_AdjustRegionToPicture(Blt_Picture picture, PictRegion *regionPtr)
-{
- int w, h;
-
- w = Blt_PictureWidth(picture);
- h = Blt_PictureHeight(picture);
-
- if ((regionPtr->w == 0) || (regionPtr->w > w)) {
- regionPtr->w = w;
- }
- if ((regionPtr->h == 0) || (regionPtr->h > h)) {
- regionPtr->h = h;
- }
-
- /* Verify that some part of the bounding box is actually inside the
- * picture. */
- if ((regionPtr->x >= w) || ((regionPtr->x + regionPtr->w) <= 0) ||
- (regionPtr->y >= h) || ((regionPtr->y + regionPtr->h) <= 0)) {
- return FALSE;
- }
- /* If needed, adjust the bounding box so that it resides totally inside the
- * picture */
- if (regionPtr->x < 0) {
- regionPtr->w += regionPtr->x;
- regionPtr->x = 0;
- }
- if (regionPtr->y < 0) {
- regionPtr->h += regionPtr->y;
- regionPtr->y = 0;
- }
- if ((regionPtr->x + regionPtr->w) > w) {
- regionPtr->w = w - regionPtr->x;
- }
- if ((regionPtr->y + regionPtr->h) > h) {
- regionPtr->h = h - regionPtr->y;
- }
- return TRUE;
-}
-
-int
-Blt_ResetPicture(Tcl_Interp *interp, const char *imageName, Blt_Picture picture)
-{
- Tcl_CmdInfo cmdInfo;
-
- if (Tcl_GetCommandInfo(interp, imageName, &cmdInfo)) {
- if (cmdInfo.objProc == PictureInstCmdProc) {
- PictImage *imgPtr;
-
- imgPtr = cmdInfo.objClientData;
- if (imgPtr->picture != picture) {
- ReplacePicture(imgPtr, picture);
- }
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
- }
- }
- Tcl_AppendResult(interp, "can't find picture \"", imageName, "\"",
- (char *)NULL);
- return TCL_ERROR;
-}
-
-#ifdef notdef
-int
-Blt_ResetPictureFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- Blt_Picture picture)
-{
- return Blt_ResetPicture(interp, Tcl_GetString(objPtr), picture);
-}
-#endif
-
-int
-Blt_GetPicture(Tcl_Interp *interp, const char *string, Blt_Picture *picturePtr)
-{
- Tcl_CmdInfo cmdInfo;
-
- if (Tcl_GetCommandInfo(interp, string, &cmdInfo)) {
- if (cmdInfo.objProc == PictureInstCmdProc) {
- PictImage *imgPtr;
-
- imgPtr = cmdInfo.objClientData;
- *picturePtr = imgPtr->picture;
- return TCL_OK;
- }
- }
- Tcl_AppendResult(interp, "can't find picture \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
-}
-
-int
-Blt_GetPictureFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Blt_Picture *pictPtr)
-{
- return Blt_GetPicture(interp, Tcl_GetString(objPtr), pictPtr);
-}
-
-
-static int
-LoadFormat(Tcl_Interp *interp, const char *name)
-{
- Tcl_DString ds;
- const char *result;
-
- Tcl_DStringInit(&ds);
- Tcl_DStringAppend(&ds, "blt_picture_", 12);
- Tcl_DStringAppend(&ds, name, -1);
- strtolower(Tcl_DStringValue(&ds));
-#define EXACT 1
- result = Tcl_PkgRequire(interp, Tcl_DStringValue(&ds), BLT_VERSION, EXACT);
- Tcl_DStringFree(&ds);
- return (result != NULL);
-}
-
-static PictFormat *
-QueryExternalFormat(
- Tcl_Interp *interp, /* Interpreter to load new format
- * into. */
- Blt_DBuffer dbuffer, /* Data to be tested. */
- const char *ext) /* Extension of file name read in. Will
- * be NULL if read from data/base64
- * string. */
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- /*
- * Step 1. Try to match the format to the extension, if there is
- * one. We're trying to minimize the number of formats
- * loaded using a blind query (.i.e. -file fileName).
- */
- if (ext != NULL) {
- hPtr = Blt_FindHashEntry(&fmtTable, ext);
- if (hPtr != NULL) {
- PictFormat *fmtPtr;
-
- fmtPtr = Blt_GetHashValue(hPtr);
-#ifdef notdef
- fprintf(stderr, "trying %s\n", fmtPtr->name);
-#endif
- if ((fmtPtr->flags & BLT_PIC_FMT_LOADED) == 0) {
- LoadFormat(interp, ext);
- }
- if (((fmtPtr->flags & BLT_PIC_FMT_LOADED) == 0) ||
- (fmtPtr->isFmtProc == NULL)) {
- fprintf(stderr, "can't load format %s\n", fmtPtr->name);
- if ((fmtPtr->flags & BLT_PIC_FMT_LOADED) == 0) {
- fprintf(stderr, "not loaded: format %s\n", fmtPtr->name);
- } else if (fmtPtr->isFmtProc == NULL) {
- fprintf(stderr, "no isFmtProc: format %s\n", fmtPtr->name);
- }
- return NULL; /* Could not load the format or the
- * format doesn't have a discovery
- * procedure. */
- }
- if ((*fmtPtr->isFmtProc)(dbuffer)) {
- return fmtPtr;
- }
-#ifdef notdef
- fprintf(stderr, "failed to match %s\n", fmtPtr->name);
-#endif
- /* If the image doesn't match, even though the extension matches,
- * fall through and try all the other formats available. */
- }
- }
- /*
- * Step 2. Try to match the image against all the previously
- * loaded formats.
- */
- for (hPtr = Blt_FirstHashEntry(&fmtTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- PictFormat *fmtPtr;
-
- fmtPtr = Blt_GetHashValue(hPtr);
-#ifdef notdef
- fprintf(stderr, "pass2 trying %s\n", fmtPtr->name);
-#endif
- if ((fmtPtr->flags & BLT_PIC_FMT_LOADED) == 0) {
- continue; /* Format isn't already loaded. */
- }
- if (fmtPtr->isFmtProc == NULL) {
- continue; /* No discover procedure. */
- }
- if ((*fmtPtr->isFmtProc)(dbuffer)) {
- return fmtPtr;
- }
- }
- /*
- * Step 3. Try to match the image against any format not previously loaded.
- */
- for (hPtr = Blt_FirstHashEntry(&fmtTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- PictFormat *fmtPtr;
-
- fmtPtr = Blt_GetHashValue(hPtr);
-#ifdef notdef
- fprintf(stderr, "pass3 trying %s\n", fmtPtr->name);
-#endif
- if (fmtPtr->flags & BLT_PIC_FMT_LOADED) {
- continue; /* Format is already loaded. */
- }
- if (!LoadFormat(interp, fmtPtr->name)) {
- continue; /* Can't load format. */
- }
- if (((fmtPtr->flags & BLT_PIC_FMT_LOADED) == 0) ||
- (fmtPtr->isFmtProc == NULL)) {
- fprintf(stderr, "can't load format %s\n", fmtPtr->name);
- if ((fmtPtr->flags & BLT_PIC_FMT_LOADED) == 0) {
- fprintf(stderr, "not loaded: format %s\n", fmtPtr->name);
- } else if (fmtPtr->isFmtProc == NULL) {
- fprintf(stderr, "no isFmtProc: format %s\n", fmtPtr->name);
- }
- return NULL; /* Could not load the format or the
- * format doesn't have a discovery
- * procedure. */
- }
- if ((*fmtPtr->isFmtProc)(dbuffer)) {
- return fmtPtr;
- }
- }
- return NULL;
-}
-
-static int
-ImageToPicture(Tcl_Interp *interp, PictImage *imgPtr, const char *imageName)
-{
- Blt_Picture picture;
- Tk_PhotoHandle photo;
-
- photo = Tk_FindPhoto(interp, imageName);
- if (photo != NULL) {
- picture = Blt_PhotoToPicture(photo);
- } else if (Blt_GetPicture(interp, imageName, &picture) == TCL_OK) {
- picture = Blt_ClonePicture(picture);
- } else {
- return TCL_ERROR;
- }
- ReplacePicture(imgPtr, picture);
- if (imgPtr->name != NULL) {
- Blt_Free(imgPtr->name);
- }
- imgPtr->name = Blt_AssertStrdup(imageName);
- imgPtr->flags &= ~IMPORTED_MASK;
- imgPtr->flags |= IMPORTED_IMAGE;
- return TCL_OK;
-}
-
-static int
-WindowToPicture(Tcl_Interp *interp, PictImage *imgPtr, Tcl_Obj *objPtr)
-{
- Blt_Picture picture;
- Window window;
- int w, h;
-
- if (Blt_GetWindowFromObj(interp, objPtr, &window) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_GetWindowRegion(imgPtr->display, window, (int *)NULL, (int *)NULL,
- &w, &h) != TCL_OK) {
- Tcl_AppendResult(interp, "can't get dimensions of window \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- /* Depth, visual, colormap */
- picture = Blt_WindowToPicture(imgPtr->display, window, 0, 0, w, h,
- imgPtr->gamma);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "can't obtain snapshot of window \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- ReplacePicture(imgPtr, picture);
- if (imgPtr->name != NULL) {
- Blt_Free(imgPtr->name);
- }
- imgPtr->name = Blt_AssertStrdup(Tcl_GetString(objPtr));
- imgPtr->flags &= ~IMPORTED_MASK;
- imgPtr->flags |= IMPORTED_WINDOW;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToFile --
- *
- * Given a file name, determine the image type and convert into a
- * picture.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToFile(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_Chain chain;
- Blt_DBuffer dbuffer;
- Blt_Picture *picturePtr = (Blt_Picture *)(widgRec + offset);
- Blt_Picture picture;
- PictImage *imgPtr = (PictImage *)widgRec;
- const char *fileName;
- PictFormat *fmtPtr;
- char *ext;
-
- fileName = Tcl_GetString(objPtr);
- if (fileName[0] == '\0') {
- FreePictures(imgPtr);
- if (imgPtr->name != NULL) {
- Blt_Free(imgPtr->name);
- }
- imgPtr->fmtPtr = NULL;
- imgPtr->flags &= ~IMPORTED_MASK;
- return TCL_OK;
- }
- dbuffer = Blt_DBuffer_Create();
- if (Blt_DBuffer_LoadFile(interp, fileName, dbuffer) != TCL_OK) {
- goto error;
- }
- ext = NULL;
- if (fileName[0] != '@') {
- ext = strrchr(fileName, '.');
- if (ext != NULL) {
- ext++;
- if (*ext == '\0') {
- ext = NULL;
- }
- strtolower(ext);
- }
- }
- fmtPtr = QueryExternalFormat(interp, dbuffer, ext);
- if (fmtPtr == NULL) {
- Tcl_AppendResult(interp, "\nunknown image file format in \"", fileName,
- "\"", (char *)NULL);
- goto error;
- }
- if (fmtPtr->readProc == NULL) {
- Tcl_AppendResult(interp, "no reader for format \"", fmtPtr->name, "\".",
- (char *)NULL);
- goto error;
- }
- chain = (*fmtPtr->readProc)(interp, fileName, dbuffer);
- if (chain == NULL) {
- goto error;
- }
- FreePictures(imgPtr);
- imgPtr->chain = chain;
- imgPtr->index = 0;
- imgPtr->picture = Blt_Chain_FirstValue(chain);
- if (imgPtr->name != NULL) {
- Blt_Free(imgPtr->name);
- }
- imgPtr->fmtPtr = fmtPtr;
- imgPtr->name = Blt_AssertStrdup(fileName);
- imgPtr->flags &= ~IMPORTED_MASK;
- imgPtr->flags |= IMPORTED_FILE;
- imgPtr->interval = 0; /* 100 microseconds */
- *picturePtr = picture;
- Blt_DBuffer_Destroy(dbuffer);
- return TCL_OK;
- error:
- Blt_DBuffer_Destroy(dbuffer);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FileToObj --
- *
- * Convert the picture into a TCL list of pixels.
- *
- * Results:
- * The string representation of the picture is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-FileToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- PictImage *imgPtr = (PictImage *)widgRec;
-
- if (((imgPtr->flags & IMPORTED_FILE) == 0) || (imgPtr->name == NULL)) {
- return Tcl_NewStringObj("", -1);
- }
- return Tcl_NewStringObj(imgPtr->name, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToFilter --
- *
- * Given a string name, get the resample filter associated with it.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToFilter(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_ResampleFilter *filterPtr = (Blt_ResampleFilter *)(widgRec + offset);
- const char *string;
-
- string = Tcl_GetString(objPtr);
- if (string[0] == '\0') {
- *filterPtr = NULL;
- return TCL_OK;
- }
- return Blt_GetResampleFilterFromObj(interp, objPtr, filterPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FilterToObj --
- *
- * Convert the picture filter into a string Tcl_Obj.
- *
- * Results:
- * The string representation of the filter is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-FilterToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_ResampleFilter filter = *(Blt_ResampleFilter *)(widgRec + offset);
-
- if (filter == NULL) {
- return Tcl_NewStringObj("", -1);
- }
- return Tcl_NewStringObj(Blt_NameOfResampleFilter(filter), -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToData --
- *
- * Given a string of data or binary Tcl_Obj, determine the image
- * type and convert into a picture.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToData(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_Picture *picturePtr = (Blt_Picture *)(widgRec + offset);
- PictImage *imgPtr = (PictImage *)widgRec;
- const unsigned char *bytes;
- int length, result;
-
- bytes = Tcl_GetByteArrayFromObj(objPtr, &length);
- result = TCL_ERROR;
- if (length == 0) {
- imgPtr->flags &= ~IMPORTED_MASK;
- FreePictures(imgPtr);
- result = TCL_OK;
- } else {
- Blt_DBuffer dbuffer;
- size_t nBytes;
- PictFormat *fmtPtr;
- Blt_Chain chain;
-
- nBytes = (size_t)length;
- dbuffer = Blt_DBuffer_Create();
- if (Blt_IsBase64(bytes, nBytes)) {
- if (Blt_DBuffer_DecodeBase64(interp, (const char *)bytes,
- nBytes, dbuffer) != TCL_OK) {
- goto error;
- }
- } else {
- Blt_DBuffer_AppendData(dbuffer, bytes, nBytes);
- }
-#ifdef notdef
- {
- FILE *f;
-
- f = fopen("junk.unk", "w");
- fwrite(Blt_DBuffer_Bytes(dbuffer), 1, Blt_DBuffer_Length(dbuffer), f);
- fclose(f);
- }
-#endif
- fmtPtr = QueryExternalFormat(interp, dbuffer, NULL);
- if (fmtPtr == NULL) {
- Tcl_AppendResult(interp, "unknown image file format in \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- goto error;
- }
- if (fmtPtr->readProc == NULL) {
- Tcl_AppendResult(interp, "no reader for format \"", fmtPtr->name,
- "\".", (char *)NULL);
- goto error;
- }
- chain = (*fmtPtr->readProc)(interp, "-data", dbuffer);
- if (chain == NULL) {
- goto error;
- }
- result = TCL_OK;
- error:
- imgPtr->flags &= ~IMPORTED_MASK;
- FreePictures(imgPtr);
- if (result == TCL_OK) {
- imgPtr->chain = chain;
- imgPtr->fmtPtr = fmtPtr;
- imgPtr->picture = Blt_Chain_FirstValue(chain);
- imgPtr->flags |= IMPORTED_DATA;
- }
- Blt_DBuffer_Destroy(dbuffer);
- }
- *picturePtr = imgPtr->picture;
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DataToObj --
- *
- * Convert the picture into a TCL list of pixels.
- *
- * Results:
- * The string representation of the picture is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-DataToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- PictImage *imgPtr = (PictImage *)(widgRec);
- PictFormat *fmtPtr;
-
- if (((imgPtr->flags & IMPORTED_DATA) == 0) || (imgPtr->picture == NULL)) {
- return Tcl_NewStringObj("", -1);
- }
- fmtPtr = imgPtr->fmtPtr;
- if (fmtPtr == NULL) {
- Tcl_AppendResult(interp, "image \"", imgPtr->name,
- "\" has no assigned format.", (char *)NULL);
- Tcl_BackgroundError(interp);
- return Tcl_NewStringObj("", -1);
- }
- if (fmtPtr->writeProc == NULL) {
- Tcl_AppendResult(interp, "no write procedure for format \"",
- fmtPtr->name, "\".", (char *)NULL);
- Tcl_BackgroundError(interp);
- return Tcl_NewStringObj("", -1);
- }
- return (*fmtPtr->writeProc)(interp, imgPtr->picture);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToImage --
- *
- * Convert a named image into a picture.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToImage(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- PictImage *imgPtr = (PictImage *)(widgRec);
-
- return ImageToPicture(interp, imgPtr, Tcl_GetString(objPtr));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImageToObj --
- *
- * Convert the named image into a picture.
- *
- * Results:
- * The string representation of the picture is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ImageToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- PictImage *imgPtr = (PictImage *)widgRec;
-
- if (((imgPtr->flags & IMPORTED_IMAGE) == 0) || (imgPtr->name == NULL)) {
- return Tcl_NewStringObj("", -1);
- }
- return Tcl_NewStringObj(imgPtr->name, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToWindow --
- *
- * Given a file name, determine the image type and convert
- * into a picture.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToWindow(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- PictImage *imgPtr = (PictImage *)(widgRec);
-
- return WindowToPicture(interp, imgPtr, objPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WindowToObj --
- *
- * Convert the picture into a TCL list of pixels.
- *
- * Results:
- * The string representation of the picture is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-WindowToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- PictImage *imgPtr = (PictImage *)widgRec;
-
- if (((imgPtr->flags & IMPORTED_WINDOW) == 0) || (imgPtr->name == NULL)) {
- return Tcl_NewStringObj("", -1);
- }
- return Tcl_NewStringObj(imgPtr->name, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CacheKey --
- *
- * Returns a key representing a specific visual context for a PictImage.
- * Keys are used to create/find cache entries stored in the hash table of
- * each PictImage.
- *
- * Results:
- * A pointer to a static cache key.
- *
- * Side effects:
- * The key is overwritten on each call. Care must be taken by the caller
- * to save the key before making additional calls.
- *
- *---------------------------------------------------------------------------
- */
-static PictCacheKey *
-CacheKey(Tk_Window tkwin, unsigned int index)
-{
- static PictCacheKey key;
-
- key.display = Tk_Display(tkwin);
- key.visualPtr = Tk_Visual(tkwin);
- key.colormap = Tk_Colormap(tkwin);
- key.depth = Tk_Depth(tkwin);
- key.index = index;
- return &key;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyCache --
- *
- * This procedure is a callback for Tcl_EventuallyFree to release the
- * resources and memory used by a PictInstance entry. The entry is
- * destroyed only if noone else is currently using the entry (using
- * reference counting).
- *
- * Results:
- * None.
- *
- * Side effects:
- * The cache entry is possibly deallocated.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyCache(DestroyData data)
-{
- PictInstance *cachePtr = (PictInstance *)data;
-
- if (cachePtr->refCount <= 0) {
- if (cachePtr->pixmap != None) {
- Tk_FreePixmap(cachePtr->display, cachePtr->pixmap);
- }
- if (cachePtr->painter != NULL) {
- Blt_FreePainter(cachePtr->painter);
- }
- if (cachePtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(cachePtr->tablePtr, cachePtr->hashPtr);
- }
- Blt_Free(cachePtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetPictInstance --
- *
- * This procedure is called for each use of a picture image in a widget.
- *
- * Results:
- * The return value is an entry for the visual context, which will be
- * passed back to us on calls to DisplayPictureImage and
- * FreePictInstance.
- *
- * Side effects:
- * A new entry is possibly allocated (or shared if one already exists).
- *
- *---------------------------------------------------------------------------
- */
-static ClientData
-GetPictInstance(
- Tk_Window tkwin, /* Window in which the picture will be
- * displayed. */
- ClientData clientData) /* Pointer to picture image for the
- * image. */
-{
- Blt_HashEntry *hPtr;
- PictCacheKey *keyPtr;
- PictImage *imgPtr = clientData;
- PictInstance *cachePtr;
- int isNew;
-
- keyPtr = CacheKey(tkwin, imgPtr->index);
- hPtr = Blt_CreateHashEntry(&imgPtr->cacheTable, (char *)keyPtr, &isNew);
- if (isNew) {
- cachePtr = Blt_Malloc(sizeof(PictInstance));
- if (cachePtr == NULL) {
- return NULL; /* Can't allocate memory. */
- }
- cachePtr->painter = Blt_GetPainter(tkwin, imgPtr->gamma);
- cachePtr->image = imgPtr;
- cachePtr->display = Tk_Display(tkwin);
- cachePtr->pixmap = None;
- cachePtr->hashPtr = hPtr;
- cachePtr->tablePtr = &imgPtr->cacheTable;
- cachePtr->refCount = 0;
- cachePtr->flags = 0;
- Blt_SetHashValue(hPtr, cachePtr);
-
- if (imgPtr->picture != NULL) {
- Blt_NotifyImageChanged(imgPtr);
- }
- }
- cachePtr = Blt_GetHashValue(hPtr);
- cachePtr->refCount++;
- return cachePtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreePictInstance --
- *
- * This procedure is called when a widget ceases to use a particular
- * instance of a picture image. We don't actually get rid of the entry
- * until later because we may be about to re-get this instance again.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Internal data structures get freed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-FreePictInstance(
- ClientData clientData, /* Pointer to cache structure */
- Display *display) /* Not used. */
-{
- PictInstance *cachePtr = clientData;
-
- cachePtr->refCount--;
- if (cachePtr->refCount <= 0) {
- /*
- * Right now no one is using the entry. But delay the removal of the
- * cache entry in case it's reused shortly afterwards.
- */
- Tcl_EventuallyFree(cachePtr, DestroyCache);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeletePictureImage --
- *
- * This procedure is called by the Tk image code to delete the master
- * structure (PictureImage) for a picture image.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Resources associated with the picture image are freed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DeletePictureImage(
- ClientData clientData) /* Pointer to picture image master
- * structure for image. Must not have
- * any more instances. */
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- PictImage *imgPtr = clientData;
-
- for (hPtr = Blt_FirstHashEntry(&imgPtr->cacheTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- PictInstance *cachePtr;
-
- cachePtr = Blt_GetHashValue(hPtr);
- cachePtr->hashPtr = NULL; /* Flag for FreePictInstance. */
- DestroyCache((DestroyData)cachePtr);
- }
- imgPtr->imgToken = NULL;
- if (imgPtr->cmdToken != NULL) {
- Tcl_DeleteCommandFromToken(imgPtr->interp, imgPtr->cmdToken);
- }
- Blt_DeleteHashTable(&imgPtr->cacheTable);
- Blt_FreeOptions(configSpecs, (char *)imgPtr, imgPtr->display, 0);
- if (imgPtr->chain != NULL) {
- FreePictures(imgPtr);
- }
- if (imgPtr->timerToken != (Tcl_TimerToken)0) {
- Tcl_DeleteTimerHandler(imgPtr->timerToken);
- imgPtr->timerToken = 0;
- }
- Blt_Free(imgPtr);
-}
-
-static int
-ConfigurePictureImage(Tcl_Interp *interp, PictImage *imgPtr, int objc,
- Tcl_Obj *const *objv, int flags)
-{
- int w, h;
-
- if (Blt_ConfigureWidgetFromObj(interp, Tk_MainWindow(interp), configSpecs,
- objc, objv, (char *)imgPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- imgPtr->picture = PictureFromPictImage(imgPtr);
- if (imgPtr->picture == NULL) {
- w = (imgPtr->reqWidth == 0) ? 16 : imgPtr->reqWidth;
- h = (imgPtr->reqHeight == 0) ? 16 : imgPtr->reqHeight;
- ReplacePicture(imgPtr, Blt_CreatePicture(w, h));
- }
- if (Blt_ConfigModified(configSpecs, "-autoscale", (char *)NULL)) {
- if (imgPtr->original != NULL) {
- Blt_FreePicture(imgPtr->original);
- imgPtr->original = NULL;
- }
- if ((imgPtr->autoscale) && (imgPtr->picture != NULL)) {
- imgPtr->original = Blt_ClonePicture(imgPtr->picture);
- }
- }
- if (imgPtr->angle != 0.0) {
- Blt_Picture rotate;
-
- /* Rotate the picture */
- rotate = Blt_RotatePicture(imgPtr->picture, imgPtr->angle);
- ReplacePicture(imgPtr, rotate);
- }
-
- w = (imgPtr->reqWidth == 0) ?
- Blt_PictureWidth(imgPtr->picture) : imgPtr->reqWidth;
- h = (imgPtr->reqHeight == 0) ?
- Blt_PictureHeight(imgPtr->picture) : imgPtr->reqHeight;
-
- if (imgPtr->maxpect) {
- double sx, sy, scale;
-
- sx = (double)w / (double)Blt_PictureWidth(imgPtr->picture);
- sy = (double)h / (double)Blt_PictureHeight(imgPtr->picture);
- scale = MIN(sx, sy);
- w = (int)(Blt_PictureWidth(imgPtr->picture) * scale + 0.5);
- h = (int)(Blt_PictureHeight(imgPtr->picture) * scale + 0.5);
- }
- if ((Blt_PictureWidth(imgPtr->picture) != w) ||
- (Blt_PictureHeight(imgPtr->picture) != h)) {
- if (imgPtr->autoscale) {
- Blt_Picture resize;
-
- /* Scale the picture */
- if (imgPtr->filter == NULL) {
- resize = Blt_ScalePicture(imgPtr->original, 0, 0,
- Blt_PictureWidth(imgPtr->original),
- Blt_PictureHeight(imgPtr->original), w, h);
- } else {
- resize = Blt_CreatePicture(w, h);
- Blt_ResamplePicture(resize, imgPtr->original, imgPtr->filter,
- imgPtr->filter);
- }
- ReplacePicture(imgPtr, resize);
- } else {
- Blt_ResizePicture(imgPtr->picture, w, h);
- }
- }
- if (imgPtr->sharpen > 0) {
- Blt_SharpenPicture(imgPtr->picture, imgPtr->picture);
- }
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreatePictureImage --
- *
- * This procedure is called by the Tk image code to create a new picture
- * image.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * The data structure for a new picture image is allocated and initialized.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreatePictureImage(
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to. */
- char *name, /* Name to use for image command. */
- int objc, /* # of option arguments. */
- Tcl_Obj *const *objv, /* Option arguments (doesn't include
- * image name or type). */
- Tk_ImageType *typePtr, /* Not used. */
- Tk_ImageMaster imgToken, /* Token for image, to be used by us in
- * later callbacks. */
- ClientData *clientDataPtr) /* Store manager's token for image here;
- * it will be returned in later
- * callbacks. */
-{
- PictImage *imgPtr;
- Tk_Window tkwin;
-
- /*
- * Allocate and initialize the picture image master record.
- */
-
- imgPtr = Blt_AssertCalloc(1, sizeof(PictImage));
- imgPtr->imgToken = imgToken;
- imgPtr->interp = interp;
- imgPtr->gamma = 1.0f;
- imgPtr->cmdToken = Tcl_CreateObjCommand(interp, name, PictureInstCmdProc,
- imgPtr, PictureInstCmdDeletedProc);
- imgPtr->maxpect = FALSE;
- imgPtr->dither = 2;
- tkwin = Tk_MainWindow(interp);
- imgPtr->display = Tk_Display(tkwin);
- imgPtr->colormap = Tk_Colormap(tkwin);
-#ifdef notdef
- imgPtr->typePtr = typePtr;
-#endif
- Blt_InitHashTable(&imgPtr->cacheTable, sizeof(PictCacheKey)/sizeof(int));
-
- /*
- * Process configuration options given in the image create command.
- */
- if (ConfigurePictureImage(interp, imgPtr, objc, objv, 0) != TCL_OK) {
- DeletePictureImage(imgPtr);
- return TCL_ERROR;
- }
- *clientDataPtr = imgPtr;
- Tcl_SetStringObj(Tcl_GetObjResult(interp), name, -1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayPictureImage --
- *
- * This procedure is invoked to draw a picture image.
- *
- * Results:
- * None.
- *
- * Side effects:
- * A portion of the image gets rendered in a pixmap or window.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayPictureImage(
- ClientData clientData, /* Pointer to token structure for the
- * picture to be displayed. */
- Display *display, /* Display on which to draw
- * picture. */
- Drawable drawable, /* Pixmap or window in which to draw
- * image. */
- int x, int y, /* Upper-left corner of region within
- * image to draw. */
- int w, int h, /* Dimension of region within image to
- * draw. */
- int dx, int dy) /* Coordinates within destination
- * drawable that correspond to imageX
- * and imageY. */
-{
- PictInstance *instPtr = clientData;
- PictImage *imgPtr;
- Blt_Picture picture;
-
- imgPtr = instPtr->image;
-
- picture = PictureFromPictImage(imgPtr);
- if (picture == NULL) {
- return;
- }
- if ((instPtr->pixmap != None) && (Blt_PictureIsDirty(picture))) {
- Tk_FreePixmap(display, instPtr->pixmap);
- instPtr->pixmap = None;
- }
- if ((imgPtr->doCache) && (Blt_PictureIsOpaque(picture))) {
- if (instPtr->pixmap == None) {
- Pixmap pixmap;
-
- /* Save the entire picture in the pixmap. */
- pixmap = Tk_GetPixmap(display, drawable,
- Blt_PictureWidth(picture),
- Blt_PictureHeight(picture),
- Blt_PainterDepth(instPtr->painter));
- Blt_PaintPicture(instPtr->painter, drawable, picture,
- 0, 0, Blt_PictureWidth(picture),
- Blt_PictureHeight(picture),
- 0, 0, imgPtr->dither);
- instPtr->pixmap = pixmap;
- }
- /* Draw only the area that need to be repaired. */
- XCopyArea(display, instPtr->pixmap, drawable,
- Blt_PainterGC(instPtr->painter), x, y, (unsigned int)w,
- (unsigned int)h, dx, dy);
- } else {
- unsigned int flags;
-
- if (instPtr->pixmap != None) {
- /* Kill the cached pixmap. */
- Tk_FreePixmap(display, instPtr->pixmap);
- instPtr->pixmap = None;
- }
- flags = 0;
- if ((imgPtr->dither == 1) || ((imgPtr->dither == 2) &&
- (Blt_PainterDepth(instPtr->painter) < 15))) {
- flags |= BLT_PAINTER_DITHER;
- }
- Blt_PaintPicture(instPtr->painter, drawable, picture,
- x, y, w, h, dx, dy, flags);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictureImageToPostScript --
- *
- * This procedure is called to output the contents of a picture image in
- * PostScript by calling the Tk_PostscriptPhoto function.
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PictureImageToPostScript(
- ClientData clientData, /* Master picture image. */
- Tcl_Interp *interp, /* Interpreter to return generated
- * PostScript. */
- Tk_Window tkwin,
- Tk_PostscriptInfo psInfo, /* Not used. Only useful for Tk
- * internal Photo and Bitmap image
- * types. */
- int x, int y, /* First pixel to output */
- int w, int h, /* Width and height of picture area */
- int prepass)
-{
- PictImage *imgPtr = clientData;
-
- if (prepass) {
- return TCL_OK;
- }
- if (Blt_PictureIsOpaque(imgPtr->picture)) {
- Blt_Ps ps;
- PageSetup setup;
-
- memset(&setup, 0, sizeof(setup));
- ps = Blt_Ps_Create(interp, &setup);
- Blt_Ps_DrawPicture(ps, imgPtr->picture, (double)x, (double)y);
- Blt_Ps_SetInterp(ps, interp);
- Blt_Ps_Free(ps);
- } else {
- Blt_HashEntry *hPtr;
- Blt_Picture bg;
- Blt_Ps ps;
- Drawable drawable;
- PageSetup setup;
- PictInstance *instPtr;
- PictCacheKey *keyPtr;
-
- instPtr = NULL;
- keyPtr = CacheKey(tkwin, imgPtr->index);
- hPtr = Blt_FindHashEntry(&imgPtr->cacheTable,(char *)keyPtr);
- if (hPtr != NULL) {
- instPtr = Blt_GetHashValue(hPtr);
- }
- if ((instPtr != NULL) && (instPtr->pixmap != None)) {
- drawable = instPtr->pixmap;
- } else {
- drawable = Tk_WindowId(tkwin);
- }
- bg = Blt_DrawableToPicture(tkwin, drawable, x, y, w, h, imgPtr->gamma);
- if (bg == NULL) {
- return TCL_ERROR;
- }
- Blt_BlendPictures(bg, imgPtr->picture, 0, 0, w, h, 0, 0);
-
- memset(&setup, 0, sizeof(setup));
- ps = Blt_Ps_Create(interp, &setup);
- Blt_Ps_DrawPicture(ps, bg, (double)x, (double)y);
- Blt_Ps_SetInterp(ps, interp);
- Blt_Ps_Free(ps);
- Blt_FreePicture(bg);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BBoxSwitch --
- *
- * Convert a Tcl_Obj list of 2 or 4 numbers into representing a bounding
- * box structure.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BBoxSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- PictRegion *regionPtr = (PictRegion *)(record + offset);
-
- if (GetBBoxFromObj(interp, objPtr, regionPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FilterSwitch --
- *
- * Convert a Tcl_Obj representing a 1D image filter.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-FilterSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_ResampleFilter *filterPtr = (Blt_ResampleFilter *)(record + offset);
-
- return Blt_GetResampleFilterFromObj(interp, objPtr, filterPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BlendingModeSwitch --
- *
- * Convert a Tcl_Obj representing a blending mode.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BlendingModeSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_BlendingMode *modePtr = (Blt_BlendingMode *)(record + offset);
- const char *string;
- int length;
- char c;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'n') && (strncmp(string, "normal", length) == 0)) {
- *modePtr = BLT_BLEND_NORMAL;
- } else if ((c == 'm') && (strncmp(string, "multiply", length) == 0)) {
- *modePtr = BLT_BLEND_MULTIPLY;
- } else if ((c == 's') && (strncmp(string, "screen", length) == 0)) {
- *modePtr = BLT_BLEND_SCREEN;
- } else if ((c == 'd') && (length > 1) &&
- (strncmp(string, "darken", length) == 0)) {
- *modePtr = BLT_BLEND_DARKEN;
- } else if ((c == 'l') && (strncmp(string, "lighten", length) == 0)) {
- *modePtr = BLT_BLEND_LIGHTEN;
- } else if ((c == 'd') && (length > 1) &&
- (strncmp(string, "difference", length) == 0)) {
- *modePtr = BLT_BLEND_DIFFERENCE;
- } else if ((c == 'h') && (strncmp(string, "hardlight", length) == 0)) {
- *modePtr = BLT_BLEND_HARDLIGHT;
- } else if ((c == 's') && (strncmp(string, "softlight", length) == 0)) {
- *modePtr = BLT_BLEND_SOFTLIGHT;
- } else if ((c == 'c') && (length > 5) &&
- (strncmp(string, "colordodge", length) == 0)) {
- *modePtr = BLT_BLEND_COLORDODGE;
- } else if ((c == 'c') && (length > 5) &&
- (strncmp(string, "colorburn", length) == 0)) {
- *modePtr = BLT_BLEND_COLORBURN;
- } else if ((c == 'o') && (strncmp(string, "overlay", length) == 0)) {
- *modePtr = BLT_BLEND_OVERLAY;
- } else {
- Tcl_AppendResult(interp, "unknown blending mode \"", string, "\": ",
- "should be normal, mulitply, screen, darken, lighten, ",
- "or difference", (char *) NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShapeSwitch --
- *
- * Convert a Tcl_Obj representing a gradient shape.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ShapeSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_GradientShape *shapePtr = (Blt_GradientShape *)(record + offset);
- const char *string, **p;
- int shape;
- static const char *gradientShapes[] = {
- "linear",
- "bilinear",
- "radial",
- "rectangular",
- NULL
- };
- string = Tcl_GetString(objPtr);
- for (shape = 0, p = gradientShapes; *p != NULL; p++, shape++) {
- if (strcmp(string, *p) == 0) {
- *shapePtr = (Blt_GradientShape)shape;
- return TCL_OK;
- }
- }
- Tcl_AppendResult(interp, "unknown gradient type \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PathSwitch --
- *
- * Convert a Tcl_Obj representing a gradient path.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PathSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_GradientPath *pathPtr = (Blt_GradientPath *)(record + offset);
- const char *string, **p;
- int path;
- static const char *gradientPaths[] = {
- "x", "y", "xy", "yx", NULL
- };
-
- string = Tcl_GetString(objPtr);
- for (path = 0, p = gradientPaths; *p != NULL; p++, path++) {
- if (strcmp(string, *p) == 0) {
- *pathPtr = (Blt_GradientPath)path;
- return TCL_OK;
- }
- }
- Tcl_AppendResult(interp, "unknown gradient type \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
-}
-
-static Blt_Picture
-NextImage(PictImage *imgPtr)
-{
- Blt_Picture picture;
-
- imgPtr->index++;
- if (imgPtr->index >= Blt_Chain_GetLength(imgPtr->chain)) {
- imgPtr->index = 0;
- }
- picture = PictureFromPictImage(imgPtr);
- Blt_NotifyImageChanged(imgPtr);
- return picture;
-}
-
-static void
-TimerProc(ClientData clientData)
-{
- PictImage *imgPtr = clientData;
- Blt_Picture picture;
- int delay;
-
- picture = NextImage(imgPtr);
- delay = Blt_PictureDelay(imgPtr->picture);
- if (imgPtr->interval > 0) {
- delay = imgPtr->interval;
- }
- imgPtr->timerToken = Tcl_CreateTimerHandler(delay, TimerProc, imgPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ArithOp --
- *
- * $image arith op $src -from { 0 0 100 100 } -to { 0 0 }
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ArithOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_Picture src, mask;
- Blt_PictureArithOps op;
- PictImage *imgPtr = clientData;
- Blt_Pixel scalar;
- const char *string;
- char c;
- int len;
- ArithSwitches switches;
-
- src = NULL;
- string = Tcl_GetString(objv[2]);
- if ((string[0] == '0') && (string[1] == 'x')) {
- if (Blt_GetPixel(interp, string, &scalar) != TCL_OK) {
- return TCL_ERROR;
- }
- } else if (Blt_GetPicture(interp, string, &src) != TCL_OK) {
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[1], &len);
- op = 0;
- c = string[0];
- if ((c == 'a') && (len > 1) && (strncmp(string, "add", len) == 0)) {
- op = PIC_ARITH_ADD;
- } else if ((c == 's') && (strncmp(string, "subtract", len) == 0)) {
- op = PIC_ARITH_SUB;
- } else if ((c == 'a') && (len > 1) && (strncmp(string, "and", len) == 0)) {
- op = PIC_ARITH_AND;
- } else if ((c == 'o') && (strncmp(string, "or", len) == 0)) {
- op = PIC_ARITH_OR;
- } else if ((c == 'n') && (len > 1) && (strncmp(string, "nand", len) == 0)) {
- op = PIC_ARITH_NAND;
- } else if ((c == 'n') && (len > 1) && (strncmp(string, "nor", len) == 0)) {
- op = PIC_ARITH_NOR;
- } else if ((c == 'x') && (strncmp(string, "xor", len) == 0)) {
- op = PIC_ARITH_XOR;
- } else if ((c == 'm') && (len > 1) && (strncmp(string, "max", len) == 0)) {
- op = PIC_ARITH_MAX;
- } else if ((c == 'm') && (len > 1) && (strncmp(string, "min", len) == 0)) {
- op = PIC_ARITH_MIN;
- }
-
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, arithSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- mask = NULL;
- if (switches.maskObjPtr != NULL) {
- if (Blt_GetPictureFromObj(interp, switches.maskObjPtr, &mask)!=TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (mask == NULL) {
- if (src == NULL) {
- Blt_ApplyScalarToPicture(imgPtr->picture, &scalar, op);
- } else {
- Blt_ApplyPictureToPicture(imgPtr->picture, src,
- 0, 0,
- Blt_PictureWidth(src),
- Blt_PictureHeight(src),
- 0, 0,
- op);
- }
- } else {
- if (src == NULL) {
- Blt_ApplyScalarToPictureWithMask(imgPtr->picture, &scalar, mask,
- switches.invert, op);
- } else {
- Blt_ApplyPictureToPictureWithMask(imgPtr->picture, src, mask,
- 0, 0,
- Blt_PictureWidth(src),
- Blt_PictureHeight(src),
- 0, 0,
- switches.invert, op);
- }
- }
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BlankOp --
- *
- * Resets the picture at its current size to blank (by default
- * white, fully opaque) pixels.
- *
- * $image blank -color #000000 -region { 0 0 20 20 }
- * Results:
- * Returns a standard TCL return value. If an error occured parsing
- * the pixel.
- *
- *
- * Side effects:
- * A Tk_ImageChanged notification is triggered.
- *
- *---------------------------------------------------------------------------
- */
-static int
-BlankOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- PictImage *imgPtr = clientData;
- Blt_Pixel bg;
-
- bg.u32 = 0x00000000;
- if ((objc == 3) && (Blt_GetPixelFromObj(interp, objv[2], &bg)!= TCL_OK)) {
- return TCL_ERROR;
- }
- Blt_BlankPicture(imgPtr->picture, &bg);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BlendOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BlendOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- BlendSwitches switches;
- Blt_Picture fg, bg, tmp;
- PictImage *imgPtr = clientData;
- Blt_Picture dest;
-
- fprintf(stderr, "calling BlendOp\n");
- if ((Blt_GetPictureFromObj(interp, objv[2], &bg) != TCL_OK) ||
- (Blt_GetPictureFromObj(interp, objv[3], &fg) != TCL_OK)) {
- return TCL_ERROR;
- }
- switches.mode = BLT_BLEND_NORMAL;
- switches.from.x = switches.from.y = 0;
- switches.from.w = Blt_PictureWidth(bg);
- switches.from.h = Blt_PictureHeight(bg);
- switches.to.x = switches.to.y = 0;
- switches.to.w = Blt_PictureWidth(bg);
- switches.to.h = Blt_PictureHeight(bg);
- if (Blt_ParseSwitches(interp, blendSwitches, objc - 4, objv + 4,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- dest = PictureFromPictImage(imgPtr);
- tmp = NULL;
- if (dest == fg) {
- fg = tmp = Blt_ClonePicture(fg);
- }
- if (dest != bg) {
- Blt_ResizePicture(dest, Blt_PictureWidth(bg), Blt_PictureHeight(bg));
- Blt_CopyPictureBits(dest, bg, 0, 0,
- Blt_PictureWidth(bg), Blt_PictureHeight(bg), 0, 0);
- }
- fprintf(stderr, "from=%d,%d %dx%d to=%d,%d\n",
- switches.from.x, switches.from.y,
- switches.from.w, switches.from.h,
- switches.to.x, switches.to.y);
-
- Blt_BlendPictures(dest, fg,
- switches.from.x, switches.from.y,
- switches.from.w, switches.from.h,
- switches.to.x, switches.to.y);
- if (tmp != NULL) {
- Blt_FreePicture(bg);
- }
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blend2Op --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-Blend2Op(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_Picture fg, bg, dest;
- BlendSwitches switches;
- PictImage *imgPtr = clientData;
-
- if ((Blt_GetPictureFromObj(interp, objv[2], &bg) != TCL_OK) ||
- (Blt_GetPictureFromObj(interp, objv[3], &fg) != TCL_OK)) {
- return TCL_ERROR;
- }
- switches.mode = BLT_BLEND_NORMAL;
- if (Blt_ParseSwitches(interp, blendSwitches, objc - 4, objv + 4,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- dest = PictureFromPictImage(imgPtr);
- Blt_ResizePicture(dest, Blt_PictureWidth(bg), Blt_PictureHeight(bg));
- Blt_CopyPictureBits(dest, bg, 0, 0, Blt_PictureWidth(bg),
- Blt_PictureHeight(bg), 0, 0);
- Blt_BlendPicturesByMode(dest, fg, switches.mode);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BlurOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BlurOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_Picture src, dest;
- PictImage *imgPtr;
- int r; /* Radius of the blur. */
-
- if (Blt_GetPictureFromObj(interp, objv[2], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tcl_GetIntFromObj(interp, objv[3], &r) != TCL_OK) {
- return TCL_ERROR;
- }
- if (r < 1) {
- Tcl_AppendResult(interp, "radius of blur must be > 1 pixel wide",
- (char *)NULL);
- return TCL_ERROR;
- }
- imgPtr = clientData;
- dest = PictureFromPictImage(imgPtr);
- Blt_BlurPicture(dest, src, r);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Returns the value of the configuration option specified.
- *
- * Results:
- * Returns a standard TCL return value. If TCL_OK, the value of the
- * picture configuration option specified is returned in the interpreter
- * result. Otherwise an error message is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CgetOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- PictImage *imgPtr = clientData;
-
- return Blt_ConfigureValueFromObj(interp, Tk_MainWindow(interp), configSpecs,
- (char *)imgPtr, objv[2], 0);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- PictImage *imgPtr;
- Tk_Window tkwin;
- unsigned int flags;
-
- flags = BLT_CONFIG_OBJV_ONLY;
- tkwin = Tk_MainWindow(interp);
- imgPtr = clientData;
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, tkwin, configSpecs,
- (char *)imgPtr, (Tcl_Obj *)NULL, flags);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, tkwin, configSpecs,
- (char *)imgPtr, objv[2], flags);
- } else {
- if (ConfigurePictureImage(interp, imgPtr, objc - 2, objv + 2, flags)
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConvolveOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ConvolveOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_Picture src;
- ConvolveSwitches switches;
- PictImage *imgPtr = clientData;
-
- if (Blt_GetPictureFromObj(interp, objv[2], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- switches.vFilter = bltBoxFilter;
- switches.hFilter = bltBoxFilter;
- switches.filter = NULL;
- if (Blt_ParseSwitches(interp, convolveSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (switches.filter != NULL) {
- switches.hFilter = switches.vFilter = switches.filter;
- }
-#ifdef notdef
- dest = PictureFromPictImage(imgPtr);
- Blt_ConvolvePicture(dest, src, switches.vFilter, switches.hFilter);
-#endif
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CopyOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CopyOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- Blt_Picture src, dest;
- CopySwitches switches;
- PictImage *imgPtr;
-
- if (Blt_GetPictureFromObj(interp, objv[2], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- switches.from.x = switches.from.y = 0;
- switches.from.w = Blt_PictureWidth(src);
- switches.from.h = Blt_PictureHeight(src);
- switches.to.x = switches.to.y = 0;
- switches.to.w = Blt_PictureWidth(src);
- switches.to.h = Blt_PictureHeight(src);
- switches.blend = FALSE;
-
- if (Blt_ParseSwitches(interp, copySwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (!Blt_AdjustRegionToPicture(src, &switches.from)) {
- return TCL_OK; /* Region is not inside of source. */
- }
- imgPtr = clientData;
- dest = PictureFromPictImage(imgPtr);
- if (!Blt_AdjustRegionToPicture(dest, &switches.to)) {
- return TCL_OK; /* Region is not inside of
- * destination. */
- }
- if (switches.blend) {
- Blt_BlendPictures(dest, src, switches.from.x,
- switches.from.y, switches.from.w, switches.from.h,
- switches.to.x, switches.to.y);
- } else {
- Blt_CopyPictureBits(dest, src, switches.from.x,
- switches.from.y, switches.from.w, switches.from.h,
- switches.to.x, switches.to.y);
- }
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CropOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CropOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- PictRegion region;
- Blt_Picture src, dest;
- PictImage *imgPtr;
-
- if (Blt_GetBBoxFromObjv(interp, objc - 2, objv + 2, ®ion) != TCL_OK) {
- return TCL_ERROR;
- }
- imgPtr = clientData;
- src = PictureFromPictImage(imgPtr);
- if (!Blt_AdjustRegionToPicture(src, ®ion)) {
- Tcl_AppendResult(interp, "impossible coordinates for region",
- (char *)NULL);
- return TCL_ERROR;
- }
- dest = Blt_CreatePicture(region.w, region.h);
- Blt_CopyPictureBits(dest, src, region.x, region.y, region.w, region.h, 0,0);
- ReplacePicture(imgPtr, dest);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-BLT_EXTERN Blt_OpSpec bltPictDrawOps[];
-BLT_EXTERN int bltPictDrawNOps;
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DrawOp(
- ClientData clientData, /* Contains reference to picture
- * object. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- PictImage *imgPtr = clientData;
- Blt_Picture picture;
- PictCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, bltPictDrawNOps, bltPictDrawOps,
- BLT_OP_ARG2, objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- picture = PictureFromPictImage(imgPtr);
- result = (*proc) (picture, interp, objc, objv);
- if (result == TCL_OK) {
- Blt_NotifyImageChanged(imgPtr);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DupOp --
- *
- * Creates a duplicate of the current picture in a new picture image. The
- * name of the new image is returned.
- *
- * Results:
- * Returns a standard TCL return value. If TCL_OK, The name of
- * the new image command is returned via the interpreter result.
- * Otherwise an error message is returned.
- *
- * Side effects:
- * A new image command is created.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DupOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- Blt_Picture picture;
- DupSwitches switches;
- PictImage *imgPtr = clientData;
- Tcl_Obj *objPtr;
-
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, dupSwitches, objc - 2, objv + 2, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (!Blt_AdjustRegionToPicture(imgPtr->picture, &switches.region)) {
- Tcl_AppendResult(interp, "impossible coordinates for region",
- (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * Create a new picture image. Let Tk automatically generate the command
- * name.
- */
- if (Tcl_Eval(interp, "image create picture") != TCL_OK) {
- return TCL_ERROR;
- }
- /* The interpreter result now contains the name of the image. */
- objPtr = Tcl_GetObjResult(interp);
- Tcl_IncrRefCount(objPtr);
-
- /*
- * Reset the result just in case Blt_ResetPicture returns an error.
- */
- Tcl_ResetResult(interp);
-
- picture = Blt_CreatePicture(switches.region.w, switches.region.h);
- if (switches.nocopy) { /* Set the picture to a blank image. */
- Blt_BlankPicture(picture, 0x00000000);
- } else { /* Copy region into new picture. */
- Blt_CopyPictureBits(picture, imgPtr->picture, switches.region.x,
- switches.region.y, switches.region.w, switches.region.h, 0, 0);
- }
- if (Blt_ResetPicture(interp, Tcl_GetString(objPtr), picture) != TCL_OK) {
- Tcl_DecrRefCount(objPtr);
- Blt_FreePicture(picture);
- return TCL_ERROR;
- }
- Tcl_SetObjResult(interp, objPtr);
- Tcl_DecrRefCount(objPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExportOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ExportOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- Blt_HashEntry *hPtr;
- PictFormat *fmtPtr;
- PictImage *imgPtr = clientData;
- int result;
- const char *fmt;
-
- if (objc == 2) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&fmtTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- PictFormat *fmtPtr;
-
- fmtPtr = Blt_GetHashValue(hPtr);
- if ((fmtPtr->flags & BLT_PIC_FMT_LOADED) == 0) {
- continue;
- }
- if (fmtPtr->exportProc == NULL) {
- continue;
- }
- Tcl_AppendElement(interp, fmtPtr->name);
- }
- return TCL_OK;
- }
- fmt = Tcl_GetString(objv[2]);
- hPtr = Blt_FindHashEntry(&fmtTable, fmt);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "can't export \"", fmt,
- "\": format not registered", (char *)NULL);
- return TCL_ERROR;
- }
- fmtPtr = Blt_GetHashValue(hPtr);
- if ((fmtPtr->flags & BLT_PIC_FMT_LOADED) == 0) {
- LoadFormat(interp, fmt);
- }
- if (fmtPtr->exportProc == NULL) {
- Tcl_AppendResult(interp, "no export procedure registered for \"",
- fmtPtr->name, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- result = (*fmtPtr->exportProc)(interp, imgPtr->index, imgPtr->chain,
- objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FadeOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-FadeOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_Picture src;
- PictImage *imgPtr = clientData;
- int alpha;
-
- if (Blt_GetPictureFromObj(interp, objv[2], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tcl_GetIntFromObj(interp, objv[3], &alpha) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_FadePicture(imgPtr->picture, src, 0, 0, Blt_PictureWidth(src),
- Blt_PictureHeight(src), 0, 0, alpha);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FlipOp --
- *
- * Flips the picture either horizontally or vertically.
- *
- * Results:
- * Returns a standard TCL return value. If TCL_OK, the components of the
- * pixel are returned as a list in the interpreter result. Otherwise an
- * error message is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-FlipOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- PictImage *imgPtr = clientData;
- const char *string;
- int isVertical;
-
- string = Tcl_GetString(objv[2]);
- if ((string[0] == 'x') && (string[1] == '\0')) {
- isVertical = FALSE;
- } else if ((string[0] == 'y') && (string[1] == '\0')) {
- isVertical = TRUE;
- } else {
- Tcl_AppendResult(interp, "bad flip argument \"", string,
- "\": should be x or y", (char *)NULL);
- return TCL_ERROR;
- }
- Blt_FlipPicture(imgPtr->picture, isVertical);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GammaOp --
- *
- * $image gamma value
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-GammaOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- PictImage *imgPtr = clientData;
- double gamma;
-
- if (Tcl_GetDoubleFromObj(interp, objv[2], &gamma) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_GammaCorrectPicture(imgPtr->picture, imgPtr->picture, (float)gamma);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetOp --
- *
- * Returns the RGBA components of the pixel at the specified coordinate.
- *
- * Results:
- * Returns a standard TCL return value. If TCL_OK, the components of the
- * pixel are returned as a list in the interpreter result. Otherwise an
- * error message is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- PictImage *imgPtr = clientData;
- Blt_Pixel *sp, pixel;
- int x, y;
-
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if ((x < 0) || (x >= Blt_PictureWidth(imgPtr->picture))) {
- Tcl_AppendResult(interp, "x-coordinate \"", Tcl_GetString(objv[2]),
- "\" is out of range", (char *)NULL);
- return TCL_ERROR;
- }
- if ((y < 0) || (y >= Blt_PictureHeight(imgPtr->picture))) {
- Tcl_AppendResult(interp, "y-coordinate \"", Tcl_GetString(objv[3]),
- "\" is out of range", (char *)NULL);
- return TCL_ERROR;
- }
- sp = Blt_PicturePixel(imgPtr->picture, x, y);
- pixel = *sp;
- if ((Blt_PictureFlags(imgPtr->picture) & BLT_PIC_ASSOCIATED_COLORS) &&
- ((sp->Alpha != 0xFF) && (sp->Alpha != 0x00))) {
- int bias = sp->Alpha >> 1;
-
- pixel.Red = (mul255(sp->Red) + bias) / sp->Alpha;
- pixel.Green = (mul255(sp->Green) + bias) / sp->Alpha;
- pixel.Blue = (mul255(sp->Blue) + bias) / sp->Alpha;
- }
- {
- char string[11];
-
- sprintf_s(string, 11, "0x%02x%02x%02x%02x", pixel.Alpha, pixel.Red,
- pixel.Green, pixel.Blue);
- Tcl_SetObjResult(interp, Tcl_NewStringObj(string, 10));
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GradientOp --
- *
- * Flips the picture either horizontally or vertically.
- *
- * Results:
- * Returns a standard TCL return value. If TCL_OK, the components of the
- * pixel are returned as a list in the interpreter result. Otherwise an
- * error message is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GradientOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- PictImage *imgPtr = clientData;
- GradientSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- colorSwitch.clientData = imgPtr;
- switches.fg.u32 = 0xFFFFFFFF;
- switches.bg.u32 = 0xFF000000;
- switches.gradient.shape = BLT_GRADIENT_SHAPE_LINEAR;
- switches.gradient.path = BLT_GRADIENT_PATH_X;
- switches.gradient.logScale = TRUE;
- switches.gradient.jitter = FALSE;
- if (Blt_ParseSwitches(interp, gradientSwitches, objc - 2, objv + 2,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- Blt_GradientPicture(imgPtr->picture, &switches.fg, &switches.bg,
- &switches.gradient);
- if ((switches.bg.Alpha != 0xFF) || (switches.fg.Alpha != 0xFF)) {
- imgPtr->picture->flags |= BLT_PIC_BLEND;
- }
- Blt_AssociateColors(imgPtr->picture);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GreyscaleOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-GreyscaleOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_Picture src, dest;
- PictImage *imgPtr = clientData;
-
- if (Blt_GetPictureFromObj(interp, objv[2], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- dest = Blt_GreyscalePicture(src);
- ReplacePicture(imgPtr, dest);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HeightOp --
- * Returns the current height of the picture.
- *
- *---------------------------------------------------------------------------
- */
-static int
-HeightOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* # of arguments. */
- Tcl_Obj *const *objv) /* Argument vector. */
-{
- PictImage *imgPtr = clientData;
- int h;
-
- h = 0;
- if (objc == 3) {
- int w;
-
- if (Tcl_GetIntFromObj(interp, objv[2], &h) != TCL_OK) {
- return TCL_ERROR;
- }
- w = Blt_PictureWidth(imgPtr->picture);
- Blt_AdjustPicture(imgPtr->picture, w, h);
- Blt_NotifyImageChanged(imgPtr);
- }
- if (imgPtr->picture != NULL) {
- h = Blt_PictureHeight(imgPtr->picture);
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), h);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImportOp --
- *
- * Imports an image source into a picture. The image source can be a file,
- * base64 string, or binary Tcl_Obj. This performs basically the same
- * function as "configure". Any extra functionality this command has is
- * based upon the ability to pass extra flags to the various converters,
- * something that can't be done really be done with
- *
- * $image configure -file file.jpg
- *
- * Results:
- * Returns a standard TCL return value. If no error, the interpreter
- * result will contain the number of images successfully read.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ImportOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- Blt_Chain chain;
- Blt_HashEntry *hPtr;
- PictFormat *fmtPtr;
- PictImage *imgPtr = clientData;
- const char *fileName;
- const char *fmt;
-
- if (objc == 2) {
- PictFormat *fp, *fend;
-
- for (fp = pictFormats, fend = fp + NUMFMTS; fp < fend; fp++) {
- if ((fp->flags & BLT_PIC_FMT_LOADED) == 0) {
- continue;
- }
- if (fp->importProc == NULL) {
- continue;
- }
- Tcl_AppendElement(interp, fp->name);
- }
- return TCL_OK;
- }
- fmt = Tcl_GetString(objv[2]);
- hPtr = Blt_FindHashEntry(&fmtTable, fmt);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "unknown picture format \"", fmt, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- fmtPtr = Blt_GetHashValue(hPtr);
- if ((fmtPtr->flags & BLT_PIC_FMT_LOADED) == 0) {
- LoadFormat(interp, fmt);
- }
- if (fmtPtr->importProc == NULL) {
- Tcl_AppendResult(interp, "no import procedure registered for \"",
- fmtPtr->name, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- chain = (*fmtPtr->importProc)(interp, objc, objv, &fileName);
- if (chain == NULL) {
- return TCL_ERROR;
- }
- FreePictures(imgPtr);
- imgPtr->chain = chain;
- imgPtr->index = 0;
- imgPtr->picture = Blt_Chain_FirstValue(chain);
-
- /*
- * Save the format type and file name in the image record. The file name
- * is used when querying image options -file or -data via configure. The
- * type is used by the "-data" operation to establish a default format to
- * output.
- */
- imgPtr->fmtPtr = fmtPtr;
- imgPtr->flags &= ~IMPORTED_MASK;
- if (imgPtr->name != NULL) {
- Blt_Free(imgPtr->name);
- }
- if (fileName == NULL) {
- imgPtr->name = NULL;
- imgPtr->flags |= IMPORTED_DATA;
- } else {
- imgPtr->name = Blt_AssertStrdup(fileName);
- imgPtr->flags |= IMPORTED_FILE;
- }
- Blt_NotifyImageChanged(imgPtr);
-
- /* Return the number of separates images read. */
- Tcl_SetIntObj(Tcl_GetObjResult(interp), Blt_Chain_GetLength(imgPtr->chain));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InfoOp --
- *
- * Reports the basic information about a picture.
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-InfoOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Not used. */
-{
- PictImage *imgPtr = clientData;
- int nColors;
- const char *string;
- Tcl_Obj *listObjPtr, *objPtr;
-
- nColors = Blt_QueryColors(imgPtr->picture, (Blt_HashTable *)NULL);
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
-
- objPtr = Tcl_NewStringObj("colors", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewIntObj(nColors);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-
- objPtr = Tcl_NewStringObj("type", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- string = Blt_PictureIsColor(imgPtr->picture) ? "color" : "greyscale";
- objPtr = Tcl_NewStringObj(string, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-
- objPtr = Tcl_NewStringObj("opacity", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- if (Blt_PictureIsBlended(imgPtr->picture)) {
- string = "blended";
- } else if (Blt_PictureIsMasked(imgPtr->picture)) {
- string = "masked";
- } else {
- string = "full";
- }
- objPtr = Tcl_NewStringObj(string, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-
- objPtr = Tcl_NewStringObj("width", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewIntObj(Blt_PictureWidth(imgPtr->picture));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-
- objPtr = Tcl_NewStringObj("height", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewIntObj(Blt_PictureHeight(imgPtr->picture));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-
- objPtr = Tcl_NewStringObj("count", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewIntObj(Blt_Chain_GetLength(imgPtr->chain));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-
- objPtr = Tcl_NewStringObj("index", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewIntObj(imgPtr->index);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-
- objPtr = Tcl_NewStringObj("read-format", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewStringObj((imgPtr->fmtPtr != NULL) ?
- imgPtr->fmtPtr->name : "???", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MultiplyOp --
- *
- * $image multiply scalar
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-MultiplyOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- PictImage *imgPtr = clientData;
- double scalar;
-
- if (Tcl_GetDoubleFromObj(interp, objv[2], &scalar) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_MultiplyPixels(imgPtr->picture, (float)scalar);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-
-static int
-GetImageIndex(Tcl_Interp *interp, PictImage *imgPtr, Tcl_Obj *objPtr,
- int *indexPtr)
-{
- int index;
- const char *string;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "end") == 0) {
- index = Blt_Chain_GetLength(imgPtr->chain) - 1;
- } else if (Tcl_GetIntFromObj(interp, objPtr, &index) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((index < 0) || (index >= Blt_Chain_GetLength(imgPtr->chain))) {
- Tcl_AppendResult(interp, "invalid image index \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- *indexPtr = index;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListAnimateOp --
- *
- * $im list animate $delay
- * $im list animate stop
- * $im list animate start
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ListAnimateOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- PictImage *imgPtr = clientData;
- const char *string;
- int interval;
-
- string = Tcl_GetString(objv[2]);
- if (strcmp(string, "stop") == 0) {
- if (imgPtr->timerToken != 0) {
- Tcl_DeleteTimerHandler(imgPtr->timerToken);
- imgPtr->timerToken = 0;
- }
- } else if (strcmp(string, "start") == 0) {
- if (imgPtr->timerToken == 0) {
- int delay;
-
- delay = Blt_PictureDelay(imgPtr->picture);
- imgPtr->timerToken =
- Tcl_CreateTimerHandler(delay, TimerProc, imgPtr);
- }
- } else if (Tcl_GetIntFromObj(interp, objv[2], &interval) == TCL_OK) {
- imgPtr->interval = interval;
- if (imgPtr->timerToken != 0) {
- Tcl_DeleteTimerHandler(imgPtr->timerToken);
- }
- imgPtr->timerToken = Tcl_CreateTimerHandler(imgPtr->interval,
- TimerProc, imgPtr);
- } else {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListAppendOp --
- *
- * $im list append $img...
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ListAppendOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- PictImage *imgPtr = clientData;
- int i;
-
- for (i = 3; i < objc; i++) {
- Blt_Picture src, dest;
-
- if (Blt_GetPictureFromObj(interp, objv[i], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- dest = Blt_ClonePicture(src);
- Blt_Chain_Append(imgPtr->chain, dest);
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListCurrentOp --
- *
- * $im list current index
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ListCurrentOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- PictImage *imgPtr = clientData;
-
- if (objc == 4) {
- int index;
-
- if (GetImageIndex(interp, imgPtr, objv[3], &index) != TCL_OK) {
- return TCL_ERROR;
- }
- imgPtr->picture = Blt_GetNthPicture(imgPtr->chain, index);
- imgPtr->index = index;
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), imgPtr->index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListDeleteOp --
- *
- * $im list delete index
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ListDeleteOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- PictImage *imgPtr = clientData;
- int i;
- int first, last;
- Blt_ChainLink link, next;
-
- if (GetImageIndex(interp, imgPtr, objv[3], &first) != TCL_OK) {
- return TCL_ERROR;
- }
- if (GetImageIndex(interp, imgPtr, objv[4], &last) != TCL_OK) {
- return TCL_ERROR;
- }
- if (first > last) {
- return TCL_OK;
- }
- for (i = 0, link = Blt_Chain_FirstLink(imgPtr->chain); link != NULL;
- link = next, i++) {
- next = Blt_Chain_NextLink(link);
- if ((i >= first) && (i <= last)) {
- Blt_Picture picture;
-
- picture = Blt_Chain_GetValue(link);
- Blt_FreePicture(picture);
- Blt_Chain_DeleteLink(imgPtr->chain, link);
- }
- }
- imgPtr->index = 0;
- imgPtr->picture = Blt_Chain_FirstValue(imgPtr->chain);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListLengthOp --
- *
- * $im list length
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ListLengthOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- PictImage *imgPtr = clientData;
- int count;
-
- count = Blt_Chain_GetLength(imgPtr->chain);
- Tcl_SetIntObj(Tcl_GetObjResult(interp), count);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListNextOp --
- *
- * $im list next
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ListNextOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- PictImage *imgPtr = clientData;
-
- NextImage(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListPreviousOp --
- *
- * $im list previous
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ListPreviousOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- PictImage *imgPtr = clientData;
-
- Blt_Picture picture;
-
- imgPtr->index--;
- if (imgPtr->index < 0) {
- imgPtr->index = Blt_Chain_GetLength(imgPtr->chain) - 1;
- }
- if (imgPtr->index < 0) {
- imgPtr->index = 0;
- }
- picture = PictureFromPictImage(imgPtr);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListReplaceOp --
- *
- * $im list replace first last $img...
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ListReplaceOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- PictImage *imgPtr = clientData;
- int i;
- int first, last;
- Blt_ChainLink link, next, head, tail;
-
- if (GetImageIndex(interp, imgPtr, objv[3], &first) != TCL_OK) {
- return TCL_ERROR;
- }
- if (GetImageIndex(interp, imgPtr, objv[4], &last) != TCL_OK) {
- return TCL_ERROR;
- }
- if (first > last) {
- return TCL_OK;
- }
- head = tail = link;
- for (i = 0, link = Blt_Chain_FirstLink(imgPtr->chain); link != NULL;
- link = next, i++) {
- next = Blt_Chain_NextLink(link);
- if ((i >= first) && (i <= last)) {
- Blt_Picture picture;
-
- picture = Blt_Chain_GetValue(link);
- Blt_FreePicture(picture);
- Blt_Chain_DeleteLink(imgPtr->chain, link);
- } else if (head == NULL) {
- head = link;
- } else if (tail == NULL) {
- tail = link;
- }
- }
- if (head != NULL) {
- for (i = 5; i < objc; i++) {
- Blt_Picture src, dest;
-
- if (Blt_GetPictureFromObj(interp, objv[i], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- dest = Blt_ClonePicture(src);
- link = Blt_Chain_NewLink();
- Blt_Chain_SetValue(link, dest);
- Blt_Chain_LinkAfter(imgPtr->chain, link, head);
- head = link;
- }
- } else if (tail != NULL) {
- for (i = 5; i < objc; i++) {
- Blt_Picture src, dest;
-
- if (Blt_GetPictureFromObj(interp, objv[i], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- dest = Blt_ClonePicture(src);
- link = Blt_Chain_NewLink();
- Blt_Chain_SetValue(link, dest);
- Blt_Chain_LinkBefore(imgPtr->chain, link, tail);
- }
- } else {
- assert(Blt_Chain_GetLength(imgPtr->chain) == 0);
- for (i = 5; i < objc; i++) {
- Blt_Picture src, dest;
-
- if (Blt_GetPictureFromObj(interp, objv[i], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- dest = Blt_ClonePicture(src);
- Blt_Chain_Append(imgPtr->chain, dest);
- }
- }
- imgPtr->index = 0;
- imgPtr->picture = Blt_Chain_FirstValue(imgPtr->chain);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-static Blt_OpSpec listOps[] =
-{
- {"animate", 2, ListAnimateOp, 3, 3, "oper",},
- {"append", 2, ListAppendOp, 3, 0, "?image...?",},
- {"current", 1, ListCurrentOp, 3, 4, "?index?",},
- {"delete", 1, ListDeleteOp, 3, 4, "first ?last?",},
- {"length", 1, ListLengthOp, 3, 3, "",},
- {"next", 1, ListNextOp, 3, 3, "",},
- {"previous", 1, ListPreviousOp, 3, 3, "",},
- {"replace", 1, ListReplaceOp, 5, 0, "first last ?image...?",},
-};
-
-static int nListOps = sizeof(listOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListOp --
- *
- * $img list animate
- * $img list append image image image
- * $img list current ?index?
- * $img list delete 0 end
- * $img list length
- * $img list next
- * $img list previous
- * $img list replace 0 end image image image image
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ListOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- PictCmdProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nListOps, listOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (clientData, interp, objc, objv);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * PutOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PutOp(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
-
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * QuantizeOp --
- *
- * $dest quantize $src 256
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-QuantizeOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_Picture src, dest;
- PictImage *imgPtr = clientData;
- int nColors;
-
- if (Blt_GetPictureFromObj(interp, objv[2], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tcl_GetIntFromObj(interp, objv[3], &nColors) != TCL_OK) {
- return TCL_ERROR;
- }
- dest = Blt_QuantizePicture(src, nColors);
- if (dest == NULL) {
- return TCL_ERROR;
- }
- ReplacePicture(imgPtr, dest);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResampleOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ResampleOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_Picture src, tmp;
- Blt_ResampleFilter hFilter, vFilter;
- PictImage *imgPtr = clientData;
- ResampleSwitches switches;
- int destWidth, destHeight;
-
- if (Blt_GetPictureFromObj(interp, objv[2], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- switches.region.x = switches.region.y = 0;
- switches.region.w = Blt_PictureWidth(src);
- switches.region.h = Blt_PictureHeight(src);
- switches.width = Blt_PictureWidth(imgPtr->picture);
- switches.height = Blt_PictureHeight(imgPtr->picture);
- switches.filter = NULL;
- if (Blt_ParseSwitches(interp, resampleSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (!Blt_AdjustRegionToPicture(src, &switches.region)) {
- Tcl_AppendResult(interp, "impossible coordinates for region",
- (char *)NULL);
- return TCL_ERROR;
- }
- if ((Blt_PictureWidth(imgPtr->picture) != switches.width) ||
- (Blt_PictureHeight(imgPtr->picture) != switches.height)) {
- Blt_AdjustPicture(imgPtr->picture, switches.width, switches.height);
- }
- destWidth = Blt_PictureWidth(imgPtr->picture);
- destHeight = Blt_PictureHeight(imgPtr->picture);
- if (switches.filter == NULL) {
- if (switches.region.w < destWidth) {
- hFilter = bltMitchellFilter;
- } else {
- hFilter = bltBoxFilter;
- }
- if (switches.region.h < destHeight) {
- vFilter = bltMitchellFilter;
- } else {
- vFilter = bltBoxFilter;
- }
- } else {
- hFilter = vFilter = switches.filter;
- }
- tmp = Blt_CreatePicture(switches.region.w, switches.region.h);
- Blt_CopyPictureBits(tmp, src, switches.region.x, switches.region.y,
- switches.region.w, switches.region.h, 0, 0);
- Blt_ResamplePicture(imgPtr->picture, tmp, vFilter, hFilter);
- Blt_FreePicture(tmp);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RotateOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-RotateOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_Picture src, dest;
- PictImage *imgPtr = clientData;
- double angle;
-
- if (Blt_GetPictureFromObj(interp, objv[2], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tcl_GetDoubleFromObj(interp, objv[3], &angle) != TCL_OK) {
- const char *string;
-
- string = Tcl_GetString(objv[3]);
- if (Tcl_ExprDouble(interp, string, &angle) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- dest = Blt_RotatePicture(src, angle);
- ReplacePicture(imgPtr, dest);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- Blt_Picture src;
- PictImage *imgPtr = clientData;
- Blt_Pixel lower, upper;
- unsigned char tmp;
-
- if (Blt_GetPictureFromObj(interp, objv[2], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_GetPixelFromObj(interp, objv[3], &lower) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 5) {
- if (Blt_GetPixelFromObj(interp, objv[4], &upper) != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- upper.u32 = lower.u32;
- }
- if (lower.Red > upper.Red) {
- tmp = lower.Red, lower.Red = upper.Red, upper.Red = tmp;
- }
- if (lower.Green > upper.Green) {
- tmp = lower.Green, lower.Green = upper.Green, upper.Green = tmp;
- }
- if (lower.Blue > upper.Blue) {
- tmp = lower.Blue, lower.Blue = upper.Blue, upper.Blue = tmp;
- }
- if (lower.Alpha > upper.Alpha) {
- tmp = lower.Alpha, lower.Alpha = upper.Alpha, upper.Alpha = tmp;
- }
- Blt_SelectPixels(imgPtr->picture, src, &lower, &upper);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SharpenOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SharpenOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Not used. */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Not used. */
-{
- PictImage *imgPtr = clientData;
-
- Blt_SharpenPicture(imgPtr->picture, imgPtr->picture);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SnapOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- * $pict snap window -region {x y w h} -raise
- *
- *---------------------------------------------------------------------------
- */
-static int
-SnapOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- PictImage *imgPtr = clientData;
- Blt_Picture picture;
- Window window;
- int w, h;
- SnapSwitches switches;
-
- if (Blt_GetWindowFromObj(interp, objv[2], &window) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_GetWindowRegion(imgPtr->display, window, (int *)NULL, (int *)NULL,
- &w, &h) != TCL_OK) {
- Tcl_AppendResult(interp, "can't get dimensions of window \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- memset(&switches, 0, sizeof(switches));
- switches.region.x = switches.region.y = 0;
- switches.region.w = w;
- switches.region.h = h;
- if (Blt_ParseSwitches(interp, snapSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if ((switches.region.w + switches.region.x) > w) {
- switches.region.w = (w - switches.region.x);
- }
- if ((switches.region.h + switches.region.y) > h) {
- switches.region.h = (h - switches.region.y);
- }
- if (switches.raise) {
- XRaiseWindow(imgPtr->display, window);
- }
- /* Depth, visual, colormap */
- picture = Blt_WindowToPicture(imgPtr->display, window, switches.region.x,
- switches.region.y, switches.region.w, switches.region.h, imgPtr->gamma);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "can't obtain snapshot of window \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- ReplacePicture(imgPtr, picture);
- if (imgPtr->name != NULL) {
- Blt_Free(imgPtr->name);
- }
- Blt_NotifyImageChanged(imgPtr);
- imgPtr->flags &= ~IMPORTED_MASK;
- Blt_FreeSwitches(snapSwitches, &switches, 0);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TileOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TileOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- PictImage *imgPtr = clientData;
- Blt_Picture src;
- TileSwitches switches;
-
- if (Blt_GetPictureFromObj(interp, objv[2], &src) != TCL_OK) {
- return TCL_ERROR;
- }
- switches.xOrigin = switches.yOrigin = 0;
- switches.region.x = switches.region.y = 0;
- switches.region.w = Blt_PictureWidth(imgPtr->picture);
- switches.region.h = Blt_PictureHeight(imgPtr->picture);
-
- if (Blt_ParseSwitches(interp, tileSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (!Blt_AdjustRegionToPicture(imgPtr->picture, &switches.region)) {
- Tcl_AppendResult(interp, "impossible coordinates for region",
- (char *)NULL);
- return TCL_ERROR;
- }
- Blt_TilePicture(imgPtr->picture, src, switches.xOrigin, switches.yOrigin,
- switches.region.x, switches.region.y, switches.region.w,
- switches.region.h);
- Blt_NotifyImageChanged(imgPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WidthOp --
- * Returns the current width of the picture.
- *
- *---------------------------------------------------------------------------
- */
-static int
-WidthOp(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* # of arguments. */
- Tcl_Obj *const *objv) /* Argument vector. */
-{
- PictImage *imgPtr = clientData;
- int w;
-
- if (objc == 3) {
- int h;
-
- if (Tcl_GetIntFromObj(interp, objv[2], &w) != TCL_OK) {
- return TCL_ERROR;
- }
- if (w < 0) {
- Tcl_AppendResult(interp, "bad width \"", Tcl_GetString(objv[2]),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- h = Blt_PictureHeight(imgPtr->picture);
- Blt_AdjustPicture(imgPtr->picture, w, h);
- Blt_NotifyImageChanged(imgPtr);
- }
- w = Blt_PictureWidth(imgPtr->picture);
- Tcl_SetIntObj(Tcl_GetObjResult(interp), w);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Picture instance sub-command specification:
- *
- * - Name of the sub-command.
- * - Minimum number of characters needed to unambiguously
- * recognize the sub-command.
- * - Pointer to the function to be called for the sub-command.
- * - Minimum number of arguments accepted.
- * - Maximum number of arguments accepted.
- * - String to be displayed for usage (arguments only).
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec pictInstOps[] =
-{
- {"add", 2, ArithOp, 3, 0, "image|color",},
- {"and", 3, ArithOp, 3, 0, "image|color",},
- {"blank", 3, BlankOp, 2, 3, "?color?",},
- {"ble2nd", 4, Blend2Op, 4, 0, "bg fg ?switches?",},
- {"blend", 4, BlendOp, 4, 0, "bg fg ?switches?",},
- {"blur", 3, BlurOp, 4, 4, "src width",},
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"configure", 4, ConfigureOp, 2, 0, "?option value?...",},
- {"convolve", 4, ConvolveOp, 3, 0, "src ?switches?",},
- {"copy", 3, CopyOp, 3, 0, "srcPict ?switches?",},
- {"crop", 3, CropOp, 2, 0, "?switches?",},
- {"draw", 2, DrawOp, 2, 0, "?args?",},
- {"dup", 2, DupOp, 2, 0, "?switches?",},
- {"export", 1, ExportOp, 2, 0, "format ?switches?...",},
- {"fade", 2, FadeOp, 4, 4, "src factor",},
- {"flip", 2, FlipOp, 3, 0, "x|y",},
- {"gamma", 2, GammaOp, 3, 3, "value",},
- {"get", 2, GetOp, 4, 4, "x y",},
- {"gradient", 3, GradientOp, 2, 0, "?switches?",},
- {"greyscale", 3, GreyscaleOp, 3, 3, "src",},
- {"height", 1, HeightOp, 2, 3, "?newHeight?",},
- {"import", 2, ImportOp, 2, 0, "format ?switches?...",},
- {"info", 2, InfoOp, 2, 2, "info",},
- {"list", 1, ListOp, 2, 0, "args...",},
- {"max", 2, ArithOp, 3, 0, "image|color",},
- {"min", 2, ArithOp, 3, 0, "image|color",},
- {"multiply", 2, MultiplyOp, 3, 3, "float",},
- {"nand", 2, ArithOp, 3, 0, "image|color",},
- {"nor", 2, ArithOp, 3, 0, "image|color",},
- {"or", 1, ArithOp, 3, 0, "image|color ?switches?",},
- {"put", 1, PutOp, 2, 0, "color ?window?...",},
- {"quantize", 1, QuantizeOp, 4, 4, "src numColors",},
- {"resample", 2, ResampleOp, 3, 0, "src ?switches?",},
- {"rotate", 2, RotateOp, 4, 4, "src angle",},
- {"select", 2, SelectOp, 4, 5, "src color ?color?",},
- {"sharpen", 2, SharpenOp, 2, 0, "",},
- {"snap", 2, SnapOp, 3, 0, "window ?switches?",},
- {"subtract", 2, ArithOp, 3, 0, "image|color",},
- {"tile", 2, TileOp, 3, 0, "image ?switches?",},
- {"width", 1, WidthOp, 2, 3, "?newWidth?",},
- {"xor", 1, ArithOp, 3, 0, "image|color ?switches?",},
-};
-
-static int nPictInstOps = sizeof(pictInstOps) / sizeof(Blt_OpSpec);
-
-static int
-PictureInstCmdProc(
- ClientData clientData, /* Information about picture cmd. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- Tcl_ObjCmdProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nPictInstOps, pictInstOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (clientData, interp, objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictureInstCmdDeleteProc --
- *
- * This procedure is invoked when a picture command is deleted.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-PictureInstCmdDeletedProc(ClientData clientData) /* Pointer to record. */
-{
- PictImage *imgPtr = clientData;
-
- imgPtr->cmdToken = NULL;
- if (imgPtr->imgToken != NULL) {
- Tk_DeleteImage(imgPtr->interp, Tk_NameOfImage(imgPtr->imgToken));
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictureLoadOp --
- *
- * Loads the dynamic library representing the converters for the named
- * format. Designed to be called by "package require", not directly by the
- * user.
- *
- * Results:
- * A standard TCL result. Return TCL_OK is the converter was successfully
- * loaded, TCL_ERROR otherwise.
- *
- * blt::datatable load fmt libpath lib
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PictureLoadOp(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Tcl_DString lib;
- char *fmt;
- char *safeProcName, *initProcName;
- int result;
- int length;
-
- fmt = Tcl_GetStringFromObj(objv[2], &length);
- hPtr = Blt_FindHashEntry(&fmtTable, fmt);
- if (hPtr != NULL) {
- PictFormat *fmtPtr;
-
- fmtPtr = Blt_GetHashValue(hPtr);
- if (fmtPtr->flags & BLT_PIC_FMT_LOADED) {
- return TCL_OK; /* Converter is already loaded. */
- }
- }
- Tcl_DStringInit(&lib);
- {
- Tcl_DString ds;
- const char *pathName;
-
- Tcl_DStringInit(&ds);
- pathName = Tcl_TranslateFileName(interp, Tcl_GetString(objv[3]), &ds);
- if (pathName == NULL) {
- Tcl_DStringFree(&ds);
- return TCL_ERROR;
- }
- Tcl_DStringAppend(&lib, pathName, -1);
- Tcl_DStringFree(&ds);
- }
- Tcl_DStringAppend(&lib, "/", -1);
- Tcl_UtfToTitle(fmt);
- Tcl_DStringAppend(&lib, "Picture", 7);
- Tcl_DStringAppend(&lib, fmt, -1);
- Tcl_DStringAppend(&lib, Blt_Itoa(BLT_MAJOR_VERSION), 1);
- Tcl_DStringAppend(&lib, Blt_Itoa(BLT_MINOR_VERSION), 1);
- Tcl_DStringAppend(&lib, BLT_LIB_SUFFIX, -1);
- Tcl_DStringAppend(&lib, BLT_SO_EXT, -1);
-
- initProcName = Blt_AssertMalloc(11 + length + 4 + 1);
- sprintf_s(initProcName, 11 + length + 4 + 1, "Blt_Picture%sInit", fmt);
- safeProcName = Blt_AssertMalloc(11 + length + 8 + 1);
- sprintf_s(safeProcName, 11 + length + 8 + 1, "Blt_Picture%sSafeInit", fmt);
-
- result = Blt_LoadLibrary(interp, Tcl_DStringValue(&lib), initProcName,
- safeProcName);
- Tcl_DStringFree(&lib);
- if (safeProcName != NULL) {
- Blt_Free(safeProcName);
- }
- if (initProcName != NULL) {
- Blt_Free(initProcName);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Picture instance sub-command specification:
- *
- * - Name of the sub-command.
- * - Minimum number of characters needed to unambiguously
- * recognize the sub-command.
- * - Pointer to the function to be called for the sub-command.
- * - Minimum number of arguments accepted.
- * - Maximum number of arguments accepted.
- * - String to be displayed for usage (arguments only).
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec pictureOps[] =
-{
- {"load", 1, PictureLoadOp, 4, 0, "fmt lib",},
-#ifdef notdef
- {"blur", 1, BlurOp, 4, 0, "src dest ?switches?",},
- {"brighten" 1, BrightenOp, 4, 0, "src dest ?switches?",},
- {"darken" 1, BrightenOp, 4, 0, "src dest ?switches?",},
- {"medianf" 1, MedianOp, 4, 0, "src dest ?switches?",},
- {"translate", 1, TranslateOp, 4, 0, "src dest ?switches?",},
-#endif
-};
-static int nPictureOps = sizeof(pictureOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictureImageCmdProc --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PictureImageCmdProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nPictureOps, pictureOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc)(clientData, interp, objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PictureCmdInitProc --
- *
- * This procedure is invoked to initialize the "tree" command.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates the new command and adds a new entry into a global Tcl
- * associative array.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_PictureCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {
- "picture", PictureImageCmdProc,
- };
- /* cmdSpec.clientData = GetPictureCmdInterpData(interp); */
- if (Blt_InitCmd(interp, "::blt", &cmdSpec) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static Tk_ImageType pictureImageType = {
- (char *)"picture",
- CreatePictureImage,
- GetPictInstance,
- DisplayPictureImage,
- FreePictInstance,
- DeletePictureImage,
- PictureImageToPostScript,
- (Tk_ImageType *)NULL /* nextPtr */
-};
-
-int
-Blt_IsPicture(Tk_Image tkImage)
-{
- const char *type;
-
- type = Blt_Image_NameOfType(tkImage);
- return (strcmp(type, pictureImageType.name) == 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RegisterPictureImageType --
- *
- * Registers the "picture" image type with Tk.
- *
- *---------------------------------------------------------------------------
-
-void
-Blt_RegisterPictureImageType(Tcl_Interp *interp)
-{
- PictFormat *fp, *fend;
-
- Tk_CreateImageType(&pictureImageType);
-
- Blt_CpuFeatures(interp, NULL);
-
- Blt_InitHashTable(&fmtTable, BLT_STRING_KEYS);
- for (fp = pictFormats, fend = fp + NUMFMTS; fp < fend; fp++) {
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&fmtTable, fp->name, &isNew);
- Blt_SetHashValue(hPtr, fp);
- }
-}
- */
-int
-Blt_PictureRegisterFormat(
- Tcl_Interp *interp,
- const char *fmt,
- Blt_PictureIsFmtProc *isProc,
- Blt_PictureReadDataProc *readProc,
- Blt_PictureWriteDataProc *writeProc,
- Blt_PictureImportProc *importProc,
- Blt_PictureExportProc *exportProc)
-{
- PictFormat *fmtPtr;
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&fmtTable, fmt);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "unknown format \"", fmt, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- fmtPtr = Blt_GetHashValue(hPtr);
- fmtPtr->flags = BLT_PIC_FMT_LOADED;
- fmtPtr->isFmtProc = isProc;
- fmtPtr->readProc = readProc;
- fmtPtr->writeProc = writeProc;
- fmtPtr->importProc = importProc;
- fmtPtr->exportProc = exportProc;
- return TCL_OK;
-}
-
diff --git a/blt3.0.1/src/bltPictDraw.c b/blt3.0.1/src/bltPictDraw.c
deleted file mode 100644
index 53442db..0000000
--- a/blt3.0.1/src/bltPictDraw.c
+++ /dev/null
@@ -1,3421 +0,0 @@
-
-/*
- * bltPictDraw.c --
- *
- * This module implements image drawing primitives (line, circle, rectangle,
- * text, etc.) for picture images in the BLT toolkit.
- *
- * Copyright 1997-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include "bltHash.h"
-#include "bltSwitch.h"
-#include "bltPicture.h"
-#include "bltPictInt.h"
-#include "bltPainter.h"
-#include <X11/Xutil.h>
-#include "bltFont.h"
-#include "bltText.h"
-#include <string.h>
-
-#define imul8x8(a,b,t) ((t) = (a)*(b)+128,(((t)+((t)>>8))>>8))
-#define CLAMP(c) ((((c) < 0.0) ? 0.0 : ((c) > 255.0) ? 255.0 : (c)))
-
-typedef struct {
- unsigned int alpha;
- unsigned int offset;
-} Shadow;
-
-#if defined (HAVE_FT2BUILD_H) && defined(HAVE_LIBXFT)
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include <X11/Xft/Xft.h>
-#define DRAWTEXT 1
-#else
-#define DRAWTEXT 0
-#endif
-
-
-#if DRAWTEXT
-static FT_Library ftLibrary;
-
-typedef struct {
- FT_Face face;
- FT_Matrix matrix;
- FT_Library lib;
- XftFont *xftFont;
- int fontSize;
- float angle;
- int height;
- int ascent, descent;
-} FtFont;
-
-#endif /*HAVE_FT2BUILD_H && HAVE_LIBXFT */
-
-static Blt_SwitchParseProc ArraySwitchProc;
-static Blt_SwitchFreeProc ArrayFreeProc;
-static Blt_SwitchCustom arraySwitch = {
- ArraySwitchProc, ArrayFreeProc, (ClientData)0,
-};
-
-static Blt_SwitchParseProc AnchorSwitch;
-static Blt_SwitchCustom anchorSwitch = {
- AnchorSwitch, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc AlphaSwitch;
-static Blt_SwitchCustom alphaSwitch = {
- AlphaSwitch, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc ShadowSwitch;
-static Blt_SwitchCustom shadowSwitch = {
- ShadowSwitch, NULL, (ClientData)0,
-};
-
-BLT_EXTERN Blt_SwitchParseProc Blt_ColorSwitchProc;
-static Blt_SwitchCustom colorSwitch = {
- Blt_ColorSwitchProc, NULL, (ClientData)0,
-};
-
-typedef struct {
- int alpha; /* Overrides alpha value of color. */
- Blt_Pixel outline, fill; /* Outline and fill colors for the circle. */
- Shadow shadow;
- int antialiased;
- int lineWidth; /* Width of outline. If zero, indicates to
- * draw a solid circle. */
-} CircleSwitches;
-
-static Blt_SwitchSpec circleSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-alpha", "value",
- Blt_Offset(CircleSwitches, alpha), 0, 0, &alphaSwitch},
- {BLT_SWITCH_CUSTOM, "-fill", "fill",
- Blt_Offset(CircleSwitches, fill), 0, 0, &colorSwitch},
- {BLT_SWITCH_BOOLEAN, "-antialiased", "bool",
- Blt_Offset(CircleSwitches, antialiased), 0},
- {BLT_SWITCH_INT_NNEG, "-linewidth", "value",
- Blt_Offset(CircleSwitches, lineWidth), 0},
- {BLT_SWITCH_CUSTOM, "-outline", "outline",
- Blt_Offset(CircleSwitches, outline), 0, 0, &colorSwitch},
- {BLT_SWITCH_CUSTOM, "-shadow", "offset",
- Blt_Offset(CircleSwitches, shadow), 0, 0, &shadowSwitch},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- int alpha; /* Overrides alpha value of color. */
- Blt_Pixel bg; /* Color of line. */
- int lineWidth; /* Width of outline. */
- Array x, y;
- Array coords;
-} LineSwitches;
-
-typedef struct {
- int alpha; /* Overrides alpha value of color. */
- Blt_Pixel bg; /* Fill color of polygon. */
- int antialiased;
- Shadow shadow;
- int lineWidth; /* Width of outline. Default is 1, If zero,
- * indicates to draw a solid polygon. */
- Array coords;
- Array x, y;
-
-} PolygonSwitches;
-
-static Blt_SwitchSpec polygonSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-alpha", "int",
- Blt_Offset(PolygonSwitches, alpha), 0, 0, &alphaSwitch},
- {BLT_SWITCH_BOOLEAN, "-antialiased", "bool",
- Blt_Offset(PolygonSwitches, antialiased), 0},
- {BLT_SWITCH_CUSTOM, "-color", "color",
- Blt_Offset(PolygonSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_CUSTOM, "-coords", "{x0 y0 x1 y1 ... xn yn}",
- Blt_Offset(PolygonSwitches, coords), 0, 0, &arraySwitch},
- {BLT_SWITCH_CUSTOM, "-x", "{x0 x1 ... xn}",
- Blt_Offset(PolygonSwitches, x), 0, 0, &arraySwitch},
- {BLT_SWITCH_CUSTOM, "-y", "{x0 x1 ... xn}",
- Blt_Offset(PolygonSwitches, y), 0, 0, &arraySwitch},
- {BLT_SWITCH_CUSTOM, "-shadow", "offset",
- Blt_Offset(PolygonSwitches, shadow), 0, 0, &shadowSwitch},
- {BLT_SWITCH_INT_POS, "-linewidth", "int",
- Blt_Offset(PolygonSwitches, lineWidth), 0},
- {BLT_SWITCH_END}
-};
-
-static Blt_SwitchSpec lineSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-alpha", "int",
- Blt_Offset(LineSwitches, alpha), 0, 0, &alphaSwitch},
- {BLT_SWITCH_CUSTOM, "-color", "color",
- Blt_Offset(LineSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_CUSTOM, "-coords", "{x0 y0 x1 y1 ... xn yn}",
- Blt_Offset(LineSwitches, coords), 0, 0, &arraySwitch},
- {BLT_SWITCH_INT_POS, "-linewidth", "int",
- Blt_Offset(LineSwitches, lineWidth), 0},
- {BLT_SWITCH_CUSTOM, "-x", "{x0 x1 ... xn}",
- Blt_Offset(LineSwitches, x), 0, 0, &arraySwitch},
- {BLT_SWITCH_CUSTOM, "-y", "{x0 x1 ... xn}",
- Blt_Offset(LineSwitches, y), 0, 0, &arraySwitch},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- int alpha; /* Overrides alpha value of color. */
- Blt_Pixel bg; /* Color of rectangle. */
- Shadow shadow;
- int lineWidth; /* Width of outline. If zero, indicates to
- * draw a solid rectangle. */
- int radius; /* Radius of rounded corner. */
- int antialiased;
-} RectangleSwitches;
-
-static Blt_SwitchSpec rectangleSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-alpha", "int",
- Blt_Offset(RectangleSwitches, alpha), 0, 0, &alphaSwitch},
- {BLT_SWITCH_CUSTOM, "-color", "color",
- Blt_Offset(RectangleSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_BOOLEAN, "-antialiased", "bool",
- Blt_Offset(RectangleSwitches, antialiased), 0},
- {BLT_SWITCH_INT_NNEG, "-radius", "number",
- Blt_Offset(RectangleSwitches, radius), 0},
- {BLT_SWITCH_CUSTOM, "-shadow", "offset",
- Blt_Offset(RectangleSwitches, shadow), 0, 0, &shadowSwitch},
- {BLT_SWITCH_INT_NNEG, "-linewidth", "number",
- Blt_Offset(RectangleSwitches, lineWidth), 0},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- int alpha; /* Overrides alpha value of color. */
- int kerning;
- Blt_Pixel color; /* Color of text. */
- Shadow shadow;
- int fontSize;
- Tcl_Obj *fontObjPtr;
- int justify;
- Tk_Anchor anchor;
- float angle;
-} TextSwitches;
-
-static Blt_SwitchSpec textSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-alpha", "int",
- Blt_Offset(TextSwitches, alpha), 0, 0, &alphaSwitch},
- {BLT_SWITCH_CUSTOM, "-anchor", "anchor",
- Blt_Offset(TextSwitches, anchor), 0, 0, &anchorSwitch},
- {BLT_SWITCH_CUSTOM, "-color", "colorName",
- Blt_Offset(TextSwitches, color), 0, 0, &colorSwitch},
- {BLT_SWITCH_OBJ, "-font", "fontName",
- Blt_Offset(TextSwitches, fontObjPtr), 0},
- {BLT_SWITCH_BOOLEAN, "-kerning", "bool",
- Blt_Offset(TextSwitches, kerning), 0},
- {BLT_SWITCH_FLOAT, "-rotate", "angle",
- Blt_Offset(TextSwitches, angle), 0},
- {BLT_SWITCH_INT, "-size", "number",
- Blt_Offset(TextSwitches, fontSize), 0},
- {BLT_SWITCH_CUSTOM, "-shadow", "offset",
- Blt_Offset(TextSwitches, shadow), 0, 0, &shadowSwitch},
- {BLT_SWITCH_END}
-};
-
-static Pict *
-BgPicture(Pict *srcPtr, int sx, int sy, int w, int h)
-{
- Pict *destPtr;
- Blt_Pixel *srcRowPtr, *destRowPtr;
- size_t nBytes;
- int y;
-
- w = MIN(w, srcPtr->width - sx);
- h = MIN(h, srcPtr->height - sy);
- destPtr = Blt_CreatePicture(w*4, h*4);
- srcRowPtr = srcPtr->bits + (sy * srcPtr->width) + sx;
- destRowPtr = destPtr->bits;
- nBytes = sizeof(Blt_Pixel) * destPtr->pixelsPerRow;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp, *sp, *send;
- Blt_Pixel *nextRowPtr;
-
- for (dp = destRowPtr, sp = srcRowPtr, send = sp + w; sp < send; sp++) {
- Blt_Pixel p;
-
- p.u32 = sp->u32;
- dp[0].u32 = dp[1].u32 = dp[2].u32 = dp[3].u32 = p.u32;
- dp += 4;
- }
-
- nextRowPtr = destRowPtr + destPtr->pixelsPerRow;
- memcpy(nextRowPtr, destRowPtr, nBytes);
- nextRowPtr += destPtr->pixelsPerRow;
- memcpy(nextRowPtr, destRowPtr, nBytes);
- nextRowPtr += destPtr->pixelsPerRow;
- memcpy(nextRowPtr, destRowPtr, nBytes);
- nextRowPtr += destPtr->pixelsPerRow;
- destRowPtr = nextRowPtr;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- return destPtr;
-}
-
-static void
-MarkPicture(Pict *srcPtr)
-{
- Blt_Pixel *srcRowPtr;
- int y;
-
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
-
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- if (sp->Alpha != 0x0) {
- sp->Alpha = 0xFF;
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
-}
-
-#if DRAWTEXT
-static void
-MeasureText(FtFont *fontPtr, const char *string, size_t length,
- size_t *widthPtr, size_t *heightPtr);
-
-static size_t GetTextWidth(FtFont *fontPtr, const char *string, size_t length,
- int kerning);
-#endif /*HAVE_FT2BUILD_H*/
-
-/*
- *---------------------------------------------------------------------------
- *
- * ArrayFreeProc --
- *
- * Free the storage associated with the -table switch.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-ArrayFreeProc(char *record, int offset, int flags)
-{
- Array *arrayPtr = (Array *)(record + offset);
-
- if (arrayPtr->values != NULL) {
- Blt_Free(arrayPtr->values);
- }
- arrayPtr->values = NULL;
- arrayPtr->nValues = 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ArraySwitchProc --
- *
- * Convert a Tcl_Obj list of numbers into an array of floats.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ArraySwitchProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Tcl_Obj **objv;
- Array *arrayPtr = (Array *)(record + offset);
- float *values;
- int i;
- int objc;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- values = Blt_Malloc(sizeof(float) * objc);
- if (values == NULL) {
- Tcl_AppendResult(interp, "can't allocated coordinate array of ",
- Blt_Itoa(objc), " elements", (char *)NULL);
- return TCL_ERROR;
- }
- for (i = 0; i < objc; i++) {
- double x;
-
- if (Tcl_GetDoubleFromObj(interp, objv[i], &x) != TCL_OK) {
- Blt_Free(values);
- return TCL_ERROR;
- }
- values[i] = (float)x;
- }
- arrayPtr->values = values;
- arrayPtr->nValues = objc;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AlphaSwitch --
- *
- * Convert a Tcl_Obj representing a number for the alpha value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-AlphaSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- int *alphaPtr = (int *)(record + offset);
- int value;
-
- if (Tcl_GetIntFromObj(interp, objPtr, &value) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((value < 0) || (value > 255)) {
- Tcl_AppendResult(interp, "bad value \"", Tcl_GetString(objPtr),
- "\" for alpha: must be 0..255", (char *)NULL);
- return TCL_ERROR;
- }
- *alphaPtr = value;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AnchorSwitch --
- *
- * Convert a Tcl_Obj representing an anchor.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-AnchorSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tk_Anchor *anchorPtr = (Tk_Anchor *)(record + offset);
-
- if (Tk_GetAnchorFromObj(interp, objPtr, anchorPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShadowSwitch --
- *
- * Convert a Tcl_Obj representing a number for the alpha value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ShadowSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Shadow *shadowPtr = (Shadow *)(record + offset);
- int value, alpha;
- int objc;
- Tcl_Obj **objv;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((objc != 1) && (objc != 2)) {
- Tcl_AppendResult(interp, "bad shadow list \"", Tcl_GetString(objPtr),
- "\": should be \"offset ?alpha?\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (Tcl_GetIntFromObj(interp, objv[0], &value) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((value < 0) || (value > 20)) {
- Tcl_AppendResult(interp, "bad offset value \"",
- Tcl_GetString(objv[0]), "\": must be 0..20", (char *)NULL);
- return TCL_ERROR;
- }
- alpha = 0xA0;
- if (objc == 2) {
- if (Tcl_GetIntFromObj(interp, objv[1], &alpha) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((alpha < 0) || (alpha > 255)) {
- Tcl_AppendResult(interp, "bad value \"", Tcl_GetString(objv[1]),
- "\" for alpha: must be 0..255", (char *)NULL);
- return TCL_ERROR;
- }
- }
- shadowPtr->offset = (unsigned int)value;
- shadowPtr->alpha = (unsigned int)alpha;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ColorSwitchProc --
- *
- * Convert a Tcl_Obj representing a Blt_Pixel color.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-Blt_ColorSwitchProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_Pixel *pixelPtr = (Blt_Pixel *)(record + offset);
- const char *string;
-
- string = Tcl_GetString(objPtr);
- if (string[0] == '\0') {
- pixelPtr->u32 = 0x00;
- return TCL_OK;
- }
- if (Blt_GetPixelFromObj(interp, objPtr, pixelPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-#if DRAWTEXT
-/*
- *---------------------------------------------------------------------------
- *
- * CreateSimpleTextLayout --
- *
- * Get the extents of a possibly multiple-lined text string.
- *
- * Results:
- * Returns via *widthPtr* and *heightPtr* the dimensions of the text
- * string.
- *
- *---------------------------------------------------------------------------
- */
-static TextLayout *
-CreateSimpleTextLayout(FtFont *fontPtr, const char *text, size_t textLen,
- TextStyle *tsPtr)
-{
- TextFragment *fp;
- TextLayout *layoutPtr;
- size_t count; /* Count # of characters on each line */
- int lineHeight;
- int maxHeight, maxWidth;
- int nFrags;
- int width; /* Running dimensions of the text */
- const char *p, *endp, *start;
- int i;
- size_t size;
-
- nFrags = 0;
- endp = text + ((textLen < 0) ? strlen(text) : textLen);
- for (p = text; p < endp; p++) {
- if (*p == '\n') {
- nFrags++;
- }
- }
- if ((p != text) && (*(p - 1) != '\n')) {
- nFrags++;
- }
- size = sizeof(TextLayout) + (sizeof(TextFragment) * (nFrags - 1));
-
- layoutPtr = Blt_AssertCalloc(1, size);
- layoutPtr->nFrags = nFrags;
-
- nFrags = count = 0;
- width = maxWidth = 0;
- maxHeight = tsPtr->padTop;
- lineHeight = fontPtr->height;
-
- fp = layoutPtr->fragments;
- for (p = start = text; p < endp; p++) {
- if (*p == '\n') {
- size_t w;
-
- if (count > 0) {
- w = GetTextWidth(fontPtr, start, count, 1);
- if (w > maxWidth) {
- maxWidth = w;
- }
- } else {
- w = 0;
- }
- fp->width = w;
- fp->count = count;
- fp->sy = fp->y = maxHeight + fontPtr->ascent;
- fp->text = start;
- maxHeight += lineHeight;
- fp++;
- nFrags++;
- start = p + 1; /* Start the text on the next line */
- count = 0; /* Reset to indicate the start of a new
- * line */
- continue;
- }
- count++;
- }
- if (nFrags < layoutPtr->nFrags) {
- size_t w;
-
- w = GetTextWidth(fontPtr, start, count, 1);
- if (w > maxWidth) {
- maxWidth = w;
- }
- fp->width = w;
- fp->count = count;
- fp->sy = fp->y = maxHeight + fontPtr->ascent;
- fp->text = start;
- maxHeight += lineHeight;
- nFrags++;
- }
- maxHeight += tsPtr->padBottom;
- maxWidth += PADDING(tsPtr->xPad);
- fp = layoutPtr->fragments;
- for (i = 0; i < nFrags; i++, fp++) {
- switch (tsPtr->justify) {
- default:
- case TK_JUSTIFY_LEFT:
- /* No offset for left justified text strings */
- fp->x = fp->sx = tsPtr->padLeft;
- break;
- case TK_JUSTIFY_RIGHT:
- fp->x = fp->sx = (maxWidth - fp->width) - tsPtr->padRight;
- break;
- case TK_JUSTIFY_CENTER:
- fp->x = fp->sx = (maxWidth - fp->width) / 2;
- break;
- }
- }
- if (tsPtr->underline >= 0) {
- fp = layoutPtr->fragments;
- for (i = 0; i < nFrags; i++, fp++) {
- int first, last;
-
- first = fp->text - text;
- last = first + fp->count;
- if ((tsPtr->underline >= first) && (tsPtr->underline < last)) {
- layoutPtr->underlinePtr = fp;
- layoutPtr->underline = tsPtr->underline - first;
- break;
- }
- }
- }
- layoutPtr->width = maxWidth;
- layoutPtr->height = maxHeight - tsPtr->leader;
- return layoutPtr;
-}
-#endif
-
-static void INLINE
-PutPixel(Pict *destPtr, int x, int y, Blt_Pixel *colorPtr)
-{
- if ((x >= 0) && (x < destPtr->width) && (y >= 0) && (y < destPtr->height)) {
- Blt_Pixel *dp;
-
- dp = Blt_PicturePixel(destPtr, x, y);
- dp->u32 = colorPtr->u32;
- }
-}
-
-
-static INLINE Blt_Pixel
-PremultiplyAlpha(Blt_Pixel *colorPtr, unsigned int alpha)
-{
- Blt_Pixel new;
- int t;
-
- new.u32 = colorPtr->u32;
- alpha = imul8x8(alpha, colorPtr->Alpha, t);
- if ((alpha != 0xFF) && (alpha != 0x00)) {
- new.Red = imul8x8(alpha, colorPtr->Red, t);
- new.Green = imul8x8(alpha, colorPtr->Green, t);
- new.Blue = imul8x8(alpha, colorPtr->Blue, t);
- }
- new.Alpha = alpha;
- return new;
-}
-
-static void INLINE
-HorizLine(Pict *destPtr, int x1, int x2, int y, Blt_Pixel *colorPtr)
-{
- Blt_Pixel *destRowPtr;
- Blt_Pixel *dp, *dend;
- size_t length;
-
- if (x1 > x2) {
- int tmp;
-
- tmp = x1, x1 = x2, x2 = tmp;
- }
- destRowPtr = destPtr->bits + (destPtr->pixelsPerRow * y) + x1;
- length = x2 - x1 + 1;
- for (dp = destRowPtr, dend = dp + length; dp < dend; dp++) {
- dp->u32 = colorPtr->u32;
- }
-}
-
-static void INLINE
-VertLine(Pict *destPtr, int x, int y1, int y2, Blt_Pixel *colorPtr)
-{
- Blt_Pixel *dp;
- int y;
-
- if (y1 > y2) {
- int tmp;
-
- tmp = y1, y1 = y2, y2 = tmp;
- }
- dp = destPtr->bits + (destPtr->pixelsPerRow * y1) + x;
- for (y = y1; y <= y2; y++) {
- dp->u32 = colorPtr->u32;
- dp += destPtr->pixelsPerRow;
- }
-}
-
-static INLINE void
-BlendPixel(Blt_Pixel *bgPtr, Blt_Pixel *colorPtr, unsigned char weight)
-{
- unsigned char alpha;
- int t1;
-
- alpha = imul8x8(colorPtr->Alpha, weight, t1);
-#ifdef notdef
- fprintf(stderr, "colorAlpha=%d weight=%d, alpha=%d, beta=%d\n",
- colorPtr->Alpha, weight, alpha, alpha ^ 0xFF);
-#endif
- if (alpha == 0xFF) {
- bgPtr->u32 = colorPtr->u32;
- } else if (alpha != 0x00) {
- unsigned char beta;
- int t2;
-
- beta = alpha ^ 0xFF;
- bgPtr->Red = imul8x8(alpha, colorPtr->Red, t1) +
- imul8x8(beta, bgPtr->Red, t2);
- bgPtr->Green = imul8x8(alpha, colorPtr->Green, t1) +
- imul8x8(beta, bgPtr->Green, t2);
- bgPtr->Blue = imul8x8(alpha, colorPtr->Blue, t1) +
- imul8x8(beta, bgPtr->Blue, t2);
- bgPtr->Alpha = alpha + imul8x8(beta, bgPtr->Alpha, t2);
-#ifdef notdef
- fprintf(stderr, "r=%d, g=%d, b=%d, a=%d, alpha=%d\n",
- bgPtr->Red, bgPtr->Green, bgPtr->Blue, bgPtr->Alpha, alpha);
-#endif
- }
-}
-
-static void INLINE
-PutPixel2(Pict *destPtr, int x, int y, Blt_Pixel *colorPtr,
- unsigned char weight)
-{
- if ((x >= 0) && (x < destPtr->width) && (y >= 0) && (y < destPtr->height)) {
- Blt_Pixel *dp;
-
- dp = Blt_PicturePixel(destPtr, x, y);
- BlendPixel(dp, colorPtr, weight);
- }
-}
-
-static void
-PaintLineSegment(
- Pict *destPtr,
- int x1, int y1,
- int x2, int y2,
- int lineWidth,
- Blt_Pixel *colorPtr)
-{
- int dx, dy, xDir;
- unsigned long error;
- Blt_Pixel edge;
-
- if (y1 > y2) {
- int tmp;
-
- tmp = y1, y1 = y2, y2 = tmp;
- tmp = x1, x1 = x2, x2 = tmp;
- }
- edge = PremultiplyAlpha(colorPtr, 255);
- /* First and last Pixels always get Set: */
- PutPixel2(destPtr, x1, y1, colorPtr, 255);
- PutPixel2(destPtr, x2, y2, colorPtr, 255);
-
- dx = x2 - x1;
- dy = y2 - y1;
-
- if (dx >= 0) {
- xDir = 1;
- } else {
- xDir = -1;
- dx = -dx;
- }
- if (dy == 0) { /* Horizontal line */
- HorizLine(destPtr, x1, x2, y1, &edge);
- return;
- }
- if (dx == 0) { /* Vertical line */
- VertLine(destPtr, x1, y1, y2, &edge);
- return;
- }
- if (dx == dy) { /* Diagonal line. */
- Blt_Pixel *dp;
-
- dp = Blt_PicturePixel(destPtr, x1, y1);
- while(dy-- > 0) {
- dp += destPtr->pixelsPerRow + xDir;
- dp->u32 = colorPtr->u32;
- }
- return;
- }
-
- /* use Wu Antialiasing: */
-
- error = 0;
- if (dy > dx) { /* y-major line */
- unsigned long adjust;
-
- /* x1 -= lineWidth / 2; */
- adjust = (dx << 16) / dy;
- while(--dy) {
- unsigned int weight;
-
- error += adjust;
- ++y1;
- if (error & ~0xFFFF) {
- x1 += xDir;
- error &= 0xFFFF;
- }
- weight = (unsigned char)(error >> 8);
- PutPixel2(destPtr, x1, y1, colorPtr, ~weight);
- PutPixel2(destPtr, x1 + xDir, y1, colorPtr, weight);
- }
- } else { /* x-major line */
- unsigned long adjust;
-
- /* y1 -= lineWidth / 2; */
- adjust = (dy << 16) / dx;
- while (--dx) {
- unsigned int weight;
-
- error += adjust;
- x1 += xDir;
- if (error & ~0xFFFF) {
- y1++;
- error &= 0xFFFF;
- }
- weight = (error >> 8) & 0xFF;
- PutPixel2(destPtr, x1, y1, colorPtr, ~weight);
- PutPixel2(destPtr, x1, y1 + 1, colorPtr, weight);
- }
- }
-}
-
-#include "bltPaintDraw.c"
-
-static void
-PaintLineSegment2(
- Pict *destPtr,
- int x1, int y1,
- int x2, int y2,
- int cw,
- Blt_Pixel *colorPtr)
-{
- Blt_Pixel interior;
- int dx, dy, xDir;
- unsigned long error;
-
- if (y1 > y2) {
- int tmp;
-
- tmp = y1, y1 = y2, y2 = tmp;
- tmp = x1, x1 = x2, x2 = tmp;
- cw = !cw;
- }
- if (x1 > x2) {
- cw = !cw;
- }
- interior = PremultiplyAlpha(colorPtr, 255);
- /* First and last Pixels always get Set: */
- PutPixel(destPtr, x1, y1, &interior);
- PutPixel(destPtr, x2, y2, &interior);
-
- dx = x2 - x1;
- dy = y2 - y1;
-
- if (dx >= 0) {
- xDir = 1;
- } else {
- xDir = -1;
- dx = -dx;
- }
- if (dx == 0) { /* Vertical line */
- VertLine(destPtr, x1, y1, y2, &interior);
- return;
- }
- if (dy == 0) { /* Horizontal line */
- HorizLine(destPtr, x1, x2, y1, &interior);
- return;
- }
- if (dx == dy) { /* Diagonal line. */
- Blt_Pixel *dp;
-
- dp = Blt_PicturePixel(destPtr, x1, y1);
- while(dy-- > 0) {
- dp += destPtr->pixelsPerRow + xDir;
- dp->u32 = interior.u32;
- }
- return;
- }
-
- /* use Wu Antialiasing: */
-
- error = 0;
- if (dy > dx) { /* y-major line */
- unsigned long adjust;
-
- /* x1 -= lineWidth / 2; */
- adjust = (dx << 16) / dy;
- while(--dy) {
- Blt_Pixel *dp;
- int x;
- unsigned char weight;
-
- error += adjust;
- ++y1;
- if (error & ~0xFFFF) {
- x1 += xDir;
- error &= 0xFFFF;
- }
- dp = Blt_PicturePixel(destPtr, x1, y1);
- weight = (unsigned char)(error >> 8);
- x = x1;
- if (x >= 0) {
- if (cw) {
- *dp = PremultiplyAlpha(colorPtr, weight ^ 0xFF);
- } else {
- *dp = interior;
- }
- }
- x += xDir;
- dp += xDir;
- if (x >= 0) {
- if (!cw) {
- *dp = PremultiplyAlpha(colorPtr, weight);
- } else {
- *dp = interior;
- }
- }
- }
- } else { /* x-major line */
- unsigned long adjust;
-
- /* y1 -= lineWidth / 2; */
- adjust = (dy << 16) / dx;
- while (--dx) {
- Blt_Pixel *dp;
- int y;
- unsigned char weight;
-
- error += adjust;
- x1 += xDir;
- if (error & ~0xFFFF) {
- y1++;
- error &= 0xFFFF;
- }
- dp = Blt_PicturePixel(destPtr, x1, y1);
- weight = (unsigned char)(error >> 8);
- y = y1;
- if (y >= 0) {
- if (!cw) {
- *dp = PremultiplyAlpha(colorPtr, weight ^ 0xFF);
- } else {
- *dp = interior;
- }
- }
- dp += destPtr->pixelsPerRow;
- y++;
- if (y >= 0) {
- if (cw) {
- *dp = PremultiplyAlpha(colorPtr, weight);
- } else {
- *dp = interior;
- }
- }
- }
- }
- destPtr->flags |= (BLT_PIC_BLEND | BLT_PIC_ASSOCIATED_COLORS);
-}
-
-
-static void
-PaintPolyline(
- Pict *destPtr,
- int nPoints,
- Point2f *points,
- int lineWidth,
- Blt_Pixel *colorPtr)
-{
- int i;
- Region2d r;
- Point2f p;
-
- r.left = r.top = 0;
- r.right = destPtr->width - 1;
- r.bottom = destPtr->height - 1;
- p.x = points[0].x, p.y = points[0].y;
- for (i = 1; i < nPoints; i++) {
- Point2f q, next;
-
- q.x = points[i].x, q.y = points[i].y;
- next = q;
- PaintLineSegment(destPtr, ROUND(p.x), ROUND(p.y), ROUND(q.x),
- ROUND(q.y), 0, colorPtr);
-#ifdef notdef
- if (Blt_LineRectClip(&r, &p, &q)) {
- PaintLineSegment(destPtr, ROUND(p.x), ROUND(p.y), ROUND(q.x),
- ROUND(q.y), 1, colorPtr);
- }
-#endif
- p = next;
- }
-}
-
-#if DRAWTEXT
-
-#undef __FTERRORS_H__
-#define FT_ERRORDEF( e, v, s ) { e, s },
-#define FT_ERROR_START_LIST {
-#define FT_ERROR_END_LIST { -1, 0 } };
-
-static const char *
-FtError(FT_Error ftError)
-{
- struct ft_errors {
- int code;
- const char* msg;
- };
- static struct ft_errors ft_err_mesgs[] =
-#include FT_ERRORS_H
-
- struct ft_errors *fp;
- for (fp = ft_err_mesgs; fp->msg != NULL; fp++) {
- if (fp->code == ftError) {
- return fp->msg;
- }
- }
- return "unknown Freetype error";
-}
-
-static void
-MeasureText(FtFont *fontPtr, const char *string, size_t length,
- size_t *widthPtr, size_t *heightPtr)
-{
- FT_Vector pen; /* Untransformed origin */
- FT_GlyphSlot slot;
- FT_Matrix matrix; /* Transformation matrix. */
- int maxX, maxY;
- const char *p, *pend;
- double radians;
- int x;
- FT_Face face;
-
- radians = 0.0;
- matrix.yy = matrix.xx = (FT_Fixed)(cos(radians) * 65536.0);
- matrix.yx = (FT_Fixed)(sin(radians) * 65536.0);
- matrix.xy = -matrix.yx;
-
- face = fontPtr->face;
- slot = face->glyph;
-
- maxY = maxX = 0;
- pen.y = 0;
- x = 0;
-#ifdef notdef
- fprintf(stderr, "face->height=%d, face->size->height=%d\n",
- face->height, (int)face->size->metrics.height);
- fprintf(stderr, "face->ascender=%d, face->descender=%d\n",
- face->ascender, face->descender);
-#endif
- for (p = string, pend = p + length; p < pend; p++) {
- maxY += face->size->metrics.height;
- pen.x = x << 6;
- for (/*empty*/; (*p != '\n') && (p < pend); p++) {
- FT_Error ftError;
-
- FT_Set_Transform(face, &matrix, &pen);
- /* Load glyph image into the slot (erase previous) */
- ftError = FT_Load_Char(face, *p, FT_LOAD_RENDER);
- if (ftError != 0) {
- fprintf(stderr, "can't load character \"%c\": %s\n", *p,
- FtError(ftError));
- continue; /* ignore errors */
- }
- pen.x += slot->advance.x;
- pen.y += slot->advance.y;
- }
- if (pen.x > maxX) {
- maxX = pen.x;
- }
- }
-#ifdef notdef
- fprintf(stderr, "w=%d,h=%d\n", maxX >> 6, maxY >> 6);
-#endif
- *widthPtr = (size_t)(maxX >> 6);
- *heightPtr = (size_t)(maxY >> 6);
-#ifdef notdef
- fprintf(stderr, "w=%lu,h=%lu\n", (unsigned long)*widthPtr,
- (unsigned long)*heightPtr);
-#endif
-}
-
-static size_t
-GetTextWidth(FtFont *fontPtr, const char *string, size_t length, int kerning)
-{
- FT_Vector pen; /* Untransformed origin */
- FT_GlyphSlot slot;
- FT_Matrix matrix; /* Transformation matrix. */
- int maxX, maxY;
- const char *p, *pend;
- double radians;
- FT_Face face;
- int previous;
- FT_Error ftError;
-
- radians = 0.0;
- matrix.yy = matrix.xx = (FT_Fixed)(cos(radians) * 65536.0);
- matrix.yx = (FT_Fixed)(sin(radians) * 65536.0);
- matrix.xy = -matrix.yx;
-
- face = fontPtr->face;
- slot = face->glyph;
-
- maxY = maxX = 0;
- pen.y = pen.x = 0;
-#ifdef notdef
- fprintf(stderr, "face->height=%d, face->size->height=%d\n",
- face->height, (int)face->size->metrics.height);
-#endif
- for (p = string, pend = p + length; p < pend; p++) {
- int current;
-
- current = FT_Get_Char_Index(face, *p);
- if ((kerning) && (previous >= 0)) {
- FT_Vector delta;
-
- FT_Get_Kerning(face, previous, current, FT_KERNING_DEFAULT, &delta);
- pen.x += delta.x;
- }
- FT_Set_Transform(face, &matrix, &pen);
- previous = current;
- /* load glyph image into the slot (erase previous one) */
- ftError = FT_Load_Glyph(face, current, FT_LOAD_DEFAULT);
- if (ftError) {
- fprintf(stderr, "can't load character \"%c\" (%d): %s\n", *p,
- current, FtError(ftError));
- continue; /* ignore errors */
- }
- pen.x += slot->advance.x;
- pen.y += slot->advance.y;
- if (pen.x > maxX) {
- maxX = pen.x;
- }
- }
- return maxX >> 6;
-}
-
-
-static void
-BlitGlyph(Pict *destPtr,
- FT_GlyphSlot slot,
- int dx, int dy,
- int xx, int yy,
- Blt_Pixel *colorPtr)
-{
- int gx, gy, gw, gh;
-
-#ifdef notdef
- fprintf(stderr, "dx=%d, dy=%d\n", dx, dy);
- fprintf(stderr, " slot.bitmap.width=%d\n", (int)slot->bitmap.width);
- fprintf(stderr, " slot.bitmap.rows=%d\n", slot->bitmap.rows);
- fprintf(stderr, " slot.bitmap_left=%d\n", (int)slot->bitmap_left);
- fprintf(stderr, " slot.bitmap_top=%d\n", (int)slot->bitmap_top);
- fprintf(stderr, " slot.bitmap.pixel_mode=%x\n", slot->bitmap.pixel_mode);
- fprintf(stderr, " slot.advance.x=%d\n", (int)slot->advance.x);
- fprintf(stderr, " slot.advance.y=%d\n", (int)slot->advance.y);
-
- fprintf(stderr, " slot.format=%c%c%c%c\n",
- (slot->format >> 24) & 0xFF,
- (slot->format >> 16) & 0xFF,
- (slot->format >> 8) & 0xFF,
- (slot->format & 0xFF));
-#endif
- if ((dx >= destPtr->width) || ((dx + slot->bitmap.width) <= 0) ||
- (dy >= destPtr->height) || ((dy + slot->bitmap.rows) <= 0)) {
- return; /* No portion of the glyph is visible in the
- * picture. */
- }
- /* By default, set the region to cover the entire glyph */
- gx = 0;
- gy = 0;
- gw = slot->bitmap.width;
- gh = slot->bitmap.rows;
-
- /* Determine the portion of the glyph inside the picture. */
-
- if (dx < 0) { /* Left side of glyph overhangs. */
- gx -= dx;
- gw += dx;
- dx = 0;
- }
- if (dy < 0) { /* Top of glyph overhangs. */
- gy -= dy;
- gh += dy;
- dy = 0;
- }
- if ((dx + gw) > destPtr->width) { /* Right side of glyph overhangs. */
- gw = destPtr->width - dx;
- }
- if ((dy + gh) > destPtr->height) { /* Bottom of glyph overhangs. */
- gh = destPtr->height - dy;
- }
- if (slot->bitmap.pixel_mode == FT_PIXEL_MODE_MONO) {
- Blt_Pixel *destRowPtr;
- unsigned char *srcRowPtr;
- int y;
-
- srcRowPtr = slot->bitmap.buffer + (gy * slot->bitmap.pitch);
- destRowPtr = Blt_PicturePixel(destPtr, xx, yy);
- for (y = gy; y < gh; y++) {
- Blt_Pixel *dp, *dend;
- int x;
-
- for (dp = destRowPtr, dend = dp+gw, x = gx; dp < dend; x++, dp++) {
- int pixel;
-
- pixel = srcRowPtr[x >> 3] & (1 << (7 - (x & 0x7)));
- if (pixel != 0x0) {
- BlendPixel(dp, colorPtr, 0xFF);
- }
- }
- srcRowPtr += slot->bitmap.pitch;
- destRowPtr += destPtr->pixelsPerRow;
- }
- } else {
- Blt_Pixel *destRowPtr;
- unsigned char *srcRowPtr;
- int y;
-
- srcRowPtr = slot->bitmap.buffer + ((gy * slot->bitmap.pitch) + gx);
- destRowPtr = Blt_PicturePixel(destPtr, dx, dy);
- for (y = gy; y < gh; y++) {
- Blt_Pixel *dp;
- unsigned char *sp, *send;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + gw; sp < send; sp++, dp++) {
- if (*sp != 0x0) {
- BlendPixel(dp, colorPtr, *sp);
- }
- }
- srcRowPtr += slot->bitmap.pitch;
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
-}
-
-static void
-CopyGrayGlyph(Pict *destPtr, FT_GlyphSlot slot, int x, int y,
- Blt_Pixel *colorPtr)
-{
- int gx, gy, gw, gh;
-
-#ifdef notdef
- fprintf(stderr, "x=%d, y=%d\n", x, y);
- fprintf(stderr, " slot.bitmap.width=%d\n", slot->bitmap.width);
- fprintf(stderr, " slot.bitmap.rows=%d\n", slot->bitmap.rows);
- fprintf(stderr, " slot.bitmap_left=%d\n", slot->bitmap_left);
- fprintf(stderr, " slot.bitmap_top=%d\n", slot->bitmap_top);
- fprintf(stderr, " slot.bitmap.pixel_mode=%x\n", slot->bitmap.pixel_mode);
- fprintf(stderr, " slot.advance.x=%d\n", slot->advance.x);
- fprintf(stderr, " slot.advance.y=%d\n", slot->advance.y);
-
- fprintf(stderr, " slot.format=%c%c%c%c\n",
- (slot->format >> 24) & 0xFF,
- (slot->format >> 16) & 0xFF,
- (slot->format >> 8) & 0xFF,
- (slot->format & 0xFF));
-#endif
- if ((x >= destPtr->width) || ((x + slot->bitmap.width) <= 0) ||
- (y >= destPtr->height) || ((y + slot->bitmap.rows) <= 0)) {
- return; /* No portion of the glyph is visible in the
- * picture. */
- }
-
- /* By default, set the region to cover the entire glyph */
- gx = 0;
- gy = 0;
- gw = slot->bitmap.width;
- gh = slot->bitmap.rows;
-#ifdef notdef
- fprintf(stderr, "before: x=%d,y=%d, gx=%d, gy=%d gw=%d gh=%d\n",
- x, y, gx, gy, gw, gh);
-#endif
- /* Determine the portion of the glyph inside the picture. */
-
- if (x < 0) { /* Left side of glyph overhangs. */
- gx -= x;
- gw += x;
- x = 0;
- }
- if (y < 0) { /* Top of glyph overhangs. */
- gy -= y;
- gh += y;
- y = 0;
- }
- if ((x + gw) > destPtr->width) { /* Right side of glyph overhangs. */
- gw = destPtr->width - x;
- }
- if ((y + gh) > destPtr->height) { /* Bottom of glyph overhangs. */
- gh = destPtr->height - y;
- }
-#ifdef notdef
- fprintf(stderr, "after: x=%d,y=%d, gx=%d, gy=%d gw=%d gh=%d\n",
- x, y, gx, gy, gw, gh);
-#endif
- {
- Blt_Pixel *destRowPtr;
- unsigned char *srcRowPtr;
-
- srcRowPtr = slot->bitmap.buffer + ((gy * slot->bitmap.pitch) + gx);
- destRowPtr = Blt_PicturePixel(destPtr, x, y);
- for (y = gy; y < gh; y++) {
- Blt_Pixel *dp;
- unsigned char *sp, *send;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + gw; sp < send; sp++, dp++) {
- if (*sp != 0x0) {
- int t, a;
- a = imul8x8(*sp, colorPtr->Alpha, t);
- dp->u32 = colorPtr->u32;
- dp->Alpha = a;
- }
- }
- srcRowPtr += slot->bitmap.pitch;
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
-}
-
-static void
-PaintGrayGlyph(Pict *destPtr, FT_GlyphSlot slot, int x, int y,
- Blt_Pixel *colorPtr)
-{
- int gx, gy, gw, gh;
-
-#ifdef notdef
- fprintf(stderr, "x=%d, y=%d\n", x, y);
- fprintf(stderr, " slot.bitmap.width=%d\n", slot->bitmap.width);
- fprintf(stderr, " slot.bitmap.rows=%d\n", slot->bitmap.rows);
- fprintf(stderr, " slot.bitmap_left=%d\n", slot->bitmap_left);
- fprintf(stderr, " slot.bitmap_top=%d\n", slot->bitmap_top);
- fprintf(stderr, " slot.bitmap.pixel_mode=%x\n", slot->bitmap.pixel_mode);
- fprintf(stderr, " slot.advance.x=%d\n", slot->advance.x);
- fprintf(stderr, " slot.advance.y=%d\n", slot->advance.y);
-
- fprintf(stderr, " slot.format=%c%c%c%c\n",
- (slot->format >> 24) & 0xFF,
- (slot->format >> 16) & 0xFF,
- (slot->format >> 8) & 0xFF,
- (slot->format & 0xFF));
-#endif
- if ((x >= destPtr->width) || ((x + slot->bitmap.width) <= 0) ||
- (y >= destPtr->height) || ((y + slot->bitmap.rows) <= 0)) {
- return; /* No portion of the glyph is visible in the
- * picture. */
- }
-
- /* By default, set the region to cover the entire glyph */
- gx = 0;
- gy = 0;
- gw = slot->bitmap.width;
- gh = slot->bitmap.rows;
-#ifdef notdef
- fprintf(stderr, "before: x=%d,y=%d, gx=%d, gy=%d gw=%d gh=%d\n",
- x, y, gx, gy, gw, gh);
-#endif
- /* Determine the portion of the glyph inside the picture. */
-
- if (x < 0) { /* Left side of glyph overhangs. */
- gx -= x;
- gw += x;
- x = 0;
- }
- if (y < 0) { /* Top of glyph overhangs. */
- gy -= y;
- gh += y;
- y = 0;
- }
- if ((x + gw) > destPtr->width) { /* Right side of glyph overhangs. */
- gw = destPtr->width - x;
- }
- if ((y + gh) > destPtr->height) { /* Bottom of glyph overhangs. */
- gh = destPtr->height - y;
- }
-#ifdef notdef
- fprintf(stderr, "after: x=%d,y=%d, gx=%d, gy=%d gw=%d gh=%d\n",
- x, y, gx, gy, gw, gh);
-#endif
- {
- Blt_Pixel *destRowPtr;
- unsigned char *srcRowPtr;
-
- srcRowPtr = slot->bitmap.buffer + ((gy * slot->bitmap.pitch) + gx);
- destRowPtr = Blt_PicturePixel(destPtr, x, y);
- for (y = gy; y < gh; y++) {
- Blt_Pixel *dp;
- unsigned char *sp, *send;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + gw; sp < send; sp++, dp++) {
- if (*sp != 0x0) {
- BlendPixel(dp, colorPtr, *sp);
- }
- }
- srcRowPtr += slot->bitmap.pitch;
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
-}
-
-static void
-CopyMonoGlyph(Pict *destPtr, FT_GlyphSlot slot, int dx, int dy,
- Blt_Pixel *colorPtr)
-{
- int gx, gy, gw, gh;
-
-#ifdef notdef
- fprintf(stderr, "dx=%d, dy=%d\n", dx, dy);
- fprintf(stderr, " slot.bitmap.width=%d\n", slot->bitmap.width);
- fprintf(stderr, " slot.bitmap.rows=%d\n", slot->bitmap.rows);
- fprintf(stderr, " slot.bitmap_left=%d\n", slot->bitmap_left);
- fprintf(stderr, " slot.bitmap_top=%d\n", slot->bitmap_top);
- fprintf(stderr, " slot.bitmap.pixel_mode=%x\n", slot->bitmap.pixel_mode);
- fprintf(stderr, " slot.advance.x=%d\n", slot->advance.x);
- fprintf(stderr, " slot.advance.y=%d\n", slot->advance.y);
- fprintf(stderr, " slot.format=%c%c%c%c\n",
- (slot->format >> 24) & 0xFF,
- (slot->format >> 16) & 0xFF,
- (slot->format >> 8) & 0xFF,
- (slot->format & 0xFF));
-#endif
-
- if ((dx >= destPtr->width) || ((dx + slot->bitmap.width) <= 0) ||
- (dy >= destPtr->height) || ((dy + slot->bitmap.rows) <= 0)) {
- return; /* No portion of the glyph is visible in the
- * picture. */
- }
- /* By default, set the region to cover the entire glyph */
- gx = 0;
- gy = 0;
- gw = slot->bitmap.width;
- gh = slot->bitmap.rows;
-
- /* Determine the portion of the glyph inside the picture. */
-
- if (dx < 0) { /* Left side of glyph overhangs. */
- gx -= dx;
- gw += dx;
- dx = 0;
- }
- if (dy < 0) { /* Top of glyph overhangs. */
- gy -= dy;
- gh += dy;
- dy = 0;
- }
- if ((dx + gw) > destPtr->width) { /* Right side of glyph overhangs. */
- gw = destPtr->width - dx;
- }
- if ((dy + gh) > destPtr->height) { /* Bottom of glyph overhangs. */
- gh = destPtr->height - dy;
- }
- {
- Blt_Pixel *destRowPtr;
- unsigned char *srcRowPtr;
- int y;
-
- srcRowPtr = slot->bitmap.buffer + (gy * slot->bitmap.pitch);
- destRowPtr = Blt_PicturePixel(destPtr, dx, dy);
- for (y = gy; y < gh; y++) {
- Blt_Pixel *dp, *dend;
- int x;
-
- for (dp = destRowPtr, dend = dp+gw, x = gx; dp < dend; x++, dp++) {
- int pixel;
-
- pixel = srcRowPtr[x >> 3] & (1 << (7 - (x & 0x7)));
- if (pixel != 0x0) {
- dp->u32 = colorPtr->u32;
- /* BlendPixel(dp, colorPtr, 0xFF); */
- }
- }
- srcRowPtr += slot->bitmap.pitch;
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
-}
-
-static int
-ScaleFont(Tcl_Interp *interp, FtFont *fontPtr, FT_F26Dot6 size)
-{
- FT_Error ftError;
- unsigned int xdpi, ydpi;
-
- Blt_ScreenDPI(Tk_MainWindow(interp), &xdpi, &ydpi);
- ftError = FT_Set_Char_Size(fontPtr->face, size, size, xdpi, ydpi);
- if (ftError) {
- Tcl_AppendResult(interp, "can't set font size to \"", Blt_Itoa(size),
- "\": ", FtError(ftError), (char *)NULL);
- return TCL_ERROR;
- }
- fontPtr->height = fontPtr->face->size->metrics.height >> 6;
- fontPtr->ascent = fontPtr->face->size->metrics.ascender >> 6;
- fontPtr->descent = fontPtr->face->size->metrics.descender >> 6;
- return TCL_OK;
-}
-
-static void
-RotateFont(FtFont *fontPtr, float angle)
-{
- /* Set up the transformation matrix. */
- double radians;
-
- radians = (angle / 180.0) * M_PI;
- fontPtr->matrix.yy = fontPtr->matrix.xx =
- (FT_Fixed)(cos(radians) * 65536.0);
- fontPtr->matrix.yx = (FT_Fixed)(sin(radians) * 65536.0);
- fontPtr->matrix.xy = -fontPtr->matrix.yx;
-}
-
-#if DRAWTEXT
-static FtFont *
-OpenFont(Tcl_Interp *interp, const char *fontName, size_t fontSize)
-{
- FtFont *fontPtr;
- FT_Error ftError;
- FT_Face face;
- const char *fileName;
-
- fontPtr = Blt_AssertCalloc(1, sizeof(FtFont));
- if (ftLibrary == NULL) {
- ftError = FT_Init_FreeType(&ftLibrary);
- if (ftError) {
- Tcl_AppendResult(interp, "can't initialize freetype library: ",
- FtError(ftError), (char *)NULL);
- return NULL;
- }
- }
- fontPtr->face = NULL;
- if (fontName[0] == '@') {
- fileName = fontName + 1;
- fontSize <<= 6;
- } else {
- double size;
-
- fileName = Blt_GetFontFile(interp, fontName, &size);
- if (fontSize == 0) {
- fontSize = (int)(size * 64.0 + 0.5);
- }
- }
- ftError = FT_New_Face(ftLibrary, fileName, 0, &face);
- if (ftError) {
- Tcl_AppendResult(interp, "can't create face from font file \"",
- fileName, "\": ", FtError(ftError), (char *)NULL);
- return NULL;
- }
- if (!FT_IS_SCALABLE(face)) {
- Tcl_AppendResult(interp, "can't use font \"", fontName,
- "\": font isn't scalable.", (char *)NULL);
- return NULL;
- }
- fontPtr->face = face;
- if (ScaleFont(interp, fontPtr, fontSize) != TCL_OK) {
- return NULL;
- }
- RotateFont(fontPtr, 0.0f); /* Initializes the rotation matrix. */
- return fontPtr;
-}
-
-#else
-
-static FtFont *
-OpenFont(Tcl_Interp *interp, const char *fontName, size_t fontSize)
-{
- Tcl_AppendResult(interp, "freetype library not available", (char *)NULL);
- return NULL;
-}
-
-#endif /*DRAWTEXT*/
-
-static void
-CloseFont(FtFont *fontPtr)
-{
-#ifdef HAVE_LIBXFT
- if (fontPtr->xftFont != NULL) {
- XftUnlockFace(fontPtr->xftFont);
- } else {
- FT_Done_Face(fontPtr->face);
- }
-#else
- FT_Done_Face(fontPtr->face);
-#endif /* HAVE_LIBXFT */
- Blt_Free(fontPtr);
-}
-
-
-static int
-PaintText(
- Pict *destPtr,
- FtFont *fontPtr,
- const char *string,
- size_t length,
- int x, int y, /* Anchor coordinates of text. */
- int kerning,
- Blt_Pixel *colorPtr)
-{
-#if DRAWTEXT
- FT_Error ftError;
- int h;
-
- FT_Vector pen; /* Untransformed origin */
- const char *p, *pend;
- FT_GlyphSlot slot;
- FT_Face face; /* Face object. */
-
- h = destPtr->height;
- face = fontPtr->face;
- slot = face->glyph;
- int xx, yy;
- int previous;
-
- if (destPtr->flags & BLT_PIC_ASSOCIATED_COLORS) {
- Blt_UnassociateColors(destPtr);
- }
-#ifdef notdef
- fprintf(stderr,
- "num_faces=%d\n"
- "face_flags=%x\n"
- "style_flags=%x\n"
- "num_glyphs=%d\n"
- "family_name=%s\n"
- "style_name=%s\n"
- "num_fixed_sizes=%d\n"
- "num_charmaps=%d\n"
- "units_per_EM=%d\n"
- "face->size->metrics.height=%d\n"
- "face->size->metrics.ascender=%d\n"
- "face->size->metrics.descender=%d\n"
- "ascender=%d\n"
- "descender=%d\n"
- "height=%d\n"
- "max_advance_width=%d\n"
- "max_advance_height=%d\n"
- "underline_position=%d\n"
- "underline_thickness=%d\n",
- face->num_faces,
- face->face_flags,
- face->style_flags,
- face->num_glyphs,
- face->family_name,
- face->style_name,
- face->num_fixed_sizes,
- face->num_charmaps,
- face->units_per_EM,
- face->size->metrics.height,
- face->size->metrics.ascender,
- face->size->metrics.descender,
- face->ascender,
- face->descender,
- face->height,
- face->max_advance_width,
- face->max_advance_height,
- face->underline_position,
- (int)face->underline_thickness);
-#endif
- xx = x, yy = y;
- previous = -1;
- FT_Set_Transform(face, &fontPtr->matrix, NULL);
- pen.y = (h - y) << 6;
- xx = x;
- pen.x = x << 6;
- for (p = string, pend = p + length; p < pend; p++) {
- int current;
-
- current = FT_Get_Char_Index(face, *p);
- if ((kerning) && (previous >= 0)) {
- FT_Vector delta;
-
- FT_Get_Kerning(face, previous, current, FT_KERNING_DEFAULT, &delta);
- pen.x += delta.x;
- }
- FT_Set_Transform(face, &fontPtr->matrix, &pen);
- previous = current;
- /* load glyph image into the slot (erase previous one) */
- ftError = FT_Load_Glyph(face, current, FT_LOAD_DEFAULT);
- if (ftError) {
- fprintf(stderr, "can't load character \"%c\": %s\n", *p,
- FtError(ftError));
- continue; /* ignore errors */
- }
- ftError = FT_Render_Glyph(slot, FT_RENDER_MODE_NORMAL);
- if (ftError) {
- fprintf(stderr, "can't render glyph \"%c\": %s\n", *p,
- FtError(ftError));
- continue; /* ignore errors */
- }
- switch(slot->bitmap.pixel_mode) {
- case FT_PIXEL_MODE_MONO:
- CopyMonoGlyph(destPtr, slot, pen.x >> 6, yy - slot->bitmap_top,
- colorPtr);
- break;
- case FT_PIXEL_MODE_LCD:
- case FT_PIXEL_MODE_LCD_V:
- case FT_PIXEL_MODE_GRAY:
-#ifdef notdef
- fprintf(stderr, "h=%d, slot->bitmap_top=%d\n", h, slot->bitmap_top);
-#endif
- PaintGrayGlyph(destPtr, slot, slot->bitmap_left,
- h - slot->bitmap_top, colorPtr);
- case FT_PIXEL_MODE_GRAY2:
- case FT_PIXEL_MODE_GRAY4:
- break;
- }
- pen.x += slot->advance.x;
- pen.y += slot->advance.y;
- previous = -1;
- }
-#endif /* HAVE_FT2BUILD_H */
- return TCL_OK;
-}
-
-#ifdef notdef
-static void
-PaintTextShadow(
- Blt_Picture picture,
- Tcl_Interp *interp,
- const char *string,
- int x, int y, /* Anchor coordinates of text. */
-
- TextSwitches *switchesPtr,
- int offset)
-{
- int w, h;
- Blt_Picture blur;
- Blt_Pixel color;
-
- MeasureText(FT_Face face, char *string, float angle, int *widthPtr,
- int *heightPtr)
- w = (width + offset*2);
- h = (height + offset*2);
- blur = Blt_CreatePicture(w, h);
- color.u32 = 0x00;
- Blt_BlankPicture(blur, &color);
- color.u32 = 0xA0000000;
-
- PaintText(blur, fontPtr, string, x+offset/2, y+offset/2, 0, colorPtr);
-
- PaintText(blur, interp, string, x+offset/2, y+offset/2, switchesPtr);
- Blt_BlurPicture(blur, blur, offset);
- Blt_BlendPictures(picture, blur, 0, 0, w, h, x+offset/2, y+offset/2);
- Blt_FreePicture(blur);
-}
-#endif
-#endif /*HAVE_FT2BUILD_H*/
-
-static void
-xPaintArc(Pict *destPtr, int x1, int y1, int x2, int y2, int lineWidth,
- Blt_Pixel *colorPtr)
-{
- Blt_Pixel *dp;
- double t;
- int r2;
- int radius;
- int dx, dy;
- int x, y;
- int xoff, yoff;
- int fill = 1;
-
- t = 0.0;
- dx = x2 - x1;
- dy = y2 - y1;
- radius = MIN(dx, dy) / 2;
- xoff = x1;
- yoff = y1;
- x = radius;
- y = 0;
- dp = Blt_PicturePixel(destPtr, x + xoff - 1, y + yoff);
- dp->u32 = colorPtr->u32;
- r2 = radius * radius;
- if (fill) {
- PaintLineSegment(destPtr, x1, y + yoff, x + xoff - 2, y + yoff, 1,
- colorPtr);
- }
- while (x > y) {
- double z;
- double d, q;
- unsigned char a;
-
- y++;
- z = sqrt(r2 - (y * y));
- d = floor(z) - z;
- if (d < t) {
- x--;
- }
- dp = Blt_PicturePixel(destPtr, x + xoff, y + yoff);
- q = FABS(d * 255.0);
- a = (unsigned int)CLAMP(q);
- BlendPixel(dp, colorPtr, a);
- dp--; /* x - 1 */
- a = (unsigned int)CLAMP(255.0 - q);
- BlendPixel(dp, colorPtr, a);
- t = d;
- x1++;
- if (fill) {
- PaintLineSegment(destPtr, x1, y + yoff, x + xoff - 1, y + yoff, 1, colorPtr);
- }
- }
-}
-
-static Point2d
-PolygonArea(int nPoints, Point2d *points, double *areaPtr)
-{
- Point2d *p, *pend;
- Point2d c;
- double area;
- int i;
-
- area = c.x = c.y = 0.0;
- for (p = points, pend = p + nPoints, i = 0; p < pend; p++, i++) {
- Point2d *q;
- double factor;
- int j;
-
- j = (i + 1) % nPoints;
- q = points + j;
- factor = (p->x * q->y) - (p->y * q->x);
- area += factor;
- c.x += (p->x + q->x) * factor;
- c.y += (p->y + q->y) * factor;
- }
- area *= 0.5;
- c.x /= 6.0 * area;
- c.y /= 6.0 * area;
- *areaPtr = area;
- return c;
-}
-
-static void
-BlendLine(Pict *destPtr, int x1, int x2, int y, Blt_Pixel *colorPtr)
-{
- Blt_Pixel *destRowPtr;
- Blt_Pixel *dp, *dend;
- size_t length;
-
- if (x1 > x2) {
- int tmp;
-
- tmp = x1, x1 = x2, x2 = tmp;
- }
- destRowPtr = destPtr->bits + (destPtr->pixelsPerRow * y) + x1;
- length = x2 - x1 + 1;
- for (dp = destRowPtr, dend = dp + length; dp < dend; dp++) {
- BlendPixel(dp, colorPtr, 0xFF);
- }
-}
-
-/*
- * Concave Polygon Scan Conversion
- * by Paul Heckbert
- * from "Graphics Gems", Academic Press, 1990
- */
-
-/*
- * concave: scan convert nvert-sided concave non-simple polygon with vertices at
- * (point[i].x, point[i].y) for i in [0..nvert-1] within the window win by
- * calling spanproc for each visible span of pixels.
- * Polygon can be clockwise or counterclockwise.
- * Algorithm does uniform point sampling at pixel centers.
- * Inside-outside test done by Jordan's rule: a point is considered inside if
- * an emanating ray intersects the polygon an odd number of times.
- * drawproc should fill in pixels from xl to xr inclusive on scanline y,
- * e.g:
- * drawproc(y, xl, xr)
- * int y, xl, xr;
- * {
- * int x;
- * for (x=xl; x<=xr; x++)
- * pixel_write(x, y, pixelvalue);
- * }
- *
- * Paul Heckbert 30 June 81, 18 Dec 89
- */
-
-#include <stdio.h>
-#include <math.h>
-
-typedef struct { /* a polygon edge */
- double x; /* x coordinate of edge's intersection with current scanline */
- double dx; /* change in x with respect to y */
- int i; /* edge number: edge i goes from pt[i] to pt[i+1] */
-} ActiveEdge;
-
-typedef struct {
- int nActive;
- ActiveEdge *active;
-} AET;
-
-/* comparison routines for qsort */
-static int n; /* number of vertices */
-static Point2f *pt; /* vertices */
-
-static int
-CompareIndices(const void *a, const void *b)
-{
- return (pt[*(int *)a].y <= pt[*(int *)b].y) ? -1 : 1;
-}
-
-static int
-CompareActive(const void *a, const void *b)
-{
- const ActiveEdge *u, *v;
-
- u = a, v = b;
- return (u->x <= v->x) ? -1 : 1;
-}
-
-static void
-cdelete(AET *tablePtr, int i) /* Remove edge i from active list */
-{
- int j;
-
- for (j=0; (j < tablePtr->nActive) && (tablePtr->active[j].i != i); j++) {
- /*empty*/
- }
- if (j >= tablePtr->nActive) {
- return; /* edge not in active list; happens at
- * win->y0*/
- }
- tablePtr->nActive--;
-
-#ifdef notdef
- bcopy(&tablePtr->active[j+1], &tablePtr->active[j],
- (tablePtr->nActive-j) *sizeof tablePtr->active[0]);
-#else
- memmove(&tablePtr->active[j], &tablePtr->active[j+1],
- (tablePtr->nActive-j) *sizeof tablePtr->active[0]);
-#endif
-}
-
-/* append edge i to end of active list */
-static void
-cinsert(AET *tablePtr, size_t n, Point2f *points, int i, int y)
-{
- int j;
- Point2f *p, *q;
- ActiveEdge *edgePtr;
-
- j = (i < (n - 1)) ? i + 1 : 0;
- if (points[i].y < points[j].y) {
- p = points + i, q = points + j;
- } else {
- p = points + j, q = points + i;
- }
- edgePtr = tablePtr->active + tablePtr->nActive;
- assert(tablePtr->nActive < n);
- /* initialize x position at intersection of edge with scanline y */
- edgePtr->dx = (q->x - p->x) / (q->y - p->y);
- edgePtr->x = edgePtr->dx * (y + 0.5 - p->y) + p->x;
- edgePtr->i = i;
- tablePtr->nActive++;
-}
-
-void
-Blt_PaintPolygon(Pict *destPtr, int nVertices, Point2f *vertices,
- Blt_Pixel *colorPtr)
-{
- int y, k;
- int top, bot;
- int *map; /* list of vertex indices, sorted by pt[map[j]].y */
- AET aet;
-
- n = nVertices;
- pt = vertices;
- if (n <= 0) {
- return;
- }
- if (destPtr->height == 0) {
- return;
- }
- map = Blt_AssertMalloc(nVertices * sizeof(unsigned int));
- aet.active = Blt_AssertCalloc(nVertices, sizeof(ActiveEdge));
- /* create y-sorted array of indices map[k] into vertex list */
- for (k = 0; k < n; k++) {
- map[k] = k;
- }
- /* sort map by pt[map[k]].y */
- qsort(map, n, sizeof(unsigned int), CompareIndices);
- aet.nActive = 0; /* start with empty active list */
- k = 0; /* map[k] is next vertex to process */
- top = MAX(0, ceil(vertices[map[0]].y-.5)); /* ymin of polygon */
- bot = MIN(destPtr->height-1, floor(vertices[map[n-1]].y-.5)); /* ymax */
- for (y = top; y <= bot; y++) { /* step through scanlines */
- unsigned int i, j;
-
- /* Scanline y is at y+.5 in continuous coordinates */
-
- /* Check vertices between previous scanline and current one, if any */
- for (/*empty*/; (k < n) && (vertices[map[k]].y <= (y +.5)); k++) {
- /* to simplify, if pt.y=y+.5, pretend it's above */
- /* invariant: y-.5 < pt[i].y <= y+.5 */
- i = map[k];
- /*
- * Insert or delete edges before and after vertex i (i-1 to i, and
- * i to i+1) from active list if they cross scanline y
- */
- /* vertex previous to i */
- j = (i > 0) ? (i - 1) : (n - 1);
- if (vertices[j].y <= (y - 0.5)) {
- /* old edge, remove from active list */
- cdelete(&aet, j);
- } else if (vertices[j].y > (y + 0.5)) {
- /* new edge, add to active list */
- cinsert(&aet, nVertices, vertices, j, y);
- }
- j = (i < (n - 1)) ? (i + 1) : 0; /* vertex next after i */
- if (vertices[j].y <= (y-.5)) {
- /* old edge, remove from active list */
- cdelete(&aet, i);
- } else if (vertices[j].y > (y+.5)){
- /* new edge, add to active list */
- cinsert(&aet, nVertices, vertices, i, y);
- }
- }
- /* Sort active edge list by active[j].x */
- qsort(aet.active, aet.nActive, sizeof(ActiveEdge), CompareActive);
-
- /* Draw horizontal segments for scanline y */
- for (j = 0; j < aet.nActive; j += 2) { /* draw horizontal segments */
- int left, right;
- ActiveEdge *p, *q;
-
- p = aet.active + j;
- q = p+1;
- /* span 'tween j & j+1 is inside, span tween j+1 & j+2 is outside */
- left = (int)ceil (p->x - 0.5); /* left end of span */
- right = (int)floor(q->x - 0.5); /* right end of span */
- if (left < 0) {
- left = 0;
- }
- if (right >= (int)destPtr->width) {
- right = destPtr->width - 1;
- }
- if (left <= right) {
- BlendLine(destPtr, left, right, y, colorPtr);
- }
- p->x += p->dx; /* increment edge coords */
- q->x += q->dx;
- }
- }
- Blt_Free(aet.active);
- Blt_Free(map);
-}
-
-static void
-GetPolygonBoundingBox(size_t nVertices, Point2f *vertices, Region2f *regionPtr)
-{
- Point2f *pp, *pend;
-
- regionPtr->left = regionPtr->top = FLT_MAX;
- regionPtr->right = regionPtr->bottom = -FLT_MAX;
- for (pp = vertices, pend = pp + nVertices; pp < pend; pp++) {
- if (pp->x < regionPtr->left) {
- regionPtr->left = pp->x;
- } else if (pp->x > regionPtr->right) {
- regionPtr->right = pp->x;
- }
- if (pp->y < regionPtr->top) {
- regionPtr->top = pp->y;
- } else if (pp->y > regionPtr->bottom) {
- regionPtr->bottom = pp->y;
- }
- }
-}
-
-static void
-TranslatePolygon(size_t nVertices, Point2f *vertices, float x, float y,
- float scale)
-{
- Point2f *pp, *pend;
-
- for (pp = vertices, pend = pp + nVertices; pp < pend; pp++) {
- pp->x = (pp->x + x) * scale;
- pp->y = (pp->y + y) * scale;
- }
-}
-
-static void
-PaintPolygonAA(Pict *destPtr, size_t nVertices, Point2f *vertices,
- Region2f *regionPtr, Blt_Pixel *colorPtr)
-{
- Region2f r2;
- int w, h;
- Blt_Picture big, tmp;
- Blt_Pixel color;
- Point2f *v;
-
- int x1, x2, y1, y2;
-
- x1 = y1 = 0;
- x2 = destPtr->width, y2 = destPtr->height;
- if (regionPtr->left > 0) {
- x1 = (int)floor(regionPtr->left);
- }
- if (regionPtr->top > 0) {
- y1 = (int)floor(regionPtr->top);
- }
- if (regionPtr->right < x2) {
- double d;
- d = ceil(regionPtr->right);
- x2 = (int)ceil(regionPtr->right);
- }
- if (regionPtr->bottom < y2) {
- y2 = (int)ceil(regionPtr->bottom);
- }
- v = Blt_AssertMalloc(nVertices * sizeof(Point2f));
- memcpy(v, vertices, sizeof(Point2f) * nVertices);
- TranslatePolygon(nVertices, v, -x1+1, -y1+1, 4.0f);
- GetPolygonBoundingBox(nVertices, v, &r2);
-
- w = (x2 - x1 + 2) * 4;
- h = (y2 - y1 + 2) * 4;
- big = Blt_CreatePicture(w, h);
- color.u32 = 0x00;
- Blt_BlankPicture(big, &color);
- color.Alpha = colorPtr->Alpha;
- Blt_PaintPolygon(big, nVertices, v, &color);
- Blt_Free(v);
- w = (x2 - x1 + 2);
- h = (y2 - y1 + 2);
- tmp = Blt_CreatePicture(w, h);
- Blt_ResamplePicture(tmp, big, bltBoxFilter, bltBoxFilter);
- Blt_FreePicture(big);
- Blt_ApplyColorToPicture(tmp, colorPtr);
- /* Replace the bounding box in the original with the new. */
- Blt_BlendPictures(destPtr, tmp, 0, 0, w, h, (int)floor(regionPtr->left)-1,
- (int)floor(regionPtr->top)-1);
- Blt_FreePicture(tmp);
-}
-
-static void
-PaintPolygonShadow(Pict *destPtr, size_t nVertices, Point2f *vertices,
- Region2f *regionPtr, Shadow *shadowPtr)
-{
- int w, h;
- Blt_Picture blur, tmp;
- Point2f *v;
- Blt_Pixel color;
- int x1, x2, y1, y2;
- Region2f r2;
-
- x1 = y1 = 0;
- x2 = destPtr->width, y2 = destPtr->height;
- if (regionPtr->left > 0) {
- x1 = (int)regionPtr->left;
- }
- if (regionPtr->top > 0) {
- y1 = (int)regionPtr->top;
- }
- if (regionPtr->right < x2) {
- x2 = (int)ceil(regionPtr->right);
- }
- if (regionPtr->bottom < y2) {
- y2 = (int)ceil(regionPtr->bottom);
- }
- if ((x1 > 0) || (y1 > 0)) {
- v = Blt_AssertMalloc(nVertices * sizeof(Point2f));
- memcpy(v, vertices, sizeof(Point2f) * nVertices);
- TranslatePolygon(nVertices, v, -x1, -y1, 1.0f);
- } else {
- v = vertices;
- }
- w = (x2 - x1 + shadowPtr->offset*8);
- h = (y2 - y1 + shadowPtr->offset*8);
- tmp = Blt_CreatePicture(w, h);
- color.u32 = 0x00;
- Blt_BlankPicture(tmp, &color);
- color.Alpha = shadowPtr->alpha;
- GetPolygonBoundingBox(nVertices, v, &r2);
- Blt_PaintPolygon(tmp, nVertices, v, &color);
- if (v != vertices) {
- Blt_Free(v);
- }
- blur = Blt_CreatePicture(w, h);
- color.u32 = 0x00;
- Blt_BlankPicture(blur, &color);
- Blt_CopyPictureBits(blur, tmp, 0, 0, w, h, shadowPtr->offset*2,
- shadowPtr->offset*2);
- Blt_BlurPicture(blur, blur, shadowPtr->offset);
- Blt_MaskPicture(blur, tmp, 0, 0, w, h, 0, 0, &color);
- Blt_FreePicture(tmp);
- Blt_BlendPictures(destPtr, blur, 0, 0, w, h, x1, y1);
- Blt_FreePicture(blur);
-}
-
-static void
-PaintPolygonAA2(Pict *destPtr, size_t nVertices, Point2f *vertices,
- Region2f *regionPtr, Blt_Pixel *colorPtr, Shadow *shadowPtr)
-{
- Region2f r2;
- Blt_Picture big, tmp;
- Blt_Pixel color;
- /*
- * Get the minimum size region to draw both a supersized polygon and
- * shadow.
- *
- * Draw the shadow and then the polygon. Everything is 4x bigger including
- * the shadow offset. This is a much bigger blur.
- *
- * Resample the image back down to 1/4 the size and blend it into
- * the destination picture.
- */
- big = Blt_CreatePicture(destPtr->width * 4, destPtr->height * 4);
- TranslatePolygon(nVertices, vertices, 0.0f, 0.0f, 4.0f);
- color.u32 = 0x00;
- Blt_BlankPicture(big, &color);
- GetPolygonBoundingBox(nVertices, vertices, &r2);
- PaintPolygonShadow(big, nVertices, vertices, &r2, shadowPtr);
- Blt_PaintPolygon(big, nVertices, vertices, colorPtr);
- tmp = Blt_CreatePicture(destPtr->width, destPtr->height);
- Blt_ResamplePicture(tmp, big, bltBoxFilter, bltBoxFilter);
- Blt_FreePicture(big);
- Blt_BlendPictures(destPtr, tmp, 0, 0, destPtr->width, destPtr->height, 0,0);
- Blt_FreePicture(tmp);
-}
-
-static void
-DrawCircle(Blt_Picture picture, int x, int y, int radius,
- CircleSwitches *switchesPtr)
-{
- int filled;
-
- filled = (switchesPtr->fill.u32 != 0x00);
- if (switchesPtr->antialiased) {
- int nSamples = 4;
- Pict *bigPtr, *tmpPtr;
- int w, h;
- Blt_Pixel color;
- int offset, r, lw;
- int cx, cy;
-
- r = radius * nSamples;
- w = h = r + r;
- offset = switchesPtr->shadow.offset * nSamples;
-
- /* Scale the region forming the bounding box of the ellipse into a new
- * picture. The bounding box is scaled by *nSamples* times. */
- bigPtr = Blt_CreatePicture(w+(1+offset)*nSamples,h+(1+offset)*nSamples);
-
- cx = bigPtr->width / 2;
- cy = bigPtr->height / 2;
-
- color.u32 = 0x00;
- color.Alpha = 0x00;
- Blt_BlankPicture(bigPtr, &color);
- if (switchesPtr->shadow.offset > 0) {
- color.Alpha = switchesPtr->shadow.alpha;
- /* Either ring or full circle for blur stencil. */
- lw = switchesPtr->lineWidth * nSamples;
- if (filled) {
- lw = 0;
- }
- PaintEllipse(bigPtr, cx, cy, r, r, lw, &color, 0);
- Blt_BlurPicture(bigPtr, bigPtr, offset/2);
- /* Offset the circle from the shadow. */
- cx -= offset;
- cy -= offset;
- offset = switchesPtr->shadow.offset;
- w = h = radius + radius + (1 + offset) * 2;
- tmpPtr = Blt_CreatePicture(w, h);
- Blt_ResamplePicture(tmpPtr, bigPtr, bltBoxFilter, bltBoxFilter);
- Blt_BlendPictures(picture, tmpPtr, 0, 0, w, h, x-w/2+offset,
- y-h/2+offset);
- color.u32 = 0x00;
- color.Alpha = 0x00;
- Blt_BlankPicture(bigPtr, &color);
- Blt_FreePicture(tmpPtr);
- }
- lw = switchesPtr->lineWidth * nSamples;
- if ((lw > 0) && (r > lw) && (switchesPtr->outline.u32 != 0x00)) {
- /* Paint ring outline. */
- PaintEllipse(bigPtr, cx, cy, r, r, lw, &switchesPtr->outline, 0);
- r -= lw;
- }
- if (filled) {
- /* Paint filled interior */
- PaintEllipse(bigPtr, cx, cy, r, r, 0, &switchesPtr->fill, 0);
- }
- offset = switchesPtr->shadow.offset;
- w = h = radius + radius + (1 + offset) * 2;
- tmpPtr = Blt_CreatePicture(w, h);
- Blt_ResamplePicture(tmpPtr, bigPtr, bltBoxFilter, bltBoxFilter);
-#ifdef notdef
- fprintf(stderr, "big=%dx%d, blur=%d\n", bigPtr->width,bigPtr->height,
- (switchesPtr->shadow.offset * nSamples)/2);
-#endif
- Blt_FreePicture(bigPtr);
- /*Blt_ApplyColorToPicture(tmpPtr, &switchesPtr->fill); */
-#ifdef notdef
- Blt_BlendPictures(picture, tmpPtr, 0, 0, w, h, x-w/2+offset,
- y-h/2+offset);
-#endif
- {
- int yy;
- Blt_Pixel *destRowPtr;
-
- destRowPtr = Blt_PictureBits(tmpPtr);
- for (yy = 0; yy < Blt_PictureHeight(tmpPtr); yy++) {
- Blt_Pixel *dp, *dend;
-
- for (dp = destRowPtr, dend = dp + Blt_PictureWidth(tmpPtr);
- dp < dend; dp++) {
- if (dp->Alpha != 0x00) {
- dp->Red = switchesPtr->fill.Red;
- dp->Green = switchesPtr->fill.Green;
- dp->Blue = switchesPtr->fill.Blue;
- }
- }
- destRowPtr += Blt_PictureStride(tmpPtr);
- }
- }
-#ifndef notdef
- Blt_BlendPictures(picture, tmpPtr, 0, 0, w, h, x-w/2,
- y-h/2);
-#else
- Blt_CopyPictureBits(picture, tmpPtr, 0, 0, w, h, x-w/2,
- y-h/2);
-#endif
- Blt_FreePicture(tmpPtr);
- } else if (switchesPtr->shadow.offset > 0) {
- Pict *blurPtr;
- int w, h;
- Blt_Pixel color;
- int offset, r, lw;
- int cx, cy;
-
- w = h = (radius + radius);
- r = radius;
- offset = switchesPtr->shadow.offset;
-
- /* Scale the region forming the bounding box of the ellipse into a new
- * picture. The bounding box is scaled by *nSamples* times. */
- blurPtr = Blt_CreatePicture(w+(offset*4), h+(offset*4));
- cx = blurPtr->width / 2;
- cy = blurPtr->height / 2;
- color.u32 = 0x00;
- Blt_BlankPicture(blurPtr, &color);
-
- color.Alpha = switchesPtr->shadow.alpha;
- /* Either ring or full circle for blur stencil. */
- lw = switchesPtr->lineWidth;
- if (filled) {
- lw = 0;
- }
- PaintEllipse(blurPtr, cx, cy, r, r, lw, &color, 0);
- Blt_BlurPicture(blurPtr, blurPtr, offset);
- /* Offset the circle from the shadow. */
- cx -= offset;
- cy -= offset;
- lw = switchesPtr->lineWidth;
- if ((lw > 0) && (r > lw) && (switchesPtr->outline.u32 != 0x00)) {
- /* Paint ring outline. */
- PaintEllipse(blurPtr, cx, cy, r, r, lw, &switchesPtr->outline, 0);
- r -= lw;
- }
- if (filled) {
- /* Paint filled interior */
- PaintEllipse(blurPtr, cx, cy, r, r, 0, &switchesPtr->fill, 0);
- }
- x -= blurPtr->width/2 + offset;
- if (x < 0) {
- x = 0;
- }
- y -= blurPtr->height/2 + offset;
- if (y < 0) {
- y = 0;
- }
- Blt_BlendPictures(picture, blurPtr, 0, 0, blurPtr->width,
- blurPtr->height, x, y);
- Blt_FreePicture(blurPtr);
- } else {
- int r;
-
- r = radius;
- if ((switchesPtr->lineWidth > 0) && (r > switchesPtr->lineWidth)) {
- /* Paint ring outline. */
- PaintEllipse(picture, x, y, r, r, switchesPtr->lineWidth,
- &switchesPtr->outline, 1);
- r -= switchesPtr->lineWidth;
- }
- if (filled) {
- /* Paint filled interior */
- PaintEllipse(picture, x, y, r, r, 0, &switchesPtr->fill, 1);
- }
- }
-}
-
-static void
-DrawCircle2(Blt_Picture picture, int x, int y, int radius,
- CircleSwitches *switchesPtr)
-{
- int filled;
-
- filled = (switchesPtr->fill.u32 != 0x00);
- if (switchesPtr->antialiased) {
- int nSamples = 4;
- Pict *bigPtr, *tmpPtr;
- int w, h;
- Blt_Pixel color;
- int offset, r, lw;
- int cx, cy;
- Blt_Pixel *srcRowPtr, *sp, *send;
-
- r = radius;
- w = h = r + r;
- offset = switchesPtr->shadow.offset * nSamples;
-
- /* Scale the region forming the bounding box of the ellipse into a new
- * picture. The bounding box is scaled by *nSamples* times. */
- bigPtr = BgPicture(picture, x, y, w, h);
- cx = bigPtr->width / 2;
- cy = bigPtr->height / 2;
-
-#ifdef notdef
- if (switchesPtr->shadow.offset > 0) {
- color.Alpha = switchesPtr->shadow.alpha;
- /* Either ring or full circle for blur stencil. */
- lw = switchesPtr->lineWidth * nSamples;
- if (filled) {
- lw = 0;
- }
- PaintEllipse(bigPtr, cx, cy, r, r, lw, &color, 0);
- Blt_BlurPicture(bigPtr, bigPtr, offset/2);
- /* Offset the circle from the shadow. */
- cx -= offset;
- cy -= offset;
- }
- lw = switchesPtr->lineWidth * nSamples;
- if ((lw > 0) && (r > lw) && (switchesPtr->outline.u32 != 0x00)) {
- /* Paint ring outline. */
- PaintEllipse(bigPtr, cx, cy, r, r, lw, &switchesPtr->outline, 0);
- r -= lw;
- }
-#endif
- if (filled) {
- /* Paint filled interior */
- PaintEllipse(bigPtr, cx, cy, r*3, r*3, 0, &switchesPtr->fill, 0);
- }
- offset = switchesPtr->shadow.offset;
- tmpPtr = Blt_CreatePicture(w, h);
- Blt_ResamplePicture(tmpPtr, bigPtr, bltBoxFilter, bltBoxFilter);
-#ifdef notdef
- MarkPicture(tmpPtr);
- fprintf(stderr, "big=%dx%d, blur=%d\n", bigPtr->width,bigPtr->height,
- (switchesPtr->shadow.offset * nSamples)/2);
-#endif
- Blt_FreePicture(bigPtr);
- /*Blt_ApplyColorToPicture(tmpPtr, &switchesPtr->fill); */
- Blt_BlendPictures(picture, tmpPtr, 0, 0, w, h, x-w/2+offset,
- y-h/2+offset);
- Blt_FreePicture(tmpPtr);
- } else if (switchesPtr->shadow.offset > 0) {
- Pict *blurPtr;
- int w, h;
- Blt_Pixel color;
- int offset, r, lw;
- int cx, cy;
-
- w = h = (radius + radius);
- r = radius;
- offset = switchesPtr->shadow.offset;
-
- /* Scale the region forming the bounding box of the ellipse into a new
- * picture. The bounding box is scaled by *nSamples* times. */
- blurPtr = Blt_CreatePicture(w+(offset*4), h+(offset*4));
- cx = blurPtr->width / 2;
- cy = blurPtr->height / 2;
- color.u32 = 0x00;
- Blt_BlankPicture(blurPtr, &color);
-
- color.Alpha = switchesPtr->shadow.alpha;
- /* Either ring or full circle for blur stencil. */
- lw = switchesPtr->lineWidth;
- if (filled) {
- lw = 0;
- }
- PaintEllipse(blurPtr, cx, cy, r, r, lw, &color, 0);
- Blt_BlurPicture(blurPtr, blurPtr, offset);
- /* Offset the circle from the shadow. */
- cx -= offset;
- cy -= offset;
- lw = switchesPtr->lineWidth;
- if ((lw > 0) && (r > lw) && (switchesPtr->outline.u32 != 0x00)) {
- /* Paint ring outline. */
- PaintEllipse(blurPtr, cx, cy, r, r, lw, &switchesPtr->outline, 0);
- r -= lw;
- }
- if (filled) {
- /* Paint filled interior */
- PaintEllipse(blurPtr, cx, cy, r, r, 0, &switchesPtr->fill, 0);
- }
- x -= blurPtr->width/2 + offset;
- if (x < 0) {
- x = 0;
- }
- y -= blurPtr->height/2 + offset;
- if (y < 0) {
- y = 0;
- }
- Blt_BlendPictures(picture, blurPtr, 0, 0, blurPtr->width,
- blurPtr->height, x, y);
- Blt_FreePicture(blurPtr);
- } else {
- int r;
-
- r = radius;
- if ((switchesPtr->lineWidth > 0) && (r > switchesPtr->lineWidth)) {
- /* Paint ring outline. */
- PaintEllipse(picture, x, y, r, r, switchesPtr->lineWidth,
- &switchesPtr->outline, 1);
- r -= switchesPtr->lineWidth;
- }
- if (filled) {
- /* Paint filled interior */
- PaintEllipse(picture, x, y, r, r, 0, &switchesPtr->fill, 1);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CircleOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CircleOp(
- Blt_Picture picture,
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- CircleSwitches switches;
- int x, y, radius;
-
- if (objc < 5) {
- Tcl_AppendResult(interp, "wrong # of coordinates for circle",
- (char *)NULL);
- return TCL_ERROR;
- }
- if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[5], &radius) != TCL_OK)) {
- return TCL_ERROR;
- }
- /* Process switches */
- switches.lineWidth = 1;
- switches.fill.u32 = 0xffffffff;
- switches.outline.u32 = 0xff000000;
- switches.alpha = -1;
- switches.antialiased = 0;
- switches.shadow.offset = 0;
- switches.shadow.alpha = 0xa0;
- if (Blt_ParseSwitches(interp, circleSwitches, objc - 6, objv + 6,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
-#ifdef notdef
- if (switches.alpha != -1) {
- switches.fill.Alpha = switches.alpha;
- switches.outline.Alpha = switches.alpha;
- }
-#endif
- DrawCircle(picture, x, y, radius, &switches);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EllipseOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-EllipseOp(
- Blt_Picture picture,
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- CircleSwitches switches;
- int x, y, a, b;
-
- if (objc < 7) {
- Tcl_AppendResult(interp, "wrong # of coordinates for circle",
- (char *)NULL);
- return TCL_ERROR;
- }
- if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[5], &a) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[6], &b) != TCL_OK)) {
- return TCL_ERROR;
- }
- /* Process switches */
- switches.lineWidth = 0;
- switches.fill.u32 = 0xFFFFFFFF;
- switches.outline.u32 = 0xFF000000;
- switches.alpha = -1;
- switches.antialiased = FALSE;
- if (Blt_ParseSwitches(interp, circleSwitches, objc - 7, objv + 7,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (switches.alpha != -1) {
- switches.fill.Alpha = switches.alpha;
- switches.outline.Alpha = switches.alpha;
- }
- if ((switches.lineWidth >= a) || (switches.lineWidth >= b)) {
- /* If the requested line width is greater than the radius then draw a
- * solid ellipse instead. */
- switches.lineWidth = 0;
- }
- if (switches.antialiased) {
- PaintEllipseAA(picture, x, y, a, b, switches.lineWidth, &switches.fill);
- } else {
- PaintEllipse(picture, x, y, a, b, switches.lineWidth, &switches.fill, 1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LineOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-LineOp(
- Blt_Picture picture,
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- LineSwitches switches;
- size_t nPoints;
- Point2f *points;
-
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF;
- switches.alpha = -1;
- if (Blt_ParseSwitches(interp, lineSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (switches.alpha != -1) {
- switches.bg.Alpha = switches.alpha;
- }
- if (switches.x.nValues != switches.y.nValues) {
- Tcl_AppendResult(interp, "-x and -y coordinate lists must have the ",
- " same number of coordinates.",(char *)NULL);
- return TCL_ERROR;
- }
- points = NULL;
- if (switches.x.nValues > 0) {
- size_t i;
- float *x, *y;
-
- nPoints = switches.x.nValues;
- points = Blt_Malloc(sizeof(Point2f) * nPoints);
- if (points == NULL) {
- Tcl_AppendResult(interp, "can't allocate memory for ",
- Blt_Itoa(nPoints + 1), " points", (char *)NULL);
- return TCL_ERROR;
- }
- x = (float *)switches.x.values;
- y = (float *)switches.y.values;
- for (i = 0; i < nPoints; i++) {
- points[i].x = x[i];
- points[i].y = y[i];
- }
- Blt_Free(switches.x.values);
- Blt_Free(switches.y.values);
- switches.x.values = switches.y.values = NULL;
- } else if (switches.coords.nValues > 0) {
- size_t i, j;
- float *coords;
-
- if (switches.coords.nValues & 0x1) {
- Tcl_AppendResult(interp, "bad -coords list: ",
- "must have an even number of values", (char *)NULL);
- return TCL_ERROR;
- }
- nPoints = (switches.coords.nValues / 2);
- points = Blt_Malloc(sizeof(Point2f)* nPoints);
- if (points == NULL) {
- Tcl_AppendResult(interp, "can't allocate memory for ",
- Blt_Itoa(nPoints + 1), " points", (char *)NULL);
- return TCL_ERROR;
- }
- coords = (float *)switches.coords.values;
- for (i = 0, j = 0; i < switches.coords.nValues; i += 2, j++) {
- points[j].x = coords[i];
- points[j].y = coords[i+1];
- }
- Blt_Free(switches.coords.values);
- switches.coords.values = NULL;
- }
- if (points != NULL) {
- PaintPolyline(picture, nPoints, points, switches.lineWidth,
- &switches.bg);
- Blt_Free(points);
- }
- Blt_FreeSwitches(lineSwitches, (char *)&switches, 0);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PolygonOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- * $pict draw polygon -coords $coords -color $color
- *---------------------------------------------------------------------------
- */
-static int
-PolygonOp(
- Pict *destPtr,
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- PolygonSwitches switches;
- size_t nVertices;
- Point2f *vertices;
- Region2f r;
-
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF;
- switches.alpha = -1;
- if (Blt_ParseSwitches(interp, polygonSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (switches.alpha != -1) {
- switches.bg.Alpha = switches.alpha;
- }
- if (switches.x.nValues != switches.y.nValues) {
- Tcl_AppendResult(interp, "-x and -y coordinate lists must have the ",
- " same number of coordinates.",(char *)NULL);
- return TCL_ERROR;
- }
- vertices = NULL;
- r.top = r.left = FLT_MAX, r.bottom = r.right = -FLT_MAX;
- if (switches.x.nValues > 0) {
- size_t i;
- float *x, *y;
-
- nVertices = switches.x.nValues;
- vertices = Blt_Malloc(sizeof(Point2f) * (switches.x.nValues + 1));
- if (vertices == NULL) {
- Tcl_AppendResult(interp, "can't allocate memory for ",
- Blt_Itoa(nVertices + 1), " vertices", (char *)NULL);
- return TCL_ERROR;
- }
- x = (float *)switches.x.values;
- y = (float *)switches.y.values;
- for (i = 0; i < switches.x.nValues; i++) {
- vertices[i].x = x[i];
- vertices[i].y = y[i];
- if (r.left > x[i]) {
- r.left = x[i];
- } else if (r.right < x[i]) {
- r.right = x[i];
- }
- if (r.top > y[i]) {
- r.top = y[i];
- } else if (r.bottom < y[i]) {
- r.bottom = y[i];
- }
- }
- if ((x[0] != x[i-1]) || (y[0] != y[i-1])) {
- vertices[i].x = x[0];
- vertices[i].y = y[0];
- nVertices++;
- }
- Blt_Free(switches.x.values);
- Blt_Free(switches.y.values);
- switches.x.values = switches.y.values = NULL;
- } else if (switches.coords.nValues > 0) {
- size_t i, j;
- float *coords;
-
- if (switches.coords.nValues & 0x1) {
- Tcl_AppendResult(interp, "bad -coords list: ",
- "must have an even number of values", (char *)NULL);
- return TCL_ERROR;
- }
- nVertices = (switches.coords.nValues / 2);
- vertices = Blt_Malloc(sizeof(Point2f)* (nVertices + 1));
- if (vertices == NULL) {
- Tcl_AppendResult(interp, "can't allocate memory for ",
- Blt_Itoa(nVertices + 1), " vertices", (char *)NULL);
- return TCL_ERROR;
- }
- coords = (float *)switches.coords.values;
- for (i = 0, j = 0; i < switches.coords.nValues; i += 2, j++) {
- vertices[j].x = coords[i];
- vertices[j].y = coords[i+1];
- if (r.left > coords[i]) {
- r.left = coords[i];
- } else if (r.right < coords[i]) {
- r.right = coords[i];
- }
- if (r.top > coords[i+1]) {
- r.top = coords[i+1];
- } else if (r.bottom < coords[i+1]) {
- r.bottom = coords[i+1];
- }
- }
- if ((coords[0] != coords[i-2]) || (coords[1] != coords[i-1])) {
- vertices[j].x = coords[0];
- vertices[j].y = coords[1];
- nVertices++;
- }
- Blt_Free(switches.coords.values);
- switches.coords.values = NULL;
- }
- if (vertices != NULL) {
- if ((r.left < destPtr->width) && (r.right >= 0) &&
- (r.top < destPtr->height) && (r.bottom >= 0)) {
- if (switches.antialiased) {
- PaintPolygonAA2(destPtr, nVertices, vertices, &r,
- &switches.bg, &switches.shadow);
- } else {
- if (switches.shadow.offset > 0) {
- PaintPolygonShadow(destPtr, nVertices, vertices, &r,
- &switches.shadow);
- }
- Blt_PaintPolygon(destPtr, nVertices, vertices, &switches.bg);
- }
- }
- Blt_Free(vertices);
- }
- Blt_FreeSwitches(polygonSwitches, (char *)&switches, 0);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RectangleOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-RectangleOp(
- Blt_Picture picture,
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
- RectangleSwitches switches;
- PictRegion r;
-
- if (Blt_GetBBoxFromObjv(interp, 4, objv + 3, &r) != TCL_OK) {
- return TCL_ERROR;
- }
- memset(&switches, 0, sizeof(switches));
- /* Process switches */
- switches.lineWidth = 0;
- switches.bg.u32 = 0xFFFFFFFF;
- switches.alpha = -1;
- if (Blt_ParseSwitches(interp, rectangleSwitches, objc - 7, objv + 7,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (switches.alpha != -1) {
- switches.bg.Alpha = switches.alpha;
- }
- if (switches.shadow.offset > 0) {
- PaintRectangleShadow(picture, r.x, r.y, r.w, r.h, switches.radius,
- switches.lineWidth, &switches.shadow);
- }
- if ((switches.antialiased) && (switches.radius > 0)) {
- PaintRectangleAA(picture, r.x, r.y, r.w, r.h, switches.radius,
- switches.lineWidth, &switches.bg);
- } else {
- PaintRectangle(picture, r.x, r.y, r.w, r.h, switches.radius,
- switches.lineWidth, &switches.bg);
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextOp --
- *
- * Results:
- * Returns a standard TCL return value.
- *
- * Side effects:
- * None.
- *
- * image draw text string x y switches
- *---------------------------------------------------------------------------
- */
-static int
-TextOp(
- Pict *destPtr, /* Picture. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument objects. */
-{
-#if DRAWTEXT
- FtFont *fontPtr;
- TextSwitches switches;
- const char *string;
- const char *fontName;
- int length;
- int result;
- int x, y;
-
- string = Tcl_GetStringFromObj(objv[3], &length);
- if ((Tcl_GetIntFromObj(interp, objv[4], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[5], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- /* Process switches */
- switches.alpha = -1;
- switches.anchor = TK_ANCHOR_NW;
- switches.angle = 0.0;
- switches.shadow.offset = 0;
- switches.color.u32 = 0xFF000000; /* black. */
- switches.shadow.alpha = 0xA0; /* black. */
- switches.fontObjPtr = Tcl_NewStringObj("Arial 12", -1);
- switches.fontSize = 0;
- switches.kerning = FALSE;
- switches.justify = TK_JUSTIFY_LEFT;
- if (Blt_ParseSwitches(interp, textSwitches, objc - 6, objv + 6, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (switches.alpha != -1) {
- switches.color.Alpha = switches.alpha;
- }
- fontName = Tcl_GetString(switches.fontObjPtr);
- fontPtr = OpenFont(interp, fontName, switches.fontSize);
- if (fontPtr == NULL) {
- fprintf(stderr, "can't open font %s\n", fontName);
- return TCL_ERROR;
- }
- if (destPtr->flags & BLT_PIC_ASSOCIATED_COLORS) {
- Blt_UnassociateColors(destPtr);
- }
- if (switches.angle != 0.0) {
- TextStyle ts;
- TextLayout *layoutPtr;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetJustify(ts, switches.justify);
- layoutPtr = CreateSimpleTextLayout(fontPtr, string, length, &ts);
- if (fontPtr->face->face_flags & FT_FACE_FLAG_SCALABLE) {
- TextFragment *fp, *fend;
- double rw, rh;
-
- Blt_RotateStartingTextPositions(layoutPtr, switches.angle);
- Blt_GetBoundingBox(layoutPtr->width, layoutPtr->height,
- switches.angle, &rw, &rh, (Point2d *)NULL);
- Blt_TranslateAnchor(x, y, (int)(rw), (int)(rh), switches.anchor,
- &x, &y);
- RotateFont(fontPtr, switches.angle);
- for (fp = layoutPtr->fragments, fend = fp + layoutPtr->nFrags;
- fp < fend; fp++) {
- PaintText(destPtr, fontPtr, fp->text, fp->count, x + fp->sx,
- y + fp->sy, switches.kerning, &switches.color);
- }
- } else {
- Blt_Picture tmp;
- Blt_Pixel color;
- Pict *rotPtr;
- TextFragment *fp, *fend;
-
- tmp = Blt_CreatePicture(layoutPtr->width, layoutPtr->height);
- color.u32 = 0x00FF0000;
- Blt_BlankPicture(tmp, &color);
- color.Alpha = 0xFF;
- for (fp = layoutPtr->fragments, fend = fp + layoutPtr->nFrags;
- fp < fend; fp++) {
- PaintText(tmp, fontPtr, fp->text, fp->count, fp->sx,
- fp->sy, switches.kerning, &switches.color);
- }
- rotPtr = Blt_RotatePicture(tmp, switches.angle);
- Blt_FreePicture(tmp);
- Blt_TranslateAnchor(x, y, rotPtr->width, rotPtr->height,
- switches.anchor, &x, &y);
- Blt_BlendPictures(destPtr, rotPtr, 0, 0,
- rotPtr->width, rotPtr->height, x, y);
- Blt_FreePicture(rotPtr);
- }
- Blt_Free(layoutPtr);
- } else {
- size_t w, h;
-
- MeasureText(fontPtr, string, length, &w, &h);
- Blt_TranslateAnchor(x, y, w, h, switches.anchor, &x, &y);
-#ifdef notdef
- fprintf(stderr, "string=%s w=%d h=%d\n", string, w, h);
-#endif
- if (switches.shadow.offset > 0) {
- Blt_Pixel color;
- Pict *blurPtr, *tmpPtr;
- int offset = switches.shadow.offset;
-
- MeasureText(fontPtr, string, length, &w, &h);
- tmpPtr = Blt_CreatePicture(w, h);
- color.u32 = 0x00000000;
- Blt_BlankPicture(tmpPtr, &color);
- color.Alpha = switches.shadow.alpha;
- PaintText(tmpPtr, fontPtr, string, length, 0, fontPtr->ascent,
- switches.kerning, &color);
- blurPtr = Blt_CreatePicture(w+offset*4, h+offset*4);
- color.Alpha = 0;
- Blt_BlankPicture(blurPtr, &color);
- Blt_CopyPictureBits(blurPtr, tmpPtr, 0, 0, w, h,
- offset, offset);
- Blt_FreePicture(tmpPtr);
- Blt_BlurPicture(blurPtr, blurPtr, offset);
- Blt_BlendPictures(destPtr, blurPtr, 0, 0, blurPtr->width,
- blurPtr->height, x, y);
- Blt_FreePicture(blurPtr);
- }
- y += fontPtr->ascent;
- result = PaintText(destPtr, fontPtr, string, length, x, y,
- switches.kerning, &switches.color);
- }
- CloseFont(fontPtr);
- Blt_FreeSwitches(textSwitches, (char *)&switches, 0);
-#endif
- return TCL_OK;
-}
-
-Blt_OpSpec bltPictDrawOps[] =
-{
- {"circle", 1, CircleOp, 4, 0, "x y r ?switches?",},
- {"ellipse", 1, EllipseOp, 5, 0, "x y a b ?switches?",},
- {"line", 1, LineOp, 3, 0, "?switches?",},
- {"polygon", 1, PolygonOp, 3, 0, "?switches?",},
- {"rectangle", 1, RectangleOp, 7, 0, "x1 y1 x2 y2 ?switches?",},
- {"text", 1, TextOp, 6, 0, "string x y ?switches?",},
-};
-
-int bltPictDrawNOps = sizeof(bltPictDrawOps) / sizeof(Blt_OpSpec);
-
-static void
-Polyline2(Pict *destPtr, int x1, int y1, int x2, int y2, Blt_Pixel *colorPtr)
-{
- Blt_Pixel *dp;
- int dx, dy, xDir;
- unsigned long error;
-
- if (y1 > y2) {
- int tmp;
-
- tmp = y1, y1 = y2, y2 = tmp;
- tmp = x1, x1 = x2, x2 = tmp;
- }
-
- /* First and last Pixels always get Set: */
- dp = Blt_PicturePixel(destPtr, x1, y1);
- dp->u32 = colorPtr->u32;
- dp = Blt_PicturePixel(destPtr, x2, y2);
- dp->u32 = colorPtr->u32;
-
- dx = x2 - x1;
- dy = y2 - y1;
-
- if (dx >= 0) {
- xDir = 1;
- } else {
- xDir = -1;
- dx = -dx;
- }
- if (dx == 0) { /* Vertical line */
- Blt_Pixel *dp;
-
- dp = Blt_PicturePixel(destPtr, x1, y1);
- while (dy-- > 0) {
- dp += destPtr->pixelsPerRow;
- dp->u32 = colorPtr->u32;
- }
- return;
- }
- if (dy == 0) { /* Horizontal line */
- Blt_Pixel *dp;
-
- dp = Blt_PicturePixel(destPtr, x1, y1);
- while(dx-- > 0) {
- dp += xDir;
- dp->u32 = colorPtr->u32;
- }
- return;
- }
- if (dx == dy) { /* Diagonal line. */
- Blt_Pixel *dp;
-
- dp = Blt_PicturePixel(destPtr, x1, y1);
- while(dy-- > 0) {
- dp += destPtr->pixelsPerRow + xDir;
- dp->u32 = colorPtr->u32;
- }
- return;
- }
-
- /* use Wu Antialiasing: */
-
- error = 0;
- if (dy > dx) { /* y-major line */
- unsigned long adjust;
-
- /* x1 -= lineWidth / 2; */
- adjust = (dx << 16) / dy;
- while(--dy) {
- Blt_Pixel *dp;
- int x;
- unsigned char weight;
-
- error += adjust;
- ++y1;
- if (error & ~0xFFFF) {
- x1 += xDir;
- error &= 0xFFFF;
- }
- dp = Blt_PicturePixel(destPtr, x1, y1);
- weight = (unsigned char)(error >> 8);
- x = x1;
- if (x >= 0) {
- dp->u32 = colorPtr->u32;
- dp->Alpha = ~weight;
- }
- x += xDir;
- dp += xDir;
- if (x >= 0) {
- dp->u32 = colorPtr->u32;
- dp->Alpha = weight;
- }
- }
- } else { /* x-major line */
- unsigned long adjust;
-
- /* y1 -= lineWidth / 2; */
- adjust = (dy << 16) / dx;
- while (--dx) {
- Blt_Pixel *dp;
- int y;
- unsigned char weight;
-
- error += adjust;
- x1 += xDir;
- if (error & ~0xFFFF) {
- y1++;
- error &= 0xFFFF;
- }
- dp = Blt_PicturePixel(destPtr, x1, y1);
- weight = (unsigned char)(error >> 8);
- y = y1;
- if (y >= 0) {
- dp->u32 = colorPtr->u32;
- dp->Alpha = ~weight;
- }
- dp += destPtr->pixelsPerRow;
- y++;
- if (y >= 0) {
- dp->u32 = colorPtr->u32;
- dp->Alpha = weight;
- }
- }
- }
-}
-
-
-Blt_Picture
-Blt_PaintCheckbox(int w, int h, XColor *fillColor, XColor *outlineColor,
- XColor *checkColor, int on)
-{
- Shadow shadow;
- Blt_Pixel color;
- int x, y;
- Pict *destPtr;
-
- destPtr = Blt_CreatePicture(w, h);
- w -= 5, h -= 5;
- color.u32 = 0x00;
- Blt_BlankPicture(destPtr, &color);
-
- shadow.offset = 1;
- shadow.alpha = 0xA0;
- x = y = 2;
- if (fillColor != NULL) {
- PaintRectangleShadow(destPtr, x+1, y+1, w-2, h-2, 0, 0, &shadow);
- color = Blt_XColorToPixel(fillColor);
- PaintRectangle(destPtr, x+1, y+1, w-2, h-2, 0, 0, &color);
- }
- if (outlineColor != NULL) {
- color = Blt_XColorToPixel(outlineColor);
- PaintRectangle(destPtr, x, y, w, h, 0, 1, &color);
- }
- x += 2, y += 2;
- w -= 5, h -= 5;
- if (on) {
- Point2f points[7];
- Region2f r;
-
- points[0].x = points[1].x = points[6].x = x;
- points[0].y = points[6].y = y + (0.4 * h);
- points[1].y = y + (0.6 * h);
- points[2].x = points[5].x = x + (0.4 * w);
- points[2].y = y + h;
- points[3].x = points[4].x = x + w;
- points[3].y = y + (0.2 * h);
- points[4].y = y;
- points[5].y = y + (0.7 * h);
- points[6].x = points[0].x;
- points[6].y = points[0].y;
- shadow.offset = 2;
- r.left = x, r.right = x + w;
- r.top = y, r.bottom = y + h;
- color = Blt_XColorToPixel(checkColor);
- PaintPolygonAA2(destPtr, 7, points, &r, &color, &shadow);
- }
- return destPtr;
-}
-
-Blt_Picture
-Blt_PaintRadioButton(int w, int h, XColor *fillColor, XColor *outlineColor,
- XColor *indicatorColor, int on)
-{
- Blt_Picture picture;
- CircleSwitches switches;
- int x, y, r;
- Blt_Pixel color;
-
- /* Process switches */
- switches.lineWidth = 0;
- switches.fill = Blt_XColorToPixel(fillColor);
- switches.outline = Blt_XColorToPixel(outlineColor);
- switches.alpha = -1;
- switches.shadow.offset = 1;
- switches.shadow.alpha = 0xA0;
- switches.antialiased = 1;
- w &= ~1;
- picture = Blt_CreatePicture(w, h);
- color.u32 = 0x00;
- Blt_BlankPicture(picture, &color);
- w -= 6, h -= 6;
- x = w / 2 + 1;
- y = h / 2 + 1;
- r = (w+1) / 2;
- DrawCircle(picture, x, y, r, &switches);
- if (on) {
- r -= 6;
- if (r < 1) {
- r = 2;
- }
- switches.fill = Blt_XColorToPixel(indicatorColor);
- switches.outline = switches.fill;
- switches.lineWidth = 0;
- switches.shadow.offset = 0;
- DrawCircle(picture, x, y, r, &switches);
- }
- return picture;
-}
-
-
-Blt_Picture
-Blt_PaintDelete(int w, int h, XColor *fillColor, XColor *symColor)
-{
- Blt_Picture picture;
- Blt_Pixel color;
- CircleSwitches switches;
- Point2f points[4];
- Region2f reg;
- Shadow shadow;
- int x, y, r;
-
- shadow.offset = 1;
- shadow.alpha = 0xA0;
-
- /* Process switches */
- switches.lineWidth = 1;
- switches.fill = Blt_XColorToPixel(fillColor);
- switches.outline.u32 = 0x0;
- switches.alpha = -1;
- switches.shadow.offset = 1;
- switches.shadow.alpha = 0x80;
- switches.antialiased = 1;
-
- shadow.offset = 0;
- reg.left = x, reg.right = x + w;
- reg.top = y, reg.bottom = y + h;
-
- picture = Blt_CreatePicture(w, h);
- color.u32 = 0x00;
- Blt_BlankPicture(picture, &color);
- x = y = w / 2 - 1;
- r = x - 1;
- DrawCircle(picture, x, y, r, &switches);
-
- points[0].x = x - 2;
- points[0].y = y - 3;
- points[1].x = x - 3;
- points[1].y = y - 2;
- points[2].x = x + 2;
- points[2].y = y + 3;
- points[3].x = x + 3;
- points[3].y = y + 2;
-
- color = Blt_XColorToPixel(symColor);
- PaintPolygonAA2(picture, 4, points, ®, &color, &shadow);
-
- points[0].x = x + 3;
- points[0].y = y - 2;
- points[1].x = x + 2;
- points[1].y = y - 3;
- points[2].x = x - 3;
- points[2].y = y + 2;
- points[3].x = x - 2;
- points[3].y = y + 3;
-
- PaintPolygonAA2(picture, 4, points, ®, &color, &shadow);
- return picture;
-}
-
-
diff --git a/blt3.0.1/src/bltPictFmts.h b/blt3.0.1/src/bltPictFmts.h
deleted file mode 100644
index 7c07f6f..0000000
--- a/blt3.0.1/src/bltPictFmts.h
+++ /dev/null
@@ -1,105 +0,0 @@
-
-/*
- * bltPictFmts.h --
- *
- * This module implements the various image format conversion routines for
- * picture in the BLT toolkit.
- *
- * Copyright 2003-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The JPEG reader/writer is adapted from jdatasrc.c and jdatadst.c
- * in the Independent JPEG Group (version 6b) library distribution.
- *
- * The authors make NO WARRANTY or representation, either express
- * or implied, with respect to this software, its quality,
- * accuracy, merchantability, or fitness for a particular
- * purpose. This software is provided "AS IS", and you, its
- * user, assume the entire risk as to its quality and accuracy.
- *
- * This software is copyright (C) 1991-1998, Thomas G. Lane. All
- * Rights Reserved except as specified below.
- *
- * Permission is hereby granted to use, copy, modify, and
- * distribute this software (or portions thereof) for any
- * purpose, without fee, subject to these conditions: (1) If any
- * part of the source code for this software is distributed, then
- * this README file must be included, with this copyright and
- * no-warranty notice unaltered; and any additions, deletions, or
- * changes to the original files must be clearly indicated in
- * accompanying documentation. (2) If only executable code is
- * distributed, then the accompanying documentation must state
- * that "this software is based in part on the work of the
- * Independent JPEG Group". (3) Permission for use of this
- * software is granted only if the user accepts full
- * responsibility for any undesirable consequences; the authors
- * accept NO LIABILITY for damages of any kind.
- *
- * The GIF reader is from converters/other/giftopnm.c in the netpbm
- * (version 10.19) distribution.
- *
- * Copyright 1990, 1991, 1993, David Koblas. (koblas at netcom.com)
- * Permission to use, copy, modify, and distribute this software
- * and its documentation for any purpose and without fee is
- * hereby granted, provided that the above copyright notice
- * appear in all copies and that both that copyright notice and
- * this permission notice appear in supporting documentation.
- * This software is provided "as is" without express or implied
- * warranty.
- *
- */
-
-#ifndef _BLT_PIC_FMTS_H
-#define _BLT_PIC_FMTS_H
-
-#include <bltChain.h>
-
-#define PIC_PROGRESSIVE (1<<0)
-#define PIC_NOQUANTIZE (1<<1)
-
-#define PIC_FMT_ISASCII (1<<3)
-
-
-typedef int (Blt_PictureIsFmtProc)(Blt_DBuffer buffer);
-
-typedef Blt_Chain (Blt_PictureReadDataProc)(Tcl_Interp *interp,
- const char *fileName, Blt_DBuffer buffer);
-
-typedef Tcl_Obj *(Blt_PictureWriteDataProc)(Tcl_Interp *interp,
- Blt_Picture picture);
-
-typedef Blt_Chain (Blt_PictureImportProc)(Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv, const char **fileNamePtr);
-
-typedef int (Blt_PictureExportProc)(Tcl_Interp *interp, unsigned int index,
- Blt_Chain chain, int objc, Tcl_Obj *const *objv);
-
-BLT_EXTERN int Blt_PictureRegisterFormat(Tcl_Interp *interp,
- const char *name,
- Blt_PictureIsFmtProc *isFmtProc,
- Blt_PictureReadDataProc *readProc,
- Blt_PictureWriteDataProc *writeProc,
- Blt_PictureImportProc *importProc,
- Blt_PictureExportProc *exportProc);
-
-BLT_EXTERN Blt_Picture Blt_GetNthPicture(Blt_Chain chain, size_t index);
-
-#endif /* _BLT_PIC_FMTS_H */
diff --git a/blt3.0.1/src/bltPictGif.c b/blt3.0.1/src/bltPictGif.c
deleted file mode 100644
index 94f6d4c..0000000
--- a/blt3.0.1/src/bltPictGif.c
+++ /dev/null
@@ -1,2334 +0,0 @@
-
-/*
- * bltPictGif.c --
- *
- * This module implements GIF file format conversion routines for the picture
- * image type in the BLT toolkit.
- *
- * Copyright 2003-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The GIF reader is from converters/other/giftopnm.c in the netpbm
- * (version 10.19) distribution.
- *
- * Copyright 1990, 1991, 1993, David Koblas. (koblas at netcom.com)
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation. This software is provided "as is" without
- * express or implied warranty.
- *
- * The GIF writer is in part derived from converters/other/pamtogif.c in
- * the netpbm (version 10.19) distribution.
- *
- * Original version, named 'ppmgif' was by Jef Poskanzer in 1989, based
- * on GIFENCOD by David Rowley <mgardi at watdscu.waterloo.edu>.A Lempel-Zim
- * compression based on "compress".
- *
- * Switched to use libnetpbm PAM facilities (ergo process PAM images) and
- * renamed 'pamtogif' by Bryan Henderson November 2006.
- *
- *
- * Copyright (C) 1989 by Jef Poskanzer.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation. This software is provided "as is" without
- * express or implied warranty.
- *
- * The Graphics Interchange Format(c) is the Copyright property of
- * CompuServe Incorporated. GIF(sm) is a Service Mark property of
- * CompuServe Incorporated.
- *
- * The compression routines also use the following
- *
- * GIFCOMPR.C - GIF Image compression routines
- *
- * Lempel-Ziv compression based on 'compress'. GIF modifications by *
- * David Rowley (mgardi at watdcsu.waterloo.edu)
- *
- * GIF Image compression - modified 'compress'
- *
- * Based on: compress.c - File compression ala IEEE Computer, June 1984.
- *
- * By Authors:
- * Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas)
- * Jim McKie (decvax!mcvax!jim)
- * Steve Davies (decvax!vax135!petsd!peora!srd)
- * Ken Turkowski (decvax!decwrl!turtlevax!ken)
- * James A. Woods (decvax!ihnp4!ames!jaw)
- * Joe Orost (decvax!vax135!petsd!joe)
- *
- */
-
-#include "blt.h"
-#include "config.h"
-
-#include <ctype.h>
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif /* HAVE_STRING_H */
-
-#include <tcl.h>
-#include <bltAlloc.h>
-#include <bltSwitch.h>
-#include <bltDBuffer.h>
-#include <bltHash.h>
-#include "bltPicture.h"
-#include "bltPictFmts.h"
-
-#ifdef _MSC_VER
-#define vsnprintf _vsnprintf
-#endif
-
-#include <setjmp.h>
-
-typedef struct _Blt_Picture Pict;
-
-typedef struct {
- Blt_Picture original;
- Blt_Picture current;
- int delay;
- int nColors;
-} Frame;
-
-#define TRUE 1
-#define FALSE 0
-
-#define LZW_MAX_BITS 12
-#define LZW_MAX_CODE (1 << LZW_MAX_BITS)
-
-#define GIF87A 1
-#define GIF89A 2
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
-} GifImportSwitches;
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(GifImportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(GifImportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- Blt_Pixel bg;
- const char **comments; /* Comments */
- unsigned int flags;
- int index;
- int delay;
-} GifExportSwitches;
-
-BLT_EXTERN Blt_SwitchParseProc Blt_ColorSwitchProc;
-static Blt_SwitchCustom colorSwitch = {
- Blt_ColorSwitchProc, NULL, (ClientData)0,
-};
-
-#define EXPORT_BLEND (1<<0)
-#define EXPORT_ANIMATE (1<<1)
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-animate", "",
- Blt_Offset(GifExportSwitches, flags), 0, EXPORT_ANIMATE},
- {BLT_SWITCH_CUSTOM, "-bg", "color",
- Blt_Offset(GifExportSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_BITMASK, "-blend", "",
- Blt_Offset(GifExportSwitches, flags), 0, EXPORT_BLEND},
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(GifExportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(GifExportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_LIST, "-comments", "{string...}",
- Blt_Offset(GifExportSwitches, comments), 0},
- {BLT_SWITCH_INT_NNEG, "-index", "int",
- Blt_Offset(GifExportSwitches, index), 0},
- {BLT_SWITCH_INT_NNEG, "-delay", "int",
- Blt_Offset(GifExportSwitches, delay), 0},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- jmp_buf jmpbuf;
- Tcl_DString errors;
- Tcl_DString warnings;
- int nWarnings, nErrors;
-} GifMessage;
-
-typedef struct {
- int version; /* Eithe GIF87A or GIF89A */
- Blt_Pixel globalColorTable[256];
- Blt_Pixel localColorTable[256];
-
- /* Data to be parsed */
- Blt_DBuffer dbuffer;
-
- /* Global parameters. */
- int logicalScreenWidth, logicalScreenHeight;
- int globalColorTableFlag;
- int colorResolution;
- int sortFlag;
- unsigned int globalColorTableSize;
- int bgColorIndex;
- int pixelAspectRatio;
-
- /* Local parameters. */
- int imageLeftPosition, imageTopPosition;
- int imageWidth, imageHeight;
- int localColorTableFlag;
- int interlaceFlag;
- int imageSortFlag;
- unsigned int localColorTableSize;
-
- /* Graphic control extension. */
-
- int disposalMethod;
- int userInputFlag;
- int transparentColorFlag;
- int delayTime;
- int transparentColorIndex;
-
- int lzwMinimumCodeSize;
-
-} Gif;
-
-static GifMessage *gifMessagePtr;
-
-DLLEXPORT extern Tcl_AppInitProc Blt_PictureGifInit;
-
-static unsigned short
-GifGetShort(unsigned char *buf)
-{
-#ifdef WORDS_BIGENDIAN
- return (buf[0] << 8) | buf[1];
-#else
- return buf[0] | (buf[1] << 8);
-#endif
-}
-
-static unsigned char *
-GifSetShort(unsigned char *buf, unsigned int value)
-{
-#ifdef WORDS_BIGENDIAN
- buf[0] = (value >> 8) & 0xFF;
- buf[1] = (value) & 0xFF;
-#else
- buf[0] = (value) & 0xFF;
- buf[1] = (value >> 8) & 0xFF;
-#endif
- return buf + 2;
-}
-
-/*ARGSUSED*/
-static void
-GifError TCL_VARARGS_DEF(const char *, arg1)
-{
- const char *fmt;
- char string[BUFSIZ+4];
- int length;
- va_list args;
-
- fmt = TCL_VARARGS_START(const char *, arg1, args);
- length = vsnprintf(string, BUFSIZ, fmt, args);
- if (length > BUFSIZ) {
- strcat(string, "...");
- }
- Tcl_DStringAppend(&gifMessagePtr->errors, string, -1);
- va_end(args);
- longjmp(gifMessagePtr->jmpbuf, 0);
-}
-
-/*ARGSUSED*/
-static void
-GifWarning TCL_VARARGS_DEF(const char *, arg1)
-{
- const char *fmt;
- char string[BUFSIZ+4];
- int length;
- va_list args;
-
- fmt = TCL_VARARGS_START(const char *, arg1, args);
- length = vsnprintf(string, BUFSIZ, fmt, args);
- if (length > BUFSIZ) {
- strcat(string, "...");
- }
- Tcl_DStringAppend(&gifMessagePtr->warnings, string, -1);
- va_end(args);
- gifMessagePtr->nWarnings++;
-}
-
-/*
- * 0 3 Signature "GIF"
- * 3 3 Version "89a"
- */
-static int
-GifHeader(Blt_DBuffer dbuffer, Gif *gifPtr)
-{
- unsigned char *bp;
-
- Blt_DBuffer_ResetCursor(dbuffer);
- if (Blt_DBuffer_BytesLeft(dbuffer) < 6) {
- return FALSE;
- }
- bp = Blt_DBuffer_Pointer(dbuffer);
- if ((bp[0] != 'G') || (bp[1] != 'I') || (bp[2] != 'F') || (bp[3] != '8') ||
- (bp[5] != 'a')) {
- return FALSE;
- }
- if (bp[4] == '7') {
- gifPtr->version = GIF87A;
- } else if (bp[4] == '9') {
- gifPtr->version = GIF89A;
- }
- Blt_DBuffer_IncrCursor(dbuffer, 6);
- return TRUE;
-}
-
-/*
- * 0 2 Logical Screen Width
- * 2 2 Logical Screen Height
- * 4 1 Flags
- * bit 7 = Global color table flag.
- * bits 4-6 = Color resolution.
- * bit 3 = Sort flag.
- * bits 0-2 = Size of global color table.
- * 5 1 Background Color Index
- * 6 1 Pixel Aspect Ratio
- */
-static void
-GifReadLogicalScreenDescriptor(Blt_DBuffer dbuffer, Gif *gifPtr)
-{
- unsigned char *bp;
-
- if (Blt_DBuffer_BytesLeft(dbuffer) < 7) {
- GifError("short file: expected 7 bytes for GIF logical screen descriptor");
- }
- bp = Blt_DBuffer_Pointer(dbuffer);
- /* Logical Screen Descriptor. */
- gifPtr->logicalScreenWidth = GifGetShort(bp + 0);
- gifPtr->logicalScreenHeight = GifGetShort(bp + 2);
- gifPtr->globalColorTableFlag = (bp[4] & 0x80);
- gifPtr->colorResolution = ((bp[4] & 0x70) >> 4);
- gifPtr->sortFlag = (bp[4] & 0x08) >> 3;
- gifPtr->globalColorTableSize = 1 << ((bp[4] & 0x07) + 1);
- gifPtr->bgColorIndex = bp[5]; /* Index of bgcolor color */
- gifPtr->pixelAspectRatio = bp[6];
- Blt_DBuffer_IncrCursor(dbuffer, 7);
-#ifdef notdef
- fprintf(stderr, "screen width = %d\n", gifPtr->logicalScreenWidth);
- fprintf(stderr, "screen height = %d\n", gifPtr->logicalScreenHeight);
- fprintf(stderr, "global color table flag = %d\n", gifPtr->globalColorTableFlag);
- fprintf(stderr, "color resolution = %d\n", gifPtr->colorResolution);
- fprintf(stderr, "sort flag = %d\n", gifPtr->sortFlag);
- fprintf(stderr, "global color table size = %d\n", gifPtr->globalColorTableSize);
- fprintf(stderr, "bg color index = %d\n", gifPtr->bgColorIndex);
- fprintf(stderr, "pixel aspect ratio = %d\n", gifPtr->pixelAspectRatio);
-#endif
-}
-
-/*
- * 7 6 5 4 3 2 1 0 Field Name Type
- * +================+
- * 0 | | Red 0 Byte
- * 1 | | Green 0 Byte
- * 2 | | Blue 0 Byte
- * 3 | | Red 1 Byte
- * | | Green 1 Byte
- * up | |
- * to | |
- * | | Green 255 Byte
- * 767 | | Blue 255 Byte
- * +================+
- */
-static void
-GifReadGlobalColorTable(Blt_DBuffer dbuffer, Gif *gifPtr)
-{
- Blt_Pixel *dp;
- unsigned int i;
- unsigned char *bp;
-
- if (Blt_DBuffer_BytesLeft(dbuffer) < (gifPtr->globalColorTableSize*3)) {
- GifError("short file: expected %d bytes for GIF global color table",
- gifPtr->globalColorTableSize * 3);
- }
- bp = Blt_DBuffer_Pointer(dbuffer);
- dp = gifPtr->globalColorTable;
- for (i = 0; i < gifPtr->globalColorTableSize; i++) {
- dp->Red = bp[0];
- dp->Green = bp[1];
- dp->Blue = bp[2];
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- bp += 3;
- }
- Blt_DBuffer_SetPointer(dbuffer, bp);
-}
-
-/*
- * 7 6 5 4 3 2 1 0 Field Name Type
- * +----------------+
- * 0 | | Image Separator Byte
- * +----------------+
- * 1 | | Image Left Position Unsigned
- * 2 | |
- * +----------------+
- * 3 | | Image Top Position Unsigned
- * 4 | |
- * +----------------+
- * 5 | | Image Width Unsigned
- * 6 | |
- * +----------------+
- * 7 | | Image Height Unsigned
- * 8 | |
- * +----------------+
- * 9 | | | | | | See below
- * +----------------+
- *
- * = Local Color Table Flag 1 Bit
- * Interlace Flag 1 Bit
- * Sort Flag 1 Bit
- * Reserved 2 Bits
- * Size of Local Color Table 3 Bits
- */
-static void
-GifReadImageDescriptor(Blt_DBuffer dbuffer, Gif *gifPtr)
-{
- unsigned char *bp;
- int size;
-
- if (Blt_DBuffer_BytesLeft(dbuffer) < 9) {
- GifError("short file: expected 9 bytes for GIF image descriptor");
- }
- bp = Blt_DBuffer_Pointer(dbuffer);
- gifPtr->imageLeftPosition = GifGetShort(bp + 0);
- gifPtr->imageTopPosition = GifGetShort(bp + 2);
- gifPtr->imageWidth = GifGetShort(bp + 4);
- gifPtr->imageHeight = GifGetShort(bp + 6);
- gifPtr->localColorTableFlag = (bp[8] & 0x80) >> 7;
- gifPtr->interlaceFlag = (bp[8] & 0x40) >> 6;
- gifPtr->imageSortFlag = (bp[8] & 0x20) >> 5;
- size = (bp[8] & 0x07);
- if (size > 0) {
- size = 1 << (size + 1);
- }
- gifPtr->localColorTableSize = size;
- Blt_DBuffer_IncrCursor(dbuffer, 9);
-}
-
-/*
- * 7 6 5 4 3 2 1 0 Field Name Type
- * +================+
- * 0 | | Red 0 Byte
- * 1 | | Green 0 Byte
- * 2 | | Blue 0 Byte
- * 3 | | Red 1 Byte
- * | | Green 1 Byte
- * up | |
- * to | |
- * | | Green 255 Byte
- * 767 | | Blue 255 Byte
- * +================+
- */
-static void
-GifReadLocalColorTable(Blt_DBuffer dbuffer, Gif *gifPtr)
-{
- unsigned char *bp;
- Blt_Pixel *dp;
- unsigned int i;
-
- if (Blt_DBuffer_BytesLeft(dbuffer) < (gifPtr->localColorTableSize*3)) {
- GifError("short file: expected %d bytes for GIF local color table",
- gifPtr->localColorTableSize * 3);
- }
- bp = Blt_DBuffer_Pointer(dbuffer);
- dp = gifPtr->localColorTable;
- for (i = 0; i < gifPtr->localColorTableSize; i++) {
- dp->Red = bp[0];
- dp->Green = bp[1];
- dp->Blue = bp[2];
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- bp += 3;
- }
- Blt_DBuffer_SetPointer(dbuffer, bp);
-}
-
-
-/*
- * 7 6 5 4 3 2 1 0 Field Name Type
- * +----------------+
- * 0 | | Extension Introducer Byte
- * +----------------+
- * 1 | | Graphic Control Label Byte
- * +----------------+
- *
- * +----------------+
- * 0 | | Block Size Byte
- * +----------------+
- * 1 | | | | | See below
- * +----------------+
- * 2 | | Delay Time Unsigned
- * 3 | |
- * +----------------+
- * 4 | | Transparent Color Index Byte
- * +----------------+
- *
- * +----------------+
- * 0 | | Block Terminator Byte
- * +----------------+
- *
- *
- * = Reserved 3 Bits
- * Disposal Method 3 Bits
- * User Input Flag 1 Bit
- * Transparent Color Flag 1 Bit
- */
-static void
-GifReadGraphicControlExtension(Blt_DBuffer dbuffer, Gif *gifPtr)
-{
- unsigned int length;
-
-
- while ((length = Blt_DBuffer_NextByte(dbuffer)) > 0) {
- unsigned char *bp;
-
- bp = Blt_DBuffer_Pointer(dbuffer);
- gifPtr->disposalMethod = (bp[0] & 0x1C) >> 2;
- gifPtr->userInputFlag = bp[0] & 0x02;
- gifPtr->transparentColorFlag = bp[0] & 0x01;
- gifPtr->delayTime = GifGetShort(bp + 1);
- gifPtr->transparentColorIndex = bp[3];
- Blt_DBuffer_IncrCursor(dbuffer, length);
- }
-}
-
-/*
- * Optional comment block
- */
-static void
-GifReadCommentExtension(Blt_DBuffer dbuffer, Gif *gifPtr)
-{
- unsigned char length;
-
- while ((length = Blt_DBuffer_NextByte(dbuffer)) > 0) {
- unsigned char *bp;
-
- if (Blt_DBuffer_BytesLeft(dbuffer) < length) {
- GifError("short file: expected %d bytes for GIF comment block",
- length);
- }
- bp = Blt_DBuffer_Pointer(dbuffer);
-#ifdef notdef
- {
- int i;
- fprintf(stderr, "comment %d bytes follows\n", length);
- for (i = 0; i < length; i++) {
- if (isprint(bp[i]) || isspace(bp[i])) {
- fprintf(stderr, "%c", bp[i]);
- } else {
- fprintf(stderr, "{%.2x}", bp[i]);
- }
- }
- fprintf(stderr, "\n");
- }
-#endif
- Blt_DBuffer_IncrCursor(dbuffer, length);
- }
- assert(length == 0);
-}
-
-static void
-GifReadUnknownExtension(Blt_DBuffer dbuffer, int ident, Gif *gifPtr)
-{
- unsigned char length;
- const char *ext;
-
- if (ident == 0x01) {
- ext = "plain text";
- } else if (ident == 0xFF) {
- ext = "application";
- } else {
- ext = "???";
- }
-#ifdef notdef
- fprintf(stderr, "read %s extension\n", ext);
-#endif
- /* Skip the data sub-blocks */
- while ((length = Blt_DBuffer_NextByte(dbuffer)) > 0) {
- if (Blt_DBuffer_BytesLeft(dbuffer) < length) {
- GifError("short file: expected %d bytes for %s extension block",
- length, ext);
- }
- Blt_DBuffer_IncrCursor(dbuffer, length);
- }
-#ifdef notdef
- fprintf(stderr, "down reading %s extension\n", ext);
-#endif
-}
-
-static void
-GifReadExtensions(Blt_DBuffer dbuffer, Gif *gifPtr)
-{
- unsigned char byte;
- /*
- * Handle only the "Graphic control extension" block, ignoring all others
- * (text, comment, and application).
- */
- byte = Blt_DBuffer_NextByte(dbuffer);
- switch (byte) {
- case 0xF9: /* Graphic control extension. */
- GifReadGraphicControlExtension(dbuffer, gifPtr);
- break;
-
- case 0xFE: /* Comment extension. */
- GifReadCommentExtension(dbuffer, gifPtr);
- break;
-
- default:
- case 0x01: /* Plain text extension. */
- case 0xFF: /* Application extension */
- GifReadUnknownExtension(dbuffer, byte, gifPtr);
- break;
- }
-#ifdef notdef
- assert(byte == 0);
- byte = Blt_DBuffer_NextByte(dbuffer);
-#endif
-}
-
-static int
-GifReadDataBlock(Blt_DBuffer dbuffer, unsigned char *out)
-{
- unsigned int length;
-
- length = Blt_DBuffer_NextByte(dbuffer);
- if (Blt_DBuffer_BytesLeft(dbuffer) < length) {
- return -1;
- }
- if (length > 0) {
- memcpy(out, Blt_DBuffer_Pointer(dbuffer), length);
- Blt_DBuffer_IncrCursor(dbuffer, length);
- }
- return (int)length;
-}
-
-
-/* Stack grows from low addresses to high addresses */
-typedef struct {
- int *stack; /* Malloc'ed array */
- int *sp; /* Stack pointer */
- int *top; /* Next word above top of stack */
-} LzwStack;
-
-typedef struct {
- unsigned char buf[280]; /* This is the buffer through which we read
- * the data from the stream. We must buffer
- * it because we have to read whole data
- * blocks at a time, but our client wants one
- * code at a time. The buffer typically
- * contains the contents of one data block
- * plus two bytes from the previous data
- * block. */
- int bufCount; /* # of bytes of contents in buf[]. */
- int curbit; /* The bit number (starting at 0) within buf[]
- * of the next bit to be returned. If the
- * next bit to be returned is not yet in buf[]
- * (we've already returned everything in
- * there), this points one beyond the end of
- * the buffer contents.
- */
- int streamExhausted; /* The last time we read from the input
- * stream, we got an EOD marker or EOF */
-} LzwCodeState;
-
-
-/*-------------------------------------------------------------------------------
- Some notes on LZW.
-
- LZW is an extension of Limpel-Ziv. The two extensions are:
-
- 1) in Limpel-Ziv, codes are all the same number of bits. In
- LZW, they start out small and increase as the stream progresses.
-
- 2) LZW has a clear code that resets the string table and code
- size.
-
- The LZW code space is allocated as follows:
-
- The true data elements are dataWidth bits wide, so the maximum value of a
- true data element is 2**dataWidth-1. We call that max_dataVal. The first
- byte in the stream tells you what dataWidth is.
-
- LZW codes 0 - max_dataVal are direct codes. Each on represents the true
- data element whose value is that of the LZW code itself. No decompression
- is required.
-
- max_dataVal + 1 and up are compression codes. They encode true data
- elements:
-
- max_dataVal + 1 is the clear code.
-
- max_dataVal + 2 is the end code.
-
- max_dataVal + 3 and up are string codes. Each string code represents a
- string of true data elements. The translation from a string code to the
- string of true data elements varies as the stream progresses. In the
- beginning and after every clear code, the translation table is empty, so no
- string codes are valid. As the stream progresses, the table gets filled
- and more string codes become valid.
-
---------------------------------------------------------------------------*/
-
-typedef struct {
- LzwStack stack;
- int fresh; /* The stream is right after a clear code or
- at the very beginning */
- int codeSize; /* Current code size -- each LZW code in this
- * part of the image is this many bits. Ergo,
- * we read this many bits at a time from the
- * stream. */
-
- int maxnum_code; /* Maximum number of LZW codes that can be
- * represented with the current code size. (1
- * << codeSize) */
-
- int next_tableSlot; /* Index in the code translation table of the
- * next free entry */
- int firstcode; /* This is always a true data element code */
- int prevcode; /* The code just before, in the image, the one
- * we're processing now */
-
- int table[2][(1 << LZW_MAX_BITS)];
-
- /* The following are constant for the life of the decompressor */
- int init_codeSize;
- int max_dataVal;
- int clear_code;
- int end_code;
-
- Blt_DBuffer dbuffer;
-} LzwDecompressor;
-
-static int zeroDataBlock = 0;
-
-static void
-LzwInitCodeState(LzwCodeState *statePtr)
-{
- /* Fake a previous data block */
- statePtr->buf[0] = statePtr->buf[1] = 0;
- statePtr->bufCount = 2;
- statePtr->curbit = statePtr->bufCount * 8;
- statePtr->streamExhausted = 0;
-}
-
-static void
-LzwGetAnotherBlock(Blt_DBuffer dbuffer, LzwCodeState *statePtr)
-{
- int count;
- unsigned int assumed_count;
-
- /*
- * Shift buffer down so last two bytes are now the first two bytes. Shift
- * 'curbit' cursor, which must be somewhere in or immediately after those
- * two bytes, accordingly.
- */
- statePtr->buf[0] = statePtr->buf[statePtr->bufCount-2];
- statePtr->buf[1] = statePtr->buf[statePtr->bufCount-1];
-
- statePtr->curbit -= (statePtr->bufCount-2)*8;
- statePtr->bufCount = 2;
-
- /* Add the next block to the buffer */
- count = GifReadDataBlock(dbuffer, statePtr->buf + statePtr->bufCount);
- if (count == -1) {
- GifWarning("EOF encountered in image before EOD marker. The GIF file is malformed, but we are proceeding anyway as if an EOD marker were at the end of the file.");
- assumed_count = 0;
- } else {
- assumed_count = count;
- }
- statePtr->streamExhausted = (assumed_count == 0);
- statePtr->bufCount += assumed_count;
-}
-
-static int
-LzwNextCode(Blt_DBuffer dbuffer, int codeSize, LzwCodeState *statePtr)
-{
- int result;
-
- if (((statePtr->curbit + codeSize) > (statePtr->bufCount * 8)) &&
- (!statePtr->streamExhausted)) {
- /*
- * Not enough left in buffer to satisfy request. Get the next
- * data block into the buffer.
- */
- LzwGetAnotherBlock(dbuffer, statePtr);
- }
- if ((statePtr->curbit + codeSize) > (statePtr->bufCount * 8)) {
- /*
- * If the buffer still doesn't have enough bits in it, that means
- * there were no data blocks left to read.
- */
- result = -1; /* EOF */
-
- {
- int const bitsUnused = (statePtr->bufCount * 8) - statePtr->curbit;
- if (bitsUnused > 0) {
- GifWarning("Stream ends with a partial code (%d bits left in file; expected a %d bit code). Ignoring.", bitsUnused, codeSize);
- }
- }
- } else {
- int i, j;
- int code;
- unsigned char *bp;
-
- bp = statePtr->buf;
- code = 0; /* Initial value */
- for (i = statePtr->curbit, j = 0; j < codeSize; ++i, ++j) {
- code |= ((bp[ i / 8 ] & (1 << (i % 8))) != 0) << j;
- }
- statePtr->curbit += codeSize;
- result = code;
- }
- return result;
-}
-
-/*---------------------------------------------------------------------------
- *
- * LzwGetCode --
- *
- * If 'init', initialize the code getter. Otherwise, read and return the
- * next LZW code from the buffer.
- *
- * Results:
- * Retunes the retrieved code. Otherwise -1 if we encounter the
- * end of the file.
- *
- *---------------------------------------------------------------------------
- */
-static int
-LzwGetCode(
- Blt_DBuffer dbuffer, /* Buffer to read from. */
- int codeSize, /* # of bits in the code we are to get. */
- int init) /* Indicates to initial the code reader. */
-{
- static LzwCodeState state;
-
- if (init) {
- LzwInitCodeState(&state);
- return 0;
- }
- return LzwNextCode(dbuffer, codeSize, &state);
-}
-
-static void
-LzwInitStack(
- LzwDecompressor *lzwPtr,
- size_t size)
-{
- lzwPtr->stack.stack = Blt_Malloc(size * sizeof(int));
- if (lzwPtr->stack.stack == NULL) {
- GifError("Unable to allocate %d -word stack.", size);
- }
- lzwPtr->stack.sp = lzwPtr->stack.stack;
- lzwPtr->stack.top = lzwPtr->stack.stack + size;
-}
-
-static void
-LzwPushStack(LzwDecompressor *lzwPtr, int const value)
-{
- if (lzwPtr->stack.sp >= lzwPtr->stack.top) {
- GifError("stack overflow");
- }
- *(lzwPtr->stack.sp++) = value;
-}
-
-static int
-LzwStackIsEmpty(LzwDecompressor *lzwPtr)
-{
- return (lzwPtr->stack.sp == lzwPtr->stack.stack);
-}
-
-static int
-LzwPopStack(LzwDecompressor *lzwPtr)
-{
- if (lzwPtr->stack.sp <= lzwPtr->stack.stack) {
- GifError("stack underflow");
- }
- return *(--lzwPtr->stack.sp);
-}
-
-static void
-LzwTermStack(LzwDecompressor *lzwPtr)
-{
- Blt_Free(lzwPtr->stack.stack);
- lzwPtr->stack.stack = NULL;
-}
-
-static void
-LzwResetDecompressor(LzwDecompressor *lzwPtr)
-{
- lzwPtr->codeSize = lzwPtr->init_codeSize + 1;
- lzwPtr->maxnum_code = 1 << lzwPtr->codeSize;
- lzwPtr->next_tableSlot = lzwPtr->max_dataVal + 3;
- lzwPtr->fresh = 1;
-}
-
-static void
-LzwInitDecompressor(Blt_DBuffer dbuffer, int codeSize, LzwDecompressor *lzwPtr)
-{
- lzwPtr->init_codeSize = codeSize;
-
- lzwPtr->max_dataVal = (1 << codeSize) - 1;
- lzwPtr->clear_code = lzwPtr->max_dataVal + 1;
- lzwPtr->end_code = lzwPtr->max_dataVal + 2;
-
- /*
- * The entries in the translation table for true data codes are constant
- * throughout the stream. We set them now and they never change.
- */
- {
- int i;
-
- for (i = 0; i <= lzwPtr->max_dataVal; ++i) {
- lzwPtr->table[0][i] = 0;
- lzwPtr->table[1][i] = i;
- }
- }
- LzwResetDecompressor(lzwPtr);
- LzwGetCode(dbuffer, 0, TRUE);
- lzwPtr->dbuffer = dbuffer;
- lzwPtr->fresh = TRUE;
- LzwInitStack(lzwPtr, LZW_MAX_CODE * 2);
-}
-
-static void
-LzwTermDecompressor(LzwDecompressor *lzwPtr)
-{
- LzwTermStack(lzwPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LzwExpandCodeOntoStack --
- *
- * 'incode' is an LZW string code. It represents a string of true data
- * elements, as defined by the string translation table in *decompP.
- *
- * Expand the code to a string of LZW direct codes and push them onto the
- * stack such that the leftmost code is on top.
- *
- * Also add to the translation table where appropriate.
- *
- * Results:
- * If successful, return TRUE. Iff the translation table contains a cycle
- * (which means the LZW stream from which it was built is invalid),
- * return FALSE.
- *
- *---------------------------------------------------------------------------
- */
-static int
-LzwExpandCodeOntoStack(LzwDecompressor *lzwPtr, int incode)
-{
- int code;
- int error;
-
- error = FALSE;
- if (incode < lzwPtr->next_tableSlot) {
- code = incode;
- } else {
- /* It's a code that isn't in our translation table yet */
- LzwPushStack(lzwPtr, lzwPtr->firstcode);
- code = lzwPtr->prevcode;
- }
-
- {
- /*
- * Get the whole string that this compression code represents and push
- * it onto the code stack so the leftmost code is on top. Set
- * lzwPtr->firstcode to the first (leftmost) code in that string.
- */
- unsigned int stringCount;
- stringCount = 0;
-
- while ((code > lzwPtr->max_dataVal) && (!error)) {
- if (stringCount > LZW_MAX_CODE) {
- GifError("contains LZW string loop");
- }
- ++stringCount;
- LzwPushStack(lzwPtr, lzwPtr->table[1][code]);
- code = lzwPtr->table[0][code];
- }
- lzwPtr->firstcode = lzwPtr->table[1][code];
- LzwPushStack(lzwPtr, lzwPtr->firstcode);
- }
-
- if (lzwPtr->next_tableSlot < LZW_MAX_CODE) {
-
- lzwPtr->table[0][lzwPtr->next_tableSlot] = lzwPtr->prevcode;
- lzwPtr->table[1][lzwPtr->next_tableSlot] = lzwPtr->firstcode;
- ++lzwPtr->next_tableSlot;
-
- if (lzwPtr->next_tableSlot >= lzwPtr->maxnum_code) {
- /*
- * We've used up all the codes of the current code size. Future
- * codes in the stream will have codes one bit longer. But
- * there's an exception if we're already at the LZW maximum, in
- * which case the codes will simply continue the same size.
- */
- if (lzwPtr->codeSize < LZW_MAX_BITS) {
- ++lzwPtr->codeSize;
- lzwPtr->maxnum_code = 1 << lzwPtr->codeSize;
- }
- }
- }
- lzwPtr->prevcode = incode;
- return error == 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LzwReadByte --
- *
- * Returns the next data element of the decompressed image. In the
- * context of a GIF, a data element is the color table index of one
- * pixel.
- *
- * We read and return the next byte of the decompressed image:
- *
- * Results:
- * Returns -1, if we hit EOF prematurely (i.e. before an "end" code. We
- * forgive the case that the "end" code is followed by EOF instead of an
- * EOD marker (zero length DataBlock)).
- *
- * Returns -2 if there are no more bytes in the image.
- *
- * Returns -3 if we encounter errors in the LZW stream.
- *
- *---------------------------------------------------------------------------
- */
-static int
-LzwReadByte(LzwDecompressor *lzwPtr)
-{
- int code;
-
- if (!LzwStackIsEmpty(lzwPtr)) {
- return LzwPopStack(lzwPtr);
- }
- if (lzwPtr->fresh) {
- lzwPtr->fresh = FALSE;
- /*
- * Read off all initial clear codes, read the first non-clear code,
- * and return it. There are no strings in the table yet, so the next
- * code must be a direct true data code.
- */
- do {
- lzwPtr->firstcode = LzwGetCode(lzwPtr->dbuffer, lzwPtr->codeSize,
- FALSE);
- lzwPtr->prevcode = lzwPtr->firstcode;
- } while (lzwPtr->firstcode == lzwPtr->clear_code);
-
- return lzwPtr->firstcode;
- }
- code = LzwGetCode(lzwPtr->dbuffer, lzwPtr->codeSize, FALSE);
- if (code < 0) {
- return code;
- }
- if (code == lzwPtr->clear_code) {
- LzwResetDecompressor(lzwPtr);
- return LzwReadByte(lzwPtr);
- }
- if (code == lzwPtr->end_code) {
- if (!zeroDataBlock) {
- /* readThroughEod(lzwPtr->ifP); */
- }
- return -2;
- }
- if (!LzwExpandCodeOntoStack(lzwPtr, code)) {
- return -3;
- }
- return LzwPopStack(lzwPtr);
-}
-
-static Blt_Picture
-GifCreatePictureFromData(Blt_DBuffer dbuffer, Gif *gifPtr)
-{
- Pict *destPtr;
- Blt_Pixel *colormap;
- LzwDecompressor lzw;
- int v;
- int xOffset, yOffset;
-
- colormap = (gifPtr->localColorTableFlag) ? gifPtr->localColorTable :
- gifPtr->globalColorTable;
- LzwInitDecompressor(dbuffer, gifPtr->lzwMinimumCodeSize, &lzw);
-
- destPtr = Blt_CreatePicture(gifPtr->logicalScreenWidth,
- gifPtr->logicalScreenHeight);
- if (!gifPtr->transparentColorFlag) {
- gifPtr->transparentColorIndex = -1;
- }
- xOffset = gifPtr->imageLeftPosition;
- yOffset = gifPtr->imageTopPosition;
- if ((xOffset > 0) || (yOffset > 0) || (gifPtr->transparentColorFlag)) {
- Blt_Pixel color;
-
- color.u32 = 0x00000000;
- Blt_BlankPicture(destPtr, &color);
- }
- destPtr->delay = gifPtr->delayTime * 10; /* Convert to milliseconds. */
- if (destPtr->delay == 0) {
- destPtr->delay = 100;
- }
- if (gifPtr->interlaceFlag) {
- static int istart[] = { 0, 4, 2, 1 };
- static int istep[] = { 8, 8, 4, 2 };
- int x, y, pass;
-
- pass = 0;
- x = y = 0;
- while ((v = LzwReadByte(&lzw)) >= 0) {
- Blt_Pixel *dp;
-
- dp = Blt_PicturePixel(destPtr, x + xOffset, y + yOffset);
- dp->u32 = colormap[v].u32;
- if (v == gifPtr->transparentColorIndex) {
- dp->Alpha = 0x0;
- destPtr->flags |= BLT_PIC_MASK;
- }
- ++x;
- if (x == gifPtr->imageWidth) {
- x = 0;
- y += istep[pass]; /* 8, 8, 4, 2 */
- if (y >= gifPtr->imageHeight) {
- ++pass;
- y = istart[pass]; /* 0, 4, 2, 1 */
- if (y == 0) {
- goto done;
- }
- }
- }
- if (y >= gifPtr->imageHeight) {
- break;
- }
- }
- } else {
- Blt_Pixel *destRowPtr;
- int y;
-
- v = 0; /* Suppress compiler warning. */
- destRowPtr = destPtr->bits + (yOffset*destPtr->pixelsPerRow) + xOffset;
- for (y = 0; y < gifPtr->imageHeight; y++) {
- Blt_Pixel *dp, *dend;
-
- for (dp = destRowPtr, dend = dp + gifPtr->imageWidth; dp < dend;
- dp++) {
- v = LzwReadByte(&lzw);
- if (v < 0) {
- goto done;
- }
- dp->u32 = colormap[v].u32;
- if (v == gifPtr->transparentColorIndex) {
- dp->Alpha = 0x0;
- destPtr->flags |= BLT_PIC_MASK;
- }
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- done:
- if (v == -3) {
- GifError("Error in GIF input stream");
- }
- if (LzwReadByte(&lzw) >= 0) {
- GifWarning("too much input data, ignoring extra...");
- }
- LzwTermDecompressor(&lzw);
- return destPtr;
-}
-
-static Blt_Picture
-GifImageDescriptor(Blt_DBuffer dbuffer, Gif *gifPtr)
-{
- Blt_Picture picture;
-
- GifReadImageDescriptor(dbuffer, gifPtr);
- if (gifPtr->localColorTableFlag) {
- GifReadLocalColorTable(dbuffer, gifPtr);
- }
- /* Get LZW minimum code size. */
- gifPtr->lzwMinimumCodeSize = Blt_DBuffer_NextByte(dbuffer);
- /* Get Image data */
- picture = GifCreatePictureFromData(dbuffer, gifPtr);
-
- /* The image block may or may not end in a 0 byte. Skip it if it
- * exists. */
- if (*Blt_DBuffer_Pointer(dbuffer) == 0) {
- Blt_DBuffer_IncrCursor(dbuffer, 1);
- }
- return picture;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GifToPictures --
- *
- * Reads a GIF file and converts it into a one or more pictures
- * returned in a list.
- *
- * Results:
- * The picture is returned. If an error occured, such as the
- * designated file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-GifToPictures(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer,
- GifImportSwitches *switchesPtr)
-{
- Blt_Chain chain;
- Blt_Picture composite, next;
- Gif gif;
- GifMessage message;
-
- gifMessagePtr = &message;
- memset(&gif, 0, sizeof(gif)); /* Clear the structure. */
- message.nWarnings = 0;
- Tcl_DStringInit(&message.errors);
- Tcl_DStringInit(&message.warnings);
- Tcl_DStringAppend(&message.errors, "error reading \"", -1);
- Tcl_DStringAppend(&message.errors, fileName, -1);
- Tcl_DStringAppend(&message.errors, "\": ", -1);
-
- if (setjmp(message.jmpbuf)) {
- Tcl_DStringResult(interp, &message.errors);
- Tcl_DStringFree(&message.warnings);
- return NULL;
- }
- if (!GifHeader(dbuffer, &gif)) {
- GifError("bad GIF header");
- }
- GifReadLogicalScreenDescriptor(dbuffer, &gif);
- if (gif.globalColorTableFlag) {
- GifReadGlobalColorTable(dbuffer, &gif);
- }
- chain = Blt_Chain_Create();
- next = composite = NULL;
- while (Blt_DBuffer_Cursor(dbuffer) < Blt_DBuffer_Length(dbuffer)) {
- int byte;
- Pict *srcPtr;
-
- byte = Blt_DBuffer_NextByte(dbuffer);
- switch (byte) {
- case '!': /* GIF extension */
- GifReadExtensions(dbuffer, &gif);
- break;
- case ',': /* Image descriptor. */
- srcPtr = GifImageDescriptor(dbuffer, &gif);
- if (composite == NULL) {
- next = Blt_ClonePicture(srcPtr);
- } else {
- switch (gif.disposalMethod) {
- case 0: /* Do nothing, blend with background */
- case 1: { /* Blend with background */
- int delay;
-
- delay = srcPtr->delay;
- /* Blend in the next frame into the current composite. */
- Blt_BlendPictures(composite, srcPtr, 0, 0,
- srcPtr->width, srcPtr->height, 0, 0);
- Blt_FreePicture(srcPtr);
- srcPtr = composite;
- /* Save a copy of the new composite for the next frame. */
- next = Blt_ClonePicture(composite);
- srcPtr->delay = delay;
- break;
- }
- case 2: { /* Restore background. Don't blend. */
- Blt_Pixel pixel;
- int delay;
-
- delay = srcPtr->delay;
- Blt_BlendPictures(composite, srcPtr, 0, 0,
- srcPtr->width, srcPtr->height, 0, 0);
- Blt_FreePicture(srcPtr);
- srcPtr = composite;
- /* Make a copy of the new composite. */
- next = Blt_ClonePicture(composite);
- srcPtr->delay = delay;
- /* Clear the current region for the next frame. */
- pixel.u32 = 0x0;
- Blt_BlankRegion(next, gif.imageLeftPosition,
- gif.imageTopPosition,
- gif.imageWidth, gif.imageHeight,
- &pixel);
- break;
- }
- case 3: { /* Restore to previous. */
- int delay;
-
- delay = srcPtr->delay;
- /* Save a copy of the current composite for the next
- * frame. */
- next = Blt_ClonePicture(composite);
- /* Blend in the next frame. */
- Blt_BlendPictures(composite, srcPtr, 0, 0,
- srcPtr->width, srcPtr->height, 0, 0);
- Blt_FreePicture(srcPtr);
- srcPtr = composite;
- srcPtr->delay = delay;
- break;
- }
- default:
- fprintf(stderr, "unknown disposal method %d\n",
- gif.disposalMethod);
- break;
- }
- }
- Blt_Chain_Append(chain, srcPtr);
- composite = next;
- break;
- case ';': /* File terminator */
- goto done;
- default:
- fprintf(stderr, "ignoring %x at %d of %d\n", byte,
- (int)Blt_DBuffer_Cursor(dbuffer),
- (int)Blt_DBuffer_Length(dbuffer));
- }
- }
- done:
- if (composite != NULL) {
- Blt_FreePicture(composite);
- }
- if (message.nWarnings > 0) {
- Tcl_SetErrorCode(interp, "PICTURE", "GIF_READ_WARNINGS",
- Tcl_DStringValue(&message.warnings), (char *)NULL);
- } else {
- Tcl_SetErrorCode(interp, "NONE", (char *)NULL);
- }
- Tcl_DStringFree(&message.warnings);
- Tcl_DStringFree(&message.errors);
- return chain;
-}
-
-static int
-GetLog2(int n)
-{
- int i;
-
- if (n < 3) {
- return 1;
- }
- for (i = 0; (n >> i) != 0; i++) {
- /*empty*/
- }
- return i;
-}
-
-/*
- * Logical Screen Descriptor
- *
- * 6 0 2 Logical Screen Width
- * 8 2 2 Logical Screen Height
- * 10 4 1 Flags
- * bit 7 = Global color table flag.
- * bits 4-6 = Color resolution.
- * bit 3 = Sort flag.
- * bits 0-2 = Size of global color table.
- * 11 5 1 Background Color Index
- * 12 6 1 Pixel Aspect Ratio
- */
-static void
-GifWriteLogicalScreenDescriptor(int w, int h, int bitsPerPixel,
- unsigned char *bp)
-{
- unsigned char flags;
-
-#define MAXSIZE (1<<16)
- if ((w >= MAXSIZE) || (h >= MAXSIZE)) {
- GifError("picture is too big for GIF format");
- }
- if ((bitsPerPixel > 8) || (bitsPerPixel < 1)) {
- GifError("#bits per pixel is %d for GIF format", bitsPerPixel);
- }
- GifSetShort(bp + 0, w);
- GifSetShort(bp + 2, h);
- flags = 0;
- flags |= (1<<7); /* Global color map flag.*/
- flags |= (bitsPerPixel - 1) << 4; /* Color resolution. */
- flags |= (bitsPerPixel - 1); /* Size of global color table. */
-
- bp[4] = flags;
- bp[5] = 0; /* Background color index. */
- bp[6] = 0; /* Pixel aspect ratio. */
-}
-
-
-/*
- * Image Descriptor
- *
- * 0 1 Image Separator
- * 1 2 Image Left Position
- * 3 2 Image Top Position
- * 5 2 Image Width
- * 7 2 Image Height
- * 9 1 Image flags:
- * = Local Color Table Flag 1 Bit
- * Interlace Flag 1 Bit
- * Sort Flag 1 Bit
- * Reserved 2 Bits
- * Size of Local Color Table 3 Bits
- */
-static void
-GifWriteImageDescriptor(int w, int h, unsigned char *bp)
-{
- bp[0] = ','; /* Image separator */
- bp[1] = bp[2] = 0; /* Left offset of image. */
- bp[3] = bp[4] = 0; /* Top offset of image. */
- GifSetShort(bp + 5, w); /* Width of image. */
- GifSetShort(bp + 7, h); /* Height of image. */
- bp[9] = 0; /* Flags: no local table, not interlaced,
- * and unsorted. */
-}
-
-/*
- * Graphic Control Extension
- *
- * 0 1 Extension Introducer
- * 1 2 Graphic Control Label
- * 2 1 Block size
- * 3 1 Flags.
- * bits 5-7 Reserved 3 Bits
- * bits 2-4 Disposal Method 3 Bits
- * bit 1 User Input Flag 1 Bit
- * bit 0 Transparent Color Flag 1 Bit
- * 4 2 Delay time.
- * 6 1 Transparent Color Index
- * 7 1 Block terminator
- */
-static void
-GifWriteGraphicControlExtension(int colorIndex, int delay, unsigned char *bp)
-{
- bp[0] = '!'; /* Extension introducer */
- bp[1] = 0xF9; /* Graphic control label */
- bp[2] = 4; /* Block size. */
- bp[3] = (colorIndex != -1); /* Transparent flag. */
- GifSetShort(bp + 4, delay);
- bp[6] = colorIndex; /* Transparent color index */
- bp[7] = 0; /* Block terminator */
-}
-
-/*
- * Write optional comment block
- */
-static void
-GifWriteCommentExtension(Blt_DBuffer dbuffer, const char *comment)
-{
- int n, length;
- unsigned char *bp;
-
- /* Comment extension and label */
- length = strlen(comment);
- if (length > 255) {
- length = 255;
- }
- n = 3 + length + 1;
- bp = Blt_DBuffer_Extend(dbuffer, n);
- bp[0] = '!';
- bp[1] = 0xFE;
- bp[2] = length;
- memcpy(bp + 3, comment, length);
- bp[n - 1] = '\0';
-}
-
-/*
- * Graphic Control Extension
- *
- * 0 1 Extension Introducer
- * 1 2 Graphic Control Label
- * 2 1 Block size
- * 3 1 Flags.
- * bits 5-7 Reserved 3 Bits
- * bits 2-4 Disposal Method 3 Bits
- * bit 1 User Input Flag 1 Bit
- * bit 0 Transparent Color Flag 1 Bit
- * 4 2 Delay time.
- * 6 1 Transparent Color Index
- * 7 1 Block terminator
- */
-static void
-GifWriteNetscapeAppExtension(int nLoop, unsigned char *bp)
-{
- bp[0] = '!'; /* Extension introducer */
- bp[1] = 0xFF; /* Application extension label */
- bp[2] = 11; /* Block size. */
- memcpy(bp + 3, "NETSCAPE2.0", 11);
- bp[14] = 0x3; /* Length of data sub-block */
- bp[15] = 0x1;
- bp[16] = 0xFF;
- bp[17] = 0xFF;
- bp[18] = 0; /* Block terminator */
-}
-
-#define DICTSIZE 5003 /* 80% occupancy */
-#define MAXCODE(n) ((1 << (n)) - 1)
-
-typedef struct {
- int fcode;
- unsigned int ent;
-} LzwDictEntry;
-
-typedef struct {
- int nBits;
- int maxCode;
- int codeLimit;
- LzwDictEntry dict[DICTSIZE];
- int ent;
- int hshift;
- int nextUnusedCode;
- int codeCount;
- int initBits;
- int clearCode;
- int eofCode;
- unsigned int curAccum;
- int curBits;
- unsigned char accum[256];
- int a_count;
- Blt_DBuffer dbuffer;
-} LzwCompressor;
-
-static void
-LzwDictShift(LzwCompressor *lzwPtr)
-{
- int hshift;
- int fcode;
-
- hshift = 0;
- for (fcode = DICTSIZE; fcode < 65536L; fcode += fcode) {
- hshift++;
- }
- lzwPtr->hshift = 8 - hshift; /* set hash code range bound */
-}
-
-static void
-LzwDictInit(LzwCompressor *lzwPtr)
-{
- LzwDictEntry *hp, *hend;
-
- for (hp = lzwPtr->dict, hend = hp + DICTSIZE; hp < hend; hp++) {
- hp->fcode = -1;
- hp->ent = 0;
- }
- lzwPtr->nextUnusedCode = lzwPtr->clearCode + 2;
-}
-
-/*
- * Flush the packet to disk, and reset the accumulator
- */
-INLINE static void
-LzwFlush(LzwCompressor *lzwPtr)
-{
- if(lzwPtr->a_count > 0) {
- unsigned char *bp;
-
- bp = Blt_DBuffer_Extend(lzwPtr->dbuffer, lzwPtr->a_count + 1);
- bp[0] = lzwPtr->a_count;
- memcpy(bp + 1, lzwPtr->accum, lzwPtr->a_count);
- lzwPtr->a_count = 0;
- }
-}
-
-/*
- * Add a character to the end of the current packet, and if it is 254
- * characters, flush the packet to disk.
- */
-INLINE static void
-LzwAccum(LzwCompressor *lzwPtr, unsigned char byte)
-{
- lzwPtr->accum[lzwPtr->a_count] = byte;
- lzwPtr->a_count++;
- if(lzwPtr->a_count >= 254) {
- LzwFlush(lzwPtr);
- }
-}
-
-INLINE static void
-LzwSetCodeSize(LzwCompressor *lzwPtr, int nBits)
-{
- lzwPtr->nBits = nBits;
- assert(nBits <= LZW_MAX_BITS);
- lzwPtr->maxCode = MAXCODE(nBits);
-}
-
-INLINE static void
-LzwIncrCodeSize(LzwCompressor *lzwPtr)
-{
- assert((lzwPtr->nBits + 1) <= LZW_MAX_BITS);
- LzwSetCodeSize(lzwPtr, lzwPtr->nBits + 1);
-}
-
-INLINE static void
-LzwAdjustCodeSize(LzwCompressor *lzwPtr)
-{
- assert(lzwPtr->nextUnusedCode <= lzwPtr->codeLimit);
- if (lzwPtr->nextUnusedCode == lzwPtr->codeLimit) {
- lzwPtr->codeLimit += lzwPtr->codeLimit;
- LzwIncrCodeSize(lzwPtr);
- }
- lzwPtr->nextUnusedCode++;
- assert(lzwPtr->codeLimit <= LZW_MAX_CODE);
-}
-
-static int
-LzwDictSearch(LzwCompressor *lzwPtr, int pixel)
-{
- int hval;
- int fcode;
- int disp;
- LzwDictEntry *hPtr;
-
- fcode = (int) ((pixel << LZW_MAX_BITS) + lzwPtr->ent);
- hval = ((pixel << lzwPtr->hshift) ^ lzwPtr->ent); /* XOR hashing */
-
- /* Secondary hash (after G. Knott) */
- disp = (hval == 0) ? 1 : DICTSIZE - hval;
- while ((lzwPtr->dict[hval].fcode != fcode) &&
- (lzwPtr->dict[hval].fcode >= 0)) {
- hval -= disp;
- if (hval < 0) {
- hval += DICTSIZE;
- }
- }
- hPtr = lzwPtr->dict + hval;
- if (hPtr->fcode == fcode ) {
- lzwPtr->ent = hPtr->ent;
- return TRUE;
- } else {
- hPtr->ent = lzwPtr->nextUnusedCode;
- hPtr->fcode = fcode;
- return FALSE;
- }
-}
-
-static void
-LzwPutCode(LzwCompressor *lzwPtr, int code)
-{
- assert(code <= lzwPtr->maxCode);
- lzwPtr->curAccum &= (1 << lzwPtr->curBits) - 1;
- if (lzwPtr->curBits > 0) {
- lzwPtr->curAccum |= ((unsigned long)code << lzwPtr->curBits);
- } else {
- lzwPtr->curAccum = code;
- }
- lzwPtr->curBits += lzwPtr->nBits;
-
- while (lzwPtr->curBits >= 8) {
- LzwAccum(lzwPtr, (unsigned int)lzwPtr->curAccum & 0xff);
- lzwPtr->curAccum >>= 8;
- lzwPtr->curBits -= 8;
- }
- lzwPtr->codeCount++;
-}
-
-
-static void
-LzwResetCompressor(LzwCompressor *lzwPtr)
-{
- LzwDictInit(lzwPtr); /* Clear out the hash table */
- LzwPutCode(lzwPtr, lzwPtr->clearCode);
- LzwSetCodeSize(lzwPtr, lzwPtr->initBits);
- lzwPtr->codeLimit = (1 << lzwPtr->initBits);
-}
-
-static void
-LzwOutputCurrent(LzwCompressor *lzwPtr)
-{
- LzwPutCode(lzwPtr, lzwPtr->ent);
- /*
- * If the next entry is going to be too big for the code size, then
- * increase it, if possible.
- */
- if (lzwPtr->nextUnusedCode < LZW_MAX_CODE) {
- LzwAdjustCodeSize(lzwPtr);
- } else {
- LzwResetCompressor(lzwPtr);
- }
- if (lzwPtr->ent == lzwPtr->eofCode) {
- /* At EOF, write the rest of the buffer. */
- while (lzwPtr->curBits > 0) {
- LzwAccum(lzwPtr, (unsigned int)lzwPtr->curAccum & 0xff);
- lzwPtr->curAccum >>= 8;
- lzwPtr->curBits -= 8;
- }
- LzwFlush(lzwPtr);
- }
-}
-
-static void
-GifWriteGlobalColorTable(Blt_HashTable *colorTablePtr, unsigned char *bp)
-{
- unsigned long index;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- index = 0;
- for (hPtr = Blt_FirstHashEntry(colorTablePtr, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- union {
- unsigned long index;
- char *key;
- } value;
- Blt_Pixel pixel;
-
- Blt_SetHashValue(hPtr, index);
- value.key = Blt_GetHashKey(colorTablePtr, hPtr);
- pixel.u32 = (unsigned int)value.index;
- bp[0] = pixel.Red;
- bp[1] = pixel.Green;
- bp[2] = pixel.Blue;
- bp += 3;
- index++;
- }
-}
-
-static int
-GetColorIndex(Blt_HashTable *colorTablePtr, Blt_Pixel *colorPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_Pixel pixel;
- int index;
- int nColors;
- union {
- unsigned long pixel;
- char *key;
- } value;
-
- nColors = colorTablePtr->numEntries;
- pixel.u32 = colorPtr->u32;
- pixel.Alpha = 0xFF;
- value.pixel = pixel.u32;
- hPtr = Blt_FindHashEntry(colorTablePtr, value.key);
- if (hPtr == NULL) {
- GifError("can't find color %x,%x,%x in color table\n",
- colorPtr->Red, colorPtr->Blue, colorPtr->Green);
- }
- if (colorPtr->Alpha == 0x00) {
- index = (int)nColors;
- } else {
- index = (unsigned long)Blt_GetHashValue(hPtr);
- }
- return index;
-}
-
-static void
-GifAddText(Blt_DBuffer dbuffer, const char **comments)
-{
- const char **p;
-
- for (p = comments; *p != NULL; p++) {
- GifWriteCommentExtension(dbuffer, *p);
- }
-}
-
-static void
-GifWriteImageData(Blt_DBuffer dbuffer, Pict *srcPtr,
- Blt_HashTable *colorTablePtr)
-{
- LzwCompressor lzw;
- int initBits;
- int initCodeSize;
- int bitsPerPixel;
-
- bitsPerPixel = GetLog2(colorTablePtr->numEntries - 1);
- assert((bitsPerPixel > 0) && (bitsPerPixel <= 8));
- /*
- bitsPerPixel = (colorMapSize == 1) ? 1 : ns(colorMapSize - 1);
- initCodeSize = bitsPerPixel <= 1 ? 2 : bitsPerPixel;
- initBits = initCodeSize + 1;
- clearCode = 1 << (initBits - 1);
- */
- initCodeSize = (bitsPerPixel <= 1) ? 2 : bitsPerPixel;
- initBits = bitsPerPixel + 1;
- memset(&lzw, 0, sizeof(lzw));
- /*
- * Set up the globals: initBits - initial number of bits
- */
- lzw.initBits = initBits;
- lzw.curAccum = 0;
- lzw.curBits = 0;
- lzw.dbuffer = dbuffer;
-
- /* Set up the necessary values */
- lzw.codeCount = 0;
- lzw.nBits = lzw.initBits;
- lzw.maxCode = MAXCODE(lzw.nBits);
- lzw.clearCode = (1 << (initBits - 1));
- lzw.eofCode = lzw.clearCode + 1;
- lzw.nextUnusedCode = lzw.clearCode + 2;
- lzw.codeLimit = (1 << initBits);
- lzw.a_count = 0;
- LzwDictShift(&lzw);
-
- Blt_DBuffer_AppendByte(dbuffer, initCodeSize);
- LzwResetCompressor(&lzw);
- /* Add compressed image data. */
- {
- Blt_Pixel *srcRowPtr, *sp;
- int y;
-
- sp = srcRowPtr = srcPtr->bits;
- lzw.ent = GetColorIndex(colorTablePtr, sp);
- sp++;
- for(y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *send;
-
- for (send = srcRowPtr + srcPtr->width; sp < send; sp++) {
- unsigned long index;
-
- index = GetColorIndex(colorTablePtr, sp);
- if (!LzwDictSearch(&lzw, index)) {
- LzwOutputCurrent(&lzw);
- lzw.ent = index;
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- sp = srcRowPtr;
- }
- }
- /* Put out the final code and sub-block terminator. */
- LzwOutputCurrent(&lzw);
- lzw.ent = lzw.eofCode;
- LzwOutputCurrent(&lzw);
- Blt_DBuffer_AppendByte(dbuffer, '\0'); /* Mark end of data sub-blocks. */
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictureToGif --
- *
- * Converts a picture to the GIF format. Since the GIF format doesn't
- * handle semi-transparent pixels we have to blend the image with a given
- * background color, while still retaining any 100% transparent pixels.
- *
- * Results:
- * A standard TCL result is returned. If an error occured,
- * such as the designated file could not be opened, TCL_ERROR is returned.
- *
- * Side Effects:
- * The dynamic buffer is filled with the GIF image.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PictureToGif(Tcl_Interp *interp, Blt_Picture original, Blt_DBuffer dbuffer,
- GifExportSwitches *switchesPtr)
-{
- Blt_HashTable colorTable;
- Pict *srcPtr;
- int bitsPerPixel;
- int isMasked;
- int n;
- int nColors, maxColors;
- unsigned char *bp;
-
- srcPtr = original;
- if ((srcPtr->width < 1) || (srcPtr->height < 1)) {
- return TCL_OK;
- }
- nColors = Blt_QueryColors(srcPtr, (Blt_HashTable *)NULL);
- maxColors = 256;
- if (Blt_PictureIsMasked(srcPtr)) {
- if (switchesPtr->flags & EXPORT_BLEND) {
- Blt_Picture background;
-
- /* Blend picture with solid color background. */
- background = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- Blt_BlankPicture(background, &switchesPtr->bg);
- Blt_BlendPictures(background, srcPtr, 0, 0, srcPtr->width,
- srcPtr->height, 0, 0);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- srcPtr = background;
- nColors = Blt_QueryColors(srcPtr, (Blt_HashTable *)NULL);
- } else if (nColors >= 256) {
- maxColors--;
- }
- }
- if (nColors > maxColors) {
- Blt_Picture quant;
-
- quant = Blt_QuantizePicture(srcPtr, maxColors);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- srcPtr = quant;
- }
- Blt_InitHashTable(&colorTable, BLT_ONE_WORD_KEYS);
- nColors = Blt_QueryColors(srcPtr, &colorTable);
- isMasked = Blt_PictureIsMasked(srcPtr);
- bitsPerPixel = GetLog2(nColors - 1);
- /*
- * 6 Header
- * 7 Logical Screen Descriptor
- * 3 * (1<<bitPerPixel) Global Color Table
- * 8 Graphic Control Extension
- * 10 Image Descriptor
- */
- n = 6 + 7 + (3 * (1<<bitsPerPixel)) + 10;
- if (isMasked) {
- n += 8;
- }
- bp = Blt_DBuffer_Extend(dbuffer, n);
-
- /* Header */
- if (isMasked) {
- memcpy(bp, "GIF89a", 6);
- } else {
- memcpy(bp, "GIF87a", 6);
- }
- bp += 6; /* Size of header */
- GifWriteLogicalScreenDescriptor(srcPtr->width, srcPtr->height,
- bitsPerPixel, bp);
- bp += 7; /* Size of logical screen
- * descriptor. */
- GifWriteGlobalColorTable(&colorTable, bp);
- bp += 3 * (1<<bitsPerPixel); /* Size of global color table. */
- if (isMasked) {
- GifWriteGraphicControlExtension(nColors, 0, bp);
- bp += 8; /* size of graphic control
- * extension. */
- }
- GifWriteImageDescriptor(srcPtr->width, srcPtr->height, bp);
- bp += 10; /* Size of image descriptor. */
-
- GifWriteImageData(dbuffer, srcPtr, &colorTable);
- if (switchesPtr->comments != NULL) {
- GifAddText(dbuffer, switchesPtr->comments);
- }
- Blt_DBuffer_AppendByte(dbuffer, ';'); /* File terminator */
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- return TCL_OK;
-}
-
-#ifndef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * PicturesToAnimatedGif --
- *
- * Converts a one or more pictures to into the animates GIF format.
- * Since the GIF format doesn't handle semi-transparent pixels we have to
- * blend the image with a given background color, while still retaining
- * any 100% transparent pixels.
- *
- * Results:
- * A standard TCL result is returned. If an error occured, such as the
- * designated file could not be opened, TCL_ERROR is returned.
- *
- * Side Effects:
- * The dynamic buffer is filled with the GIF image.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PicturesToAnimatedGif(Tcl_Interp *interp, Blt_Chain chain, Blt_DBuffer dbuffer,
- GifExportSwitches *switchesPtr)
-{
- Blt_ChainLink link;
- Blt_HashTable colorTable;
- Frame *fp, *fend, *frames;
- int bitsPerPixel;
- int n;
- int nColors, maxColors, nFrames;
- int screenWidth, screenHeight;
- unsigned char *bp;
-
- /* For each frame quantize if needed, accumulate the colors used. try to
- * assemble */
-
- maxColors = 255;
- nFrames = Blt_Chain_GetLength(chain);
- if (nFrames == 0) {
- return TCL_ERROR;
- }
- frames = Blt_AssertCalloc(nFrames, sizeof(Frame));
- link = Blt_Chain_FirstLink(chain);
- fp = frames;
- fp->original = Blt_Chain_GetValue(link);
-
- /*
- * Step 1: Load the pictures into the array. Determine what the
- * maximum picture width and height are.
- */
- screenWidth = Blt_PictureWidth(fp->original);
- screenHeight = Blt_PictureHeight(fp->original);
- for (fp = frames, link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link), fp++) {
- Pict *srcPtr;
-
- srcPtr = fp->current = fp->original = Blt_Chain_GetValue(link);
- fp->delay = srcPtr->delay;
- if (srcPtr->width > screenWidth) {
- screenWidth = srcPtr->width;
- }
- if (srcPtr->height > screenHeight) {
- screenHeight = srcPtr->height;
- }
- }
- /*
- * Step 2: Convert the pictures into the same maximum size. Automatically
- * handle blended pictures by blending into a known background.
- */
- Blt_InitHashTable(&colorTable, BLT_ONE_WORD_KEYS);
- for (fp = frames, fend = fp + nFrames; fp < fend; fp++) {
- Pict *srcPtr;
-
- srcPtr = fp->current;
- if ((srcPtr->flags & BLT_PIC_BLEND) || (srcPtr->width != screenWidth) ||
- (srcPtr->height != screenHeight)) {
- Pict *bg;
-
- /* Blend picture with solid color background. */
- bg = Blt_CreatePicture(screenWidth, screenHeight);
- Blt_BlankPicture(bg, &switchesPtr->bg);
- Blt_BlendPictures(bg, srcPtr, 0, 0, srcPtr->width, srcPtr->height,
- 0, 0);
- srcPtr = fp->current = bg;
- }
- Blt_QueryColors(srcPtr, &colorTable);
- }
- /*
- * Step 3: If there are more that 256 colors, compute color lookup
- * table by quantizing all the pictures in the sequence.
- */
- if (colorTable.numEntries > maxColors) {
- Blt_Chain sequence;
- Blt_ColorLookupTable clut;
-
- sequence = Blt_Chain_Create();
- for (fp = frames, fend = fp + nFrames; fp < fend; fp++) {
- Blt_Chain_Append(sequence, fp->current);
- }
- clut = Blt_GetColorLookupTable(sequence, maxColors);
- Blt_Chain_Destroy(sequence);
-
- /* Dump the old color table and build a new old. */
- Blt_DeleteHashTable(&colorTable);
- Blt_InitHashTable(&colorTable, BLT_ONE_WORD_KEYS);
-
- for (fp = frames, fend = fp + nFrames; fp < fend; fp++) {
- Pict *srcPtr, *destPtr;
-
- srcPtr = fp->current;
- destPtr = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- Blt_MapColors(destPtr, srcPtr, clut);
- if (fp->current != fp->original) {
- Blt_FreePicture(fp->current);
- }
- fp->current = destPtr;
- Blt_QueryColors(destPtr, &colorTable);
- }
- Blt_Free(clut);
- }
-
- /*
- * Step 4: Write the animated GIF output.
- */
- nColors = colorTable.numEntries;
- bitsPerPixel = GetLog2(nColors - 1);
- /*
- * 6 Header
- * 7 Logical Screen Descriptor
- * 3 * (1<<bitPerPixel) Global Color Table
- * 8 Graphic Control Extension
- * 10 Image Descriptor
- */
- n = 6 + 7 + (3 * (1<<bitsPerPixel)) + 19;
- bp = Blt_DBuffer_Extend(dbuffer, n);
-
- /* Header */
- memcpy(bp, "GIF89a", 6);
- bp += 6; /* Size of header */
- GifWriteLogicalScreenDescriptor(screenWidth, screenHeight,
- bitsPerPixel, bp);
- bp += 7; /* Size of logical screen
- * descriptor. */
- GifWriteGlobalColorTable(&colorTable, bp);
- bp += 3 * (1<<bitsPerPixel); /* Size of global color table. */
-
- GifWriteNetscapeAppExtension(10, bp);
- bp += 19;
- for (fp = frames, fend = fp + nFrames; fp < fend; fp++) {
- Pict *srcPtr;
-
- bp = Blt_DBuffer_Extend(dbuffer, 18);
- srcPtr = fp->current;
- GifWriteGraphicControlExtension(-1, switchesPtr->delay, bp);
- bp += 8; /* Size of graphic control
- * extension. */
- GifWriteImageDescriptor(srcPtr->width, srcPtr->height, bp);
- bp += 10; /* Size of image descriptor. */
- GifWriteImageData(dbuffer, srcPtr, &colorTable);
- if (fp->current != fp->original) {
- Blt_FreePicture(fp->current);
- }
- }
- Blt_Free(frames);
- Blt_DeleteHashTable(&colorTable);
- if (switchesPtr->comments != NULL) {
- GifAddText(dbuffer, switchesPtr->comments);
- }
- Blt_DBuffer_AppendByte(dbuffer, ';'); /* File terminator */
- return TCL_OK;
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsGif --
- *
- * Attempts to parse a GIF file header.
- *
- * Results:
- * Returns 1 is the header is GIF and 0 otherwise. Note that the
- * validity of the header contents is not checked here. That's done in
- * GifToPictures.
- *
- *---------------------------------------------------------------------------
- */
-static int
-IsGif(Blt_DBuffer dbuffer)
-{
- Gif gif;
- int bool;
-
- bool = GifHeader(dbuffer, &gif);
- return bool;
-}
-
-static Blt_Chain
-ReadGif(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer)
-{
- GifImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- return GifToPictures(interp, fileName, dbuffer, &switches);
-}
-
-static Tcl_Obj *
-WriteGif(Tcl_Interp *interp, Blt_Picture picture)
-{
- Blt_DBuffer dbuffer;
- GifExportSwitches switches;
- Tcl_Obj *objPtr;
- char *bytes;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- dbuffer = Blt_DBuffer_Create();
- objPtr = NULL;
- if (PictureToGif(interp, picture, dbuffer, &switches) != TCL_OK) {
- Blt_DBuffer_Destroy(dbuffer);
- return NULL;
- }
- bytes = Blt_DBuffer_EncodeBase64(interp, dbuffer);
- if (bytes != NULL) {
- objPtr = Tcl_NewStringObj(bytes, -1);
- Blt_Free(bytes);
- }
- Blt_DBuffer_Destroy(dbuffer);
- return objPtr;
-}
-
-static Blt_Chain
-ImportGif(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv,
- const char **fileNamePtr)
-{
- Blt_DBuffer dbuffer;
- Blt_Chain chain;
- const char *string;
- GifImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one import source: ",
- "use only one -file or -data flag.", (char *)NULL);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- dbuffer = Blt_DBuffer_Create();
- chain = NULL;
- if (switches.dataObjPtr != NULL) {
- unsigned char *bytes;
- int nBytes;
-
- bytes = Tcl_GetByteArrayFromObj(switches.dataObjPtr, &nBytes);
- if (Blt_IsBase64(bytes, nBytes)) {
- if (Blt_DBuffer_DecodeBase64(interp, string, nBytes, dbuffer)
- != TCL_OK) {
- goto error;
- }
- } else {
- Blt_DBuffer_AppendData(dbuffer, bytes, nBytes);
- }
- string = "data buffer";
- *fileNamePtr = NULL;
- } else {
- string = Tcl_GetString(switches.fileObjPtr);
- *fileNamePtr = string;
- if (Blt_DBuffer_SaveFile(interp, string, dbuffer) != TCL_OK) {
- goto error;
- }
- }
- chain = GifToPictures(interp, string, dbuffer, &switches);
- if (chain == NULL) {
- fprintf(stderr, "import gif: can't read buffer\n");
- }
- error:
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(dbuffer);
- return chain;
-}
-
-static int
-ExportGif(Tcl_Interp *interp, unsigned int index, Blt_Chain chain, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_DBuffer dbuffer;
- GifExportSwitches switches;
- int result;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- switches.index = index;
- switches.delay = 20;
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one export destination: ",
- "use only one -file or -data flag.", (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- dbuffer = Blt_DBuffer_Create();
- if (switches.flags & EXPORT_ANIMATE) {
- if (PicturesToAnimatedGif(interp, chain, dbuffer, &switches) != TCL_OK){
- Tcl_AppendResult(interp, "can't convert \"", Tcl_GetString(objv[2]),
- "\"", (char *)NULL);
- goto error;
- }
- } else {
- Blt_Picture picture;
-
- picture = Blt_GetNthPicture(chain, switches.index);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "bad picture index.", (char *)NULL);
- goto error;
- }
- if (PictureToGif(interp, picture, dbuffer, &switches) != TCL_OK) {
- Tcl_AppendResult(interp, "can't convert \"", Tcl_GetString(objv[2]),
- "\"", (char *)NULL);
- goto error;
- }
- }
- if (switches.fileObjPtr != NULL) {
- const char *fileName;
-
- /* Write the image into the designated file. */
- fileName = Tcl_GetString(switches.fileObjPtr);
- result = Blt_DBuffer_SaveFile(interp, fileName, dbuffer);
- } else if (switches.dataObjPtr != NULL) {
- Tcl_Obj *objPtr;
-
- /* Write the image into the designated TCL variable. */
- objPtr = Tcl_ObjSetVar2(interp, switches.dataObjPtr, NULL,
- Blt_DBuffer_ByteArrayObj(dbuffer), 0);
- result = (objPtr == NULL) ? TCL_ERROR : TCL_OK;
- } else {
- char *string;
-
- /* Return the image as a base64 string in the interpreter result. */
- result = TCL_ERROR;
- string = Blt_DBuffer_EncodeBase64(interp, dbuffer);
- if (string != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(string, -1);
- Blt_Free(string);
- Tcl_SetObjResult(interp, objPtr);
- result = TCL_OK;
- }
- }
- error:
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(dbuffer);
- return result;
-}
-
-int
-Blt_PictureGifInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_core", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgRequire(interp, "blt_extra", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_picture_gif", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_PictureRegisterFormat(interp,
- "gif", /* Name of format. */
- IsGif, /* Discovery routine. */
- ReadGif, /* Read format procedure. */
- WriteGif, /* Write format procedure. */
- ImportGif, /* Import format procedure. */
- ExportGif); /* Export format switches. */
-}
diff --git a/blt3.0.1/src/bltPictInt.h b/blt3.0.1/src/bltPictInt.h
deleted file mode 100644
index ac94ed4..0000000
--- a/blt3.0.1/src/bltPictInt.h
+++ /dev/null
@@ -1,219 +0,0 @@
-
-/*
- * bltPictInt.h --
- *
- * Copyright 2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_PIC_INT_H
-#define _BLT_PIC_INT_H
-
-/*
- * Scaled integers are fixed point values. The upper 18 bits is the integer
- * portion, the lower 14 bits the fractional remainder. Must be careful
- * not to overflow the values (especially during multiplication).
- *
- * The following operations are defined:
- *
- * S * n Scaled integer times an integer.
- * S1 + S2 Scaled integer plus another scaled integer.
- *
- */
-
-#define float2si(f) (int)((f) * 16383.0 + ((f < 0) ? -0.5 : 0.5))
-#define uchar2si(b) (((int)(b)) << 14)
-#define si2int(s) (((s) + 8192) >> 14)
-#define int2si(i) (((i) << 14) - 8192)
-
-/*
- * The following macro converts a fixed-point scaled integer to a
- * byte, clamping the value between 0 and 255.
- */
-#define SICLAMP(s) \
- (unsigned char)(((s) < 0) ? 0 : ((s) > 4177920) ? 255 : (si2int(s)))
-
-#define div255(i) ((((int)(i) + 1) + (((int)(i) + 1) >> 8) ) >> 8)
-#define div257(t) (((t)+((t)>>8))>>8)
-#define mul255(i) (((int)(i) << 8) - ((int)(i)))
-
-#define RGBIndex(r,g,b) (((r)<<10) + ((r)<<6) + (r) + ((g) << 5) + (g) + (b))
-
-#define ROTATE_0 0
-#define ROTATE_90 1
-#define ROTATE_180 2
-#define ROTATE_270 3
-
-#define UCLAMP(s) (unsigned char)(((s) < 0) ? 0 : ((s) > 255) ? 255 : (s))
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResampleFilterProc --
- *
- * A function implementing a 1-D filter.
- *
- *---------------------------------------------------------------------------
- */
-typedef double (Blt_ResampleFilterProc) (double value);
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResampleFilter --
- *
- * Contains information about a 1-D filter (its support and
- * the procedure implementing the filter).
- *
- *---------------------------------------------------------------------------
- */
-struct _Blt_ResampleFilter {
- const char *name; /* Name of the filter */
- Blt_ResampleFilterProc *proc; /* 1-D filter procedure. */
- double support; /* Width of 1-D filter */
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableFilter --
- *
- * Contains information about a 1-D filter (its support and
- * the procedure implementing the filter).
- *
- *---------------------------------------------------------------------------
- */
-struct _Blt_TableFilter {
- float scale;
- int nWeights; /* Width of 1-D filter */
- int weights[1];
-};
-
-#define RESAMPLE_FILTER 0
-#define TABLE_FILTER 1
-struct _Blt_ConvolveFilter {
- int type;
- void *filter;
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * Filter2D --
- *
- * Defines a convolution mask for a 2-D filter. Used to smooth or
- * enhance images.
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- double support; /* Radius of filter */
- double sum, scale; /* Sum of kernel */
- double *kernel; /* Array of values (malloc-ed) representing
- * the discrete 2-D filter. */
-} Filter2D;
-
-/*
- * We can use scaled integers (20-bit fraction) to compute the
- * luminosity with reasonable accuracy considering it's stored
- * in an 8-bit result.
- */
-#define YR 223002 /* 0.212671 */
-#define YG 749900 /* 0.715160 */
-#define YB 75675 /* 0.072169 */
-#define YMAX 267386880 /* 255.0 */
-#define YCLAMP(s) \
- (unsigned char)((s) > YMAX) ? 255 : ((((s) + 524288) >> 20))
-
-#define JITTER(x) ((x) * (0.05 - drand48() * 0.10))
-#define JCLAMP(c) ((((c) < 0.0) ? 0.0 : ((c) > 1.0) ? 1.0 : (c)))
-
-typedef union {
- int i32; /* Fixed point (scaled
- * integer). 14-bit fraction. */
- float f32;
-} PixelWeight;
-
-typedef struct {
- int start;
- PixelWeight *wend; /* Points to just beyond the last
- * weight. Tracks the number of
- * weights in array below. */
- PixelWeight weights[1]; /* Array of weights. */
-} Sample;
-
-typedef struct _Blt_Picture Pict;
-typedef struct _Blt_ResampleFilter ResampleFilter;
-typedef struct _Blt_TableFilter TableFilter;
-
-BLT_EXTERN unsigned int Blt_ComputeWeights(unsigned int sw, unsigned int dw,
- ResampleFilter *filterPtr, Sample **samplePtrPtr);
-
-typedef void (Blt_ApplyPictureToPictureProc)(Blt_Picture dest, Blt_Picture src,
- int x, int y, int w, int h, int dx, int dy, Blt_PictureArithOps op);
-typedef void (Blt_ApplyScalarToPictureProc)(Blt_Picture dest,
- Blt_Pixel *colorPtr, Blt_PictureArithOps op);
-typedef void (Blt_ApplyPictureToPictureWithMaskProc)(Blt_Picture dest,
- Blt_Picture src, Blt_Picture mask, int x, int y, int w, int h,
- int dx, int dy, int invert, Blt_PictureArithOps op);
-typedef void (Blt_ApplyScalarToPictureWithMaskProc)(Blt_Picture dest,
- Blt_Pixel *colorPtr, Blt_Picture mask,
- int invert, Blt_PictureArithOps op);
-typedef void (Blt_TentHorizontallyProc)(Blt_Picture dest, Blt_Picture src);
-typedef void (Blt_TentVerticallyProc)(Blt_Picture dest, Blt_Picture src);
-typedef void (Blt_ZoomHorizontallyProc)(Blt_Picture dest, Blt_Picture src,
- Blt_ResampleFilter filter);
-typedef void (Blt_ZoomVerticallyProc)(Blt_Picture dest, Blt_Picture src,
- Blt_ResampleFilter filter);
-typedef void (Blt_BlendPicturesProc)(Blt_Picture dest, Blt_Picture src,
- int sx, int sy, int w, int h, int dx, int dy);
-typedef void (Blt_SelectPixelsProc)(Blt_Picture dest, Blt_Picture src,
- Blt_Pixel *lowPtr , Blt_Pixel *highPtr);
-typedef void (Blt_AssociateColorsProc)(Blt_Picture picture);
-typedef void (Blt_UnassociateColorsProc)(Blt_Picture picture);
-typedef void (Blt_FadePictureProc) (Blt_Picture dest, Blt_Picture src,
- int sx, int sy, int w, int h, int dx, int dy, int alpha);
-typedef void (Blt_CopyPictureBitsProc)(Blt_Picture dest, Blt_Picture src,
- int sx, int sy, int w, int h, int dx, int dy);
-
-typedef struct {
- Blt_ApplyPictureToPictureProc *applyPictureToPictureProc;
- Blt_ApplyScalarToPictureProc *applyScalarToPictureProc;
- Blt_ApplyPictureToPictureWithMaskProc *applyPictureToPictureWithMaskProc;
- Blt_ApplyScalarToPictureWithMaskProc *applyScalarToPictureWithMaskProc;
- Blt_TentHorizontallyProc *tentHorizontallyProc;
- Blt_TentVerticallyProc *tentVerticallyProc;
- Blt_ZoomHorizontallyProc *zoomHorizontallyProc;
- Blt_ZoomVerticallyProc *zoomVerticallyProc;
- Blt_BlendPicturesProc *blendPicturesProc;
- Blt_SelectPixelsProc *selectPixelsProc;
- Blt_AssociateColorsProc *associateColorsProc;
- Blt_UnassociateColorsProc *unassociateColorsProc;
- Blt_FadePictureProc *fadePictureProc;
- Blt_CopyPictureBitsProc *copyPictureBitsProc;
-} Blt_PictureProcs;
-
-BLT_EXTERN Blt_PictureProcs *bltPictProcsPtr;
-
-#endif /*_BLT_PIC_INT_H*/
diff --git a/blt3.0.1/src/bltPictJpg.c b/blt3.0.1/src/bltPictJpg.c
deleted file mode 100644
index 8340aef..0000000
--- a/blt3.0.1/src/bltPictJpg.c
+++ /dev/null
@@ -1,878 +0,0 @@
-
-/*
- * bltPictJpg.c --
- *
- * This module implements JPEG file format conversion routines for the picture
- * image type in the BLT toolkit.
- *
- * Copyright 2003-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The JPEG reader/writer is adapted from jdatasrc.c and jdatadst.c in the
- * Independent JPEG Group (version 6b) library distribution.
- *
- * The authors make NO WARRANTY or representation, either express or
- * implied, with respect to this software, its quality, accuracy,
- * merchantability, or fitness for a particular purpose. This software
- * is provided "AS IS", and you, its user, assume the entire risk as to
- * its quality and accuracy.
- *
- * This software is copyright (C) 1991-1998, Thomas G. Lane. All Rights
- * Reserved except as specified below.
- *
- * Permission is hereby granted to use, copy, modify, and distribute this
- * software (or portions thereof) for any purpose, without fee, subject
- * to these conditions: (1) If any part of the source code for this
- * software is distributed, then this README file must be included, with
- * this copyright and no-warranty notice unaltered; and any additions,
- * deletions, or changes to the original files must be clearly indicated
- * in accompanying documentation. (2) If only executable code is
- * distributed, then the accompanying documentation must state that "this
- * software is based in part on the work of the Independent JPEG Group".
- * (3) Permission for use of this software is granted only if the user
- * accepts full responsibility for any undesirable consequences; the
- * authors accept NO LIABILITY for damages of any kind.
- *
- */
-
-#include "blt.h"
-
-#include "config.h"
-#ifdef HAVE_LIBJPG
-
-#include <tcl.h>
-
-#include <bltSwitch.h>
-#include <bltDBuffer.h>
-#include <bltHash.h>
-#include <bltAlloc.h>
-#include "bltPicture.h"
-#include "bltPictFmts.h"
-
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif /* HAVE_MEMORY_H */
-
-typedef struct _Blt_Picture Picture;
-
-#undef HAVE_STDLIB_H
-#ifdef WIN32
-#define XMD_H 1
-#endif
-#undef EXTERN
-#undef FAR
-#include "jpeglib.h"
-#include "jerror.h"
-#include <setjmp.h>
-
-#define PIC_PROGRESSIVE (1<<0)
-#define PIC_NOQUANTIZE (1<<1)
-
-#define PIC_FMT_ISASCII (1<<3)
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- int quality; /* Value 0..100 */
- int smoothing; /* Value 0..100 */
- int compress; /* Value 0..N */
- int flags; /* Flag. */
- Blt_Pixel bg;
- int index;
-} JpgExportSwitches;
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- int fast;
-} JpgImportSwitches;
-
-BLT_EXTERN Blt_SwitchParseProc Blt_ColorSwitchProc;
-
-static Blt_SwitchCustom colorSwitch = {
- Blt_ColorSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-bg", "color",
- Blt_Offset(JpgExportSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(JpgExportSwitches, dataObjPtr),0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(JpgExportSwitches, fileObjPtr),0},
- {BLT_SWITCH_INT_NNEG, "-quality", "int",
- Blt_Offset(JpgExportSwitches, quality), 0},
- {BLT_SWITCH_INT_NNEG, "-smooth", "int",
- Blt_Offset(JpgExportSwitches, smoothing),0},
- {BLT_SWITCH_BITMASK, "-progressive", "",
- Blt_Offset(JpgExportSwitches, flags), 0, PIC_PROGRESSIVE},
- {BLT_SWITCH_INT_NNEG, "-index", "int",
- Blt_Offset(JpgExportSwitches, index), 0},
- {BLT_SWITCH_END}
-};
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(JpgImportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_INT, "-fast", "int",
- Blt_Offset(JpgImportSwitches, fast), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(JpgImportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_END}
-};
-
-#define JPG_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */
-
-typedef struct {
- struct jpeg_source_mgr pub; /* public fields */
-
- Blt_DBuffer dBuffer; /* Collects the converted data. */
-} JpgReader;
-
-typedef struct {
- struct jpeg_destination_mgr pub; /* public fields */
- Blt_DBuffer dBuffer; /* Target stream */
- JOCTET *bytes; /* start of buffer */
-} JpgWriter;
-
-typedef struct {
- struct jpeg_error_mgr pub; /* "public" fields */
- jmp_buf jmpbuf;
- Tcl_DString dString;
-} JpgErrorHandler;
-
-DLLEXPORT extern Tcl_AppInitProc Blt_PictureJpgInit;
-extern const char *Blt_Itoa(int);
-
-static void
-JpgErrorProc(j_common_ptr commPtr)
-{
- JpgErrorHandler *errorPtr = (JpgErrorHandler *)commPtr->err;
-
- (*errorPtr->pub.output_message) (commPtr);
- longjmp(errorPtr->jmpbuf, 1);
-}
-
-static void
-JpgMessageProc(j_common_ptr commPtr)
-{
- JpgErrorHandler *errorPtr = (JpgErrorHandler *)commPtr->err;
- char mesg[JMSG_LENGTH_MAX];
-
- /* Create the message and append it into the dynamic string. */
- (*errorPtr->pub.format_message) (commPtr, mesg);
- Tcl_DStringAppend(&errorPtr->dString, " ", -1);
- Tcl_DStringAppend(&errorPtr->dString, mesg, -1);
-}
-
-static void
-JpgInitSource(j_decompress_ptr commPtr)
-{
- JpgReader *readerPtr = (JpgReader *)commPtr->src;
-
- readerPtr->pub.next_input_byte = Blt_DBuffer_Bytes(readerPtr->dBuffer);
- readerPtr->pub.bytes_in_buffer = Blt_DBuffer_Length(readerPtr->dBuffer);
-}
-
-static boolean
-JpgFillInputBuffer(j_decompress_ptr commPtr)
-{
- JpgReader *readerPtr = (JpgReader *)commPtr->src;
- static unsigned char eoi[2] = { 0xFF, JPEG_EOI };
-
- /* Insert a fake EOI marker */
- readerPtr->pub.next_input_byte = eoi;
- readerPtr->pub.bytes_in_buffer = 2;
- return TRUE;
-}
-
-static void
-JpgSkipInputData(j_decompress_ptr commPtr, long nBytes)
-{
- if (nBytes > 0) {
- JpgReader *readerPtr = (JpgReader *)commPtr->src;
-
- assert((readerPtr->pub.next_input_byte + nBytes) <
- (Blt_DBuffer_Bytes(readerPtr->dBuffer) +
- Blt_DBuffer_Length(readerPtr->dBuffer)));
- readerPtr->pub.next_input_byte += (size_t)nBytes;
- readerPtr->pub.bytes_in_buffer -= (size_t)nBytes;
- }
-}
-
-static void
-JpgTermSource (j_decompress_ptr commPtr)
-{
- /* Nothing to do. */
-}
-
-static void
-JpgSetSourceFromBuffer(j_decompress_ptr commPtr, Blt_DBuffer buffer)
-{
- JpgReader *readerPtr;
-
- /* The source object is made permanent so that a series of JPEG images can
- * be read from the same file by calling jpeg_stdio_src only before the
- * first one. (If we discarded the buffer at the end of one image, we'd
- * likely lose the start of the next one.) This makes it unsafe to use
- * this manager and a different source manager serially with the same JPEG
- * object. Caveat programmer.
- */
- if (commPtr->src == NULL) { /* first time for this JPEG object? */
- commPtr->src = (struct jpeg_source_mgr *)
- (*commPtr->mem->alloc_small) ((j_common_ptr)commPtr,
- JPOOL_PERMANENT, sizeof(JpgReader));
- readerPtr = (JpgReader *)commPtr->src;
- }
- readerPtr = (JpgReader *)commPtr->src;
- readerPtr->dBuffer = buffer;
- readerPtr->pub.init_source = JpgInitSource;
- readerPtr->pub.fill_input_buffer = JpgFillInputBuffer;
- readerPtr->pub.skip_input_data = JpgSkipInputData;
- /* use default method */
- readerPtr->pub.resync_to_restart = jpeg_resync_to_restart;
- readerPtr->pub.term_source = JpgTermSource;
-}
-
-static void
-JpgInitDestination (j_compress_ptr commPtr)
-{
- JpgWriter *writerPtr = (JpgWriter *)commPtr->dest;
-
- writerPtr->bytes = (JOCTET *)(*commPtr->mem->alloc_small)
- ((j_common_ptr) commPtr, JPOOL_IMAGE, JPG_BUF_SIZE * sizeof(JOCTET));
- writerPtr->pub.next_output_byte = writerPtr->bytes;
- writerPtr->pub.free_in_buffer = JPG_BUF_SIZE;
-}
-
-static boolean
-JpgEmptyOutputBuffer(j_compress_ptr commPtr)
-{
- JpgWriter *writerPtr = (JpgWriter *)commPtr->dest;
-
- if (!Blt_DBuffer_AppendData(writerPtr->dBuffer, writerPtr->bytes,
- JPG_BUF_SIZE)) {
- ERREXIT(commPtr, 10);
- }
- writerPtr->pub.next_output_byte = writerPtr->bytes;
- writerPtr->pub.free_in_buffer = JPG_BUF_SIZE;
- return TRUE;
-}
-
-static void
-JpgTermDestination (j_compress_ptr commPtr)
-{
- JpgWriter *writerPtr = (JpgWriter *)commPtr->dest;
- size_t nBytes = JPG_BUF_SIZE - writerPtr->pub.free_in_buffer;
-
- /* Write any data remaining in the buffer */
- if (nBytes > 0) {
- if (!Blt_DBuffer_AppendData(writerPtr->dBuffer, writerPtr->bytes,
- nBytes)) {
- ERREXIT(commPtr, 10);
- }
- }
-}
-
-static void
-JpgSetDestinationToBuffer(j_compress_ptr commPtr, Blt_DBuffer buffer)
-{
- JpgWriter *writerPtr;
-
- /* The destination object is made permanent so that multiple JPEG images
- * can be written to the same file without re-executing jpeg_stdio_dest.
- * This makes it dangerous to use this manager and a different destination
- * manager serially with the same JPEG object, because their private
- * object sizes may be different. Caveat programmer.
- */
- if (commPtr->dest == NULL) { /* first time for this JPEG object? */
- commPtr->dest = (struct jpeg_destination_mgr *)
- (*commPtr->mem->alloc_small) ((j_common_ptr)commPtr,
- JPOOL_PERMANENT, sizeof(JpgWriter));
- }
- writerPtr = (JpgWriter *)commPtr->dest;
- writerPtr->pub.init_destination = JpgInitDestination;
- writerPtr->pub.empty_output_buffer = JpgEmptyOutputBuffer;
- writerPtr->pub.term_destination = JpgTermDestination;
- writerPtr->dBuffer = buffer;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsJpg --
- *
- * Attempts to parse a JPG file header.
- *
- * Results:
- * Returns 1 is the header is JPG and 0 otherwise. Note that the
- * validity of the header contents is not checked here. That's done in
- * Blt_JpgToPicture.
- *
- *---------------------------------------------------------------------------
- */
-static int
-IsJpg(Blt_DBuffer buffer)
-{
- JpgErrorHandler error;
- struct jpeg_decompress_struct cinfo;
- int bool;
-
- /* Step 1: allocate and initialize JPEG decompression object */
-
- /* We set up the normal JPEG error routines, then override error_exit. */
- cinfo.dct_method = JDCT_IFAST;
- cinfo.err = jpeg_std_error(&error.pub);
- error.pub.error_exit = JpgErrorProc;
- error.pub.output_message = JpgMessageProc;
-
- /* Initialize possible error message */
- bool = FALSE;
- Tcl_DStringInit(&error.dString);
- if (setjmp(error.jmpbuf)) {
- goto done;
- }
- jpeg_create_decompress(&cinfo);
- JpgSetSourceFromBuffer(&cinfo, buffer);
- bool = (jpeg_read_header(&cinfo, TRUE) == JPEG_HEADER_OK);
- done:
- jpeg_destroy_decompress(&cinfo);
- Tcl_DStringFree(&error.dString);
- return bool;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * JpgToPicture --
- *
- * Reads a JPEG data buffer and converts it into a picture.
- *
- * Results:
- * The picture is returned. If an error occured, such as the
- * designated file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-JpgToPicture(
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- const char *fileName, /* Name of file used to fill the dynamic
- * buffer. */
- Blt_DBuffer buffer, /* Contents of the above file. */
- JpgImportSwitches *switchesPtr)
-{
- Blt_Chain chain;
- JSAMPLE **rows;
- JpgErrorHandler error;
- Picture *destPtr;
- int samplesPerRow;
- struct jpeg_decompress_struct cinfo;
- unsigned int width, height;
-
- destPtr = NULL;
-
- /* Step 1: allocate and initialize JPEG decompression object */
-
- /* We set up the normal JPEG error routines, then override error_exit. */
- cinfo.dct_method = (switchesPtr->fast) ? JDCT_IFAST : JDCT_ISLOW;
- cinfo.err = jpeg_std_error(&error.pub);
- error.pub.error_exit = JpgErrorProc;
- error.pub.output_message = JpgMessageProc;
-
- /* Initialize possible error message */
- Tcl_DStringInit(&error.dString);
- Tcl_DStringAppend(&error.dString, "error reading \"", -1);
- Tcl_DStringAppend(&error.dString, fileName, -1);
- Tcl_DStringAppend(&error.dString, "\": ", -1);
-
- if (setjmp(error.jmpbuf)) {
- jpeg_destroy_decompress(&cinfo);
- Tcl_DStringResult(interp, &error.dString);
- return NULL;
- }
- jpeg_create_decompress(&cinfo);
- JpgSetSourceFromBuffer(&cinfo, buffer);
-
- jpeg_read_header(&cinfo, TRUE); /* Step 3: read file parameters */
-
- jpeg_start_decompress(&cinfo); /* Step 5: Start decompressor */
- width = cinfo.output_width;
- height = cinfo.output_height;
- if ((width < 1) || (height < 1)) {
- Tcl_AppendResult(interp, "error reading \"", fileName,
- "\": bad JPEG image size", (char *)NULL);
- return NULL;
- }
- /* JSAMPLEs per row in output buffer */
- samplesPerRow = width * cinfo.output_components;
-
- /* Make a one-row-high sample array that will go away when done with
- * image */
- rows = (*cinfo.mem->alloc_sarray)((j_common_ptr)&cinfo, JPOOL_IMAGE,
- samplesPerRow, 1);
- destPtr = Blt_CreatePicture(width, height);
- if (cinfo.output_components == 1) {
- Blt_Pixel *destRowPtr;
-
- destRowPtr = destPtr->bits;
- while (cinfo.output_scanline < height) {
- JSAMPLE *bp;
- Blt_Pixel *dp;
- int i;
-
- dp = destRowPtr;
- jpeg_read_scanlines(&cinfo, rows, 1);
- bp = rows[0];
- for (i = 0; i < (int)width; i++) {
- dp->Red = dp->Green = dp->Blue = *bp++;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- } else {
- Blt_Pixel *destRowPtr;
-
- destRowPtr = destPtr->bits;
- while (cinfo.output_scanline < height) {
- JSAMPLE *bp;
- Blt_Pixel *dp;
- int i;
-
- dp = destRowPtr;
- jpeg_read_scanlines(&cinfo, rows, 1);
- bp = rows[0];
- for (i = 0; i < (int)width; i++) {
- dp->Red = *bp++;
- dp->Green = *bp++;
- dp->Blue = *bp++;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- destPtr->flags |= BLT_PIC_COLOR;
- }
- jpeg_finish_decompress(&cinfo);
- jpeg_destroy_decompress(&cinfo);
-
- if (error.pub.num_warnings > 0) {
- Tcl_SetErrorCode(interp, "PICTURE", "JPG_READ_WARNINGS",
- Tcl_DStringValue(&error.dString), (char *)NULL);
- } else {
- Tcl_SetErrorCode(interp, "NONE", (char *)NULL);
- }
- Tcl_DStringFree(&error.dString);
- chain = Blt_Chain_Create();
- Blt_Chain_Append(chain, destPtr);
- return chain;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictureToJpg --
- *
- * Writes a JPEG format image to the provided dynamic buffer.
- *
- * Results:
- * A standard TCL result. If an error occured, TCL_ERROR is returned and
- * an error message will be place in the interpreter result. Otherwise,
- * the dynamic buffer will contain the binary output of the image.
- *
- * Side Effects:
- * Memory is allocated for the dynamic buffer.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PictureToJpg(
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- Blt_Picture original, /* Picture source. */
- Blt_DBuffer buffer, /* Destination buffer to contain the JPEG
- * image. */
- JpgExportSwitches *switchesPtr)
-{
- JpgErrorHandler error;
- int result, nColors;
- struct jpeg_compress_struct cinfo;
- Picture *srcPtr;
-
- result = TCL_ERROR;
- srcPtr = original;
-
- /* Step 1: allocate and initialize JPEG compression object */
- cinfo.err = jpeg_std_error(&error.pub);
- error.pub.error_exit = JpgErrorProc;
- error.pub.output_message = JpgMessageProc;
-
- /* Initialize possible error message */
- Tcl_DStringInit(&error.dString);
- Tcl_DStringAppend(&error.dString, "error writing jpg: ", -1);
-
- if (setjmp(error.jmpbuf)) {
- /* Transfer the error message to the interpreter result. */
- Tcl_DStringResult(interp, &error.dString);
- goto bad;
- }
-
- /* Now we can initialize the JPEG compression object. */
- jpeg_create_compress(&cinfo);
-
- /* Step 2: specify data destination (eg, a file) */
-
- JpgSetDestinationToBuffer(&cinfo, buffer);
-
- /* Step 3: set parameters for compression */
-
- /* First we supply a description of the input image. Four fields of the
- * cinfo struct must be filled in:
- */
- cinfo.image_width = srcPtr->width;
- cinfo.image_height = srcPtr->height;
-
- if (!Blt_PictureIsOpaque(srcPtr)) {
- Blt_Picture background;
-
- /* Blend picture with solid color background. */
- background = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- Blt_BlankPicture(background, &switchesPtr->bg);
- Blt_BlendPictures(background, srcPtr, 0, 0, srcPtr->width,
- srcPtr->height, 0, 0);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- srcPtr = background;
- }
- if (srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) {
- Blt_Picture unassoc;
- /*
- * The picture has an alpha burned into the components.
- * Create a temporary copy removing pre-multiplied alphas.
- */
- unassoc = Blt_ClonePicture(srcPtr);
- Blt_UnassociateColors(unassoc);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- srcPtr = unassoc;
- }
- nColors = Blt_QueryColors(srcPtr, (Blt_HashTable *)NULL);
- if (Blt_PictureIsColor(srcPtr)) {
- cinfo.input_components = 3; /* # of color components per pixel */
- cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
- } else {
- cinfo.input_components = 1; /* # of color components per pixel */
- cinfo.in_color_space = JCS_GRAYSCALE; /* colorspace of input image */
- }
- jpeg_set_defaults(&cinfo);
-
- /*
- * Now you can set any non-default parameters you wish to. Here we just
- * illustrate the use of quality (quantization table) scaling:
- */
-
- /* limit to baseline-JPEG values */
- jpeg_set_quality(&cinfo, switchesPtr->quality, TRUE);
- if (switchesPtr->flags & PIC_PROGRESSIVE) {
- jpeg_simple_progression(&cinfo);
- }
- if (switchesPtr->smoothing > 0) {
- cinfo.smoothing_factor = switchesPtr->smoothing;
- }
- /* Step 4: Start compressor */
-
- jpeg_start_compress(&cinfo, TRUE);
-
- /* Step 5: while (scan lines remain to be written) */
- /* jpeg_write_scanlines(...); */
- {
- int y;
- int row_stride;
- JSAMPLE *destRow;
- Blt_Pixel *srcRowPtr;
- JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
-
- /* JSAMPLEs per row in image_buffer */
- row_stride = srcPtr->width * cinfo.input_components;
- destRow = Blt_AssertMalloc(sizeof(JSAMPLE) * row_stride);
- srcRowPtr = srcPtr->bits;
- if (cinfo.input_components == 3) {
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
- JSAMPLE *dp;
-
- dp = destRow;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send;
- sp++) {
- dp[0] = sp->Red;
- dp[1] = sp->Green;
- dp[2] = sp->Blue;
- dp += 3;
- }
- row_pointer[0] = destRow;
- jpeg_write_scanlines(&cinfo, row_pointer, 1);
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- } else {
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
- JSAMPLE *dp;
-
- dp = destRow;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send;
- sp++) {
- *dp++ = sp->Red;
- }
- row_pointer[0] = destRow;
- jpeg_write_scanlines(&cinfo, row_pointer, 1);
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- }
- Blt_Free(destRow);
- }
- /* Step 6: Finish compression */
- jpeg_finish_compress(&cinfo);
- result = TCL_OK;
- bad:
- /* Step 7: release JPEG compression object */
- jpeg_destroy_compress(&cinfo);
-
- if (error.pub.num_warnings > 0) {
- Tcl_SetErrorCode(interp, "PICTURE", "JPG_WRITE_WARNINGS",
- Tcl_DStringValue(&error.dString), (char *)NULL);
- } else {
- Tcl_SetErrorCode(interp, "NONE", (char *)NULL);
- }
- Tcl_DStringFree(&error.dString);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- return result;
-}
-
-static Blt_Chain
-ReadJpg(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer)
-{
- JpgImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- return JpgToPicture(interp, fileName, dbuffer, &switches);
-}
-
-static Tcl_Obj *
-WriteJpg(Tcl_Interp *interp, Blt_Picture picture)
-{
- Tcl_Obj *objPtr;
- Blt_DBuffer dbuffer;
- JpgExportSwitches switches;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- switches.quality = 100;
- switches.smoothing = 0;
- switches.flags = 0; /* No progressive or compression. */
- switches.bg.u32 = 0xFFFFFFFF; /* white */
-
- objPtr = NULL;
- dbuffer = Blt_DBuffer_Create();
- if (PictureToJpg(interp, picture, dbuffer, &switches) == TCL_OK) {
- char *bytes;
-
- bytes = Blt_DBuffer_EncodeBase64(interp, dbuffer);
- if (bytes != NULL) {
- objPtr = Tcl_NewStringObj(bytes, -1);
- Blt_Free(bytes);
- }
- }
- Blt_DBuffer_Destroy(dbuffer);
- return objPtr;
-}
-
-static Blt_Chain
-ImportJpg(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv,
- const char **fileNamePtr)
-{
- Blt_DBuffer dbuffer;
- Blt_Chain chain;
- const char *string;
- JpgImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one import source: ",
- "use only one -file or -data flag.", (char *)NULL);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- dbuffer = Blt_DBuffer_Create();
- chain = NULL;
- if (switches.dataObjPtr != NULL) {
- unsigned char *bytes;
- int nBytes;
-
- bytes = Tcl_GetByteArrayFromObj(switches.dataObjPtr, &nBytes);
- if (Blt_IsBase64(bytes, nBytes)) {
- if (Blt_DBuffer_DecodeBase64(interp, string, nBytes, dbuffer)
- != TCL_OK) {
- goto error;
- }
- } else {
- Blt_DBuffer_AppendData(dbuffer, bytes, nBytes);
- }
- string = "data buffer";
- *fileNamePtr = NULL;
- } else {
- string = Tcl_GetString(switches.fileObjPtr);
- *fileNamePtr = string;
- if (Blt_DBuffer_SaveFile(interp, string, dbuffer) != TCL_OK) {
- goto error;
- }
- }
- chain = JpgToPicture(interp, string, dbuffer, &switches);
- error:
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(dbuffer);
- return chain;
-}
-
-static int
-ExportJpg(Tcl_Interp *interp, unsigned int index, Blt_Chain chain, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_DBuffer dbuffer;
- Blt_Picture picture;
- JpgExportSwitches switches;
- int result;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- switches.quality = 100;
- switches.smoothing = 0;
- switches.flags = 0; /* No progressive or compression. */
- switches.bg.u32 = 0xFFFFFFFF; /* white */
- switches.index = index;
-
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one export destination: ",
- "use only one -file or -data flag.", (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- picture = Blt_GetNthPicture(chain, switches.index);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "no picture at index ",
- Blt_Itoa(switches.index), (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- if (switches.quality == 0) {
- switches.quality = 100; /* Default quality setting. */
- } else if (switches.quality > 100) {
- switches.quality = 100; /* Maximum quality setting. */
- }
- if (switches.smoothing > 100) {
- switches.smoothing = 100; /* Maximum smoothing setting. */
- }
-
- dbuffer = Blt_DBuffer_Create();
- result = PictureToJpg(interp, picture, dbuffer, &switches);
- if (result != TCL_OK) {
- Tcl_AppendResult(interp, "can't convert \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- goto error;
- }
-
- if (switches.fileObjPtr != NULL) {
- const char *fileName;
-
- /* Write the image into the designated file. */
- fileName = Tcl_GetString(switches.fileObjPtr);
- result = Blt_DBuffer_SaveFile(interp, fileName, dbuffer);
- } else if (switches.dataObjPtr != NULL) {
- Tcl_Obj *objPtr;
-
- /* Write the image into the designated TCL variable. */
- objPtr = Tcl_ObjSetVar2(interp, switches.dataObjPtr, NULL,
- Blt_DBuffer_ByteArrayObj(dbuffer), 0);
- result = (objPtr == NULL) ? TCL_ERROR : TCL_OK;
- } else {
- char *string;
-
- /* Return the image as a base64 string in the interpreter result. */
- result = TCL_ERROR;
- string = Blt_DBuffer_EncodeBase64(interp, dbuffer);
- if (string != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(string, -1);
- Blt_Free(string);
- Tcl_SetObjResult(interp, objPtr);
- result = TCL_OK;
- }
- }
- error:
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(dbuffer);
- return result;
-}
-
-int
-Blt_PictureJpgInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_core", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgRequire(interp, "blt_extra", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_picture_jpg", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_PictureRegisterFormat(interp,
- "jpg", /* Name of format. */
- IsJpg, /* Format discovery procedure. */
- ReadJpg, /* Read format procedure. */
- WriteJpg, /* Write format procedure. */
- ImportJpg, /* Import format procedure. */
- ExportJpg); /* Export format procedure. */
-}
-
-#endif /* HAVE_LIBJPG */
-
diff --git a/blt3.0.1/src/bltPictMmx.c b/blt3.0.1/src/bltPictMmx.c
deleted file mode 100644
index f3140c2..0000000
--- a/blt3.0.1/src/bltPictMmx.c
+++ /dev/null
@@ -1,2257 +0,0 @@
-
-
-/*
- * bltPictMMX.c --
- *
- * This module implements image processing procedures for the BLT toolkit.
- *
- * Copyright 1997-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltPicture.h"
-#include "bltPictInt.h"
-
-#ifdef HAVE_X86_ASM
-
-static Blt_ApplyPictureToPictureProc ApplyPictureToPicture;
-static Blt_ApplyScalarToPictureProc ApplyScalarToPicture;
-#ifdef notdef
-static Blt_ApplyPictureToPictureWithMaskProc ApplyPictureToPictureWithMask;
-static Blt_ApplyScalarToPictureWithMaskProc ApplyScalarToPictureWithMask;
-#endif
-static Blt_TentHorizontallyProc TentHorizontally;
-static Blt_TentVerticallyProc TentVertically;
-static Blt_ZoomHorizontallyProc ZoomHorizontally;
-static Blt_ZoomVerticallyProc ZoomVertically;
-static Blt_BlendPicturesProc BlendPictures;
-static Blt_SelectPixelsProc SelectPixels;
-static Blt_AssociateColorsProc AssociateColors;
-static Blt_UnassociateColorsProc UnassociateColors;
-static Blt_FadePictureProc FadePicture;
-static Blt_CopyPictureBitsProc CopyPictureBits;
-
-static Blt_PictureProcs mmxPictureProcs = {
- ApplyPictureToPicture,
- ApplyScalarToPicture,
- NULL, /* ApplyPictureToPictureWithMask, */
- NULL, /* ApplyScalarToPictureWithMask, */
- TentHorizontally,
- TentVertically,
- ZoomHorizontally,
- ZoomVertically,
- BlendPictures,
- SelectPixels,
- AssociateColors,
- UnassociateColors,
- NULL, /*FadePicture*, */
- CopyPictureBits
-};
-
-static void
-SelectPixels(
- Pict *destPtr,
- Pict *srcPtr,
- Blt_Pixel *lowerPtr,
- Blt_Pixel *upperPtr)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
-
- if (srcPtr != destPtr) {
- Blt_ResizePicture(destPtr, srcPtr->width, srcPtr->height);
- }
-
- asm volatile (
- /* Put lower and upper pixels in registers. */
- "movd %0, %%mm4 # mm4 = L\n\t"
- "movd %1, %%mm5 # mm5 = H\n\t"
- "pxor %%mm6, %%mm6 # mm6 = 0\n\t"
- "punpckldq %%mm4, %%mm4 # mm4 = L,L\n\t"
- "punpckldq %%mm5, %%mm5 # mm5 = H,H\n\t" :
- /* output registers */ :
- /* input registers */
- "r" (lowerPtr->u32), "r" (upperPtr->u32));
-
- destRowPtr = destPtr->bits, srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *dp, *sp, *send;
-
- dp = destRowPtr;
- for(sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp += 2) {
- asm volatile (
- /* Compare two pixels at a time */
- "movq (%1), %%mm3 # mm3 = S1,S2\n\t"
- "movq %%mm4, %%mm0 # mm0 = L,L\n\t"
-
- /* We want to test (S >= L) && (S <= H). Since the operands
- * are all unsigned, pcmp* ops are out. Instead use
- * saturated, unsigned subtraction. ((L psub S) == 0) is the
- * same as (S >= L) */
-
- "psubusb %%mm3, %%mm0 # mm0 = L - S\n\t"
- "movq %%mm3, %%mm1 # mm1 = S\n\t"
- "psubusb %%mm5, %%mm1 # mm1 = S - H\n\t"
-
- /* "or" the two results and compare 32-bit values to 0
- * (inverting the logic). */
-
- "por %%mm1, %%mm0 # mm0 = (S >= L)|(H >= S)\n\t"
- "pcmpeqd %%mm6, %%mm0 # invert logic\n\t"
- "movq %%mm0, (%0) # dp = new value\n" :
- /* output registers */
- "+r" (dp) :
- /* input registers */
- "r" (sp));
- dp += 2;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- asm volatile ("emms");
- destPtr->flags &= ~BLT_PIC_BLEND;
- destPtr->flags |= BLT_PIC_MASK;
-}
-
-static void
-AddPictureToPicture(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm7, %mm7 # mm5 = -1 \n");
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((y * srcPtr->pixelsPerRow) + x);
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp += 2, sp += 2) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "paddusb (%1), %%mm0\n\t"
- "movq %%mm0, (%0)" :
- /* output registers */
- "+r" (dp) :
- /* input registers */
- "r" (sp));
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-SubPictureToPicture(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm7, %mm7 # mm5 = -1 \n");
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((y * srcPtr->pixelsPerRow) + x);
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp += 2, sp += 2) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "psubusb (%1), %%mm0\n\t"
- "movq %%mm0, (%0)" :
- /* output registers */
- "+r" (dp) :
- /* input registers */
- "r" (sp));
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-RSubPictureToPicture(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm7, %mm7 # mm5 = -1 \n");
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((y * srcPtr->pixelsPerRow) + x);
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp += 2, sp += 2) {
- asm volatile (
- "movq (%1), %%mm1\n\t"
- "psubusb (%0), %%mm1\n\t"
- "movq %%mm1, (%0)" :
- /* output registers */
- "+r" (dp) :
- /* input registers */
- "r" (sp));
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-AndPictureToPicture(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm7, %mm7 # mm5 = -1 \n");
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((y * srcPtr->pixelsPerRow) + x);
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp += 2, sp += 2) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "pand (%1), %%mm0\n\t"
- "movq %%mm0, (%0)" :
- /* output registers */
- "+r" (dp) :
- /* input registers */
- "r" (sp));
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-OrPictureToPicture(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm7, %mm7 # mm5 = -1 \n");
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((y * srcPtr->pixelsPerRow) + x);
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp += 2, sp += 2) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "por (%1), %%mm0\n\t"
- "movq %%mm0, (%0)" :
- /* output registers */
- "+r" (dp) :
- /* input registers */
- "r" (sp));
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-NandPictureToPicture(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm7, %mm7 # mm5 = -1 \n");
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((y * srcPtr->pixelsPerRow) + x);
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp += 2, sp += 2) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "pand (%1), %%mm0\n\t"
- "pxor %%mm7, %%mm0\n\t"
- "movq %%mm0, (%0)" :
- /* output registers */
- "+r" (dp) :
- /* input registers */
- "r" (sp));
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-NorPictureToPicture(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm7, %mm7 # mm5 = -1 \n");
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((y * srcPtr->pixelsPerRow) + x);
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp += 2, sp += 2) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "por (%1), %%mm0\n\t"
- "pxor %%mm7, %%mm0\n\t"
- "movq %%mm0, (%0)"
- /* output registers */
- : "+r" (dp)
- /* input registers */
- : "r" (sp));
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-XorPictureToPicture(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm7, %mm7 # mm5 = -1 \n");
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((y * srcPtr->pixelsPerRow) + x);
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp += 2, sp += 2) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "pxor (%1), %%mm0\n\t"
- "movq %%mm0, (%0)"
- /* output registers */
- : "+r" (dp)
- /* input registers */
- : "r" (sp));
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-MinPictureToPicture(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm7, %mm7 # mm5 = -1 \n");
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((y * srcPtr->pixelsPerRow) + x);
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp += 2, sp += 2) {
- asm volatile (
- "movq (%0), %%mm0 # mm0 = A\n\t"
- "movq (%1), %%mm1 # mm1 = B\n\t"
- "movq %%mm0, %%mm2 # mm2 = A\n\t"
- "psubusb %%mm1, %%mm2 # mm2 = A - B\n\t"
- "pcmpeqb %%mm6, %%mm2 # mm2 = 0s A>B 1s A<=B\n\t"
- "pand %%mm2, %%mm0 # mm2 = mask & A\n\t"
- "pxor %%mm7, %%mm2 # mm2 = ~mask\n\t"
- "pand %%mm2, %%mm1 # mm0 = ~mask & B\n\t"
- "por %%mm1, %%mm0 # mm0 = R1 | R2\n\t"
- "movq %%mm0, (%0)"
- /* output registers */
- : "+r" (dp)
- /* input registers */
- : "r" (sp));
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-MaxPictureToPicture(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm7, %mm7 # mm5 = -1 \n");
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((y * srcPtr->pixelsPerRow) + x);
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp += 2, sp += 2) {
- asm volatile (
- "movq (%0), %%mm0 # mm0 = A\n\t"
- "movq (%1), %%mm1 # mm1 = B\n\t"
- "movq %%mm0, %%mm2 # mm2 = A\n\t"
- "psubusb %%mm1, %%mm2 # mm2 = A - B\n\t"
- "pcmpeqb %%mm6, %%mm2 # mm2 = 0s A>B 1s A<=B\n\t"
- "pand %%mm2, %%mm1 # mm1 = mask & B\n\t"
- "pxor %%mm7, %%mm2 # mm2 = ~mask\n\t"
- "pand %%mm2, %%mm0 # mm0 = ~mask & A\n\t"
- "por %%mm1, %%mm0 # mm3 = R1 | R2\n\t"
- "movq %%mm0, (%0)"
- /* output registers */
- : "+r" (dp)
- /* input registers */
- : "r" (sp));
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-ApplyPictureToPicture(
- Pict *destPtr,
- Pict *srcPtr,
- int x, int y, int w, int h, int dx, int dy,
- Blt_PictureArithOps op)
-{
- if ((x + w) > srcPtr->width) {
- w -= srcPtr->width - x;
- }
- if ((y + h) > srcPtr->height) {
- h -= srcPtr->height - y;
- }
- if ((dx + w) > destPtr->width) {
- w -= destPtr->width - dx;
- }
- if ((dy + h) > destPtr->height) {
- h -= destPtr->height - dy;
- }
- switch(op) {
- case PIC_ARITH_ADD:
- AddPictureToPicture(destPtr, srcPtr, x, y, w, h, dx, dy);
- break;
- case PIC_ARITH_SUB:
- SubPictureToPicture(destPtr, srcPtr, x, y, w, h, dx, dy);
- break;
- case PIC_ARITH_RSUB:
- RSubPictureToPicture(destPtr, srcPtr, x, y, w, h, dx, dy);
- break;
- case PIC_ARITH_AND:
- AndPictureToPicture(destPtr, srcPtr, x, y, w, h, dx, dy);
- break;
- case PIC_ARITH_OR:
- OrPictureToPicture(destPtr, srcPtr, x, y, w, h, dx, dy);
- break;
- case PIC_ARITH_NAND:
- NandPictureToPicture(destPtr, srcPtr, x, y, w, h, dx, dy);
- break;
- case PIC_ARITH_NOR:
- NorPictureToPicture(destPtr, srcPtr, x, y, w, h, dx, dy);
- break;
- case PIC_ARITH_XOR:
- XorPictureToPicture(destPtr, srcPtr, x, y, w, h, dx, dy);
- break;
- case PIC_ARITH_MIN:
- MinPictureToPicture(destPtr, srcPtr, x, y, w, h, dx, dy);
- break;
- case PIC_ARITH_MAX:
- MaxPictureToPicture(destPtr, srcPtr, x, y, w, h, dx, dy);
- break;
- }
-}
-
-
-static void
-ApplyScalarToPicture(
- Pict *srcPtr,
- Blt_Pixel *colorPtr,
- Blt_PictureArithOps op)
-{
- Blt_Pixel *srcRowPtr;
- int y;
-
- /*
- * mm7 = -1
- * mm6 = 0x0
- * mm4 = scalar,scalar
- */
- asm volatile (
- /* Generate constants needed below. */
- "pxor %%mm6, %%mm6 # mm6 = 0\n\t"
- "pcmpeqw %%mm7, %%mm7 # mm5 = -1 \n\t"
- /* Put the scalar into hi/lo 32-bit words.*/
- "movd %0, %%mm4 # mm4 = scalar\n\t"
- "punpckldq %%mm4, %%mm4 # mm2 = S,S\n"
- /* output registers */
- :
- /* input registers */
- : "r" (colorPtr->u32));
-
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
-
- sp = srcRowPtr;
- send = sp + srcPtr->width;
- switch(op) {
- case PIC_ARITH_ADD:
- while (sp < send) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "paddusb %%mm4, %%mm0\n\t"
- "movq %%mm0, (%0)" :
- /* output registers */
- "+r" (sp));
- sp += 2;
- }
- break;
-
- case PIC_ARITH_SUB:
- while (sp < send) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "psubusb %%mm4, %%mm0\n\t"
- "movq %%mm0, (%0)" :
- /* output registers */
- "+r" (sp));
- sp += 2;
- }
- break;
-
- case PIC_ARITH_RSUB:
- while (sp < send) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "movq %%mm4, %%mm1\n\t"
- "psubusb %%mm0, %%mm1\n\t"
- "movq %%mm1, (%0)" :
- /* output registers */
- "+r" (sp));
- sp += 2;
- }
- break;
-
- case PIC_ARITH_AND:
- while (sp < send) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "pand %%mm4, %%mm0\n\t"
- "movq %%mm0, (%0)" :
- /* output registers */
- "+r" (sp));
- sp += 2;
- }
- break;
-
- case PIC_ARITH_OR:
- while (sp < send) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "por %%mm4, %%mm0\n\t"
- "movq %%mm0, (%0)" :
- /* output registers */
- "+r" (sp));
- sp += 2;
- }
- break;
-
- case PIC_ARITH_NAND:
- while (sp < send) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "pand %%mm4, %%mm0\n\t"
- "pxor %%mm7, %%mm0\n\t"
- "movq %%mm0, (%0)" :
- /* output registers */
- "+r" (sp));
- sp += 2;
- }
- break;
-
- case PIC_ARITH_NOR:
- while (sp < send) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "por %%mm4, %%mm0\n\t"
- "pxor %%mm7, %%mm0\n\t"
- "movq %%mm0, (%0)" :
- /* output registers */
- "+r" (sp));
- sp += 2;
- }
- break;
-
- case PIC_ARITH_XOR:
- while (sp < send) {
- asm volatile (
- "movq (%0), %%mm0\n\t"
- "pxor %%mm4, %%mm0\n\t"
- "movq %%mm0, (%0)" :
- /* output registers */
- "+r" (sp));
- sp += 2;
- }
- break;
-
- case PIC_ARITH_MIN:
- while (sp < send) {
- asm volatile (
- "movq (%0), %%mm0 # mm0 = Color\n\t"
- "movq %%mm0, %%mm1 # mm1 = Color\n\t"
- "psubusb %%mm4, %%mm1 # mm1 = C - S\n\t"
- "pcmpeqb %%mm6, %%mm1 # mm2 = mask: 0s C>S 1s C<=S\n\t"
- "pand %%mm1, %%mm0 # mm0 = mask & C\n\t"
- "pxor %%mm7, %%mm1 # mm1 = ~mask\n\t"
- "pand %%mm4, %%mm1 # mm1 = S & ~mask\n\t"
- "por %%mm1, %%mm0 # mm0 = (S&~mask)|(mask&C)\n\t"
- "movq %%mm0, (%0)"
- /* output registers */
- : "+r" (sp));
- sp += 2;
- }
- break;
-
- case PIC_ARITH_MAX:
- while (sp < send) {
- asm volatile (
- "movq (%0), %%mm0 # mm0 = Color\n\t"
- "movq %%mm4, %%mm1 # mm1 = Scalar\n\t"
- "psubusb %%mm0, %%mm1 # mm1 = S - C\n\t"
- "pcmpeqb %%mm6, %%mm1 # mm1 = mask: 0s S>C 1s S<=C\n\t"
- "pand %%mm1, %%mm0 # mm0 = mask & C\n\t"
- "pxor %%mm7, %%mm1 # mm1 = ~mask\n\t"
- "pand %%mm4, %%mm1 # mm1 = S & ~mask\n\t"
- "por %%mm1, %%mm0 # mm0 = (S&~mask)|(mask&C)\n\t"
- "movq %%mm0, (%0)"
- /* output registers */
- : "+r" (sp));
- sp += 2;
- }
- break;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-ZoomVertically(Pict *destPtr, Pict *srcPtr, ResampleFilter *filterPtr)
-{
- Sample *samples, *send;
- int x;
- int bytesPerSample; /* Size of sample. */
- long bytesPerRow;
-
- /* Pre-calculate filter contributions for each row. */
- bytesPerSample = Blt_ComputeWeights(srcPtr->height, destPtr->height,
- filterPtr, &samples);
- bytesPerRow = sizeof(Blt_Pixel) * srcPtr->pixelsPerRow;
- send = (Sample *)((char *)samples + (destPtr->height * bytesPerSample));
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm2, %mm2 # mm2 = -1 \n\t"
- "psubw %mm6, %mm2 # mm2 = 1,1,1,1\n\t"
- "psllw $4, %mm2 # mm2 = BIAS\n");
-
- /* Apply filter to each row. */
- for (x = 0; x < srcPtr->width; x++) {
- Blt_Pixel *dp, *srcColumnPtr;
- Sample *splPtr;
-
- srcColumnPtr = srcPtr->bits + x;
- dp = destPtr->bits + x;
- for (splPtr = samples; splPtr < send;
- splPtr = (Sample *)((char *)splPtr + bytesPerSample)) {
- Blt_Pixel *sp;
-
- sp = srcColumnPtr + (splPtr->start * srcPtr->pixelsPerRow);
- asm volatile (
- /* Clear the accumulator mm5. */
- "pxor %%mm5, %%mm5 # mm5 = 0\n\n"
- ".Lasm%=:\n\t"
- /* Load the weighting factor into mm1. */
- "movd (%1), %%mm1 # mm1 = 0,0,0,W\n\t"
- /* Load the source pixel into mm0. */
- "movd (%3), %%mm0 # mm0 = S\n\t"
- /* Unpack the weighting factor into mm1. */
- "punpcklwd %%mm1, %%mm1 # mm1 = 0,0,W,W\n\t"
- /* Unpack the pixel components into 16-bit words.*/
- "punpcklbw %%mm6, %%mm0 # mm0 = Sa,Sb,Sg,Sr\n\t"
- /* */
- "punpcklwd %%mm1, %%mm1 # mm1 = W,W,W,W\n\t"
- /* Scale the 8-bit components to 14 bits. (S * 257) >> 2 */
- "movq %%mm0, %%mm3 # mm3 = S8\n\t"
- "psllw $8, %%mm3 # mm3 = S8 * 256\n\t"
- "paddw %%mm3, %%mm0 # mm0 = S16\n\t"
- "psrlw $1, %%mm0 # mm0 = S15\n\t"
- /* Multiple each pixel component by the weight. Note that
- * the lower 16-bits of the product are truncated (bad)
- * creating round-off error in the sum. */
- "pmulhw %%mm1, %%mm0 # mm0 = S15 * W14\n\t"
- "add $4, %1 # wp++\n\t"
- "add %4, %3 # sp++\n\t"
- /* Accumulate upper 16-bit results of product in mm5. */
- "paddsw %%mm0, %%mm5 # mm5 = prod + mm5\n\t"
- /* Move the pointers to the next weight and pixel */
- "cmp %2, %1 # wend == wp\n\t"
- "jnz .Lasm%=\n\t"
- /* end loop */
- /* Add a rounding bias to the pixel sum */
- "paddw %%mm2, %%mm5 # mm5 = A13 + BIAS\n\t"
- /* Shift off fractional part */
- "psraw $5, %%mm5 # mm5 = A8\n\t"
- /* Pack 16-bit components into lower 4 bytes. */
- "packuswb %%mm5, %%mm5 # Pack 4 low-order bytes.\n\t"
- /* Save the word (pixel) in the destination. */
- "movd %%mm5,(%0) # dp = word\n"
- /* output registers */
- : "+r" (dp)
- /* input registers */
- : "r" (splPtr->weights),
- "r" (splPtr->wend),
- "r" (sp),
- "r" (bytesPerRow));
-#ifdef notdef
- if (dp->Alpha != 0xFF) {
- fprintf(stdout, "mmx v-alpha=0x%x\n", dp->Alpha);
- }
-#endif
- dp += destPtr->pixelsPerRow;
-
- }
- }
- asm volatile ("emms");
- /* Free the memory allocated for filter weights. */
- Blt_Free(samples);
-}
-
-static void
-ZoomHorizontally(
- Pict *destPtr,
- Pict *srcPtr,
- ResampleFilter *filterPtr)
-{
- Sample *samples, *send;
- int y;
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int bytesPerSample; /* Size of sample. */
-
- /* Pre-calculate filter contributions for each column. */
- bytesPerSample = Blt_ComputeWeights(srcPtr->width, destPtr->width,
- filterPtr, &samples);
- send = (Sample *)((char *)samples + (destPtr->width * bytesPerSample));
-
- /* Apply filter to each column. */
- srcRowPtr = srcPtr->bits;
- destRowPtr = destPtr->bits;
-
- asm volatile (
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pxor %mm3, %mm3 # mm3 = 0\n\t"
- "pcmpeqw %mm2, %mm2 # mm2 = -1\n\t"
- "psubw %mm3, %mm2 # mm2 = 1,1,1,1\n\t"
- "psllw $4, %mm2 # mm2 = BIAS\n");
-
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *dp;
- Sample *splPtr;
-
- dp = destRowPtr;
- for (splPtr = samples; splPtr < send;
- splPtr = (Sample *)((char *)splPtr + bytesPerSample)) {
-
- Blt_Pixel *sp;
- sp = srcRowPtr + splPtr->start;
- asm volatile (
- /* Clear the accumulator mm5. */
- "pxor %%mm5, %%mm5 # mm5 = 0\n\n"
- ".Lasm%=:\n\t"
- /* Load the weighting factor into mm1. */
- "movd (%1), %%mm1 # mm1 = W\n\t"
- /* Get the source RGBA pixel. */
- "movd (%3), %%mm0 # mm0 = sp\n\t"
- /* Unpack the weighting factor into mm1. */
- "punpcklwd %%mm1, %%mm1 # mm1 = 0,0,W,W\n\t"
- /* Unpack the pixel into mm0. */
- "punpcklbw %%mm6, %%mm0 # mm0 = Sa,Sr,Sg,Sb\n\t"
- /* */
- "punpcklwd %%mm1, %%mm1 # mm1 = W,W,W,W\n\t"
- /* Scale the 8-bit components to 14 bits: (S * 257) >> 2 */
- "movq %%mm0, %%mm3 # mm3 = S8\n\t"
- "psllw $8, %%mm3 # mm3 = S8 * 256\n\t"
- "paddw %%mm3, %%mm0 # mm0 = S16\n\t"
- "psrlw $1, %%mm0 # mm0 = S15\n\t"
- /* Multiple each pixel component by the weight. Note
- * that the lower 16-bits of the product are
- * truncated (bad) creating round-off error in the
- * sum. */
- "pmulhw %%mm1, %%mm0 # mm0 = S15 * W14\n\t"
- "add $4, %1 # wp++\n\t"
- "add $4, %3 # sp++\n\t"
- /* Add the 16-bit components to mm5. */
- "paddsw %%mm0, %%mm5 # mm5 = A13 + mm5\n\t"
- /* Move the pointers to the next weight and pixel */
- "cmp %2, %1 # wend == wp\n\t"
- "jnz .Lasm%=\n\t"
- /* end loop */
- /* Add a rounding bias to the pixel sum. */
- "paddw %%mm2, %%mm5 # mm5 = A13 + BIAS\n\t"
- /* Shift off fractional portion. */
- "psraw $5, %%mm5 # mm5 = A8\n\t"
- /* Pack 16-bit components into lower 4 bytes. */
- "packuswb %%mm5, %%mm5 # Pack A8 into low 4 bytes.\n\t"
- /* Store the word (pixel) in the destination. */
- "movd %%mm5,(%0) # dp = word\n"
- /* output registers */
- : "+r" (dp)
- /* input registers */
- : "r" (splPtr->weights),
- "r" (splPtr->wend),
- "r" (sp));
-#ifdef notdef
- if (dp->Alpha != 0xFF) {
- fprintf(stdout, "mmx h-alpha=0x%x\n", dp->Alpha);
- }
-#endif
- dp++;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- asm volatile ("emms");
- /* Free the memory allocated for horizontal filter weights. */
- Blt_Free(samples);
-}
-
-
-static void
-TentVertically(Pict *destPtr, Pict *srcPtr)
-{
- Blt_Pixel *srcColumnPtr, *destColumnPtr;
- int x;
- size_t nPixels;
-
- asm volatile (
- /* Establish constants used below. */
- "pxor %mm6, %mm6 # mm6 = 0\n");
-
- nPixels = srcPtr->height * srcPtr->pixelsPerRow;
- srcColumnPtr = srcPtr->bits;
- destColumnPtr = destPtr->bits;
- for (x = 0; x < srcPtr->width; x++) {
- Blt_Pixel *dp, *rp, *rend;
-
- /*
- * mm0 =
- * mm1 = unpacked center pixel
- * mm2 = unpacked left pixel
- * mm3 = unpacked right pixel
- * mm4 =
- * mm5 =
- * mm6 = 0
- * mm7 =
- */
- dp = destColumnPtr;
- rp = srcColumnPtr + srcPtr->pixelsPerRow;
- asm volatile (
- "movd (%2), %%mm1 # mm1 = cp\n\t"
- "movd (%1), %%mm3 # mm3 = rp\n\t"
- "punpcklbw %%mm6, %%mm1 # mm1 = S8\n\t"
- "movq %%mm1, %%mm2 # mm2 = lp = S8\n\t"
- "punpcklbw %%mm6, %%mm3 # mm3 = S8\n\t"
- "movq %%mm1, %%mm0 # mm0 = cp\n\t"
- "psllw $1, %%mm0 # mm0 = cp << 1\n\t"
- "paddw %%mm2, %%mm0 # mm0 = lp + (cp << 1)\n\t"
- "paddw %%mm3, %%mm0 # mm0 = lp + (cp << 1) + rp\n\t"
- "psraw $2, %%mm0 # mm0 = (lp + (cp << 1) + rp) >> 2\n\t"
- "packuswb %%mm0, %%mm0 # Pack into low 4 bytes.\n\t"
- "movd %%mm0,(%0) # dp = word\n\t"
- "movq %%mm3, %%mm1 # cp = rp\n" :
- /* output registers */
- "+r" (dp), "+r" (rp) :
- /* input registers */
- "r" (srcColumnPtr));
- dp += destPtr->pixelsPerRow;
- rp += srcPtr->pixelsPerRow;
-
- for (rend = srcColumnPtr + nPixels; rp < rend; /*empty*/) {
- asm volatile (
- "movd (%1), %%mm3 # mm3 = rp\n\t"
- "punpcklbw %%mm6, %%mm3 # mm3 = S8\n\t"
- "movq %%mm1, %%mm0 # mm0 = cp\n\t"
- "psllw $1, %%mm0 # mm0 = cp << 1\n\t"
- "paddw %%mm2, %%mm0 # mm0 = lp + (cp << 1)\n\t"
- "paddw %%mm3, %%mm0 # mm0 = lp + (cp << 1) + rp\n\t"
- "psraw $2, %%mm0 # mm0 = (lp + (cp<<1) + rp) >> 2\n\t"
- "packuswb %%mm0, %%mm0 # Pack into low 4 bytes.\n\t"
- "movd %%mm0,(%0) # dp = word\n\t"
- "movq %%mm1, %%mm2 # lp = cp\n\t"
- "movq %%mm3, %%mm1 # cp = rp\n"
- /* output registers */
- : "+r" (dp),
- "+r" (rp));
- dp += destPtr->pixelsPerRow;
- rp += srcPtr->pixelsPerRow;
- }
- asm volatile (
- "movq %%mm1, %%mm3 # rp = cp\n\t"
- "movq %%mm1, %%mm0 # mm0 = cp\n\t"
- "psllw $1, %%mm0 # mm0 = cp << 1\n\t"
- "paddw %%mm2, %%mm0 # mm0 = lp + (cp << 1)\n\t"
- "paddw %%mm3, %%mm0 # mm0 = lp + (cp << 1) + rp\n\t"
- "psraw $2, %%mm0 # mm0 = (lp + (cp << 1) + rp) >> 2\n\t"
- "packuswb %%mm0, %%mm0 # Pack into low 4 bytes.\n\t"
- "movd %%mm0,(%0) # dp = word\n"
- /* output registers */
- : "+r" (dp));
-
- srcColumnPtr++, destColumnPtr++;
- }
- asm volatile ("emms");
-}
-
-static void
-TentHorizontally(Pict *destPtr, Pict *srcPtr)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
-
- asm volatile (
- /* Establish constants used below. */
- "pxor %mm6, %mm6 # mm6 = 0\n");
-
- srcRowPtr = srcPtr->bits;
- destRowPtr = destPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *dp;
- Blt_Pixel *rp, *rend;
-
- /*
- * mm0 =
- * mm1 = unpacked center pixel
- * mm2 = unpacked left pixel
- * mm3 = unpacked right pixel
- * mm4 =
- * mm5 =
- * mm6 = 0
- * mm7 =
- */
- dp = destRowPtr;
- rp = srcRowPtr + 1;
- asm volatile (
- "movd (%2), %%mm1 # mm1 = cp\n\t"
- "movq %%mm1, %%mm2 # mm2 = lp\n\t"
- "movd (%1), %%mm3 # mm3 = rp\n\t"
- "punpcklbw %%mm6, %%mm1 # mm1 = S8\n\t"
- "punpcklbw %%mm6, %%mm2 # mm2 = S8\n\t"
- "punpcklbw %%mm6, %%mm3 # mm3 = S8\n\t"
- "movq %%mm1, %%mm0 # mm0 = cp\n\t"
- "psllw $1, %%mm0 # mm0 = cp << 1\n\t"
- "paddw %%mm2, %%mm0 # mm0 = lp + (cp << 1)\n\t"
- "paddw %%mm3, %%mm0 # mm0 = lp + (cp << 1) + rp\n\t"
- "psraw $2, %%mm0 # mm0 = (lp + (cp << 1) + rp) >> 2\n\t"
- "packuswb %%mm0, %%mm0 # Pack into low 4 bytes.\n\t"
- "movd %%mm0,(%0) # dp = word\n\t"
- "movq %%mm3, %%mm1 # cp = rp\n" :
- /* output registers */
- "+r" (dp), "+r" (rp) :
- /* input registers */
- "r" (srcRowPtr));
- dp++, rp++;
-
- for (rend = srcRowPtr + srcPtr->width; rp < rend; /*empty*/) {
- asm volatile (
- "movd (%1), %%mm3 # mm3 = rp\n\t"
- "punpcklbw %%mm6, %%mm3 # mm3 = S8\n\t"
- "movq %%mm1, %%mm0 # mm0 = cp\n\t"
- "psllw $1, %%mm0 # mm0 = cp << 1\n\t"
- "paddw %%mm2, %%mm0 # mm0 = lp + (cp << 1)\n\t"
- "paddw %%mm3, %%mm0 # mm0 = lp + (cp << 1) + rp\n\t"
- "psraw $2, %%mm0 # mm0 = (lp + (cp<<1) + rp) >> 2\n\t"
- "packuswb %%mm0, %%mm0 # Pack into low 4 bytes.\n\t"
- "movd %%mm0,(%0) # dp = word\n\t"
- "movq %%mm1, %%mm2 # lp = cp\n\t"
- "movq %%mm3, %%mm1 # cp = rp\n"
- /* output registers */
- : "+r" (dp),
- "+r" (rp));
- dp++, rp++;
- }
-
- asm volatile (
- "movq %%mm1, %%mm3 # rp = cp\n\t"
- "movq %%mm1, %%mm0 # mm0 = cp\n\t"
- "psllw $1, %%mm0 # mm0 = cp << 1\n\t"
- "paddw %%mm2, %%mm0 # mm0 = lp + (cp << 1)\n\t"
- "paddw %%mm3, %%mm0 # mm0 = lp + (cp << 1) + rp\n\t"
- "psraw $2, %%mm0 # mm0 = (lp + (cp << 1) + rp) >> 2\n\t"
- "packuswb %%mm0, %%mm0 # Pack into low 4 bytes.\n\t"
- "movd %%mm0,(%0) # dp = word\n"
- /* output registers */
- : "+r" (dp));
-
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-BlendPictures(
- Pict *destPtr, /* (in/out) Background picture. Composite
- * overwrites region in background. */
- Pict *srcPtr, /* Foreground picture. */
- int sx, int sy, /* Origin of foreground region in source. */
- int w, int h, /* Dimension of area to be blended. */
- int dx, int dy) /* Origin of background region in
- * destination. */
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
-
- if ((srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) == 0) {
- Blt_AssociateColors(srcPtr);
- }
- if ((destPtr->flags & BLT_PIC_ASSOCIATED_COLORS) == 0) {
- Blt_AssociateColors(destPtr);
- }
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((sy * srcPtr->pixelsPerRow) + sx);
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm5, %mm5 # mm5 = -1 \n\t"
- "psubw %mm6, %mm5 # mm5 = 1,1,1,1\n\t"
- "psllw $7, %mm5 # mm5 = ROUND = 128\n");
-
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *send, *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + w; sp < send; sp++, dp++) {
- /* Blend the foreground and background together. */
- if (sp->Alpha == 0xFF) {
- *dp = *sp;
- } else if (sp->Alpha != 0x00) {
- unsigned long beta;
-
- beta = sp->Alpha ^ 0xFF; /* beta = 1 - alpha */
-
- /*
- * Small wins:
- *
- * We can compute
- * dest = (fg * alpha) + (beta * bg);
- * for all RGBA components at once.
- *
- * Packing unsigned with saturation performs the
- * necessary clamping without the branch misprediction
- * penalty.
- *
- * FIXME:
- * Check if it's faster to do the blend calcution
- * all the time (even when alpha is 0 or
- * 255). There's a good probability that the
- * majority of pixels are opaque (interior) or
- * completely transparent (exterior). Only the
- * edge pixels would require blending.
- */
- asm volatile (
- /*
- * mm0 = dp
- * mm1 = sp
- * mm2 = beta = 1 - alpha
- * mm3 = temp
- * mm4 =
- * mm5 = ROUND = 128,128,128,128
- * mm6 = 0
- * mm7 =
- */
- "movd (%0), %%mm0 # mm0 = dp\n\t"
- "movd (%1), %%mm1 # mm1 = sp\n\t"
- "movd %2, %%mm2 # mm2 = beta\n\t"
- "punpcklbw %%mm6, %%mm0 # mm0 = Da,Dr,Dg,Db\n\t"
- "punpcklwd %%mm2, %%mm2 # mm2 = 0,0,B,B\n\t"
- "punpcklbw %%mm6, %%mm1 # mm1 = Sa,Sr,Sg,Sb\n\t"
- "punpcklwd %%mm2, %%mm2 # mm2 = B,B,B,B\n\t"
- "pmullw %%mm0, %%mm2 # mm2 = D*B\n\t"
- "paddw %%mm5, %%mm2 # mm2 = (D*B)+ROUND\n\t"
- "movq %%mm2, %%mm3 # mm3 = P16\n\t"
- "psrlw $8, %%mm3 # mm3 = P16 / 256\n\t"
- "paddw %%mm2, %%mm3 # mm3 = (P16 / 256) + P16\n\t"
- "psrlw $8, %%mm3 # mm3 = P8 ~= P16 / 257\n\t"
- "paddw %%mm1, %%mm3 # mm3 = S + P\n\t"
- "packuswb %%mm3, %%mm3 # Pack 4 low bytes.\n\t"
- "movd %%mm3, (%0) # *dp = word\n"
- : "+r" (dp)
- : "r" (sp),
- "r" (beta));
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- asm volatile ("emms");
-}
-
-static void
-FadePicture(
- Pict *destPtr,
- Pict *srcPtr,
- int sx, int sy,
- int w, int h,
- int dx, int dy,
- int alpha)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int beta;
-
- beta = alpha ^ 0xFF;
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((sy * srcPtr->pixelsPerRow) + sx);
- if (alpha == 0xFF) {
- int y;
-
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp;
- int x;
-
- sp = srcRowPtr, dp = destRowPtr;
- for (x = 0; x < w; x++) {
- *dp++ = *sp++;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- } else if (alpha != 0x00) {
- int y;
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm5, %mm5 # mm5 = -1 \n\t"
- "psubw %mm6, %mm5 # mm5 = 1,1,1,1\n\t"
- "psllw $7, %mm5 # mm5 = BIAS = 128\n");
-
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *send, *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + w; sp < send; sp++, dp++) {
- asm volatile (
- /*
- * mm0 = dp
- * mm1 = sp
- * mm2 = beta = 1 - alpha
- * mm3 = temp
- * mm4 =
- * mm5 = ROUND = 128,128,128,128
- * mm6 = 0
- * mm7 =
- */
- "movd (%0), %%mm0 # mm0 = dp\n\t"
- "movd (%1), %%mm1 # mm1 = sp\n\t"
- "movd %2, %%mm2 # mm2 = beta\n\t"
- "punpcklbw %%mm6, %%mm0 # mm0 = Da,Dr,Dg,Db\n\t"
- "punpcklbw %%mm6, %%mm1 # mm1 = Sa,Sr,Sg,Sb\n\t"
- "punpcklwd %%mm2, %%mm2 # mm2 = 0,0,beta,beta\n\t"
- "punpcklwd %%mm2, %%mm2 # mm2 = beta,beta,beta,beta\n\t"
- "pmullw %%mm0, %%mm2 # mm2 = prod = D*beta\n\t"
- "paddw %%mm5, %%mm2 # mm2 = t = (D*beta)+ROUND\n\t"
- "movq %%mm2, %%mm3 # mm3 = t\n\t"
- "psrlw $8, %%mm3 # mm3 = t >> 8\n\t"
- "paddw %%mm2, %%mm3 # mm3 = t + (t>>8)\n\t"
- "psrlw $8, %%mm3 # mm3 = ((t+(t>>8)) >> 8)\n\t"
- "paddw %%mm1, %%mm3 # mm3 = S + ((t+(t>>8))>>8)\n\t"
- "packuswb %%mm3, %%mm3 # Pack 4 low bytes.\n\t"
- "movd %%mm3,(%0) # *dp = word\n"
- : "+r" (dp)
- : "r" (dp),
- "r" (beta));
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- asm volatile ("emms");
-}
-
-
-#ifdef notdef
-static void
-ConvolvePictureVertically(Pict *destPtr, Pict *srcPtr,
- ResampleFilter *filterPtr)
-{
- Sample *samples, *send;
- int x;
- int bytesPerSample; /* Size of sample. */
- long bytesPerRow;
-
- /* Pre-calculate filter contributions for each row. */
- bytesPerSample = Blt_ComputeWeights(srcPtr->height, destPtr->height,
- filterPtr, &samples);
- bytesPerRow = sizeof(Blt_Pixel) * srcPtr->pixelsPerRow;
- send = (Sample *)((char *)samples + (destPtr->height * bytesPerSample));
-
- asm volatile (
- /* Generate constants needed below. */
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pcmpeqw %mm2, %mm2 # mm2 = -1 \n\t"
- "psubw %mm6, %mm2 # mm2 = 1,1,1,1\n\t"
- "psllw $4, %mm2 # mm2 = BIAS\n");
-
- /* Apply filter to each row. */
- for (x = 0; x < srcPtr->width; x++) {
- Blt_Pixel *dp, *srcColumnPtr;
- Sample *splPtr;
-
- srcColumnPtr = srcPtr->bits + x;
- dp = destPtr->bits + x;
- for (splPtr = samples; splPtr < send;
- splPtr = (Sample *)((char *)splPtr + bytesPerSample)) {
- Blt_Pixel *sp;
-
- sp = srcColumnPtr + (splPtr->start * srcPtr->pixelsPerRow);
- asm volatile (
- /* Clear the accumulator mm5. */
- "pxor %%mm5, %%mm5 # mm5 = 0\n\n"
- ".Lasm%=:\n\t"
- /* Load the weighting factor into mm1. */
- "movd (%1), %%mm1 # mm1 = 0,0,0,W\n\t"
- /* Load the source pixel into mm0. */
- "movd (%3), %%mm0 # mm0 = S\n\t"
- /* Unpack the weighting factor into mm1. */
- "punpcklwd %%mm1, %%mm1 # mm1 = 0,0,W,W\n\t"
- "punpcklwd %%mm1, %%mm1 # mm1 = W,W,W,W\n\t"
- /* Unpack the pixel components into 16-bit words.*/
- "punpcklbw %%mm6, %%mm0 # mm0 = Sa,Sb,Sg,Sr\n\t"
- /* Scale the 8-bit components to 14 bits. (S * 257) >> 2 */
- "movq %%mm0, %%mm3 # mm3 = S8\n\t"
- "psllw $8, %%mm3 # mm3 = S8 * 256\n\t"
- "paddw %%mm3, %%mm0 # mm0 = S16\n\t"
- "psrlw $1, %%mm0 # mm0 = S15\n\t"
- /* Multiple each pixel component by the weight. Note that
- * the lower 16-bits of the product are truncated (bad)
- * creating round-off error in the sum. */
- "pmulhw %%mm1, %%mm0 # mm0 = S15 * W14\n\t"
- /* Move the pointers to the next weight and pixel */
- "add $4, %1 # wp++\n\t"
- "add %4, %3 # sp++\n\t"
- /* Accumulate upper 16-bit results of product in mm5. */
- "paddsw %%mm0, %%mm5 # mm5 = prod + mm5\n\t"
- "cmp %2, %1 # wend == wp\n\t"
- "jnz .Lasm%=\n\t"
- /* end loop */
- /* Add a rounding bias to the pixel sum */
- "paddw %%mm2, %%mm5 # mm5 = A13 + BIAS\n\t"
- /* Shift off fractional part */
- "psraw $5, %%mm5 # mm5 = A8\n\t"
- /* Pack 16-bit components into lower 4 bytes. */
- "packuswb %%mm5, %%mm5 # Pack 4 low-order bytes.\n\t"
- /* Save the word (pixel) in the destination. */
- "movd %%mm5,(%0) # dp = word\n"
- /* output registers */
- : "+r" (dp)
- /* input registers */
- : "r" (splPtr->weights),
- "r" (splPtr->wend),
- "r" (sp),
- "r" (bytesPerRow));
-#ifdef notdef
- if (dp->Alpha != 0xFF) {
- fprintf(stdout, "mmx v-alpha=0x%x\n", dp->Alpha);
- }
-#endif
- dp += destPtr->pixelsPerRow;
-
- }
- }
- asm volatile ("emms");
- /* Free the memory allocated for filter weights. */
- Blt_Free(samples);
-}
-
-static void
-ConvolvePictureHorizontally(Pict *destPtr, Pict *srcPtr,
- ResampleFilter *filterPtr)
-{
- Sample *samples, *send;
- int y;
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int bytesPerSample; /* Size of sample. */
-
- /* Pre-calculate filter contributions for each column. */
- bytesPerSample = Blt_ComputeWeights(srcPtr->width, destPtr->width,
- filterPtr, &samples);
- send = (Sample *)((char *)samples + (destPtr->width * bytesPerSample));
-
- /* Apply filter to each column. */
- srcRowPtr = srcPtr->bits;
- destRowPtr = destPtr->bits;
-
- asm volatile (
- "pxor %mm6, %mm6 # mm6 = 0\n\t"
- "pxor %mm3, %mm3 # mm3 = 0\n\t"
- "pcmpeqw %mm2, %mm2 # mm2 = -1\n\t"
- "psubw %mm3, %mm2 # mm2 = 1,1,1,1\n\t"
- "psllw $4, %mm2 # mm2 = BIAS\n");
-
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *dp;
- Sample *splPtr;
-
- dp = destRowPtr;
- for (splPtr = samples; splPtr < send;
- splPtr = (Sample *)((char *)splPtr + bytesPerSample)) {
-
- Blt_Pixel *sp;
- sp = srcRowPtr + splPtr->start;
- asm volatile (
- /* Clear the accumulator mm5. */
- "pxor %%mm5, %%mm5 # mm5 = 0\n\n"
- ".Lasm%=:\n\t"
- /* Load the weighting factor into mm1. */
- "movd (%1), %%mm1 # mm1 = W\n\t"
- /* Get the source RGBA pixel. */
- "movd (%3), %%mm0 # mm0 = sp\n\t"
- /* Unpack the weighting factor into mm1. */
- "punpcklwd %%mm1, %%mm1 # mm1 = 0,0,W,W\n\t"
- "punpcklwd %%mm1, %%mm1 # mm1 = W,W,W,W\n\t"
- /* Unpack the pixel into mm0. */
- "punpcklbw %%mm6, %%mm0 # mm0 = Sa,Sr,Sg,Sb\n\t"
- /* Scale the 8-bit components to 14 bits: (S * 257) >> 2 */
- "movq %%mm0, %%mm3 # mm3 = S8\n\t"
- "psllw $8, %%mm3 # mm3 = S8 * 256\n\t"
- "paddw %%mm3, %%mm0 # mm0 = S16\n\t"
- "psrlw $1, %%mm0 # mm0 = S15\n\t"
- /* Multiple each pixel component by the weight. Note that
- * the lower 16-bits of the product are truncated (bad)
- * creating round-off error in the sum. */
- "movq %%mm0, %%mm7 # mm5 = S15\n\t"
- "pmulhw %%mm1, %%mm0 # mm0 = S15 * W14\n\t"
- "pmullw %%mm1, %%mm7 # mm0 = S15 * W14\n\t"
- "psrlw $15, %%mm7 # mm0 = S1\n\t"
- "paddsw %%mm7, %%mm0 # mm5 = A13 + mm5\n\t"
-
- /* Add the 16-bit components to mm5. */
- "paddsw %%mm0, %%mm5 # mm5 = A13 + mm5\n\t"
- /* Move the pointers to the next weight and pixel */
- "add $4, %1 # wp++\n\t"
- "add $4, %3 # sp++\n\t"
- "cmp %2, %1 # wend == wp\n\t"
- "jnz .Lasm%=\n\t"
- /* end loop */
- /* Add a rounding bias to the pixel sum. */
- "paddw %%mm2, %%mm5 # mm5 = A13 + BIAS\n\t"
- /* Shift off fractional portion. */
- "psraw $5, %%mm5 # mm5 = A8\n\t"
- /* Pack 16-bit components into lower 4 bytes. */
- "packuswb %%mm5, %%mm5 # Pack A8 into low 4 bytes.\n\t"
- /* Store the word (pixel) in the destination. */
- "movd %%mm5,(%0) # dp = word\n"
- /* output registers */
- : "+r" (dp)
- /* input registers */
- : "r" (splPtr->weights),
- "r" (splPtr->wend),
- "r" (sp));
-#ifdef notdef
- if (dp->Alpha != 0xFF) {
- fprintf(stdout, "mmx h-alpha=0x%x\n", dp->Alpha);
- }
-#endif
- dp++;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- asm volatile ("emms");
- /* Free the memory allocated for horizontal filter weights. */
- Blt_Free(samples);
-}
-#endif
-
-static void
-AssociateColors(Pict *srcPtr) /* (in/out) picture */
-{
- Blt_Pixel *srcRowPtr;
- int y;
- Blt_Pixel mask;
-
- /* Create mask for alpha component. We'll use this mask to make sure we
- * don't change the alpha component of a pixel. */
- mask.u32 = 0;
- mask.Alpha = 0xFF;
- asm volatile (
- /* Generate constants needed below. */
- "pxor %%mm6, %%mm6 # mm6 = 0\n\t"
- "pcmpeqw %%mm5, %%mm5 # mm5 = -1 \n\t"
- "psubw %%mm6, %%mm5 # mm5 = 1,1,1,1\n\t"
- "movd %0, %%mm4 # mm4 = mask\n\t"
- "psllw $7, %%mm5 # mm5 = ROUND = 128\n"
- "punpcklbw %%mm6, %%mm4 # mm4 = 0,0,0,FF\n\t"
- /* outputs */
- :
- /* inputs */
- : "r" (mask.u32));
-
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
-
-#ifdef notdef
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp += 2) {
- Blt_Pixel *p, *q;
-
- /*
- * Small wins:
- *
- * We can compute
- * dest = (fg * alpha) + (beta * bg);
- * for all RGBA components at once.
- *
- * Packing unsigned with saturation performs the necessary
- * clamping without the branch misprediction penalty.
- */
- p = sp, q = sp+1;
- asm volatile (
- /*
- * mm0 = P
- * mm1 = Q
- * mm2 = Pa
- * mm3 = Qa
- * mm4 = temp
- * mm5 = ROUND = 128,128,128,128
- * mm6 = 0
- * mm7 = 0,0,0,FF
- */
- "movd (%0), %%mm0 # mm0 = P\n\t"
- "movd (%1), %%mm1 # mm1 = Q\n\t"
- "movd %2, %%mm2 # mm2 = 0,0,0,Pa\n\t"
- "movd %3, %%mm3 # mm2 = 0,0,0,Qa\n\t"
- "punpcklwd %%mm2, %%mm2 # mm2 = 0,0,Pa,Pa\n\t"
- "punpcklwd %%mm3, %%mm3 # mm3 = 0,0,Qa,Qa\n\t"
- "punpcklbw %%mm6, %%mm0 # mm0 = Pa,Pr,Pg,Pb\n\t"
- "punpcklwd %%mm2, %%mm2 # mm2 = Pa,Pa,Pa,Pa\n\t"
- "punpcklbw %%mm6, %%mm1 # mm1 = Qa,Qr,Qg,Qb\n\t"
- "por %%mm7, %%mm2 # mm2 = 0xff,Pa,Pa,Pa\n\t"
- "punpcklwd %%mm3, %%mm3 # mm3 = Qa,Qa,Qa,Qa\n\t"
- "por %%mm7, %%mm3 # mm2 = 0xff,Qa,Qa,Qa\n\t"
- "pmullw %%mm0, %%mm2 # mm2 = P*Pa\n\t"
- "pmullw %%mm1, %%mm3 # mm3 = Q*Qa\n\t"
- "paddw %%mm5, %%mm2 # mm2 = (P*Pa)+ROUND\n\t"
- "paddw %%mm5, %%mm3 # mm3 = (Q*Qa)+ROUND\n\t"
- "movq %%mm2, %%mm0 # mm0 = P16\n\t"
- "movq %%mm3, %%mm1 # mm1 = Q16\n\t"
- "psrlw $8, %%mm0 # mm0 = P16 / 256\n\t"
- "psrlw $8, %%mm1 # mm1 = Q16 / 256\n\t"
- "paddw %%mm2, %%mm0 # mm0 = (P16 / 256) + P16\n\t"
- "paddw %%mm3, %%mm1 # mm1 = (Q16 / 256) + Q16\n\t"
- "psrlw $8, %%mm0 # mm0 = P8 ~= P16 / 257\n\t"
- "psrlw $8, %%mm1 # mm1 = Q8 ~= Q16 / 257\n\t"
- "packuswb %%mm0, %%mm0 # Pack 4 low bytes.\n\t"
- "packuswb %%mm1, %%mm1 # Pack 4 low bytes.\n\t"
- "movd %%mm0, (%0) # *P = word\n"
- "movd %%mm1, (%1) # *Q = word\n"
- /* outputs */
- : "+r" (p),
- "+r" (q)
- /* inputs */
- : "r" ((unsigned int)(p->Alpha)),
- "r" ((unsigned int)(q->Alpha)));
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
-#else
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- unsigned int alpha;
-
- /*
- * Small wins:
- *
- * We can compute
- * dest = (fg * alpha) + (beta * bg);
- * for all RGBA components at once.
- *
- * Packing unsigned with saturation performs the necessary
- * clamping without the branch misprediction penalty.
- */
- alpha = sp->Alpha;
- asm volatile (
- /*
- * mm0 =
- * mm1 = sp
- * mm2 = alpha
- * mm3 = temp
- * mm4 = 0,0,0,FF
- * mm5 = ROUND = 128,128,128,128
- * mm6 = 0
- * mm7 =
- */
- "movd %1, %%mm2 # mm2 = 0,0,0,A\n\t"
- "movd (%0), %%mm1 # mm1 = sp\n\t"
- "punpcklwd %%mm2, %%mm2 # mm2 = 0,0,A,A\n\t"
- "punpcklbw %%mm6, %%mm1 # mm1 = Sa,Sr,Sg,Sb\n\t"
- "punpcklwd %%mm2, %%mm2 # mm2 = A,A,A,A\n\t"
- "por %%mm4, %%mm2 # mm2 = 0xff,A,A,A\n\t"
- "pmullw %%mm1, %%mm2 # mm2 = S*A\n\t"
- "paddw %%mm5, %%mm2 # mm2 = (S*A)+ROUND\n\t"
- "movq %%mm2, %%mm3 # mm3 = P16\n\t"
- "psrlw $8, %%mm3 # mm3 = P16 / 256\n\t"
- "paddw %%mm2, %%mm3 # mm3 = (P16 / 256) + P16\n\t"
- "psrlw $8, %%mm3 # mm3 = P8 ~= P16 / 257\n\t"
- "packuswb %%mm3, %%mm3 # Pack 4 low bytes.\n\t"
- "movd %%mm3, (%0) # *sp = word\n" :
- "+r" (sp) :
- "r" (alpha));
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
-#endif
- asm volatile ("emms");
- srcPtr->flags |= BLT_PIC_ASSOCIATED_COLORS;
-}
-
-
-static void
-UnassociateColors(Pict *srcPtr) /* (in/out) picture */
-{
- Blt_Pixel *srcRowPtr;
- int y;
- Blt_Pixel mask;
-
- /* Create mask for alpha component. We'll use this mask to make sure we
- * don't change the alpha component of a pixel. */
- mask.u32 = 0;
- mask.Alpha = 0xFF;
- asm volatile (
- /* Generate constants needed below. */
- "pxor %%mm6, %%mm6 # mm6 = 0\n\t"
- "pcmpeqw %%mm5, %%mm5 # mm5 = -1 \n\t"
- "psubw %%mm6, %%mm5 # mm5 = 1,1,1,1\n\t"
- "movd %0, %%mm4 # mm4 = mask\n\t"
- "psllw $7, %%mm5 # mm5 = ROUND = 128\n"
- "punpcklbw %%mm6, %%mm4 # mm4 = 0,0,0,FF\n\t"
- : /* inputs */
- : "r" (mask.u32));
-
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
-
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- unsigned int alpha;
-
- /*
- * Small wins:
- *
- * We can compute
- * dest = (fg * alpha) + (beta * bg);
- * for all RGBA components at once.
- *
- * C = (Ca * ia) + bias >> 16
- * Packing unsigned with saturation performs the
- * necessary clamping without the branch misprediction
- * penalty.
- */
- alpha = sp->Alpha;
- asm volatile (
- /*
- * mm0 =
- * mm1 = sp
- * mm2 = alpha
- * mm3 = temp
- * mm4 = 0,0,0,FF
- * mm5 = ROUND = 128,128,128,128
- * mm6 = 0
- * mm7 =
- */
- "movd %1, %%mm2 # mm2 = 0,0,0,IA\n\t"
- "movd (%0), %%mm1 # mm1 = sp\n\t"
- "punpcklwd %%mm2, %%mm2 # mm2 = 0,0,IA,IA\n\t"
- "punpcklbw %%mm6, %%mm1 # mm1 = Sa,Sr,Sg,Sb\n\t"
- "punpcklwd %%mm2, %%mm2 # mm2 = IA,IA,IA,IA\n\t"
- "por %%mm4, %%mm2 # mm2 = 0xff,IA,IA,IA\n\t"
- "pmullw %%mm1, %%mm2 # mm2 = S*IA\n\t"
- "paddw %%mm5, %%mm2 # mm2 = (S*A)+ROUND\n\t"
- "movq %%mm2, %%mm3 # mm3 = P16\n\t"
- "psrlw $8, %%mm3 # mm3 = P16 / 256\n\t"
- "paddw %%mm2, %%mm3 # mm3 = (P16 / 256) + P16\n\t"
- "psrlw $8, %%mm3 # mm3 = P8 ~= P16 / 257\n\t"
- "packuswb %%mm3, %%mm3 # Pack 4 low bytes.\n\t"
- "movd %%mm3, (%0) # *sp = word\n"
- : "+r" (sp)
- : "r" (alpha));
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- asm volatile ("emms");
- srcPtr->flags &= ~BLT_PIC_ASSOCIATED_COLORS;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CopyPictureBits --
- *
- * Creates a copy of the given picture using SSE xmm registers.
- *
- * FIXME: This is broken since it uses an double-world aligned quad word
- * move instruction.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The area specified in the source picture is copied to the
- * destination picture.
- *
- * --------------------------------------------------------------------------
- */
-static void
-CopyPictureBits(Pict *destPtr, Pict *srcPtr, int sx, int sy,
- int w, int h, int dx, int dy)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
- int dw, dh, width, height;
-
- dw = destPtr->width - dx;
- dh = destPtr->height - dy;
- width = MIN(dw, w);
- height = MIN(dh, h);
-
- srcRowPtr = srcPtr->bits + (srcPtr->pixelsPerRow * sy) + sx;
- destRowPtr = destPtr->bits + (destPtr->pixelsPerRow * dy) + dx;
- for (y = 0; y < height; y++) {
- Blt_Pixel *sp, *send, *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + (width & ~3); sp < send; sp += 4,
- dp += 4) {
- asm volatile (
- "movdqa (%1), %%xmm1\n\t"
- "movdqa %%xmm1, (%0)\n\t"
- : "+r" (dp)
- : "r" (sp));
- }
- switch (width & 3) {
- case 3: dp->u32 = sp->u32; sp++; dp++;
- case 2: dp->u32 = sp->u32; sp++; dp++;
- case 1: dp->u32 = sp->u32; sp++; dp++;
- case 0: break;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- destPtr->flags = (srcPtr->flags | BLT_PIC_DIRTY);
- asm volatile ("emms");
-}
-
-#ifdef notdef
-static void
-BoxCarVertically(Pict *destPtr, Pict *srcPtr, size_t r)
-{
- unsigned int x;
- size_t *map;
- int fscale;
- size_t fwidth; /* Filter width */
- float s;
- Blt_Pixel mask;
-
- map = CreateNeighborhoodMap(srcPtr->height, r);
- fwidth = r + r + 1;
- s = 1.0f / fwidth;
- fscale = float2si(s);
-
- fwidth--;
- /*
- * mm3 = r16 g16 b16 a16 accumulators
- */
- /* Apply filter to each row. */
-
- /* Create mask for alpha component. We'll use this mask to make sure we
- * don't change the alpha component of a pixel. */
- mask.u32 = 0;
- mask.Alpha = 0xFF;
- asm volatile (
- /* Generate constants needed below. */
- "pxor %%mm6, %%mm6 # mm6 = 0\n\t"
- "pcmpeqw %%mm5, %%mm5 # mm5 = -1 \n\t"
- "psubw %%mm6, %%mm5 # mm5 = 1,1,1,1\n\t"
- "movd %0, %%mm4 # mm4 = mask\n\t"
- "psllw $7, %%mm5 # mm5 = ROUND = 128\n"
- "punpcklbw %%mm6, %%mm4 # mm4 = 0,0,0,FF\n\t"
- : /* inputs */
- : "r" (mask.u32));
-
- for (x = 0; x < srcPtr->width; x++) {
- Blt_Pixel *dp, *srcColPtr;
- int r, g, b, a;
- unsigned int y;
-
- srcColPtr = srcPtr->bits + x;
- asm volatile (
- /* Initialize 16 bit accumulators. */
- "pxor %%mm4, %%mm4 # mm4 = 0\n\t");
- /* Prime the pump. */
- for (y = 0; y < fwidth; y++) {
- Blt_Pixel *sp;
-
- sp = srcColPtr + (srcPtr->pixelsPerRow * map[y]);
- asm volatile (
- /*
- * mm0 =
- * mm1 = sp
- * mm4 = accumulator
- * mm6 = 0
- * mm7 =
- */
- "movd (%0), %%mm1 # mm1 = sp\n\t"
- "punpcklbw %%mm6, %%mm1 # mm1 = Sa,Sr,Sg,Sb\n\t"
- "paddw %%mm1, %%mm4 # mm4 = accumulator\n\t"
- : "+r" (sp));
- }
- dp = destPtr->bits + x;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *s1, s2;
- int fr, fg, fb, fa;
-
- s1 = srcColPtr + (srcPtr->pixelsPerRow * map[y + fwidth]);
- s2 = srcColPtr + (srcPtr->pixelsPerRow * map[y]);
- asm volatile (
- /*
- * mm0 =
- * mm1 = sp
- * mm2 = alpha
- * mm3 = temp
- * mm4 = 0,0,0,FF
- * mm5 = ROUND = 128,128,128,128
- * mm6 = 0
- * mm7 =
- */
- "movd (%0), %%mm1 # mm1 = next\n\t"
- "movd (%1), %%mm2 # mm2 = prev\n\t"
- "punpcklbw %%mm6, %%mm1 # mm1 = Sa,Sr,Sg,Sb\n\t"
- "punpcklbw %%mm6, %%mm2 # mm2 = Sa,Sr,Sg,Sb\n\t"
- "paddw %%mm1, %%mm4 # mm4 = accumulator\n\t"
- "movq %%mm4, %%mm5 # mm3 = P16\n\t"
- "pmulhw %%mm3, %%mm5 # mm0 = S15 * W14\n\t"
- "psrlw $8, %%mm3 # mm3 = P16 / 256\n\t"
- "paddw %%mm2, %%mm3 # mm3 = (P16 / 256) + P16\n\t"
- "psrlw $8, %%mm3 # mm3 = P8 ~= P16 / 257\n\t"
- "packuswb %%mm3, %%mm3 # Pack 4 low bytes.\n\t"
- "movd %%mm3, (%0) # *sp = word\n"
- : "+r" (s1) "+r" (s2)
- : "r" (alpha));
- }
- r += sp->Red;
- g += sp->Green;
- b += sp->Blue;
- a += sp->Alpha;
- fr = r * fscale;
- fg = g * fscale;
- fb = b * fscale;
- fa = a * fscale;
- dp->Red = (unsigned char)SICLAMP(fr);
- dp->Green = (unsigned char)SICLAMP(fg);
- dp->Blue = (unsigned char)SICLAMP(fb);
- dp->Alpha = (unsigned char)SICLAMP(fa);
- sp = srcColPtr + (srcPtr->pixelsPerRow * map[y]);
- r -= sp->Red;
- g -= sp->Green;
- b -= sp->Blue;
- a -= sp->Alpha;
- dp += destPtr->pixelsPerRow;
- }
- }
- /* Free the memory allocated for filter weights. */
- Blt_Free(map);
-}
-
-static void
-BoxCarHorizontally(Pict *destPtr, Pict *srcPtr, size_t r)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- float s;
- size_t *map;
- int fscale;
- unsigned int y;
- size_t fwidth; /* Filter width */
-
- fwidth = r + r + 1;
- map = CreateNeighborhoodMap(srcPtr->width, r);
- s = 1.0f / fwidth;
- fscale = float2si(s);
- destRowPtr = destPtr->bits;
- srcRowPtr = srcPtr->bits;
- fwidth--;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *dp;
- unsigned int x;
- int r, g, b, a;
-
- /* Prime the pump. Get sums for each component for the first (fwidth)
- * pixels in the column. */
- r = g = b = a = 0;
- for (x = 0; x < fwidth; x++) {
- Blt_Pixel *sp;
-
- sp = srcRowPtr + map[x];
- r += sp->Red;
- g += sp->Green;
- b += sp->Blue;
- a += sp->Alpha;
- }
- dp = destRowPtr;
- for (x = 0; x < srcPtr->width; x++) {
- Blt_Pixel *sp;
- int fr, fg, fb, fa;
-
- sp = srcRowPtr + map[x + fwidth];
- r += sp->Red;
- g += sp->Green;
- b += sp->Blue;
- a += sp->Alpha;
- fr = r * fscale;
- fg = g * fscale;
- fb = b * fscale;
- fa = a * fscale;
- dp->Red = (unsigned char)SICLAMP(fr);
- dp->Green = (unsigned char)SICLAMP(fg);
- dp->Blue = (unsigned char)SICLAMP(fb);
- dp->Alpha = (unsigned char)SICLAMP(fa);
- sp = srcRowPtr + map[x];
- r -= sp->Red;
- g -= sp->Green;
- b -= sp->Blue;
- a -= sp->Alpha;
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- /* Free the memory allocated for map. */
- Blt_Free(map);
-}
-#endif
-
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * BlankPicture --
- *
- * Creates a copy of the given picture using SSE xmm registers.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The area specified in the source picture is copied to the
- * destination picture.
- *
- * --------------------------------------------------------------------------
- */
-static void
-BlankPicture(Pict *destPtr, Blt_Pixel *colorPtr)
-{
- Blt_Pixel *destRowPtr;
- int y;
-
- asm volatile (
- /* How do you load a xmm register? */
- /* Generate constants needed below. */
- "pxor %%mm6, %%mm6 # mm6 = 0\n\t"
- "pcmpeqw %%mm5, %%mm5 # mm5 = -1 \n\t"
- "psubw %%mm6, %%mm5 # mm5 = 1,1,1,1\n\t"
- "movd %0, %%mm4 # mm4 = C\n\t"
- "psllw $7, %%mm5 # mm5 = ROUND = 128\n"
- "punpcklbw %%mm6, %%mm4 # mm4 = 0,0,0,FF\n\t"
- : /* inputs */
- : "r" (colorPtr->u32));
- destRowPtr = destPtr->bits;
- for (y = 0; y < destPtr->height; y++) {
- Blt_Pixel *dp, *dend;
-
- for (dp = destRowPtr, dend = dp + (destPtr->width & ~3); dp < dend;
- dp += 4)
- asm volatile (
- "movdqa %%xmm1, (%0)\n\t"
- : "+r" (dp));
- }
- switch (width & 3) {
- case 3: dp->u32 = colorPtr->u32; dp++;
- case 2: dp->u32 = colorPtr->u32; dp++;
- case 1: dp->u32 = colorPtr->u32; dp++;
- case 0: break;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- destPtr->flags = (srcPtr->flags | BLT_PIC_DIRTY);
- asm volatile ("emms");
-}
-#endif
-
-static int
-x86HaveCpuId(void)
-{
- unsigned int ecx;
-
- asm volatile (
- /* See if ID instruction is supported. Save a copy of
- * EFLAGS in eax and ecx */
-#ifdef __amd64__
- "pushq %%rbx\n\t"
-#else
- "push %%ebx\n\t"
-#endif
- "pushf\n\t"
-#ifdef __amd64__
- "popq %%rax\n\t"
-#else
- "pop %%eax\n\t"
-#endif
- "mov %%eax, %%ecx\n\t"
- /* Toggle the CPUID bit in one copy and store to the EFLAGS
- * reg */
- "xorl $0x200000, %%eax\n\t"
-#ifdef __amd64__
- "pushq %%rax\n\t"
-#else
- "push %%eax\n\t"
-#endif
- "popf\n\t"
- /* Get the (hopefully modified) EFLAGS */
- "pushf\n\t"
-#ifdef __amd64__
- "popq %%rax\n\t"
-#else
- "pop %%eax\n\t"
-#endif
- /* Compare the result with the previous. */
- "xor %%eax, %%ecx\n\t"
- "movl %%ecx, %0\n\t"
-#ifdef __amd64__
- "popq %%rbx\n\t"
-#else
- "pop %%ebx\n\t"
-#endif
- : "=c" (ecx));
- if (ecx & 0x200000) {
- return 1;
- }
- return 0;
-}
-
-static int
-x86GetCpuVersion(char *version)
-{
- unsigned int ebx, ecx, edx;
-
- if (!x86HaveCpuId()) {
- return 0;
- }
- asm volatile (
- /* See if ID instruction is supported. Save a copy of
- * EFLAGS in eax and ecx */
-
- /* Get standard CPUID information, and go to a specific vendor
- * section */
-#ifdef __amd64__
- "pushq %%rbx\n\t"
-#else
- "push %%ebx\n\t"
-#endif
- "xor %%eax, %%eax\n\t"
- "cpuid\n\t"
- "movl %%ebx, %0\n\n\t"
-#ifdef __amd64__
- "popq %%rbx\n\n\t"
-#else
- "pop %%ebx\n\n\t"
-#endif
- : "=a" (ebx), "=d" (edx), "=c" (ecx)
- : /* no input */
- );
- memcpy (version, &ebx, 4);
- memcpy (version+4, &edx, 4);
- memcpy (version+8, &ecx, 4);
- version[12] = '\0';
-#ifdef notdef
- fprintf(stderr, "version=%s\n", version);
-#endif
- return 1;
-}
-
-static unsigned int
-x86GetCpuFlags(void)
-{
- unsigned int edx;
-
- asm volatile (
- /* Get the CPUID flags (eax=1). */
-#ifdef __amd64__
- "pushq %%rbx\n\t"
-#else
- "push %%ebx\n\t"
-#endif
- "movl $1, %%eax\n\t"
- "cpuid\n\t"
-#ifdef __amd64__
- "popq %%rbx\n\t"
-#else
- "pop %%ebx\n\t"
-#endif
- : "=d" (edx));
- return edx;
-}
-
-#define CPU_FEATURE_NONE (0)
-#define CPU_FEATURE_MMX (1<<0)
-#define CPU_FEATURE_SSE (1<<1)
-#define CPU_FEATURE_SSE2 (1<<2)
-#define CPU_FEATURE_3DNOW (1<<3)
-
-#define CPU_FEATURE_AMD_MMXEXT (1 << 22)
-#define CPU_FEATURE_AMD_3DNOW (1 << 31)
-#define CPU_FEATURE_CENTAUR_3DNOW (1 << 31)
-#define CPU_FEATURE_CENTAUR_MMX (1 << 23)
-#define CPU_FEATURE_CENTAUR_MMXEXT (1 << 24)
-#define CPU_FEATURE_CYRIX_MMX (1 << 23)
-#define CPU_FEATURE_CYRIX_MMXEXT (1 << 24)
-#define CPU_FEATURE_INTEL_MMX (1 << 23)
-#define CPU_FEATURE_INTEL_SSE (1 << 25)
-#define CPU_FEATURE_INTEL_SSE2 (1 << 26)
-#define CPU_FEATURE_AMD_MMX (1 << 23)
-#define CPU_FEATURE_AMD_SSE (1 << 25)
-#define CPU_FEATURE_AMD_SSE2 (1 << 26)
-
-static void
-PrintFeatures(Tcl_Interp *interp, unsigned int features)
-{
- if (features & CPU_FEATURE_MMX) {
- Tcl_AppendElement(interp, "mmx");
- }
- if (features & CPU_FEATURE_SSE) {
- Tcl_AppendElement(interp, "sse");
- }
- if (features & CPU_FEATURE_SSE2) {
- Tcl_AppendElement(interp, "sse2");
- }
- if (features & CPU_FEATURE_3DNOW) {
- Tcl_AppendElement(interp, "3dnow");
- }
- if (features & CPU_FEATURE_AMD_MMXEXT) {
- Tcl_AppendElement(interp, "amd_mmxext");
- }
- if (features & CPU_FEATURE_AMD_3DNOW) {
- Tcl_AppendElement(interp, "amd_mmxext");
- }
- if (features & CPU_FEATURE_CENTAUR_3DNOW) {
- Tcl_AppendElement(interp, "amd_mmxext");
- }
- if (features & CPU_FEATURE_CENTAUR_MMX) {
- Tcl_AppendElement(interp, "amd_mmxext");
- }
- if (features & CPU_FEATURE_CENTAUR_MMXEXT) {
- Tcl_AppendElement(interp, "amd_mmxext");
- }
- if (features & CPU_FEATURE_CYRIX_MMX) {
- Tcl_AppendElement(interp, "cyrix_mmx");
- }
- if (features & CPU_FEATURE_CYRIX_MMXEXT) {
- Tcl_AppendElement(interp, "cyrix_mmxext");
- }
- if (features & CPU_FEATURE_INTEL_MMX) {
- Tcl_AppendElement(interp, "intel_mmx");
- }
- if (features & CPU_FEATURE_INTEL_SSE) {
- Tcl_AppendElement(interp, "intel_sse");
- }
- if (features & CPU_FEATURE_INTEL_SSE2) {
- Tcl_AppendElement(interp, "intel_sse2");
- }
- if (features & CPU_FEATURE_AMD_MMX) {
- Tcl_AppendElement(interp, "amd_mmax");
- }
- if (features & CPU_FEATURE_AMD_SSE) {
- Tcl_AppendElement(interp, "amd_sse");
- }
- if (features & CPU_FEATURE_AMD_SSE2) {
- Tcl_AppendElement(interp, "amd_sse2");
- }
-}
-
-static int
-x86CpuFeatures(void)
-{
- char version[13];
- unsigned int flags, featureFlags;
-
- featureFlags = CPU_FEATURE_NONE;
- if (!x86GetCpuVersion(version)) {
- return featureFlags;
- }
- if (strcmp(version, "GenuineIntel") == 0) {
- flags = x86GetCpuFlags();
- if (flags & CPU_FEATURE_INTEL_MMX) {
- featureFlags |= CPU_FEATURE_MMX;
- }
- if (flags & CPU_FEATURE_INTEL_SSE) {
- featureFlags |= CPU_FEATURE_SSE;
- }
- if (flags & CPU_FEATURE_INTEL_SSE2) {
- featureFlags |= CPU_FEATURE_SSE2;
- }
- } else if (strcmp(version, "AuthenticAMD") == 0) {
- flags = x86GetCpuFlags();
- if (flags & CPU_FEATURE_AMD_MMX) {
- featureFlags |= CPU_FEATURE_MMX;
- }
- if (flags & CPU_FEATURE_AMD_SSE) {
- featureFlags |= CPU_FEATURE_SSE;
- }
- if (flags & CPU_FEATURE_AMD_SSE2) {
- featureFlags |= CPU_FEATURE_SSE2;
- }
- if (flags & CPU_FEATURE_AMD_3DNOW) {
- featureFlags |= CPU_FEATURE_3DNOW;
- }
- } else if (strcmp(version, "CyrixInstead") == 0) {
- flags = x86GetCpuFlags();
- if (flags & CPU_FEATURE_CYRIX_MMX) {
- featureFlags |= CPU_FEATURE_MMX;
- }
- }
- return featureFlags;
-}
-
-int
-Blt_CpuFeatures(Tcl_Interp *interp, int *featuresPtr)
-{
- unsigned int features;
-
- features = x86CpuFeatures();
- if (features & CPU_FEATURE_MMX) {
-#ifdef notdef
- bltPictProcsPtr = &mmxPictureProcs;
-#else
- bltPictProcsPtr->applyPictureToPictureProc = ApplyPictureToPicture;
- bltPictProcsPtr->applyScalarToPictureProc = ApplyScalarToPicture;
- bltPictProcsPtr->tentHorizontallyProc = TentHorizontally;
- bltPictProcsPtr->tentVerticallyProc = TentVertically;
- bltPictProcsPtr->zoomHorizontallyProc = ZoomHorizontally;
- bltPictProcsPtr->zoomVerticallyProc = ZoomVertically;
-#ifdef notdef
- bltPictProcsPtr->blendPicturesProc = BlendPictures;
-#endif
- bltPictProcsPtr->associateColorsProc = AssociateColors;
- bltPictProcsPtr->selectPixelsProc = SelectPixels;
- bltPictProcsPtr->fadePictureProc = FadePicture;
-#ifdef notdef
- if (features & CPU_FEATURE_SSE) {
- /*
- bltPictProcsPtr->copyPictureBitsProc = CopyPictureBits;
- */
- }
-#endif
-#endif
- }
- if (featuresPtr != NULL) {
- *featuresPtr = features;
- }
- if (interp != NULL) {
- PrintFeatures(interp, features);
- fprintf(stderr, "%s\n", Tcl_GetStringResult(interp));
- }
- return TCL_OK;
-}
-
-#else
-
-int
-Blt_CpuFeatures(Tcl_Interp *interp, int *featuresPtr)
-{
- if (featuresPtr != NULL) {
- *featuresPtr = 0;
- }
- return TCL_OK;
-}
-
-#endif /* HAVE_X86_ASM */
diff --git a/blt3.0.1/src/bltPictPbm.c b/blt3.0.1/src/bltPictPbm.c
deleted file mode 100644
index c170434..0000000
--- a/blt3.0.1/src/bltPictPbm.c
+++ /dev/null
@@ -1,962 +0,0 @@
-
-/*
- * bltPictPbm.c --
- *
- * This module implements PBM file format conversion routines for the picture
- * image type in the BLT toolkit.
- *
- * Copyright 2003-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include "blt.h"
-
-#include "config.h"
-#include <tcl.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <ctype.h>
-#include <bltAlloc.h>
-#include <bltSwitch.h>
-#include <bltDBuffer.h>
-#include <bltHash.h>
-#include "bltPicture.h"
-#include "bltPictFmts.h"
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif /* HAVE_STRING_H */
-
-#ifdef _MSC_VER
-#define vsnprintf _vsnprintf
-#endif
-
-#include <setjmp.h>
-
-typedef struct _Blt_Picture Picture;
-
-#define TRUE 1
-#define FALSE 0
-#define div257(t) (((t)+((t)>>8))>>8)
-#define SetBit(x) destRowPtr[(x>>3)] |= (0x80 >>(x&7))
-#define GetBit(x) srcRowPtr[(x>>3)] & (0x80 >> (x&7))
-
-typedef struct {
- jmp_buf jmpbuf;
- Tcl_DString errors;
- Tcl_DString warnings;
- int nWarnings, nErrors;
-} PbmMessage;
-
-typedef struct {
- unsigned int version; /* Version of PBM file */
- unsigned int maxval; /* Maximum intensity allowed. */
- unsigned int width, height; /* Dimensions of the image. */
- unsigned int bitsPerPixel; /* # bits per pixel. */
- unsigned int isRaw; /* Indicates if the image format is raw or
- * plain. */
- Blt_DBuffer dbuffer; /* */
- unsigned char *data; /* Start of raw data */
- unsigned int bytesPerRow;
- Blt_Picture picture;
-} Pbm;
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- int imageIndex;
- float gamma;
-} PbmImportSwitches;
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- Blt_Pixel bg;
- int index;
-} PbmExportSwitches;
-
-#define MAXCOLORS 256
-
-enum PbmVersions {
- PBM_UNKNOWN,
- PBM_PLAIN, /* Monochrome: 1-bit per pixel */
- PGM_PLAIN, /* 8-bits per pixel */
- PPM_PLAIN, /* 24-bits per pixel */
- PBM_RAW, /* 1-bit per pixel */
- PGM_RAW, /* 8/16-bits per pixel */
- PPM_RAW /* 24/48 bits per pixel */
-};
-
-static const char *pbmFormat[] = {
- "???",
- "pbmplain",
- "pgmplain",
- "ppmplain",
- "pbmraw",
- "pgmraw",
- "ppmraw",
-};
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(PbmImportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(PbmImportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_INT_NNEG, "-index", "int",
- Blt_Offset(PbmImportSwitches, imageIndex), 0},
- {BLT_SWITCH_FLOAT, "-gamma", "number",
- Blt_Offset(PbmImportSwitches, gamma), 0},
- {BLT_SWITCH_END}
-};
-
-BLT_EXTERN Blt_SwitchParseProc Blt_ColorSwitchProc;
-static Blt_SwitchCustom colorSwitch = {
- Blt_ColorSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(PbmExportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(PbmExportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_CUSTOM, "-bg", "color",
- Blt_Offset(PbmExportSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_INT_NNEG, "-index", "int",
- Blt_Offset(PbmExportSwitches, index), 0},
- {BLT_SWITCH_END}
-};
-
-static PbmMessage *pbmMessagePtr;
-
-DLLEXPORT extern Tcl_AppInitProc Blt_PicturePbmInit;
-
-/*ARGSUSED*/
-static void
-PbmError TCL_VARARGS_DEF(const char *, arg1)
-{
- char string[BUFSIZ+4];
- const char *fmt;
- int length;
- va_list args;
-
- fmt = TCL_VARARGS_START(const char *, arg1, args);
- length = vsnprintf(string, BUFSIZ, fmt, args);
- if (length > BUFSIZ) {
- strcat(string, "...");
- }
- Tcl_DStringAppend(&pbmMessagePtr->errors, string, -1);
- va_end(args);
- longjmp(pbmMessagePtr->jmpbuf, 0);
-}
-
-/*ARGSUSED*/
-static void
-PbmWarning TCL_VARARGS_DEF(const char *, arg1)
-{
- char string[BUFSIZ+4];
- const char *fmt;
- int length;
- va_list args;
-
- fmt = TCL_VARARGS_START(const char *, arg1, args);
- length = vsnprintf(string, BUFSIZ, fmt, args);
- if (length > BUFSIZ) {
- strcat(string, "...");
- }
- Tcl_DStringAppend(&pbmMessagePtr->warnings, string, -1);
- va_end(args);
- pbmMessagePtr->nWarnings++;
-}
-
-static char *
-PbmComment(char *bp)
-{
- char *p;
-
- p = bp;
- if (*p == '#') {
- /* Comment: file end of line */
- while((*p != '\n') && (p != '\0')) {
- p++;
- }
- PbmWarning("comment: %.*s\n", p-bp, bp);
- }
- return p;
-}
-
-static unsigned int
-PbmNextValue(Pbm *pbmPtr)
-{
- char *p, *endp;
- unsigned int value;
-
- p = (char *)Blt_DBuffer_Pointer(pbmPtr->dbuffer);
- while(isspace(*p)) {
- p++;
- }
- if (*p == '#') {
- p = PbmComment(p);
- }
- while(isspace(*p)) {
- p++;
- }
- value = strtoul(p, &endp, 10);
- if (endp == p) {
- PbmError("bad value in %s image data", pbmFormat[pbmPtr->version]);
- }
- if (value > pbmPtr->maxval) {
- PbmError("value (%d) greater than %s image max value %d", value,
- pbmFormat[pbmPtr->version], pbmPtr->maxval);
- }
- while (isspace(*p)) {
- p++;
- }
- Blt_DBuffer_SetPointer(pbmPtr->dbuffer, (unsigned char*)p);
- return value;
-}
-
-
-static inline int
-PbmGetShort(unsigned char *bp) {
- return (bp[0] << 8) + bp[1];
-}
-
-static Picture *
-PbmPlainData(Pbm *pbmPtr)
-{
- Picture *destPtr;
-
- pbmPtr->picture = destPtr =
- Blt_CreatePicture(pbmPtr->width, pbmPtr->height);
- switch (pbmPtr->bitsPerPixel) {
- case 1: /* Monochrome */
- case 8: /* Greyscale */
- {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- Blt_Pixel *dp, *dend;
-
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- dp++) {
- dp->Red = dp->Green = dp->Blue = PbmNextValue(pbmPtr);
- dp->Alpha = ALPHA_OPAQUE;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
- case 16: /* Greyscale (2 bytes) */
- {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- Blt_Pixel *dp, *dend;
-
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- dp++) {
- unsigned int value;
-
- value = PbmNextValue(pbmPtr);
- dp->Red = dp->Green = dp->Blue = div257(value);
- dp->Alpha = ALPHA_OPAQUE;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
- case 24: /* Color (1 byte per color component) */
- {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- Blt_Pixel *dp, *dend;
-
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- dp++) {
- dp->Red = PbmNextValue(pbmPtr);
- dp->Green = PbmNextValue(pbmPtr);
- dp->Blue = PbmNextValue(pbmPtr);
- dp->Alpha = ALPHA_OPAQUE;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
- case 48: /* Color (2 bytes per color component) */
- {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- Blt_Pixel *dp, *dend;
-
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- dp++) {
- int r, g, b;
-
- r = PbmNextValue(pbmPtr);
- g = PbmNextValue(pbmPtr);
- b = PbmNextValue(pbmPtr);
- dp->Red = div257(r);
- dp->Green = div257(g);
- dp->Blue = div257(b);
- dp->Alpha = ALPHA_OPAQUE;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
- }
- return destPtr;
-}
-
-static Picture *
-PbmRawData(Pbm *pbmPtr)
-{
- Picture *destPtr;
-
- pbmPtr->picture = destPtr =
- Blt_CreatePicture(pbmPtr->width, pbmPtr->height);
- switch (pbmPtr->bitsPerPixel) {
- case 1:
- {
- /* Monochrome */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- int x;
- Blt_Pixel *dp;
-
- dp = destRowPtr;
- for (x = 0; x < pbmPtr->width; x++) {
- dp->Red = dp->Green = dp->Blue = (GetBit(x)) ? 0xFF : 0;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- case 8:
- {
- /* Greyscale (1 byte) */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- sp++, dp++) {
- dp->Red = dp->Green = dp->Blue = *sp;
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- case 16:
- {
- /* Greyscale (2 bytes) */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- sp += 2, dp++) {
- unsigned int value;
-
- value = PbmGetShort(sp);
- dp->Red = dp->Green = dp->Blue = div257(value);
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- case 24:
- {
- /* Color (1 byte per color component) */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- sp += 3, dp++) {
- dp->Red = sp[0];
- dp->Green = sp[1];
- dp->Blue = sp[2];
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- case 48:
- {
- /* Color (2 bytes per color component) */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- sp += 6, dp++) {
- unsigned int r, g, b;
-
- r = PbmGetShort(sp);
- g = PbmGetShort(sp+2);
- b = PbmGetShort(sp+4);
- dp->Red = div257(r);
- dp->Green = div257(g);
- dp->Blue = div257(b);
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- }
- return destPtr;
-}
-
-static Blt_Picture
-PbmImage(Pbm *pbmPtr)
-{
- char *bp, *p;
- const char *type;
- size_t size, want;
- unsigned char *start;
- Blt_Picture picture;
-
- size = Blt_DBuffer_BytesLeft(pbmPtr->dbuffer);
- start = Blt_DBuffer_Pointer(pbmPtr->dbuffer);
- if (size < 14) {
- PbmError("can't read PBM image: short file %d bytes", size);
- }
- bp = (char *)start;
- if ((bp[0] != 'P') || (bp[1] < '1') || (bp[1] > '6')) {
- PbmError("unknown PBM image header (%c%c).", bp[0], bp[1]);
- }
- pbmPtr->version = bp[1] - '0';
- pbmPtr->isRaw = (pbmPtr->version > 2);
- switch(pbmPtr->version) {
- case PBM_PLAIN: /* P2 */
- case PBM_RAW: /* P5 */
- pbmPtr->bitsPerPixel = 8;
- break;
- case PGM_PLAIN: /* P1 */
- case PGM_RAW: /* P4 */
- pbmPtr->bitsPerPixel = 1;
- break;
- case PPM_PLAIN: /* P3 */
- case PPM_RAW: /* P6 */
- pbmPtr->bitsPerPixel = 24;
- break;
- }
- type = pbmFormat[pbmPtr->version];
- if (!isspace(bp[2])) {
- PbmError("no white space after version in %s header.", type);
- }
- p = bp + 3;
- if (*p == '#') {
- p = PbmComment(p);
- }
- pbmPtr->width = strtoul(p, &p, 10);
- if (pbmPtr->width == 0) {
- PbmError("bad %s width specification %s", type, bp+3);
- }
- if (!isspace(*p)) {
- PbmError("no white space after width in %s header.", type);
- }
- p++;
- if (*p == '#') {
- p = PbmComment(p);
- }
- pbmPtr->height = strtoul(p, &p, 10);
- if (pbmPtr->height == 0) {
- PbmError("bad %s height specification", type);
- }
- if (!isspace(*p)) {
- PbmError("no white space after height in %s header.", type);
- }
- p++;
- if (*p == '#') {
- p = PbmComment(p);
- }
- if (pbmPtr->bitsPerPixel != 1) {
- pbmPtr->maxval = strtoul(p, &p, 10);
- if (pbmPtr->maxval == 0) {
- PbmError("bad %s maxval specification", type);
- }
- if (!isspace(*p)) {
- PbmError("no white space after maxval in %s header.", type);
- }
- p++;
- if (*p == '#') {
- p = PbmComment(p);
- }
- if (pbmPtr->maxval >= USHRT_MAX) {
- PbmError("invalid %s maxval specification", type);
- }
- if (pbmPtr->maxval > 255) {
- pbmPtr->bitsPerPixel <<= 1; /* 16-bit greyscale or 48 bit color. */
- }
- }
- pbmPtr->data = (unsigned char *)p;
- pbmPtr->bytesPerRow = ((pbmPtr->bitsPerPixel * pbmPtr->width) + 7) / 8;
- want = (pbmPtr->data - start) + pbmPtr->height * pbmPtr->bytesPerRow;
- if ((pbmPtr->isRaw) && (want > Blt_DBuffer_BytesLeft(pbmPtr->dbuffer))) {
- PbmError("short %s file: expected %d bytes, got %d", type, want,
- Blt_DBuffer_BytesLeft(pbmPtr->dbuffer));
- }
- if (pbmPtr->isRaw) {
- picture = PbmRawData(pbmPtr);
- Blt_DBuffer_SetPointer(pbmPtr->dbuffer, pbmPtr->data +
- (pbmPtr->height * pbmPtr->bytesPerRow));
- } else {
- picture = PbmPlainData(pbmPtr);
- }
- return picture;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsPbm --
- *
- * Attempts to parse a PBM file header.
- *
- * Results:
- * Returns 1 is the header is PBM and 0 otherwise. Note that
- * the validity of the header contents is not checked here. That's
- * done in PbmToPictures.
- *
- *---------------------------------------------------------------------------
- */
-static int
-IsPbm(Blt_DBuffer dbuffer)
-{
- unsigned char *bp;
-
- Blt_DBuffer_ResetCursor(dbuffer);
- if (Blt_DBuffer_BytesLeft(dbuffer) < 2) {
- return FALSE;
- }
- bp = Blt_DBuffer_Pointer(dbuffer);
- if ((bp[0] != 'P') || (bp[1] < '1') || (bp[1] > '6')) {
- return FALSE;
- }
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PbmToPictures --
- *
- * Reads a PBM file and converts it into a picture.
- *
- * Results:
- * The picture is returned. If an error occured, such
- * as the designated file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-PbmToPictures(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer,
- PbmImportSwitches *switchesPtr)
-{
- Blt_Chain chain;
- Blt_Picture picture;
- Pbm pbm;
- PbmMessage message;
-
- pbmMessagePtr = &message;
- message.nWarnings = 0;
- memset(&pbm, 0, sizeof(pbm)); /* Clear the structure. */
- pbm.dbuffer = dbuffer;
-
- Tcl_DStringInit(&message.errors);
- Tcl_DStringInit(&message.warnings);
- Tcl_DStringAppend(&message.errors, "error reading \"", -1);
- Tcl_DStringAppend(&message.errors, fileName, -1);
- Tcl_DStringAppend(&message.errors, "\": ", -1);
-
- Tcl_DStringAppend(&message.warnings, "\"", -1);
- Tcl_DStringAppend(&message.warnings, fileName, -1);
- Tcl_DStringAppend(&message.warnings, "\": ", -1);
-
- if (setjmp(message.jmpbuf)) {
- Tcl_DStringResult(interp, &message.errors);
- Tcl_DStringFree(&message.warnings);
- if (pbm.picture != NULL) {
- Blt_FreePicture(pbm.picture);
- }
- return NULL;
- }
- chain = NULL;
- if (!IsPbm(pbm.dbuffer)) {
- PbmError("bad PBM header");
- }
- Blt_DBuffer_ResetCursor(pbm.dbuffer);
- chain = Blt_Chain_Create();
- while (Blt_DBuffer_BytesLeft(pbm.dbuffer) > 0) {
- picture = PbmImage(&pbm);
- Blt_Chain_Append(chain, picture);
- }
- if (switchesPtr->gamma != 1.0) {
- Blt_GammaCorrectPicture(picture, picture, switchesPtr->gamma);
- }
- if (message.nWarnings > 0) {
- Tcl_SetErrorCode(interp, "PICTURE", "PBM_READ_WARNINGS",
- Tcl_DStringValue(&message.warnings), (char *)NULL);
- } else {
- Tcl_SetErrorCode(interp, "NONE", (char *)NULL);
- }
- Tcl_DStringFree(&message.warnings);
- Tcl_DStringFree(&message.errors);
- return chain;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PicturesToPbm --
- *
- * Reads an PBM file and converts it into a picture.
- *
- * Results:
- * The picture is returned. If an error occured, such as the designated
- * file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PictureToPbm(Tcl_Interp *interp, Blt_Picture original, Blt_DBuffer dbuffer,
- PbmExportSwitches *switchesPtr)
-{
- Picture *srcPtr;
-
- srcPtr = original;
- if (srcPtr->flags & BLT_PIC_MASK) {
- Blt_Picture background;
-
- /* Blend picture with solid color background. */
- background = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- Blt_BlankPicture(background, &switchesPtr->bg);
- Blt_BlendPictures(background, srcPtr, 0, 0, srcPtr->width,
- srcPtr->height, 0, 0);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- srcPtr = background;
- }
- if (srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) {
- Blt_UnassociateColors(srcPtr);
- }
- if (srcPtr->flags & BLT_PIC_COLOR) { /* Color */
- Blt_Pixel *srcRowPtr;
- int bytesPerRow;
- int y;
- unsigned char *destRowPtr;
-
- Blt_DBuffer_Print(dbuffer, "P%d\n%d\n%d\n255\n", PPM_RAW,
- srcPtr->width, srcPtr->height);
- bytesPerRow = srcPtr->width * 3;
- Blt_DBuffer_Extend(dbuffer, srcPtr->height * bytesPerRow);
- destRowPtr = Blt_DBuffer_End(dbuffer);
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- dp[0] = sp->Red;
- dp[1] = sp->Green;
- dp[2] = sp->Blue;
- dp += 3;
- }
- destRowPtr += bytesPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- } else { /* Greyscale */
- Blt_Pixel *srcRowPtr;
- int bytesPerRow;
- int y;
- unsigned char *destRowPtr;
-
- Blt_DBuffer_Print(dbuffer, "P%d\n%d\n%d\n255\n", PGM_RAW,
- srcPtr->width, srcPtr->height);
- bytesPerRow = srcPtr->width;
- Blt_DBuffer_Extend(dbuffer, srcPtr->height * bytesPerRow);
- destRowPtr = Blt_DBuffer_End(dbuffer);
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- dp[0] = sp->Red;
- dp++;
- }
- destRowPtr += bytesPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- }
- Blt_DBuffer_SetLength(dbuffer, Blt_DBuffer_Size(dbuffer));
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- return TCL_OK;
-}
-
-
-static Blt_Chain
-ReadPbm(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer)
-{
- PbmImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- switches.imageIndex = 1;
- switches.gamma = 1.0;
- return PbmToPictures(interp, fileName, dbuffer, &switches);
-}
-
-static Tcl_Obj *
-WritePbm(Tcl_Interp *interp, Blt_Picture picture)
-{
- Blt_ChainLink link;
- Blt_DBuffer dbuffer;
- PbmExportSwitches switches;
- Tcl_Obj *objPtr;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF; /* white */
-
- dbuffer = Blt_DBuffer_Create();
- objPtr = NULL;
- picture = Blt_Chain_GetValue(link);
- if (PictureToPbm(interp, picture, dbuffer, &switches) == TCL_OK) {
- char *bytes;
-
- bytes = Blt_DBuffer_EncodeBase64(interp, dbuffer);
- if (bytes != NULL) {
- objPtr = Tcl_NewStringObj(bytes, -1);
- Blt_Free(bytes);
- }
- }
- Blt_DBuffer_Destroy(dbuffer);
- return objPtr;
-}
-
-static Blt_Chain
-ImportPbm(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv,
- const char **fileNamePtr)
-{
- Blt_DBuffer dbuffer;
- Blt_Chain chain;
- PbmImportSwitches switches;
- const char *string;
-
- memset(&switches, 0, sizeof(switches));
- switches.imageIndex = 1;
- switches.gamma = 1.0;
-
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one import source: ",
- "use only one -file or -data flag.", (char *)NULL);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- dbuffer = Blt_DBuffer_Create();
- chain = NULL;
- if (switches.dataObjPtr != NULL) {
- unsigned char *bytes;
- int nBytes;
-
- bytes = Tcl_GetByteArrayFromObj(switches.dataObjPtr, &nBytes);
- if (Blt_IsBase64(bytes, nBytes)) {
- if (Blt_DBuffer_DecodeBase64(interp, string, nBytes, dbuffer)
- != TCL_OK) {
- goto error;
- }
- } else {
- Blt_DBuffer_AppendData(dbuffer, bytes, nBytes);
- }
- string = "data buffer";
- *fileNamePtr = NULL;
- } else {
- string = Tcl_GetString(switches.fileObjPtr);
- *fileNamePtr = string;
- if (Blt_DBuffer_LoadFile(interp, string, dbuffer) != TCL_OK) {
- goto error;
- }
- }
- chain = PbmToPictures(interp, string, dbuffer, &switches);
- error:
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(dbuffer);
- return chain;
-}
-
-static int
-ExportPbm(Tcl_Interp *interp, unsigned int index, Blt_Chain chain, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_DBuffer dbuffer;
- Blt_Picture picture;
- PbmExportSwitches switches;
- int result;
-
- memset(&switches, 0, sizeof(switches));
- switches.index = index;
- switches.bg.u32 = 0xFFFFFFFF; /* Default bgcolor is white. */
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one export destination: ",
- "use only one -file or -data switch.", (char *)NULL);
- return TCL_ERROR;
- }
- /* FIXME: handle -all option. */
- picture = Blt_GetNthPicture(chain, switches.index);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "bad picture index.", (char *)NULL);
- return TCL_ERROR;
- }
- dbuffer = Blt_DBuffer_Create();
- if (PictureToPbm(interp, picture, dbuffer, &switches) != TCL_OK) {
- Tcl_AppendResult(interp, "can't convert \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- goto error;
- }
- /* Write the PBM data to file or convert it to a base64 string. */
- if (switches.fileObjPtr != NULL) {
- char *fileName;
-
- fileName = Tcl_GetString(switches.fileObjPtr);
- result = Blt_DBuffer_SaveFile(interp, fileName, dbuffer);
- } else if (switches.dataObjPtr != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_ObjSetVar2(interp, switches.dataObjPtr, NULL,
- Blt_DBuffer_ByteArrayObj(dbuffer), 0);
- result = (objPtr == NULL) ? TCL_ERROR : TCL_OK;
- } else {
- char *string;
-
- result = TCL_ERROR;
- string = Blt_DBuffer_EncodeBase64(interp, dbuffer);
- if (string != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(string, -1);
- Blt_Free(string);
- Tcl_SetObjResult(interp, objPtr);
- result = TCL_OK;
- }
- }
- error:
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(dbuffer);
- return result;
-}
-
-int
-Blt_PicturePbmInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_extra", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_picture_pbm", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_PictureRegisterFormat(interp,
- "pbm", /* Name of format. */
- IsPbm, /* Discovery routine. */
- ReadPbm, /* Read format procedure. */
- WritePbm, /* Write format procedure. */
- ImportPbm, /* Import format procedure. */
- ExportPbm); /* Export format switches. */
-}
-
diff --git a/blt3.0.1/src/bltPictPdf.c b/blt3.0.1/src/bltPictPdf.c
deleted file mode 100644
index 6256969..0000000
--- a/blt3.0.1/src/bltPictPdf.c
+++ /dev/null
@@ -1,1245 +0,0 @@
-
-/*
- * bltPictPdf.c --
- *
- * This module implements Portable Document Format (PDF) file conversion
- * routines for the picture image type in the BLT toolkit.
- *
- * Copyright 2003-2007 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include "blt.h"
-#include "config.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <limits.h>
-#include <tcl.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif /* HAVE_STRING_H */
-
-#ifndef __WIN32__
-# if defined(_WIN32) || defined(WIN32) || defined(__MINGW32__) || defined(__BORLANDC__)
-# define __WIN32__
-# ifndef WIN32
-# define WIN32
-# endif
-# endif
-#endif /*__WIN32__*/
-
-#ifdef _MSC_VER
-# define _CRT_SECURE_NO_DEPRECATE
-# define _CRT_NONSTDC_NO_DEPRECATE
-#endif /*MSC_VER*/
-
-#ifdef WIN32
-# define STRICT
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# undef STRICT
-# undef WIN32_LEAN_AND_MEAN
-# include <windowsx.h>
-#endif /*WIN32*/
-
-#include <bltSwitch.h>
-#include <bltDBuffer.h>
-#include "bltTypes.h"
-#include "bltPicture.h"
-#include "bltPictFmts.h"
-#include "bltPs.h"
-#include "bltAlloc.h"
-#include "bltWait.h"
-
-#include <tk.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-#ifdef WIN32
-#include "bltWin.h"
-#endif /*WIN32*/
-
-#define UCHAR(c) ((unsigned char) (c))
-#define ISASCII(c) (UCHAR(c)<=0177)
-#define MIN(a,b) (((a)<(b))?(a):(b))
-
-#define TRUE 1
-#define FALSE 0
-#define div257(t) (((t)+((t)>>8))>>8)
-#define SetBit(x) destRowPtr[(x>>3)] |= (0x80 >>(x&7))
-#define GetBit(x) srcRowPtr[(x>>3)] & (0x80 >> (x&7))
-
-#define MAXCOLORS 256
-#define BUFFER_SIZE (1<<16)
-
-enum PbmVersions {
- PBM_UNKNOWN,
- PBM_PLAIN, /* Monochrome: 1-bit per pixel */
- PGM_PLAIN, /* 8-bits per pixel */
- PPM_PLAIN, /* 24-bits per pixel */
- PBM_RAW, /* 1-bit per pixel */
- PGM_RAW, /* 8/16-bits per pixel */
- PPM_RAW /* 24/48 bits per pixel */
-};
-
-
-static const char *pbmFormat[] = {
- "???",
- "pbmplain",
- "pgmplain",
- "ppmplain",
- "pbmraw",
- "pgmraw",
- "ppmraw",
-};
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- int flags; /* Flag. */
- Blt_Pixel bg;
- PageSetup setup;
- int index;
-} PdfExportSwitches;
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- int dpi; /* Dots per inch. */
- const char *paperSize; /* Papersize. */
- int crop;
-} PdfImportSwitches;
-
-#define PDF_CROP (1<<0)
-
-typedef struct {
- unsigned int width, height; /* Dimensions of the image. */
- unsigned int bitsPerPixel; /* # bits per pixel. */
- unsigned char *data; /* Start of raw data */
- unsigned int bytesPerRow;
- Blt_DBuffer dbuffer;
-} Pbm;
-
-BLT_EXTERN Blt_SwitchParseProc Blt_ColorSwitchProc;
-static Blt_SwitchCustom colorSwitch = {
- Blt_ColorSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc PicaSwitchProc;
-static Blt_SwitchCustom picaSwitch = {
- PicaSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc PadSwitchProc;
-static Blt_SwitchCustom padSwitch = {
- PadSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-bg", "color",
- Blt_Offset(PdfExportSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(PdfExportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(PdfExportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_BITMASK, "-center", "",
- Blt_Offset(PdfExportSwitches, setup.flags), 0, PS_CENTER},
- {BLT_SWITCH_BITMASK, "-greyscale", "",
- Blt_Offset(PdfExportSwitches, setup.flags), 0, PS_GREYSCALE},
- {BLT_SWITCH_BITMASK, "-landscape", "",
- Blt_Offset(PdfExportSwitches, setup.flags), 0, PS_LANDSCAPE},
- {BLT_SWITCH_INT_POS, "-level", "pdflevel",
- Blt_Offset(PdfExportSwitches, setup.level), 0},
- {BLT_SWITCH_BITMASK, "-maxpect", "",
- Blt_Offset(PdfExportSwitches, setup.flags), 0, PS_MAXPECT},
- {BLT_SWITCH_CUSTOM, "-padx", "pad",
- Blt_Offset(PdfExportSwitches, setup.xPad), 0, 0, &padSwitch},
- {BLT_SWITCH_CUSTOM, "-pady", "pad",
- Blt_Offset(PdfExportSwitches, setup.yPad), 0, 0, &padSwitch},
- {BLT_SWITCH_CUSTOM, "-paperheight","pica",
- Blt_Offset(PdfExportSwitches, setup.reqPaperHeight), 0, 0, &picaSwitch},
- {BLT_SWITCH_CUSTOM, "-paperwidth", "pica",
- Blt_Offset(PdfExportSwitches, setup.reqPaperWidth), 0, 0, &picaSwitch},
- {BLT_SWITCH_LIST, "-comments", "{key value...}",
- Blt_Offset(PdfExportSwitches, setup.comments), BLT_SWITCH_NULL_OK},
- {BLT_SWITCH_INT_NNEG, "-index", "int",
- Blt_Offset(PdfExportSwitches, index), 0},
- {BLT_SWITCH_END}
-};
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_BOOLEAN, "-crop", "bool",
- Blt_Offset(PdfImportSwitches, crop), 0},
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(PdfImportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_INT, "-dpi", "number",
- Blt_Offset(PdfImportSwitches, dpi), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(PdfImportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_STRING, "-papersize", "string",
- Blt_Offset(PdfImportSwitches, paperSize), 0},
- {BLT_SWITCH_END}
-};
-
-DLLEXPORT extern Tcl_AppInitProc Blt_PicturePdfInit;
-extern const char *Blt_Itoa(int);
-
-#ifdef WIN32
-
-typedef struct {
- DWORD pid;
- HANDLE hProcess;
-} ProcessId;
-
-#else
-typedef pid_t ProcessId;
-#endif
-
-#ifdef WIN32
-#define close(fd) CloseHandle((HANDLE)fd)
-#define kill KillProcess
-#define waitpid WaitProcess
-#endif
-
-BLT_EXTERN int Blt_CreatePipeline(Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv, ProcessId **pidArrayPtr, int *stdinPipePtr,
- int *stdoutPipePtr, int *stderrPipePtr);
-BLT_EXTERN void Blt_ScreenDPI(Tk_Window tkwin, unsigned int *xPtr,
- unsigned int *yPtr);
-
-#define TRUE 1
-#define FALSE 0
-
-typedef struct _Blt_Picture Picture;
-
-#include <ctype.h>
-
-static void
-AddComments(Blt_Ps ps, const char **comments)
-{
- const char **p;
-
- for (p = comments; *p != NULL; p += 2) {
- if (*(p+1) == NULL) {
- break;
- }
- Blt_Ps_Format(ps, "%% %s: %s\n", *p, *(p+1));
- }
-}
-
-/*
- * Parse the lines that define the dimensions of the bitmap, plus the first
- * line that defines the bitmap data (it declares the name of a data variable
- * but doesn't include any actual data). These lines look something like the
- * following:
- *
- * #define foo_width 16
- * #define foo_height 16
- * #define foo_x_hot 3
- * #define foo_y_hot 3
- * static char foo_bits[] = {
- *
- * The x_hot and y_hot lines may or may not be present. It's important to
- * check for "char" in the last line, in order to reject old X10-style bitmaps
- * that used shorts.
- */
-
-#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif /* HAVE_SYS_TIME_H */
-#endif /* TIME_WITH_SYS_TIME */
-
-/*
- *--------------------------------------------------------------------------
- *
- * PicaSwitchProc --
- *
- * Convert a Tcl_Obj list of 2 or 4 numbers into representing a bounding
- * box structure.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *--------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PicaSwitchProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int *picaPtr = (int *)(record + offset);
-
- return Blt_Ps_GetPicaFromObj(interp, objPtr, picaPtr);
-}
-
-/*
- *--------------------------------------------------------------------------
- *
- * PadSwitchProc --
- *
- * Convert a Tcl_Obj list of 2 or 4 numbers into representing a bounding
- * box structure.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *--------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PadSwitchProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_Pad *padPtr = (Blt_Pad *)(record + offset);
-
- return Blt_Ps_GetPadFromObj(interp, objPtr, padPtr);
-}
-
-/*
- * --------------------------------------------------------------------------
- *
- * PostScriptPreamble --
- *
- * The PostScript preamble calculates the needed translation and scaling
- * to make image coordinates compatible with PostScript.
- *
- * --------------------------------------------------------------------------
- */
-static int
-PostScriptPreamble(
- Tcl_Interp *interp,
- Picture *srcPtr,
- PdfExportSwitches *switchesPtr,
- Blt_Ps ps)
-{
- PageSetup *setupPtr = &switchesPtr->setup;
- time_t ticks;
- char date[200]; /* Hold the date string from ctime() */
- const char *version;
- char *newline;
-
- Blt_Ps_Append(ps, "%!PS-Adobe-3.0 EPSF-3.0\n");
-
- /* The "BoundingBox" comment is required for EPS files. */
- Blt_Ps_Format(ps, "%%%%BoundingBox: %d %d %d %d\n",
- setupPtr->left, setupPtr->paperHeight - setupPtr->top,
- setupPtr->right, setupPtr->paperHeight - setupPtr->bottom);
- Blt_Ps_Append(ps, "%%Pages: 0\n");
-
- version = Tcl_GetVar(interp, "blt_version", TCL_GLOBAL_ONLY);
- if (version == NULL) {
- version = "???";
- }
- Blt_Ps_Format(ps, "%%%%Creator: (BLT %s Picture)\n", version);
-
- ticks = time((time_t *) NULL);
- strcpy(date, ctime(&ticks));
- newline = date + strlen(date) - 1;
- if (*newline == '\n') {
- *newline = '\0';
- }
- Blt_Ps_Format(ps, "%%%%CreationDate: (%s)\n", date);
- Blt_Ps_Append(ps, "%%DocumentData: Clean7Bit\n");
- if (setupPtr->flags & PS_LANDSCAPE) {
- Blt_Ps_Append(ps, "%%Orientation: Landscape\n");
- } else {
- Blt_Ps_Append(ps, "%%Orientation: Portrait\n");
- }
- AddComments(ps, setupPtr->comments);
- Blt_Ps_Append(ps, "%%EndComments\n\n");
- Blt_Ps_Append(ps, "%%BeginProlog\n");
- Blt_Ps_Append(ps, "%%EndProlog\n");
- Blt_Ps_Append(ps, "%%BeginSetup\n");
- Blt_Ps_Append(ps, "gsave\n");
- /*
- * Set the conversion from PostScript to X11 coordinates. Scale pica to
- * pixels and flip the y-axis (the origin is the upperleft corner).
- */
- Blt_Ps_VarAppend(ps,
- "% Transform coordinate system to use X11 coordinates\n"
- "% 1. Flip y-axis over by reversing the scale,\n", (char *)NULL);
- Blt_Ps_Append(ps, "1 -1 scale\n");
- Blt_Ps_VarAppend(ps,
- "% 2. Translate the origin to the other side of the page,\n"
- "% making the origin the upper left corner\n", (char *)NULL);
- Blt_Ps_Format(ps, "0 %d translate\n\n", -setupPtr->paperHeight);
- Blt_Ps_VarAppend(ps, "% User defined page layout\n\n",
- "% Set color level\n", (char *)NULL);
- Blt_Ps_Format(ps, "%% Set origin\n%d %d translate\n\n",
- setupPtr->left, setupPtr->bottom);
- if (setupPtr->flags & PS_LANDSCAPE) {
- Blt_Ps_Format(ps,
- "%% Landscape orientation\n0 %g translate\n-90 rotate\n",
- ((double)srcPtr->width * setupPtr->scale));
- }
- if (setupPtr->scale != 1.0f) {
- Blt_Ps_Append(ps, "\n% Setting picture scale factor\n");
- Blt_Ps_Format(ps, " %g %g scale\n", setupPtr->scale, setupPtr->scale);
- }
- Blt_Ps_Append(ps, "\n%%EndSetup\n\n");
- return TCL_OK;
-}
-
-static char *
-PbmComment(char *bp)
-{
- char *p;
-
- p = bp;
- if (*p == '#') {
- /* Comment: file end of line */
- while((*p != '\n') && (p != '\0')) {
- p++;
- }
- }
- return p;
-}
-
-static inline int
-PbmGetShort(unsigned char *bp) {
- return (bp[0] << 8) + bp[1];
-}
-
-static Picture *
-PbmRawData(Pbm *pbmPtr)
-{
- Picture *destPtr;
-
- destPtr = Blt_CreatePicture(pbmPtr->width, pbmPtr->height);
- switch (pbmPtr->bitsPerPixel) {
- case 1:
- {
- /* Monochrome */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- int x;
- Blt_Pixel *dp;
-
- dp = destRowPtr;
- for (x = 0; x < pbmPtr->width; x++) {
- dp->Red = dp->Green = dp->Blue = (GetBit(x)) ? 0xFF : 0;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- case 8:
- {
- /* Greyscale (1 byte) */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- sp++, dp++) {
- dp->Red = dp->Green = dp->Blue = *sp;
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- case 16:
- {
- /* Greyscale (2 bytes) */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- sp += 2, dp++) {
- unsigned int value;
-
- value = PbmGetShort(sp);
- dp->Red = dp->Green = dp->Blue = div257(value);
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- case 24:
- {
- /* Color (1 byte per color component) */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- sp += 3, dp++) {
- dp->Red = sp[0];
- dp->Green = sp[1];
- dp->Blue = sp[2];
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- case 48:
- {
- /* Color (2 bytes per color component) */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- sp += 6, dp++) {
- unsigned int r, g, b;
-
- r = PbmGetShort(sp);
- g = PbmGetShort(sp+2);
- b = PbmGetShort(sp+4);
- dp->Red = div257(r);
- dp->Green = div257(g);
- dp->Blue = div257(b);
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- }
- Blt_DBuffer_SetPointer(pbmPtr->dbuffer, pbmPtr->data +
- (pbmPtr->height * pbmPtr->bytesPerRow));
- return destPtr;
-}
-
-static Blt_Picture
-PbmToPicture(Tcl_Interp *interp, Blt_DBuffer dbuffer)
-{
- char *bp, *p;
- const char *type;
- int isRaw;
- int version;
- size_t size, want;
- unsigned char *start;
- Pbm pbm;
-
- size = Blt_DBuffer_BytesLeft(dbuffer);
- start = Blt_DBuffer_Pointer(dbuffer);
- if (size < 14) {
- Tcl_AppendResult(interp, "can't read PBM bitmap: short file",
- (char *)NULL);
- return NULL;
- }
- bp = (char *)start;
- if ((bp[0] != 'P') || (bp[1] < '1') || (bp[1] > '6')) {
- Tcl_AppendResult(interp, "unknown PBM bitmap header", (char *)NULL);
- return NULL;
- }
- version = bp[1] - '0';
- isRaw = (version > 2);
- switch(version) {
- case PBM_PLAIN: /* P2 */
- case PBM_RAW: /* P5 */
- pbm.bitsPerPixel = 8;
- break;
- case PGM_PLAIN: /* P1 */
- case PGM_RAW: /* P4 */
- pbm.bitsPerPixel = 1;
- break;
- case PPM_PLAIN: /* P3 */
- case PPM_RAW: /* P6 */
- pbm.bitsPerPixel = 24;
- break;
- }
- if (!isspace(bp[2])) {
- type = pbmFormat[version];
- Tcl_AppendResult(interp, "no white space after version in pbm header.",
- (char *)NULL);
- return NULL;
- }
- p = bp + 3;
- if (*p == '#') {
- p = PbmComment(p);
- }
- pbm.width = strtoul(p, &p, 10);
- if (pbm.width == 0) {
- Tcl_AppendResult(interp, "bad width specification ", bp+3, ".",
- (char *)NULL);
- return NULL;
- }
- if (!isspace(*p)) {
- Tcl_AppendResult(interp, "no white space after width in pbm header.",
- (char *)NULL);
- return NULL;
- }
- p++;
- if (*p == '#') {
- p = PbmComment(p);
- }
- pbm.height = strtoul(p, &p, 10);
- if (pbm.height == 0) {
- Tcl_AppendResult(interp, "bad height specification", (char *)NULL);
- return NULL;
- }
- if (!isspace(*p)) {
- Tcl_AppendResult(interp, "no white space after height in header.",
- (char *)NULL);
- return NULL;
- }
- p++;
- if (*p == '#') {
- p = PbmComment(p);
- }
- if (pbm.bitsPerPixel != 1) {
- unsigned int maxval; /* Maximum intensity allowed. */
-
- maxval = strtoul(p, &p, 10);
- if (maxval == 0) {
- Tcl_AppendResult(interp, "bad maxval specification", (char *)NULL);
- return NULL;
- }
- if (!isspace(*p)) {
- Tcl_AppendResult(interp, "no white space after maxval pbm header.",
- (char *)NULL);
- return NULL;
- }
- p++;
- if (*p == '#') {
- p = PbmComment(p);
- }
- if (maxval >= USHRT_MAX) {
- Tcl_AppendResult(interp, "invalid maxval specification",
- (char *)NULL);
- return NULL;
- }
- if (maxval > 255) {
- pbm.bitsPerPixel <<= 1; /* 16-bit greyscale or 48 bit color. */
- }
- }
- pbm.data = (unsigned char *)p;
- pbm.dbuffer = dbuffer;
- pbm.bytesPerRow = ((pbm.bitsPerPixel * pbm.width) + 7) / 8;
- want = (pbm.data - start) + pbm.height * pbm.bytesPerRow;
- if ((isRaw) && (want > Blt_DBuffer_BytesLeft(dbuffer))) {
- Tcl_AppendResult(interp, "short pbm file", (char *)NULL);
- return NULL;
- }
- if (!isRaw) {
- Tcl_AppendResult(interp, "expected raw pbm file", (char *)NULL);
- return NULL;
- }
- return PbmRawData(&pbm);
-}
-
-#ifdef WIN32
-
-typedef struct {
- int fd;
- Blt_DBuffer dbuffer;
- int lastError;
-} PdfWriter;
-
-/*
- *---------------------------------------------------------------------------
- *
- * WriteBufferProc --
- *
- * This function runs in a separate thread and write the data buffer as
- * input to the ghostscript process.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Writes the buffer (PDF file) to the ghostscript standard input
- * file descriptor.
- *
- *---------------------------------------------------------------------------
- */
-static DWORD WINAPI
-WriteBufferProc(void *clientData)
-{
- PdfWriter *writerPtr = clientData;
- const unsigned char *bp;
- int bytesLeft;
- HANDLE hFile;
- DWORD count;
-
- hFile = (HANDLE)writerPtr->fd;
- bp = Blt_DBuffer_Bytes(writerPtr->dbuffer);
- for (bytesLeft = Blt_DBuffer_Length(writerPtr->dbuffer); bytesLeft > 0;
- bytesLeft -= count) {
- if (!WriteFile(hFile, bp, bytesLeft, &count, NULL)) {
- writerPtr->lastError = GetLastError();
- break;
- }
- bp += count;
- }
- Blt_DBuffer_Destroy(writerPtr->dbuffer);
- CloseHandle(hFile);
- if (bytesLeft > 0) {
- ExitThread(1);
- }
- ExitThread(0);
- /* NOTREACHED */
- return 0;
-}
-
-static PdfWriter writer;
-
-static int
-WriteToGhostscript(Tcl_Interp *interp, int fd, Blt_DBuffer dbuffer)
-{
- HANDLE hThread;
- ClientData clientData;
- DWORD id;
-
- writer.dbuffer = Blt_DBuffer_Create();
- Blt_DBuffer_Init(writer.dbuffer);
- /* Copy the input to a new buffer. */
- Blt_DBuffer_AppendData(writer.dbuffer, Blt_DBuffer_Bytes(dbuffer),
- Blt_DBuffer_Length(dbuffer));
- writer.fd = fd;
- writer.lastError = 0;
- clientData = &writer;
- hThread = CreateThread(
- NULL, /* Security attributes */
- 8000, /* Initial stack size. */
- WriteBufferProc, /* Address of thread routine */
- clientData, /* One-word of data passed to
- * routine. */
- 0, /* Creation flags */
- &id); /* (out) Will contain Id of new
- * thread. */
- return (int)hThread;
-}
-
-
-static int
-ReadFromGhostscript(Tcl_Interp *interp, int fd, Blt_DBuffer dbuffer)
-{
- DWORD nBytes;
- HANDLE hFile;
- int result;
-
- Blt_DBuffer_Free(dbuffer);
- hFile = (HANDLE)fd;
- nBytes = 0;
- for (;;) {
- DWORD nRead;
- char *bp;
-
- bp = Blt_DBuffer_Extend(dbuffer, BUFFER_SIZE);
- if (!ReadFile(hFile, bp, BUFFER_SIZE, &nRead, NULL)) {
- DWORD err;
-
- err = GetLastError();
- if ((err != ERROR_BROKEN_PIPE) && (err != ERROR_HANDLE_EOF)) {
- Tcl_AppendResult(interp, "error reading from ghostscript: ",
- Blt_PrintError(err), (char *)NULL);
- result = TCL_ERROR;
- break;
- }
- }
- if (nRead == 0) {
- result = TCL_OK;
- break; /* EOF */
- }
- nBytes += nRead;
- Blt_DBuffer_SetLength(dbuffer, nBytes);
- }
- Blt_DBuffer_SetLength(dbuffer, nBytes);
- CloseHandle(hFile);
- return result;
-}
-
-#else /* WIN32 */
-
-static int
-WriteToGhostscript(Tcl_Interp *interp, int fd, Blt_DBuffer dbuffer)
-{
- pid_t child;
-
- child = fork();
- if (child == -1) {
- Tcl_AppendResult(interp, "can't fork process: ", Tcl_PosixError(interp),
- (char *)NULL);
- return 0;
- } else if (child > 0) {
- close(fd);
- return child;
- } else {
- const char *bytes;
- int nWritten, nBytes;
-
- bytes = (const char *)Blt_DBuffer_Bytes(dbuffer);
- nBytes = Blt_DBuffer_Length(dbuffer);
- nWritten = write(fd, bytes, nBytes);
- close(fd);
- if (nWritten != nBytes) {
- exit(1);
- }
- exit(0);
- }
-}
-
-static int
-ReadFromGhostscript(Tcl_Interp *interp, int fd, Blt_DBuffer dbuffer)
-{
- int nBytes;
-
- Blt_DBuffer_Free(dbuffer);
- nBytes = 0;
- for (;;) {
- char *bp;
- int nRead;
-
- bp = (char *)Blt_DBuffer_Extend(dbuffer, BUFFER_SIZE);
- nRead = read(fd, bp, BUFFER_SIZE);
- if (nRead == 0) {
- break; /* EOF */
- } else if (nRead < 0) {
- Tcl_AppendResult(interp, "error reading from ghostscript: ",
- Tcl_PosixError(interp), (char *)NULL);
- return TCL_ERROR;
- }
-
- nBytes += nRead;
- Blt_DBuffer_SetLength(dbuffer, nBytes);
- }
- Blt_DBuffer_SetLength(dbuffer, nBytes);
- close(fd);
- return TCL_OK;
-}
-
-#endif /* WIN32 */
-
-static int
-PdfToPbm(
- Tcl_Interp *interp,
- const char *fileName,
- Blt_DBuffer dbuffer,
- PdfImportSwitches *switchesPtr)
-{
- int in, out; /* File descriptors for ghostscript
- * subprocess. */
- char string1[200];
- char string2[200];
- int nPids;
- ProcessId *pidPtr;
- int result;
- pid_t child;
- const char **p;
- const char *args[] = {
- "gs", /* Ghostscript command */
- "-dEPSCrop", /* (optional) crop page to bbox */
- "-dSAFER", /* */
- "-q", /* Quiet mode. No GS messages. */
- "-sDEVICE=ppmraw", /* Format is PPM raw */
- "-dBATCH", /* Batch mode. No "quit" necessary. */
- "-sPAPERSIZE=letter", /* (optional) Specify paper size. */
- "-r100x100", /* (optional) Specify DPI of screen */
- "-dNOPAUSE", /* */
- "-sOutputFile=-", /* Output file is stdout. */
- "-",
- NULL
- };
-
- args[1] = (switchesPtr->crop) ? "-dEPSCrop" : "-dSAFER";
- {
- Tk_Window tkwin;
- unsigned int xdpi, ydpi;
-
- tkwin = Tk_MainWindow(interp);
- if (switchesPtr->dpi > 0) {
- xdpi = ydpi = switchesPtr->dpi;
- } else {
- Blt_ScreenDPI(tkwin, &xdpi, &ydpi);
- }
- sprintf(string1, "-r%dx%d", xdpi, ydpi);
- args[7] = string1;
- }
- if (switchesPtr->paperSize != NULL) {
- sprintf(string2, "-sPAPERSIZE=%s", switchesPtr->paperSize);
- args[6] = string2;
- }
- {
- int i;
- Tcl_Obj *objv[11];
- int objc = 11;
-
- for (i = 0, p = args; *p != NULL; p++, i++) {
- objv[i] = Tcl_NewStringObj(*p, -1);
- Tcl_IncrRefCount(objv[i]);
- }
- nPids = Blt_CreatePipeline(interp, objc, objv, &pidPtr, &in, &out,
- (int *)NULL);
- for (i = 0; i < objc; i++) {
- Tcl_DecrRefCount(objv[i]);
- }
- }
- if (nPids < 0) {
- return TCL_ERROR;
- }
- Tcl_DetachPids(nPids, (Tcl_Pid *)pidPtr);
- child = WriteToGhostscript(interp, in, dbuffer);
- if (child == 0) {
- return TCL_ERROR;
- }
- result = ReadFromGhostscript(interp, out, dbuffer);
-#ifdef WIN32
- CloseHandle((HANDLE)child);
-#endif
- Tcl_ReapDetachedProcs();
-#ifdef notdef
- Blt_DBuffer_SaveFile(interp, "junk.ppm", dbuffer);
-#endif
- if (result != TCL_OK) {
- Blt_DBuffer_Free(dbuffer);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static Blt_Chain
-PdfToPicture(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer,
- PdfImportSwitches *switchesPtr)
-{
- Blt_Chain chain;
-
- if (PdfToPbm(interp, fileName, dbuffer, switchesPtr) != TCL_OK) {
- return NULL;
- }
- /* Can be more than one image in buffer. Save each picture in a list. */
- chain = Blt_Chain_Create();
- while (Blt_DBuffer_BytesLeft(dbuffer) > 0) {
- Blt_Picture picture;
-
- picture = PbmToPicture(interp, dbuffer);
- if (picture == NULL) {
- Blt_Chain_Destroy(chain);
- return NULL;
- }
- Blt_Chain_Append(chain, picture);
- }
- return chain;
-}
-
-static int
-PictureToPdf(Tcl_Interp *interp, Blt_Picture original, Blt_Ps ps,
- PdfExportSwitches *switchesPtr)
-{
- Picture *srcPtr;
- int w, h;
-
- srcPtr = original;
- w = srcPtr->width, h = srcPtr->height;
- Blt_Ps_ComputeBoundingBox(&switchesPtr->setup, w, h);
- if (PostScriptPreamble(interp, srcPtr, switchesPtr, ps) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_ClassifyPicture(srcPtr);
- if (!Blt_PictureIsOpaque(srcPtr)) {
- Blt_Picture background;
-
- background = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- Blt_BlankPicture(background, &switchesPtr->bg);
- Blt_BlendPictures(background, srcPtr, 0, 0, srcPtr->width,
- srcPtr->height, 0, 0);
- srcPtr = background;
- }
- if (srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) {
- Blt_UnassociateColors(srcPtr);
- }
- Blt_Ps_Rectangle(ps, 0, 0, srcPtr->width, srcPtr->height);
- Blt_Ps_Append(ps, "gsave clip\n\n");
- Blt_Ps_DrawPicture(ps, srcPtr, 0, 0);
- Blt_Ps_VarAppend(ps, "\n",
- "% Unset clipping\n",
- "grestore\n\n", (char *)NULL);
- Blt_Ps_VarAppend(ps,
- "showpage\n",
- "%Trailer\n",
- "grestore\n",
- "end\n",
- "%EOF\n", (char *)NULL);
- if (srcPtr != original) {
- Blt_Free(srcPtr);
- }
- return TCL_OK;
-}
-
-static int
-IsPdf(Blt_DBuffer dbuffer)
-{
- unsigned char *bp;
-
- Blt_DBuffer_ResetCursor(dbuffer);
- if (Blt_DBuffer_BytesLeft(dbuffer) < 4) {
- return FALSE;
- }
- bp = Blt_DBuffer_Pointer(dbuffer);
- return (strncmp("%PDF", (char *)bp, 4) == 0);
-}
-
-static Blt_Chain
-ReadPdf(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer)
-{
- Blt_Chain chain;
- PdfImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- switches.crop = TRUE;
- chain = PdfToPicture(interp, fileName, dbuffer, &switches);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return chain;
-}
-
-static Tcl_Obj *
-WritePdf(Tcl_Interp *interp, Blt_Picture picture)
-{
- Blt_Ps ps;
- PdfExportSwitches switches;
- Tcl_Obj *objPtr;
- int result;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF; /* Default bgcolor is white. */
- switches.setup.reqPaperHeight = 792; /* 11 inches */
- switches.setup.reqPaperWidth = 612; /* 8.5 inches */
- switches.setup.level = 1;
- switches.setup.xPad.side1 = 72;
- switches.setup.xPad.side2 = 72;
- switches.setup.yPad.side1 = 72;
- switches.setup.yPad.side2 = 72;
- switches.setup.flags = 0;
-
- ps = Blt_Ps_Create(interp, &switches.setup);
- result = PictureToPdf(interp, picture, ps, &switches);
- objPtr = NULL;
- if (result == TCL_OK) {
- const char *string;
- int length;
-
- string = Blt_Ps_GetValue(ps, &length);
- objPtr = Tcl_NewStringObj(string, length);
- }
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- Blt_Ps_Free(ps);
- return objPtr;
-}
-
-static Blt_Chain
-ImportPdf(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv,
- const char **fileNamePtr)
-{
- Blt_Chain chain;
- Blt_DBuffer dbuffer;
- PdfImportSwitches switches;
- const char *string;
-
- memset(&switches, 0, sizeof(switches));
- switches.crop = TRUE;
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return NULL;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one import source: ",
- "use only one -file or -data flag.", (char *)NULL);
- return NULL;
- }
- chain = NULL;
- dbuffer = Blt_DBuffer_Create();
- if (switches.dataObjPtr != NULL) {
- int nBytes;
-
- string = Tcl_GetStringFromObj(switches.dataObjPtr, &nBytes);
- Blt_DBuffer_AppendData(dbuffer, (unsigned char *)string, nBytes);
- string = "data buffer";
- *fileNamePtr = NULL;
- } else {
- string = Tcl_GetString(switches.fileObjPtr);
- if (Blt_DBuffer_LoadFile(interp, string, dbuffer) != TCL_OK) {
- Blt_DBuffer_Destroy(dbuffer);
- return NULL;
- }
- *fileNamePtr = string;
- }
- chain = PdfToPicture(interp, string, dbuffer, &switches);
- Blt_DBuffer_Destroy(dbuffer);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return chain;
-}
-
-static int
-ExportPdf(Tcl_Interp *interp, unsigned int index, Blt_Chain chain, int objc,
- Tcl_Obj *const *objv)
-{
- PdfExportSwitches switches;
- Blt_Ps pdf;
- int result;
- Blt_Picture picture;
-
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF; /* Default bgcolor is white. */
- switches.setup.reqPaperHeight = 792; /* 11 inches */
- switches.setup.reqPaperWidth = 612; /* 8.5 inches */
- switches.setup.level = 1;
- switches.setup.xPad.side1 = 72;
- switches.setup.xPad.side2 = 72;
- switches.setup.yPad.side1 = 72;
- switches.setup.yPad.side2 = 72;
- switches.setup.flags = 0;
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one export destination: ",
- "use only one -file or -data switch.", (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- picture = Blt_GetNthPicture(chain, switches.index);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "no picture at index ",
- Blt_Itoa(switches.index), (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- pdf = Blt_Ps_Create(interp, &switches.setup);
- result = PictureToPdf(interp, picture, pdf, &switches);
- if (result != TCL_OK) {
- Tcl_AppendResult(interp, "can't convert \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- goto error;
- }
- if (switches.fileObjPtr != NULL) {
- char *fileName;
-
- fileName = Tcl_GetString(switches.fileObjPtr);
- result = Blt_Ps_SaveFile(interp, pdf, fileName);
- } else if (switches.dataObjPtr != NULL) {
- Tcl_Obj *objPtr;
- int length;
- const char *string;
-
- string = Blt_Ps_GetValue(pdf, &length);
- objPtr = Tcl_NewStringObj(string, length);
- objPtr = Tcl_ObjSetVar2(interp, switches.dataObjPtr, NULL, objPtr, 0);
- result = (objPtr == NULL) ? TCL_ERROR : TCL_OK;
- } else {
- const char *string;
- int length;
-
- string = Blt_Ps_GetValue(pdf, &length);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), string, length);
- }
- error:
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- Blt_Ps_Free(pdf);
- return result;
-}
-
-int
-Blt_PicturePdfInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_extra", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_picture_pdf", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_PictureRegisterFormat(interp,
- "pdf", /* Name of format. */
- IsPdf, /* Discovery routine. */
- ReadPdf, /* Import format procedure. */
- NULL, /* Export format procedure. */
- ImportPdf, /* Import format procedure. */
- NULL); /* Export format procedure. */
-}
diff --git a/blt3.0.1/src/bltPictPhoto.c b/blt3.0.1/src/bltPictPhoto.c
deleted file mode 100644
index 44c6aee..0000000
--- a/blt3.0.1/src/bltPictPhoto.c
+++ /dev/null
@@ -1,219 +0,0 @@
-
-#include "blt.h"
-
-#include "config.h"
-#include <tcl.h>
-#include <tk.h>
-#include <bltSwitch.h>
-#include <bltDBuffer.h>
-#include "bltPicture.h"
-#include "bltPictFmts.h"
-
-#define FALSE 0
-#define TRUE 1
-
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif /* HAVE_MEMORY_H */
-
-typedef struct {
- Tcl_Obj *imageObjPtr;
- int index;
-} PhotoExportSwitches;
-
-typedef struct {
- Tcl_Obj *imageObjPtr;
-} PhotoImportSwitches;
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-image", "imageName",
- Blt_Offset(PhotoExportSwitches, imageObjPtr), 0},
- {BLT_SWITCH_INT_NNEG, "-index", "int",
- Blt_Offset(PhotoExportSwitches, index), 0},
- {BLT_SWITCH_END}
-};
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-image", "imageName",
- Blt_Offset(PhotoImportSwitches, imageObjPtr), 0},
- {BLT_SWITCH_END}
-};
-
-DLLEXPORT extern Tcl_AppInitProc Blt_PicturePhotoInit;
-
-#ifdef notdef
-void
-Blt_SizeOfPhoto(Tk_PhotoHandle photo, int *widthPtr, int *heightPtr)
-{
- Tk_PhotoImageBlock ib;
-
- Tk_PhotoGetImage(photo, &ib);
- *widthPtr = ib.width;
- *heightPtr = ib.height;
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * PhotoToPicture --
- *
- * Converts a Tk Photo image to a picture.
- *
- * Results:
- * The picture is returned. If an error occured, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-PhotoToPicture(
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- PhotoImportSwitches *importPtr)
-{
- Tk_PhotoHandle photo;
- Blt_Picture picture;
- Blt_Chain chain;
-
- photo = Tk_FindPhoto(interp, Tcl_GetString(importPtr->imageObjPtr));
- if (photo == NULL) {
- Tcl_AppendResult(interp, "can't find photo \"",
- Tcl_GetString(importPtr->imageObjPtr), "\"", (char *)NULL);
- return NULL;
- }
- picture = Blt_PhotoToPicture(photo);
- chain = Blt_Chain_Create();
- Blt_Chain_Append(chain, picture);
- return chain;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictureToPhoto --
- *
- * Writes to an existing Tk Photo to contents of the picture.
- *
- * Results:
- * A standard TCL result. If an error occured, TCL_ERROR is
- * returned and an error message will be place in the interpreter
- * result.
- *
- * Side Effects:
- * Memory is allocated for the photo.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PictureToPhoto(
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- Blt_Picture picture, /* Picture source. */
- PhotoExportSwitches *switchesPtr)
-{
- Tk_PhotoHandle photo;
-
- photo = Tk_FindPhoto(interp, Tcl_GetString(switchesPtr->imageObjPtr));
- if (photo == NULL) {
- Tcl_AppendResult(interp, "can't find photo \"",
- Tcl_GetString(switchesPtr->imageObjPtr), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- Blt_PictureToPhoto(picture, photo);
- return TCL_OK;
-}
-
-static int
-IsPhoto(Blt_DBuffer buffer)
-{
- return FALSE;
-}
-
-static Blt_Chain
-ImportPhoto(
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv,
- const char **fileNamePtr)
-{
- Blt_Chain chain;
- PhotoImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- if (switches.imageObjPtr != NULL) {
- Tcl_AppendResult(interp, "no photo specified: use -image switch.",
- (char *)NULL);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- chain = PhotoToPicture(interp, &switches);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return chain;
-}
-
-static int
-ExportPhoto(Tcl_Interp *interp, unsigned int index, Blt_Chain chain, int objc,
- Tcl_Obj *const *objv)
-{
- int result;
- PhotoExportSwitches switches;
- Blt_Picture picture;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- switches.index = index;
- result = TCL_ERROR;
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- goto error;
- }
- if (switches.imageObjPtr != NULL) {
- Tcl_AppendResult(interp, "no photo specified: use -image switch.",
- (char *)NULL);
- goto error;
- }
- picture = Blt_GetNthPicture(chain, switches.index);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "bad picture index.", (char *)NULL);
- goto error;
- }
- result = PictureToPhoto(interp, picture, &switches);
- if (result != TCL_OK) {
- Tcl_AppendResult(interp, "can't convert \"", Tcl_GetString(objv[2]),
- "\"", (char *)NULL);
- }
- error:
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return result;
-}
-
-int
-Blt_PicturePhotoInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
- if (Tk_InitStubs(interp, TK_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_extra", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_picture_photo", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_PictureRegisterFormat(interp,
- "photo", /* Name of format. */
- IsPhoto, /* Discovery routine. */
- NULL, /* Read format procedure. */
- NULL, /* Write format procedure. */
- ImportPhoto, /* Import format procedure. */
- ExportPhoto); /* Export format procedure. */
-}
diff --git a/blt3.0.1/src/bltPictPng.c b/blt3.0.1/src/bltPictPng.c
deleted file mode 100644
index b178542..0000000
--- a/blt3.0.1/src/bltPictPng.c
+++ /dev/null
@@ -1,774 +0,0 @@
-
-/*
- * bltPictPng.c --
- *
- * This module implements PNG file format conversion routines for the picture
- * image type in the BLT toolkit.
- *
- * Copyright 2003-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include "blt.h"
-
-#include "config.h"
-#ifdef HAVE_LIBPNG
-#include <tcl.h>
-#include <bltSwitch.h>
-#include <bltAlloc.h>
-#include <bltAssert.h>
-#include <bltDBuffer.h>
-#include <bltHash.h>
-#include "bltPicture.h"
-#include "bltPictFmts.h"
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif /* HAVE_STRING_H */
-
-#define TRUE 1
-#define FALSE 0
-
-typedef struct _Blt_Picture Picture;
-
-#include <png.h>
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- char **comments; /* Comment pairs */
- int index;
-} PngExportSwitches;
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
-} PngImportSwitches;
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(PngExportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(PngExportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_LIST, "-comments", "{key string...}",
- Blt_Offset(PngExportSwitches, comments), 0},
- {BLT_SWITCH_INT_NNEG, "-index", "int",
- Blt_Offset(PngExportSwitches, index), 0},
- {BLT_SWITCH_END}
-};
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(PngImportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(PngImportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- Tcl_DString errors;
- Tcl_DString warnings;
- int nErrors, nWarnings;
-} PngMessage;
-
-DLLEXPORT extern Tcl_AppInitProc Blt_PicturePngInit;
-extern const char *Blt_Itoa(int);
-
-static void
-PngError(png_struct *pngPtr, const char *mesg)
-{
- PngMessage *mesgPtr;
-
- mesgPtr = png_get_error_ptr(pngPtr);
- Tcl_DStringAppend(&mesgPtr->errors, mesg, -1);
- mesgPtr->nErrors++;
-}
-
-static void
-PngWarning(png_structp png, const char *mesg)
-{
- PngMessage *mesgPtr;
-
- mesgPtr = png_get_error_ptr(png);
- Tcl_DStringAppend(&mesgPtr->warnings, mesg, -1);
- mesgPtr->nWarnings++;
-}
-
-static void
-PngReadFromBuffer(png_structp png, png_byte *out, png_size_t nWanted)
-{
- Blt_DBuffer dbuffer;
-
- dbuffer = png_get_io_ptr(png);
- if (Blt_DBuffer_BytesLeft(dbuffer) < nWanted) {
- nWanted = Blt_DBuffer_BytesLeft(dbuffer);
- }
- if (nWanted > 0) {
- memcpy(out, Blt_DBuffer_Pointer(dbuffer), nWanted);
- Blt_DBuffer_IncrCursor(dbuffer, nWanted);
- }
-}
-
-static void
-PngWriteToBuffer(
- png_struct *pngPtr,
- png_byte *out,
- png_size_t nBytes)
-{
- Blt_DBuffer dbuffer;
-
- dbuffer = png_get_io_ptr(pngPtr);
- if (!Blt_DBuffer_AppendData(dbuffer, out, nBytes)) {
- return;
- }
-}
-
-static void
-PngFlush(png_struct *pngPtr)
-{
- /* Do nothing */
-}
-
-#ifdef PNG_TEXT_SUPPORTED
-static void
-PngAddText(Tcl_Interp *interp, png_struct *pngPtr, png_info *infoPtr,
- char **comments)
-{
- png_text *text, *textPtr;
- char **p, **pend;
- int count;
-
- count = 0;
- for (p = comments; *p != NULL; p++) {
- count++;
- }
- if (count == 0) {
- return;
- }
- text = Blt_AssertMalloc(sizeof(png_text) * count);
- textPtr = text;
- for (p = comments, pend = p + count; p < pend; p += 2) {
- textPtr->compression = PNG_TEXT_COMPRESSION_NONE;
- textPtr->key = *p;
- if (*(p+1) == NULL) {
- continue;
- }
- textPtr->text = *(p+1);
- textPtr++;
- }
- if (count > 0) {
- png_set_text(pngPtr, infoPtr, text, textPtr - text);
- }
- Blt_Free(text);
-}
-#endif /* PNG_TEXT_SUPPORTED */
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsPng --
- *
- * Attempts to parse a PNG file header.
- *
- * Results:
- * Returns 1 is the header is PNG and 0 otherwise. Note that only the
- * signature is compared and the validity of the image contents is not
- * checked here. That's done in Blt_PngToPicture.
- *
- *---------------------------------------------------------------------------
- */
-static int
-IsPng(Blt_DBuffer dbuffer)
-{
-#define PNG_BYTES_TO_CHECK 4
- Blt_DBuffer_ResetCursor(dbuffer);
- if (Blt_DBuffer_Length(dbuffer) > PNG_BYTES_TO_CHECK) {
- unsigned char *bp;
- int bool;
-
- bp = Blt_DBuffer_Pointer(dbuffer);
- bool = (png_sig_cmp(bp, (png_size_t)0, PNG_BYTES_TO_CHECK) == 0);
- return bool;
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PngToPicture --
- *
- * Reads a PNG file and converts it into a picture.
- *
- * Results:
- * The picture is returned. If an error occured, such as the designated
- * file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-PngToPicture(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer,
- PngImportSwitches *switchesPtr)
-{
- Picture *destPtr;
- PngMessage message;
- int transform;
- png_infop info;
- png_structp png;
- unsigned int bitDepth, colorType;
- unsigned int interlace, filter, nChannels;
- unsigned int width, height;
-
- Tcl_DStringInit(&message.errors);
- Tcl_DStringInit(&message.warnings);
- message.nErrors = message.nWarnings = 0;
-
- Tcl_DStringAppend(&message.errors, "error reading \"", -1);
- Tcl_DStringAppend(&message.errors, fileName, -1);
- Tcl_DStringAppend(&message.errors, "\": ", -1);
- png = png_create_read_struct(PNG_LIBPNG_VER_STRING, &message, PngError,
- PngWarning);
- if (png == NULL) {
- return NULL;
- }
-
- destPtr = NULL; /* Mark to indicate failure. */
-
- info = png_create_info_struct(png);
- if (info == NULL) {
- goto bad;
- }
- if (setjmp(png->jmpbuf)) {
- goto bad;
- }
- png_set_read_fn(png, dbuffer, PngReadFromBuffer);
-
- transform = (PNG_TRANSFORM_EXPAND | /* Expand 1,2 and 4 bit to 8 bits. */
- PNG_TRANSFORM_STRIP_16); /* Convert 16-bit components to 8. */
-
- png_read_png(png, info, transform, (void *)NULL);
-
- bitDepth = png_get_bit_depth(png, info);
- colorType = png_get_color_type(png, info);
- filter = png_get_filter_type(png, info);
- height = png_get_image_height(png, info);
- interlace = png_get_interlace_type(png, info);
- nChannels = png_get_channels(png, info);
- width = png_get_image_width(png, info);
-
-#ifdef notdef
- fprintf(stderr, "%s: %dx%d, bit_depth=%d, channels=%d, interlace=%d\n",
- fileName, width, height, bitDepth, nChannels, interlace);
- fprintf(stderr, "colortype= %s %s %s \n",
- (colorType & 1) ? "palette" : "",
- (colorType & 2) ? "color" : "",
- (colorType & 4) ? "alpha" : "");
-#endif
-
- destPtr = Blt_CreatePicture(width, height);
- if (colorType & PNG_COLOR_MASK_ALPHA) {
- assert((nChannels == 4) || (nChannels == 2));
- destPtr->flags |= BLT_PIC_BLEND;
- }
- if ((nChannels == 4) || (nChannels == 3)) {
- destPtr->flags |= BLT_PIC_COLOR;
- }
- {
- unsigned int y;
- Blt_Pixel *destRowPtr;
- png_byte **row_pointers;
-
- destRowPtr = destPtr->bits;
- row_pointers = png_get_rows(png, info);
- switch (nChannels) {
- case 4: /* 1 red, 1 green, 1 blue, 1 alpha */
- for (y = 0; y < height; y++) {
- Blt_Pixel *dp;
- png_byte *sp;
- unsigned int x;
-
- dp = destRowPtr;
- sp = row_pointers[y];
- for (x = 0; x < width; x++) {
- dp->Red = sp[0];
- dp->Green = sp[1];
- dp->Blue = sp[2];
- dp->Alpha = sp[3];
- dp++, sp += 4;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- case 3: /* 1 red, 1 green, 1 blue */
- for (y = 0; y < height; y++) {
- Blt_Pixel *dp;
- unsigned char *sp;
- unsigned int x;
-
- dp = destRowPtr;
- sp = row_pointers[y];
- for (x = 0; x < width; x++) {
- dp->Red = sp[0];
- dp->Green = sp[1];
- dp->Blue = sp[2];
- dp->Alpha = ALPHA_OPAQUE;
- dp++, sp += 3;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- case 2: /* 1 greyscale, 1 alpha */
- for (y = 0; y < height; y++) {
- Blt_Pixel *dp;
- unsigned char *sp;
- unsigned int x;
-
- dp = destRowPtr;
- sp = row_pointers[y];
- for (x = 0; x < width; x++) {
- dp->Red = dp->Green = dp->Blue = sp[0];
- dp->Alpha = sp[1];
- dp++, sp += 2;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- case 1: /* 1 greyscale */
- for (y = 0; y < height; y++) {
- Blt_Pixel *dp;
- unsigned char *sp;
- unsigned int x;
-
- dp = destRowPtr;
- sp = row_pointers[y];
- for (x = 0; x < width; x++) {
- dp->Red = dp->Green = dp->Blue = *sp++;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- }
-
- bad:
- png_destroy_read_struct(&png, &info, (png_infop *)NULL);
- if (message.nWarnings > 0) {
- Tcl_SetErrorCode(interp, "PICTURE", "PNG_READ_WARNINGS",
- Tcl_DStringValue(&message.errors), (char *)NULL);
- } else {
- Tcl_SetErrorCode(interp, "NONE", (char *)NULL);
- }
- Tcl_DStringFree(&message.warnings);
- if (message.nErrors > 0) {
- Tcl_DStringResult(interp, &message.errors);
- }
- Tcl_DStringFree(&message.errors);
- if (destPtr != NULL) {
- Blt_Chain chain;
-
- chain = Blt_Chain_Create();
- Blt_Chain_Append(chain, destPtr);
- return chain;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictureToPng --
- *
- * Writes a PNG format image to the provided data buffer.
- *
- * Results:
- * A standard TCL result. If an error occured, TCL_ERROR is returned and
- * an error message will be place in the interpreter result. Otherwise,
- * the data buffer will contain the binary output of the image.
- *
- * Side Effects:
- * Memory is allocated for the data buffer.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PictureToPng(Tcl_Interp *interp, Blt_Picture picture, Blt_DBuffer dbuffer,
- PngExportSwitches *switchesPtr)
-{
- PngMessage message;
- int nColors;
- png_infop info;
- png_structp png;
- unsigned int colorType, nChannels, bitsPerPixel;
-
- Tcl_DStringInit(&message.errors);
- Tcl_DStringInit(&message.warnings);
- message.nErrors = message.nWarnings = 0;
-
- Tcl_DStringAppend(&message.errors, "error writing PNG output: ", -1);
- png = png_create_write_struct(PNG_LIBPNG_VER_STRING, &message, PngError,
- PngWarning);
- if (png == NULL) {
- return TCL_ERROR;
- }
- info = png_create_info_struct(png);
- if (info == NULL) {
- png_destroy_write_struct(&png, (png_infop *)NULL);
- return TCL_ERROR;
- }
- if (setjmp(png->jmpbuf)) {
- goto bad;
- }
- png_set_write_fn(png, (void *)dbuffer, PngWriteToBuffer, PngFlush);
-
- png_set_compression_level(png, Z_BEST_COMPRESSION);
- nColors = Blt_QueryColors(picture, (Blt_HashTable *)NULL);
- if (Blt_PictureIsColor(picture)) {
- nChannels = 3;
- colorType = PNG_COLOR_TYPE_RGB;
- } else {
- nChannels = 1;
- colorType = PNG_COLOR_TYPE_GRAY;
- }
- if (!Blt_PictureIsOpaque(picture)) {
- nChannels++;
- colorType |= PNG_COLOR_MASK_ALPHA;
- }
- bitsPerPixel = 8;
-
- png_set_IHDR(png, info,
- Blt_PictureWidth(picture), /* Width */
- Blt_PictureHeight(picture), /* Height */
- bitsPerPixel, /* Bits per pixel. */
- colorType, /* Color type: RGB or GRAY */
- PNG_INTERLACE_NONE, /* Interlace */
- PNG_COMPRESSION_TYPE_DEFAULT, /* Compression */
- PNG_FILTER_TYPE_DEFAULT); /* Filter */
-
-#ifdef PNG_TEXT_SUPPORTED
- if (switchesPtr->comments != NULL) {
- PngAddText(interp, png, info, switchesPtr->comments);
- }
-#endif
- png_write_info(png, info);
- png_set_packing(png);
-
- {
- Picture *srcPtr;
- Blt_Pixel *srcRowPtr;
- int bytesPerRow;
- int y;
- unsigned char **rowArray;
- unsigned char *destBuffer, *destRowPtr;
-
- srcPtr = picture;
- bytesPerRow = nChannels * srcPtr->width;
- destBuffer = Blt_Malloc(bytesPerRow * srcPtr->height);
- if (destBuffer == NULL) {
- goto bad;
- }
- rowArray = Blt_Malloc(sizeof(unsigned char *) * srcPtr->height);
- if (rowArray == NULL) {
- Blt_Free(destBuffer);
- goto bad;
- }
- destRowPtr = destBuffer;
- srcRowPtr = srcPtr->bits;
- switch (nChannels) {
- case 4: /* RGBA */
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp<send; sp++) {
- dp[0] = sp->Red;
- dp[1] = sp->Green;
- dp[2] = sp->Blue;
- dp[3] = sp->Alpha;
- dp += 4;
- }
- rowArray[y] = destRowPtr;
- destRowPtr += bytesPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
-
- case 3: /* RGB, 100% opaque image. */
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp<send; sp++) {
- dp[0] = sp->Red;
- dp[1] = sp->Green;
- dp[2] = sp->Blue;
- dp += 3;
- }
- rowArray[y] = destRowPtr;
- destRowPtr += bytesPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
-
- case 2: /* Greyscale with alpha component. */
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp<send; sp++) {
- dp[0] = sp->Red;
- dp[1] = sp->Alpha;
- dp += 2;
- }
- rowArray[y] = destRowPtr;
- destRowPtr += bytesPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
-
- case 1: /* Greyscale, 100% opaque image. */
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp<send; sp++) {
- *dp++ = sp->Red;
- }
- rowArray[y] = destRowPtr;
- destRowPtr += bytesPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
- }
- png_write_image(png, rowArray);
- png_write_end(png, NULL);
-
- Blt_Free(destBuffer);
- Blt_Free(rowArray);
- }
- bad:
- png_destroy_write_struct(&png, &info);
- if (message.nWarnings > 0) {
- Tcl_SetErrorCode(interp, "PICTURE", "PNG_WRITE_WARNINGS",
- Tcl_DStringValue(&message.errors), (char *)NULL);
- } else {
- Tcl_SetErrorCode(interp, "NONE", (char *)NULL);
- }
- Tcl_DStringFree(&message.warnings);
- if (message.nErrors > 0) {
- Tcl_DStringResult(interp, &message.errors);
- return TCL_ERROR;
- }
- Tcl_DStringFree(&message.errors);
- return TCL_OK;
-}
-
-static Blt_Chain
-ReadPng(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer)
-{
- PngImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- return PngToPicture(interp, fileName, dbuffer, &switches);
-}
-
-static Tcl_Obj *
-WritePng(Tcl_Interp *interp, Blt_Picture picture)
-{
- Blt_DBuffer dbuffer;
- PngExportSwitches switches;
- Tcl_Obj *objPtr;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
-
- objPtr = NULL;
- dbuffer = Blt_DBuffer_Create();
- if (PictureToPng(interp, picture, dbuffer, &switches) == TCL_OK) {
- char *bytes;
-
- bytes = Blt_DBuffer_EncodeBase64(interp, dbuffer);
- if (bytes != NULL) {
- objPtr = Tcl_NewStringObj(bytes, -1);
- Blt_Free(bytes);
- }
- }
- Blt_DBuffer_Destroy(dbuffer);
- return objPtr;
-}
-
-static Blt_Chain
-ImportPng(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv,
- const char **fileNamePtr)
-{
- Blt_Chain chain;
- Blt_DBuffer dbuffer;
- PngImportSwitches switches;
- const char *string;
-
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one import source: ",
- "use only one -file or -data flag.", (char *)NULL);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- dbuffer = Blt_DBuffer_Create();
- chain = NULL;
- if (switches.dataObjPtr != NULL) {
- unsigned char *bytes;
- int nBytes;
-
- bytes = Tcl_GetByteArrayFromObj(switches.dataObjPtr, &nBytes);
- if (Blt_IsBase64(bytes, nBytes)) {
- if (Blt_DBuffer_DecodeBase64(interp, string, nBytes, dbuffer)
- != TCL_OK) {
- goto error;
- }
- } else {
- Blt_DBuffer_AppendData(dbuffer, bytes, nBytes);
- }
- string = "data buffer";
- *fileNamePtr = NULL;
- } else {
- string = Tcl_GetString(switches.fileObjPtr);
- *fileNamePtr = string;
- if (Blt_DBuffer_SaveFile(interp, string, dbuffer) != TCL_OK) {
- goto error;
- }
- }
- chain = PngToPicture(interp, string, dbuffer, &switches);
- error:
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(dbuffer);
- return chain;
-}
-
-static int
-ExportPng(Tcl_Interp *interp, unsigned int index, Blt_Chain chain, int objc,
- Tcl_Obj *const *objv)
-{
- PngExportSwitches switches;
- Blt_DBuffer dbuffer;
- int result;
- Blt_Picture picture;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- switches.index = index;
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one export destination: ",
- "use only one -file or -data flag.", (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- picture = Blt_GetNthPicture(chain, switches.index);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "no picture at index ",
- Blt_Itoa(switches.index), (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- dbuffer = Blt_DBuffer_Create();
- result = PictureToPng(interp, picture, dbuffer, &switches);
- if (result != TCL_OK) {
- Tcl_AppendResult(interp, "can't convert \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- goto error;
- }
-
- /* Write the PNG data to file or convert it to a base64 string. */
- if (switches.fileObjPtr != NULL) {
- char *fileName;
-
- fileName = Tcl_GetString(switches.fileObjPtr);
- result = Blt_DBuffer_SaveFile(interp, fileName, dbuffer);
- } else if (switches.dataObjPtr != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_ObjSetVar2(interp, switches.dataObjPtr, NULL,
- Blt_DBuffer_ByteArrayObj(dbuffer), 0);
- result = (objPtr == NULL) ? TCL_ERROR : TCL_OK;
- } else {
- char *string;
-
- result = TCL_ERROR;
- string = Blt_DBuffer_EncodeBase64(interp, dbuffer);
- if (string != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(string, -1);
- Blt_Free(string);
- Tcl_SetObjResult(interp, objPtr);
- result = TCL_OK;
- }
- }
- error:
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(dbuffer);
- return result;
-}
-
-int
-Blt_PicturePngInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_core", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgRequire(interp, "blt_extra", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_picture_png", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_PictureRegisterFormat(interp,
- "png", /* Name of format. */
- IsPng, /* Format discovery procedure. */
- ReadPng, /* Read format procedure. */
- WritePng, /* Write format procedure. */
- ImportPng, /* Import format procedure. */
- ExportPng); /* Export format procedure. */
-}
-
-#endif /* HAVE_LIBPNG */
-
diff --git a/blt3.0.1/src/bltPictPs.c b/blt3.0.1/src/bltPictPs.c
deleted file mode 100644
index 31b90be..0000000
--- a/blt3.0.1/src/bltPictPs.c
+++ /dev/null
@@ -1,1246 +0,0 @@
-
-/*
- * bltPictPs.c --
- *
- * This module implements Encapsulated PostScript file format conversion
- * routines for the picture image type in the BLT toolkit.
- *
- * Copyright 2003-2007 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include "blt.h"
-#include "config.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <limits.h>
-#include <tcl.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif /* HAVE_STRING_H */
-
-#ifndef __WIN32__
-# if defined(_WIN32) || defined(WIN32) || defined(__MINGW32__) || defined(__BORLANDC__)
-# define __WIN32__
-# ifndef WIN32
-# define WIN32
-# endif
-# endif
-#endif /*__WIN32__*/
-
-#ifdef _MSC_VER
-# define _CRT_SECURE_NO_DEPRECATE
-# define _CRT_NONSTDC_NO_DEPRECATE
-#endif /*MSC_VER*/
-
-#ifdef WIN32
-# define STRICT
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# undef STRICT
-# undef WIN32_LEAN_AND_MEAN
-# include <windowsx.h>
-#endif /*WIN32*/
-
-#include <bltSwitch.h>
-#include <bltDBuffer.h>
-#include "bltTypes.h"
-#include "bltPicture.h"
-#include "bltPictFmts.h"
-#include "bltPs.h"
-#include "bltAlloc.h"
-#include "bltWait.h"
-
-#include <tk.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-#ifdef WIN32
-#include "bltWin.h"
-#endif /*WIN32*/
-
-#define UCHAR(c) ((unsigned char) (c))
-#define ISASCII(c) (UCHAR(c)<=0177)
-#define MIN(a,b) (((a)<(b))?(a):(b))
-
-#define TRUE 1
-#define FALSE 0
-#define div257(t) (((t)+((t)>>8))>>8)
-#define SetBit(x) destRowPtr[(x>>3)] |= (0x80 >>(x&7))
-#define GetBit(x) srcRowPtr[(x>>3)] & (0x80 >> (x&7))
-
-#define MAXCOLORS 256
-#define BUFFER_SIZE (1<<16)
-
-enum PbmVersions {
- PBM_UNKNOWN,
- PBM_PLAIN, /* Monochrome: 1-bit per pixel */
- PGM_PLAIN, /* 8-bits per pixel */
- PPM_PLAIN, /* 24-bits per pixel */
- PBM_RAW, /* 1-bit per pixel */
- PGM_RAW, /* 8/16-bits per pixel */
- PPM_RAW /* 24/48 bits per pixel */
-};
-
-
-static const char *pbmFormat[] = {
- "???",
- "pbmplain",
- "pgmplain",
- "ppmplain",
- "pbmraw",
- "pgmraw",
- "ppmraw",
-};
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- int flags; /* Flag. */
- Blt_Pixel bg;
- PageSetup setup;
- int index;
-} PsExportSwitches;
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- int dpi; /* Dots per inch. */
- const char *paperSize; /* Papersize. */
- int crop;
-} PsImportSwitches;
-
-#define PS_CROP (1<<0)
-
-typedef struct {
- unsigned int width, height; /* Dimensions of the image. */
- unsigned int bitsPerPixel; /* # bits per pixel. */
- unsigned char *data; /* Start of raw data */
- unsigned int bytesPerRow;
- Blt_DBuffer dbuffer;
-} Pbm;
-
-BLT_EXTERN Blt_SwitchParseProc Blt_ColorSwitchProc;
-static Blt_SwitchCustom colorSwitch = {
- Blt_ColorSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc PicaSwitchProc;
-static Blt_SwitchCustom picaSwitch = {
- PicaSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc PadSwitchProc;
-static Blt_SwitchCustom padSwitch = {
- PadSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-bg", "color",
- Blt_Offset(PsExportSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(PsExportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(PsExportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_BITMASK, "-center", "",
- Blt_Offset(PsExportSwitches, setup.flags), 0, PS_CENTER},
- {BLT_SWITCH_BITMASK, "-greyscale", "",
- Blt_Offset(PsExportSwitches, setup.flags), 0, PS_GREYSCALE},
- {BLT_SWITCH_BITMASK, "-landscape", "",
- Blt_Offset(PsExportSwitches, setup.flags), 0, PS_LANDSCAPE},
- {BLT_SWITCH_INT_POS, "-level", "pslevel",
- Blt_Offset(PsExportSwitches, setup.level), 0},
- {BLT_SWITCH_BITMASK, "-maxpect", "",
- Blt_Offset(PsExportSwitches, setup.flags), 0, PS_MAXPECT},
- {BLT_SWITCH_CUSTOM, "-padx", "pad",
- Blt_Offset(PsExportSwitches, setup.xPad), 0, 0, &padSwitch},
- {BLT_SWITCH_CUSTOM, "-pady", "pad",
- Blt_Offset(PsExportSwitches, setup.yPad), 0, 0, &padSwitch},
- {BLT_SWITCH_CUSTOM, "-paperheight","pica",
- Blt_Offset(PsExportSwitches, setup.reqPaperHeight), 0, 0, &picaSwitch},
- {BLT_SWITCH_CUSTOM, "-paperwidth", "pica",
- Blt_Offset(PsExportSwitches, setup.reqPaperWidth), 0, 0, &picaSwitch},
- {BLT_SWITCH_LIST, "-comments", "{key value...}",
- Blt_Offset(PsExportSwitches, setup.comments), BLT_SWITCH_NULL_OK},
- {BLT_SWITCH_INT_NNEG, "-index", "int",
- Blt_Offset(PsExportSwitches, index), 0},
- {BLT_SWITCH_END}
-};
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_BOOLEAN, "-crop", "bool",
- Blt_Offset(PsImportSwitches, crop), 0},
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(PsImportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_INT, "-dpi", "number",
- Blt_Offset(PsImportSwitches, dpi), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(PsImportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_STRING, "-papersize", "string",
- Blt_Offset(PsImportSwitches, paperSize), 0},
- {BLT_SWITCH_END}
-};
-
-DLLEXPORT extern Tcl_AppInitProc Blt_PicturePsInit;
-extern const char *Blt_Itoa(int);
-
-#ifdef WIN32
-
-typedef struct {
- DWORD pid;
- HANDLE hProcess;
-} ProcessId;
-
-#else
-typedef pid_t ProcessId;
-#endif
-
-#ifdef WIN32
-#define close(fd) CloseHandle((HANDLE)fd)
-#define kill KillProcess
-#define waitpid WaitProcess
-#endif
-
-BLT_EXTERN int Blt_CreatePipeline(Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv, ProcessId **pidArrayPtr, int *stdinPipePtr,
- int *stdoutPipePtr, int *stderrPipePtr);
-BLT_EXTERN void Blt_ScreenDPI(Tk_Window tkwin, unsigned int *xPtr,
- unsigned int *yPtr);
-
-#define TRUE 1
-#define FALSE 0
-
-typedef struct _Blt_Picture Picture;
-
-#include <ctype.h>
-
-static void
-AddComments(Blt_Ps ps, const char **comments)
-{
- const char **p;
-
- for (p = comments; *p != NULL; p += 2) {
- if (*(p+1) == NULL) {
- break;
- }
- Blt_Ps_Format(ps, "%% %s: %s\n", *p, *(p+1));
- }
-}
-
-/*
- * Parse the lines that define the dimensions of the bitmap, plus the first
- * line that defines the bitmap data (it declares the name of a data variable
- * but doesn't include any actual data). These lines look something like the
- * following:
- *
- * #define foo_width 16
- * #define foo_height 16
- * #define foo_x_hot 3
- * #define foo_y_hot 3
- * static char foo_bits[] = {
- *
- * The x_hot and y_hot lines may or may not be present. It's important to
- * check for "char" in the last line, in order to reject old X10-style bitmaps
- * that used shorts.
- */
-
-#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif /* HAVE_SYS_TIME_H */
-#endif /* TIME_WITH_SYS_TIME */
-
-/*
- *--------------------------------------------------------------------------
- *
- * PicaSwitchProc --
- *
- * Convert a Tcl_Obj list of 2 or 4 numbers into representing a bounding
- * box structure.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *--------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PicaSwitchProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int *picaPtr = (int *)(record + offset);
-
- return Blt_Ps_GetPicaFromObj(interp, objPtr, picaPtr);
-}
-
-/*
- *--------------------------------------------------------------------------
- *
- * PadSwitchProc --
- *
- * Convert a Tcl_Obj list of 2 or 4 numbers into representing a bounding
- * box structure.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *--------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PadSwitchProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_Pad *padPtr = (Blt_Pad *)(record + offset);
-
- return Blt_Ps_GetPadFromObj(interp, objPtr, padPtr);
-}
-
-/*
- * --------------------------------------------------------------------------
- *
- * PostScriptPreamble --
- *
- * The PostScript preamble calculates the needed translation and scaling
- * to make image coordinates compatible with PostScript.
- *
- * --------------------------------------------------------------------------
- */
-static int
-PostScriptPreamble(Tcl_Interp *interp, Picture *srcPtr,
- PsExportSwitches *switchesPtr, Blt_Ps ps)
-{
- PageSetup *setupPtr = &switchesPtr->setup;
- time_t ticks;
- char date[200]; /* Hold the date string from ctime() */
- const char *version;
- char *newline;
-
- Blt_Ps_Append(ps, "%!PS-Adobe-3.0 EPSF-3.0\n");
-
- /* The "BoundingBox" comment is required for EPS files. */
- Blt_Ps_Format(ps, "%%%%BoundingBox: %d %d %d %d\n",
- setupPtr->left, setupPtr->paperHeight - setupPtr->top,
- setupPtr->right, setupPtr->paperHeight - setupPtr->bottom);
- Blt_Ps_Append(ps, "%%Pages: 0\n");
-
- version = Tcl_GetVar(interp, "blt_version", TCL_GLOBAL_ONLY);
- if (version == NULL) {
- version = "???";
- }
- Blt_Ps_Format(ps, "%%%%Creator: (BLT %s Picture)\n", version);
-
- ticks = time((time_t *) NULL);
- strcpy(date, ctime(&ticks));
- newline = date + strlen(date) - 1;
- if (*newline == '\n') {
- *newline = '\0';
- }
- Blt_Ps_Format(ps, "%%%%CreationDate: (%s)\n", date);
- Blt_Ps_Append(ps, "%%DocumentData: Clean7Bit\n");
- if (setupPtr->flags & PS_LANDSCAPE) {
- Blt_Ps_Append(ps, "%%Orientation: Landscape\n");
- } else {
- Blt_Ps_Append(ps, "%%Orientation: Portrait\n");
- }
- AddComments(ps, setupPtr->comments);
- Blt_Ps_Append(ps, "%%EndComments\n\n");
- Blt_Ps_Append(ps, "%%BeginProlog\n");
- Blt_Ps_Append(ps, "%%EndProlog\n");
- Blt_Ps_Append(ps, "%%BeginSetup\n");
- Blt_Ps_Append(ps, "gsave\n");
- /*
- * Set the conversion from PostScript to X11 coordinates. Scale pica to
- * pixels and flip the y-axis (the origin is the upperleft corner).
- */
- Blt_Ps_VarAppend(ps,
- "% Transform coordinate system to use X11 coordinates\n"
- "% 1. Flip y-axis over by reversing the scale,\n", (char *)NULL);
- Blt_Ps_Append(ps, "1 -1 scale\n");
- Blt_Ps_VarAppend(ps,
- "% 2. Translate the origin to the other side of the page,\n"
- "% making the origin the upper left corner\n", (char *)NULL);
- Blt_Ps_Format(ps, "0 %d translate\n\n", -setupPtr->paperHeight);
- Blt_Ps_VarAppend(ps, "% User defined page layout\n\n",
- "% Set color level\n", (char *)NULL);
- Blt_Ps_Format(ps, "%% Set origin\n%d %d translate\n\n",
- setupPtr->left, setupPtr->bottom);
- if (setupPtr->flags & PS_LANDSCAPE) {
- Blt_Ps_Format(ps,
- "%% Landscape orientation\n0 %g translate\n-90 rotate\n",
- ((double)srcPtr->width * setupPtr->scale));
- }
- if (setupPtr->scale != 1.0f) {
- Blt_Ps_Append(ps, "\n% Setting picture scale factor\n");
- Blt_Ps_Format(ps, " %g %g scale\n", setupPtr->scale, setupPtr->scale);
- }
- Blt_Ps_Append(ps, "\n%%EndSetup\n\n");
- return TCL_OK;
-}
-
-
-static char *
-PbmComment(char *bp)
-{
- char *p;
-
- p = bp;
- if (*p == '#') {
- /* Comment: file end of line */
- while((*p != '\n') && (p != '\0')) {
- p++;
- }
- }
- return p;
-}
-
-static inline int
-PbmGetShort(unsigned char *bp) {
- return (bp[0] << 8) + bp[1];
-}
-
-static Picture *
-PbmRawData(Pbm *pbmPtr)
-{
- Picture *destPtr;
-
- destPtr = Blt_CreatePicture(pbmPtr->width, pbmPtr->height);
- switch (pbmPtr->bitsPerPixel) {
- case 1:
- {
- /* Monochrome */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- int x;
- Blt_Pixel *dp;
-
- dp = destRowPtr;
- for (x = 0; x < pbmPtr->width; x++) {
- dp->Red = dp->Green = dp->Blue = (GetBit(x)) ? 0xFF : 0;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- case 8:
- {
- /* Greyscale (1 byte) */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- sp++, dp++) {
- dp->Red = dp->Green = dp->Blue = *sp;
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- case 16:
- {
- /* Greyscale (2 bytes) */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- sp += 2, dp++) {
- unsigned int value;
-
- value = PbmGetShort(sp);
- dp->Red = dp->Green = dp->Blue = div257(value);
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- case 24:
- {
- /* Color (1 byte per color component) */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- sp += 3, dp++) {
- dp->Red = sp[0];
- dp->Green = sp[1];
- dp->Blue = sp[2];
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- case 48:
- {
- /* Color (2 bytes per color component) */
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = pbmPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < pbmPtr->height; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- sp += 6, dp++) {
- unsigned int r, g, b;
-
- r = PbmGetShort(sp);
- g = PbmGetShort(sp+2);
- b = PbmGetShort(sp+4);
- dp->Red = div257(r);
- dp->Green = div257(g);
- dp->Blue = div257(b);
- dp->Alpha = ALPHA_OPAQUE;
- }
- srcRowPtr += pbmPtr->bytesPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- }
- }
- Blt_DBuffer_SetPointer(pbmPtr->dbuffer, pbmPtr->data +
- (pbmPtr->height * pbmPtr->bytesPerRow));
- return destPtr;
-}
-
-static Blt_Picture
-PbmToPicture(Tcl_Interp *interp, Blt_DBuffer dbuffer)
-{
- char *bp, *p;
- const char *type;
- int isRaw;
- int version;
- size_t size, want;
- unsigned char *start;
- Pbm pbm;
-
- size = Blt_DBuffer_BytesLeft(dbuffer);
- start = Blt_DBuffer_Pointer(dbuffer);
- if (size < 14) {
- Tcl_AppendResult(interp, "can't read PBM bitmap: short file",
- (char *)NULL);
- return NULL;
- }
- bp = (char *)start;
- if ((bp[0] != 'P') || (bp[1] < '1') || (bp[1] > '6')) {
- Tcl_AppendResult(interp, "unknown PBM bitmap header", (char *)NULL);
- return NULL;
- }
- version = bp[1] - '0';
- isRaw = (version > 2);
- switch(version) {
- case PBM_PLAIN: /* P2 */
- case PBM_RAW: /* P5 */
- pbm.bitsPerPixel = 8;
- break;
- case PGM_PLAIN: /* P1 */
- case PGM_RAW: /* P4 */
- pbm.bitsPerPixel = 1;
- break;
- case PPM_PLAIN: /* P3 */
- case PPM_RAW: /* P6 */
- pbm.bitsPerPixel = 24;
- break;
- }
- if (!isspace(bp[2])) {
- type = pbmFormat[version];
- Tcl_AppendResult(interp, "no white space after version in pbm header.",
- (char *)NULL);
- return NULL;
- }
- p = bp + 3;
- if (*p == '#') {
- p = PbmComment(p);
- }
- pbm.width = strtoul(p, &p, 10);
- if (pbm.width == 0) {
- Tcl_AppendResult(interp, "bad width specification ", bp+3, ".",
- (char *)NULL);
- return NULL;
- }
- if (!isspace(*p)) {
- Tcl_AppendResult(interp, "no white space after width in pbm header.",
- (char *)NULL);
- return NULL;
- }
- p++;
- if (*p == '#') {
- p = PbmComment(p);
- }
- pbm.height = strtoul(p, &p, 10);
- if (pbm.height == 0) {
- Tcl_AppendResult(interp, "bad height specification", (char *)NULL);
- return NULL;
- }
- if (!isspace(*p)) {
- Tcl_AppendResult(interp, "no white space after height in header.",
- (char *)NULL);
- return NULL;
- }
- p++;
- if (*p == '#') {
- p = PbmComment(p);
- }
- if (pbm.bitsPerPixel != 1) {
- unsigned int maxval; /* Maximum intensity allowed. */
-
- maxval = strtoul(p, &p, 10);
- if (maxval == 0) {
- Tcl_AppendResult(interp, "bad maxval specification", (char *)NULL);
- return NULL;
- }
- if (!isspace(*p)) {
- Tcl_AppendResult(interp, "no white space after maxval pbm header.",
- (char *)NULL);
- return NULL;
- }
- p++;
- if (*p == '#') {
- p = PbmComment(p);
- }
- if (maxval >= USHRT_MAX) {
- Tcl_AppendResult(interp, "invalid maxval specification",
- (char *)NULL);
- return NULL;
- }
- if (maxval > 255) {
- pbm.bitsPerPixel <<= 1; /* 16-bit greyscale or 48 bit color. */
- }
- }
- pbm.data = (unsigned char *)p;
- pbm.dbuffer = dbuffer;
- pbm.bytesPerRow = ((pbm.bitsPerPixel * pbm.width) + 7) / 8;
- want = (pbm.data - start) + pbm.height * pbm.bytesPerRow;
- if ((isRaw) && (want > Blt_DBuffer_BytesLeft(dbuffer))) {
- Tcl_AppendResult(interp, "short pbm file", (char *)NULL);
- return NULL;
- }
- if (!isRaw) {
- Tcl_AppendResult(interp, "expected raw pbm file", (char *)NULL);
- return NULL;
- }
- return PbmRawData(&pbm);
-}
-
-#ifdef WIN32
-
-typedef struct {
- int fd;
- Blt_DBuffer dbuffer;
- int lastError;
-} PsWriter;
-
-/*
- *---------------------------------------------------------------------------
- *
- * WriteBufferProc --
- *
- * This function runs in a separate thread and write the data
- * buffer as input to the ghostscript process.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Writes the buffer (PostScript file) to the ghostscript standard
- * input file descriptor.
- *
- *---------------------------------------------------------------------------
- */
-static DWORD WINAPI
-WriteBufferProc(void *clientData)
-{
- PsWriter *writerPtr = clientData;
- const unsigned char *bp;
- int bytesLeft;
- HANDLE hFile;
- DWORD count;
-
- hFile = (HANDLE)writerPtr->fd;
- bp = Blt_DBuffer_Bytes(writerPtr->dbuffer);
- for (bytesLeft = Blt_DBuffer_Length(writerPtr->dbuffer); bytesLeft > 0;
- bytesLeft -= count) {
- if (!WriteFile(hFile, bp, bytesLeft, &count, NULL)) {
- writerPtr->lastError = GetLastError();
- break;
- }
- bp += count;
- }
- Blt_DBuffer_Destroy(writerPtr->dbuffer);
- CloseHandle(hFile);
- if (bytesLeft > 0) {
- ExitThread(1);
- }
- ExitThread(0);
- /* NOTREACHED */
- return 0;
-}
-
-static PsWriter writer;
-
-static int
-WriteToGhostscript(Tcl_Interp *interp, int fd, Blt_DBuffer dbuffer)
-{
- HANDLE hThread;
- ClientData clientData;
- DWORD id;
-
- writer.dbuffer = Blt_DBuffer_Create();
- Blt_DBuffer_Init(writer.dbuffer);
- /* Copy the input to a new buffer. */
- Blt_DBuffer_AppendData(writer.dbuffer,
- Blt_DBuffer_Bytes(dbuffer),
- Blt_DBuffer_Length(dbuffer));
- writer.fd = fd;
- writer.lastError = 0;
- clientData = &writer;
- hThread = CreateThread(
- NULL, /* Security attributes */
- 8000, /* Initial stack size. */
- WriteBufferProc, /* Address of thread routine */
- clientData, /* One-word of data passed to routine. */
- 0, /* Creation flags */
- &id); /* (out) Will contain Id of new thread. */
- return (int)hThread;
-}
-
-
-static int
-ReadFromGhostscript(Tcl_Interp *interp, int fd, Blt_DBuffer dbuffer)
-{
- DWORD nBytes;
- HANDLE hFile;
- int result;
-
- Blt_DBuffer_Free(dbuffer);
- hFile = (HANDLE)fd;
- nBytes = 0;
- for (;;) {
- DWORD nRead;
- char *bp;
-
- bp = Blt_DBuffer_Extend(dbuffer, BUFFER_SIZE);
- if (!ReadFile(hFile, bp, BUFFER_SIZE, &nRead, NULL)) {
- DWORD err;
-
- err = GetLastError();
- if ((err != ERROR_BROKEN_PIPE) && (err != ERROR_HANDLE_EOF)) {
- Tcl_AppendResult(interp, "error reading from ghostscript: ",
- Blt_PrintError(err), (char *)NULL);
- result = TCL_ERROR;
- break;
- }
- }
- if (nRead == 0) {
- result = TCL_OK;
- break; /* EOF */
- }
- nBytes += nRead;
- Blt_DBuffer_SetLength(dbuffer, nBytes);
- }
- Blt_DBuffer_SetLength(dbuffer, nBytes);
- CloseHandle(hFile);
- return result;
-}
-
-#else /* WIN32 */
-
-static int
-WriteToGhostscript(Tcl_Interp *interp, int fd, Blt_DBuffer dbuffer)
-{
- pid_t child;
-
- child = fork();
- if (child == -1) {
- Tcl_AppendResult(interp, "can't fork process: ", Tcl_PosixError(interp),
- (char *)NULL);
- return 0;
- } else if (child > 0) {
- close(fd);
- return child;
- } else {
- const char *bytes;
- int nWritten, nBytes;
-
- bytes = (const char *)Blt_DBuffer_Bytes(dbuffer);
- nBytes = Blt_DBuffer_Length(dbuffer);
- nWritten = write(fd, bytes, nBytes);
- close(fd);
- if (nWritten != nBytes) {
- exit(1);
- }
- exit(0);
- }
-}
-
-static int
-ReadFromGhostscript(Tcl_Interp *interp, int fd, Blt_DBuffer dbuffer)
-{
- int nBytes;
-
- Blt_DBuffer_Free(dbuffer);
- nBytes = 0;
- for (;;) {
- char *bp;
- int nRead;
-
- bp = (char *)Blt_DBuffer_Extend(dbuffer, BUFFER_SIZE);
- nRead = read(fd, bp, BUFFER_SIZE);
- if (nRead == 0) {
- break; /* EOF */
- } else if (nRead < 0) {
- Tcl_AppendResult(interp, "error reading from ghostscript: ",
- Tcl_PosixError(interp), (char *)NULL);
- return TCL_ERROR;
- }
-
- nBytes += nRead;
- Blt_DBuffer_SetLength(dbuffer, nBytes);
- }
- Blt_DBuffer_SetLength(dbuffer, nBytes);
- close(fd);
- return TCL_OK;
-}
-
-#endif /* WIN32 */
-
-static int
-PsToPbm(
- Tcl_Interp *interp,
- const char *fileName,
- Blt_DBuffer dbuffer,
- PsImportSwitches *switchesPtr)
-{
- int in, out; /* File descriptors for ghostscript
- * subprocess. */
- char string1[200];
- char string2[200];
- int nPids;
- ProcessId *pidPtr;
- int result;
- pid_t child;
- const char **p;
- const char *args[] = {
- "gs", /* Ghostscript command */
- "-dEPSCrop", /* (optional) crop page to bbox */
- "-dSAFER", /* */
- "-q", /* Quiet mode. No GS messages. */
- "-sDEVICE=ppmraw", /* Format is PPM raw */
- "-dBATCH", /* Batch mode. No "quit" necessary. */
- "-sPAPERSIZE=letter", /* (optional) Specify paper size. */
- "-r100x100", /* (optional) Specify DPI of X screen */
- "-dNOPAUSE", /* */
- "-sOutputFile=-", /* Output file is stdout. */
- "-",
- NULL
- };
-
- args[1] = (switchesPtr->crop) ? "-dEPSCrop" : "-dSAFER";
- {
- Tk_Window tkwin;
- unsigned int xdpi, ydpi;
-
- tkwin = Tk_MainWindow(interp);
- if (switchesPtr->dpi > 0) {
- xdpi = ydpi = switchesPtr->dpi;
- } else {
- Blt_ScreenDPI(tkwin, &xdpi, &ydpi);
- }
- sprintf(string1, "-r%dx%d", xdpi, ydpi);
- args[7] = string1;
- }
- if (switchesPtr->paperSize != NULL) {
- sprintf(string2, "-sPAPERSIZE=%s", switchesPtr->paperSize);
- args[6] = string2;
- }
- {
- int i;
- Tcl_Obj *objv[11];
- int objc = 11;
-
- for (i = 0, p = args; *p != NULL; p++, i++) {
- objv[i] = Tcl_NewStringObj(*p, -1);
- Tcl_IncrRefCount(objv[i]);
- }
- nPids = Blt_CreatePipeline(interp, objc, objv, &pidPtr, &in, &out,
- (int *)NULL);
- for (i = 0; i < objc; i++) {
- Tcl_DecrRefCount(objv[i]);
- }
- }
- if (nPids < 0) {
- return TCL_ERROR;
- }
- Tcl_DetachPids(nPids, (Tcl_Pid *)pidPtr);
- child = WriteToGhostscript(interp, in, dbuffer);
- if (child == 0) {
- return TCL_ERROR;
- }
- result = ReadFromGhostscript(interp, out, dbuffer);
-#ifdef WIN32
- CloseHandle((HANDLE)child);
-#endif
- Tcl_ReapDetachedProcs();
-#ifdef notdef
- Blt_DBuffer_SaveFile(interp, "junk.ppm", dbuffer);
-#endif
- if (result != TCL_OK) {
- Blt_DBuffer_Free(dbuffer);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static Blt_Chain
-PsToPicture(
- Tcl_Interp *interp,
- const char *fileName,
- Blt_DBuffer dbuffer,
- PsImportSwitches *switchesPtr)
-{
- Blt_Chain chain;
-
- if (PsToPbm(interp, fileName, dbuffer, switchesPtr) != TCL_OK) {
- return NULL;
- }
- /* Can be more than one image in buffer. Save each picture in a list. */
- chain = Blt_Chain_Create();
- while (Blt_DBuffer_BytesLeft(dbuffer) > 0) {
- Blt_Picture picture;
-
- picture = PbmToPicture(interp, dbuffer);
- if (picture == NULL) {
- Blt_Chain_Destroy(chain);
- return NULL;
- }
- Blt_Chain_Append(chain, picture);
- }
- return chain;
-}
-
-static int
-PictureToPs(Tcl_Interp *interp, Blt_Picture original, Blt_Ps ps,
- PsExportSwitches *switchesPtr)
-{
- Picture *srcPtr;
- int w, h;
-
- srcPtr = original;
- w = srcPtr->width, h = srcPtr->height;
- Blt_Ps_ComputeBoundingBox(&switchesPtr->setup, w, h);
- if (PostScriptPreamble(interp, srcPtr, switchesPtr, ps) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_ClassifyPicture(srcPtr);
- if (!Blt_PictureIsOpaque(srcPtr)) {
- Blt_Picture background;
-
- background = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- Blt_BlankPicture(background, &switchesPtr->bg);
- Blt_BlendPictures(background, srcPtr, 0, 0, srcPtr->width,
- srcPtr->height, 0, 0);
- srcPtr = background;
- }
- if (srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) {
- Blt_UnassociateColors(srcPtr);
- }
- Blt_Ps_Rectangle(ps, 0, 0, srcPtr->width, srcPtr->height);
- Blt_Ps_Append(ps, "gsave clip\n\n");
- Blt_Ps_DrawPicture(ps, srcPtr, 0, 0);
- Blt_Ps_VarAppend(ps, "\n",
- "% Unset clipping\n",
- "grestore\n\n", (char *)NULL);
- Blt_Ps_VarAppend(ps,
- "showpage\n",
- "%Trailer\n",
- "grestore\n",
- "end\n",
- "%EOF\n", (char *)NULL);
- if (srcPtr != original) {
- Blt_Free(srcPtr);
- }
- return TCL_OK;
-}
-
-static int
-IsPs(Blt_DBuffer dbuffer)
-{
- unsigned char *bp;
-
- Blt_DBuffer_ResetCursor(dbuffer);
- if (Blt_DBuffer_BytesLeft(dbuffer) < 4) {
- return FALSE;
- }
- bp = Blt_DBuffer_Pointer(dbuffer);
- return (strncmp("%!PS", (char *)bp, 4) == 0);
-}
-
-static Blt_Chain
-ReadPs(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer)
-{
- Blt_Chain chain;
- PsImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- switches.crop = TRUE;
- chain = PsToPicture(interp, fileName, dbuffer, &switches);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return chain;
-}
-
-static Tcl_Obj *
-WritePs(Tcl_Interp *interp, Blt_Picture picture)
-{
- Blt_Ps ps;
- PsExportSwitches switches;
- Tcl_Obj *objPtr;
- int result;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF; /* Default bgcolor is white. */
- switches.setup.reqPaperHeight = 792; /* 11 inches */
- switches.setup.reqPaperWidth = 612; /* 8.5 inches */
- switches.setup.level = 1;
- switches.setup.xPad.side1 = 72;
- switches.setup.xPad.side2 = 72;
- switches.setup.yPad.side1 = 72;
- switches.setup.yPad.side2 = 72;
- switches.setup.flags = 0;
- ps = Blt_Ps_Create(interp, &switches.setup);
- result = PictureToPs(interp, picture, ps, &switches);
- objPtr = NULL;
- if (result == TCL_OK) {
- const char *string;
- int length;
-
- string = Blt_Ps_GetValue(ps, &length);
- objPtr = Tcl_NewStringObj(string, length);
- }
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- Blt_Ps_Free(ps);
- return objPtr;
-}
-
-static Blt_Chain
-ImportPs(
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv,
- const char **fileNamePtr)
-{
- Blt_Chain chain;
- Blt_DBuffer dbuffer;
- PsImportSwitches switches;
- const char *string;
-
- memset(&switches, 0, sizeof(switches));
- switches.crop = TRUE;
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return NULL;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one import source: ",
- "use only one -file or -data flag.", (char *)NULL);
- return NULL;
- }
- chain = NULL;
- dbuffer = Blt_DBuffer_Create();
- if (switches.dataObjPtr != NULL) {
- int nBytes;
-
- string = Tcl_GetStringFromObj(switches.dataObjPtr, &nBytes);
- Blt_DBuffer_AppendData(dbuffer, (unsigned char *)string, nBytes);
- string = "data buffer";
- *fileNamePtr = NULL;
- } else {
- string = Tcl_GetString(switches.fileObjPtr);
- if (Blt_DBuffer_LoadFile(interp, string, dbuffer) != TCL_OK) {
- Blt_DBuffer_Destroy(dbuffer);
- return NULL;
- }
- *fileNamePtr = string;
- }
- chain = PsToPicture(interp, string, dbuffer, &switches);
- Blt_DBuffer_Destroy(dbuffer);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return chain;
-}
-
-static int
-ExportPs(Tcl_Interp *interp, unsigned int index, Blt_Chain chain, int objc,
- Tcl_Obj *const *objv)
-{
- PsExportSwitches switches;
- Blt_Ps ps;
- int result;
- Blt_Picture picture;
-
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF; /* Default bgcolor is white. */
- switches.setup.reqPaperHeight = 792; /* 11 inches */
- switches.setup.reqPaperWidth = 612; /* 8.5 inches */
- switches.setup.level = 1;
- switches.setup.xPad.side1 = 72;
- switches.setup.xPad.side2 = 72;
- switches.setup.yPad.side1 = 72;
- switches.setup.yPad.side2 = 72;
- switches.setup.flags = 0;
- switches.index = index;
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one export destination: ",
- "use only one -file or -data switch.", (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- picture = Blt_GetNthPicture(chain, switches.index);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "no picture at index ",
- Blt_Itoa(switches.index), (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- ps = Blt_Ps_Create(interp, &switches.setup);
- result = PictureToPs(interp, picture, ps, &switches);
- if (result != TCL_OK) {
- Tcl_AppendResult(interp, "can't convert \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- goto error;
- }
- if (switches.fileObjPtr != NULL) {
- char *fileName;
-
- fileName = Tcl_GetString(switches.fileObjPtr);
- result = Blt_Ps_SaveFile(interp, ps, fileName);
- } else if (switches.dataObjPtr != NULL) {
- Tcl_Obj *objPtr;
- int length;
- const char *string;
-
- string = Blt_Ps_GetValue(ps, &length);
- objPtr = Tcl_NewStringObj(string, length);
- objPtr = Tcl_ObjSetVar2(interp, switches.dataObjPtr, NULL, objPtr, 0);
- result = (objPtr == NULL) ? TCL_ERROR : TCL_OK;
- } else {
- const char *string;
- int length;
-
- string = Blt_Ps_GetValue(ps, &length);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), string, length);
- }
- error:
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- Blt_Ps_Free(ps);
- return result;
-}
-
-int
-Blt_PicturePsInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_extra", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_picture_ps", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_PictureRegisterFormat(interp,
- "ps", /* Name of format. */
- IsPs, /* Discovery routine. */
- ReadPs, /* Import format procedure. */
- WritePs, /* Export format procedure. */
- ImportPs, /* Import format procedure. */
- ExportPs); /* Export format procedure. */
-}
diff --git a/blt3.0.1/src/bltPictTif.c b/blt3.0.1/src/bltPictTif.c
deleted file mode 100644
index c72ccdc..0000000
--- a/blt3.0.1/src/bltPictTif.c
+++ /dev/null
@@ -1,874 +0,0 @@
-
-/*
- * bltPictTif.c --
- *
- * This module implements TIF file format conversion routines for the picture
- * image type in the BLT toolkit.
- *
- * Copyright 2003-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include "blt.h"
-
-#include "config.h"
-#ifdef HAVE_LIBTIF
-#include <tcl.h>
-#include <bltSwitch.h>
-#include <bltDBuffer.h>
-#include <bltHash.h>
-#include <bltChain.h>
-#include "bltPicture.h"
-#include "bltPictFmts.h"
-#include <bltAlloc.h>
-
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif /* HAVE_MEMORY_H */
-
-#if defined(WIN32) || defined(MACOSX)
-#include <setjmp.h>
-#endif
-
-typedef struct _Blt_Picture Picture;
-
-#include <tiffio.h>
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- int compress;
- int index;
-} TifExportSwitches;
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
-} TifImportSwitches;
-
-static Blt_SwitchParseProc CompressSwitch;
-static Blt_SwitchCustom compressSwitch = {
- CompressSwitch, NULL, (ClientData)0,
-};
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-compress", "type",
- Blt_Offset(TifExportSwitches, compress), 0, 0, &compressSwitch},
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(TifExportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(TifExportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_INT_NNEG, "-index", "int",
- Blt_Offset(TifExportSwitches, index), 0},
- {BLT_SWITCH_END}
-};
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(TifImportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(TifImportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_END}
-};
-
-DLLEXPORT extern Tcl_AppInitProc Blt_PictureTifInit;
-extern const char *Blt_Itoa(int);
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * CompressSwitch --
- *
- * Convert a Tcl_Obj representing a TIFF compression name.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static const char *compressNames[] = {
- "lzw", /* Lempel-Ziv & Welch */
- "ojpeg", /* !6.0 JPEG */
- "jpeg", /* %JPEG DCT compression */
- "next", /* NeXT 2-bit RLE */
- "packbits", /* Macintosh RLE */
- "thunderscan", /* ThunderScan RLE */
- "pixarfilm", /* Pixar companded 10bit LZW */
- "pixarlog", /* Pixar companded 11bit ZIP */
- "deflate", /* Deflate compression */
- "adobe_deflate", /* Adobe's deflate */
- "dcs", /* Kodak DCS encoding */
- "sgilog", /* SGI Log Luminance RLE */
- "sgilog24", /* SGI Log 24-bit packed */
- NULL
-};
-
-static int nCompressNames = sizeof(compressNames) / sizeof(char *);
-
-/*ARGSUSED*/
-static int
-CompressSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to return results. */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int *compressPtr = (int *)(record + offset);
- int i;
- char *string;
- char c;
-
- string = Tcl_GetString(objPtr);
- c = string[0];
- if (c == '\0') {
- *compressPtr = 0;
- return TCL_OK;
- }
- for (i = 0; i < nCompressNames; i++) {
- if ((c == compressNames[i][0]) &&
- (strcasecmp(string, compressNames[i]) == 0)) {
- *compressPtr = i + 1;
- return TCL_OK;
- }
- }
- Tcl_AppendResult(interp, "unknown TIFF compression mode \"", string, "\"",
- (char *) NULL);
- return TCL_ERROR;
-}
-
-
-static tsize_t
-TifRead(thandle_t handle, tdata_t out, tsize_t nWanted)
-{
- Blt_DBuffer dbuffer = (Blt_DBuffer)handle;
-
- if (Blt_DBuffer_BytesLeft(dbuffer) < nWanted) {
- nWanted = Blt_DBuffer_BytesLeft(dbuffer);
- }
- if (nWanted > 0) {
- memcpy(out, Blt_DBuffer_Pointer(dbuffer), nWanted);
- Blt_DBuffer_IncrCursor(dbuffer, nWanted);
- }
- return nWanted;
-}
-
-static toff_t
-TifSeek(thandle_t handle, toff_t offset, int whence)
-{
- Blt_DBuffer dbuffer = (Blt_DBuffer)handle;
-
- if (whence == SEEK_CUR) {
- offset += Blt_DBuffer_Cursor(dbuffer);
- } else if (whence == SEEK_END) {
- offset += Blt_DBuffer_Length(dbuffer);
- }
- if (offset < 0) {
- return -1;
- }
- if (offset > Blt_DBuffer_Size(dbuffer)) {
- /* Attempting to seek past the end of the current
- * buffer. Resize the buffer */
- Blt_DBuffer_Resize(dbuffer, offset);
- }
- Blt_DBuffer_SetCursor(dbuffer, offset);
- return (toff_t) Blt_DBuffer_Cursor(dbuffer);
-}
-
-static toff_t
-TifSize(thandle_t handle)
-{
- Blt_DBuffer dbuffer = (Blt_DBuffer)handle;
-
- return Blt_DBuffer_Length(dbuffer);
-}
-
-static int
-TifMapFile(thandle_t handle, tdata_t *data, toff_t *offsetPtr)
-{
- return 0;
-}
-
-static void
-TifUnmapFile(thandle_t handle, tdata_t data, toff_t offset)
-{
-}
-
-static int
-TifClose(thandle_t handle)
-{
- return 0;
-}
-
-
-static tsize_t
-TifWrite(thandle_t handle, tdata_t out, tsize_t nBytes)
-{
- Blt_DBuffer dbuffer = (Blt_DBuffer)handle;
- unsigned int needed;
-
- needed = Blt_DBuffer_Cursor(dbuffer) + nBytes;
- if (needed > Blt_DBuffer_Size(dbuffer)) {
- if (!Blt_DBuffer_Resize(dbuffer, needed)) {
- return -1;
- }
- }
- memcpy(Blt_DBuffer_Pointer(dbuffer), out, nBytes);
- Blt_DBuffer_IncrCursor(dbuffer, nBytes);
- if (Blt_DBuffer_Cursor(dbuffer) > Blt_DBuffer_Length(dbuffer)) {
- Blt_DBuffer_SetLength(dbuffer, Blt_DBuffer_Cursor(dbuffer));
- }
- return nBytes;
-}
-
-typedef struct {
- Tcl_DString errors;
- Tcl_DString warnings;
- int nWarnings, nErrors;
-} TifMessage;
-
-static TifMessage *tifMessagePtr;
-
-static void
-TifError(const char *routine, const char *fmt, va_list ap)
-{
- char string[BUFSIZ+4];
- int length;
-
- length = vsnprintf(string, BUFSIZ, fmt, ap);
- if (length > BUFSIZ) {
- strcat(string, "...");
- }
- Tcl_DStringAppend(&tifMessagePtr->errors, string, -1);
- tifMessagePtr->nErrors++;
-}
-
-/* warnings are not processed in TCL */
-static void
-TifWarning(const char *routine, const char *fmt, va_list ap)
-{
- char string[BUFSIZ+4];
- int length;
-
- length = vsnprintf(string, BUFSIZ, fmt, ap);
- if (length > BUFSIZ) {
- strcat(string, "...");
- }
- Tcl_DStringAppend(&tifMessagePtr->warnings, string, -1);
- Tcl_DStringAppend(&tifMessagePtr->warnings, "\n", -1);
- tifMessagePtr->nWarnings++;
-}
-
-static int
-TifReadImage(Tcl_Interp *interp, TIFF *tifPtr, Blt_Chain chain)
-{
- int w, h, nPixels;
- uint32 *srcBits, *sp;
- Picture *destPtr;
- Blt_Pixel *destRowPtr;
- int y;
-
- TIFFGetField(tifPtr, TIFFTAG_IMAGEWIDTH, &w);
- TIFFGetField(tifPtr, TIFFTAG_IMAGELENGTH, &h);
- nPixels = w * h;
- srcBits = _TIFFmalloc(sizeof(uint32) * nPixels);
- if (srcBits == NULL) {
- Tcl_AppendResult(interp, "can't allocate ", Blt_Itoa(nPixels),
- " buffer for TIF image", (char *)NULL);
- return TCL_ERROR;
- }
- if (!TIFFReadRGBAImage(tifPtr, w, h, srcBits, /*stopOnError*/0)) {
- Tcl_AppendResult(interp, "can't read image in directory",
- (char *)NULL);
- _TIFFfree(srcBits);
- return TCL_ERROR;
- }
- destPtr = Blt_CreatePicture(w, h);
- destRowPtr = destPtr->bits + (destPtr->pixelsPerRow * (h - 1));
- sp = srcBits;
- for (y = h - 1; y >= 0; y--) {
- Blt_Pixel *dp, *dend;
-
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- dp->Red = TIFFGetR(*sp);
- dp->Green = TIFFGetG(*sp);
- dp->Blue = TIFFGetB(*sp);
- dp->Alpha = TIFFGetA(*sp);
- sp++;
- }
- destRowPtr -= destPtr->pixelsPerRow;
- }
- Blt_Chain_Append(chain, destPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsTif --
- *
- * Attempts to parse a TIF file header.
- *
- * Results:
- * Returns 1 is the header is TIF and 0 otherwise. Note that the
- * validity of the header contents is not checked here. That's done in
- * TifToPicture.
- *
- *---------------------------------------------------------------------------
- */
-static int
-IsTif(Blt_DBuffer dbuffer)
-{
- unsigned char *bp;
- int bool;
-
- Blt_DBuffer_ResetCursor(dbuffer);
- bp = Blt_DBuffer_Pointer(dbuffer);
- bool = (((bp[0] == 'M') && (bp[1] == 'M')) ||
- ((bp[0] == 'I') && (bp[1] == 'I')));
- return bool;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TifToPicture --
- *
- * Reads a TIFF file and converts it into a picture.
- *
- * Results:
- * The picture is returned. If an error occured, such as the
- * designated file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-TifToPicture(
- Tcl_Interp *interp,
- const char *fileName,
- Blt_DBuffer dbuffer,
- TifImportSwitches *switchesPtr)
-{
- Blt_Chain chain;
- TIFF *tifPtr;
- TIFFErrorHandler oldErrorHandler, oldWarningHandler;
- TifMessage message;
-
- message.nWarnings = message.nErrors = 0;
- Tcl_DStringInit(&message.errors);
- Tcl_DStringInit(&message.warnings);
- Tcl_DStringAppend(&message.errors, "error reading \"", -1);
- Tcl_DStringAppend(&message.errors, fileName, -1);
- Tcl_DStringAppend(&message.errors, "\": ", -1);
- tifMessagePtr = &message;
-
- oldErrorHandler = TIFFSetErrorHandler(TifError);
- oldWarningHandler = TIFFSetWarningHandler(TifWarning);
-
- chain = NULL;
- tifPtr = TIFFClientOpen(fileName, "r", (thandle_t)dbuffer,
- TifRead, /* TIFFReadProc */
- TifWrite, /* TIFFWriteProc */
- TifSeek, /* TIFFSeekProc */
- TifClose, /* TIFFCloseProc */
- TifSize, /* TIFFSizeProc */
- TifMapFile, /* TIFFMapFileProc */
- TifUnmapFile); /* TIFFUnmapFileProc */
- if (tifPtr == NULL) {
- goto bad;
- }
- chain = Blt_Chain_Create();
- do {
- if (TifReadImage(interp, tifPtr, chain) != TCL_OK) {
- goto bad;
- }
- } while (TIFFReadDirectory(tifPtr));
- bad:
- if (tifPtr != NULL) {
- TIFFClose(tifPtr);
- }
- TIFFSetErrorHandler(oldErrorHandler);
- TIFFSetWarningHandler(oldWarningHandler);
- if (message.nWarnings > 0) {
- Tcl_SetErrorCode(interp, "PICTURE", "TIF_READ_WARNINGS",
- Tcl_DStringValue(&message.warnings), (char *)NULL);
- } else {
- Tcl_SetErrorCode(interp, "NONE", (char *)NULL);
- }
- Tcl_DStringFree(&message.warnings);
- if (message.nErrors > 0) {
- Tcl_AppendResult(interp, Tcl_DStringValue(&message.errors),
- (char *)NULL);
- }
- Tcl_DStringFree(&message.errors);
- return chain;
-}
-
-static int tifCompressionSchemes[] = {
- COMPRESSION_NONE,
-
-#ifdef LZW_SUPPORT
- COMPRESSION_LZW, /* Lempel-Ziv & Welch */
-#else
- COMPRESSION_NONE,
-#endif
-
-#ifdef OJPEG_SUPPORT
- COMPRESSION_OJPEG, /* !6.0 JPEG */
-#else
- COMPRESSION_NONE,
-#endif /* OJPEG_SUPPORT */
-
-#ifdef JPEG_SUPPORT
- COMPRESSION_JPEG, /* %JPEG DCT compression */
-#else
- COMPRESSION_NONE,
-#endif /* JPEG_SUPPORT */
-
-#ifdef NEXT_SUPPORT
- COMPRESSION_NEXT, /* NeXT 2-bit RLE */
-#else
- COMPRESSION_NONE,
-#endif /* NEXT_SUPPORT */
-
-#ifdef PACKBITS_SUPPORT
- COMPRESSION_PACKBITS, /* Macintosh RLE */
-#else
- COMPRESSION_NONE,
-#endif /* PACKBITS_SUPPORT */
-
-#ifdef THUNDER_SUPPORT
- COMPRESSION_THUNDERSCAN, /* ThunderScan RLE */
-#else
- COMPRESSION_NONE,
-#endif /* THUNDER_SUPPORT */
-
- COMPRESSION_PIXARFILM, /* Pixar 10-bit LZW */
-
-#ifdef PIXARLOG_SUPPORT
- COMPRESSION_PIXARLOG, /* Pixar 11-bit ZIP */
-#else
- COMPRESSION_NONE,
-#endif /* PIXARLOG_SUPPORT */
-
-#ifdef ZIP_SUPPORT
- COMPRESSION_DEFLATE, /* Deflate compression */
-#else
- COMPRESSION_NONE,
-#endif /* ZIP_SUPPORT */
-
-#ifdef ADOBE_SUPPORT
- COMPRESSION_ADOBE_DEFLATE, /* Adobe's deflate */
-#else
- COMPRESSION_NONE,
-#endif /* ADOBE_SUPPORT */
- COMPRESSION_DCS, /* Kodak DCS encoding */
-
-#ifdef SGILOG_SUPPORT
- COMPRESSION_SGILOG, /* SGI Log Luminance RLE */
- COMPRESSION_SGILOG24, /* SGI Log 24-bit packed */
-#else
- COMPRESSION_NONE,
- COMPRESSION_NONE,
-#endif /* SGILOG_SUPPORT */
-
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictureToTif --
- *
- * Writes a TIFF format image to the provided data buffer.
- *
- * Results:
- * A standard TCL result. If an error occured, TCL_ERROR is
- * returned and an error message will be place in the interpreter
- * result. Otherwise, the data sink will contain the binary
- * output of the image.
- *
- * Side Effects:
- * Memory is allocated for the data sink.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PictureToTif(Tcl_Interp *interp, Blt_Picture picture, Blt_DBuffer dbuffer,
- TifExportSwitches *switchesPtr)
-{
- TIFF *tifPtr;
- TIFFErrorHandler oldErrorHandler, oldWarningHandler;
- TifMessage message;
- int photometric, samplesPerPixel;
- int compress, result, nColors;
- Picture *srcPtr;
-
- compress = tifCompressionSchemes[switchesPtr->compress];
- if (compress == COMPRESSION_NONE) {
- fprintf(stderr, "not compressing TIFF output\n");
- }
-#ifdef notdef
- if (!TIFFIsCODECConfigured((unsigned short int)compress)) {
- compress = COMPRESSION_NONE;
- }
-#endif
- srcPtr = picture;
-
- Tcl_DStringInit(&message.errors);
- Tcl_DStringInit(&message.warnings);
- Tcl_DStringAppend(&message.errors, "error writing TIF output: ", -1);
- tifMessagePtr = &message;
- message.nErrors = message.nWarnings = 0;
-
- oldErrorHandler = TIFFSetErrorHandler(TifError);
- oldWarningHandler = TIFFSetWarningHandler(TifWarning);
-
- tifPtr = TIFFClientOpen("data buffer", "w", (thandle_t)dbuffer,
- TifRead, /* TIFFReadWriteProc */
- TifWrite, /* TIFFReadWriteProc */
- TifSeek, /* TIFFSeekProc */
- TifClose, /* TIFFCloseProc */
- TifSize, /* TIFFSizeProc */
- TifMapFile, /* TIFFMapFileProc */
- TifUnmapFile); /* TIFFUnmapFileProc */
- if (tifPtr == NULL) {
- Tcl_AppendResult(interp, "can't register TIF procs: ", (char *)NULL);
- return TCL_ERROR;
- }
- nColors = Blt_QueryColors(srcPtr, (Blt_HashTable *)NULL);
- if (Blt_PictureIsColor(srcPtr)) {
- samplesPerPixel = (Blt_PictureIsOpaque(srcPtr)) ? 3 : 4;
- photometric = PHOTOMETRIC_RGB;
- } else {
- if (!Blt_PictureIsOpaque(srcPtr)) {
- Blt_Picture background;
- Blt_Pixel white;
- /* Blend picture with solid color background. */
- background = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- white.u32 = 0xFFFFFFFF;
- Blt_BlankPicture(background, &white); /* White background. */
- Blt_BlendPictures(background, srcPtr, 0, 0, srcPtr->width,
- srcPtr->height, 0, 0);
- srcPtr = background;
- }
- samplesPerPixel = 1;
- photometric = PHOTOMETRIC_MINISBLACK;
- }
- TIFFSetField(tifPtr, TIFFTAG_BITSPERSAMPLE, 8);
- TIFFSetField(tifPtr, TIFFTAG_COMPRESSION, (unsigned short int)compress);
- TIFFSetField(tifPtr, TIFFTAG_IMAGELENGTH, srcPtr->height);
- TIFFSetField(tifPtr, TIFFTAG_IMAGEWIDTH, srcPtr->width);
- TIFFSetField(tifPtr, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
- TIFFSetField(tifPtr, TIFFTAG_PHOTOMETRIC, photometric);
- TIFFSetField(tifPtr, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
- TIFFSetField(tifPtr, TIFFTAG_RESOLUTIONUNIT, 2);
- TIFFSetField(tifPtr, TIFFTAG_ROWSPERSTRIP, srcPtr->height);
- TIFFSetField(tifPtr, TIFFTAG_SAMPLESPERPIXEL, samplesPerPixel);
- TIFFSetField(tifPtr, TIFFTAG_SOFTWARE, TIFFGetVersion());
- TIFFSetField(tifPtr, TIFFTAG_XRESOLUTION, 300.0f);
- TIFFSetField(tifPtr, TIFFTAG_YRESOLUTION, 300.0f);
-#ifdef WORD_BIGENDIAN
- TIFFSetField(tifPtr, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);
-#else
- TIFFSetField(tifPtr, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB);
-#endif
- result = -1;
- {
- Blt_Pixel *srcRowPtr;
- int destBitsSize;
- int y;
- unsigned char *destBits;
- unsigned char *dp;
-
- destBitsSize = srcPtr->width * srcPtr->height * sizeof(uint32);
- destBits = (unsigned char *)_TIFFmalloc(destBitsSize);
-
- if (destBits == NULL) {
- TIFFError("tiff", "can't allocate space for TIF buffer");
- TIFFClose(tifPtr);
- return TCL_ERROR;
- }
- dp = destBits;
- srcRowPtr = srcPtr->bits;
- switch (samplesPerPixel) {
- case 4:
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp;
- int x;
-
- sp = srcRowPtr;
- for (x = 0; x < srcPtr->width; x++) {
- dp[0] = sp->Red;
- dp[1] = sp->Green;
- dp[2] = sp->Blue;
- dp[3] = sp->Alpha;
- dp += 4, sp++;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
-
- case 3: /* RGB, 100% opaque image. */
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp;
- int x;
-
- sp = srcRowPtr;
- for (x = 0; x < srcPtr->width; x++) {
- dp[0] = sp->Red;
- dp[1] = sp->Green;
- dp[2] = sp->Blue;
- dp += 3, sp++;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
-
- case 1:
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp;
- int x;
-
- sp = srcRowPtr;
- for (x = 0; x < srcPtr->width; x++) {
- *dp++ = sp->Red;
- sp++;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
-
- }
- result = TIFFWriteEncodedStrip(tifPtr, 0, destBits, destBitsSize);
- if (result < 0) {
- Tcl_AppendResult(interp, "error writing TIFF encoded strip",
- (char *)NULL);
- }
- _TIFFfree(destBits);
- }
- TIFFClose(tifPtr);
- if (result == -1) {
- Blt_DBuffer_Free(dbuffer);
- }
- TIFFSetErrorHandler(oldErrorHandler);
- TIFFSetWarningHandler(oldWarningHandler);
- if (message.nWarnings > 0) {
- Tcl_SetErrorCode(interp, "PICTURE", "TIF_WRITE_WARNINGS",
- Tcl_DStringValue(&message.warnings), (char *)NULL);
- } else {
- Tcl_SetErrorCode(interp, "NONE", (char *)NULL);
- }
- Tcl_DStringFree(&message.warnings);
- if (message.nErrors > 0) {
- Tcl_DStringResult(interp, &message.errors);
- }
- Tcl_DStringFree(&message.errors);
- if (srcPtr != picture) {
- Blt_FreePicture(srcPtr);
- }
- return (result == -1) ? TCL_ERROR : TCL_OK;
-}
-
-
-static Blt_Chain
-ReadTif(Tcl_Interp *interp, const char *fileName, Blt_DBuffer dbuffer)
-{
- TifImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- return TifToPicture(interp, fileName, dbuffer, &switches);
-}
-
-static Tcl_Obj *
-WriteTif(Tcl_Interp *interp, Blt_Picture picture)
-{
- Tcl_Obj *objPtr;
- Blt_DBuffer dbuffer;
- TifExportSwitches switches;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- dbuffer = Blt_DBuffer_Create();
- objPtr = NULL;
- if (PictureToTif(interp, picture, dbuffer, &switches) == TCL_OK) {
- char *bytes;
-
- bytes = Blt_DBuffer_EncodeBase64(interp, dbuffer);
- if (bytes != NULL) {
- objPtr = Tcl_NewStringObj(bytes, -1);
- Blt_Free(bytes);
- }
- }
- Blt_DBuffer_Destroy(dbuffer);
- return objPtr;
-}
-
-static Blt_Chain
-ImportTif(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv,
- const char **fileNamePtr)
-{
- Blt_Chain chain;
- Blt_DBuffer dbuffer;
- TifImportSwitches switches;
- const char *string;
-
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one import source: ",
- "use only one -file or -data flag.", (char *)NULL);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- dbuffer = Blt_DBuffer_Create();
- chain = NULL;
- if (switches.dataObjPtr != NULL) {
- unsigned char *bytes;
- int nBytes;
-
- bytes = Tcl_GetByteArrayFromObj(switches.dataObjPtr, &nBytes);
- if (Blt_IsBase64(bytes, nBytes)) {
- if (Blt_DBuffer_DecodeBase64(interp, string, nBytes, dbuffer)
- != TCL_OK) {
- goto error;
- }
- } else {
- Blt_DBuffer_AppendData(dbuffer, bytes, nBytes);
- }
- string = "data buffer";
- *fileNamePtr = NULL;
- } else {
- string = Tcl_GetString(switches.fileObjPtr);
- *fileNamePtr = string;
- if (Blt_DBuffer_SaveFile(interp, string, dbuffer) != TCL_OK) {
- goto error;
- }
- }
- chain = TifToPicture(interp, string, dbuffer, &switches);
- error:
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(dbuffer);
- return chain;
-}
-
-static int
-ExportTif(Tcl_Interp *interp, unsigned int index, Blt_Chain chain, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_DBuffer dbuffer;
- Blt_Picture picture;
- TifExportSwitches switches;
- int result;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- switches.index = index;
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one export destination: ",
- "use only one -file or -data flag.", (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- picture = Blt_GetNthPicture(chain, switches.index);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "no picture at index ",
- Blt_Itoa(switches.index), (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- dbuffer = Blt_DBuffer_Create();
- result = PictureToTif(interp, picture, dbuffer, &switches);
- if (result != TCL_OK) {
- Tcl_AppendResult(interp, "can't convert \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- goto error;
- }
-
- /* Write the TIF data to file or convert it to a base64 string. */
- if (switches.fileObjPtr != NULL) {
- char *fileName;
-
- fileName = Tcl_GetString(switches.fileObjPtr);
- result = Blt_DBuffer_SaveFile(interp, fileName, dbuffer);
- } else if (switches.dataObjPtr != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_ObjSetVar2(interp, switches.dataObjPtr, NULL,
- Blt_DBuffer_ByteArrayObj(dbuffer), 0);
- result = (objPtr == NULL) ? TCL_ERROR : TCL_OK;
- } else {
- char *string;
-
- string = Blt_DBuffer_EncodeBase64(interp, dbuffer);
- if (string != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(string, -1);
- Blt_Free(string);
- Tcl_SetObjResult(interp, objPtr);
- }
- result = (string == NULL) ? TCL_ERROR : TCL_OK;
- }
- error:
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(dbuffer);
- return result;
-}
-
-int
-Blt_PictureTifInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_extra", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_picture_tif", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_PictureRegisterFormat(interp,
- "tif", /* Name of format. */
- IsTif, /* Discovery routine. */
- ReadTif, /* Read format procedure. */
- WriteTif, /* Write format procedure. */
- ImportTif, /* Import format procedure. */
- ExportTif); /* Export format procedure. */
-}
-
-#endif /* HAVE_LIBTIF */
diff --git a/blt3.0.1/src/bltPictXbm.c b/blt3.0.1/src/bltPictXbm.c
deleted file mode 100644
index 38c525c..0000000
--- a/blt3.0.1/src/bltPictXbm.c
+++ /dev/null
@@ -1,719 +0,0 @@
-
-/*
- * bltPictXbm.c --
- *
- * This module implements XBM file format conversion routines for
- * the picture image type in the BLT toolkit.
- *
- * Copyright 2003-2005 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include "blt.h"
-
-#include "config.h"
-#include <tcl.h>
-#include <bltSwitch.h>
-#include <bltDBuffer.h>
-#include "bltPicture.h"
-#include "bltPictFmts.h"
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif /* HAVE_STRING_H */
-
-#define UCHAR(c) ((unsigned char) (c))
-#define ISASCII(c) (UCHAR(c)<=0177)
-
-DLLEXPORT extern Tcl_AppInitProc Blt_PictureXbmInit;
-
-extern char *Blt_Itoa(int);
-extern char *Blt_InitHexTable(unsigned char *);
-
-#define TRUE 1
-#define FALSE 0
-
-typedef struct _Blt_Picture Picture;
-
-#include <ctype.h>
-
-typedef struct {
- int hotX, hotY;
- int width, height;
- int version;
-} Xbm;
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- Blt_Pixel bg, fg; /* Colors for XBM image format. */
-} XbmImportSwitches;
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- Blt_Pixel bg;
- int index;
-} XbmExportSwitches;
-
-BLT_EXTERN Blt_SwitchParseProc Blt_ColorSwitchProc;
-static Blt_SwitchCustom colorSwitch = {
- Blt_ColorSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-bg", "color",
- Blt_Offset(XbmImportSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(XbmImportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_CUSTOM, "-fg", "color",
- Blt_Offset(XbmImportSwitches, fg), 0, 0, &colorSwitch},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(XbmImportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_END}
-};
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-bg", "color",
- Blt_Offset(XbmExportSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(XbmExportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(XbmExportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_INT_NNEG, "-index", "int",
- Blt_Offset(XbmExportSwitches, index), 0},
- {BLT_SWITCH_END}
-};
-
-
-/*
- * Parse the lines that define the dimensions of the bitmap,
- * plus the first line that defines the bitmap data (it declares
- * the name of a data variable but doesn't include any actual
- * data). These lines look something like the following:
- *
- * #define foo_width 16
- * #define foo_height 16
- * #define foo_x_hot 3
- * #define foo_y_hot 3
- * static char foo_bits[] = {
- *
- * The x_hot and y_hot lines may or may not be present. It's
- * important to check for "char" in the last line, in order to
- * reject old X10-style bitmaps that used shorts.
- */
-
-static int
-XbmHeader(Blt_DBuffer data, Xbm *xbmPtr)
-{
- unsigned char *line, *next;
-
- xbmPtr->width = xbmPtr->height = 0;
- xbmPtr->hotX = xbmPtr->hotY = -1;
- xbmPtr->version = 11;
-
- Blt_DBuffer_ResetCursor(data);
- for (line = Blt_DBuffer_Pointer(data); *line != '\0'; line = next) {
-#define XBM_MAX_LINE 1023
- char substring[XBM_MAX_LINE+1];
- char *s;
- int value;
-
- /* Find the start of the next line */
- if ((*line == '\n') || (*line == '\r')) {
- line++;
- }
- next = line;
- while ((*next != '\r') && (*next != '\n') && (*next != '\0')) {
- if (*next & !ISASCII(*next)) {
- return FALSE;
- }
- next++;
- }
- /* Verify that we won't overrun the buffer with "sscanf". */
- if ((next - line) > XBM_MAX_LINE) {
- return FALSE;
- }
- s = (char *)line;
- if (sscanf(s, "#define %s %d", substring, &value) == 2) {
- char *name;
- char c;
- char *p;
-
- p = strrchr(substring, '_');
- if (p == NULL) {
- name = substring;
- } else {
- name = p + 1;
- }
- c = name[0];
- if ((c == 'w') && (strcmp("width", name) == 0)) {
- xbmPtr->width = value;
- } else if ((c == 'h') && (strcmp("height", name) == 0)){
- xbmPtr->height = value;
- } else if ((c == 'h') && (strcmp("hot", name) == 0)) {
- name -= 2;
- if (name > substring) {
- if (name[1] == '_') {
- if (name[0] == 'x') {
- xbmPtr->hotX = value;
- } else if (name[0] == 'y') {
- xbmPtr->hotY = value;
- }
- }
- }
- }
- continue;
- } else if (sscanf(s, "static short %s = {", substring) == 1) {
- xbmPtr->version = 10;
- } else if (sscanf(s,"static unsigned char %s = {", substring) == 1) {
- xbmPtr->version = 11;
- } else if (sscanf(s, "static char %s = {", substring) == 1) {
- xbmPtr->version = 11;
- } else {
- continue;
- }
- if (*next == '\r') {
- next++;
- }
- Blt_DBuffer_SetPointer(data, next);
- return TRUE;
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XbmGetHexValue --
- *
- * Converts the hexadecimal string into an unsigned integer
- * value. The hexadecimal string need not have a leading "0x".
- *
- * Results:
- * Returns a standard TCL result. If the conversion was
- * successful, TCL_OK is returned, otherwise TCL_ERROR.
- *
- * Side Effects:
- * If the conversion fails, interp->result is filled with an
- * error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-XbmGetHexValue(const char *string, int *valuePtr)
-{
- static unsigned char hexTable[256];
- static int initialized = 0;
- const char *s;
- int accum;
-
- if (!initialized) {
- Blt_InitHexTable(hexTable);
- initialized++;
- }
-
- s = string;
- if ((s[0] == '0') && ((s[1] == 'x') || (s[1] == 'X'))) {
- s += 2;
- }
- if (s[0] == '\0') {
- return FALSE; /* Error: empty string or only found "0x". */
- }
- accum = 0;
- for ( /*empty*/ ; *s != '\0'; s++) {
- unsigned char byte;
-
- /* Check if character is a hex digit and accumulate. */
- byte = hexTable[(int)*s];
- if (byte == 0xFF) {
- return FALSE; /* Not a hexadecimal number */
- }
- accum = (accum << 4) | byte;
- }
- *valuePtr = accum;
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XbmBitmapData --
- *
- * Converts a list of ASCII values into a picture.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * If an error occurs while processing the data, interp->result
- * is filled with a corresponding error message.
- *
- * The data sink is damaged by "strtok". Unlike XbmReadHeader,
- * here it's okay, since if we're already this far, we know it's
- * an XBM image and we assume that the data sink won't be reused.
- *
- *---------------------------------------------------------------------------
- */
-static int
-XbmBitmapData(
- Blt_DBuffer data, /* Data sink to be read from. */
- int version, /* X10 or X11. */
- Blt_Pixel *fgColorPtr, /* Foreground bitmap color (bit is 1). */
- Blt_Pixel *bgColorPtr, /* Background bitmap color (bit is 0). */
- Picture *destPtr) /* Picture to be populated from XBM
- * image. */
-{
- Blt_Pixel *destRowPtr;
- char *string; /* Used to tell strtok that have
- * continued processing the same
- * string. */
- int y;
-
- destRowPtr = destPtr->bits;
- string = (char *)Blt_DBuffer_Pointer(data);
- for (y = 0; y < destPtr->height; y++) {
- int x;
- Blt_Pixel *dp;
-
- dp = destRowPtr;
- if (version == 10) {
- for (x = 0; x < destPtr->width; /* empty */) {
- char *p;
- int i, u16;
-
- p = strtok(string, ",;}\n\r\t "), string = NULL;
- if ((p == NULL) || (!XbmGetHexValue(p, &u16))) {
- return FALSE;
- }
- for (i = 0; (x < destPtr->width) && (i < 16); i++, x++) {
- dp->u32 = (u16 & (1<<i)) ?
- fgColorPtr->u32 : bgColorPtr->u32;
- dp++;
- }
- }
- } else {
- for (x = 0; x < destPtr->width; /* empty */) {
- char *p;
- int i, u8;
-
- p = strtok(string, ",;}\n\r\t "), string = NULL;
- if ((p == NULL) || (!XbmGetHexValue(p, &u8))) {
- return FALSE;
- }
- for (i = 0; (x < destPtr->width) && (i < 8); i++, x++) {
- dp->u32 = (u8 & (1<<i)) ?
- fgColorPtr->u32 : bgColorPtr->u32;
- dp++;
- }
- }
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- if (bgColorPtr->Alpha == 0x00) { /* Background is 100% transparent. */
- if (fgColorPtr->Alpha == 0xFF) {
- destPtr->flags |= BLT_PIC_MASK;
- } else {
- destPtr->flags |= BLT_PIC_BLEND;
- }
- } else if (bgColorPtr->Alpha != 0xFF) { /* Partial transparency. */
- destPtr->flags |= BLT_PIC_BLEND;
- } else if (fgColorPtr->Alpha == 0x00) {
- /* Background is 100% opaque and foreground is 100%
- * transparent. */
- destPtr->flags |= BLT_PIC_MASK;
- }
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsXbm --
- *
- * Attempts to parse an XBM file header.
- *
- * Results:
- * Returns 1 is the header is XBM and 0 otherwise. Note that
- * the validity of the header values is not checked here. That's
- * done in Blt_XbmToPicture.
- *
- *---------------------------------------------------------------------------
- */
-static int
-IsXbm(Blt_DBuffer data)
-{
- Xbm xbm;
- int bool;
-
- bool = XbmHeader(data, &xbm);
- return bool;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XbmToPicture --
- *
- * Reads an XBM file and converts it into a picture.
- *
- * Results:
- * The picture is returned. If an error occured, such
- * as the designated file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-XbmToPicture(
- Tcl_Interp *interp,
- const char *fileName,
- Blt_DBuffer buffer,
- XbmImportSwitches *switchesPtr)
-{
- Blt_Picture picture;
- Xbm xbm;
-
- picture = NULL;
- if (!XbmHeader(buffer, &xbm)) {
- Tcl_AppendResult(interp, "error reading \"", fileName,
- "\" invalid XBM header", (char *)NULL);
- goto error;
- }
- if ((xbm.width > 0) && (xbm.height > 0)) {
- picture = Blt_CreatePicture(xbm.width, xbm.height);
- if (!XbmBitmapData(buffer, xbm.version, &switchesPtr->fg,
- &switchesPtr->bg, picture)) {
- Tcl_AppendResult(interp, "error reading \"", fileName,
- "\" invalid XBM data", (char *)NULL);
- goto error;
- }
- } else {
- Tcl_AppendResult(interp, "error reading \"", fileName,
- "\" invalid XBM dimensions \"", (char *)NULL);
- Tcl_AppendResult(interp, Blt_Itoa(xbm.width), " x ", (char *)NULL);
- Tcl_AppendResult(interp, Blt_Itoa(xbm.height), "\"", (char *)NULL);
- goto error;
- }
-
- Blt_DBuffer_Free(buffer);
- if (picture) {
- Blt_Chain chain;
-
- chain = Blt_Chain_Create();
- Blt_Chain_Append(chain, picture);
- return chain;
- }
- error:
- if (picture) {
- Blt_FreePicture(picture);
- }
- Blt_DBuffer_Free(buffer);
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictureToXbm --
- *
- * Writes a XBM format image to the provided data buffer.
- *
- * Results:
- * A standard TCL result. If an error occured, TCL_ERROR is
- * returned and an error message will be place in the interpreter
- * result. Otherwise, the data sink will contain the binary
- * output of the image.
- *
- * Side Effects:
- * Memory is allocated for the data sink.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PictureToXbm(Tcl_Interp *interp, Blt_Picture original, Blt_DBuffer buffer,
- XbmExportSwitches *switchesPtr)
-{
- Picture *srcPtr;
-
- srcPtr = original;
- Blt_DBuffer_Print(buffer, "#define picture_width %d\n", srcPtr->width);
- Blt_DBuffer_Print(buffer, "#define picture_height %d\n", srcPtr->height);
- Blt_DBuffer_Print(buffer, "#define picture_x_hot %d\n", srcPtr->width / 2);
- Blt_DBuffer_Print(buffer, "#define picture_y_hot %d\n", srcPtr->height / 2);
- Blt_DBuffer_Print(buffer, "static char picture_bits[] = {\n ");
- {
- Blt_Pixel *cp, *srcRowPtr;
- Blt_Pixel palette[256];
- int count, i;
- int y;
-
- /* Create a B&W palette for dithering the image. */
- for (cp = palette, i = 0; i < 256; i++, cp++) {
- int c;
-
- c = (i + 127) / 255;
- cp->Blue = cp->Green = cp->Red = (unsigned char) (c * 255 + 0.5);
- cp->Alpha = ALPHA_OPAQUE;
- }
-
- /* Remove any transparent pixels by blending into a solid
- * white background. */
- if (!Blt_PictureIsOpaque(srcPtr)) {
- Blt_Picture background;
-
- /* Blend picture with solid color background. */
- background = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- Blt_BlankPicture(background, &switchesPtr->bg);
- Blt_BlendPictures(background, srcPtr, 0, 0, srcPtr->width,
- srcPtr->height, 0, 0);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- srcPtr = background;
- }
- if (srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) {
- Blt_Picture unassoc;
- /*
- * The picture has an alpha burned into the components. Create a
- * temporary copy removing pre-multiplied alphas.
- */
- unassoc = Blt_ClonePicture(srcPtr);
- Blt_UnassociateColors(unassoc);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- srcPtr = unassoc;
- }
- /* Now dither the picture to 2 colors. */
- {
- Blt_Picture dither;
-
- dither = Blt_DitherPicture(srcPtr, palette);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- srcPtr = dither;
- }
- /* Write the dithered image data. */
- count = 0;
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp;
- int x;
-
- sp = srcRowPtr;
- for (x = 0; x < srcPtr->width; /* empty */) {
- unsigned char bits;
- int i;
-
- bits = 0;
- for (i = 0; (x < srcPtr->width) && (i < 8); i++, x++) {
- if (sp->Red == 0x00) {
- bits |= (1<<i);
- }
- sp++;
- }
- count++;
- Blt_DBuffer_Print(buffer, "0x%02x, ", bits);
- if (count > 11) {
- Blt_DBuffer_Print(buffer, "\n ");
- count = 0;
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- Blt_DBuffer_Print(buffer, "\n};\n");
-
- /* Free the temporary images. */
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- }
- return TCL_OK;
-}
-
-static Blt_Chain
-ReadXbm(Tcl_Interp *interp, const char *fileName, Blt_DBuffer buffer)
-{
- XbmImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- return XbmToPicture(interp, fileName, buffer, &switches);
-}
-
-static Tcl_Obj *
-WriteXbm(Tcl_Interp *interp, Blt_Picture picture)
-{
- Tcl_Obj *objPtr;
- Blt_DBuffer buffer;
- XbmExportSwitches switches;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF; /* white */
-
- buffer = Blt_DBuffer_Create();
- if (PictureToXbm(interp, picture, buffer, &switches) != TCL_OK) {
- objPtr = NULL;
- } else {
- objPtr = Tcl_NewStringObj((char *)Blt_DBuffer_Bytes(buffer),
- Blt_DBuffer_Length(buffer));
- }
- Blt_DBuffer_Destroy(buffer);
- return objPtr;
-}
-
-static Blt_Chain
-ImportXbm(
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv,
- const char **fileNamePtr)
-{
- Blt_Chain chain;
- Blt_DBuffer buffer;
- XbmImportSwitches switches;
- const char *string;
-
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one import source: ",
- "use only one -file or -data flag.", (char *)NULL);
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return NULL;
- }
- buffer = Blt_DBuffer_Create();
- chain = NULL;
- if (switches.dataObjPtr != NULL) {
- int nBytes;
-
- string = Tcl_GetStringFromObj(switches.dataObjPtr, &nBytes);
- Blt_DBuffer_AppendData(buffer, (unsigned char *)string, nBytes);
- string = "data buffer";
- *fileNamePtr = NULL;
- } else {
- string = Tcl_GetString(switches.fileObjPtr);
- if (Blt_DBuffer_LoadFile(interp, string, buffer) != TCL_OK) {
- goto error;
- }
- *fileNamePtr = string;
- }
- chain = XbmToPicture(interp, string, buffer, &switches);
- error:
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(buffer);
- return chain;
-}
-
-static int
-ExportXbm(Tcl_Interp *interp, unsigned int index, Blt_Chain chain, int objc,
- Tcl_Obj *const *objv)
-{
- XbmExportSwitches switches;
- Blt_DBuffer buffer;
- int result;
- Blt_Picture picture;
-
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF; /* Default bgcolor is white. */
- switches.index = index;
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one export destination: ",
- "use only one -file or -data flag.", (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
- picture = Blt_GetNthPicture(chain, switches.index);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "no picture at index ",
- Blt_Itoa(switches.index), (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
-
- buffer = Blt_DBuffer_Create();
- result = PictureToXbm(interp, picture, buffer, &switches);
- if (result != TCL_OK) {
- Tcl_AppendResult(interp, "can't convert \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- goto error;
- }
- if (switches.fileObjPtr != NULL) {
- char *fileName;
-
- fileName = Tcl_GetString(switches.fileObjPtr);
- result = Blt_DBuffer_SaveFile(interp, fileName, buffer);
- } else if (switches.dataObjPtr != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Blt_DBuffer_StringObj(buffer);
- objPtr = Tcl_ObjSetVar2(interp, switches.dataObjPtr, NULL, objPtr, 0);
- result = (objPtr == NULL) ? TCL_ERROR : TCL_OK;
- } else {
- Tcl_SetObjResult(interp, Blt_DBuffer_StringObj(buffer));
- }
- error:
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(buffer);
- return result;
-}
-
-int
-Blt_PictureXbmInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_extra", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_picture_xbm", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_PictureRegisterFormat(interp,
- "xbm", /* Name of format. */
- IsXbm, /* Discovery routine. */
- ReadXbm, /* Read format procedure. */
- WriteXbm, /* Write format procedure. */
- ImportXbm, /* Import format procedure. */
- ExportXbm); /* Export format procedure. */
-}
diff --git a/blt3.0.1/src/bltPictXpm.c b/blt3.0.1/src/bltPictXpm.c
deleted file mode 100644
index 049da05..0000000
--- a/blt3.0.1/src/bltPictXpm.c
+++ /dev/null
@@ -1,662 +0,0 @@
-
-/*
- * bltPictXpm.c --
- *
- * This module implements XPM file format conversion routines for the picture
- * image type in the BLT toolkit.
- *
- * Copyright 2003-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include "blt.h"
-
-#include "config.h"
-#ifdef HAVE_LIBXPM
-#include <tcl.h>
-#include <bltAlloc.h>
-#include <bltSwitch.h>
-#include <bltDBuffer.h>
-#include <bltHash.h>
-#include "bltPicture.h"
-#include "bltPictFmts.h"
-#include <ctype.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif /* HAVE_MEMORY_H */
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif /* HAVE_STRING_H */
-
-#ifndef HAVE_SPRINTF_S
-BLT_EXTERN int sprintf_s(char *s, size_t size, const char *fmt, /*args*/ ...);
-#endif /* HAVE_SPRINTF_S */
-
-#define TRUE 1
-#define FALSE 0
-
-typedef struct _Blt_Picture Picture;
-
-#include <X11/xpm.h>
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
- int flags; /* Flag. */
- Blt_Pixel bg;
- int index;
-} XpmExportSwitches;
-
-typedef struct {
- Tcl_Obj *dataObjPtr;
- Tcl_Obj *fileObjPtr;
-} XpmImportSwitches;
-
-BLT_EXTERN Blt_SwitchParseProc Blt_ColorSwitchProc;
-
-static Blt_SwitchCustom colorSwitch = {
- Blt_ColorSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-bg", "color",
- Blt_Offset(XpmExportSwitches, bg), 0, 0, &colorSwitch},
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(XpmExportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(XpmExportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_BITMASK, "-noquantize", "",
- Blt_Offset(XpmExportSwitches, flags), 0, PIC_NOQUANTIZE},
- {BLT_SWITCH_INT_NNEG, "-index", "int",
- Blt_Offset(XpmExportSwitches, index), 0},
- {BLT_SWITCH_END}
-};
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(XpmImportSwitches, dataObjPtr), 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(XpmImportSwitches, fileObjPtr), 0},
- {BLT_SWITCH_END}
-};
-
-DLLEXPORT extern Tcl_AppInitProc Blt_PictureXpmInit;
-extern char *Blt_Itoa(int);
-
-
-static int
-XpmHeader(Blt_DBuffer buffer)
-{
- unsigned char *line, *next;
- unsigned char *bp;
-
- Blt_DBuffer_ResetCursor(buffer);
- bp = Blt_DBuffer_End(buffer);
- bp[0] = '\0'; /* Guaranteed to have 1 extra byte in the
- * buffer to create an ASCIZ string. */
-
- for (line = Blt_DBuffer_Pointer(buffer); *line != '\0'; line = next) {
-#define XPM_MAX_LINE 4097
- char substring[XPM_MAX_LINE+1];
- int value;
- char *s;
-
- /* Find the start of the next line */
- if ((*line == '\n') || (*line == '\r')) {
- line++;
- }
- next = line;
- while ((*next != '\r') && (*next != '\n') && (*next != '\0')) {
- if (!isascii(*next)) {
- return FALSE;
- }
- next++;
- }
- /* Verify that we won't overrun the buffer with "sscanf". */
- if ((next - line) > XPM_MAX_LINE) {
- return FALSE;
- }
- s = (char *)line;
- if (sscanf(s, "#define %s %d", substring, &value) == 2) {
- char *p;
- char c;
- char *name;
-
- p = strrchr(substring, '_');
-
- if (p == NULL) {
- name = substring;
- } else {
- name = p + 1;
- }
- c = name[0];
- if ((c == 'f') && (strcmp("format", name) == 0)) {
- return TRUE;
- } else {
- return FALSE;
- }
- } else if (sscanf(s, "/* %s */", substring) == 1) {
- if ((strcmp("XPM", substring) == 0) ||
- (strcmp("XPM2", substring) == 0)) {
- return TRUE;
- }
- }
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsXpm --
- *
- * Attempts to parse an XBM file header.
- *
- * Results:
- * Returns 1 is the header is XBM and 0 otherwise. Note that
- * the validity of the header values is not checked here. That's
- * done in XpmToPicture.
- *
- *---------------------------------------------------------------------------
- */
-static int
-IsXpm(Blt_DBuffer buffer)
-{
- int bool;
-
- bool = XpmHeader(buffer);
- return bool;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XpmToPicture --
- *
- * Reads an XBM file and converts it into a picture.
- *
- * Results:
- * The picture is returned. If an error occured, such
- * as the designated file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Chain
-XpmToPicture(
- Tcl_Interp *interp,
- const char *fileName,
- Blt_DBuffer buffer,
- XpmImportSwitches *switchesPtr)
-{
- Picture *destPtr;
- Blt_Pixel *palette;
- XpmImage xpm;
- int i, result;
- int maskColorIndex;
-
- Blt_DBuffer_ResetCursor(buffer);
- result = XpmCreateXpmImageFromBuffer((char *)Blt_DBuffer_Bytes(buffer), &xpm,
- (XpmInfo *)NULL);
- if (result != XpmSuccess) {
- Tcl_AppendResult(interp, "error reading \"", fileName,
- "\" can't read XPM image. ", (char *)NULL);
- return NULL;
- }
- destPtr = NULL;
- palette = NULL;
- if ((xpm.height < 1) || (xpm.width < 1)) {
- Tcl_AppendResult(interp, "error reading \"", fileName,
- "\" invalid XPM dimensions \"", (char *)NULL);
- Tcl_AppendResult(interp, Blt_Itoa(xpm.width), " x ", (char *)NULL);
- Tcl_AppendResult(interp, Blt_Itoa(xpm.height), "\"", (char *)NULL);
- goto bad;
- }
- if (xpm.colorTable == NULL) {
- Tcl_AppendResult(interp, "error reading \"", fileName,
- "\" no XPM color table available. ", (char *)NULL);
- goto bad;
- }
- destPtr = Blt_CreatePicture(xpm.width, xpm.height);
- palette = Blt_Malloc(xpm.ncolors * sizeof(Blt_Pixel));
- if (palette == NULL) {
- Tcl_AppendResult(interp, "error reading \"", fileName,
- "\" can't allocate a ", Blt_Itoa(xpm.ncolors),
- " color XPM palette.", (char *)NULL);
- goto bad;
- }
- maskColorIndex = -1;
- for (i = 0; i < xpm.ncolors; i++) {
- char *colorName;
-
- if (xpm.colorTable[i].c_color) {
- colorName = xpm.colorTable[i].c_color;
- } else if (xpm.colorTable[i].g_color) {
- colorName = xpm.colorTable[i].g_color;
- } else if (xpm.colorTable[i].g4_color) {
- colorName = xpm.colorTable[i].g4_color;
- } else if (xpm.colorTable[i].m_color) {
- colorName = xpm.colorTable[i].m_color;
- } else if (xpm.colorTable[i].symbolic) {
- colorName = xpm.colorTable[i].symbolic;
- } else {
- palette[i].u32 = 0xFFBEBEBE;
- continue;
- }
- if (strncmp(colorName, "None", 4) == 0) {
- maskColorIndex = i;
- palette[i].u32 = 0x00000000;
- continue;
- }
- if (Blt_GetPixel(interp, colorName, palette + i) != TCL_OK) {
- palette[i].u32 = 0xFFBEBEBE;
- }
- }
- {
- int y;
- unsigned int *pixelPtr; /* Pointer */
- Blt_Pixel *destRowPtr;
-
- destRowPtr = destPtr->bits;
- pixelPtr = (unsigned int *)xpm.data;
- for (y = 0; y < xpm.height; y++) {
- Blt_Pixel *dp, *dend;
-
- for (dp = destRowPtr, dend = dp + xpm.width; dp < dend; dp++) {
- if (*pixelPtr >= xpm.ncolors) {
- Tcl_AppendResult(interp, "error reading \"", fileName,
- "\" bad color index ", Blt_Itoa(*pixelPtr),
- " in XPM image.", (char *)NULL);
- goto bad;
- }
- if (*pixelPtr == maskColorIndex) {
- destPtr->flags |= BLT_PIC_MASK;
- }
- *dp = palette[*pixelPtr];
- pixelPtr++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- Blt_Free(palette);
- XpmFreeXpmImage(&xpm);
- if (destPtr != NULL) {
- Blt_Chain chain;
-
- chain = Blt_Chain_Create();
- Blt_Chain_Append(chain, destPtr);
- return chain;
- }
- bad:
- if (destPtr != NULL) {
- Blt_FreePicture(destPtr);
- }
- if (palette != NULL) {
- Blt_Free(palette);
- }
- XpmFreeXpmImage(&xpm);
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PictureToXpm --
- *
- * Reads an XBM file and converts it into a picture.
- *
- * Results:
- * The picture is returned. If an error occured, such
- * as the designated file could not be opened, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PictureToXpm(Tcl_Interp *interp, Blt_Picture original, Blt_DBuffer buffer,
- XpmExportSwitches *switchesPtr)
-{
- Picture *srcPtr;
- int nColors;
- Blt_HashTable colorTable;
- char fmt[20];
- int quantize;
- Blt_Pixel *bgColorPtr;
-
- quantize = ((switchesPtr->flags & PIC_NOQUANTIZE) == 0);
- bgColorPtr = &switchesPtr->bg;
-
- srcPtr = original;
- if (Blt_PictureIsBlended(srcPtr)) {
- Blt_Picture background, mask;
- Blt_Pixel black, white;
-
- background = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- Blt_BlankPicture(background, bgColorPtr);
-
- mask = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- /* Don't select 100% transparent pixels */
- white.u32 = 0xFFFFFFFF;
- black.u32 = 0x01000000;
- Blt_SelectPixels(mask, srcPtr, &black, &white);
- Blt_BlendPictures(background, srcPtr, 0, 0, srcPtr->width,
- srcPtr->height, 0, 0);
-
- /* Put back the mask by and-ing the pictures together */
- Blt_AndPictures(background, mask);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- srcPtr = background;
- }
- if (Blt_PictureFlags(srcPtr) & BLT_PIC_ASSOCIATED_COLORS) {
- Blt_Picture unassoc;
-
- /*
- * The picture has an alpha burned into the components. Create a
- * temporary copy removing pre-multiplied alphas.
- */
- unassoc = Blt_ClonePicture(srcPtr);
- Blt_UnassociateColors(unassoc);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- srcPtr = unassoc;
- }
- nColors = Blt_QueryColors(srcPtr, (Blt_HashTable *)NULL);
- if ((quantize) && (nColors > 256)) {
- Blt_Picture quant;
-
- quant = Blt_QuantizePicture(srcPtr, 256);
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- srcPtr = quant;
- }
- Blt_InitHashTable(&colorTable, BLT_ONE_WORD_KEYS);
- nColors = Blt_QueryColors(srcPtr, &colorTable);
- if (Blt_PictureIsMasked(srcPtr)) {
- nColors++;
- }
- /* Header. */
- {
- unsigned int size;
- int cpp;
-
- cpp = 1;
- size = 16;
- while (size < nColors) {
- size *= 16;
- cpp++;
- }
- sprintf_s(fmt, 20, "%%0%dx", cpp);
- /* Write the header line */
- Blt_DBuffer_Print(buffer, "/* XPM */\n");
- Blt_DBuffer_Print(buffer, "static char * image_name[] = {\n");
- Blt_DBuffer_Print(buffer, " /* Creator: BLT %s */\n", BLT_VERSION);
- Blt_DBuffer_Print(buffer, " \"%d %d %d %d\",\n", srcPtr->width,
- srcPtr->height, nColors, cpp);
- Blt_DBuffer_Print(buffer, " /* Colors used: %d */\n", nColors);
- }
-
- /* Color table. */
- {
- unsigned long i;
- const char *colorkey;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- colorkey = (Blt_PictureIsColor(srcPtr)) ? "c" : "m";
- i = 0;
- Blt_DBuffer_Print(buffer, " ");
- for (hPtr = Blt_FirstHashEntry(&colorTable, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_Pixel pixel;
- unsigned long key;
-
- Blt_SetHashValue(hPtr, i);
- key = (unsigned long)Blt_GetHashKey(&colorTable, hPtr);
- pixel.u32 = (unsigned int)key;
- Blt_DBuffer_Print(buffer, "\"");
- Blt_DBuffer_Print(buffer, fmt, i);
- Blt_DBuffer_Print(buffer, " %s #%02x%02x%02x\", ", colorkey,
- pixel.Red, pixel.Green, pixel.Blue);
- i++;
- if ((i % 4) == 0) {
- Blt_DBuffer_Print(buffer, "\n ");
- }
- }
- if (Blt_PictureIsMasked(srcPtr)) {
- i++;
- Blt_DBuffer_Print(buffer, "\"");
- Blt_DBuffer_Print(buffer, fmt, i);
- Blt_DBuffer_Print(buffer, " %s None\",\n", colorkey, i);
- }
- if ((i % 4) != 0) {
- Blt_DBuffer_Print(buffer, "\n");
- }
- }
- /* Image data. */
- {
- Blt_Pixel *srcRowPtr;
- int y;
- int count;
-
- srcRowPtr = srcPtr->bits;
- count = 0;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
- Blt_DBuffer_Print(buffer, "\"");
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- Blt_HashEntry *hPtr;
- unsigned long i;
- unsigned long key;
- Blt_Pixel pixel;
-
- pixel.u32 = sp->u32;
- pixel.Alpha = 0xFF;
- key = (unsigned long)pixel.u32;
- hPtr = Blt_FindHashEntry(&colorTable, (char *)key);
- if (hPtr == NULL) {
- fprintf(stderr, "can't find %x\n", sp->u32);
- Blt_DBuffer_Print(buffer, fmt, nColors);
- continue;
- }
- if (sp->Alpha == 0x00) {
- i = (unsigned long)nColors;
- } else {
- i = (unsigned long)Blt_GetHashValue(hPtr);
- }
- Blt_DBuffer_Print(buffer, fmt, i);
- }
- Blt_DBuffer_Print(buffer, "\",\n");
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- }
- Blt_DBuffer_Print(buffer, "};\n");
- if (srcPtr != original) {
- Blt_FreePicture(srcPtr);
- }
- Blt_DeleteHashTable(&colorTable);
- return TCL_OK;
-}
-
-static Blt_Chain
-ReadXpm(Tcl_Interp *interp, const char *fileName, Blt_DBuffer buffer)
-{
- XpmImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- return XpmToPicture(interp, fileName, buffer, &switches);
-}
-
-static Tcl_Obj *
-WriteXpm(Tcl_Interp *interp, Blt_Picture picture)
-{
- Tcl_Obj *objPtr;
- Blt_DBuffer buffer;
- XpmExportSwitches switches;
- int result;
-
- /* Default export switch settings. */
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF; /* white */
- buffer = Blt_DBuffer_Create();
- result = PictureToXpm(interp, picture, buffer, &switches);
- objPtr = NULL;
- if (result == TCL_OK) {
- objPtr = Tcl_NewStringObj((char *)Blt_DBuffer_Bytes(buffer),
- Blt_DBuffer_Length(buffer));
- }
- Blt_DBuffer_Destroy(buffer);
- return objPtr;
-}
-
-static Blt_Chain
-ImportXpm(
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv,
- const char **fileNamePtr)
-{
- Blt_Chain chain;
- Blt_DBuffer buffer;
- XpmImportSwitches switches;
- const char *string;
-
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return NULL;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one import source: ",
- "use only one -file or -data flag.", (char *)NULL);
- return NULL;
- }
- chain = NULL;
- buffer = Blt_DBuffer_Create();
- if (switches.dataObjPtr != NULL) {
- int nBytes;
-
- string = Tcl_GetStringFromObj(switches.dataObjPtr, &nBytes);
- Blt_DBuffer_AppendData(buffer, (unsigned char *)string, nBytes);
- string = "data buffer";
- *fileNamePtr = NULL;
- } else {
- string = Tcl_GetString(switches.fileObjPtr);
- if (Blt_DBuffer_LoadFile(interp, string, buffer) != TCL_OK) {
- Blt_DBuffer_Destroy(buffer);
- return NULL;
- }
- *fileNamePtr = string;
- }
- chain = XpmToPicture(interp, string, buffer, &switches);
- Blt_DBuffer_Destroy(buffer);
- return chain;
-}
-
-static int
-ExportXpm(Tcl_Interp *interp, unsigned int index, Blt_Chain chain, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_DBuffer buffer;
- Blt_Picture picture;
- XpmExportSwitches switches;
- int result;
-
- memset(&switches, 0, sizeof(switches));
- switches.bg.u32 = 0xFFFFFFFF; /* Default bgcolor is white. */
- switches.index = index;
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if ((switches.dataObjPtr != NULL) && (switches.fileObjPtr != NULL)) {
- Tcl_AppendResult(interp, "more than one export destination: ",
- "use only one -file or -data switch.", (char *)NULL);
- return TCL_ERROR;
- }
- picture = Blt_GetNthPicture(chain, switches.index);
- if (picture == NULL) {
- Tcl_AppendResult(interp, "no picture at index ",
- Blt_Itoa(switches.index), (char *)NULL);
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return TCL_ERROR;
- }
-
- buffer = Blt_DBuffer_Create();
- result = PictureToXpm(interp, picture, buffer, &switches);
- if (result != TCL_OK) {
- Tcl_AppendResult(interp, "can't convert \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- goto error;
- }
- if (switches.fileObjPtr != NULL) {
- char *fileName;
-
- fileName = Tcl_GetString(switches.fileObjPtr);
- result = Blt_DBuffer_SaveFile(interp, fileName, buffer);
- } else if (switches.dataObjPtr != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Blt_DBuffer_StringObj(buffer);
- objPtr = Tcl_ObjSetVar2(interp, switches.dataObjPtr, NULL, objPtr, 0);
- result = (objPtr == NULL) ? TCL_ERROR : TCL_OK;
- } else {
- Tcl_SetObjResult(interp, Blt_DBuffer_StringObj(buffer));
- }
- error:
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- Blt_DBuffer_Destroy(buffer);
- return result;
-}
-
-int
-Blt_PictureXpmInit(Tcl_Interp *interp)
-{
-#ifdef USE_TCL_STUBS
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
- return TCL_ERROR;
- };
-#endif
- if (Tcl_PkgRequire(interp, "blt_extra", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_picture_xpm", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_PictureRegisterFormat(interp,
- "xpm", /* Name of format. */
- IsXpm, /* Discovery routine. */
- ReadXpm, /* Read format procedure. */
- WriteXpm, /* Write format procedure. */
- ImportXpm, /* Import format procedure. */
- ExportXpm); /* Export format procedure. */
-}
-
-#endif /* HAVE_LIBXPM */
-
diff --git a/blt3.0.1/src/bltPicture.c b/blt3.0.1/src/bltPicture.c
deleted file mode 100644
index d0a7f46..0000000
--- a/blt3.0.1/src/bltPicture.c
+++ /dev/null
@@ -1,6440 +0,0 @@
-
-/*
- * bltPicture.c --
- *
- * This module implements basic picture processing routines for the BLT
- * toolkit.
- *
- * Copyright 1997-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltHash.h"
-#include <bltDBuffer.h>
-#include "bltChain.h"
-#include "bltPicture.h"
-#include "bltPictInt.h"
-#include "bltImage.h"
-#include <X11/Xutil.h>
-#include <bltRound.h>
-
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif /* HAVE_MALLOC_H */
-
-#ifndef ALIGN
-#define ALIGN(a) \
- (((size_t)a + (sizeof(void *) - 1)) & (~(sizeof(void *) - 1)))
-#endif /* ALIGN */
-
-#define ALIGNMENT 16
-
-#define JITTER(x) ((x) * (0.05 - drand48() * 0.10))
-#define JCLAMP(c) ((((c) < 0.0) ? 0.0 : ((c) > 1.0) ? 1.0 : (c)))
-
-#define CLAMP(c) ((((c) < 0.0) ? 0.0 : ((c) > 255.0) ? 255.0 : (c)))
-
-#define imul8x8(a,b,t) ((t) = (a)*(b)+128,(((t)+((t)>>8))>>8))
-
-static Blt_ResampleFilterProc DefaultFilter;
-static Blt_ResampleFilterProc BellFilter;
-static Blt_ResampleFilterProc BesselFilter;
-static Blt_ResampleFilterProc BoxFilter;
-static Blt_ResampleFilterProc BSplineFilter;
-static Blt_ResampleFilterProc CatRomFilter;
-static Blt_ResampleFilterProc DummyFilter;
-static Blt_ResampleFilterProc GaussianFilter;
-static Blt_ResampleFilterProc GiFilter;
-static Blt_ResampleFilterProc Lanczos3Filter;
-static Blt_ResampleFilterProc MitchellFilter;
-static Blt_ResampleFilterProc SincFilter;
-static Blt_ResampleFilterProc TriangleFilter;
-
-static Blt_ApplyPictureToPictureProc ApplyPictureToPicture;
-static Blt_ApplyScalarToPictureProc ApplyScalarToPicture;
-static Blt_ApplyPictureToPictureWithMaskProc ApplyPictureToPictureWithMask;
-static Blt_ApplyScalarToPictureWithMaskProc ApplyScalarToPictureWithMask;
-static Blt_TentHorizontallyProc TentHorizontally;
-static Blt_TentVerticallyProc TentVertically;
-static Blt_ZoomHorizontallyProc ZoomHorizontally;
-static Blt_ZoomVerticallyProc ZoomVertically;
-static Blt_BlendPicturesProc BlendPictures;
-static Blt_SelectPixelsProc SelectPixels;
-static Blt_AssociateColorsProc AssociateColors;
-static Blt_UnassociateColorsProc UnassociateColors;
-static Blt_FadePictureProc FadePicture;
-static Blt_CopyPictureBitsProc CopyPictureBits;
-
-static Blt_PictureProcs stdPictureProcs = {
- ApplyPictureToPicture,
- ApplyScalarToPicture,
- ApplyPictureToPictureWithMask,
- ApplyScalarToPictureWithMask,
- TentHorizontally,
- TentVertically,
- ZoomHorizontally,
- ZoomVertically,
- BlendPictures,
- SelectPixels,
- AssociateColors,
- UnassociateColors,
- FadePicture,
- CopyPictureBits
-};
-
-Blt_PictureProcs *bltPictProcsPtr = &stdPictureProcs;
-
-void
-Blt_ApplyPictureToPicture(Blt_Picture dest, Blt_Picture src,
- int x, int y, int w, int h, int dx, int dy,
- Blt_PictureArithOps op)
-{
- (*bltPictProcsPtr->applyPictureToPictureProc)(dest, src, x, y, w, h,
- dx, dy, op);
-}
-
-void
-Blt_ApplyScalarToPicture(Blt_Picture dest, Blt_Pixel *colorPtr,
- Blt_PictureArithOps op)
-{
- (*bltPictProcsPtr->applyScalarToPictureProc)(dest, colorPtr, op);
-}
-
-void
-Blt_ApplyPictureToPictureWithMask(Blt_Picture dest, Blt_Picture src,
- Blt_Picture mask, int x, int y, int w, int h,
- int dx, int dy, int invert,
- Blt_PictureArithOps op)
-{
- (*bltPictProcsPtr->applyPictureToPictureWithMaskProc)(dest, src, mask,
- x, y, w, h, dx, dy, invert, op);
-}
-
-void
-Blt_ApplyScalarToPictureWithMask(Blt_Picture dest, Blt_Pixel *colorPtr,
- Blt_Picture mask, int invert,
- Blt_PictureArithOps op)
-{
- (*bltPictProcsPtr->applyScalarToPictureWithMaskProc)(dest, colorPtr,
- mask, invert, op);
-}
-
-void
-Blt_TentHorizontally(Blt_Picture dest, Blt_Picture src)
-{
- (*bltPictProcsPtr->tentHorizontallyProc)(dest, src);
-}
-
-void
-Blt_TentVertically(Blt_Picture dest, Blt_Picture src)
-{
- (*bltPictProcsPtr->tentVerticallyProc)(dest, src);
-}
-
-void
-Blt_ZoomHorizontally(Blt_Picture dest, Blt_Picture src,
- Blt_ResampleFilter filter)
-{
- (*bltPictProcsPtr->zoomHorizontallyProc)(dest, src, filter);
-}
-
-void
-Blt_ZoomVertically(Blt_Picture dest, Blt_Picture src, Blt_ResampleFilter filter)
-{
- (*bltPictProcsPtr->zoomVerticallyProc)(dest, src, filter);
-}
-
-void
-Blt_BlendPictures(Blt_Picture dest, Blt_Picture src, int x, int y, int w, int h,
- int dx, int dy)
-{
- (*bltPictProcsPtr->blendPicturesProc)(dest, src, x, y, w, h, dx, dy);
-}
-
-void
-Blt_SelectPixels(Blt_Picture dest, Blt_Picture src, Blt_Pixel *lowPtr ,
- Blt_Pixel *highPtr)
-{
- (*bltPictProcsPtr->selectPixelsProc)(dest, src, lowPtr, highPtr);
-}
-
-void
-Blt_AssociateColors(Blt_Picture picture)
-{
- (*bltPictProcsPtr->associateColorsProc)(picture);
-}
-
-void
-Blt_UnassociateColors(Blt_Picture picture)
-{
- (*bltPictProcsPtr->unassociateColorsProc)(picture);
-}
-
-void
-Blt_FadePicture(Blt_Picture dest, Blt_Picture src, int x, int y, int w, int h,
- int dx, int dy, int alpha)
-{
- (*bltPictProcsPtr->fadePictureProc)(dest, src, x, y, w, h, dx, dy, alpha);
-}
-
-void
-Blt_CopyPictureBits(Blt_Picture dest, Blt_Picture src, int x, int y, int w,
- int h, int dx, int dy)
-{
- (*bltPictProcsPtr->copyPictureBitsProc)(dest, src, x, y, w, h, dx, dy);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_CreatePicture --
- *
- * Allocates a picture of a designated height and width.
- *
- * This routine will be augmented with other types of information such as
- * a color table, etc.
- *
- * Results:
- * Returns the new color pict.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_CreatePicture(int w, int h)
-{
- Pict *destPtr;
- int pixelsPerRow;
- size_t size;
- unsigned char *buffer;
- ptrdiff_t ptr;
- assert((w > 0) && (w <= SHRT_MAX));
- assert((h > 0) && (h <= SHRT_MAX));
-
- /*
- * Be careful. There's a bunch of picture routines that assume an even
- * number of pixels per row.
- */
- pixelsPerRow = (w + 3) & ~3; /* Align each row on a 16-byte boundary. */
- destPtr = Blt_AssertMalloc(sizeof(Pict));
- destPtr->pixelsPerRow = pixelsPerRow;
- destPtr->width = w;
- destPtr->height = h;
- destPtr->flags = BLT_PIC_DIRTY;
- destPtr->delay = 0;
-
- /* Over-allocate a buffer so that we can align it (if needed) to a 16-byte
- * boundary. */
- size = (pixelsPerRow * h * sizeof(Blt_Pixel)) + ALIGNMENT;
- buffer = Blt_AssertCalloc(1, size);
- ptr = (ptrdiff_t)buffer;
- destPtr->bits = (Blt_Pixel *)(ptr + (ptr & (ALIGNMENT-1)));
- destPtr->buffer = buffer;
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FreePicture --
- *
- * Deallocates the given picture.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FreePicture(Pict *pictPtr)
-{
- Blt_Free(pictPtr->buffer);
- Blt_Free(pictPtr);
-}
-
-void
-Blt_SizeOfPicture(Pict *pictPtr, int *widthPtr , int *heightPtr)
-{
- *widthPtr = pictPtr->width;
- *heightPtr = pictPtr->height;
-}
-
-void
-Blt_ResizePicture(Pict *srcPtr, int w, int h)
-{
- assert((w > 0) && (w <= SHRT_MAX));
- assert((h > 0) && (h <= SHRT_MAX));
- if ((w != srcPtr->width) || (h != srcPtr->height)) {
- int pixelsPerRow;
- size_t size;
- ptrdiff_t ptr;
- void *buffer;
-
- pixelsPerRow = (w + 3) & ~3; /* Align each row on a 16-byte
- * boundary. */
- size = (pixelsPerRow * h * sizeof(Blt_Pixel)) + ALIGNMENT;
- buffer = Blt_Realloc(srcPtr->buffer, size);
- assert(buffer != NULL);
- srcPtr->pixelsPerRow = pixelsPerRow;
- srcPtr->width = w;
- srcPtr->height = h;
- ptr = (ptrdiff_t)buffer;
- srcPtr->bits = (Blt_Pixel *)(ptr + (ptr & (ALIGNMENT-1)));
- srcPtr->flags = BLT_PIC_DIRTY;
- srcPtr->buffer = buffer;
- }
-}
-
-void
-Blt_AdjustPicture(Pict *srcPtr, int w, int h)
-{
- assert((w > 0) && (w <= SHRT_MAX));
- assert((h > 0) && (h <= SHRT_MAX));
- if ((w != srcPtr->width) || (h != srcPtr->height)) {
- int pixelsPerRow;
- int bytesPerRow;
- size_t size;
- void *buffer;
- ptrdiff_t ptr;
- Blt_Pixel *bits;
-
- /*
- * Be careful. There's a bunch of picture routines that assume an even
- * number of pixels per row.
- */
- pixelsPerRow = (w + 3) & ~3; /* Align each row on a 16-byte
- * boundary. */
-
- size = (pixelsPerRow * h * sizeof(Blt_Pixel)) + ALIGNMENT;
- buffer = Blt_AssertMalloc(size);
- ptr = (ptrdiff_t)buffer;
- bits = (Blt_Pixel *)(ptr + (ptr & (ALIGNMENT-1)));
- if (srcPtr->bits != NULL && (srcPtr->pixelsPerRow > 0)) {
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y, nRows;
-
- bytesPerRow = sizeof(Blt_Pixel) *
- MIN(pixelsPerRow, srcPtr->pixelsPerRow);
- nRows = MIN(srcPtr->height, h);
-
- srcRowPtr = srcPtr->bits, destRowPtr = bits;
- for (y = 0; y < nRows; y++) {
- memcpy(destRowPtr, srcRowPtr, bytesPerRow);
- destRowPtr += pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- Blt_Free(srcPtr->buffer);
- }
- srcPtr->pixelsPerRow = pixelsPerRow;
- srcPtr->width = w;
- srcPtr->height = h;
- srcPtr->bits = bits;
- srcPtr->buffer = buffer;
- srcPtr->flags = BLT_PIC_DIRTY;
- }
-}
-
-
-void
-Blt_BlankPicture(Pict *destPtr, Blt_Pixel *colorPtr)
-{
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < destPtr->height; y++) {
- int n;
- Blt_Pixel *dp;
-
- dp = destRowPtr;
- n = (destPtr->width + 7) / 8; /* width > 0 assumed */
- switch (destPtr->width & 0x7) {
- case 0: do { dp->u32 = colorPtr->u32, dp++;
- case 7: dp->u32 = colorPtr->u32, dp++;
- case 6: dp->u32 = colorPtr->u32, dp++;
- case 5: dp->u32 = colorPtr->u32, dp++;
- case 4: dp->u32 = colorPtr->u32, dp++;
- case 3: dp->u32 = colorPtr->u32, dp++;
- case 2: dp->u32 = colorPtr->u32, dp++;
- case 1: dp->u32 = colorPtr->u32, dp++;
- } while (--n > 0);
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- destPtr->flags |= BLT_PIC_DIRTY;
- destPtr->flags &= ~(BLT_PIC_BLEND | BLT_PIC_MASK);
- if (colorPtr->Alpha == 0x00) {
- destPtr->flags |= BLT_PIC_MASK;
- } else if (colorPtr->Alpha != 0xFF) {
- destPtr->flags |= BLT_PIC_BLEND;
- }
-}
-
-void
-Blt_BlankRegion(Pict *destPtr, int x, int y, int w, int h, Blt_Pixel *colorPtr)
-{
- Blt_Pixel *destRowPtr;
- int y1, x1;
-
- assert ((x >= 0) && (y >= 0));
- if ((x >= destPtr->width) || (y >= destPtr->height)) {
- return;
- }
- x1 = x + w;
- y1 = y + h;
- if (x1 > destPtr->width) {
- x1 = destPtr->width;
- }
- if (y1 > destPtr->height) {
- y1 = destPtr->height;
- }
- w = x1 - x;
- h = y1 - y;
- destRowPtr = destPtr->bits + (y * destPtr->pixelsPerRow) + x;
- for (y = 0; y < h; y++) {
- int n;
- Blt_Pixel *dp;
-
- dp = destRowPtr;
- n = (w + 7) / 8; /* width > 0 assumed */
- switch (w & 0x7) {
- case 0: do { dp->u32 = colorPtr->u32, dp++;
- case 7: dp->u32 = colorPtr->u32, dp++;
- case 6: dp->u32 = colorPtr->u32, dp++;
- case 5: dp->u32 = colorPtr->u32, dp++;
- case 4: dp->u32 = colorPtr->u32, dp++;
- case 3: dp->u32 = colorPtr->u32, dp++;
- case 2: dp->u32 = colorPtr->u32, dp++;
- case 1: dp->u32 = colorPtr->u32, dp++;
- } while (--n > 0);
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- destPtr->flags |= BLT_PIC_DIRTY;
- destPtr->flags &= ~(BLT_PIC_BLEND | BLT_PIC_MASK);
- if (colorPtr->Alpha == 0x00) {
- destPtr->flags |= BLT_PIC_MASK;
- } else if (colorPtr->Alpha != 0xFF) {
- destPtr->flags |= BLT_PIC_BLEND;
- }
-}
-
-#ifdef notdef
-static void
-ComputeGammaTable(float gamma, unsigned char lut[])
-{
- int i;
- double iGamma;
-
- iGamma = 1.0 / (double)gamma;
- for (i = 0; i < 256; i++) {
- double value;
-
- value = 255.0 * pow((double)i / 255.0, iGamma);
- lut[i] = (unsigned char)CLAMP(value);
- }
-}
-#endif
-
-static void
-ComputeGammaTable2(float gamma, unsigned char lut[])
-{
- int i;
- double iGamma;
- double cutoff, exp;
-
- iGamma = 1.0 / (double)gamma;
- cutoff = 0.018;
- exp = (1.099 * pow(cutoff, iGamma) - 0.099) / cutoff;
- for (i = 0; i < 256; i++) {
- double value, intensity;
-
- intensity = (double)i / 255.0;
- if (intensity < cutoff) {
- intensity *= exp;
- } else {
- intensity = (1.099 * pow(intensity, iGamma) - 0.099);
- }
- value = 255.0 * intensity;
- lut[i] = (unsigned char)CLAMP(value);
- }
-}
-
-void
-Blt_GammaCorrectPicture(Pict *destPtr, Pict *srcPtr, float gamma)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
- unsigned char lut[256];
-
- ComputeGammaTable2(gamma, lut);
- srcRowPtr = srcPtr->bits;
- destRowPtr = destPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *dp, *send;
-
- sp = srcRowPtr, dp = destRowPtr;
- for (send = sp + srcPtr->width; sp < send; sp++, dp++) {
- dp->Red = lut[(unsigned int)sp->Red];
- dp->Green = lut[(unsigned int)sp->Green];
- dp->Blue = lut[(unsigned int)sp->Blue];
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GreyscalePicture --
- *
- * Returns a new picture converted to grey scale. All three picture
- * color components will have the same value.
- *
- * Luminosity is computed using the formula,
- *
- * Y = 0.212671 * Red + 0.715160 * Green + 0.072169 * Blue
- *
- * which is supposed to better represent contemporary monitors.
- *
- * Results:
- * Returns a new greyscale picture.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_GreyscalePicture(Pict *srcPtr)
-{
- Pict *destPtr;
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
-
- /*
- * We can use scaled integers (20-bit fraction) to compute the luminosity
- * with reasonable accuracy considering it's stored in an 8-bit result.
- */
-#define YR 223002 /* 0.212671 */
-#define YG 749900 /* 0.715160 */
-#define YB 75675 /* 0.072169 */
-#define YMAX 267386880 /* 255.0 */
-#define YCLAMP(s) \
- (unsigned char)((s) > YMAX) ? 255 : ((((s) + 524288) >> 20))
-
- destPtr = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- srcRowPtr = srcPtr->bits;
- destRowPtr = destPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *dp, *send;
-
- sp = srcRowPtr, dp = destRowPtr;
- for (send = sp + srcPtr->width; sp < send; sp++, dp++) {
- unsigned int Y;
-
- Y = YR * sp->Red + YG * sp->Green + YB * sp->Blue;
- dp->Red = dp->Green = dp->Blue = YCLAMP(Y);
- dp->Alpha = sp->Alpha;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- destPtr->flags = srcPtr->flags;
- destPtr->flags |= BLT_PIC_DIRTY;
- destPtr->flags &= ~BLT_PIC_COLOR;
- return destPtr;
-}
-
-static void
-FadePicture(Pict *destPtr, Pict *srcPtr, int sx, int sy, int w, int h,
- int dx, int dy, int alpha)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
-
- if (srcPtr != destPtr) {
- Blt_ResizePicture(destPtr, srcPtr->width, srcPtr->height);
- }
- destRowPtr = destPtr->bits;
- srcRowPtr = srcPtr->bits;
-
- if (srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) {
- Blt_UnassociateColors(srcPtr);
- }
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *dp, *send;
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++, dp++) {
- dp->Alpha -= alpha;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- destPtr->flags |= BLT_PIC_BLEND;
-}
-
-static void
-AssociateColors(Pict *srcPtr)
-{
- if ((srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) == 0) {
- Blt_Pixel *srcRowPtr;
- int y;
-
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
-
- sp = srcRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- /* No conversion necessary if 100% transparent or opaque. */
- if ((sp->Alpha != 0xFF) && (sp->Alpha != 0x00)) {
- int t;
-
- sp->Red = imul8x8(sp->Alpha, sp->Red, t);
- sp->Green = imul8x8(sp->Alpha, sp->Green, t);
- sp->Blue = imul8x8(sp->Alpha, sp->Blue, t);
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- srcPtr->flags |= BLT_PIC_ASSOCIATED_COLORS;
- }
-}
-
-static void
-UnassociateColors(Pict *srcPtr)
-{
- if (srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) {
- Blt_Pixel *srcRowPtr;
- int y;
-
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
-
- sp = srcRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- /* No conversion necessary if 100% transparent or opaque. */
- if ((sp->Alpha != 0xFF) && (sp->Alpha != 0x00)) {
- int bias;
-
- bias = sp->Alpha >> 1;
- sp->Red = (mul255(sp->Red) + bias) / sp->Alpha;
- sp->Green = (mul255(sp->Green) + bias) / sp->Alpha;
- sp->Blue = (mul255(sp->Blue) + bias) / sp->Alpha;
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- srcPtr->flags &= ~BLT_PIC_ASSOCIATED_COLORS;
- }
-}
-
-/*
- *
- * x,y------+
- * | |
- * | *----+------------+
- * | | | |
- * | | | |
- */
-
-static void
-BlendPictures(Pict *destPtr, Pict *srcPtr, int sx, int sy, int w, int h,
- int dx, int dy)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
-
- if (((dx + w) < 0) || ((dy + h) < 0)) {
- return;
- }
- if (dx < 0) {
- w += dx;
- dx = 0;
- }
- if (dy < 0) {
- h += dy;
- dy = 0;
- }
- if (destPtr->width < (dx + w)) {
- w = destPtr->width - dx;
- }
- if (destPtr->height < (dy + h)) {
- h = destPtr->height - dy;
- }
- if (srcPtr->width < w) {
- w = srcPtr->width;
- }
- if (srcPtr->height < h) {
- h = srcPtr->height;
- }
- if ((srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) == 0) {
- Blt_AssociateColors(srcPtr);
- }
- if ((destPtr->flags & BLT_PIC_ASSOCIATED_COLORS) == 0) {
- Blt_AssociateColors(destPtr);
- }
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((sy * srcPtr->pixelsPerRow) + sx);
-
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++, sp++) {
- /* Blend the foreground and background together. */
- if (sp->Alpha == 0xFF) {
- *dp = *sp;
- } else if (sp->Alpha != 0x00) {
- int beta, t;
- int r, g, b, a;
-
- beta = sp->Alpha ^ 0xFF; /* beta = 1 - alpha */
- r = sp->Red + imul8x8(beta, dp->Red, t);
- g = sp->Green + imul8x8(beta, dp->Green, t);
- b = sp->Blue + imul8x8(beta, dp->Blue, t);
- a = sp->Alpha + imul8x8(beta, dp->Alpha, t);
- dp->Red = (r > 255) ? 255 : ((r < 0) ? 0 : r);
- dp->Green = (g > 255) ? 255 : ((g < 0) ? 0 : g);
- dp->Blue = (b > 255) ? 255 : ((b < 0) ? 0 : b);
- dp->Alpha = (a > 255) ? 255 : ((a < 0) ? 0 : a);
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
-}
-
-static void
-BlendPictureArea2(
- Pict *destPtr, /* (in/out) Background picture.
- * Composite overwrites region in
- * background. */
- Pict *srcPtr, /* Foreground picture. */
- Blt_BlendingMode mode, /* Blend mode. */
- int sx, int sy, /* Origin of foreground region in
- * source. */
- int w, int h, /* Dimension of region to be blended. */
- int dx, int dy) /* Origin of background region in
- * destination. */
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
-
- if ((srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) == 0) {
- Blt_AssociateColors(srcPtr);
- }
- if ((destPtr->flags & BLT_PIC_ASSOCIATED_COLORS) == 0) {
- Blt_AssociateColors(destPtr);
- }
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((sy * srcPtr->pixelsPerRow) + sx);
-
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *send, *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + w; sp < send; sp++, dp++) {
- int r, g, b, a;
- double fa, z;
-
- /*
- * C = ((1 - Fa) * B) + ((1 - Ba) * F) + (Fa * Ba * BLEND(F,B));
- */
- {
- int fgBeta, bgBeta;
-
- bgBeta = dp->Alpha ^ 0xFF;
- fgBeta = sp->Alpha ^ 0xFF;
- r = (fgBeta * dp->Red) + (bgBeta * sp->Red);
- g = (fgBeta * dp->Green) + (bgBeta * sp->Green);
- b = (fgBeta * dp->Blue) + (bgBeta * sp->Blue);
- a = (fgBeta * dp->Alpha) + (bgBeta * sp->Alpha);
- }
- switch (mode) {
- case BLT_BLEND_NORMAL: /* C = F */
- r += dp->Alpha * sp->Red;
- g += dp->Alpha * sp->Green;
- b += dp->Alpha * sp->Blue;
- a += dp->Alpha * sp->Alpha;
- break;
-
- case BLT_BLEND_MULTIPLY: /* C = F * B */
- r += dp->Red * sp->Red;
- g += dp->Green * sp->Green;
- b += dp->Blue * sp->Blue;
- a += dp->Alpha * sp->Alpha;
- break;
-
- case BLT_BLEND_COLORDODGE: /* C = B / (1 - F) */
- if (sp->Alpha > 0) {
- fa = 1.0 / sp->Alpha;
- z = (sp->Alpha * dp->Red) / (1.0 - (sp->Red * fa));
- r += (int)(z + 0.5);
- z = (sp->Alpha * dp->Green) / (1.0 - (sp->Green * fa));
- g += (int)(z + 0.5) ;
- z = (sp->Alpha * dp->Blue) / (1.0 - (sp->Blue * fa));
- b += (int)(z + 0.5);
- a += dp->Alpha * sp->Alpha;
- } else {
- r += dp->Alpha * sp->Red;
- g += dp->Alpha * sp->Green;
- b += dp->Alpha * sp->Blue;
- a += dp->Alpha * sp->Alpha;
- }
- break;
-
- case BLT_BLEND_COLORBURN: /* C = B / F; */
- if (sp->Alpha > 0) {
- fa = 1.0 / sp->Alpha;
- z = 511.0 * ((dp->Alpha * sp->Red * fa) -
- ((sp->Alpha * dp->Red) / (sp->Red + 1)));
- r += (int)(z + 0.5);
- z = 511.0 * ((dp->Alpha * sp->Green * fa) -
- ((sp->Alpha * dp->Green) / (sp->Green + 1)));
- g += (int)(z + 0.5);
- z = 511.0 * ((dp->Alpha * sp->Blue * fa) -
- ((sp->Alpha * dp->Blue) / (sp->Blue + 1)));
- b += (int)(z + 0.5);
- a += dp->Alpha * sp->Alpha;
- } else {
- r += dp->Alpha * sp->Red;
- g += dp->Alpha * sp->Green;
- b += dp->Alpha * sp->Blue;
- a += dp->Alpha * sp->Alpha;
- }
- break;
-
- case BLT_BLEND_OVERLAY: /* Multiplies or screens depending upon
- * background color. */
- if (dp->Red < 128) {
- r += dp->Red * sp->Red;
- } else {
- r += ((sp->Alpha * dp->Red) + (dp->Alpha * sp->Red) -
- (sp->Red * dp->Red));
- }
- if (dp->Green < 128) {
- g += dp->Green * sp->Green;
- } else {
- g += ((sp->Alpha * dp->Green) + (dp->Alpha * sp->Green) -
- (sp->Green * dp->Green));
- }
- if (dp->Blue < 128) {
- b += dp->Blue * sp->Blue;
- } else {
- b += ((sp->Alpha * dp->Blue) + (dp->Alpha * sp->Blue) -
- (sp->Blue * dp->Blue));
- }
- a += dp->Alpha * sp->Alpha;
- break;
-
- case BLT_BLEND_SCREEN: /* C = 1 - ((1 - F) * B) */
- r += ((sp->Alpha * dp->Red) + (dp->Alpha * sp->Red) -
- (sp->Red * dp->Red));
- g += ((sp->Alpha * dp->Green) + (dp->Alpha * sp->Green) -
- (sp->Green * dp->Green));
- b += ((sp->Alpha * dp->Blue) + (dp->Alpha * sp->Blue) -
- (sp->Blue * dp->Blue));
- a += dp->Alpha * sp->Alpha;
- break;
-
- case BLT_BLEND_DARKEN: /* C = min(F,B) */
- r += MIN(dp->Alpha * sp->Red, sp->Alpha * dp->Red);
- g += MIN(dp->Alpha * sp->Green, sp->Alpha * dp->Green);
- b += MIN(dp->Alpha * sp->Blue, sp->Alpha * dp->Blue);
- a += dp->Alpha * sp->Alpha;
- break;
-
- case BLT_BLEND_LIGHTEN: /* C = max(F,B) */
- r += MAX(dp->Alpha * sp->Red, sp->Alpha * dp->Red);
- g += MAX(dp->Alpha * sp->Green, sp->Alpha * dp->Green);
- b += MAX(dp->Alpha * sp->Blue, sp->Alpha * dp->Blue);
- a += dp->Alpha * sp->Alpha;
- break;
-
- case BLT_BLEND_DIFFERENCE: /* C = |F - B| */
- /* C = |(F * Ba) - (B * Fa)| */
- r += ABS((dp->Alpha * sp->Red) - (sp->Alpha * dp->Red));
- g += ABS((dp->Alpha * sp->Green) - (sp->Alpha * dp->Green));
- b += ABS((dp->Alpha * sp->Blue) - (sp->Alpha * dp->Blue));
- a += dp->Alpha * sp->Alpha;
- break;
- case BLT_BLEND_HARDLIGHT:
- if (sp->Red > 127) {
- r += ((sp->Alpha * dp->Red) + (dp->Alpha * sp->Red) -
- (sp->Red * dp->Red));
- } else {
- r += dp->Red * sp->Red;
- }
- if (sp->Green > 127) {
- g += ((sp->Alpha * dp->Green) +
- (dp->Alpha * sp->Green) -
- (sp->Green * dp->Green));
- } else {
- g += dp->Green * sp->Green;
- }
- if (sp->Blue > 127) {
- b += ((sp->Alpha * dp->Blue) + (dp->Alpha * sp->Blue) -
- (sp->Blue * dp->Blue));
- } else {
- b += dp->Blue * sp->Blue;
- }
- a += MIN(sp->Alpha, dp->Alpha);
- break;
- case BLT_BLEND_SOFTLIGHT:
- fa = 1.0 / sp->Alpha;
- if (sp->Red > 127) {
- z = (sp->Alpha * dp->Red) / (1.0 - (sp->Red * fa));
- } else {
- z = 511.0 * ((dp->Alpha * sp->Red * fa) -
- ((sp->Alpha * dp->Red) / (sp->Red + 1)));
- }
- r += (int)(z + 0.5);
- if (sp->Green > 127) {
- z = (sp->Alpha * dp->Green) / (1.0 - (sp->Green * fa));
- } else {
- z = 511.0 * ((dp->Alpha * sp->Green * fa) -
- ((sp->Alpha * dp->Green) / (sp->Green + 1)));
- }
- g += (int)(z + 0.5);
- if (sp->Blue > 127) {
- z = (sp->Alpha * dp->Blue) / (1.0 - (sp->Blue * fa));
- } else {
- z = 511.0 * ((dp->Alpha * sp->Blue * fa) -
- ((sp->Alpha * dp->Blue) / (sp->Blue + 1)));
- }
- b += (int)(z + 0.5);
- a += sp->Alpha * dp->Alpha;
- break;
- }
- dp->Red = (r >= 65025) ? 255 : ((r < 0) ? 0 : div255(r));
- dp->Green = (g >= 65025) ? 255 : ((g < 0) ? 0 : div255(g));
- dp->Blue = (b >= 65025) ? 255 : ((b < 0) ? 0 : div255(b));
- dp->Alpha = (a >= 65025) ? 255 : ((a < 0) ? 0 : div255(a));
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
-}
-
-void
-Blt_BlendPicturesByMode(Pict *destPtr, Pict *srcPtr, Blt_BlendingMode mode)
-{
- BlendPictureArea2(destPtr, srcPtr, mode, 0, 0, srcPtr->width,
- srcPtr->height, 0, 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_BitmapToPicture --
- *
- * Converts the given bitmap into a picture.
- *
- * Results:
- * Returns a new picture containing the bitmap image.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_BitmapToPicture(
- Display *display,
- Pixmap bitmap, /* Source bitmap. */
- int w, int h, /* Width and height of the bitmap */
- Blt_Pixel *fg, /* Foreground pixel color */
- Blt_Pixel *bg) /* Background pixel color */
-{
- XImage *imagePtr;
- Blt_Pixel *destRowPtr;
- Pict *destPtr;
- int y;
- unsigned int flags;
-
- imagePtr = XGetImage(display, bitmap, 0, 0, w, h, 1, ZPixmap);
-
- destPtr = Blt_CreatePicture(w, h);
- destRowPtr = destPtr->bits;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp;
- int x;
-
- /*
- * The slow but robust brute force method of converting an X image:
- * FIXME: update to avoid XGetPixel calls.
- */
- dp = destRowPtr;
- for (x = 0; x < w; x++, dp++) {
- unsigned int pixel;
-
- pixel = XGetPixel(imagePtr, x, y);
- dp->u32 = (pixel) ? fg->u32 : bg->u32;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- XDestroyImage(imagePtr);
- flags = 0;
- if (bg->Alpha == 0x00) {
- flags |= BLT_PIC_MASK;
- } else if (bg->Alpha != 0xFF) {
- flags |= BLT_PIC_BLEND;
- }
- if (fg->Alpha == 0x00) {
- flags |= BLT_PIC_MASK;
- } else if (fg->Alpha != 0xFF) {
- flags |= BLT_PIC_BLEND;
- }
- destPtr->flags |= flags;
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PictureToPhoto --
- *
- * Translates a picture into a Tk photo.
- *
- * Results:
- * The photo is re-written with the new picture.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_PictureToPhoto(Pict *srcPtr, Tk_PhotoHandle photo)
-{
- Tk_PhotoImageBlock dib; /* Destination image block. */
-
- Tk_PhotoGetImage(photo, &dib);
- dib.pixelSize = sizeof(Blt_Pixel);
- dib.pitch = sizeof(Blt_Pixel) * srcPtr->pixelsPerRow;
- dib.width = srcPtr->width;
- dib.height = srcPtr->height;
- dib.offset[0] = Blt_Offset(Blt_Pixel, Red);
- dib.offset[1] = Blt_Offset(Blt_Pixel, Green);
- dib.offset[2] = Blt_Offset(Blt_Pixel, Blue);
- dib.offset[3] = Blt_Offset(Blt_Pixel, Alpha);
- Tk_PhotoSetSize(photo, srcPtr->width, srcPtr->height);
- if (srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) {
- Pict *tmpPtr;
-
- /* Divide out the alphas from picture's pre-multipled RGB values. */
- tmpPtr = Blt_ClonePicture(srcPtr);
- Blt_UnassociateColors(tmpPtr);
- dib.pixelPtr = (unsigned char *)tmpPtr->bits;
- Tk_PhotoSetSize(photo, tmpPtr->width, tmpPtr->height);
- Tk_PhotoPutBlock(photo, &dib, 0, 0, tmpPtr->width, tmpPtr->height);
- Blt_FreePicture(tmpPtr);
- } else {
- dib.pixelPtr = (unsigned char *)srcPtr->bits;
- Tk_PhotoPutBlock(photo, &dib, 0, 0, srcPtr->width, srcPtr->height);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PhotoAreaToPicture --
- *
- * Create a picture from a region in a photo image.
- *
- * Results:
- * The new picture is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_PhotoAreaToPicture(Tk_PhotoHandle photo, int x, int y, int w, int h)
-{
- Tk_PhotoImageBlock sib; /* Source image block. */
- Pict *destPtr;
- int offset;
- int ir, ib, ig, ia;
-
- if (x < 0) {
- x = 0;
- }
- if (y < 0) {
- y = 0;
- }
- Tk_PhotoGetImage(photo, &sib);
- if (w < 0) {
- w = sib.width;
- }
- if (h < 0) {
- h = sib.height;
- }
- if ((x + w) > sib.width) {
- w = sib.width - x;
- }
- if ((h + y) > sib.height) {
- h = sib.width - y;
- }
- offset = (x * sib.pixelSize) + (y * sib.pitch);
-
- destPtr = Blt_CreatePicture(w, h);
- ir = sib.offset[0];
- ig = sib.offset[1];
- ib = sib.offset[2];
- ia = sib.offset[3];
-
- if (sib.pixelSize == 4) {
- Blt_Pixel *destRowPtr;
- int x, y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp;
- unsigned char *bits;
-
- dp = destRowPtr;
- bits = sib.pixelPtr + offset;
- for (x = 0; x < w; x++) {
-
- dp->Alpha = bits[ia];
-
- if (dp->Alpha == 0xFF) {
- dp->Red = bits[ir];
- dp->Green = bits[ig];
- dp->Blue = bits[ib];
- } else if (dp->Alpha == 0x00) {
- dp->Red = bits[ir];
- dp->Green = bits[ig];
- dp->Blue = bits[ib];
- destPtr->flags |= BLT_PIC_MASK;
- } else {
- int t;
-
- /*
- * Premultiple the alpha into each component.
- * (0..255 * 0..255) / 255.0
- */
- dp->Red = imul8x8(dp->Alpha, bits[ir], t);
- dp->Green = imul8x8(dp->Alpha, bits[ig], t);
- dp->Blue = imul8x8(dp->Alpha, bits[ib], t);
- destPtr->flags |=
- (BLT_PIC_BLEND | BLT_PIC_ASSOCIATED_COLORS);
- }
- bits += sib.pixelSize;
- dp++;
- }
- offset += sib.pitch;
- destRowPtr += destPtr->pixelsPerRow;
- }
- } else if (sib.pixelSize == 3) {
- Blt_Pixel *destRowPtr;
- int x, y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp;
- unsigned char *bits;
-
- dp = destRowPtr;
- bits = sib.pixelPtr + offset;
- for (x = 0; x < w; x++) {
- dp->Red = bits[ir];
- dp->Green = bits[ig];
- dp->Blue = bits[ib];
- dp->Alpha = ALPHA_OPAQUE;
- bits += sib.pixelSize;
- dp++;
- }
- offset += sib.pitch;
- destRowPtr += destPtr->pixelsPerRow;
- }
- } else {
- Blt_Pixel *destRowPtr;
- int x, y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < h; y++) {
- Blt_Pixel *dp;
- unsigned char *bits;
-
- dp = destRowPtr;
- bits = sib.pixelPtr + offset;
- for (x = 0; x < w; x++) {
- dp->Red = dp->Green = dp->Blue = bits[ir];
- dp->Alpha = ALPHA_OPAQUE;
- bits += sib.pixelSize;
- dp++;
- }
- offset += sib.pitch;
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PhotoToPicture --
- *
- * Create a picture from a photo image.
- *
- * Results:
- * The new picture is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_PhotoToPicture(Tk_PhotoHandle photo) /* Source photo to convert. */
-{
- Pict *destPtr;
- Tk_PhotoImageBlock sib; /* Source image block. */
- int bytesPerRow;
- int sw, sh;
- int ir, ib, ig, ia;
-
- Tk_PhotoGetImage(photo, &sib);
- sw = sib.width;
- sh = sib.height;
- bytesPerRow = sib.pixelSize * sw;
- ir = sib.offset[0];
- ig = sib.offset[1];
- ib = sib.offset[2];
- ia = sib.offset[3];
-
- destPtr = Blt_CreatePicture(sw, sh);
- if (sib.pixelSize == 4) {
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = sib.pixelPtr;
- destRowPtr = destPtr->bits;
- for (y = 0; y < sh; y++) {
- Blt_Pixel *dp;
- unsigned char *bits, *bend;
-
- dp = destRowPtr;
- for (bits = srcRowPtr, bend = bits + bytesPerRow; bits < bend;
- bits += sib.pixelSize) {
- dp->Alpha = bits[ia];
- if (dp->Alpha == 0xFF) {
- dp->Red = bits[ir];
- dp->Green = bits[ig];
- dp->Blue = bits[ib];
- } else if (dp->Alpha == 0x00) {
- dp->Red = bits[ir];
- dp->Green = bits[ig];
- dp->Blue = bits[ib];
- destPtr->flags |= BLT_PIC_MASK;
- } else {
- dp->Red = bits[ir];
- dp->Green = bits[ig];
- dp->Blue = bits[ib];
- destPtr->flags |= BLT_PIC_BLEND;
- }
- dp++;
- }
- srcRowPtr += sib.pitch;
- destRowPtr += destPtr->pixelsPerRow;
- }
- } else if (sib.pixelSize == 3) {
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = sib.pixelPtr;
- destRowPtr = destPtr->bits;
- for (y = 0; y < sh; y++) {
- Blt_Pixel *dp;
- unsigned char *bits, *bend;
-
- dp = destRowPtr;
- for (bits = srcRowPtr, bend = bits + bytesPerRow; bits < bend;
- bits += sib.pixelSize) {
- dp->Red = bits[ir];
- dp->Green = bits[ig];
- dp->Blue = bits[ib];
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- srcRowPtr += sib.pitch;
- destRowPtr += destPtr->pixelsPerRow;
- }
- } else {
- Blt_Pixel *destRowPtr;
- int y;
- unsigned char *srcRowPtr;
-
- srcRowPtr = sib.pixelPtr;
- destRowPtr = destPtr->bits;
- for (y = 0; y < sh; y++) {
- Blt_Pixel *dp;
- unsigned char *bits, *bend;
-
- dp = destRowPtr;
- for (bits = srcRowPtr, bend = bits + bytesPerRow; bits < bend;
- bits += sib.pixelSize) {
- dp->Red = dp->Green = dp->Blue = bits[ir];
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- srcRowPtr += sib.pitch;
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- return destPtr;
-}
-
-/*
- * filter function definitions
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ByteToAsciiHex --
- *
- * Convert a byte to its ASCII hexidecimal equivalent.
- *
- * Results:
- * The converted 2 ASCII character string is returned.
- *
- *---------------------------------------------------------------------------
- */
-INLINE static void
-ByteToAsciiHex(unsigned char byte, char *string)
-{
- static char hexDigits[] = "0123456789ABCDEF";
-
- string[0] = hexDigits[byte >> 4];
- string[1] = hexDigits[byte & 0x0F];
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PictureToDBuffer --
- *
- * Converts a picture to PostScript RGB (3 components) or Greyscale (1
- * component) output. With 3 components, we assume the "colorimage"
- * operator is available.
- *
- * Note: The picture is converted from bottom to top, to conform
- * with the PostScript coordinate system.
- *
- * Results:
- * The PostScript data comprising the picture is written into the dynamic
- * string.
- *
- *---------------------------------------------------------------------------
- */
-Blt_DBuffer
-Blt_PictureToDBuffer(Pict *srcPtr, int nComponents)
-{
- Blt_DBuffer dBuffer;
- int length;
-
- dBuffer = Blt_DBuffer_Create();
- length = srcPtr->width * srcPtr->height * nComponents;
- Blt_DBuffer_Resize(dBuffer, length);
- if (nComponents == 3) {
- Blt_Pixel *srcRowPtr;
- int y;
- unsigned char *bp;
-
- bp = Blt_DBuffer_Pointer(dBuffer);
- srcRowPtr = srcPtr->bits + ((srcPtr->height-1) * srcPtr->pixelsPerRow);
- for (y = (srcPtr->height - 1); y >= 0; y--) {
- Blt_Pixel *sp, *send;
-
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- bp[0] = sp->Red;
- bp[1] = sp->Green;
- bp[2] = sp->Blue;
- bp += 3;
- }
- srcRowPtr -= srcPtr->pixelsPerRow;
- }
- } else if (nComponents == 1) {
- Blt_Pixel *srcRowPtr;
- int y;
- unsigned char *bp;
-
- bp = Blt_DBuffer_Pointer(dBuffer);
- srcRowPtr = srcPtr->bits + ((srcPtr->height-1) * srcPtr->pixelsPerRow);
- for (y = (srcPtr->height - 1); y >= 0; y--) {
- Blt_Pixel *sp, *send;
-
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- *bp++ = sp->Red;
- }
- srcRowPtr -= srcPtr->pixelsPerRow;
- }
- }
- Blt_DBuffer_SetLength(dBuffer, length);
- return dBuffer;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PictureToPsData --
- *
- * Converts a picture to PostScript RGB (3 components) or Greyscale (1
- * component) output. With 3 components, we assume the "colorimage"
- * operator is available.
- *
- * Note: The picture is converted from bottom to top, to conform
- * with the PostScript coordinate system.
- *
- * Results:
- * The PostScript data comprising the picture is written
- * into the dynamic string.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_PictureToPsData(
- Pict *srcPtr, /* Picture to be represented in
- * PostScript. */
- int nComponents, /* # of color components (1 or 3). If
- * it's 1, we only look at red for
- * color information. */
- Tcl_DString *resultPtr, /* (out) Holds the generated
- * postscript */
- const char *prefix) /* Indicates how to prefix the start of
- * each line of output. This is normally
- * used for PostScript previews, where
- * each line is * comment "% ". */
-{
- int count, nLines;
-
- nLines = count = 0;
- if (nComponents == 3) {
- Blt_Pixel *srcRowPtr;
- int y;
-
- srcRowPtr = srcPtr->bits + ((srcPtr->height-1) * srcPtr->pixelsPerRow);
- for (y = (srcPtr->height - 1); y >= 0; y--) {
- Blt_Pixel *sp, *send;
-
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- char string[10];
-
- if (count == 0) {
- Tcl_DStringAppend(resultPtr, prefix, -1);
- Tcl_DStringAppend(resultPtr, " ", -1);
- }
- count += 6;
- ByteToAsciiHex(sp->Red, string);
- ByteToAsciiHex(sp->Green, string + 2);
- ByteToAsciiHex(sp->Blue, string + 4);
- string[6] = '\0';
- if (count >= 60) {
- string[6] = '\n';
- string[7] = '\0';
- count = 0;
- nLines++;
- }
- Tcl_DStringAppend(resultPtr, string, -1);
- }
- srcRowPtr -= srcPtr->pixelsPerRow;
- }
- } else if (nComponents == 1) {
- int y;
- Blt_Pixel *srcRowPtr;
-
- srcRowPtr = srcPtr->bits + ((srcPtr->height-1) * srcPtr->pixelsPerRow);
- for (y = (srcPtr->height - 1); y >= 0; y--) {
- Blt_Pixel *sp, *send;
-
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- char string[10];
- char byte;
-
- if (count == 0) {
- Tcl_DStringAppend(resultPtr, prefix, -1);
- Tcl_DStringAppend(resultPtr, " ", -1);
- }
- count += 2;
- byte = ~(sp->Red);
- ByteToAsciiHex(byte, string);
- string[2] = '\0';
- if (count >= 60) {
- string[2] = '\n';
- string[3] = '\0';
- count = 0;
- nLines++;
- }
- Tcl_DStringAppend(resultPtr, string, -1);
- }
- srcRowPtr -= srcPtr->pixelsPerRow;
- }
- }
- if (count != 0) {
- Tcl_DStringAppend(resultPtr, "\n", -1);
- nLines++;
- }
- return nLines;
-}
-
-static double
-DefaultFilter(double x)
-{
- if (x < 0.0) {
- x = -x;
- }
- if (x < 1.0) {
- /* f(x) = 2x^3 - 3x^2 + 1, -1 <= x <= 1 */
- return (2.0 * x - 3.0) * x * x + 1.0;
- }
- return 0.0;
-}
-
-/* Just for testing */
-static double
-DummyFilter(double x)
-{
- return FABS(x);
-}
-
-/*
- *
- * Finite filters in increasing order:
- * Box (constant)
- * Triangle (linear)
- * Bell
- * BSpline (cubic)
- *
- */
-static double
-BoxFilter(double x)
-{
- if ((x < -0.5) || (x > 0.5)) {
- return 0.0;
- }
- return 1.0;
-}
-
-static double
-TriangleFilter(double x)
-{
- if (x < 0.0) {
- x = -x;
- }
- if (x < 1.0) {
- return (1.0 - x);
- }
- return 0.0;
-}
-
-static double
-BellFilter(double x)
-{
- if (x < 0.0) {
- x = -x;
- }
- if (x < 0.5) {
- return (0.75 - (x * x));
- }
- if (x < 1.5) {
- x = (x - 1.5);
- return (0.5 * (x * x));
- }
- return 0.0;
-}
-
-static double
-BSplineFilter(double x)
-{
- double x2;
-
- if (x < 0.0) {
- x = -x;
- }
- if (x < 1) {
- x2 = x * x;
- return ((.5 * x2 * x) - x2 + (2.0 / 3.0));
- } else if (x < 2) {
- x = 2 - x;
- return ((x * x * x) / 6.0);
- }
- return 0.0;
-}
-
-/*
- *
- * Infinite Filters:
- * Sinc perfect lowpass filter
- * Bessel circularly symmetric 2-D filter
- * Gaussian
- * Lanczos3
- * Mitchell
- */
-
-static double
-SincFilter(double x)
-{
- x *= M_PI;
- if (x == 0.0) {
- return 1.0;
- }
- return (sin(x) / x);
-}
-
-static double
-BesselFilter(double x)
-{
- /*
- * See Pratt "Digital Image Processing" p. 97 for Bessel functions
- * zeros are at approx x=1.2197, 2.2331, 3.2383, 4.2411, 5.2428, 6.2439,
- * 7.2448, 8.2454
- */
-#ifdef __BORLANDC__
- return 0.0;
-#else
- return (x == 0.0) ? M_PI / 4.0 : j1(M_PI * x) / (x + x);
-#endif
-}
-
-#define SQRT_2PI 0.79788456080286541 /* sqrt(2.0 / M_PI) */
-
-static double
-GaussianFilter(double x)
-{
- return exp(-2.0 * x * x) * SQRT_2PI;
-}
-
-static double
-Lanczos3Filter(double x)
-{
- if (x < 0) {
- x = -x;
- }
- if (x < 3.0) {
- return (SincFilter(x) * SincFilter(x / 3.0));
- }
- return 0.0;
-}
-
-#define B 0.3333333333333333 /* (1.0 / 3.0) */
-#define C 0.3333333333333333 /* (1.0 / 3.0) */
-
-static double
-MitchellFilter(double x)
-{
- double x2;
-
- x2 = x * x;
- if (x < 0) {
- x = -x;
- }
- if (x < 1.0) {
- x = (((12.0 - 9.0 * B - 6.0 * C) * (x * x2)) +
- ((-18.0 + 12.0 * B + 6.0 * C) * x2) + (6.0 - 2 * B));
- return (x / 6.0);
- } else if (x < 2.0) {
- x = (((-1.0 * B - 6.0 * C) * (x * x2)) + ((6.0 * B + 30.0 * C) * x2) +
- ((-12.0 * B - 48.0 * C) * x) + (8.0 * B + 24 * C));
- return (x / 6.0);
- }
- return 0.0;
-}
-
-/*
- * Catmull-Rom spline
- */
-static double
-CatRomFilter(double x)
-{
- if (x < -2.) {
- return 0.0;
- }
- if (x < -1.0) {
- return 0.5 * (4.0 + x * (8.0 + x * (5.0 + x)));
- }
- if (x < 0.0) {
- return 0.5 * (2.0 + x * x * (-5.0 + x * -3.0));
- }
- if (x < 1.0) {
- return 0.5 * (2.0 + x * x * (-5.0 + x * 3.0));
- }
- if (x < 2.0) {
- return 0.5 * (4.0 + x * (-8.0 + x * (5.0 - x)));
- }
- return 0.0;
-}
-
-/* approximation to the gaussian integral [x, inf) */
-static double
-GiFilter(double x)
-{
- if (x > 1.5) {
- return 0.0;
- } else if (x < -1.5) {
- return 1.0;
- } else {
-#define I6 0.166666666666667
-#define I4 0.25
-#define I3 0.333333333333333
- double x2 = x * x;
- double x3 = x2 * x;
-
- if (x > 0.5) {
- return .5625 - ( x3 * I6 - 3 * x2 * I4 + 1.125 * x);
- } else if (x > -0.5) {
- return 0.5 - (0.75 * x - x3 * I3);
- } else {
- return 0.4375 + (-x3 * I6 - 3 * x2 * I4 - 1.125 * x);
- }
- }
-}
-
-static ResampleFilter resampleFilters[] =
-{
- /* Name, Function, Support */
- {"bell", BellFilter, 1.5 },
- {"bessel", BesselFilter, 3.2383 },
- {"box", BoxFilter, 0.5 },
- {"bspline", BSplineFilter, 2.0 },
- {"catrom", CatRomFilter, 2.0 },
- {"default", DefaultFilter, 1.0 },
- {"dummy", DummyFilter, 0.5 },
- {"gauss8", GaussianFilter, 8.0 },
- {"gaussian", GaussianFilter, 1.25 },
- {"gi", GiFilter, 4.0 },
- {"gi8", GiFilter, 8.0 },
- {"lanczos3", Lanczos3Filter, 3.0 },
- {"mitchell", MitchellFilter, 2.0 },
- {"none", (Blt_ResampleFilterProc *)NULL, 0.0 },
- {"sinc", SincFilter, 4.0 },
- {"sinc8", SincFilter, 8.0 },
- {"sinc12", SincFilter, 12.0 },
- {"tent", TriangleFilter, 1.0 },
- {"triangle", TriangleFilter, 1.0 },
-};
-
-static int nFilters = sizeof(resampleFilters) / sizeof(ResampleFilter);
-
-Blt_ResampleFilter bltBoxFilter = &(resampleFilters[2]);
-Blt_ResampleFilter bltMitchellFilter = &(resampleFilters[11]);
-Blt_ResampleFilter bltBellFilter = &(resampleFilters[0]);
-Blt_ResampleFilter bltTentFilter = &(resampleFilters[16]);
-
-const char *
-Blt_NameOfResampleFilter(ResampleFilter *filterPtr)
-{
- return filterPtr->name;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetResampleFilterFromObj --
- *
- * Finds a 1-D filter associated by the given filter name.
- *
- * Results:
- * A standard TCL result. Returns TCL_OK is the filter was found. The
- * filter information (proc and support) is returned via
- * filterPtrPtr. Otherwise TCL_ERROR is returned and an error message is
- * left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetResampleFilterFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- ResampleFilter **filterPtrPtr)
-{
- ResampleFilter *fp, *fend;
- const char *string;
-
- string = Tcl_GetString(objPtr);
- for (fp = resampleFilters, fend = fp + nFilters; fp < fend; fp++) {
- if (strcmp(string, fp->name) == 0) {
- *filterPtrPtr = (fp->proc == NULL) ? NULL : fp;
- return TCL_OK;
- }
- }
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find filter \"", string, "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
-}
-
-#ifdef notdef
-int
-Blt_GetTableFilterFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- TableFilter **filterPtrPtr)
-{
- TableFilter *filterPtr;
- Tcl_Obj **objv;
- double scale;
- int objc;
-
- /* Next see if it's a table (list of numbers) */
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR; /* Can't split object. */
- }
- if (Tcl_GetDoubleFromObj(interp, objv[0], &scale) != TCL_OK) {
- return TCL_ERROR;
- }
- objc--, objv++;
- if ((objc & 0x1) == 0) {
- Tcl_AppendResult(interp, "# of values in 1-D filter \"", string,
- "\" must be odd", (char *)NULL);
- return TCL_ERROR;
- }
- filterPtr = Blt_AssertMalloc(sizeof(TableFilter) + (sizeof(int) * objc));
- filterPtr->nWeights = objc;
- filterPtr->scale = (float)scale;
- {
- int *tp, *tend, i;
-
- i = 0;
- for (tp = filterPtr->table, tend < tp + objc; tp < tend; tp++, i++) {
- if (Tcl_GetIntFromObj(interp, objv[i], tp) != TCL_OK) {
- Blt_Free(filterPtr);
- return TCL_ERROR;
- }
- }
- }
- *filterPtrPtr = filterPtr;
- return TCL_OK;
-}
-#endif
-
-unsigned int
-Blt_ComputeWeights(unsigned int sw, unsigned int dw, ResampleFilter *filterPtr,
- Sample **samplePtrPtr)
-{
- Sample *samples;
- double scale;
- size_t bytesPerSample;
-
- /* Pre-calculate filter contributions for a row or column. */
- scale = (double)dw / (double)sw;
- if (scale < 1.0) {
- Sample *samplePtr;
- double r, fscale;
- int filterSize, x;
-
- /* Downsample */
-
- r = filterPtr->support / scale;
- fscale = 1.0 / scale;
- filterSize = (int)(r * 2 + 2);
-
- bytesPerSample = sizeof(Sample) +
- ((filterSize - 1) * sizeof(PixelWeight));
- samples = Blt_AssertCalloc(dw, bytesPerSample);
- samplePtr = samples;
-#define DEBUG 0
-#if DEBUG
- fprintf(stderr, "downscale=%g, fscale=%g, radius=%g\n",
- scale, fscale, r);
-#endif
- for (x = 0; x < dw; x++) {
- PixelWeight *wp;
- double sum, center, factor;
- int i, left, right; /* filter bounds */
-
- center = ((double)x) * fscale;
-
- /* Determine bounds of filter and its density */
-#ifndef notdef
- left = (int)/*floor*/(center - r);
-#else
- left = CRoundToInt(center - r);
-#endif
- if (left < 0) {
- left = 0;
- }
-#ifndef notdef
- right = (int)/*floor*/(center + r);
-#else
- right = CRoundToInt(center + r);
-#endif
- if (right >= sw) {
- right = sw - 1;
- }
- samplePtr->start = left;
- samplePtr->wend = samplePtr->weights + (right - left + 1);
-
- sum = 0.0;
- for (wp = samplePtr->weights, i = left; i <= right; i++, wp++) {
- double val = ((double)i - center) * scale;
- wp->f32 = (float)(*filterPtr->proc)(val);
- sum += wp->f32;
- }
-
- factor = (sum == 0.0) ? 1.0 : (1.0 / sum);
- for (wp = samplePtr->weights; wp < samplePtr->wend; wp++) {
- wp->f32 = (float)(wp->f32 * factor);
- wp->i32 = float2si(wp->f32);
- }
- samplePtr = (Sample *)((char *)samplePtr + bytesPerSample);
- }
- } else {
- Sample *samplePtr;
- double fscale;
- int filterSize, x;
-
- /* Upsample */
-
- filterSize = (int)(filterPtr->support * 2 + 2);
- bytesPerSample = sizeof(Sample) +
- ((filterSize - 1) * sizeof(PixelWeight));
- samples = Blt_AssertCalloc(dw, bytesPerSample);
- fscale = 1.0 / scale;
-
- samplePtr = samples;
-#if DEBUG
- fprintf(stderr, "upscale=%g, fscale=%g, radius=%g\n",
- scale, fscale, filterPtr->support);
-#endif
- for (x = 0; x < dw; x++) {
- PixelWeight *wp;
- double sum, center, factor;
- int i, left, right; /* filter bounds */
-
- center = ((double)x) * fscale;
-#ifndef notdef
- left = (int)(center - filterPtr->support);
-#else
- left = CRoundToInt(center - filterPtr->support);
-#endif
- if (left < 0) {
- left = 0;
- }
-#ifndef notdef
- right = (int)(center + filterPtr->support);
-#else
- right = CRoundToInt(center + filterPtr->support);
-#endif
- if (right >= sw) {
- right = sw - 1;
- }
- samplePtr->start = left;
- samplePtr->wend = samplePtr->weights + (right - left + 1);
-
- /* Sum the contributions for each pixel in the filter. */
- sum = 0.0;
- for (wp = samplePtr->weights, i = left; i <= right;i++, wp++) {
- wp->f32 = (float) (*filterPtr->proc) ((double)i - center);
- sum += wp->f32;
- }
-
- /* The sum of the contributions should not be greater than 1.0 */
- factor = (sum == 0.0) ? 1.0 : (1.0 / sum);
-
- for (wp = samplePtr->weights; wp < samplePtr->wend; wp++) {
-#ifdef notdef
- fprintf(stderr, "w[%d]=%g, %g sum=%g\n",
- wp - samplePtr->weights,
- wp->f32, wp->f32 * factor, sum);
-#endif
- wp->f32 = (float)(wp->f32 * factor);
- /* Convert each weight into a fixed-point scaled integer */
- wp->i32 = float2si(wp->f32);
-
- }
- /* Go to the next sample. */
- samplePtr = (Sample *)((char *)samplePtr + bytesPerSample);
- }
- }
- *samplePtrPtr = samples;
- return bytesPerSample;
-}
-
-static void
-ZoomVertically(Pict *destPtr, Pict *srcPtr, Blt_ResampleFilter filter)
-{
- Sample *samples, *send;
- int x;
- int bytesPerSample; /* Size of sample. */
-
- /* Pre-calculate filter contributions for each row. */
- bytesPerSample = Blt_ComputeWeights(srcPtr->height, destPtr->height,
- filter, &samples);
- send = (Sample *)((char *)samples + (destPtr->height * bytesPerSample));
-
- /* Apply filter to each row. */
- for (x = 0; x < srcPtr->width; x++) {
- Blt_Pixel *dp, *srcColPtr;
- Sample *samplePtr;
- int dummy;
-
- srcColPtr = srcPtr->bits + x;
- dp = destPtr->bits + x;
- for (samplePtr = samples; samplePtr < send;
- samplePtr = (Sample *)((char *)samplePtr + bytesPerSample)) {
- Blt_Pixel *sp;
- int r, g, b, a;
- PixelWeight *wp;
-
- r = g = b = a = 0;
- sp = srcColPtr + (samplePtr->start * srcPtr->pixelsPerRow);
- for (wp = samplePtr->weights; wp < samplePtr->wend; wp++) {
- a += wp->i32 * sp->Alpha;
- r += wp->i32 * sp->Red;
- g += wp->i32 * sp->Green;
- b += wp->i32 * sp->Blue;
- sp += srcPtr->pixelsPerRow;
- }
- dummy = 0;
- dp->Alpha = SICLAMP(a);
- dp->Red = SICLAMP(r);
- dp->Green = SICLAMP(g);
- dp->Blue = SICLAMP(b);
-#ifdef notdef
- if (dp->Alpha != 0xFF) {
- fprintf(stdout, "v1: alpha=0x%x\n", dp->Alpha);
- }
-#endif
- dp += destPtr->pixelsPerRow;
-
- }
- }
- /* Free the memory allocated for filter weights. */
- Blt_Free(samples);
-}
-
-static void
-ZoomHorizontally(Pict *destPtr, Pict *srcPtr, Blt_ResampleFilter filter)
-{
- Sample *samples, *send;
- int y;
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int bytesPerSample; /* Size of sample. */
-
- /* Pre-calculate filter contributions for each column. */
- bytesPerSample = Blt_ComputeWeights(srcPtr->width, destPtr->width,
- filter, &samples);
- send = (Sample *)((char *)samples + (destPtr->width * bytesPerSample));
-
- /* Apply filter to each column. */
- srcRowPtr = srcPtr->bits;
- destRowPtr = destPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *dp;
- Sample *samplePtr;
-
- dp = destRowPtr;
- for (samplePtr = samples; samplePtr < send;
- samplePtr = (Sample *)((char *)samplePtr + bytesPerSample)) {
- Blt_Pixel *sp;
- int r, g, b, a;
- PixelWeight *wp;
-
- r = g = b = a = 0;
- sp = srcRowPtr + samplePtr->start;
- for (wp = samplePtr->weights; wp < samplePtr->wend; wp++) {
- a += wp->i32 * sp->Alpha;
- r += wp->i32 * sp->Red;
- g += wp->i32 * sp->Green;
- b += wp->i32 * sp->Blue;
- sp++;
- }
- dp->Alpha = SICLAMP(a);
- dp->Red = SICLAMP(r);
- dp->Green = SICLAMP(g);
- dp->Blue = SICLAMP(b);
-#ifdef notdef
- if (dp->Alpha != 0xFF) {
- fprintf(stdout, "h1: alpha=0x%x\n", dp->Alpha);
- }
-#endif
- dp++;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- /* Free the memory allocated for horizontal filter weights. */
- Blt_Free(samples);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ResamplePicture --
- *
- * Resamples a given picture using 1-D filters and returns a new picture
- * of the designated size.
- *
- * Results:
- * Returns the resampled picture. The original picture
- * is left intact.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ResamplePicture(Pict *destPtr, Pict *srcPtr, Blt_ResampleFilter hFilter,
- Blt_ResampleFilter vFilter)
-{
- Pict *tmpPtr;
-
- tmpPtr = Blt_CreatePicture(destPtr->width, srcPtr->height);
-
- /*
- * It's usually faster to zoom vertically last. This has to do with the
- * fact that pictures are stored in contiguous rows.
- */
- Blt_ZoomHorizontally(tmpPtr, srcPtr, hFilter);
- Blt_ZoomVertically(destPtr, tmpPtr, vFilter);
- Blt_FreePicture(tmpPtr);
- destPtr->flags = srcPtr->flags;
- destPtr->flags |= BLT_PIC_DIRTY;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ResamplePhoto --
- *
- * Resamples a Tk photo image using 1-D filters and writes the image into
- * another Tk photo. It is possible for the source and destination to be
- * the same photo.
- *
- * Results:
- * The designated destination photo will contain the resampled
- * picture. The original photo is left intact.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ResamplePhoto(
- Tk_PhotoHandle srcPhoto, /* Source photo image to scale */
- int x, int y,
- int width, int height,
- Tk_PhotoHandle destPhoto, /* Resulting scaled photo image */
- Blt_ResampleFilter hFilter,
- Blt_ResampleFilter vFilter)
-{
- Blt_Picture src, dest;
- Tk_PhotoImageBlock dib;
-
- Tk_PhotoGetImage(destPhoto, &dib);
- src = Blt_PhotoAreaToPicture(srcPhoto, x, y, width, height);
- dest = Blt_CreatePicture(dib.width, dib.height);
- Blt_ResamplePicture(dest, src, hFilter, vFilter);
- Blt_FreePicture(src);
- Blt_PictureToPhoto(dest, destPhoto);
- Blt_FreePicture(dest);
-}
-#endif
-
-static void
-FillScaleTables(
- int sw, int sh, /* Dimension of source. */
- int ax, int ay, /* Origin of requested area. */
- int aw, int ah, /* Dimension of requested area. */
- int dw, int destHeight, /* Desired new dimension. */
- int *mapX, int *mapY) /* (out) Resulting mapping tables. */
-{
- int left, right, top, bottom;
- double xScale, yScale;
- int x, y;
-
- left = ax;
- top = ay;
- right = MIN(sw, ax + aw) - 1;
- bottom = MIN(sh, ay + ah) - 1;
-
- xScale = (double)aw / (double)dw;
- for (x = 0; x < dw; x++) {
- int sx;
-
- sx = (int)(xScale * (double)x);
- sx += left;
- if (sx > right) {
- sx = right;
- }
- mapX[x] = sx;
- }
- yScale = (double)ah / (double)destHeight;
- for (y = 0; y < destHeight; y++) {
- int sy;
-
- sy = (int)(yScale * (double)y);
- sy += top;
- if (sy > bottom) {
- sy = bottom;
- }
- mapY[y] = sy;
- }
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ResizePhoto --
- *
- * Scales the region of the source image to the size of the destination
- * image. This routine performs raw scaling of the image and unlike
- * Blt_ResamplePhoto does not handle aliasing effects from subpixel
- * sampling. It is possible for the source and destination to be the same
- * photo.
- *
- * Results:
- * The designated destination photo will contain the resampled
- * picture. The original photo is left intact.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ResizePhoto(
- Tk_PhotoHandle srcPhoto, /* Source photo image to scaled. */
- int srcX, int srcY, /* Area of source photo to be scaled. */
- int sw, int sh,
- Tk_PhotoHandle destPhoto) /* (out) Resulting scaled photo image.
- * Scaling factors are derived from the
- * destination photo's dimensions. */
-{
- Pict *destPtr;
- Tk_PhotoImageBlock sib, dib; /* Source and destination image
- * blocks. */
- int *mapX, *mapY;
- int ir, ib, ig, ia;
-
- Tk_PhotoGetImage(srcPhoto, &sib);
- Tk_PhotoGetImage(destPhoto, &dib);
- mapX = (int *)Blt_AssertMalloc(sizeof(int) * dib.width);
- mapY = (int *)Blt_AssertMalloc(sizeof(int) * dib.height);
- FillScaleTables(sib.width, sib.height, srcX, srcY, sw,
- sh, dib.width, dib.height, mapX, mapY);
-
- destPtr = Blt_CreatePicture(dib.width, dib.height);
- ir = sib.offset[0];
- ig = sib.offset[1];
- ib = sib.offset[2];
- ia = sib.offset[3];
-
- if (sib.pixelSize == 4) {
- Blt_Pixel *destRowPtr;
- int x, y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < dib.height; y++) {
- Blt_Pixel *dp;
- unsigned char *srcRowPtr;
-
- dp = destRowPtr;
- srcRowPtr = sib.pixelPtr + (mapY[y] * sib.pitch);
- for (x = 0; x < dib.width; x++) {
- unsigned char *sp;
-
- sp = srcRowPtr + (mapX[x] * sib.pixelSize);
- dp->Red = sp[ir];
- dp->Green = sp[ig];
- dp->Blue = sp[ib];
- dp->Alpha = sp[ia];
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- } else if (sib.pixelSize == 3) {
- Blt_Pixel *destRowPtr;
- int x, y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < dib.height; y++) {
- Blt_Pixel *dp;
- unsigned char *srcRowPtr;
-
- dp = destRowPtr;
- srcRowPtr = sib.pixelPtr + (mapY[y] * sib.pitch);
- for (x = 0; x < dib.width; x++) {
- unsigned char *sp;
-
- sp = srcRowPtr + (mapX[x] * sib.pixelSize);
- dp->Red = sp[ir];
- dp->Green = sp[ig];
- dp->Blue = sp[ib];
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- } else {
- Blt_Pixel *destRowPtr;
- int x, y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < dib.height; y++) {
- Blt_Pixel *dp;
- unsigned char *srcRowPtr;
-
- dp = destRowPtr;
- srcRowPtr = sib.pixelPtr + (mapY[y] * sib.pitch);
- for (x = 0; x < dib.width; x++) {
- unsigned char *sp;
-
- sp = srcRowPtr + (mapX[x] * sib.pixelSize);
- dp->Red = dp->Green = dp->Blue = sp[ir];
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- Blt_Free(mapX);
- Blt_Free(mapY);
- Blt_PictureToPhoto(destPtr, destPhoto);
- Blt_FreePicture(destPtr);
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ScalePicture --
- *
- * Scales the region of the source picture to the size requested. This
- * routine performs raw scaling of the image and unlike Blt_ResamplePhoto
- * does not do any filtering.
- *
- * src picture
- * +===================+
- * | | dest picture
- * | | +==============+
- * | x,y | | |
- * | *-------* | | |
- * | | area | | | |
- * | | | | | |
- * | | | height | | |
- * | | | | | |
- * | *-------* | | |
- * | width | | |
- * | | +==============+
- * | |
- * +===================+
- *
- * x ratio = dest width / area width
- * y ratio = dest height / area height
- *
- *
- * Results:
- * Returns the new resized picture. The original picture is left intact.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_ScalePicture(
- Pict *srcPtr, /* Source picture to be scaled. */
- int sx, int sy, /* Area of source picture to scaled. */
- int sw, int sh,
- int reqWidth, int reqHeight) /* Requested dimensions of the scaled
- * picture. */
-{
- Pict *destPtr;
- Blt_Pixel *destRowPtr;
- int *mapX, *mapY;
- int y;
-
- mapX = (int *)Blt_AssertMalloc(sizeof(int) * reqWidth);
- mapY = (int *)Blt_AssertMalloc(sizeof(int) * reqHeight);
- FillScaleTables(srcPtr->width, srcPtr->height, sx, sy, sw, sh,
- reqWidth, reqHeight, mapX, mapY);
-
- destPtr = Blt_CreatePicture(reqWidth, reqHeight);
- destRowPtr = destPtr->bits;
- for (y = 0; y < reqHeight; y++) {
- Blt_Pixel *dp;
- Blt_Pixel *srcRowPtr;
- int x;
-
- dp = destRowPtr;
- srcRowPtr = srcPtr->bits + (srcPtr->pixelsPerRow * mapY[y]);
- for (x = 0; x < reqWidth; x++) {
- Blt_Pixel *sp;
-
- sp = srcRowPtr + mapX[x];
- dp->u32 = sp->u32; /* Copy the pixel. */
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- Blt_Free(mapX), Blt_Free(mapY);
- destPtr->flags = (srcPtr->flags | BLT_PIC_DIRTY);
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ScalePictureArea --
- *
- * Scales the region of the source picture to the size of the destination
- * image. This routine performs raw scaling of the image and unlike
- * Blt_ResamplePhoto does not perform any antialiasing.
- *
- * Results:
- * Returns the new resized picture. The original picture is left intact.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_ScalePictureArea(
- Pict *srcPtr, /* Source picture to be scaled. */
- int ax, int ay, /* Origin of area in source picture. */
- int aw, int ah, /* Dimension of area to be scaled. */
- int dw, int dh) /* Dimensions of the destination scaled
- image. */
-{
- Pict *destPtr;
- Blt_Pixel *srcRowPtr, *destRowPtr;
- double xScale, yScale;
- int *mapX, *mapY;
- int x, y;
-
- xScale = (double)srcPtr->width / (double)dw;
- yScale = (double)srcPtr->height / (double)dh;
- mapX = Blt_AssertMalloc(sizeof(int) * aw);
- mapY = Blt_AssertMalloc(sizeof(int) * ah);
-
- /* Precompute scaling factors for each row and column. */
- for (x = 0; x < aw; x++) {
- int sx;
-
- sx = (int)(xScale * (double)(x + ax));
- if (sx >= srcPtr->width) {
- sx = srcPtr->width - 1;
- }
- mapX[x] = sx;
- }
- for (y = 0; y < ah; y++) {
- int sy;
-
- sy = (int)(yScale * (double)(y + ay));
- if (sy > srcPtr->height) {
- sy = srcPtr->height - 1;
- }
- mapY[y] = sy;
- }
-
- destPtr = Blt_CreatePicture(aw, ah);
- destRowPtr = destPtr->bits;
- for (y = 0; y < ah; y++) {
- Blt_Pixel *dp;
-
- dp = destRowPtr;
- srcRowPtr = srcPtr->bits + (srcPtr->pixelsPerRow * mapY[y]);
- for (x = 0; x < aw; x++) {
- Blt_Pixel *sp;
-
- sp = srcRowPtr + mapX[x];
- dp->u32 = sp->u32; /* Copy the pixel. */
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- Blt_Free(mapX), Blt_Free(mapY);
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_SnapPhoto --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and writes it to
- * an existing Tk photo image.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * The named Tk photo is updated with the snapshot.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_SnapPhoto(
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to */
- Tk_Window tkwin,
- Drawable drawable, /* Window or pixmap to be snapped */
- int x, int y, /* Offset of image from drawable
- * origin. */
- int width, int height, /* Dimension of the drawable */
- int dw, int dh, /* Desired size of the destination Tk
- * photo. */
- const char *photoName, /* Name of a current Tk photo image. */
- float gamma)
-{
- Tk_PhotoHandle photo; /* The photo image to write into. */
- Blt_Picture pict;
-
- photo = Tk_FindPhoto(interp, photoName);
- if (photo == NULL) {
- Tcl_AppendResult(interp, "can't find photo \"", photoName, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- pict = Blt_DrawableToPicture(tkwin, drawable, x, y, width, height, gamma);
- if (pict == NULL) {
- Tcl_AppendResult(interp,
- "can't grab window or pixmap (possibly obscured?)", (char *)NULL);
- return TCL_ERROR; /* Can't grab window image */
- }
- if ((dw != width) || (dh != height)) {
- Blt_Picture dest;
-
- /*
- * The requested size for the destination image is different than that
- * of the source snapshot. Resample the image as necessary. We'll
- * use a cheap box filter. I'm assuming that the destination image
- * will typically be smaller than the original.
- */
- dest = Blt_CreatePicture(dw, dh);
- Blt_ResamplePicture(dest, pict, bltBoxFilter, bltBoxFilter);
- Blt_FreePicture(pict);
- pict = dest;
- }
- Blt_PictureToPhoto(pict, photo);
- Blt_FreePicture(pict);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_SnapPhoto --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and writes it to
- * an existing Tk photo image.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * The named Tk photo is updated with the snapshot.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_SnapPicture(
- Tcl_Interp *interp, /* Interpreter to return results. */
- Tk_Window tkwin,
- Drawable drawable, /* Window or pixmap to be snapped */
- int x, int y, /* Offset of image in drawable
- * origin. */
- int width, int height, /* Dimension of the drawable. */
- int dw, int dh, /* Desired size of the destination
- * picture. */
- const char *imageName, /* Name of a current picture image. */
- float gamma)
-{
- Blt_Picture pict;
-
- pict = Blt_DrawableToPicture(tkwin, drawable, x, y, width, height, gamma);
- if (pict == NULL) {
- Tcl_AppendResult(interp,
- "can't grab window or pixmap (possibly obscured?)", (char *)NULL);
- return TCL_ERROR; /* Can't grab window image */
- }
- if ((dw != width) || (dh != height)) {
- Blt_Picture dest;
-
- /*
- * The requested size for the destination image is different than that
- * of the source snapshot. Resample the image as necessary. We'll
- * use a cheap box filter. I'm assuming that the destination image
- * will typically be smaller than the original.
- */
- dest = Blt_CreatePicture(dw, dh);
- Blt_ResamplePicture(dest, pict, bltBoxFilter, bltBoxFilter);
- Blt_FreePicture(pict);
- pict = dest;
- }
- if (Blt_ResetPicture(interp, imageName, pict) == TCL_OK) {
- return TCL_OK;
- }
- Blt_FreePicture(pict);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShearY --
- *
- * Shears a row horizontally. Antialiasing limited to filtering two
- * adjacent pixels. So the shear angle must be between +-45 degrees.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The sheared image is drawn into the destination picture.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ShearY(
- Pict *destPtr,
- Pict *srcPtr,
- int y, /* Designates the row to be sheared */
- int offset, /* Difference between of. Note: don't
- * assume that offset is always
- * positive. */
- double frac,
- Blt_Pixel *bg)
-{
- Blt_Pixel *sp, *dp;
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int x, dx;
- Blt_Pixel left;
- unsigned char alpha;
- int t;
-
- assert(frac >= 0.0 && frac <= 1.0);
- destRowPtr = destPtr->bits + (y * destPtr->pixelsPerRow);
- srcRowPtr = srcPtr->bits + (y * srcPtr->pixelsPerRow);
-
- for (dp = destRowPtr, x = 0; x < offset; x++, dp++) {
- dp->u32 = bg->u32;
- }
- dp = destRowPtr + offset;
- sp = srcRowPtr;
- dx = offset;
-
- alpha = (unsigned char)(frac * 255.0 + 0.5);
- left.Red = imul8x8(alpha, bg->Red, t);
- left.Green = imul8x8(alpha, bg->Green, t);
- left.Blue = imul8x8(alpha, bg->Blue, t);
- left.Alpha = imul8x8(alpha, bg->Alpha, t);
-
- for (x = 0; x < srcPtr->width; x++, dx++) { /* Loop through row pixels */
- Blt_Pixel right;
- int t;
-
- right.Red = imul8x8(alpha, sp->Red, t);
- right.Green = imul8x8(alpha, sp->Green, t);
- right.Blue = imul8x8(alpha, sp->Blue, t);
- right.Alpha = imul8x8(alpha, sp->Alpha, t);
- if ((dx >= 0) && (dx < destPtr->width)) {
- int r, b, g, a;
-
- r = sp->Red - (right.Red - left.Red);
- g = sp->Green - (right.Green - left.Green);
- b = sp->Blue - (right.Blue - left.Blue);
- a = sp->Alpha - (right.Alpha - left.Alpha);
- if (sp->Alpha == 0) {
- a = 0;
- }
- dp->Red = UCLAMP(r);
- dp->Green = UCLAMP(g);
- dp->Blue = UCLAMP(b);
- dp->Alpha = UCLAMP(a);
- }
- left.u32 = right.u32;
- sp++, dp++;
- }
- x = srcPtr->width + offset;
- dp = destPtr->bits + (y * destPtr->pixelsPerRow) + x;
- if (x < destPtr->width) {
- dp->u32 = left.u32;
- dp++;
- }
- for (x++; x < destPtr->width; x++, dp++) {
- dp->u32 = bg->u32;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShearX --
- *
- * Shears a column. Antialiasing is limited to filtering two adjacent
- * pixels. So the shear angle must be between +-45 degrees.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The sheared image is drawn into the destination picture.
- *
- * --------------------------------------------------------------------------
- */
-static void
-ShearX(
- Pict *destPtr,
- Pict *srcPtr,
- int x, /* Column in source image to be
- * sheared. */
- int offset, /* Offset of */
- double frac, /* Fraction of subpixel. */
- Blt_Pixel *bg)
-{
- Blt_Pixel *sp, *dp;
- int y, dy;
- unsigned char alpha;
- Blt_Pixel left; /* Old left values of shear. */
- int t;
-
- assert(frac >= 0.0 && frac <= 1.0);
- dp = destPtr->bits + x;
- for (y = 0; y < offset; y++) {
- dp->u32 = bg->u32;
- dp += destPtr->pixelsPerRow;
- }
-
-
- dp = destPtr->bits + (offset * destPtr->pixelsPerRow) + x;
- sp = srcPtr->bits + x;
- alpha = (unsigned char)(frac * 255.0 + 0.5);
- left.Red = imul8x8(alpha, bg->Red, t);
- left.Green = imul8x8(alpha, bg->Green, t);
- left.Blue = imul8x8(alpha, bg->Blue, t);
- left.Alpha = imul8x8(alpha, bg->Alpha, t);
- for (dy = offset, y = 0; y < srcPtr->height; y++, dy++) {
- Blt_Pixel right;
- int t;
-
- right.Red = imul8x8(alpha, sp->Red, t);
- right.Green = imul8x8(alpha, sp->Green, t);
- right.Blue = imul8x8(alpha, sp->Blue, t);
- right.Alpha = imul8x8(alpha, sp->Alpha, t);
- if ((dy >= 0) && (dy < destPtr->height)) {
- int r, g, b, a;
-
- r = sp->Red - (right.Red - left.Red);
- g = sp->Green - (right.Green - left.Green);
- b = sp->Blue - (right.Blue - left.Blue);
- a = sp->Alpha - (right.Alpha - left.Alpha);
- if (sp->Alpha == 0) {
- a = 0;
- }
- dp->Red = UCLAMP(r);
- dp->Green = UCLAMP(g);
- dp->Blue = UCLAMP(b);
- dp->Alpha = UCLAMP(a);
- }
- left.u32 = right.u32;
- sp += srcPtr->pixelsPerRow;
- dp += destPtr->pixelsPerRow;
- }
- y = srcPtr->height + offset;
-
- dp = destPtr->bits + (y * destPtr->pixelsPerRow) + x;
- if (y < destPtr->height) {
- dp->u32 = left.u32;
- dp += destPtr->pixelsPerRow;
- }
-
- for (y++; y < destPtr->height; y++) {
- dp->u32 = bg->u32;
- dp += destPtr->pixelsPerRow;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Rotate45 --
- *
- * Rotates an image by a given angle. The angle must be in the range
- * -45.0 to 45.0 inclusive. Anti-aliasing filtering is performed on two
- * adjacent pixels, so the angle can't be so great as to force a sheared
- * pixel to occupy 3 destination pixels. Performs a three shear rotation
- * described below.
- *
- * Reference: Alan W. Paeth, "A Fast Algorithm for General Raster
- * Rotation", Graphics Gems, pp 179-195.
- *
- *
- * Results:
- * Returns a newly allocated rotated image.
- *
- * --------------------------------------------------------------------------
- */
-static Blt_Picture
-Rotate45(Pict *srcPtr, float angle, Blt_Pixel *bg)
-{
- Pict *shear1Ptr, *shear2Ptr, *destPtr;
- double skewf;
- double sinTheta, cosTheta, tanTheta;
- int skewi;
- int shearWidth, shearHeight;
- int x, y;
-
- sinTheta = sin(angle);
- cosTheta = cos(angle);
- tanTheta = tan(angle * 0.5);
-
- shearWidth = srcPtr->width + (int)(srcPtr->height * FABS(tanTheta));
- shearHeight = srcPtr->height;
-
- /* 1st shear */
-
- shear1Ptr = Blt_CreatePicture(shearWidth, shearHeight);
- if (tanTheta >= 0.0) { /* Positive angle */
- for (y = 0; y < shearHeight; y++) {
- skewf = (y + 0.5) * tanTheta;
- skewi = (int)floor(skewf);
- ShearY(shear1Ptr, srcPtr, y, skewi, skewf - skewi, bg);
- }
- } else { /* Negative angle */
- for (y = 0; y < shearHeight; y++) {
- skewf = ((y - srcPtr->height) + 0.5) * tanTheta;
- skewi = (int)floor(skewf);
- ShearY(shear1Ptr, srcPtr, y, skewi, skewf - skewi, bg);
- }
- }
- shearHeight =
- (int)(srcPtr->width * FABS(sinTheta) + srcPtr->height * cosTheta) + 1;
-
- shear2Ptr = Blt_CreatePicture(shearWidth, shearHeight);
- /* 2nd shear */
-
- if (sinTheta > 0.0) { /* Positive angle */
- skewf = (srcPtr->width - 1) * sinTheta;
- } else { /* Negative angle */
- skewf = (srcPtr->width - shearWidth) * -sinTheta;
- }
- for (x = 0; x < shearWidth; x++) {
- skewi = (int)floor(skewf);
- ShearX(shear2Ptr, shear1Ptr, x, skewi, skewf - skewi, bg);
- skewf -= sinTheta;
- }
-
- Blt_FreePicture(shear1Ptr);
-
- /* 3rd shear */
-
- shearWidth =
- (int)(srcPtr->height * FABS(sinTheta) + srcPtr->width * cosTheta) + 1;
-
- destPtr = Blt_CreatePicture(shearWidth, shearHeight);
- if (sinTheta >= 0.0) { /* Positive angle */
- skewf = (srcPtr->width - 1) * sinTheta * -tanTheta;
- } else { /* Negative angle */
- skewf = tanTheta * ((srcPtr->width - 1) * -sinTheta - (shearHeight-1));
- }
- for (y = 0; y < shearHeight; y++) {
- skewi = (int)floor(skewf);
- ShearY(destPtr, shear2Ptr, y, skewi, skewf - skewi, bg);
- skewf += tanTheta;
- }
- Blt_FreePicture(shear2Ptr);
- destPtr->flags |= BLT_PIC_BLEND;
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ClonePicture --
- *
- * Creates a copy of the given picture.
- *
- * Results:
- * Returns the new copy.
- *
- * --------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_ClonePicture(Pict *srcPtr)
-{
- Pict *destPtr;
-
- destPtr = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- Blt_CopyPictureBits(destPtr, srcPtr, 0, 0, srcPtr->width, srcPtr->height,
- 0, 0);
- destPtr->delay = srcPtr->delay;
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Rotate90 --
- *
- * Rotates the given picture by 90 degrees. This is part of the special
- * case right-angle rotations that do not create subpixel aliasing.
- *
- * Results:
- * Returns a newly allocated, rotated picture.
- *
- * --------------------------------------------------------------------------
- */
-static Blt_Picture
-Rotate90(Pict *srcPtr)
-{
- Pict *destPtr;
- Blt_Pixel *srcRowPtr;
- int offset;
- int x, y;
-
- destPtr = Blt_CreatePicture(srcPtr->height, srcPtr->width);
- offset = (destPtr->height - 1) * destPtr->pixelsPerRow;
- srcRowPtr = srcPtr->bits;
- for (x = 0; x < destPtr->width; x++) {
- Blt_Pixel *dp, *sp;
-
- sp = srcRowPtr;
- dp = destPtr->bits + offset + x;
- for (y = 0; y < destPtr->height; y++) {
- *dp = *sp++;
- dp -= destPtr->pixelsPerRow;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- destPtr->flags = srcPtr->flags;
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Rotate180 --
- *
- * Rotates the given picture by 180 degrees. This is one of the special
- * case orthogonal rotations that do not create subpixel aliasing.
- *
- * Results:
- * Returns a newly allocated, rotated picture.
- *
- * --------------------------------------------------------------------------
- */
-static Blt_Picture
-Rotate180(Pict *srcPtr)
-{
- Pict *destPtr;
- Blt_Pixel *srcRowPtr;
- int offset;
- int x, y;
-
- destPtr = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- offset = (destPtr->height - 1) * destPtr->pixelsPerRow;
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < destPtr->height; y++) {
- Blt_Pixel *dp, *sp;
-
- sp = srcRowPtr;
- dp = destPtr->bits + offset + destPtr->width - 1;
- for (x = 0; x < destPtr->width; x++) {
- *dp-- = *sp++;
- }
- offset -= destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- destPtr->flags = srcPtr->flags;
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Rotate270 --
- *
- * Rotates the given picture by 270 degrees. This is part of the special
- * case right-angle rotations that do not create subpixel aliasing.
- *
- * Results:
- * Returns a newly allocated, rotated picture.
- *
- * --------------------------------------------------------------------------
- */
-static Blt_Picture
-Rotate270(Pict *srcPtr)
-{
- Pict *destPtr;
- Blt_Pixel *srcRowPtr;
- int x, y;
-
- destPtr = Blt_CreatePicture(srcPtr->height, srcPtr->width);
-
- srcRowPtr = srcPtr->bits;
- for (x = destPtr->width - 1; x >= 0; x--) {
- Blt_Pixel *sp, *dp;
-
- sp = srcRowPtr;
- dp = destPtr->bits + x;
- for (y = 0; y < destPtr->height; y++) {
- *dp = *sp++;
- dp += destPtr->pixelsPerRow;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- destPtr->flags = srcPtr->flags;
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RotatePicture --
- *
- * Rotates a picture by a given # of degrees.
- *
- * Results:
- * Returns a newly allocated, rotated picture.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_RotatePicture(Pict *srcPtr, float angle)
-{
- Pict *destPtr, *tmpPtr;
- int quadrant;
-
- tmpPtr = srcPtr; /* Suppress compiler warning. */
-
- /* Make the angle positive between 0 and 360 degrees. */
- angle = FMOD(angle, 360.0);
- if (angle < 0.0) {
- angle += 360.0;
- }
- quadrant = ROTATE_0;
- if ((angle > 45.0) && (angle <= 135.0)) {
- quadrant = ROTATE_90;
- angle -= 90.0;
- } else if ((angle > 135.0) && (angle <= 225.0)) {
- quadrant = ROTATE_180;
- angle -= 180.0;
- } else if ((angle > 225.0) && (angle <= 315.0)) {
- quadrant = ROTATE_270;
- angle -= 270.0;
- } else if (angle > 315.0) {
- angle -= 360.0;
- }
- /*
- * If necessary, create a temporary image that's rotated by a right-angle.
- * We'll then rotate this picture between -45 to 45 degrees to arrive at
- * its final angle.
- */
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- tmpPtr = Rotate270(srcPtr);
- break;
-
- case ROTATE_90: /* 90 degrees */
- tmpPtr = Rotate90(srcPtr);
- break;
-
- case ROTATE_180: /* 180 degrees */
- tmpPtr = Rotate180(srcPtr);
- break;
-
- case ROTATE_0: /* 0 degrees */
- if (angle == 0.0) {
- tmpPtr = Blt_ClonePicture(srcPtr); /* Make a copy of the source. */
- }
- break;
- }
-
- assert((angle >= -45.0) && (angle <= 45.0));
-
- destPtr = tmpPtr;
- if (angle != 0.0) {
- Blt_Pixel bg;
-
- bg.u32 = 0x00000000;
- angle = (angle / 180.0) * M_PI;
- destPtr = Rotate45(tmpPtr, angle, &bg);
- if (tmpPtr != srcPtr) {
- Blt_FreePicture(tmpPtr);
- }
- }
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FlipPicture --
- *
- * Flips a picture vertically or horizonally.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FlipPicture(Pict *srcPtr, int vertically)
-{
- if (vertically) {
- Blt_Pixel *s1RowPtr, *s2RowPtr;
- int y;
-
- s1RowPtr = srcPtr->bits;
- s2RowPtr = srcPtr->bits + ((srcPtr->height - 1) * srcPtr->pixelsPerRow);
- for (y = 0; y < srcPtr->height / 2; y++) {
- Blt_Pixel *s1, *s2, *send;
-
- s1 = s1RowPtr, s2 = s2RowPtr;
- for (send = s1 + srcPtr->width; s1 < send; s1++, s2++) {
- Blt_Pixel tmp;
-
- tmp.u32 = s1->u32;
- s1->u32 = s2->u32;
- s2->u32 = tmp.u32;
- }
- s1RowPtr += srcPtr->pixelsPerRow;
- s2RowPtr -= srcPtr->pixelsPerRow;
- }
- } else {
- Blt_Pixel *s1ColumnPtr, *s2ColumnPtr;
- int x;
-
- s1ColumnPtr = srcPtr->bits;
- s2ColumnPtr = srcPtr->bits + (srcPtr->width - 1);
- for (x = 0; x < srcPtr->width / 2; x++) {
- Blt_Pixel *s1, *s2, *send;
-
- s1 = s1ColumnPtr, s2 = s2ColumnPtr;
- for (send = s1 + (srcPtr->height * srcPtr->pixelsPerRow); s1 < send;
- s1 += srcPtr->pixelsPerRow, s2 += srcPtr->pixelsPerRow) {
- Blt_Pixel tmp;
-
- tmp.u32 = s1->u32;
- s1->u32 = s2->u32;
- s2->u32 = tmp.u32;
- }
- s1ColumnPtr++;
- s2ColumnPtr--;
- }
- }
- srcPtr->flags |= BLT_PIC_DIRTY;
-}
-
-#define NC 256
-enum ColorDirections { RED, GREEN, BLUE };
-
-#define R0 (cubePtr->r0)
-#define R1 (cubePtr->r1)
-#define G0 (cubePtr->g0)
-#define G1 (cubePtr->g1)
-#define B0 (cubePtr->b0)
-#define B1 (cubePtr->b1)
-
-typedef struct {
- int r0, r1; /* min, max values: min exclusive max
- * inclusive */
- int g0, g1;
- int b0, b1;
- int vol;
-} Cube;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Histogram is in elements 1..HISTSIZE along each axis, element 0 is for base
- * or marginal value NB: these must start out 0!
- *
- *---------------------------------------------------------------------------
- */
-typedef struct {
- long int wt[33][33][33]; /* # pixels in voxel */
- long int mR[33][33][33]; /* Sum over voxel of red pixel values */
- long int mG[33][33][33]; /* Sum over voxel of green pixel
- * values */
- long int mB[33][33][33]; /* Sum over voxel of blue pixel
- * values */
- float gm2[33][33][33]; /* Variance */
-} PictStats;
-
-/*
- * Build 3-D color histogram of counts, R/G/B, c^2
- */
-static void
-Hist3d(PictStats *s, Pict *srcPtr)
-{
-#define MAX_INTENSITIES 256
- Blt_Pixel *srcRowPtr;
- int y;
- float tab[MAX_INTENSITIES];
-
- {
- int i;
-
- /* Precompute table of squares. */
- for (i = 0; i < MAX_INTENSITIES; i++) {
- tab[i] = (float)(i * i);
- }
- }
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp;
- int x;
-
- for (sp = srcRowPtr, x = 0; x < srcPtr->width; x++, sp++) {
- int r, g, b;
-
- /*
- * Reduce the number of bits (5) per color component. This will
- * keep the table size (2^15) reasonable without perceptually
- * affecting the final image.
- */
- r = (sp->Red >> 3) + 1;
- g = (sp->Green >> 3) + 1;
- b = (sp->Blue >> 3) + 1;
-
- s->wt[r][g][b] += 1;
- s->mR[r][g][b] += sp->Red;
- s->mG[r][g][b] += sp->Green;
- s->mB[r][g][b] += sp->Blue;
- s->gm2[r][g][b] += tab[sp->Red] + tab[sp->Green] + tab[sp->Blue];
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * At conclusion of the histogram step, we can interpret
- * wt[r][g][b] = sum over voxel of P(c)
- * mR[r][g][b] = sum over voxel of r*P(c) , similarly for mG, mB
- * m2[r][g][b] = sum over voxel of c^2*P(c)
- *
- * Actually each of these should be divided by 'size' to give the usual
- * interpretation of P() as ranging from 0 to 1, but we needn't do that here.
- *
- *---------------------------------------------------------------------------
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * We now convert histogram into moments so that we can rapidly calculate
- * the sums of the above quantities over any desired box.
- *
- *---------------------------------------------------------------------------
- */
-/* Compute cumulative moments. */
-static void
-M3d(PictStats *s)
-{
- unsigned char i, r, g, b, r0;
- long int area[33], rArea[33], gArea[33], bArea[33];
- float area2[33];
-
- for (r = 1, r0 = 0; r <= 32; r++, r0++) {
- for (i = 0; i <= 32; ++i) {
- area2[i] = 0.0f;
- area[i] = rArea[i] = gArea[i] = bArea[i] = 0;
- }
- for (g = 1; g <= 32; g++) {
- long int line, rLine, gLine, bLine;
- float line2;
-
- line2 = 0.0f;
- line = rLine = gLine = bLine = 0;
- for (b = 1; b <= 32; b++) {
- /* ind1 = RGBIndex(r, g, b); */
-
- line += s->wt[r][g][b];
- rLine += s->mR[r][g][b];
- gLine += s->mG[r][g][b];
- bLine += s->mB[r][g][b];
- line2 += s->gm2[r][g][b];
-
- area[b] += line;
- rArea[b] += rLine;
- gArea[b] += gLine;
- bArea[b] += bLine;
- area2[b] += line2;
-
- /* ind2 = ind1 - 1089; [r0][g][b] */
- s->wt[r][g][b] = s->wt[r0][g][b] + area[b];
- s->mR[r][g][b] = s->mR[r0][g][b] + rArea[b];
- s->mG[r][g][b] = s->mG[r0][g][b] + gArea[b];
- s->mB[r][g][b] = s->mB[r0][g][b] + bArea[b];
- s->gm2[r][g][b] = s->gm2[r0][g][b] + area2[b];
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Vol --
- *
- * Compute sum over a box of any given statistic
- *
- *---------------------------------------------------------------------------
- */
-static INLINE long int
-Vol(Cube *cubePtr, long int m[33][33][33])
-{
- return (m[R1][G1][B1] - m[R1][G1][B0] - m[R1][G0][B1] + m[R1][G0][B0] -
- m[R0][G1][B1] + m[R0][G1][B0] + m[R0][G0][B1] - m[R0][G0][B0]);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Bottom --
- *
- * The next two routines allow a slightly more efficient calculation of
- * Vol() for a proposed subbox of a given box. The sum of Top() and
- * Bottom() is the Vol() of a subbox split in the given direction and
- * with the specified new upper bound.
- *
- *---------------------------------------------------------------------------
- */
-/* Compute part of Vol(cubePtr, mmt) that doesn't depend on r1, g1, or b1 */
-/* (depending on dir) */
-static long int
-Bottom(
- Cube *cubePtr,
- enum ColorDirections dir,
- long int m[33][33][33]) /* Moment */
-{
- switch (dir) {
- case RED:
- return -m[R0][G1][B1] + m[R0][G1][B0] + m[R0][G0][B1] - m[R0][G0][B0];
- case GREEN:
- return -m[R1][G0][B1] + m[R1][G0][B0] + m[R0][G0][B1] - m[R0][G0][B0];
- case BLUE:
- return -m[R1][G1][B0] + m[R1][G0][B0] + m[R0][G1][B0] - m[R0][G0][B0];
- }
- return 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Top --
- *
- * Compute remainder of Vol(cubePtr, mmt), substituting pos for r1, g1,
- * or b1 (depending on dir).
- *
- *---------------------------------------------------------------------------
- */
-static long int
-Top(Cube *cubePtr, enum ColorDirections dir, int pos, long int m[33][33][33])
-{
- switch (dir) {
- case RED:
- return (m[pos][G1][B1] - m[pos][G1][B0] -
- m[pos][G0][B1] + m[pos][G0][B0]);
-
- case GREEN:
- return (m[R1][pos][B1] - m[R1][pos][B0] -
- m[R0][pos][B1] + m[R0][pos][B0]);
-
- case BLUE:
- return (m[R1][G1][pos] - m[R1][G0][pos] -
- m[R0][G1][pos] + m[R0][G0][pos]);
- }
- return 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Var --
- *
- * Compute the weighted variance of a box NB: as with the raw statistics,
- * this is really the (variance * size)
- *
- *---------------------------------------------------------------------------
- */
-static float
-Var(Cube *cubePtr, PictStats *s)
-{
- long int dR, dG, dB;
- float xx;
-
- dR = Vol(cubePtr, s->mR);
- dG = Vol(cubePtr, s->mG);
- dB = Vol(cubePtr, s->mB);
- xx = (s->gm2[R1][G1][B1] - s->gm2[R1][G1][B0] -
- s->gm2[R1][G0][B1] + s->gm2[R1][G0][B0] -
- s->gm2[R0][G1][B1] + s->gm2[R0][G1][B0] +
- s->gm2[R0][G0][B1] - s->gm2[R0][G0][B0]);
- return (xx - (float)(dR * dR + dG * dG + dB * dB) / (float)Vol(cubePtr, s->wt));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Maximize --
- *
- * We want to minimize the sum of the variances of two subboxes. The
- * sum(c^2) terms can be ignored since their sum over both subboxes is
- * the same (the sum for the whole box) no matter where we split. The
- * remaining terms have a minus sign in the variance formula, so we drop
- * the minus sign and MAXIMIZE the sum of the two terms.
- *
- *---------------------------------------------------------------------------
- */
-static float
-Maximize(
- Cube *cubePtr,
- enum ColorDirections dir,
- int first, int last, int *cut,
- long rWhole, long gWhole, long bWhole, long wWhole,
- PictStats *s)
-{
- long int rHalf, gHalf, bHalf, wHalf;
- long int rBase, gBase, bBase, wBase;
- int i;
- float temp, max;
-
- rBase = Bottom(cubePtr, dir, s->mR);
- gBase = Bottom(cubePtr, dir, s->mG);
- bBase = Bottom(cubePtr, dir, s->mB);
- wBase = Bottom(cubePtr, dir, s->wt);
- max = 0.0;
- *cut = -1;
- for (i = first; i < last; i++) {
- rHalf = rBase + Top(cubePtr, dir, i, s->mR);
- gHalf = gBase + Top(cubePtr, dir, i, s->mG);
- bHalf = bBase + Top(cubePtr, dir, i, s->mB);
- wHalf = wBase + Top(cubePtr, dir, i, s->wt);
-
- /* Now half_x is sum over lower half of box, if split at i */
- if (wHalf == 0) { /* subbox could be empty of pixels! */
- continue; /* never split into an empty box */
- } else {
- temp = ((float)rHalf * rHalf + (float)gHalf * gHalf +
- (float)bHalf * bHalf) / wHalf;
- }
- rHalf = rWhole - rHalf;
- gHalf = gWhole - gHalf;
- bHalf = bWhole - bHalf;
- wHalf = wWhole - wHalf;
- if (wHalf == 0) { /* Subbox could be empty of pixels! */
- continue; /* never split into an empty box */
- } else {
- temp += ((float)rHalf * rHalf + (float)gHalf * gHalf +
- (float)bHalf * bHalf) / wHalf;
- }
- if (temp > max) {
- max = temp;
- *cut = i;
- }
- }
- return max;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Cut --
- *
- *---------------------------------------------------------------------------
- */
-static int
-Cut(Cube *set1, Cube *set2, PictStats *s)
-{
- enum ColorDirections dir;
- int rCut, gCut, bCut;
- float rMax, gMax, bMax;
- long int rWhole, gWhole, bWhole, wWhole;
-
- rWhole = Vol(set1, s->mR);
- gWhole = Vol(set1, s->mG);
- bWhole = Vol(set1, s->mB);
- wWhole = Vol(set1, s->wt);
-
- rMax = Maximize(set1, RED, set1->r0 + 1, set1->r1, &rCut,
- rWhole, gWhole, bWhole, wWhole, s);
- gMax = Maximize(set1, GREEN, set1->g0 + 1, set1->g1, &gCut,
- rWhole, gWhole, bWhole, wWhole, s);
- bMax = Maximize(set1, BLUE, set1->b0 + 1, set1->b1, &bCut,
- rWhole, gWhole, bWhole, wWhole, s);
-
- if ((rMax >= gMax) && (rMax >= bMax)) {
- dir = RED;
- if (rCut < 0) {
- return 0; /* can't split the box */
- }
- } else {
- dir = ((gMax >= rMax) && (gMax >= bMax)) ? GREEN : BLUE;
- }
- set2->r1 = set1->r1;
- set2->g1 = set1->g1;
- set2->b1 = set1->b1;
-
- switch (dir) {
- case RED:
- set2->r0 = set1->r1 = rCut;
- set2->g0 = set1->g0;
- set2->b0 = set1->b0;
- break;
-
- case GREEN:
- set2->g0 = set1->g1 = gCut;
- set2->r0 = set1->r0;
- set2->b0 = set1->b0;
- break;
-
- case BLUE:
- set2->b0 = set1->b1 = bCut;
- set2->r0 = set1->r0;
- set2->g0 = set1->g0;
- break;
- }
- set1->vol = (set1->r1 - set1->r0) * (set1->g1 - set1->g0) *
- (set1->b1 - set1->b0);
- set2->vol = (set2->r1 - set2->r0) * (set2->g1 - set2->g0) *
- (set2->b1 - set2->b0);
- return 1;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * SplitCS --
- *
- *---------------------------------------------------------------------------
- */
-static int
-SplitCS(PictStats *s, Cube *cubes, int nReqColors)
-{
- float *vv, temp;
- int i;
- int next, k;
- int nc;
-
- vv = Blt_AssertMalloc(sizeof(float) * nReqColors);
- nc = nReqColors;
- cubes[0].r0 = cubes[0].g0 = cubes[0].b0 = 0;
- cubes[0].r1 = cubes[0].g1 = cubes[0].b1 = 32;
- next = 0;
- for (i = 1; i < nReqColors; i++) {
- if (Cut(cubes + next, cubes + i, s)) {
- /* Volume test ensures we won't try to cut one-cell box */
- vv[next] = (cubes[next].vol > 1) ? Var(cubes + next, s) : 0.0f;
- vv[i] = (cubes[i].vol > 1) ? Var(cubes + i, s) : 0.0f;
- } else {
- vv[next] = 0.0f; /* don't try to split this box again */
- i--; /* didn't create box i */
- }
-
- next = 0;
- temp = vv[0];
- for (k = 1; k <= i; k++) {
- if (vv[k] > temp) {
- temp = vv[k];
- next = k;
- }
- }
- if (temp <= 0.0) {
- nc = i + 1;
- fprintf(stderr, "Only got %d boxes\n", nc);
- break;
- }
- }
- Blt_Free(vv);
- return nc;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Mark --
- *
- *---------------------------------------------------------------------------
- */
-static void
-Mark(Cube *cubePtr, int label, Blt_ColorLookupTable tag)
-{
- int r, g, b;
-
- for (r = R0 + 1; r <= R1; r++) {
- for (g = G0 + 1; g <= G1; g++) {
- for (b = B0 + 1; b <= B1; b++) {
- tag[r][g][b] = label;
- }
- }
- }
-}
-
-static Blt_ColorLookupTable
-MakeCLuT(PictStats *s, Cube *cubes, int nColors)
-{
- Blt_ColorLookupTable clut;
- Cube *cp, *cend;
-
- clut = Blt_AssertCalloc(sizeof(unsigned int), 33 * 33 * 33);
- for (cp = cubes, cend = cp + nColors; cp < cend; cp++) {
- unsigned int r, g, b;
- long int weight;
- Blt_Pixel pixel;
-
- weight = Vol(cp, s->wt);
- if (weight) {
- r = (unsigned int)((Vol(cp, s->mR) / (float)weight) * (NC + 1));
- g = (unsigned int)((Vol(cp, s->mG) / (float)weight) * (NC + 1));
- b = (unsigned int)((Vol(cp, s->mB) / (float)weight) * (NC + 1));
- } else {
-#ifdef notdef
- fprintf(stderr, "bogus box %d\n", cp - cubes);
-#endif
- r = g = b = 0;
- }
- pixel.Red = r / 257;
- pixel.Green = g / 257;
- pixel.Blue = b / 257;
- pixel.Alpha = ALPHA_OPAQUE;
- Mark(cp, pixel.u32, clut);
- }
- return clut;
-}
-
-void
-Blt_MapColors(Pict *destPtr, Pict *srcPtr, Blt_ColorLookupTable clut)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
-
- /* Apply the color lookup table against the original image */
- srcRowPtr = srcPtr->bits;
- destRowPtr = destPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *dp, *sp, *send;
-
- sp = srcRowPtr, dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- int r, g, b, a;
-
- r = (sp->Red >> 3) + 1;
- g = (sp->Green >> 3) + 1;
- b = (sp->Blue >> 3) + 1;
- a = sp->Alpha;
- dp->u32 = clut[r][g][b];
- dp->Alpha = a;
- dp++;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_QuantizePicture --
- *
- * C Implementation of Wu's Color Quantizer (v. 2) (see Graphics Gems
- * vol. II, pp. 126-133)
- *
- * Author: Xiaolin Wu
- * Dept. of Computer Science Univ. of Western
- * Ontario London, Ontario
- * N6A 5B7
- * wu at csd.uwo.ca
- *
- * Greedy orthogonal bipartition of RGB space for variance
- * minimization aided by inclusion-exclusion tricks. For speed
- * no nearest neighbor search is done. Slightly better
- * performance can be expected by more sophisticated but more
- * expensive versions.
- *
- * The author thanks Tom Lane at Tom_Lane at G.GP.CS.CMU.EDU for
- * much of additional documentation and a cure to a previous bug.
- *
- * Free to distribute, comments and suggestions are appreciated.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_QuantizePicture(Pict *srcPtr, int nReqColors)
-{
- Cube *cubes;
- PictStats *statsPtr;
- int nc;
- Blt_ColorLookupTable clut;
- Pict *destPtr;
-
- /*
- * Allocated a structure to hold color statistics.
- */
- statsPtr = Blt_AssertCalloc(1, sizeof(PictStats));
- Hist3d(statsPtr, srcPtr);
- M3d(statsPtr);
-
- cubes = Blt_AssertMalloc(sizeof(Cube) * nReqColors);
- nc = SplitCS(statsPtr, cubes, nReqColors);
- assert(nc <= nReqColors);
-
- clut = MakeCLuT(statsPtr, cubes, nc);
- Blt_Free(statsPtr);
- Blt_Free(cubes);
- destPtr = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- Blt_MapColors(destPtr, srcPtr, clut);
- Blt_Free(clut);
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_QuantizePicture --
- *
- * C Implementation of Wu's Color Quantizer (v. 2) (see Graphics Gems
- * vol. II, pp. 126-133)
- *
- * Author: Xiaolin Wu
- * Dept. of Computer Science Univ. of Western
- * Ontario London, Ontario
- * N6A 5B7
- * wu at csd.uwo.ca
- *
- * Greedy orthogonal bipartition of RGB space for variance
- * minimization aided by inclusion-exclusion tricks. For speed
- * no nearest neighbor search is done. Slightly better
- * performance can be expected by more sophisticated but more
- * expensive versions.
- *
- * The author thanks Tom Lane at Tom_Lane at G.GP.CS.CMU.EDU for
- * much of additional documentation and a cure to a previous bug.
- *
- * Free to distribute, comments and suggestions are appreciated.
- *
- *---------------------------------------------------------------------------
- */
-Blt_ColorLookupTable
-Blt_GetColorLookupTable(Blt_Chain chain, int nReqColors)
-{
- Cube *cubes;
- PictStats *statsPtr;
- int nc;
- Blt_ColorLookupTable clut;
- Blt_ChainLink link;
-
- /*
- * Allocated a structure to hold color statistics.
- */
- statsPtr = Blt_AssertCalloc(1, sizeof(PictStats));
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Pict *srcPtr;
-
- srcPtr = Blt_Chain_GetValue(link);
- Hist3d(statsPtr, srcPtr);
- }
- M3d(statsPtr);
- cubes = Blt_AssertMalloc(sizeof(Cube) * nReqColors);
- nc = SplitCS(statsPtr, cubes, nReqColors);
- assert(nc <= nReqColors);
-
- clut = MakeCLuT(statsPtr, cubes, nc);
- Blt_Free(statsPtr);
- Blt_Free(cubes);
- return clut;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CopyPictureBits --
- *
- * Creates a copy of the given picture.
- *
- * Results:
- * Returns the new copy.
- *
- * --------------------------------------------------------------------------
- */
-static void
-CopyPictureBits(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy)
-{
- int *srcRowPtr, *destRowPtr;
- int right, bottom;
- int dw, dh;
- int width, height;
-
- if (((dx + w) < 0) || ((dy + h) < 0)) {
- return;
- }
- if (dx < 0) {
- w += dx;
- dx = 0;
- }
- if (dy < 0) {
- h += dy;
- dy = 0;
- }
- if (destPtr->width < (dx + w)) {
- w = destPtr->width - dx;
- }
- if (destPtr->height < (dy + h)) {
- h = destPtr->height - dy;
- }
- if (srcPtr->width < w) {
- w = srcPtr->width;
- }
- if (srcPtr->height < h) {
- h = srcPtr->height;
- }
-
- dw = destPtr->width - dx;
- dh = destPtr->height - dy;
-
- width = MIN(dw, w);
- height = MIN(dh, h);
-
- bottom = height + y;
- right = width + x;
-
- srcRowPtr = (int *)(srcPtr->bits + ((srcPtr->pixelsPerRow * y) + x));
- destRowPtr = (int *)(destPtr->bits + ((destPtr->pixelsPerRow * dy) + dx));
-
- for (/*empty*/; y < bottom; y++) {
- int n;
- int *sp, *dp;
-
- sp = srcRowPtr, dp = destRowPtr;
- n = (width + 7) / 8; /* count > 0 assumed */
- switch (width & 0x07) {
- case 0: do { *dp++ = *sp++;
- case 7: *dp++ = *sp++;
- case 6: *dp++ = *sp++;
- case 5: *dp++ = *sp++;
- case 4: *dp++ = *sp++;
- case 3: *dp++ = *sp++;
- case 2: *dp++ = *sp++;
- case 1: *dp++ = *sp++;
- } while (--n > 0);
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- destPtr->flags = (srcPtr->flags | BLT_PIC_DIRTY);
-}
-
-/*
- * Image dithering routines.
- *
- * Reference:
- * Victor Ostromoukhov http://www.iro.umontreal.ca/~ostrom/.
- *
- * Victor Ostromoukhov, "A Simple and Efficient Error-Diffusion
- * Algorithm" SIGGRAPH'01
- *
- * University of Montreal, http://www.iro.umontreal.ca/~ostrom/
- *
- */
-typedef struct {
- short int r; /* Right */
- short int dl; /* Down-left */
- short int d; /* Down */
- short int sum; /* Sum */
-} VarCoefs;
-
-static VarCoefs coefTable[256] = {
- { 13, 0, 5, 18, }, /* 0 */
- { 13, 0, 5, 18, }, /* 1 */
- { 21, 0, 10, 31, }, /* 2 */
- { 7, 0, 4, 11, }, /* 3 */
- { 8, 0, 5, 13, }, /* 4 */
- { 47, 3, 28, 78, }, /* 5 */
- { 23, 3, 13, 39, }, /* 6 */
- { 15, 3, 8, 26, }, /* 7 */
- { 22, 6, 11, 39, }, /* 8 */
- { 43, 15, 20, 78, }, /* 9 */
- { 7, 3, 3, 13, }, /* 10 */
- { 501, 224, 211, 936, }, /* 11 */
- { 249, 116, 103, 468, }, /* 12 */
- { 165, 80, 67, 312, }, /* 13 */
- { 123, 62, 49, 234, }, /* 14 */
- { 489, 256, 191, 936, }, /* 15 */
- { 81, 44, 31, 156, }, /* 16 */
- { 483, 272, 181, 936, }, /* 17 */
- { 60, 35, 22, 117, }, /* 18 */
- { 53, 32, 19, 104, }, /* 19 */
- { 237, 148, 83, 468, }, /* 20 */
- { 471, 304, 161, 936, }, /* 21 */
- { 3, 2, 1, 6, }, /* 22 */
- { 459, 304, 161, 924, }, /* 23 */
- { 38, 25, 14, 77, }, /* 24 */
- { 453, 296, 175, 924, }, /* 25 */
- { 225, 146, 91, 462, }, /* 26 */
- { 149, 96, 63, 308, }, /* 27 */
- { 111, 71, 49, 231, }, /* 28 */
- { 63, 40, 29, 132, }, /* 29 */
- { 73, 46, 35, 154, }, /* 30 */
- { 435, 272, 217, 924, }, /* 31 */
- { 108, 67, 56, 231, }, /* 32 */
- { 13, 8, 7, 28, }, /* 33 */
- { 213, 130, 119, 462, }, /* 34 */
- { 423, 256, 245, 924, }, /* 35 */
- { 5, 3, 3, 11, }, /* 36 */
- { 281, 173, 162, 616, }, /* 37 */
- { 141, 89, 78, 308, }, /* 38 */
- { 283, 183, 150, 616, }, /* 39 */
- { 71, 47, 36, 154, }, /* 40 */
- { 285, 193, 138, 616, }, /* 41 */
- { 13, 9, 6, 28, }, /* 42 */
- { 41, 29, 18, 88, }, /* 43 */
- { 36, 26, 15, 77, }, /* 44 */
- { 289, 213, 114, 616, }, /* 45 */
- { 145, 109, 54, 308, }, /* 46 */
- { 291, 223, 102, 616, }, /* 47 */
- { 73, 57, 24, 154, }, /* 48 */
- { 293, 233, 90, 616, }, /* 49 */
- { 21, 17, 6, 44, }, /* 50 */
- { 295, 243, 78, 616, }, /* 51 */
- { 37, 31, 9, 77, }, /* 52 */
- { 27, 23, 6, 56, }, /* 53 */
- { 149, 129, 30, 308, }, /* 54 */
- { 299, 263, 54, 616, }, /* 55 */
- { 75, 67, 12, 154, }, /* 56 */
- { 43, 39, 6, 88, }, /* 57 */
- { 151, 139, 18, 308, }, /* 58 */
- { 303, 283, 30, 616, }, /* 59 */
- { 38, 36, 3, 77, }, /* 60 */
- { 305, 293, 18, 616, }, /* 61 */
- { 153, 149, 6, 308, }, /* 62 */
- { 307, 303, 6, 616, }, /* 63 */
- { 1, 1, 0, 2, }, /* 64 */
- { 101, 105, 2, 208, }, /* 65 */
- { 49, 53, 2, 104, }, /* 66 */
- { 95, 107, 6, 208, }, /* 67 */
- { 23, 27, 2, 52, }, /* 68 */
- { 89, 109, 10, 208, }, /* 69 */
- { 43, 55, 6, 104, }, /* 70 */
- { 83, 111, 14, 208, }, /* 71 */
- { 5, 7, 1, 13, }, /* 72 */
- { 172, 181, 37, 390, }, /* 73 */
- { 97, 76, 22, 195, }, /* 74 */
- { 72, 41, 17, 130, }, /* 75 */
- { 119, 47, 29, 195, }, /* 76 */
- { 4, 1, 1, 6, }, /* 77 */
- { 4, 1, 1, 6, }, /* 78 */
- { 4, 1, 1, 6, }, /* 79 */
- { 4, 1, 1, 6, }, /* 80 */
- { 4, 1, 1, 6, }, /* 81 */
- { 4, 1, 1, 6, }, /* 82 */
- { 4, 1, 1, 6, }, /* 83 */
- { 4, 1, 1, 6, }, /* 84 */
- { 4, 1, 1, 6, }, /* 85 */
- { 65, 18, 17, 100, }, /* 86 */
- { 95, 29, 26, 150, }, /* 87 */
- { 185, 62, 53, 300, }, /* 88 */
- { 30, 11, 9, 50, }, /* 89 */
- { 35, 14, 11, 60, }, /* 90 */
- { 85, 37, 28, 150, }, /* 91 */
- { 55, 26, 19, 100, }, /* 92 */
- { 80, 41, 29, 150, }, /* 93 */
- { 155, 86, 59, 300, }, /* 94 */
- { 5, 3, 2, 10, }, /* 95 */
- { 5, 3, 2, 10, }, /* 96 */
- { 5, 3, 2, 10, }, /* 97 */
- { 5, 3, 2, 10, }, /* 98 */
- { 5, 3, 2, 10, }, /* 99 */
- { 5, 3, 2, 10, }, /* 100 */
- { 5, 3, 2, 10, }, /* 101 */
- { 5, 3, 2, 10, }, /* 102 */
- { 5, 3, 2, 10, }, /* 103 */
- { 5, 3, 2, 10, }, /* 104 */
- { 5, 3, 2, 10, }, /* 105 */
- { 5, 3, 2, 10, }, /* 106 */
- { 5, 3, 2, 10, }, /* 107 */
- { 305, 176, 119, 600, }, /* 108 */
- { 155, 86, 59, 300, }, /* 109 */
- { 105, 56, 39, 200, }, /* 110 */
- { 80, 41, 29, 150, }, /* 111 */
- { 65, 32, 23, 120, }, /* 112 */
- { 55, 26, 19, 100, }, /* 113 */
- { 335, 152, 113, 600, }, /* 114 */
- { 85, 37, 28, 150, }, /* 115 */
- { 115, 48, 37, 200, }, /* 116 */
- { 35, 14, 11, 60, }, /* 117 */
- { 355, 136, 109, 600, }, /* 118 */
- { 30, 11, 9, 50, }, /* 119 */
- { 365, 128, 107, 600, }, /* 120 */
- { 185, 62, 53, 300, }, /* 121 */
- { 25, 8, 7, 40, }, /* 122 */
- { 95, 29, 26, 150, }, /* 123 */
- { 385, 112, 103, 600, }, /* 124 */
- { 65, 18, 17, 100, }, /* 125 */
- { 395, 104, 101, 600, }, /* 126 */
- { 4, 1, 1, 6, }, /* 127 */
- { 4, 1, 1, 6, }, /* 128 */
- { 395, 104, 101, 600, }, /* 129 */
- { 65, 18, 17, 100, }, /* 130 */
- { 385, 112, 103, 600, }, /* 131 */
- { 95, 29, 26, 150, }, /* 132 */
- { 25, 8, 7, 40, }, /* 133 */
- { 185, 62, 53, 300, }, /* 134 */
- { 365, 128, 107, 600, }, /* 135 */
- { 30, 11, 9, 50, }, /* 136 */
- { 355, 136, 109, 600, }, /* 137 */
- { 35, 14, 11, 60, }, /* 138 */
- { 115, 48, 37, 200, }, /* 139 */
- { 85, 37, 28, 150, }, /* 140 */
- { 335, 152, 113, 600, }, /* 141 */
- { 55, 26, 19, 100, }, /* 142 */
- { 65, 32, 23, 120, }, /* 143 */
- { 80, 41, 29, 150, }, /* 144 */
- { 105, 56, 39, 200, }, /* 145 */
- { 155, 86, 59, 300, }, /* 146 */
- { 305, 176, 119, 600, }, /* 147 */
- { 5, 3, 2, 10, }, /* 148 */
- { 5, 3, 2, 10, }, /* 149 */
- { 5, 3, 2, 10, }, /* 150 */
- { 5, 3, 2, 10, }, /* 151 */
- { 5, 3, 2, 10, }, /* 152 */
- { 5, 3, 2, 10, }, /* 153 */
- { 5, 3, 2, 10, }, /* 154 */
- { 5, 3, 2, 10, }, /* 155 */
- { 5, 3, 2, 10, }, /* 156 */
- { 5, 3, 2, 10, }, /* 157 */
- { 5, 3, 2, 10, }, /* 158 */
- { 5, 3, 2, 10, }, /* 159 */
- { 5, 3, 2, 10, }, /* 160 */
- { 155, 86, 59, 300, }, /* 161 */
- { 80, 41, 29, 150, }, /* 162 */
- { 55, 26, 19, 100, }, /* 163 */
- { 85, 37, 28, 150, }, /* 164 */
- { 35, 14, 11, 60, }, /* 165 */
- { 30, 11, 9, 50, }, /* 166 */
- { 185, 62, 53, 300, }, /* 167 */
- { 95, 29, 26, 150, }, /* 168 */
- { 65, 18, 17, 100, }, /* 169 */
- { 4, 1, 1, 6, }, /* 170 */
- { 4, 1, 1, 6, }, /* 171 */
- { 4, 1, 1, 6, }, /* 172 */
- { 4, 1, 1, 6, }, /* 173 */
- { 4, 1, 1, 6, }, /* 174 */
- { 4, 1, 1, 6, }, /* 175 */
- { 4, 1, 1, 6, }, /* 176 */
- { 4, 1, 1, 6, }, /* 177 */
- { 4, 1, 1, 6, }, /* 178 */
- { 119, 47, 29, 195, }, /* 179 */
- { 72, 41, 17, 130, }, /* 180 */
- { 97, 76, 22, 195, }, /* 181 */
- { 172, 181, 37, 390, }, /* 182 */
- { 5, 7, 1, 13, }, /* 183 */
- { 83, 111, 14, 208, }, /* 184 */
- { 43, 55, 6, 104, }, /* 185 */
- { 89, 109, 10, 208, }, /* 186 */
- { 23, 27, 2, 52, }, /* 187 */
- { 95, 107, 6, 208, }, /* 188 */
- { 49, 53, 2, 104, }, /* 189 */
- { 101, 105, 2, 208, }, /* 190 */
- { 1, 1, 0, 2, }, /* 191 */
- { 307, 303, 6, 616, }, /* 192 */
- { 153, 149, 6, 308, }, /* 193 */
- { 305, 293, 18, 616, }, /* 194 */
- { 38, 36, 3, 77, }, /* 195 */
- { 303, 283, 30, 616, }, /* 196 */
- { 151, 139, 18, 308, }, /* 197 */
- { 43, 39, 6, 88, }, /* 198 */
- { 75, 67, 12, 154, }, /* 199 */
- { 299, 263, 54, 616, }, /* 200 */
- { 149, 129, 30, 308, }, /* 201 */
- { 27, 23, 6, 56, }, /* 202 */
- { 37, 31, 9, 77, }, /* 203 */
- { 295, 243, 78, 616, }, /* 204 */
- { 21, 17, 6, 44, }, /* 205 */
- { 293, 233, 90, 616, }, /* 206 */
- { 73, 57, 24, 154, }, /* 207 */
- { 291, 223, 102, 616, }, /* 208 */
- { 145, 109, 54, 308, }, /* 209 */
- { 289, 213, 114, 616, }, /* 210 */
- { 36, 26, 15, 77, }, /* 211 */
- { 41, 29, 18, 88, }, /* 212 */
- { 13, 9, 6, 28, }, /* 213 */
- { 285, 193, 138, 616, }, /* 214 */
- { 71, 47, 36, 154, }, /* 215 */
- { 283, 183, 150, 616, }, /* 216 */
- { 141, 89, 78, 308, }, /* 217 */
- { 281, 173, 162, 616, }, /* 218 */
- { 5, 3, 3, 11, }, /* 219 */
- { 423, 256, 245, 924, }, /* 220 */
- { 213, 130, 119, 462, }, /* 221 */
- { 13, 8, 7, 28, }, /* 222 */
- { 108, 67, 56, 231, }, /* 223 */
- { 435, 272, 217, 924, }, /* 224 */
- { 73, 46, 35, 154, }, /* 225 */
- { 63, 40, 29, 132, }, /* 226 */
- { 111, 71, 49, 231, }, /* 227 */
- { 149, 96, 63, 308, }, /* 228 */
- { 225, 146, 91, 462, }, /* 229 */
- { 453, 296, 175, 924, }, /* 230 */
- { 38, 25, 14, 77, }, /* 231 */
- { 459, 304, 161, 924, }, /* 232 */
- { 3, 2, 1, 6, }, /* 233 */
- { 471, 304, 161, 936, }, /* 234 */
- { 237, 148, 83, 468, }, /* 235 */
- { 53, 32, 19, 104, }, /* 236 */
- { 60, 35, 22, 117, }, /* 237 */
- { 483, 272, 181, 936, }, /* 238 */
- { 81, 44, 31, 156, }, /* 239 */
- { 489, 256, 191, 936, }, /* 240 */
- { 123, 62, 49, 234, }, /* 241 */
- { 165, 80, 67, 312, }, /* 242 */
- { 249, 116, 103, 468, }, /* 243 */
- { 501, 224, 211, 936, }, /* 244 */
- { 7, 3, 3, 13, }, /* 245 */
- { 43, 15, 20, 78, }, /* 246 */
- { 22, 6, 11, 39, }, /* 247 */
- { 15, 3, 8, 26, }, /* 248 */
- { 23, 3, 13, 39, }, /* 249 */
- { 47, 3, 28, 78, }, /* 250 */
- { 8, 0, 5, 13, }, /* 251 */
- { 7, 0, 4, 11, }, /* 252 */
- { 21, 0, 10, 31, }, /* 253 */
- { 13, 0, 5, 18, }, /* 254 */
- { 13, 0, 5, 18, }, /* 255 */
-};
-
-static void
-DistributeError(
- double (*cl0)[3], double (*cl1)[3],
- int x,
- double rDiff, double gDiff, double bDiff,
- int dir, Blt_Pixel *sp)
-{
- VarCoefs *coefsPtr;
- double sum, r, dl, d;
-
- coefsPtr = coefTable + sp->Red;
- sum = coefsPtr->sum;
- r = coefsPtr->r * rDiff / sum;
- dl = coefsPtr->dl * rDiff / sum;
- d = rDiff - (r + dl);
-
- cl0[x + dir][0] += r;
- cl1[x - dir][0] += dl;
- cl1[x][0] += d;
-
- coefsPtr = coefTable + sp->Green;
- sum = coefsPtr->sum;
- r = coefsPtr->r * gDiff / sum;
- dl = coefsPtr->dl * gDiff / sum;
- d = gDiff - (r + dl);
-
- cl0[x + dir][1] += r;
- cl1[x - dir][1] += dl;
- cl1[x][1] += d;
-
- coefsPtr = coefTable + sp->Blue;
- sum = coefsPtr->sum;
- r = coefsPtr->r * bDiff / sum;
- dl = coefsPtr->dl * bDiff / sum;
- d = bDiff - (r + dl);
-
- cl0[x + dir][2] += r;
- cl1[x - dir][2] += dl;
- cl1[x][2] += d;
-}
-
-#ifdef notdef
-static void
-DistributeErrorFS(
- double (*cl0)[3], double (*cl1)[3],
- int x,
- double rDiff, double gDiff, double bDiff,
- int dir, Blt_Pixel *sp)
-{
- double d2, d3, d5, d7;
-
- d2 = rDiff + rDiff;
- d3 = rDiff + d2;
- d5 = d3 + d2;
- d7 = d5 + d2;
-
- cl0[x + dir][0] += (d7 / 16);
- cl1[x - dir][0] += (d3 / 16);
- cl1[x][0] += (d5 / 16);
- cl1[x + dir][0] += (rDiff / 16);
-
- d2 = gDiff + gDiff;
- d3 = gDiff + d2;
- d5 = d3 + d2;
- d7 = d5 + d2;
-
- cl0[x + dir][1] += (d7 / 16);
- cl1[x - dir][1] += (d3 / 16);
- cl1[x][1] += (d5 / 16);
- cl1[x + dir][1] += (gDiff / 16);
-
- d2 = bDiff + bDiff;
- d3 = bDiff + d2;
- d5 = d3 + d2;
- d7 = d5 + d2;
-
- cl0[x + dir][2] += (d7 / 16);
- cl1[x - dir][2] += (d3 / 16);
- cl1[x][2] += (d5 / 16);
- cl1[x + dir][2] += (bDiff / 16);
-}
-#endif
-
-static void
-ShiftCarryBuffers(double (**cl0)[3], double (**cl1)[3], int width)
-{
- double (*tmp)[3];
- int i;
-
- /* Swap cl0 and cl1 */
- tmp = *cl0, *cl0 = *cl1, *cl1 = tmp;
-
- /* Clear c11 */
- for (i = 0; i < width; ++i) {
- (*cl1)[i][0] = (*cl1)[i][1] = (*cl1)[i][2] = 0.0;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DitherPicture --
- *
- * Dithers a 24-bit picture using a given reduced-color palette.
- *
- * Reference:
- * Victor Ostromoukhov http://www.iro.umontreal.ca/~ostrom/.
- *
- * Victor Ostromoukhov, "A Simple and Efficient
- * Error-Diffusion Algorithm" SIGGRAPH'01
- *
- * University of Montreal, http://www.iro.umontreal.ca/~ostrom/
- *
- * Results:
- * A new picture is allocated, dithered and returned. Returns NULL only
- * if memory can't be allocated for the dithered picture.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_DitherPicture(Pict *srcPtr, Blt_Pixel *palette)
-{
- Pict *destPtr;
- Blt_Pixel *srcRowPtr, *destRowPtr;
- double (*cl0)[3];
- double (*cl1)[3];
- int y;
-
- /* allocate carry_line_0 and carry_line_1 */
- cl0 = Blt_Calloc(srcPtr->width + 2, sizeof(*cl0));
- if (cl0 == NULL) {
- return NULL;
- }
- cl1 = Blt_Calloc(srcPtr->width + 2, sizeof(*cl1));
- if (cl1 == NULL) {
- Blt_Free(cl0);
- return NULL;
- }
- ++cl0;
- ++cl1;
-
- destPtr = Blt_CreatePicture(srcPtr->width, srcPtr->height);
-
- srcRowPtr = srcPtr->bits, destRowPtr = destPtr->bits;
- for (y = 0; y < srcPtr->height; ++y) {
- Blt_Pixel *sp, *dp;
- int start, finish, step;
- int x;
-
- if (y & 1) {
- start = srcPtr->width - 1;
- finish = -1;
- step = -1;
- } else {
- start = 0;
- finish = srcPtr->width;
- step = 1;
- }
- sp = srcRowPtr + start, dp = destRowPtr + start;
- for (x = start; x != finish; x += step) {
- double rCorrected, gCorrected, bCorrected;
- double rDiff, gDiff, bDiff;
- int rIntensity, gIntensity, bIntensity;
-
- rCorrected = sp->Red + cl0[x][0];
- gCorrected = sp->Green + cl0[x][1];
- bCorrected = sp->Blue + cl0[x][2];
-
- rIntensity = palette[(int)CLAMP(rCorrected)].Red;
- gIntensity = palette[(int)CLAMP(gCorrected)].Green;
- bIntensity = palette[(int)CLAMP(bCorrected)].Blue;
-
- rDiff = rCorrected - rIntensity;
- gDiff = gCorrected - gIntensity;
- bDiff = bCorrected - bIntensity;
-
- DistributeError(cl0, cl1, x, rDiff, gDiff, bDiff, step, sp);
- dp->Red = rIntensity;
- dp->Green = gIntensity;
- dp->Blue = bIntensity;
- dp += step, sp += step;
- }
- ShiftCarryBuffers(&cl0, &cl1, srcPtr->width);
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- Blt_Free(cl0 - 1);
- Blt_Free(cl1 - 1);
- return destPtr;
-}
-
-#ifdef notdef
-static void
-BoxX(Pict *destPtr, Pict *srcPtr)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
-
- srcRowPtr = srcPtr->bits;
- destRowPtr = destPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *dp, *send;
- Blt_Pixel *lp, *cp, *rp; /* Pointers to left, center, and right
- * pixels. */
- Blt_Pixel hold;
- double r, g, b, a;
-
- dp = destRowPtr;
- cp = lp = srcRowPtr, rp = srcRowPtr + 1;
- r = (double)(lp->Red + cp->Red + rp->Red) * 0.333333333333333;
- g = (double)(lp->Green + cp->Green + rp->Green) * 0.333333333333333;
- b = (double)(lp->Blue + cp->Blue + rp->Blue) * 0.333333333333333;
- a = (double)(lp->Alpha + cp->Alpha + rp->Alpha) * 0.333333333333333;
- hold = *lp;
- dp->Red = (unsigned char)CLAMP(r);
- dp->Green = (unsigned char)CLAMP(g);
- dp->Blue = (unsigned char)CLAMP(b);
- dp->Alpha = (unsigned char)CLAMP(a);
- dp++, cp++, rp++;
-
- for (send = srcRowPtr + srcPtr->width; rp < send; rp++, cp++, lp++) {
- r = (double)(lp->Red + cp->Red + rp->Red) * 0.333333333333333;
- g = (double)(lp->Green + cp->Green + rp->Green) * 0.333333333333333;
- b = (double)(lp->Blue + cp->Blue + rp->Blue) * 0.333333333333333;
- a = (double)(lp->Alpha + cp->Alpha + rp->Alpha) * 0.333333333333333;
- dp->Red = (unsigned char)CLAMP(r);
- dp->Green = (unsigned char)CLAMP(g);
- dp->Blue = (unsigned char)CLAMP(b);
- dp->Alpha = (unsigned char)CLAMP(a);
- hold = *lp;
- dp++;
- }
-
- rp = cp;
- r = (double)(lp->Red + cp->Red + rp->Red) * 0.333333333333333;
- g = (double)(lp->Green + cp->Green + rp->Green) * 0.333333333333333;
- b = (double)(lp->Blue + cp->Blue + rp->Blue) * 0.333333333333333;
- a = (double)(lp->Alpha + cp->Alpha + rp->Alpha) * 0.333333333333333;
- dp->Red = (unsigned char)CLAMP(r);
- dp->Green = (unsigned char)CLAMP(g);
- dp->Blue = (unsigned char)CLAMP(b);
- dp->Alpha = (unsigned char)CLAMP(a);
-
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
-}
-
-static void
-BoxY(Pict *destPtr, Pict *srcPtr)
-{
- Blt_Pixel *srcColPtr, *destColumnPtr;
- int x;
-
- srcColPtr = srcPtr->bits;
- destColumnPtr = destPtr->bits;
- for (x = 0; x < srcPtr->width; x++) {
- Blt_Pixel *dp, *rp, *lp, *cp, *send;
- double r, g, b, a;
- Blt_Pixel hold;
-
- dp = destColumnPtr;
- cp = lp = srcColPtr, rp = srcColPtr + srcPtr->pixelsPerRow;
- r = (lp->Red + cp->Red + rp->Red) * 0.333333333333333;
- g = (lp->Green + cp->Green + rp->Green) * 0.333333333333333;
- b = (lp->Blue + cp->Blue + rp->Blue) * 0.333333333333333;
- a = (lp->Alpha + cp->Alpha + rp->Alpha) * 0.333333333333333;
- hold = *lp;
- dp->Red = (unsigned char)CLAMP(r);
- dp->Green = (unsigned char)CLAMP(g);
- dp->Blue = (unsigned char)CLAMP(b);
- dp->Alpha = (unsigned char)CLAMP(a);
- dp += destPtr->pixelsPerRow;
- cp += srcPtr->pixelsPerRow;
- rp += srcPtr->pixelsPerRow;
-
- for (send = srcColPtr + (srcPtr->height * srcPtr->pixelsPerRow);
- rp < send; /* empty */) {
- r = (lp->Red + cp->Red + rp->Red) * 0.333333333333333;
- g = (lp->Green + cp->Green + rp->Green) * 0.333333333333333;
- b = (lp->Blue + cp->Blue + rp->Blue) * 0.333333333333333;
- a = (lp->Alpha + cp->Alpha + rp->Alpha) * 0.333333333333333;
- hold = *lp;
- dp->Red = (unsigned char)CLAMP(r);
- dp->Green = (unsigned char)CLAMP(g);
- dp->Blue = (unsigned char)CLAMP(b);
- dp->Alpha = (unsigned char)CLAMP(a);
- dp += destPtr->pixelsPerRow;
- rp += srcPtr->pixelsPerRow;
- lp += srcPtr->pixelsPerRow;
- cp += srcPtr->pixelsPerRow;
- }
- rp = cp;
- r = (lp->Red + cp->Red + rp->Red) * 0.333333333333333;
- g = (lp->Green + cp->Green + rp->Green) * 0.333333333333333;
- b = (lp->Blue + cp->Blue + rp->Blue) * 0.333333333333333;
- a = (lp->Alpha + cp->Alpha + rp->Alpha) * 0.333333333333333;
- dp->Red = (unsigned char)CLAMP(r);
- dp->Green = (unsigned char)CLAMP(g);
- dp->Blue = (unsigned char)CLAMP(b);
- dp->Alpha = (unsigned char)CLAMP(a);
- srcColPtr++, destColumnPtr++;
- }
-}
-#endif
-
-static void
-TentHorizontally(Pict *destPtr, Pict *srcPtr)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
-
- srcRowPtr = srcPtr->bits;
- destRowPtr = destPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel left, center, right;
- Blt_Pixel *dp, *sp, *send;
-
- dp = destRowPtr;
- sp = srcRowPtr + 1;
- left = *srcRowPtr, center = left, right = *sp;
- dp->Red = (left.Red + (center.Red << 1) + right.Red) >> 2;
- dp->Green = (left.Green + (center.Green << 1) + right.Green) >> 2;
- dp->Blue = (left.Blue + (center.Blue << 1) + right.Blue) >> 2;
- dp->Alpha = (left.Alpha + (center.Alpha << 1) + right.Alpha) >> 2;
- center = right;
- dp++, sp++;
-
- for (send = srcRowPtr + srcPtr->width; sp < send; /*empty*/) {
- right = *sp;
- dp->Red = (left.Red + (center.Red << 1) + right.Red) >> 2;
- dp->Green = (left.Green + (center.Green << 1) + right.Green) >> 2;
- dp->Blue = (left.Blue + (center.Blue << 1) + right.Blue) >> 2;
- dp->Alpha = (left.Alpha + (center.Alpha << 1) + right.Alpha) >> 2;
- left = center;
- center = right;
- dp++, sp++;
- }
-
- right = center;
- dp->Red = (left.Red + (center.Red << 1) + right.Red) >> 2;
- dp->Green = (left.Green + (center.Green << 1) + right.Green) >> 2;
- dp->Blue = (left.Blue + (center.Blue << 1) + right.Blue) >> 2;
- dp->Alpha = (left.Alpha + (center.Alpha << 1) + right.Alpha) >> 2;
-
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- return;
-}
-
-static void
-TentVertically(Pict *destPtr, Pict *srcPtr)
-{
- Blt_Pixel *srcColPtr, *destColumnPtr;
- int x;
-
- srcColPtr = srcPtr->bits;
- destColumnPtr = destPtr->bits;
- for (x = 0; x < srcPtr->width; x++) {
- Blt_Pixel left, center, right;
- Blt_Pixel *dp, *sp, *send;
-
- dp = destColumnPtr;
- sp = srcColPtr + srcPtr->pixelsPerRow;
- left = *srcColPtr, center = left, right = *sp;
- dp->Red = (left.Red + (center.Red << 1) + right.Red) >> 2;
- dp->Green = (left.Green + (center.Green << 1) + right.Green) >> 2;
- dp->Blue = (left.Blue + (center.Blue << 1) + right.Blue) >> 2;
- dp->Alpha = (left.Alpha + (center.Alpha << 1) + right.Alpha) >> 2;
- center = right;
- dp += destPtr->pixelsPerRow;
- sp += srcPtr->pixelsPerRow;
-
- for (send = srcColPtr + (srcPtr->height * srcPtr->pixelsPerRow);
- sp < send; /* empty */) {
- right = *sp;
- dp->Red = (left.Red + (center.Red << 1) + right.Red) >> 2;
- dp->Green = (left.Green + (center.Green << 1) + right.Green) >> 2;
- dp->Blue = (left.Blue + (center.Blue << 1) + right.Blue) >> 2;
- dp->Alpha = (left.Alpha + (center.Alpha << 1) + right.Alpha) >> 2;
- left = center;
- center = right;
- dp += destPtr->pixelsPerRow;
- sp += srcPtr->pixelsPerRow;
- }
- right = center;
- dp->Red = (left.Red + (center.Red << 1) + right.Red) >> 2;
- dp->Green = (left.Green + (center.Green << 1) + right.Green) >> 2;
- dp->Blue = (left.Blue + (center.Blue << 1) + right.Blue) >> 2;
- dp->Alpha = (left.Alpha + (center.Alpha << 1) + right.Alpha) >> 2;
-
- srcColPtr++, destColumnPtr++;
- }
-}
-
-static void
-ApplyPictureToPicture(Pict *destPtr, Pict *srcPtr, int x, int y,
- int w, int h, int dx, int dy, Blt_PictureArithOps op)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- if ((x + w) > srcPtr->width) {
- w -= srcPtr->width - x;
- }
- if ((y + h) > srcPtr->height) {
- h -= srcPtr->height - y;
- }
- if ((dx + w) > destPtr->width) {
- w -= destPtr->width - dx;
- }
- if ((dy + h) > destPtr->height) {
- h -= destPtr->height - dy;
- }
- srcRowPtr = srcPtr->bits + (srcPtr->pixelsPerRow * y) + x;
- destRowPtr = destPtr->bits + (destPtr->pixelsPerRow * dy) + dx;
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *dend;
-
- sp = srcRowPtr;
- dp = destRowPtr, dend = dp + w;
- switch(op) {
-
- case PIC_ARITH_ADD:
- while (dp < dend) {
- int i;
- i = dp->Red + sp->Red;
- dp->Red = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- i = dp->Green + sp->Green;
- dp->Green = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- i = dp->Blue + sp->Blue;
- dp->Blue = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- i = dp->Alpha + sp->Alpha;
- dp->Alpha = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- sp++, dp++;
- }
- break;
-
- case PIC_ARITH_SUB:
- while (dp < dend) {
- int i;
-
- i = dp->Red - sp->Red;
- dp->Red = (i < 0) ? 0 : i;
- i = dp->Green - sp->Green;
- dp->Green = (i < 0) ? 0 : i;
- i = dp->Blue - sp->Blue;
- dp->Blue = (i < 0) ? 0 : i;
- i = dp->Alpha - sp->Alpha;
- dp->Alpha = (i < 0) ? 0 : i;
- sp++, dp++;
- }
- break;
-
- case PIC_ARITH_RSUB:
- while (dp < dend) {
- int i;
-
- i = sp->Red - dp->Red;
- dp->Red = (i < 0) ? 0 : i;
- i = sp->Green - dp->Green;
- dp->Green = (i < 0) ? 0 : i;
- i = sp->Blue - dp->Blue;
- dp->Blue = (i < 0) ? 0 : i;
- i = sp->Alpha - dp->Alpha;
- dp->Alpha = (i < 0) ? 0 : i;
- sp++, dp++;
- }
- break;
-
- case PIC_ARITH_AND:
- while (dp < dend) {
- dp->u32 &= sp->u32;
- sp++, dp++;
- }
- break;
-
- case PIC_ARITH_OR:
- while (dp < dend) {
- dp->u32 |= sp->u32;
- sp++, dp++;
- }
- break;
-
- case PIC_ARITH_XOR:
- while (dp < dend) {
- dp->u32 ^= sp->u32;
- sp++, dp++;
- }
- break;
-
- case PIC_ARITH_NAND:
- while (dp < dend) {
- dp->u32 = ~(dp->u32 & sp->u32);
- sp++, dp++;
- }
- break;
-
- case PIC_ARITH_NOR:
- while (dp < dend) {
- dp->u32 = ~(dp->u32 | sp->u32);
- sp++, dp++;
- }
- break;
-
- case PIC_ARITH_MIN:
- while (dp < dend) {
- dp->Red = MIN(dp->Red, sp->Red);
- dp->Green = MIN(dp->Green, sp->Green);
- dp->Blue = MIN(dp->Blue, sp->Blue);
- dp->Alpha = MIN(dp->Alpha, sp->Alpha);
- sp++, dp++;
- }
- break;
-
- case PIC_ARITH_MAX:
- while (dp < dend) {
- dp->Red = MAX(dp->Red, sp->Red);
- dp->Green = MAX(dp->Green, sp->Green);
- dp->Blue = MAX(dp->Blue, sp->Blue);
- dp->Alpha = MAX(dp->Alpha, sp->Alpha);
- sp++, dp++;
- }
- break;
-
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
-}
-
-void
-Blt_ApplyColorToPicture(Pict *srcPtr, Blt_Pixel *colorPtr)
-{
- Blt_Pixel *srcRowPtr;
- int y;
-
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
-
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- if (sp->Alpha != 0x0) {
- sp->Red = colorPtr->Red;
- sp->Green = colorPtr->Green;
- sp->Blue = colorPtr->Blue;
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
-}
-
-static void
-ApplyScalarToPicture(Pict *srcPtr, Blt_Pixel *colorPtr, Blt_PictureArithOps op)
-{
- Blt_Pixel *srcRowPtr;
- int y;
-
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
-
- sp = srcRowPtr;
- send = sp + srcPtr->width;
- switch(op) {
-
- case PIC_ARITH_ADD:
- while (sp < send) {
- int i;
-
- i = sp->Red + colorPtr->Red;
- sp->Red = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- i = sp->Green + colorPtr->Green;
- sp->Green = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- i = sp->Blue + colorPtr->Blue;
- sp->Blue = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- i = sp->Alpha + colorPtr->Alpha;
- sp->Alpha = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- sp++;
- }
- break;
-
- case PIC_ARITH_SUB:
- while (sp < send) {
- int i;
-
- i = sp->Red - colorPtr->Red;
- sp->Red = (i < 0) ? 0 : i;
- i = sp->Green - colorPtr->Green;
- sp->Green = (i < 0) ? 0 : i;
- i = sp->Blue - colorPtr->Blue;
- sp->Blue = (i < 0) ? 0 : i;
- i = sp->Alpha - colorPtr->Alpha;
- sp->Alpha = (i < 0) ? 0 : i;
- sp++;
- }
- break;
-
- case PIC_ARITH_RSUB:
- while (sp < send) {
- int i;
-
- i = colorPtr->Red - sp->Red;
- sp->Red = (i < 0) ? 0 : i;
- i = colorPtr->Green - sp->Green;
- sp->Green = (i < 0) ? 0 : i;
- i = colorPtr->Blue - sp->Blue;
- sp->Blue = (i < 0) ? 0 : i;
- i = colorPtr->Alpha - sp->Alpha;
- sp->Alpha = (i < 0) ? 0 : i;
- sp++;
- }
- break;
-
- case PIC_ARITH_AND:
- while (sp < send) {
- sp->u32 &= colorPtr->u32;
- sp++;
- }
- break;
-
- case PIC_ARITH_OR:
- while (sp < send) {
- sp->u32 |= colorPtr->u32;
- sp++;
- }
- break;
-
- case PIC_ARITH_XOR:
- while (sp < send) {
- sp->u32 ^= colorPtr->u32;
- sp++;
- }
- break;
-
- case PIC_ARITH_NAND:
- while (sp < send) {
- sp->u32 = ~(sp->u32 & colorPtr->u32);
- sp++;
- }
- break;
-
- case PIC_ARITH_NOR:
- while (sp < send) {
- sp->u32 = ~(sp->u32 | colorPtr->u32);
- sp++;
- }
- break;
-
- case PIC_ARITH_MIN:
- while (sp < send) {
- sp->Red = MIN(sp->Red, colorPtr->Red);
- sp->Green = MIN(sp->Green, colorPtr->Green);
- sp->Blue = MIN(sp->Blue, colorPtr->Blue);
- sp->Alpha = MIN(sp->Alpha, colorPtr->Alpha);
- sp++;
- }
- break;
- case PIC_ARITH_MAX:
- while (sp < send) {
- sp->Red = MAX(sp->Red, colorPtr->Red);
- sp->Green = MAX(sp->Green, colorPtr->Green);
- sp->Blue = MAX(sp->Blue, colorPtr->Blue);
- sp->Alpha = MAX(sp->Alpha, colorPtr->Alpha);
- sp++;
- }
- break;
-
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
-}
-
-
-static void
-ApplyPictureToPictureWithMask(Pict *destPtr, Pict *srcPtr, Pict *maskPtr,
- int x, int y, int w, int h, int dx, int dy,
- int invert, Blt_PictureArithOps op)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr, *maskRowPtr;
- unsigned int off;
-
- if ((x + w) > srcPtr->width) {
- w -= srcPtr->width - x;
- }
- if ((y + h) > srcPtr->height) {
- h -= srcPtr->height - y;
- }
- if ((dx + w) > destPtr->width) {
- w -= destPtr->width - dx;
- }
- if ((dy + h) > destPtr->height) {
- h -= destPtr->height - dy;
- }
- off = (invert) ? (unsigned int)-1 : 0;
- maskRowPtr = maskPtr->bits;
- srcRowPtr = srcPtr->bits + (srcPtr->pixelsPerRow * y) + x;
- destRowPtr = destPtr->bits + (destPtr->pixelsPerRow * dy) + dx;
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *mp, *mend;
-
- sp = srcRowPtr, dp = destRowPtr;
- mp = maskRowPtr, mend = mp + w;
- switch(op) {
-
- case PIC_ARITH_ADD:
- while (mp < mend) {
- if (mp->u32 != off) {
- int i;
-
- i = dp->Red + sp->Red;
- dp->Red = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- i = dp->Green + sp->Green;
- dp->Green = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- i = dp->Blue + sp->Blue;
- dp->Blue = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- i = dp->Alpha + sp->Alpha;
- dp->Alpha = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- }
- sp++, dp++, mp++;
- }
- break;
-
- case PIC_ARITH_SUB:
- while (mp < mend) {
- if (mp->u32 != off) {
- int i;
-
- i = dp->Red - sp->Red;
- dp->Red = (i < 0) ? 0 : i;
- i = dp->Green - sp->Green;
- dp->Green = (i < 0) ? 0 : i;
- i = dp->Blue - sp->Blue;
- dp->Blue = (i < 0) ? 0 : i;
- i = dp->Alpha - sp->Alpha;
- dp->Alpha = (i < 0) ? 0 : i;
- }
- sp++, dp++, mp++;
- }
- break;
-
- case PIC_ARITH_RSUB:
- while (mp < mend) {
- if (mp->u32 != off) {
- int i;
-
- i = sp->Red - dp->Red;
- dp->Red = (i < 0) ? 0 : i;
- i = sp->Green - dp->Green;
- dp->Green = (i < 0) ? 0 : i;
- i = sp->Blue - dp->Blue;
- dp->Blue = (i < 0) ? 0 : i;
- i = sp->Alpha - dp->Alpha;
- dp->Alpha = (i < 0) ? 0 : i;
- }
- sp++, dp++, mp++;
- }
- break;
-
- case PIC_ARITH_AND:
- while (mp < mend) {
- if (mp->u32 != off) {
- dp->u32 &= sp->u32;
- }
- sp++, dp++, mp++;
- }
- break;
-
- case PIC_ARITH_OR:
- while (mp < mend) {
- if (mp->u32 != off) {
- dp->u32 |= sp->u32;
- }
- sp++, dp++, mp++;
- }
- break;
-
- case PIC_ARITH_XOR:
- while (mp < mend) {
- if (mp->u32 != off) {
- dp->u32 ^= sp->u32;
- }
- sp++, dp++, mp++;
- }
- break;
-
- case PIC_ARITH_NAND:
- while (mp < mend) {
- if (mp->u32 != off) {
- dp->u32 = ~(dp->u32 & sp->u32);
- }
- sp++, dp++, mp++;
- }
- break;
-
- case PIC_ARITH_NOR:
- while (mp < mend) {
- if (mp->u32 != off) {
- dp->u32 = ~(dp->u32 | sp->u32);
- }
- sp++, dp++, mp++;
- }
- break;
-
- case PIC_ARITH_MIN:
- while (mp < mend) {
- if (mp->u32 != off) {
- dp->Red = MIN(dp->Red, sp->Red);
- dp->Green = MIN(dp->Green, sp->Green);
- dp->Blue = MIN(dp->Blue, sp->Blue);
- dp->Alpha = MIN(dp->Alpha, sp->Alpha);
- }
- sp++, dp++, mp++;
- }
- break;
-
- case PIC_ARITH_MAX:
- while (mp < mend) {
- if (mp->u32 != off) {
- dp->Red = MAX(dp->Red, sp->Red);
- dp->Green = MAX(dp->Green, sp->Green);
- dp->Blue = MAX(dp->Blue, sp->Blue);
- dp->Alpha = MAX(dp->Alpha, sp->Alpha);
- }
- sp++, dp++, mp++;
- }
- break;
-
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- maskRowPtr += maskPtr->pixelsPerRow;
- }
-}
-
-static void
-ApplyScalarToPictureWithMask(Pict *srcPtr, Blt_Pixel *colorPtr, Pict *maskPtr,
- int invert, Blt_PictureArithOps op)
-{
- Blt_Pixel *srcRowPtr, *maskRowPtr;
- int width, height;
- int y;
- unsigned int off;
-
- width = MIN(srcPtr->width, maskPtr->width);
- height = MIN(srcPtr->height, maskPtr->height);
- srcRowPtr = srcPtr->bits;
- maskRowPtr = maskPtr->bits;
- off = (invert) ? (unsigned int)-1 : 0;
- for (y = 0; y < height; y++) {
- Blt_Pixel *sp, *mp, *mend;
-
- sp = srcRowPtr;
- mp = maskRowPtr, mend = mp + width;
- switch(op) {
-
- case PIC_ARITH_ADD:
- while (mp < mend) {
- if (mp->u32 != off) {
- int i;
-
- i = sp->Red + colorPtr->Red;
- sp->Red = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- i = sp->Green + colorPtr->Green;
- sp->Green = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- i = sp->Blue + colorPtr->Blue;
- sp->Blue = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- i = sp->Alpha + colorPtr->Alpha;
- sp->Alpha = (i > MAXINTENSITY) ? MAXINTENSITY : i;
- }
- sp++, mp++;
- }
- break;
-
- case PIC_ARITH_SUB:
- while (mp < mend) {
- if (mp->u32 != off) {
- int i;
-
- i = sp->Red - colorPtr->Red;
- sp->Red = (i < 0) ? 0 : i;
- i = sp->Green - colorPtr->Green;
- sp->Green = (i < 0) ? 0 : i;
- i = sp->Blue - colorPtr->Blue;
- sp->Blue = (i < 0) ? 0 : i;
- i = sp->Alpha - colorPtr->Alpha;
- sp->Alpha = (i < 0) ? 0 : i;
- }
- sp++, mp++;
- }
- break;
-
- case PIC_ARITH_RSUB:
- while (mp < mend) {
- if (mp->u32 != off) {
- int i;
-
- i = colorPtr->Red - sp->Red;
- sp->Red = (i < 0) ? 0 : i;
- i = colorPtr->Green - sp->Green;
- sp->Green = (i < 0) ? 0 : i;
- i = colorPtr->Blue - sp->Blue;
- sp->Blue = (i < 0) ? 0 : i;
- i = colorPtr->Alpha - sp->Alpha;
- sp->Alpha = (i < 0) ? 0 : i;
- }
- sp++, mp++;
- }
- break;
-
- case PIC_ARITH_AND:
- while (mp < mend) {
- if (mp->u32 != off) {
- sp->u32 &= colorPtr->u32;
- }
- sp++, mp++;
- }
- break;
-
- case PIC_ARITH_OR:
- while (mp < mend) {
- if (mp->u32 != off) {
- sp->u32 |= colorPtr->u32;
- }
- sp++, mp++;
- }
- break;
-
- case PIC_ARITH_XOR:
- while (mp < mend) {
- if (mp->u32 != off) {
- sp->u32 ^= colorPtr->u32;
- }
- sp++, mp++;
- }
- break;
-
- case PIC_ARITH_NAND:
- while (mp < mend) {
- if (mp->u32 != off) {
- sp->u32 = ~(sp->u32 & colorPtr->u32);
- }
- sp++, mp++;
- }
- break;
-
- case PIC_ARITH_NOR:
- while (mp < mend) {
- if (mp->u32 != off) {
- sp->u32 = ~(sp->u32 | colorPtr->u32);
- }
- sp++, mp++;
- }
- break;
-
- case PIC_ARITH_MIN:
- while (mp < mend) {
- if (mp->u32 != off) {
- sp->Red = MIN(sp->Red, colorPtr->Red);
- sp->Green = MIN(sp->Green, colorPtr->Green);
- sp->Blue = MIN(sp->Blue, colorPtr->Blue);
- sp->Alpha = MIN(sp->Alpha, colorPtr->Alpha);
- }
- sp++, mp++;
- }
- break;
- case PIC_ARITH_MAX:
- while (mp < mend) {
- if (mp->u32 != off) {
- sp->Red = MAX(sp->Red, colorPtr->Red);
- sp->Green = MAX(sp->Green, colorPtr->Green);
- sp->Blue = MAX(sp->Blue, colorPtr->Blue);
- sp->Alpha = MAX(sp->Alpha, colorPtr->Alpha);
- }
- sp++, mp++;
- }
- break;
-
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- maskRowPtr += maskPtr->pixelsPerRow;
- }
-}
-
-void
-Blt_MultiplyPixels(Pict *srcPtr, float scalar)
-{
- Blt_Pixel *srcRowPtr;
- short int s15;
- int y;
- float x;
- int nBits, bias;
-
- x = FABS(scalar);
- if (FABS(x) > 127.0) {
- return;
- }
- /* Figure out how many bits we need. */
- nBits = 0;
- while ((1 << nBits) < x) {
- nBits++;
- }
- nBits = 15 - nBits;
- bias = (1 << nBits) / 2;
- if (scalar < 0) {
- bias = -bias;
- }
-
- s15 = (short int)((scalar * (float)(1 << nBits)) + 0.5);
-
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
-
- sp = srcRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- short int r15, g15, b15, a15;
- int i31;
- short int i15;
-
- r15 = ((sp->Red << 8) + sp->Red) >> 1;
- g15 = ((sp->Green << 8) + sp->Green) >> 1;
- b15 = ((sp->Blue << 8) + sp->Blue) >> 1;
- a15 = ((sp->Alpha << 8) + sp->Alpha) >> 1;
-
- i31 = r15 * s15;
- i15 = i31 >> 16; /* Truncate lower 16 bits */
- i15 =+ bias;
- i15 >>= nBits;
- sp->Red = (i15 > 255) ? 255 : i15;
-
- i31 = g15 * s15;
- i15 = i31 >> 16; /* Truncate lower 16 bits */
- i15 =+ bias;
- i15 >>= nBits;
- sp->Green = (i15 > 255) ? 255 : i15;
-
- i31 = b15 * s15;
- i15 = i31 >> 16; /* Truncate lower 16 bits */
- i15 =+ bias;
- i15 >>= nBits;
- sp->Green = (i15 > 255) ? 255 : i15;
-
- i31 = a15 * s15;
- i15 = i31 >> 16; /* Truncate lower 16 bits */
- i15 =+ bias;
- i15 >>= nBits;
- sp->Alpha = (i15 > 255) ? 255 : i15;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
-}
-
-static void
-SelectPixels(Pict *destPtr, Pict *srcPtr, Blt_Pixel *lowPtr, Blt_Pixel *highPtr)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- int y;
-
- if (srcPtr != destPtr) {
- Blt_ResizePicture(destPtr, srcPtr->width, srcPtr->height);
- }
- destRowPtr = destPtr->bits, srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *dp, *sp, *send;
-
- dp = destRowPtr;
- for(sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++, dp++) {
- if ((sp->Red >= lowPtr->Red) && (sp->Red <= highPtr->Red) &&
- (sp->Green >= lowPtr->Green) && (sp->Green <= highPtr->Green) &&
- (sp->Blue >= lowPtr->Blue) && (sp->Blue <= highPtr->Blue) &&
- (sp->Alpha >= lowPtr->Alpha) && (sp->Alpha <= highPtr->Alpha)) {
- dp->u32 = 0xFFFFFFFF;
- } else {
- dp->u32 = 0;
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- destPtr->flags &= ~BLT_PIC_BLEND;
- destPtr->flags |= BLT_PIC_MASK;
-}
-
-#ifdef nodtdef
-void
-Blt_BoxFilterPicture(Pict *destPtr, Pict *srcPtr)
-{
- Blt_ResizePicture(destPtr, srcPtr->width, srcPtr->height);
- BoxY(destPtr, srcPtr);
- BoxX(destPtr, destPtr);
-}
-
-void
-Blt_TentFilterPicture(Pict *destPtr, Pict *srcPtr)
-{
- Blt_ResizePicture(destPtr, srcPtr->width, srcPtr->height);
- Blt_TentVertically(destPtr, srcPtr);
- Blt_TentHorizontally(destPtr, destPtr);
-}
-
-static unsigned int
-ComputeWeights(
- unsigned int sw, unsigned int dw, /* Source and destination widths. */
- ResampleFilter *filterPtr,
- Sample **samplePtrPtr)
-{
- Sample *samples;
- double scale;
- int bytesPerSample;
-
- /* Pre-calculate filter contributions for a row */
- scale = (double)dw / (double)sw;
- if (scale < 1.0) {
- Sample *samplePtr;
- double radius, fscale;
- int filterSize, x;
-
- /* Downsample */
-
- radius = filterPtr->support / scale;
- fscale = 1.0 / scale;
- filterSize = (int)(radius * 2 + 2);
-
- bytesPerSample = sizeof(Sample) +
- ((filterSize - 1) * sizeof(PixelWeight));
- samples = Blt_AssertCalloc(dw, bytesPerSample);
- samplePtr = samples;
-#define DEBUG 0
-#if DEBUG
- fprintf(stderr, "downscale=%g, fscale=%g, radius=%g\n",
- scale, fscale, radius);
-#endif
- for (x = 0; x < dw; x++) {
- PixelWeight *wp;
- double center;
- int i, left, right; /* Filter bounds. */
-
- center = ((double)x + 0.5) * fscale;
-
- /* Determine bounds of filter and its density. */
- left = (int)/*floor*/(center - radius);
- if (left < 0) {
- left = 0;
- }
- right = (int)/*floor*/(center + radius);
- if (right >= sw) {
- right = sw - 1;
- }
- samplePtr->start = left;
- samplePtr->wend = samplePtr->weights + (right - left + 1);
-
- for (wp = samplePtr->weights, i = left; i <= right; i++, wp++) {
- wp->f32 = (float)
- (*filterPtr->proc)(((double)i - center) * scale);
- wp->i32 = float2si(wp->f32);
- }
- samplePtr = (Sample *)((char *)samplePtr + bytesPerSample);
- }
- } else {
- Sample *samplePtr;
- double fscale;
- int filterSize, x;
-
- /* Upsample */
-
- filterSize = (int)(filterPtr->support * 2 + 2);
- bytesPerSample = sizeof(Sample) +
- ((filterSize - 1) * sizeof(PixelWeight));
- samples = Blt_AssertCalloc(dw, bytesPerSample);
- fscale = 1.0 / scale;
-
- samplePtr = samples;
-#if DEBUG
- fprintf(stderr, "upscale=%g, fscale=%g, radius=%g\n",
- scale, fscale, filterPtr->support);
-#endif
- for (x = 0; x < dw; x++) {
- PixelWeight *wp;
- double center;
- int i, left, right; /* Filter bounds. */
-
- center = ((double)x + 0.5) * fscale;
- left = (int)(center - filterPtr->support);
- if (left < 0) {
- left = 0;
- }
- right = (int)(center + filterPtr->support);
- if (right >= sw) {
- right = sw - 1;
- }
- samplePtr->start = left;
- samplePtr->wend = samplePtr->weights + (right - left + 1);
-
- /* Sum the contributions for each pixel in the filter. */
- for (wp = samplePtr->weights, i = left; i <= right;i++, wp++) {
- wp->f32 = (float) (*filterPtr->proc)((double)i - center);
- wp->i32 = float2si(wp->f32);
- }
- /* Go get the next sample. */
- samplePtr = (Sample *)((char *)samplePtr + bytesPerSample);
- }
- }
- *samplePtrPtr = samples;
- return bytesPerSample;
-}
-#endif
-
-static unsigned int *
-CreateNeighborhoodMap(unsigned int size, unsigned int radius)
-{
- unsigned int newSize;
- unsigned int *map, *p;
- unsigned int i;
-
- newSize = size + radius + radius;
- map = Blt_AssertMalloc(sizeof(unsigned int) * newSize);
- p = map;
- for (i = 0; i < radius; i++, p++) {
- *p = 0; /* Before the picture. Replicate the first
- * pixel. */
- }
- for (i = 0; i < size; i++, p++) {
- *p = i;
- }
- for (i = 0; i < radius; i++, p++) {
- *p = size - 1; /* After the picture. Replicate the last
- * pixel */
- }
- return map;
-}
-
-static void
-ConvolveVertically(Pict *destPtr, Pict *srcPtr, TableFilter *filterPtr)
-{
- int x;
- unsigned *map, mapSize;
- int fscale;
-
- map = CreateNeighborhoodMap(srcPtr->height, filterPtr->nWeights / 2);
- mapSize = srcPtr->height + filterPtr->nWeights;
- fscale = float2si(filterPtr->scale);
-
- /* Apply filter to each row. */
- for (x = 0; x < srcPtr->width; x++) {
- Blt_Pixel *dp, *srcColPtr;
-
- srcColPtr = srcPtr->bits + x;
- dp = destPtr->bits + x;
- for (x = 0; x < mapSize; x++) {
- int i;
- int r, g, b, a;
-
- r = g = b = a = 0;
- for (i = 0; i < filterPtr->nWeights; i++) {
- int sx;
- Blt_Pixel *sp;
-
- sx = map[x + i];
- sp = srcColPtr + (srcPtr->pixelsPerRow * sx);
- r += sp->Red * filterPtr->weights[i];
- g += sp->Green * filterPtr->weights[i];
- b += sp->Blue * filterPtr->weights[i];
- a += sp->Alpha * filterPtr->weights[i];
- }
- r *= fscale;
- g *= fscale;
- b *= fscale;
- a *= fscale;
- dp->Red = (unsigned char)SICLAMP(r);
- dp->Green = (unsigned char)SICLAMP(g);
- dp->Blue = (unsigned char)SICLAMP(b);
- dp->Alpha = (unsigned char)SICLAMP(a);
- dp += destPtr->pixelsPerRow;
- }
- }
- /* Free the memory allocated for filter weights. */
- Blt_Free(map);
-}
-
-static void
-ConvolveHorizontally(Pict *destPtr, Pict *srcPtr, TableFilter *filterPtr)
-{
- int y;
- Blt_Pixel *srcRowPtr, *destRowPtr;
- unsigned int *map, mapSize;
- int fscale;
-
- map = CreateNeighborhoodMap(srcPtr->width, filterPtr->nWeights / 2);
- mapSize = srcPtr->width + filterPtr->nWeights;
- fscale = float2si(filterPtr->scale);
- destRowPtr = destPtr->bits;
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *dp;
- int x;
-
- dp = destRowPtr;
- for (x = 0; x < mapSize; x++) {
- int i;
- int r, g, b, a;
-
- r = g = b = a = 0;
- for (i = 0; i < filterPtr->nWeights; i++) {
- Blt_Pixel *sp;
-
- sp = srcRowPtr + map[x + i];
- r += sp->Red * filterPtr->weights[i];
- g += sp->Green * filterPtr->weights[i];
- b += sp->Blue * filterPtr->weights[i];
- a += sp->Alpha * filterPtr->weights[i];
- }
- r *= fscale;
- g *= fscale;
- b *= fscale;
- a *= fscale;
- dp->Red = (unsigned char)SICLAMP(r);
- dp->Green = (unsigned char)SICLAMP(g);
- dp->Blue = (unsigned char)SICLAMP(b);
- dp->Alpha = (unsigned char)SICLAMP(a);
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- /* Free the memory allocated for map. */
- Blt_Free(map);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ConvolvePicture --
- *
- * Resamples a given picture using 1-D filters and returns a new picture
- * of the designated size.
- *
- * Results:
- * Returns the resampled picture. The original picture is left intact.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ConvolvePicture(Pict *destPtr, Pict *srcPtr,
- struct _Blt_ConvolveFilter *xFilterPtr,
- struct _Blt_ConvolveFilter *yFilterPtr)
-{
- Pict *tmpPtr;
-
- tmpPtr = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- if (xFilterPtr->type == RESAMPLE_FILTER) {
- Blt_ZoomHorizontally(tmpPtr, srcPtr, xFilterPtr->filter);
- } else {
- ConvolveHorizontally(tmpPtr, srcPtr, xFilterPtr->filter);
- }
- if (yFilterPtr->type == RESAMPLE_FILTER) {
- Blt_ZoomVertically(destPtr, tmpPtr, yFilterPtr->filter);
- } else {
- ConvolveVertically(destPtr, tmpPtr, yFilterPtr->filter);
- }
- Blt_FreePicture(tmpPtr);
- destPtr->flags = (srcPtr->flags | BLT_PIC_DIRTY);
-}
-
-static void
-BoxCarVertically(Pict *destPtr, Pict *srcPtr, unsigned int r)
-{
- unsigned int x;
- unsigned int *map;
- int fscale;
- unsigned int fwidth; /* Filter width */
- float s;
-
- map = CreateNeighborhoodMap(srcPtr->height, r);
- fwidth = r + r + 1;
- s = 1.0f / fwidth;
- fscale = float2si(s);
-
- fwidth--;
- /* Apply filter to each row. */
- for (x = 0; x < srcPtr->width; x++) {
- Blt_Pixel *dp, *srcColPtr;
- int r, g, b, a;
- unsigned int y;
-
- srcColPtr = srcPtr->bits + x;
- r = g = b = a = 0;
- /* Prime the pump. */
- for (y = 0; y < fwidth; y++) {
- Blt_Pixel *sp;
-
- sp = srcColPtr + (srcPtr->pixelsPerRow * map[y]);
- r += sp->Red;
- g += sp->Green;
- b += sp->Blue;
- a += sp->Alpha;
- }
- dp = destPtr->bits + x;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp;
- int fr, fg, fb, fa;
-
- sp = srcColPtr + (srcPtr->pixelsPerRow * map[y + fwidth]);
- r += sp->Red;
- g += sp->Green;
- b += sp->Blue;
- a += sp->Alpha;
- fr = r * fscale;
- fg = g * fscale;
- fb = b * fscale;
- fa = a * fscale;
- dp->Red = (unsigned char)SICLAMP(fr);
- dp->Green = (unsigned char)SICLAMP(fg);
- dp->Blue = (unsigned char)SICLAMP(fb);
- dp->Alpha = (unsigned char)SICLAMP(fa);
- sp = srcColPtr + (srcPtr->pixelsPerRow * map[y]);
- r -= sp->Red;
- g -= sp->Green;
- b -= sp->Blue;
- a -= sp->Alpha;
- dp += destPtr->pixelsPerRow;
- }
- }
- /* Free the memory allocated for filter weights. */
- Blt_Free(map);
-}
-
-static void
-BoxCarHorizontally(Pict *destPtr, Pict *srcPtr, unsigned int r)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
- float s;
- unsigned int *map;
- int fscale;
- unsigned int y;
- unsigned int fwidth; /* Filter width */
-
- fwidth = r + r + 1;
- map = CreateNeighborhoodMap(srcPtr->width, r);
- s = 1.0f / fwidth;
- fscale = float2si(s);
- destRowPtr = destPtr->bits;
- srcRowPtr = srcPtr->bits;
- fwidth--;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *dp;
- unsigned int x;
- int r, g, b, a;
-
- /* Prime the pump. Get sums for each component for the first (fwidth)
- * pixels in the column. */
- r = g = b = a = 0;
- for (x = 0; x < fwidth; x++) {
- Blt_Pixel *sp;
-
- sp = srcRowPtr + map[x];
- r += sp->Red;
- g += sp->Green;
- b += sp->Blue;
- a += sp->Alpha;
- }
- dp = destRowPtr;
- for (x = 0; x < srcPtr->width; x++) {
- Blt_Pixel *sp;
- int fr, fg, fb, fa;
-
- sp = srcRowPtr + map[x + fwidth];
- r += sp->Red;
- g += sp->Green;
- b += sp->Blue;
- a += sp->Alpha;
- fr = r * fscale;
- fg = g * fscale;
- fb = b * fscale;
- fa = a * fscale;
- dp->Red = (unsigned char)SICLAMP(fr);
- dp->Green = (unsigned char)SICLAMP(fg);
- dp->Blue = (unsigned char)SICLAMP(fb);
- dp->Alpha = (unsigned char)SICLAMP(fa);
- sp = srcRowPtr + map[x];
- r -= sp->Red;
- g -= sp->Green;
- b -= sp->Blue;
- a -= sp->Alpha;
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- /* Free the memory allocated for map. */
- Blt_Free(map);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_BlurPicture --
- *
- * Blurs a picture using a series of 1-D box filters. The width of the
- * box filter is a parameter. The source picture is blurred and stored in
- * the destination picture.
- *
- * Results:
- * None.
- * Side Effects:
- * The original picture is left intact. The destination picture contains
- * the blurred image.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_BlurPicture(Pict *destPtr, Pict *srcPtr, unsigned int r)
-{
- Pict *tmpPtr;
-
- if (srcPtr != destPtr) {
- Blt_ResizePicture(destPtr, srcPtr->width, srcPtr->height);
- }
- tmpPtr = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- BoxCarHorizontally(tmpPtr, srcPtr, r);
- BoxCarVertically(destPtr, tmpPtr, r);
- BoxCarHorizontally(tmpPtr, destPtr, r);
- BoxCarVertically(destPtr, tmpPtr, r);
- BoxCarHorizontally(tmpPtr, destPtr, r);
- BoxCarVertically(destPtr, tmpPtr, r);
-#ifdef notdef
- BoxCarHorizontally(tmpPtr, destPtr, r);
- BoxCarVertically(destPtr, tmpPtr, r);
-#endif
- Blt_FreePicture(tmpPtr);
- destPtr->flags = (srcPtr->flags | BLT_PIC_DIRTY);
-}
-
-#ifdef notdef
-void
-Blt_BlurPictureOld(Blt_Picture pict)
-{
- Blt_Picture tmp;
-
- tmp = Blt_CreatePicture(Blt_PictureWidth(pict), Blt_PictureHeight(pict));
- BoxX(tmp, pict), BoxY(pict, tmp);
- BoxX(tmp, pict), BoxY(pict, tmp);
- BoxX(tmp, pict), BoxY(pict, tmp);
- BoxX(tmp, pict), BoxY(pict, tmp);
- Blt_FreePicture(tmp);
-}
-#endif
-
-void
-Blt_SharpenPicture(Pict *destPtr, Pict *srcPtr)
-{
- Blt_Picture blur, tmp;
-
- blur = Blt_CreatePicture(srcPtr->width, srcPtr->height);
- Blt_BlurPicture(blur, srcPtr, 4);
- /*
- * tmp = src - blur;
- * dest = src + tmp
- */
- tmp = Blt_ClonePicture(srcPtr);
- Blt_SubtractPictures(tmp, blur);
- Blt_AddPictures(tmp, srcPtr);
- Blt_FreePicture(blur);
- Blt_CopyPictureBits(destPtr, tmp, 0, 0, Blt_PictureWidth(tmp),
- Blt_PictureHeight(tmp), 0, 0);
- Blt_FreePicture(tmp);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TilePicture --
- *
- * Tiles the designated region in the destination picture with the source
- * picture.
- *
- * Please note that it is the responsibility of the caller to verify the
- * region is valid (i.e. wholly contained by the destination picture).
- *
- * Results:
- * The destination picture is tiled. The original picture * is left
- * intact.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TilePicture(
- Pict *destPtr, /* Picture to be tiled. */
- Pict *srcPtr, /* Picture used as the tile. */
- int xOrigin, int yOrigin, /* Tile origin. */
- int x, int y, int w, int h) /* Region of destination picture to be
- * tiled. */
-{
- int startX, startY; /* Starting upper left corner of
- * region. */
- int delta;
-
- /* Compute the starting x and y offsets of the tile from the coordinates
- * of the origin. */
- startX = x;
- if (x < xOrigin) {
- delta = (xOrigin - x) % srcPtr->width;
- if (delta > 0) {
- startX -= (srcPtr->width - delta);
- }
- } else if (x > xOrigin) {
- delta = (x - xOrigin) % srcPtr->width;
- if (delta > 0) {
- startX -= delta;
- }
- }
- startY = y;
- if (y < yOrigin) {
- delta = (yOrigin - y) % srcPtr->height;
- if (delta > 0) {
- startY -= (srcPtr->height - delta);
- }
- } else if (y >= yOrigin) {
- delta = (y - yOrigin) % srcPtr->height;
- if (delta > 0) {
- startY -= delta;
- }
- }
-
-#ifdef notdef
- fprintf(stderr, "tile is (%d,%d,%d,%d)\n",
- xOrigin, yOrigin, srcPtr->width, srcPtr->height);
- fprintf(stderr, "region is (%d,%d,%d,%d)\n", x, y, w, h);
- fprintf(stderr, "starting at %d,%d\n", startX, startY);
-#endif
- {
- int left, top, right, bottom;
-
- /* The region to be tiled. */
- left = x;
- right = x + w;
- top = y;
- bottom = y + h;
-
- for (y = startY; y < bottom; y += srcPtr->height) {
- int sy, dy;
- int th; /* Current tile height. */
-
- sy = 0;
- dy = y;
- th = srcPtr->height;
- if (y < top) {
- sy = (top - y);
- th = srcPtr->height - sy;
- dy = top;
- }
- if ((dy + th) > bottom) {
- th = (bottom - dy);
- }
- for (x = startX; x < right; x += srcPtr->width) {
- int sx, dx;
- int tw; /* Current tile width. */
-
- sx = 0;
- dx = x;
- tw = srcPtr->width;
- if (x < left) {
- sx = (left - x);
- tw = srcPtr->width - sx;
- dx = left;
- }
- if ((dx + tw) > right) {
- tw = (right - dx);
- }
-#ifdef notdef
- fprintf(stder, "drawing pattern (%d,%d,%d,%d) at %d,%d\n",
- sx, sy, tw, th, dx, dy);
-#endif
- Blt_BlendPictures(destPtr, srcPtr, sx, sy, tw, th, dx, dy);
- }
- }
- }
-}
-
-void
-Blt_GradientPicture(
- Pict *destPtr, /* (out) Picture to contain the new
- * gradient. */
- Blt_Pixel *maxPtr, /* Color to represent 1.0 */
- Blt_Pixel *minPtr, /* Color to represent 0.0 */
- Blt_Gradient *gradientPtr)
-{
- double rRange, gRange, bRange, aRange;
-
- /* Compute the ranges for each color component. */
- rRange = (double)(maxPtr->Red - minPtr->Red);
- gRange = (double)(maxPtr->Green - minPtr->Green);
- bRange = (double)(maxPtr->Blue - minPtr->Blue);
- aRange = (double)(maxPtr->Alpha - minPtr->Alpha);
-
- switch (gradientPtr->shape) {
- case BLT_GRADIENT_SHAPE_LINEAR:
- switch (gradientPtr->path) {
- case BLT_GRADIENT_PATH_X:
- {
- Blt_Pixel *copyRowPtr, *destRowPtr, *dp;
- int x, y;
-
- /* Draw the gradient on the first row, then copy the row to
- * each subsequent row. */
-
- destRowPtr = destPtr->bits;
- for (dp = destRowPtr, x = 0; x < destPtr->width; x++, dp++) {
- double t;
-
- t = (double)x / (double)(destPtr->width - 1);
- if (gradientPtr->jitter) {
- t += JITTER(t);
- t = JCLAMP(t);
- }
- if (gradientPtr->logScale) {
- t = log10(9.0 * t + 1.0);
- }
- dp->Red = (unsigned char)(minPtr->Red + t * rRange);
- dp->Green = (unsigned char)(minPtr->Green + t * gRange);
- dp->Blue = (unsigned char)(minPtr->Blue + t * bRange);
- dp->Alpha = (unsigned char)(minPtr->Alpha + t * aRange);
- }
- destRowPtr += destPtr->pixelsPerRow;;
- copyRowPtr = destPtr->bits;
- for (y = 1; y < destPtr->height; y++) {
- Blt_Pixel *dp, *sp, *send;
-
- for (dp = destRowPtr, sp = copyRowPtr,
- send = sp + destPtr->width; sp < send; dp++, sp++) {
- dp->u32 = sp->u32;
- }
- copyRowPtr += destPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
-
- case BLT_GRADIENT_PATH_Y:
- {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < destPtr->height; y++) {
- Blt_Pixel *dp, *dend;
- double t;
- Blt_Pixel color;
-
- /* Compute the color value for the row and then replicate
- * it in every pixel in the row. */
-
- dp = destRowPtr;
- t = (double)y / (double)(destPtr->height - 1);
- if (gradientPtr->jitter) {
- t += JITTER(t);
- t = JCLAMP(t);
- }
- if (gradientPtr->logScale) {
- t = log10(9.0 * t + 1.0);
- }
- color.Red = (unsigned char)(minPtr->Red + t * rRange);
- color.Green = (unsigned char)(minPtr->Green + t * gRange);
- color.Blue = (unsigned char)(minPtr->Blue + t * bRange);
- color.Alpha = (unsigned char)(minPtr->Alpha + t * aRange);
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- dp++) {
- dp->u32 = color.u32;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
-
- case BLT_GRADIENT_PATH_YX:
- {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < destPtr->height; y++) {
- Blt_Pixel *dp;
- int x;
- double ty;
-
- ty = (double)y / (double)(destPtr->height - 1);
- ty = 1.0 - ty;
- for (dp = destRowPtr, x=0; x < destPtr->width; x++, dp++) {
- double t;
- double tx;
-
- tx = (double)x / (double)(destPtr->width - 1);
- t = (tx + ty) * 0.5;
- if (gradientPtr->jitter) {
- t += JITTER(t);
- t = JCLAMP(t);
- }
- if (gradientPtr->logScale) {
- t = log10(9.0 * t + 1.0);
- }
- dp->Red = (unsigned char)(minPtr->Red + t * rRange);
- dp->Green = (unsigned char)(minPtr->Green + t * gRange);
- dp->Blue = (unsigned char)(minPtr->Blue + t * bRange);
- dp->Alpha = (unsigned char)(minPtr->Alpha + t * aRange);
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
- case BLT_GRADIENT_PATH_XY:
- {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < destPtr->height; y++) {
- Blt_Pixel *dp;
- int x;
- double ty;
-
- ty = (double)y / (double)(destPtr->height - 1);
- for (dp = destRowPtr, x=0; x < destPtr->width; x++, dp++) {
- double t, tx;
-
- tx = (double)x / (double)(destPtr->width - 1);
- t = (tx + ty) * 0.5;
- if (gradientPtr->jitter) {
- t += JITTER(t);
- t = JCLAMP(t);
- }
- if (gradientPtr->logScale) {
- t = log10(9.0 * t + 1.0);
- }
- dp->Red = (unsigned char)(minPtr->Red + t * rRange);
- dp->Green = (unsigned char)(minPtr->Green + t * gRange);
- dp->Blue = (unsigned char)(minPtr->Blue + t * bRange);
- dp->Alpha = (unsigned char)(minPtr->Alpha + t * aRange);
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
- }
- break;
-
- case BLT_GRADIENT_SHAPE_BILINEAR:
- switch (gradientPtr->path) {
- case BLT_GRADIENT_PATH_X:
- {
- Blt_Pixel *copyRowPtr, *destRowPtr, *dp;
- int x, y;
-
- /* Draw the gradient on the first row, then copy the row to
- * each subsequent row. */
-
- destRowPtr = destPtr->bits;
- for (dp = destRowPtr, x = 0; x < destPtr->width; x++, dp++) {
- double t;
-
- t = (double)x / (double)(destPtr->width - 1);
- if (t > 0.5) {
- t = 1.0 - t;
- }
- t += t;
- if (gradientPtr->jitter) {
- t += JITTER(t);
- t = JCLAMP(t);
- }
- if (gradientPtr->logScale) {
- t = log10(9.0 * t + 1.0);
- }
- dp->Red = (unsigned char)(minPtr->Red + t * rRange);
- dp->Green = (unsigned char)(minPtr->Green + t * gRange);
- dp->Blue = (unsigned char)(minPtr->Blue + t * bRange);
- dp->Alpha = (unsigned char)(minPtr->Alpha + t * aRange);
- }
- destRowPtr += destPtr->pixelsPerRow;;
- copyRowPtr = destPtr->bits;
- for (y = 1; y < destPtr->height; y++) {
- Blt_Pixel *dp, *sp, *send;
-
- for (dp = destRowPtr, sp = copyRowPtr,
- send = sp + destPtr->width; sp < send; dp++, sp++) {
- dp->u32 = sp->u32;
- }
- copyRowPtr += destPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
-
- case BLT_GRADIENT_PATH_Y:
- {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < destPtr->height; y++) {
- Blt_Pixel *dp, *dend;
- double t;
- Blt_Pixel color;
-
- /* Compute the color value for the row and then replicate
- * it in every pixel in the row. */
-
- dp = destRowPtr;
- t = (double)y / (double)(destPtr->height - 1);
- if (t > 0.5) {
- t = 1.0 - t;
- }
- t += t;
- if (gradientPtr->jitter) {
- t += JITTER(t);
- t = JCLAMP(t);
- }
- if (gradientPtr->logScale) {
- t = log10(9.0 * t + 1.0);
- }
- color.Red = (unsigned char)(minPtr->Red + t * rRange);
- color.Green = (unsigned char)(minPtr->Green + t * gRange);
- color.Blue = (unsigned char)(minPtr->Blue + t * bRange);
- color.Alpha = (unsigned char)(minPtr->Alpha + t * aRange);
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- dp++) {
- dp->u32 = color.u32;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
-
- case BLT_GRADIENT_PATH_YX:
- {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < destPtr->height; y++) {
- Blt_Pixel *dp;
- int x;
- double ty;
-
- ty = (double)y / (double)(destPtr->height - 1);
- for (dp = destRowPtr, x = 0; x < destPtr->width; x++, dp++) {
- double t, tx;
-
- tx = (double)x / (double)(destPtr->width - 1);
- t = 1.0 - ABS(tx - ty);
- if (gradientPtr->jitter) {
- t += JITTER(t);
- t = JCLAMP(t);
- }
- if (gradientPtr->logScale) {
- t = log10(9.0 * t + 1.0);
- }
- dp->Red = (unsigned char)(minPtr->Red + t * rRange);
- dp->Green = (unsigned char)(minPtr->Green + t * gRange);
- dp->Blue = (unsigned char)(minPtr->Blue + t * bRange);
- dp->Alpha = (unsigned char)(minPtr->Alpha + t * aRange);
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
-
- case BLT_GRADIENT_PATH_XY:
- {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < destPtr->height; y++) {
- Blt_Pixel *dp;
- int x;
- double ty;
-
- ty = (double)y / (double)(destPtr->height - 1);
- ty = 1.0 - ty;
- for (dp = destRowPtr, x=0; x < destPtr->width; x++, dp++) {
- double t, tx;
-
- tx = (double)x / (double)(destPtr->width - 1);
- t = 1.0 - ABS(tx - ty);
- if (gradientPtr->jitter) {
- t += JITTER(t);
- t = JCLAMP(t);
- }
- if (gradientPtr->logScale) {
- t = log10(9.0 * t + 1.0);
- }
- dp->Red = (unsigned char)(minPtr->Red + t * rRange);
- dp->Green = (unsigned char)(minPtr->Green + t * gRange);
- dp->Blue = (unsigned char)(minPtr->Blue + t * bRange);
- dp->Alpha = (unsigned char)(minPtr->Alpha + t * aRange);
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
- }
- break;
-
- case BLT_GRADIENT_SHAPE_RADIAL:
- {
- Blt_Pixel *destRowPtr;
- int y;
- int cx, cy;
- int range;
- destRowPtr = destPtr->bits;
-
- /* Center coordinates. */
- cx = destPtr->width / 2, cy = destPtr->height / 2;
- range = cx * cx + cy * cy;
- for (y = 0; y < destPtr->height; y++) {
- int x;
- double dy, dy2;
- Blt_Pixel *dp;
-
- dy = ABS(cy - y);
- dy2 = dy * dy;
- dp = destRowPtr;
- for (x = 0; x < destPtr->width; x++) {
- double dx;
- double t;
-
- dx = ABS(cx - x);
- t = sqrt(dx * dx + dy2) / range;
- t = 1.0 - t;
- if (gradientPtr->jitter) {
- t += JITTER(t);
- t = JCLAMP(t);
- }
- if (gradientPtr->logScale) {
- t = log10(9.0 * t + 1.0);
- }
- dp->Red = (unsigned char)(minPtr->Red + t * rRange);
- dp->Green = (unsigned char)(minPtr->Green + t * gRange);
- dp->Blue = (unsigned char)(minPtr->Blue + t * bRange);
- dp->Alpha = (unsigned char)(t * aRange);
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
-
- case BLT_GRADIENT_SHAPE_RECTANGULAR:
- {
- Blt_Pixel *destRowPtr;
- int y;
- int midX, midY;
-
- midX = destPtr->width / 2, midY = destPtr->height / 2;
- destRowPtr = destPtr->bits;
- for (y = 0; y < destPtr->height; y++) {
- Blt_Pixel *dp;
- int x;
- double ty;
-
- ty = (double)y / (double)(destPtr->height - 1);
- if (ty > 0.5) {
- ty = 1.0 - ty;
- }
- dp = destRowPtr;
- for (x = 0; x < destPtr->width; x++) {
- double t;
- double tx;
-
- tx = (double)x / (double)(destPtr->width - 1);
- if (tx > 0.5) {
- tx = 1.0 - tx;
- }
- t = MIN(tx, ty);
- t += t;
- if (gradientPtr->jitter) {
- t += JITTER(t);
- t = JCLAMP(t);
- }
- if (gradientPtr->logScale) {
- t = log10(9.0 * t + 1.0);
- }
- dp->Red = (unsigned char)(minPtr->Red + t * rRange);
- dp->Green = (unsigned char)(minPtr->Green + t * gRange);
- dp->Blue = (unsigned char)(minPtr->Blue + t * bRange);
- dp->Alpha = (unsigned char)(t * aRange);
- dp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
- }
-}
-
-void
-Blt_TexturePicture(Pict *destPtr, Blt_Pixel *lowPtr, Blt_Pixel *highPtr,
- int type)
-{
-#define TEXTURE_CHECKERED 1
-#define TEXTURE_STRIPED 0
- switch (type) {
- case TEXTURE_STRIPED:
- {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < destPtr->height; y++) {
- Blt_Pixel *dp, *dend;
- Blt_Pixel color;
-
- color = ((y / 2) & 0x1) ? *lowPtr : *highPtr;
- if (0) {
- double t;
- t = 0.8;
- t += JITTER(t);
- t = JCLAMP(t);
- color.Blue = (unsigned char)(color.Blue + t * 255.0);
- color.Red = (unsigned char)(color.Red + t * 255.0);
- color.Green = (unsigned char)(color.Green + t * 255.0);
- }
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend;
- dp++) {
- dp->u32 = color.u32;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
- case TEXTURE_CHECKERED:
- {
- Blt_Pixel *destRowPtr;
- int y;
-
- destRowPtr = destPtr->bits;
- for (y = 0; y < destPtr->height; y++) {
- Blt_Pixel *dp, *dend;
- Blt_Pixel color;
- int x;
-
- if (0) {
- double t;
- t = 0.8;
- t += JITTER(t);
- t = JCLAMP(t);
- color.Blue = (unsigned char)(color.Blue + t * 255.0);
- color.Red = (unsigned char)(color.Red + t * 255.0);
- color.Green = (unsigned char)(color.Green + t * 255.0);
- }
- for (x = 0, dp = destRowPtr, dend = dp + destPtr->width;
- dp < dend; dp++, x++) {
-
- color = (((x / 8) & 1) && (((y / 8) & 1) == 0))
- ? *lowPtr : *highPtr;
- dp->u32 = color.u32;
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- }
- break;
- }
-}
-
-int
-Blt_QueryColors(Pict *srcPtr, Blt_HashTable *tablePtr)
-{
- Blt_HashTable colorTable;
- Blt_Pixel *srcRowPtr;
- int y;
- int nColors;
- unsigned int flags;
-
- flags = 0;
- if (tablePtr == NULL) {
- Blt_InitHashTable(&colorTable, BLT_ONE_WORD_KEYS);
- tablePtr = &colorTable;
- }
- if (srcPtr->flags & BLT_PIC_ASSOCIATED_COLORS) {
- Blt_UnassociateColors(srcPtr);
- }
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
-
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- int isNew;
- Blt_Pixel color;
- unsigned long key;
-
- if ((sp->Red != sp->Green) || (sp->Green != sp->Blue)) {
- flags |= BLT_PIC_COLOR;
- }
- if (sp->Alpha != 0xFF) {
-#ifdef notdef
- fprintf(stderr, "Alpha at [%d,%d] = %x\n",
- sp - srcRowPtr, y, sp->Alpha);
-#endif
- if (sp->Alpha == 0x00) {
- flags |= BLT_PIC_MASK;
- } else {
- flags |= BLT_PIC_BLEND;
- }
- }
- color.u32 = sp->u32;
- color.Alpha = 0xFF;
- key = (unsigned long)color.u32;
- Blt_CreateHashEntry(tablePtr, (char *)key, &isNew);
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- nColors = tablePtr->numEntries;
- if (tablePtr == &colorTable) {
- Blt_DeleteHashTable(&colorTable);
- }
- srcPtr->flags |= flags;
- return nColors;
-}
-
-void
-Blt_ClassifyPicture(Pict *srcPtr)
-{
- Blt_Pixel *srcRowPtr;
- int y;
- unsigned int flags;
- int opaque, transparent;
-
- flags = 0;
- srcRowPtr = srcPtr->bits;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
-
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- if ((sp->Red != sp->Green) || (sp->Green != sp->Blue)) {
- flags |= BLT_PIC_COLOR;
- goto checkOpacity;
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- checkOpacity:
- srcRowPtr = srcPtr->bits;
- opaque = transparent = FALSE;
- for (y = 0; y < srcPtr->height; y++) {
- Blt_Pixel *sp, *send;
-
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++) {
- if (sp->Alpha == 0xFF) {
- opaque = TRUE;
- } else if (sp->Alpha == 0x00) {
- transparent = TRUE;
- } else {
- flags |= BLT_PIC_BLEND;
- goto setFlags;
- }
- }
- if (opaque && transparent) {
- flags |= BLT_PIC_MASK;
- goto setFlags;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- setFlags:
- srcPtr->flags |= flags;
-}
-
-void
-Blt_MaskPicture(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy, Blt_Pixel *colorPtr)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((y * srcPtr->pixelsPerRow) + x);
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *send;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++, dp++) {
- if (sp->u32 != 0) {
- dp->u32 = colorPtr->u32;
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
-}
-
-void
-Blt_MaskPicture2(Pict *destPtr, Pict *srcPtr, int x, int y, int w, int h,
- int dx, int dy, Blt_Pixel *colorPtr)
-{
- Blt_Pixel *srcRowPtr, *destRowPtr;
-
- destRowPtr = destPtr->bits + ((dy * destPtr->pixelsPerRow) + dx);
- srcRowPtr = srcPtr->bits + ((y * srcPtr->pixelsPerRow) + x);
- for (y = 0; y < h; y++) {
- Blt_Pixel *sp, *dp, *send;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + srcPtr->width; sp < send; sp++, dp++) {
- if (sp->Alpha == 0xFF) {
- dp->u32 = colorPtr->u32;
- }
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += destPtr->pixelsPerRow;
- }
-}
-
-
-Blt_Picture
-Blt_GetPictureFromImage(Tcl_Interp *interp, Tk_Image tkImage, int *isPhotoPtr)
-{
- const char *type;
- Blt_Picture picture;
- int isPhoto;
-
- type = Blt_Image_NameOfType(tkImage);
- if (strcmp(type, "picture") == 0) {
- picture = Blt_GetPictureFromPictureImage(interp, tkImage);
- isPhoto = FALSE;
- } else if (strcmp(type, "photo") == 0) {
- picture = Blt_GetPictureFromPhotoImage(interp, tkImage);
- isPhoto = TRUE;
- } else {
- isPhoto = FALSE;
- if (interp != NULL) {
- Tcl_AppendResult(interp, "image is not a photo or picture",
- (char *)NULL);
- }
- return NULL;
- }
- if (isPhotoPtr != NULL) {
- *isPhotoPtr = isPhoto;
- }
- return picture;
-}
diff --git a/blt3.0.1/src/bltPicture.h b/blt3.0.1/src/bltPicture.h
deleted file mode 100644
index 0a0f19a..0000000
--- a/blt3.0.1/src/bltPicture.h
+++ /dev/null
@@ -1,416 +0,0 @@
-
-/*
- * bltPicture.h --
- *
- * Copyright 2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_PICTURE_H
-#define _BLT_PICTURE_H
-
-#include <bltHash.h>
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Pixel --
- *
- * A union representing either a pixel as a RGBA quartet or a single
- * word value.
- *
- *---------------------------------------------------------------------------
- */
-typedef union {
- unsigned int u32;
- struct {
-#ifdef WORDS_BIGENDIAN
- unsigned char a, r, g, b;
-#else
- unsigned char b, g, r, a;
-#endif
- } u8;
-} Blt_Pixel;
-
-#define Red u8.r
-#define Blue u8.b
-#define Green u8.g
-#define Alpha u8.a
-
-#define ALPHA_OPAQUE (0xFF)
-#define ALPHA_TRANSPARENT (0)
-#define MAXINTENSITY (0xFF)
-
-#define GAMMA (1.0f)
-
-struct _Blt_Ps;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Picture --
- *
- * The structure below represents a picture. Each pixel occupies a
- * 32-bit word of memory: one byte for each of the red, green, and blue
- * color intensities, and another for alpha-channel image compositing
- * (e.g. transparency).
- *
- *---------------------------------------------------------------------------
- */
-struct _Blt_Picture {
- void *buffer; /* Unaligned (malloc'ed) memory for pixels. */
- Blt_Pixel *bits; /* Array of pixels containing the RGBA
- * values. */
- short int delay;
- short int flags; /* Flags describing the picture. */
- short int width, height; /* Dimensions of the image in pixels. */
- short int pixelsPerRow; /* Stride of the image. */
- short int reserved;
-};
-
-#define BLT_PIC_COLOR (1<<0) /* Indicates if color or greyscale. */
-#define BLT_PIC_BLEND (1<<1) /* Picture has partial opaque pixels. */
-#define BLT_PIC_MASK (1<<2) /* Pixels are either 100% opaque or
- * transparent. The separate BLEND and MASK
- * flags are so that don't premultiply alphas
- * for masks. */
-
-#define BLT_PIC_ASSOCIATED_COLORS (1<<3)
- /* Indicates if RGB components have been
- * premultiplied by their alphas. */
-
-#define BLT_PIC_DIRTY (1<<4) /* Indicates that the picture contents have
- * changed. Cached items may need to be
- * refreshed. For example, may need to
- * premultiply alphas again. */
-
-#define BLT_PIC_FMT_ASCII (1<<0)
-#define BLT_PIC_FMT_LOADED (1<<1)
-
-#define BLT_PAINTER_DITHER (1<<0)
-
-#define BLT_PAINTER_BLEND_MASK (0x0F)
-#define BLT_PAINTER_BLEND_NONE (0)
-#define BLT_PAINTER_BLEND_MIN_ALPHAS (1<<1)
-#define BLT_PAINTER_BLEND_MAX_ALPHAS (1<<2)
-#define BLT_PAINTER_BLEND_DIFF (1<<3)
-#define BLT_PAINTER_BLEND_MULTIPLY (1<<4)
-#define BLT_PAINTER_BLEND_UNDER (1<<6)
-
-typedef enum GradientShapes {
- BLT_GRADIENT_SHAPE_LINEAR,
- BLT_GRADIENT_SHAPE_BILINEAR,
- BLT_GRADIENT_SHAPE_RADIAL,
- BLT_GRADIENT_SHAPE_RECTANGULAR
-} Blt_GradientShape;
-
-typedef enum GradientPaths {
- BLT_GRADIENT_PATH_X,
- BLT_GRADIENT_PATH_Y,
- BLT_GRADIENT_PATH_XY,
- BLT_GRADIENT_PATH_YX,
-} Blt_GradientPath;
-
-typedef struct {
- Blt_GradientShape shape; /* Determines the shape of gradient. */
-
- Blt_GradientPath path; /* Determines the direction of a linear or
- * bilinear gradient. */
-
- int logScale; /* If non-zero, use a logarithmic scale to
- * ramp colors. */
-
- int jitter; /* If non-zero, add jitter error to
- * gradient. */
-
-} Blt_Gradient;
-
-typedef struct _Blt_PictureImage *Blt_PictureImage;
-typedef struct _Blt_ResampleFilter *Blt_ResampleFilter;
-typedef struct _Blt_ConvolveFilter *Blt_ConvolveFilter;
-typedef struct _Blt_Picture *Blt_Picture;
-
-struct _Blt_Chain;
-
-/*
- * Blt_Picture is supposed to be an opaque type. Use the macros below to
- * access its members.
- */
-
-#define Blt_PictureBits(p) ((p)->bits)
-#define Blt_PictureFlags(p) ((p)->flags)
-#define Blt_PictureHeight(p) ((p)->height)
-#define Blt_PicturePixel(p,x,y) ((p)->bits + ((p)->pixelsPerRow * (y)) + (x))
-#define Blt_PictureWidth(p) ((p)->width)
-#define Blt_PictureStride(p) ((p)->pixelsPerRow)
-#define Blt_PictureDelay(p) ((p)->delay)
-
-#define Blt_PictureIsDirty(p) ((p)->flags & BLT_PIC_DIRTY)
-#define Blt_PictureIsOpaque(p) \
- (((p)->flags & (BLT_PIC_BLEND | BLT_PIC_MASK)) == 0)
-#define Blt_PictureIsMasked(p) ((p)->flags & BLT_PIC_MASK)
-#define Blt_PictureIsBlended(p) ((p)->flags & BLT_PIC_BLEND)
-#define Blt_PictureIsColor(p) ((p)->flags & BLT_PIC_COLOR)
-#define Blt_PictureIsGreyscale(p) (!Blt_IsColorPicture(p))
-
-typedef enum PictureArithOps {
- PIC_ARITH_ADD,
- PIC_ARITH_AND,
- PIC_ARITH_NAND,
- PIC_ARITH_NOR,
- PIC_ARITH_OR,
- PIC_ARITH_RSUB,
- PIC_ARITH_SUB,
- PIC_ARITH_XOR,
- PIC_ARITH_MIN,
- PIC_ARITH_MAX,
-} Blt_PictureArithOps;
-
-typedef struct {
- unsigned int x, y;
-} PictureCoordinate;
-
-typedef enum BlendingModes {
- BLT_BLEND_NORMAL, /* C = F */
- BLT_BLEND_MULTIPLY, /* C = F * B */
- BLT_BLEND_SCREEN, /* C = 1 - (1 - F * B */
- BLT_BLEND_DARKEN, /* C = min(F,B) */
- BLT_BLEND_LIGHTEN, /* C = max(F,B) */
- BLT_BLEND_DIFFERENCE, /* C = |F - B| */
- BLT_BLEND_HARDLIGHT,
- BLT_BLEND_SOFTLIGHT,
- BLT_BLEND_COLORDODGE, /* C = B / (1 - F) */
- BLT_BLEND_COLORBURN, /* C = (1 - B) / F */
- BLT_BLEND_OVERLAY, /* C = B * (F + (2 * F) * (1 - B)) */
-} Blt_BlendingMode;
-
-BLT_EXTERN Blt_ResampleFilter bltBoxFilter; /* The ubiquitous box filter */
-BLT_EXTERN Blt_ResampleFilter bltMitchellFilter;
-BLT_EXTERN Blt_ResampleFilter bltBellFilter;
-BLT_EXTERN Blt_ResampleFilter bltTentFilter;
-
-BLT_EXTERN Blt_ResampleFilter bltTableFilter;
-
-typedef struct {
- int x, y, w, h;
-} PictRegion;
-
-#define Blt_AddPictures(dest, src) \
- Blt_ApplyPictureToPicture(dest, src, 0, 0, (src)->width, (src)->height, \
- 0, 0, PIC_ARITH_ADD)
-#define Blt_SubtractPictures(dest, src) \
- Blt_ApplyPictureToPicture(dest, src, 0, 0, (src)->width, (src)->height, \
- 0, 0, PIC_ARITH_SUB)
-#define Blt_AndPictures(dest, src) \
- Blt_ApplyPictureToPicture(dest, src, 0, 0, (src)->width, (src)->height, \
- 0, 0, PIC_ARITH_AND)
-#define Blt_OrPictures(dest, src) \
- Blt_ApplyPictureToPicture(dest, src, 0, 0, (src)->width, (src)->height, \
- 0, 0, PIC_ARITH_OR)
-#define Blt_XorPictures(dest, src) \
- Blt_ApplyPictureToPicture(dest, src, 0, 0, (src)->width, (src)->height, \
- 0, 0, PIC_ARITH_XOR)
-
-typedef unsigned int (*Blt_ColorLookupTable)[33][33];
-
-/* Prototypes of picture routines */
-
-BLT_EXTERN void Blt_ApplyPictureToPicture(Blt_Picture dest, Blt_Picture src,
- int x, int y, int w, int h, int dx, int dy, Blt_PictureArithOps op);
-
-BLT_EXTERN void Blt_ApplyScalarToPicture(Blt_Picture dest, Blt_Pixel *colorPtr,
- Blt_PictureArithOps op);
-
-BLT_EXTERN void Blt_ApplyPictureToPictureWithMask(Blt_Picture dest,
- Blt_Picture src, Blt_Picture mask, int x, int y, int w, int h,
- int dx, int dy, int invert, Blt_PictureArithOps op);
-
-BLT_EXTERN void Blt_ApplyScalarToPictureWithMask(Blt_Picture dest,
- Blt_Pixel *colorPtr, Blt_Picture mask, int invert,
- Blt_PictureArithOps op);
-
-BLT_EXTERN void Blt_MaskPicture(Blt_Picture dest, Blt_Picture mask,
- int x, int y, int w, int h, int dx, int dy, Blt_Pixel *colorPtr);
-
-BLT_EXTERN void Blt_BlankPicture(Blt_Picture picture, Blt_Pixel *colorPtr);
-BLT_EXTERN void Blt_BlankRegion(Blt_Picture picture, int x, int y, int w, int h,
- Blt_Pixel *colorPtr);
-
-BLT_EXTERN void Blt_BlurPicture(Blt_Picture dest, Blt_Picture src,
- unsigned int r);
-
-BLT_EXTERN void Blt_ResizePicture(Blt_Picture picture, int w, int h);
-BLT_EXTERN void Blt_AdjustPicture(Blt_Picture picture, int w, int h);
-
-BLT_EXTERN Blt_Picture Blt_ClonePicture(Blt_Picture picture);
-
-BLT_EXTERN void Blt_ConvolvePicture(Blt_Picture dest, Blt_Picture src,
- Blt_ConvolveFilter vFilter, Blt_ConvolveFilter hFilter);
-
-BLT_EXTERN Blt_Picture Blt_CreatePicture(int w, int h);
-
-BLT_EXTERN Blt_Picture Blt_DitherPicture(Blt_Picture picture,
- Blt_Pixel *palette);
-
-BLT_EXTERN void Blt_FlipPicture(Blt_Picture picture, int vertically);
-
-BLT_EXTERN void Blt_FreePicture(Blt_Picture picture);
-
-BLT_EXTERN void Blt_GradientPicture(Blt_Picture picture, Blt_Pixel *highPtr,
- Blt_Pixel *lowPtr, Blt_Gradient *gradientPtr);
-
-BLT_EXTERN Blt_Picture Blt_GreyscalePicture(Blt_Picture picture);
-
-BLT_EXTERN Blt_Picture Blt_QuantizePicture (Blt_Picture picture, int nColors);
-
-BLT_EXTERN void Blt_ResamplePicture (Blt_Picture dest, Blt_Picture src,
- Blt_ResampleFilter hFilter, Blt_ResampleFilter vFilter);
-
-BLT_EXTERN Blt_Picture Blt_ScalePicture(Blt_Picture picture, int x, int y,
- int w, int h, int dw, int dh);
-
-BLT_EXTERN Blt_Picture Blt_ScalePictureArea(Blt_Picture picture, int x, int y,
- int w, int h, int dw, int dh);
-
-BLT_EXTERN Blt_Picture Blt_RotatePicture (Blt_Picture picture, float angle);
-
-BLT_EXTERN void Blt_TilePicture(Blt_Picture dest, Blt_Picture src, int xOrigin,
- int yOrigin, int x, int y, int w, int h);
-
-BLT_EXTERN int Blt_PictureToPsData(Blt_Picture picture, int nComponents,
- Tcl_DString *resultPtr, const char *prefix);
-
-BLT_EXTERN void Blt_SelectPixels(Blt_Picture dest, Blt_Picture src,
- Blt_Pixel *lowerPtr, Blt_Pixel *upperPtr);
-
-BLT_EXTERN int Blt_GetPicture(Tcl_Interp *interp, const char *string,
- Blt_Picture *picturePtr);
-
-BLT_EXTERN int Blt_GetPictureFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- Blt_Picture *picturePtr);
-
-BLT_EXTERN int Blt_GetResampleFilterFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- Blt_ResampleFilter *filterPtr);
-
-BLT_EXTERN const char *Blt_NameOfResampleFilter(Blt_ResampleFilter filter);
-
-BLT_EXTERN void Blt_AssociateColors(Blt_Picture picture);
-
-BLT_EXTERN void Blt_UnassociateColors(Blt_Picture picture);
-
-BLT_EXTERN void Blt_MultiplyPixels(Blt_Picture picture, float value);
-
-BLT_EXTERN int Blt_GetBBoxFromObjv(Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv, PictRegion *regionPtr);
-
-BLT_EXTERN int Blt_AdjustRegionToPicture(Blt_Picture picture,
- PictRegion *regionPtr);
-
-BLT_EXTERN int Blt_GetPixelFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- Blt_Pixel *pixelPtr);
-
-BLT_EXTERN int Blt_GetPixel(Tcl_Interp *interp, const char *string,
- Blt_Pixel *pixelPtr);
-
-BLT_EXTERN const char *Blt_NameOfPixel(Blt_Pixel *pixelPtr);
-
-BLT_EXTERN Blt_Picture Blt_PictureFromPictImage(Blt_PictureImage image);
-
-BLT_EXTERN void Blt_NotifyImageChanged(Blt_PictureImage image);
-
-BLT_EXTERN int Blt_QueryColors(Blt_Picture picture, Blt_HashTable *tablePtr);
-
-BLT_EXTERN void Blt_ClassifyPicture(Blt_Picture picture);
-
-BLT_EXTERN void Blt_TentHorizontally(Blt_Picture dest, Blt_Picture src);
-BLT_EXTERN void Blt_TentVertically(Blt_Picture dest, Blt_Picture src);
-BLT_EXTERN void Blt_ZoomHorizontally(Blt_Picture dest, Blt_Picture src,
- Blt_ResampleFilter filter);
-BLT_EXTERN void Blt_ZoomVertically(Blt_Picture dest, Blt_Picture src,
- Blt_ResampleFilter filter);
-BLT_EXTERN void Blt_BlendPictures(Blt_Picture dest, Blt_Picture src,
- int sx, int sy, int w, int h, int dx, int dy);
-
-BLT_EXTERN void Blt_BlendPicturesByMode(Blt_Picture dest, Blt_Picture src,
- Blt_BlendingMode mode);
-
-BLT_EXTERN void Blt_SelectPixelsP(Blt_Picture dest, Blt_Picture src,
- Blt_Pixel *lowPtr , Blt_Pixel *highPtr);
-
-BLT_EXTERN void Blt_FadePicture(Blt_Picture dest, Blt_Picture src,
- int sx, int sy, int w, int h, int dx, int dy, int alpha);
-
-BLT_EXTERN void Blt_CopyPictureBits(Blt_Picture dest, Blt_Picture src,
- int sx, int sy, int w, int h, int dx, int dy);
-
-BLT_EXTERN void Blt_GammaCorrectPicture(Blt_Picture dest, Blt_Picture src,
- float gamma);
-
-BLT_EXTERN void Blt_SharpenPicture(Blt_Picture dest, Blt_Picture src);
-
-BLT_EXTERN void Blt_TexturePicture(Blt_Picture picture, Blt_Pixel *lowPtr,
- Blt_Pixel *highPtr, int type);
-
-BLT_EXTERN void Blt_ApplyColorToPicture(Blt_Picture pict, Blt_Pixel *colorPtr);
-
-BLT_EXTERN void Blt_SizeOfPicture(Blt_Picture pict, int *wPtr, int *hPtr);
-
-#ifdef _BLT_DBUFFER_H
-BLT_EXTERN Blt_DBuffer Blt_PictureToDBuffer(Blt_Picture picture, int nComp);
-#endif /* _BLT_DBUFFER_H */
-
-BLT_EXTERN int Blt_ResetPicture(Tcl_Interp *interp, const char *imageName,
- Blt_Picture picture);
-
-BLT_EXTERN void Blt_MapColors(Blt_Picture dest, Blt_Picture src,
- Blt_ColorLookupTable clut);
-
-BLT_EXTERN Blt_ColorLookupTable Blt_GetColorLookupTable(struct _Blt_Chain *chain,
- int nReqColors);
-
-#ifdef _TK
-BLT_EXTERN Blt_Picture Blt_PhotoToPicture (Tk_PhotoHandle photo);
-BLT_EXTERN Blt_Picture Blt_PhotoAreaToPicture (Tk_PhotoHandle photo,
- int x, int y, int w, int h);
-BLT_EXTERN Blt_Picture Blt_DrawableToPicture(Tk_Window tkwin,
- Drawable drawable, int x, int y, int w, int h, float gamma);
-BLT_EXTERN Blt_Picture Blt_WindowToPicture(Display *display,
- Drawable drawable, int x, int y, int w, int h, float gamma);
-BLT_EXTERN void Blt_PictureToPhoto(Blt_Picture picture, Tk_PhotoHandle photo);
-BLT_EXTERN int Blt_SnapPhoto(Tcl_Interp *interp, Tk_Window tkwin,
- Drawable drawable, int sx, int sy, int w, int h, int dw, int dh,
- const char *photoName, float gamma);
-BLT_EXTERN int Blt_SnapPicture(Tcl_Interp *interp, Tk_Window tkwin,
- Drawable drawable, int sx, int sy, int w, int h, int dw, int dh,
- const char *imageName, float gamma);
-BLT_EXTERN Blt_Picture Blt_BitmapToPicture(Display *display, Pixmap bitmap,
- int w, int h, Blt_Pixel *fg, Blt_Pixel *bg);
-BLT_EXTERN Blt_Pixel Blt_XColorToPixel(XColor *colorPtr);
-BLT_EXTERN int Blt_IsPicture(Tk_Image tkImage);
-BLT_EXTERN Blt_Picture Blt_GetPictureFromImage(Tcl_Interp *interp,
- Tk_Image tkImage, int *isPhotoPtr);
-BLT_EXTERN Blt_Picture Blt_GetPictureFromPictureImage(Tcl_Interp *interp,
- Tk_Image tkImage);
-BLT_EXTERN Blt_Picture Blt_GetPictureFromPhotoImage(Tcl_Interp *interp,
- Tk_Image tkImage);
-#endif /* _TK */
-
-#endif /*_BLT_PICTURE_H*/
diff --git a/blt3.0.1/src/bltPool.c b/blt3.0.1/src/bltPool.c
deleted file mode 100644
index 81ac0db..0000000
--- a/blt3.0.1/src/bltPool.c
+++ /dev/null
@@ -1,473 +0,0 @@
-
-/*
- * bltPool.c --
- *
- * Copyright 2001-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltPool.h"
-
-/*
- * Blt_Pool --
- *
- * Implements a pool memory allocator.
- *
- * + It's faster allocating memory since malloc/free are called
- * only a fraction of the normal times. Fixed size items can
- * be reused without deallocating/reallocating memory.
- * + You don't have the extra 8-16 byte overhead per malloc.
- * - Memory is freed only when the entire pool is destroyed.
- * - Memory is allocated in chunks. More memory is allocated
- * than used.
- * 0 Depending upon allocation/deallocation patterns, locality
- * may be improved or degraded.
- *
- * The pool is a chain of malloc'ed blocks.
- *
- * +---------+ +---------+ +---------+
- * NULL<-| nextPtr |<-| nextPtr |<-| nextPtr |<- headPtr
- * |---------| |---------| |---------|
- * | chunk1 | | chunk2 | | chunk3 |
- * +---------+ | | | |
- * +---------+ | |
- * | |
- * | |
- * +---------+
- *
- * Each chunk contains an integral number of fixed size items.
- * The number of items doubles until a maximum size is reached
- * (each subsequent new chunk will be the maximum). Chunks
- * are allocated only when needed (no more space is available
- * in the last chunk).
- *
- * The chain of blocks is only freed when the entire pool is
- * destroyed.
- *
- * A freelist of unused items also maintained. Each freed item
- * is prepended to a free list. Before allocating new chunks
- * the freelist is examined to see if any unused items exist.
- *
- * chunk1 chunk2 chunk3
- * +---------+ +---------+ +---------+
- * NULL<-| unused | | | | |
- * +----^----+ +---------+ +---------+
- * | unused |<-| unused |<-| unused |
- * +---------+ +---------+ +----^----+
- * | | | | | unused |
- * +---------+ | | +----^----+
- * | | | | |
- * +---------+ +----|----+
- * | usused |<- freePtr
- * +---------+
- */
-
-#define POOL_MAX_CHUNK_SIZE ((1<<16) - sizeof(PoolChain))
-
-#ifndef ALIGN
-#define ALIGN(a) \
- (((size_t)a + (sizeof(void *) - 1)) & (~(sizeof(void *) - 1)))
-#endif /* ALIGN */
-
-typedef struct _PoolChain {
- struct _PoolChain *nextPtr;
-} PoolChain;
-
-typedef struct {
- Blt_PoolAllocProc *allocProc;
- Blt_PoolFreeProc *freeProc;
-
- PoolChain *headPtr; /* Chain of malloc'ed chunks. */
- PoolChain *freePtr; /* List of deleted items. This is only used
- * for fixed size items. */
- size_t poolSize; /* Log2 of # of items in the current block. */
- size_t itemSize; /* Size of an item. */
- size_t bytesLeft; /* # of bytes left in the current chunk. */
- size_t waste;
-} Pool;
-
-static Blt_PoolAllocProc VariablePoolAllocItem;
-static Blt_PoolFreeProc VariablePoolFreeItem;
-static Blt_PoolAllocProc FixedPoolAllocItem;
-static Blt_PoolFreeProc FixedPoolFreeItem;
-static Blt_PoolAllocProc StringPoolAllocItem;
-static Blt_PoolFreeProc StringPoolFreeItem;
-
-/*
- *---------------------------------------------------------------------------
- *
- * VariablePoolAllocItem --
- *
- * Returns a new item. First check if there is any more space
- * left in the current chunk. If there isn't then next check
- * the free list for unused items. Finally allocate a new
- * chunk and return its first item.
- *
- * Results:
- * Returns a new (possible reused) item.
- *
- * Side Effects:
- * A new memory chunk may be allocated.
- *
- *---------------------------------------------------------------------------
- */
-static void *
-VariablePoolAllocItem(
- Blt_Pool pool,
- size_t size) /* Number of bytes to allocate. */
-{
- Pool *poolPtr = (Pool *)pool;
- PoolChain *chainPtr;
- void *memory;
-
- size = ALIGN(size);
- if (size >= POOL_MAX_CHUNK_SIZE) {
- /*
- * Handle oversized requests by allocating a chunk to hold the
- * single item and immediately placing it into the in-use list.
- */
- chainPtr = Blt_AssertMalloc(sizeof(PoolChain) + size);
- if (poolPtr->headPtr == NULL) {
- poolPtr->headPtr = chainPtr;
- } else {
- chainPtr->nextPtr = poolPtr->headPtr->nextPtr;
- poolPtr->headPtr->nextPtr = chainPtr;
- }
- memory = (void *)chainPtr;
- } else {
- if (poolPtr->bytesLeft >= size) {
- poolPtr->bytesLeft -= size;
- memory = (char *)(poolPtr->headPtr + 1) + poolPtr->bytesLeft;
- } else {
- poolPtr->waste += poolPtr->bytesLeft;
- /* Create a new block of items and prepend it to the in-use list */
- poolPtr->bytesLeft = POOL_MAX_CHUNK_SIZE;
- /* Allocate the requested chunk size, plus the header */
- chainPtr = Blt_AssertMalloc(sizeof(PoolChain) + poolPtr->bytesLeft);
- chainPtr->nextPtr = poolPtr->headPtr;
- poolPtr->headPtr = chainPtr;
- /* Peel off a new item. */
- poolPtr->bytesLeft -= size;
- memory = (char *)(chainPtr + 1) + poolPtr->bytesLeft;
- }
- }
- return memory;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * VariablePoolFreeItem --
- *
- * Placeholder for freeProc routine. The pool memory is
- * not reclaimed or freed until the entire pool is released.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-VariablePoolFreeItem(Blt_Pool pool, void *item)
-{
- /* Does nothing */
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StringPoolAllocItem --
- *
- * Returns a new item. First check if there is any more space
- * left in the current chunk. If there isn't then next check
- * the free list for unused items. Finally allocate a new
- * chunk and return its first item.
- *
- * Results:
- * Returns a new (possible reused) item.
- *
- * Side Effects:
- * A new memory chunk may be allocated.
- *
- *---------------------------------------------------------------------------
- */
-static void *
-StringPoolAllocItem(Blt_Pool pool, size_t size)
-{
- Pool *poolPtr = (Pool *)pool;
- PoolChain *chainPtr;
- void *memory;
-
- if (size >= POOL_MAX_CHUNK_SIZE) {
- /*
- * Handle oversized requests by allocating a chunk to hold the
- * single item and immediately placing it into the in-use list.
- */
- chainPtr = Blt_AssertMalloc(sizeof(PoolChain) + size);
- if (poolPtr->headPtr == NULL) {
- poolPtr->headPtr = chainPtr;
- } else {
- chainPtr->nextPtr = poolPtr->headPtr->nextPtr;
- poolPtr->headPtr->nextPtr = chainPtr;
- }
- memory = (void *)chainPtr;
- } else {
- if (poolPtr->bytesLeft >= size) {
- poolPtr->bytesLeft -= size;
- memory = (char *)(poolPtr->headPtr + 1) + poolPtr->bytesLeft;
- } else {
- poolPtr->waste += poolPtr->bytesLeft;
- /* Create a new block of items and prepend it to the
- * in-use list */
- poolPtr->bytesLeft = POOL_MAX_CHUNK_SIZE;
- /* Allocate the requested chunk size, plus the header */
- chainPtr = Blt_AssertMalloc(sizeof(PoolChain) + poolPtr->bytesLeft);
- chainPtr->nextPtr = poolPtr->headPtr;
- poolPtr->headPtr = chainPtr;
- /* Peel off a new item. */
- poolPtr->bytesLeft -= size;
- memory = (char *)(chainPtr + 1) + poolPtr->bytesLeft;
- }
- }
- return memory;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StringPoolFreeItem --
- *
- * Placeholder for freeProc routine. String pool memory is
- * not reclaimed or freed until the entire pool is released.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-StringPoolFreeItem(Blt_Pool pool, void *item)
-{
- /* Does nothing */
-}
-
-/*
- * The fixed size pool is a chain of malloc'ed blocks.
- *
- * +---------+ +---------+ +---------+
- * NULL<-| nextPtr |<-| nextPtr |<-| nextPtr |<- headPtr
- * |---------| |---------| |---------|
- * | chunk1 | | chunk2 | | chunk3 |
- * +---------+ | | | |
- * +---------+ | |
- * | |
- * | |
- * +---------+
- *
- * Each chunk contains an integral number of fixed size items.
- * The number of items doubles until a maximum size is reached
- * (each subsequent new chunk will be the maximum). Chunks
- * are allocated only when needed (no more space is available
- * in the last chunk).
- *
- * The chain of blocks is only freed when the entire pool is
- * destroyed.
- *
- * A freelist of unused items also maintained. Each freed item
- * is prepended to a free list. Before allocating new chunks
- * the freelist is examined to see if an unused items exist.
- *
- * chunk1 chunk2 chunk3
- * +---------+ +---------+ +---------+
- * NULL<-| unused | | | | |
- * +----^----+ +---------+ +---------+
- * | unused |<-| unused |<-| unused |
- * +---------+ +---------+ +----^----+
- * | | | | | unused |
- * +---------+ | | +----^----+
- * | | | | |
- * +---------+ +----|----+
- * | usused |<- freePtr
- * +---------+
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * FixedPoolFreeItem --
- *
- * Returns a new item. First check if there is any more space
- * left in the current chunk. If there isn't then next check
- * the free list for unused items. Finally allocate a new
- * chunk and return its first item.
- *
- * Results:
- * Returns a new (possible reused) item.
- *
- * Side Effects:
- * A new memory chunk may be allocated.
- *
- *---------------------------------------------------------------------------
- */
-static void *
-FixedPoolAllocItem(Blt_Pool pool, size_t size)
-{
- Pool *poolPtr = (Pool *)pool;
- PoolChain *chainPtr;
- void *newPtr;
-
- size = ALIGN(size);
- if (poolPtr->itemSize == 0) {
- poolPtr->itemSize = size;
- }
- assert(size == poolPtr->itemSize);
-
- if (poolPtr->bytesLeft > 0) {
- poolPtr->bytesLeft -= poolPtr->itemSize;
- newPtr = (char *)(poolPtr->headPtr + 1) + poolPtr->bytesLeft;
- } else if (poolPtr->freePtr != NULL) { /* Reuse from the free list. */
- /* Reuse items on the free list */
- chainPtr = poolPtr->freePtr;
- poolPtr->freePtr = chainPtr->nextPtr;
- newPtr = (void *)chainPtr;
- } else { /* Allocate another block. */
-
- /* Create a new block of items and prepend it to the in-use list */
- poolPtr->bytesLeft = poolPtr->itemSize * (1 << poolPtr->poolSize);
- if (poolPtr->bytesLeft < POOL_MAX_CHUNK_SIZE) {
- poolPtr->poolSize++; /* Keep doubling the size of the new
- * chunk up to a maximum size. */
- }
- /* Allocate the requested chunk size, plus the header */
- chainPtr = Blt_AssertMalloc(sizeof(PoolChain) + poolPtr->bytesLeft);
- chainPtr->nextPtr = poolPtr->headPtr;
- poolPtr->headPtr = chainPtr;
-
- /* Peel off a new item. */
- poolPtr->bytesLeft -= poolPtr->itemSize;
- newPtr = (char *)(poolPtr->headPtr + 1) + poolPtr->bytesLeft;
- }
- return newPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FixedPoolFreeItem --
- *
- * Frees an item. The actual memory is not freed. The item
- * instead is prepended to a freelist where it may be reclaimed
- * and used again.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Item is placed on the pool's free list.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FixedPoolFreeItem(Blt_Pool pool, void *item)
-{
- Pool *poolPtr = (Pool *)pool;
- PoolChain *chainPtr = (PoolChain *)item;
-
- /* Prepend the newly deallocated item to the free list. */
- chainPtr->nextPtr = poolPtr->freePtr;
- poolPtr->freePtr = chainPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PoolCreate --
- *
- * Creates a new memory pool for fixed-size/variable-size/string
- * items.
- *
- * Results:
- * Returns a pointer to the newly allocated pool.
- *
- *---------------------------------------------------------------------------
- */
-
-Blt_Pool
-Blt_PoolCreate(int type)
-{
- Pool *poolPtr;
-
- poolPtr = Blt_AssertMalloc(sizeof(Pool));
- switch (type) {
- case BLT_VARIABLE_SIZE_ITEMS:
- poolPtr->allocProc = VariablePoolAllocItem;
- poolPtr->freeProc = VariablePoolFreeItem;
- break;
- case BLT_FIXED_SIZE_ITEMS:
- poolPtr->allocProc = FixedPoolAllocItem;
- poolPtr->freeProc = FixedPoolFreeItem;
- break;
- case BLT_STRING_ITEMS:
- poolPtr->allocProc = StringPoolAllocItem;
- poolPtr->freeProc = StringPoolFreeItem;
- break;
- }
- poolPtr->headPtr = poolPtr->freePtr = NULL;
- poolPtr->waste = poolPtr->bytesLeft = 0;
- poolPtr->poolSize = poolPtr->itemSize = 0;
- return (Blt_Pool)poolPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PoolDestroy --
- *
- * Destroys the given memory pool. The chain of allocated blocks
- * are freed. The is the only time that memory is actually freed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * All memory used by the pool is freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_PoolDestroy(Blt_Pool pool)
-{
- Pool *poolPtr = (Pool *)pool;
- PoolChain *chainPtr, *nextPtr;
-
- for (chainPtr = poolPtr->headPtr; chainPtr != NULL; chainPtr = nextPtr) {
- nextPtr = chainPtr->nextPtr;
- Blt_Free(chainPtr);
- }
- Blt_Free(poolPtr);
-}
-
diff --git a/blt3.0.1/src/bltPool.h b/blt3.0.1/src/bltPool.h
deleted file mode 100644
index a4fc329..0000000
--- a/blt3.0.1/src/bltPool.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef BLT_POOL_H
-#define BLT_POOL_H
-
-#define BLT_STRING_ITEMS 0
-#define BLT_FIXED_SIZE_ITEMS 1
-#define BLT_VARIABLE_SIZE_ITEMS 2
-
-typedef struct _Blt_Pool *Blt_Pool;
-typedef void *(Blt_PoolAllocProc)(Blt_Pool pool, size_t size);
-typedef void (Blt_PoolFreeProc)(Blt_Pool pool, void *item);
-
-struct _Blt_Pool {
- Blt_PoolAllocProc *allocProc;
- Blt_PoolFreeProc *freeProc;
-};
-
-BLT_EXTERN Blt_Pool Blt_PoolCreate(int type);
-BLT_EXTERN void Blt_PoolDestroy(Blt_Pool pool);
-
-#define Blt_PoolAllocItem(pool, n) (*((pool)->allocProc))(pool, n)
-#define Blt_PoolFreeItem(pool, item) (*((pool)->freeProc))(pool, item)
-
-#endif /* BLT_POOL_H */
diff --git a/blt3.0.1/src/bltPs.c b/blt3.0.1/src/bltPs.c
deleted file mode 100644
index 44cfdb8..0000000
--- a/blt3.0.1/src/bltPs.c
+++ /dev/null
@@ -1,1697 +0,0 @@
-
-/*
- * bltPs.c --
- *
- * This module implements general PostScript conversion routines.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include "bltInt.h"
-#include <stdarg.h>
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-#include "tkIntBorder.h"
-#include "bltDBuffer.h"
-#include "bltPicture.h"
-#include "bltPsInt.h"
-#include "tkDisplay.h"
-#include "tkFont.h"
-
-#define PS_MAXPATH 1500 /* Maximum number of components in a
- * PostScript (level 1) path. */
-
-#define PICA_MM 2.83464566929
-#define PICA_INCH 72.0
-#define PICA_CM 28.3464566929
-
-static Tcl_Interp *psInterp = NULL;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ps_GetPica --
- *
- * Given a string, returns the number of pica corresponding to that
- * string.
- *
- * Results:
- * The return value is a standard TCL return result. If TCL_OK is
- * returned, then everything went well and the pixel distance is stored
- * at *doublePtr; otherwise TCL_ERROR is returned and an error message is
- * left in interp->result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Ps_GetPicaFromObj(
- Tcl_Interp *interp, /* Use this for error reporting. */
- Tcl_Obj *objPtr, /* String describing a number of
- * pixels. */
- int *picaPtr) /* Place to store converted result. */
-{
- char *p;
- double pica;
- const char *string;
-
- string = Tcl_GetString(objPtr);
- pica = strtod((char *)string, &p);
- if (p == string) {
- goto error;
- }
- if (pica < 0.0) {
- goto error;
- }
- while ((*p != '\0') && isspace(UCHAR(*p))) {
- p++;
- }
- switch (*p) {
- case '\0': break;
- case 'c': pica *= PICA_CM; p++; break;
- case 'i': pica *= PICA_INCH; p++; break;
- case 'm': pica *= PICA_MM; p++; break;
- case 'p': p++; break;
- default: goto error;
- }
- while ((*p != '\0') && isspace(UCHAR(*p))) {
- p++;
- }
- if (*p == '\0') {
- *picaPtr = ROUND(pica);
- return TCL_OK;
- }
- error:
- Tcl_AppendResult(interp, "bad screen distance \"", string, "\"",
- (char *) NULL);
- return TCL_ERROR;
-}
-
-int
-Blt_Ps_GetPadFromObj(
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tcl_Obj *objPtr, /* Pixel value string */
- Blt_Pad *padPtr)
-{
- int side1, side2;
- int objc;
- Tcl_Obj **objv;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((objc < 1) || (objc > 2)) {
- Tcl_AppendResult(interp, "wrong # elements in padding list",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Blt_Ps_GetPicaFromObj(interp, objv[0], &side1) != TCL_OK) {
- return TCL_ERROR;
- }
- side2 = side1;
- if ((objc > 1) &&
- (Blt_Ps_GetPicaFromObj(interp, objv[1], &side2) != TCL_OK)) {
- return TCL_ERROR;
- }
- /* Don't update the pad structure until we know both values are okay. */
- padPtr->side1 = side1;
- padPtr->side2 = side2;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ps_ComputeBoundingBox --
- *
- * Computes the bounding box for the PostScript plot. First get the size
- * of the plot (by default, it's the size of graph's X window). If the
- * plot plus the page border is bigger than the designated paper size, or
- * if the "-maxpect" option is turned on, scale the plot to the page.
- *
- * Note: All coordinates/sizes are in screen coordinates, not PostScript
- * coordinates. This includes the computed bounding box and paper
- * size. They will be scaled to printer points later.
- *
- * Results:
- * Returns the height of the paper in screen coordinates.
- *
- * Side Effects:
- * The graph dimensions (width and height) are changed to the requested
- * PostScript plot size.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Ps_ComputeBoundingBox(PageSetup *setupPtr, int width, int height)
-{
- int paperWidth, paperHeight;
- int x, y, hSize, vSize, hBorder, vBorder;
- float hScale, vScale, scale;
-
- x = setupPtr->padLeft;
- y = setupPtr->padTop;
-
- hBorder = PADDING(setupPtr->xPad);
- vBorder = PADDING(setupPtr->yPad);
-
- if (setupPtr->flags & PS_LANDSCAPE) {
- hSize = height;
- vSize = width;
- } else {
- hSize = width;
- vSize = height;
- }
- /*
- * If the paper size wasn't specified, set it to the graph size plus the
- * paper border.
- */
- paperWidth = (setupPtr->reqPaperWidth > 0) ? setupPtr->reqPaperWidth :
- hSize + hBorder;
- paperHeight = (setupPtr->reqPaperHeight > 0) ? setupPtr->reqPaperHeight :
- vSize + vBorder;
-
- /*
- * Scale the plot size (the graph itself doesn't change size) if it's
- * bigger than the paper or if -maxpect was set.
- */
- hScale = vScale = 1.0f;
- if ((setupPtr->flags & PS_MAXPECT) || ((hSize + hBorder) > paperWidth)) {
- hScale = (float)(paperWidth - hBorder) / (float)hSize;
- }
- if ((setupPtr->flags & PS_MAXPECT) || ((vSize + vBorder) > paperHeight)) {
- vScale = (float)(paperHeight - vBorder) / (float)vSize;
- }
- scale = MIN(hScale, vScale);
- if (scale != 1.0f) {
- hSize = (int)((hSize * scale) + 0.5f);
- vSize = (int)((vSize * scale) + 0.5f);
- }
- setupPtr->scale = scale;
- if (setupPtr->flags & PS_CENTER) {
- if (paperWidth > hSize) {
- x = (paperWidth - hSize) / 2;
- }
- if (paperHeight > vSize) {
- y = (paperHeight - vSize) / 2;
- }
- }
- setupPtr->left = x;
- setupPtr->bottom = y;
- setupPtr->right = x + hSize - 1;
- setupPtr->top = y + vSize - 1;
- setupPtr->paperHeight = paperHeight;
- setupPtr->paperWidth = paperWidth;
- return paperHeight;
-}
-
-PostScript *
-Blt_Ps_Create(Tcl_Interp *interp, PageSetup *setupPtr)
-{
- PostScript *psPtr;
-
- psPtr = Blt_AssertMalloc(sizeof(PostScript));
- psPtr->setupPtr = setupPtr;
- psPtr->interp = interp;
- Tcl_DStringInit(&psPtr->dString);
- return psPtr;
-}
-
-void
-Blt_Ps_SetPrinting(PostScript *psPtr, int state)
-{
- psInterp = ((state) && (psPtr != NULL)) ? psPtr->interp : NULL;
-}
-
-int
-Blt_Ps_IsPrinting(void)
-{
- return (psInterp != NULL);
-}
-
-void
-Blt_Ps_Free(PostScript *psPtr)
-{
- Tcl_DStringFree(&psPtr->dString);
- Blt_Free(psPtr);
-}
-
-const char *
-Blt_Ps_GetValue(PostScript *psPtr, int *lengthPtr)
-{
- *lengthPtr = strlen(Tcl_DStringValue(&psPtr->dString));
- return Tcl_DStringValue(&psPtr->dString);
-}
-
-void
-Blt_Ps_SetInterp(PostScript *psPtr, Tcl_Interp *interp)
-{
- Tcl_DStringResult(interp, &psPtr->dString);
-}
-
-char *
-Blt_Ps_GetScratchBuffer(PostScript *psPtr)
-{
- return psPtr->scratchArr;
-}
-
-Tcl_Interp *
-Blt_Ps_GetInterp(PostScript *psPtr)
-{
- return psPtr->interp;
-}
-
-Tcl_DString *
-Blt_Ps_GetDString(PostScript *psPtr)
-{
- return &psPtr->dString;
-}
-
-int
-Blt_Ps_SaveFile(Tcl_Interp *interp, PostScript *psPtr, const char *fileName)
-{
- Tcl_Channel channel;
- int nWritten, nBytes;
- char *bytes;
-
- channel = Tcl_OpenFileChannel(interp, fileName, "w", 0660);
- if (channel == NULL) {
- return TCL_ERROR;
- }
- nBytes = Tcl_DStringLength(&psPtr->dString);
- bytes = Tcl_DStringValue(&psPtr->dString);
- nWritten = Tcl_Write(channel, bytes, nBytes);
- Tcl_Close(interp, channel);
- if (nWritten != nBytes) {
- Tcl_AppendResult(interp, "short file \"", fileName, (char *)NULL);
- Tcl_AppendResult(interp, "\" : wrote ", Blt_Itoa(nWritten), " of ",
- (char *)NULL);
- Tcl_AppendResult(interp, Blt_Itoa(nBytes), " bytes.", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-void
-Blt_Ps_VarAppend
-TCL_VARARGS_DEF(PostScript *, arg1)
-{
- va_list argList;
- PostScript *psPtr;
- const char *string;
-
- psPtr = TCL_VARARGS_START(PostScript, arg1, argList);
- for (;;) {
- string = va_arg(argList, char *);
- if (string == NULL) {
- break;
- }
- Tcl_DStringAppend(&psPtr->dString, string, -1);
- }
-}
-
-void
-Blt_Ps_AppendBytes(PostScript *psPtr, const char *bytes, int length)
-{
- Tcl_DStringAppend(&psPtr->dString, bytes, length);
-}
-
-void
-Blt_Ps_Append(PostScript *psPtr, const char *string)
-{
- Tcl_DStringAppend(&psPtr->dString, string, -1);
-}
-
-void
-Blt_Ps_Format
-TCL_VARARGS_DEF(PostScript *, arg1)
-{
- va_list argList;
- PostScript *psPtr;
- char *fmt;
-
- psPtr = TCL_VARARGS_START(PostScript, arg1, argList);
- fmt = va_arg(argList, char *);
- vsnprintf(psPtr->scratchArr, POSTSCRIPT_BUFSIZ, fmt, argList);
- va_end(argList);
- Tcl_DStringAppend(&psPtr->dString, psPtr->scratchArr, -1);
-}
-
-int
-Blt_Ps_IncludeFile(Tcl_Interp *interp, Blt_Ps ps, const char *fileName)
-{
- Tcl_Channel channel;
- Tcl_DString dString;
- char *buf;
- char *libDir;
- int nBytes;
-
- buf = Blt_Ps_GetScratchBuffer(ps);
-
- /*
- * Read in a standard prolog file from file and append it to the
- * PostScript output stored in the Tcl_DString in psPtr.
- */
-
- libDir = (char *)Tcl_GetVar(interp, "blt_library", TCL_GLOBAL_ONLY);
- if (libDir == NULL) {
- Tcl_AppendResult(interp, "couldn't find BLT script library:",
- "global variable \"blt_library\" doesn't exist", (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_DStringInit(&dString);
- Tcl_DStringAppend(&dString, libDir, -1);
- Tcl_DStringAppend(&dString, "/", -1);
- Tcl_DStringAppend(&dString, fileName, -1);
- fileName = Tcl_DStringValue(&dString);
- Blt_Ps_VarAppend(ps, "\n% including file \"", fileName, "\"\n\n",
- (char *)NULL);
- channel = Tcl_OpenFileChannel(interp, fileName, "r", 0);
- if (channel == NULL) {
- Tcl_AppendResult(interp, "couldn't open prologue file \"", fileName,
- "\": ", Tcl_PosixError(interp), (char *)NULL);
- return TCL_ERROR;
- }
- for(;;) {
- nBytes = Tcl_Read(channel, buf, POSTSCRIPT_BUFSIZ);
- if (nBytes < 0) {
- Tcl_AppendResult(interp, "error reading prologue file \"",
- fileName, "\": ", Tcl_PosixError(interp),
- (char *)NULL);
- Tcl_Close(interp, channel);
- Tcl_DStringFree(&dString);
- return TCL_ERROR;
- }
- if (nBytes == 0) {
- break;
- }
- buf[nBytes] = '\0';
- Blt_Ps_Append(ps, buf);
- }
- Tcl_DStringFree(&dString);
- Tcl_Close(interp, channel);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XColorToPostScript --
- *
- * Convert the a XColor (from its RGB values) to a PostScript command.
- * If a Tk color map variable exists, it will be consulted for a
- * PostScript translation based upon the color name.
- *
- * Maps an X color intensity (0 to 2^16-1) to a floating point value
- * [0..1]. Many versions of Tk don't properly handle the the lower 8
- * bits of the color intensity, so we can only consider the upper 8 bits.
- *
- * Results:
- * The string representing the color mode is returned.
- *
- *---------------------------------------------------------------------------
- */
-static void
-XColorToPostScript(Blt_Ps ps, XColor *colorPtr)
-{
- /*
- * Shift off the lower byte before dividing because some versions of Tk
- * don't fill the lower byte correctly.
- */
- Blt_Ps_Format(ps, "%g %g %g",
- ((double)(colorPtr->red >> 8) / 255.0),
- ((double)(colorPtr->green >> 8) / 255.0),
- ((double)(colorPtr->blue >> 8) / 255.0));
-}
-
-void
-Blt_Ps_XSetBackground(PostScript *psPtr, XColor *colorPtr)
-{
- /* If the color name exists in TCL array variable, use that translation */
- if ((psPtr->setupPtr != NULL) && (psPtr->setupPtr->colorVarName != NULL)) {
- const char *psColor;
-
- psColor = Tcl_GetVar2(psPtr->interp, psPtr->setupPtr->colorVarName,
- Tk_NameOfColor(colorPtr), 0);
- if (psColor != NULL) {
- Blt_Ps_VarAppend(psPtr, " ", psColor, "\n", (char *)NULL);
- return;
- }
- }
- XColorToPostScript(psPtr, colorPtr);
- Blt_Ps_Append(psPtr, " setrgbcolor\n");
- if (psPtr->setupPtr->flags & PS_GREYSCALE) {
- Blt_Ps_Append(psPtr, " currentgray setgray\n");
- }
-}
-
-void
-Blt_Ps_XSetForeground(PostScript *psPtr, XColor *colorPtr)
-{
- /* If the color name exists in TCL array variable, use that translation */
- if ((psPtr->setupPtr != NULL) && (psPtr->setupPtr->colorVarName != NULL)) {
- const char *psColor;
-
- psColor = Tcl_GetVar2(psPtr->interp, psPtr->setupPtr->colorVarName,
- Tk_NameOfColor(colorPtr), 0);
- if (psColor != NULL) {
- Blt_Ps_VarAppend(psPtr, " ", psColor, "\n", (char *)NULL);
- return;
- }
- }
- XColorToPostScript(psPtr, colorPtr);
- Blt_Ps_Append(psPtr, " setrgbcolor\n");
- if (psPtr->setupPtr->flags & PS_GREYSCALE) {
- Blt_Ps_Append(psPtr, " currentgray setgray\n");
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReverseBits --
- *
- * Convert a byte from a X image into PostScript image order. This
- * requires not only the nybbles to be reversed but also their bit
- * values.
- *
- * Results:
- * The converted byte is returned.
- *
- *---------------------------------------------------------------------------
- */
-INLINE static unsigned char
-ReverseBits(unsigned char byte)
-{
- byte = ((byte >> 1) & 0x55) | ((byte << 1) & 0xaa);
- byte = ((byte >> 2) & 0x33) | ((byte << 2) & 0xcc);
- byte = ((byte >> 4) & 0x0f) | ((byte << 4) & 0xf0);
- return byte;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ByteToHex --
- *
- * Convert a byte to its ASCII hexidecimal equivalent.
- *
- * Results:
- * The converted 2 ASCII character string is returned.
- *
- *---------------------------------------------------------------------------
- */
-INLINE static void
-ByteToHex(unsigned char byte, char *string)
-{
- static char hexDigits[] = "0123456789ABCDEF";
-
- string[0] = hexDigits[byte >> 4];
- string[1] = hexDigits[byte & 0x0F];
-}
-
-#ifdef WIN32
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ps_XSetBitmapData --
- *
- * Output a PostScript image string of the given bitmap image. It is
- * assumed the image is one bit deep and a zero value indicates an
- * off-pixel. To convert to PostScript, the bits need to be reversed
- * from the X11 image order.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The PostScript image string is appended.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Ps_XSetBitmapData(
- PostScript *psPtr,
- Display *display,
- Pixmap bitmap,
- int width, int height)
-{
- unsigned char byte;
- int x, y, bitPos;
- unsigned long pixel;
- int byteCount;
- char string[10];
- unsigned char *srcBits, *srcPtr;
- int bytesPerRow;
-
- srcBits = Blt_GetBitmapData(display, bitmap, width, height, &bytesPerRow);
- if (srcBits == NULL) {
- OutputDebugString("Can't get bitmap data");
- return;
- }
- Blt_Ps_Append(psPtr, "\t<");
- byteCount = bitPos = 0; /* Suppress compiler warning */
- for (y = height - 1; y >= 0; y--) {
- srcPtr = srcBits + (bytesPerRow * y);
- byte = 0;
- for (x = 0; x < width; x++) {
- bitPos = x % 8;
- pixel = (*srcPtr & (0x80 >> bitPos));
- if (pixel) {
- byte |= (unsigned char)(1 << bitPos);
- }
- if (bitPos == 7) {
- byte = ReverseBits(byte);
- ByteToHex(byte, string);
- string[2] = '\0';
- byteCount++;
- srcPtr++;
- byte = 0;
- if (byteCount >= 30) {
- string[2] = '\n';
- string[3] = '\t';
- string[4] = '\0';
- byteCount = 0;
- }
- Blt_Ps_Append(psPtr, string);
- }
- } /* x */
- if (bitPos != 7) {
- byte = ReverseBits(byte);
- ByteToHex(byte, string);
- string[2] = '\0';
- Blt_Ps_Append(psPtr, string);
- byteCount++;
- }
- } /* y */
- Blt_Free(srcBits);
- Blt_Ps_Append(psPtr, ">\n");
-}
-
-#else
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ps_XSetBitmapData --
- *
- * Output a PostScript image string of the given bitmap image. It is
- * assumed the image is one bit deep and a zero value indicates an
- * off-pixel. To convert to PostScript, the bits need to be reversed
- * from the X11 image order.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The PostScript image string is appended to interp->result.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Ps_XSetBitmapData(Blt_Ps ps, Display *display, Pixmap bitmap, int w, int h)
-{
- XImage *imagePtr;
- int byteCount;
- int y, bitPos;
-
- imagePtr = XGetImage(display, bitmap, 0, 0, w, h, 1, ZPixmap);
- Blt_Ps_Append(ps, "\t<");
- byteCount = bitPos = 0; /* Suppress compiler warning */
- for (y = 0; y < h; y++) {
- unsigned char byte;
- char string[10];
- int x;
-
- byte = 0;
- for (x = 0; x < w; x++) {
- unsigned long pixel;
-
- pixel = XGetPixel(imagePtr, x, y);
- bitPos = x % 8;
- byte |= (unsigned char)(pixel << bitPos);
- if (bitPos == 7) {
- byte = ReverseBits(byte);
- ByteToHex(byte, string);
- string[2] = '\0';
- byteCount++;
- byte = 0;
- if (byteCount >= 30) {
- string[2] = '\n';
- string[3] = '\t';
- string[4] = '\0';
- byteCount = 0;
- }
- Blt_Ps_Append(ps, string);
- }
- } /* x */
- if (bitPos != 7) {
- byte = ReverseBits(byte);
- ByteToHex(byte, string);
- string[2] = '\0';
- Blt_Ps_Append(ps, string);
- byteCount++;
- }
- } /* y */
- Blt_Ps_Append(ps, ">\n");
- XDestroyImage(imagePtr);
-}
-
-#endif /* WIN32 */
-
-typedef struct {
- const char *alias;
- const char *fontName;
-} FamilyMap;
-
-static FamilyMap familyMap[] =
-{
- { "Arial", "Helvetica" },
- { "AvantGarde", "AvantGarde" },
- { "Bookman", "Bookman" },
- { "Courier New", "Courier" },
- { "Courier", "Courier" },
- { "Geneva", "Helvetica" },
- { "Helvetica", "Helvetica" },
- { "Mathematica1", "Helvetica" },
- { "Monaco", "Courier" },
- { "New Century Schoolbook", "NewCenturySchlbk" },
- { "New York", "Times" },
- { "Nimbus Roman No9 L" "Times" },
- { "Nimbus Sans L Condensed","Helvetica" },
- { "Nimbus Sans L", "Helvetica" },
- { "Palatino", "Palatino" },
- { "Standard Symbols L", "Symbol" },
- { "Swiss 721", "Helvetica" },
- { "Symbol", "Symbol" },
- { "Times New Roman", "Times" },
- { "Times Roman", "Times" },
- { "Times", "Times" },
- { "ZapfChancery", "ZapfChancery" },
- { "ZapfDingbats", "ZapfDingbats" }
-};
-
-static int nFamilyNames = (sizeof(familyMap) / sizeof(FamilyMap));
-
-static const char *
-FamilyToPsFamily(const char *family)
-{
- FamilyMap *fp, *fend;
-
- if (strncasecmp(family, "itc ", 4) == 0) {
- family += 4;
- }
- for (fp = familyMap, fend = fp + nFamilyNames; fp < fend; fp++) {
- if (strcasecmp(fp->alias, family) == 0) {
- return fp->fontName;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- * Routines to convert X drawing functions to PostScript commands.
- *---------------------------------------------------------------------------
- */
-void
-Blt_Ps_SetClearBackground(Blt_Ps ps)
-{
- Blt_Ps_Append(ps, "1 1 1 setrgbcolor\n");
-}
-
-void
-Blt_Ps_XSetCapStyle(Blt_Ps ps, int capStyle)
-{
- /*
- * X11:not last = 0, butt = 1, round = 2, projecting = 3
- * PS: butt = 0, round = 1, projecting = 2
- */
- if (capStyle > 0) {
- capStyle--;
- }
- Blt_Ps_Format(ps, "%d setlinecap\n", capStyle);
-}
-
-void
-Blt_Ps_XSetJoinStyle(Blt_Ps ps, int joinStyle)
-{
- /*
- * miter = 0, round = 1, bevel = 2
- */
- Blt_Ps_Format(ps, "%d setlinejoin\n", joinStyle);
-}
-
-void
-Blt_Ps_XSetLineWidth(Blt_Ps ps, int lineWidth)
-{
- if (lineWidth < 1) {
- lineWidth = 1;
- }
- Blt_Ps_Format(ps, "%d setlinewidth\n", lineWidth);
-}
-
-void
-Blt_Ps_XSetDashes(Blt_Ps ps, Blt_Dashes *dashesPtr)
-{
-
- Blt_Ps_Append(ps, "[ ");
- if (dashesPtr != NULL) {
- unsigned char *vp;
-
- for (vp = dashesPtr->values; *vp != 0; vp++) {
- Blt_Ps_Format(ps, " %d", *vp);
- }
- }
- Blt_Ps_Append(ps, "] 0 setdash\n");
-}
-
-void
-Blt_Ps_XSetLineAttributes(
- Blt_Ps ps,
- XColor *colorPtr,
- int lineWidth,
- Blt_Dashes *dashesPtr,
- int capStyle,
- int joinStyle)
-{
- Blt_Ps_XSetJoinStyle(ps, joinStyle);
- Blt_Ps_XSetCapStyle(ps, capStyle);
- Blt_Ps_XSetForeground(ps, colorPtr);
- Blt_Ps_XSetLineWidth(ps, lineWidth);
- Blt_Ps_XSetDashes(ps, dashesPtr);
- Blt_Ps_Append(ps, "/DashesProc {} def\n");
-}
-
-void
-Blt_Ps_Rectangle(Blt_Ps ps, int x, int y, int width, int height)
-{
- Blt_Ps_Append(ps, "newpath\n");
- Blt_Ps_Format(ps, " %d %d moveto\n", x, y);
- Blt_Ps_Format(ps, " %d %d rlineto\n", width, 0);
- Blt_Ps_Format(ps, " %d %d rlineto\n", 0, height);
- Blt_Ps_Format(ps, " %d %d rlineto\n", -width, 0);
- Blt_Ps_Append(ps, "closepath\n");
-}
-
-void
-Blt_Ps_XFillRectangle(Blt_Ps ps, double x, double y, int width, int height)
-{
- Blt_Ps_Rectangle(ps, (int)x, (int)y, width, height);
- Blt_Ps_Append(ps, "fill\n");
-}
-
-void
-Blt_Ps_PolylineFromXPoints(Blt_Ps ps, XPoint *points, int n)
-{
- XPoint *pp, *pend;
-
- pp = points;
- Blt_Ps_Append(ps, "newpath\n");
- Blt_Ps_Format(ps, " %d %d moveto\n", pp->x, pp->y);
- pp++;
- for (pend = points + n; pp < pend; pp++) {
- Blt_Ps_Format(ps, " %d %d lineto\n", pp->x, pp->y);
- }
-}
-
-void
-Blt_Ps_Polyline(Blt_Ps ps, Point2d *screenPts, int nScreenPts)
-{
- Point2d *pp, *pend;
-
- pp = screenPts;
- Blt_Ps_Append(ps, "newpath\n");
- Blt_Ps_Format(ps, " %g %g moveto\n", pp->x, pp->y);
- for (pp++, pend = screenPts + nScreenPts; pp < pend; pp++) {
- Blt_Ps_Format(ps, " %g %g lineto\n", pp->x, pp->y);
- }
-}
-
-void
-Blt_Ps_Polygon(Blt_Ps ps, Point2d *screenPts, int nScreenPts)
-{
- Point2d *pp, *pend;
-
- pp = screenPts;
- Blt_Ps_Append(ps, "newpath\n");
- Blt_Ps_Format(ps, " %g %g moveto\n", pp->x, pp->y);
- for (pp++, pend = screenPts + nScreenPts; pp < pend; pp++) {
- Blt_Ps_Format(ps, " %g %g lineto\n", pp->x, pp->y);
- }
- Blt_Ps_Format(ps, " %g %g lineto\n", screenPts[0].x, screenPts[0].y);
- Blt_Ps_Append(ps, "closepath\n");
-}
-
-void
-Blt_Ps_XFillPolygon(Blt_Ps ps, Point2d *screenPts, int nScreenPts)
-{
- Blt_Ps_Polygon(ps, screenPts, nScreenPts);
- Blt_Ps_Append(ps, "fill\n");
-}
-
-void
-Blt_Ps_XDrawSegments(Blt_Ps ps, XSegment *segments, int nSegments)
-{
- XSegment *sp, *send;
-
- for (sp = segments, send = sp + nSegments; sp < send; sp++) {
- Blt_Ps_Format(ps, "%d %d moveto %d %d lineto\n", sp->x1, sp->y1,
- sp->x2, sp->y2);
- Blt_Ps_Append(ps, "DashesProc stroke\n");
- }
-}
-
-
-void
-Blt_Ps_XFillRectangles(Blt_Ps ps, XRectangle *rectangles, int nRectangles)
-{
- XRectangle *rp, *rend;
-
- for (rp = rectangles, rend = rp + nRectangles; rp < rend; rp++) {
- Blt_Ps_XFillRectangle(ps, (double)rp->x, (double)rp->y,
- (int)rp->width, (int)rp->height);
- }
-}
-
-#ifndef TK_RELIEF_SOLID
-#define TK_RELIEF_SOLID -1 /* Set the an impossible value. */
-#endif /* TK_RELIEF_SOLID */
-
-void
-Blt_Ps_Draw3DRectangle(
- Blt_Ps ps,
- Tk_3DBorder border, /* Token for border to draw. */
- double x, double y, /* Coordinates of rectangle */
- int width, int height, /* Region to be drawn. */
- int borderWidth, /* Desired width for border, in pixels. */
- int relief) /* Should be either TK_RELIEF_RAISED or
- * TK_RELIEF_SUNKEN; indicates position of
- * interior of window relative to exterior. */
-{
- Point2d points[7];
- TkBorder *borderPtr = (TkBorder *) border;
- XColor *lightPtr, *darkPtr;
- XColor *topPtr, *bottomPtr;
- XColor light, dark;
- int twiceWidth = (borderWidth * 2);
-
- if ((width < twiceWidth) || (height < twiceWidth)) {
- return;
- }
- if ((relief == TK_RELIEF_SOLID) ||
- (borderPtr->lightColor == NULL) || (borderPtr->darkColor == NULL)) {
- if (relief == TK_RELIEF_SOLID) {
- dark.red = dark.blue = dark.green = 0x00;
- light.red = light.blue = light.green = 0x00;
- relief = TK_RELIEF_SUNKEN;
- } else {
- light = *borderPtr->bgColor;
- dark.red = dark.blue = dark.green = 0xFF;
- }
- lightPtr = &light;
- darkPtr = &dark;
- } else {
- lightPtr = borderPtr->lightColor;
- darkPtr = borderPtr->darkColor;
- }
-
-
- /* Handle grooves and ridges with recursive calls. */
-
- if ((relief == TK_RELIEF_GROOVE) || (relief == TK_RELIEF_RIDGE)) {
- int halfWidth, insideOffset;
-
- halfWidth = borderWidth / 2;
- insideOffset = borderWidth - halfWidth;
- Blt_Ps_Draw3DRectangle(ps, border, (double)x, (double)y,
- width, height, halfWidth,
- (relief == TK_RELIEF_GROOVE) ? TK_RELIEF_SUNKEN : TK_RELIEF_RAISED);
- Blt_Ps_Draw3DRectangle(ps, border,
- (double)(x + insideOffset), (double)(y + insideOffset),
- width - insideOffset * 2, height - insideOffset * 2, halfWidth,
- (relief == TK_RELIEF_GROOVE) ? TK_RELIEF_RAISED : TK_RELIEF_SUNKEN);
- return;
- }
- if (relief == TK_RELIEF_RAISED) {
- topPtr = lightPtr;
- bottomPtr = darkPtr;
- } else if (relief == TK_RELIEF_SUNKEN) {
- topPtr = darkPtr;
- bottomPtr = lightPtr;
- } else {
- topPtr = bottomPtr = borderPtr->bgColor;
- }
- Blt_Ps_XSetBackground(ps, bottomPtr);
- Blt_Ps_XFillRectangle(ps, x, y + height - borderWidth, width, borderWidth);
- Blt_Ps_XFillRectangle(ps, x + width - borderWidth, y, borderWidth, height);
- points[0].x = points[1].x = points[6].x = x;
- points[0].y = points[6].y = y + height;
- points[1].y = points[2].y = y;
- points[2].x = x + width;
- points[3].x = x + width - borderWidth;
- points[3].y = points[4].y = y + borderWidth;
- points[4].x = points[5].x = x + borderWidth;
- points[5].y = y + height - borderWidth;
- if (relief != TK_RELIEF_FLAT) {
- Blt_Ps_XSetBackground(ps, topPtr);
- }
- Blt_Ps_XFillPolygon(ps, points, 7);
-}
-
-void
-Blt_Ps_Fill3DRectangle(
- Blt_Ps ps,
- Tk_3DBorder border, /* Token for border to draw. */
- double x, double y, /* Coordinates of top-left of border area */
- int width, int height, /* Dimension of border to be drawn. */
- int borderWidth, /* Desired width for border, in pixels. */
- int relief) /* Should be either TK_RELIEF_RAISED or
- * TK_RELIEF_SUNKEN; indicates position of
- * interior of window relative to exterior. */
-{
- TkBorder *borderPtr = (TkBorder *) border;
-
- Blt_Ps_XSetBackground(ps, borderPtr->bgColor);
- Blt_Ps_XFillRectangle(ps, x, y, width, height);
- Blt_Ps_Draw3DRectangle(ps, border, x, y, width, height, borderWidth,
- relief);
-}
-
-void
-Blt_Ps_XSetStipple(Blt_Ps ps, Display *display, Pixmap bitmap)
-{
- int width, height;
-
- Tk_SizeOfBitmap(display, bitmap, &width, &height);
- Blt_Ps_Format(ps,
- "gsave\n"
- " clip\n"
- " %d %d\n",
- width, height);
- Blt_Ps_XSetBitmapData(ps, display, bitmap, width, height);
- Blt_Ps_VarAppend(ps,
- " StippleFill\n"
- "grestore\n", (char *)NULL);
-}
-
-static void
-Base85Encode(Blt_DBuffer dBuffer, Tcl_DString *resultPtr)
-{
- char *dp;
- int count;
- int length, nBytes, oldLength;
- int n;
- unsigned char *sp, *send;
-
- oldLength = Tcl_DStringLength(resultPtr);
- nBytes = Blt_DBuffer_Length(dBuffer);
-
- /*
- * Compute worst-case length of buffer needed for encoding.
- * That is 5 characters per 4 bytes. There are newlines every
- * 65 characters. The actual size can be smaller, depending upon
- * the number of 0 tuples ('z' bytes).
- */
- length = oldLength + nBytes;
- length += ((nBytes + 3)/4) * 5; /* 5 characters per 4 bytes. */
- length += (nBytes+64) / 65; /* # of newlines. */
- Tcl_DStringSetLength(resultPtr, length);
-
-
- n = count = 0;
- dp = Tcl_DStringValue(resultPtr) + oldLength;
- for (sp = Blt_DBuffer_Bytes(dBuffer), send = sp + nBytes; sp < send;
- sp += 4) {
- unsigned int tuple;
-
- tuple = 0;
-#ifdef WORDS_BIGENDIAN
- tuple |= (sp[3] << 24);
- tuple |= (sp[2] << 16);
- tuple |= (sp[1] << 8);
- tuple |= sp[0];
-#else
- tuple |= (sp[0] << 24);
- tuple |= (sp[1] << 16);
- tuple |= (sp[2] << 8);
- tuple |= sp[3];
-#endif
- if (tuple == 0) {
- *dp++ = 'z';
- count++;
- n++;
- } else {
- dp[4] = '!' + (tuple % 85);
- tuple /= 85;
- dp[3] = '!' + (tuple % 85);
- tuple /= 85;
- dp[2] = '!' + (tuple % 85);
- tuple /= 85;
- dp[1] = '!' + (tuple % 85);
- tuple /= 85;
- dp[0] = '!' + (tuple % 85);
- dp += 5;
- n += 5;
- count += 5;
- }
- if (count > 64) {
- *dp++ = '\n';
- n++;
- count = 0;
- }
- }
-
- {
- unsigned int tuple;
-
- /* Handle remaining bytes (0-3). */
- nBytes = (nBytes & 0x3);
- sp -= nBytes;
- tuple = 0;
- switch (nBytes) {
-#ifdef WORDS_BIGENDIAN
- case 3:
- tuple |= (sp[2] << 8);
- case 2:
- tuple |= (sp[1] << 16);
- case 1:
- tuple |= (sp[0] << 24);
-#else
- case 3:
- tuple |= (sp[2] << 24);
- case 2:
- tuple |= (sp[1] << 16);
- case 1:
- tuple |= (sp[0] << 8);
-#endif
- default:
- break;
- }
- if (nBytes > 0) {
- tuple /= 85;
- if (nBytes > 2) {
- dp[3] = '!' + (tuple % 85);
- n++;
- }
- tuple /= 85;
- if (nBytes > 1) {
- dp[2] = '!' + (tuple % 85);
- n++;
- }
- tuple /= 85;
- dp[1] = '!' + (tuple % 85);
- tuple /= 85;
- dp[0] = '!' + (tuple % 85);
- *dp++ = '\n';
- n += 3;
- }
- Tcl_DStringSetLength(resultPtr, n);
- }
-}
-
-static void
-AsciiHexEncode(Blt_DBuffer dBuffer, Tcl_DString *resultPtr)
-{
- static char hexDigits[] = "0123456789ABCDEF";
- int length, oldLength;
- int nBytes;
-
- /*
- * Compute the length of the buffer needed for the encoding. That is 2
- * characters per byte. There are newlines every 64 characters.
- */
- length = oldLength = Tcl_DStringLength(resultPtr);
- nBytes = Blt_DBuffer_Length(dBuffer) * 2; /* Two characters per byte */
- length += nBytes;
- length += (nBytes+63)/64; /* Number of newlines required. */
- Tcl_DStringSetLength(resultPtr, length);
- {
- unsigned char *sp, *send;
- char *bytes, *dp;
- int count, n;
-
- count = n = 0;
- dp = bytes = Tcl_DStringValue(resultPtr) + oldLength;
- for (sp = Blt_DBuffer_Bytes(dBuffer),
- send = sp + Blt_DBuffer_Length(dBuffer);
- sp < send; sp++) {
- dp[0] = hexDigits[*sp >> 4];
- dp[1] = hexDigits[*sp & 0x0F];
- dp += 2;
- n += 2;
- count++;
- if ((count & 0x1F) == 0) {
- *dp++ = '\n';
- n++;
- }
- }
- *dp++ = '\0';
-#ifdef notdef
- Tcl_DStringSetLength(resultPtr, n + oldLength);
-#endif
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ps_DrawPicture --
- *
- * Translates a picture into 3 component RGB PostScript output. Uses PS
- * Language Level 2 operator "colorimage".
- *
- * Results:
- * The dynamic string will contain the PostScript output.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Ps_DrawPicture(PostScript *psPtr, Blt_Picture picture, double x, double y)
-{
- PageSetup *setupPtr = psPtr->setupPtr;
- int w, h;
- Blt_DBuffer dBuffer;
-
- w = Blt_PictureWidth(picture);
- h = Blt_PictureHeight(picture);
- Blt_Ps_Format(psPtr,
- "gsave\n"
- "/DeviceRGB setcolorspace\n"
- "%g %g translate\n"
- "%d %d scale\n", x, y, w, h);
- if ((setupPtr->flags & PS_GREYSCALE) || (setupPtr->level == 1)) {
- int strSize;
-
- strSize = (setupPtr->flags & PS_GREYSCALE) ? w : w * 3;
- Blt_Ps_Format(psPtr,
- "/picstr %d string def\n"
- "%d %d 8\n"
- "[%d 0 0 %d 0 %d]\n"
- "{\n"
- " currentfile picstr readhexstring pop\n"
- "}\n", strSize, w, h, w, -h, h);
- if (setupPtr->flags & PS_GREYSCALE) {
- Blt_Picture greyscale;
-
- Blt_Ps_Append(psPtr, "image\n");
- greyscale = Blt_GreyscalePicture(picture);
- dBuffer = Blt_PictureToDBuffer(picture, 1);
- Blt_FreePicture(greyscale);
- } else {
- Blt_Ps_Append(psPtr, "false 3 colorimage\n");
- dBuffer = Blt_PictureToDBuffer(picture, 3);
- }
- AsciiHexEncode(dBuffer, &psPtr->dString);
- Blt_DBuffer_Free(dBuffer);
- } else {
- Blt_Ps_Format(psPtr,
- "<<\n"
- "/ImageType 1\n"
- "/Width %d\n"
- "/Height %d\n"
- "/BitsPerComponent 8\n"
- "/Decode [0 1 0 1 0 1]\n"
- "/ImageMatrix [%d 0 0 %d 0 %d]\n"
- "/Interpolate true\n"
- "/DataSource currentfile /ASCII85Decode filter\n"
- ">>\n"
- "image\n", w, h, w, -h, h);
- dBuffer = Blt_PictureToDBuffer(picture, 3);
- Base85Encode(dBuffer, &psPtr->dString);
- Blt_DBuffer_Free(dBuffer);
- }
- Blt_Ps_Append(psPtr, "\ngrestore\n\n");
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ps_XDrawWindow --
- *
- * Converts a Tk window to PostScript. If the window could not be
- * "snapped", then a grey rectangle is drawn in its place.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Ps_XDrawWindow(Blt_Ps ps, Tk_Window tkwin, double x, double y)
-{
- Blt_Picture picture;
-
- picture = Blt_DrawableToPicture(tkwin, Tk_WindowId(tkwin), 0, 0,
- Tk_Width(tkwin), Tk_Height(tkwin), GAMMA);
- if (picture == NULL) {
- /* Can't grab window image so paint the window area grey */
- Blt_Ps_VarAppend(ps, "% Can't grab window \"", Tk_PathName(tkwin),
- "\"\n", (char *)NULL);
- Blt_Ps_Append(ps, "0.5 0.5 0.5 setrgbcolor\n");
- Blt_Ps_XFillRectangle(ps, x, y, Tk_Width(tkwin), Tk_Height(tkwin));
- return;
- }
- Blt_Ps_DrawPicture(ps, picture, x, y);
- Blt_FreePicture(picture);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ps_DrawPhoto --
- *
- * Output a PostScript image string of the given photo image. The photo
- * is first converted into a picture and then translated into PostScript.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The PostScript output representing the photo is appended to the
- * psPtr's dynamic string.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Ps_DrawPhoto(Blt_Ps ps, Tk_PhotoHandle photo, double x, double y)
-{
- Blt_Picture picture;
-
- picture = Blt_PhotoToPicture(photo);
- Blt_Ps_DrawPicture(ps, picture, x, y);
- Blt_FreePicture(picture);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ps_XSetFont --
- *
- * Map the Tk font to a PostScript font and point size.
- *
- * If a TCL array variable was specified, each element should be indexed
- * by the X11 font name and contain a list of 1-2 elements; the
- * PostScript font name and the desired point size. The point size may
- * be omitted and the X font point size will be used.
- *
- * Otherwise, if the foundry is "Adobe", we try to do a plausible mapping
- * looking at the full name of the font and building a string in the form
- * of "Family-TypeFace".
- *
- * Returns:
- * None.
- *
- * Side Effects:
- * PostScript commands are output to change the type and the point size
- * of the current font.
- *
- *---------------------------------------------------------------------------
- */
-
-void
-Blt_Ps_XSetFont(PostScript *psPtr, Blt_Font font)
-{
- Tcl_Interp *interp = psPtr->interp;
- const char *family;
-
- /* Use the font variable information if it exists. */
- if ((psPtr->setupPtr != NULL) && (psPtr->setupPtr->fontVarName != NULL)) {
- char *value;
-
- value = (char *)Tcl_GetVar2(interp, psPtr->setupPtr->fontVarName,
- Blt_NameOfFont(font), 0);
- if (value != NULL) {
- const char **argv = NULL;
- int argc;
- int newSize;
- double pointSize;
- const char *fontName;
-
- if (Tcl_SplitList(NULL, value, &argc, &argv) != TCL_OK) {
- return;
- }
- fontName = argv[0];
- if ((argc != 2) ||
- (Tcl_GetInt(interp, argv[1], &newSize) != TCL_OK)) {
- Blt_Free(argv);
- return;
- }
- pointSize = (double)newSize;
- Blt_Ps_Format(psPtr, "%g /%s SetFont\n", pointSize,
- fontName);
- Blt_Free(argv);
- return;
- }
- /*FallThru*/
- }
-
- /*
- * Check to see if it's a PostScript font. Tk_PostScriptFontName silently
- * generates a bogus PostScript font name, so we have to check to see if
- * this is really a PostScript font first before we call it.
- */
- family = FamilyToPsFamily(Blt_FamilyOfFont(font));
- if (family != NULL) {
- Tcl_DString dString;
- double pointSize;
-
- Tcl_DStringInit(&dString);
- pointSize = (double)Blt_PostscriptFontName(font, &dString);
- Blt_Ps_Format(psPtr, "%g /%s SetFont\n", pointSize,
- Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- return;
- }
- Blt_Ps_Append(psPtr, "12.0 /Helvetica-Bold SetFont\n");
-}
-
-static void
-TextLayoutToPostScript(Blt_Ps ps, int x, int y, TextLayout *textPtr)
-{
- char *bp, *dst;
- int count; /* Counts the # of bytes written to the
- * intermediate scratch buffer. */
- const char *src, *end;
- TextFragment *fragPtr;
- int i;
- unsigned char c;
-#if HAVE_UTF
- Tcl_UniChar ch;
-#endif
- int limit;
-
- limit = POSTSCRIPT_BUFSIZ - 4; /* High water mark for scratch buffer. */
- fragPtr = textPtr->fragments;
- for (i = 0; i < textPtr->nFrags; i++, fragPtr++) {
- if (fragPtr->count < 1) {
- continue;
- }
- Blt_Ps_Append(ps, "(");
- count = 0;
- dst = Blt_Ps_GetScratchBuffer(ps);
- src = fragPtr->text;
- end = fragPtr->text + fragPtr->count;
- while (src < end) {
- if (count > limit) {
- /* Don't let the scatch buffer overflow */
- dst = Blt_Ps_GetScratchBuffer(ps);
- dst[count] = '\0';
- Blt_Ps_Append(ps, dst);
- count = 0;
- }
-#if HAVE_UTF
- /*
- * INTL: For now we just treat the characters as binary data and
- * display the lower byte. Eventually this should be revised to
- * handle international postscript fonts.
- */
- src += Tcl_UtfToUniChar(src, &ch);
- c = (unsigned char)(ch & 0xff);
-#else
- c = *src++;
-#endif
-
- if ((c == '\\') || (c == '(') || (c == ')')) {
- /*
- * If special PostScript characters characters "\", "(", and
- * ")" are contained in the text string, prepend backslashes
- * to them.
- */
- *dst++ = '\\';
- *dst++ = c;
- count += 2;
- } else if ((c < ' ') || (c > '~')) {
- /* Convert non-printable characters into octal. */
- sprintf_s(dst, 5, "\\%03o", c);
- dst += 4;
- count += 4;
- } else {
- *dst++ = c;
- count++;
- }
- }
- bp = Blt_Ps_GetScratchBuffer(ps);
- bp[count] = '\0';
- Blt_Ps_Append(ps, bp);
- Blt_Ps_Format(ps, ") %d %d %d DrawAdjText\n",
- fragPtr->width, x + fragPtr->x, y + fragPtr->y);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ps_DrawText --
- *
- * Output PostScript commands to print a text string. The string may be
- * rotated at any arbitrary angle, and placed according the anchor type
- * given. The anchor indicates how to interpret the window coordinates as
- * an anchor for the text bounding box.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Text string is drawn using the given font and GC on the graph window
- * at the given coordinates, anchor, and rotation
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Ps_DrawText(
- Blt_Ps ps,
- const char *string, /* String to convert to PostScript */
- TextStyle *tsPtr, /* Text attribute information */
- double x, double y) /* Window coordinates where to print text */
-{
- TextLayout *textPtr;
- Point2d t;
-
- if ((string == NULL) || (*string == '\0')) { /* Empty string, do nothing */
- return;
- }
- textPtr = Blt_Ts_CreateLayout(string, -1, tsPtr);
- {
- float angle;
- double rw, rh;
-
- angle = FMOD(tsPtr->angle, (double)360.0);
- Blt_GetBoundingBox(textPtr->width, textPtr->height, angle, &rw, &rh,
- (Point2d *)NULL);
- /*
- * Find the center of the bounding box
- */
- t = Blt_AnchorPoint(x, y, rw, rh, tsPtr->anchor);
- t.x += rw * 0.5;
- t.y += rh * 0.5;
- }
-
- /* Initialize text (sets translation and rotation) */
- Blt_Ps_Format(ps, "%d %d %g %g %g BeginText\n", textPtr->width,
- textPtr->height, tsPtr->angle, t.x, t.y);
-
- Blt_Ps_XSetFont(ps, tsPtr->font);
-
- Blt_Ps_XSetForeground(ps, tsPtr->color);
- TextLayoutToPostScript(ps, 0, 0, textPtr);
- Blt_Free(textPtr);
- Blt_Ps_Append(ps, "EndText\n");
-}
-
-void
-Blt_Ps_XDrawLines(Blt_Ps ps, XPoint *points, int n)
-{
- int nLeft;
-
- if (n <= 0) {
- return;
- }
- for (nLeft = n; nLeft > 0; nLeft -= PS_MAXPATH) {
- int length;
-
- length = MIN(PS_MAXPATH, nLeft);
- Blt_Ps_PolylineFromXPoints(ps, points, length);
- Blt_Ps_Append(ps, "DashesProc stroke\n");
- points += length;
- }
-}
-
-void
-Blt_Ps_DrawPolyline(Blt_Ps ps, Point2d *points, int nPoints)
-{
- int nLeft;
-
- if (nPoints <= 0) {
- return;
- }
- for (nLeft = nPoints; nLeft > 0; nLeft -= PS_MAXPATH) {
- int length;
-
- length = MIN(PS_MAXPATH, nLeft);
- Blt_Ps_Polyline(ps, points, length);
- Blt_Ps_Append(ps, "DashesProc stroke\n");
- points += length;
- }
-}
-
-void
-Blt_Ps_DrawBitmap(
- Blt_Ps ps,
- Display *display,
- Pixmap bitmap, /* Bitmap to be converted to PostScript */
- double xScale, double yScale)
-{
- int width, height;
- double sw, sh;
-
- Tk_SizeOfBitmap(display, bitmap, &width, &height);
- sw = (double)width * xScale;
- sh = (double)height * yScale;
- Blt_Ps_Append(ps, " gsave\n");
- Blt_Ps_Format(ps, " %g %g translate\n", sw * -0.5, sh * 0.5);
- Blt_Ps_Format(ps, " %g %g scale\n", sw, -sh);
- Blt_Ps_Format(ps, " %d %d true [%d 0 0 %d 0 %d] {",
- width, height, width, -height, height);
- Blt_Ps_XSetBitmapData(ps, display, bitmap, width, height);
- Blt_Ps_Append(ps, " } imagemask\n grestore\n");
-}
-
-void
-Blt_Ps_Draw2DSegments(Blt_Ps ps, Segment2d *segments, int nSegments)
-{
- Segment2d *sp, *send;
-
- Blt_Ps_Append(ps, "newpath\n");
- for (sp = segments, send = sp + nSegments; sp < send; sp++) {
- Blt_Ps_Format(ps, " %g %g moveto %g %g lineto\n",
- sp->p.x, sp->p.y, sp->q.x, sp->q.y);
- Blt_Ps_Append(ps, "DashesProc stroke\n");
- }
-}
-
-void
-Blt_Ps_FontName(const char *family, int flags, Tcl_DString *resultPtr)
-{
- const char *familyName, *weightName, *slantName;
- int len;
-
- len = Tcl_DStringLength(resultPtr);
-
- familyName = FamilyToPsFamily(family);
- if (familyName == NULL) {
- Tcl_UniChar ch;
- char *src, *dest;
- int upper;
-
- /*
- * Inline, capitalize the first letter of each word, lowercase the
- * rest of the letters in each word, and then take out the spaces
- * between the words. This may make the DString shorter, which is
- * safe to do.
- */
- Tcl_DStringAppend(resultPtr, family, -1);
- src = dest = Tcl_DStringValue(resultPtr) + len;
- upper = TRUE;
- while (*src != '\0') {
- while (isspace(*src)) { /* INTL: ISO space */
- src++;
- upper = TRUE;
- }
- src += Tcl_UtfToUniChar(src, &ch);
- if (upper) {
- ch = Tcl_UniCharToUpper(ch);
- upper = FALSE;
- } else {
- ch = Tcl_UniCharToLower(ch);
- }
- dest += Tcl_UniCharToUtf(ch, dest);
- }
- *dest = '\0';
- Tcl_DStringSetLength(resultPtr, dest - Tcl_DStringValue(resultPtr));
- familyName = Tcl_DStringValue(resultPtr) + len;
- }
- if (familyName != Tcl_DStringValue(resultPtr) + len) {
- Tcl_DStringAppend(resultPtr, familyName, -1);
- familyName = Tcl_DStringValue(resultPtr) + len;
- }
- if (strcasecmp(familyName, "NewCenturySchoolbook") == 0) {
- Tcl_DStringSetLength(resultPtr, len);
- Tcl_DStringAppend(resultPtr, "NewCenturySchlbk", -1);
- familyName = Tcl_DStringValue(resultPtr) + len;
- }
-
- /* Get the string to use for the weight. */
- weightName = NULL;
- if (flags & FONT_BOLD) {
- if ((strcmp(familyName, "Bookman") == 0) ||
- (strcmp(familyName, "AvantGarde") == 0)) {
- weightName = "Demi";
- } else {
- weightName = "Bold";
- }
- } else {
- if (strcmp(familyName, "Bookman") == 0) {
- weightName = "Light";
- } else if (strcmp(familyName, "AvantGarde") == 0) {
- weightName = "Book";
- } else if (strcmp(familyName, "ZapfChancery") == 0) {
- weightName = "Medium";
- }
- }
-
- /* Get the string to use for the slant. */
- slantName = NULL;
- if (flags & FONT_ITALIC) {
- if ((strcmp(familyName, "Helvetica") == 0) ||
- (strcmp(familyName, "Courier") == 0) ||
- (strcmp(familyName, "AvantGarde") == 0)) {
- slantName = "Oblique";
- } else {
- slantName = "Italic";
- }
- }
-
- /*
- * The string "Roman" needs to be added to some fonts that are not bold
- * and not italic.
- */
- if ((slantName == NULL) && (weightName == NULL)) {
- if ((strcmp(familyName, "Times") == 0) ||
- (strcmp(familyName, "NewCenturySchlbk") == 0) ||
- (strcmp(familyName, "Palatino") == 0)) {
- Tcl_DStringAppend(resultPtr, "-Roman", -1);
- }
- } else {
- Tcl_DStringAppend(resultPtr, "-", -1);
- if (weightName != NULL) {
- Tcl_DStringAppend(resultPtr, weightName, -1);
- }
- if (slantName != NULL) {
- Tcl_DStringAppend(resultPtr, slantName, -1);
- }
- }
-}
diff --git a/blt3.0.1/src/bltPs.h b/blt3.0.1/src/bltPs.h
deleted file mode 100644
index 944faf8..0000000
--- a/blt3.0.1/src/bltPs.h
+++ /dev/null
@@ -1,215 +0,0 @@
-
-/*
- * bltPs.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_PS_H
-#define _BLT_PS_H
-
-#include "bltPicture.h"
-
-/*
- * PageSetup --
- *
- * Structure contains information specific to the layout of the page for
- * printing the graph.
- *
- */
-typedef struct {
- /* User configurable fields */
-
- int reqWidth, reqHeight; /* If greater than zero, represents the
- * requested dimensions of the printed graph */
- int reqPaperWidth;
- int reqPaperHeight; /* Requested dimensions for the PostScript
- * page. Can constrain the size of the graph
- * if the graph (plus padding) is larger than
- * the size of the page. */
- Blt_Pad xPad, yPad; /* Requested padding on the exterior of the
- * graph. This forms the bounding box for
- * the page. */
- const char *colorVarName; /* If non-NULL, is the name of a TCL array
- * variable containing X to output device color
- * translations */
- const char *fontVarName; /* If non-NULL, is the name of a TCL array
- * variable containing X to output device font
- * translations */
- int level; /* PostScript Language level 1-3 */
- unsigned int flags;
-
- const char **comments; /* User supplied comments to be added. */
-
- /* Computed fields */
-
- short int left, bottom; /* Bounding box of the plot in the page. */
- short int right, top;
-
- float scale; /* Scale of page. Set if "-maxpect" option
- * is set, otherwise 1.0. */
-
- int paperHeight;
- int paperWidth;
-
-} PageSetup;
-
-#define PS_GREYSCALE (1<<0)
-#define PS_LANDSCAPE (1<<2)
-#define PS_CENTER (1<<3)
-#define PS_MAXPECT (1<<4)
-#define PS_DECORATIONS (1<<5)
-#define PS_FOOTER (1<<6)
-#define PS_FMT_NONE 0
-#define PS_FMT_MASK (PS_FMT_WMF|PS_FMT_EPSI|PS_FMT_TIFF)
-#define PS_FMT_WMF (1<<8)
-#define PS_FMT_EPSI (1<<9)
-#define PS_FMT_TIFF (1<<10)
-
-typedef struct _Blt_Ps *Blt_Ps;
-
-BLT_EXTERN Blt_Ps Blt_Ps_Create(Tcl_Interp *interp, PageSetup *setupPtr);
-
-BLT_EXTERN void Blt_Ps_Free(Blt_Ps ps);
-
-BLT_EXTERN const char *Blt_Ps_GetValue(Blt_Ps ps, int *lengthPtr);
-
-BLT_EXTERN Tcl_Interp *Blt_Ps_GetInterp(Blt_Ps ps);
-
-BLT_EXTERN Tcl_DString *Blt_Ps_GetDString(Blt_Ps ps);
-
-BLT_EXTERN char *Blt_Ps_GetScratchBuffer(Blt_Ps ps);
-
-BLT_EXTERN void Blt_Ps_SetInterp(Blt_Ps ps, Tcl_Interp *interp);
-
-BLT_EXTERN void Blt_Ps_Append(Blt_Ps ps, const char *string);
-
-BLT_EXTERN void Blt_Ps_AppendBytes(Blt_Ps ps, const char *string, int nBytes);
-
-BLT_EXTERN void Blt_Ps_VarAppend TCL_VARARGS(Blt_Ps, ps);
-
-BLT_EXTERN void Blt_Ps_Format TCL_VARARGS(Blt_Ps, ps);
-
-BLT_EXTERN void Blt_Ps_SetClearBackground(Blt_Ps ps);
-
-BLT_EXTERN int Blt_Ps_IncludeFile(Tcl_Interp *interp, Blt_Ps ps,
- const char *fileName);
-
-BLT_EXTERN int Blt_Ps_GetPicaFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- int *picaPtr);
-
-BLT_EXTERN int Blt_Ps_GetPadFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- Blt_Pad *padPtr);
-
-BLT_EXTERN int Blt_Ps_ComputeBoundingBox(PageSetup *setupPtr, int w, int h);
-
-BLT_EXTERN void Blt_Ps_DrawPicture(Blt_Ps ps, Blt_Picture picture,
- double x, double y);
-
-BLT_EXTERN void Blt_Ps_Rectangle(Blt_Ps ps, int x, int y, int w, int h);
-
-
-BLT_EXTERN int Blt_Ps_SaveFile(Tcl_Interp *interp, Blt_Ps ps,
- const char *fileName);
-
-#ifdef _TK
-
-#include "bltFont.h"
-#include "bltText.h"
-
-BLT_EXTERN void Blt_Ps_XSetLineWidth(Blt_Ps ps, int lineWidth);
-
-BLT_EXTERN void Blt_Ps_XSetBackground(Blt_Ps ps, XColor *colorPtr);
-
-BLT_EXTERN void Blt_Ps_XSetBitmapData(Blt_Ps ps, Display *display,
- Pixmap bitmap, int width, int height);
-
-BLT_EXTERN void Blt_Ps_XSetForeground(Blt_Ps ps, XColor *colorPtr);
-
-BLT_EXTERN void Blt_Ps_XSetFont(Blt_Ps ps, Blt_Font font);
-
-BLT_EXTERN void Blt_Ps_XSetDashes(Blt_Ps ps, Blt_Dashes *dashesPtr);
-
-BLT_EXTERN void Blt_Ps_XSetLineAttributes(Blt_Ps ps, XColor *colorPtr,
- int lineWidth, Blt_Dashes *dashesPtr, int capStyle, int joinStyle);
-
-BLT_EXTERN void Blt_Ps_XSetStipple(Blt_Ps ps, Display *display, Pixmap bitmap);
-
-BLT_EXTERN void Blt_Ps_Polyline(Blt_Ps ps, Point2d *screenPts, int nScreenPts);
-
-BLT_EXTERN void Blt_Ps_XDrawLines(Blt_Ps ps, XPoint *points, int n);
-
-BLT_EXTERN void Blt_Ps_XDrawSegments(Blt_Ps ps, XSegment *segments,
- int nSegments);
-
-BLT_EXTERN void Blt_Ps_DrawPolyline(Blt_Ps ps, Point2d *points, int n);
-
-BLT_EXTERN void Blt_Ps_Draw2DSegments(Blt_Ps ps, Segment2d *segments,
- int nSegments);
-
-BLT_EXTERN void Blt_Ps_Draw3DRectangle(Blt_Ps ps, Tk_3DBorder border,
- double x, double y, int width, int height, int borderWidth, int relief);
-
-BLT_EXTERN void Blt_Ps_Fill3DRectangle(Blt_Ps ps, Tk_3DBorder border, double x,
- double y, int width, int height, int borderWidth, int relief);
-
-BLT_EXTERN void Blt_Ps_XFillRectangle(Blt_Ps ps, double x, double y,
- int width, int height);
-
-BLT_EXTERN void Blt_Ps_XFillRectangles(Blt_Ps ps, XRectangle *rects, int n);
-
-BLT_EXTERN void Blt_Ps_XFillPolygon(Blt_Ps ps, Point2d *screenPts,
- int nScreenPts);
-
-BLT_EXTERN void Blt_Ps_DrawPhoto(Blt_Ps ps, Tk_PhotoHandle photoToken,
- double x, double y);
-
-BLT_EXTERN void Blt_Ps_XDrawWindow(Blt_Ps ps, Tk_Window tkwin,
- double x, double y);
-
-BLT_EXTERN void Blt_Ps_DrawText(Blt_Ps ps, const char *string,
- TextStyle *attrPtr, double x, double y);
-
-BLT_EXTERN void Blt_Ps_DrawBitmap(Blt_Ps ps, Display *display, Pixmap bitmap,
- double scaleX, double scaleY);
-
-BLT_EXTERN void Blt_Ps_XSetCapStyle(Blt_Ps ps, int capStyle);
-
-BLT_EXTERN void Blt_Ps_XSetJoinStyle(Blt_Ps ps, int joinStyle);
-
-BLT_EXTERN void Blt_Ps_PolylineFromXPoints(Blt_Ps ps, XPoint *points, int n);
-
-BLT_EXTERN void Blt_Ps_Polygon(Blt_Ps ps, Point2d *screenPts, int nScreenPts);
-
-BLT_EXTERN void Blt_Ps_SetPrinting(Blt_Ps ps, int value);
-BLT_EXTERN int Blt_Ps_IsPrinting(void);
-
-BLT_EXTERN int Blt_Ps_TextWidth(Blt_Font font, const char *string, int nBytes);
-
-BLT_EXTERN int Blt_Ps_GetFontMetrics(Blt_Font font, Blt_FontMetrics *fmPtr);
-
-BLT_EXTERN void Blt_Ps_FontName(const char *family, int flags,
- Tcl_DString *resultPtr);
-
-#endif /* _TK */
-
-#endif /* BLT_PS_H */
diff --git a/blt3.0.1/src/bltPsAfm.c b/blt3.0.1/src/bltPsAfm.c
deleted file mode 100644
index 5307156..0000000
--- a/blt3.0.1/src/bltPsAfm.c
+++ /dev/null
@@ -1,1835 +0,0 @@
-
-/*
- * bltPsAfm.c --
- *
- * This module implements an Adobe Font Metric File parser for the purpose of
- * determining font metrics when generating PostScript.
- *
- * Copyright 2009 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <setjmp.h>
-#include <bltInt.h>
-#include <bltHash.h>
-#include "bltPs.h"
-
-#include "bltOp.h"
-#include "bltText.h"
-#include "bltFont.h"
-#define AFM_MAXSTATES 50
-#define AFM_MAXLINE 512
-#define FM(x) Blt_Offset(AdobeFontMetrics, x)
-#define CM(x) Blt_Offset(CharMetrics, x)
-#define FTOA(x) Blt_Dtoa(interp, (double)x)
-
-typedef struct {
- const char *name;
- short int code;
-} Symbol;
-
-static Symbol isoLatin1Symbols[] = {
- { "A", 65 },
- { "AE", 198 },
- { "Aacute", 193 },
- { "Acircumflex", 194 },
- { "Adieresis", 196 },
- { "Agrave", 192 },
- { "Aring", 197 },
- { "Atilde", 195 },
- { "B", 66 },
- { "C", 67 },
- { "Ccedilla", 199 },
- { "D", 68 },
- { "E", 69 },
- { "Eacute", 201 },
- { "Ecircumflex", 202 },
- { "Edieresis", 203 },
- { "Egrave", 200 },
- { "Eth", 208 },
- { "F", 70 },
- { "G", 71 },
- { "H", 72 },
- { "I", 73 },
- { "Iacute", 205 },
- { "Icircumflex", 206 },
- { "Idieresis", 207 },
- { "Igrave", 204 },
- { "J", 74 },
- { "K", 75 },
- { "L", 76 },
- { "M", 77 },
- { "N", 78 },
- { "Ntilde", 209 },
- { "O", 79 },
- { "Oacute", 211 },
- { "Ocircumflex", 212 },
- { "Odieresis", 214 },
- { "Ograve", 210 },
- { "Oslash", 216 },
- { "Otilde", 213 },
- { "P", 80 },
- { "Q", 81 },
- { "R", 82 },
- { "S", 83 },
- { "T", 84 },
- { "Thorn", 222 },
- { "U", 85 },
- { "Uacute", 218 },
- { "Ucircumflex", 219 },
- { "Udieresis", 220 },
- { "Ugrave", 217 },
- { "V", 86 },
- { "W", 87 },
- { "X", 88 },
- { "Y", 89 },
- { "Yacute", 221 },
- { "Z", 90 },
- { "a", 97 },
- { "aacute", 225 },
- { "acircumflex", 226 },
- { "acute", 180 },
- { "adieresis", 228 },
- { "ae", 230 },
- { "agrave", 224 },
- { "ampersand", 38 },
- { "aring", 229 },
- { "asciicircum", 94 },
- { "asciitilde", 126 },
- { "asterisk", 42 },
- { "at", 64 },
- { "atilde", 227 },
- { "b", 98 },
- { "backslash", 92 },
- { "bar", 124 },
- { "braceleft", 123 },
- { "braceright", 125 },
- { "bracketleft", 91 },
- { "bracketright", 93 },
- { "brokenbar", 166 },
- { "florin", 166 },
- { "c", 99 },
- { "ccedilla", 231 },
- { "cedilla", 184 },
- { "cent", 162 },
- { "colon", 58 },
- { "comma", 44 },
- { "controlACK", 6 },
- { "controlBEL", 7 },
- { "controlBS", 8 },
- { "controlCAN", 24 },
- { "controlCR", 13 },
- { "controlDC1", 17 },
- { "controlDC2", 18 },
- { "controlDC3", 19 },
- { "controlDC4", 20 },
- { "controlDEL", 127 },
- { "controlDLE", 16 },
- { "controlEM", 25 },
- { "controlENQ", 5 },
- { "controlEOT", 4 },
- { "controlESC", 27 },
- { "controlETB", 23 },
- { "controlETX", 3 },
- { "controlFF", 12 },
- { "controlFS", 28 },
- { "controlGS", 29 },
- { "controlHT", 9 },
- { "controlLF", 10 },
- { "controlNAK", 21 },
- { "controlRS", 30 },
- { "controlSI", 15 },
- { "controlSO", 14 },
- { "controlSOT", 2 },
- { "controlSTX", 1 },
- { "controlSUB", 26 },
- { "controlSYN", 22 },
- { "controlUS", 31 },
- { "controlVT", 11 },
- { "copyright", 169 },
- { "currency", 164 },
- { "fraction", 164 },
- { "d", 100 },
- { "degree", 176 },
- { "dieresis", 168 },
- { "divide", 247 },
- { "dollar", 36 },
- { "e", 101 },
- { "eacute", 233 },
- { "ecircumflex", 234 },
- { "edieresis", 235 },
- { "egrave", 232 },
- { "eight", 56 },
- { "equal", 61 },
- { "eth", 240 },
- { "exclam", 33 },
- { "exclamdown", 161 },
- { "f", 102 },
- { "five", 53 },
- { "four", 52 },
- { "g", 103 },
- { "germandbls", 223 },
- { "grave", 96 },
- { "quoteleft", 96 },
- { "greater", 62 },
- { "guillemotleft", 171 },
- { "guillemotright", 187 },
- { "h", 104 },
- { "hyphen", 45 },
- { "i", 105 },
- { "iacute", 237 },
- { "icircumflex", 238 },
- { "idieresis", 239 },
- { "igrave", 236 },
- { "j", 106 },
- { "k", 107 },
- { "l", 108 },
- { "less", 60 },
- { "logicalnot", 172 },
- { "m", 109 },
- { "macron", 175 },
- { "middot", 183 },
- { "mu", 181 },
- { "mu1", 181 },
- { "multiply", 215 },
- { "n", 110 },
- { "nbspace", 160 },
- { "nine", 57 },
- { "nonbreakingspace", 160 },
- { "ntilde", 241 },
- { "numbersign", 35 },
- { "o", 111 },
- { "oacute", 243 },
- { "ocircumflex", 244 },
- { "odieresis", 246 },
- { "ograve", 242 },
- { "one", 49 },
- { "onehalf", 189 },
- { "onequarter", 188 },
- { "onesuperior", 185 },
- { "ordfeminine", 170 },
- { "ordmasculine", 186 },
- { "oslash", 248 },
- { "otilde", 245 },
- { "overscore", 175 },
- { "p", 112 },
- { "paragraph", 182 },
- { "parenleft", 40 },
- { "parenright", 41 },
- { "percent", 37 },
- { "period", 46 },
- { "periodcentered", 183 },
- { "plus", 43 },
- { "plusminus", 177 },
- { "q", 113 },
- { "question", 63 },
- { "questiondown", 191 },
- { "quotedbl", 34 },
- { "quotesingle", 39 },
- { "quoteright", 39 },
- { "r", 114 },
- { "registered", 174 },
- { "s", 115 },
- { "section", 167 },
- { "semicolon", 59 },
- { "seven", 55 },
- { "sfthyphen", 173 },
- { "six", 54 },
- { "slash", 47 },
- { "softhyphen", 173 },
- { "space", 32 },
- { "spacehackarabic", 32 },
- { "sterling", 163 },
- { "t", 116 },
- { "thorn", 254 },
- { "three", 51 },
- { "threequarters", 190 },
- { "threesuperior", 179 },
- { "two", 50 },
- { "twosuperior", 178 },
- { "u", 117 },
- { "uacute", 250 },
- { "ucircumflex", 251 },
- { "udieresis", 252 },
- { "ugrave", 249 },
- { "underscore", 95 },
- { "v", 118 },
- { "verticalbar", 124 },
- { "w", 119 },
- { "x", 120 },
- { "y", 121 },
- { "yacute", 253 },
- { "ydieresis", 255 },
- { "yen", 165 },
- { "z", 122 },
- { "zero", 48 },
- { NULL, -1 }
-};
-
-typedef struct _Parser Parser;
-
-typedef int (ParseProc) (Parser *parserPtr, char *record, int offset);
-
-typedef struct {
- const char *key;
- unsigned int nArgs;
- ParseProc *proc;
- size_t offset;
-} ParserSpec;
-
-typedef struct {
- float llx, lly, urx, ury;
-} CharBBox;
-
-typedef struct {
- float x, y;
-} Point;
-
-typedef struct {
- short int first, second;
-} LigatureKey;
-
-typedef struct {
- const char *successor;
- const char *ligature;
- short int index;
-} Ligature;
-
-typedef struct {
- CharBBox bbox;
- int index;
- const char *name;
- int hasLigature;
- int hasKernPair;
- Point w;
- Point vVector;
-} CharMetrics;
-
-typedef struct {
- float x, y;
- short int first, second;
-} KernPairs;
-
-typedef struct {
- short int first, second;
-} KernPairsKey;
-
-typedef struct {
- float degree;
- float minPointSize, maxPointSize;
- float minKern, maxKern;
-} TrackKern;
-
-typedef struct {
- const char *afmVersion;
- const char *familyName;
- const char *fontName;
- const char *fullName;
- const char *weight;
- const char *comment;
- const char *copyright;
- const char *notice;
- float italicAngle;
- CharBBox fontBBox;
- float underlinePosition;
- float underlineThickness;
- const char *characterSet;
- int characters;
- const char *version;
- const char *encodingScheme;
- float capHeight;
- float xHeight;
- float ascender, descender;
- int metricSets;
- Point charWidth;
- int escChar;
- int isFixedPitch;
- int isBaseFont;
- int isCIDFont;
- int isFixedV;
- int mappingScheme;
- int nCharMetrics;
- int nComposites;
- int nDirection;
- int nKernPairs;
- int nTrackKern;
-
- float stdHW, stdVW;
- Point vVector;
- TrackKern *trackKern;
-
- KernPairs *kernPairs;
- CharMetrics metrics[256];
- Blt_HashTable metricsTable;
- Blt_HashTable kernPairsTable;
- Blt_HashTable ligatureTable;
- Blt_HashTable symbolTable;
-#ifdef notdef
- Composites *composites;
- Blt_HashTable compositeTable;
-#endif
- int refCount;
- Blt_HashEntry *hashPtr;
- float pointSize; /* Current point size of font. */
-} AdobeFontMetrics;
-
-struct _Parser {
- Tcl_Channel channel; /* Channel to AdobeFontMetrics file. */
- AdobeFontMetrics *afmPtr;
- jmp_buf jmpbuf;
- Tcl_DString errors; /* Contains error message. */
- int nErrors;
- int argc; /* # arguments (word) of last line. */
- const char **argv; /* Split of last line. */
- Tcl_DString lastLine; /* Contains last line read from file. */
- int lineNumber;
-};
-
-static Blt_HashTable fontTable;
-static int initialized;
-
-static int ParseLine(Parser *parserPtr, ParserSpec *specs, int nSpecs,
- ClientData clientData);
-
-static INLINE int
-Points(AdobeFontMetrics *afmPtr, double x)
-{
- return (int)round((afmPtr->pointSize * x) / 1000.0);
-}
-
-/*ARGSUSED*/
-static void
-ParserError TCL_VARARGS_DEF(Parser *, arg1)
-{
- Parser *parserPtr;
- const char *fmt;
- char string[BUFSIZ+4];
- int length;
- va_list args;
-
- parserPtr = TCL_VARARGS_START(Parser *, arg1, args);
- fmt = va_arg(args, char *);
- length = vsnprintf(string, BUFSIZ, fmt, args);
- if (length > BUFSIZ) {
- strcat(string, "...");
- }
- Tcl_DStringAppend(&parserPtr->errors, "line ", 5);
- Tcl_DStringAppend(&parserPtr->errors, Blt_Itoa(parserPtr->lineNumber), -1);
- Tcl_DStringAppend(&parserPtr->errors, ": ", 2);
- Tcl_DStringAppend(&parserPtr->errors, string, -1);
- Tcl_DStringAppend(&parserPtr->errors, "\n", -1);
- va_end(args);
- longjmp(parserPtr->jmpbuf, 0);
-}
-
-static int
-GetNumber(Parser *parserPtr, const char *string, float *valuePtr)
-{
- char *end;
- double d;
-
- errno = 0;
- d = strtod(string, &end); /* INTL: Tcl source. */
- if (end == string) {
- badDouble:
- ParserError(parserPtr, "expected floating-point number but got \"%s\"",
- string);
- }
- if (errno != 0 && (d == HUGE_VAL || d == -HUGE_VAL || d == 0)) {
- ParserError(parserPtr, "number \"%s\" is too big to represent",
- string);
- }
- while ((*end != 0) && isspace(UCHAR(*end))) { /* INTL: ISO space. */
- end++;
- }
- if (*end != 0) {
- goto badDouble;
- }
- *valuePtr = (float)d;
- return TCL_OK;
-}
-
-static int
-GetHexNumber(Parser *parserPtr, const char *string, int *valuePtr)
-{
- char *p;
- int value;
-
- if (*string == '<') {
- string++;
- }
- value = strtoul(string, &p, 8);
- if ((p == string) || (*p != '>')) {
- ParserError(parserPtr, "expected hex number but got \"%s\"", string);
- }
- *valuePtr = value;
- return TCL_OK;
-}
-
-static int
-GetLine(Parser *parserPtr)
-{
- Tcl_DStringSetLength(&parserPtr->lastLine, 0);
- while (!Tcl_Eof(parserPtr->channel)) {
- const char *p;
- int code;
-
- code = Tcl_Gets(parserPtr->channel, &parserPtr->lastLine);
- if (code < 0) {
- if (Tcl_Eof(parserPtr->channel)) {
- return TCL_RETURN;
- }
- ParserError(parserPtr, "error reading channel: %s\n",
- strerror(errno));
- }
- parserPtr->lineNumber++;
- for (p = Tcl_DStringValue(&parserPtr->lastLine); isspace(*p); p++) {
- /* skip blanks */
- }
- if (*p == '\0') {
- continue;
- }
- return TCL_OK;
- }
- return TCL_RETURN;
-}
-
-static void
-SplitLine(Parser *parserPtr, const char *line)
-{
- const char *p;
- int count;
- size_t strSize, addrSize;
-
- if (parserPtr->argv != NULL) {
- Blt_Free((char *)parserPtr->argv);
- parserPtr->argv = NULL;
- parserPtr->argc = 0;
- }
- /* Count the # of arguments to determine what size array to allocate. */
- count = 0;
- p = line;
- while (*p != '\0') {
- while (isspace(*p)) p++; /* Skip whitespace. */
- if (*p == '\0') {
- break;
- }
- while (!isspace(*p) && (*p != '\0')) p++; /* Skip the word itself. */
- count++;
- }
- if (count == 0) {
- return; /* No arguments. */
- }
- addrSize = sizeof(char **) * (count + 1);
- strSize = p - line + 1;
- {
- char *buffer, *p;
- const char **array;
-
- buffer = Blt_Malloc(addrSize + strSize);
- assert(buffer);
- p = buffer + addrSize;
- strcpy(p, line); /* Copy the string into the buffer. */
- array = (const char **)buffer;
- count = 0;
- while (*p != '\0') {
- while (isspace(*p)) {
- *p++ = '\0'; /* Convert whitespace to NULs. */
- }
- if (*p == '\0') {
- break;
- }
- array[count] = p;
- while (!isspace(*p) && (*p != '\0')) p++;
- count++;
- }
- array[count] = NULL;
- parserPtr->argv = array;
- parserPtr->argc = count;
- }
-}
-
-static int
-SplitNextLine(Parser *parserPtr)
-{
- int result;
-
- if (parserPtr->argv != NULL) {
- Blt_Free((char *)parserPtr->argv);
- parserPtr->argv = NULL;
- parserPtr->argc = 0;
- }
- result = GetLine(parserPtr);
- if (result == TCL_OK) {
- SplitLine(parserPtr, Tcl_DStringValue(&parserPtr->lastLine));
- return TCL_OK;
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LookupKeyword --
- *
- *---------------------------------------------------------------------------
- */
-static ParserSpec *
-LookupKeyword(ParserSpec *specs, int nSpecs, const char *string)
-{
- char c;
- int high, low;
-
- low = 0;
- high = nSpecs - 1;
- c = string[0];
- while (low <= high) {
- ParserSpec *specPtr;
- int compare;
- int median;
-
- median = (low + high) >> 1;
- specPtr = specs + median;
-
- /* Test the first character */
- compare = c - specPtr->key[0];
- if (compare == 0) {
- /* Now test the entire string */
- compare = strcmp(string, specPtr->key);
- }
- if (compare < 0) {
- high = median - 1;
- } else if (compare > 0) {
- low = median + 1;
- } else {
- return specPtr;
- }
- }
- return NULL; /* Can't find operation */
-}
-
-static int
-ParseLine(Parser *parserPtr, ParserSpec *specs, int nSpecs,
- ClientData clientData)
-{
- ParserSpec *specPtr;
-
- specPtr = LookupKeyword(specs, nSpecs, parserPtr->argv[0]);
- if (specPtr == NULL) {
- ParserError(parserPtr, "unknown keyword \"%s\"", parserPtr->argv[0]);
- }
- if ((specPtr->nArgs > 0) && (specPtr->nArgs != parserPtr->argc)) {
- ParserError(parserPtr, "wrong # arguments for \"%s\"", specPtr->key);
- }
- if (specPtr->proc == NULL) {
- return TCL_OK;
- }
- return (*specPtr->proc)(parserPtr, clientData, specPtr->offset);
-}
-
-static int
-ParseEndSection(Parser *parserPtr, char *record, int offset)
-{
- return TCL_CONTINUE; /* Indicates end of section. */
-}
-
-static long
-LookupSymbol(AdobeFontMetrics *afmPtr, const char *symbol)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&afmPtr->symbolTable, symbol);
- if (hPtr != NULL) {
- return (long)Blt_GetHashValue(hPtr);
- }
- /*fprintf(stderr, "unknown symbol \"%s\"\n", symbol);*/
- return -1;
-}
-
-static void
-InitSymbolTable(AdobeFontMetrics *afmPtr)
-{
- Symbol *symPtr;
-
- Blt_InitHashTable(&afmPtr->symbolTable, BLT_STRING_KEYS);
- for (symPtr = isoLatin1Symbols; symPtr->name != NULL; symPtr++) {
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&afmPtr->symbolTable, symPtr->name, &isNew);
- Blt_SetHashValue(hPtr, (ClientData)(long)symPtr->code);
- }
-}
-
-static void
-UpdateSymbol(AdobeFontMetrics *afmPtr, long code, const char *symbol)
-{
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&afmPtr->symbolTable, symbol, &isNew);
-#ifdef notdef
- if (!isNew) {
- long oldCode;
-
- oldCode = (long)Blt_GetHashValue(hPtr);
- if (code != oldCode) {
- fprintf(stderr, "rewriting symbol %s with %d (was %ld)\n",
- symbol, code, oldCode);
- }
- }
-#endif
- Blt_SetHashValue(hPtr, (ClientData)code);
-}
-
-static void
-BuildKernPairsTable(AdobeFontMetrics *afmPtr)
-{
- KernPairs *kp, *kend;
-
- Blt_InitHashTable(&afmPtr->kernPairsTable,
- sizeof(KernPairsKey) / sizeof(int));
- for (kp = afmPtr->kernPairs, kend = kp + afmPtr->nKernPairs; kp < kend;
- kp++) {
- KernPairsKey key;
- Blt_HashEntry *hPtr;
- int isNew;
-
- memset(&key, 0, sizeof(key));
- key.first = kp->first;
- key.second = kp->second;
- hPtr = Blt_CreateHashEntry(&afmPtr->kernPairsTable, (char *)&key,
- &isNew);
- Blt_SetHashValue(hPtr, (ClientData)kp);
- }
-}
-
-static KernPairs *
-GetKernPairs(AdobeFontMetrics *afmPtr, int c1, int c2)
-{
- KernPairsKey key;
- Blt_HashEntry *hPtr;
-
- key.first = c1;
- key.second = c2;
-
- hPtr = Blt_FindHashEntry(&afmPtr->kernPairsTable, (char *)&key);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-static KernPairs *
-GetLigature(AdobeFontMetrics *afmPtr, int c1, int c2)
-{
- KernPairsKey key;
- Blt_HashEntry *hPtr;
-
- key.first = c1;
- key.second = c2;
-
- hPtr = Blt_FindHashEntry(&afmPtr->kernPairsTable, (char *)&key);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-
-static Ligature *
-NewLigature(Parser *parserPtr, int first, int second)
-{
- Blt_HashEntry *hPtr;
- Ligature *ligPtr;
- int isNew;
- LigatureKey key;
-
- key.first = first;
- key.second = second;
- ligPtr = Blt_Calloc(1, sizeof(Ligature));
- assert(ligPtr);
- hPtr = Blt_CreateHashEntry(&parserPtr->afmPtr->ligatureTable,
- (char *)&key, &isNew);
- Tcl_SetHashValue(hPtr, ligPtr);
- return ligPtr;
-}
-
-static Parser *
-NewParser(AdobeFontMetrics *afmPtr, const char *fileName)
-{
- Parser *parserPtr;
- Tcl_Channel channel;
-
- channel = Tcl_OpenFileChannel(NULL, fileName, "r", 0);
- if (channel == NULL) {
- fprintf(stderr, "can't open %s\n", fileName);
- return NULL;
- }
- if ((Tcl_SetChannelOption(NULL, channel, "-translation","auto")!=TCL_OK)||
- (Tcl_SetChannelOption(NULL, channel, "-eofchar", "\x1a") != TCL_OK)) {
- return NULL;
- }
- parserPtr = Blt_Calloc(1, sizeof(Parser));
- assert(parserPtr);
- parserPtr->channel = channel;
- parserPtr->afmPtr = afmPtr;
- InitSymbolTable(afmPtr);
- Tcl_DStringInit(&parserPtr->errors);
- Tcl_DStringAppend(&parserPtr->errors, "error reading \"", -1);
- Tcl_DStringAppend(&parserPtr->errors, fileName, -1);
- Tcl_DStringAppend(&parserPtr->errors, "\": ", -1);
- Tcl_DStringInit(&parserPtr->lastLine);
- return parserPtr;
-}
-
-static void
-DestroyParser(Parser *parserPtr)
-{
- if (parserPtr->argv != NULL) {
- Blt_Free((char *)parserPtr->argv);
- }
- Tcl_Close(NULL, parserPtr->channel);
- Tcl_DStringFree(&parserPtr->errors);
- Tcl_DStringFree(&parserPtr->lastLine);
- Blt_Free(parserPtr);
-}
-
-static void
-DestroyAdobeFontMetrics(AdobeFontMetrics *afmPtr)
-{
- if (afmPtr->afmVersion != NULL) {
- Blt_Free((char *)afmPtr->afmVersion);
- }
- if (afmPtr->characterSet != NULL) {
- Blt_Free((char *)afmPtr->characterSet);
- }
- if (afmPtr->comment != NULL) {
- Blt_Free((char *)afmPtr->comment);
- }
- if (afmPtr->copyright != NULL) {
- Blt_Free((char *)afmPtr->copyright);
- }
- if (afmPtr->encodingScheme != NULL) {
- Blt_Free((char *)afmPtr->encodingScheme);
- }
- if (afmPtr->familyName != NULL) {
- Blt_Free((char *)afmPtr->familyName);
- }
- if (afmPtr->fontName != NULL) {
- Blt_Free((char *)afmPtr->fontName);
- }
- if (afmPtr->fullName != NULL) {
- Blt_Free((char *)afmPtr->fullName);
- }
- if (afmPtr->notice != NULL) {
- Blt_Free((char *)afmPtr->notice);
- }
- if (afmPtr->version != NULL) {
- Blt_Free((char *)afmPtr->version);
- }
- if (afmPtr->weight != NULL) {
- Blt_Free((char *)afmPtr->weight);
- }
- if (afmPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&fontTable, afmPtr->hashPtr);
- }
- Blt_DeleteHashTable(&afmPtr->kernPairsTable);
- Blt_DeleteHashTable(&afmPtr->metricsTable);
- Blt_DeleteHashTable(&afmPtr->symbolTable);
- Blt_DeleteHashTable(&afmPtr->ligatureTable);
- if (afmPtr->kernPairs != NULL) {
- Blt_Free(afmPtr->kernPairs);
- }
- if (afmPtr->trackKern != NULL) {
- Blt_Free(afmPtr->trackKern);
- }
- Blt_Free((char *)afmPtr);
-}
-
-static int
-ParseInt(Parser *parserPtr, char *record, int offset)
-{
- int *valuePtr = (int *)(record + offset);
-
- if (Tcl_GetInt(NULL, parserPtr->argv[1], valuePtr) != TCL_OK) {
- ParserError(parserPtr, "can't convert \"%s\" to integer.",
- parserPtr->argv[1]);
- }
- return TCL_OK;
-}
-
-static int
-ParseHex(Parser *parserPtr, char *record, int offset)
-{
- int *valuePtr = (int *)(record + offset);
-
- return GetHexNumber(parserPtr, parserPtr->argv[1], valuePtr);
-}
-
-static int
-ParseBoolean(Parser *parserPtr, char *record, int offset)
-{
- int *valuePtr = (int *)(record + offset);
-
- if (Tcl_GetBoolean(NULL, parserPtr->argv[1], valuePtr) != TCL_OK) {
- ParserError(parserPtr, "can't convert \"%s\" to boolean.",
- parserPtr->argv[1]);
- }
- return TCL_OK;
-}
-
-
-static int
-ParseNumber(Parser *parserPtr, char *record, int offset)
-{
- float *valuePtr = (float *)(record + offset);
-
- return GetNumber(parserPtr, parserPtr->argv[1], valuePtr);
-}
-
-
-static int
-ParsePoint(Parser *parserPtr, char *record, int offset)
-{
- Point *pointPtr = (Point *)(record + offset);
-
- if ((GetNumber(parserPtr, parserPtr->argv[1], &pointPtr->x) != TCL_OK) ||
- (GetNumber(parserPtr, parserPtr->argv[2], &pointPtr->y) != TCL_OK)) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-ParseBBox(Parser *parserPtr, char *record, int offset)
-{
- CharBBox *bboxPtr = (CharBBox *)(record + offset);
-
- if ((GetNumber(parserPtr, parserPtr->argv[1], &bboxPtr->llx) != TCL_OK) ||
- (GetNumber(parserPtr, parserPtr->argv[2], &bboxPtr->lly) != TCL_OK) ||
- (GetNumber(parserPtr, parserPtr->argv[3], &bboxPtr->urx) != TCL_OK) ||
- (GetNumber(parserPtr, parserPtr->argv[4], &bboxPtr->ury) != TCL_OK)) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-ParseString(Parser *parserPtr, char *record, int offset)
-{
- char **args = (char **)(record + offset);
-
- if (*args != NULL) {
- Blt_Free(*args);
- *args = NULL;
- }
- *args = Tcl_Merge(parserPtr->argc - 1 , parserPtr->argv + 1);
- if (*args == NULL) {
- ParserError(parserPtr, "can't merge \"%s\" string.",
- parserPtr->argv[0]);
- }
- return TCL_OK;
-}
-
-static int
-ParseName(Parser *parserPtr, char *record, int offset)
-{
- const char **valuePtr = (const char **)(record + offset);
-
- if (*valuePtr != NULL) {
- Blt_Free((char *)*valuePtr);
- }
- *valuePtr = Blt_Strdup(parserPtr->argv[1]);
- return TCL_OK;
-}
-
-
-static int
-ParseStartComposites(Parser *parserPtr, char *record, int offset)
-{
- int *valuePtr = (int *)(record + offset);
- int n;
-
- assert(*valuePtr == 0);
- if (Tcl_GetInt(NULL, parserPtr->argv[1], &n) != TCL_OK) {
- ParserError(parserPtr, "can't convert \"%s\" to integer",
- parserPtr->argv[1]);
- }
- n++;
- *valuePtr = n;
- for (;;) {
- if (SplitNextLine(parserPtr) == TCL_RETURN) {
- ParserError(parserPtr, "unexpected EOF in StartComposites");
- }
- if (strcmp(parserPtr->argv[0], "EndComposites") == 0) {
- return TCL_OK;
- }
- }
- /*notreached*/
- return TCL_ERROR;
-}
-
-
-static ParserSpec directionSpecs[] = {
- { "CharWidth", 3, ParsePoint, FM(charWidth) },
- { "EndDirection", 1, ParseEndSection, 0 },
- { "IsFixedPitch", 2, ParseBoolean, FM(isFixedPitch) },
- { "ItalicAngle", 2, ParseNumber, FM(italicAngle) },
- { "UnderlinePosition", 2, ParseNumber, FM(underlinePosition) },
- { "UnderlineThickness",2, ParseNumber, FM(underlineThickness) }
-};
-static int nDirectionSpecs = sizeof(directionSpecs) / sizeof(ParserSpec);
-
-
-static int
-ParseStartDirection(Parser *parserPtr, char *record, int offset)
-{
- AdobeFontMetrics *afmPtr = (AdobeFontMetrics *)record;
- int *valuePtr = (int *)(record + offset);
- int n;
- int result;
-
- assert(*valuePtr == 0);
- if (Tcl_GetInt(NULL, parserPtr->argv[1], &n) != TCL_OK) {
- ParserError(parserPtr, "can't convert \"%s\" to integer.",
- parserPtr->argv[1]);
- }
- do {
- if (SplitNextLine(parserPtr) == TCL_RETURN) {
- ParserError(parserPtr, "unexpected EOF in StartDirection");
- }
- result = ParseLine(parserPtr, directionSpecs, nDirectionSpecs, afmPtr);
- } while (result == TCL_OK);
- if (result == TCL_CONTINUE) {
- return TCL_OK; /* Found EndKernPairs */
- }
- return TCL_ERROR;
-}
-
-static int
-ParseTrackKern(Parser *parserPtr, char *record, int offset)
-{
- TrackKern *tp = (TrackKern *)(record + offset);
-
- if ((GetNumber(parserPtr, parserPtr->argv[1], &tp->degree) != TCL_OK) ||
- (GetNumber(parserPtr, parserPtr->argv[2], &tp->minPointSize)!=TCL_OK) ||
- (GetNumber(parserPtr, parserPtr->argv[3], &tp->minKern) != TCL_OK) ||
- (GetNumber(parserPtr, parserPtr->argv[4], &tp->maxPointSize)!=TCL_OK) ||
- (GetNumber(parserPtr, parserPtr->argv[5], &tp->maxKern) != TCL_OK)) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static ParserSpec trackKernSpecs[] = {
- { "EndTrackKern", 1, ParseEndSection, 0 },
- { "TrackKern", 6, ParseTrackKern, 0 },
-};
-static int nTrackKernSpecs = sizeof(trackKernSpecs) / sizeof(ParserSpec);
-
-static int
-ParseStartTrackKern(Parser *parserPtr, char *record, int offset)
-{
- AdobeFontMetrics *afmPtr = (AdobeFontMetrics *)record;
- TrackKern *tp;
- int *valuePtr = (int *)(record + offset);
- int n;
- int result;
-
- assert(*valuePtr == 0);
- if (Tcl_GetInt(NULL, parserPtr->argv[1], &n) != TCL_OK) {
- ParserError(parserPtr, "can't convert \"%s\" to integer.",
- parserPtr->argv[1]);
- }
- n++;
- *valuePtr = n;
- afmPtr->trackKern = Blt_Calloc(n, sizeof(TrackKern));
- assert(afmPtr->trackKern);
- tp = afmPtr->trackKern;
- do {
- if (SplitNextLine(parserPtr) == TCL_RETURN) {
- ParserError(parserPtr, "unexpected EOF in StartTrackKern");
- }
- result = ParseLine(parserPtr, trackKernSpecs, nTrackKernSpecs, tp);
- tp++;
- } while (result == TCL_OK);
- if (result == TCL_CONTINUE) {
- assert((tp - afmPtr->trackKern) == n);
- return TCL_OK; /* Found EndTrackKern */
- }
- return TCL_ERROR;
-}
-
-
-static int
-ParseKP(Parser *parserPtr, char *record, int offset)
-{
- KernPairs *pairPtr = (KernPairs *)(record + offset);
-
- pairPtr->first = LookupSymbol(parserPtr->afmPtr, parserPtr->argv[1]);
- pairPtr->second = LookupSymbol(parserPtr->afmPtr, parserPtr->argv[2]);
- if ((GetNumber(parserPtr, parserPtr->argv[3], &pairPtr->x) != TCL_OK) ||
- (GetNumber(parserPtr, parserPtr->argv[4], &pairPtr->y) != TCL_OK)) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-ParseKPH(Parser *parserPtr, char *record, int offset)
-{
- KernPairs *pairPtr = (KernPairs *)(record + offset);
- int x, y;
-
- pairPtr->first = LookupSymbol(parserPtr->afmPtr, parserPtr->argv[1]);
- pairPtr->second = LookupSymbol(parserPtr->afmPtr, parserPtr->argv[2]);
- if ((GetHexNumber(parserPtr, parserPtr->argv[3], &x) != TCL_OK) ||
- (GetHexNumber(parserPtr, parserPtr->argv[4], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- pairPtr->x = (float)x;
- pairPtr->y = (float)y;
- return TCL_OK;
-}
-
-static int
-ParseKPX(Parser *parserPtr, char *record, int offset)
-{
- KernPairs *pairPtr = (KernPairs *)(record + offset);
-
- pairPtr->first = LookupSymbol(parserPtr->afmPtr, parserPtr->argv[1]);
- pairPtr->second = LookupSymbol(parserPtr->afmPtr, parserPtr->argv[2]);
- if (GetNumber(parserPtr, parserPtr->argv[3], &pairPtr->x) != TCL_OK) {
- return TCL_ERROR;
- }
- pairPtr->y = 0;
- return TCL_OK;
-}
-
-static int
-ParseKPY(Parser *parserPtr, char *record, int offset)
-{
- KernPairs *pairPtr = (KernPairs *)(record + offset);
-
- pairPtr->first = LookupSymbol(parserPtr->afmPtr, parserPtr->argv[1]);
- pairPtr->second = LookupSymbol(parserPtr->afmPtr, parserPtr->argv[2]);
- if (GetNumber(parserPtr, parserPtr->argv[3], &pairPtr->y) != TCL_OK) {
- return TCL_ERROR;
- }
- pairPtr->x = 0;
- return TCL_OK;
-}
-
-static ParserSpec kernPairsSpecs[] = {
- { "EndKernPairs", 1, ParseEndSection, 0 },
- { "KP", 5, ParseKP, 0 },
- { "KPH", 5, ParseKPH, 0 },
- { "KPX", 4, ParseKPX, 0 },
- { "KPY", 4, ParseKPY, 0 },
-};
-static int nKernPairsSpecs = sizeof(kernPairsSpecs) / sizeof(ParserSpec);
-
-static int
-ParseStartKernPairs(Parser *parserPtr, char *record, int offset)
-{
- AdobeFontMetrics *afmPtr = (AdobeFontMetrics *)record;
- int *valuePtr = (int *)(record + offset);
- int n;
- int result;
- KernPairs *kp;
-
- assert(*valuePtr == 0);
- if (Tcl_GetInt(NULL, parserPtr->argv[1], &n) != TCL_OK) {
- ParserError(parserPtr, "can't convert \"%s\" to integer.",
- parserPtr->argv[1]);
- }
- n++;
- *valuePtr = n;
- afmPtr->kernPairs = Blt_Calloc(n, sizeof(KernPairs));
- assert(afmPtr->kernPairs);
- kp = afmPtr->kernPairs;
- do {
- if (SplitNextLine(parserPtr) == TCL_RETURN) {
- ParserError(parserPtr, "unexpected EOF in StartKernPairs");
- }
- result = ParseLine(parserPtr, kernPairsSpecs, nKernPairsSpecs, kp);
- kp++;
- } while (result == TCL_OK);
- if (result == TCL_CONTINUE) {
- assert((kp - afmPtr->kernPairs) == *valuePtr);
- return TCL_OK; /* Found EndKernPairs */
- }
- return TCL_ERROR;
-}
-
-
-static ParserSpec kernDataSpecs[] = {
- { "EndKernData", 1, ParseEndSection, 0 },
- { "StartKernPairs", 2, ParseStartKernPairs, FM(nKernPairs) },
- { "StartKernPairs0", 2, ParseStartKernPairs, FM(nKernPairs) },
- { "StartKernPairs1", 2, ParseStartKernPairs, FM(nKernPairs) },
- { "StartTrackKern", 2, ParseStartTrackKern, FM(nTrackKern) },
-};
-static int nKernDataSpecs = sizeof(kernDataSpecs) / sizeof(ParserSpec);
-
-static int
-ParseStartKernData(Parser *parserPtr, char *record, int offset)
-{
- AdobeFontMetrics *afmPtr = (AdobeFontMetrics *)record;
- int result;
-
- do {
- if (SplitNextLine(parserPtr) == TCL_RETURN) {
- ParserError(parserPtr, "unexpected EOF in StartKernPairs");
- }
- result = ParseLine(parserPtr, kernDataSpecs, nKernDataSpecs, afmPtr);
- } while (result == TCL_OK);
- if (result == TCL_CONTINUE) {
- return TCL_OK; /* Found EndKernData */
- }
- return TCL_ERROR;
-}
-
-
-static int
-ParseLigature(Parser *parserPtr, char *record, int offset)
-{
-#ifdef notdef
- CharMetrics *cmPtr = (CharMetrics *)record;
- int successor;
-
- cmPtr->ligature = TRUE;
- successor = LookupSymbol(parserPtr->afmPtr, parserPtr->argv[1]);
- ligPtr = NewLigature(cmPtr->index, successor);
- ligPtr->name = Blt_Strdup(parserPtr->argv[2]);
-#endif
- return TCL_OK;
-}
-
-static ParserSpec charMetricsSpecs[] = {
- { "B", 5, ParseBBox, CM(bbox) },
- { "C", 2, ParseInt, CM(index) },
- { "CH", 2, ParseHex, CM(index) },
- { "EndCharMetrics", 1, ParseEndSection, 0 },
- { "L", 3, ParseLigature, CM(hasLigature) },
- { "N", 2, ParseName, CM(name) },
- { "VV", 3, ParsePoint, CM(vVector) },
- { "W", 3, ParsePoint, CM(w) },
- { "W0", 3, ParsePoint, CM(w) },
- { "W1", 3, ParsePoint, CM(w) },
- { "W0X", 2, ParseNumber, CM(w.x) },
- { "W0Y", 2, ParseNumber, CM(w.y) },
- { "W1X", 2, ParseNumber, CM(w.x) },
- { "W1Y", 2, ParseNumber, CM(w.y) },
- { "WX", 2, ParseNumber, CM(w.x) },
- { "WY", 2, ParseNumber, CM(w.y) }
-};
-static int nCharMetricsSpecs = sizeof(charMetricsSpecs) / sizeof(ParserSpec);
-
-static int
-ParseStartCharMetrics(Parser *parserPtr, char *record, int offset)
-{
- AdobeFontMetrics *afmPtr = (AdobeFontMetrics *)record;
- int *valuePtr = (int *)(record + offset);
- int count;
- int i;
-
- assert(*valuePtr == 0);
- if (Tcl_GetInt(NULL, parserPtr->argv[1], &i) != TCL_OK) {
- ParserError(parserPtr, "can't convert \"%s\" to integer.",
- parserPtr->argv[1]);
- }
- i++;
- *valuePtr = i;
- for(i = 0; i < 256; i++) {
- afmPtr->metrics[i].index = -1;
- }
- count = 0;
- for (;;) {
- int result;
- CharMetrics cm;
- const char *p;
-
- result = GetLine(parserPtr);
- if (result == TCL_RETURN) {
- ParserError(parserPtr, "unexpected EOF in StartCharMetrics");
- }
- memset(&cm, 0, sizeof(CharMetrics));
- for(p = strtok(Tcl_DStringValue(&parserPtr->lastLine), ";"); p != NULL;
- p = strtok(NULL, ";")) {
- SplitLine(parserPtr, p);
- if (parserPtr->argc == 0) {
- continue;
- }
- result = ParseLine(parserPtr, charMetricsSpecs, nCharMetricsSpecs,
- &cm);
- if (result != TCL_OK) {
- break;
- }
- }
- count++;
- if (cm.index != -1) {
- if (cm.name != NULL) {
- UpdateSymbol(parserPtr->afmPtr, cm.index, cm.name);
- }
- afmPtr->metrics[cm.index] = cm;
- }
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (result == TCL_CONTINUE) {
- assert(count == *valuePtr);
- return TCL_OK; /* Found EndCharMetrics */
- }
- }
- return TCL_ERROR;
-}
-
-static ParserSpec fontMetricsSpecs[] = {
- { "Ascender", 2, ParseNumber, FM(ascender) },
- { "CapHeight", 2, ParseNumber, FM(capHeight) },
- { "CharWidth", 3, ParsePoint, FM(charWidth) },
- { "CharacterSet", 0, ParseString, FM(characterSet) },
- { "Characters", 2, ParseInt, FM(characters) },
- { "Comment", 0, NULL, FM(comment) },
- { "Copyright", 0, NULL, FM(copyright) },
- { "Descender", 2, ParseNumber, FM(descender) },
- { "EncodingScheme", 0, ParseString, FM(encodingScheme) },
- { "EndFontMetrics", 1, ParseEndSection, 0 },
- { "EscChar", 2, ParseInt, FM(escChar) },
- { "FamilyName", 0, ParseString, FM(familyName) },
- { "FontBBox", 5, ParseBBox, FM(fontBBox) },
- { "FontName", 0, ParseString, FM(fontName) },
- { "FullName", 0, ParseString, FM(fullName) },
- { "IsBaseFont", 2, ParseBoolean, FM(isBaseFont) },
- { "IsCIDFont", 2, ParseBoolean, FM(isCIDFont) },
- { "IsFixedPitch", 2, ParseBoolean, FM(isFixedPitch) },
- { "IsFixedV", 2, ParseBoolean, FM(isFixedV) },
- { "ItalicAngle", 2, ParseNumber, FM(italicAngle) },
- { "MappingScheme", 2, ParseInt, FM(mappingScheme) },
- { "MetricSets", 2, ParseInt, FM(metricSets) },
- { "Notice", 0, NULL, FM(notice) },
- { "StartCharMetrics", 2, ParseStartCharMetrics, FM(nCharMetrics) },
- { "StartComposites", 2, ParseStartComposites, FM(nComposites) },
- { "StartDirection", 2, ParseStartDirection, FM(nDirection) },
- { "StartKernData", 1, ParseStartKernData, 0 },
- { "StdHW", 2, ParseNumber, FM(stdHW) },
- { "StdVW", 2, ParseNumber, FM(stdVW) },
- { "UnderlinePosition", 2, ParseNumber, FM(underlinePosition) },
- { "UnderlineThickness", 2, ParseNumber, FM(underlineThickness) },
- { "VVector", 2, ParsePoint, FM(vVector) },
- { "Version", 0, ParseString, FM(version) },
- { "Weight", 0, ParseString, FM(weight) },
- { "XHeight", 2, ParseNumber, FM(xHeight) }
-};
-static int nFontMetricsSpecs = sizeof(fontMetricsSpecs) / sizeof(ParserSpec);
-
-static int
-ParseStartFontMetrics(Parser *parserPtr, char *record, int offset)
-{
- AdobeFontMetrics *afmPtr = (AdobeFontMetrics *)record;
- const char **versionPtr = (const char **)(record + offset);
- int result;
-
- assert(*versionPtr == NULL);
- *versionPtr = Blt_Strdup(parserPtr->argv[1]);
- do {
- if (SplitNextLine(parserPtr) == TCL_RETURN) {
- ParserError(parserPtr, "unexpected EOF in StartFontMetrics");
- }
- result = ParseLine(parserPtr, fontMetricsSpecs, nFontMetricsSpecs,
- afmPtr);
- } while (result == TCL_OK);
- if (result == TCL_CONTINUE) {
- return TCL_OK; /* Found EndFontMetrics */
- }
- return TCL_ERROR;
-}
-
-static ParserSpec afmSpecs[] = {
- { "StartFontMetrics", 2, ParseStartFontMetrics, FM(afmVersion) },
-};
-static int nAfmSpecs = sizeof(afmSpecs) / sizeof(ParserSpec);
-
-static AdobeFontMetrics *
-ParseAdobeFontMetricsFile(Tcl_Interp *interp, const char *fileName)
-{
- AdobeFontMetrics *afmPtr;
- Parser *parserPtr;
- int result;
-
- afmPtr = Blt_Calloc(1, sizeof(AdobeFontMetrics));
- assert(afmPtr);
- parserPtr = NewParser(afmPtr, fileName);
- if (parserPtr == NULL) {
- Blt_Free(afmPtr);
- return NULL;
- }
- /* Set up jump for errors. */
- if (setjmp(parserPtr->jmpbuf)) {
- fprintf(stderr, "%s\n", Tcl_DStringValue(&parserPtr->errors));
- DestroyParser(parserPtr);
- DestroyAdobeFontMetrics(afmPtr);
- return NULL;
- }
- for (;;) {
- result = SplitNextLine(parserPtr);
- if (result == TCL_RETURN) {
- break;
- }
- result = ParseLine(parserPtr, afmSpecs, nAfmSpecs, afmPtr);
- }
- DestroyParser(parserPtr);
- if (result != TCL_RETURN) {
- DestroyAdobeFontMetrics(afmPtr);
- return NULL;
- }
- BuildKernPairsTable(afmPtr);
- return afmPtr;
-}
-
-typedef struct {
- const char *alias;
- const char *fontName;
-} FontMap;
-
-static FontMap psFontMap[] =
-{
- { "Arial", "Helvetica" },
- { "AvantGarde", "AvantGarde" },
- { "Bookman", "Bookman" },
- { "Courier New", "Courier" },
- { "Courier", "Courier" },
- { "Geneva", "Helvetica" },
- { "Helvetica", "Helvetica" },
- { "Mathematica1", "Helvetica" },
- { "Monaco", "Courier" },
- { "New Century Schoolbook", "NewCenturySchlbk" },
- { "New York", "Times" },
- { "Nimbus Roman No9 L" "Times" },
- { "Nimbus Sans L Condensed","Helvetica" },
- { "Nimbus Sans L", "Helvetica" },
- { "Palatino", "Palatino" },
- { "Standard Symbols L", "Symbol" },
- { "Symbol", "Symbol" },
- { "Times New Roman", "Times" },
- { "Times Roman", "Times" },
- { "Times", "Times" },
- { "ZapfChancery", "ZapfChancery" },
- { "ZapfDingbats", "ZapfDingbats" }
-};
-static int nPsFonts = sizeof(psFontMap) / sizeof(FontMap);
-/*
- *---------------------------------------------------------------------------
- *
- * LookupFontName --
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-LookupFontName(const char *string)
-{
- char c;
- int high, low;
-
- low = 0;
- high = nPsFonts - 1;
- c = string[0];
- while (low <= high) {
- FontMap *mapPtr;
- int compare;
- int median;
-
- median = (low + high) >> 1;
- mapPtr = psFontMap + median;
-
- /* Test the first character */
- compare = c - mapPtr->alias[0];
- if (compare == 0) {
- /* Now test the entire string */
- compare = strcmp(string, mapPtr->alias);
- }
- if (compare < 0) {
- high = median - 1;
- } else if (compare > 0) {
- low = median + 1;
- } else {
- return mapPtr->fontName;
- }
- }
- return "Helvetica"; /* Can't find font. */
-}
-
-static AdobeFontMetrics *
-GetAdobeFontMetrics(Tcl_Interp *interp, const char *psFontName)
-{
- AdobeFontMetrics *afmPtr;
- Blt_HashEntry *hPtr;
- int isNew;
-
- if (!initialized) {
- Blt_InitHashTable(&fontTable, BLT_STRING_KEYS);
- initialized = TRUE;
- }
-#ifdef notdef
- fprintf(stderr, "Lookup for %s\n", psFontName);
-#endif
- psFontName = LookupFontName(psFontName);
-#ifdef notdef
- fprintf(stderr, "returning %s\n", psFontName);
-#endif
- hPtr = Blt_CreateHashEntry(&fontTable, psFontName, &isNew);
- if (isNew) {
- const char *path;
- Tcl_DString ds;
-
- path = Tcl_GetVar(interp, "blt_library", TCL_GLOBAL_ONLY);
- if (path == NULL) {
- Tcl_AppendResult(interp, "can't find \"blt_library\" variable",
- (char *)NULL);
- Blt_DeleteHashEntry(&fontTable, hPtr);
- return NULL;
- }
- Tcl_DStringInit(&ds);
- Tcl_DStringAppend(&ds, path, -1);
- Tcl_DStringAppend(&ds, "/afm/", 5);
- Tcl_DStringAppend(&ds, psFontName, -1);
- Tcl_DStringAppend(&ds, ".afm", 4);
- afmPtr = ParseAdobeFontMetricsFile(interp, Tcl_DStringValue(&ds));
- Tcl_DStringFree(&ds);
- if (afmPtr == NULL) {
- Blt_DeleteHashEntry(&fontTable, hPtr);
- return NULL;
- }
- Blt_SetHashValue(hPtr, afmPtr);
- afmPtr->hashPtr = hPtr;
- } else {
- afmPtr = Blt_GetHashValue(hPtr);
- }
- return afmPtr;
-}
-
-static AdobeFontMetrics *
-GetAdobeFontMetricsFromFont(Blt_Font font)
-{
- AdobeFontMetrics *afmPtr;
- Tcl_DString ds;
- double pointSize;
- Tcl_Interp *interp;
-
- Tcl_DStringInit(&ds);
- pointSize = Blt_PostscriptFontName(font, &ds);
- interp = Blt_GetFontInterp(font);
- afmPtr = GetAdobeFontMetrics(interp, Tcl_DStringValue(&ds));
- Tcl_DStringFree(&ds);
- if (afmPtr != NULL) {
- afmPtr->pointSize = pointSize;
- return afmPtr;
- }
- return NULL;
-}
-
-int
-Blt_Ps_GetFontMetrics(Blt_Font font, Blt_FontMetrics *fmPtr)
-{
- AdobeFontMetrics *afmPtr;
-
- afmPtr = GetAdobeFontMetricsFromFont(font);
- if (afmPtr == NULL) {
- return TCL_ERROR;
- }
-#ifndef notdef
- fmPtr->ascent = Points(afmPtr, afmPtr->ascender);
-#else
- fmPtr->ascent = Points(afmPtr, afmPtr->capHeight);
-#endif
- fmPtr->descent = Points(afmPtr, -afmPtr->descender);
- fmPtr->linespace = Points(afmPtr, afmPtr->ascender - afmPtr->descender);
-#ifdef notdef
- fprintf(stderr, "GetFontMetrics(%s), ascent=%d descent=%d linespace=%d\n",
- Blt_NameOfFont(font), fmPtr->ascent, fmPtr->descent,
- fmPtr->linespace);
-#endif
- return TCL_OK;
-}
-
-int
-Blt_Ps_TextWidth(Blt_Font font, const char *string, int nBytes)
-{
- AdobeFontMetrics *afmPtr;
- const char *p, *pend;
- float width;
-
-#ifdef notdef
- fprintf(stderr, "Ps_TextWidth(%s,\"%s\")\n", Blt_NameOfFont(font),
- string);
-#endif
- afmPtr = GetAdobeFontMetricsFromFont(font);
- if (afmPtr == NULL) {
- fprintf(stderr, "can't find font\n");
- return -1;
- }
- width = 0;
-#ifdef notdef
- fprintf(stderr, "string=\"%s\"\n", string);
-#endif
- for (p = string, pend = string + nBytes; p < pend; /*empty*/) {
- CharMetrics *cmPtr;
- unsigned char c;
- Tcl_UniChar ch;
-
- p += Tcl_UtfToUniChar(p, &ch);
- c = (unsigned char)(ch & 0xff);
- cmPtr = afmPtr->metrics + c;
- if (cmPtr->index < 0) {
- continue; /* Ignore unencoded characters. */
- }
-#ifdef notdef
- fprintf(stderr, "width=%g, incr=%g, char=%c\n",
- width, cmPtr->w.x, c);
-#endif
- width += cmPtr->w.x;
- }
- {
- /* Kerning */
- unsigned char c1, c2;
- Tcl_UniChar ch;
-
- p = string;
- p += Tcl_UtfToUniChar(string, &ch);
- c1 = (unsigned char)(ch & 0xff);
- while (p < pend) {
- p += Tcl_UtfToUniChar(p, &ch);
- c2 = (unsigned char)(ch & 0xff);
- if (afmPtr->metrics[c1].hasKernPair) {
- KernPairs *kp;
-
- kp = GetKernPairs(afmPtr, c1, c2);
- width += kp->x;
- }
- c1 = c2;
- }
- }
-#ifdef notdef
- fprintf(stderr, "StringWidth of \"%s\" is %d (ps=%f)\n",
- string, Points(afmPtr, width), afmPtr->pointSize);
-#endif
- return Points(afmPtr, width);
-}
-
-
-static int
-LoadOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- AdobeFontMetrics *afmPtr;
-
- afmPtr = ParseAdobeFontMetricsFile(interp, Tcl_GetString(objv[2]));
- if (afmPtr == NULL) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-DumpOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- AdobeFontMetrics *afmPtr;
- const char *fileName;
- int i;
-
- fileName = Tcl_GetString(objv[2]);
- afmPtr = ParseAdobeFontMetricsFile(interp, fileName);
- if (afmPtr == NULL) {
- return TCL_ERROR;
- }
- if (afmPtr->familyName != NULL) {
- Tcl_AppendElement(interp, "familyName");
- Tcl_AppendElement(interp, afmPtr->familyName);
- }
- if (afmPtr->fontName != NULL) {
- Tcl_AppendElement(interp, "fontName");
- Tcl_AppendElement(interp, afmPtr->fontName);
- }
- if (afmPtr->fullName != NULL) {
- Tcl_AppendElement(interp, "fullName");
- Tcl_AppendElement(interp, afmPtr->fullName);
- }
- if (afmPtr->version != NULL) {
- Tcl_AppendElement(interp, "version");
- Tcl_AppendElement(interp, afmPtr->version);
- }
- if (afmPtr->weight != NULL) {
- Tcl_AppendElement(interp, "weight");
- Tcl_AppendElement(interp, afmPtr->weight);
- }
- if (afmPtr->comment != NULL) {
- Tcl_AppendElement(interp, "comment");
- Tcl_AppendElement(interp, afmPtr->comment);
- }
- if (afmPtr->notice != NULL) {
- Tcl_AppendElement(interp, "notice");
- Tcl_AppendElement(interp, afmPtr->notice);
- }
- if (afmPtr->characterSet != NULL) {
- Tcl_AppendElement(interp, "characterSet");
- Tcl_AppendElement(interp, afmPtr->characterSet);
- }
- if (afmPtr->encodingScheme != NULL) {
- Tcl_AppendElement(interp, "encodingScheme");
- Tcl_AppendElement(interp, afmPtr->encodingScheme);
- }
- Tcl_AppendElement(interp, "underlinePosition");
- Tcl_AppendElement(interp, FTOA(afmPtr->underlinePosition));
- Tcl_AppendElement(interp, "underlineThickness");
- Tcl_AppendElement(interp, FTOA(afmPtr->underlineThickness));
- Tcl_AppendElement(interp, "italicAngle");
- Tcl_AppendElement(interp, FTOA(afmPtr->italicAngle));
- Tcl_AppendElement(interp, "capHeight");
- Tcl_AppendElement(interp, FTOA(afmPtr->capHeight));
- Tcl_AppendElement(interp, "xHeight");
- Tcl_AppendElement(interp, FTOA(afmPtr->xHeight));
- Tcl_AppendElement(interp, "ascender");
- Tcl_AppendElement(interp, FTOA(afmPtr->ascender));
- Tcl_AppendElement(interp, "descender");
- Tcl_AppendElement(interp, FTOA(afmPtr->descender));
-
- Tcl_AppendElement(interp, "isFixedPitch");
- Tcl_AppendElement(interp, Blt_Itoa(afmPtr->isFixedPitch));
- Tcl_AppendElement(interp, "isBaseFont");
- Tcl_AppendElement(interp, Blt_Itoa(afmPtr->isBaseFont));
- Tcl_AppendElement(interp, "isCIDFont");
- Tcl_AppendElement(interp, Blt_Itoa(afmPtr->isCIDFont));
- Tcl_AppendElement(interp, "isFixedV");
- Tcl_AppendElement(interp, Blt_Itoa(afmPtr->isFixedV));
- Tcl_AppendElement(interp, "nCharMetrics");
- Tcl_AppendElement(interp, Blt_Itoa(afmPtr->nCharMetrics));
- Tcl_AppendElement(interp, "nComposites");
- Tcl_AppendElement(interp, Blt_Itoa(afmPtr->nComposites));
- Tcl_AppendElement(interp, "nDirection");
- Tcl_AppendElement(interp, Blt_Itoa(afmPtr->nDirection));
- Tcl_AppendElement(interp, "nKernPairs");
- Tcl_AppendElement(interp, Blt_Itoa(afmPtr->nKernPairs));
- Tcl_AppendElement(interp, "nTrackKern");
- Tcl_AppendElement(interp, Blt_Itoa(afmPtr->nTrackKern));
- Tcl_AppendElement(interp, "escChar");
- Tcl_AppendElement(interp, Blt_Itoa(afmPtr->escChar));
- Tcl_AppendElement(interp, "vvector x");
- Tcl_AppendElement(interp, FTOA(afmPtr->vVector.x));
- Tcl_AppendElement(interp, "vvector y");
- Tcl_AppendElement(interp, FTOA(afmPtr->vVector.y));
- Tcl_AppendElement(interp, "stdHW");
- Tcl_AppendElement(interp, FTOA(afmPtr->stdHW));
- Tcl_AppendElement(interp, "stdVW");
- Tcl_AppendElement(interp, FTOA(afmPtr->stdVW));
- for (i = 0; i < 256; i++) {
- if (afmPtr->metrics[i].index >= 0) {
- if (afmPtr->metrics[i].hasLigature) {
-
- Tcl_AppendElement(interp, "index");
- Tcl_AppendElement(interp, "x");
- Tcl_AppendElement(interp, FTOA(afmPtr->metrics[i].w.x));
- Tcl_AppendElement(interp, "y");
- Tcl_AppendElement(interp, FTOA(afmPtr->metrics[i].w.y));
- Tcl_AppendElement(interp, FTOA(afmPtr->metrics[i].index));
- if (afmPtr->metrics[i].name != NULL) {
- int code;
- code = LookupSymbol(afmPtr, afmPtr->metrics[i].name);
- if (code != afmPtr->metrics[i].index) {
- fprintf(stderr, "index=%d, code=%d, name=%s\n",
- afmPtr->metrics[i].index, code,
- afmPtr->metrics[i].name);
- }
-
- Tcl_AppendElement(interp, "name");
- Tcl_AppendElement(interp, afmPtr->metrics[i].name);
- }
- Tcl_AppendElement(interp, "llx");
- Tcl_AppendElement(interp, FTOA(afmPtr->metrics[i].bbox.llx));
- Tcl_AppendElement(interp, "lly");
- Tcl_AppendElement(interp, FTOA(afmPtr->metrics[i].bbox.lly));
- Tcl_AppendElement(interp, "urx");
- Tcl_AppendElement(interp, FTOA(afmPtr->metrics[i].bbox.urx));
- Tcl_AppendElement(interp, "ury");
- Tcl_AppendElement(interp, FTOA(afmPtr->metrics[i].bbox.ury));
- }
- }
- }
- DestroyAdobeFontMetrics(afmPtr);
- return TCL_OK;
-}
-
-static Blt_OpSpec afmOps[] =
-{
- {"dump", 1, DumpOp, 3, 3, "fileName",},
- {"load", 1, LoadOp, 3, 3, "fileName",},
-};
-static int nAfmOps = sizeof(afmOps) / sizeof(Blt_OpSpec);
-
-
-static int
-AfmCmdProc(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nAfmOps, afmOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (clientData, interp, objc, objv);
- return result;
-}
-
-
-int
-Blt_AfmCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {
- "afm", AfmCmdProc,
- };
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-
-static int
-AfmStringWidthOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- AdobeFontMetrics *afmPtr;
-
- afmPtr = ParseAdobeFontMetricsFile(interp, Tcl_GetString(objv[2]));
- if (afmPtr == NULL) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
diff --git a/blt3.0.1/src/bltPsInt.h b/blt3.0.1/src/bltPsInt.h
deleted file mode 100644
index 4b552c4..0000000
--- a/blt3.0.1/src/bltPsInt.h
+++ /dev/null
@@ -1,49 +0,0 @@
-
-/*
- * bltPsInt.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_PS_INT_H
-#define _BLT_PS_INT_H
-
-#include "bltPs.h"
-
-struct _Blt_Ps {
- Tcl_Interp *interp; /* Interpreter to report errors to. */
-
- Tcl_DString dString; /* Dynamic string used to contain the
- * PostScript generated. */
- PageSetup *setupPtr;
-
-#define POSTSCRIPT_BUFSIZ ((BUFSIZ*2)-1)
- /*
- * Utility space for building strings. Currently used to create
- * PostScript output for the "postscript" command.
- */
- char scratchArr[POSTSCRIPT_BUFSIZ+1];
-};
-
-typedef struct _Blt_Ps PostScript;
-
-#endif /* BLT_PS_H */
diff --git a/blt3.0.1/src/bltRound.h b/blt3.0.1/src/bltRound.h
deleted file mode 100644
index e66b0fa..0000000
--- a/blt3.0.1/src/bltRound.h
+++ /dev/null
@@ -1,32 +0,0 @@
-
-#if (SIZEOF_FLOAT == 8)
-#define REAL64 float
-#else
-#define REAL64 double
-#endif /* SIZE_VOID_P == 8 */
-
-#define DOUBLE_MAGIC 6755399441055744.0
-#define DEFAULT_CONVERSION 1
-#ifdef WORDS_BIGENDIAN
-#define IMAN 1
-#define IEXP 0
-#else
-#define IMAN 0
-#define IEXP 1
-#endif /* WORDS_BIGENDIAN */
-
-static INLINE int
-CRoundToInt(REAL64 val)
-{
-#if DEFAULT_CONVERSION==0
- val += DOUBLE_MAGIC;
-#ifdef WORDS_BIGENDIAN
- return ((int *)&val)[1];
-#else
- return ((int *)&val)[0];
-#endif /* WORD_BIGENDIAN */
-#else
- return (int)(floor(val+.5));
-#endif /* DEFAULT_CONVERSION */
-}
-
diff --git a/blt3.0.1/src/bltScrollbar.c b/blt3.0.1/src/bltScrollbar.c
deleted file mode 100644
index 0b4785a..0000000
--- a/blt3.0.1/src/bltScrollbar.c
+++ /dev/null
@@ -1,1349 +0,0 @@
-
-/*
- * bltScrollbar.c --
- *
- * This module implements a scrollbar widgets for the Tk toolkit. A
- * scrollbar displays a slider and two arrows; mouse clicks on features
- * within the scrollbar cause scrolling commands to be invoked.
- *
- * Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994-1995 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * SCCS: @(#) tkScrollbar.c 1.79 96/02/15 18:52:40
- */
-
-#include "bltInt.h"
-#ifndef NO_TKSCROLLBAR
-
-#include "bltBgStyle.h"
-
-#define NORMAL_BG "#d9d9d9"
-#define ACTIVE_BG "#ececec"
-#define SELECT_BG "#c3c3c3"
-#define TROUGH "#c3c3c3"
-#define INDICATOR "#b03060"
-#define DISABLED "#a3a3a3"
-
-/*
- * Defaults for scrollbars:
- */
-#define DEF_ACTIVE_BACKGROUND ACTIVE_BG
-#define DEF_ACTIVE_BG_MONO RGB_BLACK
-#define DEF_ACTIVE_RELIEF "raised"
-#define DEF_ARROW_COLOR "black"
-#define DEF_DISABLED_ARROW_COLOR RGB_GREY50
-#define DEF_BACKGROUND NORMAL_BG
-#define DEF_BG_MONO RGB_WHITE
-#define DEF_BORDERWIDTH "2"
-#define DEF_COMMAND ""
-#define DEF_CURSOR ""
-#define DEF_ELEMENT_BORDERWIDTH "1"
-#define DEF_HIGHLIGHT RGB_BLACK
-#define DEF_HIGHLIGHT_BG NORMAL_BG
-#define DEF_HIGHLIGHT_WIDTH "2"
-#define DEF_JUMP "0"
-#define DEF_MIN_SLIDER_LENGTH "12"
-#define DEF_ORIENT "vertical"
-#define DEF_RELIEF "sunken"
-#define DEF_REPEAT_DELAY "300"
-#define DEF_REPEAT_INTERVAL "100"
-#define DEF_SELECT_BACKGROUND SELECT_BG
-#define DEF_TAKE_FOCUS (char *)NULL
-#define DEF_TROUGH_COLOR "grey" /*TROUGH*/
-#define DEF_TROUGH_MONO RGB_WHITE
-#define DEF_WIDTH "3.0m"
-#define DEF_SELECT_RELIEF "sunken"
-#define SB_WIDTH 15
-
-/*
- * A data structure of the following type is kept for each scrollbar widget
- * managed by this file:
- */
-
-typedef struct {
- Tk_Window tkwin; /* Window that embodies the scrollbar.
- * NULL means that the window has been
- * destroyed but the data structures
- * haven't yet been cleaned up.*/
- Display *display; /* Display containing widget. Used,
- * among other things, so that
- * resources can be freed even after
- * tkwin has gone away. */
- Tcl_Interp *interp; /* Interpreter associated with
- * scrollbar. */
- Tcl_Command widgetCmd; /* Token for scrollbar's widget
- * command. */
- char *orientation; /* Orientation for window ("vertical"
- * or "horizontal"). */
- int vertical; /* Non-zero means vertical orientation
- * requested, zero means horizontal. */
- int width; /* Desired narrow dimension of
- * scrollbar, in pixels. */
- char *command; /* Command prefix to use when invoking
- * scrolling commands. NULL means don't
- * invoke commands. Malloc'ed. */
- int commandSize; /* Number of non-NULL bytes in
- * command. */
- int repeatDelay; /* How long to wait before
- * auto-repeating on scrolling actions
- * (in * ms). */
- int repeatInterval; /* Interval between autorepeats (in
- * ms). */
- int jump; /* Value of -jump option. */
-
- /*
- * Information used when displaying widget:
- */
- int borderWidth; /* Width of 3-D borders. */
- Blt_Background bg; /* Used for drawing background (all flat
- * surfaces except for trough). */
- Blt_Background activeBg; /* For drawing backgrounds when active
- * (i.e. when mouse is positioned
- * over element). */
- Blt_Background selBg;
- Blt_Background troughBg; /* For drawing trough. */
- GC copyGC; /* Used for copying from pixmap onto
- screen. */
- XColor *disabledArrowColor; /* Used for drawing the arrow. */
- XColor *arrowColor; /* Used for drawing the arrow. */
- int relief; /* Indicates whether window as a whole
- * is raised, sunken, or flat. */
- int highlightWidth; /* Width in pixels of highlight to
- * draw around widget when it has the
- * focus. <= 0 means don't draw a
- * highlight. */
- XColor *highlightBgColorPtr; /* Color for drawing traversal
- * highlight area when highlight is
- * off. */
- XColor *highlightColorPtr; /* Color for drawing traversal
- * highlight. */
- int inset; /* Total width of all borders,
- * including traversal highlight and
- * 3-D * border. Indicates how much
- * interior stuff must be offset from
- * outside edges to leave room for
- * borders. */
- int minSliderLength; /* Minimum size of thumb. */
- int elementBW; /* Width of border to draw around
- * elements inside scrollbar (arrows
- * and * slider). -1 means use
- * borderWidth. */
- int arrowLength; /* Length of arrows along long
- * dimension of scrollbar, including
- * space for a small gap between the
- * arrow and the slider. Recomputed
- * on window size changes. */
- int sliderFirst; /* Pixel coordinate of top or left
- * edge of slider area, including
- * border. */
- int sliderLast; /* Coordinate of pixel just after
- * bottom or right edge of slider
- * area, including border. */
- int activeField; /* Names field to be displayed in
- * active colors, such as TOP_ARROW,
- * or 0 for no field. */
- int activeRelief; /* Value of -activeRelief option:
- * relief to use for active element. */
- int selRelief;
- int selField; /* Names field to be displayed in
- * active colors, such as TOP_ARROW,
- * or 0 for no field. */
- /*
- * Information describing the application related to the scrollbar. This
- * information is provided by the application by invoking the "set" widget
- * command. This information can now be provided in two ways: the "old"
- * form (totalUnits, windowUnits, firstUnit, and lastUnit), or the "new"
- * form (firstFraction and lastFraction). FirstFraction and lastFraction
- * will always be valid, but the old-style information is only valid if
- * the NEW_STYLE_COMMANDS flag is 0.
- */
-
- int totalUnits; /* Total dimension of application, in
- * units. Valid only if the
- * NEW_STYLE_COMMANDS flag isn't
- * set. */
- int windowUnits; /* Maximum number of units that can be
- * displayed in the window at once.
- * Valid * only if the
- * NEW_STYLE_COMMANDS flag isn't
- * set. */
- int firstUnit; /* Number of last unit visible in
- * application's window. Valid only
- * if the NEW_STYLE_COMMANDS flag
- * isn't set. */
- int lastUnit; /* Index of last unit visible in
- * window. Valid only if the
- * NEW_STYLE_COMMANDS flag isn't set. */
- double firstFraction; /* Position of first visible thing in
- * window, specified as a fraction
- * between 0 and 1.0. */
- double lastFraction; /* Position of last visible thing in
- * window, specified as a fraction
- * between 0 and 1.0. */
- /*
- * Miscellaneous information:
- */
- Tk_Cursor cursor; /* Current cursor for window, or
- * None. */
- char *takeFocus; /* Value of -takefocus option; not
- * used in the C code, but used by
- * keyboard traversal scripts.
- * Malloc'ed, but may be * NULL. */
- int flags; /* Various flags; see below for
- * definitions. */
-} Scrollbar;
-
-/*
- * Legal values for "activeField" field of Scrollbar structures. These are
- * also the return values from the ScrollbarPosition procedure.
- */
-
-#define OUTSIDE 0
-#define TOP_ARROW 1
-#define TOP_GAP 2
-#define SLIDER 3
-#define BOTTOM_GAP 4
-#define BOTTOM_ARROW 5
-
-/*
- * Flag bits for scrollbars:
- *
- * REDRAW_PENDING: Non-zero means a DoWhenIdle handler
- * has already been queued to redraw
- * this window.
- * NEW_STYLE_COMMANDS: Non-zero means the new style of commands
- * should be used to communicate with the
- * widget: ".t yview scroll 2 lines", instead
- * of ".t yview 40", for example.
- * GOT_FOCUS: Non-zero means this window has the input
- * focus.
- */
-
-#define REDRAW_PENDING 1
-#define NEW_STYLE_COMMANDS 2
-#define GOT_FOCUS 4
-
-/*
- * Minimum slider length, in pixels (designed to make sure that the slider
- * is always easy to grab with the mouse).
- */
-
-#define MIN_SLIDER_LENGTH 12
-
-/*
- * Information used for objv parsing.
- */
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "Foreground", DEF_ACTIVE_BACKGROUND, Blt_Offset(Scrollbar, activeBg),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "Foreground", DEF_ACTIVE_BG_MONO, Blt_Offset(Scrollbar, activeBg),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_RELIEF, "-activerelief", "activeRelief", "Relief",
- DEF_ACTIVE_RELIEF, Blt_Offset(Scrollbar, activeRelief), 0},
- {BLT_CONFIG_COLOR, "-arrowcolor", "arrowColor", "ArrowColor",
- DEF_ARROW_COLOR, Blt_Offset(Scrollbar, arrowColor), 0},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_BACKGROUND, Blt_Offset(Scrollbar, bg), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_BG_MONO, Blt_Offset(Scrollbar, bg), BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_BORDERWIDTH, Blt_Offset(Scrollbar, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-command", "command", "Command",
- DEF_COMMAND, Blt_Offset(Scrollbar, command),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_CURSOR, Blt_Offset(Scrollbar, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-diabledarrowcolor", "disabledArrowColor",
- "DisabledArrowColor", DEF_DISABLED_ARROW_COLOR,
- Blt_Offset(Scrollbar, disabledArrowColor), 0},
- {BLT_CONFIG_PIXELS, "-elementborderwidth", "elementBorderWidth",
- "BorderWidth", DEF_ELEMENT_BORDERWIDTH,
- Blt_Offset(Scrollbar, elementBW), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_HIGHLIGHT_BG,
- Blt_Offset(Scrollbar, highlightBgColorPtr), 0},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_HIGHLIGHT,
- Blt_Offset(Scrollbar, highlightColorPtr), 0},
- {BLT_CONFIG_PIXELS, "-highlightthickness", "highlightThickness",
- "HighlightThickness",
- DEF_HIGHLIGHT_WIDTH, Blt_Offset(Scrollbar, highlightWidth), 0},
- {BLT_CONFIG_BOOLEAN, "-jump", "jump", "Jump",
- DEF_JUMP, Blt_Offset(Scrollbar, jump), 0},
- {BLT_CONFIG_PIXELS_POS, "-minsliderlength", "minSliderLength",
- "MinSliderLength", DEF_MIN_SLIDER_LENGTH,
- Blt_Offset(Scrollbar, minSliderLength), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-orient", "orient", "Orient",
- DEF_ORIENT, Blt_Offset(Scrollbar, orientation), 0},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_RELIEF, Blt_Offset(Scrollbar, relief), 0},
- {BLT_CONFIG_INT, "-repeatdelay", "repeatDelay", "RepeatDelay",
- DEF_REPEAT_DELAY, Blt_Offset(Scrollbar, repeatDelay), 0},
- {BLT_CONFIG_INT, "-repeatinterval", "repeatInterval", "RepeatInterval",
- DEF_REPEAT_INTERVAL, Blt_Offset(Scrollbar, repeatInterval), 0},
- {BLT_CONFIG_BACKGROUND, "-selectbackground", "selectBackground",
- "Foreground", DEF_SELECT_BACKGROUND, Blt_Offset(Scrollbar, selBg), 0},
- {BLT_CONFIG_RELIEF, "-selectrelief", "selectRelief", "Relief",
- DEF_ACTIVE_RELIEF, Blt_Offset(Scrollbar, selRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_TAKE_FOCUS, Blt_Offset(Scrollbar, takeFocus),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BACKGROUND, "-troughcolor", "troughColor", "Background",
- DEF_TROUGH_COLOR, Blt_Offset(Scrollbar, troughBg), 0},
- {BLT_CONFIG_PIXELS, "-width", "width", "Width", DEF_WIDTH,
- Blt_Offset(Scrollbar, width), 0},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-/*
- * Forward declarations for procedures defined later in this file:
- */
-
-static void ComputeScrollbarGeometry(Scrollbar *scrollPtr);
-static int ConfigureScrollbar(Tcl_Interp *interp, Scrollbar *scrollPtr,
- int objc, Tcl_Obj *const *objv, int flags);
-static void DestroyScrollbar(DestroyData *memPtr);
-static void DisplayScrollbar(ClientData clientData);
-static void EventuallyRedraw(Scrollbar *scrollPtr);
-static void ScrollbarCmdDeletedProc(ClientData clientData);
-static void ScrollbarEventProc(ClientData clientData, XEvent *eventPtr);
-static int ScrollbarPosition(Scrollbar *scrollPtr, int x, int y);
-static int ScrollbarWidgetCmd(ClientData clientData, Tcl_Interp *, int objc,
- Tcl_Obj *const *objv);
-
-static Blt_BackgroundChangedProc BackgroundChangedProc;
-static Tcl_ObjCmdProc ScrollbarCmd;
-
-
-static const char *
-NameOfField(int field)
-{
- switch (field) {
- case BOTTOM_ARROW: return "arrow2";
- case BOTTOM_GAP: return "trough2";
- case SLIDER: return "slider";
- case TOP_ARROW: return "arrow1";
- case TOP_GAP: return "trough1";
- default:
- return "???";
- }
-}
-
-static int
-GetFieldFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *fieldPtr)
-{
- char *string;
- int length;
- char c;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'a') && (strcmp(string, "arrow1") == 0)) {
- *fieldPtr = TOP_ARROW;
- } else if ((c == 'a') && (strcmp(string, "arrow2") == 0)) {
- *fieldPtr = BOTTOM_ARROW;
- } else if ((c == 's') && (strncmp(string, "slider", length) == 0)) {
- *fieldPtr = SLIDER;
- } else {
- *fieldPtr = OUTSIDE;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollbarCmd --
- *
- * This procedure is invoked to process the "scrollbar" TCL command. See
- * the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-/*ARGSUSED*/
-static int
-ScrollbarCmd(
- ClientData clientData, /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- Scrollbar *sp;
- Tk_Window tkwin;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?options?\"", (char *)NULL);
- return TCL_ERROR;
- }
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
- Tcl_GetString(objv[1]), (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- /*
- * Initialize fields that won't be initialized by ConfigureScrollbar, or
- * which ConfigureScrollbar expects to have reasonable values
- * (e.g. resource pointers).
- */
- sp = Blt_AssertCalloc(1, sizeof(Scrollbar));
- sp->tkwin = tkwin;
- sp->display = Tk_Display(tkwin);
- sp->interp = interp;
- sp->widgetCmd = Tcl_CreateObjCommand(interp,
- Tk_PathName(sp->tkwin), ScrollbarWidgetCmd,
- (ClientData)sp, ScrollbarCmdDeletedProc);
- sp->relief = TK_RELIEF_FLAT;
- sp->elementBW = 2;
- sp->borderWidth = 1;
- sp->selRelief = TK_RELIEF_SUNKEN;
- sp->activeRelief = TK_RELIEF_RAISED;
- sp->minSliderLength = MIN_SLIDER_LENGTH;
-
- sp->width = SB_WIDTH;
-
- Tk_SetClass(sp->tkwin, "TkScrollbar");
- Tk_CreateEventHandler(sp->tkwin,
- ExposureMask | StructureNotifyMask | FocusChangeMask,
- ScrollbarEventProc, (ClientData)sp);
- if (ConfigureScrollbar(interp, sp, objc - 2, objv + 2, 0) != TCL_OK) {
- goto error;
- }
- Tcl_SetObjResult(interp, objv[1]);
- return TCL_OK;
-
- error:
- Tk_DestroyWindow(sp->tkwin);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollbarWidgetCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-ScrollbarWidgetCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Scrollbar *scrollPtr = clientData;
- int result = TCL_OK;
- int length;
- int c;
- char *string;
- Tcl_CmdInfo cmdInfo;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- objv[0], " option ?arg arg ...?\"", (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * First time in this interpreter, invoke a procedure to initialize
- * various bindings on the combomenu widget. If the procedure doesn't
- * already exist, source it from "$blt_library/scrollbar.tcl". We
- * deferred sourcing the file until now so that the variable $blt_library
- * could be set within a script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::TkScrollbar::ScrollButtonDown",
- &cmdInfo)) {
- static char cmd[] = "source [file join $blt_library scrollbar.tcl]";
-
- if (Tcl_GlobalEval(interp, cmd) != TCL_OK) {
- char info[200];
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- return TCL_ERROR;
- }
- }
- Tcl_Preserve((ClientData)scrollPtr);
- string = Tcl_GetStringFromObj(objv[1], &length);
- c = string[0];
- if ((c == 'a') && (strncmp(string, "activate", length) == 0)) {
- if (objc > 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " activate element\"", (char *)NULL);
- goto error;
- }
- if (objc == 2) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- NameOfField(scrollPtr->activeField), -1);
- } else {
- GetFieldFromObj(interp, objv[2], &scrollPtr->activeField);
- EventuallyRedraw(scrollPtr);
- }
- } else if ((c == 'c') && (length >= 2) &&
- (strncmp(string, "cget", length) == 0)) {
- if (objc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " cget option\"", (char *)NULL);
- goto error;
- }
- result = Blt_ConfigureValueFromObj(interp, scrollPtr->tkwin,
- configSpecs, (char *)scrollPtr, objv[2], 0);
- } else if ((c == 'c') && (length >= 2) &&
- (strncmp(string, "configure", length) == 0)) {
- if (objc == 2) {
- result = Blt_ConfigureInfoFromObj(interp, scrollPtr->tkwin,
- configSpecs, (char *)scrollPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- result = Blt_ConfigureInfoFromObj(interp, scrollPtr->tkwin,
- configSpecs, (char *)scrollPtr, objv[2], 0);
- } else {
- result = ConfigureScrollbar(interp, scrollPtr, objc - 2, objv + 2,
- BLT_CONFIG_OBJV_ONLY);
- }
- } else if ((c == 'd') && (strncmp(string, "delta", length) == 0)) {
- int xDelta, yDelta, pixels, barWidth;
- double fraction;
-
- if (objc != 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " delta xDelta yDelta\"", (char *)NULL);
- goto error;
- }
- if ((Tcl_GetIntFromObj(interp, objv[2], &xDelta) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &yDelta) != TCL_OK)) {
- goto error;
- }
- if (scrollPtr->vertical) {
- pixels = yDelta;
- barWidth = Tk_Height(scrollPtr->tkwin) - 1
- - 2 * (scrollPtr->arrowLength + scrollPtr->inset);
- } else {
- pixels = xDelta;
- barWidth = Tk_Width(scrollPtr->tkwin) - 1
- - 2 * (scrollPtr->arrowLength + scrollPtr->inset);
- }
- if (barWidth == 0) {
- fraction = 0.0;
- } else {
- fraction = ((double)pixels / (double)barWidth);
- }
- Tcl_SetDoubleObj(Tcl_GetObjResult(interp), fraction);
- } else if ((c == 'f') && (strncmp(string, "fraction", length) == 0)) {
- int x, y, pos, barWidth;
- double fraction;
-
- if (objc != 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " fraction x y\"", (char *)NULL);
- goto error;
- }
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- goto error;
- }
- if (scrollPtr->vertical) {
- pos = y - (scrollPtr->arrowLength + scrollPtr->inset);
- barWidth = Tk_Height(scrollPtr->tkwin) - 1
- - 2 * (scrollPtr->arrowLength + scrollPtr->inset);
- } else {
- pos = x - (scrollPtr->arrowLength + scrollPtr->inset);
- barWidth = Tk_Width(scrollPtr->tkwin) - 1
- - 2 * (scrollPtr->arrowLength + scrollPtr->inset);
- }
- if (barWidth == 0) {
- fraction = 0.0;
- } else {
- fraction = ((double)pos / (double)barWidth);
- }
- if (fraction < 0.0) {
- fraction = 0.0;
- } else if (fraction > 1.0) {
- fraction = 1.0;
- }
- Tcl_SetDoubleObj(Tcl_GetObjResult(interp), fraction);
- } else if ((c == 'g') && (strncmp(string, "get", length) == 0)) {
- if (objc != 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " get\"", (char *)NULL);
- goto error;
- }
- if (scrollPtr->flags & NEW_STYLE_COMMANDS) {
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(scrollPtr->firstFraction));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(scrollPtr->lastFraction));
- Tcl_SetObjResult(interp, listObjPtr);
- } else {
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(scrollPtr->totalUnits));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(scrollPtr->windowUnits));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(scrollPtr->firstUnit));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(scrollPtr->lastUnit));
- Tcl_SetObjResult(interp, listObjPtr);
- }
- } else if ((c == 'i') && (strncmp(string, "identify", length) == 0)) {
- int x, y, thing;
-
- if (objc != 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " identify x y\"", (char *)NULL);
- goto error;
- }
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- goto error;
- }
- thing = ScrollbarPosition(scrollPtr, x, y);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), NameOfField(thing), -1);
- } else if ((c == 's') && (strncmp(string, "set", length) == 0)) {
- int totalUnits, windowUnits, firstUnit, lastUnit;
-
- if (objc == 4) {
- double first, last;
-
- if ((Tcl_GetDoubleFromObj(interp, objv[2], &first) != TCL_OK) ||
- (Tcl_GetDoubleFromObj(interp, objv[3], &last) != TCL_OK)) {
- goto error;
- }
- if (first < 0) {
- scrollPtr->firstFraction = 0;
- } else if (first > 1.0) {
- scrollPtr->firstFraction = 1.0;
- } else {
- scrollPtr->firstFraction = first;
- }
- if (last < scrollPtr->firstFraction) {
- scrollPtr->lastFraction = scrollPtr->firstFraction;
- } else if (last > 1.0) {
- scrollPtr->lastFraction = 1.0;
- } else {
- scrollPtr->lastFraction = last;
- }
- scrollPtr->flags |= NEW_STYLE_COMMANDS;
- } else if (objc == 6) {
- if (Tcl_GetIntFromObj(interp, objv[2], &totalUnits) != TCL_OK) {
- goto error;
- }
- if (totalUnits < 0) {
- totalUnits = 0;
- }
- if (Tcl_GetIntFromObj(interp, objv[3], &windowUnits) != TCL_OK) {
- goto error;
- }
- if (windowUnits < 0) {
- windowUnits = 0;
- }
- if (Tcl_GetIntFromObj(interp, objv[4], &firstUnit) != TCL_OK) {
- goto error;
- }
- if (Tcl_GetIntFromObj(interp, objv[5], &lastUnit) != TCL_OK) {
- goto error;
- }
- if (totalUnits > 0) {
- if (lastUnit < firstUnit) {
- lastUnit = firstUnit;
- }
- } else {
- firstUnit = lastUnit = 0;
- }
- scrollPtr->totalUnits = totalUnits;
- scrollPtr->windowUnits = windowUnits;
- scrollPtr->firstUnit = firstUnit;
- scrollPtr->lastUnit = lastUnit;
- if (scrollPtr->totalUnits == 0) {
- scrollPtr->firstFraction = 0.0;
- scrollPtr->lastFraction = 1.0;
- } else {
- scrollPtr->firstFraction = ((double)firstUnit) / totalUnits;
- scrollPtr->lastFraction = ((double)(lastUnit + 1)) / totalUnits;
- }
- scrollPtr->flags &= ~NEW_STYLE_COMMANDS;
- } else {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]),
- " set firstFraction lastFraction\" or \"",
- Tcl_GetString(objv[0]),
- " set totalUnits windowUnits firstUnit lastUnit\"",
- (char *)NULL);
- goto error;
- }
- ComputeScrollbarGeometry(scrollPtr);
- EventuallyRedraw(scrollPtr);
- } else if ((c == 's') && (strncmp(string, "select", length) == 0)) {
- if (objc > 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " select element\"", (char *)NULL);
- goto error;
- }
- if (objc == 2) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- NameOfField(scrollPtr->selField), -1);
- } else {
- GetFieldFromObj(interp, objv[2], &scrollPtr->selField);
- EventuallyRedraw(scrollPtr);
- }
- } else {
- Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]),
- "\": must be activate, cget, configure, delta, fraction, ",
- "get, identify, or set", (char *)NULL);
- goto error;
- }
- Tcl_Release((ClientData)scrollPtr);
- return result;
-
- error:
- Tcl_Release((ClientData)scrollPtr);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyScrollbar --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the internal structure of a scrollbar at a safe time (when
- * no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the scrollbar is freed up.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-DestroyScrollbar(DestroyData *memPtr) /* Info about scrollbar widget. */
-{
- Scrollbar *scrollPtr = (Scrollbar *)memPtr;
-
- /*
- * Free up all the stuff that requires special handling, then let
- * Blt_FreeOptions handle all the standard option-related stuff.
- */
- if (scrollPtr->copyGC != None) {
- Tk_FreeGC(scrollPtr->display, scrollPtr->copyGC);
- }
- Blt_FreeOptions(configSpecs, (char *)scrollPtr, scrollPtr->display, 0);
- Blt_Free(scrollPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BackgroundChangedProc
- *
- * Routine for background change notifications.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-BackgroundChangedProc(ClientData clientData)
-{
- Scrollbar *scrollPtr = clientData;
-
- if (scrollPtr->tkwin != NULL) {
- EventuallyRedraw(scrollPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureScrollbar --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) a scrollbar
- * widget.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result contains an error message.
- *
- * Side effects:
- * Configuration information, such as colors, border width, etc. get set
- * for scrollPtr; old resources get freed, if there were any.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-ConfigureScrollbar(
- Tcl_Interp *interp, /* Used for error reporting. */
- Scrollbar *scrollPtr, /* Information about widget; may or
- * may not already have values for
- * some fields. */
- int objc, /* Number of valid entries in objv. */
- Tcl_Obj *const *objv, /* Arguments. */
- int flags) /* Flags to pass to
- * Blt_ConfigureWidget. */
-{
- size_t length;
- XGCValues gcValues;
-
- if (Blt_ConfigureWidgetFromObj(interp, scrollPtr->tkwin, configSpecs,
- objc, objv, (char *)scrollPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * A few options need special processing, such as parsing the orientation
- * or setting the background from a 3-D border.
- */
- length = strlen(scrollPtr->orientation);
- if (strncmp(scrollPtr->orientation, "vertical", length) == 0) {
- scrollPtr->vertical = 1;
- } else if (strncmp(scrollPtr->orientation, "horizontal", length) == 0) {
- scrollPtr->vertical = 0;
- } else {
- Tcl_AppendResult(interp, "bad orientation \"", scrollPtr->orientation,
- "\": must be vertical or horizontal", (char *)NULL);
- return TCL_ERROR;
- }
-
- if (scrollPtr->command != NULL) {
- scrollPtr->commandSize = strlen(scrollPtr->command);
- } else {
- scrollPtr->commandSize = 0;
- }
- if (scrollPtr->activeBg != NULL) {
- Blt_SetBackgroundChangedProc(scrollPtr->activeBg, BackgroundChangedProc,
- scrollPtr);
- }
- if (scrollPtr->bg != NULL) {
- Blt_SetBackgroundChangedProc(scrollPtr->bg, BackgroundChangedProc,
- scrollPtr);
- }
- Blt_SetBackgroundFromBackground(scrollPtr->tkwin, scrollPtr->bg);
-
- if (scrollPtr->copyGC == None) {
- gcValues.graphics_exposures = False;
- scrollPtr->copyGC = Tk_GetGC(scrollPtr->tkwin, GCGraphicsExposures,
- &gcValues);
- }
- /*
- * Register the desired geometry for the window (leave enough space for
- * the two arrows plus a minimum-size slider, plus border around the whole
- * window, if any). Then arrange for the window to be redisplayed.
- */
-
- ComputeScrollbarGeometry(scrollPtr);
- EventuallyRedraw(scrollPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayScrollbar --
- *
- * This procedure redraws the contents of a scrollbar window. It is
- * invoked as a do-when-idle handler, so it only runs when there's
- * nothing else for the application to do.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information appears on the screen.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-DisplayScrollbar(ClientData clientData) /* Information about window. */
-{
- Blt_Background bg;
- XColor *fg;
- Pixmap pixmap;
- Scrollbar *scrollPtr = clientData;
- Tk_Window tkwin;
- XPoint points[7];
- int relief, width, elementBW;
-
- scrollPtr->flags &= ~REDRAW_PENDING;
- tkwin = scrollPtr->tkwin;
- if ((tkwin == NULL) || !Tk_IsMapped(tkwin)) {
- return;
- }
- if ((Tk_Width(tkwin) <= 1) || (Tk_Height(tkwin) <= 1)) {
- return;
- }
- if (scrollPtr->vertical) {
- width = Tk_Width(tkwin) - 2 * scrollPtr->inset;
- } else {
- width = Tk_Height(tkwin) - 2 * scrollPtr->inset;
- }
- elementBW = scrollPtr->elementBW;
- if (elementBW < 0) {
- elementBW = scrollPtr->borderWidth;
- }
-
- /*
- * In order to avoid screen flashes, this procedure redraws the scrollbar
- * in a pixmap, then copies the pixmap to the screen in a single
- * operation. This means that there's no point in time where the on-sreen
- * image has been cleared.
- */
-
- pixmap = Tk_GetPixmap(scrollPtr->display, Tk_WindowId(tkwin),
- Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin));
-
- if (scrollPtr->highlightWidth != 0) {
- GC gc;
-
- if (scrollPtr->flags & GOT_FOCUS) {
- gc = Tk_GCForColor(scrollPtr->highlightColorPtr, pixmap);
- } else {
- gc = Tk_GCForColor(scrollPtr->highlightBgColorPtr, pixmap);
- }
- Tk_DrawFocusHighlight(tkwin, gc, scrollPtr->highlightWidth, pixmap);
- }
- Blt_FillBackgroundRectangle(tkwin, pixmap, scrollPtr->troughBg,
- scrollPtr->highlightWidth, scrollPtr->highlightWidth,
- Tk_Width(tkwin) - 2 * scrollPtr->highlightWidth,
- Tk_Height(tkwin) - 2 * scrollPtr->highlightWidth,
- scrollPtr->borderWidth, scrollPtr->relief);
-
- /*
- * Draw the top or left arrow. The coordinates of the polygon points
- * probably seem odd, but they were carefully chosen with respect to X's
- * rules for filling polygons. These point choices cause the arrows to
- * just fill the narrow dimension of the scrollbar and be properly
- * centered.
- */
- if (scrollPtr->selField == TOP_ARROW) {
- bg = scrollPtr->selBg;
- relief = scrollPtr->selRelief;
- } else if (scrollPtr->activeField == TOP_ARROW) {
- bg = scrollPtr->activeBg;
- relief = scrollPtr->activeRelief;
- } else {
- bg = scrollPtr->bg;
- relief = TK_RELIEF_RAISED;
- }
- if (scrollPtr->vertical) {
- points[0].x = scrollPtr->inset - 1;
- points[0].y = scrollPtr->arrowLength + scrollPtr->inset - 1;
- points[1].x = width + scrollPtr->inset;
- points[1].y = points[0].y;
- points[2].x = width / 2 + scrollPtr->inset;
- points[2].y = scrollPtr->inset - 1;
- } else {
- points[0].x = scrollPtr->arrowLength + scrollPtr->inset - 1;
- points[0].y = scrollPtr->inset - 1;
- points[1].x = scrollPtr->inset;
- points[1].y = width / 2 + scrollPtr->inset;
- points[2].x = points[0].x;
- points[2].y = width + scrollPtr->inset;
- }
- Blt_FillBackgroundRectangle(tkwin, pixmap, bg, scrollPtr->inset,
- scrollPtr->inset, width, width, elementBW, relief);
-
- fg = (scrollPtr->firstFraction <= 0.0)
- ? scrollPtr->disabledArrowColor : scrollPtr->arrowColor;
- Blt_DrawArrow(scrollPtr->display, pixmap, fg,
- scrollPtr->inset+1, scrollPtr->inset+1, width-2, width-2, elementBW,
- (scrollPtr->vertical) ? ARROW_UP : ARROW_LEFT);
- /*
- * Display the bottom or right arrow.
- */
- if (scrollPtr->selField == BOTTOM_ARROW) {
- bg = scrollPtr->selBg;
- relief = scrollPtr->selRelief;
- } else if (scrollPtr->activeField == BOTTOM_ARROW) {
- bg = scrollPtr->activeBg;
- relief = scrollPtr->activeRelief;
- } else {
- bg = scrollPtr->bg;
- relief = TK_RELIEF_RAISED;
- }
- if (scrollPtr->vertical) {
- points[0].x = scrollPtr->inset;
- points[0].y = Tk_Height(tkwin) - scrollPtr->arrowLength
- - scrollPtr->inset + 1;
- points[1].x = width / 2 + scrollPtr->inset;
- points[1].y = Tk_Height(tkwin) - scrollPtr->inset;
- points[2].x = width + scrollPtr->inset;
- points[2].y = points[0].y;
- } else {
- points[0].x = Tk_Width(tkwin) - scrollPtr->arrowLength
- - scrollPtr->inset + 1;
- points[0].y = scrollPtr->inset - 1;
- points[1].x = points[0].x;
- points[1].y = width + scrollPtr->inset;
- points[2].x = Tk_Width(tkwin) - scrollPtr->inset;
- points[2].y = width / 2 + scrollPtr->inset;
- }
-#ifdef notdef
- Blt_FillBackgroundPolygon(tkwin, pixmap, bg, points, 3, elementBW,
- relief);
- }
-#else
- Blt_FillBackgroundRectangle(tkwin, pixmap, bg,
- Tk_Width(tkwin) - (width + scrollPtr->inset),
- Tk_Height(tkwin) - (width + scrollPtr->inset),
- width, width, elementBW, relief);
-
- fg = (scrollPtr->lastFraction >= 1.0)
- ? scrollPtr->disabledArrowColor : scrollPtr->arrowColor;
- Blt_DrawArrow(scrollPtr->display, pixmap, fg,
- Tk_Width(tkwin) - scrollPtr->inset - width + 1,
- Tk_Height(tkwin) - scrollPtr->inset - width + 1,
- width - 2, width - 2,
- elementBW, (scrollPtr->vertical) ? ARROW_DOWN : ARROW_RIGHT);
-#endif
- /*
- * Display the slider.
- */
- if (scrollPtr->activeField == SLIDER) {
- bg = scrollPtr->activeBg;
- relief = TK_RELIEF_RAISED;
- } else if (scrollPtr->activeField == SLIDER) {
- bg = scrollPtr->activeBg;
- relief = scrollPtr->activeRelief;
- } else {
- bg = scrollPtr->bg;
- relief = TK_RELIEF_RAISED;
- }
- if (scrollPtr->vertical) {
- Blt_FillBackgroundRectangle(tkwin, pixmap, bg, scrollPtr->inset,
- scrollPtr->sliderFirst, width,
- scrollPtr->sliderLast - scrollPtr->sliderFirst,
- elementBW, relief);
- } else {
- Blt_FillBackgroundRectangle(tkwin, pixmap, bg, scrollPtr->sliderFirst,
- scrollPtr->inset,
- scrollPtr->sliderLast - scrollPtr->sliderFirst, width,
- elementBW, relief);
- }
-
- /*
- * Copy the information from the off-screen pixmap onto the screen, then
- * delete the pixmap.
- */
-
- XCopyArea(scrollPtr->display, pixmap, Tk_WindowId(tkwin),
- scrollPtr->copyGC, 0, 0, (unsigned)Tk_Width(tkwin),
- (unsigned)Tk_Height(tkwin), 0, 0);
- Tk_FreePixmap(scrollPtr->display, pixmap);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollbarEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * scrollbars.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ScrollbarEventProc(
- ClientData clientData, /* Information about window. */
- XEvent *eventPtr) /* Information about event. */
-{
- Scrollbar *scrollPtr = clientData;
-
- if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
- EventuallyRedraw(scrollPtr);
- } else if (eventPtr->type == DestroyNotify) {
- if (scrollPtr->tkwin != NULL) {
- scrollPtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(scrollPtr->interp,scrollPtr->widgetCmd);
- }
- if (scrollPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayScrollbar, (ClientData)scrollPtr);
- }
- Tcl_EventuallyFree((ClientData)scrollPtr,
- (Tcl_FreeProc *)DestroyScrollbar);
- } else if (eventPtr->type == ConfigureNotify) {
- ComputeScrollbarGeometry(scrollPtr);
- EventuallyRedraw(scrollPtr);
- } else if (eventPtr->type == FocusIn) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- scrollPtr->flags |= GOT_FOCUS;
- if (scrollPtr->highlightWidth > 0) {
- EventuallyRedraw(scrollPtr);
- }
- }
- } else if (eventPtr->type == FocusOut) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- scrollPtr->flags &= ~GOT_FOCUS;
- if (scrollPtr->highlightWidth > 0) {
- EventuallyRedraw(scrollPtr);
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollbarCmdDeletedProc --
- *
- * This procedure is invoked when a widget command is deleted. If the
- * widget isn't already in the process of being destroyed, this command
- * destroys it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ScrollbarCmdDeletedProc(ClientData clientData)
-{
- Scrollbar *scrollPtr = clientData;
- Tk_Window tkwin = scrollPtr->tkwin;
-
- /*
- * This procedure could be invoked either because the window was destroyed
- * and the command was then deleted (in which case tkwin is NULL) or
- * because the command was deleted, and then this procedure destroys the
- * widget.
- */
-
- if (tkwin != NULL) {
- scrollPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeScrollbarGeometry --
- *
- * After changes in a scrollbar's size or configuration, this procedure
- * recomputes various geometry information used in displaying the
- * scrollbar.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The scrollbar will be displayed differently.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-ComputeScrollbarGeometry(Scrollbar *sp)
-{
- int width, fieldLength;
-
- if (sp->highlightWidth < 0) {
- sp->highlightWidth = 0;
- }
- sp->inset = sp->highlightWidth + sp->borderWidth;
- width = (sp->vertical) ? Tk_Width(sp->tkwin) : Tk_Height(sp->tkwin);
- sp->arrowLength = width - (2 * sp->inset + 1);
- fieldLength = (sp->vertical ? Tk_Height(sp->tkwin) :
- Tk_Width(sp->tkwin)) - 2 * (sp->arrowLength + sp->inset);
- if (fieldLength < 0) {
- fieldLength = 0;
- }
- sp->sliderFirst = (int)(fieldLength * sp->firstFraction);
- sp->sliderLast = (int)(fieldLength * sp->lastFraction);
-
- /*
- * Adjust the slider so that some piece of it is always displayed in the
- * scrollbar and so that it has at least a minimal width (so it can be
- * grabbed with the mouse).
- */
- {
- int minSliderLength, sliderLength;
-
- minSliderLength = sp->minSliderLength;
- if (minSliderLength > fieldLength) {
- minSliderLength = fieldLength;
- }
- sliderLength = sp->sliderLast - sp->sliderFirst;
- if (sliderLength < minSliderLength) {
- fieldLength -= minSliderLength - sliderLength;
- sp->sliderFirst = (int)(fieldLength * sp->firstFraction);
- sp->sliderLast = sp->sliderFirst + minSliderLength;
- } else {
- if (sp->sliderFirst > (fieldLength - 2 * sp->borderWidth)) {
- sp->sliderFirst = fieldLength - 2 * sp->borderWidth;
- }
- if (sp->sliderFirst < 0) {
- sp->sliderFirst = 0;
- }
- if (sp->sliderLast > fieldLength) {
- sp->sliderLast = fieldLength;
- }
- }
- }
- sp->sliderFirst += sp->arrowLength + sp->inset;
- sp->sliderLast += sp->arrowLength + sp->inset;
-
- /*
- * Register the desired geometry for the window (leave enough space for
- * the two arrows plus a minimum-size slider, plus border around the whole
- * window, if any). Then arrange for the window to be redisplayed.
- */
-
- if (sp->vertical) {
- Tk_GeometryRequest(sp->tkwin, sp->width + 2 * sp->inset,
- 2 * (sp->arrowLength + sp->borderWidth + sp->inset));
- } else {
- Tk_GeometryRequest(sp->tkwin,
- 2 * (sp->arrowLength + sp->borderWidth + sp->inset),
- sp->width + 2 * sp->inset);
- }
- Tk_SetInternalBorder(sp->tkwin, sp->inset);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollbarPosition --
- *
- * Determine the scrollbar element corresponding to a given position.
- *
- * Results:
- * One of TOP_ARROW, TOP_GAP, etc., indicating which element of the
- * scrollbar covers the position given by (x, y). If (x,y) is outside
- * the scrollbar entirely, then OUTSIDE is returned.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ScrollbarPosition(
- Scrollbar *scrollPtr, /* Scrollbar widget record. */
- int x, int y) /* Coordinates within scrollPtr's
- * window. */
-{
- int length, width, tmp;
-
- if (scrollPtr->vertical) {
- length = Tk_Height(scrollPtr->tkwin);
- width = Tk_Width(scrollPtr->tkwin);
- } else {
- tmp = x;
- x = y;
- y = tmp;
- length = Tk_Width(scrollPtr->tkwin);
- width = Tk_Height(scrollPtr->tkwin);
- }
-
- if ((x < scrollPtr->inset) || (x >= (width - scrollPtr->inset)) ||
- (y < scrollPtr->inset) || (y >= (length - scrollPtr->inset))) {
- return OUTSIDE;
- }
- /*
- * All of the calculations in this procedure mirror those in
- * DisplayScrollbar. Be sure to keep the two consistent.
- */
-
- if (y < (scrollPtr->inset + scrollPtr->arrowLength)) {
- return TOP_ARROW;
- }
- if (y < scrollPtr->sliderFirst) {
- return TOP_GAP;
- }
- if (y < scrollPtr->sliderLast) {
- return SLIDER;
- }
- if (y >= (length - (scrollPtr->arrowLength + scrollPtr->inset))) {
- return BOTTOM_ARROW;
- }
- return BOTTOM_GAP;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Arrange for one or more of the fields of a scrollbar to be redrawn.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-EventuallyRedraw(Scrollbar *scrollPtr) /* Information about widget. */
-{
- if ((scrollPtr->tkwin == NULL) || (!Tk_IsMapped(scrollPtr->tkwin))) {
- return;
- }
- if ((scrollPtr->flags & REDRAW_PENDING) == 0) {
- Tcl_DoWhenIdle(DisplayScrollbar, (ClientData)scrollPtr);
- scrollPtr->flags |= REDRAW_PENDING;
- }
-}
-
-int
-Blt_ScrollbarCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "scrollbar", ScrollbarCmd, };
-
- return Blt_InitCmd(interp, "::blt::tk", &cmdSpec);
-}
-
-#endif /* NO_TKSCROLLBAR */
diff --git a/blt3.0.1/src/bltScrollset.c b/blt3.0.1/src/bltScrollset.c
deleted file mode 100644
index a3bf2d8..0000000
--- a/blt3.0.1/src/bltScrollset.c
+++ /dev/null
@@ -1,2014 +0,0 @@
-
-/*
- * bltScrollset.c --
- *
- * This module implements a scrollset widget for the BLT toolkit.
- *
- * Copyright 2006 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include "bltBind.h"
-#include "bltImage.h"
-#include "bltPicture.h"
-#include "bltFont.h"
-#include "bltText.h"
-#include "bltChain.h"
-#include "bltHash.h"
-#include "bltBgStyle.h"
-#include "bltPainter.h"
-
-#define VPORTWIDTH(s) (Tk_Width((s)->tkwin) - (s)->yScrollbarWidth)
-#define VPORTHEIGHT(s) (Tk_Height((s)->tkwin) - (s)->xScrollbarHeight)
-#define FCLAMP(x) ((((x) < 0.0) ? 0.0 : ((x) > 1.0) ? 1.0 : (x)))
-
-#define REDRAW_PENDING (1<<0) /* A redraw request is pending. */
-#define LAYOUT_PENDING (1<<1) /* A request to recompute the layout of
- * the scrollbars and slave widget is
- * pending. */
-#define UPDATE_PENDING (1<<2) /* A request to call the widget update
- * procedure because scrollbars or
- * slave widget has been configured. */
-#define SCROLLX (1<<3) /* A request to set the X scrollbar is
- * pending. */
-#define SCROLLY (1<<4) /* A request to set the Y scrollbar is
- * pending. */
-#define SCROLL_PENDING (SCROLLX|SCROLLY)
-
-#define XSCROLLBAR_PENDING (1<<5) /* A request to install a new
- * x-scrollbar widget is pending. */
-#define YSCROLLBAR_PENDING (1<<6) /* A request to install a new
- * y-scrollbar widget is pending. */
-#define SLAVE_PENDING (1<<7) /* A request to install a new slave
- * widget is pending. */
-#define DISPLAY_X (1<<8) /* Display the x-scrollbar. */
-#define DISPLAY_Y (1<<9) /* Display the y-scrollbar. */
-#define SLAVE_XVIEW (1<<10) /* The slave widget has a "xview"
- * operation */
-#define SLAVE_YVIEW (1<<11) /* The slave widget has a "yview"
- * operation. */
-
-#define DEF_ANCHOR "center"
-#define DEF_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_CURSOR ((char *)NULL)
-#define DEF_FILL "both"
-#define DEF_HEIGHT "0"
-#define DEF_IPADX "0"
-#define DEF_IPADY "0"
-#define DEF_PADX "0"
-#define DEF_PADY "0"
-#define DEF_WIDTH "0"
-#define DEF_WINDOW ((char *)NULL)
-#define DEF_XSCROLLBAR ((char *)NULL)
-#define DEF_XSCROLLCOMMAND ((char *)NULL)
-#define DEF_XSCROLLINCREMENT "2"
-#define DEF_XVIEWCOMMAND ((char *)NULL)
-#define DEF_YSCROLLBAR ((char *)NULL)
-#define DEF_YSCROLLCOMMAND ((char *)NULL)
-#define DEF_YSCROLLINCREMENT "2"
-#define DEF_YVIEWCOMMAND ((char *)NULL)
-
-/*
- * Limits --
- *
- * Defines the bounding of a size (width or height) in the table. It may
- * be related to the partition, entry, or table size. The widget pointers
- * are used to associate sizes with the requested size of other widgets.
- */
-
-typedef struct {
- int flags; /* Flags indicate whether using
- * default values for limits or
- * not. See flags below. */
- int max, min; /* Values for respective limits. */
- int nom; /* Nominal starting value. */
-} Limits;
-
-typedef struct {
- /*
- * This works around a bug in the Tk API. Under under Win32, Tk tries to
- * read the widget record of toplevel windows (TopLevel or Frame widget), to
- * get its menu name field. What this means is that we must carefully
- * arrange the fields of this widget so that the menuName field is at the
- * same offset in the structure.
- */
-
- Tk_Window tkwin; /* Window that embodies the frame.
- * NULL means that the window has been
- * destroyed but the data structures
- * haven't yet been cleaned up. */
-
- Display *display; /* Display containing widget. Used,
- * among other things, so that
- * resources can * be freed even after
- * tkwin has gone away. */
-
- Tcl_Interp *interp; /* Interpreter associated with widget.
- * Used to delete widget command. */
-
- Tcl_Command cmdToken; /* Token for widget's command. */
-
- Tcl_Obj *slaveObjPtr; /* Name of the slave widget to be
- * embed into the widget window. */
- Tk_Window slave; /* Slave window to be managed by this
- * widget. */
- Tk_Window shangle;
-
- Limits reqSlaveWidth, reqSlaveHeight; /* Requested sizes for slave. */
- int reqWidth, reqHeight;
- Tk_Anchor anchor; /* Anchor type: indicates how the
- * slave is positioned if extra space
- * is available in the widget */
- Blt_Pad xPad; /* Extra padding placed left and right
- * of the slave. */
- Blt_Pad yPad; /* Extra padding placed above and
- * below the slave */
- Blt_Background bg;
- int ixPad, iyPad; /* Extra padding added to the interior
- * of the widget (i.e. adds to the
- * requested size of the widget) */
- int fill; /* Indicates how the widget should
- * fill the span of cells it
- * occupies. */
- int slaveX, slaveY; /* Origin of widget wrt container. */
- int slaveWidth, slaveHeight; /* Dimension of slave widget. */
- unsigned int flags;
- Tk_Cursor cursor; /* Current cursor for window or
- * None. */
-
- int xScrollUnits, yScrollUnits; /* Unit of distance to move when
- * clicking on the scrollbar
- * button. */
- /* Names of scrollbars to embed into the widget window. */
- Tcl_Obj *xScrollbarObjPtr, *yScrollbarObjPtr;
-
- /* Commands to control horizontal and vertical scrollbars. */
- Tcl_Obj *xReqScrollCmdObjPtr, *yReqScrollCmdObjPtr;
-
- Tcl_Obj *xScrollCmdObjPtr, *yScrollCmdObjPtr;
-
- /* Commands to control slave's horizontal and vertical views. */
- Tcl_Obj *xViewCmdObjPtr, *yViewCmdObjPtr;
-
- int xOffset, yOffset; /* Scroll offsets of viewport in
- * world. */
- int worldWidth, worldHeight; /* Dimension of entire menu. */
- int cavityWidth, cavityHeight; /* Dimension of entire menu. */
-
- Tk_Window xScrollbar; /* Horizontal scrollbar to be used if
- * necessary. If NULL, no x-scrollbar
- * is used. */
- Tk_Window yScrollbar; /* Vertical scrollbar to be used if
- * necessary. If NULL, no y-scrollbar
- * is used. */
-
- short int xScrollbarWidth, xScrollbarHeight;
- short int yScrollbarWidth, yScrollbarHeight;
- short int shangleWidth, shangleHeight;
- /*
- * Scanning Information:
- */
- int scanAnchorX; /* Horizontal scan anchor in screen
- * x-coordinates. */
- int scanX; /* x-offset of the start of the
- * horizontal scan in world
- * coordinates.*/
- int scanAnchorY; /* Vertical scan anchor in screen
- * y-coordinates. */
- int scanY; /* y-offset of the start of the
- * vertical scan in world
- * coordinates.*/
- short int width, height;
-} Scrollset;
-
-static Blt_OptionParseProc ObjToLimits;
-static Blt_OptionPrintProc LimitsToObj;
-static Blt_CustomOption limitsOption =
-{
- ObjToLimits, LimitsToObj, NULL, (ClientData)0
-};
-
-static Blt_ConfigSpec scrollsetSpecs[] =
-{
- {BLT_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor", DEF_ANCHOR,
- Blt_Offset(Scrollset, anchor), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_BACKGROUND, Blt_Offset(Scrollset, bg), 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", DEF_CURSOR,
- Blt_Offset(Scrollset, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FILL, "-fill", "fill", "Fill", DEF_FILL,
- Blt_Offset(Scrollset, fill), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS, "-height", "height", "Height", DEF_HEIGHT,
- Blt_Offset(Scrollset, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-ipadx", "iPadX", "IPadX", DEF_IPADX,
- Blt_Offset(Scrollset, ixPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-ipady", "iPadY", "IPadY", DEF_IPADY,
- Blt_Offset(Scrollset, iyPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-padx", "padX", "PadX", DEF_PADX,
- Blt_Offset(Scrollset, xPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-pady", "padY", "PadY", DEF_PADY,
- Blt_Offset(Scrollset, yPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-reqheight", "reqHeight", "ReqHeight", (char *)NULL,
- Blt_Offset(Scrollset, reqSlaveHeight), 0, &limitsOption},
- {BLT_CONFIG_CUSTOM, "-reqwidth", "reqSlaveWidth", "ReqWidth", (char *)NULL,
- Blt_Offset(Scrollset, reqSlaveWidth), 0, &limitsOption},
- {BLT_CONFIG_OBJ, "-xscrollbar", "xScrollbar", "Scrollbar", DEF_XSCROLLBAR,
- Blt_Offset(Scrollset, xScrollbarObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
- DEF_XSCROLLCOMMAND, Blt_Offset(Scrollset, xReqScrollCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_POS, "-xscrollincrement", "xScrollIncrement",
- "ScrollIncrement", DEF_XSCROLLINCREMENT,
- Blt_Offset(Scrollset, xScrollUnits), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-xviewcommand", "xViewCommand", "ViewCommand",
- DEF_XVIEWCOMMAND, Blt_Offset(Scrollset, xViewCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-yscrollbar", "yScrollbar", "Scrollbar", DEF_YSCROLLBAR,
- Blt_Offset(Scrollset, yScrollbarObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
- DEF_YSCROLLCOMMAND, Blt_Offset(Scrollset, yReqScrollCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_POS, "-yscrollincrement", "yScrollIncrement",
- "ScrollIncrement", DEF_YSCROLLINCREMENT,
- Blt_Offset(Scrollset, yScrollUnits),BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-yviewcommand", "yViewCommand", "ViewCommand",
- DEF_YVIEWCOMMAND, Blt_Offset(Scrollset, yViewCmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS, "-width", "width", "Width", DEF_WIDTH,
- Blt_Offset(Scrollset, reqWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-window", "window", "Window", DEF_WINDOW,
- Blt_Offset(Scrollset, slaveObjPtr),
- BLT_CONFIG_NULL_OK | BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-static Tk_GeomRequestProc ScrollsetGeometryProc;
-static Tk_GeomLostSlaveProc ScrollsetCustodyProc;
-static Tk_GeomMgr scrollsetMgrInfo = {
- (char *)"scrollset", /* Name of geometry manager used by
- * winfo. */
- ScrollsetGeometryProc, /* Procedure to for new geometry
- * requests. */
- ScrollsetCustodyProc, /* Procedure when scrollbar is taken
- * away. */
-};
-
-static Tcl_IdleProc DisplayScrollset;
-static Tcl_FreeProc DestroyScrollset;
-static Tk_EventProc WindowEventProc;
-static Tk_EventProc ScrollsetEventProc;
-static Tcl_ObjCmdProc ScrollsetInstCmdProc;
-static Tcl_CmdDeleteProc ScrollsetInstCmdDeletedProc;
-
-typedef int (ScrollsetCmdProc)(Scrollset *setPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Tells the Tk dispatcher to call the scrollset display routine at the
- * next idle point. This request is made only if the window is displayed
- * and no other redraw request is pending.
- *
- * Results: None.
- *
- * Side effects:
- * The window is eventually redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(Scrollset *setPtr)
-{
- if ((setPtr->tkwin != NULL) && !(setPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayScrollset, setPtr);
- setPtr->flags |= REDRAW_PENDING;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToLimits --
- *
- * Converts the list of elements into zero or more pixel values which
- * determine the range of pixel values possible. An element can be in any
- * form accepted by Tk_GetPixels. The list has a different meaning based
- * upon the number of elements.
- *
- * # of elements:
- *
- * 0 - the limits are reset to the defaults.
- * 1 - the minimum and maximum values are set to this
- * value, freezing the range at a single value.
- * 2 - first element is the minimum, the second is the
- * maximum.
- * 3 - first element is the minimum, the second is the
- * maximum, and the third is the nominal value.
- *
- * Any element may be the empty string which indicates the default.
- *
- * Results:
- * The return value is a standard TCL result. The min and max fields
- * of the range are set.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToLimits(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Widget of table */
- Tcl_Obj *objPtr, /* New width list */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Limits *limitsPtr = (Limits *)(widgRec + offset);
- int objc;
- int limits[3];
- int limitsFlags;
-
- /* Initialize limits to default values */
- limits[2] = LIMITS_NOM;
- limits[1] = LIMITS_MAX;
- limits[0] = LIMITS_MIN;
- limitsFlags = 0;
-
- objc = 0;
- if (objPtr != NULL) {
- Tcl_Obj **objv;
- int size;
- int i;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc > 3) {
- Tcl_AppendResult(interp, "wrong # limits \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- for (i = 0; i < objc; i++) {
- const char *string;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] == '\0') {
- continue; /* Empty string: use default value */
- }
- limitsFlags |= (1 << i);
- if (Blt_GetPixelsFromObj(interp, tkwin, objv[i], PIXELS_ANY,
- &size) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((size < LIMITS_MIN) || (size > LIMITS_MAX)) {
- Tcl_AppendResult(interp, "bad limits \"", Tcl_GetString(objPtr),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- limits[i] = size;
- }
- }
- /*
- * Check the limits specified.
- */
- switch (objc) {
- case 1:
- limitsFlags |= (LIMITS_MIN | LIMITS_MAX);
- limits[1] = limits[0]; /* Set minimum and maximum to value */
- break;
-
- case 2:
- if (limits[1] < limits[0]) {
- Tcl_AppendResult(interp, "bad range \"", Tcl_GetString(objPtr),
- "\": min > max", (char *)NULL);
- return TCL_ERROR; /* Minimum is greater than maximum */
- }
- break;
-
- case 3:
- if (limits[1] < limits[0]) {
- Tcl_AppendResult(interp, "bad range \"", Tcl_GetString(objPtr),
- "\": min > max", (char *)NULL);
- return TCL_ERROR; /* Minimum is greater than maximum */
- }
- if ((limits[2] < limits[0]) || (limits[2] > limits[1])) {
- Tcl_AppendResult(interp, "nominal value \"",
- Tcl_GetString(objPtr),
- "\" out of range", (char *)NULL);
- return TCL_ERROR; /* Nominal is outside of range defined
- * by minimum and maximum */
- }
- break;
- }
- limitsPtr->min = limits[0];
- limitsPtr->max = limits[1];
- limitsPtr->nom = limits[2];
- limitsPtr->flags = limitsFlags;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LimitsToObj --
- *
- * Convert the limits of the pixel values allowed into a list.
- *
- * Results:
- * The string representation of the limits is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-LimitsToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Row/column structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Limits *limitsPtr = (Limits *)(widgRec + offset);
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (limitsPtr->flags & LIMITS_MIN) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(limitsPtr->min));
- } else {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("", -1));
- }
- if (limitsPtr->flags & LIMITS_MAX) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(limitsPtr->max));
- } else {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("", -1));
- }
- if (limitsPtr->flags & LIMITS_NOM) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(limitsPtr->nom));
- } else {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("", -1));
- }
- return listObjPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResetLimits --
- *
- * Resets the limits to their default values.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-INLINE static void
-ResetLimits(Limits *limitsPtr) /* Limits to be imposed on the value */
-{
- limitsPtr->flags = 0;
- limitsPtr->min = LIMITS_MIN;
- limitsPtr->max = LIMITS_MAX;
- limitsPtr->nom = LIMITS_NOM;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TranslateAnchor --
- *
- * Translate the coordinates of a given bounding box based upon the
- * anchor specified. The anchor indicates where the given xy position is
- * in relation to the bounding box.
- *
- * nw --- n --- ne
- * | | x,y ---+
- * w center e | |
- * | | +-----+
- * sw --- s --- se
- *
- * Results:
- * The translated coordinates of the bounding box are returned.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TranslateAnchor(
- int dx, int dy, /* Difference between outer and inner
- * regions */
- Tk_Anchor anchor, /* Direction of the anchor */
- int *xPtr, int *yPtr)
-{
- int x, y;
-
- x = y = 0;
- switch (anchor) {
- case TK_ANCHOR_NW: /* Upper left corner */
- break;
- case TK_ANCHOR_W: /* Left center */
- y = (dy / 2);
- break;
- case TK_ANCHOR_SW: /* Lower left corner */
- y = dy;
- break;
- case TK_ANCHOR_N: /* Top center */
- x = (dx / 2);
- break;
- case TK_ANCHOR_CENTER: /* Centered */
- x = (dx / 2);
- y = (dy / 2);
- break;
- case TK_ANCHOR_S: /* Bottom center */
- x = (dx / 2);
- y = dy;
- break;
- case TK_ANCHOR_NE: /* Upper right corner */
- x = dx;
- break;
- case TK_ANCHOR_E: /* Right center */
- x = dx;
- y = (dy / 2);
- break;
- case TK_ANCHOR_SE: /* Lower right corner */
- x = dx;
- y = dy;
- break;
- }
- *xPtr = (*xPtr) + x;
- *yPtr = (*yPtr) + y;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetBoundedWidth --
- *
- * Bounds a given width value to the limits described in the limit
- * structure. The initial starting value may be overridden by the nominal
- * value in the limits.
- *
- * Results:
- * Returns the constrained value.
- *
- *---------------------------------------------------------------------------
- */
-static INLINE int
-GetBoundedWidth(
- int width, /* Initial value to be constrained */
- Limits *limitsPtr) /* Limits to be imposed on the
- * value. */
-{
- if (limitsPtr->flags & LIMITS_NOM) {
- width = limitsPtr->nom; /* Override initial value */
- }
- if (width < limitsPtr->min) {
- width = limitsPtr->min; /* Bounded by minimum value */
- }
- if (width > limitsPtr->max) {
- width = limitsPtr->max; /* Bounded by maximum value */
- }
- return width;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetBoundedHeight --
- *
- * Bounds a given value to the limits described in the limit structure.
- * The initial starting value may be overridden by the nominal value in
- * the limits.
- *
- * Results:
- * Returns the constrained value.
- *
- *---------------------------------------------------------------------------
- */
-static INLINE int
-GetBoundedHeight(
- int height, /* Initial value to be constrained */
- Limits *limitsPtr) /* Limits to be imposed on the
- * value. */
-{
- if (limitsPtr->flags & LIMITS_NOM) {
- height = limitsPtr->nom; /* Override initial value */
- }
- if (height < limitsPtr->min) {
- height = limitsPtr->min; /* Bounded by minimum value */
- }
- if (height > limitsPtr->max) {
- height = limitsPtr->max; /* Bounded by maximum value */
- }
- return height;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetSlaveReqWidth --
- *
- * Returns the width requested by the widget starting in the given entry.
- * The requested space also includes any internal padding which has been
- * designated for this widget.
- *
- * The requested width of the widget is always bounded by the limits set
- * in tePtr->reqWidth.
- *
- * Results:
- * Returns the requested width of the widget.
- *
- *---------------------------------------------------------------------------
- */
-static INLINE int
-GetSlaveReqWidth(Scrollset *setPtr)
-{
- int width;
-
- width = 2 * setPtr->ixPad;
- if (setPtr->slave != NULL) {
- width += Tk_ReqWidth(setPtr->slave);
- }
- width = GetBoundedWidth(width, &setPtr->reqSlaveWidth);
- return width;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetSlaveReqHeight --
- *
- * Returns the height requested by the widget starting in the given entry.
- * The requested space also includes any internal padding which has been
- * designated for this widget.
- *
- * The requested height of the widget is always bounded by the limits set
- * in setPtr->reqSlaveHeight.
- *
- * Results:
- * Returns the requested height of the widget.
- *
- *---------------------------------------------------------------------------
- */
-static INLINE int
-GetSlaveReqHeight(Scrollset *setPtr)
-{
- int height;
-
- height = 2 * setPtr->iyPad;
- if (setPtr->slave != NULL) {
- height += Tk_ReqHeight(setPtr->slave);
- }
- height = GetBoundedHeight(height, &setPtr->reqSlaveHeight);
- return height;
-}
-
-static void
-UnmanageWindow(Scrollset *setPtr, Tk_Window tkwin)
-{
- Tk_DeleteEventHandler(tkwin, StructureNotifyMask, WindowEventProc, setPtr);
- Tk_ManageGeometry(tkwin, (Tk_GeomMgr *)NULL, setPtr);
- if (Tk_IsMapped(tkwin)) {
- Tk_UnmapWindow(tkwin);
- }
-}
-
-static void
-ManageWindow(Scrollset *setPtr, Tk_Window tkwin)
-{
- Tk_CreateEventHandler(tkwin, StructureNotifyMask, WindowEventProc, setPtr);
- Tk_ManageGeometry(tkwin, &scrollsetMgrInfo, setPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InstallWindow --
- *
- * Convert the string representation of a color into a XColor pointer.
- *
- * Results:
- * The return value is a standard TCL result. The color pointer is
- * written into the widget record.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InstallWindow(
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Scrollset *setPtr,
- Tcl_Obj *objPtr, /* String representing scrollbar
- * window. */
- Tk_Window *tkwinPtr)
-{
- Tk_Window tkwin;
-
- if (objPtr == NULL) {
- Tcl_AppendResult(interp, "window name is NULL", (char *)NULL);
- *tkwinPtr = NULL;
- return TCL_ERROR;
- }
- tkwin = Tk_NameToWindow(interp, Tcl_GetString(objPtr), setPtr->tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_Parent(tkwin) != setPtr->tkwin) {
- Tcl_AppendResult(interp, "window \"", Tk_PathName(tkwin),
- "\" must be a slave of scrollset.", (char *)NULL);
- return TCL_ERROR;
- }
- ManageWindow(setPtr, tkwin);
- *tkwinPtr = tkwin;
- return TCL_OK;
-}
-
-static void
-InstallXScrollbar(ClientData clientData)
-{
- Scrollset *setPtr = clientData;
- Tcl_Interp *interp;
-
- interp = setPtr->interp;
- setPtr->flags &= ~XSCROLLBAR_PENDING;
- if (setPtr->tkwin == NULL) {
- return; /* Widget has been destroyed. */
- }
- if (InstallWindow(interp, setPtr, setPtr->xScrollbarObjPtr,
- &setPtr->xScrollbar) != TCL_OK) {
- Tcl_BackgroundError(setPtr->interp);
- return;
- }
- if (setPtr->xScrollCmdObjPtr != NULL) {
- Tcl_DecrRefCount(setPtr->xScrollCmdObjPtr);
- setPtr->xScrollCmdObjPtr = NULL;
- }
- if (setPtr->xReqScrollCmdObjPtr != NULL) {
- Tcl_IncrRefCount(setPtr->xReqScrollCmdObjPtr);
- setPtr->xScrollCmdObjPtr = setPtr->xReqScrollCmdObjPtr;
- } else {
- Tcl_Obj *listObjPtr;
-
- /* Defaults to "scrollbar set". */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, setPtr->xScrollbarObjPtr);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("set",3));
- Tcl_IncrRefCount(listObjPtr);
- setPtr->xScrollCmdObjPtr = listObjPtr;
- }
-}
-
-static void
-InstallYScrollbar(ClientData clientData)
-{
- Scrollset *setPtr = clientData;
- Tcl_Interp *interp;
-
- interp = setPtr->interp;
- setPtr->flags &= ~YSCROLLBAR_PENDING;
- if (setPtr->tkwin == NULL) {
- return; /* Widget has been destroyed. */
- }
- if (InstallWindow(interp, setPtr, setPtr->yScrollbarObjPtr,
- &setPtr->yScrollbar) != TCL_OK) {
- Tcl_BackgroundError(setPtr->interp);
- return;
- }
- if (setPtr->yScrollCmdObjPtr != NULL) {
- Tcl_DecrRefCount(setPtr->yScrollCmdObjPtr);
- setPtr->yScrollCmdObjPtr = NULL;
- }
- if (setPtr->yReqScrollCmdObjPtr != NULL) {
- Tcl_IncrRefCount(setPtr->yReqScrollCmdObjPtr);
- setPtr->yScrollCmdObjPtr = setPtr->yReqScrollCmdObjPtr;
- } else {
- Tcl_Obj *listObjPtr;
-
- /* Defaults to "scrollbar set". */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, setPtr->yScrollbarObjPtr);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj("set",3));
- Tcl_IncrRefCount(listObjPtr);
- setPtr->yScrollCmdObjPtr = listObjPtr;
- }
-}
-
-
-static void
-InstallSlave(ClientData clientData)
-{
- Scrollset *setPtr = clientData;
- Tcl_Interp *interp;
- Tcl_Obj *cmdObjPtr;
- int result;
-
- interp = setPtr->interp;
- setPtr->flags &= ~(SLAVE_PENDING | SLAVE_XVIEW | SLAVE_YVIEW);
- if (setPtr->tkwin == NULL) {
- return; /* Widget has been destroyed. */
- }
- if (InstallWindow(interp, setPtr, setPtr->slaveObjPtr, &setPtr->slave)
- != TCL_OK) {
- Tcl_BackgroundError(interp);
- return;
- }
-
- /* Check if the slave widget has a "yview" operation. */
- if (setPtr->yViewCmdObjPtr != NULL) {
- cmdObjPtr = Tcl_DuplicateObj(setPtr->yViewCmdObjPtr);
- } else {
- cmdObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, cmdObjPtr, setPtr->slaveObjPtr);
- Tcl_ListObjAppendElement(interp, cmdObjPtr,Tcl_NewStringObj("yview",5));
- }
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- Tcl_ResetResult(interp);
- if (result == TCL_OK) {
- setPtr->flags |= SLAVE_YVIEW;
- }
-
- /* Check if the slave widget has a "xview" operation. */
- if (setPtr->xViewCmdObjPtr != NULL) {
- cmdObjPtr = Tcl_DuplicateObj(setPtr->xViewCmdObjPtr);
- } else {
- cmdObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, cmdObjPtr, setPtr->slaveObjPtr);
- Tcl_ListObjAppendElement(interp, cmdObjPtr,Tcl_NewStringObj("xview",5));
- }
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- Tcl_ResetResult(interp);
- if (result == TCL_OK) {
- setPtr->flags |= SLAVE_XVIEW;
- }
-}
-
-static void
-UpdateScrollset(ClientData clientData)
-{
- Scrollset *setPtr = clientData;
- Tcl_Interp *interp;
-
- interp = setPtr->interp;
- /*
- * Execute the initialization procedure on this widget.
- */
- setPtr->flags &= ~UPDATE_PENDING;
- if (setPtr->tkwin == NULL) {
- return; /* Widget has been destroyed. */
- }
- if (Tcl_VarEval(interp, "::blt::Scrollset::ConfigureScrollbars ",
- Tk_PathName(setPtr->tkwin), (char *)NULL) != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
-}
-
-static void
-ComputeSlaveGeometry(Scrollset *setPtr)
-{
- int cavityWidth, cavityHeight;
- int dx, dy;
- int slaveWidth, slaveHeight;
- int x, y;
-
- cavityWidth = Tk_Width(setPtr->tkwin);
- cavityHeight = Tk_Height(setPtr->tkwin);
-#ifdef notdef
- fprintf(stderr, "ComputeSlaveGeometry: container=%s rw=%d rh=%d w=%d h=%d, slave=%s rw=%d rh=%d w=%d, h=%d\n",
- Tk_PathName(setPtr->tkwin),
- Tk_ReqWidth(setPtr->tkwin), Tk_ReqHeight(setPtr->tkwin),
- Tk_Width(setPtr->tkwin), Tk_Height(setPtr->tkwin),
- Tk_PathName(setPtr->slave),
- Tk_ReqWidth(setPtr->slave), Tk_ReqHeight(setPtr->slave),
- Tk_Width(setPtr->slave), Tk_Height(setPtr->slave));
-#endif
- slaveWidth = GetSlaveReqWidth(setPtr);
- slaveHeight = GetSlaveReqHeight(setPtr);
-#ifdef notdef
- fprintf(stderr, "ComputeSlaveGeometry: slaveWidth=%d slaveHeight=%d, cavityWidth=%d cavityHeight=%d\n",
- slaveWidth, slaveHeight, cavityWidth, cavityHeight);
-#endif
- setPtr->flags &= ~(DISPLAY_X | DISPLAY_Y);
- if ((setPtr->flags & SLAVE_XVIEW) == 0) {
- setPtr->worldWidth = slaveWidth;
- }
- if ((setPtr->flags & SLAVE_YVIEW) == 0) {
- setPtr->worldHeight = slaveHeight;
- }
- setPtr->xScrollbarHeight = setPtr->yScrollbarWidth = 0;
- if ((setPtr->xScrollbar != NULL) && (setPtr->worldWidth > cavityWidth)) {
- setPtr->xScrollbarHeight = Tk_ReqHeight(setPtr->xScrollbar);
- cavityHeight -= setPtr->xScrollbarHeight;
- setPtr->flags |= DISPLAY_X;
- }
- if ((setPtr->yScrollbar != NULL) && (setPtr->worldHeight > cavityHeight)) {
- setPtr->yScrollbarWidth = Tk_ReqWidth(setPtr->yScrollbar);
- cavityWidth -= setPtr->yScrollbarWidth;
- setPtr->flags |= DISPLAY_Y;
- }
- if ((setPtr->xScrollbar != NULL) && (setPtr->xScrollbarHeight == 0) &&
- (setPtr->worldWidth > cavityWidth)) {
- setPtr->xScrollbarHeight = Tk_ReqHeight(setPtr->xScrollbar);
- cavityHeight -= setPtr->xScrollbarHeight;
- setPtr->flags |= DISPLAY_X;
- }
- if ((setPtr->yScrollbar != NULL) && (setPtr->yScrollbarWidth == 0) &&
- (setPtr->worldHeight > cavityHeight)) {
- setPtr->yScrollbarWidth = Tk_ReqWidth(setPtr->yScrollbar);
- cavityWidth -= setPtr->yScrollbarWidth;
- setPtr->flags |= DISPLAY_Y;
- }
-#ifdef notdef
- fprintf(stderr, "ComputeSlaveGeometry: 2 cavityWidth=%d, cavityHeight=%d slaveWidth=%d, slaveHeight=%d\n",
- cavityWidth, cavityHeight, slaveWidth, slaveHeight);
-
-#endif
- dx = dy = 0;
- if ((cavityWidth - PADDING(setPtr->xPad)) > slaveWidth) {
- cavityWidth -= PADDING(setPtr->xPad);
- if (setPtr->fill & FILL_X) {
- slaveWidth = cavityWidth;
- if (slaveWidth > setPtr->reqSlaveWidth.max) {
- slaveWidth = setPtr->reqSlaveWidth.max;
- }
- } else {
- dx = (cavityWidth - slaveWidth);
- }
- setPtr->xOffset = 0;
- } else if (setPtr->flags & SLAVE_XVIEW) {
- slaveWidth = cavityWidth;
- }
- if ((cavityHeight - PADDING(setPtr->yPad)) > slaveHeight) {
- cavityHeight -= PADDING(setPtr->yPad);
- if (setPtr->fill & FILL_Y) {
- slaveHeight = cavityHeight;
- if (slaveHeight > setPtr->reqSlaveHeight.max) {
- slaveHeight = setPtr->reqSlaveHeight.max;
- }
- } else {
- dy = (cavityHeight - slaveHeight);
- }
- setPtr->yOffset = 0;
- } else if (setPtr->flags & SLAVE_YVIEW) {
- slaveHeight = cavityHeight;
- }
- x = y = 0;
- if ((dx > 0) || (dy > 0)) {
- TranslateAnchor(dx, dy, setPtr->anchor, &x, &y);
- }
-#ifdef notdef
- fprintf(stderr, "ComputeSlaveGeometry: 3 cavityWidth=%d, cavityHeight=%d slaveWidth=%d, slaveHeight=%d\n",
- cavityWidth, cavityHeight, slaveWidth, slaveHeight);
-#endif
- setPtr->shangleHeight = setPtr->xScrollbarHeight;
- setPtr->shangleWidth = setPtr->yScrollbarWidth;
- setPtr->yScrollbarHeight = cavityHeight - setPtr->xScrollbarHeight;
- setPtr->xScrollbarWidth = cavityWidth - setPtr->yScrollbarWidth;
-
- if (setPtr->slave != NULL) {
- if ((setPtr->xScrollbar == NULL) && (slaveWidth > cavityWidth)) {
- slaveWidth = cavityWidth;
- if (slaveWidth < setPtr->reqSlaveWidth.min) {
- slaveWidth = setPtr->reqSlaveWidth.min;
- }
- }
- if ((setPtr->yScrollbar == NULL) && (slaveHeight > cavityHeight)) {
- slaveHeight = cavityHeight;
- if (slaveHeight < setPtr->reqSlaveHeight.min) {
- slaveHeight = setPtr->reqSlaveHeight.min;
- }
- }
- if (cavityWidth > slaveWidth) {
- x += Tk_Changes(setPtr->slave)->border_width;
- } else {
- x = Tk_Changes(setPtr->slave)->border_width;
- }
- if (cavityHeight > slaveHeight) {
- y += Tk_Changes(setPtr->slave)->border_width;
- } else {
- y = Tk_Changes(setPtr->slave)->border_width;
- }
- }
-#ifdef notdef
- fprintf(stderr, "ComputeSlaveGeometry: final cavityWidth=%d, cavityHeight=%d slaveWidth=%d, slaveHeight=%d\n",
- cavityWidth, cavityHeight, slaveWidth, slaveHeight);
-#endif
- setPtr->slaveX = x;
- setPtr->slaveY = y;
- setPtr->slaveWidth = slaveWidth;
- setPtr->slaveHeight = slaveHeight;
- setPtr->cavityWidth = cavityWidth;
- setPtr->cavityHeight = cavityHeight;
-
- /* Adjust the scroll offsets to put as much of the slave widget in view as
- * possible. */
- if ((setPtr->flags & SLAVE_YVIEW) == 0) {
- if ((slaveHeight - setPtr->yOffset) < cavityHeight) {
- setPtr->yOffset = slaveHeight - cavityHeight;
- }
- setPtr->flags |= SCROLLY;
- }
- if ((setPtr->flags & SLAVE_XVIEW) == 0) {
- if ((slaveWidth - setPtr->xOffset) < cavityWidth) {
- setPtr->xOffset = slaveWidth - cavityWidth;
- }
- setPtr->flags |= SCROLLX;
- }
- setPtr->flags &= ~LAYOUT_PENDING;
-}
-
-static int
-ConfigureScrollset(Tcl_Interp *interp, Scrollset *setPtr, int objc,
- Tcl_Obj *const *objv, int flags)
-{
- int updateNeeded;
-
- if (Blt_ConfigureWidgetFromObj(interp, setPtr->tkwin, scrollsetSpecs,
- objc, objv, (char *)setPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Install the scrollbars and slave widget at a later time after the
- * scrollset window has been created. We defer installing the slave and
- * scrollbars so the scrollbar widgets don't have to exist when they are
- * specified by the -xscrollbar, -yscrollbar, and -window options
- * respectively. The down-side is that errors messages will be backgrounded.
- */
- updateNeeded = FALSE;
- if (Blt_ConfigModified(scrollsetSpecs, "-xscrollbar", (char *)NULL)) {
- if (setPtr->xScrollbar != NULL) {
- UnmanageWindow(setPtr, setPtr->xScrollbar);
- setPtr->xScrollbar = NULL;
- }
- if ((setPtr->flags & XSCROLLBAR_PENDING) == 0) {
- Tcl_DoWhenIdle(InstallXScrollbar, setPtr);
- setPtr->flags |= XSCROLLBAR_PENDING;
- }
- updateNeeded = TRUE;
- }
- if (Blt_ConfigModified(scrollsetSpecs, "-yscrollbar", (char *)NULL)) {
- if (setPtr->yScrollbar != NULL) {
- UnmanageWindow(setPtr, setPtr->yScrollbar);
- setPtr->yScrollbar = NULL;
- }
- if ((setPtr->flags & YSCROLLBAR_PENDING) == 0) {
- Tcl_DoWhenIdle(InstallYScrollbar, setPtr);
- setPtr->flags |= YSCROLLBAR_PENDING;
- }
- updateNeeded = TRUE;
- }
- if (Blt_ConfigModified(scrollsetSpecs, "-window", (char *)NULL)) {
- if (setPtr->slave != NULL) {
- UnmanageWindow(setPtr, setPtr->slave);
- setPtr->slave = NULL;
- }
- if ((setPtr->flags & SLAVE_PENDING) == 0) {
- Tcl_DoWhenIdle(InstallSlave, setPtr);
- setPtr->flags |= SLAVE_PENDING;
- }
- updateNeeded = TRUE;
- }
- if (updateNeeded) {
- if ((setPtr->flags & UPDATE_PENDING) == 0) {
- Tcl_DoWhenIdle(UpdateScrollset, setPtr);
- setPtr->flags |= UPDATE_PENDING;
- }
- }
- return TCL_OK;
-}
-
-/* Widget Callbacks */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollsetEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * comboentry widgets.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ScrollsetEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Scrollset *setPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(setPtr);
- }
- } else if (eventPtr->type == ConfigureNotify) {
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
- } else if (eventPtr->type == DestroyNotify) {
- if (setPtr->tkwin != NULL) {
- setPtr->tkwin = NULL;
- }
- if (setPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayScrollset, setPtr);
- }
- if (setPtr->flags & XSCROLLBAR_PENDING) {
- Tcl_CancelIdleCall(InstallXScrollbar, setPtr);
- }
- if (setPtr->flags & YSCROLLBAR_PENDING) {
- Tcl_CancelIdleCall(InstallYScrollbar, setPtr);
- }
- if (setPtr->flags & SLAVE_PENDING) {
- Tcl_CancelIdleCall(InstallSlave, setPtr);
- }
- if (setPtr->flags & UPDATE_PENDING) {
- Tcl_CancelIdleCall(UpdateScrollset, setPtr);
- }
- Tcl_EventuallyFree(setPtr, DestroyScrollset);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WindowEventProc --
- *
- * This procedure is invoked by the Tk event handler when StructureNotify
- * events occur in a scrollbar managed by the widget.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-WindowEventProc(
- ClientData clientData, /* Pointer to Entry structure for widget
- * referred to by eventPtr. */
- XEvent *eventPtr) /* Describes what just happened. */
-{
- Scrollset *setPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(setPtr);
- }
- } else if (eventPtr->type == ConfigureNotify) {
- EventuallyRedraw(setPtr);
- } else if (eventPtr->type == DestroyNotify) {
- if ((setPtr->yScrollbar != NULL) &&
- (eventPtr->xany.window == Tk_WindowId(setPtr->yScrollbar))) {
- setPtr->yScrollbar = NULL;
- } else if ((setPtr->xScrollbar != NULL) &&
- (eventPtr->xany.window == Tk_WindowId(setPtr->xScrollbar))) {
- setPtr->xScrollbar = NULL;
- } else if ((setPtr->slave != NULL) &&
- (eventPtr->xany.window == Tk_WindowId(setPtr->slave))) {
- setPtr->slave = NULL;
- } else if ((setPtr->shangle != NULL) &&
- (eventPtr->xany.window == Tk_WindowId(setPtr->shangle))) {
- setPtr->shangle = NULL;
- }
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollsetCustodyProc --
- *
- * This procedure is invoked when a scrollbar has been stolen by another
- * geometry manager.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the scrollset to have its layout re-arranged at the next
- * idle point.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-ScrollsetCustodyProc(ClientData clientData, Tk_Window tkwin)
-{
- Scrollset *setPtr = (Scrollset *)clientData;
-
- if (tkwin == setPtr->yScrollbar) {
- setPtr->yScrollbar = NULL;
- setPtr->yScrollbarWidth = 0;
- setPtr->flags &= ~DISPLAY_Y;
- } else if (tkwin == setPtr->xScrollbar) {
- setPtr->xScrollbar = NULL;
- setPtr->xScrollbarHeight = 0;
- setPtr->flags &= ~DISPLAY_X;
- } else if (tkwin == setPtr->slave) {
- setPtr->slave = NULL;
- setPtr->slaveWidth = setPtr->slaveHeight = 0;
- setPtr->flags &= ~(DISPLAY_X|DISPLAY_Y);
- }
- Tk_UnmaintainGeometry(tkwin, setPtr->tkwin);
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollsetGeometryProc --
- *
- * This procedure is invoked by Tk_GeometryRequest for scrollbars managed
- * by the scrollset.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the scrollset to have its layout re-computed and
- * re-arranged at the next idle point.
- *
- * --------------------------------------------------------------------------
-*/
-/* ARGSUSED */
-static void
-ScrollsetGeometryProc(ClientData clientData, Tk_Window tkwin)
-{
- Scrollset *setPtr = (Scrollset *)clientData;
-
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
-}
-
-/* Widget Operations */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm configure ?option value?...
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(Scrollset *setPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int result;
-
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, setPtr->tkwin, scrollsetSpecs,
- (char *)setPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, setPtr->tkwin, scrollsetSpecs,
- (char *)setPtr, objv[2], 0);
- }
- Tcl_Preserve(setPtr);
- result = ConfigureScrollset(interp, setPtr, objc - 2, objv + 2,
- BLT_CONFIG_OBJV_ONLY);
- Tcl_Release(setPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Results:
- * Standard TCL result.
- *
- * Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
- *
- * .cm cget option
- *
- *---------------------------------------------------------------------------
- */
-static int
-CgetOp(Scrollset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- return Blt_ConfigureValueFromObj(interp, setPtr->tkwin, scrollsetSpecs,
- (char *)setPtr, objv[2], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetOp --
- *
- * Relays the "set" operation from the slave widget to scrollbar. This
- * routine checks to see if the first/last values are 0 and 1 respectively,
- * indicating no scrollbar is necessary. This is used for slave widgets
- * with scrolling capabilities to determine when scrollbars are needed.
- *
- * .ss set x first last
- * .ss set y first last
- *
- *---------------------------------------------------------------------------
- */
-static int
-SetOp(Scrollset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *scrollObjPtr;
- const char *string;
- unsigned int flag;
- int useX;
-
- string = Tcl_GetString(objv[2]);
- flag = 0;
- if ((string[0] == 'x') && (string[1] == '\0')) {
- scrollObjPtr = setPtr->xScrollbarObjPtr;
- useX = TRUE;
- if (setPtr->flags & SLAVE_XVIEW) {
- flag = DISPLAY_X;
- }
- } else if ((string[0] == 'y') && (string[1] == '\0')) {
- scrollObjPtr = setPtr->yScrollbarObjPtr;
- useX = FALSE;
- if (setPtr->flags & SLAVE_YVIEW) {
- flag = DISPLAY_Y;
- }
- } else {
- Tcl_AppendResult(interp, "bad scrollbar argument: should be x or y",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (flag != 0) {
- double first, last;
-
- /* Examine the set values from the slave. */
- if (Tcl_GetDoubleFromObj(interp, objv[3], &first) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tcl_GetDoubleFromObj(interp, objv[4], &last) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((first <= 0.0) && (last >= 1.0)) {
- setPtr->flags &= ~flag; /* Hide scrollbar. */
- if (useX) {
- setPtr->worldWidth = 0;
- } else {
- setPtr->worldHeight = 0;
- }
- } else if (useX) {
- setPtr->worldWidth = 0;
- if ((last > first) && (Tk_Width(setPtr->slave) > 1)) {
- setPtr->worldWidth =
- (int)((double)Tk_Width(setPtr->slave) / (last - first));
- }
- setPtr->flags |= DISPLAY_X; /* Display y-scrollbar. */
- } else {
- setPtr->worldHeight = 0;
- if ((last > first) && (Tk_Height(setPtr->slave) > 1)) {
- setPtr->worldHeight =
- (int)((double)Tk_Height(setPtr->slave) / (last - first));
- }
- setPtr->flags |= DISPLAY_Y; /* Display y-scrollbar. */
- }
- setPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(setPtr);
- }
- if (scrollObjPtr != NULL) {
- Tcl_Obj *cmdv[4];
-
- /* Now relay the "set" command to the appropiate scrollbar. */
- cmdv[0] = scrollObjPtr;
- cmdv[1] = Tcl_NewStringObj("set", 3);
- cmdv[2] = objv[3];
- cmdv[3] = objv[4];
- if (Blt_GlobalEvalObjv(interp, 4, cmdv) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-static int
-XviewOp(Scrollset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int w;
-
- if (setPtr->flags & SLAVE_XVIEW) {
- Tcl_Obj *cmdObjPtr;
- int i;
- int result;
-
- /* The slave widget has a "xview" operation. Simply relay the
- * information on to the slave widget by calling its "xview"
- * operation. */
- if (setPtr->xViewCmdObjPtr != NULL) {
- cmdObjPtr = Tcl_DuplicateObj(setPtr->xViewCmdObjPtr);
- } else {
- cmdObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, cmdObjPtr, setPtr->slaveObjPtr);
- Tcl_ListObjAppendElement(interp, cmdObjPtr,
- Tcl_NewStringObj("xview", 5));
- }
- for (i = 2; i < objc; i++) {
- Tcl_ListObjAppendElement(interp, cmdObjPtr, objv[i]);
- }
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- return result;
- }
- w = VPORTWIDTH(setPtr);
- if (objc == 2) {
- double first, last;
- Tcl_Obj *listObjPtr;
-
- /*
- * Note: we are bounding the fractions between 0.0 and 1.0 to support
- * the "canvas"-style of scrolling.
- */
- if (setPtr->worldWidth < 1) {
- first = 0.0, last = 1.0;
- } else {
- first = (double)setPtr->xOffset / setPtr->worldHeight;
- last = (double)(setPtr->xOffset + w) / setPtr->worldWidth;
- first = FCLAMP(first);
- last = FCLAMP(last);
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(first));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(last));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2, &setPtr->xOffset,
- setPtr->worldWidth, w, setPtr->xScrollUnits,
- BLT_SCROLL_MODE_HIERBOX) != TCL_OK) {
- return TCL_ERROR;
- }
- setPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-
-static int
-YviewOp(Scrollset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int height;
-
- if (setPtr->flags & SLAVE_YVIEW) {
- Tcl_Obj *cmdObjPtr;
- int i;
- int result;
-
- /* The slave widget has a "yview" operation. Simply relay the
- * information on to the slave widget by calling its "yview"
- * operation. */
- if (setPtr->yViewCmdObjPtr != NULL) {
- cmdObjPtr = Tcl_DuplicateObj(setPtr->yViewCmdObjPtr);
- } else {
- cmdObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, cmdObjPtr, setPtr->slaveObjPtr);
- Tcl_ListObjAppendElement(interp, cmdObjPtr,
- Tcl_NewStringObj("yview", 5));
- }
- for (i = 2; i < objc; i++) {
- Tcl_ListObjAppendElement(interp, cmdObjPtr, objv[i]);
- }
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- return result;
- }
-
- height = VPORTHEIGHT(setPtr);
- if (objc == 2) {
- double fract;
-
- /*
- * Note: we are bounding the fractions between 0.0 and 1.0 to support
- * the "canvas"-style of scrolling.
- */
- fract = (double)setPtr->yOffset / setPtr->worldHeight;
- Tcl_AppendElement(interp, Blt_Dtoa(interp, FCLAMP(fract)));
- fract = (double)(setPtr->yOffset + height) / setPtr->worldHeight;
- Tcl_AppendElement(interp, Blt_Dtoa(interp, FCLAMP(fract)));
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2, &setPtr->yOffset,
- setPtr->worldHeight, height, setPtr->yScrollUnits,
- BLT_SCROLL_MODE_HIERBOX) != TCL_OK) {
- return TCL_ERROR;
- }
- setPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyScrollset --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the internal structure of the widget at a safe time (when
- * no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyScrollset(DestroyData dataPtr) /* Pointer to the widget
- * record. */
-{
- Scrollset *setPtr = (Scrollset *)dataPtr;
-
- if (setPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayScrollset, setPtr);
- }
- if (setPtr->flags & XSCROLLBAR_PENDING) {
- Tcl_CancelIdleCall(InstallXScrollbar, setPtr);
- }
- if (setPtr->flags & YSCROLLBAR_PENDING) {
- Tcl_CancelIdleCall(InstallYScrollbar, setPtr);
- }
- if (setPtr->flags & SLAVE_PENDING) {
- Tcl_CancelIdleCall(InstallSlave, setPtr);
- }
- if (setPtr->flags & UPDATE_PENDING) {
- Tcl_CancelIdleCall(UpdateScrollset, setPtr);
- }
- Blt_FreeOptions(scrollsetSpecs, (char *)setPtr, setPtr->display, 0);
- Tcl_DeleteCommandFromToken(setPtr->interp, setPtr->cmdToken);
- Blt_Free(setPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewScrollset --
- *
- *---------------------------------------------------------------------------
- */
-static Scrollset *
-NewScrollset(Tcl_Interp *interp, Tk_Window tkwin)
-{
- Scrollset *setPtr;
-
- setPtr = Blt_AssertCalloc(1, sizeof(Scrollset));
-
- Tk_SetClass(tkwin, "Scrollset");
- setPtr->tkwin = tkwin;
- setPtr->display = Tk_Display(tkwin);
- setPtr->interp = interp;
- setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- setPtr->xScrollUnits = 2;
- setPtr->yScrollUnits = 2;
- setPtr->anchor = TK_ANCHOR_CENTER;
- setPtr->fill = FILL_BOTH;
- ResetLimits(&setPtr->reqSlaveWidth);
- ResetLimits(&setPtr->reqSlaveHeight);
- Blt_SetWindowInstanceData(tkwin, setPtr);
- return setPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollsetCmd --
- *
- * This procedure is invoked to process the "scrollset" command. See the
- * user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec scrollsetOps[] =
-{
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"configure", 2, ConfigureOp, 2, 0, "?option value?...",},
- {"set", 1, SetOp, 5, 5, "x|y first last",},
- {"xview", 1, XviewOp, 2, 5,
- "?moveto fract? ?scroll number what?",},
- {"yview", 1, YviewOp, 2, 5,
- "?moveto fract? ?scroll number what?",},
-};
-
-static int nScrollsetOps = sizeof(scrollsetOps) / sizeof(Blt_OpSpec);
-
-typedef int (ScrollsetInstOp)(Scrollset *setPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-static int
-ScrollsetInstCmdProc(
- ClientData clientData, /* Information about the widget. */
- Tcl_Interp *interp, /* Interpreter to report errors back
- * to. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument vector. */
-{
- ScrollsetInstOp *proc;
- Scrollset *setPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nScrollsetOps, scrollsetOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(setPtr);
- result = (*proc) (setPtr, interp, objc, objv);
- Tcl_Release(setPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollsetInstCmdDeletedProc --
- *
- * This procedure can be called if the window was destroyed (tkwin will
- * be NULL) and the command was deleted automatically. In this case, we
- * need to do nothing.
- *
- * Otherwise this routine was called because the command was deleted.
- * Then we need to clean-up and destroy the widget.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ScrollsetInstCmdDeletedProc(ClientData clientData)
-{
- Scrollset *setPtr = clientData; /* Pointer to widget record. */
-
- if (setPtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = setPtr->tkwin;
- setPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollsetCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-ScrollsetCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Scrollset *setPtr;
- Tk_Window tkwin;
- unsigned int mask;
- Tcl_CmdInfo cmdInfo;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
- Tcl_GetString(objv[1]), (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- setPtr = NewScrollset(interp, tkwin);
- if (ConfigureScrollset(interp, setPtr, objc - 2, objv + 2, 0) != TCL_OK) {
- Tk_DestroyWindow(setPtr->tkwin);
- return TCL_ERROR;
- }
- mask = (ExposureMask | StructureNotifyMask);
- Tk_CreateEventHandler(tkwin, mask, ScrollsetEventProc, setPtr);
- setPtr->cmdToken = Tcl_CreateObjCommand(interp, Tk_PathName(tkwin),
- ScrollsetInstCmdProc, setPtr, ScrollsetInstCmdDeletedProc);
-
- /*
- * The shangle is a small window covering the lower-right corner of the
- * widget that is unobscurred by both the horizontal of vertical
- * scrollbar. You can pack a widget into it or use "bind" to add
- * shangle-like resize behaviors.
- */
- setPtr->shangle = Tk_CreateWindow(interp, tkwin, "shangle", (char *)NULL);
- Tk_CreateEventHandler(setPtr->shangle, mask, WindowEventProc, setPtr);
-
- /*
- * First time in this interpreter, load in a procedure to initialize various
- * bindings on the scrollset widget. We deferred sourcing the file until
- * now so that the variable $blt_library can be set within a script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::Scrollset::ConfigureScrollbars",
- &cmdInfo)) {
- if (Tcl_GlobalEval(interp,
- "source [file join $blt_library scrollset.tcl]") != TCL_OK) {
- char info[200];
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- return TCL_ERROR;
- }
- }
- Tcl_SetObjResult(interp, objv[1]);
- return TCL_OK;
-}
-
-int
-Blt_ScrollsetCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "scrollset", ScrollsetCmd, };
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-static void
-DrawScrollset(Scrollset *setPtr)
-{
- if (setPtr->slave != NULL) {
- /*
- * If the widget is too small (i.e. it has only an external border)
- * then unmap it.
- */
- if ((setPtr->slaveWidth < 1) || (setPtr->slaveHeight < 1)) {
- if (Tk_IsMapped(setPtr->slave)) {
- if (setPtr->tkwin != Tk_Parent(setPtr->slave)) {
- Tk_UnmaintainGeometry(setPtr->slave, setPtr->tkwin);
- }
- Tk_UnmapWindow(setPtr->slave);
- }
- } else {
- int x, y;
-
- x = setPtr->slaveX;
- y = setPtr->slaveY;
- if (setPtr->xOffset > 0) {
- x -= setPtr->xOffset;
- }
- if (setPtr->yOffset > 0) {
- y -= setPtr->yOffset;
- }
- if (setPtr->tkwin != Tk_Parent(setPtr->slave)) {
- Tk_MaintainGeometry(setPtr->slave, setPtr->tkwin, x, y,
- setPtr->slaveWidth, setPtr->slaveHeight);
- } else {
- if ((x != Tk_X(setPtr->slave)) || (y != Tk_Y(setPtr->slave)) ||
- (setPtr->slaveWidth != Tk_Width(setPtr->slave)) ||
- (setPtr->slaveHeight != Tk_Height(setPtr->slave))) {
-#ifdef notdef
- fprintf(stderr, "Slave Resize %s %d,%d %dx%d\n",
- Tk_PathName(setPtr->slave), x, y, setPtr->slaveWidth,
- setPtr->slaveHeight);
-#endif
- Tk_MoveResizeWindow(setPtr->slave, x, y,
- setPtr->slaveWidth, setPtr->slaveHeight);
- }
- if (!Tk_IsMapped(setPtr->slave)) {
- Tk_MapWindow(setPtr->slave);
- }
- }
- }
- }
-
- /* Manage the geometry of the scrollbars. */
-
- if (setPtr->yScrollbarWidth > 0) {
- int x, y;
- int yScrollbarHeight;
-
- x = VPORTWIDTH(setPtr);
- y = 0;
- yScrollbarHeight = VPORTHEIGHT(setPtr);
- if ((Tk_Width(setPtr->yScrollbar) != setPtr->yScrollbarWidth) ||
- (Tk_Height(setPtr->yScrollbar) != yScrollbarHeight) ||
- (x != Tk_X(setPtr->yScrollbar)) ||
- (y != Tk_Y(setPtr->yScrollbar))) {
- Tk_MoveResizeWindow(setPtr->yScrollbar, x, y,
- setPtr->yScrollbarWidth, yScrollbarHeight);
- }
- if (!Tk_IsMapped(setPtr->yScrollbar)) {
- Tk_MapWindow(setPtr->yScrollbar);
- XRaiseWindow(setPtr->display, Tk_WindowId(setPtr->yScrollbar));
- }
- } else if ((setPtr->yScrollbar != NULL) &&
- (Tk_IsMapped(setPtr->yScrollbar))) {
- Tk_UnmapWindow(setPtr->yScrollbar);
- }
-
- if (setPtr->xScrollbarHeight > 0) {
- int x, y;
- int xScrollbarWidth;
-
- x = 0;
- y = VPORTHEIGHT(setPtr);
- xScrollbarWidth = VPORTWIDTH(setPtr);
- if ((Tk_Width(setPtr->xScrollbar) != xScrollbarWidth) ||
- (Tk_Height(setPtr->xScrollbar) != setPtr->xScrollbarHeight) ||
- (x != Tk_X(setPtr->xScrollbar)) ||
- (y != Tk_Y(setPtr->xScrollbar))) {
- Tk_MoveResizeWindow(setPtr->xScrollbar, x, y, xScrollbarWidth,
- setPtr->xScrollbarHeight);
- }
- if (!Tk_IsMapped(setPtr->xScrollbar)) {
- Tk_MapWindow(setPtr->xScrollbar);
- XRaiseWindow(setPtr->display, Tk_WindowId(setPtr->xScrollbar));
- }
- } else if ((setPtr->xScrollbar != NULL) &&
- (Tk_IsMapped(setPtr->xScrollbar))) {
- Tk_UnmapWindow(setPtr->xScrollbar);
- }
-
- if ((setPtr->yScrollbarWidth > 0) && (setPtr->xScrollbarHeight > 0)) {
- int shangleX, shangleY;
- int shangleWidth, shangleHeight;
-
- shangleX = VPORTWIDTH(setPtr);
- shangleY = VPORTHEIGHT(setPtr);
- shangleWidth = setPtr->yScrollbarWidth;
- shangleHeight = setPtr->xScrollbarHeight;
- if ((shangleX != Tk_X(setPtr->shangle)) ||
- (shangleY != Tk_Y(setPtr->shangle)) ||
- (shangleWidth != Tk_Width(setPtr->shangle)) ||
- (shangleHeight != Tk_Height(setPtr->shangle))) {
- Tk_MoveResizeWindow(setPtr->shangle, shangleX,
- shangleY, shangleWidth, shangleHeight);
- }
- if (!Tk_IsMapped(setPtr->shangle)) {
- Tk_MapWindow(setPtr->shangle);
- XRaiseWindow(setPtr->display, Tk_WindowId(setPtr->shangle));
- }
- Blt_FillBackgroundRectangle(setPtr->shangle,
- Tk_WindowId(setPtr->shangle), setPtr->bg,
- 0, 0, shangleWidth, shangleHeight, 0, TK_RELIEF_FLAT);
-
- } else {
- Tk_UnmapWindow(setPtr->shangle);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayScrollset --
- *
- * This procedure is invoked to display a scrollset widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the menu.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayScrollset(ClientData clientData)
-{
- Scrollset *setPtr = clientData;
- int reqWidth, reqHeight;
-
- setPtr->flags &= ~REDRAW_PENDING;
- if (setPtr->tkwin == NULL) {
- return; /* Window destroyed (should not get
- * here) */
- }
-#ifdef notdef
- fprintf(stderr, "Calling DisplayScrollset(%s)\n",
- Tk_PathName(setPtr->tkwin));
-#endif
- /*
- * The request size of the host container is always the requested
- * size of the slave widget without scrollbars. Only when the size
- * of the window is less than the requested size to we add scrollbars
- * (non-scrolling widgets).
- */
- reqWidth = (setPtr->reqWidth > 0) ? setPtr->reqWidth :
- GetSlaveReqWidth(setPtr);
- reqHeight = (setPtr->reqHeight > 0) ? setPtr->reqHeight :
- GetSlaveReqHeight(setPtr);
-
- if ((reqWidth != Tk_ReqWidth(setPtr->tkwin)) ||
- (reqHeight != Tk_ReqHeight(setPtr->tkwin))) {
-#ifdef notdef
- fprintf(stderr, "DisplayScrollset: %s geometry request = %dx%d\n",
- Tk_PathName(setPtr->tkwin), reqWidth, reqHeight);
-#endif
- Tk_GeometryRequest(setPtr->tkwin, reqWidth, reqHeight);
- }
-
- if ((Tk_Width(setPtr->tkwin) <= 1) || (Tk_Height(setPtr->tkwin) <= 1)){
- /* Don't bother computing the layout until the window size is
- * something reasonable. */
- return;
- }
- if (setPtr->flags & LAYOUT_PENDING) {
- ComputeSlaveGeometry(setPtr);
- }
- if (!Tk_IsMapped(setPtr->tkwin)) {
- /* The scrollset's window isn't displayed, so don't bother drawing
- * anything. By getting this far, we've at least computed the
- * coordinates of the scrollset's new layout. */
- return;
- }
- if (setPtr->flags & SCROLL_PENDING) {
- int w, h;
- /*
- * The view port has changed. The scrollbars need to be updated.
- */
- w = VPORTWIDTH(setPtr);
- h = VPORTHEIGHT(setPtr);
- if ((setPtr->xScrollCmdObjPtr != NULL) && (setPtr->flags & SCROLLX)) {
- Blt_UpdateScrollbar(setPtr->interp, setPtr->xScrollCmdObjPtr,
- setPtr->xOffset, setPtr->xOffset + w, setPtr->worldWidth);
- }
- if ((setPtr->yScrollCmdObjPtr != NULL) && (setPtr->flags & SCROLLY)) {
- Blt_UpdateScrollbar(setPtr->interp, setPtr->yScrollCmdObjPtr,
- setPtr->yOffset, setPtr->yOffset + h, setPtr->worldHeight);
- }
- setPtr->flags &= ~SCROLL_PENDING;
- }
- if ((setPtr->slaveWidth < VPORTWIDTH(setPtr)) ||
- (setPtr->slaveHeight < VPORTHEIGHT(setPtr))) {
- Blt_FillBackgroundRectangle(setPtr->tkwin, Tk_WindowId(setPtr->tkwin),
- setPtr->bg, 0, 0, VPORTWIDTH(setPtr), VPORTHEIGHT(setPtr),
- 0, TK_RELIEF_FLAT);
- }
- DrawScrollset(setPtr);
-}
diff --git a/blt3.0.1/src/bltSpline.c b/blt3.0.1/src/bltSpline.c
deleted file mode 100644
index 3f3b621..0000000
--- a/blt3.0.1/src/bltSpline.c
+++ /dev/null
@@ -1,1399 +0,0 @@
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include <bltVector.h>
-
-typedef int (SplineProc)(Point2d origPts[], int nOrigPts, Point2d intpPts[],
- int nIntpPts);
-
-typedef double TriDiagonalMatrix[3];
-typedef struct {
- double b, c, d;
-} Cubic2D;
-
-typedef struct {
- double b, c, d, e, f;
-} Quint2D;
-
-/*
- * Quadratic spline parameters
- */
-#define E1 param[0]
-#define E2 param[1]
-#define V1 param[2]
-#define V2 param[3]
-#define W1 param[4]
-#define W2 param[5]
-#define Z1 param[6]
-#define Z2 param[7]
-#define Y1 param[8]
-#define Y2 param[9]
-
-static Tcl_ObjCmdProc SplineCmd;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Search --
- *
- * Conducts a binary search for a value. This routine is called
- * only if key is between x(0) and x(len - 1).
- *
- * Results:
- * Returns the index of the largest value in xtab for which
- * x[i] < key.
- *
- *---------------------------------------------------------------------------
- */
-static int
-Search(
- Point2d points[], /* Contains the abscissas of the data
- * points of interpolation. */
- int nPoints, /* Dimension of x. */
- double key, /* Value whose relative position in
- * x is to be located. */
- int *foundPtr) /* (out) Returns 1 if s is found in
- * x and 0 otherwise. */
-{
- int high, low, mid;
-
- low = 0;
- high = nPoints - 1;
-
- while (high >= low) {
- mid = (high + low) / 2;
- if (key > points[mid].x) {
- low = mid + 1;
- } else if (key < points[mid].x) {
- high = mid - 1;
- } else {
- *foundPtr = 1;
- return mid;
- }
- }
- *foundPtr = 0;
- return low;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * QuadChoose --
- *
- * Determines the case needed for the computation of the parame-
- * ters of the quadratic spline.
- *
- * Results:
- * Returns a case number (1-4) which controls how the parameters
- * of the quadratic spline are evaluated.
- *
- *---------------------------------------------------------------------------
- */
-static int
-QuadChoose(
- Point2d *p, /* Coordinates of one of the points of
- * interpolation */
- Point2d *q, /* Coordinates of one of the points of
- * interpolation */
- double m1, /* Derivative condition at point P */
- double m2, /* Derivative condition at point Q */
- double epsilon) /* Error tolerance used to distinguish
- * cases when m1 or m2 is relatively
- * close to the slope or twice the
- * slope of the line segment joining
- * the points P and Q. If
- * epsilon is not 0.0, then epsilon
- * should be greater than or equal to
- * machine epsilon. */
-{
- double slope;
-
- /* Calculate the slope of the line joining P and Q. */
- slope = (q->y - p->y) / (q->x - p->x);
-
- if (slope != 0.0) {
- double relerr;
- double mref, mref1, mref2, prod1, prod2;
-
- prod1 = slope * m1;
- prod2 = slope * m2;
-
- /* Find the absolute values of the slopes slope, m1, and m2. */
- mref = FABS(slope);
- mref1 = FABS(m1);
- mref2 = FABS(m2);
-
- /*
- * If the relative deviation of m1 or m2 from slope is less than
- * epsilon, then choose case 2 or case 3.
- */
- relerr = epsilon * mref;
- if ((FABS(slope - m1) > relerr) && (FABS(slope - m2) > relerr) &&
- (prod1 >= 0.0) && (prod2 >= 0.0)) {
- double prod;
-
- prod = (mref - mref1) * (mref - mref2);
- if (prod < 0.0) {
- /*
- * l1, the line through (x1,y1) with slope m1, and l2,
- * the line through (x2,y2) with slope m2, intersect
- * at a point whose abscissa is between x1 and x2.
- * The abscissa becomes a knot of the spline.
- */
- return 1;
- }
- if (mref1 > (mref * 2.0)) {
- if (mref2 <= ((2.0 - epsilon) * mref)) {
- return 3;
- }
- } else if (mref2 <= (mref * 2.0)) {
- /*
- * Both l1 and l2 cross the line through
- * (x1+x2)/2.0,y1 and (x1+x2)/2.0,y2, which is the
- * midline of the rectangle formed by P and Q or both
- * m1 and m2 have signs different than the sign of
- * slope, or one of m1 and m2 has opposite sign from
- * slope and l1 and l2 intersect to the left of x1 or
- * to the right of x2. The point (x1+x2)/2. is a knot
- * of the spline.
- */
- return 2;
- } else if (mref1 <= ((2.0 - epsilon) * mref)) {
- /*
- * In cases 3 and 4, sign(m1)=sign(m2)=sign(slope).
- * Either l1 or l2 crosses the midline, but not both.
- * Choose case 4 if mref1 is greater than
- * (2.-epsilon)*mref; otherwise, choose case 3.
- */
- return 3;
- }
- /*
- * If neither l1 nor l2 crosses the midline, the spline
- * requires two knots between x1 and x2.
- */
- return 4;
- } else {
- /*
- * The sign of at least one of the slopes m1 or m2 does not
- * agree with the sign of *slope*.
- */
- if ((prod1 < 0.0) && (prod2 < 0.0)) {
- return 2;
- } else if (prod1 < 0.0) {
- if (mref2 > ((epsilon + 1.0) * mref)) {
- return 1;
- } else {
- return 2;
- }
- } else if (mref1 > ((epsilon + 1.0) * mref)) {
- return 1;
- } else {
- return 2;
- }
- }
- } else if ((m1 * m2) >= 0.0) {
- return 2;
- } else {
- return 1;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * QuadCases --
- *
- * Computes the knots and other parameters of the spline on the
- * interval PQ.
- *
- *
- * On input--
- *
- * P and Q are the coordinates of the points of interpolation.
- *
- * m1 is the slope at P.
- *
- * m2 is the slope at Q.
- *
- * ncase controls the number and location of the knots.
- *
- *
- * On output--
- *
- * (v1,v2),(w1,w2),(z1,z2), and (e1,e2) are the coordinates of
- * the knots and other parameters of the spline on P.
- * (e1,e2) and Q are used only if ncase=4.
- *
- *---------------------------------------------------------------------------
- */
-static void
-QuadCases(Point2d *p, Point2d *q, double m1, double m2, double param[],
- int which)
-{
- if ((which == 3) || (which == 4)) { /* Parameters used in both 3 and 4 */
- double mbar1, mbar2, mbar3, c1, d1, h1, j1, k1;
-
- c1 = p->x + (q->y - p->y) / m1;
- d1 = q->x + (p->y - q->y) / m2;
- h1 = c1 * 2.0 - p->x;
- j1 = d1 * 2.0 - q->x;
- mbar1 = (q->y - p->y) / (h1 - p->x);
- mbar2 = (p->y - q->y) / (j1 - q->x);
-
- if (which == 4) { /* Case 4. */
- Y1 = (p->x + c1) / 2.0;
- V1 = (p->x + Y1) / 2.0;
- V2 = m1 * (V1 - p->x) + p->y;
- Z1 = (d1 + q->x) / 2.0;
- W1 = (q->x + Z1) / 2.0;
- W2 = m2 * (W1 - q->x) + q->y;
- mbar3 = (W2 - V2) / (W1 - V1);
- Y2 = mbar3 * (Y1 - V1) + V2;
- Z2 = mbar3 * (Z1 - V1) + V2;
- E1 = (Y1 + Z1) / 2.0;
- E2 = mbar3 * (E1 - V1) + V2;
- } else { /* Case 3. */
- k1 = (p->y - q->y + q->x * mbar2 - p->x * mbar1) / (mbar2 - mbar1);
- if (FABS(m1) > FABS(m2)) {
- Z1 = (k1 + p->x) / 2.0;
- } else {
- Z1 = (k1 + q->x) / 2.0;
- }
- V1 = (p->x + Z1) / 2.0;
- V2 = p->y + m1 * (V1 - p->x);
- W1 = (q->x + Z1) / 2.0;
- W2 = q->y + m2 * (W1 - q->x);
- Z2 = V2 + (W2 - V2) / (W1 - V1) * (Z1 - V1);
- }
- } else if (which == 2) { /* Case 2. */
- Z1 = (p->x + q->x) / 2.0;
- V1 = (p->x + Z1) / 2.0;
- V2 = p->y + m1 * (V1 - p->x);
- W1 = (Z1 + q->x) / 2.0;
- W2 = q->y + m2 * (W1 - q->x);
- Z2 = (V2 + W2) / 2.0;
- } else { /* Case 1. */
- double ztwo;
-
- Z1 = (p->y - q->y + m2 * q->x - m1 * p->x) / (m2 - m1);
- ztwo = p->y + m1 * (Z1 - p->x);
- V1 = (p->x + Z1) / 2.0;
- V2 = (p->y + ztwo) / 2.0;
- W1 = (Z1 + q->x) / 2.0;
- W2 = (ztwo + q->y) / 2.0;
- Z2 = V2 + (W2 - V2) / (W1 - V1) * (Z1 - V1);
- }
-}
-
-static int
-QuadSelect(Point2d *p, Point2d *q, double m1, double m2, double epsilon,
- double param[])
-{
- int ncase;
-
- ncase = QuadChoose(p, q, m1, m2, epsilon);
- QuadCases(p, q, m1, m2, param, ncase);
- return ncase;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * QuadGetImage --
- *
- *---------------------------------------------------------------------------
- */
-INLINE static double
-QuadGetImage(double p1, double p2, double p3, double x1, double x2, double x3)
-{
- double A, B, C;
- double y;
-
- A = x1 - x2;
- B = x2 - x3;
- C = x1 - x3;
-
- y = (p1 * (A * A) + p2 * 2.0 * B * A + p3 * (B * B)) / (C * C);
- return y;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * QuadSpline --
- *
- * Finds the image of a point in x.
- *
- * On input
- *
- * x Contains the value at which the spline is evaluated.
- * leftX, leftY
- * Coordinates of the left-hand data point used in the
- * evaluation of x values.
- * rightX, rightY
- * Coordinates of the right-hand data point used in the
- * evaluation of x values.
- * Z1, Z2, Y1, Y2, E2, W2, V2
- * Parameters of the spline.
- * ncase Controls the evaluation of the spline by indicating
- * whether one or two knots were placed in the interval
- * (xtabs,xtabs1).
- *
- * Results:
- * The image of the spline at x.
- *
- *---------------------------------------------------------------------------
- */
-static void
-QuadSpline(
- Point2d *intp, /* Value at which spline is evaluated */
- Point2d *left, /* Point to the left of the data point to
- * be evaluated */
- Point2d *right, /* Point to the right of the data point to
- * be evaluated */
- double param[], /* Parameters of the spline */
- int ncase) /* Controls the evaluation of the
- * spline by indicating whether one or
- * two knots were placed in the
- * interval (leftX,rightX) */
-{
- double y;
-
- if (ncase == 4) {
- /*
- * Case 4: More than one knot was placed in the interval.
- */
-
- /*
- * Determine the location of data point relative to the 1st knot.
- */
- if (Y1 > intp->x) {
- y = QuadGetImage(left->y, V2, Y2, Y1, intp->x, left->x);
- } else if (Y1 < intp->x) {
- /*
- * Determine the location of the data point relative to
- * the 2nd knot.
- */
- if (Z1 > intp->x) {
- y = QuadGetImage(Y2, E2, Z2, Z1, intp->x, Y1);
- } else if (Z1 < intp->x) {
- y = QuadGetImage(Z2, W2, right->y, right->x, intp->x, Z1);
- } else {
- y = Z2;
- }
- } else {
- y = Y2;
- }
- } else {
-
- /*
- * Cases 1, 2, or 3:
- *
- * Determine the location of the data point relative to the
- * knot.
- */
- if (Z1 < intp->x) {
- y = QuadGetImage(Z2, W2, right->y, right->x, intp->x, Z1);
- } else if (Z1 > intp->x) {
- y = QuadGetImage(left->y, V2, Z2, Z1, intp->x, left->x);
- } else {
- y = Z2;
- }
- }
- intp->y = y;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * QuadSlopes --
- *
- * Calculates the derivative at each of the data points. The
- * slopes computed will insure that an osculatory quadratic
- * spline will have one additional knot between two adjacent
- * points of interpolation. Convexity and monotonicity are
- * preserved wherever these conditions are compatible with the
- * data.
- *
- * Results:
- * The output array "m" is filled with the derivates at each
- * data point.
- *
- *---------------------------------------------------------------------------
- */
-static void
-QuadSlopes(Point2d *points, double *m, int nPoints)
-{
- double xbar, xmid, xhat, ydif1, ydif2;
- double yxmid;
- double m1, m2;
- double m1s, m2s;
- int i, n, l;
-
- m1s = m2s = m1 = m2 = 0;
- for (l = 0, i = 1, n = 2; i < (nPoints - 1); l++, i++, n++) {
- /*
- * Calculate the slopes of the two lines joining three
- * consecutive data points.
- */
- ydif1 = points[i].y - points[l].y;
- ydif2 = points[n].y - points[i].y;
- m1 = ydif1 / (points[i].x - points[l].x);
- m2 = ydif2 / (points[n].x - points[i].x);
- if (i == 1) {
- m1s = m1, m2s = m2; /* Save slopes of starting point */
- }
- /*
- * If one of the preceding slopes is zero or if they have opposite
- * sign, assign the value zero to the derivative at the middle
- * point.
- */
- if ((m1 == 0.0) || (m2 == 0.0) || ((m1 * m2) <= 0.0)) {
- m[i] = 0.0;
- } else if (FABS(m1) > FABS(m2)) {
- /*
- * Calculate the slope by extending the line with slope m1.
- */
- xbar = ydif2 / m1 + points[i].x;
- xhat = (xbar + points[n].x) / 2.0;
- m[i] = ydif2 / (xhat - points[i].x);
- } else {
- /*
- * Calculate the slope by extending the line with slope m2.
- */
- xbar = -ydif1 / m2 + points[i].x;
- xhat = (points[l].x + xbar) / 2.0;
- m[i] = ydif1 / (points[i].x - xhat);
- }
- }
-
- /* Calculate the slope at the last point, x(n). */
- i = nPoints - 2;
- n = nPoints - 1;
- if ((m1 * m2) < 0.0) {
- m[n] = m2 * 2.0;
- } else {
- xmid = (points[i].x + points[n].x) / 2.0;
- yxmid = m[i] * (xmid - points[i].x) + points[i].y;
- m[n] = (points[n].y - yxmid) / (points[n].x - xmid);
- if ((m[n] * m2) < 0.0) {
- m[n] = 0.0;
- }
- }
-
- /* Calculate the slope at the first point, x(0). */
- if ((m1s * m2s) < 0.0) {
- m[0] = m1s * 2.0;
- } else {
- xmid = (points[0].x + points[1].x) / 2.0;
- yxmid = m[1] * (xmid - points[1].x) + points[1].y;
- m[0] = (yxmid - points[0].y) / (xmid - points[0].x);
- if ((m[0] * m1s) < 0.0) {
- m[0] = 0.0;
- }
- }
-
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * QuadEval --
- *
- * QuadEval controls the evaluation of an osculatory quadratic
- * spline. The user may provide his own slopes at the points of
- * interpolation or use the subroutine 'QuadSlopes' to calculate
- * slopes which are consistent with the shape of the data.
- *
- * ON INPUT--
- * intpPts must be a nondecreasing vector of points at which the
- * spline will be evaluated.
- * origPts contains the abscissas of the data points to be
- * interpolated. xtab must be increasing.
- * y contains the ordinates of the data points to be
- * interpolated.
- * m contains the slope of the spline at each point of
- * interpolation.
- * nPoints number of data points (dimension of xtab and y).
- * numEval is the number of points of evaluation (dimension of
- * xval and yval).
- * epsilon is a relative error tolerance used in subroutine
- * 'QuadChoose' to distinguish the situation m(i) or
- * m(i+1) is relatively close to the slope or twice
- * the slope of the linear segment between xtab(i) and
- * xtab(i+1). If this situation occurs, roundoff may
- * cause a change in convexity or monotonicity of the
- * resulting spline and a change in the case number
- * provided by 'QuadChoose'. If epsilon is not equal to zero,
- * then epsilon should be greater than or equal to machine
- * epsilon.
- * ON OUTPUT--
- * yval contains the images of the points in xval.
- * err is one of the following error codes:
- * 0 - QuadEval ran normally.
- * 1 - xval(i) is less than xtab(1) for at least one
- * i or xval(i) is greater than xtab(num) for at
- * least one i. QuadEval will extrapolate to provide
- * function values for these abscissas.
- * 2 - xval(i+1) < xval(i) for some i.
- *
- *
- * QuadEval calls the following subroutines or functions:
- * Search
- * QuadCases
- * QuadChoose
- * QuadSpline
- *---------------------------------------------------------------------------
- */
-static int
-QuadEval(
- Point2d origPts[],
- int nOrigPts,
- Point2d intpPts[],
- int nIntpPts,
- double *m, /* Slope of the spline at each point
- * of interpolation. */
- double epsilon) /* Relative error tolerance (see choose) */
-{
- int error;
- int i, j;
- double param[10];
- int ncase;
- int start, end;
- int l, p;
- int n;
- int found;
-
- /* Initialize indices and set error result */
- error = 0;
- l = nOrigPts - 1;
- p = l - 1;
- ncase = 1;
-
- /*
- * Determine if abscissas of new vector are non-decreasing.
- */
- for (j = 1; j < nIntpPts; j++) {
- if (intpPts[j].x < intpPts[j - 1].x) {
- return 2;
- }
- }
- /*
- * Determine if any of the points in xval are LESS than the
- * abscissa of the first data point.
- */
- for (start = 0; start < nIntpPts; start++) {
- if (intpPts[start].x >= origPts[0].x) {
- break;
- }
- }
- /*
- * Determine if any of the points in xval are GREATER than the
- * abscissa of the l data point.
- */
- for (end = nIntpPts - 1; end >= 0; end--) {
- if (intpPts[end].x <= origPts[l].x) {
- break;
- }
- }
-
- if (start > 0) {
- error = 1; /* Set error value to indicate that
- * extrapolation has occurred. */
- /*
- * Calculate the images of points of evaluation whose abscissas
- * are less than the abscissa of the first data point.
- */
- ncase = QuadSelect(origPts, origPts + 1, m[0], m[1], epsilon, param);
- for (j = 0; j < (start - 1); j++) {
- QuadSpline(intpPts + j, origPts, origPts + 1, param, ncase);
- }
- if (nIntpPts == 1) {
- return error;
- }
- }
- if ((nIntpPts == 1) && (end != (nIntpPts - 1))) {
- goto noExtrapolation;
- }
-
- /*
- * Search locates the interval in which the first in-range
- * point of evaluation lies.
- */
-
- i = Search(origPts, nOrigPts, intpPts[start].x, &found);
-
- n = i + 1;
- if (n >= nOrigPts) {
- n = nOrigPts - 1;
- i = nOrigPts - 2;
- }
- /*
- * If the first in-range point of evaluation is equal to one
- * of the data points, assign the appropriate value from y.
- * Continue until a point of evaluation is found which is not
- * equal to a data point.
- */
- if (found) {
- do {
- intpPts[start].y = origPts[i].y;
- start++;
- if (start >= nIntpPts) {
- return error;
- }
- } while (intpPts[start - 1].x == intpPts[start].x);
-
- for (;;) {
- if (intpPts[start].x < origPts[n].x) {
- break; /* Break out of for-loop */
- }
- if (intpPts[start].x == origPts[n].x) {
- do {
- intpPts[start].y = origPts[n].y;
- start++;
- if (start >= nIntpPts) {
- return error;
- }
- } while (intpPts[start].x == intpPts[start - 1].x);
- }
- i++;
- n++;
- }
- }
- /*
- * Calculate the images of all the points which lie within
- * range of the data.
- */
- if ((i > 0) || (error != 1)) {
- ncase = QuadSelect(origPts + i, origPts + n, m[i], m[n],
- epsilon, param);
- }
- for (j = start; j <= end; j++) {
- /*
- * If xx(j) - x(n) is negative, do not recalculate
- * the parameters for this section of the spline since
- * they are already known.
- */
- if (intpPts[j].x == origPts[n].x) {
- intpPts[j].y = origPts[n].y;
- continue;
- } else if (intpPts[j].x > origPts[n].x) {
- double delta;
-
- /* Determine that the routine is in the correct part of
- the spline. */
- do {
- i++, n++;
- delta = intpPts[j].x - origPts[n].x;
- } while (delta > 0.0);
-
- if (delta < 0.0) {
- ncase = QuadSelect(origPts + i, origPts + n, m[i],
- m[n], epsilon, param);
- } else if (delta == 0.0) {
- intpPts[j].y = origPts[n].y;
- continue;
- }
- }
- QuadSpline(intpPts + j, origPts + i, origPts + n, param, ncase);
- }
-
- if (end == (nIntpPts - 1)) {
- return error;
- }
- if ((n == l) && (intpPts[end].x != origPts[l].x)) {
- goto noExtrapolation;
- }
-
- error = 1; /* Set error value to indicate that
- * extrapolation has occurred. */
- ncase = QuadSelect(origPts + p, origPts + l, m[p], m[l], epsilon, param);
-
- noExtrapolation:
- /*
- * Calculate the images of the points of evaluation whose
- * abscissas are greater than the abscissa of the last data point.
- */
- for (j = (end + 1); j < nIntpPts; j++) {
- QuadSpline(intpPts + j, origPts + p, origPts + l, param, ncase);
- }
- return error;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Shape preserving quadratic splines
- * by D.F.Mcallister & J.A.Roulier
- * Coded by S.L.Dodd & M.Roulier
- * N.C.State University
- *
- *---------------------------------------------------------------------------
- */
-/*
- * Driver routine for quadratic spline package
- * On input--
- * X,Y Contain n-long arrays of data (x is increasing)
- * XM Contains m-long array of x values (increasing)
- * eps Relative error tolerance
- * n Number of input data points
- * m Number of output data points
- * On output--
- * work Contains the value of the first derivative at each data point
- * ym Contains the interpolated spline value at each data point
- */
-int
-Blt_QuadraticSpline(Point2d *origPts, int nOrigPts, Point2d *intpPts,
- int nIntpPts)
-{
- double epsilon;
- double *work;
- int result;
-
- work = Blt_AssertMalloc(nOrigPts * sizeof(double));
- epsilon = 0.0; /* TBA: adjust error via command-line option */
- /* allocate space for vectors used in calculation */
- QuadSlopes(origPts, work, nOrigPts);
- result = QuadEval(origPts, nOrigPts, intpPts, nIntpPts, work, epsilon);
- Blt_Free(work);
- if (result > 1) {
- return FALSE;
- }
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Reference:
- * Numerical Analysis, R. Burden, J. Faires and A. Reynolds.
- * Prindle, Weber & Schmidt 1981 pp 112
- *
- * Parameters:
- * origPts - vector of points, assumed to be sorted along x.
- * intpPts - vector of new points.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_NaturalSpline(Point2d *origPts, int nOrigPts, Point2d *intpPts,
- int nIntpPts)
-{
- Cubic2D *eq;
- Point2d *ip, *iend;
- TriDiagonalMatrix *A;
- double *dx; /* vector of deltas in x */
- double x, dy, alpha;
- int isKnot;
- int i, j, n;
-
- dx = Blt_AssertMalloc(sizeof(double) * nOrigPts);
- /* Calculate vector of differences */
- for (i = 0, j = 1; j < nOrigPts; i++, j++) {
- dx[i] = origPts[j].x - origPts[i].x;
- if (dx[i] < 0.0) {
- return 0;
- }
- }
- n = nOrigPts - 1; /* Number of intervals. */
- A = Blt_AssertMalloc(sizeof(TriDiagonalMatrix) * nOrigPts);
- if (A == NULL) {
- Blt_Free(dx);
- return 0;
- }
- /* Vectors to solve the tridiagonal matrix */
- A[0][0] = A[n][0] = 1.0;
- A[0][1] = A[n][1] = 0.0;
- A[0][2] = A[n][2] = 0.0;
-
- /* Calculate the intermediate results */
- for (i = 0, j = 1; j < n; j++, i++) {
- alpha = 3.0 * ((origPts[j + 1].y / dx[j]) - (origPts[j].y / dx[i]) -
- (origPts[j].y / dx[j]) + (origPts[i].y / dx[i]));
- A[j][0] = 2 * (dx[j] + dx[i]) - dx[i] * A[i][1];
- A[j][1] = dx[j] / A[j][0];
- A[j][2] = (alpha - dx[i] * A[i][2]) / A[j][0];
- }
-
- eq = Blt_Malloc(sizeof(Cubic2D) * nOrigPts);
- if (eq == NULL) {
- Blt_Free(A);
- Blt_Free(dx);
- return FALSE;
- }
- eq[0].c = eq[n].c = 0.0;
- for (j = n, i = n - 1; i >= 0; i--, j--) {
- eq[i].c = A[i][2] - A[i][1] * eq[j].c;
- dy = origPts[i+1].y - origPts[i].y;
- eq[i].b = (dy) / dx[i] - dx[i] * (eq[j].c + 2.0 * eq[i].c) / 3.0;
- eq[i].d = (eq[j].c - eq[i].c) / (3.0 * dx[i]);
- }
- Blt_Free(A);
- Blt_Free(dx);
-
- /* Now calculate the new values */
- for (ip = intpPts, iend = ip + nIntpPts; ip < iend; ip++) {
- ip->y = 0.0;
- x = ip->x;
-
- /* Is it outside the interval? */
- if ((x < origPts[0].x) || (x > origPts[n].x)) {
- continue;
- }
- /* Search for the interval containing x in the point array */
- i = Search(origPts, nOrigPts, x, &isKnot);
- if (isKnot) {
- ip->y = origPts[i].y;
- } else {
- i--;
- x -= origPts[i].x;
- ip->y = origPts[i].y + x * (eq[i].b + x * (eq[i].c + x * eq[i].d));
- }
- }
- Blt_Free(eq);
- return TRUE;
-}
-
-static Blt_OpSpec splineOps[] =
-{
- {"natural", 1, Blt_NaturalSpline, 6, 6, "x y splx sply",},
- {"quadratic", 1, Blt_QuadraticSpline, 6, 6, "x y splx sply",},
-};
-static int nSplineOps = sizeof(splineOps) / sizeof(Blt_OpSpec);
-
-/*ARGSUSED*/
-static int
-SplineCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- SplineProc *proc;
- Blt_Vector *x, *y, *splX, *splY;
- double *xArr, *yArr;
- int i;
- Point2d *origPts, *intpPts;
- int nOrigPts, nIntpPts;
-
- proc = Blt_GetOpFromObj(interp, nSplineOps, splineOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- if ((Blt_GetVectorFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Blt_GetVectorFromObj(interp, objv[3], &y) != TCL_OK) ||
- (Blt_GetVectorFromObj(interp, objv[4], &splX) != TCL_OK)) {
- return TCL_ERROR;
- }
- nOrigPts = Blt_VecLength(x);
- if (nOrigPts < 3) {
- Tcl_AppendResult(interp, "length of vector \"", Tcl_GetString(objv[2]),
- "\" is < 3", (char *)NULL);
- return TCL_ERROR;
- }
- for (i = 1; i < nOrigPts; i++) {
- if (Blt_VecData(x)[i] < Blt_VecData(x)[i - 1]) {
- Tcl_AppendResult(interp, "x vector \"", Tcl_GetString(objv[2]),
- "\" must be monotonically increasing", (char *)NULL);
- return TCL_ERROR;
- }
- }
- /* Check that all the data points aren't the same. */
- if (Blt_VecData(x)[i - 1] <= Blt_VecData(x)[0]) {
- Tcl_AppendResult(interp, "x vector \"", Tcl_GetString(objv[2]),
- "\" must be monotonically increasing", (char *)NULL);
- return TCL_ERROR;
- }
- if (nOrigPts != Blt_VecLength(y)) {
- Tcl_AppendResult(interp, "vectors \"", Tcl_GetString(objv[2]),
- "\" and \"", Tcl_GetString(objv[3]),
- " have different lengths", (char *)NULL);
- return TCL_ERROR;
- }
- nIntpPts = Blt_VecLength(splX);
- if (Blt_GetVectorFromObj(interp, objv[5], &splY) != TCL_OK) {
- /*
- * If the named vector to hold the ordinates of the spline
- * doesn't exist, create one the same size as the vector
- * containing the abscissas.
- */
- if (Blt_CreateVector(interp, Tcl_GetString(objv[5]), nIntpPts, &splY)
- != TCL_OK) {
- return TCL_ERROR;
- }
- } else if (nIntpPts != Blt_VecLength(splY)) {
- /*
- * The x and y vectors differ in size. Make the number of ordinates
- * the same as the number of abscissas.
- */
- if (Blt_ResizeVector(splY, nIntpPts) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- origPts = Blt_Malloc(sizeof(Point2d) * nOrigPts);
- if (origPts == NULL) {
- Tcl_AppendResult(interp, "can't allocate \"", Blt_Itoa(nOrigPts),
- "\" points", (char *)NULL);
- return TCL_ERROR;
- }
- intpPts = Blt_Malloc(sizeof(Point2d) * nIntpPts);
- if (intpPts == NULL) {
- Tcl_AppendResult(interp, "can't allocate \"", Blt_Itoa(nIntpPts),
- "\" points", (char *)NULL);
- Blt_Free(origPts);
- return TCL_ERROR;
- }
- xArr = Blt_VecData(x);
- yArr = Blt_VecData(y);
- for (i = 0; i < nOrigPts; i++) {
- origPts[i].x = xArr[i];
- origPts[i].y = yArr[i];
- }
- xArr = Blt_VecData(splX);
- yArr = Blt_VecData(splY);
- for (i = 0; i < nIntpPts; i++) {
- intpPts[i].x = xArr[i];
- intpPts[i].y = yArr[i];
- }
- if (!(*proc) (origPts, nOrigPts, intpPts, nIntpPts)) {
- Tcl_AppendResult(interp, "error generating spline for \"",
- Blt_NameOfVector(splY), "\"", (char *)NULL);
- Blt_Free(origPts);
- Blt_Free(intpPts);
- return TCL_ERROR;
- }
- yArr = Blt_VecData(splY);
- for (i = 0; i < nIntpPts; i++) {
- yArr[i] = intpPts[i].y;
- }
- Blt_Free(origPts);
- Blt_Free(intpPts);
-
- /* Finally update the vector. The size of the vector hasn't
- * changed, just the data. Reset the vector using TCL_STATIC to
- * indicate this. */
- if (Blt_ResetVector(splY, Blt_VecData(splY), Blt_VecLength(splY),
- Blt_VecSize(splY), TCL_STATIC) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-int
-Blt_SplineCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {"spline", SplineCmd,};
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-
-#define SQR(x) ((x)*(x))
-
-typedef struct {
- double t; /* Arc length of interval. */
- double x; /* 2nd derivative of X with respect to T */
- double y; /* 2nd derivative of Y with respect to T */
-} CubicSpline;
-
-
-/*
- * The following two procedures solve the special linear system which arise
- * in cubic spline interpolation. If x is assumed cyclic ( x[i]=x[n+i] ) the
- * equations can be written as (i=0,1,...,n-1):
- * m[i][0] * x[i-1] + m[i][1] * x[i] + m[i][2] * x[i+1] = b[i] .
- * In matrix notation one gets A * x = b, where the matrix A is tridiagonal
- * with additional elements in the upper right and lower left position:
- * A[i][0] = A_{i,i-1} for i=1,2,...,n-1 and m[0][0] = A_{0,n-1} ,
- * A[i][1] = A_{i, i } for i=0,1,...,n-1
- * A[i][2] = A_{i,i+1} for i=0,1,...,n-2 and m[n-1][2] = A_{n-1,0}.
- * A should be symmetric (A[i+1][0] == A[i][2]) and positive definite.
- * The size of the system is given in n (n>=1).
- *
- * In the first procedure the Cholesky decomposition A = C^T * D * C
- * (C is upper triangle with unit diagonal, D is diagonal) is calculated.
- * Return TRUE if decomposition exist.
- */
-static int
-SolveCubic1(TriDiagonalMatrix A[], int n)
-{
- int i;
- double m_ij, m_n, m_nn, d;
-
- if (n < 1) {
- return FALSE; /* Dimension should be at least 1 */
- }
- d = A[0][1]; /* D_{0,0} = A_{0,0} */
- if (d <= 0.0) {
- return FALSE; /* A (or D) should be positive definite */
- }
- m_n = A[0][0]; /* A_{0,n-1} */
- m_nn = A[n - 1][1]; /* A_{n-1,n-1} */
- for (i = 0; i < n - 2; i++) {
- m_ij = A[i][2]; /* A_{i,1} */
- A[i][2] = m_ij / d; /* C_{i,i+1} */
- A[i][0] = m_n / d; /* C_{i,n-1} */
- m_nn -= A[i][0] * m_n; /* to get C_{n-1,n-1} */
- m_n = -A[i][2] * m_n; /* to get C_{i+1,n-1} */
- d = A[i + 1][1] - A[i][2] * m_ij; /* D_{i+1,i+1} */
- if (d <= 0.0) {
- return FALSE; /* Elements of D should be positive */
- }
- A[i + 1][1] = d;
- }
- if (n >= 2) { /* Complete last column */
- m_n += A[n - 2][2]; /* add A_{n-2,n-1} */
- A[n - 2][0] = m_n / d; /* C_{n-2,n-1} */
- A[n - 1][1] = d = m_nn - A[n - 2][0] * m_n; /* D_{n-1,n-1} */
- if (d <= 0.0) {
- return FALSE;
- }
- }
- return TRUE;
-}
-
-/*
- * The second procedure solves the linear system, with the Cholesky
- * decomposition calculated above (in m[][]) and the right side b given
- * in x[]. The solution x overwrites the right side in x[].
- */
-static void
-SolveCubic2(TriDiagonalMatrix A[], CubicSpline spline[], int nIntervals)
-{
- int i;
- double x, y;
- int n, m;
-
- n = nIntervals - 2;
- m = nIntervals - 1;
-
- /* Division by transpose of C : b = C^{-T} * b */
- x = spline[m].x;
- y = spline[m].y;
- for (i = 0; i < n; i++) {
- spline[i + 1].x -= A[i][2] * spline[i].x; /* C_{i,i+1} * x(i) */
- spline[i + 1].y -= A[i][2] * spline[i].y; /* C_{i,i+1} * x(i) */
- x -= A[i][0] * spline[i].x; /* C_{i,n-1} * x(i) */
- y -= A[i][0] * spline[i].y; /* C_{i,n-1} * x(i) */
- }
- if (n >= 0) {
- /* C_{n-2,n-1} * x_{n-1} */
- spline[m].x = x - A[n][0] * spline[n].x;
- spline[m].y = y - A[n][0] * spline[n].y;
- }
- /* Division by D: b = D^{-1} * b */
- for (i = 0; i < nIntervals; i++) {
- spline[i].x /= A[i][1];
- spline[i].y /= A[i][1];
- }
-
- /* Division by C: b = C^{-1} * b */
- x = spline[m].x;
- y = spline[m].y;
- if (n >= 0) {
- /* C_{n-2,n-1} * x_{n-1} */
- spline[n].x -= A[n][0] * x;
- spline[n].y -= A[n][0] * y;
- }
- for (i = (n - 1); i >= 0; i--) {
- /* C_{i,i+1} * x_{i+1} + C_{i,n-1} * x_{n-1} */
- spline[i].x -= A[i][2] * spline[i + 1].x + A[i][0] * x;
- spline[i].y -= A[i][2] * spline[i + 1].y + A[i][0] * y;
- }
-}
-
-/*
- * Find second derivatives (x''(t_i),y''(t_i)) of cubic spline interpolation
- * through list of points (x_i,y_i). The parameter t is calculated as the
- * length of the linear stroke. The number of points must be at least 3.
- * Note: For CLOSED_CONTOURs the first and last point must be equal.
- */
-static CubicSpline *
-CubicSlopes(
- Point2d points[],
- int nPoints, /* Number of points (nPoints>=3) */
- int isClosed, /* CLOSED_CONTOUR or OPEN_CONTOUR */
- double unitX,
- double unitY) /* Unit length in x and y (norm=1) */
-{
- CubicSpline *spline;
- CubicSpline *s1, *s2;
- int n, i;
- double norm, dx, dy;
- TriDiagonalMatrix *A; /* The tri-diagonal matrix is saved here. */
-
- spline = Blt_Malloc(sizeof(CubicSpline) * nPoints);
- if (spline == NULL) {
- return NULL;
- }
- A = Blt_Malloc(sizeof(TriDiagonalMatrix) * nPoints);
- if (A == NULL) {
- Blt_Free(spline);
- return NULL;
- }
- /*
- * Calculate first differences in (dxdt2[i], y[i]) and interval lengths
- * in dist[i]:
- */
- s1 = spline;
- for (i = 0; i < nPoints - 1; i++) {
- s1->x = points[i+1].x - points[i].x;
- s1->y = points[i+1].y - points[i].y;
-
- /*
- * The Norm of a linear stroke is calculated in "normal coordinates"
- * and used as interval length:
- */
- dx = s1->x / unitX;
- dy = s1->y / unitY;
- s1->t = sqrt(dx * dx + dy * dy);
-
- s1->x /= s1->t; /* first difference, with unit norm: */
- s1->y /= s1->t; /* || (dxdt2[i], y[i]) || = 1 */
- s1++;
- }
-
- /*
- * Setup linear System: Ax = b
- */
- n = nPoints - 2; /* Without first and last point */
- if (isClosed) {
- /* First and last points must be equal for CLOSED_CONTOURs */
- spline[nPoints - 1].t = spline[0].t;
- spline[nPoints - 1].x = spline[0].x;
- spline[nPoints - 1].y = spline[0].y;
- n++; /* Add last point (= first point) */
- }
- s1 = spline, s2 = s1 + 1;
- for (i = 0; i < n; i++) {
- /* Matrix A, mainly tridiagonal with cyclic second index
- ("j = j+n mod n")
- */
- A[i][0] = s1->t; /* Off-diagonal element A_{i,i-1} */
- A[i][1] = 2.0 * (s1->t + s2->t); /* A_{i,i} */
- A[i][2] = s2->t; /* Off-diagonal element A_{i,i+1} */
-
- /* Right side b_x and b_y */
- s1->x = (s2->x - s1->x) * 6.0;
- s1->y = (s2->y - s1->y) * 6.0;
-
- /*
- * If the linear stroke shows a cusp of more than 90 degree,
- * the right side is reduced to avoid oscillations in the
- * spline:
- */
- /*
- * The Norm of a linear stroke is calculated in "normal coordinates"
- * and used as interval length:
- */
- dx = s1->x / unitX;
- dy = s1->y / unitY;
- norm = sqrt(dx * dx + dy * dy) / 8.5;
- if (norm > 1.0) {
- /* The first derivative will not be continuous */
- s1->x /= norm;
- s1->y /= norm;
- }
- s1++, s2++;
- }
-
- if (!isClosed) {
- /* Third derivative is set to zero at both ends */
- A[0][1] += A[0][0]; /* A_{0,0} */
- A[0][0] = 0.0; /* A_{0,n-1} */
- A[n-1][1] += A[n-1][2]; /* A_{n-1,n-1} */
- A[n-1][2] = 0.0; /* A_{n-1,0} */
- }
- /* Solve linear systems for dxdt2[] and y[] */
-
- if (SolveCubic1(A, n)) { /* Cholesky decomposition */
- SolveCubic2(A, spline, n); /* A * dxdt2 = b_x */
- } else { /* Should not happen, but who knows ... */
- Blt_Free(A);
- Blt_Free(spline);
- return NULL;
- }
- /* Shift all second derivatives one place right and update the ends. */
- s2 = spline + n, s1 = s2 - 1;
- for (/* empty */; s2 > spline; s2--, s1--) {
- s2->x = s1->x;
- s2->y = s1->y;
- }
- if (isClosed) {
- spline[0].x = spline[n].x;
- spline[0].y = spline[n].y;
- } else {
- /* Third derivative is 0.0 for the first and last interval. */
- spline[0].x = spline[1].x;
- spline[0].y = spline[1].y;
- spline[n + 1].x = spline[n].x;
- spline[n + 1].y = spline[n].y;
- }
- Blt_Free( A);
- return spline;
-}
-
-
-/*
- * Calculate interpolated values of the spline function (defined via p_cntr
- * and the second derivatives dxdt2[] and dydt2[]). The number of tabulated
- * values is n. On an equidistant grid n_intpol values are calculated.
- */
-static int
-CubicEval(Point2d *origPts, int nOrigPts, Point2d *intpPts, int nIntpPts,
- CubicSpline *spline)
-{
- double t, tSkip, tMax;
- Point2d q;
- int i, j, count;
-
- /* Sum the lengths of all the segments (intervals). */
- tMax = 0.0;
- for (i = 0; i < nOrigPts - 1; i++) {
- tMax += spline[i].t;
- }
-
- /* Need a better way of doing this... */
-
- /* The distance between interpolated points */
- tSkip = (1. - 1e-7) * tMax / (nIntpPts - 1);
-
- t = 0.0; /* Spline parameter value. */
- q = origPts[0];
- count = 0;
-
- intpPts[count++] = q; /* First point. */
- t += tSkip;
-
- for (i = 0, j = 1; j < nOrigPts; i++, j++) {
- Point2d p;
- double d, hx, dx0, dx01, hy, dy0, dy01;
-
- d = spline[i].t; /* Interval length */
- p = q;
- q = origPts[i+1];
- hx = (q.x - p.x) / d;
- hy = (q.y - p.y) / d;
- dx0 = (spline[j].x + 2 * spline[i].x) / 6.0;
- dy0 = (spline[j].y + 2 * spline[i].y) / 6.0;
- dx01 = (spline[j].x - spline[i].x) / (6.0 * d);
- dy01 = (spline[j].y - spline[i].y) / (6.0 * d);
- while (t <= spline[i].t) { /* t in current interval ? */
- p.x += t * (hx + (t - d) * (dx0 + t * dx01));
- p.y += t * (hy + (t - d) * (dy0 + t * dy01));
- intpPts[count++] = p;
- t += tSkip;
- }
- /* Parameter t relative to start of next interval */
- t -= spline[i].t;
- }
- return count;
-}
-
-/*
- * Generate a cubic spline curve through the points (x_i,y_i) which are
- * stored in the linked list p_cntr.
- * The spline is defined as a 2d-function s(t) = (x(t),y(t)), where the
- * parameter t is the length of the linear stroke.
- */
-int
-Blt_NaturalParametricSpline(Point2d *origPts, int nOrigPts, Region2d *extsPtr,
- int isClosed, Point2d *intpPts, int nIntpPts)
-{
- double unitX, unitY; /* To define norm (x,y)-plane */
- CubicSpline *spline;
- int result;
-
- if (nOrigPts < 3) {
- return 0;
- }
- if (isClosed) {
- origPts[nOrigPts].x = origPts[0].x;
- origPts[nOrigPts].y = origPts[0].y;
- nOrigPts++;
- }
- /* Width and height of the grid is used at unit length (2d-norm) */
- unitX = extsPtr->right - extsPtr->left;
- unitY = extsPtr->bottom - extsPtr->top;
-
- if (unitX < FLT_EPSILON) {
- unitX = FLT_EPSILON;
- }
- if (unitY < FLT_EPSILON) {
- unitY = FLT_EPSILON;
- }
- /* Calculate parameters for cubic spline:
- * t = arc length of interval.
- * dxdt2 = second derivatives of x with respect to t,
- * dydt2 = second derivatives of y with respect to t,
- */
- spline = CubicSlopes(origPts, nOrigPts, isClosed, unitX, unitY);
- if (spline == NULL) {
- return 0;
- }
- result= CubicEval(origPts, nOrigPts, intpPts, nIntpPts, spline);
- Blt_Free(spline);
- return result;
-}
-
-static INLINE void
-CatromCoeffs(Point2d *p, Point2d *a, Point2d *b, Point2d *c, Point2d *d)
-{
- a->x = -p[0].x + 3.0 * p[1].x - 3.0 * p[2].x + p[3].x;
- b->x = 2.0 * p[0].x - 5.0 * p[1].x + 4.0 * p[2].x - p[3].x;
- c->x = -p[0].x + p[2].x;
- d->x = 2.0 * p[1].x;
- a->y = -p[0].y + 3.0 * p[1].y - 3.0 * p[2].y + p[3].y;
- b->y = 2.0 * p[0].y - 5.0 * p[1].y + 4.0 * p[2].y - p[3].y;
- c->y = -p[0].y + p[2].y;
- d->y = 2.0 * p[1].y;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ParametricCatromSpline --
- *
- * Computes a spline based upon the data points, returning a new (larger)
- * coordinate array of points.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_CatromParametricSpline(Point2d *points, int nPoints, Point2d *intpPts,
- int nIntpPts)
-{
- int i;
- Point2d *origPts;
- double t;
- int interval;
- Point2d a, b, c, d;
-
- assert(nPoints > 0);
-
- /*
- * The spline is computed in screen coordinates instead of data points so
- * that we can select the abscissas of the interpolated points from each
- * pixel horizontally across the plotting area.
- */
- origPts = Blt_AssertMalloc((nPoints + 4) * sizeof(Point2d));
- memcpy(origPts + 1, points, sizeof(Point2d) * nPoints);
-
- origPts[0] = origPts[1];
- origPts[nPoints + 2] = origPts[nPoints + 1] = origPts[nPoints];
-
- for (i = 0; i < nIntpPts; i++) {
- interval = (int)intpPts[i].x;
- t = intpPts[i].y;
- assert(interval < nPoints);
- CatromCoeffs(origPts + interval, &a, &b, &c, &d);
- intpPts[i].x = (d.x + t * (c.x + t * (b.x + t * a.x))) / 2.0;
- intpPts[i].y = (d.y + t * (c.y + t * (b.y + t * a.y))) / 2.0;
- }
- Blt_Free(origPts);
- return 1;
-}
diff --git a/blt3.0.1/src/bltString.h b/blt3.0.1/src/bltString.h
deleted file mode 100644
index a831057..0000000
--- a/blt3.0.1/src/bltString.h
+++ /dev/null
@@ -1,61 +0,0 @@
-
-/*
- * bltString.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_STRING_H
-#define _BLT_STRING_H
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif /* HAVE_STDLIB_H */
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif /* HAVE_STRING_H */
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-/*
- * On some systems "strncasecmp" and "strcasecmp" are in the C library
- * but have no declarations in the C header files. Make sure we supply
- * them here.
- */
-#if !HAVE_DECL_STRTOLOWER
-BLT_EXTERN void strtolower(char *s);
-#endif /* !HAVE_DECL_STRTOLOWER */
-
-#if !HAVE_DECL_STRCASECMP
-BLT_EXTERN int strcasecmp(const char *s1, const char *s2);
-#endif /* !HAVE_DECL_STRDUP */
-
-#if !HAVE_DECL_STRNCASECMP
-BLT_EXTERN int strncasecmp(const char *s1, const char *s2, size_t length);
-#endif /* !HAVE_DECL_STRDUP */
-#endif
diff --git a/blt3.0.1/src/bltSwitch.c b/blt3.0.1/src/bltSwitch.c
deleted file mode 100644
index 35228d1..0000000
--- a/blt3.0.1/src/bltSwitch.c
+++ /dev/null
@@ -1,554 +0,0 @@
-
-/*
- * bltSwitch.c --
- *
- * This module implements command/argument switch parsing procedures for the
- * BLT toolkit.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include <stdarg.h>
-
-#include "bltSwitch.h"
-
-static void
-DoHelp(Tcl_Interp *interp, Blt_SwitchSpec *specs)
-{
- Tcl_DString ds;
- Blt_SwitchSpec *sp;
-
- Tcl_DStringInit(&ds);
- Tcl_DStringAppend(&ds, "following switches are available:", -1);
- for (sp = specs; sp->type != BLT_SWITCH_END; sp++) {
- Tcl_DStringAppend(&ds, "\n ", 4);
- Tcl_DStringAppend(&ds, sp->switchName, -1);
- Tcl_DStringAppend(&ds, " ", 1);
- Tcl_DStringAppend(&ds, sp->help, -1);
- }
- Tcl_AppendResult(interp, Tcl_DStringValue(&ds), (char *)NULL);
- Tcl_DStringFree(&ds);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindSwitchSpec --
- *
- * Search through a table of configuration specs, looking for one that
- * matches a given argvName.
- *
- * Results:
- * The return value is a pointer to the matching entry, or NULL if
- * nothing matched. In that case an error message is left in the
- * interp's result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_SwitchSpec *
-FindSwitchSpec(
- Tcl_Interp *interp, /* Used for reporting errors. */
- Blt_SwitchSpec *specs, /* Pointer to table of configuration
- * specifications for a widget. */
- const char *name, /* Name identifying a particular switch. */
- int length, /* Length of name. */
- int needFlags, /* Flags that must be present in matching
- * entry. */
- int hateFlags) /* Flags that must NOT be present in matching
- * entry. */
-{
- Blt_SwitchSpec *sp;
- char c; /* First character of current argument. */
- Blt_SwitchSpec *matchPtr; /* Matching spec, or NULL. */
-
- c = name[1];
- matchPtr = NULL;
- for (sp = specs; sp->type != BLT_SWITCH_END; sp++) {
- if (sp->switchName == NULL) {
- continue;
- }
- if (((sp->flags & needFlags) != needFlags) || (sp->flags & hateFlags)) {
- continue;
- }
- if ((sp->switchName[1] != c) ||
- (strncmp(sp->switchName, name, length) != 0)) {
- continue;
- }
- if (sp->switchName[length] == '\0') {
- return sp; /* Stop on a perfect match. */
- }
- if (matchPtr != NULL) {
- Tcl_AppendResult(interp, "ambiguous switch \"", name, "\"\n",
- (char *) NULL);
- DoHelp(interp, specs);
- return NULL;
- }
- matchPtr = sp;
- }
- if (strcmp(name, "-help") == 0) {
- DoHelp(interp, specs);
- return NULL;
- }
- if (matchPtr == NULL) {
- Tcl_AppendResult(interp, "unknown switch \"", name, "\"\n",
- (char *)NULL);
- DoHelp(interp, specs);
- return NULL;
- }
- return matchPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DoSwitch --
- *
- * This procedure applies a single configuration switch to a widget
- * record.
- *
- * Results:
- * A standard TCL return value.
- *
- * Side effects:
- * WidgRec is modified as indicated by specPtr and value. The old value
- * is recycled, if that is appropriate for the value type.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DoSwitch(
- Tcl_Interp *interp, /* Interpreter for error reporting. */
- Blt_SwitchSpec *sp, /* Specifier to apply. */
- Tcl_Obj *objPtr, /* Value to use to fill in widgRec. */
- void *record) /* Record whose fields are to be modified.
- * Values must be properly initialized. */
-{
- do {
- char *ptr;
-
- ptr = (char *)record + sp->offset;
- switch (sp->type) {
- case BLT_SWITCH_BOOLEAN:
- {
- int bool;
-
- if (Tcl_GetBooleanFromObj(interp, objPtr, &bool) != TCL_OK) {
- return TCL_ERROR;
- }
- if (sp->mask > 0) {
- if (bool) {
- *((int *)ptr) |= sp->mask;
- } else {
- *((int *)ptr) &= ~sp->mask;
- }
- } else {
- *((int *)ptr) = bool;
- }
- }
- break;
-
- case BLT_SWITCH_DOUBLE:
- if (Tcl_GetDoubleFromObj(interp, objPtr, (double *)ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
-
- case BLT_SWITCH_OBJ:
- Tcl_IncrRefCount(objPtr);
- *(Tcl_Obj **)ptr = objPtr;
- break;
-
- case BLT_SWITCH_FLOAT:
- {
- double value;
-
- if (Tcl_GetDoubleFromObj(interp, objPtr, &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(float *)ptr = (float)value;
- }
- break;
-
- case BLT_SWITCH_INT:
- if (Tcl_GetIntFromObj(interp, objPtr, (int *)ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
-
- case BLT_SWITCH_INT_NNEG:
- {
- long value;
-
- if (Blt_GetCountFromObj(interp, objPtr, COUNT_NNEG,
- &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(int *)ptr = (int)value;
- }
- break;
-
- case BLT_SWITCH_INT_POS:
- {
- long value;
-
- if (Blt_GetCountFromObj(interp, objPtr, COUNT_POS,
- &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(int *)ptr = (int)value;
- }
- break;
-
- case BLT_SWITCH_LIST:
- {
- int argc;
-
- if (Tcl_SplitList(interp, Tcl_GetString(objPtr), &argc,
- (const char ***)ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- break;
-
- case BLT_SWITCH_LONG:
- if (Tcl_GetLongFromObj(interp, objPtr, (long *)ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
-
- case BLT_SWITCH_LONG_NNEG:
- {
- long value;
-
- if (Blt_GetCountFromObj(interp, objPtr, COUNT_NNEG,
- &value) != TCL_OK) {
- return TCL_ERROR;
- }
- *(long *)ptr = value;
- }
- break;
-
- case BLT_SWITCH_LONG_POS:
- {
- long value;
-
- if (Blt_GetCountFromObj(interp, objPtr, COUNT_POS, &value)
- != TCL_OK) {
- return TCL_ERROR;
- }
- *(long *)ptr = value;
- }
- break;
-
- case BLT_SWITCH_STRING:
- {
- char *value;
-
- value = Tcl_GetString(objPtr);
- value = (*value == '\0') ? NULL : Blt_AssertStrdup(value);
- if (*(char **)ptr != NULL) {
- Blt_Free(*(char **)ptr);
- }
- *(char **)ptr = value;
- }
-#ifdef notdef
- {
- char *old, *new, **strPtr;
- char *string;
-
- string = Tcl_GetString(objPtr);
- strPtr = (char **)ptr;
- new = ((*string == '\0') && (sp->flags & BLT_SWITCH_NULL_OK))
- ? NULL : Blt_AssertStrdup(string);
- old = *strPtr;
- if (old != NULL) {
- Blt_Free(old);
- }
- *strPtr = new;
- }
-#endif
- break;
-
- case BLT_SWITCH_CUSTOM:
- assert(sp->customPtr != NULL);
- if ((*sp->customPtr->parseProc)(sp->customPtr->clientData, interp,
- sp->switchName, objPtr, (char *)record, sp->offset, sp->flags)
- != TCL_OK) {
- return TCL_ERROR;
- }
- break;
-
- default:
- Tcl_AppendResult(interp, "bad switch table: unknown type \"",
- Blt_Itoa(sp->type), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- sp++;
- } while ((sp->switchName == NULL) && (sp->type != BLT_SWITCH_END));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ParseSwitches --
- *
- * Process command-line switches to fill in fields of a record with
- * resources and other parameters.
- *
- * Results:
- * Returns the number of arguments comsumed by parsing the command line.
- * If an error occurred, -1 will be returned and an error messages can be
- * found as the interpreter result.
- *
- * Side effects:
- * The fields of widgRec get filled in with information from argc/argv.
- * Old information in widgRec's fields gets recycled.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_ParseSwitches(
- Tcl_Interp *interp, /* Interpreter for error reporting. */
- Blt_SwitchSpec *specs, /* Describes legal switches. */
- int objc, /* Number of elements in argv. */
- Tcl_Obj *const *objv, /* Command-line switches. */
- void *record, /* Record whose fields are to be modified.
- * Values must be properly initialized. */
- int flags) /* Used to specify additional flags that must
- * be present in switch specs for them to be
- * considered. */
-{
- Blt_SwitchSpec *sp;
- int count;
- int needFlags; /* Specs must contain this set of flags or
- * else they are not considered. */
- int hateFlags; /* If a spec contains any bits here, it's not
- * considered. */
-
- needFlags = flags & ~(BLT_SWITCH_USER_BIT - 1);
- hateFlags = 0;
-
- /*
- * Pass 1: Clear the change flags on all the specs so that we
- * can check it later.
- */
- for (sp = specs; sp->type != BLT_SWITCH_END; sp++) {
- sp->flags &= ~BLT_SWITCH_SPECIFIED;
- }
- /*
- * Pass 2: Process the arguments that match entries in the specs.
- * It's an error if the argument doesn't match anything.
- */
- for (count = 0; count < objc; count++) {
- char *arg;
- int length;
-
- arg = Tcl_GetStringFromObj(objv[count], &length);
- if (flags & BLT_SWITCH_OBJV_PARTIAL) {
- /*
- * If the argument doesn't start with a '-' (not a switch) or is
- * '--', stop processing and return the number of arguments
- * comsumed.
- */
- if (arg[0] != '-') {
- return count;
- }
- if ((arg[1] == '-') && (arg[2] == '\0')) {
- return count + 1; /* include the "--" in the count. */
- }
- }
- sp = FindSwitchSpec(interp, specs, arg, length, needFlags, hateFlags);
- if (sp == NULL) {
- return -1;
- }
- if (sp->type == BLT_SWITCH_BITMASK) {
- char *ptr;
-
- ptr = (char *)record + sp->offset;
- *((int *)ptr) |= sp->mask;
- } else if (sp->type == BLT_SWITCH_BITMASK_INVERT) {
- char *ptr;
-
- ptr = (char *)record + sp->offset;
- *((int *)ptr) &= ~sp->mask;
- } else if (sp->type == BLT_SWITCH_VALUE) {
- char *ptr;
-
- ptr = (char *)record + sp->offset;
- *((int *)ptr) = sp->mask;
- } else {
- count++;
- if (count == objc) {
- Tcl_AppendResult(interp, "value for \"", arg, "\" missing",
- (char *) NULL);
- return -1;
- }
- if (DoSwitch(interp, sp, objv[count], record) != TCL_OK) {
- char msg[200];
-
- sprintf_s(msg, 200, "\n (processing \"%.40s\" switch)",
- sp->switchName);
- Tcl_AddErrorInfo(interp, msg);
- return -1;
- }
- }
- sp->flags |= BLT_SWITCH_SPECIFIED;
- }
- return count;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FreeSwitches --
- *
- * Free up all resources associated with switches.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-void
-Blt_FreeSwitches(
- Blt_SwitchSpec *specs, /* Describes legal switches. */
- void *record, /* Record whose fields contain current values
- * for switches. */
- int needFlags) /* Used to specify additional flags that must
- * be present in config specs for them to be
- * considered. */
-{
- Blt_SwitchSpec *sp;
-
- for (sp = specs; sp->type != BLT_SWITCH_END; sp++) {
- if ((sp->flags & needFlags) == needFlags) {
- char *ptr;
-
- ptr = (char *)record + sp->offset;
- switch (sp->type) {
- case BLT_SWITCH_STRING:
- case BLT_SWITCH_LIST:
- if (*((char **) ptr) != NULL) {
- Blt_Free(*((char **) ptr));
- *((char **) ptr) = NULL;
- }
- break;
-
- case BLT_SWITCH_OBJ:
- if (*((Tcl_Obj **) ptr) != NULL) {
- Tcl_DecrRefCount(*((Tcl_Obj **)ptr));
- *((Tcl_Obj **) ptr) = NULL;
- }
- break;
-
- case BLT_SWITCH_CUSTOM:
- assert(sp->customPtr != NULL);
- if ((*(char **)ptr != NULL) &&
- (sp->customPtr->freeProc != NULL)) {
- (*sp->customPtr->freeProc)((char *)record, sp->offset,
- sp->flags);
- }
- break;
-
- default:
- break;
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_SwitchModified --
- *
- * Given the configuration specifications and one or more switch patterns
- * (terminated by a NULL), indicate if any of the matching switches has
- * been reset.
- *
- * Results:
- * Returns 1 if one of the switches have changed, 0 otherwise.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_SwitchChanged TCL_VARARGS_DEF(Blt_SwitchSpec *, arg1)
-{
- va_list argList;
- Blt_SwitchSpec *specs;
- Blt_SwitchSpec *sp;
- char *switchName;
-
- specs = TCL_VARARGS_START(Blt_SwitchSpec *, arg1, argList);
- while ((switchName = va_arg(argList, char *)) != NULL) {
- for (sp = specs; sp->type != BLT_SWITCH_END; sp++) {
- if ((Tcl_StringMatch(sp->switchName, switchName)) &&
- (sp->flags & BLT_SWITCH_SPECIFIED)) {
- va_end(argList);
- return 1;
- }
- }
- }
- va_end(argList);
- return 0;
-}
-
-int
-Blt_ExprDoubleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, double *valuePtr)
-{
- /* First try to extract the value as a double precision number. */
- if (Tcl_GetDoubleFromObj((Tcl_Interp *)NULL, objPtr, valuePtr) == TCL_OK) {
- return TCL_OK;
- }
- /* Then try to parse it as an expression. */
- if (Tcl_ExprDouble(interp, Tcl_GetString(objPtr), valuePtr) == TCL_OK) {
- return TCL_OK;
- }
- return TCL_ERROR;
-}
-
-int
-Blt_ExprIntFromObj(
- Tcl_Interp *interp,
- Tcl_Obj *objPtr,
- int *valuePtr)
-{
- long lvalue;
-
- /* First try to extract the value as a simple integer. */
- if (Tcl_GetIntFromObj((Tcl_Interp *)NULL, objPtr, valuePtr) == TCL_OK) {
- return TCL_OK;
- }
- /* Otherwise try to parse it as an expression. */
- if (Tcl_ExprLong(interp, Tcl_GetString(objPtr), &lvalue) == TCL_OK) {
- *valuePtr = lvalue;
- return TCL_OK;
- }
- return TCL_ERROR;
-}
-
diff --git a/blt3.0.1/src/bltSwitch.h b/blt3.0.1/src/bltSwitch.h
deleted file mode 100644
index 603c73f..0000000
--- a/blt3.0.1/src/bltSwitch.h
+++ /dev/null
@@ -1,136 +0,0 @@
-
-/*
- * bltSwitch.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef BLT_SWITCH_H
-#define BLT_SWITCH_H
-
-#ifdef HAVE_STDDEF_H
-# include <stddef.h>
-#endif /* HAVE_STDDEF_H */
-
-#ifndef Blt_Offset
-#ifdef offsetof
-#define Blt_Offset(type, field) ((int) offsetof(type, field))
-#else
-#define Blt_Offset(type, field) ((int) ((char *) &((type *) 0)->field))
-#endif
-#endif /* Blt_Offset */
-
-typedef int (Blt_SwitchParseProc)(ClientData clientData, Tcl_Interp *interp,
- const char *switchName, Tcl_Obj *valueObjPtr, char *record, int offset,
- int flags);
-typedef void (Blt_SwitchFreeProc)(char *record, int offset, int flags);
-
-typedef struct {
- Blt_SwitchParseProc *parseProc; /* Procedure to parse a switch
- * value and store it in its *
- * converted form in the data *
- * record. */
-
- Blt_SwitchFreeProc *freeProc; /* Procedure to free a switch. */
-
- ClientData clientData; /* Arbitrary one-word value used by
- * switch parser, passed to
- * parseProc. */
-} Blt_SwitchCustom;
-
-
-/*
- * Type values for Blt_SwitchSpec structures. See the user
- * documentation for details.
- */
-typedef enum {
- BLT_SWITCH_BOOLEAN,
- BLT_SWITCH_DOUBLE,
- BLT_SWITCH_BITMASK,
- BLT_SWITCH_BITMASK_INVERT,
- BLT_SWITCH_FLOAT,
- BLT_SWITCH_INT,
- BLT_SWITCH_INT_NNEG,
- BLT_SWITCH_INT_POS,
- BLT_SWITCH_LIST,
- BLT_SWITCH_LONG,
- BLT_SWITCH_LONG_NNEG,
- BLT_SWITCH_LONG_POS,
- BLT_SWITCH_OBJ,
- BLT_SWITCH_STRING,
- BLT_SWITCH_VALUE,
- BLT_SWITCH_CUSTOM,
- BLT_SWITCH_END
-} Blt_SwitchTypes;
-
-
-typedef struct {
- Blt_SwitchTypes type; /* Type of option, such as
- * BLT_SWITCH_COLOR; see definitions
- * below. Last option in table must
- * have type BLT_SWITCH_END. */
-
- const char *switchName; /* Switch used to specify option in
- * argv. NULL means this spec is part
- * of a group. */
-
- const char *help; /* Help string. */
- int offset; /* Where in widget record to store
- * value; use Blt_Offset macro to
- * generate values for this. */
-
- int flags; /* Any combination of the values
- * defined below. */
-
- unsigned int mask;
-
- Blt_SwitchCustom *customPtr; /* If type is BLT_SWITCH_CUSTOM then
- * this is a pointer to info about how
- * to parse and print the option.
- * Otherwise it is irrelevant. */
-} Blt_SwitchSpec;
-
-#define BLT_SWITCH_DEFAULTS (0)
-#define BLT_SWITCH_ARGV_PARTIAL (1<<1)
-#define BLT_SWITCH_OBJV_PARTIAL (1<<1)
-
-/*
- * Possible flag values for Blt_SwitchSpec structures. Any bits at or
- * above BLT_SWITCH_USER_BIT may be used by clients for selecting
- * certain entries.
- */
-#define BLT_SWITCH_NULL_OK (1<<0)
-#define BLT_SWITCH_DONT_SET_DEFAULT (1<<3)
-#define BLT_SWITCH_SPECIFIED (1<<4)
-#define BLT_SWITCH_USER_BIT (1<<8)
-
-BLT_EXTERN int Blt_ParseSwitches(Tcl_Interp *interp, Blt_SwitchSpec *specPtr,
- int objc, Tcl_Obj *const *objv, void *rec, int flags);
-
-BLT_EXTERN void Blt_FreeSwitches(Blt_SwitchSpec *specs, void *rec, int flags);
-
-BLT_EXTERN int Blt_SwitchChanged TCL_VARARGS(Blt_SwitchSpec *, specs);
-
-#endif /* BLT_SWITCH_H */
diff --git a/blt3.0.1/src/bltTable.c b/blt3.0.1/src/bltTable.c
deleted file mode 100644
index db79c46..0000000
--- a/blt3.0.1/src/bltTable.c
+++ /dev/null
@@ -1,5138 +0,0 @@
-
-/*
- * bltTable.c --
- *
- * This module implements a table-based geometry manager for the BLT toolkit.
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * To do:
- *
- * 3) No way to detect if widget is already a container of another geometry
- * manager. This one is especially bad with toplevel widgets, causing the
- * window manager to lock-up trying to handle the myriads of resize requests.
- *
- * Note: This problem continues in Tk 8.x. It's possible for a widget
- * to be a container for two different geometry managers. Each manager
- * will set its own requested geometry for the container widget. The
- * winner sets the geometry last (sometimes ad infinitum).
- *
- * 7) Relative sizing of partitions?
- *
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include "bltSwitch.h"
-#include "bltTable.h"
-
-#define TABLE_THREAD_KEY "BLT Table Data"
-#define TABLE_DEF_PAD 0
-
-/*
- * Default values for widget attributes.
- */
-#define DEF_TABLE_ANCHOR "center"
-#define DEF_TABLE_COLUMNS "0"
-#define DEF_TABLE_FILL "none"
-#define DEF_TABLE_PAD "0"
-#define DEF_TABLE_PROPAGATE "1"
-#define DEF_TABLE_RESIZE "both"
-#define DEF_TABLE_ROWS "0"
-#define DEF_TABLE_SPAN "1"
-#define DEF_TABLE_CONTROL "normal"
-#define DEF_TABLE_WEIGHT "1.0"
-
-#define ENTRY_DEF_PAD 0
-#define ENTRY_DEF_ANCHOR TK_ANCHOR_CENTER
-#define ENTRY_DEF_FILL FILL_NONE
-#define ENTRY_DEF_SPAN 1
-#define ENTRY_DEF_CONTROL CONTROL_NORMAL
-#define ENTRY_DEF_IPAD 0
-
-#define ROWCOL_DEF_RESIZE (RESIZE_BOTH | RESIZE_VIRGIN)
-#define ROWCOL_DEF_PAD 0
-#define ROWCOL_DEF_WEIGHT 1.0
-
-#define MATCH_PATTERN (1<<0) /* Find widgets whose path names
- * match a given pattern */
-#define MATCH_SPAN (1<<1) /* Find widgets that span index */
-#define MATCH_START (1<<2) /* Find widgets that start at index */
-
-
-static Blt_Uid rowUid, columnUid;
-
-static Tk_GeomRequestProc WidgetGeometryProc;
-static Tk_GeomLostSlaveProc WidgetCustodyProc;
-static Tk_GeomMgr tableMgrInfo =
-{
- (char *)"table", /* Name of geometry manager used by winfo */
- WidgetGeometryProc, /* Procedure to for new geometry requests */
- WidgetCustodyProc, /* Procedure when widget is taken away */
-};
-
-static Blt_OptionParseProc ObjToLimits;
-static Blt_OptionPrintProc LimitsToObj;
-static Blt_CustomOption limitsOption =
-{
- ObjToLimits, LimitsToObj, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToControl;
-static Blt_OptionPrintProc ControlToObj;
-static Blt_CustomOption controlOption =
-{
- ObjToControl, ControlToObj, NULL, (ClientData)0
-};
-
-static Blt_ConfigSpec rowConfigSpecs[] =
-{
- {BLT_CONFIG_CUSTOM, "-height", (char *)NULL, (char *)NULL, (char *)NULL,
- Blt_Offset(RowColumn, reqSize), 0, &limitsOption},
- {BLT_CONFIG_PAD, "-pady", (char *)NULL, (char *)NULL, DEF_TABLE_PAD,
- Blt_Offset(RowColumn, pad), BLT_CONFIG_DONT_SET_DEFAULT, },
- {BLT_CONFIG_RESIZE, "-resize", (char *)NULL, (char *)NULL, DEF_TABLE_RESIZE,
- Blt_Offset(RowColumn, resize), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FLOAT, "-weight", (char *)NULL, (char *)NULL, DEF_TABLE_WEIGHT,
- Blt_Offset(RowColumn, weight), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static Blt_ConfigSpec columnConfigSpecs[] =
-{
- {BLT_CONFIG_PAD, "-padx", (char *)NULL, (char *)NULL, DEF_TABLE_PAD,
- Blt_Offset(RowColumn, pad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RESIZE, "-resize", (char *)NULL, (char *)NULL, DEF_TABLE_RESIZE,
- Blt_Offset(RowColumn, resize), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FLOAT, "-weight", (char *)NULL, (char *)NULL, DEF_TABLE_WEIGHT,
- Blt_Offset(RowColumn, weight), BLT_CONFIG_DONT_SET_DEFAULT,
- &limitsOption},
- {BLT_CONFIG_CUSTOM, "-width", (char *)NULL, (char *)NULL, (char *)NULL,
- Blt_Offset(RowColumn, reqSize), 0, &limitsOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-
-static Blt_ConfigSpec entryConfigSpecs[] =
-{
- {BLT_CONFIG_ANCHOR, "-anchor", (char *)NULL, (char *)NULL,
- DEF_TABLE_ANCHOR, Blt_Offset(TableEntry, anchor),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_INT, "-columnspan", "columnSpan", (char *)NULL,
- DEF_TABLE_SPAN, Blt_Offset(TableEntry, column.span),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-columncontrol", "columnControl", (char *)NULL,
- DEF_TABLE_CONTROL, Blt_Offset(TableEntry, column.control),
- BLT_CONFIG_DONT_SET_DEFAULT, &controlOption},
- {BLT_CONFIG_SYNONYM, "-cspan", "columnSpan", (char *)NULL, (char *)NULL,
- Blt_Offset(TableEntry, column.span), 0},
- {BLT_CONFIG_SYNONYM, "-ccontrol", "columnControl", (char *)NULL,
- (char *)NULL, Blt_Offset(TableEntry, column.control), 0},
- {BLT_CONFIG_FILL, "-fill", (char *)NULL, (char *)NULL, DEF_TABLE_FILL,
- Blt_Offset(TableEntry, fill), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-height", "reqHeight", (char *)NULL,
- (char *)NULL, Blt_Offset(TableEntry, reqHeight), 0},
- {BLT_CONFIG_PAD, "-padx", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(TableEntry, xPad), 0},
- {BLT_CONFIG_PAD, "-pady", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(TableEntry, yPad), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-ipadx", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(TableEntry, ixPad), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-ipady", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(TableEntry, iyPad), 0},
- {BLT_CONFIG_CUSTOM, "-reqheight", "reqHeight", (char *)NULL, (char *)NULL,
- Blt_Offset(TableEntry, reqHeight), 0, &limitsOption},
- {BLT_CONFIG_CUSTOM, "-reqwidth", "reqWidth", (char *)NULL, (char *)NULL,
- Blt_Offset(TableEntry, reqWidth), 0, &limitsOption},
- {BLT_CONFIG_INT, "-rowspan", "rowSpan", (char *)NULL, DEF_TABLE_SPAN,
- Blt_Offset(TableEntry, row.span), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-rowcontrol", "rowControl", (char *)NULL,
- DEF_TABLE_CONTROL, Blt_Offset(TableEntry, row.control),
- BLT_CONFIG_DONT_SET_DEFAULT, &controlOption},
- {BLT_CONFIG_SYNONYM, "-rspan", "rowSpan", (char *)NULL, (char *)NULL,
- Blt_Offset(TableEntry, row.span), 0},
- {BLT_CONFIG_SYNONYM, "-rcontrol", "rowControl", (char *)NULL, (char *)NULL,
- Blt_Offset(TableEntry, row.control), 0},
- {BLT_CONFIG_SYNONYM, "-width", "reqWidth", (char *)NULL, (char *)NULL,
- Blt_Offset(TableEntry, reqWidth), 0},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-
-static Blt_ConfigSpec tableConfigSpecs[] =
-{
- {BLT_CONFIG_PAD, "-padx", (char *)NULL, (char *)NULL,
- DEF_TABLE_PAD, Blt_Offset(Table, xPad),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-pady", (char *)NULL, (char *)NULL,
- DEF_TABLE_PAD, Blt_Offset(Table, yPad),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-propagate", (char *)NULL, (char *)NULL,
- DEF_TABLE_PROPAGATE, Blt_Offset(Table, propagate),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-reqheight", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(Table, reqHeight), 0, &limitsOption},
- {BLT_CONFIG_CUSTOM, "-reqwidth", (char *)NULL, (char *)NULL,
- (char *)NULL, Blt_Offset(Table, reqWidth), 0, &limitsOption},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-static Blt_SwitchParseProc ObjToPosition;
-static Blt_SwitchCustom positionSwitch =
-{
- ObjToPosition, NULL, 0,
-};
-
-typedef struct {
- int rspan, cspan;
- int rstart, cstart;
- int flags;
- const char *pattern;
- Table *tablePtr;
-} SearchSwitches;
-
-static Blt_SwitchSpec searchSwitches[] =
-{
- {BLT_SWITCH_STRING, "-pattern", "pattern",
- Blt_Offset(SearchSwitches, pattern), 0, 0,},
- {BLT_SWITCH_CUSTOM, "-span", "int",
- 0, 0, 0, &positionSwitch},
- {BLT_SWITCH_CUSTOM, "-start", "position",
- 0, 0, 0, &positionSwitch},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- const char *pattern;
- const char *slave;
-} NamesSwitches;
-
-static Blt_SwitchSpec namesSwitches[] =
-{
- {BLT_SWITCH_STRING, "-pattern", "pattern",
- Blt_Offset(NamesSwitches, pattern), 0, 0,},
- {BLT_SWITCH_STRING, "-slave", "widget",
- Blt_Offset(NamesSwitches, slave), 0, 0},
- {BLT_SWITCH_END}
-};
-
-/*
- * Forward declarations
- */
-static Tcl_FreeProc DestroyTable;
-static Tcl_IdleProc ArrangeTable;
-static Tcl_InterpDeleteProc TableInterpDeleteProc;
-static Tcl_ObjCmdProc TableCmd;
-static Tk_EventProc TableEventProc;
-static Tk_EventProc WidgetEventProc;
-
-static void DestroyEntry(TableEntry * tePtr);
-static void BinEntry(Table *tablePtr, TableEntry * tePtr);
-static RowColumn *InitSpan(PartitionInfo * piPtr, int start, int span);
-static int ParseItem(Table *tablePtr, const char *string, int *rowPtr,
- int *colPtr);
-
-static EntrySearchProc FindEntry;
-
-typedef int (TableCmdProc)(TableInterpData *dataPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToLimits --
- *
- * Converts the list of elements into zero or more pixel values which
- * determine the range of pixel values possible. An element can be in
- * any form accepted by Tk_GetPixels. The list has a different meaning
- * based upon the number of elements.
- *
- * # of elements:
- *
- * 0 - the limits are reset to the defaults.
- * 1 - the minimum and maximum values are set to this
- * value, freezing the range at a single value.
- * 2 - first element is the minimum, the second is the
- * maximum.
- * 3 - first element is the minimum, the second is the
- * maximum, and the third is the nominal value.
- *
- * Any element may be the empty string which indicates the default.
- *
- * Results:
- * The return value is a standard TCL result. The min and max fields
- * of the range are set.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToLimits(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Widget of table */
- Tcl_Obj *objPtr, /* New width list */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Limits *limitsPtr = (Limits *)(widgRec + offset);
- const char **argv;
- int argc;
- int limArr[3];
- Tk_Window winArr[3];
- int limitsFlags;
-
- argv = NULL;
- argc = 0;
-
- /* Initialize limits to default values */
- limArr[2] = LIMITS_NOM;
- limArr[1] = LIMITS_MAX;
- limArr[0] = LIMITS_MIN;
- winArr[0] = winArr[1] = winArr[2] = NULL;
- limitsFlags = 0;
-
- if (objPtr != NULL) {
- int size;
- int i;
- const char *string;
-
- string = Tcl_GetString(objPtr);
- if (Tcl_SplitList(interp, string, &argc, &argv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (argc > 3) {
- Tcl_AppendResult(interp, "wrong # limits \"", string, "\"",
- (char *)NULL);
- goto error;
- }
- for (i = 0; i < argc; i++) {
- if (argv[i][0] == '\0') {
- continue; /* Empty string: use default value */
- }
- limitsFlags |= (LIMITS_SET_BIT << i);
- if ((argv[i][0] == '.') &&
- ((argv[i][1] == '\0') || isalpha(UCHAR(argv[i][1])))) {
- Tk_Window tkwin2;
-
- /* Widget specified: save pointer to widget */
- tkwin2 = Tk_NameToWindow(interp, argv[i], tkwin);
- if (tkwin2 == NULL) {
- goto error;
- }
- winArr[i] = tkwin2;
- } else {
- if (Tk_GetPixels(interp, tkwin, argv[i], &size) != TCL_OK) {
- goto error;
- }
- if ((size < LIMITS_MIN) || (size > LIMITS_MAX)) {
- Tcl_AppendResult(interp, "bad limits \"", string, "\"",
- (char *)NULL);
- goto error;
- }
- limArr[i] = size;
- }
- }
- Blt_Free(argv);
- }
- /*
- * Check the limits specified. We can't check the requested
- * size of widgets.
- */
- switch (argc) {
- case 1:
- limitsFlags |= (LIMITS_SET_MIN | LIMITS_SET_MAX);
- if (winArr[0] == NULL) {
- limArr[1] = limArr[0]; /* Set minimum and maximum to value */
- } else {
- winArr[1] = winArr[0];
- }
- break;
-
- case 2:
- if ((winArr[0] == NULL) && (winArr[1] == NULL) &&
- (limArr[1] < limArr[0])) {
- Tcl_AppendResult(interp, "bad range \"", Tcl_GetString(objPtr),
- "\": min > max", (char *)NULL);
- return TCL_ERROR; /* Minimum is greater than maximum */
- }
- break;
-
- case 3:
- if ((winArr[0] == NULL) && (winArr[1] == NULL)) {
- if (limArr[1] < limArr[0]) {
- Tcl_AppendResult(interp, "bad range \"", Tcl_GetString(objPtr),
- "\": min > max", (char *)NULL);
- return TCL_ERROR; /* Minimum is greater than maximum */
- }
- if ((winArr[2] == NULL) &&
- ((limArr[2] < limArr[0]) || (limArr[2] > limArr[1]))) {
- Tcl_AppendResult(interp, "nominal value \"",
- Tcl_GetString(objPtr),
- "\" out of range", (char *)NULL);
- return TCL_ERROR; /* Nominal is outside of range defined
- * by minimum and maximum */
- }
- }
- break;
- }
- limitsPtr->min = limArr[0];
- limitsPtr->max = limArr[1];
- limitsPtr->nom = limArr[2];
- limitsPtr->wMin = winArr[0];
- limitsPtr->wMax = winArr[1];
- limitsPtr->wNom = winArr[2];
- limitsPtr->flags = limitsFlags;
- return TCL_OK;
- error:
- Blt_Free(argv);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResetLimits --
- *
- * Resets the limits to their default values.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-INLINE static void
-ResetLimits(Limits *limitsPtr) /* Limits to be imposed on the value */
-{
- limitsPtr->flags = 0;
- limitsPtr->min = LIMITS_MIN;
- limitsPtr->max = LIMITS_MAX;
- limitsPtr->nom = LIMITS_NOM;
- limitsPtr->wNom = limitsPtr->wMax = limitsPtr->wMin = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetBoundedWidth --
- *
- * Bounds a given width value to the limits described in the limit
- * structure. The initial starting value may be overridden by the
- * nominal value in the limits.
- *
- * Results:
- * Returns the constrained value.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetBoundedWidth(
- int width, /* Initial value to be constrained */
- Limits *limitsPtr) /* Limits to be imposed on the value */
-{
- /*
- * Check widgets for requested width values;
- */
- if (limitsPtr->wMin != NULL) {
- limitsPtr->min = Tk_ReqWidth(limitsPtr->wMin);
- }
- if (limitsPtr->wMax != NULL) {
- limitsPtr->max = Tk_ReqWidth(limitsPtr->wMax);
- }
- if (limitsPtr->wNom != NULL) {
- limitsPtr->nom = Tk_ReqWidth(limitsPtr->wNom);
- }
- if (limitsPtr->flags & LIMITS_SET_NOM) {
- width = limitsPtr->nom; /* Override initial value */
- }
- if (width < limitsPtr->min) {
- width = limitsPtr->min; /* Bounded by minimum value */
- } else if (width > limitsPtr->max) {
- width = limitsPtr->max; /* Bounded by maximum value */
- }
- return width;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetBoundedHeight --
- *
- * Bounds a given value to the limits described in the limit structure.
- * The initial starting value may be overridden by the nominal value in
- * the limits.
- *
- * Results:
- * Returns the constrained value.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetBoundedHeight(
- int height, /* Initial value to be constrained */
- Limits *limitsPtr) /* Limits to be imposed on the value */
-{
- /*
- * Check widgets for requested height values;
- */
- if (limitsPtr->wMin != NULL) {
- limitsPtr->min = Tk_ReqHeight(limitsPtr->wMin);
- }
- if (limitsPtr->wMax != NULL) {
- limitsPtr->max = Tk_ReqHeight(limitsPtr->wMax);
- }
- if (limitsPtr->wNom != NULL) {
- limitsPtr->nom = Tk_ReqHeight(limitsPtr->wNom);
- }
- if (limitsPtr->flags & LIMITS_SET_NOM) {
- height = limitsPtr->nom;/* Override initial value */
- }
- if (height < limitsPtr->min) {
- height = limitsPtr->min;/* Bounded by minimum value */
- } else if (height > limitsPtr->max) {
- height = limitsPtr->max;/* Bounded by maximum value */
- }
- return height;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NameOfLimits --
- *
- * Convert the values into a list representing the limits.
- *
- * Results:
- * The static string representation of the limits is returned.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-NameOfLimits(Limits *limitsPtr)
-{
- Tcl_DString buffer;
-#define STRING_SPACE 200
- static char string[STRING_SPACE + 1];
-
- Tcl_DStringInit(&buffer);
-
- if (limitsPtr->wMin != NULL) {
- Tcl_DStringAppendElement(&buffer, Tk_PathName(limitsPtr->wMin));
- } else if (limitsPtr->flags & LIMITS_SET_MIN) {
- Tcl_DStringAppendElement(&buffer, Blt_Itoa(limitsPtr->min));
- } else {
- Tcl_DStringAppendElement(&buffer, "");
- }
-
- if (limitsPtr->wMax != NULL) {
- Tcl_DStringAppendElement(&buffer, Tk_PathName(limitsPtr->wMax));
- } else if (limitsPtr->flags & LIMITS_SET_MAX) {
- Tcl_DStringAppendElement(&buffer, Blt_Itoa(limitsPtr->max));
- } else {
- Tcl_DStringAppendElement(&buffer, "");
- }
-
- if (limitsPtr->wNom != NULL) {
- Tcl_DStringAppendElement(&buffer, Tk_PathName(limitsPtr->wNom));
- } else if (limitsPtr->flags & LIMITS_SET_NOM) {
- Tcl_DStringAppendElement(&buffer, Blt_Itoa(limitsPtr->nom));
- } else {
- Tcl_DStringAppendElement(&buffer, "");
- }
- strncpy(string, Tcl_DStringValue(&buffer), STRING_SPACE);
- string[STRING_SPACE] = '\0';
- return string;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LimitsToObj --
- *
- * Convert the limits of the pixel values allowed into a list.
- *
- * Results:
- * The string representation of the limits is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-LimitsToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Row/column structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Limits *limitsPtr = (Limits *)(widgRec + offset);
-
- return Tcl_NewStringObj(NameOfLimits(limitsPtr), -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToControl --
- *
- * Converts the control string into its numeric representation. Valid
- * control strings are "none", "normal", and "full".
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToControl(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Control style string */
- char *widgRec, /* Entry structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- const char *string;
- char c;
- float *controlPtr = (float *)(widgRec + offset);
- int bool;
- int length;
-
- if (Tcl_GetBooleanFromObj(NULL, objPtr, &bool) == TCL_OK) {
- *controlPtr = bool;
- return TCL_OK;
- }
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'n') && (length > 1) &&
- (strncmp(string, "normal", length) == 0)) {
- *controlPtr = CONTROL_NORMAL;
- } else if ((c == 'n') && (length > 1) &&
- (strncmp(string, "none", length) == 0)) {
- *controlPtr = CONTROL_NONE;
- } else if ((c == 'f') && (strncmp(string, "full", length) == 0)) {
- *controlPtr = CONTROL_FULL;
- } else {
- double control;
-
- if ((Tcl_GetDoubleFromObj(interp, objPtr, &control) != TCL_OK) ||
- (control < 0.0)) {
- Tcl_AppendResult(interp, "bad control argument \"", string,
- "\": should be \"normal\", \"none\", or \"full\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- *controlPtr = (float)control;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NameOfControl --
- *
- * Converts the control value into its string representation.
- *
- * Results:
- * Returns a pointer to the static name string.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-NameOfControl(float control)
-{
- if (control == CONTROL_NORMAL) {
- return "normal";
- } else if (control == CONTROL_NONE) {
- return "none";
- } else if (control == CONTROL_FULL) {
- return "full";
- } else {
- static char string[TCL_DOUBLE_SPACE];
-
- sprintf_s(string, TCL_DOUBLE_SPACE, "%g", (double)control);
- return string;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ControlToObj --
- *
- * Returns control mode string based upon the control flags.
- *
- * Results:
- * The control mode string is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ControlToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Row/column structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- float control = *(float *)(widgRec + offset);
-
- return Tcl_NewStringObj(NameOfControl(control), -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToPosition --
- *
- * Converts the position mode into its numeric representation.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToPosition(
- ClientData clientData, /* Flag indicating if the node is considered
- * before or after the insertion position. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- SearchSwitches *searchPtr = (SearchSwitches *)record;
- int row, column;
-
- if (ParseItem(searchPtr->tablePtr, Tcl_GetString(objPtr), &row, &column)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (strcmp(switchName, "-span") == 0) {
- searchPtr->flags |= MATCH_SPAN;
- searchPtr->rspan = row;
- searchPtr->cspan = column;
- } else if (strcmp(switchName, "-start") == 0) {
- searchPtr->flags |= MATCH_START;
- searchPtr->rstart = row;
- searchPtr->cstart = column;
- }
- return TCL_OK;
-}
-
-
-static void
-EventuallyArrangeTable(Table *tablePtr)
-{
- if (!(tablePtr->flags & ARRANGE_PENDING)) {
- tablePtr->flags |= ARRANGE_PENDING;
- Tcl_DoWhenIdle(ArrangeTable, tablePtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableEventProc --
- *
- * This procedure is invoked by the Tk event handler when the container
- * widget is reconfigured or destroyed.
- *
- * The table will be rearranged at the next idle point if the container
- * widget has been resized or moved. There's a distinction made between
- * parent and non-parent container arrangements. When the container is
- * the parent of the embedded widgets, the widgets will automatically
- * keep their positions relative to the container, even when the
- * container is moved. But if the container is not the parent, those
- * widgets have to be moved manually. This can be a performance hit in
- * rare cases where we're scrolling the container (by moving the window)
- * and there are lots of non-child widgets arranged inside.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the table associated with tkwin to have its layout
- * re-computed and drawn at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TableEventProc(
- ClientData clientData, /* Information about widget */
- XEvent *eventPtr) /* Information about event */
-{
- Table *tablePtr = clientData;
-
- if (eventPtr->type == ConfigureNotify) {
- if ((tablePtr->container.width != Tk_Width(tablePtr->tkwin)) ||
- (tablePtr->container.height != Tk_Height(tablePtr->tkwin))
- || (tablePtr->flags & NON_PARENT)) {
- EventuallyArrangeTable(tablePtr);
- }
- } else if (eventPtr->type == DestroyNotify) {
- if (tablePtr->flags & ARRANGE_PENDING) {
- Tcl_CancelIdleCall(ArrangeTable, tablePtr);
- }
- tablePtr->tkwin = NULL;
- Tcl_EventuallyFree(tablePtr, DestroyTable);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WidgetEventProc --
- *
- * This procedure is invoked by the Tk event handler when StructureNotify
- * events occur in a widget managed by the table.
- *
- * For example, when a managed widget is destroyed, it frees the
- * corresponding entry structure and arranges for the table layout to be
- * re-computed at the next idle point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * If the managed widget was deleted, the Entry structure gets cleaned up
- * and the table is rearranged.
- *
- *---------------------------------------------------------------------------
- */
-static void
-WidgetEventProc(
- ClientData clientData, /* Pointer to Entry structure for widget
- * referred to by eventPtr. */
- XEvent *eventPtr) /* Describes what just happened. */
-{
- TableEntry *tePtr = (TableEntry *) clientData;
- Table *tablePtr = tePtr->tablePtr;
-
- if (eventPtr->type == ConfigureNotify) {
- int borderWidth;
-
- tablePtr->flags |= REQUEST_LAYOUT;
- borderWidth = Tk_Changes(tePtr->tkwin)->border_width;
- if (tePtr->borderWidth != borderWidth) {
- tePtr->borderWidth = borderWidth;
- EventuallyArrangeTable(tablePtr);
- }
- } else if (eventPtr->type == DestroyNotify) {
- tePtr->tkwin = NULL;
- DestroyEntry(tePtr);
- tablePtr->flags |= REQUEST_LAYOUT;
- EventuallyArrangeTable(tablePtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WidgetCustodyProc --
- *
- * This procedure is invoked when a widget has been stolen by another
- * geometry manager. The information and memory associated with the
- * widget is released.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the table to have its layout re-arranged at the next idle
- * point.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-WidgetCustodyProc(
- ClientData clientData, /* Information about the widget */
- Tk_Window tkwin) /* Not used. */
-{
- TableEntry *tePtr = (TableEntry *) clientData;
- Table *tablePtr = tePtr->tablePtr;
-
- if (Tk_IsMapped(tePtr->tkwin)) {
- Tk_UnmapWindow(tePtr->tkwin);
- }
- Tk_UnmaintainGeometry(tePtr->tkwin, tablePtr->tkwin);
- tePtr->tkwin = NULL;
- DestroyEntry(tePtr);
- tablePtr->flags |= REQUEST_LAYOUT;
- EventuallyArrangeTable(tablePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WidgetGeometryProc --
- *
- * This procedure is invoked by Tk_GeometryRequest for widgets managed by
- * the table geometry manager.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the table to have its layout re-computed and re-arranged
- * at the next idle point.
- *
- * ---------------------------------------------------------------------------- */
-/* ARGSUSED */
-static void
-WidgetGeometryProc(
- ClientData clientData, /* Information about widget that got new
- * preferred geometry. */
- Tk_Window tkwin) /* Other Tk-related information about the
- * widget. */
-{
- TableEntry *tePtr = (TableEntry *) clientData;
-
- tePtr->tablePtr->flags |= REQUEST_LAYOUT;
- EventuallyArrangeTable(tePtr->tablePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindEntry --
- *
- * Searches for the table entry corresponding to the given widget.
- *
- * Results:
- * If a structure associated with the widget exists, a pointer to that
- * structure is returned. Otherwise NULL.
- *
- *---------------------------------------------------------------------------
- */
-static TableEntry *
-FindEntry(
- Table *tablePtr,
- Tk_Window tkwin) /* Widget associated with table entry */
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&tablePtr->entryTable, (char *)tkwin);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-
-static int
-GetEntry(Tcl_Interp *interp, Table *tablePtr, const char *string,
- TableEntry **tePtrPtr)
-{
- Tk_Window tkwin;
- TableEntry *tePtr;
-
- tkwin = Tk_NameToWindow(interp, string, tablePtr->tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- tePtr = FindEntry(tablePtr, tkwin);
- if (tePtr == NULL) {
- Tcl_AppendResult(interp, "\"", Tk_PathName(tkwin),
- "\" is not managed by any table", (char *)NULL);
- return TCL_ERROR;
- }
- *tePtrPtr = tePtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateEntry --
- *
- * This procedure creates and initializes a new Entry structure to hold a
- * widget. A valid widget has a parent widget that is either a) the
- * container widget itself or b) a mutual ancestor of the container
- * widget.
- *
- * Results:
- * Returns a pointer to the new structure describing the new widget
- * entry. If an error occurred, then the return value is NULL and an
- * error message is left in interp->result.
- *
- * Side effects:
- * Memory is allocated and initialized for the Entry structure.
- *
- * ----------------------------------------------------------------------------
- */
-static TableEntry *
-CreateEntry(
- Table *tablePtr,
- Tk_Window tkwin)
-{
- TableEntry *tePtr;
- int dummy;
- Tk_Window parent, ancestor;
-
- /*
- * Check that this widget can be managed by this table. A valid widget
- * has a parent widget that either
- *
- * 1) is the container widget, or
- * 2) is a mutual ancestor of the container widget.
- */
- ancestor = Tk_Parent(tkwin);
- for (parent = tablePtr->tkwin; (parent != ancestor) &&
- (!Tk_IsTopLevel(parent)); parent = Tk_Parent(parent)) {
- /* empty */
- }
- if (ancestor != parent) {
- Tcl_AppendResult(tablePtr->interp, "can't manage \"",
- Tk_PathName(tkwin), "\" in table \"", Tk_PathName(tablePtr->tkwin),
- "\"", (char *)NULL);
- return NULL;
- }
- tePtr = Blt_AssertCalloc(1, sizeof(TableEntry));
-
- /* Initialize the entry structure */
-
- tePtr->tkwin = tkwin;
- tePtr->tablePtr = tablePtr;
- tePtr->borderWidth = Tk_Changes(tkwin)->border_width;
- tePtr->fill = ENTRY_DEF_FILL;
- tePtr->row.control = tePtr->column.control = ENTRY_DEF_CONTROL;
- tePtr->anchor = ENTRY_DEF_ANCHOR;
- tePtr->row.span = tePtr->column.span = ENTRY_DEF_SPAN;
- ResetLimits(&tePtr->reqWidth);
- ResetLimits(&tePtr->reqHeight);
-
- /*
- * Add the entry to the following data structures.
- *
- * 1) A chain of widgets managed by the table.
- * 2) A hash table of widgets managed by the table.
- */
- tePtr->link = Blt_Chain_Append(tablePtr->chain, tePtr);
- tePtr->hashPtr = Blt_CreateHashEntry(&tablePtr->entryTable,
- (char *)tkwin, &dummy);
- Blt_SetHashValue(tePtr->hashPtr, tePtr);
-
- Tk_CreateEventHandler(tkwin, StructureNotifyMask, WidgetEventProc,
- tePtr);
- Tk_ManageGeometry(tkwin, &tableMgrInfo, (ClientData)tePtr);
-
- return tePtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyEntry --
- *
- * Removes the Entry structure from the hash table and frees the memory
- * allocated by it. If the table is still in use (i.e. was not called
- * from DestoryTable), remove its entries from the lists of row and
- * column sorted partitions.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the entry is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyEntry(TableEntry *tePtr)
-{
- Table *tablePtr = tePtr->tablePtr;
-
- if (tePtr->row.link != NULL) {
- Blt_Chain_DeleteLink(tePtr->row.chain, tePtr->row.link);
- }
- if (tePtr->column.link != NULL) {
- Blt_Chain_DeleteLink(tePtr->column.chain,
- tePtr->column.link);
- }
- if (tePtr->link != NULL) {
- Blt_Chain_DeleteLink(tablePtr->chain, tePtr->link);
- }
- if (tePtr->tkwin != NULL) {
- Tk_DeleteEventHandler(tePtr->tkwin, StructureNotifyMask,
- WidgetEventProc, (ClientData)tePtr);
- Tk_ManageGeometry(tePtr->tkwin, (Tk_GeomMgr *)NULL,
- (ClientData)tePtr);
- if ((tablePtr->tkwin != NULL) &&
- (Tk_Parent(tePtr->tkwin) != tablePtr->tkwin)) {
- Tk_UnmaintainGeometry(tePtr->tkwin, tablePtr->tkwin);
- }
- if (Tk_IsMapped(tePtr->tkwin)) {
- Tk_UnmapWindow(tePtr->tkwin);
- }
- }
- if (tePtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&tablePtr->entryTable, tePtr->hashPtr);
- }
- Blt_Free(tePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureEntry --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) one or more
- * entries. Entries hold information about widgets managed by the table
- * geometry manager.
- *
- * Note: You can query only one widget at a time. But several can be
- * reconfigured at once.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result contains an error message.
- *
- * Side effects:
- * The table layout is recomputed and rearranged at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureEntry(Table *tablePtr, Tcl_Interp *interp, TableEntry *tePtr,
- int objc, Tcl_Obj *const *objv)
-{
- int oldRowSpan, oldColSpan;
-
- if (tePtr->tablePtr != tablePtr) {
- Tcl_AppendResult(interp, "widget \"", Tk_PathName(tePtr->tkwin),
- "\" does not belong to table \"", Tk_PathName(tablePtr->tkwin),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (objc == 0) {
- return Blt_ConfigureInfoFromObj(interp, tePtr->tkwin,
- entryConfigSpecs, (char *)tePtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 1) {
- return Blt_ConfigureInfoFromObj(interp, tePtr->tkwin,
- entryConfigSpecs, (char *)tePtr, objv[0], 0);
- }
- oldRowSpan = tePtr->row.span;
- oldColSpan = tePtr->column.span;
-
- if (Blt_ConfigureWidgetFromObj(interp, tePtr->tkwin, entryConfigSpecs,
- objc, objv, (char *)tePtr, BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((tePtr->column.span < 1) || (tePtr->column.span > USHRT_MAX)) {
- Tcl_AppendResult(interp, "bad column span specified for \"",
- Tk_PathName(tePtr->tkwin), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if ((tePtr->row.span < 1) || (tePtr->row.span > USHRT_MAX)) {
- Tcl_AppendResult(interp, "bad row span specified for \"",
- Tk_PathName(tePtr->tkwin), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if ((oldColSpan != tePtr->column.span) ||
- (oldRowSpan != tePtr->row.span)) {
- BinEntry(tablePtr, tePtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PrintEntry --
- *
- * Returns the name, position and options of a widget in the table.
- *
- * Results:
- * Returns a standard TCL result. A list of the widget attributes is
- * left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-PrintEntry(TableEntry *tePtr, Tcl_DString *resultPtr)
-{
- char string[200];
-
- sprintf_s(string, 200, " %d,%d ", tePtr->row.rcPtr->index,
- tePtr->column.rcPtr->index);
- Tcl_DStringAppend(resultPtr, string, -1);
- Tcl_DStringAppend(resultPtr, Tk_PathName(tePtr->tkwin), -1);
- if (tePtr->ixPad != ENTRY_DEF_PAD) {
- Tcl_DStringAppend(resultPtr, " -ipadx ", -1);
- Tcl_DStringAppend(resultPtr, Blt_Itoa(tePtr->ixPad), -1);
- }
- if (tePtr->iyPad != ENTRY_DEF_PAD) {
- Tcl_DStringAppend(resultPtr, " -ipady ", -1);
- Tcl_DStringAppend(resultPtr, Blt_Itoa(tePtr->iyPad), -1);
- }
- if (tePtr->row.span != ENTRY_DEF_SPAN) {
- Tcl_DStringAppend(resultPtr, " -rowspan ", -1);
- Tcl_DStringAppend(resultPtr, Blt_Itoa(tePtr->row.span), -1);
- }
- if (tePtr->column.span != ENTRY_DEF_SPAN) {
- Tcl_DStringAppend(resultPtr, " -columnspan ", -1);
- Tcl_DStringAppend(resultPtr, Blt_Itoa(tePtr->column.span), -1);
- }
- if (tePtr->anchor != ENTRY_DEF_ANCHOR) {
- Tcl_DStringAppend(resultPtr, " -anchor ", -1);
- Tcl_DStringAppend(resultPtr, Tk_NameOfAnchor(tePtr->anchor), -1);
- }
- if ((tePtr->padLeft != ENTRY_DEF_PAD) ||
- (tePtr->padRight != ENTRY_DEF_PAD)) {
- Tcl_DStringAppend(resultPtr, " -padx ", -1);
- sprintf_s(string, 200, "{%d %d}", tePtr->padLeft, tePtr->padRight);
- Tcl_DStringAppend(resultPtr, string, -1);
- }
- if ((tePtr->padTop != ENTRY_DEF_PAD) ||
- (tePtr->padBottom != ENTRY_DEF_PAD)) {
- Tcl_DStringAppend(resultPtr, " -pady ", -1);
- sprintf_s(string, 200, "{%d %d}", tePtr->padTop, tePtr->padBottom);
- Tcl_DStringAppend(resultPtr, string, -1);
- }
- if (tePtr->fill != ENTRY_DEF_FILL) {
- Tcl_DStringAppend(resultPtr, " -fill ", -1);
- Tcl_DStringAppend(resultPtr, Blt_NameOfFill(tePtr->fill), -1);
- }
- if (tePtr->column.control != ENTRY_DEF_CONTROL) {
- Tcl_DStringAppend(resultPtr, " -columncontrol ", -1);
- Tcl_DStringAppend(resultPtr, NameOfControl(tePtr->column.control), -1);
- }
- if (tePtr->row.control != ENTRY_DEF_CONTROL) {
- Tcl_DStringAppend(resultPtr, " -rowcontrol ", -1);
- Tcl_DStringAppend(resultPtr, NameOfControl(tePtr->row.control), -1);
- }
- if ((tePtr->reqWidth.nom != LIMITS_NOM) ||
- (tePtr->reqWidth.min != LIMITS_MIN) ||
- (tePtr->reqWidth.max != LIMITS_MAX)) {
- Tcl_DStringAppend(resultPtr, " -reqwidth {", -1);
- Tcl_DStringAppend(resultPtr, NameOfLimits(&tePtr->reqWidth), -1);
- Tcl_DStringAppend(resultPtr, "}", -1);
- }
- if ((tePtr->reqHeight.nom != LIMITS_NOM) ||
- (tePtr->reqHeight.min != LIMITS_MIN) ||
- (tePtr->reqHeight.max != LIMITS_MAX)) {
- Tcl_DStringAppend(resultPtr, " -reqheight {", -1);
- Tcl_DStringAppend(resultPtr, NameOfLimits(&tePtr->reqHeight), -1);
- Tcl_DStringAppend(resultPtr, "}", -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InfoEntry --
- *
- * Returns the name, position and options of a widget in the table.
- *
- * Results:
- * Returns a standard TCL result. A list of the widget attributes is
- * left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InfoEntry(Tcl_Interp *interp, Table *tablePtr, TableEntry *tePtr)
-{
- Tcl_DString dString;
-
- if (tePtr->tablePtr != tablePtr) {
- Tcl_AppendResult(interp, "widget \"", Tk_PathName(tePtr->tkwin),
- "\" does not belong to table \"", Tk_PathName(tablePtr->tkwin),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_DStringInit(&dString);
- PrintEntry(tePtr, &dString);
- Tcl_DStringResult(interp, &dString);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateRowColumn --
- *
- * Creates and initializes a structure that manages the size of a row or
- * column in the table. There will be one of these structures allocated
- * for each row and column in the table, regardless if a widget is
- * contained in it or not.
- *
- * Results:
- * Returns a pointer to the newly allocated row or column structure.
- *
- *---------------------------------------------------------------------------
- */
-static RowColumn *
-CreateRowColumn(void)
-{
- RowColumn *rcPtr;
-
- rcPtr = Blt_AssertMalloc(sizeof(RowColumn));
- rcPtr->resize = ROWCOL_DEF_RESIZE;
- ResetLimits(&rcPtr->reqSize);
- rcPtr->nom = LIMITS_NOM;
- rcPtr->pad.side1 = rcPtr->pad.side2 = ROWCOL_DEF_PAD;
- rcPtr->size = rcPtr->index = rcPtr->minSpan = 0;
- rcPtr->weight = ROWCOL_DEF_WEIGHT;
- return rcPtr;
-}
-
-static PartitionInfo *
-ParseRowColumn2(Table *tablePtr, const char *string, int *numberPtr)
-{
- char c;
- int n;
- PartitionInfo *piPtr;
-
- c = tolower(string[0]);
- if (c == 'c') {
- piPtr = &tablePtr->cols;
- } else if (c == 'r') {
- piPtr = &tablePtr->rows;
- } else {
- Tcl_AppendResult(tablePtr->interp, "bad index \"", string,
- "\": must start with \"r\" or \"c\"", (char *)NULL);
- return NULL;
- }
- /* Handle row or column configuration queries */
- if (Tcl_GetInt(tablePtr->interp, string + 1, &n) != TCL_OK) {
- return NULL;
- }
- *numberPtr = (int)n;
- return piPtr;
-}
-
-static PartitionInfo *
-ParseRowColumn(Table *tablePtr, Tcl_Obj *objPtr, int *numberPtr)
-{
- int n;
- PartitionInfo *piPtr;
- const char *string;
-
- string = Tcl_GetString(objPtr);
- piPtr = ParseRowColumn2(tablePtr, string, &n);
- if (piPtr == NULL) {
- return NULL;
- }
- if ((n < 0) || (n >= Blt_Chain_GetLength(piPtr->chain))) {
- Tcl_AppendResult(tablePtr->interp, "bad ", piPtr->type, " index \"",
- string, "\"", (char *)NULL);
- return NULL;
- }
- *numberPtr = (int)n;
- return piPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetRowColumn --
- *
- * Gets the designated row or column from the table. If the row or
- * column index is greater than the size of the table, new rows/columns
- * will be automatically allocated.
- *
- * Results:
- * Returns a pointer to the row or column structure.
- *
- *---------------------------------------------------------------------------
- */
-static RowColumn *
-GetRowColumn(PartitionInfo *piPtr, int n)
-{
- Blt_ChainLink link;
- int i;
-
- for (i = Blt_Chain_GetLength(piPtr->chain); i <= n; i++) {
- RowColumn *rcPtr;
-
- rcPtr = CreateRowColumn();
- rcPtr->index = i;
- rcPtr->link = Blt_Chain_Append(piPtr->chain, (ClientData)rcPtr);
- }
- link = Blt_Chain_GetNthLink(piPtr->chain, n);
- if (link == NULL) {
- return NULL;
- }
- return Blt_Chain_GetValue(link);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteRowColumn --
- *
- * Deletes a span of rows/columns from the table. The number of
- * rows/columns to be deleted is given by span.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The size of the column partition array may be extended and
- * initialized.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DeleteRowColumn(
- Table *tablePtr,
- PartitionInfo *piPtr,
- RowColumn *rcPtr)
-{
- /*
- * Remove any entries that start in the row/column to be deleted. They
- * point to memory that will be freed.
- */
- if (piPtr->type == rowUid) {
- Blt_ChainLink link, next;
-
- for (link = Blt_Chain_FirstLink(tablePtr->chain); link != NULL;
- link = next) {
- TableEntry *tePtr;
-
- next = Blt_Chain_NextLink(link);
- tePtr = Blt_Chain_GetValue(link);
- if (tePtr->row.rcPtr->index == rcPtr->index) {
- DestroyEntry(tePtr);
- }
- }
- } else {
- Blt_ChainLink link, next;
-
- for (link = Blt_Chain_FirstLink(tablePtr->chain); link != NULL;
- link = next) {
- TableEntry *tePtr;
-
- next = Blt_Chain_NextLink(link);
- tePtr = Blt_Chain_GetValue(link);
- if (tePtr->column.rcPtr->index == rcPtr->index) {
- DestroyEntry(tePtr);
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureRowColumn --
- *
- * This procedure is called to process an objv/objc list in order to
- * configure a row or column in the table geometry manager.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result holds an error message.
- *
- * Side effects:
- * Partition configuration options (bounds, resize flags, etc) get set.
- * New partitions may be created as necessary. The table is recalculated
- * and arranged at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureRowColumn(Table *tablePtr, PartitionInfo *piPtr, const char *pattern,
- int objc, Tcl_Obj *const *objv)
-{
- Blt_ChainLink link;
- int nMatches;
-
- nMatches = 0;
- for (link = Blt_Chain_FirstLink(piPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
- char string[200];
-
- rcPtr = Blt_Chain_GetValue(link);
- sprintf_s(string, 200, "%c%d", pattern[0], rcPtr->index);
- if (Tcl_StringMatch(string, pattern)) {
- if (objc == 0) {
- return Blt_ConfigureInfoFromObj(tablePtr->interp,
- tablePtr->tkwin, piPtr->configSpecs, (char *)rcPtr,
- (Tcl_Obj *)NULL, 0);
- } else if (objc == 1) {
- return Blt_ConfigureInfoFromObj(tablePtr->interp,
- tablePtr->tkwin, piPtr->configSpecs, (char *)rcPtr,
- objv[0], 0);
- } else {
- if (Blt_ConfigureWidgetFromObj(tablePtr->interp,
- tablePtr->tkwin, piPtr->configSpecs, objc, objv,
- (char *)rcPtr, BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- nMatches++;
- }
- }
- if (nMatches == 0) {
- int n;
- RowColumn *rcPtr;
-
- /*
- * We found no existing partitions matching this pattern, so see if
- * this designates an new partition (one beyond the current range).
- */
- if ((Tcl_GetInt(NULL, pattern + 1, &n) != TCL_OK) || (n < 0)) {
- Tcl_AppendResult(tablePtr->interp, "pattern \"", pattern,
- "\" matches no ", piPtr->type, " in table \"",
- Tk_PathName(tablePtr->tkwin), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- rcPtr = GetRowColumn(piPtr, n);
- assert(rcPtr);
- if (Blt_ConfigureWidgetFromObj(tablePtr->interp, tablePtr->tkwin,
- piPtr->configSpecs, objc, objv, (char *)rcPtr,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- EventuallyArrangeTable(tablePtr);
- return TCL_OK;
-}
-
-static void
-PrintRowColumn(
- Tcl_Interp *interp,
- PartitionInfo *piPtr,
- RowColumn *rcPtr,
- Tcl_DString *resultPtr)
-{
- char string[200];
- const char *padFmt, *sizeFmt;
-
- if (piPtr->type == rowUid) {
- padFmt = " -pady {%d %d}";
- sizeFmt = " -height {%s}";
- } else {
- padFmt = " -padx {%d %d}";
- sizeFmt = " -width {%s}";
- }
- if (rcPtr->resize != ROWCOL_DEF_RESIZE) {
- Tcl_DStringAppend(resultPtr, " -resize ", -1);
- Tcl_DStringAppend(resultPtr, Blt_NameOfResize(rcPtr->resize), -1);
- }
- if ((rcPtr->pad.side1 != ROWCOL_DEF_PAD) ||
- (rcPtr->pad.side2 != ROWCOL_DEF_PAD)) {
- sprintf_s(string, 200, padFmt, rcPtr->pad.side1, rcPtr->pad.side2);
- Tcl_DStringAppend(resultPtr, string, -1);
- }
- if (rcPtr->weight != ROWCOL_DEF_WEIGHT) {
- Tcl_DStringAppend(resultPtr, " -weight ", -1);
- Tcl_DStringAppend(resultPtr, Blt_Dtoa(interp, rcPtr->weight), -1);
- }
- if ((rcPtr->reqSize.min != LIMITS_MIN) ||
- (rcPtr->reqSize.nom != LIMITS_NOM) ||
- (rcPtr->reqSize.max != LIMITS_MAX)) {
- sprintf_s(string, 200, sizeFmt, NameOfLimits(&rcPtr->reqSize));
- Tcl_DStringAppend(resultPtr, string, -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InfoRowColumn --
- *
- * Returns the options of a partition in the table.
- *
- * Results:
- * Returns a standard TCL result. A list of the partition
- * attributes is left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InfoRowColumn(Table *tablePtr, Tcl_Interp *interp, const char *pattern)
-{
- PartitionInfo *piPtr;
- char c;
- Blt_ChainLink link, last;
- Tcl_DString dString;
-
- c = pattern[0];
- if ((c == 'r') || (c == 'R')) {
- piPtr = &tablePtr->rows;
- } else {
- piPtr = &tablePtr->cols;
- }
- Tcl_DStringInit(&dString);
- last = Blt_Chain_LastLink(piPtr->chain);
- for (link = Blt_Chain_FirstLink(piPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
- char string[200];
-
- rcPtr = Blt_Chain_GetValue(link);
- sprintf_s(string, 200, "%c%d", piPtr->type[0], rcPtr->index);
- if (Tcl_StringMatch(string, pattern)) {
- Tcl_DStringAppend(&dString, string, -1);
- PrintRowColumn(interp, piPtr, rcPtr, &dString);
- if (link != last) {
- Tcl_DStringAppend(&dString, " \\\n", -1);
- } else {
- Tcl_DStringAppend(&dString, "\n", -1);
- }
- }
- }
- Tcl_DStringResult(interp, &dString);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InitSpan --
- *
- * Checks the size of the column partitions and extends the size if a
- * larger array is needed.
- *
- * Results:
- * Always return a RowColumn pointer.
- *
- * Side effects:
- * The size of the column partition array may be extended and
- * initialized.
- *
- *---------------------------------------------------------------------------
- */
-static RowColumn *
-InitSpan(PartitionInfo *piPtr, int start, int span)
-{
- int length;
- int i;
- Blt_ChainLink link;
-
- length = Blt_Chain_GetLength(piPtr->chain);
- for (i = length; i < (start + span); i++) {
- RowColumn *rcPtr;
-
- rcPtr = CreateRowColumn();
- rcPtr->index = i;
- rcPtr->link = Blt_Chain_Append(piPtr->chain, (ClientData)rcPtr);
- }
- link = Blt_Chain_GetNthLink(piPtr->chain, start);
- return Blt_Chain_GetValue(link);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetTableFromObj --
- *
- * Searches for a table associated by the path name of the widget
- * container.
- *
- * Errors may occur because
- * 1) pathName isn't a valid for any Tk widget, or
- * 2) there's no table associated with that widget as a container.
- *
- * Results:
- * If a table entry exists, a pointer to the Table structure is
- * returned. Otherwise NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-int
-Blt_GetTableFromObj(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- Tcl_Obj *objPtr, /* Path name of the container widget. */
- Table **tablePtrPtr)
-{
- Blt_HashEntry *hPtr;
- Tk_Window tkwin;
- const char *pathName;
-
- pathName = Tcl_GetString(objPtr);
- tkwin = Tk_NameToWindow(interp, pathName, dataPtr->tkMain);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- hPtr = Blt_FindHashEntry(&dataPtr->tableTable, (char *)tkwin);
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "no table associated with widget \"",
- pathName, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- *tablePtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateTable --
- *
- * This procedure creates and initializes a new Table structure with
- * tkwin as its container widget. The internal structures associated with
- * the table are initialized.
- *
- * Results:
- * Returns the pointer to the new Table structure describing the new
- * table geometry manager. If an error occurred, the return value will
- * be NULL and an error message is left in interp->result.
- *
- * Side effects:
- * Memory is allocated and initialized, an event handler is set up to
- * watch tkwin, etc.
- *
- *---------------------------------------------------------------------------
- */
-static Table *
-CreateTable(
- TableInterpData *dataPtr,
- Tcl_Interp *interp, /* Interpreter associated with table. */
- const char *pathName) /* Path name of the container widget to be
- * associated with the new table. */
-{
- Table *tablePtr;
- Tk_Window tkwin;
- int dummy;
- Blt_HashEntry *hPtr;
-
- tkwin = Tk_NameToWindow(interp, pathName, dataPtr->tkMain);
- if (tkwin == NULL) {
- return NULL;
- }
- tablePtr = Blt_AssertCalloc(1, sizeof(Table));
- tablePtr->tkwin = tkwin;
- tablePtr->interp = interp;
- tablePtr->rows.type = rowUid;
- tablePtr->rows.configSpecs = rowConfigSpecs;
- tablePtr->rows.chain = Blt_Chain_Create();
- tablePtr->cols.type = columnUid;
- tablePtr->cols.configSpecs = columnConfigSpecs;
- tablePtr->cols.chain = Blt_Chain_Create();
- tablePtr->propagate = TRUE;
-
- tablePtr->arrangeProc = ArrangeTable;
- Blt_InitHashTable(&tablePtr->entryTable, BLT_ONE_WORD_KEYS);
- tablePtr->findEntryProc = FindEntry;
-
- ResetLimits(&tablePtr->reqWidth);
- ResetLimits(&tablePtr->reqHeight);
-
- tablePtr->chain = Blt_Chain_Create();
- tablePtr->rows.list = Blt_List_Create(BLT_ONE_WORD_KEYS);
- tablePtr->cols.list = Blt_List_Create(BLT_ONE_WORD_KEYS);
-
- Tk_CreateEventHandler(tablePtr->tkwin, StructureNotifyMask,
- TableEventProc, (ClientData)tablePtr);
- hPtr = Blt_CreateHashEntry(&dataPtr->tableTable, (char *)tkwin, &dummy);
- tablePtr->hashPtr = hPtr;
- tablePtr->tablePtr = &dataPtr->tableTable;
- Blt_SetHashValue(hPtr, (ClientData)tablePtr);
- return tablePtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureTable --
- *
- * This procedure is called to process an objv/objc list in order to
- * configure the table geometry manager.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result contains an error message.
- *
- * Side effects:
- * Table configuration options (-padx, -pady, etc.) get set. The table
- * is recalculated and arranged at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureTable(
- Table *tablePtr, /* Table to be configured */
- Tcl_Interp *interp, /* Interpreter to report results back to */
- int objc,
- Tcl_Obj *const *objv) /* Option-value pairs */
-{
- if (objc == 0) {
- return Blt_ConfigureInfoFromObj(interp, tablePtr->tkwin,
- tableConfigSpecs, (char *)tablePtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 1) {
- return Blt_ConfigureInfoFromObj(interp, tablePtr->tkwin,
- tableConfigSpecs, (char *)tablePtr, objv[0], 0);
- }
- if (Blt_ConfigureWidgetFromObj(interp, tablePtr->tkwin, tableConfigSpecs,
- objc, objv, (char *)tablePtr, BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Arrange for the table layout to be computed at the next idle point. */
- tablePtr->flags |= REQUEST_LAYOUT;
- EventuallyArrangeTable(tablePtr);
- return TCL_OK;
-}
-
-static void
-PrintTable(
- Table *tablePtr,
- Tcl_DString *resultPtr)
-{
- char string[200];
-
- if ((tablePtr->padLeft != TABLE_DEF_PAD) ||
- (tablePtr->padRight != TABLE_DEF_PAD)) {
- sprintf_s(string, 200, " -padx {%d %d}", tablePtr->padLeft,
- tablePtr->padRight);
- Tcl_DStringAppend(resultPtr, string, -1);
- }
- if ((tablePtr->padTop != TABLE_DEF_PAD) ||
- (tablePtr->padBottom != TABLE_DEF_PAD)) {
- sprintf_s(string, 200, " -pady {%d %d}", tablePtr->padTop,
- tablePtr->padBottom);
- Tcl_DStringAppend(resultPtr, string, -1);
- }
- if (!tablePtr->propagate) {
- Tcl_DStringAppend(resultPtr, " -propagate no", -1);
- }
- if ((tablePtr->reqWidth.min != LIMITS_MIN) ||
- (tablePtr->reqWidth.nom != LIMITS_NOM) ||
- (tablePtr->reqWidth.max != LIMITS_MAX)) {
- Tcl_DStringAppend(resultPtr, " -reqwidth {%s}", -1);
- Tcl_DStringAppend(resultPtr, NameOfLimits(&tablePtr->reqWidth), -1);
- }
- if ((tablePtr->reqHeight.min != LIMITS_MIN) ||
- (tablePtr->reqHeight.nom != LIMITS_NOM) ||
- (tablePtr->reqHeight.max != LIMITS_MAX)) {
- Tcl_DStringAppend(resultPtr, " -reqheight {%s}", -1);
- Tcl_DStringAppend(resultPtr, NameOfLimits(&tablePtr->reqHeight), -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyPartitions --
- *
- * Clear each of the lists managing the entries. The entries in the
- * lists of row and column spans are themselves lists which need to be
- * cleared.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyPartitions(PartitionInfo *piPtr)
-{
- if (piPtr->list != NULL) {
- Blt_ListNode node;
-
- for (node = Blt_List_FirstNode(piPtr->list); node != NULL;
- node = Blt_List_NextNode(node)) {
- Blt_Chain chain;
-
- chain = Blt_List_GetValue(node);
- if (chain != NULL) {
- Blt_Chain_Destroy(chain);
- }
- }
- Blt_List_Destroy(piPtr->list);
- }
- if (piPtr->chain != NULL) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(piPtr->chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- Blt_Free(rcPtr);
- }
- Blt_Chain_Destroy(piPtr->chain);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyTable --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the Table structure at a safe time (when no-one is using it
- * anymore).
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the table geometry manager is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyTable(DestroyData dataPtr) /* Table structure */
-{
- Blt_ChainLink link;
- Table *tablePtr = (Table *)dataPtr;
-
- /* Release the chain of entries. */
- for (link = Blt_Chain_FirstLink(tablePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TableEntry *tePtr;
-
- tePtr = Blt_Chain_GetValue(link);
- tePtr->link = NULL; /* Don't disrupt this chain of entries */
- DestroyEntry(tePtr);
- }
- Blt_Chain_Destroy(tablePtr->chain);
-
- DestroyPartitions(&tablePtr->rows);
- DestroyPartitions(&tablePtr->cols);
- Blt_DeleteHashTable(&tablePtr->entryTable);
- if (tablePtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(tablePtr->tablePtr, tablePtr->hashPtr);
- }
- Blt_Free(tablePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BinEntry --
- *
- * Adds the entry to the lists of both row and column spans. The layout
- * of the table is done in order of partition spans, from shorted to
- * longest. The widgets spanning a particular number of partitions are
- * stored in a linked list. Each list is in turn, contained within a
- * master list.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The entry is added to both the lists of row and columns spans. This
- * will effect the layout of the widgets.
- *
- *---------------------------------------------------------------------------
- */
-static void
-BinEntry(Table *tablePtr, TableEntry *tePtr)
-{
- Blt_ListNode node;
- Blt_List list;
- Blt_Chain chain;
- long key;
-
- /*
- * Remove the entry from both row and column lists. It will be
- * re-inserted into the table at the new position.
- */
- if (tePtr->column.link != NULL) {
- Blt_Chain_UnlinkLink(tePtr->column.chain,
- tePtr->column.link);
- }
- if (tePtr->row.link != NULL) {
- Blt_Chain_UnlinkLink(tePtr->row.chain, tePtr->row.link);
- }
- list = tablePtr->rows.list;
- key = 0; /* Initialize key to bogus span */
- for (node = Blt_List_FirstNode(list); node != NULL;
- node = Blt_List_NextNode(node)) {
-
- key = (long)Blt_List_GetKey(node);
- if (tePtr->row.span <= key) {
- break;
- }
- }
- if (key != tePtr->row.span) {
- Blt_ListNode newNode;
-
- /*
- * Create a new list (bucket) to hold entries of that size span and
- * and link it into the list of buckets.
- */
- newNode = Blt_List_CreateNode(list, (char *)tePtr->row.span);
- Blt_List_SetValue(newNode, (char *)Blt_Chain_Create());
- Blt_List_LinkBefore(list, newNode, node);
- node = newNode;
- }
- chain = Blt_List_GetValue(node);
- if (tePtr->row.link == NULL) {
- tePtr->row.link = Blt_Chain_Append(chain, tePtr);
- } else {
- Blt_Chain_LinkAfter(chain, tePtr->row.link, NULL);
- }
- tePtr->row.chain = chain;
-
- list = tablePtr->cols.list;
- key = 0;
- for (node = Blt_List_FirstNode(list); node != NULL;
- node = Blt_List_NextNode(node)) {
- key = (long)Blt_List_GetKey(node);
- if (tePtr->column.span <= key) {
- break;
- }
- }
- if (key != tePtr->column.span) {
- Blt_ListNode newNode;
-
- /*
- * Create a new list (bucket) to hold entries of that size span and
- * and link it into the list of buckets.
- */
- newNode = Blt_List_CreateNode(list, (char *)tePtr->column.span);
- Blt_List_SetValue(newNode, (char *)Blt_Chain_Create());
- Blt_List_LinkBefore(list, newNode, node);
- node = newNode;
- }
- chain = Blt_List_GetValue(node);
-
- /* Add the new entry to the span bucket */
- if (tePtr->column.link == NULL) {
- tePtr->column.link = Blt_Chain_Append(chain, tePtr);
- } else {
- Blt_Chain_LinkAfter(chain, tePtr->column.link, NULL);
- }
- tePtr->column.chain = chain;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ParseIndex --
- *
- * Parse the entry index string and return the row and column numbers in
- * their respective parameters. The format of a table entry index is
- * row,column where row is the row number and column is the column
- * number. Rows and columns are numbered starting from zero.
- *
- * Results:
- * Returns a standard TCL result. If TCL_OK is returned, the row and
- * column numbers are returned via rowPtr and columnPtr respectively.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ParseIndex(Tcl_Interp *interp, const char *string, int *rowPtr, int *columnPtr)
-{
- char *comma;
- long row, column;
- int result;
-
- comma = (char *)strchr(string, ',');
- if (comma == NULL) {
- Tcl_AppendResult(interp, "bad index \"", string,
- "\": should be \"row,column\"", (char *)NULL);
- return TCL_ERROR;
-
- }
- *comma = '\0';
- result = ((Tcl_ExprLong(interp, string, &row) != TCL_OK) ||
- (Tcl_ExprLong(interp, comma + 1, &column) != TCL_OK));
- *comma = ','; /* Repair the argument */
- if (result) {
- return TCL_ERROR;
- }
- if ((row < 0) || (row > (long)USHRT_MAX)) {
- Tcl_AppendResult(interp, "bad index \"", string,
- "\": row is out of range", (char *)NULL);
- return TCL_ERROR;
-
- }
- if ((column < 0) || (column > (long)USHRT_MAX)) {
- Tcl_AppendResult(interp, "bad index \"", string,
- "\": column is out of range", (char *)NULL);
- return TCL_ERROR;
- }
- *rowPtr = (int)row;
- *columnPtr = (int)column;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ManageEntry --
- *
- * Inserts the given widget into the table at a given row and column
- * position. The widget can already be managed by this or another table.
- * The widget will be simply moved to the new location in this table.
- *
- * The new widget is inserted into both a hash table (this is used to
- * locate the information associated with the widget) and a list (used to
- * indicate relative ordering of widgets).
- *
- * Results:
- * Returns a standard TCL result. If an error occurred, TCL_ERROR is
- * returned and an error message is left in interp->result.
- *
- * Side Effects:
- * The table is re-computed and arranged at the next idle point.
- *
- * ---------------------------------------------------------------------------- */
-static int
-ManageEntry(
- Tcl_Interp *interp,
- Table *tablePtr,
- Tk_Window tkwin,
- int row, int column,
- int objc,
- Tcl_Obj *const *objv)
-{
- TableEntry *tePtr;
- int result = TCL_OK;
-
- tePtr = FindEntry(tablePtr, tkwin);
- if ((tePtr != NULL) && (tePtr->tablePtr != tablePtr)) {
- /* The entry for the widget already exists. If it's managed by another
- * table, delete it. */
- DestroyEntry(tePtr);
- tePtr = NULL;
- }
- if (tePtr == NULL) {
- tePtr = CreateEntry(tablePtr, tkwin);
- if (tePtr == NULL) {
- return TCL_ERROR;
- }
- }
- if (objc > 0) {
- result = Blt_ConfigureWidgetFromObj(tablePtr->interp, tePtr->tkwin,
- entryConfigSpecs, objc, objv, (char *)tePtr,
- BLT_CONFIG_OBJV_ONLY);
- }
- if ((tePtr->column.span < 1) || (tePtr->row.span < 1)) {
- Tcl_AppendResult(tablePtr->interp, "bad span specified for \"",
- Tk_PathName(tkwin), "\"", (char *)NULL);
- DestroyEntry(tePtr);
- return TCL_ERROR;
- }
- tePtr->column.rcPtr = InitSpan(&tablePtr->cols, column, tePtr->column.span);
- tePtr->row.rcPtr = InitSpan(&tablePtr->rows, row, tePtr->row.span);
- /* Insert the entry into both the row and column layout lists */
- BinEntry(tablePtr, tePtr);
-
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BuildTable --
- *
- * Processes an objv/objc list of table entries to add and configure new
- * widgets into the table. A table entry consists of the widget path
- * name, table index, and optional configuration options. The first
- * argument in the objv list is the name of the table. If no table
- * exists for the given widget, a new one is created.
- *
- * Results:
- * Returns a standard TCL result. If an error occurred,
- * TCL_ERROR is returned and an error message is left in
- * interp->result.
- *
- * Side Effects:
- * Memory is allocated, a new table is possibly created, etc.
- * The table is re-computed and arranged at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
-static int
-BuildTable(
- Table *tablePtr, /* Table to manage new widgets */
- Tcl_Interp *interp, /* Interpreter to report errors back to */
- int objc, /* */
- Tcl_Obj *const *objv) /* List of widgets, indices, and options */
-{
- Tk_Window tkwin;
- int row, column;
- int nextRow, nextColumn;
- int i;
-
- /* Process any options specific to the table */
- for (i = 2; i < objc; i += 2) {
- const char *string;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] != '-') {
- break;
- }
- }
- if (i > objc) {
- i = objc;
- }
- if (i > 2) {
- if (ConfigureTable(tablePtr, interp, i - 2, objv + 2) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- nextRow = tablePtr->nRows;
- nextColumn = 0;
- objc -= i, objv += i;
- while (objc > 0) {
- const char *string;
- /*
- * Allow the name of the widget and row/column index to be specified
- * in any order.
- */
- string = Tcl_GetString(objv[0]);
- if (string[0] == '.') {
- tkwin = Tk_NameToWindow(interp, string, tablePtr->tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (objc == 1) {
- /* No row,column index, use defaults instead */
- row = nextRow, column = nextColumn;
- objc--, objv++;
- } else {
- string = Tcl_GetString(objv[1]);
- if (string[0] == '-') {
- /* No row,column index, use defaults instead */
- row = nextRow, column = nextColumn;
- objc--, objv++;
- } else {
- if (ParseIndex(interp, string, &row, &column) != TCL_OK) {
- return TCL_ERROR; /* Invalid row,column index */
- }
- /* Skip over the widget pathname and table index. */
- objc -= 2, objv += 2;
- }
- }
- } else {
- if (ParseIndex(interp, Tcl_GetString(objv[0]), &row, &column)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 1) {
- Tcl_AppendResult(interp, "missing widget pathname after \"",
- Tcl_GetString(objv[0]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[1]),
- tablePtr->tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- /* Skip over the widget pathname and table index. */
- objc -= 2, objv += 2;
- }
-
- /* Find the end of the widget's option-value pairs */
- for (i = 0; i < objc; i += 2) {
- string = Tcl_GetString(objv[i]);
- if (string[0] != '-') {
- break;
- }
- }
- if (i > objc) {
- i = objc;
- }
- if (ManageEntry(interp, tablePtr, tkwin, row,
- column, i, objv) != TCL_OK) {
- return TCL_ERROR;
- }
- nextColumn = column + 1;
- objc -= i, objv += i;
- }
- /* Arrange for the new table layout to be calculated. */
- tablePtr->flags |= REQUEST_LAYOUT;
- EventuallyArrangeTable(tablePtr);
-
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(tablePtr->tkwin),-1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ParseItem --
- *
- * Parses a string representing an item in the table. An item may be one
- * of the following:
- * Rn - Row index, where n is the index of row
- * Cn - Column index, where n is the index of column
- * r,c - Cell index, where r is the row index and c
- * is the column index.
- *
- * Results:
- * Returns a standard TCL result. If no error occurred, TCL_OK is
- * returned. *RowPtr* will return the row index. *ColumnPtr* will
- * return the column index. If the row or column index is not
- * applicable, -1 is returned via *rowPtr* or *columnPtr*.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ParseItem(Table *tablePtr, const char *string, int *rowPtr, int *columnPtr)
-{
- char c;
- long partNum;
-
- c = tolower(string[0]);
- *rowPtr = *columnPtr = -1;
- if (c == 'r') {
- if (Tcl_ExprLong(tablePtr->interp, string + 1, &partNum) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((partNum < 0) || (partNum >= tablePtr->nRows)) {
- Tcl_AppendResult(tablePtr->interp, "row index \"", string,
- "\" is out of range", (char *)NULL);
- return TCL_ERROR;
- }
- *rowPtr = (int)partNum;
- } else if (c == 'c') {
- if (Tcl_ExprLong(tablePtr->interp, string + 1, &partNum) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((partNum < 0) || (partNum >= tablePtr->nColumns)) {
- Tcl_AppendResult(tablePtr->interp, "column index \"", string,
- "\" is out of range", (char *)NULL);
- return TCL_ERROR;
- }
- *columnPtr = (int)partNum;
- } else {
- if (ParseIndex(tablePtr->interp, string,
- rowPtr, columnPtr) != TCL_OK) {
- return TCL_ERROR; /* Invalid row,column index */
- }
- if ((*rowPtr < 0) || (*rowPtr >= tablePtr->nRows) ||
- (*columnPtr < 0) || (*columnPtr >= tablePtr->nColumns)) {
- Tcl_AppendResult(tablePtr->interp, "index \"", string,
- "\" is out of range", (char *)NULL);
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TranslateAnchor --
- *
- * Translate the coordinates of a given bounding box based upon the
- * anchor specified. The anchor indicates where the given xy position is
- * in relation to the bounding box.
- *
- * nw --- n --- ne
- * | | x,y ---+
- * w center e | |
- * | | +-----+
- * sw --- s --- se
- *
- * Results:
- * The translated coordinates of the bounding box are returned.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TranslateAnchor(
- int dx, int dy, /* Difference between outer and inner
- * regions */
- Tk_Anchor anchor, /* Direction of the anchor */
- int *xPtr, int *yPtr)
-{
- int x, y;
-
- x = y = 0;
- switch (anchor) {
- case TK_ANCHOR_NW: /* Upper left corner */
- break;
- case TK_ANCHOR_W: /* Left center */
- y = (dy / 2);
- break;
- case TK_ANCHOR_SW: /* Lower left corner */
- y = dy;
- break;
- case TK_ANCHOR_N: /* Top center */
- x = (dx / 2);
- break;
- case TK_ANCHOR_CENTER: /* Centered */
- x = (dx / 2);
- y = (dy / 2);
- break;
- case TK_ANCHOR_S: /* Bottom center */
- x = (dx / 2);
- y = dy;
- break;
- case TK_ANCHOR_NE: /* Upper right corner */
- x = dx;
- break;
- case TK_ANCHOR_E: /* Right center */
- x = dx;
- y = (dy / 2);
- break;
- case TK_ANCHOR_SE: /* Lower right corner */
- x = dx;
- y = dy;
- break;
- }
- *xPtr = (*xPtr) + x;
- *yPtr = (*yPtr) + y;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetReqWidth --
- *
- * Returns the width requested by the widget starting in the given entry.
- * The requested space also includes any internal padding which has been
- * designated for this widget.
- *
- * The requested width of the widget is always bounded by the limits set
- * in tePtr->reqWidth.
- *
- * Results:
- * Returns the requested width of the widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetReqWidth(TableEntry *tePtr)
-{
- int width;
-
- width = Tk_ReqWidth(tePtr->tkwin) + (2 * tePtr->ixPad);
- width = GetBoundedWidth(width, &tePtr->reqWidth);
- return width;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetReqHeight --
- *
- * Returns the height requested by the widget starting in the given
- * entry. The requested space also includes any internal padding which
- * has been designated for this widget.
- *
- * The requested height of the widget is always bounded by the limits set
- * in tePtr->reqHeight.
- *
- * Results:
- * Returns the requested height of the widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetReqHeight(TableEntry *tePtr)
-{
- int height;
-
- height = Tk_ReqHeight(tePtr->tkwin) + (2 * tePtr->iyPad);
- height = GetBoundedHeight(height, &tePtr->reqHeight);
- return height;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTotalSpan --
- *
- * Sums the row/column space requirements for the entire table.
- *
- * Results:
- * Returns the space currently used in the span of partitions.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetTotalSpan(PartitionInfo *piPtr)
-{
- int spaceUsed;
- Blt_ChainLink link;
-
- spaceUsed = 0;
- for (link = Blt_Chain_FirstLink(piPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr; /* Start of partitions */
-
- rcPtr = Blt_Chain_GetValue(link);
- spaceUsed += rcPtr->size;
- }
- return spaceUsed;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetSpan --
- *
- * Determines the space used by rows/columns for an entry.
- *
- * Results:
- * Returns the space currently used in the span of partitions.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetSpan(PartitionInfo *piPtr, TableEntry *tePtr)
-{
- RowColumn *startPtr;
- int spaceUsed;
- int count;
- Blt_ChainLink link;
- RowColumn *rcPtr; /* Start of partitions */
- int span; /* Number of partitions spanned */
-
- if (piPtr->type == rowUid) {
- rcPtr = tePtr->row.rcPtr;
- span = tePtr->row.span;
- } else {
- rcPtr = tePtr->column.rcPtr;
- span = tePtr->column.span;
- }
-
- count = spaceUsed = 0;
- link = rcPtr->link;
- startPtr = Blt_Chain_GetValue(link);
- for ( /*empty*/ ; (link != NULL) && (count < span);
- link = Blt_Chain_NextLink(link)) {
- rcPtr = Blt_Chain_GetValue(link);
- spaceUsed += rcPtr->size;
- count++;
- }
- /*
- * Subtract off the padding on either side of the span, since the
- * widget can't grow into it.
- */
- rcPtr->pad.side2 = 0;
- spaceUsed -= (startPtr->pad.side1 + rcPtr->pad.side2 + piPtr->ePad);
-#ifdef notdef
- if (strcmp(Tk_Name(tePtr->tkwin), "ss") == 0) {
- fprintf(stderr, "index=%d spaceUsed=%d\n", rcPtr->index, spaceUsed);
- }
-#endif
- return spaceUsed;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GrowSpan --
- *
- * Expand the span by the amount of the extra space needed. This
- * procedure is used in LayoutPartitions to grow the partitions to their
- * minimum nominal size, starting from a zero width and height space.
- *
- * This looks more complicated than it really is. The idea is to make
- * the size of the partitions correspond to the smallest entry spans.
- * For example, if widget A is in column 1 and widget B spans both
- * columns 0 and 1, any extra space needed to fit widget B should come
- * from column 0.
- *
- * On the first pass we try to add space to partitions which have not
- * been touched yet (i.e. have no nominal size). Since the row and
- * column lists are sorted in ascending order of the number of rows or
- * columns spanned, the space is distributed amongst the smallest spans
- * first.
- *
- * The second pass handles the case of widgets which have the same span.
- * For example, if A and B, which span the same number of partitions are
- * the only widgets to span column 1, column 1 would grow to contain the
- * bigger of the two slices of space.
- *
- * If there is still extra space after the first two passes, this means
- * that there were no partitions of with no widget spans or the same
- * order span that could be expanded. The third pass will try to remedy
- * this by parcelling out the left over space evenly among the rest of
- * the partitions.
- *
- * On each pass, we have to keep iterating over the span, evenly doling
- * out slices of extra space, because we may hit partition limits as
- * space is donated. In addition, if there are left over pixels because
- * of round-off, this will distribute them as evenly as possible. For
- * the worst case, it will take *span* passes to expand the span.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The partitions in the span may be expanded.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GrowSpan(
- Table *tablePtr,
- PartitionInfo *piPtr,
- TableEntry *tePtr,
- int growth) /* The amount of extra space needed to grow
- * the span. */
-{
- Blt_ChainLink link;
- int nOpen; /* # of partitions with space available */
- int n;
- RowColumn *startPtr; /* Starting (column/row) partition */
- int span; /* Number of partitions in the span */
-
-#ifdef notdef
- if (strcmp(Tk_Name(tablePtr->tkwin), "fs") == 0) {
- fprintf(stderr, "GrowSpan %s %s growth=%d\n",
- Tk_Name(tablePtr->tkwin), Tk_Name(tePtr->tkwin), growth);
- }
-#endif
- if (piPtr->type == rowUid) {
- startPtr = tePtr->row.rcPtr;
- span = tePtr->row.span;
- } else {
- startPtr = tePtr->column.rcPtr;
- span = tePtr->column.span;
- }
-
- /*
- * Pass 1: First add space to rows/columns that haven't determined
- * their nominal sizes yet.
- */
-
- nOpen = 0;
- /* Find out how many partitions have no size yet */
-
- for (n = 0, link = startPtr->link; (link != NULL) && (n < span);
- n++, link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- if ((rcPtr->nom == LIMITS_NOM) && (rcPtr->max > rcPtr->size)) {
- nOpen++;
- }
- }
-
- while ((nOpen > 0) && (growth > 0)) {
- int ration;
-
- ration = growth / nOpen;
- if (ration == 0) {
- ration = 1;
- }
- link = startPtr->link;
- for (n = 0; (n < span) && (growth > 0); n++) {
- RowColumn *rcPtr;
- int avail;
-
- rcPtr = Blt_Chain_GetValue(link);
- avail = rcPtr->max - rcPtr->size;
- if ((rcPtr->nom == LIMITS_NOM) && (avail > 0)) {
- if (ration < avail) {
- growth -= ration;
- rcPtr->size += ration;
- } else {
- growth -= avail;
- rcPtr->size += avail;
- nOpen--;
- }
- rcPtr->minSpan = span;
- rcPtr->control = tePtr;
- }
-#ifdef notdef
- if (strcmp(Tk_Name(tablePtr->tkwin), "fs") == 0) {
- fprintf(stderr, "GrowSpan pass1 %s %s size=%d\n",
- Tk_Name(tablePtr->tkwin), Tk_Name(tePtr->tkwin), rcPtr->size);
- }
-#endif
- link = Blt_Chain_NextLink(link);
- }
- }
-
- /*
- * Pass 2: Add space to partitions which have the same minimum span
- */
-
- nOpen = 0;
- link = startPtr->link;
- for (n = 0; n < span; n++) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- if ((rcPtr->minSpan == span) && (rcPtr->max > rcPtr->size)) {
- nOpen++;
- }
- link = Blt_Chain_NextLink(link);
- }
- while ((nOpen > 0) && (growth > 0)) {
- int ration;
-
- ration = growth / nOpen;
- if (ration == 0) {
- ration = 1;
- }
- link = startPtr->link;
- for (n = 0; (n < span) && (growth > 0); n++) {
- RowColumn *rcPtr;
- int avail;
-
- rcPtr = Blt_Chain_GetValue(link);
- avail = rcPtr->max - rcPtr->size;
- if ((rcPtr->minSpan == span) && (avail > 0)) {
- if (ration < avail) {
- growth -= ration;
- rcPtr->size += ration;
- } else {
- growth -= avail;
- rcPtr->size += avail;
- nOpen--;
- }
- rcPtr->control = tePtr;
- }
-#ifdef notdef
- if (strcmp(Tk_Name(tablePtr->tkwin), "fs") == 0) {
- fprintf(stderr, "GrowSpan pass2 %s %s size=%d\n",
- Tk_Name(tablePtr->tkwin), Tk_Name(tePtr->tkwin), rcPtr->size);
- }
-#endif
- link = Blt_Chain_NextLink(link);
- }
- }
-
- /*
- * Pass 3: Try to expand all the partitions with space still available
- */
-
- /* Find out how many partitions still have space available */
- nOpen = 0;
- link = startPtr->link;
- for (n = 0; n < span; n++) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- if ((rcPtr->resize & RESIZE_EXPAND) && (rcPtr->max > rcPtr->size)) {
- nOpen++;
- }
- /* Set the nominal size of the row/column. */
- rcPtr->nom = rcPtr->size;
- link = Blt_Chain_NextLink(link);
- }
- while ((nOpen > 0) && (growth > 0)) {
- int ration;
-
- ration = growth / nOpen;
- if (ration == 0) {
- ration = 1;
- }
- link = startPtr->link;
- for (n = 0; (n < span) && (growth > 0); n++) {
- RowColumn *rcPtr;
- int avail;
-
- rcPtr = Blt_Chain_GetValue(link);
- link = Blt_Chain_NextLink(link);
- if (!(rcPtr->resize & RESIZE_EXPAND)) {
- continue;
- }
- avail = rcPtr->max - rcPtr->size;
- if (avail > 0) {
- if (ration < avail) {
- growth -= ration;
- rcPtr->size += ration;
- } else {
- growth -= avail;
- rcPtr->size += avail;
- nOpen--;
- }
- rcPtr->nom = rcPtr->size;
- rcPtr->control = tePtr;
- }
-#ifdef notdef
- if (strcmp(Tk_Name(tablePtr->tkwin), "fs") == 0) {
- fprintf(stderr, "GrowSpan pass3 %s %s size=%d\n",
- Tk_Name(tablePtr->tkwin), Tk_Name(tePtr->tkwin), rcPtr->size);
- }
-#endif
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GrowPartitions --
- *
- * Grow the span by the designated amount. Size constraints on the
- * partitions may prevent any or all of the spacing adjustments.
- *
- * This is very much like the GrowSpan procedure, but in this case we are
- * expanding all the (row or column) partitions. It uses a two pass
- * approach, first giving space to partitions which are smaller than
- * their nominal sizes. This is because constraints on the partitions may
- * cause resizing to be non-linear.
- *
- * If there is still extra space, this means that all partitions are at
- * least to their nominal sizes. The second pass will try to add the
- * left over space evenly among all the partitions which still have space
- * available (i.e. haven't reached their specified max sizes).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of the partitions may be increased.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GrowPartitions(
- PartitionInfo *piPtr, /* Array of (column/row) partitions */
- int adjustment) /* The amount of extra space to grow the
- * span. If negative, it represents the amount
- * of space to add. */
-{
- int delta; /* Amount of space needed */
- int nAdjust; /* Number of rows/columns that still can be
- * adjusted. */
- Blt_Chain chain;
- Blt_ChainLink link;
- float totalWeight;
-
- chain = piPtr->chain;
-
- /*
- * Pass 1: First adjust the size of rows/columns that still haven't
- * reached their nominal size.
- */
- delta = adjustment;
-
- nAdjust = 0;
- totalWeight = 0.0;
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- if ((rcPtr->weight > 0.0) && (rcPtr->nom > rcPtr->size)) {
- nAdjust++;
- totalWeight += rcPtr->weight;
- }
- }
-
- while ((nAdjust > 0) && (totalWeight > 0.0) && (delta > 0)) {
- Blt_ChainLink link;
- int ration; /* Amount of space to add to each
- * row/column. */
- ration = (int)(delta / totalWeight);
- if (ration == 0) {
- ration = 1;
- }
- for (link = Blt_Chain_FirstLink(chain); (link != NULL) && (delta > 0);
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- if (rcPtr->weight > 0.0) {
- int avail; /* Amount of space still available. */
-
- avail = rcPtr->nom - rcPtr->size;
- if (avail > 0) {
- int size; /* Amount of space requested for a particular
- * row/column. */
- size = (int)(ration * rcPtr->weight);
- if (size > delta) {
- size = delta;
- }
- if (size < avail) {
- delta -= size;
- rcPtr->size += size;
- } else {
- delta -= avail;
- rcPtr->size += avail;
- nAdjust--;
- totalWeight -= rcPtr->weight;
- }
- }
- }
- }
- }
-
- /*
- * Pass 2: Adjust the partitions with space still available
- */
- nAdjust = 0;
- totalWeight = 0.0;
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- if ((rcPtr->weight > 0.0) && (rcPtr->max > rcPtr->size)) {
- nAdjust++;
- totalWeight += rcPtr->weight;
- }
- }
- while ((nAdjust > 0) && (totalWeight > 0.0) && (delta > 0)) {
- Blt_ChainLink link;
- int ration; /* Amount of space to add to each
- * row/column. */
-
- ration = (int)(delta / totalWeight);
- if (ration == 0) {
- ration = 1;
- }
- for (link = Blt_Chain_FirstLink(chain); (link != NULL) && (delta > 0);
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- if (rcPtr->weight > 0.0) {
- int avail; /* Amount of space still available */
-
- avail = (rcPtr->max - rcPtr->size);
- if (avail > 0) {
- int size; /* Amount of space requested for a particular
- * row/column. */
- size = (int)(ration * rcPtr->weight);
- if (size > delta) {
- size = delta;
- }
- if (size < avail) {
- delta -= size;
- rcPtr->size += size;
- } else {
- delta -= avail;
- rcPtr->size += avail;
- nAdjust--;
- totalWeight -= rcPtr->weight;
- }
- }
- }
- }
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShrinkPartitions --
- *
- * Shrink the span by the amount specified. Size constraints on the
- * partitions may prevent any or all of the spacing adjustments.
- *
- * This is very much like the GrowSpan procedure, but in this case we are
- * shrinking or expanding all the (row or column) partitions. It uses a
- * two pass approach, first subtracting space to partitions which are
- * larger than their nominal sizes. This is because constraints on the
- * partitions may cause resizing to be non-linear.
- *
- * After pass 1, if there is still extra to be removed, this means that
- * all partitions are at least to their nominal sizes. The second pass
- * will try to remove the extra space evenly among all the partitions
- * which still have space available (i.e haven't reached their respective
- * min sizes).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of the partitions may be decreased.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ShrinkPartitions(
- PartitionInfo *piPtr, /* Array of (column/row) partitions */
- int adjustment) /* The amount of extra space to shrink the
- * span. It represents the amount of space to
- * remove. */
-{
- Blt_ChainLink link;
- int extra; /* Amount of space needed */
- int nAdjust; /* Number of rows/columns that still can be
- * adjusted. */
- Blt_Chain chain;
- float totalWeight;
-
- chain = piPtr->chain;
-
- /*
- * Pass 1: First adjust the size of rows/columns that still aren't
- * at their nominal size.
- */
- extra = -adjustment;
-
- nAdjust = 0;
- totalWeight = 0.0;
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- if ((rcPtr->weight > 0.0) && (rcPtr->nom < rcPtr->size)) {
- nAdjust++;
- totalWeight += rcPtr->weight;
- }
- }
-
- while ((nAdjust > 0) && (totalWeight > 0.0) && (extra > 0)) {
- Blt_ChainLink link;
- int ration; /* Amount of space to subtract from each
- * row/column. */
- ration = (int)(extra / totalWeight);
- if (ration == 0) {
- ration = 1;
- }
- for (link = Blt_Chain_FirstLink(chain); (link != NULL) && (extra > 0);
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- if (rcPtr->weight > 0.0) {
- int avail; /* Amount of space still available */
-
- avail = rcPtr->size - rcPtr->nom;
- if (avail > 0) {
- int slice; /* Amount of space requested for a particular
- * row/column. */
- slice = (int)(ration * rcPtr->weight);
- if (slice > extra) {
- slice = extra;
- }
- if (avail > slice) {
- extra -= slice;
- rcPtr->size -= slice;
- } else {
- extra -= avail;
- rcPtr->size -= avail;
- nAdjust--; /* Goes to zero (nominal). */
- totalWeight -= rcPtr->weight;
- }
- }
- }
- }
- }
- /*
- * Pass 2: Now adjust the partitions with space still available (i.e.
- * are bigger than their minimum size).
- */
- nAdjust = 0;
- totalWeight = 0.0;
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- if ((rcPtr->weight > 0.0) && (rcPtr->size > rcPtr->min)) {
- nAdjust++;
- totalWeight += rcPtr->weight;
- }
- }
- while ((nAdjust > 0) && (totalWeight > 0.0) && (extra > 0)) {
- Blt_ChainLink link;
- int ration; /* Amount of space to subtract from each
- * row/column. */
- ration = (int)(extra / totalWeight);
- if (ration == 0) {
- ration = 1;
- }
- for (link = Blt_Chain_FirstLink(chain); (link != NULL) && (extra > 0);
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- if (rcPtr->weight > 0.0) {
- int avail; /* Amount of space still available */
-
- avail = rcPtr->size - rcPtr->min;
- if (avail > 0) {
- int slice; /* Amount of space requested for a particular
- * row/column. */
- slice = (int)(ration * rcPtr->weight);
- if (slice > extra) {
- slice = extra;
- }
- if (avail > slice) {
- extra -= slice;
- rcPtr->size -= slice;
- } else {
- extra -= avail;
- rcPtr->size -= avail;
- nAdjust--;
- totalWeight -= rcPtr->weight;
- }
- }
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResetPartitions --
- *
- * Sets/resets the size of each row and column partition to the minimum
- * limit of the partition (this is usually zero). This routine gets
- * called when new widgets are added, deleted, or resized.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of each partition is re-initialized to its minimum size.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ResetPartitions(Table *tablePtr, PartitionInfo *piPtr, LimitsProc *limitsProc)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(piPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
- int pad, size;
-
- rcPtr = Blt_Chain_GetValue(link);
-
- /*
- * The constraint procedure below also has the desired side-effect of
- * setting the minimum, maximum, and nominal values to the requested
- * size of its associated widget (if one exists).
- */
- size = (*limitsProc)(0, &rcPtr->reqSize);
-
- pad = PADDING(rcPtr->pad) + piPtr->ePad;
- if (rcPtr->reqSize.flags & LIMITS_SET_NOM) {
-
- /*
- * This could be done more cleanly. We want to ensure that the
- * requested nominal size is not overridden when determining the
- * normal sizes. So temporarily fix min and max to the nominal
- * size and reset them back later.
- */
- rcPtr->min = rcPtr->max = rcPtr->size = rcPtr->nom =
- size + pad;
-
- } else {
- /* The range defaults to 0..MAXINT */
- rcPtr->min = rcPtr->reqSize.min + pad;
- rcPtr->max = rcPtr->reqSize.max + pad;
- rcPtr->nom = LIMITS_NOM;
- rcPtr->size = pad;
- }
- rcPtr->minSpan = 0;
- rcPtr->control = NULL;
- rcPtr->count = 0;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetNominalSizes
- *
- * Sets the normal sizes for each partition. The partition size is the
- * requested widget size plus an amount of padding. In addition, adjust
- * the min/max bounds of the partition depending upon the resize flags
- * (whether the partition can be expanded or shrunk from its normal
- * size).
- *
- * Results:
- * Returns the total space needed for the all the partitions.
- *
- * Side Effects:
- * The nominal size of each partition is set. This is later used to
- * determine how to shrink or grow the table if the container can't be
- * resized to accommodate the exact size requirements of all the
- * partitions.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SetNominalSizes(Table *tablePtr, PartitionInfo *piPtr)
-{
- Blt_ChainLink link;
- int total;
-
- total = 0;
- for (link = Blt_Chain_FirstLink(piPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
- int pad, size;
-
- rcPtr = Blt_Chain_GetValue(link);
- pad = PADDING(rcPtr->pad) + piPtr->ePad;
-
- /*
- * Restore the real bounds after temporarily setting nominal size.
- * These values may have been set in ResetPartitions to restrict the
- * size of the partition to the requested range.
- */
-
- rcPtr->min = rcPtr->reqSize.min + pad;
- rcPtr->max = rcPtr->reqSize.max + pad;
-
- size = rcPtr->size;
- if (size > rcPtr->max) {
- size = rcPtr->max;
- } else if (size < rcPtr->min) {
- size = rcPtr->min;
- }
- if ((piPtr->ePad > 0) && (size < tablePtr->editPtr->min)) {
- size = tablePtr->editPtr->min;
- }
- rcPtr->nom = rcPtr->size = size;
-
- /*
- * If a partition can't be resized (to either expand or shrink), hold
- * its respective limit at its normal size.
- */
- if (!(rcPtr->resize & RESIZE_EXPAND)) {
- rcPtr->max = rcPtr->nom;
- }
- if (!(rcPtr->resize & RESIZE_SHRINK)) {
- rcPtr->min = rcPtr->nom;
- }
- if (rcPtr->control == NULL) {
- /* If a row/column contains no entries, then its size should be
- * locked. */
- if (rcPtr->resize & RESIZE_VIRGIN) {
- rcPtr->max = rcPtr->min = size;
- } else {
- if (!(rcPtr->resize & RESIZE_EXPAND)) {
- rcPtr->max = size;
- }
- if (!(rcPtr->resize & RESIZE_SHRINK)) {
- rcPtr->min = size;
- }
- }
- rcPtr->nom = size;
- }
-#ifdef notdef
- if (strcmp(Tk_Name(tablePtr->tkwin), "fs") == 0) {
- fprintf(stderr, "SetNominalSizes %s: %s %d min=%d max=%d nom=%d, size=%d total=%d\n",
- Tk_Name(tablePtr->tkwin), piPtr->type, rcPtr->index, rcPtr->min, rcPtr->max, rcPtr->nom, rcPtr->size, total);
- }
-#endif
- total += rcPtr->nom;
- }
- return total;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LockPartitions
- *
- * Sets the maximum size of a row or column, if the partition has a
- * widget that controls it.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LockPartitions(PartitionInfo *piPtr)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(piPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- if (rcPtr->control != NULL) {
- /* Partition is controlled by this widget */
- rcPtr->max = rcPtr->size;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LayoutPartitions --
- *
- * Calculates the normal space requirements for both the row and column
- * partitions. Each widget is added in order of the number of rows or
- * columns spanned, which defines the space needed among in the
- * partitions spanned.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The sum of normal sizes set here will be used as the normal size for
- * the container widget.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LayoutPartitions(Table *tablePtr)
-{
- Blt_ListNode node;
- int total;
- PartitionInfo *piPtr;
-
- piPtr = &tablePtr->cols;
-
- ResetPartitions(tablePtr, piPtr, GetBoundedWidth);
-
- for (node = Blt_List_FirstNode(piPtr->list); node != NULL;
- node = Blt_List_NextNode(node)) {
- Blt_Chain chain;
- Blt_ChainLink link;
-
- chain = Blt_List_GetValue(node);
-
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TableEntry *tePtr;
- int needed, used;
-
- tePtr = Blt_Chain_GetValue(link);
- if (tePtr->column.control != CONTROL_FULL) {
- continue;
- }
- needed = GetReqWidth(tePtr) + PADDING(tePtr->xPad) +
- 2 * (tePtr->borderWidth + tablePtr->eEntryPad);
- if (needed <= 0) {
- continue;
- }
- used = GetSpan(piPtr, tePtr);
- if (needed > used) {
- GrowSpan(tablePtr, piPtr, tePtr, needed - used);
- }
- }
- }
-
- LockPartitions(piPtr);
-
- for (node = Blt_List_FirstNode(piPtr->list); node != NULL;
- node = Blt_List_NextNode(node)) {
- Blt_Chain chain;
- Blt_ChainLink link;
-
- chain = Blt_List_GetValue(node);
-
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TableEntry *tePtr;
- int needed, used;
-
- tePtr = Blt_Chain_GetValue(link);
-
- needed = GetReqWidth(tePtr) + PADDING(tePtr->xPad) +
- 2 * (tePtr->borderWidth + tablePtr->eEntryPad);
-
- if (tePtr->column.control >= 0.0) {
- needed = (int)(needed * tePtr->column.control);
- }
- if (needed <= 0) {
- continue;
- }
- used = GetSpan(piPtr, tePtr);
- if (needed > used) {
- GrowSpan(tablePtr, piPtr, tePtr, needed - used);
- }
- }
- }
- total = SetNominalSizes(tablePtr, piPtr);
- tablePtr->normal.width = GetBoundedWidth(total, &tablePtr->reqWidth) +
- PADDING(tablePtr->xPad) +
- 2 * (tablePtr->eTablePad + Tk_InternalBorderWidth(tablePtr->tkwin));
-
- piPtr = &tablePtr->rows;
-
- ResetPartitions(tablePtr, piPtr, GetBoundedHeight);
-
- for (node = Blt_List_FirstNode(piPtr->list); node != NULL;
- node = Blt_List_NextNode(node)) {
- Blt_Chain chain;
- Blt_ChainLink link;
-
- chain = Blt_List_GetValue(node);
-
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TableEntry *tePtr;
- int needed, used;
-
- tePtr = Blt_Chain_GetValue(link);
- if (tePtr->row.control != CONTROL_FULL) {
- continue;
- }
- needed = GetReqHeight(tePtr) + PADDING(tePtr->yPad) +
- 2 * (tePtr->borderWidth + tablePtr->eEntryPad);
- if (needed <= 0) {
- continue;
- }
- used = GetSpan(piPtr, tePtr);
- if (needed > used) {
- GrowSpan(tablePtr, piPtr, tePtr, needed - used);
- }
-#ifdef notdef
- if (strcmp(Tk_Name(tePtr->tkwin), "ss") == 0) {
- fprintf(stderr, "pass1 %s used=%d needed=%d\n", Tk_Name(tePtr->tkwin),
- used, needed);
- }
-#endif
- }
- }
- LockPartitions(&tablePtr->rows);
-
- for (node = Blt_List_FirstNode(piPtr->list); node != NULL;
- node = Blt_List_NextNode(node)) {
- Blt_Chain chain;
- Blt_ChainLink link;
-
- chain = Blt_Chain_GetValue(node);
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TableEntry *tePtr;
- int needed, used;
-
- tePtr = Blt_Chain_GetValue(link);
- needed = GetReqHeight(tePtr) + PADDING(tePtr->yPad) +
- 2 * (tePtr->borderWidth + tablePtr->eEntryPad);
- if (tePtr->row.control >= 0.0) {
- needed = (int)(needed * tePtr->row.control);
- }
- if (needed <= 0) {
- continue;
- }
- used = GetSpan(piPtr, tePtr);
- if (needed > used) {
- GrowSpan(tablePtr, piPtr, tePtr, needed - used);
- }
-#ifdef notdef
- if (strcmp(Tk_Name(tePtr->tkwin), "ss") == 0) {
- fprintf(stderr, "pass2 %s used=%d needed=%d\n", Tk_Name(tePtr->tkwin),
- used, needed);
- }
-#endif
- }
- }
- total = SetNominalSizes(tablePtr, piPtr);
- tablePtr->normal.height = GetBoundedHeight(total, &tablePtr->reqHeight) +
- PADDING(tablePtr->yPad) +
- 2 * (tablePtr->eTablePad + Tk_InternalBorderWidth(tablePtr->tkwin));
-
-#ifdef notdef
- if (strcmp(Tk_Name(tablePtr->tkwin), "fs") == 0) {
- fprintf(stderr, "%s normal height=%d\n",
- Tk_PathName(tablePtr->tkwin), tablePtr->normal.height);
- fprintf(stderr, "total=%d boundedheight=%d reqHeight=%d normal=%d\n",
- total, GetBoundedHeight(total, &tablePtr->reqHeight),
- tablePtr->reqHeight.nom, tablePtr->normal.height);
- }
-#endif
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ArrangeEntries
- *
- * Places each widget at its proper location. First determines the size
- * and position of the each widget. It then considers the following:
- *
- * 1. translation of widget position its parent widget.
- * 2. fill style
- * 3. anchor
- * 4. external and internal padding
- * 5. widget size must be greater than zero
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of each partition is re-initialized its minimum size.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ArrangeEntries(Table *tablePtr) /* Table widget structure */
-{
- Blt_ChainLink link;
- int xMax, yMax;
-
- xMax = tablePtr->container.width -
- (Tk_InternalBorderWidth(tablePtr->tkwin) + tablePtr->padRight +
- tablePtr->eTablePad);
- yMax = tablePtr->container.height -
- (Tk_InternalBorderWidth(tablePtr->tkwin) + tablePtr->padBottom +
- tablePtr->eTablePad);
-
- for (link = Blt_Chain_FirstLink(tablePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TableEntry *tePtr;
- int dx, dy;
- int extra;
- int spanWidth, spanHeight;
- int winWidth, winHeight;
- int x, y;
-
- tePtr = Blt_Chain_GetValue(link);
-
- x = tePtr->column.rcPtr->offset +
- tePtr->column.rcPtr->pad.side1 +
- tePtr->padLeft +
- Tk_Changes(tePtr->tkwin)->border_width +
- tablePtr->eEntryPad;
- y = tePtr->row.rcPtr->offset +
- tePtr->row.rcPtr->pad.side1 +
- tePtr->padTop +
- Tk_Changes(tePtr->tkwin)->border_width +
- tablePtr->eEntryPad;
-
- /*
- * Unmap any widgets that start beyond of the right edge of the
- * container.
- */
- if ((x >= xMax) || (y >= yMax)) {
- if (Tk_IsMapped(tePtr->tkwin)) {
- if (Tk_Parent(tePtr->tkwin) != tablePtr->tkwin) {
- Tk_UnmaintainGeometry(tePtr->tkwin, tablePtr->tkwin);
- }
- Tk_UnmapWindow(tePtr->tkwin);
- }
- continue;
- }
- extra = 2 * (tePtr->borderWidth + tablePtr->eEntryPad);
- spanWidth = GetSpan(&tablePtr->cols, tePtr) -
- (extra + PADDING(tePtr->xPad));
- spanHeight = GetSpan(&tablePtr->rows, tePtr) -
- (extra + PADDING(tePtr->yPad));
-
- winWidth = GetReqWidth(tePtr);
- winHeight = GetReqHeight(tePtr);
-
- /*
- *
- * Compare the widget's requested size to the size of the span.
- *
- * 1) If the widget is larger than the span or if the fill flag is
- * set, make the widget the size of the span. Check that the new size
- * is within the bounds set for the widget.
- *
- * 2) Otherwise, position the widget in the space according to its
- * anchor.
- *
- */
- if ((spanWidth <= winWidth) || (tePtr->fill & FILL_X)) {
- winWidth = spanWidth;
- if (winWidth > tePtr->reqWidth.max) {
- winWidth = tePtr->reqWidth.max;
- }
- }
- if ((spanHeight <= winHeight) || (tePtr->fill & FILL_Y)) {
- winHeight = spanHeight;
- if (winHeight > tePtr->reqHeight.max) {
- winHeight = tePtr->reqHeight.max;
- }
- }
-
- dx = dy = 0;
- if (spanWidth > winWidth) {
- dx = (spanWidth - winWidth);
- }
- if (spanHeight > winHeight) {
- dy = (spanHeight - winHeight);
- }
- if ((dx > 0) || (dy > 0)) {
- TranslateAnchor(dx, dy, tePtr->anchor, &x, &y);
- }
- /*
- * Clip the widget at the bottom and/or right edge of the container.
- */
- if (winWidth > (xMax - x)) {
- winWidth = (xMax - x);
- }
- if (winHeight > (yMax - y)) {
- winHeight = (yMax - y);
- }
-
- /*
- * If the widget is too small (i.e. it has only an external border)
- * then unmap it.
- */
- if ((winWidth < 1) || (winHeight < 1)) {
- if (Tk_IsMapped(tePtr->tkwin)) {
- if (tablePtr->tkwin != Tk_Parent(tePtr->tkwin)) {
- Tk_UnmaintainGeometry(tePtr->tkwin, tablePtr->tkwin);
- }
- Tk_UnmapWindow(tePtr->tkwin);
- }
- continue;
- }
-
- /*
- * Resize and/or move the widget as necessary.
- */
- tePtr->x = x;
- tePtr->y = y;
-
-#ifdef notdef
- if (strcmp(Tk_Name(tePtr->tkwin), "fs") == 0) {
- fprintf(stderr, "ArrangeEntries: %s rw=%d rh=%d w=%d h=%d\n",
- Tk_PathName(tePtr->tkwin), Tk_ReqWidth(tePtr->tkwin),
- Tk_ReqHeight(tePtr->tkwin), winWidth, winHeight);
- }
-#endif
- if (tablePtr->tkwin != Tk_Parent(tePtr->tkwin)) {
- Tk_MaintainGeometry(tePtr->tkwin, tablePtr->tkwin, x, y,
- winWidth, winHeight);
- } else {
- if ((x != Tk_X(tePtr->tkwin)) || (y != Tk_Y(tePtr->tkwin)) ||
- (winWidth != Tk_Width(tePtr->tkwin)) ||
- (winHeight != Tk_Height(tePtr->tkwin))) {
-#ifdef notdef
- if (strcmp(Tk_Name(tePtr->tkwin), "fs") == 0) {
- fprintf(stderr, "ArrangeEntries: %s rw=%d rh=%d w=%d h=%d\n",
- Tk_PathName(tePtr->tkwin), Tk_ReqWidth(tePtr->tkwin),
- Tk_ReqHeight(tePtr->tkwin), winWidth, winHeight);
- }
-#endif
- Tk_MoveResizeWindow(tePtr->tkwin, x, y, winWidth, winHeight);
- }
- if (!Tk_IsMapped(tePtr->tkwin)) {
- Tk_MapWindow(tePtr->tkwin);
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ArrangeTable --
- *
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widgets in the table are possibly resized and redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ArrangeTable(ClientData clientData)
-{
- Table *tablePtr = clientData;
- int width, height;
- int offset, delta;
- int xPad, yPad;
- int outerPad;
- Blt_ChainLink link;
-
-#ifdef notdef
- fprintf(stderr, "ArrangeTable(%s)\n", Tk_PathName(tablePtr->tkwin));
-#endif
- Tcl_Preserve(tablePtr);
- tablePtr->flags &= ~ARRANGE_PENDING;
-
- tablePtr->rows.ePad = tablePtr->cols.ePad = tablePtr->eTablePad =
- tablePtr->eEntryPad = 0;
- if (tablePtr->editPtr != NULL) {
- tablePtr->rows.ePad = tablePtr->cols.ePad =
- tablePtr->editPtr->gridLineWidth;
- tablePtr->eTablePad = tablePtr->editPtr->gridLineWidth;
- tablePtr->eEntryPad = tablePtr->editPtr->entryPad;
- }
- /*
- * If the table has no children anymore, then don't do anything at all:
- * just leave the container widget's size as-is.
- */
- if ((Blt_Chain_GetLength(tablePtr->chain) == 0) ||
- (tablePtr->tkwin == NULL)) {
- Tcl_Release(tablePtr);
- return;
- }
- if (tablePtr->flags & REQUEST_LAYOUT) {
- tablePtr->flags &= ~REQUEST_LAYOUT;
- LayoutPartitions(tablePtr);
- }
- /*
- * Initially, try to fit the partitions exactly into the container by
- * resizing the container. If the widget's requested size is different,
- * send a request to the container widget's geometry manager to resize.
- */
- if ((tablePtr->propagate) &&
- ((tablePtr->normal.width != Tk_ReqWidth(tablePtr->tkwin)) ||
- (tablePtr->normal.height != Tk_ReqHeight(tablePtr->tkwin)))) {
- Tk_GeometryRequest(tablePtr->tkwin, tablePtr->normal.width,
- tablePtr->normal.height);
- EventuallyArrangeTable(tablePtr);
- Tcl_Release(tablePtr);
- return;
- }
- /*
- * Save the width and height of the container so we know when its size has
- * changed during ConfigureNotify events.
- */
- tablePtr->container.width = Tk_Width(tablePtr->tkwin);
- tablePtr->container.height = Tk_Height(tablePtr->tkwin);
- outerPad = 2 * (Tk_InternalBorderWidth(tablePtr->tkwin) +
- tablePtr->eTablePad);
- xPad = outerPad + tablePtr->cols.ePad + PADDING(tablePtr->xPad);
- yPad = outerPad + tablePtr->rows.ePad + PADDING(tablePtr->yPad);
-
- width = GetTotalSpan(&tablePtr->cols) + xPad;
- height = GetTotalSpan(&tablePtr->rows) + yPad;
-
- /*
- * If the previous geometry request was not fulfilled (i.e. the size of
- * the container is different from partitions' space requirements), try to
- * adjust size of the partitions to fit the widget.
- */
- delta = tablePtr->container.width - width;
- if (delta != 0) {
- if (delta > 0) {
- GrowPartitions(&tablePtr->cols, delta);
- } else {
- ShrinkPartitions(&tablePtr->cols, delta);
- }
- width = GetTotalSpan(&tablePtr->cols) + xPad;
- }
- delta = tablePtr->container.height - height;
- if (delta != 0) {
- if (delta > 0) {
-#ifdef notdef
- if (strcmp(Tk_Name(tablePtr->tkwin), "fs") == 0) {
- fprintf(stderr, "GrowPartiions %s delta=%d container=%d rh=%d h=%d\n",
- Tk_Name(tablePtr->tkwin), delta, tablePtr->container.height,
- Tk_ReqHeight(tablePtr->tkwin), height);
- }
-#endif
- GrowPartitions(&tablePtr->rows, delta);
- } else {
-#ifdef notdef
- if (strcmp(Tk_Name(tablePtr->tkwin), "fs") == 0) {
- fprintf(stderr, "ShrinkPartiions %s delta=%d container=%d rh=%d h=%d\n",
- Tk_Name(tablePtr->tkwin), delta, tablePtr->container.height,
- Tk_ReqHeight(tablePtr->tkwin), height);
- }
-#endif
- ShrinkPartitions(&tablePtr->rows, delta);
- }
- height = GetTotalSpan(&tablePtr->rows) + yPad;
- }
-
- /*
- * If after adjusting the size of the partitions the space required does
- * not equal the size of the widget, do one of the following:
- *
- * 1) If it's smaller, center the table in the widget.
- * 2) If it's bigger, clip the partitions that extend beyond
- * the edge of the container.
- *
- * Set the row and column offsets (including the container's internal
- * border width). To be used later when positioning the widgets.
- */
-
- offset = Tk_InternalBorderWidth(tablePtr->tkwin) + tablePtr->padLeft +
- tablePtr->eTablePad;
- if (width < tablePtr->container.width) {
- offset += (tablePtr->container.width - width) / 2;
- }
- for (link = Blt_Chain_FirstLink(tablePtr->cols.chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *columnPtr;
-
- columnPtr = Blt_Chain_GetValue(link);
- columnPtr->offset = offset + tablePtr->cols.ePad;
- offset += columnPtr->size;
- }
-
- offset = Tk_InternalBorderWidth(tablePtr->tkwin) + tablePtr->padTop +
- tablePtr->eTablePad;
- if (height < tablePtr->container.height) {
- offset += (tablePtr->container.height - height) / 2;
- }
- for (link = Blt_Chain_FirstLink(tablePtr->rows.chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- RowColumn *rowPtr;
-
- rowPtr = Blt_Chain_GetValue(link);
- rowPtr->offset = offset + tablePtr->rows.ePad;
- offset += rowPtr->size;
- }
-
- ArrangeEntries(tablePtr);
- if (tablePtr->editPtr != NULL) {
- /* Redraw the editor */
- (*tablePtr->editPtr->drawProc) (tablePtr->editPtr);
- }
- Tcl_Release(tablePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ArrangeOp --
- *
- * Forces layout of the table geometry manager. This is useful mostly
- * for debugging the geometry manager. You can get the geometry manager
- * to calculate the normal (requested) width and height of each row and
- * column. Otherwise, you need to first withdraw the container widget,
- * invoke "update", and then query the geometry manager.
- *
- * Results:
- * Returns a standard TCL result. If the table is successfully
- * rearranged, TCL_OK is returned. Otherwise, TCL_ERROR is returned and
- * an error message is left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ArrangeOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report errors to */
- int objc,
- Tcl_Obj *const *objv) /* Path name of container associated with the
- * table */
-{
- Table *tablePtr;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- tablePtr->flags |= REQUEST_LAYOUT;
- ArrangeTable(tablePtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Returns the name, position and options of a widget in the table.
- *
- * Results:
- * Returns a standard TCL result. A list of the widget attributes is
- * left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CgetOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- PartitionInfo *piPtr;
- Table *tablePtr;
- const char *string;
- char c;
- int length;
- int n;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 4) {
- return Blt_ConfigureValueFromObj(interp, tablePtr->tkwin,
- tableConfigSpecs, (char *)tablePtr, objv[3], 0);
- }
- string = Tcl_GetStringFromObj(objv[3], &length);
- c = string[0];
- if (c == '.') { /* Configure widget */
- TableEntry *tePtr;
-
- if (GetEntry(interp, tablePtr, Tcl_GetString(objv[3]), &tePtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_ConfigureValueFromObj(interp, tePtr->tkwin,
- entryConfigSpecs, (char *)tePtr, objv[4], 0);
- } else if ((c == 'c') && (strncmp(string, "container", length) == 0)) {
- return Blt_ConfigureValueFromObj(interp, tablePtr->tkwin,
- tableConfigSpecs, (char *)tablePtr, objv[4], 0);
- }
- piPtr = ParseRowColumn(tablePtr, objv[3], &n);
- if (piPtr == NULL) {
- return TCL_ERROR;
- }
- return Blt_ConfigureValueFromObj(interp, tablePtr->tkwin,
- piPtr->configSpecs, (char *)GetRowColumn(piPtr, n), objv[4], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Returns the name, position and options of a widget in the table.
- *
- * Results:
- * Returns a standard TCL result. A list of the table configuration
- * option information is left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ConfigureOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Table *tablePtr;
- int count;
- int result;
- Tcl_Obj *const *items;
- int i;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Find the end of the items. Search until we see an option (-).
- */
- objc -= 3, objv += 3;
- for (count = 0; count < objc; count++) {
- const char *string;
-
- string = Tcl_GetString(objv[count]);
- if (string[0] == '-') {
- break;
- }
- }
- items = objv; /* Save the start of the item list */
- objc -= count; /* Move beyond the items to the options */
- objv += count;
- result = TCL_ERROR; /* Suppress compiler warning */
-
- if (count == 0) {
- result = ConfigureTable(tablePtr, interp, objc, objv);
- }
- for (i = 0; i < count; i++) {
- const char *string;
- char c1, c2;
- int length;
-
- string = Tcl_GetStringFromObj(items[i], &length);
- c1 = string[0];
- c2 = string[1];
- if (c1 == '.') { /* Configure widget */
- TableEntry *tePtr;
-
- if (GetEntry(interp, tablePtr, string, &tePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- result = ConfigureEntry(tablePtr, interp, tePtr, objc, objv);
- } else if ((c1 == 'r') || (c1 == 'R')) {
- result = ConfigureRowColumn(tablePtr, &tablePtr->rows,
- string, objc, objv);
- } else if ((c1 == 'c') && (c2 == 'o') &&
- (strncmp(string, "container", length) == 0)) {
- result = ConfigureTable(tablePtr, interp, objc, objv);
- } else if ((c1 == 'c') || (c1 == 'C')) {
- result = ConfigureRowColumn(tablePtr, &tablePtr->cols,
- string, objc, objv);
- } else {
- Tcl_AppendResult(interp, "unknown item \"", string,
- "\": should be widget, row or column index, or \"container\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (result == TCL_ERROR) {
- break;
- }
- if ((i + 1) < count) {
- Tcl_AppendResult(interp, "\n", (char *)NULL);
- }
- }
- tablePtr->flags |= REQUEST_LAYOUT;
- EventuallyArrangeTable(tablePtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Deletes the specified rows and/or columns from the table. Note that
- * the row/column indices can be fixed only after all the deletions have
- * occurred.
- *
- * table delete .f r0 r1 r4 c0
- *
- * Results:
- * Returns a standard TCL result.
- *
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DeleteOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Table *tablePtr;
- int matches;
- int i;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 3; i < objc; i++) {
- const char *pattern;
- char c;
-
- pattern = Tcl_GetString(objv[i]);
- c = tolower(pattern[0]);
- if ((c != 'r') && (c != 'c')) {
- Tcl_AppendResult(interp, "bad index \"", pattern,
- "\": must start with \"r\" or \"c\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- matches = 0;
- for (i = 3; i < objc; i++) {
- Blt_ChainLink link, next;
- PartitionInfo *piPtr;
- const char *pattern;
- char c;
-
- pattern = Tcl_GetString(objv[i]);
- c = tolower(pattern[0]);
- piPtr = (c == 'r') ? &tablePtr->rows : &tablePtr->cols;
- for (link = Blt_Chain_FirstLink(piPtr->chain); link != NULL;
- link = next) {
- RowColumn *rcPtr;
- char ident[200];
-
- next = Blt_Chain_NextLink(link);
- rcPtr = Blt_Chain_GetValue(link);
- sprintf_s(ident, 200, "%c%d", c, rcPtr->index);
- if (Tcl_StringMatch(ident, pattern)) {
- matches++;
- DeleteRowColumn(tablePtr, piPtr, rcPtr);
- Blt_Chain_DeleteLink(piPtr->chain, link);
- }
- }
- }
- if (matches > 0) { /* Fix indices */
- Blt_ChainLink link;
-
- i = 0;
- for (link = Blt_Chain_FirstLink(tablePtr->cols.chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- rcPtr->index = i++;
- }
- i = 0;
- for (link = Blt_Chain_FirstLink(tablePtr->rows.chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- rcPtr->index = i++;
- }
- tablePtr->flags |= REQUEST_LAYOUT;
- EventuallyArrangeTable(tablePtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * JoinOp --
- *
- * Joins the specified span of rows/columns together into a partition.
- * The row/column indices can be fixed only after all the deletions have
- * occurred.
- *
- * table join .f r0 r3
- * table join .f c2 c4
- * Results:
- * Returns a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-JoinOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Table *tablePtr;
- Blt_ChainLink link, nextl, froml;
- PartitionInfo *piPtr, *info2Ptr;
- TableEntry *tePtr;
- int from, to; /* Indices marking the span of partitions to
- * be joined together. */
- int start, end; /* Entry indices. */
- int i;
- RowColumn *rcPtr;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- piPtr = ParseRowColumn(tablePtr, objv[3], &from);
- if (piPtr == NULL) {
- return TCL_ERROR;
- }
- info2Ptr = ParseRowColumn(tablePtr, objv[4], &to);
- if (info2Ptr == NULL) {
- return TCL_ERROR;
- }
- if (piPtr != info2Ptr) {
- Tcl_AppendResult(interp,
- "\"from\" and \"to\" must both be rows or columns",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (from >= to) {
- return TCL_OK; /* No-op. */
- }
- froml = Blt_Chain_GetNthLink(piPtr->chain, from);
- rcPtr = Blt_Chain_GetValue(froml);
-
- /*
- * Reduce the span of all entries that currently cross any of the
- * trailing rows/columns. Also, if the entry starts in one of these
- * rows/columns, moved it to the designated "joined" row/column.
- */
- if (piPtr->type == rowUid) {
- for (link = Blt_Chain_FirstLink(tablePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- tePtr = Blt_Chain_GetValue(link);
- start = tePtr->row.rcPtr->index + 1;
- end = tePtr->row.rcPtr->index + tePtr->row.span - 1;
- if ((end < from) || ((start > to))) {
- continue;
- }
- tePtr->row.span -= to - start + 1;
- if (start >= from) {/* Entry starts in a trailing partition. */
- tePtr->row.rcPtr = rcPtr;
- }
- }
- } else {
- for (link = Blt_Chain_FirstLink(tablePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- tePtr = Blt_Chain_GetValue(link);
- start = tePtr->column.rcPtr->index + 1;
- end = tePtr->column.rcPtr->index + tePtr->column.span - 1;
- if ((end < from) || ((start > to))) {
- continue;
- }
- tePtr->column.span -= to - start + 1;
- if (start >= from) {/* Entry starts in a trailing partition. */
- tePtr->column.rcPtr = rcPtr;
- }
- }
- }
- link = Blt_Chain_NextLink(froml);
- for (i = from + 1; i <= to; i++) {
- nextl = Blt_Chain_NextLink(link);
- rcPtr = Blt_Chain_GetValue(link);
- DeleteRowColumn(tablePtr, piPtr, rcPtr);
- Blt_Chain_DeleteLink(piPtr->chain, link);
- link = nextl;
- }
- i = 0;
- for (link = Blt_Chain_FirstLink(piPtr->chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- rcPtr = Blt_Chain_GetValue(link);
- rcPtr->index = i++;
- }
- tablePtr->flags |= REQUEST_LAYOUT;
- EventuallyArrangeTable(tablePtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExtentsOp --
- *
- * Returns a list of all the pathnames of the widgets managed by a table.
- * The table is determined from the name of the container widget
- * associated with the table.
- *
- * table extents .frame r0 c0 container
- *
- * Results:
- * Returns a standard TCL result. If no error occurred, TCL_OK is
- * returned and a list of widgets managed by the table is left in
- * interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ExtentsOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to return results to. */
- int objc, /* # of arguments */
- Tcl_Obj *const *objv) /* Command line arguments. */
-{
- Table *tablePtr;
- Blt_ChainLink link;
- PartitionInfo *piPtr;
- Tcl_DString dString;
- char *pattern;
- char c;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- pattern = Tcl_GetString(objv[3]);
- c = tolower(pattern[0]);
- if (c == 'r') {
- piPtr = &tablePtr->rows;
- } else if (c == 'c') {
- piPtr = &tablePtr->cols;
- } else {
- Tcl_AppendResult(interp, "unknown item \"", pattern,
- "\": should be widget, row, or column", (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_DStringInit(&dString);
- for (link = Blt_Chain_FirstLink(piPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
- char ident[200];
-
- rcPtr = Blt_Chain_GetValue(link);
- sprintf_s(ident, 200, "%c%d", c, rcPtr->index);
- if (Tcl_StringMatch(ident, pattern)) {
- int x, y, width, height;
- RowColumn *c1Ptr, *r1Ptr, *c2Ptr, *r2Ptr;
-
- if (c == 'r') {
- r1Ptr = r2Ptr = rcPtr;
- c1Ptr = GetRowColumn(&tablePtr->cols, 0);
- c2Ptr = GetRowColumn(&tablePtr->cols,
- tablePtr->nColumns - 1);
- } else {
- c1Ptr = c2Ptr = rcPtr;
- r1Ptr = GetRowColumn(&tablePtr->rows, 0);
- r2Ptr = GetRowColumn(&tablePtr->rows, tablePtr->nRows - 1);
- }
- x = c1Ptr->offset;
- y = r1Ptr->offset;
- width = c2Ptr->offset + c2Ptr->size - x;
- height = r2Ptr->offset + r2Ptr->size - y;
- Tcl_DStringAppend(&dString, ident, -1);
- Tcl_DStringAppend(&dString, " ", 1);
- Tcl_DStringAppend(&dString, Blt_Itoa(rcPtr->index), -1);
- Tcl_DStringAppend(&dString, " ", 1);
- Tcl_DStringAppend(&dString, Blt_Itoa(x), -1);
- Tcl_DStringAppend(&dString, " ", 1);
- Tcl_DStringAppend(&dString, Blt_Itoa(y), -1);
- Tcl_DStringAppend(&dString, " ", 1);
- Tcl_DStringAppend(&dString, Blt_Itoa(width), -1);
- Tcl_DStringAppend(&dString, " ", 1);
- Tcl_DStringAppend(&dString, Blt_Itoa(height), -1);
- Tcl_DStringAppend(&dString, "\n", 1);
- }
- }
- Tcl_DStringResult(interp, &dString);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ForgetOp --
- *
- * Processes an objv/objc list of widget names and purges their entries
- * from their respective tables. The widgets are unmapped and the tables
- * are rearranged at the next idle point. Note that all the named
- * widgets do not need to exist in the same table.
- *
- * Results:
- * Returns a standard TCL result. If an error occurred, TCL_ERROR is
- * returned and an error message is left in interp->result.
- *
- * Side Effects:
- * Memory is deallocated (the entry is destroyed), etc. The affected
- * tables are is re-computed and arranged at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ForgetOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- TableEntry *tePtr;
- int i;
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Table *tablePtr;
- Tk_Window tkwin;
- char *string;
-
- tablePtr = NULL;
- for (i = 2; i < objc; i++) {
- tePtr = NULL;
- string = Tcl_GetString(objv[i]);
- tkwin = Tk_NameToWindow(interp, string, dataPtr->tkMain);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- for (hPtr = Blt_FirstHashEntry(&dataPtr->tableTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- tablePtr = Blt_GetHashValue(hPtr);
- if (tablePtr->interp != interp) {
- continue;
- }
- tePtr = FindEntry(tablePtr, tkwin);
- if (tePtr != NULL) {
- break;
- }
- }
- if (tePtr == NULL) {
- Tcl_AppendResult(interp, "\"", string,
- "\" is not managed by any table", (char *)NULL);
- return TCL_ERROR;
- }
- if (Tk_IsMapped(tePtr->tkwin)) {
- Tk_UnmapWindow(tePtr->tkwin);
- }
- /* Arrange for the call back here in the loop, because the widgets may
- * not belong to the same table. */
- tablePtr->flags |= REQUEST_LAYOUT;
- EventuallyArrangeTable(tablePtr);
- DestroyEntry(tePtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InfoOp --
- *
- * Returns the options of a widget or partition in the table.
- *
- * Results:
- * Returns a standard TCL result. A list of the widget attributes is
- * left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InfoOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Table *tablePtr;
- int result;
- char c;
- int i;
- char *string;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 3; i < objc; i++) {
- string = Tcl_GetString(objv[i]);
- c = string[0];
- if (c == '.') { /* Entry information */
- TableEntry *tePtr;
-
- if (GetEntry(interp, tablePtr, string, &tePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- result = InfoEntry(interp, tablePtr, tePtr);
- } else if ((c == 'r') || (c == 'R') || (c == 'c') || (c == 'C')) {
- result = InfoRowColumn(tablePtr, interp, string);
- } else {
- Tcl_AppendResult(interp, "unknown item \"", string,
- "\": should be widget, row, or column", (char *)NULL);
- return TCL_ERROR;
- }
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- if ((i + 1) < objc) {
- Tcl_AppendResult(interp, "\n", (char *)NULL);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InsertOp --
- *
- * Inserts a span of rows/columns into the table.
- *
- * table insert .f r0 2
- * table insert .f c0 5
- *
- * Results:
- * Returns a standard TCL result. A list of the widget attributes is
- * left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InsertOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Table *tablePtr;
- long int span;
- int iBefore;
- PartitionInfo *piPtr;
- RowColumn *rcPtr;
- int i;
- Blt_ChainLink before, link;
- int linkBefore;
- char *string;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- linkBefore = TRUE;
-
- string = Tcl_GetString(objv[3]);
- if (string[0] == '-') {
- if (strcmp(string, "-before") == 0) {
- linkBefore = TRUE;
- objv++; objc--;
- } else if (strcmp(string, "-after") == 0) {
- linkBefore = FALSE;
- objv++; objc--;
- }
- }
- if (objc == 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), "insert ", Tcl_GetString(objv[2]),
- "row|column ?span?", (char *)NULL);
- return TCL_ERROR;
- }
- piPtr = ParseRowColumn(tablePtr, objv[3], &iBefore);
- if (piPtr == NULL) {
- return TCL_ERROR;
- }
- span = 1;
- if ((objc > 4) &&
- (Tcl_ExprLong(interp, Tcl_GetString(objv[4]), &span) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (span < 1) {
- Tcl_AppendResult(interp, "span value \"", Tcl_GetString(objv[4]),
- "\" can't be negative", (char *)NULL);
- return TCL_ERROR;
- }
- before = Blt_Chain_GetNthLink(piPtr->chain, iBefore);
- /*
- * Insert the new rows/columns from the designated point in the
- * chain.
- */
- for (i = 0; i < span; i++) {
- rcPtr = CreateRowColumn();
- link = Blt_Chain_NewLink();
- Blt_Chain_SetValue(link, rcPtr);
- if (linkBefore) {
- Blt_Chain_LinkBefore(piPtr->chain, link, before);
- } else {
- Blt_Chain_LinkAfter(piPtr->chain, link, before);
- }
- rcPtr->link = link;
- }
- i = 0;
- for (link = Blt_Chain_FirstLink(piPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- rcPtr = Blt_Chain_GetValue(link);
- /* Reset the indices of the trailing rows/columns. */
- rcPtr->index = i++;
- }
- tablePtr->flags |= REQUEST_LAYOUT;
- EventuallyArrangeTable(tablePtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SplitOp --
- *
- * Splits a single row/column into multiple partitions. Any widgets that
- * span this row/column will be automatically corrected to include the
- * new rows/columns.
- *
- * table split .f r0 3
- * table split .f c2 2
- * Results:
- * Returns a standard TCL result. A list of the widget attributes is
- * left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SplitOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Table *tablePtr;
- int number, split;
- int start, end;
- PartitionInfo *piPtr;
- RowColumn *rcPtr;
- int i;
- Blt_ChainLink after, link;
- TableEntry *tePtr;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- piPtr = ParseRowColumn(tablePtr, objv[3], &number);
- if (piPtr == NULL) {
- return TCL_ERROR;
- }
- split = 2;
- if (objc > 4) {
- if (Tcl_GetIntFromObj(interp, objv[4], &split) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (split < 2) {
- Tcl_AppendResult(interp, "bad split value \"", Tcl_GetString(objv[4]),
- "\": should be 2 or greater", (char *)NULL);
- return TCL_ERROR;
- }
- after = Blt_Chain_GetNthLink(piPtr->chain, number);
-
- /*
- * Append (split - 1) additional rows/columns starting
- * from the current point in the chain.
- */
-
- for (i = 1; i < split; i++) {
- rcPtr = CreateRowColumn();
- link = Blt_Chain_NewLink();
- Blt_Chain_SetValue(link, rcPtr);
- Blt_Chain_LinkAfter(piPtr->chain, link, after);
- rcPtr->link = link;
- }
-
- /*
- * Also increase the span of all entries that span this row/column by
- * split - 1.
- */
- if (piPtr->type == rowUid) {
- for (link = Blt_Chain_FirstLink(tablePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- tePtr = Blt_Chain_GetValue(link);
- start = tePtr->row.rcPtr->index;
- end = tePtr->row.rcPtr->index + tePtr->row.span;
- if ((start <= number) && (number < end)) {
- tePtr->row.span += (split - 1);
- }
- }
- } else {
- for (link = Blt_Chain_FirstLink(tablePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- tePtr = Blt_Chain_GetValue(link);
- start = tePtr->column.rcPtr->index;
- end = tePtr->column.rcPtr->index + tePtr->column.span;
- if ((start <= number) && (number < end)) {
- tePtr->column.span += (split - 1);
- }
- }
- }
- /*
- * Be careful to renumber the rows or columns only after processing each
- * entry. Otherwise row/column numbering will be out of sync with the
- * index.
- */
- i = number;
- for (link = after; link != NULL; link = Blt_Chain_NextLink(link)) {
- rcPtr = Blt_Chain_GetValue(link);
- rcPtr->index = i++; /* Renumber the trailing indices. */
- }
-
- tablePtr->flags |= REQUEST_LAYOUT;
- EventuallyArrangeTable(tablePtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RowColumnSearch --
- *
- * Searches for the row or column designated by an x or y coordinate.
- *
- * Results:
- * Returns a pointer to the row/column containing the given point. If no
- * row/column contains the coordinate, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static RowColumn *
-RowColumnSearch(PartitionInfo *piPtr, int x)
-{
- Blt_ChainLink link;
-
- /*
- * This search assumes that rows/columns are organized in increasing
- * order.
- */
- for (link = Blt_Chain_FirstLink(piPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- /*
- *| |offset |offset+size | |
- * ^
- * x
- */
- if (x < rcPtr->offset) {
- return NULL; /* Too far, can't find row/column. */
- }
- if (x < (rcPtr->offset + rcPtr->size)) {
- return rcPtr;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LocateOp --
- *
- *
- * Returns the row,column index given a screen coordinate.
- *
- * Results:
- * Returns a standard TCL result.
- *
- * table locate .t %X %Y
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-LocateOp(TableInterpData *dataPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- RowColumn *rowPtr, *columnPtr;
- Table *tablePtr;
- Tcl_Obj *listObjPtr;
- int x, y;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_GetPixelsFromObj(interp, tablePtr->tkwin, objv[3], PIXELS_ANY, &x)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_GetPixelsFromObj(interp, tablePtr->tkwin, objv[4], PIXELS_ANY, &y)
- != TCL_OK) {
- return TCL_ERROR;
- }
- rowPtr = RowColumnSearch(&tablePtr->rows, y);
- if (rowPtr == NULL) {
- return TCL_OK;
- }
- columnPtr = RowColumnSearch(&tablePtr->cols, x);
- if (columnPtr == NULL) {
- return TCL_OK;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(rowPtr->index));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(columnPtr->index));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * Returns a list of tables currently in use. A table is associated by
- * the name of its container widget. All tables matching a given pattern
- * are included in this list. If no pattern is present (objc == 0), all
- * tables are included.
- *
- * Results:
- * Returns a standard TCL result. If no error occurred, TCL_OK is
- * returned and a list of tables is left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NamesOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to return list of names to */
- int objc,
- Tcl_Obj *const *objv) /* Contains 0-1 arguments: search pattern */
-{
- NamesSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, namesSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (switches.slave != NULL) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tk_Window tkwin;
-
- tkwin = Tk_NameToWindow(interp, switches.slave, dataPtr->tkMain);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- for (hPtr = Blt_FirstHashEntry(&dataPtr->tableTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Table *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- if (FindEntry(tablePtr, tkwin) != NULL) {
- Tcl_AppendElement(interp, Tk_PathName(tablePtr->tkwin));
- }
- }
- } else {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- const char *pattern;
-
- pattern = (switches.pattern == NULL) ? Tcl_GetString(objv[3]) :
- switches.pattern;
- for (hPtr = Blt_FirstHashEntry(&dataPtr->tableTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Table *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- if (tablePtr->interp == interp) {
- if ((pattern == NULL) ||
- (Tcl_StringMatch(Tk_PathName(tablePtr->tkwin), pattern))) {
- Tcl_AppendElement(interp, Tk_PathName(tablePtr->tkwin));
- }
- }
- }
- }
- Blt_FreeSwitches(namesSwitches, (char *)&switches, 0);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SaveOp --
- *
- * Returns a list of all the commands necessary to rebuild the the table.
- * This includes the layout of the widgets and any row, column, or table
- * options set.
- *
- * Results:
- * Returns a standard TCL result. If no error occurred, TCL_OK is
- * returned and a list of widget path names is left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SaveOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Table *tablePtr;
- Blt_ChainLink link, lastl;
- PartitionInfo *piPtr;
- Tcl_DString dString;
- int start, last;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_DStringInit(&dString);
- Tcl_DStringAppend(&dString, "\n# Table widget layout\n\n", -1);
- Tcl_DStringAppend(&dString, Tcl_GetString(objv[0]), -1);
- Tcl_DStringAppend(&dString, " ", -1);
- Tcl_DStringAppend(&dString, Tk_PathName(tablePtr->tkwin), -1);
- Tcl_DStringAppend(&dString, " \\\n", -1);
- lastl = Blt_Chain_LastLink(tablePtr->chain);
- for (link = Blt_Chain_FirstLink(tablePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TableEntry *tePtr;
-
- tePtr = Blt_Chain_GetValue(link);
- PrintEntry(tePtr, &dString);
- if (link != lastl) {
- Tcl_DStringAppend(&dString, " \\\n", -1);
- }
- }
- Tcl_DStringAppend(&dString, "\n\n# Row configuration options\n\n", -1);
- piPtr = &tablePtr->rows;
- for (link = Blt_Chain_FirstLink(piPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- start = Tcl_DStringLength(&dString);
- Tcl_DStringAppend(&dString, Tcl_GetString(objv[0]), -1);
- Tcl_DStringAppend(&dString, " configure ", -1);
- Tcl_DStringAppend(&dString, Tk_PathName(tablePtr->tkwin), -1);
- Tcl_DStringAppend(&dString, " r", -1);
- Tcl_DStringAppend(&dString, Blt_Itoa(rcPtr->index), -1);
- last = Tcl_DStringLength(&dString);
- PrintRowColumn(interp, piPtr, rcPtr, &dString);
- if (Tcl_DStringLength(&dString) == last) {
- Tcl_DStringSetLength(&dString, start);
- } else {
- Tcl_DStringAppend(&dString, "\n", -1);
- }
- }
- Tcl_DStringAppend(&dString, "\n\n# Column configuration options\n\n", -1);
- piPtr = &tablePtr->cols;
- for (link = Blt_Chain_FirstLink(piPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- RowColumn *rcPtr;
-
- rcPtr = Blt_Chain_GetValue(link);
- start = Tcl_DStringLength(&dString);
- Tcl_DStringAppend(&dString, Tcl_GetString(objv[0]), -1);
- Tcl_DStringAppend(&dString, " configure ", -1);
- Tcl_DStringAppend(&dString, Tk_PathName(tablePtr->tkwin), -1);
- Tcl_DStringAppend(&dString, " c", -1);
- Tcl_DStringAppend(&dString, Blt_Itoa(rcPtr->index), -1);
- last = Tcl_DStringLength(&dString);
- PrintRowColumn(interp, piPtr, rcPtr, &dString);
- if (Tcl_DStringLength(&dString) == last) {
- Tcl_DStringSetLength(&dString, start);
- } else {
- Tcl_DStringAppend(&dString, "\n", -1);
- }
- }
- start = Tcl_DStringLength(&dString);
- Tcl_DStringAppend(&dString, "\n\n# Table configuration options\n\n", -1);
- Tcl_DStringAppend(&dString, Tcl_GetString(objv[0]), -1);
- Tcl_DStringAppend(&dString, " configure ", -1);
- Tcl_DStringAppend(&dString, Tk_PathName(tablePtr->tkwin), -1);
- last = Tcl_DStringLength(&dString);
- PrintTable(tablePtr, &dString);
- if (Tcl_DStringLength(&dString) == last) {
- Tcl_DStringSetLength(&dString, start);
- } else {
- Tcl_DStringAppend(&dString, "\n", -1);
- }
- Tcl_DStringResult(interp, &dString);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SearchOp --
- *
- * Returns a list of all the pathnames of the widgets managed by a table
- * geometry manager. The table is given by the path name of a container
- * widget associated with the table.
- *
- * Results:
- * Returns a standard TCL result. If no error occurred, TCL_OK is
- * returned and a list of widget path names is left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SearchOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to return list of names to */
- int objc, /* Number of arguments */
- Tcl_Obj *const *objv) /* Contains 1-2 arguments: pathname of
- * container widget associated with the table
- * and search pattern */
-{
- Table *tablePtr;
- Blt_ChainLink link;
- SearchSwitches switches;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
-
- memset(&switches, 0, sizeof(switches));
- switches.tablePtr = tablePtr;
- if (Blt_ParseSwitches(interp, searchSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
-
- /* Find entries that match the search criteria. */
-
- for (link = Blt_Chain_FirstLink(tablePtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TableEntry *tePtr;
-
- tePtr = Blt_Chain_GetValue(link);
- if (switches.pattern != NULL) {
- if (!Tcl_StringMatch(Tk_PathName(tePtr->tkwin), switches.pattern)) {
- continue;
- }
- }
- if (switches.flags & MATCH_SPAN) {
- if ((switches.rspan >= 0) &&
- (tePtr->row.rcPtr->index > switches.rspan) &&
- ((tePtr->row.rcPtr->index + tePtr->row.span) < switches.rspan)){
- continue;
- }
- if ((switches.cspan >= 0) &&
- ((tePtr->column.rcPtr->index > switches.cspan) ||
- ((tePtr->column.rcPtr->index + tePtr->column.span) <
- switches.cspan))) {
- continue;
- }
- }
- if (switches.flags & MATCH_START) {
- if ((switches.rstart >= 0) &&
- (tePtr->row.rcPtr->index != switches.rstart)) {
- continue;
- }
- if ((switches.cstart >= 0) &&
- (tePtr->column.rcPtr->index != switches.cstart)) {
- continue;
- }
- }
- Tcl_AppendElement(interp, Tk_PathName(tePtr->tkwin));
- }
- Blt_FreeSwitches(searchSwitches, (char *)&switches, 0);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Table operations.
- *
- * The fields for Blt_OpSpec are as follows:
- *
- * - operation name
- * - minimum number of characters required to disambiguate the operation name.
- * - function associated with operation.
- * - minimum number of arguments required.
- * - maximum number of arguments allowed (0 indicates no limit).
- * - usage string
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec tableOps[] =
-{
- {"arrange", 1, ArrangeOp, 3, 3, "container",},
- {"cget", 2, CgetOp, 4, 5,
- "container ?row|column|widget? option",},
- {"configure", 3, ConfigureOp, 3, 0,
- "container ?row|column|widget?... ?option value?...",},
- {"containers", 3, NamesOp, 2, 4, "?switch? ?arg?",},
- {"delete", 1, DeleteOp, 3, 0, "container row|column ?row|column?",},
- {"extents", 1, ExtentsOp, 4, 4, "container row|column|widget",},
- {"forget", 1, ForgetOp, 3, 0, "widget ?widget?...",},
- {"info", 3, InfoOp, 3, 0, "container ?row|column|widget?...",},
- {"insert", 3, InsertOp, 4, 6,
- "container ?-before|-after? row|column ?count?",},
- {"join", 1, JoinOp, 5, 5, "container first last",},
- {"locate", 2, LocateOp, 5, 5, "container x y",},
- {"names", 1, NamesOp, 2, 4, "?switch? ?arg?",},
- {"save", 2, SaveOp, 3, 3, "container",},
- {"search", 2, SearchOp, 3, 0, "container ?switch arg?...",},
- {"split", 2, SplitOp, 4, 5, "container row|column div",},
-};
-
-static int nTableOps = sizeof(tableOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to the table geometry manager. See the user documentation for details
- * on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TableCmd(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- TableInterpData *dataPtr = clientData;
- TableCmdProc *proc;
-
- if (objc > 1) {
- char *string;
-
- string = Tcl_GetString(objv[1]);
- if (string[0] == '.') {
- Table *tablePtr;
-
- if (Blt_GetTableFromObj(clientData, interp, objv[1], &tablePtr)
- != TCL_OK) {
- Tcl_ResetResult(interp);
- tablePtr = CreateTable(dataPtr, interp, string);
- if (tablePtr == NULL) {
- return TCL_ERROR;
- }
- }
- return BuildTable(tablePtr, interp, objc, objv);
- }
- }
- proc = Blt_GetOpFromObj(interp, nTableOps, tableOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc)(dataPtr, interp, objc, objv);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableInterpDeleteProc --
- *
- * This is called when the interpreter hosting the table command is
- * destroyed.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Destroys all the hash table maintaining the names of the table
- * geometry managers.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-TableInterpDeleteProc(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp)
-{
- TableInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->tableTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Table *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- tablePtr->hashPtr = NULL;
- DestroyTable((DestroyData)tablePtr);
- }
- Blt_DeleteHashTable(&dataPtr->tableTable);
- Tcl_DeleteAssocData(interp, TABLE_THREAD_KEY);
- Blt_Free(dataPtr);
-}
-
-static TableInterpData *
-GetTableInterpData(Tcl_Interp *interp)
-{
- TableInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (TableInterpData *)
- Tcl_GetAssocData(interp, TABLE_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(TableInterpData));
- dataPtr->tkMain = Tk_MainWindow(interp);
- Tcl_SetAssocData(interp, TABLE_THREAD_KEY, TableInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->tableTable, BLT_ONE_WORD_KEYS);
- }
- return dataPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TableMgrCmdInitProc --
- *
- * This procedure is invoked to initialize the TCL command that
- * corresponds to the table geometry manager.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates the new TCL command.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_TableMgrCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "table", TableCmd, };
-
- cmdSpec.clientData = GetTableInterpData(interp);
- rowUid = (Blt_Uid)Tk_GetUid("row");
- columnUid = (Blt_Uid)Tk_GetUid("column");
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
diff --git a/blt3.0.1/src/bltTable.h b/blt3.0.1/src/bltTable.h
deleted file mode 100644
index e732d41..0000000
--- a/blt3.0.1/src/bltTable.h
+++ /dev/null
@@ -1,374 +0,0 @@
-
-/*
- * bltTable.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_TABLE_H
-#define _BLT_TABLE_H
-
-#include "bltChain.h"
-#include "bltHash.h"
-#include "bltList.h"
-
-typedef struct {
- Blt_HashTable tableTable; /* Hash table of table structures keyed by
- * the address of the reference Tk window */
- Tk_Window tkMain;
-} TableInterpData;
-
-
-typedef struct _Editor Editor;
-typedef void (EditorDrawProc)(Editor *editor);
-typedef void (EditorDestroyProc)(DestroyData destroyData);
-
-struct _Editor {
- int gridLineWidth;
- int buttonHeight;
- int entryPad;
- int min; /* Minimum size to allow any partition */
-
- EditorDrawProc *drawProc;
- EditorDestroyProc *destroyProc;
-};
-
-#define nRows rows.chain->nLinks
-#define nColumns cols.chain->nLinks
-
-/*
- * Limits --
- *
- * Defines the bounding of a size (width or height) in the table. It may
- * be related to the partition, entry, or table size. The widget
- * pointers are used to associate sizes with the requested size of other
- * widgets.
- */
-
-typedef struct {
- int flags; /* Flags indicate whether using default
- * values for limits or not. See flags
- * below. */
- int max, min; /* Values for respective limits. */
- int nom; /* Nominal starting value. */
- Tk_Window wMax, wMin; /* If non-NULL, represents widgets whose
- * requested sizes will be set as limits. */
- Tk_Window wNom; /* If non-NULL represents widget whose
- * requested size will be the nominal
- * size. */
-} Limits;
-
-#define LIMITS_SET_BIT 1
-#define LIMITS_SET_MIN (LIMITS_SET_BIT<<0)
-#define LIMITS_SET_MAX (LIMITS_SET_BIT<<1)
-#define LIMITS_SET_NOM (LIMITS_SET_BIT<<2)
-
-#define LIMITS_MIN 0 /* Default minimum limit */
-#define LIMITS_MAX SHRT_MAX/* Default maximum limit */
-#define LIMITS_NOM -1000 /* Default nomimal value. Indicates if a
- * partition has received any space yet */
-
-typedef int (LimitsProc)(int value, Limits *limitsPtr);
-
-/*
- * Resize --
- *
- * These flags indicate in what ways each partition in a table can be
- * resized from its default dimensions. The normal size of a row/column
- * is the minimum amount of space needed to hold the widgets that span
- * it. The table may then be stretched or shrunk depending if the
- * container is larger or smaller than the table. This can occur if 1)
- * the user resizes the toplevel widget, or 2) the container is in turn
- * packed into a larger widget and the "fill" option is set.
- *
- * RESIZE_NONE - No resizing from normal size.
- * RESIZE_EXPAND - Do not allow the size to decrease.
- * The size may increase however.
- * RESIZE_SHRINK - Do not allow the size to increase.
- * The size may decrease however.
- * RESIZE_BOTH - Allow the size to increase or
- * decrease from the normal size.
- * RESIZE_VIRGIN - Special case of the resize flag. Used to
- * indicate the initial state of the flag.
- * Empty rows/columns are treated differently
- * if this row/column is set.
- */
-
-#define RESIZE_NONE 0
-#define RESIZE_EXPAND (1<<0)
-#define RESIZE_SHRINK (1<<1)
-#define RESIZE_BOTH (RESIZE_EXPAND | RESIZE_SHRINK)
-#define RESIZE_VIRGIN (1<<2)
-
-/*
- * Control --
- */
-#define CONTROL_NORMAL 1.0 /* Consider the widget when calculating the
- * row heights and column widths. */
-#define CONTROL_NONE 0.0 /* Ignore the widget. The height and width of
- * the rows/columns spanned by this widget
- * will not affected by the size of the
- * widget.
- */
-#define CONTROL_FULL -1.0 /* Consider only this widget when determining
- * the column widths and row heights of the
- * partitions it spans. */
-#define EXCL_PAD 0
-#define INCL_PAD 1
-
-typedef struct _Table Table;
-typedef struct _RowColumn RowColumn;
-
-/*
- * TableEntry --
- *
- * An entry holds a widget and describes how the widget should appear in
- * a range of cells.
- * 1. padding.
- * 2. how many rows/columns the entry spans.
- * 3. size bounds for the widget.
- *
- * Several entries may start at the same cell in the table, but a entry
- * can hold only one widget.
- */
-
-typedef struct {
- Tk_Window tkwin; /* Widget to be managed. */
-
- Table *tablePtr; /* Table managing this widget */
-
- int borderWidth; /* The external border width of the
- * widget. This is needed to check if
- * Tk_Changes(tkwin)->border_width changes.
- */
-
- int manageWhenNeeded; /* If non-zero, allow joint custody of the
- * widget. This is for cases where the same
- * widget may be shared between two different
- * tables (e.g. same graph on two different
- * notebook pages). Claim the widget only
- * when the table is mapped. Don't destroy the
- * entry if the table loses custody of the
- * widget. */
-
- Limits reqWidth, reqHeight; /* Bounds for width and height requests made
- * by the widget. */
- struct PositionInfo {
- RowColumn *rcPtr; /* Row or column where this entry starts. */
-
- long span; /* Number of rows or columns spanned. */
- float control; /* Weight of widget in the row or column. */
-
- Blt_ChainLink link; /* Link to widget in the chain of spans */
-
- Blt_Chain chain; /* Pointer to the chain of spans. */
- } row, column;
-
- Tk_Anchor anchor; /* Anchor type: indicates how the widget is
- * positioned if extra space is available in
- * the entry */
-
- Blt_Pad xPad; /* Extra padding placed left and right of the
- * widget. */
- Blt_Pad yPad; /* Extra padding placed above and below the
- * widget */
-
- int ixPad, iyPad; /* Extra padding added to the interior of the
- * widget (i.e. adds to the requested size of
- * the widget) */
-
- int fill; /* Indicates how the widget should fill the
- * span of cells it occupies. */
-
- int x, y; /* Origin of widget wrt container. */
-
- Blt_ChainLink link; /* Pointer into list of entries. */
-
- Blt_HashEntry *hashPtr; /* Pointer into table of entries. */
-
-} TableEntry;
-
-/*
- * RowColumn --
- *
- * Creates a definable space (row or column) in the table. It may have
- * both requested minimum or maximum values which constrain the size of
- * it.
- */
-
-struct _RowColumn {
- int index; /* Index of row or column */
-
- int size; /* Current size of the partition. This size
- * is bounded by min and max. */
-
- /*
- * nom and size perform similar duties. I need to keep track of the
- * amount of space allocated to the partition (using size). But at the
- * same time, I need to indicate that space can be parcelled out to this
- * partition. If a nominal size was set for this partition, I don't want
- * to add space.
- */
-
- int nom; /* The nominal size (neither expanded nor
- * shrunk) of the partition based upon the
- * requested sizes of the widgets spanning
- * this partition. */
-
- int min, max; /* Size constraints on the partition */
-
- int offset; /* Offset of the partition (in pixels) from
- * the origin of the container. */
-
- int minSpan; /* Minimum spanning widget in partition. Used
- * for bookkeeping when growing a span of
- * partitions */
-
- float weight; /* Weight of row or column */
-
- TableEntry *control; /* Pointer to the entry that is determining
- * the size of this partition. This is used
- * to know when a partition is occupied. */
-
- int resize; /* Indicates if the partition should shrink or
- * expand from its nominal size. */
-
- Blt_Pad pad; /* Pads the partition beyond its nominal
- * size */
-
- Limits reqSize; /* Requested bounds for the size of the
- * partition. The partition will not expand or
- * shrink beyond these limits, regardless of
- * how it was specified (max widget size).
- * This includes any extra padding which may
- * be specified. */
-
- int maxSpan; /* Maximum spanning widget to consider when
- * growing a span of partitions. A value of
- * zero indicates that all spans should be
- * considered. */
-
- int count;
-
- Blt_ChainLink link;
-
-};
-
-#define DEF_TBL_RESIZE "both"
-#define DEF_TBL_PAD "0"
-#define DEF_TBL_MAXSPAN "0"
-
-
-/*
- * This is the default number of elements in the statically pre-allocated
- * column and row arrays. This number should reflect a useful number of row
- * and columns, which fit most applications.
- */
-#define DEF_ARRAY_SIZE 32
-
-typedef TableEntry *(EntrySearchProc)(Table *tablePtr, Tk_Window tkwin);
-
-/*
- * PartitionInfo --
- *
- * Manages the rows or columns of the table. Contains a chain of
- * partitions (representing the individiual rows or columns).
- *
- */
-typedef struct PartitionInfo {
- char *type; /* String identifying the type of partition:
- * "row" or "column". */
- Blt_Chain chain;
- Blt_List list; /* Linked list of bins of widgets keyed by
- * increasing span. */
- Blt_ConfigSpec *configSpecs;
- int reqLength;
- int ePad; /* Extra padding for row/column needed to
- * display editor marks */
-} PartitionInfo;
-
-/*
- * Table structure
- */
-struct _Table {
- int flags; /* See the flags definitions below. */
- Tk_Window tkwin; /* The container widget into which other
- * widgets are arranged. */
- Tcl_Interp *interp; /* Interpreter associated with all widgets */
-
- Blt_Chain chain; /* Chain of entries in the table. */
-
- Blt_HashTable entryTable; /* Table of entries. Serves as a directory to
- * look up entries from widget their names. */
- Blt_Pad xPad, yPad;
-
- int propagate; /* If non-zero, the table will make a geometry
- * request on behalf of the container
- * widget. */
-
- int eTablePad, eEntryPad;
-
- PartitionInfo cols;
- PartitionInfo rows; /* Manages row and column partitions */
-
- Dim2D container; /* Last known dimenion of the container. */
- Dim2D normal; /* Normal dimensions of the table */
- Limits reqWidth, reqHeight; /* Constraints on the table's normal width and
- * height */
- Editor *editPtr; /* If non-NULL, indicates that the table is
- * currently being edited */
- Tcl_IdleProc *arrangeProc;
- EntrySearchProc *findEntryProc;
- Blt_HashEntry *hashPtr; /* Used to delete the table from its
- * hashtable. */
- Blt_HashTable *tablePtr;
-};
-
-/*
- * Table flags definitions
- */
-#define ARRANGE_PENDING (1<<0) /* A call to ArrangeTable is pending. This
- * flag allows multiple layout changes to be
- * requested before the table is actually
- * reconfigured. */
-#define REQUEST_LAYOUT (1<<1) /* Get the requested sizes of the widgets
- * before expanding/shrinking the size of the
- * container. It's necessary to recompute the
- * layout every time a partition or entry is
- * added, reconfigured, or deleted, but not
- * when the container is resized. */
-#define NON_PARENT (1<<2) /* The table is managing widgets that arern't
- * children of the container. This requires
- * that they are manually moved when the
- * container is moved (a definite performance
- * hit). */
-/*
- * Forward declarations
- */
-
-BLT_EXTERN int Blt_GetTable(TableInterpData *dataPtr, Tcl_Interp *interp,
- const char *pathName, Table **tablePtrPtr);
-
-BLT_EXTERN int Blt_GetTableFromObj(TableInterpData *dataPtr, Tcl_Interp *interp,
- Tcl_Obj *objPtr, Table **tablePtrPtr);
-
-#endif /* _BLT_TABLE_H */
diff --git a/blt3.0.1/src/bltTabset.c b/blt3.0.1/src/bltTabset.c
deleted file mode 100644
index 75afecd..0000000
--- a/blt3.0.1/src/bltTabset.c
+++ /dev/null
@@ -1,8075 +0,0 @@
-
-/*
- * bltTabset.c --
- *
- * This module implements a tabnotebook widget for the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_TABSET
-#include "bltOp.h"
-#include "bltBind.h"
-#include "bltChain.h"
-#include "bltFont.h"
-#include "bltBgStyle.h"
-#include "bltImage.h"
-#include "bltPicture.h"
-#include "bltPainter.h"
-#include "bltText.h"
-#include "bltHash.h"
-
-#define DEBUG0 0
-#define DEBUG1 0
-#define DEBUG2 1
-
-#define INVALID_FAIL 0
-#define INVALID_OK 1
-
-#define TABWIDTH_NONE -2
-#define TABWIDTH_SAME -1
-#define TABWIDTH_VARIABLE 0
-
-#define PHOTO_ICON 1
-
-#define FCLAMP(x) ((((x) < 0.0) ? 0.0 : ((x) > 1.0) ? 1.0 : (x)))
-#define SWAP(a,b) { int tmp; tmp = (a), (a) = (b), (b) = tmp; }
-
-#define GAP 1
-#define SELECT_PADX 4
-#define SELECT_PADY 2
-#define OUTER_PAD 0
-#define LABEL_PAD 4
-#define CORNER_OFFSET 3
-#define CLOSE_WIDTH 16
-#define CLOSE_HEIGHT 16
-
-#define TAB_SCROLL_OFFSET 10
-
-#define END (-1)
-#define ODD(x) ((x) | 0x01)
-
-#define SIDE_LEFT (1<<0)
-#define SIDE_TOP (1<<1)
-#define SIDE_RIGHT (1<<2)
-#define SIDE_BOTTOM (1<<3)
-
-#define VPORTWIDTH(b) \
- ((((b)->side) & (SIDE_TOP|SIDE_BOTTOM)) ? \
- (Tk_Width((b)->tkwin) - 2 * (b)->inset) : \
- (Tk_Height((b)->tkwin) - 2 * (b)->inset))
-
-#define VPORTHEIGHT(b) \
- ((((b)->side) & (SIDE_LEFT|SIDE_RIGHT)) ? \
- (Tk_Width((b)->tkwin) - 2 * (b)->inset) : \
- (Tk_Height((b)->tkwin) - 2 * (b)->inset))
-
-#define GETATTR(t,attr) \
- (((t)->attr != NULL) ? (t)->attr : (t)->setPtr->defStyle.attr)
-
-/*
- *---------------------------------------------------------------------------
- *
- * Internal widget flags:
- *
- * LAYOUT_PENDING The layout of the widget needs to be recomputed.
- *
- * REDRAW_PENDING A redraw request is pending for the widget.
- *
- * SCROLL_PENDING A scroll request is pending.
- *
- * FOCUS The widget is receiving keyboard events.
- * Draw the focus highlight border around the widget.
- *
- * MULTIPLE_TIER Tabset is using multiple tiers.
- *
- * SCROLLING Tabset has enough tabs to be scrolled.
- *
- * SCROLL_TABS Scroll tabs if there are enough tabs to be scrolled.
- *
- * SHOW_SINGLE_TAB Display window in a tab even if only one tab.
- *
- * CLOSE_NEEDED Include a "x" button on each tab that automatically
- * closes the tab.
- *
- *---------------------------------------------------------------------------
- */
-#define LAYOUT_PENDING (1<<0) /* Indicates the tabset has been
- * changed so that it geometry needs
- * to be recalculated before its
- * redrawn. */
-#define REDRAW_PENDING (1<<1) /* Indicates the tabset needs to be
- * redrawn at the next idle point. */
-#define SCROLL_PENDING (1<<2) /* Indicates a scroll request that */
-#define FOCUS (1<<3) /* Indicates the tabset/tab has
- * focus. */
-#define TEAROFF (1<<4) /* Indicates if the perforation should
- * be drawn (see -tearoff). */
-#define SCROLLING (1<<5)
-#define MULTIPLE_TIER (1<<6) /* Indicates the tabset is using
- * multiple tiers of tabs. */
-#define ACTIVE_PERFORATION (1<<7) /* Indicates if the perforation should
- * should be drawn with active
- * colors. */
-#define REDRAW_ALL (1<<9) /* Draw the entire tabset including
- * the folder. If not set, indicates
- * that only the tabs need to be drawn
- * (activate, deactivate, scroll,
- * etc). This avoids drawing the
- * folder again. */
-#define SLANT_NONE 0
-#define SLANT_LEFT (1<<10)
-#define SLANT_RIGHT (1<<11)
-#define SLANT_BOTH (SLANT_LEFT | SLANT_RIGHT)
-
-#define CLOSE_NEEDED (1<<13) /* Draw a close button on each tab. */
-#define SHOW_SINGLE_TAB (1<<14) /* Display window in a tab even if
- * there is only one tab displayed. */
-#define SCROLL_TABS (1<<15) /* Allow tabs to be scrolled if
- * needed. Otherwise tab sizes will
- * shrink to fit the space. */
-
-#define TAB_LABEL (ClientData)0
-#define TAB_PERFORATION (ClientData)1
-#define TAB_BUTTON (ClientData)2
-
-#ifdef notdef
-#define DEF_ACTIVEBACKGROUND RBG_GREY85
-#define DEF_ACTIVEFOREGROUND STD_ACTIVE_FOREGROUND
-#else
-#define DEF_ACTIVEBACKGROUND RGB_SKYBLUE4
-#define DEF_ACTIVEFOREGROUND RGB_WHITE
-#endif
-
-#define DEF_BACKGROUND RGB_GREY77
-#define DEF_BORDERWIDTH "0"
-#define DEF_COMMAND (char *)NULL
-#define DEF_CURSOR (char *)NULL
-#define DEF_DASHES "1"
-#define DEF_FONT STD_FONT_SMALL
-#define DEF_FOREGROUND STD_NORMAL_FOREGROUND
-#define DEF_FOREGROUND STD_NORMAL_FOREGROUND
-#define DEF_GAP "1"
-#define DEF_HEIGHT "0"
-#define DEF_HIGHLIGHTBACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_HIGHLIGHTCOLOR RGB_BLACK
-#define DEF_HIGHLIGHTTHICKNESS "0"
-#define DEF_JUSTIFY "center"
-#define DEF_OUTERPAD "0"
-#define DEF_PAGEHEIGHT "0"
-#define DEF_PAGEWIDTH "0"
-#define DEF_RELIEF "flat"
-#define DEF_ROTATE "0.0"
-#define DEF_SCROLLINCREMENT "0"
-#define DEF_SCROLLTABS "0"
-#define DEF_SELECTBACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_SELECTBORDERWIDTH "1"
-#define DEF_SELECTCOMMAND (char *)NULL
-#define DEF_CLOSECOMMAND (char *)NULL
-#define DEF_SELECTFOREGROUND RGB_BLACK
-#define DEF_SELECTMODE "multiple"
-#define DEF_SELECTPADX "4"
-#define DEF_SELECTPADY "2"
-#define DEF_SELECTRELIEF "raised"
-#define DEF_SHADOWCOLOR RGB_BLACK
-#define DEF_CLOSEBUTTON "0"
-#define DEF_SHOWSINGLETAB "1"
-#define DEF_SIDE "top"
-#define DEF_SLANT "none"
-#define DEF_TABRELIEF "raised"
-#define DEF_TABWIDTH "same"
-#define DEF_TAKEFOCUS "1"
-#define DEF_TEAROFF "no"
-#define DEF_ICONPOSITION "left"
-#define DEF_TIERS "1"
-#define DEF_TROUGHCOLOR "grey60"
-#define DEF_WIDTH "0"
-
-#define DEF_CLOSEBUTTON_ACTIVEBACKGROUND RGB_RED
-#define DEF_CLOSEBUTTON_ACTIVEFOREGROUND RGB_WHITE
-#define DEF_CLOSEBUTTON_ACTIVERELIEF "raised"
-#define DEF_CLOSEBUTTON_BACKGROUND RGB_GREY70
-#define DEF_CLOSEBUTTON_BORDERWIDTH "0"
-#define DEF_CLOSEBUTTON_COMMAND (char *)NULL
-#define DEF_CLOSEBUTTON_FOREGROUND RGB_GREY95
-#define DEF_CLOSEBUTTON_RELIEF "flat"
-
-#define DEF_TAB_ACTIVEBACKGROUND (char *)NULL
-#define DEF_TAB_ACTIVEFOREGROUND (char *)NULL
-#define DEF_TAB_ANCHOR "center"
-#define DEF_TAB_BACKGROUND (char *)NULL
-#define DEF_TAB_BORDERWIDTH "1"
-#define DEF_TAB_BUTTON (char *)NULL
-#define DEF_TAB_CLOSEBUTTON "1"
-#define DEF_TAB_COMMAND (char *)NULL
-#define DEF_TAB_DATA (char *)NULL
-#define DEF_TAB_FILL "none"
-#define DEF_TAB_FONT (char *)NULL
-#define DEF_TAB_FOREGROUND (char *)NULL
-#define DEF_TAB_HEIGHT "0"
-#define DEF_TAB_HIDE "no"
-#define DEF_TAB_IMAGE (char *)NULL
-#define DEF_TAB_IPAD "0"
-#define DEF_TAB_PAD "3"
-#define DEF_TAB_PERFORATIONCOMMAND (char *)NULL
-#define DEF_TAB_SELECTBACKGROUND (char *)NULL
-#define DEF_TAB_SELECTBORDERWIDTH "1"
-#define DEF_TAB_SELECTCOMMAND (char *)NULL
-#define DEF_TAB_SELECTFOREGROUND (char *)NULL
-#define DEF_TAB_STATE "normal"
-#define DEF_TAB_STIPPLE "BLT"
-#define DEF_TAB_TEXT (char *)NULL
-#define DEF_TAB_VISUAL (char *)NULL
-#define DEF_TAB_WIDTH "0"
-#define DEF_TAB_WINDOW (char *)NULL
-#define DEF_TAB_WINDOWHEIGHT "0"
-#define DEF_TAB_WINDOWWIDTH "0"
-
-typedef struct _Tabset Tabset;
-
-static Tk_GeomRequestProc EmbeddedWidgetGeometryProc;
-static Tk_GeomLostSlaveProc EmbeddedWidgetCustodyProc;
-static Tk_GeomMgr tabMgrInfo = {
- (char *)"tabset", /* Name of geometry manager used by
- * winfo */
- EmbeddedWidgetGeometryProc, /* Procedure to for new geometry
- * requests */
- EmbeddedWidgetCustodyProc, /* Procedure when window is taken away */
-};
-
-static Blt_OptionParseProc ObjToIconProc;
-static Blt_OptionPrintProc IconToObjProc;
-static Blt_OptionFreeProc FreeIconProc;
-static Blt_OptionParseProc ObjToChildProc;
-static Blt_OptionPrintProc ChildToObjProc;
-static Blt_OptionParseProc ObjToSlantProc;
-static Blt_OptionPrintProc SlantToObjProc;
-static Blt_OptionParseProc ObjToTabWidthProc;
-static Blt_OptionPrintProc TabWidthToObjProc;
-static Blt_OptionParseProc ObjToStateProc;
-static Blt_OptionPrintProc StateToObjProc;
-
-/*
- * Contains a pointer to the widget that's currently being configured. This
- * is used in the custom configuration parse routine for icons.
- */
-
-static Blt_CustomOption iconOption = {
- ObjToIconProc, IconToObjProc, FreeIconProc, (ClientData)0,
-};
-
-static Blt_CustomOption childOption = {
- ObjToChildProc, ChildToObjProc, NULL, (ClientData)0,
-};
-
-static Blt_CustomOption slantOption = {
- ObjToSlantProc, SlantToObjProc, NULL, (ClientData)0,
-};
-
-static Blt_CustomOption tabWidthOption = {
- ObjToTabWidthProc, TabWidthToObjProc, NULL, (ClientData)0,
-};
-
-static Blt_CustomOption stateOption = {
- ObjToStateProc, StateToObjProc, NULL, (ClientData)0
-};
-
-typedef struct {
- short int x, y; /* Location of region. */
- short int w, h; /* Dimensions of region. */
-} GadgetRegion;
-
-/*
- * Icon --
- *
- * When multiple instances of an image are displayed in the same widget,
- * this can be inefficient in terms of both memory and time. We only
- * need one instance of each image, regardless of number of times we use
- * it. And searching/deleting instances can be very slow as the list
- * gets large.
- *
- * The workaround, employed below, is to maintain a hash table of images
- * that maintains a reference count for each image.
- */
-
-typedef struct _Icon {
- Blt_HashEntry *hashPtr; /* Hash table pointer to the image. */
- Tk_Image tkImage; /* The Tk image being cached. */
- Blt_Picture picture;
- float angle;
- short int width, height; /* Dimensions of the cached image. */
- int refCount; /* Reference counter for this image. */
-} *Icon;
-
-#define IconHeight(i) (((i) == NULL) ? 0 : (i)->height)
-#define IconWidth(i) (((i) == NULL) ? 0 : (i)->width)
-#define IconBits(i) ((i)->tkImage)
-
-/*
- * Button --
- */
-typedef struct {
- int borderWidth; /* Width of 3D border around this
- * button. */
- int pad; /* Amount of extra padding around
- * the button. */
- int relief; /* 3D relief of button. */
- int activeRelief; /* 3D relief when the button is
- * active. */
- XColor *normalFg; /* Foreground color of the button when
- * the button is inactive. */
- XColor *normalBg; /* Background color of the button when
- * the button is inactive. */
- XColor *activeFg; /* Foreground color of the button
- * when the button is active. */
- XColor *activeBg; /* Background color of the button
- * when the button is active. */
- Tcl_Obj *cmdObjPtr; /* Command to be executed when the the
- * button is invoked. */
- Blt_Picture normal0; /* Contains the image to be displayed
- * when the button is inactive at 0
- * degrees rotation. */
- Blt_Picture active0; /* Contains the image to be displayed
- * when the button is active at 0
- * degreees rotation. */
-
- Blt_Picture normal; /* Contains the image to be displayed
- * when the button is inactive at 0
- * degrees rotation. */
- Blt_Picture active; /* Contains the image to be displayed
- * when the button is active at 0
- * degreees rotation. */
- short int width, height; /* The dimensions of the button. */
-} Button;
-
-static Blt_ConfigSpec buttonSpecs[] =
-{
- {BLT_CONFIG_COLOR, "-activebackground", "activeBackrgound",
- "ActiveBackground", DEF_CLOSEBUTTON_ACTIVEBACKGROUND,
- Blt_Offset(Button, activeBg), 0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForergound",
- "ActiveForeground", DEF_CLOSEBUTTON_ACTIVEFOREGROUND,
- Blt_Offset(Button, activeFg), 0},
- {BLT_CONFIG_COLOR, "-background", "backrgound", "Background",
- DEF_CLOSEBUTTON_BACKGROUND, Blt_Offset(Button, normalBg), 0},
- {BLT_CONFIG_COLOR, "-foreground", "forergound", "Foreground",
- DEF_CLOSEBUTTON_FOREGROUND, Blt_Offset(Button, normalFg), 0},
- {BLT_CONFIG_RELIEF, "-activerelief", "activeRelief", "ActiveRelief",
- DEF_CLOSEBUTTON_ACTIVERELIEF, Blt_Offset(Button, activeRelief), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_CLOSEBUTTON_BORDERWIDTH, Blt_Offset(Button, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_CLOSEBUTTON_RELIEF,
- Blt_Offset(Button, relief), 0},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-#define NORMAL (0)
-#define ACTIVE (1<<0)
-#define DISABLED (1<<1)
-#define HIDE (1<<2)
-#define STATE_MASK (ACTIVE|DISABLED|HIDE)
-#define ONSCREEN (1<<3)
-#define TEAROFF_REDRAW (1<<4)
-
-typedef struct {
- const char *name; /* Identifier for tab. */
- Blt_HashEntry *hashPtr;
- int index; /* Index of the tab. */
- unsigned int flags;
- int tier; /* Index of tier [1..numTiers]
- * containing this tab. */
-
- int worldX, worldY; /* Position of tab in world
- * coordinates. */
- int worldWidth, worldHeight; /* Dimensions of the tab at 0 degree
- * rotation. It includes the *
- * border, padding, label, etc. */
- int screenX, screenY; /* Location of tab on screen. */
- int screenWidth;
- int screenHeight; /* */
-
- Tabset *setPtr; /* Tabset that includes this
- * tab. Needed for callbacks can pass
- * only a tab pointer. */
- /*
- * Tab label:
- */
- const char *text; /* String displayed as the tab's
- * label. */
- TextLayout *layoutPtr;
-
- Icon icon; /* Icon displayed as the label. */
-
- /* Dimensions of the tab label, corrected for side. */
- short int rotWidth, rotHeight;
-
- short int textWidth0, textHeight0;
- short int labelWidth0, labelHeight0;
- Blt_Pad iPadX, iPadY; /* Internal padding around the text */
-
- Blt_Font font;
-
- /*
- * Normal:
- */
- XColor *textColor; /* Text color */
- Blt_Background bg; /* Background color and border for
- * tab. */
- /*
- * Selected: Tab is currently selected.
- */
- XColor *selColor; /* Selected text color */
- Blt_Background selBg; /* 3D border of selected folder. */
-
- /*
- * Active: Mouse passes over the tab.
- */
- Blt_Background activeBg; /* Active background color. */
- XColor *activeFg; /* Active text color */
- Pixmap stipple; /* Stipple for outline of embedded
- * window when torn off. */
- /*
- * Embedded widget information:
- */
- Tk_Window tkwin; /* Widget to be mapped when the tab is
- * selected. If NULL, don't make
- * space for the page. */
- int reqSlaveWidth, reqSlaveHeight; /* If non-zero, overrides the
- * requested dimensions of the
- * embedded widget. */
- Tk_Window container; /* The window containing the embedded
- * widget. Does not necessarily have
- * to be the parent. */
- Tk_Anchor anchor; /* Anchor: indicates how the embedded
- * widget is positioned within the
- * extra space on the page. */
- Blt_Pad xPad, yPad; /* Padding around embedded widget. */
- int fill; /* Indicates how the window should
- * fill the page. */
-
- /*
- * Auxillary information:
- */
- Tcl_Obj *cmdObjPtr; /* Command invoked when the tab is
- * selected */
- const char *data; /* This value isn't used in C code.
- * It may be used by clients in Tcl
- * bindings * to associate extra data
- * (other than the * label or name)
- * with the tab. */
-
- Tcl_Obj *closeObjPtr; /* Command to be executed when the tab
- * is closed. */
- Blt_ChainLink link; /* Pointer to where the tab resides in
- * the list of tabs. */
- Tcl_Obj *perfCmdObjPtr; /* Command invoked when the tab is
- * selected */
- GC textGC;
- GC backGC;
-
- /* Gadget positions and locations: */
- GadgetRegion buttonRegion;
- GadgetRegion textRegion;
- GadgetRegion iconRegion;
- GadgetRegion focusRegion;
-} Tab;
-
-static Blt_ConfigSpec tabSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_TAB_ACTIVEBACKGROUND,
- Blt_Offset(Tab, activeBg), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "ActiveForeground", DEF_TAB_ACTIVEFOREGROUND,
- Blt_Offset(Tab, activeFg), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor", DEF_TAB_ANCHOR,
- Blt_Offset(Tab, anchor), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- (char *)NULL, Blt_Offset(Tab, bg), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_BITMASK, "-closebutton", "closeButton", "CloseButton",
- DEF_TAB_CLOSEBUTTON, Blt_Offset(Tab, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)CLOSE_NEEDED},
- {BLT_CONFIG_OBJ, "-closecommand", "closeCommand", "CloseCommand",
- DEF_CLOSECOMMAND, Blt_Offset(Tab, closeObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-command", "command", "Command", DEF_TAB_COMMAND,
- Blt_Offset(Tab, cmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-data", "data", "data", DEF_TAB_DATA,
- Blt_Offset(Tab, data), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_FILL, "-fill", "fill", "Fill", DEF_TAB_FILL,
- Blt_Offset(Tab, fill), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", (char *)NULL,
- Blt_Offset(Tab, textColor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FONT, "-font", "font", "Font", (char *)NULL,
- Blt_Offset(Tab, font), 0},
- {BLT_CONFIG_CUSTOM, "-image", "image", "Image", DEF_TAB_IMAGE,
- Blt_Offset(Tab, icon), BLT_CONFIG_NULL_OK, &iconOption},
- {BLT_CONFIG_PAD, "-ipadx", "iPadX", "PadX", DEF_TAB_IPAD,
- Blt_Offset(Tab, iPadX), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-ipady", "iPadY", "PadY", DEF_TAB_IPAD,
- Blt_Offset(Tab, iPadY), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-padx", "padX", "PadX", DEF_TAB_PAD,
- Blt_Offset(Tab, xPad), 0},
- {BLT_CONFIG_PAD, "-pady", "padY", "PadY", DEF_TAB_PAD,
- Blt_Offset(Tab, yPad), 0},
- {BLT_CONFIG_OBJ, "-perforationcommand", "perforationcommand",
- "PerforationCommand", DEF_TAB_PERFORATIONCOMMAND,
- Blt_Offset(Tab, perfCmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BACKGROUND, "-selectbackground", "selectBackground",
- "Background", DEF_TAB_SELECTBACKGROUND, Blt_Offset(Tab, selBg),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground", "Foreground",
- DEF_TAB_SELECTFOREGROUND, Blt_Offset(Tab, selColor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-state", "state", "State", DEF_TAB_STATE,
- Blt_Offset(Tab, flags), BLT_CONFIG_DONT_SET_DEFAULT, &stateOption},
- {BLT_CONFIG_BITMAP, "-stipple", "stipple", "Stipple", DEF_TAB_STIPPLE,
- Blt_Offset(Tab, stipple), 0},
- {BLT_CONFIG_STRING, "-text", "Text", "Text", DEF_TAB_TEXT,
- Blt_Offset(Tab, text), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-window", "window", "Window", DEF_TAB_WINDOW,
- Blt_Offset(Tab, tkwin), BLT_CONFIG_NULL_OK, &childOption},
- {BLT_CONFIG_PIXELS_NNEG, "-windowheight", "windowHeight", "WindowHeight",
- DEF_TAB_WINDOWHEIGHT, Blt_Offset(Tab, reqSlaveHeight),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-windowwidth", "windowWidth", "WindowWidth",
- DEF_TAB_WINDOWWIDTH, Blt_Offset(Tab, reqSlaveWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-/*
- * TabStyle --
- */
-typedef struct {
- Tk_Window tkwin; /* Default window to map pages. */
-
- int borderWidth; /* Width of 3D border around the tab's
- * label. */
- int pad; /* Extra padding of a tab entry */
-
- Blt_Font font;
-
- XColor *textColor;
- Blt_Background bg; /* Normal background. */
-
- XColor *selColor; /* Selected foreground. */
- Blt_Background selBg; /* Selected background. */
-
- Blt_Background activeBg; /* Active background. */
- XColor *activeFg; /* Active foreground. */
-
- Blt_Dashes dashes;
- GC activeGC;
- int relief;
- Tcl_Obj *cmdObjPtr; /* Command invoked when the tab is
- * selected */
- Tcl_Obj *perfCmdObjPtr;
-
-} TabStyle;
-
-struct _Tabset {
- Tk_Window tkwin; /* Window that embodies the widget.
- * NULL means that the window has been
- * destroyed but the data structures
- * haven't yet been cleaned up.*/
-
- Display *display; /* Display containing widget; needed,
- * among other things, to release
- * resources after tkwin has already
- * gone away. */
-
- Tcl_Interp *interp; /* Interpreter associated with
- * widget. */
-
- Tcl_Command cmdToken; /* Token for widget's command. */
-
- unsigned int flags; /* For bitfield definitions, see
- * below */
-
- short int inset; /* Total width of all borders,
- * including traversal highlight and
- * 3-D border. Indicates how much
- * interior stuff must be offset from
- * outside edges to leave room for
- * borders. */
-
- short int inset2; /* Total width of 3-D folder border +
- * corner, Indicates how much interior
- * stuff must be offset from outside
- * edges of folder.*/
-
- short int ySelectPad2; /* Extra offset for selected tab. Only
- * for single tiers. */
-
- short int pageTop; /* Offset from top of tabset to the
- * start of the page. */
- short int xOffset, yOffset; /* Offset of pixmap buffer to top of
- * window. */
-
- Blt_Painter painter;
-
- Tk_Cursor cursor; /* X Cursor */
-
- Blt_Background bg; /* 3D border surrounding the
- * window. */
- int borderWidth; /* Width of 3D border. */
- int relief; /* 3D border relief. */
- XColor *shadowColor; /* Shadow color around folder. */
-
- int justify;
- int iconPos;
-
- float angle; /* Angle to rotate tab. This includes
- * the icon, text, and close
- * buttons. The tab can only be rotated
- * at right angles: 0, 90, 180, 270,
- * etc. */
- int quad;
- /*
- * Focus highlight ring
- */
- int highlightWidth; /* Width in pixels of highlight to
- * draw around widget when it has the
- * focus. <= 0 means don't draw a
- * highlight. */
- XColor *highlightBg; /* Color for drawing traversal
- * highlight area when highlight is
- * off. */
- XColor *highlightColor; /* Color for drawing traversal
- * highlight. */
-
- GC highlightGC; /* GC for focus highlight. */
-
- const char *takeFocus; /* Says whether to select this widget
- * during tab traveral operations.
- * This value isn't used in C code,
- * but for the widget's Tcl
- * bindings. */
-
-
- int side; /* Orientation of the tabset: either
- * SIDE_LEFT, SIDE_RIGHT, SIDE_TOP, or
- * SIDE_BOTTOM. */
- int reqSlant; /* Determines slant on either side
- * of tab. */
- int overlap; /* Amount of */
- int gap;
- int reqTabWidth; /* Requested tab size. */
- short int tabWidth, tabHeight;
- int xSelectPad, ySelectPad; /* Padding around label of the
- * selected tab. */
- int outerPad; /* Padding around the exterior of the
- * tabset and folder. */
-
- Button closeButton; /* Close tab button drawn on right
- * side of a tab. */
- Tcl_Obj *closeObjPtr; /* Command to be executed when the tab
- * is closed. */
-
- TabStyle defStyle; /* Global attribute information
- * specific to tabs. */
-
- int reqWidth, reqHeight; /* Requested dimensions of the tabset
- * window. */
- int pageWidth, pageHeight; /* Dimensions of a page in the
- * folder. */
- int reqPageWidth, reqPageHeight; /* Requested dimensions of a page. */
-
- int lastX, lastY;
-
- /*
- * Scrolling information:
- */
- int worldWidth;
- int scrollOffset; /* Offset of viewport in world
- * coordinates. */
- Tcl_Obj *scrollCmdObjPtr; /* Command strings to control
- * scrollbar.*/
- int scrollUnits; /* Smallest unit of scrolling for
- * tabs. */
-
- /*
- * Scanning information:
- */
- int scanAnchor; /* Scan anchor in screen coordinates. */
- int scanOffset; /* Offset of the start of the scan in
- * world coordinates.*/
- int corner; /* Number of pixels to offset next
- * point when drawing corners of the
- * folder. */
- int reqTiers; /* Requested number of tiers. Zero
- * means to dynamically scroll if
- * there are * too many tabs to be
- * display on a single * tier. */
- int nTiers; /* Actual number of tiers. */
- Blt_HashTable iconTable;
- Tab *plusPtr; /* Special tab always at end of tab
- * set. */
- Tab *selectPtr; /* The currently selected tab.
- * (i.e. its page is displayed). */
- Tab *activePtr; /* Tab last located under the pointer.
- * It is displayed with its active
- * foreground / background
- * colors. */
- Tab *activeButtonPtr; /* Tab where to pointer is located
- * over the close button. The button
- * is displayed with its active
- * foreground / background colors. */
- Tab *focusPtr; /* Tab currently receiving focus. */
- Tab *startPtr; /* The first tab on the first tier. */
- Blt_Chain chain; /* List of tab entries. Used to
- * arrange placement of tabs. */
- Blt_HashTable tabTable; /* Hash table of tab entries. Used for
- * lookups of tabs by name. */
- int nextId;
- int nVisible; /* Number of tabs that are currently
- * visible in the view port. */
- Blt_BindTable bindTable; /* Tab binding information */
- Blt_HashTable tagTable; /* Table of tags. */
- Blt_HashTable bindTagTable; /* Table of binding tags. */
-};
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "activeBackground", DEF_ACTIVEBACKGROUND,
- Blt_Offset(Tabset, defStyle.activeBg), 0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "activeForeground", DEF_ACTIVEFOREGROUND,
- Blt_Offset(Tabset, defStyle.activeFg), 0},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_BACKGROUND, Blt_Offset(Tabset, defStyle.bg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_BORDERWIDTH, Blt_Offset(Tabset, defStyle.borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-closebutton", "closeButton", "CloseButton",
- DEF_CLOSEBUTTON, Blt_Offset(Tabset, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)CLOSE_NEEDED},
- {BLT_CONFIG_OBJ, "-closecommand", "closeCommand", "CloseCommand",
- DEF_CLOSECOMMAND, Blt_Offset(Tabset, closeObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_CURSOR, Blt_Offset(Tabset, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_DASHES, "-dashes", "dashes", "Dashes", DEF_DASHES,
- Blt_Offset(Tabset, defStyle.dashes), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_FOREGROUND, Blt_Offset(Tabset, defStyle.textColor), 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font",
- DEF_FONT, Blt_Offset(Tabset, defStyle.font), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-gap", "gap", "Gap", DEF_GAP,
- Blt_Offset(Tabset, gap), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-height", "height", "Height", DEF_HEIGHT,
- Blt_Offset(Tabset, reqHeight), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_HIGHLIGHTBACKGROUND,
- Blt_Offset(Tabset, highlightBg), 0},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_HIGHLIGHTCOLOR, Blt_Offset(Tabset, highlightColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_HIGHLIGHTTHICKNESS,
- Blt_Offset(Tabset, highlightWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SIDE, "-iconposition", "iconPosition", "IconPosition",
- DEF_ICONPOSITION, Blt_Offset(Tabset, iconPos),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_JUSTIFY, "-justify", "Justify", "Justify", DEF_JUSTIFY,
- Blt_Offset(Tabset, justify), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-outerborderwidth", "outerBorderWidth",
- "OuterBorderWidth", DEF_BORDERWIDTH, Blt_Offset(Tabset, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-outerpad", "outerPad", "OuterPad", DEF_OUTERPAD,
- Blt_Offset(Tabset, outerPad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-outerrelief", "outerRelief", "OuterRelief",
- DEF_RELIEF, Blt_Offset(Tabset, relief), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-pageheight", "pageHeight", "PageHeight",
- DEF_PAGEHEIGHT, Blt_Offset(Tabset, reqPageHeight),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-pagewidth", "pageWidth", "PageWidth",
- DEF_PAGEWIDTH, Blt_Offset(Tabset, reqPageWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-perforationcommand", "perforationcommand",
- "PerforationCommand", DEF_TAB_PERFORATIONCOMMAND,
- Blt_Offset(Tabset, defStyle.perfCmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_TABRELIEF, Blt_Offset(Tabset, defStyle.relief), 0},
- {BLT_CONFIG_FLOAT, "-rotate", "rotate", "Rotate", DEF_ROTATE,
- Blt_Offset(Tabset, angle), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-tabwidth", "tabWidth", "TabWidth",
- DEF_TABWIDTH, Blt_Offset(Tabset, reqTabWidth),
- BLT_CONFIG_DONT_SET_DEFAULT, &tabWidthOption},
- {BLT_CONFIG_OBJ, "-scrollcommand", "scrollCommand", "ScrollCommand",
- (char *)NULL, Blt_Offset(Tabset, scrollCmdObjPtr),BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_POS, "-scrollincrement", "scrollIncrement",
- "ScrollIncrement", DEF_SCROLLINCREMENT,
- Blt_Offset(Tabset, scrollUnits), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-scrolltabs", "scrollTabs", "ScrollTabs",
- DEF_SCROLLTABS, Blt_Offset(Tabset, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)SCROLL_TABS},
- {BLT_CONFIG_BACKGROUND, "-selectbackground", "selectBackground",
- "Foreground", DEF_SELECTBACKGROUND, Blt_Offset(Tabset, defStyle.selBg),
- 0},
- {BLT_CONFIG_OBJ, "-selectcommand", "selectCommand", "SelectCommand",
- DEF_SELECTCOMMAND, Blt_Offset(Tabset, defStyle.cmdObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background",
- DEF_SELECTFOREGROUND, Blt_Offset(Tabset, defStyle.selColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-selectpadx", "selectPadX", "SelectPadX",
- DEF_SELECTPADX, Blt_Offset(Tabset, xSelectPad),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-selectpady", "selectPad", "SelectPad",
- DEF_SELECTPADY, Blt_Offset(Tabset, ySelectPad),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-shadowcolor", "shadowColor", "ShadowColor",
- DEF_SHADOWCOLOR, Blt_Offset(Tabset, shadowColor), 0},
- {BLT_CONFIG_BITMASK, "-showsingletab", "showSingleTab", "ShowSingleTab",
- DEF_SHOWSINGLETAB, Blt_Offset(Tabset, flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)SHOW_SINGLE_TAB},
- {BLT_CONFIG_SIDE, "-side", "side", "side", DEF_SIDE,
- Blt_Offset(Tabset, side), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-slant", "slant", "Slant", DEF_SLANT,
- Blt_Offset(Tabset, reqSlant), BLT_CONFIG_DONT_SET_DEFAULT,
- &slantOption},
- {BLT_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_TAKEFOCUS, Blt_Offset(Tabset, takeFocus), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMASK, "-tearoff", "tearoff", "Tearoff", DEF_TEAROFF,
- Blt_Offset(Tabset, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)TEAROFF},
- {BLT_CONFIG_INT_POS, "-tiers", "tiers", "Tiers", DEF_TIERS,
- Blt_Offset(Tabset, reqTiers), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-troughcolor", "troughColor", "TroughColor",
- DEF_TROUGHCOLOR, Blt_Offset(Tabset, bg), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-width", "width", "Width", DEF_WIDTH,
- Blt_Offset(Tabset, reqWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-/*
- * TabIterator --
- *
- * Tabs may be tagged with strings. A tab may have many tags. The
- * same tag may be used for many tabs.
- *
- */
-typedef enum {
- ITER_SINGLE, ITER_ALL, ITER_TAG, ITER_PATTERN,
-} IteratorType;
-
-typedef struct _Iterator {
- Tabset *setPtr; /* Tabset that we're iterating over. */
-
- IteratorType type; /* Type of iteration:
- * ITER_TAG By item tag.
- * ITER_ALL By every item.
- * ITER_SINGLE Single item: either
- * tag or index.
- * ITER_PATTERN Over a consecutive
- * range of indices.
- */
-
- Tab *startPtr; /* Starting item. Starting point of
- * search, saved if iterator is reused.
- * Used for ITER_ALL and ITER_SINGLE
- * searches. */
- Tab *endPtr; /* Ending item (inclusive). */
- Tab *nextPtr; /* Next item. */
- /* For tag-based searches. */
- char *tagName; /* If non-NULL, is the tag that we are
- * currently iterating over. */
- Blt_HashTable *tablePtr; /* Pointer to tag hash table. */
- Blt_HashSearch cursor; /* Search iterator for tag hash
- * table. */
- Blt_ChainLink link;
-} TabIterator;
-
-/* Forward Declarations */
-static Blt_BindPickProc PickTabProc;
-static Blt_BindTagProc GetTagsProc;
-static Tcl_CmdDeleteProc TabsetInstDeletedCmd;
-static Tcl_FreeProc DestroyTabset;
-static Tcl_FreeProc DestroyTearoff;
-static Tcl_IdleProc AdoptWindow;
-static Tcl_IdleProc DisplayTabset;
-static Tcl_IdleProc DisplayTearoff;
-static Tcl_ObjCmdProc TabsetCmd;
-static Tcl_ObjCmdProc TabsetInstCmd;
-static Tk_EventProc EmbeddedWidgetEventProc;
-static Tk_EventProc TabsetEventProc;
-static Tk_EventProc TearoffEventProc;
-static Tk_ImageChangedProc IconChangedProc;
-
-static void DrawLabel(Tabset *setPtr, Tab *tabPtr, Drawable drawable);
-static void DrawFolder(Tabset *setPtr, Tab *tabPtr, Drawable drawable);
-
-static void GetWindowRectangle(Tab *tabPtr, Tk_Window parent, int hasTearOff,
- XRectangle *rectPtr);
-static void ArrangeWindow(Tk_Window tkwin, XRectangle *rectPtr, int force);
-static void EventuallyRedraw(Tabset *setPtr);
-static void EventuallyRedrawTearoff(Tab *tabPtr);
-static void ComputeLayout(Tabset *setPtr);
-static void DrawOuterBorders(Tabset *setPtr, Drawable drawable);
-
-static int GetTabIterator(Tcl_Interp *interp, Tabset *setPtr, Tcl_Obj *objPtr,
- TabIterator *iterPtr);
-static int GetTabFromObj(Tcl_Interp *interp, Tabset *setPtr, Tcl_Obj *objPtr,
- Tab **tabPtrPtr);
-static void ComputeLabelOffsets(Tabset *setPtr, Tab *tabPtr);
-
-typedef int (TabsetCmdProc)(Tabset *setPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-/*
- *---------------------------------------------------------------------------
- *
- * WorldToScreen --
- *
- * Converts world coordinates to screen coordinates. Note that the world
- * view is always tabs side top.
- *
- * Results:
- * The screen coordinates are returned via *xScreenPtr and *yScreenPtr.
- *
- *---------------------------------------------------------------------------
- */
-static void
-WorldToScreen(Tabset *setPtr, int x, int y, int *xScreenPtr, int *yScreenPtr)
-{
- int sx, sy;
-
- sx = sy = 0; /* Suppress compiler warning. */
-
- /* Translate world X-Y to screen coordinates */
- /*
- * Note that the world X-coordinate is translated by the selected label's
- * X padding. This is done only to keep the scroll range is between 0.0
- * and 1.0, rather adding/subtracting the pad in various locations. It
- * may be changed back in the future.
- */
- x += setPtr->inset + setPtr->xSelectPad - setPtr->scrollOffset;
- y += setPtr->inset;
- if (setPtr->nTiers == 1) {
- y += setPtr->ySelectPad;
- }
- switch (setPtr->side) {
- case SIDE_TOP:
- sx = x, sy = y; /* Do nothing */
- break;
- case SIDE_RIGHT:
- sx = Tk_Width(setPtr->tkwin) - y;
- sy = x;
- break;
- case SIDE_LEFT:
- sy = x; sx = y; /* Flip coordinates */
- break;
- case SIDE_BOTTOM:
- sx = x;
- sy = Tk_Height(setPtr->tkwin) - y;
- break;
- }
- *xScreenPtr = sx;
- *yScreenPtr = sy;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Queues a request to redraw the widget at the next idle point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets redisplayed. Right now we don't do selective
- * redisplays: the whole window will be redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(Tabset *setPtr)
-{
- if ((setPtr->tkwin != NULL) && !(setPtr->flags & REDRAW_PENDING)) {
- setPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayTabset, setPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedrawTearoff --
- *
- * Queues a request to redraw the tearoff at the next idle point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets redisplayed. Right now we don't do selective
- * redisplays: the whole window will be redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedrawTearoff(Tab *tabPtr)
-{
- if ((tabPtr->tkwin != NULL) && !(tabPtr->flags & TEAROFF_REDRAW)) {
- tabPtr->flags |= TEAROFF_REDRAW;
- Tcl_DoWhenIdle(DisplayTearoff, tabPtr);
- }
-}
-
-static void
-FreeIcon(Tabset *setPtr, struct _Icon *iconPtr)
-{
- iconPtr->refCount--;
- if (iconPtr->refCount == 0) {
- Blt_DeleteHashEntry(&setPtr->iconTable, iconPtr->hashPtr);
- Tk_FreeImage(iconPtr->tkImage);
- if (iconPtr->picture != NULL) {
- Blt_FreePicture(iconPtr->picture);
- }
- Blt_Free(iconPtr);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconChangedProc
- *
- * This routine is called whenever an image displayed in a tab changes.
- * In this case, we assume that everything will change and queue a
- * request to re-layout and redraw the entire tabset.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-IconChangedProc(
- ClientData clientData,
- int x, int y, /* Not used. */
- int width, int height, /* Not used. */
- int imageWidth, int imageHeight) /* Not used. */
-{
- Tabset *setPtr = clientData;
-
- setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING | REDRAW_ALL);
- EventuallyRedraw(setPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetIcon --
- *
- * This is a wrapper procedure for Tk_GetImage. The problem is that if
- * the same image is used repeatedly in the same widget, the separate
- * instances are saved in a linked list. This makes it especially slow
- * to destroy the widget. As a workaround, this routine hashes the image
- * and maintains a reference count for it.
- *
- * Results:
- * Returns a pointer to the new image.
- *
- *---------------------------------------------------------------------------
- */
-static Icon
-GetIcon(Tabset *setPtr, Tcl_Interp *interp, Tk_Window tkwin, const char *name)
-{
- struct _Icon *iconPtr;
- int isNew;
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_CreateHashEntry(&setPtr->iconTable, name, &isNew);
- if (isNew) {
- Tk_Image tkImage;
- int width, height;
- Blt_Picture picture;
-
- tkImage = Tk_GetImage(interp, tkwin, name, IconChangedProc, setPtr);
- if (tkImage == NULL) {
- Blt_DeleteHashEntry(&setPtr->iconTable, hPtr);
- return NULL;
- }
- Tk_SizeOfImage(tkImage, &width, &height);
- iconPtr = Blt_AssertMalloc(sizeof(struct _Icon));
- iconPtr->tkImage = tkImage;
- iconPtr->hashPtr = hPtr;
- iconPtr->refCount = 1;
- iconPtr->width = width;
- iconPtr->height = height;
- iconPtr->picture = picture;
- iconPtr->angle = 0.0;
- iconPtr->picture = NULL;
- Blt_SetHashValue(hPtr, iconPtr);
- } else {
- iconPtr = Blt_GetHashValue(hPtr);
- iconPtr->refCount++;
- }
- return iconPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeIconProc --
- *
- * Releases the image if it's not being used anymore by this widget.
- * Note there may be several uses of the same image by many tabs.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The reference count is decremented and the image is freed is it's not
- * being used anymore.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-FreeIconProc(ClientData clientData, Display *display, char *widgRec, int offset)
-{
- Icon *iconPtr = (Icon *)(widgRec + offset);
- Tabset *setPtr = clientData;
-
- if (*iconPtr != NULL) {
- FreeIcon(setPtr, *iconPtr);
- *iconPtr = NULL;
- }
-}
-
-static Blt_HashTable *
-GetTagTable(Tabset *setPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&setPtr->tagTable, tagName);
- if (hPtr == NULL) {
- return NULL; /* No tag by name. */
- }
- return Blt_GetHashValue(hPtr);
-}
-
-static int
-HasTag(Tab *tabPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
-
- if (strcmp(tagName, "all") == 0) {
- return TRUE;
- }
- tablePtr = GetTagTable(tabPtr->setPtr, tagName);
- if (tablePtr == NULL) {
- return FALSE;
- }
- hPtr = Blt_FindHashEntry(tablePtr, (char *)tabPtr);
- if (hPtr == NULL) {
- return FALSE;
- }
- return TRUE;
-}
-
-static Blt_HashTable *
-AddTagTable(Tabset *setPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&setPtr->tagTable, tagName, &isNew);
- if (isNew) {
- tablePtr = Blt_AssertMalloc(sizeof(Blt_HashTable));
- Blt_InitHashTable(tablePtr, BLT_ONE_WORD_KEYS);
- Blt_SetHashValue(hPtr, tablePtr);
- } else {
- tablePtr = Blt_GetHashValue(hPtr);
- }
- return tablePtr;
-}
-
-static void
-AddTag(Tabset *setPtr, Tab *tabPtr, const char *tagName)
-{
- int isNew;
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
-
- tablePtr = AddTagTable(setPtr, tagName);
- hPtr = Blt_CreateHashEntry(tablePtr, (char *)tabPtr, &isNew);
- if (isNew) {
- Blt_SetHashValue(hPtr, tabPtr);
- }
-}
-
-
-static void
-ForgetTag(Tabset *setPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
-
- if (strcmp(tagName, "all") == 0) {
- return; /* Can't remove tag "all". */
- }
- hPtr = Blt_FindHashEntry(&setPtr->tagTable, tagName);
- if (hPtr == NULL) {
- return; /* No tag by name. */
- }
- tablePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(tablePtr);
- Blt_Free(tablePtr);
- Blt_DeleteHashEntry(&setPtr->tagTable, hPtr);
-}
-
-static void
-DestroyTags(Tabset *setPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(tablePtr);
- }
-}
-
-static void
-RemoveTag(Tab *tabPtr, const char *tagName)
-{
- Blt_HashTable *tablePtr;
- Tabset *setPtr;
-
- setPtr = tabPtr->setPtr;
- tablePtr = GetTagTable(setPtr, tagName);
- if (tablePtr != NULL) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(tablePtr, (char *)tabPtr);
- if (hPtr != NULL) {
- Blt_DeleteHashEntry(tablePtr, hPtr);
- }
- }
-}
-
-static void
-ClearTags(Tab *tabPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tabset *setPtr;
-
- setPtr = tabPtr->setPtr;
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tablePtr;
- Blt_HashEntry *h2Ptr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(tablePtr, (char *)tabPtr);
- if (h2Ptr != NULL) {
- Blt_DeleteHashEntry(tablePtr, h2Ptr);
- }
- }
-}
-
-static void
-AppendTags(Tabset *setPtr, Tab *tabPtr, Blt_List list)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- if (Blt_FindHashEntry(tablePtr, (char *)tabPtr) != NULL) {
- Blt_List_Append(list, Blt_GetHashKey(&setPtr->tagTable, hPtr), 0);
- }
- }
-}
-
-static ClientData
-MakeBindTag(Tabset *setPtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&setPtr->bindTagTable, tagName, &isNew);
- return Blt_GetHashKey(&setPtr->bindTagTable, hPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToIconProc --
- *
- * Converts an image name into a Tk image token.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToIconProc(
- ClientData clientData, /* Contains a pointer to the tabset containing
- * this image. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Window associated with the tabset. */
- Tcl_Obj *objPtr, /* String representation */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tabset *setPtr = clientData;
- Icon *iconPtr = (Icon *) (widgRec + offset);
- Icon icon;
- const char *string;
- int length;
-
- icon = NULL;
- string = Tcl_GetStringFromObj(objPtr, &length);
- if (length > 0) {
- icon = GetIcon(setPtr, interp, tkwin, string);
- if (icon == NULL) {
- return TCL_ERROR;
- }
- }
- *iconPtr = icon;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconToObj --
- *
- * Converts the Tk image back to a Tcl_Obj representation (i.e. its
- * name).
- *
- * Results:
- * The name of the image is returned as a Tcl_Obj.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-IconToObjProc(
- ClientData clientData, /* Pointer to tabset containing image. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tabset *setPtr = clientData;
- Icon *iconPtr = (Icon *) (widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (*iconPtr == NULL) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- const char *name;
-
- name = Blt_GetHashKey(&setPtr->iconTable, (*iconPtr)->hashPtr);
- objPtr = Tcl_NewStringObj(name, -1);
- }
- return objPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToSlantProc --
- *
- * Converts the slant style string into its numeric representation.
- *
- * Valid style strings are:
- *
- * "none" Both sides are straight.
- * "left" Left side is slanted.
- * "right" Right side is slanted.
- * "both" Both sides are slanted.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToSlantProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of
- * attribute. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- const char *string;
- char c;
- int *slantPtr = (int *)(widgRec + offset);
- int slant;
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'n') && (strncmp(string, "none", length) == 0)) {
- slant = SLANT_NONE;
- } else if ((c == 'l') && (strncmp(string, "left", length) == 0)) {
- slant = SLANT_LEFT;
- } else if ((c == 'r') && (strncmp(string, "right", length) == 0)) {
- slant = SLANT_RIGHT;
- } else if ((c == 'b') && (strncmp(string, "both", length) == 0)) {
- slant = SLANT_BOTH;
- } else {
- Tcl_AppendResult(interp, "bad argument \"", string,
- "\": should be \"none\", \"left\", \"right\", or \"both\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- *slantPtr &= ~SLANT_BOTH;
- *slantPtr |= slant;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SlantToObjProc --
- *
- * Returns the slant style string based upon the slant flags.
- *
- * Results:
- * The slant style string is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-SlantToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget structure record. */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int slant = *(int *)(widgRec + offset);
- const char *string;
-
- switch (slant & SLANT_BOTH) {
- case SLANT_LEFT: string = "left"; break;
- case SLANT_RIGHT: string = "right"; break;
- case SLANT_NONE: string = "none"; break;
- case SLANT_BOTH: string = "both"; break;
- default: string = "???"; break;
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToChildProc --
- *
- * Converts a window name into Tk window.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToChildProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window parent, /* Parent window */
- Tcl_Obj *objPtr, /* String representation. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tab *tabPtr = (Tab *)widgRec;
- Tk_Window *tkwinPtr = (Tk_Window *)(widgRec + offset);
- Tk_Window old, tkwin;
- Tabset *setPtr;
- const char *string;
-
- old = *tkwinPtr;
- tkwin = NULL;
- setPtr = tabPtr->setPtr;
- string = Tcl_GetString(objPtr);
- if (string[0] != '\0') {
- tkwin = Tk_NameToWindow(interp, string, parent);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (tkwin == old) {
- return TCL_OK;
- }
- /*
- * Allow only widgets that are children of the tabset to be embedded
- * into the page. This way we can make assumptions about the window
- * based upon its parent; either it's the tabset window or it has
- * been torn off.
- */
- parent = Tk_Parent(tkwin);
- if (parent != setPtr->tkwin) {
- Tcl_AppendResult(interp, "can't manage \"", Tk_PathName(tkwin),
- "\" in tabset \"", Tk_PathName(setPtr->tkwin), "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- Tk_ManageGeometry(tkwin, &tabMgrInfo, tabPtr);
- Tk_CreateEventHandler(tkwin, StructureNotifyMask,
- EmbeddedWidgetEventProc, tabPtr);
-
- /*
- * We need to make the window to exist immediately. If the window is
- * torn off (placed into another container window), the timing between
- * the container and the its new child (this window) gets tricky.
- * This should work for Tk 4.2.
- */
- Tk_MakeWindowExist(tkwin);
- }
- if (old != NULL) {
- if (tabPtr->container != NULL) {
- Tcl_EventuallyFree(tabPtr, DestroyTearoff);
- }
- Tk_DeleteEventHandler(old, StructureNotifyMask,
- EmbeddedWidgetEventProc, tabPtr);
- Tk_ManageGeometry(old, (Tk_GeomMgr *) NULL, tabPtr);
- Tk_UnmapWindow(old);
- }
- *tkwinPtr = tkwin;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChildToObjProc --
- *
- * Converts the Tk window back to a Tcl_Obj (i.e. its name).
- *
- * Results:
- * The name of the window is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ChildToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window parent, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tk_Window tkwin = *(Tk_Window *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (tkwin == NULL) {
- objPtr = Tcl_NewStringObj("", -1);
- } else {
- objPtr = Tcl_NewStringObj(Tk_PathName(tkwin), -1);
- }
- return objPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToTabWidthProc --
- *
- * Converts the tab width style string into its numeric representation.
- *
- * Valid width strings are:
- *
- * "variable" Tab width determined by text/image label.
- * "same" Tab width is max of all text/image labels.
- * "1i" Tab width is set to 1 inch.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTabWidthProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of
- * attribute. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- const char *string;
- char c;
- int *widthPtr = (int *)(widgRec + offset);
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- if ((c == 'v') && (strncmp(string, "variable", length) == 0)) {
- *widthPtr = TABWIDTH_VARIABLE;
- } else if ((c == 's') && (strncmp(string, "same", length) == 0)) {
- *widthPtr = TABWIDTH_SAME;
- } else if (Blt_GetPixelsFromObj(interp, tkwin, objPtr, PIXELS_POS,
- widthPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TabWidthToObjProc --
- *
- * Returns the tabwidth string based upon the tabwidth.
- *
- * Results:
- * The tabwidth string is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TabWidthToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget structure record. */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int width = *(int *)(widgRec + offset);
-
- switch (width) {
- case TABWIDTH_VARIABLE:
- return Tcl_NewStringObj("variable", 8);
- case TABWIDTH_SAME:
- return Tcl_NewStringObj("same", 4);
- default:
- return Tcl_NewIntObj(width);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToStateProc --
- *
- * Convert the string representation of an tab state into a flag.
- *
- * Results:
- * The return value is a standard TCL result. The state flags are
- * updated.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToStateProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results. */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing state. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tab *tabPtr = (Tab *)(widgRec);
- unsigned int *flagsPtr = (unsigned int *)(widgRec + offset);
- char *string;
- Tabset *setPtr;
- int flag;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "active") == 0) {
- flag = ACTIVE;
- } else if (strcmp(string, "disabled") == 0) {
- flag = DISABLED;
- } else if (strcmp(string, "hidden") == 0) {
- flag = HIDE;
- } else if (strcmp(string, "normal") == 0) {
- flag = NORMAL;
- } else {
- Tcl_AppendResult(interp, "unknown state \"", string,
- "\": should be active, disabled, hidden, or normal.",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (tabPtr->flags & flag) {
- return TCL_OK; /* State is already set to value. */
- }
- setPtr = tabPtr->setPtr;
- if (setPtr->activePtr != tabPtr) {
- setPtr->activePtr = NULL;
- }
- *flagsPtr &= ~STATE_MASK;
- *flagsPtr |= flag;
- if (flag == ACTIVE) {
- setPtr->activePtr = tabPtr;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StateToObjProc --
- *
- * Return the name of the style.
- *
- * Results:
- * The name representing the style is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-StateToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget information record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- unsigned int state = *(unsigned int *)(widgRec + offset);
- Tcl_Obj *objPtr;
-
- if (state & HIDE) {
- objPtr = Tcl_NewStringObj("hidden", -1);
- } else if (state & DISABLED) {
- objPtr = Tcl_NewStringObj("disabled", -1);
- } else if (state & ACTIVE) {
- objPtr = Tcl_NewStringObj("active", -1);
- } else {
- objPtr = Tcl_NewStringObj("normal", -1);
- }
- return objPtr;
-}
-
-static int
-WorldY(Tab *tabPtr)
-{
- int tier;
-
- tier = tabPtr->setPtr->nTiers - tabPtr->tier;
- return tier * tabPtr->setPtr->tabHeight;
-}
-
-static INLINE Tab *
-FirstTab(Tabset *setPtr, unsigned int hateFlags)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Tab *tabPtr;
-
- tabPtr = Blt_Chain_GetValue(link);
- if ((tabPtr->flags & hateFlags) == 0) {
- return tabPtr;
- }
- }
- return NULL;
-}
-
-static INLINE Tab *
-LastTab(Tabset *setPtr, unsigned int hateFlags)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_LastLink(setPtr->chain); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- Tab *tabPtr;
-
- tabPtr = Blt_Chain_GetValue(link);
- if ((tabPtr->flags & hateFlags) == 0) {
- return tabPtr;
- }
- }
- return NULL;
-}
-
-
-static Tab *
-NextTab(Tab *tabPtr, unsigned int hateFlags)
-{
- if (tabPtr != NULL) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_NextLink(tabPtr->link); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- tabPtr = Blt_Chain_GetValue(link);
- if ((tabPtr->flags & hateFlags) == 0) {
- return tabPtr;
- }
- }
- }
- return NULL;
-}
-
-static Tab *
-PrevTab(Tab *tabPtr, unsigned int hateFlags)
-{
- if (tabPtr != NULL) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_PrevLink(tabPtr->link); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- tabPtr = Blt_Chain_GetValue(link);
- if ((tabPtr->flags & hateFlags) == 0) {
- return tabPtr;
- }
- }
- }
- return NULL;
-}
-
-static INLINE Tab *
-BeginTab(Tabset *setPtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_FirstLink(setPtr->chain);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- return NULL;
-}
-
-static INLINE Tab *
-EndTab(Tabset *setPtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_LastLink(setPtr->chain);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- return NULL;
-}
-
-static Tab *
-StepTab(Tab *tabPtr)
-{
- if (tabPtr != NULL) {
- Blt_ChainLink link;
-
- link = Blt_Chain_NextLink(tabPtr->link);
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- }
- return NULL;
-}
-
-
-static void
-ReindexTabs(Tabset *setPtr)
-{
- int count;
- Tab *tabPtr;
-
- count = 0;
- for (tabPtr = FirstTab(setPtr, 0); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, 0)) {
- tabPtr->index = count;
- count++;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RenumberTiers --
- *
- * In multi-tier mode, we need to find the start of the tier containing
- * the newly selected tab.
- *
- * Tiers are draw from the last tier to the first, so that the the
- * lower-tiered tabs will partially cover the bottoms of tab directly
- * above it. This simplifies the drawing of tabs because we don't worry
- * how tabs are clipped by their neighbors.
- *
- * In addition, tabs are re-marked with the correct tier number.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Renumbering the tab's tier will change the vertical placement
- * of the tab (i.e. shift tiers).
- *
- *---------------------------------------------------------------------------
- */
-static void
-RenumberTiers(Tabset *setPtr, Tab *tabPtr)
-{
- int tier;
- Blt_ChainLink link, last;
-
- setPtr->focusPtr = setPtr->selectPtr = tabPtr;
- Blt_SetFocusItem(setPtr->bindTable, setPtr->focusPtr, NULL);
-
- tier = tabPtr->tier;
- for (link = Blt_Chain_PrevLink(tabPtr->link); link != NULL; link = last) {
- Tab *prevPtr;
-
- last = Blt_Chain_PrevLink(link);
- prevPtr = Blt_Chain_GetValue(link);
- if ((prevPtr == NULL) || (prevPtr->tier != tier)) {
- break;
- }
- tabPtr = prevPtr;
- }
- setPtr->startPtr = tabPtr;
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- tabPtr = Blt_Chain_GetValue(link);
- tabPtr->tier = (tabPtr->tier - tier + 1);
- if (tabPtr->tier < 1) {
- tabPtr->tier += setPtr->nTiers;
- }
- tabPtr->worldY = WorldY(tabPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PickTabProc --
- *
- * Searches the tab located within the given screen X-Y coordinates in
- * the viewport. Note that tabs overlap slightly, so that its important
- * to search from the innermost tier out.
- *
- * Results:
- * Returns the pointer to the tab. If the pointer isn't contained by any
- * tab, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static ClientData
-PickTabProc(ClientData clientData, int x, int y, ClientData *contextPtr)
-{
- Tabset *setPtr = clientData;
- Tab *tabPtr;
- int xSelPad, ySelPad;
-
- if (contextPtr != NULL) {
- *contextPtr = NULL;
- }
- tabPtr = setPtr->selectPtr;
- if ((setPtr->flags & TEAROFF) && (tabPtr != NULL) &&
- (tabPtr->container == NULL) && (tabPtr->tkwin != NULL)) {
- int top, bottom, left, right;
- int sx, sy;
-
- /* Check first for perforation on the selected tab. */
- WorldToScreen(setPtr, tabPtr->worldX + 2,
- tabPtr->worldY + tabPtr->worldHeight + 4, &sx, &sy);
- if (setPtr->side & (SIDE_TOP|SIDE_BOTTOM)) {
- left = sx - 2;
- right = left + tabPtr->screenWidth;
- top = sy - 4;
- bottom = sy + 4;
- } else {
- left = sx - 4;
- right = sx + 4;
- top = sy - 2;
- bottom = top + tabPtr->screenHeight;
- }
- if ((x >= left) && (y >= top) && (x < right) && (y < bottom)) {
- if (contextPtr != NULL) {
- *contextPtr = TAB_PERFORATION;
- }
- return setPtr->selectPtr;
- }
- }
- /* Adjust the label's area according to the tab's slant. */
- if (setPtr->side & (SIDE_RIGHT | SIDE_LEFT)) {
- y -= (setPtr->flags & SLANT_LEFT) ? setPtr->tabHeight : setPtr->inset2;
- } else {
- x -= (setPtr->flags & SLANT_LEFT) ? setPtr->tabHeight : setPtr->inset2;
- }
- for (tabPtr = FirstTab(setPtr, 0); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, 0)) {
- GadgetRegion *rPtr;
-
- if ((tabPtr->flags & ONSCREEN) == 0) {
- continue;
- }
- if ((x >= tabPtr->screenX) && (y >= tabPtr->screenY) &&
- (x <= (tabPtr->screenX + tabPtr->screenWidth)) &&
- (y < (tabPtr->screenY + tabPtr->screenHeight + 4 +
- setPtr->ySelectPad))) {
- if (contextPtr != NULL) {
- *contextPtr = TAB_LABEL;
- }
- rPtr = &tabPtr->buttonRegion;
- if ((tabPtr->flags & CLOSE_NEEDED) &&
- (x >= (tabPtr->screenX + rPtr->x)) &&
- (x < (tabPtr->screenX + rPtr->x + rPtr->w)) &&
- (y >= (tabPtr->screenY + rPtr->y)) &&
- (y < (tabPtr->screenY + rPtr->y + rPtr->h))) {
- *contextPtr = TAB_BUTTON;
- }
- return tabPtr;
- }
- }
- return NULL;
-}
-
-static Tab *
-TabLeft(Tab *tabPtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_PrevLink(tabPtr->link);
- if (link != NULL) {
- Tab *newPtr;
-
- newPtr = Blt_Chain_GetValue(link);
- /* Move only if the next tab is the same tier. */
- if (newPtr->tier == tabPtr->tier) {
- tabPtr = newPtr;
- }
- }
- return tabPtr;
-}
-
-static Tab *
-TabRight(Tab *tabPtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_NextLink(tabPtr->link);
- if (link != NULL) {
- Tab *newPtr;
-
- newPtr = Blt_Chain_GetValue(link);
- /* Move only if the next tab is on the same tier. */
- if (newPtr->tier == tabPtr->tier) {
- tabPtr = newPtr;
- }
- }
- return tabPtr;
-}
-
-static Tab *
-TabUp(Tab *tabPtr)
-{
- if (tabPtr != NULL) {
- Tabset *setPtr;
- int x, y;
- int worldX, worldY;
-
- setPtr = tabPtr->setPtr;
- worldX = tabPtr->worldX + (tabPtr->worldWidth / 2);
- worldY = tabPtr->worldY - (setPtr->tabHeight / 2);
- WorldToScreen(setPtr, worldX, worldY, &x, &y);
-
- tabPtr = (Tab *)PickTabProc(setPtr, x, y, NULL);
- if (tabPtr == NULL) {
- /*
- * We might have inadvertly picked the gap between two tabs, so if
- * the first pick fails, try again a little to the left.
- */
- WorldToScreen(setPtr, worldX + setPtr->gap, worldY, &x, &y);
- tabPtr = (Tab *)PickTabProc(setPtr, x, y, NULL);
- }
- if ((tabPtr == NULL) &&
- (setPtr->focusPtr->tier < (setPtr->nTiers - 1))) {
- worldY -= setPtr->tabHeight;
- WorldToScreen(setPtr, worldX, worldY, &x, &y);
- tabPtr = (Tab *)PickTabProc(setPtr, x, y, NULL);
- }
- if (tabPtr == NULL) {
- tabPtr = setPtr->focusPtr;
- }
- }
- return tabPtr;
-}
-
-static Tab *
-TabDown(Tab *tabPtr)
-{
- if (tabPtr != NULL) {
- Tabset *setPtr;
- int x, y;
- int worldX, worldY;
-
- setPtr = tabPtr->setPtr;
- worldX = tabPtr->worldX + (tabPtr->worldWidth / 2);
- worldY = tabPtr->worldY + (3 * setPtr->tabHeight) / 2;
- WorldToScreen(setPtr, worldX, worldY, &x, &y);
- tabPtr = (Tab *)PickTabProc(setPtr, x, y, NULL);
- if (tabPtr == NULL) {
- /*
- * We might have inadvertly picked the gap between two tabs, so if
- * the first pick fails, try again a little to the left.
- */
- WorldToScreen(setPtr, worldX - setPtr->gap, worldY, &x, &y);
- tabPtr = (Tab *)PickTabProc(setPtr, x, y, NULL);
- }
- if ((tabPtr == NULL) && (setPtr->focusPtr->tier > 2)) {
- worldY += setPtr->tabHeight;
- WorldToScreen(setPtr, worldX, worldY, &x, &y);
- tabPtr = (Tab *)PickTabProc(setPtr, x, y, NULL);
- }
- if (tabPtr == NULL) {
- tabPtr = setPtr->focusPtr;
- }
- }
- return tabPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextTaggedTab --
- *
- * Returns the next tab derived from the given tag.
- *
- * Results:
- * Returns the pointer to the next tab in the iterator. If no more tabs
- * are available, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Tab *
-NextTaggedTab(TabIterator *iterPtr)
-{
- switch (iterPtr->type) {
- case ITER_TAG:
- {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_NextHashEntry(&iterPtr->cursor);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- break;
- }
- case ITER_ALL:
- if (iterPtr->link != NULL) {
- Tab *tabPtr;
-
- tabPtr = Blt_Chain_GetValue(iterPtr->link);
- iterPtr->link = Blt_Chain_NextLink(iterPtr->link);
- return tabPtr;
- }
- break;
- case ITER_PATTERN:
- {
- Blt_ChainLink link;
-
- for (link = iterPtr->link; link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Tab *tabPtr;
-
- tabPtr = Blt_Chain_GetValue(iterPtr->link);
- if (Tcl_StringMatch(tabPtr->text, iterPtr->tagName)) {
- iterPtr->link = Blt_Chain_NextLink(link);
- return tabPtr;
- }
- }
- break;
- }
- default:
- break;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FirstTaggedTab --
- *
- * Returns the first tab derived from the given tag.
- *
- * Results:
- * Returns the first tab in the sequence. If no more tabs are in
- * the list, then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Tab *
-FirstTaggedTab(TabIterator *iterPtr)
-{
- switch (iterPtr->type) {
- case ITER_TAG:
- {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FirstHashEntry(iterPtr->tablePtr, &iterPtr->cursor);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- }
-
- case ITER_ALL:
- if (iterPtr->link != NULL) {
- Tab *tabPtr;
-
- tabPtr = Blt_Chain_GetValue(iterPtr->link);
- iterPtr->link = Blt_Chain_NextLink(iterPtr->link);
- return tabPtr;
- }
- break;
-
- case ITER_PATTERN:
- {
- Blt_ChainLink link;
-
- for (link = iterPtr->link; link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Tab *tabPtr;
-
- tabPtr = Blt_Chain_GetValue(iterPtr->link);
- if (Tcl_StringMatch(tabPtr->text, iterPtr->tagName)) {
- iterPtr->link = Blt_Chain_NextLink(link);
- return tabPtr;
- }
- }
- break;
- }
- case ITER_SINGLE:
- return iterPtr->startPtr;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTabFromObj --
- *
- * Gets the tab associated the given index, tag, or label. This routine
- * is used when you want only one tab. It's an error if more than one
- * tab is specified (e.g. "all" tag or range "1:4"). It's also an error
- * if the tag is empty (no tabs are currently tagged).
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetTabFromObj(Tcl_Interp *interp, Tabset *setPtr, Tcl_Obj *objPtr,
- Tab **tabPtrPtr)
-{
- TabIterator iter;
- Tab *firstPtr;
-
- if (GetTabIterator(interp, setPtr, objPtr, &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- firstPtr = FirstTaggedTab(&iter);
- if (firstPtr != NULL) {
- Tab *nextPtr;
-
- nextPtr = NextTaggedTab(&iter);
- if (nextPtr != NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "multiple tabs specified by \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- }
- *tabPtrPtr = firstPtr;
- return TCL_OK;
-}
-
-static int
-GetTabByIndex(Tcl_Interp *interp, Tabset *setPtr, const char *string,
- int length, Tab **tabPtrPtr)
-{
- Tab *tabPtr;
- char c;
- long pos;
-
- tabPtr = NULL;
- c = string[0];
- length = strlen(string);
- if (Tcl_GetLong(NULL, string, &pos) == TCL_OK) {
- Blt_ChainLink link;
-
- link = Blt_Chain_GetNthLink(setPtr->chain, pos);
- if (link != NULL) {
- tabPtr = Blt_Chain_GetValue(link);
- }
- if (tabPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find tab: bad index \"",
- string, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- } else if ((c == 'a') && (strncmp(string, "active", length) == 0)) {
- tabPtr = setPtr->activePtr;
- } else if ((c == 'c') && (strncmp(string, "current", length) == 0)) {
- tabPtr = (Tab *)Blt_GetCurrentItem(setPtr->bindTable);
- } else if ((c == 'd') && (strncmp(string, "down", length) == 0)) {
- switch (setPtr->side) {
- case SIDE_LEFT:
- case SIDE_RIGHT:
- tabPtr = TabRight(setPtr->focusPtr);
- break;
-
- case SIDE_BOTTOM:
- tabPtr = TabUp(setPtr->focusPtr);
- break;
-
- case SIDE_TOP:
- tabPtr = TabDown(setPtr->focusPtr);
- break;
- }
- } else if ((c == 'f') && (length > 1) &&
- (strncmp(string, "focus", length) == 0)) {
- tabPtr = setPtr->focusPtr;
- } else if ((c == 'f') && (length > 1) &&
- (strncmp(string, "first", length) == 0)) {
- tabPtr = FirstTab(setPtr, HIDE | DISABLED);
- } else if ((c == 's') && (strncmp(string, "selected", length) == 0)) {
- tabPtr = setPtr->selectPtr;
- } else if ((c == 'l') && (length > 1) &&
- (strncmp(string, "last", length) == 0)) {
- tabPtr = LastTab(setPtr, HIDE | DISABLED);
- } else if ((c == 'l') && (length > 1) &&
- (strncmp(string, "left", length) == 0)) {
- switch (setPtr->side) {
- case SIDE_LEFT:
- tabPtr = TabUp(setPtr->focusPtr);
- break;
-
- case SIDE_RIGHT:
- tabPtr = TabDown(setPtr->focusPtr);
- break;
-
- case SIDE_BOTTOM:
- case SIDE_TOP:
- tabPtr = TabLeft(setPtr->focusPtr);
- break;
- }
- } else if ((c == 'n') && (strncmp(string, "none", length) == 0)) {
- tabPtr = NULL;
- } else if ((c == 'r') && (strncmp(string, "right", length) == 0)) {
- switch (setPtr->side) {
- case SIDE_LEFT:
- tabPtr = TabDown(setPtr->focusPtr);
- break;
-
- case SIDE_RIGHT:
- tabPtr = TabUp(setPtr->focusPtr);
- break;
-
- case SIDE_BOTTOM:
- case SIDE_TOP:
- tabPtr = TabRight(setPtr->focusPtr);
- break;
- }
- } else if ((c == 'u') && (strncmp(string, "up", length) == 0)) {
- switch (setPtr->side) {
- case SIDE_LEFT:
- case SIDE_RIGHT:
- tabPtr = TabLeft(setPtr->focusPtr);
- break;
-
- case SIDE_BOTTOM:
- tabPtr = TabDown(setPtr->focusPtr);
- break;
-
- case SIDE_TOP:
- tabPtr = TabUp(setPtr->focusPtr);
- break;
- }
- } else if (c == '@') {
- int x, y;
-
- if (Blt_GetXY(interp, setPtr->tkwin, string, &x, &y) != TCL_OK) {
- return TCL_ERROR;
- }
- tabPtr = (Tab *)PickTabProc(setPtr, x, y, NULL);
- } else {
- return TCL_CONTINUE;
- }
- *tabPtrPtr = tabPtr;
- return TCL_OK;
-}
-
-static Tab *
-GetTabByName(Tabset *setPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&setPtr->tabTable, string);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTabIterator --
- *
- * Converts a string representing a tab index into an tab pointer. The
- * index may be in one of the following forms:
- *
- * number Tab at index in the list of tabs.
- * @x,y Tab closest to the specified X-Y screen coordinates.
- * "active" Tab where mouse pointer is located.
- * "posted" Tab is the currently posted cascade tab.
- * "next" Next tab from the focus tab.
- * "previous" Previous tab from the focus tab.
- * "end" Last tab.
- * "none" No tab.
- *
- * number Tab at position in the list of tabs.
- * @x,y Tab closest to the specified X-Y screen coordinates.
- * "active" Tab mouse is located over.
- * "focus" Tab is the widget's focus.
- * "select" Currently selected tab.
- * "right" Next tab from the focus tab.
- * "left" Previous tab from the focus tab.
- * "up" Next tab from the focus tab.
- * "down" Previous tab from the focus tab.
- * "end" Last tab in list.
- * "name:string" Tab named "string".
- * "index:number" Tab at index number in list of tabs.
- * "tag:string" Tab(s) tagged by "string".
- * "label:pattern" Tab(s) with label matching "pattern".
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned. The
- * pointer to the node is returned via tabPtrPtr. Otherwise, TCL_ERROR
- * is returned and an error message is left in interpreter's result
- * field.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetTabIterator(Tcl_Interp *interp, Tabset *setPtr, Tcl_Obj *objPtr,
- TabIterator *iterPtr)
-{
- Tab *tabPtr, *startPtr, *endPtr;
- Blt_HashTable *tablePtr;
- char *string;
- char c;
- int nBytes;
- int length;
- int result;
-
- iterPtr->setPtr = setPtr;
- iterPtr->type = ITER_SINGLE;
- iterPtr->tagName = Tcl_GetStringFromObj(objPtr, &nBytes);
- iterPtr->nextPtr = NULL;
- iterPtr->startPtr = iterPtr->endPtr = NULL;
-
- if (setPtr->focusPtr == NULL) {
- setPtr->focusPtr = setPtr->selectPtr;
- Blt_SetFocusItem(setPtr->bindTable, setPtr->focusPtr, NULL);
- }
- string = Tcl_GetStringFromObj(objPtr, &length);
- c = string[0];
- iterPtr->startPtr = iterPtr->endPtr = setPtr->activePtr;
- startPtr = endPtr = tabPtr = NULL;
- if (c == '\0') {
- startPtr = endPtr = NULL;
- }
- iterPtr->type = ITER_SINGLE;
- result = GetTabByIndex(interp, setPtr, string, length, &tabPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (result == TCL_OK) {
- iterPtr->startPtr = iterPtr->endPtr = tabPtr;
- return TCL_OK;
- }
- if ((c == 'a') && (strcmp(iterPtr->tagName, "all") == 0)) {
- iterPtr->type = ITER_ALL;
- iterPtr->link = Blt_Chain_FirstLink(setPtr->chain);
- } else if ((c == 'i') && (length > 6) &&
- (strncmp(string, "index:", 6) == 0)) {
- if (GetTabByIndex(interp, setPtr, string + 6, length - 6, &tabPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- iterPtr->startPtr = iterPtr->endPtr = tabPtr;
- } else if ((c == 'n') && (length > 5) &&
- (strncmp(string, "name:", 5) == 0)) {
- tabPtr = GetTabByName(setPtr, string + 5);
- if (tabPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find a tab name \"", string + 5,
- "\" in \"", Tk_PathName(setPtr->tkwin), "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- iterPtr->startPtr = iterPtr->endPtr = tabPtr;
- } else if ((c == 't') && (length > 4) &&
- (strncmp(string, "tag:", 4) == 0)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = GetTagTable(setPtr, string + 4);
- if (tablePtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find a tag \"", string + 5,
- "\" in \"", Tk_PathName(setPtr->tkwin), "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- iterPtr->tagName = string + 4;
- iterPtr->tablePtr = tablePtr;
- iterPtr->type = ITER_TAG;
- } else if ((c == 'l') && (length > 6) &&
- (strncmp(string, "label:", 6) == 0)) {
- iterPtr->link = Blt_Chain_FirstLink(setPtr->chain);
- iterPtr->tagName = string + 6;
- iterPtr->type = ITER_PATTERN;
- } else if ((tabPtr = GetTabByName(setPtr, string)) != NULL) {
- iterPtr->startPtr = iterPtr->endPtr = tabPtr;
- } else if ((tablePtr = GetTagTable(setPtr, string)) != NULL) {
- iterPtr->tagName = string;
- iterPtr->tablePtr = tablePtr;
- iterPtr->type = ITER_TAG;
- } else {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find tab index, name, or tag \"",
- string, "\" in \"", Tk_PathName(setPtr->tkwin), "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * GetTabFromObj --
- *
- * Converts a string representing a tab index into a tab pointer. The
- * index may be in one of the following forms:
- *
- * number Tab at position in the list of tabs.
- * @x,y Tab closest to the specified X-Y screen coordinates.
- * "active" Tab mouse is located over.
- * "focus" Tab is the widget's focus.
- * "select" Currently selected tab.
- * "right" Next tab from the focus tab.
- * "left" Previous tab from the focus tab.
- * "up" Next tab from the focus tab.
- * "down" Previous tab from the focus tab.
- * "end" Last tab in list.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned. The
- * pointer to the node is returned via tabPtrPtr. Otherwise, TCL_ERROR
- * is returned and an error message is left in interpreter's result
- * field.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetTabFromObj(Tabset *setPtr, Tcl_Obj *objPtr, Tab **tabPtrPtr, int allowNull)
-{
- Tab *tabPtr;
- Blt_ChainLink link;
- int position;
- char c;
- const char *string;
-
- string = Tcl_GetString(objPtr);
- c = string[0];
- tabPtr = NULL;
- if (setPtr->focusPtr == NULL) {
- setPtr->focusPtr = setPtr->selectPtr;
- Blt_SetFocusItem(setPtr->bindTable, setPtr->focusPtr, NULL);
- }
- if ((isdigit(UCHAR(c))) &&
- (Tcl_GetIntFromObj(setPtr->interp, objPtr, &position) == TCL_OK)) {
- link = Blt_Chain_GetNthLink(setPtr->chain, position);
- if (link == NULL) {
- Tcl_AppendResult(setPtr->interp, "can't find tab \"", string,
- "\" in \"", Tk_PathName(setPtr->tkwin),
- "\": no such index", (char *)NULL);
- return TCL_ERROR;
- }
- tabPtr = Blt_Chain_GetValue(link);
- } else if ((c == 'a') && (strcmp(string, "active") == 0)) {
- tabPtr = setPtr->activePtr;
- } else if ((c == 'c') && (strcmp(string, "current") == 0)) {
- tabPtr = (Tab *)Blt_GetCurrentItem(setPtr->bindTable);
- } else if ((c == 's') && (strcmp(string, "select") == 0)) {
- tabPtr = setPtr->selectPtr;
- } else if ((c == 'f') && (strcmp(string, "focus") == 0)) {
- tabPtr = setPtr->focusPtr;
- } else if ((c == 'u') && (strcmp(string, "up") == 0)) {
- switch (setPtr->side) {
- case SIDE_LEFT:
- case SIDE_RIGHT:
- tabPtr = TabLeft(setPtr->focusPtr);
- break;
-
- case SIDE_BOTTOM:
- tabPtr = TabDown(setPtr->focusPtr);
- break;
-
- case SIDE_TOP:
- tabPtr = TabUp(setPtr->focusPtr);
- break;
- }
- } else if ((c == 'd') && (strcmp(string, "down") == 0)) {
- switch (setPtr->side) {
- case SIDE_LEFT:
- case SIDE_RIGHT:
- tabPtr = TabRight(setPtr->focusPtr);
- break;
-
- case SIDE_BOTTOM:
- tabPtr = TabUp(setPtr->focusPtr);
- break;
-
- case SIDE_TOP:
- tabPtr = TabDown(setPtr->focusPtr);
- break;
- }
- } else if ((c == 'l') && (strcmp(string, "left") == 0)) {
- switch (setPtr->side) {
- case SIDE_LEFT:
- tabPtr = TabUp(setPtr->focusPtr);
- break;
-
- case SIDE_RIGHT:
- tabPtr = TabDown(setPtr->focusPtr);
- break;
-
- case SIDE_BOTTOM:
- case SIDE_TOP:
- tabPtr = TabLeft(setPtr->focusPtr);
- break;
- }
- } else if ((c == 'r') && (strcmp(string, "right") == 0)) {
- switch (setPtr->side) {
- case SIDE_LEFT:
- tabPtr = TabDown(setPtr->focusPtr);
- break;
-
- case SIDE_RIGHT:
- tabPtr = TabUp(setPtr->focusPtr);
- break;
-
- case SIDE_BOTTOM:
- case SIDE_TOP:
- tabPtr = TabRight(setPtr->focusPtr);
- break;
- }
- } else if ((c == 'e') && (strcmp(string, "end") == 0)) {
- tabPtr = LastTab(setPtr, 0);
- } else if (c == '@') {
- int x, y;
-
- if (Blt_GetXY(setPtr->interp, setPtr->tkwin, string, &x, &y)
- != TCL_OK) {
- return TCL_ERROR;
- }
- tabPtr = (Tab *)PickTabProc(setPtr, x, y, NULL);
- } else {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&setPtr->tabTable, string);
- if (hPtr != NULL) {
- tabPtr = Blt_GetHashValue(hPtr);
- }
- }
- *tabPtrPtr = tabPtr;
- Tcl_ResetResult(setPtr->interp);
-
- if ((!allowNull) && (tabPtr == NULL)) {
- Tcl_AppendResult(setPtr->interp, "can't find tab \"", string,
- "\" in \"", Tk_PathName(setPtr->tkwin), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-#endif
-
-static Tab *
-NextOrLastTab(Tab *tabPtr)
-{
- if (tabPtr->link != NULL) {
- Blt_ChainLink link;
-
- link = Blt_Chain_NextLink(tabPtr->link);
- if (link == NULL) {
- link = Blt_Chain_PrevLink(tabPtr->link);
- }
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- }
- return NULL;
-}
-
-static Tab *
-PreviousOrFirstTab(Tab *tabPtr)
-{
- if (tabPtr->link != NULL) {
- Blt_ChainLink link;
-
- link = Blt_Chain_PrevLink(tabPtr->link);
- if (link == NULL) {
- link = Blt_Chain_NextLink(tabPtr->link);
- }
- if (link != NULL) {
- return Blt_Chain_GetValue(link);
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EmbeddedWidgetEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * embedded widgets contained in the tabset.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When an embedded widget gets deleted, internal structures get cleaned
- * up. When it gets resized, the tabset is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EmbeddedWidgetEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Tab *tabPtr = clientData;
-
- if ((tabPtr == NULL) || (tabPtr->tkwin == NULL)) {
- return;
- }
- switch (eventPtr->type) {
- case ConfigureNotify:
- /*
- * If the window's requested size changes, redraw the window. But
- * only if it's currently the selected page.
- */
- if ((tabPtr->container == NULL) && (Tk_IsMapped(tabPtr->tkwin)) &&
- (tabPtr->setPtr->selectPtr == tabPtr)) {
- tabPtr->setPtr->flags |= REDRAW_ALL;
- EventuallyRedraw(tabPtr->setPtr);
- }
- break;
-
- case DestroyNotify:
- /*
- * Mark the tab as deleted by dereferencing the Tk window
- * pointer. Redraw the window only if the tab is currently visible.
- */
- if ((Tk_IsMapped(tabPtr->tkwin)) &&
- (tabPtr->setPtr->selectPtr == tabPtr)) {
- tabPtr->setPtr->flags |= REDRAW_ALL;
- EventuallyRedraw(tabPtr->setPtr);
- }
- Tk_DeleteEventHandler(tabPtr->tkwin, StructureNotifyMask,
- EmbeddedWidgetEventProc, tabPtr);
- tabPtr->tkwin = NULL;
- break;
-
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EmbeddedWidgetCustodyProc --
- *
- * This procedure is invoked when a tab window has been stolen by another
- * geometry manager. The information and memory associated with the tab
- * window is released.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the widget formerly associated with the tab window to
- * have its layout re-computed and arranged at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
- /* ARGSUSED */
-static void
-EmbeddedWidgetCustodyProc(ClientData clientData, Tk_Window tkwin)
-{
- Tab *tabPtr = clientData;
- Tabset *setPtr;
-
- if ((tabPtr == NULL) || (tabPtr->tkwin == NULL)) {
- return;
- }
- setPtr = tabPtr->setPtr;
- if (tabPtr->container != NULL) {
- Tcl_EventuallyFree(tabPtr, DestroyTearoff);
- }
- /*
- * Mark the tab as deleted by dereferencing the Tk window pointer. Redraw
- * the window only if the tab is currently visible.
- */
- if (tabPtr->tkwin != NULL) {
- if (Tk_IsMapped(tabPtr->tkwin) && (setPtr->selectPtr == tabPtr)) {
- setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING | REDRAW_ALL);
- EventuallyRedraw(setPtr);
- }
- Tk_DeleteEventHandler(tabPtr->tkwin, StructureNotifyMask,
- EmbeddedWidgetEventProc, tabPtr);
- tabPtr->tkwin = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EmbeddedWidgetGeometryProc --
- *
- * This procedure is invoked by Tk_GeometryRequest for tab windows
- * managed by the widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for tkwin, and all its managed siblings, to be repacked and
- * drawn at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
- /* ARGSUSED */
-static void
-EmbeddedWidgetGeometryProc(ClientData clientData, Tk_Window tkwin)
-{
- Tab *tabPtr = clientData;
-
- if ((tabPtr == NULL) || (tabPtr->tkwin == NULL)) {
- fprintf(stderr, "%s: line %d \"tkwin is null\"", __FILE__, __LINE__);
- return;
- }
- tabPtr->setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING | REDRAW_ALL);
- EventuallyRedraw(tabPtr->setPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyTab --
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyTab(Tabset *setPtr, Tab *tabPtr)
-{
- iconOption.clientData = setPtr;
- Blt_FreeOptions(tabSpecs, (char *)tabPtr, setPtr->display, 0);
- ClearTags(tabPtr);
- if (tabPtr->flags & TEAROFF_REDRAW) {
- Tcl_CancelIdleCall(DisplayTearoff, tabPtr);
- }
- if (tabPtr->container != NULL) {
- Tk_DestroyWindow(tabPtr->container);
- }
- if (tabPtr == setPtr->plusPtr) {
- setPtr->plusPtr = NULL; /* Indicate that the plus tab has now
- * been deleted. */
- }
- if (tabPtr->tkwin != NULL) {
- Tk_ManageGeometry(tabPtr->tkwin, (Tk_GeomMgr *)NULL, tabPtr);
- Tk_DeleteEventHandler(tabPtr->tkwin, StructureNotifyMask,
- EmbeddedWidgetEventProc, tabPtr);
- if (Tk_IsMapped(tabPtr->tkwin)) {
- Tk_UnmapWindow(tabPtr->tkwin);
- }
- }
- if (tabPtr == setPtr->activePtr) {
- setPtr->activePtr = NULL;
- }
- if (tabPtr == setPtr->selectPtr) {
- setPtr->selectPtr = PreviousOrFirstTab(tabPtr);
- }
- if (tabPtr == setPtr->focusPtr) {
- setPtr->focusPtr = setPtr->selectPtr;
- Blt_SetFocusItem(setPtr->bindTable, setPtr->focusPtr, NULL);
- }
- if (tabPtr == setPtr->startPtr) {
- setPtr->startPtr = NULL;
- }
- if (tabPtr->text != NULL) {
- Blt_Free(tabPtr->text);
- }
- if (tabPtr->textGC != NULL) {
- Tk_FreeGC(setPtr->display, tabPtr->textGC);
- }
- if (tabPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&setPtr->tabTable, tabPtr->hashPtr);
- }
- if (tabPtr->backGC != NULL) {
- Tk_FreeGC(setPtr->display, tabPtr->backGC);
- }
- if (tabPtr->link != NULL) {
- Blt_Chain_DeleteLink(setPtr->chain, tabPtr->link);
- }
- if (tabPtr->layoutPtr != NULL) {
- Blt_Free(tabPtr->layoutPtr);
- }
- Blt_DeleteBindings(setPtr->bindTable, tabPtr);
- Blt_Free(tabPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewTab --
- *
- * Creates a new tab structure. A tab contains information about the
- * state of the tab and its embedded window.
- *
- * Results:
- * Returns a pointer to the new tab structure.
- *
- *---------------------------------------------------------------------------
- */
-static Tab *
-NewTab(Tcl_Interp *interp, Tabset *setPtr, const char *tabName)
-{
- Tab *tabPtr;
- Blt_HashEntry *hPtr;
- int isNew;
- char string[200];
-
- if (tabName == NULL) {
- sprintf_s(string, 200, "tab%d", setPtr->nextId++);
- tabName = string;
- }
- hPtr = Blt_CreateHashEntry(&setPtr->tabTable, tabName, &isNew);
- if (!isNew) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "a tab \"", tabName,
- "\" already exists in \"", Tk_PathName(setPtr->tkwin), "\".",
- (char *)NULL);
- }
- return NULL;
- }
- tabPtr = Blt_AssertCalloc(1, sizeof(Tab));
- tabPtr->setPtr = setPtr;
- if (strcmp(tabName, "+") == 0) {
- setPtr->plusPtr = tabPtr;
- }
- tabPtr->text = Blt_AssertStrdup(tabName);
- tabPtr->fill = FILL_NONE;
- tabPtr->anchor = TK_ANCHOR_CENTER;
- tabPtr->container = NULL;
- tabPtr->flags = NORMAL | CLOSE_NEEDED;
- tabPtr->name = Blt_GetHashKey(&setPtr->tabTable, hPtr);
- Blt_SetHashValue(hPtr, tabPtr);
- tabPtr->hashPtr = hPtr;
- return tabPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BackgroundChangedProc
- *
- * Stub for image change notifications. Since we immediately draw the
- * image into a pixmap, we don't really care about image changes.
- *
- * It would be better if Tk checked for NULL proc pointers.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-BackgroundChangedProc(ClientData clientData)
-{
- Tabset *setPtr = clientData;
-
- if (setPtr->tkwin != NULL) {
- setPtr->flags |= REDRAW_ALL;
- EventuallyRedraw(setPtr);
- }
-}
-
-static int
-ConfigureTab(Tabset *setPtr, Tab *tabPtr)
-{
- Blt_Background bg;
- Blt_Font font;
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
-
- font = GETATTR(tabPtr, font);
- newGC = NULL;
- if (tabPtr->text != NULL) {
- XColor *colorPtr;
-
- gcMask = GCForeground | GCFont;
- colorPtr = GETATTR(tabPtr, textColor);
- gcValues.foreground = colorPtr->pixel;
- gcValues.font = Blt_FontId(font);
- newGC = Tk_GetGC(setPtr->tkwin, gcMask, &gcValues);
- }
- if (tabPtr->textGC != NULL) {
- Tk_FreeGC(setPtr->display, tabPtr->textGC);
- }
- tabPtr->textGC = newGC;
-
- gcMask = GCForeground | GCStipple | GCFillStyle;
- gcValues.fill_style = FillStippled;
- bg = GETATTR(tabPtr, bg);
- gcValues.foreground = Blt_BackgroundBorderColor(bg)->pixel;
- gcValues.stipple = tabPtr->stipple;
- newGC = Tk_GetGC(setPtr->tkwin, gcMask, &gcValues);
- if (tabPtr->backGC != NULL) {
- Tk_FreeGC(setPtr->display, tabPtr->backGC);
- }
- tabPtr->backGC = newGC;
-
- if (tabPtr->bg != NULL) {
- Blt_SetBackgroundChangedProc(tabPtr->bg, BackgroundChangedProc, setPtr);
- }
- if (Blt_ConfigModified(tabSpecs, "-image", "-*pad*", "-state",
- "-text", "-window*", (char *)NULL)) {
- setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING | REDRAW_ALL);
- }
- if (tabPtr->flags & HIDE) {
- if (setPtr->selectPtr == tabPtr) {
- setPtr->selectPtr = FirstTab(setPtr, HIDE | DISABLED);
- }
- if (setPtr->activePtr == tabPtr) {
- setPtr->activePtr = NULL;
- }
- }
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureButton --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) the widget.
- *
- * Results:
-
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for setPtr; old resources get freed, if there were any. The widget
- * is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyButton(Tabset *setPtr, Button *butPtr)
-{
- iconOption.clientData = setPtr;
- Blt_FreeOptions(buttonSpecs, (char *)butPtr, setPtr->display, 0);
- if (butPtr->active != butPtr->active0) {
- Blt_FreePicture(butPtr->active);
- }
- if (butPtr->normal != butPtr->normal0) {
- Blt_FreePicture(butPtr->normal);
- }
- if (butPtr->active0 != NULL) {
- Blt_FreePicture(butPtr->active0);
- }
- if (butPtr->normal0 != NULL) {
- Blt_FreePicture(butPtr->normal0);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureButton --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) the widget.
- *
- * Results:
-
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for setPtr; old resources get freed, if there were any. The widget
- * is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureButton(
- Tcl_Interp *interp, /* Interpreter to report errors. */
- Tabset *setPtr, /* Information about widget; may or
- * may not already have values for some
- * fields. */
- int objc,
- Tcl_Obj *const *objv,
- int flags)
-{
- Button *butPtr = &setPtr->closeButton;
-
- iconOption.clientData = setPtr;
- if (Blt_ConfigureWidgetFromObj(interp, setPtr->tkwin, buttonSpecs,
- objc, objv, (char *)butPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
-#ifdef notdef
- if ((setPtr->reqHeight > 0) && (setPtr->reqWidth > 0)) {
- Tk_GeometryRequest(setPtr->tkwin, setPtr->reqWidth, setPtr->reqHeight);
- }
-#endif
- setPtr->flags |= REDRAW_ALL;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TearoffEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * the tearoff widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the tearoff gets deleted, internal structures get cleaned up.
- * When it gets resized or exposed, it's redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TearoffEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Tab *tabPtr = clientData;
-
- if ((tabPtr == NULL) || (tabPtr->tkwin == NULL) ||
- (tabPtr->container == NULL)) {
- return;
- }
- switch (eventPtr->type) {
- case Expose:
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedrawTearoff(tabPtr);
- }
- break;
- case ConfigureNotify:
- EventuallyRedrawTearoff(tabPtr);
- break;
- case DestroyNotify:
- if (tabPtr->flags & TEAROFF_REDRAW) {
- tabPtr->flags &= ~TEAROFF_REDRAW;
- Tcl_CancelIdleCall(DisplayTearoff, clientData);
- }
- Tk_DestroyWindow(tabPtr->container);
- tabPtr->container = NULL;
- break;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetReqWidth --
- *
- * Returns the width requested by the embedded tab window and any
- * requested padding around it. This represents the requested width of
- * the page.
- *
- * Results:
- * Returns the requested width of the page.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetReqWidth(Tab *tabPtr)
-{
- int width;
-
- if (tabPtr->reqSlaveWidth > 0) {
- width = tabPtr->reqSlaveWidth;
- } else {
- width = Tk_ReqWidth(tabPtr->tkwin);
- }
- width += PADDING(tabPtr->xPad) +
- 2 * Tk_Changes(tabPtr->tkwin)->border_width;
- if (width < 1) {
- width = 1;
- }
- return width;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetReqHeight --
- *
- * Returns the height requested by the window and padding around the
- * window. This represents the requested height of the page.
- *
- * Results:
- * Returns the requested height of the page.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetReqHeight(Tab *tabPtr)
-{
- int height;
-
- if (tabPtr->reqSlaveHeight > 0) {
- height = tabPtr->reqSlaveHeight;
- } else {
- height = Tk_ReqHeight(tabPtr->tkwin);
- }
- height += PADDING(tabPtr->yPad) +
- 2 * Tk_Changes(tabPtr->tkwin)->border_width;
- if (height < 1) {
- height = 1;
- }
- return height;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TranslateAnchor --
- *
- * Translate the coordinates of a given bounding box based upon the
- * anchor specified. The anchor indicates where the given xy position
- * is in relation to the bounding box.
- *
- * nw --- n --- ne
- * | | x,y ---+
- * w center e | |
- * | | +-----+
- * sw --- s --- se
- *
- * Results:
- * The translated coordinates of the bounding box are returned.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TranslateAnchor(int dx, int dy, Tk_Anchor anchor, int *xPtr, int *yPtr)
-{
- int x, y;
-
- x = y = 0;
- switch (anchor) {
- case TK_ANCHOR_NW: /* Upper left corner */
- break;
- case TK_ANCHOR_W: /* Left center */
- y = (dy / 2);
- break;
- case TK_ANCHOR_SW: /* Lower left corner */
- y = dy;
- break;
- case TK_ANCHOR_N: /* Top center */
- x = (dx / 2);
- break;
- case TK_ANCHOR_CENTER: /* Centered */
- x = (dx / 2);
- y = (dy / 2);
- break;
- case TK_ANCHOR_S: /* Bottom center */
- x = (dx / 2);
- y = dy;
- break;
- case TK_ANCHOR_NE: /* Upper right corner */
- x = dx;
- break;
- case TK_ANCHOR_E: /* Right center */
- x = dx;
- y = (dy / 2);
- break;
- case TK_ANCHOR_SE: /* Lower right corner */
- x = dx;
- y = dy;
- break;
- }
- *xPtr = (*xPtr) + x;
- *yPtr = (*yPtr) + y;
-}
-
-static void
-GetWindowRectangle(Tab *tabPtr, Tk_Window parent, int hasTearOff,
- XRectangle *rectPtr)
-{
- int pad;
- Tabset *setPtr;
- int cavityWidth, cavityHeight;
- int width, height;
- int dx, dy;
- int x, y;
-
- setPtr = tabPtr->setPtr;
- pad = setPtr->inset + setPtr->inset2;
-
- x = y = 0; /* Suppress compiler warning. */
- if (!hasTearOff) {
- switch (setPtr->side) {
- case SIDE_RIGHT:
- case SIDE_BOTTOM:
- x = setPtr->inset + setPtr->inset2;
- y = setPtr->inset + setPtr->inset2;
- break;
-
- case SIDE_LEFT:
- x = setPtr->pageTop;
- y = setPtr->inset + setPtr->inset2;
- break;
-
- case SIDE_TOP:
- x = setPtr->inset + setPtr->inset2;
- y = setPtr->pageTop;
- break;
- }
-
- if (setPtr->side & (SIDE_LEFT | SIDE_RIGHT)) {
- cavityWidth = Tk_Width(setPtr->tkwin) - (setPtr->pageTop + pad);
- cavityHeight = Tk_Height(setPtr->tkwin) - (2 * pad);
- } else {
- cavityWidth = Tk_Width(setPtr->tkwin) - (2 * pad);
- cavityHeight = Tk_Height(setPtr->tkwin) - (setPtr->pageTop + pad);
- }
-
- } else {
- x = setPtr->inset + setPtr->inset2;
-#define TEAR_OFF_TAB_SIZE 5
- y = setPtr->inset + setPtr->inset2 + setPtr->outerPad +
- TEAR_OFF_TAB_SIZE;
- if (setPtr->nTiers == 1) {
- y += setPtr->ySelectPad;
- }
- cavityWidth = Tk_Width(parent) - (2 * pad);
- cavityHeight = Tk_Height(parent) - (y + pad);
- }
- cavityWidth -= PADDING(tabPtr->xPad);
- cavityHeight -= PADDING(tabPtr->yPad);
- if (cavityWidth < 1) {
- cavityWidth = 1;
- }
- if (cavityHeight < 1) {
- cavityHeight = 1;
- }
- width = GetReqWidth(tabPtr);
- height = GetReqHeight(tabPtr);
-
- /*
- * Resize the embedded window is of the following is true:
- *
- * 1) It's been torn off.
- * 2) The -fill option (horizontal or vertical) is set.
- * 3) the window is bigger than the cavity.
- */
- if ((hasTearOff) || (cavityWidth < width) || (tabPtr->fill & FILL_X)) {
- width = cavityWidth;
- }
- if ((hasTearOff) || (cavityHeight < height) || (tabPtr->fill & FILL_Y)) {
- height = cavityHeight;
- }
- dx = (cavityWidth - width);
- dy = (cavityHeight - height);
- if ((dx > 0) || (dy > 0)) {
- TranslateAnchor(dx, dy, tabPtr->anchor, &x, &y);
- }
- /* Remember that X11 windows must be at least 1 pixel. */
- if (width < 1) {
- width = 1;
- }
- if (height < 1) {
- height = 1;
- }
- rectPtr->x = (short)(x + tabPtr->padLeft);
- rectPtr->y = (short)(y + tabPtr->padTop);
- rectPtr->width = (short)width;
- rectPtr->height = (short)height;
-}
-
-static void
-ArrangeWindow(Tk_Window tkwin, XRectangle *rectPtr, int force)
-{
- if ((force) ||
- (rectPtr->x != Tk_X(tkwin)) ||
- (rectPtr->y != Tk_Y(tkwin)) ||
- (rectPtr->width != Tk_Width(tkwin)) ||
- (rectPtr->height != Tk_Height(tkwin))) {
- Tk_MoveResizeWindow(tkwin, rectPtr->x, rectPtr->y,
- rectPtr->width, rectPtr->height);
- }
- if (!Tk_IsMapped(tkwin)) {
- Tk_MapWindow(tkwin);
- }
-}
-
-
-/*ARGSUSED*/
-static void
-GetTagsProc(Blt_BindTable table, ClientData object, ClientData context,
- Blt_List list)
-{
- Tab *tabPtr = (Tab *)object;
- Tabset *setPtr;
-
- setPtr = table->clientData;
- if (context == TAB_PERFORATION) {
- Blt_List_Append(list, MakeBindTag(setPtr, "Perforation"), 0);
- } else if (context == TAB_BUTTON) {
- ClientData tag;
-
- Blt_List_Append(list, MakeBindTag(setPtr, "Button"), 0);
- tag = MakeBindTag(setPtr, tabPtr->name);
- Blt_List_Append(list, tag, 0);
- } else if (context == TAB_LABEL) {
- ClientData tag;
-
- tag = MakeBindTag(setPtr, tabPtr->name);
- Blt_List_Append(list, tag, 0);
- AppendTags(setPtr, tabPtr, list);
- Blt_List_Append(list, MakeBindTag(setPtr, "all"), 0);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TabsetEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * tabset widgets.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TabsetEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Tabset *setPtr = clientData;
-
- switch (eventPtr->type) {
- case Expose:
- setPtr->flags |= REDRAW_ALL;
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(setPtr);
- }
- break;
-
- case ConfigureNotify:
- setPtr->flags |= REDRAW_ALL;
- setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- EventuallyRedraw(setPtr);
- break;
-
- case FocusIn:
- case FocusOut:
- if (eventPtr->xfocus.detail != NotifyInferior) {
- if (eventPtr->type == FocusIn) {
- setPtr->flags |= FOCUS;
- } else {
- setPtr->flags &= ~FOCUS;
- }
- EventuallyRedraw(setPtr);
- }
- break;
-
- case DestroyNotify:
- if (setPtr->tkwin != NULL) {
- setPtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(setPtr->interp, setPtr->cmdToken);
- }
- if (setPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayTabset, setPtr);
- }
- Tcl_EventuallyFree(setPtr, DestroyTabset);
- break;
-
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyTabset --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the internal structure of the widget at a safe time (when
- * no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyTabset(DestroyData dataPtr)
-{
- Tabset *setPtr = (Tabset *)dataPtr;
- Tab *tabPtr;
- Blt_ChainLink link, next;
-
- if (setPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayTabset, setPtr);
- }
- iconOption.clientData = setPtr;
- Blt_FreeOptions(configSpecs, (char *)setPtr, setPtr->display, 0);
- if (setPtr->highlightGC != NULL) {
- Tk_FreeGC(setPtr->display, setPtr->highlightGC);
- }
- if (setPtr->defStyle.activeGC != NULL) {
- Blt_FreePrivateGC(setPtr->display, setPtr->defStyle.activeGC);
- }
- if (setPtr->painter != NULL) {
- Blt_FreePainter(setPtr->painter);
- }
- for (link = Blt_Chain_FirstLink(setPtr->chain); link != NULL; link = next) {
- next = Blt_Chain_NextLink(link);
- tabPtr = Blt_Chain_GetValue(link);
- tabPtr->link = NULL;
- tabPtr->hashPtr = NULL;
- DestroyTab(setPtr, tabPtr);
- }
- DestroyTags(setPtr);
- DestroyButton(setPtr, &setPtr->closeButton);
- Blt_Chain_Destroy(setPtr->chain);
- Blt_DestroyBindingTable(setPtr->bindTable);
- Blt_DeleteHashTable(&setPtr->iconTable);
- Blt_DeleteHashTable(&setPtr->tagTable);
- Blt_DeleteHashTable(&setPtr->bindTagTable);
- Blt_Free(setPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewTabset --
- *
- *---------------------------------------------------------------------------
- */
-static Tabset *
-NewTabset(Tcl_Interp *interp, Tk_Window tkwin)
-{
- Tabset *setPtr;
-
- setPtr = Blt_AssertCalloc(1, sizeof(Tabset));
- Tk_SetClass(tkwin, "Tabset");
- setPtr->borderWidth = setPtr->highlightWidth = 0;
- setPtr->corner = CORNER_OFFSET;
- setPtr->defStyle.borderWidth = 1;
- setPtr->defStyle.relief = TK_RELIEF_RAISED;
- setPtr->iconPos = SIDE_LEFT;
- setPtr->angle = 0.0f;
- setPtr->justify = TK_JUSTIFY_CENTER;
- setPtr->reqTabWidth = TABWIDTH_SAME;
- setPtr->reqTiers = 1;
- setPtr->reqSlant = SLANT_NONE;
- setPtr->display = Tk_Display(tkwin);
- setPtr->flags |= LAYOUT_PENDING | SCROLL_PENDING;
- setPtr->gap = GAP;
- setPtr->interp = interp;
- setPtr->relief = TK_RELIEF_FLAT;
- setPtr->scrollUnits = 2;
- setPtr->side = SIDE_TOP;
- setPtr->tkwin = tkwin;
- setPtr->closeButton.borderWidth = 0;
- setPtr->xSelectPad = SELECT_PADX;
- setPtr->ySelectPad = SELECT_PADY;
- setPtr->bindTable = Blt_CreateBindingTable(interp, tkwin, setPtr,
- PickTabProc, GetTagsProc);
- setPtr->chain = Blt_Chain_Create();
- Blt_InitHashTable(&setPtr->tabTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&setPtr->iconTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&setPtr->tagTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&setPtr->bindTagTable, BLT_STRING_KEYS);
- Blt_SetWindowInstanceData(tkwin, setPtr);
- return setPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureTabset --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) the widget.
- *
- * Results:
-
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for setPtr; old resources get freed, if there were any. The widget
- * is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureTabset(
- Tcl_Interp *interp, /* Interpreter to report errors. */
- Tabset *setPtr, /* Information about widget; may or may not
- * already have values for some fields. */
- int objc,
- Tcl_Obj *const *objv,
- int flags)
-{
- XGCValues gcValues;
- unsigned long gcMask;
- GC newGC;
- int slantLeft, slantRight;
-
- iconOption.clientData = setPtr;
- if (Blt_ConfigureWidgetFromObj(interp, setPtr->tkwin, configSpecs,
- objc, objv, (char *)setPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_ConfigModified(configSpecs, "-width", "-height", "-side", "-gap",
- "-slant", "-iconposition", "-rotate", "-tiers", "-tabwidth",
- "-scrolltabs", "-showsingletab", "-closebutton", "-justify",
- "-iconposition", (char *)NULL)) {
- setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- }
- if ((setPtr->reqHeight > 0) && (setPtr->reqWidth > 0)) {
- Tk_GeometryRequest(setPtr->tkwin, setPtr->reqWidth,
- setPtr->reqHeight);
- }
- /*
- * GC for focus highlight.
- */
- gcMask = GCForeground;
- gcValues.foreground = setPtr->highlightColor->pixel;
- newGC = Tk_GetGC(setPtr->tkwin, gcMask, &gcValues);
- if (setPtr->highlightGC != NULL) {
- Tk_FreeGC(setPtr->display, setPtr->highlightGC);
- }
- setPtr->highlightGC = newGC;
-
- if (setPtr->bg != NULL) {
- Blt_SetBackgroundChangedProc(setPtr->bg, BackgroundChangedProc, setPtr);
- }
- /*
- * GC for active line.
- */
- gcMask = GCForeground | GCLineWidth | GCLineStyle | GCCapStyle;
- gcValues.foreground = setPtr->defStyle.textColor->pixel;
- gcValues.line_width = 0;
- gcValues.cap_style = CapProjecting;
- gcValues.line_style = (LineIsDashed(setPtr->defStyle.dashes))
- ? LineOnOffDash : LineSolid;
-
- newGC = Blt_GetPrivateGC(setPtr->tkwin, gcMask, &gcValues);
- if (LineIsDashed(setPtr->defStyle.dashes)) {
- setPtr->defStyle.dashes.offset = 2;
- Blt_SetDashes(setPtr->display, newGC, &setPtr->defStyle.dashes);
- }
- if (setPtr->defStyle.activeGC != NULL) {
- Blt_FreePrivateGC(setPtr->display, setPtr->defStyle.activeGC);
- }
- setPtr->defStyle.activeGC = newGC;
-
- setPtr->angle = FMOD(setPtr->angle, 360.0);
- if (setPtr->angle < 0.0) {
- setPtr->angle += 360.0;
- }
- setPtr->quad = (int)(setPtr->angle / 90.0);
- setPtr->inset = setPtr->highlightWidth + setPtr->borderWidth +
- setPtr->outerPad;
-#ifndef notdef
- if (Blt_ConfigModified(configSpecs, "-font", "-*foreground", "-rotate",
- "-*background", "-side", "-iconposition", "-tiers", "-tabwidth",
- (char *)NULL)) {
- Tab *tabPtr;
-
- for (tabPtr = FirstTab(setPtr, 0); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, 0)) {
- ConfigureTab(setPtr, tabPtr);
- }
- setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING | REDRAW_ALL);
- }
-#endif
- /* Swap slant flags if side is left. */
- slantLeft = slantRight = FALSE;
- if (setPtr->reqSlant & SLANT_LEFT) {
- slantLeft = TRUE;
- }
- if (setPtr->reqSlant & SLANT_RIGHT) {
- slantRight = TRUE;
- }
- if (setPtr->side & SIDE_LEFT) {
- SWAP(slantLeft, slantRight);
- }
- setPtr->flags &= ~SLANT_BOTH;
- if (slantLeft) {
- setPtr->flags |= SLANT_LEFT;
- }
- if (slantRight) {
- setPtr->flags |= SLANT_RIGHT;
- }
- setPtr->inset2 = setPtr->defStyle.borderWidth + setPtr->corner;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Tabset operations
- *
- *---------------------------------------------------------------------------
- */
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateOp --
- *
- * Selects the tab to appear active.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ActivateOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- const char *string;
-
- string = Tcl_GetString(objv[2]);
- if (string[0] == '\0') {
- tabPtr = NULL;
- } else if (GetTabFromObj(interp, setPtr, objv[2], &tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((tabPtr != NULL) && (tabPtr->flags & (HIDE|DISABLED))) {
- tabPtr = NULL;
- }
- if (tabPtr != setPtr->activePtr) {
- setPtr->activePtr = tabPtr;
- EventuallyRedraw(setPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AddOp --
- *
- * Adds a new tab to the tabset widget. The tab is automatically
- * placed on the end of the tab list.
- *
- * .t add ?label? ?option-value...?
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-AddOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- const char *string;
-
- string = NULL;
- if (objc > 2) {
- const char *name;
-
- name = Tcl_GetString(objv[2]);
- if (name[0] != '-') {
- string = name;
- objc--, objv++;
- }
- }
- tabPtr = NewTab(interp, setPtr, string);
- if (tabPtr == NULL) {
- return TCL_ERROR;
- }
- iconOption.clientData = setPtr;
- if (Blt_ConfigureComponentFromObj(interp, setPtr->tkwin, tabPtr->name,
- "Tab", tabSpecs, objc-2, objv+2, (char *)tabPtr, 0) != TCL_OK) {
- DestroyTab(setPtr, tabPtr);
- return TCL_ERROR;
- }
- if (ConfigureTab(setPtr, tabPtr) != TCL_OK) {
- DestroyTab(setPtr, tabPtr);
- return TCL_ERROR;
- }
- tabPtr->link = Blt_Chain_Append(setPtr->chain, tabPtr);
- if (setPtr->plusPtr != NULL) {
- Blt_ChainLink link;
-
- /* Move plus tab to the end. */
- link = setPtr->plusPtr->link;
- Blt_Chain_UnlinkLink(setPtr->chain, link);
- Blt_Chain_AppendLink(setPtr->chain, link);
- }
- ReindexTabs(setPtr);
- setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING | REDRAW_ALL);
- EventuallyRedraw(setPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), tabPtr->name, -1);
- return TCL_OK;
-
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BindOp --
- *
- * .t bind index sequence command
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BindOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- ClientData tag;
-
- if (objc == 2) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Tcl_Obj *listObjPtr, *objPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- objPtr = Blt_GetHashValue(hPtr);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- tag = MakeBindTag(setPtr, Tcl_GetString(objv[2]));
- return Blt_ConfigureBindingsFromObj(interp, setPtr->bindTable, tag,
- objc - 3, objv + 3);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonActivateOp --
- *
- * This procedure is called to highlight the button.
- *
- * .h button activate tab
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ButtonActivateOp(Tabset *setPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- const char *string;
-
- string = Tcl_GetString(objv[3]);
- if (string[0] == '\0') {
- tabPtr = NULL;
- } else if (GetTabFromObj(interp, setPtr, objv[3], &tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((tabPtr != NULL) && (tabPtr->flags & (HIDE|DISABLED))) {
- tabPtr = NULL;
- }
- if (tabPtr != setPtr->activeButtonPtr) {
- setPtr->activeButtonPtr = tabPtr;
- EventuallyRedraw(setPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonCgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ButtonCgetOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- iconOption.clientData = setPtr;
- return Blt_ConfigureValueFromObj(interp, setPtr->tkwin, buttonSpecs,
- (char *)&setPtr->closeButton, objv[2], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonConfigureOp --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) the widget.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for setPtr; old resources get freed, if there were any. The widget
- * is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ButtonConfigureOp(Tabset *setPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- iconOption.clientData = setPtr;
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, setPtr->tkwin, buttonSpecs,
- (char *)&setPtr->closeButton, (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, setPtr->tkwin, buttonSpecs,
- (char *)&setPtr->closeButton, objv[2], 0);
- }
- if (ConfigureButton(interp, setPtr, objc - 3, objv + 3,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- setPtr->flags |= REDRAW_ALL;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonOp --
- *
- * This procedure handles tab operations.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec buttonOps[] =
-{
- {"activate", 1, ButtonActivateOp, 4, 4, "tab" },
- {"cget", 2, ButtonCgetOp, 4, 4, "option",},
- {"configure", 2, ButtonConfigureOp, 3, 0, "?option value?...",},
-};
-static int nButtonOps = sizeof(buttonOps) / sizeof(Blt_OpSpec);
-
-static int
-ButtonOp(Tabset *setPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TabsetCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nButtonOps, buttonOps,
- BLT_OP_ARG2, objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (setPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CgetOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- iconOption.clientData = setPtr;
- return Blt_ConfigureValueFromObj(interp, setPtr->tkwin, configSpecs,
- (char *)setPtr, objv[2], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CloseOp --
- *
- * Invokes a TCL command when a tab is closed.
- *
- * .t close tab
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then
- * interp->result contains an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CloseOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- Tcl_Obj *cmdObjPtr;
-
- if (GetTabFromObj(interp, setPtr, objv[2], &tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((tabPtr != NULL) && (tabPtr->flags & (HIDE|DISABLED))) {
- return TCL_OK;
- }
- cmdObjPtr = (tabPtr->closeObjPtr == NULL)
- ? setPtr->closeObjPtr : tabPtr->closeObjPtr;
- if (cmdObjPtr != NULL) {
- int result;
-
- cmdObjPtr = Tcl_DuplicateObj(cmdObjPtr);
- Tcl_ListObjAppendElement(interp, cmdObjPtr,
- Tcl_NewIntObj(tabPtr->index));
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- return result;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) the widget.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for setPtr; old resources get freed, if there were any. The widget
- * is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(Tabset *setPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- iconOption.clientData = setPtr;
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, setPtr->tkwin, configSpecs,
- (char *)setPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, setPtr->tkwin, configSpecs,
- (char *)setPtr, objv[2], 0);
- }
- if (ConfigureTabset(interp, setPtr, objc - 2, objv + 2,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- setPtr->flags |= REDRAW_ALL;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Deletes tab from the set. Deletes either a range of tabs or a single
- * node.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DeleteOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashTable delTable;
- int i;
-
- Blt_InitHashTable(&delTable, BLT_ONE_WORD_KEYS);
- for (i = 2; i < objc; i++) {
- TabIterator iter;
- Tab *tabPtr;
-
- if (GetTabIterator(interp, setPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (tabPtr = FirstTaggedTab(&iter); tabPtr != NULL;
- tabPtr = NextTaggedTab(&iter)) {
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&delTable, tabPtr, &isNew);
- Blt_SetHashValue(hPtr, tabPtr);
- }
- }
- if (delTable.numEntries > 0) {
- Blt_HashSearch iter;
- Blt_HashEntry *hPtr;
-
- for (hPtr = Blt_FirstHashEntry(&delTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Tab *tabPtr;
-
- tabPtr = Blt_GetHashValue(hPtr);
- DestroyTab(setPtr, tabPtr);
- }
- ReindexTabs(setPtr);
- setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING | REDRAW_ALL);
- EventuallyRedraw(setPtr);
- }
- Blt_DeleteHashTable(&delTable);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DockallOp --
- *
- * .h dockall
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DockallOp(Tabset *bookPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(bookPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- Tab *tabPtr;
-
- tabPtr = Blt_Chain_GetValue(link);
- if (tabPtr->container != NULL) {
- Tcl_EventuallyFree(tabPtr, DestroyTearoff);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- * Converts a string representing a tab index.
- *
- * Results:
- * A standard TCL result. Interp->result will contain the identifier of
- * each index found. If an index could not be found, then the serial
- * identifier will be the empty string.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ExistsOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- int state;
-
- state = FALSE;
- if (GetTabFromObj(NULL, setPtr, objv[2], &tabPtr) == TCL_OK) {
- if (tabPtr != NULL) {
- state = TRUE;
- }
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), state);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExtentsOp --
- *
- * Returns the extents of the tab in root coordinates.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ExtentsOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
-
- if (GetTabFromObj(interp, setPtr, objv[2], &tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (tabPtr == NULL) {
- Tcl_AppendResult(interp, "can't find a tab \"",
- Tcl_GetString(objv[2]), "\" in \"", Tk_PathName(setPtr->tkwin),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (tabPtr->flags & ONSCREEN) {
- Tcl_Obj *listObjPtr, *objPtr;
- int rootX, rootY;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tk_GetRootCoords(setPtr->tkwin, &rootX, &rootY);
- objPtr = Tcl_NewIntObj(tabPtr->screenX + rootX);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewIntObj(tabPtr->screenY + rootY);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewIntObj(tabPtr->screenX + rootX + tabPtr->screenWidth);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewIntObj(tabPtr->screenY + rootY + tabPtr->screenHeight);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FocusOp --
- *
- * Sets focus on the specified tab. A dotted outline will be drawn
- * around this tab.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-FocusOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- long index;
-
- if (objc == 3) {
- if (GetTabFromObj(interp, setPtr, objv[2], &tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((tabPtr != NULL) && ((tabPtr->flags & (DISABLED|HIDE)) == 0)) {
- setPtr->focusPtr = tabPtr;
- Blt_SetFocusItem(setPtr->bindTable, setPtr->focusPtr, NULL);
- EventuallyRedraw(setPtr);
- }
- }
- index = -1;
- if (setPtr->focusPtr != NULL) {
- index = setPtr->focusPtr->index;
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- * Converts a string representing a tab index.
- *
- * Results:
- * A standard TCL result. Interp->result will contain the identifier of
- * each index found. If an index could not be found, then the serial
- * identifier will be the empty string.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IndexOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- int index;
-
- index = -1;
- if (GetTabFromObj(NULL, setPtr, objv[2], &tabPtr) == TCL_OK) {
- if (tabPtr != NULL) {
- index = tabPtr->index;
- }
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), index);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IdOp --
- *
- * Converts a tab index into the tab identifier.
- *
- * Results:
- * A standard TCL result. Interp->result will contain the identifier of
- * each index found. If an index could not be found, then the serial
- * identifier will be the empty string.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IdOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
-
- if (GetTabFromObj(interp, setPtr, objv[2], &tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (tabPtr == NULL) {
- Tcl_AppendResult(interp, "can't find a tab \"",
- Tcl_GetString(objv[2]), "\" in \"", Tk_PathName(setPtr->tkwin),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), tabPtr->name, -1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InsertOp --
- *
- * Add new entries into a tab set.
- *
- * .t insert position ?label? option-value label option-value...
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InsertOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- Blt_ChainLink link, before;
- char c;
- const char *string;
-
- string = Tcl_GetString(objv[2]);
- c = string[0];
- if ((c == 'e') && (strcmp(string, "end") == 0)) {
- before = NULL;
- } else if (isdigit(UCHAR(c))) {
- int pos;
-
- if (Tcl_GetIntFromObj(interp, objv[2], &pos) != TCL_OK) {
- return TCL_ERROR;
- }
- if (pos < 0) {
- before = Blt_Chain_FirstLink(setPtr->chain);
- } else if (pos > Blt_Chain_GetLength(setPtr->chain)) {
- before = NULL;
- } else {
- before = Blt_Chain_GetNthLink(setPtr->chain, pos);
- }
- } else {
- Tab *beforePtr;
-
- if (GetTabFromObj(interp, setPtr, objv[2], &beforePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (beforePtr == NULL) {
- Tcl_AppendResult(interp, "can't find a tab \"",
- Tcl_GetString(objv[2]), "\" in \"", Tk_PathName(setPtr->tkwin),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- before = beforePtr->link;
- }
- string = NULL;
- if (objc > 3) {
- const char *name;
-
- name = Tcl_GetString(objv[3]);
- if (name[0] != '-') {
- string = name;
- objc--, objv++;
- }
- }
- tabPtr = NewTab(interp, setPtr, string);
- if (tabPtr == NULL) {
- return TCL_ERROR;
- }
- setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING | REDRAW_ALL);
- EventuallyRedraw(setPtr);
- iconOption.clientData = setPtr;
- if (Blt_ConfigureComponentFromObj(interp, setPtr->tkwin, tabPtr->name, "Tab",
- tabSpecs, objc - 3, objv + 3, (char *)tabPtr, 0) != TCL_OK) {
- DestroyTab(setPtr, tabPtr);
- return TCL_ERROR;
- }
- if (ConfigureTab(setPtr, tabPtr) != TCL_OK) {
- DestroyTab(setPtr, tabPtr);
- return TCL_ERROR;
- }
- link = Blt_Chain_NewLink();
- if (before != NULL) {
- Blt_Chain_LinkBefore(setPtr->chain, link, before);
- } else {
- Blt_Chain_AppendLink(setPtr->chain, link);
- }
- tabPtr->link = link;
- Blt_Chain_SetValue(link, tabPtr);
- if (setPtr->plusPtr != NULL) {
- /* Move plus tab to the end. */
- link = setPtr->plusPtr->link;
- Blt_Chain_UnlinkLink(setPtr->chain, link);
- Blt_Chain_AppendLink(setPtr->chain, link);
- }
- ReindexTabs(setPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), tabPtr->name, -1);
- return TCL_OK;
-
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InvokeOp --
- *
- * This procedure is called to invoke a selection command.
- *
- * .h invoke index
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set; old resources get freed, if there were any. The widget is
- * redisplayed if needed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InvokeOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- Tcl_Obj *cmdObjPtr;
-
- if (GetTabFromObj(interp, setPtr, objv[2], &tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((tabPtr == NULL) || (tabPtr->flags & (DISABLED|HIDE))) {
- return TCL_OK;
- }
- cmdObjPtr = GETATTR(tabPtr, cmdObjPtr);
- if (cmdObjPtr != NULL) {
- Tcl_Obj **args;
- Tcl_Obj **cmdv;
- int cmdc;
- int i;
- int result;
-
- if (Tcl_ListObjGetElements(interp, cmdObjPtr, &cmdc, &cmdv) != TCL_OK) {
- return TCL_ERROR;
- }
- args = Blt_AssertMalloc(sizeof(Tcl_Obj *) * (cmdc + 1));
- for (i = 0; i < cmdc; i++) {
- args[i] = cmdv[i];
- }
- args[i] = Tcl_NewIntObj(tabPtr->index);
- result = Blt_GlobalEvalObjv(interp, cmdc + 1, args);
- Blt_Free(args);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MoveOp --
- *
- * Moves a tab to a new location.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-MoveOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr, *fromPtr;
- char c;
- const char *string;
- int isBefore;
- int length;
-
- if (GetTabFromObj(interp, setPtr, objv[2], &tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((tabPtr == NULL) || (tabPtr->flags & DISABLED)) {
- return TCL_OK;
- }
- string = Tcl_GetStringFromObj(objv[3], &length);
- c = string[0];
- if ((c == 'b') && (strncmp(string, "before", length) == 0)) {
- isBefore = TRUE;
- } else if ((c == 'a') && (strncmp(string, "after", length) == 0)) {
- isBefore = FALSE;
- } else {
- Tcl_AppendResult(interp, "bad key word \"", string,
- "\": should be \"after\" or \"before\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (GetTabFromObj(interp, setPtr, objv[4], &fromPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (fromPtr == NULL) {
- Tcl_AppendResult(interp, "can't find a tab \"",
- Tcl_GetString(objv[4]), "\" in \"", Tk_PathName(setPtr->tkwin),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (tabPtr == fromPtr) {
- return TCL_OK;
- }
- Blt_Chain_UnlinkLink(setPtr->chain, tabPtr->link);
- if (isBefore) {
- Blt_Chain_LinkBefore(setPtr->chain, tabPtr->link, fromPtr->link);
- } else {
- Blt_Chain_LinkAfter(setPtr->chain, tabPtr->link, fromPtr->link);
- }
- setPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING | REDRAW_ALL);
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * .h names pattern
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NamesOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (objc == 2) {
- Tab *tabPtr;
-
- for (tabPtr = FirstTab(setPtr, 0); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, 0)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(tabPtr->name, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- } else {
- Tab *tabPtr;
-
- for (tabPtr = FirstTab(setPtr, 0); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, 0)) {
- int i;
-
- for (i = 2; i < objc; i++) {
- if (Tcl_StringMatch(tabPtr->name, Tcl_GetString(objv[i]))) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(tabPtr->name, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- break;
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-NearestOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int x, y; /* Screen coordinates of the test point. */
- Tab *tabPtr;
-
- if ((Tk_GetPixelsFromObj(interp, setPtr->tkwin, objv[2], &x) != TCL_OK) ||
- (Tk_GetPixelsFromObj(interp, setPtr->tkwin, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (setPtr->nVisible > 0) {
- tabPtr = (Tab *)PickTabProc(setPtr, x, y, NULL);
- if ((tabPtr != NULL) && ((tabPtr->flags & DISABLED) == 0)) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), tabPtr->name, -1);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectOp --
- *
- * This procedure is called to select a tab.
- *
- * .h select index
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then
- * interp->result contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set; old resources get freed, if there were any.
- * The widget is redisplayed if needed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
-
- if (GetTabFromObj(interp, setPtr, objv[2], &tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((tabPtr == NULL) || (tabPtr->flags & (HIDE|DISABLED))) {
- return TCL_OK;
- }
- if ((setPtr->selectPtr != NULL) && (setPtr->selectPtr != tabPtr) &&
- (setPtr->selectPtr->tkwin != NULL)) {
- if (setPtr->selectPtr->container == NULL) {
- if (Tk_IsMapped(setPtr->selectPtr->tkwin)) {
- Tk_UnmapWindow(setPtr->selectPtr->tkwin);
- }
- } else {
- /* Redraw now unselected container. */
- EventuallyRedrawTearoff(setPtr->selectPtr);
- }
- }
- setPtr->selectPtr = tabPtr;
- if ((setPtr->nTiers > 1) && (tabPtr->tier != setPtr->startPtr->tier)) {
- RenumberTiers(setPtr, tabPtr);
- Blt_PickCurrentItem(setPtr->bindTable);
- }
- setPtr->flags |= SCROLL_PENDING;
- if (tabPtr->container != NULL) {
- EventuallyRedrawTearoff(tabPtr);
- }
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-static int
-ViewOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int width;
-
- width = VPORTWIDTH(setPtr);
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr, *objPtr;
-
- /* Report first and last fractions */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- /*
- * Note: we are bounding the fractions between 0.0 and 1.0 to support
- * the "canvas"-style of scrolling.
- */
- fract = (double)setPtr->scrollOffset / setPtr->worldWidth;
- objPtr = Tcl_NewDoubleObj(FCLAMP(fract));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- fract = (double)(setPtr->scrollOffset + width) / setPtr->worldWidth;
- objPtr = Tcl_NewDoubleObj(FCLAMP(fract));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2,
- &setPtr->scrollOffset, setPtr->worldWidth, width,
- setPtr->scrollUnits, BLT_SCROLL_MODE_HIERBOX) != TCL_OK) {
- return TCL_ERROR;
- }
- setPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-
-static void
-AdoptWindow(ClientData clientData)
-{
- Tab *tabPtr = clientData;
- int x, y;
- Tabset *setPtr = tabPtr->setPtr;
-
- x = setPtr->inset + setPtr->inset2 + tabPtr->padLeft;
-#define TEAR_OFF_TAB_SIZE 5
- y = setPtr->inset + setPtr->inset2 + setPtr->outerPad +
- TEAR_OFF_TAB_SIZE + tabPtr->padTop;
- if (setPtr->nTiers == 1) {
- y += setPtr->ySelectPad;
- }
- Blt_RelinkWindow(tabPtr->tkwin, tabPtr->container, x, y);
- Tk_MapWindow(tabPtr->tkwin);
-}
-
-static void
-DestroyTearoff(DestroyData dataPtr)
-{
- Tab *tabPtr = (Tab *)dataPtr;
-
- if (tabPtr->container != NULL) {
- Tabset *setPtr;
- Tk_Window tkwin;
- setPtr = tabPtr->setPtr;
-
- tkwin = tabPtr->container;
- if (tabPtr->flags & TEAROFF_REDRAW) {
- Tcl_CancelIdleCall(DisplayTearoff, tabPtr);
- }
- Tk_DeleteEventHandler(tkwin, StructureNotifyMask, TearoffEventProc,
- tabPtr);
- if (tabPtr->tkwin != NULL) {
- XRectangle rect;
-
- GetWindowRectangle(tabPtr, setPtr->tkwin, FALSE, &rect);
- Blt_RelinkWindow(tabPtr->tkwin, setPtr->tkwin, rect.x, rect.y);
- if (tabPtr == setPtr->selectPtr) {
- ArrangeWindow(tabPtr->tkwin, &rect, TRUE);
- } else {
- Tk_UnmapWindow(tabPtr->tkwin);
- }
- }
- Tk_DestroyWindow(tkwin);
- tabPtr->container = NULL;
- }
-}
-
-static int
-NewTearoff(Tabset *setPtr, Tcl_Obj *objPtr, Tab *tabPtr)
-{
- Tk_Window tkwin;
- const char *name;
- int w, h;
-
- name = Tcl_GetString(objPtr);
- tkwin = Tk_CreateWindowFromPath(setPtr->interp, setPtr->tkwin, name,
- (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- tabPtr->container = tkwin;
- if (Tk_WindowId(tkwin) == None) {
- Tk_MakeWindowExist(tkwin);
- }
- Tk_SetClass(tkwin, "Tearoff");
- Tk_CreateEventHandler(tkwin, (ExposureMask | StructureNotifyMask),
- TearoffEventProc, tabPtr);
- if (Tk_WindowId(tabPtr->tkwin) == None) {
- Tk_MakeWindowExist(tabPtr->tkwin);
- }
- w = Tk_Width(tabPtr->tkwin);
- if (w < 2) {
- w = (tabPtr->reqSlaveWidth > 0)
- ? tabPtr->reqSlaveWidth : Tk_ReqWidth(tabPtr->tkwin);
- }
- w += PADDING(tabPtr->xPad) + 2 * Tk_Changes(tabPtr->tkwin)->border_width;
- w += 2 * (setPtr->inset2 + setPtr->inset);
-#define TEAR_OFF_TAB_SIZE 5
- h = Tk_Height(tabPtr->tkwin);
- if (h < 2) {
- h = (tabPtr->reqSlaveHeight > 0)
- ? tabPtr->reqSlaveHeight : Tk_ReqHeight(tabPtr->tkwin);
- }
- h += PADDING(tabPtr->yPad) + 2 * Tk_Changes(tabPtr->tkwin)->border_width;
- h += setPtr->inset + setPtr->inset2 + TEAR_OFF_TAB_SIZE + setPtr->outerPad;
- if (setPtr->nTiers == 1) {
- h += setPtr->ySelectPad;
- }
- Tk_GeometryRequest(tkwin, w, h);
- Tk_UnmapWindow(tabPtr->tkwin);
- /* Tk_MoveWindow(tabPtr->tkwin, 0, 0); */
-#ifdef WIN32
- AdoptWindow(tabPtr);
-#else
- Tcl_DoWhenIdle(AdoptWindow, tabPtr);
-#endif
- Tcl_SetStringObj(Tcl_GetObjResult(setPtr->interp), Tk_PathName(tkwin), -1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TabCgetOp --
- *
- * .h tab cget index option
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TabCgetOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
-
- if (GetTabFromObj(interp, setPtr, objv[3], &tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (tabPtr == NULL) {
- Tcl_AppendResult(interp, "can't find a tab \"",
- Tcl_GetString(objv[3]), "\" in \"", Tk_PathName(setPtr->tkwin),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- iconOption.clientData = setPtr;
- return Blt_ConfigureValueFromObj(interp, setPtr->tkwin, tabSpecs,
- (char *)tabPtr, objv[4], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TabConfigureOp --
- *
- * This procedure is called to process a list of configuration options
- * database, in order to reconfigure the options for one or more tabs in
- * the widget.
- *
- * .h tab configure index ?index...? ?option value?...
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side Effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set; old resources get freed, if there were any. The widget is
- * redisplayed if needed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TabConfigureOp(Tabset *setPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- TabIterator iter;
-
- iconOption.clientData = setPtr;
- if ((objc == 4) || (objc == 5)) {
- if (GetTabFromObj(interp, setPtr, objv[3], &tabPtr) != TCL_OK) {
- return TCL_ERROR; /* Can't find node. */
- }
- if (tabPtr == NULL) {
- Tcl_AppendResult(interp, "can't find a tab \"",
- Tcl_GetString(objv[3]), "\" in \"",
- Tk_PathName(setPtr->tkwin),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, setPtr->tkwin, tabSpecs,
- (char *)tabPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 5) {
- return Blt_ConfigureInfoFromObj(interp, setPtr->tkwin, tabSpecs,
- (char *)tabPtr, objv[4], 0);
- }
- }
- if (GetTabIterator(interp, setPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR; /* Can't find node. */
- }
- for (tabPtr = FirstTaggedTab(&iter); tabPtr != NULL;
- tabPtr = NextTaggedTab(&iter)) {
- int result;
-
- Tcl_Preserve(tabPtr);
- result = Blt_ConfigureWidgetFromObj(interp, setPtr->tkwin, tabSpecs,
- objc - 4, objv + 4, (char *)tabPtr, BLT_CONFIG_OBJV_ONLY);
- Tcl_Release(tabPtr);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (ConfigureTab(setPtr, tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TabOp --
- *
- * This procedure handles tab operations.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec tabOps[] =
-{
- {"cget", 2, TabCgetOp, 5, 5, "tab option",},
- {"configure", 2, TabConfigureOp, 4, 0, "tab ?option value?...",},
-};
-
-static int nTabOps = sizeof(tabOps) / sizeof(Blt_OpSpec);
-
-static int
-TabOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TabsetCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTabOps, tabOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (setPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PerforationActivateOp --
- *
- * This procedure is called to highlight the perforation.
- *
- * .h perforation highlight boolean
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PerforationActivateOp(
- Tabset *setPtr,
- Tcl_Interp *interp, /* Not used. */
- int objc,
- Tcl_Obj *const *objv)
-{
- int bool;
-
- if (Tcl_GetBooleanFromObj(interp, objv[3], &bool) != TCL_OK) {
- return TCL_ERROR;
- }
- if (bool) {
- setPtr->flags |= ACTIVE_PERFORATION;
- } else {
- setPtr->flags &= ~ACTIVE_PERFORATION;
- }
- EventuallyRedraw(setPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PerforationInvokeOp --
- *
- * This procedure is called to invoke a perforation command.
- *
- * .t perforation invoke
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then
- * interp->result contains an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PerforationInvokeOp(Tabset *setPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_Obj *objPtr;
- Tab *tabPtr;
-
- if (setPtr->selectPtr == NULL) {
- return TCL_OK;
- }
- tabPtr = setPtr->selectPtr;
- objPtr = GETATTR(tabPtr, perfCmdObjPtr);
- if (objPtr != NULL) {
- Tcl_Obj **args;
- Tcl_Obj **cmdv;
- int cmdc;
- int i;
- int result;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &cmdc, &cmdv) != TCL_OK) {
- return TCL_ERROR;
- }
- args = Blt_AssertMalloc(sizeof(Tcl_Obj *) * (cmdc + 1));
- for (i = 0; i < cmdc; i++) {
- args[i] = cmdv[i];
- }
- args[i] = Tcl_NewIntObj(tabPtr->index);
- result = Blt_GlobalEvalObjv(interp, cmdc + 1, args);
- Blt_Free(args);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PerforationOp --
- *
- * This procedure handles tab operations.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec perforationOps[] =
-{
- {"activate", 1, PerforationActivateOp, 4, 4, "boolean" },
- {"invoke", 1, PerforationInvokeOp, 3, 3, "",},
-};
-
-static int nPerforationOps = sizeof(perforationOps) / sizeof(Blt_OpSpec);
-
-static int
-PerforationOp(Tabset *setPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TabsetCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nPerforationOps, perforationOps,
- BLT_OP_ARG2, objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (setPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScanOp --
- *
- * Implements the quick scan.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ScanOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- char c;
- const char *string;
- int length;
- int oper;
- int x, y;
-
-#define SCAN_MARK 1
-#define SCAN_DRAGTO 2
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- if ((c == 'm') && (strncmp(string, "mark", length) == 0)) {
- oper = SCAN_MARK;
- } else if ((c == 'd') && (strncmp(string, "dragto", length) == 0)) {
- oper = SCAN_DRAGTO;
- } else {
- Tcl_AppendResult(interp, "bad scan operation \"", string,
- "\": should be either \"mark\" or \"dragto\"", (char *)NULL);
- return TCL_ERROR;
- }
- if ((Tk_GetPixelsFromObj(interp, setPtr->tkwin, objv[3], &x) != TCL_OK) ||
- (Tk_GetPixelsFromObj(interp, setPtr->tkwin, objv[4], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (oper == SCAN_MARK) {
- if (setPtr->side & (SIDE_LEFT | SIDE_RIGHT)) {
- setPtr->scanAnchor = y;
- } else {
- setPtr->scanAnchor = x;
- }
- setPtr->scanOffset = setPtr->scrollOffset;
- } else {
- int offset, delta;
-
- if (setPtr->side & (SIDE_LEFT | SIDE_RIGHT)) {
- delta = setPtr->scanAnchor - y;
- } else {
- delta = setPtr->scanAnchor - x;
- }
- offset = setPtr->scanOffset + (10 * delta);
- offset = Blt_AdjustViewport(offset, setPtr->worldWidth,
- VPORTWIDTH(setPtr), setPtr->scrollUnits, BLT_SCROLL_MODE_HIERBOX);
- setPtr->scrollOffset = offset;
- setPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(setPtr);
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-SeeOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
-
- if (GetTabFromObj(interp, setPtr, objv[2], &tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (tabPtr != NULL) {
- int left, right, width;
-
- width = VPORTWIDTH(setPtr);
- left = setPtr->scrollOffset + setPtr->xSelectPad;
- right = setPtr->scrollOffset + width - setPtr->xSelectPad;
-
- /* If the tab is partially obscured, scroll so that it's
- * entirely in view. */
- if (tabPtr->worldX < left) {
- setPtr->scrollOffset = tabPtr->worldX;
- if (tabPtr->index > 0) {
- setPtr->scrollOffset -= TAB_SCROLL_OFFSET;
- }
- } else if ((tabPtr->worldX + tabPtr->worldWidth) >= right) {
- Blt_ChainLink link;
-
- setPtr->scrollOffset = tabPtr->worldX + tabPtr->worldWidth -
- (width - 2 * setPtr->xSelectPad);
- link = Blt_Chain_NextLink(tabPtr->link);
- if (link != NULL) {
- Tab *nextPtr;
-
- nextPtr = Blt_Chain_GetValue(link);
- if (nextPtr->tier == tabPtr->tier) {
- setPtr->scrollOffset += TAB_SCROLL_OFFSET;
- }
- }
- }
- setPtr->flags |= SCROLL_PENDING;
- EventuallyRedraw(setPtr);
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-SizeOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int nTabs;
-
- nTabs = Blt_Chain_GetLength(setPtr->chain);
- Tcl_SetIntObj(Tcl_GetObjResult(interp), nTabs);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagAddOp --
- *
- * .t tag add tagName tab1 tab2 tab2 tab4
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagAddOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- const char *tag;
- long tagId;
-
- tag = Tcl_GetString(objv[3]);
- if (Tcl_GetLongFromObj(NULL, objv[3], &tagId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", tag,
- "\": can't be a number.", (char *)NULL);
- return TCL_ERROR;
- }
- if (strcmp(tag, "all") == 0) {
- Tcl_AppendResult(interp, "can't add reserved tag \"", tag, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (objc == 4) {
- /* No nodes specified. Just add the tag. */
- AddTag(setPtr, NULL, tag);
- } else {
- int i;
-
- for (i = 4; i < objc; i++) {
- Tab *tabPtr;
- TabIterator iter;
-
- if (GetTabIterator(interp, setPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (tabPtr = FirstTaggedTab(&iter); tabPtr != NULL;
- tabPtr = NextTaggedTab(&iter)) {
- AddTag(setPtr, tabPtr, tag);
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagDeleteOp --
- *
- * .t delete tagName tab1 tab2 tab3
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagDeleteOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- const char *tag;
- Blt_HashTable *tablePtr;
- long tagId;
-
- tag = Tcl_GetString(objv[3]);
- if (Tcl_GetLongFromObj(NULL, objv[3], &tagId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", tag,
- "\": can't be a number.", (char *)NULL);
- return TCL_ERROR;
- }
- if (strcmp(tag, "all") == 0) {
- Tcl_AppendResult(interp, "can't delete reserved tag \"", tag, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- tablePtr = GetTagTable(setPtr, tag);
- if (tablePtr != NULL) {
- int i;
-
- for (i = 4; i < objc; i++) {
- Tab *tabPtr;
- TabIterator iter;
-
- if (GetTabIterator(interp, setPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (tabPtr = FirstTaggedTab(&iter); tabPtr != NULL;
- tabPtr = NextTaggedTab(&iter)) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(tablePtr, (char *)tabPtr);
- if (hPtr != NULL) {
- Blt_DeleteHashEntry(tablePtr, hPtr);
- }
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagExistsOp --
- *
- * Returns the existence of the one or more tags in the given node. If
- * the node has any the tags, true is return in the interpreter.
- *
- * .t tag exists tab tag1 tag2 tag3...
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TagExistsOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
- TabIterator iter;
-
- if (GetTabIterator(interp, setPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 4; i < objc; i++) {
- const char *tag;
- Tab *tabPtr;
-
- tag = Tcl_GetString(objv[i]);
- for (tabPtr = FirstTaggedTab(&iter); tabPtr != NULL;
- tabPtr = NextTaggedTab(&iter)) {
- if (HasTag(tabPtr, tag)) {
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), TRUE);
- return TCL_OK;
- }
- }
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), FALSE);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagForgetOp --
- *
- * Removes the given tags from all tabs.
- *
- * .ts tab forget tag1 tag2 tag3...
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TagForgetOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- const char *tag;
- long tagId;
-
- tag = Tcl_GetString(objv[i]);
- if (Tcl_GetLongFromObj(NULL, objv[i], &tagId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", tag,
- "\": can't be a number.", (char *)NULL);
- return TCL_ERROR;
- }
- ForgetTag(setPtr, tag);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagGetOp --
- *
- * Returns tag names for a given node. If one of more pattern arguments
- * are provided, then only those matching tags are returned.
- *
- * .t tag get tab pat1 pat2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagGetOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- TabIterator iter;
- Tcl_Obj *listObjPtr;
-
- if (GetTabIterator(interp, setPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (tabPtr = FirstTaggedTab(&iter); tabPtr != NULL;
- tabPtr = NextTaggedTab(&iter)) {
- if (objc == 4) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch hiter;
-
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &hiter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&hiter)) {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- if (Blt_FindHashEntry(tablePtr, (char *)tabPtr) != NULL) {
- const char *tag;
- Tcl_Obj *objPtr;
-
- tag = Blt_GetHashKey(&setPtr->tagTable, hPtr);
- objPtr = Tcl_NewStringObj(tag, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj("all", 3));
- } else {
- int i;
-
- /* Check if we need to add the special tags "all" */
- for (i = 4; i < objc; i++) {
- const char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- if (Tcl_StringMatch("all", pattern)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj("all", 3);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- break;
- }
- }
- /* Now process any standard tags. */
- for (i = 4; i < objc; i++) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch hiter;
- const char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &hiter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&hiter)) {
- const char *tag;
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_GetHashValue(hPtr);
- tag = Blt_GetHashKey(&setPtr->tagTable, hPtr);
- if (!Tcl_StringMatch(tag, pattern)) {
- continue;
- }
- if (Blt_FindHashEntry(tablePtr, (char *)tabPtr) != NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(tag, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr,objPtr);
- }
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagNamesOp --
- *
- * Returns the names of all the tags in the tabset. If one of more node
- * arguments are provided, then only the tags found in those nodes are
- * returned.
- *
- * .t tag names tab tab tab...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagNamesOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr, *objPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- objPtr = Tcl_NewStringObj("all", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- const char *tag;
- tag = Blt_GetHashKey(&setPtr->tagTable, hPtr);
- objPtr = Tcl_NewStringObj(tag, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- } else {
- Blt_HashTable uniqTable;
- int i;
-
- Blt_InitHashTable(&uniqTable, BLT_STRING_KEYS);
- for (i = 3; i < objc; i++) {
- TabIterator iter;
- Tab *tabPtr;
-
- if (GetTabIterator(interp, setPtr, objPtr, &iter) != TCL_OK) {
- goto error;
- }
- for (tabPtr = FirstTaggedTab(&iter); tabPtr != NULL;
- tabPtr = NextTaggedTab(&iter)) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch hiter;
- for (hPtr = Blt_FirstHashEntry(&setPtr->tagTable, &hiter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&hiter)) {
- const char *tag;
- Blt_HashTable *tablePtr;
-
- tag = Blt_GetHashKey(&setPtr->tagTable, hPtr);
- tablePtr = Blt_GetHashValue(hPtr);
- if (Blt_FindHashEntry(tablePtr, tabPtr) != NULL) {
- int isNew;
-
- Blt_CreateHashEntry(&uniqTable, tag, &isNew);
- }
- }
- }
- }
- {
- Blt_HashEntry *hPtr;
- Blt_HashSearch hiter;
-
- for (hPtr = Blt_FirstHashEntry(&uniqTable, &hiter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&hiter)) {
- objPtr = Tcl_NewStringObj(Blt_GetHashKey(&uniqTable, hPtr), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Blt_DeleteHashTable(&uniqTable);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- error:
- Tcl_DecrRefCount(listObjPtr);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagIndicesOp --
- *
- * Returns the indices associated with the given tags. The indices
- * returned will represent the union of tabs for all the given tags.
- *
- * .t tag indices tag1 tag2 tag3...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagIndicesOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashTable tabTable;
- int i;
-
- Blt_InitHashTable(&tabTable, BLT_ONE_WORD_KEYS);
- for (i = 3; i < objc; i++) {
- const char *tag;
- long tagId;
-
- tag = Tcl_GetString(objv[i]);
- if (Tcl_GetLongFromObj(NULL, objv[i], &tagId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", tag,
- "\": can't be a number.", (char *)NULL);
- goto error;
- }
- if (strcmp(tag, "all") == 0) {
- break;
- } else {
- Blt_HashTable *tablePtr;
-
- tablePtr = GetTagTable(setPtr, tag);
- if (tablePtr != NULL) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(tablePtr, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Tab *tabPtr;
- int isNew;
-
- tabPtr = Blt_GetHashValue(hPtr);
- if (tabPtr != NULL) {
- Blt_CreateHashEntry(&tabTable, (char *)tabPtr, &isNew);
- }
- }
- continue;
- }
- }
- Tcl_AppendResult(interp, "can't find a tag \"", tag, "\"",
- (char *)NULL);
- goto error;
- }
- {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (hPtr = Blt_FirstHashEntry(&tabTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Tab *tabPtr;
- Tcl_Obj *objPtr;
-
- tabPtr = (Tab *)Blt_GetHashKey(&tabTable, hPtr);
- objPtr = Tcl_NewLongObj(tabPtr->index);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- }
- Blt_DeleteHashTable(&tabTable);
- return TCL_OK;
-
- error:
- Blt_DeleteHashTable(&tabTable);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagSetOp --
- *
- * Sets one or more tags for a given tab. Tag names can't start with a
- * digit (to distinquish them from node ids) and can't be a reserved tag
- * ("all").
- *
- * .t tag set tab tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagSetOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
- TabIterator iter;
-
- if (GetTabIterator(interp, setPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 4; i < objc; i++) {
- const char *tag;
- long tagId;
- Tab *tabPtr;
-
- tag = Tcl_GetString(objv[i]);
- if (Tcl_GetLongFromObj(NULL, objv[i], &tagId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", tag,
- "\": can't be a number.", (char *)NULL);
- return TCL_ERROR;
- }
- if (strcmp(tag, "all") == 0) {
- Tcl_AppendResult(interp, "can't add reserved tag \"", tag, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- for (tabPtr = FirstTaggedTab(&iter); tabPtr != NULL;
- tabPtr = NextTaggedTab(&iter)) {
- AddTag(setPtr, tabPtr, tag);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagUnsetOp --
- *
- * Removes one or more tags from a given tab. If a tag doesn't exist or
- * is a reserved tag ("all"), nothing will be done and no error
- * message will be returned.
- *
- * .t tag unset tab tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagUnsetOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- TabIterator iter;
-
- if (GetTabIterator(interp, setPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (tabPtr = FirstTaggedTab(&iter); tabPtr != NULL;
- tabPtr = NextTaggedTab(&iter)) {
- int i;
- for (i = 4; i < objc; i++) {
- RemoveTag(tabPtr, Tcl_GetString(objv[i]));
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagOp --
- *
- * This procedure is invoked to process tag operations.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec tagOps[] =
-{
- {"add", 1, TagAddOp, 4, 0, "tab ?tag...?",},
- {"delete", 1, TagDeleteOp, 4, 0, "tab ?tag...?",},
- {"exists", 1, TagExistsOp, 4, 0, "tab ?tag...?",},
- {"forget", 1, TagForgetOp, 3, 0, "?tag...?",},
- {"get", 1, TagGetOp, 4, 0, "tab ?pattern...?",},
- {"indices", 1, TagIndicesOp, 3, 0, "?tag...?",},
- {"names", 2, TagNamesOp, 3, 0, "?tab...?",},
- {"set", 1, TagSetOp, 4, 0, "tab ?tag...",},
- {"unset", 1, TagUnsetOp, 4, 0, "tab ?tag...",},
-};
-
-static int nTagOps = sizeof(tagOps) / sizeof(Blt_OpSpec);
-
-static int
-TagOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TabsetCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTagOps, tagOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc)(setPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TearoffOp --
- *
- * .h tearoff index ?title?
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TearoffOp(Tabset *setPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tab *tabPtr;
- Tk_Window tkwin;
- const char *string;
- int result;
-
- if (GetTabFromObj(interp, setPtr, objv[2], &tabPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((tabPtr == NULL) || (tabPtr->tkwin == NULL) ||
- (tabPtr->flags & (DISABLED|HIDE))) {
- return TCL_OK; /* No-op */
- }
- if (objc == 3) {
- Tk_Window parent;
-
- parent = (tabPtr->container == NULL) ? setPtr->tkwin : tabPtr->container;
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(parent), -1);
- return TCL_OK;
- }
- Tcl_Preserve(tabPtr);
- result = TCL_OK;
-
- string = Tcl_GetString(objv[3]);
- tkwin = Tk_NameToWindow(interp, string, setPtr->tkwin);
- Tcl_ResetResult(interp);
-
- if (tabPtr->container != NULL) {
- Tcl_EventuallyFree(tabPtr, DestroyTearoff);
- }
- if ((tkwin != setPtr->tkwin) && (tabPtr->container == NULL)) {
- result = NewTearoff(setPtr, objv[3], tabPtr);
- }
- Tcl_Release(tabPtr);
- EventuallyRedraw(setPtr);
- return result;
-}
-
-static void
-ComputeTabGeometry(Tabset *setPtr, Tab *tabPtr)
-{
- Blt_Font font;
- int iconWidth0, iconHeight0;
- unsigned int w, h;
-
- font = GETATTR(tabPtr, font);
- w = h = 0;
- if (tabPtr->text != NULL) {
- TextStyle ts;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, font);
- Blt_Ts_SetPadding(ts, 2, 2, 0, 0);
- if (tabPtr->layoutPtr != NULL) {
- Blt_Free(tabPtr->layoutPtr);
- }
- tabPtr->layoutPtr = Blt_Ts_CreateLayout(tabPtr->text, -1, &ts);
- tabPtr->textWidth0 = ODD(tabPtr->layoutPtr->width);
- tabPtr->textHeight0 = ODD(tabPtr->layoutPtr->height);
- } else {
- tabPtr->textWidth0 = tabPtr->textHeight0 = 0;
- }
- if (tabPtr->icon != NULL) {
- iconWidth0 = IconWidth(tabPtr->icon);
- iconHeight0 = IconHeight(tabPtr->icon);
- } else {
- iconWidth0 = iconHeight0 = 0;
- }
- w = iconWidth0 + tabPtr->textWidth0 + PADDING(tabPtr->iPadX);
- if ((iconWidth0 > 0) && (tabPtr->textWidth0 > 0)) {
- w += LABEL_PAD;
- }
- h = MAX(iconHeight0, tabPtr->textHeight0) + PADDING(tabPtr->iPadY);
- if ((setPtr->flags & CLOSE_NEEDED) && (setPtr->plusPtr != tabPtr)) {
- w += CLOSE_WIDTH + LABEL_PAD + 2 * setPtr->closeButton.borderWidth;
- }
- tabPtr->labelWidth0 = w;
- tabPtr->labelHeight0 = h;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeWorldGeometry --
- *
- * Compute the sizes of the tabset and each tab in world coordinates.
- * World coordinates are not rotated according to the side the widget
- * where the tabs are located.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ComputeWorldGeometry(Tabset *setPtr)
-{
- int count;
- int maxPageWidth, maxPageHeight;
- int maxTabWidth, maxTabHeight;
- Tab *tabPtr;
-
- maxPageWidth = maxPageHeight = 0;
- maxTabWidth = maxTabHeight = 0;
- count = 0;
-
- /*
- * Step 1: Figure out the maximum area needed for a label and a
- * page. Both the label and page dimensions are adjusted
- * for orientation. In addition, reset the visibility
- * flags and reorder the tabs.
- */
- for (tabPtr = FirstTab(setPtr, 0); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, 0)) {
-
- /* Reset visibility flag and order of tabs. */
- tabPtr->flags &= ~ONSCREEN;
- if (tabPtr->flags & HIDE) {
- continue;
- }
- ComputeTabGeometry(setPtr, tabPtr);
- count++;
- if (tabPtr->tkwin != NULL) {
- int w, h;
-
- w = GetReqWidth(tabPtr);
- if (maxPageWidth < w) {
- maxPageWidth = w;
- }
- h = GetReqHeight(tabPtr);
- if (maxPageHeight < h) {
- maxPageHeight = h;
- }
- }
- if (maxTabWidth < tabPtr->labelWidth0) {
- maxTabWidth = tabPtr->labelWidth0;
- }
- if (maxTabHeight < tabPtr->labelHeight0) {
- maxTabHeight = tabPtr->labelHeight0;
- }
- }
- setPtr->overlap = 0;
- /*
- * Step 2: Set the sizes for each tab. This is different
- * for constant and variable width tabs. Add the extra space
- * needed for slanted tabs, now that we know maximum tab
- * height.
- */
- if (setPtr->reqTabWidth != TABWIDTH_VARIABLE) {
- int slant;
- Tab *tabPtr;
- int w, h;
-
- w = (setPtr->reqTabWidth > 0) ? setPtr->reqTabWidth : maxTabWidth;
- h = maxTabHeight;
- if ((setPtr->quad == ROTATE_90) || (setPtr->quad == ROTATE_270)) {
- SWAP(w, h);
- }
- if (setPtr->side & (SIDE_LEFT | SIDE_RIGHT)) {
- SWAP(w, h);
- }
- slant = h;
- w += (setPtr->flags & SLANT_LEFT) ? slant : setPtr->inset2;
- w += (setPtr->flags & SLANT_RIGHT) ? slant : setPtr->inset2;
- if (setPtr->flags & SLANT_LEFT) {
- setPtr->overlap += slant / 2;
- }
- if (setPtr->flags & SLANT_RIGHT) {
- setPtr->overlap += slant / 2;
- }
- setPtr->tabWidth = w;
- setPtr->tabHeight = h;
- for (tabPtr = FirstTab(setPtr, HIDE); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, HIDE)) {
- if (setPtr->plusPtr == tabPtr) {
- tabPtr->worldWidth = tabPtr->labelWidth0;
- tabPtr->worldWidth += (setPtr->flags & SLANT_LEFT)
- ? slant : setPtr->inset2;
- tabPtr->worldWidth += (setPtr->flags & SLANT_RIGHT)
- ? slant : setPtr->inset2;
- } else {
- tabPtr->worldWidth = w;
- }
- tabPtr->worldHeight = h;
- }
- } else { /* Variable width tabs. */
- int slant;
- Tab *tabPtr;
- int tabWidth, tabHeight;
- int w, h;
-
- tabWidth = tabHeight = 0;
- for (tabPtr = FirstTab(setPtr, HIDE); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, HIDE)) {
-
- w = tabPtr->labelWidth0;
- h = maxTabHeight;
- if ((setPtr->quad == ROTATE_90) || (setPtr->quad == ROTATE_270)) {
- SWAP(w, h);
- }
- if (setPtr->side & (SIDE_LEFT | SIDE_RIGHT)) {
- SWAP(w, h);
- }
- slant = h;
- w += (setPtr->flags & SLANT_LEFT) ? slant : setPtr->inset2;
- w += (setPtr->flags & SLANT_RIGHT) ? slant : setPtr->inset2;
- tabPtr->worldWidth = w;
- tabPtr->worldHeight = h;
- if (tabWidth < w) {
- tabWidth = w;
- }
- if (tabHeight < h) {
- tabHeight = h;
- }
- }
- if (setPtr->flags & SLANT_LEFT) {
- setPtr->overlap += tabHeight / 2;
- }
- if (setPtr->flags & SLANT_RIGHT) {
- setPtr->overlap += tabHeight / 2;
- }
- setPtr->tabWidth = tabWidth;
- setPtr->tabHeight = tabHeight;
- }
-
-
- /*
- * Let the user override any page dimension.
- */
- setPtr->pageWidth = maxPageWidth;
- setPtr->pageHeight = maxPageHeight;
- if (setPtr->reqPageWidth > 0) {
- setPtr->pageWidth = setPtr->reqPageWidth;
- }
- if (setPtr->reqPageHeight > 0) {
- setPtr->pageHeight = setPtr->reqPageHeight;
- }
- return count;
-}
-
-#ifdef notdef
-static int
-CompareTabSizes(const void *a, const void *b)
-{
- Tab *tab1Ptr, *tab2Ptr;
-
- tab1Ptr = *(Tab **)a;
- tab2Ptr = *(Tab **)b;
- if (tab1Ptr == setPtr->plusPtr) {
- return -1;
- }
- if (tab2Ptr == setPtr->plusPtr) {
- return 1;
- }
- return tab1Ptr->worldWidth - tab2Ptr->worldWidth;
-}
-
-/*
- * Two pass shrink.
- * 1) Any space beyond the normal size.
- * 2) Any space beyong the defined minimum.
- */
-static void
-ShrinkTabs2(Tabset *setPtr, Tab *startPtr, int nTabs, int adjustment)
-{
- int x;
- int i;
- Tab *tabPtr;
-
- /* Sort tabs according to size. */
- tabs = Blt_AssertMalloc(nTabs * sizeof(Tab *));
- for (tabPtr = startPtr, i = 0; (tabPtr != NULL) && (i < nTabs);
- tabPtr = NextTab(tabPtr, HIDE), i++) {
- tabs[i] = tabPtr;
- }
- qsort(tabs, nTabs, sizeof(Tab *), CompareTabSizes);
- for (i = 1; i < tabIndex; i++) {
- avail = (tabs[i-1].worldWidth - tabs[i].worldWidth) * i;
- if (avail > adjustment) {
- avail = adjustment;
- }
- ration = (avail+(i-1))/ i;
- for (j = 0; j < i; j++) {
- if (adjustment > ration) {
- ration = adjustment;
- }
- tabs[j].worldWidth -= ration;
- adjustment -= ration;
- }
-
- accum += tabs[i].worldWidth - tabs[tabIndex].worldWidth;
- if (accum >= adjustment) {
- break; /* Have enough room. */
- }
- }
-
- x = startPtr->tier;
- while (adjustment > 0) {
- int count;
- int ration;
- Tab *tabPtr;
-
- ration = adjustment / count;
- if (ration == 0) {
- ration = 1;
- }
- count = 0;
- for (i = 0; (i < nTabs) && (adjustment > 0); i++) {
- tabPtr = tabs[i];
- if (tabPtr->worldWidth)
-
- tabPtr = NextTab(tabPtr, HIDE), i++) {
- if (tabPtr != setPtr->plusPtr) {
- count++;
- }
- }
- ration = adjustment / count;
- if (ration == 0) {
- ration = 1;
- }
-
- for (tabPtr = startPtr, i = 0;
- (tabPtr != NULL) && (i < nTabs) && (adjustment > 0);
- tabPtr = NextTab(tabPtr, HIDE), i++) {
- if (tabPtr != setPtr->plusPtr) {
- adjustment -= ration;
- tabPtr->worldWidth -= ration;
- assert(x == tabPtr->tier);
- }
- }
- }
- /*
- * Go back and reset the world X-coordinates of the tabs,
- * now that their widths have changed.
- */
- x = 0;
- for (tabPtr = startPtr, i = 0; (i < nTabs) && (tabPtr != NULL);
- tabPtr = NextTab(tabPtr, HIDE), i++) {
- tabPtr->worldX = x;
- x += tabPtr->worldWidth + setPtr->gap - setPtr->overlap;
- }
-}
-#endif
-
-static void
-ShrinkTabs(Tabset *setPtr, Tab *startPtr, int nTabs, int adjustment)
-{
- int x;
- int i;
- Tab *tabPtr;
-
- x = startPtr->tier;
- while (adjustment > 0) {
- int count;
- int ration;
- Tab *tabPtr;
-
- count = 0;
- for (tabPtr = startPtr, i = 0;
- (tabPtr != NULL) && (i < nTabs) && (adjustment > 0);
- tabPtr = NextTab(tabPtr, HIDE), i++) {
- if (tabPtr != setPtr->plusPtr) {
- count++;
- }
- }
- ration = adjustment / count;
- if (ration == 0) {
- ration = 1;
- }
-
- for (tabPtr = startPtr, i = 0;
- (tabPtr != NULL) && (i < nTabs) && (adjustment > 0);
- tabPtr = NextTab(tabPtr, HIDE), i++) {
- if (tabPtr != setPtr->plusPtr) {
- adjustment -= ration;
- tabPtr->worldWidth -= ration;
- assert(x == tabPtr->tier);
- }
- }
- }
- /*
- * Go back and reset the world X-coordinates of the tabs,
- * now that their widths have changed.
- */
- x = 0;
- for (tabPtr = startPtr, i = 0; (i < nTabs) && (tabPtr != NULL);
- tabPtr = NextTab(tabPtr, HIDE), i++) {
- tabPtr->worldX = x;
- x += tabPtr->worldWidth + setPtr->gap - setPtr->overlap;
- }
-}
-
-static void
-GrowTabs(Tabset *setPtr, Tab *startPtr, int nTabs, int adjustment)
-{
- int x;
- int i;
- Tab *tabPtr;
-
- x = startPtr->tier;
- while (adjustment > 0) {
- int count;
- int ration;
- Tab *tabPtr;
-
- count = 0;
- for (tabPtr = startPtr, i = 0;
- (tabPtr != NULL) && (i < nTabs) && (adjustment > 0);
- tabPtr = NextTab(tabPtr, HIDE), i++) {
- if (tabPtr != setPtr->plusPtr) {
- count++;
- }
- }
- ration = adjustment / count;
- if (ration == 0) {
- ration = 1;
- }
-
- for (tabPtr = startPtr, i = 0;
- (tabPtr != NULL) && (i < nTabs) && (adjustment > 0);
- tabPtr = NextTab(tabPtr, HIDE), i++) {
- if (tabPtr != setPtr->plusPtr) {
- adjustment -= ration;
- tabPtr->worldWidth += ration;
- assert(x == tabPtr->tier);
- }
- }
- }
- /*
- * Go back and reset the world X-coordinates of the tabs,
- * now that their widths have changed.
- */
- x = 0;
- for (tabPtr = startPtr, i = 0; (i < nTabs) && (tabPtr != NULL);
- tabPtr = NextTab(tabPtr, HIDE), i++) {
- tabPtr->worldX = x;
- x += tabPtr->worldWidth + setPtr->gap - setPtr->overlap;
- }
-}
-
-static void
-AdjustTabSizes(Tabset *setPtr, int nTabs)
-{
- int tabsPerTier;
- int total, count, extra, plus;
- Tab *startPtr, *nextPtr;
- Blt_ChainLink link;
- Tab *tabPtr;
- int x, maxWidth;
-
- tabsPerTier = (nTabs + (setPtr->nTiers - 1)) / setPtr->nTiers;
- x = 0;
- link = NULL;
- maxWidth = 0;
- if (setPtr->reqTabWidth != TABWIDTH_VARIABLE) {
- link = Blt_Chain_FirstLink(setPtr->chain);
- count = 1;
- while (link != NULL) {
- int i;
-
- for (i = 0; i < tabsPerTier; i++) {
- tabPtr = Blt_Chain_GetValue(link);
- if ((tabPtr->flags & HIDE) == 0) {
- tabPtr->tier = count;
- tabPtr->worldX = x;
- x += tabPtr->worldWidth + setPtr->gap - setPtr->overlap;
- if (x > maxWidth) {
- maxWidth = x;
- }
- }
- link = Blt_Chain_NextLink(link);
- if (link == NULL) {
- goto done;
- }
- }
- count++;
- x = 0;
- }
- }
- done:
- /* Add to tab widths to fill out row. */
- if (((nTabs % tabsPerTier) != 0) &&
- (setPtr->reqTabWidth != TABWIDTH_VARIABLE)) {
- return;
- }
- startPtr = NULL;
- count = total = 0;
- plus = 0;
-#ifndef notdef
- if (setPtr->plusPtr != NULL) {
- plus += setPtr->inset2 * 2;
- }
-#endif
- for (tabPtr = FirstTab(setPtr, HIDE); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, HIDE)) {
- if (startPtr == NULL) {
- startPtr = tabPtr;
- }
- count++;
- total += tabPtr->worldWidth + setPtr->gap - setPtr->overlap;
- link = Blt_Chain_NextLink(tabPtr->link);
- if (link != NULL) {
- nextPtr = Blt_Chain_GetValue(link);
- if (tabPtr->tier == nextPtr->tier) {
- continue;
- }
- }
- total += setPtr->overlap;
-
- extra = setPtr->worldWidth - plus - total;
- assert(count > 0);
- if ((extra > 0) && (setPtr->nTiers > 1)) {
- GrowTabs(setPtr, startPtr, count, extra);
- } else if (extra < 0) {
- ShrinkTabs(setPtr, startPtr, count, -extra);
- }
- count = total = 0;
- startPtr = NULL;
- }
-}
-
-/*
- *
- * tabWidth = textWidth0 + gap + (2 * (pad + outerBW));
- *
- * tabHeight = textHeight0 + 2 * (pad + outerBW) + topMargin;
- *
- */
-static void
-ComputeLayout(Tabset *setPtr)
-{
- int width;
- Blt_ChainLink link;
- int x, extra;
- int nTiers, nTabs;
-
- setPtr->nTiers = 0;
- setPtr->pageTop = 0;
- setPtr->worldWidth = 1;
-
- nTabs = ComputeWorldGeometry(setPtr);
- if (nTabs == 0) {
- return;
- }
- /* Reset the pointers to the selected and starting tab. */
- if (setPtr->selectPtr == NULL) {
- link = Blt_Chain_FirstLink(setPtr->chain);
- if (link != NULL) {
- setPtr->selectPtr = Blt_Chain_GetValue(link);
- }
- }
- if (setPtr->startPtr == NULL) {
- setPtr->startPtr = setPtr->selectPtr;
- }
- if (setPtr->focusPtr == NULL) {
- setPtr->focusPtr = setPtr->selectPtr;
- Blt_SetFocusItem(setPtr->bindTable, setPtr->focusPtr, NULL);
- }
-
- if (setPtr->side & (SIDE_LEFT | SIDE_RIGHT)) {
- width = Tk_ReqHeight(setPtr->tkwin) - 2 *
- (setPtr->inset2 + setPtr->xSelectPad);
- } else {
- width = Tk_ReqWidth(setPtr->tkwin) - (2 * setPtr->inset) -
- setPtr->xSelectPad - setPtr->inset2;
- }
- setPtr->flags &= ~SCROLLING;
- if (setPtr->reqTiers > 1) {
- int total, maxWidth;
- Tab *tabPtr;
-
- /* Static multiple tier mode. */
-
- /* Sum tab widths and determine the number of tiers needed. */
- nTiers = 1;
- total = x = 0;
- for (tabPtr = FirstTab(setPtr, HIDE); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, HIDE)) {
- if ((x + tabPtr->worldWidth) > width) {
- nTiers++;
- x = 0;
- }
- tabPtr->worldX = x;
- tabPtr->tier = nTiers;
- extra = tabPtr->worldWidth + setPtr->gap - setPtr->overlap;
- total += extra, x += extra;
- }
- maxWidth = width;
-
- if (nTiers > setPtr->reqTiers) {
- Tab *tabPtr;
- /*
- * The tabs do not fit into the requested number of tiers.
- * Go into scrolling mode.
- */
- width = ((total + setPtr->tabWidth) / setPtr->reqTiers);
- x = 0;
- nTiers = 1;
- for (tabPtr = FirstTab(setPtr, HIDE); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, HIDE)) {
- tabPtr->tier = nTiers;
- /*
- * Keep adding tabs to a tier until we overfill it.
- */
- tabPtr->worldX = x;
- x += tabPtr->worldWidth + setPtr->gap - setPtr->overlap;
- if (x > width) {
- nTiers++;
- if (x > maxWidth) {
- maxWidth = x;
- }
- x = 0;
- }
- }
- setPtr->flags |= SCROLLING;
- }
- setPtr->worldWidth = maxWidth;
- setPtr->nTiers = nTiers;
-
- if (nTiers > 1) {
- AdjustTabSizes(setPtr, nTabs);
- }
- if ((setPtr->flags & (SCROLLING|SCROLL_TABS)) ==
- (SCROLLING|SCROLL_TABS)) {
- /* Do you add an offset ? */
- setPtr->worldWidth += (setPtr->xSelectPad + setPtr->inset2);
- setPtr->worldWidth += setPtr->overlap;
- } else {
- if (VPORTWIDTH(setPtr) > 1) {
- setPtr->worldWidth = VPORTWIDTH(setPtr) -
- (setPtr->xSelectPad + setPtr->inset2);
- }
- }
- if (setPtr->selectPtr != NULL) {
- RenumberTiers(setPtr, setPtr->selectPtr);
- }
- } else {
- Tab *tabPtr;
- /*
- * Scrollable single tier mode.
- */
- nTiers = 1;
- x = 0;
- for (tabPtr = FirstTab(setPtr, HIDE); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, HIDE)) {
- tabPtr->tier = nTiers;
- tabPtr->worldX = x;
- tabPtr->worldY = 0;
- x += tabPtr->worldWidth + setPtr->gap - setPtr->overlap;
- }
- /* Subtract off the last gap. */
- setPtr->worldWidth = x + setPtr->inset2 - setPtr->gap +
- setPtr->xSelectPad + setPtr->overlap;
- setPtr->flags |= SCROLLING;
- }
- setPtr->nTiers = nTiers;
- if (nTiers == 1) {
- /* We only need the extra space at top of the widget for selected tab
- * if there's only one tier. */
- if ((setPtr->flags & (SCROLLING|SCROLL_TABS)) == SCROLLING) {
- if (VPORTWIDTH(setPtr) > 1) {
- setPtr->worldWidth = VPORTWIDTH(setPtr) -
- (setPtr->xSelectPad + setPtr->inset2);
- }
- AdjustTabSizes(setPtr, nTabs);
- }
- }
- setPtr->nTiers = nTiers;
- setPtr->pageTop = setPtr->inset + setPtr->inset2 +
- (setPtr->nTiers * setPtr->tabHeight);
- if (setPtr->nTiers == 1) {
- setPtr->pageTop += setPtr->ySelectPad;
- }
- if (setPtr->side & (SIDE_LEFT | SIDE_RIGHT)) {
- Tab *tabPtr;
-
- for (tabPtr = FirstTab(setPtr, HIDE); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, HIDE)) {
- tabPtr->screenWidth = (short int)setPtr->tabHeight;
- tabPtr->screenHeight = (short int)tabPtr->worldWidth;
- }
- } else {
- Tab *tabPtr;
-
- for (tabPtr = FirstTab(setPtr, HIDE); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, HIDE)) {
- tabPtr->screenWidth = (short int)tabPtr->worldWidth;
- tabPtr->screenHeight = (short int)setPtr->tabHeight;
- }
- }
-}
-
-static void
-ComputeVisibleTabs(Tabset *setPtr)
-{
- int nVisibleTabs;
- Tab *tabPtr;
-
- setPtr->nVisible = 0;
- if (Blt_Chain_GetLength(setPtr->chain) == 0) {
- return;
- }
- nVisibleTabs = 0;
- if (setPtr->flags & SCROLLING) {
- int width, offset;
- Tab *tabPtr;
-
- /*
- * Scrollable (single or multiple) tier mode.
- */
- offset = setPtr->scrollOffset - (setPtr->outerPad + setPtr->xSelectPad);
- width = VPORTWIDTH(setPtr) + setPtr->scrollOffset +
- 2 * setPtr->outerPad;
- for (tabPtr = FirstTab(setPtr, 0); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, 0)) {
- if (tabPtr->flags & HIDE) {
- tabPtr->flags &= ~ONSCREEN;
- continue;
- }
- if ((tabPtr->worldX >= width) ||
- ((tabPtr->worldX + tabPtr->worldWidth) < offset)) {
- tabPtr->flags &= ~ONSCREEN;
- } else {
- tabPtr->flags |= ONSCREEN;
- nVisibleTabs++;
- }
- }
- } else {
- Tab *tabPtr;
- /* Static multiple tier mode. */
-
- for (tabPtr = FirstTab(setPtr, HIDE); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, HIDE)) {
- tabPtr->flags |= ONSCREEN;
- nVisibleTabs++;
- }
- }
- for (tabPtr = FirstTab(setPtr, HIDE); tabPtr != NULL;
- tabPtr = NextTab(tabPtr, HIDE)) {
- tabPtr->screenX = tabPtr->screenY = -1000;
- if (tabPtr->flags & ONSCREEN) {
- WorldToScreen(setPtr, tabPtr->worldX, tabPtr->worldY,
- &tabPtr->screenX, &tabPtr->screenY);
- switch (setPtr->side) {
- case SIDE_RIGHT:
- tabPtr->screenX -= setPtr->tabHeight;
- break;
-
- case SIDE_BOTTOM:
- tabPtr->screenY -= setPtr->tabHeight;
- break;
- }
- }
- }
- setPtr->nVisible = nVisibleTabs;
- Blt_PickCurrentItem(setPtr->bindTable);
-}
-
-
-static void
-Draw3dFolder(Tabset *setPtr, Tab *tabPtr, Drawable drawable, int side,
- XPoint *points, int nPoints)
-{
- int relief, borderWidth;
- Blt_Background bg;
-
- if (tabPtr == setPtr->selectPtr) {
- bg = GETATTR(tabPtr, selBg);
- } else if ((tabPtr == setPtr->activePtr) ||
- (tabPtr == setPtr->activeButtonPtr)) {
- bg = GETATTR(tabPtr, activeBg);
- } else if (tabPtr->bg != NULL) {
- bg = tabPtr->bg;
- } else {
- bg = setPtr->defStyle.bg;
- }
- relief = setPtr->defStyle.relief;
- if ((side == SIDE_RIGHT) || (side == SIDE_TOP)) {
- borderWidth = -setPtr->defStyle.borderWidth;
- if (relief == TK_RELIEF_SUNKEN) {
- relief = TK_RELIEF_RAISED;
- } else if (relief == TK_RELIEF_RAISED) {
- relief = TK_RELIEF_SUNKEN;
- }
- } else {
- borderWidth = setPtr->defStyle.borderWidth;
- }
- Blt_FillBackgroundPolygon(setPtr->tkwin, drawable, bg, points, nPoints,
- borderWidth, relief);
-}
-
-static void
-DrawPerforation(Tabset *setPtr, Tab *tabPtr, Drawable drawable)
-{
- int x, y;
- int segmentWidth, max;
- Blt_Background bg, perfBg;
-
- if ((tabPtr->container != NULL) || (tabPtr->tkwin == NULL)) {
- return;
- }
- WorldToScreen(setPtr, tabPtr->worldX + 2,
- tabPtr->worldY + tabPtr->worldHeight + 2, &x, &y);
- x += setPtr->xOffset;
- y += setPtr->yOffset;
- bg = GETATTR(tabPtr, selBg);
- segmentWidth = 3;
- if (setPtr->flags & ACTIVE_PERFORATION) {
- perfBg = GETATTR(tabPtr, activeBg);
- } else {
- perfBg = GETATTR(tabPtr, selBg);
- }
- if (setPtr->side & (SIDE_TOP|SIDE_BOTTOM)) {
- XPoint points[2];
-
- points[0].x = x;
- points[0].y = points[1].y = y;
- max = tabPtr->screenX + setPtr->xOffset + tabPtr->screenWidth - 2;
- Blt_FillBackgroundRectangle(setPtr->tkwin, drawable, perfBg, x-2, y-4,
- tabPtr->screenWidth, 8, 0, TK_RELIEF_FLAT);
- while (points[0].x < max) {
- points[1].x = points[0].x + segmentWidth;
- if (points[1].x > max) {
- points[1].x = max;
- }
- Blt_DrawBackgroundPolygon(setPtr->tkwin, drawable, bg, points,
- 2, 1, TK_RELIEF_RAISED);
- points[0].x += 2 * segmentWidth;
- }
- } else {
- XPoint points[2];
-
- points[0].x = points[1].x = x;
- points[0].y = y;
- max = tabPtr->screenY + tabPtr->screenHeight - 2;
- Blt_FillBackgroundRectangle(setPtr->tkwin, drawable, perfBg,
- x - 4, y - 2, 8, tabPtr->screenHeight, 0, TK_RELIEF_FLAT);
- while (points[0].y < max) {
- points[1].y = points[0].y + segmentWidth;
- if (points[1].y > max) {
- points[1].y = max;
- }
- Blt_DrawBackgroundPolygon(setPtr->tkwin, drawable, bg, points,
- 2, 1, TK_RELIEF_RAISED);
- points[0].y += 2 * segmentWidth;
- }
- }
-}
-
-#define NextPoint(px, py) \
- pointPtr->x = (px), pointPtr->y = (py), pointPtr++, nPoints++
-#define EndPoint(px, py) \
- pointPtr->x = (px), pointPtr->y = (py), nPoints++
-
-#define BottomLeft(px, py) \
- NextPoint((px) + setPtr->corner, (py)), \
- NextPoint((px), (py) - setPtr->corner)
-
-#define TopLeft(px, py) \
- NextPoint((px), (py) + setPtr->corner), \
- NextPoint((px) + setPtr->corner, (py))
-
-#define TopRight(px, py) \
- NextPoint((px) - setPtr->corner, (py)), \
- NextPoint((px), (py) + setPtr->corner)
-
-#define BottomRight(px, py) \
- NextPoint((px), (py) - setPtr->corner), \
- NextPoint((px) - setPtr->corner, (py))
-
-/*
- * From the left edge:
- *
- * |a|b|c|d|e| f |d|e|g|h| i |h|g|e|d|f| j |e|d|c|b|a|
- *
- * a. highlight ring
- * b. tabset 3D border
- * c. outer gap
- * d. page border
- * e. page corner
- * f. gap + select pad
- * g. label pad x (worldX)
- * h. internal pad x
- * i. label width
- * j. rest of page width
- *
- * worldX, worldY
- * |
- * |
- * * 4+ . . +5
- * 3+ +6
- * . .
- * . .
- * 1+. . .2+ +7 . . . .+8
- * 0+ +9
- * . .
- * . .
- *13+ +10
- * 12+-------------------------+11
- *
- */
-static void
-DrawFolder(Tabset *setPtr, Tab *tabPtr, Drawable drawable)
-{
- XPoint points[16];
- XPoint *pointPtr;
- int width, height;
- int left, bottom, right, top, yBot, yTop;
- int x, y;
- int i;
- int nPoints;
- int ySelectPad;
-
- width = VPORTWIDTH(setPtr);
- height = VPORTHEIGHT(setPtr);
-
- x = tabPtr->worldX;
- y = tabPtr->worldY;
-
- nPoints = 0;
- pointPtr = points;
-
- ySelectPad = 0;
- if (setPtr->nTiers == 1) {
- ySelectPad = setPtr->ySelectPad;
- }
-
- /* Remember these are all world coordinates. */
- /*
- * x,y
- * |
- * * + . . +
- * + +
- * . .
- * left . .
- * +. . .2+---------+7 . . . .+8
- * 0+ +9
- * x Left side of tab.
- * y Top of tab.
- * yTop Top of folder.
- * yBot Bottom of the tab.
- * left Left side of the folder.
- * right Right side of the folder.
- * top Top of folder.
- * bottom Bottom of folder.
- */
- left = setPtr->scrollOffset - setPtr->xSelectPad;
- right = left + width;
- yTop = y + tabPtr->worldHeight;
- yBot = setPtr->pageTop - (setPtr->inset + ySelectPad) + 1;
- top = yBot - setPtr->inset2 /* - 4 */;
-
- bottom = MAX(height - ySelectPad, yBot);
- if (setPtr->pageHeight == 0) {
- top = yBot - 1;
- yTop = bottom - setPtr->corner;
- yBot = bottom;
- }
- if (tabPtr != setPtr->selectPtr) {
-
- /*
- * Case 1: Unselected tab
- *
- * * 2+ . . +3
- * 1+ +4
- * . .
- * 0+-------- +5
- *
- */
-
- if (setPtr->flags & SLANT_LEFT) {
- NextPoint(x, yBot);
- NextPoint(x, yTop);
- NextPoint(x + setPtr->tabHeight, y);
- } else {
- NextPoint(x, yBot);
- TopLeft(x, y);
- }
- x += tabPtr->worldWidth;
- if (setPtr->flags & SLANT_RIGHT) {
- NextPoint(x - setPtr->tabHeight, y);
- NextPoint(x, yTop);
- NextPoint(x, yBot);
- } else {
- TopRight(x, y);
- NextPoint(x, yBot);
- }
- } else if ((tabPtr->flags & ONSCREEN) == 0) {
- /*
- * Case 2: Selected tab not visible in viewport. Draw folder only.
- *
- * * 2+ . . +3
- * 1+ +4
- * . .
- * 0+-------- +5
- */
-
- TopLeft(left, top);
- TopRight(right, top);
- NextPoint(right, bottom);
- NextPoint(left, bottom);
- } else {
- int flags;
- int tabWidth;
-
- x -= setPtr->xSelectPad;
- y -= setPtr->ySelectPad;
- tabWidth = tabPtr->worldWidth + 2 * setPtr->xSelectPad;
-
-#define CLIP_NONE 0
-#define CLIP_LEFT (1<<0)
-#define CLIP_RIGHT (1<<1)
- flags = 0;
- if (x < left) {
- flags |= CLIP_LEFT;
- }
- if ((x + tabWidth) > right) {
- flags |= CLIP_RIGHT;
- }
- switch (flags) {
- case CLIP_NONE:
-
- /*
- * worldX, worldY
- * |
- * * 4+ . . +5
- * 3+ +6
- * . .
- * . .
- * 1+. . .2+---------+7 . . . .+8
- * 0+ +9
- * . .
- * . .
- * . .
- *11+ . . . . . . . . . . . . . . +10
- */
-
- if (x < (left + setPtr->corner)) {
- NextPoint(left, top);
- } else {
- TopLeft(left, top);
- }
- if (setPtr->flags & SLANT_LEFT) {
- NextPoint(x, yTop);
- NextPoint(x + setPtr->tabHeight + ySelectPad, y);
- } else {
- NextPoint(x, top);
- TopLeft(x, y);
- }
- x += tabWidth;
- if (setPtr->flags & SLANT_RIGHT) {
- NextPoint(x - setPtr->tabHeight - ySelectPad, y);
- NextPoint(x, yTop);
- } else {
- TopRight(x, y);
- NextPoint(x, top);
- }
- if (x > (right - setPtr->corner)) {
- NextPoint(right, top + setPtr->corner);
- } else {
- TopRight(right, top);
- }
- NextPoint(right, bottom);
- NextPoint(left, bottom);
- break;
-
- case CLIP_LEFT:
-
- /*
- * worldX, worldY
- * |
- * * 4+ . . +5
- * 3+ +6
- * . .
- * . .
- * 2+--------+7 . . . .+8
- * 1+ . . . +0 +9
- * . .
- * . .
- * . .
- * 11+ . . . . . +10
- */
-
- NextPoint(left, yBot);
- if (setPtr->flags & SLANT_LEFT) {
- NextPoint(x, yBot);
- NextPoint(x, yTop);
- NextPoint(x + setPtr->tabHeight + ySelectPad, y);
- } else {
- BottomLeft(x, yBot);
- TopLeft(x, y);
- }
-
- x += tabWidth;
- if (setPtr->flags & SLANT_RIGHT) {
- NextPoint(x - setPtr->tabHeight - ySelectPad, y);
- NextPoint(x, yTop);
- NextPoint(x, top);
- } else {
- TopRight(x, y);
- NextPoint(x, top);
- }
- if (x > (right - setPtr->corner)) {
- NextPoint(right, top + setPtr->corner);
- } else {
- TopRight(right, top);
- }
- NextPoint(right, bottom);
- NextPoint(left, bottom);
- break;
-
- case CLIP_RIGHT:
-
- /*
- * worldX, worldY
- * |
- * * 7+ . . +8
- * 6+ +9
- * . .
- * . .
- * 4+ . . . .5+---------+10
- * 3+ 0+ . . . +11
- * . .
- * . .
- * . .
- * 2+ . . . . . +1
- */
-
- NextPoint(right, yBot);
- NextPoint(right, bottom);
- NextPoint(left, bottom);
- if (x < (left + setPtr->corner)) {
- NextPoint(left, top);
- } else {
- TopLeft(left, top);
- }
- NextPoint(x, top);
-
- if (setPtr->flags & SLANT_LEFT) {
- NextPoint(x, yTop);
- NextPoint(x + setPtr->tabHeight + ySelectPad, y);
- } else {
- TopLeft(x, y);
- }
- x += tabWidth;
- if (setPtr->flags & SLANT_RIGHT) {
- NextPoint(x - setPtr->tabHeight - ySelectPad, y);
- NextPoint(x, yTop);
- NextPoint(x, yBot);
- } else {
- TopRight(x, y);
- BottomRight(x, yBot);
- }
- break;
-
- case (CLIP_LEFT | CLIP_RIGHT):
-
- /*
- * worldX, worldY
- * |
- * * 4+ . . . . . . . . +5
- * 3+ +6
- * . .
- * . .
- * 1+---------------------+7
- * 2+ 0+ +9 .+8
- * . .
- * . .
- * . .
- * 11+ . . . . .+10
- */
-
- NextPoint(left, yBot);
- if (setPtr->flags & SLANT_LEFT) {
- NextPoint(x, yBot);
- NextPoint(x, yTop);
- NextPoint(x + setPtr->tabHeight + ySelectPad, y);
- } else {
- BottomLeft(x, yBot);
- TopLeft(x, y);
- }
- x += tabPtr->worldWidth;
- if (setPtr->flags & SLANT_RIGHT) {
- NextPoint(x - setPtr->tabHeight - ySelectPad, y);
- NextPoint(x, yTop);
- NextPoint(x, yBot);
- } else {
- TopRight(x, y);
- BottomRight(x, yBot);
- }
- NextPoint(right, yBot);
- NextPoint(right, bottom);
- NextPoint(left, bottom);
- break;
- }
- }
- EndPoint(points[0].x, points[0].y);
- for (i = 0; i < nPoints; i++) {
- WorldToScreen(setPtr, points[i].x, points[i].y, &x, &y);
- points[i].x = x + setPtr->xOffset;
- points[i].y = y + setPtr->yOffset;
- }
- Draw3dFolder(setPtr, tabPtr, drawable, setPtr->side, points, nPoints);
- DrawLabel(setPtr, tabPtr, drawable);
- if (tabPtr->container != NULL) {
- XRectangle rect;
-
- /* Draw a rectangle covering the spot representing the window */
- GetWindowRectangle(tabPtr, setPtr->tkwin, FALSE, &rect);
- XFillRectangles(setPtr->display, drawable, tabPtr->backGC,
- &rect, 1);
- }
-}
-
-static void
-DrawOuterBorders(Tabset *setPtr, Drawable drawable)
-{
- /*
- * Draw 3D border just inside of the focus highlight ring. We draw the
- * border even if the relief is flat so that any tabs that hang over the
- * edge will be clipped.
- */
- if (setPtr->borderWidth > 0) {
- Blt_DrawBackgroundRectangle(setPtr->tkwin, drawable, setPtr->bg,
- setPtr->highlightWidth + setPtr->xOffset,
- setPtr->highlightWidth + setPtr->yOffset,
- Tk_Width(setPtr->tkwin) - 2 * setPtr->highlightWidth,
- Tk_Height(setPtr->tkwin) - 2 * setPtr->highlightWidth,
- setPtr->borderWidth, setPtr->relief);
- }
- /* Draw focus highlight ring. */
- if (setPtr->highlightWidth > 0) {
- XColor *color;
- GC gc;
-
- color = (setPtr->flags & FOCUS)
- ? setPtr->highlightColor : setPtr->highlightBg;
- gc = Tk_GCForColor(color, drawable);
- Tk_DrawFocusHighlight(setPtr->tkwin, gc, setPtr->highlightWidth,
- drawable);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayTabset --
- *
- * This procedure is invoked to display the widget.
- *
- * Recomputes the layout of the widget if necessary. This is necessary if
- * the world coordinate system has changed. Sets the vertical and
- * horizontal scrollbars. This is done here since the window width and
- * height are needed for the scrollbar calculations.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayTabset(ClientData clientData) /* Information about widget. */
-{
- Tabset *setPtr = clientData;
- Pixmap pixmap;
- int width, height;
- int redrawAll;
-
- redrawAll = setPtr->flags & REDRAW_ALL;
- setPtr->flags &= ~(REDRAW_PENDING | REDRAW_ALL);
- if (setPtr->tkwin == NULL) {
- return; /* Window has been destroyed. */
- }
- if (setPtr->flags & LAYOUT_PENDING) {
- ComputeLayout(setPtr);
- setPtr->flags &= ~LAYOUT_PENDING;
- }
- if ((setPtr->reqHeight == 0) || (setPtr->reqWidth == 0)) {
- width = height = 0;
- if (setPtr->side & (SIDE_LEFT | SIDE_RIGHT)) {
- height = setPtr->worldWidth;
- } else {
- width = setPtr->worldWidth;
- }
- if (setPtr->reqWidth > 0) {
- width = setPtr->reqWidth;
- } else if (setPtr->pageWidth > 0) {
- width = setPtr->pageWidth;
- }
- if (setPtr->reqHeight > 0) {
- height = setPtr->reqHeight;
- } else if (setPtr->pageHeight > 0) {
- height = setPtr->pageHeight;
- }
- if (setPtr->side & (SIDE_LEFT | SIDE_RIGHT)) {
-#ifdef notdef
- width += setPtr->pageTop + setPtr->inset + setPtr->inset2;
- height += setPtr->inset + setPtr->inset2;
-#else
- width += 2 * setPtr->inset + setPtr->pageTop + setPtr->inset2;
- height += 2 * setPtr->inset;
-#endif
- } else {
- height += 2 * setPtr->inset + setPtr->pageTop + setPtr->inset2;
- width += 2 * setPtr->inset;
- }
- if ((Tk_ReqWidth(setPtr->tkwin) != width) ||
- (Tk_ReqHeight(setPtr->tkwin) != height)) {
- Tk_GeometryRequest(setPtr->tkwin, width, height);
- }
- }
- if (setPtr->flags & SCROLL_PENDING) {
- width = VPORTWIDTH(setPtr);
- setPtr->scrollOffset = Blt_AdjustViewport(setPtr->scrollOffset,
- setPtr->worldWidth, width, setPtr->scrollUnits,
- BLT_SCROLL_MODE_HIERBOX);
- if (setPtr->scrollCmdObjPtr != NULL) {
- Blt_UpdateScrollbar(setPtr->interp, setPtr->scrollCmdObjPtr,
- setPtr->scrollOffset, setPtr->scrollOffset + width,
- setPtr->worldWidth);
- }
- ComputeVisibleTabs(setPtr);
- setPtr->flags &= ~SCROLL_PENDING;
- }
- if (!Tk_IsMapped(setPtr->tkwin)) {
- return;
- }
- width = Tk_Width(setPtr->tkwin);
- height = Tk_Height(setPtr->tkwin);
- setPtr->xOffset = setPtr->yOffset = 0; /* Offset of the window origin
- * from the pixmap created
- * below. */
- if (!redrawAll) {
- /* Create a pixmap only the size of the tab region. This saves the X
- * server from rendering the entire folder background polygon each
- * time. This is good for scrolling and active tabs. */
- switch (setPtr->side) {
- case SIDE_TOP:
- height = setPtr->pageTop + setPtr->inset + setPtr->inset2;
- break;
- case SIDE_BOTTOM:
- setPtr->yOffset = setPtr->pageTop - height;
- height = setPtr->pageTop + setPtr->inset + setPtr->inset2;
- break;
- case SIDE_LEFT:
- width = setPtr->pageTop + setPtr->inset + setPtr->inset2;
- break;
- case SIDE_RIGHT:
- setPtr->xOffset = setPtr->pageTop - width;
- width = setPtr->pageTop + setPtr->inset + setPtr->inset2;
- break;
- }
- }
- pixmap = Tk_GetPixmap(setPtr->display, Tk_WindowId(setPtr->tkwin),
- width, height, Tk_Depth(setPtr->tkwin));
- /*
- * Clear the background either by tiling a pixmap or filling with a solid
- * color. Tiling takes precedence.
- */
- Blt_FillBackgroundRectangle(setPtr->tkwin, pixmap, setPtr->bg,
- setPtr->xOffset, setPtr->yOffset,
- Tk_Width(setPtr->tkwin), Tk_Height(setPtr->tkwin),
- 0, TK_RELIEF_FLAT);
-
- if (setPtr->nVisible > 0) {
- int i;
- Tab *tabPtr;
- Blt_ChainLink link;
-
- link = setPtr->startPtr->link;
- for (i = 0; i < Blt_Chain_GetLength(setPtr->chain); i++) {
- link = Blt_Chain_PrevLink(link);
- if (link == NULL) {
- link = Blt_Chain_LastLink(setPtr->chain);
- }
- tabPtr = Blt_Chain_GetValue(link);
- if ((tabPtr != setPtr->selectPtr) && (tabPtr->flags & ONSCREEN)) {
- DrawFolder(setPtr, tabPtr, pixmap);
- }
- }
- DrawFolder(setPtr, setPtr->selectPtr, pixmap);
- if (setPtr->flags & TEAROFF) {
- DrawPerforation(setPtr, setPtr->selectPtr, pixmap);
- }
-
- if ((setPtr->selectPtr->tkwin != NULL) &&
- (setPtr->selectPtr->container == NULL)) {
- XRectangle rect;
-
- GetWindowRectangle(setPtr->selectPtr, setPtr->tkwin, FALSE, &rect);
- ArrangeWindow(setPtr->selectPtr->tkwin, &rect, 0);
- }
- }
- DrawOuterBorders(setPtr, pixmap);
- XCopyArea(setPtr->display, pixmap, Tk_WindowId(setPtr->tkwin),
- setPtr->highlightGC, 0, 0, width, height, -setPtr->xOffset,
- -setPtr->yOffset);
- Tk_FreePixmap(setPtr->display, pixmap);
-}
-
-/*
- * From the left edge:
- *
- * |a|b|c|d|e| f |d|e|g|h| i |h|g|e|d|f| j |e|d|c|b|a|
- *
- * a. highlight ring
- * b. tabset 3D border
- * c. outer gap
- * d. page border
- * e. page corner
- * f. gap + select pad
- * g. label pad x (worldX)
- * h. internal pad x
- * i. label width
- * j. rest of page width
- *
- * worldX, worldY
- * |
- * |
- * * 4+ . . +5
- * 3+ +6
- * . .
- * . .
- * 1+. . .2+ +7 . . . .+8
- * 0+ +9
- * . .
- * . .
- * . .
- *11+------------------------------+10
- *
- */
-static void
-DisplayTearoff(ClientData clientData)
-{
- Tabset *setPtr;
- Tab *tabPtr;
- Drawable drawable;
- XPoint points[16];
- XPoint *pointPtr;
- int width, height;
- int left, bottom, right, top;
- int x, y;
- int nPoints;
- Tk_Window tkwin;
- Tk_Window parent;
- XRectangle rect;
-
- tabPtr = clientData;
- if (tabPtr == NULL) {
- return;
- }
- tabPtr->flags &= ~TEAROFF_REDRAW;
- setPtr = tabPtr->setPtr;
- if (setPtr->tkwin == NULL) {
- return;
- }
- tkwin = tabPtr->container;
- drawable = Tk_WindowId(tkwin);
-
- Blt_FillBackgroundRectangle(tkwin, drawable, setPtr->bg, 0, 0,
- Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
-
- width = Tk_Width(tkwin) - 2 * setPtr->inset;
- height = Tk_Height(tkwin) - 2 * setPtr->inset;
- x = setPtr->inset + setPtr->gap + setPtr->corner;
- y = setPtr->inset;
-
- left = setPtr->inset;
- right = setPtr->inset + width;
- top = setPtr->inset + setPtr->corner + setPtr->xSelectPad;
- bottom = setPtr->inset + height;
-
- /*
- * worldX, worldY
- * |
- * * 4+ . . +5
- * 3+ +6
- * . .
- * . .
- * 1+. . .2+ +7 . . . .+8
- * 0+ +9
- * . .
- * . .
- * . .
- *11+------------------------------+10
- */
-
- nPoints = 0;
- pointPtr = points;
-
- TopLeft(left, top);
- NextPoint(x, top);
- TopLeft(x, y);
- x += tabPtr->worldWidth;
- TopRight(x, y);
- NextPoint(x, top);
- TopRight(right, top);
- NextPoint(right, bottom);
- NextPoint(left, bottom);
- EndPoint(points[0].x, points[0].y);
- Draw3dFolder(setPtr, tabPtr, drawable, SIDE_TOP, points, nPoints);
-
- parent = (tabPtr->container == NULL) ? setPtr->tkwin : tabPtr->container;
- GetWindowRectangle(tabPtr, parent, TRUE, &rect);
- ArrangeWindow(tabPtr->tkwin, &rect, TRUE);
-
- /* Draw 3D border. */
- if ((setPtr->borderWidth > 0) && (setPtr->relief != TK_RELIEF_FLAT)) {
- Blt_DrawBackgroundRectangle(tkwin, drawable, setPtr->bg, 0, 0,
- Tk_Width(tkwin), Tk_Height(tkwin), setPtr->borderWidth,
- setPtr->relief);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TabsetCmd --
- *
- * This procedure is invoked to process the "tabset" command. See the
- * user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec tabsetOps[] =
-{
- {"activate", 2, ActivateOp, 3, 3, "tab",},
- {"add", 2, AddOp, 2, 0, "?label? ?option-value..?",},
- {"bind", 2, BindOp, 2, 5, "tab ?sequence command?",},
- {"button", 2, ButtonOp, 2, 0, "args",},
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"close", 2, CloseOp, 3, 3, "tab",},
- {"configure", 2, ConfigureOp, 2, 0, "?option value?...",},
- {"delete", 2, DeleteOp, 2, 0, "?tab...?",},
- {"dockall", 2, DockallOp, 2, 2, "" },
- {"exists", 3, ExistsOp, 3, 3, "tab",},
- {"extents", 1, ExtentsOp, 3, 3, "tab",},
- {"focus", 1, FocusOp, 2, 3, "?tab?",},
- {"highlight", 1, ActivateOp, 3, 3, "tab",},
- {"id", 2, IdOp, 3, 3, "tab",},
- {"index", 3, IndexOp, 3, 3, "tab",},
- {"insert", 3, InsertOp, 3, 0, "position ?option value?",},
- {"invoke", 3, InvokeOp, 3, 3, "tab",},
- {"move", 1, MoveOp, 5, 5, "tab after|before tab",},
- {"names", 2, NamesOp, 2, 0, "?pattern...?",},
- {"nearest", 2, NearestOp, 4, 4, "x y",},
- {"perforation", 1, PerforationOp, 2, 0, "args",},
- {"scan", 2, ScanOp, 5, 5, "dragto|mark x y",},
- {"see", 3, SeeOp, 3, 3, "tab",},
- {"select", 3, SelectOp, 3, 3, "tab",},
- {"size", 2, SizeOp, 2, 2, "",},
- {"tab", 2, TabOp, 2, 0, "oper args",},
- {"tag", 2, TagOp, 2, 0, "oper args",},
- {"tearoff", 2, TearoffOp, 3, 4, "tab ?parent?",},
- {"view", 1, ViewOp, 2, 5,
- "?moveto fract? ?scroll number what?",},
-};
-
-static int nTabsetOps = sizeof(tabsetOps) / sizeof(Blt_OpSpec);
-
-static int
-TabsetInstCmd(
- ClientData clientData, /* Information about the widget. */
- Tcl_Interp *interp, /* Interpreter to report errors. */
- int objc, /* # of arguments. */
- Tcl_Obj *const *objv) /* Vector of argument strings. */
-{
- TabsetCmdProc *proc;
- Tabset *setPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTabsetOps, tabsetOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(setPtr);
- result = (*proc) (setPtr, interp, objc, objv);
- Tcl_Release(setPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TabsetInstDeletedCmd --
- *
- * This procedure can be called if the window was destroyed (tkwin will
- * be NULL) and the command was deleted automatically. In this case, we
- * need to do nothing.
- *
- * Otherwise this routine was called because the command was deleted.
- * Then we need to clean-up and destroy the widget.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TabsetInstDeletedCmd(ClientData clientData)
-{
- Tabset *setPtr = clientData;
-
- if (setPtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = setPtr->tkwin;
- setPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TabsetCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds
- * to a widget managed by this module. See the user documentation for
- * details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * See the user documentation.
- *
- *
- * blt::tabset pathName ?option value?...
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-TabsetCmd(
- ClientData clientData, /* Main window associated with interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- Tabset *setPtr;
- Tk_Window tkwin;
- unsigned int mask;
- Tcl_CmdInfo cmdInfo;
- const char *pathName;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?option value?...\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- pathName = Tcl_GetString(objv[1]);
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), pathName,
- (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- /*
- * Try to invoke a procedure to initialize various bindings on tabs.
- * Source the file containing the procedure now if the procedure isn't
- * currently defined. We deferred this to now so that the user could set
- * the variable "blt_library" within the script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::Tabset::Init", &cmdInfo)) {
- static char initCmd[] =
- "source [file join $blt_library tabset.tcl]";
-
- if (Tcl_GlobalEval(interp, initCmd) != TCL_OK) {
- char info[200];
-
- sprintf_s(info, 200, "\n (while loading bindings for %s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- Tk_DestroyWindow(setPtr->tkwin);
- return TCL_ERROR;
- }
- }
- setPtr = NewTabset(interp, tkwin);
- if (ConfigureTabset(interp, setPtr, objc - 2, objv + 2, 0) != TCL_OK) {
- Tk_DestroyWindow(setPtr->tkwin);
- return TCL_ERROR;
- }
- if (ConfigureButton(interp, setPtr, 0, NULL, 0) != TCL_OK) {
- Tk_DestroyWindow(setPtr->tkwin);
- return TCL_ERROR;
- }
- mask = (ExposureMask | StructureNotifyMask | FocusChangeMask);
- Tk_CreateEventHandler(tkwin, mask, TabsetEventProc, setPtr);
- setPtr->cmdToken = Tcl_CreateObjCommand(interp, pathName, TabsetInstCmd,
- setPtr, TabsetInstDeletedCmd);
-
- if (Tcl_VarEval(interp, "::blt::Tabset::Init ",
- Tk_PathName(setPtr->tkwin), (char *)NULL) != TCL_OK) {
- Tk_DestroyWindow(setPtr->tkwin);
- return TCL_ERROR;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), pathName, -1);
- return TCL_OK;
-}
-
-int
-Blt_TabsetCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpecs[2] = {
- { "tabset", TabsetCmd, },
- { "tabnotebook", TabsetCmd, },
- };
- return Blt_InitCmds(interp, "::blt", cmdSpecs, 2);
-}
-
-#endif /* NO_TABSET */
-
-static GadgetRegion
-RotateRegion(Tab *tabPtr, int x, int y, unsigned int w, unsigned int h)
-{
- Tabset *setPtr;
- GadgetRegion r;
-
- setPtr = tabPtr->setPtr;
- if (setPtr->quad == ROTATE_90) {
- r.x = y;
- r.y = tabPtr->rotWidth - (x + w);
- r.w = h;
- r.h = w;
- } else if (setPtr->quad == ROTATE_270) {
- r.x = tabPtr->rotHeight - (y + h);
- r.y = x;
- r.w = h;
- r.h = w;
- } else {
- r.x = x;
- r.y = y;
- r.w = w, r.h = h;
- }
- return r;
-}
-
-/*
- * Computes the location and dimensions of the
- *
- * 1. icon
- * 2. text or image
- * 3. close button.
- * 4. focus rectangle
- * 5.
- * x,y
- * |1|2|3| 4 |5| 4 |3|2|1|
- *
- * 1. tab borderwidth
- * 2. corner offset or slant
- * 3. label pad
- * 4. label or text width
- * 5. pad
- */
-static void
-ComputeLabelOffsets(Tabset *setPtr, Tab *tabPtr)
-{
- int w, h;
- int x1, x2, y1, y2;
- int tx, ty, tw, th, maxLength;
- int ix, iy, iw, ih;
- int fx, fy, fw, fh;
- int worldWidth, worldHeight, labelWidth;
- int xSelPad, ySelPad;
-
- worldWidth = tabPtr->worldWidth;
- worldHeight = setPtr->tabHeight + setPtr->inset2;
-
- /* The world width of tab has to be fixed to remove the extra padding for
- * the slant/corner and the rotation based upon the side. */
- worldWidth -= (setPtr->flags & SLANT_LEFT)
- ? tabPtr->worldHeight : setPtr->inset2;
- worldWidth -= (setPtr->flags & SLANT_RIGHT)
- ? tabPtr->worldHeight : setPtr->inset2;
-
- xSelPad = ySelPad = 0;
- if (tabPtr == setPtr->selectPtr) {
- worldWidth += setPtr->xSelectPad;
- xSelPad = setPtr->xSelectPad / 2;
- ySelPad = setPtr->ySelectPad / 2;
- }
- if ((setPtr->quad == ROTATE_90) || (setPtr->quad == ROTATE_270)) {
- SWAP(worldWidth, worldHeight);
- }
- if (setPtr->side & (SIDE_RIGHT | SIDE_LEFT)) {
- SWAP(worldWidth, worldHeight);
- }
- tabPtr->rotWidth = worldWidth;
- tabPtr->rotHeight = worldHeight;
-
- x1 = y1 = 0;
- x2 = x1 + tabPtr->rotWidth;
- y2 = y1 + tabPtr->rotHeight;
-
-#if DEBUG1
- fprintf(stderr, "ComputeLabelOffset: -1. tab=%s x1=%d,y1=%d,x2=%d,y2=%d,w=%d,h=%d, w0=%d h0=%d\n",
- tabPtr->text, x1, y1, x2, y2, w, h, tabPtr->rotWidth,
- tabPtr->rotHeight);
-#endif
-
- /* Compute the positions of the tab in world coordinates (rotated 0
- * degrees). */
-
- /* Start with the upper/left and lower/right corners of the label inside of
- * the tab. This excludes the tab's borderwidth. */
-
- /* This is the available area for the label. */
- w = x2 - x1;
- h = y2 - y1;
-
- if ((w < 0) || (h < 0)) {
- return;
- }
-#if DEBUG1
- fprintf(stderr, "ComputeLabelOffset: 0. tab=%s x1=%d,y1=%d,x2=%d,y2=%d,w=%d,h=%d, w0=%d h0=%d\n",
- tabPtr->text, x1, y1, x2, y2, w, h, tabPtr->rotWidth,
- tabPtr->rotHeight);
-#endif
-
- /* Focus dashed rectangle. */
- {
- fx = x1;
- fy = y1;
- fw = ODD(w);
- fh = ODD(h);
- tabPtr->focusRegion = RotateRegion(tabPtr, fx, fy, fw, fh);
- }
-
- /* Close button geometry. */
- if ((setPtr->plusPtr != tabPtr) && (setPtr->flags & CLOSE_NEEDED)) {
- int bx, by, bw, bh;
-
- /* Close button is always located on the right side of the tab,
- * it's height is centered. */
- bx = x2 - CLOSE_WIDTH - setPtr->closeButton.borderWidth;
- by = y1;
- bw = CLOSE_WIDTH;
- bh = CLOSE_HEIGHT;
- if (h > bh) {
- by += (h - bh) / 2;
- } else {
- bh = h;
- }
- if (w < bw) {
- bw = w;
- }
- if ((setPtr->quad == ROTATE_0) || (setPtr->quad == ROTATE_180)) {
- bx += 2 * xSelPad;
- }
- tabPtr->buttonRegion = RotateRegion(tabPtr, bx, by, bw, bh);
-#if DEBUG1
- fprintf(stderr, "ComputeLabelOffset: button tab=%s x=%d,y=%d,w=%d,h=%d => x=%d,y=%d w=%d,h=%d\n",
- tabPtr->text, bx, by, bw, bh, tabPtr->buttonRegion.x,
- tabPtr->buttonRegion.y, tabPtr->buttonRegion.width,
- tabPtr->buttonRegion.height);
-#endif
- x2 -= bw + LABEL_PAD + 2 * setPtr->closeButton.borderWidth;
- }
-
- /* Label/image and icon. Their positioning is related because of
- * the -iconposition option. */
-
- w = x2 - x1;
- h = y2 - y1;
-
- if (tabPtr->icon != NULL) {
- iw = IconWidth(tabPtr->icon);
- ih = IconHeight(tabPtr->icon);
- } else {
- iw = ih = 0;
- }
- if (iw > w) {
- iw = w;
- }
- w = x2 - x1;
- h = y2 - y1;
-
- labelWidth = tabPtr->labelWidth0;
- if ((tabPtr != setPtr->plusPtr) && (setPtr->flags & CLOSE_NEEDED)) {
- labelWidth -= CLOSE_WIDTH + 2 * setPtr->closeButton.borderWidth;
- }
- if (w > labelWidth) {
- if (setPtr->justify == TK_JUSTIFY_CENTER) {
- x1 += (w - labelWidth) / 2;
- } else if (setPtr->justify == TK_JUSTIFY_RIGHT) {
- x1 += (w - labelWidth);
- }
- }
- if (tabPtr->text != NULL) {
- tw = tabPtr->textWidth0;
- th = tabPtr->textHeight0;
- } else {
- tw = th = 0;
- }
- w = x2 - x1;
- h = y2 - y1;
-#if DEBUG1
- fprintf(stderr, "ComputeLabelOffset: 1 tab=%s x=%d,y=%d,w=%d,h=%d, ww=%d wh=%d tabLabelWidth=%d lw=%d\n",
- tabPtr->text, x1, y1, w, h, tabPtr->worldWidth,
- tabPtr->worldHeight, tabPtr->labelWidth0, labelWidth);
-#endif
- maxLength = x2 - x1;
-
- if (tw > w) {
- tw = w;
- }
-
- /* Now compute the text/image and icon positions according to the text
- * side. Don't use the text/image width/height to compute the position of
- * the icon because the text will shrink with the available room. */
- switch (setPtr->iconPos) {
- case SIDE_LEFT:
- if (iw > w) { /* Not enough space for icon. */
- iw = w;
- w = 0;
- } else {
- w -= iw; /* Subtract space taken by icon. */
- }
- if (tw > w) { /* Not enough space for text. */
- tw = w;
- w = 0;
- } else {
- w -= tw; /* Subtract space taken by text. */
- }
- if (w < 0) {
- w = 0;
- }
- /* The text/image is to the right of the icon. */
- ix = x1;
- iy = y1;
- if (h > ih) {
- iy += (h - ih) / 2;
- }
- tx = ix + iw;
- if ((iw > 0) && (tw > 0)) {
- tx += LABEL_PAD;
- }
- ty = y1;
- if (h > th) {
- ty += (h - th) / 2;
- }
-#if DEBUG1
- fprintf(stderr, "tab=%s textWidth=%d, textHeight=%d => %d,%d %dx%d iw=%d ih=%d\n",
- tabPtr->text, tabPtr->textWidth0, tabPtr->textHeight0, tx, ty, tw, th,
- iw, ih);
-#endif
- break;
-
- case SIDE_RIGHT:
- /* The text/image is to the left of the icon. */
- tx = x1;
- ty = y1 + (h - th) / 2;
- ix = x2 - iw;
- iy = y1 + (h - ih) / 2;
- if ((iw > 0) && (tw > 0)) {
- ix += LABEL_PAD;
- }
- break;
- }
- tabPtr->iconRegion = RotateRegion(tabPtr, ix, iy, iw, ih);
-#ifdef DEBUG
- fprintf(stderr, "ComputeLabelOffset: icon tab=%s x=%d,y=%d,w=%d,h=%d => x=%d,y=%d w=%d,h=%d\n",
- tabPtr->text, ix, iy, iw, ih, tabPtr->iconRegion.x,
- tabPtr->iconRegion.y, tabPtr->iconRegion.width,
- tabPtr->iconRegion.height);
-#endif
- tabPtr->textRegion = RotateRegion(tabPtr, tx, ty, ODD(tw), ODD(th));
-#if DEBUG1
- fprintf(stderr, "ComputeLabelOffset: text tab=%s x=%d,y=%d,w=%d,h=%d => x=%d,y=%d w=%d,h=%d\n",
- tabPtr->text, tx, ty, tw, th, tabPtr->textRegion.x,
- tabPtr->textRegion.y, tabPtr->textRegion.width,
- tabPtr->textRegion.height);
-#endif
- /* Focus dashed rectangle. */
- {
- fx = tx;
- fy = ty;
- fw = ODD(tw);
- fh = ODD(th);
- tabPtr->focusRegion = RotateRegion(tabPtr, fx, fy, fw, fh);
- }
-
-}
-
-
-static void
-DrawButtonPictures(Tabset *setPtr)
-{
- Button *butPtr = &setPtr->closeButton;
-
- if (butPtr->active0 == NULL) {
- butPtr->active0 = Blt_PaintDelete(CLOSE_WIDTH, CLOSE_HEIGHT,
- butPtr->activeBg, butPtr->activeFg);
- }
- if ((butPtr->active != NULL) &&
- (butPtr->active != butPtr->active0)) {
- Blt_FreePicture(butPtr->active);
- }
- if (setPtr->angle == 0.0) {
- butPtr->active = butPtr->active0;
- } else {
- butPtr->active = Blt_RotatePicture(butPtr->active0, setPtr->angle);
- }
- if (butPtr->normal0 == NULL) {
- butPtr->normal0 = Blt_PaintDelete(CLOSE_WIDTH, CLOSE_HEIGHT,
- butPtr->normalBg, butPtr->normalFg);
- }
- if ((butPtr->normal != NULL) &&
- (butPtr->normal != butPtr->normal0)) {
- Blt_FreePicture(butPtr->normal);
- }
- if (setPtr->angle == 0.0) {
- butPtr->normal = butPtr->normal0;
- } else {
- butPtr->normal = Blt_RotatePicture(butPtr->normal0, setPtr->angle);
- }
-}
-
-/*
- * x,y
- * |1|2|3| 4 |5| 4 |3|2|1|
- *
- * 1. tab borderwidth
- * 2. corner offset or slant
- * 3. label pad
- * 4. label or text width
- * 5. pad
- */
-static void
-DrawLabel(Tabset *setPtr, Tab *tabPtr, Drawable drawable)
-{
- int x, y;
- int maxLength;
- XColor *bgColor;
- Blt_Background bg;
- TabStyle *stylePtr;
- int xSelPad, ySelPad;
- GadgetRegion *rPtr;
-
- if ((tabPtr->flags & ONSCREEN) == 0) {
- return;
- }
-
- ComputeLabelOffsets(setPtr, tabPtr);
-
- /* Get origin of tab. */
- WorldToScreen(setPtr, tabPtr->worldX, tabPtr->worldY, &x, &y);
- x += setPtr->xOffset; /* Adjust for pixmap offsets. */
- y += setPtr->yOffset;
-
- /* Adjust according the side. */
- if (setPtr->side & SIDE_BOTTOM) {
- y -= setPtr->tabHeight + tabPtr->padTop;
- } else if (setPtr->side & SIDE_LEFT) {
- /* y -= tabPtr->worldWidth; */
- } else if (setPtr->side & SIDE_RIGHT) {
- x -= setPtr->tabHeight + tabPtr->padTop;
- }
- /* Adjust the label's area according to the tab's slant. */
- if (setPtr->side & (SIDE_RIGHT | SIDE_LEFT)) {
- y += (setPtr->flags & SLANT_LEFT) ? setPtr->tabHeight : setPtr->inset2;
- } else {
- x += (setPtr->flags & SLANT_LEFT) ? setPtr->tabHeight : setPtr->inset2;
- }
-
-#if DEBUG0
- fprintf(stderr, "DrawLabel: tab=%s x=%d,y=%d wx=%d,wy=%d,ww=%d,wh=%d\n",
- tabPtr->text, x, y, tabPtr->worldX, tabPtr->worldY,
- tabPtr->worldWidth, tabPtr->worldHeight);
-#endif
- stylePtr = &setPtr->defStyle;
- bg = GETATTR(tabPtr, bg);
- xSelPad = ySelPad = 0;
- if (tabPtr == setPtr->selectPtr) {
- x -= setPtr->xSelectPad / 2;
- if (setPtr->side & SIDE_TOP) {
- y -= setPtr->ySelectPad;
- }
- if (setPtr->side & SIDE_BOTTOM) {
- y += setPtr->ySelectPad;
- }
- xSelPad = setPtr->xSelectPad / 2;
- ySelPad = setPtr->ySelectPad / 2;
- bg = GETATTR(tabPtr, selBg);
- }
- bgColor = Blt_BackgroundBorderColor(bg);
- if ((tabPtr == setPtr->activePtr) || (tabPtr == setPtr->activeButtonPtr)) {
- Blt_Background activeBg;
-
- activeBg = GETATTR(tabPtr, activeBg);
- bgColor = Blt_BackgroundBorderColor(activeBg);
- }
- rPtr = &tabPtr->buttonRegion;
- if ((setPtr->plusPtr != tabPtr) && (setPtr->flags & CLOSE_NEEDED) &&
- (tabPtr->flags & CLOSE_NEEDED) && (rPtr->w > 0) && (rPtr->h > 0)) {
- Button *butPtr = &setPtr->closeButton;
- Blt_Picture picture;
- int bx, by;
-
- DrawButtonPictures(setPtr);
- picture = (setPtr->activeButtonPtr == tabPtr)
- ? butPtr->active : butPtr->normal;
- if (setPtr->painter == NULL) {
- setPtr->painter = Blt_GetPainter(setPtr->tkwin, 1.0);
- }
-
- bx = x + rPtr->x;
- by = y + rPtr->y;
- Blt_PaintPictureWithBlend(setPtr->painter, drawable, picture, 0, 0,
- rPtr->w, rPtr->h, bx, by, 0, 1.0);
- }
-
- rPtr = &tabPtr->iconRegion;
- if ((tabPtr->icon != NULL) && (rPtr->w > 0) && (rPtr->h > 0)) {
- Tk_Image tkImage;
- int maxLength;
-
- maxLength = 10000;
- tkImage = IconBits(tabPtr->icon);
- if (setPtr->angle == 0.0) {
- Tk_RedrawImage(tkImage, 0, 0, rPtr->w, rPtr->h, drawable,
- x + rPtr->x, y + rPtr->y);
- } else {
- struct _Icon *iconPtr;
-
- iconPtr = tabPtr->icon;
- if (iconPtr->angle != setPtr->angle) {
- int isPhoto;
- Blt_Picture picture, rotated;
-
- if (iconPtr->picture != NULL) {
- Blt_FreePicture(iconPtr->picture);
- }
- picture = Blt_GetPictureFromImage(setPtr->interp, tkImage,
- &isPhoto);
- rotated = Blt_RotatePicture(picture, setPtr->angle);
- iconPtr->picture = rotated;
- iconPtr->angle = setPtr->angle;
- if (isPhoto) {
- Blt_FreePicture(picture);
- }
- }
- if (setPtr->painter == NULL) {
- setPtr->painter = Blt_GetPainter(setPtr->tkwin, 1.0);
- }
- Blt_PaintPictureWithBlend(setPtr->painter, drawable,
- iconPtr->picture, 0, 0, rPtr->w, rPtr->h, x + rPtr->x,
- y + rPtr->y, 0, 1.0);
- }
- }
- rPtr = &tabPtr->textRegion;
- if ((tabPtr->text != NULL) && (rPtr->w > 0) && (rPtr->h > 0)) {
- TextStyle ts;
- XColor *fgColor;
- Blt_Font font;
- int maxLength = -1;
-
- font = GETATTR(tabPtr, font);
- if (tabPtr == setPtr->selectPtr) {
- fgColor = GETATTR(tabPtr, selColor);
- } else if ((tabPtr == setPtr->activePtr) ||
- (tabPtr == setPtr->activeButtonPtr)) {
- fgColor = GETATTR(tabPtr, activeFg);
- } else {
- fgColor = GETATTR(tabPtr, textColor);
- }
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetAngle(ts, setPtr->angle);
- Blt_Ts_SetBackground(ts, bg);
- Blt_Ts_SetFont(ts, font);
- Blt_Ts_SetPadding(ts, 2, 2, 0, 0);
- if (tabPtr->flags & DISABLED) {
- Blt_Ts_SetState(ts, STATE_DISABLED);
- } else if (tabPtr->flags & ACTIVE) {
- Blt_Ts_SetState(ts, STATE_ACTIVE);
- }
- Blt_Ts_SetForeground(ts, fgColor);
- if ((setPtr->quad == ROTATE_90) || (setPtr->quad == ROTATE_270)) {
- maxLength = rPtr->h;
- } else {
- maxLength = rPtr->w;
- }
- if (tabPtr == setPtr->selectPtr) {
- maxLength += setPtr->xSelectPad;
- }
-#if DEBUG0
- fprintf(stderr, "DrawLayout: text tab=%s coords=%d,%d text=%dx%d ml=%d => region: x=%d,y=%d w=%d,h=%d\n",
- tabPtr->text, x, y, tabPtr->textWidth0, tabPtr->textHeight0,
- maxLength, rPtr->x, rPtr->y, rPtr->w, rPtr->h);
-#endif
- Blt_Ts_SetMaxLength(ts, maxLength);
- Blt_Ts_DrawLayout(setPtr->tkwin, drawable, tabPtr->layoutPtr, &ts,
- x + rPtr->x, y + rPtr->y);
- }
- rPtr = &tabPtr->focusRegion;
- if ((setPtr->flags & FOCUS) && (setPtr->focusPtr == tabPtr) &&
- (rPtr->w > 0) && (rPtr->h > 0)) {
- XColor *fg;
-
- if (tabPtr == setPtr->selectPtr) {
- fg = GETATTR(tabPtr, selColor);
- } else if (tabPtr == setPtr->activePtr) {
- fg = GETATTR(tabPtr, activeFg);
- } else {
- fg = GETATTR(tabPtr, textColor);
- }
- XSetForeground(setPtr->display, stylePtr->activeGC, fg->pixel);
- maxLength = rPtr->w + xSelPad;
- if ((setPtr->quad == ROTATE_0) || (setPtr->quad == ROTATE_180)) {
- XDrawRectangle(setPtr->display, drawable, stylePtr->activeGC,
- x + rPtr->x - 1, y + rPtr->y, maxLength + 1, rPtr->h);
- } else {
- XDrawRectangle(setPtr->display, drawable, stylePtr->activeGC,
- x + rPtr->x, y + rPtr->y - 1, maxLength, rPtr->h + 1);
- }
- }
-}
diff --git a/blt3.0.1/src/bltTed.c b/blt3.0.1/src/bltTed.c
deleted file mode 100644
index 879bfad..0000000
--- a/blt3.0.1/src/bltTed.c
+++ /dev/null
@@ -1,1826 +0,0 @@
-
-/*
- * bltTed.c --
- *
- * This module implements an editor for the table geometry manager in the BLT
- * toolkit.
- *
- * Copyright 1995-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include "bltSwitch.h"
-#include "bltTable.h"
-#include "bltFont.h"
-#include "bltText.h"
-
-typedef struct _TableEditor TableEditor;
-
-#define TABLE_THREAD_KEY "BLT Table Data"
-
-typedef struct {
- Blt_HashTable tableTable; /* Hash table of table structures keyed by
- * the address of the reference Tk window */
-} TableData;
-
-
-typedef struct {
- int flags;
- Tcl_Interp *interp;
- Tk_Window tkwin; /* Entry window */
- TableEntry *tePtr; /* Entry it represents */
- Table *tablePtr; /* Table where it can be found */
- TableEditor *tedPtr; /* Table editor */
- int mapped; /* Indicates if the debugging windows are
- * mapped */
-} EntryRep;
-
-
-typedef struct {
- Blt_Font font;
- XColor *widgetColor;
- XColor *cntlColor;
- XColor *normalFg, *normalBg;
- XColor *activeFg, *activeBg;
-
- Tk_Cursor cursor; /* Cursor to display inside of this window */
- Pixmap stipple;
-
- GC drawGC; /* GC to draw grid, outlines */
- GC fillGC; /* GC to fill entry area */
- GC widgetFillGC; /* GC to fill widget area */
- GC cntlGC; /* GC to fill rectangles */
-
-} EntryAttributes;
-
-typedef struct {
- int count;
- XRectangle *array;
-} Rectangles;
-
-struct _TableEditor {
- int gridLineWidth; /* Width of grid lines */
- int buttonHeight; /* Height of row/column buttons */
- int cavityPad; /* Extra padding to add to entry cavity */
- int min; /* Minimum size for partitions */
-
- EditorDrawProc *drawProc;
- EditorDestroyProc *destroyProc;
-
- Display *display;
- Blt_Font font;
- Table *tablePtr; /* Pointer to table being debugged */
- Tcl_Interp *interp;
- int flags;
- Tk_Window tkwin; /* Grid window */
- Tk_Window input; /* InputOnly window to receive events */
- int inputIsSibling;
-
- /* Form the grid */
- XSegment *segArr;
- int nSegs;
- XRectangle *padRectArr;
- int nPadRects;
- XRectangle *widgetPadRectArr;
- int nWidgetPadRects;
-
- XRectangle *cntlRectArr;
- int nCntlRects;
-
- XRectangle *rects;
- int nRects;
-
- XRectangle activeRectArr[5];
- int spanActive;
-
- GC rectGC; /* GC to fill rectangles */
- GC drawGC; /* GC to draw grid, outlines */
- GC fillGC; /* GC to fill window */
- GC spanGC; /* GC to fill spans */
- GC padRectGC; /* GC to draw padding */
-
- Tk_3DBorder border; /* Border to use with buttons */
- int relief;
- int borderWidth; /* Border width of buttons */
- XColor *normalBg;
- XColor *padColor;
- XColor *gridColor;
- XColor *buttonColor;
- XColor *spanColor;
-
- Pixmap padStipple;
- Pixmap spanStipple;
- Blt_Dashes dashes;
- char *fileName; /* If non-NULL, indicates name of file
- * to write final table output to */
- int mapped; /* Indicates if the debugging windows are
- * mapped */
- int gripSize;
- int doubleBuffer;
- Tk_Cursor cursor;
- Blt_Chain chain;
- int nextWindowId;
-
- EntryAttributes attributes; /* Entry attributes */
-};
-
-#define REDRAW_PENDING (1<<0) /* A DoWhenIdle handler has already
- * been queued to redraw the window */
-#define LAYOUT_PENDING (1<<1)
-
-/*
- *
- *
- * |Cavity|1|2|
- *
- *
- */
-#define DEF_ENTRY_ACTIVE_BG_MONO RGB_BLACK
-#define DEF_ENTRY_ACTIVE_FG_MONO RGB_WHITE
-#define DEF_ENTRY_ACTIVE_BACKGROUND RGB_BLACK
-#define DEF_ENTRY_ACTIVE_FOREGROUND RGB_WHITE
-#define DEF_ENTRY_CURSOR (char *)NULL
-#define DEF_ENTRY_FONT "Helvetica 10 Bold"
-#define DEF_ENTRY_NORMAL_BACKGROUND RGB_BLUE
-#define DEF_ENTRY_NORMAL_BG_MONO RGB_BLACK
-#define DEF_ENTRY_NORMAL_FOREGROUND RGB_WHITE
-#define DEF_ENTRY_NORMAL_FG_MONO RGB_WHITE
-#define DEF_ENTRY_WIDGET_BACKGROUND RGB_GREEN
-#define DEF_ENTRY_CONTROL_BACKGROUND RGB_YELLOW
-#define DEF_ENTRY_WIDGET_BG_MONO RGB_BLACK
-#define DEF_ENTRY_STIPPLE "gray50"
-#define DEF_GRID_BACKGROUND RGB_WHITE
-#define DEF_GRID_BG_MONO RGB_WHITE
-#define DEF_GRID_CURSOR "crosshair"
-#define DEF_GRID_DASHES (char *)NULL
-#define DEF_GRID_FOREGROUND RGB_BLACK
-#define DEF_GRID_FG_MONO RGB_BLACK
-#define DEF_GRID_FONT "Helvetica 10 Bold"
-#define DEF_GRID_LINE_WIDTH "1"
-#define DEF_GRID_PAD_COLOR RGB_RED
-#define DEF_GRID_PAD_MONO RGB_BLACK
-#define DEF_GRID_PAD_STIPPLE "gray25"
-#define DEF_GRID_PAD_CAVITY "0"
-#define DEF_GRID_PAD_MIN "8"
-#define DEF_ROWCOL_BACKGROUND RGB_RED
-#define DEF_ROWCOL_BG_MONO RGB_BLACK
-#define DEF_ROWCOL_BORDER_COLOR RGB_RED
-#define DEF_ROWCOL_BORDER_MONO RGB_BLACK
-#define DEF_ROWCOL_BORDERWIDTH "2"
-#define DEF_ROWCOL_HEIGHT "8"
-#define DEF_ROWCOL_RELIEF "raised"
-#define DEF_SPAN_STIPPLE "gray50"
-#define DEF_SPAN_COLOR RGB_BLACK
-#define DEF_SPAN_MONO RGB_BLACK
-#define DEF_SPAN_GRIP_SIZE "5"
-#define DEF_GRID_DOUBLE_BUFFER "1"
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BORDER, "-bg", "tedBorder", (char *)NULL,
- DEF_ROWCOL_BORDER_COLOR, Blt_Offset(TableEditor, border), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_BORDER, "-bg", "tedBorder", (char *)NULL,
- DEF_ROWCOL_BORDER_MONO, Blt_Offset(TableEditor, border), BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-background", "tedBackground", (char *)NULL,
- DEF_GRID_BACKGROUND, Blt_Offset(TableEditor, normalBg), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-background", "tedBackground", (char *)NULL,
- DEF_GRID_BG_MONO, Blt_Offset(TableEditor, normalBg), BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_CURSOR, "-cursor", "cursor", (char *)NULL,
- DEF_GRID_CURSOR, Blt_Offset(TableEditor, cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-gridcolor", "gridColor", (char *)NULL,
- DEF_GRID_FOREGROUND, Blt_Offset(TableEditor, gridColor), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-gridcolor", "gridColor", (char *)NULL,
- DEF_GRID_FG_MONO, Blt_Offset(TableEditor, gridColor), BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-buttoncolor", "buttonColor", (char *)NULL,
- DEF_ROWCOL_BACKGROUND, Blt_Offset(TableEditor, buttonColor), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-buttoncolor", "buttonColor", (char *)NULL,
- DEF_ROWCOL_BG_MONO, Blt_Offset(TableEditor, buttonColor), BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-padcolor", "padColor", (char *)NULL,
- DEF_GRID_PAD_COLOR, Blt_Offset(TableEditor, padColor), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-padcolor", "padColor", (char *)NULL,
- DEF_GRID_PAD_MONO, Blt_Offset(TableEditor, padColor), BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_BITMAP, "-padstipple", "padStipple", (char *)NULL,
- DEF_GRID_PAD_STIPPLE, Blt_Offset(TableEditor, padStipple), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FONT, "-font", "font", (char *)NULL,
- DEF_GRID_FONT, Blt_Offset(TableEditor, font), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-gridlinewidth", "gridLineWidth", (char *)NULL,
- DEF_GRID_LINE_WIDTH, Blt_Offset(TableEditor, gridLineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-buttonheight", "buttonHeight", (char *)NULL,
- DEF_ROWCOL_HEIGHT, Blt_Offset(TableEditor, buttonHeight),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-cavitypad", "cavityPad", (char *)NULL,
- DEF_GRID_PAD_CAVITY, Blt_Offset(TableEditor, cavityPad),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-minsize", "minSize", (char *)NULL,
- DEF_GRID_PAD_MIN, Blt_Offset(TableEditor, min),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_DASHES, "-dashes", "dashes", (char *)NULL,
- DEF_GRID_DASHES, Blt_Offset(TableEditor, dashes), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-relief", "relief", (char *)NULL,
- DEF_ROWCOL_RELIEF, Blt_Offset(TableEditor, relief), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", (char *)NULL,
- DEF_ROWCOL_BORDERWIDTH, Blt_Offset(TableEditor, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CURSOR, "-entrycursor", "entryCursor", (char *)NULL,
- DEF_ENTRY_CURSOR, Blt_Offset(TableEditor, attributes.cursor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_FONT, "-entryfont", "entryFont", (char *)NULL,
- DEF_ENTRY_FONT, Blt_Offset(TableEditor, attributes.font), 0},
- {BLT_CONFIG_BITMAP, "-entrystipple", "entryStipple", (char *)NULL,
- DEF_ENTRY_STIPPLE, Blt_Offset(TableEditor, attributes.stipple),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-widgetbackground", "widgetBackground", (char *)NULL,
- DEF_ENTRY_WIDGET_BACKGROUND, Blt_Offset(TableEditor, attributes.widgetColor),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-widgetbackground", "widgetBackground", (char *)NULL,
- DEF_ENTRY_WIDGET_BG_MONO, Blt_Offset(TableEditor, attributes.widgetColor),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-controlbackground", "controlBackground", (char *)NULL,
- DEF_ENTRY_CONTROL_BACKGROUND, Blt_Offset(TableEditor, attributes.cntlColor),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-controlbackground", "controlBackground", (char *)NULL,
- DEF_ENTRY_WIDGET_BG_MONO, Blt_Offset(TableEditor, attributes.cntlColor),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-entrybackground", "entryBackground", (char *)NULL,
- DEF_ENTRY_NORMAL_BACKGROUND, Blt_Offset(TableEditor, attributes.normalBg),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-entrybackground", "entryBackground", (char *)NULL,
- DEF_ENTRY_NORMAL_BG_MONO, Blt_Offset(TableEditor, attributes.normalBg),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-entryactivebackground", "entryActiveBackground", (char *)NULL,
- DEF_ENTRY_ACTIVE_BACKGROUND, Blt_Offset(TableEditor, attributes.activeBg),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-entryactivebackground", "entryActiveBackground", (char *)NULL,
- DEF_ENTRY_ACTIVE_BG_MONO, Blt_Offset(TableEditor, attributes.activeBg),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-entryactiveforeground", "entryActiveForeground", (char *)NULL,
- DEF_ENTRY_ACTIVE_FOREGROUND, Blt_Offset(TableEditor, attributes.activeFg),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-entryactiveforeground", "entryActiveForeground", (char *)NULL,
- DEF_ENTRY_ACTIVE_FG_MONO, Blt_Offset(TableEditor, attributes.activeFg),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-entryforeground", "entryForeground", (char *)NULL,
- DEF_ENTRY_NORMAL_FOREGROUND, Blt_Offset(TableEditor, attributes.normalFg),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-entryforeground", "entryForeground", (char *)NULL,
- DEF_ENTRY_NORMAL_FG_MONO, Blt_Offset(TableEditor, attributes.normalFg),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-spancolor", "spanColor", (char *)NULL,
- DEF_SPAN_COLOR, Blt_Offset(TableEditor, spanColor), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-spancolor", "spanColor", (char *)NULL,
- DEF_SPAN_MONO, Blt_Offset(TableEditor, spanColor), BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_BITMAP, "-spanstipple", "spanStipple", (char *)NULL,
- DEF_SPAN_STIPPLE, Blt_Offset(TableEditor, spanStipple), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-gripsize", "gripSize", (char *)NULL,
- DEF_SPAN_GRIP_SIZE, Blt_Offset(TableEditor, gripSize),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-dbl", "doubleBuffer", (char *)NULL,
- DEF_GRID_DOUBLE_BUFFER, Blt_Offset(TableEditor, doubleBuffer),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-
-
-static Tcl_FreeProc DestroyEditor;
-static Tcl_FreeProc DestroyEntry;
-static Tcl_FreeProc DestroyTableEditor;
-static Tcl_IdleProc DisplayEntry;
-static Tcl_IdleProc DisplayTableEditor;
-static Tcl_ObjCmdProc TedCmd;
-static Tk_EventProc EntryEventProc;
-static Tk_EventProc TableEditorEventProc;
-
-static void DrawEditor(Editor *editor);
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Queues a request to redraw the text window at the next idle
- * point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets redisplayed. Right now we don't do selective
- * redisplays: the whole window will be redrawn. This doesn't
- * seem to hurt performance noticeably, but if it does then this
- * could be changed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(TableEditor *tedPtr)
-{
- if ((tedPtr->tkwin != NULL) && !(tedPtr->flags & REDRAW_PENDING)) {
- tedPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayTableEditor, tedPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Queues a request to redraw the text window at the next idle
- * point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets redisplayed. Right now we don't do selective
- * redisplays: the whole window will be redrawn. This doesn't
- * seem to hurt performance noticeably, but if it does then this
- * could be changed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedrawEntry(EntryRep *repPtr)
-{
- if ((repPtr->tkwin != NULL) && !(repPtr->flags & REDRAW_PENDING)) {
- repPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayEntry, repPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various
- * events on the editing grid for the table.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EntryEventProc(ClientData clientData, XEvent *eventPtr)
-{
- EntryRep *repPtr = (EntryRep *)clientData;
-
- if (eventPtr->type == ConfigureNotify) {
- EventuallyRedrawEntry(repPtr);
- } else if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedrawEntry(repPtr);
- }
- } else if (eventPtr->type == DestroyNotify) {
- repPtr->tkwin = NULL;
- if (repPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayEntry, repPtr);
- }
- Tcl_EventuallyFree(repPtr, DestroyEntry);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TableEditorEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various
- * events on the editing grid for the table.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TableEditorEventProc(ClientData clientData, XEvent *eventPtr)
-{
- TableEditor *tedPtr = (TableEditor *) clientData;
-
- if (eventPtr->type == ConfigureNotify) {
- EventuallyRedraw(tedPtr);
- } else if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(tedPtr);
- }
- } else if (eventPtr->type == DestroyNotify) {
- tedPtr->tkwin = NULL;
- if (tedPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayTableEditor, tedPtr);
- }
- Tcl_EventuallyFree(tedPtr, DestroyTableEditor);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateGrid --
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateGrid(TableEditor *tedPtr)
-{
- Tcl_Interp *interp;
- Tk_Window tkwin;
- Tk_Window master;
- /*
- * Create a sibling window to cover the master window. It will
- * be stacked just above the master window.
- */
- interp = tedPtr->tablePtr->interp;
- master = tedPtr->tablePtr->tkwin;
- tkwin = Tk_CreateWindow(interp, master, "ted_%output%", (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- Tk_SetClass(tkwin, "BltTableEditor");
- Tk_CreateEventHandler(tkwin, ExposureMask | StructureNotifyMask,
- TableEditorEventProc, tedPtr);
- Tk_MoveResizeWindow(tkwin, 0, 0, Tk_Width(master), Tk_Height(master));
- Tk_RestackWindow(tkwin, Below, (Tk_Window)NULL);
- Tk_MapWindow(tkwin);
- tedPtr->tkwin = tkwin;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateEventWindow --
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateEventWindow(TableEditor *tedPtr)
-{
- Tcl_Interp *interp;
- Tk_Window tkwin;
- Tk_Window master;
- Tk_Window parent;
-
- interp = tedPtr->tablePtr->interp;
- master = tedPtr->tablePtr->tkwin;
- /*
- * Create an InputOnly window which sits above the table to
- * collect and dispatch user events.
- */
- if (Tk_IsTopLevel(master)) {
- /*
- * If master is a top-level window, it's also the parent of
- * the widgets (it can't have a sibling).
- * In this case, the InputOnly window is a child of the
- * master instead of a sibling.
- */
- parent = master;
- tkwin = Tk_CreateWindow(interp, parent, "ted_%input%", (char *)NULL);
- if (tkwin != NULL) {
- Tk_ResizeWindow(tkwin, Tk_Width(parent), Tk_Height(parent));
- }
- tedPtr->inputIsSibling = 0;
- } else {
- char *namePtr; /* Name of InputOnly window. */
-
- parent = Tk_Parent(master);
- namePtr = Blt_AssertMalloc(strlen(Tk_Name(master)) + 5);
- sprintf_s(namePtr, strlen(Tk_Name(master)) + 5, "ted_%s",
- Tk_Name(master));
- tkwin = Tk_CreateWindow(interp, parent, namePtr, (char *)NULL);
- Blt_Free(namePtr);
- if (tkwin != NULL) {
- Tk_MoveResizeWindow(tkwin, Tk_X(master), Tk_Y(master),
- Tk_Width(master), Tk_Height(master));
- }
- tedPtr->inputIsSibling = 1;
- }
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- Blt_MakeTransparentWindowExist(tkwin, Tk_WindowId(parent), TRUE);
- Tk_RestackWindow(tkwin, Above, (Tk_Window)NULL);
- Tk_MapWindow(tkwin);
- tedPtr->input = tkwin;
- return TCL_OK;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * CreateEntry --
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateEntry(TableEditor *tedPtr, TableEntry *tePtr)
-{
- Tk_Window tkwin, master;
- char string[200];
- EntryRep *repPtr;
-
- repPtr = Blt_AssertCalloc(1, sizeof(EntryRep));
- repPtr->tablePtr = tedPtr->tablePtr;
- repPtr->tedPtr = tedPtr;
- repPtr->interp = tedPtr->interp;
- repPtr->tePtr = tePtr;
- repPtr->mapped = 0;
-
- /*
- * Create a sibling window to cover the master window. It will
- * be stacked just above the master window.
- */
-
- master = tedPtr->tablePtr->tkwin;
- sprintf_s(string, 200, "bltTableEditor%d", tedPtr->nextWindowId);
- tedPtr->nextWindowId++;
- tkwin = Tk_CreateWindow(tedPtr->interp, master, string, (char *)NULL);
- if (tkwin == NULL) {
- Blt_Free(repPtr);
- return TCL_ERROR;
- }
- Tk_SetClass(tkwin, "BltTableEditor");
- Tk_CreateEventHandler(tkwin, ExposureMask | StructureNotifyMask,
- EntryEventProc, repPtr);
- repPtr->tkwin = tkwin;
- Blt_Chain_Append(tedPtr->chain, repPtr);
- return TCL_OK;
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyEntry --
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyEntry(DestroyData data)
-{
- EntryRep *repPtr = (EntryRep *)data;
- Blt_ChainLink link;
- TableEntry *tePtr;
-
- for (link = Blt_Chain_FirstLink(repPtr->tedPtr->chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- tePtr = Blt_Chain_GetValue(link);
- if (tePtr == repPtr->tePtr) {
- Blt_Chain_DeleteLink(repPtr->tedPtr->chain, link);
- Blt_Free(repPtr);
- return;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayEntry --
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayEntry(ClientData clientData)
-{
- EntryRep *repPtr = (EntryRep *) clientData;
- TableEditor *tedPtr;
- TableEntry *tePtr;
- Tk_Window tkwin;
- int x, y, width, height;
-
- repPtr->flags &= ~REDRAW_PENDING;
- if ((repPtr->tkwin == NULL) || (repPtr->tePtr == NULL)) {
- return;
- }
- if (!Tk_IsMapped(repPtr->tkwin)) {
- return;
- }
- tedPtr = repPtr->tedPtr;
- tePtr = repPtr->tePtr;
- tkwin = repPtr->tkwin;
-
- /*
- * Check if the entry size and position.
- * Move and resize the window accordingly.
- */
- x = Tk_X(tePtr->tkwin) - (tePtr->padLeft + tedPtr->cavityPad);
- y = Tk_Y(tePtr->tkwin) - (tePtr->padTop + tedPtr->cavityPad);
- width = Tk_Width(tePtr->tkwin) + PADDING(tePtr->xPad) +
- (2 * tedPtr->cavityPad);
- height = Tk_Height(tePtr->tkwin) + PADDING(tePtr->yPad) +
- (2 * tedPtr->cavityPad);
-
-
- if ((Tk_X(tkwin) != x) || (Tk_Y(tkwin) != y) ||
- (Tk_Width(tkwin) != width) || (Tk_Height(tkwin) != height)) {
- Tk_MoveResizeWindow(tkwin, x, y, width, height);
- Tk_RestackWindow(tkwin, Above, (Tk_Window)NULL);
- }
- /* Clear the background of the entry */
-
- XFillRectangle(Tk_Display(tkwin), Tk_WindowId(tkwin),
- tedPtr->attributes.fillGC, 0, 0, width, height);
-
- /* Draw the window */
-
- x = tePtr->padLeft + tedPtr->cavityPad;
- y = tePtr->padTop + tedPtr->cavityPad;
-
- XFillRectangle(Tk_Display(tkwin), Tk_WindowId(tkwin),
- tedPtr->attributes.widgetFillGC, x, y, Tk_Width(tePtr->tkwin),
- Tk_Height(tePtr->tkwin));
- XDrawRectangle(Tk_Display(tkwin), Tk_WindowId(tkwin),
- tedPtr->attributes.drawGC, x, y, Tk_Width(tePtr->tkwin),
- Tk_Height(tePtr->tkwin));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindEditor --
- *
- * Searches for a table associated with the window given by its
- * pathname. This window represents the master window of the table.
- *
- * Errors may occur because
- * 1) pathName does not represent a valid Tk window or
- * 2) the window is not associated with any table as its master.
- *
- * Results:
- * If a table entry exists, a pointer to the Table structure is
- * returned. Otherwise NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static TableEditor *
-FindEditor(ClientData clientData, Tcl_Interp *interp, Tcl_Obj *objPtr)
-{
- Table *tablePtr;
-
- if (Blt_GetTableFromObj(clientData, interp, objPtr, &tablePtr) != TCL_OK) {
- return NULL;
- }
- if (tablePtr->editPtr == NULL) {
- Tcl_AppendResult(interp, "no editor exists for table \"",
- Tk_PathName(tablePtr->tkwin), "\"", (char *)NULL);
- return NULL;
- }
- return (TableEditor *) tablePtr->editPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateTableEditor --
- *
- *---------------------------------------------------------------------------
- */
-static TableEditor *
-CreateTableEditor(Table *tablePtr, Tcl_Interp *interp)
-{
- TableEditor *tedPtr;
-
- tedPtr = Blt_AssertCalloc(1, sizeof(TableEditor));
- tedPtr->nextWindowId = 0;
- tedPtr->interp = interp;
- tedPtr->tablePtr = tablePtr;
- tedPtr->gridLineWidth = 1;
- tedPtr->buttonHeight = 0;
- tedPtr->cavityPad = 0;
- tedPtr->min = 3;
- tedPtr->gripSize = 5;
- tedPtr->drawProc = DrawEditor;
- tedPtr->destroyProc = DestroyEditor;
- tedPtr->display = Tk_Display(tablePtr->tkwin);
- tedPtr->relief = TK_RELIEF_RAISED;
- tedPtr->borderWidth = 2;
- tedPtr->doubleBuffer = 1;
- tedPtr->chain = Blt_Chain_Create();
- /* Create the grid window */
-
- if (CreateGrid(tedPtr) != TCL_OK) {
- return NULL;
- }
- /* Create an InputOnly window to collect user events */
- if (CreateEventWindow(tedPtr) != TCL_OK) {
- return NULL;
- }
- tablePtr->editPtr = (Editor *)tedPtr;
- return tedPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyTableEditor --
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyTableEditor(DestroyData freeProcData)
-{
- TableEditor *tedPtr = (TableEditor *) freeProcData;
-
- if (tedPtr->rects != NULL) {
- Blt_Free(tedPtr->rects);
- }
- if (tedPtr->segArr != NULL) {
- Blt_Free(tedPtr->segArr);
- }
- if (tedPtr->fillGC != NULL) {
- Tk_FreeGC(tedPtr->display, tedPtr->fillGC);
- }
- if (tedPtr->drawGC != NULL) {
- Blt_FreePrivateGC(tedPtr->display, tedPtr->drawGC);
- }
- if (tedPtr->rectGC != NULL) {
- Tk_FreeGC(tedPtr->display, tedPtr->rectGC);
- }
- if (tedPtr->padRectGC != NULL) {
- Tk_FreeGC(tedPtr->display, tedPtr->padRectGC);
- }
- /* Is this save ? */
- tedPtr->tablePtr->editPtr = NULL;
- Blt_Free(tedPtr);
-
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureTableEditor --
- *
- * This procedure is called to process an objv/objc list in order to
- * configure the table geometry manager.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is
- * returned, then interp->result contains an error message.
- *
- * Side effects:
- * Table configuration options (padx, pady, rows, columns, etc) get
- * set. The table is recalculated and arranged at the next idle
- * point.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureTableEditor(TableEditor *tedPtr, int objc, Tcl_Obj *const *objv,
- int flags)
-{
- XGCValues gcValues;
- GC newGC;
- unsigned long gcMask;
-
- if (Blt_ConfigureWidgetFromObj(tedPtr->interp, tedPtr->tkwin, configSpecs,
- objc, objv, (char *)tedPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- /* GC for filling background of edit window */
-
- gcMask = GCForeground;
- gcValues.foreground = tedPtr->normalBg->pixel;
- newGC = Tk_GetGC(tedPtr->tkwin, gcMask, &gcValues);
- if (tedPtr->fillGC != NULL) {
- Tk_FreeGC(tedPtr->display, tedPtr->fillGC);
- }
- tedPtr->fillGC = newGC;
-
- /* GC for drawing grid lines */
-
- gcMask = (GCForeground | GCBackground | GCLineWidth | GCLineStyle |
- GCCapStyle | GCJoinStyle | GCFont);
- gcValues.font = Blt_FontId(tedPtr->font);
- gcValues.foreground = tedPtr->gridColor->pixel;
- gcValues.background = tedPtr->normalBg->pixel;
- gcValues.line_width = LineWidth(tedPtr->gridLineWidth);
- gcValues.cap_style = CapRound;
- gcValues.join_style = JoinRound;
- gcValues.line_style = LineSolid;
- if (LineIsDashed(tedPtr->dashes)) {
- gcValues.line_style = LineOnOffDash;
- }
- newGC = Blt_GetPrivateGC(tedPtr->tkwin, gcMask, &gcValues);
- if (tedPtr->drawGC != NULL) {
- Blt_FreePrivateGC(tedPtr->display, tedPtr->drawGC);
- }
- if (LineIsDashed(tedPtr->dashes)) {
- XSetDashes(tedPtr->display, newGC, 0,
- (const char *)tedPtr->dashes.values,
- strlen((char *)tedPtr->dashes.values));
- }
- tedPtr->drawGC = newGC;
-
- /* GC for button rectangles */
-
- gcMask = GCForeground;
- gcValues.foreground = tedPtr->buttonColor->pixel;
- newGC = Tk_GetGC(tedPtr->tkwin, gcMask, &gcValues);
- if (tedPtr->rectGC != NULL) {
- Tk_FreeGC(tedPtr->display, tedPtr->rectGC);
- }
- tedPtr->rectGC = newGC;
-
- /* GC for button rectangles */
-
- gcMask = GCForeground;
- gcValues.foreground = tedPtr->padColor->pixel;
- if (tedPtr->padStipple != None) {
- gcMask |= GCStipple | GCFillStyle;
- gcValues.stipple = tedPtr->padStipple;
- gcValues.fill_style = FillStippled;
- }
- newGC = Tk_GetGC(tedPtr->tkwin, gcMask, &gcValues);
- if (tedPtr->padRectGC != NULL) {
- Tk_FreeGC(tedPtr->display, tedPtr->padRectGC);
- }
- tedPtr->padRectGC = newGC;
-
- /* GC for filling entrys */
-
- gcMask = GCForeground;
- gcValues.foreground = tedPtr->attributes.normalBg->pixel;
- if (tedPtr->attributes.stipple != None) {
- gcMask |= GCStipple | GCFillStyle;
- gcValues.stipple = tedPtr->attributes.stipple;
- gcValues.fill_style = FillStippled;
- }
- newGC = Tk_GetGC(tedPtr->tkwin, gcMask, &gcValues);
- if (tedPtr->attributes.fillGC != NULL) {
- Tk_FreeGC(tedPtr->display, tedPtr->attributes.fillGC);
- }
- tedPtr->attributes.fillGC = newGC;
-
- /* GC for drawing entrys */
-
- gcMask = GCForeground | GCBackground | GCFont;
- gcValues.foreground = tedPtr->attributes.normalFg->pixel;
- gcValues.background = tedPtr->attributes.normalBg->pixel;
- gcValues.font = Blt_FontId(tedPtr->attributes.font);
- newGC = Tk_GetGC(tedPtr->tkwin, gcMask, &gcValues);
- if (tedPtr->attributes.drawGC != NULL) {
- Blt_FreePrivateGC(tedPtr->display, tedPtr->attributes.drawGC);
- }
- tedPtr->attributes.drawGC = newGC;
-
- /* GC for filling widget rectangles */
-
- gcMask = GCForeground;
- gcValues.foreground = tedPtr->attributes.widgetColor->pixel;
- newGC = Tk_GetGC(tedPtr->tkwin, gcMask, &gcValues);
- if (tedPtr->attributes.widgetFillGC != NULL) {
- Tk_FreeGC(tedPtr->display, tedPtr->attributes.widgetFillGC);
- }
- tedPtr->attributes.widgetFillGC = newGC;
-
- gcMask = GCForeground;
- gcValues.foreground = tedPtr->attributes.cntlColor->pixel;
- newGC = Tk_GetGC(tedPtr->tkwin, gcMask, &gcValues);
- if (tedPtr->attributes.cntlGC != NULL) {
- Tk_FreeGC(tedPtr->display, tedPtr->attributes.cntlGC);
- }
- tedPtr->attributes.cntlGC = newGC;
-
- /* GC for filling span rectangle */
-
- gcMask = GCForeground;
- gcValues.foreground = tedPtr->spanColor->pixel;
- if (tedPtr->spanStipple != None) {
- gcMask |= GCStipple | GCFillStyle;
- gcValues.stipple = tedPtr->spanStipple;
- gcValues.fill_style = FillStippled;
- }
- newGC = Tk_GetGC(tedPtr->tkwin, gcMask, &gcValues);
- if (tedPtr->spanGC != NULL) {
- Tk_FreeGC(tedPtr->display, tedPtr->spanGC);
- }
- tedPtr->spanGC = newGC;
-
- /* Define cursor for grid events */
- if (tedPtr->cursor != None) {
- Tk_DefineCursor(tedPtr->input, tedPtr->cursor);
- } else {
- Tk_UndefineCursor(tedPtr->input);
- }
- return TCL_OK;
-}
-
-
-static void
-LayoutGrid(TableEditor *tedPtr)
-{
- int needed;
- XSegment *segArr;
- Table *tablePtr;
- Blt_ChainLink link;
- RowColumn *rcPtr;
- int startX, endX;
- int startY, endY;
- int count;
-
- tablePtr = tedPtr->tablePtr;
- if (tedPtr->segArr != NULL) {
- Blt_Free(tedPtr->segArr);
- tedPtr->segArr = NULL;
- }
- tedPtr->nSegs = 0;
- if ((tablePtr->nRows == 0) || (tablePtr->nColumns == 0)) {
- return;
- }
- needed = tablePtr->nRows + tablePtr->nColumns + 2;
- segArr = Blt_Calloc(needed, sizeof(XSegment));
- if (segArr == NULL) {
- return;
- }
- link = Blt_Chain_FirstLink(tablePtr->cols.chain);
- rcPtr = Blt_Chain_GetValue(link);
- startX = rcPtr->offset - tedPtr->gridLineWidth;
-
- link = Blt_Chain_LastLink(tablePtr->cols.chain);
- rcPtr = Blt_Chain_GetValue(link);
- endX = rcPtr->offset + rcPtr->size - 1;
-
- link = Blt_Chain_FirstLink(tablePtr->rows.chain);
- rcPtr = Blt_Chain_GetValue(link);
- startY = rcPtr->offset - tedPtr->gridLineWidth;
-
- link = Blt_Chain_LastLink(tablePtr->rows.chain);
- rcPtr = Blt_Chain_GetValue(link);
- endY = rcPtr->offset + rcPtr->size - 1;
-
- count = 0; /* Reset segment counter */
-
- for (link = Blt_Chain_FirstLink(tablePtr->rows.chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- rcPtr = Blt_Chain_GetValue(link);
- segArr[count].x1 = startX;
- segArr[count].x2 = endX;
- segArr[count].y1 = segArr[count].y2 = rcPtr->offset -
- tedPtr->gridLineWidth;
- count++;
- }
- segArr[count].x1 = startX;
- segArr[count].x2 = endX;
- segArr[count].y1 = segArr[count].y2 = endY;
- count++;
-
- for (link = Blt_Chain_FirstLink(tablePtr->cols.chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- rcPtr = Blt_Chain_GetValue(link);
- segArr[count].y1 = startY;
- segArr[count].y2 = endY;
- segArr[count].x1 = segArr[count].x2 = rcPtr->offset -
- tedPtr->gridLineWidth;
- count++;
- }
- segArr[count].x1 = segArr[count].x2 = endX;
- segArr[count].y1 = startY;
- segArr[count].y2 = endY;
- count++;
- assert(count == needed);
- if (tedPtr->segArr != NULL) {
- Blt_Free(tedPtr->segArr);
- }
- tedPtr->segArr = segArr;
- tedPtr->nSegs = count;
-}
-
-
-static void
-LayoutPads(TableEditor *tedPtr)
-{
- int needed;
- XRectangle *rects, *rectPtr;
- Table *tablePtr;
- Blt_ChainLink link;
- RowColumn *rcPtr;
- int startX, endX;
- int startY, endY;
- int count;
-
- tablePtr = tedPtr->tablePtr;
- if (tedPtr->padRectArr != NULL) {
- Blt_Free(tedPtr->padRectArr);
- tedPtr->padRectArr = NULL;
- }
- tedPtr->nPadRects = 0;
- if ((tablePtr->nRows == 0) || (tablePtr->nColumns == 0)) {
- return;
- }
- needed = 2 * (tablePtr->nRows + tablePtr->nColumns);
- rects = Blt_Calloc(needed, sizeof(XRectangle));
- if (rects == NULL) {
- return;
- }
- link = Blt_Chain_FirstLink(tablePtr->cols.chain);
- rcPtr = Blt_Chain_GetValue(link);
- startX = rcPtr->offset;
-
- link = Blt_Chain_LastLink(tablePtr->cols.chain);
- rcPtr = Blt_Chain_GetValue(link);
- endX = (rcPtr->offset + rcPtr->size);
-
- link = Blt_Chain_FirstLink(tablePtr->rows.chain);
- rcPtr = Blt_Chain_GetValue(link);
- startY = rcPtr->offset;
-
- link = Blt_Chain_LastLink(tablePtr->rows.chain);
- rcPtr = Blt_Chain_GetValue(link);
- endY = (rcPtr->offset + rcPtr->size);
-
- count = 0; /* Reset segment counter */
- rectPtr = rects;
- for (link = Blt_Chain_FirstLink(tablePtr->rows.chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- rcPtr = Blt_Chain_GetValue(link);
- if (rcPtr->pad.side1 > 0) {
- rectPtr->x = startX;
- rectPtr->y = rcPtr->offset;
- rectPtr->height = rcPtr->pad.side1;
- rectPtr->width = endX - startX - 1;
- rectPtr++, count++;
- }
- if (rcPtr->pad.side2 > 0) {
- rectPtr->x = startX;
- rectPtr->y = rcPtr->offset + rcPtr->size - rcPtr->pad.side2 - 1;
- rectPtr->height = rcPtr->pad.side2;
- rectPtr->width = endX - startX - 1;
- rectPtr++, count++;
- }
- }
- for (link = Blt_Chain_FirstLink(tablePtr->cols.chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- rcPtr = Blt_Chain_GetValue(link);
- if (rcPtr->pad.side1 > 0) {
- rectPtr->x = rcPtr->offset;
- rectPtr->y = startY;
- rectPtr->height = endY - startY - 1;
- rectPtr->width = rcPtr->pad.side1;
- rectPtr++, count++;
- }
- if (rcPtr->pad.side2 > 0) {
- rectPtr->x = rcPtr->offset + rcPtr->size - rcPtr->pad.side2;
- rectPtr->y = startY;
- rectPtr->height = endY - startY - 1;
- rectPtr->width = rcPtr->pad.side2;
- rectPtr++, count++;
- }
- }
- if (count == 0) {
- Blt_Free(rects);
- return;
- }
- tedPtr->padRectArr = rects;
- tedPtr->nPadRects = count;
-}
-
-static void
-LayoutEntries(TableEditor *tedPtr)
-{
- TableEntry *tePtr;
- XRectangle *rects;
- int needed;
- int count;
- Blt_ChainLink link;
-
- if (tedPtr->widgetPadRectArr != NULL) {
- Blt_Free(tedPtr->widgetPadRectArr);
- tedPtr->widgetPadRectArr = NULL;
- }
- tedPtr->nWidgetPadRects = 0;
-
- needed = Blt_Chain_GetLength(tedPtr->tablePtr->chain);
- rects = Blt_Calloc(needed, sizeof(XRectangle));
- if (rects == NULL) {
- return;
- }
- /* Draw any entry windows */
- count = 0;
- for (link = Blt_Chain_FirstLink(tedPtr->tablePtr->chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- tePtr = Blt_Chain_GetValue(link);
- if ((PADDING(tePtr->xPad) + PADDING(tePtr->yPad)) == 0) {
- continue;
- }
- rects[count].x = Tk_X(tePtr->tkwin) - tePtr->padLeft;
- rects[count].y = Tk_Y(tePtr->tkwin) - tePtr->padTop;
- rects[count].width = Tk_Width(tePtr->tkwin) +
- PADDING(tePtr->xPad);
- rects[count].height = Tk_Height(tePtr->tkwin) +
- PADDING(tePtr->yPad);
- count++;
- }
- if (count == 0) {
- Blt_Free(rects);
- return;
- }
- tedPtr->widgetPadRectArr = rects;
- tedPtr->nWidgetPadRects = count;
-}
-
-static void
-LayoutControlEntries(TableEditor *tedPtr)
-{
- TableEntry *tePtr;
- XRectangle *rects;
- int needed;
- int count;
- Table *tablePtr = tedPtr->tablePtr;
- Blt_ChainLink link;
- RowColumn *rcPtr;
-
- if (tedPtr->cntlRectArr != NULL) {
- Blt_Free(tedPtr->cntlRectArr);
- tedPtr->cntlRectArr = NULL;
- }
- tedPtr->nCntlRects = 0;
-
- needed = (tablePtr->nRows + tablePtr->nColumns);
- rects = Blt_Calloc(needed, sizeof(XRectangle));
- if (rects == NULL) {
- return;
- }
- /* Draw any entry windows */
- count = 0;
- for (link = Blt_Chain_FirstLink(tablePtr->cols.chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- rcPtr = Blt_Chain_GetValue(link);
- tePtr = rcPtr->control;
- if (tePtr != NULL) {
- rects[count].x = Tk_X(tePtr->tkwin) - tePtr->padLeft;
- rects[count].y = Tk_Y(tePtr->tkwin) - tePtr->padTop;
- rects[count].width = Tk_Width(tePtr->tkwin) +
- PADDING(tePtr->xPad);
- rects[count].height = Tk_Height(tePtr->tkwin) +
- PADDING(tePtr->yPad);
- count++;
- }
- }
- for (link = Blt_Chain_FirstLink(tablePtr->rows.chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- rcPtr = Blt_Chain_GetValue(link);
- tePtr = rcPtr->control;
- if (tePtr != NULL) {
- rects[count].x = Tk_X(tePtr->tkwin) - tePtr->padLeft;
- rects[count].y = Tk_Y(tePtr->tkwin) - tePtr->padTop;
- rects[count].width = Tk_Width(tePtr->tkwin) +
- PADDING(tePtr->xPad);
- rects[count].height = Tk_Height(tePtr->tkwin) +
- PADDING(tePtr->yPad);
- count++;
- }
- }
- if (count == 0) {
- Blt_Free(rects);
- return;
- }
- tedPtr->cntlRectArr = rects;
- tedPtr->nCntlRects = count;
-}
-
-static void
-LayoutButtons(TableEditor *tedPtr)
-{
- int needed;
- XRectangle *rects;
- Table *tablePtr;
- Blt_ChainLink link;
- RowColumn *rcPtr;
- int count;
-
- tablePtr = tedPtr->tablePtr;
- if ((tablePtr->nRows == 0) || (tablePtr->nColumns == 0)) {
- if (tedPtr->rects != NULL) {
- Blt_Free(tedPtr->rects);
- }
- tedPtr->rects = NULL;
- tedPtr->nRects = 0;
- return; /* Nothing to display, empty table */
- }
- needed = 2 * (tablePtr->nRows + tablePtr->nColumns);
- rects = Blt_Calloc(needed, sizeof(XRectangle));
- if (rects == NULL) {
- return; /* Can't allocate rectangles */
- }
- count = 0;
- for (link = Blt_Chain_FirstLink(tablePtr->rows.chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- rcPtr = Blt_Chain_GetValue(link);
- rects[count].x = 0;
- rects[count].y = rcPtr->offset - rcPtr->pad.side1;
- rects[count].width = tedPtr->buttonHeight;
- rects[count].height = rcPtr->size - 2;
- count++;
- rects[count].x = Tk_Width(tedPtr->tkwin) - tedPtr->buttonHeight;
- rects[count].y = rcPtr->offset - rcPtr->pad.side1;
- rects[count].width = tedPtr->buttonHeight;
- rects[count].height = rcPtr->size - 2;
- count++;
- }
- for (link = Blt_Chain_FirstLink(tablePtr->cols.chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- rcPtr = Blt_Chain_GetValue(link);
- rects[count].x = rcPtr->offset - rcPtr->pad.side1;
- rects[count].y = 0;
- rects[count].width = rcPtr->size - 2;
- rects[count].height = tedPtr->buttonHeight;
- count++;
- rects[count].x = rcPtr->offset - rcPtr->pad.side1;
- rects[count].y = Tk_Height(tedPtr->tkwin) - tedPtr->buttonHeight;
- rects[count].width = rcPtr->size - 2;
- rects[count].height = tedPtr->buttonHeight;
- count++;
- }
- assert(count == needed);
- if (tedPtr->rects != NULL) {
- Blt_Free(tedPtr->rects);
- }
- tedPtr->rects = rects;
- tedPtr->nRects = count;
-}
-
-
-static void
-DisplayTableEditor(ClientData clientData)
-{
- TableEditor *tedPtr = (TableEditor *) clientData;
- Tk_Window master;
- Tk_Window tkwin;
- Blt_ChainLink link;
- EntryRep *repPtr;
- Drawable drawable;
- Pixmap pixmap;
-
-#ifdef notdef
- fprintf(stderr, "display grid\n");
-#endif
- tedPtr->flags &= ~REDRAW_PENDING;
- if (!Tk_IsMapped(tedPtr->tkwin)) {
- return;
- }
- /*
- * Check if the master window has changed size and resize the
- * grid and input windows accordingly.
- */
- master = tedPtr->tablePtr->tkwin;
- if ((Tk_Width(master) != Tk_Width(tedPtr->tkwin)) ||
- (Tk_Height(master) != Tk_Height(tedPtr->tkwin))) {
-#ifdef notdef
- fprintf(stderr, "resizing windows\n");
-#endif
- Tk_ResizeWindow(tedPtr->tkwin, Tk_Width(master), Tk_Height(master));
- Tk_ResizeWindow(tedPtr->input, Tk_Width(master), Tk_Height(master));
- if (tedPtr->inputIsSibling) {
- Tk_MoveWindow(tedPtr->input, Tk_X(master), Tk_X(master));
- }
- tedPtr->flags |= LAYOUT_PENDING;
- }
- if (tedPtr->flags & LAYOUT_PENDING) {
-#ifdef notdef
- fprintf(stderr, "layout of grid\n");
-#endif
- LayoutPads(tedPtr);
- LayoutEntries(tedPtr);
- LayoutControlEntries(tedPtr);
- LayoutGrid(tedPtr);
- LayoutButtons(tedPtr);
- tedPtr->flags &= ~LAYOUT_PENDING;
- }
- tkwin = tedPtr->tkwin;
-
- pixmap = None; /* Suppress compiler warning. */
- drawable = Tk_WindowId(tkwin);
- if (tedPtr->doubleBuffer) {
- /* Create an off-screen pixmap for semi-smooth scrolling. */
- pixmap = Tk_GetPixmap(tedPtr->display, Tk_WindowId(tkwin),
- Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin));
- drawable = pixmap;
- }
- /* Clear the background of the grid */
-
- XFillRectangle(Tk_Display(tkwin), drawable, tedPtr->fillGC, 0, 0,
- Tk_Width(tkwin), Tk_Height(tkwin));
-
- /* Draw the row and column buttons */
-
- if (tedPtr->nRects > 0) {
- int i;
-
- for (i = 0; i < tedPtr->nRects; i++) {
- Blt_Fill3DRectangle(tkwin, drawable, tedPtr->border,
- tedPtr->rects[i].x, tedPtr->rects[i].y,
- tedPtr->rects[i].width, tedPtr->rects[i].height,
- tedPtr->borderWidth, tedPtr->relief);
- }
-#ifdef notdef
- XFillRectangles(tedPtr->display, drawable, tedPtr->rectGC,
- tedPtr->rects, tedPtr->nRects);
- XDrawRectangles(tedPtr->display, drawable, tedPtr->drawGC,
- tedPtr->rects, tedPtr->nRects);
-#endif
- }
- if (tedPtr->nPadRects > 0) {
- XFillRectangles(tedPtr->display, drawable, tedPtr->padRectGC,
- tedPtr->padRectArr, tedPtr->nPadRects);
- }
- if (tedPtr->spanActive) {
- XFillRectangles(tedPtr->display, drawable, tedPtr->spanGC,
- tedPtr->activeRectArr, 1);
- XFillRectangles(tedPtr->display, drawable, tedPtr->drawGC,
- tedPtr->activeRectArr + 1, 4);
- }
- if (tedPtr->nWidgetPadRects > 0) {
- XFillRectangles(tedPtr->display, drawable, tedPtr->attributes.fillGC,
- tedPtr->widgetPadRectArr, tedPtr->nWidgetPadRects);
- }
- if (tedPtr->nCntlRects > 0) {
- XFillRectangles(tedPtr->display, drawable, tedPtr->attributes.cntlGC,
- tedPtr->cntlRectArr, tedPtr->nCntlRects);
- }
- /* Draw the grid lines */
- if (tedPtr->nSegs > 0) {
- XDrawSegments(tedPtr->display, drawable, tedPtr->drawGC,
- tedPtr->segArr, tedPtr->nSegs);
- }
-#ifndef notdef
- /* Draw any entry windows */
- for (link = Blt_Chain_FirstLink(tedPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- repPtr = Blt_Chain_GetValue(link);
- if (repPtr->mapped) {
- DisplayEntry(repPtr);
- }
- }
-#endif
- if (tedPtr->doubleBuffer) {
- XCopyArea(tedPtr->display, drawable, Tk_WindowId(tkwin), tedPtr->fillGC,
- 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 0, 0);
- Tk_FreePixmap(tedPtr->display, pixmap);
- }
-}
-
-
-static void
-DrawEditor(Editor *editPtr)
-{
- TableEditor *tedPtr = (TableEditor *) editPtr;
-
- tedPtr->flags |= LAYOUT_PENDING;
- if ((tedPtr->tkwin != NULL) && !(tedPtr->flags & REDRAW_PENDING)) {
- tedPtr->flags |= REDRAW_PENDING;
-#ifdef notdef
- fprintf(stderr, "from draw editor\n");
-#endif
- Tcl_DoWhenIdle(DisplayTableEditor, tedPtr);
- }
-}
-
-static void
-DestroyEditor(DestroyData destroyData)
-{
- TableEditor *tedPtr = (TableEditor *) destroyData;
-
- tedPtr->tkwin = NULL;
- if (tedPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayTableEditor, tedPtr);
- }
- Tcl_EventuallyFree(tedPtr, DestroyTableEditor);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EditOp --
- *
- * Processes an objv/objc list of table entries to add and configure
- * new widgets into the table. A table entry consists of the
- * window path name, table index, and optional configuration options.
- * The first argument in the objv list is the name of the table. If
- * no table exists for the given window, a new one is created.
- *
- * Results:
- * Returns a standard TCL result. If an error occurred, TCL_ERROR is
- * returned and an error message is left in interp->result.
- *
- * Side Effects:
- * Memory is allocated, a new master table is possibly created, etc.
- * The table is re-computed and arranged at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
-static int
-EditOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to return list of names to */
- int objc, /* Number of arguments */
- Tcl_Obj *const *objv)
-{
- Table *tablePtr;
- TableEditor *tedPtr;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (tablePtr->editPtr != NULL) { /* Already editing this table */
- tedPtr = (TableEditor *) tablePtr->editPtr;
- } else {
- tedPtr = CreateTableEditor(tablePtr, interp);
- if (tedPtr == NULL) {
- return TCL_ERROR;
- }
- }
- if (ConfigureTableEditor(tedPtr, objc - 3, objv + 3, 0) != TCL_OK) {
- tedPtr->tkwin = NULL;
- if (tedPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayTableEditor, tedPtr);
- }
- Tcl_EventuallyFree(tedPtr, DestroyTableEditor);
- return TCL_ERROR;
- }
- /* Rearrange the table */
- if (!(tablePtr->flags & ARRANGE_PENDING)) {
- tablePtr->flags |= ARRANGE_PENDING;
- Tcl_DoWhenIdle(tablePtr->arrangeProc, tablePtr);
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(tedPtr->tkwin), -1);
- tedPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(tedPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetCmd --
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is
- * returned, then interp->result contains an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CgetOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report results back to */
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Option-value pairs */
-{
- TableEditor *tedPtr;
-
- tedPtr = FindEditor(dataPtr, interp, objv[2]);
- if (tedPtr == NULL) {
- return TCL_ERROR;
- }
- return Blt_ConfigureValueFromObj(interp, tedPtr->tkwin, configSpecs,
- (char *)tedPtr, objv[3], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureCmd --
- *
- * This procedure is called to process an objv/objc list in order to
- * configure the table geometry manager.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is
- * returned, then interp->result contains an error message.
- *
- * Side effects:
- * Table configuration options (padx, pady, rows, columns, etc) get
- * set. The table is recalculated and arranged at the next idle
- * point.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to report results back to */
- int objc,
- Tcl_Obj *const *objv) /* Option-value pairs */
-{
- TableEditor *tedPtr;
-
- tedPtr = FindEditor(dataPtr, interp, objv[2]);
- if (tedPtr == NULL) {
- return TCL_ERROR;
- }
- if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, tedPtr->tkwin, configSpecs,
- (char *)tedPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, tedPtr->tkwin, configSpecs,
- (char *)tedPtr, objv[3], 0);
- }
- if (ConfigureTableEditor(tedPtr, objc - 3, objv + 3, BLT_CONFIG_OBJV_ONLY)
- != TCL_OK) {
- return TCL_ERROR;
- }
- EventuallyRedraw(tedPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to return list of names to */
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Table *tablePtr;
- TableEditor *tedPtr;
- TableEntry *tePtr;
- int active;
- int x, y, width, height;
- int ix, iy;
- Blt_ChainLink link;
- Tk_Window tkwin;
-
- /* ted select master @x,y */
- tkwin = dataPtr->tkMain;
- tedPtr = FindEditor(dataPtr, interp, objv[2]);
- if (tedPtr == NULL) {
- return TCL_ERROR;
- }
- if (Blt_GetXY(interp, tkwin, Tcl_GetString(objv[3]), &ix, &iy) != TCL_OK) {
- return TCL_ERROR;
- }
- tablePtr = tedPtr->tablePtr;
- active = 0;
- for (link = Blt_Chain_FirstLink(tablePtr->chain);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- tePtr = Blt_Chain_GetValue(link);
- x = tePtr->x - tePtr->xPad.side1;
- y = tePtr->y - tePtr->yPad.side1;
- width = Tk_Width(tePtr->tkwin) + PADDING(tePtr->xPad);
- height = Tk_Height(tePtr->tkwin) + PADDING(tePtr->yPad);
- if ((ix >= x) && (ix <= (x + width)) &&
- (iy >= y) && (iy <= (y + height))) {
- int left, right, top, bottom;
- int last;
- int grip;
- RowColumn *rcPtr;
-
- last = tePtr->column.rcPtr->index + tePtr->column.span - 1;
- link = Blt_Chain_GetNthLink(tablePtr->cols.chain, last);
- rcPtr = Blt_Chain_GetValue(link);
-
- /* Calculate the span rectangle */
- left = (tePtr->column.rcPtr->offset -
- tePtr->column.rcPtr->pad.side1);
- right = (rcPtr->offset - rcPtr->pad.side1) + rcPtr->size;
-
- top = (tePtr->row.rcPtr->offset -
- tePtr->row.rcPtr->pad.side1);
-
- last = tePtr->row.rcPtr->index + tePtr->row.span - 1;
- link = Blt_Chain_GetNthLink(tablePtr->rows.chain, last);
- rcPtr = Blt_Chain_GetValue(link);
- bottom = (rcPtr->offset - rcPtr->pad.side1) + rcPtr->size;
-
- tedPtr->activeRectArr[0].x = left;
- tedPtr->activeRectArr[0].y = top;
- tedPtr->activeRectArr[0].width = (right - left);
- tedPtr->activeRectArr[0].height = (bottom - top);
-
- grip = tedPtr->gripSize;
- tedPtr->activeRectArr[1].x = (left + right - grip) / 2;
- tedPtr->activeRectArr[1].y = top;
- tedPtr->activeRectArr[1].width = grip - 1;
- tedPtr->activeRectArr[1].height = grip - 1;
-
- tedPtr->activeRectArr[2].x = left;
- tedPtr->activeRectArr[2].y = (top + bottom - grip) / 2;
- tedPtr->activeRectArr[2].width = grip - 1;
- tedPtr->activeRectArr[2].height = grip - 1;
-
- tedPtr->activeRectArr[3].x = (left + right - grip) / 2;
- tedPtr->activeRectArr[3].y = bottom - grip;
- tedPtr->activeRectArr[3].width = grip - 1;
- tedPtr->activeRectArr[3].height = grip - 1;
-
- tedPtr->activeRectArr[4].x = right - grip;
- tedPtr->activeRectArr[4].y = (top + bottom - grip) / 2;
- tedPtr->activeRectArr[4].width = grip - 1;
- tedPtr->activeRectArr[4].height = grip - 1;
-
- interp->result = Tk_PathName(tePtr->tkwin);
- active = 1;
- break;
- }
- }
- if ((active) || (active != tedPtr->spanActive)) {
- tedPtr->spanActive = active;
- EventuallyRedraw(tedPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EditOp --
- *
- * Processes an objv/objc list of table entries to add and configure
- * new widgets into the table. A table entry consists of the
- * window path name, table index, and optional configuration options.
- * The first argument in the objv list is the name of the table. If
- * no table exists for the given window, a new one is created.
- *
- * Results:
- * Returns a standard TCL result. If an error occurred, TCL_ERROR is
- * returned and an error message is left in interp->result.
- *
- * Side Effects:
- * Memory is allocated, a new master table is possibly created, etc.
- * The table is re-computed and arranged at the next idle point.
- *
- *---------------------------------------------------------------------------
- */
-static int
-RepOp(
- TableInterpData *dataPtr, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Interpreter to return list of names to */
- int objc, /* Number of arguments */
- Tcl_Obj *const *objv)
-{
- Tk_Window tkwin;
- Table *tablePtr;
- TableEditor *tedPtr;
-
- if (Blt_GetTableFromObj(dataPtr, interp, objv[2], &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- /* ted rep master index */
- tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[3]), dataPtr->tkMain);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (tablePtr->editPtr != NULL) { /* Already editing this table */
- tedPtr = (TableEditor *) tablePtr->editPtr;
- } else {
- tedPtr = CreateTableEditor(tablePtr, interp);
- if (tedPtr == NULL) {
- return TCL_ERROR;
- }
- }
- if (ConfigureTableEditor(tedPtr, objc - 3, objv + 3, 0) != TCL_OK) {
- tedPtr->tkwin = NULL;
- if (tedPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayTableEditor, tedPtr);
- }
- Tcl_EventuallyFree(tedPtr, DestroyTableEditor);
- return TCL_ERROR;
- }
- /* Rearrange the table */
- if (!(tablePtr->flags & ARRANGE_PENDING)) {
- tablePtr->flags |= ARRANGE_PENDING;
- Tcl_DoWhenIdle(tablePtr->arrangeProc, tablePtr);
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(tedPtr->tkwin), -1);
- tedPtr->flags |= LAYOUT_PENDING;
- EventuallyRedraw(tedPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Command options for the table editor.
- *
- * The fields for Blt_OperSpec are as follows:
- *
- * - option name
- * - minimum number of characters required to disambiguate the option name.
- * - function associated with command option.
- * - minimum number of arguments required.
- * - maximum number of arguments allowed (0 indicates no limit).
- * - usage string
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec tedOps[] =
-{
- {"cget", 2, CgetOp, 4, 4, "master option",},
- {"configure", 2, ConfigureOp, 3, 0,
- "master ?option...?",},
- {"edit", 1, EditOp, 3, 0, "master ?options...?",},
- {"rep", 1, RepOp, 2, 0, "master index ?options...?",},
- {"select", 1, SelectOp, 4, 0, "master @x,y",},
- /* {"forget", 1, ForgetOp, 3, 0, "master ?master...?",},
- {"index", 1, IndexOp, 3, 0, "master ?item...?",}, */
-};
-static int nTedOps = sizeof(tedOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * TedCmd --
- *
- * This procedure is invoked to process the TCL command that
- * corresponds to the table geometry manager. See the user
- * documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TedCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTedOps, tedOps, BLT_OP_ARG1, objc, objv,
- 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (clientData, interp, objc, objv);
- return result;
-}
-
-static TableData *
-GetTableInterpData(Tcl_Interp *interp)
-{
- TableData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (TableData *)Tcl_GetAssocData(interp, TABLE_THREAD_KEY, &proc);
- assert(dataPtr);
- return dataPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TedCmdInitProc --
- *
- * This procedure is invoked to initialize the TCL command that
- * corresponds to the table geometry manager.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates the new command and adds an entry into a global Tcl
- * associative array.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_TedCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {"ted", TedCmd, };
-
- cmdSpec.clientData = GetTableInterpData(interp);
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
diff --git a/blt3.0.1/src/bltText.c b/blt3.0.1/src/bltText.c
deleted file mode 100644
index d9cb33b..0000000
--- a/blt3.0.1/src/bltText.c
+++ /dev/null
@@ -1,2018 +0,0 @@
-
-/*
- * bltText.c --
- *
- * This module implements multi-line, rotate-able text for the BLT toolkit.
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include <bltHash.h>
-#include <X11/Xutil.h>
-#include "tkIntBorder.h"
-#include "tkDisplay.h"
-#include "bltImage.h"
-#include "bltBitmap.h"
-#include "bltFont.h"
-#include "bltText.h"
-#include "bltBgStyle.h"
-
-#define WINDEBUG 0
-
-static Blt_HashTable bitmapGCTable;
-static int initialized;
-
-GC
-Blt_GetBitmapGC(Tk_Window tkwin)
-{
- int isNew;
- GC gc;
- Display *display;
- Blt_HashEntry *hPtr;
-
- if (!initialized) {
- Blt_InitHashTable(&bitmapGCTable, BLT_ONE_WORD_KEYS);
- initialized = TRUE;
- }
- display = Tk_Display(tkwin);
- hPtr = Blt_CreateHashEntry(&bitmapGCTable, (char *)display, &isNew);
- if (isNew) {
- Pixmap bitmap;
- XGCValues gcValues;
- unsigned long gcMask;
- Window root;
-
- root = Tk_RootWindow(tkwin);
- bitmap = Tk_GetPixmap(display, root, 1, 1, 1);
- gcValues.foreground = gcValues.background = 0;
- gcMask = (GCForeground | GCBackground);
- gc = Blt_GetPrivateGCFromDrawable(display, bitmap, gcMask, &gcValues);
- Tk_FreePixmap(display, bitmap);
- Blt_SetHashValue(hPtr, gc);
- } else {
- gc = (GC)Blt_GetHashValue(hPtr);
- }
- return gc;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetTextExtents --
- *
- * Get the extents of a possibly multiple-lined text string.
- *
- * Results:
- * Returns via *widthPtr* and *heightPtr* the dimensions of the text
- * string.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_GetTextExtents(
- Blt_Font font,
- int leader,
- const char *text, /* Text string to be measured. */
- int textLen, /* Length of the text. If -1, indicates that
- * text is an ASCIZ string that the length
- * should be computed with strlen. */
- unsigned int *widthPtr,
- unsigned int *heightPtr)
-{
- unsigned int lineHeight;
-
- if (text == NULL) {
- return; /* NULL string? */
- }
- {
- Blt_FontMetrics fm;
-
- Blt_GetFontMetrics(font, &fm);
- lineHeight = fm.linespace;
- }
- if (textLen < 0) {
- textLen = strlen(text);
- }
- {
- unsigned int lineLen; /* # of characters on each line */
- const char *p, *pend;
- const char *line;
- unsigned int maxWidth, maxHeight;
-
- maxWidth = maxHeight = 0;
- lineLen = 0;
- for (p = line = text, pend = text + textLen; p < pend; p++) {
- if (*p == '\n') {
- if (lineLen > 0) {
- unsigned int lineWidth;
-
- lineWidth = Blt_TextWidth(font, line, lineLen);
- if (lineWidth > maxWidth) {
- maxWidth = lineWidth;
- }
- }
- maxHeight += lineHeight;
- line = p + 1; /* Point to the start of the next line. */
- lineLen = 0; /* Reset counter to indicate the start of a
- * new line. */
- continue;
- }
- lineLen++;
- }
- if ((lineLen > 0) && (*(p - 1) != '\n')) {
- unsigned int lineWidth;
-
- maxHeight += lineHeight;
- lineWidth = Blt_TextWidth(font, line, lineLen);
- if (lineWidth > maxWidth) {
- maxWidth = lineWidth;
- }
- }
- *widthPtr = maxWidth;
- *heightPtr = maxHeight;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ts_GetExtents --
- *
- * Get the extents of a possibly multiple-lined text string.
- *
- * Results:
- * Returns via *widthPtr* and *heightPtr* the dimensions of
- * the text string.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Ts_GetExtents(TextStyle *tsPtr, const char *text, unsigned int *widthPtr,
- unsigned int *heightPtr)
-{
-
- if (text == NULL) {
- *widthPtr = *heightPtr = 0;
- } else {
- unsigned int w, h;
-
- Blt_GetTextExtents(tsPtr->font, tsPtr->leader, text, -1, &w, &h);
- *widthPtr = w + PADDING(tsPtr->xPad);
- *heightPtr = h + PADDING(tsPtr->yPad);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetBoundingBox
- *
- * Computes the dimensions of the bounding box surrounding a rectangle
- * rotated about its center. If pointArr isn't NULL, the coordinates of
- * the rotated rectangle are also returned.
- *
- * The dimensions are determined by rotating the rectangle, and doubling
- * the maximum x-coordinate and y-coordinate.
- *
- * w = 2 * maxX, h = 2 * maxY
- *
- * Since the rectangle is centered at 0,0, the coordinates of the
- * bounding box are (-w/2,-h/2 w/2,-h/2, w/2,h/2 -w/2,h/2).
- *
- * 0 ------- 1
- * | |
- * | x |
- * | |
- * 3 ------- 2
- *
- * Results:
- * The width and height of the bounding box containing the rotated
- * rectangle are returned.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_GetBoundingBox(
- int width, int height, /* Unrotated region */
- float angle, /* Rotation of box */
- double *rotWidthPtr,
- double *rotHeightPtr, /* (out) Bounding box region */
- Point2d *bbox) /* (out) Points of the rotated box */
-{
- int i;
- double sinTheta, cosTheta;
- double radians;
- double xMax, yMax;
- double x, y;
- Point2d corner[4];
-
- angle = FMOD(angle, 360.0);
- if (FMOD(angle, (double)90.0) == 0.0) {
- int ll, ur, ul, lr;
- double rotWidth, rotHeight;
- int quadrant;
-
- /* Handle right-angle rotations specially. */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- ul = 3, ur = 0, lr = 1, ll = 2;
- rotWidth = (double)height;
- rotHeight = (double)width;
- break;
- case ROTATE_90: /* 90 degrees */
- ul = 1, ur = 2, lr = 3, ll = 0;
- rotWidth = (double)height;
- rotHeight = (double)width;
- break;
- case ROTATE_180: /* 180 degrees */
- ul = 2, ur = 3, lr = 0, ll = 1;
- rotWidth = (double)width;
- rotHeight = (double)height;
- break;
- default:
- case ROTATE_0: /* 0 degrees */
- ul = 0, ur = 1, lr = 2, ll = 3;
- rotWidth = (double)width;
- rotHeight = (double)height;
- break;
- }
- if (bbox != NULL) {
- x = rotWidth * 0.5;
- y = rotHeight * 0.5;
- bbox[ll].x = bbox[ul].x = -x;
- bbox[ur].y = bbox[ul].y = -y;
- bbox[lr].x = bbox[ur].x = x;
- bbox[ll].y = bbox[lr].y = y;
- }
- *rotWidthPtr = rotWidth;
- *rotHeightPtr = rotHeight;
- return;
- }
- /* Set the four corners of the rectangle whose center is the origin. */
- corner[1].x = corner[2].x = (double)width * 0.5;
- corner[0].x = corner[3].x = -corner[1].x;
- corner[2].y = corner[3].y = (double)height * 0.5;
- corner[0].y = corner[1].y = -corner[2].y;
-
- radians = (-angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
- xMax = yMax = 0.0;
-
- /* Rotate the four corners and find the maximum X and Y coordinates */
-
- for (i = 0; i < 4; i++) {
- x = (corner[i].x * cosTheta) - (corner[i].y * sinTheta);
- y = (corner[i].x * sinTheta) + (corner[i].y * cosTheta);
- if (x > xMax) {
- xMax = x;
- }
- if (y > yMax) {
- yMax = y;
- }
- if (bbox != NULL) {
- bbox[i].x = x;
- bbox[i].y = y;
- }
- }
-
- /*
- * By symmetry, the width and height of the bounding box are twice the
- * maximum x and y coordinates.
- */
- *rotWidthPtr = xMax + xMax;
- *rotHeightPtr = yMax + yMax;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TranslateAnchor --
- *
- * Translate the coordinates of a given bounding box based upon the
- * anchor specified. The anchor indicates where the given x-y position
- * is in relation to the bounding box.
- *
- * nw --- n --- ne
- * | |
- * w center e
- * | |
- * sw --- s --- se
- *
- * The coordinates returned are translated to the origin of the bounding
- * box (suitable for giving to XCopyArea, XCopyPlane, etc.)
- *
- * Results:
- * The translated coordinates of the bounding box are returned.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TranslateAnchor(
- int x, int y, /* Window coordinates of anchor */
- int w, int h, /* Extents of the bounding box */
- Tk_Anchor anchor, /* Direction of the anchor */
- int *xPtr, int *yPtr)
-{
- switch (anchor) {
- case TK_ANCHOR_NW: /* Upper left corner */
- break;
- case TK_ANCHOR_W: /* Left center */
- y -= (h / 2);
- break;
- case TK_ANCHOR_SW: /* Lower left corner */
- y -= h;
- break;
- case TK_ANCHOR_N: /* Top center */
- x -= (w / 2);
- break;
- case TK_ANCHOR_CENTER: /* Center */
- x -= (w / 2);
- y -= (h / 2);
- break;
- case TK_ANCHOR_S: /* Bottom center */
- x -= (w / 2);
- y -= h;
- break;
- case TK_ANCHOR_NE: /* Upper right corner */
- x -= w;
- break;
- case TK_ANCHOR_E: /* Right center */
- x -= w;
- y -= (h / 2);
- break;
- case TK_ANCHOR_SE: /* Lower right corner */
- x -= w;
- y -= h;
- break;
- }
- *xPtr = x;
- *yPtr = y;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_AnchorPoint --
- *
- * Translates a position, using both the dimensions of the bounding box,
- * and the anchor direction, returning the coordinates of the upper-left
- * corner of the box. The anchor indicates where the given x-y position
- * is in relation to the bounding box.
- *
- * nw --- n --- ne
- * | |
- * w center e
- * | |
- * sw --- s --- se
- *
- * The coordinates returned are translated to the origin of the bounding
- * box (suitable for giving to XCopyArea, XCopyPlane, etc.)
- *
- * Results:
- * The translated coordinates of the bounding box are returned.
- *
- *---------------------------------------------------------------------------
- */
-Point2d
-Blt_AnchorPoint(
- double x, double y, /* Coordinates of anchor. */
- double w, double h, /* Extents of the bounding box */
- Tk_Anchor anchor) /* Direction of the anchor */
-{
- Point2d t;
-
- switch (anchor) {
- case TK_ANCHOR_NW: /* Upper left corner */
- break;
- case TK_ANCHOR_W: /* Left center */
- y -= (h * 0.5);
- break;
- case TK_ANCHOR_SW: /* Lower left corner */
- y -= h;
- break;
- case TK_ANCHOR_N: /* Top center */
- x -= (w * 0.5);
- break;
- case TK_ANCHOR_CENTER: /* Center */
- x -= (w * 0.5);
- y -= (h * 0.5);
- break;
- case TK_ANCHOR_S: /* Bottom center */
- x -= (w * 0.5);
- y -= h;
- break;
- case TK_ANCHOR_NE: /* Upper right corner */
- x -= w;
- break;
- case TK_ANCHOR_E: /* Right center */
- x -= w;
- y -= (h * 0.5);
- break;
- case TK_ANCHOR_SE: /* Lower right corner */
- x -= w;
- y -= h;
- break;
- }
- t.x = x;
- t.y = y;
- return t;
-}
-
-static INLINE int
-SizeOfUtfChar(const char *s) /* Buffer in which the UTF-8 representation of
- * the Tcl_UniChar is stored. Buffer must be
- * large enough to hold the UTF-8 character
- * (at most TCL_UTF_MAX bytes). */
-{
- int byte;
-
- byte = *((unsigned char *)s);
- if (byte < 0xC0) {
- return 1;
- } else if ((byte < 0xE0) && ((s[1] & 0xC0) == 0x80)) {
- return 2;
- } else if ((byte < 0xF0) &&
- ((s[1] & 0xC0) == 0x80) && ((s[2] & 0xC0) == 0x80)) {
- return 3;
- }
- return 1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MeasureText --
- *
- * Draw a string of characters on the screen. Blt_DrawChars()
- * expands control characters that occur in the string to
- * \xNN sequences.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets drawn on the screen.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_MeasureText(
- Blt_Font font, /* Font in which characters will be drawn;
- * must be the same as font used in GC. */
- const char *text, /* UTF-8 string to be displayed. Need not be
- * '\0' terminated. All Tk meta-characters
- * (tabs, control characters, and newlines)
- * should be stripped out of the string that
- * is passed to this function. If they are
- * not stripped out, they will be displayed as
- * regular printing characters. */
- int textLen, /* # of bytes to draw in text string. */
- int maxLength,
- int *countPtr)
-{
- int elWidth;
- const char *s, *send;
- int accum, count, threshold;
- int nBytes;
-
- if (maxLength < 0) {
- if (countPtr != NULL) {
- nBytes = textLen;
- }
- return Blt_TextWidth(font, text, textLen);
- }
- elWidth = Blt_TextWidth(font, "...", 3);
- threshold = maxLength - elWidth;
- if (threshold <= 0) {
- return 0;
- }
-#if !HAVE_UTF
- nBytes = 1;
-#endif /* !HAVE_UTF */
- count = accum = 0;
- for (s = text, send = s + textLen; s < send; s += nBytes) {
-#if HAVE_UTF
- Tcl_UniChar ch;
-#endif /* HAVE_UTF */
- int w;
-#if HAVE_UTF
- nBytes = Tcl_UtfToUniChar (s, &ch);
-#endif /* HAVE_UTF */
- w = Blt_TextWidth(font, s, nBytes);
- if ((accum + w) > threshold) {
- if (countPtr != NULL) {
- *countPtr = count;
- }
- return accum + elWidth;
- }
- accum += w;
- count += nBytes;
- }
- if (countPtr != NULL) {
- *countPtr = count;
- }
- return accum;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ts_CreateLayout --
- *
- * Get the extents of a possibly multiple-lined text string.
- *
- * Results:
- * Returns via *widthPtr* and *heightPtr* the dimensions of the text
- * string.
- *
- *---------------------------------------------------------------------------
- */
-TextLayout *
-Blt_Ts_CreateLayout(const char *text, int textLen, TextStyle *tsPtr)
-{
- TextFragment *fp;
- TextLayout *layoutPtr;
- Blt_FontMetrics fm;
- int count; /* Count # of characters on each line */
- int lineHeight;
- size_t maxHeight, maxWidth;
- size_t nFrags;
- int width; /* Running dimensions of the text */
- const char *p, *endp, *start;
- int i;
- size_t size;
-
- nFrags = 0;
- endp = text + ((textLen < 0) ? strlen(text) : textLen);
- for (p = text; p < endp; p++) {
- if (*p == '\n') {
- nFrags++;
- }
- }
- if ((p != text) && (*(p - 1) != '\n')) {
- nFrags++;
- }
- size = sizeof(TextLayout) + (sizeof(TextFragment) * (nFrags - 1));
-
- layoutPtr = Blt_AssertCalloc(1, size);
- layoutPtr->nFrags = nFrags;
-
- nFrags = count = 0;
- width = maxWidth = 0;
- maxHeight = tsPtr->padTop;
- Blt_GetFontMetrics(tsPtr->font, &fm);
- lineHeight = fm.linespace + tsPtr->leader;
-
- fp = layoutPtr->fragments;
- for (p = start = text; p < endp; p++) {
- if (*p == '\n') {
- if (count > 0) {
- width = Blt_TextWidth(tsPtr->font, start, count);
- if (width > maxWidth) {
- maxWidth = width;
- }
- } else {
- width = 0;
- }
- fp->width = width;
- fp->count = count;
- fp->sy = fp->y = maxHeight + fm.ascent;
- fp->text = start;
- maxHeight += lineHeight;
- fp++;
- nFrags++;
- start = p + 1; /* Start the text on the next line */
- count = 0; /* Reset to indicate the start of a new
- * line */
- continue;
- }
- count++;
- }
-
- if (nFrags < layoutPtr->nFrags) {
- width = Blt_TextWidth(tsPtr->font, start, count);
- if (width > maxWidth) {
- maxWidth = width;
- }
- fp->width = width;
- fp->count = count;
- fp->sy = fp->y = maxHeight + fm.ascent;
- fp->text = start;
- maxHeight += lineHeight;
- nFrags++;
- }
- maxHeight += tsPtr->padBottom;
- maxWidth += PADDING(tsPtr->xPad);
- fp = layoutPtr->fragments;
- for (i = 0; i < nFrags; i++, fp++) {
- switch (tsPtr->justify) {
- default:
- case TK_JUSTIFY_LEFT:
- /* No offset for left justified text strings */
- fp->x = fp->sx = tsPtr->padLeft;
- break;
- case TK_JUSTIFY_RIGHT:
- fp->x = fp->sx = (maxWidth - fp->width) - tsPtr->padRight;
- break;
- case TK_JUSTIFY_CENTER:
- fp->x = fp->sx = (maxWidth - fp->width) / 2;
- break;
- }
- }
- if (tsPtr->underline >= 0) {
- fp = layoutPtr->fragments;
- for (i = 0; i < nFrags; i++, fp++) {
- int first, last;
-
- first = fp->text - text;
- last = first + fp->count;
- if ((tsPtr->underline >= first) && (tsPtr->underline < last)) {
- layoutPtr->underlinePtr = fp;
- layoutPtr->underline = tsPtr->underline - first;
- break;
- }
- }
- }
- layoutPtr->width = maxWidth;
- layoutPtr->height = maxHeight - tsPtr->leader;
- return layoutPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawCharsWithEllipsis --
- *
- * Draw a string of characters on the screen. Blt_DrawChars()
- * expands control characters that occur in the string to
- * \xNN sequences.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets drawn on the screen.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DrawCharsWithEllipsis(
- Tk_Window tkwin, /* Display on which to draw. */
- Drawable drawable, /* Window or pixmap in which to draw. */
- GC gc, /* Graphics context for drawing characters. */
- Blt_Font font, /* Font in which characters will be drawn;
- * must be the same as font used in GC. */
- int depth,
- float angle,
- const char *text, /* UTF-8 string to be displayed. Need not be
- * '\0' terminated. All Tk meta-characters
- * (tabs, control characters, and newlines)
- * should be stripped out of the string that
- * is passed to this function. If they are
- * not stripped out, they will be displayed as
- * regular printing characters. */
- int textLen, /* # of bytes to draw in text string. */
- int x, int y, /* Coordinates at which to place origin of
- * string when drawing. */
- int maxLength)
-{
- int elWidth;
- const char *s, *send;
- Tcl_DString dString;
- int nBytes;
- int accum, threshold;
-
-#if HAVE_UTF
- Tcl_UniChar ch;
-#endif /* HAVE_UTF */
- accum = 0;
- elWidth = Blt_TextWidth(font, "...", 3);
- if (maxLength < elWidth) {
- return;
- }
- threshold = maxLength - elWidth;
- Tcl_DStringInit(&dString);
-#if !HAVE_UTF
- nBytes = 1;
-#endif /* !HAVE_UTF */
- for (s = text, send = s + textLen; s < send; s += nBytes) {
-#if HAVE_UTF
- nBytes = Tcl_UtfToUniChar (s, &ch);
-#endif /* HAVE_UTF */
- accum += Blt_TextWidth(font, s, nBytes);
- if (accum > threshold) {
- break;
- }
- Tcl_DStringAppend(&dString, s, nBytes);
- }
- if (s < send) {
- Tcl_DStringAppend(&dString, "...", 3);
- }
- Blt_DrawChars(Tk_Display(tkwin), drawable, gc, font, depth, angle,
- Tcl_DStringValue(&dString), Tcl_DStringLength(&dString), x, y);
- Tcl_DStringFree(&dString);
-}
-
-void
-Blt_DrawLayout(Tk_Window tkwin, Drawable drawable, GC gc, Blt_Font font,
- int depth, float angle, int x, int y, TextLayout *layoutPtr,
- int maxLength)
-{
- TextFragment *fp, *fend;
- Blt_FontMetrics fm;
-
- Blt_GetFontMetrics(font, &fm);
- for (fp = layoutPtr->fragments, fend = fp + layoutPtr->nFrags;
- fp < fend; fp++) {
- int sx, sy;
-
- sx = x + fp->sx, sy = y + fp->sy;
- if ((maxLength > 0) && ((fp->width + fp->x) > maxLength)) {
- Blt_DrawCharsWithEllipsis(tkwin, drawable, gc, font, depth, angle,
- fp->text, fp->count, sx, sy, maxLength - fp->x);
- } else {
- Blt_DrawChars(Tk_Display(tkwin), drawable, gc, font, depth, angle,
- fp->text, fp->count, sx, sy);
- }
- }
- if (layoutPtr->underlinePtr != NULL) {
- fp = layoutPtr->underlinePtr;
- Blt_UnderlineChars(Tk_Display(tkwin), drawable, gc, font, fp->text,
- fp->count, x + fp->sx, y + fp->sy, layoutPtr->underline,
- layoutPtr->underline + 1, maxLength);
- }
-}
-
-
-#ifdef WIN32
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ts_Bitmap --
- *
- * Draw a bitmap, using the the given window coordinates as an anchor for
- * the text bounding box.
- *
- * Results:
- * Returns the bitmap representing the text string.
- *
- * Side Effects:
- * Bitmap is drawn using the given font and GC in the drawable at the
- * given coordinates, anchor, and rotation.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_Ts_Bitmap(
- Tk_Window tkwin,
- TextLayout *layoutPtr, /* Text string to draw */
- TextStyle *stylePtr, /* Text attributes: rotation, color,
- * font, linespacing, justification,
- * etc. */
- int *bmWidthPtr,
- int *bmHeightPtr) /* Extents of rotated text string */
-{
- Pixmap bitmap;
- Window root;
- GC gc;
- HDC hDC;
- TkWinDCState state;
-
- /* Create a temporary bitmap to contain the text string */
- root = Tk_RootWindow(tkwin);
- bitmap = Tk_GetPixmap(Tk_Display(tkwin), root, layoutPtr->width,
- layoutPtr->height, 1);
- assert(bitmap != None);
- if (bitmap == None) {
- return None; /* Can't allocate pixmap. */
- }
- gc = Blt_GetBitmapGC(tkwin);
-
- /* Clear the pixmap and draw the text string into it */
- hDC = TkWinGetDrawableDC(Tk_Display(tkwin), bitmap, &state);
- PatBlt(hDC, 0, 0, layoutPtr->width, layoutPtr->height, WHITENESS);
- TkWinReleaseDrawableDC(bitmap, hDC, &state);
-
- XSetFont(Tk_Display(tkwin), gc, Blt_FontId(stylePtr->font));
- XSetForeground(Tk_Display(tkwin), gc, 1);
- Blt_DrawLayout(tkwin, bitmap, gc, stylePtr->font, 1, 0.0f, 0, 0, layoutPtr,
- stylePtr->maxLength);
-
- /*
- * Under Win32, 1 is off and 0 is on. That's why we're inverting the
- * bitmap here.
- */
- hDC = TkWinGetDrawableDC(Tk_Display(tkwin), bitmap, &state);
- PatBlt(hDC, 0, 0, layoutPtr->width, layoutPtr->height, DSTINVERT);
- TkWinReleaseDrawableDC(bitmap, hDC, &state);
-
- *bmWidthPtr = layoutPtr->width, *bmHeightPtr = layoutPtr->height;
- return bitmap;
-}
-#else
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ts_Bitmap --
- *
- * Draw a bitmap, using the the given window coordinates as an anchor for
- * the text bounding box.
- *
- * Results:
- * Returns the bitmap representing the text string.
- *
- * Side Effects:
- * Bitmap is drawn using the given font and GC in the drawable at the
- * given coordinates, anchor, and rotation.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_Ts_Bitmap(
- Tk_Window tkwin,
- TextLayout *layoutPtr, /* Text string to draw */
- TextStyle *stylePtr, /* Text attributes: rotation, color,
- * font, linespacing, justification,
- * etc. */
- int *bmWidthPtr,
- int *bmHeightPtr) /* Extents of rotated text string */
-{
- Pixmap bitmap;
- GC gc;
-
- /* Create a bitmap big enough to contain the text. */
- bitmap = Tk_GetPixmap(Tk_Display(tkwin), Tk_RootWindow(tkwin),
- layoutPtr->width, layoutPtr->height, 1);
- assert(bitmap != None);
- if (bitmap == None) {
- return None; /* Can't allocate pixmap. */
- }
- gc = Blt_GetBitmapGC(tkwin);
-
- /* Clear the bitmap. Background is 0. */
- XSetForeground(Tk_Display(tkwin), gc, 0);
- XFillRectangle(Tk_Display(tkwin), bitmap, gc, 0, 0, layoutPtr->width,
- layoutPtr->height);
-
- /* Draw the text into the bitmap. Foreground is 1. */
- XSetFont(Tk_Display(tkwin), gc, Blt_FontId(stylePtr->font));
- XSetForeground(Tk_Display(tkwin), gc, 1);
- Blt_DrawLayout(tkwin, bitmap, gc, stylePtr->font, 1, 0.0f, 0, 0, layoutPtr,
- stylePtr->maxLength);
- *bmWidthPtr = layoutPtr->width, *bmHeightPtr = layoutPtr->height;
- return bitmap;
-}
-#endif /* WIN32 */
-
-void
-Blt_Ts_SetDrawStyle(
- TextStyle *stylePtr,
- Blt_Font font,
- GC gc,
- XColor *normalColor,
- float angle,
- Tk_Anchor anchor,
- Tk_Justify justify,
- int leader)
-{
- stylePtr->xPad.side1 = stylePtr->xPad.side2 = 0;
- stylePtr->yPad.side1 = stylePtr->yPad.side2 = 0;
- stylePtr->state = 0;
- stylePtr->anchor = anchor;
- stylePtr->color = normalColor;
- stylePtr->font = font;
- stylePtr->gc = gc;
- stylePtr->justify = justify;
- stylePtr->leader = leader;
- stylePtr->angle = (float)angle;
-}
-
-static void
-DrawStandardLayout(Tk_Window tkwin, Drawable drawable, TextStyle *stylePtr,
- TextLayout *layoutPtr, int x, int y)
-{
- int w, h;
- /*
- * This is the easy case of no rotation. Simply draw the text
- * using the standard drawing routines. Handle offset printing
- * for engraved (disabled) text.
- */
- w = layoutPtr->width;
- h = layoutPtr->height;
- if ((stylePtr->maxLength > 0) && (stylePtr->maxLength < w)) {
- w = stylePtr->maxLength;
- }
- Blt_TranslateAnchor(x, y, w, h, stylePtr->anchor, &x, &y);
- if (stylePtr->state & (STATE_DISABLED | STATE_EMPHASIS)) {
- TkBorder *borderPtr = (TkBorder *) Blt_BackgroundBorder(stylePtr->bg);
- XColor *color1, *color2;
-
- color1 = borderPtr->lightColor, color2 = borderPtr->darkColor;
- if (stylePtr->state & STATE_EMPHASIS) {
- XColor *hold;
-
- hold = color1, color1 = color2, color2 = hold;
- }
- if (color1 != NULL) {
- XSetForeground(Tk_Display(tkwin), stylePtr->gc, color1->pixel);
- }
- Blt_DrawLayout(tkwin, drawable, stylePtr->gc, stylePtr->font,
- Tk_Depth(tkwin), 0.0f, x+1, y+1, layoutPtr,stylePtr->maxLength);
- if (color2 != NULL) {
- XSetForeground(Tk_Display(tkwin), stylePtr->gc, color2->pixel);
- }
- Blt_DrawLayout(tkwin, drawable, stylePtr->gc, stylePtr->font,
- Tk_Depth(tkwin), 0.0f, x, y, layoutPtr, stylePtr->maxLength);
-
- /* Reset the foreground color back to its original setting, so not to
- * invalidate the GC cache. */
- XSetForeground(Tk_Display(tkwin), stylePtr->gc, stylePtr->color->pixel);
-
- return; /* Done */
- }
- Blt_DrawLayout(tkwin, drawable, stylePtr->gc, stylePtr->font,
- Tk_Depth(tkwin), 0.0f, x, y, layoutPtr, stylePtr->maxLength);
-}
-
-
-static void
-RotateStartingTextPositions(TextLayout *lPtr, int w, int h, float angle)
-{
- Point2d off1, off2;
- TextFragment *fp, *fend;
- double radians;
- double rw, rh;
- double sinTheta, cosTheta;
-
- Blt_GetBoundingBox(w, h, angle, &rw, &rh, (Point2d *)NULL);
- off1.x = (double)w * 0.5;
- off1.y = (double)h * 0.5;
- off2.x = rw * 0.5;
- off2.y = rh * 0.5;
- radians = (-angle / 180.0) * M_PI;
-
- sinTheta = sin(radians), cosTheta = cos(radians);
- for (fp = lPtr->fragments, fend = fp + lPtr->nFrags; fp < fend; fp++) {
- Point2d p, q;
-
- p.x = fp->x - off1.x;
- p.y = fp->y - off1.y;
- q.x = (p.x * cosTheta) - (p.y * sinTheta);
- q.y = (p.x * sinTheta) + (p.y * cosTheta);
- q.x += off2.x;
- q.y += off2.y;
- fp->sx = ROUND(q.x);
- fp->sy = ROUND(q.y);
- }
-}
-
-void
-Blt_RotateStartingTextPositions(TextLayout *lPtr, float angle)
-{
- RotateStartingTextPositions(lPtr, lPtr->width, lPtr->height, angle);
-}
-
-int
-Blt_DrawTextWithRotatedFont(Tk_Window tkwin, Drawable drawable, float angle,
- TextStyle *stylePtr, TextLayout *layoutPtr,
- int x, int y)
-{
- double rw, rh;
- int w, h;
-
- w = layoutPtr->width;
- h = layoutPtr->height;
- if ((stylePtr->maxLength > 0) && (stylePtr->maxLength < w)) {
- w = stylePtr->maxLength;
- }
- RotateStartingTextPositions(layoutPtr, w, h, angle);
- Blt_GetBoundingBox(w, h, angle, &rw, &rh, (Point2d *)NULL);
- Blt_TranslateAnchor(x, y, (int)rw, (int)rh, stylePtr->anchor, &x, &y);
- if (stylePtr->state & (STATE_DISABLED | STATE_EMPHASIS)) {
- TkBorder *borderPtr = (TkBorder *)Blt_BackgroundBorder(stylePtr->bg);
- XColor *color1, *color2;
-
- color1 = borderPtr->lightColor, color2 = borderPtr->darkColor;
- if (stylePtr->state & STATE_EMPHASIS) {
- XColor *hold;
-
- hold = color1, color1 = color2, color2 = hold;
- }
- if (color1 != NULL) {
- XSetForeground(Tk_Display(tkwin), stylePtr->gc, color1->pixel);
- Blt_DrawLayout(tkwin, drawable, stylePtr->gc, stylePtr->font,
- Tk_Depth(tkwin), angle, x, y, layoutPtr, stylePtr->maxLength);
- }
- if (color2 != NULL) {
- XSetForeground(Tk_Display(tkwin), stylePtr->gc, color2->pixel);
- Blt_DrawLayout(tkwin, drawable, stylePtr->gc, stylePtr->font,
- Tk_Depth(tkwin), angle, x, y, layoutPtr, stylePtr->maxLength);
- }
- XSetForeground(Tk_Display(tkwin), stylePtr->gc, stylePtr->color->pixel);
- return TRUE;
- }
- XSetForeground(Tk_Display(tkwin), stylePtr->gc, stylePtr->color->pixel);
- Blt_DrawLayout(tkwin, drawable, stylePtr->gc, stylePtr->font,
- Tk_Depth(tkwin), angle, x, y, layoutPtr, stylePtr->maxLength);
- return TRUE;
-}
-
-static void
-Blt_DrawTextWithRotatedBitmap(
- Tk_Window tkwin,
- Drawable drawable,
- float angle,
- TextStyle *stylePtr, /* Text attribute information */
- TextLayout *layoutPtr,
- int x, int y) /* Window coordinates to draw text */
-{
- int width, height;
- Display *display;
- Pixmap bitmap;
-
- display = Tk_Display(tkwin);
- /*
- * Rotate the text by writing the text into a bitmap and rotating the
- * bitmap. Set the clip mask and origin in the GC first. And make sure
- * we restore the GC because it may be shared.
- */
- stylePtr->angle = angle;
-
- bitmap = Blt_Ts_Bitmap(tkwin, layoutPtr, stylePtr, &width, &height);
- if (bitmap == None) {
- return;
- }
- if ((bitmap != None) && (stylePtr->angle != 0.0)) {
- Pixmap rotated;
-
- rotated = Blt_RotateBitmap(tkwin, bitmap, width, height,
- stylePtr->angle, &width, &height);
- Tk_FreePixmap(display, bitmap);
- bitmap = rotated;
- }
- Blt_TranslateAnchor(x, y, width, height, stylePtr->anchor, &x, &y);
- XSetClipMask(display, stylePtr->gc, bitmap);
-
- if (stylePtr->state & (STATE_DISABLED | STATE_EMPHASIS)) {
- TkBorder *borderPtr = (TkBorder *) Blt_BackgroundBorder(stylePtr->bg);
- XColor *color1, *color2;
-
- color1 = borderPtr->lightColor, color2 = borderPtr->darkColor;
- if (stylePtr->state & STATE_EMPHASIS) {
- XColor *hold;
-
- hold = color1, color1 = color2, color2 = hold;
- }
- if (color1 != NULL) {
- XSetForeground(display, stylePtr->gc, color1->pixel);
- }
- XSetClipOrigin(display, stylePtr->gc, x + 1, y + 1);
- XCopyPlane(display, bitmap, drawable, stylePtr->gc, 0, 0, width,
- height, x + 1, y + 1, 1);
- if (color2 != NULL) {
- XSetForeground(display, stylePtr->gc, color2->pixel);
- }
- XSetClipOrigin(display, stylePtr->gc, x, y);
- XCopyPlane(display, bitmap, drawable, stylePtr->gc, 0, 0, width,
- height, x, y, 1);
- XSetForeground(display, stylePtr->gc, stylePtr->color->pixel);
- } else {
- XSetForeground(display, stylePtr->gc, stylePtr->color->pixel);
- XSetClipOrigin(display, stylePtr->gc, x, y);
- XCopyPlane(display, bitmap, drawable, stylePtr->gc, 0, 0, width, height,
- x, y, 1);
- }
- XSetClipMask(display, stylePtr->gc, None);
- Tk_FreePixmap(display, bitmap);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ts_DrawLayout --
- *
- * Draw a text string, possibly rotated, using the the given window
- * coordinates as an anchor for the text bounding box. If the text is
- * not rotated, simply use the X text drawing routines. Otherwise,
- * generate a bitmap of the rotated text.
- *
- * Results:
- * Returns the x-coordinate to the right of the text.
- *
- * Side Effects:
- * Text string is drawn using the given font and GC at the the given
- * window coordinates.
- *
- * The Stipple, FillStyle, and TSOrigin fields of the GC are modified for
- * rotated text. This assumes the GC is private, *not* shared (via
- * Tk_GetGC)
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Ts_DrawLayout(
- Tk_Window tkwin,
- Drawable drawable,
- TextLayout *layoutPtr,
- TextStyle *stylePtr, /* Text attribute information */
- int x, int y) /* Window coordinates to draw text */
-{
- float angle;
-
- if ((stylePtr->gc == NULL) || (stylePtr->flags & UPDATE_GC)) {
- Blt_Ts_ResetStyle(tkwin, stylePtr);
- }
- angle = (float)FMOD(stylePtr->angle, 360.0);
- if (angle < 0.0) {
- angle += 360.0;
- }
- if (angle == 0.0) {
- /*
- * This is the easy case of no rotation. Simply draw the text using
- * the standard drawing routines. Handle offset printing for engraved
- * (disabled) text.
- */
- DrawStandardLayout(tkwin, drawable, stylePtr, layoutPtr, x, y);
- return;
- }
- if (Blt_CanRotateFont(stylePtr->font, angle)) {
- if (Blt_DrawTextWithRotatedFont(tkwin, drawable, angle, stylePtr,
- layoutPtr, x, y)) {
- return; /* Success. */
- }
- }
- /*Fallthru*/
- stylePtr->angle = (float)angle;
- Blt_DrawTextWithRotatedBitmap(tkwin, drawable, angle, stylePtr, layoutPtr,
- x, y);
-}
-
-void
-Blt_Ts_UnderlineLayout(
- Tk_Window tkwin,
- Drawable drawable,
- TextLayout *layoutPtr,
- TextStyle *stylePtr, /* Text attribute information */
- int x, int y) /* Window coordinates to draw text */
-{
- float angle;
-
- if ((stylePtr->gc == NULL) || (stylePtr->flags & UPDATE_GC)) {
- Blt_Ts_ResetStyle(tkwin, stylePtr);
- }
- angle = (float)FMOD(stylePtr->angle, 360.0);
- if (angle < 0.0) {
- angle += 360.0;
- }
- if (angle == 0.0) {
- TextFragment *fp, *fend;
-
- for (fp = layoutPtr->fragments, fend = fp + layoutPtr->nFrags;
- fp < fend; fp++) {
- int sx, sy;
-
- sx = x + fp->sx, sy = y + fp->sy;
- Blt_UnderlineChars(Tk_Display(tkwin), drawable, stylePtr->gc,
- stylePtr->font, fp->text, fp->count, sx, sy, 0, fp->count,
- stylePtr->maxLength);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Ts_DrawLayout --
- *
- * Draw a text string, possibly rotated, using the the given window
- * coordinates as an anchor for the text bounding box. If the text is
- * not rotated, simply use the X text drawing routines. Otherwise,
- * generate a bitmap of the rotated text.
- *
- * Results:
- * Returns the x-coordinate to the right of the text.
- *
- * Side Effects:
- * Text string is drawn using the given font and GC at the the given
- * window coordinates.
- *
- * The Stipple, FillStyle, and TSOrigin fields of the GC are modified for
- * rotated text. This assumes the GC is private, *not* shared (via
- * Tk_GetGC)
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Ts_DrawText(
- Tk_Window tkwin,
- Drawable drawable,
- const char *text,
- int textLen,
- TextStyle *stylePtr, /* Text attribute information */
- int x, int y) /* Window coordinates to draw text */
-{
- TextLayout *layoutPtr;
-
- layoutPtr = Blt_Ts_CreateLayout(text, textLen, stylePtr);
- Blt_Ts_DrawLayout(tkwin, drawable, layoutPtr, stylePtr, x, y);
- Blt_Free(layoutPtr);
-}
-
-void
-Blt_DrawText2(
- Tk_Window tkwin,
- Drawable drawable,
- const char *string,
- TextStyle *stylePtr, /* Text attribute information */
- int x, int y, /* Window coordinates to draw text */
- Dim2D *areaPtr)
-{
- TextLayout *layoutPtr;
- int width, height;
- float angle;
-
- if ((string == NULL) || (*string == '\0')) {
- return; /* Empty string, do nothing */
- }
- layoutPtr = Blt_Ts_CreateLayout(string, -1, stylePtr);
- Blt_Ts_DrawLayout(tkwin, drawable, layoutPtr, stylePtr, x, y);
- angle = FMOD(stylePtr->angle, 360.0);
- if (angle < 0.0) {
- angle += 360.0;
- }
- width = layoutPtr->width;
- height = layoutPtr->height;
- if (angle != 0.0) {
- double rotWidth, rotHeight;
-
- Blt_GetBoundingBox(width, height, angle, &rotWidth, &rotHeight,
- (Point2d *)NULL);
- width = ROUND(rotWidth);
- height = ROUND(rotHeight);
- }
- areaPtr->width = width;
- areaPtr->height = height;
- Blt_Free(layoutPtr);
-}
-
-void
-Blt_DrawText(
- Tk_Window tkwin,
- Drawable drawable,
- const char *string,
- TextStyle *stylePtr, /* Text attribute information */
- int x, int y) /* Window coordinates to draw text */
-{
- TextLayout *layoutPtr;
-
- if ((string == NULL) || (*string == '\0')) {
- return; /* Empty string, do nothing */
- }
- layoutPtr = Blt_Ts_CreateLayout(string, -1, stylePtr);
- Blt_Ts_DrawLayout(tkwin, drawable, layoutPtr, stylePtr, x, y);
- Blt_Free(layoutPtr);
-}
-
-void
-Blt_Ts_ResetStyle(Tk_Window tkwin, TextStyle *stylePtr)
-{
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
-
- gcMask = GCFont;
- gcValues.font = Blt_FontId(stylePtr->font);
- if (stylePtr->color != NULL) {
- gcMask |= GCForeground;
- gcValues.foreground = stylePtr->color->pixel;
- }
- newGC = Tk_GetGC(tkwin, gcMask, &gcValues);
- if (stylePtr->gc != NULL) {
- Tk_FreeGC(Tk_Display(tkwin), stylePtr->gc);
- }
- stylePtr->gc = newGC;
- stylePtr->flags &= ~UPDATE_GC;
-}
-
-void
-Blt_Ts_FreeStyle(Display *display, TextStyle *stylePtr)
-{
- if (stylePtr->gc != NULL) {
- Tk_FreeGC(display, stylePtr->gc);
- }
-}
-
-/*
- * The following two structures are used to keep track of string
- * measurement information when using the text layout facilities.
- *
- * A LayoutChunk represents a contiguous range of text that can be measured
- * and displayed by low-level text calls. In general, chunks will be
- * delimited by newlines and tabs. Low-level, platform-specific things
- * like kerning and non-integer character widths may occur between the
- * characters in a single chunk, but not between characters in different
- * chunks.
- *
- * A TextLayout is a collection of LayoutChunks. It can be displayed with
- * respect to any origin. It is the implementation of the Tk_TextLayout
- * opaque token.
- */
-
-typedef struct LayoutChunk {
- const char *start; /* Pointer to simple string to be displayed.
- * This is a pointer into the TkTextLayout's
- * string. */
- int numBytes; /* The number of bytes in this chunk. */
- int numChars; /* The number of characters in this chunk. */
- int numDisplayChars; /* The number of characters to display when
- * this chunk is displayed. Can be less than
- * numChars if extra space characters were
- * absorbed by the end of the chunk. This
- * will be < 0 if this is a chunk that is
- * holding a tab or newline. */
- int x, y; /* The origin of the first character in this
- * chunk with respect to the upper-left hand
- * corner of the TextLayout. */
- int totalWidth; /* Width in pixels of this chunk. Used
- * when hit testing the invisible spaces at
- * the end of a chunk. */
- int displayWidth; /* Width in pixels of the displayable
- * characters in this chunk. Can be less than
- * width if extra space characters were
- * absorbed by the end of the chunk. */
-} LayoutChunk;
-
-typedef struct TkTextLayout {
- Blt_Font font; /* The font used when laying out the text. */
- const char *string; /* The string that was layed out. */
- int width; /* The maximum width of all lines in the
- * text layout. */
- int numChunks; /* Number of chunks actually used in
- * following array. */
- LayoutChunk chunks[1]; /* Array of chunks. The actual size will
- * be maxChunks. THIS FIELD MUST BE THE LAST
- * IN THE STRUCTURE. */
-} TkTextLayout;
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FreeTextLayout --
- *
- * This procedure is called to release the storage associated with
- * a Tk_TextLayout when it is no longer needed.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory is freed.
- *
- *---------------------------------------------------------------------------
- */
-
-void
-Blt_FreeTextLayout(Tk_TextLayout textLayout)
-{
- TkTextLayout *layoutPtr = (TkTextLayout *) textLayout;
-
- if (layoutPtr != NULL) {
- Blt_Free(layoutPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewChunk --
- *
- * Helper function for Blt_ComputeTextLayout(). Encapsulates a
- * measured set of characters in a chunk that can be quickly
- * drawn.
- *
- * Results:
- * A pointer to the new chunk in the text layout.
- *
- * Side effects:
- * The text layout is reallocated to hold more chunks as necessary.
- *
- * Currently, Tk_ComputeTextLayout() stores contiguous ranges of
- * "normal" characters in a chunk, along with individual tab
- * and newline chars in their own chunks. All characters in the
- * text layout are accounted for.
- *
- *---------------------------------------------------------------------------
- */
-static LayoutChunk *
-NewChunk(TkTextLayout **layoutPtrPtr, int *maxPtr, const char *start,
- int numBytes, int curX, int newX, int y)
-{
- TkTextLayout *layoutPtr;
- LayoutChunk *chunkPtr;
- int maxChunks, numChars;
- size_t s;
-
- layoutPtr = *layoutPtrPtr;
- maxChunks = *maxPtr;
- if (layoutPtr->numChunks == maxChunks) {
- maxChunks *= 2;
- s = sizeof(TkTextLayout) + ((maxChunks - 1) * sizeof(LayoutChunk));
- layoutPtr = Blt_Realloc(layoutPtr, s);
- *layoutPtrPtr = layoutPtr;
- *maxPtr = maxChunks;
- }
- numChars = Tcl_NumUtfChars(start, numBytes);
- chunkPtr = &layoutPtr->chunks[layoutPtr->numChunks];
- chunkPtr->start = start;
- chunkPtr->numBytes = numBytes;
- chunkPtr->numChars = numChars;
- chunkPtr->numDisplayChars = numChars;
- chunkPtr->x = curX;
- chunkPtr->y = y;
- chunkPtr->totalWidth = newX - curX;
- chunkPtr->displayWidth = newX - curX;
- layoutPtr->numChunks++;
-
- return chunkPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ComputeTextLayout --
- *
- * Computes the amount of screen space needed to display a multi-line,
- * justified string of text. Records all the measurements that were done
- * to determine to size and positioning of the individual lines of text;
- * this information can be used by the Tk_DrawTextLayout() procedure to
- * display the text quickly (without remeasuring it).
- *
- * This procedure is useful for simple widgets that want to display
- * single-font, multi-line text and want Tk to handle the details.
- *
- * Results:
- * The return value is a Tk_TextLayout token that holds the measurement
- * information for the given string. The token is only valid for the
- * given string. If the string is freed, the token is no longer valid
- * and must also be freed. To free the token, call Tk_FreeTextLayout().
- *
- * The dimensions of the screen area needed to display the text are
- * stored in *widthPtr and *heightPtr.
- *
- * Side effects:
- * Memory is allocated to hold the measurement information.
- *
- *---------------------------------------------------------------------------
- */
-
-Tk_TextLayout
-Blt_ComputeTextLayout(
- Blt_Font font, /* Font that will be used to display text. */
- const char *string, /* String whose dimensions are to be
- * computed. */
- int numChars, /* Number of characters to consider from
- * string, or < 0 for strlen(). */
- int wrapLength, /* Longest permissible line length, in
- * pixels. <= 0 means no automatic wrapping:
- * just let lines get as long as needed. */
- Tk_Justify justify, /* How to justify lines. */
- int flags, /* Flag bits OR-ed together.
- * TK_IGNORE_TABS means that tab characters
- * should not be expanded. TK_IGNORE_NEWLINES
- * means that newline characters should not
- * cause a line break. */
- int *widthPtr, /* Filled with width of string. */
- int *heightPtr) /* Filled with height of string. */
-{
- const char *start, *end, *special;
- int n, y, bytesThisChunk, maxChunks;
- int baseline, height, curX, newX, maxWidth;
- TkTextLayout *layoutPtr;
- LayoutChunk *chunkPtr;
- Blt_FontMetrics fm;
- Tcl_DString lineBuffer;
- int *lineLengths;
- int curLine, layoutHeight;
-
- Tcl_DStringInit(&lineBuffer);
-
- if ((font == NULL) || (string == NULL)) {
- if (widthPtr != NULL) {
- *widthPtr = 0;
- }
- if (heightPtr != NULL) {
- *heightPtr = 0;
- }
- return NULL;
- }
-
- Blt_GetFontMetrics(font, &fm);
- height = fm.ascent + fm.descent;
-
- if (numChars < 0) {
- numChars = Tcl_NumUtfChars(string, -1);
- }
- if (wrapLength == 0) {
- wrapLength = -1;
- }
-
- maxChunks = 1;
-
- layoutPtr = Blt_AssertMalloc(sizeof(TkTextLayout) + (maxChunks - 1) *
- sizeof(LayoutChunk));
- layoutPtr->font = font;
- layoutPtr->string = string;
- layoutPtr->numChunks = 0;
-
- baseline = fm.ascent;
- maxWidth = 0;
-
- /*
- * Divide the string up into simple strings and measure each string.
- */
-
- curX = 0;
-
- end = Tcl_UtfAtIndex(string, numChars);
- special = string;
-
- flags &= TK_IGNORE_TABS | TK_IGNORE_NEWLINES;
- flags |= TK_WHOLE_WORDS | TK_AT_LEAST_ONE;
- for (start = string; start < end; ) {
- if (start >= special) {
- /*
- * Find the next special character in the string.
- *
- * INTL: Note that it is safe to increment by byte, because we are
- * looking for 7-bit characters that will appear unchanged in
- * UTF-8. At some point we may need to support the full Unicode
- * whitespace set.
- */
-
- for (special = start; special < end; special++) {
- if (!(flags & TK_IGNORE_NEWLINES)) {
- if ((*special == '\n') || (*special == '\r')) {
- break;
- }
- }
- if (!(flags & TK_IGNORE_TABS)) {
- if (*special == '\t') {
- break;
- }
- }
- }
- }
-
- /*
- * Special points at the next special character (or the end of the
- * string). Process characters between start and special.
- */
-
- chunkPtr = NULL;
- if (start < special) {
- bytesThisChunk = Blt_MeasureChars(font, start, special - start,
- wrapLength - curX, flags, &newX);
- newX += curX;
- flags &= ~TK_AT_LEAST_ONE;
- if (bytesThisChunk > 0) {
- chunkPtr = NewChunk(&layoutPtr, &maxChunks, start,
- bytesThisChunk, curX, newX, baseline);
-
- start += bytesThisChunk;
- curX = newX;
- }
- }
-
- if ((start == special) && (special < end)) {
- /*
- * Handle the special character.
- *
- * INTL: Special will be pointing at a 7-bit character so we
- * can safely treat it as a single byte.
- */
-
- chunkPtr = NULL;
- if (*special == '\t') {
- newX = curX + fm.tabWidth;
- newX -= newX % fm.tabWidth;
- NewChunk(&layoutPtr, &maxChunks, start, 1, curX, newX,
- baseline)->numDisplayChars = -1;
- start++;
- if ((start < end) &&
- ((wrapLength <= 0) || (newX <= wrapLength))) {
- /*
- * More chars can still fit on this line.
- */
-
- curX = newX;
- flags &= ~TK_AT_LEAST_ONE;
- continue;
- }
- } else {
- NewChunk(&layoutPtr, &maxChunks, start, 1, curX, curX,
- baseline)->numDisplayChars = -1;
- start++;
- goto wrapLine;
- }
- }
-
- /*
- * No more characters are going to go on this line, either because
- * no more characters can fit or there are no more characters left.
- * Consume all extra spaces at end of line.
- */
-
- while ((start < end) && isspace(UCHAR(*start))) { /* INTL: ISO space */
- if (!(flags & TK_IGNORE_NEWLINES)) {
- if ((*start == '\n') || (*start == '\r')) {
- break;
- }
- }
- if (!(flags & TK_IGNORE_TABS)) {
- if (*start == '\t') {
- break;
- }
- }
- start++;
- }
- if (chunkPtr != NULL) {
- const char *end;
-
- /*
- * Append all the extra spaces on this line to the end of the
- * last text chunk. This is a little tricky because we are
- * switching back and forth between characters and bytes.
- */
-
- end = chunkPtr->start + chunkPtr->numBytes;
- bytesThisChunk = start - end;
- if (bytesThisChunk > 0) {
- bytesThisChunk = Blt_MeasureChars(font, end, bytesThisChunk,
- -1, 0, &chunkPtr->totalWidth);
- chunkPtr->numBytes += bytesThisChunk;
- chunkPtr->numChars += Tcl_NumUtfChars(end, bytesThisChunk);
- chunkPtr->totalWidth += curX;
- }
- }
-
- wrapLine:
- flags |= TK_AT_LEAST_ONE;
-
- /*
- * Save current line length, then move current position to start of
- * next line.
- */
-
- if (curX > maxWidth) {
- maxWidth = curX;
- }
-
- /*
- * Remember width of this line, so that all chunks on this line
- * can be centered or right justified, if necessary.
- */
-
- Tcl_DStringAppend(&lineBuffer, (char *) &curX, sizeof(curX));
-
- curX = 0;
- baseline += height;
- }
-
- /*
- * If last line ends with a newline, then we need to make a 0 width
- * chunk on the next line. Otherwise "Hello" and "Hello\n" are the
- * same height.
- */
-
- if ((layoutPtr->numChunks > 0) && ((flags & TK_IGNORE_NEWLINES) == 0)) {
- if (layoutPtr->chunks[layoutPtr->numChunks - 1].start[0] == '\n') {
- chunkPtr = NewChunk(&layoutPtr, &maxChunks, start, 0, curX,
- curX, baseline);
- chunkPtr->numDisplayChars = -1;
- Tcl_DStringAppend(&lineBuffer, (char *) &curX, sizeof(curX));
- baseline += height;
- }
- }
-
- layoutPtr->width = maxWidth;
- layoutHeight = baseline - fm.ascent;
- if (layoutPtr->numChunks == 0) {
- layoutHeight = height;
-
- /*
- * This fake chunk is used by the other procedures so that they can
- * pretend that there is a chunk with no chars in it, which makes
- * the coding simpler.
- */
-
- layoutPtr->numChunks = 1;
- layoutPtr->chunks[0].start = string;
- layoutPtr->chunks[0].numBytes = 0;
- layoutPtr->chunks[0].numChars = 0;
- layoutPtr->chunks[0].numDisplayChars = -1;
- layoutPtr->chunks[0].x = 0;
- layoutPtr->chunks[0].y = fm.ascent;
- layoutPtr->chunks[0].totalWidth = 0;
- layoutPtr->chunks[0].displayWidth = 0;
- } else {
- /*
- * Using maximum line length, shift all the chunks so that the lines
- * are all justified correctly.
- */
-
- curLine = 0;
- chunkPtr = layoutPtr->chunks;
- y = chunkPtr->y;
- lineLengths = (int *) Tcl_DStringValue(&lineBuffer);
- for (n = 0; n < layoutPtr->numChunks; n++) {
- int extra;
-
- if (chunkPtr->y != y) {
- curLine++;
- y = chunkPtr->y;
- }
- extra = maxWidth - lineLengths[curLine];
- if (justify == TK_JUSTIFY_CENTER) {
- chunkPtr->x += extra / 2;
- } else if (justify == TK_JUSTIFY_RIGHT) {
- chunkPtr->x += extra;
- }
- chunkPtr++;
- }
- }
-
- if (widthPtr != NULL) {
- *widthPtr = layoutPtr->width;
- }
- if (heightPtr != NULL) {
- *heightPtr = layoutHeight;
- }
- Tcl_DStringFree(&lineBuffer);
-
- return (Tk_TextLayout) layoutPtr;
-}
-
-void
-Blt_DrawTextLayout(
- Display *display, /* Display on which to draw. */
- Drawable drawable, /* Window or pixmap in which to draw. */
- GC gc, /* Graphics context to use for drawing text. */
- Tk_TextLayout layout, /* Layout information, from a previous call
- * to Blt_ComputeTextLayout(). */
- int x, int y, /* Upper-left hand corner of rectangle in
- * which to draw (pixels). */
- int firstChar, /* The index of the first character to draw
- * from the given text item. 0 specfies the
- * beginning. */
- int lastChar) /* The index just after the last character
- * to draw from the given text item. A number
- * < 0 means to draw all characters. */
-{
- TkTextLayout *layoutPtr;
- int i, numDisplayChars, drawX;
- const char *firstByte;
- const char *lastByte;
- LayoutChunk *chunkPtr;
- int depth = 24;
-
- layoutPtr = (TkTextLayout *) layout;
- if (layoutPtr == NULL) {
- return;
- }
-
- if (lastChar < 0) {
- lastChar = 100000000;
- }
- chunkPtr = layoutPtr->chunks;
- for (i = 0; i < layoutPtr->numChunks; i++) {
- numDisplayChars = chunkPtr->numDisplayChars;
- if ((numDisplayChars > 0) && (firstChar < numDisplayChars)) {
- if (firstChar <= 0) {
- drawX = 0;
- firstChar = 0;
- firstByte = chunkPtr->start;
- } else {
- firstByte = Tcl_UtfAtIndex(chunkPtr->start, firstChar);
- Blt_MeasureChars(layoutPtr->font, chunkPtr->start,
- firstByte - chunkPtr->start, -1, 0, &drawX);
- }
- if (lastChar < numDisplayChars) {
- numDisplayChars = lastChar;
- }
- lastByte = Tcl_UtfAtIndex(chunkPtr->start, numDisplayChars);
- Blt_DrawChars(display, drawable, gc, layoutPtr->font, depth, 0.0f,
- firstByte, lastByte - firstByte,
- x + chunkPtr->x + drawX, y + chunkPtr->y);
- }
- firstChar -= chunkPtr->numChars;
- lastChar -= chunkPtr->numChars;
- if (lastChar <= 0) {
- break;
- }
- chunkPtr++;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Tk_CharBbox --
- *
- * Use the information in the Tk_TextLayout token to return the
- * bounding box for the character specified by index.
- *
- * The width of the bounding box is the advance width of the
- * character, and does not include and left- or right-bearing.
- * Any character that extends partially outside of the
- * text layout is considered to be truncated at the edge. Any
- * character which is located completely outside of the text
- * layout is considered to be zero-width and pegged against
- * the edge.
- *
- * The height of the bounding box is the line height for this font,
- * extending from the top of the ascent to the bottom of the
- * descent. Information about the actual height of the individual
- * letter is not available.
- *
- * A text layout that contains no characters is considered to
- * contain a single zero-width placeholder character.
- *
- * Results:
- * The return value is 0 if the index did not specify a character
- * in the text layout, or non-zero otherwise. In that case,
- * *bbox is filled with the bounding box of the character.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-int
-Blt_CharBbox(
- Tk_TextLayout layout, /* Layout information, from a previous call to
- * Tk_ComputeTextLayout(). */
- int index, /* The index of the character whose bbox is
- * desired. */
- int *xPtr, int *yPtr, /* Filled with the upper-left hand corner, in
- * pixels, of the bounding box for the character
- * specified by index, if non-NULL. */
- int *widthPtr,
- int *heightPtr) /* Filled with the width and height of the
- * bounding box for the character specified by
- * index, if non-NULL. */
-{
- TkTextLayout *layoutPtr;
- LayoutChunk *chunkPtr;
- int i, x, w;
- Blt_Font font;
- const char *end;
- Blt_FontMetrics fm;
-
- if (index < 0) {
- return 0;
- }
-
- layoutPtr = (TkTextLayout *) layout;
- chunkPtr = layoutPtr->chunks;
- font = layoutPtr->font;
-
- Blt_GetFontMetrics(font, &fm);
- for (i = 0; i < layoutPtr->numChunks; i++) {
- if (chunkPtr->numDisplayChars < 0) {
- if (index == 0) {
- x = chunkPtr->x;
- w = chunkPtr->totalWidth;
- goto check;
- }
- } else if (index < chunkPtr->numChars) {
- end = Tcl_UtfAtIndex(chunkPtr->start, index);
- if (xPtr != NULL) {
- Blt_MeasureChars(font, chunkPtr->start,
- end - chunkPtr->start, -1, 0, &x);
- x += chunkPtr->x;
- }
- if (widthPtr != NULL) {
- Blt_MeasureChars(font, end, Tcl_UtfNext(end) - end, -1, 0, &w);
- }
- goto check;
- }
- index -= chunkPtr->numChars;
- chunkPtr++;
- }
- if (index == 0) {
- /*
- * Special case to get location just past last char in layout.
- */
-
- chunkPtr--;
- x = chunkPtr->x + chunkPtr->totalWidth;
- w = 0;
- } else {
- return 0;
- }
-
- /*
- * Ensure that the bbox lies within the text layout. This forces all
- * chars that extend off the right edge of the text layout to have
- * truncated widths, and all chars that are completely off the right
- * edge of the text layout to peg to the edge and have 0 width.
- */
- check:
- if (yPtr != NULL) {
- *yPtr = chunkPtr->y - fm.ascent;
- }
- if (heightPtr != NULL) {
- *heightPtr = fm.ascent + fm.descent;
- }
-
- if (x > layoutPtr->width) {
- x = layoutPtr->width;
- }
- if (xPtr != NULL) {
- *xPtr = x;
- }
- if (widthPtr != NULL) {
- if (x + w > layoutPtr->width) {
- w = layoutPtr->width - x;
- }
- *widthPtr = w;
- }
-
- return 1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_UnderlineTextLayout --
- *
- * Use the information in the Tk_TextLayout token to display an
- * underline below an individual character. This procedure does
- * not draw the text, just the underline.
- *
- * This procedure is useful for simple widgets that need to
- * display single-font, multi-line text with an individual
- * character underlined and want Tk to handle the details.
- * To display larger amounts of underlined text, construct
- * and use an underlined font.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Underline drawn on the screen.
- *
- *---------------------------------------------------------------------------
- */
-
-void
-Blt_UnderlineTextLayout(
- Display *display, /* Display on which to draw. */
- Drawable drawable, /* Window or pixmap in which to draw. */
- GC gc, /* Graphics context to use for drawing text. */
- Tk_TextLayout layout, /* Layout information, from a previous call
- * to Tk_ComputeTextLayout(). */
- int x, int y, /* Upper-left hand corner of rectangle in
- * which to draw (pixels). */
- int underline) /* Index of the single character to
- * underline, or -1 for no underline. */
-{
- TkTextLayout *layoutPtr;
- int xx, yy, width, height;
-
- if ((Blt_CharBbox(layout, underline, &xx, &yy, &width, &height) != 0)
- && (width != 0)) {
- Blt_FontMetrics fm;
- layoutPtr = (TkTextLayout *) layout;
- Blt_GetFontMetrics(layoutPtr->font, &fm);
- XFillRectangle(display, drawable, gc, x + xx,
- y + yy + fm.ascent + fm.underlinePos,
- (unsigned int) width, fm.underlineHeight);
- }
-}
diff --git a/blt3.0.1/src/bltText.h b/blt3.0.1/src/bltText.h
deleted file mode 100644
index 7d4ef3d..0000000
--- a/blt3.0.1/src/bltText.h
+++ /dev/null
@@ -1,265 +0,0 @@
-
-/*
- * bltText.h --
- *
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_TEXT_H
-#define _BLT_TEXT_H
-
-#include "bltBgStyle.h"
-
-#define DEF_TEXT_FLAGS (TK_PARTIAL_OK | TK_IGNORE_NEWLINES)
-#define UPDATE_GC 1
-
-/*
- * TextFragment --
- */
-typedef struct {
- const char *text; /* Text string to be displayed */
-
- size_t count; /* Number of bytes in text. The actual
- * character count may differ because of
- * multi-byte UTF encodings. */
-
- short x, y; /* X-Y offset of the baseline from the
- * upper-left corner of the bbox. */
-
- short sx, sy; /* Starting offset of text using rotated
- * font. */
-
- int width; /* Width of segment in pixels. This
- * information is used to draw
- * PostScript strings the same width
- * as X. */
-} TextFragment;
-
-
-/*
- * TextItem --
- *
- * Parsed form for markup string. Each item is a scrap of text
- * describes the font, position, and characters to be displayed.
- *
- * subscript x_y very small subset of latex markup.
- * superscript x^y
- * grouping a^{x+y} a_{i,j}
- * supersuper a^{10^8}
- * \hat{a} \bar{b} \vec{c}
- * \overline{} \underline{}
- * \frac \tfrac
- * \Alpha \Beta ...
- * \mathbf{} \mathit{} \mathrm{} \boldsymbol{}
- * \angstrom \degree
- *
- * -mathtext instead of -text
- *
- * Can use TextItem where you don't directly edit the text:
- * label, treeview, graph, barchart...
- *
- * Font selector (bold, italic, size adjust) from base font.
- * Global font table reference counted.
- *
- */
-typedef struct {
- const char *text; /* Text string to be displayed */
-
- size_t count; /* Number of bytes in text. The actual
- * character count may differ because of
- * multi-byte UTF encodings. */
-
- short int x, y; /* X-Y offset of the baseline from the
- * upper-left corner of the bbox. */
-
- short int sx, sy; /* Starting offset of text using rotated
- * font. */
-
- Blt_Font font; /* Allocated font for this chunk.
- * If NULL, use the global font. */
-
- int underline; /* Text is underlined */
-
- int width; /* Width of segment in pixels. This
- * information is used to draw
- * PostScript strings the same width
- * as X. (deprecated) */
-} TextItem;
-
-/*
- * TextLayout --
- */
-typedef struct {
- TextFragment *underlinePtr;
- int underline;
- size_t width, height; /* Dimensions of text bounding box */
- size_t nFrags; /* # fragments of text */
- TextFragment fragments[1]; /* Information about each fragment of text */
-} TextLayout;
-
-/*
- * TextStyle --
- *
- * A somewhat convenient structure to hold text attributes that determine
- * how a text string is to be displayed on the screen or drawn with
- * PostScript commands. The alternative is to pass lots of parameters to
- * the drawing and printing routines. This seems like a more efficient
- * and less cumbersome way of passing parameters.
- */
-typedef struct {
- unsigned int state; /* If non-zero, indicates to draw text
- * in the active color */
- XColor *color; /* Color to draw the text. */
- Blt_Font font; /* Font to use to draw text */
- Blt_Background bg; /* Background color of text. This is
- * also used for drawing disabled
- * text. */
- float angle; /* Rotation of text in degrees. */
- Tk_Justify justify; /* Justification of the text
- * string. This only matters if the
- * text is composed of multiple
- * lines. */
- Tk_Anchor anchor; /* Indicates how the text is anchored
- * around its x,y coordinates. */
- Blt_Pad xPad, yPad; /* # pixels padding of around text
- * region. */
- unsigned short int leader; /* # pixels spacing between lines of
- * text. */
- short int underline; /* Index of character to be underlined,
- * -1 if no underline. */
- int maxLength; /* Maximum length in pixels of text */
- /* Private fields. */
- unsigned short flags;
- GC gc; /* GC used to draw the text */
-} TextStyle;
-
-BLT_EXTERN TextLayout *Blt_Ts_CreateLayout(const char *string, int length,
- TextStyle *tsPtr);
-
-BLT_EXTERN void Blt_Ts_DrawLayout(Tk_Window tkwin, Drawable drawable,
- TextLayout *textPtr, TextStyle *tsPtr, int x, int y);
-
-BLT_EXTERN void Blt_Ts_GetExtents(TextStyle *tsPtr, const char *text,
- unsigned int *widthPtr, unsigned int *heightPtr);
-
-BLT_EXTERN void Blt_Ts_ResetStyle(Tk_Window tkwin, TextStyle *tsPtr);
-
-BLT_EXTERN void Blt_Ts_FreeStyle(Display *display, TextStyle *tsPtr);
-
-BLT_EXTERN void Blt_Ts_SetDrawStyle (TextStyle *tsPtr, Blt_Font font, GC gc,
- XColor *fgColor, float angle, Tk_Anchor anchor, Tk_Justify justify,
- int leader);
-
-BLT_EXTERN void Blt_Ts_SetPrintStyle(TextStyle *tsPtr, Blt_Font font,
- XColor *fgColor, XColor *bgColor, float angle, Tk_Anchor anchor,
- Tk_Justify justify, int leader);
-
-BLT_EXTERN void Blt_DrawText(Tk_Window tkwin, Drawable drawable,
- const char *string, TextStyle *tsPtr, int x, int y);
-
-BLT_EXTERN void Blt_DrawText2(Tk_Window tkwin, Drawable drawable,
- const char *string, TextStyle *tsPtr, int x, int y, Dim2D * dimPtr);
-
-BLT_EXTERN Pixmap Blt_Ts_Bitmap(Tk_Window tkwin, TextLayout *textPtr,
- TextStyle *tsPtr, int *widthPtr, int *heightPtr);
-
-BLT_EXTERN int Blt_DrawTextWithRotatedFont(Tk_Window tkwin, Drawable drawable,
- float angle, TextStyle *tsPtr, TextLayout *textPtr, int x, int y);
-
-BLT_EXTERN void Blt_DrawLayout(Tk_Window tkwin, Drawable drawable, GC gc,
- Blt_Font font, int depth, float angle, int x, int y,
- TextLayout *layoutPtr, int maxLength);
-
-BLT_EXTERN void Blt_GetTextExtents(Blt_Font font, int leader, const char *text,
- int textLen, unsigned int *widthPtr, unsigned int *heightPtr);
-
-BLT_EXTERN void Blt_RotateStartingTextPositions(TextLayout *textPtr,
- float angle);
-
-BLT_EXTERN Tk_TextLayout Blt_ComputeTextLayout(Blt_Font font,
- const char *string, int numChars, int wrapLength, Tk_Justify justify,
- int flags, int *widthPtr, int *heightPtr);
-
-BLT_EXTERN void Blt_DrawTextLayout(Display *display, Drawable drawable, GC gc,
- Tk_TextLayout layout, int x, int y, int firstChar, int lastChar);
-
-BLT_EXTERN int Blt_CharBbox(Tk_TextLayout layout, int index, int *xPtr,
- int *yPtr, int *widthPtr, int *heightPtr);
-
-BLT_EXTERN void Blt_UnderlineTextLayout(Display *display, Drawable drawable,
- GC gc, Tk_TextLayout layout, int x, int y, int underline);
-
-BLT_EXTERN void Blt_Ts_UnderlineLayout(Tk_Window tkwin, Drawable drawable,
- TextLayout *layoutPtr, TextStyle *tsPtr, int x, int y);
-
-BLT_EXTERN void Blt_Ts_DrawText(Tk_Window tkwin, Drawable drawable,
- const char *text, int textLen, TextStyle *tsPtr, int x, int y);
-
-BLT_EXTERN int Blt_MeasureText(Blt_Font font, const char *text, int textLen,
- int maxLength, int *nBytesPtr);
-
-BLT_EXTERN void Blt_FreeTextLayout(Tk_TextLayout layout);
-
-#define Blt_Ts_GetAnchor(ts) ((ts).anchor)
-#define Blt_Ts_GetAngle(ts) ((ts).angle)
-#define Blt_Ts_GetBackground(ts) ((ts).bg)
-#define Blt_Ts_GetFont(ts) ((ts).font)
-#define Blt_Ts_GetForeground(ts) ((ts).color)
-#define Blt_Ts_GetJustify(ts) ((ts).justify)
-#define Blt_Ts_GetLeader(ts) ((ts).leader)
-
-#define Blt_Ts_SetAnchor(ts, a) ((ts).anchor = (a))
-#define Blt_Ts_SetAngle(ts, r) ((ts).angle = (float)(r))
-#define Blt_Ts_SetBackground(ts, b) ((ts).bg = (b))
-#define Blt_Ts_SetFont(ts, f) \
- (((ts).font != (f)) ? ((ts).font = (f), (ts).flags |= UPDATE_GC) : 0)
-#define Blt_Ts_SetForeground(ts, c) \
- (((ts).color != (c)) ? ((ts).color = (c), (ts).flags |= UPDATE_GC) : 0)
-#define Blt_Ts_SetGC(ts, g) ((ts).gc = (g))
-#define Blt_Ts_SetJustify(ts, j) ((ts).justify = (j))
-#define Blt_Ts_SetLeader(ts, l) ((ts).leader = (l))
-#define Blt_Ts_SetMaxLength(ts, l) ((ts).maxLength = (l))
-#define Blt_Ts_SetPadding(ts, l, r, t, b) \
- ((ts).xPad.side1 = (l), \
- (ts).xPad.side2 = (r), \
- (ts).yPad.side1 = (t), \
- (ts).yPad.side2 = (b))
-#define Blt_Ts_SetState(ts, s) ((ts).state = (s))
-#define Blt_Ts_SetUnderline(ts, ul) ((ts).underline = (ul))
-
-#define Blt_Ts_InitStyle(ts) \
- ((ts).anchor = TK_ANCHOR_NW, \
- (ts).color = (XColor *)NULL, \
- (ts).font = NULL, \
- (ts).justify = TK_JUSTIFY_LEFT, \
- (ts).leader = 0, \
- (ts).underline = -1, \
- (ts).xPad.side1 = (ts).xPad.side2 = 0, \
- (ts).yPad.side1 = (ts).yPad.side2 = 0, \
- (ts).state = 0, \
- (ts).flags = 0, \
- (ts).gc = NULL, \
- (ts).maxLength = -1, \
- (ts).angle = 0.0)
-
-#endif /* _BLT_TEXT_H */
diff --git a/blt3.0.1/src/bltTile.c b/blt3.0.1/src/bltTile.c
deleted file mode 100644
index 4271bf8..0000000
--- a/blt3.0.1/src/bltTile.c
+++ /dev/null
@@ -1,1315 +0,0 @@
-
-/*
- * bltTile.c --
- *
- * This module manages images for tiled backgrounds for the BLT toolkit.
- *
- * Copyright 1995-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltChain.h"
-#include "bltHash.h"
-#include "bltImage.h"
-#include <X11/Xutil.h>
-#include "tkDisplay.h"
-#include "bltTile.h"
-#include "bltBitmap.h"
-
-#define TILE_THREAD_KEY "BLT Tile Data"
-#define TILE_MAGIC ((unsigned int) 0x46170277)
-
-typedef struct {
- Blt_HashTable tileTable; /* Hash table of tile structures keyed by the
- * name of the image. */
- Tcl_Interp *interp;
-} TileInterpData;
-
-typedef struct {
- char *name; /* Name of image used to generate the pixmap.*/
- Display *display; /* Display where pixmap was created. */
- int flags; /* See definitions below. */
- Tcl_Interp *interp;
-
- Blt_HashEntry *hashPtr; /* Pointer to hash table location */
-
- Blt_HashTable *tablePtr;
-
- Pixmap pixmap; /* Pixmap generated from image. */
-
- Pixmap mask; /* Monochrome pixmap used as a transparency
- * mask. */
-
- GC gc; /* GC */
- Tk_Image tkImage; /* Tk image token. */
- Blt_Chain clients; /* Chain of clients sharing this tile. */
-
- int width, height; /* Dimensions of the tile itself. */
-} Tile;
-
-#define NOTIFY_PENDING 1 /* If set, indicates that the image associated
- * with the tile has been updated or deleted.
- * The tile pixmap will be changed and the
- * clients of the tile will be notified (if
- * they supplied a TileChangedProc routine. */
-
-typedef struct _Blt_TileClient {
- unsigned int magic;
-
- Tk_Window tkwin; /* Reference window. */
-
- int xOrigin, yOrigin; /* Origin of tile relative to the reference
- * window. */
-
- Blt_TileChangedProc *notifyProc; /* If non-NULL, routine to call to when
- * tile image changes. */
- ClientData clientData; /* Data to pass to when calling the above
- * routine. */
- Tile *tilePtr; /* Pointer to actual tile information */
- Blt_ChainLink link; /* Pointer to client entry in the server's
- * client list. Used to delete the client */
-} TileClient;
-
-typedef struct {
- Display *display;
- Tk_Uid nameId;
- int depth;
-} TileKey;
-
-#ifdef notdef
-#define DEF_TILE_BORDER STD_BACKGROUND
-#define DEF_TILE_BORDER_WIDTH "0"
-#define DEF_TILE_RESIZE "none"
-#define DEF_TILE_X_ORIGIN "0"
-#define DEF_TILE_Y_ORIGIN "0"
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BORDER, "-background", "background", "Background",
- DEF_TILE_BORDER_COLOR, Blt_Offset(Tile, border), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_TILE_BORDERWIDTH, Blt_Offset(Tile, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-image", "image", "Image", (char *)NULL,
- Blt_Offset(Tile, image), BLT_CONFIG_DONT_SET_DEFAULT, &imageOption},
- {BLT_CONFIG_CUSTOM, "-relativeto", "relativeTo", "RelativeTo", (char *)NULL,
- Blt_Offset(Tile, relative), BLT_CONFIG_DONT_SET_DEFAULT,
- &relativeOption},
- {BLT_CONFIG_CUSTOM, "-resize", "resize", "Resize", (char *)NULL,
- Blt_Offset(Tile, resize), BLT_CONFIG_DONT_SET_DEFAULT,
- &resizeOption},
- {BLT_CONFIG_INT, "-xorigin", "xOrigin", "Origin", DEF_TILE_X_ORIGIN,
- Blt_Offset(Tile, xOrigin), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_INT, "-yorigin", "yOrigin", "Origin", DEF_TILE_Y_ORIGIN,
- Blt_Offset(Tile, yOrigin), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
-};
-#endif
-
-static Tcl_IdleProc UpdateTile;
-static Tk_ImageChangedProc ImageChangedProc;
-static Tcl_InterpDeleteProc TileInterpDeleteProc;
-
-static TileInterpData *GetTileInterpData(Tcl_Interp *interp);
-static void DestroyClient(TileClient *clientPtr);
-static void DestroyTile(Tile *tilePtr);
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * RedrawTile --
- *
- * Generates a pixmap and draws the tile image into it. Also a
- * tranparency mask is possibly generated from the image.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-RedrawTile(Tk_Window tkwin, Tile *tilePtr)
-{
- GC newGC;
- Tk_PhotoHandle photo;
- XGCValues gcValues;
- int width, height;
- unsigned int gcMask;
-
- Tk_SizeOfImage(tilePtr->tkImage, &width, &height);
-
- Tk_MakeWindowExist(tkwin);
- if ((width != tilePtr->width) || (height != tilePtr->height)) {
- Pixmap pixmap;
-
- /*
- * Create the new pixmap *before* destroying the old one. I don't why
- * this happens, but if you delete the old pixmap first, the old
- * pixmap sometimes gets used in the client's GCs. I suspect it has
- * something to do with the way Tk reallocates X resource identifiers.
- */
- pixmap = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin), width,
- height, Tk_Depth(tkwin));
- if (tilePtr->pixmap != None) {
- Tk_FreePixmap(Tk_Display(tkwin), tilePtr->pixmap);
- }
- tilePtr->pixmap = pixmap;
- }
- Tk_RedrawImage(tilePtr->tkImage, 0, 0, width, height, tilePtr->pixmap,
- 0, 0);
-
- gcMask = (GCTile | GCFillStyle);
- gcValues.fill_style = FillTiled;
- gcValues.tile = tilePtr->pixmap;
- newGC = Tk_GetGC(tkwin, gcMask, &gcValues);
- if (tilePtr->gc != NULL) {
- Tk_FreeGC(Tk_Display(tkwin), tilePtr->gc);
- }
- tilePtr->gc = newGC;
- tilePtr->width = width;
- tilePtr->height = height;
-
- if (tilePtr->mask != None) {
-#if defined(WIN32) || defined(MACOSX)
- Tk_FreePixmap(Tk_Display(tkwin), tilePtr->mask);
-#else
- XFreePixmap(Tk_Display(tkwin), tilePtr->mask);
-#endif /* WIN32 or MACOSX */
- tilePtr->mask = None;
- }
- photo = Tk_FindPhoto(tilePtr->interp,
- Blt_Image_Name(tilePtr->tkImage));
- if (photo != NULL) {
- Tk_PhotoImageBlock src;
-
- Tk_PhotoGetImage(photo, &src);
- if ((src.offset[3] < src.pixelSize) && (src.offset[3] >= 0)) {
- tilePtr->mask = Blt_PhotoImageMask(tkwin, src);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UpdateTile --
- *
- * It would be better if Tk checked for NULL proc pointers.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-UpdateTile(ClientData clientData)
-{
- Tile *tilePtr = (Tile *)clientData;
- TileClient *clientPtr;
- Blt_ChainLink link;
-
- tilePtr->flags &= ~NOTIFY_PENDING;
- if (Blt_Image_IsDeleted(tilePtr->tkImage)) {
- if (tilePtr->pixmap != None) {
- Tk_FreePixmap(tilePtr->display, tilePtr->pixmap);
- }
- tilePtr->pixmap = None;
- } else {
- /* Pick any client window to generate the new pixmap. */
- link = Blt_Chain_FirstLink(tilePtr->clients);
- clientPtr = Blt_Chain_GetValue(link);
- RedrawTile(clientPtr->tkwin, tilePtr);
- }
-
- /* Notify each of the tile's clients that the pixmap has changed. */
-
- for (link = Blt_ChainFirstLink(tilePtr->clients); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- clientPtr = Blt_Chain_GetValue(link);
- if (clientPtr->notifyProc != NULL) {
- (*clientPtr->notifyProc) (clientPtr->clientData, clientPtr);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImageChangedProc
- *
- * The Tk image has changed or been deleted, redraw the pixmap
- * tile.
- *
- * Note: As of Tk 4.2 (rechecked in 8.3), if you redraw Tk
- * images from a Tk_ImageChangedProc you'll get a coredump. As a
- * workaround, we have to simulate how the Tk widgets use images
- * and redraw within an idle event.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-ImageChangedProc(
- ClientData clientData,
- int x, int y, /* Not used. */
- int width, int height, /* Not used. */
- int imageWidth, int imageHeight) /* Not used. */
-{
- Tile *tilePtr = (Tile *) clientData;
-
- if (!(tilePtr->flags & NOTIFY_PENDING)) {
- Tcl_DoWhenIdle(UpdateTile, tilePtr);
- tilePtr->flags |= NOTIFY_PENDING;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyTile --
- *
- * Deletes the core tile structure, including the pixmap representing the
- * tile.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyTile(Tile *tilePtr)
-{
- Blt_ChainLink link;
- TileClient *clientPtr;
-
- if (tilePtr->flags & NOTIFY_PENDING) {
- Tcl_CancelIdleCall(UpdateTile, tilePtr);
- }
- for (link = Blt_Chain_FirstLink(tilePtr->clients); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- clientPtr = Blt_Chain_GetValue(link);
- Blt_Free(clientPtr);
- }
- Blt_Chain_Destroy(tilePtr->clients);
-
- if (tilePtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(tilePtr->tablePtr, tilePtr->hashPtr);
- }
- if (tilePtr->pixmap != None) {
- Tk_FreePixmap(tilePtr->display, tilePtr->pixmap);
- }
- Tk_FreeImage(tilePtr->tkImage);
-
- if (tilePtr->gc != NULL) {
- Tk_FreeGC(tilePtr->display, tilePtr->gc);
- }
- if (tilePtr->name != NULL) {
- Blt_Free(tilePtr->name);
- }
- Blt_Free(tilePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateTile --
- *
- * Creates a tile server. A tile server manages a single image, possibly
- * shared by several clients. Clients will be updated (if requested) by
- * the server if the image changes, so they know to redraw themselves.
- * For X11 the image is drawn into a pixmap that is used in a new GC as
- * its tile. For Windows we have to do the tiling ourselves by redrawing
- * the image across the drawing area (see Blt_TileRectangle and
- * Blt_TilePolygon).
- *
- * Results:
- * Returns a pointer to the new tile server. If the image name does not
- * represent a Tk image, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Tile *
-CreateTile(
- Tcl_Interp *interp,
- Tk_Window tkwin,
- char *imageName)
-{
- Tile *tilePtr;
- Tk_Image tkImage;
-
- tilePtr = Blt_AssertCalloc(1, sizeof(Tile));
-
- /* Get the image. Funnel all change notifications to a single routine. */
- tkImage = Tk_GetImage(interp, tkwin, imageName, ImageChangedProc,
- tilePtr);
- if (tkImage == NULL) {
- Blt_Free(tilePtr);
- return NULL;
- }
-
- /* Initialize the tile server. */
- tilePtr->display = Tk_Display(tkwin);
- tilePtr->interp = interp;
- tilePtr->name = Blt_AssertStrdup(imageName);
- tilePtr->clients = Blt_Chain_Create();
- tilePtr->tkImage = tkImage;
- RedrawTile(tkwin, tilePtr);
- return tilePtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyClient --
- *
- * Removes the client from the servers's list of clients and memory used
- * by the client token is released. When the last client is deleted, the
- * server is also removed.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyClient(TileClient *clientPtr)
-{
- Tile *tilePtr;
- tilePtr = clientPtr->tilePtr;
-
- /* Remove the client from the server's list */
- if (clientPtr->link != NULL) {
- Blt_Chain_DeleteLink(tilePtr->clients, clientPtr->link);
- }
- if (Blt_Chain_GetLength(tilePtr->clients) == 0) {
- /*
- * If there are no more clients of the tile, then remove the pixmap,
- * image, and the server record.
- */
- DestroyTile(tilePtr);
- }
- Blt_Free(clientPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateClient --
- *
- * Returns a token to a tile (possibly shared by many clients). A client
- * uses the token to query or display the tile. Clients request tiles by
- * their image names. Each tile is known by its display, screen depth,
- * and image name. The tile server tracks what clients are using the
- * tile and notifies them (via a callback) whenever the tile changes. If
- * no server exists already, one is created on-the-fly.
- *
- * Results:
- * A pointer to the newly created client (i.e. tile).
- *
- *---------------------------------------------------------------------------
- */
-static TileClient *
-CreateClient(
- Tcl_Interp *interp,
- Tk_Window tkwin,
-
- char *name)
-{
- TileClient *clientPtr;
- Tile *tilePtr;
- TileInterpData *dataPtr;
- Blt_HashEntry *hPtr;
- int isNew;
- TileKey key;
-
- dataPtr = GetTileInterpData(interp);
-
- key.nameId = Tk_GetUid(name);
- key.display = Tk_Display(tkwin);
- key.depth = Tk_Depth(tkwin);
- hPtr = Blt_CreateHashEntry(&dataPtr->tileTable, (char *)&key, &isNew);
- if (isNew) {
- tilePtr = CreateTile(interp, tkwin, name);
- if (tilePtr == NULL) {
- Blt_DeleteHashEntry(&dataPtr->tileTable, hPtr);
- return NULL;
- }
- tilePtr->hashPtr = hPtr;
- tilePtr->tablePtr = &dataPtr->tileTable;
- Blt_SetHashValue(hPtr, tilePtr);
- } else {
- tilePtr = Blt_GetHashValue(hPtr);
- }
- clientPtr = Blt_AssertCalloc(1, sizeof(TileClient));
- /* Initialize client information. */
- clientPtr->magic = TILE_MAGIC;
- clientPtr->tkwin = tkwin;
- clientPtr->link = Blt_Chain_Append(tilePtr->clients, clientPtr);
- clientPtr->tilePtr = tilePtr;
- return clientPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TileInterpDeleteProc --
- *
- * This is called when the interpreter is deleted. All the tiles are
- * specific to that interpreter are destroyed.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Destroys the tile table.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-TileInterpDeleteProc(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp)
-{
- TileInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Tile *tilePtr;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->tileTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- tilePtr = Blt_GetHashValue(hPtr);
- tilePtr->hashPtr = NULL;
- DestroyTile(tilePtr);
- }
- Blt_DeleteHashTable(&dataPtr->tileTable);
- Tcl_DeleteAssocData(interp, TILE_THREAD_KEY);
- Blt_Free(dataPtr);
-}
-
-static TileInterpData *
-GetTileInterpData(Tcl_Interp *interp)
-{
- TileInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (TileInterpData *)
- Tcl_GetAssocData(interp, TILE_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(TileInterpData));
- dataPtr->interp = interp;
- Tcl_SetAssocData(interp, TILE_THREAD_KEY, TileInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->tileTable, sizeof(TileKey)/sizeof(int));
- }
- return dataPtr;
-}
-
-/* Public API for tiles. */
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetTile
- *
- * Convert the named image into a tile.
- *
- * Results:
- * If the image is valid, a new tile is returned. If the name does not
- * represent a proper image, an error message is left in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-int
-Blt_GetTile(
- Tcl_Interp *interp, /* Interpreter to report results back to */
- Tk_Window tkwin, /* Window on the same display as tile */
- char *imageName, /* Name of image */
- Blt_Tile *tokenPtr) /* (out) Returns the allocated tile token. */
-{
- TileClient *clientPtr;
-
- clientPtr = CreateClient(interp, tkwin, imageName);
- if (clientPtr == NULL) {
- return TCL_ERROR;
- }
- *tokenPtr = clientPtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FreeTile
- *
- * Release the resources associated with the tile.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Memory and X resources are freed. Bookkeeping information about the
- * tile (i.e. width, height, and name) is discarded.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_FreeTile(TileClient *clientPtr) /* Tile to be deleted */
-{
- if ((clientPtr == NULL) || (clientPtr->magic != TILE_MAGIC)) {
- return; /* No tile */
- }
- DestroyClient(clientPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_NameOfTile
- *
- * Returns the name of the image from which the tile was generated.
- *
- * Results:
- * The name of the image is returned. The name is not unique. Many
- * tiles may use the same image.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-const char *
-Blt_NameOfTile(TileClient *clientPtr) /* Tile to query */
-{
- if (clientPtr == NULL) {
- return "";
- }
- if (clientPtr->magic != TILE_MAGIC) {
- return "not a tile";
- }
- return clientPtr->tilePtr->name;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PixmapOfTile
- *
- * Returns the pixmap of the tile.
- *
- * Results:
- * The X pixmap used as the tile is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-Pixmap
-Blt_PixmapOfTile(TileClient *clientPtr) /* Tile to query */
-{
- if ((clientPtr == NULL) || (clientPtr->magic != TILE_MAGIC)) {
- return None;
- }
- return clientPtr->tilePtr->pixmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_SizeOfTile
- *
- * Returns the width and height of the tile.
- *
- * Results:
- * The width and height of the tile are returned.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_SizeOfTile(
- TileClient *clientPtr, /* Tile to query */
- int *widthPtr,
- int *heightPtr) /* Returned dimensions of the tile (out) */
-{
- if ((clientPtr == NULL) || (clientPtr->magic != TILE_MAGIC)) {
- *widthPtr = *heightPtr = 0;
- return; /* No tile given. */
- }
- *widthPtr = clientPtr->tilePtr->width;
- *heightPtr = clientPtr->tilePtr->height;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_SetTileChangedProc
- *
- * Sets the routine to called when an image changes.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The designated routine will be called the next time the image
- * associated with the tile changes.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-void
-Blt_SetTileChangedProc(
- TileClient *clientPtr, /* Tile to query */
- Blt_TileChangedProc *notifyProc,
- ClientData clientData)
-{
- if ((clientPtr != NULL) && (clientPtr->magic == TILE_MAGIC)) {
- clientPtr->notifyProc = notifyProc;
- clientPtr->clientData = clientData;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_SetTileOrigin --
- *
- * Set the pattern origin of the tile to a common point (i.e. the origin
- * (0,0) of the top level window) so that tiles from two different
- * widgets will match up. This done by setting the GCTileStipOrigin
- * field is set to the translated origin of the toplevel window in the
- * hierarchy.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The GCTileStipOrigin is reset in the GC. This will cause the tile
- * origin to change when the GC is used for drawing.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-void
-Blt_SetTileOrigin(
- Tk_Window tkwin,
- TileClient *clientPtr,
- int x, int y)
-{
- while (!Tk_IsTopLevel(tkwin)) {
- x += Tk_X(tkwin) + Tk_Changes(tkwin)->border_width;
- y += Tk_Y(tkwin) + Tk_Changes(tkwin)->border_width;
- tkwin = Tk_Parent(tkwin);
- }
- XSetTSOrigin(Tk_Display(tkwin), clientPtr->tilePtr->gc, -x, -y);
- clientPtr->xOrigin = -x;
- clientPtr->yOrigin = -y;
-}
-
-void
-Blt_SetTSOrigin(
- Tk_Window tkwin,
- TileClient *clientPtr,
- int x, int y)
-{
- XSetTSOrigin(Tk_Display(tkwin), clientPtr->tilePtr->gc, x, y);
- clientPtr->xOrigin = x;
- clientPtr->yOrigin = y;
-}
-
-#ifdef WIN32
-static int tkpWinRopModes[] =
-{
- R2_BLACK, /* GXclear */
- R2_MASKPEN, /* GXand */
- R2_MASKPENNOT, /* GXandReverse */
- R2_COPYPEN, /* GXcopy */
- R2_MASKNOTPEN, /* GXandInverted */
- R2_NOT, /* GXnoop */
- R2_XORPEN, /* GXxor */
- R2_MERGEPEN, /* GXor */
- R2_NOTMERGEPEN, /* GXnor */
- R2_NOTXORPEN, /* GXequiv */
- R2_NOT, /* GXinvert */
- R2_MERGEPENNOT, /* GXorReverse */
- R2_NOTCOPYPEN, /* GXcopyInverted */
- R2_MERGENOTPEN, /* GXorInverted */
- R2_NOTMASKPEN, /* GXnand */
- R2_WHITE /* GXset */
-};
-#define MASKPAT 0x00E20746 /* dest = (src & pat) | (!src & dst) */
-#define COPYFG 0x00CA0749 /* dest = (pat & src) | (!pat & dst) */
-#define COPYBG 0x00AC0744 /* dest = (!pat & src) | (pat & dst) */
-
-static void
-TileArea(
- HDC srcDC, /* Source device context. */
- HDC destDC, /* Destination device context. */
- HDC maskDC, /* If non-NULL, device context of the tile
- * mask. */
- TileClient *clientPtr,
- int x, int y,
- int width, int height)
-{
- Tile *tilePtr = clientPtr->tilePtr;
- int destX, destY;
- int destWidth, destHeight;
- int srcX, srcY;
- int startX, startY; /* Starting upper left corner of region. */
- int delta;
- int left, top, right, bottom;
-
- startX = x;
- if (x < clientPtr->xOrigin) {
- delta = (clientPtr->xOrigin - x) % tilePtr->width;
- if (delta > 0) {
- startX -= (tilePtr->width - delta);
- }
- } else if (x > clientPtr->xOrigin) {
- delta = (x - clientPtr->xOrigin) % tilePtr->width;
- if (delta > 0) {
- startX -= delta;
- }
- }
- startY = y;
- if (y < clientPtr->yOrigin) {
- delta = (clientPtr->yOrigin - y) % tilePtr->height;
- if (delta > 0) {
- startY -= (tilePtr->height - delta);
- }
- } else if (y >= clientPtr->yOrigin) {
- delta = (y - clientPtr->yOrigin) % tilePtr->height;
- if (delta > 0) {
- startY -= delta;
- }
- }
-#ifdef notdef
- PurifyPrintf("tile is (%d,%d,%d,%d)\n",
- clientPtr->xOrigin, clientPtr->yOrigin,
- tilePtr->width, tilePtr->height);
- PurifyPrintf("region is (%d,%d,%d,%d)\n", x, y, width, height);
- PurifyPrintf("starting at %d,%d\n", startX, startY);
-#endif
- left = x;
- right = x + width;
- top = y;
- bottom = y + height;
- for (y = startY; y < bottom; y += tilePtr->height) {
- srcY = 0;
- destY = y;
- destHeight = tilePtr->height;
- if (y < top) {
- srcY = (top - y);
- destHeight = tilePtr->height - srcY;
- destY = top;
- }
- if ((destY + destHeight) > bottom) {
- destHeight = (bottom - destY);
- }
- for (x = startX; x < right; x += tilePtr->width) {
- srcX = 0;
- destX = x;
- destWidth = tilePtr->width;
- if (x < left) {
- srcX = (left - x);
- destWidth = tilePtr->width - srcX;
- destX = left;
- }
- if ((destX + destWidth) > right) {
- destWidth = (right - destX);
- }
-#ifdef notdef
- PurifyPrintf("drawing pattern (%d,%d,%d,%d) at %d,%d\n",
- srcX , srcY, destWidth, destHeight, destX, destY);
-#endif
- if (tilePtr->mask != None) { /* With transparency. */
-#ifdef notdef
- HDC maskDC;
- TkWinDCState maskState;
-
- maskDC = TkWinGetDrawableDC(tilePtr->display,
- tilePtr->mask, &maskState);
- SetBkColor(destDC, RGB(255, 255, 255));
- SetTextColor(destDC, RGB(0, 0, 0));
-#endif
- BitBlt(destDC, destX, destY, destWidth, destHeight, maskDC,
- 0, 0, SRCAND);
- BitBlt(destDC, destX, destY, destWidth, destHeight, srcDC,
- srcX, srcY, SRCPAINT);
-#ifdef notdef
- TkWinReleaseDrawableDC(tilePtr->mask, maskDC, &maskState);
-#endif
- } else { /* Opaque tile. */
- BitBlt(destDC, destX, destY, destWidth, destHeight,
- srcDC, srcX, srcY, SRCCOPY);
- }
- }
- }
-}
-
-void
-Blt_TilePolygon(
- Tk_Window tkwin,
- Drawable drawable,
- TileClient *clientPtr,
- XPoint *points,
- int nPoints)
-{
- HBITMAP oldBitmap;
- HDC hDC, memDC;
- HRGN hRgn;
- POINT *wp, *winPts;
- int left, right, top, bottom;
- Tile *tilePtr;
- TkWinDCState state;
- TkWinDrawable *twdPtr;
- XPoint *pend, *p;
- int fillMode;
- int width, height;
-
- if (drawable == None) {
- return;
- }
- tilePtr = clientPtr->tilePtr;
-
- /* Determine the bounding box of the polygon. */
- left = right = points[0].x;
- top = bottom = points[0].y;
- for (p = points, pend = p + nPoints; p < pend; p++) {
- if (p->x < left) {
- left = p->x;
- }
- if (p->x > right) {
- right = p->x;
- }
- if (p->y < top) {
- top = p->y;
- }
- if (p->y > bottom) {
- bottom = p->y;
- }
- }
- width = right - left + 1;
- height = bottom - top + 1;
-
- /* Allocate and fill an array of POINTS to create the polygon path. */
- wp = winPts = Blt_AssertMalloc(sizeof(POINT) * nPoints);
- for (p = points; p < pend; p++) {
- wp->x = p->x - left;
- wp->y = p->y - top;
- wp++;
- }
-
- hDC = TkWinGetDrawableDC(Tk_Display(tkwin), drawable, &state);
- SetROP2(hDC, tkpWinRopModes[tilePtr->gc->function]);
- fillMode = (tilePtr->gc->fill_rule == EvenOddRule) ? ALTERNATE : WINDING;
-
- /* Use the polygon as a clip path. */
- LPtoDP(hDC, winPts, nPoints);
- hRgn = CreatePolygonRgn(winPts, nPoints, fillMode);
- SelectClipRgn(hDC, hRgn);
- OffsetClipRgn(hDC, left, top);
-
- Blt_Free(winPts);
-
- twdPtr = (TkWinDrawable *)tilePtr->pixmap;
- memDC = CreateCompatibleDC(hDC);
- oldBitmap = SelectBitmap(memDC, twdPtr->bitmap.handle);
-
- /* Tile the bounding box. */
- if (tilePtr->mask != None) {
- TkWinDCState maskState;
- HDC maskDC;
-
- maskDC = TkWinGetDrawableDC(tilePtr->display, tilePtr->mask,
- &maskState);
- SetBkColor(hDC, RGB(255, 255, 255));
- SetTextColor(hDC, RGB(0, 0, 0));
- TileArea(memDC, hDC, maskDC, clientPtr, left, top, width, height);
- TkWinReleaseDrawableDC(tilePtr->mask, maskDC, &maskState);
- } else {
- TileArea(memDC, hDC, NULL, clientPtr, left, top, width, height);
- }
- SelectBitmap(memDC, oldBitmap);
- DeleteDC(memDC);
- SelectClipRgn(hDC, NULL);
- DeleteRgn(hRgn);
- TkWinReleaseDrawableDC(drawable, hDC, &state);
-}
-
-void
-Blt_TileRectangle(
- Tk_Window tkwin,
- Drawable drawable,
- TileClient *clientPtr,
- int x, int y,
- unsigned int width,
- unsigned int height)
-{
- HBITMAP oldBitmap;
- HDC hDC, memDC;
- Tile *tilePtr;
- TkWinDCState state;
- TkWinDrawable *twdPtr;
-
- if (drawable == None) {
- return;
- }
- tilePtr = clientPtr->tilePtr;
- hDC = TkWinGetDrawableDC(Tk_Display(tkwin), drawable, &state);
- SetROP2(hDC, tkpWinRopModes[tilePtr->gc->function]);
-
- twdPtr = (TkWinDrawable *)tilePtr->pixmap;
- memDC = CreateCompatibleDC(hDC);
- oldBitmap = SelectBitmap(memDC, twdPtr->bitmap.handle);
-
- /* Tile the bounding box. */
- if (tilePtr->mask != None) {
- TkWinDCState maskState;
- HDC maskDC;
-
- maskDC = TkWinGetDrawableDC(tilePtr->display, tilePtr->mask,
- &maskState);
- SetBkColor(hDC, RGB(255, 255, 255));
- SetTextColor(hDC, RGB(0, 0, 0));
- TileArea(memDC, hDC, maskDC, clientPtr, x, y, width, height);
- TkWinReleaseDrawableDC(tilePtr->mask, maskDC, &maskState);
- } else {
- TileArea(memDC, hDC, NULL, clientPtr, x, y, width, height);
- }
- SelectBitmap(memDC, oldBitmap);
- DeleteDC(memDC);
- TkWinReleaseDrawableDC(drawable, hDC, &state);
-}
-
-void
-Blt_TileRectangles(
- Tk_Window tkwin,
- Drawable drawable,
- TileClient *clientPtr,
- XRectangle *rectangles,
- int nRectangles)
-{
- HBITMAP oldBitmap;
- HDC hDC, memDC;
- Tile *tilePtr;
- TkWinDCState state;
- TkWinDrawable *twdPtr;
-
- if (drawable == None) {
- return;
- }
-
- tilePtr = clientPtr->tilePtr;
- hDC = TkWinGetDrawableDC(Tk_Display(tkwin), drawable, &state);
- SetROP2(hDC, tkpWinRopModes[tilePtr->gc->function]);
-
- twdPtr = (TkWinDrawable *)tilePtr->pixmap;
- memDC = CreateCompatibleDC(hDC);
- oldBitmap = SelectBitmap(memDC, twdPtr->bitmap.handle);
-
- /* Tile the bounding box. */
- if (tilePtr->mask != None) {
- XRectangle *rp, *rend;
- TkWinDCState maskState;
- HDC maskDC;
-
- maskDC = TkWinGetDrawableDC(tilePtr->display, tilePtr->mask,
- &maskState);
- SetBkColor(hDC, RGB(255, 255, 255));
- SetTextColor(hDC, RGB(0, 0, 0));
- for (rp = rectangles, rend = rp + nRectangles; rp < rend; rp++) {
- TileArea(memDC, hDC, maskDC, clientPtr, (int)rp->x, (int)rp->y,
- (int)rp->width, (int)rp->height);
- }
- TkWinReleaseDrawableDC(tilePtr->mask, maskDC, &maskState);
- } else {
- XRectangle *rp, *rend;
-
- for (rp = rectangles, rend = rp + nRectangles; rp < rend; rp++) {
- TileArea(memDC, hDC, NULL, clientPtr, (int)rp->x, (int)rp->y,
- (int)rp->width, (int)rp->height);
- }
- }
- SelectBitmap(memDC, oldBitmap);
- DeleteDC(memDC);
- TkWinReleaseDrawableDC(drawable, hDC, &state);
-}
-
-#else
-
-/*
- *---------------------------------------------------------------------------
- *
- * RectangleMask --
- *
- * Creates a rectangular mask also stippled by the mask of the tile.
- * This is used to draw the tiled polygon images with transparent areas.
- *
- * Results:
- * A bitmap mask is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Pixmap
-RectangleMask(
- Display *display,
- Drawable drawable,
- int x, int y,
- unsigned int width, unsigned int height,
- Pixmap mask,
- int xOrigin, int yOrigin)
-{
- GC gc;
- Pixmap bitmap;
- XGCValues gcValues;
- unsigned long gcMask;
-
- bitmap = Tk_GetPixmap(display, drawable, width, height, 1);
- gcMask = (GCForeground | GCBackground | GCFillStyle |
- GCTileStipXOrigin | GCTileStipYOrigin | GCStipple);
- gcValues.foreground = 0x1;
- gcValues.background = 0x0;
- gcValues.fill_style = FillOpaqueStippled;
- gcValues.ts_x_origin = xOrigin - x;
- gcValues.ts_y_origin = yOrigin - y;
- gcValues.stipple = mask;
- gc = XCreateGC(display, bitmap, gcMask, &gcValues);
- XFillRectangle(display, bitmap, gc, 0, 0, width, height);
- Blt_FreePrivateGC(display, gc);
- return bitmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TileRectangle --
- *
- * Draws a rectangle filled by a tiled image. This differs from the
- * normal XFillRectangle call in that we also try to handle a
- * transparency mask.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Draws the rectangle.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TileRectangle(
- Tk_Window tkwin,
- Drawable drawable,
- TileClient *clientPtr,
- int x, int y,
- unsigned int width, unsigned int height)
-{
- Tile *tilePtr;
- Display *display;
-
- display = Tk_Display(tkwin);
- tilePtr = clientPtr->tilePtr;
- if (clientPtr->tilePtr->mask != None) {
- Pixmap mask;
-
- mask = RectangleMask(display, drawable, x, y, width, height,
- tilePtr->mask, clientPtr->xOrigin, clientPtr->yOrigin);
- XSetClipMask(display, tilePtr->gc, mask);
- XSetClipOrigin(display, tilePtr->gc, x, y);
- XFillRectangle(display, drawable, tilePtr->gc, x, y, width, height);
- XSetClipMask(display, tilePtr->gc, None);
- XSetClipOrigin(display, tilePtr->gc, 0, 0);
- Tk_FreePixmap(display, mask);
- } else {
- XFillRectangle(display, drawable, tilePtr->gc, x, y, width, height);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TileRectangles --
- *
- * Draws rectangles filled by a tiled image. This differs from the
- * normal XFillRectangles call in that we also try to handle a
- * transparency mask.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Draws the given rectangles.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TileRectangles(
- Tk_Window tkwin,
- Drawable drawable,
- TileClient *clientPtr,
- XRectangle rectangles[],
- int nRectangles)
-{
- Tile *tilePtr;
-
- tilePtr = clientPtr->tilePtr;
- if (tilePtr->mask != None) {
- XRectangle *rp, *rend;
-
- for (rp = rectangles, rend = rp + nRectangles; rp < rend; rp++) {
- Blt_TileRectangle(tkwin, drawable, clientPtr, rp->x, rp->y,
- rp->width, rp->height);
- }
- } else {
- XFillRectangles(Tk_Display(tkwin), drawable, tilePtr->gc, rectangles,
- nRectangles);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PolygonMask --
- *
- * Creates a polygon shaped mask also stippled by the mask of the tile.
- * This is used to draw the tiled polygon images with transparent areas.
- *
- * Results:
- * A bitmap mask is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Pixmap
-PolygonMask(
- Display *display,
- XPoint *points,
- int nPoints,
- int x, int y, int width, int height,
- Pixmap mask,
- int xOrigin, int yOrigin)
-{
- Pixmap bitmap;
- XPoint *maskPts;
-
- maskPts = Blt_Malloc(sizeof(XPoint) * nPoints);
- if (maskPts == NULL) {
- return None;
- }
- {
- XPoint *dp, *pp, *pend;
-
- dp = maskPts;
- for (pp = points, pend = pp + nPoints; pp < pend; pp++) {
- dp->x = pp->x - x;
- dp->y = pp->y - y;
- dp++;
- }
- }
-
- bitmap = Tk_GetPixmap(display, DefaultRootWindow(display), width, height,1);
- {
- GC gc;
-
- gc = XCreateGC(display, bitmap, 0, NULL);
- XFillRectangle(display, bitmap, gc, 0, 0, width, height);
- XSetForeground(display, gc, 0x01);
- XSetFillStyle(display, gc, FillStippled);
- XSetTSOrigin(display, gc, xOrigin - x, yOrigin - y);
- XSetStipple(display, gc, mask);
- XFillPolygon(display, bitmap, gc, maskPts, nPoints, Complex,
- CoordModeOrigin);
- XFreeGC(display, gc);
- }
- Blt_Free(maskPts);
- return bitmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TilePolygon --
- *
- * Draws a polygon filled by a tiled image. This differs from the normal
- * XFillPolygon call in that we also try to handle a transparency mask.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Draws the polygon.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TilePolygon(
- Tk_Window tkwin,
- Drawable drawable,
- TileClient *clientPtr,
- XPoint *points,
- int nPoints)
-{
- Tile *tilePtr;
- Display *display;
-
- display = Tk_Display(tkwin);
- tilePtr = clientPtr->tilePtr;
- if (tilePtr->mask != None) {
- XPoint *pp, *pend;
- int left, right, top, bottom;
- Pixmap mask;
-
- /* Determine the bounding box of the polygon. */
- left = right = points[0].x;
- top = bottom = points[0].y;
- for (pp = points, pend = pp + nPoints; pp < pend; pp++) {
- if (left > pp->x) {
- left = pp->x;
- } else if (right < pp->x) {
- right = pp->x;
- }
- if (top > pp->y) {
- top = pp->y;
- } else if (bottom < pp->y) {
- bottom = pp->y;
- }
- }
- mask = PolygonMask(display, points, nPoints, left, top,
- right - left + 1, bottom - top + 1, tilePtr->mask,
- clientPtr->xOrigin, clientPtr->yOrigin);
- XSetClipMask(display, tilePtr->gc, mask);
- XSetClipOrigin(display, tilePtr->gc, left, top);
- XFillPolygon(display, drawable, tilePtr->gc, points, nPoints,
- Complex, CoordModeOrigin);
- XSetClipMask(display, tilePtr->gc, None);
- XSetClipOrigin(display, tilePtr->gc, 0, 0);
- Tk_FreePixmap(display, mask);
- } else {
- XFillPolygon(display, drawable, tilePtr->gc, points, nPoints, Complex,
- CoordModeOrigin);
- }
-}
-#endif /* WIN32 */
-
diff --git a/blt3.0.1/src/bltTile.h b/blt3.0.1/src/bltTile.h
deleted file mode 100644
index 48b484c..0000000
--- a/blt3.0.1/src/bltTile.h
+++ /dev/null
@@ -1,61 +0,0 @@
-
-/*
- * bltTile.h --
- *
- * Copyright 1995-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef BLT_TILE_H
-#define BLT_TILE_H
-
-#define TILE_THREAD_KEY "BLT Tile Data"
-#define TILE_MAGIC ((unsigned int) 0x46170277)
-
-typedef struct _Blt_TileClient *Blt_Tile; /* Opaque type for tiles */
-
-typedef void (Blt_TileChangedProc)(ClientData clientData, Blt_Tile tile);
-
-BLT_EXTERN int Blt_GetTile(Tcl_Interp *interp, Tk_Window tkwin, char *imageName,
- Blt_Tile *tilePtr);
-
-BLT_EXTERN void Blt_FreeTile(Blt_Tile tile);
-
-BLT_EXTERN const char *Blt_NameOfTile(Blt_Tile tile);
-
-BLT_EXTERN void Blt_SetTileChangedProc(Blt_Tile tile,
- Blt_TileChangedProc *changeProc, ClientData clientData);
-
-BLT_EXTERN void Blt_TileRectangle(Tk_Window tkwin, Drawable drawable,
- Blt_Tile tile, int x, int y, unsigned int width, unsigned int height);
-BLT_EXTERN void Blt_TileRectangles(Tk_Window tkwin, Drawable drawable,
- Blt_Tile tile, XRectangle *rectArr, int nRects);
-BLT_EXTERN void Blt_TilePolygon(Tk_Window tkwin, Drawable drawable,
- Blt_Tile tile, XPoint *pointArr, int nPoints);
-BLT_EXTERN Pixmap Blt_PixmapOfTile(Blt_Tile tile);
-
-BLT_EXTERN void Blt_SizeOfTile(Blt_Tile tile, int *widthPtr, int *heightPtr);
-
-BLT_EXTERN void Blt_SetTileOrigin(Tk_Window tkwin, Blt_Tile tile, int x, int y);
-
-BLT_EXTERN void Blt_SetTSOrigin(Tk_Window tkwin, Blt_Tile tile, int x, int y);
-
-#endif /* BLT_TILE_H */
diff --git a/blt3.0.1/src/bltTree.c b/blt3.0.1/src/bltTree.c
deleted file mode 100644
index 9564c16..0000000
--- a/blt3.0.1/src/bltTree.c
+++ /dev/null
@@ -1,4366 +0,0 @@
-
-/*
- * bltTree.c --
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-/* TODO:
- * Traces and notifiers should be in one list in tree object.
- * Notifier is always fired.
- * Incorporate first/next tag routines ?
- */
-
-#include "bltNsUtil.h"
-#include "bltArrayObj.h"
-#include "bltTree.h"
-
-static Tcl_InterpDeleteProc TreeInterpDeleteProc;
-static Blt_TreeApplyProc SizeApplyProc;
-static Tcl_IdleProc NotifyIdleProc;
-static Tcl_IdleProc TraceIdleProc;
-
-#define TREE_THREAD_KEY "BLT Tree Data"
-#define TREE_MAGIC ((unsigned int) 0x46170277)
-#define TREE_DESTROYED (1<<0)
-
-#define TREE_NODE_REBUILD_SIZE 3U
-
-typedef struct _Blt_TreeNode Node;
-typedef struct _Blt_Tree Tree;
-typedef struct _Blt_TreeObject TreeObject;
-typedef struct _Blt_TreeValue Value;
-
-/*
- * Blt_TreeValue --
- *
- * A tree node may have zero or more data fields or values that are
- * represented by these container structures. Each data field has both
- * the name of the field (Blt_TreeKey) and its data (Tcl_Obj). Values
- * are private or public. Private values are only be seen by the tree
- * client that created the field.
- *
- * Values are organized in two ways. They are stored in a linked list in
- * order that they were created. In addition, they may be placed into a
- * hash table when the number of values reaches a high-water mark.
- *
- */
-struct _Blt_TreeValue {
- Blt_TreeKey key; /* String identifying the data field */
- Tcl_Obj *objPtr; /* Data representation. */
- Blt_Tree owner; /* Non-NULL if privately owned. */
- Blt_TreeValue next; /* Next value in the chain. */
- Blt_TreeValue hnext; /* Next value in hash table. */
-};
-
-typedef struct {
- Tree *treePtr;
- unsigned int flags;
- Node *rootPtr;
- Blt_HashTable idTable;
- int nLines;
- Blt_HashTable dataTable;
-} RestoreInfo;
-
-#include <stdio.h>
-#include <string.h>
-/* The following header is required for LP64 compilation */
-#include <stdlib.h>
-
-#include "bltHash.h"
-
-static void TreeDestroyValues(Blt_TreeNode node);
-
-static Value *TreeFindValue(Blt_TreeNode node, Blt_TreeKey key);
-static Value *TreeCreateValue(Blt_TreeNode node, Blt_TreeKey key, int *newPtr);
-
-static int TreeDeleteValue(Blt_TreeNode node, Blt_TreeValue value);
-
-static Value *TreeFirstValue(Blt_TreeNode, Blt_TreeKeyIterator *iterPtr);
-
-static Value *TreeNextValue(Blt_TreeKeyIterator *iterPtr);
-
-/*
- * When there are this many entries per bucket, on average, rebuild the hash
- * table to make it larger.
- */
-#define REBUILD_MULTIPLIER 3
-#define START_LOGSIZE 5 /* Initial hash table size is 32. */
-#define HASH_HIGH_WATER 20 /* Start a hash table when a node has this
- * many values or child nodes. */
-#define HASH_LOW_WATER (HASH_HIGH_WATER << 1)
-
-#if (SIZEOF_VOID_P == 8)
-#define RANDOM_INDEX(i) HashOneWord(mask, downshift, i)
-static Blt_Hash HashOneWord(uint64_t mask, unsigned int downshift,
- const void *key);
-#define BITSPERWORD 64
-#else
-
-/*
- * The following macro takes a preliminary integer hash value and produces an
- * index into a hash tables bucket list. The idea is to make it so that
- * preliminary values that are arbitrarily similar will end up in different
- * buckets. The hash function was taken from a random-number generator.
- */
-#define RANDOM_INDEX(i) \
- (((((long) (i))*1103515245) >> downshift) & mask)
-#define BITSPERWORD 32
-#endif /* SIZEOF_VOID_P == 8 */
-
-#define DOWNSHIFT_START (BITSPERWORD - 2)
-
-/*
- * The hash table below is used to keep track of all the Blt_TreeKeys created
- * so far.
- */
-typedef struct _Blt_TreeInterpData {
- Tcl_Interp *interp;
- Blt_HashTable treeTable; /* Table of trees. */
- Blt_HashTable keyTable; /* Table of string keys, shared among all the
- * trees within an interpreter. */
- unsigned int nextId; /* Identifier used to generate automatic tree
- * names. */
-} TreeInterpData;
-
-typedef struct {
- Tcl_Interp *interp;
- ClientData clientData;
- Blt_TreeKey key;
- Blt_TreeNotifyEventProc *proc;
- Blt_TreeNotifyEvent event;
- unsigned int mask;
- int notifyPending;
-} NotifyEventHandler;
-
-typedef struct {
- /* This must match _Blt_TreeTrace in bltTree.h */
- ClientData clientData;
- const char *keyPattern; /* Pattern to be matched */
- Node *nodePtr; /* Node to be matched. */
- unsigned int mask;
- Blt_TreeTraceProc *proc;
-
- /* Private fields */
- const char *withTag;
- Tree *treePtr;
- Blt_ChainLink link;
- Blt_HashTable idleTable;
- Tcl_Interp *interp;
-} TraceHandler;
-
-typedef struct {
- TraceHandler *tracePtr; /* Trace trace matched. */
- Tcl_Interp *interp; /* Source interpreter. */
- Blt_TreeKey key; /* Key that matched. */
- int flags; /* Flags that matched. */
- long inode; /* Node that matched. */
- Blt_HashEntry *hashPtr;
-} TraceWhenIdle;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_GetInterpData --
- *
- * Creates or retrieves data associated with tree data objects for a
- * particular thread. We're using Tcl_GetAssocData rather than the Tcl
- * thread routines so BLT can work with pre-8.0 TCL versions that don't
- * have thread support.
- *
- * Results:
- * Returns a pointer to the tree interpreter data.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_TreeInterpData *
-Blt_Tree_GetInterpData(Tcl_Interp *interp)
-{
- Tcl_InterpDeleteProc *proc;
- TreeInterpData *dataPtr;
-
- dataPtr = (TreeInterpData *)
- Tcl_GetAssocData(interp, TREE_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(TreeInterpData));
- dataPtr->interp = interp;
- Tcl_SetAssocData(interp, TREE_THREAD_KEY, TreeInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->treeTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&dataPtr->keyTable, BLT_STRING_KEYS);
- }
- return dataPtr;
-}
-
-const char *
-Blt_Tree_NodeIdAscii(Node *nodePtr)
-{
- static char stringRep[200];
-
- sprintf_s(stringRep, 200, "%ld", nodePtr->inode);
- return stringRep;
-}
-
-static Tree *
-FirstClient(TreeObject *corePtr)
-{
- Blt_ChainLink link;
-
- link = Blt_Chain_FirstLink(corePtr->clients);
- if (link == NULL) {
- return NULL;
- }
- return Blt_Chain_GetValue(link);
-}
-
-static Tree *
-NextClient(Tree *treePtr)
-{
- Blt_ChainLink link;
-
- if (treePtr == NULL) {
- return NULL;
- }
- link = Blt_Chain_NextLink(treePtr->link);
- if (link == NULL) {
- return NULL;
- }
- return Blt_Chain_GetValue(link);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewNode --
- *
- * Creates a new node in the tree without installing it. The number of
- * nodes in the tree is incremented and a unique serial number is
- * generated for the node.
- *
- * Also, all nodes have a label. If no label was provided (name is NULL)
- * then automatically generate one in the form "nodeN" where N is the
- * serial number of the node.
- *
- * Results:
- * Returns a pointer to the new node.
- *
- * --------------------------------------------------------------
- */
-static Node *
-NewNode(TreeObject *corePtr, const char *name, long inode)
-{
- Node *np;
-
- /* Create the node structure */
- np = Blt_PoolAllocItem(corePtr->nodePool, sizeof(Node));
- np->inode = inode;
- np->corePtr = corePtr;
- np->parent = NULL;
- np->depth = 0;
- np->flags = 0;
- np->next = np->prev = NULL;
- np->first = np->last = NULL;
- np->nChildren = 0;
- np->values = NULL;
- np->valueTable = NULL;
- np->valueTableSize2 = 0;
- np->nValues = 0;
- np->nodeTable = NULL;
- np->nodeTableSize2 = 0;
- np->hnext = NULL;
-
- np->label = NULL;
- if (name != NULL) {
- np->label = Blt_Tree_GetKeyFromNode(np, name);
- }
- corePtr->nNodes++;
- return np;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReleaseTagTable --
- *
- *---------------------------------------------------------------------------
- */
-static void
-ReleaseTagTable(Blt_TreeTagTable *tablePtr)
-{
- tablePtr->refCount--;
- if (tablePtr->refCount <= 0) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for(hPtr = Blt_FirstHashEntry(&tablePtr->tagTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_TreeTagEntry *tePtr;
-
- tePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(&tePtr->nodeTable);
- Blt_Free(tePtr);
- }
- Blt_DeleteHashTable(&tablePtr->tagTable);
- Blt_Free(tablePtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResetDepths --
- *
- * Called after moving a node, resets the depths of each node for the
- * entire branch (node and it's decendants).
- *
- * Results:
- * None.
- *
- * ----------------------------------------------------------------------
- */
-static void
-ResetDepths(Node *branchPtr, long depth)
-{
- Node *np;
-
- branchPtr->depth = depth;
-
- /* Also reset the depth for each descendant node. */
- for (np = branchPtr->first; np != NULL; np = np->next) {
- ResetDepths(np, depth + 1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RebuildNodeTable --
- *
- * This procedure is invoked when the ratio of entries to hash buckets
- * becomes too large. It creates a new table with a larger bucket array
- * and moves all of the entries into the new table.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory gets reallocated and entries get re-hashed to new
- * buckets.
- *
- *---------------------------------------------------------------------------
- */
-static void
-RebuildNodeTable(Node *parentPtr) /* Table to enlarge. */
-{
- Node **bp, **bend;
- unsigned int downshift;
- unsigned long mask;
- Node **buckets;
- size_t nBuckets;
-
- nBuckets = (1 << parentPtr->nodeTableSize2);
- bend = parentPtr->nodeTable + nBuckets;
-
- /*
- * Allocate and initialize the new bucket array, and set up hashing
- * constants for new array size.
- */
- parentPtr->nodeTableSize2 += 2;
- nBuckets = (1 << parentPtr->nodeTableSize2);
- buckets = Blt_AssertCalloc(nBuckets, sizeof(Node *));
- /*
- * Move all of the existing entries into the new bucket array, based on
- * their new hash values.
- */
- mask = nBuckets - 1;
- downshift = DOWNSHIFT_START - parentPtr->nodeTableSize2;
- for (bp = parentPtr->nodeTable; bp < bend; bp++) {
- Node *np, *nextPtr;
-
- for (np = *bp; np != NULL; np = nextPtr) {
- Node **bucketPtr;
-
- nextPtr = np->hnext;
- bucketPtr = buckets + RANDOM_INDEX(np->label);
- np->hnext = *bucketPtr;
- *bucketPtr = np;
- }
- }
- Blt_Free(parentPtr->nodeTable);
- parentPtr->nodeTable = buckets;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MakeNodeTable --
- *
- * Generates a hash table from the nodes list of children.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Hash table for child nodes is created.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MakeNodeTable(Node *parentPtr)
-{
- Node **buckets;
- Node *np, *nextPtr;
- int downshift;
- unsigned int mask;
- unsigned int nBuckets;
-
- assert(parentPtr->nodeTable == NULL);
- parentPtr->nodeTableSize2 = START_LOGSIZE;
- nBuckets = 1 << parentPtr->nodeTableSize2;
- buckets = Blt_AssertCalloc(nBuckets, sizeof(Node *));
- mask = nBuckets - 1;
- downshift = DOWNSHIFT_START - parentPtr->nodeTableSize2;
- for (np = parentPtr->first; np != NULL; np = nextPtr) {
- Node **bucketPtr;
-
- nextPtr = np->next;
- bucketPtr = buckets + RANDOM_INDEX(np->label);
- np->hnext = *bucketPtr;
- *bucketPtr = np;
- }
- parentPtr->nodeTable = buckets;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LinkBefore --
- *
- * Inserts a link preceding a given link.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LinkBefore(
- Node *parentPtr, /* Parent to hold the new entry. */
- Node *nodePtr, /* New node to be inserted. */
- Node *beforePtr) /* Node to link before. */
-{
- if (parentPtr->first == NULL) {
- parentPtr->last = parentPtr->first = nodePtr;
- } else if (beforePtr == NULL) { /* Append onto the end of the chain */
- nodePtr->next = NULL;
- nodePtr->prev = parentPtr->last;
- parentPtr->last->next = nodePtr;
- parentPtr->last = nodePtr;
- } else {
- nodePtr->prev = beforePtr->prev;
- nodePtr->next = beforePtr;
- if (beforePtr == parentPtr->first) {
- parentPtr->first = nodePtr;
- } else {
- beforePtr->prev->next = nodePtr;
- }
- beforePtr->prev = nodePtr;
- }
- parentPtr->nChildren++;
- nodePtr->parent = parentPtr;
-
- /*
- * Check if there as so many children that an addition hash table should
- * be created.
- */
- if (parentPtr->nodeTable == NULL) {
- if (parentPtr->nChildren > HASH_HIGH_WATER) {
- MakeNodeTable(parentPtr);
- }
- } else {
- Node **bucketPtr;
- size_t nBuckets;
- unsigned int downshift;
- unsigned long mask;
-
- nBuckets = (1 << parentPtr->nodeTableSize2);
- mask = nBuckets - 1;
- downshift = DOWNSHIFT_START - parentPtr->nodeTableSize2;
- bucketPtr = parentPtr->nodeTable + RANDOM_INDEX(nodePtr->label);
- nodePtr->hnext = *bucketPtr;
- *bucketPtr = nodePtr;
- /*
- * If the table has exceeded a decent size, rebuild it with many more
- * buckets.
- */
- if (parentPtr->nChildren >= (nBuckets * TREE_NODE_REBUILD_SIZE)) {
- RebuildNodeTable(parentPtr);
- }
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnlinkNode --
- *
- * Unlinks a link from the chain. The link is not deallocated, but only
- * removed from the chain.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-UnlinkNode(Node *nodePtr)
-{
- Node *parentPtr;
- int unlinked; /* Indicates if the link is actually removed
- * from the chain. */
- parentPtr = nodePtr->parent;
- unlinked = FALSE;
- if (parentPtr->first == nodePtr) {
- parentPtr->first = nodePtr->next;
- unlinked = TRUE;
- }
- if (parentPtr->last == nodePtr) {
- parentPtr->last = nodePtr->prev;
- unlinked = TRUE;
- }
- if (nodePtr->next != NULL) {
- nodePtr->next->prev = nodePtr->prev;
- unlinked = TRUE;
- }
- if (nodePtr->prev != NULL) {
- nodePtr->prev->next = nodePtr->next;
- unlinked = TRUE;
- }
- if (unlinked) {
- parentPtr->nChildren--;
- }
- nodePtr->prev = nodePtr->next = NULL;
- if (parentPtr->nodeTable != NULL) {
- Node **bucketPtr;
- unsigned int downshift;
- unsigned long mask;
-
- mask = (1 << parentPtr->nodeTableSize2) - 1;
- downshift = DOWNSHIFT_START - parentPtr->nodeTableSize2;
- bucketPtr = parentPtr->nodeTable + RANDOM_INDEX(nodePtr->label);
- if (*bucketPtr == nodePtr) {
- *bucketPtr = nodePtr->hnext;
- } else {
- Node *np;
-
- for (np = *bucketPtr; /*empty*/; np = np->hnext) {
- if (np == NULL) {
- return; /* Can't find node in hash bucket. */
- }
- if (np->hnext == nodePtr) {
- np->hnext = nodePtr->hnext;
- break;
- }
- }
- }
- }
- nodePtr->hnext = NULL;
- if (parentPtr->nChildren < HASH_LOW_WATER) {
- Blt_Free(parentPtr->nodeTable);
- parentPtr->nodeTable = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeNode --
- *
- * Unlinks a given node from the tree, removes its data, and frees memory
- * allocated to the node.
- *
- * Results:
- * None.
- *
- * --------------------------------------------------------------
- */
-static void
-FreeNode(TreeObject *corePtr, Node *nodePtr)
-{
- Blt_HashEntry *hPtr;
-
- /* Destroy any data fields associated with this node. */
- if (nodePtr->values != NULL) {
- TreeDestroyValues(nodePtr);
- }
- if (nodePtr->nodeTable != NULL) {
- Blt_Free(nodePtr->nodeTable);
- }
- UnlinkNode(nodePtr);
- corePtr->nNodes--;
- hPtr = Blt_FindHashEntry(&corePtr->nodeTable, (char *)nodePtr->inode);
- assert(hPtr);
- Blt_DeleteHashEntry(&corePtr->nodeTable, hPtr);
- Blt_PoolFreeItem(corePtr->nodePool, nodePtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TeardownTree --
- *
- * Destroys an entire branch. This is a special purpose routine used to
- * speed up the final clean up of the tree.
- *
- * Results:
- * None.
- *
- * ----------------------------------------------------------------------
- */
-static void
-TeardownTree(TreeObject *corePtr, Node *branchPtr)
-{
- Node *np, *nextPtr;
-
- if (branchPtr->nodeTable != NULL) {
- Blt_Free(branchPtr->nodeTable);
- branchPtr->nodeTable = NULL;
- }
- if (branchPtr->values != NULL) {
- TreeDestroyValues(branchPtr);
- }
- for (np = branchPtr->first; np != NULL; np = nextPtr) {
- nextPtr = np->next;
- TeardownTree(corePtr, np);
- }
- Blt_PoolFreeItem(corePtr->nodePool, branchPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyTreeObject --
- *
- * Destroys a tree object, freeing its nodes and memory.
- *
- * Results:
- * None.
- *
- * ----------------------------------------------------------------------
- */
-static void
-DestroyTreeObject(TreeObject *corePtr)
-{
- corePtr->flags |= TREE_DESTROYED;
- corePtr->nNodes = 0;
-
- assert(Blt_Chain_GetLength(corePtr->clients) == 0);
- Blt_Chain_Destroy(corePtr->clients);
-
- TeardownTree(corePtr, corePtr->root);
- Blt_PoolDestroy(corePtr->nodePool);
- Blt_PoolDestroy(corePtr->valuePool);
- Blt_DeleteHashTable(&corePtr->nodeTable);
- Blt_Free(corePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReleaseTreeObject --
- *
- * Removes the client from the core tree object's list of clients. If
- * there are no more clients, then the tree object itself is destroyed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The client is detached from the tree object. The tree object is
- * possibly destroyed, freeing memory.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ReleaseTreeObject(Tree *treePtr)
-{
- if ((treePtr->link != NULL) && (treePtr->corePtr != NULL)) {
- /* Remove the client from the core's list */
- Blt_Chain_DeleteLink(treePtr->corePtr->clients, treePtr->link);
- if (Blt_Chain_GetLength(treePtr->corePtr->clients) == 0) {
- DestroyTreeObject(treePtr->corePtr);
- }
- treePtr->corePtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewTreeObject --
- *
- * Creates and initializes a new tree object. Trees always contain a root
- * node, so one is allocated here.
- *
- * Results:
- * Returns a pointer to the new tree object is successful, NULL
- * otherwise. If a tree can't be generated, interp->result will contain
- * an error message.
- *
- *---------------------------------------------------------------------------
- */
-static TreeObject *
-NewTreeObject(TreeInterpData *dataPtr)
-{
- TreeObject *corePtr;
- int isNew;
- Blt_HashEntry *hPtr;
-
- corePtr = Blt_Calloc(1, sizeof(TreeObject));
- if (corePtr == NULL) {
- return NULL;
- }
- corePtr->dataPtr = dataPtr;
- corePtr->valuePool = Blt_PoolCreate(BLT_FIXED_SIZE_ITEMS);
- corePtr->nodePool = Blt_PoolCreate(BLT_FIXED_SIZE_ITEMS);
- corePtr->clients = Blt_Chain_Create();
- corePtr->depth = 1;
- corePtr->notifyFlags = 0;
- Blt_InitHashTableWithPool(&corePtr->nodeTable, BLT_ONE_WORD_KEYS);
- hPtr = Blt_CreateHashEntry(&corePtr->nodeTable, (char *)0, &isNew);
- corePtr->root = NewNode(corePtr, "", 0);
- Blt_SetHashValue(hPtr, corePtr->root);
- return corePtr;
-}
-
-static Tree *
-FindClientInNamespace(TreeInterpData *dataPtr, Blt_ObjectName *objNamePtr)
-{
- Tcl_DString ds;
- const char *qualName;
- Blt_HashEntry *hPtr;
-
- qualName = Blt_MakeQualifiedName(objNamePtr, &ds);
- hPtr = Blt_FindHashEntry(&dataPtr->treeTable, qualName);
- Tcl_DStringFree(&ds);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTree --
- *
- * Searches for the tree object associated by the name given.
- *
- * Results:
- * Returns a pointer to the tree if found, otherwise NULL.
- *
- *---------------------------------------------------------------------------
- */
-static Tree *
-GetTree(TreeInterpData *dataPtr, const char *name, int flags)
-{
- Blt_ObjectName objName;
- Tree *treePtr;
- Tcl_Interp *interp;
-
- treePtr = NULL;
- interp = dataPtr->interp;
- if (!Blt_ParseObjectName(interp, name, &objName, BLT_NO_DEFAULT_NS)) {
- return NULL;
- }
- if (objName.nsPtr != NULL) {
- treePtr = FindClientInNamespace(dataPtr, &objName);
- } else {
- if (flags & NS_SEARCH_CURRENT) {
- /* Look first in the current namespace. */
- objName.nsPtr = Tcl_GetCurrentNamespace(interp);
- treePtr = FindClientInNamespace(dataPtr, &objName);
- }
- if ((treePtr == NULL) && (flags & NS_SEARCH_GLOBAL)) {
- objName.nsPtr = Tcl_GetGlobalNamespace(interp);
- treePtr = FindClientInNamespace(dataPtr, &objName);
- }
- }
- return treePtr;
-}
-
-static void
-ResetTree(Tree *treePtr)
-{
- Blt_ChainLink link;
-
- /* Remove any traces that may be set. */
- for (link = Blt_Chain_FirstLink(treePtr->traces); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TraceHandler *tracePtr;
-
- tracePtr = Blt_Chain_GetValue(link);
- if (tracePtr->keyPattern != NULL) {
- Blt_Free(tracePtr->keyPattern);
- }
- if (tracePtr->idleTable.numEntries > 0) {
- Tcl_CancelIdleCall(TraceIdleProc, tracePtr);
- }
- Blt_Free(tracePtr);
- }
- Blt_Chain_Reset(treePtr->traces);
-
- /* And any event handlers. */
- for(link = Blt_Chain_FirstLink(treePtr->events);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- NotifyEventHandler *notifyPtr;
-
- notifyPtr = Blt_Chain_GetValue(link);
- if (notifyPtr->notifyPending) {
- Tcl_CancelIdleCall(NotifyIdleProc, notifyPtr);
- }
- Blt_Free(notifyPtr);
- }
- Blt_Chain_Reset(treePtr->events);
-}
-
-static void
-DestroyTree(Tree *treePtr)
-{
- TreeInterpData *dataPtr;
-
- dataPtr = treePtr->corePtr->dataPtr;
- if (treePtr->tagTablePtr != NULL) {
- ReleaseTagTable(treePtr->tagTablePtr);
- }
- ResetTree(treePtr);
- if (treePtr->hPtr != NULL) {
- Blt_DeleteHashEntry(&dataPtr->treeTable, treePtr->hPtr);
- }
- Blt_Chain_Destroy(treePtr->traces);
- Blt_Chain_Destroy(treePtr->events);
- treePtr->magic = 0;
- ReleaseTreeObject(treePtr);
- Blt_Free(treePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeInterpDeleteProc --
- *
- * This is called when the interpreter hosting the tree object is deleted
- * from the interpreter.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Destroys all remaining trees and removes the hash table used to
- * register tree names.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-TreeInterpDeleteProc(ClientData clientData, Tcl_Interp *interp)
-{
- TreeInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->treeTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Tree *treePtr;
-
- treePtr = Blt_GetHashValue(hPtr);
- treePtr->hPtr = NULL;
- DestroyTree(treePtr);
- }
- Blt_DeleteHashTable(&dataPtr->treeTable);
- Blt_DeleteHashTable(&dataPtr->keyTable);
- Tcl_DeleteAssocData(interp, TREE_THREAD_KEY);
- Blt_Free(dataPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyIdleProc --
- *
- * Used to invoke event handler routines at some idle point. This
- * routine is called from the TCL event loop. Errors generated by the
- * event handler routines are backgrounded.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-NotifyIdleProc(ClientData clientData)
-{
- NotifyEventHandler *notifyPtr = clientData;
- int result;
-
- notifyPtr->notifyPending = FALSE;
- notifyPtr->mask |= TREE_NOTIFY_ACTIVE;
- result = (*notifyPtr->proc)(notifyPtr->clientData, ¬ifyPtr->event);
- notifyPtr->mask &= ~TREE_NOTIFY_ACTIVE;
- if (result != TCL_OK) {
- Tcl_BackgroundError(notifyPtr->interp);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CheckEventHandlers --
- *
- * Traverses the list of client event callbacks and checks if one matches
- * the given event. A client may trigger an action that causes the tree
- * to notify it. The can be prevented by setting the
- * TREE_NOTIFY_FOREIGN_ONLY bit in the event handler.
- *
- * If a matching handler is found, a callback may be called either
- * immediately or at the next idle time depending upon the
- * TREE_NOTIFY_WHENIDLE bit.
- *
- * Since a handler routine may trigger yet another call to itself,
- * callbacks are ignored while the event handler is executing.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-CheckEventHandlers(Tree *treePtr, int isSource, Blt_TreeNotifyEvent *eventPtr)
-{
- Blt_ChainLink link, next;
-
- eventPtr->tree = treePtr;
- for (link = Blt_Chain_FirstLink(treePtr->events); link != NULL;
- link = next) {
- NotifyEventHandler *notifyPtr;
-
- next = Blt_Chain_NextLink(link);
- notifyPtr = Blt_Chain_GetValue(link);
- if ((notifyPtr->mask & TREE_NOTIFY_ACTIVE) ||
- (notifyPtr->mask & eventPtr->type) == 0) {
- continue; /* Ignore callbacks that are generated
- * inside of a notify handler
- * routine. */
- }
- if ((isSource) && (notifyPtr->mask & TREE_NOTIFY_FOREIGN_ONLY)) {
- continue; /* Don't notify yourself. */
- }
- if (notifyPtr->mask & TREE_NOTIFY_WHENIDLE) {
- if (!notifyPtr->notifyPending) {
- notifyPtr->notifyPending = TRUE;
- notifyPtr->event = *eventPtr;
- Tcl_DoWhenIdle(NotifyIdleProc, notifyPtr);
- }
- } else {
- int result;
-
- notifyPtr->mask |= TREE_NOTIFY_ACTIVE;
- result = (*notifyPtr->proc) (notifyPtr->clientData, eventPtr);
- notifyPtr->mask &= ~TREE_NOTIFY_ACTIVE;
- if (result != TCL_OK) {
- Tcl_BackgroundError(notifyPtr->interp);
- }
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyClients --
- *
- * Traverses the list of clients for a particular tree and notifies each
- * client that an event occurred. Clients indicate interest in a
- * particular event through a bit flag.
- *
- *---------------------------------------------------------------------------
- */
-static void
-NotifyClients(Tree *sourcePtr, TreeObject *corePtr, Node *nodePtr,
- int eventFlag)
-{
- Blt_TreeNotifyEvent event;
- Tree *treePtr;
-
- event.type = eventFlag;
- event.inode = nodePtr->inode;
- event.node = nodePtr;
- /*
- * Issue callbacks to each client indicating that a new node has been
- * created.
- */
- for (treePtr = FirstClient(corePtr); treePtr != NULL;
- treePtr = NextClient(treePtr)) {
- int isSource;
-
- isSource = (treePtr == sourcePtr);
- CheckEventHandlers(treePtr, isSource, &event);
- }
-}
-
-static void
-FreeValue(Node *nodePtr, Value *valuePtr)
-{
- if (valuePtr->objPtr != NULL) {
- Tcl_DecrRefCount(valuePtr->objPtr);
- }
- Blt_PoolFreeItem(nodePtr->corePtr->valuePool, valuePtr);
-}
-
-
-
-#if (SIZEOF_VOID_P == 8)
-/*
- *---------------------------------------------------------------------------
- *
- * HashOneWord --
- *
- * Compute a one-word hash value of a 64-bit word, which then can be used
- * to generate a hash index.
- *
- * From Knuth, it's a multiplicative hash. Multiplies an unsigned 64-bit
- * value with the golden ratio (sqrt(5) - 1) / 2. The downshift value is
- * 64 - n, when n is the log2 of the size of the hash table.
- *
- * Results:
- * The return value is a one-word summary of the information in 64 bit
- * word.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Hash
-HashOneWord(uint64_t mask, unsigned int downshift, const void *key)
-{
- uint64_t a0, a1;
- uint64_t y0, y1;
- uint64_t y2, y3;
- uint64_t p1, p2;
- uint64_t result;
-
- /* Compute key * GOLDEN_RATIO in 128-bit arithmetic */
- a0 = (uint64_t)key & 0x00000000FFFFFFFF;
- a1 = (uint64_t)key >> 32;
-
- y0 = a0 * 0x000000007f4a7c13;
- y1 = a0 * 0x000000009e3779b9;
- y2 = a1 * 0x000000007f4a7c13;
- y3 = a1 * 0x000000009e3779b9;
- y1 += y0 >> 32; /* Can't carry */
- y1 += y2; /* Might carry */
- if (y1 < y2) {
- y3 += (1LL << 32); /* Propagate */
- }
-
- /* 128-bit product: p1 = loword, p2 = hiword */
- p1 = ((y1 & 0x00000000FFFFFFFF) << 32) + (y0 & 0x00000000FFFFFFFF);
- p2 = y3 + (y1 >> 32);
-
- /* Left shift the value downward by the size of the table */
- if (downshift > 0) {
- if (downshift < 64) {
- result = ((p2 << (64 - downshift)) | (p1 >> (downshift & 63)));
- } else {
- result = p2 >> (downshift & 63);
- }
- } else {
- result = p1;
- }
- /* Finally mask off the high bits */
- return (Blt_Hash)(result & mask);
-}
-
-#endif /* SIZEOF_VOID_P == 8 */
-
-/*
- *---------------------------------------------------------------------------
- *
- * RebuildTable --
- *
- * This procedure is invoked when the ratio of entries to hash buckets
- * becomes too large. It creates a new table with a larger bucket array
- * and moves all of the entries into the new table.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory gets reallocated and entries get re-hashed to new buckets.
- *
- *---------------------------------------------------------------------------
- */
-static void
-RebuildValueTable(Node *nodePtr) /* Table to enlarge. */
-{
- Value **bp, **bend, **buckets, **oldBuckets;
- size_t nBuckets;
- unsigned int downshift;
- unsigned long mask;
-
- oldBuckets = nodePtr->valueTable;
- nBuckets = (1 << nodePtr->valueTableSize2);
- bend = oldBuckets + nBuckets;
-
- /*
- * Allocate and initialize the new bucket array, and set up hashing
- * constants for new array size.
- */
- nodePtr->valueTableSize2 += 2;
- nBuckets = (1 << nodePtr->valueTableSize2);
- buckets = Blt_AssertCalloc(nBuckets, sizeof(Value *));
-
- /*
- * Move all of the existing entries into the new bucket array, based on
- * their hash values.
- */
- mask = nBuckets - 1;
- downshift = DOWNSHIFT_START - nodePtr->valueTableSize2;
- for (bp = oldBuckets; bp < bend; bp++) {
- Value *vp, *nextPtr;
-
- for (vp = *bp; vp != NULL; vp = nextPtr) {
- Value **bucketPtr;
-
- nextPtr = vp->hnext;
- bucketPtr = buckets + RANDOM_INDEX(vp->key);
- vp->hnext = *bucketPtr;
- *bucketPtr = vp;
- }
- }
- nodePtr->valueTable = buckets;
- Blt_Free(oldBuckets);
-}
-
-static void
-MakeValueTable(Node *nodePtr)
-{
- unsigned int nBuckets;
- Value **buckets;
- unsigned int mask;
- int downshift;
- Value *vp, *nextPtr;
-
- assert(nodePtr->valueTable == NULL);
-
- /* Generate hash table from list of values. */
- nodePtr->valueTableSize2 = START_LOGSIZE;
- nBuckets = 1 << nodePtr->valueTableSize2;
- buckets = Blt_AssertCalloc(nBuckets, sizeof(Value *));
- mask = nBuckets - 1;
- downshift = DOWNSHIFT_START - nodePtr->valueTableSize2;
- for (vp = nodePtr->values; vp != NULL; vp = nextPtr) {
- Value **bucketPtr;
-
- nextPtr = vp->next;
- bucketPtr = buckets + RANDOM_INDEX(vp->key);
- vp->hnext = *bucketPtr;
- *bucketPtr = vp;
- }
- nodePtr->valueTable = buckets;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeDeleteValue --
- *
- * Remove a single entry from a hash table.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The entry given by entryPtr is deleted from its table and should never
- * again be used by the caller. It is up to the caller to free the
- * clientData field of the entry, if that is relevant.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TreeDeleteValue(Node *nodePtr, Blt_TreeValue value)
-{
- Value *vp, *prevPtr;
-
- if (nodePtr->valueTable != NULL) {
- Value **bucketPtr;
- unsigned int downshift;
- unsigned long mask;
-
- mask = (1 << nodePtr->valueTableSize2) - 1;
- downshift = DOWNSHIFT_START - nodePtr->valueTableSize2;
- bucketPtr = nodePtr->valueTable + RANDOM_INDEX(((Value *)value)->key);
- if (*bucketPtr == value) {
- *bucketPtr = ((Value *)value)->hnext;
- } else {
- Value *pp;
-
- for (pp = *bucketPtr; /*empty*/; pp = pp->hnext) {
- if (pp == NULL) {
- return TCL_ERROR; /* Can't find value in hash bucket. */
- }
- if (pp->hnext == value) {
- pp->hnext = ((Value *)value)->hnext;
- break;
- }
- }
- }
- }
- prevPtr = NULL;
- for (vp = nodePtr->values; vp != NULL; vp = vp->next) {
- if (vp == value) {
- break;
- }
- prevPtr = vp;
- }
- if (vp == NULL) {
- return TCL_ERROR; /* Can't find value in list. */
- }
- if (prevPtr == NULL) {
- nodePtr->values = vp->next;
- } else {
- prevPtr->next = vp->next;
- }
- nodePtr->nValues--;
- FreeValue(nodePtr, value);
- if (nodePtr->nValues < HASH_LOW_WATER) {
- Blt_Free(nodePtr->valueTable);
- nodePtr->valueTable = NULL;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeDestroyValues --
- *
- * Free up everything associated with a hash table except for the record
- * for the table itself.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The hash table is no longer useable.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TreeDestroyValues(Node *nodePtr)
-{
- Value *vp;
- Value *nextPtr;
-
- /* Free value hash table. */
- if (nodePtr->valueTable != NULL) {
- Blt_Free(nodePtr->valueTable);
- }
-
- /* Free all the entries in the value list. */
- for (vp = nodePtr->values; vp != NULL; vp = nextPtr) {
- nextPtr = vp->next;
- FreeValue(nodePtr, vp);
- }
- nodePtr->values = NULL;
- nodePtr->valueTable = NULL;
- nodePtr->nValues = 0;
- nodePtr->valueTableSize2 = 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeFirstValue --
- *
- * Locate the first entry in a hash table and set up a record that can be
- * used to step through all the remaining entries of the table.
- *
- * Results:
- * The return value is a pointer to the first value in tablePtr, or NULL
- * if tablePtr has no entries in it. The memory at *searchPtr is
- * initialized so that subsequent calls to Blt_Tree_NextValue will return
- * all of the values in the table, one at a time.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static Value *
-TreeFirstValue(
- Node *nodePtr,
- Blt_TreeKeyIterator *iterPtr) /* Place to store information about progress
- * through the table. */
-{
- iterPtr->node = nodePtr;
- iterPtr->nextIndex = 0;
- iterPtr->nextValue = nodePtr->values;
- return TreeNextValue(iterPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeNextValue --
- *
- * Once a hash table enumeration has been initiated by calling
- * Blt_Tree_FirstValue, this procedure may be called to return successive
- * elements of the table.
- *
- * Results:
- * The return value is the next entry in the hash table being enumerated,
- * or NULL if the end of the table is reached.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static Value *
-TreeNextValue(
- Blt_TreeKeyIterator *iterPtr) /* Place to store information about progress
- * through the table. Must have been
- * initialized by calling
- * Blt_Tree_FirstValue. */
-{
- Value *valuePtr;
-
- valuePtr = iterPtr->nextValue;
- if (valuePtr != NULL) {
- iterPtr->nextValue = valuePtr->next;
- }
- return valuePtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeFindValue --
- *
- * Given a hash table with one-word keys, and a one-word key, find the
- * entry with a matching key.
- *
- * Results:
- * The return value is a token for the matching entry in the hash table,
- * or NULL if there was no matching entry.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static Value *
-TreeFindValue(
- Node *nodePtr,
- Blt_TreeKey key) /* Key to use to find matching entry. */
-{
- Value *vp;
-
- if (nodePtr->valueTable != NULL) {
- unsigned int downshift;
- unsigned long mask;
- Value *bucket;
-
- mask = (1 << nodePtr->valueTableSize2) - 1;
- downshift = DOWNSHIFT_START - nodePtr->valueTableSize2;
- bucket = nodePtr->valueTable[RANDOM_INDEX(key)];
-
- /* Search all of the entries in the appropriate bucket. */
- for (vp = bucket; (vp != NULL) && (vp->key != key); vp = vp->hnext) {
- /* empty */;
- }
- } else {
- for (vp = nodePtr->values; (vp != NULL) && (vp->key != key);
- vp = vp->next) {
- /* empty */;
- }
- }
- return vp;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeCreateValue --
- *
- * Find the value with a matching key. If there is no matching value,
- * then create a new one.
- *
- * Results:
- * The return value is a pointer to the matching value. If this is a
- * newly-created value, then *newPtr will be set to a non-zero value;
- * otherwise *newPtr will be set to 0.
- *
- * Side effects:
- * A new value may be added to the hash table.
- *
- *---------------------------------------------------------------------------
- */
-static Value *
-TreeCreateValue(
- Node *nodePtr,
- Blt_TreeKey key, /* Key to use to find or create matching
- * entry. */
- int *isNewPtr) /* (out) If non-zero, indicates a new hash
- * entry was created. */
-{
- Value *vp, *prevPtr;
-
- prevPtr = NULL;
- *isNewPtr = FALSE;
- for (vp = nodePtr->values; vp != NULL; vp = vp->next) {
- if (vp->key == key) {
- return vp;
- }
- prevPtr = vp;
- }
- /* Value not found. Add a new value to the list. */
- *isNewPtr = TRUE;
- vp = Blt_PoolAllocItem(nodePtr->corePtr->valuePool, sizeof(Value));
- vp->key = key;
- vp->owner = NULL;
- vp->next = NULL;
- vp->hnext = NULL;
- vp->objPtr = NULL;
- if (prevPtr == NULL) {
- nodePtr->values = vp;
- } else {
- prevPtr->next = vp;
- }
- nodePtr->nValues++;
-
- if (nodePtr->valueTable == NULL) {
- /*
- * If we reach a threshold number of values, create a hash table of
- * values.
- */
- if (nodePtr->nValues > HASH_HIGH_WATER) {
- MakeValueTable(nodePtr);
- }
- } else {
- Value **bucketPtr;
- size_t nBuckets;
- unsigned int downshift;
- unsigned long mask;
-
- nBuckets = (1 << nodePtr->valueTableSize2);
- mask = nBuckets - 1;
- downshift = DOWNSHIFT_START - nodePtr->valueTableSize2;
- bucketPtr = nodePtr->valueTable + RANDOM_INDEX((void *)key);
- vp->hnext = *bucketPtr;
- *bucketPtr = vp;
- /*
- * If the table has exceeded a decent size, rebuild it with many more
- * buckets.
- */
- if ((unsigned int)nodePtr->nValues >= (nBuckets * 3)) {
- RebuildValueTable(nodePtr);
- }
- }
- return vp;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ParseDumpRecord --
- *
- * Gets the next full record in the dump string, returning the record as
- * a list. Blank lines and comments are ignored.
- *
- * Results:
- * TCL_RETURN The end of the string is reached.
- * TCL_ERROR An error occurred and an error message
- * is left in the interpreter result.
- * TCL_OK The next record has been successfully parsed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ParseDumpRecord(
- Tcl_Interp *interp,
- const char **stringPtr, /* (in/out) points to current location in in
- * dump string. Updated after parsing
- * record. */
- int *argcPtr, /* (out) Will contain the length of the
- * record's list. */
- const char ***argvPtr, /* (out) Will contain the list representing
- * the dump record of the node. */
- RestoreInfo *restorePtr)
-{
- char *entry, *eol;
- char saved;
- int result;
-
- entry = (char *)*stringPtr;
- /* Get first line, ignoring blank lines and comments. */
- for (;;) {
- char *first;
-
- first = NULL;
- restorePtr->nLines++;
- /* Find the end of the first line. */
- for (eol = entry; (*eol != '\n') && (*eol != '\0'); eol++) {
- if ((first == NULL) && (!isspace(UCHAR(*eol)))) {
- first = eol; /* Track first non-whitespace character. */
- }
- }
- if (first == NULL) {
- if (*eol == '\0') {
- return TCL_RETURN;
- }
- } else if (*first != '#') {
- break; /* Not a comment or blank line. */
- }
- entry = eol + 1;
- }
- saved = *eol;
- *eol = '\0';
- while (!Tcl_CommandComplete(entry)) {
- *eol = saved;
- if (*eol == '\0') {
- Tcl_AppendResult(interp, "incomplete dump record: \"", entry,
- "\"", (char *)NULL);
- return TCL_ERROR; /* Found EOF (incomplete entry) or error. */
- }
- /* Get the next line. */
- for (eol = eol + 1; (*eol != '\n') && (*eol != '\0'); eol++) {
- /*empty*/
- }
- restorePtr->nLines++;
- saved = *eol;
- *eol = '\0';
- }
- if (entry == eol) {
- return TCL_RETURN;
- }
- result = Tcl_SplitList(interp, entry, argcPtr, argvPtr);
- *eol = saved;
- *stringPtr = eol + 1;
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReadDumpRecord --
- *
- * Reads the next full record from the given channel, returning the
- * record as a list. Blank lines and comments are ignored.
- *
- * Results:
- * TCL_RETURN The end of the file has been reached.
- * TCL_ERROR A read error has occurred and an error message
- * is left in the interpreter result.
- * TCL_OK The next record has been successfully parsed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ReadDumpRecord(
- Tcl_Interp *interp,
- Tcl_Channel channel, /* Channel from which to read the next
- * record. */
- int *argcPtr, /* (out) Will contain the length of the
- * record's list. */
- const char ***argvPtr, /* (out) Will contain the list representing
- * the dump record of the node. */
- RestoreInfo *restorePtr)
-{
- int result;
- Tcl_DString ds;
-
- Tcl_DStringInit(&ds);
- /* Get first line, ignoring blank lines and comments. */
- for (;;) {
- char *cp;
- int nBytes;
-
- Tcl_DStringSetLength(&ds, 0);
- nBytes = Tcl_Gets(channel, &ds);
- if (nBytes < 0) {
- if (Tcl_Eof(channel)) {
- return TCL_RETURN;
- }
- return TCL_ERROR;
- }
- restorePtr->nLines++;
- for (cp = Tcl_DStringValue(&ds); *cp != '\0'; cp++) {
- if (!isspace(UCHAR(*cp))) {
- break;
- }
- }
- if ((*cp != '\0') && (*cp != '#')) {
- break; /* Not a comment or blank line. */
- }
- }
-
- Tcl_DStringAppend(&ds, "\n", 1);
- while (!Tcl_CommandComplete(Tcl_DStringValue(&ds))) {
- int nBytes;
-
- if (Tcl_Eof(channel)) {
- Tcl_AppendResult(interp, "unexpected EOF: short record.",
- (char *)NULL);
- Tcl_DStringFree(&ds);
- return TCL_ERROR; /* Found EOF (incomplete entry) or error. */
- }
- /* Process additional lines if needed */
- nBytes = Tcl_Gets(channel, &ds);
- if (nBytes < 0) {
- Tcl_AppendResult(interp, "read error: ",
- Tcl_PosixError(interp), (char *)NULL);
- Tcl_DStringFree(&ds);
- return TCL_ERROR; /* Found EOF (incomplete entry) or error. */
- }
- restorePtr->nLines++;
- Tcl_DStringAppend(&ds, "\n", 1);
- }
- result = Tcl_SplitList(interp, Tcl_DStringValue(&ds), argcPtr, argvPtr);
- Tcl_DStringFree(&ds);
- return result;
-}
-
-static Tcl_Obj *
-GetStringObj(RestoreInfo *restorePtr, const char *string, int length)
-{
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&restorePtr->dataTable, string, &isNew);
- if (isNew) {
- Tcl_Obj *objPtr;
-
- if (length == -1) {
- length = strlen(string);
- }
- objPtr = Tcl_NewStringObj(string, length);
- Blt_SetHashValue(hPtr, objPtr);
- return objPtr;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-static int
-RestoreValues(
- RestoreInfo *restorePtr,
- Tcl_Interp *interp,
- Node *nodePtr,
- int nValues,
- const char **values)
-{
- int i;
-
- for (i = 0; i < nValues; i += 2) {
- Tcl_Obj *valueObjPtr;
- int result;
-
- if ((i + 1) < nValues) {
- valueObjPtr = GetStringObj(restorePtr, values[i + 1], -1);
- } else {
- valueObjPtr = Tcl_NewStringObj("", -1);
- }
- Tcl_IncrRefCount(valueObjPtr);
- result = Blt_Tree_SetValue(interp, restorePtr->treePtr, nodePtr,
- values[i], valueObjPtr);
- Tcl_DecrRefCount(valueObjPtr);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-static int
-RestoreTags(
- Tree *treePtr,
- Node *nodePtr,
- int nTags,
- const char **tags)
-{
- int i;
-
- for (i = 0; i < nTags; i++) {
- Blt_Tree_AddTag(treePtr, nodePtr, tags[i]);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RestoreNode5 --
- *
- * Parses and creates a node based upon the first 3 fields of a five
- * field entry. This is the new restore file format.
- *
- * parentId nodeId pathList dataList tagList ?attrList?
- *
- * The purpose is to attempt to save and restore the node ids embedded in
- * the restore file information. The old format could not distinquish
- * between two sibling nodes with the same label unless they were both
- * leaves. I'm trying to avoid dependencies upon labels.
- *
- * If you're starting from an empty tree, this obviously should work
- * without a hitch. We only need to map the file's root id to 0. It's a
- * little more complicated when adding node to an already full tree.
- *
- * First see if the node id isn't already in use. Otherwise, map the
- * node id (via a hashtable) to the real node. We'll need it later when
- * subsequent entries refer to their parent id.
- *
- * If a parent id is unknown (the restore file may be out of order), then
- * follow plan B and use its path.
- *
- *---------------------------------------------------------------------------
- */
-static int
-RestoreNode5(
- Tcl_Interp *interp,
- int argc, /* Not used. */
- const char **argv,
- RestoreInfo *restorePtr)
-{
- Tree *treePtr;
- Blt_HashEntry *hPtr;
- Node *nodePtr, *parentPtr;
- int isNew;
- long pid, id;
- const char **attrs, **tags, **values, **names;
- int nTags, nValues, nNames;
-
- treePtr = restorePtr->treePtr;
-
- /*
- * The second and first fields respectively are the ids of the node and
- * its parent. The parent id of the root node is always -1.
- */
-
- if ((Tcl_GetLong(interp, argv[0], &pid) != TCL_OK) ||
- (Tcl_GetLong(interp, argv[1], &id) != TCL_OK)) {
- return TCL_ERROR;
- }
- names = values = tags = attrs = NULL;
- nodePtr = NULL;
-
- /*
- * The third, fourth, and fifth fields respectively are the list of
- * component names representing the path to the node including the name of
- * the node, a key-value list of data values, and a list of tag names.
- */
-
- if ((Tcl_SplitList(interp, argv[2], &nNames, &names) != TCL_OK) ||
- (Tcl_SplitList(interp, argv[3], &nValues, &values) != TCL_OK) ||
- (Tcl_SplitList(interp, argv[4], &nTags, &tags) != TCL_OK)) {
- goto error;
- }
-
- /* Get the parent of the node. */
-
- if (pid == -1) { /* Map -1 id to the root node of the subtree. */
- nodePtr = restorePtr->rootPtr;
- hPtr = Blt_CreateHashEntry(&restorePtr->idTable, (char *)id, &isNew);
- Blt_SetHashValue(hPtr, nodePtr);
- Blt_Tree_RelabelNode(treePtr, nodePtr, names[0]);
- } else {
-
- /*
- * Check if the parent has been mapped to another id in the tree.
- * This can happen when there's a id collision with an existing node.
- */
-
- hPtr = Blt_FindHashEntry(&restorePtr->idTable, (char *)pid);
- if (hPtr != NULL) {
- parentPtr = Blt_GetHashValue(hPtr);
- } else {
- parentPtr = Blt_Tree_GetNode(treePtr, pid);
- if (parentPtr == NULL) {
- /*
- * Normally the parent node should already exist in the tree,
- * but in a partial restore it might not. "Plan B" is to use
- * the list of path components to create the missing
- * components, including the parent.
- */
- if (nNames == 0) {
- parentPtr = restorePtr->rootPtr;
- } else {
- int i;
-
- for (i = 1; i < (nNames - 2); i++) {
- nodePtr = Blt_Tree_FindChild(parentPtr, names[i]);
- if (nodePtr == NULL) {
- nodePtr = Blt_Tree_CreateNode(treePtr, parentPtr,
- names[i], -1);
- }
- parentPtr = nodePtr;
- }
- /*
- * If there's a node with the same label as the parent,
- * we'll use that node. Otherwise, try to create a new
- * node with the desired parent id.
- */
- nodePtr = Blt_Tree_FindChild(parentPtr, names[nNames - 2]);
- if (nodePtr == NULL) {
- nodePtr = Blt_Tree_CreateNodeWithId(treePtr, parentPtr,
- names[nNames - 2], pid, -1);
- if (nodePtr == NULL) {
- goto error;
- }
- }
- parentPtr = nodePtr;
- }
- }
- }
-
- /*
- * It's an error if the desired id has already been remapped. That
- * means there were two nodes in the dump with the same id.
- */
- hPtr = Blt_FindHashEntry(&restorePtr->idTable, (char *)id);
- if (hPtr != NULL) {
- Tcl_AppendResult(interp, "node \"", Blt_Ltoa(id),
- "\" has already been restored", (char *)NULL);
- goto error;
- }
-
-
- if (restorePtr->flags & TREE_RESTORE_OVERWRITE) {
- /* Can you find the child by name. */
- nodePtr = Blt_Tree_FindChild(parentPtr, names[nNames - 1]);
- if (nodePtr != NULL) {
- hPtr = Blt_CreateHashEntry(&restorePtr->idTable, (char *)id,
- &isNew);
- Blt_SetHashValue(hPtr, nodePtr);
- }
- }
-
- if (nodePtr == NULL) {
- nodePtr = Blt_Tree_GetNode(treePtr, id);
- if (nodePtr == NULL) {
- nodePtr = Blt_Tree_CreateNodeWithId(treePtr, parentPtr,
- names[nNames - 1], id, -1);
- } else {
- nodePtr = Blt_Tree_CreateNode(treePtr, parentPtr,
- names[nNames - 1], -1);
- hPtr = Blt_CreateHashEntry(&restorePtr->idTable, (char *)id,
- &isNew);
- Blt_SetHashValue(hPtr, nodePtr);
- }
- }
- }
-
- if (nodePtr == NULL) {
- goto error; /* Couldn't create node with requested id. */
- }
- Blt_Free(names);
- names = NULL;
-
- /* Values */
- if (RestoreValues(restorePtr, interp, nodePtr, nValues, values) != TCL_OK) {
- goto error;
- }
- Blt_Free(values);
- values = NULL;
-
- /* Tags */
- if (!(restorePtr->flags & TREE_RESTORE_NO_TAGS)) {
- RestoreTags(treePtr, nodePtr, nTags, tags);
- }
- Blt_Free(tags);
- tags = NULL;
- return TCL_OK;
-
- error:
- if (attrs != NULL) {
- Blt_Free(attrs);
- }
- if (tags != NULL) {
- Blt_Free(tags);
- }
- if (values != NULL) {
- Blt_Free(values);
- }
- if (names != NULL) {
- Blt_Free(names);
- }
- if (nodePtr != NULL) {
- Blt_Tree_DeleteNode(treePtr, nodePtr);
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RestoreNode3 --
- *
- * Parses and creates a node based upon the first field of a three field
- * entry. This is the old restore file format.
- *
- * pathList dataList tagList
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-RestoreNode3(
- Tcl_Interp *interp,
- int argc, /* Not used. */
- const char **argv,
- RestoreInfo *restorePtr)
-{
- Tree *treePtr;
- Node *nodePtr, *parentPtr;
- int i;
- const char **names, **values, **tags;
- int nNames, nValues, nTags;
-
- /* The first field is a list of component names representing the path to
- * the node, including the name of the node. */
-
- if (Tcl_SplitList(interp, argv[0], &nNames, &names) != TCL_OK) {
- return TCL_ERROR;
- }
- nodePtr = parentPtr = restorePtr->rootPtr;
- treePtr = restorePtr->treePtr;
- /* Automatically create ancestor nodes as needed. */
- for (i = 0; i < (nNames - 1); i++) {
- nodePtr = Blt_Tree_FindChild(parentPtr, names[i]);
- if (nodePtr == NULL) {
- nodePtr = Blt_Tree_CreateNode(treePtr, parentPtr, names[i], -1);
- }
- parentPtr = nodePtr;
- }
- if (nNames > 0) {
-
- /*
- * By default duplicate nodes (two sibling nodes with the same label)
- * unless the -overwrite switch was given.
- */
-
- nodePtr = NULL;
- if (restorePtr->flags & TREE_RESTORE_OVERWRITE) {
- nodePtr = Blt_Tree_FindChild(parentPtr, names[i]);
- }
- if (nodePtr == NULL) {
- nodePtr = Blt_Tree_CreateNode(treePtr, parentPtr, names[i], -1);
- }
- }
- Blt_Free(names);
-
- /* The second field is a key-value list of the node's values. */
-
- if (Tcl_SplitList(interp, argv[1], &nValues, &values) != TCL_OK) {
- return TCL_ERROR;
- }
- if (RestoreValues(restorePtr, interp, nodePtr, nValues, values) != TCL_OK) {
- goto error;
- }
- Blt_Free(values);
-
- /* The third field is a list of tags. */
-
- if (!(restorePtr->flags & TREE_RESTORE_NO_TAGS)) {
- /* Parse the tag list. */
- if (Tcl_SplitList(interp, argv[2], &nTags, &tags) != TCL_OK) {
- goto error;
- }
- RestoreTags(treePtr, nodePtr, nTags, tags);
- Blt_Free(tags);
- }
- return TCL_OK;
-
- error:
- Blt_Free(argv);
- Blt_Tree_DeleteNode(treePtr, nodePtr);
- return TCL_ERROR;
-}
-
-/* Public Routines */
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_GetKey --
- *
- * Given a string, returns a unique identifier for the string.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TreeKey
-Blt_Tree_GetKey(Tree *treePtr, const char *string) /* String to convert. */
-{
- Blt_HashEntry *hPtr;
- int isNew;
- Blt_HashTable *tablePtr;
-
- tablePtr = &treePtr->corePtr->dataPtr->keyTable;
- hPtr = Blt_CreateHashEntry(tablePtr, string, &isNew);
- return (Blt_TreeKey)Blt_GetHashKey(tablePtr, hPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_GetKeyFromNode --
- *
- * Given a string, returns a unique identifier for the string.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TreeKey
-Blt_Tree_GetKeyFromNode(Node *nodePtr, const char *string)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- Blt_HashTable *tablePtr;
-
- tablePtr = &nodePtr->corePtr->dataPtr->keyTable;
- hPtr = Blt_CreateHashEntry(tablePtr, string, &isNew);
- return (Blt_TreeKey)Blt_GetHashKey(tablePtr, hPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_GetKeyFromInterp --
- *
- * Given a string, returns a unique identifier for the string.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TreeKey
-Blt_Tree_GetKeyFromInterp(Tcl_Interp *interp, const char *string)
-{
- Blt_HashEntry *hPtr;
- TreeInterpData *dataPtr;
- int isNew;
-
- dataPtr = Blt_Tree_GetInterpData(interp);
- hPtr = Blt_CreateHashEntry(&dataPtr->keyTable, string, &isNew);
- return (Blt_TreeKey)Blt_GetHashKey(&dataPtr->keyTable, hPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_CreateNode --
- *
- * Creates a new node in the given parent node. The name and position in
- * the parent are also provided.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TreeNode
-Blt_Tree_CreateNode(
- Tree *treePtr, /* The tree client that is creating this node.
- * If NULL, indicates to trigger notify events
- * on behalf of the initiating client also. */
- Node *parentPtr, /* Parent node where the new node will be
- * inserted. */
- const char *name, /* Name of node. */
- long position) /* Position in the parent's list of children
- * where to insert the new node. */
-{
- Blt_HashEntry *hPtr;
- Node *beforePtr;
- Node *nodePtr; /* Node to be inserted. */
- TreeObject *corePtr;
- long inode;
- int isNew;
-
- corePtr = parentPtr->corePtr;
-
- /* Generate an unique serial number for this node. */
- do {
- inode = corePtr->nextInode++;
- hPtr = Blt_CreateHashEntry(&corePtr->nodeTable,(char *)inode,
- &isNew);
- } while (!isNew);
- nodePtr = NewNode(corePtr, name, inode);
- Blt_SetHashValue(hPtr, nodePtr);
-
- if ((position == -1) || ((size_t)position >= parentPtr->nChildren)) {
- beforePtr = NULL;
- } else {
- beforePtr = parentPtr->first;
- while ((position > 0) && (beforePtr != NULL)) {
- position--;
- beforePtr = beforePtr->next;
- }
- }
- LinkBefore(parentPtr, nodePtr, beforePtr);
- nodePtr->depth = parentPtr->depth + 1;
- /*
- * Issue callbacks to each client indicating that a new node has been
- * created.
- */
- NotifyClients(treePtr, corePtr, nodePtr, TREE_NOTIFY_CREATE);
- return nodePtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_CreateNodeWithId --
- *
- * Like Blt_Tree_CreateNode, but provides a specific id to use for the
- * node. If the tree already contains a node by that id, NULL is
- * returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TreeNode
-Blt_Tree_CreateNodeWithId(
- Tree *treePtr,
- Node *parentPtr, /* Parent node where the new node will be
- * inserted. */
- const char *name, /* Name of node. */
- long inode, /* Requested id of the new node. If a node by
- * this id already exists in the tree, no node
- * is created. */
- long position) /* Position in the parent's list of children
- * where to insert the new node. */
-{
- Blt_HashEntry *hPtr;
- Node *beforePtr;
- Node *nodePtr; /* Node to be inserted. */
- TreeObject *corePtr;
- int isNew;
-
- corePtr = parentPtr->corePtr;
- hPtr = Blt_CreateHashEntry(&corePtr->nodeTable, (char *)inode, &isNew);
- if (!isNew) {
- return NULL;
- }
- nodePtr = NewNode(corePtr, name, inode);
- Blt_SetHashValue(hPtr, nodePtr);
-
- if ((position == -1) || ((size_t)position >= parentPtr->nChildren)) {
- beforePtr = NULL;
- } else {
- beforePtr = parentPtr->first;
- while ((position > 0) && (beforePtr != NULL)) {
- position--;
- beforePtr = beforePtr->next;
- }
- }
- LinkBefore(parentPtr, nodePtr, beforePtr);
- nodePtr->depth = parentPtr->depth + 1;
- /*
- * Issue callbacks to each client indicating that a new node has been
- * created.
- */
- NotifyClients(treePtr, corePtr, nodePtr, TREE_NOTIFY_CREATE);
- return nodePtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_MoveNode --
- *
- * Move an entry into a new location in the hierarchy.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-Blt_Tree_MoveNode(Tree *treePtr, Node *nodePtr, Node *parentPtr,
- Node *beforePtr)
-{
- TreeObject *corePtr = nodePtr->corePtr;
- size_t newDepth;
-
- if (nodePtr == beforePtr) {
- return TCL_ERROR;
- }
- if ((beforePtr != NULL) && (beforePtr->parent != parentPtr)) {
- return TCL_ERROR;
- }
- if (nodePtr->parent == NULL) {
- return TCL_ERROR; /* Can't move root. */
- }
- /* Verify that the node isn't an ancestor of the new parent. */
- if (Blt_Tree_IsAncestor(nodePtr, parentPtr)) {
- return TCL_ERROR;
- }
- UnlinkNode(nodePtr);
-
- /* Relink the node as a child of the new parent. */
- LinkBefore(parentPtr, nodePtr, beforePtr);
- newDepth = parentPtr->depth + 1;
- if (nodePtr->depth != newDepth) {
- /* Recursively reset the depths of all descendant nodes. */
- ResetDepths(nodePtr, newDepth);
- }
-
- /*
- * Issue callbacks to each client indicating that a node has been moved.
- */
- NotifyClients(treePtr, corePtr, nodePtr, TREE_NOTIFY_MOVE);
- return TCL_OK;
-}
-
-int
-Blt_Tree_DeleteNode(Tree *treePtr, Node *nodePtr)
-{
- TreeObject *corePtr = nodePtr->corePtr;
- Node *np, *nextPtr;
-
- /* In depth-first order, delete each descendant node. */
- for (np = nodePtr->first; np != NULL; np = nextPtr) {
- nextPtr = np->next;
- Blt_Tree_DeleteNode(treePtr, np);
- }
- /*
- * Issue callbacks to each client indicating that the node can no longer
- * be used.
- */
- NotifyClients(treePtr, corePtr, nodePtr, TREE_NOTIFY_DELETE);
-
- /* Now remove the actual node. */
- FreeNode(corePtr, nodePtr);
- return TCL_OK;
-}
-
-Blt_TreeNode
-Blt_Tree_GetNode(Tree *treePtr, long inode)
-{
- TreeObject *corePtr = treePtr->corePtr;
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&corePtr->nodeTable, (char *)inode);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- return NULL;
-}
-
-Blt_TreeTrace
-Blt_Tree_CreateTrace(Tree *treePtr, Node *nodePtr, const char *keyPattern,
- const char *tagName, unsigned int mask,
- Blt_TreeTraceProc *proc, ClientData clientData)
-{
- TraceHandler *tracePtr;
-
- tracePtr = Blt_AssertCalloc(1, sizeof (TraceHandler));
- tracePtr->link = Blt_Chain_Append(treePtr->traces, tracePtr);
- if (keyPattern != NULL) {
- tracePtr->keyPattern = Blt_AssertStrdup(keyPattern);
- }
- if (tagName != NULL) {
- tracePtr->withTag = Blt_AssertStrdup(tagName);
- }
- tracePtr->treePtr = treePtr;
- tracePtr->proc = proc;
- tracePtr->clientData = clientData;
- tracePtr->mask = mask;
- tracePtr->nodePtr = nodePtr;
- tracePtr->interp = treePtr->interp;
- Blt_InitHashTable(&tracePtr->idleTable, sizeof(TraceWhenIdle)/sizeof(int));
- return (Blt_TreeTrace)tracePtr;
-}
-
-void
-Blt_Tree_DeleteTrace(Blt_TreeTrace trace)
-{
- TraceHandler *tracePtr = (TraceHandler *)trace;
-
- Blt_Chain_DeleteLink(tracePtr->treePtr->traces, tracePtr->link);
- if (tracePtr->keyPattern != NULL) {
- Blt_Free(tracePtr->keyPattern);
- }
- if (tracePtr->withTag != NULL) {
- Blt_Free(tracePtr->withTag);
- }
- Blt_Free(tracePtr);
-}
-
-void
-Blt_Tree_RelabelNodeWithoutNotify(Node *nodePtr, const char *string)
-{
- Blt_TreeKey oldLabel;
- Node **bucketPtr;
- Node *parentPtr;
- Node *np;
- unsigned int downshift;
- unsigned long mask;
-
- oldLabel = nodePtr->label;
- nodePtr->label = Blt_Tree_GetKeyFromNode(nodePtr, string);
- parentPtr = nodePtr->parent;
- if ((parentPtr == NULL) || (parentPtr->nodeTable == NULL)) {
- return; /* Root node. */
- }
- /* Changing the node's name requires that we rehash the node in the
- * parent's table of children. */
- mask = (1 << parentPtr->nodeTableSize2) - 1;
- downshift = DOWNSHIFT_START - parentPtr->nodeTableSize2;
- bucketPtr = parentPtr->nodeTable + RANDOM_INDEX(oldLabel);
- if (*bucketPtr == nodePtr) {
- *bucketPtr = nodePtr->hnext;
- } else {
- for (np = *bucketPtr; /*empty*/; np = np->hnext) {
- if (np == NULL) {
- return; /* Can't find node in hash bucket. */
- }
- if (np->hnext == nodePtr) {
- np->hnext = nodePtr->hnext;
- break;
- }
- }
- }
- bucketPtr = parentPtr->nodeTable + RANDOM_INDEX(nodePtr->label);
- nodePtr->hnext = *bucketPtr;
- *bucketPtr = nodePtr;
-}
-
-void
-Blt_Tree_RelabelNode(Tree *treePtr, Node *nodePtr, const char *string)
-{
- Blt_Tree_RelabelNodeWithoutNotify(nodePtr, string);
- NotifyClients(treePtr, treePtr->corePtr, nodePtr,
- TREE_NOTIFY_RELABEL);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_FindChild --
- *
- * Searches for the named node in a parent's chain of siblings.
- *
- *
- * Results:
- * If found, the child node is returned, otherwise NULL.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TreeNode
-Blt_Tree_FindChild(Node *parentPtr, const char *string)
-{
- Blt_TreeKey key;
- Node *np;
-
- key = Blt_Tree_GetKeyFromNode(parentPtr, string);
- if (parentPtr->nodeTable != NULL) {
- unsigned int downshift;
- unsigned long mask;
- Node *bucket;
-
- mask = (1 << parentPtr->nodeTableSize2) - 1;
- downshift = DOWNSHIFT_START - parentPtr->nodeTableSize2;
- bucket = parentPtr->nodeTable[RANDOM_INDEX(key)];
-
- /* Search all of the entries in the appropriate bucket. */
- for (np = bucket; np != NULL; np = np->hnext) {
- if (key == np->label) {
- return np;
- }
- }
- } else {
- for (np = parentPtr->first; np != NULL; np = np->next) {
- if (key == np->label) {
- return np;
- }
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_NodePosition --
- *
- * Returns the position of the node in its parent's list of children.
- * The root's position is 0.
- *
- *---------------------------------------------------------------------------
- */
-long
-Blt_Tree_NodePosition(Node *nodePtr)
-{
- Node *parentPtr;
- long count;
-
- count = 0;
- parentPtr = nodePtr->parent;
- if (parentPtr != NULL) {
- Node *np;
-
- for (np = parentPtr->first; np != NULL; np = np->next) {
- if (nodePtr == np) {
- break;
- }
- count++;
- }
- }
- return count;
-}
-
-Blt_TreeNode
-Blt_Tree_FirstChild(Node *parentPtr)
-{
- return parentPtr->first;
-}
-
-Blt_TreeNode
-Blt_Tree_LastChild(Node *parentPtr)
-{
- return parentPtr->last;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_PrevNode --
- *
- * Returns the "previous" node in the tree. This node (in depth-first
- * order) is its parent, if the node has no siblings that are previous to
- * it. Otherwise it is the last descendant of the last sibling. In this
- * case, descend the sibling's hierarchy, using the last child at any
- * ancestor, with we we find a leaf.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TreeNode
-Blt_Tree_PrevNode(
- Node *rootPtr, /* Root of subtree. If NULL, indicates the
- * tree's root. */
- Node *nodePtr) /* Current node in subtree. */
-{
- Node *prevPtr;
-
- if (rootPtr == NULL) {
- rootPtr = nodePtr->corePtr->root;
- }
- if (nodePtr == rootPtr) {
- return NULL; /* The root is the first node. */
- }
- prevPtr = nodePtr->prev;
- if (prevPtr == NULL) {
- /* There are no siblings previous to this one, so pick the parent. */
- return nodePtr->parent;
- }
- /*
- * Traverse down the right-most thread, in order to select the next entry.
- * Stop when we reach a leaf.
- */
- nodePtr = prevPtr;
- while ((prevPtr = nodePtr->last) != NULL) {
- nodePtr = prevPtr;
- }
- return nodePtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_NextNode --
- *
- * Returns the "next" node in relation to the given node. The next node
- * (in depth-first order) is either the first child of the given node the
- * next sibling if the node has no children (the node is a leaf). If the
- * given node is the last sibling, then try it's parent next sibling.
- * Continue until we either find a next sibling for some ancestor or we
- * reach the root node. In this case the current node is the last node
- * in the tree.
- *
- *---------------------------------------------------------------------------
- */
-Blt_TreeNode
-Blt_Tree_NextNode(
- Node *rootPtr, /* Root of subtree. If NULL, indicates the
- * tree's root. */
- Node *nodePtr) /* Current node in subtree. */
-{
- Node *nextPtr;
-
- /* Pick the first sub-node. */
- nextPtr = nodePtr->first;
- if (nextPtr != NULL) {
- return nextPtr;
- }
- /*
- * Back up until we can find a level where we can pick a "next sibling".
- * For the last entry we'll thread our way back to the root.
- */
- if (rootPtr == NULL) {
- rootPtr = nodePtr->corePtr->root;
- }
- while (nodePtr != rootPtr) {
- nextPtr = nodePtr->next;
- if (nextPtr != NULL) {
- return nextPtr;
- }
- nodePtr = nodePtr->parent;
- }
- return NULL; /* At root, no next node. */
-}
-
-
-int
-Blt_Tree_IsBefore(Node *n1Ptr, Node *n2Ptr)
-{
- long depth;
- long i;
- Node *nodePtr;
-
- if (n1Ptr == n2Ptr) {
- return FALSE;
- }
- depth = MIN(n1Ptr->depth, n2Ptr->depth);
- if (depth == 0) { /* One of the nodes is root. */
- return (n1Ptr->parent == NULL);
- }
- /*
- * Traverse back from the deepest node, until both nodes are at the same
- * depth. Check if this ancestor node is the same for both nodes.
- */
- for (i = n1Ptr->depth; i > depth; i--) {
- n1Ptr = n1Ptr->parent;
- }
- if (n1Ptr == n2Ptr) {
- return FALSE;
- }
- for (i = n2Ptr->depth; i > depth; i--) {
- n2Ptr = n2Ptr->parent;
- }
- if (n2Ptr == n1Ptr) {
- return TRUE;
- }
-
- /*
- * First find the mutual ancestor of both nodes. Look at each preceding
- * ancestor level-by-level for both nodes. Eventually we'll find a node
- * that's the parent of both ancestors. Then find the first ancestor in
- * the parent's list of subnodes.
- */
- for (i = depth; i > 0; i--) {
- if (n1Ptr->parent == n2Ptr->parent) {
- break;
- }
- n1Ptr = n1Ptr->parent;
- n2Ptr = n2Ptr->parent;
- }
- for (nodePtr = n1Ptr->parent->first; nodePtr != NULL;
- nodePtr = nodePtr->next) {
- if (nodePtr == n1Ptr) {
- return TRUE;
- } else if (nodePtr == n2Ptr) {
- return FALSE;
- }
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceIdleProc --
- *
- * Used to invoke event handler routines at some idle point. This
- * routine is called from the TCL event loop. Errors generated by the
- * event handler routines are backgrounded.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TraceIdleProc(ClientData clientData)
-{
- Blt_HashEntry *hashPtr = clientData;
- TraceWhenIdle *idlePtr;
- TraceHandler *tracePtr;
- int result;
- Node *nodePtr;
- Tcl_Interp *interp;
- Blt_TreeKey key;
- int flags;
-
- idlePtr = Blt_GetHashValue(hashPtr);
- tracePtr = idlePtr->tracePtr;
- interp = idlePtr->interp;
-
- /* Get the node from the inode since the node may be been deleted in the
- * time between the idle proc was issued and invoked. */
- nodePtr = Blt_Tree_GetNode(tracePtr->treePtr, idlePtr->inode);
- if (nodePtr != NULL) {
- key = idlePtr->key;
- flags = idlePtr->flags;
- Blt_DeleteHashEntry(&tracePtr->idleTable, hashPtr);
- result = (*tracePtr->proc) (tracePtr->clientData, interp, nodePtr,
- key, flags);
- if (result != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
- nodePtr->flags &= ~TREE_TRACE_ACTIVE;
- }
-}
-
-static void
-CallTraces(
- Tcl_Interp *interp,
- Tree *sourcePtr, /* Client holding a reference to the tree. If
- * NULL, indicates to execute all handlers,
- * including those of the caller. */
- TreeObject *corePtr, /* Tree that was changed. */
- Node *nodePtr, /* Node that received the event. */
- Blt_TreeKey key,
- unsigned int flags)
-{
- Tree *treePtr;
-
- for(treePtr = FirstClient(corePtr); treePtr != NULL;
- treePtr = NextClient(treePtr)) {
- Blt_ChainLink link;
-
- for(link = Blt_Chain_FirstLink(treePtr->traces); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TraceHandler *tracePtr;
-
- tracePtr = Blt_Chain_GetValue(link);
- if ((tracePtr->keyPattern != NULL) &&
- (!Tcl_StringMatch(key, tracePtr->keyPattern))) {
- continue; /* Key pattern doesn't match. */
- }
- if ((tracePtr->withTag != NULL) &&
- (!Blt_Tree_HasTag(treePtr, nodePtr, tracePtr->withTag))) {
- continue; /* Doesn't have the tag. */
- }
- if ((tracePtr->mask & flags) == 0) {
- continue; /* Flags don't match. */
- }
- if ((treePtr == sourcePtr) &&
- (tracePtr->mask & TREE_TRACE_FOREIGN_ONLY)) {
- continue; /* This client initiated the trace. */
- }
- if ((tracePtr->nodePtr != NULL) && (tracePtr->nodePtr != nodePtr)) {
- continue; /* Nodes don't match. */
- }
- if (tracePtr->mask & TREE_TRACE_WHENIDLE) {
- TraceWhenIdle idle;
- int isNew;
- Blt_HashEntry *hPtr;
-
- memset(&idle, 0, sizeof(idle));
- idle.interp = sourcePtr->interp;
- idle.tracePtr = tracePtr;
- idle.key = key;
- idle.flags = flags;
- idle.inode = nodePtr->inode;
- hPtr = Blt_CreateHashEntry(&tracePtr->idleTable, (char *)&idle,
- &isNew);
- if (isNew) {
- Blt_SetHashValue(hPtr,
- Blt_GetHashKey(&tracePtr->idleTable, hPtr));
- Tcl_DoWhenIdle(TraceIdleProc, hPtr);
- }
- } else {
- nodePtr->flags |= TREE_TRACE_ACTIVE;
- if ((*tracePtr->proc) (tracePtr->clientData, sourcePtr->interp,
- nodePtr, key, flags) != TCL_OK) {
- if (interp != NULL) {
- Tcl_BackgroundError(interp);
- }
- }
- nodePtr->flags &= ~TREE_TRACE_ACTIVE;
- }
- }
- }
-}
-
-static Value *
-GetTreeValue(Tcl_Interp *interp, Tree *treePtr, Node *nodePtr, Blt_TreeKey key)
-{
- Value *valuePtr;
-
- valuePtr = TreeFindValue(nodePtr, key);
- if (valuePtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find field \"", key, "\"",
- (char *)NULL);
- }
- return NULL;
- }
- if ((valuePtr->owner != NULL) && (valuePtr->owner != treePtr)) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't access private field \"",
- key, "\"", (char *)NULL);
- }
- return NULL;
- }
- return valuePtr;
-}
-
-int
-Blt_Tree_PrivateValue(Tcl_Interp *interp, Tree *treePtr, Node *nodePtr,
- Blt_TreeKey key)
-{
- Value *valuePtr;
-
- valuePtr = TreeFindValue(nodePtr, key);
- if (valuePtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find field \"", key, "\".",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- valuePtr->owner = treePtr;
- return TCL_OK;
-}
-
-int
-Blt_Tree_PublicValue(Tcl_Interp *interp, Tree *treePtr, Node *nodePtr,
- Blt_TreeKey key)
-{
- Value *valuePtr;
-
- valuePtr = TreeFindValue(nodePtr, key);
- if (valuePtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find field \"", key, "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (valuePtr->owner != treePtr) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "not the owner of \"", key, "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- valuePtr->owner = NULL;
- return TCL_OK;
-}
-
-int
-Blt_Tree_ValueExistsByKey(Tree *treePtr, Node *nodePtr, Blt_TreeKey key)
-{
- Value *valuePtr;
-
- valuePtr = GetTreeValue((Tcl_Interp *)NULL, treePtr, nodePtr, key);
- if (valuePtr == NULL) {
- return FALSE;
- }
- return TRUE;
-}
-
-int
-Blt_Tree_GetValueByKey(Tcl_Interp *interp, Tree *treePtr, Node *nodePtr,
- Blt_TreeKey key, Tcl_Obj **valueObjPtrPtr)
-{
- Value *valuePtr;
- TreeObject *corePtr = nodePtr->corePtr;
-
- valuePtr = GetTreeValue(interp, treePtr, nodePtr, key);
- if (valuePtr == NULL) {
- return TCL_ERROR;
- }
- *valueObjPtrPtr = valuePtr->objPtr;
- if (!(nodePtr->flags & TREE_TRACE_ACTIVE)) {
- CallTraces(interp, treePtr, corePtr, nodePtr, key,
- TREE_TRACE_READ);
- }
- return TCL_OK;
-}
-
-int
-Blt_Tree_SetValueByKey(
- Tcl_Interp *interp,
- Tree *treePtr,
- Node *nodePtr, /* Node to be updated. */
- Blt_TreeKey key, /* Identifies the field key. */
- Tcl_Obj *valueObjPtr) /* New value of field. */
-{
- TreeObject *corePtr = nodePtr->corePtr;
- Value *valuePtr;
- int isNew;
- unsigned int flags;
-
- if (valueObjPtr == NULL) {
- return Blt_Tree_UnsetValueByKey(interp, treePtr, nodePtr, key);
- }
- valuePtr = TreeCreateValue(nodePtr, key, &isNew);
- if ((valuePtr->owner != NULL) && (valuePtr->owner != treePtr)) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't set private field \"",
- key, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (valueObjPtr != valuePtr->objPtr) {
- Tcl_IncrRefCount(valueObjPtr);
- if (valuePtr->objPtr != NULL) {
- Tcl_DecrRefCount(valuePtr->objPtr);
- }
- valuePtr->objPtr = valueObjPtr;
- }
- flags = TREE_TRACE_WRITE;
- if (isNew) {
- flags |= TREE_TRACE_CREATE;
- }
- if (!(nodePtr->flags & TREE_TRACE_ACTIVE)) {
- CallTraces(interp, treePtr, corePtr, nodePtr, valuePtr->key, flags);
- }
- return TCL_OK;
-}
-
-int
-Blt_Tree_UnsetValueByKey(
- Tcl_Interp *interp,
- Tree *treePtr,
- Node *nodePtr, /* Node to be updated. */
- Blt_TreeKey key) /* Name of field in node. */
-{
- TreeObject *corePtr = nodePtr->corePtr;
- Value *valuePtr;
-
- valuePtr = TreeFindValue(nodePtr, key);
- if (valuePtr == NULL) {
- return TCL_OK; /* It's okay to unset values that don't exist
- * in the node. */
- }
- if ((valuePtr->owner != NULL) && (valuePtr->owner != treePtr)) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't unset private field \"",
- key, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- TreeDeleteValue(nodePtr, valuePtr);
- CallTraces(interp, treePtr, corePtr, nodePtr, key, TREE_TRACE_UNSET);
- return TCL_OK;
-}
-
-static int
-ParseParentheses(Tcl_Interp *interp, const char *string,
- char **leftPtr, char **rightPtr)
-{
- char *p;
- char *left, *right;
-
- left = right = NULL;
- for (p = (char *)string; *p != '\0'; p++) {
- if (*p == '(') {
- left = p;
- } else if (*p == ')') {
- right = p;
- }
- }
- if (left != right) {
- if (((left != NULL) && (right == NULL)) ||
- ((left == NULL) && (right != NULL)) ||
- (left > right) || (right != (p - 1))) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "bad array specification \"", string,
- "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- }
- *leftPtr = left;
- *rightPtr = right;
- return TCL_OK;
-}
-
-static Tree *
-NewTree(TreeInterpData *dataPtr, TreeObject *corePtr, const char *qualName)
-{
- Tree *treePtr;
- int isNew;
-
- treePtr = Blt_Calloc(1, sizeof(Tree));
- if (treePtr == NULL) {
- return NULL;
- }
-
- treePtr->magic = TREE_MAGIC;
- treePtr->interp = dataPtr->interp;
- /* Add client to table object's list of clients. */
- treePtr->link = Blt_Chain_Append(corePtr->clients, treePtr);
- treePtr->corePtr = corePtr;
- treePtr->root = corePtr->root;
-
- /* By default, use own sets of tags. */
- Blt_Tree_NewTagTable(treePtr);
-
- treePtr->hPtr = Blt_CreateHashEntry(&dataPtr->treeTable, qualName, &isNew);
- Blt_SetHashValue(treePtr->hPtr, treePtr);
- treePtr->name = Blt_GetHashKey(&dataPtr->treeTable, treePtr->hPtr);
- treePtr->events = Blt_Chain_Create();
- treePtr->traces = Blt_Chain_Create();
- return treePtr;
-}
-
-static const char *
-MakeTreeName(TreeInterpData *dataPtr, char *string)
-{
- /* Generate a unique tree name in the current namespace. */
- do {
- sprintf_s(string, 200, "tree%d", dataPtr->nextId++);
- } while (GetTree(dataPtr, string, NS_SEARCH_CURRENT) != NULL);
- return string;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShareTagTable --
- *
- *---------------------------------------------------------------------------
- */
-static void
-ShareTagTable(Tree *sourcePtr, Tree *targetPtr)
-{
- sourcePtr->tagTablePtr->refCount++;
- if (targetPtr->tagTablePtr != NULL) {
- ReleaseTagTable(targetPtr->tagTablePtr);
- }
- targetPtr->tagTablePtr = sourcePtr->tagTablePtr;
-}
-
-int
-Blt_Tree_GetValue(
- Tcl_Interp *interp,
- Tree *treePtr,
- Node *nodePtr,
- const char *string, /* String identifying the field in node. */
- Tcl_Obj **valueObjPtrPtr)
-{
- char *left, *right;
- int result;
-
- if (ParseParentheses(interp, string, &left, &right) != TCL_OK) {
- return TCL_ERROR;
- }
- if (left != NULL) {
- *left = *right = '\0';
- result = Blt_Tree_GetArrayValue(interp, treePtr, nodePtr, string,
- left + 1, valueObjPtrPtr);
- *left = '(', *right = ')';
- } else {
- result = Blt_Tree_GetValueByKey(interp, treePtr, nodePtr,
- Blt_Tree_GetKey(treePtr, string), valueObjPtrPtr);
- }
- return result;
-}
-
-int
-Blt_Tree_SetValue(
- Tcl_Interp *interp,
- Tree *treePtr,
- Node *nodePtr, /* Node to be updated. */
- const char *string, /* String identifying the field in node. */
- Tcl_Obj *valueObjPtr) /* New value of field. If NULL, field is
- * deleted. */
-{
- char *left, *right;
- int result;
-
- if (ParseParentheses(interp, string, &left, &right) != TCL_OK) {
- return TCL_ERROR;
- }
- if (left != NULL) {
- *left = *right = '\0';
- result = Blt_Tree_SetArrayValue(interp, treePtr, nodePtr, string,
- left + 1, valueObjPtr);
- *left = '(', *right = ')';
- } else {
- result = Blt_Tree_SetValueByKey(interp, treePtr, nodePtr,
- Blt_Tree_GetKey(treePtr, string), valueObjPtr);
- }
- return result;
-}
-
-int
-Blt_Tree_UnsetValue(
- Tcl_Interp *interp,
- Tree *treePtr,
- Node *nodePtr, /* Node to be updated. */
- const char *string) /* String identifying the field in node. */
-{
- char *left, *right;
- int result;
-
- if (ParseParentheses(interp, string, &left, &right) != TCL_OK) {
- return TCL_ERROR;
- }
- if (left != NULL) {
- *left = *right = '\0';
- result = Blt_Tree_UnsetArrayValue(interp, treePtr, nodePtr, string,
- left + 1);
- *left = '(', *right = ')';
- } else {
- result = Blt_Tree_UnsetValueByKey(interp, treePtr, nodePtr,
- Blt_Tree_GetKey(treePtr, string));
- }
- return result;
-}
-
-int
-Blt_Tree_ValueExists(Tree *treePtr, Node *nodePtr, const char *string)
-{
- char *left, *right;
- int result;
-
- if (ParseParentheses((Tcl_Interp *)NULL, string, &left, &right) != TCL_OK) {
- return FALSE;
- }
- if (left != NULL) {
- *left = *right = '\0';
- result = Blt_Tree_ArrayValueExists(treePtr, nodePtr, string, left + 1);
- *left = '(', *right = ')';
- } else {
- result = Blt_Tree_ValueExistsByKey(treePtr, nodePtr,
- Blt_Tree_GetKey(treePtr, string));
- }
- return result;
-}
-
-Blt_TreeKey
-Blt_Tree_FirstKey(Tree *treePtr, Node *nodePtr, Blt_TreeKeyIterator *iterPtr)
-{
- Value *valuePtr;
-
- valuePtr = TreeFirstValue(nodePtr, iterPtr);
- if (valuePtr == NULL) {
- return NULL;
- }
- while ((valuePtr->owner != NULL) && (valuePtr->owner != treePtr)) {
- valuePtr = TreeNextValue(iterPtr);
- if (valuePtr == NULL) {
- return NULL;
- }
- }
- return valuePtr->key;
-}
-
-Blt_TreeKey
-Blt_Tree_NextKey(Tree *treePtr, Blt_TreeKeyIterator *iterPtr)
-{
- Value *valuePtr;
-
- valuePtr = TreeNextValue(iterPtr);
- if (valuePtr == NULL) {
- return NULL;
- }
- while ((valuePtr->owner != NULL) && (valuePtr->owner != treePtr)) {
- valuePtr = TreeNextValue(iterPtr);
- if (valuePtr == NULL) {
- return NULL;
- }
- }
- return valuePtr->key;
-}
-
-int
-Blt_Tree_IsAncestor(Node *n1Ptr, Node *n2Ptr)
-{
- if (n2Ptr != NULL) {
- n2Ptr = n2Ptr->parent;
- while (n2Ptr != NULL) {
- if (n2Ptr == n1Ptr) {
- return TRUE;
- }
- n2Ptr = n2Ptr->parent;
- }
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_SortNode --
- *
- * Sorts the subnodes at a given node.
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Tree_SortNode(Tree *treePtr, Node *nodePtr, Blt_TreeCompareNodesProc *proc)
-{
- Node **nodes;
- int nNodes;
- Node *np, **npp;
-
- nNodes = nodePtr->nChildren;
- if (nNodes < 2) {
- return TCL_OK;
- }
- nodes = Blt_Malloc((nNodes + 1) * sizeof(Node *));
- if (nodes == NULL) {
- return TCL_ERROR; /* Out of memory. */
- }
- for (npp = nodes, np = nodePtr->first; np != NULL; np = np->next, npp++) {
- *npp = np;
- }
- *npp = NULL;
-
- qsort(nodes, nNodes, sizeof(Node *), (QSortCompareProc *)proc);
- for (npp = nodes; *npp != NULL; npp++) {
- UnlinkNode(*npp);
- LinkBefore(nodePtr, *npp, (Blt_TreeNode)NULL);
- }
- Blt_Free(nodes);
- NotifyClients(treePtr, nodePtr->corePtr, nodePtr, TREE_NOTIFY_SORT);
- return TCL_OK;
-}
-
-#define TEST_RESULT(result) \
- switch (result) { \
- case TCL_CONTINUE: \
- return TCL_OK; \
- case TCL_OK: \
- break; \
- default: \
- return (result); \
- }
-
-int
-Blt_Tree_Apply(
- Node *branchPtr, /* Root node of subtree. */
- Blt_TreeApplyProc *proc, /* Procedure to call for each node. */
- ClientData clientData) /* One-word of data passed when calling
- * proc. */
-{
- Node *np, *nextPtr;
-
- for (np = branchPtr->first; np != NULL; np = nextPtr) {
- int result;
-
- /*
- * Get the next link in the chain before calling Blt_TreeApply
- * recursively. This is because the apply callback may delete the
- * node and its link.
- */
- nextPtr = np->next;
-
- result = Blt_Tree_Apply(np, proc, clientData);
- TEST_RESULT(result);
- }
- return (*proc) (branchPtr, clientData, TREE_POSTORDER);
-}
-
-int
-Blt_Tree_ApplyDFS(
- Node *branchPtr, /* Root node of subtree. */
- Blt_TreeApplyProc *proc, /* Procedure to call for each node. */
- ClientData clientData, /* One-word of data passed when calling
- * proc. */
- int order) /* Order of traversal. */
-{
- Node *nodePtr, *nextPtr;
- int result;
-
- if (order & TREE_PREORDER) {
- result = (*proc) (branchPtr, clientData, TREE_PREORDER);
- TEST_RESULT(result);
- }
- nodePtr = branchPtr->first;
- if (order & TREE_INORDER) {
- if (nodePtr != NULL) {
- result = Blt_Tree_ApplyDFS(nodePtr, proc, clientData, order);
- TEST_RESULT(result);
- nodePtr = nodePtr->next;
- }
- result = (*proc) (branchPtr, clientData, TREE_INORDER);
- TEST_RESULT(result);
- }
- for (/* empty */; nodePtr != NULL; nodePtr = nextPtr) {
- /*
- * Get the next link in the chain before calling Blt_Tree_Apply
- * recursively. This is because the apply callback may delete the
- * node and its link.
- */
- nextPtr = nodePtr->next;
- result = Blt_Tree_ApplyDFS(nodePtr, proc, clientData, order);
- TEST_RESULT(result);
- }
- if (order & TREE_POSTORDER) {
- return (*proc) (branchPtr, clientData, TREE_POSTORDER);
- }
- return TCL_OK;
-}
-
-int
-Blt_Tree_ApplyBFS(
- Node *branchPtr, /* Root node of subtree. */
- Blt_TreeApplyProc *proc, /* Procedure to call for each node. */
- ClientData clientData) /* One-word of data passed when calling
- * proc. */
-{
- Blt_Chain queue;
- Blt_ChainLink link, next;
- Node *nodePtr;
- int result;
-
- queue = Blt_Chain_Create();
- link = Blt_Chain_Append(queue, branchPtr);
- while (link != NULL) {
- Node *np;
-
- nodePtr = Blt_Chain_GetValue(link);
- /* Add the children to the queue. */
- for (np = nodePtr->first; np != NULL; np = np->next) {
- Blt_Chain_Append(queue, np);
- }
- /* Process the node. */
- result = (*proc) (nodePtr, clientData, TREE_BREADTHFIRST);
- switch (result) {
- case TCL_CONTINUE:
- Blt_Chain_Destroy(queue);
- return TCL_OK;
- case TCL_OK:
- break;
- default:
- Blt_Chain_Destroy(queue);
- return result;
- }
- /* Remove the node from the queue. */
- next = Blt_Chain_NextLink(link);
- Blt_Chain_DeleteLink(queue, link);
- link = next;
- }
- Blt_Chain_Destroy(queue);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_Attach --
- *
- * Attaches the tree object of the named tree to the current one. This
- * lets a tree client change its core tree object. If the name of the
- * tree (used to get the tree object) is the empty string (""), then
- * create a new tree object.
- *
- * Results:
- * Returns a standard TCL result. If an error occurs, TCL_ERROR is
- * returned and an error message if left in the interpreter result.
- *
- * Side Effects:
- * The tree's traces and notifiers are deactivated and removed. The
- * tree's old core tree object is released. This may destroy the old
- * tree object is no client is still using it. The tag table is also
- * reset or shared with the named client.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Tree_Attach(Tcl_Interp *interp, Tree *treePtr, const char *name)
-{
- TreeObject *corePtr;
- Blt_ChainLink link;
- TreeInterpData *dataPtr;
-
- dataPtr = treePtr->corePtr->dataPtr;
- if (name[0] == '\0') {
- /* Create a new tree object. */
- corePtr = NewTreeObject(dataPtr);
- if (corePtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate a new tree object.",
- (char *)NULL);
- return TCL_ERROR;
- }
- } else {
- Tree *newPtr;
-
- newPtr = GetTree(dataPtr, name, NS_SEARCH_BOTH);
- if ((newPtr == NULL) || (newPtr->corePtr == NULL)) {
- Tcl_AppendResult(interp, "can't find a tree named \"", name, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- corePtr = newPtr->corePtr;
- ShareTagTable(newPtr, treePtr);
- }
- /*
- * Be sure to add the client to new tree object, before releasing the old
- * tree object. This is so that reattaching to the same tree object
- * doesn't delete the tree object.
- */
- link = Blt_Chain_Append(corePtr->clients, treePtr);
- ReleaseTreeObject(treePtr);
- ResetTree(treePtr); /* Reset the client's traces and notifiers. */
- /* Update pointers in the client. */
- treePtr->link = link;
- treePtr->corePtr = corePtr;
- treePtr->root = corePtr->root;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_Open --
- *
- * Creates a tree using an existing or new tree object. The returned
- * tree must be freed by the caller using Blt_Tree_Close. If the name of
- * the tree (used to get the tree object) is the empty string (""), then
- * create a new tree object. The following flags may be used:
- *
- * TREE_CREATE Create a tree named "name". A new tree object is
- * automatically created. If the "name" is NULL, then
- * automatically generate a new name.
- *
- * TREE_ATTACH Create a tree and use the tree object from an
- * existing tree given by "name". By default
- * the tag table is shared.
- *
- * TREE_NEWTAGS By default the tag table is shared. This flag
- * indicates to not share tags and to start with an
- * empty tag table.
- *
- * Results:
- * Returns a standard TCL result. If an error occurs, TCL_ERROR
- * is returned and an error message if left in the interpreter result.
- *
- * Side Effects:
- * The tree's traces and notifiers are deactivated and removed. The
- * tree's old core tree object is release. This may destroy the tree
- * object is no client is still using it. The tag table is also reset or
- * shared with the named client.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Tree
-Blt_Tree_Open(
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- const char *name, /* Name of tree in namespace. */
- int flags) /* TREE_ATTACH|TREE_NEWTAGS */
-{
- Blt_ObjectName objName;
- Tree *srcPtr, *destPtr;
- TreeObject *corePtr;
- Tcl_DString ds;
- TreeInterpData *dataPtr;
- const char *qualName;
- char string[200];
-
- dataPtr = Blt_Tree_GetInterpData(interp);
- srcPtr = NULL;
- /* If there's a name available, see it's a tree. */
- if (name != NULL) {
- srcPtr = GetTree(dataPtr, name, NS_SEARCH_BOTH);
- } else if ((flags & TREE_CREATE) == 0) {
- Tcl_AppendResult(interp, "no tree name given to attach", (char *)NULL);
- return NULL;
- }
- /* Either create a core tree object or use the one from the named tree.*/
- if (flags & TREE_CREATE) {
- if (srcPtr != NULL) {
- Tcl_AppendResult(interp, "tree \"", name, "\" already exists",
- (char *)NULL);
- return NULL;
- }
- corePtr = NewTreeObject(dataPtr);
- if (corePtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate tree object.",
- (char *)NULL);
- return NULL;
- }
- } else {
- if ((srcPtr == NULL) || (srcPtr->corePtr == NULL)) {
- Tcl_AppendResult(interp, "can't find a tree named \"", name, "\"",
- (char *)NULL);
- return NULL;
- }
- corePtr = srcPtr->corePtr;
- }
- /* Generate a new tree name if one wasn't already provided. */
- if (name == NULL) {
- name = MakeTreeName(dataPtr, string);
- }
- /*
- * Tear apart and put back together the namespace-qualified name of the
- * tree. This is to ensure that naming is consistent.
- */
- if (!Blt_ParseObjectName(interp, name, &objName, 0)) {
- return NULL;
- }
- qualName = Blt_MakeQualifiedName(&objName, &ds);
- destPtr = NewTree(dataPtr, corePtr, qualName);
- Tcl_DStringFree(&ds);
- if (destPtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate tree token", (char *)NULL);
- return NULL;
- }
- if (((flags & TREE_NEWTAGS) == 0) && (srcPtr != NULL)) {
- ShareTagTable(srcPtr, destPtr);
- }
- return destPtr;
-}
-
-void
-Blt_Tree_Close(Tree *treePtr)
-{
- if (treePtr->magic != TREE_MAGIC) {
- fprintf(stderr, "invalid tree object token 0x%lx\n",
- (unsigned long)treePtr);
- return;
- }
- DestroyTree(treePtr);
-}
-
-int
-Blt_Tree_Exists(Tcl_Interp *interp, const char *name)
-{
- TreeInterpData *dataPtr;
-
- dataPtr = Blt_Tree_GetInterpData(interp);
- return (GetTree(dataPtr, name, NS_SEARCH_BOTH) != NULL);
-}
-
-/*ARGSUSED*/
-static int
-SizeApplyProc(Node *nodePtr, ClientData clientData, int order)
-{
- int *sumPtr = clientData;
- *sumPtr = *sumPtr + 1;
- return TCL_OK;
-}
-
-int
-Blt_Tree_Size(Node *nodePtr)
-{
- int sum;
-
- sum = 0;
- Blt_Tree_Apply(nodePtr, SizeApplyProc, &sum);
- return sum;
-}
-
-
-void
-Blt_Tree_CreateEventHandler(Tree *treePtr, unsigned int mask,
- Blt_TreeNotifyEventProc *proc,
- ClientData clientData)
-{
- Blt_ChainLink link;
- NotifyEventHandler *notifyPtr;
-
- notifyPtr = NULL; /* Suppress compiler warning. */
-
- /* Check if the event is already handled. */
- for(link = Blt_Chain_FirstLink(treePtr->events);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- notifyPtr = Blt_Chain_GetValue(link);
- if ((notifyPtr->proc == proc) &&
- (notifyPtr->mask == mask) &&
- (notifyPtr->clientData == clientData)) {
- break;
- }
- }
- if (link == NULL) {
- notifyPtr = Blt_AssertMalloc(sizeof (NotifyEventHandler));
- link = Blt_Chain_Append(treePtr->events, notifyPtr);
- }
- if (proc == NULL) {
- Blt_Chain_DeleteLink(treePtr->events, link);
- Blt_Free(notifyPtr);
- } else {
- notifyPtr->proc = proc;
- notifyPtr->clientData = clientData;
- notifyPtr->mask = mask;
- notifyPtr->notifyPending = FALSE;
- notifyPtr->interp = treePtr->interp;
- }
-}
-
-void
-Blt_Tree_DeleteEventHandler(Tree *treePtr, unsigned int mask,
- Blt_TreeNotifyEventProc *proc,
- ClientData clientData)
-{
- Blt_ChainLink link;
-
- for(link = Blt_Chain_FirstLink(treePtr->events); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- NotifyEventHandler *notifyPtr;
-
- notifyPtr = Blt_Chain_GetValue(link);
- if ((notifyPtr->proc == proc) && (notifyPtr->mask == mask) &&
- (notifyPtr->clientData == clientData)) {
- if (notifyPtr->notifyPending) {
- Tcl_CancelIdleCall(NotifyIdleProc, notifyPtr);
- }
- Blt_Chain_DeleteLink(treePtr->events, link);
- Blt_Free(notifyPtr);
- return;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_PathFromNode --
- *
- *---------------------------------------------------------------------------
- */
-const char *
-Blt_Tree_NodeRelativePath(
- Node *rootPtr, /* Root of subtree. */
- Node *nodePtr, /* Node whose path is to be returned. */
- const char *separator, /* Character string to separator elements. */
- unsigned int flags, /* Indicates how to print the path. */
- Tcl_DString *dsPtr) /* (out) Contains the path of the node. */
-{
- const char **names; /* Used to stack the component names. */
- const char *staticSpace[64];
- long i;
- long nLevels;
-
- if (rootPtr == NULL) {
- rootPtr = nodePtr->corePtr->root;
- }
- nLevels = Blt_Tree_NodeDepth(nodePtr) - Blt_Tree_NodeDepth(rootPtr);
- if (flags & TREE_INCLUDE_ROOT) {
- nLevels++;
- }
- if (nLevels > 64) {
- names = Blt_AssertMalloc(nLevels * sizeof(const char *));
- } else {
- names = staticSpace;
- }
- for (i = nLevels; i > 0; i--) {
- /* Save the name of each ancestor in the name array. Note that we
- * ignore the root. */
- names[i - 1] = nodePtr->label;
- nodePtr = nodePtr->parent;
- }
- /* Append each the names in the array. */
- if ((nLevels > 0) && (separator != NULL)) {
- Tcl_DStringAppend(dsPtr, names[0], -1);
- for (i = 1; i < nLevels; i++) {
- Tcl_DStringAppend(dsPtr, separator, -1);
- Tcl_DStringAppend(dsPtr, names[i], -1);
- }
- } else {
- for (i = 0; i < nLevels; i++) {
- Tcl_DStringAppendElement(dsPtr, names[i]);
- }
- }
- if (names != staticSpace) {
- Blt_Free(names);
- }
- return Tcl_DStringValue(dsPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_NodePath --
- *
- *---------------------------------------------------------------------------
- */
-const char *
-Blt_Tree_NodePath(Node *nodePtr, Tcl_DString *dsPtr)
-{
- Blt_TreeNode root;
-
- root = nodePtr->corePtr->root;
- return Blt_Tree_NodeRelativePath(root, nodePtr, NULL, 0, dsPtr);
-}
-
-int
-Blt_Tree_ArrayValueExists(Tree *treePtr, Node *nodePtr, const char *arrayName,
- const char *elemName)
-{
- Blt_TreeKey key;
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
- Value *valuePtr;
-
- key = Blt_Tree_GetKey(treePtr, arrayName);
- valuePtr = GetTreeValue((Tcl_Interp *)NULL, treePtr, nodePtr, key);
- if (valuePtr == NULL) {
- return FALSE;
- }
- if (Tcl_IsShared(valuePtr->objPtr)) {
- Tcl_DecrRefCount(valuePtr->objPtr);
- valuePtr->objPtr = Tcl_DuplicateObj(valuePtr->objPtr);
- Tcl_IncrRefCount(valuePtr->objPtr);
- }
- if (Blt_GetArrayFromObj((Tcl_Interp *)NULL, valuePtr->objPtr, &tablePtr)
- != TCL_OK) {
- return FALSE;
- }
- hPtr = Blt_FindHashEntry(tablePtr, elemName);
- return (hPtr != NULL);
-}
-
-int
-Blt_Tree_GetArrayValue(Tcl_Interp *interp, Tree *treePtr, Node *nodePtr,
- const char *arrayName, const char *elemName,
- Tcl_Obj **valueObjPtrPtr)
-{
- Blt_TreeKey key;
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
- Value *valuePtr;
-
- key = Blt_Tree_GetKey(treePtr, arrayName);
- valuePtr = GetTreeValue(interp, treePtr, nodePtr, key);
- if (valuePtr == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_IsShared(valuePtr->objPtr)) {
- Tcl_DecrRefCount(valuePtr->objPtr);
- valuePtr->objPtr = Tcl_DuplicateObj(valuePtr->objPtr);
- Tcl_IncrRefCount(valuePtr->objPtr);
- }
- if (Blt_GetArrayFromObj(interp, valuePtr->objPtr, &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- hPtr = Blt_FindHashEntry(tablePtr, elemName);
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find \"", arrayName, "(",
- elemName, ")\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- *valueObjPtrPtr = Blt_GetHashValue(hPtr);
-
- /* Reading any element of the array can cause a trace to fire. */
- if (!(nodePtr->flags & TREE_TRACE_ACTIVE)) {
- CallTraces(interp, treePtr, nodePtr->corePtr, nodePtr, key,
- TREE_TRACE_READ);
- }
- return TCL_OK;
-}
-
-int
-Blt_Tree_SetArrayValue(Tcl_Interp *interp, Tree *treePtr, Node *nodePtr,
- const char *arrayName, const char *elemName,
- Tcl_Obj *valueObjPtr)
-{
- Blt_TreeKey key;
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
- Value *valuePtr;
- unsigned int flags;
- int isNew;
-
- assert(valueObjPtr != NULL);
-
- /*
- * Search for the array in the list of data fields. If one doesn't exist,
- * create it.
- */
- key = Blt_Tree_GetKey(treePtr, arrayName);
- valuePtr = TreeCreateValue(nodePtr, key, &isNew);
- if ((valuePtr->owner != NULL) && (valuePtr->owner != treePtr)) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't set private field \"",
- key, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- flags = TREE_TRACE_WRITE;
- if (isNew) {
- valuePtr->objPtr = Blt_NewArrayObj(0, (Tcl_Obj **)NULL);
- Tcl_IncrRefCount(valuePtr->objPtr);
- flags |= TREE_TRACE_CREATE;
- } else if (Tcl_IsShared(valuePtr->objPtr)) {
- Tcl_DecrRefCount(valuePtr->objPtr);
- valuePtr->objPtr = Tcl_DuplicateObj(valuePtr->objPtr);
- Tcl_IncrRefCount(valuePtr->objPtr);
- }
- if (Blt_GetArrayFromObj(interp, valuePtr->objPtr, &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_InvalidateStringRep(valuePtr->objPtr);
- hPtr = Blt_CreateHashEntry(tablePtr, elemName, &isNew);
- Tcl_IncrRefCount(valueObjPtr);
- if (!isNew) {
- Tcl_Obj *oldValueObjPtr;
-
- /* An element by the same name already exists. Decrement the reference
- * count of the old value. */
-
- oldValueObjPtr = Blt_GetHashValue(hPtr);
- if (oldValueObjPtr != NULL) {
- Tcl_DecrRefCount(oldValueObjPtr);
- }
- }
- Blt_SetHashValue(hPtr, valueObjPtr);
-
- /*
- * We don't handle traces on a per array element basis. Setting any
- * element can fire traces for the value.
- */
- if (!(nodePtr->flags & TREE_TRACE_ACTIVE)) {
- CallTraces(interp, treePtr, nodePtr->corePtr, nodePtr,
- valuePtr->key, flags);
- }
- return TCL_OK;
-}
-
-int
-Blt_Tree_UnsetArrayValue(Tcl_Interp *interp, Tree *treePtr, Node *nodePtr,
- const char *arrayName, const char *elemName)
-{
- Blt_TreeKey key; /* Name of field in node. */
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
- Tcl_Obj *valueObjPtr;
- Value *valuePtr;
-
- key = Blt_Tree_GetKey(treePtr, arrayName);
- valuePtr = TreeFindValue(nodePtr, key);
- if (valuePtr == NULL) {
- return TCL_OK;
- }
- if ((valuePtr->owner != NULL) && (valuePtr->owner != treePtr)) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't unset private field \"",
- key, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- if (Tcl_IsShared(valuePtr->objPtr)) {
- Tcl_DecrRefCount(valuePtr->objPtr);
- valuePtr->objPtr = Tcl_DuplicateObj(valuePtr->objPtr);
- Tcl_IncrRefCount(valuePtr->objPtr);
- }
- if (Blt_GetArrayFromObj(interp, valuePtr->objPtr, &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- hPtr = Blt_FindHashEntry(tablePtr, elemName);
- if (hPtr == NULL) {
- return TCL_OK; /* Element doesn't exist, Ok. */
- }
- valueObjPtr = Blt_GetHashValue(hPtr);
- Tcl_DecrRefCount(valueObjPtr);
- Blt_DeleteHashEntry(tablePtr, hPtr);
-
- /*
- * Un-setting any element in the array can cause the trace on the value to
- * fire.
- */
- if (!(nodePtr->flags & TREE_TRACE_ACTIVE)) {
- CallTraces(interp, treePtr, nodePtr->corePtr, nodePtr,
- valuePtr->key, TREE_TRACE_WRITE);
- }
- return TCL_OK;
-}
-
-int
-Blt_Tree_ArrayNames(Tcl_Interp *interp, Tree *treePtr, Node *nodePtr,
- const char *arrayName, Tcl_Obj *listObjPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Blt_HashTable *tablePtr;
- Value *valuePtr;
- const char *key;
-
- key = Blt_Tree_GetKey(treePtr, arrayName);
- valuePtr = GetTreeValue(interp, treePtr, nodePtr, key);
- if (valuePtr == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_IsShared(valuePtr->objPtr)) {
- Tcl_DecrRefCount(valuePtr->objPtr);
- valuePtr->objPtr = Tcl_DuplicateObj(valuePtr->objPtr);
- Tcl_IncrRefCount(valuePtr->objPtr);
- }
- if (Blt_GetArrayFromObj(interp, valuePtr->objPtr, &tablePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- tablePtr = (Blt_HashTable *)valuePtr->objPtr;
- for (hPtr = Blt_FirstHashEntry(tablePtr, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(Blt_GetHashKey(tablePtr, hPtr), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- return TCL_OK;
-}
-
-void
-Blt_Tree_NewTagTable(Tree *treePtr)
-{
- Blt_TreeTagTable *tagTablePtr;
-
- if (treePtr->tagTablePtr != NULL) {
- ReleaseTagTable(treePtr->tagTablePtr);
- }
- /* By default, use own sets of tags. */
- tagTablePtr = Blt_AssertMalloc(sizeof(Blt_TreeTagTable));
- tagTablePtr->refCount = 1;
- Blt_InitHashTable(&tagTablePtr->tagTable, BLT_STRING_KEYS);
- treePtr->tagTablePtr = tagTablePtr;
-}
-
-int
-Blt_Tree_TagTableIsShared(Tree *treePtr)
-{
- return (treePtr->tagTablePtr->refCount > 1);
-}
-
-void
-Blt_Tree_ClearTags(Tree *treePtr, Node *nodePtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&treePtr->tagTablePtr->tagTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_TreeTagEntry *tePtr;
- Blt_HashEntry *h2Ptr;
-
- tePtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(&tePtr->nodeTable, (char *)nodePtr);
- if (h2Ptr != NULL) {
- Blt_DeleteHashEntry(&tePtr->nodeTable, h2Ptr);
- }
- }
-}
-
-Blt_TreeTagEntry *
-Blt_Tree_RememberTag(Tree *treePtr, const char *tagName)
-{
- int isNew;
- Blt_HashEntry *hPtr;
- Blt_TreeTagEntry *tePtr;
- Blt_HashTable *tablePtr;
-
- tablePtr = &treePtr->tagTablePtr->tagTable;
- hPtr = Blt_CreateHashEntry(tablePtr, tagName, &isNew);
- if (isNew) {
- tePtr = Blt_AssertMalloc(sizeof(Blt_TreeTagEntry));
- Blt_InitHashTable(&tePtr->nodeTable, BLT_ONE_WORD_KEYS);
- Blt_SetHashValue(hPtr, tePtr);
- tePtr->hashPtr = hPtr;
- tePtr->tagName = Blt_GetHashKey(tablePtr, hPtr);
- } else {
- tePtr = Blt_GetHashValue(hPtr);
- }
- return tePtr;
-}
-
-void
-Blt_Tree_ForgetTag(Tree *treePtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_TreeTagEntry *tePtr;
-
- if ((strcmp(tagName, "all") == 0) || (strcmp(tagName, "root") == 0)) {
- return;
- }
-
- hPtr = Blt_FindHashEntry(&treePtr->tagTablePtr->tagTable, tagName);
- if (hPtr == NULL) {
- return;
- }
- tePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashTable(&tePtr->nodeTable);
- Blt_Free(tePtr);
- Blt_DeleteHashEntry(&treePtr->tagTablePtr->tagTable, hPtr);
-}
-
-int
-Blt_Tree_HasTag(
- Tree *treePtr,
- Node *nodePtr,
- const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_TreeTagEntry *tePtr;
-
- if (strcmp(tagName, "all") == 0) {
- return TRUE;
- }
- if ((strcmp(tagName, "root") == 0) &&
- (nodePtr == Blt_Tree_RootNode(treePtr))) {
- return TRUE;
- }
- hPtr = Blt_FindHashEntry(&treePtr->tagTablePtr->tagTable, tagName);
- if (hPtr == NULL) {
- return FALSE;
- }
- tePtr = Blt_GetHashValue(hPtr);
- hPtr = Blt_FindHashEntry(&tePtr->nodeTable, (char *)nodePtr);
- if (hPtr == NULL) {
- return FALSE;
- }
- return TRUE;
-}
-
-void
-Blt_Tree_AddTag(Tree *treePtr, Node *nodePtr, const char *tagName)
-{
- Blt_TreeTagEntry *tePtr;
-
- if ((strcmp(tagName, "all") == 0) || (strcmp(tagName, "root") == 0)) {
- return;
- }
- tePtr = Blt_Tree_RememberTag(treePtr, tagName);
- if (nodePtr != NULL) {
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&tePtr->nodeTable, (char *)nodePtr, &isNew);
- if (isNew) {
- Blt_SetHashValue(hPtr, nodePtr);
- }
- }
-}
-
-void
-Blt_Tree_RemoveTag(Tree *treePtr, Node *nodePtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
- Blt_TreeTagEntry *tePtr;
-
- if (strcmp(tagName, "all") == 0) {
- return; /* Can't remove tag "all". */
- }
- if ((strcmp(tagName, "root") == 0) &&
- (nodePtr == Blt_Tree_RootNode(treePtr))) {
- return; /* Can't remove tag "root" from root node. */
- }
- hPtr = Blt_FindHashEntry(&treePtr->tagTablePtr->tagTable, tagName);
- if (hPtr == NULL) {
- return; /* No such tag. */
- }
- tePtr = Blt_GetHashValue(hPtr);
- hPtr = Blt_FindHashEntry(&tePtr->nodeTable, (char *)nodePtr);
- if (hPtr == NULL) {
- return; /* Node isn't tagged. */
- }
- Blt_DeleteHashEntry(&tePtr->nodeTable, hPtr);
- return;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_TagHashTable --
- *
- *---------------------------------------------------------------------------
- */
-Blt_HashTable *
-Blt_Tree_TagHashTable(Tree *treePtr, const char *tagName)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&treePtr->tagTablePtr->tagTable, tagName);
- if (hPtr != NULL) {
- Blt_TreeTagEntry *tePtr;
-
- tePtr = Blt_GetHashValue(hPtr);
- return &tePtr->nodeTable;
- }
- return NULL;
-}
-
-Blt_HashEntry *
-Blt_Tree_FirstTag(Tree *treePtr, Blt_HashSearch *cursorPtr)
-{
- return Blt_FirstHashEntry(&treePtr->tagTablePtr->tagTable, cursorPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_DumpNode --
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Tree_DumpNode(Tree *treePtr, Node *rootPtr, Node *nodePtr,
- Tcl_DString *dsPtr)
-{
- if (nodePtr == rootPtr) {
- Tcl_DStringAppendElement(dsPtr, "-1");
- } else {
- Tcl_DStringAppendElement(dsPtr,
- Blt_Tree_NodeIdAscii(nodePtr->parent));
- }
- Tcl_DStringAppendElement(dsPtr, Blt_Tree_NodeIdAscii(nodePtr));
-
- Tcl_DStringStartSublist(dsPtr);
- Blt_Tree_NodeRelativePath(rootPtr, nodePtr, NULL, TREE_INCLUDE_ROOT, dsPtr);
- Tcl_DStringEndSublist(dsPtr);
-
- Tcl_DStringStartSublist(dsPtr);
- {
- Blt_TreeKeyIterator iter;
- Blt_TreeKey key;
-
- /* Add list of key-value pairs. */
- for (key = Blt_Tree_FirstKey(treePtr, nodePtr, &iter); key != NULL;
- key = Blt_Tree_NextKey(treePtr, &iter)) {
- Tcl_Obj *objPtr;
-
- if (Blt_Tree_GetValueByKey((Tcl_Interp *)NULL, treePtr, nodePtr,
- key, &objPtr) == TCL_OK) {
- Tcl_DStringAppendElement(dsPtr, key);
- Tcl_DStringAppendElement(dsPtr, Tcl_GetString(objPtr));
- }
- }
- }
- Tcl_DStringEndSublist(dsPtr);
- Tcl_DStringStartSublist(dsPtr);
- {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- /* Add list of tags. */
- for (hPtr = Blt_Tree_FirstTag(treePtr, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_TreeTagEntry *tePtr;
-
- tePtr = Blt_GetHashValue(hPtr);
- if (Blt_FindHashEntry(&tePtr->nodeTable, (char *)nodePtr) != NULL) {
- Tcl_DStringAppendElement(dsPtr, tePtr->tagName);
- }
- }
- }
- Tcl_DStringEndSublist(dsPtr);
- Tcl_DStringAppend(dsPtr, "\n", -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_Dump --
- *
- * Dumps node information recursively from the given tree based starting
- * at *rootPtr*. The dump information is written to the TCL dynamic
- * string provided. It the caller's responsibility to initialize and free
- * the dynamic string.
- *
- * Results:
- * Always returns TCL_OK.
- *
- * Side Effects:
- * Dump information is written to the dynamic string provided.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Tree_Dump(Tree *treePtr, Node *rootPtr, Tcl_DString *dsPtr)
-{
- Node *np;
-
- for (np = rootPtr; np != NULL; np = Blt_Tree_NextNode(rootPtr, np)) {
- Blt_Tree_DumpNode(treePtr, rootPtr, np, dsPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_DumpToFile --
- *
- * Dumps node information recursively from the given tree based starting
- * at *rootPtr*. The dump information is written to the file named. If
- * the file name starts with an '@', then it is the name of an already
- * opened channel to be used.
- *
- * Results:
- * A standard TCL result. If the dump was successful, TCL_OK is
- * returned. Otherwise, TCL_ERROR is returned and an error message is
- * left in the interpreter result.
- *
- * Side Effects:
- * Dump information is written to the named file.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Tree_DumpToFile(
- Tcl_Interp *interp,
- Tree *treePtr,
- Node *rootPtr, /* Root node of subtree. */
- const char *fileName)
-{
- Tcl_Channel channel;
- Node *np;
- Tcl_DString ds;
- int closeChannel;
-
- closeChannel = TRUE;
- if ((fileName[0] == '@') && (fileName[1] != '\0')) {
- int mode;
-
- channel = Tcl_GetChannel(interp, fileName+1, &mode);
- if (channel == NULL) {
- return TCL_ERROR;
- }
- if ((mode & TCL_WRITABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", fileName,
- "\" not opened for writing", (char *)NULL);
- return TCL_ERROR;
- }
- closeChannel = FALSE;
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "w", 0666);
- if (channel == NULL) {
- return TCL_ERROR;
- }
- }
- Tcl_DStringInit(&ds);
- for (np = rootPtr; np != NULL; np = Blt_Tree_NextNode(rootPtr, np)) {
- int nWritten, length;
-
- Tcl_DStringSetLength(&ds, 0);
- Blt_Tree_DumpNode(treePtr, rootPtr, np, &ds);
- length = Tcl_DStringLength(&ds);
-#if HAVE_UTF
- nWritten = Tcl_WriteChars(channel, Tcl_DStringValue(&ds), length);
-#else
- nWritten = Tcl_Write(channel, Tcl_DStringValue(&ds), length);
-#endif
- if (nWritten < 0) {
- Tcl_AppendResult(interp, fileName, ": write error:",
- Tcl_PosixError(interp), (char *)NULL);
- Tcl_DStringFree(&ds);
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- return TCL_ERROR;
- }
- }
- Tcl_DStringFree(&ds);
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_RestoreFromFile --
- *
- * Restores nodes to the given tree based upon the dump file
- * provided. The dump file should have been generated by Blt_Tree_Dump or
- * Blt_Tree_DumpToFile. If the file name starts with an '@', then it is
- * the name of an already opened channel to be used. Nodes are added
- * relative to the node *rootPtr* as the root of the sub-tree. Two bit
- * flags may be set.
- *
- * TREE_RESTORE_NO_TAGS Don't restore tag information.
- * TREE_RESTORE_OVERWRITE Look for nodes with the same label.
- * Overwrite if necessary.
- *
- * Results:
- * A standard TCL result. If the restore was successful, TCL_OK is
- * returned. Otherwise, TCL_ERROR is returned and an error message is
- * left in the interpreter result.
- *
- * Side Effects:
- * New nodes are created in the tree and may possibly generate notify
- * callbacks.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Tree_RestoreFromFile(
- Tcl_Interp *interp,
- Tree *treePtr,
- Node *rootPtr, /* Root node of branch to be restored. */
- const char *fileName,
- unsigned int flags)
-{
- Tcl_Channel channel;
- RestoreInfo restore;
- int argc;
- const char **argv;
- int closeChannel;
- int result;
-
- closeChannel = TRUE;
- if ((fileName[0] == '@') && (fileName[1] != '\0')) {
- int mode;
-
- channel = Tcl_GetChannel(interp, fileName+1, &mode);
- if (channel == NULL) {
- return TCL_ERROR;
- }
- if ((mode & TCL_READABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", fileName,
- "\" not opened for reading", (char *)NULL);
- return TCL_ERROR;
- }
- closeChannel = FALSE;
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "r", 0);
- if (channel == NULL) {
- return TCL_ERROR; /* Can't open dump file. */
- }
- }
- memset((char *)&restore, 0, sizeof(restore));
- Blt_InitHashTable(&restore.idTable, BLT_ONE_WORD_KEYS);
- Blt_InitHashTable(&restore.dataTable, BLT_STRING_KEYS);
- restore.rootPtr = rootPtr;
- restore.flags = flags;
- restore.treePtr = treePtr;
-
- argv = NULL;
- result = TCL_ERROR;
- for (;;) {
- result = ReadDumpRecord(interp, channel, &argc, &argv, &restore);
- if (result != TCL_OK) {
- break; /* Found error or EOF */
- }
- if (argc == 0) {
- result = TCL_OK; /* Do nothing. */
- } else if (argc == 3) {
- result = RestoreNode3(interp, argc, argv, &restore);
- } else if ((argc == 5) || (argc == 6)) {
- result = RestoreNode5(interp, argc, argv, &restore);
- } else {
- Tcl_AppendResult(interp, "line #", Blt_Itoa(restore.nLines),
- ": wrong # elements in restore entry", (char *)NULL);
- result = TCL_ERROR;
- }
- Blt_Free(argv);
- if (result != TCL_OK) {
- break;
- }
- }
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- Blt_DeleteHashTable(&restore.idTable);
- Blt_DeleteHashTable(&restore.dataTable);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Tree_Restore --
- *
- * Restores nodes to the given tree based upon the dump string. The dump
- * string should have been generated by Blt_Tree_Dump. Nodes are added
- * relative to the node *rootPtr* as the root of the sub-tree. Two bit
- * flags may be set.
- *
- * TREE_RESTORE_NO_TAGS Don't restore tag information.
- * TREE_RESTORE_OVERWRITE Look for nodes with the same label.
- * Overwrite if necessary.
- *
- * Results:
- * A standard TCL result. If the restore was successful, TCL_OK is
- * returned. Otherwise, TCL_ERROR is returned and an error message is
- * left in the interpreter result.
- *
- * Side Effects:
- * New nodes are created in the tree and may possibly generate
- * notify callbacks.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Tree_Restore(
- Tcl_Interp *interp,
- Tree *treePtr,
- Node *rootPtr, /* Root node of branch to be restored. */
- const char *string,
- unsigned int flags)
-{
- RestoreInfo restore;
- int result;
-
- memset((char *)&restore, 0, sizeof(restore));
- Blt_InitHashTable(&restore.idTable, BLT_ONE_WORD_KEYS);
- Blt_InitHashTable(&restore.dataTable, BLT_STRING_KEYS);
- restore.treePtr = treePtr;
- restore.rootPtr = rootPtr;
- restore.flags = flags;
- result = TCL_ERROR;
- for (;;) {
- const char **argv;
- int argc;
-
- result = ParseDumpRecord(interp, &string, &argc, &argv, &restore);
- if (result != TCL_OK) {
- break; /* Found error or EOF */
- }
- if (argc == 0) {
- result = TCL_OK; /* Do nothing. */
- } else if (argc == 3) {
- result = RestoreNode3(interp, argc, argv, &restore);
- } else if ((argc == 5) || (argc == 6)) {
- result = RestoreNode5(interp, argc, argv, &restore);
- } else {
- Tcl_AppendResult(interp, "line #", Blt_Itoa(restore.nLines),
- ": wrong # elements in restore entry", (char *)NULL);
- result = TCL_ERROR;
- }
- Blt_Free(argv);
- if (result != TCL_OK) {
- break;
- }
- }
- Blt_DeleteHashTable(&restore.idTable);
- Blt_DeleteHashTable(&restore.dataTable);
-
- /* result will be TCL_RETURN if successful, TCL_ERROR otherwise. */
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
diff --git a/blt3.0.1/src/bltTree.h b/blt3.0.1/src/bltTree.h
deleted file mode 100644
index 46fc089..0000000
--- a/blt3.0.1/src/bltTree.h
+++ /dev/null
@@ -1,502 +0,0 @@
-
-/*
- * bltTree.h --
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_TREE_H
-#define _BLT_TREE_H
-
-#include <bltChain.h>
-#include <bltHash.h>
-#include <bltPool.h>
-
-typedef struct _Blt_TreeSlink *Blt_TreeSlink;
-typedef struct _Blt_TreeNode *Blt_TreeNode;
-typedef struct _Blt_TreeObject *Blt_TreeObject;
-typedef struct _Blt_Tree *Blt_Tree;
-typedef struct _Blt_TreeTrace *Blt_TreeTrace;
-typedef struct _Blt_TreeValue *Blt_TreeValue;
-typedef struct _Blt_TreeTagEntry Blt_TreeTagEntry;
-typedef struct _Blt_TreeTagTable Blt_TreeTagTable;
-typedef struct _Blt_TreeInterpData Blt_TreeInterpData;
-
-typedef const char *Blt_TreeKey;
-
-#define TREE_CREATE (1<<0)
-#define TREE_NEWTAGS (1<<1)
-
-#define TREE_PREORDER (1<<0)
-#define TREE_POSTORDER (1<<1)
-#define TREE_INORDER (1<<2)
-#define TREE_BREADTHFIRST (1<<3)
-
-#define TREE_NODE_LINK (1<<0)
-
-#define TREE_TRACE_UNSET (1<<3)
-#define TREE_TRACE_WRITE (1<<4)
-#define TREE_TRACE_READ (1<<5)
-#define TREE_TRACE_CREATE (1<<6)
-#define TREE_TRACE_ALL \
- (TREE_TRACE_UNSET | TREE_TRACE_WRITE | TREE_TRACE_READ | TREE_TRACE_CREATE)
-#define TREE_TRACE_MASK (TREE_TRACE_ALL)
-
-#define TREE_TRACE_WHENIDLE (1<<8)
-#define TREE_TRACE_FOREIGN_ONLY (1<<9)
-#define TREE_TRACE_ACTIVE (1<<10)
-
-#define TREE_NOTIFY_CREATE (1<<0)
-#define TREE_NOTIFY_DELETE (1<<1)
-#define TREE_NOTIFY_MOVE (1<<2)
-#define TREE_NOTIFY_SORT (1<<3)
-#define TREE_NOTIFY_RELABEL (1<<4)
-#define TREE_NOTIFY_ALL \
- (TREE_NOTIFY_CREATE | TREE_NOTIFY_DELETE | TREE_NOTIFY_MOVE | \
- TREE_NOTIFY_SORT | TREE_NOTIFY_RELABEL)
-#define TREE_NOTIFY_MASK (TREE_NOTIFY_ALL)
-
-#define TREE_NOTIFY_WHENIDLE (1<<8)
-#define TREE_NOTIFY_FOREIGN_ONLY (1<<9)
-#define TREE_NOTIFY_ACTIVE (1<<10)
-
-#define TREE_RESTORE_NO_TAGS (1<<0)
-#define TREE_RESTORE_OVERWRITE (1<<1)
-
-#define TREE_INCLUDE_ROOT (1<<0)
-
-typedef struct {
- int type;
- Blt_Tree tree;
- long inode; /* Node of event */
- Blt_TreeNode node;
- Tcl_Interp *interp;
-} Blt_TreeNotifyEvent;
-
-typedef struct {
- Blt_TreeNode node; /* Node being searched. */
- unsigned long nextIndex; /* Index of next bucket to be enumerated after
- * present one. */
- Blt_TreeValue nextValue; /* Next entry to be enumerated in the the
- * current bucket. */
-} Blt_TreeKeyIterator;
-
-/*
- * Blt_TreeObject --
- *
- * Structure providing the internal representation of the tree object. A
- * tree is uniquely identified by a combination of its name and
- * originating namespace. Two trees in the same interpreter can have the
- * same names but must reside in different namespaces.
- *
- * The tree object represents a general-ordered tree of nodes. Each node
- * may contain a heterogeneous collection of data values. Each value is
- * identified by a field name and nodes do not need to contain the same
- * data fields. Data field names are saved as reference counted strings
- * and can be shared among nodes.
- *
- * The tree is threaded. Each node contains pointers to back its parents
- * to its next sibling.
- *
- * A tree object can be shared by several clients. When a client wants
- * to use a tree object, it is given a token that represents the tree.
- * The tree object uses the tokens to keep track of its clients. When
- * all clients have released their tokens the tree is automatically
- * destroyed.
- */
-
-struct _Blt_TreeObject {
- Blt_TreeNode root; /* Root of the entire tree. */
-
- const char *sortNodesCmd; /* TCL command to invoke to sort entries */
-
- Blt_Chain clients; /* List of clients using this tree */
-
- Blt_Pool nodePool;
- Blt_Pool valuePool;
-
- Blt_HashTable nodeTable; /* Table of node identifiers. Used to
- * search for a node pointer given an inode.*/
- Blt_TreeInterpData *dataPtr;
- long nextInode;
-
- long nNodes; /* Always counts root node. */
-
- long depth; /* Maximum depth of the tree. */
-
- unsigned int flags; /* Internal flags. See definitions below. */
- unsigned int notifyFlags; /* Notification flags. See definitions
- * below. */
-};
-
-/*
- * _Blt_TreeNode --
- *
- * Structure representing a node in a general ordered tree. Nodes are
- * identified by their index, or inode. Nodes also have names, but nodes
- * names are not unique and can be changed. Inodes are valid even if the
- * node is moved.
- *
- * Each node can contain a list of data fields. Fields are name-value
- * pairs. The values are represented by Tcl_Objs.
- *
- */
-struct _Blt_TreeNode {
- Blt_TreeNode parent; /* Parent node. If NULL, then this is the root
- node. */
- Blt_TreeNode next, prev; /* Next/previous sibling nodes. */
- Blt_TreeNode hnext; /* Next node in the hash bucket. */
-
- Blt_TreeKey label; /* Node label (doesn't have to be unique). */
- long inode; /* Serial number of the node. */
-
- Blt_TreeObject corePtr; /* Pointer back to the tree object that
- * contains this node. */
- size_t depth; /* The depth of this node in the tree. */
- size_t nChildren; /* # of children for this node. */
- Blt_TreeNode first, last; /* First/last nodes of child nodes stored as a
- * linked list. */
- Blt_TreeNode *nodeTable; /* Hash table of child nodes. */
- size_t nodeTableSize2; /* Log2 size of child node hash table. */
-
- Blt_TreeValue values; /* Chain of Blt_TreeValue structures. Each
- * value structure contains a key/value data
- * pair. The data value is a Tcl_Obj. */
-
- Blt_TreeValue *valueTable; /* Hash table for values. When the number of
- * values reaches exceeds a threshold, values
- * will also be linked into this hash
- * table. */
-
- unsigned short nValues; /* # of values for this node. */
- unsigned short valueTableSize2; /* Size of hash table indicated as a power
- * of 2 (e.g. if logSize=3, then table size is
- * 8). If 0, this indicates that the node's
- * values are stored as a list. */
- unsigned int flags; /* Indicates if this node is currently used
- * within an active trace. */
-};
-
-struct _Blt_TreeTagEntry {
- const char *tagName;
- Blt_HashEntry *hashPtr;
- Blt_HashTable nodeTable;
-};
-
-struct _Blt_TreeTagTable {
- Blt_HashTable tagTable;
- int refCount;
-};
-
-/*
- * _Blt_Tree --
- *
- * A tree may be shared by several clients. Each client allocates this
- * structure which acts as a ticket for using the tree. Each client can
- *
- * - Designate notifier routines that are automatically invoked by the
- * tree object when nodes are created, deleted, moved, etc. by other
- * clients.
- * - Place traces on the values of specific nodes.
- * - Manage its own set or common of tags for nodes of the tree. By
- * default, clients share tags.
- */
-
-struct _Blt_Tree {
- unsigned int magic; /* Magic value indicating whether a generic
- * pointer is really a datatable token or
- * not. */
- const char *name; /* Fully namespace-qualified name of the
- * client. */
- Blt_TreeObject corePtr; /* Pointer to the structure containing the
- * master information about the tree used by
- * the client. If NULL, this indicates that
- * the tree has been destroyed (but as of yet,
- * this client hasn't recognized it). */
- Tcl_Interp *interp; /* Interpreter associated with this tree. */
-
- Blt_HashEntry *hPtr; /* This client's entry in the above
- * table. This is a list of clients that all
- * have the same qualified table name
- * (i.e. are sharing the same table. */
-
- Blt_ChainLink link; /* Pointer to this link in the server's chain
- * of clients. */
-
- Blt_Chain events; /* Chain of node event handlers. */
- Blt_Chain traces; /* Chain of data field callbacks. */
- Blt_TreeNode root; /* Designated root for this client */
- Blt_TreeTagTable *tagTablePtr; /* Tag table used by this client. */
-};
-
-
-typedef int (Blt_TreeNotifyEventProc)(ClientData clientData,
- Blt_TreeNotifyEvent *eventPtr);
-
-typedef int (Blt_TreeTraceProc)(ClientData clientData, Tcl_Interp *interp,
- Blt_TreeNode node, Blt_TreeKey key, unsigned int flags);
-
-typedef int (Blt_TreeEnumProc)(Blt_TreeNode node, Blt_TreeKey key,
- Tcl_Obj *valuePtr);
-
-typedef int (Blt_TreeCompareNodesProc)(Blt_TreeNode *n1Ptr,
- Blt_TreeNode *n2Ptr);
-
-typedef int (Blt_TreeApplyProc) _ANSI_ARGS_((Blt_TreeNode node,
- ClientData clientData, int order));
-
-struct _Blt_TreeTrace {
- ClientData clientData;
- Blt_TreeKey key;
- Blt_TreeNode node;
- unsigned int mask;
- Blt_TreeTraceProc *proc;
-};
-
-/*
- * Structure definition for information used to keep track of searches through
- * hash tables:
- */
-struct _Blt_TreeKeyIterator {
- Blt_TreeNode node; /* Table being searched. */
- unsigned long nextIndex; /* Index of next bucket to be enumerated after
- * present one. */
- Blt_TreeValue nextValue; /* Next entry to be enumerated in the the
- * current bucket. */
-};
-
-BLT_EXTERN Blt_TreeKey Blt_Tree_GetKey(Blt_Tree tree, const char *string);
-BLT_EXTERN Blt_TreeKey Blt_Tree_GetKeyFromNode(Blt_TreeNode node,
- const char *string);
-BLT_EXTERN Blt_TreeKey Blt_Tree_GetKeyFromInterp(Tcl_Interp *interp,
- const char *string);
-
-BLT_EXTERN Blt_TreeNode Blt_Tree_CreateNode(Blt_Tree tree, Blt_TreeNode parent,
- const char *name, long position);
-
-BLT_EXTERN Blt_TreeNode Blt_Tree_CreateNodeWithId(Blt_Tree tree,
- Blt_TreeNode parent, const char *name, long inode, long position);
-
-BLT_EXTERN int Blt_Tree_DeleteNode(Blt_Tree tree, Blt_TreeNode node);
-
-BLT_EXTERN int Blt_Tree_MoveNode(Blt_Tree tree, Blt_TreeNode node,
- Blt_TreeNode parent, Blt_TreeNode before);
-
-BLT_EXTERN Blt_TreeNode Blt_Tree_GetNode(Blt_Tree tree, long inode);
-
-BLT_EXTERN Blt_TreeNode Blt_Tree_FindChild(Blt_TreeNode parent,
- const char *name);
-
-BLT_EXTERN Blt_TreeNode Blt_Tree_NextNode(Blt_TreeNode root, Blt_TreeNode node);
-
-BLT_EXTERN Blt_TreeNode Blt_Tree_PrevNode(Blt_TreeNode root, Blt_TreeNode node);
-
-BLT_EXTERN Blt_TreeNode Blt_Tree_FirstChild(Blt_TreeNode parent);
-
-BLT_EXTERN Blt_TreeNode Blt_Tree_LastChild(Blt_TreeNode parent);
-
-BLT_EXTERN Blt_TreeNode Blt_Tree_ChangeRoot(Blt_Tree tree, Blt_TreeNode node);
-
-BLT_EXTERN Blt_TreeNode Blt_Tree_EndNode(Blt_TreeNode node,
- unsigned int nodeFlags);
-
-BLT_EXTERN int Blt_Tree_IsBefore(Blt_TreeNode node1, Blt_TreeNode node2);
-
-BLT_EXTERN int Blt_Tree_IsAncestor(Blt_TreeNode node1, Blt_TreeNode node2);
-
-BLT_EXTERN int Blt_Tree_PrivateValue(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode node, Blt_TreeKey key);
-
-BLT_EXTERN int Blt_Tree_PublicValue(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode node, Blt_TreeKey key);
-
-BLT_EXTERN int Blt_Tree_GetValue(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode node, const char *string, Tcl_Obj **valuePtr);
-
-BLT_EXTERN int Blt_Tree_ValueExists(Blt_Tree tree, Blt_TreeNode node,
- const char *string);
-
-BLT_EXTERN int Blt_Tree_SetValue(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode node, const char *string, Tcl_Obj *valuePtr);
-
-BLT_EXTERN int Blt_Tree_UnsetValue(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode node, const char *string);
-
-BLT_EXTERN int Blt_Tree_GetArrayValue(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode node, const char *arrayName, const char *elemName,
- Tcl_Obj **valueObjPtrPtr);
-
-BLT_EXTERN int Blt_Tree_SetArrayValue(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode node, const char *arrayName, const char *elemName,
- Tcl_Obj *valueObjPtr);
-
-BLT_EXTERN int Blt_Tree_UnsetArrayValue(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode node, const char *arrayName, const char *elemName);
-
-BLT_EXTERN int Blt_Tree_ArrayValueExists(Blt_Tree tree, Blt_TreeNode node,
- const char *arrayName, const char *elemName);
-
-BLT_EXTERN int Blt_Tree_ArrayNames(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode node, const char *arrayName, Tcl_Obj *listObjPtr);
-
-BLT_EXTERN int Blt_Tree_GetValueByKey(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode node, Blt_TreeKey key, Tcl_Obj **valuePtr);
-
-BLT_EXTERN int Blt_Tree_SetValueByKey(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode node, Blt_TreeKey key, Tcl_Obj *valuePtr);
-
-BLT_EXTERN int Blt_Tree_UnsetValueByKey(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode node, Blt_TreeKey key);
-
-BLT_EXTERN int Blt_Tree_ValueExistsByKey(Blt_Tree tree, Blt_TreeNode node,
- Blt_TreeKey key);
-
-BLT_EXTERN Blt_TreeKey Blt_Tree_FirstKey(Blt_Tree tree, Blt_TreeNode node,
- Blt_TreeKeyIterator *iterPtr);
-
-BLT_EXTERN Blt_TreeKey Blt_Tree_NextKey(Blt_Tree tree,
- Blt_TreeKeyIterator *iterPtr);
-
-BLT_EXTERN int Blt_Tree_Apply(Blt_TreeNode root, Blt_TreeApplyProc *proc,
- ClientData clientData);
-
-BLT_EXTERN int Blt_Tree_ApplyDFS(Blt_TreeNode root, Blt_TreeApplyProc *proc,
- ClientData clientData, int order);
-
-BLT_EXTERN int Blt_Tree_ApplyBFS(Blt_TreeNode root, Blt_TreeApplyProc *proc,
- ClientData clientData);
-
-BLT_EXTERN int Blt_Tree_SortNode(Blt_Tree tree, Blt_TreeNode node,
- Blt_TreeCompareNodesProc *proc);
-
-BLT_EXTERN int Blt_Tree_Exists(Tcl_Interp *interp, const char *name);
-
-BLT_EXTERN Blt_Tree Blt_Tree_Open(Tcl_Interp *interp, const char *name,
- int flags);
-
-BLT_EXTERN void Blt_Tree_Close(Blt_Tree tree);
-
-BLT_EXTERN int Blt_Tree_Attach(Tcl_Interp *interp, Blt_Tree tree,
- const char *name);
-
-BLT_EXTERN int Blt_Tree_Size(Blt_TreeNode node);
-
-BLT_EXTERN Blt_TreeTrace Blt_Tree_CreateTrace(Blt_Tree tree, Blt_TreeNode node,
- const char *keyPattern, const char *tagName, unsigned int mask,
- Blt_TreeTraceProc *proc, ClientData clientData);
-
-BLT_EXTERN void Blt_Tree_DeleteTrace(Blt_TreeTrace token);
-
-BLT_EXTERN void Blt_Tree_CreateEventHandler(Blt_Tree tree, unsigned int mask,
- Blt_TreeNotifyEventProc *proc, ClientData clientData);
-BLT_EXTERN void Blt_Tree_CreateTagEventHandler(Blt_Tree tree, unsigned int mask,
- const char *tag, Blt_TreeNotifyEventProc *proc, ClientData clientData);
-BLT_EXTERN void Blt_Tree_CreateNodeEventHandler(Blt_Tree tree,
- unsigned int mask, Blt_TreeNode node, Blt_TreeNotifyEventProc *proc,
- ClientData clientData);
-
-BLT_EXTERN void Blt_Tree_DeleteEventHandler(Blt_Tree tree, unsigned int mask,
- Blt_TreeNotifyEventProc *proc, ClientData clientData);
-
-BLT_EXTERN void Blt_Tree_RelabelNode(Blt_Tree tree, Blt_TreeNode node,
- const char *string);
-BLT_EXTERN void Blt_Tree_RelabelNodeWithoutNotify(Blt_TreeNode node,
- const char *string);
-
-BLT_EXTERN const char *Blt_Tree_NodeIdAscii(Blt_TreeNode node);
-
-BLT_EXTERN const char *Blt_Tree_NodePath(Blt_TreeNode node,
- Tcl_DString *resultPtr);
-
-BLT_EXTERN const char *Blt_Tree_NodeRelativePath(Blt_TreeNode root,
- Blt_TreeNode node, const char *separator, unsigned int flags,
- Tcl_DString *resultPtr);
-
-BLT_EXTERN long Blt_Tree_NodePosition(Blt_TreeNode node);
-
-BLT_EXTERN void Blt_Tree_ClearTags(Blt_Tree tree, Blt_TreeNode node);
-BLT_EXTERN int Blt_Tree_HasTag(Blt_Tree tree, Blt_TreeNode node,
- const char *tagName);
-BLT_EXTERN void Blt_Tree_AddTag(Blt_Tree tree, Blt_TreeNode node,
- const char *tagName);
-BLT_EXTERN void Blt_Tree_RemoveTag(Blt_Tree tree, Blt_TreeNode node,
- const char *tagName);
-BLT_EXTERN void Blt_Tree_ForgetTag(Blt_Tree tree, const char *tagName);
-BLT_EXTERN Blt_HashTable *Blt_Tree_TagHashTable(Blt_Tree tree,
- const char *tagName);
-BLT_EXTERN int Blt_Tree_TagTableIsShared(Blt_Tree tree);
-BLT_EXTERN void Blt_Tree_NewTagTable(Blt_Tree tree);
-
-BLT_EXTERN Blt_HashEntry *Blt_Tree_FirstTag(Blt_Tree tree,
- Blt_HashSearch *searchPtr);
-
-BLT_EXTERN int Blt_Tree_ImportData(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode root, Tcl_Obj *objPtr, unsigned int flags);
-
-BLT_EXTERN int Blt_Tree_ImportFile(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode root, Tcl_Obj *objPtr, unsigned int flags);
-
-BLT_EXTERN void Blt_Tree_DumpNode(Blt_Tree tree, Blt_TreeNode root,
- Blt_TreeNode node, Tcl_DString *resultPtr);
-
-BLT_EXTERN int Blt_Tree_Dump(Blt_Tree tree, Blt_TreeNode root,
- Tcl_DString *resultPtr);
-
-BLT_EXTERN int Blt_Tree_DumpToFile(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode root, const char *fileName);
-
-BLT_EXTERN int Blt_Tree_Restore _ANSI_ARGS_((Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode root, const char *string, unsigned int flags));
-
-BLT_EXTERN int Blt_Tree_RestoreFromFile(Tcl_Interp *interp, Blt_Tree tree,
- Blt_TreeNode root, const char *fileName, unsigned int flags);
-
-#define Blt_Tree_Name(token) ((token)->name)
-#define Blt_Tree_RootNode(token) ((token)->root)
-
-#define Blt_Tree_NodeDegree(node) ((node)->nChildren)
-#define Blt_Tree_NodeDepth(node) ((node)->depth)
-#define Blt_Tree_NodeLabel(node) ((node)->label)
-#define Blt_Tree_NodeId(node) ((node)->inode)
-#define Blt_Tree_NextNodeId(token) ((token)->corePtr->nextInode)
-#define Blt_Tree_ParentNode(node) ((node == NULL) ? NULL : (node)->parent)
-
-#define Blt_Tree_IsLeaf(node) ((node)->nChildren == 0)
-#define Blt_Tree_IsLink(node) ((node)->flags & TREE_NODE_LINK)
-
-#define Blt_Tree_NextSibling(node) (((node) == NULL) ? NULL : (node)->next)
-#define Blt_Tree_PrevSibling(node) (((node) == NULL) ? NULL : (node)->prev)
-
-typedef int (Blt_TreeImportProc)(Tcl_Interp *interp, Blt_Tree tree, int objc,
- Tcl_Obj *const *objv);
-
-typedef int (Blt_TreeExportProc)(Tcl_Interp *interp, Blt_Tree tree, int objc,
- Tcl_Obj *const *objv);
-
-BLT_EXTERN int Blt_Tree_RegisterFormat(Tcl_Interp *interp, const char *fmtName,
- Blt_TreeImportProc *importProc, Blt_TreeExportProc *exportProc);
-
-BLT_EXTERN Blt_TreeTagEntry *Blt_Tree_RememberTag(Blt_Tree tree,
- const char *name);
-
-#endif /* _BLT_TREE_H */
-
diff --git a/blt3.0.1/src/bltTreeCmd.c b/blt3.0.1/src/bltTreeCmd.c
deleted file mode 100644
index 6ef675d..0000000
--- a/blt3.0.1/src/bltTreeCmd.c
+++ /dev/null
@@ -1,5893 +0,0 @@
-
-/*
- *
- * bltTreeCmd.c --
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- tree create t0 t1 t2
- tree names
- t0 destroy
- -or-
- tree destroy t0
- tree copy tree at node tree at node -recurse -tags
-
- tree move node after|before|into t2 at node
-
- $t apply -recurse $root command arg arg
-
- $t attach treename
-
- $t children $n
- t0 copy node1 node2 node3 node4 node5 destName
- $t delete $n...
- $t depth $n
- $t dump $root
- $t dumpfile $root fileName
- $t dup $t2
- $t find $root -name pat -name pattern
- $t firstchild $n
- $t get $n $key
- $t get $n $key(abc)
- $t index $n
- $t insert $parent $switches?
- $t isancestor $n1 $n2
- $t isbefore $n1 $n2
- $t isleaf $n
- $t lastchild $n
- $t move $n1 after|before|into $n2
- $t next $n
- $t nextsibling $n
- $t path $n1 $n2 $n3...
- $t parent $n
- $t previous $n
- $t prevsibling $n
- $t restore $root data -overwrite
- $t root ?$n?
-
- $t set $n $key $value ?$key $value?
- $t size $n
- $t slink $n $t2@$node ???
- $t sort -recurse $root
-
- $t tag delete tag1 tag2 tag3...
- $t tag names
- $t tag nodes $tag
- $t tag set $n tag1 tag2 tag3...
- $t tag unset $n tag1 tag2 tag3...
-
- $t trace create $n $key how -whenidle command
- $t trace delete id1 id2 id3...
- $t trace names
- $t trace info $id
-
- $t unset $n key1 key2 key3...
-
- $t notify create -oncreate -ondelete -onmove command
- $t notify create -oncreate -ondelete -onmove -onsort command arg arg arg
- $t notify delete id1 id2 id3
- $t notify names
- $t notify info id
-
- for { set n [$t firstchild $node] } { $n >= 0 } {
- set n [$t nextsibling $n] } {
- }
- foreach n [$t children $node] {
-
- }
- set n [$t next $node]
- set n [$t previous $node]
-
-*/
-
-#include <bltInt.h>
-
-#ifndef NO_TREE
-#include "bltOp.h"
-#include <bltTree.h>
-#include <bltHash.h>
-#include <bltList.h>
-#include "bltNsUtil.h"
-#include "bltSwitch.h"
-#include <ctype.h>
-
-#define TREE_THREAD_KEY "BLT Tree Command Data"
-#define TREE_MAGIC ((unsigned int) 0x46170277)
-
-enum TagTypes { TAG_TYPE_NONE, TAG_TYPE_ALL, TAG_TYPE_TAG };
-
-typedef struct {
- const char *name; /* Name of format. */
- int isLoaded;
- Blt_TreeImportProc *importProc;
- Blt_TreeExportProc *exportProc;
-} DataFormat;
-
-typedef struct {
- Tcl_Interp *interp;
- Blt_HashTable treeTable; /* Hash table of trees keyed by
- * address. */
- Blt_HashTable fmtTable;
-} TreeCmdInterpData;
-
-typedef struct {
- Tcl_Interp *interp;
- Tcl_Command cmdToken; /* Token for tree's TCL command. */
- Blt_Tree tree; /* Token holding internal tree. */
- Blt_HashEntry *hashPtr;
- Blt_HashTable *tablePtr;
- TreeCmdInterpData *tdPtr; /* */
- int traceCounter; /* Used to generate trace id
- * strings. */
- Blt_HashTable traceTable; /* Table of active traces. Maps trace
- * ids back to their TraceInfo
- * records. */
- int notifyCounter; /* Used to generate notify id
- * strings. */
- Blt_HashTable notifyTable; /* Table of event handlers. Maps
- * notify ids back to their Notifier
- * records. */
- Blt_Chain notifiers;
-} TreeCmd;
-
-typedef struct {
- TreeCmd *cmdPtr;
- Blt_TreeNode node;
- Blt_TreeTrace traceToken;
- const char *withTag; /* If non-NULL, the event or trace was
- * specified with this tag. This
- * value is saved for informational
- * purposes. The tree's trace
- * matching routines do the real
- * checking, not the client's
- * callback. */
- char command[1]; /* Command prefix for the trace or
- * notify Tcl callback. Extra
- * arguments will be appended to the
- * end. Extra space will be allocated
- * for the length of the string */
-} TraceInfo;
-
-typedef struct {
- TreeCmd *cmdPtr;
- int mask; /* Requested event mask. */
- long inode; /* If >= 0, inode to match. */
- const char *tag; /* If non-NULL, tag to match. */
- Tcl_Obj *cmdObjPtr; /* Command to be executed when
- * matching event is found. */
- Blt_TreeNode node; /* (out) Node affected by event. */
- Blt_TreeTrace notifyToken;
-
- Blt_HashEntry *hashPtr; /* Pointer to entry in hash table. */
- Blt_ChainLink link; /* Pointer to entry in list of
- * notifiers. */
-} Notifier;
-
-BLT_EXTERN Blt_SwitchParseProc Blt_TreeNodeSwitchProc;
-static Blt_SwitchCustom nodeSwitch = {
- Blt_TreeNodeSwitchProc, NULL, (ClientData)0,
-};
-
-typedef struct {
- int mask;
-} AttachSwitches;
-
-static Blt_SwitchSpec attachSwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-newtags", "",
- Blt_Offset(AttachSwitches, mask), 0, TREE_NEWTAGS},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- int mask;
- Blt_TreeNode node;
- const char *tag;
-} NotifySwitches;
-
-static Blt_SwitchSpec notifySwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-create", "",
- Blt_Offset(NotifySwitches, mask), 0, TREE_NOTIFY_CREATE},
- {BLT_SWITCH_BITMASK, "-delete", "",
- Blt_Offset(NotifySwitches, mask), 0, TREE_NOTIFY_DELETE},
- {BLT_SWITCH_BITMASK, "-move", "",
- Blt_Offset(NotifySwitches, mask), 0, TREE_NOTIFY_MOVE},
- {BLT_SWITCH_BITMASK, "-sort", "",
- Blt_Offset(NotifySwitches, mask), 0, TREE_NOTIFY_SORT},
- {BLT_SWITCH_BITMASK, "-relabel", "",
- Blt_Offset(NotifySwitches, mask), 0, TREE_NOTIFY_RELABEL},
- {BLT_SWITCH_BITMASK, "-allevents", "",
- Blt_Offset(NotifySwitches, mask), 0, TREE_NOTIFY_ALL},
- {BLT_SWITCH_BITMASK, "-whenidle", "",
- Blt_Offset(NotifySwitches, mask), 0, TREE_NOTIFY_WHENIDLE},
- {BLT_SWITCH_CUSTOM, "-node", "node",
- Blt_Offset(NotifySwitches, node), 0, 0, &nodeSwitch},
- {BLT_SWITCH_STRING, "-tag", "string",
- Blt_Offset(NotifySwitches, tag), 0},
- {BLT_SWITCH_END}
-};
-
-static Blt_SwitchParseProc ChildSwitch;
-#define INSERT_BEFORE (ClientData)0
-#define INSERT_AFTER (ClientData)1
-static Blt_SwitchCustom beforeSwitch = {
- ChildSwitch, NULL, INSERT_BEFORE,
-};
-static Blt_SwitchCustom afterSwitch = {
- ChildSwitch, NULL, INSERT_AFTER,
-};
-
-typedef struct {
- const char *label;
- long position;
- long inode;
- Tcl_Obj *tagsObjPtr;
- char **dataPairs;
- Blt_TreeNode parent;
-} InsertSwitches;
-
-static Blt_SwitchSpec insertSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-after", "position",
- Blt_Offset(InsertSwitches, position), 0, 0, &afterSwitch},
- {BLT_SWITCH_LONG_NNEG, "-at", "position",
- Blt_Offset(InsertSwitches, position), 0},
- {BLT_SWITCH_CUSTOM, "-before", "position",
- Blt_Offset(InsertSwitches, position), 0, 0, &beforeSwitch},
- {BLT_SWITCH_LIST, "-data", "{name value ?name value?...}",
- Blt_Offset(InsertSwitches, dataPairs), 0},
- {BLT_SWITCH_STRING, "-label", "string",
- Blt_Offset(InsertSwitches, label), 0},
- {BLT_SWITCH_LONG_NNEG, "-node", "number",
- Blt_Offset(InsertSwitches, inode), 0},
- {BLT_SWITCH_OBJ, "-tags", "{?tagName?...}",
- Blt_Offset(InsertSwitches, tagsObjPtr), 0},
- {BLT_SWITCH_END}
-};
-
-#define MATCH_INVERT (1<<8)
-#define MATCH_LEAFONLY (1<<4)
-#define MATCH_NOCASE (1<<5)
-#define MATCH_PATHNAME (1<<6)
-#define PATTERN_NONE (0)
-#define PATTERN_EXACT (1)
-#define PATTERN_GLOB (2)
-#define PATTERN_REGEXP (3)
-#define PATTERN_MASK (0x3)
-
-typedef struct {
- TreeCmd *cmdPtr; /* Tree to examine. */
- Tcl_Obj *listObjPtr; /* List to accumulate the indices of
- * matching nodes. */
- Tcl_Obj *cmdObjPtr; /* If non-NULL, command to be executed
- * for each found node. */
- unsigned int flags; /* See flags definitions above. */
- size_t nMatches; /* Current number of matches. */
- size_t maxMatches; /* If > 0, stop after this many
- * matches. */
- unsigned int order; /* Order of search: Can be either
- * TREE_PREORDER, TREE_POSTORDER,
- * TREE_INORDER, TREE_BREADTHFIRST. */
- long maxDepth; /* If >= 0, don't descend more than
- * this many levels. */
- Blt_List patternList; /* List of patterns to compare with
- * labels or values. */
- const char *addTag; /* If non-NULL, tag added to selected
- * nodes. */
- Blt_List keyList; /* List of key name patterns. */
- Blt_List tagList; /* List of tag names. */
- Blt_HashTable excludeTable; /* Table of nodes to exclude. */
-} FindSwitches;
-
-static Blt_SwitchParseProc OrderSwitch;
-static Blt_SwitchCustom orderSwitch = {
- OrderSwitch, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc PatternSwitch;
-static Blt_SwitchFreeProc FreePatterns;
-
-static Blt_SwitchCustom regexpSwitch = {
- PatternSwitch, FreePatterns, (ClientData)PATTERN_REGEXP,
-};
-static Blt_SwitchCustom globSwitch = {
- PatternSwitch, FreePatterns, (ClientData)PATTERN_GLOB,
-};
-static Blt_SwitchCustom exactSwitch = {
- PatternSwitch, FreePatterns, (ClientData)PATTERN_EXACT,
-};
-
-static Blt_SwitchCustom tagSwitch = {
- PatternSwitch, FreePatterns, (ClientData)PATTERN_EXACT,
-};
-
-
-static Blt_SwitchParseProc NodesSwitch;
-static Blt_SwitchFreeProc FreeNodes;
-static Blt_SwitchCustom nodesSwitch = {
- NodesSwitch, FreeNodes, (ClientData)0,
-};
-
-
-static Blt_SwitchSpec findSwitches[] = {
- {BLT_SWITCH_STRING, "-addtag", "tagName",
- Blt_Offset(FindSwitches, addTag), 0},
- {BLT_SWITCH_LONG_NNEG, "-count", "number",
- Blt_Offset(FindSwitches, maxMatches), 0},
- {BLT_SWITCH_LONG_NNEG, "-depth", "number",
- Blt_Offset(FindSwitches, maxDepth), 0},
- {BLT_SWITCH_CUSTOM, "-exact", "string",
- Blt_Offset(FindSwitches, patternList),0, 0, &exactSwitch},
- {BLT_SWITCH_CUSTOM, "-excludes", "nodes",
- Blt_Offset(FindSwitches, excludeTable),0, 0, &nodesSwitch},
- {BLT_SWITCH_OBJ, "-exec", "command",
- Blt_Offset(FindSwitches, cmdObjPtr), 0},
- {BLT_SWITCH_CUSTOM, "-glob", "pattern",
- Blt_Offset(FindSwitches, patternList),0, 0, &globSwitch},
- {BLT_SWITCH_BITMASK, "-invert", "",
- Blt_Offset(FindSwitches, flags), 0, MATCH_INVERT},
- {BLT_SWITCH_CUSTOM, "-key", "string",
- Blt_Offset(FindSwitches, keyList), 0, 0, &exactSwitch},
- {BLT_SWITCH_CUSTOM, "-keyexact", "string",
- Blt_Offset(FindSwitches, keyList), 0, 0, &exactSwitch},
- {BLT_SWITCH_CUSTOM, "-keyglob", "pattern",
- Blt_Offset(FindSwitches, keyList), 0, 0, &globSwitch},
- {BLT_SWITCH_CUSTOM, "-keyregexp","pattern",
- Blt_Offset(FindSwitches, keyList), 0, 0, ®expSwitch},
- {BLT_SWITCH_BITMASK, "-leafonly", "",
- Blt_Offset(FindSwitches, flags), 0, MATCH_LEAFONLY},
- {BLT_SWITCH_BITMASK, "-nocase", "",
- Blt_Offset(FindSwitches, flags), 0, MATCH_NOCASE},
- {BLT_SWITCH_CUSTOM, "-order", "order",
- Blt_Offset(FindSwitches, order), 0, 0, &orderSwitch},
- {BLT_SWITCH_BITMASK, "-path", "",
- Blt_Offset(FindSwitches, flags), 0, MATCH_PATHNAME},
- {BLT_SWITCH_CUSTOM, "-regexp", "pattern",
- Blt_Offset(FindSwitches, patternList),0, 0, ®expSwitch},
- {BLT_SWITCH_CUSTOM, "-tag", "{?tag?...}",
- Blt_Offset(FindSwitches, tagList), 0, 0, &tagSwitch},
- {BLT_SWITCH_END}
-};
-#undef _off
-
-
-typedef struct {
- TreeCmd *cmdPtr; /* Tree to move nodes. */
- Blt_TreeNode node;
- long movePos;
-} MoveSwitches;
-
-static Blt_SwitchSpec moveSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-after", "child",
- Blt_Offset(MoveSwitches, node), 0, 0, &nodeSwitch},
- {BLT_SWITCH_LONG_NNEG, "-at", "position",
- Blt_Offset(MoveSwitches, movePos), 0},
- {BLT_SWITCH_CUSTOM, "-before", "child",
- Blt_Offset(MoveSwitches, node), 0, 0, &nodeSwitch},
- {BLT_SWITCH_END}
-};
-#undef _off
-
-typedef struct {
- Blt_TreeNode srcNode;
- Blt_Tree srcTree, destTree;
- TreeCmd *srcPtr, *destPtr;
- const char *label;
- unsigned int flags;
-} CopySwitches;
-
-#define COPY_RECURSE (1<<0)
-#define COPY_TAGS (1<<1)
-#define COPY_OVERWRITE (1<<2)
-
-static Blt_SwitchSpec copySwitches[] =
-{
- {BLT_SWITCH_STRING, "-label", "string",
- Blt_Offset(CopySwitches, label), 0},
- {BLT_SWITCH_BITMASK, "-recurse", "",
- Blt_Offset(CopySwitches, flags), 0, COPY_RECURSE},
- {BLT_SWITCH_BITMASK, "-tags", "",
- Blt_Offset(CopySwitches, flags), 0, COPY_TAGS},
- {BLT_SWITCH_BITMASK, "-overwrite", "",
- Blt_Offset(CopySwitches, flags), 0, COPY_OVERWRITE},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- TreeCmd *cmdPtr; /* Tree to examine. */
- unsigned int flags; /* See flags definitions above. */
-
- long maxDepth; /* If >= 0, don't descend more than
- * this many levels. */
- /* String options. */
- Blt_List patternList; /* List of label or value patterns. */
- Tcl_Obj *preCmdObjPtr; /* Pre-command. */
- Tcl_Obj *postCmdObjPtr; /* Post-command. */
- Blt_List keyList; /* List of key-name patterns. */
- Blt_List tagList;
-} ApplySwitches;
-
-static Blt_SwitchSpec applySwitches[] =
-{
- {BLT_SWITCH_OBJ, "-precommand", "command",
- Blt_Offset(ApplySwitches, preCmdObjPtr), 0},
- {BLT_SWITCH_OBJ, "-postcommand", "command",
- Blt_Offset(ApplySwitches, postCmdObjPtr), 0},
- {BLT_SWITCH_LONG_NNEG, "-depth", "number",
- Blt_Offset(ApplySwitches, maxDepth), 0},
- {BLT_SWITCH_CUSTOM, "-exact", "string",
- Blt_Offset(ApplySwitches, patternList), 0, 0, &exactSwitch},
- {BLT_SWITCH_CUSTOM, "-glob", "pattern",
- Blt_Offset(ApplySwitches, patternList), 0, 0, &globSwitch},
- {BLT_SWITCH_BITMASK, "-invert", "",
- Blt_Offset(ApplySwitches, flags), 0, MATCH_INVERT},
- {BLT_SWITCH_CUSTOM, "-key", "pattern",
- Blt_Offset(ApplySwitches, keyList), 0, 0, &exactSwitch},
- {BLT_SWITCH_CUSTOM, "-keyexact", "string",
- Blt_Offset(ApplySwitches, keyList), 0, 0, &exactSwitch},
- {BLT_SWITCH_CUSTOM, "-keyglob", "pattern",
- Blt_Offset(ApplySwitches, keyList), 0, 0, &globSwitch},
- {BLT_SWITCH_CUSTOM, "-keyregexp", "pattern",
- Blt_Offset(ApplySwitches, keyList), 0, 0, ®expSwitch},
- {BLT_SWITCH_BITMASK, "-leafonly", "",
- Blt_Offset(ApplySwitches, flags), 0, MATCH_LEAFONLY},
- {BLT_SWITCH_BITMASK, "-nocase", "",
- Blt_Offset(ApplySwitches, flags), 0, MATCH_NOCASE},
- {BLT_SWITCH_BITMASK, "-path", "",
- Blt_Offset(ApplySwitches, flags), 0, MATCH_PATHNAME},
- {BLT_SWITCH_CUSTOM, "-regexp", "pattern",
- Blt_Offset(ApplySwitches, patternList), 0, 0, ®expSwitch},
- {BLT_SWITCH_CUSTOM, "-tag", "{?tag?...}",
- Blt_Offset(ApplySwitches, tagList), 0, 0, &tagSwitch},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- unsigned int flags;
-} RestoreSwitches;
-
-
-#define RESTORE_NO_TAGS (1<<0)
-#define RESTORE_OVERWRITE (1<<1)
-
-static Blt_SwitchSpec restoreSwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-notags", "",
- Blt_Offset(RestoreSwitches, flags), 0, RESTORE_NO_TAGS},
- {BLT_SWITCH_BITMASK, "-overwrite", "",
- Blt_Offset(RestoreSwitches, flags), 0, RESTORE_OVERWRITE},
- {BLT_SWITCH_END}
-};
-
-static Blt_SwitchParseProc FormatSwitch;
-static Blt_SwitchCustom formatSwitch =
-{
- FormatSwitch, NULL, (ClientData)0,
-};
-
-typedef struct {
- int sort; /* If non-zero, sort the nodes. */
- int withParent; /* If non-zero, add the parent node id
- * to the output of the command.*/
- int withId; /* If non-zero, echo the node id in
- * the output of the command. */
-} PositionSwitches;
-
-#define POSITION_SORTED (1<<0)
-
-static Blt_SwitchSpec positionSwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-sort", "",
- Blt_Offset(PositionSwitches, sort), 0, POSITION_SORTED},
- {BLT_SWITCH_CUSTOM, "-format", "format",
- 0, 0, 0, &formatSwitch},
- {BLT_SWITCH_END}
-};
-
-#define PATH_LEAF (1<<0)
-#define PATH_PARENTS (1<<1)
-#define PATH_NOCOMPLAIN (1<<2)
-
-typedef struct {
- unsigned int flags; /* Parse flags. */
- const char *separator; /* Path separator. */
-} PathSwitches;
-
-static Blt_SwitchSpec pathSwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-parents", "",
- Blt_Offset(PathSwitches, flags), 0, PATH_PARENTS},
- {BLT_SWITCH_BITMASK, "-leaf", "",
- Blt_Offset(PathSwitches, flags), 0, PATH_LEAF},
- {BLT_SWITCH_BITMASK, "-nocomplain", "",
- Blt_Offset(PathSwitches, flags), 0, PATH_NOCOMPLAIN},
- {BLT_SWITCH_STRING, "-separator", "char",
- Blt_Offset(PathSwitches, separator), 0},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- int mask;
-} TraceSwitches;
-
-static Blt_SwitchSpec traceSwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-whenidle", "",
- Blt_Offset(TraceSwitches, mask), 0, TREE_NOTIFY_WHENIDLE},
- {BLT_SWITCH_END}
-};
-
-static Tcl_InterpDeleteProc TreeInterpDeleteProc;
-static Blt_TreeApplyProc MatchNodeProc, SortApplyProc;
-static Blt_TreeApplyProc ApplyNodeProc;
-static Blt_TreeTraceProc TreeTraceProc;
-static Tcl_CmdDeleteProc TreeInstDeleteProc;
-static Blt_TreeCompareNodesProc CompareNodes;
-
-static Tcl_ObjCmdProc TreeObjCmd;
-static Tcl_ObjCmdProc CompareDictionaryCmd;
-static Tcl_ObjCmdProc ExitCmd;
-static Blt_TreeNotifyEventProc TreeEventProc;
-
-typedef int (TreeCmdProc)(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-static int GetNodeFromObj(Tcl_Interp *interp, Blt_Tree tree, Tcl_Obj *objPtr,
- Blt_TreeNode *nodePtr);
-
-static int
-IsTag(Blt_Tree tree, const char *string)
-{
- if (strcmp(string, "all") == 0) {
- return TRUE;
- } else if (strcmp(string, "root") == 0) {
- return TRUE;
- } else {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_Tree_TagHashTable(tree, string);
- if (tablePtr == NULL) {
- return FALSE;
- }
- }
- return TRUE;
-}
-
-static int
-IsNodeId(const char *string)
-{
- long value;
-
- return (Tcl_GetLong(NULL, string, &value) == TCL_OK);
-}
-
-static int
-IsNodeIdOrModifier(const char *string)
-{
- if (strstr(string, "->") == NULL) {
- return IsNodeId(string);
- }
- return TRUE;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChildSwitch --
- *
- * Convert a Tcl_Obj representing the label of a child node into its
- * integer node id.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ChildSwitch(
- ClientData clientData, /* Flag indicating if the node is
- * considered before or after the
- * insertion position. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- InsertSwitches *insertPtr = (InsertSwitches *)record;
- Blt_TreeNode node;
- const char *string;
-
- string = Tcl_GetString(objPtr);
- node = Blt_Tree_FindChild(insertPtr->parent, string);
- if (node == NULL) {
- Tcl_AppendResult(interp, "can't find a child named \"", string,
- "\" in \"", Blt_Tree_NodeLabel(insertPtr->parent), "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- insertPtr->position = Blt_Tree_NodeDegree(node);
- if (clientData == INSERT_AFTER) {
- insertPtr->position++;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeNodeSwitchProc --
- *
- * Convert a Tcl_Obj representing a node number into its integer value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-Blt_TreeNodeSwitchProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_TreeNode *nodePtr = (Blt_TreeNode *)(record + offset);
- Blt_TreeNode node;
- Blt_Tree tree = clientData;
- int result;
-
- result = GetNodeFromObj(interp, tree, objPtr, &node);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- *nodePtr = node;
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * OrderSwitch --
- *
- * Convert a string represent a node number into its integer
- * value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-OrderSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- int *orderPtr = (int *)(record + offset);
- char c;
- char *string;
-
- string = Tcl_GetString(objPtr);
- c = string[0];
- if ((c == 'b') && (strcmp(string, "breadthfirst") == 0)) {
- *orderPtr = TREE_BREADTHFIRST;
- } else if ((c == 'i') && (strcmp(string, "inorder") == 0)) {
- *orderPtr = TREE_INORDER;
- } else if ((c == 'p') && (strcmp(string, "preorder") == 0)) {
- *orderPtr = TREE_PREORDER;
- } else if ((c == 'p') && (strcmp(string, "postorder") == 0)) {
- *orderPtr = TREE_POSTORDER;
- } else {
- Tcl_AppendResult(interp, "bad order \"", string,
- "\": should be breadthfirst, inorder, preorder, or postorder",
- (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PatternSwitch --
- *
- * Convert a string represent a node number into its integer
- * value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PatternSwitch(
- ClientData clientData, /* Flag indicating type of pattern. */
- Tcl_Interp *interp, /* Not used. */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Blt_List *listPtr = (Blt_List *)(record + offset);
-
- if (*listPtr == NULL) {
- *listPtr = Blt_List_Create(BLT_STRING_KEYS);
- }
- Blt_List_Append(*listPtr, Tcl_GetString(objPtr), clientData);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreePatterns --
- *
- * Convert a string represent a node number into its integer
- * value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-FreePatterns(char *record, int offset, int flags)
-{
- Blt_List *listPtr = (Blt_List *)(record + offset);
-
- if (*listPtr != NULL) {
- Blt_List_Destroy(*listPtr);
- /*
- * This routine can be called several times for each switch that
- * appends to this list. Mark it NULL, so we don't try to destroy the
- * list again.
- */
- *listPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FormatSwitch --
- *
- * Convert a string represent a node number into its integer value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-FormatSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- PositionSwitches *pdPtr = (PositionSwitches *)record;
- char *string;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "position") == 0) {
- pdPtr->withParent = FALSE;
- pdPtr->withId = FALSE;
- } else if (strcmp(string, "id+position") == 0) {
- pdPtr->withParent = FALSE;
- pdPtr->withId = TRUE;
- } else if (strcmp(string, "parent-at-position") == 0) {
- pdPtr->withParent = TRUE;
- pdPtr->withId = FALSE;
- } else if (strcmp(string, "id+parent-at-position") == 0) {
- pdPtr->withParent = TRUE;
- pdPtr->withId = TRUE;
- } else {
- Tcl_AppendResult(interp, "bad format \"", string,
- "\": should be position, parent-at-position, id+position, or id+parent-at-position",
- (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeNodes --
- *
- * Convert a string represent a node number into its integer value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-FreeNodes(char *record, int offset, int flags)
-{
- Blt_HashTable *tablePtr = (Blt_HashTable *)(record + offset);
-
- Blt_DeleteHashTable(tablePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NodesSwitch --
- *
- * Convert a Tcl_Obj representing a node number into its integer
- * value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NodesSwitch(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* String representation */
- char *record, /* Structure record */
- int offset, /* Not used. */
- int flags) /* Not used. */
-{
- FindSwitches *findPtr = (FindSwitches *)record;
- int objc;
- Tcl_Obj **objv;
- int i;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 0; i < objc; i++) {
- int isNew;
- Blt_TreeNode node;
-
- if (GetNodeFromObj(interp, findPtr->cmdPtr->tree, objv[i], &node)
- != TCL_OK) {
- Blt_DeleteHashTable(&findPtr->excludeTable);
- return TCL_ERROR;
- }
- Blt_CreateHashEntry(&findPtr->excludeTable, (char *)node, &isNew);
- }
- return TCL_OK;
-}
-
-static void
-FreeNotifier(TreeCmd *cmdPtr, Notifier *notifyPtr)
-{
- if (notifyPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&cmdPtr->notifyTable, notifyPtr->hashPtr);
- }
- if (notifyPtr->link != NULL) {
- Blt_Chain_DeleteLink(cmdPtr->notifiers, notifyPtr->link);
- }
- Tcl_DecrRefCount(notifyPtr->cmdObjPtr);
- if (notifyPtr->tag != NULL) {
- Blt_Free(notifyPtr->tag);
- }
- Blt_Free(notifyPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTreeCmdInterpData --
- *
- *---------------------------------------------------------------------------
- */
-static TreeCmdInterpData *
-GetTreeCmdInterpData(Tcl_Interp *interp)
-{
- TreeCmdInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (TreeCmdInterpData *)
- Tcl_GetAssocData(interp, TREE_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(TreeCmdInterpData));
- dataPtr->interp = interp;
- Tcl_SetAssocData(interp, TREE_THREAD_KEY, TreeInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->treeTable, BLT_ONE_WORD_KEYS);
- Blt_InitHashTable(&dataPtr->fmtTable, BLT_STRING_KEYS);
- }
- return dataPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTreeCmd --
- *
- * Find the tree command associated with the TCL command "string".
- *
- * We have to do multiple lookups to get this right.
- *
- * The first step is to generate a canonical command name. If an
- * unqualified command name (i.e. no namespace qualifier) is given, we
- * should search first the current namespace and then the global one.
- * Most TCL commands (like Tcl_GetCmdInfo) look only at the global
- * namespace.
- *
- * Next check if the string is
- * a) a TCL command and
- * b) really is a command for a tree object.
- * Tcl_GetCommandInfo will get us the objClientData field that should be
- * a cmdPtr. We can verify that by searching our hashtable of cmdPtr
- * addresses.
- *
- * Results:
- * A pointer to the tree command. If no associated tree command can be
- * found, NULL is returned. It's up to the calling routines to generate
- * an error message.
- *
- *---------------------------------------------------------------------------
- */
-static TreeCmd *
-GetTreeCmd(
- TreeCmdInterpData *tdPtr,
- Tcl_Interp *interp,
- const char *string)
-{
- Blt_ObjectName objName;
- Tcl_CmdInfo cmdInfo;
- Blt_HashEntry *hPtr;
- Tcl_DString dString;
- const char *treeName;
- int result;
-
- /* Pull apart the tree name and put it back together in a standard
- * format. */
- if (!Blt_ParseObjectName(interp, string, &objName, BLT_NO_ERROR_MSG)) {
- return NULL; /* No such parent namespace. */
- }
- /* Rebuild the fully qualified name. */
- treeName = Blt_MakeQualifiedName(&objName, &dString);
- result = Tcl_GetCommandInfo(interp, treeName, &cmdInfo);
- Tcl_DStringFree(&dString);
-
- if (!result) {
- return NULL;
- }
- hPtr = Blt_FindHashEntry(&tdPtr->treeTable,
- (char *)(cmdInfo.objClientData));
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-static Blt_TreeNode
-ParseModifiers(Tcl_Interp *interp, Blt_Tree tree, Blt_TreeNode node,
- char *modifiers)
-{
- char *p, *token;
-
- p = modifiers;
- do {
- p += 2; /* Skip the initial "->" */
- token = strstr(p, "->");
- if (token != NULL) {
- *token = '\0';
- }
- if (IsNodeId(p)) {
- long inode;
-
- if (Tcl_GetLong(interp, p, &inode) != TCL_OK) {
- node = NULL;
- } else {
- node = Blt_Tree_GetNode(tree, inode);
- }
- } else if ((*p == 'p') && (strcmp(p, "parent") == 0)) {
- node = Blt_Tree_ParentNode(node);
- } else if ((*p == 'f') && (strcmp(p, "firstchild") == 0)) {
- node = Blt_Tree_FirstChild(node);
- } else if ((*p == 'l') && (strcmp(p, "lastchild") == 0)) {
- node = Blt_Tree_LastChild(node);
- } else if ((*p == 'n') && (strcmp(p, "next") == 0)) {
- node = Blt_Tree_NextNode(NULL, node);
- } else if ((*p == 'n') && (strcmp(p, "nextsibling") == 0)) {
- node = Blt_Tree_NextSibling(node);
- } else if ((*p == 'p') && (strcmp(p, "previous") == 0)) {
- node = Blt_Tree_PrevNode(NULL, node);
- } else if ((*p == 'p') && (strcmp(p, "prevsibling") == 0)) {
- node = Blt_Tree_PrevSibling(node);
- } else {
- int length;
-
- length = strlen(p);
- if (length > 0) {
- char *endp;
-
- endp = p + length - 1;
- if ((*p == '"') && (*endp == '"')) {
- *endp = '\0';
- node = Blt_Tree_FindChild(node, p + 1);
- *endp = '"';
- } else {
- node = Blt_Tree_FindChild(node, p);
- }
- }
- }
- if (node == NULL) {
- goto error;
- }
- if (token != NULL) {
- *token = '-'; /* Repair the string */
- }
- p = token;
- } while (token != NULL);
- return node;
- error:
- if (token != NULL) {
- *token = '-'; /* Repair the string */
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetForeignNode --
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetForeignNode(Tcl_Interp *interp, Blt_Tree tree, Tcl_Obj *objPtr,
- Blt_TreeNode *nodePtr)
-{
- Blt_TreeNode node;
- char *string;
- char *p;
- char save;
-
- save = '\0'; /* Suppress compiler warning. */
- string = Tcl_GetString(objPtr);
-
- /* Check if modifiers are present. */
- p = strstr(string, "->");
- if (p != NULL) {
- save = *p;
- *p = '\0';
- }
- if (IsNodeId(string)) {
- long inode;
-
- if (p != NULL) {
- if (Tcl_GetLong(interp, string, &inode) != TCL_OK) {
- goto error;
- }
- } else {
- if (Tcl_GetLongFromObj(interp, objPtr, &inode) != TCL_OK) {
- goto error;
- }
- }
- node = Blt_Tree_GetNode(tree, inode);
- if (p != NULL) {
- node = ParseModifiers(interp, tree, node, p);
- }
- if (node != NULL) {
- *nodePtr = node;
- if (p != NULL) {
- *p = save;
- }
- return TCL_OK;
- }
- }
- Tcl_AppendResult(interp, "can't find tag or id \"", string, "\" in ",
- Blt_Tree_Name(tree), (char *)NULL);
- error:
- if (p != NULL) {
- *p = save; /* Restore the string */
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetNodeFromObj --
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetNodeFromObj(Tcl_Interp *interp, Blt_Tree tree, Tcl_Obj *objPtr,
- Blt_TreeNode *nodePtr)
-{
- Blt_TreeNode node;
- char *string;
- char *p;
- char save;
-
- node = NULL; /* Suppress compiler warnings. */
- save = '\0';
-
- string = Tcl_GetString(objPtr);
-
- /* Check if modifiers are present. */
- p = strstr(string, "->");
- if (p != NULL) {
- save = *p;
- *p = '\0';
- }
- if (IsNodeId(string)) {
- long inode;
-
- if (p != NULL) {
- if (Tcl_GetLong(interp, string, &inode) != TCL_OK) {
- goto error;
- }
- } else {
- if (Tcl_GetLongFromObj(interp, objPtr, &inode) != TCL_OK) {
- goto error;
- }
- }
- node = Blt_Tree_GetNode(tree, inode);
- } else if (tree != NULL) {
- if (strcmp(string, "all") == 0) {
- if (Blt_Tree_Size(Blt_Tree_RootNode(tree)) > 1) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "more than one node tagged as \"",
- string, "\"", (char *)NULL);
- }
- goto error;
- }
- node = Blt_Tree_RootNode(tree);
- } else if (strcmp(string, "root") == 0) {
- node = Blt_Tree_RootNode(tree);
- } else {
- Blt_HashTable *tablePtr;
- Blt_HashSearch cursor;
- Blt_HashEntry *hPtr;
-
- node = NULL;
- tablePtr = Blt_Tree_TagHashTable(tree, string);
- if (tablePtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find tag or id \"", string,
- "\" in ", Blt_Tree_Name(tree), (char *)NULL);
- }
- goto error;
- } else if (tablePtr->numEntries > 1) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "more than one node tagged as \"",
- string, "\"", (char *)NULL);
- }
- goto error;
- } else if (tablePtr->numEntries > 0) {
- hPtr = Blt_FirstHashEntry(tablePtr, &cursor);
- node = Blt_GetHashValue(hPtr);
- if (p != NULL) {
- *p = save;
- }
- }
- }
- }
- if (node != NULL) {
- if (p != NULL) {
- node = ParseModifiers(interp, tree, node, p);
- if (node == NULL) {
- if (interp != NULL) {
- *p = save; /* Need entire string. */
- Tcl_AppendResult(interp, "can't find tag or id \"", string,
- "\" in ", Blt_Tree_Name(tree), (char *)NULL);
- }
- goto error;
- }
- }
- if (p != NULL) {
- *p = save;
- }
- *nodePtr = node;
- return TCL_OK;
- }
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find tag or id \"", string, "\" in ",
- Blt_Tree_Name(tree), (char *)NULL);
- }
- error:
- if (p != NULL) {
- *p = save;
- }
- return TCL_ERROR;
-}
-
-typedef struct {
- int tagType;
- Blt_TreeNode root;
- Blt_HashSearch cursor;
-} TagSearch;
-
-/*
- *---------------------------------------------------------------------------
- *
- * FirstTaggedNode --
- *
- * Returns the id of the first node tagged by the given tag in objPtr.
- * It basically hides much of the cumbersome special case details. For
- * example, the special tags "root" and "all" always exist, so they don't
- * have entries in the tag hashtable. If it's a hashed tag (not "root"
- * or "all"), we have to save the place of where we are in the table for
- * the next call to NextTaggedNode.
- *
- *---------------------------------------------------------------------------
- */
-static int
-FirstTaggedNode(Tcl_Interp *interp, TreeCmd *cmdPtr, Tcl_Obj *objPtr,
- TagSearch *cursorPtr, Blt_TreeNode *nodePtr)
-{
- const char *string;
-
- *nodePtr = NULL;
- string = Tcl_GetString(objPtr);
- cursorPtr->tagType = TAG_TYPE_NONE;
- cursorPtr->root = Blt_Tree_RootNode(cmdPtr->tree);
-
- /* Process strings with modifiers or digits as simple ids, not tags. */
- if (GetNodeFromObj(NULL, cmdPtr->tree, objPtr, nodePtr) == TCL_OK) {
- return TCL_OK;
- }
-
- if (strcmp(string, "all") == 0) {
- cursorPtr->tagType = TAG_TYPE_ALL;
- *nodePtr = cursorPtr->root;
- return TCL_OK;
- } else if (strcmp(string, "root") == 0) {
- *nodePtr = cursorPtr->root;
- return TCL_OK;
- } else {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_Tree_TagHashTable(cmdPtr->tree, string);
- if (tablePtr != NULL) {
- Blt_HashEntry *hPtr;
-
- cursorPtr->tagType = TAG_TYPE_TAG;
- hPtr = Blt_FirstHashEntry(tablePtr, &cursorPtr->cursor);
- if (hPtr == NULL) {
- *nodePtr = NULL;
- return TCL_OK;
- }
- *nodePtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
- }
- }
- Tcl_AppendResult(interp, "can't find tag or id \"", string, "\" in ",
- Blt_Tree_Name(cmdPtr->tree), (char *)NULL);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SkipSeparators --
- *
- * Moves the character pointer past one of more separators.
- *
- * Results:
- * Returns the updates character pointer.
- *
- *---------------------------------------------------------------------------
- */
-static char *
-SkipSeparators(char *path, const char *separator, int length)
-{
- while ((*path == *separator) && (strncmp(path, separator, length) == 0)) {
- path += length;
- }
- return path;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SplitPath --
- *
- * Returns the trailing component of the given path. Trailing separators
- * are ignored.
- *
- * Results:
- * Returns the string of the tail component.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SplitPath(Tcl_Interp *interp, char *path, const char *separator, int *argcPtr,
- const char ***argvPtr)
-{
- int skipLen, pathLen;
- int depth;
- size_t listSize;
- const char **components;
- char *p;
- char *sp;
-
- if ((separator == NULL) || (*separator == '\0')) {
- if (Tcl_SplitList(interp, path, argcPtr, argvPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
- }
- pathLen = strlen(path);
- skipLen = strlen(separator);
- path = SkipSeparators(path, separator, skipLen);
- depth = pathLen / skipLen;
-
- listSize = (depth + 1) * sizeof(char *);
- components = Blt_AssertMalloc(listSize + (pathLen + 1));
- p = (char *)components + listSize;
- strcpy(p, path);
-
- depth = 0;
- for (sp = strstr(p, separator); ((*p != '\0') && (sp != NULL));
- sp = strstr(p, separator)) {
- *sp = '\0';
- components[depth++] = p;
- p = SkipSeparators(sp + skipLen, separator, skipLen);
- }
- if (*p != '\0') {
- components[depth++] = p;
- }
- components[depth] = NULL;
- *argcPtr = depth;
- *argvPtr = components;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextTaggedNode --
- *
- *---------------------------------------------------------------------------
- */
-static Blt_TreeNode
-NextTaggedNode(Blt_TreeNode node, TagSearch *cursorPtr)
-{
- if (cursorPtr->tagType == TAG_TYPE_ALL) {
- return Blt_Tree_NextNode(NULL, node);
- }
- if (cursorPtr->tagType == TAG_TYPE_TAG) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_NextHashEntry(&cursorPtr->cursor);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
- }
- return NULL;
-}
-
-static int
-AddTag(TreeCmd *cmdPtr, Blt_TreeNode node, const char *tagName)
-{
- if (strcmp(tagName, "root") == 0) {
- Tcl_AppendResult(cmdPtr->interp, "can't add reserved tag \"",
- tagName, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- Blt_Tree_AddTag(cmdPtr->tree, node, tagName);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteNode --
- *
- *---------------------------------------------------------------------------
- */
-static void
-DeleteNode(TreeCmd *cmdPtr, Blt_TreeNode node)
-{
- Blt_TreeNode root;
-
- if (!Blt_Tree_TagTableIsShared(cmdPtr->tree)) {
- Blt_Tree_ClearTags(cmdPtr->tree, node);
- }
- root = Blt_Tree_RootNode(cmdPtr->tree);
- if (node == root) {
- Blt_TreeNode next;
-
- /* Don't delete the root node. Simply clean out the tree. */
- for (node = Blt_Tree_FirstChild(node); node != NULL; node = next) {
- next = Blt_Tree_NextSibling(node);
- Blt_Tree_DeleteNode(cmdPtr->tree, node);
- }
- } else if (Blt_Tree_IsAncestor(root, node)) {
- Blt_Tree_DeleteNode(cmdPtr->tree, node);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PrintTraceFlags --
- *
- *---------------------------------------------------------------------------
- */
-static void
-PrintTraceFlags(unsigned int flags, char *string)
-{
- char *s;
-
- s = string;
- if (flags & TREE_TRACE_READ) {
- *s++ = 'r';
- }
- if (flags & TREE_TRACE_WRITE) {
- *s++ = 'w';
- }
- if (flags & TREE_TRACE_UNSET) {
- *s++ = 'u';
- }
- if (flags & TREE_TRACE_CREATE) {
- *s++ = 'c';
- }
- *s = '\0';
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetTraceFlags --
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetTraceFlags(const char *string)
-{
- const char *s;
- unsigned int flags;
-
- flags = 0;
- for (s = string; *s != '\0'; s++) {
- int c;
-
- c = toupper(*s);
- switch (c) {
- case 'R':
- flags |= TREE_TRACE_READ;
- break;
- case 'W':
- flags |= TREE_TRACE_WRITE;
- break;
- case 'U':
- flags |= TREE_TRACE_UNSET;
- break;
- case 'C':
- flags |= TREE_TRACE_CREATE;
- break;
- default:
- return -1;
- }
- }
- return flags;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetValues --
- *
- *---------------------------------------------------------------------------
- */
-static int
-SetValues(TreeCmd *cmdPtr, Blt_TreeNode node, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 0; i < objc; i += 2) {
- const char *string;
-
- string = Tcl_GetString(objv[i]);
- if ((i + 1) == objc) {
- Tcl_AppendResult(cmdPtr->interp, "missing value for field \"",
- string, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (Blt_Tree_SetValue(cmdPtr->interp, cmdPtr->tree, node, string,
- objv[i + 1]) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnsetValues --
- *
- *---------------------------------------------------------------------------
- */
-static int
-UnsetValues(TreeCmd *cmdPtr, Blt_TreeNode node, int objc, Tcl_Obj *const *objv)
-{
- if (objc == 0) {
- Blt_TreeKey key;
- Blt_TreeKeyIterator iter;
-
- for (key = Blt_Tree_FirstKey(cmdPtr->tree, node, &iter); key != NULL;
- key = Blt_Tree_NextKey(cmdPtr->tree, &iter)) {
- if (Blt_Tree_UnsetValueByKey(cmdPtr->interp, cmdPtr->tree, node,
- key) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- } else {
- int i;
-
- for (i = 0; i < objc; i ++) {
- if (Blt_Tree_UnsetValue(cmdPtr->interp, cmdPtr->tree, node,
- Tcl_GetString(objv[i])) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-static int
-ComparePatterns(Blt_List patternList, const char *string, int nocase)
-{
- Blt_ListNode node;
- int result;
-
- if (nocase) {
- string = Blt_AssertStrdup(string);
- strtolower((char *)string);
- }
- result = FALSE;
- for (node = Blt_List_FirstNode(patternList); node != NULL;
- node = Blt_List_NextNode(node)) {
- size_t type;
- char *pattern;
-
- type = (size_t)Blt_List_GetValue(node);
- pattern = (char *)Blt_List_GetKey(node);
- switch (type) {
- case PATTERN_EXACT:
- result = (strcmp(string, pattern) == 0);
- break;
-
- case PATTERN_GLOB:
- result = Tcl_StringMatch(string, pattern);
- break;
-
- case PATTERN_REGEXP:
- result = Tcl_RegExpMatch((Tcl_Interp *)NULL, string, pattern);
- break;
- }
- }
- if (nocase) {
- Blt_Free((char *)string);
- }
- return result;
-}
-
-
-static int
-CompareTags(
- Blt_Tree tree,
- Blt_TreeNode node,
- Blt_List tagList)
-{
- Blt_ListNode tn;
-
- for (tn = Blt_List_FirstNode(tagList); tn != NULL;
- tn = Blt_List_NextNode(tn)) {
- char *tag;
-
- tag = (char *)Blt_List_GetKey(tn);
- if (Blt_Tree_HasTag(tree, node, tag)) {
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MatchNodeProc --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-MatchNodeProc(Blt_TreeNode node, ClientData clientData, int order)
-{
- FindSwitches *findPtr = clientData;
- Tcl_DString dString;
- TreeCmd *cmdPtr = findPtr->cmdPtr;
- Tcl_Interp *interp = findPtr->cmdPtr->interp;
- int result, invert;
-
- if ((findPtr->flags & MATCH_LEAFONLY) && (!Blt_Tree_IsLeaf(node))) {
- return TCL_OK;
- }
- if ((findPtr->maxDepth >= 0) &&
- (findPtr->maxDepth < Blt_Tree_NodeDepth(node))) {
- return TCL_OK;
- }
- result = TRUE;
- Tcl_DStringInit(&dString);
- if (findPtr->keyList != NULL) {
- Blt_TreeKey key;
- Blt_TreeKeyIterator iter;
-
- result = FALSE; /* It's false if no keys match. */
- for (key = Blt_Tree_FirstKey(cmdPtr->tree, node, &iter); key != NULL;
- key = Blt_Tree_NextKey(cmdPtr->tree, &iter)) {
-
- result = ComparePatterns(findPtr->keyList, key, 0);
- if (!result) {
- continue;
- }
- if (findPtr->patternList != NULL) {
- const char *string;
- Tcl_Obj *objPtr;
-
- Blt_Tree_GetValue(interp, cmdPtr->tree, node, key, &objPtr);
- string = (objPtr == NULL) ? "" : Tcl_GetString(objPtr);
- result = ComparePatterns(findPtr->patternList, string,
- findPtr->flags & MATCH_NOCASE);
- if (!result) {
- continue;
- }
- }
- break;
- }
- } else if (findPtr->patternList != NULL) {
- const char *string;
-
- if (findPtr->flags & MATCH_PATHNAME) {
- string = Blt_Tree_NodePath(node, &dString);
- } else {
- string = Blt_Tree_NodeLabel(node);
- }
- result = ComparePatterns(findPtr->patternList, string,
- findPtr->flags & MATCH_NOCASE);
- }
- if (findPtr->tagList != NULL) {
- result = CompareTags(cmdPtr->tree, node, findPtr->tagList);
- }
- Tcl_DStringFree(&dString);
-
- invert = (findPtr->flags & MATCH_INVERT) ? TRUE : FALSE;
- if ((result != invert) &&
- /* Check if the matching node is on the exclude list. */
- ((findPtr->excludeTable.numEntries == 0) ||
- (Blt_FindHashEntry(&findPtr->excludeTable, (char *)node) == NULL))) {
- Tcl_Obj *objPtr;
-
- if (findPtr->addTag != NULL) {
- if (AddTag(cmdPtr, node, findPtr->addTag) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- /* Save the node id in our list. */
- objPtr = Tcl_NewLongObj(Blt_Tree_NodeId(node));
- Tcl_ListObjAppendElement(interp, findPtr->listObjPtr, objPtr);
-
- /* Execute a procedure for the matching node. */
- if (findPtr->cmdObjPtr != NULL) {
- Tcl_Obj *cmdObjPtr;
-
- cmdObjPtr = Tcl_DuplicateObj(findPtr->cmdObjPtr);
- Tcl_ListObjAppendElement(interp, cmdObjPtr, objPtr);
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- if (result != TCL_OK) {
- return result;
- }
- }
- findPtr->nMatches++;
- if ((findPtr->maxMatches > 0) &&
- (findPtr->nMatches >= findPtr->maxMatches)) {
- return TCL_BREAK;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ApplyNodeProc --
- *
- *---------------------------------------------------------------------------
- */
-static int
-ApplyNodeProc(Blt_TreeNode node, ClientData clientData, int order)
-{
- ApplySwitches *applyPtr = clientData;
- TreeCmd *cmdPtr = applyPtr->cmdPtr;
- Tcl_Interp *interp = cmdPtr->interp;
- int invert, result;
- Tcl_DString dString;
-
- if ((applyPtr->flags & MATCH_LEAFONLY) && (!Blt_Tree_IsLeaf(node))) {
- return TCL_OK;
- }
- if ((applyPtr->maxDepth >= 0) &&
- (applyPtr->maxDepth < Blt_Tree_NodeDepth(node))) {
- return TCL_OK;
- }
- Tcl_DStringInit(&dString);
- result = TRUE;
- if (applyPtr->keyList != NULL) {
- Blt_TreeKey key;
- Blt_TreeKeyIterator iter;
-
- result = FALSE; /* It's false if no keys match. */
- for (key = Blt_Tree_FirstKey(cmdPtr->tree, node, &iter);
- key != NULL; key = Blt_Tree_NextKey(cmdPtr->tree, &iter)) {
-
- result = ComparePatterns(applyPtr->keyList, key, 0);
- if (!result) {
- continue;
- }
- if (applyPtr->patternList != NULL) {
- const char *string;
- Tcl_Obj *objPtr;
-
- Blt_Tree_GetValue(interp, cmdPtr->tree, node, key, &objPtr);
- string = (objPtr == NULL) ? "" : Tcl_GetString(objPtr);
- result = ComparePatterns(applyPtr->patternList, string,
- applyPtr->flags & MATCH_NOCASE);
- if (!result) {
- continue;
- }
- }
- break;
- }
- } else if (applyPtr->patternList != NULL) {
- const char *string;
-
- if (applyPtr->flags & MATCH_PATHNAME) {
- string = Blt_Tree_NodePath(node, &dString);
- } else {
- string = Blt_Tree_NodeLabel(node);
- }
- result = ComparePatterns(applyPtr->patternList, string,
- applyPtr->flags & MATCH_NOCASE);
- }
- Tcl_DStringFree(&dString);
- if (applyPtr->tagList != NULL) {
- result = CompareTags(cmdPtr->tree, node, applyPtr->tagList);
- }
- invert = (applyPtr->flags & MATCH_INVERT) ? 1 : 0;
- if (result != invert) {
- Tcl_Obj *cmdObjPtr;
-
- if (order == TREE_PREORDER) {
- cmdObjPtr = Tcl_DuplicateObj(applyPtr->preCmdObjPtr);
- } else if (order == TREE_PREORDER) {
- cmdObjPtr = Tcl_DuplicateObj(applyPtr->postCmdObjPtr);
- } else {
- return TCL_OK;
- }
- Tcl_ListObjAppendElement(interp, cmdObjPtr,
- Tcl_NewLongObj(Blt_Tree_NodeId(node)));
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- return result;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClearTracesAndEvents --
- *
- *---------------------------------------------------------------------------
- */
-static void
-ClearTracesAndEvents(TreeCmd *cmdPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Blt_ChainLink link, next;
-
- /*
- * When the tree token is released, all the traces and notification events
- * are automatically removed. But we still need to clean up the
- * bookkeeping kept for traces. Clear all the tags and trace information.
- */
- for (hPtr = Blt_FirstHashEntry(&cmdPtr->traceTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- TraceInfo *tracePtr;
-
- tracePtr = Blt_GetHashValue(hPtr);
- Blt_Free(tracePtr);
- }
- Blt_DeleteHashTable(&cmdPtr->traceTable);
- Blt_InitHashTable(&cmdPtr->traceTable, BLT_STRING_KEYS);
- for (link = Blt_Chain_FirstLink(cmdPtr->notifiers); link != NULL;
- link = next) {
- Notifier *notifyPtr;
-
- next = Blt_Chain_NextLink(link);
- notifyPtr = Blt_Chain_GetValue(link);
- FreeNotifier(cmdPtr, notifyPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReleaseTreeObject --
- *
- *---------------------------------------------------------------------------
- */
-static void
-ReleaseTreeObject(TreeCmd *cmdPtr)
-{
- ClearTracesAndEvents(cmdPtr);
- Blt_Tree_Close(cmdPtr->tree);
- cmdPtr->tree = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeTraceProc --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TreeTraceProc(
- ClientData clientData,
- Tcl_Interp *interp,
- Blt_TreeNode node, /* Node that has just been updated. */
- Blt_TreeKey key, /* Field that's updated. */
- unsigned int flags)
-{
- TraceInfo *tracePtr = clientData;
- Tcl_DString dsName;
- char string[5];
- char *qualName;
- int result;
- Blt_ObjectName objName;
- Tcl_Obj *cmdObjPtr;
-
- cmdObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, cmdObjPtr,
- Tcl_NewStringObj(tracePtr->command, -1));
- Tcl_DStringInit(&dsName);
- objName.name = Tcl_GetCommandName(interp, tracePtr->cmdPtr->cmdToken);
- objName.nsPtr = Blt_GetCommandNamespace(tracePtr->cmdPtr->cmdToken);
- qualName = Blt_MakeQualifiedName(&objName, &dsName);
- Tcl_ListObjAppendElement(interp, cmdObjPtr,
- Tcl_NewStringObj(qualName, -1));
- Tcl_DStringFree(&dsName);
- if (node != NULL) {
- Tcl_ListObjAppendElement(interp, cmdObjPtr,
- Tcl_NewLongObj(Blt_Tree_NodeId(node)));
- } else {
- Tcl_ListObjAppendElement(interp, cmdObjPtr, Tcl_NewStringObj("", -1));
- }
- Tcl_ListObjAppendElement(interp, cmdObjPtr, Tcl_NewStringObj(key, -1));
- PrintTraceFlags(flags, string);
- Tcl_ListObjAppendElement(interp, cmdObjPtr, Tcl_NewStringObj(string, -1));
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeEventProc --
- *
- *---------------------------------------------------------------------------
- */
-static int
-TreeEventProc(ClientData clientData, Blt_TreeNotifyEvent *eventPtr)
-{
- TreeCmd *cmdPtr = clientData;
- Blt_TreeNode node;
- const char *string;
- Blt_ChainLink link, next;
-
- switch (eventPtr->type) {
- case TREE_NOTIFY_CREATE:
- string = "-create";
- break;
-
- case TREE_NOTIFY_DELETE:
- node = Blt_Tree_GetNode(cmdPtr->tree, eventPtr->inode);
- if (node != NULL) {
- Blt_Tree_ClearTags(cmdPtr->tree, node);
- }
- string = "-delete";
- break;
-
- case TREE_NOTIFY_MOVE:
- string = "-move";
- break;
-
- case TREE_NOTIFY_SORT:
- string = "-sort";
- break;
-
- case TREE_NOTIFY_RELABEL:
- string = "-relabel";
- break;
-
- default:
- /* empty */
- string = "???";
- break;
- }
- for (link = Blt_Chain_FirstLink(cmdPtr->notifiers); link != NULL;
- link = next) {
- Notifier *notifyPtr;
- int result;
- Tcl_Obj *cmdObjPtr, *objPtr;
- int remove;
-
- result = TCL_OK;
- next = Blt_Chain_NextLink(link);
- notifyPtr = Blt_Chain_GetValue(link);
- remove = FALSE;
- if (notifyPtr->inode >= 0) {
- /* Test for specific node id. */
- if (notifyPtr->inode != eventPtr->inode) {
- continue; /* No match. */
- }
- if (eventPtr->type == TREE_NOTIFY_DELETE) {
- remove = TRUE; /* Must destroy notifier. Node no
- * longer exists. */
- }
- }
- if ((notifyPtr->tag != NULL) &&
- (!Blt_Tree_HasTag(cmdPtr->tree, eventPtr->node, notifyPtr->tag))) {
- goto next; /* Doesn't have the tag. */
- }
- if ((notifyPtr->mask & eventPtr->type) == 0) {
- goto next; /* Event not matching. */
- }
- cmdObjPtr = Tcl_DuplicateObj(notifyPtr->cmdObjPtr);
- objPtr = Tcl_NewStringObj(string, -1);
- Tcl_ListObjAppendElement(cmdPtr->interp, cmdObjPtr, objPtr);
- objPtr = Tcl_NewLongObj(eventPtr->inode);
- Tcl_ListObjAppendElement(cmdPtr->interp, cmdObjPtr, objPtr);
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(cmdPtr->interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- if (result != TCL_OK) {
- Tcl_BackgroundError(cmdPtr->interp);
- }
- next:
- if (remove) {
- FreeNotifier(cmdPtr, notifyPtr);
- }
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_ResetResult(cmdPtr->interp);
- }
- return TCL_OK;
-}
-
-
-/* Tree command operations. */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ApplyOp --
- *
- * t0 apply root -precommand {command} -postcommand {command}
- *
- *---------------------------------------------------------------------------
- */
-static int
-ApplyOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int result;
- Blt_TreeNode node;
- ApplySwitches switches;
- int order;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- memset(&switches, 0, sizeof(switches));
- switches.maxDepth = -1;
- switches.cmdPtr = cmdPtr;
-
- /* Process switches */
- if (Blt_ParseSwitches(interp, applySwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- order = 0;
- if (switches.flags & MATCH_NOCASE) {
- Blt_ListNode ln;
-
- for (ln = Blt_List_FirstNode(switches.patternList); ln != NULL;
- ln = Blt_List_NextNode(ln)) {
- strtolower((char *)Blt_List_GetKey(ln));
- }
- }
- if (switches.preCmdObjPtr != NULL) {
- order |= TREE_PREORDER;
- }
- if (switches.postCmdObjPtr != NULL) {
- order |= TREE_POSTORDER;
- }
- result = Blt_Tree_ApplyDFS(node, ApplyNodeProc, &switches, order);
- Blt_FreeSwitches(applySwitches, (char *)&switches, 0);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-
-/*ARGSUSED*/
-static int
-AncestorOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- long d1, d2, minDepth;
- long i;
- Blt_TreeNode ancestor, node1, node2;
-
- if ((GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node1) != TCL_OK) ||
- (GetNodeFromObj(interp, cmdPtr->tree, objv[3], &node2) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (node1 == node2) {
- ancestor = node1;
- goto done;
- }
- d1 = Blt_Tree_NodeDepth(node1);
- d2 = Blt_Tree_NodeDepth(node2);
- minDepth = MIN(d1, d2);
- if (minDepth == 0) { /* One of the nodes is root. */
- ancestor = Blt_Tree_RootNode(cmdPtr->tree);
- goto done;
- }
- /*
- * Traverse back from the deepest node, until the both nodes are at the
- * same depth. Check if the ancestor node found is the other node.
- */
- for (i = d1; i > minDepth; i--) {
- node1 = Blt_Tree_ParentNode(node1);
- }
- if (node1 == node2) {
- ancestor = node2;
- goto done;
- }
- for (i = d2; i > minDepth; i--) {
- node2 = Blt_Tree_ParentNode(node2);
- }
- if (node2 == node1) {
- ancestor = node1;
- goto done;
- }
-
- /*
- * First find the mutual ancestor of both nodes. Look at each preceding
- * ancestor level-by-level for both nodes. Eventually we'll find a node
- * that's the parent of both ancestors. Then find the first ancestor in
- * the parent's list of subnodes.
- */
- for (i = minDepth; i > 0; i--) {
- node1 = Blt_Tree_ParentNode(node1);
- node2 = Blt_Tree_ParentNode(node2);
- if (node1 == node2) {
- ancestor = node2;
- goto done;
- }
- }
- Tcl_AppendResult(interp, "unknown ancestor", (char *)NULL);
- return TCL_ERROR;
- done:
- Tcl_SetLongObj(Tcl_GetObjResult(interp), Blt_Tree_NodeId(ancestor));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AttachOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-AttachOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- const char *treeName;
- AttachSwitches switches;
-
- treeName = Tcl_GetString(objv[2]);
- switches.mask = 0;
- /* Process switches */
- if (Blt_ParseSwitches(interp, attachSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (Blt_Tree_Attach(interp, cmdPtr->tree, treeName) != TCL_OK) {
- return TCL_ERROR;
- }
- if (switches.mask & TREE_NEWTAGS) {
- Blt_Tree_NewTagTable(cmdPtr->tree);
- }
- ClearTracesAndEvents(cmdPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChildrenOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-ChildrenOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 3) {
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (node = Blt_Tree_FirstChild(node); node != NULL;
- node = Blt_Tree_NextSibling(node)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewLongObj(Blt_Tree_NodeId(node));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- } else if (objc == 4) {
- long childPos;
- long inode;
- long count;
-
- /* Get the node at */
- if (Tcl_GetLongFromObj(interp, objv[3], &childPos) != TCL_OK) {
- return TCL_ERROR;
- }
- count = 0;
- inode = -1;
- for (node = Blt_Tree_FirstChild(node); node != NULL;
- node = Blt_Tree_NextSibling(node)) {
- if (count == childPos) {
- inode = Blt_Tree_NodeId(node);
- break;
- }
- count++;
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
- } else if (objc == 5) {
- long firstPos, lastPos;
- long count;
- Tcl_Obj *listObjPtr;
- char *string;
-
- firstPos = lastPos = Blt_Tree_NodeDegree(node) - 1;
- string = Tcl_GetString(objv[3]);
- if ((strcmp(string, "end") != 0) &&
- (Tcl_GetLongFromObj(interp, objv[3], &firstPos) != TCL_OK)) {
- return TCL_ERROR;
- }
- string = Tcl_GetString(objv[4]);
- if ((strcmp(string, "end") != 0) &&
- (Tcl_GetLongFromObj(interp, objv[4], &lastPos) != TCL_OK)) {
- return TCL_ERROR;
- }
-
- count = 0;
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (node = Blt_Tree_FirstChild(node); node != NULL;
- node = Blt_Tree_NextSibling(node)) {
- if ((count >= firstPos) && (count <= lastPos)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewLongObj(Blt_Tree_NodeId(node));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- count++;
- }
- Tcl_SetObjResult(interp, listObjPtr);
- }
- return TCL_OK;
-}
-
-
-static Blt_TreeNode
-CopyNodes(
- CopySwitches *copyPtr,
- Blt_TreeNode node, /* Node to be copied. */
- Blt_TreeNode parent) /* New parent for the copied node. */
-{
- Blt_TreeNode newNode; /* Newly created copy. */
- const char *label;
-
- newNode = NULL;
- label = Blt_Tree_NodeLabel(node);
- if (copyPtr->flags & COPY_OVERWRITE) {
- newNode = Blt_Tree_FindChild(parent, label);
- }
- if (newNode == NULL) { /* Create node in new parent. */
- newNode = Blt_Tree_CreateNode(copyPtr->destTree, parent, label, -1);
- }
- /* Copy the data fields. */
- {
- Blt_TreeKey key;
- Blt_TreeKeyIterator iter;
-
- for (key = Blt_Tree_FirstKey(copyPtr->srcTree, node, &iter);
- key != NULL; key = Blt_Tree_NextKey(copyPtr->srcTree, &iter)) {
- Tcl_Obj *objPtr;
-
- if (Blt_Tree_GetValueByKey((Tcl_Interp *)NULL, copyPtr->srcTree,
- node, key, &objPtr) == TCL_OK) {
- Blt_Tree_SetValueByKey((Tcl_Interp *)NULL, copyPtr->destTree,
- newNode, key, objPtr);
- }
- }
- }
- /* Add tags to destination tree command. */
- if ((copyPtr->destPtr != NULL) && (copyPtr->flags & COPY_TAGS)) {
- Blt_HashSearch iter;
- Blt_HashEntry *hPtr;
-
- for (hPtr = Blt_Tree_FirstTag(copyPtr->srcPtr->tree, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Blt_HashEntry *h2Ptr;
- Blt_TreeTagEntry *tPtr;
-
- tPtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(&tPtr->nodeTable, (char *)node);
- if (h2Ptr != NULL) {
- if (AddTag(copyPtr->destPtr, newNode, tPtr->tagName)!= TCL_OK) {
- return NULL;
- }
- }
- }
- }
- if (copyPtr->flags & COPY_RECURSE) {
- Blt_TreeNode child;
-
- for (child = Blt_Tree_FirstChild(node); child != NULL;
- child = Blt_Tree_NextSibling(child)) {
- if (CopyNodes(copyPtr, child, newNode) == NULL) {
- return NULL;
- }
- }
- }
- return newNode;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CopyOp --
- *
- * t0 copy node tree node
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CopyOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeCmd *srcPtr, *destPtr;
- Blt_Tree srcTree, destTree;
- Blt_TreeNode copyNode;
- Blt_TreeNode parent;
- CopySwitches switches;
- int nArgs, nSwitches;
- Blt_TreeNode root;
- int i;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &parent) != TCL_OK) {
- return TCL_ERROR;
- }
- srcTree = destTree = cmdPtr->tree;
- srcPtr = destPtr = cmdPtr;
-
- /* Find the first switch. */
- for(i = 3; i < objc; i++) {
- char *string;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] == '-') {
- break;
- }
- }
- nArgs = i - 2;
- nSwitches = objc - i;
- if ((nArgs < 2) || (nArgs > 3)) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]),
- " copy parent ?tree? node ?switches?",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (nArgs == 3) {
- char *string;
-
- /*
- * The tree name is either the name of a tree command (first choice)
- * or an internal tree object.
- */
- string = Tcl_GetString(objv[3]);
- srcPtr = GetTreeCmd(cmdPtr->tdPtr, interp, string);
- if (srcPtr != NULL) {
- srcTree = srcPtr->tree;
- } else {
- /* Try to get the tree as an internal tree data object. */
- srcTree = Blt_Tree_Open(interp, string, 0);
- if (srcTree == NULL) {
- return TCL_ERROR;
- }
- }
- objv++;
- }
-
- root = NULL;
- if (srcPtr == NULL) {
- if (GetForeignNode(interp, srcTree, objv[3], ©Node) != TCL_OK) {
- goto error;
- }
- } else {
- if (GetNodeFromObj(interp, srcPtr->tree, objv[3], ©Node) != TCL_OK) {
- goto error;
- }
- }
- memset((char *)&switches, 0, sizeof(switches));
- switches.destPtr = destPtr;
- switches.destTree = destTree;
- switches.srcPtr = srcPtr;
- switches.srcTree = srcTree;
-
- /* Process switches */
- if (Blt_ParseSwitches(interp, copySwitches, nSwitches, objv + 4, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- goto error;
- }
- if ((switches.flags & COPY_OVERWRITE) &&
- (Blt_Tree_ParentNode(copyNode) == parent)) {
- Tcl_AppendResult(interp, "source and destination nodes are the same",
- (char *)NULL);
- goto error;
- }
- if ((srcTree == destTree) && (switches.flags & COPY_RECURSE) &&
- (Blt_Tree_IsAncestor(copyNode, parent))) {
- Tcl_AppendResult(interp, "can't make cyclic copy: ",
- "source node is an ancestor of the destination",
- (char *)NULL);
- goto error;
- }
-
- /* Copy nodes to destination. */
- root = CopyNodes(&switches, copyNode, parent);
- if (root != NULL) {
- if (switches.label != NULL) {
- Blt_Tree_RelabelNode(switches.destTree, root, switches.label);
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), Blt_Tree_NodeId(root));
- }
- error:
- if (srcPtr == NULL) {
- Blt_Tree_Close(srcTree);
- }
- return (root == NULL) ? TCL_ERROR : TCL_OK;
-
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DegreeOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DegreeOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), Blt_Tree_NodeDegree(node));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Deletes one or more nodes from the tree. Nodes may be specified by
- * their id (a number) or a tag.
- *
- * Tags have to be handled carefully here. We can't use the normal
- * GetTaggedNode, NextTaggedNode, etc. routines because they walk
- * hashtables while we're deleting nodes. Also, remember that deleting a
- * node recursively deletes all its children. If a parent and its
- * children have the same tag, its possible that the tag list may contain
- * nodes than no longer exist. So save the node indices in a list and
- * then delete then in a second pass.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DeleteOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
- char *string;
-
- string = NULL;
- for (i = 2; i < objc; i++) {
- string = Tcl_GetString(objv[i]);
- if (IsNodeIdOrModifier(string)) {
- Blt_TreeNode node;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[i], &node) != TCL_OK){
- return TCL_ERROR;
- }
- DeleteNode(cmdPtr, node);
- } else {
- Blt_Chain chain;
- Blt_ChainLink link, next;
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Blt_HashTable *tablePtr;
-
- if ((strcmp(string, "all") == 0) || (strcmp(string, "root") == 0)) {
- Blt_TreeNode node;
-
- node = Blt_Tree_RootNode(cmdPtr->tree);
- DeleteNode(cmdPtr, node);
- continue;
- }
- tablePtr = Blt_Tree_TagHashTable(cmdPtr->tree, string);
- if (tablePtr == NULL) {
- goto error;
- }
- /*
- * Generate a list of tagged nodes. Save the inode instead of the
- * node itself since a pruned branch may contain more tagged
- * nodes.
- */
- chain = Blt_Chain_Create();
- for (hPtr = Blt_FirstHashEntry(tablePtr, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Blt_TreeNode node;
-
- node = Blt_GetHashValue(hPtr);
- Blt_Chain_Append(chain, (ClientData)Blt_Tree_NodeId(node));
- }
- /*
- * Iterate through this list to delete the nodes. By side-effect
- * the tag table is deleted and Uids are released.
- */
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = next) {
- Blt_TreeNode node;
- long inode;
-
- next = Blt_Chain_NextLink(link);
- inode = (long)Blt_Chain_GetValue(link);
- node = Blt_Tree_GetNode(cmdPtr->tree, inode);
- if (node != NULL) {
- DeleteNode(cmdPtr, node);
- }
- }
- Blt_Chain_Destroy(chain);
- }
- }
- return TCL_OK;
- error:
- Tcl_AppendResult(interp, "can't find tag or id \"", string, "\" in ",
- Blt_Tree_Name(cmdPtr->tree), (char *)NULL);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DepthOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DepthOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), Blt_Tree_NodeDepth(node));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DumpOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DumpOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode top;
- Tcl_DString dString;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &top) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_DStringInit(&dString);
- Blt_Tree_Dump(cmdPtr->tree, top, &dString);
- Tcl_DStringResult(interp, &dString);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DumpfileOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DumpfileOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode top;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &top) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_Tree_DumpToFile(interp, cmdPtr->tree, top,
- Tcl_GetString(objv[3]));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExistsOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-ExistsOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- int bool;
-
- bool = TRUE;
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- bool = FALSE;
- } else if (objc == 4) {
- Tcl_Obj *valueObjPtr;
- char *string;
-
- string = Tcl_GetString(objv[3]);
- if (Blt_Tree_GetValue((Tcl_Interp *)NULL, cmdPtr->tree, node,
- string, &valueObjPtr) != TCL_OK) {
- bool = FALSE;
- }
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExportOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-ExportOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- DataFormat *fmtPtr;
- TreeCmdInterpData *dataPtr;
-
- dataPtr = GetTreeCmdInterpData(interp);
- if (objc == 2) {
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->fmtTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- fmtPtr = Blt_GetHashValue(hPtr);
- if (fmtPtr->exportProc != NULL) {
- Tcl_AppendElement(interp, fmtPtr->name);
- }
- }
- return TCL_OK;
- }
- hPtr = Blt_FindHashEntry(&dataPtr->fmtTable, Tcl_GetString(objv[2]));
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "can't export \"", Tcl_GetString(objv[2]),
- "\": format not registered", (char *)NULL);
- return TCL_ERROR;
- }
- fmtPtr = Blt_GetHashValue(hPtr);
- if (fmtPtr->exportProc == NULL) {
- Tcl_AppendResult(interp, "no export procedure registered for \"",
- fmtPtr->name, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- return (*fmtPtr->exportProc) (interp, cmdPtr->tree, objc, objv);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-FindOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- FindSwitches switches;
- int result;
- Tcl_Obj **objArr;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- memset(&switches, 0, sizeof(switches));
- switches.maxDepth = -1;
- switches.order = TREE_POSTORDER;
- switches.cmdPtr = cmdPtr;
- Blt_InitHashTable(&switches.excludeTable, BLT_ONE_WORD_KEYS);
- objArr = NULL;
-
- /* Process switches */
- if (Blt_ParseSwitches(interp, findSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (switches.maxDepth >= 0) {
- switches.maxDepth += Blt_Tree_NodeDepth(node);
- }
- if (switches.flags & MATCH_NOCASE) {
- Blt_ListNode lnode;
-
- for (lnode = Blt_List_FirstNode(switches.patternList); lnode != NULL;
- lnode = Blt_List_NextNode(lnode)) {
- strtolower((char *)Blt_List_GetKey(lnode));
- }
- }
- switches.listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- switches.cmdPtr = cmdPtr;
- if (switches.order == TREE_BREADTHFIRST) {
- result = Blt_Tree_ApplyBFS(node, MatchNodeProc, &switches);
- } else {
- result = Blt_Tree_ApplyDFS(node, MatchNodeProc, &switches,
- switches.order);
- }
- Blt_FreeSwitches(findSwitches, (char *)&switches, 0);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- Tcl_SetObjResult(interp, switches.listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindChildOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-FindChildOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode parent, child;
- long inode;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &parent) != TCL_OK) {
- return TCL_ERROR;
- }
- inode = -1;
- child = Blt_Tree_FindChild(parent, Tcl_GetString(objv[3]));
- if (child != NULL) {
- inode = Blt_Tree_NodeId(child);
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FirstChildOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-FirstChildOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- long inode;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- inode = -1;
- node = Blt_Tree_FirstChild(node);
- if (node != NULL) {
- inode = Blt_Tree_NodeId(node);
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 3) {
- Blt_TreeKey key;
- Tcl_Obj *valueObjPtr, *listObjPtr;
- Blt_TreeKeyIterator iter;
-
- /* Add the key-value pairs to a new Tcl_Obj */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (key = Blt_Tree_FirstKey(cmdPtr->tree, node, &iter); key != NULL;
- key = Blt_Tree_NextKey(cmdPtr->tree, &iter)) {
- if (Blt_Tree_GetValue((Tcl_Interp *)NULL, cmdPtr->tree, node, key,
- &valueObjPtr) == TCL_OK) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(key, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- Tcl_ListObjAppendElement(interp, listObjPtr, valueObjPtr);
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- } else {
- Tcl_Obj *valueObjPtr;
- const char *string;
-
- string = Tcl_GetString(objv[3]);
- if (Blt_Tree_GetValue((Tcl_Interp *)NULL, cmdPtr->tree, node, string,
- &valueObjPtr) != TCL_OK) {
- if (objc == 4) {
- Tcl_DString dString;
- const char *path;
-
- Tcl_DStringInit(&dString);
- path = Blt_Tree_NodePath(node, &dString);
- Tcl_AppendResult(interp, "can't find field \"", string,
- "\" in \"", path, "\"", (char *)NULL);
- Tcl_DStringFree(&dString);
- return TCL_ERROR;
- }
- /* Default to given value */
- valueObjPtr = objv[4];
- }
- Tcl_SetObjResult(interp, valueObjPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImportOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ImportOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- DataFormat *fmtPtr;
- TreeCmdInterpData *dataPtr;
-
- dataPtr = GetTreeCmdInterpData(interp);
- if (objc == 2) {
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->fmtTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- fmtPtr = Blt_GetHashValue(hPtr);
- if (fmtPtr->importProc != NULL) {
- Tcl_AppendElement(interp, fmtPtr->name);
- }
- }
- return TCL_OK;
- }
- hPtr = Blt_FindHashEntry(&dataPtr->fmtTable, Tcl_GetString(objv[2]));
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "can't import \"", Tcl_GetString(objv[2]),
- "\": format not registered", (char *)NULL);
- return TCL_ERROR;
- }
- fmtPtr = Blt_GetHashValue(hPtr);
- if (fmtPtr->importProc == NULL) {
- Tcl_AppendResult(interp, "no import procedure registered for \"",
- fmtPtr->name, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- return (*fmtPtr->importProc) (interp, cmdPtr->tree, objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IndexOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- long inode;
- char *string;
-
- inode = -1;
- string = Tcl_GetString(objv[2]);
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) == TCL_OK) {
- if (node != NULL) {
- inode = Blt_Tree_NodeId(node);
- }
- } else {
- int i;
- Blt_TreeNode parent;
- Tcl_Obj **pathv;
- int pathc;
-
- if (Tcl_ListObjGetElements(interp, objv[2], &pathc, &pathv) != TCL_OK) {
- goto done; /* Can't split object. */
- }
- /* Start from the root and verify each path component. */
- parent = Blt_Tree_RootNode(cmdPtr->tree);
- for (i = 0; i < pathc; i++) {
- string = Tcl_GetString(pathv[i]);
- if (string[0] == '\0') {
- continue; /* Skip null separators. */
- }
- node = Blt_Tree_FindChild(parent, string);
- if (node == NULL) {
- goto done; /* Can't find component */
- }
- parent = node;
- }
- inode = Blt_Tree_NodeId(node);
- }
- done:
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InsertOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-InsertOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode parent, child;
- InsertSwitches switches;
-
- child = NULL;
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &parent) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Initialize switch flags */
- memset(&switches, 0, sizeof(switches));
- switches.position = -1; /* Default to append node. */
- switches.parent = parent;
- switches.inode = -1;
-
- if (Blt_ParseSwitches(interp, insertSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- goto error;
- }
- if (switches.inode > 0) {
- Blt_TreeNode node;
-
- node = Blt_Tree_GetNode(cmdPtr->tree, switches.inode);
- if (node != NULL) {
- Tcl_AppendResult(interp, "can't reissue node id \"",
- Blt_Ltoa(switches.inode), "\": id already exists.",
- (char *)NULL);
- goto error;
- }
- child = Blt_Tree_CreateNodeWithId(cmdPtr->tree, parent, switches.label,
- switches.inode, switches.position);
- } else {
- child = Blt_Tree_CreateNode(cmdPtr->tree, parent, switches.label,
- switches.position);
- }
- if (child == NULL) {
- Tcl_AppendResult(interp, "can't allocate new node", (char *)NULL);
- goto error;
- }
- if (switches.label == NULL) {
- char string[200];
-
- sprintf_s(string, 200, "node%ld", Blt_Tree_NodeId(child));
- Blt_Tree_RelabelNodeWithoutNotify(child, string);
- }
- if (switches.tagsObjPtr != NULL) {
- int i, nTags;
- Tcl_Obj **tags;
-
- if (Tcl_ListObjGetElements(interp, switches.tagsObjPtr, &nTags, &tags)
- != TCL_OK) {
- goto error;
- }
- for (i = 0; i < nTags; i++) {
- if (AddTag(cmdPtr, child, Tcl_GetString(tags[i])) != TCL_OK) {
- goto error;
- }
- }
- }
- if (switches.dataPairs != NULL) {
- char **p;
-
- for (p = switches.dataPairs; *p != NULL; p++) {
- Tcl_Obj *objPtr;
- char *key;
-
- key = *p;
- p++;
- if (*p == NULL) {
- Tcl_AppendResult(interp, "missing value for \"", key, "\"",
- (char *)NULL);
- goto error;
- }
- objPtr = Tcl_NewStringObj(*p, -1);
- if (Blt_Tree_SetValue(interp, cmdPtr->tree, child, key, objPtr)
- != TCL_OK) {
- Tcl_DecrRefCount(objPtr);
- goto error;
- }
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), Blt_Tree_NodeId(child));
- Blt_FreeSwitches(insertSwitches, (char *)&switches, 0);
- return TCL_OK;
-
- error:
- if (child != NULL) {
- Blt_Tree_DeleteNode(cmdPtr->tree, child);
- }
- Blt_FreeSwitches(insertSwitches, (char *)&switches, 0);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsAncestorOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IsAncestorOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node1, node2;
- int bool;
-
- if ((GetNodeFromObj(interp, cmdPtr->tree, objv[3], &node1) != TCL_OK) ||
- (GetNodeFromObj(interp, cmdPtr->tree, objv[4], &node2) != TCL_OK)) {
- return TCL_ERROR;
- }
- bool = Blt_Tree_IsAncestor(node1, node2);
- Tcl_SetIntObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsBeforeOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IsBeforeOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node1, node2;
- int bool;
-
- if ((GetNodeFromObj(interp, cmdPtr->tree, objv[3], &node1) != TCL_OK) ||
- (GetNodeFromObj(interp, cmdPtr->tree, objv[4], &node2) != TCL_OK)) {
- return TCL_ERROR;
- }
- bool = Blt_Tree_IsBefore(node1, node2);
- Tcl_SetIntObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsLeafOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IsLeafOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[3], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), Blt_Tree_IsLeaf(node));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsRootOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IsRootOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- int bool;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[3], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- bool = (node == Blt_Tree_RootNode(cmdPtr->tree));
- Tcl_SetIntObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IsOp --
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec isOps[] =
-{
- {"ancestor", 1, IsAncestorOp, 5, 5, "node1 node2",},
- {"before", 1, IsBeforeOp, 5, 5, "node1 node2",},
- {"leaf", 2, IsLeafOp, 4, 4, "node",},
- {"root", 1, IsRootOp, 4, 4, "node",},
-};
-
-static int nIsOps = sizeof(isOps) / sizeof(Blt_OpSpec);
-
-static int
-IsOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nIsOps, isOps, BLT_OP_ARG2, objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (cmdPtr, interp, objc, objv);
- return result;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * KeysOp --
- *
- * Returns the key names of values for a node or array value.
- *
- *---------------------------------------------------------------------------
- */
-static int
-KeysOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashTable keyTable;
- int i;
-
- Blt_InitHashTableWithPool(&keyTable, BLT_ONE_WORD_KEYS);
- for (i = 2; i < objc; i++) {
- Blt_TreeNode node;
- TagSearch iter;
- int isNew;
-
- if (FirstTaggedNode(interp, cmdPtr, objv[i], &iter, &node)
- != TCL_OK) {
- return TCL_ERROR;
- }
- for (/* empty */; node != NULL; node = NextTaggedNode(node, &iter)) {
- Blt_TreeKey key;
- Blt_TreeKeyIterator keyIter;
-
- for (key = Blt_Tree_FirstKey(cmdPtr->tree, node, &keyIter);
- key != NULL; key = Blt_Tree_NextKey(cmdPtr->tree, &keyIter)) {
- Blt_CreateHashEntry(&keyTable, key, &isNew);
- }
- }
- }
- {
- Blt_HashSearch tagSearch;
- Blt_HashEntry *hPtr;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (hPtr = Blt_FirstHashEntry(&keyTable, &tagSearch); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&tagSearch)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(Blt_GetHashKey(&keyTable, hPtr), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- }
- Blt_DeleteHashTable(&keyTable);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LabelOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-LabelOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 4) {
- Blt_Tree_RelabelNode(cmdPtr->tree, node, Tcl_GetString(objv[3]));
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Blt_Tree_NodeLabel(node), -1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LastChildOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-LastChildOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- long inode;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- node = Blt_Tree_LastChild(node);
- inode = (node != NULL) ? Blt_Tree_NodeId(node) : -1 ;
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MoveOp --
- *
- * The trick here is to not consider the node to be moved in determining
- * it's new location. Ideally, you would temporarily pull it from the
- * tree and replace it (back in its old location if something went
- * wrong), but you could still pick the node by its serial number. So
- * here we make lots of checks for the node to be moved.
- *
- *---------------------------------------------------------------------------
- */
-static int
-MoveOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode root, parent, node;
- Blt_TreeNode before;
- MoveSwitches switches;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[3], &parent) != TCL_OK) {
- return TCL_ERROR;
- }
- root = Blt_Tree_RootNode(cmdPtr->tree);
- if (node == root) {
- Tcl_AppendResult(interp, "can't move root node", (char *)NULL);
- return TCL_ERROR;
- }
- if (parent == node) {
- Tcl_AppendResult(interp, "can't move node to self", (char *)NULL);
- return TCL_ERROR;
- }
- switches.node = NULL;
- switches.cmdPtr = cmdPtr;
- switches.movePos = -1;
- nodeSwitch.clientData = cmdPtr->tree;
- /* Process switches */
- if (Blt_ParseSwitches(interp, moveSwitches, objc - 4, objv + 4, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- /* Verify they aren't ancestors. */
- if (Blt_Tree_IsAncestor(node, parent)) {
- Tcl_AppendResult(interp, "can't move node: \"",
- Tcl_GetString(objv[2]), (char *)NULL);
- Tcl_AppendResult(interp, "\" is an ancestor of \"",
- Tcl_GetString(objv[3]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- before = NULL; /* If before is NULL, this appends the node to
- * the parent's child list. */
-
- if (switches.node != NULL) { /* -before or -after */
- if (Blt_Tree_ParentNode(switches.node) != parent) {
- Tcl_AppendResult(interp, Tcl_GetString(objv[2]),
- " isn't the parent of ", Blt_Tree_NodeLabel(switches.node),
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Blt_SwitchChanged(moveSwitches, "-before", (char *)NULL)) {
- before = switches.node;
- if (before == node) {
- Tcl_AppendResult(interp, "can't move node before itself",
- (char *)NULL);
- return TCL_ERROR;
- }
- } else {
- before = Blt_Tree_NextSibling(switches.node);
- if (before == node) {
- Tcl_AppendResult(interp, "can't move node after itself",
- (char *)NULL);
- return TCL_ERROR;
- }
- }
- } else if (switches.movePos >= 0) { /* -at */
- int count; /* Tracks the current list index. */
- Blt_TreeNode child;
-
- /*
- * If the node is in the list, ignore it when determining the "before"
- * node using the -at index. An index of -1 means to append the node
- * to the list.
- */
- count = 0;
- for(child = Blt_Tree_FirstChild(parent); child != NULL;
- child = Blt_Tree_NextSibling(child)) {
- if (child == node) {
- continue; /* Ignore the node to be moved. */
- }
- if (count == switches.movePos) {
- before = child;
- break;
- }
- count++;
- }
- }
- if (Blt_Tree_MoveNode(cmdPtr->tree, node, parent, before) != TCL_OK) {
- Tcl_AppendResult(interp, "can't move node ", Tcl_GetString(objv[2]),
- " to ", Tcl_GetString(objv[3]), (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NextOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- long inode;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- node = Blt_Tree_NextNode(NULL, node);
- inode = (node != NULL) ? Blt_Tree_NodeId(node) : -1;
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextSiblingOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NextSiblingOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- long inode;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- inode = -1;
- node = Blt_Tree_NextSibling(node);
- if (node != NULL) {
- inode = Blt_Tree_NodeId(node);
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyCreateOp --
- *
- * tree0 notify create ?flags? command arg
- *---------------------------------------------------------------------------
- */
-static int
-NotifyCreateOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Notifier *notifyPtr;
- NotifySwitches switches;
- int i;
-
- nodeSwitch.clientData = cmdPtr->tree;
- memset(&switches, 0, sizeof(switches));
- /* Process switches */
- i = Blt_ParseSwitches(interp, notifySwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_OBJV_PARTIAL);
- if (i < 0) {
- return TCL_ERROR;
- }
- objc -= 3 + i;
- objv += 3 + i;
- notifyPtr = Blt_AssertCalloc(1, sizeof(Notifier));
- notifyPtr->inode = -1;
- if (switches.node != NULL) {
- notifyPtr->inode = Blt_Tree_NodeId(switches.node);
- }
- if (switches.tag != NULL) {
- notifyPtr->tag = Blt_Strdup(switches.tag);
- }
- notifyPtr->cmdObjPtr = Tcl_NewListObj(objc, objv);
- Tcl_IncrRefCount(notifyPtr->cmdObjPtr);
- notifyPtr->cmdPtr = cmdPtr;
- if (switches.mask == 0) {
- switches.mask = TREE_NOTIFY_ALL;
- }
- notifyPtr->mask = switches.mask;
-
- {
- Blt_HashEntry *hPtr;
- char idString[200];
- int isNew;
-
- sprintf_s(idString, 200, "notify%d", cmdPtr->notifyCounter++);
- hPtr = Blt_CreateHashEntry(&cmdPtr->notifyTable, idString, &isNew);
- assert(isNew);
- notifyPtr->link = Blt_Chain_Append(cmdPtr->notifiers, notifyPtr);
- Blt_SetHashValue(hPtr, notifyPtr);
- notifyPtr->hashPtr = hPtr;
- Tcl_SetStringObj(Tcl_GetObjResult(interp), idString, -1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyDeleteOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-NotifyDeleteOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- Blt_HashEntry *hPtr;
- Notifier *notifyPtr;
- char *string;
-
- string = Tcl_GetString(objv[i]);
- hPtr = Blt_FindHashEntry(&cmdPtr->notifyTable, string);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "unknown notify name \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- notifyPtr = Blt_GetHashValue(hPtr);
- FreeNotifier(cmdPtr, notifyPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyInfoOp --
- *
- *---------------------------------------------------------------------------
- */
-
-/*ARGSUSED*/
-static int
-NotifyInfoOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Notifier *notifyPtr;
- Blt_HashEntry *hPtr;
- Tcl_DString dString;
- char *string;
-
- string = Tcl_GetString(objv[3]);
- hPtr = Blt_FindHashEntry(&cmdPtr->notifyTable, string);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "unknown notify name \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- notifyPtr = Blt_GetHashValue(hPtr);
-
- Tcl_DStringInit(&dString);
- Tcl_DStringAppendElement(&dString, string); /* Copy notify Id */
- Tcl_DStringStartSublist(&dString);
- if (notifyPtr->mask & TREE_NOTIFY_CREATE) {
- Tcl_DStringAppendElement(&dString, "-create");
- }
- if (notifyPtr->mask & TREE_NOTIFY_DELETE) {
- Tcl_DStringAppendElement(&dString, "-delete");
- }
- if (notifyPtr->mask & TREE_NOTIFY_MOVE) {
- Tcl_DStringAppendElement(&dString, "-move");
- }
- if (notifyPtr->mask & TREE_NOTIFY_SORT) {
- Tcl_DStringAppendElement(&dString, "-sort");
- }
- if (notifyPtr->mask & TREE_NOTIFY_RELABEL) {
- Tcl_DStringAppendElement(&dString, "-relabel");
- }
- if (notifyPtr->mask & TREE_NOTIFY_WHENIDLE) {
- Tcl_DStringAppendElement(&dString, "-whenidle");
- }
- Tcl_DStringEndSublist(&dString);
- Tcl_DStringStartSublist(&dString);
- Tcl_DStringAppendElement(&dString, Tcl_GetString(notifyPtr->cmdObjPtr));
- Tcl_DStringEndSublist(&dString);
- Tcl_DStringResult(interp, &dString);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyNamesOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NotifyNamesOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Not used. */
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (hPtr = Blt_FirstHashEntry(&cmdPtr->notifyTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Tcl_Obj *objPtr;
- char *notifyId;
-
- notifyId = Blt_GetHashKey(&cmdPtr->notifyTable, hPtr);
- objPtr = Tcl_NewStringObj(notifyId, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyOp --
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec notifyOps[] =
-{
- {"create", 1, NotifyCreateOp, 4, 0, "?flags? command",},
- {"delete", 1, NotifyDeleteOp, 3, 0, "notifyId...",},
- {"info", 1, NotifyInfoOp, 4, 4, "notifyId",},
- {"names", 1, NotifyNamesOp, 3, 3, "",},
-};
-
-static int nNotifyOps = sizeof(notifyOps) / sizeof(Blt_OpSpec);
-
-static int
-NotifyOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nNotifyOps, notifyOps, BLT_OP_ARG2, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (cmdPtr, interp, objc, objv);
- return result;
-}
-
-
-/*ARGSUSED*/
-static int
-ParentOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- long inode;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- inode = -1;
- node = Blt_Tree_ParentNode(node);
- if (node != NULL) {
- inode = Blt_Tree_NodeId(node);
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PathOp --
- *
- * $tree path $node
- * $t path $node -separator
- * $t path $node $path -separator /
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PathOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode parent;
- long inode;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &parent) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 3) {
- Tcl_DString dString;
-
- Tcl_DStringInit(&dString);
- Blt_Tree_NodePath(parent, &dString);
- Tcl_DStringResult(interp, &dString);
- return TCL_OK;
- } else {
- Blt_TreeNode child;
- PathSwitches switches;
- const char **argv;
- int argc;
- int i;
- int result;
- const char *path;
-
- /* Process switches */
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, pathSwitches, objc - 4, objv + 4,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- result = SplitPath(interp, Tcl_GetString(objv[3]), switches.separator,
- &argc, &argv);
- Blt_FreeSwitches(pathSwitches, (char *)&switches, 0);
- if (argc == 0) {
- goto done;
- }
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 0; i < (argc - 1); i++) {
- Blt_TreeNode child;
-
- child = Blt_Tree_FindChild(parent, argv[i]);
- if (child == NULL) {
- if (switches.flags & PATH_PARENTS) {
- child = Blt_Tree_CreateNode(cmdPtr->tree, parent, argv[i],
- -1);
- } else if (switches.flags & PATH_NOCOMPLAIN) {
- parent = NULL;
- goto done;
- } else {
- Tcl_DString ds;
-
- Tcl_DStringInit(&ds);
- Tcl_AppendResult(interp, "can't find \"", argv[i], "\" in ",
- Blt_Tree_NodePath(parent, &ds), "\"", (char *)NULL);
- Tcl_DStringFree(&ds);
- Blt_Free(argv);
- return TCL_ERROR;
- }
- }
- parent = child;
- }
- child = Blt_Tree_FindChild(parent, argv[i]);
- if (child == NULL) {
- if (switches.flags & (PATH_PARENTS | PATH_LEAF)) {
- child = Blt_Tree_CreateNode(cmdPtr->tree, parent, argv[i], -1);
- } else if (switches.flags & PATH_NOCOMPLAIN){
- parent = NULL;
- goto done;
- } else {
- Tcl_DString ds;
-
- Tcl_DStringInit(&ds);
- Tcl_AppendResult(interp, "can't find \"", argv[i], "\" in ",
- Blt_Tree_NodePath(parent, &ds), "\"", (char *)NULL);
- Tcl_DStringFree(&ds);
- Blt_Free(argv);
- return TCL_ERROR;
- }
- }
- parent = child;
- done:
- Blt_Free(argv);
- }
- inode = -1;
- if (parent != NULL) {
- inode = Blt_Tree_NodeId(parent);
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
-}
-
-
-static int
-ComparePositions(Blt_TreeNode *n1Ptr, Blt_TreeNode *n2Ptr)
-{
- if (*n1Ptr == *n2Ptr) {
- return 0;
- }
- if (Blt_Tree_IsBefore(*n1Ptr, *n2Ptr)) {
- return -1;
- }
- return 1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PositionOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PositionOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- PositionSwitches switches;
- Blt_TreeNode *nodeArr, *nodePtr;
- Blt_TreeNode lastParent;
- Tcl_Obj *listObjPtr, *objPtr;
- int i;
- long position;
- Tcl_DString dString;
- int n;
-
- memset((char *)&switches, 0, sizeof(switches));
- /* Process switches */
- n = Blt_ParseSwitches(interp, positionSwitches, objc - 2, objv + 2,
- &switches, BLT_SWITCH_OBJV_PARTIAL);
- if (n < 0) {
- return TCL_ERROR;
- }
- objc -= n + 2, objv += n + 2;
-
- /* Collect the node ids into an array */
- nodeArr = Blt_AssertMalloc((objc + 1) * sizeof(Blt_TreeNode));
- for (i = 0; i < objc; i++) {
- Blt_TreeNode node;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[i], &node) != TCL_OK) {
- Blt_Free(nodeArr);
- return TCL_ERROR;
- }
- nodeArr[i] = node;
- }
- nodeArr[i] = NULL;
-
- if (switches.sort) { /* Sort the nodes by depth-first order
- * if requested. */
- qsort((char *)nodeArr, objc, sizeof(Blt_TreeNode),
- (QSortCompareProc *)ComparePositions);
- }
-
- position = 0; /* Suppress compiler warning. */
- lastParent = NULL;
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_DStringInit(&dString);
- for (nodePtr = nodeArr; *nodePtr != NULL; nodePtr++) {
- Blt_TreeNode parent;
-
- parent = Blt_Tree_ParentNode(*nodePtr);
- if ((parent != NULL) && (parent == lastParent)) {
- Blt_TreeNode node;
-
- /*
- * Since we've sorted the nodes already, we can safely assume that
- * if two consecutive nodes have the same parent, the first node
- * came before the second. If this is the case, use the last node
- * as a starting point.
- */
-
- /*
- * Note that we start comparing from the last node, not its
- * successor. Some one may give us the same node more than once.
- */
- node = *(nodePtr - 1); /* Can't get here unless there's more than
- * one node. */
- for(/*empty*/; node != NULL; node = Blt_Tree_NextSibling(node)) {
- if (node == *nodePtr) {
- break;
- }
- position++;
- }
- } else {
- /*
- * The fallback is to linearly search through the parent's list of
- * children, counting the number of preceding siblings. Except for
- * nodes with many siblings (100+), this should be okay.
- */
- position = Blt_Tree_NodePosition(*nodePtr);
- }
- if (switches.sort) {
- lastParent = parent; /* Update the last parent. */
- }
- /*
- * Add an element in the form "parent -at position" to the list that
- * we're generating.
- */
- if (switches.withId) {
- objPtr = Tcl_NewLongObj(Blt_Tree_NodeId(*nodePtr));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- if (switches.withParent) {
- const char *string;
-
- Tcl_DStringSetLength(&dString, 0); /* Clear the string. */
- string = (parent == NULL) ? "" : Blt_Tree_NodeIdAscii(parent);
- Tcl_DStringAppendElement(&dString, string);
- Tcl_DStringAppendElement(&dString, "-at");
- Tcl_DStringAppendElement(&dString, Blt_Ltoa(position));
- objPtr = Tcl_NewStringObj(Tcl_DStringValue(&dString), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- } else {
- objPtr = Tcl_NewLongObj(position);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_DStringFree(&dString);
- Blt_Free(nodeArr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PreviousOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PreviousOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- long inode;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- node = Blt_Tree_PrevNode(NULL, node);
- inode = (node != NULL) ? Blt_Tree_NodeId(node) : -1;
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-PrevSiblingOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- long inode;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- inode = -1;
- node = Blt_Tree_PrevSibling(node);
- if (node != NULL) {
- inode = Blt_Tree_NodeId(node);
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RestoreOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-RestoreOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode root; /* Root node of restored subtree. */
- RestoreSwitches switches;
- char *string;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &root) != TCL_OK) {
- return TCL_ERROR;
- }
- memset((char *)&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, restoreSwitches, objc - 4, objv + 4,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- string = Tcl_GetString(objv[3]);
- if (strcmp(Tcl_GetString(objv[1]), "restore") == 0) {
- return Blt_Tree_Restore(interp, cmdPtr->tree, root, string,
- switches.flags);
- } else {
- return Blt_Tree_RestoreFromFile(interp, cmdPtr->tree, root, string,
- switches.flags);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RootOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-RootOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode root;
-
- root = Blt_Tree_RootNode(cmdPtr->tree);
- Tcl_SetLongObj(Tcl_GetObjResult(interp), Blt_Tree_NodeId(root));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-SetOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- TagSearch iter;
-
- if (FirstTaggedNode(interp, cmdPtr, objv[2], &iter, &node) != TCL_OK) {
- return TCL_ERROR;
- }
- while (node != NULL) {
- if (SetValues(cmdPtr, node, objc - 3, objv + 3) != TCL_OK) {
- return TCL_ERROR;
- }
- node = NextTaggedNode(node, &iter);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SizeOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SizeOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), Blt_Tree_Size(node));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagAddOp --
- *
- * .t tag add tagName node1 node2 node3
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagAddOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- const char *string;
- long nodeId;
-
- string = Tcl_GetString(objv[3]);
- if (Tcl_GetLongFromObj(NULL, objv[3], &nodeId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", string,
- "\": can't be a number", (char *)NULL);
- return TCL_ERROR;
- }
- if ((strcmp(string, "all") == 0) || (strcmp(string, "root") == 0)) {
- Tcl_AppendResult(cmdPtr->interp, "can't add reserved tag \"",
- string, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (objc == 4) {
- /* No nodes specified. Just add the tag. */
- if (AddTag(cmdPtr, NULL, string) != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- int i;
-
- for (i = 4; i < objc; i++) {
- Blt_TreeNode node;
- TagSearch iter;
-
- if (FirstTaggedNode(interp, cmdPtr, objv[i], &iter, &node)
- != TCL_OK) {
- return TCL_ERROR;
- }
- for (/* empty */; node != NULL;
- node = NextTaggedNode(node, &iter)) {
- if (AddTag(cmdPtr, node, string) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagDeleteOp --
- *
- * .t add tag node1 node2 node3
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagDeleteOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- const char *string;
- Blt_HashTable *tablePtr;
- long nodeId;
-
- string = Tcl_GetString(objv[3]);
- if (Tcl_GetLongFromObj(NULL, objv[3], &nodeId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", string,
- "\": can't be a number", (char *)NULL);
- return TCL_ERROR;
- }
- if ((strcmp(string, "all") == 0) || (strcmp(string, "root") == 0)) {
- Tcl_AppendResult(interp, "can't delete reserved tag \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- tablePtr = Blt_Tree_TagHashTable(cmdPtr->tree, string);
- if (tablePtr != NULL) {
- int i;
-
- for (i = 4; i < objc; i++) {
- Blt_TreeNode node;
- TagSearch iter;
-
- if (FirstTaggedNode(interp, cmdPtr, objv[i], &iter, &node)
- != TCL_OK) {
- return TCL_ERROR;
- }
- for (/* empty */; node != NULL;
- node = NextTaggedNode(node, &iter)) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(tablePtr, (char *)node);
- if (hPtr != NULL) {
- Blt_DeleteHashEntry(tablePtr, hPtr);
- }
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagDumpOp --
- *
- * Like "dump", but dumps only the contents of nodes tagged by a given
- * tag.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagDumpOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode root;
- Tcl_DString dString;
- int i;
-
- Tcl_DStringInit(&dString);
- root = Blt_Tree_RootNode(cmdPtr->tree);
- for (i = 3; i < objc; i++) {
- Blt_TreeNode node;
- TagSearch iter;
-
- if (FirstTaggedNode(interp, cmdPtr, objv[i], &iter, &node)
- != TCL_OK) {
- Tcl_DStringFree(&dString);
- return TCL_ERROR;
- }
- for (/* empty */; node != NULL; node = NextTaggedNode(node, &iter)) {
- Blt_Tree_DumpNode(cmdPtr->tree, root, node, &dString);
- }
- }
- Tcl_DStringResult(interp, &dString);
- Tcl_DStringFree(&dString);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagExistsOp --
- *
- * Returns the existence of the one or more tags in the given node. If
- * the node has any the tags, true is return in the interpreter.
- *
- * .t tag exists tag1 node
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TagExistsOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int bool;
- const char *tagName;
-
- tagName = Tcl_GetString(objv[3]);
- bool = (Blt_Tree_TagHashTable(cmdPtr->tree, tagName) != NULL);
- if (objc == 5) {
- Blt_TreeNode node;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[4], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- bool = Blt_Tree_HasTag(cmdPtr->tree, node, tagName);
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagForgetOp --
- *
- * Removes the given tags from all nodes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TagForgetOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- const char *string;
- long nodeId;
-
- string = Tcl_GetString(objv[i]);
- if (Tcl_GetLongFromObj(NULL, objv[i], &nodeId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", string,
- "\": can't be a number", (char *)NULL);
- return TCL_ERROR;
- }
- Blt_Tree_ForgetTag(cmdPtr->tree, string);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagGetOp --
- *
- * Returns tag names for a given node. If one of more pattern arguments
- * are provided, then only those matching tags are returned.
- *
- * .t tag get node pat1 pat2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagGetOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- Tcl_Obj *listObjPtr;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[3], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- if (objc == 4) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *objPtr;
-
- /* Dump all tags for this node. */
- if (node == Blt_Tree_RootNode(cmdPtr->tree)) {
- objPtr = Tcl_NewStringObj("root", 4);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- for (hPtr = Blt_Tree_FirstTag(cmdPtr->tree, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_TreeTagEntry *tPtr;
- Blt_HashEntry *h2Ptr;
-
- tPtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(&tPtr->nodeTable, (char *)node);
- if (h2Ptr != NULL) {
- objPtr = Tcl_NewStringObj(tPtr->tagName, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- objPtr = Tcl_NewStringObj("all", 3);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- } else {
- int i;
- Tcl_Obj *objPtr;
-
- /* Check if we need to add the special tags "all" and "root" */
- for (i = 4; i < objc; i++) {
- char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- if (Tcl_StringMatch("all", pattern)) {
- objPtr = Tcl_NewStringObj("all", 3);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- break;
- }
- }
- if (node == Blt_Tree_RootNode(cmdPtr->tree)) {
- for (i = 4; i < objc; i++) {
- char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- if (Tcl_StringMatch("root", pattern)) {
- objPtr = Tcl_NewStringObj("root", 4);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- break;
- }
- }
- }
- /* Now process any standard tags. */
- for (i = 4; i < objc; i++) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- for (hPtr = Blt_Tree_FirstTag(cmdPtr->tree, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_TreeTagEntry *tPtr;
-
- tPtr = Blt_GetHashValue(hPtr);
- if (Tcl_StringMatch(tPtr->tagName, pattern)) {
- Blt_HashEntry *h2Ptr;
-
- h2Ptr = Blt_FindHashEntry(&tPtr->nodeTable, (char *)node);
- if (h2Ptr != NULL) {
- objPtr = Tcl_NewStringObj(tPtr->tagName, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagNamesOp --
- *
- * Returns the names of all the tags in the tree. If one of more node
- * arguments are provided, then only the tags found in those nodes are
- * returned.
- *
- * .t tag names node node node...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagNamesOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr, *objPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- objPtr = Tcl_NewStringObj("all", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- objPtr = Tcl_NewStringObj("root", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- for (hPtr = Blt_Tree_FirstTag(cmdPtr->tree, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_TreeTagEntry *tPtr;
-
- tPtr = Blt_GetHashValue(hPtr);
- objPtr = Tcl_NewStringObj(tPtr->tagName, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- } else {
- Blt_HashTable uniqTable;
- int i;
-
- Blt_InitHashTable(&uniqTable, BLT_STRING_KEYS);
- for (i = 3; i < objc; i++) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Blt_TreeNode node;
- int isNew;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[i], &node) != TCL_OK) {
- goto error;
- }
- if (node == Blt_Tree_RootNode(cmdPtr->tree)) {
- Blt_CreateHashEntry(&uniqTable, "root", &isNew);
- }
- for (hPtr = Blt_Tree_FirstTag(cmdPtr->tree, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_TreeTagEntry *tPtr;
- Blt_HashEntry *h2Ptr;
-
- tPtr = Blt_GetHashValue(hPtr);
- h2Ptr = Blt_FindHashEntry(&tPtr->nodeTable, (char *)node);
- if (h2Ptr != NULL) {
- Blt_CreateHashEntry(&uniqTable, tPtr->tagName, &isNew);
- }
- }
- }
- {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&uniqTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- objPtr = Tcl_NewStringObj(Blt_GetHashKey(&uniqTable, hPtr), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Blt_DeleteHashTable(&uniqTable);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- error:
- Tcl_DecrRefCount(listObjPtr);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagNodesOp --
- *
- * Returns the node ids for the given tags. The ids returned will
- * represent the union of nodes for all the given tags.
- *
- * .t nodes tag1 tag2 tag3...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagNodesOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_HashTable nodeTable;
- int i;
-
- Blt_InitHashTable(&nodeTable, BLT_ONE_WORD_KEYS);
- for (i = 3; i < objc; i++) {
- const char *string;
- int isNew;
- long nodeId;
-
- string = Tcl_GetString(objv[i]);
- if (Tcl_GetLongFromObj(NULL, objv[i], &nodeId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", string,
- "\": can't be a number", (char *)NULL);
- goto error;
- }
- if (strcmp(string, "all") == 0) {
- break;
- } else if (strcmp(string, "root") == 0) {
- Blt_CreateHashEntry(&nodeTable,
- (char *)Blt_Tree_RootNode(cmdPtr->tree), &isNew);
- continue;
- } else {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_Tree_TagHashTable(cmdPtr->tree, string);
- if (tablePtr != NULL) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(tablePtr, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Blt_TreeNode node;
-
- node = Blt_GetHashValue(hPtr);
- Blt_CreateHashEntry(&nodeTable, (char *)node, &isNew);
- }
- continue;
- }
- }
- Blt_DeleteHashTable(&nodeTable);
- return TCL_OK;
- }
- {
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (hPtr = Blt_FirstHashEntry(&nodeTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_TreeNode node;
- Tcl_Obj *objPtr;
-
- node = (Blt_TreeNode)Blt_GetHashKey(&nodeTable, hPtr);
- objPtr = Tcl_NewLongObj(Blt_Tree_NodeId(node));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- }
- Blt_DeleteHashTable(&nodeTable);
- return TCL_OK;
-
- error:
- Blt_DeleteHashTable(&nodeTable);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagSetOp --
- *
- * Sets one or more tags for a given node. Tag names can't start with a
- * digit (to distinquish them from node ids) and can't be a reserved tag
- * ("root" or "all").
- *
- * .t tag set node tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagSetOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- int i;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[3], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 4; i < objc; i++) {
- const char *string;
- long nodeId;
-
- string = Tcl_GetString(objv[i]);
- if (Tcl_GetLongFromObj(NULL, objv[i], &nodeId) == TCL_OK) {
- Tcl_AppendResult(interp, "bad tag \"", string,
- "\": can't be a number", (char *)NULL);
- return TCL_ERROR;
- }
- if ((strcmp(string, "all") == 0) || (strcmp(string, "root") == 0)) {
- Tcl_AppendResult(interp, "can't add reserved tag \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (AddTag(cmdPtr, node, string) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagUnsetOp --
- *
- * Removes one or more tags from a given node. If a tag doesn't exist or
- * is a reserved tag ("root" or "all"), nothing will be done and no error
- * message will be returned.
- *
- * .t tag unset node tag1 tag2...
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagUnsetOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- int i;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[3], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 4; i < objc; i++) {
- Blt_Tree_RemoveTag(cmdPtr->tree, node, Tcl_GetString(objv[i]));
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagOp --
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec tagOps[] = {
- {"add", 1, TagAddOp, 4, 0, "tag ?node...?",},
- {"delete", 2, TagDeleteOp, 5, 0, "tag node...",},
- {"dump", 2, TagDumpOp, 4, 0, "tag...",},
- {"exists", 1, TagExistsOp, 4, 5, "tag ?node?",},
- {"forget", 1, TagForgetOp, 4, 0, "tag...",},
- {"get", 1, TagGetOp, 4, 0, "node ?pattern...?",},
- {"names", 2, TagNamesOp, 3, 0, "?node...?",},
- {"nodes", 2, TagNodesOp, 4, 0, "tag ?tag...?",},
- {"set", 1, TagSetOp, 4, 0, "node tag...",},
- {"unset", 1, TagUnsetOp, 4, 0, "node tag...",},
-};
-
-static int nTagOps = sizeof(tagOps) / sizeof(Blt_OpSpec);
-
-static int
-TagOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTagOps, tagOps, BLT_OP_ARG2, objc, objv,
- 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (cmdPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceCreateOp --
- *
- * $tree trace create nodeIdOrTag key rwu cmd switches
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TraceCreateOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- TraceInfo *tracePtr;
- const char *key, *command;
- const char *string;
- const char *tagName;
- int flags;
- int length;
- TraceSwitches switches;
- long nodeId;
-
- string = Tcl_GetString(objv[3]);
- if (IsTag(cmdPtr->tree, string)) {
- tagName = Blt_AssertStrdup(string);
- node = NULL;
- } else if (Tcl_GetLongFromObj(NULL, objv[3], &nodeId) == TCL_OK) {
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[3], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- tagName = NULL;
- }
- key = Tcl_GetString(objv[4]);
- string = Tcl_GetString(objv[5]);
- flags = GetTraceFlags(string);
- if (flags < 0) {
- Tcl_AppendResult(interp, "unknown flag in \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- command = Tcl_GetStringFromObj(objv[6], &length);
- /* Process switches */
- switches.mask = 0;
- if (Blt_ParseSwitches(interp, traceSwitches, objc-7, objv+7, &switches,
- BLT_SWITCH_DEFAULTS | BLT_SWITCH_OBJV_PARTIAL) < 0) {
- return TCL_ERROR;
- }
- /* Stash away the command in structure and pass that to the trace. */
- tracePtr = Blt_AssertCalloc(1, length + sizeof(TraceInfo));
- strcpy(tracePtr->command, command);
- tracePtr->cmdPtr = cmdPtr;
- tracePtr->withTag = tagName;
- tracePtr->node = node;
- flags |= switches.mask;
- tracePtr->traceToken = Blt_Tree_CreateTrace(cmdPtr->tree, node, key,
- tagName, flags, TreeTraceProc, tracePtr);
-
- {
- Blt_HashEntry *hPtr;
- char idString[200];
- int isNew;
-
- sprintf_s(idString, 200, "trace%d", cmdPtr->traceCounter++);
- hPtr = Blt_CreateHashEntry(&cmdPtr->traceTable, idString, &isNew);
- Blt_SetHashValue(hPtr, tracePtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), idString, -1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceDeleteOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-TraceDeleteOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- Blt_HashEntry *hPtr;
- TraceInfo *tracePtr;
- char *key;
-
- key = Tcl_GetString(objv[i]);
- hPtr = Blt_FindHashEntry(&cmdPtr->traceTable, key);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "unknown trace \"", key, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- tracePtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashEntry(&cmdPtr->traceTable, hPtr);
- Blt_Tree_DeleteTrace(tracePtr->traceToken);
- if (tracePtr->withTag != NULL) {
- Blt_Free(tracePtr->withTag);
- }
- Blt_Free(tracePtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceNamesOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TraceNamesOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(&cmdPtr->traceTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- Tcl_AppendElement(interp, Blt_GetHashKey(&cmdPtr->traceTable, hPtr));
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceInfoOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TraceInfoOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TraceInfo *tracePtr;
- struct _Blt_TreeTrace *tokenPtr;
- Blt_HashEntry *hPtr;
- char string[5];
- char *key;
- Tcl_Obj *listObjPtr, *objPtr;
-
- key = Tcl_GetString(objv[3]);
- hPtr = Blt_FindHashEntry(&cmdPtr->traceTable, key);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "unknown trace \"", key, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- tracePtr = Blt_GetHashValue(hPtr);
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (tracePtr->withTag != NULL) {
- objPtr = Tcl_NewStringObj(tracePtr->withTag, -1);
- } else {
- objPtr = Tcl_NewLongObj(Blt_Tree_NodeId(tracePtr->node));
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- tokenPtr = (struct _Blt_TreeTrace *)tracePtr->traceToken;
- objPtr = Tcl_NewStringObj(tokenPtr->key, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- PrintTraceFlags(tokenPtr->mask, string);
- objPtr = Tcl_NewStringObj(string, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewStringObj(tracePtr->command, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TraceOp --
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec traceOps[] =
-{
- {"create", 1, TraceCreateOp, 7, 0, "node key how command ?-whenidle?",},
- {"delete", 1, TraceDeleteOp, 3, 0, "id...",},
- {"info", 1, TraceInfoOp, 4, 4, "id",},
- {"names", 1, TraceNamesOp, 3, 3, "",},
-};
-
-static int nTraceOps = sizeof(traceOps) / sizeof(Blt_OpSpec);
-
-static int
-TraceOp(TreeCmd *cmdPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTraceOps, traceOps, BLT_OP_ARG2, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (cmdPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TypeOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- Tcl_Obj *valueObjPtr;
- char *string;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
-
- string = Tcl_GetString(objv[3]);
- if (Blt_Tree_GetValue(interp, cmdPtr->tree, node, string, &valueObjPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (valueObjPtr->typePtr != NULL) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), valueObjPtr->typePtr->name,
- -1);
- } else {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), "string", 6);
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnsetOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-UnsetOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- const char *string;
- long nodeId;
-
- string = Tcl_GetString(objv[2]);
- if (Tcl_GetLongFromObj(NULL, objv[2], &nodeId) == TCL_OK) {
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- if (UnsetValues(cmdPtr, node, objc - 3, objv + 3) != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- TagSearch iter;
-
- if (FirstTaggedNode(interp, cmdPtr, objv[2], &iter, &node)
- != TCL_OK) {
- return TCL_ERROR;
- }
- for (/* empty */; node != NULL; node = NextTaggedNode(node, &iter)) {
- if (UnsetValues(cmdPtr, node, objc - 3, objv + 3) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-
-typedef struct {
- TreeCmd *cmdPtr;
- unsigned int flags;
- int type;
- int mode;
- char *key;
- const char *command;
-} SortSwitches;
-
-#define SORT_RECURSE (1<<2)
-#define SORT_DECREASING (1<<3)
-#define SORT_PATHNAME (1<<4)
-
-enum SortTypes { SORT_DICTIONARY, SORT_REAL, SORT_INTEGER, SORT_ASCII,
- SORT_COMMAND };
-
-enum SortModes { SORT_FLAT, SORT_REORDER };
-
-#define _off(x) Blt_Offset(SortSwitches, x)
-static Blt_SwitchSpec sortSwitches[] =
-{
- {BLT_SWITCH_VALUE, "-ascii", "",
- Blt_Offset(SortSwitches, type), 0, SORT_ASCII},
- {BLT_SWITCH_STRING, "-command", "command",
- Blt_Offset(SortSwitches, command), 0},
- {BLT_SWITCH_BITMASK, "-decreasing", "",
- Blt_Offset(SortSwitches, flags), 0, SORT_DECREASING},
- {BLT_SWITCH_VALUE, "-dictionary", "",
- Blt_Offset(SortSwitches, type), 0, SORT_DICTIONARY},
- {BLT_SWITCH_VALUE, "-integer", "",
- Blt_Offset(SortSwitches, type), 0, SORT_INTEGER},
- {BLT_SWITCH_STRING, "-key", "string",
- Blt_Offset(SortSwitches, key), 0},
- {BLT_SWITCH_BITMASK, "-path", "",
- Blt_Offset(SortSwitches, flags), 0, SORT_PATHNAME},
- {BLT_SWITCH_VALUE, "-real", "",
- Blt_Offset(SortSwitches, type), 0, SORT_REAL},
- {BLT_SWITCH_VALUE, "-recurse", "",
- Blt_Offset(SortSwitches, flags), 0, SORT_RECURSE},
- {BLT_SWITCH_VALUE, "-reorder", "",
- Blt_Offset(SortSwitches, mode), 0, SORT_REORDER},
- {BLT_SWITCH_END}
-};
-#undef _off
-
-static SortSwitches sortData;
-
-static int
-CompareNodes(Blt_TreeNode *n1Ptr, Blt_TreeNode *n2Ptr)
-{
- TreeCmd *cmdPtr = sortData.cmdPtr;
- const char *s1, *s2;
- int result;
- Tcl_DString dString1, dString2;
-
- s1 = s2 = "";
- result = 0;
-
- if (sortData.flags & SORT_PATHNAME) {
- Tcl_DStringInit(&dString1);
- Tcl_DStringInit(&dString2);
- }
- if (sortData.key != NULL) {
- Tcl_Obj *valueObjPtr;
-
- if (Blt_Tree_GetValue((Tcl_Interp *)NULL, cmdPtr->tree, *n1Ptr,
- sortData.key, &valueObjPtr) == TCL_OK) {
- s1 = Tcl_GetString(valueObjPtr);
- }
- if (Blt_Tree_GetValue((Tcl_Interp *)NULL, cmdPtr->tree, *n2Ptr,
- sortData.key, &valueObjPtr) == TCL_OK) {
- s2 = Tcl_GetString(valueObjPtr);
- }
- } else if (sortData.flags & SORT_PATHNAME) {
- Blt_TreeNode root;
-
- root = Blt_Tree_RootNode(cmdPtr->tree);
- Tcl_DStringInit(&dString1), Tcl_DStringInit(&dString2);
- s1 = Blt_Tree_NodeRelativePath(root, *n1Ptr, NULL, 0, &dString1);
- s2 = Blt_Tree_NodeRelativePath(root, *n2Ptr, NULL, 0, &dString2);
- } else {
- s1 = Blt_Tree_NodeLabel(*n1Ptr);
- s2 = Blt_Tree_NodeLabel(*n2Ptr);
- }
- switch (sortData.type) {
- case SORT_ASCII:
- result = strcmp(s1, s2);
- break;
-
- case SORT_COMMAND:
- if (sortData.command == NULL) {
- result = Blt_DictionaryCompare(s1, s2);
- } else {
- Blt_ObjectName objName;
- Tcl_DString dsCmd, dsName;
- char *qualName;
-
- result = 0; /* Hopefully this will be okay even if the TCL command
- * fails to return the correct result. */
- Tcl_DStringInit(&dsCmd);
- Tcl_DStringAppend(&dsCmd, sortData.command, -1);
- Tcl_DStringInit(&dsName);
- objName.name = Tcl_GetCommandName(cmdPtr->interp, cmdPtr->cmdToken);
- objName.nsPtr = Blt_GetCommandNamespace(cmdPtr->cmdToken);
- qualName = Blt_MakeQualifiedName(&objName, &dsName);
- Tcl_DStringAppendElement(&dsCmd, qualName);
- Tcl_DStringFree(&dsName);
- Tcl_DStringAppendElement(&dsCmd, Blt_Tree_NodeIdAscii(*n1Ptr));
- Tcl_DStringAppendElement(&dsCmd, Blt_Tree_NodeIdAscii(*n2Ptr));
- Tcl_DStringAppendElement(&dsCmd, s1);
- Tcl_DStringAppendElement(&dsCmd, s2);
- result = Tcl_GlobalEval(cmdPtr->interp, Tcl_DStringValue(&dsCmd));
- Tcl_DStringFree(&dsCmd);
-
- if ((result != TCL_OK) ||
- (Tcl_GetInt(cmdPtr->interp,
- Tcl_GetStringResult(cmdPtr->interp), &result) != TCL_OK)) {
- Tcl_BackgroundError(cmdPtr->interp);
- }
- Tcl_ResetResult(cmdPtr->interp);
- }
- break;
-
- case SORT_DICTIONARY:
- result = Blt_DictionaryCompare(s1, s2);
- break;
-
- case SORT_INTEGER:
- {
- int i1, i2;
-
- if (Tcl_GetInt(NULL, s1, &i1) == TCL_OK) {
- if (Tcl_GetInt(NULL, s2, &i2) == TCL_OK) {
- result = i1 - i2;
- } else {
- result = -1;
- }
- } else if (Tcl_GetInt(NULL, s2, &i2) == TCL_OK) {
- result = 1;
- } else {
- result = Blt_DictionaryCompare(s1, s2);
- }
- }
- break;
-
- case SORT_REAL:
- {
- double r1, r2;
-
- if (Tcl_GetDouble(NULL, s1, &r1) == TCL_OK) {
- if (Tcl_GetDouble(NULL, s2, &r2) == TCL_OK) {
- result = (r1 < r2) ? -1 : (r1 > r2) ? 1 : 0;
- } else {
- result = -1;
- }
- } else if (Tcl_GetDouble(NULL, s2, &r2) == TCL_OK) {
- result = 1;
- } else {
- result = Blt_DictionaryCompare(s1, s2);
- }
- }
- break;
- }
- if (result == 0) {
- result = Blt_Tree_NodeId(*n1Ptr) - Blt_Tree_NodeId(*n2Ptr);
- }
- if (sortData.flags & SORT_DECREASING) {
- result = -result;
- }
- if (sortData.flags & SORT_PATHNAME) {
- Tcl_DStringFree(&dString1);
- Tcl_DStringFree(&dString2);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SortApplyProc --
- *
- * Sorts the subnodes at a given node.
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SortApplyProc(
- Blt_TreeNode node,
- ClientData clientData,
- int order) /* Not used. */
-{
- TreeCmd *cmdPtr = clientData;
-
- if (!Blt_Tree_IsLeaf(node)) {
- Blt_Tree_SortNode(cmdPtr->tree, node, CompareNodes);
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * SortOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-SortOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode top;
- SortSwitches switches;
- int result;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &top) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Process switches */
- memset(&switches, 0, sizeof(switches));
- switches.cmdPtr = cmdPtr;
- if (Blt_ParseSwitches(interp, sortSwitches, objc - 3, objv + 3, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (switches.command != NULL) {
- switches.type = SORT_COMMAND;
- }
- switches.cmdPtr = cmdPtr;
- sortData = switches;
- if (switches.mode == SORT_FLAT) {
- Blt_TreeNode *nodeArr;
- long nNodes;
- long i;
-
- if (switches.flags & SORT_RECURSE) {
- nNodes = Blt_Tree_Size(top);
- } else {
- nNodes = Blt_Tree_NodeDegree(top);
- }
- nodeArr = Blt_AssertMalloc(nNodes * sizeof(Blt_TreeNode));
- if (switches.flags & SORT_RECURSE) {
- Blt_TreeNode node, *p;
-
- p = nodeArr;
- for(p = nodeArr, node = top; node != NULL;
- node = Blt_Tree_NextNode(top, node)) {
- *p++ = node;
- }
- } else {
- Blt_TreeNode node, *p;
-
- for (p = nodeArr, node = Blt_Tree_FirstChild(top); node != NULL;
- node = Blt_Tree_NextSibling(node)) {
- *p++ = node;
- }
- }
- qsort((char *)nodeArr, nNodes, sizeof(Blt_TreeNode),
- (QSortCompareProc *)CompareNodes);
- {
- Tcl_Obj *listObjPtr;
- Blt_TreeNode *p;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (p = nodeArr, i = 0; i < nNodes; i++, p++) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewLongObj(Blt_Tree_NodeId(*p));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- }
- Blt_Free(nodeArr);
- result = TCL_OK;
- } else {
- if (switches.flags & SORT_RECURSE) {
- result = Blt_Tree_Apply(top, SortApplyProc, cmdPtr);
- } else {
- result = SortApplyProc(top, cmdPtr, TREE_PREORDER);
- }
- }
- Blt_FreeSwitches(sortSwitches, (char *)&switches, 0);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ValuesOp --
- *
- * Returns the names of values for a node or array value.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ValuesOp(
- TreeCmd *cmdPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeNode node;
- Tcl_Obj *listObjPtr;
-
- if (GetNodeFromObj(interp, cmdPtr->tree, objv[2], &node) != TCL_OK) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- if (objc == 4) {
- char *string;
-
- string = Tcl_GetString(objv[3]);
- if (Blt_Tree_ArrayNames(interp, cmdPtr->tree, node, string, listObjPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- Blt_TreeKey key;
- Blt_TreeKeyIterator iter;
-
- for (key = Blt_Tree_FirstKey(cmdPtr->tree, node, &iter); key != NULL;
- key = Blt_Tree_NextKey(cmdPtr->tree, &iter)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(key, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeInstObjCmd --
- *
- * This procedure is invoked to process commands on behalf of the tree
- * object.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec treeOps[] =
-{
- {"ancestor", 2, AncestorOp, 4, 4, "node1 node2",},
- {"apply", 1, ApplyOp, 3, 0, "node ?switches?",},
- {"attach", 2, AttachOp, 3, 0, "tree ?switches?",},
- {"children", 2, ChildrenOp, 3, 5, "node ?first? ?last?",},
- {"copy", 2, CopyOp, 4, 0, "parent ?tree? node ?switches?",},
- {"degree", 2, DegreeOp, 3, 0, "node",},
- {"delete", 2, DeleteOp, 2, 0, "?node...?",},
- {"depth", 3, DepthOp, 3, 3, "node",},
- {"dump", 4, DumpOp, 3, 3, "node",},
- {"dumpfile", 5, DumpfileOp, 4, 4, "node fileName",},
- {"exists", 3, ExistsOp, 3, 4, "node ?key?",},
- {"export", 3, ExportOp, 2, 0, "format ?switches?",},
- {"find", 4, FindOp, 3, 0, "node ?switches?",},
- {"findchild", 5, FindChildOp, 4, 4, "node label",},
- {"firstchild", 3, FirstChildOp, 3, 3, "node",},
- {"get", 1, GetOp, 3, 5, "node ?key? ?defaultValue?",},
- {"import", 2, ImportOp, 2, 0, "format ?switches?",},
- {"index", 3, IndexOp, 3, 3, "label|list",},
- {"insert", 3, InsertOp, 3, 0, "parent ?switches?",},
- {"is", 2, IsOp, 2, 0, "oper args...",},
- {"keys", 1, KeysOp, 3, 0, "node ?node...?",},
- {"label", 3, LabelOp, 3, 4, "node ?newLabel?",},
- {"lastchild", 3, LastChildOp, 3, 3, "node",},
- {"move", 1, MoveOp, 4, 0, "node newParent ?switches?",},
- {"next", 4, NextOp, 3, 3, "node",},
- {"nextsibling", 5, NextSiblingOp, 3, 3, "node",},
- {"notify", 2, NotifyOp, 2, 0, "args...",},
- {"parent", 3, ParentOp, 3, 3, "node",},
- {"path", 3, PathOp, 3, 0, "node ?string switches?",},
- {"position", 2, PositionOp, 3, 0, "?switches? node...",},
- {"previous", 5, PreviousOp, 3, 3, "node",},
- {"prevsibling", 5, PrevSiblingOp, 3, 3, "node",},
- {"restore", 7, RestoreOp, 4, 5, "node data ?switches?",},
- {"restorefile", 8, RestoreOp, 4, 5, "node fileName ?switches?",},
- {"root", 2, RootOp, 2, 2, "",},
- {"set", 3, SetOp, 3, 0, "node ?key value...?",},
- {"size", 2, SizeOp, 3, 3, "node",},
- {"sort", 2, SortOp, 3, 0, "node ?flags...?",},
- {"tag", 2, TagOp, 3, 0, "args...",},
- {"trace", 2, TraceOp, 2, 0, "args...",},
- {"type", 2, TypeOp, 4, 4, "node key",},
- {"unset", 3, UnsetOp, 3, 0, "node ?key...?",},
- {"values", 1, ValuesOp, 3, 4, "node ?key?",},
-};
-
-static int nTreeOps = sizeof(treeOps) / sizeof(Blt_OpSpec);
-
-static int
-TreeInstObjCmd(
- ClientData clientData, /* Information about the widget. */
- Tcl_Interp *interp, /* Interpreter to report errors back to. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Vector of argument strings. */
-{
- TreeCmdProc *proc;
- TreeCmd *cmdPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTreeOps, treeOps, BLT_OP_ARG1, objc, objv,
- 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(cmdPtr);
- result = (*proc) (cmdPtr, interp, objc, objv);
- Tcl_Release(cmdPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeInstDeleteProc --
- *
- * Deletes the command associated with the tree. This is called only
- * when the command associated with the tree is destroyed.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TreeInstDeleteProc(ClientData clientData)
-{
- TreeCmd *cmdPtr = clientData;
-
- ReleaseTreeObject(cmdPtr);
- if (cmdPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(cmdPtr->tablePtr, cmdPtr->hashPtr);
- }
- Blt_Chain_Destroy(cmdPtr->notifiers);
- Blt_DeleteHashTable(&cmdPtr->notifyTable);
- Blt_DeleteHashTable(&cmdPtr->traceTable);
- Blt_Free(cmdPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GenerateName --
- *
- * Generates an unique tree command name. Tree names are in the form
- * "treeN", where N is a non-negative integer. Check each name generated
- * to see if it is already a tree. We want to recycle names if possible.
- *
- * Results:
- * Returns the unique name. The string itself is stored in the dynamic
- * string passed into the routine.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-GenerateName(
- Tcl_Interp *interp,
- const char *prefix,
- const char *suffix,
- Tcl_DString *resultPtr)
-{
-
- int i;
- const char *treeName;
-
- /*
- * Parse the command and put back so that it's in a consistent
- * format.
- *
- * t1 <current namespace>::t1
- * n1::t1 <current namespace>::n1::t1
- * ::t1 ::t1
- * ::n1::t1 ::n1::t1
- */
- treeName = NULL; /* Suppress compiler warning. */
- for (i = 0; i < INT_MAX; i++) {
- Blt_ObjectName objName;
- Tcl_CmdInfo cmdInfo;
- Tcl_DString ds;
- char string[200];
-
- Tcl_DStringInit(&ds);
- Tcl_DStringAppend(&ds, prefix, -1);
- sprintf_s(string, 200, "tree%d", i);
- Tcl_DStringAppend(&ds, string, -1);
- Tcl_DStringAppend(&ds, suffix, -1);
- if (!Blt_ParseObjectName(interp, Tcl_DStringValue(&ds), &objName, 0)) {
- Tcl_DStringFree(&ds);
- return NULL;
- }
- treeName = Blt_MakeQualifiedName(&objName, resultPtr);
- Tcl_DStringFree(&ds);
-
- if (Blt_Tree_Exists(interp, treeName)) {
- continue; /* A tree by this name already exists. */
- }
- if (Tcl_GetCommandInfo(interp, (char *)treeName, &cmdInfo)) {
- continue; /* A command by this name already exists. */
- }
- break;
- }
- return treeName;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeCreateOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TreeCreateOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- TreeCmdInterpData *tdPtr = clientData;
- const char *name;
- Tcl_DString ds;
- Blt_Tree tree;
-
- name = NULL;
- if (objc == 3) {
- name = Tcl_GetString(objv[2]);
- }
- Tcl_DStringInit(&ds);
- if (name == NULL) {
- name = GenerateName(interp, "", "", &ds);
- } else {
- char *p;
-
- p = strstr(name, "#auto");
- if (p != NULL) {
- *p = '\0';
- name = GenerateName(interp, name, p + 5, &ds);
- *p = '#';
- } else {
- Blt_ObjectName objName;
- Tcl_CmdInfo cmdInfo;
-
- /*
- * Parse the command and put back so that it's in a consistent
- * format.
- *
- * t1 <current namespace>::t1
- * n1::t1 <current namespace>::n1::t1
- * ::t1 ::t1
- * ::n1::t1 ::n1::t1
- */
- if (!Blt_ParseObjectName(interp, name, &objName, 0)) {
- return TCL_ERROR;
- }
- name = Blt_MakeQualifiedName(&objName, &ds);
- /*
- * Check if the command already exists.
- */
- if (Tcl_GetCommandInfo(interp, (char *)name, &cmdInfo)) {
- Tcl_AppendResult(interp, "a command \"", name,
- "\" already exists", (char *)NULL);
- goto error;
- }
- if (Blt_Tree_Exists(interp, name)) {
- Tcl_AppendResult(interp, "a tree \"", name,
- "\" already exists", (char *)NULL);
- goto error;
- }
- }
- }
- if (name == NULL) {
- goto error;
- }
- tree = Blt_Tree_Open(interp, name, TREE_CREATE);
- if (tree != NULL) {
- int isNew;
- TreeCmd *cmdPtr;
-
- cmdPtr = Blt_AssertCalloc(1, sizeof(TreeCmd));
- cmdPtr->tdPtr = tdPtr;
- cmdPtr->tree = tree;
- cmdPtr->interp = interp;
- Blt_InitHashTable(&cmdPtr->traceTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&cmdPtr->notifyTable, BLT_STRING_KEYS);
- cmdPtr->notifiers = Blt_Chain_Create();
- cmdPtr->cmdToken = Tcl_CreateObjCommand(interp, (char *)name,
- (Tcl_ObjCmdProc *)TreeInstObjCmd, cmdPtr, TreeInstDeleteProc);
- cmdPtr->tablePtr = &tdPtr->treeTable;
- cmdPtr->hashPtr = Blt_CreateHashEntry(cmdPtr->tablePtr, (char *)cmdPtr,
- &isNew);
- Blt_SetHashValue(cmdPtr->hashPtr, cmdPtr);
- Tcl_SetStringObj(Tcl_GetObjResult(interp), (char *)name, -1);
- Tcl_DStringFree(&ds);
- /*
- * Since we store the TCL command and notifier information
- * on the client side, we need to also cleanup when we see a
- * delete event. So just register a callback for all tree events
- * to catch anything we need to know about.
- */
- Blt_Tree_CreateEventHandler(cmdPtr->tree, TREE_NOTIFY_ALL,
- TreeEventProc, cmdPtr);
- return TCL_OK;
- }
- error:
- Tcl_DStringFree(&ds);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeDestroyOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TreeDestroyOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- TreeCmdInterpData *tdPtr = clientData;
- int i;
-
- for (i = 2; i < objc; i++) {
- TreeCmd *cmdPtr;
- char *string;
-
- string = Tcl_GetString(objv[i]);
- cmdPtr = GetTreeCmd(tdPtr, interp, string);
- if (cmdPtr == NULL) {
- Tcl_AppendResult(interp, "can't find a tree named \"", string,
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_DeleteCommandFromToken(interp, cmdPtr->cmdToken);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeNamesOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TreeNamesOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- TreeCmdInterpData *tdPtr = clientData;
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- Tcl_Obj *listObjPtr;
- Tcl_DString ds;
-
- Tcl_DStringInit(&ds);
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (hPtr = Blt_FirstHashEntry(&tdPtr->treeTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Blt_ObjectName objName;
- TreeCmd *cmdPtr;
- char *qualName;
- Tcl_Obj *objPtr;
-
- cmdPtr = Blt_GetHashValue(hPtr);
- objName.name = Tcl_GetCommandName(interp, cmdPtr->cmdToken);
- objName.nsPtr = Blt_GetCommandNamespace(cmdPtr->cmdToken);
- qualName = Blt_MakeQualifiedName(&objName, &ds);
- if (objc == 3) {
- if (!Tcl_StringMatch(qualName, Tcl_GetString(objv[2]))) {
- continue;
- }
- }
- objPtr = Tcl_NewStringObj(qualName, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- Tcl_DStringFree(&ds);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-TreeLoadOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- TreeCmdInterpData *dataPtr = clientData;
- Tcl_DString libName;
- char *fmt;
- char *safeProcName, *initProcName;
- int result;
- int length;
-
- fmt = Tcl_GetStringFromObj(objv[2], &length);
- hPtr = Blt_FindHashEntry(&dataPtr->fmtTable, fmt);
- if (hPtr != NULL) {
- return TCL_OK; /* Converter for format is already loaded. */
- }
- Tcl_DStringInit(&libName);
- {
- Tcl_DString pathName;
- const char *path;
-
- Tcl_DStringInit(&pathName);
- path = Tcl_TranslateFileName(interp, Tcl_GetString(objv[3]), &pathName);
- if (path == NULL) {
- Tcl_DStringFree(&pathName);
- return TCL_ERROR;
- }
- Tcl_DStringAppend(&libName, path, -1);
- Tcl_DStringFree(&pathName);
- }
- Tcl_DStringAppend(&libName, "/", -1);
- Tcl_UtfToTitle(fmt);
- Tcl_DStringAppend(&libName, "Tree", 4);
- Tcl_DStringAppend(&libName, fmt, -1);
- Tcl_DStringAppend(&libName, Blt_Itoa(BLT_MAJOR_VERSION), 1);
- Tcl_DStringAppend(&libName, Blt_Itoa(BLT_MINOR_VERSION), 1);
- Tcl_DStringAppend(&libName, BLT_LIB_SUFFIX, -1);
- Tcl_DStringAppend(&libName, BLT_SO_EXT, -1);
-
- initProcName = Blt_AssertMalloc(8 + length + 4 + 1);
- sprintf_s(initProcName, 8 + length + 4 + 1, "Blt_Tree%sInit", fmt);
- safeProcName = Blt_AssertMalloc(8 + length + 8 + 1);
- sprintf_s(safeProcName, 8 + length + 9 + 1, "Blt_Tree%sSafeInit", fmt);
- result = Blt_LoadLibrary(interp, Tcl_DStringValue(&libName), initProcName,
- safeProcName);
- Tcl_DStringFree(&libName);
- if (safeProcName != NULL) {
- Blt_Free(safeProcName);
- }
- if (initProcName != NULL) {
- Blt_Free(initProcName);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeObjCmd --
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec treeCmdOps[] =
-{
- {"create", 1, TreeCreateOp, 2, 3, "?name?",},
- {"destroy", 1, TreeDestroyOp, 3, 0, "name...",},
- {"load", 1, TreeLoadOp, 4, 4, "name libpath",},
- {"names", 1, TreeNamesOp, 2, 3, "?pattern?...",},
-};
-
-static int nCmdOps = sizeof(treeCmdOps) / sizeof(Blt_OpSpec);
-
-/*ARGSUSED*/
-static int
-TreeObjCmd(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
-
- proc = Blt_GetOpFromObj(interp, nCmdOps, treeCmdOps, BLT_OP_ARG1, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (clientData, interp, objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeInterpDeleteProc --
- *
- * This is called when the interpreter hosting the "tree" command
- * is deleted.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Removes the hash table managing all tree names.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-TreeInterpDeleteProc(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp)
-{
- TreeCmdInterpData *tdPtr = clientData;
-
- /*
- * All tree instances should already have been destroyed when their
- * respective TCL commands were deleted.
- */
- Blt_DeleteHashTable(&tdPtr->treeTable);
- Tcl_DeleteAssocData(interp, TREE_THREAD_KEY);
- Blt_Free(tdPtr);
-}
-
-/*ARGSUSED*/
-static int
-CompareDictionaryCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- int result;
- const char *s1, *s2;
-
- s1 = Tcl_GetString(objv[1]);
- s2 = Tcl_GetString(objv[2]);
- result = Blt_DictionaryCompare(s1, s2);
- Tcl_SetIntObj(Tcl_GetObjResult(interp), result);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-ExitCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- int code;
-
- if (Tcl_GetIntFromObj(interp, objv[1], &code) != TCL_OK) {
- return TCL_ERROR;
- }
-#ifdef TCL_THREADS
- Tcl_Exit(code);
-#else
- exit(code);
-#endif
- /*NOTREACHED*/
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeCmdInitProc --
- *
- * This procedure is invoked to initialize the "tree" command.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates the new command and adds a new entry into a global Tcl
- * associative array.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_TreeCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {
- "tree", TreeObjCmd,
- };
- static Blt_InitCmdSpec utilSpecs[] = {
- { "compare", CompareDictionaryCmd, },
- { "_exit", ExitCmd, }
- };
- if (Blt_InitCmds(interp, "::blt::util", utilSpecs, 2) != TCL_OK) {
- return TCL_ERROR;
- }
- cmdSpec.clientData = GetTreeCmdInterpData(interp);
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-/* Dump tree to dbm */
-/* Convert node data to datablock */
-
-
-int
-Blt_Tree_RegisterFormat(
- Tcl_Interp *interp,
- const char *fmt,
- Blt_TreeImportProc *importProc,
- Blt_TreeExportProc *exportProc)
-{
- Blt_HashEntry *hPtr;
- DataFormat *fmtPtr;
- TreeCmdInterpData *dataPtr;
- int isNew;
-
- dataPtr = GetTreeCmdInterpData(interp);
- hPtr = Blt_CreateHashEntry(&dataPtr->fmtTable, fmt, &isNew);
- if (isNew) {
- fmtPtr = Blt_AssertMalloc(sizeof(DataFormat));
- fmtPtr->name = Blt_AssertStrdup(fmt);
- Blt_SetHashValue(hPtr, fmtPtr);
- } else {
- fmtPtr = Blt_GetHashValue(hPtr);
- }
- fmtPtr->isLoaded = TRUE;
- fmtPtr->importProc = importProc;
- fmtPtr->exportProc = exportProc;
- return TCL_OK;
-}
-
-#endif /* NO_TREE */
-
diff --git a/blt3.0.1/src/bltTreeView.c b/blt3.0.1/src/bltTreeView.c
deleted file mode 100644
index 5f972da..0000000
--- a/blt3.0.1/src/bltTreeView.c
+++ /dev/null
@@ -1,5489 +0,0 @@
-
-/*
- * bltTreeView.c --
- *
- * This module implements an hierarchy widget for the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * TODO:
- *
- * BUGS:
- * 1. "open" operation should change scroll offset so that as many
- * new entries (up to half a screen) can be seen.
- * 2. "open" needs to adjust the scrolloffset so that the same entry
- * is seen at the same place.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_TREEVIEW
-
-#include "bltTreeView.h"
-
-#define BUTTON_PAD 2
-#define BUTTON_IPAD 1
-#define BUTTON_SIZE 7
-#define COLUMN_PAD 2
-#define FOCUS_WIDTH 1
-#define ICON_PADX 2
-#define ICON_PADY 1
-#define INSET_PAD 0
-#define LABEL_PADX 0
-#define LABEL_PADY 0
-
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-
-#define DEF_ICON_WIDTH 1
-#define DEF_ICON_HEIGHT 16
-
-typedef TreeViewColumn Column;
-
-typedef ClientData (TagProc)(TreeView *viewPtr, const char *string);
-
-static Blt_TreeApplyProc DeleteApplyProc;
-static Blt_TreeApplyProc CreateApplyProc;
-
-BLT_EXTERN Blt_CustomOption bltTreeViewDataOption;
-
-static Blt_OptionParseProc ObjToTree;
-static Blt_OptionPrintProc TreeToObj;
-static Blt_OptionFreeProc FreeTree;
-Blt_CustomOption bltTreeViewTreeOption =
-{
- ObjToTree, TreeToObj, FreeTree, NULL,
-};
-
-static Blt_OptionParseProc ObjToIcons;
-static Blt_OptionPrintProc IconsToObj;
-static Blt_OptionFreeProc FreeIcons;
-
-Blt_CustomOption bltTreeViewIconsOption =
-{
- ObjToIcons, IconsToObj, FreeIcons, NULL,
-};
-
-static Blt_OptionParseProc ObjToButton;
-static Blt_OptionPrintProc ButtonToObj;
-static Blt_CustomOption buttonOption = {
- ObjToButton, ButtonToObj, NULL, NULL,
-};
-
-static Blt_OptionParseProc ObjToUid;
-static Blt_OptionPrintProc UidToObj;
-static Blt_OptionFreeProc FreeUid;
-Blt_CustomOption bltTreeViewUidOption = {
- ObjToUid, UidToObj, FreeUid, NULL,
-};
-
-static Blt_OptionParseProc ObjToScrollmode;
-static Blt_OptionPrintProc ScrollmodeToObj;
-static Blt_CustomOption scrollmodeOption = {
- ObjToScrollmode, ScrollmodeToObj, NULL, NULL,
-};
-
-static Blt_OptionParseProc ObjToSelectmode;
-static Blt_OptionPrintProc SelectmodeToObj;
-static Blt_CustomOption selectmodeOption = {
- ObjToSelectmode, SelectmodeToObj, NULL, NULL,
-};
-
-static Blt_OptionParseProc ObjToSeparator;
-static Blt_OptionPrintProc SeparatorToObj;
-static Blt_OptionFreeProc FreeSeparator;
-static Blt_CustomOption separatorOption = {
- ObjToSeparator, SeparatorToObj, FreeSeparator, NULL,
-};
-
-static Blt_OptionParseProc ObjToLabel;
-static Blt_OptionPrintProc LabelToObj;
-static Blt_OptionFreeProc FreeLabel;
-static Blt_CustomOption labelOption = {
- ObjToLabel, LabelToObj, FreeLabel, NULL,
-};
-
-static Blt_OptionParseProc ObjToStyles;
-static Blt_OptionPrintProc StylesToObj;
-static Blt_CustomOption stylesOption = {
- ObjToStyles, StylesToObj, NULL, NULL,
-};
-
-#define DEF_BUTTON_ACTIVE_BACKGROUND RGB_WHITE
-#define DEF_BUTTON_ACTIVE_BG_MONO STD_ACTIVE_BG_MONO
-#define DEF_BUTTON_ACTIVE_FOREGROUND STD_ACTIVE_FOREGROUND
-#define DEF_BUTTON_ACTIVE_FG_MONO STD_ACTIVE_FG_MONO
-#define DEF_BUTTON_BORDERWIDTH "1"
-#define DEF_BUTTON_CLOSE_RELIEF "solid"
-#define DEF_BUTTON_OPEN_RELIEF "solid"
-#define DEF_BUTTON_NORMAL_BACKGROUND RGB_WHITE
-#define DEF_BUTTON_NORMAL_BG_MONO STD_NORMAL_BG_MONO
-#define DEF_BUTTON_NORMAL_FOREGROUND STD_NORMAL_FOREGROUND
-#define DEF_BUTTON_NORMAL_FG_MONO STD_NORMAL_FG_MONO
-#define DEF_BUTTON_SIZE "7"
-
-/* RGB_LIGHTBLUE1 */
-
-#define DEF_ACTIVE_FOREGROUND RBG_BLACK
-#define DEF_ACTIVE_RELIEF "flat"
-#define DEF_ALLOW_DUPLICATES "yes"
-#define DEF_BACKGROUND RGB_WHITE
-#define DEF_ALT_BACKGROUND RGB_GREY97
-#define DEF_BORDERWIDTH STD_BORDERWIDTH
-#define DEF_BUTTON "auto"
-#define DEF_DASHES "dot"
-#define DEF_EXPORT_SELECTION "no"
-#define DEF_FOREGROUND STD_NORMAL_FOREGROUND
-#define DEF_FG_MONO STD_NORMAL_FG_MONO
-#define DEF_FLAT "no"
-#define DEF_FOCUS_DASHES "dot"
-#define DEF_FOCUS_EDIT "no"
-#define DEF_FOCUS_FOREGROUND STD_ACTIVE_FOREGROUND
-#define DEF_FOCUS_FG_MONO STD_ACTIVE_FG_MONO
-#define DEF_FONT STD_FONT_SMALL
-#define DEF_HEIGHT "400"
-#define DEF_HIDE_LEAVES "no"
-#define DEF_HIDE_ROOT "yes"
-#define DEF_FOCUS_HIGHLIGHT_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_FOCUS_HIGHLIGHT_COLOR RGB_BLACK
-#define DEF_FOCUS_HIGHLIGHT_WIDTH "2"
-#define DEF_ICONVARIABLE ((char *)NULL)
-#define DEF_ICONS "::blt::TreeView::closeIcon ::blt::TreeView::openIcon"
-#define DEF_LINECOLOR RGB_GREY30
-#define DEF_LINECOLOR_MONO STD_NORMAL_FG_MONO
-#define DEF_LINESPACING "0"
-#define DEF_LINEWIDTH "1"
-#define DEF_MAKE_PATH "no"
-#define DEF_NEW_TAGS "no"
-#define DEF_NORMAL_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_NORMAL_FG_MONO STD_ACTIVE_FG_MONO
-#define DEF_RELIEF "sunken"
-#define DEF_RESIZE_CURSOR "arrow"
-#define DEF_SCROLL_INCREMENT "20"
-#define DEF_SCROLL_MODE "hierbox"
-#define DEF_SELECT_BACKGROUND STD_SELECT_BACKGROUND
-#define DEF_SELECT_BG_MONO STD_SELECT_BG_MONO
-#define DEF_SELECT_BORDERWIDTH "1"
-#define DEF_SELECT_FOREGROUND STD_SELECT_FOREGROUND
-#define DEF_SELECT_FG_MONO STD_SELECT_FG_MONO
-#define DEF_SELECT_MODE "single"
-#define DEF_SELECT_RELIEF "flat"
-#define DEF_SHOW_ROOT "yes"
-#define DEF_SHOW_TITLES "yes"
-#define DEF_SORT_SELECTION "no"
-#define DEF_TAKE_FOCUS "1"
-#define DEF_TEXT_COLOR STD_NORMAL_FOREGROUND
-#define DEF_TEXT_MONO STD_NORMAL_FG_MONO
-#define DEF_TEXTVARIABLE ((char *)NULL)
-#define DEF_TRIMLEFT ""
-#define DEF_WIDTH "200"
-
-#define TvOffset(x) Blt_Offset(TreeView, x)
-
-Blt_ConfigSpec bltTreeViewButtonSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "Background", DEF_BUTTON_ACTIVE_BACKGROUND, TvOffset(button.activeBg), 0},
- {BLT_CONFIG_SYNONYM, "-activebg", "activeBackground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-activefg", "activeForeground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground", "Foreground",
- DEF_BUTTON_ACTIVE_FOREGROUND, TvOffset(button.activeFgColor), 0},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_BUTTON_NORMAL_BACKGROUND, TvOffset(button.bg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_BUTTON_BORDERWIDTH, TvOffset(button.borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-closerelief", "closeRelief", "Relief",
- DEF_BUTTON_CLOSE_RELIEF, TvOffset(button.closeRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_BUTTON_NORMAL_FOREGROUND, TvOffset(button.fgColor), 0},
- {BLT_CONFIG_CUSTOM, "-images", "images", "Icons", (char *)NULL,
- TvOffset(button.icons), BLT_CONFIG_NULL_OK, &bltTreeViewIconsOption},
- {BLT_CONFIG_RELIEF, "-openrelief", "openRelief", "Relief",
- DEF_BUTTON_OPEN_RELIEF, TvOffset(button.openRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-size", "size", "Size", DEF_BUTTON_SIZE,
- TvOffset(button.reqSize), 0},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL, 0, 0}
-};
-
-#define EntryOffset(x) Blt_Offset(TreeViewEntry, x)
-
-Blt_ConfigSpec bltTreeViewEntrySpecs[] =
-{
- {BLT_CONFIG_CUSTOM, "-bindtags", (char *)NULL, (char *)NULL, (char *)NULL,
- EntryOffset(tagsUid), BLT_CONFIG_NULL_OK, &bltTreeViewUidOption},
- {BLT_CONFIG_CUSTOM, "-button", (char *)NULL, (char *)NULL, DEF_BUTTON,
- EntryOffset(flags), BLT_CONFIG_DONT_SET_DEFAULT, &buttonOption},
- {BLT_CONFIG_CUSTOM, "-closecommand", (char *)NULL, (char *)NULL,
- (char *)NULL, EntryOffset(closeCmd), BLT_CONFIG_NULL_OK,
- &bltTreeViewUidOption},
- {BLT_CONFIG_CUSTOM, "-data", (char *)NULL, (char *)NULL, (char *)NULL, 0,
- BLT_CONFIG_NULL_OK, &bltTreeViewDataOption},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_FONT, "-font", (char *)NULL, (char *)NULL, (char *)NULL,
- EntryOffset(font), 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", (char *)NULL, (char *)NULL,
- EntryOffset(color), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-height", (char *)NULL, (char *)NULL,
- (char *)NULL, EntryOffset(reqHeight), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-icons", (char *)NULL, (char *)NULL, (char *)NULL,
- EntryOffset(icons), BLT_CONFIG_NULL_OK, &bltTreeViewIconsOption},
- {BLT_CONFIG_CUSTOM, "-label", (char *)NULL, (char *)NULL, (char *)NULL,
- EntryOffset(labelUid), 0, &labelOption},
- {BLT_CONFIG_CUSTOM, "-opencommand", (char *)NULL, (char *)NULL,
- (char *)NULL, EntryOffset(openCmd), BLT_CONFIG_NULL_OK,
- &bltTreeViewUidOption},
- {BLT_CONFIG_CUSTOM, "-styles", (char *)NULL, (char *)NULL,
- (char *)NULL, EntryOffset(values), BLT_CONFIG_NULL_OK, &stylesOption},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-Blt_ConfigSpec bltTreeViewSpecs[] =
-{
- {BLT_CONFIG_BITMASK, "-allowduplicates", "allowDuplicates",
- "AllowDuplicates", DEF_ALLOW_DUPLICATES, TvOffset(flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)TV_ALLOW_DUPLICATES},
- {BLT_CONFIG_SYNONYM, "-altbg", "alternateBackground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_BACKGROUND, "-alternatebackground", "alternateBackground",
- "Background", DEF_ALT_BACKGROUND, TvOffset(altBg), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMASK, "-autocreate", "autoCreate", "AutoCreate",
- DEF_MAKE_PATH, TvOffset(flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)TV_FILL_ANCESTORS},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_BACKGROUND, TvOffset(bg), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_BORDERWIDTH, TvOffset(borderWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-button", "button", "Button", DEF_BUTTON,
- TvOffset(buttonFlags), BLT_CONFIG_DONT_SET_DEFAULT, &buttonOption},
- {BLT_CONFIG_STRING, "-closecommand", "closeCommand", "CloseCommand",
- (char *)NULL, TvOffset(closeCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", (char *)NULL,
- TvOffset(cursor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_DASHES, "-dashes", "dashes", "Dashes", DEF_DASHES,
- TvOffset(dashes), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-exportselection", "exportSelection",
- "ExportSelection", DEF_EXPORT_SELECTION, TvOffset(flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)TV_SELECT_EXPORT},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_BOOLEAN, "-flat", "flat", "Flat", DEF_FLAT, TvOffset(flatView),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_DASHES, "-focusdashes", "focusDashes", "FocusDashes",
- DEF_FOCUS_DASHES, TvOffset(focusDashes), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-focusforeground", "focusForeground", "FocusForeground",
- DEF_FOCUS_FOREGROUND, TvOffset(focusColor),BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-focusforeground", "focusForeground", "FocusForeground",
- DEF_FOCUS_FG_MONO, TvOffset(focusColor), BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_FONT, TvOffset(font), 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", DEF_TEXT_COLOR,
- TvOffset(fgColor), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", DEF_TEXT_MONO,
- TvOffset(fgColor), BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_PIXELS_NNEG, "-height", "height", "Height", DEF_HEIGHT,
- TvOffset(reqHeight), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BITMASK, "-hideleaves", "hideLeaves", "HideLeaves",
- DEF_HIDE_LEAVES, TvOffset(flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)TV_HIDE_LEAVES},
- {BLT_CONFIG_BITMASK, "-hideroot", "hideRoot", "HideRoot", DEF_HIDE_ROOT,
- TvOffset(flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)HIDE_ROOT},
- {BLT_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_FOCUS_HIGHLIGHT_BACKGROUND,
- TvOffset(highlightBgColor), 0},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_FOCUS_HIGHLIGHT_COLOR, TvOffset(highlightColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_FOCUS_HIGHLIGHT_WIDTH, TvOffset(highlightWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-iconvariable", "iconVariable", "IconVariable",
- DEF_TEXTVARIABLE, Blt_Offset(TreeView, iconVarObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-icons", "icons", "Icons", DEF_ICONS,
- TvOffset(icons), BLT_CONFIG_NULL_OK, &bltTreeViewIconsOption},
- {BLT_CONFIG_COLOR, "-linecolor", "lineColor", "LineColor",
- DEF_LINECOLOR, TvOffset(lineColor), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-linecolor", "lineColor", "LineColor",
- DEF_LINECOLOR_MONO, TvOffset(lineColor), BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_PIXELS_NNEG, "-linespacing", "lineSpacing", "LineSpacing",
- DEF_LINESPACING, TvOffset(leader), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-linewidth", "lineWidth", "LineWidth",
- DEF_LINEWIDTH, TvOffset(lineWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-opencommand", "openCommand", "OpenCommand",
- (char *)NULL, TvOffset(openCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_RELIEF,
- TvOffset(relief), 0},
- {BLT_CONFIG_CURSOR, "-resizecursor", "resizeCursor", "ResizeCursor",
- DEF_RESIZE_CURSOR, TvOffset(resizeCursor), 0},
- {BLT_CONFIG_CUSTOM, "-scrollmode", "scrollMode", "ScrollMode",
- DEF_SCROLL_MODE, TvOffset(scrollMode),
- BLT_CONFIG_DONT_SET_DEFAULT, &scrollmodeOption},
- {BLT_CONFIG_BACKGROUND, "-selectbackground", "selectBackground",
- "Foreground", DEF_SELECT_BACKGROUND, TvOffset(selBg), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-selectborderwidth", "selectBorderWidth",
- "BorderWidth", DEF_SELECT_BORDERWIDTH, TvOffset(selBW),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-selectcommand", "selectCommand", "SelectCommand",
- (char *)NULL, TvOffset(selectCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background",
- DEF_SELECT_FOREGROUND, TvOffset(selFgColor), 0},
- {BLT_CONFIG_CUSTOM, "-selectmode", "selectMode", "SelectMode",
- DEF_SELECT_MODE, TvOffset(selectMode),
- BLT_CONFIG_DONT_SET_DEFAULT, &selectmodeOption},
- {BLT_CONFIG_RELIEF, "-selectrelief", "selectRelief", "Relief",
- DEF_SELECT_RELIEF, TvOffset(selRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-separator", "separator", "Separator", (char *)NULL,
- TvOffset(pathSep), BLT_CONFIG_NULL_OK, &separatorOption},
- {BLT_CONFIG_BITMASK, "-newtags", "newTags", "newTags",
- DEF_NEW_TAGS, TvOffset(flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)TV_NEW_TAGS},
- {BLT_CONFIG_BITMASK, "-showtitles", "showTitles", "ShowTitles",
- DEF_SHOW_TITLES, TvOffset(flags), 0,
- (Blt_CustomOption *)TV_SHOW_COLUMN_TITLES},
- {BLT_CONFIG_BITMASK, "-sortselection", "sortSelection", "SortSelection",
- DEF_SORT_SELECTION, TvOffset(flags),
- BLT_CONFIG_DONT_SET_DEFAULT, (Blt_CustomOption *)TV_SELECT_SORTED},
- {BLT_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_TAKE_FOCUS, TvOffset(takeFocus), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_OBJ, "-textvariable", "textVariable", "TextVariable",
- DEF_TEXTVARIABLE, Blt_Offset(TreeView, textVarObjPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-tree", "tree", "Tree", (char *)NULL,
- TvOffset(treeName), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-trim", "trim", "Trim", DEF_TRIMLEFT,
- TvOffset(trimLeft), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-width", "width", "Width", DEF_WIDTH,
- TvOffset(reqWidth), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
- (char *)NULL, TvOffset(xScrollCmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-xscrollincrement", "xScrollIncrement",
- "ScrollIncrement", DEF_SCROLL_INCREMENT, TvOffset(xScrollUnits),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
- (char *)NULL, TvOffset(yScrollCmdObjPtr), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-yscrollincrement", "yScrollIncrement",
- "ScrollIncrement", DEF_SCROLL_INCREMENT,
- TvOffset(yScrollUnits), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-/* Forward Declarations */
-BLT_EXTERN Blt_TreeApplyProc TreeViewSortApplyProc;
-static Blt_BindPickProc PickItem;
-static Blt_BindTagProc GetTags;
-static Blt_TreeNotifyEventProc TreeEventProc;
-static Blt_TreeTraceProc TreeTraceProc;
-static Tcl_CmdDeleteProc WidgetInstCmdDeleteProc;
-static Tcl_FreeProc DestroyEntry;
-static Tcl_FreeProc DestroyTreeView;
-static Tcl_IdleProc DisplayTreeView;
-static Tcl_ObjCmdProc TreeViewObjCmd;
-static Tk_EventProc TreeViewEventProc;
-static Tk_ImageChangedProc IconChangedProc;
-static Tk_SelectionProc SelectionProc;
-
-static int ComputeVisibleEntries(TreeView *viewPtr);
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_EventuallyRedraw --
- *
- * Queues a request to redraw the widget at the next idle point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets redisplayed. Right now we don't do selective
- * redisplays: the whole window will be redrawn.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TreeView_EventuallyRedraw(TreeView *viewPtr)
-{
- if ((viewPtr->tkwin != NULL) && ((viewPtr->flags & REDRAW_PENDING) == 0) &&
- ((viewPtr->flags & DONT_UPDATE) == 0)) {
- viewPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayTreeView, viewPtr);
- }
-}
-
-void
-Blt_TreeView_TraceColumn(TreeView *viewPtr, TreeViewColumn *cp)
-{
- Blt_Tree_CreateTrace(viewPtr->tree, NULL /* Node */, cp->key, NULL,
- TREE_TRACE_FOREIGN_ONLY | TREE_TRACE_WRITE | TREE_TRACE_UNSET,
- TreeTraceProc, viewPtr);
-}
-
-static void
-TraceColumns(TreeView *viewPtr)
-{
- Blt_ChainLink link;
-
- for(link = Blt_Chain_FirstLink(viewPtr->columns); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TreeViewColumn *cp;
-
- cp = Blt_Chain_GetValue(link);
- Blt_Tree_CreateTrace(
- viewPtr->tree,
- NULL /* Node */,
- cp->key /* Key pattern */,
- NULL /* Tag */,
- TREE_TRACE_FOREIGN_ONLY | TREE_TRACE_WRITE | TREE_TRACE_UNSET,
- TreeTraceProc /* Callback routine */,
- viewPtr /* Client data */);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToTree --
- *
- * Convert the string representing the name of a tree object
- * into a tree token.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToTree(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_Tree tree = *(Blt_Tree *)(widgRec + offset);
-
- if (Blt_Tree_Attach(interp, tree, Tcl_GetString(objPtr)) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeToObj --
- *
- * Results:
- * The string representation of the button boolean is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-TreeToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Blt_Tree tree = *(Blt_Tree *)(widgRec + offset);
-
- if (tree == NULL) {
- return Tcl_NewStringObj("", -1);
- } else {
- return Tcl_NewStringObj(Blt_Tree_Name(tree), -1);
- }
-}
-
-/*ARGSUSED*/
-static void
-FreeTree(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- Blt_Tree *treePtr = (Blt_Tree *)(widgRec + offset);
-
- if (*treePtr != NULL) {
- Blt_TreeNode root;
- TreeView *viewPtr = clientData;
-
- /*
- * Release the current tree, removing any entry fields.
- */
- root = Blt_Tree_RootNode(*treePtr);
- Blt_Tree_Apply(root, DeleteApplyProc, viewPtr);
- Blt_TreeView_ClearSelection(viewPtr);
- Blt_Tree_Close(*treePtr);
- *treePtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToScrollmode --
- *
- * Convert the string reprsenting a scroll mode, to its numeric
- * form.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToScrollmode(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* New legend position string */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- char *string;
- char c;
- int *modePtr = (int *)(widgRec + offset);
-
- string = Tcl_GetString(objPtr);
- c = string[0];
- if ((c == 'l') && (strcmp(string, "listbox") == 0)) {
- *modePtr = BLT_SCROLL_MODE_LISTBOX;
- } else if ((c == 't') && (strcmp(string, "treeview") == 0)) {
- *modePtr = BLT_SCROLL_MODE_HIERBOX;
- } else if ((c == 'c') && (strcmp(string, "canvas") == 0)) {
- *modePtr = BLT_SCROLL_MODE_CANVAS;
- } else {
- Tcl_AppendResult(interp, "bad scroll mode \"", string,
- "\": should be \"treeview\", \"listbox\", or \"canvas\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScrollmodeToObj --
- *
- * Results:
- * The string representation of the button boolean is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ScrollmodeToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- int mode = *(int *)(widgRec + offset);
-
- switch (mode) {
- case BLT_SCROLL_MODE_LISTBOX:
- return Tcl_NewStringObj("listbox", -1);
- case BLT_SCROLL_MODE_HIERBOX:
- return Tcl_NewStringObj("hierbox", -1);
- case BLT_SCROLL_MODE_CANVAS:
- return Tcl_NewStringObj("canvas", -1);
- default:
- return Tcl_NewStringObj("unknown scroll mode", -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToSelectmode --
- *
- * Convert the string reprsenting a scroll mode, to its numeric
- * form.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToSelectmode(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- char *string;
- char c;
- int *modePtr = (int *)(widgRec + offset);
-
- string = Tcl_GetString(objPtr);
- c = string[0];
- if ((c == 's') && (strcmp(string, "single") == 0)) {
- *modePtr = SELECT_MODE_SINGLE;
- } else if ((c == 'm') && (strcmp(string, "multiple") == 0)) {
- *modePtr = SELECT_MODE_MULTIPLE;
- } else if ((c == 'a') && (strcmp(string, "active") == 0)) {
- *modePtr = SELECT_MODE_SINGLE;
- } else {
- Tcl_AppendResult(interp, "bad select mode \"", string,
- "\": should be \"single\" or \"multiple\"", (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectmodeToObj --
- *
- * Results:
- * The string representation of the button boolean is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-SelectmodeToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- int mode = *(int *)(widgRec + offset);
-
- switch (mode) {
- case SELECT_MODE_SINGLE:
- return Tcl_NewStringObj("single", -1);
- case SELECT_MODE_MULTIPLE:
- return Tcl_NewStringObj("multiple", -1);
- default:
- return Tcl_NewStringObj("unknown scroll mode", -1);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToButton --
- *
- * Convert a string to one of three values.
- * 0 - false, no, off
- * 1 - true, yes, on
- * 2 - auto
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToButton(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- char *string;
- int *flagsPtr = (int *)(widgRec + offset);
-
- string = Tcl_GetString(objPtr);
- if ((string[0] == 'a') && (strcmp(string, "auto") == 0)) {
- *flagsPtr &= ~BUTTON_MASK;
- *flagsPtr |= BUTTON_AUTO;
- } else {
- int bool;
-
- if (Tcl_GetBooleanFromObj(interp, objPtr, &bool) != TCL_OK) {
- return TCL_ERROR;
- }
- *flagsPtr &= ~BUTTON_MASK;
- if (bool) {
- *flagsPtr |= BUTTON_SHOW;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonToObj --
- *
- * Results:
- * The string representation of the button boolean is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ButtonToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- int bool;
- unsigned int buttonFlags = *(int *)(widgRec + offset);
-
- bool = (buttonFlags & BUTTON_MASK);
- if (bool == BUTTON_AUTO) {
- return Tcl_NewStringObj("auto", 4);
- } else {
- return Tcl_NewBooleanObj(bool);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToScrollmode --
- *
- * Convert the string reprsenting a scroll mode, to its numeric
- * form.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToSeparator(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- char **sepPtr = (char **)(widgRec + offset);
- char *string;
-
- string = Tcl_GetString(objPtr);
- if (string[0] == '\0') {
- *sepPtr = SEPARATOR_LIST;
- } else if (strcmp(string, "none") == 0) {
- *sepPtr = SEPARATOR_NONE;
- } else {
- *sepPtr = Blt_AssertStrdup(string);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SeparatorToObj --
- *
- * Results:
- * The string representation of the separator is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-SeparatorToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- char *separator = *(char **)(widgRec + offset);
-
- if (separator == SEPARATOR_NONE) {
- return Tcl_NewStringObj("", -1);
- } else if (separator == SEPARATOR_LIST) {
- return Tcl_NewStringObj("list", -1);
- } else {
- return Tcl_NewStringObj(separator, -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeSeparator --
- *
- * Free the UID from the widget record, setting it to NULL.
- *
- * Results:
- * The UID in the widget record is set to NULL.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-FreeSeparator(ClientData clientData, Display *display, char *widgRec,
- int offset)
-{
- char **sepPtr = (char **)(widgRec + offset);
-
- if ((*sepPtr != SEPARATOR_LIST) && (*sepPtr != SEPARATOR_NONE)) {
- Blt_Free(*sepPtr);
- *sepPtr = SEPARATOR_NONE;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToLabel --
- *
- * Convert the string representing the label.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToLabel(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- UID *labelPtr = (UID *)(widgRec + offset);
- char *string;
-
- string = Tcl_GetString(objPtr);
- if (string[0] != '\0') {
- TreeView *viewPtr = clientData;
-
- *labelPtr = Blt_TreeView_GetUid(viewPtr, string);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeToObj --
- *
- * Results:
- * The string of the entry's label is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-LabelToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- UID labelUid = *(UID *)(widgRec + offset);
- const char *string;
-
- if (labelUid == NULL) {
- TreeViewEntry *entryPtr = (TreeViewEntry *)widgRec;
-
- string = Blt_Tree_NodeLabel(entryPtr->node);
- } else {
- string = labelUid;
- }
- return Tcl_NewStringObj(string, -1);
-}
-
-/*ARGSUSED*/
-static void
-FreeLabel(ClientData clientData, Display *display, char *widgRec, int offset)
-{
- UID *labelPtr = (UID *)(widgRec + offset);
-
- if (*labelPtr != NULL) {
- TreeView *viewPtr = clientData;
-
- Blt_TreeView_FreeUid(viewPtr, *labelPtr);
- *labelPtr = NULL;
- }
-}
-/*
-
- *---------------------------------------------------------------------------
- *
- * ObjToStyles --
- *
- * Convert the list representing the field-name style-name pairs into
- * stylePtr's.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToStyles(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- TreeViewEntry *entryPtr = (TreeViewEntry *)widgRec;
- TreeView *viewPtr;
- Tcl_Obj **objv;
- int objc;
- int i;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc & 1) {
- Tcl_AppendResult(interp, "odd number of field/style pairs in \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- viewPtr = entryPtr->viewPtr;
- for (i = 0; i < objc; i += 2) {
- TreeViewValue *valuePtr;
- TreeViewStyle *stylePtr;
- TreeViewColumn *cp;
- char *string;
-
- if (Blt_TreeView_GetColumn(interp, viewPtr, objv[i], &cp)!=TCL_OK) {
- return TCL_ERROR;
- }
- valuePtr = Blt_TreeView_FindValue(entryPtr, cp);
- if (valuePtr == NULL) {
- return TCL_ERROR;
- }
- string = Tcl_GetString(objv[i+1]);
- stylePtr = NULL;
- if ((*string != '\0') && (Blt_TreeView_GetStyle(interp, viewPtr, string,
- &stylePtr) != TCL_OK)) {
- return TCL_ERROR; /* No data ??? */
- }
- if (valuePtr->stylePtr != NULL) {
- Blt_TreeView_FreeStyle(viewPtr, valuePtr->stylePtr);
- }
- valuePtr->stylePtr = stylePtr;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StylesToObj --
- *
- * Results:
- * The string representation of the button boolean is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-StylesToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- TreeViewEntry *entryPtr = (TreeViewEntry *)widgRec;
- TreeViewValue *vp;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (vp = entryPtr->values; vp != NULL; vp = vp->nextPtr) {
- const char *styleName;
-
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(vp->columnPtr->key, -1));
- styleName = (vp->stylePtr != NULL) ? vp->stylePtr->name : "";
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(styleName, -1));
- }
- return listObjPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_GetUid --
- *
- * Gets or creates a unique string identifier. Strings are reference
- * counted. The string is placed into a hashed table local to the
- * treeview.
- *
- * Results:
- * Returns the pointer to the hashed string.
- *
- *---------------------------------------------------------------------------
- */
-UID
-Blt_TreeView_GetUid(TreeView *viewPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- size_t refCount;
-
- hPtr = Blt_CreateHashEntry(&viewPtr->uidTable, string, &isNew);
- if (isNew) {
- refCount = 1;
- } else {
- refCount = (size_t)Blt_GetHashValue(hPtr);
- refCount++;
- }
- Blt_SetHashValue(hPtr, refCount);
- return Blt_GetHashKey(&viewPtr->uidTable, hPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_FreeUid --
- *
- * Releases the uid. Uids are reference counted, so only when the
- * reference count is zero (i.e. no one else is using the string) is the
- * entry removed from the hash table.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TreeView_FreeUid(TreeView *viewPtr, UID uid)
-{
- Blt_HashEntry *hPtr;
- size_t refCount;
-
- hPtr = Blt_FindHashEntry(&viewPtr->uidTable, uid);
- assert(hPtr != NULL);
- refCount = (size_t)Blt_GetHashValue(hPtr);
- refCount--;
- if (refCount > 0) {
- Blt_SetHashValue(hPtr, refCount);
- } else {
- Blt_DeleteHashEntry(&viewPtr->uidTable, hPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToUid --
- *
- * Converts the string to a Uid. Uid's are hashed, reference counted
- * strings.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToUid(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- TreeView *viewPtr = clientData;
- UID *uidPtr = (UID *)(widgRec + offset);
-
- *uidPtr = Blt_TreeView_GetUid(viewPtr, Tcl_GetString(objPtr));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UidToObj --
- *
- * Returns the uid as a string.
- *
- * Results:
- * The fill style string is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-UidToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- UID uid = *(UID *)(widgRec + offset);
-
- if (uid == NULL) {
- return Tcl_NewStringObj("", -1);
- } else {
- return Tcl_NewStringObj(uid, -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeUid --
- *
- * Free the UID from the widget record, setting it to NULL.
- *
- * Results:
- * The UID in the widget record is set to NULL.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-FreeUid(ClientData clientData, Display *display, char *widgRec, int offset)
-{
- UID *uidPtr = (UID *)(widgRec + offset);
-
- if (*uidPtr != NULL) {
- TreeView *viewPtr = clientData;
-
- Blt_TreeView_FreeUid(viewPtr, *uidPtr);
- *uidPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconChangedProc
- *
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-IconChangedProc(
- ClientData clientData,
- int x, /* Not used. */
- int y, /* Not used. */
- int width, /* Not used. */
- int height, /* Not used. */
- int imageWidth, /* Not used. */
- int imageHeight) /* Not used. */
-{
- TreeView *viewPtr = clientData;
-
- viewPtr->flags |= (DIRTY | LAYOUT_PENDING | SCROLL_PENDING);
- Blt_TreeView_EventuallyRedraw(viewPtr);
-}
-
-TreeViewIcon
-Blt_TreeView_GetIcon(TreeView *viewPtr, const char *iconName)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- struct _TreeViewIcon *iconPtr;
-
- hPtr = Blt_CreateHashEntry(&viewPtr->iconTable, iconName, &isNew);
- if (isNew) {
- Tk_Image tkImage;
- int width, height;
-
- tkImage = Tk_GetImage(viewPtr->interp, viewPtr->tkwin, (char *)iconName,
- IconChangedProc, viewPtr);
- if (tkImage == NULL) {
- Blt_DeleteHashEntry(&viewPtr->iconTable, hPtr);
- return NULL;
- }
- Tk_SizeOfImage(tkImage, &width, &height);
- iconPtr = Blt_AssertMalloc(sizeof(struct _TreeViewIcon));
- iconPtr->tkImage = tkImage;
- iconPtr->hashPtr = hPtr;
- iconPtr->refCount = 1;
- iconPtr->width = width;
- iconPtr->height = height;
- Blt_SetHashValue(hPtr, iconPtr);
- } else {
- iconPtr = Blt_GetHashValue(hPtr);
- iconPtr->refCount++;
- }
- return iconPtr;
-}
-
-void
-Blt_TreeView_FreeIcon(TreeView *viewPtr, TreeViewIcon icon)
-{
- struct _TreeViewIcon *iconPtr = icon;
-
- iconPtr->refCount--;
- if (iconPtr->refCount == 0) {
- Blt_DeleteHashEntry(&viewPtr->iconTable, iconPtr->hashPtr);
- Tk_FreeImage(iconPtr->tkImage);
- Blt_Free(iconPtr);
- }
-}
-
-static void
-DumpIconTable(TreeView *viewPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
- struct _TreeViewIcon *iconPtr;
-
- for (hPtr = Blt_FirstHashEntry(&viewPtr->iconTable, &iter);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&iter)) {
- iconPtr = Blt_GetHashValue(hPtr);
- Tk_FreeImage(iconPtr->tkImage);
- Blt_Free(iconPtr);
- }
- Blt_DeleteHashTable(&viewPtr->iconTable);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToIcons --
- *
- * Convert a list of image names into Tk images.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToIcons(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new
- * value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tcl_Obj **objv;
- TreeView *viewPtr = clientData;
- TreeViewIcon **iconPtrPtr = (TreeViewIcon **)(widgRec + offset);
- TreeViewIcon *icons;
- int objc;
- int result;
-
- result = TCL_OK;
- icons = NULL;
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc > 0) {
- int i;
-
- icons = Blt_AssertMalloc(sizeof(TreeViewIcon *) * (objc + 1));
- for (i = 0; i < objc; i++) {
- icons[i] = Blt_TreeView_GetIcon(viewPtr, Tcl_GetString(objv[i]));
- if (icons[i] == NULL) {
- result = TCL_ERROR;
- break;
- }
- }
- icons[i] = NULL;
- }
- *iconPtrPtr = icons;
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconsToObj --
- *
- * Converts the icon into its string representation (its name).
- *
- * Results:
- * The name of the icon is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-IconsToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- TreeViewIcon *icons = *(TreeViewIcon **)(widgRec + offset);
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (icons != NULL) {
- TreeViewIcon *iconPtr;
-
- for (iconPtr = icons; *iconPtr != NULL; iconPtr++) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(Blt_Image_Name((*iconPtr)->tkImage), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-
- }
- }
- return listObjPtr;
-}
-
-/*ARGSUSED*/
-static void
-FreeIcons(ClientData clientData, Display *display, char *widgRec, int offset)
-{
- TreeViewIcon **iconsPtr = (TreeViewIcon **)(widgRec + offset);
-
- if (*iconsPtr != NULL) {
- TreeViewIcon *ip;
- TreeView *viewPtr = clientData;
-
- for (ip = *iconsPtr; *ip != NULL; ip++) {
- Blt_TreeView_FreeIcon(viewPtr, *ip);
- }
- Blt_Free(*iconsPtr);
- *iconsPtr = NULL;
- }
-}
-
-TreeViewEntry *
-Blt_TreeView_NodeToEntry(TreeView *viewPtr, Blt_TreeNode node)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->entryTable, (char *)node);
- if (hPtr == NULL) {
- fprintf(stderr, "Blt_TreeView_NodeToEntry: can't find node %s\n",
- Blt_Tree_NodeLabel(node));
- abort();
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-TreeViewEntry *
-Blt_TreeView_FindEntry(TreeView *viewPtr, Blt_TreeNode node)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->entryTable, (char *)node);
- if (hPtr == NULL) {
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-int
-Blt_TreeView_Apply(
- TreeView *viewPtr,
- TreeViewEntry *entryPtr, /* Root entry of subtree. */
- TreeViewApplyProc *proc, /* Procedure called for each entry. */
- unsigned int flags)
-{
- if ((flags & ENTRY_HIDE) && (Blt_TreeView_EntryIsHidden(entryPtr))) {
- return TCL_OK; /* Hidden node. */
- }
- if ((flags & entryPtr->flags) & ENTRY_HIDE) {
- return TCL_OK; /* Hidden node. */
- }
- if ((flags | entryPtr->flags) & ENTRY_CLOSED) {
- TreeViewEntry *childPtr;
- Blt_TreeNode node, next;
-
- for (node = Blt_Tree_FirstChild(entryPtr->node); node != NULL;
- node = next) {
- next = Blt_Tree_NextSibling(node);
- /*
- * Get the next child before calling Blt_TreeView_Apply
- * recursively. This is because the apply callback may delete the
- * node and its link.
- */
- childPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- if (Blt_TreeView_Apply(viewPtr, childPtr, proc, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- if ((*proc) (viewPtr, entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-int
-Blt_TreeView_EntryIsHidden(TreeViewEntry *entryPtr)
-{
- TreeView *viewPtr = entryPtr->viewPtr;
-
- if ((viewPtr->flags & TV_HIDE_LEAVES) && (Blt_Tree_IsLeaf(entryPtr->node))) {
- return TRUE;
- }
- return (entryPtr->flags & ENTRY_HIDE) ? TRUE : FALSE;
-}
-
-#ifdef notdef
-int
-TreeViewEntryIsMapped(TreeViewEntry *entryPtr)
-{
- TreeView *viewPtr = entryPtr->viewPtr;
-
- /* Don't check if the entry itself is open, only that its ancestors
- * are. */
- if (TreeViewEntryIsHidden(entryPtr)) {
- return FALSE;
- }
- if (entryPtr == viewPtr->rootPtr) {
- return TRUE;
- }
- entryPtr = Blt_TreeView_ParentEntry(entryPtr);
- while (entryPtr != viewPtr->rootPtr) {
- if (entryPtr->flags & (ENTRY_CLOSED | ENTRY_HIDE)) {
- return FALSE;
- }
- entryPtr = Blt_TreeView_ParentEntry(entryPtr);
- }
- return TRUE;
-}
-#endif
-
-TreeViewEntry *
-Blt_TreeView_FirstChild(TreeViewEntry *entryPtr, unsigned int mask)
-{
- Blt_TreeNode node;
- TreeView *viewPtr = entryPtr->viewPtr;
-
- for (node = Blt_Tree_FirstChild(entryPtr->node); node != NULL;
- node = Blt_Tree_NextSibling(node)) {
- entryPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- if (((mask & ENTRY_HIDE) == 0) ||
- (!Blt_TreeView_EntryIsHidden(entryPtr))) {
- return entryPtr;
- }
- }
- return NULL;
-}
-
-TreeViewEntry *
-Blt_TreeView_LastChild(TreeViewEntry *entryPtr, unsigned int mask)
-{
- Blt_TreeNode node;
- TreeView *viewPtr = entryPtr->viewPtr;
-
- for (node = Blt_Tree_LastChild(entryPtr->node); node != NULL;
- node = Blt_Tree_PrevSibling(node)) {
- entryPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- if (((mask & ENTRY_HIDE) == 0) ||
- (!Blt_TreeView_EntryIsHidden(entryPtr))) {
- return entryPtr;
- }
- }
- return NULL;
-}
-
-TreeViewEntry *
-Blt_TreeView_NextSibling(TreeViewEntry *entryPtr, unsigned int mask)
-{
- Blt_TreeNode node;
- TreeView *viewPtr = entryPtr->viewPtr;
-
- for (node = Blt_Tree_NextSibling(entryPtr->node); node != NULL;
- node = Blt_Tree_NextSibling(node)) {
- entryPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- if (((mask & ENTRY_HIDE) == 0) ||
- (!Blt_TreeView_EntryIsHidden(entryPtr))) {
- return entryPtr;
- }
- }
- return NULL;
-}
-
-TreeViewEntry *
-Blt_TreeView_PrevSibling(TreeViewEntry *entryPtr, unsigned int mask)
-{
- Blt_TreeNode node;
- TreeView *viewPtr = entryPtr->viewPtr;
-
- for (node = Blt_Tree_PrevSibling(entryPtr->node); node != NULL;
- node = Blt_Tree_PrevSibling(node)) {
- entryPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- if (((mask & ENTRY_HIDE) == 0) ||
- (!Blt_TreeView_EntryIsHidden(entryPtr))) {
- return entryPtr;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_PrevEntry --
- *
- * Returns the "previous" node in the tree. This node (in depth-first
- * order) is its parent if the node has no siblings that are previous to
- * it. Otherwise it is the last descendant of the last sibling. In this
- * case, descend the sibling's hierarchy, using the last child at any
- * ancestor, until we we find a leaf.
- *
- *---------------------------------------------------------------------------
- */
-TreeViewEntry *
-Blt_TreeView_PrevEntry(TreeViewEntry *entryPtr, unsigned int mask)
-{
- TreeView *viewPtr = entryPtr->viewPtr;
- TreeViewEntry *prevPtr;
-
- if (entryPtr->node == Blt_Tree_RootNode(viewPtr->tree)) {
- return NULL; /* The root is the first node. */
- }
- prevPtr = Blt_TreeView_PrevSibling(entryPtr, mask);
- if (prevPtr == NULL) {
- /* There are no siblings previous to this one, so pick the parent. */
- prevPtr = Blt_TreeView_ParentEntry(entryPtr);
- } else {
- /*
- * Traverse down the right-most thread in order to select the last
- * entry. Stop if we find a "closed" entry or reach a leaf.
- */
- entryPtr = prevPtr;
- while ((entryPtr->flags & mask) == 0) {
- entryPtr = Blt_TreeView_LastChild(entryPtr, mask);
- if (entryPtr == NULL) {
- break; /* Found a leaf. */
- }
- prevPtr = entryPtr;
- }
- }
- if (prevPtr == NULL) {
- return NULL;
- }
- return prevPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_NextEntry --
- *
- * Returns the "next" node in relation to the given node. The next node
- * (in depth-first order) is either the first child of the given node the
- * next sibling if the node has no children (the node is a leaf). If the
- * given node is the last sibling, then try it's parent next sibling.
- * Continue until we either find a next sibling for some ancestor or we
- * reach the root node. In this case the current node is the last node
- * in the tree.
- *
- *---------------------------------------------------------------------------
- */
-TreeViewEntry *
-Blt_TreeView_NextEntry(TreeViewEntry *entryPtr, unsigned int mask)
-{
- TreeView *viewPtr = entryPtr->viewPtr;
- TreeViewEntry *nextPtr;
- int ignoreLeaf;
-
- ignoreLeaf = ((viewPtr->flags & TV_HIDE_LEAVES) &&
- (Blt_Tree_IsLeaf(entryPtr->node)));
-
- if ((!ignoreLeaf) && ((entryPtr->flags & mask) == 0)) {
- nextPtr = Blt_TreeView_FirstChild(entryPtr, mask);
- if (nextPtr != NULL) {
- return nextPtr; /* Pick the first sub-node. */
- }
- }
- /*
- * Back up until to a level where we can pick a "next sibling". For the
- * last entry we'll thread our way back to the root.
- */
- while (entryPtr != viewPtr->rootPtr) {
- nextPtr = Blt_TreeView_NextSibling(entryPtr, mask);
- if (nextPtr != NULL) {
- return nextPtr;
- }
- entryPtr = Blt_TreeView_ParentEntry(entryPtr);
- }
- return NULL; /* At root, no next node. */
-}
-
-void
-Blt_TreeView_ConfigureButtons(TreeView *viewPtr)
-{
- GC newGC;
- TreeViewButton *buttonPtr = &viewPtr->button;
- XGCValues gcValues;
- unsigned long gcMask;
-
- gcMask = GCForeground;
- gcValues.foreground = buttonPtr->fgColor->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (buttonPtr->normalGC != NULL) {
- Tk_FreeGC(viewPtr->display, buttonPtr->normalGC);
- }
- buttonPtr->normalGC = newGC;
-
- gcMask = GCForeground;
- gcValues.foreground = buttonPtr->activeFgColor->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (buttonPtr->activeGC != NULL) {
- Tk_FreeGC(viewPtr->display, buttonPtr->activeGC);
- }
- buttonPtr->activeGC = newGC;
-
- buttonPtr->width = buttonPtr->height = ODD(buttonPtr->reqSize);
- if (buttonPtr->icons != NULL) {
- int i;
-
- for (i = 0; i < 2; i++) {
- int width, height;
-
- if (buttonPtr->icons[i] == NULL) {
- break;
- }
- width = TreeView_IconWidth(buttonPtr->icons[i]);
- height = TreeView_IconWidth(buttonPtr->icons[i]);
- if (buttonPtr->width < width) {
- buttonPtr->width = width;
- }
- if (buttonPtr->height < height) {
- buttonPtr->height = height;
- }
- }
- }
- buttonPtr->width += 2 * buttonPtr->borderWidth;
- buttonPtr->height += 2 * buttonPtr->borderWidth;
-}
-
-int
-Blt_TreeView_ConfigureEntry(TreeView *viewPtr, TreeViewEntry *entryPtr,
- int objc, Tcl_Obj *const *objv, int flags)
-{
- GC newGC;
- Blt_ChainLink link;
- TreeViewColumn *cp;
-
- bltTreeViewIconsOption.clientData = viewPtr;
- bltTreeViewUidOption.clientData = viewPtr;
- labelOption.clientData = viewPtr;
- if (Blt_ConfigureWidgetFromObj(viewPtr->interp, viewPtr->tkwin,
- bltTreeViewEntrySpecs, objc, objv, (char *)entryPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Check if there are values that need to be added
- */
- for(link = Blt_Chain_FirstLink(viewPtr->columns); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- cp = Blt_Chain_GetValue(link);
- Blt_TreeView_AddValue(entryPtr, cp);
- }
-
- newGC = NULL;
- if ((entryPtr->font != NULL) || (entryPtr->color != NULL)) {
- Blt_Font font;
- XColor *colorPtr;
- XGCValues gcValues;
- unsigned long gcMask;
-
- font = entryPtr->font;
- if (font == NULL) {
- font = Blt_TreeView_GetStyleFont(viewPtr,
- viewPtr->treeColumn.stylePtr);
- }
- colorPtr = CHOOSE(viewPtr->fgColor, entryPtr->color);
- gcMask = GCForeground | GCFont;
- gcValues.foreground = colorPtr->pixel;
- gcValues.font = Blt_FontId(font);
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- }
- if (entryPtr->gc != NULL) {
- Tk_FreeGC(viewPtr->display, entryPtr->gc);
- }
- /* Assume all changes require a new layout. */
- entryPtr->gc = newGC;
- entryPtr->flags |= ENTRY_LAYOUT_PENDING;
- if (Blt_ConfigModified(bltTreeViewEntrySpecs, "-font", (char *)NULL)) {
- viewPtr->flags |= UPDATE;
- }
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY);
- return TCL_OK;
-}
-
-void
-Blt_TreeView_DestroyValue(TreeView *viewPtr, TreeViewValue *valuePtr)
-{
- if (valuePtr->stylePtr != NULL) {
- Blt_TreeView_FreeStyle(viewPtr, valuePtr->stylePtr);
- }
- if (valuePtr->textPtr != NULL) {
- Blt_Free(valuePtr->textPtr);
- }
-}
-
-
-static void
-DestroyEntry(DestroyData data)
-{
- TreeViewEntry *entryPtr = (TreeViewEntry *)data;
- TreeView *viewPtr;
-
- viewPtr = entryPtr->viewPtr;
- bltTreeViewIconsOption.clientData = viewPtr;
- bltTreeViewUidOption.clientData = viewPtr;
- labelOption.clientData = viewPtr;
- Blt_FreeOptions(bltTreeViewEntrySpecs, (char *)entryPtr, viewPtr->display,
- 0);
- if (!Blt_Tree_TagTableIsShared(viewPtr->tree)) {
- /* Don't clear tags unless this client is the only one using
- * the tag table.*/
- Blt_Tree_ClearTags(viewPtr->tree, entryPtr->node);
- }
- if (entryPtr->gc != NULL) {
- Tk_FreeGC(viewPtr->display, entryPtr->gc);
- }
- /* Delete the chain of data values from the entry. */
- if (entryPtr->values != NULL) {
- TreeViewValue *valuePtr, *nextPtr;
-
- for (valuePtr = entryPtr->values; valuePtr != NULL;
- valuePtr = nextPtr) {
- nextPtr = valuePtr->nextPtr;
- Blt_TreeView_DestroyValue(viewPtr, valuePtr);
- }
- entryPtr->values = NULL;
- }
- if (entryPtr->fullName != NULL) {
- Blt_Free(entryPtr->fullName);
- }
- if (entryPtr->textPtr != NULL) {
- Blt_Free(entryPtr->textPtr);
- }
- Blt_PoolFreeItem(viewPtr->entryPool, entryPtr);
-}
-
-TreeViewEntry *
-Blt_TreeView_ParentEntry(TreeViewEntry *entryPtr)
-{
- TreeView *viewPtr = entryPtr->viewPtr;
- Blt_TreeNode node;
-
- if (entryPtr->node == Blt_Tree_RootNode(viewPtr->tree)) {
- return NULL;
- }
- node = Blt_Tree_ParentNode(entryPtr->node);
- if (node == NULL) {
- return NULL;
- }
- return Blt_TreeView_NodeToEntry(viewPtr, node);
-}
-
-static void
-FreeEntry(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- Blt_HashEntry *hPtr;
-
- if (entryPtr == viewPtr->activePtr) {
- viewPtr->activePtr = Blt_TreeView_ParentEntry(entryPtr);
- }
- if (entryPtr == viewPtr->activeBtnPtr) {
- viewPtr->activeBtnPtr = NULL;
- }
- if (entryPtr == viewPtr->focusPtr) {
- viewPtr->focusPtr = Blt_TreeView_ParentEntry(entryPtr);
- Blt_SetFocusItem(viewPtr->bindTable, viewPtr->focusPtr, ITEM_ENTRY);
- }
- if (entryPtr == viewPtr->selAnchorPtr) {
- viewPtr->selMarkPtr = viewPtr->selAnchorPtr = NULL;
- }
- Blt_TreeView_DeselectEntry(viewPtr, entryPtr);
- Blt_TreeView_PruneSelection(viewPtr, entryPtr);
- Blt_DeleteBindings(viewPtr->bindTable, entryPtr);
- hPtr = Blt_FindHashEntry(&viewPtr->entryTable, entryPtr->node);
- if (hPtr != NULL) {
- Blt_DeleteHashEntry(&viewPtr->entryTable, hPtr);
- }
- entryPtr->node = NULL;
-
- Tcl_EventuallyFree(entryPtr, DestroyEntry);
- /*
- * Indicate that the screen layout of the hierarchy may have changed
- * because this node was deleted. The screen positions of the nodes in
- * viewPtr->visibleArr are invalidated.
- */
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY);
- Blt_TreeView_EventuallyRedraw(viewPtr);
-}
-
-int
-Blt_TreeView_EntryIsSelected(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->selectTable, (char *)entryPtr);
- return (hPtr != NULL);
-}
-
-void
-Blt_TreeView_SelectEntry(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- int isNew;
- Blt_HashEntry *hPtr;
- TreeViewIcon icon;
- const char *label;
-
- hPtr = Blt_CreateHashEntry(&viewPtr->selectTable, (char *)entryPtr, &isNew);
- if (isNew) {
- Blt_ChainLink link;
-
- link = Blt_Chain_Append(viewPtr->selected, entryPtr);
- Blt_SetHashValue(hPtr, link);
- }
- label = GETLABEL(entryPtr);
- if ((viewPtr->textVarObjPtr != NULL) && (label != NULL)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(label, -1);
- if (Tcl_ObjSetVar2(viewPtr->interp, viewPtr->textVarObjPtr, NULL,
- objPtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- return;
- }
- }
- icon = Blt_TreeView_GetEntryIcon(viewPtr, entryPtr);
- if ((viewPtr->iconVarObjPtr != NULL) && (icon != NULL)) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(TreeView_IconName(icon), -1);
- if (Tcl_ObjSetVar2(viewPtr->interp, viewPtr->iconVarObjPtr, NULL,
- objPtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- return;
- }
- }
-}
-
-void
-Blt_TreeView_DeselectEntry(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->selectTable, (char *)entryPtr);
- if (hPtr != NULL) {
- Blt_ChainLink link;
-
- link = Blt_GetHashValue(hPtr);
- Blt_Chain_DeleteLink(viewPtr->selected, link);
- Blt_DeleteHashEntry(&viewPtr->selectTable, hPtr);
- }
-}
-
-const char *
-Blt_TreeView_GetFullName(TreeView *viewPtr, TreeViewEntry *entryPtr,
- int checkEntryLabel, Tcl_DString *resultPtr)
-{
- const char **names; /* Used the stack the component names. */
- const char *staticSpace[64+2];
- int level;
- int i;
-
- level = Blt_Tree_NodeDepth(entryPtr->node);
- if (viewPtr->rootPtr->labelUid == NULL) {
- level--;
- }
- if (level > 64) {
- names = Blt_AssertMalloc((level + 2) * sizeof(char *));
- } else {
- names = staticSpace;
- }
- for (i = level; i >= 0; i--) {
- Blt_TreeNode node;
-
- /* Save the name of each ancestor in the name array. */
- if (checkEntryLabel) {
- names[i] = GETLABEL(entryPtr);
- } else {
- names[i] = Blt_Tree_NodeLabel(entryPtr->node);
- }
- node = Blt_Tree_ParentNode(entryPtr->node);
- if (node != NULL) {
- entryPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- }
- }
- Tcl_DStringInit(resultPtr);
- if (level >= 0) {
- if ((viewPtr->pathSep == SEPARATOR_LIST) ||
- (viewPtr->pathSep == SEPARATOR_NONE)) {
- for (i = 0; i <= level; i++) {
- Tcl_DStringAppendElement(resultPtr, names[i]);
- }
- } else {
- Tcl_DStringAppend(resultPtr, names[0], -1);
- for (i = 1; i <= level; i++) {
- Tcl_DStringAppend(resultPtr, viewPtr->pathSep, -1);
- Tcl_DStringAppend(resultPtr, names[i], -1);
- }
- }
- } else {
- if ((viewPtr->pathSep != SEPARATOR_LIST) &&
- (viewPtr->pathSep != SEPARATOR_NONE)) {
- Tcl_DStringAppend(resultPtr, viewPtr->pathSep, -1);
- }
- }
- if (names != staticSpace) {
- Blt_Free(names);
- }
- return Tcl_DStringValue(resultPtr);
-}
-
-
-int
-Blt_TreeView_CloseEntry(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- const char *cmd;
-
- if (entryPtr->flags & ENTRY_CLOSED) {
- return TCL_OK; /* Entry is already closed. */
- }
- entryPtr->flags |= ENTRY_CLOSED;
- viewPtr->flags |= LAYOUT_PENDING;
-
- /*
- * Invoke the entry's "close" command, if there is one. Otherwise try the
- * treeview's global "close" command.
- */
- cmd = CHOOSE(viewPtr->closeCmd, entryPtr->closeCmd);
- if (cmd != NULL) {
- Tcl_DString dString;
- int result;
-
- Blt_TreeView_PercentSubst(viewPtr, entryPtr, cmd, &dString);
- Tcl_Preserve(entryPtr);
- result = Tcl_GlobalEval(viewPtr->interp, Tcl_DStringValue(&dString));
- Tcl_Release(entryPtr);
- Tcl_DStringFree(&dString);
- if (result != TCL_OK) {
- viewPtr->flags |= DIRTY;
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-
-int
-Blt_TreeView_OpenEntry(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- const char *cmd;
-
- if ((entryPtr->flags & ENTRY_CLOSED) == 0) {
- return TCL_OK; /* Entry is already open. */
- }
- entryPtr->flags &= ~ENTRY_CLOSED;
- viewPtr->flags |= LAYOUT_PENDING;
-
- /*
- * If there's a "open" command proc specified for the entry, use that
- * instead of the more general "open" proc for the entire treeview.
- * Be careful because the "open" command may perform an update.
- */
- cmd = CHOOSE(viewPtr->openCmd, entryPtr->openCmd);
- if (cmd != NULL) {
- Tcl_DString dString;
- int result;
-
- Blt_TreeView_PercentSubst(viewPtr, entryPtr, cmd, &dString);
- Tcl_Preserve(entryPtr);
- result = Tcl_GlobalEval(viewPtr->interp, Tcl_DStringValue(&dString));
- Tcl_Release(entryPtr);
- Tcl_DStringFree(&dString);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_CreateEntry --
- *
- * This procedure is called by the Tree object when a node is created and
- * inserted into the tree. It adds a new treeview entry field to the node.
- *
- * Results:
- * Returns the entry.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_TreeView_CreateEntry(
- TreeView *viewPtr,
- Blt_TreeNode node, /* Node that has just been created. */
- int objc,
- Tcl_Obj *const *objv,
- int flags)
-{
- TreeViewEntry *entryPtr;
- int isNew;
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_CreateHashEntry(&viewPtr->entryTable, (char *)node, &isNew);
- if (isNew) {
- /* Create the entry structure */
- entryPtr = Blt_PoolAllocItem(viewPtr->entryPool, sizeof(TreeViewEntry));
- memset(entryPtr, 0, sizeof(TreeViewEntry));
- entryPtr->flags = (unsigned short)(viewPtr->buttonFlags | ENTRY_CLOSED);
- entryPtr->viewPtr = viewPtr;
- entryPtr->labelUid = NULL;
- entryPtr->node = node;
- Blt_SetHashValue(hPtr, entryPtr);
-
- } else {
- entryPtr = Blt_GetHashValue(hPtr);
- }
- if (Blt_TreeView_ConfigureEntry(viewPtr, entryPtr, objc, objv, flags)
- != TCL_OK) {
- FreeEntry(viewPtr, entryPtr);
- return TCL_ERROR; /* Error configuring the entry. */
- }
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-
-/*ARGSUSED*/
-static int
-CreateApplyProc(Blt_TreeNode node, ClientData clientData, int order)
-{
- TreeView *viewPtr = clientData;
- return Blt_TreeView_CreateEntry(viewPtr, node, 0, NULL, 0);
-}
-
-/*ARGSUSED*/
-static int
-DeleteApplyProc(Blt_TreeNode node, ClientData clientData, int order)
-{
- TreeView *viewPtr = clientData;
- /*
- * Unsetting the tree value triggers a call back to destroy the entry and
- * also releases the Tcl_Obj that contains it.
- */
- return Blt_Tree_UnsetValueByKey(viewPtr->interp, viewPtr->tree, node,
- viewPtr->treeColumn.key);
-}
-
-static int
-TreeEventProc(ClientData clientData, Blt_TreeNotifyEvent *eventPtr)
-{
- Blt_TreeNode node;
- TreeView *viewPtr = clientData;
-
- node = Blt_Tree_GetNode(eventPtr->tree, eventPtr->inode);
- switch (eventPtr->type) {
- case TREE_NOTIFY_CREATE:
- return Blt_TreeView_CreateEntry(viewPtr, node, 0, NULL, 0);
- case TREE_NOTIFY_DELETE:
- /*
- * Deleting the tree node triggers a call back to free the treeview
- * entry that is associated with it.
- */
- if (node != NULL) {
- TreeViewEntry *entryPtr;
-
- entryPtr = Blt_TreeView_FindEntry(viewPtr, node);
- if (entryPtr != NULL) {
- FreeEntry(viewPtr, entryPtr);
- }
- }
- break;
- case TREE_NOTIFY_RELABEL:
- if (node != NULL) {
- TreeViewEntry *entryPtr;
-
- entryPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- entryPtr->flags |= ENTRY_DIRTY;
- }
- /*FALLTHRU*/
- case TREE_NOTIFY_MOVE:
- case TREE_NOTIFY_SORT:
- viewPtr->flags |= (LAYOUT_PENDING | RESORT | DIRTY);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- break;
- default:
- /* empty */
- break;
- }
- return TCL_OK;
-}
-
-TreeViewValue *
-Blt_TreeView_FindValue(TreeViewEntry *entryPtr, TreeViewColumn *cp)
-{
- TreeViewValue *vp;
-
- for (vp = entryPtr->values; vp != NULL; vp = vp->nextPtr) {
- if (vp->columnPtr == cp) {
- return vp;
- }
- }
- return NULL;
-}
-
-void
-Blt_TreeView_AddValue(TreeViewEntry *entryPtr, TreeViewColumn *cp)
-{
- if (Blt_TreeView_FindValue(entryPtr, cp) == NULL) {
- Tcl_Obj *objPtr;
-
- if (Blt_TreeView_GetData(entryPtr, cp->key, &objPtr) == TCL_OK) {
- TreeViewValue *valuePtr;
-
- /* Add a new value only if a data entry exists. */
- valuePtr = Blt_PoolAllocItem(entryPtr->viewPtr->valuePool,
- sizeof(TreeViewValue));
- valuePtr->columnPtr = cp;
- valuePtr->nextPtr = entryPtr->values;
- valuePtr->textPtr = NULL;
- valuePtr->width = valuePtr->height = 0;
- valuePtr->stylePtr = NULL;
- valuePtr->fmtString = NULL;
- entryPtr->values = valuePtr;
- }
- }
- entryPtr->viewPtr->flags |= (LAYOUT_PENDING | DIRTY);
- entryPtr->flags |= ENTRY_DIRTY;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeTraceProc --
- *
- * Mirrors the individual values of the tree object (they must also be
- * listed in the widget's columns chain). This is because it must track and
- * save the sizes of each individual data entry, rather than re-computing
- * all the sizes each time the widget is redrawn.
- *
- * This procedure is called by the Tree object when a node data value is
- * set unset.
- *
- * Results:
- * Returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TreeTraceProc(
- ClientData clientData,
- Tcl_Interp *interp,
- Blt_TreeNode node, /* Node that has just been updated. */
- Blt_TreeKey key, /* Key of value that's been updated. */
- unsigned int flags)
-{
- Blt_HashEntry *hPtr;
- TreeView *viewPtr = clientData;
- TreeViewColumn *cp;
- TreeViewEntry *entryPtr;
- TreeViewValue *valuePtr, *nextPtr, *lastPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->entryTable, (char *)node);
- if (hPtr == NULL) {
- return TCL_OK; /* Not a node that we're interested
- * in. */
- }
- entryPtr = Blt_GetHashValue(hPtr);
- flags &= TREE_TRACE_WRITE | TREE_TRACE_READ | TREE_TRACE_UNSET;
- switch (flags) {
- case TREE_TRACE_WRITE:
- hPtr = Blt_FindHashEntry(&viewPtr->columnTable, key);
- if (hPtr == NULL) {
- return TCL_OK; /* Data value isn't used by widget. */
- }
- cp = Blt_GetHashValue(hPtr);
- if (cp != &viewPtr->treeColumn) {
- Blt_TreeView_AddValue(entryPtr, cp);
- }
- entryPtr->flags |= ENTRY_DIRTY;
- Blt_TreeView_EventuallyRedraw(viewPtr);
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY);
- break;
-
- case TREE_TRACE_UNSET:
- lastPtr = NULL;
- for(valuePtr = entryPtr->values; valuePtr != NULL; valuePtr = nextPtr) {
- nextPtr = valuePtr->nextPtr;
- if (valuePtr->columnPtr->key == key) {
- Blt_TreeView_DestroyValue(viewPtr, valuePtr);
- if (lastPtr == NULL) {
- entryPtr->values = nextPtr;
- } else {
- lastPtr->nextPtr = nextPtr;
- }
- entryPtr->flags |= ENTRY_DIRTY;
- Blt_TreeView_EventuallyRedraw(viewPtr);
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY);
- break;
- }
- lastPtr = valuePtr;
- }
- break;
-
- default:
- break;
- }
- return TCL_OK;
-}
-
-static void
-FormatValue(TreeViewEntry *entryPtr, TreeViewValue *valuePtr)
-{
- TreeViewColumn *colPtr;
- Tcl_Obj *resultObjPtr;
- Tcl_Obj *valueObjPtr;
-
- colPtr = valuePtr->columnPtr;
- if (Blt_TreeView_GetData(entryPtr, colPtr->key, &valueObjPtr) != TCL_OK) {
- return; /* No data ??? */
- }
- if (valuePtr->fmtString != NULL) {
- Blt_Free(valuePtr->fmtString);
- }
- valuePtr->fmtString = NULL;
- if (valueObjPtr == NULL) {
- return;
- }
- if (colPtr->fmtCmdPtr != NULL) {
- Tcl_Interp *interp = entryPtr->viewPtr->interp;
- Tcl_Obj *cmdObjPtr, *objPtr;
- int result;
-
- cmdObjPtr = Tcl_DuplicateObj(colPtr->fmtCmdPtr);
- objPtr = Tcl_NewLongObj(Blt_Tree_NodeId(entryPtr->node));
- Tcl_ListObjAppendElement(interp, cmdObjPtr, objPtr);
- Tcl_ListObjAppendElement(interp, cmdObjPtr, valueObjPtr);
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- if (result != TCL_OK) {
- Tcl_BackgroundError(interp);
- return;
- }
- resultObjPtr = Tcl_GetObjResult(interp);
- } else {
- resultObjPtr = valueObjPtr;
- }
- valuePtr->fmtString = Blt_Strdup(Tcl_GetString(resultObjPtr));
-}
-
-
-static void
-GetValueSize(TreeViewEntry *entryPtr, TreeViewValue *valuePtr,
- TreeViewStyle *stylePtr)
-{
- valuePtr->width = valuePtr->height = 0;
- FormatValue(entryPtr, valuePtr);
- stylePtr = CHOOSE(valuePtr->columnPtr->stylePtr, valuePtr->stylePtr);
- /* Measure the text string. */
- (*stylePtr->classPtr->measProc)(entryPtr->viewPtr, stylePtr, valuePtr);
-}
-
-static void
-GetRowExtents(TreeViewEntry *entryPtr, int *widthPtr, int *heightPtr)
-{
- TreeViewValue *valuePtr;
- int width, height; /* Compute dimensions of row. */
-
- width = height = 0;
- for (valuePtr = entryPtr->values; valuePtr != NULL;
- valuePtr = valuePtr->nextPtr) {
- TreeViewStyle *stylePtr;
- int valueWidth; /* Width of individual value. */
-
- stylePtr = valuePtr->stylePtr;
- if (stylePtr == NULL) {
- stylePtr = valuePtr->columnPtr->stylePtr;
- }
- if ((entryPtr->flags & ENTRY_DIRTY) || (stylePtr->flags & STYLE_DIRTY)){
- GetValueSize(entryPtr, valuePtr, stylePtr);
- }
- if (valuePtr->height > height) {
- height = valuePtr->height;
- }
- valueWidth = valuePtr->width;
- width += valueWidth;
- }
- *widthPtr = width;
- *heightPtr = height;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_NearestEntry --
- *
- * Finds the entry closest to the given screen X-Y coordinates in the
- * viewport.
- *
- * Results:
- * Returns the pointer to the closest node. If no node is visible (nodes
- * may be hidden), NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-TreeViewEntry *
-Blt_TreeView_NearestEntry(TreeView *viewPtr, int x, int y, int selectOne)
-{
- TreeViewEntry *lastPtr;
- TreeViewEntry **p;
-
- /*
- * We implicitly can pick only visible entries. So make sure that the
- * tree exists.
- */
- if (viewPtr->nVisible == 0) {
- return NULL;
- }
- if (y < viewPtr->titleHeight) {
- return (selectOne) ? viewPtr->visibleArr[0] : NULL;
- }
- /*
- * Since the entry positions were previously computed in world
- * coordinates, convert Y-coordinate from screen to world coordinates too.
- */
- y = WORLDY(viewPtr, y);
- lastPtr = viewPtr->visibleArr[0];
- for (p = viewPtr->visibleArr; *p != NULL; p++) {
- TreeViewEntry *entryPtr;
-
- entryPtr = *p;
- /*
- * If the start of the next entry starts beyond the point, use the last
- * entry.
- */
- if (entryPtr->worldY > y) {
- return (selectOne) ? entryPtr : NULL;
- }
- if (y < (entryPtr->worldY + entryPtr->height)) {
- return entryPtr; /* Found it. */
- }
- lastPtr = entryPtr;
- }
- return (selectOne) ? lastPtr : NULL;
-}
-
-
-ClientData
-Blt_TreeView_EntryTag(TreeView *viewPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
- int isNew; /* Not used. */
-
- hPtr = Blt_CreateHashEntry(&viewPtr->entryTagTable, string, &isNew);
- return Blt_GetHashKey(&viewPtr->entryTagTable, hPtr);
-}
-
-ClientData
-Blt_TreeView_ButtonTag(TreeView *viewPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
- int isNew; /* Not used. */
-
- hPtr = Blt_CreateHashEntry(&viewPtr->buttonTagTable, string, &isNew);
- return Blt_GetHashKey(&viewPtr->buttonTagTable, hPtr);
-}
-
-ClientData
-Blt_TreeView_ColumnTag(TreeView *viewPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
- int isNew; /* Not used. */
-
- hPtr = Blt_CreateHashEntry(&viewPtr->columnTagTable, string, &isNew);
- return Blt_GetHashKey(&viewPtr->columnTagTable, hPtr);
-}
-
-#ifdef notdef
-ClientData
-TreeViewStyleTag(TreeView *viewPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
- int isNew; /* Not used. */
-
- hPtr = Blt_CreateHashEntry(&viewPtr->styleTagTable, string, &isNew);
- return Blt_GetHashKey(&viewPtr->styleTagTable, hPtr);
-}
-#endif
-
-static void
-AddIdsToList(TreeView *viewPtr, Blt_List ids, const char *string,
- TagProc *tagProc)
-{
- int argc;
- const char **argv;
-
- if (Tcl_SplitList((Tcl_Interp *)NULL, string, &argc, &argv) == TCL_OK) {
- const char **p;
-
- for (p = argv; *p != NULL; p++) {
- Blt_List_Append(ids, (*tagProc)(viewPtr, *p), 0);
- }
- Blt_Free(argv);
- }
-}
-
-static void
-GetTags(
- Blt_BindTable table,
- ClientData object, /* Object picked. */
- ClientData context, /* Context of object. */
- Blt_List ids) /* (out) List of binding ids to be
- * applied for this object. */
-{
- TreeView *viewPtr;
-
- viewPtr = Blt_GetBindingData(table);
- if (context == (ClientData)ITEM_ENTRY_BUTTON) {
- TreeViewEntry *entryPtr = object;
-
- Blt_List_Append(ids, Blt_TreeView_ButtonTag(viewPtr, "Button"), 0);
- if (entryPtr->tagsUid != NULL) {
- AddIdsToList(viewPtr, ids, entryPtr->tagsUid, Blt_TreeView_ButtonTag);
- } else {
- Blt_List_Append(ids, Blt_TreeView_ButtonTag(viewPtr, "Entry"), 0);
- Blt_List_Append(ids, Blt_TreeView_ButtonTag(viewPtr, "all"), 0);
- }
- } else if (context == (ClientData)ITEM_COLUMN_TITLE) {
- TreeViewColumn *cp = object;
-
- Blt_List_Append(ids, (char *)cp, 0);
- if (cp->tagsUid != NULL) {
- AddIdsToList(viewPtr, ids, cp->tagsUid,
- Blt_TreeView_ColumnTag);
- }
- } else if (context == ITEM_COLUMN_RULE) {
- Blt_List_Append(ids, Blt_TreeView_ColumnTag(viewPtr, "Rule"), 0);
- } else {
- TreeViewEntry *entryPtr = object;
-
- Blt_List_Append(ids, (char *)entryPtr, 0);
- if (entryPtr->tagsUid != NULL) {
- AddIdsToList(viewPtr, ids, entryPtr->tagsUid, Blt_TreeView_EntryTag);
- } else if (context == ITEM_ENTRY){
- Blt_List_Append(ids, Blt_TreeView_EntryTag(viewPtr, "Entry"), 0);
- Blt_List_Append(ids, Blt_TreeView_EntryTag(viewPtr, "all"), 0);
- } else {
- TreeViewValue *valuePtr = context;
-
- if (valuePtr != NULL) {
- TreeViewStyle *stylePtr = valuePtr->stylePtr;
-
- if (stylePtr == NULL) {
- stylePtr = valuePtr->columnPtr->stylePtr;
- }
- Blt_List_Append(ids,
- Blt_TreeView_EntryTag(viewPtr, stylePtr->name), 0);
- Blt_List_Append(ids,
- Blt_TreeView_EntryTag(viewPtr, valuePtr->columnPtr->key), 0);
- Blt_List_Append(ids,
- Blt_TreeView_EntryTag(viewPtr, stylePtr->classPtr->className),
- 0);
-#ifndef notdef
- Blt_List_Append(ids, Blt_TreeView_EntryTag(viewPtr, "Entry"), 0);
- Blt_List_Append(ids, Blt_TreeView_EntryTag(viewPtr, "all"), 0);
-#endif
- }
- }
- }
-}
-
-/*ARGSUSED*/
-static ClientData
-PickItem(
- ClientData clientData,
- int x, int y, /* Screen coordinates of the test
- * point. */
- ClientData *contextPtr) /* (out) Context of item selected:
- * should be ITEM_ENTRY,
- * ITEM_ENTRY_BUTTON, ITEM_COLUMN_TITLE,
- * ITEM_COLUMN_RULE, or ITEM_STYLE. */
-{
- TreeView *viewPtr = clientData;
- TreeViewEntry *entryPtr;
- TreeViewColumn *cp;
-
- if (contextPtr != NULL) {
- *contextPtr = NULL;
- }
- if (viewPtr->flags & DIRTY) {
- /* Can't trust the selected entry if nodes have been added or
- * deleted. So recompute the layout. */
- if (viewPtr->flags & LAYOUT_PENDING) {
- Blt_TreeView_ComputeLayout(viewPtr);
- }
- ComputeVisibleEntries(viewPtr);
- }
- cp = Blt_TreeView_NearestColumn(viewPtr, x, y, contextPtr);
- if ((*contextPtr != NULL) && (viewPtr->flags & TV_SHOW_COLUMN_TITLES)) {
- return cp;
- }
- if (viewPtr->nVisible == 0) {
- return NULL;
- }
- entryPtr = Blt_TreeView_NearestEntry(viewPtr, x, y, FALSE);
- if (entryPtr == NULL) {
- return NULL;
- }
- x = WORLDX(viewPtr, x);
- y = WORLDY(viewPtr, y);
- if (contextPtr != NULL) {
- *contextPtr = ITEM_ENTRY;
- if (cp != NULL) {
- TreeViewValue *valuePtr;
-
- valuePtr = Blt_TreeView_FindValue(entryPtr, cp);
- if (valuePtr != NULL) {
- TreeViewStyle *stylePtr;
-
- stylePtr = valuePtr->stylePtr;
- if (stylePtr == NULL) {
- stylePtr = valuePtr->columnPtr->stylePtr;
- }
- if ((stylePtr->classPtr->pickProc == NULL) ||
- ((*stylePtr->classPtr->pickProc)(entryPtr, valuePtr,
- stylePtr, x, y))) {
- *contextPtr = valuePtr;
- }
- }
- }
- if (entryPtr->flags & ENTRY_HAS_BUTTON) {
- TreeViewButton *buttonPtr = &viewPtr->button;
- int left, right, top, bottom;
-
- left = entryPtr->worldX + entryPtr->buttonX - BUTTON_PAD;
- right = left + buttonPtr->width + 2 * BUTTON_PAD;
- top = entryPtr->worldY + entryPtr->buttonY - BUTTON_PAD;
- bottom = top + buttonPtr->height + 2 * BUTTON_PAD;
- if ((x >= left) && (x < right) && (y >= top) && (y < bottom)) {
- *contextPtr = (ClientData)ITEM_ENTRY_BUTTON;
- }
- }
- }
- return entryPtr;
-}
-
-static void
-GetEntryExtents(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- int entryWidth, entryHeight;
- int width, height;
-
- /*
- * FIXME: Use of DIRTY flag inconsistent. When does it
- * mean "dirty entry"? When does it mean "dirty column"?
- * Does it matter? probably
- */
- if ((entryPtr->flags & ENTRY_DIRTY) || (viewPtr->flags & UPDATE)) {
- Blt_Font font;
- Blt_FontMetrics fontMetrics;
- TreeViewIcon *icons;
- const char *label;
-
- entryPtr->iconWidth = entryPtr->iconHeight = 0;
- icons = CHOOSE(viewPtr->icons, entryPtr->icons);
- if (icons != NULL) {
- int i;
-
- for (i = 0; i < 2; i++) {
- if (icons[i] == NULL) {
- break;
- }
- if (entryPtr->iconWidth < TreeView_IconWidth(icons[i])) {
- entryPtr->iconWidth = TreeView_IconWidth(icons[i]);
- }
- if (entryPtr->iconHeight < TreeView_IconHeight(icons[i])) {
- entryPtr->iconHeight = TreeView_IconHeight(icons[i]);
- }
- }
- entryPtr->iconWidth += 2 * ICON_PADX;
- entryPtr->iconHeight += 2 * ICON_PADY;
- } else if ((icons == NULL) || (icons[0] == NULL)) {
- entryPtr->iconWidth = DEF_ICON_WIDTH;
- entryPtr->iconHeight = DEF_ICON_HEIGHT;
- }
- entryHeight = MAX(entryPtr->iconHeight, viewPtr->button.height);
- font = entryPtr->font;
- if (font == NULL) {
- font = Blt_TreeView_GetStyleFont(viewPtr,
- viewPtr->treeColumn.stylePtr);
- }
- if (entryPtr->fullName != NULL) {
- Blt_Free(entryPtr->fullName);
- entryPtr->fullName = NULL;
- }
- if (entryPtr->textPtr != NULL) {
- Blt_Free(entryPtr->textPtr);
- entryPtr->textPtr = NULL;
- }
-
- Blt_GetFontMetrics(font, &fontMetrics);
- entryPtr->lineHeight = fontMetrics.linespace;
- entryPtr->lineHeight += 2 * (FOCUS_WIDTH + LABEL_PADY +
- viewPtr->selBW) + viewPtr->leader;
-
- label = GETLABEL(entryPtr);
- if (label[0] == '\0') {
- width = height = entryPtr->lineHeight;
- } else {
- TextStyle ts;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, font);
- if (viewPtr->flatView) {
- Tcl_DString dString;
-
- Blt_TreeView_GetFullName(viewPtr, entryPtr, TRUE, &dString);
- entryPtr->fullName =
- Blt_AssertStrdup(Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- entryPtr->textPtr = Blt_Ts_CreateLayout(entryPtr->fullName, -1,
- &ts);
- } else {
- entryPtr->textPtr = Blt_Ts_CreateLayout(label, -1, &ts);
- }
- width = entryPtr->textPtr->width;
- height = entryPtr->textPtr->height;
- }
- width += 2 * (FOCUS_WIDTH + LABEL_PADX + viewPtr->selBW);
- height += 2 * (FOCUS_WIDTH + LABEL_PADY + viewPtr->selBW);
- width = ODD(width);
- if (entryPtr->reqHeight > height) {
- height = entryPtr->reqHeight;
- }
- height = ODD(height);
- entryWidth = width;
- if (entryHeight < height) {
- entryHeight = height;
- }
- entryPtr->labelWidth = width;
- entryPtr->labelHeight = height;
- } else {
- entryHeight = entryPtr->labelHeight;
- entryWidth = entryPtr->labelWidth;
- }
- entryHeight = MAX3(entryPtr->iconHeight, entryPtr->lineHeight,
- entryPtr->labelHeight);
-
- /*
- * Find the maximum height of the data value entries. This also has the
- * side effect of contributing the maximum width of the column.
- */
- GetRowExtents(entryPtr, &width, &height);
- if (entryHeight < height) {
- entryHeight = height;
- }
- entryPtr->width = entryWidth + COLUMN_PAD;
- entryPtr->height = entryHeight + viewPtr->leader;
-
- /*
- * Force the height of the entry to an even number. This is to make the
- * dots or the vertical line segments coincide with the start of the
- * horizontal lines.
- */
- if (entryPtr->height & 0x01) {
- entryPtr->height++;
- }
- entryPtr->flags &= ~ENTRY_DIRTY;
-}
-
-/*
- * TreeView Procedures
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateTreeView --
- *
- *---------------------------------------------------------------------------
- */
-static TreeView *
-CreateTreeView(Tcl_Interp *interp, Tcl_Obj *objPtr)
-{
- Tk_Window tkwin;
- TreeView *viewPtr;
- char *name;
- Tcl_DString dString;
- int result;
-
- name = Tcl_GetString(objPtr);
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), name,
- (char *)NULL);
- if (tkwin == NULL) {
- return NULL;
-
- }
- Tk_SetClass(tkwin, "TreeView");
-
- viewPtr = Blt_AssertCalloc(1, sizeof(TreeView));
- viewPtr->tkwin = tkwin;
- viewPtr->display = Tk_Display(tkwin);
- viewPtr->interp = interp;
- viewPtr->flags = (HIDE_ROOT | TV_SHOW_COLUMN_TITLES | DIRTY |
- LAYOUT_PENDING | REPOPULATE);
- viewPtr->leader = 0;
- viewPtr->dashes = 1;
- viewPtr->highlightWidth = 2;
- viewPtr->selBW = 1;
- viewPtr->borderWidth = 2;
- viewPtr->relief = TK_RELIEF_SUNKEN;
- viewPtr->selRelief = TK_RELIEF_FLAT;
- viewPtr->scrollMode = BLT_SCROLL_MODE_HIERBOX;
- viewPtr->selectMode = SELECT_MODE_SINGLE;
- viewPtr->button.closeRelief = viewPtr->button.openRelief = TK_RELIEF_SOLID;
- viewPtr->reqWidth = 0;
- viewPtr->reqHeight = 0;
- viewPtr->xScrollUnits = viewPtr->yScrollUnits = 20;
- viewPtr->lineWidth = 1;
- viewPtr->button.borderWidth = 1;
- viewPtr->columns = Blt_Chain_Create();
- viewPtr->buttonFlags = BUTTON_AUTO;
- viewPtr->selected = Blt_Chain_Create();
- viewPtr->userStyles = Blt_Chain_Create();
- viewPtr->sortColumnPtr = &viewPtr->treeColumn;
- Blt_InitHashTableWithPool(&viewPtr->entryTable, BLT_ONE_WORD_KEYS);
- Blt_InitHashTable(&viewPtr->columnTable, BLT_ONE_WORD_KEYS);
- Blt_InitHashTable(&viewPtr->iconTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&viewPtr->selectTable, BLT_ONE_WORD_KEYS);
- Blt_InitHashTable(&viewPtr->uidTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&viewPtr->styleTable, BLT_STRING_KEYS);
- viewPtr->bindTable = Blt_CreateBindingTable(interp, tkwin, viewPtr, PickItem,
- GetTags);
- Blt_InitHashTable(&viewPtr->entryTagTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&viewPtr->columnTagTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&viewPtr->buttonTagTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&viewPtr->styleTagTable, BLT_STRING_KEYS);
-
- viewPtr->entryPool = Blt_PoolCreate(BLT_FIXED_SIZE_ITEMS);
- viewPtr->valuePool = Blt_PoolCreate(BLT_FIXED_SIZE_ITEMS);
- Blt_SetWindowInstanceData(tkwin, viewPtr);
- viewPtr->cmdToken = Tcl_CreateObjCommand(interp, Tk_PathName(viewPtr->tkwin),
- Blt_TreeView_WidgetInstCmd, viewPtr, WidgetInstCmdDeleteProc);
-
- Tk_CreateSelHandler(viewPtr->tkwin, XA_PRIMARY, XA_STRING, SelectionProc,
- viewPtr, XA_STRING);
- Tk_CreateEventHandler(viewPtr->tkwin, ExposureMask | StructureNotifyMask |
- FocusChangeMask, TreeViewEventProc, viewPtr);
- /*
- * Create a default style. This must exist before we can create the
- * treeview column.
- */
- viewPtr->stylePtr = Blt_TreeView_CreateStyle(interp, viewPtr, STYLE_TEXTBOX,
- "text");
- if (viewPtr->stylePtr == NULL) {
- return NULL;
- }
- /*
- * By default create a tree. The name will be the same as the widget
- * pathname.
- */
- viewPtr->tree = Blt_Tree_Open(interp, Tk_PathName(viewPtr->tkwin), TREE_CREATE);
- if (viewPtr->tree == NULL) {
- return NULL;
- }
- /* Create a default column to display the view of the tree. */
- Tcl_DStringInit(&dString);
- Tcl_DStringAppend(&dString, "BLT TreeView ", -1);
- Tcl_DStringAppend(&dString, Tk_PathName(viewPtr->tkwin), -1);
- result = Blt_TreeView_CreateColumn(viewPtr, &viewPtr->treeColumn,
- Tcl_DStringValue(&dString), "");
- Tcl_DStringFree(&dString);
- if (result != TCL_OK) {
- return NULL;
- }
- Blt_Chain_Append(viewPtr->columns, &viewPtr->treeColumn);
- return viewPtr;
-}
-
-static void
-TeardownEntries(TreeView *viewPtr)
-{
- Blt_HashSearch iter;
- Blt_HashEntry *hPtr;
-
- /* Release the current tree, removing any entry fields. */
- for (hPtr = Blt_FirstHashEntry(&viewPtr->entryTable, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- TreeViewEntry *entryPtr;
-
- entryPtr = Blt_GetHashValue(hPtr);
- DestroyEntry((ClientData)entryPtr);
- }
- Blt_DeleteHashTable(&viewPtr->entryTable);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyTreeView --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
- * clean up the internal structure of a TreeView at a safe time (when
- * no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyTreeView(DestroyData dataPtr) /* Pointer to the widget record. */
-{
- Blt_ChainLink link;
- TreeView *viewPtr = (TreeView *)dataPtr;
- TreeViewButton *buttonPtr;
- TreeViewStyle *stylePtr;
-
- TeardownEntries(viewPtr);
- if (viewPtr->tree != NULL) {
- Blt_Tree_Close(viewPtr->tree);
- viewPtr->tree = NULL;
- }
- bltTreeViewTreeOption.clientData = viewPtr;
- bltTreeViewIconsOption.clientData = viewPtr;
- Blt_FreeOptions(bltTreeViewSpecs, (char *)viewPtr, viewPtr->display, 0);
- if (viewPtr->tkwin != NULL) {
- Tk_DeleteSelHandler(viewPtr->tkwin, XA_PRIMARY, XA_STRING);
- }
- if (viewPtr->lineGC != NULL) {
- Tk_FreeGC(viewPtr->display, viewPtr->lineGC);
- }
- if (viewPtr->focusGC != NULL) {
- Blt_FreePrivateGC(viewPtr->display, viewPtr->focusGC);
- }
- if (viewPtr->selGC != NULL) {
- Blt_FreePrivateGC(viewPtr->display, viewPtr->selGC);
- }
- if (viewPtr->visibleArr != NULL) {
- Blt_Free(viewPtr->visibleArr);
- }
- if (viewPtr->flatArr != NULL) {
- Blt_Free(viewPtr->flatArr);
- }
- if (viewPtr->levelInfo != NULL) {
- Blt_Free(viewPtr->levelInfo);
- }
- buttonPtr = &viewPtr->button;
- if (buttonPtr->activeGC != NULL) {
- Tk_FreeGC(viewPtr->display, buttonPtr->activeGC);
- }
- if (buttonPtr->normalGC != NULL) {
- Tk_FreeGC(viewPtr->display, buttonPtr->normalGC);
- }
- if (viewPtr->stylePtr != NULL) {
- Blt_TreeView_FreeStyle(viewPtr, viewPtr->stylePtr);
- }
- Blt_TreeView_DestroyColumns(viewPtr);
- Blt_DestroyBindingTable(viewPtr->bindTable);
- Blt_Chain_Destroy(viewPtr->selected);
- Blt_DeleteHashTable(&viewPtr->entryTagTable);
- Blt_DeleteHashTable(&viewPtr->columnTagTable);
- Blt_DeleteHashTable(&viewPtr->buttonTagTable);
- Blt_DeleteHashTable(&viewPtr->styleTagTable);
-
- /* Remove any user-specified style that might remain. */
- for (link = Blt_Chain_FirstLink(viewPtr->userStyles); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- stylePtr = Blt_Chain_GetValue(link);
- stylePtr->link = NULL;
- Blt_TreeView_FreeStyle(viewPtr, stylePtr);
- }
- Blt_Chain_Destroy(viewPtr->userStyles);
- if (viewPtr->comboWin != NULL) {
- Tk_DestroyWindow(viewPtr->comboWin);
- }
- Blt_DeleteHashTable(&viewPtr->styleTable);
- Blt_DeleteHashTable(&viewPtr->selectTable);
- Blt_DeleteHashTable(&viewPtr->uidTable);
- Blt_PoolDestroy(viewPtr->entryPool);
- Blt_PoolDestroy(viewPtr->valuePool);
- DumpIconTable(viewPtr);
- Blt_Free(viewPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeViewEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various events on
- * treeview widgets.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TreeViewEventProc(ClientData clientData, XEvent *eventPtr)
-{
- TreeView *viewPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- Blt_TreeView_EventuallyRedraw(viewPtr);
- Blt_PickCurrentItem(viewPtr->bindTable);
- }
- } else if (eventPtr->type == ConfigureNotify) {
- viewPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- } else if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- if (eventPtr->type == FocusIn) {
- viewPtr->flags |= FOCUS;
- } else {
- viewPtr->flags &= ~FOCUS;
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- }
- } else if (eventPtr->type == DestroyNotify) {
- if (viewPtr->tkwin != NULL) {
- viewPtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(viewPtr->interp, viewPtr->cmdToken);
- }
- if (viewPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayTreeView, viewPtr);
- }
- if (viewPtr->flags & TV_SELECT_PENDING) {
- Tcl_CancelIdleCall(Blt_TreeView_SelectCmdProc, viewPtr);
- }
- Tcl_EventuallyFree(viewPtr, DestroyTreeView);
- }
-}
-
-/* Selection Procedures */
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionProc --
- *
- * This procedure is called back by Tk when the selection is requested by
- * someone. It returns part or all of the selection in a buffer provided
- * by the caller.
- *
- * Results:
- * The return value is the number of non-NULL bytes stored at buffer.
- * Buffer is filled (or partially filled) with a NUL-terminated string
- * containing part or all of the selection, as given by offset and
- * maxBytes.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectionProc(
- ClientData clientData, /* Information about the widget. */
- int offset, /* Offset within selection of first
- * character to be returned. */
- char *buffer, /* Location in which to place
- * selection. */
- int maxBytes) /* Maximum number of bytes to place at
- * buffer, not including terminating
- * NULL character. */
-{
- Tcl_DString dString;
- TreeView *viewPtr = clientData;
- TreeViewEntry *entryPtr;
- int size;
-
- if ((viewPtr->flags & TV_SELECT_EXPORT) == 0) {
- return -1;
- }
- /*
- * Retrieve the names of the selected entries.
- */
- Tcl_DStringInit(&dString);
- if (viewPtr->flags & TV_SELECT_SORTED) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(viewPtr->selected);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- entryPtr = Blt_Chain_GetValue(link);
- Tcl_DStringAppend(&dString, GETLABEL(entryPtr), -1);
- Tcl_DStringAppend(&dString, "\n", -1);
- }
- } else {
- for (entryPtr = viewPtr->rootPtr; entryPtr != NULL;
- entryPtr = Blt_TreeView_NextEntry(entryPtr, ENTRY_MASK)) {
- if (Blt_TreeView_EntryIsSelected(viewPtr, entryPtr)) {
- Tcl_DStringAppend(&dString, GETLABEL(entryPtr), -1);
- Tcl_DStringAppend(&dString, "\n", -1);
- }
- }
- }
- size = Tcl_DStringLength(&dString) - offset;
- strncpy(buffer, Tcl_DStringValue(&dString) + offset, maxBytes);
- Tcl_DStringFree(&dString);
- buffer[maxBytes] = '\0';
- return (size > maxBytes) ? maxBytes : size;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WidgetInstCmdDeleteProc --
- *
- * This procedure is invoked when a widget command is deleted. If the
- * widget isn't already in the process of being destroyed, this command
- * destroys it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-WidgetInstCmdDeleteProc(ClientData clientData)
-{
- TreeView *viewPtr = clientData;
-
- /*
- * This procedure could be invoked either because the window was destroyed
- * and the command was then deleted (in which case tkwin is NULL) or
- * because the command was deleted, and then this procedure destroys the
- * widget.
- */
- if (viewPtr->tkwin != NULL) {
- Tk_Window tkwin;
-
- tkwin = viewPtr->tkwin;
- viewPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_UpdateWidget --
- *
- * Updates the GCs and other information associated with the treeview
- * widget.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is returned,
- * then interp->result contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for viewPtr; old resources get freed, if there were any. The widget
- * is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_TreeView_UpdateWidget(Tcl_Interp *interp, TreeView *viewPtr)
-{
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
-
- /*
- * GC for dotted vertical line.
- */
- gcMask = (GCForeground | GCLineWidth);
- gcValues.foreground = viewPtr->lineColor->pixel;
- gcValues.line_width = viewPtr->lineWidth;
- if (viewPtr->dashes > 0) {
- gcMask |= (GCLineStyle | GCDashList);
- gcValues.line_style = LineOnOffDash;
- gcValues.dashes = viewPtr->dashes;
- }
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (viewPtr->lineGC != NULL) {
- Tk_FreeGC(viewPtr->display, viewPtr->lineGC);
- }
- viewPtr->lineGC = newGC;
-
- /*
- * GC for active label. Dashed outline.
- */
- gcMask = GCForeground | GCLineStyle;
- gcValues.foreground = viewPtr->focusColor->pixel;
- gcValues.line_style = (LineIsDashed(viewPtr->focusDashes))
- ? LineOnOffDash : LineSolid;
- newGC = Blt_GetPrivateGC(viewPtr->tkwin, gcMask, &gcValues);
- if (LineIsDashed(viewPtr->focusDashes)) {
- viewPtr->focusDashes.offset = 2;
- Blt_SetDashes(viewPtr->display, newGC, &viewPtr->focusDashes);
- }
- if (viewPtr->focusGC != NULL) {
- Blt_FreePrivateGC(viewPtr->display, viewPtr->focusGC);
- }
- viewPtr->focusGC = newGC;
-
- /*
- * GC for selection. Dashed outline.
- */
- gcMask = GCForeground | GCLineStyle;
- gcValues.foreground = viewPtr->selFgColor->pixel;
- gcValues.line_style = (LineIsDashed(viewPtr->focusDashes))
- ? LineOnOffDash : LineSolid;
- newGC = Blt_GetPrivateGC(viewPtr->tkwin, gcMask, &gcValues);
- if (LineIsDashed(viewPtr->focusDashes)) {
- viewPtr->focusDashes.offset = 2;
- Blt_SetDashes(viewPtr->display, newGC, &viewPtr->focusDashes);
- }
- if (viewPtr->selGC != NULL) {
- Blt_FreePrivateGC(viewPtr->display, viewPtr->selGC);
- }
- viewPtr->selGC = newGC;
-
- Blt_TreeView_ConfigureButtons(viewPtr);
- viewPtr->inset = viewPtr->highlightWidth + viewPtr->borderWidth + INSET_PAD;
-
- /*
- * If the tree object was changed, we need to setup the new one.
- */
- if (Blt_ConfigModified(bltTreeViewSpecs, "-tree", (char *)NULL)) {
- TeardownEntries(viewPtr);
- Blt_InitHashTableWithPool(&viewPtr->entryTable, BLT_ONE_WORD_KEYS);
- Blt_TreeView_ClearSelection(viewPtr);
- if (Blt_Tree_Attach(interp, viewPtr->tree, viewPtr->treeName)
- != TCL_OK) {
- return TCL_ERROR;
- }
- viewPtr->flags |= REPOPULATE;
- }
-
- /*
- * These options change the layout of the box. Mark the widget for update.
- */
- if (Blt_ConfigModified(bltTreeViewSpecs, "-font",
- "-linespacing", "-*width", "-height", "-hide*", "-tree", "-flat",
- (char *)NULL)) {
- viewPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- }
- /*
- * If the tree view was changed, mark all the nodes dirty (we'll be
- * switching back to either the full path name or the label) and free the
- * array representing the flattened view of the tree.
- */
- if (Blt_ConfigModified(bltTreeViewSpecs, "-hideleaves", "-flat",
- (char *)NULL)) {
- TreeViewEntry *entryPtr;
-
- viewPtr->flags |= DIRTY;
- /* Mark all entries dirty. */
- for (entryPtr = viewPtr->rootPtr; entryPtr != NULL;
- entryPtr = Blt_TreeView_NextEntry(entryPtr, 0)) {
- entryPtr->flags |= ENTRY_DIRTY;
- }
- if ((!viewPtr->flatView) && (viewPtr->flatArr != NULL)) {
- Blt_Free(viewPtr->flatArr);
- viewPtr->flatArr = NULL;
- }
- }
-
- if (viewPtr->flags & REPOPULATE) {
- Blt_TreeNode root;
-
- Blt_Tree_CreateEventHandler(viewPtr->tree, TREE_NOTIFY_ALL,
- TreeEventProc, viewPtr);
- TraceColumns(viewPtr);
- root = Blt_Tree_RootNode(viewPtr->tree);
-
- /* Automatically add view-entry values to the new tree. */
- Blt_Tree_Apply(root, CreateApplyProc, viewPtr);
- viewPtr->focusPtr = viewPtr->rootPtr =
- Blt_TreeView_NodeToEntry(viewPtr,root);
- viewPtr->selMarkPtr = viewPtr->selAnchorPtr = NULL;
- Blt_SetFocusItem(viewPtr->bindTable, viewPtr->rootPtr, ITEM_ENTRY);
-
- /* Automatically open the root node. */
- if (Blt_TreeView_OpenEntry(viewPtr, viewPtr->rootPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (viewPtr->flags & TV_NEW_TAGS) {
- Blt_Tree_NewTagTable(viewPtr->tree);
- }
- viewPtr->flags &= ~REPOPULATE;
- }
-
- if (Blt_ConfigModified(bltTreeViewSpecs, "-font", "-color",
- (char *)NULL)) {
- Blt_TreeView_ConfigureColumn(viewPtr, &viewPtr->treeColumn);
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResetCoordinates --
- *
- * Determines the maximum height of all visible entries.
- *
- * 1. Sets the worldY coordinate for all mapped/open entries.
- * 2. Determines if entry needs a button.
- * 3. Collects the minimum height of open/mapped entries. (Do for all
- * entries upon insert).
- * 4. Figures out horizontal extent of each entry (will be width of
- * tree view column).
- * 5. Collects maximum icon size for each level.
- * 6. The height of its vertical line
- *
- * Results:
- * Returns 1 if beyond the last visible entry, 0 otherwise.
- *
- * Side effects:
- * The array of visible nodes is filled.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ResetCoordinates(TreeView *viewPtr, TreeViewEntry *entryPtr, int *yPtr,
- int *indexPtr)
-{
- int depth, height;
-
- entryPtr->worldY = -1;
- entryPtr->vertLineLength = -1;
- if ((entryPtr != viewPtr->rootPtr) &&
- (Blt_TreeView_EntryIsHidden(entryPtr))) {
- return; /* If the entry is hidden, then do
- * nothing. */
- }
- entryPtr->worldY = *yPtr;
- height = MAX3(entryPtr->lineHeight, entryPtr->iconHeight,
- viewPtr->button.height);
- entryPtr->vertLineLength = -(*yPtr + height / 2);
- *yPtr += entryPtr->height;
- entryPtr->flatIndex = *indexPtr;
- (*indexPtr)++;
- depth = DEPTH(viewPtr, entryPtr->node) + 1;
- if (viewPtr->levelInfo[depth].labelWidth < entryPtr->labelWidth) {
- viewPtr->levelInfo[depth].labelWidth = entryPtr->labelWidth;
- }
- if (viewPtr->levelInfo[depth].iconWidth < entryPtr->iconWidth) {
- viewPtr->levelInfo[depth].iconWidth = entryPtr->iconWidth;
- }
- viewPtr->levelInfo[depth].iconWidth |= 0x01;
- if ((entryPtr->flags & ENTRY_CLOSED) == 0) {
- TreeViewEntry *bottomPtr, *childPtr;
-
- bottomPtr = entryPtr;
- for (childPtr = Blt_TreeView_FirstChild(entryPtr, ENTRY_HIDE);
- childPtr != NULL;
- childPtr = Blt_TreeView_NextSibling(childPtr, ENTRY_HIDE)){
- ResetCoordinates(viewPtr, childPtr, yPtr, indexPtr);
- bottomPtr = childPtr;
- }
- height = MAX3(bottomPtr->lineHeight, bottomPtr->iconHeight,
- viewPtr->button.height);
- entryPtr->vertLineLength += bottomPtr->worldY + height / 2;
- }
-}
-
-static void
-AdjustColumns(TreeView *viewPtr)
-{
- Blt_ChainLink link;
- TreeViewColumn *lastPtr;
- double weight;
- int growth;
- int nOpen;
-
- growth = VPORTWIDTH(viewPtr) - viewPtr->worldWidth;
- lastPtr = NULL;
- nOpen = 0;
- weight = 0.0;
- /* Find out how many columns still have space available */
- for (link = Blt_Chain_FirstLink(viewPtr->columns); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TreeViewColumn *cp;
-
- cp = Blt_Chain_GetValue(link);
- if (cp->flags & COLUMN_HIDDEN) {
- continue;
- }
- lastPtr = cp;
- if ((cp->weight == 0.0) || (cp->width >= cp->max) ||
- (cp->reqWidth > 0)) {
- continue;
- }
- nOpen++;
- weight += cp->weight;
- }
-
- while ((nOpen > 0) && (weight > 0.0) && (growth > 0)) {
- int ration;
-
- ration = (int)(growth / weight);
- if (ration == 0) {
- ration = 1;
- }
- for (link = Blt_Chain_FirstLink(viewPtr->columns);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- TreeViewColumn *cp;
- int size, avail;
-
- cp = Blt_Chain_GetValue(link);
- if (cp->flags & COLUMN_HIDDEN) {
- continue;
- }
- lastPtr = cp;
- if ((cp->weight == 0.0) || (cp->width >= cp->max) ||
- (cp->reqWidth > 0)) {
- continue;
- }
- size = (int)(ration * cp->weight);
- if (size > growth) {
- size = growth;
- }
- avail = cp->max - cp->width;
- if (size > avail) {
- size = avail;
- nOpen--;
- weight -= cp->weight;
- }
- cp->width += size;
- growth -= size;
- ration -= size;
- }
- }
- if ((growth > 0) && (lastPtr != NULL)) {
- lastPtr->width += growth;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeFlatLayout --
- *
- * Recompute the layout when entries are opened/closed, inserted/deleted,
- * or when text attributes change (such as font, linespacing).
- *
- * Results:
- * None.
- *
- * Side effects:
- * The world coordinates are set for all the opened entries.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComputeFlatLayout(TreeView *viewPtr)
-{
- Blt_ChainLink link;
- TreeViewColumn *cp;
- TreeViewEntry **p;
- TreeViewEntry *entryPtr;
- int count;
- int maxX;
- int y;
-
- /*
- * Pass 1: Reinitialize column sizes and loop through all nodes.
- *
- * 1. Recalculate the size of each entry as needed.
- * 2. The maximum depth of the tree.
- * 3. Minimum height of an entry. Dividing this by the
- * height of the widget gives a rough estimate of the
- * maximum number of visible entries.
- * 4. Build an array to hold level information to be filled
- * in on pass 2.
- */
- if (viewPtr->flags & (DIRTY | UPDATE)) {
- int position;
-
- /* Reset the positions of all the columns and initialize the column used
- * to track the widest value. */
- position = 1;
- for (link = Blt_Chain_FirstLink(viewPtr->columns);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- cp = Blt_Chain_GetValue(link);
- cp->maxWidth = 0;
- cp->max = SHRT_MAX;
- if (cp->reqMax > 0) {
- cp->max = cp->reqMax;
- }
- cp->position = position;
- position++;
- }
-
- /* If the view needs to be resorted, free the old view. */
- if ((viewPtr->flags & (DIRTY|RESORT|SORT_PENDING|TV_SORT_AUTO)) &&
- (viewPtr->flatArr != NULL)) {
- Blt_Free(viewPtr->flatArr);
- viewPtr->flatArr = NULL;
- }
-
- /* Recreate the flat view of all the open and not-hidden entries. */
- if (viewPtr->flatArr == NULL) {
- count = 0;
- /* Count the number of open entries to allocate for the array. */
- for (entryPtr = viewPtr->rootPtr; entryPtr != NULL;
- entryPtr = Blt_TreeView_NextEntry(entryPtr, ENTRY_MASK)) {
- if ((viewPtr->flags & HIDE_ROOT) &&
- (entryPtr == viewPtr->rootPtr)) {
- continue;
- }
- count++;
- }
- viewPtr->nEntries = count;
-
- /* Allocate an array for the flat view. */
- viewPtr->flatArr = Blt_AssertCalloc((count + 1),
- sizeof(TreeViewEntry *));
- /* Fill the array with open and not-hidden entries */
- p = viewPtr->flatArr;
- for (entryPtr = viewPtr->rootPtr; entryPtr != NULL;
- entryPtr = Blt_TreeView_NextEntry(entryPtr, ENTRY_MASK)) {
- if ((viewPtr->flags & HIDE_ROOT) &&
- (entryPtr == viewPtr->rootPtr)) {
- continue;
- }
- *p++ = entryPtr;
- }
- *p = NULL;
- viewPtr->flags &= ~SORTED; /* Indicate the view isn't
- * sorted. */
- }
-
- /* Collect the extents of the entries in the flat view. */
- viewPtr->depth = 0;
- viewPtr->minHeight = SHRT_MAX;
- for (p = viewPtr->flatArr; *p != NULL; p++) {
- entryPtr = *p;
- GetEntryExtents(viewPtr, entryPtr);
- if (viewPtr->minHeight > entryPtr->height) {
- viewPtr->minHeight = entryPtr->height;
- }
- entryPtr->flags &= ~ENTRY_HAS_BUTTON;
- }
- if (viewPtr->levelInfo != NULL) {
- Blt_Free(viewPtr->levelInfo);
- }
- viewPtr->levelInfo =
- Blt_AssertCalloc(viewPtr->depth+2, sizeof(LevelInfo));
- viewPtr->flags &= ~(DIRTY | UPDATE | RESORT);
- if (viewPtr->flags & TV_SORT_AUTO) {
- /* If we're auto-sorting, schedule the view to be resorted. */
- viewPtr->flags |= SORT_PENDING;
- }
- }
-
- if (viewPtr->flags & SORT_PENDING) {
- Blt_TreeView_SortFlatView(viewPtr);
- }
-
- viewPtr->levelInfo[0].labelWidth = viewPtr->levelInfo[0].x =
- viewPtr->levelInfo[0].iconWidth = 0;
- /*
- * Pass 2: Loop through all open/mapped nodes.
- *
- * 1. Set world y-coordinates for entries. We must defer
- * setting the x-coordinates until we know the maximum
- * icon sizes at each level.
- * 2. Compute the maximum depth of the tree.
- * 3. Build an array to hold level information.
- */
- y = 0;
- count = 0;
- for(p = viewPtr->flatArr; *p != NULL; p++) {
- entryPtr = *p;
- entryPtr->flatIndex = count++;
- entryPtr->worldY = y;
- entryPtr->vertLineLength = 0;
- y += entryPtr->height;
- if (viewPtr->levelInfo[0].labelWidth < entryPtr->labelWidth) {
- viewPtr->levelInfo[0].labelWidth = entryPtr->labelWidth;
- }
- if (viewPtr->levelInfo[0].iconWidth < entryPtr->iconWidth) {
- viewPtr->levelInfo[0].iconWidth = entryPtr->iconWidth;
- }
- }
- viewPtr->levelInfo[0].iconWidth |= 0x01;
- viewPtr->worldHeight = y; /* Set the scroll height of the
- * hierarchy. */
- if (viewPtr->worldHeight < 1) {
- viewPtr->worldHeight = 1;
- }
- maxX = viewPtr->levelInfo[0].iconWidth + viewPtr->levelInfo[0].labelWidth;
- viewPtr->treeColumn.maxWidth = maxX;
- viewPtr->treeWidth = maxX;
- viewPtr->flags |= VIEWPORT;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeTreeLayout --
- *
- * Recompute the layout when entries are opened/closed, inserted/deleted,
- * or when text attributes change (such as font, linespacing).
- *
- * Results:
- * None.
- *
- * Side effects:
- * The world coordinates are set for all the opened entries.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComputeTreeLayout(TreeView *viewPtr)
-{
- int y;
- int index;
- /*
- * Pass 1: Reinitialize column sizes and loop through all nodes.
- *
- * 1. Recalculate the size of each entry as needed.
- * 2. The maximum depth of the tree.
- * 3. Minimum height of an entry. Dividing this by the
- * height of the widget gives a rough estimate of the
- * maximum number of visible entries.
- * 4. Build an array to hold level information to be filled
- * in on pass 2.
- */
- if (viewPtr->flags & DIRTY) {
- Blt_ChainLink link;
- TreeViewEntry *ep;
- int position;
-
- position = 1;
- for (link = Blt_Chain_FirstLink(viewPtr->columns);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- TreeViewColumn *cp;
-
- cp = Blt_Chain_GetValue(link);
- cp->maxWidth = 0;
- cp->max = SHRT_MAX;
- if (cp->reqMax > 0) {
- cp->max = cp->reqMax;
- }
- cp->position = position;
- position++;
- }
- viewPtr->minHeight = SHRT_MAX;
- viewPtr->depth = 0;
- for (ep = viewPtr->rootPtr; ep != NULL;
- ep = Blt_TreeView_NextEntry(ep, 0)){
- GetEntryExtents(viewPtr, ep);
- if (viewPtr->minHeight > ep->height) {
- viewPtr->minHeight = ep->height;
- }
- /*
- * Determine if the entry should display a button (indicating that
- * it has children) and mark the entry accordingly.
- */
- ep->flags &= ~ENTRY_HAS_BUTTON;
- if (ep->flags & BUTTON_SHOW) {
- ep->flags |= ENTRY_HAS_BUTTON;
- } else if (ep->flags & BUTTON_AUTO) {
- if (Blt_TreeView_FirstChild(ep, ENTRY_HIDE) != NULL) {
- ep->flags |= ENTRY_HAS_BUTTON;
- }
- }
- /* Determine the depth of the tree. */
- if (viewPtr->depth < DEPTH(viewPtr, ep->node)) {
- viewPtr->depth = DEPTH(viewPtr, ep->node);
- }
- }
- if (viewPtr->flags & SORT_PENDING) {
- Blt_TreeView_SortView(viewPtr);
- }
- if (viewPtr->levelInfo != NULL) {
- Blt_Free(viewPtr->levelInfo);
- }
- viewPtr->levelInfo = Blt_AssertCalloc(viewPtr->depth+2,
- sizeof(LevelInfo));
- viewPtr->flags &= ~(DIRTY | RESORT);
- }
- {
- size_t i;
-
- for (i = 0; i <= (viewPtr->depth + 1); i++) {
- viewPtr->levelInfo[i].labelWidth = viewPtr->levelInfo[i].x =
- viewPtr->levelInfo[i].iconWidth = 0;
- }
- }
- /*
- * Pass 2: Loop through all open/mapped nodes.
- *
- * 1. Set world y-coordinates for entries. We must defer
- * setting the x-coordinates until we know the maximum
- * icon sizes at each level.
- * 2. Compute the maximum depth of the tree.
- * 3. Build an array to hold level information.
- */
- y = 0;
- if (viewPtr->flags & HIDE_ROOT) {
- /* If the root entry is to be hidden, cheat by offsetting the
- * y-coordinates by the height of the entry. */
- y = -(viewPtr->rootPtr->height);
- }
- index = 0;
- ResetCoordinates(viewPtr, viewPtr->rootPtr, &y, &index);
- viewPtr->worldHeight = y; /* Set the scroll height of the
- * hierarchy. */
- if (viewPtr->worldHeight < 1) {
- viewPtr->worldHeight = 1;
- }
- {
- int maxX;
- int sum;
- size_t i;
-
- sum = maxX = 0;
- i = 0;
- for (/*empty*/; i <= (viewPtr->depth + 1); i++) {
- int x;
-
- sum += viewPtr->levelInfo[i].iconWidth;
- if (i <= viewPtr->depth) {
- viewPtr->levelInfo[i + 1].x = sum;
- }
- x = sum;
- if (((viewPtr->flags & HIDE_ROOT) == 0) || (i > 1)) {
- x += viewPtr->levelInfo[i].labelWidth;
- }
- if (x > maxX) {
- maxX = x;
- }
- }
- viewPtr->treeColumn.maxWidth = maxX;
- viewPtr->treeWidth = maxX;
- }
-}
-
-static void
-LayoutColumns(TreeView *viewPtr)
-{
- Blt_ChainLink link;
- int sum;
-
- /* The width of the widget (in world coordinates) is the sum of the column
- * widths. */
-
- viewPtr->worldWidth = viewPtr->titleHeight = 0;
- sum = 0;
- for (link = Blt_Chain_FirstLink(viewPtr->columns); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TreeViewColumn *cp;
-
- cp = Blt_Chain_GetValue(link);
- cp->width = 0;
- if (cp->flags & COLUMN_HIDDEN) {
- continue;
- }
- if ((viewPtr->flags & TV_SHOW_COLUMN_TITLES) &&
- (viewPtr->titleHeight < cp->titleHeight)) {
- viewPtr->titleHeight = cp->titleHeight;
- }
- if (cp->reqWidth > 0) {
- cp->width = cp->reqWidth;
- } else {
- /* The computed width of a column is the maximum of the title
- * width and the widest entry. */
- cp->width = MAX(cp->titleWidth, cp->maxWidth);
-
- /* Check that the width stays within any constraints that have
- * been set. */
- if ((cp->reqMin > 0) && (cp->reqMin > cp->width)) {
- cp->width = cp->reqMin;
- }
- if ((cp->reqMax > 0) && (cp->reqMax < cp->width)) {
- cp->width = cp->reqMax;
- }
- }
- cp->width += PADDING(cp->pad) + 2 * cp->borderWidth;
- cp->worldX = sum;
- sum += cp->width;
- }
- viewPtr->worldWidth = sum;
- if (VPORTWIDTH(viewPtr) > sum) {
- AdjustColumns(viewPtr);
- }
- sum = 0;
- for (link = Blt_Chain_FirstLink(viewPtr->columns); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TreeViewColumn *cp;
-
- cp = Blt_Chain_GetValue(link);
- cp->worldX = sum;
- sum += cp->width;
- }
- if (viewPtr->titleHeight > 0) {
- /* If any headings are displayed, add some extra padding to the
- * height. */
- viewPtr->titleHeight += 4;
- }
- /* viewPtr->worldWidth += 10; */
- if (viewPtr->yScrollUnits < 1) {
- viewPtr->yScrollUnits = 1;
- }
- if (viewPtr->xScrollUnits < 1) {
- viewPtr->xScrollUnits = 1;
- }
- if (viewPtr->worldWidth < 1) {
- viewPtr->worldWidth = 1;
- }
- viewPtr->flags &= ~LAYOUT_PENDING;
- viewPtr->flags |= SCROLL_PENDING;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_ComputeLayout --
- *
- * Recompute the layout when entries are opened/closed, inserted/deleted,
- * or when text attributes change (such as font, linespacing).
- *
- * Results:
- * None.
- *
- * Side effects:
- * The world coordinates are set for all the opened entries.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TreeView_ComputeLayout(TreeView *viewPtr)
-{
- Blt_ChainLink link;
- TreeViewColumn *cp;
- TreeViewEntry *entryPtr;
- TreeViewValue *valuePtr;
-
- if (viewPtr->flatView) {
- ComputeFlatLayout(viewPtr);
- } else {
- ComputeTreeLayout(viewPtr);
- }
-
- /*
- * Determine the width of each column based upon the entries that as open
- * (not hidden). The widest entry in a column determines the width of that
- * column.
- */
- /* Initialize the columns. */
- for (link = Blt_Chain_FirstLink(viewPtr->columns);
- link != NULL; link = Blt_Chain_NextLink(link)) {
- cp = Blt_Chain_GetValue(link);
- cp->maxWidth = 0;
- cp->max = SHRT_MAX;
- if (cp->reqMax > 0) {
- cp->max = cp->reqMax;
- }
- }
- /* The treeview column width was computed earlier. */
- viewPtr->treeColumn.maxWidth = viewPtr->treeWidth;
-
- /*
- * Look at all open entries and their values. Determine the column widths
- * by tracking the maximum width value in each column.
- */
- for (entryPtr = viewPtr->rootPtr; entryPtr != NULL;
- entryPtr = Blt_TreeView_NextEntry(entryPtr, ENTRY_MASK)) {
- for (valuePtr = entryPtr->values; valuePtr != NULL;
- valuePtr = valuePtr->nextPtr) {
- if (valuePtr->columnPtr->maxWidth < valuePtr->width) {
- valuePtr->columnPtr->maxWidth = valuePtr->width;
- }
- }
- }
- /* Now layout the columns with the proper sizes. */
- LayoutColumns(viewPtr);
-}
-
-#ifdef notdef
-static void
-PrintFlags(TreeView *viewPtr, char *string)
-{
- fprintf(stderr, "%s: flags=", string);
- if (viewPtr->flags & LAYOUT_PENDING) {
- fprintf(stderr, "layout ");
- }
- if (viewPtr->flags & REDRAW_PENDING) {
- fprintf(stderr, "redraw ");
- }
- if (viewPtr->flags & SCROLLX) {
- fprintf(stderr, "xscroll ");
- }
- if (viewPtr->flags & SCROLLY) {
- fprintf(stderr, "yscroll ");
- }
- if (viewPtr->flags & FOCUS) {
- fprintf(stderr, "focus ");
- }
- if (viewPtr->flags & DIRTY) {
- fprintf(stderr, "dirty ");
- }
- if (viewPtr->flags & UPDATE) {
- fprintf(stderr, "update ");
- }
- if (viewPtr->flags & RESORT) {
- fprintf(stderr, "resort ");
- }
- if (viewPtr->flags & SORTED) {
- fprintf(stderr, "sorted ");
- }
- if (viewPtr->flags & SORT_PENDING) {
- fprintf(stderr, "sort_pending ");
- }
- if (viewPtr->flags & REDRAW_BORDERS) {
- fprintf(stderr, "borders ");
- }
- if (viewPtr->flags & VIEWPORT) {
- fprintf(stderr, "viewport ");
- }
- fprintf(stderr, "\n");
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeVisibleEntries --
- *
- * The entries visible in the viewport (the widget's window) are inserted
- * into the array of visible nodes.
- *
- * Results:
- * Returns 1 if beyond the last visible entry, 0 otherwise.
- *
- * Side effects:
- * The array of visible nodes is filled.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ComputeVisibleEntries(TreeView *viewPtr)
-{
- int height;
- int nSlots;
- int maxX;
- int xOffset, yOffset;
-
- xOffset = Blt_AdjustViewport(viewPtr->xOffset, viewPtr->worldWidth,
- VPORTWIDTH(viewPtr), viewPtr->xScrollUnits, viewPtr->scrollMode);
- yOffset = Blt_AdjustViewport(viewPtr->yOffset,
- viewPtr->worldHeight, VPORTHEIGHT(viewPtr), viewPtr->yScrollUnits,
- viewPtr->scrollMode);
-
- if ((xOffset != viewPtr->xOffset) || (yOffset != viewPtr->yOffset)) {
- viewPtr->yOffset = yOffset;
- viewPtr->xOffset = xOffset;
- viewPtr->flags |= VIEWPORT;
- }
- height = VPORTHEIGHT(viewPtr);
-
- /* Allocate worst case number of slots for entry array. */
- nSlots = (height / viewPtr->minHeight) + 3;
- if (nSlots != viewPtr->nVisible) {
- if (viewPtr->visibleArr != NULL) {
- Blt_Free(viewPtr->visibleArr);
- }
- viewPtr->visibleArr = Blt_AssertCalloc(nSlots + 1,
- sizeof(TreeViewEntry *));
- }
- viewPtr->nVisible = 0;
- viewPtr->visibleArr[nSlots] = viewPtr->visibleArr[0] = NULL;
-
- if (viewPtr->rootPtr->flags & ENTRY_HIDE) {
- return TCL_OK; /* Root node is hidden. */
- }
- /* Find the node where the view port starts. */
- if (viewPtr->flatView) {
- TreeViewEntry **epp;
-
- /* Find the starting entry visible in the viewport. It can't be hidden
- * or any of it's ancestors closed. */
- again:
- for (epp = viewPtr->flatArr; *epp != NULL; epp++) {
- if (((*epp)->worldY + (*epp)->height) > viewPtr->yOffset) {
- break;
- }
- }
- /*
- * If we can't find the starting node, then the view must be scrolled
- * down, but some nodes were deleted. Reset the view back to the top
- * and try again.
- */
- if (*epp == NULL) {
- if (viewPtr->yOffset == 0) {
- return TCL_OK; /* All entries are hidden. */
- }
- viewPtr->yOffset = 0;
- goto again;
- }
-
- maxX = 0;
- height += viewPtr->yOffset;
- for (/*empty*/; *epp != NULL; epp++) {
- int x;
-
- (*epp)->worldX = LEVELX(0) + viewPtr->treeColumn.worldX;
- x = (*epp)->worldX + ICONWIDTH(0) + (*epp)->width;
- if (x > maxX) {
- maxX = x;
- }
- if ((*epp)->worldY >= height) {
- break;
- }
- viewPtr->visibleArr[viewPtr->nVisible] = *epp;
- viewPtr->nVisible++;
- }
- viewPtr->visibleArr[viewPtr->nVisible] = NULL;
- } else {
- TreeViewEntry *ep;
-
- ep = viewPtr->rootPtr;
- while ((ep->worldY + ep->height) <= viewPtr->yOffset) {
- for (ep = Blt_TreeView_LastChild(ep, ENTRY_HIDE); ep != NULL;
- ep = Blt_TreeView_PrevSibling(ep, ENTRY_HIDE)) {
- if (ep->worldY <= viewPtr->yOffset) {
- break;
- }
- }
- /*
- * If we can't find the starting node, then the view must be
- * scrolled down, but some nodes were deleted. Reset the view
- * back to the top and try again.
- */
- if (ep == NULL) {
- if (viewPtr->yOffset == 0) {
- return TCL_OK; /* All entries are hidden. */
- }
- viewPtr->yOffset = 0;
- continue;
- }
- }
-
- height += viewPtr->yOffset;
- maxX = 0;
- viewPtr->treeColumn.maxWidth = viewPtr->treeWidth;
-
- for (; ep != NULL; ep = Blt_TreeView_NextEntry(ep, ENTRY_MASK)){
- int x;
- int level;
-
- /*
- * Compute and save the entry's X-coordinate now that we know the
- * maximum level offset for the entire widget.
- */
- level = DEPTH(viewPtr, ep->node);
- ep->worldX = LEVELX(level) + viewPtr->treeColumn.worldX;
- x = ep->worldX + ICONWIDTH(level) + ICONWIDTH(level+1) + ep->width;
- if (x > maxX) {
- maxX = x;
- }
- if (ep->worldY >= height) {
- break;
- }
- viewPtr->visibleArr[viewPtr->nVisible] = ep;
- viewPtr->nVisible++;
- }
- viewPtr->visibleArr[viewPtr->nVisible] = NULL;
- }
- /*
- * Note: It's assumed that the view port always starts at or
- * over an entry. Check that a change in the hierarchy
- * (e.g. closing a node) hasn't left the viewport beyond
- * the last entry. If so, adjust the viewport to start
- * on the last entry.
- */
- if (viewPtr->xOffset > (viewPtr->worldWidth - viewPtr->xScrollUnits)) {
- viewPtr->xOffset = viewPtr->worldWidth - viewPtr->xScrollUnits;
- }
- if (viewPtr->yOffset > (viewPtr->worldHeight - viewPtr->yScrollUnits)) {
- viewPtr->yOffset = viewPtr->worldHeight - viewPtr->yScrollUnits;
- }
- viewPtr->xOffset = Blt_AdjustViewport(viewPtr->xOffset,
- viewPtr->worldWidth, VPORTWIDTH(viewPtr), viewPtr->xScrollUnits,
- viewPtr->scrollMode);
- viewPtr->yOffset = Blt_AdjustViewport(viewPtr->yOffset,
- viewPtr->worldHeight, VPORTHEIGHT(viewPtr), viewPtr->yScrollUnits,
- viewPtr->scrollMode);
-
- viewPtr->flags &= ~DIRTY;
- Blt_PickCurrentItem(viewPtr->bindTable);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawLines --
- *
- * Draws vertical lines for the ancestor nodes. While the entry of the
- * ancestor may not be visible, its vertical line segment does extent
- * into the viewport. So walk back up the hierarchy drawing lines
- * until we get to the root.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Vertical lines are drawn for the ancestor nodes.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawLines(
- TreeView *viewPtr, /* Widget record containing the
- * attribute information for buttons. */
- GC gc,
- Drawable drawable) /* Pixmap or window to draw into. */
-{
- TreeViewEntry **epp;
- TreeViewButton *buttonPtr;
- TreeViewEntry *entryPtr; /* Entry to be drawn. */
-
- entryPtr = viewPtr->visibleArr[0];
- while (entryPtr != viewPtr->rootPtr) {
- int level;
-
- entryPtr = Blt_TreeView_ParentEntry(entryPtr);
- if (entryPtr == NULL) {
- break;
- }
- level = DEPTH(viewPtr, entryPtr->node);
- if (entryPtr->vertLineLength > 0) {
- int ax, ay, by;
- int x, y;
- int height;
-
- /*
- * World X-coordinates aren't computed for entries that are
- * outside the viewport. So for each off-screen ancestor node
- * compute it here too.
- */
- entryPtr->worldX = LEVELX(level) + viewPtr->treeColumn.worldX;
- x = SCREENX(viewPtr, entryPtr->worldX);
- y = SCREENY(viewPtr, entryPtr->worldY);
- height = MAX3(entryPtr->lineHeight, entryPtr->iconHeight,
- viewPtr->button.height);
- ax = x + ICONWIDTH(level) + ICONWIDTH(level + 1) / 2;
- ay = y + height / 2;
- by = ay + entryPtr->vertLineLength;
- if ((entryPtr == viewPtr->rootPtr) && (viewPtr->flags & HIDE_ROOT)){
- TreeViewEntry *nextPtr;
- int h;
-
- /* If the root node is hidden, go to the next entry to start
- * the vertical line. */
- nextPtr = Blt_TreeView_NextEntry(viewPtr->rootPtr, ENTRY_MASK);
- h = MAX3(nextPtr->lineHeight, nextPtr->iconHeight,
- viewPtr->button.height);
- ay = SCREENY(viewPtr, nextPtr->worldY) + h / 2;
- }
- /*
- * Clip the line's Y-coordinates at the viewport's borders.
- */
- if (ay < 0) {
- ay &= 0x1; /* Make sure the dotted line starts on
- * the same even/odd pixel. */
- }
- if (by > Tk_Height(viewPtr->tkwin)) {
- by = Tk_Height(viewPtr->tkwin);
- }
- if ((ay < Tk_Height(viewPtr->tkwin)) && (by > 0)) {
- ay |= 0x1;
- XDrawLine(viewPtr->display, drawable, gc, ax, ay, ax, by);
- }
- }
- }
- buttonPtr = &viewPtr->button;
- for (epp = viewPtr->visibleArr; *epp != NULL; epp++) {
- int x, y, w, h;
- int buttonY, level;
- int x1, x2, y1, y2;
-
- entryPtr = *epp;
- /* Entry is open, draw vertical line. */
- x = SCREENX(viewPtr, entryPtr->worldX);
- y = SCREENY(viewPtr, entryPtr->worldY);
- level = DEPTH(viewPtr, entryPtr->node);
- w = ICONWIDTH(level);
- h = MAX3(entryPtr->lineHeight, entryPtr->iconHeight, buttonPtr->height);
- entryPtr->buttonX = (w - buttonPtr->width) / 2;
- entryPtr->buttonY = (h - buttonPtr->height) / 2;
- buttonY = y + entryPtr->buttonY;
- x1 = x + (w / 2);
- y1 = buttonY + (buttonPtr->height / 2);
- x2 = x1 + (ICONWIDTH(level) + ICONWIDTH(level + 1)) / 2;
- if (Blt_Tree_ParentNode(entryPtr->node) != NULL) {
- /*
- * For every node except root, draw a horizontal line from the
- * vertical bar to the middle of the icon.
- */
- y1 |= 0x1;
- XDrawLine(viewPtr->display, drawable, gc, x1, y1, x2, y1);
- }
- if (((entryPtr->flags & ENTRY_CLOSED) == 0) &&
- (entryPtr->vertLineLength > 0)) {
- y2 = y1 + entryPtr->vertLineLength;
- if (y2 > Tk_Height(viewPtr->tkwin)) {
- y2 = Tk_Height(viewPtr->tkwin); /* Clip line at window border.*/
- }
- XDrawLine(viewPtr->display, drawable, gc, x2, y1, x2, y2);
- }
- }
-}
-
-void
-Blt_TreeView_DrawRule(
- TreeView *viewPtr, /* Widget record containing the
- * attribute information for rules. */
- TreeViewColumn *cp,
- Drawable drawable) /* Pixmap or window to draw into. */
-{
- int x, y1, y2;
-
- x = SCREENX(viewPtr, cp->worldX) +
- cp->width + viewPtr->ruleMark - viewPtr->ruleAnchor - 1;
-
- y1 = viewPtr->titleHeight + viewPtr->inset;
- y2 = Tk_Height(viewPtr->tkwin) - viewPtr->inset;
- XDrawLine(viewPtr->display, drawable, cp->ruleGC, x, y1, x, y2);
- viewPtr->flags = TOGGLE(viewPtr->flags, TV_RULE_ACTIVE);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_DrawButton --
- *
- * Draws a button for the given entry. The button is drawn centered in the
- * region immediately to the left of the origin of the entry (computed in
- * the layout routines). The height and width of the button were previously
- * calculated from the average row height.
- *
- * button height = entry height - (2 * some arbitrary padding).
- * button width = button height.
- *
- * The button may have a border. The symbol (either a plus or minus) is
- * slight smaller than the width or height minus the border.
- *
- * x,y origin of entry
- *
- * +---+
- * | + | icon label
- * +---+
- * closed
- *
- * |----|----| horizontal offset
- *
- * +---+
- * | - | icon label
- * +---+
- * open
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A button is drawn for the entry.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TreeView_DrawButton(
- TreeView *viewPtr, /* Widget record containing the
- * attribute information for buttons. */
- TreeViewEntry *entryPtr, /* Entry. */
- Drawable drawable, /* Pixmap or window to draw into. */
- int x, int y)
-{
- Blt_Background bg;
- TreeViewButton *buttonPtr = &viewPtr->button;
- TreeViewIcon icon;
- int relief;
- int width, height;
-
- bg = (entryPtr == viewPtr->activeBtnPtr)
- ? buttonPtr->activeBg : buttonPtr->bg;
- relief = (entryPtr->flags & ENTRY_CLOSED)
- ? buttonPtr->closeRelief : buttonPtr->openRelief;
- if (relief == TK_RELIEF_SOLID) {
- relief = TK_RELIEF_FLAT;
- }
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, x, y,
- buttonPtr->width, buttonPtr->height, buttonPtr->borderWidth, relief);
-
- x += buttonPtr->borderWidth;
- y += buttonPtr->borderWidth;
- width = buttonPtr->width - (2 * buttonPtr->borderWidth);
- height = buttonPtr->height - (2 * buttonPtr->borderWidth);
-
- icon = NULL;
- if (buttonPtr->icons != NULL) { /* Open or close button icon? */
- icon = buttonPtr->icons[0];
- if (((entryPtr->flags & ENTRY_CLOSED) == 0) &&
- (buttonPtr->icons[1] != NULL)) {
- icon = buttonPtr->icons[1];
- }
- }
- if (icon != NULL) { /* Icon or rectangle? */
- Tk_RedrawImage(TreeView_IconBits(icon), 0, 0, width, height,
- drawable, x, y);
- } else {
- int top, bottom, left, right;
- XSegment segments[6];
- int count;
- GC gc;
-
- gc = (entryPtr == viewPtr->activeBtnPtr)
- ? buttonPtr->activeGC : buttonPtr->normalGC;
- if (relief == TK_RELIEF_FLAT) {
- /* Draw the box outline */
-
- left = x - buttonPtr->borderWidth;
- top = y - buttonPtr->borderWidth;
- right = left + buttonPtr->width - 1;
- bottom = top + buttonPtr->height - 1;
-
- segments[0].x1 = left;
- segments[0].x2 = right;
- segments[0].y2 = segments[0].y1 = top;
- segments[1].x2 = segments[1].x1 = right;
- segments[1].y1 = top;
- segments[1].y2 = bottom;
- segments[2].x2 = segments[2].x1 = left;
- segments[2].y1 = top;
- segments[2].y2 = bottom;
-#ifdef WIN32
- segments[2].y2++;
-#endif
- segments[3].x1 = left;
- segments[3].x2 = right;
- segments[3].y2 = segments[3].y1 = bottom;
-#ifdef WIN32
- segments[3].x2++;
-#endif
- }
- top = y + height / 2;
- left = x + BUTTON_IPAD;
- right = x + width - BUTTON_IPAD;
-
- segments[4].y1 = segments[4].y2 = top;
- segments[4].x1 = left;
- segments[4].x2 = right - 1;
-#ifdef WIN32
- segments[4].x2++;
-#endif
-
- count = 5;
- if (entryPtr->flags & ENTRY_CLOSED) { /* Draw the vertical line for the
- * plus. */
- top = y + BUTTON_IPAD;
- bottom = y + height - BUTTON_IPAD;
- segments[5].y1 = top;
- segments[5].y2 = bottom - 1;
- segments[5].x1 = segments[5].x2 = x + width / 2;
-#ifdef WIN32
- segments[5].y2++;
-#endif
- count = 6;
- }
- XDrawSegments(viewPtr->display, drawable, gc, segments, count);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_GetEntryIcon --
- *
- * Selects the correct image for the entry's icon depending upon the
- * current state of the entry: active/inactive normal/selected.
- *
- * active - normal
- * active - selected
- * inactive - normal
- * inactive - selected
- *
- * Results:
- * Returns the image for the icon.
- *
- *---------------------------------------------------------------------------
- */
-TreeViewIcon
-Blt_TreeView_GetEntryIcon(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- TreeViewIcon *icons;
- TreeViewIcon icon;
- int hasFocus;
-
- hasFocus = (entryPtr == viewPtr->focusPtr);
- icons = CHOOSE(viewPtr->icons, entryPtr->icons);
- icon = NULL;
- if (icons != NULL) { /* Selected or normal icon? */
- icon = icons[0];
- if ((hasFocus) && (icons[1] != NULL)) {
- icon = icons[1];
- }
- }
- return icon;
-}
-
-
-static int
-DrawImage(
- TreeView *viewPtr, /* Widget record containing the
- * attribute information for buttons. */
- TreeViewEntry *entryPtr, /* Entry to display. */
- Drawable drawable, /* Pixmap or window to draw into. */
- int x, int y)
-{
- TreeViewIcon icon;
-
- icon = Blt_TreeView_GetEntryIcon(viewPtr, entryPtr);
-
- if (icon != NULL) { /* Icon or default icon bitmap? */
- int entryHeight;
- int level;
- int maxY;
- int top, bottom;
- int topInset, botInset;
- int width, height;
-
- level = DEPTH(viewPtr, entryPtr->node);
- entryHeight = MAX3(entryPtr->lineHeight, entryPtr->iconHeight,
- viewPtr->button.height);
- height = TreeView_IconHeight(icon);
- width = TreeView_IconWidth(icon);
- if (viewPtr->flatView) {
- x += (ICONWIDTH(0) - width) / 2;
- } else {
- x += (ICONWIDTH(level + 1) - width) / 2;
- }
- y += (entryHeight - height) / 2;
- botInset = viewPtr->inset - INSET_PAD;
- topInset = viewPtr->titleHeight + viewPtr->inset;
- maxY = Tk_Height(viewPtr->tkwin) - botInset;
- top = 0;
- bottom = y + height;
- if (y < topInset) {
- height += y - topInset;
- top = -y + topInset;
- y = topInset;
- } else if (bottom >= maxY) {
- height = maxY - y;
- }
- Tk_RedrawImage(TreeView_IconBits(icon), 0, top, width, height,
- drawable, x, y);
- }
- return (icon != NULL);
-}
-
-static int
-DrawLabel(
- TreeView *viewPtr, /* Widget record. */
- TreeViewEntry *entryPtr, /* Entry attribute information. */
- Drawable drawable, /* Pixmap or window to draw into. */
- int x, int y,
- int maxLength)
-{
- const char *label;
- int entryHeight;
- int width, height; /* Width and height of label. */
- int isFocused, isSelected, isActive;
-
- entryHeight = MAX3(entryPtr->lineHeight, entryPtr->iconHeight,
- viewPtr->button.height);
- isFocused = ((entryPtr == viewPtr->focusPtr) && (viewPtr->flags & FOCUS));
- isSelected = Blt_TreeView_EntryIsSelected(viewPtr, entryPtr);
- isActive = (entryPtr == viewPtr->activePtr);
-
- /* Includes padding, selection 3-D border, and focus outline. */
- width = entryPtr->labelWidth;
- height = entryPtr->labelHeight;
-
- /* Center the label, if necessary, vertically along the entry row. */
- if (height < entryHeight) {
- y += (entryHeight - height) / 2;
- }
- if (isFocused) { /* Focus outline */
- if (isSelected) {
- XColor *color;
-
- color = viewPtr->selFgColor;
- XSetForeground(viewPtr->display, viewPtr->focusGC, color->pixel);
- }
- if (width > maxLength) {
- width = maxLength | 0x1; /* Width has to be odd for the dots in
- * the focus rectangle to align. */
- }
- XDrawRectangle(viewPtr->display, drawable, viewPtr->focusGC, x, y+1,
- width - 1, height - 3);
- if (isSelected) {
- XSetForeground(viewPtr->display, viewPtr->focusGC,
- viewPtr->focusColor->pixel);
- }
- }
- x += FOCUS_WIDTH + LABEL_PADX + viewPtr->selBW;
- y += FOCUS_WIDTH + LABEL_PADY + viewPtr->selBW;
-
- label = GETLABEL(entryPtr);
- if (label[0] != '\0') {
- TreeViewStyle *stylePtr;
- TextStyle ts;
- Blt_Font font;
- XColor *color;
-
- stylePtr = viewPtr->treeColumn.stylePtr;
- font = entryPtr->font;
- if (font == NULL) {
- font = Blt_TreeView_GetStyleFont(viewPtr, stylePtr);
- }
- if (isSelected) {
- color = viewPtr->selFgColor;
- } else if (entryPtr->color != NULL) {
- color = entryPtr->color;
- } else {
- color = Blt_TreeView_GetStyleFg(viewPtr, stylePtr);
- }
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, font);
- Blt_Ts_SetForeground(ts, color);
- Blt_Ts_SetMaxLength(ts, maxLength);
- Blt_Ts_DrawLayout(viewPtr->tkwin, drawable, entryPtr->textPtr, &ts,
- x, y);
- if (isActive) {
- Blt_Ts_UnderlineLayout(viewPtr->tkwin, drawable, entryPtr->textPtr,
- &ts, x, y);
- }
- }
- return entryHeight;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawFlatEntry --
- *
- * Draws a button for the given entry. Note that buttons should only be
- * drawn if the entry has sub-entries to be opened or closed. It's the
- * responsibility of the calling routine to ensure this.
- *
- * The button is drawn centered in the region immediately to the left of
- * the origin of the entry (computed in the layout routines). The height
- * and width of the button were previously calculated from the average row
- * height.
- *
- * button height = entry height - (2 * some arbitrary padding).
- * button width = button height.
- *
- * The button has a border. The symbol (either a plus or minus) is slight
- * smaller than the width or height minus the border.
- *
- * x,y origin of entry
- *
- * +---+
- * | + | icon label
- * +---+
- * closed
- *
- * |----|----| horizontal offset
- *
- * +---+
- * | - | icon label
- * +---+
- * open
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A button is drawn for the entry.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawFlatEntry(
- TreeView *viewPtr, /* Widget record containing the
- * attribute information for
- * buttons. */
- TreeViewEntry *entryPtr, /* Entry to be drawn. */
- Drawable drawable) /* Pixmap or window to draw into. */
-{
- int level;
- int x, y, xMax;
-
- entryPtr->flags &= ~ENTRY_REDRAW;
-
- x = SCREENX(viewPtr, entryPtr->worldX);
- y = SCREENY(viewPtr, entryPtr->worldY);
- if (!DrawImage(viewPtr, entryPtr, drawable, x, y)) {
- x -= (DEF_ICON_WIDTH * 2) / 3;
- }
- level = 0;
- x += ICONWIDTH(level);
- /* Entry label. */
- xMax = SCREENX(viewPtr, viewPtr->treeColumn.worldX) +
- viewPtr->treeColumn.width - viewPtr->treeColumn.titleBW -
- viewPtr->treeColumn.pad.side2;
- DrawLabel(viewPtr, entryPtr, drawable, x, y, xMax - x);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawTreeEntry --
- *
- * Draws a button for the given entry. Note that buttons should only be
- * drawn if the entry has sub-entries to be opened or closed. It's the
- * responsibility of the calling routine to ensure this.
- *
- * The button is drawn centered in the region immediately to the left of
- * the origin of the entry (computed in the layout routines). The height
- * and width of the button were previously calculated from the average
- * row height.
- *
- * button height = entry height - (2 * some arbitrary padding).
- * button width = button height.
- *
- * The button has a border. The symbol (either a plus or minus) is
- * slight smaller than the width or height minus the border.
- *
- * x,y origin of entry
- *
- * +---+
- * | + | icon label
- * +---+
- * closed
- *
- * |----|----| horizontal offset
- *
- * +---+
- * | - | icon label
- * +---+
- * open
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A button is drawn for the entry.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawTreeEntry(
- TreeView *viewPtr, /* Widget record. */
- TreeViewEntry *entryPtr, /* Entry to be drawn. */
- Drawable drawable) /* Pixmap or window to draw into. */
-{
- TreeViewButton *buttonPtr = &viewPtr->button;
- int buttonY;
- int level;
- int width, height;
- int x, y, xMax;
- int x1, y1, x2, y2;
-
- entryPtr->flags &= ~ENTRY_REDRAW;
- x = SCREENX(viewPtr, entryPtr->worldX);
- y = SCREENY(viewPtr, entryPtr->worldY);
-
- level = DEPTH(viewPtr, entryPtr->node);
- width = ICONWIDTH(level);
- height = MAX3(entryPtr->lineHeight, entryPtr->iconHeight,
- buttonPtr->height);
-
- entryPtr->buttonX = (width - buttonPtr->width) / 2;
- entryPtr->buttonY = (height - buttonPtr->height) / 2;
-
- buttonY = y + entryPtr->buttonY;
-
- x1 = x + (width / 2);
- y1 = y2 = buttonY + (buttonPtr->height / 2);
- x2 = x1 + (ICONWIDTH(level) + ICONWIDTH(level + 1)) / 2;
-
- if ((entryPtr->flags & ENTRY_HAS_BUTTON) && (entryPtr != viewPtr->rootPtr)){
- /*
- * Except for the root, draw a button for every entry that needs one.
- * The displayed button can be either an icon (Tk image) or a line
- * drawing (rectangle with plus or minus sign).
- */
- Blt_TreeView_DrawButton(viewPtr, entryPtr, drawable,
- x + entryPtr->buttonX, y + entryPtr->buttonY);
- }
- x += ICONWIDTH(level);
-
- if (!DrawImage(viewPtr, entryPtr, drawable, x, y)) {
- x -= (DEF_ICON_WIDTH * 2) / 3;
- }
- x += ICONWIDTH(level + 1);
-
- /* Entry label. */
- xMax = SCREENX(viewPtr, viewPtr->treeColumn.worldX) +
- viewPtr->treeColumn.width - viewPtr->treeColumn.titleBW -
- viewPtr->treeColumn.pad.side2;
- DrawLabel(viewPtr, entryPtr, drawable, x, y, xMax - x);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_DrawValue --
- *
- * Draws a column value for the given entry.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A button is drawn for the entry.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TreeView_DrawValue(
- TreeView *viewPtr, /* Widget record. */
- TreeViewEntry *entryPtr, /* Node of entry to be drawn. */
- TreeViewValue *valuePtr,
- Drawable drawable, /* Pixmap or window to draw into. */
- int x, int y)
-{
- TreeViewStyle *stylePtr;
-
- stylePtr = CHOOSE(valuePtr->columnPtr->stylePtr, valuePtr->stylePtr);
- (*stylePtr->classPtr->drawProc)(viewPtr, drawable, entryPtr, valuePtr,
- stylePtr, x, y);
-}
-
-static void
-DrawTitle(TreeView *viewPtr, Column *columnPtr, Drawable drawable, int x)
-{
- Blt_Background bg;
- XColor *fgColor;
- int dw, dx;
- int avail, need;
- int startX, arrowX;
- int needArrow;
-
- if (viewPtr->titleHeight < 1) {
- return;
- }
- startX = dx = arrowX = x;
- dw = columnPtr->width;
- if (columnPtr->position == Blt_Chain_GetLength(viewPtr->columns)) {
- /* If there's any room left over, let the last column take it. */
- dw = Tk_Width(viewPtr->tkwin) - x;
- } else if (columnPtr->position == 1) {
- dw += x;
- dx = 0;
- }
-
- if (columnPtr == viewPtr->activeColumnPtr) {
- bg = columnPtr->activeTitleBg;
- fgColor = columnPtr->activeTitleFgColor;
- } else {
- bg = columnPtr->titleBg;
- fgColor = columnPtr->titleFgColor;
- }
-
- /* Clear the title area by drawing the background. */
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, dx,
- viewPtr->inset, dw, viewPtr->titleHeight, 0, TK_RELIEF_FLAT);
-
- x += columnPtr->pad.side1 + columnPtr->titleBW;
- startX = x;
- needArrow = ((columnPtr == viewPtr->sortColumnPtr) && (viewPtr->flatView));
- needArrow = (columnPtr == viewPtr->sortColumnPtr);
-
- avail = columnPtr->width - (2*columnPtr->titleBW) - PADDING(columnPtr->pad);
- need = columnPtr->titleWidth - (2 * columnPtr->titleBW) -
- columnPtr->arrowWidth;
-
- if (avail > need) {
- switch (columnPtr->titleJustify) {
- case TK_JUSTIFY_RIGHT:
- x += avail - need;
- break;
- case TK_JUSTIFY_CENTER:
- x += (avail - need) / 2;
- break;
- case TK_JUSTIFY_LEFT:
- break;
- }
- }
- if (needArrow) {
- arrowX = x + need + columnPtr->pad.side2;
- if (arrowX > (startX + avail - columnPtr->arrowWidth)) {
- arrowX = startX + avail + columnPtr->pad.side1 + columnPtr->titleBW
- - columnPtr->arrowWidth - 1;
- avail -= columnPtr->arrowWidth + 1;
- x -= columnPtr->arrowWidth + 1;
- if (x < startX) {
- avail -= (startX - x);
- x = startX;
- }
- }
- }
- if (columnPtr->titleIcon != NULL) {
- int ix, iy, iw, ih;
-
- ih = TreeView_IconHeight(columnPtr->titleIcon);
- iw = TreeView_IconWidth(columnPtr->titleIcon);
- ix = x;
- /* Center the icon vertically. We already know the column title is at
- * least as tall as the icon. */
- iy = viewPtr->inset + (viewPtr->titleHeight - ih) / 2;
- Tk_RedrawImage(TreeView_IconBits(columnPtr->titleIcon), 0, 0, iw, ih,
- drawable, ix, iy);
- x += iw + 6;
- avail -= iw + 6;
- }
- if (columnPtr->text != NULL) {
- TextStyle ts;
- int ty;
-
- ty = viewPtr->inset + 1;
- if (viewPtr->titleHeight > columnPtr->textHeight) {
- ty += (viewPtr->titleHeight - columnPtr->textHeight) / 2;
- }
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, columnPtr->titleFont);
- Blt_Ts_SetForeground(ts, fgColor);
- Blt_Ts_SetMaxLength(ts, avail);
- Blt_Ts_DrawText(viewPtr->tkwin, drawable, columnPtr->text, -1, &ts, x,
- ty);
- }
- if (needArrow) {
- Blt_DrawArrow(viewPtr->display, drawable, fgColor, arrowX,
- viewPtr->inset, columnPtr->arrowWidth, viewPtr->titleHeight,
- columnPtr->titleBW,
- (viewPtr->sortDecreasing) ? ARROW_UP : ARROW_DOWN);
- }
- Blt_DrawBackgroundRectangle(viewPtr->tkwin, drawable, bg, dx,
- viewPtr->inset, dw, viewPtr->titleHeight, columnPtr->titleBW,
- columnPtr->titleRelief);
-}
-
-void
-Blt_TreeView_DrawHeadings(TreeView *viewPtr, Drawable drawable)
-{
- Blt_ChainLink link;
- TreeViewColumn *columnPtr;
- int x;
-
- for (link = Blt_Chain_FirstLink(viewPtr->columns); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- columnPtr = Blt_Chain_GetValue(link);
- if (columnPtr->flags & COLUMN_HIDDEN) {
- continue;
- }
- x = SCREENX(viewPtr, columnPtr->worldX);
- if ((x + columnPtr->width) < 0) {
- continue; /* Don't draw columns before the left
- * edge. */
- }
- if (x > Tk_Width(viewPtr->tkwin)) {
- break; /* Discontinue when a column starts
- * beyond the right edge. */
- }
- DrawTitle(viewPtr, columnPtr, drawable, x);
- }
-}
-
-static void
-DrawNormalBackground(TreeView *viewPtr, Drawable drawable, int x, int w)
-{
- Blt_Background bg;
-
- bg = Blt_TreeView_GetStyleBackground(viewPtr, viewPtr->stylePtr);
- /* This also fills the background where there are no entries. */
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, x, 0, w,
- Tk_Height(viewPtr->tkwin), 0, TK_RELIEF_FLAT);
- if (viewPtr->altBg != NULL) {
- TreeViewEntry **epp;
- int count;
-
- for (count = 0, epp = viewPtr->visibleArr; *epp != NULL; epp++,
- count++) {
- if ((*epp)->flatIndex & 0x1) {
- int y;
-
- y = SCREENY(viewPtr, (*epp)->worldY);
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable,
- viewPtr->altBg, x, y, w, (*epp)->height,
- viewPtr->selBW, viewPtr->selRelief);
- }
- }
- }
-}
-
-static void
-DrawSelectionBackground(TreeView *viewPtr, Drawable drawable, int x, int w)
-{
- TreeViewEntry **epp;
-
- /*
- * Draw the backgrounds of selected entries first. The vertical lines
- * connecting child entries will be draw on top.
- */
- for (epp = viewPtr->visibleArr; *epp != NULL; epp++) {
- if (Blt_TreeView_EntryIsSelected(viewPtr, *epp)) {
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable,
- viewPtr->selBg, x, SCREENY(viewPtr, (*epp)->worldY),
- w, (*epp)->height, viewPtr->selBW, viewPtr->selRelief);
- }
- }
-}
-
-static void
-DrawTreeView(TreeView *viewPtr, Drawable drawable, int x)
-{
- TreeViewEntry **epp;
- int count;
-
- count = 0;
- for (epp = viewPtr->visibleArr; *epp != NULL; epp++) {
- (*epp)->flags &= ~ENTRY_SELECTED;
- if (Blt_TreeView_EntryIsSelected(viewPtr, *epp)) {
- (*epp)->flags |= ENTRY_SELECTED;
- count++;
- }
- }
- if ((viewPtr->lineWidth > 0) && (viewPtr->nVisible > 0)) {
- /* Draw all the vertical lines from topmost node. */
- DrawLines(viewPtr, viewPtr->lineGC, drawable);
- if (count > 0) {
- TkRegion rgn;
-
- rgn = TkCreateRegion();
- for (epp = viewPtr->visibleArr; *epp != NULL; epp++) {
- if ((*epp)->flags & ENTRY_SELECTED) {
- XRectangle r;
-
- r.x = 0;
- r.y = SCREENY(viewPtr, (*epp)->worldY);
- r.width = Tk_Width(viewPtr->tkwin);
- r.height = (*epp)->height;
- TkUnionRectWithRegion(&r, rgn, rgn);
- }
- }
- TkSetRegion(viewPtr->display, viewPtr->selGC, rgn);
- DrawLines(viewPtr, viewPtr->selGC, drawable);
- XSetClipMask(viewPtr->display, viewPtr->selGC, None);
- TkDestroyRegion(rgn);
- }
- }
- for (epp = viewPtr->visibleArr; *epp != NULL; epp++) {
- DrawTreeEntry(viewPtr, *epp, drawable);
- }
-}
-
-
-static void
-DrawFlatView(TreeView *viewPtr, Drawable drawable, int x)
-{
- TreeViewEntry **epp;
-
- for (epp = viewPtr->visibleArr; *epp != NULL; epp++) {
- DrawFlatEntry(viewPtr, *epp, drawable);
- }
-}
-
-void
-Blt_TreeView_DrawOuterBorders(TreeView *viewPtr, Drawable drawable)
-{
- /* Draw 3D border just inside of the focus highlight ring. */
- if (viewPtr->borderWidth > 0) {
- Blt_DrawBackgroundRectangle(viewPtr->tkwin, drawable, viewPtr->bg,
- viewPtr->highlightWidth, viewPtr->highlightWidth,
- Tk_Width(viewPtr->tkwin) - 2 * viewPtr->highlightWidth,
- Tk_Height(viewPtr->tkwin) - 2 * viewPtr->highlightWidth,
- viewPtr->borderWidth, viewPtr->relief);
- }
- /* Draw focus highlight ring. */
- if (viewPtr->highlightWidth > 0) {
- XColor *color;
- GC gc;
-
- color = (viewPtr->flags & FOCUS)
- ? viewPtr->highlightColor : viewPtr->highlightBgColor;
- gc = Tk_GCForColor(color, drawable);
- Tk_DrawFocusHighlight(viewPtr->tkwin, gc, viewPtr->highlightWidth,
- drawable);
- }
- viewPtr->flags &= ~REDRAW_BORDERS;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayTreeView --
- *
- * This procedure is invoked to display the widget.
- *
- * Recompute the layout of the text if necessary. This is necessary if the
- * world coordinate system has changed. Specifically, the following may
- * have occurred:
- *
- * 1. a text attribute has changed (font, linespacing, etc.).
- * 2. an entry's option changed, possibly resizing the entry.
- *
- * This is deferred to the display routine since potentially many of
- * these may occur.
- *
- * Set the vertical and horizontal scrollbars. This is done here since the
- * window width and height are needed for the scrollbar calculations.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayTreeView(ClientData clientData) /* Information about widget. */
-{
- Blt_ChainLink link;
- Pixmap drawable;
- TreeView *viewPtr = clientData;
- int reqWidth, reqHeight;
-
- viewPtr->flags &= ~REDRAW_PENDING;
- if (viewPtr->tkwin == NULL) {
- return; /* Window has been destroyed. */
- }
- fprintf(stderr, "DisplayTreeView %s\n", Tk_PathName(viewPtr->tkwin));
- if (viewPtr->flags & LAYOUT_PENDING) {
- /*
- * Recompute the layout when entries are opened/closed,
- * inserted/deleted, or when text attributes change (such as font,
- * linespacing).
- */
- Blt_TreeView_ComputeLayout(viewPtr);
- }
- if (viewPtr->flags & (SCROLL_PENDING | DIRTY)) {
- int width, height;
- /*
- * Scrolling means that the view port has changed and that the visible
- * entries need to be recomputed.
- */
- ComputeVisibleEntries(viewPtr);
- width = VPORTWIDTH(viewPtr);
- height = VPORTHEIGHT(viewPtr);
- if ((viewPtr->flags & SCROLLX) && (viewPtr->xScrollCmdObjPtr != NULL)) {
- Blt_UpdateScrollbar(viewPtr->interp, viewPtr->xScrollCmdObjPtr,
- viewPtr->xOffset, viewPtr->xOffset + width, viewPtr->worldWidth);
- }
- if ((viewPtr->flags & SCROLLY) && (viewPtr->yScrollCmdObjPtr != NULL)) {
- Blt_UpdateScrollbar(viewPtr->interp, viewPtr->yScrollCmdObjPtr,
- viewPtr->yOffset, viewPtr->yOffset+height, viewPtr->worldHeight);
- }
- viewPtr->flags &= ~SCROLL_PENDING;
- }
-
- reqHeight = (viewPtr->reqHeight > 0) ? viewPtr->reqHeight :
- viewPtr->worldHeight + viewPtr->titleHeight + 2 * viewPtr->inset + 1;
- reqWidth = (viewPtr->reqWidth > 0) ? viewPtr->reqWidth :
- viewPtr->worldWidth + 2 * viewPtr->inset;
- if ((reqWidth != Tk_ReqWidth(viewPtr->tkwin)) ||
- (reqHeight != Tk_ReqHeight(viewPtr->tkwin))) {
- Tk_GeometryRequest(viewPtr->tkwin, reqWidth, reqHeight);
- }
-#ifdef notdef
- if (viewPtr->reqWidth == 0) {
- int w;
- /*
- * The first time through this routine, set the requested width to the
- * computed width. All we want is to automatically set the width of
- * the widget, not dynamically grow/shrink it as attributes change.
- */
- w = viewPtr->worldWidth + 2 * viewPtr->inset;
- Tk_GeometryRequest(viewPtr->tkwin, w, viewPtr->reqHeight);
- }
-#endif
- if (!Tk_IsMapped(viewPtr->tkwin)) {
- return;
- }
- drawable = Tk_GetPixmap(viewPtr->display, Tk_WindowId(viewPtr->tkwin),
- Tk_Width(viewPtr->tkwin), Tk_Height(viewPtr->tkwin),
- Tk_Depth(viewPtr->tkwin));
-
- if ((viewPtr->focusPtr == NULL) && (viewPtr->nVisible > 0)) {
- /* Re-establish the focus entry at the top entry. */
- viewPtr->focusPtr = viewPtr->visibleArr[0];
- }
- viewPtr->flags |= VIEWPORT;
- if ((viewPtr->flags & TV_RULE_ACTIVE) && (viewPtr->resizeColumnPtr!=NULL)) {
- Blt_TreeView_DrawRule(viewPtr, viewPtr->resizeColumnPtr, drawable);
- }
- for (link = Blt_Chain_FirstLink(viewPtr->columns); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TreeViewColumn *columnPtr;
- int x;
-
- columnPtr = Blt_Chain_GetValue(link);
- columnPtr->flags &= ~COLUMN_DIRTY;
- if (columnPtr->flags & COLUMN_HIDDEN) {
- continue;
- }
- x = SCREENX(viewPtr, columnPtr->worldX);
- if ((x + columnPtr->width) < 0) {
- continue; /* Don't draw columns before the left
- * edge. */
- }
- if (x > Tk_Width(viewPtr->tkwin)) {
- break; /* Discontinue when a column starts
- * beyond the right edge. */
- }
- /* Clear the column background. */
- DrawNormalBackground(viewPtr, drawable, x, columnPtr->width);
- DrawSelectionBackground(viewPtr, drawable, x, columnPtr->width);
- if (columnPtr != &viewPtr->treeColumn) {
- TreeViewEntry **epp;
-
- for (epp = viewPtr->visibleArr; *epp != NULL; epp++) {
- TreeViewValue *vp;
-
- /* Check if there's a corresponding value in the entry. */
- vp = Blt_TreeView_FindValue(*epp, columnPtr);
- if (vp != NULL) {
- Blt_TreeView_DrawValue(viewPtr, *epp, vp, drawable,
- x + columnPtr->pad.side1, SCREENY(viewPtr, (*epp)->worldY));
- }
- }
- } else {
- if (viewPtr->flatView) {
- DrawFlatView(viewPtr, drawable, x);
- } else {
- DrawTreeView(viewPtr, drawable, x);
- }
- }
- if (columnPtr->relief != TK_RELIEF_FLAT) {
- Blt_Background bg;
-
- /* Draw a 3D border around the column. */
- bg = Blt_TreeView_GetStyleBackground(viewPtr, viewPtr->stylePtr);
- Blt_DrawBackgroundRectangle(viewPtr->tkwin, drawable, bg, x, 0,
- columnPtr->width, Tk_Height(viewPtr->tkwin),
- columnPtr->borderWidth, columnPtr->relief);
- }
- }
- if (viewPtr->flags & TV_SHOW_COLUMN_TITLES) {
- Blt_TreeView_DrawHeadings(viewPtr, drawable);
- }
- Blt_TreeView_DrawOuterBorders(viewPtr, drawable);
- if ((viewPtr->flags & TV_RULE_NEEDED) &&
- (viewPtr->resizeColumnPtr != NULL)) {
- Blt_TreeView_DrawRule(viewPtr, viewPtr->resizeColumnPtr, drawable);
- }
- /* Now copy the new view to the window. */
- XCopyArea(viewPtr->display, drawable, Tk_WindowId(viewPtr->tkwin),
- viewPtr->lineGC, 0, 0, Tk_Width(viewPtr->tkwin),
- Tk_Height(viewPtr->tkwin), 0, 0);
- Tk_FreePixmap(viewPtr->display, drawable);
- viewPtr->flags &= ~VIEWPORT;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_SelectCmdProc --
- *
- * Invoked at the next idle point whenever the current selection changes.
- * Executes some application-specific code in the -selectcommand option.
- * This provides a way for applications to handle selection changes.
- *
- * Results:
- * None.
- *
- * Side effects:
- * TCL code gets executed for some application-specific task.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TreeView_SelectCmdProc(ClientData clientData)
-{
- TreeView *viewPtr = clientData;
-
- viewPtr->flags &= ~TV_SELECT_PENDING;
- Tcl_Preserve(viewPtr);
- if (viewPtr->selectCmd != NULL) {
- if (Tcl_GlobalEval(viewPtr->interp, viewPtr->selectCmd) != TCL_OK) {
- Tcl_BackgroundError(viewPtr->interp);
- }
- }
- Tcl_Release(viewPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeViewObjCmd --
- *
- * This procedure is invoked to process the TCL command that corresponds to
- * a widget managed by this module. See the user documentation for details
- * on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-TreeViewObjCmd(
- ClientData clientData, /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- TreeView *viewPtr;
- Tcl_CmdInfo cmdInfo;
- Tcl_Obj *initObjv[2];
- char *string;
- int result;
-
- string = Tcl_GetString(objv[0]);
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", string,
- " pathName ?option value?...\"", (char *)NULL);
- return TCL_ERROR;
- }
- viewPtr = CreateTreeView(interp, objv[1]);
- if (viewPtr == NULL) {
- goto error;
- }
-
- /*
- * Invoke a procedure to initialize various bindings on treeview entries.
- * If the procedure doesn't already exist, source it from
- * "$blt_library/treeview.tcl". We deferred sourcing the file until now so
- * that the variable $blt_library could be set within a script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::TreeView::Initialize", &cmdInfo)) {
- if (Tcl_GlobalEval(interp,
- "source [file join $blt_library treeview.tcl]") != TCL_OK) {
- char info[200];
-
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- goto error;
- }
- }
- /*
- * Initialize the widget's configuration options here. The options need to
- * be set first, so that entry, column, and style components can use them
- * for their own GCs.
- */
- bltTreeViewIconsOption.clientData = viewPtr;
- bltTreeViewTreeOption.clientData = viewPtr;
- if (Blt_ConfigureWidgetFromObj(interp, viewPtr->tkwin, bltTreeViewSpecs,
- objc - 2, objv + 2, (char *)viewPtr, 0) != TCL_OK) {
- goto error;
- }
- if (Blt_ConfigureComponentFromObj(interp, viewPtr->tkwin, "button",
- "Button", bltTreeViewButtonSpecs, 0, (Tcl_Obj **)NULL, (char *)viewPtr,
- 0) != TCL_OK) {
- goto error;
- }
-
- /*
- * Rebuild the widget's GC and other resources that are predicated by the
- * widget's configuration options. Do the same for the default column.
- */
- if (Blt_TreeView_UpdateWidget(interp, viewPtr) != TCL_OK) {
- goto error;
- }
- Blt_TreeView_ConfigureColumn(viewPtr, &viewPtr->treeColumn);
- Blt_TreeView_UpdateStyleGCs(viewPtr, viewPtr->stylePtr);
-
- /*
- * Invoke a procedure to initialize various bindings on treeview entries.
- * If the procedure doesn't already exist, source it from
- * "$blt_library/treeview.tcl". We deferred sourcing the file until now
- * so that the variable $blt_library could be set within a script.
- */
- initObjv[0] = Tcl_NewStringObj("::blt::TreeView::Initialize", -1);
- initObjv[1] = objv[1];
- Tcl_IncrRefCount(initObjv[0]);
- Tcl_IncrRefCount(initObjv[1]);
- result = Tcl_EvalObjv(interp, 2, initObjv, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(initObjv[1]);
- Tcl_DecrRefCount(initObjv[0]);
- if (result != TCL_OK) {
- goto error;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(viewPtr->tkwin), -1);
- return TCL_OK;
- error:
- if (viewPtr != NULL) {
- Tk_DestroyWindow(viewPtr->tkwin);
- }
- return TCL_ERROR;
-}
-
-int
-Blt_TreeViewCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpecs[] = {
- { "treeview", TreeViewObjCmd, },
- { "hiertable", TreeViewObjCmd, }
- };
-
- return Blt_InitCmds(interp, "::blt", cmdSpecs, 2);
-}
-
-#endif /* NO_TREEVIEW */
-
-
-int
-Blt_TreeView_DrawLabel(TreeView *viewPtr, TreeViewEntry *entryPtr,
- Drawable drawable)
-{
- Blt_Background bg;
- TreeViewIcon icon;
- int level;
- int overlap;
- int srcX, srcY, destX, destY, pmWidth, pmHeight;
- int y2, y1, x1, x2;
- int dx, dy;
- int x, y, xMax, w, h;
-
- x = SCREENX(viewPtr, entryPtr->worldX);
- y = SCREENY(viewPtr, entryPtr->worldY);
- h = entryPtr->height - 1;
- w = viewPtr->treeColumn.width -
- (entryPtr->worldX - viewPtr->treeColumn.worldX);
- xMax = SCREENX(viewPtr, viewPtr->treeColumn.worldX) +
- viewPtr->treeColumn.width - viewPtr->treeColumn.titleBW -
- viewPtr->treeColumn.pad.side2;
-
- icon = Blt_TreeView_GetEntryIcon(viewPtr, entryPtr);
- entryPtr->flags |= ENTRY_ICON;
- if (viewPtr->flatView) {
- x += ICONWIDTH(0);
- w -= ICONWIDTH(0);
- if (icon == NULL) {
- x -= (DEF_ICON_WIDTH * 2) / 3;
- }
- } else {
- level = DEPTH(viewPtr, entryPtr->node);
- if (!viewPtr->flatView) {
- x += ICONWIDTH(level);
- w -= ICONWIDTH(level);
- }
- if (icon != NULL) {
- x += ICONWIDTH(level + 1);
- w -= ICONWIDTH(level + 1);
- }
- }
- if (Blt_TreeView_EntryIsSelected(viewPtr, entryPtr)) {
- bg = viewPtr->selBg;
- } else {
- bg = Blt_TreeView_GetStyleBackground(viewPtr, viewPtr->stylePtr);
- if ((viewPtr->altBg != NULL) && (entryPtr->flatIndex & 0x1)) {
- bg = viewPtr->altBg;
- }
- }
- x1 = viewPtr->inset;
- x2 = Tk_Width(viewPtr->tkwin) - viewPtr->inset;
- y1 = viewPtr->titleHeight + viewPtr->inset;
- y2 = Tk_Height(viewPtr->tkwin) - viewPtr->inset - INSET_PAD;
-
- /* Verify that the label is currently visible on screen. */
- if (((x + w) < x1) || (x > x2) || ((y + h) < y1) || (y > y2)) {
- return 0;
- }
- /*
- * sx, sy
- * +================+
- * | +-------------|--------------+
- * | | dx, dy | h |
- * +================+ |
- * |<---- w ----> |
- * | |
- * +----------------------------+
- */
- overlap = FALSE;
- destX = x;
- destY = y;
- srcX = srcY = 0;
- pmWidth = w, pmHeight = h;
- dy = y1 - y;
- if (dy > 0) {
- overlap = TRUE;
- pmHeight -= dy; /* Reduce the height of the pixmap. */
- srcY = -dy; /* Offset from the origin of the
- * pixmap. */
- destY = y1;
- }
- dy = (y + h) - y2;
- if (dy > 0) {
- overlap = TRUE;
- pmHeight -= dy;
- }
- dx = x1 - x;
- if (dx > 0) {
- overlap = TRUE;
- pmWidth -= dx;
- srcX = -dx;
- destX = x1;
- }
- dx = (x + w) - x2;
- if (dx > 0) {
- overlap = TRUE;
- pmWidth -= dx;
- }
- if ((overlap) && (pmWidth > 0) && (pmHeight)) {
- Pixmap pm;
-
- pm = Tk_GetPixmap(viewPtr->display, Tk_WindowId(viewPtr->tkwin),
- pmWidth, pmHeight, Tk_Depth(viewPtr->tkwin));
- /* Clear the entry label background. */
- Blt_FillBackgroundRectangle(viewPtr->tkwin, pm, bg, 0, 0, pmWidth,
- pmHeight, 0, TK_RELIEF_FLAT);
- DrawLabel(viewPtr, entryPtr, pm, srcX, srcY, xMax - x);
- XCopyArea(viewPtr->display, pm, drawable, viewPtr->lineGC, 0, 0,
- pmWidth, pmHeight, destX, destY);
- Tk_FreePixmap(viewPtr->display, pm);
- } else {
- /* Clear the entry label background. */
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, x, y, w, h,
- 0, TK_RELIEF_FLAT);
- DrawLabel(viewPtr, entryPtr, drawable, x, y, xMax - x);
- }
- return 1;
-}
diff --git a/blt3.0.1/src/bltTreeView.h b/blt3.0.1/src/bltTreeView.h
deleted file mode 100644
index 16faec3..0000000
--- a/blt3.0.1/src/bltTreeView.h
+++ /dev/null
@@ -1,1079 +0,0 @@
-
-/*
- * bltTreeView.h --
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * TODO:
- *
- * BUGS:
- * 1. "open" operation should change scroll offset so that as many
- * new entries (up to half a screen) can be seen.
- * 2. "open" needs to adjust the scrolloffset so that the same entry
- * is seen at the same place.
- */
-
-#ifndef BLT_TREEVIEW_H
-#define BLT_TREEVIEW_H
-
-#include "bltImage.h"
-#include "bltHash.h"
-#include "bltFont.h"
-#include "bltText.h"
-#include "bltChain.h"
-#include "bltTree.h"
-#include "bltTile.h"
-#include "bltBind.h"
-#include "bltBgStyle.h"
-
-#define ITEM_ENTRY (ClientData)0
-#define ITEM_ENTRY_BUTTON (ClientData)1
-#define ITEM_COLUMN_TITLE (ClientData)2
-#define ITEM_COLUMN_RULE (ClientData)3
-#define ITEM_STYLE (ClientData)0x10004
-
-#if HAVE_UTF
-#else
-#define Tcl_NumUtfChars(s,n) (((n) == -1) ? strlen((s)) : (n))
-#define Tcl_UtfAtIndex(s,i) ((s) + (i))
-#endif
-
-#define ODD(x) ((x) | 0x01)
-
-#define END (-1)
-#define SEPARATOR_LIST ((char *)NULL)
-#define SEPARATOR_NONE ((char *)-1)
-
-#define SEARCH_Y 1
-
-#define TV_ARROW_WIDTH 17
-#define TV_ARROW_HEIGHT 17
-
-typedef const char *UID;
-
-/*
- * The macro below is used to modify a "char" value (e.g. by casting it to an
- * unsigned character) so that it can be used safely with macros such as
- * isspace.
- */
-#define UCHAR(c) ((unsigned char) (c))
-
-#define TOGGLE(x, mask) (((x) & (mask)) ? ((x) & ~(mask)) : ((x) | (mask)))
-
-
-#define SCREENX(h, wx) ((wx) - (h)->xOffset + (h)->inset)
-#define SCREENY(h, wy) ((wy) - (h)->yOffset + (h)->inset + (h)->titleHeight)
-
-#define WORLDX(h, sx) ((sx) - (h)->inset + (h)->xOffset)
-#define WORLDY(h, sy) ((sy) - ((h)->inset + (h)->titleHeight) + (h)->yOffset)
-
-#define VPORTWIDTH(h) (Tk_Width((h)->tkwin) - 2 * (h)->inset)
-#define VPORTHEIGHT(h) \
- (Tk_Height((h)->tkwin) - (h)->titleHeight - 2 * (h)->inset)
-
-#define ICONWIDTH(d) (viewPtr->levelInfo[(d)].iconWidth)
-#define LEVELX(d) (viewPtr->levelInfo[(d)].x)
-
-#define DEPTH(h, n) (((h)->flatView) ? 0 : Blt_Tree_NodeDepth(n))
-
-#define SELECT_MODE_SINGLE (1<<0)
-#define SELECT_MODE_MULTIPLE (1<<1)
-
-/*
- *---------------------------------------------------------------------------
- *
- * Internal treeview widget flags:
- *
- * LAYOUT_PENDING The layout of the hierarchy needs to be recomputed.
- *
- * REDRAW_PENDING A redraw request is pending for the widget.
- *
- * SCROLLX X-scroll request is pending.
- *
- * SCROLLY Y-scroll request is pending.
- *
- * SCROLL_PENDING Both X-scroll and Y-scroll requests are pending.
- *
- * FOCUS The widget is receiving keyboard events.
- * Draw the focus highlight border around the widget.
- *
- * DIRTY The hierarchy has changed. It may invalidate
- * the locations and pointers to entries. The widget
- * will need to recompute its layout.
- *
- * RESORT The tree has changed such that the view needs to
- * be resorted. This can happen when an entry is
- * open or closed, it's label changes, a column value
- * changes, etc.
- *
- * REDRAW_BORDERS The borders of the widget (highlight ring and
- * 3-D border) need to be redrawn.
- *
- * VIEWPORT Indicates that the viewport has changed in some
- * way: the size of the viewport, the location of
- * the viewport, or the contents of the viewport.
- *
- */
-
-#define LAYOUT_PENDING (1<<0)
-#define REDRAW_PENDING (1<<1)
-#define SCROLLX (1<<2)
-#define SCROLLY (1<<3)
-#define SCROLL_PENDING (SCROLLX | SCROLLY)
-#define FOCUS (1<<4)
-#define DIRTY (1<<5)
-#define SORTED (1<<8)
-#define UPDATE (1<<6)
-#define VIEWPORT (1<<11)
-#define RESORT (1<<7)
-#define SORT_PENDING (1<<9)
-#define REDRAW_BORDERS (1<<10)
-#define REPOPULATE (1<<12)
-
-#define COLUMN_HIDDEN (1<<13)
-#define COLUMN_READONLY (1<<14)
-
-/*
- * Rule related flags: Rules are XOR-ed lines. We need to track whether
- * they have been drawn or not.
- *
- * TV_RULE_ACTIVE Indicates that a rule is currently being drawn
- * for a column.
- *
- *
- * TV_RULE_NEEDED Indicates that a rule is needed (but not yet
- * drawn) for a column.
- */
-
-#define TV_RULE_ACTIVE (1<<15)
-#define TV_RULE_NEEDED (1<<16)
-
-/*
- * Selection related flags:
- *
- * TV_SELECT_Blt_Export Export the selection to X11.
- *
- * TV_SELECT_PENDING A "selection" command idle task is pending.
- *
- * TV_SELECT_CLEAR Clear selection flag of entry.
- *
- * TV_SELECT_SET Set selection flag of entry.
- *
- * TV_SELECT_TOGGLE Toggle selection flag of entry.
- *
- * TV_SELECT_MASK Mask of selection set/clear/toggle flags.
- *
- * TV_SELECT_SORTED Indicates if the entries in the selection
- * should be sorted or displayed in the order
- * they were selected.
- *
- */
-#define TV_SELECT_CLEAR (1<<16)
-#define TV_SELECT_EXPORT (1<<17)
-#define TV_SELECT_PENDING (1<<18)
-#define TV_SELECT_SET (1<<19)
-#define TV_SELECT_TOGGLE (TV_SELECT_SET | TV_SELECT_CLEAR)
-#define TV_SELECT_MASK (TV_SELECT_SET | TV_SELECT_CLEAR)
-#define TV_SELECT_SORTED (1<<20)
-
-/*
- * Miscellaneous flags:
- *
- * TV_ALLOW_DUPLICATES When inserting new entries, create
- * duplicate entries.
- *
- * TV_FILL_ANCESTORS Automatically create ancestor entries
- * as needed when inserting a new entry.
- *
- * HIDE_ROOT Don't display the root entry.
- *
- * TV_HIDE_LEAVES Don't display entries that are leaves.
- *
- * TV_SHOW_COLUMN_TITLES Indicates whether to draw titles over each
- * column.
- *
- */
-#define TV_ALLOW_DUPLICATES (1<<21)
-#define TV_FILL_ANCESTORS (1<<22)
-#define HIDE_ROOT (1<<23)
-#define TV_HIDE_LEAVES (1<<24)
-#define TV_SHOW_COLUMN_TITLES (1<<25)
-#define TV_SORT_AUTO (1<<26)
-#define TV_NEW_TAGS (1<<27)
-#define TV_HIGHLIGHT_CELLS (1<<28)
-
-#define DONT_UPDATE (1<<29)
-
-#define TV_ITEM_COLUMN 1
-#define TV_ITEM_RULE 2
-
-/*
- *---------------------------------------------------------------------------
- *
- * Internal entry flags:
- *
- * ENTRY_HAS_BUTTON Indicates that a button needs to be
- * drawn for this entry.
- *
- * ENTRY_CLOSED Indicates that the entry is closed and
- * its subentries are not displayed.
- *
- * ENTRY_HIDE Indicates that the entry is hidden (i.e.
- * can not be viewed by opening or scrolling).
- *
- * BUTTON_AUTO
- * BUTTON_SHOW
- * BUTTON_MASK
- *
- *---------------------------------------------------------------------------
- */
-#define ENTRY_CLOSED (1<<0)
-#define ENTRY_HIDE (1<<1)
-#define ENTRY_NOT_LEAF (1<<2)
-#define ENTRY_MASK (ENTRY_CLOSED | ENTRY_HIDE)
-
-#define ENTRY_HAS_BUTTON (1<<3)
-#define ENTRY_ICON (1<<4)
-#define ENTRY_REDRAW (1<<5)
-#define ENTRY_LAYOUT_PENDING (1<<6)
-#define ENTRY_DATA_CHANGED (1<<7)
-#define ENTRY_DIRTY (ENTRY_DATA_CHANGED | ENTRY_LAYOUT_PENDING)
-
-#define BUTTON_AUTO (1<<8)
-#define BUTTON_SHOW (1<<9)
-#define BUTTON_MASK (BUTTON_AUTO | BUTTON_SHOW)
-
-#define ENTRY_EDITABLE (1<<10)
-#define ENTRY_SELECTED (1<<11)
-
-#define COLUMN_RULE_PICKED (1<<1)
-#define COLUMN_DIRTY (1<<2)
-
-#define STYLE_TEXTBOX (0)
-#define STYLE_COMBOBOX (1)
-#define STYLE_CHECKBOX (2)
-#define STYLE_TYPE 0x3
-
-#define STYLE_LAYOUT (1<<3)
-#define STYLE_DIRTY (1<<4)
-#define STYLE_HIGHLIGHT (1<<5)
-#define STYLE_USER (1<<6)
-
-#define STYLE_EDITABLE (1<<10)
-
-typedef struct _TreeViewColumn TreeViewColumn;
-typedef struct _TreeViewCombobox TreeView_Combobox;
-typedef struct _TreeViewEntry TreeViewEntry;
-typedef struct _TreeView TreeView;
-typedef struct _TreeViewStyleClass TreeViewStyleClass;
-typedef struct _TreeViewStyle TreeViewStyle;
-
-typedef int (TreeViewCompareProc)(Tcl_Interp *interp, const char *name,
- const char *pattern);
-
-typedef TreeViewEntry *(TreeViewIterProc)(TreeViewEntry *entryPtr,
- unsigned int mask);
-
-typedef struct {
- int tagType;
- TreeView *viewPtr;
- Blt_HashSearch cursor;
- TreeViewEntry *entryPtr;
-} TreeViewTagIter;
-
-/*
- * TreeViewIcon --
- *
- * Since instances of the same Tk image can be displayed in
- * different windows with possibly different color palettes, Tk
- * internally stores each instance in a linked list. But if
- * the instances are used in the same widget and therefore use
- * the same color palette, this adds a lot of overhead,
- * especially when deleting instances from the linked list.
- *
- * For the treeview widget, we never need more than a single
- * instance of an image, regardless of how many times it's used.
- * Cache the image, maintaining a reference count for each
- * image used in the widget. It's likely that the treeview
- * widget will use many instances of the same image (for example
- * the open/close icons).
- */
-
-typedef struct _TreeViewIcon {
- Tk_Image tkImage; /* The Tk image being cached. */
- int refCount; /* Reference count for this image. */
- short int width, height; /* Dimensions of the cached image. */
- Blt_HashEntry *hashPtr; /* Hash table pointer to the image. */
-} *TreeViewIcon;
-
-#define TreeView_IconHeight(icon) ((icon)->height)
-#define TreeView_IconWidth(icon) ((icon)->width)
-#define TreeView_IconBits(icon) ((icon)->tkImage)
-#define TreeView_IconName(icon) (Blt_Image_Name((icon)->tkImage))
-
-/*
- * TreeViewColumn --
- *
- * A column describes how to display a field of data in the tree. It may
- * display a title that you can bind to. It may display a rule for
- * resizing the column. Columns may be hidden, and have attributes
- * (foreground color, background color, font, etc) that override those
- * designated globally for the treeview widget.
- */
-struct _TreeViewColumn {
- int type; /* Always TV_COLUMN */
- Blt_TreeKey key; /* Data cell identifier for current
- * tree. */
- int position; /* Position of column in list. Used
- * to indicate the first and last
- * columns. */
- UID tagsUid; /* List of binding tags for this
- * entry. UID, not a string, because
- * in the typical case most columns
- * will have the same bindtags. */
-
- TreeView *viewPtr;
- unsigned int flags;
-
- /* Title-related information */
- const char *text; /* Text displayed in column heading as
- * its title. By default, this is the
- * same as the data cell name. */
- short int textWidth, textHeight; /* Dimensions of title text. */
- Blt_Font titleFont; /* Font to draw title in. */
- XColor *titleFgColor; /* Foreground color of text displayed
- * in the heading */
- Blt_Background titleBg; /* Background color of the heading. */
- GC titleGC;
- XColor *activeTitleFgColor; /* Foreground color of the heading
- * when the column is activated.*/
- Blt_Background activeTitleBg;
-
- int titleBW;
- int titleRelief;
- Tk_Justify titleJustify; /* Indicates how the text and/or icon
- * is justified within the column
- * title. */
- GC activeTitleGC;
- short int titleWidth, titleHeight;
-
- TreeViewIcon titleIcon; /* Icon displayed in column heading */
- const char *titleCmd; /* TCL script to be executed by the
- * column's "invoke" operation. */
- Tcl_Obj *sortCmdPtr; /* TCL script used to compare two
- * columns. */
- int reqArrowWidth; /* If > 0, this is the requested width
- * of the sort direction arrow
- * displayed in the title. */
- int arrowWidth; /* Actual width of the arrow. */
-
- /* General information. */
- int state; /* Indicates if column title can
- * invoked. */
- int max; /* Maximum space allowed for
- * column. */
- int reqMin, reqMax; /* Requested bounds on the width of
- * column. Does not include any
- * padding or the borderwidth of
- * column. If non-zero, overrides the
- * computed width of the column. */
- int reqWidth; /* User-requested width of
- * column. Does not include any
- * padding or the borderwidth of
- * column. If non-zero, overrides the
- * computed column width. */
- int maxWidth; /* Width of the widest entry in the
- * column. */
- int worldX; /* Starting world x-coordinate of the
- * column. */
- double weight; /* Growth factor for column. Zero
- * indicates that the column can not
- * be resized. */
- int width; /* Computed width of column. */
- TreeViewStyle *stylePtr; /* Default style for column. */
- Blt_Background bg; /* Background color. */
- int borderWidth; /* Border width of the column. */
- int relief; /* Relief of the column. */
- Blt_Pad pad; /* Horizontal padding on either side
- * of the column. */
- Tk_Justify justify; /* Indicates how the text or icon is
- * justified within the column. */
- Blt_ChainLink link;
-
- int ruleLineWidth;
- Blt_Dashes ruleDashes;
- GC ruleGC;
-
- Tcl_Obj *fmtCmdPtr;
-};
-
-
-struct _TreeViewStyle {
- int refCount; /* Usage reference count. A reference
- * count of zero indicates that the
- * style may be freed. */
- unsigned int flags; /* Bit field containing both the style
- * type and various flags. */
- const char *name; /* Instance name. */
- TreeViewStyleClass *classPtr; /* Contains class-specific information
- * such as configuration
- * specifications and * configure,
- * draw, etc. routines. */
- Blt_HashEntry *hashPtr; /* If non-NULL, points to the hash
- * table entry for the style. A style
- * that's been deleted, but still in
- * use (non-zero reference count)
- * will have no hash table entry. */
- Blt_ChainLink link; /* If non-NULL, pointer of the
- * style in a list of all newly
- * created styles. */
- /* General style fields. */
- Tk_Cursor cursor; /* X Cursor */
-
- TreeViewIcon icon; /* If non-NULL, is a Tk_Image to be
- * drawn in the cell. */
- int gap; /* # pixels gap between icon and
- * text. */
- Blt_Font font;
- XColor *fgColor; /* Normal foreground color of cell. */
- XColor *highlightFgColor; /* Foreground color of cell when
- * highlighted. */
- XColor *activeFgColor; /* Foreground color of cell when
- * active. */
- XColor *selFgColor; /* Foreground color of a selected
- * cell. If non-NULL, overrides
- * default foreground color
- * specification. */
- Blt_Background bg; /* Normal background color of cell. */
- Blt_Background highlightBg; /* Background color of cell when
- * highlighted. */
- Blt_Background activeBg; /* Background color of cell when
- * active. */
-
- Blt_Background selBg; /* Background color of a selected
- * cell. If non-NULL, overrides the
- * default background * color
- * specification. */
- const char *validateCmd;
-
-};
-
-typedef struct _TreeViewValue {
- TreeViewColumn *columnPtr; /* Column in which the value is
- * located. */
- unsigned int width, height; /* Dimensions of value. */
- TreeViewStyle *stylePtr; /* Style information for cell
- * displaying value. */
- const char *fmtString; /* Raw text string. */
- TextLayout *textPtr; /* Processes string to be displayed .*/
- struct _TreeViewValue *nextPtr;
-} TreeViewValue;
-
-typedef void (StyleConfigProc)(TreeView *viewPtr, TreeViewStyle *stylePtr);
-typedef void (StyleDrawProc)(TreeView *viewPtr, Drawable drawable,
- TreeViewEntry *entryPtr, TreeViewValue *valuePtr,
- TreeViewStyle *stylePtr, int x, int y);
-typedef int (StyleEditProc)(TreeView *viewPtr, TreeViewEntry *entryPtr,
- TreeViewColumn *colPtr, TreeViewStyle *stylePtr);
-typedef void (StyleFreeProc)(TreeView *viewPtr, TreeViewStyle *stylePtr);
-typedef void (StyleMeasureProc)(TreeView *viewPtr, TreeViewStyle *stylePtr,
- TreeViewValue *valuePtr);
-typedef int (StylePickProc)(TreeViewEntry *entryPtr, TreeViewValue *valuePtr,
- TreeViewStyle *stylePtr, int x, int y);
-
-struct _TreeViewStyleClass {
- const char *className; /* Class name of the style */
- Blt_ConfigSpec *specsPtr; /* Style configuration
- * specifications */
- StyleConfigProc *configProc; /* Sets the GCs for style. */
- StyleMeasureProc *measProc; /* Measures the area needed for the
- * value with this style. */
- StyleDrawProc *drawProc; /* Draw the value in it's style. */
- StylePickProc *pickProc; /* Routine to pick the style's button.
- * Indicates if the mouse pointer is
- * over the style's button (if it has
- * one). */
- StyleEditProc *editProc; /* Routine to edit the style's
- * value. */
- StyleFreeProc *freeProc; /* Routine to free the style's
- * resources. */
-};
-
-/*
- * TreeViewEntry --
- *
- * Contains data-specific information how to represent the data
- * of a node of the hierarchy.
- *
- */
-struct _TreeViewEntry {
- Blt_TreeNode node; /* Node containing entry */
- int worldX, worldY; /* X-Y position in world coordinates
- * where the entry is positioned. */
- size_t width, height; /* Dimensions of the entry. This
- * includes the size of its columns. */
- int reqHeight; /* Requested height of the entry.
- * Overrides computed height. */
- int vertLineLength; /* Length of the vertical line
- * segment. */
- short int lineHeight; /* Height of first line of text. */
- unsigned short int flags; /* Flags for this entry. For the
- * definitions of the various bit
- * fields see below. */
- UID tagsUid; /* List of binding tags for this
- * entry. UID, not a string, because
- * in the typical case most entries
- * will have the same bindtags. */
- TreeView *viewPtr;
- UID openCmd, closeCmd; /* TCL commands to invoke when entries
- * are opened or closed. They override
- * those specified globally. */
- /*
- * Button information:
- */
- short int buttonX, buttonY; /* X-Y coordinate offsets from to
- * upper left corner of the entry to
- * the upper-left corner of the
- * button. Used to pick the button
- * quickly */
- TreeViewIcon *icons; /* Tk images displayed for the entry.
- * The first image is the icon
- * displayed to the left of the
- * entry's label. The second is icon
- * displayed when entry is "open". */
- TreeViewIcon *activeIcons; /* Tk images displayed for the entry.
- * The first image is the icon
- * displayed to the left of the
- * entry's label. The second * is icon
- * displayed when entry is "open". */
- short int iconWidth;
- short int iconHeight; /* Maximum dimensions for icons and
- * buttons for this entry. This is
- * used to align the button, icon, and
- * text. */
- /*
- * Label information:
- */
- TextLayout *textPtr;
- short int labelWidth;
- short int labelHeight;
- UID labelUid; /* Text displayed right of the
- * icon. */
- Blt_Font font; /* Font of label. Overrides global
- * font specification. */
- const char *fullName;
- int flatIndex; /* Used to navigate to next/last entry
- * when the view is flat. */
- Tcl_Obj *dataObjPtr; /* pre-fetched data for sorting */
- XColor *color; /* Color of label. If non-NULL,
- * overrides default text color
- * specification. */
- GC gc;
- TreeViewValue *values; /* List of column-related information
- * for each data value in the node.
- * Non-NULL only if there are value
- * entries. */
-};
-
-/*
- * TreeViewButton --
- *
- * A button is the open/close indicator at the far left of the entry. It
- * is displayed as a plus or minus in a solid colored box with optionally
- * an border. It has both "active" and "normal" colors.
- */
-typedef struct {
- XColor *fgColor; /* Foreground color. */
-
- Blt_Background bg; /* Background color. */
-
- XColor *activeFgColor; /* Active foreground color. */
-
- Blt_Background activeBg; /* Active background color. */
-
- GC normalGC;
- GC activeGC;
-
- int reqSize;
-
- int borderWidth;
-
- int openRelief, closeRelief;
-
- int width, height;
-
- TreeViewIcon *icons;
-
-} TreeViewButton;
-
-/*
- * LevelInfo --
- *
- */
-typedef struct {
- int x;
- int iconWidth;
- int labelWidth;
-} LevelInfo;
-
-/*
- * TreeView --
- *
- * A TreeView is a widget that displays an hierarchical table of one
- * or more entries.
- *
- * Entries are positioned in "world" coordinates, referring to the
- * virtual treeview. Coordinate 0,0 is the upper-left corner of the root
- * entry and the bottom is the end of the last entry. The widget's Tk
- * window acts as view port into this virtual space. The treeview's
- * xOffset and yOffset fields specify the location of the view port in
- * the virtual world. Scrolling the viewport is therefore simply
- * changing the xOffset and/or yOffset fields and redrawing.
- *
- * Note that world coordinates are integers, not signed short integers
- * like X11 screen coordinates. It's very easy to create a hierarchy
- * taller than 0x7FFF pixels.
- */
-struct _TreeView {
- Tcl_Interp *interp;
-
- Tcl_Command cmdToken; /* Token for widget's TCL command. */
-
- Blt_Tree tree; /* Token holding internal tree. */
- const char *treeName; /* In non-NULL, is the name of the tree we are
- * attached to */
- Blt_HashEntry *hashPtr;
-
- /* TreeView_ specific fields. */
-
- Tk_Window tkwin; /* Window that embodies the widget. NULL
- * means that the window has been destroyed
- * but the data structures haven't yet been
- * cleaned up.*/
-
- Display *display; /* Display containing widget; needed, among
- * other things, to release resources after
- * tkwin has already gone away. */
-
- Blt_HashTable entryTable; /* Table of entry information, keyed by the
- * node pointer. */
-
- Blt_HashTable columnTable; /* Table of column information. */
- Blt_Chain columns; /* Chain of columns. Same as the hash table
- * above but maintains the order in which
- * columns are displayed. */
-
- unsigned int flags; /* For bitfield definitions, see below */
-
- int inset; /* Total width of all borders, including
- * traversal highlight and 3-D border.
- * Indicates how much interior stuff must be
- * offset from outside edges to leave room for
- * borders. */
-
- Blt_Font font;
- XColor *fgColor;
-
- Blt_Background bg; /* 3D border surrounding the window
- * (viewport). */
- Blt_Background altBg;
-
- int borderWidth; /* Width of 3D border. */
-
- int relief; /* 3D border relief. */
-
- int highlightWidth; /* Width in pixels of highlight to draw around
- * widget when it has the focus. <= 0 means
- * don't draw a highlight. */
-
- XColor *highlightBgColor; /* Color for drawing traversal highlight area
- * when highlight is off. */
-
- XColor *highlightColor; /* Color for drawing traversal highlight. */
-
- const char *pathSep; /* Pathname separators */
-
- const char *trimLeft; /* Leading characters to trim from
- * pathnames */
-
- /*
- * Entries are connected by horizontal and vertical lines. They may be
- * drawn dashed or solid.
- */
- int lineWidth; /* Width of lines connecting entries */
-
- int dashes; /* Dash on-off value. */
-
- XColor *lineColor; /* Color of connecting lines. */
-
- /*
- * Button Information:
- *
- * The button is the open/close indicator at the far left of the entry.
- * It is usually displayed as a plus or minus in a solid colored box with
- * optionally an border. It has both "active" and "normal" colors.
- */
- TreeViewButton button;
-
- /*
- * Selection Information:
- *
- * The selection is the rectangle that contains a selected entry. There
- * may be many selected entries. It is displayed as a solid colored box
- * with optionally a 3D border.
- */
- int selRelief; /* Relief of selected items. Currently is
- * always raised. */
-
- int selBW; /* Border width of a selected entry.*/
-
- XColor *selFgColor; /* Text color of a selected entry. */
- Blt_Background selBg;
-
- TreeViewEntry *selAnchorPtr; /* Fixed end of selection (i.e. entry
- * at which selection was started.) */
- TreeViewEntry *selMarkPtr;
-
- GC selGC;
- int selectMode; /* Selection style: "single" or
- * "multiple". */
-
- const char *selectCmd; /* TCL script that's invoked whenever the
- * selection changes. */
-
- Blt_HashTable selectTable; /* Hash table of currently selected
- * entries. */
-
- Blt_Chain selected; /* Chain of currently selected entries.
- * Contains the same information as the
- * above hash table, but maintains the
- * order in which entries are
- * selected. */
-
- int leader; /* Number of pixels padding between
- * entries. */
-
- Tk_Cursor cursor; /* X Cursor */
-
- Tk_Cursor resizeCursor; /* Resize Cursor */
-
- int reqWidth, reqHeight; /* Requested dimensions of the treeview
- * widget's window. */
-
- GC lineGC; /* GC for drawing dotted line between
- * entries. */
-
- XColor *focusColor;
-
- Blt_Dashes focusDashes; /* Dash on-off value. */
-
- GC focusGC; /* Graphics context for the active
- * label. */
-
- Tk_Window comboWin;
-
- TreeViewEntry *activePtr; /* Last active entry. */
-
- TreeViewEntry *focusPtr; /* Entry that currently has focus. */
-
- TreeViewEntry *activeBtnPtr; /* Pointer to last active button */
-
- TreeViewEntry *fromPtr;
-
- TreeViewValue *activeValuePtr; /* Last active value. */
-
- int xScrollUnits, yScrollUnits; /* # of pixels per scroll unit. */
-
- /* Command strings to control horizontal and vertical scrollbars. */
- Tcl_Obj *xScrollCmdObjPtr, *yScrollCmdObjPtr;
-
- int scrollMode; /* Selects mode of scrolling: either
- * BLT_SCROLL_MODE_HIERBOX,
- * BLT_SCROLL_MODE_LISTBOX, or
- * BLT_SCROLL_MODE_CANVAS. */
- /*
- * Total size of all "open" entries. This represents the range of world
- * coordinates.
- */
- int worldWidth, worldHeight;
-
- int xOffset, yOffset; /* Translation between view port and
- * world origin. */
- short int minHeight; /* Minimum entry height. Used to to
- * compute what the y-scroll unit
- * should * be. */
- short int titleHeight; /* Height of column titles. */
-
- LevelInfo *levelInfo;
-
- /* Scanning information: */
- int scanAnchorX, scanAnchorY; /* Scan anchor in screen
- * coordinates. */
- int scanX, scanY; /* X-Y world coordinate where the scan
- * started. */
- Blt_HashTable iconTable; /* Table of Tk images */
- Blt_HashTable uidTable; /* Table of strings. */
- Blt_HashTable styleTable; /* Table of cell styles. */
- Blt_Chain userStyles; /* List of user-created styles. */
- TreeViewEntry *rootPtr; /* Root entry of tree. */
- TreeViewEntry **visibleArr; /* Array of visible entries. */
- int nVisible; /* # of entries in the visible array. */
- int nEntries; /* # of entries in tree. */
- int treeWidth; /* Computed width of the tree. */
-
- int buttonFlags; /* Global button indicator for all
- * entries. This may be overridden by
- * the entry's -button option. */
-
- const char *openCmd, *closeCmd; /* TCL commands to invoke when entries
- * are opened or closed. */
-
- TreeViewIcon *icons; /* Tk images displayed for the entry.
- * The first image is the icon
- * displayed to the left of the
- * entry's label. The second is icon
- * displayed when entry is "open". */
- TreeViewIcon *activeIcons; /* Tk images displayed for the entry.
- * The first image is the icon
- * displayed to the left of the
- * entry's label. The second is icon
- * displayed when entry is "open". */
- const char *takeFocus;
-
- ClientData clientData;
-
- Blt_BindTable bindTable; /* Binding information for entries. */
-
- Blt_HashTable entryTagTable;
- Blt_HashTable buttonTagTable;
- Blt_HashTable columnTagTable;
- Blt_HashTable styleTagTable;
-
- TreeViewStyle *stylePtr; /* Default style for text cells */
-
- TreeViewColumn treeColumn;
-
- TreeViewColumn *activeColumnPtr;
- TreeViewColumn *activeTitleColumnPtr;/* Column title currently active. */
-
- TreeViewColumn *resizeColumnPtr; /* Column that is being resized. */
-
- size_t depth;
- int flatView; /* Indicates if the view of the tree
- * has been flattened. */
- TreeViewEntry **flatArr; /* Flattened array of entries. */
- const char *sortField; /* Field to be sorted. */
-
- int sortType; /* Type of sorting to be
- * performed. See below for valid
- * values. */
- Tcl_Obj *sortCmdPtr; /* Sort command. */
-
- int sortDecreasing; /* Indicates entries should be sorted
- * in decreasing order. */
- int viewIsDecreasing; /* Current sorting direction */
-
- TreeViewColumn *sortColumnPtr; /* Column to use for sorting
- * criteria. */
-
- Tcl_Obj *iconVarObjPtr; /* Name of TCL variable. If non-NULL,
- * this variable will be set to the
- * name of the Tk image representing
- * the icon of the selected item. */
- Tcl_Obj *textVarObjPtr; /* Name of TCL variable. If non-NULL,
- * this variable will be set to the
- * text string of the label of the
- * selected item. */
-#ifdef notdef
- Pixmap drawable; /* Pixmap used to cache the entries
- * displayed. The pixmap is saved so
- * that only selected elements can be
- * drawn quicky. */
- short int drawWidth, drawHeight;
-#endif
- short int ruleAnchor, ruleMark;
-
- Blt_Pool entryPool;
- Blt_Pool valuePool;
-};
-
-BLT_EXTERN UID Blt_TreeView_GetUid(TreeView *viewPtr, const char *string);
-BLT_EXTERN void Blt_TreeView_FreeUid(TreeView *viewPtr, UID uid);
-
-BLT_EXTERN void Blt_TreeView_EventuallyRedraw(TreeView *viewPtr);
-BLT_EXTERN Tcl_ObjCmdProc Blt_TreeView_WidgetInstCmd;
-BLT_EXTERN TreeViewEntry *Blt_TreeView_NearestEntry(TreeView *viewPtr, int x,
- int y, int flags);
-BLT_EXTERN const char *Blt_TreeView_GetFullName(TreeView *viewPtr,
- TreeViewEntry *entryPtr, int checkEntryLabel, Tcl_DString *dsPtr);
-BLT_EXTERN void Blt_TreeView_SelectCmdProc(ClientData clientData);
-BLT_EXTERN void Blt_TreeView_InsertText(TreeView *viewPtr,
- TreeViewEntry *entryPtr, const char *string, int extra, int insertPos);
-BLT_EXTERN void Blt_TreeView_ComputeLayout(TreeView *viewPtr);
-BLT_EXTERN void Blt_TreeView_PercentSubst(TreeView *viewPtr,
- TreeViewEntry *entryPtr, const char *command, Tcl_DString *resultPtr);
-BLT_EXTERN void Blt_TreeView_DrawButton(TreeView *viewPtr,
- TreeViewEntry *entryPtr, Drawable drawable, int x, int y);
-BLT_EXTERN void Blt_TreeView_DrawValue(TreeView *viewPtr,
- TreeViewEntry *entryPtr, TreeViewValue *valuePtr, Drawable drawable,
- int x, int y);
-BLT_EXTERN void Blt_TreeView_DrawOuterBorders(TreeView *viewPtr,
- Drawable drawable);
-BLT_EXTERN int Blt_TreeView_DrawLabel(TreeView *viewPtr,
- TreeViewEntry *entryPtr, Drawable drawable);
-BLT_EXTERN void Blt_TreeView_DrawHeadings(TreeView *viewPtr, Drawable drawable);
-BLT_EXTERN void Blt_TreeView_DrawRule(TreeView *viewPtr, TreeViewColumn *colPtr,
- Drawable drawable);
-BLT_EXTERN void Blt_TreeView_ConfigureButtons(TreeView *viewPtr);
-BLT_EXTERN int Blt_TreeView_UpdateWidget(Tcl_Interp *interp, TreeView *viewPtr);
-BLT_EXTERN int Blt_TreeView_ScreenToIndex(TreeView *viewPtr, int x, int y);
-
-BLT_EXTERN void Blt_TreeView_FreeIcon(TreeView *viewPtr, TreeViewIcon icon);
-BLT_EXTERN TreeViewIcon Blt_TreeView_GetIcon(TreeView *viewPtr,
- const char *iconName);
-BLT_EXTERN void Blt_TreeView_AddValue(TreeViewEntry *entryPtr,
- TreeViewColumn *colPtr);
-BLT_EXTERN int Blt_TreeView_CreateColumn(TreeView *viewPtr,
- TreeViewColumn *colPtr, const char *name, const char *defLabel);
-BLT_EXTERN void Blt_TreeView_DestroyValue(TreeView *viewPtr,
- TreeViewValue *valuePtr);
-BLT_EXTERN TreeViewValue *Blt_TreeView_FindValue(TreeViewEntry *entryPtr,
- TreeViewColumn *colPtr);
-BLT_EXTERN void Blt_TreeView_DestroyColumns(TreeView *viewPtr);
-BLT_EXTERN void Blt_TreeView_AllocateColumnUids(TreeView *viewPtr);
-BLT_EXTERN void Blt_TreeView_FreeColumnUids(TreeView *viewPtr);
-BLT_EXTERN void Blt_TreeView_ConfigureColumn(TreeView *viewPtr,
- TreeViewColumn *colPtr);
-BLT_EXTERN TreeViewColumn *Blt_TreeView_NearestColumn(TreeView *viewPtr,
- int x, int y, ClientData *contextPtr);
-
-BLT_EXTERN int Blt_TreeView_TextOp(TreeView *viewPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-
-BLT_EXTERN int Blt_TreeView_CreateCombobox(TreeView *viewPtr,
- TreeViewEntry *entryPtr, TreeViewColumn *colPtr);
-BLT_EXTERN int Blt_TreeView_CreateEntry(TreeView *viewPtr, Blt_TreeNode node,
- int objc, Tcl_Obj *const *objv, int flags);
-BLT_EXTERN int Blt_TreeView_ConfigureEntry(TreeView *viewPtr,
- TreeViewEntry *entryPtr, int objc, Tcl_Obj *const *objv, int flags);
-BLT_EXTERN int Blt_TreeView_OpenEntry(TreeView *viewPtr,
- TreeViewEntry *entryPtr);
-BLT_EXTERN int Blt_TreeView_CloseEntry(TreeView *viewPtr,
- TreeViewEntry *entryPtr);
-BLT_EXTERN TreeViewEntry *Blt_TreeView_NextEntry(TreeViewEntry *entryPtr,
- unsigned int mask);
-BLT_EXTERN TreeViewEntry *Blt_TreeView_PrevEntry(TreeViewEntry *entryPtr,
- unsigned int mask);
-BLT_EXTERN int Blt_TreeView_GetEntry(TreeView *viewPtr, Tcl_Obj *objPtr,
- TreeViewEntry **entryPtrPtr);
-BLT_EXTERN int Blt_TreeView_EntryIsHidden(TreeViewEntry *entryPtr);
-BLT_EXTERN TreeViewEntry *Blt_TreeView_NextSibling(TreeViewEntry *entryPtr,
- unsigned int mask);
-BLT_EXTERN TreeViewEntry *Blt_TreeView_PrevSibling(TreeViewEntry *entryPtr,
- unsigned int mask);
-BLT_EXTERN TreeViewEntry *Blt_TreeView_FirstChild(TreeViewEntry *parentPtr,
- unsigned int mask);
-BLT_EXTERN TreeViewEntry *Blt_TreeView_LastChild(TreeViewEntry *entryPtr,
- unsigned int mask);
-BLT_EXTERN TreeViewEntry *Blt_TreeView_ParentEntry(TreeViewEntry *entryPtr);
-
-typedef int (TreeViewApplyProc)(TreeView *viewPtr, TreeViewEntry *entryPtr);
-BLT_EXTERN int Blt_TreeView_Apply(TreeView *viewPtr, TreeViewEntry *entryPtr,
- TreeViewApplyProc *proc, unsigned int mask);
-BLT_EXTERN int Blt_TreeView_ColumnOp(TreeView *viewPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-BLT_EXTERN int Blt_TreeView_SortOp(TreeView *viewPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-BLT_EXTERN int Blt_TreeView_GetColumn(Tcl_Interp *interp, TreeView *viewPtr,
- Tcl_Obj *objPtr, TreeViewColumn **colPtrPtr);
-
-BLT_EXTERN void Blt_TreeView_SortFlatView(TreeView *viewPtr);
-BLT_EXTERN void Blt_TreeView_SortView(TreeView *viewPtr);
-
-BLT_EXTERN int Blt_TreeView_EntryIsSelected(TreeView *viewPtr,
- TreeViewEntry *entryPtr);
-BLT_EXTERN void Blt_TreeView_SelectEntry(TreeView *viewPtr,
- TreeViewEntry *entryPtr);
-BLT_EXTERN void Blt_TreeView_DeselectEntry(TreeView *viewPtr,
- TreeViewEntry *entryPtr);
-BLT_EXTERN void Blt_TreeView_PruneSelection(TreeView *viewPtr,
- TreeViewEntry *entryPtr);
-BLT_EXTERN void Blt_TreeView_ClearSelection(TreeView *viewPtr);
-BLT_EXTERN void Blt_TreeView_ClearTags(TreeView *viewPtr,
- TreeViewEntry *entryPtr);
-BLT_EXTERN int Blt_TreeView_FindTaggedEntries(TreeView *viewPtr,
- Tcl_Obj *objPtr, TreeViewTagIter *iterPtr);
-BLT_EXTERN TreeViewEntry *Blt_TreeView_FirstTaggedEntry(
- TreeViewTagIter *iterPtr);
-BLT_EXTERN TreeViewEntry *Blt_TreeView_NextTaggedEntry(
- TreeViewTagIter *iterPtr);
-BLT_EXTERN ClientData Blt_TreeView_ButtonTag(TreeView *viewPtr,
- const char *string);
-BLT_EXTERN ClientData Blt_TreeView_EntryTag(TreeView *viewPtr,
- const char *string);
-BLT_EXTERN ClientData Blt_TreeView_ColumnTag(TreeView *viewPtr,
- const char *string);
-BLT_EXTERN void Blt_TreeView_GetTags(Tcl_Interp *interp, TreeView *viewPtr,
- TreeViewEntry *entryPtr, Blt_List list);
-BLT_EXTERN void Blt_TreeView_TraceColumn(TreeView *viewPtr,
- TreeViewColumn *colPtr);
-BLT_EXTERN TreeViewIcon Blt_TreeView_GetEntryIcon(TreeView *viewPtr,
- TreeViewEntry *entryPtr);
-BLT_EXTERN void Blt_TreeView_SetStyleIcon(TreeView *viewPtr,
- TreeViewStyle *stylePtr, TreeViewIcon icon);
-BLT_EXTERN int Blt_TreeView_GetStyle(Tcl_Interp *interp, TreeView *viewPtr,
- const char *styleName, TreeViewStyle **stylePtrPtr);
-BLT_EXTERN void Blt_TreeView_FreeStyle(TreeView *viewPtr,
- TreeViewStyle *stylePtr);
-BLT_EXTERN TreeViewStyle *Blt_TreeView_CreateStyle(Tcl_Interp *interp,
- TreeView *viewPtr, int type, const char *styleName);
-BLT_EXTERN void Blt_TreeView_UpdateStyleGCs(TreeView *viewPtr,
- TreeViewStyle *stylePtr);
-BLT_EXTERN Blt_Background Blt_TreeView_GetStyleBackground(TreeView *viewPtr,
- TreeViewStyle *stylePtr);
-BLT_EXTERN GC Blt_TreeView_GetStyleGC(TreeViewStyle *stylePtr);
-BLT_EXTERN Blt_Font Blt_TreeView_GetStyleFont(TreeView *viewPtr,
- TreeViewStyle *stylePtr);
-BLT_EXTERN XColor *Blt_TreeView_GetStyleFg(TreeView *viewPtr,
- TreeViewStyle *stylePtr);
-BLT_EXTERN TreeViewEntry *Blt_TreeView_NodeToEntry(TreeView *viewPtr,
- Blt_TreeNode node);
-BLT_EXTERN int Blt_TreeView_StyleOp(TreeView *viewPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-BLT_EXTERN TreeViewEntry *Blt_TreeView_FindEntry(TreeView *viewPtr,
- Blt_TreeNode node);
-BLT_EXTERN int Blt_TreeView_CreateTextbox(TreeView *viewPtr,
- TreeViewEntry *entryPtr, TreeViewColumn *colPtr);
-
-#define CHOOSE(default, override) \
- (((override) == NULL) ? (default) : (override))
-
-#define GETLABEL(e) \
- (((e)->labelUid != NULL)? (e)->labelUid : Blt_Tree_NodeLabel((e)->node))
-
-#define Blt_TreeView_GetData(entryPtr, key, objPtrPtr) \
- Blt_Tree_GetValueByKey((Tcl_Interp *)NULL, (entryPtr)->viewPtr->tree, \
- (entryPtr)->node, key, objPtrPtr)
-
-#endif /* BLT_TREEVIEW_H */
diff --git a/blt3.0.1/src/bltTreeXml.c b/blt3.0.1/src/bltTreeXml.c
deleted file mode 100644
index 2ea76e6..0000000
--- a/blt3.0.1/src/bltTreeXml.c
+++ /dev/null
@@ -1,1040 +0,0 @@
-
-/*
- *
- * bltTreeXml.c --
- *
- * Copyright 1998-2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <blt.h>
-
-#include "config.h"
-#include <tcl.h>
-
-#include <bltSwitch.h>
-#include <bltAssert.h>
-#include <bltAlloc.h>
-#include <bltTree.h>
-#include <string.h>
-
-#ifdef HAVE_CTYPE_H
-# include <ctype.h>
-#endif /* HAVE_CTYPE_H */
-
-#define TRUE 1
-#define FALSE 0
-/*
- * The macro below is used to modify a "char" value (e.g. by casting
- * it to an unsigned character) so that it can be used safely with
- * macros such as isspace.
- */
-#define UCHAR(c) ((unsigned char) (c))
-
-DLLEXPORT extern Tcl_AppInitProc Blt_TreeXmlInit;
-
-static Blt_TreeImportProc ImportXmlProc;
-static Blt_TreeExportProc ExportXmlProc;
-
-extern char *Blt_Itoa(int);
-
-/*
- * Format Import Export
- * xml file/data file/data
- * html file/data file/data
- *
- * $tree import xml $node fileName -data dataString
- * $table export xml $node -file defaultFileName
- * $tree import html $node -file fileName -data dataString
- * $table export html $node -file defaultFileName
- */
-
-/*
- * ImportSwitches --
- */
-typedef struct {
- Tcl_Obj *fileObj; /* Name of file representing the channel. */
- Tcl_Obj *dataObj;
- Tcl_Interp *interp;
- unsigned int flags;
- Blt_TreeNode root;
-} ImportSwitches;
-
-#define IMPORT_TRIMCDATA (1<<0)
-#define IMPORT_OVERWRITE (1<<1)
-
-#define IMPORT_ATTRIBUTES (1<<2)
-#define IMPORT_BASEURI (1<<3)
-#define IMPORT_CDATA (1<<4)
-#define IMPORT_COMMENTS (1<<5)
-#define IMPORT_DTD (1<<6)
-#define IMPORT_LOCATION (1<<7)
-#define IMPORT_PI (1<<8)
-#define IMPORT_NS (1<<9)
-#define IMPORT_ALL (IMPORT_ATTRIBUTES | IMPORT_COMMENTS | IMPORT_CDATA |\
- IMPORT_DTD | IMPORT_PI | IMPORT_LOCATION | \
- IMPORT_BASEURI)
-
-#define SYM_BASEURI "#baseuri"
-#define SYM_BYTEIDX "#byteindex"
-#define SYM_CDATA "#cdata"
-#define SYM_COLNO "#column"
-#define SYM_COMMENT "#comment"
-#define SYM_LINENO "#line"
-#define SYM_NS "#namespace"
-#define SYM_NOTATION "#notation"
-#define SYM_PI "#pi"
-#define SYM_PUBID "#publicid"
-#define SYM_SYSID "#systemid"
-
-extern Blt_SwitchParseProc Blt_TreeNodeSwitchProc;
-
-static Blt_SwitchCustom nodeSwitch = {
- Blt_TreeNodeSwitchProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchSpec importSwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-all", "",
- Blt_Offset(ImportSwitches, flags), 0, IMPORT_ALL},
- {BLT_SWITCH_BOOLEAN, "-comments", "bool",
- Blt_Offset(ImportSwitches, flags), 0, IMPORT_COMMENTS},
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(ImportSwitches, dataObj), 0, 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(ImportSwitches, fileObj), 0, 0},
- {BLT_SWITCH_BOOLEAN, "-locations", "bool",
- Blt_Offset(ImportSwitches, flags), 0, IMPORT_LOCATION},
- {BLT_SWITCH_CUSTOM, "-root", "node",
- Blt_Offset(ImportSwitches, root), 0, 0, &nodeSwitch},
- {BLT_SWITCH_BOOLEAN, "-attributes", "bool",
- Blt_Offset(ImportSwitches, flags), 0, IMPORT_ATTRIBUTES},
- {BLT_SWITCH_BOOLEAN, "-namespace", "bool",
- Blt_Offset(ImportSwitches, flags), 0, IMPORT_NS},
- {BLT_SWITCH_BOOLEAN, "-cdata", "bool",
- Blt_Offset(ImportSwitches, flags), 0, IMPORT_CDATA},
- {BLT_SWITCH_BOOLEAN, "-overwrite", "bool",
- Blt_Offset(ImportSwitches, flags), 0, IMPORT_OVERWRITE},
- {BLT_SWITCH_BOOLEAN, "-processinginstructions", "bool",
- Blt_Offset(ImportSwitches, flags), 0, IMPORT_PI},
- {BLT_SWITCH_BOOLEAN, "-trimwhitespace", "bool",
- Blt_Offset(ImportSwitches, flags), 0, IMPORT_TRIMCDATA},
- {BLT_SWITCH_END}
-};
-
-/*
- * ExportSwitches --
- */
-typedef struct {
- Tcl_Obj *fileObj;
- Tcl_Obj *dataObj;
- Blt_TreeNode root;
-
- /* Private fields. */
- Tcl_Interp *interp;
- unsigned int flags;
- Tcl_Channel channel; /* If non-NULL, channel to write output to. */
- Tcl_DString *dsPtr;
-} ExportSwitches;
-
-static Blt_SwitchSpec exportSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-data", "data",
- Blt_Offset(ExportSwitches, dataObj), 0, 0},
- {BLT_SWITCH_OBJ, "-file", "fileName",
- Blt_Offset(ExportSwitches, fileObj), 0, 0},
- {BLT_SWITCH_END}
-};
-
-#ifdef HAVE_LIBEXPAT
-#include <expat.h>
-
-typedef struct {
- Blt_Tree tree;
- Blt_TreeNode root;
- Blt_TreeNode parent;
- Tcl_Interp *interp;
- int flags;
- Blt_HashTable stringTable;
- XML_Parser parser;
-} ImportData;
-
-
-static Tcl_Obj *
-GetStringObj(ImportData *importPtr, const char *string)
-{
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&importPtr->stringTable, string, &isNew);
- if (isNew) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(string, -1);
- Tcl_IncrRefCount(objPtr);
- Blt_SetHashValue(hPtr, objPtr);
- return objPtr;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-static const char *
-GetBaseUri(ImportData *importPtr, Blt_TreeNode node)
-{
- Blt_TreeNode top;
-
- top = Blt_Tree_ParentNode(importPtr->root);
- do {
- if (Blt_Tree_ValueExists(importPtr->tree, node, SYM_BASEURI)) {
- Tcl_Obj *objPtr;
-
- if (Blt_Tree_GetValue((Tcl_Interp *)NULL, importPtr->tree, node,
- SYM_BASEURI, &objPtr) == TCL_OK) {
- return Tcl_GetString(objPtr);
- }
- }
- node = Blt_Tree_ParentNode(node);
- } while (node != top);
- return NULL;
-}
-
-static void
-SetLocation(ImportData *importPtr, Blt_TreeNode node)
-{
- Blt_Tree_SetValue(importPtr->interp, importPtr->tree, node, SYM_LINENO,
- Tcl_NewIntObj(XML_GetCurrentLineNumber(importPtr->parser)));
- Blt_Tree_SetValue(importPtr->interp, importPtr->tree, node, SYM_COLNO,
- Tcl_NewIntObj(XML_GetCurrentColumnNumber(importPtr->parser)));
- Blt_Tree_SetValue(importPtr->interp, importPtr->tree, node, SYM_BYTEIDX,
- Tcl_NewLongObj(XML_GetCurrentByteIndex(importPtr->parser)));
-}
-
-static void
-GetNotationProc(
- void *userData,
- const XML_Char *notationName,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId)
-{
- ImportData *importPtr = userData;
-
- if (publicId != NULL) {
- Blt_Tree_SetValue(importPtr->interp, importPtr->tree,
- importPtr->parent, SYM_PUBID, Tcl_NewStringObj(publicId, -1));
- }
- if (systemId != NULL) {
- Blt_Tree_SetValue(importPtr->interp, importPtr->tree,
- importPtr->parent, SYM_SYSID, Tcl_NewStringObj(systemId, -1));
- }
- if (base != NULL) {
- Blt_Tree_SetValue(importPtr->interp, importPtr->tree,
- importPtr->parent, SYM_BASEURI, Tcl_NewStringObj(base, -1));
- }
- if (notationName != NULL) {
- Blt_Tree_SetValue(importPtr->interp, importPtr->tree,
- importPtr->parent, SYM_NOTATION,
- Tcl_NewStringObj(notationName, -1));
- }
-}
-
-static void
-GetCommentProc(void *userData, const XML_Char *string)
-{
- ImportData *importPtr = userData;
-
- if ((importPtr->flags & IMPORT_DTD) == 0) {
- Blt_Tree tree;
- Blt_TreeNode child;
- Tcl_Obj *objPtr;
-
- tree = importPtr->tree;
- objPtr = GetStringObj(importPtr, string);
- child = Blt_Tree_CreateNode(tree, importPtr->parent, SYM_COMMENT, -1);
- Blt_Tree_SetValue(importPtr->interp, tree, child, SYM_COMMENT, objPtr);
- if (importPtr->flags & IMPORT_LOCATION) {
- SetLocation(importPtr, child);
- }
- }
-}
-
-static void
-GetProcessingInstructionProc(
- void *userData,
- const char *target,
- const char *data)
-{
- ImportData *importPtr = userData;
-
- if ((importPtr->flags & IMPORT_DTD) == 0) {
- Tcl_Obj *objPtr;
- Blt_Tree tree;
- Blt_TreeNode child;
-
- tree = importPtr->tree;
- objPtr = GetStringObj(importPtr, data);
- child = Blt_Tree_CreateNode(tree, importPtr->parent, SYM_PI, -1);
- Blt_Tree_SetValue(importPtr->interp, tree, child, target, objPtr);
- if (importPtr->flags & IMPORT_LOCATION) {
- SetLocation(importPtr, child);
- }
- }
-}
-
-static void
-GetCharacterDataProc(void *userData, const XML_Char *string, int length)
-{
- ImportData *importPtr = userData;
- Blt_Tree tree;
- Blt_TreeNode child;
- Tcl_Obj *objPtr;
-
- if (importPtr->flags & IMPORT_TRIMCDATA) {
- const char *p, *pend;
-
- for (p = string, pend = p + length; p < pend; p++) {
- if (!isspace(UCHAR(*p))) {
- break;
- }
- }
- if (p == pend) {
- return;
- }
- length = pend - p;
- string = p;
- }
- tree = importPtr->tree;
- child = Blt_Tree_LastChild(importPtr->parent);
- if ((child != NULL) && (strcmp(Blt_Tree_NodeLabel(child), SYM_CDATA)==0)) {
-
- /* Last child added was a CDATA node, append new data to it. */
-
- if (Blt_Tree_GetValue(importPtr->interp, tree, child, SYM_CDATA,
- &objPtr) == TCL_OK) {
- Tcl_AppendToObj(objPtr, string, length);
- return;
- }
- }
- objPtr = Tcl_NewStringObj(string, length);
- child = Blt_Tree_CreateNode(tree, importPtr->parent, SYM_CDATA,-1);
- Blt_Tree_SetValue(importPtr->interp, tree, child, SYM_CDATA, objPtr);
- if (importPtr->flags & IMPORT_LOCATION) {
- SetLocation(importPtr, child);
- }
-}
-
-static void
-DumpStringTable(Blt_HashTable *tablePtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(tablePtr, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Tcl_Obj *objPtr;
-
- objPtr = Blt_GetHashValue(hPtr);
- Tcl_DecrRefCount(objPtr);
- }
- Blt_DeleteHashTable(tablePtr);
-}
-
-static void
-StartDocTypeProc(
- void *userData,
- const char *doctypeName,
- const char *systemId,
- const char *publicId,
- int has_internal_subset)
-{
- ImportData *importPtr = userData;
-
- if (publicId != NULL) {
- Blt_Tree_SetValue(importPtr->interp, importPtr->tree, importPtr->root,
- SYM_PUBID, Tcl_NewStringObj(publicId, -1));
- }
- if (systemId != NULL) {
- Blt_Tree_SetValue(importPtr->interp, importPtr->tree, importPtr->root,
- SYM_SYSID, Tcl_NewStringObj(systemId, -1));
- }
- importPtr->flags |= IMPORT_DTD;
-}
-
-static void
-EndDocTypeProc(void *userData)
-{
- ImportData *importPtr = userData;
-
- importPtr->flags &= ~IMPORT_DTD;
-}
-
-
-
-static void
-StartElementProc(void *userData, const char *element, const char **attr)
-{
- Blt_TreeNode child;
- ImportData *importPtr = userData;
- Blt_Tree tree;
-
- tree = importPtr->tree;
- child = NULL;
- if (importPtr->flags & IMPORT_OVERWRITE) {
- child = Blt_Tree_FindChild(importPtr->parent, element);
- }
- if (child == NULL) {
- child = Blt_Tree_CreateNode(tree, importPtr->parent, element, -1);
- }
- if (importPtr->flags & IMPORT_ATTRIBUTES) {
- const char **p;
-
- for (p = attr; *p != NULL; p += 2) {
- Tcl_Obj *objPtr;
-
- objPtr = GetStringObj(importPtr, *(p+1));
- Blt_Tree_SetValue(importPtr->interp, tree, child, *p, objPtr);
- }
- }
- if (importPtr->flags & IMPORT_LOCATION) {
- SetLocation(importPtr, child);
- }
- if (importPtr->flags & IMPORT_BASEURI) {
- const char *oldBase, *newBase;
-
- newBase = XML_GetBase(importPtr->parser);
- oldBase = GetBaseUri(importPtr, importPtr->parent);
- assert(oldBase != NULL);
- if (strcmp(oldBase, newBase) != 0) {
- Blt_Tree_SetValue(importPtr->interp, tree, importPtr->parent,
- SYM_BASEURI, Tcl_NewStringObj(newBase, -1));
- }
- }
- importPtr->parent = child; /* Increase depth. */
-}
-
-static void
-EndElementProc(void *userData, const char *element)
-{
- ImportData *importPtr = userData;
-
- importPtr->parent = Blt_Tree_ParentNode(importPtr->parent);
-}
-
-static int
-ReadXmlFromFile(
- Tcl_Interp *interp,
- XML_Parser parser,
- const char *fileName)
-{
- int closeChannel;
- int done;
- Tcl_Channel channel;
-
- closeChannel = TRUE;
- if ((fileName[0] == '@') && (fileName[1] != '\0')) {
- int mode;
-
- channel = Tcl_GetChannel(interp, fileName+1, &mode);
- if (channel == NULL) {
- return FALSE;
- }
- if ((mode & TCL_READABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", fileName,
- "\" not opened for reading", (char *)NULL);
- return FALSE;
- }
- closeChannel = FALSE;
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "r", 0);
- if (channel == NULL) {
- return FALSE; /* Can't open dump file. */
- }
- }
- done = FALSE;
- while (!done) {
- int length;
-#define BUFFSIZE 8191
- char buffer[BUFFSIZE+1];
-
- length = Tcl_Read(channel, buffer, sizeof(char) * BUFFSIZE);
- if (length < 0) {
- Tcl_AppendResult(interp, "\nread error: ", Tcl_PosixError(interp),
- (char *)NULL);
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- return FALSE;
- }
- done = Tcl_Eof(channel);
- if (!XML_Parse(parser, buffer, length, done)) {
- Tcl_AppendResult(interp, "\n", fileName, ":",
- Blt_Itoa(XML_GetCurrentLineNumber(parser)), ": ",
- "error: ",
- XML_ErrorString(XML_GetErrorCode(parser)),
- (char *)NULL);
- Tcl_AppendResult(interp, "\n", fileName, ":",
- Blt_Itoa(XML_GetCurrentByteIndex(parser)), ": ",
- "error: ",
- XML_ErrorString(XML_GetErrorCode(parser)),
- (char *)NULL);
- fprintf(stderr, "buffer=%.*s\n",
- (int)XML_GetCurrentByteIndex(parser),
- buffer);
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- return FALSE;
- }
- }
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- return TRUE;
-}
-
-
-static int
-GetExternalEntityRefProc(
- XML_Parser parser,
- const XML_Char *context,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId)
-{
- ImportData *importPtr;
- Tcl_DString ds;
- Tcl_Interp *interp;
- XML_Parser newParser, oldParser;
- int result;
-
- importPtr = XML_GetUserData(parser);
- assert(importPtr != NULL);
- interp = importPtr->interp;
- Tcl_DStringInit(&ds);
- if ((base != NULL) && (Tcl_GetPathType(systemId) == TCL_PATH_RELATIVE)) {
- const char **argv;
- const char **baseNames, **sysIdNames;
- int argc;
- int i, j;
- int nBase, nSysId;
-
- Tcl_SplitPath(base, &nBase, &baseNames);
- Tcl_SplitPath(systemId, &nSysId, &sysIdNames);
- argc = nBase + nSysId;
- argv = Blt_Malloc(sizeof(char *) * (argc + 1));
- if (argv == NULL) {
- return FALSE;
- }
- for (i = 0; i < nBase; i++) {
- argv[i] = baseNames[i];
- }
- for (j = 0; j < nSysId; j++, i++) {
- argv[i] = sysIdNames[j];
- }
- argv[i] = NULL;
- Tcl_JoinPath(argc, argv, &ds);
- Blt_Free(baseNames);
- Blt_Free(sysIdNames);
- Blt_Free(argv);
- } else {
- Tcl_DStringAppend(&ds, systemId, -1);
- }
- newParser = XML_ExternalEntityParserCreate(parser, context, NULL);
- if (newParser == NULL) {
- Tcl_AppendResult(interp, "can't create external entity ref parser",
- (char *)NULL);
- return FALSE;
- }
- oldParser = importPtr->parser;
- importPtr->parser = newParser;
- result = ReadXmlFromFile(interp, newParser, Tcl_DStringValue(&ds));
- importPtr->parser = oldParser;
- Tcl_DStringFree(&ds);
- XML_ParserFree(newParser);
- return result;
-}
-
-static int
-ImportXmlFile(
- Tcl_Interp *interp,
- Blt_Tree tree,
- Blt_TreeNode parent,
- Tcl_Obj *objPtr,
- unsigned int flags)
-{
- ImportData import;
- XML_Parser parser;
- int result;
- char *fileName;
-
- if (flags & IMPORT_NS) {
- parser = XML_ParserCreateNS(NULL, ':');
- } else {
- parser = XML_ParserCreate(NULL);
- }
- if (parser == NULL) {
- Tcl_AppendResult(interp, "can't create XML parser", (char *)NULL);
- return TCL_ERROR;
- }
- import.flags = flags;
- import.interp = interp;
- import.parent = parent;
- import.parser = parser;
- import.root = parent;
- import.tree = tree;
- Blt_InitHashTable(&import.stringTable, BLT_STRING_KEYS);
- XML_SetUserData(parser, &import);
-
- fileName = Tcl_GetString(objPtr);
- /* Set baseURI */
- {
- Tcl_DString ds;
- int argc;
- const char **argv;
-
- Tcl_DStringInit(&ds);
- Tcl_SplitPath(fileName, &argc, &argv);
- Tcl_JoinPath(argc - 1, argv, &ds);
- XML_SetBase(parser, Tcl_DStringValue(&ds));
- if (flags & IMPORT_BASEURI) {
- Blt_Tree_SetValue(interp, tree, parent, SYM_BASEURI,
- Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)));
- }
- Blt_Free(argv);
- Tcl_DStringFree(&ds);
- }
- XML_SetExternalEntityRefHandler(parser, GetExternalEntityRefProc);
- XML_SetElementHandler(parser, StartElementProc, EndElementProc);
- if (flags & IMPORT_CDATA) {
- XML_SetCharacterDataHandler(parser, GetCharacterDataProc);
- }
- if (flags & IMPORT_BASEURI) {
- XML_SetNotationDeclHandler(parser, GetNotationProc);
- XML_SetDoctypeDeclHandler(parser, StartDocTypeProc, EndDocTypeProc);
- }
- if (flags & IMPORT_PI) {
- XML_SetProcessingInstructionHandler(parser,
- GetProcessingInstructionProc);
- }
- if (flags & IMPORT_COMMENTS) {
- XML_SetCommentHandler(parser, GetCommentProc);
- }
- result = ReadXmlFromFile(interp, parser, fileName);
- XML_ParserFree(parser);
- DumpStringTable(&import.stringTable);
- return (result) ? TCL_OK : TCL_ERROR;
-}
-
-
-static int
-ImportXmlData(
- Tcl_Interp *interp,
- Blt_Tree tree,
- Blt_TreeNode parent,
- Tcl_Obj *dataObjPtr,
- unsigned int flags)
-{
- ImportData import;
- XML_Parser parser;
- char *string;
- int length;
- int result;
-
- if (flags & IMPORT_NS) {
- parser = XML_ParserCreateNS(NULL, ':');
- } else {
- parser = XML_ParserCreate(NULL);
- }
- if (parser == NULL) {
- Tcl_AppendResult(interp, "can't create parser", (char *)NULL);
- return TCL_ERROR;
- }
- import.flags = flags;
- import.interp = interp;
- import.parent = parent;
- import.parser = parser;
- import.root = parent;
- import.tree = tree;
- Blt_InitHashTable(&import.stringTable, BLT_STRING_KEYS);
- XML_SetBase(parser, ".");
- XML_SetUserData(parser, &import);
- XML_SetExternalEntityRefHandler(parser, GetExternalEntityRefProc);
- XML_SetElementHandler(parser, StartElementProc, EndElementProc);
- if (flags & IMPORT_CDATA) {
- XML_SetCharacterDataHandler(parser, GetCharacterDataProc);
- }
- if (flags & IMPORT_BASEURI) {
- XML_SetNotationDeclHandler(parser, GetNotationProc);
- XML_SetDoctypeDeclHandler(parser, StartDocTypeProc, EndDocTypeProc);
- }
- if (flags & IMPORT_PI) {
- XML_SetProcessingInstructionHandler(parser,
- GetProcessingInstructionProc);
- }
- if (flags & IMPORT_COMMENTS) {
- XML_SetCommentHandler(parser, GetCommentProc);
- }
- string = Tcl_GetStringFromObj(dataObjPtr, &length);
- result = XML_Parse(parser, string, length, 1);
- if (!result) {
- Tcl_AppendResult(interp, "\nparse error at line ",
- Blt_Itoa(XML_GetCurrentLineNumber(parser)), ": ",
- XML_ErrorString(XML_GetErrorCode(parser)),
- (char *)NULL);
- }
- XML_ParserFree(parser);
- DumpStringTable(&import.stringTable);
- return (result) ? TCL_OK : TCL_ERROR;
-}
-
-static int
-ImportXmlProc(
- Tcl_Interp *interp,
- Blt_Tree tree,
- int objc,
- Tcl_Obj *const *objv)
-{
- int result;
- ImportSwitches switches;
-
- memset(&switches, 0, sizeof(switches));
- nodeSwitch.clientData = tree;
- switches.root = Blt_Tree_RootNode(tree);
- switches.flags = IMPORT_ATTRIBUTES | IMPORT_CDATA;
- if (Blt_ParseSwitches(interp, importSwitches, objc - 3, objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- result = TCL_ERROR;
- if ((switches.dataObj != NULL) && (switches.fileObj != NULL)) {
- Tcl_AppendResult(interp, "can't set both -file and -data switches.",
- (char *)NULL);
- goto error;
- }
- if (switches.fileObj != NULL) {
- result = ImportXmlFile(interp, tree, switches.root, switches.fileObj,
- switches.flags);
- } else if (switches.dataObj != NULL) {
- result = ImportXmlData(interp, tree, switches.root, switches.dataObj,
- switches.flags);
- } else {
- result = TCL_OK;
- }
- error:
- Blt_FreeSwitches(importSwitches, (char *)&switches, 0);
- return result;
-}
-
-#endif /* HAVE_LIBEXPAT */
-
-static int
-XmlFlush(ExportSwitches *exportPtr)
-{
- int nWritten;
- char *line;
- int length;
-
- line = Tcl_DStringValue(exportPtr->dsPtr);
- length = Tcl_DStringLength(exportPtr->dsPtr);
- nWritten = Tcl_Write(exportPtr->channel, line, length);
- if (nWritten != length) {
- Tcl_AppendResult(exportPtr->interp, "can't write xml element: ",
- Tcl_PosixError(exportPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_DStringSetLength(exportPtr->dsPtr, 0);
- return TCL_OK;
-}
-
-static void
-XmlPutEscapeString(const char *from, size_t length, ExportSwitches *exportPtr)
-{
- const char *p, *pend;
-
- for (p = from, pend = from + length; p < pend; /*empty*/) {
- switch (*p) {
- case '\'':
- if (p > from) {
- Tcl_DStringAppend(exportPtr->dsPtr, from, p - from);
- }
- from = ++p;
- Tcl_DStringAppend(exportPtr->dsPtr, "'", 6);
- break;
- case '&':
- if (p > from) {
- Tcl_DStringAppend(exportPtr->dsPtr, from, p - from);
- }
- from = ++p;
- Tcl_DStringAppend(exportPtr->dsPtr, "&", 5);
- break;
- case '>':
- if (p > from) {
- Tcl_DStringAppend(exportPtr->dsPtr, from, p - from);
- }
- from = ++p;
- Tcl_DStringAppend(exportPtr->dsPtr, ">", 4);
- break;
- case '<':
- if (p > from) {
- Tcl_DStringAppend(exportPtr->dsPtr, from, p - from);
- }
- from = ++p;
- Tcl_DStringAppend(exportPtr->dsPtr, "<", 4);
- break;
- case '"':
- if (p > from) {
- Tcl_DStringAppend(exportPtr->dsPtr, from, p - from);
- }
- from = ++p;
- Tcl_DStringAppend(exportPtr->dsPtr, """, 6);
- break;
- default:
- p++;
- break;
- }
- }
- if (p > from) {
- Tcl_DStringAppend(exportPtr->dsPtr, from, p - from);
- }
-}
-
-static void
-XmlOpenStartElement(ExportSwitches *exportPtr, Blt_TreeNode node)
-{
- size_t i;
-
- if (exportPtr->channel != NULL) {
- Tcl_DStringSetLength(exportPtr->dsPtr, 0);
- }
- for (i = 0; i < Blt_Tree_NodeDepth(node); i++) {
- Tcl_DStringAppend(exportPtr->dsPtr, " ", 2);
- }
- Tcl_DStringAppend(exportPtr->dsPtr, "<", 1);
- Tcl_DStringAppend(exportPtr->dsPtr, Blt_Tree_NodeLabel(node), -1);
-}
-
-static int
-XmlCloseStartElement(ExportSwitches *exportPtr)
-{
- Tcl_DStringAppend(exportPtr->dsPtr, ">\n", 2);
- if (exportPtr->channel != NULL) {
- return XmlFlush(exportPtr);
- }
- return TCL_OK;
-}
-
-static int
-XmlEndElement(ExportSwitches *exportPtr, Blt_TreeNode node)
-{
- size_t i;
-
- Tcl_DStringAppend(exportPtr->dsPtr, "\n", 1);
- for (i = 0; i < Blt_Tree_NodeDepth(node); i++) {
- Tcl_DStringAppend(exportPtr->dsPtr, " ", 2);
- }
- Tcl_DStringAppend(exportPtr->dsPtr, "</", 2);
- Tcl_DStringAppend(exportPtr->dsPtr, Blt_Tree_NodeLabel(node), -1);
- Tcl_DStringAppend(exportPtr->dsPtr, ">\n", 2);
- if (exportPtr->channel != NULL) {
- return XmlFlush(exportPtr);
- }
- return TCL_OK;
-}
-
-static void
-XmlAppendAttribute(
- ExportSwitches *exportPtr,
- const char *attrName,
- const char *value,
- int length)
-{
- size_t valueLen;
-
- if (length < 0) {
- valueLen = strlen(value);
- } else {
- valueLen = (size_t)length;
- }
- Tcl_DStringAppend(exportPtr->dsPtr, " ", 1);
- Tcl_DStringAppend(exportPtr->dsPtr, attrName, -1);
- Tcl_DStringAppend(exportPtr->dsPtr, "=", 1);
- Tcl_DStringAppend(exportPtr->dsPtr, "\"", 1);
- XmlPutEscapeString(value, valueLen, exportPtr);
- Tcl_DStringAppend(exportPtr->dsPtr, "\"", 1);
-}
-
-static void
-XmlAppendCharacterData(
- ExportSwitches *exportPtr,
- const char *string,
- int length)
-{
- if (length < 0) {
- length = strlen(string);
- }
- Tcl_DStringAppend(exportPtr->dsPtr, "CDATA=(", -1);
- XmlPutEscapeString(string, length, exportPtr);
- Tcl_DStringAppend(exportPtr->dsPtr, ")", -1);
-}
-
-static int
-XmlExportElement(Blt_Tree tree, Blt_TreeNode parent, ExportSwitches *exportPtr)
-{
- Blt_TreeKey key;
- Blt_TreeKeyIterator iter;
- Blt_TreeNode child;
-
- if (strcmp(Blt_Tree_NodeLabel(parent), SYM_CDATA) == 0) {
- Tcl_Obj *valueObjPtr;
- const char *value;
- int nBytes;
-
- /* Just output the CDATA field. */
- if (Blt_Tree_GetValue(exportPtr->interp, tree, parent, SYM_CDATA,
- &valueObjPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- value = Tcl_GetStringFromObj(valueObjPtr, &nBytes);
- XmlAppendCharacterData(exportPtr, value, nBytes);
- return TCL_OK;
- }
- XmlOpenStartElement(exportPtr, parent);
- for (key = Blt_Tree_FirstKey(tree, parent, &iter); key != NULL;
- key = Blt_Tree_NextKey(tree, &iter)) {
- Tcl_Obj *valueObjPtr;
- const char *value;
- int nBytes;
-
- if (Blt_Tree_GetValueByKey(exportPtr->interp, tree, parent, key,
- &valueObjPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- value = Tcl_GetStringFromObj(valueObjPtr, &nBytes);
- XmlAppendAttribute(exportPtr, key, value, nBytes);
- }
- XmlCloseStartElement(exportPtr);
- for (child = Blt_Tree_FirstChild(parent); child != NULL;
- child = Blt_Tree_NextSibling(child)) {
- if (XmlExportElement(tree, child, exportPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return XmlEndElement(exportPtr, parent);
-}
-
-static int
-XmlExport(Blt_Tree tree, ExportSwitches *exportPtr)
-{
- if (XmlExportElement(tree, exportPtr->root, exportPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (exportPtr->channel != NULL) {
- return XmlFlush(exportPtr);
- }
- return TCL_OK;
-}
-
-static int
-ExportXmlProc(
- Tcl_Interp *interp,
- Blt_Tree tree,
- int objc,
- Tcl_Obj *const *objv)
-{
- ExportSwitches switches;
- Tcl_Channel channel;
- Tcl_DString ds;
- int closeChannel;
- int result;
-
- closeChannel = FALSE;
- channel = NULL;
-
- Tcl_DStringInit(&ds);
- memset(&switches, 0, sizeof(switches));
- nodeSwitch.clientData = tree;
- switches.root = Blt_Tree_RootNode(tree);
- switches.flags = IMPORT_ATTRIBUTES | IMPORT_CDATA;
- if (Blt_ParseSwitches(interp, exportSwitches, objc - 3 , objv + 3,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- result = TCL_ERROR;
- if (switches.fileObj != NULL) {
- char *fileName;
-
- closeChannel = TRUE;
- fileName = Tcl_GetString(switches.fileObj);
- if ((fileName[0] == '@') && (fileName[1] != '\0')) {
- int mode;
-
- channel = Tcl_GetChannel(interp, fileName+1, &mode);
- if (channel == NULL) {
- goto error;
- }
- if ((mode & TCL_WRITABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", fileName,
- "\" not opened for writing", (char *)NULL);
- goto error;
- }
- closeChannel = FALSE;
- } else {
- channel = Tcl_OpenFileChannel(interp, fileName, "w", 0666);
- if (channel == NULL) {
- goto error; /* Can't open export file. */
- }
- }
- }
- switches.interp = interp;
- switches.dsPtr = &ds;
- switches.channel = channel;
- result = XmlExport(tree, &switches);
- if ((switches.channel == NULL) && (result == TCL_OK)) {
- Tcl_DStringResult(interp, &ds);
- }
- error:
- Tcl_DStringFree(&ds);
- if (closeChannel) {
- Tcl_Close(interp, channel);
- }
- Blt_FreeSwitches(exportSwitches, (char *)&switches, 0);
- return result;
-}
-
-int
-Blt_TreeXmlInit(Tcl_Interp *interp)
-{
- if (Tcl_PkgRequire(interp, "blt_core", BLT_VERSION, /*Exact*/1) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_PkgProvide(interp, "blt_tree_xml", BLT_VERSION) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_Tree_RegisterFormat(interp,
- "xml", /* Name of format. */
-#ifdef HAVE_LIBEXPAT
- ImportXmlProc, /* Import procedure. */
-#else
- NULL, /* Import procedure. */
-#endif /* HAVE_LIBEXPAT */
- ExportXmlProc); /* Export procedure. */
-
-}
diff --git a/blt3.0.1/src/bltTri.c b/blt3.0.1/src/bltTri.c
deleted file mode 100644
index 3db9bc2..0000000
--- a/blt3.0.1/src/bltTri.c
+++ /dev/null
@@ -1,746 +0,0 @@
-#include "bltInt.h"
-#include "bltChain.h"
-
-#define DELETED ((Edge *)-2)
-#define LE 0
-#define RE 1
-
-#define Dist(p,q) \
- hypot((p)->point.x - (q)->point.x, (p)->point.y - (q)->point.y)
-
-typedef struct _HalfEdge HalfEdge;
-typedef struct _FreeNode FreeNode;
-
-typedef struct {
- int a, b, c;
- float min, max;
-} Triplet;
-
-struct _FreeNode {
- FreeNode *nextPtr;
-};
-
-typedef struct {
- FreeNode *headPtr;
- int nodesize;
-} FreeList;
-
-typedef struct {
- Point2d point;
- int neighbor;
- int refCount;
-} Site;
-
-typedef struct {
- double a, b, c;
- Site *ep[2];
- Site *leftReg, *rightReg;
- int neighbor;
-} Edge;
-
-struct _HalfEdge {
- HalfEdge *leftPtr, *rightPtr;
- Edge *edgePtr;
- int refCount;
- int pm;
- Site *vertex;
- double ystar;
- HalfEdge *pqNext;
-};
-
-/* Static variables */
-
-typedef struct {
- double xMin, xMax, yMin, yMax, xDelta, yDelta;
- Site *sites;
- int nSites;
- int siteIndex;
- int sqrtNumSites;
- int nVertices;
- Site *bottomsite;
- int nEdges;
- FreeList freeSites;
- FreeList freeEdges;
- FreeList freeHalfEdges;
- HalfEdge *elLeftEnd, *elRightEnd;
- int elHashsize;
- HalfEdge **elHash;
- int pqHashsize;
- HalfEdge *pqHash;
- int pqCount;
- int pqMin;
- Blt_Chain allocChain;
-} Voronoi;
-
-static void
-FreeInit(FreeList *listPtr, int size)
-{
- listPtr->headPtr = NULL;
- listPtr->nodesize = size;
-}
-
-static void
-InitMemorySystem(Voronoi *v)
-{
- if (v->allocChain == NULL) {
- v->allocChain = Blt_Chain_Create();
- }
- FreeInit(&v->freeSites, sizeof(Site));
-}
-
-static void *
-AllocMemory(Voronoi *v, size_t size)
-{
- void *ptr;
-
- ptr = Blt_Malloc(size);
- if (ptr == NULL) {
- return NULL;
- }
- Blt_Chain_Append(v->allocChain, ptr);
- return ptr;
-}
-
-static void
-ReleaseMemorySystem(Voronoi *v)
-{
- Blt_ChainLink link;
-
- for (link = Blt_Chain_LastLink(v->allocChain); link != NULL;
- link = Blt_Chain_PrevLink(link)) {
- void *ptr;
-
- ptr = Blt_Chain_GetValue(link);
- if (ptr != NULL) {
- Blt_Free(ptr);
- }
- }
- Blt_Chain_Destroy(v->allocChain);
- v->allocChain = NULL;
-}
-
-INLINE static void
-MakeFree(void *item, FreeList *listPtr)
-{
- FreeNode *nodePtr = item;
-
- nodePtr->nextPtr = listPtr->headPtr;
- listPtr->headPtr = nodePtr;
-}
-
-
-static void *
-GetFree(Voronoi *v, FreeList *listPtr)
-{
- FreeNode *nodePtr;
-
- if (listPtr->headPtr == NULL) {
- int i;
-
- nodePtr = AllocMemory(v, v->sqrtNumSites * listPtr->nodesize);
- /* Thread the free nodes as a list */
- for (i = 0; i < v->sqrtNumSites; i++) {
- MakeFree(((char *)nodePtr + i * listPtr->nodesize), listPtr);
- }
- }
- nodePtr = listPtr->headPtr;
- listPtr->headPtr = listPtr->headPtr->nextPtr;
- return nodePtr;
-}
-
-INLINE static void
-DecrRefCount(Voronoi *v, Site *vertexPtr)
-{
- vertexPtr->refCount--;
- if (vertexPtr->refCount == 0) {
- MakeFree(vertexPtr, &v->freeSites);
- }
-}
-
-INLINE static void
-IncrRefCount(Site *vertexPtr)
-{
- vertexPtr->refCount++;
-}
-
-INLINE static HalfEdge *
-HECreate(Voronoi *v, Edge *edgePtr, int pm)
-{
- HalfEdge *hePtr;
-
- hePtr = GetFree(v, &v->freeHalfEdges);
- hePtr->edgePtr = edgePtr;
- hePtr->pm = pm;
- hePtr->pqNext = NULL;
- hePtr->vertex = NULL;
- hePtr->refCount = 0;
- return hePtr;
-}
-
-
-static void
-ElInitialize(Voronoi *v)
-{
- FreeInit(&v->freeHalfEdges, sizeof(HalfEdge));
-
- v->elHashsize = 2 * v->sqrtNumSites;
- v->elHash = AllocMemory(v, v->elHashsize * sizeof(HalfEdge *));
- assert(v->elHash);
- memset(v->elHash, 0, v->elHashsize * sizeof(HalfEdge *));
-
- v->elLeftEnd = HECreate(v, (Edge *)NULL, 0);
- v->elRightEnd = HECreate(v, (Edge *)NULL, 0);
- v->elLeftEnd->leftPtr = NULL;
- v->elLeftEnd->rightPtr = v->elRightEnd;
- v->elRightEnd->leftPtr = v->elLeftEnd;
- v->elRightEnd->rightPtr = NULL;
- v->elHash[0] = v->elLeftEnd;
- v->elHash[v->elHashsize - 1] = v->elRightEnd;
-}
-
-INLINE static void
-ElInsert(HalfEdge *lb, HalfEdge *edgePtr)
-{
- edgePtr->leftPtr = lb;
- edgePtr->rightPtr = lb->rightPtr;
- lb->rightPtr->leftPtr = edgePtr;
- lb->rightPtr = edgePtr;
-}
-
-static HalfEdge *
-ElGetHash(Voronoi *v, int b)
-{
- HalfEdge *hePtr;
-
- if ((b < 0) || (b >= v->elHashsize)) {
- return NULL;
- }
- hePtr = v->elHash[b];
- if ((hePtr == NULL) || (hePtr->edgePtr != DELETED)) {
- return hePtr;
- }
- /* Hash table points to deleted half edge. Patch as necessary. */
-
- v->elHash[b] = NULL;
- hePtr->refCount--;
- if (hePtr->refCount == 0) {
- MakeFree(hePtr, &v->freeHalfEdges);
- }
- return NULL;
-}
-
-static int
-RightOf(HalfEdge *hePtr, Point2d *p)
-{
- Edge *e;
- Site *topsite;
- int rightOfSite, above, fast;
- double dxp, dyp, dxs, t1, t2, t3, yl;
-
- e = hePtr->edgePtr;
- topsite = e->rightReg;
- rightOfSite = p->x > topsite->point.x;
- if ((rightOfSite) && (hePtr->pm == LE)) {
- return 1;
- }
- if ((!rightOfSite) && (hePtr->pm == RE)) {
- return 0;
- }
- if (e->a == 1.0) {
- dyp = p->y - topsite->point.y;
- dxp = p->x - topsite->point.x;
- fast = 0;
- if ((!rightOfSite & e->b < 0.0) | (rightOfSite & e->b >= 0.0)) {
- above = dyp >= e->b * dxp;
- fast = above;
- } else {
- above = p->x + p->y * e->b > e->c;
- if (e->b < 0.0) {
- above = !above;
- }
- if (!above) {
- fast = 1;
- }
- }
- if (!fast) {
- dxs = topsite->point.x - (e->leftReg)->point.x;
- above = e->b * (dxp * dxp - dyp * dyp) <
- dxs * dyp * (1.0 + 2.0 * dxp / dxs + e->b * e->b);
- if (e->b < 0.0) {
- above = !above;
- }
- }
- } else { /* e->b==1.0 */
- yl = e->c - e->a * p->x;
- t1 = p->y - yl;
- t2 = p->x - topsite->point.x;
- t3 = yl - topsite->point.y;
- above = t1 * t1 > t2 * t2 + t3 * t3;
- }
- return (hePtr->pm == LE ? above : !above);
-}
-
-static HalfEdge *
-ElLeftBnd(Voronoi *v, Point2d *p)
-{
- int i, bucket;
- HalfEdge *hePtr;
-
- /* Use hash table to get close to desired halfedge */
-
- bucket = (p->x - v->xMin) / v->xDelta * v->elHashsize;
- if (bucket < 0) {
- bucket = 0;
- } else if (bucket >= v->elHashsize) {
- bucket = v->elHashsize - 1;
- }
- hePtr = ElGetHash(v, bucket);
- if (hePtr == NULL) {
- for (i = 1; /* empty */ ; i++) {
- hePtr = ElGetHash(v, bucket - i);
- if (hePtr != NULL) {
- break;
- }
- hePtr = ElGetHash(v, bucket + i);
- if (hePtr != NULL) {
- break;
- }
- }
- }
-
- /* Now search linear list of halfedges for the correct one */
-
- if ((hePtr == v->elLeftEnd) ||
- (hePtr != v->elRightEnd && RightOf(hePtr, p))) {
- do {
- hePtr = hePtr->rightPtr;
- } while ((hePtr != v->elRightEnd) && (RightOf(hePtr, p)));
- hePtr = hePtr->leftPtr;
- } else {
- do {
- hePtr = hePtr->leftPtr;
- } while ((hePtr != v->elLeftEnd) && (!RightOf(hePtr, p)));
- }
-
- /* Update hash table and reference counts */
-
- if ((bucket > 0) && (bucket < (v->elHashsize - 1))) {
- if (v->elHash[bucket] != NULL) {
- v->elHash[bucket]->refCount--;
- }
- v->elHash[bucket] = hePtr;
- v->elHash[bucket]->refCount++;
- }
- return hePtr;
-}
-
-/*
- * This delete routine can't reclaim node, since pointers from hash table may
- * be present.
- */
-INLINE static void
-ElDelete(HalfEdge *hePtr)
-{
- hePtr->leftPtr->rightPtr = hePtr->rightPtr;
- hePtr->rightPtr->leftPtr = hePtr->leftPtr;
- hePtr->edgePtr = DELETED;
-}
-
-INLINE static Site *
-LeftRegion(Voronoi *v, HalfEdge *hePtr)
-{
- if (hePtr->edgePtr == NULL) {
- return v->bottomsite;
- }
- return (hePtr->pm == LE) ? hePtr->edgePtr->leftReg : hePtr->edgePtr->rightReg;
-}
-
-INLINE static Site *
-RightRegion(Voronoi *v, HalfEdge *hePtr)
-{
- if (hePtr->edgePtr == NULL) {
- return v->bottomsite;
- }
- return (hePtr->pm == LE) ? hePtr->edgePtr->rightReg : hePtr->edgePtr->leftReg;
-}
-
-static void
-GeomInit(Voronoi *v)
-{
- FreeInit(&v->freeEdges, sizeof(Edge));
- v->nVertices = v->nEdges = 0;
- v->sqrtNumSites = sqrt((double)(v->nSites + 4));
- v->yDelta = v->xMax - v->xMax;
- v->xDelta = v->yMax - v->yMin;
-}
-
-static Edge *
-Bisect(Voronoi *v, Site *s1, Site *s2)
-{
- double dx, dy, adx, ady;
- Edge *edgePtr;
-
- edgePtr = GetFree(v, &v->freeEdges);
-
- edgePtr->leftReg = s1;
- edgePtr->rightReg = s2;
- IncrRefCount(s1);
- IncrRefCount(s2);
- edgePtr->ep[0] = edgePtr->ep[1] = NULL;
-
- dx = s2->point.x - s1->point.x;
- dy = s2->point.y - s1->point.y;
- adx = FABS(dx);
- ady = FABS(dy);
- edgePtr->c = (s1->point.x * dx) + (s1->point.y * dy) +
- ((dx * dx) + (dy * dy)) * 0.5;
- if (adx > ady) {
- edgePtr->a = 1.0;
- edgePtr->b = dy / dx;
- edgePtr->c /= dx;
- } else {
- edgePtr->b = 1.0;
- edgePtr->a = dx / dy;
- edgePtr->c /= dy;
- }
-
- edgePtr->neighbor = v->nEdges;
- v->nEdges++;
- return edgePtr;
-}
-
-static Site *
-Intersect(Voronoi *v, HalfEdge *hePtr1, HalfEdge *hePtr2)
-{
- Edge *e1, *e2, *e;
- HalfEdge *hePtr;
- double d, xint, yint;
- int rightOfSite;
- Site *sitePtr;
-
- e1 = hePtr1->edgePtr;
- e2 = hePtr2->edgePtr;
- if ((e1 == NULL) || (e2 == NULL)) {
- return NULL;
- }
- if (e1->rightReg == e2->rightReg) {
- return NULL;
- }
- d = (e1->a * e2->b) - (e1->b * e2->a);
- if ((-1.0e-10 < d) && (d < 1.0e-10)) {
- return NULL;
- }
- xint = ((e1->c * e2->b) - (e2->c * e1->b)) / d;
- yint = ((e2->c * e1->a) - (e1->c * e2->a)) / d;
-
- if ((e1->rightReg->point.y < e2->rightReg->point.y) ||
- ((e1->rightReg->point.y == e2->rightReg->point.y) &&
- (e1->rightReg->point.x < e2->rightReg->point.x))) {
- hePtr = hePtr1;
- e = e1;
- } else {
- hePtr = hePtr2;
- e = e2;
- }
- rightOfSite = (xint >= e->rightReg->point.x);
- if ((rightOfSite && hePtr->pm == LE) || (!rightOfSite && hePtr->pm == RE)) {
- return NULL;
- }
- sitePtr = GetFree(v, &v->freeSites);
- sitePtr->refCount = 0;
- sitePtr->point.x = xint;
- sitePtr->point.y = yint;
- return sitePtr;
-}
-
-INLINE static void
-EndPoint(Voronoi *v, Edge *e, int lr, Site *s)
-{
- e->ep[lr] = s;
- IncrRefCount(s);
- if (e->ep[RE - lr] == NULL) {
- return;
- }
- DecrRefCount(v, e->leftReg);
- DecrRefCount(v, e->rightReg);
- MakeFree(e, &v->freeEdges);
-}
-
-INLINE static void
-MakeVertex(Voronoi *v, Site *vertex)
-{
- vertex->neighbor = v->nVertices;
- v->nVertices++;
-}
-
-static int
-PQBucket(Voronoi *v, HalfEdge *hePtr)
-{
- int bucket;
-
- bucket = (hePtr->ystar - v->yMin) / v->yDelta * v->pqHashsize;
- if (bucket < 0) {
- bucket = 0;
- }
- if (bucket >= v->pqHashsize) {
- bucket = v->pqHashsize - 1;
- }
- if (bucket < v->pqMin) {
- v->pqMin = bucket;
- }
- return bucket;
-}
-
-static void
-PQInsert(Voronoi *v, HalfEdge *hePtr, Site *vertex, double offset)
-{
- HalfEdge *last, *next;
-
- hePtr->vertex = vertex;
- IncrRefCount(vertex);
- hePtr->ystar = vertex->point.y + offset;
- last = v->pqHash + PQBucket(v, hePtr);
- while (((next = last->pqNext) != NULL) &&
- ((hePtr->ystar > next->ystar) ||
- ((hePtr->ystar == next->ystar) &&
- (vertex->point.x > next->vertex->point.x)))) {
- last = next;
- }
- hePtr->pqNext = last->pqNext;
- last->pqNext = hePtr;
- v->pqCount++;
-}
-
-static void
-PQDelete(Voronoi *v, HalfEdge *hePtr)
-{
- if (hePtr->vertex != NULL) {
- HalfEdge *last;
-
- last = v->pqHash + PQBucket(v, hePtr);
- while (last->pqNext != hePtr) {
- last = last->pqNext;
- }
- last->pqNext = hePtr->pqNext;
- v->pqCount--;
- DecrRefCount(v, hePtr->vertex);
- hePtr->vertex = NULL;
- }
-}
-
-INLINE static int
-PQEmpty(Voronoi *v)
-{
- return (v->pqCount == 0);
-}
-
-INLINE static Point2d
-PQMin(Voronoi *v)
-{
- Point2d p;
-
- while (v->pqHash[v->pqMin].pqNext == NULL) {
- v->pqMin++;
- }
- p.x = v->pqHash[v->pqMin].pqNext->vertex->point.x;
- p.y = v->pqHash[v->pqMin].pqNext->ystar;
- return p;
-}
-
-INLINE static HalfEdge *
-PQExtractMin(Voronoi *v)
-{
- HalfEdge *curr;
-
- curr = v->pqHash[v->pqMin].pqNext;
- v->pqHash[v->pqMin].pqNext = curr->pqNext;
- v->pqCount--;
- return curr;
-}
-
-static void
-PQInitialize(Voronoi *v)
-{
- size_t nBytes;
-
- v->pqCount = v->pqMin = 0;
- v->pqHashsize = 4 * v->sqrtNumSites;
- nBytes = v->pqHashsize * sizeof(HalfEdge);
- v->pqHash = AllocMemory(v, nBytes);
- assert(v->pqHash);
- memset(v->pqHash, 0, nBytes);
-}
-
-INLINE static Site *
-NextSite(Voronoi *v)
-{
- if (v->siteIndex < v->nSites) {
- Site *s;
-
- s = v->sites + v->siteIndex;
- v->siteIndex++;
- return s;
- }
- return NULL;
-}
-
-static int
-ComputeVoronoi(Voronoi *v, Triplet *triplets)
-{
- Site *newsite, *bot, *top, *temp, *p;
- Site *vertex;
- Point2d newintstar;
- int pm, count = 0;
- HalfEdge *lbnd, *rbnd, *llbnd, *rrbnd, *bisector;
- Edge *e;
-
- PQInitialize(v);
- v->bottomsite = NextSite(v);
- ElInitialize(v);
-
- newsite = NextSite(v);
- for (;;) {
- if (!PQEmpty(v)) {
- newintstar = PQMin(v);
- }
- if ((newsite != NULL)
- && ((PQEmpty(v)) ||
- (newsite->point.y < newintstar.y) ||
- (newsite->point.y == newintstar.y) &&
- (newsite->point.x < newintstar.x))) {
-
- /* New site is smallest */
-
- lbnd = ElLeftBnd(v, &newsite->point);
- rbnd = lbnd->rightPtr;
- bot = RightRegion(v, lbnd);
- e = Bisect(v, bot, newsite);
- bisector = HECreate(v, e, LE);
- ElInsert(lbnd, bisector);
- p = Intersect(v, lbnd, bisector);
- if (p != NULL) {
- PQDelete(v, lbnd);
- PQInsert(v, lbnd, p, Dist(p, newsite));
- }
- lbnd = bisector;
- bisector = HECreate(v, e, RE);
- ElInsert(lbnd, bisector);
- p = Intersect(v, bisector, rbnd);
- if (p != NULL) {
- PQInsert(v, bisector, p, Dist(p, newsite));
- }
- newsite = NextSite(v);
- } else if (!PQEmpty(v)) {
-
- /* Intersection is smallest */
-
- lbnd = PQExtractMin(v);
- llbnd = lbnd->leftPtr;
- rbnd = lbnd->rightPtr;
- rrbnd = rbnd->rightPtr;
- bot = LeftRegion(v, lbnd);
- top = RightRegion(v, rbnd);
- triplets[count].a = bot->neighbor;
- triplets[count].b = top->neighbor;
- triplets[count].c = RightRegion(v, lbnd)->neighbor;
- ++count;
- vertex = lbnd->vertex;
- MakeVertex(v, vertex);
- EndPoint(v, lbnd->edgePtr, lbnd->pm, vertex);
- EndPoint(v, rbnd->edgePtr, rbnd->pm, vertex);
- ElDelete(lbnd);
- PQDelete(v, rbnd);
- ElDelete(rbnd);
- pm = LE;
- if (bot->point.y > top->point.y) {
- temp = bot, bot = top, top = temp;
- pm = RE;
- }
- e = Bisect(v, bot, top);
- bisector = HECreate(v, e, pm);
- ElInsert(llbnd, bisector);
- EndPoint(v, e, RE - pm, vertex);
- DecrRefCount(v, vertex);
- p = Intersect(v, llbnd, bisector);
- if (p != NULL) {
- PQDelete(v, llbnd);
- PQInsert(v, llbnd, p, Dist(p, bot));
- }
- p = Intersect(v, bisector, rrbnd);
- if (p != NULL) {
- PQInsert(v, bisector, p, Dist(p, bot));
- }
- } else {
- break;
- }
- }
- return count;
-}
-
-static int
-CompareSites(const void *a, const void *b)
-{
- const Site *s1 = a;
- const Site *s2 = b;
-
- if (s1->point.y < s2->point.y) {
- return -1;
- }
- if (s1->point.y > s2->point.y) {
- return 1;
- }
- if (s1->point.x < s2->point.x) {
- return -1;
- }
- if (s1->point.x > s2->point.x) {
- return 1;
- }
- return 0;
-}
-
-int
-Blt_Triangulate(Tcl_Interp *interp, size_t nPoints, Point2f *points,
- int sorted, int *nTrianglesPtr, Triplet **trianglesPtr)
-{
- int i;
- Site *sp, *send;
- int n;
- Voronoi v;
- Triplet *triangles;
-
- memset(&v, 0, sizeof(v));
-
- InitMemorySystem(&v);
-
- v.nSites = nPoints;
- v.sites = AllocMemory(&v, nPoints * sizeof(Site));
-
- for (sp = v.sites, send = sp + nPoints, i = 0; sp < send; i++, sp++) {
- sp->point.x = points[i].x;
- sp->point.y = points[i].y;
- sp->neighbor = i;
- sp->refCount = 0;
- }
- if (!sorted) {
- qsort(v.sites, v.nSites, sizeof(Site), CompareSites);
- }
- sp = v.sites;
- v.xMin = v.xMax = sp->point.x;
- v.yMin = sp->point.y;
- v.yMax = v.sites[nPoints - 1].point.y;
- for (sp++, send = v.sites + nPoints; sp < send; sp++) {
- if (sp->point.x < v.xMin) {
- v.xMin = sp->point.x;
- } else if (sp->point.x > v.xMax) {
- v.xMax = sp->point.x;
- }
- }
- v.siteIndex = 0;
- GeomInit(&v);
- n = ComputeVoronoi(&v, triangles);
- /* Release memory allocated for triangulation */
- ReleaseMemorySystem(&v);
- *nTrianglesPtr = n;
- *trianglesPtr = triangles;
- return TCL_OK;
-}
diff --git a/blt3.0.1/src/bltTvCmd.c b/blt3.0.1/src/bltTvCmd.c
deleted file mode 100644
index 751bde8..0000000
--- a/blt3.0.1/src/bltTvCmd.c
+++ /dev/null
@@ -1,4701 +0,0 @@
-
-/*
- * bltTvCmd.c --
- *
- * This module implements an hierarchy widget for the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * TODO:
- *
- * BUGS:
- * 1. "open" operation should change scroll offset so that as many
- * new entries (up to half a screen) can be seen.
- * 2. "open" needs to adjust the scrolloffset so that the same entry
- * is seen at the same place.
- */
-#include "bltInt.h"
-
-#ifndef NO_TREEVIEW
-#include "bltOp.h"
-#include "bltTreeView.h"
-#include "bltList.h"
-#include "bltSwitch.h"
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-
-#define FCLAMP(x) ((((x) < 0.0) ? 0.0 : ((x) > 1.0) ? 1.0 : (x)))
-
-#define DEF_ICON_WIDTH 16
-
-static TreeViewCompareProc ExactCompare, GlobCompare, RegexpCompare;
-static TreeViewApplyProc ShowEntryApplyProc, HideEntryApplyProc,
- MapAncestorsApplyProc, FixSelectionsApplyProc;
-static Tk_LostSelProc LostSelection;
-static TreeViewApplyProc SelectEntryApplyProc;
-
-BLT_EXTERN Blt_CustomOption bltTreeViewIconsOption;
-BLT_EXTERN Blt_CustomOption bltTreeViewUidOption;
-BLT_EXTERN Blt_CustomOption bltTreeViewTreeOption;
-BLT_EXTERN Blt_ConfigSpec bltTreeViewButtonSpecs[];
-BLT_EXTERN Blt_ConfigSpec bltTreeViewSpecs[];
-BLT_EXTERN Blt_ConfigSpec bltTreeViewEntrySpecs[];
-
-typedef struct {
- int mask;
-} ChildrenSwitches;
-
-static Blt_SwitchSpec childrenSwitches[] = {
- {BLT_SWITCH_BITMASK, "-exposed", "",
- Blt_Offset(ChildrenSwitches, mask), 0, ENTRY_MASK},
- {BLT_SWITCH_END}
-};
-
-
-typedef int (TvCmdProc)(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-#define TAG_UNKNOWN (1<<0)
-#define TAG_RESERVED (1<<1)
-#define TAG_USER_DEFINED (1<<2)
-
-#define TAG_SINGLE (1<<3)
-#define TAG_MULTIPLE (1<<4)
-#define TAG_ALL (1<<5)
-
-
-#define NodeToObj(n) Tcl_NewLongObj(Blt_Tree_NodeId(n))
-
-/*
- *---------------------------------------------------------------------------
- *
- * SkipSeparators --
- *
- * Moves the character pointer past one of more separators.
- *
- * Results:
- * Returns the updates character pointer.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-SkipSeparators(const char *path, const char *separator, int length)
-{
- while ((path[0] == separator[0]) &&
- (strncmp(path, separator, length) == 0)) {
- path += length;
- }
- return path;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteNode --
- *
- * Delete the node and its descendants. Don't remove the root node,
- * though. If the root node is specified, simply remove all its
- * children.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DeleteNode(TreeView *viewPtr, Blt_TreeNode node)
-{
- Blt_TreeNode root;
-
- if (!Blt_Tree_TagTableIsShared(viewPtr->tree)) {
- Blt_Tree_ClearTags(viewPtr->tree, node);
- }
- root = Blt_Tree_RootNode(viewPtr->tree);
- if (node == root) {
- Blt_TreeNode next;
- /* Don't delete the root node. Simply clean out the tree. */
- for (node = Blt_Tree_FirstChild(node); node != NULL; node = next) {
- next = Blt_Tree_NextSibling(node);
- Blt_Tree_DeleteNode(viewPtr->tree, node);
- }
- } else if (Blt_Tree_IsAncestor(root, node)) {
- Blt_Tree_DeleteNode(viewPtr->tree, node);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SplitPath --
- *
- * Returns the trailing component of the given path. Trailing separators
- * are ignored.
- *
- * Results:
- * Returns the string of the tail component.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SplitPath(TreeView *viewPtr, const char *path, long *depthPtr,
- const char ***argvPtr)
-{
- int skipLen, pathLen;
- long depth;
- size_t listSize;
- char **argv;
- char *p;
- char *sep;
-
- if (viewPtr->pathSep == SEPARATOR_LIST) {
- int nElem;
- if (Tcl_SplitList(viewPtr->interp, path, &nElem, argvPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- *depthPtr = (long)nElem;
- return TCL_OK;
- }
- pathLen = strlen(path);
- skipLen = strlen(viewPtr->pathSep);
- path = SkipSeparators(path, viewPtr->pathSep, skipLen);
- depth = pathLen / skipLen;
-
- listSize = (depth + 1) * sizeof(char *);
- argv = Blt_AssertMalloc(listSize + (pathLen + 1));
- p = (char *)argv + listSize;
- strcpy(p, path);
-
- sep = strstr(p, viewPtr->pathSep);
- depth = 0;
- while ((*p != '\0') && (sep != NULL)) {
- *sep = '\0';
- argv[depth++] = p;
- p = (char *)SkipSeparators(sep + skipLen, viewPtr->pathSep, skipLen);
- sep = strstr(p, viewPtr->pathSep);
- }
- if (*p != '\0') {
- argv[depth++] = p;
- }
- argv[depth] = NULL;
- *depthPtr = depth;
- *argvPtr = (const char **)argv;
- return TCL_OK;
-}
-
-
-static TreeViewEntry *
-LastEntry(TreeView *viewPtr, TreeViewEntry *entryPtr, unsigned int mask)
-{
- TreeViewEntry *nextPtr;
-
- nextPtr = Blt_TreeView_LastChild(entryPtr, mask);
- while (nextPtr != NULL) {
- entryPtr = nextPtr;
- nextPtr = Blt_TreeView_LastChild(entryPtr, mask);
- }
- return entryPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShowEntryApplyProc --
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ShowEntryApplyProc(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- entryPtr->flags &= ~ENTRY_HIDE;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HideEntryApplyProc --
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-HideEntryApplyProc(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- entryPtr->flags |= ENTRY_HIDE;
- return TCL_OK;
-}
-
-
-static void
-MapAncestors(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- while (entryPtr != viewPtr->rootPtr) {
- entryPtr = Blt_TreeView_ParentEntry(entryPtr);
- if (entryPtr->flags & (ENTRY_CLOSED | ENTRY_HIDE)) {
- viewPtr->flags |= LAYOUT_PENDING;
- entryPtr->flags &= ~(ENTRY_CLOSED | ENTRY_HIDE);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapAncestorsApplyProc --
- *
- * If a node in mapped, then all its ancestors must be mapped also. This
- * routine traverses upwards and maps each unmapped ancestor. It's
- * assumed that for any mapped ancestor, all it's ancestors will already
- * be mapped too.
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-static int
-MapAncestorsApplyProc(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- /*
- * Make sure that all the ancestors of this entry are mapped too.
- */
- while (entryPtr != viewPtr->rootPtr) {
- entryPtr = Blt_TreeView_ParentEntry(entryPtr);
- if ((entryPtr->flags & (ENTRY_HIDE | ENTRY_CLOSED)) == 0) {
- break; /* Assume ancestors are also mapped. */
- }
- entryPtr->flags &= ~(ENTRY_HIDE | ENTRY_CLOSED);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindPath --
- *
- * Finds the node designated by the given path. Each path component is
- * searched for as the tree is traversed.
- *
- * A leading character string is trimmed off the path if it matches the
- * one designated (see the -trimleft option).
- *
- * If no separator is designated (see the -separator configuration
- * option), the path is considered a TCL list. Otherwise the each
- * component of the path is separated by a character string. Leading and
- * trailing separators are ignored. Multiple separators are treated as
- * one.
- *
- * Results:
- * Returns the pointer to the designated node. If any component can't be
- * found, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static TreeViewEntry *
-FindPath(TreeView *viewPtr, TreeViewEntry *rootPtr, const char *path)
-{
- Blt_TreeNode child;
- const char **argv;
- const char *name;
- long nComp;
- const char **p;
- TreeViewEntry *entryPtr;
-
- /* Trim off characters that we don't want */
- if (viewPtr->trimLeft != NULL) {
- const char *s1, *s2;
-
- /* Trim off leading character string if one exists. */
- for (s1 = path, s2 = viewPtr->trimLeft; *s2 != '\0'; s2++, s1++) {
- if (*s1 != *s2) {
- break;
- }
- }
- if (*s2 == '\0') {
- path = s1;
- }
- }
- if (*path == '\0') {
- return rootPtr;
- }
- name = path;
- entryPtr = rootPtr;
- if (viewPtr->pathSep == SEPARATOR_NONE) {
- child = Blt_Tree_FindChild(entryPtr->node, name);
- if (child == NULL) {
- goto error;
- }
- return Blt_TreeView_NodeToEntry(viewPtr, child);
- }
-
- if (SplitPath(viewPtr, path, &nComp, &argv) != TCL_OK) {
- return NULL;
- }
- for (p = argv; *p != NULL; p++) {
- name = *p;
- child = Blt_Tree_FindChild(entryPtr->node, name);
- if (child == NULL) {
- Blt_Free(argv);
- goto error;
- }
- entryPtr = Blt_TreeView_NodeToEntry(viewPtr, child);
- }
- Blt_Free(argv);
- return entryPtr;
- error:
- {
- Tcl_DString dString;
-
- Blt_TreeView_GetFullName(viewPtr, entryPtr, FALSE, &dString);
- Tcl_AppendResult(viewPtr->interp, "can't find node \"", name,
- "\" in parent node \"", Tcl_DStringValue(&dString), "\"",
- (char *)NULL);
- Tcl_DStringFree(&dString);
- }
- return NULL;
-
-}
-
-static int
-GetEntryFromSpecialId(TreeView *viewPtr, const char *string,
- TreeViewEntry **entryPtrPtr)
-{
- Blt_TreeNode node;
- TreeViewEntry *fromPtr, *entryPtr;
- char c;
-
- entryPtr = NULL;
- fromPtr = viewPtr->fromPtr;
- if (fromPtr == NULL) {
- fromPtr = viewPtr->focusPtr;
- }
- if (fromPtr == NULL) {
- fromPtr = viewPtr->rootPtr;
- }
- c = string[0];
- if (c == '@') {
- int x, y;
-
- if (Blt_GetXY(viewPtr->interp, viewPtr->tkwin, string, &x, &y) == TCL_OK) {
- *entryPtrPtr = Blt_TreeView_NearestEntry(viewPtr, x, y, TRUE);
- }
- } else if ((c == 'b') && (strcmp(string, "bottom") == 0)) {
- if (viewPtr->flatView) {
- entryPtr = viewPtr->flatArr[viewPtr->nEntries - 1];
- } else {
- entryPtr = LastEntry(viewPtr, viewPtr->rootPtr, ENTRY_MASK);
- }
- } else if ((c == 't') && (strcmp(string, "top") == 0)) {
- if (viewPtr->flatView) {
- entryPtr = viewPtr->flatArr[0];
- } else {
- entryPtr = viewPtr->rootPtr;
- if (viewPtr->flags & HIDE_ROOT) {
- entryPtr = Blt_TreeView_NextEntry(entryPtr, ENTRY_MASK);
- }
- }
- } else if ((c == 'e') && (strcmp(string, "end") == 0)) {
- entryPtr = LastEntry(viewPtr, viewPtr->rootPtr, ENTRY_MASK);
- } else if ((c == 'a') && (strcmp(string, "anchor") == 0)) {
- entryPtr = viewPtr->selAnchorPtr;
- } else if ((c == 'f') && (strcmp(string, "focus") == 0)) {
- entryPtr = viewPtr->focusPtr;
- if ((entryPtr == viewPtr->rootPtr) && (viewPtr->flags & HIDE_ROOT)) {
- entryPtr = Blt_TreeView_NextEntry(viewPtr->rootPtr, ENTRY_MASK);
- }
- } else if ((c == 'r') && (strcmp(string, "root") == 0)) {
- entryPtr = viewPtr->rootPtr;
- } else if ((c == 'p') && (strcmp(string, "parent") == 0)) {
- if (fromPtr != viewPtr->rootPtr) {
- entryPtr = Blt_TreeView_ParentEntry(fromPtr);
- }
- } else if ((c == 'c') && (strcmp(string, "current") == 0)) {
- /* Can't trust picked item, if entries have been added or deleted. */
- if (!(viewPtr->flags & DIRTY)) {
- ClientData context;
-
- context = Blt_GetCurrentContext(viewPtr->bindTable);
- if ((context == ITEM_ENTRY) ||
- (context == ITEM_ENTRY_BUTTON) ||
- (context >= ITEM_STYLE)) {
- entryPtr = Blt_GetCurrentItem(viewPtr->bindTable);
- }
- }
- } else if ((c == 'u') && (strcmp(string, "up") == 0)) {
- entryPtr = fromPtr;
- if (viewPtr->flatView) {
- int i;
-
- i = entryPtr->flatIndex - 1;
- if (i >= 0) {
- entryPtr = viewPtr->flatArr[i];
- }
- } else {
- entryPtr = Blt_TreeView_PrevEntry(fromPtr, ENTRY_MASK);
- if (entryPtr == NULL) {
- entryPtr = fromPtr;
- }
- if ((entryPtr == viewPtr->rootPtr) &&
- (viewPtr->flags & HIDE_ROOT)) {
- entryPtr = Blt_TreeView_NextEntry(entryPtr, ENTRY_MASK);
- }
- }
- } else if ((c == 'd') && (strcmp(string, "down") == 0)) {
- entryPtr = fromPtr;
- if (viewPtr->flatView) {
- int i;
-
- i = entryPtr->flatIndex + 1;
- if (i < viewPtr->nEntries) {
- entryPtr = viewPtr->flatArr[i];
- }
- } else {
- entryPtr = Blt_TreeView_NextEntry(fromPtr, ENTRY_MASK);
- if (entryPtr == NULL) {
- entryPtr = fromPtr;
- }
- if ((entryPtr == viewPtr->rootPtr) &&
- (viewPtr->flags & HIDE_ROOT)) {
- entryPtr = Blt_TreeView_NextEntry(entryPtr, ENTRY_MASK);
- }
- }
- } else if (((c == 'l') && (strcmp(string, "last") == 0)) ||
- ((c == 'p') && (strcmp(string, "prev") == 0))) {
- entryPtr = fromPtr;
- if (viewPtr->flatView) {
- int i;
-
- i = entryPtr->flatIndex - 1;
- if (i < 0) {
- i = viewPtr->nEntries - 1;
- }
- entryPtr = viewPtr->flatArr[i];
- } else {
- entryPtr = Blt_TreeView_PrevEntry(fromPtr, ENTRY_MASK);
- if (entryPtr == NULL) {
- entryPtr = LastEntry(viewPtr, viewPtr->rootPtr, ENTRY_MASK);
- }
- if ((entryPtr == viewPtr->rootPtr) &&
- (viewPtr->flags & HIDE_ROOT)) {
- entryPtr = Blt_TreeView_NextEntry(entryPtr, ENTRY_MASK);
- }
- }
- } else if ((c == 'n') && (strcmp(string, "next") == 0)) {
- entryPtr = fromPtr;
- if (viewPtr->flatView) {
- int i;
-
- i = entryPtr->flatIndex + 1;
- if (i >= viewPtr->nEntries) {
- i = 0;
- }
- entryPtr = viewPtr->flatArr[i];
- } else {
- entryPtr = Blt_TreeView_NextEntry(fromPtr, ENTRY_MASK);
- if (entryPtr == NULL) {
- if (viewPtr->flags & HIDE_ROOT) {
- entryPtr = Blt_TreeView_NextEntry(viewPtr->rootPtr,ENTRY_MASK);
- } else {
- entryPtr = viewPtr->rootPtr;
- }
- }
- }
- } else if ((c == 'n') && (strcmp(string, "nextsibling") == 0)) {
- node = Blt_Tree_NextSibling(fromPtr->node);
- if (node != NULL) {
- entryPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- }
- } else if ((c == 'p') && (strcmp(string, "prevsibling") == 0)) {
- node = Blt_Tree_PrevSibling(fromPtr->node);
- if (node != NULL) {
- entryPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- }
- } else if ((c == 'v') && (strcmp(string, "view.top") == 0)) {
- if (viewPtr->nVisible > 0) {
- entryPtr = viewPtr->visibleArr[0];
- }
- } else if ((c == 'v') && (strcmp(string, "view.bottom") == 0)) {
- if (viewPtr->nVisible > 0) {
- entryPtr = viewPtr->visibleArr[viewPtr->nVisible - 1];
- }
- } else {
- return TCL_ERROR;
- }
- *entryPtrPtr = entryPtr;
- return TCL_OK;
-}
-
-static int
-GetTagIter(TreeView *viewPtr, char *tagName, TreeViewTagIter *iterPtr)
-{
-
- iterPtr->tagType = TAG_RESERVED | TAG_SINGLE;
- iterPtr->entryPtr = NULL;
-
- if (strcmp(tagName, "all") == 0) {
- iterPtr->entryPtr = viewPtr->rootPtr;
- iterPtr->tagType |= TAG_ALL;
- } else {
- Blt_HashTable *tablePtr;
-
- tablePtr = Blt_Tree_TagHashTable(viewPtr->tree, tagName);
- if (tablePtr != NULL) {
- Blt_HashEntry *hPtr;
-
- iterPtr->tagType = TAG_USER_DEFINED; /* Empty tags are not an
- * error. */
- hPtr = Blt_FirstHashEntry(tablePtr, &iterPtr->cursor);
- if (hPtr != NULL) {
- Blt_TreeNode node;
-
- node = Blt_GetHashValue(hPtr);
- iterPtr->entryPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- if (tablePtr->numEntries > 1) {
- iterPtr->tagType |= TAG_MULTIPLE;
- }
- }
- } else {
- iterPtr->tagType = TAG_UNKNOWN;
- Tcl_AppendResult(viewPtr->interp, "can't find tag or id \"", tagName,
- "\" in \"", Tk_PathName(viewPtr->tkwin), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-void
-Blt_TreeView_GetTags(Tcl_Interp *interp, TreeView *viewPtr,
- TreeViewEntry *entryPtr, Blt_List list)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Blt_TreeTagEntry *tPtr;
-
- for (hPtr = Blt_Tree_FirstTag(viewPtr->tree, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- tPtr = Blt_GetHashValue(hPtr);
- hPtr = Blt_FindHashEntry(&tPtr->nodeTable, (char *)entryPtr->node);
- if (hPtr != NULL) {
- Blt_List_Append(list, Blt_TreeView_GetUid(viewPtr, tPtr->tagName),
- 0);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AddTag --
- *
- *---------------------------------------------------------------------------
- */
-static int
-AddTag(TreeView *viewPtr, Blt_TreeNode node, const char *tagName)
-{
- TreeViewEntry *entryPtr;
-
- if (strcmp(tagName, "root") == 0) {
- Tcl_AppendResult(viewPtr->interp, "can't add reserved tag \"",
- tagName, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (isdigit(UCHAR(tagName[0]))) {
- long inode;
-
- if (TclGetLong(NULL, tagName, &inode) == TCL_OK) {
- Tcl_AppendResult(viewPtr->interp, "invalid tag \"", tagName,
- "\": can't be a number.", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (tagName[0] == '@') {
- Tcl_AppendResult(viewPtr->interp, "invalid tag \"", tagName,
- "\": can't start with \"@\"", (char *)NULL);
- return TCL_ERROR;
- }
- viewPtr->fromPtr = NULL;
- if (GetEntryFromSpecialId(viewPtr, tagName, &entryPtr) == TCL_OK) {
- Tcl_AppendResult(viewPtr->interp, "invalid tag \"", tagName,
- "\": is a special id", (char *)NULL);
- return TCL_ERROR;
- }
- /* Add the tag to the node. */
- Blt_Tree_AddTag(viewPtr->tree, node, tagName);
- return TCL_OK;
-}
-
-TreeViewEntry *
-Blt_TreeView_FirstTaggedEntry(TreeViewTagIter *iterPtr)
-{
- return iterPtr->entryPtr;
-}
-
-int
-Blt_TreeView_FindTaggedEntries(TreeView *viewPtr, Tcl_Obj *objPtr,
- TreeViewTagIter *iterPtr)
-{
- char *tagName;
- TreeViewEntry *entryPtr;
- long inode;
-
- tagName = Tcl_GetString(objPtr);
- viewPtr->fromPtr = NULL;
- if ((isdigit(UCHAR(tagName[0]))) &&
- (Tcl_GetLongFromObj(viewPtr->interp, objPtr, &inode) == TCL_OK)) {
- Blt_TreeNode node;
-
- node = Blt_Tree_GetNode(viewPtr->tree, inode);
- if (node == NULL) {
- Tcl_AppendResult(viewPtr->interp, "can't find node \"",
- Tcl_GetString(objPtr), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- iterPtr->entryPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- iterPtr->tagType = (TAG_RESERVED | TAG_SINGLE);
- } else if (GetEntryFromSpecialId(viewPtr, tagName, &entryPtr) == TCL_OK) {
- iterPtr->entryPtr = entryPtr;
- iterPtr->tagType = (TAG_RESERVED | TAG_SINGLE);
- } else {
- if (GetTagIter(viewPtr, tagName, iterPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-TreeViewEntry *
-Blt_TreeView_NextTaggedEntry(TreeViewTagIter *iterPtr)
-{
- TreeViewEntry *entryPtr;
-
- entryPtr = NULL;
- if (iterPtr->entryPtr != NULL) {
- TreeView *viewPtr = iterPtr->entryPtr->viewPtr;
-
- if (iterPtr->tagType & TAG_ALL) {
- entryPtr = Blt_TreeView_NextEntry(iterPtr->entryPtr, 0);
- } else if (iterPtr->tagType & TAG_MULTIPLE) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_NextHashEntry(&iterPtr->cursor);
- if (hPtr != NULL) {
- Blt_TreeNode node;
-
- node = Blt_GetHashValue(hPtr);
- entryPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- }
- }
- iterPtr->entryPtr = entryPtr;
- }
- return entryPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetEntryFromObj2 --
- *
- * Converts a string into node pointer. The string may be in one of the
- * following forms:
- *
- * NNN - inode.
- * "active" - Currently active node.
- * "anchor" - anchor of selected region.
- * "current" - Currently picked node in bindtable.
- * "focus" - The node currently with focus.
- * "root" - Root node.
- * "end" - Last open node in the entire hierarchy.
- * "next" - Next open node from the currently active
- * node. Wraps around back to top.
- * "last" - Previous open node from the currently active
- * node. Wraps around back to bottom.
- * "up" - Next open node from the currently active
- * node. Does not wrap around.
- * "down" - Previous open node from the currently active
- * node. Does not wrap around.
- * "nextsibling" - Next sibling of the current node.
- * "prevsibling" - Previous sibling of the current node.
- * "parent" - Parent of the current node.
- * "view.top" - Top of viewport.
- * "view.bottom" - Bottom of viewport.
- * @x,y - Closest node to the specified X-Y position.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned. The
- * pointer to the node is returned via nodePtr. Otherwise, TCL_ERROR is
- * returned and an error message is left in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetEntryFromObj2(TreeView *viewPtr, Tcl_Obj *objPtr, TreeViewEntry **entryPtrPtr)
-{
- Tcl_Interp *interp;
- char *string;
- TreeViewTagIter iter;
- long inode;
-
- interp = viewPtr->interp;
-
- string = Tcl_GetString(objPtr);
- *entryPtrPtr = NULL;
- if ((isdigit(UCHAR(string[0]))) &&
- (Tcl_GetLongFromObj(interp, objPtr, &inode) == TCL_OK)) {
- Blt_TreeNode node;
-
- node = Blt_Tree_GetNode(viewPtr->tree, inode);
- if (node != NULL) {
- *entryPtrPtr = Blt_TreeView_NodeToEntry(viewPtr, node);
- }
- return TCL_OK; /* Node Id. */
- }
- if (GetEntryFromSpecialId(viewPtr, string, entryPtrPtr) == TCL_OK) {
- return TCL_OK; /* Special Id. */
- }
- if (GetTagIter(viewPtr, string, &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- if (iter.tagType & TAG_MULTIPLE) {
- Tcl_AppendResult(interp, "more than one entry tagged as \"", string,
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- *entryPtrPtr = iter.entryPtr;
- return TCL_OK; /* Singleton tag. */
-}
-
-static int
-GetEntryFromObj(TreeView *viewPtr, Tcl_Obj *objPtr, TreeViewEntry **entryPtrPtr)
-{
- viewPtr->fromPtr = NULL;
- return GetEntryFromObj2(viewPtr, objPtr, entryPtrPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_GetEntry --
- *
- * Returns an entry based upon its index.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned. The
- * pointer to the node is returned via nodePtr. Otherwise, TCL_ERROR is
- * returned and an error message is left in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_TreeView_GetEntry(TreeView *viewPtr, Tcl_Obj *objPtr, TreeViewEntry **entryPtrPtr)
-{
- TreeViewEntry *entryPtr;
-
- if (GetEntryFromObj(viewPtr, objPtr, &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (entryPtr == NULL) {
- Tcl_ResetResult(viewPtr->interp);
- Tcl_AppendResult(viewPtr->interp, "can't find entry \"",
- Tcl_GetString(objPtr), "\" in \"", Tk_PathName(viewPtr->tkwin),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- *entryPtrPtr = entryPtr;
- return TCL_OK;
-}
-
-static Blt_TreeNode
-GetNthNode(Blt_TreeNode parent, long position)
-{
- Blt_TreeNode node;
- long count;
-
- count = 0;
- for(node = Blt_Tree_FirstChild(parent); node != NULL;
- node = Blt_Tree_NextSibling(node)) {
- if (count == position) {
- return node;
- }
- }
- return Blt_Tree_LastChild(parent);
-}
-
-/*
- * Preprocess the command string for percent substitution.
- */
-void
-Blt_TreeView_PercentSubst(
- TreeView *viewPtr,
- TreeViewEntry *entryPtr,
- const char *command,
- Tcl_DString *resultPtr)
-{
- const char *last, *p;
- const char *fullName;
- Tcl_DString dString;
-
- /*
- * Get the full path name of the node, in case we need to substitute for
- * it.
- */
- Tcl_DStringInit(&dString);
- fullName = Blt_TreeView_GetFullName(viewPtr, entryPtr, TRUE, &dString);
- Tcl_DStringInit(resultPtr);
- /* Append the widget name and the node .t 0 */
- for (last = p = command; *p != '\0'; p++) {
- if (*p == '%') {
- const char *string;
- char buf[3];
-
- if (p > last) {
- Tcl_DStringAppend(resultPtr, last, p - last);
- }
- switch (*(p + 1)) {
- case '%': /* Percent sign */
- string = "%";
- break;
- case 'W': /* Widget name */
- string = Tk_PathName(viewPtr->tkwin);
- break;
- case 'P': /* Full pathname */
- string = fullName;
- break;
- case 'p': /* Name of the node */
- string = GETLABEL(entryPtr);
- break;
- case '#': /* Node identifier */
- string = Blt_Tree_NodeIdAscii(entryPtr->node);
- break;
- default:
- if (*(p + 1) == '\0') {
- p--;
- }
- buf[0] = *p, buf[1] = *(p + 1), buf[2] = '\0';
- string = buf;
- break;
- }
- Tcl_DStringAppend(resultPtr, string, -1);
- p++;
- last = p + 1;
- }
- }
- if (p > last) {
- Tcl_DStringAppend(resultPtr, last, p-last);
- }
- Tcl_DStringFree(&dString);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectEntryApplyProc --
- *
- * Sets the selection flag for a node. The selection flag is
- * set/cleared/toggled based upon the flag set in the treeview widget.
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectEntryApplyProc(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- Blt_HashEntry *hPtr;
-
- switch (viewPtr->flags & TV_SELECT_MASK) {
- case TV_SELECT_CLEAR:
- Blt_TreeView_DeselectEntry(viewPtr, entryPtr);
- break;
-
- case TV_SELECT_SET:
- Blt_TreeView_SelectEntry(viewPtr, entryPtr);
- break;
-
- case TV_SELECT_TOGGLE:
- hPtr = Blt_FindHashEntry(&viewPtr->selectTable, (char *)entryPtr);
- if (hPtr != NULL) {
- Blt_TreeView_DeselectEntry(viewPtr, entryPtr);
- } else {
- Blt_TreeView_SelectEntry(viewPtr, entryPtr);
- }
- break;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyInvokeSelectCmd --
- *
- * Queues a request to execute the -selectcommand code associated with
- * the widget at the next idle point. Invoked whenever the selection
- * changes.
- *
- * Results:
- * None.
- *
- * Side effects:
- * TCL code gets executed for some application-specific task.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyInvokeSelectCmd(TreeView *viewPtr)
-{
- if (!(viewPtr->flags & TV_SELECT_PENDING)) {
- viewPtr->flags |= TV_SELECT_PENDING;
- Tcl_DoWhenIdle(Blt_TreeView_SelectCmdProc, viewPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_PruneSelection --
- *
- * The root entry being deleted or closed. Deselect any of its
- * descendants that are currently selected.
- *
- * Results:
- * None.
- *
- * Side effects:
- * If any of the entry's descendants are deselected the widget is
- * redrawn and the a selection command callback is invoked (if there's
- * one configured).
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TreeView_PruneSelection(TreeView *viewPtr, TreeViewEntry *rootPtr)
-{
- Blt_ChainLink link, next;
- TreeViewEntry *entryPtr;
- int selectionChanged;
-
- /*
- * Check if any of the currently selected entries are a descendant of of
- * the current root entry. Deselect the entry and indicate that the
- * treeview widget needs to be redrawn.
- */
- selectionChanged = FALSE;
- for (link = Blt_Chain_FirstLink(viewPtr->selected); link != NULL;
- link = next) {
- next = Blt_Chain_NextLink(link);
- entryPtr = Blt_Chain_GetValue(link);
- if (Blt_Tree_IsAncestor(rootPtr->node, entryPtr->node)) {
- Blt_TreeView_DeselectEntry(viewPtr, entryPtr);
- selectionChanged = TRUE;
- }
- }
- if (selectionChanged) {
- Blt_TreeView_EventuallyRedraw(viewPtr);
- if (viewPtr->selectCmd != NULL) {
- EventuallyInvokeSelectCmd(viewPtr);
- }
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeView operations
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-FocusOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- long inode;
-
- if (objc == 3) {
- TreeViewEntry *entryPtr;
-
- if (GetEntryFromObj(viewPtr, objv[2], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((entryPtr != NULL) && (entryPtr != viewPtr->focusPtr)) {
- if (entryPtr->flags & ENTRY_HIDE) {
- /* Doesn't make sense to set focus to a node you can't see. */
- MapAncestors(viewPtr, entryPtr);
- }
- /* Changing focus can only affect the visible entries. The entry
- * layout stays the same. */
- if (viewPtr->focusPtr != NULL) {
- viewPtr->focusPtr->flags |= ENTRY_REDRAW;
- }
- entryPtr->flags |= ENTRY_REDRAW;
- viewPtr->flags |= SCROLL_PENDING;
- viewPtr->focusPtr = entryPtr;
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- }
- Blt_SetFocusItem(viewPtr->bindTable, viewPtr->focusPtr, ITEM_ENTRY);
- inode = -1;
- if (viewPtr->focusPtr != NULL) {
- inode = Blt_Tree_NodeId(viewPtr->focusPtr->node);
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BboxOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BboxOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
- TreeViewEntry *entryPtr;
- int width, height, yBot;
- int left, top, right, bottom;
- int screen;
- int lWidth;
- char *string;
-
- if (viewPtr->flags & LAYOUT_PENDING) {
- /*
- * The layout is dirty. Recompute it now, before we use the world
- * dimensions. But remember, the "bbox" operation isn't valid for
- * hidden entries (since they're not visible, they don't have world
- * coordinates).
- */
- Blt_TreeView_ComputeLayout(viewPtr);
- }
- left = viewPtr->worldWidth;
- top = viewPtr->worldHeight;
- right = bottom = 0;
-
- screen = FALSE;
- string = Tcl_GetString(objv[2]);
- if ((string[0] == '-') && (strcmp(string, "-screen") == 0)) {
- screen = TRUE;
- objc--, objv++;
- }
- for (i = 2; i < objc; i++) {
- string = Tcl_GetString(objv[i]);
- if ((string[0] == 'a') && (strcmp(string, "all") == 0)) {
- left = top = 0;
- right = viewPtr->worldWidth;
- bottom = viewPtr->worldHeight;
- break;
- }
- if (GetEntryFromObj(viewPtr, objv[i], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (entryPtr == NULL) {
- continue;
- }
- if (entryPtr->flags & ENTRY_HIDE) {
- continue;
- }
- yBot = entryPtr->worldY + entryPtr->height;
- height = VPORTHEIGHT(viewPtr);
- if ((yBot <= viewPtr->yOffset) &&
- (entryPtr->worldY >= (viewPtr->yOffset + height))) {
- continue;
- }
- if (bottom < yBot) {
- bottom = yBot;
- }
- if (top > entryPtr->worldY) {
- top = entryPtr->worldY;
- }
- lWidth = ICONWIDTH(DEPTH(viewPtr, entryPtr->node));
- if (right < (entryPtr->worldX + entryPtr->width + lWidth)) {
- right = (entryPtr->worldX + entryPtr->width + lWidth);
- }
- if (left > entryPtr->worldX) {
- left = entryPtr->worldX;
- }
- }
-
- if (screen) {
- width = VPORTWIDTH(viewPtr);
- height = VPORTHEIGHT(viewPtr);
- /*
- * Do a min-max text for the intersection of the viewport and the
- * computed bounding box. If there is no intersection, return the
- * empty string.
- */
- if ((right < viewPtr->xOffset) || (bottom < viewPtr->yOffset) ||
- (left >= (viewPtr->xOffset + width)) ||
- (top >= (viewPtr->yOffset + height))) {
- return TCL_OK;
- }
- /* Otherwise clip the coordinates at the view port boundaries. */
- if (left < viewPtr->xOffset) {
- left = viewPtr->xOffset;
- } else if (right > (viewPtr->xOffset + width)) {
- right = viewPtr->xOffset + width;
- }
- if (top < viewPtr->yOffset) {
- top = viewPtr->yOffset;
- } else if (bottom > (viewPtr->yOffset + height)) {
- bottom = viewPtr->yOffset + height;
- }
- left = SCREENX(viewPtr, left), top = SCREENY(viewPtr, top);
- right = SCREENX(viewPtr, right), bottom = SCREENY(viewPtr, bottom);
- }
- if ((left < right) && (top < bottom)) {
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(left));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(top));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(right - left));
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(bottom - top));
- Tcl_SetObjResult(interp, listObjPtr);
- }
- return TCL_OK;
-}
-
-static void
-DrawButton(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- Drawable drawable;
- int sx, sy, dx, dy;
- int width, height;
- int left, right, top, bottom;
-
- dx = SCREENX(viewPtr, entryPtr->worldX) + entryPtr->buttonX;
- dy = SCREENY(viewPtr, entryPtr->worldY) + entryPtr->buttonY;
- width = viewPtr->button.width;
- height = viewPtr->button.height;
-
- top = viewPtr->titleHeight + viewPtr->inset;
- bottom = Tk_Height(viewPtr->tkwin) - viewPtr->inset;
- left = viewPtr->inset;
- right = Tk_Width(viewPtr->tkwin) - viewPtr->inset;
-
- if (((dx + width) < left) || (dx > right) ||
- ((dy + height) < top) || (dy > bottom)) {
- return; /* Value is clipped. */
- }
- drawable = Tk_GetPixmap(viewPtr->display, Tk_WindowId(viewPtr->tkwin),
- width, height, Tk_Depth(viewPtr->tkwin));
- /* Draw the background of the value. */
- Blt_TreeView_DrawButton(viewPtr, entryPtr, drawable, 0, 0);
-
- /* Clip the drawable if necessary */
- sx = sy = 0;
- if (dx < left) {
- width -= left - dx;
- sx += left - dx;
- dx = left;
- }
- if ((dx + width) >= right) {
- width -= (dx + width) - right;
- }
- if (dy < top) {
- height -= top - dy;
- sy += top - dy;
- dy = top;
- }
- if ((dy + height) >= bottom) {
- height -= (dy + height) - bottom;
- }
- XCopyArea(viewPtr->display, drawable, Tk_WindowId(viewPtr->tkwin),
- viewPtr->lineGC, sx, sy, width, height, dx, dy);
- Tk_FreePixmap(viewPtr->display, drawable);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonActivateOp --
- *
- * Selects the button to appear active.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ButtonActivateOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewEntry *oldPtr, *newPtr;
- char *string;
-
- string = Tcl_GetString(objv[3]);
- if (string[0] == '\0') {
- newPtr = NULL;
- } else if (GetEntryFromObj(viewPtr, objv[3], &newPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (viewPtr->treeColumn.flags & COLUMN_HIDDEN) {
- return TCL_OK;
- }
- if ((newPtr != NULL) && !(newPtr->flags & ENTRY_HAS_BUTTON)) {
- newPtr = NULL;
- }
- oldPtr = viewPtr->activeBtnPtr;
- viewPtr->activeBtnPtr = newPtr;
- if (!(viewPtr->flags & REDRAW_PENDING) && (newPtr != oldPtr)) {
- if ((oldPtr != NULL) && (oldPtr != viewPtr->rootPtr)) {
- DrawButton(viewPtr, oldPtr);
- }
- if ((newPtr != NULL) && (newPtr != viewPtr->rootPtr)) {
- DrawButton(viewPtr, newPtr);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonBindOp --
- *
- * .t bind tag sequence command
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ButtonBindOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- ClientData object;
- char *string;
-
- string = Tcl_GetString(objv[3]);
- /* Assume that this is a binding tag. */
- object = Blt_TreeView_ButtonTag(viewPtr, string);
- return Blt_ConfigureBindingsFromObj(interp, viewPtr->bindTable, object,
- objc - 4, objv + 4);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonCgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ButtonCgetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- return Blt_ConfigureValueFromObj(interp, viewPtr->tkwin, bltTreeViewButtonSpecs,
- (char *)viewPtr, objv[3], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonConfigureOp --
- *
- * This procedure is called to process a list of configuration options
- * database, in order to reconfigure the one of more entries in the
- * widget.
- *
- * .h button configure option value
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for viewPtr; old resources get freed, if there were any. The
- * hypertext is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ButtonConfigureOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin,
- bltTreeViewButtonSpecs, (char *)viewPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin,
- bltTreeViewButtonSpecs, (char *)viewPtr, objv[3], 0);
- }
- bltTreeViewIconsOption.clientData = viewPtr;
- if (Blt_ConfigureWidgetFromObj(viewPtr->interp, viewPtr->tkwin,
- bltTreeViewButtonSpecs, objc - 3, objv + 3, (char *)viewPtr,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_TreeView_ConfigureButtons(viewPtr);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonOp --
- *
- * This procedure handles button operations.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec buttonOps[] =
-{
- {"activate", 1, ButtonActivateOp, 4, 4, "tagOrId",},
- {"bind", 1, ButtonBindOp, 4, 6, "tagName ?sequence command?",},
- {"cget", 2, ButtonCgetOp, 4, 4, "option",},
- {"configure", 2, ButtonConfigureOp, 3, 0, "?option value?...",},
- {"highlight", 1, ButtonActivateOp, 4, 4, "tagOrId",},
-};
-
-static int nButtonOps = sizeof(buttonOps) / sizeof(Blt_OpSpec);
-
-static int
-ButtonOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TvCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nButtonOps, buttonOps, BLT_OP_ARG2, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (viewPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CgetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- return Blt_ConfigureValueFromObj(interp, viewPtr->tkwin, bltTreeViewSpecs,
- (char *)viewPtr, objv[2], 0);
-}
-
-/*ARGSUSED*/
-static int
-CloseOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
- TreeViewTagIter iter;
- int recurse, result;
- int i;
-
- recurse = FALSE;
-
- if (objc > 2) {
- char *string;
- int length;
-
- string = Tcl_GetStringFromObj(objv[2], &length);
- if ((string[0] == '-') && (length > 1) &&
- (strncmp(string, "-recurse", length) == 0)) {
- objv++, objc--;
- recurse = TRUE;
- }
- }
- for (i = 2; i < objc; i++) {
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- /*
- * Clear the selections for any entries that may have become
- * hidden by closing the node.
- */
- Blt_TreeView_PruneSelection(viewPtr, entryPtr);
-
- /*
- * Check if either the "focus" entry or selection anchor is in
- * this hierarchy. Must move it or disable it before we close
- * the node. Otherwise it may be deleted by a TCL "close"
- * script, and we'll be left pointing to a bogus memory location.
- */
- if ((viewPtr->focusPtr != NULL) &&
- (Blt_Tree_IsAncestor(entryPtr->node, viewPtr->focusPtr->node))){
- viewPtr->focusPtr = entryPtr;
- Blt_SetFocusItem(viewPtr->bindTable, viewPtr->focusPtr,
- ITEM_ENTRY);
- }
- if ((viewPtr->selAnchorPtr != NULL) &&
- (Blt_Tree_IsAncestor(entryPtr->node,
- viewPtr->selAnchorPtr->node))) {
- viewPtr->selMarkPtr = viewPtr->selAnchorPtr = NULL;
- }
- if ((viewPtr->activePtr != NULL) &&
- (Blt_Tree_IsAncestor(entryPtr->node,viewPtr->activePtr->node))){
- viewPtr->activePtr = entryPtr;
- }
- if (recurse) {
- result = Blt_TreeView_Apply(viewPtr, entryPtr,
- Blt_TreeView_CloseEntry, 0);
- } else {
- result = Blt_TreeView_CloseEntry(viewPtr, entryPtr);
- }
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- /* Closing a node may affect the visible entries and the the world layout
- * of the entries. */
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY /*| RESORT */);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * This procedure is called to process an objv/objc list, plus the Tk
- * option database, in order to configure (or reconfigure) the widget.
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for viewPtr; old resources get freed, if there were any. The widget
- * is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin,
- bltTreeViewSpecs, (char *)viewPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin,
- bltTreeViewSpecs, (char *)viewPtr, objv[2], 0);
- }
- bltTreeViewIconsOption.clientData = viewPtr;
- bltTreeViewTreeOption.clientData = viewPtr;
- if (Blt_ConfigureWidgetFromObj(interp, viewPtr->tkwin, bltTreeViewSpecs,
- objc - 2, objv + 2, (char *)viewPtr, BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_TreeView_UpdateWidget(interp, viewPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-CurselectionOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (viewPtr->flags & TV_SELECT_SORTED) {
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(viewPtr->selected); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TreeViewEntry *entryPtr;
- Tcl_Obj *objPtr;
-
- entryPtr = Blt_Chain_GetValue(link);
- objPtr = NodeToObj(entryPtr->node);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
-
- }
- } else {
- TreeViewEntry *entryPtr;
-
- for (entryPtr = viewPtr->rootPtr; entryPtr != NULL;
- entryPtr = Blt_TreeView_NextEntry(entryPtr, ENTRY_MASK)) {
-
- if (Blt_TreeView_EntryIsSelected(viewPtr, entryPtr)) {
- Tcl_Obj *objPtr;
-
- objPtr = NodeToObj(entryPtr->node);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BindOp --
- *
- * .t bind tagOrId sequence command
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BindOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- ClientData object;
- TreeViewEntry *entryPtr;
- const char *string;
- long inode;
-
- /*
- * Entries are selected by id only. All other strings are interpreted as
- * a binding tag.
- */
- string = Tcl_GetString(objv[2]);
- if ((isdigit(UCHAR(string[0]))) &&
- (Tcl_GetLongFromObj(viewPtr->interp, objv[2], &inode) == TCL_OK)) {
- Blt_TreeNode node;
-
- node = Blt_Tree_GetNode(viewPtr->tree, inode);
- object = Blt_TreeView_NodeToEntry(viewPtr, node);
- } else if (GetEntryFromSpecialId(viewPtr, string, &entryPtr) == TCL_OK) {
- if (entryPtr != NULL) {
- return TCL_OK; /* Special id doesn't currently exist. */
- }
- object = entryPtr;
- } else {
- /* Assume that this is a binding tag. */
- object = Blt_TreeView_EntryTag(viewPtr, string);
- }
- return Blt_ConfigureBindingsFromObj(interp, viewPtr->bindTable, object,
- objc - 3, objv + 3);
-}
-
-
-/*ARGSUSED*/
-static int
-EditOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
- char *string;
- int isRoot, isTest;
- int x, y;
-
- isRoot = isTest = FALSE;
- string = Tcl_GetString(objv[2]);
- if (strcmp("-root", string) == 0) {
- isRoot = TRUE;
- objv++, objc--;
- }
- string = Tcl_GetString(objv[2]);
- if (strcmp("-test", string) == 0) {
- isTest = TRUE;
- objv++, objc--;
- }
- if (objc != 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ", Tcl_GetString(objv[1]),
- " ?-root? x y\"", (char *)NULL);
- return TCL_ERROR;
-
- }
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (isRoot) {
- int rootX, rootY;
-
- Tk_GetRootCoords(viewPtr->tkwin, &rootX, &rootY);
- x -= rootX;
- y -= rootY;
- }
- entryPtr = Blt_TreeView_NearestEntry(viewPtr, x, y, FALSE);
- if (entryPtr != NULL) {
- Blt_ChainLink link;
- int worldX;
-
- worldX = WORLDX(viewPtr, x);
- for (link = Blt_Chain_FirstLink(viewPtr->columns); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- TreeViewColumn *columnPtr;
-
- columnPtr = Blt_Chain_GetValue(link);
- if (columnPtr->flags & COLUMN_READONLY) {
- continue; /* Column isn't editable. */
- }
- if ((worldX >= columnPtr->worldX) &&
- (worldX < (columnPtr->worldX + columnPtr->width))) {
- TreeViewStyle *stylePtr;
-
- stylePtr = NULL;
- if (columnPtr != &viewPtr->treeColumn) {
- TreeViewValue *valuePtr;
-
- valuePtr = Blt_TreeView_FindValue(entryPtr, columnPtr);
- if (valuePtr == NULL) {
- continue;
- }
- stylePtr = valuePtr->stylePtr;
- }
- if (stylePtr == NULL) {
- stylePtr = columnPtr->stylePtr;
- }
- if ((columnPtr->flags & COLUMN_READONLY) ||
- (stylePtr->classPtr->editProc == NULL)) {
- continue;
- }
- if (!isTest) {
- if ((*stylePtr->classPtr->editProc)(viewPtr, entryPtr,
- columnPtr, stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), TRUE);
- return TCL_OK;
- }
- }
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), FALSE);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryActivateOp --
- *
- * Selects the entry to appear active.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EntryActivateOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewEntry *newPtr, *oldPtr;
- char *string;
-
- string = Tcl_GetString(objv[3]);
- if (string[0] == '\0') {
- newPtr = NULL;
- } else if (GetEntryFromObj(viewPtr, objv[3], &newPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (viewPtr->treeColumn.flags & COLUMN_HIDDEN) {
- return TCL_OK;
- }
- oldPtr = viewPtr->activePtr;
- viewPtr->activePtr = newPtr;
- if (!(viewPtr->flags & REDRAW_PENDING) && (newPtr != oldPtr)) {
- Drawable drawable;
-
- drawable = Tk_WindowId(viewPtr->tkwin);
- if (oldPtr != NULL) {
- Blt_TreeView_DrawLabel(viewPtr, oldPtr, drawable);
- }
- if (newPtr != NULL) {
- Blt_TreeView_DrawLabel(viewPtr, newPtr, drawable);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryCgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EntryCgetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
-
- if (Blt_TreeView_GetEntry(viewPtr, objv[3], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_ConfigureValueFromObj(interp, viewPtr->tkwin,
- bltTreeViewEntrySpecs, (char *)entryPtr, objv[4], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryConfigureOp --
- *
- * This procedure is called to process a list of configuration options
- * database, in order to reconfigure the one of more entries in the
- * widget.
- *
- * .h entryconfigure node node node node option value
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for viewPtr; old resources get freed, if there were any. The
- * hypertext is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-EntryConfigureOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int nIds, configObjc;
- Tcl_Obj *const *configObjv;
- int i;
- TreeViewEntry *entryPtr;
- TreeViewTagIter iter;
- char *string;
-
- /* Figure out where the option value pairs begin */
- objc -= 3, objv += 3;
- for (i = 0; i < objc; i++) {
- string = Tcl_GetString(objv[i]);
- if (string[0] == '-') {
- break;
- }
- }
- nIds = i; /* # of tags or ids specified */
- configObjc = objc - i; /* # of options specified */
- configObjv = objv + i; /* Start of options in objv */
-
- bltTreeViewIconsOption.clientData = viewPtr;
- bltTreeViewUidOption.clientData = viewPtr;
-
- for (i = 0; i < nIds; i++) {
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- if (configObjc == 0) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin,
- bltTreeViewEntrySpecs, (char *)entryPtr,
- (Tcl_Obj *)NULL, 0);
- } else if (configObjc == 1) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin,
- bltTreeViewEntrySpecs, (char *)entryPtr,
- configObjv[0], 0);
- }
- if (Blt_TreeView_ConfigureEntry(viewPtr, entryPtr, configObjc,
- configObjv, BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- viewPtr->flags |= (DIRTY | LAYOUT_PENDING | SCROLL_PENDING /*| RESORT */);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryIsOpenOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EntryIsBeforeOp(
- TreeView *viewPtr,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewEntry *e1Ptr, *e2Ptr;
- int bool;
-
- if ((Blt_TreeView_GetEntry(viewPtr, objv[3], &e1Ptr) != TCL_OK) ||
- (Blt_TreeView_GetEntry(viewPtr, objv[4], &e2Ptr) != TCL_OK)) {
- return TCL_ERROR;
- }
- bool = Blt_Tree_IsBefore(e1Ptr->node, e2Ptr->node);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryIsHiddenOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EntryIsHiddenOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
- int bool;
-
- if (Blt_TreeView_GetEntry(viewPtr, objv[3], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- bool = (entryPtr->flags & ENTRY_HIDE);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryIsOpenOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EntryIsOpenOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
- int bool;
-
- if (Blt_TreeView_GetEntry(viewPtr, objv[3], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- bool = ((entryPtr->flags & ENTRY_CLOSED) == 0);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryChildrenOp --
- *
- * $treeview entry children $gid ?switches?
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EntryChildrenOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewEntry *parentPtr;
- Tcl_Obj *listObjPtr;
- ChildrenSwitches switches;
- TreeViewEntry *entryPtr;
-
- if (Blt_TreeView_GetEntry(viewPtr, objv[3], &parentPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- switches.mask = 0;
- if (Blt_ParseSwitches(interp, childrenSwitches, objc - 4, objv + 4,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
-
- for (entryPtr = Blt_TreeView_FirstChild(parentPtr, switches.mask);
- entryPtr != NULL;
- entryPtr = Blt_TreeView_NextSibling(entryPtr, switches.mask)) {
- Tcl_Obj *objPtr;
-
- objPtr = NodeToObj(entryPtr->node);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryDeleteOp --
- *
- * .tv entry degree $entry
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EntryDegreeOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewEntry *parentPtr, *entryPtr;
- long count;
-
- if (Blt_TreeView_GetEntry(viewPtr, objv[3], &parentPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- count = 0;
- for (entryPtr = Blt_TreeView_FirstChild(parentPtr, ENTRY_HIDE);
- entryPtr != NULL;
- entryPtr = Blt_TreeView_NextSibling(entryPtr, ENTRY_HIDE)) {
- count++;
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), count);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryDeleteOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EntryDeleteOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
-
- if (Blt_TreeView_GetEntry(viewPtr, objv[3], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 5) {
- long entryPos;
- Blt_TreeNode node;
- /*
- * Delete a single child node from a hierarchy specified by its
- * numeric position.
- */
- if (Blt_GetPositionFromObj(interp, objv[3], &entryPos) != TCL_OK) {
- return TCL_ERROR;
- }
- if (entryPos >= (long)Blt_Tree_NodeDegree(entryPtr->node)) {
- return TCL_OK; /* Bad first index */
- }
- if (entryPos == END) {
- node = Blt_Tree_LastChild(entryPtr->node);
- } else {
- node = GetNthNode(entryPtr->node, entryPos);
- }
- DeleteNode(viewPtr, node);
- } else {
- long firstPos, lastPos;
- Blt_TreeNode node, first, last, next;
- long nEntries;
- /*
- * Delete range of nodes in hierarchy specified by first/last
- * positions.
- */
- if ((Blt_GetPositionFromObj(interp, objv[4], &firstPos) != TCL_OK) ||
- (Blt_GetPositionFromObj(interp, objv[5], &lastPos) != TCL_OK)) {
- return TCL_ERROR;
- }
- nEntries = Blt_Tree_NodeDegree(entryPtr->node);
- if (nEntries == 0) {
- return TCL_OK;
- }
- if (firstPos == END) {
- firstPos = nEntries - 1;
- }
- if (firstPos >= nEntries) {
- Tcl_AppendResult(interp, "first position \"",
- Tcl_GetString(objv[4]), " is out of range", (char *)NULL);
- return TCL_ERROR;
- }
- if ((lastPos == END) || (lastPos >= nEntries)) {
- lastPos = nEntries - 1;
- }
- if (firstPos > lastPos) {
- Tcl_AppendResult(interp, "bad range: \"", Tcl_GetString(objv[4]),
- " > ", Tcl_GetString(objv[5]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- first = GetNthNode(entryPtr->node, firstPos);
- last = GetNthNode(entryPtr->node, lastPos);
- for (node = first; node != NULL; node = next) {
- next = Blt_Tree_NextSibling(node);
- DeleteNode(viewPtr, node);
- if (node == last) {
- break;
- }
- }
- }
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY /*| RESORT */);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntrySizeOp --
- *
- * Counts the number of entries at this node.
- *
- * Results:
- * A standard TCL result. If an error occurred TCL_ERROR is returned and
- * interp->result will contain an error message. Otherwise, TCL_OK is
- * returned and interp->result contains the number of entries.
- *
- *---------------------------------------------------------------------------
- */
-static int
-EntrySizeOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
- int length, recurse;
- long sum;
- char *string;
-
- recurse = FALSE;
- string = Tcl_GetStringFromObj(objv[3], &length);
- if ((string[0] == '-') && (length > 1) &&
- (strncmp(string, "-recurse", length) == 0)) {
- objv++, objc--;
- recurse = TRUE;
- }
- if (objc == 3) {
- Tcl_AppendResult(interp, "missing node argument: should be \"",
- Tcl_GetString(objv[0]), " entry open node\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (Blt_TreeView_GetEntry(viewPtr, objv[3], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
-
- if (recurse) {
- sum = Blt_Tree_Size(entryPtr->node);
- } else {
- sum = Blt_Tree_NodeDegree(entryPtr->node);
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), sum);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EntryOp --
- *
- * This procedure handles entry operations.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-
-static Blt_OpSpec entryOps[] =
-{
- {"activate", 1, EntryActivateOp, 4, 4, "tagOrId",},
- /*bbox*/
- /*bind*/
- {"cget", 2, EntryCgetOp, 5, 5, "tagOrId option",},
- {"children", 2, EntryChildrenOp, 4, 0, "tagOrId ?switches?",},
- /*close*/
- {"configure", 2, EntryConfigureOp, 4, 0,
- "tagOrId ?tagOrId...? ?option value?...",},
- {"degree", 3, EntryDegreeOp, 4, 4, "tagOrId",},
- {"delete", 3, EntryDeleteOp, 5, 6, "tagOrId firstPos ?lastPos?",},
- /*focus*/
- /*hide*/
- {"highlight", 1, EntryActivateOp, 4, 4, "tagOrId",},
- /*index*/
- {"isbefore", 3, EntryIsBeforeOp, 5, 5, "tagOrId tagOrId",},
- {"ishidden", 3, EntryIsHiddenOp, 4, 4, "tagOrId",},
- {"isopen", 3, EntryIsOpenOp, 4, 4, "tagOrId",},
- /*move*/
- /*nearest*/
- /*open*/
- /*see*/
- /*show*/
- {"size", 1, EntrySizeOp, 4, 5, "?-recurse? tagOrId",},
- /*toggle*/
-};
-static int nEntryOps = sizeof(entryOps) / sizeof(Blt_OpSpec);
-
-static int
-EntryOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TvCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nEntryOps, entryOps, BLT_OP_ARG2, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (viewPtr, interp, objc, objv);
- return result;
-}
-
-/*ARGSUSED*/
-static int
-ExactCompare(Tcl_Interp *interp, const char *name, const char *pattern)
-{
- return (strcmp(name, pattern) == 0);
-}
-
-/*ARGSUSED*/
-static int
-GlobCompare(Tcl_Interp *interp, const char *name, const char *pattern)
-{
- return Tcl_StringMatch(name, pattern);
-}
-
-static int
-RegexpCompare(Tcl_Interp *interp, const char *name, const char *pattern)
-{
- return Tcl_RegExpMatch(interp, name, pattern);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindOp --
- *
- * Find one or more nodes based upon the pattern provided.
- *
- * Results:
- * A standard TCL result. The interpreter result will contain a list of
- * the node serial identifiers.
- *
- *---------------------------------------------------------------------------
- */
-static int
-FindOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewEntry *firstPtr, *lastPtr;
- int nMatches, maxMatches;
- char c;
- int length;
- TreeViewCompareProc *compareProc;
- TreeViewIterProc *nextProc;
- int invertMatch; /* normal search mode (matching entries) */
- char *namePattern, *fullPattern;
- char *execCmd;
- int i;
- int result;
- char *pattern, *option;
- Blt_List options;
- Blt_ListNode node;
- char *addTag, *withTag;
- TreeViewEntry *entryPtr;
- char *string;
- Tcl_Obj *listObjPtr, *objPtr;
-
- invertMatch = FALSE;
- maxMatches = 0;
- execCmd = namePattern = fullPattern = NULL;
- compareProc = ExactCompare;
- nextProc = Blt_TreeView_NextEntry;
- options = Blt_List_Create(BLT_ONE_WORD_KEYS);
- withTag = addTag = NULL;
-
- entryPtr = viewPtr->rootPtr;
- /*
- * Step 1: Process flags for find operation.
- */
- for (i = 2; i < objc; i++) {
- string = Tcl_GetStringFromObj(objv[i], &length);
- if (string[0] != '-') {
- break;
- }
- option = string + 1;
- length--;
- c = option[0];
- if ((c == 'e') && (length > 2) &&
- (strncmp(option, "exact", length) == 0)) {
- compareProc = ExactCompare;
- } else if ((c == 'g') && (strncmp(option, "glob", length) == 0)) {
- compareProc = GlobCompare;
- } else if ((c == 'r') && (strncmp(option, "regexp", length) == 0)) {
- compareProc = RegexpCompare;
- } else if ((c == 'n') && (length > 1) &&
- (strncmp(option, "nonmatching", length) == 0)) {
- invertMatch = TRUE;
- } else if ((c == 'n') && (length > 1) &&
- (strncmp(option, "name", length) == 0)) {
- if ((i + 1) == objc) {
- goto missingArg;
- }
- i++;
- namePattern = Tcl_GetString(objv[i]);
- } else if ((c == 'f') && (strncmp(option, "full", length) == 0)) {
- if ((i + 1) == objc) {
- goto missingArg;
- }
- i++;
- fullPattern = Tcl_GetString(objv[i]);
- } else if ((c == 'e') && (length > 2) &&
- (strncmp(option, "exec", length) == 0)) {
- if ((i + 1) == objc) {
- goto missingArg;
- }
- i++;
- execCmd = Tcl_GetString(objv[i]);
- } else if ((c == 'a') && (length > 1) &&
- (strncmp(option, "addtag", length) == 0)) {
- if ((i + 1) == objc) {
- goto missingArg;
- }
- i++;
- addTag = Tcl_GetString(objv[i]);
- } else if ((c == 't') && (length > 1) &&
- (strncmp(option, "tag", length) == 0)) {
- if ((i + 1) == objc) {
- goto missingArg;
- }
- i++;
- withTag = Tcl_GetString(objv[i]);
- } else if ((c == 'c') && (strncmp(option, "count", length) == 0)) {
- if ((i + 1) == objc) {
- goto missingArg;
- }
- i++;
- if (Tcl_GetIntFromObj(interp, objv[i], &maxMatches) != TCL_OK) {
- return TCL_ERROR;
- }
- if (maxMatches < 0) {
- Tcl_AppendResult(interp, "bad match count \"", objv[i],
- "\": should be a positive number", (char *)NULL);
- Blt_List_Destroy(options);
- return TCL_ERROR;
- }
- } else if ((option[0] == '-') && (option[1] == '\0')) {
- break;
- } else {
- /*
- * Verify that the switch is actually an entry configuration
- * option.
- */
- if (Blt_ConfigureValueFromObj(interp, viewPtr->tkwin,
- bltTreeViewEntrySpecs, (char *)entryPtr, objv[i], 0)
- != TCL_OK) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad find switch \"", string, "\"",
- (char *)NULL);
- Blt_List_Destroy(options);
- return TCL_ERROR;
- }
- if ((i + 1) == objc) {
- goto missingArg;
- }
- /* Save the option in the list of configuration options */
- node = Blt_List_GetNode(options, (char *)objv[i]);
- if (node == NULL) {
- node = Blt_List_CreateNode(options, (char *)objv[i]);
- Blt_List_AppendNode(options, node);
- }
- i++;
- Blt_List_SetValue(node, Tcl_GetString(objv[i]));
- }
- }
-
- if ((objc - i) > 2) {
- Blt_List_Destroy(options);
- Tcl_AppendResult(interp, "too many args", (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * Step 2: Find the range of the search. Check the order of two
- * nodes and arrange the search accordingly.
- *
- * Note: Be careful to treat "end" as the end of all nodes, instead
- * of the end of visible nodes. That way, we can search the
- * entire tree, even if the last folder is closed.
- */
- firstPtr = viewPtr->rootPtr; /* Default to root node */
- lastPtr = LastEntry(viewPtr, firstPtr, 0);
-
- if (i < objc) {
- string = Tcl_GetString(objv[i]);
- if ((string[0] == 'e') && (strcmp(string, "end") == 0)) {
- firstPtr = LastEntry(viewPtr, viewPtr->rootPtr, 0);
- } else if (Blt_TreeView_GetEntry(viewPtr, objv[i], &firstPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- i++;
- }
- if (i < objc) {
- string = Tcl_GetString(objv[i]);
- if ((string[0] == 'e') && (strcmp(string, "end") == 0)) {
- lastPtr = LastEntry(viewPtr, viewPtr->rootPtr, 0);
- } else if (Blt_TreeView_GetEntry(viewPtr, objv[i], &lastPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (Blt_Tree_IsBefore(lastPtr->node, firstPtr->node)) {
- nextProc = Blt_TreeView_PrevEntry;
- }
- nMatches = 0;
-
- /*
- * Step 3: Search through the tree and look for nodes that match the
- * current pattern specifications. Save the name of each of
- * the matching nodes.
- */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (entryPtr = firstPtr; entryPtr != NULL;
- entryPtr = (*nextProc) (entryPtr, 0)) {
- if (namePattern != NULL) {
- result = (*compareProc)(interp, Blt_Tree_NodeLabel(entryPtr->node),
- namePattern);
- if (result == invertMatch) {
- goto nextEntry; /* Failed to match */
- }
- }
- if (fullPattern != NULL) {
- Tcl_DString fullName;
-
- Blt_TreeView_GetFullName(viewPtr, entryPtr, FALSE, &fullName);
- result = (*compareProc) (interp, Tcl_DStringValue(&fullName),
- fullPattern);
- Tcl_DStringFree(&fullName);
- if (result == invertMatch) {
- goto nextEntry; /* Failed to match */
- }
- }
- if (withTag != NULL) {
- result = Blt_Tree_HasTag(viewPtr->tree, entryPtr->node, withTag);
- if (result == invertMatch) {
- goto nextEntry; /* Failed to match */
- }
- }
- for (node = Blt_List_FirstNode(options); node != NULL;
- node = Blt_List_NextNode(node)) {
- objPtr = (Tcl_Obj *)Blt_List_GetKey(node);
- Tcl_ResetResult(interp);
- Blt_ConfigureValueFromObj(interp, viewPtr->tkwin,
- bltTreeViewEntrySpecs, (char *)entryPtr, objPtr, 0);
- pattern = Blt_List_GetValue(node);
- objPtr = Tcl_GetObjResult(interp);
- result = (*compareProc) (interp, Tcl_GetString(objPtr), pattern);
- if (result == invertMatch) {
- goto nextEntry; /* Failed to match */
- }
- }
- /*
- * Someone may actually delete the current node in the "exec"
- * callback. Preserve the entry.
- */
- Tcl_Preserve(entryPtr);
- if (execCmd != NULL) {
- Tcl_DString cmdString;
-
- Blt_TreeView_PercentSubst(viewPtr, entryPtr, execCmd, &cmdString);
- result = Tcl_GlobalEval(interp, Tcl_DStringValue(&cmdString));
- Tcl_DStringFree(&cmdString);
- if (result != TCL_OK) {
- Tcl_Release(entryPtr);
- goto error;
- }
- }
- /* A NULL node reference in an entry indicates that the entry
- * was deleted, but its memory not released yet. */
- if (entryPtr->node != NULL) {
- /* Finally, save the matching node name. */
- objPtr = NodeToObj(entryPtr->node);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- if (addTag != NULL) {
- if (AddTag(viewPtr, entryPtr->node, addTag) != TCL_OK) {
- goto error;
- }
- }
- }
-
- Tcl_Release(entryPtr);
- nMatches++;
- if ((nMatches == maxMatches) && (maxMatches > 0)) {
- break;
- }
- nextEntry:
- if (entryPtr == lastPtr) {
- break;
- }
- }
- Tcl_ResetResult(interp);
- Blt_List_Destroy(options);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-
- missingArg:
- Tcl_AppendResult(interp, "missing argument for find option \"", objv[i],
- "\"", (char *)NULL);
- error:
- Blt_List_Destroy(options);
- return TCL_ERROR;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetOp --
- *
- * Converts one or more node identifiers to its path component. The path
- * may be either the single entry name or the full path of the entry.
- *
- * Results:
- * A standard TCL result. The interpreter result will contain a list of
- * the convert names.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewTagIter iter;
- TreeViewEntry *entryPtr;
- int useFullName;
- int i;
- Tcl_DString d1, d2;
- int count;
-
- useFullName = FALSE;
- if (objc > 2) {
- char *string;
-
- string = Tcl_GetString(objv[2]);
- if ((string[0] == '-') && (strcmp(string, "-full") == 0)) {
- useFullName = TRUE;
- objv++, objc--;
- }
- }
- Tcl_DStringInit(&d1); /* Result. */
- Tcl_DStringInit(&d2); /* Last element. */
- count = 0;
- for (i = 2; i < objc; i++) {
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- Tcl_DStringSetLength(&d2, 0);
- count++;
- if (entryPtr->node != NULL) {
- if (useFullName) {
- Blt_TreeView_GetFullName(viewPtr, entryPtr, FALSE, &d2);
- } else {
- Tcl_DStringAppend(&d2,Blt_Tree_NodeLabel(entryPtr->node),-1);
- }
- Tcl_DStringAppendElement(&d1, Tcl_DStringValue(&d2));
- }
- }
- }
- /* This handles the single element list problem. */
- if (count == 1) {
- Tcl_DStringResult(interp, &d2);
- Tcl_DStringFree(&d1);
- } else {
- Tcl_DStringResult(interp, &d1);
- Tcl_DStringFree(&d2);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SearchAndApplyToTree --
- *
- * Searches through the current tree and applies a procedure to matching
- * nodes. The search specification is taken from the following
- * command-line arguments:
- *
- * ?-exact? ?-glob? ?-regexp? ?-nonmatching?
- * ?-data string?
- * ?-name string?
- * ?-full string?
- * ?--?
- * ?inode...?
- *
- * Results:
- * A standard TCL result. If the result is valid, and if the nonmatchPtr
- * is specified, it returns a boolean value indicating whether or not the
- * search was inverted. This is needed to fix things properly for the
- * "hide nonmatching" case.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SearchAndApplyToTree(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv, TreeViewApplyProc *proc, int *nonMatchPtr)
-{
- TreeViewCompareProc *compareProc;
- int invertMatch; /* Normal search mode (matching
- * entries) */
- char *namePattern, *fullPattern;
- int i;
- int length;
- int result;
- char *option, *pattern;
- char c;
- Blt_List options;
- TreeViewEntry *entryPtr;
- Blt_ListNode node;
- char *string;
- char *withTag;
- Tcl_Obj *objPtr;
- TreeViewTagIter iter;
-
- options = Blt_List_Create(BLT_ONE_WORD_KEYS);
- invertMatch = FALSE;
- namePattern = fullPattern = NULL;
- compareProc = ExactCompare;
- withTag = NULL;
-
- entryPtr = viewPtr->rootPtr;
- for (i = 2; i < objc; i++) {
- string = Tcl_GetStringFromObj(objv[i], &length);
- if (string[0] != '-') {
- break;
- }
- option = string + 1;
- length--;
- c = option[0];
- if ((c == 'e') && (strncmp(option, "exact", length) == 0)) {
- compareProc = ExactCompare;
- } else if ((c == 'g') && (strncmp(option, "glob", length) == 0)) {
- compareProc = GlobCompare;
- } else if ((c == 'r') && (strncmp(option, "regexp", length) == 0)) {
- compareProc = RegexpCompare;
- } else if ((c == 'n') && (length > 1) &&
- (strncmp(option, "nonmatching", length) == 0)) {
- invertMatch = TRUE;
- } else if ((c == 'f') && (strncmp(option, "full", length) == 0)) {
- if ((i + 1) == objc) {
- goto missingArg;
- }
- i++;
- fullPattern = Tcl_GetString(objv[i]);
- } else if ((c == 'n') && (length > 1) &&
- (strncmp(option, "name", length) == 0)) {
- if ((i + 1) == objc) {
- goto missingArg;
- }
- i++;
- namePattern = Tcl_GetString(objv[i]);
- } else if ((c == 't') && (length > 1) &&
- (strncmp(option, "tag", length) == 0)) {
- if ((i + 1) == objc) {
- goto missingArg;
- }
- i++;
- withTag = Tcl_GetString(objv[i]);
- } else if ((option[0] == '-') && (option[1] == '\0')) {
- break;
- } else {
- /*
- * Verify that the switch is actually an entry configuration
- * option.
- */
- if (Blt_ConfigureValueFromObj(interp, viewPtr->tkwin,
- bltTreeViewEntrySpecs, (char *)entryPtr, objv[i], 0)
- != TCL_OK) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad switch \"", string,
- "\": must be -exact, -glob, -regexp, -name, -full, or -nonmatching",
- (char *)NULL);
- return TCL_ERROR;
- }
- if ((i + 1) == objc) {
- goto missingArg;
- }
- /* Save the option in the list of configuration options */
- node = Blt_List_GetNode(options, (char *)objv[i]);
- if (node == NULL) {
- node = Blt_List_CreateNode(options, (char *)objv[i]);
- Blt_List_AppendNode(options, node);
- }
- i++;
- Blt_List_SetValue(node, Tcl_GetString(objv[i]));
- }
- }
-
- if ((namePattern != NULL) || (fullPattern != NULL) ||
- (Blt_List_GetLength(options) > 0)) {
- /*
- * Search through the tree and look for nodes that match the current
- * spec. Apply the input procedure to each of the matching nodes.
- */
- for (entryPtr = viewPtr->rootPtr; entryPtr != NULL;
- entryPtr = Blt_TreeView_NextEntry(entryPtr, 0)) {
- if (namePattern != NULL) {
- result = (*compareProc) (interp,
- Blt_Tree_NodeLabel(entryPtr->node), namePattern);
- if (result == invertMatch) {
- continue; /* Failed to match */
- }
- }
- if (fullPattern != NULL) {
- Tcl_DString dString;
-
- Blt_TreeView_GetFullName(viewPtr, entryPtr, FALSE, &dString);
- result = (*compareProc) (interp, Tcl_DStringValue(&dString),
- fullPattern);
- Tcl_DStringFree(&dString);
- if (result == invertMatch) {
- continue; /* Failed to match */
- }
- }
- if (withTag != NULL) {
- result = Blt_Tree_HasTag(viewPtr->tree, entryPtr->node, withTag);
- if (result == invertMatch) {
- continue; /* Failed to match */
- }
- }
- for (node = Blt_List_FirstNode(options); node != NULL;
- node = Blt_List_NextNode(node)) {
- objPtr = (Tcl_Obj *)Blt_List_GetKey(node);
- Tcl_ResetResult(interp);
- if (Blt_ConfigureValueFromObj(interp, viewPtr->tkwin,
- bltTreeViewEntrySpecs, (char *)entryPtr, objPtr, 0)
- != TCL_OK) {
- return TCL_ERROR; /* This shouldn't happen. */
- }
- pattern = Blt_List_GetValue(node);
- objPtr = Tcl_GetObjResult(interp);
- result = (*compareProc)(interp, Tcl_GetString(objPtr), pattern);
- if (result == invertMatch) {
- continue; /* Failed to match */
- }
- }
- /* Finally, apply the procedure to the node */
- (*proc) (viewPtr, entryPtr);
- }
- Tcl_ResetResult(interp);
- Blt_List_Destroy(options);
- }
- /*
- * Apply the procedure to nodes that have been specified individually.
- */
- for ( /*empty*/ ; i < objc; i++) {
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- if ((*proc) (viewPtr, entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- if (nonMatchPtr != NULL) {
- *nonMatchPtr = invertMatch; /* return "inverted search" status */
- }
- return TCL_OK;
-
- missingArg:
- Blt_List_Destroy(options);
- Tcl_AppendResult(interp, "missing pattern for search option \"", objv[i],
- "\"", (char *)NULL);
- return TCL_ERROR;
-
-}
-
-static int
-FixSelectionsApplyProc(TreeView *viewPtr, TreeViewEntry *entryPtr)
-{
- if (entryPtr->flags & ENTRY_HIDE) {
- Blt_TreeView_DeselectEntry(viewPtr, entryPtr);
- if ((viewPtr->focusPtr != NULL) &&
- (Blt_Tree_IsAncestor(entryPtr->node, viewPtr->focusPtr->node))) {
- if (entryPtr != viewPtr->rootPtr) {
- entryPtr = Blt_TreeView_ParentEntry(entryPtr);
- viewPtr->focusPtr = (entryPtr == NULL)
- ? viewPtr->focusPtr : entryPtr;
- Blt_SetFocusItem(viewPtr->bindTable, viewPtr->focusPtr, ITEM_ENTRY);
- }
- }
- if ((viewPtr->selAnchorPtr != NULL) &&
- (Blt_Tree_IsAncestor(entryPtr->node, viewPtr->selAnchorPtr->node))) {
- viewPtr->selMarkPtr = viewPtr->selAnchorPtr = NULL;
- }
- if ((viewPtr->activePtr != NULL) &&
- (Blt_Tree_IsAncestor(entryPtr->node, viewPtr->activePtr->node))) {
- viewPtr->activePtr = NULL;
- }
- Blt_TreeView_PruneSelection(viewPtr, entryPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HideOp --
- *
- * Hides one or more nodes. Nodes can be specified by their inode, or by
- * matching a name or data value pattern. By default, the patterns are
- * matched exactly. They can also be matched using glob-style and
- * regular expression rules.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-HideOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int status, nonmatching;
-
- status = SearchAndApplyToTree(viewPtr, interp, objc, objv,
- HideEntryApplyProc, &nonmatching);
-
- if (status != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * If this was an inverted search, scan back through the tree and make
- * sure that the parents for all visible nodes are also visible. After
- * all, if a node is supposed to be visible, its parent can't be hidden.
- */
- if (nonmatching) {
- Blt_TreeView_Apply(viewPtr, viewPtr->rootPtr, MapAncestorsApplyProc, 0);
- }
- /*
- * Make sure that selections are cleared from any hidden nodes. This
- * wasn't done earlier--we had to delay it until we fixed the visibility
- * status for the parents.
- */
- Blt_TreeView_Apply(viewPtr, viewPtr->rootPtr, FixSelectionsApplyProc, 0);
-
- /* Hiding an entry only effects the visible nodes. */
- viewPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ShowOp --
- *
- * Mark one or more nodes to be exposed. Nodes can be specified by their
- * inode, or by matching a name or data value pattern. By default, the
- * patterns are matched exactly. They can also be matched using
- * glob-style and regular expression rules.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ShowOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (SearchAndApplyToTree(viewPtr, interp, objc, objv, ShowEntryApplyProc,
- (int *)NULL) != TCL_OK) {
- return TCL_ERROR;
- }
- viewPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- * Converts one of more words representing indices of the entries in the
- * treeview widget to their respective serial identifiers.
- *
- * Results:
- * A standard TCL result. Interp->result will contain the identifier of
- * each inode found. If an inode could not be found, then the serial
- * identifier will be the empty string.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IndexOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
- char *string;
- TreeViewEntry *fromPtr;
- int usePath;
- long inode;
-
- usePath = FALSE;
- fromPtr = NULL;
- string = Tcl_GetString(objv[2]);
- if ((string[0] == '-') && (strcmp(string, "-path") == 0)) {
- usePath = TRUE;
- objv++, objc--;
- }
- if ((string[0] == '-') && (strcmp(string, "-at") == 0)) {
- if (Blt_TreeView_GetEntry(viewPtr, objv[3], &fromPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- objv += 2, objc -= 2;
- }
- if (objc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]),
- " index ?-at tagOrId? ?-path? tagOrId\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- viewPtr->fromPtr = fromPtr;
- if (viewPtr->fromPtr == NULL) {
- viewPtr->fromPtr = viewPtr->focusPtr;
- }
- if (viewPtr->fromPtr == NULL) {
- viewPtr->fromPtr = viewPtr->rootPtr;
- }
- inode = -1;
- if (usePath) {
- if (fromPtr == NULL) {
- fromPtr = viewPtr->rootPtr;
- }
- string = Tcl_GetString(objv[2]);
- entryPtr = FindPath(viewPtr, fromPtr, string);
- if (entryPtr != NULL) {
- inode = Blt_Tree_NodeId(entryPtr->node);
- }
- } else {
- if ((GetEntryFromObj2(viewPtr, objv[2], &entryPtr) == TCL_OK) &&
- (entryPtr != NULL)) {
- inode = Blt_Tree_NodeId(entryPtr->node);
- }
- }
- Tcl_SetLongObj(Tcl_GetObjResult(interp), inode);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InsertOp --
- *
- * Add new entries into a hierarchy. If no node is specified, new
- * entries will be added to the root of the hierarchy.
- *
- *---------------------------------------------------------------------------
- */
-static int
-InsertOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node, parent;
- Tcl_Obj *const *options;
- Tcl_Obj *listObjPtr;
- TreeViewEntry *rootPtr;
- const char **argv;
- const char **p;
- const char *path;
- char *string;
- int count;
- int n;
- long depth;
- long insertPos;
-
- rootPtr = viewPtr->rootPtr;
- string = Tcl_GetString(objv[2]);
- if ((string[0] == '-') && (strcmp(string, "-at") == 0)) {
- if (objc > 2) {
- if (Blt_TreeView_GetEntry(viewPtr, objv[3], &rootPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- objv += 2, objc -= 2;
- } else {
- Tcl_AppendResult(interp, "missing argument for \"-at\" flag",
- (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (objc == 2) {
- Tcl_AppendResult(interp, "missing position argument", (char *)NULL);
- return TCL_ERROR;
- }
- if (Blt_GetPositionFromObj(interp, objv[2], &insertPos) != TCL_OK) {
- return TCL_ERROR;
- }
- node = NULL;
- objc -= 3, objv += 3;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- while (objc > 0) {
- path = Tcl_GetString(objv[0]);
- objv++, objc--;
-
- /*
- * Count the option-value pairs that follow. Count until we spot one
- * that looks like an entry name (i.e. doesn't start with a minus
- * "-").
- */
- for (count = 0; count < objc; count += 2) {
- string = Tcl_GetString(objv[count]);
- if (string[0] != '-') {
- break;
- }
- }
- if (count > objc) {
- count = objc;
- }
- options = objv;
- objc -= count, objv += count;
-
- if (viewPtr->trimLeft != NULL) {
- const char *s1, *s2;
-
- /* Trim off leading character string if one exists. */
- for (s1 = path, s2 = viewPtr->trimLeft; *s2 != '\0'; s2++, s1++) {
- if (*s1 != *s2) {
- break;
- }
- }
- if (*s2 == '\0') {
- path = s1;
- }
- }
- /* Split the path and find the parent node of the path. */
- argv = &path;
- depth = 1;
- if (viewPtr->pathSep != SEPARATOR_NONE) {
- if (SplitPath(viewPtr, path, &depth, &argv) != TCL_OK) {
- goto error;
- }
- if (depth == 0) {
- Blt_Free(argv);
- continue; /* Root already exists. */
- }
- }
- parent = rootPtr->node;
- depth--;
-
- /* Verify each component in the path preceding the tail. */
- for (n = 0, p = argv; n < depth; n++, p++) {
- node = Blt_Tree_FindChild(parent, *p);
- if (node == NULL) {
- if ((viewPtr->flags & TV_FILL_ANCESTORS) == 0) {
- Tcl_AppendResult(interp, "can't find path component \"",
- *p, "\" in \"", path, "\"", (char *)NULL);
- goto error;
- }
- node = Blt_Tree_CreateNode(viewPtr->tree, parent, *p, END);
- if (node == NULL) {
- goto error;
- }
- }
- parent = node;
- }
- node = NULL;
- if (((viewPtr->flags & TV_ALLOW_DUPLICATES) == 0) &&
- (Blt_Tree_FindChild(parent, *p) != NULL)) {
- Tcl_AppendResult(interp, "entry \"", *p, "\" already exists in \"",
- path, "\"", (char *)NULL);
- goto error;
- }
- node = Blt_Tree_CreateNode(viewPtr->tree, parent, *p, insertPos);
- if (node == NULL) {
- goto error;
- }
- if (Blt_TreeView_CreateEntry(viewPtr, node, count, options, 0) != TCL_OK) {
- goto error;
- }
- if (argv != &path) {
- Blt_Free(argv);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, NodeToObj(node));
- }
- viewPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING | DIRTY /*| RESORT */);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-
- error:
- if (argv != &path) {
- Blt_Free(argv);
- }
- Tcl_DecrRefCount(listObjPtr);
- if (node != NULL) {
- DeleteNode(viewPtr, node);
- }
- return TCL_ERROR;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * AddOp --
- *
- * Add new entries into a hierarchy. If no node is specified,
- * new entries will be added to the root of the hierarchy.
- *
- *---------------------------------------------------------------------------
- */
-
-static Blt_SwitchParseProc StringToChild;
-#define INSERT_BEFORE (ClientData)0
-#define INSERT_AFTER (ClientData)1
-static Blt_SwitchCustom beforeSwitch = {
- ObjToChild, NULL, INSERT_BEFORE,
-};
-static Blt_SwitchCustom afterSwitch = {
- ObjToChild, NULL, INSERT_AFTER,
-};
-
-typedef struct {
- long insertPos;
- Blt_TreeNode parent;
-} InsertData;
-
-static Blt_SwitchSpec insertSwitches[] =
-{
- {BLT_SWITCH_CUSTOM, "-after", "position",
- Blt_Offset(InsertData, insertPos), 0, 0, &afterSwitch},
- {BLT_SWITCH_LONG_NNEG, "-at", "position",
- Blt_Offset(InsertData, insertPos), 0},
- {BLT_SWITCH_CUSTOM, "-before", "position",
- Blt_Offset(InsertData, insertPos), 0, 0, &beforeSwitch},
- {BLT_SWITCH_END}
-};
-
-static int
-AddOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode node, parent;
- Tcl_Obj *const *options;
- Tcl_Obj *listObjPtr;
- TreeViewEntry *rootPtr;
- const char **argv;
- const char **p;
- char *path;
- char *string;
- int count;
- int n;
- long depth;
- long insertPos;
-
- memset(&data, 0, sizeof(data));
- data.maxDepth = -1;
- data.cmdPtr = cmdPtr;
-
- /* Process any leading switches */
- i = Blt_ProcessObjSwitches(interp, addSwitches, objc - 2, objv + 2,
- (char *)&data, BLT_CONFIG_OBJV_PARTIAL);
- if (i < 0) {
- return TCL_ERROR;
- }
- i += 2;
- /* Should have at the starting node */
- if (i >= objc) {
- Tcl_AppendResult(interp, "starting node argument is missing",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Blt_TreeView_GetEntry(viewPtr, objv[i], &rootPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- objv += i, objc -= i;
- node = NULL;
-
- /* Process sections of path ?options? */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- while (objc > 0) {
- path = Tcl_GetString(objv[0]);
- objv++, objc--;
- /*
- * Count the option-value pairs that follow. Count until we spot one
- * that looks like an entry name (i.e. doesn't start with a minus
- * "-").
- */
- for (count = 0; count < objc; count += 2) {
- if (!Blt_ObjIsOption(bltTreeViewEntrySpecs, objv[count], 0)) {
- break;
- }
- }
- if (count > objc) {
- count = objc;
- }
- options = objv;
- objc -= count, objv += count;
-
- if (viewPtr->trimLeft != NULL) {
- char *s1, *s2;
-
- /* Trim off leading character string if one exists. */
- for (s1 = path, s2 = viewPtr->trimLeft; *s2 != '\0'; s2++, s1++) {
- if (*s1 != *s2) {
- break;
- }
- }
- if (*s2 == '\0') {
- path = s1;
- }
- }
- /* Split the path and find the parent node of the path. */
- argv = &path;
- depth = 1;
- if (viewPtr->pathSep != SEPARATOR_NONE) {
- if (SplitPath(viewPtr, path, &depth, &argv) != TCL_OK) {
- goto error;
- }
- if (depth == 0) {
- Blt_Free(argv);
- continue; /* Root already exists. */
- }
- }
- parent = rootPtr->node;
- depth--;
-
- /* Verify each component in the path preceding the tail. */
- for (n = 0, p = argv; n < depth; n++, p++) {
- node = Blt_Tree_FindChild(parent, *p);
- if (node == NULL) {
- if ((viewPtr->flags & TV_FILL_ANCESTORS) == 0) {
- Tcl_AppendResult(interp, "can't find path component \"",
- *p, "\" in \"", path, "\"", (char *)NULL);
- goto error;
- }
- node = Blt_Tree_CreateNode(viewPtr->tree, parent, *p, END);
- if (node == NULL) {
- goto error;
- }
- }
- parent = node;
- }
- node = NULL;
- if (((viewPtr->flags & TV_ALLOW_DUPLICATES) == 0) &&
- (Blt_Tree_FindChild(parent, *p) != NULL)) {
- Tcl_AppendResult(interp, "entry \"", *p, "\" already exists in \"",
- path, "\"", (char *)NULL);
- goto error;
- }
- node = Blt_Tree_CreateNode(viewPtr->tree, parent, *p, insertPos);
- if (node == NULL) {
- goto error;
- }
- if (Blt_TreeView_CreateEntry(viewPtr, node, count, options, 0) != TCL_OK) {
- goto error;
- }
- if (argv != &path) {
- Blt_Free(argv);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, NodeToObj(node));
- }
- viewPtr->flags |= (LAYOUT_PENDING | SCROLL_PENDING | DIRTY /*| RESORT */);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-
- error:
- if (argv != &path) {
- Blt_Free(argv);
- }
- Tcl_DecrRefCount(listObjPtr);
- if (node != NULL) {
- DeleteNode(viewPtr, node);
- }
- return TCL_ERROR;
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Deletes nodes from the hierarchy. Deletes one or more entries (except
- * root). In all cases, nodes are removed recursively.
- *
- * Note: There's no need to explicitly clean up Entry structures
- * or request a redraw of the widget. When a node is
- * deleted in the tree, all of the Tcl_Objs representing
- * the various data fields are also removed. The treeview
- * widget store the Entry structure in a data field. So it's
- * automatically cleaned up when FreeEntryInternalRep is
- * called.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DeleteOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewTagIter iter;
- TreeViewEntry *entryPtr;
- int i;
-
- for (i = 2; i < objc; i++) {
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- if (entryPtr == viewPtr->rootPtr) {
- Blt_TreeNode next, node;
-
- /*
- * Don't delete the root node. We implicitly assume that
- * even an empty tree has at a root. Instead delete all the
- * children regardless if they're closed or hidden.
- */
- for (node = Blt_Tree_FirstChild(entryPtr->node); node != NULL;
- node = next) {
- next = Blt_Tree_NextSibling(node);
- DeleteNode(viewPtr, node);
- }
- } else {
- DeleteNode(viewPtr, entryPtr->node);
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MoveOp --
- *
- * Move an entry into a new location in the hierarchy.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-MoveOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_TreeNode parent;
- TreeViewEntry *srcPtr, *destPtr;
- char c;
- int action;
- char *string;
- TreeViewTagIter iter;
-
-#define MOVE_INTO (1<<0)
-#define MOVE_BEFORE (1<<1)
-#define MOVE_AFTER (1<<2)
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[2], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- string = Tcl_GetString(objv[3]);
- c = string[0];
- if ((c == 'i') && (strcmp(string, "into") == 0)) {
- action = MOVE_INTO;
- } else if ((c == 'b') && (strcmp(string, "before") == 0)) {
- action = MOVE_BEFORE;
- } else if ((c == 'a') && (strcmp(string, "after") == 0)) {
- action = MOVE_AFTER;
- } else {
- Tcl_AppendResult(interp, "bad position \"", string,
- "\": should be into, before, or after", (char *)NULL);
- return TCL_ERROR;
- }
- if (Blt_TreeView_GetEntry(viewPtr, objv[4], &destPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- for (srcPtr = Blt_TreeView_FirstTaggedEntry(&iter); srcPtr != NULL;
- srcPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- /* Verify they aren't ancestors. */
- if (Blt_Tree_IsAncestor(srcPtr->node, destPtr->node)) {
- Tcl_DString dString;
- const char *path;
-
- path = Blt_TreeView_GetFullName(viewPtr, srcPtr, 1, &dString);
- Tcl_AppendResult(interp, "can't move node: \"", path,
- "\" is an ancestor of \"", Tcl_GetString(objv[4]),
- "\"", (char *)NULL);
- Tcl_DStringFree(&dString);
- return TCL_ERROR;
- }
- parent = Blt_Tree_ParentNode(destPtr->node);
- if (parent == NULL) {
- action = MOVE_INTO;
- }
- switch (action) {
- case MOVE_INTO:
- Blt_Tree_MoveNode(viewPtr->tree, srcPtr->node, destPtr->node,
- (Blt_TreeNode)NULL);
- break;
-
- case MOVE_BEFORE:
- Blt_Tree_MoveNode(viewPtr->tree, srcPtr->node, parent, destPtr->node);
- break;
-
- case MOVE_AFTER:
- Blt_Tree_MoveNode(viewPtr->tree, srcPtr->node, parent,
- Blt_Tree_NextSibling(destPtr->node));
- break;
- }
- }
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY /*| RESORT */);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-NearestOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewButton *buttonPtr = &viewPtr->button;
- int x, y; /* Screen coordinates of the test point. */
- TreeViewEntry *entryPtr;
- int isRoot;
- char *string;
-
- isRoot = FALSE;
- string = Tcl_GetString(objv[2]);
- if (strcmp("-root", string) == 0) {
- isRoot = TRUE;
- objv++, objc--;
- }
- if (objc < 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ", Tcl_GetString(objv[1]),
- " ?-root? x y\"", (char *)NULL);
- return TCL_ERROR;
-
- }
- if ((Tk_GetPixelsFromObj(interp, viewPtr->tkwin, objv[2], &x) != TCL_OK) ||
- (Tk_GetPixelsFromObj(interp, viewPtr->tkwin, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (viewPtr->nVisible == 0) {
- return TCL_OK;
- }
- if (isRoot) {
- int rootX, rootY;
-
- Tk_GetRootCoords(viewPtr->tkwin, &rootX, &rootY);
- x -= rootX;
- y -= rootY;
- }
- entryPtr = Blt_TreeView_NearestEntry(viewPtr, x, y, TRUE);
- if (entryPtr == NULL) {
- return TCL_OK;
- }
- x = WORLDX(viewPtr, x);
- y = WORLDY(viewPtr, y);
- if (objc > 4) {
- const char *where;
- int labelX, labelY, depth;
- TreeViewIcon icon;
-
- where = "";
- if (entryPtr->flags & ENTRY_HAS_BUTTON) {
- int buttonX, buttonY;
-
- buttonX = entryPtr->worldX + entryPtr->buttonX;
- buttonY = entryPtr->worldY + entryPtr->buttonY;
- if ((x >= buttonX) && (x < (buttonX + buttonPtr->width)) &&
- (y >= buttonY) && (y < (buttonY + buttonPtr->height))) {
- where = "button";
- goto done;
- }
- }
- depth = DEPTH(viewPtr, entryPtr->node);
-
- icon = Blt_TreeView_GetEntryIcon(viewPtr, entryPtr);
- if (icon != NULL) {
- int iconWidth, iconHeight, entryHeight;
- int iconX, iconY;
-
- entryHeight = MAX(entryPtr->iconHeight, viewPtr->button.height);
- iconHeight = TreeView_IconHeight(icon);
- iconWidth = TreeView_IconWidth(icon);
- iconX = entryPtr->worldX + ICONWIDTH(depth);
- iconY = entryPtr->worldY;
- if (viewPtr->flatView) {
- iconX += (ICONWIDTH(0) - iconWidth) / 2;
- } else {
- iconX += (ICONWIDTH(depth + 1) - iconWidth) / 2;
- }
- iconY += (entryHeight - iconHeight) / 2;
- if ((x >= iconX) && (x <= (iconX + iconWidth)) &&
- (y >= iconY) && (y < (iconY + iconHeight))) {
- where = "icon";
- goto done;
- }
- }
- labelX = entryPtr->worldX + ICONWIDTH(depth);
- labelY = entryPtr->worldY;
- if (!viewPtr->flatView) {
- labelX += ICONWIDTH(depth + 1) + 4;
- }
- if ((x >= labelX) && (x < (labelX + entryPtr->labelWidth)) &&
- (y >= labelY) && (y < (labelY + entryPtr->labelHeight))) {
- where = "label";
- }
- done:
- if (Tcl_SetVar(interp, Tcl_GetString(objv[4]), where,
- TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- }
- Tcl_SetObjResult(interp, NodeToObj(entryPtr->node));
- return TCL_OK;
-}
-
-
-/*ARGSUSED*/
-static int
-OpenOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
- TreeViewTagIter iter;
- int recurse, result;
- int i;
-
- recurse = FALSE;
- if (objc > 2) {
- int length;
- char *string;
-
- string = Tcl_GetStringFromObj(objv[2], &length);
- if ((string[0] == '-') && (length > 1) &&
- (strncmp(string, "-recurse", length) == 0)) {
- objv++, objc--;
- recurse = TRUE;
- }
- }
- for (i = 2; i < objc; i++) {
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- if (recurse) {
- result = Blt_TreeView_Apply(viewPtr, entryPtr,
- Blt_TreeView_OpenEntry, 0);
- } else {
- result = Blt_TreeView_OpenEntry(viewPtr, entryPtr);
- }
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- /* Make sure ancestors of this node aren't hidden. */
- MapAncestors(viewPtr, entryPtr);
- }
- }
- /*FIXME: This is only for flattened entries. */
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY /*| RESORT */);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RangeOp --
- *
- * Returns the node identifiers in a given range.
- *
- *---------------------------------------------------------------------------
- */
-static int
-RangeOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr, *firstPtr, *lastPtr;
- unsigned int mask;
- int length;
- Tcl_Obj *listObjPtr, *objPtr;
- char *string;
-
- mask = 0;
- string = Tcl_GetStringFromObj(objv[2], &length);
- if ((string[0] == '-') && (length > 1) &&
- (strncmp(string, "-open", length) == 0)) {
- objv++, objc--;
- mask |= ENTRY_CLOSED;
- }
- if (Blt_TreeView_GetEntry(viewPtr, objv[2], &firstPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc > 3) {
- if (Blt_TreeView_GetEntry(viewPtr, objv[3], &lastPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- lastPtr = LastEntry(viewPtr, firstPtr, mask);
- }
- if (mask & ENTRY_CLOSED) {
- if (firstPtr->flags & ENTRY_HIDE) {
- Tcl_AppendResult(interp, "first node \"", Tcl_GetString(objv[2]),
- "\" is hidden.", (char *)NULL);
- return TCL_ERROR;
- }
- if (lastPtr->flags & ENTRY_HIDE) {
- Tcl_AppendResult(interp, "last node \"", Tcl_GetString(objv[3]),
- "\" is hidden.", (char *)NULL);
- return TCL_ERROR;
- }
- }
-
- /*
- * The relative order of the first/last markers determines the
- * direction.
- */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (Blt_Tree_IsBefore(lastPtr->node, firstPtr->node)) {
- for (entryPtr = lastPtr; entryPtr != NULL;
- entryPtr = Blt_TreeView_PrevEntry(entryPtr, mask)) {
- objPtr = NodeToObj(entryPtr->node);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- if (entryPtr == firstPtr) {
- break;
- }
- }
- } else {
- for (entryPtr = firstPtr; entryPtr != NULL;
- entryPtr = Blt_TreeView_NextEntry(entryPtr, mask)) {
- objPtr = NodeToObj(entryPtr->node);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- if (entryPtr == lastPtr) {
- break;
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ScanOp --
- *
- * Implements the quick scan.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ScanOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int x, y;
- char c;
- int length;
- int oper;
- char *string;
- Tk_Window tkwin;
-
-#define SCAN_MARK 1
-#define SCAN_DRAGTO 2
- string = Tcl_GetStringFromObj(objv[2], &length);
- c = string[0];
- tkwin = viewPtr->tkwin;
- if ((c == 'm') && (strncmp(string, "mark", length) == 0)) {
- oper = SCAN_MARK;
- } else if ((c == 'd') && (strncmp(string, "dragto", length) == 0)) {
- oper = SCAN_DRAGTO;
- } else {
- Tcl_AppendResult(interp, "bad scan operation \"", string,
- "\": should be either \"mark\" or \"dragto\"", (char *)NULL);
- return TCL_ERROR;
- }
- if ((Blt_GetPixelsFromObj(interp, tkwin, objv[3], PIXELS_ANY, &x)
- != TCL_OK) ||
- (Blt_GetPixelsFromObj(interp, tkwin, objv[4], PIXELS_ANY, &y)
- != TCL_OK)) {
- return TCL_ERROR;
- }
- if (oper == SCAN_MARK) {
- viewPtr->scanAnchorX = x;
- viewPtr->scanAnchorY = y;
- viewPtr->scanX = viewPtr->xOffset;
- viewPtr->scanY = viewPtr->yOffset;
- } else {
- int worldX, worldY;
- int dx, dy;
-
- dx = viewPtr->scanAnchorX - x;
- dy = viewPtr->scanAnchorY - y;
- worldX = viewPtr->scanX + (10 * dx);
- worldY = viewPtr->scanY + (10 * dy);
-
- if (worldX < 0) {
- worldX = 0;
- } else if (worldX >= viewPtr->worldWidth) {
- worldX = viewPtr->worldWidth - viewPtr->xScrollUnits;
- }
- if (worldY < 0) {
- worldY = 0;
- } else if (worldY >= viewPtr->worldHeight) {
- worldY = viewPtr->worldHeight - viewPtr->yScrollUnits;
- }
- viewPtr->xOffset = worldX;
- viewPtr->yOffset = worldY;
- viewPtr->flags |= SCROLL_PENDING;
- Blt_TreeView_EventuallyRedraw(viewPtr);
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-SeeOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
- int width, height;
- int x, y;
- Tk_Anchor anchor;
- int left, right, top, bottom;
- char *string;
-
- string = Tcl_GetString(objv[2]);
- anchor = TK_ANCHOR_W; /* Default anchor is West */
- if ((string[0] == '-') && (strcmp(string, "-anchor") == 0)) {
- if (objc == 3) {
- Tcl_AppendResult(interp, "missing \"-anchor\" argument",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (Tk_GetAnchorFromObj(interp, objv[3], &anchor) != TCL_OK) {
- return TCL_ERROR;
- }
- objc -= 2, objv += 2;
- }
- if (objc == 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", objv[0],
- "see ?-anchor anchor? tagOrId\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (GetEntryFromObj(viewPtr, objv[2], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (entryPtr == NULL) {
- return TCL_OK;
- }
- if (entryPtr->flags & ENTRY_HIDE) {
- MapAncestors(viewPtr, entryPtr);
- viewPtr->flags |= SCROLL_PENDING;
- /*
- * If the entry wasn't previously exposed, its world coordinates
- * aren't likely to be valid. So re-compute the layout before we try
- * to see the viewport to the entry's location.
- */
- Blt_TreeView_ComputeLayout(viewPtr);
- }
- width = VPORTWIDTH(viewPtr);
- height = VPORTHEIGHT(viewPtr);
-
- /*
- * XVIEW: If the entry is left or right of the current view, adjust
- * the offset. If the entry is nearby, adjust the view just
- * a bit. Otherwise, center the entry.
- */
- left = viewPtr->xOffset;
- right = viewPtr->xOffset + width;
-
- switch (anchor) {
- case TK_ANCHOR_W:
- case TK_ANCHOR_NW:
- case TK_ANCHOR_SW:
- x = 0;
- break;
- case TK_ANCHOR_E:
- case TK_ANCHOR_NE:
- case TK_ANCHOR_SE:
- x = entryPtr->worldX + entryPtr->width +
- ICONWIDTH(DEPTH(viewPtr, entryPtr->node)) - width;
- break;
- default:
- if (entryPtr->worldX < left) {
- x = entryPtr->worldX;
- } else if ((entryPtr->worldX + entryPtr->width) > right) {
- x = entryPtr->worldX + entryPtr->width - width;
- } else {
- x = viewPtr->xOffset;
- }
- break;
- }
- /*
- * YVIEW: If the entry is above or below the current view, adjust
- * the offset. If the entry is nearby, adjust the view just
- * a bit. Otherwise, center the entry.
- */
- top = viewPtr->yOffset;
- bottom = viewPtr->yOffset + height;
-
- switch (anchor) {
- case TK_ANCHOR_N:
- y = viewPtr->yOffset;
- break;
- case TK_ANCHOR_NE:
- case TK_ANCHOR_NW:
- y = entryPtr->worldY - (height / 2);
- break;
- case TK_ANCHOR_S:
- case TK_ANCHOR_SE:
- case TK_ANCHOR_SW:
- y = entryPtr->worldY + entryPtr->height - height;
- break;
- default:
- if (entryPtr->worldY < top) {
- y = entryPtr->worldY;
- } else if ((entryPtr->worldY + entryPtr->height) > bottom) {
- y = entryPtr->worldY + entryPtr->height - height;
- } else {
- y = viewPtr->yOffset;
- }
- break;
- }
- if ((y != viewPtr->yOffset) || (x != viewPtr->xOffset)) {
- /* viewPtr->xOffset = x; */
- viewPtr->yOffset = y;
- viewPtr->flags |= SCROLL_PENDING;
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-void
-Blt_TreeView_ClearSelection(TreeView *viewPtr)
-{
- Blt_DeleteHashTable(&viewPtr->selectTable);
- Blt_InitHashTable(&viewPtr->selectTable, BLT_ONE_WORD_KEYS);
- Blt_Chain_Reset(viewPtr->selected);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- if (viewPtr->selectCmd != NULL) {
- EventuallyInvokeSelectCmd(viewPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LostSelection --
- *
- * This procedure is called back by Tk when the selection is grabbed
- * away.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The existing selection is unhighlighted, and the window is
- * marked as not containing a selection.
- *
- *---------------------------------------------------------------------------
- */
-static void
-LostSelection(ClientData clientData)
-{
- TreeView *viewPtr = clientData;
-
- if ((viewPtr->flags & TV_SELECT_EXPORT) == 0) {
- return;
- }
- Blt_TreeView_ClearSelection(viewPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectRange --
- *
- * Sets the selection flag for a range of nodes. The range is
- * determined by two pointers which designate the first/last
- * nodes of the range.
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectRange(TreeView *viewPtr, TreeViewEntry *fromPtr, TreeViewEntry *toPtr)
-{
- if (viewPtr->flatView) {
- int i;
-
- if (fromPtr->flatIndex > toPtr->flatIndex) {
- for (i = fromPtr->flatIndex; i >= toPtr->flatIndex; i--) {
- SelectEntryApplyProc(viewPtr, viewPtr->flatArr[i]);
- }
- } else {
- for (i = fromPtr->flatIndex; i <= toPtr->flatIndex; i++) {
- SelectEntryApplyProc(viewPtr, viewPtr->flatArr[i]);
- }
- }
- } else {
- TreeViewEntry *entryPtr, *nextPtr;
- TreeViewIterProc *proc;
- /* From the range determine the direction to select entries. */
-
- proc = (Blt_Tree_IsBefore(toPtr->node, fromPtr->node))
- ? Blt_TreeView_PrevEntry : Blt_TreeView_NextEntry;
- for (entryPtr = fromPtr; entryPtr != NULL; entryPtr = nextPtr) {
- nextPtr = (*proc)(entryPtr, ENTRY_MASK);
- SelectEntryApplyProc(viewPtr, entryPtr);
- if (entryPtr == toPtr) {
- break;
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionAnchorOp --
- *
- * Sets the selection anchor to the element given by a index. The
- * selection anchor is the end of the selection that is fixed while
- * dragging out a selection with the mouse. The index "anchor" may be
- * used to refer to the anchor element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionAnchorOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
-
- if (GetEntryFromObj(viewPtr, objv[3], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Set both the anchor and the mark. Indicates that a single entry
- * is selected. */
- viewPtr->selAnchorPtr = entryPtr;
- viewPtr->selMarkPtr = NULL;
- if (entryPtr != NULL) {
- Tcl_SetObjResult(interp, NodeToObj(entryPtr->node));
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionClearallOp
- *
- * Clears the entire selection.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionClearallOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeView_ClearSelection(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionIncludesOp
- *
- * Returns 1 if the element indicated by index is currently
- * selected, 0 if it isn't.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionIncludesOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
- int bool;
-
- if (GetEntryFromObj(viewPtr, objv[3], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- bool = FALSE;
- if (entryPtr == NULL) {
- bool = Blt_TreeView_EntryIsSelected(viewPtr, entryPtr);
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionMarkOp --
- *
- * Sets the selection mark to the element given by a index. The
- * selection anchor is the end of the selection that is movable while
- * dragging out a selection with the mouse. The index "mark" may be used
- * to refer to the anchor element.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionMarkOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
-
- if (GetEntryFromObj(viewPtr, objv[3], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (viewPtr->selAnchorPtr == NULL) {
- Tcl_AppendResult(interp, "selection anchor must be set first",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (viewPtr->selMarkPtr != entryPtr) {
- Blt_ChainLink link, next;
-
- /* Deselect entry from the list all the way back to the anchor. */
- for (link = Blt_Chain_LastLink(viewPtr->selected); link != NULL;
- link = next) {
- TreeViewEntry *selectPtr;
-
- next = Blt_Chain_PrevLink(link);
- selectPtr = Blt_Chain_GetValue(link);
- if (selectPtr == viewPtr->selAnchorPtr) {
- break;
- }
- Blt_TreeView_DeselectEntry(viewPtr, selectPtr);
- }
- viewPtr->flags &= ~TV_SELECT_MASK;
- viewPtr->flags |= TV_SELECT_SET;
- SelectRange(viewPtr, viewPtr->selAnchorPtr, entryPtr);
- Tcl_SetObjResult(interp, NodeToObj(entryPtr->node));
- viewPtr->selMarkPtr = entryPtr;
-
- Blt_TreeView_EventuallyRedraw(viewPtr);
- if (viewPtr->selectCmd != NULL) {
- EventuallyInvokeSelectCmd(viewPtr);
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionPresentOp
- *
- * Returns 1 if there is a selection and 0 if it isn't.
- *
- * Results:
- * A standard TCL result. interp->result will contain a boolean string
- * indicating if there is a selection.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionPresentOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int bool;
-
- bool = (Blt_Chain_GetLength(viewPtr->selected) > 0);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionSetOp
- *
- * Selects, deselects, or toggles all of the elements in the range
- * between first and last, inclusive, without affecting the selection
- * state of elements outside that range.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectionSetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- char *string;
-
- viewPtr->flags &= ~TV_SELECT_MASK;
- if (viewPtr->flags & LAYOUT_PENDING) {
- /*
- * The layout is dirty. Recompute it now so that we can use
- * view.top and view.bottom for nodes.
- */
- Blt_TreeView_ComputeLayout(viewPtr);
- }
- string = Tcl_GetString(objv[2]);
- switch (string[0]) {
- case 's':
- viewPtr->flags |= TV_SELECT_SET;
- break;
- case 'c':
- viewPtr->flags |= TV_SELECT_CLEAR;
- break;
- case 't':
- viewPtr->flags |= TV_SELECT_TOGGLE;
- break;
- }
- if (objc > 4) {
- TreeViewEntry *firstPtr, *lastPtr;
-
- if (GetEntryFromObj(viewPtr, objv[3], &firstPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (firstPtr == NULL) {
- return TCL_OK; /* Didn't pick an entry. */
- }
- if ((firstPtr->flags & ENTRY_HIDE) &&
- (!(viewPtr->flags & TV_SELECT_CLEAR))) {
- if (objc > 4) {
- Tcl_AppendResult(interp, "can't select hidden node \"",
- Tcl_GetString(objv[3]), "\"", (char *)NULL);
- return TCL_ERROR;
- } else {
- return TCL_OK;
- }
- }
- lastPtr = firstPtr;
- if (objc > 4) {
- if (Blt_TreeView_GetEntry(viewPtr, objv[4], &lastPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((lastPtr->flags & ENTRY_HIDE) &&
- (!(viewPtr->flags & TV_SELECT_CLEAR))) {
- Tcl_AppendResult(interp, "can't select hidden node \"",
- Tcl_GetString(objv[4]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (firstPtr == lastPtr) {
- SelectEntryApplyProc(viewPtr, firstPtr);
- } else {
- SelectRange(viewPtr, firstPtr, lastPtr);
- }
- /* Set both the anchor and the mark. Indicates that a single entry is
- * selected. */
- if (viewPtr->selAnchorPtr == NULL) {
- viewPtr->selAnchorPtr = firstPtr;
- }
- } else {
- TreeViewEntry *entryPtr;
- TreeViewTagIter iter;
-
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[3], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- if ((entryPtr->flags & ENTRY_HIDE) &&
- ((viewPtr->flags & TV_SELECT_CLEAR) == 0)) {
- continue;
- }
- SelectEntryApplyProc(viewPtr, entryPtr);
- }
- /* Set both the anchor and the mark. Indicates that a single entry is
- * selected. */
- if (viewPtr->selAnchorPtr == NULL) {
- viewPtr->selAnchorPtr = entryPtr;
- }
- }
- if (viewPtr->flags & TV_SELECT_EXPORT) {
- Tk_OwnSelection(viewPtr->tkwin, XA_PRIMARY, LostSelection, viewPtr);
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- if (viewPtr->selectCmd != NULL) {
- EventuallyInvokeSelectCmd(viewPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectionOp --
- *
- * This procedure handles the individual options for text selections.
- * The selected text is designated by start and end indices into the text
- * pool. The selected segment has both a anchored and unanchored ends.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec selectionOps[] =
-{
- {"anchor", 1, SelectionAnchorOp, 4, 4, "tagOrId",},
- {"clear", 5, SelectionSetOp, 4, 5, "first ?last?",},
- {"clearall", 6, SelectionClearallOp, 3, 3, "",},
- {"includes", 1, SelectionIncludesOp, 4, 4, "tagOrId",},
- {"mark", 1, SelectionMarkOp, 4, 4, "tagOrId",},
- {"present", 1, SelectionPresentOp, 3, 3, "",},
- {"set", 1, SelectionSetOp, 4, 5, "first ?last?",},
- {"toggle", 1, SelectionSetOp, 4, 5, "first ?last?",},
-};
-static int nSelectionOps = sizeof(selectionOps) / sizeof(Blt_OpSpec);
-
-static int
-SelectionOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TvCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nSelectionOps, selectionOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (viewPtr, interp, objc, objv);
- return result;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagForgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TagForgetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 3; i < objc; i++) {
- Blt_Tree_ForgetTag(viewPtr->tree, Tcl_GetString(objv[i]));
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagNamesOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagNamesOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr, *objPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- objPtr = Tcl_NewStringObj("all", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Blt_TreeTagEntry *tPtr;
-
- objPtr = Tcl_NewStringObj("root", -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- for (hPtr = Blt_Tree_FirstTag(viewPtr->tree, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- tPtr = Blt_GetHashValue(hPtr);
- objPtr = Tcl_NewStringObj(tPtr->tagName, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- } else {
- int i;
-
- for (i = 3; i < objc; i++) {
- Blt_List list;
- Blt_ListNode listNode;
- TreeViewEntry *entryPtr;
-
- if (Blt_TreeView_GetEntry(viewPtr, objv[i], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- list = Blt_List_Create(BLT_ONE_WORD_KEYS);
- Blt_TreeView_GetTags(interp, viewPtr, entryPtr, list);
- for (listNode = Blt_List_FirstNode(list); listNode != NULL;
- listNode = Blt_List_NextNode(listNode)) {
- objPtr =
- Tcl_NewStringObj((char *)Blt_List_GetKey(listNode), -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Blt_List_Destroy(list);
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagNodesOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagNodesOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_HashTable nodeTable;
- int i;
-
- Blt_InitHashTable(&nodeTable, BLT_ONE_WORD_KEYS);
- for (i = 3; i < objc; i++) {
- TreeViewTagIter iter;
- TreeViewEntry *entryPtr;
-
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- int isNew;
-
- Blt_CreateHashEntry(&nodeTable, (char *)entryPtr->node, &isNew);
- }
- }
- {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (hPtr = Blt_FirstHashEntry(&nodeTable, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- Blt_TreeNode node;
- Tcl_Obj *objPtr;
-
- node = (Blt_TreeNode)Blt_GetHashKey(&nodeTable, hPtr);
- objPtr = Tcl_NewLongObj(Blt_Tree_NodeId(node));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- }
- Blt_DeleteHashTable(&nodeTable);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagAddOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-TagAddOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
- int i;
- char *tagName;
- TreeViewTagIter iter;
-
- tagName = Tcl_GetString(objv[3]);
- viewPtr->fromPtr = NULL;
- if (strcmp(tagName, "root") == 0) {
- Tcl_AppendResult(interp, "can't add reserved tag \"", tagName, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (isdigit(UCHAR(tagName[0]))) {
- long nodeId;
-
- if (Tcl_GetLongFromObj(NULL, objv[3], &nodeId) == TCL_OK) {
- Tcl_AppendResult(viewPtr->interp, "invalid tag \"", tagName,
- "\": can't be a number.", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (tagName[0] == '@') {
- Tcl_AppendResult(viewPtr->interp, "invalid tag \"", tagName,
- "\": can't start with \"@\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (GetEntryFromSpecialId(viewPtr, tagName, &entryPtr) == TCL_OK) {
- Tcl_AppendResult(interp, "invalid tag \"", tagName,
- "\": is a special id", (char *)NULL);
- return TCL_ERROR;
- }
- for (i = 4; i < objc; i++) {
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- if (AddTag(viewPtr, entryPtr->node, tagName) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagDeleteOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-TagDeleteOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- char *tagName;
- Blt_HashTable *tablePtr;
-
- tagName = Tcl_GetString(objv[3]);
- tablePtr = Blt_Tree_TagHashTable(viewPtr->tree, tagName);
- if (tablePtr != NULL) {
- int i;
-
- for (i = 4; i < objc; i++) {
- TreeViewEntry *entryPtr;
- TreeViewTagIter iter;
-
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[i], &iter)!= TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter);
- entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(tablePtr, (char *)entryPtr->node);
- if (hPtr != NULL) {
- Blt_DeleteHashEntry(tablePtr, hPtr);
- }
- }
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TagOp --
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec tagOps[] = {
- {"add", 1, TagAddOp, 5, 0, "tag id...",},
- {"delete", 2, TagDeleteOp, 5, 0, "tag id...",},
- {"forget", 1, TagForgetOp, 4, 0, "tag...",},
- {"names", 2, TagNamesOp, 3, 0, "?id...?",},
- {"nodes", 2, TagNodesOp, 4, 0, "tag ?tag...?",},
-};
-
-static int nTagOps = sizeof(tagOps) / sizeof(Blt_OpSpec);
-
-static int
-TagOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TvCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTagOps, tagOps, BLT_OP_ARG2, objc, objv,
- 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc)(viewPtr, interp, objc, objv);
- return result;
-}
-
-/*ARGSUSED*/
-static int
-ToggleOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
- TreeViewTagIter iter;
- int result;
-
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[2], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- if (entryPtr == NULL) {
- return TCL_OK;
- }
- if (entryPtr->flags & ENTRY_CLOSED) {
- result = Blt_TreeView_OpenEntry(viewPtr, entryPtr);
- } else {
- Blt_TreeView_PruneSelection(viewPtr, viewPtr->focusPtr);
- if ((viewPtr->focusPtr != NULL) &&
- (Blt_Tree_IsAncestor(entryPtr->node, viewPtr->focusPtr->node))){
- viewPtr->focusPtr = entryPtr;
- Blt_SetFocusItem(viewPtr->bindTable, entryPtr, ITEM_ENTRY);
- }
- if ((viewPtr->selAnchorPtr != NULL) &&
- (Blt_Tree_IsAncestor(entryPtr->node,
- viewPtr->selAnchorPtr->node))) {
- viewPtr->selAnchorPtr = NULL;
- }
- result = Blt_TreeView_CloseEntry(viewPtr, entryPtr);
- }
- }
- viewPtr->flags |= SCROLL_PENDING;
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UpdateOp --
- *
- * .tv update false
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-UpdateOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int state;
-
- if (objc == 3) {
- if (Tcl_GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) {
- return TCL_ERROR;
- }
- if (state) {
- viewPtr->flags &= ~DONT_UPDATE;
- viewPtr->flags |= LAYOUT_PENDING | DIRTY;
- Blt_TreeView_EventuallyRedraw(viewPtr);
- fprintf(stderr, "Turning on updates %d\n",
- viewPtr->flags & DONT_UPDATE);
- } else {
- viewPtr->flags |= DONT_UPDATE;
- fprintf(stderr, "Turning off updates %d\n",
- viewPtr->flags & DONT_UPDATE);
- }
- } else {
- state = (viewPtr->flags & DONT_UPDATE) ? FALSE : TRUE;
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), state);
- return TCL_OK;
-}
-
-static int
-XViewOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int width, worldWidth;
-
- width = VPORTWIDTH(viewPtr);
- worldWidth = viewPtr->worldWidth;
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr;
-
- /*
- * Note that we are bounding the fractions between 0.0 and 1.0
- * to support the "canvas"-style of scrolling.
- */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- fract = (double)viewPtr->xOffset / worldWidth;
- fract = FCLAMP(fract);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(fract));
- fract = (double)(viewPtr->xOffset + width) / worldWidth;
- fract = FCLAMP(fract);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(fract));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2, &viewPtr->xOffset,
- worldWidth, width, viewPtr->xScrollUnits, viewPtr->scrollMode)
- != TCL_OK) {
- return TCL_ERROR;
- }
- viewPtr->flags |= SCROLLX;
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-static int
-YViewOp(TreeView *viewPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int height, worldHeight;
-
- height = VPORTHEIGHT(viewPtr);
- worldHeight = viewPtr->worldHeight;
- if (objc == 2) {
- double fract;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- /* Report first and last fractions */
- fract = (double)viewPtr->yOffset / worldHeight;
- fract = FCLAMP(fract);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(fract));
- fract = (double)(viewPtr->yOffset + height) / worldHeight;
- fract = FCLAMP(fract);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(fract));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
- }
- if (Blt_GetScrollInfoFromObj(interp, objc - 2, objv + 2, &viewPtr->yOffset,
- worldHeight, height, viewPtr->yScrollUnits, viewPtr->scrollMode)
- != TCL_OK) {
- return TCL_ERROR;
- }
- viewPtr->flags |= SCROLL_PENDING;
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_WidgetInstCmd --
- *
- * This procedure is invoked to process commands on behalf of the
- * treeview widget.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec tvOps[] =
-{
- {"bbox", 2, BboxOp, 3, 0, "tagOrId...",},
- {"bind", 2, BindOp, 3, 5, "tagName ?sequence command?",},
- {"button", 2, ButtonOp, 2, 0, "args",},
- {"cget", 2, CgetOp, 3, 3, "option",},
- {"close", 2, CloseOp, 2, 0, "?-recurse? tagOrId...",},
- {"column", 3, Blt_TreeView_ColumnOp, 2, 0, "oper args",},
- {"configure", 3, ConfigureOp, 2, 0, "?option value?...",},
- {"curselection", 2, CurselectionOp, 2, 2, "",},
- {"delete", 1, DeleteOp, 2, 0, "tagOrId ?tagOrId...?",},
- {"edit", 2, EditOp, 4, 6, "?-root|-test? x y",},
- {"entry", 2, EntryOp, 2, 0, "oper args",},
- {"find", 2, FindOp, 2, 0, "?flags...? ?first last?",},
- {"focus", 2, FocusOp, 3, 3, "tagOrId",},
- {"get", 1, GetOp, 2, 0, "?-full? tagOrId ?tagOrId...?",},
- {"hide", 1, HideOp, 2, 0, "?-exact? ?-glob? ?-regexp? ?-nonmatching? ?-name string? ?-full string? ?-data string? ?--? ?tagOrId...?",},
- {"index", 3, IndexOp, 3, 6, "?-at tagOrId? ?-path? string",},
- {"insert", 3, InsertOp, 3, 0,
- "?-at tagOrId? position label ?label...? ?option value?",},
- {"move", 1, MoveOp, 5, 5,
- "tagOrId into|before|after tagOrId",},
- {"nearest", 1, NearestOp, 4, 5, "x y ?varName?",},
- {"open", 1, OpenOp, 2, 0, "?-recurse? tagOrId...",},
- {"range", 1, RangeOp, 4, 5, "?-open? tagOrId tagOrId",},
- {"scan", 2, ScanOp, 5, 5, "dragto|mark x y",},
- {"see", 3, SeeOp, 3, 0, "?-anchor anchor? tagOrId",},
- {"selection", 3, SelectionOp, 2, 0, "oper args",},
- {"show", 2, ShowOp, 2, 0, "?-exact? ?-glob? ?-regexp? ?-nonmatching? ?-name string? ?-full string? ?-data string? ?--? ?tagOrId...?",},
- {"sort", 2, Blt_TreeView_SortOp, 2, 0, "args",},
- {"style", 2, Blt_TreeView_StyleOp, 2, 0, "args",},
- {"tag", 2, TagOp, 2, 0, "oper args",},
- {"toggle", 2, ToggleOp, 3, 3, "tagOrId",},
- {"update", 1, UpdateOp, 2, 3, "?bool?",},
- {"xview", 1, XViewOp, 2, 5,
- "?moveto fract? ?scroll number what?",},
- {"yview", 1, YViewOp, 2, 5,
- "?moveto fract? ?scroll number what?",},
-};
-
-static int nTvOps = sizeof(tvOps) / sizeof(Blt_OpSpec);
-
-int
-Blt_TreeView_WidgetInstCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TvCmdProc *proc;
- TreeView *viewPtr = clientData;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTvOps, tvOps, BLT_OP_ARG1, objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- Tcl_Preserve(viewPtr);
- result = (*proc) (viewPtr, interp, objc, objv);
- Tcl_Release(viewPtr);
- return result;
-}
-
-#endif /* NO_TREEVIEW */
diff --git a/blt3.0.1/src/bltTvCol.c b/blt3.0.1/src/bltTvCol.c
deleted file mode 100644
index 8b8c1f1..0000000
--- a/blt3.0.1/src/bltTvCol.c
+++ /dev/null
@@ -1,2067 +0,0 @@
-
-/*
- * bltTvCol.c --
- *
- * This module implements an hierarchy widget for the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * TODO:
- *
- * BUGS:
- * 1. "open" operation should change scroll offset so that as many
- * new entries (up to half a screen) can be seen.
- * 2. "open" needs to adjust the scrolloffset so that the same entry
- * is seen at the same place.
- */
-#include "bltInt.h"
-
-#ifndef NO_TREEVIEW
-#include "bltOp.h"
-#include "bltTreeView.h"
-#include <X11/Xutil.h>
-
-#define RULE_AREA (8)
-
-typedef int (TreeViewCmdProc)(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-static const char *sortTypeStrings[] = {
- "dictionary", "ascii", "integer", "real", "command", "none", NULL
-};
-
-enum SortTypeValues {
- SORT_DICTIONARY, SORT_ASCII, SORT_INTEGER,
- SORT_REAL, SORT_COMMAND, SORT_NONE
-};
-
-#define DEF_SORT_COLUMN (char *)NULL
-#define DEF_SORT_COMMAND (char *)NULL
-#define DEF_SORT_DECREASING "no"
-#define DEF_SORT_TYPE "dictionary"
-
-#ifdef WIN32
-#define DEF_COLUMN_ACTIVE_TITLE_BG RGB_GREY85
-#else
-#define DEF_COLUMN_ACTIVE_TITLE_BG RGB_GREY90
-#endif
-#define DEF_COLUMN_ACTIVE_TITLE_FG STD_ACTIVE_FOREGROUND
-#define DEF_COLUMN_ARROWWIDTH "0"
-#define DEF_COLUMN_BACKGROUND (char *)NULL
-#define DEF_COLUMN_BIND_TAGS "all"
-#define DEF_COLUMN_BORDERWIDTH STD_BORDERWIDTH
-#define DEF_COLUMN_COLOR RGB_BLACK
-#define DEF_COLUMN_EDIT "yes"
-#define DEF_COLUMN_FONT STD_FONT
-#define DEF_COLUMN_COMMAND (char *)NULL
-#define DEF_COLUMN_FORMATCOMMAND (char *)NULL
-#define DEF_COLUMN_HIDE "no"
-#define DEF_COLUMN_SHOW "yes"
-#define DEF_COLUMN_JUSTIFY "center"
-#define DEF_COLUMN_MAX "0"
-#define DEF_COLUMN_MIN "0"
-#define DEF_COLUMN_PAD "2"
-#define DEF_COLUMN_RELIEF "flat"
-#define DEF_COLUMN_STATE "normal"
-#define DEF_COLUMN_STYLE "text"
-#define DEF_COLUMN_TITLE_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_COLUMN_TITLE_BORDERWIDTH STD_BORDERWIDTH
-#define DEF_COLUMN_TITLE_FONT STD_FONT_SMALL
-#define DEF_COLUMN_TITLE_FOREGROUND STD_NORMAL_FOREGROUND
-#define DEF_COLUMN_TITLE_RELIEF "raised"
-#define DEF_COLUMN_WEIGHT "1.0"
-#define DEF_COLUMN_WIDTH "0"
-#define DEF_COLUMN_RULE_DASHES "dot"
-
-static Blt_OptionParseProc ObjToEnum;
-static Blt_OptionPrintProc EnumToObj;
-static Blt_CustomOption typeOption =
-{
- ObjToEnum, EnumToObj, NULL, (ClientData)sortTypeStrings
-};
-
-static Blt_OptionParseProc ObjToColumn;
-static Blt_OptionPrintProc ColumnToObj;
-static Blt_CustomOption columnOption =
-{
- ObjToColumn, ColumnToObj, NULL, (ClientData)0
-};
-
-static Blt_OptionParseProc ObjToData;
-static Blt_OptionPrintProc DataToObj;
-Blt_CustomOption bltTreeViewDataOption =
-{
- ObjToData, DataToObj, NULL, (ClientData)0,
-};
-
-static Blt_OptionParseProc ObjToStyle;
-static Blt_OptionPrintProc StyleToObj;
-static Blt_OptionFreeProc FreeStyle;
-static Blt_CustomOption styleOption =
-{
- /* Contains a pointer to the widget that's currently being
- * configured. This is used in the custom configuration parse
- * routine for icons. */
- ObjToStyle, StyleToObj, FreeStyle, NULL,
-};
-
-BLT_EXTERN Blt_CustomOption bltTreeViewUidOption;
-BLT_EXTERN Blt_CustomOption bltTreeViewIconOption;
-
-static Blt_ConfigSpec columnSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activetitlebackground", "activeTitleBackground",
- "Background", DEF_COLUMN_ACTIVE_TITLE_BG,
- Blt_Offset(TreeViewColumn, activeTitleBg), 0},
- {BLT_CONFIG_COLOR, "-activetitleforeground", "activeTitleForeground",
- "Foreground", DEF_COLUMN_ACTIVE_TITLE_FG,
- Blt_Offset(TreeViewColumn, activeTitleFgColor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-arrowwidth", "arrowWidth","ArrowWidth",
- DEF_COLUMN_ARROWWIDTH, Blt_Offset(TreeViewColumn, reqArrowWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_COLUMN_BACKGROUND, Blt_Offset(TreeViewColumn, bg),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_CUSTOM, "-bindtags", "bindTags", "BindTags",
- DEF_COLUMN_BIND_TAGS, Blt_Offset(TreeViewColumn, tagsUid),
- BLT_CONFIG_NULL_OK, &bltTreeViewUidOption},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_COLUMN_BORDERWIDTH, Blt_Offset(TreeViewColumn, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-command", "command", "Command",
- DEF_COLUMN_COMMAND, Blt_Offset(TreeViewColumn, titleCmd),
- BLT_CONFIG_DONT_SET_DEFAULT | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMASK_INVERT, "-edit", "edit", "Edit", DEF_COLUMN_STATE,
- Blt_Offset(TreeViewColumn, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)COLUMN_READONLY},
- {BLT_CONFIG_OBJ, "-formatcommand", "formatCommand", "FormatCommand",
- (char *)NULL, Blt_Offset(TreeViewColumn, fmtCmdPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMASK, "-hide", "hide", "Hide", DEF_COLUMN_HIDE,
- Blt_Offset(TreeViewColumn, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)COLUMN_HIDDEN},
- {BLT_CONFIG_CUSTOM, "-icon", "icon", "icon", (char *)NULL,
- Blt_Offset(TreeViewColumn, titleIcon),
- BLT_CONFIG_NULL_OK | BLT_CONFIG_DONT_SET_DEFAULT,
- &bltTreeViewIconOption},
- {BLT_CONFIG_JUSTIFY, "-justify", "justify", "Justify", DEF_COLUMN_JUSTIFY,
- Blt_Offset(TreeViewColumn, justify), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-max", "max", "Max", DEF_COLUMN_MAX,
- Blt_Offset(TreeViewColumn, reqMax), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-min", "min", "Min", DEF_COLUMN_MIN,
- Blt_Offset(TreeViewColumn, reqMin), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PAD, "-pad", "pad", "Pad", DEF_COLUMN_PAD,
- Blt_Offset(TreeViewColumn, pad), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_COLUMN_RELIEF,
- Blt_Offset(TreeViewColumn, relief), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_DASHES, "-ruledashes", "ruleDashes", "RuleDashes",
- DEF_COLUMN_RULE_DASHES, Blt_Offset(TreeViewColumn, ruleDashes),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMASK_INVERT, "-show", "show", "Show", DEF_COLUMN_SHOW,
- Blt_Offset(TreeViewColumn, flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)COLUMN_HIDDEN},
- {BLT_CONFIG_OBJ, "-sortcommand", "sortCommand", "SortCommand",
- DEF_SORT_COMMAND, Blt_Offset(TreeViewColumn, sortCmdPtr),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STATE, "-state", "state", "State", DEF_COLUMN_STATE,
- Blt_Offset(TreeViewColumn, state), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-style", "style", "Style", DEF_COLUMN_STYLE,
- Blt_Offset(TreeViewColumn, stylePtr), BLT_CONFIG_NULL_OK, &styleOption},
- {BLT_CONFIG_STRING, "-text", "text", "Text",
- (char *)NULL, Blt_Offset(TreeViewColumn, text), 0},
- {BLT_CONFIG_STRING, "-title", "title", "Title", (char *)NULL,
- Blt_Offset(TreeViewColumn, text), 0},
- {BLT_CONFIG_BACKGROUND, "-titlebackground", "titleBackground",
- "TitleBackground", DEF_COLUMN_TITLE_BACKGROUND,
- Blt_Offset(TreeViewColumn, titleBg), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-titleborderwidth", "titleBorderWidth",
- "TitleBorderWidth", DEF_COLUMN_TITLE_BORDERWIDTH,
- Blt_Offset(TreeViewColumn, titleBW), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_FONT, "-titlefont", "titleFont", "Font",
- DEF_COLUMN_TITLE_FONT, Blt_Offset(TreeViewColumn, titleFont), 0},
- {BLT_CONFIG_COLOR, "-titleforeground", "titleForeground", "TitleForeground",
- DEF_COLUMN_TITLE_FOREGROUND,
- Blt_Offset(TreeViewColumn, titleFgColor), 0},
- {BLT_CONFIG_JUSTIFY, "-titlejustify", "titleJustify", "TitleJustify",
- DEF_COLUMN_JUSTIFY, Blt_Offset(TreeViewColumn, titleJustify),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-titlerelief", "titleRelief", "TitleRelief",
- DEF_COLUMN_TITLE_RELIEF, Blt_Offset(TreeViewColumn, titleRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_DOUBLE, "-weight", (char *)NULL, (char *)NULL,
- DEF_COLUMN_WEIGHT, Blt_Offset(TreeViewColumn, weight),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-width", "width", "Width",
- DEF_COLUMN_WIDTH, Blt_Offset(TreeViewColumn, reqWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-static Blt_ConfigSpec sortSpecs[] =
-{
- {BLT_CONFIG_OBJ, "-command", "command", "Command",
- DEF_SORT_COMMAND, Blt_Offset(TreeView, sortCmdPtr),
- BLT_CONFIG_DONT_SET_DEFAULT | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-column", "column", "Column",
- DEF_SORT_COLUMN, Blt_Offset(TreeView, sortColumnPtr),
- BLT_CONFIG_NULL_OK | BLT_CONFIG_DONT_SET_DEFAULT, &columnOption},
- {BLT_CONFIG_BOOLEAN, "-decreasing", "decreasing", "Decreasing",
- DEF_SORT_DECREASING, Blt_Offset(TreeView, sortDecreasing),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CUSTOM, "-mode", "mode", "Mode", DEF_SORT_TYPE,
- Blt_Offset(TreeView, sortType), 0, &typeOption},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-static Blt_TreeApplyProc SortApplyProc;
-static Blt_TreeCompareNodesProc CompareNodes;
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToEnum --
- *
- * Converts the string into its enumerated type.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToEnum(
- ClientData clientData, /* Vectors of valid strings. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr,
- char *widgRec, /* Widget record. */
- int offset, /* Offset of field in record */
- int flags)
-{
- int *enumPtr = (int *)(widgRec + offset);
- char c;
- char **p;
- int i;
- int count;
- char *string;
-
- string = Tcl_GetString(objPtr);
- c = string[0];
- count = 0;
- for (p = (char **)clientData; *p != NULL; p++) {
- if ((c == p[0][0]) && (strcmp(string, *p) == 0)) {
- *enumPtr = count;
- return TCL_OK;
- }
- count++;
- }
- *enumPtr = -1;
-
- Tcl_AppendResult(interp, "bad value \"", string, "\": should be ",
- (char *)NULL);
- p = (char **)clientData;
- if (count > 0) {
- Tcl_AppendResult(interp, p[0], (char *)NULL);
- }
- for (i = 1; i < (count - 1); i++) {
- Tcl_AppendResult(interp, " ", p[i], ", ", (char *)NULL);
- }
- if (count > 1) {
- Tcl_AppendResult(interp, " or ", p[count - 1], ".", (char *)NULL);
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EnumToObj --
- *
- * Returns the string associated with the enumerated type.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-EnumToObj(
- ClientData clientData, /* List of strings. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int value = *(int *)(widgRec + offset);
- char **strings = (char **)clientData;
- char **p;
- int count;
-
- count = 0;
- for (p = strings; *p != NULL; p++) {
- if (value == count) {
- return Tcl_NewStringObj(*p, -1);
- }
- count++;
- }
- return Tcl_NewStringObj("unknown value", -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToColumn --
- *
- * Convert the string reprsenting a column, to its numeric
- * form.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToColumn(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* New legend position string */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- TreeView *viewPtr = (TreeView *)widgRec;
- TreeViewColumn **columnPtrPtr = (TreeViewColumn **)(widgRec + offset);
- char *string;
-
- string = Tcl_GetString(objPtr);
- if (string[0] == '\0') {
- *columnPtrPtr = &viewPtr->treeColumn;
- } else {
- if (Blt_TreeView_GetColumn(interp, viewPtr, objPtr, columnPtrPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnToString --
- *
- * Results:
- * The string representation of the column is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ColumnToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- TreeViewColumn *columnPtr = *(TreeViewColumn **)(widgRec + offset);
-
- if (columnPtr == NULL) {
- return Tcl_NewStringObj("", -1);
- } else {
- return Tcl_NewStringObj(columnPtr->key, -1);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToData --
- *
- * Convert the string reprsenting a scroll mode, to its numeric
- * form.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left
- * in interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToData(
- ClientData clientData, /* Node of entry. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing new data. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tcl_Obj **objv;
- TreeViewEntry *entryPtr = (TreeViewEntry *)widgRec;
- char *string;
- int objc;
- int i;
-
- string = Tcl_GetString(objPtr);
- if (*string == '\0') {
- return TCL_OK;
- }
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 0) {
- return TCL_OK;
- }
- if (objc & 0x1) {
- Tcl_AppendResult(interp, "data \"", string,
- "\" must be in even name-value pairs", (char *)NULL);
- return TCL_ERROR;
- }
- for (i = 0; i < objc; i += 2) {
- TreeViewColumn *columnPtr;
- TreeView *viewPtr = entryPtr->viewPtr;
-
- if (Blt_TreeView_GetColumn(interp, viewPtr, objv[i], &columnPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_Tree_SetValueByKey(viewPtr->interp, viewPtr->tree, entryPtr->node,
- columnPtr->key, objv[i + 1]) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_TreeView_AddValue(entryPtr, columnPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DataToObj --
- *
- * Results:
- * The string representation of the data is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-DataToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tcl_Obj *listObjPtr, *objPtr;
- TreeViewEntry *entryPtr = (TreeViewEntry *)widgRec;
- TreeViewValue *valuePtr;
-
- /* Add the key-value pairs to a new Tcl_Obj */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (valuePtr = entryPtr->values; valuePtr != NULL;
- valuePtr = valuePtr->nextPtr) {
- objPtr = Tcl_NewStringObj(valuePtr->columnPtr->key, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- if (Blt_TreeView_GetData(entryPtr, valuePtr->columnPtr->key, &objPtr)
- != TCL_OK) {
- objPtr = Tcl_NewStringObj("", -1);
- Tcl_IncrRefCount(objPtr);
- }
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- return listObjPtr;
-}
-
-int
-Blt_TreeView_GetColumn(Tcl_Interp *interp, TreeView *viewPtr, Tcl_Obj *objPtr,
- TreeViewColumn **columnPtrPtr)
-{
- char *string;
-
- string = Tcl_GetString(objPtr);
- if (strcmp(string, "treeView") == 0) {
- *columnPtrPtr = &viewPtr->treeColumn;
- } else {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->columnTable,
- Blt_Tree_GetKey(viewPtr->tree, string));
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find column \"", string,
- "\" in \"", Tk_PathName(viewPtr->tkwin), "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- *columnPtrPtr = Blt_GetHashValue(hPtr);
- }
- return TCL_OK;
-}
-
-
-/*ARGSUSED*/
-static void
-FreeStyle(ClientData clientData, Display *display, char *widgRec, int offset)
-{
- TreeView *viewPtr = clientData;
- TreeViewStyle **stylePtrPtr = (TreeViewStyle **)(widgRec + offset);
-
- if (*stylePtrPtr != NULL) {
- Blt_TreeView_FreeStyle(viewPtr, *stylePtrPtr);
- *stylePtrPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToStyle --
- *
- * Convert the name of an icon into a treeview style.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToStyle(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the new value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- TreeView *viewPtr = clientData;
- TreeViewStyle **stylePtrPtr = (TreeViewStyle **)(widgRec + offset);
- TreeViewStyle *stylePtr;
-
- if (Blt_TreeView_GetStyle(interp, viewPtr, Tcl_GetString(objPtr),
- &stylePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- stylePtr->flags |= STYLE_DIRTY;
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY);
- if (*stylePtrPtr != NULL) {
- Blt_TreeView_FreeStyle(viewPtr, *stylePtrPtr);
- }
- *stylePtrPtr = stylePtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconToObj --
- *
- * Converts the icon into its string representation (its name).
- *
- * Results:
- * The name of the icon is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-StyleToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- TreeViewStyle *stylePtr = *(TreeViewStyle **)(widgRec + offset);
-
- if (stylePtr == NULL) {
- return Tcl_NewStringObj("", -1);
- } else {
- return Tcl_NewStringObj(stylePtr->name, -1);
- }
-}
-
-
-void
-Blt_TreeView_ConfigureColumn(TreeView *viewPtr, TreeViewColumn *columnPtr)
-{
- Drawable drawable;
- GC newGC;
- Blt_Background bg;
- XGCValues gcValues;
- int ruleDrawn;
- unsigned long gcMask;
- int iconWidth, iconHeight;
- unsigned int textWidth, textHeight;
-
- gcMask = GCForeground | GCFont;
- gcValues.font = Blt_FontId(columnPtr->titleFont);
-
- /* Normal title text */
- gcValues.foreground = columnPtr->titleFgColor->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (columnPtr->titleGC != NULL) {
- Tk_FreeGC(viewPtr->display, columnPtr->titleGC);
- }
- columnPtr->titleGC = newGC;
-
- /* Active title text */
- gcValues.foreground = columnPtr->activeTitleFgColor->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (columnPtr->activeTitleGC != NULL) {
- Tk_FreeGC(viewPtr->display, columnPtr->activeTitleGC);
- }
- columnPtr->activeTitleGC = newGC;
-
- columnPtr->titleWidth = 2 * columnPtr->titleBW;
- iconWidth = iconHeight = 0;
- if (columnPtr->titleIcon != NULL) {
- iconWidth = TreeView_IconWidth(columnPtr->titleIcon);
- iconHeight = TreeView_IconHeight(columnPtr->titleIcon);
- columnPtr->titleWidth += iconWidth;
- }
- textWidth = textHeight = 0;
- if (columnPtr->text != NULL) {
- TextStyle ts;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, columnPtr->titleFont);
- Blt_Ts_GetExtents(&ts, columnPtr->text, &textWidth, &textHeight);
- columnPtr->textWidth = textWidth;
- columnPtr->textHeight = textHeight;
- columnPtr->titleWidth += textWidth;
- }
- if (columnPtr->reqArrowWidth > 0) {
- columnPtr->arrowWidth = columnPtr->reqArrowWidth;
- } else {
- columnPtr->arrowWidth = Blt_TextWidth(columnPtr->titleFont, "0", 1) + 4;
- }
- if ((iconWidth > 0) && (textWidth > 0)) {
- columnPtr->titleWidth += 8;
- }
- columnPtr->titleWidth += columnPtr->arrowWidth + 2;
- columnPtr->titleHeight = MAX(iconHeight, textHeight);
- gcMask = (GCFunction | GCLineWidth | GCLineStyle | GCForeground);
-
- /*
- * If the rule is active, turn it off (i.e. draw again to erase
- * it) before changing the GC. If the color changes, we won't be
- * able to erase the old line, since it will no longer be
- * correctly XOR-ed with the background.
- */
- drawable = Tk_WindowId(viewPtr->tkwin);
- ruleDrawn = ((viewPtr->flags & TV_RULE_ACTIVE) &&
- (viewPtr->activeTitleColumnPtr == columnPtr) &&
- (drawable != None));
- if (ruleDrawn) {
- Blt_TreeView_DrawRule(viewPtr, columnPtr, drawable);
- }
- /* XOR-ed rule column divider */
- gcValues.line_width = LineWidth(columnPtr->ruleLineWidth);
- gcValues.foreground =
- Blt_TreeView_GetStyleFg(viewPtr, columnPtr->stylePtr)->pixel;
- if (LineIsDashed(columnPtr->ruleDashes)) {
- gcValues.line_style = LineOnOffDash;
- } else {
- gcValues.line_style = LineSolid;
- }
- gcValues.function = GXxor;
-
- bg = CHOOSE(viewPtr->bg, columnPtr->bg);
- gcValues.foreground ^= Blt_BackgroundBorderColor(bg)->pixel;
- newGC = Blt_GetPrivateGC(viewPtr->tkwin, gcMask, &gcValues);
- if (columnPtr->ruleGC != NULL) {
- Blt_FreePrivateGC(viewPtr->display, columnPtr->ruleGC);
- }
- if (LineIsDashed(columnPtr->ruleDashes)) {
- Blt_SetDashes(viewPtr->display, newGC, &columnPtr->ruleDashes);
- }
- columnPtr->ruleGC = newGC;
- if (ruleDrawn) {
- Blt_TreeView_DrawRule(viewPtr, columnPtr, drawable);
- }
- columnPtr->flags |= COLUMN_DIRTY;
- viewPtr->flags |= UPDATE;
-}
-
-static void
-DestroyColumn(TreeView *viewPtr, TreeViewColumn *columnPtr)
-{
- Blt_HashEntry *hPtr;
-
- bltTreeViewUidOption.clientData = viewPtr;
- bltTreeViewIconOption.clientData = viewPtr;
- styleOption.clientData = viewPtr;
- Blt_FreeOptions(columnSpecs, (char *)columnPtr, viewPtr->display, 0);
- if (columnPtr->titleGC != NULL) {
- Tk_FreeGC(viewPtr->display, columnPtr->titleGC);
- }
- if (columnPtr->ruleGC != NULL) {
- Blt_FreePrivateGC(viewPtr->display, columnPtr->ruleGC);
- }
- hPtr = Blt_FindHashEntry(&viewPtr->columnTable, columnPtr->key);
- if (hPtr != NULL) {
- Blt_DeleteHashEntry(&viewPtr->columnTable, hPtr);
- }
- if (columnPtr->link != NULL) {
- Blt_Chain_DeleteLink(viewPtr->columns, columnPtr->link);
- }
- if (columnPtr == &viewPtr->treeColumn) {
- columnPtr->link = NULL;
- } else {
- Blt_Free(columnPtr);
- }
-}
-
-void
-Blt_TreeView_DestroyColumns(TreeView *viewPtr)
-{
- if (viewPtr->columns != NULL) {
- Blt_ChainLink link;
- TreeViewColumn *columnPtr;
-
- for (link = Blt_Chain_FirstLink(viewPtr->columns); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- columnPtr = Blt_Chain_GetValue(link);
- columnPtr->link = NULL;
- DestroyColumn(viewPtr, columnPtr);
- }
- Blt_Chain_Destroy(viewPtr->columns);
- viewPtr->columns = NULL;
- }
- Blt_DeleteHashTable(&viewPtr->columnTable);
-}
-
-int
-Blt_TreeView_CreateColumn(TreeView *viewPtr, TreeViewColumn *columnPtr,
- const char *name, const char *defTitle)
-{
- Blt_HashEntry *hPtr;
- int isNew;
-
- columnPtr->key = Blt_Tree_GetKeyFromInterp(viewPtr->interp, name);
- columnPtr->text = Blt_AssertStrdup(defTitle);
- columnPtr->justify = TK_JUSTIFY_CENTER;
- columnPtr->relief = TK_RELIEF_FLAT;
- columnPtr->borderWidth = 1;
- columnPtr->pad.side1 = columnPtr->pad.side2 = 2;
- columnPtr->state = STATE_NORMAL;
- columnPtr->weight = 1.0;
- columnPtr->ruleLineWidth = 1;
- columnPtr->titleBW = 2;
- columnPtr->titleRelief = TK_RELIEF_RAISED;
- columnPtr->titleIcon = NULL;
- hPtr = Blt_CreateHashEntry(&viewPtr->columnTable, columnPtr->key, &isNew);
- Blt_SetHashValue(hPtr, columnPtr);
-
- bltTreeViewUidOption.clientData = viewPtr;
- bltTreeViewIconOption.clientData = viewPtr;
- styleOption.clientData = viewPtr;
- if (Blt_ConfigureComponentFromObj(viewPtr->interp, viewPtr->tkwin, name,
- "Column", columnSpecs, 0, (Tcl_Obj **)NULL, (char *)columnPtr, 0)
- != TCL_OK) {
- DestroyColumn(viewPtr, columnPtr);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static TreeViewColumn *
-CreateColumn(TreeView *viewPtr, Tcl_Obj *nameObjPtr, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewColumn *columnPtr;
-
- columnPtr = Blt_AssertCalloc(1, sizeof(TreeViewColumn));
- if (Blt_TreeView_CreateColumn(viewPtr, columnPtr, Tcl_GetString(nameObjPtr),
- Tcl_GetString(nameObjPtr)) != TCL_OK) {
- return NULL;
- }
- bltTreeViewUidOption.clientData = viewPtr;
- bltTreeViewIconOption.clientData = viewPtr;
- styleOption.clientData = viewPtr;
- if (Blt_ConfigureComponentFromObj(viewPtr->interp, viewPtr->tkwin,
- columnPtr->key, "Column", columnSpecs, objc, objv, (char *)columnPtr,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- DestroyColumn(viewPtr, columnPtr);
- return NULL;
- }
- Blt_TreeView_ConfigureColumn(viewPtr, columnPtr);
- return columnPtr;
-}
-
-TreeViewColumn *
-Blt_TreeView_NearestColumn(TreeView *viewPtr, int x, int y,
- ClientData *contextPtr)
-{
- if (viewPtr->nVisible > 0) {
- Blt_ChainLink link;
- TreeViewColumn *columnPtr;
- int right;
-
- /*
- * Determine if the pointer is over the rightmost portion of the
- * column. This activates the rule.
- */
- x = WORLDX(viewPtr, x);
- for(link = Blt_Chain_FirstLink(viewPtr->columns); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- columnPtr = Blt_Chain_GetValue(link);
- right = columnPtr->worldX + columnPtr->width;
- if ((x >= columnPtr->worldX) && (x <= right)) {
- if (contextPtr != NULL) {
- *contextPtr = NULL;
- if ((viewPtr->flags & TV_SHOW_COLUMN_TITLES) &&
- (y >= viewPtr->inset) &&
- (y < (viewPtr->titleHeight + viewPtr->inset))) {
- *contextPtr = (x >= (right - RULE_AREA))
- ? ITEM_COLUMN_RULE : ITEM_COLUMN_TITLE;
- }
- }
- return columnPtr;
- }
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnActivateOp --
- *
- * Selects the button to appear active.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ColumnActivateOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- if (objc == 4) {
- Drawable drawable;
- TreeViewColumn *columnPtr;
- char *string;
-
- string = Tcl_GetString(objv[3]);
- if (string[0] == '\0') {
- columnPtr = NULL;
- } else {
- if (Blt_TreeView_GetColumn(interp, viewPtr, objv[3], &columnPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (((viewPtr->flags & TV_SHOW_COLUMN_TITLES) == 0) ||
- (columnPtr->flags & COLUMN_HIDDEN) ||
- (columnPtr->state == STATE_DISABLED)) {
- columnPtr = NULL;
- }
- }
- viewPtr->activeTitleColumnPtr = viewPtr->activeColumnPtr = columnPtr;
- drawable = Tk_WindowId(viewPtr->tkwin);
- if (drawable != None) {
- Blt_TreeView_DrawHeadings(viewPtr, drawable);
- Blt_TreeView_DrawOuterBorders(viewPtr, drawable);
- }
- }
- if (viewPtr->activeTitleColumnPtr != NULL) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- viewPtr->activeTitleColumnPtr->key, -1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnBindOp --
- *
- * .t bind tag sequence command
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ColumnBindOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- ClientData object;
- TreeViewColumn *columnPtr;
-
- if (Blt_TreeView_GetColumn(NULL, viewPtr, objv[3], &columnPtr) == TCL_OK) {
- object = Blt_TreeView_ColumnTag(viewPtr, columnPtr->key);
- } else {
- object = Blt_TreeView_ColumnTag(viewPtr, Tcl_GetString(objv[3]));
- }
- return Blt_ConfigureBindingsFromObj(interp, viewPtr->bindTable, object,
- objc - 4, objv + 4);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnCgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ColumnCgetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewColumn *columnPtr;
-
- if (Blt_TreeView_GetColumn(interp, viewPtr, objv[3], &columnPtr) != TCL_OK){
- return TCL_ERROR;
- }
- return Blt_ConfigureValueFromObj(interp, viewPtr->tkwin, columnSpecs,
- (char *)columnPtr, objv[4], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnConfigureOp --
- *
- * This procedure is called to process a list of configuration
- * options database, in order to reconfigure the one of more
- * entries in the widget.
- *
- * .h entryconfigure node node node node option value
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then
- * interp->result contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for viewPtr; old resources get freed, if there
- * were any. The hypertext is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnConfigureOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int nOptions, start;
- int i;
-
- /* Figure out where the option value pairs begin */
- for(i = 3; i < objc; i++) {
- TreeViewColumn *columnPtr;
-
- if (Blt_ObjIsOption(columnSpecs, objv[i], 0)) {
- break;
- }
- if (Blt_TreeView_GetColumn(interp, viewPtr, objv[i], &columnPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- start = i;
- nOptions = objc - start;
-
- bltTreeViewUidOption.clientData = viewPtr;
- bltTreeViewIconOption.clientData = viewPtr;
- styleOption.clientData = viewPtr;
- for (i = 3; i < start; i++) {
- TreeViewColumn *columnPtr;
-
- if (Blt_TreeView_GetColumn(interp, viewPtr, objv[i], &columnPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (nOptions == 0) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin, columnSpecs,
- (char *)columnPtr, (Tcl_Obj *)NULL, 0);
- } else if (nOptions == 1) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin, columnSpecs,
- (char *)columnPtr, objv[start], 0);
- }
- if (Blt_ConfigureWidgetFromObj(viewPtr->interp, viewPtr->tkwin,
- columnSpecs, nOptions, objv + start, (char *)columnPtr,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_TreeView_ConfigureColumn(viewPtr, columnPtr);
- }
- /*FIXME: Makes every change redo everything. */
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnDeleteOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ColumnDeleteOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int i;
-
- for(i = 3; i < objc; i++) {
- TreeViewColumn *columnPtr;
- TreeViewEntry *entryPtr;
-
- if (Blt_TreeView_GetColumn(interp, viewPtr, objv[i], &columnPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- /* Traverse the tree deleting values associated with the column. */
- for(entryPtr = viewPtr->rootPtr; entryPtr != NULL;
- entryPtr = Blt_TreeView_NextEntry(entryPtr, 0)) {
- if (entryPtr != NULL) {
- TreeViewValue *valuePtr, *lastPtr, *nextPtr;
-
- lastPtr = NULL;
- for (valuePtr = entryPtr->values; valuePtr != NULL;
- valuePtr = nextPtr) {
- nextPtr = valuePtr->nextPtr;
- if (valuePtr->columnPtr == columnPtr) {
- Blt_TreeView_DestroyValue(viewPtr, valuePtr);
- if (lastPtr == NULL) {
- entryPtr->values = nextPtr;
- } else {
- lastPtr->nextPtr = nextPtr;
- }
- break;
- }
- lastPtr = valuePtr;
- }
- }
- }
- DestroyColumn(viewPtr, columnPtr);
- }
- /* Deleting a column may affect the height of an entry. */
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY /*| RESORT */);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnInsertOp --
- *
- * Add new columns to the tree.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ColumnInsertOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_ChainLink before;
- Tcl_Obj *const *options;
- int i;
- int nOptions;
- int start;
- long insertPos;
-
- if (Blt_GetPositionFromObj(viewPtr->interp, objv[3], &insertPos) != TCL_OK){
- return TCL_ERROR;
- }
- if ((insertPos == -1) ||
- (insertPos >= Blt_Chain_GetLength(viewPtr->columns))) {
- before = NULL; /* Insert at end of list. */
- } else {
- before = Blt_Chain_GetNthLink(viewPtr->columns, insertPos);
- }
- /*
- * Count the column names that follow. Count the arguments until we spot
- * one that looks like a configuration option (i.e. starts with a minus
- * ("-")).
- */
- for (i = 4; i < objc; i++) {
- if (Blt_ObjIsOption(columnSpecs, objv[i], 0)) {
- break;
- }
- }
- start = i;
- nOptions = objc - i;
- options = objv + start;
-
- for (i = 4; i < start; i++) {
- TreeViewColumn *columnPtr;
- TreeViewEntry *entryPtr;
-
- if (Blt_TreeView_GetColumn(NULL, viewPtr, objv[i], &columnPtr) ==
- TCL_OK) {
- Tcl_AppendResult(interp, "column \"", Tcl_GetString(objv[i]),
- "\" already exists", (char *)NULL);
- return TCL_ERROR;
- }
- columnPtr = CreateColumn(viewPtr, objv[i], nOptions, options);
- if (columnPtr == NULL) {
- return TCL_ERROR;
- }
- if (before == NULL) {
- columnPtr->link = Blt_Chain_Append(viewPtr->columns, columnPtr);
- } else {
- columnPtr->link = Blt_Chain_NewLink();
- Blt_Chain_SetValue(columnPtr->link, columnPtr);
- Blt_Chain_LinkBefore(viewPtr->columns, columnPtr->link, before);
- }
- /*
- * Traverse the tree adding column entries where needed.
- */
- for(entryPtr = viewPtr->rootPtr; entryPtr != NULL;
- entryPtr = Blt_TreeView_NextEntry(entryPtr, 0)) {
- Blt_TreeView_AddValue(entryPtr, columnPtr);
- }
- Blt_TreeView_TraceColumn(viewPtr, columnPtr);
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnCurrentOp --
- *
- * Make the rule to appear active.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ColumnCurrentOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- ClientData context;
- TreeViewColumn *columnPtr;
-
- columnPtr = NULL;
- context = Blt_GetCurrentContext(viewPtr->bindTable);
- if ((context == ITEM_COLUMN_TITLE) || (context == ITEM_COLUMN_RULE)) {
- columnPtr = Blt_GetCurrentItem(viewPtr->bindTable);
- }
- if (context >= ITEM_STYLE) {
- TreeViewValue *valuePtr = context;
-
- columnPtr = valuePtr->columnPtr;
- }
- if (columnPtr != NULL) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), columnPtr->key, -1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnInvokeOp --
- *
- * This procedure is called to invoke a column command.
- *
- * .h column invoke columnName
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then
- * interp->result contains an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ColumnInvokeOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewColumn *columnPtr;
- char *string;
-
- string = Tcl_GetString(objv[3]);
- if (string[0] == '\0') {
- return TCL_OK;
- }
- if (Blt_TreeView_GetColumn(interp, viewPtr, objv[3], &columnPtr) != TCL_OK){
- return TCL_ERROR;
- }
- if ((columnPtr->state == STATE_NORMAL) && (columnPtr->titleCmd != NULL)) {
- int result;
-
- Tcl_Preserve(viewPtr);
- Tcl_Preserve(columnPtr);
- result = Tcl_GlobalEval(interp, columnPtr->titleCmd);
- Tcl_Release(columnPtr);
- Tcl_Release(viewPtr);
- return result;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnMoveOp --
- *
- * Move a column.
- *
- * .h column move field1 position
- *---------------------------------------------------------------------------
- */
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnNamesOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ColumnNamesOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_ChainLink link;
- Tcl_Obj *listObjPtr, *objPtr;
- TreeViewColumn *columnPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for(link = Blt_Chain_FirstLink(viewPtr->columns); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- columnPtr = Blt_Chain_GetValue(link);
- objPtr = Tcl_NewStringObj(columnPtr->key, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-ColumnNearestOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int x, y; /* Screen coordinates of the test point. */
- TreeViewColumn *columnPtr;
- ClientData context;
- int checkTitle;
-#ifdef notdef
- int isRoot;
-
- isRoot = FALSE;
- string = Tcl_GetString(objv[3]);
-
- if (strcmp("-root", string) == 0) {
- isRoot = TRUE;
- objv++, objc--;
- }
- if (objc != 5) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " ", Tcl_GetString(objv[1]),
- Tcl_GetString(objv[2]), " ?-root? x y\"", (char *)NULL);
- return TCL_ERROR;
-
- }
-#endif
- if (Tk_GetPixelsFromObj(interp, viewPtr->tkwin, objv[3], &x) != TCL_OK) {
- return TCL_ERROR;
- }
- y = 0;
- checkTitle = FALSE;
- if (objc == 5) {
- if (Tk_GetPixelsFromObj(interp, viewPtr->tkwin, objv[4], &y) != TCL_OK) {
- return TCL_ERROR;
- }
- checkTitle = TRUE;
- }
- columnPtr = Blt_TreeView_NearestColumn(viewPtr, x, y, &context);
- if ((checkTitle) && (context == NULL)) {
- columnPtr = NULL;
- }
- if (columnPtr != NULL) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), columnPtr->key, -1);
- }
- return TCL_OK;
-}
-
-static void
-UpdateMark(TreeView *viewPtr, int newMark)
-{
- Drawable drawable;
- TreeViewColumn *cp;
- int dx;
- int width;
-
- cp = viewPtr->resizeColumnPtr;
- if (cp == NULL) {
- return;
- }
- drawable = Tk_WindowId(viewPtr->tkwin);
- if (drawable == None) {
- return;
- }
-
- /* Erase any existing rule. */
- if (viewPtr->flags & TV_RULE_ACTIVE) {
- Blt_TreeView_DrawRule(viewPtr, cp, drawable);
- }
-
- dx = newMark - viewPtr->ruleAnchor;
- width = cp->width - (PADDING(cp->pad) + 2 * cp->borderWidth);
- if ((cp->reqMin > 0) && ((width + dx) < cp->reqMin)) {
- dx = cp->reqMin - width;
- }
- if ((cp->reqMax > 0) && ((width + dx) > cp->reqMax)) {
- dx = cp->reqMax - width;
- }
- if ((width + dx) < 4) {
- dx = 4 - width;
- }
- viewPtr->ruleMark = viewPtr->ruleAnchor + dx;
-
- /* Redraw the rule if required. */
- if (viewPtr->flags & TV_RULE_NEEDED) {
- Blt_TreeView_DrawRule(viewPtr, cp, drawable);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResizeActivateOp --
- *
- * Turns on/off the resize cursor.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ResizeActivateOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewColumn *columnPtr;
- char *string;
-
- string = Tcl_GetString(objv[4]);
- if (string[0] == '\0') {
- if (viewPtr->cursor != None) {
- Tk_DefineCursor(viewPtr->tkwin, viewPtr->cursor);
- } else {
- Tk_UndefineCursor(viewPtr->tkwin);
- }
- viewPtr->resizeColumnPtr = NULL;
- } else if (Blt_TreeView_GetColumn(interp, viewPtr, objv[4], &columnPtr)
- == TCL_OK) {
- if (viewPtr->resizeCursor != None) {
- Tk_DefineCursor(viewPtr->tkwin, viewPtr->resizeCursor);
- }
- viewPtr->resizeColumnPtr = columnPtr;
- } else {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResizeAnchorOp --
- *
- * Set the anchor for the resize.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ResizeAnchorOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int x;
-
- if (Tcl_GetIntFromObj(NULL, objv[4], &x) != TCL_OK) {
- return TCL_ERROR;
- }
- viewPtr->ruleAnchor = x;
- viewPtr->flags |= TV_RULE_NEEDED;
- UpdateMark(viewPtr, x);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResizeMarkOp --
- *
- * Sets the resize mark. The distance between the mark and the anchor
- * is the delta to change the width of the active column.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ResizeMarkOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int x;
-
- if (Tcl_GetIntFromObj(NULL, objv[4], &x) != TCL_OK) {
- return TCL_ERROR;
- }
- viewPtr->flags |= TV_RULE_NEEDED;
- UpdateMark(viewPtr, x);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ResizeSetOp --
- *
- * Returns the new width of the column including the resize delta.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ResizeSetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- viewPtr->flags &= ~TV_RULE_NEEDED;
- UpdateMark(viewPtr, viewPtr->ruleMark);
- if (viewPtr->resizeColumnPtr != NULL) {
- int width, delta;
- TreeViewColumn *columnPtr;
-
- columnPtr = viewPtr->resizeColumnPtr;
- delta = (viewPtr->ruleMark - viewPtr->ruleAnchor);
- width = viewPtr->resizeColumnPtr->width + delta -
- (PADDING(columnPtr->pad) + 2 * columnPtr->borderWidth) - 1;
- Tcl_SetIntObj(Tcl_GetObjResult(interp), width);
- }
- return TCL_OK;
-}
-
-static Blt_OpSpec resizeOps[] =
-{
- {"activate", 2, ResizeActivateOp, 5, 5, "column"},
- {"anchor", 2, ResizeAnchorOp, 5, 5, "x"},
- {"mark", 1, ResizeMarkOp, 5, 5, "x"},
- {"set", 1, ResizeSetOp, 4, 4, "",},
-};
-
-static int nResizeOps = sizeof(resizeOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColumnResizeOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColumnResizeOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nResizeOps, resizeOps, BLT_OP_ARG3,
- objc, objv,0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (viewPtr, interp, objc, objv);
- return result;
-}
-
-
-static Blt_OpSpec columnOps[] =
-{
- {"activate", 1, ColumnActivateOp, 3, 4, "?field?",},
- {"bind", 1, ColumnBindOp, 4, 6, "tagName ?sequence command?",},
- {"cget", 2, ColumnCgetOp, 5, 5, "field option",},
- {"configure", 2, ColumnConfigureOp, 4, 0, "field ?option value?...",},
- {"current", 2, ColumnCurrentOp, 3, 3, "",},
- {"delete", 1, ColumnDeleteOp, 3, 0, "?field...?",},
- {"highlight", 1, ColumnActivateOp, 3, 4, "?field?",},
- {"insert", 3, ColumnInsertOp, 5, 0,
- "position field ?field...? ?option value?...",},
- {"invoke", 3, ColumnInvokeOp, 4, 4, "field",},
- {"names", 2, ColumnNamesOp, 3, 3, "",},
- {"nearest", 2, ColumnNearestOp, 4, 5, "x ?y?",},
- {"resize", 1, ColumnResizeOp, 3, 0, "arg",},
-};
-static int nColumnOps = sizeof(columnOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeViewColumnOp --
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_TreeView_ColumnOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nColumnOps, columnOps, BLT_OP_ARG2,
- objc, objv,0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (viewPtr, interp, objc, objv);
- return result;
-}
-
-
-static int
-InvokeCompare(TreeView *viewPtr, TreeViewEntry *e1Ptr, TreeViewEntry *e2Ptr,
- Tcl_Obj *cmdPtr)
-{
- int result;
- Tcl_Obj *objv[8];
- int i;
-
- objv[0] = cmdPtr;
- objv[1] = Tcl_NewStringObj(Tk_PathName(viewPtr->tkwin), -1);
- objv[2] = Tcl_NewLongObj(Blt_Tree_NodeId(e1Ptr->node));
- objv[3] = Tcl_NewLongObj(Blt_Tree_NodeId(e2Ptr->node));
- objv[4] = Tcl_NewStringObj(viewPtr->sortColumnPtr->key, -1);
-
- if (viewPtr->flatView) {
- objv[5] = Tcl_NewStringObj(e1Ptr->fullName, -1);
- objv[6] = Tcl_NewStringObj(e2Ptr->fullName, -1);
- } else {
- objv[5] = Tcl_NewStringObj(GETLABEL(e1Ptr), -1);
- objv[6] = Tcl_NewStringObj(GETLABEL(e2Ptr), -1);
- }
- for(i = 0; i < 7; i++) {
- Tcl_IncrRefCount(objv[i]);
- }
- objv[7] = NULL;
- result = Tcl_EvalObjv(viewPtr->interp, 7, objv, TCL_EVAL_GLOBAL);
- if ((result != TCL_OK) ||
- (Tcl_GetIntFromObj(viewPtr->interp, Tcl_GetObjResult(viewPtr->interp),
- &result) != TCL_OK)) {
- Tcl_BackgroundError(viewPtr->interp);
- }
- for(i = 0; i < 7; i++) {
- Tcl_DecrRefCount(objv[i]);
- }
- Tcl_ResetResult(viewPtr->interp);
- return result;
-}
-
-static TreeView *treeViewInstance;
-
-static int
-CompareEntries(const void *a, const void *b)
-{
- TreeView *viewPtr;
- TreeViewEntry **e1PtrPtr = (TreeViewEntry **)a;
- TreeViewEntry **e2PtrPtr = (TreeViewEntry **)b;
- Tcl_Obj *obj1, *obj2;
- const char *s1, *s2;
- int result;
-
- viewPtr = (*e1PtrPtr)->viewPtr;
- obj1 = (*e1PtrPtr)->dataObjPtr;
- obj2 = (*e2PtrPtr)->dataObjPtr;
- s1 = Tcl_GetString(obj1);
- s2 = Tcl_GetString(obj2);
- result = 0;
- switch (viewPtr->sortType) {
- case SORT_ASCII:
- result = strcmp(s1, s2);
- break;
-
- case SORT_COMMAND:
- {
- Tcl_Obj *cmdPtr;
-
- cmdPtr = viewPtr->sortColumnPtr->sortCmdPtr;
- if (cmdPtr == NULL) {
- cmdPtr = viewPtr->sortCmdPtr;
- }
- if (cmdPtr == NULL) {
- result = Blt_DictionaryCompare(s1, s2);
- } else {
- result = InvokeCompare(viewPtr, *e1PtrPtr, *e2PtrPtr, cmdPtr);
- }
- }
- break;
-
- case SORT_DICTIONARY:
- result = Blt_DictionaryCompare(s1, s2);
- break;
-
- case SORT_INTEGER:
- {
- int i1, i2;
-
- if (Tcl_GetIntFromObj(NULL, obj1, &i1)==TCL_OK) {
- if (Tcl_GetIntFromObj(NULL, obj2, &i2) == TCL_OK) {
- result = i1 - i2;
- } else {
- result = -1;
- }
- } else if (Tcl_GetIntFromObj(NULL, obj2, &i2) == TCL_OK) {
- result = 1;
- } else {
- result = Blt_DictionaryCompare(s1, s2);
- }
- }
- break;
-
- case SORT_REAL:
- {
- double r1, r2;
-
- if (Tcl_GetDoubleFromObj(NULL, obj1, &r1) == TCL_OK) {
- if (Tcl_GetDoubleFromObj(NULL, obj2, &r2) == TCL_OK) {
- result = (r1 < r2) ? -1 : (r1 > r2) ? 1 : 0;
- } else {
- result = -1;
- }
- } else if (Tcl_GetDoubleFromObj(NULL, obj2, &r2) == TCL_OK) {
- result = 1;
- } else {
- result = Blt_DictionaryCompare(s1, s2);
- }
- }
- break;
- }
- if (result == 0) {
- result = strcmp((*e1PtrPtr)->fullName, (*e2PtrPtr)->fullName);
- }
- if (viewPtr->sortDecreasing) {
- return -result;
- }
- return result;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * CompareNodes --
- *
- * Comparison routine (used by qsort) to sort a chain of subnodes.
- *
- * Results:
- * 1 is the first is greater, -1 is the second is greater, 0
- * if equal.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CompareNodes(Blt_TreeNode *n1Ptr, Blt_TreeNode *n2Ptr)
-{
- TreeView *viewPtr = treeViewInstance;
- TreeViewEntry *e1Ptr, *e2Ptr;
-
- e1Ptr = Blt_TreeView_NodeToEntry(viewPtr, *n1Ptr);
- e2Ptr = Blt_TreeView_NodeToEntry(viewPtr, *n2Ptr);
-
- /* Fetch the data for sorting. */
- if (viewPtr->sortType == SORT_COMMAND) {
- e1Ptr->dataObjPtr = Tcl_NewLongObj(Blt_Tree_NodeId(*n1Ptr));
- e2Ptr->dataObjPtr = Tcl_NewLongObj(Blt_Tree_NodeId(*n2Ptr));
- } else {
- Blt_TreeKey key;
- Tcl_Obj *objPtr;
-
- key = viewPtr->sortColumnPtr->key;
- if (Blt_TreeView_GetData(e1Ptr, key, &objPtr) != TCL_OK) {
- e1Ptr->dataObjPtr = Tcl_NewStringObj("", -1);
- } else {
- e1Ptr->dataObjPtr = objPtr;
- }
- if (Blt_TreeView_GetData(e2Ptr, key, &objPtr) != TCL_OK) {
- e2Ptr->dataObjPtr = Tcl_NewStringObj("", -1);
- } else {
- e2Ptr->dataObjPtr = objPtr;
- }
- }
- {
- Tcl_DString dString;
-
- Tcl_DStringInit(&dString);
- if (e1Ptr->fullName == NULL) {
- Blt_TreeView_GetFullName(viewPtr, e1Ptr, TRUE, &dString);
- e1Ptr->fullName = Blt_AssertStrdup(Tcl_DStringValue(&dString));
- }
- e1Ptr->dataObjPtr = Tcl_NewStringObj(e1Ptr->fullName, -1);
- if (e2Ptr->fullName == NULL) {
- Blt_TreeView_GetFullName(viewPtr, e2Ptr, TRUE, &dString);
- e2Ptr->fullName = Blt_AssertStrdup(Tcl_DStringValue(&dString));
- }
- e2Ptr->dataObjPtr = Tcl_NewStringObj(e2Ptr->fullName, -1);
- Tcl_DStringFree(&dString);
- }
- return CompareEntries(&e1Ptr, &e2Ptr);
-}
-
-static int
-SortAutoOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
-
- if (objc == 4) {
- int bool;
- int isAuto;
-
- isAuto = ((viewPtr->flags & TV_SORT_AUTO) != 0);
- if (Tcl_GetBooleanFromObj(interp, objv[3], &bool) != TCL_OK) {
- return TCL_ERROR;
- }
- if (isAuto != bool) {
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY | RESORT);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- }
- if (bool) {
- viewPtr->flags |= TV_SORT_AUTO;
- } else {
- viewPtr->flags &= ~TV_SORT_AUTO;
- }
- }
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), (viewPtr->flags & TV_SORT_AUTO));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SortCgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SortCgetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- return Blt_ConfigureValueFromObj(interp, viewPtr->tkwin, sortSpecs,
- (char *)viewPtr, objv[3], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SortConfigureOp --
- *
- * This procedure is called to process a list of configuration
- * options database, in order to reconfigure the one of more
- * entries in the widget.
- *
- * .h sort configure option value
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then
- * interp->result contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for viewPtr; old resources get freed, if there
- * were any. The hypertext is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SortConfigureOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int oldType;
- Tcl_Obj *oldCmdPtr;
- TreeViewColumn *oldColumn;
-
- if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin, sortSpecs,
- (char *)viewPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin, sortSpecs,
- (char *)viewPtr, objv[3], 0);
- }
- oldColumn = viewPtr->sortColumnPtr;
- oldType = viewPtr->sortType;
- oldCmdPtr = viewPtr->sortCmdPtr;
- if (Blt_ConfigureWidgetFromObj(interp, viewPtr->tkwin, sortSpecs,
- objc - 3, objv + 3, (char *)viewPtr, BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((oldColumn != viewPtr->sortColumnPtr)||(oldType != viewPtr->sortType) ||
- (oldCmdPtr != viewPtr->sortCmdPtr)) {
- viewPtr->flags &= ~SORTED;
- viewPtr->flags |= (DIRTY | RESORT);
- }
- if (viewPtr->flags & TV_SORT_AUTO) {
- viewPtr->flags |= SORT_PENDING;
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-SortOnceOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int recurse;
-
- recurse = FALSE;
- if (objc > 3) {
- char *string;
- int length;
-
- string = Tcl_GetStringFromObj(objv[3], &length);
- if ((string[0] == '-') && (length > 1) &&
- (strncmp(string, "-recurse", length) == 0)) {
- objv++, objc--;
- recurse = TRUE;
- }
- }
-#ifdef notdef
- {
- int i;
-
- treeViewInstance = viewPtr;
- for (i = 3; i < objc; i++) {
- TreeViewEntry *entryPtr;
- int result;
-
- if (Blt_TreeView_GetEntry(viewPtr, objv[i], &entryPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (recurse) {
- result = Blt_Tree_Apply(entryPtr->node, SortApplyProc, viewPtr);
- } else {
- result = SortApplyProc(entryPtr->node, viewPtr, TREE_PREORDER);
- }
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
-#endif
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY | UPDATE | SORT_PENDING |
- RESORT);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_SortOp --
- *
- * Comparison routine (used by qsort) to sort a chain of subnodes.
- * A simple string comparison is performed on each node name.
- *
- * .h sort auto
- * .h sort once -recurse root
- *
- * Results:
- * 1 is the first is greater, -1 is the second is greater, 0
- * if equal.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec sortOps[] =
-{
- {"auto", 1, SortAutoOp, 3, 4, "?boolean?",},
- {"cget", 2, SortCgetOp, 4, 4, "option",},
- {"configure", 2, SortConfigureOp, 3, 0, "?option value?...",},
- {"once", 1, SortOnceOp, 3, 0, "?-recurse? node...",},
-};
-static int nSortOps = sizeof(sortOps) / sizeof(Blt_OpSpec);
-
-/*ARGSUSED*/
-int
-Blt_TreeView_SortOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nSortOps, sortOps, BLT_OP_ARG2, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (viewPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SortApplyProc --
- *
- * Sorts the subnodes at a given node.
- *
- * Results:
- * Always returns TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SortApplyProc(Blt_TreeNode node, ClientData clientData, int order)
-{
- TreeView *viewPtr = clientData;
-
- if (!Blt_Tree_IsLeaf(node)) {
- Blt_Tree_SortNode(viewPtr->tree, node, CompareNodes);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_SortFlatView --
- *
- * Sorts the flatten array of entries.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TreeView_SortFlatView(TreeView *viewPtr)
-{
- TreeViewEntry *entryPtr, **p;
-
- viewPtr->flags &= ~SORT_PENDING;
- if ((viewPtr->sortType == SORT_NONE) || (viewPtr->nEntries < 2)) {
- return;
- }
- if (viewPtr->flags & SORTED) {
- int first, last;
- TreeViewEntry *hold;
-
- if (viewPtr->sortDecreasing == viewPtr->viewIsDecreasing) {
- return;
- }
-
- /*
- * The view is already sorted but in the wrong direction.
- * Reverse the entries in the array.
- */
- for (first = 0, last = viewPtr->nEntries - 1; last > first;
- first++, last--) {
- hold = viewPtr->flatArr[first];
- viewPtr->flatArr[first] = viewPtr->flatArr[last];
- viewPtr->flatArr[last] = hold;
- }
- viewPtr->viewIsDecreasing = viewPtr->sortDecreasing;
- viewPtr->flags |= SORTED | LAYOUT_PENDING;
- return;
- }
- /* Fetch each entry's data as Tcl_Objs for sorting. */
- if (viewPtr->sortColumnPtr == &viewPtr->treeColumn) {
- for(p = viewPtr->flatArr; *p != NULL; p++) {
- entryPtr = *p;
- if (entryPtr->fullName == NULL) {
- Tcl_DString dString;
-
- Blt_TreeView_GetFullName(viewPtr, entryPtr, TRUE, &dString);
- entryPtr->fullName =
- Blt_AssertStrdup(Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- }
- entryPtr->dataObjPtr = Tcl_NewStringObj(entryPtr->fullName, -1);
- Tcl_IncrRefCount(entryPtr->dataObjPtr);
- }
- } else {
- Blt_TreeKey key;
- Tcl_Obj *objPtr;
-
- key = viewPtr->sortColumnPtr->key;
- for(p = viewPtr->flatArr; *p != NULL; p++) {
- entryPtr = *p;
- if (Blt_TreeView_GetData(entryPtr, key, &objPtr) != TCL_OK) {
- objPtr = Tcl_NewStringObj("", -1);
- }
- entryPtr->dataObjPtr = objPtr;
- Tcl_IncrRefCount(entryPtr->dataObjPtr);
- }
- }
- qsort((char *)viewPtr->flatArr, viewPtr->nEntries, sizeof(TreeViewEntry *),
- (QSortCompareProc *)CompareEntries);
-
- /* Free all the Tcl_Objs used for comparison data. */
- for(p = viewPtr->flatArr; *p != NULL; p++) {
- Tcl_DecrRefCount((*p)->dataObjPtr);
- }
- viewPtr->viewIsDecreasing = viewPtr->sortDecreasing;
- viewPtr->flags |= SORTED;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_TreeView_SortView --
- *
- * Sorts the tree array of entries.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_TreeView_SortView(TreeView *viewPtr)
-{
- viewPtr->flags &= ~SORT_PENDING;
- if (viewPtr->sortType != SORT_NONE) {
- treeViewInstance = viewPtr;
- Blt_Tree_Apply(viewPtr->rootPtr->node, SortApplyProc, viewPtr);
- }
- viewPtr->viewIsDecreasing = viewPtr->sortDecreasing;
-}
-
-
-#endif /* NO_TREEVIEW */
diff --git a/blt3.0.1/src/bltTvEdit.c b/blt3.0.1/src/bltTvEdit.c
deleted file mode 100644
index 92520ff..0000000
--- a/blt3.0.1/src/bltTvEdit.c
+++ /dev/null
@@ -1,1703 +0,0 @@
-
-/*
- Remember row,column where string was acquired.
- postcombobox x y
- icon?, text, row, column position, fg, bg button?
- based upon style.
- grab set
- SetIcon
- SetText
- SetBg
- SetFg
- SetFont
- SetButton
- */
-
-/*
- * bltTvEdit.c --
- *
- * This module implements an hierarchy widget for the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_TREEVIEW
-#include "bltOp.h"
-#include "bltTreeView.h"
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-
-#define TEXTBOX_FOCUS (1<<0)
-#define TEXTBOX_REDRAW (1<<1)
-
-static Tcl_IdleProc DisplayTextbox;
-static Tcl_FreeProc DestroyTextbox;
-static Tcl_TimerProc BlinkCursorProc;
-static Tcl_ObjCmdProc TextboxCmd;
-
-/*
- * Textbox --
- *
- * This structure is shared by entries when their labels are
- * edited via the keyboard. It maintains the location of the
- * insertion cursor and the text selection for the editted entry.
- * The structure is shared since we need only one. The "focus"
- * entry should be the only entry receiving KeyPress/KeyRelease
- * events at any time. Information from the previously editted
- * entry is overwritten.
- *
- * Note that all the indices internally are in terms of bytes,
- * not characters. This is because UTF-8 strings may encode a
- * single character into a multi-byte sequence. To find the
- * respective character position
- *
- * n = Tcl_NumUtfChars(string, index);
- *
- * where n is the resulting character number.
- */
-typedef struct {
-
- /*
- * This is a SNAFU in the Tk API. It assumes that only an official
- * Tk "toplevel" widget will ever become a toplevel window (i.e. a
- * window whose parent is the root window). Because under Win32,
- * Tk tries to use the widget record associated with the TopLevel
- * as a Tk frame widget, to read its menu name. What this means
- * is that any widget that's going to be a toplevel, must also look
- * like a frame. Therefore we've copied the frame widget structure
- * fields into the token.
- */
-
- Tk_Window tkwin; /* Window that embodies the frame. NULL
- * means that the window has been destroyed
- * but the data structures haven't yet been
- * cleaned up. */
- Display *display; /* Display containing widget. Used, among
- * other things, so that resources can be
- * freed even after tkwin has gone away. */
- Tcl_Interp *interp; /* Interpreter associated with widget. Used
- * to delete widget command. */
- Tcl_Command widgetCmd; /* Token for frame's widget command. */
- char *className; /* Class name for widget (from configuration
- * option). Malloc-ed. */
- int mask; /* Either FRAME or TOPLEVEL; used to select
- * which configuration options are valid for
- * widget. */
- char *screenName; /* Screen on which widget is created. Non-null
- * only for top-levels. Malloc-ed, may be
- * NULL. */
- char *visualName; /* Textual description of visual for window,
- * from -visual option. Malloc-ed, may be
- * NULL. */
- char *colormapName; /* Textual description of colormap for window,
- * from -colormap option. Malloc-ed, may be
- * NULL. */
- char *menuName; /* Textual description of menu to use for
- * menubar. Malloc-ed, may be NULL. */
- Colormap colormap; /* If not None, identifies a colormap
- * allocated for this window, which must be
- * freed when the window is deleted. */
- Tk_3DBorder border; /* Structure used to draw 3-D border and
- * background. NULL means no background
- * or border. */
- int borderWidth; /* Width of 3-D border (if any). */
- int relief; /* 3-d effect: TK_RELIEF_RAISED etc. */
- int highlightWidth; /* Width in pixels of highlight to draw
- * around widget when it has the focus.
- * 0 means don't draw a highlight. */
- XColor *highlightBgColorPtr;
- /* Color for drawing traversal highlight
- * area when highlight is off. */
- XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
- int width; /* Width to request for window. <= 0 means
- * don't request any size. */
- int height; /* Height to request for window. <= 0 means
- * don't request any size. */
- Tk_Cursor cursor; /* Current cursor for window, or None. */
- char *takeFocus; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
- int isContainer; /* 1 means this window is a container, 0 means
- * that it isn't. */
- char *useThis; /* If the window is embedded, this points to
- * the name of the window in which it is
- * embedded (malloc'ed). For non-embedded
- * windows this is NULL. */
- int flags; /* Various flags; see below for
- * definitions. */
-
- /* Textbox-specific fields */
- TreeView *viewPtr;
- int x, y; /* Position of window. */
-
- int active; /* Indicates that the frame is active. */
- int exportSelection;
-
- int insertPos; /* Position of the cursor within the
- * array of bytes of the entry's label. */
-
- int cursorX, cursorY; /* Position of the insertion cursor in the
- * textbox window. */
- short int cursorWidth; /* Size of the insertion cursor symbol. */
- short int cursorHeight;
-
- int selAnchor; /* Fixed end of selection. Used to extend
- * the selection while maintaining the
- * other end of the selection. */
- int selFirst; /* Position of the first character in the
- * selection. */
- int selLast; /* Position of the last character in the
- * selection. */
-
- int cursorOn; /* Indicates if the cursor is displayed. */
- int onTime, offTime; /* Time in milliseconds to wait before
- * changing the cursor from off-to-on
- * and on-to-off. Setting offTime to 0 makes
- * the cursor steady. */
- Tcl_TimerToken timerToken; /* Handle for a timer event called periodically
- * to blink the cursor. */
- /* Data-specific fields. */
- TreeViewEntry *entryPtr; /* Selected entry */
- TreeViewColumn *columnPtr; /* Column of entry to be edited */
- TreeViewStyle *stylePtr;
- TreeViewIcon icon;
- int gap;
- char *string;
- TextLayout *textPtr;
- Blt_Font font;
- GC gc;
-
- Tk_3DBorder selBorder;
- int selRelief;
- int selBW;
- XColor *selFgColor; /* Text color of a selected entry. */
- int buttonBW;
- Tk_3DBorder buttonBorder;
- int buttonRelief;
-} Textbox;
-
-#define DEF_TEXTBOX_BACKGROUND RGB_WHITE
-#define DEF_TEXTBOX_BORDERWIDTH STD_BORDERWIDTH
-#ifdef WIN32
-#define DEF_TEXTBOX_BUTTON_BACKGROUND RGB_GREY85
-#else
-#define DEF_TEXTBOX_BUTTON_BACKGROUND RGB_GREY90
-#endif
-#define DEF_TEXTBOX_BUTTON_BORDERWIDTH "2"
-#define DEF_TEXTBOX_BUTTON_RELIEF "raised"
-#define DEF_TEXTBOX_CURSOR (char *)NULL
-#define DEF_TEXTBOX_EXPORT_SELECTION "no"
-#define DEF_TEXTBOX_NORMAL_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_TEXTBOX_NORMAL_FG_MONO STD_ACTIVE_FG_MONO
-#define DEF_TEXTBOX_RELIEF "solid"
-#define DEF_TEXTBOX_SELECT_BACKGROUND RGB_LIGHTBLUE0
-#define DEF_TEXTBOX_SELECT_BG_MONO STD_SELECT_BG_MONO
-#define DEF_TEXTBOX_SELECT_BORDERWIDTH "1"
-#define DEF_TEXTBOX_SELECT_FOREGROUND STD_SELECT_FOREGROUND
-#define DEF_TEXTBOX_SELECT_FG_MONO STD_SELECT_FG_MONO
-#define DEF_TEXTBOX_SELECT_RELIEF "flat"
-
-/* Textbox Procedures */
-static Blt_ConfigSpec textboxConfigSpecs[] =
-{
- {BLT_CONFIG_BORDER, "-background", "background", "Background",
- DEF_TEXTBOX_BACKGROUND, Blt_Offset(Textbox, border), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0,0},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_TEXTBOX_CURSOR, Blt_Offset(Textbox, cursor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_TEXTBOX_BORDERWIDTH, Blt_Offset(Textbox, borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BORDER, "-buttonbackground", "buttonBackground",
- "ButtonBackground", DEF_TEXTBOX_BUTTON_BACKGROUND,
- Blt_Offset(Textbox, buttonBorder), 0},
- {BLT_CONFIG_RELIEF, "-buttonrelief", "buttonRelief", "ButtonRelief",
- DEF_TEXTBOX_BUTTON_RELIEF, Blt_Offset(Textbox, buttonRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-buttonborderwidth", "buttonBorderWidth",
- "ButtonBorderWidth", DEF_TEXTBOX_BUTTON_BORDERWIDTH,
- Blt_Offset(Textbox, buttonBW),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BOOLEAN, "-exportselection", "exportSelection",
- "ExportSelection", DEF_TEXTBOX_EXPORT_SELECTION,
- Blt_Offset(Textbox, exportSelection),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_TEXTBOX_RELIEF,
- Blt_Offset(Textbox, relief), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BORDER, "-selectbackground", "selectBackground", "Background",
- DEF_TEXTBOX_SELECT_BG_MONO, Blt_Offset(Textbox, selBorder),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_BORDER, "-selectbackground", "selectBackground", "Background",
- DEF_TEXTBOX_SELECT_BACKGROUND, Blt_Offset(Textbox, selBorder),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_PIXELS_NNEG, "-selectborderwidth", "selectBorderWidth",
- "BorderWidth", DEF_TEXTBOX_SELECT_BORDERWIDTH,
- Blt_Offset(Textbox, selBW), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground", "Foreground",
-
- DEF_TEXTBOX_SELECT_FG_MONO, Blt_Offset(Textbox, selFgColor),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground", "Foreground",
- DEF_TEXTBOX_SELECT_FOREGROUND, Blt_Offset(Textbox, selFgColor),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_RELIEF, "-selectrelief", "selectRelief", "Relief",
- DEF_TEXTBOX_SELECT_RELIEF, Blt_Offset(Textbox, selRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-static Tk_LostSelProc TextboxLostSelectionProc;
-static Tk_SelectionProc TextboxSelectionProc;
-static Tk_EventProc TextboxEventProc;
-
-typedef int (TextboxCmdProc)(Textbox *tbPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedraw --
- *
- * Queues a request to redraw the widget at the next idle point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets redisplayed. Right now we don't do selective
- * redisplays: the whole window will be redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedraw(Textbox *tbPtr)
-{
- if ((tbPtr->tkwin != NULL) &&
- ((tbPtr->flags & TEXTBOX_REDRAW) == 0)) {
- tbPtr->flags |= TEXTBOX_REDRAW;
- Tcl_DoWhenIdle(DisplayTextbox, tbPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BlinkCursorProc --
- *
- * This procedure is called as a timer handler to blink the
- * insertion cursor off and on.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The cursor gets turned on or off, redisplay gets invoked,
- * and this procedure reschedules itself.
- *
- *---------------------------------------------------------------------------
- */
-static void
-BlinkCursorProc(ClientData clientData)
-{
- Textbox *tbPtr = clientData;
- int interval;
-
- if (!(tbPtr->flags & TEXTBOX_FOCUS) || (tbPtr->offTime == 0)) {
- return;
- }
- if (tbPtr->active) {
- tbPtr->cursorOn ^= 1;
- interval = (tbPtr->cursorOn) ? tbPtr->onTime : tbPtr->offTime;
- tbPtr->timerToken =
- Tcl_CreateTimerHandler(interval, BlinkCursorProc, tbPtr);
- EventuallyRedraw(tbPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextboxEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various
- * events on treeview widgets.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TextboxEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Textbox *tbPtr = clientData;
-
- if (eventPtr->type == Expose) {
- if (eventPtr->xexpose.count == 0) {
- EventuallyRedraw(tbPtr);
- }
- } else if (eventPtr->type == ConfigureNotify) {
- EventuallyRedraw(tbPtr);
- } else if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
- if (eventPtr->xfocus.detail == NotifyInferior) {
- return;
- }
- if (eventPtr->type == FocusIn) {
- tbPtr->flags |= TEXTBOX_FOCUS;
- } else {
- tbPtr->flags &= ~TEXTBOX_FOCUS;
- }
- Tcl_DeleteTimerHandler(tbPtr->timerToken);
- if ((tbPtr->active) && (tbPtr->flags & TEXTBOX_FOCUS)) {
- tbPtr->cursorOn = TRUE;
- if (tbPtr->offTime != 0) {
- tbPtr->timerToken = Tcl_CreateTimerHandler(tbPtr->onTime,
- BlinkCursorProc, tbPtr);
- }
- } else {
- tbPtr->cursorOn = FALSE;
- tbPtr->timerToken = (Tcl_TimerToken) NULL;
- }
- EventuallyRedraw(tbPtr);
- } else if (eventPtr->type == DestroyNotify) {
- if (tbPtr->tkwin != NULL) {
- tbPtr->tkwin = NULL;
- }
- if (tbPtr->flags & TEXTBOX_REDRAW) {
- Tcl_CancelIdleCall(DisplayTextbox, tbPtr);
- }
- if (tbPtr->timerToken != NULL) {
- Tcl_DeleteTimerHandler(tbPtr->timerToken);
- }
- tbPtr->viewPtr->comboWin = NULL;
- Tcl_EventuallyFree(tbPtr, DestroyTextbox);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextboxLostSelectionProc --
- *
- * This procedure is called back by Tk when the selection is
- * grabbed away from a Text widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The existing selection is unhighlighted, and the window is
- * marked as not containing a selection.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TextboxLostSelectionProc(ClientData clientData)
-{
- Textbox *tbPtr = clientData;
-
- if ((tbPtr->selFirst >= 0) && (tbPtr->exportSelection)) {
- tbPtr->selFirst = tbPtr->selLast = -1;
- EventuallyRedraw(tbPtr);
- }
-}
-
-static int
-PointerToIndex(Textbox *tbPtr, int x, int y)
-{
- TextLayout *textPtr;
- Blt_FontMetrics fontMetrics;
- TextFragment *fragPtr;
- int nBytes;
- int i;
- int total;
-
- if ((tbPtr->string == NULL) || (tbPtr->string[0] == '\0')) {
- return 0;
- }
- x -= tbPtr->selBW;
- y -= tbPtr->selBW;
-
- textPtr = tbPtr->textPtr;
-
- /* Bound the y-coordinate within the window. */
- if (y < 0) {
- y = 0;
- } else if (y >= textPtr->height) {
- y = textPtr->height - 1;
- }
- /*
- * Compute the line that contains the y-coordinate.
- *
- * FIXME: This assumes that segments are distributed
- * line-by-line. This may change in the future.
- */
- Blt_GetFontMetrics(tbPtr->font, &fontMetrics);
- fragPtr = textPtr->fragments;
- total = 0;
- for (i = (y / fontMetrics.linespace); i > 0; i--) {
- total += fragPtr->count;
- fragPtr++;
- }
- if (x < 0) {
- nBytes = 0;
- } else if (x >= textPtr->width) {
- nBytes = fragPtr->count;
- } else {
- int newX;
-
- /* Find the character underneath the pointer. */
- nBytes = Blt_MeasureChars(tbPtr->font, fragPtr->text, fragPtr->count,
- x, 0, &newX);
- if ((newX < x) && (nBytes < fragPtr->count)) {
- double fract;
- int length, charSize;
- const char *next;
-
- next = fragPtr->text + nBytes;
-#if HAVE_UTF
- {
- Tcl_UniChar dummy;
-
- length = Tcl_UtfToUniChar(next, &dummy);
- }
-#else
- length = 1;
-#endif
- charSize = Blt_TextWidth(tbPtr->font, next, length);
- fract = ((double)(x - newX) / (double)charSize);
- if (ROUND(fract)) {
- nBytes += length;
- }
- }
- }
- return nBytes + total;
-}
-
-static int
-IndexToPointer(Textbox *tbPtr)
-{
- int x, y;
- int maxLines;
- TextLayout *textPtr;
- Blt_FontMetrics fontMetrics;
- int nBytes;
- int sum;
- TextFragment *fragPtr;
- int i;
-
- textPtr = tbPtr->textPtr;
- Blt_GetFontMetrics(tbPtr->font, &fontMetrics);
- maxLines = (textPtr->height / fontMetrics.linespace) - 1;
-
- sum = 0;
- x = y = tbPtr->borderWidth;
- if (tbPtr->icon != NULL) {
- x += TreeView_IconWidth(tbPtr->icon) + 2 * tbPtr->gap;
- }
- fragPtr = textPtr->fragments;
- for (i = 0; i <= maxLines; i++) {
- /* Total the number of bytes on each line. Include newlines. */
- nBytes = fragPtr->count + 1;
- if ((sum + nBytes) > tbPtr->insertPos) {
- x += Blt_TextWidth(tbPtr->font, fragPtr->text,
- tbPtr->insertPos - sum);
- break;
- }
- y += fontMetrics.linespace;
- sum += nBytes;
- fragPtr++;
- }
- tbPtr->cursorX = x;
- tbPtr->cursorY = y;
- tbPtr->cursorHeight = fontMetrics.linespace;
- tbPtr->cursorWidth = 3;
- return TCL_OK;
-}
-
-static void
-UpdateLayout(Textbox *tbPtr)
-{
- TreeView *viewPtr;
- TextStyle ts;
- int width, height;
- TextLayout *textPtr;
- int gap, offset;
- int iw, ih;
-
- viewPtr = tbPtr->viewPtr;
- offset = gap = iw = ih = 0;
- if (tbPtr->icon != NULL) {
- iw = TreeView_IconWidth(tbPtr->icon) + 4;
- ih = TreeView_IconHeight(tbPtr->icon);
- gap = tbPtr->gap;
- }
-
- /* The layout is based upon the current font. */
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, tbPtr->font);
- textPtr = Blt_Ts_CreateLayout(tbPtr->string, -1, &ts);
- if (tbPtr->textPtr != NULL) {
- Blt_Free(tbPtr->textPtr);
- }
- tbPtr->textPtr = textPtr;
-
- width = iw + textPtr->width + gap * 2;
- height = MAX(ih, textPtr->height);
- if ((tbPtr->columnPtr == &viewPtr->treeColumn) && (!viewPtr->flatView)) {
- int level;
-
- level = DEPTH(viewPtr, tbPtr->entryPtr->node);
- offset = -(ICONWIDTH(level) + 2);
- }
-
- if (width <= (tbPtr->columnPtr->width + offset)) {
- width = (tbPtr->columnPtr->width + offset);
- }
- if (height < tbPtr->entryPtr->height) {
- height = tbPtr->entryPtr->height;
- }
- tbPtr->width = width + (2 * tbPtr->borderWidth);
- tbPtr->height = height + (2 * tbPtr->borderWidth);
- IndexToPointer(tbPtr);
- Tk_MoveResizeWindow(tbPtr->tkwin, tbPtr->x, tbPtr->y,
- tbPtr->width, tbPtr->height);
- Tk_MapWindow(tbPtr->tkwin);
- XRaiseWindow(tbPtr->display, Tk_WindowId(tbPtr->tkwin));
-}
-
-static void
-InsertText(Textbox *tbPtr, char *insertText, int insertPos, int nBytes)
-{
- int oldSize, newSize;
- char *oldText, *newText;
-
- oldText = tbPtr->string;
- oldSize = (int)strlen(oldText);
- newSize = oldSize + nBytes + 1;
- newText = Blt_AssertMalloc(sizeof(char) * newSize);
- if (insertPos == oldSize) { /* Append */
- sprintf_s(newText, newSize, "%s%s", oldText, insertText);
- } else if (insertPos == 0) {/* Prepend */
- sprintf_s(newText, newSize, "%s%s", insertText, oldText);
- } else { /* Insert into existing. */
- sprintf_s(newText, newSize, "%.*s%s%s", insertPos, oldText, insertText,
- oldText + insertPos);
- }
-
- /*
- * All indices from the start of the insertion to the end of the
- * string need to be updated. Simply move the indices down by the
- * number of characters added.
- */
- if (tbPtr->selFirst >= insertPos) {
- tbPtr->selFirst += nBytes;
- }
- if (tbPtr->selLast > insertPos) {
- tbPtr->selLast += nBytes;
- }
- if ((tbPtr->selAnchor > insertPos) || (tbPtr->selFirst >= insertPos)) {
- tbPtr->selAnchor += nBytes;
- }
- if (tbPtr->string != NULL) {
- Blt_Free(tbPtr->string);
- }
- tbPtr->string = newText;
- tbPtr->insertPos = insertPos + nBytes;
- UpdateLayout(tbPtr);
-}
-
-static int
-DeleteText(Textbox *tbPtr, int firstPos, int lastPos)
-{
- char *oldText, *newText;
- int oldSize, newSize;
- int nBytes;
- char *p;
-
- oldText = tbPtr->string;
- if (firstPos > lastPos) {
- return TCL_OK;
- }
- lastPos++; /* Now is the position after the last
- * character. */
-
- nBytes = lastPos - firstPos;
- oldSize = strlen(oldText) + 1;
- newSize = oldSize - nBytes + 1;
- newText = Blt_AssertMalloc(sizeof(char) * newSize);
- p = newText;
- if (firstPos > 0) {
- strncpy(p, oldText, firstPos);
- p += firstPos;
- }
- *p = '\0';
- if (lastPos < oldSize) {
- strcpy(p, oldText + lastPos);
- }
- Blt_Free(oldText);
-
- /*
- * Since deleting characters compacts the character array, we need to
- * update the various character indices according. It depends where
- * the index occurs in relation to range of deleted characters:
- *
- * before Ignore.
- * within Move the index back to the start of the deletion.
- * after Subtract off the deleted number of characters,
- * since the array has been compressed by that
- * many characters.
- *
- */
- if (tbPtr->selFirst >= firstPos) {
- if (tbPtr->selFirst >= lastPos) {
- tbPtr->selFirst -= nBytes;
- } else {
- tbPtr->selFirst = firstPos;
- }
- }
- if (tbPtr->selLast >= firstPos) {
- if (tbPtr->selLast >= lastPos) {
- tbPtr->selLast -= nBytes;
- } else {
- tbPtr->selLast = firstPos;
- }
- }
- if (tbPtr->selLast <= tbPtr->selFirst) {
- tbPtr->selFirst = tbPtr->selLast = -1; /* Cut away the entire
- * selection. */
- }
- if (tbPtr->selAnchor >= firstPos) {
- if (tbPtr->selAnchor >= lastPos) {
- tbPtr->selAnchor -= nBytes;
- } else {
- tbPtr->selAnchor = firstPos;
- }
- }
- if (tbPtr->insertPos >= firstPos) {
- if (tbPtr->insertPos >= lastPos) {
- tbPtr->insertPos -= nBytes;
- } else {
- tbPtr->insertPos = firstPos;
- }
- }
- tbPtr->string = newText;
- UpdateLayout(tbPtr);
- EventuallyRedraw(tbPtr);
- return TCL_OK;
-}
-
-static int
-AcquireText(TreeView *viewPtr, Textbox *tbPtr, TreeViewEntry *entryPtr,
- TreeViewColumn *columnPtr)
-{
- TreeViewStyle *stylePtr;
- int x, y;
- const char *string;
- TreeViewIcon icon;
-
- if (columnPtr == &viewPtr->treeColumn) {
- int level;
-
- level = DEPTH(viewPtr, entryPtr->node);
- x = SCREENX(viewPtr, entryPtr->worldX);
- y = SCREENY(viewPtr, entryPtr->worldY);
-#ifdef notdef
- x += ICONWIDTH(level) + ICONWIDTH(level + 1) + 4;
-#endif
- if (!viewPtr->flatView) {
- x += ICONWIDTH(level);
- }
- string = GETLABEL(entryPtr);
- stylePtr = columnPtr->stylePtr;
- icon = Blt_TreeView_GetEntryIcon(viewPtr, entryPtr);
- } else {
- TreeViewValue *valuePtr;
-
- x = SCREENX(viewPtr, columnPtr->worldX);
- y = SCREENY(viewPtr, entryPtr->worldY);
- stylePtr = columnPtr->stylePtr;
- valuePtr = Blt_TreeView_FindValue(entryPtr, columnPtr);
- string = valuePtr->fmtString;
- if (valuePtr->stylePtr != NULL) {
- stylePtr = valuePtr->stylePtr;
- }
- icon = stylePtr->icon;
- }
- if (tbPtr->textPtr != NULL) {
- Blt_Free(tbPtr->textPtr);
- tbPtr->textPtr = NULL;
- }
- if (tbPtr->string != NULL) {
- Blt_Free(tbPtr->string);
- }
- if (string == NULL) {
- string = "";
- }
- tbPtr->icon = icon;
- tbPtr->entryPtr = entryPtr;
- tbPtr->columnPtr = columnPtr;
- tbPtr->x = x - tbPtr->borderWidth;
- tbPtr->y = y - tbPtr->borderWidth;
-
- tbPtr->gap = stylePtr->gap;
- tbPtr->string = Blt_AssertStrdup(string);
- tbPtr->gc = Blt_TreeView_GetStyleGC(stylePtr);
- tbPtr->font = Blt_TreeView_GetStyleFont(viewPtr, stylePtr);
- tbPtr->selFirst = tbPtr->selLast = -1;
- UpdateLayout(tbPtr);
- Tk_MapWindow(tbPtr->tkwin);
- EventuallyRedraw(tbPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetIndexFromObj --
- *
- * Parse an index into an entry and return either its value
- * or an error.
- *
- * Results:
- * A standard TCL result. If all went well, then *indexPtr is
- * filled in with the character index (into entryPtr) corresponding to
- * string. The index value is guaranteed to lie between 0 and
- * the number of characters in the string, inclusive. If an
- * error occurs then an error message is left in the interp's result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetIndexFromObj(Tcl_Interp *interp, Textbox *tbPtr, Tcl_Obj *objPtr,
- int *indexPtr)
-{
- int textPos;
- char c;
- char *string;
-
- string = Tcl_GetString(objPtr);
- if ((tbPtr->string == NULL) || (tbPtr->string[0] == '\0')) {
- *indexPtr = 0;
- return TCL_OK;
- }
- c = string[0];
- if ((c == 'a') && (strcmp(string, "anchor") == 0)) {
- textPos = tbPtr->selAnchor;
- } else if ((c == 'e') && (strcmp(string, "end") == 0)) {
- textPos = strlen(tbPtr->string);
- } else if ((c == 'i') && (strcmp(string, "insert") == 0)) {
- textPos = tbPtr->insertPos;
- } else if ((c == 'n') && (strcmp(string, "next") == 0)) {
- textPos = tbPtr->insertPos;
- if (textPos < (int)strlen(tbPtr->string)) {
- textPos++;
- }
- } else if ((c == 'l') && (strcmp(string, "last") == 0)) {
- textPos = tbPtr->insertPos;
- if (textPos > 0) {
- textPos--;
- }
- } else if ((c == 's') && (strcmp(string, "sel.first") == 0)) {
- if (tbPtr->selFirst < 0) {
- textPos = -1;
- } else {
- textPos = tbPtr->selFirst;
- }
- } else if ((c == 's') && (strcmp(string, "sel.last") == 0)) {
- if (tbPtr->selLast < 0) {
- textPos = -1;
- } else {
- textPos = tbPtr->selLast;
- }
- } else if (c == '@') {
- int x, y;
-
- if (Blt_GetXY(interp, tbPtr->tkwin, string, &x, &y) != TCL_OK) {
- return TCL_ERROR;
- }
- textPos = PointerToIndex(tbPtr, x, y);
- } else if (isdigit((int)c)) {
- int number;
- int maxChars;
-
- if (Tcl_GetIntFromObj(interp, objPtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Don't allow the index to point outside the label. */
- maxChars = Tcl_NumUtfChars(tbPtr->string, -1);
- if (number < 0) {
- textPos = 0;
- } else if (number > maxChars) {
- textPos = strlen(tbPtr->string);
- } else {
- textPos = Tcl_UtfAtIndex(tbPtr->string, number) - tbPtr->string;
- }
- } else {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "bad label index \"", string, "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- *indexPtr = textPos;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectText --
- *
- * Modify the selection by moving its un-anchored end. This
- * could make the selection either larger or smaller.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The selection changes.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SelectText(Textbox *tbPtr, int textPos)
-{
- int selFirst, selLast;
-
- /*
- * Grab the selection if we don't own it already.
- */
- if ((tbPtr->exportSelection) && (tbPtr->selFirst == -1)) {
- Tk_OwnSelection(tbPtr->tkwin, XA_PRIMARY,
- TextboxLostSelectionProc, tbPtr);
- }
- /* If the anchor hasn't been set yet, assume the beginning of the text*/
- if (tbPtr->selAnchor < 0) {
- tbPtr->selAnchor = 0;
- }
- if (tbPtr->selAnchor <= textPos) {
- selFirst = tbPtr->selAnchor;
- selLast = textPos;
- } else {
- selFirst = textPos;
- selLast = tbPtr->selAnchor;
- }
- if ((tbPtr->selFirst != selFirst) || (tbPtr->selLast != selLast)) {
- tbPtr->selFirst = selFirst;
- tbPtr->selLast = selLast;
- EventuallyRedraw(tbPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextboxSelectionProc --
- *
- * This procedure is called back by Tk when the selection is
- * requested by someone. It returns part or all of the selection
- * in a buffer provided by the caller.
- *
- * Results:
- * The return value is the number of non-NULL bytes stored at
- * buffer. Buffer is filled (or partially filled) with a
- * NUL-terminated string containing part or all of the
- * selection, as given by offset and maxBytes.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-TextboxSelectionProc(
- ClientData clientData, /* Information about the widget. */
- int offset, /* Offset within selection of first
- * character to be returned. */
- char *buffer, /* Location in which to place
- * selection. */
- int maxBytes) /* Maximum number of bytes to place
- * at buffer, not including terminating
- * NULL character. */
-{
- Textbox *tbPtr = clientData;
- int size;
-
- size = (int)strlen(tbPtr->string + offset);
- /*
- * Return the string currently in the textbox.
- */
- strncpy(buffer, tbPtr->string + offset, maxBytes);
- buffer[maxBytes] = '\0';
- return (size > maxBytes) ? maxBytes : size;
-}
-
-
-static void
-DestroyTextbox(DestroyData data)
-{
- Textbox *tbPtr = (Textbox *)data;
-
- Blt_FreeOptions(textboxConfigSpecs, (char *)tbPtr,
- tbPtr->display, 0);
-
- if (tbPtr->string != NULL) {
- Blt_Free(tbPtr->string);
- }
- if (tbPtr->textPtr != NULL) {
- Blt_Free(tbPtr->textPtr);
- }
- if (tbPtr->timerToken != NULL) {
- Tcl_DeleteTimerHandler(tbPtr->timerToken);
- }
- if (tbPtr->tkwin != NULL) {
- Tk_DeleteSelHandler(tbPtr->tkwin, XA_PRIMARY, XA_STRING);
- }
- Blt_Free(tbPtr);
-}
-
-static void
-ConfigureTextbox(Textbox *tbPtr)
-{
-#ifdef notdef
- GC newGC;
- Textbox *tbPtr = viewPtr->tbPtr;
- XGCValues gcValues;
- unsigned long gcMask;
-
- /*
- * GC for edit window.
- */
- gcMask = 0;
- newGC = Tk_GetGC(tbPtr->tkwin, gcMask, &gcValues);
- if (tbPtr->gc != NULL) {
- Tk_FreeGC(tbPtr->display, tbPtr->gc);
- }
- tbPtr->gc = newGC;
- tbPtr->width = tbPtr->textPtr->width +
- 2 * (tbPtr->borderWidth + tbPtr->highlightWidth);
- tbPtr->height = tbPtr->textPtr->height +
- 2 * (tbPtr->borderWidth + tbPtr->highlightWidth);
-
- if (Tk_IsMapped(tbPtr->tkwin)) {
- if ((tbPtr->height != Tk_Height(tbPtr->tkwin)) ||
- (tbPtr->width != Tk_Width(tbPtr->tkwin))) {
- Tk_ResizeWindow(tbPtr->tkwin, tbPtr->width, tbPtr->height);
- }
- }
-#endif
-}
-
-int
-Blt_TreeView_CreateTextbox(TreeView *viewPtr, TreeViewEntry *entryPtr,
- TreeViewColumn *columnPtr)
-{
- Tk_Window tkwin;
- Textbox *tbPtr;
-
- if (viewPtr->comboWin != NULL) {
- Tk_DestroyWindow(viewPtr->comboWin);
- }
- tkwin = Tk_CreateWindow(viewPtr->interp, viewPtr->tkwin, "edit",
- (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
-
- Tk_MakeWindowExist(tkwin);
-
- Tk_SetClass(tkwin, "TreeViewEditor");
-
- tbPtr = Blt_AssertCalloc(1, sizeof(Textbox));
-
- tbPtr->interp = viewPtr->interp;
- tbPtr->display = Tk_Display(tkwin);
- tbPtr->tkwin = tkwin;
- tbPtr->borderWidth = 1;
- tbPtr->relief = TK_RELIEF_SOLID;
- tbPtr->selRelief = TK_RELIEF_FLAT;
- tbPtr->selBW = 1;
- tbPtr->selAnchor = -1;
- tbPtr->selFirst = tbPtr->selLast = -1;
- tbPtr->onTime = 600;
- tbPtr->active = TRUE;
- tbPtr->offTime = 300;
- tbPtr->viewPtr = viewPtr;
- tbPtr->buttonRelief = TK_RELIEF_SUNKEN;
- tbPtr->buttonBW = 1;
- viewPtr->comboWin = tkwin;
- Blt_SetWindowInstanceData(tkwin, tbPtr);
- Tk_CreateSelHandler(tkwin, XA_PRIMARY, XA_STRING,
- TextboxSelectionProc, tbPtr, XA_STRING);
- Tk_CreateEventHandler(tkwin, ExposureMask | StructureNotifyMask |
- FocusChangeMask, TextboxEventProc, tbPtr);
- Tcl_CreateObjCommand(viewPtr->interp, Tk_PathName(tkwin),
- TextboxCmd, tbPtr, NULL);
- if (Blt_ConfigureWidgetFromObj(viewPtr->interp, tkwin, textboxConfigSpecs, 0,
- (Tcl_Obj **)NULL, (char *)tbPtr, 0) != TCL_OK) {
- Tk_DestroyWindow(tkwin);
- return TCL_ERROR;
- }
- AcquireText(viewPtr, tbPtr, entryPtr, columnPtr);
- tbPtr->insertPos = strlen(tbPtr->string);
-
- Tk_MoveResizeWindow(tkwin, tbPtr->x, tbPtr->y, tbPtr->width, tbPtr->height);
- Tk_MapWindow(tkwin);
- Tk_MakeWindowExist(tkwin);
- XRaiseWindow(tbPtr->display, Tk_WindowId(tkwin));
- EventuallyRedraw(tbPtr);
- return TCL_OK;
-}
-
-static void
-DisplayTextbox(ClientData clientData)
-{
- Textbox *tbPtr = clientData;
- Pixmap drawable;
- int i;
- int x1, x2;
- int count, nChars;
- int selStart, selEnd, selLength;
- int x, y;
- TextFragment *fragPtr;
- Blt_FontMetrics fontMetrics;
-#ifdef notdef
- int buttonX, buttonY, buttonWidth, buttonHeight;
-#endif
- tbPtr->flags &= ~TEXTBOX_REDRAW;
- if (!Tk_IsMapped(tbPtr->tkwin)) {
- return;
- }
- if (tbPtr->columnPtr == NULL) {
- return;
- }
- drawable = Tk_GetPixmap(tbPtr->display, Tk_WindowId(tbPtr->tkwin),
- Tk_Width(tbPtr->tkwin), Tk_Height(tbPtr->tkwin),
- Tk_Depth(tbPtr->tkwin));
-
- Blt_Fill3DRectangle(tbPtr->tkwin, drawable, tbPtr->border, 0, 0,
- Tk_Width(tbPtr->tkwin), Tk_Height(tbPtr->tkwin),
- tbPtr->borderWidth, tbPtr->relief);
-
- x = tbPtr->borderWidth + tbPtr->gap;
- y = tbPtr->borderWidth;
-
-#ifdef notdef
- buttonX = Tk_Width(tbPtr->tkwin) -
- (tbPtr->borderWidth + tbPtr->gap + 1);
- buttonY = tbPtr->borderWidth + 1;
-#endif
-
- if (tbPtr->icon != NULL) {
- y += (tbPtr->height - TreeView_IconHeight(tbPtr->icon)) / 2;
- Tk_RedrawImage(TreeView_IconBits(tbPtr->icon), 0, 0,
- TreeView_IconWidth(tbPtr->icon),
- TreeView_IconHeight(tbPtr->icon),
- drawable, x, y);
- x += TreeView_IconWidth(tbPtr->icon) + tbPtr->gap;
- }
-
- Blt_GetFontMetrics(tbPtr->font, &fontMetrics);
- fragPtr = tbPtr->textPtr->fragments;
- count = 0;
- y = tbPtr->borderWidth;
- if (tbPtr->height > fontMetrics.linespace) {
- y += (tbPtr->height - fontMetrics.linespace) / 2;
- }
- for (i = 0; i < tbPtr->textPtr->nFrags; i++, fragPtr++) {
- int leftPos, rightPos;
-
- leftPos = count;
- count += fragPtr->count;
- rightPos = count;
- if ((rightPos < tbPtr->selFirst) || (leftPos > tbPtr->selLast)) {
- /* No part of the text fragment is selected. */
- Blt_DrawChars(Tk_Display(tbPtr->tkwin), drawable, tbPtr->gc,
- tbPtr->font, Tk_Depth(tbPtr->tkwin), 0.0f, fragPtr->text,
- fragPtr->count, x + fragPtr->x, y + fragPtr->y);
- continue;
- }
-
- /*
- * A text fragment can have up to 3 regions:
- *
- * 1. Text before the start the selection
- * 2. Selected text itself (drawn in a raised border)
- * 3. Text following the selection.
- */
-
- selStart = leftPos;
- selEnd = rightPos;
- /* First adjust selected region for current line. */
- if (tbPtr->selFirst > leftPos) {
- selStart = tbPtr->selFirst;
- }
- if (tbPtr->selLast < rightPos) {
- selEnd = tbPtr->selLast;
- }
- selLength = (selEnd - selStart);
- x1 = x;
-
- if (selStart > leftPos) { /* Normal text preceding the selection */
- nChars = (selStart - leftPos);
- Blt_MeasureChars(tbPtr->font, tbPtr->string + leftPos,
- nChars, 10000, DEF_TEXT_FLAGS, &x1);
- x1 += x;
- }
- if (selLength > 0) { /* The selection itself */
- int width;
-
- Blt_MeasureChars(tbPtr->font, fragPtr->text + selStart, selLength,
- 10000, DEF_TEXT_FLAGS, &x2);
- x2 += x;
- width = (x2 - x1) + 1;
- Blt_Fill3DRectangle(tbPtr->tkwin, drawable, tbPtr->selBorder,
- x1, y + fragPtr->y - fontMetrics.ascent,
- width, fontMetrics.linespace,
- tbPtr->selBW, tbPtr->selRelief);
- }
- Blt_DrawChars(Tk_Display(tbPtr->tkwin), drawable, tbPtr->gc,
- tbPtr->font, Tk_Depth(tbPtr->tkwin), 0.0f, fragPtr->text,
- fragPtr->count, fragPtr->x + x, fragPtr->y + y);
- }
- if ((tbPtr->flags & TEXTBOX_FOCUS) && (tbPtr->cursorOn)) {
- int left, top, right, bottom;
-
- IndexToPointer(tbPtr);
- left = tbPtr->cursorX + 1;
- right = left + 1;
- top = tbPtr->cursorY;
- if (tbPtr->height > fontMetrics.linespace) {
- top += (tbPtr->height - fontMetrics.linespace) / 2;
- }
- bottom = top + tbPtr->cursorHeight - 1;
- XDrawLine(tbPtr->display, drawable, tbPtr->gc, left, top, left,
- bottom);
- XDrawLine(tbPtr->display, drawable, tbPtr->gc, left - 1, top, right,
- top);
- XDrawLine(tbPtr->display, drawable, tbPtr->gc, left - 1, bottom,
- right, bottom);
- }
- Blt_Draw3DRectangle(tbPtr->tkwin, drawable, tbPtr->border, 0, 0,
- Tk_Width(tbPtr->tkwin), Tk_Height(tbPtr->tkwin),
- tbPtr->borderWidth, tbPtr->relief);
- XCopyArea(tbPtr->display, drawable, Tk_WindowId(tbPtr->tkwin),
- tbPtr->gc, 0, 0, Tk_Width(tbPtr->tkwin),
- Tk_Height(tbPtr->tkwin), 0, 0);
- Tk_FreePixmap(tbPtr->display, drawable);
-}
-
-/*ARGSUSED*/
-static int
-ApplyOp(Textbox *tbPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TreeViewEntry *entryPtr;
- TreeView *viewPtr = tbPtr->viewPtr;
- TreeViewColumn *columnPtr;
- int valid;
- TreeViewStyle *stylePtr;
- char *newValue;
-
- entryPtr = tbPtr->entryPtr;
- valid = TRUE;
- newValue = tbPtr->string;
-
- columnPtr = tbPtr->columnPtr;
- stylePtr = NULL;
- if (columnPtr != &viewPtr->treeColumn) {
- TreeViewValue *valuePtr;
-
- valuePtr = Blt_TreeView_FindValue(tbPtr->entryPtr, columnPtr);
- if (valuePtr != NULL) {
- stylePtr = valuePtr->stylePtr;
- }
- }
- if (stylePtr == NULL) {
- stylePtr = columnPtr->stylePtr;
- }
- if (stylePtr->validateCmd != NULL) {
- Tcl_DString dString;
- int result;
-
- Blt_TreeView_PercentSubst(viewPtr, entryPtr, stylePtr->validateCmd, &dString);
- Tcl_DStringAppend(&dString, " ", -1);
- Tcl_DStringAppend(&dString, tbPtr->string, -1);
- result = Tcl_GlobalEval(interp, Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- if (result == TCL_OK) {
- newValue = Tcl_GetString(Tcl_GetObjResult(interp));
- } else {
- valid = FALSE;
- }
- }
- if (valid) {
- if (columnPtr == &viewPtr->treeColumn) {
- if (entryPtr->labelUid != NULL) {
- Blt_TreeView_FreeUid(viewPtr, entryPtr->labelUid);
- }
- if (newValue == NULL) {
- entryPtr->labelUid = Blt_TreeView_GetUid(viewPtr, "");
- } else {
- entryPtr->labelUid = Blt_TreeView_GetUid(viewPtr, newValue);
- }
- } else {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(newValue, -1);
- if (Blt_Tree_SetValueByKey(interp, viewPtr->tree, entryPtr->node,
- columnPtr->key, objPtr) != TCL_OK) {
- Tcl_DecrRefCount(objPtr);
- return TCL_ERROR;
- }
- entryPtr->flags |= ENTRY_DIRTY;
- }
- }
- if (viewPtr != NULL) {
- Blt_TreeView_ConfigureEntry(viewPtr, entryPtr, 0, NULL, BLT_CONFIG_OBJV_ONLY);
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- }
- Tk_DestroyWindow(tbPtr->tkwin);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-CancelOp(Textbox *tbPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tk_DestroyWindow(tbPtr->tkwin);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CgetOp(Textbox *tbPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- return Blt_ConfigureValueFromObj(interp, tbPtr->tkwin,
- textboxConfigSpecs, (char *)tbPtr, objv[2], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * This procedure is called to process a list of configuration
- * options database, in order to reconfigure the one of more
- * entries in the widget.
- *
- * .c configure option value
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then
- * interp->result contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for viewPtr; old resources get freed, if there
- * were any. The hypertext is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(Textbox *tbPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (objc == 2) {
- return Blt_ConfigureInfoFromObj(interp, tbPtr->tkwin,
- textboxConfigSpecs, (char *)tbPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, tbPtr->tkwin,
- textboxConfigSpecs, (char *)tbPtr, objv[3], 0);
- }
- if (Blt_ConfigureWidgetFromObj(interp, tbPtr->tkwin,
- textboxConfigSpecs, objc - 2, objv + 2, (char *)tbPtr,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- ConfigureTextbox(tbPtr);
- EventuallyRedraw(tbPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Remove one or more characters from the label of an entry.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Memory gets freed, the entry gets modified and (eventually)
- * redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DeleteOp(Textbox *tbPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int firstPos, lastPos;
-
- if (tbPtr->entryPtr == NULL) {
- return TCL_OK;
- }
- if (GetIndexFromObj(interp, tbPtr, objv[2], &firstPos) != TCL_OK) {
- return TCL_ERROR;
- }
- lastPos = firstPos;
- if ((objc == 4) &&
- (GetIndexFromObj(interp, tbPtr, objv[3], &lastPos) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (firstPos > lastPos) {
- return TCL_OK;
- }
- return DeleteText(tbPtr, firstPos, lastPos);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * IcursorOp --
- *
- * Returns the numeric index of the given string. Indices can be
- * one of the following:
- *
- * "anchor" Selection anchor.
- * "end" End of the label.
- * "insert" Insertion cursor.
- * "sel.first" First character selected.
- * "sel.last" Last character selected.
- * @x,y Index at X-Y screen coordinate.
- * number Returns the same number.
- *
- * Results:
- * A standard TCL result. If the argument does not represent a
- * valid label index, then TCL_ERROR is returned and the interpreter
- * result will contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IcursorOp(Textbox *tbPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int textPos;
-
- if (GetIndexFromObj(interp, tbPtr, objv[2], &textPos) != TCL_OK) {
- return TCL_ERROR;
- }
- if (tbPtr->columnPtr != NULL) {
- tbPtr->insertPos = textPos;
- IndexToPointer(tbPtr);
- EventuallyRedraw(tbPtr);
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- * Returns the numeric index of the given string. Indices can be
- * one of the following:
- *
- * "anchor" Selection anchor.
- * "end" End of the label.
- * "insert" Insertion cursor.
- * "sel.first" First character selected.
- * "sel.last" Last character selected.
- * @x,y Index at X-Y screen coordinate.
- * number Returns the same number.
- *
- * Results:
- * A standard TCL result. If the argument does not represent a
- * valid label index, then TCL_ERROR is returned and the interpreter
- * result will contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-IndexOp(Textbox *tbPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int textPos;
-
- if (GetIndexFromObj(interp, tbPtr, objv[2], &textPos) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((tbPtr->columnPtr != NULL) && (tbPtr->string != NULL)) {
- int nChars;
-
- nChars = Tcl_NumUtfChars(tbPtr->string, textPos);
- Tcl_SetIntObj(Tcl_GetObjResult(interp), nChars);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InsertOp --
- *
- * Add new characters to the label of an entry.
- *
- * Results:
- * None.
- *
- * Side effects:
- * New information gets added to tbPtr; it will be redisplayed
- * soon, but not necessarily immediately.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InsertOp(Textbox *tbPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int extra;
- int insertPos;
- char *string;
-
- if (tbPtr->entryPtr == NULL) {
- return TCL_ERROR;
- }
- if (GetIndexFromObj(interp, tbPtr, objv[2], &insertPos) != TCL_OK) {
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[3], &extra);
- if (extra == 0) { /* Nothing to insert. Move the cursor anyways. */
- tbPtr->insertPos = insertPos;
- } else {
- InsertText(tbPtr, string, insertPos, extra);
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-SelectionAdjustOp(Textbox *tbPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int textPos;
- int half1, half2;
-
- if (GetIndexFromObj(interp, tbPtr, objv[3], &textPos) != TCL_OK) {
- return TCL_ERROR;
- }
- half1 = (tbPtr->selFirst + tbPtr->selLast) / 2;
- half2 = (tbPtr->selFirst + tbPtr->selLast + 1) / 2;
- if (textPos < half1) {
- tbPtr->selAnchor = tbPtr->selLast;
- } else if (textPos > half2) {
- tbPtr->selAnchor = tbPtr->selFirst;
- }
- return SelectText(tbPtr, textPos);
-}
-
-/*ARGSUSED*/
-static int
-SelectionClearOp(Textbox *tbPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- if (tbPtr->selFirst != -1) {
- tbPtr->selFirst = tbPtr->selLast = -1;
- EventuallyRedraw(tbPtr);
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-SelectionFromOp(Textbox *tbPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int textPos;
-
- if (GetIndexFromObj(interp, tbPtr, objv[3], &textPos) != TCL_OK) {
- return TCL_ERROR;
- }
- tbPtr->selAnchor = textPos;
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-SelectionPresentOp(Textbox *tbPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), (tbPtr->selFirst != -1));
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-SelectionRangeOp(Textbox *tbPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int selFirst, selLast;
-
- if (GetIndexFromObj(interp, tbPtr, objv[3], &selFirst) != TCL_OK) {
- return TCL_ERROR;
- }
- if (GetIndexFromObj(interp, tbPtr, objv[4], &selLast) != TCL_OK) {
- return TCL_ERROR;
- }
- tbPtr->selAnchor = selFirst;
- return SelectText(tbPtr, selLast);
-}
-
-/*ARGSUSED*/
-static int
-SelectionToOp(Textbox *tbPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- int textPos;
-
- if (GetIndexFromObj(interp, tbPtr, objv[3], &textPos) != TCL_OK) {
- return TCL_ERROR;
- }
- return SelectText(tbPtr, textPos);
-}
-
-
-static Blt_OpSpec selectionOps[] =
-{
- {"adjust", 1, SelectionAdjustOp, 4, 4, "index",},
- {"clear", 1, SelectionClearOp, 3, 3, "",},
- {"from", 1, SelectionFromOp, 4, 4, "index"},
- {"present", 1, SelectionPresentOp, 3, 3, ""},
- {"range", 1, SelectionRangeOp, 5, 5, "start end",},
- {"to", 1, SelectionToOp, 4, 4, "index"},
-};
-
-static int nSelectionOps = sizeof(selectionOps) / sizeof(Blt_OpSpec);
-
-/*
- * This procedure handles the individual options for text
- * selections. The selected text is designated by start and end
- * indices into the text pool. The selected segment has both a
- * anchored and unanchored ends. The following selection
- * operations are implemented:
- *
- * "adjust" - resets either the first or last index
- * of the selection.
- * "clear" - clears the selection. Sets first/last
- * indices to -1.
- * "from" - sets the index of the selection anchor.
- * "present" - return "1" if a selection is available,
- * "0" otherwise.
- * "range" - sets the first and last indices.
- * "to" - sets the index of the un-anchored end.
- */
-static int
-SelectionOp(Textbox *tbPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- TextboxCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nSelectionOps, selectionOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (tbPtr, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TextboxCmd --
- *
- * This procedure handles entry operations.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec comboOps[] =
-{
- {"apply", 1, ApplyOp, 2, 2, "",},
- {"cancel", 2, CancelOp, 2, 2, "",},
- {"cget", 2, CgetOp, 3, 3, "value",},
- {"configure", 2, ConfigureOp, 2, 0, "?option value...?",},
- {"delete", 1, DeleteOp, 3, 4, "first ?last?"},
- {"icursor", 2, IcursorOp, 3, 3, "index"},
- {"index", 3, IndexOp, 3, 3, "index"},
- {"insert", 3, InsertOp, 4, 4, "index string"},
- {"selection", 1, SelectionOp, 2, 0, "args"},
-};
-static int nComboOps = sizeof(comboOps) / sizeof(Blt_OpSpec);
-
-static int
-TextboxCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Textbox *tbPtr = clientData;
- TextboxCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nComboOps, comboOps, BLT_OP_ARG1, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (tbPtr, interp, objc, objv);
- return result;
-}
-
-#endif
-
diff --git a/blt3.0.1/src/bltTvStyle.c b/blt3.0.1/src/bltTvStyle.c
deleted file mode 100644
index 5956c75..0000000
--- a/blt3.0.1/src/bltTvStyle.c
+++ /dev/null
@@ -1,2684 +0,0 @@
-
-/*
- * bltTvStyle.c --
- *
- * This module implements styles for treeview widget cells.
- *
- * Copyright 1998-2008 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_TREEVIEW
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-#include "bltOp.h"
-#include "bltTreeView.h"
-#include "bltList.h"
-#include "bltPicture.h"
-#include "bltPainter.h"
-
-typedef int (TreeViewCmdProc)(TreeView *viewPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-
-#define STYLE_GAP 2
-#define ARROW_WIDTH 13
-
-static Blt_OptionParseProc ObjToIcon;
-static Blt_OptionPrintProc IconToObj;
-static Blt_OptionFreeProc FreeIcon;
-
-Blt_CustomOption bltTreeViewIconOption =
-{
- ObjToIcon, IconToObj, FreeIcon, NULL,
-};
-
-#define DEF_STYLE_HIGHLIGHT_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_STYLE_HIGHLIGHT_FOREGROUND STD_NORMAL_FOREGROUND
-#ifdef WIN32
-#define DEF_STYLE_ACTIVE_BACKGROUND RGB_GREY85
-#else
-#define DEF_STYLE_ACTIVE_BACKGROUND RGB_GREY95
-#endif
-#define DEF_STYLE_ACTIVE_FOREGROUND STD_ACTIVE_FOREGROUND
-#define DEF_STYLE_GAP "2"
-
-typedef struct {
- int refCount; /* Usage reference count. */
- unsigned int flags;
- const char *name;
- TreeViewStyleClass *classPtr; /* Class-specific routines to manage
- * style. */
- Blt_HashEntry *hashPtr;
- Blt_ChainLink link;
-
- /* General style fields. */
- Tk_Cursor cursor; /* X Cursor */
- TreeViewIcon icon; /* If non-NULL, is a Tk_Image to be
- * drawn in the cell. */
- int gap; /* # pixels gap between icon and
- * text. */
- Blt_Font font;
- XColor *fgColor; /* Normal foreground color of cell. */
- XColor *highlightFgColor; /* Foreground color of cell when
- * highlighted. */
- XColor *activeFgColor; /* Foreground color of cell when
- * active. */
- XColor *selFgColor; /* Foreground color of a selected
- * cell. If non-NULL, overrides default
- * foreground color specification. */
- Blt_Background bg; /* Normal background color of cell. */
- Blt_Background highlightBg; /* Background color of cell when
- * highlighted. */
- Blt_Background activeBg; /* Background color of cell when
- * active. */
- Blt_Background selBg; /* Background color of a selected
- * cell. If non-NULL, overrides the
- * default background color
- * specification. */
- const char *validateCmd;
-
- /* TextBox-specific fields */
- GC gc;
- GC highlightGC;
- GC activeGC;
- int side; /* Position of the text in relation to
- * the icon. */
- Blt_TreeKey key; /* Actual data resides in this tree
- value. */
- Tcl_Obj *cmdObjPtr;
-} TreeViewTextBox;
-
-#ifdef WIN32
-#define DEF_TEXTBOX_CURSOR "arrow"
-#else
-#define DEF_TEXTBOX_CURSOR "hand2"
-#endif /*WIN32*/
-#define DEF_TEXTBOX_SIDE "left"
-#define DEF_TEXTBOX_VALIDATE_COMMAND (char *)NULL
-#define DEF_TEXTBOX_COMMAND (char *)NULL
-
-#define TextBoxOffset(x) Blt_Offset(TreeViewTextBox, x)
-
-static Blt_ConfigSpec textBoxSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_STYLE_ACTIVE_BACKGROUND,
- TextBoxOffset(activeBg), 0},
- {BLT_CONFIG_SYNONYM, "-activebg", "activeBackground",
- (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-activefg", "activeFackground",
- (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "ActiveForeground", DEF_STYLE_ACTIVE_FOREGROUND,
- TextBoxOffset(activeFgColor), 0},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- (char *)NULL, TextBoxOffset(bg), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_OBJ, "-command", "command", "Command", DEF_TEXTBOX_COMMAND,
- TextBoxOffset(cmdObjPtr), 0},
- {BLT_CONFIG_CURSOR, "-cursor", "cursor", "Cursor", DEF_TEXTBOX_CURSOR,
- TextBoxOffset(cursor), 0},
- {BLT_CONFIG_BITMASK, "-edit", "edit", "Edit", (char *)NULL,
- TextBoxOffset(flags), BLT_CONFIG_DONT_SET_DEFAULT,
- (Blt_CustomOption *)STYLE_EDITABLE},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font", (char *)NULL,
- TextBoxOffset(font), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", (char *)NULL,
- TextBoxOffset(fgColor),BLT_CONFIG_NULL_OK },
- {BLT_CONFIG_PIXELS_NNEG, "-gap", "gap", "Gap", DEF_STYLE_GAP,
- TextBoxOffset(gap), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_STYLE_HIGHLIGHT_BACKGROUND,
- TextBoxOffset(highlightBg), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-highlightforeground", "highlightForeground",
- "HighlightForeground", DEF_STYLE_HIGHLIGHT_FOREGROUND,
- TextBoxOffset(highlightFgColor), 0},
- {BLT_CONFIG_SYNONYM, "-highlightbg", "highlightBackground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-highlightfg", "highlightForeground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_CUSTOM, "-icon", "icon", "Icon", (char *)NULL,
- TextBoxOffset(icon), BLT_CONFIG_NULL_OK, &bltTreeViewIconOption},
- {BLT_CONFIG_STRING, "-key", "key", "key", (char *)NULL,
- TextBoxOffset(key), BLT_CONFIG_NULL_OK, 0},
- {BLT_CONFIG_BACKGROUND, "-selectbackground", "selectBackground",
- "Foreground", (char *)NULL, TextBoxOffset(selBg), 0},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background",
- (char *)NULL, TextBoxOffset(selFgColor), 0},
- {BLT_CONFIG_SIDE, "-side", "side", "side", DEF_TEXTBOX_SIDE,
- TextBoxOffset(side), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_STRING, "-validatecommand", "validateCommand",
- "ValidateCommand", DEF_TEXTBOX_VALIDATE_COMMAND,
- TextBoxOffset(validateCmd), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0}
-};
-
-
-typedef struct {
- int refCount; /* Usage reference count. */
- unsigned int flags; /* Contains style type and update
- * flags. */
- const char *name; /* Instance name. */
- TreeViewStyleClass *classPtr; /* Class-specific routines to manage
- * style. */
- Blt_HashEntry *hashPtr;
- Blt_ChainLink link;
-
- /* General style fields. */
- Tk_Cursor cursor; /* X Cursor */
- TreeViewIcon icon; /* If non-NULL, is a Tk_Image to be
- * drawn in the cell. */
- int gap; /* # pixels gap between icon and
- * text. */
- Blt_Font font;
- XColor *fgColor; /* Normal foreground color of cell. */
- XColor *highlightFgColor; /* Foreground color of cell when
- * highlighted. */
- XColor *activeFgColor; /* Foreground color of cell when
- * active. */
- XColor *selFgColor; /* Foreground color of a selected
- * cell. If non-NULL, overrides
- * default foreground color
- * specification. */
-
- Blt_Background bg; /* Normal background color of cell. */
- Blt_Background highlightBg; /* Background color of cell when
- * highlighted. */
- Blt_Background activeBg; /* Background color of cell when
- * active. */
- Blt_Background selBg; /* Background color of a selected
- * cell. If non-NULL, overrides the
- * default background color
- * specification. */
- const char *validateCmd;
-
- /* Checkbox specific fields. */
- GC gc;
- GC highlightGC;
- GC activeGC;
- Blt_TreeKey key; /* Actual data resides in this tree
- value. */
- int size; /* Size of the checkbox. */
- int showValue; /* If non-zero, display the on/off
- * value. */
- const char *onValue;
- const char *offValue;
- int lineWidth; /* Linewidth of the surrounding
- * box. */
- XColor *boxColor; /* Rectangle (box) color (grey). */
- XColor *fillColor; /* Fill color (white) */
- XColor *checkColor; /* Check color (red). */
-
- TextLayout *onPtr, *offPtr;
-
- Blt_Painter painter;
- Blt_Picture selectedPicture;
- Blt_Picture normalPicture;
- Blt_Picture disabledPicture;
- Tcl_Obj *cmdObjPtr; /* If non-NULL, command to be invoked
- * when check is clicked. */
-} TreeViewCheckBox;
-
-#define DEF_CHECKBOX_BOX_COLOR (char *)NULL
-#define DEF_CHECKBOX_CHECK_COLOR "red"
-#define DEF_CHECKBOX_COMMAND (char *)NULL
-#define DEF_CHECKBOX_FILL_COLOR (char *)NULL
-#define DEF_CHECKBOX_OFFVALUE "0"
-#define DEF_CHECKBOX_ONVALUE "1"
-#define DEF_CHECKBOX_SHOWVALUE "yes"
-#define DEF_CHECKBOX_SIZE "11"
-#define DEF_CHECKBOX_LINEWIDTH "2"
-#define DEF_CHECKBOX_GAP "4"
-#ifdef WIN32
-#define DEF_CHECKBOX_CURSOR "arrow"
-#else
-#define DEF_CHECKBOX_CURSOR "hand2"
-#endif /*WIN32*/
-
-#define CheckBoxOffset(x) Blt_Offset(TreeViewCheckBox, x)
-
-static Blt_ConfigSpec checkBoxSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_STYLE_ACTIVE_BACKGROUND,
- CheckBoxOffset(activeBg), 0},
- {BLT_CONFIG_SYNONYM, "-activebg", "activeBackground",
- (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-activefg", "activeFackground",
- (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "ActiveForeground", DEF_STYLE_ACTIVE_FOREGROUND,
- CheckBoxOffset(activeFgColor), 0},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- (char *)NULL, CheckBoxOffset(bg), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_PIXELS_POS, "-boxsize", "boxSize", "BoxSize", DEF_CHECKBOX_SIZE,
- CheckBoxOffset(size), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_OBJ, "-command", "command", "Command", DEF_CHECKBOX_COMMAND,
- CheckBoxOffset(cmdObjPtr), 0},
- {BLT_CONFIG_CURSOR, "-cursor", "cursor", "Cursor", DEF_CHECKBOX_CURSOR,
- CheckBoxOffset(cursor), 0},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font", (char *)NULL,
- CheckBoxOffset(font), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", (char *)NULL,
- CheckBoxOffset(fgColor), BLT_CONFIG_NULL_OK },
- {BLT_CONFIG_PIXELS_NNEG, "-gap", "gap", "Gap", DEF_CHECKBOX_GAP,
- CheckBoxOffset(gap), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_STYLE_HIGHLIGHT_BACKGROUND,
- CheckBoxOffset(highlightBg), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-highlightforeground", "highlightForeground",
- "HighlightForeground", DEF_STYLE_HIGHLIGHT_FOREGROUND,
- CheckBoxOffset(highlightFgColor), 0},
- {BLT_CONFIG_SYNONYM, "-highlightbg", "highlightBackground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-highlightfg", "highlightForeground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_CUSTOM, "-icon", "icon", "Icon", (char *)NULL,
- CheckBoxOffset(icon), BLT_CONFIG_NULL_OK, &bltTreeViewIconOption},
- {BLT_CONFIG_STRING, "-key", "key", "key", (char *)NULL,
- CheckBoxOffset(key), BLT_CONFIG_NULL_OK, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-linewidth", "lineWidth", "LineWidth",
- DEF_CHECKBOX_LINEWIDTH, CheckBoxOffset(lineWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_COLOR, "-checkcolor", "checkColor", "CheckColor",
- DEF_CHECKBOX_CHECK_COLOR, CheckBoxOffset(checkColor), 0},
- {BLT_CONFIG_COLOR, "-boxcolor", "boxColor", "BoxColor",
- DEF_CHECKBOX_BOX_COLOR, CheckBoxOffset(boxColor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-fillcolor", "fillColor", "FillColor",
- DEF_CHECKBOX_FILL_COLOR, CheckBoxOffset(fillColor), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-offvalue", "offValue", "OffValue",
- DEF_CHECKBOX_OFFVALUE, CheckBoxOffset(offValue), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-onvalue", "onValue", "OnValue",
- DEF_CHECKBOX_ONVALUE, CheckBoxOffset(onValue), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-key", "key", "key", (char *)NULL, CheckBoxOffset(key),
- BLT_CONFIG_NULL_OK, 0},
- {BLT_CONFIG_BACKGROUND, "-selectbackground", "selectBackground",
- "Foreground", (char *)NULL, CheckBoxOffset(selBg), 0},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background",
- (char *)NULL, CheckBoxOffset(selFgColor), 0},
- {BLT_CONFIG_BOOLEAN, "-showvalue", "showValue", "ShowValue",
- DEF_CHECKBOX_SHOWVALUE, CheckBoxOffset(showValue),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-typedef struct {
- int refCount; /* Usage reference count. */
- unsigned int flags;
- const char *name;
- TreeViewStyleClass *classPtr; /* Class-specific style routines. */
- Blt_HashEntry *hashPtr;
- Blt_ChainLink link;
-
- /* General style fields. */
- Tk_Cursor cursor; /* X Cursor */
- TreeViewIcon icon; /* If non-NULL, is a Tk_Image to be
- * drawn in the cell. */
- int gap; /* # pixels gap between icon and
- * text. */
- Blt_Font font;
- XColor *fgColor; /* Normal foreground color of cell. */
- XColor *highlightFgColor; /* Foreground color of cell when
- * highlighted. */
- XColor *activeFgColor; /* Foreground color of cell when
- * active. */
- XColor *selFgColor; /* Foreground color of a selected
- * cell. If non-NULL, overrides
- * default foreground color
- * specification. */
- Blt_Background bg; /* Normal background color of cell. */
- Blt_Background highlightBg; /* Background color of cell when
- * highlighted. */
- Blt_Background activeBg; /* Background color of cell when
- * active. */
-
- Blt_Background selBg; /* Background color of a selected
- * cell. If non-NULL, overrides the
- * default background color
- * specification. */
- const char *validateCmd;
-
- /* ComboBox-specific fields */
- GC gc;
- GC highlightGC;
- GC activeGC;
-
- int borderWidth; /* Width of outer border surrounding
- * the entire box. */
- int relief; /* Relief of outer border. */
-
- Blt_TreeKey key; /* Actual data resides in this tree
- value. */
-
- const char *choices; /* List of available choices. */
- const char *choiceIcons; /* List of icons associated with
- * choices. */
- int scrollWidth;
- int arrow;
- int arrowWidth;
- int arrowBW; /* Border width of arrow. */
- int arrowRelief; /* Normal relief of arrow. */
-} TreeViewComboBox;
-
-#define DEF_COMBOBOX_BORDERWIDTH "1"
-#define DEF_COMBOBOX_ARROW_BORDERWIDTH "1"
-#define DEF_COMBOBOX_ARROW_RELIEF "raised"
-#define DEF_COMBOBOX_RELIEF "flat"
-#ifdef WIN32
-#define DEF_COMBOBOX_CURSOR "arrow"
-#else
-#define DEF_COMBOBOX_CURSOR "hand2"
-#endif /*WIN32*/
-
-
-#define ComboBoxOffset(x) Blt_Offset(TreeViewComboBox, x)
-
-static Blt_ConfigSpec comboBoxSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_STYLE_ACTIVE_BACKGROUND,
- ComboBoxOffset(activeBg), 0},
- {BLT_CONFIG_SYNONYM, "-activebg", "activeBackground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-activefg", "activeFackground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground",
- "ActiveForeground", DEF_STYLE_ACTIVE_FOREGROUND,
- ComboBoxOffset(activeFgColor), 0},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- (char *)NULL, ComboBoxOffset(bg), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL, (char *)NULL, 0,
- 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_COMBOBOX_BORDERWIDTH, ComboBoxOffset(borderWidth),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_RELIEF, "-arrowrelief", "arrowRelief", "ArrowRelief",
- DEF_COMBOBOX_ARROW_RELIEF, ComboBoxOffset(arrowRelief),
- BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_PIXELS_NNEG, "-arrowborderwidth", "arrowBorderWidth",
- "ArrowBorderWidth", DEF_COMBOBOX_ARROW_BORDERWIDTH,
- ComboBoxOffset(arrowBW), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_CURSOR, "-cursor", "cursor", "Cursor", DEF_COMBOBOX_CURSOR,
- ComboBoxOffset(cursor), 0},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL,
- 0, 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font", (char *)NULL,
- ComboBoxOffset(font), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- (char *)NULL, ComboBoxOffset(fgColor), BLT_CONFIG_NULL_OK },
- {BLT_CONFIG_PIXELS_NNEG, "-gap", "gap", "Gap", DEF_STYLE_GAP,
- ComboBoxOffset(gap), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_STYLE_HIGHLIGHT_BACKGROUND,
- ComboBoxOffset(highlightBg), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-highlightforeground", "highlightForeground",
- "HighlightForeground", DEF_STYLE_HIGHLIGHT_FOREGROUND,
- ComboBoxOffset(highlightFgColor), 0},
- {BLT_CONFIG_SYNONYM, "-highlightbg", "highlightBackground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-highlightfg", "highlightForeground", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_CUSTOM, "-icon", "icon", "Icon", (char *)NULL,
- ComboBoxOffset(icon), BLT_CONFIG_NULL_OK, &bltTreeViewIconOption},
- {BLT_CONFIG_STRING, "-key", "key", "key", (char *)NULL, ComboBoxOffset(key),
- BLT_CONFIG_NULL_OK, 0},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_COMBOBOX_RELIEF,
- ComboBoxOffset(relief), BLT_CONFIG_DONT_SET_DEFAULT},
- {BLT_CONFIG_BACKGROUND, "-selectbackground", "selectBackground",
- "Foreground", (char *)NULL, ComboBoxOffset(selBg), 0},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background",
- (char *)NULL, ComboBoxOffset(selFgColor), 0},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-typedef TreeViewStyle *(StyleCreateProc)(TreeView *viewPtr,Blt_HashEntry *hPtr);
-
-static StyleConfigProc ConfigureTextBox, ConfigureCheckBox, ConfigureComboBox;
-static StyleCreateProc CreateTextBox, CreateCheckBox, CreateComboBox;
-static StyleDrawProc DrawTextBox, DrawCheckBox, DrawComboBox;
-static StyleEditProc EditTextBox, EditCheckBox, EditComboBox;
-static StyleFreeProc FreeTextBox, FreeCheckBox, FreeComboBox;
-static StyleMeasureProc MeasureTextBox, MeasureCheckBox, MeasureComboBox;
-#ifdef notdef
-static StylePickProc PickCheckBox;
-#endif
-static StylePickProc PickComboBox;
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToIcon --
- *
- * Convert the name of an icon into a Tk image.
- *
- * Results:
- * If the string is successfully converted, TCL_OK is returned.
- * Otherwise, TCL_ERROR is returned and an error message is left in
- * interpreter's result field.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToIcon(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to report results */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* Tcl_Obj representing the value. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- TreeView *viewPtr = clientData;
- TreeViewIcon *iconPtr = (TreeViewIcon *)(widgRec + offset);
- TreeViewIcon icon;
- const char *string;
- int length;
-
- string = Tcl_GetStringFromObj(objPtr, &length);
- icon = NULL;
- if (length > 0) {
- icon = Blt_TreeView_GetIcon(viewPtr, Tcl_GetString(objPtr));
- if (icon == NULL) {
- return TCL_ERROR;
- }
- }
- if (*iconPtr != NULL) {
- Blt_TreeView_FreeIcon(viewPtr, *iconPtr);
- }
- *iconPtr = icon;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * IconToObj --
- *
- * Converts the icon into its string representation (its name).
- *
- * Results:
- * The name of the icon is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-IconToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec,
- int offset, /* Offset to field in structure */
- int flags)
-{
- TreeViewIcon icon = *(TreeViewIcon *)(widgRec + offset);
-
- if (icon == NULL) {
- return Tcl_NewStringObj("", -1);
- } else {
- return Tcl_NewStringObj(Blt_Image_Name((icon)->tkImage), -1);
- }
-}
-
-/*ARGSUSED*/
-static void
-FreeIcon(
- ClientData clientData,
- Display *display, /* Not used. */
- char *widgRec,
- int offset)
-{
- TreeViewIcon *iconPtr = (TreeViewIcon *)(widgRec + offset);
- TreeView *viewPtr = clientData;
-
- if (*iconPtr != NULL) {
- Blt_TreeView_FreeIcon(viewPtr, *iconPtr);
- *iconPtr = NULL;
- }
-}
-
-static TreeViewStyleClass textBoxClass = {
- "TextBoxStyle",
- textBoxSpecs,
- ConfigureTextBox,
- MeasureTextBox,
- DrawTextBox,
- NULL,
- EditTextBox,
- FreeTextBox,
-};
-
-static TreeViewStyleClass checkBoxClass = {
- "CheckBoxStyle",
- checkBoxSpecs,
- ConfigureCheckBox,
- MeasureCheckBox,
- DrawCheckBox,
- NULL,
- EditCheckBox,
- FreeCheckBox,
-};
-
-static TreeViewStyleClass comboBoxClass = {
- "ComboBoxStyle",
- comboBoxSpecs,
- ConfigureComboBox,
- MeasureComboBox,
- DrawComboBox,
- NULL,
- EditComboBox,
- FreeComboBox,
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateTextBox --
- *
- * Creates a "textbox" style.
- *
- * Results:
- * A pointer to the new style structure.
- *
- *---------------------------------------------------------------------------
- */
-static TreeViewStyle *
-CreateTextBox(TreeView *viewPtr, Blt_HashEntry *hPtr)
-{
- TreeViewTextBox *tbPtr;
-
- tbPtr = Blt_AssertCalloc(1, sizeof(TreeViewTextBox));
- tbPtr->classPtr = &textBoxClass;
- tbPtr->side = SIDE_LEFT;
- tbPtr->gap = STYLE_GAP;
- tbPtr->name = Blt_AssertStrdup(Blt_GetHashKey(&viewPtr->styleTable, hPtr));
- tbPtr->hashPtr = hPtr;
- tbPtr->link = NULL;
- tbPtr->flags = STYLE_TEXTBOX;
- tbPtr->refCount = 1;
- Blt_SetHashValue(hPtr, tbPtr);
- return (TreeViewStyle *)tbPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureTextBox --
- *
- * Configures a "textbox" style. This routine performs generates the GCs
- * required for a textbox style.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * GCs are created for the style.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ConfigureTextBox(TreeView *viewPtr, TreeViewStyle *stylePtr)
-{
- TreeViewTextBox *tbPtr = (TreeViewTextBox *)stylePtr;
- GC newGC;
- XGCValues gcValues;
- unsigned long gcMask;
-
- gcMask = GCForeground | GCFont;
- gcValues.font = Blt_FontId(CHOOSE(viewPtr->font, tbPtr->font));
-
- /* Normal GC */
- gcValues.foreground = CHOOSE(viewPtr->fgColor, tbPtr->fgColor)->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (tbPtr->gc != NULL) {
- Tk_FreeGC(viewPtr->display, tbPtr->gc);
- }
- tbPtr->gc = newGC;
-
- /* Highlight GC */
- gcValues.foreground = tbPtr->highlightFgColor->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (tbPtr->highlightGC != NULL) {
- Tk_FreeGC(viewPtr->display, tbPtr->highlightGC);
- }
- tbPtr->highlightGC = newGC;
-
- /* Active GC */
- gcValues.foreground = tbPtr->activeFgColor->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (tbPtr->activeGC != NULL) {
- Tk_FreeGC(viewPtr->display, tbPtr->activeGC);
- }
- tbPtr->activeGC = newGC;
- tbPtr->flags |= STYLE_DIRTY;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MeasureTextBox --
- *
- * Determines the space requirements for the "textbox" given the value to
- * be displayed. Depending upon whether an icon or text is displayed and
- * their relative placements, this routine computes the space needed for
- * the text entry.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The width and height fields of *valuePtr* are set with the computed
- * dimensions.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MeasureTextBox(
- TreeView *viewPtr,
- TreeViewStyle *stylePtr,
- TreeViewValue *valuePtr)
-{
- TreeViewTextBox *tbPtr = (TreeViewTextBox *)stylePtr;
- int iconWidth, iconHeight;
- int textWidth, textHeight;
- int gap;
-
- textWidth = textHeight = 0;
- iconWidth = iconHeight = 0;
- valuePtr->width = valuePtr->height = 0;
-
- if (tbPtr->icon != NULL) {
- iconWidth = TreeView_IconWidth(tbPtr->icon);
- iconHeight = TreeView_IconHeight(tbPtr->icon);
- }
- if (valuePtr->textPtr != NULL) {
- Blt_Free(valuePtr->textPtr);
- valuePtr->textPtr = NULL;
- }
- if (valuePtr->fmtString != NULL) { /* New string defined. */
- TextStyle ts;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, CHOOSE(viewPtr->font, tbPtr->font));
- valuePtr->textPtr = Blt_Ts_CreateLayout(valuePtr->fmtString, -1, &ts);
- }
- gap = 0;
- if (valuePtr->textPtr != NULL) {
- textWidth = valuePtr->textPtr->width;
- textHeight = valuePtr->textPtr->height;
- if (tbPtr->icon != NULL) {
- gap = tbPtr->gap;
- }
- }
- if (tbPtr->side & (SIDE_TOP | SIDE_BOTTOM)) {
- valuePtr->width = MAX(textWidth, iconWidth);
- valuePtr->height = iconHeight + gap + textHeight;
- } else {
- valuePtr->width = iconWidth + gap + textWidth;
- valuePtr->height = MAX(textHeight, iconHeight);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawTextBox --
- *
- * Draws the "textbox" given the screen coordinates and the value to be
- * displayed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The textbox value is drawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawTextBox(TreeView *viewPtr, Drawable drawable, TreeViewEntry *entryPtr,
- TreeViewValue *valuePtr, TreeViewStyle *stylePtr, int x, int y)
-{
- TreeViewColumn *colPtr;
- TreeViewTextBox *tbPtr = (TreeViewTextBox *)stylePtr;
- int iconX, iconY, iconWidth, iconHeight;
- int textX, textY, textWidth, textHeight;
- int gap, columnWidth;
- Blt_Background bg;
- XColor *fgColor;
-
- colPtr = valuePtr->columnPtr;
-
- if (stylePtr->flags & STYLE_HIGHLIGHT) {
- bg = tbPtr->highlightBg;
- fgColor = tbPtr->highlightFgColor;
- } else {
- if (tbPtr->bg != NULL) {
- bg = tbPtr->bg;
- } else {
- bg = ((viewPtr->altBg != NULL) && (entryPtr->flatIndex & 0x1))
- ? viewPtr->altBg : viewPtr->bg;
- }
- fgColor = CHOOSE(viewPtr->fgColor, tbPtr->fgColor);
- }
- if (Blt_TreeView_EntryIsSelected(viewPtr, entryPtr)) {
- bg = (stylePtr->selBg != NULL) ? stylePtr->selBg : viewPtr->selBg;
- }
- /*
- * Draw the active or normal background color over the entire label area.
- * This includes both the tab's text and image. The rectangle should be 2
- * pixels wider/taller than this area. So if the label consists of just an
- * image, we get an halo around the image when the tab is active.
- */
- if (bg != NULL) {
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, x, y,
- colPtr->width, entryPtr->height + 1, 0, TK_RELIEF_FLAT);
- }
-
- columnWidth = colPtr->width -
- (2 * colPtr->borderWidth + PADDING(colPtr->pad));
- if (columnWidth > valuePtr->width) {
- switch(colPtr->justify) {
- case TK_JUSTIFY_RIGHT:
- x += (columnWidth - valuePtr->width);
- break;
- case TK_JUSTIFY_CENTER:
- x += (columnWidth - valuePtr->width) / 2;
- break;
- case TK_JUSTIFY_LEFT:
- break;
- }
- }
-
- textX = textY = iconX = iconY = 0; /* Suppress compiler warning. */
-
- iconWidth = iconHeight = 0;
- if (tbPtr->icon != NULL) {
- iconWidth = TreeView_IconWidth(tbPtr->icon);
- iconHeight = TreeView_IconHeight(tbPtr->icon);
- }
- textWidth = textHeight = 0;
- if (valuePtr->textPtr != NULL) {
- textWidth = valuePtr->textPtr->width;
- textHeight = valuePtr->textPtr->height;
- }
- gap = 0;
- if ((tbPtr->icon != NULL) && (valuePtr->textPtr != NULL)) {
- gap = tbPtr->gap;
- }
- switch (tbPtr->side) {
- case SIDE_RIGHT:
- textX = x;
- textY = y + (entryPtr->height - textHeight) / 2;
- iconX = textX + textWidth + gap;
- iconY = y + (entryPtr->height - iconHeight) / 2;
- break;
- case SIDE_LEFT:
- iconX = x;
- iconY = y + (entryPtr->height - iconHeight) / 2;
- textX = iconX + iconWidth + gap;
- textY = y + (entryPtr->height - textHeight) / 2;
- break;
- case SIDE_TOP:
- iconY = y;
- iconX = x + (columnWidth - iconWidth) / 2;
- textY = iconY + iconHeight + gap;
- textX = x + (columnWidth - textWidth) / 2;
- break;
- case SIDE_BOTTOM:
- textY = y;
- textX = x + (columnWidth - textWidth) / 2;
- iconY = textY + textHeight + gap;
- iconX = x + (columnWidth - iconWidth) / 2;
- break;
- }
- if (tbPtr->icon != NULL) {
- Tk_RedrawImage(TreeView_IconBits(tbPtr->icon), 0, 0, iconWidth,
- iconHeight, drawable, iconX, iconY);
- }
- if (valuePtr->textPtr != NULL) {
- TextStyle ts;
- XColor *color;
- Blt_Font font;
- int xMax;
-
- font = CHOOSE(viewPtr->font, tbPtr->font);
- if (Blt_TreeView_EntryIsSelected(viewPtr, entryPtr)) {
- if (stylePtr->selFgColor != NULL) {
- color = stylePtr->selFgColor;
- } else {
- color = viewPtr->selFgColor;
- }
- } else if (entryPtr->color != NULL) {
- color = entryPtr->color;
- } else {
- color = fgColor;
- }
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, font);
- Blt_Ts_SetForeground(ts, color);
- xMax = colPtr->width - colPtr->titleBW - colPtr->pad.side2;
- Blt_Ts_SetMaxLength(ts, xMax);
- Blt_Ts_DrawLayout(viewPtr->tkwin, drawable, valuePtr->textPtr, &ts,
- textX, textY);
- }
- stylePtr->flags &= ~STYLE_DIRTY;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EditCombobox --
- *
- * Edits the "combobox".
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The checkbox value is drawn.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EditTextBox(TreeView *viewPtr, TreeViewEntry *entryPtr, TreeViewColumn *colPtr,
- TreeViewStyle *stylePtr)
-{
- return Blt_TreeView_CreateTextbox(viewPtr, entryPtr, colPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeTextBox --
- *
- * Releases resources allocated for the textbox. The resources freed by
- * this routine are specific only to the "textbox". Other resources
- * (common to all styles) are freed in the Blt_TreeView_FreeStyle
- * routine.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * GCs allocated for the textbox are freed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeTextBox(TreeView *viewPtr, TreeViewStyle *stylePtr)
-{
- TreeViewTextBox *tbPtr = (TreeViewTextBox *)stylePtr;
-
- if (tbPtr->highlightGC != NULL) {
- Tk_FreeGC(viewPtr->display, tbPtr->highlightGC);
- }
- if (tbPtr->activeGC != NULL) {
- Tk_FreeGC(viewPtr->display, tbPtr->activeGC);
- }
- if (tbPtr->gc != NULL) {
- Tk_FreeGC(viewPtr->display, tbPtr->gc);
- }
- if (tbPtr->icon != NULL) {
- Blt_TreeView_FreeIcon(viewPtr, tbPtr->icon);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateCheckbox --
- *
- * Creates a "checkbox" style.
- *
- * Results:
- * A pointer to the new style structure.
- *
- *---------------------------------------------------------------------------
- */
-static TreeViewStyle *
-CreateCheckBox(TreeView *viewPtr, Blt_HashEntry *hPtr)
-{
- TreeViewCheckBox *cbPtr;
-
- cbPtr = Blt_AssertCalloc(1, sizeof(TreeViewCheckBox));
- cbPtr->classPtr = &checkBoxClass;
- cbPtr->gap = 4;
- cbPtr->size = 18;
- cbPtr->lineWidth = 2;
- cbPtr->showValue = TRUE;
- cbPtr->name = Blt_AssertStrdup(Blt_GetHashKey(&viewPtr->styleTable, hPtr));
- cbPtr->hashPtr = hPtr;
- cbPtr->link = NULL;
- cbPtr->flags = STYLE_CHECKBOX;
- cbPtr->refCount = 1;
- Blt_SetHashValue(hPtr, cbPtr);
- return (TreeViewStyle *)cbPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureCheckbox --
- *
- * Configures a "checkbox" style. This routine performs generates the
- * GCs required for a checkbox style.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * GCs are created for the style.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ConfigureCheckBox(TreeView *viewPtr, TreeViewStyle *stylePtr)
-{
- GC newGC;
- TreeViewCheckBox *cbPtr = (TreeViewCheckBox *)stylePtr;
- XColor *bgColor;
- XGCValues gcValues;
- unsigned long gcMask;
-
- gcMask = GCForeground | GCBackground | GCFont;
- gcValues.font = Blt_FontId(CHOOSE(viewPtr->font, cbPtr->font));
- bgColor = Blt_BackgroundBorderColor(CHOOSE(viewPtr->bg, cbPtr->bg));
-
- gcValues.background = bgColor->pixel;
- gcValues.foreground = CHOOSE(viewPtr->fgColor, cbPtr->fgColor)->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (cbPtr->gc != NULL) {
- Tk_FreeGC(viewPtr->display, cbPtr->gc);
- }
- cbPtr->gc = newGC;
- gcValues.background = Blt_BackgroundBorderColor(cbPtr->highlightBg)->pixel;
- gcValues.foreground = cbPtr->highlightFgColor->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (cbPtr->highlightGC != NULL) {
- Tk_FreeGC(viewPtr->display, cbPtr->highlightGC);
- }
- cbPtr->highlightGC = newGC;
-
- gcValues.background = Blt_BackgroundBorderColor(cbPtr->activeBg)->pixel;
- gcValues.foreground = cbPtr->activeFgColor->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (cbPtr->activeGC != NULL) {
- Tk_FreeGC(viewPtr->display, cbPtr->activeGC);
- }
- cbPtr->activeGC = newGC;
-
- cbPtr->flags |= STYLE_DIRTY;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MeasureCheckbox --
- *
- * Determines the space requirements for the "checkbox" given the value
- * to be displayed. Depending upon whether an icon or text is displayed
- * and their relative placements, this routine computes the space needed
- * for the text entry.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The width and height fields of *valuePtr* are set with the
- * computed dimensions.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MeasureCheckBox(TreeView *viewPtr, TreeViewStyle *stylePtr,
- TreeViewValue *valuePtr)
-{
- TreeViewCheckBox *cbPtr = (TreeViewCheckBox *)stylePtr;
- int iconWidth, iconHeight;
- int textWidth, textHeight;
- int gap;
- int boxWidth, boxHeight;
-
- boxWidth = boxHeight = ODD(cbPtr->size);
-
- textWidth = textHeight = iconWidth = iconHeight = 0;
- valuePtr->width = valuePtr->height = 0;
- if (cbPtr->icon != NULL) {
- iconWidth = TreeView_IconWidth(cbPtr->icon);
- iconHeight = TreeView_IconHeight(cbPtr->icon);
- }
- if (cbPtr->onPtr != NULL) {
- Blt_Free(cbPtr->onPtr);
- cbPtr->onPtr = NULL;
- }
- if (cbPtr->offPtr != NULL) {
- Blt_Free(cbPtr->offPtr);
- cbPtr->offPtr = NULL;
- }
- gap = 0;
- if (cbPtr->showValue) {
- TextStyle ts;
- const char *string;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, CHOOSE(viewPtr->font, cbPtr->font));
- string = (cbPtr->onValue != NULL) ? cbPtr->onValue :
- valuePtr->fmtString;
- cbPtr->onPtr = Blt_Ts_CreateLayout(string, -1, &ts);
- string = (cbPtr->offValue != NULL) ? cbPtr->offValue :
- valuePtr->fmtString;
- cbPtr->offPtr = Blt_Ts_CreateLayout(string, -1, &ts);
- textWidth = MAX(cbPtr->offPtr->width, cbPtr->onPtr->width);
- textHeight = MAX(cbPtr->offPtr->height, cbPtr->onPtr->height);
- if (cbPtr->icon != NULL) {
- gap = cbPtr->gap;
- }
- }
- valuePtr->width = cbPtr->gap * 2 + boxWidth + iconWidth + gap + textWidth;
- valuePtr->height = MAX3(boxHeight, textHeight, iconHeight) | 0x1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawCheckbox --
- *
- * Draws the "checkbox" given the screen coordinates and the
- * value to be displayed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The checkbox value is drawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawCheckBox(TreeView *viewPtr, Drawable drawable, TreeViewEntry *entryPtr,
- TreeViewValue *valuePtr, TreeViewStyle *stylePtr, int x, int y)
-{
- Blt_Background bg;
- Blt_Font font;
- TextLayout *textPtr;
- TreeViewCheckBox *cbPtr = (TreeViewCheckBox *)stylePtr;
- TreeViewColumn *colPtr;
- XColor *fgColor;
- int bool;
- int borderWidth, relief;
- int gap, columnWidth;
- int iconX, iconY, iconWidth, iconHeight;
- int textX, textY, textHeight;
- int xBox, yBox, boxWidth, boxHeight;
-
- font = CHOOSE(viewPtr->font, cbPtr->font);
- colPtr = valuePtr->columnPtr;
- borderWidth = 0;
- relief = TK_RELIEF_FLAT;
- if (valuePtr == viewPtr->activeValuePtr) {
- bg = cbPtr->activeBg;
- fgColor = cbPtr->activeFgColor;
- borderWidth = 1;
- relief = TK_RELIEF_RAISED;
- } else if (stylePtr->flags & STYLE_HIGHLIGHT) {
- bg = cbPtr->highlightBg;
- fgColor = cbPtr->highlightFgColor;
- } else {
- /* If a background was specified, override the current background.
- * Otherwise, use the standard background taking into consideration if
- * its the odd or even color. */
- if (cbPtr->bg != NULL) {
- bg = cbPtr->bg;
- } else {
- bg = ((viewPtr->altBg != NULL) && (entryPtr->flatIndex & 0x1))
- ? viewPtr->altBg : viewPtr->bg;
- }
- fgColor = CHOOSE(viewPtr->fgColor, cbPtr->fgColor);
- }
- columnWidth = colPtr->width - PADDING(colPtr->pad);
-
- /*
- * Draw the active or normal background color over the entire label area.
- * This includes both the tab's text and image. The rectangle should be 2
- * pixels wider/taller than this area. So if the label consists of just an
- * image, we get an halo around the image when the tab is active.
- */
- if (Blt_TreeView_EntryIsSelected(viewPtr, entryPtr)) {
- bg = CHOOSE(viewPtr->selBg, stylePtr->selBg);
- }
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, x, y+1,
- columnWidth, entryPtr->height - 2, borderWidth, relief);
-
- if (columnWidth > valuePtr->width) {
- switch(colPtr->justify) {
- case TK_JUSTIFY_RIGHT:
- x += (columnWidth - valuePtr->width);
- break;
- case TK_JUSTIFY_CENTER:
- x += (columnWidth - valuePtr->width) / 2;
- break;
- case TK_JUSTIFY_LEFT:
- break;
- }
- }
-
- bool = (strcmp(valuePtr->fmtString, cbPtr->onValue) == 0);
- textPtr = (bool) ? cbPtr->onPtr : cbPtr->offPtr;
-
- /*
- * Draw the box and check.
- *
- * +-----------+
- * | |
- * | * |
- * | * |
- * | * * |
- * | * * |
- * | * * |
- * | * |
- * +-----------+
- */
- boxWidth = boxHeight = ODD(cbPtr->size);
- xBox = x + cbPtr->gap;
- yBox = y + (entryPtr->height - boxHeight) / 2;
- {
- Blt_Picture picture;
-
- if (0) {
- if (cbPtr->disabledPicture == NULL) {
- cbPtr->disabledPicture = Blt_PaintCheckbox(boxWidth, boxHeight,
- cbPtr->fillColor, cbPtr->boxColor, cbPtr->boxColor,
- bool);
- }
- picture = cbPtr->disabledPicture;
- } else if (bool) {
- if (cbPtr->selectedPicture == NULL) {
- cbPtr->selectedPicture = Blt_PaintCheckbox(boxWidth, boxHeight,
- cbPtr->fillColor, cbPtr->boxColor, cbPtr->checkColor,
- TRUE);
- }
- picture = cbPtr->selectedPicture;
- } else {
- if (cbPtr->normalPicture == NULL) {
- cbPtr->normalPicture = Blt_PaintCheckbox(boxWidth, boxHeight,
- cbPtr->fillColor, cbPtr->boxColor, cbPtr->checkColor,
- FALSE);
- }
- picture = cbPtr->normalPicture;
- }
- if (cbPtr->painter == NULL) {
- cbPtr->painter = Blt_GetPainter(viewPtr->tkwin, 1.0);
- }
- Blt_PaintPicture(cbPtr->painter, drawable, picture, 0, 0,
- boxWidth, boxHeight, xBox, yBox, 0);
- }
- iconWidth = iconHeight = 0;
- if (cbPtr->icon != NULL) {
- iconWidth = TreeView_IconWidth(cbPtr->icon);
- iconHeight = TreeView_IconHeight(cbPtr->icon);
- }
- textHeight = 0;
- gap = 0;
- if (cbPtr->showValue) {
- textHeight = textPtr->height;
- if (cbPtr->icon != NULL) {
- gap = cbPtr->gap;
- }
- }
- x = xBox + boxWidth + cbPtr->gap;
-
- /* The icon sits to the left of the text. */
- iconX = x;
- iconY = y + (entryPtr->height - iconHeight) / 2;
- textX = iconX + iconWidth + gap;
- textY = y + (entryPtr->height - textHeight) / 2;
- if (cbPtr->icon != NULL) {
- Tk_RedrawImage(TreeView_IconBits(cbPtr->icon), 0, 0, iconWidth,
- iconHeight, drawable, iconX, iconY);
- }
- if ((cbPtr->showValue) && (textPtr != NULL)) {
- TextStyle ts;
- XColor *color;
- int xMax;
-
- if (Blt_TreeView_EntryIsSelected(viewPtr, entryPtr)) {
- if (stylePtr->selFgColor != NULL) {
- color = stylePtr->selFgColor;
- } else {
- color = viewPtr->selFgColor;
- }
- } else if (entryPtr->color != NULL) {
- color = entryPtr->color;
- } else {
- color = fgColor;
- }
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, font);
- Blt_Ts_SetForeground(ts, color);
- Blt_Ts_SetMaxLength(ts, xMax - textX);
- xMax = SCREENX(viewPtr, colPtr->worldX) + colPtr->width -
- colPtr->titleBW - colPtr->pad.side2;
- Blt_Ts_DrawLayout(viewPtr->tkwin, drawable, textPtr, &ts, textX, textY);
- }
- stylePtr->flags &= ~STYLE_DIRTY;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * PickCheckbox --
- *
- * Draws the "checkbox" given the screen coordinates and the value to be
- * displayed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The checkbox value is drawn.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PickCheckBox(TreeViewEntry *entryPtr, TreeViewValue *valuePtr,
- TreeViewStyle *stylePtr, int worldX, int worldY)
-{
- TreeViewColumn *colPtr;
- TreeViewCheckBox *cbPtr = (TreeViewCheckBox *)stylePtr;
- int columnWidth;
- int x, y, width, height;
-
- colPtr = valuePtr->columnPtr;
- columnWidth = colPtr->width -
- (2 * colPtr->borderWidth + PADDING(colPtr->pad));
- if (columnWidth > valuePtr->width) {
- switch(colPtr->justify) {
- case TK_JUSTIFY_RIGHT:
- worldX += (columnWidth - valuePtr->width);
- break;
- case TK_JUSTIFY_CENTER:
- worldX += (columnWidth - valuePtr->width) / 2;
- break;
- case TK_JUSTIFY_LEFT:
- break;
- }
- }
- width = height = ODD(cbPtr->size) + 2 * cbPtr->lineWidth;
- x = colPtr->worldX + colPtr->pad.side1 + cbPtr->gap - cbPtr->lineWidth;
- y = entryPtr->worldY + (entryPtr->height - height) / 2;
- if ((worldX >= x) && (worldX < (x + width)) &&
- (worldY >= y) && (worldY < (y + height))) {
- return TRUE;
- }
- return FALSE;
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * EditCheckbox --
- *
- * Edits the "checkbox".
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The checkbox value is drawn.
- *
- *---------------------------------------------------------------------------
- */
-static int
-EditCheckBox(TreeView *viewPtr, TreeViewEntry *entryPtr,
- TreeViewColumn *colPtr, TreeViewStyle *stylePtr)
-{
- TreeViewCheckBox *cbPtr = (TreeViewCheckBox *)stylePtr;
- Tcl_Obj *objPtr;
-
- if (Blt_Tree_GetValueByKey(viewPtr->interp, viewPtr->tree, entryPtr->node,
- colPtr->key, &objPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (strcmp(Tcl_GetString(objPtr), cbPtr->onValue) == 0) {
- objPtr = Tcl_NewStringObj(cbPtr->offValue, -1);
- } else {
- objPtr = Tcl_NewStringObj(cbPtr->onValue, -1);
- }
- entryPtr->flags |= ENTRY_DIRTY;
- viewPtr->flags |= (DIRTY | LAYOUT_PENDING | SCROLL_PENDING);
- if (Blt_Tree_SetValueByKey(viewPtr->interp, viewPtr->tree, entryPtr->node,
- colPtr->key, objPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (cbPtr->cmdObjPtr != NULL) {
- Tcl_Obj *cmdObjPtr;
- int result;
-
- cmdObjPtr = Tcl_DuplicateObj(cbPtr->cmdObjPtr);
- Tcl_ListObjAppendElement(viewPtr->interp, cmdObjPtr,
- Tcl_NewLongObj(Blt_Tree_NodeId(entryPtr->node)));
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(viewPtr->interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeCheckbox --
- *
- * Releases resources allocated for the checkbox. The resources freed by
- * this routine are specific only to the "checkbox". Other resources
- * (common to all styles) are freed in the Blt_TreeView_FreeStyle
- * routine.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * GCs allocated for the checkbox are freed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeCheckBox(TreeView *viewPtr, TreeViewStyle *stylePtr)
-{
- TreeViewCheckBox *cbPtr = (TreeViewCheckBox *)stylePtr;
-
- if (cbPtr->highlightGC != NULL) {
- Tk_FreeGC(viewPtr->display, cbPtr->highlightGC);
- }
- if (cbPtr->activeGC != NULL) {
- Tk_FreeGC(viewPtr->display, cbPtr->activeGC);
- }
- if (cbPtr->gc != NULL) {
- Tk_FreeGC(viewPtr->display, cbPtr->gc);
- }
- if (cbPtr->icon != NULL) {
- Blt_TreeView_FreeIcon(viewPtr, cbPtr->icon);
- }
- if (cbPtr->offPtr != NULL) {
- Blt_Free(cbPtr->offPtr);
- }
- if (cbPtr->onPtr != NULL) {
- Blt_Free(cbPtr->onPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateComboBox --
- *
- * Creates a "combobox" style.
- *
- * Results:
- * A pointer to the new style structure.
- *
- *---------------------------------------------------------------------------
- */
-static TreeViewStyle *
-CreateComboBox(TreeView *viewPtr, Blt_HashEntry *hPtr)
-{
- TreeViewComboBox *cbPtr;
-
- cbPtr = Blt_AssertCalloc(1, sizeof(TreeViewComboBox));
- cbPtr->classPtr = &comboBoxClass;
- cbPtr->gap = STYLE_GAP;
- cbPtr->arrowRelief = TK_RELIEF_RAISED;
- cbPtr->arrowBW = 1;
- cbPtr->borderWidth = 1;
- cbPtr->relief = TK_RELIEF_FLAT;
- cbPtr->name = Blt_AssertStrdup(Blt_GetHashKey(&viewPtr->styleTable, hPtr));
- cbPtr->hashPtr = hPtr;
- cbPtr->link = NULL;
- cbPtr->flags = STYLE_COMBOBOX;
- cbPtr->refCount = 1;
- Blt_SetHashValue(hPtr, cbPtr);
- return (TreeViewStyle *)cbPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureComboBox --
- *
- * Configures a "combobox" style. This routine performs generates the
- * GCs required for a combobox style.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * GCs are created for the style.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ConfigureComboBox(TreeView *viewPtr, TreeViewStyle *stylePtr)
-{
- GC newGC;
- TreeViewComboBox *cbPtr = (TreeViewComboBox *)stylePtr;
- XColor *bgColor;
- XGCValues gcValues;
- unsigned long gcMask;
-
- gcValues.font = Blt_FontId(CHOOSE(viewPtr->font, cbPtr->font));
- bgColor = Blt_BackgroundBorderColor(CHOOSE(viewPtr->bg, cbPtr->bg));
- gcMask = GCForeground | GCBackground | GCFont;
-
- /* Normal foreground */
- gcValues.background = bgColor->pixel;
- gcValues.foreground = CHOOSE(viewPtr->fgColor, cbPtr->fgColor)->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (cbPtr->gc != NULL) {
- Tk_FreeGC(viewPtr->display, cbPtr->gc);
- }
- cbPtr->gc = newGC;
-
- /* Highlight foreground */
- gcValues.background = Blt_BackgroundBorderColor(cbPtr->highlightBg)->pixel;
- gcValues.foreground = cbPtr->highlightFgColor->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (cbPtr->highlightGC != NULL) {
- Tk_FreeGC(viewPtr->display, cbPtr->highlightGC);
- }
- cbPtr->highlightGC = newGC;
-
- /* Active foreground */
- gcValues.background = Blt_BackgroundBorderColor(cbPtr->activeBg)->pixel;
- gcValues.foreground = cbPtr->activeFgColor->pixel;
- newGC = Tk_GetGC(viewPtr->tkwin, gcMask, &gcValues);
- if (cbPtr->activeGC != NULL) {
- Tk_FreeGC(viewPtr->display, cbPtr->activeGC);
- }
- cbPtr->activeGC = newGC;
- cbPtr->flags |= STYLE_DIRTY;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MeasureComboBox --
- *
- * Determines the space requirements for the "combobox" given the value
- * to be displayed. Depending upon whether an icon or text is displayed
- * and their relative placements, this routine computes the space needed
- * for the text entry.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The width and height fields of *valuePtr* are set with the computed
- * dimensions.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MeasureComboBox(TreeView *viewPtr, TreeViewStyle *stylePtr,
- TreeViewValue *valuePtr)
-{
- TreeViewComboBox *cbPtr = (TreeViewComboBox *)stylePtr;
- int iconWidth, iconHeight;
- int textWidth, textHeight;
- int gap;
- Blt_Font font;
-
- textWidth = textHeight = 0;
- iconWidth = iconHeight = 0;
- valuePtr->width = valuePtr->height = 0;
-
- if (cbPtr->icon != NULL) {
- iconWidth = TreeView_IconWidth(cbPtr->icon);
- iconHeight = TreeView_IconHeight(cbPtr->icon);
- }
- if (valuePtr->textPtr != NULL) {
- Blt_Free(valuePtr->textPtr);
- valuePtr->textPtr = NULL;
- }
- font = CHOOSE(viewPtr->font, cbPtr->font);
- if (valuePtr->fmtString != NULL) { /* New string defined. */
- TextStyle ts;
-
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, font);
- valuePtr->textPtr = Blt_Ts_CreateLayout(valuePtr->fmtString, -1, &ts);
- }
- gap = 0;
- if (valuePtr->textPtr != NULL) {
- textWidth = valuePtr->textPtr->width;
- textHeight = valuePtr->textPtr->height;
- if (cbPtr->icon != NULL) {
- gap = cbPtr->gap;
- }
- }
- cbPtr->arrowWidth = Blt_TextWidth(font, "0", 1);
- cbPtr->arrowWidth += 2 * cbPtr->arrowBW;
- valuePtr->width = 2 * cbPtr->borderWidth + iconWidth + 4 * gap +
- cbPtr->arrowWidth + textWidth;
- valuePtr->height = MAX(textHeight, iconHeight) + 2 * cbPtr->borderWidth;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawComboBox --
- *
- * Draws the "combobox" given the screen coordinates and the
- * value to be displayed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The combobox value is drawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawComboBox(TreeView *viewPtr, Drawable drawable, TreeViewEntry *entryPtr,
- TreeViewValue *valuePtr, TreeViewStyle *stylePtr, int x, int y)
-{
- Blt_Background bg;
- TreeViewColumn *colPtr;
- TreeViewComboBox *cbPtr = (TreeViewComboBox *)stylePtr;
- XColor *fgColor;
- int arrowX, arrowY;
- int gap, columnWidth;
- int iconX, iconY, iconWidth, iconHeight;
- int textX, textY, textHeight;
- int relief;
- int borderWidth;
-
- borderWidth = 0;
- relief = TK_RELIEF_FLAT;
- colPtr = valuePtr->columnPtr;
- if (valuePtr == viewPtr->activeValuePtr) {
- bg = cbPtr->activeBg;
- fgColor = cbPtr->activeFgColor;
- borderWidth = 1;
- relief = TK_RELIEF_RAISED;
- } else if (stylePtr->flags & STYLE_HIGHLIGHT) {
- bg = cbPtr->highlightBg;
- fgColor = cbPtr->highlightFgColor;
- } else {
- /* If a background was specified, override the current background.
- * Otherwise, use the standard background taking into consideration if
- * its the odd or even color. */
- if (cbPtr->bg != NULL) {
- bg = cbPtr->bg;
- } else {
- bg = ((viewPtr->altBg != NULL) && (entryPtr->flatIndex & 0x1))
- ? viewPtr->altBg : viewPtr->bg;
- }
- fgColor = CHOOSE(viewPtr->fgColor, cbPtr->fgColor);
- }
-
- columnWidth = colPtr->width - PADDING(colPtr->pad);
- /* if (valuePtr == viewPtr->activeValuePtr) */ {
- /*
- * Draw the active or normal background color over the entire label
- * area. This includes both the tab's text and image. The rectangle
- * should be 2 pixels wider/taller than this area. So if the label
- * consists of just an image, we get an halo around the image when the
- * tab is active.
- */
- if (Blt_TreeView_EntryIsSelected(viewPtr, entryPtr)) {
- if (stylePtr->selBg != NULL) {
- bg = stylePtr->selBg;
- } else {
- bg = viewPtr->selBg;
- }
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, x, y+1,
- columnWidth, entryPtr->height - 2, borderWidth, relief);
- } else {
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, x, y+1,
- columnWidth, entryPtr->height - 2, borderWidth, relief);
- }
- }
- if (Blt_TreeView_EntryIsSelected(viewPtr, entryPtr)) {
- fgColor = viewPtr->selFgColor;
- }
- arrowX = x + colPtr->width;
- arrowX -= colPtr->pad.side2 + cbPtr->borderWidth + cbPtr->arrowWidth +
- cbPtr->gap;
- arrowY = y;
-
- if (columnWidth > valuePtr->width) {
- switch(colPtr->justify) {
- case TK_JUSTIFY_RIGHT:
- x += (columnWidth - valuePtr->width);
- break;
- case TK_JUSTIFY_CENTER:
- x += (columnWidth - valuePtr->width) / 2;
- break;
- case TK_JUSTIFY_LEFT:
- break;
- }
- }
-
-#ifdef notdef
- textX = textY = iconX = iconY = 0; /* Suppress compiler warning. */
-#endif
-
- iconWidth = iconHeight = 0;
- if (cbPtr->icon != NULL) {
- iconWidth = TreeView_IconWidth(cbPtr->icon);
- iconHeight = TreeView_IconHeight(cbPtr->icon);
- }
- textHeight = 0;
- if (valuePtr->textPtr != NULL) {
- textHeight = valuePtr->textPtr->height;
- }
- gap = 0;
- if ((cbPtr->icon != NULL) && (valuePtr->textPtr != NULL)) {
- gap = cbPtr->gap;
- }
-
- iconX = x + gap;
- iconY = y + (entryPtr->height - iconHeight) / 2;
- textX = iconX + iconWidth + gap;
- textY = y + (entryPtr->height - textHeight) / 2;
-
- if (cbPtr->icon != NULL) {
- Tk_RedrawImage(TreeView_IconBits(cbPtr->icon), 0, 0, iconWidth,
- iconHeight, drawable, iconX, iconY);
- }
- if (valuePtr->textPtr != NULL) {
- TextStyle ts;
- XColor *color;
- Blt_Font font;
- int xMax;
-
- font = CHOOSE(viewPtr->font, cbPtr->font);
- if (Blt_TreeView_EntryIsSelected(viewPtr, entryPtr)) {
- color = CHOOSE(viewPtr->selFgColor, stylePtr->selFgColor);
- } else if (entryPtr->color != NULL) {
- color = entryPtr->color;
- } else {
- color = fgColor;
- }
- Blt_Ts_InitStyle(ts);
- Blt_Ts_SetFont(ts, font);
- Blt_Ts_SetForeground(ts, color);
- Blt_Ts_SetMaxLength(ts, xMax - textX);
- xMax = SCREENX(viewPtr, colPtr->worldX) + colPtr->width -
- colPtr->titleBW - colPtr->pad.side2 - cbPtr->arrowWidth;
- Blt_Ts_DrawLayout(viewPtr->tkwin, drawable, valuePtr->textPtr, &ts,
- textX, textY);
- }
- if (valuePtr == viewPtr->activeValuePtr) {
- bg = stylePtr->activeBg;
- } else {
- bg = colPtr->titleBg;
-#ifdef notdef
- bg = CHOOSE(viewPtr->bg, cbPtr->bg);
-#endif
- }
-#ifdef notdef
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, arrowX,
- arrowY + cbPtr->borderWidth, cbPtr->arrowWidth,
- entryPtr->height - 2 * cbPtr->borderWidth, cbPtr->arrowBW,
- cbPtr->arrowRelief);
-#endif
- Blt_DrawArrow(viewPtr->display, drawable, fgColor, arrowX, arrowY - 1,
- cbPtr->arrowWidth, entryPtr->height, cbPtr->arrowBW, ARROW_DOWN);
- stylePtr->flags &= ~STYLE_DIRTY;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PickCombobox --
- *
- * Draws the "checkbox" given the screen coordinates and the
- * value to be displayed.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The checkbox value is drawn.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PickComboBox(TreeViewEntry *entryPtr, TreeViewValue *valuePtr,
- TreeViewStyle *stylePtr, int worldX, int worldY)
-{
- TreeViewColumn *colPtr;
- TreeViewComboBox *cbPtr = (TreeViewComboBox *)stylePtr;
- int x, y, width, height;
-
- colPtr = valuePtr->columnPtr;
- width = colPtr->width;
- height = entryPtr->height - 4;
- x = colPtr->worldX + cbPtr->borderWidth;
- y = entryPtr->worldY + cbPtr->borderWidth;
- if ((worldX >= x) && (worldX < (x + width)) &&
- (worldY >= y) && (worldY < (y + height))) {
- return TRUE;
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EditCombobox --
- *
- * Edits the "combobox".
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The checkbox value is drawn.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-EditComboBox(
- TreeView *viewPtr,
- TreeViewEntry *entryPtr,
- TreeViewColumn *colPtr,
- TreeViewStyle *stylePtr) /* Not used. */
-{
- return Blt_TreeView_CreateTextbox(viewPtr, entryPtr, colPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeComboBox --
- *
- * Releases resources allocated for the combobox. The resources freed by
- * this routine are specific only to the "combobox". Other resources
- * (common to all styles) are freed in the Blt_TreeView_FreeStyle
- * routine.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * GCs allocated for the combobox are freed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeComboBox(TreeView *viewPtr, TreeViewStyle *stylePtr)
-{
- TreeViewComboBox *cbPtr = (TreeViewComboBox *)stylePtr;
-
- if (cbPtr->highlightGC != NULL) {
- Tk_FreeGC(viewPtr->display, cbPtr->highlightGC);
- }
- if (cbPtr->activeGC != NULL) {
- Tk_FreeGC(viewPtr->display, cbPtr->activeGC);
- }
- if (cbPtr->gc != NULL) {
- Tk_FreeGC(viewPtr->display, cbPtr->gc);
- }
- if (cbPtr->icon != NULL) {
- Blt_TreeView_FreeIcon(viewPtr, cbPtr->icon);
- }
-}
-
-static TreeViewStyle *
-GetStyle(Tcl_Interp *interp, TreeView *viewPtr, const char *styleName)
-{
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&viewPtr->styleTable, styleName);
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find cell style \"", styleName,
- "\"", (char *)NULL);
- }
- return NULL;
- }
- return Blt_GetHashValue(hPtr);
-}
-
-int
-Blt_TreeView_GetStyle(Tcl_Interp *interp, TreeView *viewPtr,
- const char *styleName, TreeViewStyle **stylePtrPtr)
-{
- TreeViewStyle *stylePtr;
-
- stylePtr = GetStyle(interp, viewPtr, styleName);
- if (stylePtr == NULL) {
- return TCL_ERROR;
- }
- stylePtr->refCount++;
- *stylePtrPtr = stylePtr;
- return TCL_OK;
-}
-
-#ifdef notdef
-int
-Blt_TreeView_GetStyleFromObj(Tcl_Interp *interp, TreeView *viewPtr,
- Tcl_Obj *objPtr, TreeViewStyle **stylePtrPtr)
-{
- return Blt_TreeView_GetStyle(interp, viewPtr, Tcl_GetString(objPtr), stylePtrPtr);
-}
-#endif
-
-static TreeViewStyle *
-CreateStyle(
- Tcl_Interp *interp,
- TreeView *viewPtr, /* Blt_TreeView_ widget. */
- int type, /* Type of style: either
- * STYLE_TEXTBOX,
- * STYLE_COMBOBOX, or
- * STYLE_CHECKBOX */
- const char *styleName, /* Name of the new style. */
- int objc,
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- TreeViewStyle *stylePtr;
-
- hPtr = Blt_CreateHashEntry(&viewPtr->styleTable, styleName, &isNew);
- if (!isNew) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "cell style \"", styleName,
- "\" already exists", (char *)NULL);
- }
- return NULL;
- }
- /* Create the new marker based upon the given type */
- switch (type) {
- case STYLE_TEXTBOX:
- stylePtr = CreateTextBox(viewPtr, hPtr);
- break;
- case STYLE_COMBOBOX:
- stylePtr = CreateComboBox(viewPtr, hPtr);
- break;
- case STYLE_CHECKBOX:
- stylePtr = CreateCheckBox(viewPtr, hPtr);
- break;
- default:
- return NULL;
- }
- bltTreeViewIconOption.clientData = viewPtr;
- if (Blt_ConfigureComponentFromObj(interp, viewPtr->tkwin, styleName,
- stylePtr->classPtr->className, stylePtr->classPtr->specsPtr,
- objc, objv, (char *)stylePtr, 0) != TCL_OK) {
- Blt_TreeView_FreeStyle(viewPtr, stylePtr);
- return NULL;
- }
- return stylePtr;
-}
-
-void
-Blt_TreeView_UpdateStyleGCs(TreeView *viewPtr, TreeViewStyle *stylePtr)
-{
- (*stylePtr->classPtr->configProc)(viewPtr, stylePtr);
- stylePtr->flags |= STYLE_DIRTY;
- Blt_TreeView_EventuallyRedraw(viewPtr);
-}
-
-TreeViewStyle *
-Blt_TreeView_CreateStyle(
- Tcl_Interp *interp,
- TreeView *viewPtr, /* Blt_TreeView_ widget. */
- int type, /* Type of style: either
- * STYLE_TEXTBOX,
- * STYLE_COMBOBOX, or
- * STYLE_CHECKBOX */
- const char *styleName) /* Name of the new style. */
-{
- TreeViewStyle *stylePtr;
-
- stylePtr = CreateStyle(interp, viewPtr, type, styleName, 0, (Tcl_Obj **)NULL);
- if (stylePtr == NULL) {
- return NULL;
- }
- return stylePtr;
-}
-
-void
-Blt_TreeView_FreeStyle(TreeView *viewPtr, TreeViewStyle *stylePtr)
-{
- stylePtr->refCount--;
-#ifdef notdef
- fprintf(stderr, "Blt_TreeView_FreeStyle %s count=%d\n", stylePtr->name,
- stylePtr->refCount);
-#endif
- /* Remove the style from the hash table so that it's name can be used.*/
- /* If no cell is using the style, remove it.*/
- if (stylePtr->refCount <= 0) {
-#ifdef notdef
- fprintf(stderr, "freeing %s\n", stylePtr->name);
-#endif
- bltTreeViewIconOption.clientData = viewPtr;
- Blt_FreeOptions(stylePtr->classPtr->specsPtr, (char *)stylePtr,
- viewPtr->display, 0);
- (*stylePtr->classPtr->freeProc)(viewPtr, stylePtr);
- if (stylePtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&viewPtr->styleTable, stylePtr->hashPtr);
- }
- if (stylePtr->link != NULL) {
- /* Only user-generated styles will be in the list. */
- Blt_Chain_DeleteLink(viewPtr->userStyles, stylePtr->link);
- }
- if (stylePtr->name != NULL) {
- Blt_Free(stylePtr->name);
- }
- Blt_Free(stylePtr);
- }
-}
-
-void
-Blt_TreeView_SetStyleIcon(TreeView *viewPtr, TreeViewStyle *stylePtr,
- TreeViewIcon icon)
-{
- TreeViewTextBox *tbPtr = (TreeViewTextBox *)stylePtr;
-
- if (tbPtr->icon != NULL) {
- Blt_TreeView_FreeIcon(viewPtr, tbPtr->icon);
- }
- tbPtr->icon = icon;
-}
-
-GC
-Blt_TreeView_GetStyleGC(TreeViewStyle *stylePtr)
-{
- TreeViewTextBox *tbPtr = (TreeViewTextBox *)stylePtr;
- return tbPtr->gc;
-}
-
-Blt_Background
-Blt_TreeView_GetStyleBackground(TreeView *viewPtr, TreeViewStyle *stylePtr)
-{
- TreeViewTextBox *tbPtr = (TreeViewTextBox *)stylePtr;
- Blt_Background bg;
-
- bg = (tbPtr->flags & STYLE_HIGHLIGHT) ? tbPtr->highlightBg : tbPtr->bg;
- return (bg != NULL) ? bg : viewPtr->bg;
-}
-
-Blt_Font
-Blt_TreeView_GetStyleFont(TreeView *viewPtr, TreeViewStyle *stylePtr)
-{
- TreeViewTextBox *tbPtr = (TreeViewTextBox *)stylePtr;
-
- if (tbPtr->font != NULL) {
- return tbPtr->font;
- }
- return viewPtr->font;
-}
-
-XColor *
-Blt_TreeView_GetStyleFg(TreeView *viewPtr, TreeViewStyle *stylePtr)
-{
- TreeViewTextBox *tbPtr = (TreeViewTextBox *)stylePtr;
-
- if (tbPtr->fgColor != NULL) {
- return tbPtr->fgColor;
- }
- return viewPtr->fgColor;
-}
-
-static void
-DrawValue(TreeView *viewPtr, TreeViewEntry *entryPtr, TreeViewValue *valuePtr)
-{
- int srcX, srcY, x, y;
- int w, h;
- int pixWidth, pixHeight;
- int x1, x2, y1, y2;
- TreeViewColumn *colPtr;
- TreeViewStyle *stylePtr;
- Blt_Background bg;
- int overlap;
-
- stylePtr = valuePtr->stylePtr;
- if (stylePtr == NULL) {
- stylePtr = valuePtr->columnPtr->stylePtr;
- }
- if (stylePtr->cursor != None) {
- if (valuePtr == viewPtr->activeValuePtr) {
- Tk_DefineCursor(viewPtr->tkwin, stylePtr->cursor);
- } else {
- if (viewPtr->cursor != None) {
- Tk_DefineCursor(viewPtr->tkwin, viewPtr->cursor);
- } else {
- Tk_UndefineCursor(viewPtr->tkwin);
- }
- }
- }
- colPtr = valuePtr->columnPtr;
- x = SCREENX(viewPtr, colPtr->worldX) + colPtr->pad.side1;
- y = SCREENY(viewPtr, entryPtr->worldY);
- h = entryPtr->height - 2;
- w = valuePtr->columnPtr->width - PADDING(colPtr->pad);
-
- y1 = viewPtr->titleHeight + viewPtr->inset;
- y2 = Tk_Height(viewPtr->tkwin) - viewPtr->inset;
- x1 = viewPtr->inset;
- x2 = Tk_Width(viewPtr->tkwin) - viewPtr->inset;
-
- if (((x + w) < x1) || (x > x2) || ((y + h) < y1) || (y > y2)) {
- return; /* Value is entirely clipped. */
- }
-
- /* Draw the background of the value. */
- if ((valuePtr == viewPtr->activeValuePtr) ||
- (!Blt_TreeView_EntryIsSelected(viewPtr, entryPtr))) {
- bg = Blt_TreeView_GetStyleBackground(viewPtr, viewPtr->stylePtr);
- } else {
- bg = CHOOSE(viewPtr->selBg, stylePtr->selBg);
- }
- /*FIXME*/
- /* bg = CHOOSE(viewPtr->selBg, stylePtr->selBg); */
- overlap = FALSE;
- /* Clip the drawable if necessary */
- srcX = srcY = 0;
- pixWidth = w, pixHeight = h;
- if (x < x1) {
- pixWidth -= x1 - x;
- srcX += x1 - x;
- x = x1;
- overlap = TRUE;
- }
- if ((x + w) >= x2) {
- pixWidth -= (x + w) - x2;
- overlap = TRUE;
- }
- if (y < y1) {
- pixHeight -= y1 - y;
- srcY += y1 - y;
- y = y1;
- overlap = TRUE;
- }
- if ((y + h) >= y2) {
- pixHeight -= (y + h) - y2;
- overlap = TRUE;
- }
- if (overlap) {
- Drawable drawable;
-
- drawable = Tk_GetPixmap(viewPtr->display, Tk_WindowId(viewPtr->tkwin),
- pixWidth, pixHeight, Tk_Depth(viewPtr->tkwin));
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, 0, 0,
- pixWidth, pixHeight, 0, TK_RELIEF_FLAT);
- Blt_TreeView_DrawValue(viewPtr, entryPtr, valuePtr, drawable, srcX, srcY);
- XCopyArea(viewPtr->display, drawable, Tk_WindowId(viewPtr->tkwin),
- viewPtr->lineGC, 0, 0, pixWidth, pixHeight, x, y+1);
- Tk_FreePixmap(viewPtr->display, drawable);
- } else {
- Drawable drawable;
-
- drawable = Tk_WindowId(viewPtr->tkwin);
- Blt_FillBackgroundRectangle(viewPtr->tkwin, drawable, bg, x, y+1, w, h,
- 0, TK_RELIEF_FLAT);
- Blt_TreeView_DrawValue(viewPtr, entryPtr, valuePtr, drawable, x, y);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleActivateOp --
- *
- * Turns on/off highlighting for a particular style.
- *
- * .t style activate entry column
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-StyleActivateOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewValue *oldValuePtr;
-
- oldValuePtr = viewPtr->activeValuePtr;
- if (objc == 3) {
- Tcl_Obj *listObjPtr;
- TreeViewEntry *ep;
- TreeViewValue *vp;
-
- vp = viewPtr->activeValuePtr;
- ep = viewPtr->activePtr;
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if ((ep != NULL) && (vp != NULL)) {
- Tcl_Obj *objPtr;
- objPtr = Tcl_NewLongObj(Blt_Tree_NodeId(ep->node));
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewStringObj(vp->columnPtr->key, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- } else if (objc == 4) {
- viewPtr->activeValuePtr = NULL;
- if ((oldValuePtr != NULL) && (viewPtr->activePtr != NULL)) {
- DrawValue(viewPtr, viewPtr->activePtr, oldValuePtr);
- }
- } else {
- TreeViewColumn *colPtr;
- TreeViewEntry *ep;
- TreeViewValue *vp;
-
- if (Blt_TreeView_GetEntry(viewPtr, objv[3], &ep) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_TreeView_GetColumn(interp, viewPtr, objv[4], &colPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- vp = Blt_TreeView_FindValue(ep, colPtr);
- if (vp != NULL) {
- viewPtr->activePtr = ep;
- viewPtr->activeColumnPtr = colPtr;
- oldValuePtr = viewPtr->activeValuePtr;
- viewPtr->activeValuePtr = vp;
- if (vp != oldValuePtr) {
- if (oldValuePtr != NULL) {
- DrawValue(viewPtr, ep, oldValuePtr);
- }
- DrawValue(viewPtr, ep, vp);
- }
- }
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleCgetOp --
- *
- * .t style cget "styleName" -background
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-StyleCgetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewStyle *stylePtr;
-
- stylePtr = GetStyle(interp, viewPtr, Tcl_GetString(objv[3]));
- if (stylePtr == NULL) {
- return TCL_ERROR;
- }
- return Blt_ConfigureValueFromObj(interp, viewPtr->tkwin,
- stylePtr->classPtr->specsPtr, (char *)viewPtr, objv[4], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleCheckBoxOp --
- *
- * .t style checkbox "styleName" -background blue
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-StyleCheckBoxOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewStyle *stylePtr;
-
- stylePtr = CreateStyle(interp, viewPtr, STYLE_CHECKBOX,
- Tcl_GetString(objv[3]), objc - 4, objv + 4);
- if (stylePtr == NULL) {
- return TCL_ERROR;
- }
- stylePtr->link = Blt_Chain_Append(viewPtr->userStyles, stylePtr);
- Blt_TreeView_UpdateStyleGCs(viewPtr, stylePtr);
- Tcl_SetObjResult(interp, objv[3]);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleComboBoxOp --
- *
- * .t style combobox "styleName" -background blue
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-StyleComboBoxOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewStyle *stylePtr;
-
- stylePtr = CreateStyle(interp, viewPtr, STYLE_COMBOBOX,
- Tcl_GetString(objv[3]), objc - 4, objv + 4);
- if (stylePtr == NULL) {
- return TCL_ERROR;
- }
- stylePtr->link = Blt_Chain_Append(viewPtr->userStyles, stylePtr);
- Blt_TreeView_UpdateStyleGCs(viewPtr, stylePtr);
- Tcl_SetObjResult(interp, objv[3]);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleConfigureOp --
- *
- * This procedure is called to process a list of configuration options
- * database, in order to reconfigure a style.
- *
- * .t style configure "styleName" option value
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font, etc. get
- * set for stylePtr; old resources get freed, if there were any.
- *
- *---------------------------------------------------------------------------
- */
-static int
-StyleConfigureOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewStyle *stylePtr;
-
- stylePtr = GetStyle(interp, viewPtr, Tcl_GetString(objv[3]));
- if (stylePtr == NULL) {
- return TCL_ERROR;
- }
- if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin,
- stylePtr->classPtr->specsPtr, (char *)stylePtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 5) {
- return Blt_ConfigureInfoFromObj(interp, viewPtr->tkwin,
- stylePtr->classPtr->specsPtr, (char *)stylePtr, objv[5], 0);
- }
- bltTreeViewIconOption.clientData = viewPtr;
- if (Blt_ConfigureWidgetFromObj(interp, viewPtr->tkwin,
- stylePtr->classPtr->specsPtr, objc - 4, objv + 4, (char *)stylePtr,
- BLT_CONFIG_OBJV_ONLY) != TCL_OK) {
- return TCL_ERROR;
- }
- (*stylePtr->classPtr->configProc)(viewPtr, stylePtr);
- stylePtr->flags |= STYLE_DIRTY;
- viewPtr->flags |= (LAYOUT_PENDING | DIRTY);
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleForgetOp --
- *
- * Eliminates one or more style names. A style still may be in use after
- * its name has been officially removed. Only its hash table entry is
- * removed. The style itself remains until its reference count returns
- * to zero (i.e. no one else is using it).
- *
- * .t style forget "styleName"...
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-StyleForgetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewStyle *stylePtr;
- int i;
-
- for (i = 3; i < objc; i++) {
- stylePtr = GetStyle(interp, viewPtr, Tcl_GetString(objv[i]));
- if (stylePtr == NULL) {
- return TCL_ERROR;
- }
- /*
- * Removing the style from the hash tables frees up the style
- * name again. The style itself may not be removed until it's
- * been released by everything using it.
- */
- if (stylePtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&viewPtr->styleTable, stylePtr->hashPtr);
- stylePtr->hashPtr = NULL;
- }
- Blt_TreeView_FreeStyle(viewPtr, stylePtr);
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleHighlightOp --
- *
- * Turns on/off highlighting for a particular style.
- *
- * .t style highlight styleName on|off
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-StyleHighlightOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewStyle *stylePtr;
- int bool, oldBool;
-
- stylePtr = GetStyle(interp, viewPtr, Tcl_GetString(objv[3]));
- if (stylePtr == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_GetBooleanFromObj(interp, objv[4], &bool) != TCL_OK) {
- return TCL_ERROR;
- }
- oldBool = ((stylePtr->flags & STYLE_HIGHLIGHT) != 0);
- if (oldBool != bool) {
- if (bool) {
- stylePtr->flags |= STYLE_HIGHLIGHT;
- } else {
- stylePtr->flags &= ~STYLE_HIGHLIGHT;
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleNamesOp --
- *
- * Lists the names of all the current styles in the treeview widget.
- *
- * .t style names
- *
- * Results:
- * Always TCL_OK.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-StyleNamesOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Tcl_Obj *listObjPtr, *objPtr;
- TreeViewStyle *stylePtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&viewPtr->styleTable, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- stylePtr = Blt_GetHashValue(hPtr);
- objPtr = Tcl_NewStringObj(stylePtr->name, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleSetOp --
- *
- * Sets a style for a given key for all the ids given.
- *
- * .t style set styleName key node...
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then interp->result
- * contains an error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-StyleSetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeKey key;
- TreeViewStyle *stylePtr;
- int i;
-
- stylePtr = GetStyle(interp, viewPtr, Tcl_GetString(objv[3]));
- if (stylePtr == NULL) {
- return TCL_ERROR;
- }
- key = Blt_Tree_GetKey(viewPtr->tree, Tcl_GetString(objv[4]));
- stylePtr->flags |= STYLE_LAYOUT;
- for (i = 5; i < objc; i++) {
- TreeViewEntry *entryPtr;
- TreeViewTagIter iter;
-
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- TreeViewValue *vp;
-
- for (vp = entryPtr->values; vp != NULL; vp = vp->nextPtr) {
- if (vp->columnPtr->key == key) {
- TreeViewStyle *oldStylePtr;
-
- stylePtr->refCount++;
- oldStylePtr = vp->stylePtr;
- vp->stylePtr = stylePtr;
- if (oldStylePtr != NULL) {
- Blt_TreeView_FreeStyle(viewPtr, oldStylePtr);
- }
- break;
- }
- }
- }
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleTextBoxOp --
- *
- * .t style text "styleName" -background blue
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-StyleTextBoxOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewStyle *stylePtr;
-
- stylePtr = CreateStyle(interp, viewPtr, STYLE_TEXTBOX,
- Tcl_GetString(objv[3]), objc - 4, objv + 4);
- if (stylePtr == NULL) {
- return TCL_ERROR;
- }
- stylePtr->link = Blt_Chain_Append(viewPtr->userStyles, stylePtr);
- Blt_TreeView_UpdateStyleGCs(viewPtr, stylePtr);
- Tcl_SetObjResult(interp, objv[3]);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleUnsetOp --
- *
- * Removes a style for a given key for all the ids given.
- * The cell's style is returned to its default state.
- *
- * .t style unset styleName key node...
- *
- * Results:
- * A standard TCL result. If TCL_ERROR is returned, then
- * interp->result contains an error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-StyleUnsetOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Blt_TreeKey key;
- TreeViewStyle *stylePtr;
- int i;
-
- stylePtr = GetStyle(interp, viewPtr, Tcl_GetString(objv[3]));
- if (stylePtr == NULL) {
- return TCL_ERROR;
- }
- key = Blt_Tree_GetKey(viewPtr->tree, Tcl_GetString(objv[4]));
- stylePtr->flags |= STYLE_LAYOUT;
- for (i = 5; i < objc; i++) {
- TreeViewTagIter iter;
- TreeViewEntry *entryPtr;
-
- if (Blt_TreeView_FindTaggedEntries(viewPtr, objv[i], &iter) != TCL_OK) {
- return TCL_ERROR;
- }
- for (entryPtr = Blt_TreeView_FirstTaggedEntry(&iter); entryPtr != NULL;
- entryPtr = Blt_TreeView_NextTaggedEntry(&iter)) {
- TreeViewValue *vp;
-
- for (vp = entryPtr->values; vp != NULL; vp = vp->nextPtr) {
- if (vp->columnPtr->key == key) {
- if (vp->stylePtr != NULL) {
- Blt_TreeView_FreeStyle(viewPtr, vp->stylePtr);
- vp->stylePtr = NULL;
- }
- break;
- }
- }
- }
- }
- Blt_TreeView_EventuallyRedraw(viewPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StyleOp --
- *
- * .t style activate $node $column
- * .t style activate
- * .t style cget "highlight" -foreground
- * .t style configure "highlight" -fg blue -bg green
- * .t style checkbox "highlight"
- * .t style highlight "highlight" on|off
- * .t style combobox "highlight"
- * .t style text "highlight"
- * .t style forget "highlight"
- * .t style get "mtime" $node
- * .t style names
- * .t style set "mtime" "highlight" all
- * .t style unset "mtime" all
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec styleOps[] = {
- {"activate", 1, StyleActivateOp, 3, 5, "entry column",},
- {"cget", 2, StyleCgetOp, 5, 5, "styleName option",},
- {"checkbox", 2, StyleCheckBoxOp, 4, 0, "styleName options...",},
- {"combobox", 3, StyleComboBoxOp, 4, 0, "styleName options...",},
- {"configure", 3, StyleConfigureOp, 4, 0, "styleName options...",},
- {"forget", 1, StyleForgetOp, 3, 0, "styleName...",},
- {"highlight", 1, StyleHighlightOp, 5, 5, "styleName boolean",},
- {"names", 1, StyleNamesOp, 3, 3, "",},
- {"set", 1, StyleSetOp, 6, 6, "key styleName tagOrId...",},
- {"textbox", 1, StyleTextBoxOp, 4, 0, "styleName options...",},
- {"unset", 1, StyleUnsetOp, 5, 5, "key tagOrId",},
-};
-
-static int nStyleOps = sizeof(styleOps) / sizeof(Blt_OpSpec);
-
-int
-Blt_TreeView_StyleOp(TreeView *viewPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- TreeViewCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nStyleOps, styleOps, BLT_OP_ARG2, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc)(viewPtr, interp, objc, objv);
- return result;
-}
-#endif /* NO_TREEVIEW */
diff --git a/blt3.0.1/src/bltTypes.h b/blt3.0.1/src/bltTypes.h
deleted file mode 100644
index dbee65b..0000000
--- a/blt3.0.1/src/bltTypes.h
+++ /dev/null
@@ -1,141 +0,0 @@
-
-/*
- * ----------------------------------------------------------------------
- *
- * Blt_Pad --
- *
- * Specifies vertical and horizontal padding.
- *
- * Padding can be specified on a per side basis. The fields
- * side1 and side2 refer to the opposite sides, either
- * horizontally or vertically.
- *
- * side1 side2
- * ----- -----
- * x | left right
- * y | top bottom
- *
- * ----------------------------------------------------------------------
- */
-typedef struct {
- unsigned short int side1, side2;
-} Blt_Pad;
-
-#define padLeft xPad.side1
-#define padRight xPad.side2
-#define padTop yPad.side1
-#define padBottom yPad.side2
-#define PADDING(x) ((x).side1 + (x).side2)
-
-/*
- * ----------------------------------------------------------------------
- *
- * The following enumerated values are used as bit flags.
- * FILL_NONE Neither coordinate plane is specified
- * FILL_X Horizontal plane.
- * FILL_Y Vertical plane.
- * FILL_BOTH Both vertical and horizontal planes.
- *
- * ----------------------------------------------------------------------
- */
-#define FILL_NONE 0
-#define FILL_X 1
-#define FILL_Y 2
-#define FILL_BOTH 3
-
-/*
- * ----------------------------------------------------------------------
- *
- * Blt_Dashes --
- *
- * List of dash values (maximum 11 based upon PostScript limit).
- *
- * ----------------------------------------------------------------------
- */
-typedef struct {
- unsigned char values[12];
- int offset;
-} Blt_Dashes;
-
-#define LineIsDashed(d) ((d).values[0] != 0)
-
-/*
- * -------------------------------------------------------------------
- *
- * Point2D --
- *
- * 2-D coordinate.
- *
- * -------------------------------------------------------------------
- */
-typedef struct {
- double x, y;
-} Point2D;
-
-/*
- * -------------------------------------------------------------------
- *
- * Point3D --
- *
- * 3-D coordinate.
- *
- * -------------------------------------------------------------------
- */
-typedef struct {
- double x, y, z;
-} Point3D;
-
-/*
- * -------------------------------------------------------------------
- *
- * Segment2D --
- *
- * 2-D line segment.
- *
- * -------------------------------------------------------------------
- */
-typedef struct {
- Point2D p, q; /* The two end points of the segment. */
-} Segment2D;
-
-/*
- * -------------------------------------------------------------------
- *
- * Dim2D --
- *
- * 2-D dimension.
- *
- * -------------------------------------------------------------------
- */
-typedef struct {
- short int width, height;
-} Dim2D;
-
-/*
- *----------------------------------------------------------------------
- *
- * Region2D --
- *
- * 2-D region. Used to copy parts of images.
- *
- *----------------------------------------------------------------------
- */
-typedef struct {
- double left, right, top, bottom;
-} Region2D;
-
-typedef struct {
- double left, right, top, bottom, front, back;
-} Region3D;
-
-#define RegionWidth(r) ((r)->right - (r)->left + 1)
-#define RegionHeight(r) ((r)->bottom - (r)->top + 1)
-
-#define PointInRegion(e,x,y) \
- (((x) <= (e)->right) && ((x) >= (e)->left) && \
- ((y) <= (e)->bottom) && ((y) >= (e)->top))
-
-#define PointInRectangle(r,x0,y0) \
- (((x0) <= (int)((r)->x + (r)->width - 1)) && ((x0) >= (int)(r)->x) && \
- ((y0) <= (int)((r)->y + (r)->height - 1)) && ((y0) >= (int)(r)->y))
-
diff --git a/blt3.0.1/src/bltUnixBgexec.c b/blt3.0.1/src/bltUnixBgexec.c
deleted file mode 100644
index 7973e7b..0000000
--- a/blt3.0.1/src/bltUnixBgexec.c
+++ /dev/null
@@ -1,2425 +0,0 @@
-
-/*
- * bltUnixBgexec.c --
- *
- * This module implements a background "exec" command for the BLT toolkit.
- *
- * Copyright 2010 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#define _GNU_SOURCE
-#define _XOPEN_SOURCE
-#include "bltInt.h"
-#ifndef NO_BGEXEC
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif /* HAVE_STDLIB_H */
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_STROPTS_H
-#include <stropts.h>
-#endif /* HAVE_STROPTS_H */
-#ifdef HAVE_TERMIOS_H
-#include <termios.h>
-#include <unistd.h>
-#endif /* HAVE_TERMIOS_H */
-
-#include "bltWait.h"
-#include "bltSwitch.h"
-#include "bltChain.h"
-
-static Tcl_ObjCmdProc BgexecCmd;
-
-#if (_TCL_VERSION < _VERSION(8,1,0))
-typedef void *Tcl_Encoding; /* Make up dummy type for encoding. */
-#endif
-
-#define ENCODING_ASCII ((Tcl_Encoding)NULL)
-#define ENCODING_BINARY ((Tcl_Encoding)1)
-
-#define BGEXEC_THREAD_KEY "BLT Bgexec Data"
-
-#define READ_AGAIN (0)
-#define READ_EOF (-1)
-#define READ_ERROR (-2)
-
-#define PTY_NAME_SIZE 32
-
-/* The wait-related definitions are taken from tclUnix.h */
-
-#define TRACE_FLAGS (TCL_TRACE_WRITES | TCL_TRACE_UNSETS | TCL_GLOBAL_ONLY)
-
-#define BLOCK_SIZE 1024 /* Size of allocation blocks for
- * buffer */
-#define DEF_BUFFER_SIZE (BLOCK_SIZE * 8)
-#define MAX_READS 100 /* Maximum # of successful reads
- * before stopping to let TCL catch up
- * on events */
-#ifndef NSIG
-#define NSIG 32 /* # of signals available */
-#endif /*NSIG*/
-
-#ifndef SIGINT
-#define SIGINT 2
-#endif /* SIGINT */
-
-#ifndef SIGQUIT
-#define SIGQUIT 3
-#endif /* SIGQUIT */
-
-#ifndef SIGKILL
-#define SIGKILL 9
-#endif /* SIGKILL */
-
-#ifndef SIGTERM
-#define SIGTERM 14
-#endif /* SIGTERM */
-
-typedef struct {
- int number;
- const char *name;
-} SignalToken;
-
-static SignalToken signalTokens[] =
-{
-#ifdef SIGABRT
- {SIGABRT, "SIGABRT"},
-#endif
-#ifdef SIGALRM
- {SIGALRM, "SIGALRM"},
-#endif
-#ifdef SIGBUS
- {SIGBUS, "SIGBUS"},
-#endif
-#ifdef SIGCHLD
- {SIGCHLD, "SIGCHLD"},
-#endif
-#if defined(SIGCLD) && (!defined(SIGCHLD) || (SIGCLD != SIGCHLD))
- {SIGCLD, "SIGCLD"},
-#endif
-#ifdef SIGCONT
- {SIGCONT, "SIGCONT"},
-#endif
-#if defined(SIGEMT) && (!defined(SIGXCPU) || (SIGEMT != SIGXCPU))
- {SIGEMT, "SIGEMT"},
-#endif
-#ifdef SIGFPE
- {SIGFPE, "SIGFPE"},
-#endif
-#ifdef SIGHUP
- {SIGHUP, "SIGHUP"},
-#endif
-#ifdef SIGILL
- {SIGILL, "SIGILL"},
-#endif
-#ifdef SIGINT
- {SIGINT, "SIGINT"},
-#endif
-#ifdef SIGIO
- {SIGIO, "SIGIO"},
-#endif
-#if defined(SIGIOT) && (!defined(SIGABRT) || (SIGIOT != SIGABRT))
- {SIGIOT, "SIGIOT"},
-#endif
-#ifdef SIGKILL
- {SIGKILL, "SIGKILL"},
-#endif
-#if defined(SIGLOST) && (!defined(SIGIOT) || (SIGLOST != SIGIOT)) && (!defined(SIGURG) || (SIGLOST != SIGURG))
- {SIGLOST, "SIGLOST"},
-#endif
-#ifdef SIGPIPE
- {SIGPIPE, "SIGPIPE"},
-#endif
-#if defined(SIGPOLL) && (!defined(SIGIO) || (SIGPOLL != SIGIO))
- {SIGPOLL, "SIGPOLL"},
-#endif
-#ifdef SIGPROF
- {SIGPROF, "SIGPROF"},
-#endif
-#if defined(SIGPWR) && (!defined(SIGXFSZ) || (SIGPWR != SIGXFSZ))
- {SIGPWR, "SIGPWR"},
-#endif
-#ifdef SIGQUIT
- {SIGQUIT, "SIGQUIT"},
-#endif
-#ifdef SIGSEGV
- {SIGSEGV, "SIGSEGV"},
-#endif
-#ifdef SIGSTOP
- {SIGSTOP, "SIGSTOP"},
-#endif
-#ifdef SIGSYS
- {SIGSYS, "SIGSYS"},
-#endif
-#ifdef SIGTERM
- {SIGTERM, "SIGTERM"},
-#endif
-#ifdef SIGTRAP
- {SIGTRAP, "SIGTRAP"},
-#endif
-#ifdef SIGTSTP
- {SIGTSTP, "SIGTSTP"},
-#endif
-#ifdef SIGTTIN
- {SIGTTIN, "SIGTTIN"},
-#endif
-#ifdef SIGTTOU
- {SIGTTOU, "SIGTTOU"},
-#endif
-#if defined(SIGURG) && (!defined(SIGIO) || (SIGURG != SIGIO))
- {SIGURG, "SIGURG"},
-#endif
-#if defined(SIGUSR1) && (!defined(SIGIO) || (SIGUSR1 != SIGIO))
- {SIGUSR1, "SIGUSR1"},
-#endif
-#if defined(SIGUSR2) && (!defined(SIGURG) || (SIGUSR2 != SIGURG))
- {SIGUSR2, "SIGUSR2"},
-#endif
-#ifdef SIGVTALRM
- {SIGVTALRM, "SIGVTALRM"},
-#endif
-#ifdef SIGWINCH
- {SIGWINCH, "SIGWINCH"},
-#endif
-#ifdef SIGXCPU
- {SIGXCPU, "SIGXCPU"},
-#endif
-#ifdef SIGXFSZ
- {SIGXFSZ, "SIGXFSZ"},
-#endif
- {-1, "unknown signal"},
-};
-
-#ifdef TCL_THREADS
-static Tcl_Mutex *mutexPtr = NULL;
-#endif
-static Blt_Chain activePipelines; /* List of active pipelines and their
- * ptyexec structures. */
-
-/*
- * Sink buffer:
- * ____________________
- * | | "size" current allocated length of buffer.
- * | |
- * |--------------------| "fill" fill point (# characters in buffer).
- * | Raw |
- * |--------------------| "mark" Marks end of cooked characters.
- * | |
- * | Cooked |
- * | |
- * | |
- * |--------------------| "lastMark" Mark end of processed characters.
- * | |
- * | |
- * | Processed |
- * | |
- * |____________________| 0
- */
-typedef struct {
- const char *name; /* Name of the sink. */
- const char *doneVar; /* Name of a TCL variable (malloc'ed)
- * set to the collected data of the
- * last UNIX * subprocess. */
- const char *updateVar; /* Name of a TCL variable (malloc'ed)
- * updated as data is read from the
- * pipe. */
- Tcl_Obj *cmdObjPtr; /* Start of a TCL command executed
- * whenever data is read from the
- * pipe. */
- int flags;
- Tcl_Encoding encoding; /* Decoding scheme to use when
- * translating data. */
- int fd; /* File descriptor of the pipe. */
- int status;
- int echo; /* Indicates if the pipeline's stderr
- * stream should be echoed */
-
- unsigned char *bytes; /* Stores pipeline output (malloc-ed):
- * Initially points to static
- * storage */
- int size; /* Size of dynamically allocated
- * buffer. */
-
- int fill; /* # of bytes read into the
- * buffer. Marks the current fill
- * point of the buffer. */
-
- int mark; /* # of bytes translated (cooked). */
- int lastMark; /* # of bytes as of the last read. This
- * indicates the start of the new data
- * in the buffer since the last time
- * the "update" variable was set. */
- unsigned char staticSpace[DEF_BUFFER_SIZE]; /* Static space */
-
-} Sink;
-
-#define SINK_BUFFERED (1<<0)
-#define SINK_KEEP_NL (1<<1)
-#define SINK_NOTIFY (1<<2)
-
-typedef struct {
- const char *statusVar; /* Name of a TCL variable set to the
- * exit status of the last
- * process. Setting this variable
- * triggers the termination of all
- * subprocesses (regardless whether
- * they have already completed) */
- int signalNum; /* If non-zero, indicates the signal
- * to send subprocesses when cleaning
- * up.*/
- unsigned int flags; /* Various bit flags: see below. */
- int interval; /* Interval to poll for the exiting
- * processes */
- /* Private */
- Tcl_Interp *interp; /* Interpreter containing variables */
- int nProcs; /* # of processes in pipeline */
- ProcessId *procIds; /* Array of process tokens from
- * pipeline. Under Unix, tokens are
- * pid_t, while for Win32 they're
- * handles. */
- Tcl_TimerToken timerToken; /* Token for timer handler which polls
- * for the exit status of each
- * sub-process. If zero, there's no
- * timer handler queued. */
- int *exitCodePtr; /* Pointer to a memory location to
- * contain the last process' exit
- * code. */
- int *donePtr;
- Sink err, out; /* Data sinks for pipeline's output
- * and error channels. */
- Blt_ChainLink link;
-
- int master; /* File descriptor of master. */
- int slave; /* File descriptor of slave. */
- char masterName[PTY_NAME_SIZE+1];
- char slaveName[PTY_NAME_SIZE+1];
- pid_t sid; /* Pid of session leader. */
-} Bgexec;
-
-#define KEEPNEWLINE (1<<0) /* Indicates to set TCL output
- * variables with trailing newlines
- * intact */
-#define LINEBUFFERED (1<<1) /* Indicates to provide data to update
- * variable and update proc on a
- * line-by-line * basis. */
-#define IGNOREEXITCODE (1<<2) /* Don't check for 0 exit status of
- * the pipeline. */
-#define TRACED (1<<3) /* Indicates that the status variable
- * is currently being traced. */
-#define DETACHED (1<<4) /* Indicates that the pipeline is
- * detached from standard I/O, running
- * in the background. */
-#define KILLED (1<<5) /* The variable trace has been triggered
- * so ignore any errors from a broken
- * connection. */
-
-static Blt_SwitchParseProc ObjToSignalProc;
-static Blt_SwitchCustom killSignalSwitch =
-{
- ObjToSignalProc, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc ObjToEncodingProc;
-static Blt_SwitchFreeProc FreeEncodingProc;
-static Blt_SwitchCustom encodingSwitch =
-{
- ObjToEncodingProc, FreeEncodingProc, (ClientData)0,
-};
-
-static Blt_SwitchSpec switchSpecs[] =
-{
- {BLT_SWITCH_CUSTOM, "-decodeoutput", "encoding",
- Blt_Offset(Bgexec, out.encoding), 0, 0, &encodingSwitch},
- {BLT_SWITCH_CUSTOM, "-decodeerror", "encoding",
- Blt_Offset(Bgexec, err.encoding), 0, 0, &encodingSwitch},
- {BLT_SWITCH_BOOLEAN, "-echo", "bool",
- Blt_Offset(Bgexec, err.echo), 0},
- {BLT_SWITCH_STRING, "-error", "variable",
- Blt_Offset(Bgexec, err.doneVar), 0},
- {BLT_SWITCH_STRING, "-update", "variable",
- Blt_Offset(Bgexec, out.updateVar), 0},
- {BLT_SWITCH_STRING, "-output", "variable",
- Blt_Offset(Bgexec, out.doneVar), 0},
- {BLT_SWITCH_STRING, "-lasterror", "variable",
- Blt_Offset(Bgexec, err.updateVar), 0},
- {BLT_SWITCH_STRING, "-lastoutput", "variable",
- Blt_Offset(Bgexec, out.updateVar), 0},
- {BLT_SWITCH_OBJ, "-onerror", "command",
- Blt_Offset(Bgexec, err.cmdObjPtr), 0},
- {BLT_SWITCH_OBJ, "-onoutput", "command",
- Blt_Offset(Bgexec, out.cmdObjPtr), 0},
- {BLT_SWITCH_BOOLEAN, "-keepnewline", "bool",
- Blt_Offset(Bgexec, flags), 0, KEEPNEWLINE},
- {BLT_SWITCH_INT, "-check", "interval",
- Blt_Offset(Bgexec, interval), 0},
- {BLT_SWITCH_CUSTOM, "-killsignal", "signal",
- Blt_Offset(Bgexec, signalNum), 0, 0, &killSignalSwitch},
- {BLT_SWITCH_BOOLEAN, "-linebuffered", "bool",
- Blt_Offset(Bgexec, flags), 0, LINEBUFFERED},
- {BLT_SWITCH_BOOLEAN, "-ignoreexitcode", "bool",
- Blt_Offset(Bgexec, flags), 0, IGNOREEXITCODE},
- {BLT_SWITCH_STRING, "-variable", "variable",
- Blt_Offset(Bgexec, statusVar), 0},
- {BLT_SWITCH_END}
-};
-
-static Tcl_VarTraceProc VariableProc;
-static Tcl_TimerProc TimerProc;
-static Tcl_FileProc StdoutProc, StderrProc;
-static Tcl_ExitProc BgexecExitProc;
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToSignalProc --
- *
- * Convert a Tcl_Obj representing a signal number into its integer
- * value.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToSignalProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Intrepreter to return results */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* Value representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- char *string;
- int *signalPtr = (int *)(record + offset);
- int signalNum;
-
- string = Tcl_GetString(objPtr);
- if (string[0] == '\0') {
- *signalPtr = 0;
- return TCL_OK;
- }
- if (isdigit(UCHAR(string[0]))) {
- if (Tcl_GetIntFromObj(interp, objPtr, &signalNum) != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- char *name;
- SignalToken *sp;
-
- name = string;
-
- /* Clip off any "SIG" prefix from the signal name */
- if ((name[0] == 'S') && (name[1] == 'I') && (name[2] == 'G')) {
- name += 3;
- }
- signalNum = -1;
- for (sp = signalTokens; sp->number > 0; sp++) {
- if (strcmp(sp->name + 3, name) == 0) {
- signalNum = sp->number;
- break;
- }
- }
- if (signalNum < 0) {
- Tcl_AppendResult(interp, "unknown signal \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- }
- if ((signalNum < 0) || (signalNum > NSIG)) {
- /* Outside range of signals */
- Tcl_AppendResult(interp, "signal number \"", string,
- "\" is out of range", (char *)NULL);
- return TCL_ERROR;
- }
- *signalPtr = signalNum;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToEncodingProc --
- *
- * Convert a Tcl_Obj representing a encoding into a Tcl_Encoding.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToEncodingProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Intrepreter to return results */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* Value representation */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Tcl_Encoding *encodingPtr = (Tcl_Encoding *)(record + offset);
- Tcl_Encoding encoding;
- const char *name;
-
- name = Tcl_GetString(objPtr);
- encoding = ENCODING_ASCII;
- if (name != NULL) {
- if (strcmp(name, "binary") == 0) {
- encoding = ENCODING_BINARY;
- } else {
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- encoding = Tcl_GetEncoding(interp, name);
- if (encoding == NULL) {
- return TCL_ERROR;
- }
-#endif
- }
- }
- if ((*encodingPtr != ENCODING_BINARY) && (*encodingPtr != ENCODING_ASCII)) {
- Tcl_FreeEncoding(*encodingPtr);
- }
- *encodingPtr = encoding;
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static void
-FreeEncodingProc(char *record, int offset, int flags)
-{
- Tcl_Encoding *encodingPtr = (Tcl_Encoding *)(record + offset);
-
- if ((*encodingPtr != ENCODING_BINARY) && (*encodingPtr != ENCODING_ASCII)) {
- Tcl_FreeEncoding(*encodingPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetSinkData --
- *
- * Returns the data currently saved in the buffer
- *
- *---------------------------------------------------------------------------
- */
-static void
-GetSinkData(Sink *sinkPtr, unsigned char **dataPtr, int *lengthPtr)
-{
- int length;
-
- sinkPtr->bytes[sinkPtr->mark] = '\0';
- length = sinkPtr->mark;
- if ((sinkPtr->mark > 0) && (sinkPtr->encoding != ENCODING_BINARY)) {
- unsigned char *last;
-
- last = sinkPtr->bytes + (sinkPtr->mark - 1);
- if (((sinkPtr->flags & SINK_KEEP_NL) == 0) && (*last == '\n')) {
- length--;
- }
- }
- *dataPtr = sinkPtr->bytes;
- *lengthPtr = length;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextBlock --
- *
- * Returns the next block of data since the last time this routine was
- * called.
- *
- *---------------------------------------------------------------------------
- */
-static unsigned char *
-NextBlock(Sink *sinkPtr, size_t *lengthPtr)
-{
- unsigned char *string;
- ptrdiff_t length;
-
- string = sinkPtr->bytes + sinkPtr->lastMark;
- length = sinkPtr->mark - sinkPtr->lastMark;
- sinkPtr->lastMark = sinkPtr->mark;
- if (length > 0) {
- if ((!(sinkPtr->flags & SINK_KEEP_NL)) && (string[length-1] == '\n')) {
- length--;
- }
- *lengthPtr = length;
- return string;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextLine --
- *
- * Returns the next line of data.
- *
- *---------------------------------------------------------------------------
- */
-static unsigned char *
-NextLine(Sink *sinkPtr, size_t *lengthPtr)
-{
- if (sinkPtr->mark > sinkPtr->lastMark) {
- unsigned char *string;
- size_t newBytes;
- int i;
-
- string = sinkPtr->bytes + sinkPtr->lastMark;
- newBytes = sinkPtr->mark - sinkPtr->lastMark;
- for (i = 0; i < newBytes; i++) {
- if (string[i] == '\n') {
- int length;
-
- length = i + 1;
- sinkPtr->lastMark += length;
- if (!(sinkPtr->flags & SINK_KEEP_NL)) {
- length--; /* Backup over the newline. */
- }
- *lengthPtr = length;
- return string;
- }
- }
- /* Newline not found. On errors or EOF, also return a partial line. */
- if (sinkPtr->status < 0) {
- *lengthPtr = newBytes;
- sinkPtr->lastMark = sinkPtr->mark;
- return string;
- }
- }
- return NULL;
-}
-/*
- *---------------------------------------------------------------------------
- *
- * ResetSink --
- *
- * Removes the bytes already processed from the buffer, possibly
- * resetting it to empty. This used when we don't care about keeping all
- * the data collected from the channel (no -output flag and the process
- * is detached).
- *
- *---------------------------------------------------------------------------
- */
-static void
-ResetSink(Sink *sinkPtr)
-{
- if ((sinkPtr->flags & SINK_BUFFERED) &&
- (sinkPtr->fill > sinkPtr->lastMark)) {
- int i, j;
-
- /* There may be bytes remaining in the buffer, awaiting another read
- * before we see the next newline. So move the bytes to the front of
- * the array. */
-
- for (i = 0, j = sinkPtr->lastMark; j < sinkPtr->fill; i++, j++) {
- sinkPtr->bytes[i] = sinkPtr->bytes[j];
- }
- /* Move back the fill point and processed point. */
- sinkPtr->fill -= sinkPtr->lastMark;
- sinkPtr->mark -= sinkPtr->lastMark;
- } else {
- sinkPtr->mark = sinkPtr->fill = 0;
- }
- sinkPtr->lastMark = 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InitSink --
- *
- * Initializes the buffer's storage.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Storage is cleared.
- *
- *---------------------------------------------------------------------------
- */
-static void
-InitSink(Bgexec *execPtr, Sink *sinkPtr, const char *name)
-{
- sinkPtr->name = name;
- sinkPtr->echo = FALSE;
- sinkPtr->fd = -1;
- sinkPtr->bytes = sinkPtr->staticSpace;
- sinkPtr->size = DEF_BUFFER_SIZE;
-
- if (execPtr->flags & KEEPNEWLINE) {
- sinkPtr->flags |= SINK_KEEP_NL;
- }
- if (execPtr->flags & LINEBUFFERED) {
- sinkPtr->flags |= SINK_BUFFERED;
- }
- if ((sinkPtr->cmdObjPtr != NULL) ||
- (sinkPtr->updateVar != NULL) ||
- (sinkPtr->echo)) {
- sinkPtr->flags |= SINK_NOTIFY;
- }
- ResetSink(sinkPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeSinkBuffer --
- *
- * Frees the buffer's storage, freeing any malloc'ed space.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeSinkBuffer(Sink *sinkPtr)
-{
- if (sinkPtr->bytes != sinkPtr->staticSpace) {
- Blt_Free(sinkPtr->bytes);
- }
- sinkPtr->fd = -1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExtendSinkBuffer --
- *
- * Doubles the size of the current buffer.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ExtendSinkBuffer(Sink *sinkPtr)
-{
- unsigned char *bytes;
- /*
- * Allocate a new array, double the old size
- */
- sinkPtr->size += sinkPtr->size;
- bytes = Blt_Malloc(sizeof(unsigned char) * sinkPtr->size);
- if (bytes != NULL) {
- unsigned char *sp, *dp, *send;
-
- dp = bytes;
- for (sp = sinkPtr->bytes, send = sp + sinkPtr->fill; sp < send;
- /*empty*/) {
- *dp++ = *sp++;
- }
- if (sinkPtr->bytes != sinkPtr->staticSpace) {
- Blt_Free(sinkPtr->bytes);
- }
- sinkPtr->bytes = bytes;
- return (sinkPtr->size - sinkPtr->fill); /* Return bytes left. */
- }
- return -1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ReadBytes --
- *
- * Reads and appends any available data from a given file descriptor
- * to the buffer.
- *
- * Results:
- * Returns TCL_OK when EOF is found, TCL_RETURN if reading data would
- * block, and TCL_ERROR if an error occurred.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ReadBytes(Sink *sinkPtr)
-{
- int i;
- int nBytes;
-
- /*
- * Worry about indefinite postponement.
- *
- * Typically we want to stay in the read loop as long as it takes to
- * collect all the data that's currently available. But if it's coming
- * in at a constant high rate, we need to arbitrarily break out at some
- * point. This allows for both setting the update variable and the Tk
- * program to handle idle events.
- */
- nBytes = 0;
- for (i = 0; i < MAX_READS; i++) {
- int bytesLeft;
- unsigned char *array;
-
- /* Allocate a larger buffer when the number of remaining bytes is
- * below the threshold BLOCK_SIZE. */
-
- bytesLeft = sinkPtr->size - sinkPtr->fill;
-
- if (bytesLeft < BLOCK_SIZE) {
- bytesLeft = ExtendSinkBuffer(sinkPtr);
- if (bytesLeft < 0) {
- errno = ENOMEM;
- sinkPtr->status = READ_ERROR;
- return;
- }
- }
- array = sinkPtr->bytes + sinkPtr->fill;
-
- /* Read into a buffer but make sure we leave room for a trailing NUL
- * byte. */
- nBytes = read(sinkPtr->fd, array, bytesLeft - 1);
- if (nBytes == 0) { /* EOF: break out of loop. */
- sinkPtr->status = READ_EOF;
- return;
- }
- if (nBytes < 0) {
-#ifdef O_NONBLOCK
-#define BLOCKED EAGAIN
-#else
-#define BLOCKED EWOULDBLOCK
-#endif /*O_NONBLOCK*/
- /* Either an error has occurred or no more data is currently
- * available to read. */
- if (errno == BLOCKED) {
- sinkPtr->status = READ_AGAIN;
- return;
- }
- sinkPtr->bytes[0] = '\0';
- sinkPtr->status = READ_ERROR;
- return;
- }
- sinkPtr->fill += nBytes;
- sinkPtr->bytes[sinkPtr->fill] = '\0';
- }
- sinkPtr->status = nBytes;
-}
-
-#define SINKOPEN(sinkPtr) ((sinkPtr)->fd != -1)
-
-static void
-CloseSink(Tcl_Interp *interp, Sink *sinkPtr)
-{
- if (SINKOPEN(sinkPtr)) {
- close(sinkPtr->fd);
- Tcl_DeleteFileHandler(sinkPtr->fd);
- sinkPtr->fd = -1;
- if (sinkPtr->doneVar != NULL) {
- unsigned char *data;
- int length;
- /*
- * If data is to be collected, set the "done" variable with the
- * contents of the buffer.
- */
- GetSinkData(sinkPtr, &data, &length);
-#if (_TCL_VERSION < _VERSION(8,1,0))
- data[length] = '\0';
- if (Tcl_SetVar(interp, sinkPtr->doneVar, data,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_BackgroundError(interp);
- }
-#else
- if (Tcl_SetVar2Ex(interp, sinkPtr->doneVar, NULL,
- Tcl_NewByteArrayObj(data, (int)length),
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_BackgroundError(interp);
- }
-#endif
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CookSink --
- *
- * For Windows, translate CR/NL combinations to NL alone.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of the byte array may shrink and array contents shifted as
- * carriage returns are found and removed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-CookSink(Tcl_Interp *interp, Sink *sinkPtr)
-{
- unsigned char *srcPtr, *endPtr;
-#ifdef WIN32
- int oldMark;
-
- oldMark = sinkPtr->mark;
-#endif
- if (sinkPtr->encoding == ENCODING_BINARY) { /* binary */
- /* No translation needed. */
- sinkPtr->mark = sinkPtr->fill;
- } else if (sinkPtr->encoding == ENCODING_ASCII) { /* ascii */
-#if (_TCL_VERSION < _VERSION(8,1,0))
- /* Convert NUL bytes to question marks. */
- srcPtr = sinkPtr->bytes + sinkPtr->mark;
- endPtr = sinkPtr->bytes + sinkPtr->fill;
- while (srcPtr < endPtr) {
- if (*srcPtr == '\0') {
- *srcPtr = '?';
- }
- srcPtr++;
- }
-#endif /* < 8.1.0 */
- /* One-to-one translation. mark == fill. */
- sinkPtr->mark = sinkPtr->fill;
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- } else { /* unicode. */
- int nSrcCooked, nCooked;
- int result;
- int cookedSize, spaceLeft, needed;
- int nRaw, nLeftOver;
- unsigned char *destPtr;
- unsigned char *raw, *cooked;
- unsigned char leftover[100];
-
- raw = sinkPtr->bytes + sinkPtr->mark;
- nRaw = sinkPtr->fill - sinkPtr->mark;
- /* Ideally, the cooked buffer size should be smaller */
- cookedSize = nRaw * TCL_UTF_MAX + 1;
- cooked = Blt_AssertMalloc(cookedSize);
- result = Tcl_ExternalToUtf(interp, sinkPtr->encoding,
- (char *)raw, nRaw, 0, NULL, (char *)cooked,
- cookedSize, &nSrcCooked, &nCooked, NULL);
- nLeftOver = 0;
- if (result == TCL_CONVERT_MULTIBYTE) {
- /*
- * Last multibyte sequence wasn't completed. Save the extra
- * characters in a temporary buffer.
- */
- nLeftOver = (nRaw - nSrcCooked);
- srcPtr = sinkPtr->bytes + (sinkPtr->mark + nSrcCooked);
- endPtr = srcPtr + nLeftOver;
- destPtr = leftover;
- while (srcPtr < endPtr) {
- *destPtr++ = *srcPtr++;
- }
- }
- /*
- * Create a bigger sink.
- */
- needed = nLeftOver + nCooked;
- spaceLeft = sinkPtr->size - sinkPtr->mark;
- if (spaceLeft >= needed) {
- spaceLeft = ExtendSinkBuffer(sinkPtr);
- }
- assert(spaceLeft > needed);
- /*
- * Replace the characters from the mark with the translated
- * characters.
- */
- srcPtr = cooked;
- endPtr = cooked + nCooked;
- destPtr = sinkPtr->bytes + sinkPtr->mark;
- while (srcPtr < endPtr) {
- *destPtr++ = *srcPtr++;
- }
- /* Add the number of newly translated characters to the mark */
- sinkPtr->mark += nCooked;
-
- srcPtr = leftover;
- endPtr = leftover + nLeftOver;
- while (srcPtr < endPtr) {
- *destPtr++ = *srcPtr++;
- }
- sinkPtr->fill = sinkPtr->mark + nLeftOver;
-#endif /* >= 8.1.0 */
- }
-#ifdef WIN32
- /*
- * Translate CRLF character sequences to LF characters. We have to do
- * this after converting the string to UTF from UNICODE.
- */
- if (sinkPtr->encoding != ENCODING_BINARY) {
- int count;
- unsigned char *destPtr;
-
- destPtr = srcPtr = sinkPtr->bytes + oldMark;
- endPtr = sinkPtr->bytes + sinkPtr->fill;
- *endPtr = '\0';
- count = 0;
- for (endPtr--; srcPtr < endPtr; srcPtr++) {
- if ((*srcPtr == '\r') && (*(srcPtr + 1) == '\n')) {
- count++;
- continue; /* Skip the CR in CR/LF sequences. */
- }
- if (srcPtr != destPtr) {
- *destPtr = *srcPtr; /* Collapse the string, overwriting
- * the \r's encountered. */
- }
- destPtr++;
- }
- sinkPtr->mark -= count;
- sinkPtr->fill -= count;
- *destPtr = *srcPtr; /* Copy the last byte */
- if (*destPtr == '\r') {
- sinkPtr->mark--;
- }
- }
-#endif /* WIN32 */
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * CookSink --
- *
- * For Windows, translate CR/NL combinations to NL alone.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The size of the byte array may shrink and array contents shifted as
- * carriage returns are found and removed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-CookSink(Tcl_Interp *interp, Sink *sinkPtr)
-{
- unsigned char *srcPtr, *endPtr;
-
- if (sinkPtr->encoding == ENCODING_BINARY) { /* binary */
- /* No translation needed. */
- sinkPtr->mark = sinkPtr->fill;
- } else if (sinkPtr->encoding == ENCODING_ASCII) { /* ascii */
-#if (_TCL_VERSION < _VERSION(8,1,0))
- /* Convert NUL bytes to question marks. */
- srcPtr = sinkPtr->bytes + sinkPtr->mark;
- endPtr = sinkPtr->bytes + sinkPtr->fill;
- while (srcPtr < endPtr) {
- if (*srcPtr == '\0') {
- *srcPtr = '?';
- }
- srcPtr++;
- }
-#endif /* < 8.1.0 */
- /* One-to-one translation. mark == fill. */
- sinkPtr->mark = sinkPtr->fill;
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- } else { /* unicode. */
- int nSrcCooked, nCooked;
- int result;
- int cookedSize, spaceLeft, needed;
- int nRaw, nLeftOver;
- unsigned char *destPtr;
- unsigned char *raw, *cooked;
- unsigned char leftover[100];
-
- raw = sinkPtr->bytes + sinkPtr->mark;
- nRaw = sinkPtr->fill - sinkPtr->mark;
- /* Ideally, the cooked buffer size should be smaller */
- cookedSize = nRaw * TCL_UTF_MAX + 1;
- cooked = Blt_AssertMalloc(cookedSize);
- result = Tcl_ExternalToUtf(interp, sinkPtr->encoding,
- (char *)raw, nRaw, 0, NULL, (char *)cooked,
- cookedSize, &nSrcCooked, &nCooked, NULL);
- nLeftOver = 0;
- if (result == TCL_CONVERT_MULTIBYTE) {
- /*
- * Last multibyte sequence wasn't completed. Save the extra
- * characters in a temporary buffer.
- */
- nLeftOver = (nRaw - nSrcCooked);
- srcPtr = sinkPtr->bytes + (sinkPtr->mark + nSrcCooked);
- endPtr = srcPtr + nLeftOver;
- destPtr = leftover;
- while (srcPtr < endPtr) {
- *destPtr++ = *srcPtr++;
- }
- }
- /*
- * Create a bigger sink.
- */
-
- needed = nLeftOver + nCooked;
- spaceLeft = sinkPtr->size - sinkPtr->mark;
- if (spaceLeft >= needed) {
- spaceLeft = ExtendSinkBuffer(sinkPtr);
- }
- assert(spaceLeft > needed);
- /*
- * Replace the characters from the mark with the translated
- * characters.
- */
- srcPtr = cooked;
- endPtr = cooked + nCooked;
- destPtr = sinkPtr->bytes + sinkPtr->mark;
- while (srcPtr < endPtr) {
- *destPtr++ = *srcPtr++;
- }
- /* Add the number of newly translated characters to the mark */
- sinkPtr->mark += nCooked;
-
- srcPtr = leftover;
- endPtr = leftover + nLeftOver;
- while (srcPtr < endPtr) {
- *destPtr++ = *srcPtr++;
- }
- sinkPtr->fill = sinkPtr->mark + nLeftOver;
-#endif /* >= 8.1.0 */
- }
-}
-#endif
-
-#if (_TCL_VERSION < _VERSION(8,1,0))
-
-static void
-NotifyOnUpdate(Tcl_Interp *interp, Sink *sinkPtr, unsigned char *data,
- size_t nBytes)
-{
- char save;
-
- if (data[0] == '\0') {
- return;
- }
- save = data[nBytes];
- data[nBytes] = '\0';
- if (sinkPtr->echo) {
- Tcl_Channel channel;
-
- channel = Tcl_GetStdChannel(TCL_STDERR);
- if (channel == NULL) {
- Tcl_AppendResult(interp, "can't get stderr channel", (char *)NULL);
- Tcl_BackgroundError(interp);
- sinkPtr->echo = FALSE;
- } else {
- Tcl_Write(channel, data, nBytes);
- if (save == '\n') {
- Tcl_Write(channel, "\n", 1);
- }
- Tcl_Flush(channel);
- }
- }
- objPtr = Tcl_NewByteArrayObj(data, nBytes);
- Tcl_IncrRefCount(objPtr);
- if (sinkPtr->cmdObjPtr != NULL) {
- Tcl_Obj *cmdObjPtr;
- int result;
-
- cmdObjPtr = Tcl_DuplicateObj(sinkPtr->cmdObjPtr);
- Tcl_ListObjAppendElement(interp, cmdObjPtr, objPtr);
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- if (result != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
- }
- if (sinkPtr->updateVar != NULL) {
- if (Tcl_SetVar2Ex(interp, sinkPtr->updateVar, NULL, objPtr,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_BackgroundError(interp);
- }
- }
- Tcl_DecrRefCount(objPtr);
- data[nBytes] = save;
-}
-
-#else
-
-static void
-NotifyOnUpdate(Tcl_Interp *interp, Sink *sinkPtr, unsigned char *data,
- size_t nBytes)
-{
- Tcl_Obj *objPtr;
-
- if ((nBytes == 0) || (data[0] == '\0')) {
- return;
- }
- if (sinkPtr->echo) {
- Tcl_Channel channel;
-
- channel = Tcl_GetStdChannel(TCL_STDERR);
- if (channel == NULL) {
- Tcl_AppendResult(interp, "can't get stderr channel", (char *)NULL);
- Tcl_BackgroundError(interp);
- sinkPtr->echo = FALSE;
- } else {
- if (data[nBytes] == '\n') {
- objPtr = Tcl_NewByteArrayObj(data, nBytes + 1);
- } else {
- objPtr = Tcl_NewByteArrayObj(data, nBytes);
- }
- Tcl_WriteObj(channel, objPtr);
- Tcl_Flush(channel);
- }
- }
-
- objPtr = Tcl_NewByteArrayObj(data, nBytes);
- Tcl_IncrRefCount(objPtr);
- if (sinkPtr->cmdObjPtr != NULL) {
- Tcl_Obj *cmdObjPtr;
- int result;
-
- cmdObjPtr = Tcl_DuplicateObj(sinkPtr->cmdObjPtr);
- Tcl_ListObjAppendElement(interp, cmdObjPtr, objPtr);
- Tcl_IncrRefCount(cmdObjPtr);
- result = Tcl_EvalObjEx(interp, cmdObjPtr, TCL_EVAL_GLOBAL);
- Tcl_DecrRefCount(cmdObjPtr);
- if (result != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
- }
- if (sinkPtr->updateVar != NULL) {
- if (Tcl_SetVar2Ex(interp, sinkPtr->updateVar, NULL, objPtr,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_BackgroundError(interp);
- }
- }
- Tcl_DecrRefCount(objPtr);
-}
-
-#endif /* < 8.1.0 */
-
-static int
-CollectData(Bgexec *execPtr, Sink *sinkPtr)
-{
- if ((execPtr->flags & DETACHED) && (sinkPtr->doneVar == NULL)) {
- ResetSink(sinkPtr);
- }
- ReadBytes(sinkPtr);
- CookSink(execPtr->interp, sinkPtr);
- if ((sinkPtr->mark > sinkPtr->lastMark) && (sinkPtr->flags & SINK_NOTIFY)) {
- if (sinkPtr->flags & SINK_BUFFERED) {
- size_t length;
- unsigned char *data;
-
- /* For line-by-line updates, call NotifyOnUpdate for each new
- * complete line. */
- while ((data = NextLine(sinkPtr, &length)) != NULL) {
- NotifyOnUpdate(execPtr->interp, sinkPtr, data, length);
- }
- } else {
- size_t length;
- unsigned char *data;
- int count;
-#ifdef notdef
- int i;
-#endif
- length = 0; /* Suppress compiler warning. */
- data = NextBlock(sinkPtr, &length);
- #ifdef notdef
- count = 0;
- for (i = 0; i < length; i++) {
- if (data[i] == '\r') {
- continue;
- }
- if (i > count) {
- data[count] = data[i];
- }
- count++;
- }
- fprintf(stderr, "\n");
- #else
- count = length;
- #endif
- NotifyOnUpdate(execPtr->interp, sinkPtr, data, count);
- }
- }
- if (sinkPtr->status >= 0) {
- return TCL_OK;
- }
- if (sinkPtr->status == READ_ERROR) {
- if ((execPtr->flags & KILLED) == 0) {
- Tcl_AppendResult(execPtr->interp, "can't read data from ",
- sinkPtr->name, ": ", Tcl_PosixError(execPtr->interp),
- (char *)NULL);
- Tcl_BackgroundError(execPtr->interp);
- }
- return TCL_RETURN;
- }
- return TCL_RETURN;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateSinkHandler --
- *
- * Creates a file handler for the given sink. The file descriptor is
- * also set for non-blocking I/O.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The memory allocated to the Bgexec structure released.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateSinkHandler(Bgexec *execPtr, Sink *sinkPtr, Tcl_FileProc *proc)
-{
- int flags;
-
- flags = fcntl(sinkPtr->fd, F_GETFL);
-#ifdef O_NONBLOCK
- flags |= O_NONBLOCK;
-#else
- flags |= O_NDELAY;
-#endif
- if (fcntl(sinkPtr->fd, F_SETFL, flags) < 0) {
- Tcl_AppendResult(execPtr->interp, "can't set file descriptor ",
- Blt_Itoa(sinkPtr->fd), " to non-blocking:",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_CreateFileHandler(sinkPtr->fd, TCL_READABLE, proc, execPtr);
- return TCL_OK;
-}
-
-static void
-DisableTriggers(Bgexec *execPtr) /* Background info record. */
-{
- if (execPtr->flags & TRACED) {
- Tcl_UntraceVar(execPtr->interp, execPtr->statusVar, TRACE_FLAGS,
- VariableProc, execPtr);
- execPtr->flags &= ~TRACED;
- }
- if (SINKOPEN(&execPtr->out)) {
- CloseSink(execPtr->interp, &execPtr->out);
- }
- if (SINKOPEN(&execPtr->err)) {
- CloseSink(execPtr->interp, &execPtr->err);
- }
- if (execPtr->timerToken != (Tcl_TimerToken) 0) {
- Tcl_DeleteTimerHandler(execPtr->timerToken);
- execPtr->timerToken = 0;
- }
- if (execPtr->donePtr != NULL) {
- *execPtr->donePtr = TRUE;
- }
-}
-
-#ifdef notdef
- if ((Flags & DILLO_TTY) && tcgetattr(STDIN_FILENO, &tt) == -1)
- if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &tt) == -1)
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreatePipe --
- *
- * Creates a pipe by simply calling the pipe() function.
- *
- * Results:
- * Returns 1 on success, 0 on failure.
- *
- * Side effects:
- * Creates a pipe.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreatePipe(
- Tcl_Interp *interp,
- int *inPtr, /* (out) Descriptor for read side of
- * pipe. */
- int *outPtr) /* (out) Descriptor for write side of
- * pipe. */
-{
- int fd[2];
-
- if (pipe(fd) < 0) {
- Tcl_AppendResult(interp, "can't create pipe: ",
- Tcl_PosixError(interp), (char *)NULL);
- return TCL_ERROR;
- }
- fcntl(fd[0], F_SETFD, FD_CLOEXEC);
- fcntl(fd[1], F_SETFD, FD_CLOEXEC);
-
- *inPtr = fd[0];
- *outPtr = fd[1];
- return TCL_OK;
-}
-
-#ifdef HAVE_GETPT
-static int
-GetMaster(Bgexec *execPtr)
-{
- int f;
-
- f = getpt();
- if (f < 0) {
- Tcl_AppendResult(execPtr->interp, "failed getpt: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- execPtr->masterName[0] = '\0';
- execPtr->master = f;
- return TCL_OK;
-}
-
-#elif defined(HAVE_POSIX_OPENPT)
-
-static int
-GetMaster(Bgexec *execPtr)
-{
- int f;
-
- f = posix_openpt(O_RDWR | O_NOCTTY);
- if (f < 0) {
- Tcl_AppendResult(execPtr->interp, "failed openpt: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- execPtr->masterName[0] = '\0';
- execPtr->master = f;
- return TCL_OK;
-}
-
-#else
-static int
-GetMaster(Bgexec *execPtr)
-{
- static const char ptyChars[] = {
- "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
- };
- int f;
- const char *p;
- char ptyName[11];
-
- strcpy(execPtr->masterName, "/dev/ptmx");
- f = open(execPtr->masterName, O_RDWR | O_NOCTTY);
- if (f >= 0) {
- execPtr->master = f;
- return TCL_OK;
- }
- strcpy(ptyName, "/dev/ptyXY");
- for (p = ptyChars; *p != '\0'; p++) {
- const char *q;
-
- ptyName[8] = *p;
- ptyName[9] = *ptyChars;
- if (access(proto, F_OK) == -1) {
- if (errno == E_NOENT) {
- /* If there is no /dev/ptyX0, skip all Xs. */
- continue;
- }
- Tcl_AppendResult(execPtr->interp, "can't access \"", ptyName, "\": ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- for (q = ptyChars; *q != '\0'; q++) {
- int f;
-
- ptyName[9] = *q;
- f = open(ptyName, O_RDWR);
- if (f >= 0) {
- execPtr->master = f;
- strcpy(execPtr->masterName, ptyName);
- return TCL_OK;
- }
- if (errno == E_NOENT) {
- break;
- }
- }
- }
- Tcl_AppendResult(execPtr->interp, "can't access any ptys", (char *)NULL);
- return TCL_ERROR;
-}
-#endif /* HAVE_POSIX_OPENPT */
-
-typedef int Tcl_File;
-static int
-InitMaster(Bgexec *execPtr)
-{
-#ifdef HAVE_TCFLUSH
- if (tcflush(execPtr->master, TCIOFLUSH) < 0) {
- Tcl_AppendResult(execPtr->interp, "tcflush: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
-#else
-#ifdef TIOCFLUSH
- if (ioctl(execPtr->master, TIOCFLUSH, NULL) < 0) {
- Tcl_AppendResult(execPtr->interp, "can't set TIOCFLUSH on master: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
-#endif /* TIOCFLUSH */
-#endif /* HAVE_TCFLUSH */
-
-#ifdef TIOCEXCL
- if (ioctl(execPtr->master, TIOCEXCL, NULL) < 0) {
- Tcl_AppendResult(execPtr->interp, "can't set TIOCEXCL on descriptor: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
-#endif /* TIOCEXCL */
- return TCL_OK;
-}
-
-#ifdef HAVE_OPEN_CONTROLLING_PTY
-static int
-OpenMaster(Bgexec *execPtr)
-{
- const char *name;
- int f;
-
- f = open_controlling_pty(name);
- if (f < 0) {
- Tcl_AppendResult(execPtr->interp, "can't open controlling pty: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- execPtr->master = f;
- strcpy(execPtr->slaveName, name);
- if (InitMaster(execPtr) != TCL_OK) {
- return TCL_ERROR;
- }
-}
-#endif /* HAVE_OPEN_CONTROLLING_PTY */
-
-#ifdef HAVE_GRANTPT
-static int
-OpenMaster(Bgexec *execPtr)
-{
- const char *name;
-
- if (GetMaster(execPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (grantpt(execPtr->master) < 0) {
- Tcl_AppendResult(execPtr->interp, "grantpt: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- if (unlockpt(execPtr->master) < 0) {
- Tcl_AppendResult(execPtr->interp, "unlockpt: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- name = ptsname(execPtr->master);
- if (name == NULL) {
- Tcl_AppendResult(execPtr->interp, "ptsname: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- strcpy(execPtr->slaveName, name);
- if (InitMaster(execPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-#else
-
-#ifdef HAVE_OPENPTY
-#include <util.h>
-static int
-OpenMaster(Bgexec *execPtr)
-{
- if (openpty(&execPtr->master, &execPtr->slave, NULL, NULL, NULL) < 0) {
- Tcl_AppendResult(execPtr->interp, "can't open pty: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- if (InitMaster(execPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-#endif /* HAVE_OPENPT */
-#endif /* HAVE_GRANTPT */
-
-static int
-OpenSlave(Bgexec *execPtr)
-{
- int f;
- pid_t pid;
- struct termios tt;
-
- pid = getpid(); /* Get the pid of the session leader. */
- if (setsid() < 0) {
- Tcl_AppendResult(execPtr->interp, "setsid: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- if (fork() > 0) {
- _exit(0);
- }
- if (setpgid(0, pid) < 0) {
- Tcl_AppendResult(execPtr->interp, "setpgid: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- f = open(execPtr->slaveName, O_RDWR);
- if (f < 0) {
- Tcl_AppendResult(execPtr->interp, "can't open \"", execPtr->slaveName,
- "\": ", Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- execPtr->slave = f;
-#ifdef TIOCSCTTY
- if (ioctl(f, TIOCSCTTY, (char *)TRUE) < 0) {
- Tcl_AppendResult(execPtr->interp, "can't set ioctl \"TIOCSCTTY\": ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
-#endif /* TIOCSCTTY */
-#ifdef I_PUSH
- if (isastream(f)) {
- if (ioctl(f, I_PUSH, "p_tem") < 0) {
- Tcl_AppendResult(execPtr->interp, "can't set ioctl \"p_tem\": ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- if (ioctl(f, I_PUSH, "ldterm") < 0) {
- Tcl_AppendResult(execPtr->interp, "can't set ioctl \"ldterm\": ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- }
-#endif
- if (tcgetattr(0, &tt) < 0) {
- Tcl_AppendResult(execPtr->interp, "can't get terminate attributes: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- if (tcsetattr(execPtr->slave, TCSAFLUSH, &tt) < 0) {
- Tcl_AppendResult(execPtr->interp, "can't set terminate attributes: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- if (dup2(execPtr->slave, 0) < 0) {
- Tcl_AppendResult(execPtr->interp, "can't dup stdin: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- if (dup2(execPtr->slave, 1) < 0) {
- Tcl_AppendResult(execPtr->interp, "can't dup stdout: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- if (dup2(execPtr->slave, 2) < 0) {
- Tcl_AppendResult(execPtr->interp, "can't dup stderr: ",
- Tcl_PosixError(execPtr->interp), (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * Must clear the close-on-exec flag for the target FD, since some
- * systems (e.g. Ultrix) do not clear the CLOEXEC flag on the
- * target FD.
- */
- fcntl(0, F_SETFD, 0);
- fcntl(1, F_SETFD, 0);
- fcntl(2, F_SETFD, 0);
- return TCL_OK;
-}
-
-static int
-ExecutePipeline(Bgexec *execPtr, int objc, Tcl_Obj *const *objv)
-{
- WAIT_STATUS_TYPE waitStatus, lastStatus;
- int nProcs; /* # of processes. */
- pid_t child;
- int mesgIn, mesgOut;
- int errIn, errOut;
- pid_t *pids;
-
- errIn = errOut = -1;
- mesgIn = mesgOut = -1;
-
- /*
- * Create a pipe that the child can use to return error information if
- * anything goes wrong in creating the pipeline.
- */
- if (CreatePipe(execPtr->interp, &mesgIn, &mesgOut) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Create a pseudo terminal for the pipeline. */
- if (OpenMaster(execPtr) != TCL_OK) {
- goto error;
- }
- if (CreatePipe(execPtr->interp, &errIn, &errOut) != TCL_OK) {
- goto error;
- }
- execPtr->err.fd = execPtr->out.fd = execPtr->master;
-#ifdef notdef
- if ((execPtr->err.doneVar != NULL) || (execPtr->err.updateVar != NULL) ||
- (execPtr->err.cmdObjPtr != NULL) || (!execPtr->err.echo)) {
- /* If we want stderr separately, create a pipe for the error
- * channel. */
- execPtr->err.fd = errIn;
- }
-#endif
- child = fork();
- if (child > 0) {
- char mesg[BUFSIZ+1];
- ssize_t nRead;
- /*
- * Read back from the error pipe to see if the pipeline started up
- * properly. The info in the pipe (if any) if the Tcl error message
- * from the child process.
- */
- close(mesgOut);
- nRead = read(mesgIn, mesg, BUFSIZ);
- if (nRead == 0) {
- execPtr->sid = child;
- return TCL_OK;
- }
- close(mesgIn);
- mesg[nRead] = '\0';
- Tcl_AppendResult(execPtr->interp, mesg, (char *)NULL);
- error:
- if (mesgIn >= 0) {
- close(mesgIn);
- }
- if (mesgOut >= 0) {
- close(mesgOut);
- }
- if (errIn >= 0) {
- close(errIn);
- }
- if (errOut >= 0) {
- close(errOut);
- }
- return TCL_ERROR;
- }
- close(mesgIn);
- /* Open the slave side of the pseudo terminal for the pipeline. */
- /* The default descriptor for 0, 1, and 2 are now the pseudo terminal. */
- if (OpenSlave(execPtr) != TCL_OK) {
- fprintf(stderr, "OpenSlave: %s\n", Tcl_GetStringResult(execPtr->interp));
- return TCL_ERROR;
- }
- /* Always collect characters from the sinks. Display to the screen or
- * not. */
- nProcs = Blt_CreatePipeline(execPtr->interp, objc, objv, &pids,
- (int *)NULL, (int *)NULL, (int *)NULL);
- if (nProcs <= 0) {
- ssize_t nWritten;
- const char *mesg;
- int length;
-
- mesg = Tcl_GetStringFromObj(Tcl_GetObjResult(execPtr->interp), &length);
- fprintf(stderr, "child: %s\n", mesg);
- nWritten = write(mesgOut, mesg, length);
- _exit(1);
- }
- close(mesgOut); /* The pipeline has started. */
- *((int *)&waitStatus) = 0;
- *((int *)&lastStatus) = 0;
- while (nProcs > 0) {
- int pid;
-
- pid = waitpid(-1, (int *)&waitStatus, 0);
- if (pid < 0) {
- fprintf(stderr, "waitpid: %s\n", Tcl_PosixError(execPtr->interp));
- continue;
- }
- /*
- * Save the status information associated with the subprocess.
- * We'll use it only if this is the last subprocess to be reaped.
- */
- lastStatus = waitStatus;
- --nProcs;
- }
- /*
- * All pipeline processes have completed. Exit the child replicating the
- * exit code.
- */
- exit(WEXITSTATUS(lastStatus));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeBgexec --
- *
- * Releases the memory allocated for the backgrounded process.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeBgexec(Bgexec *execPtr)
-{
- Blt_FreeSwitches(switchSpecs, (char *)execPtr, 0);
- if (execPtr->link != NULL) {
- Tcl_MutexLock(mutexPtr);
- Blt_Chain_DeleteLink(activePipelines, execPtr->link);
- Tcl_MutexUnlock(mutexPtr);
- }
- Blt_Free(execPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * KillPipeline --
- *
- * Cleans up background execution processes and memory.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The memory allocated to the Bgexec structure released.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-KillPipeline(Bgexec *execPtr) /* Background info record. */
-{
- if (execPtr->sid > 0) {
- unsigned long pid;
- Tcl_Pid tclPid;
-
- if (execPtr->signalNum > 0) {
- kill(-execPtr->sid, execPtr->signalNum);
- }
- pid = (long)execPtr->sid;
- tclPid = (Tcl_Pid)pid;
- Tcl_DetachPids(1, &tclPid);
- } else if (execPtr->procIds != NULL) {
- int i;
-
- for (i = 0; i < execPtr->nProcs; i++) {
- Tcl_Pid tclPid;
- unsigned long pid;
-
- if (execPtr->signalNum > 0) {
- kill(execPtr->procIds[i], execPtr->signalNum);
- }
-
- pid = (long)execPtr->procIds[i];
- tclPid = (Tcl_Pid)pid;
- Tcl_DetachPids(1, &tclPid);
- }
- }
- Tcl_ReapDetachedProcs();
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyBgexec --
- *
- * Cleans up background execution processes and memory.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The memory allocated to the Bgexec structure released.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-DestroyBgexec(Bgexec *execPtr) /* Background info record. */
-{
- DisableTriggers(execPtr);
- FreeSinkBuffer(&execPtr->err);
- FreeSinkBuffer(&execPtr->out);
- KillPipeline(execPtr);
- FreeBgexec(execPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * VariableProc --
- *
- * Kills all currently running subprocesses (given the specified
- * signal). This procedure is called when the user sets the status
- * variable associated with this group of child subprocesses.
- *
- * Results:
- * Always returns NULL. Only called from a variable trace.
- *
- * Side effects:
- * The subprocesses are signaled for termination using the specified kill
- * signal. Additionally, any resources allocated to track the
- * subprocesses is released.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static char *
-VariableProc(
- ClientData clientData, /* File output information. */
- Tcl_Interp *interp, /* Not used. */
- const char *part1, /* Not used. */
- const char *part2, /* Not Used. */
- int flags)
-{
- if (flags & TRACE_FLAGS) {
- Bgexec *execPtr = clientData;
-
- /* Kill all child processes that remain alive. */
- KillPipeline(execPtr);
- execPtr->flags |= KILLED;
- }
- return NULL;
-}
-
-
-static int
-CheckPipeline(Bgexec *execPtr, Tcl_Obj **objPtrPtr)
-{
- enum PROCESS_STATUS {
- PROCESS_EXITED, PROCESS_STOPPED, PROCESS_KILLED, PROCESS_UNKNOWN
- } pcode;
- static const char *tokens[] = {
- "EXITED", "KILLED", "STOPPED", "UNKNOWN"
- };
- Tcl_Obj *listObjPtr, *objPtr;
- Tcl_Interp *interp;
- WAIT_STATUS_TYPE waitStatus, lastStatus;
- char string[200];
- const char *mesg;
- int code;
- int i;
- int nLeft; /* # of processes still not reaped */
- unsigned int lastPid;
-
- interp = execPtr->interp;
- lastPid = (unsigned int)-1;
- *((int *)&waitStatus) = 0;
- *((int *)&lastStatus) = 0;
-
- nLeft = 0;
- for (i = 0; i < execPtr->nProcs; i++) {
- int pid;
-
- pid = waitpid(execPtr->procIds[i], (int *)&waitStatus, WNOHANG);
- if (pid == 0) { /* Process has not terminated yet */
- if (nLeft < i) {
- execPtr->procIds[nLeft] = execPtr->procIds[i];
- }
- nLeft++; /* Count the # of processes left */
- } else if (pid != -1) {
- /*
- * Save the status information associated with the subprocess.
- * We'll use it only if this is the last subprocess to be reaped.
- */
- lastStatus = waitStatus;
- lastPid = (unsigned int)pid;
- }
- }
- execPtr->nProcs = nLeft;
- if ((nLeft > 0) || (SINKOPEN(&execPtr->out)) || (SINKOPEN(&execPtr->err))) {
- /* Keep polling for the status of the children that are left */
- execPtr->timerToken = Tcl_CreateTimerHandler(execPtr->interval, TimerProc,
- execPtr);
- return -1;
- }
-
- /*
- * All child processes have completed. Set the status variable with the
- * status of the last process reaped. The status is a list of an error
- * token, the exit status, and a message.
- */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- code = WEXITSTATUS(lastStatus);
- if (WIFEXITED(lastStatus)) {
- pcode = PROCESS_EXITED;
- } else if (WIFSIGNALED(lastStatus)) {
- pcode = PROCESS_KILLED;
- code = -1;
- } else if (WIFSTOPPED(lastStatus)) {
- pcode = PROCESS_STOPPED;
- code = -1;
- } else {
- pcode = PROCESS_UNKNOWN;
- }
- objPtr = Tcl_NewStringObj(tokens[pcode], -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewLongObj(lastPid);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- switch(pcode) {
- case PROCESS_EXITED:
- mesg = "child completed normally";
- break;
- case PROCESS_KILLED:
- mesg = Tcl_SignalMsg((int)(WTERMSIG(lastStatus)));
- break;
- case PROCESS_STOPPED:
- mesg = Tcl_SignalMsg((int)(WSTOPSIG(lastStatus)));
- break;
- case PROCESS_UNKNOWN:
- sprintf_s(string, 200, "child completed with unknown status 0x%x",
- *((int *)&lastStatus));
- mesg = string;
- break;
- }
- objPtr = Tcl_NewStringObj(mesg, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- if (execPtr->exitCodePtr != NULL) {
- *execPtr->exitCodePtr = code;
- }
- *objPtrPtr = listObjPtr;
- return code;
-}
-
-static int
-CheckSession(Bgexec *execPtr, Tcl_Obj **objPtrPtr)
-{
- enum PROCESS_STATUS {
- PROCESS_EXITED, PROCESS_STOPPED, PROCESS_KILLED, PROCESS_UNKNOWN
- } pcode;
- static const char *tokens[] = {
- "EXITED", "KILLED", "STOPPED", "UNKNOWN"
- };
- Tcl_Obj *listObjPtr, *objPtr;
- Tcl_Interp *interp;
- WAIT_STATUS_TYPE waitStatus;
- char string[200];
- const char *mesg;
- int code;
- int pid;
-
- interp = execPtr->interp;
- *((int *)&waitStatus) = 0;
- pid = waitpid(execPtr->sid, (int *)&waitStatus, WNOHANG);
- if (pid == 0) { /* Process has not terminated yet */
- /* Keep polling for the status of the children that are left */
- execPtr->timerToken = Tcl_CreateTimerHandler(execPtr->interval,
- TimerProc, execPtr);
- return -1;
- }
- /*
- * All child processes have completed. Set the status variable with the
- * status of the last process reaped. The status is a list of an error
- * token, the exit status, and a message.
- */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- code = WEXITSTATUS(waitStatus);
- if (WIFEXITED(waitStatus)) {
- pcode = PROCESS_EXITED;
- } else if (WIFSIGNALED(waitStatus)) {
- pcode = PROCESS_KILLED;
- code = -1;
- } else if (WIFSTOPPED(waitStatus)) {
- pcode = PROCESS_STOPPED;
- code = -1;
- } else {
- pcode = PROCESS_UNKNOWN;
- }
- objPtr = Tcl_NewStringObj(tokens[pcode], -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- objPtr = Tcl_NewLongObj(pid);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- switch(pcode) {
- case PROCESS_EXITED:
- mesg = "child completed normally";
- break;
- case PROCESS_KILLED:
- mesg = Tcl_SignalMsg((int)(WTERMSIG(waitStatus)));
- break;
- case PROCESS_STOPPED:
- mesg = Tcl_SignalMsg((int)(WSTOPSIG(waitStatus)));
- break;
- case PROCESS_UNKNOWN:
- sprintf_s(string, 200, "child completed with unknown status 0x%x",
- *((int *)&waitStatus));
- mesg = string;
- break;
- }
- objPtr = Tcl_NewStringObj(mesg, -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- *objPtrPtr = listObjPtr;
- return code;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TimerProc --
- *
- * This is a timer handler procedure which gets called periodically to
- * reap any of the sub-processes if they have terminated. After the last
- * process has terminated, the contents of standard output are stored in
- * the output variable, which triggers the cleanup proc (using a variable
- * trace). The status the last process to exit is written to the status
- * variable.
- *
- * Results:
- * None. Called from the TCL event loop.
- *
- * Side effects:
- * Many. The contents of procIds is shifted, leaving only those
- * sub-processes which have not yet terminated. If there are still
- * subprocesses left, this procedure is placed in the timer queue
- * again. Otherwise the output and possibly the status variables are
- * updated. The former triggers the cleanup routine which will destroy
- * the information and resources associated with these background
- * processes.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TimerProc(ClientData clientData)
-{
- Bgexec *execPtr = clientData;
- Tcl_Obj *resultObjPtr;
- int code;
-
- if (execPtr->sid > 0) {
- code = CheckSession(execPtr, &resultObjPtr);
- } else {
- code = CheckPipeline(execPtr, &resultObjPtr);
- }
- if (code < 0) {
- /* Keep polling for the status of the children that are left */
- return;
- }
- if (execPtr->exitCodePtr != NULL) {
- *execPtr->exitCodePtr = code;
- }
- DisableTriggers(execPtr);
- if (Tcl_SetVar2Ex(execPtr->interp, execPtr->statusVar, NULL, resultObjPtr,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- Tcl_BackgroundError(execPtr->interp);
- }
- if (execPtr->flags & DETACHED) {
- DestroyBgexec(execPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Stdoutproc --
- *
- * This procedure is called when output from the detached pipeline is
- * available. The output is read and saved in a buffer in the Bgexec
- * structure.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Data is stored in the buffer. This character array may be increased
- * as more space is required to contain the output of the pipeline.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-StdoutProc(ClientData clientData, int mask)
-{
- Bgexec *execPtr = clientData;
-
- if (CollectData(execPtr, &execPtr->out) == TCL_OK) {
- return;
- }
- /*
- * Either EOF or an error has occurred. In either case, close the
- * sink. Note that closing the sink will also remove the file handler, so
- * this routine will not be called again.
- */
- CloseSink(execPtr->interp, &execPtr->out);
-
- /*
- * If both sinks (stdout and stderr) are closed, this doesn't necessarily
- * mean that the process has terminated. Set up a timer handler to
- * periodically poll for the exit status of each process. Initially check
- * at the next idle interval.
- */
- if (!SINKOPEN(&execPtr->err)) {
- execPtr->timerToken = Tcl_CreateTimerHandler(0, TimerProc, clientData);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StderrProc --
- *
- * This procedure is called when error from the detached pipeline is
- * available. The error is read and saved in a buffer in the Bgexec
- * structure.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Data is stored in the buffer. This character array may be increased
- * as more space is required to contain the stderr of the pipeline.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-StderrProc(ClientData clientData, int mask)
-{
- Bgexec *execPtr = clientData;
-
- if (CollectData(execPtr, &execPtr->err) == TCL_OK) {
- return;
- }
- /*
- * Either EOF or an error has occurred. In either case, close the
- * sink. Note that closing the sink will also remove the file handler, so
- * this routine will not be called again.
- */
- CloseSink(execPtr->interp, &execPtr->err);
-
- /*
- * If both sinks (stdout and stderr) are closed, this doesn't necessarily
- * mean that the process has terminated. Set up a timer handler to
- * periodically poll for the exit status of each process. Initially check
- * at the next idle interval.
- */
- if (!SINKOPEN(&execPtr->out)) {
- execPtr->timerToken = Tcl_CreateTimerHandler(0, TimerProc, clientData);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BgexecCmd --
- *
- * This procedure is invoked to process the "ptyexec" TCL command. See
- * the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-BgexecCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* # of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- Bgexec *execPtr;
- ProcessId *pidPtr;
- char *lastArg;
- int *outFdPtr, *errFdPtr;
- int isDetached;
- int i;
- int nProcs;
-
- if (objc < 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " varName ?options? command ?arg...?\"",
- (char *)NULL);
- return TCL_ERROR;
- }
-
- /* Check if the command line is to be run detached (the last argument is
- * "&") */
- lastArg = Tcl_GetString(objv[objc - 1]);
- isDetached = ((lastArg[0] == '&') && (lastArg[1] == '\0'));
- if (isDetached) {
- objc--; /* Remove the '&' argument */
- }
- execPtr = Blt_AssertCalloc(1, sizeof(Bgexec));
- /* Initialize the background information record */
- execPtr->slave = execPtr->master = -1;
- execPtr->interp = interp;
- execPtr->signalNum = SIGHUP;
- execPtr->nProcs = -1;
- execPtr->interval = 1000;
- if (isDetached) {
- execPtr->flags |= DETACHED;
- }
- Tcl_MutexLock(mutexPtr);
- execPtr->link = Blt_Chain_Append(activePipelines, execPtr);
- Tcl_MutexUnlock(mutexPtr);
- execPtr->out.encoding = ENCODING_ASCII;
- execPtr->err.encoding = ENCODING_ASCII;
-
- /* Try to clean up any detached processes */
- Tcl_ReapDetachedProcs();
- i = Blt_ParseSwitches(interp, switchSpecs, objc - 1, objv + 1, execPtr,
- BLT_SWITCH_OBJV_PARTIAL);
- if (i < 0) {
- FreeBgexec(execPtr);
- return TCL_ERROR;
- }
- i += 1;
- /* Must be at least one argument left as the command to execute. */
- if (objc <= i) {
- Tcl_AppendResult(interp, "missing command to execute: should be \"",
- Tcl_GetString(objv[0]), " varName ?options? command ?arg...?\"",
- (char *)NULL);
- FreeBgexec(execPtr);
- return TCL_ERROR;
- }
- InitSink(execPtr, &execPtr->out, "stdout");
- InitSink(execPtr, &execPtr->err, "stderr");
- if (execPtr->statusVar == NULL) {
- static int count = 0;
- char string[200];
-
- count++;
- sprintf(string, "blt::ptyexecstatus%d", count);
- execPtr->statusVar = Blt_AssertStrdup(string);
- }
- /* Put a trace on the exit status variable. The will also allow the user
- * to terminate the pipeline by simply setting the variable. */
- Tcl_TraceVar(interp, execPtr->statusVar, TRACE_FLAGS, VariableProc,execPtr);
- execPtr->flags |= TRACED;
-
- if (ExecutePipeline(execPtr, objc - i, objv + i) != TCL_OK) {
- goto error;
- }
- if (CreateSinkHandler(execPtr, &execPtr->out, StdoutProc) != TCL_OK) {
- goto error;
- }
- if (execPtr->err.fd != execPtr->master) {
- /* Only create a sink for stderr if a separation of stdout and stderr
- * is requested. */
- if (CreateSinkHandler(execPtr, &execPtr->err, StderrProc) != TCL_OK) {
- goto error;
- }
- }
- if (isDetached) {
- /* If detached, return the process id of the session instead of the
- * output of the pipeline. */
- Tcl_SetLongObj(Tcl_GetObjResult(interp), execPtr->sid);
- } else {
- int exitCode;
- int done;
-
- execPtr->exitCodePtr = &exitCode;
- execPtr->donePtr = &done;
-
- exitCode = done = 0;
- while (!done) {
- Tcl_DoOneEvent(0);
- }
- DisableTriggers(execPtr);
- if ((execPtr->flags & IGNOREEXITCODE) || (exitCode == 0)) {
- if (execPtr->out.doneVar == NULL) {
- unsigned char *data;
- int length;
-
- /* Return the output of the pipeline. */
- GetSinkData(&execPtr->out, &data, &length);
- assert(length <= UINT_MAX);
-#if (_TCL_VERSION < _VERSION(8,1,0))
- data[length] = '\0';
- Tcl_SetObjResult(interp, Tcl_NewStringObj(data, length));
-#else
- Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(data, length));
-#endif
- }
- } else {
- DestroyBgexec(execPtr);
- Tcl_AppendResult(interp, "child process exited abnormally",
- (char *)NULL);
- return TCL_ERROR;
- }
- DestroyBgexec(execPtr);
- }
- return TCL_OK;
- error:
- DestroyBgexec(execPtr);
- return TCL_ERROR;
-}
-
-
-
-static void
-BgexecExitProc(ClientData clientData)
-{
- Blt_ChainLink link, next;
-
- Tcl_MutexLock(mutexPtr);
- for (link = Blt_Chain_FirstLink(activePipelines); link != NULL;
- link = next) {
- next = Blt_Chain_NextLink(link);
- Bgexec *execPtr;
-
- execPtr = Blt_Chain_GetValue(link);
- execPtr->link = NULL;
- KillPipeline(execPtr);
- }
- Blt_Chain_Destroy(activePipelines);
- Tcl_MutexUnlock(mutexPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_BgexecCmdInitProc --
- *
- * This procedure is invoked to initialize the "ptyexec" TCL command. See
- * the user documentation for details on what it does.
- *
- * Results:
- * None.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_PtyExecCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "ptyexec", BgexecCmd, };
-
- if (activePipelines == NULL) {
-#ifdef TCL_THREADS
- mutexPtr = Tcl_GetAllocMutex();
-#endif
- activePipelines = Blt_Chain_Create();
- Tcl_CreateExitHandler(BgexecExitProc, activePipelines);
- }
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-#endif /* NO_BGEXEC */
diff --git a/blt3.0.1/src/bltUnixBitmap.c b/blt3.0.1/src/bltUnixBitmap.c
deleted file mode 100644
index 9d74771..0000000
--- a/blt3.0.1/src/bltUnixBitmap.c
+++ /dev/null
@@ -1,674 +0,0 @@
-
-/*
- * bltUnixBitmap.c --
- *
- * This module implements X11-specific bitmap processing procedures for the
- * BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The color allocation routines are adapted from tkImgPhoto.c of the Tk
- * library distrubution. The photo image type was designed and implemented by
- * Paul Mackerras.
- *
- * Copyright (c) 1987-1993 The Regents of the University of
- * California.
- *
- * Copyright (c) 19941998 Sun Microsystems, Inc.
- *
- */
-
-#include "bltInt.h"
-#include "bltHash.h"
-#ifdef notdef
-#include "bltPicture.h"
-#endif
-#include <X11/Xutil.h>
-#if !defined(WIN32) && !defined(MAC_OSX_TCL)
-#include <X11/Xproto.h>
-#endif
-#include "bltBitmap.h"
-
-#define ROTATE_0 0
-#define ROTATE_90 1
-#define ROTATE_180 2
-#define ROTATE_270 3
-
-Pixmap
-Blt_PhotoImageMask(Tk_Window tkwin, Tk_PhotoImageBlock src)
-{
- Pixmap bitmap;
- int arraySize, bytes_per_line;
- int offset, count;
- int y;
- unsigned char *bits;
- unsigned char *dp;
-
- bytes_per_line = (src.width + 7) / 8;
- arraySize = src.height * bytes_per_line;
- bits = Blt_AssertMalloc(sizeof(unsigned char) * arraySize);
- dp = bits;
- offset = count = 0;
- for (y = 0; y < src.height; y++) {
- int value, bitMask;
- int x;
- unsigned char *sp;
-
- value = 0, bitMask = 1;
- sp = src.pixelPtr + offset;
- for (x = 0; x < src.width; /*empty*/ ) {
- unsigned long pixel;
-
- pixel = (sp[src.offset[3]] != 0x00);
- if (pixel) {
- value |= bitMask;
- } else {
- count++; /* Count the number of transparent pixels. */
- }
- bitMask <<= 1;
- x++;
- if (!(x & 7)) {
- *dp++ = (unsigned char)value;
- value = 0, bitMask = 1;
- }
- sp += src.pixelSize;
- }
- if (x & 7) {
- *dp++ = (unsigned char)value;
- }
- offset += src.pitch;
- }
- if (count > 0) {
- Tk_MakeWindowExist(tkwin);
- bitmap = XCreateBitmapFromData(Tk_Display(tkwin), Tk_WindowId(tkwin),
- (char *)bits, (unsigned int)src.width, (unsigned int)src.height);
- } else {
- bitmap = None; /* Image is opaque. */
- }
- Blt_Free(bits);
- return bitmap;
-}
-
-#ifdef notdef
-Pixmap
-Blt_PictureMask(Tk_Window tkwin, Picture *srcPtr)
-{
- Blt_Pixel *srcRowPtr;
- Pixmap bitmap;
- int bytesPerLine;
- int count;
- int x, y;
- unsigned char *bits;
- unsigned char *destRowPtr;
-
- bytesPerLine = (srcPtr->width + 7) / 8;
- bits = Blt_AssertMalloc(sizeof(unsigned char)*srcPtr->height*bytesPerLine);
- count = 0;
- srcRowPtr = srcPtr->bits;
- destRowPtr = bits;
- for (y = 0; y < srcPtr->height; y++) {
- int value, bitMask;
- Blt_Pixel *sp;
- unsigned char *dp;
-
- sp = srcRowPtr, dp = destRowPtr;
- value = 0, bitMask = 1;
- for (x = 0; x < srcPtr->width; /*empty*/ ) {
- unsigned long pixel;
-
- pixel = (sp->Alpha != ALPHA_TRANSPARENT);
- if (pixel) {
- value |= bitMask;
- } else {
- count++; /* Count the number of transparent pixels. */
- }
- bitMask <<= 1;
- x++;
- if (!(x & 7)) {
- *dp++ = (unsigned char)value;
- value = 0, bitMask = 1;
- }
- sp++;
- }
- if (x & 7) {
- *dp++ = (unsigned char)value;
- }
- srcRowPtr += srcPtr->pixelsPerRow;
- destRowPtr += bytesPerLine;
- }
- if (count > 0) {
- Tk_MakeWindowExist(tkwin);
- bitmap = XCreateBitmapFromData(Tk_Display(tkwin), Tk_WindowId(tkwin),
- (char *)bits, (unsigned int)srcPtr->width,
- (unsigned int)srcPtr->height);
- } else {
- bitmap = None; /* Image is opaque. */
- }
- Blt_Free(bits);
- return bitmap;
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RotateBitmap --
- *
- * Creates a new bitmap containing the rotated image of the given bitmap.
- * We also need a special GC of depth 1, so that we do not need to rotate
- * more than one plane of the bitmap.
- *
- * Results:
- * Returns a new bitmap containing the rotated image.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_RotateBitmap(
- Tk_Window tkwin,
- Pixmap srcBitmap, /* Source bitmap to be rotated */
- int srcWidth, int srcHeight, /* Width and height of the source bitmap */
- float angle, /* # of degrees to rotate the bitmap. */
- int *destWidthPtr,
- int *destHeightPtr)
-{
- Display *display; /* X display */
- GC bitmapGC;
- Pixmap destBitmap;
- Window root; /* Root window drawable */
- XImage *srcImgPtr, *destImgPtr;
- double rotWidth, rotHeight;
- int destWidth, destHeight;
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
-
- /* Create a bitmap and image big enough to contain the rotated text */
- Blt_GetBoundingBox(srcWidth, srcHeight, angle, &rotWidth, &rotHeight,
- (Point2d *)NULL);
- destWidth = ROUND(rotWidth);
- destHeight = ROUND(rotHeight);
- destBitmap = Tk_GetPixmap(display, root, destWidth, destHeight, 1);
- bitmapGC = Blt_GetBitmapGC(tkwin);
- XSetForeground(display, bitmapGC, 0x0);
- XFillRectangle(display, destBitmap, bitmapGC, 0, 0, destWidth, destHeight);
-
- srcImgPtr = XGetImage(display, srcBitmap, 0, 0, srcWidth, srcHeight, 1,
- ZPixmap);
- destImgPtr = XGetImage(display, destBitmap, 0, 0, destWidth, destHeight,
- 1, ZPixmap);
- angle = FMOD(angle, 360.0);
- if (FMOD(angle, (double)90.0) == 0.0) {
- int quadrant;
- int y;
-
- /* Handle right-angle rotations specifically */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- for (y = 0; y < destHeight; y++) {
- int x, sx;
-
- sx = y;
- for (x = 0; x < destWidth; x++) {
- int sy;
- unsigned long pixel;
-
- sy = destWidth - x - 1;
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- case ROTATE_180: /* 180 degrees */
- for (y = 0; y < destHeight; y++) {
- int x, sy;
-
- sy = destHeight - y - 1;
- for (x = 0; x < destWidth; x++) {
- int sx;
- unsigned long pixel;
-
- sx = destWidth - x - 1,
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- case ROTATE_90: /* 90 degrees */
- for (y = 0; y < destHeight; y++) {
- int x, sx;
-
- sx = destHeight - y - 1;
- for (x = 0; x < destWidth; x++) {
- int sy;
- unsigned long pixel;
-
- sy = x;
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- case ROTATE_0: /* 0 degrees */
- for (y = 0; y < destHeight; y++) {
- int x;
-
- for (x = 0; x < destWidth; x++) {
- unsigned long pixel;
-
- pixel = XGetPixel(srcImgPtr, x, y);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- default:
- /* The calling routine should never let this happen. */
- break;
- }
- } else {
- double radians, sinTheta, cosTheta;
- double sox, soy; /* Offset from the center of the source
- * rectangle. */
- double destCX, destCY; /* Offset to the center of the destination
- * rectangle. */
- int y;
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
-
- /* Coordinates of the centers of source and destination rectangles */
- sox = srcWidth * 0.5;
- soy = srcHeight * 0.5;
- destCX = destWidth * 0.5;
- destCY = destHeight * 0.5;
-
- /* For each pixel of the destination image, transform back to the
- * associated pixel in the source image. */
-
- for (y = 0; y < destHeight; y++) {
- double ty;
- int x;
-
- ty = y - destCY;
- for (x = 0; x < destWidth; x++) {
- double tx, rx, ry, sx, sy;
- unsigned long pixel;
-
- /* Translate origin to center of destination image. */
- tx = x - destCX;
-
- /* Rotate the coordinates about the origin. */
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source image. */
- rx += sox;
- ry += soy;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination image can be
- * bigger than the source.
- */
-
- if ((sx >= srcWidth) || (sx < 0) || (sy >= srcHeight) ||
- (sy < 0)) {
- continue;
- }
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- }
- /* Write the rotated image into the destination bitmap. */
- XPutImage(display, destBitmap, bitmapGC, destImgPtr, 0, 0, 0, 0,
- destWidth, destHeight);
-
- /* Clean up the temporary resources used. */
- XDestroyImage(srcImgPtr), XDestroyImage(destImgPtr);
- *destWidthPtr = destWidth;
- *destHeightPtr = destHeight;
- return destBitmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ScaleBitmap --
- *
- * Creates a new scaled bitmap from another bitmap. The new bitmap is
- * bounded by a specified region. Only this portion of the bitmap is
- * scaled from the original bitmap.
- *
- * By bounding scaling to a region we can generate a new bitmap which is
- * no bigger than the specified viewport.
- *
- * Results:
- * The new scaled bitmap is returned.
- *
- * Side Effects:
- * A new pixmap is allocated. The caller must release this.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_ScaleBitmap(
- Tk_Window tkwin,
- Pixmap srcBitmap,
- int srcWidth, int srcHeight,
- int destWidth, int destHeight)
-{
- Display *display;
- GC bitmapGC;
- Pixmap destBitmap;
- Window root;
- XImage *srcImgPtr, *destImgPtr;
- double xScale, yScale;
- int y; /* Destination bitmap coordinates */
-
- /* Create a new bitmap the size of the region and clear it */
-
- display = Tk_Display(tkwin);
-
- root = Tk_RootWindow(tkwin);
- destBitmap = Tk_GetPixmap(display, root, destWidth, destHeight, 1);
- bitmapGC = Blt_GetBitmapGC(tkwin);
- XSetForeground(display, bitmapGC, 0x0);
- XFillRectangle(display, destBitmap, bitmapGC, 0, 0, destWidth, destHeight);
-
- srcImgPtr = XGetImage(display, srcBitmap, 0, 0, srcWidth, srcHeight, 1,
- ZPixmap);
- destImgPtr = XGetImage(display, destBitmap, 0, 0, destWidth, destHeight,
- 1, ZPixmap);
-
- /*
- * Scale each pixel of destination image from results of source
- * image. Verify the coordinates, since the destination image can be
- * bigger than the source
- */
- xScale = (double)srcWidth / (double)destWidth;
- yScale = (double)srcHeight / (double)destHeight;
-
- /* Map each pixel in the destination image back to the source. */
- for (y = 0; y < destHeight; y++) {
- int x, sy;
-
- sy = (int)(yScale * (double)y);
- for (x = 0; x < destWidth; x++) {
- int sx;
- unsigned long pixel;
-
- sx = (int)(xScale * (double)x);
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- /* Write the scaled image into the destination bitmap */
-
- XPutImage(display, destBitmap, bitmapGC, destImgPtr, 0, 0, 0, 0,
- destWidth, destHeight);
- XDestroyImage(srcImgPtr), XDestroyImage(destImgPtr);
- return destBitmap;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RotateScaleBitmapArea --
- *
- * Creates a scaled and rotated bitmap from a given bitmap. The caller
- * also provides (offsets and dimensions) the region of interest in the
- * destination bitmap. This saves having to process the entire
- * destination bitmap is only part of it is showing in the viewport.
- *
- * This uses a simple rotation/scaling of each pixel in the destination
- * image. For each pixel, the corresponding pixel in the source bitmap
- * is used. This means that destination coordinates are first scaled to
- * the size of the rotated source bitmap. These coordinates are then
- * rotated back to their original orientation in the source.
- *
- * Results:
- * The new rotated and scaled bitmap is returned.
- *
- * Side Effects:
- * A new pixmap is allocated. The caller must release this.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_ScaleRotateBitmapArea(
- Tk_Window tkwin,
- Pixmap srcBitmap, /* Source bitmap. */
- unsigned int srcWidth,
- unsigned int srcHeight, /* Size of source bitmap */
- int regionX, int regionY, /* Offset of region in virtual destination
- * bitmap. */
- unsigned int regionWidth,
- unsigned int regionHeight, /* Desire size of bitmap region. */
- unsigned int destWidth,
- unsigned int destHeight, /* Virtual size of destination bitmap. */
- float angle) /* Angle to rotate bitmap. */
-{
- Display *display; /* X display */
- Window root; /* Root window drawable */
- Pixmap destBitmap;
- XImage *srcImgPtr, *destImgPtr;
- double xScale, yScale;
- double rotWidth, rotHeight;
- GC bitmapGC;
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
-
- /* Create a bitmap and image big enough to contain the rotated text */
- bitmapGC = Blt_GetBitmapGC(tkwin);
- destBitmap = Tk_GetPixmap(display, root, regionWidth, regionHeight, 1);
- XSetForeground(display, bitmapGC, 0x0);
- XFillRectangle(display, destBitmap, bitmapGC, 0, 0, regionWidth,
- regionHeight);
-
- srcImgPtr = XGetImage(display, srcBitmap, 0, 0, srcWidth, srcHeight, 1,
- ZPixmap);
- destImgPtr = XGetImage(display, destBitmap, 0, 0, regionWidth,
- regionHeight, 1, ZPixmap);
- angle = FMOD(angle, 360.0);
-
- Blt_GetBoundingBox(srcWidth, srcHeight, angle, &rotWidth, &rotHeight,
- (Point2d *)NULL);
-
- xScale = rotWidth / (double)destWidth;
- yScale = rotHeight / (double)destHeight;
-
- if (FMOD(angle, (double)90.0) == 0.0) {
- int quadrant;
- int x, y;
-
- /* Handle right-angle rotations specifically */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- for (y = 0; y < regionHeight; y++) {
- int sx;
-
- sx = (int)(yScale * (double)(y + regionY));
- for (x = 0; x < regionWidth; x++) {
- int sy;
- unsigned long pixel;
-
- sy = (int)(xScale *(double)(destWidth - (x + regionX) - 1));
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- case ROTATE_180: /* 180 degrees */
- for (y = 0; y < regionHeight; y++) {
- int sy;
-
- sy = (int)(yScale * (double)(destHeight - (y + regionY) - 1));
- for (x = 0; x < regionWidth; x++) {
- int sx;
- unsigned long pixel;
-
- sx = (int)(xScale *(double)(destWidth - (x + regionX) - 1));
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- case ROTATE_90: /* 90 degrees */
- for (y = 0; y < regionHeight; y++) {
- int sx;
-
- sx = (int)(yScale * (double)(destHeight - (y + regionY) - 1));
- for (x = 0; x < regionWidth; x++) {
- int sy;
- unsigned long pixel;
-
- sy = (int)(xScale * (double)(x + regionX));
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- case ROTATE_0: /* 0 degrees */
- for (y = 0; y < regionHeight; y++) {
- int sy;
-
- sy = (int)(yScale * (double)(y + regionY));
- for (x = 0; x < regionWidth; x++) {
- int sx;
- unsigned long pixel;
-
- sx = (int)(xScale * (double)(x + regionX));
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- break;
-
- default:
- /* The calling routine should never let this happen. */
- break;
- }
- } else {
- double radians, sinTheta, cosTheta;
- double sox, soy; /* Offset from the center of the source
- * rectangle. */
- double rox, roy; /* Offset to the center of the rotated
- * rectangle. */
- int x, y;
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
-
- /*
- * Coordinates of the centers of the source and destination rectangles
- */
- sox = srcWidth * 0.5;
- soy = srcHeight * 0.5;
- rox = rotWidth * 0.5;
- roy = rotHeight * 0.5;
-
- /* For each pixel of the destination image, transform back to the
- * associated pixel in the source image. */
-
- for (y = 0; y < regionHeight; y++) {
- double ty;
-
- ty = (yScale * (double)(y + regionY)) - roy;
- for (x = 0; x < regionWidth; x++) {
- double tx, rx, ry;
- int sx, sy;
- unsigned long pixel;
-
- /* Translate origin to center of destination image. */
- tx = (xScale * (double)(x + regionX)) - rox;
-
- /* Rotate the coordinates about the origin. */
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source image. */
- rx += sox;
- ry += soy;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination image can be
- * bigger than the source.
- */
-
- if ((sx >= srcWidth) || (sx < 0) || (sy >= srcHeight) ||
- (sy < 0)) {
- continue;
- }
- pixel = XGetPixel(srcImgPtr, sx, sy);
- if (pixel) {
- XPutPixel(destImgPtr, x, y, pixel);
- }
- }
- }
- }
- /* Write the rotated image into the destination bitmap. */
- XPutImage(display, destBitmap, bitmapGC, destImgPtr, 0, 0, 0, 0,
- regionWidth, regionHeight);
-
- /* Clean up the temporary resources used. */
- XDestroyImage(srcImgPtr), XDestroyImage(destImgPtr);
- return destBitmap;
-}
diff --git a/blt3.0.1/src/bltUnixDnd.c b/blt3.0.1/src/bltUnixDnd.c
deleted file mode 100644
index 61a9d5c..0000000
--- a/blt3.0.1/src/bltUnixDnd.c
+++ /dev/null
@@ -1,5110 +0,0 @@
-
-
-/*
- * bltUnixDnd.c --
- *
- * This module implements a drag-and-drop manager for the BLT Toolkit.
- * Allows widgets to be registered as drag&drop sources and targets
- * for handling "drag-and-drop" operations between Tcl/Tk
- * applications.
- *
- * Copyright 1995-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_DRAGDROP
-#include "bltOp.h"
-#include <bltHash.h>
-#include <bltChain.h>
-
-
-#include <X11/Xatom.h>
-#include <X11/Xproto.h>
-
-#define DND_THREAD_KEY "BLT Dnd Data"
-
-#define DND_SELECTED (1<<0)
-#define DND_INITIATED (1<<1)
-#define DND_ACTIVE (DND_SELECTED | DND_INITIATED)
-#define DND_IN_PACKAGE (1<<2) /* Indicates if a token package command is
- * currently active. The user may invoke
- * "update" or "tkwait" commands from within
- * the package command script. This allows the
- * "drag" operation to preempt itself. */
-#define DND_VOIDED (1<<3)
-#define DND_DELETED (1<<4)
-
-#define PACK(lo,hi) (((hi) << 16) | ((lo) & 0x0000FFFF))
-#define UNPACK(x,lo,hi) ((lo) = (x & 0x0000FFFF), (hi) = (x >> 16))
-
-#define WATCH_ENTER (1<<0)
-#define WATCH_LEAVE (1<<1)
-#define WATCH_MOTION (1<<2)
-#define WATCH_MASK (WATCH_ENTER | WATCH_LEAVE | WATCH_MOTION)
-
-/* Source-to-Target Message Types */
-
-#define ST_DRAG_ENTER 0x1001
-#define ST_DRAG_LEAVE 0x1002
-#define ST_DRAG_MOTION 0x1003
-#define ST_DROP 0x1004
-
-/* Target-to-Source Message Types */
-
-#define TS_DRAG_STATUS 0x1005
-#define TS_START_DROP 0x1006
-#define TS_DROP_RESULT 0x1007
-
-/* Indices of information fields in ClientMessage array. */
-
-#define MESG_TYPE 0 /* Message type. */
-#define MESG_WINDOW 1 /* Window id of remote. */
-#define MESG_TIMESTAMP 2 /* Transaction timestamp. */
-#define MESG_POINT 3 /* Root X-Y coordinate. */
-#define MESG_STATE 4 /* Button and key state. */
-#define MESG_RESPONSE 3 /* Response to drag/drop message. */
-#define MESG_FORMAT 3 /* Format atom. */
-#define MESG_PROPERTY 4 /* Index of button #/key state. */
-
-/* Drop Status Values (actions included) */
-
-#define DROP_CONTINUE -2
-#define DROP_FAIL -1
-#define DROP_CANCEL 0
-#define DROP_OK 1
-#define DROP_COPY 1
-#define DROP_LINK 2
-#define DROP_MOVE 3
-
-#define PROP_WATCH_FLAGS 0
-#define PROP_DATA_FORMATS 1
-#define PROP_MAX_SIZE 1000 /* Maximum size of property. */
-
-#define PROTO_BLT 0
-#define PROTO_XDND 1
-
-#define TOKEN_OFFSET 0
-#define TOKEN_REDRAW (1<<0)
-
-#define TOKEN_NORMAL 0
-#define TOKEN_REJECT -1
-#define TOKEN_ACTIVE 1
-#define TOKEN_TIMEOUT 5000 /* 5 second timeout for drop requests. */
-
-/*
- * Each widget representing a drag & drop target is tagged with
- * a "BltDndTarget" property in XA_STRING format. This property
- * identifies the window as a target. It's formated as a TCL list
- * and contains the following information:
- *
- * "flags DATA_TYPE DATA_TYPE ..."
- *
- * "INTERP_NAME TARGET_NAME WINDOW_ID DATA_TYPE DATA_TYPE ..."
- *
- * INTERP_NAME Name of the target application's interpreter.
- * TARGET_NAME Path name of widget registered as the drop target.
- * WINDOW_ID Window Id of the target's communication window.
- * Used to forward Enter/Leave/Motion event information
- * to the target.
- * DATA_TYPE One or more "types" handled by the target.
- *
- * When the user invokes the "drag" operation, the window hierarchy
- * is progressively examined. Window information is cached during
- * the operation, to minimize X server traffic. Windows carrying a
- * "BltDndTarget" property are identified. When the token is dropped
- * over a valid site, the drop information is sent to the application
- * via the usual "send" command. If communication fails, the drag&drop
- * facility automatically posts a rejection symbol on the token window.
- */
-
-/*
- * Drop Protocol:
- *
- * Source Target
- * ------ ------
- * ButtonRelease-? event.
- * Invokes blt::dnd drop
- * +
- * Send "drop" message to target (via
- * ClientMessage). Contains X-Y, key/ --> Gets "drop" message.
- * button state, source window XID. Invokes LeaveCmd proc.
- * Gets property from source of
- * ordered matching formats.
- * +
- * Invokes DropCmd proc. Arguments
- * are X-Y coordinate, key/button
- * state, transaction timestamp,
- * list of matching formats.
- * +
- * Target selects format and invokes
- * blt::dnd pull to transfer the data
- * in the selected format.
- * +
- * Sends "drop start" message to
- * source. Contains selected format
- * Gets "drop start" message. <-- (as atom), ?action?, target window
- * Invokes data handler for the ID, transaction timestamp.
- * selected format. +
- * + Waits for property to change on
- * Places first packet of data in its window. Time out set for
- * property on target window. --> no response.
- * + +
- * Waits for response property After each packet, sets zero-length
- * change. Time out set for no resp. <-- property on source window.
- * If non-zero length packet, error +
- * occurred, packet is error message. Sends "drop finished" message.
- * Contains transaction timestamp,
- * Gets "drop finished" message. <-- status, ?action?.
- * Invokes FinishCmd proc.
- */
-
-/* Configuration Parameters */
-
-#define DEF_DND_BUTTON_BACKGROUND RGB_YELLOW
-#define DEF_DND_BUTTON_BG_MONO STD_NORMAL_BG_MONO
-#define DEF_DND_BUTTON_NUMBER "3"
-#define DEF_DND_ENTER_COMMAND (char *)NULL
-#define DEF_DND_LEAVE_COMMAND (char *)NULL
-#define DEF_DND_MOTION_COMMAND (char *)NULL
-#define DEF_DND_DROP_COMMAND (char *)NULL
-#define DEF_DND_RESULT_COMMAND (char *)NULL
-#define DEF_DND_PACKAGE_COMMAND (char *)NULL
-#define DEF_DND_SELF_TARGET "no"
-#define DEF_DND_SEND (char *)NULL
-#define DEF_DND_IS_TARGET "no"
-#define DEF_DND_IS_SOURCE "no"
-#define DEF_DND_SITE_COMMAND (char *)NULL
-
-#define DEF_DND_DRAG_THRESHOLD "0"
-#define DEF_TOKEN_ACTIVE_BACKGROUND STD_ACTIVE_BACKGROUND
-#define DEF_TOKEN_ACTIVE_BG_MONO STD_ACTIVE_BG_MONO
-#define DEF_TOKEN_ACTIVE_BORDERWIDTH "3"
-#define DEF_TOKEN_ACTIVE_RELIEF "sunken"
-#define DEF_TOKEN_ANCHOR "se"
-#define DEF_TOKEN_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_TOKEN_BG_MONO STD_NORMAL_BG_MONO
-#define DEF_TOKEN_BORDERWIDTH "3"
-#define DEF_TOKEN_CURSOR "top_left_arrow"
-#define DEF_TOKEN_REJECT_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_TOKEN_REJECT_BG_MONO RGB_WHITE
-#define DEF_TOKEN_REJECT_FOREGROUND RGB_RED
-#define DEF_TOKEN_REJECT_FG_MONO RGB_BLACK
-#define DEF_TOKEN_REJECT_STIPPLE_COLOR (char *)NULL
-#define DEF_TOKEN_REJECT_STIPPLE_MONO RGB_GREY50
-#define DEF_TOKEN_RELIEF "raised"
-
-static Blt_OptionFreeProc FreeCursors;
-static Blt_OptionParseProc ObjToCursors;
-static Blt_OptionPrintProc CursorsToObj;
-static Blt_CustomOption cursorsOption =
-{
- ObjToCursors, CursorsToObj, FreeCursors, (ClientData)0
-};
-
-typedef struct {
- Blt_HashTable dndTable; /* Hash table of dnd structures keyed by
- * the address of the reference Tk window */
- Tk_Window tkMain;
- Display *display;
- Atom mesgAtom; /* Atom signifying a drag-and-drop message. */
- Atom formatsAtom; /* Source formats property atom. */
- Atom targetAtom; /* Target property atom. */
- Atom commAtom; /* Communication property atom. */
-
-#ifdef HAVE_XDND
- Blt_HashTable handlerTable; /* Table of toplevel windows with XdndAware
- * properties attached to them. */
- Atom XdndActionListAtom;
- Atom XdndAwareAtom;
- Atom XdndEnterAtom;
- Atom XdndFinishedAtom;
- Atom XdndLeaveAtom;
- Atom XdndPositionAtom;
- Atom XdndSelectionAtom;
- Atom XdndStatusAtom;
- Atom XdndTypeListAtom;
-
- Atom XdndActionCopyAtom;
- Atom XdndActionMoveAtom;
- Atom XdndActionLinkAtom;
- Atom XdndActionAskAtom;
- Atom XdndActionPrivateAtom;
- Atom XdndActionDescriptionAtom;
-#endif
-} DndInterpData;
-
-
-typedef struct {
- Tcl_DString dString;
- Window window; /* Source/Target window */
- Display *display;
- Atom commAtom; /* Data communication property atom. */
- int packetSize;
- Tcl_TimerToken timerToken;
- int status; /* Status of transaction: CONTINUE, OK, FAIL,
- * or TIMEOUT. */
- int timestamp; /* Timestamp of the transaction. */
- int offset;
- int protocol; /* Drag-and-drop protocol used by the source:
- * either PROTO_BLT or PROTO_XDND. */
-} DropPending;
-
-/*
- * SubstDescriptors --
- *
- * Structure to hold letter-value pairs for percent substitutions.
- */
-typedef struct {
- char letter; /* character like 'x' in "%x" */
- const char *value; /* value to be substituted in place of "%x" */
-} SubstDescriptors;
-
-/*
- * Drag&Drop Registration Data
- */
-typedef struct {
- Tk_Window tkwin; /* Window that embodies the token. NULL
- * means that the window has been destroyed
- * but the data structures haven't yet been
- * cleaned up. */
-
- Display *display; /* Display containing widget. Used, among
- * other things, so that resources can be
- * freed even after tkwin has gone away. */
- Tcl_Interp *interp; /* Interpreter associated with widget. Used
- * to delete widget command. */
- Tk_3DBorder border; /* Structure used to draw 3-D border and
- * background. NULL means no background
- * or border. */
- int borderWidth; /* Width of 3-D border (if any). */
- int relief; /* 3-d effect: TK_RELIEF_RAISED etc. */
-
- int flags; /* Various flags; see below for
- * definitions. */
-
- /* Token specific fields */
- int x, y; /* Last position of token window */
- int startX, startY;
-
- int status; /* Indicates the current status of the token:
- * 0 is normal, 1 is active. */
- int lastStatus; /* Indicates the last status of the token. */
- Tcl_TimerToken timerToken; /* Token for routine to hide tokenwin */
- GC fillGC; /* GC used to draw rejection fg: (\) */
- GC outlineGC; /* GC used to draw rejection bg: (\) */
- int width, height;
-
- /* User-configurable fields */
-
- Tk_Anchor anchor; /* Position of token win relative to mouse */
- Tk_3DBorder normalBorder; /* Border/background for token window */
- Tk_3DBorder activeBorder; /* Border/background for token window */
- int activeRelief;
- int activeBW; /* Border width in pixels */
- XColor *fillColor; /* Color used to draw rejection fg: (\) */
- XColor *outlineColor; /* Color used to draw rejection bg: (\) */
- Pixmap rejectStipple; /* Stipple used to draw rejection: (\) */
- int reqWidth, reqHeight;
-
- int nSteps;
-
-} Token;
-
-/*
- * Winfo --
- *
- * This structure represents a window hierarchy examined during a single
- * "drag" operation. It's used to cache information to reduce the round
- * trip calls to the server needed to query window geometry information
- * and grab the target property.
- */
-typedef struct _Winfo {
- Window window; /* Window in hierarchy. */
-
- int initialized; /* If zero, the rest of this structure's
- * information hasn't been set. */
-
- int x1, y1, x2, y2; /* Extents of the window (upper-left and
- * lower-right corners). */
-
- struct _Winfo *parentPtr; /* Parent node. NULL if root. Used to
- * compute offset for X11 windows. */
-
- Blt_Chain chain; /* List of this window's children. If NULL,
- * there are no children. */
-
- int isTarget; /* Indicates if this window is a drag&drop
- * target. */
- int lookedForProperty; /* Indicates if this window */
-
- int eventFlags; /* Retrieved from the target's drag&drop
- * property, indicates what kinds of pointer
- * events should be relayed to the target via
- * ClientMessages. Possible values are OR-ed
- * combinations of the following bits:
- * 001 Enter events.
- * 010 Motion events.
- * 100 Leave events.
- */
- const char *matches;
-
-} Winfo;
-
-/*
- * Dnd --
- *
- * This structure represents the drag&drop manager. It is associated
- * with a widget as a drag&drop source, target, or both. It contains
- * both the source and target components, since a widget can be both
- * a drag source and a drop target.
- */
-typedef struct {
- Tcl_Interp *interp; /* Interpreter associated with the drag&drop
- * manager. */
-
- Tk_Window tkwin; /* Tk window representing the drag&drop
- * manager (can be source and/or target). */
-
- Display *display; /* Display for drag&drop widget. Saved to free
- * resources after window has been destroyed. */
-
- int isSource; /* Indicates if this drag&drop manager can act
- * as a drag source. */
- int isTarget; /* Indicates if this drag&drop manager can act
- * as a drop target. */
-
- int targetPropertyExists; /* Indicates is the drop target property has
- * been set. */
-
- unsigned int flags; /* Various flags; see below for
- * definitions. */
- int timestamp; /* Id of the current drag&drop transaction. */
-
- int x, y; /* Last known location of the mouse pointer. */
-
- Blt_HashEntry *hashPtr;
-
- DndInterpData *dataPtr;
-
- /* Source component. */
-
- Blt_HashTable getDataTable; /* Table of data handlers (converters)
- * registered for this source. */
-
- int reqButton; /* Button used to invoke drag operation. */
-
- int button; /* Last button press detected. */
- int keyState; /* Last key state. */
-
- Tk_Cursor cursor; /* Cursor restored after dragging */
-
- int selfTarget; /* Indicated if the source should drop onto
- * itself. */
-
- const char **reqFormats; /* List of requested data formats. The
- * list should be ordered with the more
- * desireable formats first. You can also
- * temporarily turn off a source by setting
- * the value to the empty string. */
-
- Winfo *rootPtr; /* Cached window information: Gathered
- * and used during the "drag" operation
- * to see if the mouse pointer is over a
- * valid target. */
-
- Winfo *windowPtr; /* Points to information about the last
- * target the pointer was over. If NULL,
- * the pointer was not over a valid target. */
-
- const char **packageCmd; /* TCL command executed at start of the drag
- * operation to initialize token. */
-
- const char **resultCmd; /* TCL command executed at the end of the
- * "drop" operation to indicate its status. */
-
- const char **siteCmd; /* TCL command executed to update token
- * window. */
-
- Token *tokenPtr; /* Token used to provide special cursor. */
-
-
- Tcl_TimerToken timerToken;
-
- Tk_Cursor *cursors; /* Array of drag-and-drop cursors. */
- int cursorPos;
-
- int dragStart; /* Minimum number of pixels movement
- * before B1-Motion is considered to
- * start dragging. */
-
- /* Target component. */
-
- Blt_HashTable setDataTable; /* Table of data handlers (converters)
- * registered for this target. */
- const char **enterCmd; /* TCL proc called when the mouse enters the
- * target. */
- const char **leaveCmd; /* TCL proc called when the mouse leaves the
- * target. */
- const char **motionCmd; /* TCL proc called when the mouse is moved
- * over the target. */
- const char **dropCmd; /* TCL proc called when the mouse button
- * is released over the target. */
-
- const char *matchingFormats; /* */
- int lastId; /* The last transaction id used. This is used
- * to cache the above formats string. */
-
- DropPending *pendingPtr; /* Points to structure containing information
- * about a current drop in progress. If NULL,
- * no drop is in progress. */
-
- short int dropX, dropY; /* Location of the current drop. */
- short int dragX, dragY; /* Starting position of token window */
-} Dnd;
-
-
-typedef struct {
- Tk_Window tkwin; /* Toplevel window of the drop target. */
- int refCount; /* # of targets referencing this structure. */
- Dnd *dndPtr; /* Last drop target selected. Used the
- * implement Enter/Leave events for targets.
- * If NULL, indicates that no drop target was
- * previously selected. */
- int lastRepsonse; /* Indicates what the last response was. */
- Window window; /* Window id of the top-level window (ie.
- * the wrapper). */
- const char **formatArr; /* List of formats available from source.
- * Must be pruned down to matching list. */
- DndInterpData *dataPtr;
- int x, y;
-
-} XDndHandler;
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_LIST, "-allowformats", "allowFormats", "AllowFormats",
- DEF_DND_SEND, Blt_Offset(Dnd, reqFormats), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_INT, "-button", "buttonNumber", "ButtonNumber",
- DEF_DND_BUTTON_NUMBER, Blt_Offset(Dnd, reqButton), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-dragthreshold", "dragThreshold", "DragThreshold",
- DEF_DND_DRAG_THRESHOLD, Blt_Offset(Dnd, dragStart), 0},
- {BLT_CONFIG_CUSTOM, "-cursors", "cursors", "cursors", DEF_TOKEN_CURSOR,
- Blt_Offset(Dnd, cursors), BLT_CONFIG_NULL_OK, &cursorsOption },
- {BLT_CONFIG_LIST, "-onenter", "onEnter", "OnEnter", DEF_DND_ENTER_COMMAND,
- Blt_Offset(Dnd, enterCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_LIST, "-onmotion", "onMotion", "OnMotion",
- DEF_DND_MOTION_COMMAND, Blt_Offset(Dnd, motionCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_LIST, "-onleave", "onLeave", "OnLeave", DEF_DND_LEAVE_COMMAND,
- Blt_Offset(Dnd, leaveCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_LIST, "-ondrop", "onDrop", "OnDrop", DEF_DND_DROP_COMMAND,
- Blt_Offset(Dnd, dropCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_LIST, "-package", "packageCommand", "PackageCommand",
- DEF_DND_PACKAGE_COMMAND, Blt_Offset(Dnd, packageCmd),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_LIST, "-result", "result", "Result", DEF_DND_RESULT_COMMAND,
- Blt_Offset(Dnd, resultCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BOOLEAN, "-selftarget", "selfTarget", "SelfTarget",
- DEF_DND_SELF_TARGET, Blt_Offset(Dnd, selfTarget), 0},
- {BLT_CONFIG_LIST, "-site", "siteCommand", "Command", DEF_DND_SITE_COMMAND,
- Blt_Offset(Dnd, siteCmd), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BOOLEAN, "-source", "source", "Source", DEF_DND_IS_SOURCE,
- Blt_Offset(Dnd, isSource), 0},
- {BLT_CONFIG_BOOLEAN, "-target", "target", "Target", DEF_DND_IS_TARGET,
- Blt_Offset(Dnd, isTarget), 0},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0},
-};
-
-static Blt_ConfigSpec tokenConfigSpecs[] =
-{
- {BLT_CONFIG_BORDER, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_TOKEN_ACTIVE_BACKGROUND,
- Blt_Offset(Token, activeBorder), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_BORDER, "-activebackground", "activeBackground",
- "ActiveBackground", DEF_TOKEN_ACTIVE_BG_MONO,
- Blt_Offset(Token, activeBorder), BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_RELIEF, "-activerelief", "activeRelief", "activeRelief",
- DEF_TOKEN_ACTIVE_RELIEF, Blt_Offset(Token, activeRelief), 0},
- {BLT_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor",
- DEF_TOKEN_ANCHOR, Blt_Offset(Token, anchor), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-activeborderwidth", "activeBorderWidth",
- "ActiveBorderWidth", DEF_TOKEN_ACTIVE_BORDERWIDTH,
- Blt_Offset(Token, activeBW), 0},
- {BLT_CONFIG_BORDER, "-background", "background", "Background",
- DEF_TOKEN_BACKGROUND, Blt_Offset(Token, normalBorder),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_BORDER, "-background", "background", "Background",
- DEF_TOKEN_BG_MONO, Blt_Offset(Token, normalBorder),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_TOKEN_BORDERWIDTH, Blt_Offset(Token, borderWidth), 0},
- {BLT_CONFIG_COLOR, "-outline", "outline", "Outline",
- DEF_TOKEN_REJECT_BACKGROUND, Blt_Offset(Token, outlineColor),
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-outline", "outline", "Outline",
- DEF_TOKEN_REJECT_BG_MONO, Blt_Offset(Token, outlineColor),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-fill", "fill", "Fill", DEF_TOKEN_REJECT_FOREGROUND,
- Blt_Offset(Token, fillColor), BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-fill", "fill", "Fill", DEF_TOKEN_REJECT_BACKGROUND,
- Blt_Offset(Token, fillColor), BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_BITMAP, "-rejectstipple", "rejectStipple", "Stipple",
- DEF_TOKEN_REJECT_STIPPLE_COLOR, Blt_Offset(Token, rejectStipple),
- BLT_CONFIG_COLOR_ONLY | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BITMAP, "-rejectstipple", "rejectStipple", "Stipple",
- DEF_TOKEN_REJECT_STIPPLE_MONO, Blt_Offset(Token, rejectStipple),
- BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_TOKEN_RELIEF,
- Blt_Offset(Token, relief), 0},
- {BLT_CONFIG_INT, "-width", "width", "Width", (char *)NULL,
- Blt_Offset(Token, reqWidth), 0},
- {BLT_CONFIG_INT, "-height", "height", "Height", (char *)NULL,
- Blt_Offset(Token, reqHeight), 0},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL,
- 0, 0},
-};
-
-/*
- * Forward Declarations
- */
-
-static Tcl_ObjCmdProc DndCmd;
-static Tcl_FreeProc DestroyDnd;
-static Tk_GenericProc DndEventProc;
-static Tk_EventProc TokenEventProc;
-static Tcl_IdleProc DisplayToken;
-
-static Winfo *InitRoot (Dnd *dndPtr);
-static Winfo *OverTarget (Dnd *dndPtr);
-static int ConfigureToken (Tcl_Interp *interp, Dnd *dndPtr, int objc,
- Tcl_Obj *const *objv, int flags);
-static int GetDndFromObj (ClientData clientData, Tcl_Interp *interp,
- Tcl_Obj *objPtr, Dnd **dndPtrPtr);
-static void AddTargetProperty (Dnd *dndPtr);
-static void CancelDrag (Dnd *dndPtr);
-static void DrawRejectSymbol (Dnd *dndPtr);
-static void FreeWinfo (Winfo *wr);
-static void GetWinfo (Display *display, Winfo * windowPtr);
-static void HideToken (Dnd *dndPtr);
-static void MoveToken (Dnd *dndPtr);
-static Dnd *CreateDnd (Tcl_Interp *interp, Tk_Window tkwin);
-
-/*ARGSUSED*/
-static void
-FreeCursors(
- ClientData clientData, /* Not used. */
- Display *display,
- char *widgRec,
- int offset)
-{
- Tk_Cursor **cursorsPtr = (Tk_Cursor **)(widgRec + offset);
-
- if (*cursorsPtr != NULL) {
- Tk_Cursor *cp;
-
- for (cp = *cursorsPtr; *cp != None; cp++) {
- Tk_FreeCursor(display, *cp);
- }
- Blt_Free(*cursorsPtr);
- *cursorsPtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToCursors --
- *
- * Converts the resize mode into its numeric representation. Valid
- * mode strings are "none", "expand", "shrink", or "both".
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToCursors(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representing cursors. */
- char *widgRec, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- int objc;
- Tcl_Obj **objv;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc > 0) {
- Tk_Cursor **cursorsPtr = (Tk_Cursor **)(widgRec + offset);
- Tk_Cursor *cursors;
- int i;
-
- cursors = Blt_AssertCalloc(objc + 1, sizeof(Tk_Cursor));
- for (i = 0; i < objc; i++) {
- cursors[i] = Tk_AllocCursorFromObj(interp, tkwin, objv[i]);
- if (cursors[i] == None) {
- Tk_Cursor *cp;
-
- for (cp = cursors; *cp != None; cp++) {
- Tk_FreeCursor(Tk_Display(tkwin), *cp);
- }
- return TCL_ERROR;
- }
- }
- *cursorsPtr = cursors;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CursorsToObj --
- *
- * Returns resize mode string based upon the resize flags.
- *
- * Results:
- * The resize mode string is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-CursorsToObj(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Cursor record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tk_Cursor *cursors = *(Tk_Cursor **)(widgRec + offset);
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (cursors != NULL) {
- Tcl_Obj *objPtr;
- Tk_Cursor *cp;
-
- for (cp = cursors; *cp != NULL; cp++) {
- objPtr = Tcl_NewStringObj(Tk_NameOfCursor(Tk_Display(tkwin), *cp),
- -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- }
- return listObjPtr;
-}
-
-
-static Tcl_Obj *
-PrintList(Tcl_Interp *interp, const char **list)
-{
- Tcl_Obj *listObjPtr;
- const char **p;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for(p = list; *p != NULL; p++) {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewStringObj(*p, -1));
- }
- return listObjPtr;
-}
-
-
-/* ARGSUSED */
-static int
-XSendEventErrorProc(
- ClientData clientData,
- XErrorEvent *errEventPtr)
-{
- int *errorPtr = clientData;
-
- *errorPtr = TCL_ERROR;
- return 0;
-}
-
-static void
-SendClientMsg(
- Display *display,
- Window window,
- Atom mesgAtom,
- int data0, int data1, int data2, int data3, int data4)
-{
- XEvent event;
- Tk_ErrorHandler handler;
- int result;
- int any = -1;
-
- event.xclient.type = ClientMessage;
- event.xclient.serial = 0;
- event.xclient.send_event = True;
- event.xclient.display = display;
- event.xclient.window = window;
- event.xclient.message_type = mesgAtom;
- event.xclient.format = 32;
- event.xclient.data.l[0] = data0;
- event.xclient.data.l[1] = data1;
- event.xclient.data.l[2] = data2;
- event.xclient.data.l[3] = data3;
- event.xclient.data.l[4] = data4;
-
- result = TCL_OK;
- handler = Tk_CreateErrorHandler(display, any, X_SendEvent, any,
- XSendEventErrorProc, &result);
- if (!XSendEvent(display, window, False, ClientMessage, &event)) {
- result = TCL_ERROR;
- }
- Tk_DeleteErrorHandler(handler);
- XSync(display, False);
- if (result != TCL_OK) {
- fprintf(stderr, "XSendEvent response to drop: Protocol failed\n");
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetWindowZOrder --
- *
- * Returns a chain of the child windows according to their stacking
- * order. The window ids are ordered from top to bottom.
- *
- * ------------------------------------------------------------------------
- */
-static Blt_Chain
-GetWindowZOrder(Display *display, Window window)
-{
- Blt_Chain chain;
- Window *winv;
- unsigned int winc;
- Window dummy;
-
- chain = NULL;
- if ((XQueryTree(display, window, &dummy, &dummy, &winv, &winc)) &&
- (winc > 0)) {
- unsigned int i;
-
- chain = Blt_Chain_Create();
- for (i = 0; i < winc; i++) {
- /*
- * XQuery returns windows in bottom to top order. We only care
- * about the top window.
- */
- Blt_Chain_Prepend(chain, (ClientData)winv[i]);
- }
- if (winv != NULL) {
- XFree((char *)winv); /* done with list of kids */
- }
- }
- return chain;
-}
-
-static int
-GetMaxPropertySize(Display *display)
-{
- int size;
-
- size = Blt_MaxRequestSize(display, sizeof(char));
- size -= 32;
- return size;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetProperty --
- *
- * Returns the data associated with the named property on the
- * given window. All data is assumed to be 8-bit string data.
- *
- * ------------------------------------------------------------------------
- */
-static unsigned char *
-GetProperty(Display *display, Window window, Atom atom)
-{
- unsigned char *data;
- int result, format;
- Atom typeAtom;
- unsigned long nItems, bytesAfter;
-
- if (window == None) {
- return NULL;
- }
- data = NULL;
- result = XGetWindowProperty(
- display, /* Display of window. */
- window, /* Window holding the property. */
- atom, /* Name of property. */
- 0, /* Offset of data (for multiple reads). */
- GetMaxPropertySize(display), /* Maximum number of items to read. */
- False, /* If true, delete the property. */
- XA_STRING, /* Desired type of property. */
- &typeAtom, /* (out) Actual type of the property. */
- &format, /* (out) Actual format of the property. */
- &nItems, /* (out) # of items in specified format. */
- &bytesAfter, /* (out) # of bytes remaining to be read. */
- &data);
- if ((result != Success) || (format != 8) || (typeAtom != XA_STRING)) {
- if (data != NULL) {
- XFree((char *)data);
- data = NULL;
- }
- }
- return data;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetProperty --
- *
- * Associates the given data with the a property on a given window.
- * All data is assumed to be 8-bit string data.
- *
- * ------------------------------------------------------------------------
- */
-static void
-SetProperty(Tk_Window tkwin, Atom atom, const char *data)
-{
- XChangeProperty(Tk_Display(tkwin), Tk_WindowId(tkwin), atom, XA_STRING,
- 8, PropModeReplace, (unsigned char *)data, strlen(data) + 1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetWindowArea --
- *
- * Queries for the upper-left and lower-right corners of the
- * given window.
- *
- * Results:
- * Returns if the window is currently viewable. The coordinates
- * of the window are returned via parameters.
- *
- * ------------------------------------------------------------------------
- */
-static int
-GetWindowArea(Display *display, Winfo *windowPtr)
-{
- XWindowAttributes winAttrs;
-
- if (XGetWindowAttributes(display, windowPtr->window, &winAttrs)) {
- windowPtr->x1 = winAttrs.x;
- windowPtr->y1 = winAttrs.y;
- windowPtr->x2 = winAttrs.x + winAttrs.width - 1;
- windowPtr->y2 = winAttrs.y + winAttrs.height - 1;
- }
- return (winAttrs.map_state == IsViewable);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindTopWindow --
- *
- * Searches for the topmost window at a given pair of X-Y coordinates.
- *
- * Results:
- * Returns a pointer to the node representing the window containing
- * the point. If one can't be found, NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Winfo *
-FindTopWindow(Dnd *dndPtr, int x, int y)
-{
- Winfo *rootPtr;
- Blt_ChainLink link;
- Winfo *windowPtr;
-
- rootPtr = dndPtr->rootPtr;
- if (!rootPtr->initialized) {
- GetWinfo(dndPtr->display, rootPtr);
- }
- if ((x < rootPtr->x1) || (x > rootPtr->x2) ||
- (y < rootPtr->y1) || (y > rootPtr->y2)) {
- return NULL; /* Point is not over window */
- }
- windowPtr = rootPtr;
-
- /*
- * The window list is ordered top to bottom, so stop when we find the
- * first child that contains the X-Y coordinate. It will be the topmost
- * window in that hierarchy. If none exists, then we already have the
- * topmost window.
- */
- descend:
- for (link = Blt_Chain_FirstLink(rootPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- rootPtr = Blt_Chain_GetValue(link);
- if (!rootPtr->initialized) {
- GetWinfo(dndPtr->display, rootPtr);
- }
- if (rootPtr->window == Blt_GetWindowId(dndPtr->tokenPtr->tkwin)) {
- continue; /* Don't examine the token window. */
- }
- if ((x >= rootPtr->x1) && (x <= rootPtr->x2) &&
- (y >= rootPtr->y1) && (y <= rootPtr->y2)) {
- /*
- * Remember the last window containing the pointer and descend
- * into its window hierarchy. We'll look for a child that also
- * contains the pointer.
- */
- windowPtr = rootPtr;
- goto descend;
- }
- }
- return windowPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetWidgetCursor --
- *
- * Queries a widget for its current cursor. The given window
- * may or may not be a Tk widget that has a -cursor option.
- *
- * Results:
- * Returns the current cursor of the widget.
- *
- * ------------------------------------------------------------------------
- */
-static Tk_Cursor
-GetWidgetCursor(
- Tcl_Interp *interp, /* Interpreter to evaluate widget command. */
- Tk_Window tkwin) /* Window of drag&drop source. */
-{
- Tk_Cursor cursor;
- Tcl_DString dString, savedResult;
-
- cursor = None;
- Tcl_DStringInit(&dString);
- Blt_DStringAppendElements(&dString, Tk_PathName(tkwin), "cget", "-cursor",
- (char *)NULL);
- Tcl_DStringInit(&savedResult);
- Tcl_DStringGetResult(interp, &savedResult);
- if (Tcl_GlobalEval(interp, Tcl_DStringValue(&dString)) == TCL_OK) {
- const char *name;
-
- name = Tcl_GetStringResult(interp);
- if ((name != NULL) && (name[0] != '\0')) {
- cursor = Tk_GetCursor(interp, tkwin, Tk_GetUid(name));
- }
- }
- Tcl_DStringResult(interp, &savedResult);
- Tcl_DStringFree(&dString);
- return cursor;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NameOfStatus --
- *
- * Converts a numeric drop result into its string representation.
- *
- * Results:
- * Returns a static string representing the drop result.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-NameOfStatus(int status)
-{
- switch (status) {
- case DROP_OK:
- return "active";
- case DROP_CONTINUE:
- return "normal";
- case DROP_FAIL:
- return "reject";
- case DROP_CANCEL:
- return "cancel";
- default:
- return "unknown status value";
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NameOfAction --
- *
- * Converts a numeric drop result into its string representation.
- *
- * Results:
- * Returns a static string representing the drop result.
- *
- *---------------------------------------------------------------------------
- */
-static const char *
-NameOfAction(int action)
-{
- switch (action) {
- case DROP_COPY:
- return "copy";
- case DROP_CANCEL:
- return "cancel";
- case DROP_MOVE:
- return "move";
- break;
- case DROP_LINK:
- return "link";
- case DROP_FAIL:
- return "fail";
- default:
- return "unknown action";
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetAction --
- *
- * Converts a string to its numeric drop result value.
- *
- * Results:
- * Returns the drop result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetAction(const char *string)
-{
- char c;
-
- c = string[0];
- if ((c == 'c') && (strcmp(string, "cancel") == 0)) {
- return DROP_CANCEL;
- } else if ((c == 'f') && (strcmp(string, "fail") == 0)) {
- return DROP_FAIL;
- } else if ((c == 'm') && (strcmp(string, "move") == 0)) {
- return DROP_MOVE;
- } else if ((c == 'l') && (strcmp(string, "link") == 0)) {
- return DROP_LINK;
- } else if ((c == 'c') && (strcmp(string, "copy") == 0)) {
- return DROP_COPY;
- } else {
- return DROP_COPY;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetDragResult --
- *
- * Converts a string to its numeric drag result value.
- *
- * Results:
- * Returns the drag result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetDragResult(Tcl_Interp *interp, const char *string)
-{
- char c;
- int bool;
-
- c = string[0];
- if ((c == 'c') && (strcmp(string, "cancel") == 0)) {
- return DROP_CANCEL;
- } else if (Tcl_GetBoolean(interp, string, &bool) != TCL_OK) {
- Tcl_BackgroundError(interp);
- return DROP_CANCEL;
- }
- return bool;
-}
-
-static void
-AnimateActiveCursor(ClientData clientData)
-{
- Dnd *dndPtr = clientData;
- Tk_Cursor cursor;
-
- dndPtr->cursorPos++;
- cursor = dndPtr->cursors[dndPtr->cursorPos];
- if (cursor == None) {
- cursor = dndPtr->cursors[1];
- dndPtr->cursorPos = 1;
- }
- Tk_DefineCursor(dndPtr->tkwin, cursor);
- dndPtr->timerToken = Tcl_CreateTimerHandler(100, AnimateActiveCursor,
- dndPtr);
-}
-
-static void
-StartActiveCursor(Dnd *dndPtr)
-{
- if (dndPtr->timerToken != NULL) {
- Tcl_DeleteTimerHandler(dndPtr->timerToken);
- }
- if (dndPtr->cursors != NULL) {
- Tk_Cursor cursor;
-
- dndPtr->cursorPos = 1;
- cursor = dndPtr->cursors[1];
- if (cursor != None) {
- Tk_DefineCursor(dndPtr->tkwin, cursor);
- dndPtr->timerToken = Tcl_CreateTimerHandler(125,
- AnimateActiveCursor, dndPtr);
- }
- }
-}
-
-static void
-StopActiveCursor(Dnd *dndPtr)
-{
- if (dndPtr->cursorPos > 0) {
- dndPtr->cursorPos = 0;
- }
- if (dndPtr->cursors != NULL) {
- Tk_DefineCursor(dndPtr->tkwin, dndPtr->cursors[0]);
- }
- if (dndPtr->timerToken != NULL) {
- Tcl_DeleteTimerHandler(dndPtr->timerToken);
- dndPtr->timerToken = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EventuallyRedrawToken --
- *
- * Queues a request to redraw the widget at the next idle point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets redisplayed. Right now we don't do selective
- * redisplays: the whole window will be redrawn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-EventuallyRedrawToken(Dnd *dndPtr)
-{
- Token *tokenPtr;
-
- if (dndPtr->tokenPtr == NULL) {
- return;
- }
- tokenPtr = dndPtr->tokenPtr;
- if ((tokenPtr->tkwin != NULL) && (tokenPtr->tkwin != NULL) &&
- !(tokenPtr->flags & TOKEN_REDRAW)) {
- tokenPtr->flags |= TOKEN_REDRAW;
- Tcl_DoWhenIdle(DisplayToken, dndPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RaiseToken --
- *
- *---------------------------------------------------------------------------
- */
-static void
-RaiseToken(Dnd *dndPtr)
-{
- Token *tokenPtr = dndPtr->tokenPtr;
-
- if (dndPtr->flags & DND_INITIATED) {
- if ((Tk_Width(tokenPtr->tkwin) != Tk_ReqWidth(tokenPtr->tkwin)) ||
- (Tk_Height(tokenPtr->tkwin) != Tk_ReqHeight(tokenPtr->tkwin))) {
- Blt_ResizeToplevelWindow(tokenPtr->tkwin,
- Tk_ReqWidth(tokenPtr->tkwin),
- Tk_ReqHeight(tokenPtr->tkwin));
- }
- Blt_MapToplevelWindow(tokenPtr->tkwin);
- Blt_RaiseToplevelWindow(tokenPtr->tkwin);
- }
-}
-
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayToken --
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayToken(ClientData clientData)
-{
- Dnd *dndPtr = clientData;
- Token *tokenPtr = dndPtr->tokenPtr;
- int relief;
- Tk_3DBorder border;
- int borderWidth;
-
- tokenPtr->flags &= ~TOKEN_REDRAW;
- if (tokenPtr->status == DROP_OK) {
- relief = tokenPtr->activeRelief;
- border = tokenPtr->activeBorder;
- borderWidth = tokenPtr->activeBW;
- if ((dndPtr->cursors != NULL) && (dndPtr->cursorPos == 0)) {
- StartActiveCursor(dndPtr);
- }
- } else {
- relief = tokenPtr->relief;
- border = tokenPtr->normalBorder;
- borderWidth = tokenPtr->borderWidth;
- StopActiveCursor(dndPtr);
- }
- Blt_Fill3DRectangle(tokenPtr->tkwin, Tk_WindowId(tokenPtr->tkwin), border,
- 0, 0, Tk_Width(tokenPtr->tkwin), Tk_Height(tokenPtr->tkwin),
- borderWidth, relief);
- tokenPtr->lastStatus = tokenPtr->status;
- if (tokenPtr->status == DROP_FAIL) {
- DrawRejectSymbol(dndPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FadeToken --
- *
- * Fades the token into the target.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FadeToken(Dnd *dndPtr) /* Drag-and-drop manager (source). */
-{
- Token *tokenPtr = dndPtr->tokenPtr;
- int w, h;
- int dx, dy;
- Window window;
-
- if (tokenPtr->status == DROP_FAIL) {
- tokenPtr->nSteps = 1;
- return;
- }
- if (tokenPtr->nSteps == 1) {
- HideToken(dndPtr);
- dndPtr->flags &= ~(DND_ACTIVE | DND_VOIDED);
- return;
- }
- if (tokenPtr->timerToken != NULL) {
- Tcl_DeleteTimerHandler(tokenPtr->timerToken);
- }
- tokenPtr->timerToken = Tcl_CreateTimerHandler(10,
- (Tcl_TimerProc *)FadeToken, dndPtr);
- tokenPtr->nSteps--;
-
- w = Tk_ReqWidth(tokenPtr->tkwin) * tokenPtr->nSteps / 10;
- h = Tk_ReqHeight(tokenPtr->tkwin) * tokenPtr->nSteps / 10;
- if (w < 1) {
- w = 1;
- }
- if (h < 1) {
- h = 1;
- }
- dx = (Tk_ReqWidth(tokenPtr->tkwin) - w) / 2;
- dy = (Tk_ReqHeight(tokenPtr->tkwin) - h) / 2;
- window = Blt_GetWindowId(tokenPtr->tkwin);
- XMoveResizeWindow(dndPtr->display, window, tokenPtr->x + dx,
- tokenPtr->y + dy, (unsigned int)w, (unsigned int)h);
- tokenPtr->width = w, tokenPtr->height = h;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SnapToken --
- *
- * Snaps the token back to the source.
- *
- *---------------------------------------------------------------------------
- */
-static void
-SnapToken(Dnd *dndPtr)
-{
- Token *tokenPtr = dndPtr->tokenPtr;
-
- if (tokenPtr->nSteps == 1) {
- HideToken(dndPtr);
- return;
- }
- if (tokenPtr->timerToken != NULL) {
- Tcl_DeleteTimerHandler(tokenPtr->timerToken);
- }
- tokenPtr->timerToken = Tcl_CreateTimerHandler(10,
- (Tcl_TimerProc *)SnapToken, dndPtr);
- tokenPtr->nSteps--;
- tokenPtr->x -= (tokenPtr->x - tokenPtr->startX) / tokenPtr->nSteps;
- tokenPtr->y -= (tokenPtr->y - tokenPtr->startY) / tokenPtr->nSteps;
- if ((tokenPtr->x != Tk_X(tokenPtr->tkwin)) ||
- (tokenPtr->y != Tk_Y(tokenPtr->tkwin))) {
- Tk_MoveToplevelWindow(tokenPtr->tkwin, tokenPtr->x, tokenPtr->y);
- }
- RaiseToken(dndPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HideToken --
- *
- * Unmaps the drag&drop token. Invoked directly at the end of a
- * successful communication, or after a delay if the communication
- * fails (allowing the user to see a graphical picture of failure).
- *
- *---------------------------------------------------------------------------
- */
-static void
-HideToken(Dnd *dndPtr)
-{
- Token *tokenPtr = dndPtr->tokenPtr;
-
- if (tokenPtr->timerToken != NULL) {
- Tcl_DeleteTimerHandler(tokenPtr->timerToken);
- tokenPtr->timerToken = NULL;
- }
- if (dndPtr->flags & DND_INITIATED) {
- /* Reset the cursor back to its normal state. */
- StopActiveCursor(dndPtr);
- if (dndPtr->cursor == None) {
- Tk_UndefineCursor(dndPtr->tkwin);
- } else {
- Tk_DefineCursor(dndPtr->tkwin, dndPtr->cursor);
- }
- if (tokenPtr->tkwin != NULL) {
- Tk_UnmapWindow(tokenPtr->tkwin);
- Blt_ResizeToplevelWindow(tokenPtr->tkwin,
- Tk_ReqWidth(tokenPtr->tkwin),
- Tk_ReqHeight(tokenPtr->tkwin));
- }
- }
- if (dndPtr->rootPtr != NULL) {
- FreeWinfo(dndPtr->rootPtr);
- dndPtr->rootPtr = NULL;
- }
- dndPtr->flags &= ~(DND_ACTIVE | DND_VOIDED);
- tokenPtr->status = DROP_CONTINUE;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * MorphToken --
- *
- * Fades the token into the target.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MorphToken(Dnd *dndPtr) /* Drag-and-drop manager (source). */
-{
- Token *tokenPtr = dndPtr->tokenPtr;
-
- if (tokenPtr->status == DROP_FAIL) {
- tokenPtr->nSteps = 1;
- return;
- }
- if (tokenPtr->nSteps == 1) {
- HideToken(dndPtr);
- dndPtr->flags &= ~(DND_ACTIVE | DND_VOIDED);
- return;
- }
- if (tokenPtr->timerToken != NULL) {
- Tcl_DeleteTimerHandler(tokenPtr->timerToken);
- }
- tokenPtr->timerToken = Tcl_CreateTimerHandler(10,
- (Tcl_TimerProc *)MorphToken, dndPtr);
- tokenPtr->nSteps--;
-
- if (dndPtr->flags & DROP_CANCEL) {
- tokenPtr->nSteps--;
- tokenPtr->x -= (tokenPtr->x - tokenPtr->startX) / tokenPtr->nSteps;
- tokenPtr->y -= (tokenPtr->y - tokenPtr->startY) / tokenPtr->nSteps;
- if ((tokenPtr->x != Tk_X(tokenPtr->tkwin)) ||
- (tokenPtr->y != Tk_Y(tokenPtr->tkwin))) {
- Tk_MoveToplevelWindow(tokenPtr->tkwin, tokenPtr->x, tokenPtr->y);
- }
- } else {
- int w, h;
- int dx, dy;
- Window window;
-
- w = Tk_ReqWidth(tokenPtr->tkwin) * tokenPtr->nSteps / 10;
- h = Tk_ReqHeight(tokenPtr->tkwin) * tokenPtr->nSteps / 10;
- if (w < 1) {
- w = 1;
- }
- if (h < 1) {
- h = 1;
- }
- dx = (Tk_ReqWidth(tokenPtr->tkwin) - w) / 2;
- dy = (Tk_ReqHeight(tokenPtr->tkwin) - h) / 2;
- window = Blt_GetWindowId(tokenPtr->tkwin);
- XMoveResizeWindow(dndPtr->display, window, tokenPtr->x + dx,
- tokenPtr->y + dy, (unsigned int)w, (unsigned int)h);
- tokenPtr->width = w, tokenPtr->height = h;
- }
- RaiseToken(dndPtr);
-}
-#endif
-
-static void
-GetTokenPosition(Dnd *dndPtr, int x, int y)
-{
- Token *tokenPtr = dndPtr->tokenPtr;
- int maxX, maxY;
- int vx, vy, dummy;
- int screenWidth, screenHeight;
-
- /* Adjust current location for virtual root windows. */
- Tk_GetVRootGeometry(dndPtr->tkwin, &vx, &vy, &dummy, &dummy);
- x += vx - TOKEN_OFFSET;
- y += vy - TOKEN_OFFSET;
-
- Blt_SizeOfScreen(tokenPtr->tkwin, &screenWidth, &screenHeight);
- maxX = screenWidth - Tk_Width(tokenPtr->tkwin);
- maxY = screenHeight - Tk_Height(tokenPtr->tkwin);
- Blt_TranslateAnchor(x, y, Tk_Width(tokenPtr->tkwin),
- Tk_Height(tokenPtr->tkwin), tokenPtr->anchor, &x, &y);
- if (x > maxX) {
- x = maxX;
- } else if (x < 0) {
- x = 0;
- }
- if (y > maxY) {
- y = maxY;
- } else if (y < 0) {
- y = 0;
- }
- tokenPtr->x = x, tokenPtr->y = y;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MoveToken --
- *
- * Invoked during "drag" operations to move a token window to its
- * current "drag" coordinate.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MoveToken(Dnd *dndPtr) /* drag&drop source window data */
-{
- Token *tokenPtr = dndPtr->tokenPtr;
-
- GetTokenPosition(dndPtr, dndPtr->x, dndPtr->y);
- if ((tokenPtr->x != Tk_X(tokenPtr->tkwin)) ||
- (tokenPtr->y != Tk_Y(tokenPtr->tkwin))) {
- Tk_MoveToplevelWindow(tokenPtr->tkwin, tokenPtr->x, tokenPtr->y);
- }
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ChangeToken --
- *
- * Invoked when the event loop is idle to determine whether or not
- * the current drag&drop token position is over another drag&drop
- * target.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ChangeToken(Dnd *dndPtr, int status)
-{
- Token *tokenPtr = dndPtr->tokenPtr;
-
- tokenPtr->status = status;
- EventuallyRedrawToken(dndPtr);
-
- /*
- * If the source has a site command, then invoke it to
- * modify the appearance of the token window. Pass any
- * errors onto the drag&drop error handler.
- */
- if (dndPtr->siteCmd) {
- Tcl_Interp *interp = dndPtr->interp;
- Tcl_DString dString, savedResult;
- const char **p;
-
- Tcl_DStringInit(&dString);
- for (p = dndPtr->siteCmd; *p != NULL; p++) {
- Tcl_DStringAppendElement(&dString, *p);
- }
- Tcl_DStringAppendElement(&dString, Tk_PathName(dndPtr->tkwin));
- Tcl_DStringAppendElement(&dString, "timestamp");
- Tcl_DStringAppendElement(&dString, Blt_Utoa(dndPtr->timestamp));
- Tcl_DStringAppendElement(&dString, "status");
- Tcl_DStringAppendElement(&dString, NameOfStatus(status));
- Tcl_DStringInit(&savedResult);
- Tcl_DStringGetResult(interp, &savedResult);
- if (Tcl_GlobalEval(interp, Tcl_DStringValue(&dString)) != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
- Tcl_DStringFree(&dString);
- Tcl_DStringResult(interp, &savedResult);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawRejectSymbol --
- *
- * Draws a rejection mark on the current drag&drop token, and arranges
- * for the token to be unmapped after a small delay.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawRejectSymbol(Dnd *dndPtr)
-{
- Token *tokenPtr = dndPtr->tokenPtr;
- int divisor = 6; /* controls size of rejection symbol */
- int w, h, lineWidth, x, y, margin;
-
- margin = 2 * tokenPtr->borderWidth;
- w = Tk_Width(tokenPtr->tkwin) - 2 * margin;
- h = Tk_Height(tokenPtr->tkwin) - 2 * margin;
- lineWidth = (w < h) ? w / divisor : h / divisor;
- lineWidth = (lineWidth < 1) ? 1 : lineWidth;
-
- w = h = lineWidth * (divisor - 1);
- x = (Tk_Width(tokenPtr->tkwin) - w) / 2;
- y = (Tk_Height(tokenPtr->tkwin) - h) / 2;
-
- /*
- * Draw the rejection symbol background (\) on the token window...
- */
- XSetLineAttributes(Tk_Display(tokenPtr->tkwin), tokenPtr->outlineGC,
- lineWidth + 2, LineSolid, CapButt, JoinBevel);
-
- XDrawArc(Tk_Display(tokenPtr->tkwin), Tk_WindowId(tokenPtr->tkwin),
- tokenPtr->outlineGC, x, y, w, h, 0, 23040);
-
- XDrawLine(Tk_Display(tokenPtr->tkwin), Tk_WindowId(tokenPtr->tkwin),
- tokenPtr->outlineGC, x + lineWidth, y + lineWidth, x + w - lineWidth,
- y + h - lineWidth);
-
- /*
- * Draw the rejection symbol foreground (\) on the token window...
- */
- XSetLineAttributes(Tk_Display(tokenPtr->tkwin), tokenPtr->fillGC,
- lineWidth, LineSolid, CapButt, JoinBevel);
-
- XDrawArc(Tk_Display(tokenPtr->tkwin), Tk_WindowId(tokenPtr->tkwin),
- tokenPtr->fillGC, x, y, w, h, 0, 23040);
-
- XDrawLine(Tk_Display(tokenPtr->tkwin), Tk_WindowId(tokenPtr->tkwin),
- tokenPtr->fillGC, x + lineWidth, y + lineWidth, x + w - lineWidth,
- y + h - lineWidth);
-
- tokenPtr->status = DROP_FAIL;
- /*
- * Arrange for token window to disappear eventually.
- */
- if (tokenPtr->timerToken != NULL) {
- Tcl_DeleteTimerHandler(tokenPtr->timerToken);
- }
- tokenPtr->timerToken = Tcl_CreateTimerHandler(1000,
- (Tcl_TimerProc *)HideToken, dndPtr);
- RaiseToken(dndPtr);
- dndPtr->flags &= ~(DND_ACTIVE | DND_VOIDED);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateToken --
- *
- * Looks for a Source record in the hash table for drag&drop source
- * widgets. Creates a new record if the widget name is not already
- * registered. Returns a pointer to the desired record.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyToken(DestroyData data)
-{
- Dnd *dndPtr = (Dnd *)data;
- Token *tokenPtr = dndPtr->tokenPtr;
-
- dndPtr->tokenPtr = NULL;
- if (tokenPtr == NULL) {
- return;
- }
- if (tokenPtr->flags & TOKEN_REDRAW) {
- Tcl_CancelIdleCall(DisplayToken, dndPtr);
- }
- Blt_FreeOptions(tokenConfigSpecs, (char *)tokenPtr, dndPtr->display, 0);
- if (tokenPtr->timerToken) {
- Tcl_DeleteTimerHandler(tokenPtr->timerToken);
- }
- if (tokenPtr->fillGC != NULL) {
- Tk_FreeGC(dndPtr->display, tokenPtr->fillGC);
- }
- if (tokenPtr->outlineGC != NULL) {
- Tk_FreeGC(dndPtr->display, tokenPtr->outlineGC);
- }
- if (tokenPtr->tkwin != NULL) {
- Tk_DeleteEventHandler(tokenPtr->tkwin,
- ExposureMask | StructureNotifyMask, TokenEventProc, dndPtr);
- Tk_DestroyWindow(tokenPtr->tkwin);
- }
- Blt_Free(tokenPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TokenEventProc --
- *
- * Invoked by the Tk dispatcher to handle widget events.
- * Manages redraws for the drag&drop token window.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TokenEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Dnd *dndPtr = clientData;
- Token *tokenPtr = dndPtr->tokenPtr;
-
- if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
- if (tokenPtr->tkwin != NULL) {
- EventuallyRedrawToken(dndPtr);
- }
- } else if (eventPtr->type == DestroyNotify) {
- tokenPtr->tkwin = NULL;
- if (tokenPtr->flags & TOKEN_REDRAW) {
- tokenPtr->flags &= ~TOKEN_REDRAW;
- Tcl_CancelIdleCall(DisplayToken, dndPtr);
- }
- Tcl_EventuallyFree(dndPtr, DestroyToken);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateToken --
- *
- * Looks for a Source record in the hash table for drag&drop source
- * widgets. Creates a new record if the widget name is not already
- * registered. Returns a pointer to the desired record.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreateToken(
- Tcl_Interp *interp,
- Dnd *dndPtr)
-{
- XSetWindowAttributes attrs;
- Tk_Window tkwin;
- unsigned int mask;
- Token *tokenPtr;
-
- tokenPtr = Blt_AssertCalloc(1, sizeof(Token));
- tokenPtr->anchor = TK_ANCHOR_SE;
- tokenPtr->relief = TK_RELIEF_RAISED;
- tokenPtr->activeRelief = TK_RELIEF_SUNKEN;
- tokenPtr->borderWidth = tokenPtr->activeBW = 3;
-
- /* Create toplevel on parent's screen. */
- tkwin = Tk_CreateWindow(interp, dndPtr->tkwin, "dndtoken", "");
- if (tkwin == NULL) {
- Blt_Free(tokenPtr);
- return TCL_ERROR;
- }
- tokenPtr->tkwin = tkwin;
- Tk_SetClass(tkwin, "DndToken");
- Tk_CreateEventHandler(tkwin, ExposureMask | StructureNotifyMask,
- TokenEventProc, dndPtr);
- attrs.override_redirect = True;
- attrs.backing_store = WhenMapped;
- attrs.save_under = True;
- mask = CWOverrideRedirect | CWSaveUnder | CWBackingStore;
- Tk_ChangeWindowAttributes(tkwin, mask, &attrs);
- Tk_SetInternalBorder(tkwin, tokenPtr->borderWidth + 2);
- Tk_MakeWindowExist(tkwin);
- dndPtr->tokenPtr = tokenPtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureToken --
- *
- * Called to process an (objc,objv) list to configure (or
- * reconfigure) a drag&drop source widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureToken(
- Tcl_Interp *interp, /* current interpreter */
- Dnd *dndPtr, /* Drag&drop source widget record */
- int objc, /* number of arguments */
- Tcl_Obj *const *objv, /* argument strings */
- int flags) /* flags controlling interpretation */
-{
- GC newGC;
- Token *tokenPtr = dndPtr->tokenPtr;
- XGCValues gcValues;
- unsigned long gcMask;
-
- Tk_MakeWindowExist(tokenPtr->tkwin);
- if (Blt_ConfigureWidgetFromObj(interp, tokenPtr->tkwin, tokenConfigSpecs,
- objc, objv, (char *)tokenPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * Set up the rejection outline GC for the token window...
- */
- gcValues.foreground = tokenPtr->outlineColor->pixel;
- gcValues.subwindow_mode = IncludeInferiors;
- gcValues.graphics_exposures = False;
- gcValues.line_style = LineSolid;
- gcValues.cap_style = CapButt;
- gcValues.join_style = JoinBevel;
-
- gcMask = GCForeground | GCSubwindowMode | GCLineStyle |
- GCCapStyle | GCJoinStyle | GCGraphicsExposures;
- newGC = Tk_GetGC(dndPtr->tkwin, gcMask, &gcValues);
-
- if (tokenPtr->outlineGC != NULL) {
- Tk_FreeGC(dndPtr->display, tokenPtr->outlineGC);
- }
- tokenPtr->outlineGC = newGC;
-
- /*
- * Set up the rejection fill GC for the token window...
- */
- gcValues.foreground = tokenPtr->fillColor->pixel;
- if (tokenPtr->rejectStipple != None) {
- gcValues.stipple = tokenPtr->rejectStipple;
- gcValues.fill_style = FillStippled;
- gcMask |= GCStipple | GCFillStyle;
- }
- newGC = Tk_GetGC(dndPtr->tkwin, gcMask, &gcValues);
-
- if (tokenPtr->fillGC != NULL) {
- Tk_FreeGC(dndPtr->display, tokenPtr->fillGC);
- }
- tokenPtr->fillGC = newGC;
-
- if ((tokenPtr->reqWidth > 0) && (tokenPtr->reqHeight > 0)) {
- Tk_GeometryRequest(tokenPtr->tkwin, tokenPtr->reqWidth,
- tokenPtr->reqHeight);
- }
- /*
- * Reset the border width in case it has changed...
- */
- Tk_SetInternalBorder(tokenPtr->tkwin, tokenPtr->borderWidth + 2);
- return TCL_OK;
-}
-
-static int
-GetFormattedData(
- Dnd *dndPtr,
- char *format,
- int timestamp,
- Tcl_DString *resultPtr)
-{
- Tcl_Interp *interp = dndPtr->interp;
- Blt_HashEntry *hPtr;
- char **formatCmd;
- Tcl_DString savedResult;
- Tcl_DString dString;
- char **p;
- int x, y;
-
- /* Find the data converter for the prescribed format. */
- hPtr = Blt_FindHashEntry(&dndPtr->getDataTable, format);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "can't find format \"", format,
- "\" in source \"", Tk_PathName(dndPtr->tkwin), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- formatCmd = Blt_GetHashValue(hPtr);
- Tcl_DStringInit(&dString);
- for (p = formatCmd; *p != NULL; p++) {
- Tcl_DStringAppendElement(&dString, *p);
- }
- x = dndPtr->dragX - Blt_RootX(dndPtr->tkwin);
- y = dndPtr->dragY - Blt_RootY(dndPtr->tkwin);
- Tcl_DStringAppendElement(&dString, Tk_PathName(dndPtr->tkwin));
- Tcl_DStringAppendElement(&dString, "x");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(x));
- Tcl_DStringAppendElement(&dString, "y");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(y));
- Tcl_DStringAppendElement(&dString, "timestamp");
- Tcl_DStringAppendElement(&dString, Blt_Utoa(timestamp));
- Tcl_DStringAppendElement(&dString, "format");
- Tcl_DStringAppendElement(&dString, format);
- Tcl_DStringInit(&savedResult);
- Tcl_DStringGetResult(interp, &savedResult);
- if (Tcl_GlobalEval(interp, Tcl_DStringValue(&dString)) != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
- Tcl_DStringFree(&dString);
- Tcl_DStringInit(resultPtr);
- Tcl_DStringGetResult(interp, resultPtr);
-
- /* Restore the interpreter result. */
- Tcl_DStringResult(interp, &savedResult);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyDnd --
- *
- * Free resources allocated for the drag&drop window.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyDnd(DestroyData data)
-{
- Dnd *dndPtr = (Dnd *)data;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- char **cmd;
-
- Blt_FreeOptions(configSpecs, (char *)dndPtr, dndPtr->display, 0);
- Tk_DeleteGenericHandler(DndEventProc, dndPtr);
- for (hPtr = Blt_FirstHashEntry(&dndPtr->getDataTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- cmd = Blt_GetHashValue(hPtr);
- if (cmd != NULL) {
- Blt_Free(cmd);
- }
- }
- Blt_DeleteHashTable(&dndPtr->getDataTable);
-
- for (hPtr = Blt_FirstHashEntry(&dndPtr->setDataTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- cmd = Blt_GetHashValue(hPtr);
- if (cmd != NULL) {
- Blt_Free(cmd);
- }
- }
- Blt_DeleteHashTable(&dndPtr->setDataTable);
- if (dndPtr->rootPtr != NULL) {
- FreeWinfo(dndPtr->rootPtr);
- }
- if (dndPtr->cursor != None) {
- Tk_FreeCursor(dndPtr->display, dndPtr->cursor);
- }
- if (dndPtr->reqFormats != NULL) {
- Blt_Free(dndPtr->reqFormats);
- }
- if (dndPtr->matchingFormats != NULL) {
- Blt_Free(dndPtr->matchingFormats);
- }
-
- /* Now that the various commands are custom list options, we need
- * to explicitly free them. */
- if (dndPtr->motionCmd != NULL) {
- Blt_Free(dndPtr->motionCmd);
- }
- if (dndPtr->leaveCmd != NULL) {
- Blt_Free(dndPtr->leaveCmd);
- }
- if (dndPtr->enterCmd != NULL) {
- Blt_Free(dndPtr->enterCmd);
- }
- if (dndPtr->dropCmd != NULL) {
- Blt_Free(dndPtr->dropCmd);
- }
- if (dndPtr->resultCmd != NULL) {
- Blt_Free(dndPtr->resultCmd);
- }
- if (dndPtr->packageCmd != NULL) {
- Blt_Free(dndPtr->packageCmd);
- }
- if (dndPtr->siteCmd != NULL) {
- Blt_Free(dndPtr->siteCmd);
- }
-
- if (dndPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&dndPtr->dataPtr->dndTable, dndPtr->hashPtr);
- }
- if (dndPtr->tokenPtr != NULL) {
- DestroyToken((DestroyData)dndPtr);
- }
- if (dndPtr->tkwin != NULL) {
- XDeleteProperty(dndPtr->display, Tk_WindowId(dndPtr->tkwin),
- dndPtr->dataPtr->targetAtom);
- XDeleteProperty(dndPtr->display, Tk_WindowId(dndPtr->tkwin),
- dndPtr->dataPtr->commAtom);
- }
- Blt_Free(dndPtr);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetDnd --
- *
- * Looks for a Source record in the hash table for drag&drop source
- * widgets. Returns a pointer to the desired record.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetDndFromObj(
- ClientData clientData,
- Tcl_Interp *interp,
- Tcl_Obj *objPtr, /* widget pathname for desired record */
- Dnd **dndPtrPtr)
-{
- DndInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Tk_Window tkwin;
- char *pathName;
-
- pathName = Tcl_GetString(objPtr);
- assert(interp != NULL);
- tkwin = Tk_NameToWindow(interp, pathName, dataPtr->tkMain);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- hPtr = Blt_FindHashEntry(&dataPtr->dndTable, (char *)tkwin);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "window \"", pathName,
- "\" is not a drag&drop source/target", (char *)NULL);
- return TCL_ERROR;
- }
- *dndPtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateDnd --
- *
- * Looks for a Source record in the hash table for drag&drop source
- * widgets. Creates a new record if the widget name is not already
- * registered. Returns a pointer to the desired record.
- *
- *---------------------------------------------------------------------------
- */
-static Dnd *
-CreateDnd(
- Tcl_Interp *interp,
- Tk_Window tkwin) /* Widget for desired record */
-{
- Dnd *dndPtr;
-
- dndPtr = Blt_AssertCalloc(1, sizeof(Dnd));
- dndPtr->interp = interp;
- dndPtr->display = Tk_Display(tkwin);
- dndPtr->tkwin = tkwin;
- Tk_MakeWindowExist(tkwin);
- Blt_InitHashTable(&dndPtr->setDataTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&dndPtr->getDataTable, BLT_STRING_KEYS);
- Tk_CreateGenericHandler(DndEventProc, dndPtr);
- return dndPtr;
-}
-
-static int
-ConfigureDnd(Tcl_Interp *interp, Dnd *dndPtr)
-{
- Tcl_CmdInfo cmdInfo;
- Tcl_DString dString;
- int button, result;
-
- if (!Tcl_GetCommandInfo(interp, "::blt::DndInit", &cmdInfo)) {
- static char cmd[] = "source [file join $blt_library dnd.tcl]";
- /*
- * If the "DndInit" routine hasn't been sourced, do it now.
- */
- if (Tcl_GlobalEval(interp, cmd) != TCL_OK) {
- Tcl_AddErrorInfo(interp,
- "\n (while loading bindings for blt::drag&drop)");
- return TCL_ERROR;
- }
- }
- /*
- * Reset the target property if it's changed state or
- * added/subtracted one of its callback procedures.
- */
- if (Blt_ConfigModified(configSpecs, "-target", "-onenter", "-onmotion",
- "-onleave", (char *)NULL)) {
- if (dndPtr->targetPropertyExists) {
- XDeleteProperty(dndPtr->display, Tk_WindowId(dndPtr->tkwin),
- dndPtr->dataPtr->targetAtom);
- dndPtr->targetPropertyExists = FALSE;
- }
- if (dndPtr->isTarget) {
- AddTargetProperty(dndPtr);
- dndPtr->targetPropertyExists = TRUE;
- }
- }
- if (dndPtr->isSource) {
- /* Check the button binding for valid range (0 or 1-5) */
- if ((dndPtr->reqButton < 0) || (dndPtr->reqButton > 5)) {
- Tcl_AppendResult(interp,
- "button must be 1-5, or 0 for no bindings",
- (char *)NULL);
- return TCL_ERROR;
- }
- button = dndPtr->reqButton;
- } else {
- button = 0;
- }
- Tcl_DStringInit(&dString);
- Blt_DStringAppendElements(&dString, "::blt::DndInit",
- Tk_PathName(dndPtr->tkwin), Blt_Itoa(button), (char *)NULL);
- result = Tcl_GlobalEval(interp, Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * SendRestrictProc --
- *
- * This procedure filters incoming events when a "send" command
- * is outstanding. It defers all events except those containing
- * send commands and results.
- *
- * Results:
- * False is returned except for property-change events on a
- * commWindow.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-/* ARGSUSED */
-static Tk_RestrictAction
-SendRestrictProc(
- ClientData clientData, /* Drag-and-drop manager. */
- XEvent *eventPtr) /* Event that just arrived. */
-{
- Dnd *dndPtr = clientData;
-
- if (eventPtr->xproperty.window != Tk_WindowId(dndPtr->tkwin)) {
- return TK_PROCESS_EVENT; /* Event not in our window. */
- }
- if ((eventPtr->type == PropertyNotify) &&
- (eventPtr->xproperty.state == PropertyNewValue)) {
- return TK_PROCESS_EVENT; /* This is the one we want to process. */
- }
- if (eventPtr->type == Expose) {
- return TK_PROCESS_EVENT; /* Let expose events also get
- * handled. */
- }
- return TK_DEFER_EVENT; /* Defer everything else. */
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SendTimerProc --
- *
- * Procedure called when the timer event elapses. Used to wait
- * between attempts checking for the designated window.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Sets a flag, indicating the timeout occurred.
- *
- *---------------------------------------------------------------------------
- */
-static void
-SendTimerProc(ClientData clientData)
-{
- int *statusPtr = clientData;
-
- /*
- * An unusually long amount of time has elapsed since the drag
- * start message was sent. Assume that the other party has died
- * and abort the operation.
- */
- *statusPtr = DROP_FAIL;
-}
-
-#define WAIT_INTERVAL 2000 /* Twenty seconds. */
-
-/*
- *---------------------------------------------------------------------------
- *
- * TargetPropertyEventProc --
- *
- * Invoked by the Tk dispatcher to handle widget events. Manages redraws
- * for the drag&drop token window.
- *
- *---------------------------------------------------------------------------
- */
-static void
-TargetPropertyEventProc(
- ClientData clientData, /* Data associated with transaction. */
- XEvent *eventPtr) /* information about event */
-{
- DropPending *pendingPtr = clientData;
- unsigned char *data;
- int result, format;
- Atom typeAtom;
- unsigned long nItems, bytesAfter;
-
-#ifdef notdef
- fprintf(stderr, "TargetPropertyEventProc\n");
-#endif
- if ((eventPtr->type != PropertyNotify) ||
- (eventPtr->xproperty.atom != pendingPtr->commAtom) ||
- (eventPtr->xproperty.state != PropertyNewValue)) {
- return;
- }
- Tcl_DeleteTimerHandler(pendingPtr->timerToken);
- data = NULL;
- result = XGetWindowProperty(
- eventPtr->xproperty.display, /* Display of window. */
- eventPtr->xproperty.window, /* Window holding the property. */
- eventPtr->xproperty.atom, /* Name of property. */
- 0, /* Offset of data (for multiple
- * reads). */
- pendingPtr->packetSize, /* Maximum number of items to read. */
- False, /* If true, delete the property. */
- XA_STRING, /* Desired type of property. */
- &typeAtom, /* (out) Actual type of the property. */
- &format, /* (out) Actual format of the
- * property. */
- &nItems, /* (out) # of items in specified
- * format. */
- &bytesAfter, /* (out) # of bytes remaining to be
- * read. */
- &data);
-#ifdef notdef
- fprintf(stderr,
- "TargetPropertyEventProc: result=%d, typeAtom=%d, format=%d, nItems=%d\n",
- result, typeAtom, format, nItems);
-#endif
- pendingPtr->status = DROP_FAIL;
- if ((result == Success) && (typeAtom == XA_STRING) && (format == 8)) {
- pendingPtr->status = DROP_OK;
-#ifdef notdef
- fprintf(stderr, "data found is (%s)\n", data);
-#endif
- Tcl_DStringAppend(&pendingPtr->dString, (char *)data, -1);
- XFree(data);
- if (nItems == pendingPtr->packetSize) {
- /* Normally, we'll receive the data in one chunk. But if more are
- * required, reset the timer and go back into the wait loop
- * again. */
- pendingPtr->timerToken = Tcl_CreateTimerHandler(WAIT_INTERVAL,
- SendTimerProc, &pendingPtr->status);
- pendingPtr->status = DROP_CONTINUE;
- }
- }
- /* Set an empty, zero-length value on the source's property. This acts as a
- * handshake, indicating that the target received the latest chunk. */
-#ifdef notdef
- fprintf(stderr, "TargetPropertyEventProc: set response property\n");
-#endif
- XChangeProperty(pendingPtr->display, pendingPtr->window,
- pendingPtr->commAtom, XA_STRING, 8, PropModeReplace,
- (unsigned char *)"", 0);
-}
-
-#ifdef HAVE_XDND
-
-static int
-XDndSelectionProc(clientData, interp, portion)
- ClientData clientData;
- Tcl_Interp *interp;
- char *portion;
-{
- DropPending *pendingPtr = clientData;
-
- Tcl_DStringAppend(&pendingPtr->dString, portion, -1);
-#ifdef notdef
- fprintf(stderr, "-> XDndGetSelectionProc\n");
-#endif
- return TCL_OK;
-}
-
-#endif /* HAVE_XDND */
-
-static void
-CompleteDataTransaction(Dnd *dndPtr, char *format, DropPending *pendingPtr)
-{
- DndInterpData *dataPtr = dndPtr->dataPtr;
- Tk_Window tkwin;
- Atom formatAtom;
-
-#ifdef notdef
- fprintf(stderr, "-> CompleteDataTransaction\n");
-#endif
- /* Check if the source is local to the application. */
- tkwin = Tk_IdToWindow(dndPtr->display, pendingPtr->window);
- if (tkwin != NULL) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&dndPtr->dataPtr->dndTable, (char *)tkwin);
- if (hPtr != NULL) {
- Dnd *srcPtr;
-
- srcPtr = Blt_GetHashValue(hPtr);
- GetFormattedData(srcPtr, format, pendingPtr->timestamp,
- &pendingPtr->dString);
- }
- return;
- }
-
- formatAtom = XInternAtom(pendingPtr->display, format, False);
-
- if (pendingPtr->protocol == PROTO_XDND) {
-#ifdef HAVE_XDND
- if (Tk_GetSelection(dndPtr->interp, dndPtr->tkwin,
- dataPtr->XdndSelectionAtom, formatAtom, XDndSelectionProc,
- pendingPtr) != TCL_OK) {
- pendingPtr->status = DROP_FAIL;
- }
-#endif
- pendingPtr->status = DROP_OK;
- } else {
- Tk_RestrictProc *proc;
- ClientData arg;
-
- SendClientMsg(pendingPtr->display, pendingPtr->window,
- dataPtr->mesgAtom,
- TS_START_DROP,
- (int)Tk_WindowId(dndPtr->tkwin),
- pendingPtr->timestamp,
- (int)formatAtom,
- (int)pendingPtr->commAtom);
-
- pendingPtr->commAtom = dndPtr->dataPtr->commAtom;
- pendingPtr->status = DROP_CONTINUE;
- pendingPtr->display = dndPtr->display;
- proc = Tk_RestrictEvents(SendRestrictProc, dndPtr, &arg);
- Tk_CreateEventHandler(dndPtr->tkwin, PropertyChangeMask,
- TargetPropertyEventProc, pendingPtr);
- pendingPtr->timerToken = Tcl_CreateTimerHandler(WAIT_INTERVAL,
- SendTimerProc, &pendingPtr->status);
- /*
- * Enter a loop processing X events until the all the data is received
- * or the source is declared to be dead (i.e. we timeout). While
- * waiting for a result, restrict handling to just property-related
- * events so that the transfer is synchronous with respect to other
- * events in the widget.
- */
- while (pendingPtr->status == DROP_CONTINUE) {
- Tcl_DoOneEvent(TCL_ALL_EVENTS); /* Wait for property event. */
- }
- Tk_RestrictEvents(proc, arg, &arg);
- Tcl_DeleteTimerHandler(pendingPtr->timerToken);
- Tk_DeleteEventHandler(dndPtr->tkwin, PropertyChangeMask,
- TargetPropertyEventProc, pendingPtr);
- }
-#ifdef notdef
- fprintf(stderr, "<- CompleteDataTransaction\n");
-#endif
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SourcePropertyEventProc --
- *
- * Invoked by the Tk dispatcher when a PropertyNotify event occurs on the
- * source window. The event acts as a handshake between the target and the
- * source. The source acknowledges the target has received the last packet
- * of data and sends the next packet.
- *
- * Note a special case. If the data is divisible by the packetsize, then
- * an extra zero-length packet is sent to mark the end of the data. A
- * packetsize length packet indicates more is to follow.
- *
- * Normally the property is empty (zero-length). But if an errored
- * occurred on the target, it will contain the error message.
- *
- * ------------------------------------------------------------------------
- */
-static void
-SourcePropertyEventProc(
- ClientData clientData, /* data associated with widget */
- XEvent *eventPtr) /* information about event */
-{
- DropPending *pendingPtr = clientData;
- unsigned char *data;
- int result, format;
- Atom typeAtom;
- unsigned long nItems, bytesAfter;
- int size, bytesLeft;
- unsigned char *p;
-
-#ifdef notdef
- fprintf(stderr, "-> SourcePropertyEventProc\n");
-#endif
- if ((eventPtr->xproperty.atom != pendingPtr->commAtom)
- || (eventPtr->xproperty.state != PropertyNewValue)) {
- return;
- }
- Tcl_DeleteTimerHandler(pendingPtr->timerToken);
- data = NULL;
- result = XGetWindowProperty(
- eventPtr->xproperty.display, /* Display of window. */
- eventPtr->xproperty.window, /* Window holding the property. */
- eventPtr->xproperty.atom, /* Name of property. */
- 0, /* Offset of data (for multiple
- * reads). */
- pendingPtr->packetSize, /* Maximum number of items to read. */
- True, /* If true, delete the property. */
- XA_STRING, /* Desired type of property. */
- &typeAtom, /* (out) Actual type of the property. */
- &format, /* (out) Actual format of the
- * property. */
- &nItems, /* (out) # of items in specified
- * format. */
- &bytesAfter, /* (out) # of bytes remaining to be
- * read. */
- &data);
-
- if ((result != Success) || (typeAtom != XA_STRING) || (format != 8)) {
- pendingPtr->status = DROP_FAIL;
-#ifdef notdef
- fprintf(stderr, "<- SourcePropertyEventProc: wrong format\n");
-#endif
- return; /* Wrong data format. */
- }
- if (nItems > 0) {
- pendingPtr->status = DROP_FAIL;
- Tcl_DStringFree(&pendingPtr->dString);
- Tcl_DStringAppend(&pendingPtr->dString, (char *)data, -1);
- XFree(data);
-#ifdef notdef
- fprintf(stderr, "<- SourcePropertyEventProc: error\n");
-#endif
- return; /* Error occurred on target. */
- }
- bytesLeft = Tcl_DStringLength(&pendingPtr->dString) - pendingPtr->offset;
- if (bytesLeft <= 0) {
-#ifdef notdef
- fprintf(stderr, "<- SourcePropertyEventProc: done\n");
-#endif
- pendingPtr->status = DROP_OK;
- size = 0;
- } else {
- size = MIN(bytesLeft, pendingPtr->packetSize);
- pendingPtr->status = DROP_CONTINUE;
- }
- p = (unsigned char *)Tcl_DStringValue(&pendingPtr->dString) +
- pendingPtr->offset;
- XChangeProperty(pendingPtr->display, pendingPtr->window,
- pendingPtr->commAtom, XA_STRING, 8, PropModeReplace, p, size);
- pendingPtr->offset += size;
- pendingPtr->timerToken = Tcl_CreateTimerHandler(WAIT_INTERVAL,
- SendTimerProc, &pendingPtr->status);
-#ifdef notdef
- fprintf(stderr, "<- SourcePropertyEventProc\n");
-#endif
-}
-
-
-static void
-SendDataToTarget(Dnd *dndPtr, DropPending *pendingPtr)
-{
- int size;
- Tk_RestrictProc *proc;
- ClientData arg;
-
-#ifdef notdef
- fprintf(stderr, "-> SendDataToTarget\n");
-#endif
- Tk_CreateEventHandler(dndPtr->tkwin, PropertyChangeMask,
- SourcePropertyEventProc, pendingPtr);
- pendingPtr->timerToken = Tcl_CreateTimerHandler(WAIT_INTERVAL,
- SendTimerProc, &pendingPtr->status);
- size = MIN(Tcl_DStringLength(&pendingPtr->dString), pendingPtr->packetSize);
-
- proc = Tk_RestrictEvents(SendRestrictProc, dndPtr, &arg);
-
- /*
- * Setting the property starts the process. The target will see the
- * PropertyChange event and respond accordingly.
- */
- XChangeProperty(dndPtr->display, pendingPtr->window,
- pendingPtr->commAtom, XA_STRING, 8, PropModeReplace,
- (unsigned char *)Tcl_DStringValue(&pendingPtr->dString), size);
- pendingPtr->offset += size;
-
- /*
- * Enter a loop processing X events until the result comes in or the target
- * is declared to be dead. While waiting for a result, look only at
- * property-related events so that the handshake is synchronous with respect
- * to other events in the application.
- */
- pendingPtr->status = DROP_CONTINUE;
- while (pendingPtr->status == DROP_CONTINUE) {
- /* Wait for the property change event. */
- Tcl_DoOneEvent(TCL_ALL_EVENTS);
- }
- Tk_RestrictEvents(proc, arg, &arg);
- Tcl_DeleteTimerHandler(pendingPtr->timerToken);
- Tk_DeleteEventHandler(dndPtr->tkwin, PropertyChangeMask,
- SourcePropertyEventProc, pendingPtr);
-#ifdef notdef
- fprintf(stderr, "<- SendDataToTarget\n");
-#endif
-}
-
-static void
-DoDrop(Dnd *dndPtr, XEvent *eventPtr)
-{
- DndInterpData *dataPtr = dndPtr->dataPtr;
- Token *tokenPtr = dndPtr->tokenPtr;
- Tcl_Interp *interp = dndPtr->interp;
- struct DropRequest {
- int mesg; /* TS_DROP_RESULT message. */
- Window window; /* Target window. */
- int timestamp; /* Transaction timestamp. */
- Atom formatAtom; /* Format requested. */
- } *dropPtr;
- char *format;
- DropPending pending;
-
- if (tokenPtr->timerToken != NULL) {
- Tcl_DeleteTimerHandler(tokenPtr->timerToken);
- }
- dropPtr = (struct DropRequest *)eventPtr->xclient.data.l;
- format = XGetAtomName(dndPtr->display, dropPtr->formatAtom);
-#ifdef notdef
- fprintf(stderr, "DoDrop %s 0x%x\n", Tk_PathName(dndPtr->tkwin),
- dropPtr->window);
-#endif
- if (GetFormattedData(dndPtr, format, dropPtr->timestamp, &pending.dString)
- != TCL_OK) {
- Tcl_BackgroundError(interp);
- /* Send empty string to break target's wait loop. */
- XChangeProperty(dndPtr->display, dropPtr->window, dataPtr->commAtom,
- XA_STRING, 8, PropModeReplace, (unsigned char *)"", 0);
- return;
- }
- pending.window = dropPtr->window;
- pending.display = dndPtr->display;
- pending.commAtom = dataPtr->commAtom;
- pending.offset = 0;
- pending.packetSize = GetMaxPropertySize(dndPtr->display);
- SendDataToTarget(dndPtr, &pending);
- Tcl_DStringFree(&pending.dString);
-#ifdef notdef
- fprintf(stderr, "<- DoDrop\n");
-#endif
-}
-
-static void
-DropFinished(Dnd *dndPtr, XEvent *eventPtr)
-{
- Tcl_Interp *interp = dndPtr->interp;
- Tcl_DString dString, savedResult;
- int result;
- const char **p;
- struct DropResult {
- int mesg; /* TS_DROP_RESULT message. */
- Window window; /* Target window. */
- int timestamp; /* Transaction timestamp. */
- int result; /* Result of transaction. */
- } *dropPtr;
-
-#ifdef notdef
- fprintf(stderr, "DropFinished\n");
-#endif
- dropPtr = (struct DropResult *)eventPtr->xclient.data.l;
-
- Tcl_DStringInit(&dString);
- for (p = dndPtr->resultCmd; *p != NULL; p++) {
- Tcl_DStringAppendElement(&dString, *p);
- }
- Tcl_DStringAppendElement(&dString, Tk_PathName(dndPtr->tkwin));
- Tcl_DStringAppendElement(&dString, "action");
- Tcl_DStringAppendElement(&dString, NameOfAction(dropPtr->result));
- Tcl_DStringAppendElement(&dString, "timestamp");
- Tcl_DStringAppendElement(&dString, Blt_Utoa(dropPtr->timestamp));
-
- Tcl_DStringInit(&savedResult);
- Tcl_DStringGetResult(interp, &savedResult);
- result = Tcl_GlobalEval(interp, Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- if (result != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
- Tcl_DStringResult(interp, &savedResult);
-}
-
-
-static void
-FreeFormats(Dnd *dndPtr)
-{
- if (dndPtr->matchingFormats != NULL) {
- Blt_Free(dndPtr->matchingFormats);
- dndPtr->matchingFormats = NULL;
- }
- dndPtr->lastId = None;
-}
-
-static const char *
-GetSourceFormats(Dnd *dndPtr, Window window, int timestamp)
-{
- if (dndPtr->lastId != timestamp) {
- unsigned char *data;
-
- FreeFormats(dndPtr);
- data = GetProperty(dndPtr->display, window,
- dndPtr->dataPtr->formatsAtom);
- if (data != NULL) {
- dndPtr->matchingFormats = Blt_AssertStrdup((char *)data);
- XFree(data);
- }
- dndPtr->lastId = timestamp;
- }
- if (dndPtr->matchingFormats == NULL) {
- return "";
- }
- return dndPtr->matchingFormats;
-}
-
-
-static int
-InvokeCallback(Dnd *dndPtr, const char **cmd, int x, int y, const char *formats,
- int button, int keyState, int timestamp)
-{
- Tcl_DString dString, savedResult;
- Tcl_Interp *interp = dndPtr->interp;
- int result;
- const char **p;
-
- Tcl_DStringInit(&dString);
- for (p = cmd; *p != NULL; p++) {
- Tcl_DStringAppendElement(&dString, *p);
- }
- Tcl_DStringAppendElement(&dString, Tk_PathName(dndPtr->tkwin));
- /* Send coordinates relative to target. */
- x -= Blt_RootX(dndPtr->tkwin);
- y -= Blt_RootY(dndPtr->tkwin);
- Tcl_DStringAppendElement(&dString, "x");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(x));
- Tcl_DStringAppendElement(&dString, "y");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(y));
- Tcl_DStringAppendElement(&dString, "formats");
- if (formats == NULL) {
- formats = "";
- }
- Tcl_DStringAppendElement(&dString, formats);
- Tcl_DStringAppendElement(&dString, "button");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(button));
- Tcl_DStringAppendElement(&dString, "state");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(keyState));
- Tcl_DStringAppendElement(&dString, "timestamp");
- Tcl_DStringAppendElement(&dString, Blt_Utoa(timestamp));
- Tcl_Preserve(interp);
- Tcl_DStringInit(&savedResult);
- Tcl_DStringGetResult(interp, &savedResult);
- result = Tcl_GlobalEval(interp, Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- if (result == TCL_OK) {
- result = GetDragResult(interp, Tcl_GetStringResult(interp));
- } else {
- result = DROP_CANCEL;
- Tcl_BackgroundError(interp);
- }
- Tcl_DStringResult(interp, &savedResult);
- Tcl_Release(interp);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AcceptDrop --
- *
- * Invokes a TCL procedure to handle the target's side of the drop. A Tcl
- * procedure is invoked, either one designated for this target by the user
- * (-ondrop) or a default TCL procedure. It is passed the following
- * arguments:
- *
- * widget The path name of the target.
- * x X-coordinate of the mouse relative to the
- * widget.
- * y Y-coordinate of the mouse relative to the
- * widget.
- * formats A list of data formats acceptable to both
- * the source and target.
- * button Button pressed.
- * state Key state.
- * timestamp Timestamp of transaction.
- * action Requested action from source.
- *
- * If the TCL procedure returns "cancel", this indicates that the drop was
- * not accepted by the target and the reject symbol should be displayed.
- * Otherwise one of the following strings may be recognized:
- *
- * "cancel" Drop was canceled.
- * "copy" Source data has been successfully copied.
- * "link" Target has made a link to the data. It's
- * Ok for the source to remove it's association
- * with the data, but not to delete the data
- * itself.
- * "move" Source data has been successfully copied,
- * it's Ok for the source to delete its
- * association with the data and the data itself.
- *
- * The result is relayed back to the source via another client message.
- * The source may or may not be waiting for the result.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A TCL procedure is invoked in the target to handle the drop event.
- * The result of the drop is sent (via another ClientMessage) to the
- * source.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AcceptDrop(
- Dnd *dndPtr, /* Target where the drop event occurred. */
- int x, int y,
- const char *formats,
- int button,
- int keyState,
- int timestamp)
-{
- Tcl_Interp *interp = dndPtr->interp;
- const char **cmd;
- Tcl_DString dString, savedResult;
- int result;
-
- if (dndPtr->motionCmd != NULL) {
- result = InvokeCallback(dndPtr, dndPtr->motionCmd, x, y, formats,
- button, keyState, timestamp);
- if (result != DROP_OK) {
- return result;
- }
- }
- if (dndPtr->leaveCmd != NULL) {
- InvokeCallback(dndPtr, dndPtr->leaveCmd, x, y, formats, button,
- keyState, timestamp);
- }
- Tcl_DStringInit(&dString);
- cmd = dndPtr->dropCmd;
- if (cmd != NULL) {
- const char **p;
-
- for (p = cmd; *p != NULL; p++) {
- Tcl_DStringAppendElement(&dString, *p);
- }
- } else {
- Tcl_DStringAppendElement(&dString, "::blt::DndStdDrop");
- }
- Tcl_DStringAppendElement(&dString, Tk_PathName(dndPtr->tkwin));
- dndPtr->dropX = x - Blt_RootX(dndPtr->tkwin);
- dndPtr->dropY = y - Blt_RootY(dndPtr->tkwin);
- Tcl_DStringAppendElement(&dString, "x");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(dndPtr->dropX));
- Tcl_DStringAppendElement(&dString, "y");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(dndPtr->dropY));
- Tcl_DStringAppendElement(&dString, "formats");
- Tcl_DStringAppendElement(&dString, formats);
- Tcl_DStringAppendElement(&dString, "button");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(button));
- Tcl_DStringAppendElement(&dString, "state");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(keyState));
- Tcl_DStringAppendElement(&dString, "timestamp");
- Tcl_DStringAppendElement(&dString, Blt_Utoa(timestamp));
- Tcl_Preserve(interp);
- Tcl_DStringInit(&savedResult);
- Tcl_DStringGetResult(interp, &savedResult);
- result = Tcl_GlobalEval(interp, Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- if (result == TCL_OK) {
- result = GetAction(Tcl_GetStringResult(interp));
- } else {
- result = DROP_CANCEL;
- Tcl_BackgroundError(interp);
- }
- Tcl_DStringResult(interp, &savedResult);
- Tcl_Release(interp);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleDropEvent --
- *
- * Invokes a TCL procedure to handle the target's side of the drop. This
- * routine is triggered via a client message from the drag source
- * indicating that the token was dropped over this target. The fields of
- * the incoming message are:
- *
- * data.l[0] Message type.
- * data.l[1] Window Id of the source.
- * data.l[2] Screen X-coordinate of the pointer.
- * data.l[3] Screen Y-coordinate of the pointer.
- * data.l[4] Id of the drag&drop transaction.
- *
- * A TCL procedure is invoked, either one designated for this target by the
- * user (-ondrop) or a default TCL procedure. It is passed the following
- * arguments:
- *
- * widget The path name of the target.
- * x X-coordinate of the mouse relative to the
- * widget.
- * y Y-coordinate of the mouse relative to the
- * widget.
- * formats A list of data formats acceptable to both
- * the source and target.
- *
- * If the TCL procedure returns "cancel", this indicates that the drop was
- * not accepted by the target and the reject symbol should be displayed.
- * Otherwise one of the following strings may be recognized:
- *
- * "cancel" Drop was canceled.
- * "copy" Source data has been successfully copied.
- * "link" Target has made a link to the data. It's
- * Ok for the source to remove it's association
- * with the data, but not to delete the data
- * itself.
- * "move" Source data has been successfully copied,
- * it's Ok for the source to delete its
- * association with the data and the data itself.
- *
- * The result is relayed back to the source via another client message.
- * The source may or may not be waiting for the result.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A TCL procedure is invoked in the target to handle the drop event.
- * The result of the drop is sent (via another ClientMessage) to the
- * source.
- *
- *---------------------------------------------------------------------------
- */
-static void
-HandleDropEvent(
- Dnd *dndPtr, /* Target where the drop event
- * occurred. */
- XEvent *eventPtr) /* Message sent from the drag source. */
-{
- int button, keyState;
- int x, y;
- const char *formats;
- int result;
- struct DropInfo {
- int mesg; /* TS_DROP message. */
- Window window; /* Source window. */
- int timestamp; /* Transaction timestamp. */
- int point; /* Root X-Y coordinate of pointer. */
- int flags; /* Button/keystate information. */
- } *dropPtr;
- DropPending pending;
-
- dropPtr = (struct DropInfo *)eventPtr->xclient.data.l;
- UNPACK(dropPtr->point, x, y);
- UNPACK(dropPtr->flags, button, keyState);
-
- /* Set up temporary bookkeeping for the drop transaction */
- memset (&pending, 0, sizeof(pending));
- pending.window = dropPtr->window;
- pending.display = eventPtr->xclient.display;
- pending.timestamp = dropPtr->timestamp;
- pending.protocol = PROTO_BLT;
- pending.packetSize = GetMaxPropertySize(pending.display);
- Tcl_DStringInit(&pending.dString);
-
- formats = GetSourceFormats(dndPtr, dropPtr->window, dropPtr->timestamp);
-
- dndPtr->pendingPtr = &pending;
- result = AcceptDrop(dndPtr, x, y, formats, button, keyState,
- dropPtr->timestamp);
- dndPtr->pendingPtr = NULL;
-
- /* Target-to-Source: Drop result message. */
- SendClientMsg(dndPtr->display, dropPtr->window, dndPtr->dataPtr->mesgAtom,
- TS_DROP_RESULT, (int)Tk_WindowId(dndPtr->tkwin), dropPtr->timestamp,
- result, 0);
- FreeFormats(dndPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HandleDragEvent --
- *
- * Invokes one of 3 TCL procedures to handle the target's side of the drag
- * operation. This routine is triggered via a ClientMessage from the drag
- * source indicating that the token as either entered, moved, or left this
- * target. The source sends messages only if TCL procedures on the target
- * have been defined to watch the events. The message_type field can be
- * either
- *
- * ST_DRAG_ENTER The mouse has entered the target.
- * ST_DRAG_MOTION The mouse has moved within the target.
- * ST_DRAG_LEAVE The mouse has left the target.
- *
- * The data fields are as follows:
- * data.l[0] Message type.
- * data.l[1] Window Id of the source.
- * data.l[2] Timestamp of the drag&drop transaction.
- * data.l[3] Root X-Y coordinate of the pointer.
- * data.l[4] Button and key state information.
- *
- * For any of the 3 TCL procedures, the following arguments are passed:
- *
- * widget The path name of the target.
- * x X-coordinate of the mouse in the widget.
- * y Y-coordinate of the mouse in the widget.
- * formats A list of data formats acceptable to both
- * the source and target.
- *
- * If the TCL procedure returns "cancel", this indicates that the drag
- * operation has been canceled and the reject symbol should be displayed.
- * Otherwise it should return a boolean:
- *
- * true Target will accept drop.
- * false Target will not accept the drop.
- *
- * The purpose of the Enter and Leave procedure is to allow the target to
- * provide visual feedback that the drop can occur or not. The Motion
- * procedure is for cases where the drop area is a smaller area within the
- * target, such as a canvas item on a canvas. The procedure can determine
- * (based upon the X-Y coordinates) whether the pointer is over the canvas
- * item and return a value accordingly.
- *
- * The result of the TCL procedure is then relayed back to the source by a
- * ClientMessage.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A TCL procedure is invoked in the target to handle the drag event.
- * The result of the drag is sent (via another ClientMessage) to the
- * source.
- *
- *---------------------------------------------------------------------------
- */
-static void
-HandleDragEvent(
- Dnd *dndPtr, /* Target where the drag event
- * occurred. */
- XEvent *eventPtr) /* Message sent from the drag source. */
-{
- const char **cmd;
- int resp;
- int x, y;
- int button, keyState;
- const char *formats;
- struct DragInfo {
- int mesg; /* Drag-and-drop message type. */
- Window window; /* Source window. */
- int timestamp; /* Transaction timestamp. */
- int point; /* Root X-Y coordinate of pointer. */
- int flags; /* Button/keystate information. */
- } *dragPtr;
-
- dragPtr = (struct DragInfo *)eventPtr->xclient.data.l;
-
- cmd = NULL;
- switch (dragPtr->mesg) {
- case ST_DRAG_ENTER:
- cmd = dndPtr->enterCmd;
- break;
- case ST_DRAG_MOTION:
- cmd = dndPtr->motionCmd;
- break;
- case ST_DRAG_LEAVE:
- cmd = dndPtr->leaveCmd;
- break;
- }
- if (cmd == NULL) {
- return; /* Nothing to do. */
- }
- UNPACK(dragPtr->point, x, y);
- UNPACK(dragPtr->flags, button, keyState);
- formats = GetSourceFormats(dndPtr, dragPtr->window, dragPtr->timestamp);
- resp = InvokeCallback(dndPtr, cmd, x, y, formats, button, keyState,
- dragPtr->timestamp);
-
- /* Target-to-Source: Drag result message. */
- SendClientMsg(dndPtr->display, dragPtr->window, dndPtr->dataPtr->mesgAtom,
- TS_DRAG_STATUS, (int)Tk_WindowId(dndPtr->tkwin), dragPtr->timestamp,
- resp, 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DndEventProc --
- *
- * Invoked by Tk_HandleEvent whenever a DestroyNotify event is received
- * on a registered drag&drop source widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DndEventProc(
- ClientData clientData, /* Drag&drop record. */
- XEvent *eventPtr) /* Event description. */
-{
- Dnd *dndPtr = clientData;
-
- if (eventPtr->xany.window != Tk_WindowId(dndPtr->tkwin)) {
- return 0;
- }
- if (eventPtr->type == DestroyNotify) {
- dndPtr->tkwin = NULL;
- dndPtr->flags |= DND_DELETED;
- Tcl_EventuallyFree(dndPtr, DestroyDnd);
- return 0; /* Other handlers have to see this event too.*/
- } else if (eventPtr->type == ButtonPress) {
- dndPtr->keyState = eventPtr->xbutton.state;
- dndPtr->button = eventPtr->xbutton.button;
- return 0;
- } else if (eventPtr->type == ButtonRelease) {
- dndPtr->keyState = eventPtr->xbutton.state;
- dndPtr->button = eventPtr->xbutton.button;
- return 0;
- } else if (eventPtr->type == MotionNotify) {
- dndPtr->keyState = eventPtr->xmotion.state;
- return 0;
- } else if ((eventPtr->type == ClientMessage) &&
- (eventPtr->xclient.message_type == dndPtr->dataPtr->mesgAtom)) {
- int result;
-
- switch((unsigned int)eventPtr->xclient.data.l[0]) {
- case TS_START_DROP:
- DoDrop(dndPtr, eventPtr);
- return 1;
-
- case TS_DROP_RESULT:
- result = eventPtr->xclient.data.l[MESG_RESPONSE];
- dndPtr->tokenPtr->status = result;
- if (result == DROP_CANCEL) {
- CancelDrag(dndPtr);
- } else if (result == DROP_FAIL) {
- EventuallyRedrawToken(dndPtr);
- } else {
- dndPtr->tokenPtr->nSteps = 10;
- FadeToken(dndPtr);
- }
- if (dndPtr->resultCmd != NULL) {
- DropFinished(dndPtr, eventPtr);
- }
- return 1;
-
- case TS_DRAG_STATUS:
- result = eventPtr->xclient.data.l[MESG_RESPONSE];
- ChangeToken(dndPtr, result);
- return 1;
-
- case ST_DROP:
- HandleDropEvent(dndPtr, eventPtr);
- return 1;
-
- case ST_DRAG_ENTER:
- case ST_DRAG_MOTION:
- case ST_DRAG_LEAVE:
- HandleDragEvent(dndPtr, eventPtr);
- return 1;
- }
- }
- return 0;
-}
-
-static void
-SendPointerMessage(
- Dnd *dndPtr, /* Source drag&drop manager. */
- int eventType, /* Type of event to relay. */
- Winfo *windowPtr, /* Generic window information. */
- int x, int y) /* Root coordinates of mouse. */
-{
- /* Source-to-Target: Pointer event messages. */
- SendClientMsg(
- dndPtr->display, /* Display of recipient window. */
- windowPtr->window, /* Recipient window. */
- dndPtr->dataPtr->mesgAtom, /* Message type. */
- eventType, /* Data 1 */
- (int)Tk_WindowId(dndPtr->tkwin), /* Data 2 */
- dndPtr->timestamp, /* Data 3 */
- PACK(x, y), /* Data 4 */
- PACK(dndPtr->button, dndPtr->keyState)); /* Data 5 */
- /* Don't wait the response. */
-}
-
-static void
-RelayEnterEvent(Dnd *dndPtr, Winfo *windowPtr, int x, int y)
-{
- if ((windowPtr != NULL) && (windowPtr->eventFlags & WATCH_ENTER)) {
- SendPointerMessage(dndPtr, ST_DRAG_ENTER, windowPtr, x, y);
- }
-}
-
-static void
-RelayLeaveEvent(Dnd *dndPtr, Winfo *windowPtr, int x, int y)
-{
- if ((windowPtr != NULL) && (windowPtr->eventFlags & WATCH_LEAVE)) {
- SendPointerMessage(dndPtr, ST_DRAG_LEAVE, windowPtr, x, y);
- }
-}
-
-static void
-RelayMotionEvent(Dnd *dndPtr, Winfo *windowPtr, int x, int y)
-{
- if ((windowPtr != NULL) && (windowPtr->eventFlags & WATCH_MOTION)) {
- SendPointerMessage(dndPtr, ST_DRAG_MOTION, windowPtr, x, y);
- }
-}
-
-static void
-RelayDropEvent(Dnd *dndPtr, Winfo *windowPtr, int x, int y)
-{
- SendPointerMessage(dndPtr, ST_DROP, windowPtr, x, y);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreeWinfo --
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreeWinfo(Winfo *windowPtr) /* Window rep to be freed */
-{
- Winfo *childPtr;
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(windowPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- childPtr = Blt_Chain_GetValue(link);
- FreeWinfo(childPtr); /* Recursively free children. */
- }
- if (windowPtr->matches != NULL) {
- Blt_Free(windowPtr->matches);
- }
- Blt_Chain_Destroy(windowPtr->chain);
- Blt_Free(windowPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetWinfo --
- *
- * Invoked during "drag" operations. Digs into the root window
- * hierarchy and caches the window-related information.
- * If the current point lies over an uninitialized window (i.e.
- * one that already has an allocated Winfo structure, but has
- * not been filled in yet), this routine is called to query
- * window coordinates. If the window has any children, more
- * uninitialized Winfo structures are allocated. Further queries
- * will cause these structures to be initialized in turn.
- *
- *---------------------------------------------------------------------------
- */
-static void
-GetWinfo(Display *display, Winfo *windowPtr) /* window rep to be initialized */
-{
- int visible;
-
- if (windowPtr->initialized) {
- return;
- }
- /* Query for the window coordinates. */
- visible = GetWindowArea(display, windowPtr);
- if (visible) {
- Blt_ChainLink link;
- Blt_Chain chain;
- Winfo *childPtr;
-
- /* Add offset from parent's origin to coordinates */
- if (windowPtr->parentPtr != NULL) {
- windowPtr->x1 += windowPtr->parentPtr->x1;
- windowPtr->y1 += windowPtr->parentPtr->y1;
- windowPtr->x2 += windowPtr->parentPtr->x1;
- windowPtr->y2 += windowPtr->parentPtr->y1;
- }
- /*
- * Collect a list of child windows, sorted in z-order. The
- * topmost window will be first in the list.
- */
- chain = GetWindowZOrder(display, windowPtr->window);
-
- /* Add and initialize extra slots if needed. */
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- childPtr = Blt_AssertCalloc(1, sizeof(Winfo));
- childPtr->initialized = FALSE;
- childPtr->window = (Window)Blt_Chain_GetValue(link);
- childPtr->parentPtr = windowPtr;
- Blt_Chain_SetValue(link, childPtr);
- }
- windowPtr->chain = chain;
- } else {
- /* If it's not viewable don't bother doing anything else. */
- windowPtr->x1 = windowPtr->y1 = windowPtr->x2 = windowPtr->y2 = -1;
- windowPtr->chain = NULL;
- }
- windowPtr->initialized = TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InitRoot --
- *
- * Invoked at the start of a "drag" operation to capture the
- * positions of all windows on the current root. Queries the
- * entire window hierarchy and determines the placement of each
- * window. Queries the "BltDndTarget" property info where
- * appropriate. This information is used during the drag
- * operation to determine when the drag&drop token is over a
- * valid drag&drop target.
- *
- * Results:
- * Returns the record for the root window, which contains records
- * for all other windows as children.
- *
- *---------------------------------------------------------------------------
- */
-static Winfo *
-InitRoot(Dnd *dndPtr)
-{
- Winfo *rootPtr;
-
- rootPtr = Blt_AssertCalloc(1, sizeof(Winfo));
- rootPtr->window = DefaultRootWindow(dndPtr->display);
- dndPtr->windowPtr = NULL;
- GetWinfo(dndPtr->display, rootPtr);
- return rootPtr;
-}
-
-
-static int
-ParseProperty(Tcl_Interp *interp, Dnd *dndPtr, Winfo *windowPtr, char *data)
-{
- int argc;
- const char **argv;
- int eventFlags;
- Tcl_DString dString;
- int count;
- int i;
-
- if (Tcl_SplitList(interp, data, &argc, &argv) != TCL_OK) {
- return TCL_ERROR; /* Malformed property list. */
- }
- if (argc < 1) {
- Tcl_AppendResult(interp, "Malformed property \"", data, "\"",
- (char *)NULL);
- goto error;
- }
- if (Tcl_GetInt(interp, argv[PROP_WATCH_FLAGS], &eventFlags) != TCL_OK) {
- goto error;
- }
-
- /* target flags, type1, type2, ... */
- /*
- * The target property contains a list of possible formats.
- * Compare this with what formats the source is willing to
- * convert and compress the list down to just the matching
- * formats. It's up to the target to request the specific
- * type (or types) that it wants.
- */
- count = 0;
- Tcl_DStringInit(&dString);
- if (dndPtr->reqFormats == NULL) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- char *fmt;
-
- for (i = 1; i < argc; i++) {
- for(hPtr = Blt_FirstHashEntry(&dndPtr->getDataTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- fmt = Blt_GetHashKey(&dndPtr->getDataTable, hPtr);
- if ((*fmt == argv[i][0]) && (strcmp(fmt, argv[i]) == 0)) {
- Tcl_DStringAppendElement(&dString, argv[i]);
- count++;
- break;
- }
- }
- }
- } else {
- const char **s;
-
- for (i = 1; i < argc; i++) {
- for (s = dndPtr->reqFormats; *s != NULL; s++) {
- if ((**s == argv[i][0]) && (strcmp(*s, argv[i]) == 0)) {
- Tcl_DStringAppendElement(&dString, argv[i]);
- count++;
- }
- }
- }
- }
- if (count == 0) {
-#ifdef notdef
- fprintf(stderr, "source/target mismatch: No matching types\n");
-#endif
- return TCL_BREAK;
- }
- if (eventFlags != 0) {
- SetProperty(dndPtr->tkwin, dndPtr->dataPtr->formatsAtom,
- Tcl_DStringValue(&dString));
- windowPtr->matches = NULL;
- } else {
- windowPtr->matches = Blt_AssertStrdup(Tcl_DStringValue(&dString));
- }
- Tcl_DStringFree(&dString);
- windowPtr->eventFlags = eventFlags;
- return TCL_OK;
- error:
- Blt_Free(argv);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OverTarget --
- *
- * Checks to see if a compatible drag&drop target exists at the
- * given position. A target is "compatible" if it is a drag&drop
- * window, and if it has a handler that is compatible with the
- * current source window.
- *
- * Results:
- * Returns a pointer to a structure describing the target, or NULL
- * if no compatible target is found.
- *
- *---------------------------------------------------------------------------
- */
-static Winfo *
-OverTarget(Dnd *dndPtr) /* drag&drop source window */
-{
- Tcl_Interp *interp = dndPtr->interp;
- int x, y;
- int vx, vy;
- int dummy;
- Winfo *windowPtr;
-
- /*
- * If no window info has been been gathered yet for this target,
- * then abort this call. This probably means that the token is
- * moved before it has been properly built.
- */
- if (dndPtr->rootPtr == NULL) {
- fprintf(stderr, "rootPtr not initialized\n");
- return NULL;
- }
- /* Adjust current location for virtual root windows. */
- Tk_GetVRootGeometry(dndPtr->tkwin, &vx, &vy, &dummy, &dummy);
- x = dndPtr->x + vx;
- y = dndPtr->y + vy;
-
- windowPtr = FindTopWindow(dndPtr, x, y);
- if (windowPtr == NULL) {
- return NULL; /* Not over a window. */
- }
- if ((!dndPtr->selfTarget) &&
- (Tk_WindowId(dndPtr->tkwin) == windowPtr->window)) {
- return NULL; /* If the self-target flag isn't set,
- * don't allow the source window to
- * drop onto itself. */
- }
- if (!windowPtr->lookedForProperty) {
- unsigned char *data;
- int result;
-
- windowPtr->lookedForProperty = TRUE;
- /* See if this window has a "BltDndTarget" property. */
- data = GetProperty(dndPtr->display, windowPtr->window,
- dndPtr->dataPtr->targetAtom);
- if (data == NULL) {
-#ifdef notdef
- fprintf(stderr, "No property on 0x%x\n", windowPtr->window);
-#endif
- return NULL; /* No such property on window. */
- }
- result = ParseProperty(interp, dndPtr, windowPtr, (char *)data);
- XFree(data);
- if (result == TCL_BREAK) {
-#ifdef notdef
- fprintf(stderr, "No matching formats\n");
-#endif
- return NULL;
- }
- if (result != TCL_OK) {
- Tcl_BackgroundError(interp);
- return NULL; /* Malformed property list. */
- }
- windowPtr->isTarget = TRUE;
- }
- if (!windowPtr->isTarget) {
- return NULL;
- }
- return windowPtr;
-
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AddTargetProperty --
- *
- * Attaches a drag&drop property to the given target window.
- * This property allows us to recognize the window later as a
- * valid target. It also stores important information including
- * the interpreter managing the target and the pathname of the
- * target window. Usually this routine is called when the target
- * is first registered or first exposed (so that the X-window
- * really exists).
- *
- *---------------------------------------------------------------------------
- */
-static void
-AddTargetProperty(Dnd *dndPtr) /* drag&drop target window data */
-{
- Tcl_DString dString;
- Blt_HashEntry *hPtr;
- unsigned int eventFlags;
- Blt_HashSearch cursor;
- char *fmt;
- char string[200];
-
- Tcl_DStringInit(&dString);
- /*
- * Each target window's dnd property contains
- *
- * 1. Mouse event flags.
- * 2. List of all the data types that can be handled. If none
- * are listed, then all can be handled.
- */
- eventFlags = 0;
- if (dndPtr->enterCmd != NULL) {
- eventFlags |= WATCH_ENTER;
- }
- if (dndPtr->leaveCmd != NULL) {
- eventFlags |= WATCH_LEAVE;
- }
- if (dndPtr->motionCmd != NULL) {
- eventFlags |= WATCH_MOTION;
- }
- sprintf_s(string, 200, "0x%x", eventFlags);
- Tcl_DStringAppendElement(&dString, string);
- for (hPtr = Blt_FirstHashEntry(&dndPtr->setDataTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- fmt = Blt_GetHashKey(&dndPtr->setDataTable, hPtr);
- Tcl_DStringAppendElement(&dString, fmt);
- }
- SetProperty(dndPtr->tkwin, dndPtr->dataPtr->targetAtom,
- Tcl_DStringValue(&dString));
- dndPtr->targetPropertyExists = TRUE;
- Tcl_DStringFree(&dString);
-}
-
-static void
-CancelDrag(Dnd *dndPtr)
-{
- if (dndPtr->flags & DND_INITIATED) {
- dndPtr->tokenPtr->nSteps = 10;
- SnapToken(dndPtr);
- StopActiveCursor(dndPtr);
- if (dndPtr->cursor == None) {
- Tk_UndefineCursor(dndPtr->tkwin);
- } else {
- Tk_DefineCursor(dndPtr->tkwin, dndPtr->cursor);
- }
- }
- if (dndPtr->rootPtr != NULL) {
- FreeWinfo(dndPtr->rootPtr);
- dndPtr->rootPtr = NULL;
- }
-}
-
-static int
-DragInit(Dnd *dndPtr, int x, int y)
-{
- Token *tokenPtr = dndPtr->tokenPtr;
- int result;
- Winfo *newPtr;
-
- assert((dndPtr->flags & DND_ACTIVE) == DND_SELECTED);
-
- if (dndPtr->rootPtr != NULL) {
- FreeWinfo(dndPtr->rootPtr);
- }
- dndPtr->rootPtr = InitRoot(dndPtr); /* Reset information cache. */
- dndPtr->flags &= ~DND_VOIDED;
-
- dndPtr->x = x; /* Save current location. */
- dndPtr->y = y;
- result = TRUE;
- Tcl_Preserve(dndPtr);
- if (dndPtr->packageCmd != NULL) {
- Tcl_DString dString, savedResult;
- Tcl_Interp *interp = dndPtr->interp;
- int status;
- const char **p;
- int rx, ry;
-
- Tcl_DStringInit(&dString);
- for (p = dndPtr->packageCmd; *p != NULL; p++) {
- Tcl_DStringAppendElement(&dString, *p);
- }
- Tcl_DStringAppendElement(&dString, Tk_PathName(dndPtr->tkwin));
- rx = dndPtr->dragX - Blt_RootX(dndPtr->tkwin);
- ry = dndPtr->dragY - Blt_RootY(dndPtr->tkwin);
- Tcl_DStringAppendElement(&dString, "x");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(rx));
- Tcl_DStringAppendElement(&dString, "y");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(ry));
- Tcl_DStringAppendElement(&dString, "button");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(dndPtr->button));
- Tcl_DStringAppendElement(&dString, "state");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(dndPtr->keyState));
- Tcl_DStringAppendElement(&dString, "timestamp");
- Tcl_DStringAppendElement(&dString, Blt_Utoa(dndPtr->timestamp));
- Tcl_DStringAppendElement(&dString, "token");
- Tcl_DStringAppendElement(&dString, Tk_PathName(tokenPtr->tkwin));
-
- Tcl_DStringInit(&savedResult);
- Tcl_DStringGetResult(interp, &savedResult);
- dndPtr->flags |= DND_IN_PACKAGE;
- status = Tcl_GlobalEval(interp, Tcl_DStringValue(&dString));
- dndPtr->flags &= ~DND_IN_PACKAGE;
- if (status == TCL_OK) {
- result = GetDragResult(interp, Tcl_GetStringResult(interp));
- } else {
- Tcl_BackgroundError(interp);
- }
- Tcl_DStringFree(&dString);
- Tcl_DStringResult(interp, &savedResult);
- Tcl_DStringFree(&dString);
- if (status != TCL_OK) {
- HideToken(dndPtr);
- Tcl_Release(dndPtr);
- return TCL_ERROR;
- }
- }
- if (dndPtr->flags & DND_VOIDED) {
- HideToken(dndPtr);
- Tcl_Release(dndPtr);
- return TCL_RETURN;
- }
- if ((!result) || (dndPtr->flags & DND_DELETED)) {
- HideToken(dndPtr);
- Tcl_Release(dndPtr);
- return TCL_RETURN;
- }
- Tcl_Release(dndPtr);
-
- if (dndPtr->cursor != None) {
- Tk_Cursor cursor;
-
- /* Save the old cursor */
- cursor = GetWidgetCursor(dndPtr->interp, dndPtr->tkwin);
- if (dndPtr->cursor != None) {
- Tk_FreeCursor(dndPtr->display, dndPtr->cursor);
- }
- dndPtr->cursor = cursor;
- if (dndPtr->cursors != NULL) {
- /* Temporarily install the drag-and-drop cursor. */
- Tk_DefineCursor(dndPtr->tkwin, dndPtr->cursors[0]);
- }
- }
- if (Tk_WindowId(tokenPtr->tkwin) == None) {
- Tk_MakeWindowExist(tokenPtr->tkwin);
- }
- if (!Tk_IsMapped(tokenPtr->tkwin)) {
- Tk_MapWindow(tokenPtr->tkwin);
- }
- dndPtr->flags |= DND_INITIATED;
- newPtr = OverTarget(dndPtr);
- RelayEnterEvent(dndPtr, newPtr, x, y);
- dndPtr->windowPtr = newPtr;
- tokenPtr->status = (newPtr != NULL) ? DROP_OK : DROP_CONTINUE;
- if (tokenPtr->lastStatus != tokenPtr->status) {
- EventuallyRedrawToken(dndPtr);
- }
- MoveToken(dndPtr); /* Move token to current drag point. */
- RaiseToken(dndPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CancelOp --
- *
- * Cancels the current drag&drop operation for the source. Calling
- * this operation does not affect the transfer of data from the
- * source to the target, once the drop has been made. From the
- * source's point of view, the drag&drop operation is already over.
- *
- * Example: dnd cancel .widget
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Hides the token and sets a flag indicating that further "drag"
- * and "drop" operations should be ignored.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CancelOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Dnd *dndPtr;
-
- if (GetDndFromObj(clientData, interp, objv[2], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (!dndPtr->isSource) {
- Tcl_AppendResult(interp, "widget \"", Tk_PathName(dndPtr->tkwin),
- "\" is not a registered drag&drop source.", (char *)NULL);
- return TCL_ERROR;
- }
- /* Send the target a Leave message so it can change back. */
- RelayLeaveEvent(dndPtr, dndPtr->windowPtr, 0, 0);
- CancelDrag(dndPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CgetOp --
- *
- * Called to process an (objc,objv) list to configure (or
- * reconfigure) a drag&drop widget.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED*/
-static int
-CgetOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Dnd *dndPtr;
-
- if (GetDndFromObj(clientData, interp, objv[2], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return Blt_ConfigureValueFromObj(interp, dndPtr->tkwin, configSpecs,
- (char *)dndPtr, objv[3], 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Called to process an (objc,objv) list to configure (or
- * reconfigure) a drag&drop widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp, /* current interpreter */
- int objc, /* number of arguments */
- Tcl_Obj *const *objv) /* argument strings */
-{
- Dnd *dndPtr;
- int flags;
-
- if (GetDndFromObj(clientData, interp, objv[2], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- flags = BLT_CONFIG_OBJV_ONLY;
- if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, dndPtr->tkwin, configSpecs,
- (char *)dndPtr, (Tcl_Obj *)NULL, flags);
- } else if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, dndPtr->tkwin, configSpecs,
- (char *)dndPtr, objv[3], flags);
- }
- if (Blt_ConfigureWidgetFromObj(interp, dndPtr->tkwin, configSpecs, objc - 3,
- objv + 3, (char *)dndPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- if (ConfigureDnd(interp, dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Deletes the drag&drop manager from the widget. If a "-source"
- * or "-target" switch is present, only that component of the
- * drag&drop manager is shutdown. The manager is not deleted
- * unless both the target and source components are shutdown.
- *
- * Example: dnd delete .widget
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Deletes the drag&drop manager. Also the source and target window
- * properties are removed from the widget.
- *
- * ------------------------------------------------------------------------
- */
-static int
-DeleteOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- int i;
-
- for(i = 3; i < objc; i++) {
- Dnd *dndPtr;
-
- if (GetDndFromObj(clientData, interp, objv[i], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- dndPtr->flags |= DND_DELETED;
- Tcl_EventuallyFree(dndPtr, DestroyDnd);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SelectOp --
- *
- * Initializes a drag&drop transaction. Typically this operation
- * is called from a ButtonPress event on a source widget. The
- * window information cache is initialized, and the token is
- * initialized and displayed.
- *
- * Example: dnd pickup .widget x y
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * The token is initialized and displayed. This may require invoking
- * a user-defined package command. The window information cache is
- * also initialized.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SelectOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Dnd *dndPtr;
- int x, y, timestamp;
- Token *tokenPtr;
-
- if (GetDndFromObj(clientData, interp, objv[2], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (!dndPtr->isSource) {
- Tcl_AppendResult(interp, "widget \"", Tk_PathName(dndPtr->tkwin),
- "\" is not a registered drag&drop source.", (char *)NULL);
- return TCL_ERROR;
- }
- tokenPtr = dndPtr->tokenPtr;
- if (tokenPtr == NULL) {
- Tcl_AppendResult(interp, "no drag&drop token created for \"",
- objv[2], "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (Tcl_GetIntFromObj(interp, objv[5], ×tamp) != TCL_OK) {
- return TCL_ERROR;
- }
- if (dndPtr->flags & (DND_IN_PACKAGE | DND_ACTIVE | DND_VOIDED)) {
- return TCL_OK;
- }
-
- if (tokenPtr->timerToken != NULL) {
- HideToken(dndPtr); /* If the user selected again before the
- * token snap/melt has completed, first
- * disable the token timer callback. */
- }
- /* At this point, simply save the starting pointer location. */
- dndPtr->dragX = x, dndPtr->dragY = y;
- GetTokenPosition(dndPtr, x, y);
- tokenPtr->startX = tokenPtr->x;
- tokenPtr->startY = tokenPtr->y;
- dndPtr->timestamp = timestamp;
- dndPtr->flags |= DND_SELECTED;
-
- if (dndPtr->dragStart == 0) {
- if (DragInit(dndPtr, x, y) == TCL_ERROR) {
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DragOp --
- *
- * Continues the drag&drop transaction. Typically this operation
- * is called from a button Motion event on a source widget. Pointer
- * event messages are possibly sent to the target, indicating Enter,
- * Leave, and Motion events.
- *
- * Example: dnd drag .widget x y
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Pointer events are relayed to the target (if the mouse is over
- * one).
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DragOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Winfo *newPtr, *oldPtr;
- Dnd *dndPtr;
- int x, y;
-
- if (GetDndFromObj(clientData, interp, objv[2], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (!dndPtr->isSource) {
- Tcl_AppendResult(interp, "widget \"", Tk_PathName(dndPtr->tkwin),
- "\" is not a registered drag&drop source.", (char *)NULL);
- return TCL_ERROR;
- }
- if (dndPtr->tokenPtr == NULL) {
- Tcl_AppendResult(interp, "no drag&drop token created for \"",
- objv[2], "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
-
- if ((dndPtr->flags & DND_SELECTED) == 0) {
- return TCL_OK; /* Re-entered this routine. */
- }
- /*
- * The following code gets tricky because the package command may
- * call "update" or "tkwait". A motion event may then trigger
- * this routine, before the token has been initialized. Until the
- * package command finishes, no target messages are sent and drops
- * are silently ignored. Note that we do still track mouse
- * movements, so that when the package command completes, it will
- * have the latest pointer position.
- */
- dndPtr->x = x; /* Save current location. */
- dndPtr->y = y;
-
- if (dndPtr->flags & DND_IN_PACKAGE) {
- return TCL_OK; /* Re-entered this routine. */
- }
- if ((dndPtr->flags & DND_INITIATED) == 0) {
- int dx, dy;
- int result;
-
- dx = dndPtr->dragX - x;
- dy = dndPtr->dragY - y;
- if ((ABS(dx) < dndPtr->dragStart) && (ABS(dy) < dndPtr->dragStart)) {
- return TCL_OK;
- }
- result = DragInit(dndPtr, x, y);
- if (result == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (result == TCL_RETURN) {
- return TCL_OK;
- }
- }
- if (dndPtr->flags & DND_VOIDED) {
- return TCL_OK;
- }
- oldPtr = dndPtr->windowPtr;
- newPtr = OverTarget(dndPtr);
- if (newPtr == oldPtr) {
- RelayMotionEvent(dndPtr, oldPtr, x, y);
- dndPtr->windowPtr = oldPtr;
- } else {
- RelayLeaveEvent(dndPtr, oldPtr, x, y);
- RelayEnterEvent(dndPtr, newPtr, x, y);
- dndPtr->windowPtr = newPtr;
- }
- dndPtr->tokenPtr->status = (newPtr != NULL) ? DROP_OK : DROP_CONTINUE;
- if (dndPtr->tokenPtr->lastStatus != dndPtr->tokenPtr->status) {
- EventuallyRedrawToken(dndPtr);
- }
- MoveToken(dndPtr); /* Move token to current drag point. */
- RaiseToken(dndPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * DropOp --
- *
- * Finishes the drag&drop transaction by dropping the data on the
- * selected target. Typically this operation is called from a
- * ButtonRelease event on a source widget. Note that a Leave message
- * is always sent to the target so that is can un-highlight itself.
- * The token is hidden and a drop message is sent to the target.
- *
- * Example: dnd drop .widget x y
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * The token is hidden and a drop message is sent to the target.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DropOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Winfo *windowPtr;
- Dnd *dndPtr;
- int x, y;
-
- if (GetDndFromObj(clientData, interp, objv[2], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (!dndPtr->isSource) {
- Tcl_AppendResult(interp, "widget \"", Tk_PathName(dndPtr->tkwin),
- "\" is not a registered drag&drop source.", (char *)NULL);
- return TCL_ERROR;
- }
- if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- dndPtr->x = x; /* Save drag&drop location */
- dndPtr->y = y;
- if ((dndPtr->flags & DND_INITIATED) == 0) {
- return TCL_OK; /* Never initiated any drag operation. */
- }
- if (dndPtr->flags & DND_VOIDED) {
- HideToken(dndPtr);
- return TCL_OK;
- }
- windowPtr = OverTarget(dndPtr);
- if (windowPtr != NULL) {
- if (windowPtr->matches != NULL) {
- SetProperty(dndPtr->tkwin, dndPtr->dataPtr->formatsAtom,
- windowPtr->matches);
- }
- MoveToken(dndPtr); /* Move token to current drag point. */
- RaiseToken(dndPtr);
- RelayDropEvent(dndPtr, windowPtr, x, y);
-#ifdef notdef
- tokenPtr->nSteps = 10;
- FadeToken(dndPtr);
-#endif
- } else {
- CancelDrag(dndPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetdataOp --
- *
- * Registers one or more data formats with a drag&drop source.
- * Each format has a TCL command associated with it. This command
- * is automatically invoked whenever data is pulled from the source
- * to a target requesting the data in that particular format. The
- * purpose of the TCL command is to get the data from in the
- * application. When the TCL command is invoked, special percent
- * substitutions are made:
- *
- * %# Drag&drop transaction timestamp.
- * %W Source widget.
- *
- * If a converter (command) already exists for a format, it
- * overwrites the existing command.
- *
- * Example: dnd getdata .widget "color" { %W cget -bg }
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetdataOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Dnd *dndPtr;
- int i;
-
- if (GetDndFromObj(clientData, interp, objv[2], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 3) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- /* Return list of source data formats */
- for (hPtr = Blt_FirstHashEntry(&dndPtr->getDataTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Tcl_AppendElement(interp,
- Blt_GetHashKey(&dndPtr->getDataTable, hPtr));
- }
- return TCL_OK;
- }
-
- if (objc == 4) {
- Blt_HashEntry *hPtr;
- const char *string;
- const char **argv;
-
- string = Tcl_GetString(objv[3]);
- hPtr = Blt_FindHashEntry(&dndPtr->getDataTable, string);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "can't find handler for format \"",
- string, "\" for source \"", Tk_PathName(dndPtr->tkwin), "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- argv = Blt_GetHashValue(hPtr);
- if (argv == NULL) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), "", -1);
- } else {
- Tcl_SetObjResult(interp, PrintList(interp, argv));
- }
- return TCL_OK;
- }
-
- for (i = 3; i < objc; i += 2) {
- Blt_HashEntry *hPtr;
- const char **argv;
- int argc;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&dndPtr->getDataTable,
- Tcl_GetString(objv[i]), &isNew);
- if (!isNew) {
- argv = Blt_GetHashValue(hPtr);
- Blt_Free(argv);
- }
- if (Tcl_SplitList(interp, Tcl_GetString(objv[i + 1]), &argc, &argv)
- != TCL_OK) {
- Blt_DeleteHashEntry(&dndPtr->getDataTable, hPtr);
- return TCL_ERROR;
- }
- Blt_SetHashValue(hPtr, argv);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * Returns the names of all the drag&drop managers. If either
- * a "-source" or "-target" switch is present, only the names of
- * managers acting as sources or targets respectively are returned.
- * A pattern argument may also be given. Only those managers
- * matching the pattern are returned.
- *
- * Examples: dnd names
- * dnd names -source
- * dnd names -target
- * dnd names .*label
- * Results:
- * A standard TCL result. A TCL list of drag&drop manager
- * names is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-NamesOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- DndInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Dnd *dndPtr;
- int findSources, findTargets;
- char *string;
- Tcl_Obj *listObjPtr;
-
- findSources = findTargets = TRUE;
- if (objc > 2) {
- string = Tcl_GetString(objv[2]);
- if ((string[0] == '-') && (strcmp(string, "-source") == 0)) {
- findTargets = FALSE;
- objc--, objv++;
- } else if ((string[0] == '-') && (strcmp(string, "-target") == 0)) {
- findSources = FALSE;
- objc--, objv++;
- }
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&dataPtr->dndTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- dndPtr = Blt_GetHashValue(hPtr);
- if (objc > 3) {
- string = Tcl_GetString(objv[3]);
- if (!Tcl_StringMatch(Tk_PathName(dndPtr->tkwin), string)) {
- continue;
- }
- }
- if (((findSources) && (dndPtr->isSource)) ||
- ((findTargets) && (dndPtr->isTarget))) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(Tk_PathName(dndPtr->tkwin), -1));
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-
-#ifdef notdef
-RunCommand(Dnd *dndPtr, char **formatCmd)
-{
- Tcl_DString dString, savedResult;
- Tcl_Obj **objv;
- char **p;
-
- objc = 0;
- for (objc = 0, p = formatCmd; *p != NULL; p++) {
- objc++;
- }
- objc += 12;
- objv = Blt_AssertMalloc(sizeof(Tcl_Obj *) * (objc + 1));
- for (i = 0; p = formatCmd; *p != NULL; p++, i++) {
- objv[i] = Tcl_NewStringObj(*p, -1);
- }
- objv[i++] = Tcl_NewStringObj(Tk_PathName(dndPtr->tkwin), -1);
- objv[i++] = Tcl_NewStringObj("x", 1);
- objv[i++] = Tcl_NewStringObj("x", 1);
- objv[i++] = Tcl_NewIntObj(dndPtr->dropX);
- objv[i++] = Tcl_NewStringObj("y", 1);
- objv[i++] = Tcl_NewIntObj(dndPtr->dropY);
- objv[i++] = Tcl_NewStringObj("timestamp", 9);
- objv[i++] = Tcl_NewStringObj(Blt_Utoa(dndPtr->pendingPtr->timestamp), -1);
- objv[i++] = Tcl_NewStringObj("format", 6);
- objv[i++] = Tcl_NewStringObj(fmt, -1);
- objv[i++] = Tcl_NewStringObj("value", 5);
- objv[i++] = Tcl_NewStringObj(
- Tcl_DStringValue(&dndPtr->pendingPtr->dString),
- Tcl_DStringLength(&dndPtr->pendingPtr->dString));
- for (i = 0; i < objc; i++) {
- Tcl_IncrRefCount(objv[i]);
- }
- Tcl_DStringInit(&savedResult);
- Tcl_DStringGetResult(interp, &savedResult);
- if (Tcl_EvalObjv(interp, objc, objv, 0) != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
- Tcl_DStringResult(interp, &savedResult);
- for (i = 0; i < objc; i++) {
- Tcl_DecrRefCount(objv[i]);
- }
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * PullOp --
- *
- * Pulls the current data from the source in the given format.
- * application.
- *
- * dnd pull .widget format data
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * Invokes the target's data converter to store the data.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PullOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Dnd *dndPtr; /* drag&drop source record */
- int result;
- char **formatCmd;
- char *fmt;
- Blt_HashEntry *hPtr;
-
- if (GetDndFromObj(clientData, interp, objv[2], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (!dndPtr->isTarget) {
- Tcl_AppendResult(interp, "widget \"", Tk_PathName(dndPtr->tkwin),
- "\" is not a registered drag&drop target.", (char *)NULL);
- return TCL_ERROR;
- }
- fmt = Tcl_GetString(objv[3]);
- hPtr = Blt_FindHashEntry(&dndPtr->setDataTable, fmt);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "can't find format \"", fmt,
- "\" in target \"", Tk_PathName(dndPtr->tkwin), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- formatCmd = Blt_GetHashValue(hPtr);
- if (dndPtr->pendingPtr == NULL) {
- Tcl_AppendResult(interp, "no drop in progress", (char *)NULL);
- return TCL_ERROR;
- }
-
- CompleteDataTransaction(dndPtr, fmt, dndPtr->pendingPtr);
- result = TCL_OK;
- if (Tcl_DStringLength(&dndPtr->pendingPtr->dString) > 0) {
- Tcl_DString dString, savedResult;
- char **p;
-
- Tcl_DStringInit(&dString);
- for (p = formatCmd; *p != NULL; p++) {
- Tcl_DStringAppendElement(&dString, *p);
- }
- Tcl_DStringAppendElement(&dString, Tk_PathName(dndPtr->tkwin));
- Tcl_DStringAppendElement(&dString, "x");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(dndPtr->dropX));
- Tcl_DStringAppendElement(&dString, "y");
- Tcl_DStringAppendElement(&dString, Blt_Itoa(dndPtr->dropY));
- Tcl_DStringAppendElement(&dString, "timestamp");
- Tcl_DStringAppendElement(&dString,
- Blt_Utoa(dndPtr->pendingPtr->timestamp));
- Tcl_DStringAppendElement(&dString, "format");
- Tcl_DStringAppendElement(&dString, Tcl_GetString(objv[3]));
- Tcl_DStringAppendElement(&dString, "value");
- Tcl_DStringAppendElement(&dString,
- Tcl_DStringValue(&dndPtr->pendingPtr->dString));
- Tcl_DStringInit(&savedResult);
- Tcl_DStringGetResult(interp, &savedResult);
- if (Tcl_GlobalEval(interp, Tcl_DStringValue(&dString)) != TCL_OK) {
- Tcl_BackgroundError(interp);
- }
- Tcl_DStringResult(interp, &savedResult);
- Tcl_DStringFree(&dString);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetdataOp --
- *
- * Registers one or more data formats with a drag&drop target.
- * Each format has a TCL command associated with it. This command
- * is automatically invoked whenever data arrives from a source
- * to be converted to that particular format. The purpose of the
- * command is to set the data somewhere in the application (either
- * using a TCL command or variable). When the TCL command is invoked,
- * special percent substitutions are made:
- *
- * %# Drag&drop transaction timestamp.
- * %W Target widget.
- * %v Data value transfered from the source to
- * be converted into the correct format.
- *
- * If a converter (command) already exists for a format, it
- * overwrites the existing command.
- *
- * Example: dnd setdata .widget color { . configure -bg %v }
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SetdataOp(
- ClientData clientData,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Dnd *dndPtr;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- int i;
-
- if (GetDndFromObj(clientData, interp, objv[2], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 3) {
- /* Show target handler data formats */
- for (hPtr = Blt_FirstHashEntry(&dndPtr->setDataTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Tcl_AppendElement(interp,
- Blt_GetHashKey(&dndPtr->setDataTable, hPtr));
- }
- return TCL_OK;
- }
- if (objc == 4) {
- const char **argv;
-
- hPtr = Blt_FindHashEntry(&dndPtr->setDataTable, objv[3]);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "can't find handler for format \"",
- objv[3], "\" for target \"", Tk_PathName(dndPtr->tkwin), "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- argv = Blt_GetHashValue(hPtr);
- if (argv == NULL) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), "", -1);
- } else {
- Tcl_SetObjResult(interp, PrintList(interp, argv));
- }
- return TCL_OK;
- }
- for (i = 3; i < objc; i += 2) {
- const char **argv;
- int isNew, argc;
-
- hPtr = Blt_CreateHashEntry(&dndPtr->setDataTable,
- Tcl_GetString(objv[i]), &isNew);
- if (!isNew) {
- argv = Blt_GetHashValue(hPtr);
- Blt_Free(argv);
- }
- if (Tcl_SplitList(interp, Tcl_GetString(objv[i + 1]), &argc, &argv)
- != TCL_OK) {
- Blt_DeleteHashEntry(&dndPtr->setDataTable, hPtr);
- return TCL_ERROR;
- }
- Blt_SetHashValue(hPtr, argv);
- }
- AddTargetProperty(dndPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RegisterOp --
- *
- * dnd register .window
- *---------------------------------------------------------------------------
- */
-static int
-RegisterOp(
- ClientData clientData,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- DndInterpData *dataPtr = clientData;
- Tk_Window tkwin;
- Blt_HashEntry *hPtr;
- Dnd *dndPtr;
- int isNew;
-
- tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), dataPtr->tkMain);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- hPtr = Blt_CreateHashEntry(&dataPtr->dndTable, (char *)tkwin, &isNew);
- if (!isNew) {
- Tcl_AppendResult(interp, "\"", Tk_PathName(tkwin),
- "\" is already registered as a drag&drop manager", (char *)NULL);
- return TCL_ERROR;
- }
- dndPtr = CreateDnd(interp, tkwin);
- dndPtr->hashPtr = hPtr;
- dndPtr->dataPtr = dataPtr;
- Blt_SetHashValue(hPtr, dndPtr);
- if (Blt_ConfigureWidgetFromObj(interp, dndPtr->tkwin, configSpecs, objc - 3,
- objv + 3, (char *)dndPtr, 0) != TCL_OK) {
- return TCL_ERROR;
- }
- if (ConfigureDnd(interp, dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TokenWindowOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-TokenWindowOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Dnd *dndPtr;
- int flags;
-
- if (GetDndFromObj(clientData, interp, objv[3], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- flags = 0;
- if (dndPtr->tokenPtr == NULL) {
- if (CreateToken(interp, dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- flags = BLT_CONFIG_OBJV_ONLY;
- }
- if (ConfigureToken(interp, dndPtr, objc - 4, objv + 4, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- Tk_PathName(dndPtr->tokenPtr->tkwin), -1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TokenCgetOp --
- *
- * Called to process an (objc,objv) list to configure (or
- * reconfigure) a drag&drop widget.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED*/
-static int
-TokenCgetOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- Dnd *dndPtr;
-
- if (GetDndFromObj(clientData, interp, objv[3], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (dndPtr->tokenPtr == NULL) {
- Tcl_AppendResult(interp, "no token created for \"", objv[3], "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- return Blt_ConfigureValueFromObj(interp, dndPtr->tokenPtr->tkwin,
- tokenConfigSpecs, (char *)dndPtr->tokenPtr, objv[4],
- BLT_CONFIG_OBJV_ONLY);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TokenConfigureOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-TokenConfigureOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Token *tokenPtr;
- Dnd *dndPtr;
- int flags;
-
- if (GetDndFromObj(clientData, interp, objv[3], &dndPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- flags = BLT_CONFIG_OBJV_ONLY;
- if (dndPtr->tokenPtr == NULL) {
- Tcl_AppendResult(interp, "no token created for \"", objv[3], "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- tokenPtr = dndPtr->tokenPtr;
- if (objc == 3) {
- return Blt_ConfigureInfoFromObj(interp, tokenPtr->tkwin,
- tokenConfigSpecs, (char *)tokenPtr, (Tcl_Obj *)NULL, flags);
- } else if (objc == 4) {
- return Blt_ConfigureInfoFromObj(interp, tokenPtr->tkwin,
- tokenConfigSpecs, (char *)tokenPtr, objv[3], flags);
- }
- return ConfigureToken(interp, dndPtr, objc - 4, objv + 4, flags);
-}
-
-static Blt_OpSpec tokenOps[] =
-{
- {"cget", 2, TokenCgetOp, 5, 5, "widget option",},
- {"configure", 2, TokenConfigureOp, 4, 0,
- "widget ?option value?...",},
- {"window", 5, TokenWindowOp, 4, 0,
- "widget ?option value?...",},
-};
-
-static int nTokenOps = sizeof(tokenOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * TokenOp --
- *
- *---------------------------------------------------------------------------
- */
-static int
-TokenOp(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nTokenOps, tokenOps, BLT_OP_ARG2,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (clientData, interp, objc, objv);
- return result;
-}
-
-static Blt_OpSpec dndOps[] =
-{
- {"cancel", 2, CancelOp, 3, 3, "widget",},
- {"cget", 2, CgetOp, 4, 4, "widget option",},
- {"configure", 4, ConfigureOp, 3, 0,
- "widget ?option value?...",},
-#ifdef notdef
- {"convert", 4, ConvertOp, 5, 5, "widget data format",},
-#endif
- {"delete", 2, DeleteOp, 3, 0,"?-source|-target? widget...",},
- {"drag", 3, DragOp, 3, 0, "widget x y ?token?",},
- {"drop", 3, DropOp, 3, 0, "widget x y ?token?",},
- {"getdata", 1, GetdataOp, 3, 0, "widget ?format command?",},
- {"names", 1, NamesOp, 2, 4, "?-source|-target? ?pattern?",},
- {"pull", 1, PullOp, 4, 4, "widget format",},
- {"register", 1, RegisterOp, 3, 0, "widget ?option value?...",},
- {"select", 3, SelectOp, 6, 6, "widget x y timestamp",},
- {"setdata", 3, SetdataOp, 3, 0, "widget ?format command?",},
- {"token", 5, TokenOp, 3, 0, "args...",},
-};
-
-static int nDndOps = sizeof(dndOps) / sizeof(Blt_OpSpec);
-
-/*
- *---------------------------------------------------------------------------
- *
- * DndCmd --
- *
- * Invoked by TCL whenever the user issues a drag&drop command.
- *
- *---------------------------------------------------------------------------
- */
-static int
-DndCmd(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp, /* current interpreter */
- int objc, /* number of arguments */
- Tcl_Obj *const *objv) /* Argument strings */
-{
- Tcl_ObjCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nDndOps, dndOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (clientData, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DndInterpDeleteProc --
- *
- * This is called when the interpreter hosting the "dnd" command is
- * destroyed.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Destroys the hash table containing the drag&drop managers.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-DndInterpDeleteProc(
- ClientData clientData, /* Thread-specific data. */
- Tcl_Interp *interp)
-{
- DndInterpData *dataPtr = clientData;
- Dnd *dndPtr;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->dndTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- dndPtr = Blt_GetHashValue(hPtr);
- dndPtr->hashPtr = NULL;
- DestroyDnd((DestroyData)dndPtr);
- }
- Blt_DeleteHashTable(&dataPtr->dndTable);
- Tcl_DeleteAssocData(interp, DND_THREAD_KEY);
- Blt_Free(dataPtr);
-}
-
-static DndInterpData *
-GetDndInterpData(Tcl_Interp *interp)
-{
- DndInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (DndInterpData *)Tcl_GetAssocData(interp, DND_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- Display *display;
- Tk_Window tkwin;
-
- dataPtr = Blt_AssertMalloc(sizeof(DndInterpData));
- tkwin = Tk_MainWindow(interp);
- display = Tk_Display(tkwin);
- dataPtr->tkMain = tkwin;
- dataPtr->display = display;
- Tcl_SetAssocData(interp, DND_THREAD_KEY, DndInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->dndTable, BLT_ONE_WORD_KEYS);
- dataPtr->mesgAtom = XInternAtom(display, "BLT Dnd Message", False);
- dataPtr->targetAtom = XInternAtom(display, "BLT Dnd Target", False);
- dataPtr->formatsAtom = XInternAtom(display, "BLT Dnd Formats",False);
- dataPtr->commAtom = XInternAtom(display, "BLT Dnd CommData", False);
-
-#ifdef HAVE_XDND
- dataPtr->XdndActionListAtom = XInternAtom(display, "XdndActionList",
- False);
- dataPtr->XdndAwareAtom = XInternAtom(display, "XdndAware", False);
- dataPtr->XdndEnterAtom = XInternAtom(display, "XdndEnter", False);
- dataPtr->XdndFinishedAtom = XInternAtom(display, "XdndFinished", False);
- dataPtr->XdndLeaveAtom = XInternAtom(display, "XdndLeave", False);
- dataPtr->XdndPositionAtom = XInternAtom(display, "XdndPosition", False);
- dataPtr->XdndSelectionAtom = XInternAtom(display, "XdndSelection",
- False);
- dataPtr->XdndStatusAtom = XInternAtom(display, "XdndStatus", False);
- dataPtr->XdndTypeListAtom = XInternAtom(display, "XdndTypeList", False);
-#endif /* HAVE_XDND */
- }
- return dataPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DndCmdInitProc --
- *
- * Adds the drag&drop command to the given interpreter. Should
- * be invoked to properly install the command whenever a new
- * interpreter is created.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_DndCmdInitProc(Tcl_Interp *interp) /* Interpreter to be updated */
-{
- static Blt_InitCmdSpec cmdSpec = { "dnd", DndCmd };
-
- cmdSpec.clientData = GetDndInterpData(interp);
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-#ifdef notdef
-/*
- * Registers bitmap outline of dragged data, used to indicate
- * what is being dragged by source. Bitmap is XOR-ed as cursor/token
- * is moved around the screen.
- */
-static void
-Blt_DndSetOutlineBitmap(Tk_Window tkwin, Pixmap bitmap, int x, int y)
-{
-
-}
-#endif
-
-#ifdef HAVE_XDND
-
-static void
-XDndFreeFormats(XDndHandler *handlerPtr)
-{
- if (handlerPtr->formatArr != NULL) {
- char **p;
-
- for (p = handlerPtr->formatArr; *p != NULL; p++) {
- XFree(*p);
- }
- Blt_Free(handlerPtr->formatArr);
- handlerPtr->formatArr = NULL;
- }
-}
-
-static char **
-XDndGetFormats(XDndHandler *handlerPtr, XEvent *eventPtr)
-{
- int flags;
- Window window;
- unsigned char *data;
- Atom typeAtom;
- Atom format;
- int nItems, bytesAfter;
- Atom *atomArr;
- char *nameArr[XDND_MAX_TYPES + 1];
- Display *display;
-
- XDndFreeFormats(handlerPtr);
- display = eventPtr->xclient.display;
- window = eventPtr->xclient.data.l[0];
- flags = eventPtr->xclient.data.l[1];
- data = NULL;
- if (flags & 0x01) {
- result = XGetWindowProperty(
- display, /* Display of window. */
- window, /* Window holding the property. */
- handlerPtr->dataPtr->XdndTypeListAtom, /* Name of property. */
- 0, /* Offset of data (for multiple reads). */
- XDND_MAX_TYPES, /* Maximum number of items to read. */
- False, /* If true, delete the property. */
- XA_ATOM, /* Desired type of property. */
- &typeAtom, /* (out) Actual type of the property. */
- &format, /* (out) Actual format of the property. */
- &nItems, /* (out) # of items in specified format. */
- &bytesAfter, /* (out) # of bytes remaining to be read. */
- (unsigned char **)&data);
- if ((result != Success) || (format != 32) || (typeAtom != XA_ATOM)) {
- if (data != NULL) {
- XFree((char *)data);
- return (char **)NULL;
- }
- }
- atomArr = (Atom *)data;
- nAtoms = nItems;
- } else {
- atomArr = &(eventPtr->xclient.data.l[2]);
- nAtoms = 3;
- }
- formatArr = Blt_AssertCalloc(nAtoms + 1, sizeof(char *));
- for (i = 0; (i < nAtoms) && (atomArr[i] != None); i++) {
- formatArr[i] = XGetAtomName(display, atomArr[i]);
- }
- if (data != NULL) {
- XFree((char *)data);
- }
- handlerPtr->formatArr = formatArr;
-}
-
-static char *
-GetMatchingFormats(Dnd *dndPtr, char **formatArr)
-{
- int nMatches;
-
- nMatches = 0;
- Tcl_DStringInit(&dString);
- for (p = formatArr; *p != NULL; p++) {
- for(hPtr = Blt_FirstHashEntry(&dndPtr->setDataTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- fmt = Blt_GetHashKey(&dndPtr->setDataTable, hPtr);
- if ((*fmt == **p) && (strcmp(fmt, *p) == 0)) {
- Tcl_DStringAppendElement(&dString, *p);
- nMatches++;
- break;
- }
- }
- }
- if (nMatches > 0) {
- char *string;
-
- string = Blt_AssertStrdup(Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- return string;
- }
- return NULL;
-}
-
-static void
-XDndPointerEvent(XDndHandler *handlerPtr, XEvent *eventPtr)
-{
- Tk_Window tkwin;
- int flags;
- Atom action;
- Window window;
-
- flags = 0;
- action = None;
- window = eventPtr->xclient.data.l[MESG_XDND_WINDOW];
-
- /*
- * If the XDND source has no formats specified, don't process any
- * further. Simply send a "no accept" action with the message.
- */
- if (handlerPtr->formatArr != NULL) {
- Dnd *newPtr, *oldPtr;
- int point;
- int button, keyState;
- int x, y;
- char *formats;
-
- point = (int)eventPtr->xclient.data.l[MESG_XDND_POINT];
- UNPACK(point, x, y);
-
- /*
- * See if the mouse pointer currently over a drop target. We first
- * determine what Tk window is under the mouse, and then check if
- * that window is registered as a drop target.
- */
- newPtr = NULL;
- tkwin = Tk_CoordsToWindow(x, y, handlerPtr->tkwin);
- if (tkwin != NULL) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&handlerPtr->dataPtr->dndTable,
- (char *)tkwin);
- if (hPtr != NULL) {
- newPtr = Blt_GetHashValue(hPtr);
- if (!newPtr->isTarget) {
- newPtr = NULL; /* Not a DND target. */
- }
- formats = GetMatchingFormats(newPtr, handlerPtr->formatArr);
- if (formats == NULL) {
- newPtr = NULL; /* Source has no matching formats. */
- }
- }
- }
- button = keyState = 0;
- oldPtr = handlerPtr->dndPtr;
- resp = DROP_CANCEL;
- if (newPtr == oldPtr) {
- if ((oldPtr != NULL) && (oldPtr->motionCmd != NULL)) {
- resp = InvokeCallback(oldPtr, oldPtr->motionCmd, x, y, formats,
- button, keyState, dndPtr->timestamp);
- }
- } else {
- if ((oldPtr != NULL) && (oldPtr->leaveCmd != NULL)) {
- InvokeCallback(oldPtr, oldPtr->leaveCmd, x, y, formats, button,
- keyState, dndPtr->timestamp);
- }
- if ((newPtr != NULL) && (newPtr->enterCmd != NULL)) {
- resp = InvokeCallback(newPtr, newPtr->enterCmd, x, y, formats,
- button, keyState, dndPtr->timestamp);
- }
- handlerPtr->dndPtr = newPtr;
- /*
- * Save the current mouse position, since we get them from the
- * drop message.
- */
- newPtr->x = x;
- newPtr->y = y;
- }
- if (formats != NULL) {
- Blt_Free(formats);
- }
- flags = XDND_FLAGS_WANT_POSITION_MSGS;
- if (resp) {
- flags |= XDND_FLAGS_ACCEPT_DROP;
- action = handlerPtr->dataPtr->XdndActionCopyAtom;
- }
- }
- /* Target-to-Source: Drag result message. */
- SendClientMsg(handlerPtr->display, window,
- handlerPtr->dataPtr->XdndStatusAtom, handlerPtr->window,
- flags, 0, 0, action);
-}
-
-static void
-XDndDropEvent(XDndHandler *handlerPtr, XEvent *eventPtr)
-{
- Tk_Window tkwin;
- int flags;
- Atom action;
- Window window;
- int timestamp;
-
- flags = 0;
- action = None;
- window = eventPtr->xclient.data.l[MESG_XDND_WINDOW];
- timestamp = eventPtr->xclient.data.l[MESG_XDND_TIMESTAMP];
-
- /*
- * If no formats were specified for the XDND source or if the last
- * motion event did not place the mouse over a valid drop target,
- * don't process any further. Simply send a "no accept" action with
- * the message.
- */
- if ((handlerPtr->formatArr != NULL) && (handlerPtr->dndPtr != NULL)) {
- int button, keyState;
- Dnd *dndPtr = handlerPtr->dndPtr;
- DropPending pending;
- int resp;
-
- button = keyState = 0; /* Protocol doesn't supply this
- * information. */
-
- /* Set up temporary bookkeeping for the drop transaction */
- memset (&pending, 0, sizeof(pending));
- pending.window = window;
- pending.display = eventPtr->xclient.display;
- pending.timestamp = timestamp;
- pending.protocol = PROTO_XDND;
- pending.packetSize = GetMaxPropertySize(pending.display);
- Tcl_DStringInit(&pending.dString);
-
- formats = GetMatchingFormats(handlerPtr->dndPtr, handlerPtr->formatArr);
- if (formats == NULL) {
- }
- dndPtr->pendingPtr = &pending;
- resp = AcceptDrop(dndPtr, dndPtr->x, dndPtr->y, formats, button,
- keyState, action, timestamp);
- dndPtr->pendingPtr = NULL;
- if (resp) {
- flags |= XDND_FLAGS_ACCEPT_DROP;
- action = handlerPtr->dataPtr->XdndActionCopyAtom;
- }
- }
- /* Target-to-Source: Drag result message. */
- SendClientMsg(handlerPtr->display, window,
- handlerPtr->dataPtr->XdndStatusAtom, handlerPtr->window,
- flags, 0, 0, action);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XDndProtoEventProc --
- *
- * Invoked by Tk_HandleEvent whenever a DestroyNotify event is received
- * on a registered drag&drop source widget.
- *
- *---------------------------------------------------------------------------
- */
-static int
-XDndProtoEventProc(
- ClientData clientData, /* Drag&drop record. */
- XEvent *eventPtr) /* Event description. */
-{
- DndInterpData *dataPtr = clientData;
- Tk_Window tkwin;
- Blt_HashEntry *hPtr;
- XDndHandler *handlerPtr;
- int point;
- int x, y;
- Atom mesg;
-
- if (eventPtr->type != ClientMessage) {
- return 0; /* Not a ClientMessage event. */
- }
- /* Was the recipient a registered toplevel window? */
- hPtr = Blt_FindHashEntry(&dataPtr->handlerTable,
- (char *)eventPtr->xclient.window);
- if (hPtr == NULL) {
- return 0; /* No handler registered with window. */
- }
- handlerPtr = Blt_GetHashValue(hPtr);
- mesg = eventPtr->xclient.message_type;
- if (mesg == dataPtr->XdndEnterAtom) {
- XDndGetFormats(handlerPtr, eventPtr);
- handlerPtr->dndPtr = NULL;
- } else if (mesg == dataPtr->XdndPositionAtom) {
- XDndPointerEvent(handlerPtr, eventPtr);
- } else if (mesg == dataPtr->XdndLeaveAtom) {
- XDndFreeFormats(handlerPtr); /* Free up any collected formats. */
- if (handlerPtr->dndPtr != NULL) {
- InvokeCallback(handlerPtr->dndPtr, handlerPtr->dndPtr->leaveCmd,
- -1, -1, NULL, 0, 0);
- /* Send leave event to drop target. */
- }
- } else if (mesg == dataPtr->XdndDropAtom) {
- XDndDropEvent(handlerPtr, eventPtr);
- } else {
- fprintf(stderr, "Unknown client message type = 0x%x\n", mesg);
- return 0; /* Unknown message type. */
- }
- return 1;
-}
-
-static XDndHandler *
-XDndCreateHandler(Dnd *dndPtr)
-{
- Tk_Window tkwin;
- Window window;
- Blt_HashEntry *hPtr;
- int isNew;
- XDndHandler *handlerPtr;
-
- /*
- * Find the containing toplevel of this window. See if an XDND handler is
- * already registered for it.
- */
- tkwin = Blt_GetToplevelWindow(dndPtr->tkwin);
- window = Blt_GetWindowId(tkwin); /* Use the wrapper window as
- * the real toplevel window. */
- hPtr = Blt_CreateHashEntry(&dataPtr->XDndHandlerTable, (char *)window,
- &isNew);
- if (!isNew) {
- handlerPtr = (XDndHandler *)Blt_GetHashEntry(hPtr);
- handlerPtr->refCount++;
- } else {
- handlerPtr = Blt_AssertMalloc(sizeof(XDndHandler));
- handlerPtr->tkwin = tkwin;
- handlerPtr->dndPtr = NULL;
- handlerPtr->refCount = 1;
- handlerPtr->dataPtr = dataPtr;
- /* FIXME */
- SetProperty(window, dataPtr->XdndAwareAtom, "3");
- Blt_SetHashValue(hPtr, handlerPtr);
- }
- return handlerPtr;
-}
-
-static void
-XDndDeleteHandler(Dnd *dndPtr)
-{
- Tk_Window tkwin;
- Window window;
- Blt_HashEntry *hPtr;
-
- tkwin = Blt_GetToplevelWindow(dndPtr->tkwin);
- window = Blt_GetWindowId(tkwin); /* Use the wrapper window as the real
- * toplevel window. */
- hPtr = Blt_FindHashEntry(&dataPtr->XDndHandlerTable, (char *)window);
- if (hPtr != NULL) {
- XDndHandler *handlerPtr;
-
- handlerPtr = (XDndHandler *)Blt_GetHashEntry(hPtr);
- handlerPtr->refCount--;
- if (handlerPtr->refCount == 0) {
- XDndFreeFormats(handlerPtr);
- XDeleteProperty(dndPtr->display, window,
- dndPtr->dataPtr->XdndAwareAtom);
- Blt_DeleteHashEntry(&dataPtr->XDndHandlerTable, hPtr);
- Blt_Free(handlerPtr);
- }
- }
-}
-
-#endif /* HAVE_XDND */
-
-#endif /* NO_DRAGDROP */
diff --git a/blt3.0.1/src/bltUnixFont.c b/blt3.0.1/src/bltUnixFont.c
deleted file mode 100644
index 98f7786..0000000
--- a/blt3.0.1/src/bltUnixFont.c
+++ /dev/null
@@ -1,2824 +0,0 @@
-
-/*
- * bltUnixFont.c --
- *
- * This module implements freetype (Xft) and Tk fonts for the BLT toolkit.
- *
- * The Blt_Font is a wrapper around the existing Tk font structure, adding
- * Freetype fonts (via the XRender extension). The original Tk font
- * procedures act as a fallback if a suitable Xft enabled server can't be
- * found.
- *
- * Copyright 2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <ctype.h>
-#include "bltInt.h"
-#include <bltHash.h>
-#include "tkDisplay.h"
-#include "tkFont.h"
-
-#ifdef HAVE_LIBXFT
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include <X11/Xft/Xft.h>
-#endif
-
-#include "bltFont.h"
-#include "bltPs.h"
-
-#undef isspace
-
-/*
- * This module provides antialiased fonts via Freetype as now does Tk 8.5.
- * This version also includes rotated fonts. No subfont matching is done to
- * avoid rotating dozens of subfonts for every rotated font. It's possible
- * that glyphs may be missing that exist in the Tk version. The trade-off
- * seems fair when weighing the benefit of high-quality antialiased rotated
- * fonts.
- *
- * Font rotation is done via the freetype font matrix for outline fonts. For
- * bitmap fonts we fall back on drawing the text into a bitmap and rotate the
- * bitmap. This requires depth-aware versions of Tk_DrawChars, since Xft is
- * drawing into a drawable of a different depth (depth is 1).
- *
- * The best tactic is to 1) not use bitmapped fonts if better outline fonts
- * are available and 2) provide our own font handling routines that allow font
- * rotation and font aliasing. The font aliases allow us to use a font name
- * like "Sans Serif" that translates into a good font for that platform and
- * set of fonts available (Xft or Xlfd font).
- */
-
-#define DEBUG_FONT_SELECTION 0
-#define DEBUG_FONT_SELECTION2 0
-
-typedef struct _Blt_Font _Blt_Font;
-
-enum FontTypes {
- FONT_UNKNOWN, /* Unknown font type. */
- FONT_TK, /* Normal Tk font. */
- FONT_FT /* Freetype font. */
-};
-
-#ifndef HAVE_LIBXFT
-#define FC_WEIGHT_THIN 0
-#define FC_WEIGHT_EXTRALIGHT 40
-#define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT
-#define FC_WEIGHT_LIGHT 50
-#define FC_WEIGHT_BOOK 75
-#define FC_WEIGHT_REGULAR 80
-#define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR
-#define FC_WEIGHT_MEDIUM 100
-#define FC_WEIGHT_DEMIBOLD 180
-#define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD
-#define FC_WEIGHT_BOLD 200
-#define FC_WEIGHT_EXTRABOLD 205
-#define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD
-#define FC_WEIGHT_BLACK 210
-#define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK
-#define FC_WEIGHT_EXTRABLACK 215
-#define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK
-
-#define FC_SLANT_ROMAN 0
-#define FC_SLANT_ITALIC 100
-#define FC_SLANT_OBLIQUE 110
-
-#define FC_WIDTH_ULTRACONDENSED 50
-#define FC_WIDTH_EXTRACONDENSED 63
-#define FC_WIDTH_CONDENSED 75
-#define FC_WIDTH_SEMICONDENSED 87
-#define FC_WIDTH_NORMAL 100
-#define FC_WIDTH_SEMIEXPANDED 113
-#define FC_WIDTH_EXPANDED 125
-#define FC_WIDTH_EXTRAEXPANDED 150
-#define FC_WIDTH_ULTRAEXPANDED 200
-
-#define FC_PROPORTIONAL 0
-#define FC_DUAL 90
-#define FC_MONO 100
-#define FC_CHARCELL 110
-
-#define FC_ANTIALIAS "antialias" /* Bool (depends) */
-#define FC_AUTOHINT "autohint" /* Bool (false) */
-#define FC_DECORATIVE "decorative" /* Bool */
-#define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool */
-#define FC_EMBOLDEN "embolden" /* Bool */
-#define FC_FAMILY "family" /* String */
-#define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */
-#define FC_HINTING "hinting" /* Bool (true) */
-#define FC_MINSPACE "minspace" /* Bool */
-#define FC_OUTLINE "outline" /* Bool */
-#define FC_SCALABLE "scalable" /* Bool */
-#define FC_SIZE "size" /* Double */
-#define FC_SLANT "slant" /* Int */
-#define FC_SPACING "spacing" /* Int */
-#define FC_STYLE "style" /* String */
-#define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */
-#define FC_WEIGHT "weight" /* Int */
-#define FC_WIDTH "width" /* Int */
-
-#endif
-
-#ifndef FC_WEIGHT_EXTRABLACK
-#define FC_WEIGHT_EXTRABLACK 215
-#define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK
-#endif
-
-typedef struct {
- char *family;
- const char *weight;
- const char *slant;
- const char *width;
- const char *spacing;
- int size; /* If negative, pixels, else points */
-} TkFontPattern;
-
-typedef struct {
- const char *name;
- int minChars;
- const char *key;
- int value;
- const char *oldvalue;
-} FontSpec;
-
-static FontSpec fontSpecs[] = {
- { "black", 2, FC_WEIGHT, FC_WEIGHT_BLACK, "*"},
- { "bold", 3, FC_WEIGHT, FC_WEIGHT_BOLD, "bold"},
- { "book", 3, FC_WEIGHT, FC_WEIGHT_MEDIUM, "medium"},
- { "charcell", 2, FC_SPACING, FC_CHARCELL, "c"},
- { "condensed", 2, FC_WIDTH, FC_WIDTH_CONDENSED, "condensed"},
- { "demi", 4, FC_WEIGHT, FC_WEIGHT_BOLD, "semi"},
- { "demibold", 5, FC_WEIGHT, FC_WEIGHT_DEMIBOLD, "semibold"},
- { "dual", 2, FC_SPACING, FC_DUAL, "*"},
- { "i", 1, FC_SLANT, FC_SLANT_ITALIC, "i"},
- { "italic", 2, FC_SLANT, FC_SLANT_ITALIC, "i"},
- { "light", 1, FC_WEIGHT, FC_WEIGHT_LIGHT, "light"},
- { "medium", 2, FC_WEIGHT, FC_WEIGHT_MEDIUM, "medium"},
- { "mono", 2, FC_SPACING, FC_MONO, "m"},
- { "normal", 1, FC_WIDTH, FC_WIDTH_NORMAL, "normal"},
- { "o", 1, FC_SLANT, FC_SLANT_OBLIQUE, "o"},
- { "obilque", 2, FC_SLANT, FC_SLANT_OBLIQUE, "o"},
- { "overstrike", 2, NULL, 0, "*"},
- { "proportional", 1, FC_SPACING, FC_PROPORTIONAL, "p"},
- { "r", 1, FC_SLANT, FC_SLANT_ROMAN, "r"},
- { "roman", 2, FC_SLANT, FC_SLANT_ROMAN, "r"},
- { "semibold", 5, FC_WEIGHT, FC_WEIGHT_DEMIBOLD, "semibold"},
- { "semicondensed",5, FC_WIDTH, FC_WIDTH_SEMICONDENSED, "semicondensed"},
- { "underline", 1, NULL, 0, "*"},
-};
-static int nFontSpecs = sizeof(fontSpecs) / sizeof(FontSpec);
-
-static FontSpec weightSpecs[] ={
- { "black", 2, FC_WEIGHT, FC_WEIGHT_BLACK, "bold"},
- { "bold", 3, FC_WEIGHT, FC_WEIGHT_BOLD, "bold"},
- { "book", 3, FC_WEIGHT, FC_WEIGHT_MEDIUM, "*"},
- { "demi", 4, FC_WEIGHT, FC_WEIGHT_BOLD, "*"},
- { "demibold", 5, FC_WEIGHT, FC_WEIGHT_DEMIBOLD, "*"},
- { "extrablack", 6, FC_WEIGHT, FC_WEIGHT_EXTRABLACK, "*"},
- { "extralight", 6, FC_WEIGHT, FC_WEIGHT_EXTRALIGHT, "*"},
- { "heavy", 1, FC_WEIGHT, FC_WEIGHT_HEAVY, "*"},
- { "light", 1, FC_WEIGHT, FC_WEIGHT_LIGHT, "light"},
- { "medium", 1, FC_WEIGHT, FC_WEIGHT_MEDIUM, "medium"},
- { "normal", 1, FC_WEIGHT, FC_WEIGHT_MEDIUM, "normal"},
- { "regular", 1, FC_WEIGHT, FC_WEIGHT_REGULAR, "medium"},
- { "semibold", 1, FC_WEIGHT, FC_WEIGHT_SEMIBOLD, "semibold"},
- { "thin", 1, FC_WEIGHT, FC_WEIGHT_THIN, "thin"},
- { "ultrablack", 7, FC_WEIGHT, FC_WEIGHT_ULTRABLACK, "*"},
- { "ultrabold", 7, FC_WEIGHT, FC_WEIGHT_ULTRABOLD, "*"},
- { "ultralight", 6, FC_WEIGHT, FC_WEIGHT_ULTRALIGHT, "*"},
-};
-static int nWeightSpecs = sizeof(weightSpecs) / sizeof(FontSpec);
-
-static FontSpec slantSpecs[] ={
- { "i", 1, FC_SLANT, FC_SLANT_ITALIC, "i"},
- { "italic", 2, FC_SLANT, FC_SLANT_ITALIC, "i"},
- { "o", 1, FC_SLANT, FC_SLANT_OBLIQUE, "o"},
- { "obilque", 3, FC_SLANT, FC_SLANT_OBLIQUE, "o"},
- { "r", 1, FC_SLANT, FC_SLANT_ROMAN, "r"},
- { "roman", 2, FC_SLANT, FC_SLANT_ROMAN, "r"},
-};
-static int nSlantSpecs = sizeof(slantSpecs) / sizeof(FontSpec);
-
-static FontSpec widthSpecs[] ={
- { "condensed", 1, FC_WIDTH, FC_WIDTH_CONDENSED, "condensed"},
- { "expanded", 3, FC_WIDTH, FC_WIDTH_EXPANDED, "*"},
- { "extracondensed", 6, FC_WIDTH, FC_WIDTH_EXTRACONDENSED, "*"},
- { "extraexpanded", 6, FC_WIDTH, FC_WIDTH_EXTRAEXPANDED, "*"},
- { "narrow", 2, FC_WIDTH, FC_WIDTH_CONDENSED, "narrow"},
- { "normal", 2, FC_WIDTH, FC_WIDTH_NORMAL, "normal"},
- { "semicondensed", 5, FC_WIDTH, FC_WIDTH_SEMICONDENSED, "semicondensed"},
- { "semiexpanded", 5, FC_WIDTH, FC_WIDTH_SEMIEXPANDED, "*"},
- { "ultracondensed", 6, FC_WIDTH, FC_WIDTH_ULTRACONDENSED, "*"},
- { "ultraexpanded", 6, FC_WIDTH, FC_WIDTH_ULTRAEXPANDED, "*"},
-};
-static int nWidthSpecs = sizeof(widthSpecs) / sizeof(FontSpec);
-
-static FontSpec spacingSpecs[] = {
- { "charcell", 2, FC_SPACING, FC_CHARCELL, "c"},
- { "dual", 2, FC_SPACING, FC_DUAL, "*"},
- { "mono", 2, FC_SPACING, FC_MONO, "m"},
- { "proportional", 1, FC_SPACING, FC_PROPORTIONAL, "p"},
-};
-static int nSpacingSpecs = sizeof(spacingSpecs) / sizeof(FontSpec);
-
-static FontSpec boolSpecs[] ={
- { "antialias", 1, FC_ANTIALIAS, },
- { "decorative", 1, FC_DECORATIVE, },
- { "embeddedbitmap", 4, FC_EMBEDDED_BITMAP, },
- { "embolden", 4, FC_EMBOLDEN, },
- { "globaladvance", 1, FC_GLOBAL_ADVANCE, },
- { "hinting", 1, FC_HINTING, },
- { "minspace", 1, FC_MINSPACE, },
- { "outline", 1, FC_OUTLINE, },
- { "scalable", 1, FC_SCALABLE, },
- { "verticallayout", 1, FC_VERTICAL_LAYOUT, },
-};
-static int nBoolSpecs = sizeof(boolSpecs) / sizeof(FontSpec);
-
-static Blt_HashTable fontTable;
-static void TkGetFontFamilies(Tk_Window tkwin, Blt_HashTable *tablePtr);
-
-enum XLFDFields {
- XLFD_FOUNDRY,
- XLFD_FAMILY,
- XLFD_WEIGHT,
- XLFD_SLANT,
- XLFD_SETWIDTH,
- XLFD_ADD_STYLE,
- XLFD_PIXEL_SIZE,
- XLFD_POINT_SIZE,
- XLFD_RESOLUTION_X,
- XLFD_RESOLUTION_Y,
- XLFD_SPACING,
- XLFD_AVERAGE_WIDTH,
- XLFD_CHARSET,
- XLFD_NUMFIELDS
-};
-
-
-#ifdef HAVE_LIBXFT
-static void FtGetFontFamilies(Tk_Window tkwin, Blt_HashTable *tablePtr);
-static int initialized = FALSE;
-
-static int
-IsXRenderAvailable(Tk_Window tkwin)
-{
- static int isXRenderAvail = -1;
-
- if (isXRenderAvail < 0) {
- int eventBase, errorBase;
-
- isXRenderAvail = FALSE;
- Blt_InitHashTable(&fontTable, BLT_STRING_KEYS);
- initialized = TRUE;
- if (!XRenderQueryExtension(Tk_Display(tkwin), &eventBase, &errorBase)) {
- return FALSE;
- }
- if (XRenderFindVisualFormat(Tk_Display(tkwin), Tk_Visual(tkwin)) == 0) {
- return FALSE;
- }
- isXRenderAvail = TRUE;
- }
- return isXRenderAvail;
-}
-#endif
-
-static double
-PointsToPixels(Tk_Window tkwin, int size)
-{
- double d;
-
- if (size < 0) {
- return -size;
- }
- d = size * 25.4 / 72.0;
- d *= WidthOfScreen(Tk_Screen(tkwin));
- d /= WidthMMOfScreen(Tk_Screen(tkwin));
- return d;
-}
-
-static double
-PixelsToPoints(Tk_Window tkwin, int size)
-{
- double d;
-
- if (size >= 0) {
- return size;
- }
- d = -size * 72.0 / 25.4;
- d *= WidthMMOfScreen(Tk_Screen(tkwin));
- d /= WidthOfScreen(Tk_Screen(tkwin));
- return d;
-}
-
-static void
-ParseXLFD(const char *fontName, int *argcPtr, char ***argvPtr)
-{
- char *p, *pend, *desc, *buf;
- size_t arrayLen, stringLen;
- int count;
- char **field;
-
- arrayLen = (sizeof(char *) * (XLFD_NUMFIELDS + 1));
- stringLen = strlen(fontName);
- buf = Blt_AssertCalloc(1, arrayLen + stringLen + 1);
- desc = buf + arrayLen;
- strcpy(desc, fontName);
- field = (char **)buf;
-
- count = 0;
- for (p = desc, pend = p + stringLen; p < pend; p++, count++) {
- char *word;
-
- field[count] = NULL;
- /* Get the next word, separated by dashes (-). */
- word = p;
- while ((*p != '\0') && (*p != '-')) {
- if (((*p & 0x80) == 0) && Tcl_UniCharIsUpper(UCHAR(*p))) {
- *p = (char)Tcl_UniCharToLower(UCHAR(*p));
- }
- p++;
- }
- if (*p != '\0') {
- *p = '\0';
- }
- if ((word[0] == '\0') ||
- (((word[0] == '*') || (word[0] == '?')) && (word[1] == '\0'))) {
- continue; /* Field not specified. -- -*- -?- */
- }
- field[count] = word;
- }
-
- /*
- * An XLFD of the form -adobe-times-medium-r-*-12-*-* is pretty common,
- * but it is (strictly) malformed, because the first * is eliding both the
- * Setwidth and the Addstyle fields. If the Addstyle field is a number,
- * then assume the above incorrect form was used and shift all the rest of
- * the fields right by one, so the number gets interpreted as a pixelsize.
- * This fix is so that we don't get a million reports that "it works under
- * X (as a native font name), but gives a syntax error under Windows (as a
- * parsed set of attributes)".
- */
-
- if ((count > XLFD_ADD_STYLE) && (field[XLFD_ADD_STYLE] != NULL)) {
- int dummy;
-
- if (Tcl_GetInt(NULL, field[XLFD_ADD_STYLE], &dummy) == TCL_OK) {
- int j;
-
- for (j = XLFD_NUMFIELDS - 1; j >= XLFD_ADD_STYLE; j--) {
- field[j + 1] = field[j];
- }
- field[XLFD_ADD_STYLE] = NULL;
- count++;
- }
- }
- *argcPtr = count;
- *argvPtr = field;
-
- field[XLFD_NUMFIELDS] = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SearchForFontSpec --
- *
- * Performs a binary search on the array of font specification to find a
- * partial, anchored match for the given option string.
- *
- * Results:
- * If the string matches unambiguously the index of the specification in
- * the array is returned. If the string does not match, even as an
- * abbreviation, any operation, -1 is returned. If the string matches,
- * but ambiguously -2 is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SearchForFontSpec(
- FontSpec *table, /* Table of font options. */
- int nSpecs, /* # specifications in font spec table. */
- const char *string) /* Name of font option to search for. */
-{
- char c;
- int high, low;
- size_t length;
-
- low = 0;
- high = nSpecs - 1;
- c = tolower((unsigned char)string[0]);
- length = strlen(string);
- while (low <= high) {
- FontSpec *sp;
- int compare;
- int median;
-
- median = (low + high) >> 1;
- sp = table + median;
-
- /* Test the first character */
- compare = c - sp->name[0];
- if (compare == 0) {
- /* Now test the entire string */
- compare = strncasecmp(string, sp->name, length);
- if (compare == 0) {
- if ((int)length < sp->minChars) {
- return -2; /* Ambiguous spec name */
- }
- }
- }
- if (compare < 0) {
- high = median - 1;
- } else if (compare > 0) {
- low = median + 1;
- } else {
- return median; /* Spec found. */
- }
- }
- return -1; /* Can't find spec */
-}
-
-static FontSpec *
-FindSpec(Tcl_Interp *interp, FontSpec *tablePtr, int nSpecs, const char *string)
-{
- int n;
-
- n = SearchForFontSpec(tablePtr, nSpecs, string);
- if (n < 0) {
- if (n == -1) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "unknown ", tablePtr[0].key,
- " specification \"", string, "\"", (char *)NULL);
- }
- }
- if (n == -2) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "ambiguous ", tablePtr[0].key,
- " specification \"", string, "\"", (char *)NULL);
- }
- }
- return NULL;
- }
- return tablePtr + n;
-}
-
-static Blt_HashTable aliasTable;
-static int alias_initialized = 0;
-
-typedef struct {
- const char *name, *aliases[10];
-} FontAlias;
-
-#ifdef HAVE_LIBXFT
-static FontAlias xftFontAliases[] = {
- { "math", { "mathematica1", "nimbus sans l condensed", "courier"}},
- { "serif", { "times new roman", "nimbus roman no9 l" "times" }},
- { "sans serif", { "arial", "nimbus sans l", "helvetica" }},
- { "monospace", { "courier new", "nimbus mono l", "courier" }},
- { "symbol", { "standard symbols l", "symbol" }},
- { NULL }
-};
-#endif
-
-static FontAlias xlfdFontAliases[] = {
- { "math", {"courier"}},
- { "serif", {"times"}},
- { "sans serif", { "helvetica" }},
- { "monospace", { "courier" }},
- { NULL }
-};
-
-static void
-MakeAliasTable(Tk_Window tkwin)
-{
- Blt_HashTable familyTable;
- FontAlias *fp;
- FontAlias *table;
-
- Blt_InitHashTable(&familyTable, TCL_STRING_KEYS);
-#ifdef HAVE_LIBXFT
- if (IsXRenderAvailable(tkwin)) {
- FtGetFontFamilies(tkwin, &familyTable);
- } else {
- TkGetFontFamilies(tkwin, &familyTable);
- }
-#else
- TkGetFontFamilies(tkwin, &familyTable);
-#endif
- Blt_InitHashTable(&aliasTable, TCL_STRING_KEYS);
-#ifdef HAVE_LIBXFT
- table = (IsXRenderAvailable(tkwin)) ? xftFontAliases : xlfdFontAliases;
-#else
- table = xlfdFontAliases;
-#endif
- for(fp = table; fp->name != NULL; fp++) {
- Blt_HashEntry *hPtr;
- const char **alias;
-
- for (alias = fp->aliases; *alias != NULL; alias++) {
- hPtr = Blt_FindHashEntry(&familyTable, *alias);
- if (hPtr != NULL) {
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&aliasTable, fp->name, &isNew);
- Blt_SetHashValue(hPtr, *alias);
- break;
- }
- }
- }
- Blt_DeleteHashTable(&familyTable);
-}
-
-static const char *
-GetAlias(const char *family)
-{
- Blt_HashEntry *hPtr;
-
- strtolower((char *)family);
- hPtr = Blt_FindHashEntry(&aliasTable, family);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- return family;
-}
-
-static Blt_NameOfFontProc TkNameOfFontProc;
-static Blt_GetFontMetricsProc TkGetFontMetricsProc;
-static Blt_FontIdProc TkFontIdProc;
-static Blt_MeasureCharsProc TkMeasureCharsProc;
-static Blt_TextStringWidthProc TkTextStringWidthProc;
-static Blt_FreeFontProc TkFreeFontProc;
-static Blt_DrawCharsProc TkDrawCharsProc;
-static Blt_PostscriptFontNameProc TkPostscriptFontNameProc;
-static Blt_FamilyOfFontProc TkFamilyOfFontProc;
-static Blt_CanRotateFontProc TkCanRotateFontProc;
-static Blt_UnderlineCharsProc TkUnderlineCharsProc;
-
-static Blt_FontClass tkFontClass = {
- FONT_TK,
- TkNameOfFontProc, /* Blt_NameOfFontProc */
- TkFamilyOfFontProc, /* Blt_FamilyOfFontProc */
- TkFontIdProc, /* Blt_FontIdProc */
- TkGetFontMetricsProc, /* Blt_GetFontMetricsProc */
- TkMeasureCharsProc, /* Blt_MeasureCharsProc */
- TkTextStringWidthProc, /* Blt_TextWidthProc */
- TkCanRotateFontProc, /* Blt_CanRotateFontProc */
- TkDrawCharsProc, /* Blt_DrawCharsProc */
- TkPostscriptFontNameProc, /* Blt_PostscriptFontNameProc */
- TkFreeFontProc, /* Blt_FreeFontProc */
- TkUnderlineCharsProc, /* Blt_UnderlineCharsProc */
-};
-
-static TkFontPattern *
-TkNewFontPattern(void)
-{
- TkFontPattern *patternPtr;
-
- patternPtr = Blt_Calloc(1, sizeof(TkFontPattern));
- return patternPtr;
-}
-
-static void
-TkFreeFontPattern(TkFontPattern *patternPtr)
-{
- if (patternPtr->family != NULL) {
- Blt_Free((char *)patternPtr->family);
- }
- Blt_Free(patternPtr);
-}
-
-
-static void
-TkGetFontFamilies(Tk_Window tkwin, Blt_HashTable *tablePtr)
-{
- char **list, **np, **nend;
- const char *pat;
- int n;
-
- pat = "-*-*-*-*-*-*-*-*-*-*-*-*-*-*";
- list = XListFonts(Tk_Display(tkwin), pat, 10000, &n);
- for (np = list, nend = np + n; np < nend; np++) {
- Blt_HashEntry *hPtr;
- int isNew;
- char *family, *dash;
-
- /* Parse out the family name. Assume the names are all lower case. */
- dash = strchr(*np+1, '-');
- if (dash == NULL) {
- continue;
- }
- family = dash+1;
- dash = strchr(family, '-');
- if (dash != NULL) {
- *dash = '\0';
- }
- hPtr = Blt_CreateHashEntry(tablePtr, family, &isNew);
- Blt_SetHashValue(hPtr, NULL);
- }
- XFreeFontNames(list);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * TkParseTkDesc --
- *
- * Parses an array of Tcl_Objs as a Tk style font description .
- *
- * "family [size] [optionList]"
- *
- * Results:
- * Returns a pattern structure, filling in with the necessary fields.
- * Returns NULL if objv doesn't contain a Tk font description.
- *
- * Side effects:
- * Memory is allocated for the font pattern and the its strings.
- *
- *---------------------------------------------------------------------------
- */
-static TkFontPattern *
-TkParseTkDesc(Tcl_Interp *interp, int objc, Tcl_Obj **objv)
-{
- TkFontPattern *patternPtr;
- Tcl_Obj **aobjv;
- int aobjc;
- int i;
-
- patternPtr = TkNewFontPattern();
-
- /* Font family. */
- {
- char *family, *dash;
- family = Tcl_GetString(objv[0]);
- dash = strchr(family, '-');
- if (dash != NULL) {
- int size;
-
- if (Tcl_GetInt(NULL, dash + 1, &size) != TCL_OK) {
- goto error;
- }
- patternPtr->size = size;
- }
- if (dash != NULL) {
- *dash = '\0';
- }
- patternPtr->family = Blt_AssertStrdup(GetAlias(family));
- if (dash != NULL) {
- *dash = '-';
- i = 1;
- }
- objv++, objc--;
- }
- if (objc > 0) {
- int size;
-
- if (Tcl_GetIntFromObj(NULL, objv[0], &size) == TCL_OK) {
- patternPtr->size = size;
- objv++, objc--;
- }
- }
- aobjc = objc, aobjv = objv;
- if (objc > 0) {
- if (Tcl_ListObjGetElements(NULL, objv[0], &aobjc, &aobjv) != TCL_OK) {
- goto error;
- }
- }
- for (i = 0; i < aobjc; i++) {
- FontSpec *specPtr;
- const char *key;
-
- key = Tcl_GetString(aobjv[i]);
- specPtr = FindSpec(interp, fontSpecs, nFontSpecs, key);
- if (specPtr == NULL) {
- goto error;
- }
- if (specPtr->key == NULL) {
- continue;
- }
- if (strcmp(specPtr->key, FC_WEIGHT) == 0) {
- patternPtr->weight = specPtr->oldvalue;
- } else if (strcmp(specPtr->key, FC_SLANT) == 0) {
- patternPtr->slant = specPtr->oldvalue;
- } else if (strcmp(specPtr->key, FC_SPACING) == 0) {
- patternPtr->spacing = specPtr->oldvalue;
- } else if (strcmp(specPtr->key, FC_WIDTH) == 0) {
- patternPtr->width = specPtr->oldvalue;
- }
- }
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "found TkDesc => Tk font \"%s\"\n", patternPtr->family);
-#endif
- return patternPtr;
- error:
- TkFreeFontPattern(patternPtr);
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TkParseNameValuePairs --
- *
- * Given Tcl_Obj list of name value pairs, parse the list saving
- * in the values in a font pattern structure.
- *
- * "-family family -size size -weight weight"
- *
- * Results:
- * Returns a pattern structure, filling in with the necessary fields.
- * Returns NULL if objv doesn't contain a valid name-value list
- * describing a font.
- *
- * Side effects:
- * Memory is allocated for the font pattern and the its strings.
- *
- *---------------------------------------------------------------------------
- */
-static TkFontPattern *
-TkParseNameValuePairs(Tcl_Interp *interp, Tcl_Obj *objPtr)
-{
- TkFontPattern *patternPtr;
- Tcl_Obj **objv;
- int objc;
- int i;
-
- if ((Tcl_ListObjGetElements(NULL, objPtr, &objc, &objv) != TCL_OK) ||
- (objc < 1)) {
- return NULL; /* Can't split list or list is empty. */
- }
- if (objc & 0x1) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "odd number of elements, missing value",
- (char *)NULL);
- }
- return NULL; /* Odd number of elements in list. */
- }
- patternPtr = TkNewFontPattern();
- for (i = 0; i < objc; i += 2) {
- const char *key, *value;
-
- key = Tcl_GetString(objv[i]);
- value = Tcl_GetString(objv[i+1]);
- if (strcmp(key, "-family") == 0) {
- if (patternPtr->family != NULL) {
- Blt_Free(patternPtr->family);
- }
- patternPtr->family = Blt_AssertStrdup(GetAlias(value));
- } else if (strcmp(key, "-size") == 0) {
- int size;
-
- if (Tcl_GetIntFromObj(interp, objv[i+1], &size) != TCL_OK) {
- goto error;
- }
- patternPtr->size = size;
- } else if (strcmp(key, "-weight") == 0) {
- FontSpec *specPtr;
-
- specPtr = FindSpec(interp, weightSpecs, nWeightSpecs, value);
- if (specPtr == NULL) {
- goto error;
- }
- patternPtr->weight = specPtr->oldvalue;
- } else if (strcmp(key, "-slant") == 0) {
- FontSpec *specPtr;
-
- specPtr = FindSpec(interp, slantSpecs, nSlantSpecs, value);
- if (specPtr == NULL) {
- goto error;
- }
- patternPtr->slant = specPtr->oldvalue;
- } else if (strcmp(key, "-spacing") == 0) {
- FontSpec *specPtr;
-
- specPtr = FindSpec(interp, spacingSpecs, nSpacingSpecs, value);
- if (specPtr == NULL) {
- goto error;
- }
- patternPtr->spacing = specPtr->oldvalue;
- } else if (strcmp(key, "-hint") == 0) {
- /* Ignore */
- } else if (strcmp(key, "-rgba") == 0) {
- /* Ignore */
- } else if (strcmp(key, "-underline") == 0) {
- /* Ignore */
- } else if (strcmp(key, "-overstrike") == 0) {
- /* Ignore */
- } else {
- /* Ignore */
- }
- }
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "found TkAttrList => Tk font \"%s\"\n",
- Tcl_GetString(objPtr));
-#endif
- return patternPtr;
- error:
- TkFreeFontPattern(patternPtr);
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TkParseNameValuePairs --
- *
- * Given the name of a Tk font object, get its configuration values
- * save the data in a font pattern structure.
- *
- * "-family family -size size -weight weight"
- *
- * Results:
- * Returns a pattern structure, filling in with the necessary fields.
- * Returns NULL if objv doesn't contain a valid name-value list
- * describing a font.
- *
- * Side effects:
- * Memory is allocated for the font pattern and the its strings.
- *
- *---------------------------------------------------------------------------
- */
-static TkFontPattern *
-TkParseFontObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
-{
- TkFontPattern *patternPtr;
- Tcl_Obj *cmd[3];
- int result;
-
- patternPtr = NULL;
- cmd[0] = Tcl_NewStringObj("font", -1);
- cmd[1] = Tcl_NewStringObj("configure", -1);
- cmd[2] = objPtr;
- Tcl_IncrRefCount(cmd[0]);
- Tcl_IncrRefCount(cmd[1]);
- Tcl_IncrRefCount(cmd[2]);
- result = Tcl_EvalObjv(interp, 3, cmd, 0);
- Tcl_DecrRefCount(cmd[2]);
- Tcl_DecrRefCount(cmd[1]);
- Tcl_DecrRefCount(cmd[0]);
- if (result == TCL_OK) {
- patternPtr = TkParseNameValuePairs(interp, Tcl_GetObjResult(interp));
- }
- Tcl_ResetResult(interp);
-#if DEBUG_FONT_SELECTION
- if (patternPtr != NULL) {
- fprintf(stderr, "found FontObject => Tk font \"%s\"\n",
- Tcl_GetString(objPtr));
- }
-#endif
- return patternPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TkGetPattern --
- *
- * Parses the font description so that the font can rewritten with an
- * aliased font name. This allows us to use
- *
- * "Sans Serif", "Serif", "Math", "Monospace"
- *
- * font names that correspond to the proper font regardless if the
- * standard X fonts or XFT fonts are being used.
- *
- * Leave XLFD font descriptions alone. Let users describe exactly the
- * font they wish.
- *
- *---------------------------------------------------------------------------
- */
-static TkFontPattern *
-TkGetPattern(Tcl_Interp *interp, Tcl_Obj *objPtr)
-{
- TkFontPattern *patternPtr;
- char *desc;
-
- desc = Tcl_GetString(objPtr);
- while (isspace(*desc)) {
- desc++; /* Skip leading blanks. */
- }
- if (*desc == '-') {
- /*
- * Case 1: XLFD font description or Tk attribute list.
- *
- * If the font description starts with a '-', it could be either an
- * old fashion XLFD font description or a Tk font attribute
- * option-value list.
- */
- patternPtr = TkParseNameValuePairs(interp, objPtr);
- if (patternPtr == NULL) {
- return NULL; /* XLFD font description */
- }
- } else if (*desc == '*') {
- return NULL; /* XLFD font description */
- } else if (strpbrk(desc, "::") != NULL) {
- patternPtr = TkParseFontObj(interp, objPtr);
- } else {
- int objc;
- Tcl_Obj **objv;
- /*
- * Case 3: Tk-style description.
- */
- if ((Tcl_ListObjGetElements(NULL, objPtr, &objc, &objv) != TCL_OK) ||
- (objc < 1)) {
- return NULL; /* Can't split into a list or
- * list is empty. */
- }
- patternPtr = NULL;
- if (objc == 1) {
- /*
- * Case 3a: Tk font object name.
- *
- * Assuming that Tk font object names won't contain whitespace,
- * see if its a font object.
- */
- patternPtr = TkParseFontObj(interp, objv[0]);
- }
- if (patternPtr == NULL) {
- /*
- * Case 3b: List of font attributes in the form "family size
- * ?attrs?"
- */
- patternPtr = TkParseTkDesc(interp, objc, objv);
- }
- }
- return patternPtr;
-}
-
-static void
-TkWriteXLFDDescription(Tk_Window tkwin, TkFontPattern *patternPtr,
- Tcl_DString *resultPtr)
-{
- const char *string;
- int size;
-
- /* Rewrite the font description using the aliased family. */
- Tcl_DStringInit(resultPtr);
-
- /* Foundry */
- Tcl_DStringAppend(resultPtr, "-*-", 3);
- /* Family */
- string = (patternPtr->family != NULL) ? patternPtr->family : "*";
- Tcl_DStringAppend(resultPtr, string, -1);
- Tcl_DStringAppend(resultPtr, "-", 1);
- /* Weight */
- string = (patternPtr->weight == NULL) ? "*" : patternPtr->weight;
- Tcl_DStringAppend(resultPtr, string, -1);
- Tcl_DStringAppend(resultPtr, "-", 1);
- /* Slant */
- string = (patternPtr->slant == NULL) ? "*" : patternPtr->slant;
- Tcl_DStringAppend(resultPtr, string, -1);
- Tcl_DStringAppend(resultPtr, "-", 1);
- /* Width */
- string = (patternPtr->width == NULL) ? "*" : patternPtr->width;
- Tcl_DStringAppend(resultPtr, string, -1);
- /* Style */
- Tcl_DStringAppend(resultPtr, "-*-", 3);
- /* Pixel size */
- size = (int)(PointsToPixels(tkwin, patternPtr->size) + 0.5);
- string = (size == 0) ? "*" : Blt_Itoa(size);
- Tcl_DStringAppend(resultPtr, string, -1);
- /* Point size */
- Tcl_DStringAppend(resultPtr, "-", 1);
- size = (int)(PixelsToPoints(tkwin, patternPtr->size) + 0.5);
- string = (size == 0) ? "*" : Blt_Itoa(size);
- Tcl_DStringAppend(resultPtr, string, -1);
-
- /* resx, resy */
- Tcl_DStringAppend(resultPtr, "-*-*-", 5);
- /* Spacing */
- string = (patternPtr->spacing == NULL) ? "*" : patternPtr->spacing;
- Tcl_DStringAppend(resultPtr, string, -1);
- /* Average Width, Registry, Encoding */
- Tcl_DStringAppend(resultPtr, "-*-*-*-", 7);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TkGetFontFromObj --
- *
- * Opens a Tk font based on the description in the Tcl_Obj. We first
- * parse the description and if necessary rewrite it using the proper
- * font aliases. The font names
- *
- * "Sans Serif", "Serif", "Math", "Monospace"
- *
- * correspond to the proper font regardless if the standard X fonts or
- * XFT fonts are being used.
- *
- * Leave XLFD font descriptions alone. Let users describe exactly the
- * font they wish.
- *
- * Outside of reimplementing the Tk font mechanism, rewriting the
- * font allows use to better handle programs that must work with
- * X servers with and without the XRender extension. It means
- * that the widget's default font settings do not have to use
- * XLFD fonts even if XRender is available.
- *
- *---------------------------------------------------------------------------
- */
-static Tk_Font
-TkGetFontFromObj(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)
-{
- Tk_Font tkFont;
- TkFontPattern *patternPtr;
-
- if (!alias_initialized) {
- MakeAliasTable(tkwin);
- alias_initialized++;
- }
- patternPtr = TkGetPattern(interp, objPtr);
- if (patternPtr == NULL) {
- tkFont = Tk_GetFont(interp, tkwin, Tcl_GetString(objPtr));
- } else {
- Tcl_DString ds;
-
- /* Rewrite the font description using the aliased family. */
- TkWriteXLFDDescription(tkwin, patternPtr, &ds);
- tkFont = Tk_GetFont(interp, tkwin, Tcl_DStringValue(&ds));
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "Tkfont: %s => %s\n", Tcl_GetString(objPtr),
- Tcl_DStringValue(&ds));
-#endif
- Tcl_DStringFree(&ds);
- TkFreeFontPattern(patternPtr);
- }
- return tkFont;
-}
-
-static const char *
-TkNameOfFontProc(_Blt_Font *fontPtr)
-{
- return Tk_NameOfFont(fontPtr->clientData);
-}
-
-static const char *
-TkFamilyOfFontProc(_Blt_Font *fontPtr)
-{
- return ((TkFont *)fontPtr->clientData)->fa.family;
-}
-
-static Font
-TkFontIdProc(_Blt_Font *fontPtr)
-{
- return Tk_FontId(fontPtr->clientData);
-}
-
-static void
-TkGetFontMetricsProc(_Blt_Font *fontPtr, Blt_FontMetrics *fmPtr)
-{
- TkFont *tkFontPtr = fontPtr->clientData;
- Tk_FontMetrics fm;
-
- Tk_GetFontMetrics(fontPtr->clientData, &fm);
- fmPtr->ascent = fm.ascent;
- fmPtr->descent = fm.descent;
- fmPtr->linespace = fm.linespace;
- fmPtr->tabWidth = tkFontPtr->tabWidth;
- fmPtr->underlinePos = tkFontPtr->underlinePos;
- fmPtr->underlineHeight = tkFontPtr->underlineHeight;
-}
-
-static int
-TkMeasureCharsProc(_Blt_Font *fontPtr, const char *text, int nBytes, int max,
- int flags, int *lengthPtr)
-{
- return Tk_MeasureChars(fontPtr->clientData, text, nBytes, max, flags,
- lengthPtr);
-}
-
-static int
-TkTextStringWidthProc(_Blt_Font *fontPtr, const char *string, int nBytes)
-{
- return Tk_TextWidth(fontPtr->clientData, string, nBytes);
-}
-
-static void
-TkDrawCharsProc(
- Display *display, /* Display on which to draw. */
- Drawable drawable, /* Window or pixmap in which to draw. */
- GC gc, /* Graphics context for drawing characters. */
- _Blt_Font *fontPtr, /* Font in which characters will be drawn;
- * must be the same as font used in GC. */
- int depth, /* Not used. */
- float angle, /* Not used. */
- const char *text, /* UTF-8 string to be displayed. Need not be
- * '\0' terminated. All Tk meta-characters
- * (tabs, control characters, and newlines)
- * should be stripped out of the string that
- * is passed to this function. If they are
- * not stripped out, they will be displayed as
- * regular printing characters. */
- int nBytes, /* Number of bytes in string. */
- int x, int y) /* Coordinates at which to place origin of
- * string when drawing. */
-{
- Tk_DrawChars(display, drawable, gc, fontPtr->clientData,text, nBytes, x, y);
-}
-
-static int
-TkPostscriptFontNameProc(_Blt_Font *fontPtr, Tcl_DString *resultPtr)
-{
- TkFont *tkFontPtr;
- unsigned int flags;
-
- tkFontPtr = (TkFont *)fontPtr->clientData;
- flags = 0;
- if (tkFontPtr->fa.slant != TK_FS_ROMAN) {
- flags |= FONT_ITALIC;
- }
- if (tkFontPtr->fa.weight != TK_FW_NORMAL) {
- flags |= FONT_BOLD;
- }
- Blt_Ps_FontName(tkFontPtr->fa.family, flags, resultPtr);
- return tkFontPtr->fa.size;
-}
-
-static int
-TkCanRotateFontProc(_Blt_Font *fontPtr, float angle)
-{
- return FALSE;
-}
-
-static void
-TkFreeFontProc(_Blt_Font *fontPtr)
-{
- Tk_FreeFont(fontPtr->clientData);
- Blt_Free(fontPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TkUnderlineCharsProc --
- *
- * This procedure draws an underline for a given range of characters in a
- * given string. It doesn't draw the characters (which are assumed to
- * have been displayed previously); it just draws the underline. This
- * procedure would mainly be used to quickly underline a few characters
- * without having to construct an underlined font. To produce properly
- * underlined text, the appropriate underlined font should be constructed
- * and used.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets displayed in "drawable".
- *
- *---------------------------------------------------------------------------
- */
-static void
-TkUnderlineCharsProc(
- Display *display, /* Display on which to draw. */
- Drawable drawable, /* Window or pixmap in which to draw. */
- GC gc, /* Graphics context for actually drawing
- * line. */
- _Blt_Font *fontPtr, /* Font used in GC; must have been
- * allocated by Tk_GetFont(). Used for
- * character dimensions, etc. */
- const char *text, /* String containing characters to be
- * underlined or overstruck. */
- int textLen, /* Unused. */
- int x, int y, /* Coordinates at which first character of
- * string is drawn. */
- int first, /* Byte offset of the first character. */
- int last, /* Byte offset after the last character. */
- int xMax)
-{
- Tk_UnderlineChars(display, drawable, gc, fontPtr->clientData, text, x, y,
- first, last);
-}
-
-
-#ifdef HAVE_LIBXFT
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include <X11/Xft/Xft.h>
-
-static Blt_NameOfFontProc FtNameOfFontProc;
-static Blt_FamilyOfFontProc FtFamilyOfFontProc;
-static Blt_FontIdProc FtFontIdProc;
-static Blt_GetFontMetricsProc FtGetFontMetricsProc;
-static Blt_MeasureCharsProc FtMeasureCharsProc;
-static Blt_TextStringWidthProc FtTextStringWidthProc;
-static Blt_FreeFontProc FtFreeFontProc;
-static Blt_DrawCharsProc FtDrawCharsProc;
-static Blt_PostscriptFontNameProc FtPostscriptFontNameProc;
-static Blt_CanRotateFontProc FtCanRotateFontProc;
-static Blt_UnderlineCharsProc FtUnderlineCharsProc;
-
-static Blt_FontClass ftFontClass = {
- FONT_FT,
- FtNameOfFontProc, /* Blt_NameOfFontProc */
- FtFamilyOfFontProc, /* Blt_FamilyOfFontProc */
- FtFontIdProc, /* Blt_FontIdProc */
- FtGetFontMetricsProc, /* Blt_GetFontMetricsProc */
- FtMeasureCharsProc, /* Blt_MeasureCharsProc */
- FtTextStringWidthProc, /* Blt_TextStringWidthProc */
- FtCanRotateFontProc, /* Blt_CanRotateFontProc */
- FtDrawCharsProc, /* Blt_DrawCharsProc */
- FtPostscriptFontNameProc, /* Blt_PostscriptFontNameProc */
- FtFreeFontProc, /* Blt_FreeFontProc */
- FtUnderlineCharsProc, /* Blt_UnderlineCharsProc */
-};
-
-/*
- * Freetype font container.
- */
-typedef struct {
- char *name; /* Name of the font (malloc-ed). */
- int refCount; /* Reference count for this structure.
- * When refCount reaches zero, it
- * means to free the resources
- * associated with this structure. */
- Blt_HashEntry *hashPtr; /* Pointer to this entry in global
- * font hash table. Used to remove the
- * entry * from the table. */
- Font fid; /* Font id used to fake out
- * Tk_FontId. */
- FcPattern *pattern; /* Pattern matching the current
- * non-rotated font. Used to create
- * rotated fonts by duplicating the
- * pattern and adding a rotation
- * matrix. */
-
- Blt_HashTable fontTable; /* Hash table containing an Xft font
- * for each angle it's used at. Will
- * always contain a 0 degree
- * entry. */
-
- /* Information specific to the display/drawable being used. The drawables
- * are changed as the drawable changes for each drawing request.
- * Typically this will change for each pixmap. */
-
- Drawable drawable; /* Drawable associated with draw. */
- XftDraw *draw; /* Current Xft drawable. */
- int drawDepth; /* Depth of current drawable. */
-
- XftColor color; /* Color to be displayed. We don't
- * actually allocate this color, since
- * we assume it's been already
- * allocated by the standard Tk
- * procedures. */
-
- /* Saved Information from the Tk_Window used to created the initial
- * font. */
- Display *display;
- Visual *visual;
- int screenNum;
- Colormap colormap;
-
- int underlineHeight; /* Thickness of underline
- * rectangle. */
- int underlinePos; /* Offset of underline. */
- int tabWidth;
-} FtFont;
-
-static FontSpec rgbaSpecs[] = {
- { "bgr", 1, FC_RGBA, FC_RGBA_BGR, },
- { "none", 1, FC_RGBA, FC_RGBA_NONE, },
- { "rgb", 1, FC_RGBA, FC_RGBA_RGB, },
- { "unknown", 1, FC_RGBA, FC_RGBA_UNKNOWN, },
- { "vbgr", 2, FC_RGBA, FC_RGBA_VBGR, },
- { "vrgb", 2, FC_RGBA, FC_RGBA_VRGB, },
-};
-static int nRgbaSpecs = sizeof(rgbaSpecs) / sizeof(FontSpec);
-
-static FontSpec hintSpecs[] = {
- { "full", 1, FC_HINT_STYLE, FC_HINT_FULL, },
- { "medium", 1, FC_HINT_STYLE, FC_HINT_MEDIUM, },
- { "none", 1, FC_HINT_STYLE, FC_HINT_NONE, },
- { "slight", 1, FC_HINT_STYLE, FC_HINT_SLIGHT, },
-};
-static int nHintSpecs = sizeof(hintSpecs) / sizeof(FontSpec);
-
-static void
-FtGetFontFamilies(Tk_Window tkwin, Blt_HashTable *tablePtr)
-{
- XftFontSet *fsPtr;
- int i;
-
- fsPtr = XftListFonts(Tk_Display(tkwin),
- Tk_ScreenNumber(tkwin),
- (char*)NULL, /* pattern elements */
- XFT_FAMILY, (char*)NULL); /* fields */
- for (i = 0; i < fsPtr->nfont; i++) {
- FcResult result;
- FcChar8 *family;
-
- result = FcPatternGetString(fsPtr->fonts[i], FC_FAMILY, 0, &family);
- if (result == FcResultMatch) {
- int isNew;
- char *name;
-
- /* Family names must be all lower case in the hash table. */
- name = Blt_AssertStrdup((const char *)family);
- strtolower(name);
- Blt_CreateHashEntry(tablePtr, name, &isNew);
- Blt_Free(name);
- }
- }
- XftFontSetDestroy(fsPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FtParseTkDesc --
- *
- * Try to open a Xft font from an Tk style font description.
- *
- * Results:
- * Return value is TCL_ERROR if string was not a fully specified XLFD.
- * Otherwise, fills font attribute buffer with the values parsed from the
- * XLFD and returns TCL_OK.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static FcPattern *
-FtParseTkDesc(Tcl_Interp *interp, Tk_Window tkwin, int objc, Tcl_Obj **objv)
-{
- FcPattern *pattern;
- int i;
- const char *family;
-
- pattern = FcPatternCreate();
- FcPatternAddBool(pattern, FC_ANTIALIAS, FcTrue);
-
- /* Font family. */
- family = GetAlias(Tcl_GetString(objv[0]));
- FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *)family);
-
- /* Size */
- if (objc > 1) {
- int size;
-
- if (Tcl_GetIntFromObj(NULL, objv[1], &size) != TCL_OK) {
- goto error;
- }
- FcPatternAddDouble(pattern, FC_SIZE, PixelsToPoints(tkwin, size));
- }
- i = 2;
- if (objc == 3) {
- if (Tcl_ListObjGetElements(interp, objv[2], &objc, &objv) != TCL_OK) {
- goto error;
- }
- i = 0;
- }
- for (/*empty*/; i < objc; i++) {
- FontSpec *specPtr;
-
- specPtr = FindSpec(interp, fontSpecs, nFontSpecs,
- Tcl_GetString(objv[i]));
- if (specPtr == NULL) {
- goto error;
- }
- if (specPtr->key != NULL) {
- FcPatternAddInteger(pattern, specPtr->key, specPtr->value);
- }
- }
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "parsed TkDesc-XFT font \"%s\"\n", Tcl_GetString(objv[0]));
-#endif
- return pattern;
- error:
- if (pattern != NULL) {
- FcPatternDestroy(pattern);
- }
- return NULL;
-}
-
-static FcPattern *
-FtParseTkFontAttributeList(Tcl_Interp *interp, Tk_Window tkwin,
- Tcl_Obj *objPtr)
-{
- FcPattern *pattern;
- Tcl_Obj **objv;
- int objc;
- int i;
-
- if ((Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) ||
- (objc < 1)) {
- return NULL; /* Can't split list or list is empty. */
- }
- if (objc & 0x1) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "odd number of elements, missing value",
- (char *)NULL);
- }
- return NULL; /* Odd number of elements in list. */
- }
- pattern = FcPatternCreate();
- FcPatternAddBool(pattern, FC_ANTIALIAS, FcTrue);
- for (i = 0; i < objc; i += 2) {
- char *key, *value;
-
- key = Tcl_GetString(objv[i]);
- value = Tcl_GetString(objv[i+1]);
- if (strcmp(key, "-family") == 0) {
- const char *family;
-
- family = GetAlias(value);
- FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *)family);
- } else if (strcmp(key, "-size") == 0) {
- int size;
-
- if (Tcl_GetIntFromObj(interp, objv[i+1], &size) != TCL_OK) {
- goto error;
- }
- FcPatternAddDouble(pattern, FC_SIZE, PixelsToPoints(tkwin, size));
- } else if (strcmp(key, "-weight") == 0) {
- FontSpec *specPtr;
-
- specPtr = FindSpec(interp, weightSpecs, nWeightSpecs, value);
- if (specPtr == NULL) {
- goto error;
- }
- FcPatternAddInteger(pattern, FC_WEIGHT, specPtr->value);
- } else if (strcmp(key, "-slant") == 0) {
- FontSpec *specPtr;
-
- specPtr = FindSpec(interp, slantSpecs, nSlantSpecs, value);
- if (specPtr == NULL) {
- goto error;
- }
- FcPatternAddInteger(pattern, FC_SLANT, specPtr->value);
- } else if (strcmp(key, "-hint") == 0) {
- FontSpec *specPtr;
-
- specPtr = FindSpec(interp, hintSpecs, nHintSpecs, value);
- if (specPtr == NULL) {
- goto error;
- }
- FcPatternAddInteger(pattern, FC_HINT_STYLE, specPtr->value);
- } else if (strcmp(key, "-rgba") == 0) {
- FontSpec *specPtr;
-
- specPtr = FindSpec(interp, rgbaSpecs, nRgbaSpecs, value);
- if (specPtr == NULL) {
- goto error;
- }
- FcPatternAddInteger(pattern, FC_RGBA, specPtr->value);
- } else if (strcmp(key, "-underline") == 0) {
- /* Ignore */
- } else if (strcmp(key, "-overstrike") == 0) {
- /* Ignore */
- } else {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "unknown switch \"", key,
- "\" in font description.", (char *)NULL);
- }
- goto error;
- }
- }
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "parsed TkAttrList-XFT font \"%s\"\n",
- Tcl_GetString(objPtr));
-#endif
- return pattern;
- error:
- FcPatternDestroy(pattern);
- return NULL;
-}
-
-static FcPattern *
-FtGetAttributesFromFontObj(Tk_Window tkwin, Tcl_Interp *interp,
- Tcl_Obj *objPtr)
-{
- FcPattern *pattern;
- Tcl_Obj *cmd[3];
- int result;
-
- cmd[0] = Tcl_NewStringObj("font", -1);
- cmd[1] = Tcl_NewStringObj("configure", -1);
- cmd[2] = objPtr;
- result = Blt_GlobalEvalObjv(interp, 3, cmd);
- if (result == TCL_OK) {
- pattern = FtParseTkFontAttributeList(interp, tkwin,
- Tcl_GetObjResult(interp));
- } else {
- pattern = NULL;
- }
- Tcl_ResetResult(interp);
-#if DEBUG_FONT_SELECTION
- if (pattern != NULL) {
- fprintf(stderr, "found FontObject => XFT font \"%s\"\n",
- Tcl_GetString(objPtr));
- }
-#endif
- return pattern;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FtParseXLFD --
- *
- * Try to open a Xft font from an XLFD description.
- *
- * Results:
- * Return value is TCL_ERROR if string was not a fully specified XLFD.
- * Otherwise, fills font attribute buffer with the values parsed from the
- * XLFD and returns TCL_OK.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static FcPattern *
-FtParseXLFD(Tcl_Interp *interp, Tk_Window tkwin, char *fontName)
-{
- FcPattern *pattern;
- FontSpec *specPtr;
- int argc;
- char **argv;
- double size;
-
- if (fontName[0] == '-') {
- fontName++;
- }
- ParseXLFD(fontName, &argc, &argv);
-
- pattern = FcPatternCreate();
- FcPatternAddBool(pattern, FC_ANTIALIAS, FcTrue);
-
- if (argv[XLFD_FOUNDRY] != NULL) {
- FcPatternAddString(pattern, FC_FOUNDRY,
- (const FcChar8 *)argv[XLFD_FOUNDRY]);
- }
- if (argv[XLFD_FAMILY] != NULL) {
- FcPatternAddString(pattern, FC_FAMILY,
- (const FcChar8 *)argv[XLFD_FAMILY]);
- }
- if (argv[XLFD_WEIGHT] != NULL) {
- specPtr = FindSpec(interp, weightSpecs, nWeightSpecs,
- argv[XLFD_WEIGHT]);
- if (specPtr == NULL) {
- goto error;
- }
- FcPatternAddInteger(pattern, FC_WEIGHT, specPtr->value);
- }
- if (argv[XLFD_SLANT] != NULL) {
- specPtr = FindSpec(interp, slantSpecs, nSlantSpecs, argv[XLFD_SLANT]);
- if (specPtr == NULL) {
- goto error;
- }
- FcPatternAddInteger(pattern, FC_SLANT, specPtr->value);
- }
- if (argv[XLFD_SETWIDTH] != NULL) {
- specPtr = FindSpec(interp, widthSpecs, nWidthSpecs,
- argv[XLFD_SETWIDTH]);
- if (specPtr == NULL) {
- goto error;
- }
- FcPatternAddInteger(pattern, FC_WIDTH, specPtr->value);
- }
- if (argv[XLFD_ADD_STYLE] != NULL) {
- FcPatternAddString(pattern, FC_STYLE,
- (const FcChar8 *)argv[XLFD_ADD_STYLE]);
- }
- size = 12.0;
- if (argv[XLFD_PIXEL_SIZE] != NULL) {
- int value;
- if (argv[XLFD_PIXEL_SIZE][0] == '[') {
- /*
- * Some X fonts have the point size specified as follows:
- *
- * [ N1 N2 N3 N4 ]
- *
- * where N1 is the point size (in points, not decipoints!), and
- * N2, N3, and N4 are some additional numbers that I don't know
- * the purpose of, so I ignore them.
- */
- value = atoi(argv[XLFD_PIXEL_SIZE]+1);
- } else if (Tcl_GetInt(NULL, argv[XLFD_PIXEL_SIZE], &value) == TCL_OK) {
- /* empty */
- } else {
- goto error;
- }
- size = PixelsToPoints(tkwin, -value);
- }
-#ifndef notdef
- if (argv[XLFD_POINT_SIZE] != NULL) {
- int value;
- if (argv[XLFD_POINT_SIZE][0] == '[') {
- /*
- * Some X fonts have the point size specified as follows:
- *
- * [ N1 N2 N3 N4 ]
- *
- * where N1 is the point size (in points, not decipoints!), and
- * N2, N3, and N4 are some additional numbers that I don't know
- * the purpose of, so I ignore them.
- */
- value = atoi(argv[XLFD_POINT_SIZE]+1);
- } else if (Tcl_GetInt(NULL, argv[XLFD_POINT_SIZE], &value) == TCL_OK) {
- /* empty */
- } else {
- goto error;
- }
- size = PixelsToPoints(tkwin, -value) * 0.1;
- }
-#endif
- FcPatternAddDouble(pattern, FC_SIZE, (double)size);
-
- if (argv[XLFD_SPACING] != NULL) {
- specPtr = FindSpec(interp, spacingSpecs, nSpacingSpecs,
- argv[XLFD_SPACING]);
- if (specPtr == NULL) {
- goto error;
- }
- FcPatternAddInteger(pattern, FC_SPACING, specPtr->value);
- }
-#ifdef notdef
- if (argv[XLFD_CHARSET] != NULL) {
- FcPatternAddString(pattern, FC_CHARSET,
- (const FcChar8 *)argv[XLFD_CHARSET]);
- } else {
- FcPatternAddString(pattern, FC_CHARSET, (const FcChar8 *)"iso8859-1");
- }
-#endif
- Blt_Free((char *)argv);
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "parsed Xlfd-XFT font \"%s\"\n", fontName);
-#endif
- return pattern;
- error:
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "can't open font \"%s\" as XLFD\n", fontName);
-#endif
- Blt_Free((char *)argv);
- FcPatternDestroy(pattern);
- return NULL;
-}
-
-
-static void
-FtDeleteFont(FtFont *ftPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&ftPtr->fontTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- XftFont *xftPtr;
-
- xftPtr = Blt_GetHashValue(hPtr);
- XftFontClose(ftPtr->display, xftPtr);
- }
- Blt_DeleteHashTable(&ftPtr->fontTable);
-
- if (ftPtr->name != NULL) {
- Blt_Free(ftPtr->name);
- }
- if (ftPtr->draw != 0) {
- XftDrawDestroy(ftPtr->draw);
- }
- if (ftPtr->fid) {
- XUnloadFont(ftPtr->display, ftPtr->fid);
- }
- Blt_DeleteHashEntry(&fontTable, ftPtr->hashPtr);
- Blt_Free(ftPtr);
-}
-
-static int
-FtMeasureChars(FtFont *ftPtr, const char *source, int nBytes, int maxLength,
- int flags, int *lengthPtr)
-{
- FcChar32 c;
- XGlyphInfo extents;
- int clen;
- int curX, newX;
- int termByte = 0, termX = 0;
- int curByte, newByte, sawNonSpace;
-#if 0
- char string[256];
- int len = 0;
-#endif
- XftFont *xftPtr;
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&ftPtr->fontTable, (char *)0L);
- if (hPtr == NULL) {
- return 0;
- }
- xftPtr = Blt_GetHashValue(hPtr);
- curX = 0;
- curByte = 0;
- sawNonSpace = 0;
- while (nBytes > 0) {
- Tcl_UniChar unichar;
-
- clen = Tcl_UtfToUniChar(source, &unichar);
- c = (FcChar32)unichar;
-
- if (clen <= 0) {
- /* This can't happen (but see #1185640) */
- *lengthPtr = curX;
- return curByte;
- }
-
- source += clen;
- nBytes -= clen;
- if (c < 256 && isspace(c)) { /* I18N: ??? */
- if (sawNonSpace) {
- termByte = curByte;
- termX = curX;
- sawNonSpace = 0;
- }
- } else {
- sawNonSpace = 1;
- }
-
-#if 0
- string[len++] = (char) c;
-#endif
- XftTextExtents32(ftPtr->display, xftPtr, &c, 1, &extents);
-
- newX = curX + extents.xOff;
- newByte = curByte + clen;
- if (maxLength >= 0 && newX > maxLength) {
- if ((flags & TK_PARTIAL_OK) ||
- ((flags & TK_AT_LEAST_ONE && curByte == 0))) {
- curX = newX;
- curByte = newByte;
- } else if ((flags & TK_WHOLE_WORDS) && (termX != 0)) {
- curX = termX;
- curByte = termByte;
- }
- break;
- }
-
- curX = newX;
- curByte = newByte;
- }
-#if 0
- string[len] = '\0';
- printf("MeasureChars %s length %d bytes %d\n", string, curX, curByte);
-#endif
- *lengthPtr = curX;
- return curByte;
-}
-
-static void
-FtSetFontParams(Tk_Window tkwin, FtFont *ftPtr, XftFont *xftPtr)
-{
- FT_UInt glyph;
- XGlyphInfo metrics;
- double size;
- FcResult result;
-
- /*
- * Get information used for drawing underlines from the 0 angle font.
- */
- glyph = XftCharIndex(ftPtr->display, xftPtr, '0');
- XftGlyphExtents(ftPtr->display, xftPtr, &glyph, 1, &metrics);
-
- ftPtr->underlinePos = xftPtr->descent / 2;
- result = FcPatternGetDouble(xftPtr->pattern, FC_SIZE, 0, &size);
- if (result != FcResultMatch) {
- size = 12.0;
- }
- ftPtr->underlineHeight = (int)(PointsToPixels(tkwin,(int)size)/10.0 + 0.5);
- if (ftPtr->underlineHeight == 0) {
- ftPtr->underlineHeight = 1;
- }
- if ((ftPtr->underlinePos + ftPtr->underlineHeight) > xftPtr->descent) {
- /*
- * If this set of values would cause the bottom of the underline bar
- * to stick below the descent of the font, jack the underline up a bit
- * higher.
- */
- ftPtr->underlineHeight = xftPtr->descent - ftPtr->underlinePos;
- if (ftPtr->underlineHeight == 0) {
- ftPtr->underlinePos--;
- ftPtr->underlineHeight = 1;
- }
- }
- FtMeasureChars(ftPtr, "0", 1, -1, 0, &ftPtr->tabWidth);
- if (ftPtr->tabWidth == 0) {
- ftPtr->tabWidth = xftPtr->max_advance_width;
- }
- ftPtr->tabWidth *= 8;
- /*
- * Make sure the tab width isn't zero (some fonts may not have enough
- * information to set a reasonable tab width).
- */
- if (ftPtr->tabWidth == 0) {
- ftPtr->tabWidth = 1;
- }
-}
-
-static FtFont *
-FtNewFont(Tcl_Interp *interp, Tk_Window tkwin, const char *fontName,
- XftFont *xftPtr)
-{
- Blt_HashEntry *hPtr;
- FtFont *ftPtr;
- int isNew;
-
- ftPtr = Blt_AssertCalloc(1, sizeof(FtFont));
- ftPtr->name = Blt_AssertStrdup(fontName);
- ftPtr->visual = Tk_Visual(tkwin);
- ftPtr->colormap = Tk_Colormap(tkwin);
- ftPtr->display = Tk_Display(tkwin);
- ftPtr->fid = XLoadFont(Tk_Display(tkwin), "fixed");
- ftPtr->color.pixel = 0xFFFFFFFF;
- ftPtr->pattern = xftPtr->pattern;
- ftPtr->refCount = 1;
- /*
- * Initialize the Xft font table for this font. Add the initial Xft font
- * for the case of 0 degrees rotation.
- */
- Blt_InitHashTable(&ftPtr->fontTable, BLT_ONE_WORD_KEYS);
- hPtr = Blt_CreateHashEntry(&ftPtr->fontTable, (char *)0L, &isNew);
- assert(isNew);
- Blt_SetHashValue(hPtr, xftPtr);
-
-#ifdef notdef
- /* Try to use the Freetype routine FT_Get_Postscript_Name. If this fails,
- * build a string from the various fields of the font. */
- {
- FT_Face face;
- const char *string;
-
- face = XftLockFace(xftPtr);
- string = FT_Get_Postscript_Name(face);
- XftUnlockFace(xftPtr);
- if (string != NULL) {
- fprintf(stderr, "%s: psfont=(%s)\n", fontName, string);
- }
- }
-#endif
- /* Add the font information to the font table. */
- hPtr = Blt_CreateHashEntry(&fontTable, fontName, &isNew);
- assert(isNew);
- Blt_SetHashValue(hPtr, ftPtr);
- ftPtr->hashPtr = hPtr;
- FtSetFontParams(tkwin, ftPtr, xftPtr);
- return ftPtr;
-}
-
-/*
- * FtGetPattern --
- *
- * Generates an pattern based upon the font description provided. The
- * description is parsed base upon Tk's font selection rules (listed
- * below).
- *
- * Tk's Font Selection Rules:
- *
- * When font description font is used, the system attempts to parse the
- * description according to each of the above five rules, in the order
- * specified. Cases [1] and [2] must match the name of an existing named
- * font or of a system font. Cases [3], [4], and [5] are accepted on all
- * platforms and the closest available font will be used. In some
- * situations it may not be possible to find any close font (e.g., the
- * font family was a garbage value); in that case, some system-dependant
- * default font is chosen. If the font description does not match any of
- * the above patterns, an error is generated.
- *
- * [1] fontname
- * The name of a named font, created using the font create command. When
- * a widget uses a named font, it is guaranteed that this will never
- * cause an error, as long as the named font exists, no mat- ter what
- * potentially invalid or meaningless set of attributes the named font
- * has. If the named font cannot be displayed with exactly the specified
- * attributes, some other close font will be substituted automatically.
- *
- * [Query the named font (using "font configure") and generate an Xft
- * font with the same attributes. It's assumed that these names don't
- * start with a '*' or '-'.]
- *
- * [2] systemfont
- * The platform-specific name of a font, interpreted by the graphics
- * server. This also includes, under X, an XLFD (see [4]) for which a
- * single ``*'' character was used to elide more than one field in the
- * middle of the name. See PLATFORM-SPECIFIC issues for a list of the
- * system fonts.
- *
- * [Same as above. Query the named font (using "font configure") and
- * generate an Xft font with the same attributes.]
- *
- * [3] family ?size? ?style? ?style ...?
- * A properly formed list whose first element is the desired font family
- * and whose optional second element is the desired size. The
- * interpretation of the size attribute follows the same rules described
- * for -size in FONT OPTIONS below. Any additional optional arguments
- * following the size are font styles. Possible values for the style
- * arguments are as follows:
- *
- * normal, bold, roman, italic, underline, overstrike
- *
- * [Parse the list of attributes and generate a corresponding Xft font.]
- *
- * [4] X-font names (XLFD)
- * A Unix-centric font name of the form -foundry-family-weight
- * slant-setwidth-addstyle-pixel-point-resx-resy-spacing-width
- * charset-encoding. The ``*'' character may be used to skip indi vidual
- * fields that the user does not care about. There must be exactly one
- * ``*'' for each field skipped, except that a ``*'' at the end of the
- * XLFD skips any remaining fields; the shortest valid XLFD is simply
- * ``*'', signifying all fields as defaults. Any fields that were
- * skipped are given default values. For compatibility, an XLFD always
- * chooses a font of the specified pixel size (not point size); although
- * this interpretation is not strictly correct, all existing applications
- * using XLFDs assumed that one ``point'' was in fact one pixel and would
- * display incorrectly (generally larger) if the correct size font were
- * actually used.
- *
- * [Parse the font description and generate a corresponding Xft font.]
- *
- * [5] option value ?option value ...?
- * A properly formed list of option-value pairs that specify the desired
- * attributes of the font, in the same format used when defining a named
- * font.
- *
- * [Parse the option-value list and generate a corresponding Xft font.]
- *
- * Extra:
- * [6] Xft font description.
- *
- * [Handle the newer Xft font descriptions.]
- */
-
-static FcPattern *
-FtGetPattern(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)
-{
- FcPattern *pattern;
- char *desc;
-
- desc = Tcl_GetString(objPtr);
- while (isspace(*desc)) {
- desc++; /* Skip leading blanks. */
- }
- if (*desc == '-') {
- /*
- * Case 1: XLFD font description or Tk attribute list.
- *
- * If the font description starts with a '-', it could be either an
- * old fashion XLFD font description or a Tk font attribute
- * option-value list.
- */
- pattern = FtParseTkFontAttributeList(NULL, tkwin, objPtr);
- if (pattern == NULL) {
- /* Try parsing it as an XLFD font description. */
- pattern = FtParseXLFD(interp, tkwin, desc);
- }
- } else if (*desc == '*') {
- pattern = FtParseXLFD(interp, tkwin, desc);
- } else if (strpbrk(desc, ":,=") != NULL) {
- /*
- * Case 2: XFT font description.
- *
- * If the font description contains a ':', '=', or ',' in it, we
- * assume it's a new XFT font description. We want to allow these
- * font descriptions too.
- */
- pattern = NULL;
- if (strstr(desc, "::") != NULL) {
- pattern = FtGetAttributesFromFontObj(tkwin, interp, objPtr);
- }
- if (pattern == NULL) {
- pattern = FcNameParse((const FcChar8 *)desc);
- }
-#if DEBUG_FONT_SELECTION
- if (pattern != NULL) {
- fprintf(stderr, "found XFT => XFT font \"%s\"\n", desc);
- }
-#endif
- } else {
- int objc;
- Tcl_Obj **objv;
- /*
- * Case 3: Tk-style description.
- */
- if ((Tcl_ListObjGetElements(NULL, objPtr, &objc, &objv) != TCL_OK) ||
- (objc < 1)) {
- return NULL; /* Can't split into a list or list is
- * empty. */
- }
- if (objc == 1) {
- /*
- * Case 3a: Tk font object name.
- *
- * Assuming that Tk font object names won't contain whitespace,
- * see if its a font object.
- */
-
- pattern = FtGetAttributesFromFontObj(tkwin, interp, objv[0]);
- if (pattern == NULL) {
- pattern = FcNameParse((const FcChar8 *)desc);
-#if DEBUG_FONT_SELECTION
- if (pattern != NULL) {
- fprintf(stderr, "found XFT => XFT font \"%s\"\n", desc);
- }
-#endif
- }
- } else {
- /*
- * Case 3b: List of font attributes in the form "family size
- * ?attrs?"
- */
- pattern = FtParseTkDesc(interp, tkwin, objc, objv);
- }
- }
- return pattern;
-}
-
-static FcPattern *
-FtGetFontPattern(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)
-{
- FcPattern *pattern;
-
- pattern = FtGetPattern(interp, tkwin, objPtr);
- if (pattern != NULL) {
- FcPattern *match;
- FcResult result;
-
- /*
- * XftFontMatch only sets *result* on complete match failures. So
- * initialize it here for a successful match. We'll accept partial
- * matches.
- */
- result = FcResultMatch;
- match = XftFontMatch(Tk_Display(tkwin), Tk_ScreenNumber(tkwin),
- pattern, &result);
-#if DEBUG_FONT_SELECTION
- if (match != NULL) {
- FcChar8 *name;
-
- name = FcNameUnparse(pattern);
- fprintf(stderr, "\nfont=%s\n", Tcl_GetString(objPtr));
- fprintf(stderr, "original spec was %s\n", name);
- free(name);
- name = FcNameUnparse(match);
- fprintf(stderr, "matching spec is %s\n", name);
- free(name);
- }
-#endif
- FcPatternDestroy(pattern);
- if ((match != NULL) && (result == FcResultMatch)) {
- return match;
- }
- }
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "can't open font pattern \"%s\"\n", Tcl_GetString(objPtr));
-#endif
- return NULL;
-}
-
-static XftFont *
-FtOpenFont(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)
-{
- FcPattern *pattern;
-
- pattern = FtGetFontPattern(interp, tkwin, objPtr);
- if (pattern != NULL) {
- return XftFontOpenPattern(Tk_Display(tkwin), pattern);
- }
- return NULL;
-}
-
-static FtFont *
-FtGetFontFromObj(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)
-{
- Blt_HashEntry *hPtr;
- char *desc;
-
- desc = Tcl_GetString(objPtr);
- while (isspace(*desc)) {
- desc++; /* Skip leading blanks. */
- }
- /* Is the font already in the cache? */
- hPtr = Blt_FindHashEntry(&fontTable, desc);
- if (hPtr != NULL) {
- FtFont *ftPtr;
-
- ftPtr = Tcl_GetHashValue(hPtr);
- ftPtr->refCount++;
- return ftPtr;
- } else {
- XftFont *xftPtr;
-
- xftPtr = FtOpenFont(interp, tkwin, objPtr);
- if (xftPtr != NULL) {
- return FtNewFont(interp, tkwin, desc, xftPtr);
- }
- }
- return NULL;
-}
-
-const char *
-Blt_GetFontFileFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, double *sizePtr)
-{
- Tk_Window tkwin;
- FcResult result;
- FcChar8 *fileName;
- FcPattern *pattern;
- double size;
-
- tkwin = Tk_MainWindow(interp);
- if (!alias_initialized) {
- MakeAliasTable(tkwin);
- alias_initialized++;
- }
- if (!IsXRenderAvailable(tkwin)) {
- Tcl_AppendResult(interp, "can't open Xft font: ",
- "X server doesn't support XRENDER extension",
- (char *)NULL);
- return NULL;
- }
- pattern = FtGetFontPattern(interp, tkwin, objPtr);
- if (pattern == NULL) {
- return NULL;
- }
- result = FcPatternGetDouble(pattern, FC_SIZE, 0, &size);
- if (result != FcResultMatch) {
- size = 12.0;
- }
- result = FcPatternGetString(pattern, FC_FILE, 0, &fileName);
- FcPatternDestroy(pattern);
- if (result != FcResultMatch) {
- return NULL;
- }
- *sizePtr = size;
- return (const char *)fileName;
-}
-
-const char *
-Blt_GetFontFile(Tcl_Interp *interp, const char *fontName, double *sizePtr)
-{
- Tcl_Obj *objPtr;
- const char *fileName;
-
- objPtr = Tcl_NewStringObj(fontName, strlen(fontName));
- Tcl_IncrRefCount(objPtr);
- fileName = Blt_GetFontFileFromObj(interp, objPtr, sizePtr);
- Tcl_DecrRefCount(objPtr);
- return fileName;
-}
-
-
-static const char *
-FtNameOfFontProc(_Blt_Font *fontPtr)
-{
- FtFont *ftPtr = fontPtr->clientData;
- return ftPtr->name;
-}
-
-static const char *
-FtFamilyOfFontProc(_Blt_Font *fontPtr)
-{
- FtFont *ftPtr = fontPtr->clientData;
- FcChar8 *string;
- FcResult result;
-
- result = FcPatternGetString(ftPtr->pattern, FC_FAMILY, 0, &string);
- if (result == FcResultMatch) {
- return (const char *)string;
- }
- return NULL;
-}
-
-
-static Font
-FtFontIdProc(_Blt_Font *fontPtr)
-{
- FtFont *ftPtr = fontPtr->clientData;
- return ftPtr->fid;
-}
-
-static void
-FtGetFontMetricsProc(_Blt_Font *fontPtr, Blt_FontMetrics *mPtr)
-{
- FtFont *ftPtr = fontPtr->clientData;
- Blt_HashEntry *hPtr;
-
- /* Always take font metrics from the non-rotated font. */
- hPtr = Blt_FindHashEntry(&ftPtr->fontTable, (char *)0L);
- if (hPtr != NULL) {
- FT_UInt glyph;
- XGlyphInfo metrics;
- XftFont *xftPtr;
-
- xftPtr = Blt_GetHashValue(hPtr);
- glyph = XftCharIndex(ftPtr->display, xftPtr, '0');
- XftGlyphExtents(ftPtr->display, xftPtr, &glyph, 1, &metrics);
- mPtr->ascent = xftPtr->ascent;
- mPtr->descent = xftPtr->descent;
- mPtr->linespace = mPtr->ascent + mPtr->descent;
- mPtr->tabWidth = ftPtr->tabWidth;
- mPtr->underlinePos = ftPtr->underlinePos;
- mPtr->underlineHeight = ftPtr->underlineHeight;
- }
-}
-
-static int
-FtMeasureCharsProc(
- _Blt_Font *fontPtr,
- const char *source,
- int nBytes,
- int maxLength,
- int flags,
- int *lengthPtr)
-{
- FtFont *ftPtr = fontPtr->clientData;
-
- return FtMeasureChars(ftPtr, source, nBytes, maxLength, flags, lengthPtr);
-}
-
-static int
-FtTextStringWidthProc(Blt_Font font, const char *string, int nBytes)
-{
- int width;
-
- FtMeasureCharsProc(font, string, nBytes, -1, 0, &width);
- return width;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FtPostscriptFontNameProc --
- *
- * Given a Xft font, return the name of the corresponding Postscript
- * font.
- *
- * Results:
- * The return value is the pointsize of the given Xft font. The name of
- * the Postscript font is appended to dsPtr.
- *
- * Side effects:
- * If the font does not exist on the printer, the print job will fail at
- * print time. Given a "reasonable" Postscript printer, the following
- * Tk_Font font families should print correctly:
- *
- * Avant Garde, Arial, Bookman, Courier, Courier New, Geneva,
- * Helvetica, Monaco, New Century Schoolbook, New York, Palatino,
- * Symbol, Times, Times New Roman, Zapf Chancery, and Zapf Dingbats.
- *
- * Any other Xft font families may not print correctly because the
- * computed Postscript font name may be incorrect.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-FtPostscriptFontNameProc(_Blt_Font *fontPtr, Tcl_DString *resultPtr)
-{
- FtFont *ftPtr = fontPtr->clientData;
- FcChar8 *string;
- const char *family;
- FcResult result;
- int weight, slant;
- double size;
- int flags;
-
- result = FcPatternGetString(ftPtr->pattern, FC_FAMILY, 0, &string);
- family = (result == FcResultMatch) ? (const char *)string : "Unknown";
- result = FcPatternGetInteger(ftPtr->pattern, FC_WEIGHT, 0, &weight);
- if (result != FcResultMatch) {
- weight = FC_WEIGHT_MEDIUM;
- }
- result = FcPatternGetInteger(ftPtr->pattern, FC_SLANT, 0, &slant);
- if (result != FcResultMatch) {
- slant = FC_SLANT_ROMAN;
- }
- flags = 0;
- if (weight > FC_WEIGHT_MEDIUM) {
- flags |= FONT_BOLD;
- }
- if (slant > FC_SLANT_ROMAN) {
- flags |= FONT_ITALIC;
- }
- Blt_Ps_FontName(family, flags, resultPtr);
- result = FcPatternGetDouble(ftPtr->pattern, FC_SIZE, 0, &size);
- if (result != FcResultMatch) {
- size = 12.0;
- }
- return (int)size;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FtUnderlineCharsProc --
- *
- * This procedure draws an underline for a given range of characters in a
- * given string. It doesn't draw the characters (which are assumed to
- * have been displayed previously); it just draws the underline. This
- * procedure would mainly be used to quickly underline a few characters
- * without having to construct an underlined font. To produce properly
- * underlined text, the appropriate underlined font should be constructed
- * and used.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets displayed in "drawable".
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-FtUnderlineCharsProc(
- Display *display, /* Display on which to draw. */
- Drawable drawable, /* Window or pixmap in which to
- * draw. */
- GC gc, /* Graphics context for actually
- * drawing line. */
- _Blt_Font *fontPtr,
- const char *text, /* String containing characters to be
- * underlined or overstruck. */
- int textLen,
- int x, int y, /* Coordinates at which first
- * character of string is drawn. */
- int first, /* Index of first byte of first
- * character. */
- int last, /* Index of first byte after the last
- * character. */
- int maxLength)
-{
- int elWidth;
- const char *s, *send;
- FtFont *ftPtr = fontPtr->clientData;
- int firstX, lastX, clipX;
- int nBytes;
- int accum, threshold, index, next;
- int clipped;
-
- /* Compute the width of an ellipsis and verify that we're not bigger
- * than it. */
- elWidth = Blt_TextWidth(fontPtr, "...", 3);
- if (maxLength < 0) {
- maxLength = threshold = 10000;
- } else {
- threshold = maxLength - elWidth;
- }
-#if !HAVE_UTF
- nBytes = 1;
-#endif /* !HAVE_UTF */
- /* Compute the length of the string, stopping when we've surpassed our
- * threshold. Also save the first and last coordinates of the substring to
- * be underlined. */
- clipX = lastX = -1, firstX = 0;
- accum = next = 0;
- clipped = FALSE;
- for (index = 0, s = text, send = s + textLen; s < send;
- s += nBytes, index++, accum += next) {
-#if HAVE_UTF
- Tcl_UniChar ch;
-#endif /* HAVE_UTF */
-
- if (index == first) {
- firstX = accum;
- }
- if (index == last) {
- lastX = accum;
- break;
- }
-#if HAVE_UTF
- nBytes = Tcl_UtfToUniChar(s, &ch);
-#endif /* HAVE_UTF */
- next = Blt_TextWidth(fontPtr, s, nBytes);
- if ((next + accum) <= threshold) {
- clipX = accum + next; /* Remember the last length where text
- * plus the ellipsis fit */
- }
- if ((next + accum) > maxLength) {
- clipped = TRUE;
- break;
- }
- }
- if (lastX < 0) {
- lastX = accum;
- }
- if (clipped) {
- if ((s < send) && (accum < elWidth)) {
- return; /* Not enough room for "..." */
- }
- lastX = clipX + elWidth;
- }
- x += firstX;
- y += ftPtr->underlinePos + 1;
- XFillRectangle(display, drawable, gc, x, y, (unsigned int)(lastX - firstX),
- (unsigned int)ftPtr->underlineHeight);
-}
-
-static int
-FtCanRotateFontProc(_Blt_Font *fontPtr, float angle)
-{
- FcPattern *pattern;
- FcResult result;
- FtFont *ftPtr = fontPtr->clientData;
- int boolean;
- long angle10;
-
- angle10 = (long)((double)angle * 10.0);
- if (Blt_FindHashEntry(&ftPtr->fontTable, (char *)angle10) != NULL) {
- return TRUE; /* Rotated font already exists. */
- }
-
- /*
- * I don't know if this is correct. Some PCF fonts don't rotate properly.
- * The chararcter positions are rotated but the glyph itself is drawn with
- * no rotation. The standard Adobe Helvetica font is a good example of
- * this. So I need to bail on those fonts. I check if scalable=True in
- * the Xft font pattern to determine if the font will rotate properly.
- */
- result = FcPatternGetBool(ftPtr->pattern, FC_SCALABLE, 0, &boolean);
- if ((result == FcResultMatch) && (!boolean)) {
- return FALSE;
- }
- {
- XftMatrix matrix;
- double cosTheta, sinTheta, theta;
-
- theta = ((double)angle / 180.0) * M_PI;
- sinTheta = sin(theta);
- cosTheta = cos(theta);
-
- XftMatrixInit(&matrix);
- XftMatrixRotate(&matrix, cosTheta, sinTheta);
- pattern = FcPatternDuplicate(ftPtr->pattern);
- FcPatternAddMatrix(pattern, FC_MATRIX, &matrix);
- }
-
- {
- FcResult result;
- FcPattern *match;
-
- /*
- * XftFontMatch only sets *result* on complete match failures. So
- * initialize it here for a successful match. We'll accept partial
- * matches.
- */
- result = FcResultMatch;
- match = XftFontMatch(ftPtr->display, ftPtr->screenNum, pattern,&result);
- if ((match != NULL) && (result == FcResultMatch)) {
- XftFont *xftPtr;
-
- xftPtr = XftFontOpenPattern(ftPtr->display, match);
- /* Add the new rotated font to the hash table. */
- if (xftPtr != NULL) {
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&ftPtr->fontTable, (char *)angle10,
- &isNew);
- assert(isNew);
- Blt_SetHashValue(hPtr, xftPtr);
- FcPatternDestroy(pattern);
- return TRUE;
- }
- }
- FcPatternDestroy(pattern);
- }
- return FALSE;
-}
-
-static void
-FtDrawCharsProc(
- Display *display, /* Display on which to draw. */
- Drawable drawable, /* Window or pixmap in which to draw. */
- GC gc, /* Graphics context for drawing
- * characters. */
- _Blt_Font *fontPtr, /* Font in which characters will be
- * drawn; must be the same as font
- * used in *GC. */
- int depth,
- float angle,
- const char *source, /* UTF-8 string to be displayed. Need
- * not be '\0' terminated. All Tk
- * meta-characters (tabs, control
- * characters, and newlines) should be
- * stripped out of the string that is
- * passed to this function. If they
- * are not stripped out, they will be
- * displayed as regular printing
- * characters. */
- int nBytes, /* # of bytes in string. */
- int x, int y) /* Coordinates at which to place
- * origin of string when drawing. */
-{
- XftFont *xftPtr;
- FtFont *ftPtr = fontPtr->clientData;
- Blt_HashEntry *hPtr;
- long angle10;
-
- angle10 = (long)(angle * 10.0);
- hPtr = Blt_FindHashEntry(&ftPtr->fontTable, (char *)angle10);
- if (hPtr == NULL) {
- fprintf(stderr, "can't find font %s rotated at %g degrees\n",
- ftPtr->name, angle);
- return; /* Can't find instance at requested angle. */
- }
- xftPtr = Blt_GetHashValue(hPtr);
- if ((ftPtr->draw == 0) || (ftPtr->drawDepth != depth)) {
- XftDraw *draw;
-
- if (depth == 1) {
- draw = XftDrawCreateBitmap(display, drawable);
- } else {
- draw = XftDrawCreate(display, drawable, ftPtr->visual,
- ftPtr->colormap);
- }
- if (ftPtr->draw != 0) {
- XftDrawDestroy(ftPtr->draw);
- }
- ftPtr->drawDepth = depth;
- ftPtr->draw = draw;
- ftPtr->drawable = drawable;
- } else {
- Tk_ErrorHandler handler;
-#if 0
- printf("Switch to drawable 0x%x\n", drawable);
-#endif
- handler = Tk_CreateErrorHandler(display, -1, -1, -1,
- (Tk_ErrorProc *)NULL, (ClientData) NULL);
- XftDrawChange(ftPtr->draw, drawable);
- ftPtr->drawable = drawable;
- Tk_DeleteErrorHandler(handler);
- }
- {
- XGCValues values;
-
- XGetGCValues(display, gc, GCForeground, &values);
- if (values.foreground != ftPtr->color.pixel) {
- XColor xc;
-
- xc.pixel = values.foreground;
- XQueryColor(display, ftPtr->colormap, &xc);
- ftPtr->color.color.red = xc.red;
- ftPtr->color.color.green = xc.green;
- ftPtr->color.color.blue = xc.blue;
- ftPtr->color.color.alpha = 0xffff; /* Assume opaque. */
- ftPtr->color.pixel = values.foreground;
- }
- }
-
- {
-#define NUM_SPEC 1024
- XftGlyphFontSpec *specPtr;
- XftGlyphFontSpec specs[NUM_SPEC+1];
- int nSpecs;
- const int maxCoord = 0x7FFF; /* Xft coordinates are 16 bit values */
-
- nSpecs = 0;
- specPtr = specs;
- while ((nBytes > 0) && (x <= maxCoord) && (y <= maxCoord)) {
- XftChar32 c;
- int charLen;
- XGlyphInfo metrics;
-
- charLen = XftUtf8ToUcs4((XftChar8 *)source, &c, nBytes);
- if (charLen <= 0) {
- /* This should not happen, but it can. */
- return;
- }
- source += charLen;
- nBytes -= charLen;
-
- specPtr = specs + nSpecs;
- specPtr->font = xftPtr;
- specPtr->glyph = XftCharIndex(display, xftPtr, c);
- specPtr->x = x;
- specPtr->y = y;
- XftGlyphExtents(display, xftPtr, &specPtr->glyph, 1, &metrics);
- x += metrics.xOff;
- y += metrics.yOff;
- nSpecs++, specPtr++;
- if (nSpecs == NUM_SPEC) {
- XftDrawGlyphFontSpec(ftPtr->draw, &ftPtr->color, specs, nSpecs);
- nSpecs = 0;
- specPtr = specs;
- }
- }
- if (nSpecs > 0) {
- XftDrawGlyphFontSpec(ftPtr->draw, &ftPtr->color, specs, nSpecs);
- }
- }
-}
-
-static void
-FtFreeFontProc(_Blt_Font *fontPtr)
-{
- FtFont *ftPtr = fontPtr->clientData;
-
- ftPtr->refCount--;
- if (ftPtr->refCount <= 0) {
- FtDeleteFont(ftPtr);
- }
- Blt_Free(fontPtr);
-}
-
-#endif /* HAVE_LIBXFT */
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetFontFromObj --
- *
- * Given a string description of a font, map the description to a
- * corresponding Tk_Font that represents the font.
- *
- * Results:
- * The return value is token for the font, or NULL if an error prevented
- * the font from being created. If NULL is returned, an error message
- * will be left in the interp's result.
- *
- * Side effects:
- * The font is added to an internal database with a reference count. For
- * each call to this procedure, there should eventually be a call to
- * Tk_FreeFont() or Tk_FreeFontFromObj() so that the database is cleaned
- * up when fonts aren't in use anymore.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Font
-Blt_GetFontFromObj(
- Tcl_Interp *interp, /* Interp for database and error
- * return. */
- Tk_Window tkwin, /* For display on which font will be
- * used. */
- Tcl_Obj *objPtr) /* String describing font, as: named
- * font, native format, or parseable
- * string. */
-{
- _Blt_Font *fontPtr;
-
- fontPtr = Blt_Calloc(1, sizeof(_Blt_Font));
- if (fontPtr == NULL) {
- return NULL; /* Out of memory. */
- }
- if (!alias_initialized) {
- MakeAliasTable(tkwin);
- alias_initialized++;
- }
-#ifdef HAVE_LIBXFT
- if (IsXRenderAvailable(tkwin)) {
- FtFont *ftPtr;
-
- /* Check first if we open the specified font as an XFT font. */
- ftPtr = FtGetFontFromObj(interp, tkwin, objPtr);
- if (ftPtr != NULL) {
- fontPtr->classPtr = &ftFontClass;
- fontPtr->clientData = ftPtr;
- fontPtr->interp = interp;
- fontPtr->display = Tk_Display(tkwin);
-#if DEBUG_FONT_SELECTION2
- fprintf(stderr, "SUCCESS: Found XFT font \"%s\"\n",
- Tcl_GetString(objPtr));
-#endif
- return fontPtr; /* Found Xft font. */
- }
- /* Otherwise fall thru and try to open font as a normal Tk font. */
- }
-#endif /* HAVE_LIBXFT */
- fontPtr->clientData = TkGetFontFromObj(interp, tkwin, objPtr);
- if (fontPtr->clientData == NULL) {
- Blt_Free(fontPtr);
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "FAILED to find either Xft or Tk font \"%s\"\n", Tcl_GetString(objPtr));
-#endif
- return NULL; /* Failed to find either Xft or Tk
- * fonts. */
- }
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "SUCCESS: Found Tk font \"%s\"\n", Tcl_GetString(objPtr));
-#endif
- fontPtr->classPtr = &tkFontClass;
- fontPtr->interp = interp;
- fontPtr->display = Tk_Display(tkwin);
- return fontPtr; /* Found Tk font. */
-}
-
-
-Blt_Font
-Blt_AllocFontFromObj(
- Tcl_Interp *interp, /* Interp for database and error return. */
- Tk_Window tkwin, /* For screen on which font will be used. */
- Tcl_Obj *objPtr) /* Object describing font, as: named font,
- * native format, or parseable string. */
-{
- return Blt_GetFontFromObj(interp, tkwin, objPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetFont --
- *
- * Given a string description of a font, map the description to a
- * corresponding Tk_Font that represents the font.
- *
- * Results:
- * The return value is token for the font, or NULL if an error prevented
- * the font from being created. If NULL is returned, an error message
- * will be left in interp's result object.
- *
- * Side effects:
- * The font is added to an internal database with a reference count. For
- * each call to this procedure, there should eventually be a call to
- * Blt_FreeFont so that the database is cleaned up when fonts aren't in
- * use anymore.
- *
- *---------------------------------------------------------------------------
- */
-
-Blt_Font
-Blt_GetFont(
- Tcl_Interp *interp, /* Interp for database and error return. */
- Tk_Window tkwin, /* For screen on which font will be used. */
- const char *string) /* Object describing font, as: named font,
- * native format, or parseable string. */
-{
- Blt_Font font;
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(string, strlen(string));
- Tcl_IncrRefCount(objPtr);
- font = Blt_GetFontFromObj(interp, tkwin, objPtr);
- Tcl_DecrRefCount(objPtr);
- return font;
-}
-
-Tcl_Interp *
-Blt_GetFontInterp(_Blt_Font *fontPtr)
-{
- return fontPtr->interp;
-}
-
-int
-Blt_TextWidth(_Blt_Font *fontPtr, const char *string, int length)
-{
- if (Blt_Ps_IsPrinting()) {
- int width;
-
- width = Blt_Ps_TextWidth(fontPtr, string, length);
- if (width >= 0) {
- return width;
- }
- }
- return (*fontPtr->classPtr->textWidth)(fontPtr, string, length);
-}
-
-void
-Blt_GetFontMetrics(_Blt_Font *fontPtr, Blt_FontMetrics *fmPtr)
-{
- if (Blt_Ps_IsPrinting()) {
- if (Blt_Ps_GetFontMetrics(fontPtr, fmPtr) == TCL_OK) {
- return;
- }
- }
- return (*fontPtr->classPtr->getFontMetrics)(fontPtr, fmPtr);
-}
-
-#ifdef notdef
-
-static Blt_FontClass psFontClass = {
- FONT_PS,
- PsNameOfFontProc, /* Blt_NameOfFontProc */
- PsFamilyOfFontProc, /* Blt_FamilyOfFontProc */
- NULL, /* Blt_FontIdProc */
- PsGetFontMetricsProc, /* Blt_GetFontMetricsProc */
- PsMeasureCharsProc, /* Blt_MeasureCharsProc */
- PsTextWidthProc, /* Blt_TextWidthProc */
- NULL, /* Blt_CanRotateFontProc */
- NULL, /* Blt_DrawCharsProc */
- PsPostscriptFontNameProc, /* Blt_PostscriptFontNameProc */
- PsFreeFontProc, /* Blt_FreeFontProc */
- NULL, /* Blt_UnderlineCharsProc */
-};
-
-#endif
-
diff --git a/blt3.0.1/src/bltUnixMain.c b/blt3.0.1/src/bltUnixMain.c
deleted file mode 100644
index 155977c..0000000
--- a/blt3.0.1/src/bltUnixMain.c
+++ /dev/null
@@ -1,327 +0,0 @@
-
-/*
- * bltUnixMain.c --
- *
- * Provides a default version of the Tcl_AppInit procedure for
- * use in wish and similar Tk-based applications.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This file was adapted from the Tk distribution.
- *
- * Copyright (c) 1993 The Regents of the University of
- * California. All rights reserved.
- *
- * Permission is hereby granted, without written agreement and
- * without license or royalty fees, to use, copy, modify, and
- * distribute this software and its documentation for any
- * purpose, provided that the above copyright notice and the
- * following two paragraphs appear in all copies of this
- * software.
- *
- * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO
- * ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
- * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS
- * SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
- * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
- * BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO *
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
- * MODIFICATIONS.
- *
- */
-
-#include <blt.h>
-#include <tcl.h>
-#ifndef TCL_ONLY
-#include <tk.h>
-#endif
-#include "config.h"
-/*
- * The following variable is a special hack that is needed in order for
- * Sun shared libraries to be used for Tcl.
- */
-
-#ifdef NEED_MATHERR
-BLT_EXTERN int matherr();
-int *tclDummyMathPtr = (int *)matherr;
-#endif
-
-
-BLT_EXTERN Tcl_AppInitProc Blt_core_Init;
-BLT_EXTERN Tcl_AppInitProc Blt_core_SafeInit;
-
-#ifndef TCL_ONLY
-BLT_EXTERN Tcl_AppInitProc Blt_x_Init;
-BLT_EXTERN Tcl_AppInitProc Blt_x_SafeInit;
-#endif
-
-#ifdef STATIC_PKGS
-
-/* Picture format packages. */
-#ifndef TCL_ONLY
-BLT_EXTERN Tcl_AppInitProc Blt_PictureBmpInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PictureGifInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PictureJpgInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PicturePbmInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PicturePhotoInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PicturePdfInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PicturePngInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PicturePsInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PictureTifInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PictureXbmInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PictureXpmInit;
-#endif /* TCL_ONLY */
-
-/* Data table format packages. */
-BLT_EXTERN Tcl_AppInitProc Blt_Table_CsvInit;
-#ifdef HAVE_LIBMYSQL
-BLT_EXTERN Tcl_AppInitProc Blt_Table_MysqlInit;
-#endif /* HAVE_LIBMYSQL */
-BLT_EXTERN Tcl_AppInitProc Blt_Table_TreeInit;
-BLT_EXTERN Tcl_AppInitProc Blt_Table_VectorInit;
-#ifdef HAVE_LIBEXPAT
-BLT_EXTERN Tcl_AppInitProc Blt_Table_XmlInit;
-#endif
-
-/* Tree format packages. */
-#ifdef HAVE_LIBEXPAT
-BLT_EXTERN Tcl_AppInitProc Blt_TreeXmlInit;
-#endif
-
-#endif /* STATIC_PKGS */
-
-static int
-Initialize(Tcl_Interp *interp) /* Interpreter for application. */
-{
-#ifdef TCLLIBPATH
- /*
- * It seems that some distributions of TCL don't compile-in a
- * default location of the library. This causes Tcl_Init to fail
- * if bltwish and bltsh are moved to another directory. The
- * workaround is to set the magic variable "tclDefaultLibrary".
- */
- Tcl_SetVar(interp, "tclDefaultLibrary", TCLLIBPATH, TCL_GLOBAL_ONLY);
-#endif /* TCLLIBPATH */
- if (Tcl_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- /*
- * 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.
- */
- if (Blt_core_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_core", Blt_core_Init, Blt_core_SafeInit);
-
-#ifdef STATIC_PKGS
- /* Tcl-only static packages */
- if (Blt_Table_CsvInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
-
- /* Data table packages. */
- Tcl_StaticPackage(interp, "blt_datatable_csv", Blt_Table_CsvInit,
- Blt_Table_CsvInit);
-
-#ifdef HAVE_LIBMYSQL
- if (Blt_Table_MysqlInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_datatable_mysql", Blt_Table_MysqlInit,
- Blt_Table_MysqlInit);
-#endif /* HAVE_LIBMYSQL */
-
- if (Blt_Table_TreeInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_datatable_tree", Blt_Table_TreeInit,
- Blt_Table_TreeInit);
-
- if (Blt_Table_VectorInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_datatable_vector", Blt_Table_VectorInit,
- Blt_Table_VectorInit);
-
-#ifdef HAVE_LIBEXPAT
- if (Blt_Table_XmlInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_datatable_xml", Blt_Table_XmlInit,
- Blt_Table_XmlInit);
-#endif /* HAVE_LIBEXPAT */
-
- /* Tree packages. */
-#ifdef HAVE_LIBEXPAT
- if (Blt_TreeXmlInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_tree_xml", Blt_TreeXmlInit, Blt_TreeXmlInit);
-#endif /* HAVE_LIBEXPAT */
-
-#endif /* STATIC_PKGS */
-
-#ifndef TCL_ONLY
- if (Tk_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (Blt_x_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_extra", Blt_x_Init, Blt_x_SafeInit);
-
-#ifdef STATIC_PKGS
-
- /* Picture packages. */
-
- if (Blt_PictureBmpInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_bmp", Blt_PictureBmpInit,
- Blt_PictureBmpInit);
-
- if (Blt_PictureGifInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_gif", Blt_PictureGifInit,
- Blt_PictureGifInit);
-
-#ifdef HAVE_LIBJPG
- if (Blt_PictureJpgInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_jpg", Blt_PictureJpgInit,
- Blt_PictureJpgInit);
-#endif /*HAVE_LIBJPG*/
-
- if (Blt_PicturePbmInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_pbm", Blt_PicturePbmInit,
- Blt_PicturePbmInit);
-
- if (Blt_PicturePhotoInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_photo", Blt_PicturePhotoInit,
- Blt_PicturePhotoInit);
-
-#ifdef HAVE_LIBPNG
- if (Blt_PicturePngInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_png", Blt_PicturePngInit,
- Blt_PicturePngInit);
-#endif /*HAVE_LIBPNG*/
-
- if (Blt_PicturePsInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_ps", Blt_PicturePsInit,
- Blt_PicturePsInit);
-
- if (Blt_PicturePdfInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_pdf", Blt_PicturePdfInit,
- Blt_PicturePdfInit);
-
-#ifdef HAVE_LIBTIF
- if (Blt_PictureTifInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_tif", Blt_PictureTifInit,
- Blt_PictureTifInit);
-#endif /*HAVE_LIBTIF*/
-
- if (Blt_PictureXbmInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_xbm", Blt_PictureXbmInit,
- Blt_PictureXbmInit);
-
-#ifdef HAVE_LIBXPM
- if (Blt_PictureXpmInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_xpm", Blt_PictureXpmInit,
- Blt_PictureXpmInit);
-#endif /*HAVE_LIBXPM*/
-
-#endif /* STATIC_PKGS */
-#endif /*TCL_ONLY*/
- /*
- * 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.
- */
-#ifdef TCL_ONLY
- Tcl_SetVar(interp, "tcl_rcFileName", "~/tclshrc.tcl", TCL_GLOBAL_ONLY);
-#else
- Tcl_SetVar(interp, "tcl_rcFileName", "~/wishrc.tcl", TCL_GLOBAL_ONLY);
-#endif
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * main --
- *
- * This is the main program for the application.
- *
- * Results:
- * None: Tk_Main never returns here, so this procedure never
- * returns either.
- *
- * Side effects:
- * Whatever the application does.
- *
- *---------------------------------------------------------------------------
- */
-int
-main(int argc, char **argv)
-{
-#ifdef TCL_ONLY
- Tcl_Main(argc, argv, Initialize);
-#else
- Tk_Main(argc, argv, Initialize);
-#endif
- return 0; /* Needed only to prevent compiler warning. */
-}
-
diff --git a/blt3.0.1/src/bltUnixPainter.c b/blt3.0.1/src/bltUnixPainter.c
deleted file mode 100644
index 8012a36..0000000
--- a/blt3.0.1/src/bltUnixPainter.c
+++ /dev/null
@@ -1,2005 +0,0 @@
-
-/*
- * bltUnixPainter.c --
- *
- * This module implements X11-specific image processing procedures for the BLT
- * toolkit.
- *
- * Copyright (c) 1998 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The color allocation routines are adapted from tkImgPhoto.c of the Tk library
- * distrubution. The photo image type was designed and implemented by Paul
- * Mackerras.
- *
- * Copyright (c) 1987-1993 The Regents of the University of California.
- *
- * Copyright (c) 19941998 Sun Microsystems, Inc.
- *
- */
-
-
-#include "bltInt.h"
-#include "bltHash.h"
-#include "bltPicture.h"
-#include "bltUnixPainter.h"
-#include "bltPainter.h"
-#include <X11/Xutil.h>
-#if !defined(WIN32) && !defined(MAC_OSX_TCL)
-#include <X11/Xproto.h>
-#endif
-
-typedef struct _Blt_Picture Pict;
-
-#define CFRAC(i, n) ((i) * 65535 / (n))
-/* As for CFRAC, but apply exponent of g. */
-#define CGFRAC(i, n, g) ((int)(65535 * pow((double)(i) / (n), (g))))
-
-#define MAXIMAGESIZE(dpy) (XMaxRequestSize(dpy) << 2) - 24
-
-#define CLAMP(c) ((((c) < 0.0) ? 0.0 : ((c) > 255.0) ? 255.0 : (c)))
-
-
-static Blt_HashTable painterTable;
-static int initialized = 0;
-
-#define COLOR_WINDOW (1<<0)
-#define BLACK_AND_WHITE (1<<1)
-#define MAP_COLORS (1<<2)
-
-/*
- * PainterKey --
- *
- * This structure represents the key used to uniquely identify painters. A
- * painter is specified by a combination of display, visual, colormap, depth,
- * and monitor gamma value.
- */
-typedef struct {
- Display *display; /* Display of painter. Used to free
- * colors allocated. */
- Visual *visualPtr; /* Visual information for the class of
- * windows displaying the image. */
- Colormap colormap; /* Colormap used. This may be the
- * default colormap, or an allocated
- * private map. */
- int depth; /* Pixel depth of the display. */
- float gamma; /* Gamma correction value for the
- * monitor. */
-} PainterKey;
-
-
-#define GC_PRIVATE 1 /* Indicates if the GC in the painter
- * was shared (allocated by Tk_GetGC) or
- * private (by XCreateGC). */
-
-static Tcl_FreeProc FreePainter;
-
-/*
- *---------------------------------------------------------------------------
- *
- * FindShift --
- *
- * Returns the position of the least significant (low) bit in the given
- * mask.
- *
- * For TrueColor and DirectColor visuals, a pixel value is formed by
- * OR-ing the red, green, and blue colormap indices into a single 32-bit
- * word. The visual's color masks tell you where in the word the indices
- * are supposed to be. The masks contain bits only where the index is
- * found. By counting the leading zeros in the mask, we know how many
- * bits to shift to the individual red, green, and blue values to form a
- * pixel.
- *
- * Results:
- * The number of the least significant bit.
- *
- *---------------------------------------------------------------------------
- */
-static int
-FindShift(unsigned int mask) /* 32-bit word */
-{
- int bit;
-
- for (bit = 0; bit < 32; bit++) {
- if (mask & (1 << bit)) {
- break;
- }
- }
- return bit;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CountBits --
- *
- * Returns the number of bits set in the given 32-bit mask.
- *
- * Reference: Graphics Gems Volume II.
- *
- * Results:
- * The number of bits to set in the mask.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CountBits(unsigned long mask) /* 32 1-bit tallies */
-{
- /* 16 2-bit tallies */
- mask = (mask & 0x55555555) + ((mask >> 1) & (0x55555555));
- /* 8 4-bit tallies */
- mask = (mask & 0x33333333) + ((mask >> 2) & (0x33333333));
- /* 4 8-bit tallies */
- mask = (mask & 0x07070707) + ((mask >> 4) & (0x07070707));
- /* 2 16-bit tallies */
- mask = (mask & 0x000F000F) + ((mask >> 8) & (0x000F000F));
- /* 1 32-bit tally */
- mask = (mask & 0x0000001F) + ((mask >> 16) & (0x0000001F));
- return mask;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeGammaTables --
- *
- * Initializes both the power and inverse power tables for the painter with
- * a given gamma value. These tables are used to/from map linear RGB
- * values to/from non-linear monitor intensities.
- *
- * Results:
- * The *gammaTable* and *igammaTable* arrays are filled out to
- * contain the mapped values.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComputeGammaTables(Painter *p)
-{
- int i;
- double igamma, gamma;
-
- gamma = (double)p->gamma;
- igamma = 1.0 / gamma;
- for (i = 0; i < 256; i++) {
- double value, y;
-
- y = i / 255.0;
- value = pow(y, gamma) * 255.0 + 0.5;
- p->gammaTable[i] = (unsigned char)CLAMP(value);
- value = pow(y, igamma) * 255.0 + 0.5;
- p->igammaTable[i] = (unsigned char)CLAMP(value);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * QueryPalette --
- *
- * Queries the X display server for the colors currently used in the
- * colormap. These values will then be used to map screen pixels back to
- * RGB values (see Blt_DrawableToPicture). The queried non-linear color
- * intensities are reverse mapped back to to linear RGB values.
- *
- * Results:
- * The *palette* array is filled in with the RGB color values of the
- * colors allocated.
- *
- *---------------------------------------------------------------------------
- */
-static void
-QueryPalette(Painter *p, Blt_Pixel *palette)
-{
- Visual *visualPtr;
- XColor colors[256];
-
- visualPtr = p->visualPtr;
- assert(visualPtr->map_entries <= 256);
-
- if ((visualPtr->class == DirectColor) || (visualPtr->class == TrueColor)) {
- XColor *cp, *cend;
- int nRed, nGreen, nBlue;
- unsigned int r, g, b;
-
- r = g = b = 0;
- nRed = (p->rMask >> p->rShift) + 1;
- nGreen = (p->gMask >> p->gShift) + 1;
- nBlue = (p->bMask >> p->bShift) + 1;
-
- for (cp = colors, cend = cp + visualPtr->map_entries; cp < cend; cp++) {
- cp->pixel = ((r << p->rShift)|(g << p->gShift) | (b << p->bShift));
- cp->pad = 0;
- r++, b++, g++;
- if (r >= nRed) {
- r = 0;
- }
- if (g >= nGreen) {
- g = 0;
- }
- if (b >= nBlue) {
- b = 0;
- }
- }
- } else {
- XColor *cp;
- int i;
-
- for (cp = colors, i = 0; i < visualPtr->map_entries; i++, cp++) {
- cp->pixel = i;
- cp->pad = 0;
- }
- }
-
- XQueryColors(p->display, p->colormap, colors, visualPtr->map_entries);
-
- /* Scale to convert XColor component value (0..65535) to unsigned
- * char (0..255). */
- if (p->gamma == 1.0f) {
- Blt_Pixel *dp;
- XColor *cp;
- int i;
- double a;
-
- a = 1.0 / 257.0;
- cp = colors, dp = palette;
- for (i = 0; i < visualPtr->map_entries; i++) {
- dp->Red = (unsigned char)(cp->red * a + 0.5);
- dp->Green = (unsigned char)(cp->green * a + 0.5);
- dp->Blue = (unsigned char)(cp->blue * a + 0.5);
- cp++, dp++;
- }
- } else {
- Blt_Pixel *dp;
- XColor *cp;
- int i;
- double a;
-
- a = 1.0 / 257.0;
- cp = colors, dp = palette;
- for (i = 0; i < visualPtr->map_entries; i++) {
- dp->Red = p->gammaTable[(int)(cp->red * a + 0.5)];
- dp->Green = p->gammaTable[(int)(cp->green * a + 0.5)];
- dp->Blue = p->gammaTable[(int)(cp->blue * a + 0.5)];
- cp++, dp++;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ColorRamp --
- *
- * Computes a smooth color ramp based upon the number of colors available
- * for each color component. It returns an array of the desired colors
- * (XColor structures). The screen gamma is factored into the desired
- * colors.
- *
- * Results:
- * Returns the number of colors desired. The *colors* array is filled
- * out to contain the component values.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ColorRamp(Painter *p, XColor *colors)
-{
- int nColors;
- XColor *cp;
- double rScale, gScale, bScale;
- double igamma;
- int i;
-
- nColors = 0; /* Suppress compiler warning. */
-
- /*
- * Calculate the RGB coordinates of the colors we want to allocate and
- * store them in *colors.
- */
- igamma = 1.0 / (double)p->gamma;
-
- rScale = 255.0 / (p->nRed - 1);
- gScale = 255.0 / (p->nGreen - 1);
- bScale = 255.0 / (p->nBlue - 1);
-
- switch (p->visualPtr->class) {
- case TrueColor:
- case DirectColor:
-
- nColors = MAX3(p->nRed, p->nGreen, p->nBlue);
- if (p->isMonochrome) {
- nColors = p->nBlue = p->nGreen = p->nRed;
- }
-
- /* Compute the 16-bit RGB values from each possible 8-bit value. */
- cp = colors;
- for (i = 0; i < nColors; i++) {
- int r, g, b;
-
- r = (int)(i * rScale + 0.5);
- g = (int)(i * gScale + 0.5);
- b = (int)(i * bScale + 0.5);
-
- r = p->igammaTable[r];
- g = p->igammaTable[g];
- b = p->igammaTable[b];
-
- cp->red = (r << 8) + r;
- cp->green = (g << 8) + g;
- cp->blue = (b << 8) + b;
- cp++;
- }
- break;
-
- case PseudoColor:
- case StaticColor:
- case GrayScale:
- case StaticGray:
-
- nColors = (p->nRed * p->nGreen * p->nBlue);
- if (p->isMonochrome) {
- nColors = p->nRed;
- }
- if (!p->isMonochrome) {
- XColor *cp;
- int i;
-
- cp = colors;
- for (i = 0; i < p->nRed; i++) {
- int j;
- unsigned char r;
-
- r = (unsigned char)(i * rScale + 0.5);
- r = p->igammaTable[r];
- for (j = 0; j < p->nGreen; j++) {
- int k;
- unsigned int g;
-
- g = (unsigned char)(j * gScale + 0.5);
- g = p->igammaTable[g];
- for (k = 0; k < p->nBlue; k++) {
- unsigned int b;
-
- b = (unsigned char)(k * bScale + 0.5);
- b = p->igammaTable[b];
- cp->red = (r << 8) | r;
- cp->green = (g << 8) | g;
- cp->blue = (b << 8) | b;
- cp++;
- }
- }
- }
- }
- break;
-
- default: /* Monochrome */
- {
- XColor *cp;
- double scale;
- int i;
-
- scale = 255.0 / (nColors - 1);
-
- cp = colors;
- for (i = 0; i < nColors; ++i) {
- int c;
-
- c = (int)(i * scale + 0.5);
- c = p->igammaTable[c];
- cp->red = cp->green = cp->blue = (c << 8) | c;
- cp++;
- }
- }
- } /* end switch */
- return nColors;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AllocateColors --
- *
- * Individually allocates each of the desired colors (as specified by the
- * *colors* array). If a color can't be allocated the desired colors
- * allocated to that point as released, the number of component
- * intensities is reduced, and 0 is returned.
- *
- * For TrueColor visuals, we don't need to allocate colors at all, since
- * we can compute them directly.
- *
- * Results:
- * Returns 1 if all desired colors were allocated successfully. If
- * unsuccessful, returns 0. All colors allocated up to that point are
- * freed and a smaller color palette size is computed and reset in the
- * painter structure.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AllocateColors(Painter *p, XColor *colors, int nColors)
-{
- if (p->visualPtr->class == TrueColor) {
- XColor *cp, *cend;
-
- /*
- * For TrueColor visuals, don't call XAllocColor, compute the pixel
- * value directly.
- */
- for (cp = colors, cend = cp + nColors; cp < cend; cp++) {
- unsigned int r, g, b;
-
- r = ((cp->red >> 8) >> p->rAdjust);
- g = ((cp->green >> 8) >> p->gAdjust);
- b = ((cp->blue >> 8) >> p->bAdjust);
-
- /* Shift each color into the proper location of the pixel index. */
- r = (r << p->rShift) & p->rMask;
- g = (g << p->gShift) & p->gMask;
- b = (b << p->bShift) & p->bMask;
- cp->pixel = (r | g | b);
- }
- p->nPixels = 0; /* This will indicate that we didn't use
- * XAllocColor to obtain pixel
- * values. */
- return TRUE;
- } else {
- int i;
- XColor *cp;
-
- cp = colors;
- for (i = 0; i < nColors; i++) {
- if (!XAllocColor(p->display, p->colormap, cp)){
-#ifdef notdef
- fprintf(stderr, "can't allocate color #%d: r=%x g=%x b=%x\n",
- i, cp->red, cp->green, cp->blue);
-#endif
- break;
- }
-#ifdef notdef
- fprintf(stderr, "picture: allocated r=%x g=%x b=%x\n",
- colors[i].red, colors[i].green, colors[i].blue);
-#endif
- p->pixels[i] = cp->pixel;
- cp++;
- }
- p->nPixels = i; /* # of pixels in array */
- if (i == nColors) {
- fprintf(stderr, "painter palette %d/%d/%d colors okay\n", p->nRed,
- p->nGreen, p->nBlue);
- return TRUE; /* Success. */
- }
- }
- /*
- * If we didn't get all of the colors, free the current palette, reduce
- * the palette RGB component sizes.
- */
-#ifdef notdef
- fprintf(stderr, "can't allocate %d/%d/%d colors\n", p->nRed, p->nGreen,
- p->nBlue);
-#endif
- XFreeColors(p->display, p->colormap, p->pixels, p->nPixels, 0);
-
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FillPalette --
- *
- * Base upon the colors allocated, generate two mappings from the
- * picture's 8-bit RGB components.
- *
- * 1) Map 8-bit RGB values to the bits of the pixel. Each component
- * contains a portion of the pixel value. For mapped visuals
- * (pseudocolor, staticcolor, grayscale, and staticgray) this pixel
- * value will be translated to the actual pixel used by the display.
- *
- * 2) Map 8-bit RGB values to the actual color values used. The
- * color ramp generated may be only a subset of the possible
- * color values. The resulting palette is used in dithering the
- * image, using the error between the desired picture RGB value
- * and the actual value used.
- *
- * Results:
- * Color palette and pixel maps are filled in.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FillPalette(Painter *p, XColor *colors, int nColors)
-{
- p->nColors = nColors;
- if (!p->isMonochrome) {
- p->flags |= COLOR_WINDOW;
-
- if ((p->visualPtr->class != DirectColor) &&
- (p->visualPtr->class != TrueColor)) {
- p->flags |= MAP_COLORS;
- }
- }
- if (p->isMonochrome) {
- int i;
-
- for (i = 0; i < 256; i++) {
- int c;
-
- c = (i + 127) / 255;
- p->rBits[i] = colors[c].pixel;
- p->palette[i].Blue = p->palette[i].Green = p->palette[i].Red =
- (unsigned char)(c * 255 + 0.5);
- }
- } else {
- int i, rMult;
- double rScale, gScale, bScale;
-
- rMult = p->nGreen * p->nBlue;
-
- rScale = 255.0 / (p->nRed - 1);
- gScale = 255.0 / (p->nGreen - 1);
- bScale = 255.0 / (p->nBlue - 1);
-
- for (i = 0; i < 256; i++) {
- int r, g, b;
-
- r = (i * (p->nRed - 1) + 127) / 255;
- g = (i * (p->nGreen - 1) + 127) / 255;
- b = (i * (p->nBlue - 1) + 127) / 255;
-
- if ((p->visualPtr->class == DirectColor) ||
- (p->visualPtr->class == TrueColor)) {
- p->rBits[i] = colors[r].pixel & p->rMask;
- p->gBits[i] = colors[g].pixel & p->gMask;
- p->bBits[i] = colors[b].pixel & p->bMask;
- } else {
- p->rBits[i] = r * rMult;
- p->gBits[i] = g * p->nBlue;
- p->bBits[i] = b;
- }
- p->palette[i].Red = (unsigned char)(r * rScale + 0.5);
- p->palette[i].Green = (unsigned char)(g * gScale + 0.5);
- p->palette[i].Blue = (unsigned char)(b * bScale + 0.5);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * AllocatePalette --
- *
- * This procedure allocates the colors required by a color table, and
- * sets up the fields in the color table data structure which are used in
- * dithering.
- *
- * This routine essentially mimics what is done in tkImgPhoto.c. It's
- * purpose is to allocate exactly the same color ramp as the photo
- * image. That way both image types can co-exist without fighting over
- * available colors.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Colors are allocated from the X server. The color palette and pixel
- * indices are updated.
- *
- *---------------------------------------------------------------------------
- */
-static void
-AllocatePalette(Painter *p) /* Pointer to the color table requiring
- * colors to be allocated. */
-{
- XColor colors[256];
- int nColors;
- static int stdPalettes[13][3] = {
- /* nRed, nGreen, nBlue */
- { 2, 2, 2 }, /* 3 bits, 8 colors */
- { 2, 3, 2 }, /* 4 bits, 12 colors */
- { 3, 4, 2 }, /* 5 bits, 24 colors */
- { 4, 5, 3 }, /* 6 bits, 60 colors */
- { 5, 6, 4 }, /* 7 bits, 120 colors */
- { 7, 7, 4 }, /* 8 bits, 198 colors */
- { 8, 10, 6 }, /* 9 bits, 480 colors */
- { 10, 12, 8 }, /* 10 bits, 960 colors */
- { 14, 15, 9 }, /* 11 bits, 1890 colors */
- { 16, 20, 12 }, /* 12 bits, 3840 colors */
- { 20, 24, 16 }, /* 13 bits, 7680 colors */
- { 26, 30, 20 }, /* 14 bits, 15600 colors */
- { 32, 32, 30 }, /* 15 bits, 30720 colors */
- };
-
- p->isMonochrome = FALSE;
- switch (p->visualPtr->class) {
- case TrueColor:
- case DirectColor:
- p->nRed = 1 << CountBits(p->rMask);
- p->nGreen = 1 << CountBits(p->gMask);
- p->nBlue = 1 << CountBits(p->bMask);
- break;
-
- case GrayScale:
- case StaticGray:
- case PseudoColor:
- case StaticColor:
- if (p->depth > 15) {
- p->nRed = p->nGreen = p->nBlue = 32;
- } else if (p->depth >= 3) {
- int *ip = stdPalettes[p->depth - 3];
- p->nRed = ip[0];
- p->nGreen = ip[1];
- p->nBlue = ip[2];
- }
- break;
-
- default:
- p->nGreen = p->nBlue = 0;
- p->nRed = 1 << p->depth;
- p->isMonochrome = TRUE;
- break;
- }
-
- /*
- * Each time around this loop, we reduce the number of colors we're trying
- * to allocate until we succeed in allocating all of the colors we need.
- */
- for (;;) {
- /*
- * If we are using 1 bit/pixel, we don't need to allocate any colors (we
- * just use the foreground and background colors in the GC).
- */
- if ((p->isMonochrome) && (p->nRed <= 2)) {
- p->flags |= BLACK_AND_WHITE;
- /* return; */
- }
- /*
- * Calculate the RGB values of a color ramp, given the some number of
- * red, green, blue intensities available.
- */
- nColors = ColorRamp(p, colors);
-
- /* Now try to allocate the colors we've calculated. */
-
- if (AllocateColors(p, colors, nColors)) {
- break; /* Success. */
- }
- if (!p->isMonochrome) {
- if ((p->nRed == 2) && (p->nGreen == 2) && (p->nBlue == 2)) {
- break;
- /* Fall back to 1-bit monochrome display. */
- /* p->mono = TRUE; */
- } else {
- /*
- * Reduce the number of shades of each primary to about 3/4 of
- * the previous value. This will reduce the total number of
- * colors required to less than half (27/64) the previous value
- * for PseudoColor displays.
- */
- p->nRed = (p->nRed * 3 + 2) / 4;
- p->nGreen = (p->nGreen * 3 + 2) / 4;
- p->nBlue = (p->nBlue * 3 + 2) / 4;
- }
- } else {
- p->nRed /= 2;
- }
- }
- FillPalette(p, colors, nColors);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewPainter --
- *
- * Creates a new painter to be used to paint pictures. Painters are keyed
- * by the combination of display, colormap, visual, depth, and gamma value
- * used.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- * Side Effects:
- * A color ramp is allocated (not true for TrueColor visuals). Gamma
- * tables are computed and filled.
- *
- *---------------------------------------------------------------------------
- */
-static Painter *
-NewPainter(PainterKey *keyPtr)
-{
- Painter *p;
-
- p = Blt_AssertCalloc(1, sizeof(Painter));
- p->colormap = keyPtr->colormap;
- p->depth = keyPtr->depth;
- p->display = keyPtr->display;
- p->gamma = keyPtr->gamma;
- p->visualPtr = keyPtr->visualPtr;
-
- p->refCount = 0;
- p->rMask = (unsigned int)p->visualPtr->red_mask;
- p->gMask = (unsigned int)p->visualPtr->green_mask;
- p->bMask = (unsigned int)p->visualPtr->blue_mask;
-
- p->rShift = FindShift(p->rMask);
- p->gShift = FindShift(p->gMask);
- p->bShift = FindShift(p->bMask);
-
- p->rAdjust = p->gAdjust = p->bAdjust = 0;
-
- {
- int nRedBits, nGreenBits, nBlueBits;
-
- nRedBits = CountBits(p->rMask);
- nGreenBits = CountBits(p->gMask);
- nBlueBits = CountBits(p->bMask);
- if (nRedBits < 8) {
- p->rAdjust = 8 - nRedBits;
- }
- if (nGreenBits < 8) {
- p->gAdjust = 8 - nGreenBits;
- }
- if (nBlueBits < 8) {
- p->bAdjust = 8 - nBlueBits;
- }
- }
- ComputeGammaTables(p);
- AllocatePalette(p);
- return p;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreePainter --
- *
- * Called when the TCL interpreter is idle, this routine frees the
- * painter. Painters are reference counted. Only when no clients are using
- * the painter (the count is zero) is the painter actually freed. By
- * deferring its deletion, this allows client code to call Blt_GetPainter
- * after Blt_FreePainter without incurring a performance penalty.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreePainter(DestroyData data)
-{
- Painter *p = (Painter *)data;
-
- if (p->refCount <= 0) {
- if (p->nColors > 0) {
- XFreeColors(p->display, p->colormap,
- p->pixels, p->nPixels, 0);
- }
- Blt_DeleteHashEntry(&painterTable, p->hashPtr);
- if (p->gc != NULL) {
- if (p->flags & GC_PRIVATE) {
- XFreeGC(p->display, p->gc);
- } else {
- Tk_FreeGC(p->display, p->gc);
- }
- p->gc = NULL;
- }
- Blt_Free(p);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetPainter --
- *
- * Attempts to retrieve a painter for a particular combination of display,
- * colormap, visual, depth, and gamma value. If no specific painter
- * exists, then one is created.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- * Side Effects:
- * If no current painter exists, a new painter is added to the hash table
- * of painters. Otherwise, the current painter's reference count is
- * incremented indicated how many clients are using the painter.
- *
- *---------------------------------------------------------------------------
- */
-static Painter *
-GetPainter(
- Display *display,
- Colormap colormap,
- Visual *visualPtr,
- int depth,
- float gamma)
-{
- Painter *p;
- PainterKey key;
- int isNew;
- Blt_HashEntry *hPtr;
-
- if (!initialized) {
- Blt_InitHashTable(&painterTable, sizeof(PainterKey) / sizeof(int));
- initialized = TRUE;
- }
- key.display = display;
- key.colormap = colormap;
- key.visualPtr = visualPtr;
- key.depth = depth;
- key.gamma = gamma;
-
- hPtr = Blt_CreateHashEntry(&painterTable, (char *)&key, &isNew);
- if (isNew) {
- p = NewPainter(&key);
- p->hashPtr = hPtr;
- Blt_SetHashValue(hPtr, p);
- } else {
- p = Blt_GetHashValue(hPtr);
- }
- p->refCount++;
- return p;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaintXImage --
- *
- * Draw the given XImage. If the size of the image exceeds the maximum
- * request size of the X11 protocol, the image is drawn using XPutImage in
- * multiples of rows that fit within the limit.
- *
- *---------------------------------------------------------------------------
- */
-static void
-PaintXImage(Painter *p, Drawable drawable, XImage *imgPtr, int sx, int sy,
- int w, int h, int dx, int dy)
-{
- int y;
- int n;
- long maxPixels;
-
- maxPixels = Blt_MaxRequestSize(p->display, sizeof(Blt_Pixel));
- n = (maxPixels + w - 1) / w;
- if (n < 1) {
- n = 1;
- }
- if (n > h ) {
- n = h;
- }
- for (y = 0; y < h; y += n) {
- if ((y + n) > h) {
- n = h - y;
- }
- XPutImage(p->display, drawable, p->gc, imgPtr, sx, sy+y,
- dx, dy+y, w, n);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XGetImageErrorProc --
- *
- * Error handling routine for the XGetImage request below. Sets the flag
- * passed via *clientData* to TCL_ERROR indicating an error occurred.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-XGetImageErrorProc(
- ClientData clientData,
- XErrorEvent *errEventPtr) /* Not used. */
-{
- int *errorPtr = clientData;
-
- *errorPtr = TCL_ERROR;
- return 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawableToXImage --
- *
- * Attempts to snap the image from the drawable into an XImage structure
- * (using XGetImage). This may fail is the coordinates of the region in
- * the drawable are obscured.
- *
- * Results:
- * Returns a pointer to the XImage if successful. Otherwise NULL is
- * returned.
- *
- *---------------------------------------------------------------------------
- */
-static XImage *
-DrawableToXImage(
- Display *display,
- Drawable drawable,
- int x, int y, int w, int h)
-{
- XImage *imgPtr;
- Tk_ErrorHandler errHandler;
- int result;
-
- result = TCL_OK;
-#if !defined(WIN32) && !defined(MAC_OSX_TCL)
- errHandler = Tk_CreateErrorHandler(display, BadMatch, X_GetImage, -1,
- XGetImageErrorProc, &result);
-#endif
- imgPtr = XGetImage(display, drawable, x, y, w, h, AllPlanes, ZPixmap);
-#if !defined(WIN32) && !defined(MAC_OSX_TCL)
- Tk_DeleteErrorHandler(errHandler);
-#endif
- XSync(display, False);
- if (result != TCL_OK) {
-#ifdef notdef
- fprintf(stderr, "can't snap picture of drawable\n");
-#endif
- return NULL;
- }
- return imgPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawableToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and converts it
- * to a picture.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred (a portion of
- * the region specified is obscured), then NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Picture
-DrawableToPicture(
- Painter *p,
- Drawable drawable,
- int x, int y, /* Coordinates of region in source
- * drawable. */
- int w, int h) /* Dimension of the region in the source
- * drawable. Region must be completely
- * contained by the drawable. */
-{
- Pict *destPtr;
- Blt_Pixel *destRowPtr;
- Blt_Pixel palette[256];
- XImage *imgPtr;
- int shift[4];
- unsigned char *srcRowPtr;
-
- imgPtr = DrawableToXImage(p->display, drawable, x, y, w, h);
- if (imgPtr == NULL) {
- int dw, dh;
-
- /*
- * Failed to acquire an XImage from the drawable. The drawable may be
- * partially obscured or too small for the requested area. Try it
- * again, after fixing the area with the dimensions of the drawable.
- */
- if (Blt_GetWindowRegion(p->display, drawable, (int *)NULL, (int *)NULL,
- &dw, &dh) == TCL_OK) {
- if ((x + w) > dw) {
- w = dw - x;
- }
- if ((y + h) > dh) {
- h = dh - y;
- }
- imgPtr = DrawableToXImage(p->display, drawable, x, y, w, h);
- }
- }
- if (imgPtr == NULL) {
- return NULL;
- }
-
- /* Allocate a picture to hold the screen snapshot. */
- destPtr = Blt_CreatePicture(w, h);
-
- /* Get the palette of the current painter/window */
- QueryPalette(p, palette);
-
- /* Suppress compiler warnings. */
- shift[0] = shift[1] = shift[2] = shift[3] = 0;
-
- switch (p->visualPtr->class) {
- case TrueColor:
- case DirectColor:
- if (imgPtr->byte_order == MSBFirst) {
- shift[0] = 24, shift[1] = 16, shift[2] = 8, shift[3] = 0;
- } else {
- switch (imgPtr->bits_per_pixel) {
- case 32:
- shift[0] = 0, shift[1] = 8, shift[2] = 16, shift[3] = 24;
- break;
- case 24:
- shift[1] = 0, shift[2] = 8, shift[3] = 16;
- break;
- case 16:
- shift[2] = 0, shift[3] = 8;
- break;
- case 8:
- shift[3] = 0;
- break;
- }
- }
- srcRowPtr = (unsigned char *)imgPtr->data;
- destRowPtr = destPtr->bits;
- switch (imgPtr->bits_per_pixel) {
- case 32:
- for (y = 0; y < h; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- int r, g, b;
- unsigned long pixel;
-
- /* Get the next pixel from the image. */
- pixel = ((sp[0] << shift[0]) | (sp[1] << shift[1]) |
- (sp[2] << shift[2]) | (sp[3] << shift[3]));
-
- /* Convert the pixel to RGB, correcting for input gamma. */
- r = ((pixel & p->rMask) >> p->rShift);
- g = ((pixel & p->gMask) >> p->gShift);
- b = ((pixel & p->bMask) >> p->bShift);
- dp->Red = palette[r].Red;
- dp->Green = palette[g].Green;
- dp->Blue = palette[b].Blue;
- dp->Alpha = ALPHA_OPAQUE;
- sp += 4;
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += imgPtr->bytes_per_line;
- }
- break;
-
- case 24:
- for (y = 0; y < h; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- int r, g, b;
- unsigned long pixel;
-
- /* Get the next pixel from the image. */
- pixel = ((sp[0] << shift[1]) | (sp[1] << shift[2]) |
- (sp[2] << shift[3]));
-
- /* Convert the pixel to RGB, correcting for input gamma. */
- r = ((pixel & p->rMask) >> p->rShift);
- g = ((pixel & p->gMask) >> p->gShift);
- b = ((pixel & p->bMask) >> p->bShift);
- dp->Red = palette[r].Red;
- dp->Green = palette[g].Green;
- dp->Blue = palette[b].Blue;
- dp->Alpha = ALPHA_OPAQUE;
- sp += 3;
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += imgPtr->bytes_per_line;
- }
- break;
-
- case 16:
- for (y = 0; y < h; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- int r, g, b;
- unsigned long pixel;
-
- /* Get the next pixel from the image. */
- pixel = ((sp[0] << shift[2]) | (sp[1] << shift[3]));
-
- /* Convert the pixel to RGB, correcting for input gamma. */
- r = ((pixel & p->rMask) >> p->rShift);
- g = ((pixel & p->gMask) >> p->gShift);
- b = ((pixel & p->bMask) >> p->bShift);
- dp->Red = palette[r].Red;
- dp->Green = palette[g].Green;
- dp->Blue = palette[b].Blue;
- dp->Alpha = ALPHA_OPAQUE;
- sp += 2;
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += imgPtr->bytes_per_line;
- }
- break;
-
- case 8:
- for (y = 0; y < h; y++) {
- unsigned char *sp;
- Blt_Pixel *dp, *dend;
-
- sp = srcRowPtr;
- for (dp = destRowPtr, dend = dp + w; dp < dend; dp++) {
- int r, g, b;
- unsigned long pixel;
-
- /* Get the next pixel from the image. */
- pixel = (*sp << shift[3]);
-
- /* Convert the pixel to RGB, correcting for input gamma. */
- r = ((pixel & p->rMask) >> p->rShift);
- g = ((pixel & p->gMask) >> p->gShift);
- b = ((pixel & p->bMask) >> p->bShift);
- dp->Red = palette[r].Red;
- dp->Green = palette[g].Green;
- dp->Blue = palette[b].Blue;
- dp->Alpha = ALPHA_OPAQUE;
- sp++;
- }
- destRowPtr += destPtr->pixelsPerRow;
- srcRowPtr += imgPtr->bytes_per_line;
- }
- break;
- }
- break;
-
- case PseudoColor:
- case StaticColor:
- case GrayScale:
- case StaticGray:
- if ((imgPtr->bits_per_pixel != 8) && (imgPtr->bits_per_pixel != 4)) {
- return NULL; /* Can only handle 4 or 8 bit pixels. */
- }
- srcRowPtr = (unsigned char *)imgPtr->data;
- destRowPtr = destPtr->bits;
- for (y = 0; y < h; y++) {
- unsigned char *sp;
- Blt_Pixel *dp;
-
- sp = srcRowPtr, dp = destRowPtr;
- for (x = 0; x < w; x++) {
- unsigned long pixel;
-
- if (imgPtr->bits_per_pixel == 8) {
- pixel = *sp++;
- } else {
- if (x & 1) { /* Odd: pixel is high nybble. */
- pixel = (*sp & 0xF0) >> 4;
- sp++;
- } else { /* Even: pixel is low nybble. */
- pixel = (*sp & 0x0F);
- }
- }
- /* Convert the pixel to RGB, correcting for input gamma. */
- dp->Red = palette[pixel].Red;
- dp->Green = palette[pixel].Green;
- dp->Blue = palette[pixel].Blue;
- dp->Alpha = ALPHA_OPAQUE;
- dp++;
- }
- srcRowPtr += imgPtr->bytes_per_line;
- destRowPtr += destPtr->pixelsPerRow;
- }
- break;
- default:
- break;
- }
- XDestroyImage(imgPtr);
- return destPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaintPicture --
- *
- * Paints the picture to the given drawable. The region of the picture is
- * specified and the coordinates where in the destination drawable is the
- * image to be displayed.
- *
- * The image may be dithered depending upon the bit set in the flags
- * parameter: 0 no dithering, 1 for dithering.
- *
- * Results:
- * Returns TRUE is the picture was successfully displayed. Otherwise FALSE
- * is returned if the particular combination visual and image depth is not
- * handled.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PaintPicture(
- Painter *p,
- Drawable drawable,
- Pict *srcPtr,
- int sx, int sy, /* Coordinates of region in the
- * picture. */
- int w, int h, /* Dimension of the source region.
- * Area cannot extend beyond the end
- * of the picture. */
- int dx, int dy, /* Coordinates of destination region
- * in the drawable. */
- unsigned int flags)
-{
-#ifdef WORD_BIGENDIAN
- static int nativeByteOrder = MSBFirst;
-#else
- static int nativeByteOrder = LSBFirst;
-#endif
- int dw, dh;
- Pict *ditherPtr;
- Blt_Pixel *srcRowPtr;
- XImage *imgPtr;
- int y;
- unsigned char *destRowPtr;
-
-#ifdef notdef
- fprintf(stderr, "PaintPicture: x=%d,y=%d,w=%d,h=%d,dx=%d,dy=%d\n",
- sx, sy, w, h, dx, dy);
-#endif
- ditherPtr = NULL;
- if (flags & BLT_PAINTER_DITHER) {
- ditherPtr = Blt_DitherPicture(srcPtr, p->palette);
- if (ditherPtr != NULL) {
- srcPtr = ditherPtr;
- }
- }
- imgPtr = XCreateImage(p->display, p->visualPtr, p->depth, ZPixmap, 0,
- (char *)NULL, w, h, 32, 0);
- assert(imgPtr);
-
- /*
- * Set the byte order to the platform's native byte order. We'll let Xlib
- * handle byte swapping.
- */
- imgPtr->byte_order = nativeByteOrder;
- imgPtr->data = Blt_AssertMalloc(sizeof(Blt_Pixel) * w * h);
- srcRowPtr = srcPtr->bits + ((sy * srcPtr->pixelsPerRow) + sx);
- destRowPtr = (unsigned char *)imgPtr->data;
-
- dw = MIN(w, srcPtr->width);
- dh = MIN(h, srcPtr->height);
- switch (p->visualPtr->class) {
- case TrueColor:
-
- /* Directly compute the pixel 8, 16, 24, or 32 bit values from the RGB
- * components. */
-
- switch (imgPtr->bits_per_pixel) {
- case 32:
- for (y = 0; y < dh; y++) {
- Blt_Pixel *sp, *send;
- unsigned int *dp;
-
- dp = (unsigned int *)destRowPtr;
- for (sp = srcRowPtr, send = sp + dw; sp < send; sp++) {
- unsigned int r, g, b;
-
- r = (p->igammaTable[sp->Red] >> p->rAdjust) << p->rShift;
- g = (p->igammaTable[sp->Green] >> p->gAdjust) << p->gShift;
- b = (p->igammaTable[sp->Blue] >> p->bAdjust) << p->bShift;
- *dp = r | g | b;
- dp++;
- }
- destRowPtr += imgPtr->bytes_per_line;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
- case 24:
- for (y = 0; y < dh; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + dw; sp < send; sp++) {
- unsigned long pixel;
- unsigned int r, g, b;
-
- r = (p->igammaTable[sp->Red] >> p->rAdjust) << p->rShift;
- g = (p->igammaTable[sp->Green] >> p->gAdjust) << p->gShift;
- b = (p->igammaTable[sp->Blue] >> p->bAdjust) << p->bShift;
- pixel = r | g | b;
-
- *dp++ = pixel & 0xFF;
- *dp++ = (pixel >> 8) & 0xFF;
- *dp++ = (pixel >> 16) & 0xFF;
- }
- destRowPtr += imgPtr->bytes_per_line;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
-
- case 16:
- for (y = 0; y < dh; y++) {
- Blt_Pixel *sp, *send;
- unsigned short *dp;
-
- dp = (unsigned short *)destRowPtr;
- for (sp = srcRowPtr, send = sp + dw; sp < send; sp++) {
- unsigned long pixel;
- unsigned int r, g, b;
-
- r = (p->igammaTable[sp->Red] >> p->rAdjust) << p->rShift;
- g = (p->igammaTable[sp->Green] >> p->gAdjust) << p->gShift;
- b = (p->igammaTable[sp->Blue] >> p->bAdjust) << p->bShift;
- pixel = r | g | b;
- *dp = pixel;
- dp++;
- }
- destRowPtr += imgPtr->bytes_per_line;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
-
- case 8:
- for (y = 0; y < dh; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + dw; sp < send; sp++) {
- unsigned long pixel;
- unsigned int r, g, b;
-
- r = (p->igammaTable[sp->Red] >> p->rAdjust) << p->rShift;
- g = (p->igammaTable[sp->Green] >> p->gAdjust) << p->gShift;
- b = (p->igammaTable[sp->Blue] >> p->bAdjust) << p->bShift;
-
- pixel = r | g | b;
- *dp++ = pixel & 0xFF;
- }
- destRowPtr += imgPtr->bytes_per_line;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
- }
- break;
-
- case DirectColor:
-
- /* Translate the RGB components to 8, 16, 24, or 32-bit pixel
- * values. */
-
- switch (imgPtr->bits_per_pixel) {
- case 32:
- for (y = 0; y < dh; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + dw; sp < send; sp++) {
- unsigned long pixel;
-
- pixel = (p->rBits[sp->Red] | p->gBits[sp->Green] |
- p->bBits[sp->Blue]);
- *(unsigned int *)dp = pixel;
- dp += 4;
- }
- destRowPtr += imgPtr->bytes_per_line;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
-
- case 24:
- for (y = 0; y < dh; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + dw; sp < send; sp++) {
- unsigned long pixel;
-
- pixel = (p->rBits[sp->Red] | p->gBits[sp->Green] |
- p->bBits[sp->Blue]);
- *dp++ = pixel & 0xFF;
- *dp++ = (pixel >> 8) & 0xFF;
- *dp++ = (pixel >> 16) & 0xFF;
- }
- destRowPtr += imgPtr->bytes_per_line;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
-
- case 16:
- for (y = 0; y < dh; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + dw; sp < send; sp++) {
- unsigned long pixel;
-
- pixel = (p->rBits[sp->Red] | p->gBits[sp->Green] |
- p->bBits[sp->Blue]);
- *(unsigned short *)dp = pixel;
- dp += 2;
- }
- destRowPtr += imgPtr->bytes_per_line;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
-
- case 8:
- for (y = 0; y < dh; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + dw; sp < send; sp++) {
- unsigned long pixel;
-
- pixel = (p->rBits[sp->Red] | p->gBits[sp->Green] |
- p->bBits[sp->Blue]);
- *dp++ = pixel & 0xFF;
- }
- break;
- }
- destRowPtr += imgPtr->bytes_per_line;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- break;
-
- case PseudoColor:
- case StaticColor:
- case GrayScale:
- case StaticGray:
-
- /* Translate RGB components to the correct 8-bit or 4-bit
- * pixel values. */
-
- if (imgPtr->bits_per_pixel == 8) {
- for (y = 0; y < dh; y++) {
- Blt_Pixel *sp, *send;
- unsigned char *dp;
-
- dp = destRowPtr;
- for (sp = srcRowPtr, send = sp + dw; sp < send; sp++) {
- unsigned long pixel;
-
- pixel = (p->rBits[sp->Red] + p->gBits[sp->Green] +
- p->bBits[sp->Blue]);
- pixel = p->pixels[pixel];
- *dp++ = (pixel & 0xFF);
- }
- destRowPtr += imgPtr->bytes_per_line;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- } else {
- for (y = 0; y < dh; y++) {
- Blt_Pixel *sp;
- int x;
- unsigned char *dp;
-
- dp = destRowPtr, sp = srcRowPtr;
- for (x = 0; x < dw; x++, sp++) {
- unsigned long pixel;
-
- pixel = (p->rBits[sp->Red] + p->gBits[sp->Green] +
- p->bBits[sp->Blue]);
- pixel = p->pixels[pixel];
- if (x & 1) {
- *dp |= (pixel & 0x0F) << 4;
- /* Move to the next address after odd nybbles. */
- dp++;
- } else {
- *dp = (pixel & 0x0F);
- }
- }
- destRowPtr += imgPtr->bytes_per_line;
- srcRowPtr += srcPtr->pixelsPerRow;
- }
- }
- break;
-
- default:
- if (ditherPtr != NULL) {
- Blt_FreePicture(ditherPtr);
- }
- XDestroyImage(imgPtr);
- return FALSE;
- }
- PaintXImage(p, drawable, imgPtr, 0, 0, w, h, dx, dy);
-
- if (ditherPtr != NULL) {
- Blt_FreePicture(ditherPtr);
- }
- XDestroyImage(imgPtr);
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaintPictureWithBlend --
- *
- * Blends and paints the picture in the given drawable. The region of the
- * picture is specified and the coordinates where in the destination
- * drawable is the image to be displayed.
- *
- * The background is snapped from the drawable and converted into a
- * picture. This picture is then blended with the current picture (the
- * background always assumed to be 100% opaque).
- *
- * Results:
- * Returns TRUE is the picture was successfully display, Otherwise FALSE is
- * returned. This may happen if the background can not be obtained from
- * the drawable.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PaintPictureWithBlend(
- Painter *p,
- Drawable drawable,
- Blt_Picture fg,
- int x, int y, /* Coordinates of source region in the
- * picture. */
- int w, int h, /* Dimension of the source region.
- * Region cannot extend beyond the end
- * of the picture. */
- int dx, int dy, /* Coordinates of destination region in
- * the drawable. */
- unsigned int flags,
- int alpha)
-{
- Pict *bgPtr;
-
-#ifdef notdef
- fprintf(stderr, "PaintPictureWithBlend: x=%d,y=%d,w=%d,h=%d,dx=%d,dy=%d\n",
- x, y, w, h, dx, dy);
-#endif
- if (dx < 0) {
- w -= -dx; /* Shrink the width. */
- x += -dx; /* Change the left of the source
- * region. */
- dx = 0; /* Start at the left of the
- * destination. */
- }
- if (dy < 0) {
- h -= -dy; /* Shrink the height. */
- y += -dy; /* Change the top of the source
- * region. */
- dy = 0; /* Start at the top of the
- * destination. */
- }
- if ((w < 0) || (h < 0)) {
- return FALSE;
- }
- bgPtr = DrawableToPicture(p, drawable, dx, dy, w, h);
- if (bgPtr == NULL) {
- return FALSE;
- }
- /* Dimension of source region may be adjusted by the actual size of the
- * drawable. This is reflected in the size of the background picture. */
- Blt_BlendPictures(bgPtr, fg, x, y, bgPtr->width, bgPtr->height, 0, 0);
- PaintPicture(p, drawable, bgPtr, 0, 0, bgPtr->width, bgPtr->height, dx, dy,
- flags);
- Blt_FreePicture(bgPtr);
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawableToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and converts it
- * to a picture.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred, NULL is
- * returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_DrawableToPicture(
- Tk_Window tkwin,
- Drawable drawable,
- int x, int y, /* Offset of image from the drawable's
- * origin. */
- int w, int h, /* Dimension of the image. Image must
- * be completely contained by the
- * drawable. */
- float gamma)
-{
- Blt_Painter painter;
- Blt_Picture picture;
-
- painter = Blt_GetPainter(tkwin, gamma);
- picture = DrawableToPicture(painter, drawable, x, y, w, h);
- Blt_FreePainter(painter);
- return picture;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_WindowToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and converts it
- * to a picture.
- *
- * This routine is used to snap foreign (non-Tk) windows. For pixmaps and
- * Tk windows, Blt_DrawableToPicture is preferred.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred, NULL is
- * returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_WindowToPicture(
- Display *display,
- Drawable drawable,
- int x, int y, /* Offset of image from the drawable's
- * origin. */
- int w, int h, /* Dimension of the image. Image must
- * be completely contained by the
- * drawable. */
- float gamma)
-{
- Blt_Painter painter;
- Blt_Picture picture;
-
- painter = Blt_GetPainterFromDrawable(display, drawable, gamma);
- picture = DrawableToPicture(painter, drawable, x, y, w, h);
- Blt_FreePainter(painter);
- return picture;
-}
-
-int
-Blt_PaintPicture(
- Blt_Painter painter,
- Drawable drawable,
- Blt_Picture picture,
- int x, int y, /* Starting coordinates of subregion in
- * the picture to be painted. */
- int w, int h, /* Dimension of the subregion. */
- int dx, int dy, /* Coordinates of region in the
- * drawable. */
- unsigned int flags)
-{
- int x1, y1, x2, y2;
-
- /*
- * Nothing to draw. The selected region is outside of the picture.
- *
- * 0,0
- * +---------+
- * | |
- * | Picture |
- * | |
- * +---------+
- * x,y
- * +-------+
- * | |
- * | | h
- * +-------+
- * w
- */
- x1 = x, y1 = y, x2 = x + w, y2 = y1 + h;
- if ((picture == NULL) ||
- (x1 >= Blt_PictureWidth(picture)) || (x2 <= 0) ||
- (y1 >= Blt_PictureHeight(picture)) || (y2 <= 0)) {
- return TRUE;
- }
- if (dx < 0) {
- x1 -= dx; /* Add offset */
- dx = 0;
- }
- if (dy < 0) {
- y1 -= dy; /* Add offset */
- dy = 0;
- }
- /*
- * Correct the dimensions if the origin starts before the picture
- * (i.e. coordinate is negative). Reset the coordinate the 0.
- *
- * x,y
- * +---------+ 0,0
- * | +------|--------+ +------+--------+
- * h | |0,0 | | | | |
- * | | | | | | |
- * +--|------+ | +------+ |
- * w | | | |
- * | | | |
- * +---------------+ +---------------+
- *
- */
- if (x1 < 0) {
- x2 += x1;
- x1 = 0;
- }
- if (y1 < 0) {
- y2 += y1;
- y1 = 0;
- }
- /*
- * Check that the given area does not extend beyond the end of the
- * picture.
- *
- * 0,0 0,0
- * +-----------------+ +-----------------+
- * | | | |
- * | x,y | | x,y |
- * | +---------+ | +-------+
- * | | | | | | |
- * | | | | w | | |
- * +---------|-------+ | +---------+-------+
- * +---------+
- * h
- *
- * Clip the end of the area if it's too big.
- */
- if ((x2 - x1) > Blt_PictureWidth(picture)) {
- x2 = x1 + Blt_PictureWidth(picture);
- }
- if ((y2 - y1) > Blt_PictureHeight(picture)) {
- y2 = y1 + Blt_PictureHeight(picture);
- }
- /* Check that there's still something to paint. */
- if (((x2 - x1) <= 0) || ((y2 - y1) <= 0)) {
- return TRUE;
- }
- if (Blt_PictureIsOpaque(picture)) {
- return PaintPicture(painter, drawable, picture, x1, y1, x2 - x1,
- y2 - y1, dx, dy, flags);
- } else {
- int alpha = 128;
-
- return PaintPictureWithBlend(painter, drawable, picture, x1, y1,
- x2 - x1, y2 - y1, dx, dy, flags, alpha);
- }
-}
-
-int
-Blt_PaintPictureWithBlend(
- Blt_Painter painter,
- Drawable drawable,
- Blt_Picture picture,
- int x, int y, /* Coordinates of region in the
- * picture. */
- int w, int h, /* Dimension of the region. Area
- * cannot extend beyond the end of the
- * picture. */
- int dx, int dy, /* Coordinates of region in the
- * drawable. */
- unsigned int flags, /* Indicates whether to dither the
- * picture before displaying. */
- double falpha)
-{
- int alpha;
- int x1, y1, x2, y2;
-
- alpha = (int)(falpha * 255.0 + 0.5);
- /*
- * Nothing to draw. The selected region is outside of the picture.
- *
- * 0,0
- * +---------+
- * | |
- * | Picture |
- * | |
- * +---------+
- * x,y
- * +-------+
- * | |
- * | | h
- * +-------+
- * w
- */
- x1 = x, y1 = y, x2 = x + w, y2 = y1 + h;
- if ((picture == NULL) ||
- (x1 >= Blt_PictureWidth(picture)) || (x2 <= 0) ||
- (y1 >= Blt_PictureHeight(picture)) || (y2 <= 0)) {
- return TRUE;
- }
- if (dx < 0) {
- x1 -= dx;
- dx = 0; /* Add offset */
- }
- if (dy < 0) {
- y1 -= dy; /* Add offset */
- dy = 0;
- }
- /*
- * Correct the dimensions if the origin starts before the picture
- * (i.e. coordinate is negative). Reset the coordinate the 0.
- *
- * x,y
- * +---------+ 0,0
- * | +------|--------+ +------+--------+
- * h | |0,0 | | | | |
- * | | | | | | |
- * +--|------+ | +------+ |
- * w | | | |
- * | | | |
- * +---------------+ +---------------+
- *
- */
- if (x1 < 0) {
- x2 += x1;
- x1 = 0;
- }
- if (y1 < 0) {
- y2 += y2;
- y1 = 0;
- }
- /*
- * Check that the given area does not extend beyond the end of the
- * picture.
- *
- * 0,0 0,0
- * +-----------------+ +-----------------+
- * | | | |
- * | x,y | | x,y |
- * | +---------+ | +-------+
- * | | | | | | |
- * | | | | w | | |
- * +---------|-------+ | +---------+-------+
- * +---------+
- * h
- *
- * Clip the end of the area if it's too big.
- */
- if ((x2 - x1) > Blt_PictureWidth(picture)) {
- x2 = x1 + Blt_PictureWidth(picture);
- }
- if ((y2 - y1) > Blt_PictureHeight(picture)) {
- y2 = y1 + Blt_PictureHeight(picture);
- }
- /* Check that there's still something to paint. */
- if (((x2 - x1) <= 0) || ((y2 - y1) <= 0)) {
- return TRUE;
- }
- return PaintPictureWithBlend(painter, drawable, picture, x1, y1, x2 - x1,
- y2 - y1, dx, dy, flags, alpha);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPainterFromDrawable --
- *
- * Gets a painter for a particular combination of display, colormap,
- * visual, depth, and gamma value. This information is retrieved from
- * the drawable which is assumed to be a window.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- *---------------------------------------------------------------------------
- */
-Painter *
-Blt_GetPainterFromDrawable(Display *display, Drawable drawable, float gamma)
-{
- XGCValues gcValues;
- unsigned long gcMask;
- Painter *p;
-
- {
- Blt_DrawableAttributes *attrPtr;
-
- attrPtr = Blt_GetDrawableAttribs(display, drawable);
- if ((attrPtr != NULL) && (attrPtr->visual != NULL)) {
- p = GetPainter(display, attrPtr->colormap, attrPtr->visual,
- attrPtr->depth, gamma);
- } else {
- XWindowAttributes a;
- XGetWindowAttributes(display, drawable, &a);
- p = GetPainter(display, a.colormap, a.visual, a.depth, gamma);
- }
- }
-
- /*
- * Make a GC with background = black and foreground = white.
- */
- gcMask = GCGraphicsExposures;
- gcValues.graphics_exposures = False;
-
- p->gc = XCreateGC(display, drawable, gcMask, &gcValues);
- p->flags |= GC_PRIVATE;
- return p;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPainter --
- *
- * Gets a painter for a particular combination of display, colormap,
- * visual, depth, and gamma value. This information (except for the
- * monitor's gamma value) is retrieved from the given Tk window.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- *---------------------------------------------------------------------------
- */
-Painter *
-Blt_GetPainter(Tk_Window tkwin, float gamma)
-{
- Painter *p;
- XGCValues gcValues;
- unsigned long gcMask;
-
- p = GetPainter(Tk_Display(tkwin), Tk_Colormap(tkwin),
- Tk_Visual(tkwin), Tk_Depth(tkwin), gamma);
-
- /*
- * Make a GC with background = black and foreground = white.
- */
- gcMask = GCGraphicsExposures;
- gcValues.graphics_exposures = False;
- p->gc = Tk_GetGC(tkwin, gcMask, &gcValues);
- p->flags &= ~GC_PRIVATE;
- return p;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FreePainter --
- *
- * Frees the painter. Painters are reference counted. Only when no clients
- * are using the painter (the count is zero) is the painter actually freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FreePainter(Painter *p)
-{
- p->refCount--;
- if (p->refCount <= 0) {
- Tcl_EventuallyFree(p, FreePainter);
- }
-}
-
-GC
-Blt_PainterGC(Painter *p)
-{
- return p->gc;
-}
-
-int
-Blt_PainterDepth(Painter *p)
-{
- return p->depth;
-}
-
-Visual *
-Blt_PainterVisual(Painter *p)
-{
- return p->visualPtr;
-}
-
-Colormap
-Blt_PainterColormap(Painter *p)
-{
- return p->colormap;
-}
diff --git a/blt3.0.1/src/bltUnixPainter.h b/blt3.0.1/src/bltUnixPainter.h
deleted file mode 100644
index 63749a1..0000000
--- a/blt3.0.1/src/bltUnixPainter.h
+++ /dev/null
@@ -1,143 +0,0 @@
-
-/*
- * bltUnixPainter.h --
- *
- * This header contains the private definitions for a painter in
- * the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The color allocation routines are adapted from tkImgPhoto.c of the
- * Tk library distrubution. The photo image type was designed and
- * implemented by Paul Mackerras.
- *
- * Copyright (c) 1987-1993 The Regents of the University of
- * California.
- *
- * Copyright (c) 19941998 Sun Microsystems, Inc.
- *
- */
-
-#ifndef _BLT_UNIX_PAINTER_H
-#define _BLT_UNIX_PAINTER_H
-
-#ifdef notdef
-#define PAINTER_COLOR_WINDOW (1<<0)
-#define PAINTER_BW (1<<1)
-#define PAINTER_MAP_COLORS (1<<2)
-#endif
-
-/*
- * Painter --
- *
- * This structure represents a painter used to display picture images. A
- * painter is specified by a combination of display, visual, colormap, depth,
- * and monitor gamma value. Painters contain information necessary to display
- * a picture. This includes both an RGB to pixel map, and a RGB to allocated
- * color map.
- *
- * Painters may be shared by more than one client and are reference counted.
- * When no clients are using the painter, it is freed.
- */
-
-struct _Blt_Painter {
- Display *display; /* Display of painter. Used to free colors
- * allocated. */
-
- Visual *visualPtr; /* Visual information for the class of windows
- * displaying the image. */
-
- Colormap colormap; /* Colormap used. This may be the default
- * colormap, or an allocated private map. */
-
- int depth; /* Pixel depth of the display. */
-
- float gamma; /* Gamma correction value of monitor. */
-
- unsigned int flags; /* Flags listed below. */
-
- int refCount; /* # of clients using this painter. If zero,
- * # the painter is freed. */
-
- Blt_HashEntry *hashPtr; /* Used to delete the painter entry from the
- * hash table of painters. */
-
- int nColors; /* # of colors allocated. */
- int nRed, nGreen, nBlue; /* # of intensities for each RGB component. */
-
- unsigned long pixels[256]; /* Array of pixel values. Needed to deallocate
- * the color palette. Also contains the
- * mapping between linear pixel values (rBits,
- * gBits, bBits) and the actual pixel for
- * PsuedoColor, StaticColor, Greyscale, and
- * StaticGrey visuals.
- */
-
- int nPixels; /* # of pixels allocated in above array. */
-
-
- GC gc; /* GC used to draw the image. */
-
- /*
- * The following arrays are used for DirectColor, PsuedoColor,
- * StaticColor, Greyscale, and StaticGrey visuals to convert RGB triplets
- * to a parts of a pixel index.
- */
- unsigned int rBits[256], gBits[256], bBits[256];
-
- /*
- * This following as used for TrueColor and DirectColor visuals only.
- * They are used to directly compute of pixel values from picture RGB
- * components.
- */
- unsigned int rAdjust, gAdjust, bAdjust;
- unsigned int rShift, gShift, bShift;
- unsigned int rMask, gMask, bMask;
-
- unsigned char gammaTable[256]; /* Input gamma lookup table. Used to map
- * non-linear monitor values back to RGB
- * values. This is used whenever we take a
- * snapshot of the screen (e.g. alpha
- * blending). Computes the power mapping. D
- * = I^gamma. */
-
- unsigned char igammaTable[256]; /* Output gamma lookup table. Used to map
- * RGB values to non-linear monitor
- * values. Computes the inverse power mapping.
- * I~ = D^1/gamma. */
-
- int isMonochrome; /* Indicates if the display uses a single
- * color component (e.g. 4-bit grayscale). */
-
- Blt_Pixel palette[256]; /* Maps the picture's 8-bit RGB values to the
- * RGB values of the colors actually
- * allocated. This is used for dithering the
- * picture. */
-
-};
-
-typedef struct _Blt_Painter Painter;
-
-#endif /* _BLT_UNIX_PAINTER_H */
diff --git a/blt3.0.1/src/bltUnixPipe.c b/blt3.0.1/src/bltUnixPipe.c
deleted file mode 100644
index f3e955e..0000000
--- a/blt3.0.1/src/bltUnixPipe.c
+++ /dev/null
@@ -1,1093 +0,0 @@
-
-/*
- * bltUnixPipe.c --
- *
- * This module implements the former Tcl_CreatePipeline API. This file
- * contains the generic portion of the command channel driver as well
- * as various utility routines used in managing subprocesses.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This file was adapted from tclPipe.c and tclUnixPipe.c of the Tcl
- * distribution.
- *
- * Copyright (c) 1997 by Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and
- * redistribution of this file, and for a DISCLAIMER OF ALL
- * WARRANTIES.
- *
- */
-
-#include "bltInt.h"
-#include <fcntl.h>
-#include <signal.h>
-#include "bltWait.h"
-
-typedef int Tcl_File;
-
-static int
-GetFdFromChannel(Tcl_Channel channel, int direction)
-{
- long f;
- ClientData clientData;
-
- if (Tcl_GetChannelHandle(channel, direction, &clientData) != TCL_OK) {
- return -1;
- }
- f = (long)clientData;
- return (int)f;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OpenFile --
- *
- * Open a file for use in a pipeline.
- *
- * Results:
- * Returns a new TclFile handle or NULL on failure.
- *
- * Side effects:
- * May cause a file to be created on the file system.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-OpenFile(
- char *fname, /* The name of the file to open. */
- int mode) /* In what mode to open the file? */
-{
- int fd;
-
- fd = open(fname, mode, 0666);
- if (fd != -1) {
- fcntl(fd, F_SETFD, FD_CLOEXEC);
- /*
- * If the file is being opened for writing, seek to the end so we can
- * append to any data already in the file.
- */
- if (mode & O_WRONLY) {
- lseek(fd, 0, SEEK_END);
- }
- return fd;
- }
- return -1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateTempFile --
- *
- * This function creates a temporary file initialized with an
- * optional string, and returns a file handle with the file pointer
- * at the beginning of the file.
- *
- * Results:
- * A handle to a file.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-CreateTempFile(char *contents) /* String to write into temp file, or NULL. */
-{
- char fileName[L_tmpnam];
- int fd;
- size_t length = (contents == NULL) ? 0 : strlen(contents);
-
- if (mkstemp(fileName) < 0) {
- panic("can't create temp file");
- }
- fd = OpenFile(fileName, O_RDWR | O_CREAT | O_TRUNC);
- unlink(fileName);
-
- if ((fd >= 0) && (length > 0)) {
- for (;;) {
- if (write(fd, contents, length) != -1) {
- break;
- } else if (errno != EINTR) {
- close(fd);
- return -1;
- }
- }
- lseek(fd, 0, SEEK_SET);
- }
- return fd;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreatePipe --
- *
- * Creates a pipe by simply calling the pipe() function.
- *
- * Results:
- * Returns 1 on success, 0 on failure.
- *
- * Side effects:
- * Creates a pipe.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CreatePipe(
- Tcl_Interp *interp,
- int *inPtr, /* (out) Descriptor for read side of
- * pipe. */
- int *outPtr) /* (out) Descriptor for write side of
- * pipe. */
-{
- int fd[2];
-
- if (pipe(fd) < 0) {
- Tcl_AppendResult(interp, "can't create pipe for command: ",
- Tcl_PosixError(interp), (char *)NULL);
- return TCL_ERROR;
- }
- fcntl(fd[0], F_SETFD, FD_CLOEXEC);
- fcntl(fd[1], F_SETFD, FD_CLOEXEC);
-
- *inPtr = fd[0];
- *outPtr = fd[1];
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CloseFile --
- *
- * Implements a mechanism to close a UNIX file.
- *
- * Results:
- * Returns 0 on success, or -1 on error, setting errno.
- *
- * Side effects:
- * The file is closed.
- *
- *---------------------------------------------------------------------------
- */
-static int
-CloseFile(int fd) /* File descriptor to be closed. */
-{
- if ((fd == 0) || (fd == 1) || (fd == 2)) {
- return 0; /* Don't close stdin, stdout or
- * stderr. */
- }
- Tcl_DeleteFileHandler(fd);
- return close(fd);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RestoreSignals --
- *
- * This procedure is invoked in a forked child process just before
- * exec-ing a new program to restore all signals to their default
- * settings.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Signal settings get changed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-RestoreSignals(void)
-{
-#ifdef SIGABRT
- signal(SIGABRT, SIG_DFL);
-#endif
-#ifdef SIGALRM
- signal(SIGALRM, SIG_DFL);
-#endif
-#ifdef SIGFPE
- signal(SIGFPE, SIG_DFL);
-#endif
-#ifdef SIGHUP
- signal(SIGHUP, SIG_DFL);
-#endif
-#ifdef SIGILL
- signal(SIGILL, SIG_DFL);
-#endif
-#ifdef SIGINT
- signal(SIGINT, SIG_DFL);
-#endif
-#ifdef SIGPIPE
- signal(SIGPIPE, SIG_DFL);
-#endif
-#ifdef SIGQUIT
- signal(SIGQUIT, SIG_DFL);
-#endif
-#ifdef SIGSEGV
- signal(SIGSEGV, SIG_DFL);
-#endif
-#ifdef SIGTERM
- signal(SIGTERM, SIG_DFL);
-#endif
-#ifdef SIGUSR1
- signal(SIGUSR1, SIG_DFL);
-#endif
-#ifdef SIGUSR2
- signal(SIGUSR2, SIG_DFL);
-#endif
-#ifdef SIGCHLD
- signal(SIGCHLD, SIG_DFL);
-#endif
-#ifdef SIGCONT
- signal(SIGCONT, SIG_DFL);
-#endif
-#ifdef SIGTSTP
- signal(SIGTSTP, SIG_DFL);
-#endif
-#ifdef SIGTTIN
- signal(SIGTTIN, SIG_DFL);
-#endif
-#ifdef SIGTTOU
- signal(SIGTTOU, SIG_DFL);
-#endif
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetupStdFile --
- *
- * Set up stdio file handles for the child process, using the
- * current standard channels if no other files are specified.
- * If no standard channel is defined, or if no file is associated
- * with the channel, then the corresponding standard fd is closed.
- *
- * Results:
- * Returns 1 on success, or 0 on failure.
- *
- * Side effects:
- * Replaces stdio fds.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SetupStdFile(
- int fd, /* File descriptor to dup, or -1. */
- int type) /* One of TCL_STDIN, TCL_STDOUT,
- * TCL_STDERR */
-{
- int targetFd = 0; /* Initializations here needed only
- * to */
- int direction = 0; /* Prevent warnings about using
- * uninitialized variables. */
- switch (type) {
- case TCL_STDIN:
- targetFd = 0;
- direction = TCL_READABLE;
- break;
- case TCL_STDOUT:
- targetFd = 1;
- direction = TCL_WRITABLE;
- break;
- case TCL_STDERR:
- targetFd = 2;
- direction = TCL_WRITABLE;
- break;
- }
- if (fd < 0) {
- Tcl_Channel channel;
-
- channel = Tcl_GetStdChannel(type);
- if (channel) {
- fd = GetFdFromChannel(channel, direction);
- }
- }
- if (fd >= 0) {
- if (fd != targetFd) {
- if (dup2(fd, targetFd) == -1) {
- return 0;
- }
- /*
- * Must clear the close-on-exec flag for the target FD, since some
- * systems (e.g. Ultrix) do not clear the CLOEXEC flag on the
- * target FD.
- */
-
- fcntl(targetFd, F_SETFD, 0);
- } else {
- /*
- * Since we aren't dup'ing the file, we need to explicitly clear
- * the close-on-exec flag.
- */
- fcntl(fd, F_SETFD, 0);
- }
- } else {
- close(targetFd);
- }
- return 1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateProcess --
- *
- * Create a child process that has the specified files as its standard
- * input, output, and error. The child process runs asynchronously and
- * runs with the same environment variables as the creating process.
- *
- * The path is searched to find the specified executable.
- *
- * Results:
- * The return value is TCL_ERROR and an error message is left in
- * interp->result if there was a problem creating the child process.
- * Otherwise, the return value is TCL_OK and *pidPtr is filled with the
- * process id of the child process.
- *
- * Side effects:
- * A process is created.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-CreateProcess(
- Tcl_Interp *interp, /* Interpreter in which to leave errors that
- * occurred when creating the child process.
- * Error messages from the child process
- * itself are sent to stderrFd. */
- int argc, /* Number of arguments in following array. */
- char **argv, /* Array of argument strings. argv[0]
- * contains the name of the executable
- * converted to native format (using the
- * Tcl_TranslateFileName call). Additional
- * arguments have not been converted. */
- int stdinFd, /* The file to use as input for the child
- * process. If stdinFd file is -1, input is
- * read from the standard input channel. If
- * the file isn't readable, the child will
- * receive no standard input. */
- int stdoutFd, /* The file that receives output from the
- * child process. If stdoutFd is -1, output
- * is sent to the standard output channel. If
- * the file is not writeable, output from the
- * child will be discarded. */
- int stderrFd, /* The file that receives errors from the
- * child process. If stderrFd file is -1,
- * errors will be sent to the standard error
- * channel. If the file isn't writeable,
- * errors from the child will be discarded.
- * stderrFd may be the same as stdoutFd. */
- int *pidPtr) /* (out) If this procedure is successful,
- * pidPtr is filled with the process id of the
- * child process. */
-{
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- Tcl_DString *dsArr;
- Tcl_Encoding encoding;
-#endif
- char errSpace[200];
- int errPipeIn, errPipeOut;
- int i;
- int joinThisError, status, fd;
- long pid;
- size_t count;
-
- errPipeIn = errPipeOut = -1;
- pid = -1;
-
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- dsArr = Blt_AssertMalloc(argc * sizeof(Tcl_DString));
- encoding = Tcl_GetEncoding(interp, NULL);
- for(i = 0; i < argc; i++) {
- argv[i] = Tcl_UtfToExternalDString(encoding, argv[i],
- strlen(argv[i]), dsArr + i);
- }
-#endif
- /*
- * Create a pipe that the child can use to return error information if
- * anything goes wrong.
- */
- if (CreatePipe(interp, &errPipeIn, &errPipeOut) != TCL_OK) {
- goto error;
- }
- joinThisError = (stderrFd == stdoutFd);
- pid = fork();
- if (pid == 0) {
- ssize_t nWritten;
-
- fd = errPipeOut;
-
- /*
- * Set up stdio file handles for the child process.
- */
- if (!SetupStdFile(stdinFd, TCL_STDIN) ||
- !SetupStdFile(stdoutFd, TCL_STDOUT) ||
- (!joinThisError && !SetupStdFile(stderrFd, TCL_STDERR)) ||
- (joinThisError &&
- ((dup2(1, 2) == -1) || (fcntl(2, F_SETFD, 0) != 0)))) {
- sprintf_s(errSpace, 200,
- "%dforked process can't set up input/output: ", errno);
- nWritten = write(fd, errSpace, (size_t) strlen(errSpace));
- _exit(1);
- }
- /*
- * Close the input side of the error pipe.
- */
- RestoreSignals();
- execvp(argv[0], &argv[0]);
- sprintf_s(errSpace, 200, "%dcan't execute \"%.150s\": ", errno, argv[0]);
- nWritten = write(fd, errSpace, (size_t)strlen(errSpace));
- _exit(1);
- }
- if (pid == -1) {
- Tcl_AppendResult(interp, "can't fork child process: ",
- Tcl_PosixError(interp), (char *)NULL);
- goto error;
- }
-
- /*
- * Read back from the error pipe to see if the child started up OK. The
- * info in the pipe (if any) consists of a decimal errno value followed by
- * an error message.
- */
- CloseFile(errPipeOut);
- errPipeOut = -1;
-
- fd = errPipeIn;
- count = read(fd, errSpace, (size_t) (sizeof(errSpace) - 1));
- if (count > 0) {
- char *end;
-
- errSpace[count] = 0;
- errno = strtol(errSpace, &end, 10);
- Tcl_AppendResult(interp, end, Tcl_PosixError(interp), (char *)NULL);
- goto error;
- }
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- for(i = 0; i < argc; i++) {
- Tcl_DStringFree(dsArr + i);
- }
- Blt_Free(dsArr);
-#endif
- CloseFile(errPipeIn);
- *pidPtr = pid;
- return TCL_OK;
-
- error:
- if (pid != -1) {
- /*
- * Reap the child process now if an error occurred during its startup.
- */
- Tcl_WaitPid((Tcl_Pid)pid, &status, WNOHANG);
- }
- if (errPipeIn >= 0) {
- CloseFile(errPipeIn);
- }
- if (errPipeOut >= 0) {
- CloseFile(errPipeOut);
- }
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- for(i = 0; i < argc; i++) {
- Tcl_DStringFree(dsArr + i);
- }
- Blt_Free(dsArr);
-#endif
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FileForRedirect --
- *
- * This procedure does much of the work of parsing redirection operators.
- * It handles "@" if specified and allowed, and a file name, and opens
- * the file if necessary.
- *
- * Results:
- * The return value is the descriptor number for the file. If an error
- * occurs then NULL is returned and an error message is left in
- * interp->result. Several arguments are side-effected; see the argument
- * list below for details.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-FileForRedirect(
- Tcl_Interp *interp, /* Intepreter to use for error reporting. */
- char *spec, /* Points to character just after redirection
- * character. */
- char *arg, /* Pointer to entire argument containing spec:
- * used for error reporting. */
- int atOK, /* Non-zero means that '@' notation can be
- * used to specify a channel, zero means that
- * it isn't. */
- char *nextArg, /* Next argument in argc/argv array, if needed
- * for file name or channel name. May be
- * NULL. */
- int flags, /* Flags to use for opening file or to specify
- * mode for channel. */
- int *skipPtr, /* (out) Filled with 1 if redirection target
- * was in spec, 2 if it was in nextArg. */
- int *closePtr) /* (out) Filled with one if the caller should
- * close the file when done with it, zero
- * otherwise. */
-{
- int writing = (flags & O_WRONLY);
- int fd;
-
- *skipPtr = 1;
- if ((atOK != 0) && (*spec == '@')) {
- int direction;
- Tcl_Channel chan;
-
- spec++;
- if (*spec == '\0') {
- spec = nextArg;
- if (spec == NULL) {
- goto badLastArg;
- }
- *skipPtr = 2;
- }
- chan = Tcl_GetChannel(interp, spec, NULL);
- if (chan == NULL) {
- return -1;
- }
- direction = (writing) ? TCL_WRITABLE : TCL_READABLE;
- fd = GetFdFromChannel(chan, direction);
- if (fd < 0) {
- Tcl_AppendResult(interp, "channel \"", Tcl_GetChannelName(chan),
- "\" wasn't opened for ",
- ((writing) ? "writing" : "reading"), (char *)NULL);
- return -1;
- }
- if (writing) {
- /*
- * Be sure to flush output to the file, so that anything
- * written by the child appears after stuff we've already
- * written.
- */
- Tcl_Flush(chan);
- }
- } else {
- char *name;
- Tcl_DString nameString;
-
- if (*spec == '\0') {
- spec = nextArg;
- if (spec == NULL) {
- goto badLastArg;
- }
- *skipPtr = 2;
- }
- name = Tcl_TranslateFileName(interp, spec, &nameString);
-
- if (name != NULL) {
- fd = OpenFile(name, flags);
- } else {
- fd = -1;
- }
- Tcl_DStringFree(&nameString);
- if (fd < 0) {
- Tcl_AppendResult(interp, "can't ",
- ((writing) ? "write" : "read"), " file \"", spec, "\": ",
- Tcl_PosixError(interp), (char *)NULL);
- return -1;
- }
- *closePtr = TRUE;
- }
- return fd;
-
- badLastArg:
- Tcl_AppendResult(interp, "can't specify \"", arg,
- "\" as last word in command", (char *)NULL);
- return -1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_CreatePipeline --
- *
- * Given an objc/objv array, instantiate a pipeline of processes as
- * described by the objv.
- *
- * Results:
- * The return value is a count of the number of new processes created, or
- * -1 if an error occurred while creating the pipeline. *pidArrayPtr is
- * filled in with the address of a dynamically allocated array giving the
- * ids of all of the processes.
- *
- * It is up to the caller to free this array when it isn't needed
- * anymore.
- *
- * If stdinPipePtr isn't NULL, then *stdinPipePtr is filled with the file
- * id for the input pipe for the pipeline (if any): the caller must
- * eventually close this file.
- *
- * If stdoutPipePtr isn't NULL, then *stdoutPipePtr is filled with the
- * file id for the output pipe from the pipeline: the caller must close
- * this file.
- *
- * If stderrPipePtr isn't NULL, then *stderrPipePtr is filled with a file
- * id that may be used to read error output after the pipeline completes.
- *
- * Side effects:
- * Processes and pipes are created.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_CreatePipeline(
- Tcl_Interp *interp, /* Interpreter to use for error reporting. */
- int objc, /* Number of entries in objv. */
- Tcl_Obj *const *objv, /* Array of strings describing commands in
- * pipeline plus I/O redirection with <, <<,
- * >, etc. Objv[objc] must be NULL. */
- ProcessId **pidArrayPtr, /* (out) Word at *pidArrayPtr gets filled in
- * with address of array of pids for processes
- * in pipeline (first pid is first process in
- * pipeline). */
- int *stdinPipePtr, /* (out) If non-NULL, input to the pipeline
- * comes from a pipe (unless overridden by
- * redirection in the command). The file id
- * with which to write to this pipe is stored
- * at *stdinPipePtr. NULL means command
- * specified its own input source. */
- int *stdoutPipePtr, /* (out) If non-NULL, output to the pipeline
- * goes to a pipe, unless overriden by
- * redirection in the command. The file id
- * with which to read frome this pipe is
- * stored at *stdoutPipePtr. NULL means
- * command specified its own output sink. */
- int *stderrPipePtr) /* (out) If non-NULL, all stderr output from
- * the pipeline will go to a temporary file
- * created here, and a descriptor to read the
- * file will be left at *stderrPipePtr. The
- * file will be removed already, so closing
- * this descriptor will be the end of the
- * file. If this is NULL, then all stderr
- * output goes to our stderr. If the pipeline
- * specifies redirection then the file will
- * still be created but it will never get any
- * data. */
-{
- int *pids = NULL; /* Points to malloc-ed array holding all the
- * pids of child processes. */
- int nPids; /* Actual number of processes that exist at
- * *pids right now. */
- int cmdCount; /* Count of number of distinct commands found
- * in objc/objv. */
- char *inputLiteral = NULL; /* If non-null, then this points to a string
- * containing input data (specified via <<) to
- * be piped to the first process in the
- * pipeline. */
- char *p;
- int skip, lastBar, lastArg, i, j, atOK, flags, errorToOutput;
- Tcl_DString execBuffer;
- int pipeIn;
- int isOpen[3];
- int curFd[3]; /* If non-zero, then fd should be closed
- * when cleaning up. */
- int fd[3];
-
- char **argv;
-
- fd[0] = fd[1] = fd[2] = -1;
- isOpen[0] = isOpen[1] = isOpen[2] = FALSE;
- if (stdinPipePtr != NULL) {
- *stdinPipePtr = -1;
- }
- if (stdoutPipePtr != NULL) {
- *stdoutPipePtr = -1;
- }
- if (stderrPipePtr != NULL) {
- *stderrPipePtr = -1;
- }
- Tcl_DStringInit(&execBuffer);
-
- pipeIn = curFd[0] = curFd[1] = -1;
- nPids = 0;
-
- /*
- * First, scan through all the arguments to figure out the structure of
- * the pipeline. Process all of the input and output redirection
- * arguments and remove them from the argument list in the pipeline.
- * Count the number of distinct processes (it's the number of "|"
- * arguments plus one) but don't remove the "|" arguments because they'll
- * be used in the second pass to seperate the individual child processes.
- *
- * Cannot start the child processes in this pass because the redirection
- * symbols may appear anywhere in the command line -- e.g., the '<' that
- * specifies the input to the entire pipe may appear at the very end of
- * the argument list.
- */
-
- /* Convert all the Tcl_Objs to strings. */
- argv = Blt_AssertMalloc((objc + 1) * sizeof(char *));
- for (i = 0; i < objc; i++) {
- argv[i] = Tcl_GetString(objv[i]);
- }
- argv[i] = NULL;
-
- lastBar = -1;
- cmdCount = 1;
- for (i = 0; i < objc; i++) {
- skip = 0;
- p = argv[i];
- switch (*p++) {
- case '\\':
- p++;
- continue;
-
- case '|':
- if (*p == '&') {
- p++;
- }
- if (*p == '\0') {
- if ((i == (lastBar + 1)) || (i == (objc - 1))) {
- Tcl_AppendResult(interp,
- "illegal use of | or |& in command", (char *)NULL);
- goto error;
- }
- }
- lastBar = i;
- cmdCount++;
- break;
-
- case '<':
- if (isOpen[0] != 0) {
- isOpen[0] = FALSE;
- CloseFile(fd[0]);
- }
- if (*p == '<') {
- fd[0] = -1;
- inputLiteral = p + 1;
- skip = 1;
- if (*inputLiteral == '\0') {
- inputLiteral = argv[i + 1];
- if (inputLiteral == NULL) {
- Tcl_AppendResult(interp, "can't specify \"", argv[i],
- "\" as last word in command", (char *)NULL);
- goto error;
- }
- skip = 2;
- }
- } else {
- inputLiteral = NULL;
- fd[0] = FileForRedirect(interp, p, argv[i], TRUE, argv[i + 1],
- O_RDONLY, &skip, &isOpen[0]);
- if (fd[0] < 0) {
- goto error;
- }
- }
- break;
-
- case '>':
- atOK = TRUE;
- flags = O_WRONLY | O_CREAT | O_TRUNC;
- errorToOutput = FALSE;
- if (*p == '>') {
- p++;
- atOK = FALSE;
- flags = O_WRONLY | O_CREAT;
- }
- if (*p == '&') {
- if (isOpen[2] != 0) {
- isOpen[2] = FALSE;
- CloseFile(fd[2]);
- }
- errorToOutput = TRUE;
- p++;
- }
- if (isOpen[1] != 0) {
- isOpen[1] = FALSE;
- CloseFile(fd[1]);
- }
- fd[1] = FileForRedirect(interp, p, argv[i], atOK, argv[i + 1],
- flags, &skip, &isOpen[1]);
- if (fd[1] < 0) {
- goto error;
- }
- if (errorToOutput) {
- isOpen[2] = FALSE;
- fd[2] = fd[1];
- }
- break;
-
- case '2':
- if (*p != '>') {
- break;
- }
- p++;
- atOK = TRUE;
- flags = O_WRONLY | O_CREAT | O_TRUNC;
- if (*p == '>') {
- p++;
- atOK = FALSE;
- flags = O_WRONLY | O_CREAT;
- }
- if (isOpen[2] != 0) {
- isOpen[2] = FALSE;
- CloseFile(fd[2]);
- }
- fd[2] = FileForRedirect(interp, p, argv[i], atOK, argv[i + 1],
- flags, &skip, &isOpen[2]);
- if (fd[2] < 0) {
- goto error;
- }
- break;
- }
-
- if (skip != 0) {
- for (j = i + skip; j < objc; j++) {
- argv[j - skip] = argv[j];
- }
- objc -= skip;
- i -= 1;
- }
- }
-
- if (fd[0] == -1) {
- if (inputLiteral != NULL) {
- /*
- * The input for the first process is immediate data coming from
- * Tcl. Create a temporary file for it and put the data into the
- * file.
- */
- fd[0] = CreateTempFile(inputLiteral);
- if (fd[0] < 0) {
- Tcl_AppendResult(interp,
- "can't create input file for command: ",
- Tcl_PosixError(interp), (char *)NULL);
- goto error;
- }
- isOpen[0] = TRUE;
- } else if (stdinPipePtr != NULL) {
- /*
- * The input for the first process in the pipeline is to come from
- * a pipe that can be written from by the caller.
- */
- if (CreatePipe(interp, &fd[0], stdinPipePtr) != TCL_OK) {
- goto error;
- }
- isOpen[0] = TRUE;
- } else {
- /*
- * The input for the first process comes from stdin.
- */
- fd[0] = 0;
- }
- }
- if (fd[1] == -1) {
- if (stdoutPipePtr != NULL) {
- /*
- * Output from the last process in the pipeline is to go to a pipe
- * that can be read by the caller.
- */
- if (CreatePipe(interp, stdoutPipePtr, &fd[1]) != TCL_OK) {
- goto error;
- }
- isOpen[1] = TRUE;
- } else {
- /*
- * The output for the last process goes to stdout.
- */
- fd[1] = 1;
- }
- }
- if (fd[2] == -1) {
- if (stderrPipePtr != NULL) {
- /*
- * Stderr from the last process in the pipeline is to go to a pipe
- * that can be read by the caller.
- */
- if (CreatePipe(interp, stderrPipePtr, &fd[2]) != TCL_OK) {
- goto error;
- }
- isOpen[2] = TRUE;
- } else {
- /*
- * Errors from the pipeline go to stderr.
- */
- fd[2] = 2;
- }
- }
- /*
- * Scan through the objc array, creating a process for each group of
- * arguments between the "|" characters.
- */
-
- Tcl_ReapDetachedProcs();
- pids = Blt_AssertMalloc(cmdCount * sizeof(int));
- curFd[0] = fd[0];
-
- lastArg = 0; /* Suppress compiler warning */
- for (i = 0; i < objc; i = lastArg + 1) {
- int joinThisError;
- int pid;
-
- /*
- * Convert the program name into native form.
- */
-
- argv[i] = Tcl_TranslateFileName(interp, argv[i], &execBuffer);
- if (argv[i] == NULL) {
- goto error;
- }
- /*
- * Find the end of the curent segment of the pipeline.
- */
- joinThisError = 0;
- for (lastArg = i + 1; lastArg < objc; lastArg++) {
- if (argv[lastArg][0] == '|') {
- if (argv[lastArg][1] == '\0') {
- break;
- }
- if ((argv[lastArg][1] == '&') && (argv[lastArg][2] == '\0')) {
- joinThisError = 1;
- break;
- }
- }
- }
- argv[lastArg] = NULL;
-
- /*
- * If this is the last segment, use the specified fd[1]. Otherwise
- * create an intermediate pipe. pipeIn will become the curInFile for
- * the next segment of the pipe.
- */
- if (lastArg == objc) {
- curFd[1] = fd[1];
- } else {
- if (CreatePipe(interp, &pipeIn, &curFd[1]) != TCL_OK) {
- goto error;
- }
- }
-
- if (joinThisError != 0) {
- curFd[2] = curFd[1];
- } else {
- curFd[2] = fd[2];
- }
-
- if (CreateProcess(interp, lastArg - i, argv + i, curFd[0], curFd[1],
- curFd[2], &pid) != TCL_OK) {
- goto error;
- }
- Tcl_DStringFree(&execBuffer);
-
- pids[nPids] = pid;
- nPids++;
-
- /*
- * Close off our copies of file descriptors that were set up for this
- * child, then set up the input for the next child.
- */
- if ((curFd[0] >= 0) && (curFd[0] != fd[0])) {
- CloseFile(curFd[0]);
- }
- curFd[0] = pipeIn;
- pipeIn = -1;
-
- if ((curFd[1] >= 0) && (curFd[1] != fd[1])) {
- CloseFile(curFd[1]);
- }
- curFd[1] = -1;
- }
-
- *pidArrayPtr = pids;
-
- /*
- * All done. Cleanup open files lying around and then return.
- */
-
- cleanup:
- Tcl_DStringFree(&execBuffer);
-
- for (i = 0; i < 3; i++) {
- if (isOpen[i]) {
- CloseFile(fd[i]);
- }
- }
- if (argv != NULL) {
- Blt_Free(argv);
- }
- return nPids;
-
- /*
- * An error occured. There could have been extra files open, such as
- * pipes between children. Clean them all up. Detach any child processes
- * that have been created.
- */
-
- error:
- if (pipeIn >= 0) {
- CloseFile(pipeIn);
- }
- if ((curFd[2] >= 0) && (curFd[2] != fd[2])) {
- CloseFile(curFd[2]);
- }
- if ((curFd[1] >= 0) && (curFd[1] != fd[1])) {
- CloseFile(curFd[1]);
- }
- if ((curFd[0] >= 0) && (curFd[0] != fd[0])) {
- CloseFile(curFd[0]);
- }
- if ((stdinPipePtr != NULL) && (*stdinPipePtr >= 0)) {
- CloseFile(*stdinPipePtr);
- *stdinPipePtr = -1;
- }
- if ((stdoutPipePtr != NULL) && (*stdoutPipePtr >= 0)) {
- CloseFile(*stdoutPipePtr);
- *stdoutPipePtr = -1;
- }
- if ((stderrPipePtr != NULL) && (*stderrPipePtr >= 0)) {
- CloseFile(*stderrPipePtr);
- *stderrPipePtr = -1;
- }
- if (pids != NULL) {
- for (i = 0; i < nPids; i++) {
- if (pids[i] != -1) {
- Tcl_DetachPids(1, (Tcl_Pid *)(pids + i));
- }
- }
- Blt_Free(pids);
- }
- nPids = -1;
- goto cleanup;
-}
diff --git a/blt3.0.1/src/bltUnixWindow.c b/blt3.0.1/src/bltUnixWindow.c
deleted file mode 100644
index 11f2d77..0000000
--- a/blt3.0.1/src/bltUnixWindow.c
+++ /dev/null
@@ -1,520 +0,0 @@
-
-/*
- * bltUnixWindow.c --
- *
- * This module implements additional window functionality for the BLT
- * toolkit, such as transparent Tk windows, and reparenting Tk
- * windows.
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#include <X11/Xlib.h>
-#if !defined(WIN32) && !defined(MAC_OSX_TCL)
-#include <X11/Xproto.h>
-#endif
-#include "tkDisplay.h"
-
-/*
- *---------------------------------------------------------------------------
- *
- * DoConfigureNotify --
- *
- * Generate a ConfigureNotify event describing the current
- * configuration of a window.
- *
- * Results:
- * None.
- *
- * Side effects:
- * An event is generated and processed by Tk_HandleEvent.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DoConfigureNotify(Tk_FakeWin *winPtr)
-{
- XEvent event;
-
- event.type = ConfigureNotify;
- event.xconfigure.serial = LastKnownRequestProcessed(winPtr->display);
- event.xconfigure.send_event = False;
- event.xconfigure.display = winPtr->display;
- event.xconfigure.event = winPtr->window;
- event.xconfigure.window = winPtr->window;
- event.xconfigure.x = winPtr->changes.x;
- event.xconfigure.y = winPtr->changes.y;
- event.xconfigure.width = winPtr->changes.width;
- event.xconfigure.height = winPtr->changes.height;
- event.xconfigure.border_width = winPtr->changes.border_width;
- if (winPtr->changes.stack_mode == Above) {
- event.xconfigure.above = winPtr->changes.sibling;
- } else {
- event.xconfigure.above = None;
- }
- event.xconfigure.override_redirect = winPtr->atts.override_redirect;
- Tk_HandleEvent(&event);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MakeTransparentWindowExist --
- *
- * Similar to Tk_MakeWindowExist but instead creates a
- * transparent window to block for user events from sibling
- * windows.
- *
- * Differences from Tk_MakeWindowExist.
- *
- * 1. This is always a "busy" window. There's never a
- * platform-specific class procedure to execute instead.
- * 2. The window is transparent and never will contain children,
- * so colormap information is irrelevant.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the procedure returns, the internal window associated
- * with tkwin is guaranteed to exist. This may require the
- * window's ancestors to be created too.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MakeTransparentWindowExist(Tk_Window tkwin, Window parent, int isBusy)
-{
- TkWindow *winPtr = (TkWindow *) tkwin;
- TkWindow *winPtr2;
- Tcl_HashEntry *hPtr;
- int notUsed;
- TkDisplay *dispPtr;
- long int mask;
-
- if (winPtr->window != None) {
- return; /* Window already exists. */
- }
-
- /* Create a transparent window and put it on top. */
-
- mask = (!isBusy) ? 0 : (CWDontPropagate | CWEventMask);
- /* Ignore the important events while the window is mapped. */
-#define USER_EVENTS (EnterWindowMask | LeaveWindowMask | KeyPressMask | \
- KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | \
- PointerMotionMask)
-#define PROP_EVENTS (KeyPressMask | KeyReleaseMask | ButtonPressMask | \
- ButtonReleaseMask | PointerMotionMask)
-
- winPtr->atts.do_not_propagate_mask = PROP_EVENTS;
- winPtr->atts.event_mask = USER_EVENTS;
- winPtr->changes.border_width = 0;
- winPtr->depth = 0;
-
- winPtr->window = XCreateWindow(winPtr->display, parent,
- winPtr->changes.x, winPtr->changes.y,
- (unsigned)winPtr->changes.width, /* width */
- (unsigned)winPtr->changes.height, /* height */
- (unsigned)winPtr->changes.border_width, /* border_width */
- winPtr->depth, /* depth */
- InputOnly, /* class */
- winPtr->visual, /* visual */
- mask, /* valuemask */
- &winPtr->atts /* attributes */ );
-
- dispPtr = winPtr->dispPtr;
- hPtr = Tcl_CreateHashEntry(&dispPtr->winTable, (char *)winPtr->window,
- ¬Used);
- Tcl_SetHashValue(hPtr, winPtr);
- winPtr->dirtyAtts = 0;
- winPtr->dirtyChanges = 0;
-#ifdef TK_USE_INPUT_METHODS
- winPtr->inputContext = NULL;
-#endif /* TK_USE_INPUT_METHODS */
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
- /*
- * If any siblings higher up in the stacking order have already
- * been created then move this window to its rightful position
- * in the stacking order.
- *
- * NOTE: this code ignores any changes anyone might have made
- * to the sibling and stack_mode field of the window's attributes,
- * so it really isn't safe for these to be manipulated except
- * by calling Tk_RestackWindow.
- */
- for (winPtr2 = winPtr->nextPtr; winPtr2 != NULL;
- winPtr2 = winPtr2->nextPtr) {
- if ((winPtr2->window != None) && !(winPtr2->flags & TK_TOP_LEVEL)) {
- XWindowChanges changes;
- changes.sibling = winPtr2->window;
- changes.stack_mode = Below;
- XConfigureWindow(winPtr->display, winPtr->window,
- CWSibling | CWStackMode, &changes);
- break;
- }
- }
- }
-
- /*
- * Issue a ConfigureNotify event if there were deferred configuration
- * changes (but skip it if the window is being deleted; the
- * ConfigureNotify event could cause problems if we're being called
- * from Tk_DestroyWindow under some conditions).
- */
- if ((winPtr->flags & TK_NEED_CONFIG_NOTIFY)
- && !(winPtr->flags & TK_ALREADY_DEAD)) {
- winPtr->flags &= ~TK_NEED_CONFIG_NOTIFY;
- DoConfigureNotify((Tk_FakeWin *) tkwin);
- }
-}
-
-Window
-Blt_GetParentWindow(Display *display, Window window)
-{
- Window root, parent;
- Window *dummy;
- unsigned int count;
-
- if (XQueryTree(display, window, &root, &parent, &dummy, &count) > 0) {
- XFree(dummy);
- return parent;
- }
- return None;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetWindowId --
- *
- * Returns the XID for the Tk_Window given. Starting in Tk 8.0,
- * the toplevel widgets are wrapped by another window. Currently
- * there's no way to get at that window, other than what is done
- * here: query the X window hierarchy and retrieve the parent.
- *
- * Results:
- * Returns the X Window ID of the widget. If it's a toplevel, then
- * the XID of the wrapper is returned.
- *
- *---------------------------------------------------------------------------
- */
-Window
-Blt_GetWindowId(Tk_Window tkwin)
-{
- Window window;
-
- Tk_MakeWindowExist(tkwin);
- window = Tk_WindowId(tkwin);
- if (Tk_IsTopLevel(tkwin)) {
- Window parent;
-
- parent = Blt_GetParentWindow(Tk_Display(tkwin), window);
- if (parent != None) {
- window = parent;
- }
- window = parent;
- }
- return window;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XGeometryErrorProc --
- *
- * Flags errors generated from XGetGeometry calls to the X server.
- *
- * Results:
- * Always returns 0.
- *
- * Side Effects:
- * Sets a flag, indicating an error occurred.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static int
-XGeometryErrorProc(ClientData clientData, XErrorEvent *errEventPtr)
-{
- int *errorPtr = clientData;
-
- *errorPtr = FALSE;
- return 0;
-}
-
-int
-Blt_GetWindowRegion(Display *display, Window window, int *xPtr, int *yPtr,
- int *widthPtr, int *heightPtr)
-{
- Tk_ErrorHandler handler;
- Window root;
- int any = -1;
- int result;
- int x, y;
- unsigned int w, h, bw, depth;
-
-#if !defined(WIN32) && !defined(MAC_OSX_TCL)
- handler = Tk_CreateErrorHandler(display, any, X_GetGeometry, any,
- XGeometryErrorProc, &result);
-#endif
- result = XGetGeometry(display, window, &root, &x, &y, &w, &h, &bw, &depth);
- if (!result) {
- goto error;
- }
- if (widthPtr != NULL) {
- *widthPtr = (int)w;
- }
- if (heightPtr != NULL) {
- *heightPtr = (int)h;
- }
- if ((xPtr != NULL) || (yPtr != NULL)) {
- int rootX, rootY;
- rootX = rootY = 0;
-
- do {
- Window *children, parent;
- unsigned int n;
-
- parent = -1;
- fprintf(stderr, "before geomtry window=%x, root=%x parent=%x\n",
- window, root, parent);
- result = XGetGeometry(display, window, &root, &x, &y, &w, &h,
- &bw, &depth);
- if (!result) {
- goto error;
- }
- rootX += x + bw;
- rootY += y + bw;
- fprintf(stderr, "before window=%x, root=%x parent=%x\n",
- window, root, parent);
- result = XQueryTree(display, window, &root, &parent, &children, &n);
- fprintf(stderr, "after window=%x, root=%x parent=%x\n",
- window, root, parent);
- XFree(children);
- if (!result) {
- goto error;
- }
- window = parent;
- } while (window != root);
-
- if (xPtr != NULL) {
- *xPtr = rootX;
- }
- if (yPtr != NULL) {
- *yPtr = rootY;
- }
- }
-#if !defined(WIN32) && !defined(MAC_OSX_TCL)
- Tk_DeleteErrorHandler(handler);
-#endif
- XSync(display, False);
- return TCL_OK;
- error:
- Tk_DeleteErrorHandler(handler);
- XSync(display, False);
- fprintf(stderr, "failed to get window region\n");
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RaiseToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_RaiseToplevelWindow(Tk_Window tkwin)
-{
- XRaiseWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_LowerToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_LowerToplevelWindow(Tk_Window tkwin)
-{
- XLowerWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ResizeToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_ResizeToplevelWindow(Tk_Window tkwin, int width, int height)
-{
- XResizeWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin), width, height);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MoveResizeToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MoveResizeToplevelWindow(Tk_Window tkwin, int x, int y, int w, int h)
-{
- XMoveResizeWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin), x, y, w, h);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ResizeToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MoveToplevelWindow(Tk_Window tkwin, int x, int y)
-{
- XMoveWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin), x, y);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MapToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MapToplevelWindow(Tk_Window tkwin)
-{
- XMapWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin));
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_UnmapToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_UnmapToplevelWindow(Tk_Window tkwin)
-{
- XUnmapWindow(Tk_Display(tkwin), Blt_GetWindowId(tkwin));
-}
-
-/* ARGSUSED */
-static int
-XReparentWindowErrorProc(ClientData clientData, XErrorEvent *errEventPtr)
-{
- int *errorPtr = clientData;
-
- *errorPtr = TCL_ERROR;
- return 0;
-}
-
-int
-Blt_ReparentWindow(
- Display *display,
- Window window,
- Window newParent,
- int x, int y)
-{
- Tk_ErrorHandler handler;
- int result;
- int any = -1;
-
- result = TCL_OK;
-#if !defined(WIN32) && !defined(MAC_OSX_TCL)
- handler = Tk_CreateErrorHandler(display, any, X_ReparentWindow, any,
- XReparentWindowErrorProc, &result);
-#endif
- XReparentWindow(display, window, newParent, x, y);
-#if !defined(WIN32) && !defined(MAC_OSX_TCL)
- Tk_DeleteErrorHandler(handler);
-#endif
- XSync(display, False);
- return result;
-}
-
-int
-Blt_GetWindowFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Window *windowPtr)
-{
- const char *string;
-
- string = Tcl_GetString(objPtr);
- if (string[0] == '.') {
- Tk_Window tkwin;
-
- tkwin = Tk_NameToWindow(interp, string, Tk_MainWindow(interp));
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_WindowId(tkwin) == None) {
- Tk_MakeWindowExist(tkwin);
- }
- *windowPtr = (Tk_IsTopLevel(tkwin)) ? Blt_GetWindowId(tkwin) :
- Tk_WindowId(tkwin);
- } else if (strcmp(string, "root") == 0) {
- *windowPtr = Tk_RootWindow(Tk_MainWindow(interp));
- } else {
-
- int id;
-
- if (Tcl_GetIntFromObj(interp, objPtr, &id) != TCL_OK) {
- return TCL_ERROR;
- }
- *windowPtr = (Window)id;
- }
- return TCL_OK;
-}
-
diff --git a/blt3.0.1/src/bltUtil.c b/blt3.0.1/src/bltUtil.c
deleted file mode 100644
index a5fca81..0000000
--- a/blt3.0.1/src/bltUtil.c
+++ /dev/null
@@ -1,1376 +0,0 @@
-
-/*
- * bltUtil.c --
- *
- * This module implements utility procedures for the BLT toolkit.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include <stdarg.h>
-#include <bltHash.h>
-#include <bltDBuffer.h>
-
-#ifndef HAVE_STRTOLOWER
-void
-strtolower(char *s)
-{
- while (*s != '\0') {
- *s = tolower(UCHAR(*s));
- s++;
- }
-}
-#endif /* !HAVE_STRTOLOWER */
-
-#ifndef HAVE_STRCASECMP
-
-static unsigned char caseTable[] =
-{
- (unsigned char)'\000', (unsigned char)'\001',
- (unsigned char)'\002', (unsigned char)'\003',
- (unsigned char)'\004', (unsigned char)'\005',
- (unsigned char)'\006', (unsigned char)'\007',
- (unsigned char)'\010', (unsigned char)'\011',
- (unsigned char)'\012', (unsigned char)'\013',
- (unsigned char)'\014', (unsigned char)'\015',
- (unsigned char)'\016', (unsigned char)'\017',
- (unsigned char)'\020', (unsigned char)'\021',
- (unsigned char)'\022', (unsigned char)'\023',
- (unsigned char)'\024', (unsigned char)'\025',
- (unsigned char)'\026', (unsigned char)'\027',
- (unsigned char)'\030', (unsigned char)'\031',
- (unsigned char)'\032', (unsigned char)'\033',
- (unsigned char)'\034', (unsigned char)'\035',
- (unsigned char)'\036', (unsigned char)'\037',
- (unsigned char)'\040', (unsigned char)'\041',
- (unsigned char)'\042', (unsigned char)'\043',
- (unsigned char)'\044', (unsigned char)'\045',
- (unsigned char)'\046', (unsigned char)'\047',
- (unsigned char)'\050', (unsigned char)'\051',
- (unsigned char)'\052', (unsigned char)'\053',
- (unsigned char)'\054', (unsigned char)'\055',
- (unsigned char)'\056', (unsigned char)'\057',
- (unsigned char)'\060', (unsigned char)'\061',
- (unsigned char)'\062', (unsigned char)'\063',
- (unsigned char)'\064', (unsigned char)'\065',
- (unsigned char)'\066', (unsigned char)'\067',
- (unsigned char)'\070', (unsigned char)'\071',
- (unsigned char)'\072', (unsigned char)'\073',
- (unsigned char)'\074', (unsigned char)'\075',
- (unsigned char)'\076', (unsigned char)'\077',
- (unsigned char)'\100', (unsigned char)'\141',
- (unsigned char)'\142', (unsigned char)'\143',
- (unsigned char)'\144', (unsigned char)'\145',
- (unsigned char)'\146', (unsigned char)'\147',
- (unsigned char)'\150', (unsigned char)'\151',
- (unsigned char)'\152', (unsigned char)'\153',
- (unsigned char)'\154', (unsigned char)'\155',
- (unsigned char)'\156', (unsigned char)'\157',
- (unsigned char)'\160', (unsigned char)'\161',
- (unsigned char)'\162', (unsigned char)'\163',
- (unsigned char)'\164', (unsigned char)'\165',
- (unsigned char)'\166', (unsigned char)'\167',
- (unsigned char)'\170', (unsigned char)'\171',
- (unsigned char)'\172', (unsigned char)'\133',
- (unsigned char)'\134', (unsigned char)'\135',
- (unsigned char)'\136', (unsigned char)'\137',
- (unsigned char)'\140', (unsigned char)'\141',
- (unsigned char)'\142', (unsigned char)'\143',
- (unsigned char)'\144', (unsigned char)'\145',
- (unsigned char)'\146', (unsigned char)'\147',
- (unsigned char)'\150', (unsigned char)'\151',
- (unsigned char)'\152', (unsigned char)'\153',
- (unsigned char)'\154', (unsigned char)'\155',
- (unsigned char)'\156', (unsigned char)'\157',
- (unsigned char)'\160', (unsigned char)'\161',
- (unsigned char)'\162', (unsigned char)'\163',
- (unsigned char)'\164', (unsigned char)'\165',
- (unsigned char)'\166', (unsigned char)'\167',
- (unsigned char)'\170', (unsigned char)'\171',
- (unsigned char)'\172', (unsigned char)'\173',
- (unsigned char)'\174', (unsigned char)'\175',
- (unsigned char)'\176', (unsigned char)'\177',
- (unsigned char)'\200', (unsigned char)'\201',
- (unsigned char)'\202', (unsigned char)'\203',
- (unsigned char)'\204', (unsigned char)'\205',
- (unsigned char)'\206', (unsigned char)'\207',
- (unsigned char)'\210', (unsigned char)'\211',
- (unsigned char)'\212', (unsigned char)'\213',
- (unsigned char)'\214', (unsigned char)'\215',
- (unsigned char)'\216', (unsigned char)'\217',
- (unsigned char)'\220', (unsigned char)'\221',
- (unsigned char)'\222', (unsigned char)'\223',
- (unsigned char)'\224', (unsigned char)'\225',
- (unsigned char)'\226', (unsigned char)'\227',
- (unsigned char)'\230', (unsigned char)'\231',
- (unsigned char)'\232', (unsigned char)'\233',
- (unsigned char)'\234', (unsigned char)'\235',
- (unsigned char)'\236', (unsigned char)'\237',
- (unsigned char)'\240', (unsigned char)'\241',
- (unsigned char)'\242', (unsigned char)'\243',
- (unsigned char)'\244', (unsigned char)'\245',
- (unsigned char)'\246', (unsigned char)'\247',
- (unsigned char)'\250', (unsigned char)'\251',
- (unsigned char)'\252', (unsigned char)'\253',
- (unsigned char)'\254', (unsigned char)'\255',
- (unsigned char)'\256', (unsigned char)'\257',
- (unsigned char)'\260', (unsigned char)'\261',
- (unsigned char)'\262', (unsigned char)'\263',
- (unsigned char)'\264', (unsigned char)'\265',
- (unsigned char)'\266', (unsigned char)'\267',
- (unsigned char)'\270', (unsigned char)'\271',
- (unsigned char)'\272', (unsigned char)'\273',
- (unsigned char)'\274', (unsigned char)'\275',
- (unsigned char)'\276', (unsigned char)'\277',
- (unsigned char)'\300', (unsigned char)'\341',
- (unsigned char)'\342', (unsigned char)'\343',
- (unsigned char)'\344', (unsigned char)'\345',
- (unsigned char)'\346', (unsigned char)'\347',
- (unsigned char)'\350', (unsigned char)'\351',
- (unsigned char)'\352', (unsigned char)'\353',
- (unsigned char)'\354', (unsigned char)'\355',
- (unsigned char)'\356', (unsigned char)'\357',
- (unsigned char)'\360', (unsigned char)'\361',
- (unsigned char)'\362', (unsigned char)'\363',
- (unsigned char)'\364', (unsigned char)'\365',
- (unsigned char)'\366', (unsigned char)'\367',
- (unsigned char)'\370', (unsigned char)'\371',
- (unsigned char)'\372', (unsigned char)'\333',
- (unsigned char)'\334', (unsigned char)'\335',
- (unsigned char)'\336', (unsigned char)'\337',
- (unsigned char)'\340', (unsigned char)'\341',
- (unsigned char)'\342', (unsigned char)'\343',
- (unsigned char)'\344', (unsigned char)'\345',
- (unsigned char)'\346', (unsigned char)'\347',
- (unsigned char)'\350', (unsigned char)'\351',
- (unsigned char)'\352', (unsigned char)'\353',
- (unsigned char)'\354', (unsigned char)'\355',
- (unsigned char)'\356', (unsigned char)'\357',
- (unsigned char)'\360', (unsigned char)'\361',
- (unsigned char)'\362', (unsigned char)'\363',
- (unsigned char)'\364', (unsigned char)'\365',
- (unsigned char)'\366', (unsigned char)'\367',
- (unsigned char)'\370', (unsigned char)'\371',
- (unsigned char)'\372', (unsigned char)'\373',
- (unsigned char)'\374', (unsigned char)'\375',
- (unsigned char)'\376', (unsigned char)'\377',
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * strcasecmp --
- *
- * Compare two strings, disregarding case.
- *
- * Results:
- * Returns a signed integer representing the following:
- *
- * zero - two strings are equal
- * negative - first string is less than second
- * positive - first string is greater than second
- *
- *---------------------------------------------------------------------------
- */
-int
-strcasecmp(const char *s1, const char *s2)
-{
- unsigned char *s = (unsigned char *)s1;
- unsigned char *t = (unsigned char *)s2;
-
- for ( /* empty */ ; (caseTable[*s] == caseTable[*t]); s++, t++) {
- if (*s == '\0') {
- return 0;
- }
- }
- return (caseTable[*s] - caseTable[*t]);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * strncasecmp --
- *
- * Compare two strings, disregarding case, up to a given length.
- *
- * Results:
- * Returns a signed integer representing the following:
- *
- * zero - two strings are equal
- * negative - first string is less than second
- * positive - first string is greater than second
- *
- *---------------------------------------------------------------------------
- */
-int
-strncasecmp(const char *s1, const char *s2, size_t length)
-{
- unsigned char *s = (unsigned char *)s1;
- unsigned char *t = (unsigned char *)s2;
-
- for ( /* empty */ ; (length > 0); s++, t++, length--) {
- if (caseTable[*s] != caseTable[*t]) {
- return (caseTable[*s] - caseTable[*t]);
- }
- if (*s == '\0') {
- return 0;
- }
- }
- return 0;
-}
-
-#endif /* !HAVE_STRCASECMP */
-
-
-#if !HAVE_DRAND48
-#define XDR48 0x000100010001LL
-#define MNDR48 0x0005deece66dLL
-#define DODDR48 0xbLL
-
-static long long int xdr48 = XDR48;
-double
-drand48(void) // works only on compilers with long long int!
-{
- xdr48 = MNDR48 * xdr48 + DODDR48;
- xdr48 &= 0xffffffffffffLL;
- return xdr48 / 281474976710656.0;
-}
-
-// Random number generator initialization
-// parameters:
-// s - seed
-// return:
-void
-srand48(long x0)
-{
- xdr48 = ((unsigned long)x0<<16) + 0x330e;
-}
-#endif /*HAVE_DRAND48*/
-
-#if (_TCL_VERSION < _VERSION(8,1,0))
-
-char *
-Tcl_GetString(Tcl_Obj *objPtr)
-{
- unsigned int dummy;
-
- return Tcl_GetStringFromObj(objPtr, &dummy);
-}
-
-int
-Tcl_EvalObjv(Tcl_Interp *interp, int objc, Tcl_Obj **objv, int flags)
-{
- Tcl_DString dString;
- int i;
- int result;
-
- Tcl_DStringInit(&dString);
- for (i = 0; i < objc; i++) {
- Tcl_DStringAppendElement(&dString, Tcl_GetString(objv[i]));
- }
- result = Tcl_Eval(interp, Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- return result;
-}
-
-int
-Tcl_WriteObj(Tcl_Channel channel, Tcl_Obj *objPtr)
-{
- char *string;
- int nBytes;
-
- string = Tcl_GetStringFromObj(objPtr, &nBytes);
- return Tcl_Write(channel, string, nBytes);
-}
-
-char *
-Tcl_SetVar2Ex(
- Tcl_Interp *interp,
- char *part1,
- char *part2,
- Tcl_Obj *objPtr,
- int flags)
-{
- return Tcl_SetVar2(interp, part1, part2, Tcl_GetString(objPtr), flags);
-}
-
-Tcl_Obj *
-Tcl_GetVar2Ex(
- Tcl_Interp *interp,
- char *part1,
- char *part2,
- int flags)
-{
- char *result;
-
- result = Tcl_GetVar2(interp, part1, part2, flags);
- if (result == NULL) {
- return NULL;
- }
- return Tcl_NewStringObj(result, -1);
-}
-
-#endif
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetDoubleFromString --
- *
- * Converts a string into a double precision number. This differs from
- * Tcl's version in that it also allows NaN and +/-Inf. There are
- * cases where NaNs are used to indicate holes in the data.
- *
- * Results:
- * Returns a standard Tcl result.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetDoubleFromString(Tcl_Interp *interp, const char *s, double *valuePtr)
-{
- char *end;
- double d;
-
- errno = 0;
- d = strtod(s, &end); /* INTL: Tcl source. */
- if (end == s) {
- badDouble:
- if (interp != (Tcl_Interp *) NULL) {
- Tcl_AppendResult(interp,
- "expected floating-point number but got \"", s, "\"",
- (char *) NULL);
- }
- return TCL_ERROR;
- }
- if (errno != 0 && (d == HUGE_VAL || d == -HUGE_VAL || d == 0)) {
- if (interp != (Tcl_Interp *) NULL) {
- char msg[64 + TCL_INTEGER_SPACE];
-
- sprintf(msg, "unknown floating-point error, errno = %d", errno);
- Tcl_AppendToObj(Tcl_GetObjResult(interp), msg, -1);
- Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", msg, (char *) NULL);
- }
- return TCL_ERROR;
- }
- while ((*end != 0) && isspace(UCHAR(*end))) { /* INTL: ISO space. */
- end++;
- }
- if (*end != 0) {
- goto badDouble;
- }
- *valuePtr = d;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetDoubleFromString --
- *
- * Converts a Tcl_Obj into a double precision number. This differs from
- * Tcl's version in that it also allows NaN and +/-Inf. There are
- * cases where NaNs are used to indicate holes in the data.
- *
- * Results:
- * Returns a standard Tcl result.
- *
- * Side Effects:
- * tclDoubleType is no longer available (in 8.5) as a global variable.
- * We have to get a double obj and save its type pointer.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetDoubleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, double *valuePtr)
-{
- const char *string;
- static Tcl_ObjType *tclDoubleTypePtr = NULL;
-
- if (tclDoubleTypePtr == NULL) {
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewDoubleObj(0.0);
- tclDoubleTypePtr = objPtr->typePtr;
- Tcl_DecrRefCount(objPtr);
- }
- if (objPtr->typePtr == tclDoubleTypePtr) {
- *valuePtr = objPtr->internalRep.doubleValue;
- return TCL_OK;
- }
- string = Tcl_GetString(objPtr);
- return Blt_GetDoubleFromString(interp, string, valuePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_CompareDictionary
- *
- * This function compares two strings as if they were being used in
- * an index or card catalog. The case of alphabetic characters is
- * ignored, except to break ties. Thus "B" comes before "b" but
- * after "a". Also, integers embedded in the strings compare in
- * numerical order. In other words, "x10y" comes after "x9y", not
- * before it as it would when using strcmp().
- *
- * Results:
- * A negative result means that the first element comes before the
- * second, and a positive result means that the second element
- * should come first. A result of zero means the two elements
- * are equal and it doesn't matter which comes first.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-#if HAVE_UTF
-int
-Blt_DictionaryCompare(const char *left, const char *right)
-{
- Tcl_UniChar uniLeft, uniRight, uniLeftLower, uniRightLower;
- int diff, zeros;
- int secondaryDiff = 0;
-
- for(;;) {
- if ((isdigit(UCHAR(*right))) && (isdigit(UCHAR(*left)))) {
- /*
- * There are decimal numbers embedded in the two strings. Compare
- * them as numbers, rather than strings. If one number has more
- * leading zeros than the other, the number with more leading
- * zeros sorts later, but only as a secondary choice.
- */
-
- zeros = 0;
- while ((*right == '0') && (isdigit(UCHAR(right[1])))) {
- right++;
- zeros--;
- }
- while ((*left == '0') && (isdigit(UCHAR(left[1])))) {
- left++;
- zeros++;
- }
- if (secondaryDiff == 0) {
- secondaryDiff = zeros;
- }
-
- /*
- * The code below compares the numbers in the two strings without
- * ever converting them to integers. It does this by first
- * comparing the lengths of the numbers and then comparing the
- * digit values.
- */
-
- diff = 0;
- for (;;) {
- if (diff == 0) {
- diff = UCHAR(*left) - UCHAR(*right);
- }
- right++;
- left++;
-
- /* Ignore commas in numbers. */
- if (*left == ',') {
- left++;
- }
- if (*right == ',') {
- right++;
- }
-
- if (!isdigit(UCHAR(*right))) { /* INTL: digit */
- if (isdigit(UCHAR(*left))) { /* INTL: digit */
- return 1;
- } else {
- /*
- * The two numbers have the same length. See
- * if their values are different.
- */
-
- if (diff != 0) {
- return diff;
- }
- break;
- }
- } else if (!isdigit(UCHAR(*left))) { /* INTL: digit */
- return -1;
- }
- }
- continue;
- }
-
- /*
- * Convert character to Unicode for comparison purposes. If either
- * string is at the terminating null, do a byte-wise comparison and
- * bail out immediately.
- */
- if ((*left != '\0') && (*right != '\0')) {
- left += Tcl_UtfToUniChar(left, &uniLeft);
- right += Tcl_UtfToUniChar(right, &uniRight);
- /*
- * Convert both chars to lower for the comparison, because
- * dictionary sorts are case insensitve. Convert to lower, not
- * upper, so chars between Z and a will sort before A (where most
- * other interesting punctuations occur)
- */
- uniLeftLower = Tcl_UniCharToLower(uniLeft);
- uniRightLower = Tcl_UniCharToLower(uniRight);
- } else {
- diff = UCHAR(*left) - UCHAR(*right);
- break;
- }
-
- diff = uniLeftLower - uniRightLower;
- if (diff) {
- return diff;
- } else if (secondaryDiff == 0) {
- if (Tcl_UniCharIsUpper(uniLeft) &&
- Tcl_UniCharIsLower(uniRight)) {
- secondaryDiff = -1;
- } else if (Tcl_UniCharIsUpper(uniRight)
- && Tcl_UniCharIsLower(uniLeft)) {
- secondaryDiff = 1;
- }
- }
- }
- if (diff == 0) {
- diff = secondaryDiff;
- }
- return diff;
-}
-
-#else
-
-int
-Blt_DictionaryCompare(const char *left, const char *right)
-{
- int diff, zeros;
- int secondaryDiff = 0;
-
- while (1) {
- if (isdigit(UCHAR(*right)) && isdigit(UCHAR(*left))) {
- /*
- * There are decimal numbers embedded in the two strings. Compare
- * them as numbers, rather than strings. If one number has more
- * leading zeros than the other, the number with more leading
- * zeros sorts later, but only as a secondary choice.
- */
-
- zeros = 0;
- while ((*right == '0') && (isdigit(UCHAR(right[1])))) {
- right++;
- zeros--;
- }
- while ((*left == '0') && (isdigit(UCHAR(left[1])))) {
- left++;
- zeros++;
- }
- if (secondaryDiff == 0) {
- secondaryDiff = zeros;
- }
-
- /*
- * The code below compares the numbers in the two strings without
- * ever converting them to integers. It does this by first
- * comparing the lengths of the numbers and then comparing the
- * digit values.
- */
-
- diff = 0;
- while (1) {
- if (diff == 0) {
- diff = UCHAR(*left) - UCHAR(*right);
- }
- right++;
- left++;
- /* Ignore commas in numbers. */
- if (*left == ',') {
- left++;
- }
- if (*right == ',') {
- right++;
- }
- if (!isdigit(UCHAR(*right))) {
- if (isdigit(UCHAR(*left))) {
- return 1;
- } else {
- /*
- * The two numbers have the same length. See
- * if their values are different.
- */
-
- if (diff != 0) {
- return diff;
- }
- break;
- }
- } else if (!isdigit(UCHAR(*left))) {
- return -1;
- }
- }
- continue;
- }
- diff = UCHAR(*left) - UCHAR(*right);
- if (diff) {
- if (isupper(UCHAR(*left)) && islower(UCHAR(*right))) {
- diff = UCHAR(tolower(*left)) - UCHAR(*right);
- if (diff) {
- return diff;
- } else if (secondaryDiff == 0) {
- secondaryDiff = -1;
- }
- } else if (isupper(UCHAR(*right)) && islower(UCHAR(*left))) {
- diff = UCHAR(*left) - UCHAR(tolower(UCHAR(*right)));
- if (diff) {
- return diff;
- } else if (secondaryDiff == 0) {
- secondaryDiff = 1;
- }
- } else {
- return diff;
- }
- }
- if (*left == 0) {
- break;
- }
- left++;
- right++;
- }
- if (diff == 0) {
- diff = secondaryDiff;
- }
- return diff;
-}
-#endif
-
-#ifndef NDEBUG
-
-void
-Blt_Assert(const char *testExpr, const char *fileName, int lineNumber)
-{
-#ifdef WINDEBUG
- PurifyPrintf("line %d of %s: Assert \"%s\" failed\n", lineNumber,
- fileName, testExpr);
-#endif
- fprintf(stderr, "line %d of %s: Assert \"%s\" failed\n",
- lineNumber, fileName, testExpr);
- fflush(stderr);
- abort();
-}
-#endif /* NDEBUG */
-
-/*ARGSUSED*/
-void
-Blt_Panic TCL_VARARGS_DEF(const char *, arg1)
-{
- const char *format;
- va_list args;
-
- format = TCL_VARARGS_START(const char *, arg1, args);
- vfprintf(stderr, format, args);
- fprintf(stderr, "\n");
- fflush(stderr);
- abort();
-}
-
-void
-Blt_DStringAppendElements
-TCL_VARARGS_DEF(Tcl_DString *, arg1)
-{
- Tcl_DString *dsPtr;
- char *elem;
- va_list args;
-
- dsPtr = TCL_VARARGS_START(Tcl_DString *, arg1, args);
- while ((elem = va_arg(args, char *)) != NULL) {
- Tcl_DStringAppendElement(dsPtr, elem);
- }
- va_end(args);
-}
-
-/*ARGSUSED*/
-#ifndef HAVE_SPRINTF_S
-int
-sprintf_s(char *s, size_t size, const char *fmt, /*args*/ ...)
-{
- va_list ap;
- int n;
-
- va_start(ap, fmt);
- n = vsnprintf(s, size, fmt, ap);
- if ((n != (int)size) && (size > 0)) {
- s[size-1] = '\0';
- }
- va_end(ap);
- return n;
-}
-#endif /* HAVE_SPRINTF_S */
-
-static char stringRep[200];
-
-const char *
-Blt_Itoa(int value)
-{
- sprintf_s(stringRep, 200, "%d", value);
- return stringRep;
-}
-
-const char *
-Blt_Ltoa(long value)
-{
- sprintf_s(stringRep, 200, "%ld", value);
- return stringRep;
-}
-
-const char *
-Blt_Utoa(unsigned int value)
-{
- sprintf_s(stringRep, 200, "%u", value);
- return stringRep;
-}
-
-const char *
-Blt_Dtoa(Tcl_Interp *interp, double value)
-{
- Tcl_PrintDouble(interp, value, stringRep);
- return stringRep;
-}
-
-FILE *
-Blt_OpenFile(Tcl_Interp *interp, const char *fileName, const char *mode)
-{
- FILE *f;
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- Tcl_DString dString, nativeDString;
- char *native;
-
- native = Tcl_TranslateFileName(interp, fileName, &nativeDString);
- if (native == NULL) {
- return NULL;
- }
- fileName = Tcl_UtfToExternalDString(NULL, native, -1, &dString);
- if (fileName == NULL) {
- Tcl_AppendResult(interp, "can't convert filename \"", native,
- "\" to system encoding", (char *)NULL);
- Tcl_DStringFree(&nativeDString);
- return NULL;
- }
- f = fopen(fileName, mode);
-#else
- f = fopen(fileName, mode);
-#endif
- if (f == NULL) {
- Tcl_AppendResult(interp, "can't open \"", fileName, "\": ",
- Tcl_PosixError(interp), (char *)NULL);
- }
- Tcl_DStringFree(&dString);
- Tcl_DStringFree(&nativeDString);
- return f;
-}
-
-int
-Blt_GlobalEvalObjv(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
- int result;
-
- for (i = 0; i < objc; i++) {
- Tcl_IncrRefCount(objv[i]);
- }
- result = Tcl_EvalObjv(interp, objc, objv, TCL_EVAL_GLOBAL);
- for (i = 0; i < objc; i++) {
- Tcl_DecrRefCount(objv[i]);
- }
- return result;
-}
-
-int
-Blt_GlobalEvalListObj(Tcl_Interp *interp, Tcl_Obj *cmdObjPtr)
-{
- Tcl_Obj **objv;
- int objc;
- int i;
- int result;
-
- if (Tcl_ListObjGetElements(interp, cmdObjPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 0; i < objc; i++) {
- Tcl_IncrRefCount(objv[i]);
- }
- result = Tcl_EvalObjv(interp, objc, objv, TCL_EVAL_GLOBAL);
- for (i = 0; i < objc; i++) {
- Tcl_DecrRefCount(objv[i]);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_InitHexTable --
- *
- * Table index for the hex values. Initialized once, first time. Used
- * for translation value or delimiter significance lookup.
- *
- * We build the table at run time for several reasons:
- *
- * 1. portable to non-ASCII machines.
- * 2. still reentrant since we set the init flag after setting
- * table.
- * 3. easier to extend.
- * 4. less prone to bugs.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_InitHexTable(unsigned char *hexTable)
-{
- memset(hexTable, 0xFF, 256);
- hexTable['0'] = 0;
- hexTable['1'] = 1;
- hexTable['2'] = 2;
- hexTable['3'] = 3;
- hexTable['4'] = 4;
- hexTable['5'] = 5;
- hexTable['6'] = 6;
- hexTable['7'] = 7;
- hexTable['8'] = 8;
- hexTable['9'] = 9;
- hexTable['a'] = hexTable['A'] = 10;
- hexTable['b'] = hexTable['B'] = 11;
- hexTable['c'] = hexTable['C'] = 12;
- hexTable['d'] = hexTable['D'] = 13;
- hexTable['e'] = hexTable['E'] = 14;
- hexTable['f'] = hexTable['F'] = 15;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPosition --
- *
- * Convert a string representing a numeric position. A position can be
- * in one of the following forms.
- *
- * number - number of the item in the hierarchy, indexed
- * from zero.
- * "end" - last position in the hierarchy.
- *
- * Results:
- * A standard TCL result. If "string" is a valid index, then *indexPtr
- * is filled with the corresponding numeric index. If "end" was selected
- * then *indexPtr is set to -1. Otherwise an error message is left in
- * interp->result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetPosition(
- Tcl_Interp *interp, /* Interpreter to report results back
- * to. */
- const char *string, /* String representation of the index.
- * Can be an integer or "end" to refer
- * to the last index. */
- long *indexPtr) /* Holds the converted index. */
-{
- if ((string[0] == 'e') && (strcmp(string, "end") == 0)) {
- *indexPtr = -1; /* Indicates last position in
- * hierarchy. */
- } else {
- long position;
-
- if (Tcl_GetLong(interp, string, &position) != TCL_OK) {
- return TCL_ERROR;
- }
- if (position < 0) {
- Tcl_AppendResult(interp, "bad position \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- *indexPtr = position;
- }
- return TCL_OK;
-}
-
-int
-Blt_GetCountFromObj(
- Tcl_Interp *interp,
- Tcl_Obj *objPtr,
- int check, /* Can be COUNT_POS, COUNT_NNEG,
- * or COUNT_ANY, */
- long *valuePtr)
-{
- long count;
-
- if (Tcl_GetLongFromObj(interp, objPtr, &count) != TCL_OK) {
- return TCL_ERROR;
- }
- switch (check) {
- case COUNT_NNEG:
- if (count < 0) {
- Tcl_AppendResult(interp, "bad value \"", Tcl_GetString(objPtr),
- "\": can't be negative", (char *)NULL);
- return TCL_ERROR;
- }
- break;
- case COUNT_POS:
- if (count <= 0) {
- Tcl_AppendResult(interp, "bad value \"", Tcl_GetString(objPtr),
- "\": must be positive", (char *)NULL);
- return TCL_ERROR;
- }
- break;
- case COUNT_ANY:
- break;
- }
- *valuePtr = count;
- return TCL_OK;
-}
-
-/*
- * The hash table below is used to keep track of all the Blt_Uids created
- * so far.
- */
-static Blt_HashTable uidTable;
-static int uidInitialized = 0;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetUid --
- *
- * Given a string, returns a unique identifier for the string. A
- * reference count is maintained, so that the identifier can be freed
- * when it is not needed any more. This can be used in many places to
- * replace Tcl_GetUid.
- *
- * Results:
- * This procedure returns a Blt_Uid corresponding to the "string"
- * argument. The Blt_Uid has a string value identical to string (strcmp
- * will return 0), but it's guaranteed that any other calls to this
- * procedure with a string equal to "string" will return exactly the same
- * result (i.e. can compare Blt_Uid *values* directly, without having to
- * call strcmp on what they point to).
- *
- * Side effects:
- * New information may be entered into the identifier table.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Uid
-Blt_GetUid(const char *string) /* String to convert. */
-{
- Blt_HashEntry *hPtr;
- int isNew;
- size_t refCount;
-
- if (!uidInitialized) {
- Blt_InitHashTable(&uidTable, BLT_STRING_KEYS);
- uidInitialized = 1;
- }
- hPtr = Blt_CreateHashEntry(&uidTable, string, &isNew);
- if (isNew) {
- refCount = 0;
- } else {
- refCount = (size_t)Blt_GetHashValue(hPtr);
- }
- refCount++;
- Blt_SetHashValue(hPtr, (ClientData)refCount);
- return (Blt_Uid)Blt_GetHashKey(&uidTable, hPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FreeUid --
- *
- * Frees the Blt_Uid if there are no more clients using this identifier.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The identifier may be deleted from the identifier table.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FreeUid(Blt_Uid uid) /* Identifier to release. */
-{
- Blt_HashEntry *hPtr;
-
- if (!uidInitialized) {
- Blt_InitHashTable(&uidTable, BLT_STRING_KEYS);
- uidInitialized = 1;
- }
- hPtr = Blt_FindHashEntry(&uidTable, uid);
- if (hPtr) {
- size_t refCount;
-
- refCount = (size_t)Blt_GetHashValue(hPtr);
- refCount--;
- if (refCount == 0) {
- Blt_DeleteHashEntry(&uidTable, hPtr);
- } else {
- Blt_SetHashValue(hPtr, refCount);
- }
- } else {
- fprintf(stderr, "tried to release unknown identifier \"%s\"\n", uid);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FindUid --
- *
- * Returns a Blt_Uid associated with a given string, if one exists.
- *
- * Results:
- * A Blt_Uid for the string if one exists. Otherwise NULL.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Uid
-Blt_FindUid(const char *string) /* String to find. */
-{
- Blt_HashEntry *hPtr;
-
- if (!uidInitialized) {
- Blt_InitHashTable(&uidTable, BLT_STRING_KEYS);
- uidInitialized = 1;
- }
- hPtr = Blt_FindHashEntry(&uidTable, string);
- if (hPtr == NULL) {
- return NULL;
- }
- return (Blt_Uid) Blt_GetHashKey(&uidTable, hPtr);
-}
-
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * BinaryOpSearch --
- *
- * Performs a binary search on the array of command operation
- * specifications to find a partial, anchored match for the given
- * operation string.
- *
- * Results:
- * If the string matches unambiguously the index of the specification in
- * the array is returned. If the string does not match, even as an
- * abbreviation, any operation, -1 is returned. If the string matches,
- * but ambiguously -2 is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-BinaryOpSearch(Blt_OpSpec *specs, int nSpecs, const char *string, int length)
-{
- char c;
- int high, low;
-
- low = 0;
- high = nSpecs - 1;
- c = string[0];
- while (low <= high) {
- Blt_OpSpec *specPtr;
- int compare;
- int median;
-
- median = (low + high) >> 1;
- specPtr = specs + median;
-
- /* Test the first character */
- compare = c - specPtr->name[0];
- if (compare == 0) {
- /* Now test the entire string */
- compare = strncmp(string, specPtr->name, length);
- if (compare == 0) {
- if ((int)length < specPtr->minChars) {
- return -2; /* Ambiguous operation name */
- }
- }
- }
- if (compare < 0) {
- high = median - 1;
- } else if (compare > 0) {
- low = median + 1;
- } else {
- return median; /* Op found. */
- }
- }
- return -1; /* Can't find operation */
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * LinearOpSearch --
- *
- * Performs a binary search on the array of command operation
- * specifications to find a partial, anchored match for the given
- * operation string.
- *
- * Results:
- * If the string matches unambiguously the index of the specification in
- * the array is returned. If the string does not match, even as an
- * abbreviation, any operation, -1 is returned. If the string matches,
- * but ambiguously -2 is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-LinearOpSearch(Blt_OpSpec *specs, int nSpecs, const char *string, int length)
-{
- Blt_OpSpec *specPtr;
- char c;
- int nMatches, last;
- int i;
-
- c = string[0];
- nMatches = 0;
- last = -1;
- for (specPtr = specs, i = 0; i < nSpecs; i++, specPtr++) {
- if ((c == specPtr->name[0]) &&
- (strncmp(string, specPtr->name, length) == 0)) {
- last = i;
- nMatches++;
- if ((int)length == specPtr->minChars) {
- break;
- }
- }
- }
- if (nMatches > 1) {
- return -2; /* Ambiguous operation name */
- }
- if (nMatches == 0) {
- return -1; /* Can't find operation */
- }
- return last; /* Op found. */
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetOpFromObj --
- *
- * Find the command operation given a string name. This is useful where
- * a group of command operations have the same argument signature.
- *
- * Results:
- * If found, a pointer to the procedure (function pointer) is returned.
- * Otherwise NULL is returned and an error message containing a list of
- * the possible commands is returned in interp->result.
- *
- *---------------------------------------------------------------------------
- */
-void *
-Blt_GetOpFromObj(
- Tcl_Interp *interp, /* Interpreter to report errors to */
- int nSpecs, /* # of specifications in array */
- Blt_OpSpec *specs, /* Op specification array */
- int operPos, /* Position of operation in argument
- * list. */
- int objc, /* # of arguments in the argument *
- * vector. This includes any
- * prefixed arguments */
- Tcl_Obj *const *objv, /* Argument vector */
- int flags)
-{
- Blt_OpSpec *specPtr;
- const char *string;
- int length;
- int n;
-
- if (objc <= operPos) { /* No operation argument */
- Tcl_AppendResult(interp, "wrong # args: ", (char *)NULL);
- usage:
- Tcl_AppendResult(interp, "should be one of...", (char *)NULL);
- for (n = 0; n < nSpecs; n++) {
- int i;
-
- Tcl_AppendResult(interp, "\n ", (char *)NULL);
- for (i = 0; i < operPos; i++) {
- Tcl_AppendResult(interp, Tcl_GetString(objv[i]), " ",
- (char *)NULL);
- }
- specPtr = specs + n;
- Tcl_AppendResult(interp, specPtr->name, " ", specPtr->usage,
- (char *)NULL);
- }
- return NULL;
- }
- string = Tcl_GetStringFromObj(objv[operPos], &length);
- if (flags & BLT_OP_LINEAR_SEARCH) {
- n = LinearOpSearch(specs, nSpecs, string, length);
- } else {
- n = BinaryOpSearch(specs, nSpecs, string, length);
- }
- if (n == -2) {
- char c;
-
- Tcl_AppendResult(interp, "ambiguous", (char *)NULL);
- if (operPos > 2) {
- Tcl_AppendResult(interp, " ", Tcl_GetString(objv[operPos - 1]),
- (char *)NULL);
- }
- Tcl_AppendResult(interp, " operation \"", string, "\" matches: ",
- (char *)NULL);
-
- c = string[0];
- for (n = 0; n < nSpecs; n++) {
- specPtr = specs + n;
- if ((c == specPtr->name[0]) &&
- (strncmp(string, specPtr->name, length) == 0)) {
- Tcl_AppendResult(interp, " ", specPtr->name, (char *)NULL);
- }
- }
- return NULL;
-
- } else if (n == -1) { /* Can't find operation, display help */
- Tcl_AppendResult(interp, "bad", (char *)NULL);
- if (operPos > 2) {
- Tcl_AppendResult(interp, " ", Tcl_GetString(objv[operPos - 1]),
- (char *)NULL);
- }
- Tcl_AppendResult(interp, " operation \"", string, "\": ", (char *)NULL);
- goto usage;
- }
- specPtr = specs + n;
- if ((objc < specPtr->minArgs) ||
- ((specPtr->maxArgs > 0) && (objc > specPtr->maxArgs))) {
- int i;
-
- Tcl_AppendResult(interp, "wrong # args: should be \"", (char *)NULL);
- for (i = 0; i < operPos; i++) {
- Tcl_AppendResult(interp, Tcl_GetString(objv[i]), " ",
- (char *)NULL);
- }
- Tcl_AppendResult(interp, specPtr->name, " ", specPtr->usage, "\"",
- (char *)NULL);
- return NULL;
- }
- return specPtr->proc;
-}
-
-#if (_TCL_VERSION >= _VERSION(8,4,0))
-/*ARGSUSED*/
-int
-Blt_LoadLibrary(Tcl_Interp *interp, const char *libPath,
- const char *initProcName, const char *safeProcName)
-{
- Tcl_FSUnloadFileProc *unLoadProcPtr = NULL;
- Tcl_LoadHandle loadHandle;
- Tcl_PackageInitProc *initProc, *safeProc;
- int result;
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(libPath, -1);
- Tcl_IncrRefCount(objPtr);
- result = Tcl_FSLoadFile(interp, objPtr, initProcName, safeProcName,
- &initProc, &safeProc, &loadHandle, &unLoadProcPtr);
- if (result != TCL_OK) {
- goto done;
- }
- if (initProc == NULL) {
- Tcl_AppendResult(interp, "couldn't find procedure ", initProcName,
- (char *) NULL);
- result = TCL_ERROR;
- goto done;
- }
- if (Tcl_IsSafe(interp)) {
- if (safeProc == NULL) {
- Tcl_AppendResult(interp,
- "can't use package in a safe interpreter: no ", safeProcName,
- " procedure", (char *) NULL);
- result = TCL_ERROR;
- goto done;
- }
- result = (*safeProc)(interp);
- } else {
- result = (*initProc)(interp);
- }
- done:
- Tcl_DecrRefCount(objPtr);
- if (result != TCL_OK) {
- if (unLoadProcPtr != NULL) {
- (*unLoadProcPtr)(loadHandle);
- }
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-#else
-int
-Blt_LoadLibrary(Tcl_Interp *interp, const char *libPath,
- const char *initProcName, const char *safeProcName)
-{
- ClientData loadData;
- Tcl_PackageInitProc *initProc, *safeProc;
- int result;
-
- result = TclpLoadFile(interp, libPath, initProcName, safeProcName,
- &initProc, &safeProc, &loadData);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- if (initProc == NULL) {
- Tcl_AppendResult(interp, "couldn't find procedure ", initProcName,
- (char *) NULL);
- result = TCL_ERROR;
- goto done;
- }
- if (Tcl_IsSafe(interp)) {
- if (safeProc == NULL) {
- Tcl_AppendResult(interp,
- "can't use package in a safe interpreter: ", "no ",
- safeProcName, " procedure", (char *) NULL);
- result = TCL_ERROR;
- goto done;
- }
- result = (*safeProc)(interp);
- } else {
- result = (*initProc)(interp);
- }
- done:
- if (result != TCL_OK) {
- TclpUnloadFile(loadData);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-#endif
diff --git a/blt3.0.1/src/bltVar.c b/blt3.0.1/src/bltVar.c
deleted file mode 100644
index db16b65..0000000
--- a/blt3.0.1/src/bltVar.c
+++ /dev/null
@@ -1,43 +0,0 @@
-
-/*
- * bltVar.c --
- *
- * This module implements TCL variable handler procedures for the BLT
- * toolkit.
- *
- * Copyright 1997-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include <bltHash.h>
-#include "bltNsUtil.h"
-#include "bltVar.h"
-#include <bltList.h>
-
-#if (_TK_VERSION > _VERSION(8,5,0))
-#include "bltVar85.c"
-#else
-#include "bltVar84.c"
-#endif
diff --git a/blt3.0.1/src/bltVar.h b/blt3.0.1/src/bltVar.h
deleted file mode 100644
index 811ef34..0000000
--- a/blt3.0.1/src/bltVar.h
+++ /dev/null
@@ -1,62 +0,0 @@
-
-/*
- * bltVar.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_VAR_H
-#define _BLT_VAR_H
-
-/*
- * The following procedures are helper routines to build TCL variables
- * for special variable resolvers.
- */
-BLT_EXTERN Tcl_Var Blt_GetCachedVar(Blt_HashTable *tablePtr, const char *label,
- Tcl_Obj *objPtr);
-
-BLT_EXTERN void Blt_FreeCachedVars(Blt_HashTable *tablePtr);
-
-/*
- * The following declarations are missing from the TCL public API.
- */
-#ifndef USE_TCL_STUBS
-typedef struct _Tcl_ResolvedVarInfo Tcl_ResolvedVarInfo;
-
-typedef int (Tcl_ResolveCmdProc)(Tcl_Interp* interp, const char *name,
- Tcl_Namespace *context, int flags, Tcl_Command *rPtr);
-
-typedef int (Tcl_ResolveVarProc)(Tcl_Interp *interp, const char *name,
- Tcl_Namespace *context, int flags, Tcl_Var *rPtr);
-
-typedef int (Tcl_ResolveCompiledVarProc)(Tcl_Interp* interp, const char *name,
- int length, Tcl_Namespace *context, Tcl_ResolvedVarInfo **rPtr);
-
-BLT_EXTERN void Tcl_SetNamespaceResolvers(Tcl_Namespace *nsPtr,
- Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc,
- Tcl_ResolveCompiledVarProc *compiledVarProc);
-#endif
-
-#endif /* _BLT_VAR_H */
diff --git a/blt3.0.1/src/bltVar84.c b/blt3.0.1/src/bltVar84.c
deleted file mode 100644
index c8b7adc..0000000
--- a/blt3.0.1/src/bltVar84.c
+++ /dev/null
@@ -1,284 +0,0 @@
-
-/*
- * bltVar84.c --
- *
- * This module implements TCL 8.4 variable handler procedures for the BLT
- * toolkit.
- *
- * Copyright 1997-2008 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include <bltHash.h>
-#include "bltNsUtil.h"
-#include "bltVar.h"
-#include <bltList.h>
-
-/*
- * Variable resolver routines.
- *
- * The following bit of magic is from [incr Tcl]. The following routine are
- * taken from [incr Tcl] to roughly duplicate how TCL internally creates
- * variables.
- *
- * Note: There is no API for the variable resolver routines in the Tcl
- * library. The resolver callback is supposed to return a Tcl_Var
- * back. But the definition of Tcl_Var in tcl.h is opaque.
- */
-
-#define VAR_SCALAR 0x1
-#define VAR_ARRAY 0x2
-#define VAR_LINK 0x4
-#define VAR_UNDEFINED 0x8
-#define VAR_IN_HASHTABLE 0x10
-#define VAR_TRACE_ACTIVE 0x20
-#define VAR_ARRAY_ELEMENT 0x40
-#define VAR_NAMESPACE_VAR 0x80
-
-#define VAR_ARGUMENT 0x100
-#define VAR_TEMPORARY 0x200
-#define VAR_RESOLVED 0x400
-
-typedef struct ArraySearch ArraySearch;
-typedef struct VarTrace VarTrace;
-typedef struct Namespace Namespace;
-
-typedef struct Var {
- union {
- Tcl_Obj *objPtr; /* The variable's object value. Used for
- * scalar variables and array elements. */
- Tcl_HashTable *tablePtr;/* For array variables, this points to
- * information about the hash table used to
- * implement the associative array. Points to
- * malloc-ed data. */
- struct Var *linkPtr; /* If this is a global variable being referred
- * to in a procedure, or a variable created by
- * "upvar", this field points to the
- * referenced variable's Var struct. */
- } value;
- char *name; /* NULL if the variable is in a hashtable,
- * otherwise points to the variable's name. It
- * is used, e.g., by TclLookupVar and "info
- * locals". The storage for the characters of
- * the name is not owned by the Var and must
- * not be freed when freeing the Var. */
- Namespace *nsPtr; /* Points to the namespace that contains this
- * variable or NULL if the variable is a local
- * variable in a TCL procedure. */
- Tcl_HashEntry *hPtr; /* If variable is in a hashtable, either the
- * hash table entry that refers to this
- * variable or NULL if the variable has been
- * detached from its hash table (e.g. an array
- * is deleted, but some of its elements are
- * still referred to in upvars). NULL if the
- * variable is not in a hashtable. This is
- * used to delete an variable from its
- * hashtable if it is no longer needed. */
- int refCount; /* Counts number of active uses of this
- * variable, not including its entry in the
- * call frame or the hash table: 1 for each
- * additional variable whose linkPtr points
- * here, 1 for each nested trace active on
- * variable, and 1 if the variable is a
- * namespace variable. This record can't be
- * deleted until refCount becomes 0. */
- VarTrace *tracePtr; /* First in list of all traces set for this
- * variable. */
- ArraySearch *searchPtr; /* First in list of all searches active for
- * this variable, or NULL if none. */
- int flags; /* Miscellaneous bits of information about
- * variable. See below for definitions. */
-} Var;
-
-static INLINE Tcl_Namespace *
-NamespaceOfVariable(Tcl_Var var)
-{
- Var *varPtr = (Var *)var;
-
- return (Tcl_Namespace *)varPtr->nsPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewVar --
- *
- * Create a new heap-allocated variable that will eventually be entered
- * into a hashtable.
- *
- * Results:
- * The return value is a pointer to the new variable structure. It is
- * marked as a scalar variable (and not a link or array variable). Its
- * value initially is NULL. The variable is not part of any hash table
- * yet. Since it will be in a hashtable and not in a call frame, its name
- * field is set NULL. It is initially marked as undefined.
- *
- * Side effects:
- * Storage gets allocated.
- *
- *---------------------------------------------------------------------------
- */
-static Var *
-NewVar(const char *label, Tcl_Obj *objPtr)
-{
- Var *varPtr;
-
- varPtr = Blt_AssertMalloc(sizeof(Var));
- varPtr->value.objPtr = objPtr;
-#ifdef notdef
- if (objPtr != NULL) {
- Tcl_IncrRefCount(objPtr);
- }
-#endif
- varPtr->name = (char *)label;
- varPtr->nsPtr = NULL;
- /*
- * NOTE: TCL reports a "dangling upvar" error for variables
- * with a null "hPtr" field. Put something non-zero
- * in here to keep Tcl_SetVar2() happy. The only time
- * this field is really used is it remove a variable
- * from the hash table that contains it in CleanupVar,
- * but since these variables are protected by their
- * higher refCount, they will not be deleted by CleanupVar
- * anyway. These variables are unset and removed in
- * FreeCachedVars.
- */
- varPtr->hPtr = (Tcl_HashEntry *)0x01;
- varPtr->refCount = 1; /* protect from being deleted */
- varPtr->tracePtr = NULL;
- varPtr->searchPtr = NULL;
- varPtr->flags = (VAR_SCALAR | VAR_IN_HASHTABLE);
- return varPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetVariableNamespace --
- *
- * Returns the namespace context of the named variable. The variable
- * named may be fully qualified or not. Variables in the current
- * namespace supersede the global namespace.
- *
- * Results:
- * Returns the context of the namespace in an opaque type. If return
- * value is NULL, this indicates that the variable is local to the call
- * frame.
- *
- *---------------------------------------------------------------------------
- */
-
-Tcl_Namespace *
-Blt_GetVariableNamespace(Tcl_Interp *interp, const char *path)
-{
- Blt_ObjectName objName;
-
- if (!Blt_ParseObjectName(interp, path, &objName, BLT_NO_DEFAULT_NS)) {
- return NULL;
- }
- if (objName.nsPtr == NULL) {
- Tcl_Var var;
-
- /* Search the current namespace and */
- var = Tcl_FindNamespaceVar(interp, (char *)path, NULL,
- TCL_NAMESPACE_ONLY);
- if (var != NULL) {
- return NamespaceOfVariable(var);
- }
- /* then search the global namespace. */
- var = Tcl_FindNamespaceVar(interp, (char *)path, NULL,
- TCL_GLOBAL_ONLY);
- if (var != NULL) {
- return NamespaceOfVariable(var);
- }
- }
- return objName.nsPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetCachedVar --
- *
- * Returns an opaque TCL variable reference by *name* with the value
- * pointed to by *objPtr*. The purpose of this routine is to return a
- * Tcl_Var for a NamespaceResolver callback and to set the value of that
- * variable. The variable is stored in a hash table associated with the
- * (temporary) namespace.
- *
- * Results:
- * Returns the opaque type of a Tcl_Var.
- *
- * Side Effects:
- * If the variable does not already exist in the hash table, it is
- * created. The value of the variable is set to *objPtr*.
- *
- *---------------------------------------------------------------------------
- */
-
-Tcl_Var
-Blt_GetCachedVar(Blt_HashTable *tablePtr, const char *label, Tcl_Obj *objPtr)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- Var *varPtr;
-
- /* Check if the variable has been cached already. */
- hPtr = Blt_CreateHashEntry(tablePtr, label, &isNew);
- if (isNew) {
- varPtr = NewVar(label, objPtr);
- Blt_SetHashValue(hPtr, varPtr);
- } else {
- varPtr = Blt_GetHashValue(hPtr);
- varPtr->value.objPtr = objPtr;
-#ifdef notdef
- if (objPtr != NULL) {
- Tcl_IncrRefCount(objPtr);
- }
-#endif
- }
- return (Tcl_Var)varPtr;
-}
-
-void
-Blt_FreeCachedVars(Blt_HashTable *tablePtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(tablePtr, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Var *varPtr;
-
- varPtr = Blt_GetHashValue(hPtr);
- varPtr->refCount--;
- if (varPtr->refCount > 1) {
-#ifdef notdef
- if (varPtr->value.objPtr != NULL) {
- Tcl_DecrRefCount(varPtr->value.objPtr);
- }
-#endif
- Blt_Free(varPtr);
- }
- }
- Blt_DeleteHashTable(tablePtr);
-}
diff --git a/blt3.0.1/src/bltVar85.c b/blt3.0.1/src/bltVar85.c
deleted file mode 100644
index e6a7b95..0000000
--- a/blt3.0.1/src/bltVar85.c
+++ /dev/null
@@ -1,465 +0,0 @@
-
-/*
- * bltVar85.c --
- *
- * This module implements TCL 8.5 variable handler procedures for the BLT
- * toolkit.
- *
- * Copyright 1997-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include <bltHash.h>
-#include "bltNsUtil.h"
-#include "bltVar.h"
-#include <bltList.h>
-
-
-/*
- * Variable resolver routines.
- *
- * The following bit of magic is from [incr Tcl]. The following
- * routine are taken from [incr Tcl] to roughly duplicate how Tcl
- * internally creates variables.
- *
- * Note: There is no API for the variable resolver routines in the Tcl
- * library. The resolver callback is supposed to return a Tcl_Var
- * back. But the definition of Tcl_Var in tcl.h is opaque.
- */
-
-typedef struct TclVarHashTable {
- Tcl_HashTable table;
- Tcl_Namespace *nsPtr;
-} TclVarHashTable;
-
-/*
- * The structure below defines a variable, which associates a string name with
- * a Tcl_Obj value. These structures are kept in procedure call frames (for
- * local variables recognized by the compiler) or in the heap (for global
- * variables and any variable not known to the compiler). For each Var
- * structure in the heap, a hash table entry holds the variable name and a
- * pointer to the Var structure.
- */
-
-typedef struct Var {
- int flags; /* Miscellaneous bits of information about
- * variable. See below for definitions. */
- union {
- Tcl_Obj *objPtr; /* The variable's object value. Used for
- * scalar variables and array elements. */
- TclVarHashTable *tablePtr;/* For array variables, this points to
- * information about the hash table used to
- * implement the associative array. Points to
- * ckalloc-ed data. */
- struct Var *linkPtr; /* If this is a global variable being referred
- * to in a procedure, or a variable created by
- * "upvar", this field points to the
- * referenced variable's Var struct. */
- } value;
-} Var;
-
-typedef struct VarInHash {
- Var var;
- int refCount; /* Counts number of active uses of this
- * variable: 1 for the entry in the hash
- * table, 1 for each additional variable whose
- * linkPtr points here, 1 for each nested
- * trace active on variable, and 1 if the
- * variable is a namespace variable. This
- * record can't be deleted until refCount
- * becomes 0. */
- Tcl_HashEntry entry; /* The hash table entry that refers to this
- * variable. This is used to find the name of
- * the variable and to delete it from its
- * hashtable if it is no longer needed. It
- * also holds the variable's name. */
-} VarInHash;
-
-/*
- * Flag bits for variables. The first two (VAR_ARRAY and VAR_LINK) are
- * mutually exclusive and give the "type" of the variable. If none is set,
- * this is a scalar variable.
- *
- * VAR_ARRAY - 1 means this is an array variable rather than
- * a scalar variable or link. The "tablePtr"
- * field points to the array's hashtable for its
- * elements.
- * VAR_LINK - 1 means this Var structure contains a pointer
- * to another Var structure that either has the
- * real value or is itself another VAR_LINK
- * pointer. Variables like this come about
- * through "upvar" and "global" commands, or
- * through references to variables in enclosing
- * namespaces.
- *
- * Flags that indicate the type and status of storage; none is set for
- * compiled local variables (Var structs).
- *
- * VAR_IN_HASHTABLE - 1 means this variable is in a hashtable and
- * the Var structure is malloced. 0 if it is a
- * local variable that was assigned a slot in a
- * procedure frame by the compiler so the Var
- * storage is part of the call frame.
- * VAR_DEAD_HASH 1 means that this var's entry in the hashtable
- * has already been deleted.
- * VAR_ARRAY_ELEMENT - 1 means that this variable is an array
- * element, so it is not legal for it to be an
- * array itself (the VAR_ARRAY flag had better
- * not be set).
- * VAR_NAMESPACE_VAR - 1 means that this variable was declared as a
- * namespace variable. This flag ensures it
- * persists until its namespace is destroyed or
- * until the variable is unset; it will persist
- * even if it has not been initialized and is
- * marked undefined. The variable's refCount is
- * incremented to reflect the "reference" from
- * its namespace.
- *
- * Flag values relating to the variable's trace and search status.
- *
- * VAR_TRACED_READ
- * VAR_TRACED_WRITE
- * VAR_TRACED_UNSET
- * VAR_TRACED_ARRAY
- * VAR_TRACE_ACTIVE - 1 means that trace processing is currently
- * underway for a read or write access, so new
- * read or write accesses should not cause trace
- * procedures to be called and the variable can't
- * be deleted.
- * VAR_SEARCH_ACTIVE
- *
- * The following additional flags are used with the CompiledLocal type defined
- * below:
- *
- * VAR_ARGUMENT - 1 means that this variable holds a procedure
- * argument.
- * VAR_TEMPORARY - 1 if the local variable is an anonymous
- * temporary variable. Temporaries have a NULL
- * name.
- * VAR_RESOLVED - 1 if name resolution has been done for this
- * variable.
- * VAR_IS_ARGS 1 if this variable is the last argument and is
- * named "args".
- */
-
-/*
- * FLAGS RENUMBERED: everything breaks already, make things simpler.
- *
- * IMPORTANT: skip the values 0x10, 0x20, 0x40, 0x800 corresponding to
- * TCL_TRACE_(READS/WRITES/UNSETS/ARRAY): makes code simpler in tclTrace.c
- *
- * Keep the flag values for VAR_ARGUMENT and VAR_TEMPORARY so that old values
- * in precompiled scripts keep working.
- */
-
-
-/* Type of value (0 is scalar) */
-#define VAR_ARRAY 0x1
-#define VAR_LINK 0x2
-
-/* Type of storage (0 is compiled local) */
-#define VAR_IN_HASHTABLE 0x4
-#define VAR_DEAD_HASH 0x8
-#define VAR_ARRAY_ELEMENT 0x1000
-#define VAR_NAMESPACE_VAR 0x80 /* KEEP OLD VALUE for Itcl */
-
-#define VAR_ALL_HASH \
- (VAR_IN_HASHTABLE|VAR_DEAD_HASH|VAR_NAMESPACE_VAR|VAR_ARRAY_ELEMENT)
-
-/* Trace and search state */
-
-#define VAR_TRACED_READ 0x10 /* TCL_TRACE_READS */
-#define VAR_TRACED_WRITE 0x20 /* TCL_TRACE_WRITES */
-#define VAR_TRACED_UNSET 0x40 /* TCL_TRACE_UNSETS */
-#define VAR_TRACED_ARRAY 0x800 /* TCL_TRACE_ARRAY */
-#define VAR_TRACE_ACTIVE 0x2000
-#define VAR_SEARCH_ACTIVE 0x4000
-#define VAR_ALL_TRACES \
- (VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET)
-
-
-/* Special handling on initialisation (only CompiledLocal) */
-#define VAR_ARGUMENT 0x100 /* KEEP OLD VALUE! See tclProc.c */
-#define VAR_TEMPORARY 0x200 /* KEEP OLD VALUE! See tclProc.c */
-#define VAR_IS_ARGS 0x400
-#define VAR_RESOLVED 0x8000
-
-/*
- * Macros to ensure that various flag bits are set properly for variables.
- * The ANSI C "prototypes" for these macros are:
- *
- * MODULE_SCOPE void TclSetVarScalar(Var *varPtr);
- * MODULE_SCOPE void TclSetVarArray(Var *varPtr);
- * MODULE_SCOPE void TclSetVarLink(Var *varPtr);
- * MODULE_SCOPE void TclSetVarArrayElement(Var *varPtr);
- * MODULE_SCOPE void TclSetVarUndefined(Var *varPtr);
- * MODULE_SCOPE void TclClearVarUndefined(Var *varPtr);
- */
-
-#define TclSetVarScalar(varPtr) \
- (varPtr)->flags &= ~(VAR_ARRAY|VAR_LINK)
-
-#define TclSetVarArray(varPtr) \
- (varPtr)->flags = ((varPtr)->flags & ~VAR_LINK) | VAR_ARRAY
-
-#define TclSetVarLink(varPtr) \
- (varPtr)->flags = ((varPtr)->flags & ~VAR_ARRAY) | VAR_LINK
-
-#define TclSetVarArrayElement(varPtr) \
- (varPtr)->flags = ((varPtr)->flags & ~VAR_ARRAY) | VAR_ARRAY_ELEMENT
-
-#define TclSetVarUndefined(varPtr) \
- (varPtr)->flags &= ~(VAR_ARRAY|VAR_LINK);\
- (varPtr)->value.objPtr = NULL
-
-#define TclClearVarUndefined(varPtr)
-
-#define TclSetVarTraceActive(varPtr) \
- (varPtr)->flags |= VAR_TRACE_ACTIVE
-
-#define TclClearVarTraceActive(varPtr) \
- (varPtr)->flags &= ~VAR_TRACE_ACTIVE
-
-#define TclSetVarNamespaceVar(varPtr) \
- if (!TclIsVarNamespaceVar(varPtr)) {\
- (varPtr)->flags |= VAR_NAMESPACE_VAR;\
- ((VarInHash *)(varPtr))->refCount++;\
- }
-
-#define TclClearVarNamespaceVar(varPtr) \
- if (TclIsVarNamespaceVar(varPtr)) {\
- (varPtr)->flags &= ~VAR_NAMESPACE_VAR;\
- ((VarInHash *)(varPtr))->refCount--;\
- }
-
-/*
- * Macros to read various flag bits of variables.
- * The ANSI C "prototypes" for these macros are:
- *
- * MODULE_SCOPE int TclIsVarScalar(Var *varPtr);
- * MODULE_SCOPE int TclIsVarLink(Var *varPtr);
- * MODULE_SCOPE int TclIsVarArray(Var *varPtr);
- * MODULE_SCOPE int TclIsVarUndefined(Var *varPtr);
- * MODULE_SCOPE int TclIsVarArrayElement(Var *varPtr);
- * MODULE_SCOPE int TclIsVarTemporary(Var *varPtr);
- * MODULE_SCOPE int TclIsVarArgument(Var *varPtr);
- * MODULE_SCOPE int TclIsVarResolved(Var *varPtr);
- */
-
-#define TclIsVarScalar(varPtr) \
- !((varPtr)->flags & (VAR_ARRAY|VAR_LINK))
-
-#define TclIsVarLink(varPtr) \
- ((varPtr)->flags & VAR_LINK)
-
-#define TclIsVarArray(varPtr) \
- ((varPtr)->flags & VAR_ARRAY)
-
-#define TclIsVarUndefined(varPtr) \
- ((varPtr)->value.objPtr == NULL)
-
-#define TclIsVarArrayElement(varPtr) \
- ((varPtr)->flags & VAR_ARRAY_ELEMENT)
-
-#define TclIsVarNamespaceVar(varPtr) \
- ((varPtr)->flags & VAR_NAMESPACE_VAR)
-
-#define TclIsVarTemporary(varPtr) \
- ((varPtr)->flags & VAR_TEMPORARY)
-
-#define TclIsVarArgument(varPtr) \
- ((varPtr)->flags & VAR_ARGUMENT)
-
-#define TclIsVarResolved(varPtr) \
- ((varPtr)->flags & VAR_RESOLVED)
-
-#define TclIsVarTraceActive(varPtr) \
- ((varPtr)->flags & VAR_TRACE_ACTIVE)
-
-#define TclIsVarTraced(varPtr) \
- ((varPtr)->flags & VAR_ALL_TRACES)
-
-#define TclIsVarInHash(varPtr) \
- ((varPtr)->flags & VAR_IN_HASHTABLE)
-
-#define TclIsVarDeadHash(varPtr) \
- ((varPtr)->flags & VAR_DEAD_HASH)
-
-#define TclGetVarNsPtr(varPtr) \
- (TclIsVarInHash(varPtr) \
- ? ((TclVarHashTable *) ((((VarInHash *) (varPtr))->entry.tablePtr)))->nsPtr \
- : NULL)
-
-#define VarHashRefCount(varPtr) \
- ((VarInHash *) (varPtr))->refCount
-
-/*
- * Macros for direct variable access by TEBC
- */
-
-#define TclIsVarDirectReadable(varPtr) \
- ( !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_READ)) \
- && (varPtr)->value.objPtr)
-
-#define TclIsVarDirectWritable(varPtr) \
- !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH))
-
-#define TclIsVarDirectModifyable(varPtr) \
- ( !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_READ|VAR_TRACED_WRITE)) \
- && (varPtr)->value.objPtr)
-
-#define TclIsVarDirectReadable2(varPtr, arrayPtr) \
- (TclIsVarDirectReadable(varPtr) &&\
- (!(arrayPtr) || !((arrayPtr)->flags & VAR_TRACED_READ)))
-
-#define TclIsVarDirectWritable2(varPtr, arrayPtr) \
- (TclIsVarDirectWritable(varPtr) &&\
- (!(arrayPtr) || !((arrayPtr)->flags & VAR_TRACED_WRITE)))
-
-#define TclIsVarDirectModifyable2(varPtr, arrayPtr) \
- (TclIsVarDirectModifyable(varPtr) &&\
- (!(arrayPtr) || !((arrayPtr)->flags & (VAR_TRACED_READ|VAR_TRACED_WRITE))))
-
-#define VarHashGetValue(hPtr) \
- ((Var *) ((char *)hPtr - Blt_Offset(VarInHash, entry)))
-
-static INLINE Tcl_Namespace *
-NamespaceOfVariable(Var *varPtr)
-{
- if (varPtr->flags & VAR_IN_HASHTABLE) {
- VarInHash *vhashPtr = (VarInHash *)varPtr;
- TclVarHashTable *vtablePtr;
-
- vtablePtr = (TclVarHashTable *)vhashPtr->entry.tablePtr;
- return vtablePtr->nsPtr;
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewVar --
- *
- * Create a new heap-allocated variable that will eventually be
- * entered into a hashtable.
- *
- * Results:
- * The return value is a pointer to the new variable structure. It is
- * marked as a scalar variable (and not a link or array variable). Its
- * value initially is NULL. The variable is not part of any hash table
- * yet. Since it will be in a hashtable and not in a call frame, its
- * name field is set NULL. It is initially marked as undefined.
- *
- * Side effects:
- * Storage gets allocated.
- *
- *---------------------------------------------------------------------------
- */
-static Var *
-NewVar(Tcl_Obj *objPtr)
-{
- Var *varPtr;
-
- varPtr = Blt_AssertMalloc(sizeof(Var));
- varPtr->value.objPtr = objPtr;
- varPtr->flags = 0;
- return varPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetVariableNamespace --
- *
- * Returns the namespace context of the variable. If NULL, this
- * indicates that the variable is local to the call frame.
- *
- * Results:
- * Returns the context of the namespace in an opaque type.
- *
- *---------------------------------------------------------------------------
- */
-
-Tcl_Namespace *
-Blt_GetVariableNamespace(Tcl_Interp *interp, const char *path)
-{
- Blt_ObjectName objName;
-
- if (!Blt_ParseObjectName(interp, path, &objName, BLT_NO_DEFAULT_NS)) {
- return NULL;
- }
- if (objName.nsPtr == NULL) {
- Var *varPtr;
-
- varPtr = (Var *)Tcl_FindNamespaceVar(interp, (char *)path,
- (Tcl_Namespace *)NULL, TCL_NAMESPACE_ONLY);
- if (varPtr != NULL) {
- return NamespaceOfVariable(varPtr);
- }
- varPtr = (Var *)Tcl_FindNamespaceVar(interp, (char *)path,
- (Tcl_Namespace *)NULL, TCL_GLOBAL_ONLY);
- if (varPtr != NULL) {
- return NamespaceOfVariable(varPtr);
- }
- }
- return objName.nsPtr;
-}
-
-Tcl_Var
-Blt_GetCachedVar(Blt_HashTable *cacheTablePtr, const char *label,
- Tcl_Obj *objPtr)
-{
- Blt_HashEntry *hPtr;
- int isNew;
- Var *varPtr;
-
- /* Check if the variable has been cached already. */
- hPtr = Blt_CreateHashEntry(cacheTablePtr, label, &isNew);
- if (isNew) {
- varPtr = NewVar(objPtr);
- Blt_SetHashValue(hPtr, varPtr);
- } else {
- varPtr = Blt_GetHashValue(hPtr);
- varPtr->value.objPtr = objPtr;
- }
- return (Tcl_Var)varPtr;
-}
-
-void
-Blt_FreeCachedVars(Blt_HashTable *tablePtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch iter;
-
- for (hPtr = Blt_FirstHashEntry(tablePtr, &iter); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&iter)) {
- Var *varPtr;
-
- varPtr = Blt_GetHashValue(hPtr);
- Blt_Free(varPtr);
- }
- Blt_DeleteHashTable(tablePtr);
-}
diff --git a/blt3.0.1/src/bltVecCmd.c b/blt3.0.1/src/bltVecCmd.c
deleted file mode 100644
index c113347..0000000
--- a/blt3.0.1/src/bltVecCmd.c
+++ /dev/null
@@ -1,2414 +0,0 @@
-
-/*
- * bltVecCmd.c --
- *
- * This module implements vector data objects.
- *
- * Copyright 1995-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Code for binary data read operation was donated by Harold Kirsch.
- *
- */
-
-/*
- * TODO:
- * o Add H. Kirsch's vector binary read operation
- * x binread file0
- * x binread -file file0
- *
- * o Add ASCII/binary file reader
- * x read fileName
- *
- * o Allow Tcl-based client notifications.
- * vector x
- * x notify call Display
- * x notify delete Display
- * x notify reorder #1 #2
- */
-
-#include "bltVecInt.h"
-#include "bltOp.h"
-#include "bltNsUtil.h"
-#include "bltSwitch.h"
-
-typedef int (VectorCmdProc)(Vector *vPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv);
-
-static Blt_SwitchParseProc ObjToFFTVector;
-static Blt_SwitchCustom fftVectorSwitch = {
- ObjToFFTVector, NULL, (ClientData)0,
-};
-
-static Blt_SwitchParseProc ObjToIndex;
-static Blt_SwitchCustom indexSwitch = {
- ObjToIndex, NULL, (ClientData)0,
-};
-
-typedef struct {
- Tcl_Obj *formatObjPtr;
- int from, to;
-} PrintSwitches;
-
-static Blt_SwitchSpec printSwitches[] =
-{
- {BLT_SWITCH_OBJ, "-format", "string",
- Blt_Offset(PrintSwitches, formatObjPtr), 0},
- {BLT_SWITCH_CUSTOM, "-from", "index",
- Blt_Offset(PrintSwitches, from), 0, 0, &indexSwitch},
- {BLT_SWITCH_CUSTOM, "-to", "index",
- Blt_Offset(PrintSwitches, to), 0, 0, &indexSwitch},
- {BLT_SWITCH_END}
-};
-
-
-typedef struct {
- int flags;
-} SortSwitches;
-
-#define SORT_DECREASING (1<<0)
-#define SORT_UNIQUE (1<<1)
-
-static Blt_SwitchSpec sortSwitches[] =
-{
- {BLT_SWITCH_BITMASK, "-decreasing", "",
- Blt_Offset(SortSwitches, flags), 0, SORT_DECREASING},
- {BLT_SWITCH_BITMASK, "-reverse", "",
- Blt_Offset(SortSwitches, flags), 0, SORT_DECREASING},
- {BLT_SWITCH_BITMASK, "-uniq", "",
- Blt_Offset(SortSwitches, flags), 0, SORT_UNIQUE},
- {BLT_SWITCH_END}
-};
-
-typedef struct {
- double delta;
- Vector *imagPtr; /* Vector containing imaginary part. */
- Vector *freqPtr; /* Vector containing frequencies. */
- VectorInterpData *dataPtr;
- int mask; /* Flags controlling FFT. */
-} FFTData;
-
-
-static Blt_SwitchSpec fftSwitches[] = {
- {BLT_SWITCH_CUSTOM, "-imagpart", "vector",
- Blt_Offset(FFTData, imagPtr), 0, 0, &fftVectorSwitch},
- {BLT_SWITCH_BITMASK, "-noconstant", "",
- Blt_Offset(FFTData, mask), 0, FFT_NO_CONSTANT},
- {BLT_SWITCH_BITMASK, "-spectrum", "",
- Blt_Offset(FFTData, mask), 0, FFT_SPECTRUM},
- {BLT_SWITCH_BITMASK, "-bartlett", "",
- Blt_Offset(FFTData, mask), 0, FFT_BARTLETT},
- {BLT_SWITCH_DOUBLE, "-delta", "float",
- Blt_Offset(FFTData, mask), 0, 0, },
- {BLT_SWITCH_CUSTOM, "-frequencies", "vector",
- Blt_Offset(FFTData, freqPtr), 0, 0, &fftVectorSwitch},
- {BLT_SWITCH_END}
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToFFTVector --
- *
- * Convert a string representing a vector into its vector structure.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToFFTVector(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* Name of vector. */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- FFTData *dataPtr = (FFTData *)record;
- Vector *vPtr;
- Vector **vPtrPtr = (Vector **)(record + offset);
- int isNew; /* Not used. */
- char *string;
-
- string = Tcl_GetString(objPtr);
- vPtr = Blt_Vec_Create(dataPtr->dataPtr, string, string, string, &isNew);
- if (vPtr == NULL) {
- return TCL_ERROR;
- }
- *vPtrPtr = vPtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToIndex --
- *
- * Convert a string representing a vector into its vector structure.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToIndex(
- ClientData clientData, /* Contains the vector in question to verify
- * its length. */
- Tcl_Interp *interp, /* Interpreter to send results back to */
- const char *switchName, /* Not used. */
- Tcl_Obj *objPtr, /* Name of vector. */
- char *record, /* Structure record */
- int offset, /* Offset to field in structure */
- int flags) /* Not used. */
-{
- Vector *vPtr = clientData;
- int *indexPtr = (int *)(record + offset);
- int index;
-
- if (Blt_Vec_GetIndex(interp, vPtr, Tcl_GetString(objPtr), &index,
- INDEX_CHECK, (Blt_VectorIndexProc **)NULL) != TCL_OK) {
- return TCL_ERROR;
- }
- *indexPtr = index;
- return TCL_OK;
-
-}
-
-static Tcl_Obj *
-GetValues(Vector *vPtr, int first, int last)
-{
- Tcl_Obj *listObjPtr;
- double *vp, *vend;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (vp = vPtr->valueArr + first, vend = vPtr->valueArr + last; vp <= vend;
- vp++) {
- Tcl_ListObjAppendElement(vPtr->interp, listObjPtr,
- Tcl_NewDoubleObj(*vp));
- }
- return listObjPtr;
-}
-
-static void
-ReplicateValue(Vector *vPtr, int first, int last, double value)
-{
- double *vp, *vend;
-
- for (vp = vPtr->valueArr + first, vend = vPtr->valueArr + last;
- vp <= vend; vp++) {
- *vp = value;
- }
- vPtr->notifyFlags |= UPDATE_RANGE;
-}
-
-static int
-CopyList(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- if (Blt_Vec_SetLength(interp, vPtr, objc) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 0; i < objc; i++) {
- double value;
-
- if (Blt_ExprDoubleFromObj(interp, objv[i], &value) != TCL_OK) {
- Blt_Vec_SetLength(interp, vPtr, i);
- return TCL_ERROR;
- }
- vPtr->valueArr[i] = value;
- }
- return TCL_OK;
-}
-
-static int
-AppendVector(Vector *destPtr, Vector *srcPtr)
-{
- size_t nBytes;
- size_t oldSize, newSize;
-
- oldSize = destPtr->length;
- newSize = oldSize + srcPtr->last - srcPtr->first + 1;
- if (Blt_Vec_ChangeLength(destPtr->interp, destPtr, newSize) != TCL_OK) {
- return TCL_ERROR;
- }
- nBytes = (newSize - oldSize) * sizeof(double);
- memcpy((char *)(destPtr->valueArr + oldSize),
- (srcPtr->valueArr + srcPtr->first), nBytes);
- destPtr->notifyFlags |= UPDATE_RANGE;
- return TCL_OK;
-}
-
-static int
-AppendList(Vector *vPtr, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Interp *interp = vPtr->interp;
- int count;
- int i;
- double value;
- int oldSize;
-
- oldSize = vPtr->length;
- if (Blt_Vec_ChangeLength(interp, vPtr, vPtr->length + objc) != TCL_OK) {
- return TCL_ERROR;
- }
- count = oldSize;
- for (i = 0; i < objc; i++) {
- if (Blt_ExprDoubleFromObj(interp, objv[i], &value) != TCL_OK) {
- Blt_Vec_ChangeLength(interp, vPtr, count);
- return TCL_ERROR;
- }
- vPtr->valueArr[count++] = value;
- }
- vPtr->notifyFlags |= UPDATE_RANGE;
- return TCL_OK;
-}
-
-/* Vector instance option commands */
-
-/*
- *---------------------------------------------------------------------------
- *
- * AppendOp --
- *
- * Appends one of more TCL lists of values, or vector objects onto the
- * end of the current vector object.
- *
- * Results:
- * A standard TCL result. If a current vector can't be created,
- * resized, any of the named vectors can't be found, or one of lists of
- * values is invalid, TCL_ERROR is returned.
- *
- * Side Effects:
- * Clients of current vector will be notified of the change.
- *
- *---------------------------------------------------------------------------
- */
-static int
-AppendOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
- int result;
- Vector *v2Ptr;
-
- for (i = 2; i < objc; i++) {
- v2Ptr = Blt_Vec_ParseElement((Tcl_Interp *)NULL, vPtr->dataPtr,
- Tcl_GetString(objv[i]), (const char **)NULL, NS_SEARCH_BOTH);
- if (v2Ptr != NULL) {
- result = AppendVector(vPtr, v2Ptr);
- } else {
- int nElem;
- Tcl_Obj **elemObjArr;
-
- if (Tcl_ListObjGetElements(interp, objv[i], &nElem, &elemObjArr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- result = AppendList(vPtr, nElem, elemObjArr);
- }
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (objc > 2) {
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ClearOp --
- *
- * Deletes all the accumulated array indices for the TCL array associated
- * will the vector. This routine can be used to free excess memory from
- * a large vector.
- *
- * Results:
- * Always returns TCL_OK.
- *
- * Side Effects:
- * Memory used for the entries of the TCL array variable is freed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ClearOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Blt_Vec_FlushCache(vPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Deletes the given indices from the vector. If no indices are provided
- * the entire vector is deleted.
- *
- * Results:
- * A standard TCL result. If any of the given indices is invalid,
- * interp->result will an error message and TCL_ERROR is returned.
- *
- * Side Effects:
- * The clients of the vector will be notified of the vector
- * deletions.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DeleteOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- unsigned char *unsetArr;
- int i, j;
- int count;
- char *string;
-
- /* FIXME: Don't delete vector with no indices. */
- if (objc == 2) {
- Blt_Vec_Free(vPtr);
- return TCL_OK;
- }
-
- /* Allocate an "unset" bitmap the size of the vector. */
- unsetArr = Blt_AssertCalloc(sizeof(unsigned char), (vPtr->length + 7) / 8);
-#define SetBit(i) \
- unsetArr[(i) >> 3] |= (1 << ((i) & 0x07))
-#define GetBit(i) \
- (unsetArr[(i) >> 3] & (1 << ((i) & 0x07)))
-
- for (i = 2; i < objc; i++) {
- string = Tcl_GetString(objv[i]);
- if (Blt_Vec_GetIndexRange(interp, vPtr, string,
- (INDEX_COLON | INDEX_CHECK), (Blt_VectorIndexProc **) NULL)
- != TCL_OK) {
- Blt_Free(unsetArr);
- return TCL_ERROR;
- }
- for (j = vPtr->first; j <= vPtr->last; j++) {
- SetBit(j); /* Mark the range of elements for deletion. */
- }
- }
- count = 0;
- for (i = 0; i < vPtr->length; i++) {
- if (GetBit(i)) {
- continue; /* Skip elements marked for deletion. */
- }
- if (count < i) {
- vPtr->valueArr[count] = vPtr->valueArr[i];
- }
- count++;
- }
- Blt_Free(unsetArr);
- vPtr->length = count;
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DupOp --
- *
- * Creates one or more duplicates of the vector object.
- *
- * Results:
- * A standard TCL result. If a new vector can't be created,
- * or and existing vector resized, TCL_ERROR is returned.
- *
- * Side Effects:
- * Clients of existing vectors will be notified of the change.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DupOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 2; i < objc; i++) {
- Vector *v2Ptr;
- char *name;
- int isNew;
-
- name = Tcl_GetString(objv[i]);
- v2Ptr = Blt_Vec_Create(vPtr->dataPtr, name, name, name, &isNew);
- if (v2Ptr == NULL) {
- return TCL_ERROR;
- }
- if (v2Ptr == vPtr) {
- continue;
- }
- if (Blt_Vec_Duplicate(v2Ptr, vPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (!isNew) {
- if (v2Ptr->flush) {
- Blt_Vec_FlushCache(v2Ptr);
- }
- Blt_Vec_UpdateClients(v2Ptr);
- }
- }
- return TCL_OK;
-}
-
-
-/* spinellia at acm.org START */
-
-/* fft implementation */
-/*ARGSUSED*/
-static int
-FFTOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Vector *v2Ptr = NULL;
- int isNew;
- FFTData data;
- char *realVecName;
-
- memset(&data, 0, sizeof(data));
- data.delta = 1.0;
-
- realVecName = Tcl_GetString(objv[2]);
- v2Ptr = Blt_Vec_Create(vPtr->dataPtr, realVecName, realVecName,
- realVecName, &isNew);
- if (v2Ptr == NULL) {
- return TCL_ERROR;
- }
- if (v2Ptr == vPtr) {
- Tcl_AppendResult(interp, "real vector \"", realVecName, "\"",
- " can't be the same as the source", (char *)NULL);
- return TCL_ERROR;
- }
- if (Blt_ParseSwitches(interp, fftSwitches, objc - 3, objv + 3, &data,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (Blt_Vec_FFT(interp, v2Ptr, data.imagPtr, data.freqPtr, data.delta,
- data.mask, vPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Update bookkeeping. */
- if (!isNew) {
- if (v2Ptr->flush) {
- Blt_Vec_FlushCache(v2Ptr);
- }
- Blt_Vec_UpdateClients(v2Ptr);
- }
- if (data.imagPtr != NULL) {
- if (data.imagPtr->flush) {
- Blt_Vec_FlushCache(data.imagPtr);
- }
- Blt_Vec_UpdateClients(data.imagPtr);
- }
- if (data.freqPtr != NULL) {
- if (data.freqPtr->flush) {
- Blt_Vec_FlushCache(data.freqPtr);
- }
- Blt_Vec_UpdateClients(data.freqPtr);
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-InverseFFTOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int isNew;
- char *name;
- Vector *srcImagPtr;
- Vector *destRealPtr;
- Vector *destImagPtr;
-
- name = Tcl_GetString(objv[2]);
- if (Blt_Vec_LookupName(vPtr->dataPtr, name, &srcImagPtr) != TCL_OK ) {
- return TCL_ERROR;
- }
- name = Tcl_GetString(objv[3]);
- destRealPtr = Blt_Vec_Create(vPtr->dataPtr, name, name, name, &isNew);
- name = Tcl_GetString(objv[4]);
- destImagPtr = Blt_Vec_Create(vPtr->dataPtr, name, name, name, &isNew);
-
- if (Blt_Vec_InverseFFT(interp, srcImagPtr, destRealPtr, destImagPtr, vPtr)
- != TCL_OK ){
- return TCL_ERROR;
- }
- if (destRealPtr->flush) {
- Blt_Vec_FlushCache(destRealPtr);
- }
- Blt_Vec_UpdateClients(destRealPtr);
-
- if (destImagPtr->flush) {
- Blt_Vec_FlushCache(destImagPtr);
- }
- Blt_Vec_UpdateClients(destImagPtr);
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * IndexOp --
- *
- * Sets or reads the value of the index. This simulates what the
- * vector's variable does.
- *
- * Results:
- * A standard TCL result. If the index is invalid,
- * interp->result will an error message and TCL_ERROR is returned.
- * Otherwise interp->result will contain the values.
- *
- *---------------------------------------------------------------------------
- */
-static int
-IndexOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int first, last;
- char *string;
-
- string = Tcl_GetString(objv[2]);
- if (Blt_Vec_GetIndexRange(interp, vPtr, string, INDEX_ALL_FLAGS,
- (Blt_VectorIndexProc **) NULL) != TCL_OK) {
- return TCL_ERROR;
- }
- first = vPtr->first, last = vPtr->last;
- if (objc == 3) {
- Tcl_Obj *listObjPtr;
-
- if (first == vPtr->length) {
- Tcl_AppendResult(interp, "can't get index \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR; /* Can't read from index "++end" */
- }
- listObjPtr = GetValues(vPtr, first, last);
- Tcl_SetObjResult(interp, listObjPtr);
- } else {
- double value;
-
- /* FIXME: huh? Why set values here?. */
- if (first == SPECIAL_INDEX) {
- Tcl_AppendResult(interp, "can't set index \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR; /* Tried to set "min" or "max" */
- }
- if (Blt_ExprDoubleFromObj(interp, objv[3], &value) != TCL_OK) {
- return TCL_ERROR;
- }
- if (first == vPtr->length) {
- if (Blt_Vec_ChangeLength(interp, vPtr, vPtr->length + 1)
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- ReplicateValue(vPtr, first, last, value);
- Tcl_SetObjResult(interp, objv[3]);
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LengthOp --
- *
- * Returns the length of the vector. If a new size is given, the
- * vector is resized to the new vector.
- *
- * Results:
- * A standard TCL result. If the new length is invalid,
- * interp->result will an error message and TCL_ERROR is returned.
- * Otherwise interp->result will contain the length of the vector.
- *
- *---------------------------------------------------------------------------
- */
-static int
-LengthOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (objc == 3) {
- int nElem;
-
- if (Tcl_GetIntFromObj(interp, objv[2], &nElem) != TCL_OK) {
- return TCL_ERROR;
- }
- if (nElem < 0) {
- Tcl_AppendResult(interp, "bad vector size \"",
- Tcl_GetString(objv[2]), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if ((Blt_Vec_SetSize(interp, vPtr, nElem) != TCL_OK) ||
- (Blt_Vec_SetLength(interp, vPtr, nElem) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), vPtr->length);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapOp --
- *
- * Queries or sets the offset of the array index from the base
- * address of the data array of values.
- *
- * Results:
- * A standard TCL result. If the source vector doesn't exist
- * or the source list is not a valid list of numbers, TCL_ERROR
- * returned. Otherwise TCL_OK is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-MapOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (objc > 2) {
- if (Blt_Vec_MapVariable(interp, vPtr, Tcl_GetString(objv[2]))
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (vPtr->arrayName != NULL) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp), vPtr->arrayName, -1);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MaxOp --
- *
- * Returns the maximum value of the vector.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-MaxOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_SetDoubleObj(Tcl_GetObjResult(interp), Blt_Vec_Max(vPtr));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MergeOp --
- *
- * Merges the values from the given vectors to the current vector.
- *
- * Results:
- * A standard TCL result. If any of the given vectors differ in size,
- * TCL_ERROR is returned. Otherwise TCL_OK is returned and the
- * vector data will contain merged values of the given vectors.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-MergeOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Vector **vecArr;
- int refSize, nElem;
- int i;
- double *valuePtr, *valueArr;
- Vector **vPtrPtr;
-
- /* Allocate an array of vector pointers of each vector to be
- * merged in the current vector. */
- vecArr = Blt_AssertMalloc(sizeof(Vector *) * objc);
- vPtrPtr = vecArr;
-
- refSize = -1;
- nElem = 0;
- for (i = 2; i < objc; i++) {
- Vector *v2Ptr;
- int length;
-
- if (Blt_Vec_LookupName(vPtr->dataPtr, Tcl_GetString(objv[i]), &v2Ptr)
- != TCL_OK) {
- Blt_Free(vecArr);
- return TCL_ERROR;
- }
- /* Check that all the vectors are the same length */
- length = v2Ptr->last - v2Ptr->first + 1;
- if (refSize < 0) {
- refSize = length;
- } else if (length != refSize) {
- Tcl_AppendResult(vPtr->interp, "vectors \"", vPtr->name,
- "\" and \"", v2Ptr->name, "\" differ in length",
- (char *)NULL);
- Blt_Free(vecArr);
- return TCL_ERROR;
- }
- *vPtrPtr++ = v2Ptr;
- nElem += refSize;
- }
- *vPtrPtr = NULL;
-
- valueArr = Blt_Malloc(sizeof(double) * nElem);
- if (valueArr == NULL) {
- Tcl_AppendResult(vPtr->interp, "not enough memory to allocate ",
- Blt_Itoa(nElem), " vector elements", (char *)NULL);
- return TCL_ERROR;
- }
-
- /* Merge the values from each of the vectors into the current vector */
- valuePtr = valueArr;
- for (i = 0; i < refSize; i++) {
- Vector **vpp;
-
- for (vpp = vecArr; *vpp != NULL; vpp++) {
- *valuePtr++ = (*vpp)->valueArr[i + (*vpp)->first];
- }
- }
- Blt_Free(vecArr);
- Blt_Vec_Reset(vPtr, valueArr, nElem, nElem, TCL_DYNAMIC);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MinOp --
- *
- * Returns the minimum value of the vector.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-MinOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_SetDoubleObj(Tcl_GetObjResult(interp), Blt_Vec_Min(vPtr));
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NormalizeOp --
- *
- * Normalizes the vector.
- *
- * Results:
- * A standard TCL result. If the density is invalid, TCL_ERROR
- * is returned. Otherwise TCL_OK is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NormalizeOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
- double range;
-
- Blt_Vec_UpdateRange(vPtr);
- range = vPtr->max - vPtr->min;
- if (objc > 2) {
- Vector *v2Ptr;
- int isNew;
- char *string;
-
- string = Tcl_GetString(objv[2]);
- v2Ptr = Blt_Vec_Create(vPtr->dataPtr, string, string, string, &isNew);
- if (v2Ptr == NULL) {
- return TCL_ERROR;
- }
- if (Blt_Vec_SetLength(interp, v2Ptr, vPtr->length) != TCL_OK) {
- return TCL_ERROR;
- }
- for (i = 0; i < vPtr->length; i++) {
- v2Ptr->valueArr[i] = (vPtr->valueArr[i] - vPtr->min) / range;
- }
- Blt_Vec_UpdateRange(v2Ptr);
- if (!isNew) {
- if (v2Ptr->flush) {
- Blt_Vec_FlushCache(v2Ptr);
- }
- Blt_Vec_UpdateClients(v2Ptr);
- }
- } else {
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (i = 0; i < vPtr->length; i++) {
- double norm;
-
- norm = (vPtr->valueArr[i] - vPtr->min) / range;
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(norm));
- }
- Tcl_SetObjResult(interp, listObjPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifyOp --
- *
- * Notify clients of vector.
- *
- * Results:
- * A standard TCL result. If any of the given vectors differ in size,
- * TCL_ERROR is returned. Otherwise TCL_OK is returned and the
- * vector data will contain merged values of the given vectors.
- *
- * x vector notify now
- * x vector notify always
- * x vector notify whenidle
- * x vector notify update {}
- * x vector notify delete {}
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NotifyOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int option;
- int bool;
- enum optionIndices {
- OPTION_ALWAYS, OPTION_NEVER, OPTION_WHENIDLE,
- OPTION_NOW, OPTION_CANCEL, OPTION_PENDING
- };
- static const char *optionArr[] = {
- "always", "never", "whenidle", "now", "cancel", "pending", NULL
- };
-
- if (Tcl_GetIndexFromObj(interp, objv[2], optionArr, "qualifier", TCL_EXACT,
- &option) != TCL_OK) {
- return TCL_OK;
- }
- switch (option) {
- case OPTION_ALWAYS:
- vPtr->notifyFlags &= ~NOTIFY_WHEN_MASK;
- vPtr->notifyFlags |= NOTIFY_ALWAYS;
- break;
- case OPTION_NEVER:
- vPtr->notifyFlags &= ~NOTIFY_WHEN_MASK;
- vPtr->notifyFlags |= NOTIFY_NEVER;
- break;
- case OPTION_WHENIDLE:
- vPtr->notifyFlags &= ~NOTIFY_WHEN_MASK;
- vPtr->notifyFlags |= NOTIFY_WHENIDLE;
- break;
- case OPTION_NOW:
- /* FIXME: How does this play when an update is pending? */
- Blt_Vec_NotifyClients(vPtr);
- break;
- case OPTION_CANCEL:
- if (vPtr->notifyFlags & NOTIFY_PENDING) {
- vPtr->notifyFlags &= ~NOTIFY_PENDING;
- Tcl_CancelIdleCall(Blt_Vec_NotifyClients, (ClientData)vPtr);
- }
- break;
- case OPTION_PENDING:
- bool = (vPtr->notifyFlags & NOTIFY_PENDING);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), bool);
- break;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PopulateOp --
- *
- * Creates or resizes a new vector based upon the density specified.
- *
- * Results:
- * A standard TCL result. If the density is invalid, TCL_ERROR
- * is returned. Otherwise TCL_OK is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PopulateOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Vector *v2Ptr;
- int size, density;
- int isNew;
- int i, j;
- double *valuePtr;
- int count;
- char *string;
-
- string = Tcl_GetString(objv[2]);
- v2Ptr = Blt_Vec_Create(vPtr->dataPtr, string, string, string, &isNew);
- if (v2Ptr == NULL) {
- return TCL_ERROR;
- }
- if (vPtr->length == 0) {
- return TCL_OK; /* Source vector is empty. */
- }
- if (Tcl_GetIntFromObj(interp, objv[3], &density) != TCL_OK) {
- return TCL_ERROR;
- }
- if (density < 1) {
- Tcl_AppendResult(interp, "bad density \"", Tcl_GetString(objv[3]),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- size = (vPtr->length - 1) * (density + 1) + 1;
- if (Blt_Vec_SetLength(interp, v2Ptr, size) != TCL_OK) {
- return TCL_ERROR;
- }
- count = 0;
- valuePtr = v2Ptr->valueArr;
- for (i = 0; i < (vPtr->length - 1); i++) {
- double slice, range;
-
- range = vPtr->valueArr[i + 1] - vPtr->valueArr[i];
- slice = range / (double)(density + 1);
- for (j = 0; j <= density; j++) {
- *valuePtr = vPtr->valueArr[i] + (slice * (double)j);
- valuePtr++;
- count++;
- }
- }
- count++;
- *valuePtr = vPtr->valueArr[i];
- assert(count == v2Ptr->length);
- if (!isNew) {
- if (v2Ptr->flush) {
- Blt_Vec_FlushCache(v2Ptr);
- }
- Blt_Vec_UpdateClients(v2Ptr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ValuesOp --
- *
- * Print the values vector.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ValuesOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- PrintSwitches switches;
-
- switches.formatObjPtr = NULL;
- switches.from = 0;
- switches.to = vPtr->length - 1;
- indexSwitch.clientData = vPtr;
- if (Blt_ParseSwitches(interp, printSwitches, objc - 2, objv + 2, &switches,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (switches.from > switches.to) {
- int tmp;
- /* swap positions. */
- tmp = switches.to;
- switches.to = switches.from;
- switches.from = tmp;
- }
- if (switches.formatObjPtr == NULL) {
- Tcl_Obj *listObjPtr;
- int i;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (i = switches.from; i <= switches.to; i++) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(vPtr->valueArr[i]));
- }
- Tcl_SetObjResult(interp, listObjPtr);
- } else {
- Tcl_DString ds;
- char buffer[200];
- const char *fmt;
- int i;
-
- Tcl_DStringInit(&ds);
- fmt = Tcl_GetString(switches.formatObjPtr);
- for (i = switches.from; i <= switches.to; i++) {
- sprintf(buffer, fmt, vPtr->valueArr[i]);
- Tcl_DStringAppend(&ds, buffer, -1);
- }
- Tcl_DStringResult(interp, &ds);
- Tcl_DStringFree(&ds);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RangeOp --
- *
- * Returns a TCL list of the range of vector values specified.
- *
- * Results:
- * A standard TCL result. If the given range is invalid, TCL_ERROR
- * is returned. Otherwise TCL_OK is returned and interp->result
- * will contain the list of values.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-RangeOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Obj *listObjPtr;
- int first, last;
- int i;
-
- if (objc == 2) {
- first = 0;
- last = vPtr->length - 1;
- } else if (objc == 4) {
- if ((Blt_Vec_GetIndex(interp, vPtr, Tcl_GetString(objv[2]), &first,
- INDEX_CHECK, (Blt_VectorIndexProc **) NULL) != TCL_OK) ||
- (Blt_Vec_GetIndex(interp, vPtr, Tcl_GetString(objv[3]), &last,
- INDEX_CHECK, (Blt_VectorIndexProc **) NULL) != TCL_OK)) {
- return TCL_ERROR;
- }
- } else {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " range ?first last?", (char *)NULL);
- return TCL_ERROR;
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (first > last) {
- /* Return the list reversed */
- for (i = last; i <= first; i++) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(vPtr->valueArr[i]));
- }
- } else {
- for (i = first; i <= last; i++) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(vPtr->valueArr[i]));
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InRange --
- *
- * Determines if a value lies within a given range.
- *
- * The value is normalized and compared against the interval
- * [0..1], where 0.0 is the minimum and 1.0 is the maximum.
- * DBL_EPSILON is the smallest number that can be represented
- * on the host machine, such that (1.0 + epsilon) != 1.0.
- *
- * Please note, min cannot be greater than max.
- *
- * Results:
- * If the value is within of the interval [min..max], 1 is
- * returned; 0 otherwise.
- *
- *---------------------------------------------------------------------------
- */
-INLINE static int
-InRange(double value, double min, double max)
-{
- double range;
-
- range = max - min;
- if (range < DBL_EPSILON) {
- return (FABS(max - value) < DBL_EPSILON);
- } else {
- double norm;
-
- norm = (value - min) / range;
- return ((norm >= -DBL_EPSILON) && ((norm - 1.0) < DBL_EPSILON));
- }
-}
-
-enum NativeFormats {
- FMT_UNKNOWN = -1,
- FMT_UCHAR, FMT_CHAR,
- FMT_USHORT, FMT_SHORT,
- FMT_UINT, FMT_INT,
- FMT_ULONG, FMT_LONG,
- FMT_FLOAT, FMT_DOUBLE
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetBinaryFormat
- *
- * Translates a format string into a native type. Valid formats are
- *
- * signed i1, i2, i4, i8
- * unsigned u1, u2, u4, u8
- * real r4, r8, r16
- *
- * There must be a corresponding native type. For example, this for
- * reading 2-byte binary integers from an instrument and converting them
- * to unsigned shorts or ints.
- *
- *---------------------------------------------------------------------------
- */
-static enum NativeFormats
-GetBinaryFormat(Tcl_Interp *interp, char *string, int *sizePtr)
-{
- char c;
-
- c = tolower(string[0]);
- if (Tcl_GetInt(interp, string + 1, sizePtr) != TCL_OK) {
- Tcl_AppendResult(interp, "unknown binary format \"", string,
- "\": incorrect byte size", (char *)NULL);
- return FMT_UNKNOWN;
- }
- switch (c) {
- case 'r':
- if (*sizePtr == sizeof(double)) {
- return FMT_DOUBLE;
- } else if (*sizePtr == sizeof(float)) {
- return FMT_FLOAT;
- }
- break;
-
- case 'i':
- if (*sizePtr == sizeof(char)) {
- return FMT_CHAR;
- } else if (*sizePtr == sizeof(int)) {
- return FMT_INT;
- } else if (*sizePtr == sizeof(long)) {
- return FMT_LONG;
- } else if (*sizePtr == sizeof(short)) {
- return FMT_SHORT;
- }
- break;
-
- case 'u':
- if (*sizePtr == sizeof(unsigned char)) {
- return FMT_UCHAR;
- } else if (*sizePtr == sizeof(unsigned int)) {
- return FMT_UINT;
- } else if (*sizePtr == sizeof(unsigned long)) {
- return FMT_ULONG;
- } else if (*sizePtr == sizeof(unsigned short)) {
- return FMT_USHORT;
- }
- break;
-
- default:
- Tcl_AppendResult(interp, "unknown binary format \"", string,
- "\": should be either i#, r#, u# (where # is size in bytes)",
- (char *)NULL);
- return FMT_UNKNOWN;
- }
- Tcl_AppendResult(interp, "can't handle format \"", string, "\"",
- (char *)NULL);
- return FMT_UNKNOWN;
-}
-
-static int
-CopyValues(Vector *vPtr, char *byteArr, enum NativeFormats fmt, int size,
- int length, int swap, int *indexPtr)
-{
- int i, n;
- int newSize;
-
- if ((swap) && (size > 1)) {
- int nBytes = size * length;
- unsigned char *p;
- int left, right;
-
- for (i = 0; i < nBytes; i += size) {
- p = (unsigned char *)(byteArr + i);
- for (left = 0, right = size - 1; left < right; left++, right--) {
- p[left] ^= p[right];
- p[right] ^= p[left];
- p[left] ^= p[right];
- }
-
- }
- }
- newSize = *indexPtr + length;
- if (newSize > vPtr->length) {
- if (Blt_Vec_ChangeLength(vPtr->interp, vPtr, newSize) != TCL_OK) {
- return TCL_ERROR;
- }
- }
-#define CopyArrayToVector(vPtr, arr) \
- for (i = 0, n = *indexPtr; i < length; i++, n++) { \
- (vPtr)->valueArr[n] = (double)(arr)[i]; \
- }
-
- switch (fmt) {
- case FMT_CHAR:
- CopyArrayToVector(vPtr, (char *)byteArr);
- break;
-
- case FMT_UCHAR:
- CopyArrayToVector(vPtr, (unsigned char *)byteArr);
- break;
-
- case FMT_INT:
- CopyArrayToVector(vPtr, (int *)byteArr);
- break;
-
- case FMT_UINT:
- CopyArrayToVector(vPtr, (unsigned int *)byteArr);
- break;
-
- case FMT_LONG:
- CopyArrayToVector(vPtr, (long *)byteArr);
- break;
-
- case FMT_ULONG:
- CopyArrayToVector(vPtr, (unsigned long *)byteArr);
- break;
-
- case FMT_SHORT:
- CopyArrayToVector(vPtr, (short int *)byteArr);
- break;
-
- case FMT_USHORT:
- CopyArrayToVector(vPtr, (unsigned short int *)byteArr);
- break;
-
- case FMT_FLOAT:
- CopyArrayToVector(vPtr, (float *)byteArr);
- break;
-
- case FMT_DOUBLE:
- CopyArrayToVector(vPtr, (double *)byteArr);
- break;
-
- case FMT_UNKNOWN:
- break;
- }
- *indexPtr += length;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * BinreadOp --
- *
- * Reads binary values from a TCL channel. Values are either appended to
- * the end of the vector or placed at a given index (using the "-at"
- * option), overwriting existing values. Data is read until EOF is found
- * on the channel or a specified number of values are read. (note that
- * this is not necessarily the same as the number of bytes).
- *
- * The following flags are supported:
- * -swap Swap bytes
- * -at index Start writing data at the index.
- * -format fmt Specifies the format of the data.
- *
- * This binary reader was created and graciously donated by Harald Kirsch
- * (kir at iitb.fhg.de). Anything that's wrong is due to my (gah) munging
- * of the code.
- *
- * Results:
- * Returns a standard TCL result. The interpreter result will contain the
- * number of values (not the number of bytes) read.
- *
- * Caveats:
- * Channel reads must end on an element boundary.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-BinreadOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tcl_Channel channel;
- char *byteArr;
- char *string;
- enum NativeFormats fmt;
- int arraySize, bytesRead;
- int count, total;
- int first;
- int size, length, mode;
- int swap;
- int i;
-
- string = Tcl_GetString(objv[2]);
- channel = Tcl_GetChannel(interp, string, &mode);
- if (channel == NULL) {
- return TCL_ERROR;
- }
- if ((mode & TCL_READABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", string,
- "\" wasn't opened for reading", (char *)NULL);
- return TCL_ERROR;
- }
- first = vPtr->length;
- fmt = FMT_DOUBLE;
- size = sizeof(double);
- swap = FALSE;
- count = 0;
-
- if (objc > 3) {
- string = Tcl_GetString(objv[3]);
- if (string[0] != '-') {
- long int value;
- /* Get the number of values to read. */
- if (Tcl_GetLongFromObj(interp, objv[3], &value) != TCL_OK) {
- return TCL_ERROR;
- }
- if (value < 0) {
- Tcl_AppendResult(interp, "count can't be negative",
- (char *)NULL);
- return TCL_ERROR;
- }
- count = (size_t)value;
- objc--, objv++;
- }
- }
- /* Process any option-value pairs that remain. */
- for (i = 3; i < objc; i++) {
- string = Tcl_GetString(objv[i]);
- if (strcmp(string, "-swap") == 0) {
- swap = TRUE;
- } else if (strcmp(string, "-format") == 0) {
- i++;
- if (i >= objc) {
- Tcl_AppendResult(interp, "missing arg after \"", string,
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- string = Tcl_GetString(objv[i]);
- fmt = GetBinaryFormat(interp, string, &size);
- if (fmt == FMT_UNKNOWN) {
- return TCL_ERROR;
- }
- } else if (strcmp(string, "-at") == 0) {
- i++;
- if (i >= objc) {
- Tcl_AppendResult(interp, "missing arg after \"", string,
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- string = Tcl_GetString(objv[i]);
- if (Blt_Vec_GetIndex(interp, vPtr, string, &first, 0,
- (Blt_VectorIndexProc **)NULL) != TCL_OK) {
- return TCL_ERROR;
- }
- if (first > vPtr->length) {
- Tcl_AppendResult(interp, "index \"", string,
- "\" is out of range", (char *)NULL);
- return TCL_ERROR;
- }
- }
- }
-
-#define BUFFER_SIZE 1024
- if (count == 0) {
- arraySize = BUFFER_SIZE * size;
- } else {
- arraySize = count * size;
- }
-
- byteArr = Blt_AssertMalloc(arraySize);
- /* FIXME: restore old channel translation later? */
- if (Tcl_SetChannelOption(interp, channel, "-translation",
- "binary") != TCL_OK) {
- return TCL_ERROR;
- }
- total = 0;
- while (!Tcl_Eof(channel)) {
- bytesRead = Tcl_Read(channel, byteArr, arraySize);
- if (bytesRead < 0) {
- Tcl_AppendResult(interp, "error reading channel: ",
- Tcl_PosixError(interp), (char *)NULL);
- return TCL_ERROR;
- }
- if ((bytesRead % size) != 0) {
- Tcl_AppendResult(interp, "error reading channel: short read",
- (char *)NULL);
- return TCL_ERROR;
- }
- length = bytesRead / size;
- if (CopyValues(vPtr, byteArr, fmt, size, length, swap, &first)
- != TCL_OK) {
- return TCL_ERROR;
- }
- total += length;
- if (count > 0) {
- break;
- }
- }
- Blt_Free(byteArr);
-
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
-
- /* Set the result as the number of values read. */
- Tcl_SetIntObj(Tcl_GetObjResult(interp), total);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SearchOp --
- *
- * Searches for a value in the vector. Returns the indices of all vector
- * elements matching a particular value.
- *
- * Results:
- * Always returns TCL_OK. interp->result will contain a list of the
- * indices of array elements matching value. If no elements match,
- * interp->result will contain the empty string.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SearchOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- double min, max;
- int i;
- int wantValue;
- char *string;
- Tcl_Obj *listObjPtr;
-
- wantValue = FALSE;
- string = Tcl_GetString(objv[2]);
- if ((string[0] == '-') && (strcmp(string, "-value") == 0)) {
- wantValue = TRUE;
- objv++, objc--;
- }
- if (Blt_ExprDoubleFromObj(interp, objv[2], &min) != TCL_OK) {
- return TCL_ERROR;
- }
- max = min;
- if (objc > 4) {
- Tcl_AppendResult(interp, "wrong # arguments: should be \"",
- Tcl_GetString(objv[0]), " search ?-value? min ?max?",
- (char *)NULL);
- return TCL_ERROR;
- }
- if ((objc > 3) &&
- (Blt_ExprDoubleFromObj(interp, objv[3], &max) != TCL_OK)) {
- return TCL_ERROR;
- }
- if ((min - max) >= DBL_EPSILON) {
- return TCL_OK; /* Bogus range. Don't bother looking. */
- }
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- if (wantValue) {
- for (i = 0; i < vPtr->length; i++) {
- if (InRange(vPtr->valueArr[i], min, max)) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(vPtr->valueArr[i]));
- }
- }
- } else {
- for (i = 0; i < vPtr->length; i++) {
- if (InRange(vPtr->valueArr[i], min, max)) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewIntObj(i + vPtr->offset));
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OffsetOp --
- *
- * Queries or sets the offset of the array index from the base address of
- * the data array of values.
- *
- * Results:
- * A standard TCL result. If the source vector doesn't exist or the
- * source list is not a valid list of numbers, TCL_ERROR returned.
- * Otherwise TCL_OK is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-OffsetOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (objc == 3) {
- int newOffset;
-
- if (Tcl_GetIntFromObj(interp, objv[2], &newOffset) != TCL_OK) {
- return TCL_ERROR;
- }
- vPtr->offset = newOffset;
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), vPtr->offset);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * RandomOp --
- *
- * Generates random values for the length of the vector.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-RandomOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 0; i < vPtr->length; i++) {
- vPtr->valueArr[i] = drand48();
- }
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SeqOp --
- *
- * Generates a sequence of values in the vector.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SeqOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int n;
- double start, stop;
-
- if (Blt_ExprDoubleFromObj(interp, objv[2], &start) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_ExprDoubleFromObj(interp, objv[3], &stop) != TCL_OK) {
- return TCL_ERROR;
- }
- n = vPtr->length;
- if ((objc > 4) && (Blt_ExprIntFromObj(interp, objv[4], &n) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (n > 1) {
- int i;
- double step;
-
- if (Blt_Vec_SetLength(interp, vPtr, n) != TCL_OK) {
- return TCL_ERROR;
- }
- step = (stop - start) / (double)(n - 1);
- for (i = 0; i < n; i++) {
- vPtr->valueArr[i] = start + (step * i);
- }
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetOp --
- *
- * Sets the data of the vector object from a list of values.
- *
- * Results:
- * A standard TCL result. If the source vector doesn't exist or the
- * source list is not a valid list of numbers, TCL_ERROR returned.
- * Otherwise TCL_OK is returned.
- *
- * Side Effects:
- * The vector data is reset. Clients of the vector are notified. Any
- * cached array indices are flushed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SetOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int result;
- Vector *v2Ptr;
- int nElem;
- Tcl_Obj **elemObjArr;
-
- /* The source can be either a list of numbers or another vector. */
-
- v2Ptr = Blt_Vec_ParseElement((Tcl_Interp *)NULL, vPtr->dataPtr,
- Tcl_GetString(objv[2]), NULL, NS_SEARCH_BOTH);
- if (v2Ptr != NULL) {
- if (vPtr == v2Ptr) {
- Vector *tmpPtr;
- /*
- * Source and destination vectors are the same. Copy the source
- * first into a temporary vector to avoid memory overlaps.
- */
- tmpPtr = Blt_Vec_New(vPtr->dataPtr);
- result = Blt_Vec_Duplicate(tmpPtr, v2Ptr);
- if (result == TCL_OK) {
- result = Blt_Vec_Duplicate(vPtr, tmpPtr);
- }
- Blt_Vec_Free(tmpPtr);
- } else {
- result = Blt_Vec_Duplicate(vPtr, v2Ptr);
- }
- } else if (Tcl_ListObjGetElements(interp, objv[2], &nElem, &elemObjArr)
- == TCL_OK) {
- result = CopyList(vPtr, interp, nElem, elemObjArr);
- } else {
- return TCL_ERROR;
- }
-
- if (result == TCL_OK) {
- /*
- * The vector has changed; so flush the array indices (they're wrong
- * now), find the new range of the data, and notify the vector's
- * clients that it's been modified.
- */
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SimplifyOp --
- *
- * Sets the data of the vector object from a list of values.
- *
- * Results:
- * A standard TCL result. If the source vector doesn't exist or the
- * source list is not a valid list of numbers, TCL_ERROR returned.
- * Otherwise TCL_OK is returned.
- *
- * Side Effects:
- * The vector data is reset. Clients of the vector are notified. Any
- * cached array indices are flushed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SimplifyOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- size_t i, n;
- int length, nPoints;
- int *simple;
- double tolerance = 10.0;
- Point2d *orig, *reduced;
-
- length = vPtr->length;
- nPoints = vPtr->length / 2;
- simple = Blt_AssertMalloc(nPoints * sizeof(int));
- reduced = Blt_AssertMalloc(nPoints * sizeof(Point2d));
- orig = (Point2d *)vPtr->valueArr;
- n = Blt_SimplifyLine(orig, 0, nPoints - 1, tolerance, simple);
- for (i = 0; i < n; i++) {
- reduced[i] = orig[simple[i]];
- }
- Blt_Free(simple);
- Blt_Vec_Reset(vPtr, (double *)reduced, n * 2, vPtr->length, TCL_DYNAMIC);
- /*
- * The vector has changed; so flush the array indices (they're wrong
- * now), find the new range of the data, and notify the vector's
- * clients that it's been modified.
- */
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SplitOp --
- *
- * Copies the values from the vector evenly into one of more vectors.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-SplitOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int nVectors;
-
- nVectors = objc - 2;
- if ((vPtr->length % nVectors) != 0) {
- Tcl_AppendResult(interp, "can't split vector \"", vPtr->name,
- "\" into ", Blt_Itoa(nVectors), " even parts.", (char *)NULL);
- return TCL_ERROR;
- }
- if (nVectors > 0) {
- Vector *v2Ptr;
- char *string; /* Name of vector. */
- int i, j, k;
- int oldSize, newSize, extra, isNew;
-
- extra = vPtr->length / nVectors;
- for (i = 0; i < nVectors; i++) {
- string = Tcl_GetString(objv[i+2]);
- v2Ptr = Blt_Vec_Create(vPtr->dataPtr, string, string, string,
- &isNew);
- oldSize = v2Ptr->length;
- newSize = oldSize + extra;
- if (Blt_Vec_SetLength(interp, v2Ptr, newSize) != TCL_OK) {
- return TCL_ERROR;
- }
- for (j = i, k = oldSize; j < vPtr->length; j += nVectors, k++) {
- v2Ptr->valueArr[k] = vPtr->valueArr[j];
- }
- Blt_Vec_UpdateClients(v2Ptr);
- if (v2Ptr->flush) {
- Blt_Vec_FlushCache(v2Ptr);
- }
- }
- }
- return TCL_OK;
-}
-
-
-static Vector **sortVectors; /* Pointer to the array of values currently
- * being sorted. */
-static int nSortVectors;
-static int sortDecreasing; /* Indicates the ordering of the sort. If
- * non-zero, the vectors are sorted in
- * decreasing order */
-
-static int
-CompareVectors(void *a, void *b)
-{
- double delta;
- int i;
- int sign;
- Vector *vPtr;
-
- sign = (sortDecreasing) ? -1 : 1;
- for (i = 0; i < nSortVectors; i++) {
- vPtr = sortVectors[i];
- delta = vPtr->valueArr[*(int *)a] - vPtr->valueArr[*(int *)b];
- if (delta < 0.0) {
- return (-1 * sign);
- } else if (delta > 0.0) {
- return (1 * sign);
- }
- }
- return 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_SortMap --
- *
- * Returns an array of indices that represents the sorted mapping of the
- * original vector.
- *
- * Results:
- * A standard TCL result. If any of the auxiliary vectors are a
- * different size than the sorted vector object, TCL_ERROR is returned.
- * Otherwise TCL_OK is returned.
- *
- * Side Effects:
- * The vectors are sorted.
- *
- * vecName sort ?switches? vecName vecName...
- *---------------------------------------------------------------------------
- */
-size_t *
-Blt_Vec_SortMap(Vector **vectors, int nVectors)
-{
- size_t *map;
- int i;
- Vector *vPtr = *vectors;
- int length;
-
- length = vPtr->last - vPtr->first + 1;
- map = Blt_AssertMalloc(sizeof(size_t) * length);
- for (i = vPtr->first; i <= vPtr->last; i++) {
- map[i] = i;
- }
- /* Set global variables for sorting routine. */
- sortVectors = vectors;
- nSortVectors = nVectors;
- qsort((char *)map, length, sizeof(size_t),
- (QSortCompareProc *)CompareVectors);
- return map;
-}
-
-static size_t *
-SortVectors(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Vector **vectors, *v2Ptr;
- size_t *map;
- int i;
-
- vectors = Blt_AssertMalloc(sizeof(Vector *) * (objc + 1));
- vectors[0] = vPtr;
- map = NULL;
- for (i = 0; i < objc; i++) {
- if (Blt_Vec_LookupName(vPtr->dataPtr, Tcl_GetString(objv[i]),
- &v2Ptr) != TCL_OK) {
- goto error;
- }
- if (v2Ptr->length != vPtr->length) {
- Tcl_AppendResult(interp, "vector \"", v2Ptr->name,
- "\" is not the same size as \"", vPtr->name, "\"",
- (char *)NULL);
- goto error;
- }
- vectors[i + 1] = v2Ptr;
- }
- map = Blt_Vec_SortMap(vectors, objc + 1);
- error:
- Blt_Free(vectors);
- return map;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * SortOp --
- *
- * Sorts the vector object and any other vectors according to sorting
- * order of the vector object.
- *
- * Results:
- * A standard TCL result. If any of the auxiliary vectors are a
- * different size than the sorted vector object, TCL_ERROR is returned.
- * Otherwise TCL_OK is returned.
- *
- * Side Effects:
- * The vectors are sorted.
- *
- * vecName sort ?switches? vecName vecName...
- *---------------------------------------------------------------------------
- */
-static int
-SortOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Vector *v2Ptr;
- double *copy;
- size_t *map;
- size_t sortLength, nBytes;
- int result;
- int i;
- unsigned int n;
- SortSwitches switches;
-
- sortDecreasing = FALSE;
- switches.flags = 0;
- i = Blt_ParseSwitches(interp, sortSwitches, objc - 2, objv + 2, &switches,
- BLT_SWITCH_OBJV_PARTIAL);
- if (i < 0) {
- return TCL_ERROR;
- }
- objc -= i, objv += i;
- sortDecreasing = (switches.flags & SORT_DECREASING);
- if (objc > 2) {
- map = SortVectors(vPtr, interp, objc - 2, objv + 2);
- } else {
- map = Blt_Vec_SortMap(&vPtr, 1);
- }
- if (map == NULL) {
- return TCL_ERROR;
- }
- sortLength = vPtr->length;
- /*
- * Create an array to store a copy of the current values of the
- * vector. We'll merge the values back into the vector based upon the
- * indices found in the index array.
- */
- nBytes = sizeof(double) * sortLength;
- copy = Blt_AssertMalloc(nBytes);
- memcpy((char *)copy, (char *)vPtr->valueArr, nBytes);
- if (switches.flags & SORT_UNIQUE) {
- int count;
-
- for (count = n = 1; n < sortLength; n++) {
- size_t next, prev;
-
- next = map[n];
- prev = map[n - 1];
- if (copy[next] != copy[prev]) {
- map[count] = next;
- count++;
- }
- }
- sortLength = count;
- nBytes = sortLength * sizeof(double);
- }
- if (sortLength != vPtr->length) {
- Blt_Vec_SetLength(interp, vPtr, sortLength);
- }
- for (n = 0; n < sortLength; n++) {
- vPtr->valueArr[n] = copy[map[n]];
- }
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
-
- /* Now sort any other vectors in the same fashion. The vectors must be
- * the same size as the map though. */
- result = TCL_ERROR;
- for (i = 2; i < objc; i++) {
- if (Blt_Vec_LookupName(vPtr->dataPtr, Tcl_GetString(objv[i]),
- &v2Ptr) != TCL_OK) {
- goto error;
- }
- if (sortLength != v2Ptr->length) {
- Blt_Vec_SetLength(interp, v2Ptr, sortLength);
- }
- memcpy((char *)copy, (char *)v2Ptr->valueArr, nBytes);
- for (n = 0; n < sortLength; n++) {
- v2Ptr->valueArr[n] = copy[map[n]];
- }
- Blt_Vec_UpdateClients(v2Ptr);
- if (v2Ptr->flush) {
- Blt_Vec_FlushCache(v2Ptr);
- }
- }
- result = TCL_OK;
- error:
- Blt_Free(copy);
- Blt_Free(map);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InstExprOp --
- *
- * Computes the result of the expression which may be either a scalar
- * (single value) or vector (list of values).
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InstExprOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
-
- if (Blt_ExprVector(interp, Tcl_GetString(objv[2]), (Blt_Vector *)vPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ArithOp --
- *
- * Results:
- * A standard TCL result. If the source vector doesn't exist or the
- * source list is not a valid list of numbers, TCL_ERROR returned.
- * Otherwise TCL_OK is returned.
- *
- * Side Effects:
- * The vector data is reset. Clients of the vector are notified.
- * Any cached array indices are flushed.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ArithOp(Vector *vPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- double value;
- int i;
- Vector *v2Ptr;
- double scalar;
- Tcl_Obj *listObjPtr;
- char *string;
-
- v2Ptr = Blt_Vec_ParseElement((Tcl_Interp *)NULL, vPtr->dataPtr,
- Tcl_GetString(objv[2]), NULL, NS_SEARCH_BOTH);
- if (v2Ptr != NULL) {
- int j;
- int length;
-
- length = v2Ptr->last - v2Ptr->first + 1;
- if (length != vPtr->length) {
- Tcl_AppendResult(interp, "vectors \"", Tcl_GetString(objv[0]),
- "\" and \"", Tcl_GetString(objv[2]),
- "\" are not the same length", (char *)NULL);
- return TCL_ERROR;
- }
- string = Tcl_GetString(objv[1]);
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- switch (string[0]) {
- case '*':
- for (i = 0, j = v2Ptr->first; i < vPtr->length; i++, j++) {
- value = vPtr->valueArr[i] * v2Ptr->valueArr[j];
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(value));
- }
- break;
-
- case '/':
- for (i = 0, j = v2Ptr->first; i < vPtr->length; i++, j++) {
- value = vPtr->valueArr[i] / v2Ptr->valueArr[j];
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(value));
- }
- break;
-
- case '-':
- for (i = 0, j = v2Ptr->first; i < vPtr->length; i++, j++) {
- value = vPtr->valueArr[i] - v2Ptr->valueArr[j];
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(value));
- }
- break;
-
- case '+':
- for (i = 0, j = v2Ptr->first; i < vPtr->length; i++, j++) {
- value = vPtr->valueArr[i] + v2Ptr->valueArr[j];
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(value));
- }
- break;
- }
- Tcl_SetObjResult(interp, listObjPtr);
-
- } else if (Blt_ExprDoubleFromObj(interp, objv[2], &scalar) == TCL_OK) {
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- string = Tcl_GetString(objv[1]);
- switch (string[0]) {
- case '*':
- for (i = 0; i < vPtr->length; i++) {
- value = vPtr->valueArr[i] * scalar;
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(value));
- }
- break;
-
- case '/':
- for (i = 0; i < vPtr->length; i++) {
- value = vPtr->valueArr[i] / scalar;
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(value));
- }
- break;
-
- case '-':
- for (i = 0; i < vPtr->length; i++) {
- value = vPtr->valueArr[i] - scalar;
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(value));
- }
- break;
-
- case '+':
- for (i = 0; i < vPtr->length; i++) {
- value = vPtr->valueArr[i] + scalar;
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewDoubleObj(value));
- }
- break;
- }
- Tcl_SetObjResult(interp, listObjPtr);
- } else {
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * VectorInstCmd --
- *
- * Parses and invokes the appropriate vector instance command option.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_OpSpec vectorInstOps[] =
-{
- {"*", 1, ArithOp, 3, 3, "item",}, /*Deprecated*/
- {"+", 1, ArithOp, 3, 3, "item",}, /*Deprecated*/
- {"-", 1, ArithOp, 3, 3, "item",}, /*Deprecated*/
- {"/", 1, ArithOp, 3, 3, "item",}, /*Deprecated*/
- {"append", 1, AppendOp, 3, 0, "item ?item...?",},
- {"binread", 1, BinreadOp, 3, 0, "channel ?numValues? ?flags?",},
- {"clear", 1, ClearOp, 2, 2, "",},
- {"delete", 2, DeleteOp, 2, 0, "index ?index...?",},
- {"dup", 2, DupOp, 3, 0, "vecName",},
- {"expr", 1, InstExprOp, 3, 3, "expression",},
- {"fft", 1, FFTOp, 3, 0, "vecName ?switches?",},
- {"index", 3, IndexOp, 3, 4, "index ?value?",},
- {"inversefft",3, InverseFFTOp,4, 4, "vecName vecName",},
- {"length", 1, LengthOp, 2, 3, "?newSize?",},
- {"max", 2, MaxOp, 2, 2, "",},
- {"merge", 2, MergeOp, 3, 0, "vecName ?vecName...?",},
- {"min", 2, MinOp, 2, 2, "",},
- {"normalize", 3, NormalizeOp, 2, 3, "?vecName?",}, /*Deprecated*/
- {"notify", 3, NotifyOp, 3, 3, "keyword",},
- {"offset", 1, OffsetOp, 2, 3, "?offset?",},
- {"populate", 1, PopulateOp, 4, 4, "vecName density",},
- {"random", 4, RandomOp, 2, 2, "",}, /*Deprecated*/
- {"range", 4, RangeOp, 2, 4, "first last",},
- {"search", 3, SearchOp, 3, 5, "?-value? value ?value?",},
- {"seq", 3, SeqOp, 4, 5, "begin end ?num?",},
- {"set", 3, SetOp, 3, 3, "list",},
- {"simplify", 2, SimplifyOp, 2, 2, },
- {"sort", 2, SortOp, 2, 0, "?switches? ?vecName...?",},
- {"split", 2, SplitOp, 2, 0, "?vecName...?",},
- {"values", 3, ValuesOp, 2, 0, "?switches?",},
- {"variable", 3, MapOp, 2, 3, "?varName?",},
-};
-
-static int nInstOps = sizeof(vectorInstOps) / sizeof(Blt_OpSpec);
-
-int
-Blt_Vec_InstCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- VectorCmdProc *proc;
- Vector *vPtr = clientData;
-
- vPtr->first = 0;
- vPtr->last = vPtr->length - 1;
- proc = Blt_GetOpFromObj(interp, nInstOps, vectorInstOps, BLT_OP_ARG1, objc,
- objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (vPtr, interp, objc, objv);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_VarTrace --
- *
- * Results:
- * Returns NULL on success. Only called from a variable trace.
- *
- * Side effects:
- *
- *---------------------------------------------------------------------------
- */
-char *
-Blt_Vec_VarTrace(ClientData clientData, Tcl_Interp *interp, const char *part1,
- const char *part2, int flags)
-{
- Blt_VectorIndexProc *indexProc;
- Vector *vPtr = clientData;
- int first, last;
- int varFlags;
-#define MAX_ERR_MSG 1023
- static char message[MAX_ERR_MSG + 1];
-
- if (part2 == NULL) {
- if (flags & TCL_TRACE_UNSETS) {
- Blt_Free(vPtr->arrayName);
- vPtr->arrayName = NULL;
- if (vPtr->freeOnUnset) {
- Blt_Vec_Free(vPtr);
- }
- }
- return NULL;
- }
- if (Blt_Vec_GetIndexRange(interp, vPtr, part2, INDEX_ALL_FLAGS, &indexProc)
- != TCL_OK) {
- goto error;
- }
- first = vPtr->first, last = vPtr->last;
- varFlags = TCL_LEAVE_ERR_MSG | (TCL_GLOBAL_ONLY & flags);
- if (flags & TCL_TRACE_WRITES) {
- double value;
- Tcl_Obj *objPtr;
-
- if (first == SPECIAL_INDEX) { /* Tried to set "min" or "max" */
- return (char *)"read-only index";
- }
- objPtr = Tcl_GetVar2Ex(interp, part1, part2, varFlags);
- if (objPtr == NULL) {
- goto error;
- }
- if (Blt_ExprDoubleFromObj(interp, objPtr, &value) != TCL_OK) {
- if ((last == first) && (first >= 0)) {
- /* Single numeric index. Reset the array element to
- * its old value on errors */
- Tcl_SetVar2Ex(interp, part1, part2, objPtr, varFlags);
- }
- goto error;
- }
- if (first == vPtr->length) {
- if (Blt_Vec_ChangeLength((Tcl_Interp *)NULL, vPtr, vPtr->length + 1)
- != TCL_OK) {
- return (char *)"error resizing vector";
- }
- }
- /* Set possibly an entire range of values */
- ReplicateValue(vPtr, first, last, value);
- } else if (flags & TCL_TRACE_READS) {
- double value;
- Tcl_Obj *objPtr;
-
- if (vPtr->length == 0) {
- if (Tcl_SetVar2(interp, part1, part2, "", varFlags) == NULL) {
- goto error;
- }
- return NULL;
- }
- if (first == vPtr->length) {
- return (char *)"write-only index";
- }
- if (first == last) {
- if (first >= 0) {
- value = vPtr->valueArr[first];
- } else {
- vPtr->first = 0, vPtr->last = vPtr->length - 1;
- value = (*indexProc) ((Blt_Vector *) vPtr);
- }
- objPtr = Tcl_NewDoubleObj(value);
- if (Tcl_SetVar2Ex(interp, part1, part2, objPtr, varFlags) == NULL) {
- Tcl_DecrRefCount(objPtr);
- goto error;
- }
- } else {
- objPtr = GetValues(vPtr, first, last);
- if (Tcl_SetVar2Ex(interp, part1, part2, objPtr, varFlags) == NULL) {
- Tcl_DecrRefCount(objPtr);
- goto error;
- }
- }
- } else if (flags & TCL_TRACE_UNSETS) {
- int i, j;
-
- if ((first == vPtr->length) || (first == SPECIAL_INDEX)) {
- return (char *)"special vector index";
- }
- /*
- * Collapse the vector from the point of the first unset element.
- * Also flush any array variable entries so that the shift is
- * reflected when the array variable is read.
- */
- for (i = first, j = last + 1; j < vPtr->length; i++, j++) {
- vPtr->valueArr[i] = vPtr->valueArr[j];
- }
- vPtr->length -= ((last - first) + 1);
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- } else {
- return (char *)"unknown variable trace flag";
- }
- if (flags & (TCL_TRACE_UNSETS | TCL_TRACE_WRITES)) {
- Blt_Vec_UpdateClients(vPtr);
- }
- Tcl_ResetResult(interp);
- return NULL;
-
- error:
- strncpy(message, Tcl_GetStringResult(interp), MAX_ERR_MSG);
- message[MAX_ERR_MSG] = '\0';
- return message;
-}
diff --git a/blt3.0.1/src/bltVecInt.h b/blt3.0.1/src/bltVecInt.h
deleted file mode 100644
index 5d30f97..0000000
--- a/blt3.0.1/src/bltVecInt.h
+++ /dev/null
@@ -1,251 +0,0 @@
-
-/*
- * bltVecInt.h --
- *
- * Copyright 1995-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#include "bltInt.h"
-#include <bltHash.h>
-#include <bltChain.h>
-#include <bltVector.h>
-
-#define VECTOR_THREAD_KEY "BLT Vector Data"
-#define VECTOR_MAGIC ((unsigned int) 0x46170277)
-
-/* These defines allow parsing of different types of indices */
-
-#define INDEX_SPECIAL (1<<0) /* Recognize "min", "max", and "++end" as
- * valid indices */
-#define INDEX_COLON (1<<1) /* Also recognize a range of indices separated
- * by a colon */
-#define INDEX_CHECK (1<<2) /* Verify that the specified index or range of
- * indices are within limits */
-#define INDEX_ALL_FLAGS (INDEX_SPECIAL | INDEX_COLON | INDEX_CHECK)
-
-#define SPECIAL_INDEX -2
-
-#define FFT_NO_CONSTANT (1<<0)
-#define FFT_BARTLETT (1<<1)
-#define FFT_SPECTRUM (1<<2)
-
-typedef struct {
- Blt_HashTable vectorTable; /* Table of vectors */
- Blt_HashTable mathProcTable; /* Table of vector math functions */
- Blt_HashTable indexProcTable;
- Tcl_Interp *interp;
- unsigned int nextId;
-} VectorInterpData;
-
-/*
- * Vector --
- *
- * A vector is an array of double precision values. It can be accessed
- * through a TCL command, a TCL array variable, or C API. The storage for
- * the array points initially to a statically allocated buffer, but to
- * malloc-ed memory if more is necessary.
- *
- * Vectors can be shared by several clients (for example, two different
- * graph widgets). The data is shared. When a client wants to use a
- * vector, it allocates a vector identifier, which identifies the client.
- * Clients use this ID to specify a callback routine to be invoked
- * whenever the vector is modified or destroyed. Whenever the vector is
- * updated or destroyed, each client is notified of the change by their
- * callback routine.
- */
-
-typedef struct {
-
- /*
- * If you change these fields, make sure you change the definition of
- * Blt_Vector in bltInt.h and blt.h too.
- */
-
- double *valueArr; /* Array of values (malloc-ed) */
-
- int length; /* Current number of values in the array. */
-
- int size; /* Maximum number of values that can be stored
- * in the value array. */
-
- double min, max; /* Minimum and maximum values in the vector */
-
- int dirty; /* Indicates if the vector has been updated */
-
- int reserved;
-
- /* The following fields are local to this module */
-
- const char *name; /* The namespace-qualified name of the vector.
- * It points to the hash key allocated for the
- * entry in the vector hash table. */
-
- VectorInterpData *dataPtr;
- Tcl_Interp *interp; /* Interpreter associated with the
- * vector */
-
- Blt_HashEntry *hashPtr; /* If non-NULL, pointer in a hash table to
- * track the vectors in use. */
-
- Tcl_FreeProc *freeProc; /* Address of procedure to call to release
- * storage for the value array, Optionally can
- * be one of the following: TCL_STATIC,
- * TCL_DYNAMIC, or TCL_VOLATILE. */
-
- const char *arrayName; /* The name of the TCL array variable mapped
- * to the vector (malloc'ed). If NULL,
- * indicates that the vector isn't mapped to
- * any variable */
-
- Tcl_Namespace *nsPtr; /* Namespace context of the vector itself. */
-
- int offset; /* Offset from zero of the vector's starting
- * index */
-
- Tcl_Command cmdToken; /* Token for vector's TCL command. */
-
- Blt_Chain chain; /* List of clients using this vector */
-
- int notifyFlags; /* Notification flags. See definitions
- * below */
-
- int varFlags; /* Indicate if the variable is global,
- * namespace, or local */
-
- int freeOnUnset; /* For backward compatibility only: If
- * non-zero, free the vector when its variable
- * is unset. */
- int flush;
-
- int first, last; /* Selected region of vector. This is used
- * mostly for the math routines */
-} Vector;
-
-#define NOTIFY_UPDATED ((int)BLT_VECTOR_NOTIFY_UPDATE)
-#define NOTIFY_DESTROYED ((int)BLT_VECTOR_NOTIFY_DESTROY)
-
-#define NOTIFY_NEVER (1<<3) /* Never notify clients of updates to
- * the vector */
-#define NOTIFY_ALWAYS (1<<4) /* Notify clients after each update
- * of the vector is made */
-#define NOTIFY_WHENIDLE (1<<5) /* Notify clients at the next idle point
- * that the vector has been updated. */
-
-#define NOTIFY_PENDING (1<<6) /* A do-when-idle notification of the
- * vector's clients is pending. */
-#define NOTIFY_NOW (1<<7) /* Notify clients of changes once
- * immediately */
-
-#define NOTIFY_WHEN_MASK (NOTIFY_NEVER|NOTIFY_ALWAYS|NOTIFY_WHENIDLE)
-
-#define UPDATE_RANGE (1<<9) /* The data of the vector has changed.
- * Update the min and max limits when
- * they are needed */
-
-#define FindRange(array, first, last, min, max) \
-{ \
- min = max = 0.0; \
- if (first <= last) { \
- register int i; \
- min = max = array[first]; \
- for (i = first + 1; i <= last; i++) { \
- if (min > array[i]) { \
- min = array[i]; \
- } else if (max < array[i]) { \
- max = array[i]; \
- } \
- } \
- } \
-}
-
-BLT_EXTERN void Blt_Vec_InstallSpecialIndices(Blt_HashTable *tablePtr);
-
-BLT_EXTERN void Blt_Vec_InstallMathFunctions(Blt_HashTable *tablePtr);
-
-BLT_EXTERN void Blt_Vec_UninstallMathFunctions(Blt_HashTable *tablePtr);
-
-BLT_EXTERN VectorInterpData *Blt_Vec_GetInterpData (Tcl_Interp *interp);
-
-BLT_EXTERN double Blt_Vec_Max(Vector *vecObjPtr);
-BLT_EXTERN double Blt_Vec_Min(Vector *vecObjPtr);
-
-BLT_EXTERN Vector *Blt_Vec_New(VectorInterpData *dataPtr);
-
-BLT_EXTERN int Blt_Vec_Duplicate(Vector *destPtr, Vector *srcPtr);
-
-BLT_EXTERN int Blt_Vec_SetLength(Tcl_Interp *interp, Vector *vPtr,
- int length);
-
-BLT_EXTERN int Blt_Vec_SetSize(Tcl_Interp *interp, Vector *vPtr,
- int size);
-
-BLT_EXTERN int Blt_Vec_ChangeLength(Tcl_Interp *interp, Vector *vPtr,
- int length);
-
-BLT_EXTERN Vector *Blt_Vec_ParseElement(Tcl_Interp *interp,
- VectorInterpData *dataPtr, const char *start, const char **endPtr,
- int flags);
-
-BLT_EXTERN void Blt_Vec_Free(Vector *vPtr);
-
-BLT_EXTERN size_t *Blt_Vec_SortMap(Vector **vectors, int nVectors);
-
-BLT_EXTERN int Blt_Vec_LookupName(VectorInterpData *dataPtr,
- const char *vecName, Vector **vPtrPtr);
-
-BLT_EXTERN Vector *Blt_Vec_Create(VectorInterpData *dataPtr,
- const char *name, const char *cmdName, const char *varName,
- int *newPtr);
-
-BLT_EXTERN void Blt_Vec_UpdateRange(Vector *vPtr);
-
-BLT_EXTERN void Blt_Vec_UpdateClients(Vector *vPtr);
-
-BLT_EXTERN void Blt_Vec_FlushCache(Vector *vPtr);
-
-BLT_EXTERN int Blt_Vec_Reset(Vector *vPtr, double *dataArr,
- int nValues, int arraySize, Tcl_FreeProc *freeProc);
-
-BLT_EXTERN int Blt_Vec_GetIndex(Tcl_Interp *interp, Vector *vPtr,
- const char *string, int *indexPtr, int flags,
- Blt_VectorIndexProc **procPtrPtr);
-
-BLT_EXTERN int Blt_Vec_GetIndexRange(Tcl_Interp *interp, Vector *vPtr,
- const char *string, int flags, Blt_VectorIndexProc **procPtrPtr);
-
-BLT_EXTERN int Blt_Vec_MapVariable(Tcl_Interp *interp, Vector *vPtr,
- const char *name);
-
-BLT_EXTERN int Blt_Vec_FFT(Tcl_Interp *interp, Vector *realPtr,
- Vector *phasesPtr, Vector *freqPtr, double delta,
- int flags, Vector *srcPtr);
-
-BLT_EXTERN int Blt_Vec_InverseFFT(Tcl_Interp *interp, Vector *iSrcPtr,
- Vector *rDestPtr, Vector *iDestPtr, Vector *srcPtr);
-
-BLT_EXTERN Tcl_ObjCmdProc Blt_Vec_InstCmd;
-
-BLT_EXTERN Tcl_VarTraceProc Blt_Vec_VarTrace;
-
-BLT_EXTERN Tcl_IdleProc Blt_Vec_NotifyClients;
-
diff --git a/blt3.0.1/src/bltVecMath.c b/blt3.0.1/src/bltVecMath.c
deleted file mode 100644
index a0bd4af..0000000
--- a/blt3.0.1/src/bltVecMath.c
+++ /dev/null
@@ -1,1895 +0,0 @@
-
-/*
- * bltVecMath.c --
- *
- * This module implements mathematical expressions with vector data
- * objects.
- *
- * Copyright 1995-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltVecInt.h"
-#include "bltNsUtil.h"
-#include "bltParse.h"
-
-/*
- * Three types of math functions:
- *
- * ComponentProc Function is applied in multiple calls to
- * each component of the vector.
- * VectorProc Entire vector is passed, each component is
- * modified.
- * ScalarProc Entire vector is passed, single scalar value
- * is returned.
- */
-
-typedef double (ComponentProc)(double value);
-typedef int (VectorProc)(Vector *vPtr);
-typedef double (ScalarProc)(Vector *vPtr);
-
-/*
- * Built-in math functions:
- */
-typedef int (GenericMathProc) _ANSI_ARGS_(ANYARGS);
-
-/*
- * MathFunction --
- *
- * Contains information about math functions that can be called
- * for vectors. The table of math functions is global within the
- * application. So you can't define two different "sqrt"
- * functions.
- */
-typedef struct {
- const char *name; /* Name of built-in math function. If
- * NULL, indicates that the function
- * was user-defined and dynamically
- * allocated. Function names are
- * global across all interpreters. */
-
- void *proc; /* Procedure that implements this math
- * function. */
-
- ClientData clientData; /* Argument to pass when invoking the
- * function. */
-
-} MathFunction;
-
-
-/*
- * Macros for testing floating-point values for certain special cases:
- *
- * IS_NAN Test for not-a-number by comparing a value against itself
- * IF_INF Test for infinity by comparing against the largest floating
- * point value.
- */
-
-#define IS_NAN(v) ((v) != (v))
-
-#ifdef DBL_MAX
-# define IS_INF(v) (((v) > DBL_MAX) || ((v) < -DBL_MAX))
-#else
-# define IS_INF(v) 0
-#endif
-
-/* The data structure below is used to describe an expression value,
- * which can be either a double-precision floating-point value, or a
- * string. A given number has only one value at a time. */
-
-#define STATIC_STRING_SPACE 150
-
-/*
- * Tokens --
- *
- * The token types are defined below. In addition, there is a
- * table associating a precedence with each operator. The order
- * of types is important. Consult the code before changing it.
- */
-enum Tokens {
- VALUE, OPEN_PAREN, CLOSE_PAREN, COMMA, END, UNKNOWN,
- MULT = 8, DIVIDE, MOD, PLUS, MINUS,
- LEFT_SHIFT, RIGHT_SHIFT,
- LESS, GREATER, LEQ, GEQ, EQUAL, NEQ,
- OLD_BIT_AND, EXPONENT, OLD_BIT_OR, OLD_QUESTY, OLD_COLON,
- AND, OR, UNARY_MINUS, OLD_UNARY_PLUS, NOT, OLD_BIT_NOT
-};
-
-typedef struct {
- Vector *vPtr;
- char staticSpace[STATIC_STRING_SPACE];
- ParseValue pv; /* Used to hold a string value, if any. */
-} Value;
-
-/*
- * ParseInfo --
- *
- * The data structure below describes the state of parsing an
- * expression. It's passed among the routines in this module.
- */
-typedef struct {
- const char *expr; /* The entire right-hand side of the
- * expression, as originally passed to
- * Blt_ExprVector. */
-
- const char *nextPtr; /* Position of the next character to
- * be scanned from the expression
- * string. */
-
- enum Tokens token; /* Type of the last token to be parsed
- * from nextPtr. See below for
- * definitions. Corresponds to the
- * characters just before nextPtr. */
-
-} ParseInfo;
-
-/*
- * Precedence table. The values for non-operator token types are ignored.
- */
-static int precTable[] =
-{
- 0, 0, 0, 0, 0, 0, 0, 0,
- 12, 12, 12, /* MULT, DIVIDE, MOD */
- 11, 11, /* PLUS, MINUS */
- 10, 10, /* LEFT_SHIFT, RIGHT_SHIFT */
- 9, 9, 9, 9, /* LESS, GREATER, LEQ, GEQ */
- 8, 8, /* EQUAL, NEQ */
- 7, /* OLD_BIT_AND */
- 13, /* EXPONENTIATION */
- 5, /* OLD_BIT_OR */
- 4, /* AND */
- 3, /* OR */
- 2, /* OLD_QUESTY */
- 1, /* OLD_COLON */
- 14, 14, 14, 14 /* UNARY_MINUS, OLD_UNARY_PLUS, NOT,
- * OLD_BIT_NOT */
-};
-
-
-/*
- * Forward declarations.
- */
-
-static int NextValue(Tcl_Interp *interp, ParseInfo *piPtr, int prec,
- Value *valuePtr);
-
-#include <bltMath.h>
-
-/*
- *---------------------------------------------------------------------------
- *
- * Sort --
- *
- * A vector math function. Sorts the values of the given
- * vector.
- *
- * Results:
- * Always TCL_OK.
- *
- * Side Effects:
- * The vector is sorted.
- *
- *---------------------------------------------------------------------------
- */
-static int
-Sort(Vector *vPtr)
-{
- size_t *map;
- double *values;
- int i;
-
- map = Blt_Vec_SortMap(&vPtr, 1);
- values = Blt_AssertMalloc(sizeof(double) * vPtr->length);
- for(i = vPtr->first; i <= vPtr->last; i++) {
- values[i] = vPtr->valueArr[map[i]];
- }
- Blt_Free(map);
- for (i = vPtr->first; i <= vPtr->last; i++) {
- vPtr->valueArr[i] = values[i];
- }
- Blt_Free(values);
- return TCL_OK;
-}
-
-static double
-Length(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
-
- return (double)(vPtr->last - vPtr->first + 1);
-}
-
-double
-Blt_VecMax(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
-
- return Blt_Vec_Max(vPtr);
-}
-
-double
-Blt_VecMin(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
-
- return Blt_Vec_Min(vPtr);
-}
-
-
-static double
-Product(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
- double prod;
- double *vp, *vend;
-
- prod = 1.0;
- for(vp = vPtr->valueArr + vPtr->first,
- vend = vPtr->valueArr + vPtr->last; vp <= vend; vp++) {
- prod *= *vp;
- }
- return prod;
-}
-
-static double
-Sum(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
- double sum, c;
- double *vp, *vend;
-
- /* Kahan summation algorithm */
-
- vp = vPtr->valueArr + vPtr->first;
- sum = *vp++;
- c = 0.0; /* A running compensation for lost
- * low-order bits.*/
- for (vend = vPtr->valueArr + vPtr->last; vp <= vend; vp++) {
- double y, t;
-
- y = *vp - c; /* So far, so good: c is zero.*/
- t = sum + y; /* Alas, sum is big, y small, so
- * low-order digits of y are lost.*/
- c = (t - sum) - y; /* (t - sum) recovers the high-order
- * part of y; subtracting y recovers
- * -(low part of y) */
- sum = t;
- }
- return sum;
-}
-
-static double
-Mean(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
- double sum;
- int n;
-
- sum = Sum(vectorPtr);
- n = vPtr->last - vPtr->first + 1;
- return sum / (double)n;
-}
-
-/*
- * var = 1/N Sum( (x[i] - mean)^2 )
- */
-static double
-Variance(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
- double var, mean;
- double *vp, *vend;
- int count;
-
- mean = Mean(vectorPtr);
- var = 0.0;
- count = 0;
- for(vp = vPtr->valueArr + vPtr->first,
- vend = vPtr->valueArr + vPtr->last; vp <= vend; vp++) {
- double dx;
-
- dx = *vp - mean;
- var += dx * dx;
- count++;
- }
- if (count < 2) {
- return 0.0;
- }
- var /= (double)(count - 1);
- return var;
-}
-
-/*
- * skew = Sum( (x[i] - mean)^3 ) / (var^3/2)
- */
-static double
-Skew(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
- double diff, var, skew, mean, diffsq;
- double *vp, *vend;
- int count;
-
- mean = Mean(vectorPtr);
- var = skew = 0.0;
- count = 0;
- for(vp = vPtr->valueArr + vPtr->first,
- vend = vPtr->valueArr + vPtr->last; vp <= vend; vp++) {
- diff = *vp - mean;
- diff = FABS(diff);
- diffsq = diff * diff;
- var += diffsq;
- skew += diffsq * diff;
- count++;
- }
- if (count < 2) {
- return 0.0;
- }
- var /= (double)(count - 1);
- skew /= count * var * sqrt(var);
- return skew;
-}
-
-static double
-StdDeviation(Blt_Vector *vectorPtr)
-{
- double var;
-
- var = Variance(vectorPtr);
- if (var > 0.0) {
- return sqrt(var);
- }
- return 0.0;
-}
-
-
-static double
-AvgDeviation(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
- double diff, avg, mean;
- double *vp, *vend;
- int count;
-
- mean = Mean(vectorPtr);
- avg = 0.0;
- count = 0;
- for(vp = vPtr->valueArr + vPtr->first,
- vend = vPtr->valueArr + vPtr->last; vp <= vend; vp++) {
- diff = *vp - mean;
- avg += FABS(diff);
- count++;
- }
- if (count < 2) {
- return 0.0;
- }
- avg /= (double)count;
- return avg;
-}
-
-
-static double
-Kurtosis(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
- double diff, diffsq, kurt, var, mean;
- double *vp, *vend;
- int count;
-
- mean = Mean(vectorPtr);
- var = kurt = 0.0;
- count = 0;
- for(vp = vPtr->valueArr + vPtr->first,
- vend = vPtr->valueArr + vPtr->last; vp <= vend; vp++) {
- diff = *vp - mean;
- diffsq = diff * diff;
- var += diffsq;
- kurt += diffsq * diffsq;
- count++;
- }
- if (count < 2) {
- return 0.0;
- }
- var /= (double)(count - 1);
- if (var == 0.0) {
- return 0.0;
- }
- kurt /= (count * var * var);
- return kurt - 3.0; /* Fisher Kurtosis */
-}
-
-
-static double
-Median(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
- size_t *map;
- double q2;
- int mid;
-
- if (vPtr->length == 0) {
- return -DBL_MAX;
- }
- map = Blt_Vec_SortMap(&vPtr, 1);
- mid = (vPtr->length - 1) / 2;
-
- /*
- * Determine Q2 by checking if the number of elements [0..n-1] is
- * odd or even. If even, we must take the average of the two
- * middle values.
- */
- if (vPtr->length & 1) { /* Odd */
- q2 = vPtr->valueArr[map[mid]];
- } else { /* Even */
- q2 = (vPtr->valueArr[map[mid]] +
- vPtr->valueArr[map[mid + 1]]) * 0.5;
- }
- Blt_Free(map);
- return q2;
-}
-
-static double
-Q1(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
- double q1;
- size_t *map;
-
- if (vPtr->length == 0) {
- return -DBL_MAX;
- }
- map = Blt_Vec_SortMap(&vPtr, 1);
-
- if (vPtr->length < 4) {
- q1 = vPtr->valueArr[map[0]];
- } else {
- int mid, q;
-
- mid = (vPtr->length - 1) / 2;
- q = mid / 2;
-
- /*
- * Determine Q1 by checking if the number of elements in the
- * bottom half [0..mid) is odd or even. If even, we must
- * take the average of the two middle values.
- */
- if (mid & 1) { /* Odd */
- q1 = vPtr->valueArr[map[q]];
- } else { /* Even */
- q1 = (vPtr->valueArr[map[q]] +
- vPtr->valueArr[map[q + 1]]) * 0.5;
- }
- }
- Blt_Free(map);
- return q1;
-}
-
-static double
-Q3(Blt_Vector *vectorPtr)
-{
- Vector *vPtr = (Vector *)vectorPtr;
- double q3;
- size_t *map;
-
- if (vPtr->length == 0) {
- return -DBL_MAX;
- }
-
- map = Blt_Vec_SortMap(&vPtr, 1);
-
- if (vPtr->length < 4) {
- q3 = vPtr->valueArr[map[vPtr->length - 1]];
- } else {
- int mid, q;
-
- mid = (vPtr->length - 1) / 2;
- q = (vPtr->length + mid) / 2;
-
- /*
- * Determine Q3 by checking if the number of elements in the
- * upper half (mid..n-1] is odd or even. If even, we must
- * take the average of the two middle values.
- */
- if (mid & 1) { /* Odd */
- q3 = vPtr->valueArr[map[q]];
- } else { /* Even */
- q3 = (vPtr->valueArr[map[q]] +
- vPtr->valueArr[map[q + 1]]) * 0.5;
- }
- }
- Blt_Free(map);
- return q3;
-}
-
-
-static int
-Norm(Blt_Vector *vector)
-{
- Vector *vPtr = (Vector *)vector;
- double norm, range, min, max;
- int i;
-
- min = Blt_Vec_Min(vPtr);
- max = Blt_Vec_Max(vPtr);
- range = max - min;
- for (i = 0; i < vPtr->length; i++) {
- norm = (vPtr->valueArr[i] - min) / range;
- vPtr->valueArr[i] = norm;
- }
- return TCL_OK;
-}
-
-
-static double
-Nonzeros(Blt_Vector *vector)
-{
- Vector *vPtr = (Vector *)vector;
- int count;
- double *vp, *vend;
-
- count = 0;
- for(vp = vPtr->valueArr + vPtr->first,
- vend = vPtr->valueArr + vPtr->last; vp <= vend; vp++) {
- if (*vp == 0.0) {
- count++;
- }
- }
- return (double) count;
-}
-
-static double
-Fabs(double value)
-{
- if (value < 0.0) {
- return -value;
- }
- return value;
-}
-
-static double
-Round(double value)
-{
- if (value < 0.0) {
- return ceil(value - 0.5);
- } else {
- return floor(value + 0.5);
- }
-}
-
-static double
-Fmod(double x, double y)
-{
- if (y == 0.0) {
- return 0.0;
- }
- return x - (floor(x / y) * y);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MathError --
- *
- * This procedure is called when an error occurs during a
- * floating-point operation. It reads errno and sets
- * interp->result accordingly.
- *
- * Results:
- * Interp->result is set to hold an error message.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MathError(
- Tcl_Interp *interp, /* Where to store error message. */
- double value) /* Value returned after error; used to
- * distinguish underflows from
- * overflows. */
-{
- if ((errno == EDOM) || (value != value)) {
- Tcl_AppendResult(interp, "domain error: argument not in valid range",
- (char *)NULL);
- Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", interp->result,
- (char *)NULL);
- } else if ((errno == ERANGE) || IS_INF(value)) {
- if (value == 0.0) {
- Tcl_AppendResult(interp,
- "floating-point value too small to represent",
- (char *)NULL);
- Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", interp->result,
- (char *)NULL);
- } else {
- Tcl_AppendResult(interp,
- "floating-point value too large to represent",
- (char *)NULL);
- Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", interp->result,
- (char *)NULL);
- }
- } else {
- Tcl_AppendResult(interp, "unknown floating-point error, ",
- "errno = ", Blt_Itoa(errno), (char *)NULL);
- Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", interp->result,
- (char *)NULL);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ParseString --
- *
- * Given a string (such as one coming from command or variable
- * substitution), make a Value based on the string. The value
- * will be a floating-point or integer, if possible, or else it
- * will just be a copy of the string.
- *
- * Results:
- * TCL_OK is returned under normal circumstances, and TCL_ERROR
- * is returned if a floating-point overflow or underflow occurred
- * while reading in a number. The value at *valuePtr is modified
- * to hold a number, if possible.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-ParseString(
- Tcl_Interp *interp, /* Where to store error message. */
- const char *string, /* String to turn into value. */
- Value *valuePtr) /* Where to store value information.
- * Caller must have initialized pv field. */
-{
- const char *endPtr;
- double value;
-
- errno = 0;
-
- /*
- * The string can be either a number or a vector. First try to
- * convert the string to a number. If that fails then see if
- * we can find a vector by that name.
- */
-
- value = strtod(string, (char **)&endPtr);
- if ((endPtr != string) && (*endPtr == '\0')) {
- if (errno != 0) {
- Tcl_ResetResult(interp);
- MathError(interp, value);
- return TCL_ERROR;
- }
- /* Numbers are stored as single element vectors. */
- if (Blt_Vec_ChangeLength(interp, valuePtr->vPtr, 1) != TCL_OK) {
- return TCL_ERROR;
- }
- valuePtr->vPtr->valueArr[0] = value;
- return TCL_OK;
- } else {
- Vector *vPtr;
-
- while (isspace(UCHAR(*string))) {
- string++; /* Skip spaces leading the vector name. */
- }
- vPtr = Blt_Vec_ParseElement(interp, valuePtr->vPtr->dataPtr,
- string, &endPtr, NS_SEARCH_BOTH);
- if (vPtr == NULL) {
- return TCL_ERROR;
- }
- if (*endPtr != '\0') {
- Tcl_AppendResult(interp, "extra characters after vector",
- (char *)NULL);
- return TCL_ERROR;
- }
- /* Copy the designated vector to our temporary. */
- Blt_Vec_Duplicate(valuePtr->vPtr, vPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ParseMathFunction --
- *
- * This procedure is invoked to parse a math function from an
- * expression string, carry out the function, and return the
- * value computed.
- *
- * Results:
- * TCL_OK is returned if all went well and the function's value
- * was computed successfully. If the name doesn't match any
- * known math function, returns TCL_RETURN. And if a format error
- * was found, TCL_ERROR is returned and an error message is left
- * in interp->result.
- *
- * After a successful return piPtr will be updated to point to
- * the character just after the function call, the token is set
- * to VALUE, and the value is stored in valuePtr.
- *
- * Side effects:
- * Embedded commands could have arbitrary side-effects.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ParseMathFunction(
- Tcl_Interp *interp, /* Interpreter to use for error reporting. */
- const char *start, /* Start of string to parse */
- ParseInfo *piPtr, /* Describes the state of the parse.
- * piPtr->nextPtr must point to the
- * first character of the function's
- * name. */
- Value *valuePtr) /* Where to store value, if that is
- * what's parsed from string. Caller
- * must have initialized pv field
- * correctly. */
-{
- Blt_HashEntry *hPtr;
- MathFunction *mathPtr; /* Info about math function. */
- char *p;
- VectorInterpData *dataPtr; /* Interpreter-specific data. */
- GenericMathProc *proc;
-
- /*
- * Find the end of the math function's name and lookup the
- * record for the function.
- */
- p = (char *)start;
- while (isspace(UCHAR(*p))) {
- p++;
- }
- piPtr->nextPtr = p;
- while (isalnum(UCHAR(*p)) || (*p == '_')) {
- p++;
- }
- if (*p != '(') {
- return TCL_RETURN; /* Must start with open parenthesis */
- }
- dataPtr = valuePtr->vPtr->dataPtr;
- *p = '\0';
- hPtr = Blt_FindHashEntry(&dataPtr->mathProcTable, piPtr->nextPtr);
- *p = '(';
- if (hPtr == NULL) {
- return TCL_RETURN; /* Name doesn't match any known function */
- }
- /* Pick up the single value as the argument to the function */
- piPtr->token = OPEN_PAREN;
- piPtr->nextPtr = p + 1;
- valuePtr->pv.next = valuePtr->pv.buffer;
- if (NextValue(interp, piPtr, -1, valuePtr) != TCL_OK) {
- return TCL_ERROR; /* Parse error */
- }
- if (piPtr->token != CLOSE_PAREN) {
- Tcl_AppendResult(interp, "unmatched parentheses in expression \"",
- piPtr->expr, "\"", (char *)NULL);
- return TCL_ERROR; /* Missing right parenthesis */
- }
- mathPtr = Blt_GetHashValue(hPtr);
- proc = mathPtr->proc;
- if ((*proc) (mathPtr->clientData, interp, valuePtr->vPtr) != TCL_OK) {
- return TCL_ERROR; /* Function invocation error */
- }
- piPtr->token = VALUE;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextToken --
- *
- * Lexical analyzer for expression parser: parses a single value,
- * operator, or other syntactic element from an expression string.
- *
- * Results:
- * TCL_OK is returned unless an error occurred while doing lexical
- * analysis or executing an embedded command. In that case a
- * standard TCL error is returned, using interp->result to hold
- * an error message. In the event of a successful return, the token
- * and field in piPtr is updated to refer to the next symbol in
- * the expression string, and the expr field is advanced past that
- * token; if the token is a value, then the value is stored at
- * valuePtr.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-NextToken(
- Tcl_Interp *interp, /* Interpreter to use for error reporting. */
- ParseInfo *piPtr, /* Describes the state of the parse. */
- Value *valuePtr) /* Where to store value, if that is
- * what's parsed from string. Caller
- * must have initialized pv field
- * correctly. */
-{
- const char *p;
- const char *endPtr;
- const char *var;
- int result;
-
- p = piPtr->nextPtr;
- while (isspace(UCHAR(*p))) {
- p++;
- }
- if (*p == '\0') {
- piPtr->token = END;
- piPtr->nextPtr = p;
- return TCL_OK;
- }
- /*
- * Try to parse the token as a floating-point number. But check
- * that the first character isn't a "-" or "+", which "strtod"
- * will happily accept as an unary operator. Otherwise, we might
- * accidently treat a binary operator as unary by mistake, which
- * will eventually cause a syntax error.
- */
- if ((*p != '-') && (*p != '+')) {
- double value;
-
- errno = 0;
- value = strtod(p, (char **)&endPtr);
- if (endPtr != p) {
- if (errno != 0) {
- MathError(interp, value);
- return TCL_ERROR;
- }
- piPtr->token = VALUE;
- piPtr->nextPtr = endPtr;
-
- /*
- * Save the single floating-point value as an 1-component vector.
- */
- if (Blt_Vec_ChangeLength(interp, valuePtr->vPtr, 1) != TCL_OK) {
- return TCL_ERROR;
- }
- valuePtr->vPtr->valueArr[0] = value;
- return TCL_OK;
- }
- }
- piPtr->nextPtr = p + 1;
- switch (*p) {
- case '$':
- piPtr->token = VALUE;
- var = Tcl_ParseVar(interp, p, &endPtr);
- if (var == NULL) {
- return TCL_ERROR;
- }
- piPtr->nextPtr = endPtr;
- Tcl_ResetResult(interp);
- result = ParseString(interp, var, valuePtr);
- return result;
-
- case '[':
- piPtr->token = VALUE;
- result = Blt_ParseNestedCmd(interp, p + 1, 0, &endPtr, &valuePtr->pv);
- if (result != TCL_OK) {
- return result;
- }
- piPtr->nextPtr = endPtr;
- Tcl_ResetResult(interp);
- result = ParseString(interp, valuePtr->pv.buffer, valuePtr);
- return result;
-
- case '"':
- piPtr->token = VALUE;
- result = Blt_ParseQuotes(interp, p + 1, '"', 0, &endPtr, &valuePtr->pv);
- if (result != TCL_OK) {
- return result;
- }
- piPtr->nextPtr = endPtr;
- Tcl_ResetResult(interp);
- result = ParseString(interp, valuePtr->pv.buffer, valuePtr);
- return result;
-
- case '{':
- piPtr->token = VALUE;
- result = Blt_ParseBraces(interp, p + 1, &endPtr, &valuePtr->pv);
- if (result != TCL_OK) {
- return result;
- }
- piPtr->nextPtr = endPtr;
- Tcl_ResetResult(interp);
- result = ParseString(interp, valuePtr->pv.buffer, valuePtr);
- return result;
-
- case '(':
- piPtr->token = OPEN_PAREN;
- break;
-
- case ')':
- piPtr->token = CLOSE_PAREN;
- break;
-
- case ',':
- piPtr->token = COMMA;
- break;
-
- case '*':
- piPtr->token = MULT;
- break;
-
- case '/':
- piPtr->token = DIVIDE;
- break;
-
- case '%':
- piPtr->token = MOD;
- break;
-
- case '+':
- piPtr->token = PLUS;
- break;
-
- case '-':
- piPtr->token = MINUS;
- break;
-
- case '^':
- piPtr->token = EXPONENT;
- break;
-
- case '<':
- switch (*(p + 1)) {
- case '<':
- piPtr->nextPtr = p + 2;
- piPtr->token = LEFT_SHIFT;
- break;
- case '=':
- piPtr->nextPtr = p + 2;
- piPtr->token = LEQ;
- break;
- default:
- piPtr->token = LESS;
- break;
- }
- break;
-
- case '>':
- switch (*(p + 1)) {
- case '>':
- piPtr->nextPtr = p + 2;
- piPtr->token = RIGHT_SHIFT;
- break;
- case '=':
- piPtr->nextPtr = p + 2;
- piPtr->token = GEQ;
- break;
- default:
- piPtr->token = GREATER;
- break;
- }
- break;
-
- case '=':
- if (*(p + 1) == '=') {
- piPtr->nextPtr = p + 2;
- piPtr->token = EQUAL;
- } else {
- piPtr->token = UNKNOWN;
- }
- break;
-
- case '&':
- if (*(p + 1) == '&') {
- piPtr->nextPtr = p + 2;
- piPtr->token = AND;
- } else {
- piPtr->token = UNKNOWN;
- }
- break;
-
- case '|':
- if (*(p + 1) == '|') {
- piPtr->nextPtr = p + 2;
- piPtr->token = OR;
- } else {
- piPtr->token = UNKNOWN;
- }
- break;
-
- case '!':
- if (*(p + 1) == '=') {
- piPtr->nextPtr = p + 2;
- piPtr->token = NEQ;
- } else {
- piPtr->token = NOT;
- }
- break;
-
- default:
- piPtr->token = VALUE;
- result = ParseMathFunction(interp, p, piPtr, valuePtr);
- if ((result == TCL_OK) || (result == TCL_ERROR)) {
- return result;
- } else {
- Vector *vPtr;
-
- while (isspace(UCHAR(*p))) {
- p++; /* Skip spaces leading the vector name. */
- }
- vPtr = Blt_Vec_ParseElement(interp, valuePtr->vPtr->dataPtr,
- p, &endPtr, NS_SEARCH_BOTH);
- if (vPtr == NULL) {
- return TCL_ERROR;
- }
- Blt_Vec_Duplicate(valuePtr->vPtr, vPtr);
- piPtr->nextPtr = endPtr;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NextValue --
- *
- * Parse a "value" from the remainder of the expression in piPtr.
- *
- * Results:
- * Normally TCL_OK is returned. The value of the expression is
- * returned in *valuePtr. If an error occurred, then interp->result
- * contains an error message and TCL_ERROR is returned.
- * InfoPtr->token will be left pointing to the token AFTER the
- * expression, and piPtr->nextPtr will point to the character just
- * after the terminating token.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-NextValue(
- Tcl_Interp *interp, /* Interpreter to use for error reporting. */
- ParseInfo *piPtr, /* Describes the state of the parse
- * just before the value (i.e. NextToken will
- * be called to get first token of value). */
- int prec, /* Treat any un-parenthesized operator
- * with precedence <= this as the end
- * of the expression. */
- Value *valuePtr) /* Where to store the value of the expression.
- * Caller must have initialized pv field. */
-{
- Value value2; /* Second operand for current operator. */
- int operator; /* Current operator (either unary or binary). */
- int gotOp; /* Non-zero means already lexed the operator
- * (while picking up value for unary operator).
- * Don't lex again. */
- int result;
- Vector *vPtr, *v2Ptr;
- int i;
-
- /*
- * There are two phases to this procedure. First, pick off an initial
- * value. Then, parse (binary operator, value) pairs until done.
- */
-
- vPtr = valuePtr->vPtr;
- v2Ptr = Blt_Vec_New(vPtr->dataPtr);
- gotOp = FALSE;
- value2.vPtr = v2Ptr;
- value2.pv.buffer = value2.pv.next = value2.staticSpace;
- value2.pv.end = value2.pv.buffer + STATIC_STRING_SPACE - 1;
- value2.pv.expandProc = Blt_ExpandParseValue;
- value2.pv.clientData = NULL;
-
- result = NextToken(interp, piPtr, valuePtr);
- if (result != TCL_OK) {
- goto done;
- }
- if (piPtr->token == OPEN_PAREN) {
-
- /* Parenthesized sub-expression. */
-
- result = NextValue(interp, piPtr, -1, valuePtr);
- if (result != TCL_OK) {
- goto done;
- }
- if (piPtr->token != CLOSE_PAREN) {
- Tcl_AppendResult(interp, "unmatched parentheses in expression \"",
- piPtr->expr, "\"", (char *)NULL);
- result = TCL_ERROR;
- goto done;
- }
- } else {
- if (piPtr->token == MINUS) {
- piPtr->token = UNARY_MINUS;
- }
- if (piPtr->token >= UNARY_MINUS) {
- operator = piPtr->token;
- result = NextValue(interp, piPtr, precTable[operator], valuePtr);
- if (result != TCL_OK) {
- goto done;
- }
- gotOp = TRUE;
- /* Process unary operators. */
- switch (operator) {
- case UNARY_MINUS:
- for(i = 0; i < vPtr->length; i++) {
- vPtr->valueArr[i] = -(vPtr->valueArr[i]);
- }
- break;
-
- case NOT:
- for(i = 0; i < vPtr->length; i++) {
- vPtr->valueArr[i] = (double)(!vPtr->valueArr[i]);
- }
- break;
- default:
- Tcl_AppendResult(interp, "unknown operator", (char *)NULL);
- goto error;
- }
- } else if (piPtr->token != VALUE) {
- Tcl_AppendResult(interp, "missing operand", (char *)NULL);
- goto error;
- }
- }
- if (!gotOp) {
- result = NextToken(interp, piPtr, &value2);
- if (result != TCL_OK) {
- goto done;
- }
- }
- /*
- * Got the first operand. Now fetch (operator, operand) pairs.
- */
- for (;;) {
- operator = piPtr->token;
-
- value2.pv.next = value2.pv.buffer;
- if ((operator < MULT) || (operator >= UNARY_MINUS)) {
- if ((operator == END) || (operator == CLOSE_PAREN) ||
- (operator == COMMA)) {
- result = TCL_OK;
- goto done;
- } else {
- Tcl_AppendResult(interp, "bad operator", (char *)NULL);
- goto error;
- }
- }
- if (precTable[operator] <= prec) {
- result = TCL_OK;
- goto done;
- }
- result = NextValue(interp, piPtr, precTable[operator], &value2);
- if (result != TCL_OK) {
- goto done;
- }
- if ((piPtr->token < MULT) && (piPtr->token != VALUE) &&
- (piPtr->token != END) && (piPtr->token != CLOSE_PAREN) &&
- (piPtr->token != COMMA)) {
- Tcl_AppendResult(interp, "unexpected token in expression",
- (char *)NULL);
- goto error;
- }
- /*
- * At this point we have two vectors and an operator.
- */
-
- if (v2Ptr->length == 1) {
- double *opnd;
- double scalar;
-
- /*
- * 2nd operand is a scalar.
- */
- scalar = v2Ptr->valueArr[0];
- opnd = vPtr->valueArr;
- switch (operator) {
- case MULT:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] *= scalar;
- }
- break;
-
- case DIVIDE:
- if (scalar == 0.0) {
- Tcl_AppendResult(interp, "divide by zero", (char *)NULL);
- goto error;
- }
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] /= scalar;
- }
- break;
-
- case PLUS:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] += scalar;
- }
- break;
-
- case MINUS:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] -= scalar;
- }
- break;
-
- case EXPONENT:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = pow(opnd[i], scalar);
- }
- break;
-
- case MOD:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = Fmod(opnd[i], scalar);
- }
- break;
-
- case LESS:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(opnd[i] < scalar);
- }
- break;
-
- case GREATER:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(opnd[i] > scalar);
- }
- break;
-
- case LEQ:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(opnd[i] <= scalar);
- }
- break;
-
- case GEQ:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(opnd[i] >= scalar);
- }
- break;
-
- case EQUAL:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(opnd[i] == scalar);
- }
- break;
-
- case NEQ:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(opnd[i] != scalar);
- }
- break;
-
- case AND:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(opnd[i] && scalar);
- }
- break;
-
- case OR:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(opnd[i] || scalar);
- }
- break;
-
- case LEFT_SHIFT:
- {
- int offset;
-
- offset = (int)scalar % vPtr->length;
- if (offset > 0) {
- double *hold;
- int j;
-
- hold = Blt_AssertMalloc(sizeof(double) * offset);
- for (i = 0; i < offset; i++) {
- hold[i] = opnd[i];
- }
- for (i = offset, j = 0; i < vPtr->length; i++, j++) {
- opnd[j] = opnd[i];
- }
- for (i = 0, j = vPtr->length - offset;
- j < vPtr->length; i++, j++) {
- opnd[j] = hold[i];
- }
- Blt_Free(hold);
- }
- }
- break;
-
- case RIGHT_SHIFT:
- {
- int offset;
-
- offset = (int)scalar % vPtr->length;
- if (offset > 0) {
- double *hold;
- int j;
-
- hold = Blt_AssertMalloc(sizeof(double) * offset);
- for (i = vPtr->length - offset, j = 0;
- i < vPtr->length; i++, j++) {
- hold[j] = opnd[i];
- }
- for (i = vPtr->length - offset - 1,
- j = vPtr->length - 1; i >= 0; i--, j--) {
- opnd[j] = opnd[i];
- }
- for (i = 0; i < offset; i++) {
- opnd[i] = hold[i];
- }
- Blt_Free(hold);
- }
- }
- break;
-
- default:
- Tcl_AppendResult(interp, "unknown operator in expression",
- (char *)NULL);
- goto error;
- }
-
- } else if (vPtr->length == 1) {
- double *opnd;
- double scalar;
-
- /*
- * 1st operand is a scalar.
- */
- scalar = vPtr->valueArr[0];
- Blt_Vec_Duplicate(vPtr, v2Ptr);
- opnd = vPtr->valueArr;
- switch (operator) {
- case MULT:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] *= scalar;
- }
- break;
-
- case PLUS:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] += scalar;
- }
- break;
-
- case DIVIDE:
- for(i = 0; i < vPtr->length; i++) {
- if (opnd[i] == 0.0) {
- Tcl_AppendResult(interp, "divide by zero",
- (char *)NULL);
- goto error;
- }
- opnd[i] = (scalar / opnd[i]);
- }
- break;
-
- case MINUS:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = scalar - opnd[i];
- }
- break;
-
- case EXPONENT:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = pow(scalar, opnd[i]);
- }
- break;
-
- case MOD:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = Fmod(scalar, opnd[i]);
- }
- break;
-
- case LESS:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(scalar < opnd[i]);
- }
- break;
-
- case GREATER:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(scalar > opnd[i]);
- }
- break;
-
- case LEQ:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(scalar >= opnd[i]);
- }
- break;
-
- case GEQ:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(scalar <= opnd[i]);
- }
- break;
-
- case EQUAL:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(opnd[i] == scalar);
- }
- break;
-
- case NEQ:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(opnd[i] != scalar);
- }
- break;
-
- case AND:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(opnd[i] && scalar);
- }
- break;
-
- case OR:
- for(i = 0; i < vPtr->length; i++) {
- opnd[i] = (double)(opnd[i] || scalar);
- }
- break;
-
- case LEFT_SHIFT:
- case RIGHT_SHIFT:
- Tcl_AppendResult(interp, "second shift operand must be scalar",
- (char *)NULL);
- goto error;
-
- default:
- Tcl_AppendResult(interp, "unknown operator in expression",
- (char *)NULL);
- goto error;
- }
- } else {
- double *opnd1, *opnd2;
- /*
- * Carry out the function of the specified operator.
- */
- if (vPtr->length != v2Ptr->length) {
- Tcl_AppendResult(interp, "vectors are different lengths",
- (char *)NULL);
- goto error;
- }
- opnd1 = vPtr->valueArr, opnd2 = v2Ptr->valueArr;
- switch (operator) {
- case MULT:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] *= opnd2[i];
- }
- break;
-
- case DIVIDE:
- for (i = 0; i < vPtr->length; i++) {
- if (opnd2[i] == 0.0) {
- Tcl_AppendResult(interp,
- "can't divide by 0.0 vector component",
- (char *)NULL);
- goto error;
- }
- opnd1[i] /= opnd2[i];
- }
- break;
-
- case PLUS:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] += opnd2[i];
- }
- break;
-
- case MINUS:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] -= opnd2[i];
- }
- break;
-
- case MOD:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] = Fmod(opnd1[i], opnd2[i]);
- }
- break;
-
- case EXPONENT:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] = pow(opnd1[i], opnd2[i]);
- }
- break;
-
- case LESS:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] = (double)(opnd1[i] < opnd2[i]);
- }
- break;
-
- case GREATER:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] = (double)(opnd1[i] > opnd2[i]);
- }
- break;
-
- case LEQ:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] = (double)(opnd1[i] <= opnd2[i]);
- }
- break;
-
- case GEQ:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] = (double)(opnd1[i] >= opnd2[i]);
- }
- break;
-
- case EQUAL:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] = (double)(opnd1[i] == opnd2[i]);
- }
- break;
-
- case NEQ:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] = (double)(opnd1[i] != opnd2[i]);
- }
- break;
-
- case AND:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] = (double)(opnd1[i] && opnd2[i]);
- }
- break;
-
- case OR:
- for (i = 0; i < vPtr->length; i++) {
- opnd1[i] = (double)(opnd1[i] || opnd2[i]);
- }
- break;
-
- case LEFT_SHIFT:
- case RIGHT_SHIFT:
- Tcl_AppendResult(interp, "second shift operand must be scalar",
- (char *)NULL);
- goto error;
-
- default:
- Tcl_AppendResult(interp, "unknown operator in expression",
- (char *)NULL);
- goto error;
- }
- }
- }
- done:
- if (value2.pv.buffer != value2.staticSpace) {
- Blt_Free(value2.pv.buffer);
- }
- Blt_Vec_Free(v2Ptr);
- return result;
-
- error:
- if (value2.pv.buffer != value2.staticSpace) {
- Blt_Free(value2.pv.buffer);
- }
- Blt_Vec_Free(v2Ptr);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * EvaluateExpression --
- *
- * This procedure provides top-level functionality shared by
- * procedures like Tcl_ExprInt, Tcl_ExprDouble, etc.
- *
- * Results:
- * The result is a standard TCL return value. If an error
- * occurs then an error message is left in interp->result.
- * The value of the expression is returned in *valuePtr, in
- * whatever form it ends up in (could be string or integer
- * or double). Caller may need to convert result. Caller
- * is also responsible for freeing string memory in *valuePtr,
- * if any was allocated.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-EvaluateExpression(
- Tcl_Interp *interp, /* Context in which to evaluate the
- * expression. */
- char *string, /* Expression to evaluate. */
- Value *valuePtr) /* Where to store result. Should
- * not be initialized by caller. */
-{
- ParseInfo info;
- int result;
- Vector *vPtr;
- double *vp, *vend;
-
- info.expr = info.nextPtr = string;
- valuePtr->pv.buffer = valuePtr->pv.next = valuePtr->staticSpace;
- valuePtr->pv.end = valuePtr->pv.buffer + STATIC_STRING_SPACE - 1;
- valuePtr->pv.expandProc = Blt_ExpandParseValue;
- valuePtr->pv.clientData = NULL;
-
- result = NextValue(interp, &info, -1, valuePtr);
- if (result != TCL_OK) {
- return result;
- }
- if (info.token != END) {
- Tcl_AppendResult(interp, ": syntax error in expression \"",
- string, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- vPtr = valuePtr->vPtr;
-
- /* Check for NaN's and overflows. */
- for (vp = vPtr->valueArr, vend = vp + vPtr->length; vp < vend; vp++) {
- if (!FINITE(*vp)) {
- /*
- * IEEE floating-point error.
- */
- MathError(interp, *vp);
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Math Functions --
- *
- * This page contains the procedures that implement all of the
- * built-in math functions for expressions.
- *
- * Results:
- * Each procedure returns TCL_OK if it succeeds and places result
- * information at *resultPtr. If it fails it returns TCL_ERROR
- * and leaves an error message in interp->result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ComponentFunc(
- ClientData clientData, /* Contains address of procedure that
- * takes one double argument and
- * returns a double result. */
- Tcl_Interp *interp,
- Vector *vPtr)
-{
- ComponentProc *procPtr = (ComponentProc *) clientData;
- double *vp, *vend;
-
- errno = 0;
- for(vp = vPtr->valueArr + vPtr->first,
- vend = vPtr->valueArr + vPtr->last; vp <= vend; vp++) {
- *vp = (*procPtr) (*vp);
- if (errno != 0) {
- MathError(interp, *vp);
- return TCL_ERROR;
- }
- if (!FINITE(*vp)) {
- /*
- * IEEE floating-point error.
- */
- MathError(interp, *vp);
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-static int
-ScalarFunc(ClientData clientData, Tcl_Interp *interp, Vector *vPtr)
-{
- double value;
- ScalarProc *procPtr = (ScalarProc *) clientData;
-
- errno = 0;
- value = (*procPtr) (vPtr);
- if (errno != 0) {
- MathError(interp, value);
- return TCL_ERROR;
- }
- if (Blt_Vec_ChangeLength(interp, vPtr, 1) != TCL_OK) {
- return TCL_ERROR;
- }
- vPtr->valueArr[0] = value;
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-VectorFunc(ClientData clientData, Tcl_Interp *interp, Vector *vPtr)
-{
- VectorProc *procPtr = (VectorProc *) clientData;
-
- return (*procPtr) (vPtr);
-}
-
-
-static MathFunction mathFunctions[] =
-{
- {"abs", ComponentFunc, Fabs},
- {"acos", ComponentFunc, acos},
- {"asin", ComponentFunc, asin},
- {"atan", ComponentFunc, atan},
- {"adev", ScalarFunc, AvgDeviation},
- {"ceil", ComponentFunc, ceil},
- {"cos", ComponentFunc, cos},
- {"cosh", ComponentFunc, cosh},
- {"exp", ComponentFunc, exp},
- {"floor", ComponentFunc, floor},
- {"kurtosis",ScalarFunc, Kurtosis},
- {"length", ScalarFunc, Length},
- {"log", ComponentFunc, log},
- {"log10", ComponentFunc, log10},
- {"max", ScalarFunc, Blt_VecMax},
- {"mean", ScalarFunc, Mean},
- {"median", ScalarFunc, Median},
- {"min", ScalarFunc, Blt_VecMin},
- {"norm", VectorFunc, Norm},
- {"nz", ScalarFunc, Nonzeros},
- {"q1", ScalarFunc, Q1},
- {"q3", ScalarFunc, Q3},
- {"prod", ScalarFunc, Product},
- {"random", ComponentFunc, drand48},
- {"round", ComponentFunc, Round},
- {"sdev", ScalarFunc, StdDeviation},
- {"sin", ComponentFunc, sin},
- {"sinh", ComponentFunc, sinh},
- {"skew", ScalarFunc, Skew},
- {"sort", VectorFunc, Sort},
- {"sqrt", ComponentFunc, sqrt},
- {"sum", ScalarFunc, Sum},
- {"tan", ComponentFunc, tan},
- {"tanh", ComponentFunc, tanh},
- {"var", ScalarFunc, Variance},
- {(char *)NULL,},
-};
-
-void
-Blt_Vec_InstallMathFunctions(Blt_HashTable *tablePtr)
-{
- MathFunction *mathPtr;
-
- for (mathPtr = mathFunctions; mathPtr->name != NULL; mathPtr++) {
- Blt_HashEntry *hPtr;
- int isNew;
-
- hPtr = Blt_CreateHashEntry(tablePtr, mathPtr->name, &isNew);
- Blt_SetHashValue(hPtr, (ClientData)mathPtr);
- }
-}
-
-void
-Blt_Vec_UninstallMathFunctions(Blt_HashTable *tablePtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(tablePtr, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
- MathFunction *mathPtr;
-
- mathPtr = Blt_GetHashValue(hPtr);
- if (mathPtr->name == NULL) {
- Blt_Free(mathPtr);
- }
- }
-}
-
-
-static void
-InstallIndexProc(
- Blt_HashTable *tablePtr,
- const char *string,
- Blt_VectorIndexProc *procPtr) /* Pointer to function to be called
- * when the vector finds the named index.
- * If NULL, this indicates to remove
- * the index from the table.
- */
-{
- Blt_HashEntry *hPtr;
- int dummy;
-
- hPtr = Blt_CreateHashEntry(tablePtr, string, &dummy);
- if (procPtr == NULL) {
- Blt_DeleteHashEntry(tablePtr, hPtr);
- } else {
- Blt_SetHashValue(hPtr, (ClientData)procPtr);
- }
-}
-
-void
-Blt_Vec_InstallSpecialIndices(Blt_HashTable *tablePtr)
-{
- InstallIndexProc(tablePtr, "min", Blt_VecMin);
- InstallIndexProc(tablePtr, "max", Blt_VecMax);
- InstallIndexProc(tablePtr, "mean", Mean);
- InstallIndexProc(tablePtr, "sum", Sum);
- InstallIndexProc(tablePtr, "prod", Product);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ExprVector --
- *
- * Evaluates an vector expression and returns its value(s).
- *
- * Results:
- * Each of the procedures below returns a standard TCL result.
- * If an error occurs then an error message is left in
- * interp->result. Otherwise the value of the expression,
- * in the appropriate form, is stored at *resultPtr. If
- * the expression had a result that was incompatible with the
- * desired form then an error is returned.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_ExprVector(
- Tcl_Interp *interp, /* Context in which to evaluate the
- * expression. */
- char *string, /* Expression to evaluate. */
- Blt_Vector *vector) /* Where to store result. */
-{
- VectorInterpData *dataPtr; /* Interpreter-specific data. */
- Vector *vPtr = (Vector *)vector;
- Value value;
-
- dataPtr = (vector != NULL)
- ? vPtr->dataPtr : Blt_Vec_GetInterpData(interp);
- value.vPtr = Blt_Vec_New(dataPtr);
- if (EvaluateExpression(interp, string, &value) != TCL_OK) {
- Blt_Vec_Free(value.vPtr);
- return TCL_ERROR;
- }
- if (vPtr != NULL) {
- Blt_Vec_Duplicate(vPtr, value.vPtr);
- } else {
- Tcl_Obj *listObjPtr;
- double *vp, *vend;
-
- /* No result vector. Put values in interp->result. */
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- for (vp = value.vPtr->valueArr, vend = vp + value.vPtr->length;
- vp < vend; vp++) {
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewDoubleObj(*vp));
- }
- Tcl_SetObjResult(interp, listObjPtr);
- }
- Blt_Vec_Free(value.vPtr);
- return TCL_OK;
-}
diff --git a/blt3.0.1/src/bltVector.c b/blt3.0.1/src/bltVector.c
deleted file mode 100644
index e332b9d..0000000
--- a/blt3.0.1/src/bltVector.c
+++ /dev/null
@@ -1,2808 +0,0 @@
-
-/*
- * bltVector.c --
- *
- * This module implements vector data objects.
- *
- * Copyright 1995-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * TODO:
- * o Add H. Kirsch's vector binary read operation
- * x binread file0
- * x binread -file file0
- *
- * o Add ASCII/binary file reader
- * x read fileName
- *
- * o Allow Tcl-based client notifications.
- * vector x
- * x notify call Display
- * x notify delete Display
- * x notify reorder #1 #2
- */
-
-#include "bltVecInt.h"
-#include "bltOp.h"
-#include "bltNsUtil.h"
-#include "bltSwitch.h"
-#include <bltMath.h>
-
-#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif /* HAVE_SYS_TIME_H */
-#endif /* TIME_WITH_SYS_TIME */
-
-#ifndef TCL_NAMESPACE_ONLY
-#define TCL_NAMESPACE_ONLY TCL_GLOBAL_ONLY
-#endif
-
-#define DEF_ARRAY_SIZE 64
-#define TRACE_ALL (TCL_TRACE_WRITES | TCL_TRACE_READS | TCL_TRACE_UNSETS)
-
-
-#define VECTOR_CHAR(c) ((isalnum(UCHAR(c))) || \
- (c == '_') || (c == ':') || (c == '@') || (c == '.'))
-
-
-/*
- * VectorClient --
- *
- * A vector can be shared by several clients. Each client allocates this
- * structure that acts as its key for using the vector. Clients can also
- * designate a callback routine that is executed whenever the vector is
- * updated or destroyed.
- *
- */
-typedef struct {
- unsigned int magic; /* Magic value designating whether this really
- * is a vector token or not */
-
- Vector *serverPtr; /* Pointer to the master record of the vector.
- * If NULL, indicates that the vector has been
- * destroyed but as of yet, this client hasn't
- * recognized it. */
-
- Blt_VectorChangedProc *proc;/* Routine to call when the contents of the
- * vector change or the vector is deleted. */
-
- ClientData clientData; /* Data passed whenever the vector change
- * procedure is called. */
-
- Blt_ChainLink link; /* Used to quickly remove this entry from its
- * server's client chain. */
-} VectorClient;
-
-static Tcl_CmdDeleteProc VectorInstDeleteProc;
-static Tcl_ObjCmdProc VectorCmd;
-static Tcl_InterpDeleteProc VectorInterpDeleteProc;
-
-typedef struct {
- char *varName; /* Requested variable name. */
- char *cmdName; /* Requested command name. */
- int flush; /* Flush */
- int watchUnset; /* Watch when variable is unset. */
-} CreateSwitches;
-
-static Blt_SwitchSpec createSwitches[] =
-{
- {BLT_SWITCH_STRING, "-variable", "varName",
- Blt_Offset(CreateSwitches, varName), BLT_SWITCH_NULL_OK},
- {BLT_SWITCH_STRING, "-command", "command",
- Blt_Offset(CreateSwitches, cmdName), BLT_SWITCH_NULL_OK},
- {BLT_SWITCH_BOOLEAN, "-watchunset", "bool",
- Blt_Offset(CreateSwitches, watchUnset), 0},
- {BLT_SWITCH_BOOLEAN, "-flush", "bool",
- Blt_Offset(CreateSwitches, flush), 0},
- {BLT_SWITCH_END}
-};
-
-typedef int (VectorCmdProc)(Vector *vecObjPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-
-static Vector *
-FindVectorInNamespace(
- VectorInterpData *dataPtr, /* Interpreter-specific data. */
- Blt_ObjectName *objNamePtr)
-{
- Tcl_DString dString;
- const char *name;
- Blt_HashEntry *hPtr;
-
- name = Blt_MakeQualifiedName(objNamePtr, &dString);
- hPtr = Blt_FindHashEntry(&dataPtr->vectorTable, name);
- Tcl_DStringFree(&dString);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetVectorObject --
- *
- * Searches for the vector associated with the name given. Allow for a
- * range specification.
- *
- * Results:
- * Returns a pointer to the vector if found, otherwise NULL.
- *
- *---------------------------------------------------------------------------
- */
-static Vector *
-GetVectorObject(
- VectorInterpData *dataPtr, /* Interpreter-specific data. */
- const char *name,
- int flags)
-{
- Blt_ObjectName objName;
- Vector *vPtr;
- Tcl_Interp *interp;
-
- interp = dataPtr->interp;
- if (!Blt_ParseObjectName(interp, name, &objName,
- BLT_NO_ERROR_MSG | BLT_NO_DEFAULT_NS)) {
- return NULL; /* Can't find namespace. */
- }
- vPtr = NULL;
- if (objName.nsPtr != NULL) {
- vPtr = FindVectorInNamespace(dataPtr, &objName);
- } else {
- if (flags & NS_SEARCH_CURRENT) {
- objName.nsPtr = Tcl_GetCurrentNamespace(interp);
- vPtr = FindVectorInNamespace(dataPtr, &objName);
- }
- if ((vPtr == NULL) && (flags & NS_SEARCH_GLOBAL)) {
- objName.nsPtr = Tcl_GetGlobalNamespace(interp);
- vPtr = FindVectorInNamespace(dataPtr, &objName);
- }
- }
- return vPtr;
-}
-
-void
-Blt_Vec_UpdateRange(Vector *vPtr)
-{
- double min, max;
- double *vp, *vend;
-
- vp = vPtr->valueArr + vPtr->first;
- vend = vPtr->valueArr + vPtr->last;
- min = max = *vp++;
- for (/* empty */; vp <= vend; vp++) {
- if (min > *vp) {
- min = *vp;
- } else if (max < *vp) {
- max = *vp;
- }
- }
- vPtr->min = min;
- vPtr->max = max;
- vPtr->notifyFlags &= ~UPDATE_RANGE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_GetIndex --
- *
- * Converts the string representing an index in the vector, to its
- * numeric value. A valid index may be an numeric string of the string
- * "end" (indicating the last element in the string).
- *
- * Results:
- * A standard TCL result. If the string is a valid index, TCL_OK is
- * returned. Otherwise TCL_ERROR is returned and interp->result will
- * contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Vec_GetIndex(
- Tcl_Interp *interp,
- Vector *vPtr,
- const char *string,
- int *indexPtr,
- int flags,
- Blt_VectorIndexProc **procPtrPtr)
-{
- char c;
- int value;
-
- c = string[0];
-
- /* Treat the index "end" like a numeric index. */
-
- if ((c == 'e') && (strcmp(string, "end") == 0)) {
- if (vPtr->length < 1) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "bad index \"end\": vector is empty",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- *indexPtr = vPtr->length - 1;
- return TCL_OK;
- } else if ((c == '+') && (strcmp(string, "++end") == 0)) {
- *indexPtr = vPtr->length;
- return TCL_OK;
- }
- if (procPtrPtr != NULL) {
- Blt_HashEntry *hPtr;
-
- hPtr = Blt_FindHashEntry(&vPtr->dataPtr->indexProcTable, string);
- if (hPtr != NULL) {
- *indexPtr = SPECIAL_INDEX;
- *procPtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
- }
- }
- if (Tcl_GetInt(interp, (char *)string, &value) != TCL_OK) {
- long int lvalue;
- /*
- * Unlike Tcl_GetInt, Tcl_ExprLong needs a valid interpreter, but the
- * interp passed in may be NULL. So we have to use vPtr->interp and
- * then reset the result.
- */
- if (Tcl_ExprLong(vPtr->interp, (char *)string, &lvalue) != TCL_OK) {
- Tcl_ResetResult(vPtr->interp);
- if (interp != NULL) {
- Tcl_AppendResult(interp, "bad index \"", string, "\"",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- value = (int)lvalue;
- }
- /*
- * Correct the index by the current value of the offset. This makes all
- * the numeric indices non-negative, which is how we distinguish the
- * special non-numeric indices.
- */
- value -= vPtr->offset;
-
- if ((value < 0) || ((flags & INDEX_CHECK) && (value >= vPtr->length))) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "index \"", string, "\" is out of range",
- (char *)NULL);
- }
- return TCL_ERROR;
- }
- *indexPtr = (int)value;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_GetIndexRange --
- *
- * Converts the string representing an index in the vector, to its
- * numeric value. A valid index may be an numeric string of the string
- * "end" (indicating the last element in the string).
- *
- * Results:
- * A standard TCL result. If the string is a valid index, TCL_OK is
- * returned. Otherwise TCL_ERROR is returned and interp->result will
- * contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Vec_GetIndexRange(
- Tcl_Interp *interp,
- Vector *vPtr,
- const char *string,
- int flags,
- Blt_VectorIndexProc **procPtrPtr)
-{
- int ielem;
- char *colon;
-
- colon = NULL;
- if (flags & INDEX_COLON) {
- colon = strchr(string, ':');
- }
- if (colon != NULL) {
- if (string == colon) {
- vPtr->first = 0; /* Default to the first index */
- } else {
- int result;
-
- *colon = '\0';
- result = Blt_Vec_GetIndex(interp, vPtr, string, &ielem, flags,
- (Blt_VectorIndexProc **) NULL);
- *colon = ':';
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- vPtr->first = ielem;
- }
- if (*(colon + 1) == '\0') {
- /* Default to the last index */
- vPtr->last = (vPtr->length > 0) ? vPtr->length - 1 : 0;
- } else {
- if (Blt_Vec_GetIndex(interp, vPtr, colon + 1, &ielem, flags,
- (Blt_VectorIndexProc **) NULL) != TCL_OK) {
- return TCL_ERROR;
- }
- vPtr->last = ielem;
- }
- if (vPtr->first > vPtr->last) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "bad range \"", string,
- "\" (first > last)", (char *)NULL);
- }
- return TCL_ERROR;
- }
- } else {
- if (Blt_Vec_GetIndex(interp, vPtr, string, &ielem, flags,
- procPtrPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- vPtr->last = vPtr->first = ielem;
- }
- return TCL_OK;
-}
-
-Vector *
-Blt_Vec_ParseElement(
- Tcl_Interp *interp,
- VectorInterpData *dataPtr, /* Interpreter-specific data. */
- const char *start,
- const char **endPtr,
- int flags)
-{
- char *p;
- char saved;
- Vector *vPtr;
-
- p = (char *)start;
- /* Find the end of the vector name */
- while (VECTOR_CHAR(*p)) {
- p++;
- }
- saved = *p;
- *p = '\0';
-
- vPtr = GetVectorObject(dataPtr, start, flags);
- if (vPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find vector \"", start, "\"",
- (char *)NULL);
- }
- *p = saved;
- return NULL;
- }
- *p = saved;
- vPtr->first = 0;
- vPtr->last = vPtr->length - 1;
- if (*p == '(') {
- int count, result;
-
- start = p + 1;
- p++;
-
- /* Find the matching right parenthesis */
- count = 1;
- while (*p != '\0') {
- if (*p == ')') {
- count--;
- if (count == 0) {
- break;
- }
- } else if (*p == '(') {
- count++;
- }
- p++;
- }
- if (count > 0) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "unbalanced parentheses \"", start,
- "\"", (char *)NULL);
- }
- return NULL;
- }
- *p = '\0';
- result = Blt_Vec_GetIndexRange(interp, vPtr, start,
- (INDEX_COLON | INDEX_CHECK), (Blt_VectorIndexProc **) NULL);
- *p = ')';
- if (result != TCL_OK) {
- return NULL;
- }
- p++;
- }
- if (endPtr != NULL) {
- *endPtr = p;
- }
- return vPtr;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_NotifyClients --
- *
- * Notifies each client of the vector that the vector has changed
- * (updated or destroyed) by calling the provided function back. The
- * function pointer may be NULL, in that case the client is not notified.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The results depend upon what actions the client callbacks
- * take.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Vec_NotifyClients(ClientData clientData)
-{
- Vector *vPtr = clientData;
- Blt_ChainLink link, next;
- Blt_VectorNotify notify;
-
- notify = (vPtr->notifyFlags & NOTIFY_DESTROYED)
- ? BLT_VECTOR_NOTIFY_DESTROY : BLT_VECTOR_NOTIFY_UPDATE;
- vPtr->notifyFlags &= ~(NOTIFY_UPDATED | NOTIFY_DESTROYED | NOTIFY_PENDING);
- for (link = Blt_Chain_FirstLink(vPtr->chain); link != NULL; link = next) {
- VectorClient *clientPtr;
-
- next = Blt_Chain_NextLink(link);
- clientPtr = Blt_Chain_GetValue(link);
- if ((clientPtr->proc != NULL) && (clientPtr->serverPtr != NULL)) {
- (*clientPtr->proc) (vPtr->interp, clientPtr->clientData, notify);
- }
- }
- /*
- * Some clients may not handle the "destroy" callback properly (they
- * should call Blt_FreeVectorId to release the client identifier), so mark
- * any remaining clients to indicate that vector's server has gone away.
- */
- if (notify == BLT_VECTOR_NOTIFY_DESTROY) {
- for (link = Blt_Chain_FirstLink(vPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- VectorClient *clientPtr;
-
- clientPtr = Blt_Chain_GetValue(link);
- clientPtr->serverPtr = NULL;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_UpdateClients --
- *
- * Notifies each client of the vector that the vector has changed
- * (updated or destroyed) by calling the provided function back.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The individual client callbacks are eventually invoked.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Vec_UpdateClients(Vector *vPtr)
-{
- vPtr->dirty++;
- vPtr->max = vPtr->min = Blt_NaN();
- if (vPtr->notifyFlags & NOTIFY_NEVER) {
- return;
- }
- vPtr->notifyFlags |= NOTIFY_UPDATED;
- if (vPtr->notifyFlags & NOTIFY_ALWAYS) {
- Blt_Vec_NotifyClients(vPtr);
- return;
- }
- if (!(vPtr->notifyFlags & NOTIFY_PENDING)) {
- vPtr->notifyFlags |= NOTIFY_PENDING;
- Tcl_DoWhenIdle(Blt_Vec_NotifyClients, vPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_FlushCache --
- *
- * Unsets all the elements of the TCL array variable associated with the
- * vector, freeing memory associated with the variable. This includes
- * both the hash table and the hash keys. The down side is that this
- * effectively flushes the caching of vector elements in the array. This
- * means that the subsequent reads of the array will require a decimal to
- * string conversion.
- *
- * This is needed when the vector changes its values, making the array
- * variable out-of-sync.
- *
- * Results:
- * None.
- *
- * Side effects:
- * All elements of array variable (except one) are unset, freeing
- * the memory associated with the variable.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Vec_FlushCache(Vector *vPtr)
-{
- Tcl_Interp *interp = vPtr->interp;
-
- if (vPtr->arrayName == NULL) {
- return; /* Doesn't use the variable API */
- }
- /* Turn off the trace temporarily so that we can unset all the
- * elements in the array. */
-
- Tcl_UntraceVar2(interp, vPtr->arrayName, (char *)NULL,
- TRACE_ALL | vPtr->varFlags, Blt_Vec_VarTrace, vPtr);
-
- /* Clear all the element entries from the entire array */
- Tcl_UnsetVar2(interp, vPtr->arrayName, (char *)NULL, vPtr->varFlags);
-
- /* Restore the "end" index by default and the trace on the entire array */
- Tcl_SetVar2(interp, vPtr->arrayName, "end", "", vPtr->varFlags);
- Tcl_TraceVar2(interp, vPtr->arrayName, (char *)NULL,
- TRACE_ALL | vPtr->varFlags, Blt_Vec_VarTrace, vPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_LookupName --
- *
- * Searches for the vector associated with the name given. Allow for a
- * range specification.
- *
- * Results:
- * Returns a pointer to the vector if found, otherwise NULL. If the name
- * is not associated with a vector and the TCL_LEAVE_ERR_MSG flag is set,
- * and interp->result will contain an error message.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Vec_LookupName(
- VectorInterpData *dataPtr, /* Interpreter-specific data. */
- const char *vecName,
- Vector **vPtrPtr)
-{
- Vector *vPtr;
- const char *endPtr;
-
- vPtr = Blt_Vec_ParseElement(dataPtr->interp, dataPtr, vecName, &endPtr,
- NS_SEARCH_BOTH);
- if (vPtr == NULL) {
- return TCL_ERROR;
- }
- if (*endPtr != '\0') {
- Tcl_AppendResult(dataPtr->interp,
- "extra characters after vector name", (char *)NULL);
- return TCL_ERROR;
- }
- *vPtrPtr = vPtr;
- return TCL_OK;
-}
-
-double
-Blt_Vec_Min(Vector *vecObjPtr)
-{
- double *vp, *vend;
- double min;
-
- vp = vecObjPtr->valueArr + vecObjPtr->first;
- vend = vecObjPtr->valueArr + vecObjPtr->last;
- min = *vp++;
- for (/* empty */; vp <= vend; vp++) {
- if (min > *vp) {
- min = *vp;
- }
- }
- vecObjPtr->min = min;
- return vecObjPtr->min;
-}
-
-double
-Blt_Vec_Max(Vector *vecObjPtr)
-{
- double max;
- double *vp, *vend;
-
- max = Blt_NaN();
- vp = vecObjPtr->valueArr + vecObjPtr->first;
- vend = vecObjPtr->valueArr + vecObjPtr->last;
- max = *vp++;
- for (/* empty */; vp <= vend; vp++) {
- if (max < *vp) {
- max = *vp;
- }
- }
- vecObjPtr->max = max;
- return vecObjPtr->max;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteCommand --
- *
- * Deletes the TCL command associated with the vector, without triggering
- * a callback to "VectorInstDeleteProc".
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DeleteCommand(Vector *vPtr) /* Vector associated with the TCL command. */
-{
- Tcl_Interp *interp = vPtr->interp;
- char *qualName; /* Name of TCL command. */
- Tcl_CmdInfo cmdInfo;
- Tcl_DString dString;
- Blt_ObjectName objName;
-
- Tcl_DStringInit(&dString);
- objName.name = Tcl_GetCommandName(interp, vPtr->cmdToken);
- objName.nsPtr = Blt_GetCommandNamespace(vPtr->cmdToken);
- qualName = Blt_MakeQualifiedName(&objName, &dString);
- if (Tcl_GetCommandInfo(interp, qualName, &cmdInfo)) {
- /* Disable the callback before deleting the TCL command.*/
- cmdInfo.deleteProc = NULL;
- Tcl_SetCommandInfo(interp, qualName, &cmdInfo);
- Tcl_DeleteCommandFromToken(interp, vPtr->cmdToken);
- }
- Tcl_DStringFree(&dString);
- vPtr->cmdToken = 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnmapVariable --
- *
- * Destroys the trace on the current TCL variable designated to access
- * the vector.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-UnmapVariable(Vector *vPtr)
-{
- Tcl_Interp *interp = vPtr->interp;
-
- /* Unset the entire array */
- Tcl_UntraceVar2(interp, vPtr->arrayName, (char *)NULL,
- (TRACE_ALL | vPtr->varFlags), Blt_Vec_VarTrace, vPtr);
- Tcl_UnsetVar2(interp, vPtr->arrayName, (char *)NULL, vPtr->varFlags);
-
- if (vPtr->arrayName != NULL) {
- Blt_Free(vPtr->arrayName);
- vPtr->arrayName = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_MapVariable --
- *
- * Sets up traces on a TCL variable to access the vector.
- *
- * If another variable is already mapped, it's first untraced and
- * removed. Don't do anything else for variables named "" (even though
- * Tcl allows this pathology). Saves the name of the new array variable.
- *
- * Results:
- * A standard TCL result. If an error occurs setting the variable
- * TCL_ERROR is returned and an error message is left in the interpreter.
- *
- * Side effects:
- * Traces are set for the new variable. The new variable name is saved in
- * a malloc'ed string in vPtr->arrayName. If this variable is non-NULL,
- * it indicates that a TCL variable has been mapped to this vector.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Vec_MapVariable(
- Tcl_Interp *interp,
- Vector *vPtr,
- const char *path)
-{
- Blt_ObjectName objName;
- char *newPath;
- const char *result;
- Tcl_DString dString;
-
- if (vPtr->arrayName != NULL) {
- UnmapVariable(vPtr);
- }
- if ((path == NULL) || (path[0] == '\0')) {
- return TCL_OK; /* If the variable pathname is the empty
- * string, simply return after removing any
- * existing variable. */
- }
- /* Get the variable name (without the namespace qualifier). */
- if (!Blt_ParseObjectName(interp, path, &objName, BLT_NO_DEFAULT_NS)) {
- return TCL_ERROR;
- }
- if (objName.nsPtr == NULL) {
- /*
- * If there was no namespace qualifier, try harder to see if the
- * variable is non-local.
- */
- objName.nsPtr = Blt_GetVariableNamespace(interp, objName.name);
- }
- Tcl_DStringInit(&dString);
- vPtr->varFlags = 0;
- if (objName.nsPtr != NULL) { /* Global or namespace variable. */
- newPath = Blt_MakeQualifiedName(&objName, &dString);
- vPtr->varFlags |= (TCL_NAMESPACE_ONLY | TCL_GLOBAL_ONLY);
- } else { /* Local variable. */
- newPath = (char *)objName.name;
- }
-
- /*
- * To play it safe, delete the variable first. This has the benefical
- * side-effect of unmapping the variable from another vector that may be
- * currently associated with it.
- */
- Tcl_UnsetVar2(interp, newPath, (char *)NULL, 0);
-
- /*
- * Set the index "end" in the array. This will create the variable
- * immediately so that we can check its namespace context.
- */
- result = Tcl_SetVar2(interp, newPath, "end", "", TCL_LEAVE_ERR_MSG);
- if (result == NULL) {
- Tcl_DStringFree(&dString);
- return TCL_ERROR;
- }
- /* Create a full-array trace on reads, writes, and unsets. */
- Tcl_TraceVar2(interp, newPath, (char *)NULL, TRACE_ALL, Blt_Vec_VarTrace,
- vPtr);
- vPtr->arrayName = Blt_AssertStrdup(newPath);
- Tcl_DStringFree(&dString);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_SetSize --
- *
- * Resizes the vector to the designated new size.
- *
- * If the new size is the same as the old, simply return. Otherwise
- * we're copying the data from one memory location to another.
- *
- * If the storage changed memory locations, free up the old location if
- * it was dynamically allocated.
- *
- * Results:
- * A standard TCL result. If the reallocation is successful,
- * TCL_OK is returned, otherwise TCL_ERROR.
- *
- * Side effects:
- * Memory for the array is reallocated.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Vec_SetSize(
- Tcl_Interp *interp,
- Vector *vPtr,
- int newSize) /* Size of array in elements */
-{
- if (newSize <= 0) {
- newSize = DEF_ARRAY_SIZE;
- }
- if (newSize == vPtr->size) {
- /* Same size, use the current array. */
- return TCL_OK;
- }
- if (vPtr->freeProc == TCL_DYNAMIC) {
- double *newArr;
-
- /* Old memory was dynamically allocated, so use realloc. */
- newArr = Blt_Realloc(vPtr->valueArr, newSize * sizeof(double));
- if (newArr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't reallocate ",
- Blt_Itoa(newSize), " elements for vector \"",
- vPtr->name, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- vPtr->size = newSize;
- vPtr->valueArr = newArr;
- return TCL_OK;
- }
-
- {
- double *newArr;
-
- /* Old memory was created specially (static or special allocator).
- * Replace with dynamically allocated memory (malloc-ed). */
-
- newArr = Blt_Calloc(newSize, sizeof(double));
- if (newArr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't allocate ",
- Blt_Itoa(newSize), " elements for vector \"",
- vPtr->name, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- {
- int used, wanted;
-
- /* Copy the contents of the old memory into the new. */
- used = vPtr->length;
- wanted = newSize;
-
- if (used > wanted) {
- used = wanted;
- }
- /* Copy any previous data */
- if (used > 0) {
- memcpy(newArr, vPtr->valueArr, used * sizeof(double));
- }
- }
-
- assert(vPtr->valueArr != NULL);
-
- /*
- * We're not using the old storage anymore, so free it if it's not
- * TCL_STATIC. It's static because the user previously reset the
- * vector with a statically allocated array (setting freeProc to
- * TCL_STATIC).
- */
- if (vPtr->freeProc != TCL_STATIC) {
- if (vPtr->freeProc == TCL_DYNAMIC) {
- Blt_Free(vPtr->valueArr);
- } else {
- (*vPtr->freeProc) ((char *)vPtr->valueArr);
- }
- }
- vPtr->freeProc = TCL_DYNAMIC; /* Set the type of the new storage */
- vPtr->valueArr = newArr;
- vPtr->size = newSize;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_SetSize --
- *
- * Set the length (the number of elements currently in use) of the
- * vector. If the new length is greater than the size (total number of
- * slots), then the vector is grown.
- *
- * Results:
- * A standard TCL result. If the reallocation is successful, TCL_OK is
- * returned, otherwise TCL_ERROR.
- *
- * Side effects:
- * Memory for the array is possibly reallocated.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Vec_SetLength(
- Tcl_Interp *interp,
- Vector *vPtr,
- int newLength) /* Size of array in elements */
-{
- if (vPtr->size < newLength) {
- if (Blt_Vec_SetSize(interp, vPtr, newLength) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- vPtr->length = newLength;
- vPtr->first = 0;
- vPtr->last = newLength - 1;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_ChangeLength --
- *
- * Resizes the vector to the new size.
- *
- * The new size of the vector is computed by doubling the size of the
- * vector until it fits the number of slots needed (designated by
- * *length*).
- *
- * If the new size is the same as the old, simply adjust the length of
- * the vector. Otherwise we're copying the data from one memory location
- * to another. The trailing elements of the vector need to be reset to
- * zero.
- *
- * If the storage changed memory locations, free up the old location if
- * it was dynamically allocated.
- *
- * Results:
- * A standard TCL result. If the reallocation is successful,
- * TCL_OK is returned, otherwise TCL_ERROR.
- *
- * Side effects:
- * Memory for the array is reallocated.
- *
- *---------------------------------------------------------------------------
- */
-
-int
-Blt_Vec_ChangeLength(
- Tcl_Interp *interp,
- Vector *vPtr,
- int newLength)
-{
- if (newLength < 0) {
- newLength = 0;
- }
- if (newLength > vPtr->size) {
- int newSize; /* Size of array in elements */
-
- /* Compute the new size of the array. It's a multiple of
- * DEF_ARRAY_SIZE. */
- newSize = DEF_ARRAY_SIZE;
- while (newSize < newLength) {
- newSize += newSize;
- }
- if (newSize != vPtr->size) {
- if (Blt_Vec_SetSize(interp, vPtr, newSize) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- }
- vPtr->length = newLength;
- vPtr->first = 0;
- vPtr->last = newLength - 1;
- return TCL_OK;
-
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_Reset --
- *
- * Resets the vector data. This is called by a client to indicate that
- * the vector data has changed. The vector does not need to point to
- * different memory. Any clients of the vector will be notified of the
- * change.
- *
- * Results:
- * A standard TCL result. If the new array size is invalid, TCL_ERROR is
- * returned. Otherwise TCL_OK is returned and the new vector data is
- * recorded.
- *
- * Side Effects:
- * Any client designated callbacks will be posted. Memory may be changed
- * for the vector array.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_Vec_Reset(
- Vector *vPtr,
- double *valueArr, /* Array containing the elements of the
- * vector. If NULL, indicates to reset the
- * vector size to the default. */
- int length, /* The number of elements that the vector
- * currently holds. */
- int size, /* The maximum number of elements that the
- * array can hold. */
- Tcl_FreeProc *freeProc) /* Address of memory deallocation routine
- * for the array of values. Can also be
- * TCL_STATIC, TCL_DYNAMIC, or TCL_VOLATILE. */
-{
- if (vPtr->valueArr != valueArr) { /* New array of values resides
- * in different memory than
- * the current vector. */
- if ((valueArr == NULL) || (size == 0)) {
- /* Empty array. Set up default values */
- valueArr = Blt_Malloc(sizeof(double) * DEF_ARRAY_SIZE);
- size = DEF_ARRAY_SIZE;
- if (valueArr == NULL) {
- Tcl_AppendResult(vPtr->interp, "can't allocate ",
- Blt_Itoa(size), " elements for vector \"",
- vPtr->name, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- freeProc = TCL_DYNAMIC;
- length = 0;
- } else if (freeProc == TCL_VOLATILE) {
- double *newArr;
- /* Data is volatile. Make a copy of the value array. */
- newArr = Blt_Malloc(size * sizeof(double));
- if (newArr == NULL) {
- Tcl_AppendResult(vPtr->interp, "can't allocate ",
- Blt_Itoa(size), " elements for vector \"",
- vPtr->name, "\"", (char *)NULL);
- return TCL_ERROR;
- }
- memcpy((char *)newArr, (char *)valueArr,
- sizeof(double) * length);
- valueArr = newArr;
- freeProc = TCL_DYNAMIC;
- }
-
- if (vPtr->freeProc != TCL_STATIC) {
- /* Old data was dynamically allocated. Free it before attaching
- * new data. */
- if (vPtr->freeProc == TCL_DYNAMIC) {
- Blt_Free(vPtr->valueArr);
- } else {
- (*freeProc) ((char *)vPtr->valueArr);
- }
- }
- vPtr->freeProc = freeProc;
- vPtr->valueArr = valueArr;
- vPtr->size = size;
- }
-
- vPtr->length = length;
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
- return TCL_OK;
-}
-
-Vector *
-Blt_Vec_New(VectorInterpData *dataPtr) /* Interpreter-specific data. */
-{
- Vector *vPtr;
-
- vPtr = Blt_AssertCalloc(1, sizeof(Vector));
- vPtr->valueArr = Blt_Malloc(sizeof(double) * DEF_ARRAY_SIZE);
- if (vPtr->valueArr == NULL) {
- Blt_Free(vPtr);
- return NULL;
- }
- vPtr->size = DEF_ARRAY_SIZE;
- vPtr->freeProc = TCL_DYNAMIC;
- vPtr->length = 0;
- vPtr->interp = dataPtr->interp;
- vPtr->hashPtr = NULL;
- vPtr->chain = Blt_Chain_Create();
- vPtr->flush = FALSE;
- vPtr->min = vPtr->max = Blt_NaN();
- vPtr->notifyFlags = NOTIFY_WHENIDLE;
- vPtr->dataPtr = dataPtr;
- return vPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_Free --
- *
- * Removes the memory and frees resources associated with the vector.
- *
- * o Removes the trace and the TCL array variable and unsets
- * the variable.
- * o Notifies clients of the vector that the vector is being
- * destroyed.
- * o Removes any clients that are left after notification.
- * o Frees the memory (if necessary) allocated for the array.
- * o Removes the entry from the hash table of vectors.
- * o Frees the memory allocated for the name.
- *
- * Results:
- * None.
- *
- * Side effects:
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_Vec_Free(Vector *vPtr)
-{
- Blt_ChainLink link;
-
- if (vPtr->cmdToken != 0) {
- DeleteCommand(vPtr);
- }
- if (vPtr->arrayName != NULL) {
- UnmapVariable(vPtr);
- }
- vPtr->length = 0;
-
- /* Immediately notify clients that vector is going away */
- if (vPtr->notifyFlags & NOTIFY_PENDING) {
- vPtr->notifyFlags &= ~NOTIFY_PENDING;
- Tcl_CancelIdleCall(Blt_Vec_NotifyClients, vPtr);
- }
- vPtr->notifyFlags |= NOTIFY_DESTROYED;
- Blt_Vec_NotifyClients(vPtr);
-
- for (link = Blt_Chain_FirstLink(vPtr->chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- VectorClient *clientPtr;
-
- clientPtr = Blt_Chain_GetValue(link);
- Blt_Free(clientPtr);
- }
- Blt_Chain_Destroy(vPtr->chain);
- if ((vPtr->valueArr != NULL) && (vPtr->freeProc != TCL_STATIC)) {
- if (vPtr->freeProc == TCL_DYNAMIC) {
- Blt_Free(vPtr->valueArr);
- } else {
- (*vPtr->freeProc) ((char *)vPtr->valueArr);
- }
- }
- if (vPtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(&vPtr->dataPtr->vectorTable, vPtr->hashPtr);
- }
-#ifdef NAMESPACE_DELETE_NOTIFY
- if (vPtr->nsPtr != NULL) {
- Blt_DestroyNsDeleteNotify(vPtr->interp, vPtr->nsPtr, vPtr);
- }
-#endif /* NAMESPACE_DELETE_NOTIFY */
- Blt_Free(vPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * VectorInstDeleteProc --
- *
- * Deletes the command associated with the vector. This is called only
- * when the command associated with the vector is destroyed.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static void
-VectorInstDeleteProc(ClientData clientData)
-{
- Vector *vPtr = clientData;
-
- vPtr->cmdToken = 0;
- Blt_Vec_Free(vPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Vec_Create --
- *
- * Creates a vector structure and the following items:
- *
- * o TCL command
- * o TCL array variable and establishes traces on the variable
- * o Adds a new entry in the vector hash table
- *
- * Results:
- * A pointer to the new vector structure. If an error occurred NULL is
- * returned and an error message is left in interp->result.
- *
- * Side effects:
- * A new TCL command and array variable is added to the interpreter.
- *
- * ----------------------------------------------------------------------
- */
-Vector *
-Blt_Vec_Create(
- VectorInterpData *dataPtr, /* Interpreter-specific data. */
- const char *vecName, /* Namespace-qualified name of the vector */
- const char *cmdName, /* Name of the TCL command mapped to
- * the vector */
- const char *varName, /* Name of the TCL array mapped to the
- * vector */
- int *isNewPtr)
-{
- Tcl_DString dString;
- Vector *vPtr;
- int isNew;
- Blt_ObjectName objName;
- char *qualName;
- Blt_HashEntry *hPtr;
- Tcl_Interp *interp = dataPtr->interp;
-
- isNew = 0;
- vPtr = NULL;
-
- if (!Blt_ParseObjectName(interp, vecName, &objName, 0)) {
- return NULL;
- }
- Tcl_DStringInit(&dString);
- if ((objName.name[0] == '#') && (strcmp(objName.name, "#auto") == 0)) {
-
- do { /* Generate a unique vector name. */
- char string[200];
-
- sprintf_s(string, 200, "vector%d", dataPtr->nextId++);
- objName.name = string;
- qualName = Blt_MakeQualifiedName(&objName, &dString);
- hPtr = Blt_FindHashEntry(&dataPtr->vectorTable, qualName);
- } while (hPtr != NULL);
- } else {
- const char *p;
-
- for (p = objName.name; *p != '\0'; p++) {
- if (!VECTOR_CHAR(*p)) {
- Tcl_AppendResult(interp, "bad vector name \"", objName.name,
- "\": must contain digits, letters, underscore, or period",
- (char *)NULL);
- goto error;
- }
- }
- qualName = Blt_MakeQualifiedName(&objName, &dString);
- vPtr = Blt_Vec_ParseElement((Tcl_Interp *)NULL, dataPtr, qualName,
- NULL, NS_SEARCH_CURRENT);
- }
- if (vPtr == NULL) {
- hPtr = Blt_CreateHashEntry(&dataPtr->vectorTable, qualName, &isNew);
- vPtr = Blt_Vec_New(dataPtr);
- vPtr->hashPtr = hPtr;
- vPtr->nsPtr = objName.nsPtr;
-
- vPtr->name = Blt_GetHashKey(&dataPtr->vectorTable, hPtr);
-#ifdef NAMESPACE_DELETE_NOTIFY
- Blt_CreateNsDeleteNotify(interp, objName.nsPtr, vPtr,
- VectorInstDeleteProc);
-#endif /* NAMESPACE_DELETE_NOTIFY */
- Blt_SetHashValue(hPtr, vPtr);
- }
- if (cmdName != NULL) {
- Tcl_CmdInfo cmdInfo;
-
- if ((cmdName == vecName) ||
- ((cmdName[0] == '#') && (strcmp(cmdName, "#auto")==0))) {
- cmdName = qualName;
- }
- if (Tcl_GetCommandInfo(interp, (char *)cmdName, &cmdInfo)) {
- if (vPtr != cmdInfo.objClientData) {
- Tcl_AppendResult(interp, "command \"", cmdName,
- "\" already exists", (char *)NULL);
- goto error;
- }
- /* We get here only if the old name is the same as the new. */
- goto checkVariable;
- }
- }
- if (vPtr->cmdToken != 0) {
- DeleteCommand(vPtr); /* Command already exists, delete old first */
- }
- if (cmdName != NULL) {
- Tcl_DString dString2;
-
- Tcl_DStringInit(&dString2);
- if (cmdName != qualName) {
- if (!Blt_ParseObjectName(interp, cmdName, &objName, 0)) {
- goto error;
- }
- cmdName = Blt_MakeQualifiedName(&objName, &dString2);
- }
- vPtr->cmdToken = Tcl_CreateObjCommand(interp, (char *)cmdName,
- Blt_Vec_InstCmd, vPtr, VectorInstDeleteProc);
- Tcl_DStringFree(&dString2);
- }
- checkVariable:
- if (varName != NULL) {
- if ((varName[0] == '#') && (strcmp(varName, "#auto") == 0)) {
- varName = qualName;
- }
- if (Blt_Vec_MapVariable(interp, vPtr, varName) != TCL_OK) {
- goto error;
- }
- }
-
- Tcl_DStringFree(&dString);
- *isNewPtr = isNew;
- return vPtr;
-
- error:
- Tcl_DStringFree(&dString);
- if (vPtr != NULL) {
- Blt_Vec_Free(vPtr);
- }
- return NULL;
-}
-
-
-int
-Blt_Vec_Duplicate(Vector *destPtr, Vector *srcPtr)
-{
- size_t nBytes;
- size_t length;
-
- if (destPtr == srcPtr) {
- /* Copying the same vector. */
- }
- length = srcPtr->last - srcPtr->first + 1;
- if (Blt_Vec_ChangeLength(destPtr->interp, destPtr, length) != TCL_OK) {
- return TCL_ERROR;
- }
- nBytes = length * sizeof(double);
- memcpy(destPtr->valueArr, srcPtr->valueArr + srcPtr->first, nBytes);
- destPtr->offset = srcPtr->offset;
- return TCL_OK;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * VectorNamesOp --
- *
- * Reports the names of all the current vectors in the interpreter.
- *
- * Results:
- * A standard TCL result. interp->result will contain a list of
- * all the names of the vector instances.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-VectorNamesOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- VectorInterpData *dataPtr = clientData;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- if (objc == 2) {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->vectorTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- char *name;
-
- name = Blt_GetHashKey(&dataPtr->vectorTable, hPtr);
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(name, -1));
- }
- } else {
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->vectorTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- char *name;
- int i;
-
- name = Blt_GetHashKey(&dataPtr->vectorTable, hPtr);
- for (i = 2; i < objc; i++) {
- char *pattern;
-
- pattern = Tcl_GetString(objv[i]);
- if (Tcl_StringMatch(name, pattern)) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(name, -1));
- break;
- }
- }
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * VectorCreateOp --
- *
- * Creates a TCL command, and array variable representing an instance of
- * a vector.
- *
- * vector a
- * vector b(20)
- * vector c(-5:14)
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-/*ARGSUSED*/
-static int
-VectorCreate2(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int argStart,
- int objc,
- Tcl_Obj *const *objv)
-{
- VectorInterpData *dataPtr = clientData;
- Vector *vPtr;
- int count, i;
- CreateSwitches switches;
-
- /*
- * Handle switches to the vector command and collect the vector name
- * arguments into an array.
- */
- count = 0;
- vPtr = NULL;
- for (i = argStart; i < objc; i++) {
- char *string;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] == '-') {
- break;
- }
- }
- count = i - argStart;
- if (count == 0) {
- Tcl_AppendResult(interp, "no vector names supplied", (char *)NULL);
- return TCL_ERROR;
- }
- memset(&switches, 0, sizeof(switches));
- if (Blt_ParseSwitches(interp, createSwitches, objc - i, objv + i,
- &switches, BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- if (count > 1) {
- if (switches.cmdName != NULL) {
- Tcl_AppendResult(interp,
- "can't specify more than one vector with \"-command\" switch",
- (char *)NULL);
- goto error;
- }
- if (switches.varName != NULL) {
- Tcl_AppendResult(interp,
- "can't specify more than one vector with \"-variable\" switch",
- (char *)NULL);
- goto error;
- }
- }
- for (i = 0; i < count; i++) {
- char *leftParen, *rightParen;
- char *string;
- int isNew;
- int size, first, last;
-
- size = first = last = 0;
- string = Tcl_GetString(objv[i + argStart]);
- leftParen = strchr(string, '(');
- rightParen = strchr(string, ')');
- if (((leftParen != NULL) && (rightParen == NULL)) ||
- ((leftParen == NULL) && (rightParen != NULL)) ||
- (leftParen > rightParen)) {
- Tcl_AppendResult(interp, "bad vector specification \"", string,
- "\"", (char *)NULL);
- goto error;
- }
- if (leftParen != NULL) {
- int result;
- char *colon;
-
- *rightParen = '\0';
- colon = strchr(leftParen + 1, ':');
- if (colon != NULL) {
-
- /* Specification is in the form vecName(first:last) */
- *colon = '\0';
- result = Tcl_GetInt(interp, leftParen + 1, &first);
- if ((*(colon + 1) != '\0') && (result == TCL_OK)) {
- result = Tcl_GetInt(interp, colon + 1, &last);
- if (first > last) {
- Tcl_AppendResult(interp, "bad vector range \"",
- string, "\"", (char *)NULL);
- result = TCL_ERROR;
- }
- size = (last - first) + 1;
- }
- *colon = ':';
- } else {
- /* Specification is in the form vecName(size) */
- result = Tcl_GetInt(interp, leftParen + 1, &size);
- }
- *rightParen = ')';
- if (result != TCL_OK) {
- goto error;
- }
- if (size < 0) {
- Tcl_AppendResult(interp, "bad vector size \"", string, "\"",
- (char *)NULL);
- goto error;
- }
- }
- if (leftParen != NULL) {
- *leftParen = '\0';
- }
- /*
- * By default, we create a TCL command by the name of the vector.
- */
- vPtr = Blt_Vec_Create(dataPtr, string,
- (switches.cmdName == NULL) ? string : switches.cmdName,
- (switches.varName == NULL) ? string : switches.varName, &isNew);
- if (leftParen != NULL) {
- *leftParen = '(';
- }
- if (vPtr == NULL) {
- goto error;
- }
- vPtr->freeOnUnset = switches.watchUnset;
- vPtr->flush = switches.flush;
- vPtr->offset = first;
- if (size > 0) {
- if (Blt_Vec_ChangeLength(interp, vPtr, size) != TCL_OK) {
- goto error;
- }
- }
- if (!isNew) {
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
- }
- }
- Blt_FreeSwitches(createSwitches, (char *)&switches, 0);
- if (vPtr != NULL) {
- /* Return the name of the last vector created */
- Tcl_SetStringObj(Tcl_GetObjResult(interp), vPtr->name, -1);
- }
- return TCL_OK;
- error:
- Blt_FreeSwitches(createSwitches, (char *)&switches, 0);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * VectorCreateOp --
- *
- * Creates a TCL command, and array variable representing an instance of
- * a vector.
- *
- * vector a
- * vector b(20)
- * vector c(-5:14)
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-VectorCreateOp(
- ClientData clientData,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- return VectorCreate2(clientData, interp, 2, objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * VectorDestroyOp --
- *
- * Destroys the vector and its related TCL command and array variable (if
- * they exist).
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * Deletes the vector.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-VectorDestroyOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp, /* Not used. */
- int objc,
- Tcl_Obj *const *objv)
-{
- VectorInterpData *dataPtr = clientData;
- Vector *vPtr;
- int i;
-
- for (i = 2; i < objc; i++) {
- if (Blt_Vec_LookupName(dataPtr, Tcl_GetString(objv[i]), &vPtr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_Vec_Free(vPtr);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * VectorExprOp --
- *
- * Computes the result of the expression which may be either a scalar
- * (single value) or vector (list of values).
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-VectorExprOp(
- ClientData clientData, /* Not Used. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- return Blt_ExprVector(interp, Tcl_GetString(objv[2]), (Blt_Vector *)NULL);
-}
-
-static Blt_OpSpec vectorCmdOps[] =
-{
- {"create", 1, VectorCreateOp, 3, 0,
- "vecName ?vecName...? ?switches...?",},
- {"destroy", 1, VectorDestroyOp, 3, 0,
- "vecName ?vecName...?",},
- {"expr", 1, VectorExprOp, 3, 3, "expression",},
- {"names", 1, VectorNamesOp, 2, 3, "?pattern?...",},
-};
-
-static int nCmdOps = sizeof(vectorCmdOps) / sizeof(Blt_OpSpec);
-
-/*ARGSUSED*/
-static int
-VectorCmd(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- VectorCmdProc *proc;
- /*
- * Try to replicate the old vector command's behavior:
- */
- if (objc > 1) {
- char *string;
- char c;
- int i;
- Blt_OpSpec *specPtr;
-
- string = Tcl_GetString(objv[1]);
- c = string[0];
- for (specPtr = vectorCmdOps, i = 0; i < nCmdOps; i++, specPtr++) {
- if ((c == specPtr->name[0]) &&
- (strcmp(string, specPtr->name) == 0)) {
- goto doOp;
- }
- }
- /*
- * The first argument is not an operation, so assume that its
- * actually the name of a vector to be created
- */
- return VectorCreate2(clientData, interp, 1, objc, objv);
- }
- doOp:
- /* Do the usual vector operation lookup now. */
- proc = Blt_GetOpFromObj(interp, nCmdOps, vectorCmdOps, BLT_OP_ARG1,
- objc, objv,0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return (*proc) (clientData, interp, objc, objv);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * VectorInterpDeleteProc --
- *
- * This is called when the interpreter hosting the "vector" command
- * is deleted.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Destroys the math and index hash tables. In addition removes
- * the hash table managing all vector names.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-VectorInterpDeleteProc(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp)
-{
- VectorInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->vectorTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Vector *vPtr;
-
- vPtr = Blt_GetHashValue(hPtr);
- vPtr->hashPtr = NULL;
- Blt_Vec_Free(vPtr);
- }
- Blt_DeleteHashTable(&dataPtr->vectorTable);
-
- /* If any user-defined math functions were installed, remove them. */
- Blt_Vec_UninstallMathFunctions(&dataPtr->mathProcTable);
- Blt_DeleteHashTable(&dataPtr->mathProcTable);
-
- Blt_DeleteHashTable(&dataPtr->indexProcTable);
- Tcl_DeleteAssocData(interp, VECTOR_THREAD_KEY);
- Blt_Free(dataPtr);
-}
-
-VectorInterpData *
-Blt_Vec_GetInterpData(Tcl_Interp *interp)
-{
- VectorInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (VectorInterpData *)
- Tcl_GetAssocData(interp, VECTOR_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(VectorInterpData));
- dataPtr->interp = interp;
- dataPtr->nextId = 0;
- Tcl_SetAssocData(interp, VECTOR_THREAD_KEY, VectorInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->vectorTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&dataPtr->mathProcTable, BLT_STRING_KEYS);
- Blt_InitHashTable(&dataPtr->indexProcTable, BLT_STRING_KEYS);
- Blt_Vec_InstallMathFunctions(&dataPtr->mathProcTable);
- Blt_Vec_InstallSpecialIndices(&dataPtr->indexProcTable);
-#ifdef HAVE_SRAND48
- srand48(time((time_t *) NULL));
-#endif
- }
- return dataPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_VectorCmdInitProc --
- *
- * This procedure is invoked to initialize the "vector" command.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates the new command and adds a new entry into a global Tcl
- * associative array.
- *
- *---------------------------------------------------------------------------
- */
-
-int
-Blt_VectorCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {"vector", VectorCmd, };
-
- cmdSpec.clientData = Blt_Vec_GetInterpData(interp);
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-
-
-/* C Application interface to vectors */
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_CreateVector --
- *
- * Creates a new vector by the name and size.
- *
- * Results:
- * A standard TCL result. If the new array size is invalid or a vector
- * already exists by that name, TCL_ERROR is returned. Otherwise TCL_OK
- * is returned and the new vector is created.
- *
- * Side Effects:
- * Memory will be allocated for the new vector. A new TCL command and
- * Tcl array variable will be created.
- *
- *---------------------------------------------------------------------------
- */
-
-/*LINTLIBRARY*/
-int
-Blt_CreateVector2(
- Tcl_Interp *interp,
- const char *vecName, const char *cmdName, const char *varName,
- int initialSize,
- Blt_Vector **vecPtrPtr)
-{
- VectorInterpData *dataPtr; /* Interpreter-specific data. */
- Vector *vPtr;
- int isNew;
- char *nameCopy;
-
- if (initialSize < 0) {
- Tcl_AppendResult(interp, "bad vector size \"", Blt_Itoa(initialSize),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- dataPtr = Blt_Vec_GetInterpData(interp);
-
- nameCopy = Blt_AssertStrdup(vecName);
- vPtr = Blt_Vec_Create(dataPtr, nameCopy, cmdName, varName, &isNew);
- Blt_Free(nameCopy);
-
- if (vPtr == NULL) {
- return TCL_ERROR;
- }
- if (initialSize > 0) {
- if (Blt_Vec_ChangeLength(interp, vPtr, initialSize) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (vecPtrPtr != NULL) {
- *vecPtrPtr = (Blt_Vector *) vPtr;
- }
- return TCL_OK;
-}
-
-int
-Blt_CreateVector(
- Tcl_Interp *interp,
- const char *name,
- int size,
- Blt_Vector **vecPtrPtr)
-{
- return Blt_CreateVector2(interp, name, name, name, size, vecPtrPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DeleteVector --
- *
- * Deletes the vector of the given name. All clients with designated
- * callback routines will be notified.
- *
- * Results:
- * A standard TCL result. If no vector exists by that name, TCL_ERROR is
- * returned. Otherwise TCL_OK is returned and vector is deleted.
- *
- * Side Effects:
- * Memory will be released for the new vector. Both the TCL command and
- * array variable will be deleted. All clients which set call back
- * procedures will be notified.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-int
-Blt_DeleteVector(Blt_Vector *vecPtr)
-{
- Vector *vPtr = (Vector *)vecPtr;
-
- Blt_Vec_Free(vPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DeleteVectorByName --
- *
- * Deletes the vector of the given name. All clients with designated
- * callback routines will be notified.
- *
- * Results:
- * A standard TCL result. If no vector exists by that name, TCL_ERROR is
- * returned. Otherwise TCL_OK is returned and vector is deleted.
- *
- * Side Effects:
- * Memory will be released for the new vector. Both the TCL command and
- * array variable will be deleted. All clients which set call back
- * procedures will be notified.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-int
-Blt_DeleteVectorByName(Tcl_Interp *interp, const char *name)
-{
- VectorInterpData *dataPtr; /* Interpreter-specific data. */
- Vector *vPtr;
- char *nameCopy;
- int result;
-
- /*
- * If the vector name was passed via a read-only string (e.g. "x"), the
- * Blt_Vec_ParseElement routine will segfault when it tries to write into
- * the string. Therefore make a writable copy and free it when we're
- * done.
- */
- nameCopy = Blt_AssertStrdup(name);
- dataPtr = Blt_Vec_GetInterpData(interp);
- result = Blt_Vec_LookupName(dataPtr, nameCopy, &vPtr);
- Blt_Free(nameCopy);
-
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_Vec_Free(vPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_VectorExists2 --
- *
- * Returns whether the vector associated with the client token still
- * exists.
- *
- * Results:
- * Returns 1 is the vector still exists, 0 otherwise.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_VectorExists2(Tcl_Interp *interp, const char *vecName)
-{
- VectorInterpData *dataPtr; /* Interpreter-specific data. */
-
- dataPtr = Blt_Vec_GetInterpData(interp);
- if (GetVectorObject(dataPtr, vecName, NS_SEARCH_BOTH) != NULL) {
- return TRUE;
- }
- return FALSE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_VectorExists --
- *
- * Returns whether the vector associated with the client token
- * still exists.
- *
- * Results:
- * Returns 1 is the vector still exists, 0 otherwise.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_VectorExists(Tcl_Interp *interp, const char *vecName)
-{
- char *nameCopy;
- int result;
-
- /*
- * If the vector name was passed via a read-only string (e.g. "x"), the
- * Blt_VectorParseName routine will segfault when it tries to write into
- * the string. Therefore make a writable copy and free it when we're
- * done.
- */
- nameCopy = Blt_AssertStrdup(vecName);
- result = Blt_VectorExists2(interp, nameCopy);
- Blt_Free(nameCopy);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetVector --
- *
- * Returns a pointer to the vector associated with the given name.
- *
- * Results:
- * A standard TCL result. If there is no vector "name", TCL_ERROR is
- * returned. Otherwise TCL_OK is returned and vecPtrPtr will point to
- * the vector.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetVector(Tcl_Interp *interp, const char *name, Blt_Vector **vecPtrPtr)
-{
- VectorInterpData *dataPtr; /* Interpreter-specific data. */
- Vector *vPtr;
- char *nameCopy;
- int result;
-
- dataPtr = Blt_Vec_GetInterpData(interp);
- /*
- * If the vector name was passed via a read-only string (e.g. "x"), the
- * Blt_VectorParseName routine will segfault when it tries to write into
- * the string. Therefore make a writable copy and free it when we're
- * done.
- */
- nameCopy = Blt_AssertStrdup(name);
- result = Blt_Vec_LookupName(dataPtr, nameCopy, &vPtr);
- Blt_Free(nameCopy);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_Vec_UpdateRange(vPtr);
- *vecPtrPtr = (Blt_Vector *) vPtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetVectorFromObj --
- *
- * Returns a pointer to the vector associated with the given name.
- *
- * Results:
- * A standard TCL result. If there is no vector "name", TCL_ERROR
- * is returned. Otherwise TCL_OK is returned and vecPtrPtr will
- * point to the vector.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetVectorFromObj(
- Tcl_Interp *interp,
- Tcl_Obj *objPtr,
- Blt_Vector **vecPtrPtr)
-{
- VectorInterpData *dataPtr; /* Interpreter-specific data. */
- Vector *vPtr;
-
- dataPtr = Blt_Vec_GetInterpData(interp);
- if (Blt_Vec_LookupName(dataPtr, Tcl_GetString(objPtr), &vPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_Vec_UpdateRange(vPtr);
- *vecPtrPtr = (Blt_Vector *) vPtr;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ResetVector --
- *
- * Resets the vector data. This is called by a client to indicate that
- * the vector data has changed. The vector does not need to point to
- * different memory. Any clients of the vector will be notified of the
- * change.
- *
- * Results:
- * A standard TCL result. If the new array size is invalid,
- * TCL_ERROR is returned. Otherwise TCL_OK is returned and the
- * new vector data is recorded.
- *
- * Side Effects:
- * Any client designated callbacks will be posted. Memory may
- * be changed for the vector array.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_ResetVector(
- Blt_Vector *vecPtr,
- double *valueArr, /* Array containing the elements of the
- * vector. If NULL, indicates to reset the
- * vector.*/
- int length, /* The number of elements that the vector
- * currently holds. */
- int size, /* The maximum number of elements that the
- * array can hold. */
- Tcl_FreeProc *freeProc) /* Address of memory deallocation routine
- * for the array of values. Can also be
- * TCL_STATIC, TCL_DYNAMIC, or TCL_VOLATILE. */
-{
- Vector *vPtr = (Vector *)vecPtr;
-
- if (size < 0) {
- Tcl_AppendResult(vPtr->interp, "bad array size", (char *)NULL);
- return TCL_ERROR;
- }
- return Blt_Vec_Reset(vPtr, valueArr, length, size, freeProc);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ResizeVector --
- *
- * Changes the size of the vector. All clients with designated callback
- * routines will be notified of the size change.
- *
- * Results:
- * A standard TCL result. If no vector exists by that name, TCL_ERROR is
- * returned. Otherwise TCL_OK is returned and vector is resized.
- *
- * Side Effects:
- * Memory may be reallocated for the new vector size. All clients which
- * set call back procedures will be notified.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_ResizeVector(Blt_Vector *vecPtr, int length)
-{
- Vector *vPtr = (Vector *)vecPtr;
-
- if (Blt_Vec_ChangeLength((Tcl_Interp *)NULL, vPtr, length) != TCL_OK) {
- Tcl_AppendResult(vPtr->interp, "can't resize vector \"", vPtr->name,
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- if (vPtr->flush) {
- Blt_Vec_FlushCache(vPtr);
- }
- Blt_Vec_UpdateClients(vPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_AllocVectorId --
- *
- * Creates an identifier token for an existing vector. The identifier is
- * used by the client routines to get call backs when (and if) the vector
- * changes.
- *
- * Results:
- * A standard TCL result. If "vecName" is not associated with a vector,
- * TCL_ERROR is returned and interp->result is filled with an error
- * message.
- *
- *---------------------------------------------------------------------------
- */
-Blt_VectorId
-Blt_AllocVectorId(Tcl_Interp *interp, const char *name)
-{
- VectorInterpData *dataPtr; /* Interpreter-specific data. */
- Vector *vPtr;
- VectorClient *clientPtr;
- Blt_VectorId clientId;
- int result;
- char *nameCopy;
-
- dataPtr = Blt_Vec_GetInterpData(interp);
- /*
- * If the vector name was passed via a read-only string (e.g. "x"), the
- * Blt_VectorParseName routine will segfault when it tries to write into
- * the string. Therefore make a writable copy and free it when we're
- * done.
- */
- nameCopy = Blt_AssertStrdup(name);
- result = Blt_Vec_LookupName(dataPtr, nameCopy, &vPtr);
- Blt_Free(nameCopy);
-
- if (result != TCL_OK) {
- return (Blt_VectorId) 0;
- }
- /* Allocate a new client structure */
- clientPtr = Blt_AssertCalloc(1, sizeof(VectorClient));
- clientPtr->magic = VECTOR_MAGIC;
-
- /* Add the new client to the server's list of clients */
- clientPtr->link = Blt_Chain_Append(vPtr->chain, clientPtr);
- clientPtr->serverPtr = vPtr;
- clientId = (Blt_VectorId) clientPtr;
- return clientId;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_SetVectorChangedProc --
- *
- * Sets the routine to be called back when the vector is changed or
- * deleted. *clientData* will be provided as an argument. If *proc* is
- * NULL, no callback will be made.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * The designated routine will be called when the vector is changed
- * or deleted.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_SetVectorChangedProc(
- Blt_VectorId clientId, /* Client token identifying the vector */
- Blt_VectorChangedProc *proc,/* Address of routine to call when the contents
- * of the vector change. If NULL, no routine
- * will be called */
- ClientData clientData) /* One word of information to pass along when
- * the above routine is called */
-{
- VectorClient *clientPtr = (VectorClient *)clientId;
-
- if (clientPtr->magic != VECTOR_MAGIC) {
- return; /* Not a valid token */
- }
- clientPtr->clientData = clientData;
- clientPtr->proc = proc;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FreeVectorId --
- *
- * Releases the token for an existing vector. This indicates that the
- * client is no longer interested the vector. Any previously specified
- * callback routine will no longer be invoked when (and if) the vector
- * changes.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Any previously specified callback routine will no longer be
- * invoked when (and if) the vector changes.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FreeVectorId(Blt_VectorId clientId)
-{
- VectorClient *clientPtr = (VectorClient *)clientId;
-
- if (clientPtr->magic != VECTOR_MAGIC) {
- return; /* Not a valid token */
- }
- if (clientPtr->serverPtr != NULL) {
- /* Remove the client from the server's list */
- Blt_Chain_DeleteLink(clientPtr->serverPtr->chain, clientPtr->link);
- }
- Blt_Free(clientPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_NameOfVectorId --
- *
- * Returns the name of the vector (and array variable).
- *
- * Results:
- * The name of the array variable is returned.
- *
- *---------------------------------------------------------------------------
- */
-const char *
-Blt_NameOfVectorId(Blt_VectorId clientId)
-{
- VectorClient *clientPtr = (VectorClient *)clientId;
-
- if ((clientPtr->magic != VECTOR_MAGIC) || (clientPtr->serverPtr == NULL)) {
- return NULL;
- }
- return clientPtr->serverPtr->name;
-}
-
-const char *
-Blt_NameOfVector(Blt_Vector *vecPtr) /* Vector to query. */
-{
- Vector *vPtr = (Vector *)vecPtr;
- return vPtr->name;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_VectorNotifyPending --
- *
- * Returns the name of the vector (and array variable).
- *
- * Results:
- * The name of the array variable is returned.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_VectorNotifyPending(Blt_VectorId clientId)
-{
- VectorClient *clientPtr = (VectorClient *)clientId;
-
- if ((clientPtr == NULL) || (clientPtr->magic != VECTOR_MAGIC) ||
- (clientPtr->serverPtr == NULL)) {
- return 0;
- }
- return (clientPtr->serverPtr->notifyFlags & NOTIFY_PENDING);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetVectorById --
- *
- * Returns a pointer to the vector associated with the client
- * token.
- *
- * Results:
- * A standard TCL result. If the client token is not associated
- * with a vector any longer, TCL_ERROR is returned. Otherwise,
- * TCL_OK is returned and vecPtrPtr will point to vector.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_GetVectorById(
- Tcl_Interp *interp,
- Blt_VectorId clientId, /* Client token identifying the vector */
- Blt_Vector **vecPtrPtr)
-{
- VectorClient *clientPtr = (VectorClient *)clientId;
-
- if (clientPtr->magic != VECTOR_MAGIC) {
- Tcl_AppendResult(interp, "bad vector token", (char *)NULL);
- return TCL_ERROR;
- }
- if (clientPtr->serverPtr == NULL) {
- Tcl_AppendResult(interp, "vector no longer exists", (char *)NULL);
- return TCL_ERROR;
- }
- Blt_Vec_UpdateRange(clientPtr->serverPtr);
- *vecPtrPtr = (Blt_Vector *) clientPtr->serverPtr;
- return TCL_OK;
-}
-
-/*LINTLIBRARY*/
-void
-Blt_InstallIndexProc(Tcl_Interp *interp, const char *string,
- Blt_VectorIndexProc *procPtr)
-{
- VectorInterpData *dataPtr; /* Interpreter-specific data. */
- Blt_HashEntry *hPtr;
- int isNew;
-
- dataPtr = Blt_Vec_GetInterpData(interp);
- hPtr = Blt_CreateHashEntry(&dataPtr->indexProcTable, string, &isNew);
- if (procPtr == NULL) {
- Blt_DeleteHashEntry(&dataPtr->indexProcTable, hPtr);
- } else {
- Blt_SetHashValue(hPtr, procPtr);
- }
-}
-
-/* spinellia at acm.org START */
-
-
-#define SWAP(a,b) tempr=(a);(a)=(b);(b)=tempr
-
-/* routine by Brenner
- * data is the array of complex data points, perversely
- * starting at 1
- * nn is the number of complex points, i.e. half the length of data
- * isign is 1 for forward, -1 for inverse
- */
-static void
-four1(double *data, unsigned long nn, int isign)
-{
- unsigned long n,mmax,m,j,istep,i;
- double wtemp,wr,wpr,wpi,wi,theta;
- double tempr,tempi;
-
- n=nn << 1;
- j=1;
- for (i = 1;i<n;i+=2) {
- if (j > i) {
- SWAP(data[j],data[i]);
- SWAP(data[j+1],data[i+1]);
- }
- m=n >> 1;
- while (m >= 2 && j > m) {
- j -= m;
- m >>= 1;
- }
- j += m;
- }
- mmax=2;
- while (n > mmax) {
- istep=mmax << 1;
- theta=isign*(6.28318530717959/mmax);
- wtemp=sin(0.5*theta);
- wpr = -2.0*wtemp*wtemp;
- wpi=sin(theta);
- wr=1.0;
- wi=0.0;
- for (m=1;m<mmax;m+=2) {
- for (i=m;i<=n;i+=istep) {
- j=i+mmax;
- tempr=wr*data[j]-wi*data[j+1];
- tempi=wr*data[j+1]+wi*data[j];
- data[j]=data[i]-tempr;
- data[j+1]=data[i+1]-tempi;
- data[i] += tempr;
- data[i+1] += tempi;
- }
- wr=(wtemp=wr)*wpr-wi*wpi+wr;
- wi=wi*wpr+wtemp*wpi+wi;
- }
- mmax=istep;
- }
-}
-#undef SWAP
-
-static int
-smallest_power_of_2_not_less_than(int x)
-{
- int pow2 = 1;
-
- while (pow2 < x){
- pow2 <<= 1;
- }
- return pow2;
-}
-
-
-int
-Blt_Vec_FFT(
- Tcl_Interp *interp, /* Interpreter to report errors to */
- Vector *realPtr, /* If non-NULL, indicates to compute and
- store the real values in this vector. */
- Vector *phasesPtr, /* If non-NULL, indicates to compute
- * and store the imaginary values in
- * this vector. */
- Vector *freqPtr, /* If non-NULL, indicates to compute
- * and store the frequency values in
- * this vector. */
- double delta, /* */
- int flags, /* Bit mask representing various
- * flags: FFT_NO_constANT,
- * FFT_SPECTRUM, and FFT_BARTLETT. */
- Vector *srcPtr)
-{
- int length;
- int pow2len;
- double *paddedData;
- int i;
- double Wss = 0.0;
- /* TENTATIVE */
- int middle = 1;
- int noconstant;
-
- noconstant = (flags & FFT_NO_CONSTANT) ? 1 : 0;
-
- /* Length of the original vector. */
- length = srcPtr->last - srcPtr->first + 1;
- /* new length */
- pow2len = smallest_power_of_2_not_less_than( length );
-
- /* We do not do in-place FFTs */
- if (realPtr == srcPtr) {
- Tcl_AppendResult(interp, "real vector \"", realPtr->name,
- "\" can't be the same as the source", (char *)NULL);
- return TCL_ERROR;
- }
- if (phasesPtr != NULL) {
- if (phasesPtr == srcPtr) {
- Tcl_AppendResult(interp, "imaginary vector \"", phasesPtr->name,
- "\" can't be the same as the source", (char *)NULL);
- return TCL_ERROR;
- }
- if (Blt_Vec_ChangeLength(interp, phasesPtr,
- pow2len/2-noconstant+middle) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (freqPtr != NULL) {
- if (freqPtr == srcPtr) {
- Tcl_AppendResult(interp, "frequency vector \"", freqPtr->name,
- "\" can't be the same as the source", (char *)NULL);
- return TCL_ERROR;
- }
- if (Blt_Vec_ChangeLength(interp, freqPtr,
- pow2len/2-noconstant+middle) != TCL_OK) {
- return TCL_ERROR;
- }
- }
-
- /* Allocate memory zero-filled array. */
- paddedData = Blt_Calloc(pow2len * 2, sizeof(double));
- if (paddedData == NULL) {
- Tcl_AppendResult(interp, "can't allocate memory for padded data",
- (char *)NULL);
- return TCL_ERROR;
- }
-
- /*
- * Since we just do real transforms, only even locations will be
- * filled with data.
- */
- if (flags & FFT_BARTLETT) { /* Bartlett window 1 - ( (x - N/2) / (N/2) ) */
- double Nhalf = pow2len*0.5;
- double Nhalf_1 = 1.0 / Nhalf;
- double w;
-
- for (i = 0; i < length; i++) {
- w = 1.0 - fabs( (i-Nhalf) * Nhalf_1 );
- Wss += w;
- paddedData[2*i] = w * srcPtr->valueArr[i];
- }
- for(/*empty*/; i < pow2len; i++) {
- w = 1.0 - fabs((i-Nhalf) * Nhalf_1);
- Wss += w;
- }
- } else { /* Squared window, i.e. no data windowing. */
- for (i = 0; i < length; i++) {
- paddedData[2*i] = srcPtr->valueArr[i];
- }
- Wss = pow2len;
- }
-
- /* Fourier */
- four1(paddedData-1, pow2len, 1);
-
- /*
- for(i=0;i<pow2len;i++){
- printf( "(%f %f) ", paddedData[2*i], paddedData[2*i+1] );
- }
- */
-
- /* the spectrum is the modulus of the transforms, scaled by 1/N^2 */
- /* or 1/(N * Wss) for windowed data */
- if (flags & FFT_SPECTRUM) {
- double re, im, reS, imS;
- double factor = 1.0 / (pow2len*Wss);
- double *v = realPtr->valueArr;
-
- for (i = 0 + noconstant; i < pow2len / 2; i++) {
- re = paddedData[2*i];
- im = paddedData[2*i+1];
- reS = paddedData[2*pow2len-2*i-2];
- imS = paddedData[2*pow2len-2*i-1];
- v[i - noconstant] = factor * (
-# if 0
- hypot( paddedData[2*i], paddedData[2*i+1] )
- + hypot(
- paddedData[pow2len*2-2*i-2],
- paddedData[pow2len*2-2*i-1]
- )
-# else
- sqrt( re*re + im* im ) + sqrt( reS*reS + imS*imS )
-# endif
- );
- }
- } else {
- for(i = 0 + noconstant; i < pow2len / 2 + middle; i++) {
- realPtr->valueArr[i - noconstant] = paddedData[2*i];
- }
- }
- if( phasesPtr != NULL ){
- for (i = 0 + noconstant; i < pow2len / 2 + middle; i++) {
- phasesPtr->valueArr[i-noconstant] = paddedData[2*i+1];
- }
- }
-
- /* Compute frequencies */
- if (freqPtr != NULL) {
- double N = pow2len;
- double denom = 1.0 / N / delta;
- for( i=0+noconstant; i<pow2len/2+middle; i++ ){
- freqPtr->valueArr[i-noconstant] = ((double) i) * denom;
- }
- }
-
- /* Memory is necessarily dynamic, because nobody touched it ! */
- Blt_Free(paddedData);
-
- realPtr->offset = 0;
- return TCL_OK;
-}
-
-
-int
-Blt_Vec_InverseFFT(Tcl_Interp *interp, Vector *srcImagPtr, Vector *destRealPtr,
- Vector *destImagPtr, Vector *srcPtr)
-{
- int length;
- int pow2len;
- double *paddedData;
- int i;
- double oneOverN;
-
- if ((destRealPtr == srcPtr) || (destImagPtr == srcPtr )){
-/* we do not do in-place FFTs */
- return TCL_ERROR;
- }
- length = srcPtr->last - srcPtr->first + 1;
-
-/* minus one because of the magical middle element! */
- pow2len = smallest_power_of_2_not_less_than( (length-1)*2 );
- oneOverN = 1.0 / pow2len;
-
- if (Blt_Vec_ChangeLength(interp, destRealPtr, pow2len) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Blt_Vec_ChangeLength(interp, destImagPtr, pow2len) != TCL_OK) {
- return TCL_ERROR;
- }
-
- if( length != (srcImagPtr->last - srcImagPtr->first + 1) ){
- Tcl_AppendResult(srcPtr->interp,
- "the length of the imagPart vector must ",
- "be the same as the real one", (char *)NULL);
- return TCL_ERROR;
- }
-
- paddedData = Blt_AssertMalloc( pow2len*2*sizeof(double) );
- if( paddedData == NULL ){
- if (interp != NULL) {
- Tcl_AppendResult(interp, "memory allocation failed", (char *)NULL);
- }
- return TCL_ERROR;
- }
- for(i=0;i<pow2len*2;i++) { paddedData[i] = 0.0; }
- for(i=0;i<length-1;i++){
- paddedData[2*i] = srcPtr->valueArr[i];
- paddedData[2*i+1] = srcImagPtr->valueArr[i];
- paddedData[pow2len*2 - 2*i - 2 ] = srcPtr->valueArr[i+1];
- paddedData[pow2len*2 - 2*i - 1 ] = - srcImagPtr->valueArr[i+1];
- }
-/* mythical middle element */
- paddedData[(length-1)*2] = srcPtr->valueArr[length-1];
- paddedData[(length-1)*2+1] = srcImagPtr->valueArr[length-1];
-
-/*
-for(i=0;i<pow2len;i++){
- printf( "(%f %f) ", paddedData[2*i], paddedData[2*i+1] );
-}
- */
-
-/* fourier */
- four1( paddedData-1, pow2len, -1 );
-
-/* put values in their places, normalising by 1/N */
- for(i=0;i<pow2len;i++){
- destRealPtr->valueArr[i] = paddedData[2*i] * oneOverN;
- destImagPtr->valueArr[i] = paddedData[2*i+1] * oneOverN;
- }
-
-/* memory is necessarily dynamic, because nobody touched it ! */
- Blt_Free( paddedData );
-
- return TCL_OK;
-}
-
-
-/* spinellia at acm.org STOP */
-
-
-
-static double
-FindSplit(Point2d *points, int i, int j, int *split)
-{
- double maxDist2;
-
- maxDist2 = -1.0;
- if ((i + 1) < j) {
- int k;
- double a, b, c;
-
- /*
- *
- * dist2 P(k) = | 1 P(i).x P(i).y |
- * | 1 P(j).x P(j).y |
- * | 1 P(k).x P(k).y |
- * ------------------------------------------
- * (P(i).x - P(j).x)^2 + (P(i).y - P(j).y)^2
- */
-
- a = points[i].y - points[j].y;
- b = points[j].x - points[i].x;
- c = (points[i].x * points[j].y) - (points[i].y * points[j].x);
- for (k = (i + 1); k < j; k++) {
- double dist2;
-
- dist2 = (points[k].x * a) + (points[k].y * b) + c;
- if (dist2 < 0.0) {
- dist2 = -dist2;
- }
- if (dist2 > maxDist2) {
- maxDist2 = dist2; /* Track the maximum. */
- *split = k;
- }
- }
- /* Correction for segment length---should be redone if can == 0 */
- maxDist2 *= maxDist2 / (a * a + b * b);
- }
- return maxDist2;
-}
-
-
-/* Douglas-Peucker line simplification algorithm */
-int
-Blt_SimplifyLine(Point2d *inputPts, int low, int high, double tolerance,
- int *indices)
-{
-#define StackPush(a) s++, stack[s] = (a)
-#define StackPop(a) (a) = stack[s], s--
-#define StackEmpty() (s < 0)
-#define StackTop() stack[s]
- int *stack;
- int split = -1;
- double dist2, tolerance2;
- int s = -1; /* Points to top stack item. */
- int count;
-
- stack = Blt_AssertMalloc(sizeof(int) * (high - low + 1));
- StackPush(high);
- count = 0;
- indices[count++] = 0;
- tolerance2 = tolerance * tolerance;
- while (!StackEmpty()) {
- dist2 = FindSplit(inputPts, low, StackTop(), &split);
- if (dist2 > tolerance2) {
- StackPush(split);
- } else {
- indices[count++] = StackTop();
- StackPop(low);
- }
- }
- Blt_Free(stack);
- return count;
-}
diff --git a/blt3.0.1/src/bltVector.h b/blt3.0.1/src/bltVector.h
deleted file mode 100644
index 78eddc5..0000000
--- a/blt3.0.1/src/bltVector.h
+++ /dev/null
@@ -1,137 +0,0 @@
-
-/*
- * bltVector.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_VECTOR_H
-#define _BLT_VECTOR_H
-
-typedef enum {
- BLT_VECTOR_NOTIFY_UPDATE = 1, /* The vector's values has been updated */
- BLT_VECTOR_NOTIFY_DESTROY /* The vector has been destroyed and the client
- * should no longer use its data (calling
- * Blt_FreeVectorId) */
-} Blt_VectorNotify;
-
-typedef struct _Blt_VectorId *Blt_VectorId;
-
-typedef void (Blt_VectorChangedProc)(Tcl_Interp *interp, ClientData clientData,
- Blt_VectorNotify notify);
-
-typedef struct {
- double *valueArr; /* Array of values (possibly malloc-ed) */
- int numValues; /* Number of values in the array */
- int arraySize; /* Size of the allocated space */
- double min, max; /* Minimum and maximum values in the vector */
- int dirty; /* Indicates if the vector has been updated */
- int reserved; /* Reserved for future use */
-
-} Blt_Vector;
-
-typedef double (Blt_VectorIndexProc)(Blt_Vector * vecPtr);
-
-typedef enum {
- BLT_MATH_FUNC_SCALAR = 1, /* The function returns a single double
- * precision value. */
- BLT_MATH_FUNC_VECTOR /* The function processes the entire vector. */
-} Blt_MathFuncType;
-
-/*
- * To be safe, use the macros below, rather than the fields of the
- * structure directly.
- *
- * The Blt_Vector is basically an opaque type. But it's also the
- * actual memory address of the vector itself. I wanted to make the
- * API as unobtrusive as possible. So instead of giving you a copy of
- * the vector, providing various functions to access and update the
- * vector, you get your hands on the actual memory (array of doubles)
- * shared by all the vector's clients.
- *
- * The trade-off for speed and convenience is safety. You can easily
- * break things by writing into the vector when other clients are
- * using it. Use Blt_ResetVector to get around this. At least the
- * macros are a reminder it isn't really safe to reset the data
- * fields, except by the API routines.
- */
-#define Blt_VecData(v) ((v)->valueArr)
-#define Blt_VecLength(v) ((v)->numValues)
-#define Blt_VecSize(v) ((v)->arraySize)
-#define Blt_VecDirty(v) ((v)->dirty)
-
-BLT_EXTERN double Blt_VecMin(Blt_Vector *vPtr);
-BLT_EXTERN double Blt_VecMax(Blt_Vector *vPtr);
-
-BLT_EXTERN Blt_VectorId Blt_AllocVectorId(Tcl_Interp *interp,
- const char *vecName);
-
-BLT_EXTERN void Blt_SetVectorChangedProc(Blt_VectorId clientId,
- Blt_VectorChangedProc *proc, ClientData clientData);
-
-BLT_EXTERN void Blt_FreeVectorId(Blt_VectorId clientId);
-
-BLT_EXTERN int Blt_GetVectorById(Tcl_Interp *interp, Blt_VectorId clientId,
- Blt_Vector **vecPtrPtr);
-
-BLT_EXTERN const char *Blt_NameOfVectorId(Blt_VectorId clientId);
-
-BLT_EXTERN const char *Blt_NameOfVector(Blt_Vector *vecPtr);
-
-BLT_EXTERN int Blt_VectorNotifyPending(Blt_VectorId clientId);
-
-BLT_EXTERN int Blt_CreateVector(Tcl_Interp *interp, const char *vecName,
- int size, Blt_Vector ** vecPtrPtr);
-
-BLT_EXTERN int Blt_CreateVector2(Tcl_Interp *interp, const char *vecName,
- const char *cmdName, const char *varName, int initialSize,
- Blt_Vector **vecPtrPtr);
-
-BLT_EXTERN int Blt_GetVector(Tcl_Interp *interp, const char *vecName,
- Blt_Vector **vecPtrPtr);
-
-BLT_EXTERN int Blt_GetVectorFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- Blt_Vector **vecPtrPtr);
-
-BLT_EXTERN int Blt_VectorExists(Tcl_Interp *interp, const char *vecName);
-
-BLT_EXTERN int Blt_ResetVector(Blt_Vector *vecPtr, double *dataArr, int n,
- int arraySize, Tcl_FreeProc *freeProc);
-
-BLT_EXTERN int Blt_ResizeVector(Blt_Vector *vecPtr, int n);
-
-BLT_EXTERN int Blt_DeleteVectorByName(Tcl_Interp *interp, const char *vecName);
-
-BLT_EXTERN int Blt_DeleteVector(Blt_Vector *vecPtr);
-
-BLT_EXTERN int Blt_ExprVector(Tcl_Interp *interp, char *expr,
- Blt_Vector *vecPtr);
-
-BLT_EXTERN void Blt_InstallIndexProc(Tcl_Interp *interp, const char *indexName,
- Blt_VectorIndexProc * procPtr);
-
-BLT_EXTERN int Blt_VectorExists2(Tcl_Interp *interp, const char *vecName);
-
-#endif /* _BLT_VECTOR_H */
diff --git a/blt3.0.1/src/bltWait.h b/blt3.0.1/src/bltWait.h
deleted file mode 100644
index 6f43f21..0000000
--- a/blt3.0.1/src/bltWait.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * bltWait.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_WAIT_H
-#define _BLT_WAIT_H
-
-#ifdef HAVE_WAITFLAGS_H
-# include <waitflags.h>
-#endif
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-#ifdef HAVE_ERRNO_H
-# include <errno.h>
-#endif
-
-/*
- * Define EINPROGRESS in terms of WSAEINPROGRESS.
- */
-
-#ifndef EINPROGRESS
-#define EINPROGRESS WSAEINPROGRESS
-#endif
-
-/*
- * If ENOTSUP is not defined, define it to a value that will never occur.
- */
-
-#ifndef ENOTSUP
-#define ENOTSUP -1030507
-#endif
-
-/*
- * The following defines redefine the Windows Socket errors as
- * BSD errors so Tcl_PosixError can do the right thing.
- */
-
-#ifndef EWOULDBLOCK
-#define EWOULDBLOCK EAGAIN
-#endif
-#ifndef EALREADY
-#define EALREADY 149 /* operation already in progress */
-#endif
-#ifndef ENOTSOCK
-#define ENOTSOCK 95 /* Socket operation on non-socket */
-#endif
-#ifndef EDESTADDRREQ
-#define EDESTADDRREQ 96 /* Destination address required */
-#endif
-#ifndef EMSGSIZE
-#define EMSGSIZE 97 /* Message too long */
-#endif
-#ifndef EPROTOTYPE
-#define EPROTOTYPE 98 /* Protocol wrong type for socket */
-#endif
-#ifndef ENOPROTOOPT
-#define ENOPROTOOPT 99 /* Protocol not available */
-#endif
-#ifndef EPROTONOSUPPORT
-#define EPROTONOSUPPORT 120 /* Protocol not supported */
-#endif
-#ifndef ESOCKTNOSUPPORT
-#define ESOCKTNOSUPPORT 121 /* Socket type not supported */
-#endif
-#ifndef EOPNOTSUPP
-#define EOPNOTSUPP 122 /* Operation not supported on socket */
-#endif
-#ifndef EPFNOSUPPORT
-#define EPFNOSUPPORT 123 /* Protocol family not supported */
-#endif
-#ifndef EAFNOSUPPORT
-#define EAFNOSUPPORT 124 /* Address family not supported */
-#endif
-#ifndef EADDRINUSE
-#define EADDRINUSE 125 /* Address already in use */
-#endif
-#ifndef EADDRNOTAVAIL
-#define EADDRNOTAVAIL 126 /* Can't assign requested address */
-#endif
-#ifndef ENETDOWN
-#define ENETDOWN 127 /* Network is down */
-#endif
-#ifndef ENETUNREACH
-#define ENETUNREACH 128 /* Network is unreachable */
-#endif
-#ifndef ENETRESET
-#define ENETRESET 129 /* Network dropped connection on reset */
-#endif
-#ifndef ECONNABORTED
-#define ECONNABORTED 130 /* Software caused connection abort */
-#endif
-#ifndef ECONNRESET
-#define ECONNRESET 131 /* Connection reset by peer */
-#endif
-#ifndef ENOBUFS
-#define ENOBUFS 132 /* No buffer space available */
-#endif
-#ifndef EISCONN
-#define EISCONN 133 /* Socket is already connected */
-#endif
-#ifndef ENOTCONN
-#define ENOTCONN 134 /* Socket is not connected */
-#endif
-#ifndef ESHUTDOWN
-#define ESHUTDOWN 143 /* Can't send after socket shutdown */
-#endif
-#ifndef ETOOMANYREFS
-#define ETOOMANYREFS 144 /* Too many references: can't splice */
-#endif
-#ifndef ETIMEDOUT
-#define ETIMEDOUT 145 /* Connection timed out */
-#endif
-#ifndef ECONNREFUSED
-#define ECONNREFUSED 146 /* Connection refused */
-#endif
-#ifndef ELOOP
-#define ELOOP 90 /* Symbolic link loop */
-#endif
-#ifndef EHOSTDOWN
-#define EHOSTDOWN 147 /* Host is down */
-#endif
-#ifndef EHOSTUNREACH
-#define EHOSTUNREACH 148 /* No route to host */
-#endif
-#ifndef ENOTEMPTY
-#define ENOTEMPTY 93 /* directory not empty */
-#endif
-#ifndef EUSERS
-#define EUSERS 94 /* Too many users (for UFS) */
-#endif
-#ifndef EDQUOT
-#define EDQUOT 49 /* Disc quota exceeded */
-#endif
-#ifndef ESTALE
-#define ESTALE 151 /* Stale NFS file handle */
-#endif
-#ifndef EREMOTE
-#define EREMOTE 66 /* The object is remote */
-#endif
-
-#ifndef WIFEXITED
-# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xff) == 0)
-#endif
-
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff)
-#endif
-
-#ifndef WIFSIGNALED
-# define WIFSIGNALED(stat) (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) & 0x00ff)))
-#endif
-
-#ifndef WTERMSIG
-# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7f)
-#endif
-
-#ifndef WIFSTOPPED
-# define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xff) == 0177)
-#endif
-
-#ifndef WSTOPSIG
-# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xff)
-#endif
-
-/*
- * Define constants for waitpid() system call if they aren't defined
- * by a system header file.
- */
-
-#ifndef WNOHANG
-# define WNOHANG 1
-#endif
-#ifndef WUNTRACED
-# define WUNTRACED 2
-#endif
-
-/*
- * The type of the status returned by wait varies from UNIX system
- * to UNIX system. The macro below defines it:
- */
-
-#ifdef AIX
-# define WAIT_STATUS_TYPE pid_t
-#else
-#ifdef HAVE_UNION_WAIT
-# define WAIT_STATUS_TYPE union wait
-#else
-# define WAIT_STATUS_TYPE int
-#endif
-#endif
-
-/*
- * Supply definitions for macros to query wait status, if not already
- * defined in header files above.
- */
-
-#ifndef WIFEXITED
-# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xff) == 0)
-#endif
-
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff)
-#endif
-
-#ifndef WIFSIGNALED
-# define WIFSIGNALED(stat) (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) & 0x00ff)))
-#endif
-
-#ifndef WTERMSIG
-# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7f)
-#endif
-
-#ifndef WIFSTOPPED
-# define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xff) == 0177)
-#endif
-
-#ifndef WSTOPSIG
-# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xff)
-#endif
-
-#endif /* _BLT_WAIT_H */
diff --git a/blt3.0.1/src/bltWatch.c b/blt3.0.1/src/bltWatch.c
deleted file mode 100644
index 93b1b30..0000000
--- a/blt3.0.1/src/bltWatch.c
+++ /dev/null
@@ -1,856 +0,0 @@
-
-/*
- * bltWatch.c --
- *
- * This module implements watch procedure callbacks for TCL commands
- * and procedures.
- *
- * Copyright 1994-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltOp.h"
-#include <bltHash.h>
-#include "bltSwitch.h"
-
-#define UNKNOWN_RETURN_CODE 5
-static const char *codeNames[] =
-{
- "OK", "ERROR", "RETURN", "BREAK", "CONTINUE"
-};
-
-#define WATCH_THREAD_KEY "BLT Watch Command Data"
-#define WATCH_MAX_LEVEL 10000 /* Maximum depth of TCL traces. */
-
-enum WatchStates {
- WATCH_STATE_DONT_CARE = -1, /* Select watch regardless of state */
- WATCH_STATE_IDLE = 0, /* */
- WATCH_STATE_ACTIVE = 1
-};
-
-typedef struct {
- Tcl_Interp *interp; /* Interpreter associated with the watch */
- char *name; /* Watch identifier */
-
- /* User-configurable fields */
- enum WatchStates state; /* Current state of watch: either
- * WATCH_STATE_IDLE or WATCH_STATE_ACTIVE */
- int maxLevel; /* Maximum depth of tracing allowed */
- char **preCmd; /* Procedure to be invoked before the
- * command is executed (but after
- * substitutions have occurred). */
- char **postCmd; /* Procedure to be invoked after the command
- * is executed. */
- Tcl_Trace trace; /* Trace handler which activates "pre"
- * command procedures */
- Tcl_AsyncHandler asyncHandle; /* Async handler which triggers the
- * "post" command procedure (if one
- * exists) */
- int active; /* Indicates if a trace is currently
- * active. This prevents recursive
- * tracing of the "pre" and "post"
- * procedures. */
- int level; /* Current level of traced command. */
- char *cmdPtr; /* Command string before substitutions.
- * Points to a original command buffer. */
- char *args; /* TCL list of the command after
- * substitutions. List is malloc-ed by
- * Tcl_Merge. Must be freed in handler
- * procs */
-} Watch;
-
-typedef struct {
- Blt_HashTable watchTable; /* Hash table of trees keyed by address. */
- Tcl_Interp *interp;
-} WatchCmdInterpData;
-
-static Blt_SwitchSpec switchSpecs[] =
-{
- {BLT_SWITCH_LIST, "-precmd", "command",
- Blt_Offset(Watch, preCmd), 0},
- {BLT_SWITCH_LIST, "-postcmd", "command",
- Blt_Offset(Watch, postCmd), 0},
- {BLT_SWITCH_BOOLEAN, "-active", "bool",
- Blt_Offset(Watch, state), 0},
- {BLT_SWITCH_INT_NNEG, "-maxlevel", "number",
- Blt_Offset(Watch, maxLevel), 0},
- {BLT_SWITCH_END}
-};
-
-static Tcl_CmdTraceProc PreCmdProc;
-static Tcl_AsyncProc PostCmdProc;
-static Tcl_ObjCmdProc WatchCmd;
-
-/*
- *---------------------------------------------------------------------------
- *
- * TreeInterpDeleteProc --
- *
- * This is called when the interpreter hosting the "tree" command
- * is deleted.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Removes the hash table managing all tree names.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-WatchInterpDeleteProc(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp)
-{
- WatchCmdInterpData *dataPtr = clientData;
-
- /* All tree instances should already have been destroyed when
- * their respective TCL commands were deleted. */
- Blt_DeleteHashTable(&dataPtr->watchTable);
- Tcl_DeleteAssocData(interp, WATCH_THREAD_KEY);
- Blt_Free(dataPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetWatchCmdInterpData --
- *
- *---------------------------------------------------------------------------
- */
-static WatchCmdInterpData *
-GetWatchCmdInterpData(Tcl_Interp *interp)
-{
- WatchCmdInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (WatchCmdInterpData *)
- Tcl_GetAssocData(interp, WATCH_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(WatchCmdInterpData));
- dataPtr->interp = interp;
- Tcl_SetAssocData(interp, WATCH_THREAD_KEY, WatchInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->watchTable, BLT_ONE_WORD_KEYS);
- }
- return dataPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PreCmdProc --
- *
- * Procedure callback for Tcl_Trace. Gets called before the
- * command is executed, but after substitutions have occurred.
- * If a watch procedure is active, it evals a TCL command.
- * Activates the "precmd" callback, if one exists.
- *
- * Stashes some information for the "pre" callback: command
- * string, substituted argument list, and current level.
- *
- * Format of "pre" proc:
- *
- * proc beforeCmd { level cmdStr argList } {
- *
- * }
- *
- *
- * Results:
- * None.
- *
- * Side Effects:
- * A Tcl_AsyncHandler may be triggered, if a "post" procedure is
- * defined.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-PreCmdProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- int level, /* Current level */
- char *command, /* Command before substitution */
- Tcl_CmdProc *cmdProc, /* Not used. */
- ClientData cmdClientData, /* Not used. */
- int argc,
- const char **argv) /* Command after parsing, but before
- * evaluation */
-{
- Watch *watchPtr = clientData;
-
- if (watchPtr->active) {
- return; /* Don't re-enter from Tcl_Eval below */
- }
- watchPtr->cmdPtr = command;
- watchPtr->level = level;
- /*
- * There's no guarantee that the calls to PreCmdProc will match
- * up with PostCmdProc. So free up argument lists that are still
- * hanging around before allocating a new one.
- */
- if (watchPtr->args != NULL) {
- Blt_Free(watchPtr->args);
- }
- watchPtr->args = Tcl_Merge(argc, argv);
-
- if (watchPtr->preCmd != NULL) {
- Tcl_DString buffer;
- char string[200];
- int status;
- char **p;
-
- /* Create the "pre" command procedure call */
- Tcl_DStringInit(&buffer);
- for (p = watchPtr->preCmd; *p != NULL; p++) {
- Tcl_DStringAppendElement(&buffer, *p);
- }
- sprintf_s(string, 200, "%d", watchPtr->level);
- Tcl_DStringAppendElement(&buffer, string);
- Tcl_DStringAppendElement(&buffer, watchPtr->cmdPtr);
- Tcl_DStringAppendElement(&buffer, watchPtr->args);
-
- watchPtr->active = 1;
- status = Tcl_Eval(interp, Tcl_DStringValue(&buffer));
- watchPtr->active = 0;
-
- Tcl_DStringFree(&buffer);
- if (status != TCL_OK) {
- fprintf(stderr, "%s failed: %s\n", watchPtr->preCmd[0],
- Tcl_GetStringResult(interp));
- }
- }
- /* Set the trigger for the "post" command procedure */
- if (watchPtr->postCmd != NULL) {
- Tcl_AsyncMark(watchPtr->asyncHandle);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PostCmdProc --
- *
- * Procedure callback for Tcl_AsyncHandler. Gets called after
- * the command has executed. It tests for a "post" command, but
- * you really can't get here, if one doesn't exist.
- *
- * Save the current contents of interp->result before calling
- * the "post" command, and restore it afterwards.
- *
- * Format of "post" proc:
- *
- * proc afterCmd { level cmdStr argList retCode results } {
- *
- * }
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Memory for argument list is released.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-PostCmdProc(ClientData clientData, Tcl_Interp *interp, int code)
-{
- Watch *watchPtr = clientData;
-
- if (watchPtr->active) {
- return code;
- }
- if (watchPtr->postCmd != NULL) {
- int status;
- Tcl_DString buffer;
- char string[200];
- const char *results;
- char **p;
- const char *retCode;
- char *errorCode, *errorInfo;
- errorInfo = errorCode = NULL;
-
- results = "NO INTERPRETER AVAILABLE";
-
- /*
- * Save the state of the interpreter.
- */
- if (interp != NULL) {
- errorInfo = (char *)Tcl_GetVar2(interp, "errorInfo", (char *)NULL,
- TCL_GLOBAL_ONLY);
- if (errorInfo != NULL) {
- errorInfo = Blt_AssertStrdup(errorInfo);
- }
- errorCode = (char *)Tcl_GetVar2(interp, "errorCode", (char *)NULL,
- TCL_GLOBAL_ONLY);
- if (errorCode != NULL) {
- errorCode = Blt_AssertStrdup(errorCode);
- }
- results = Blt_AssertStrdup(Tcl_GetStringResult(interp));
- }
- /* Create the "post" command procedure call */
- Tcl_DStringInit(&buffer);
- for (p = watchPtr->postCmd; *p != NULL; p++) {
- Tcl_DStringAppendElement(&buffer, *p);
- }
- sprintf_s(string, 200, "%d", watchPtr->level);
- Tcl_DStringAppendElement(&buffer, string);
- Tcl_DStringAppendElement(&buffer, watchPtr->cmdPtr);
- Tcl_DStringAppendElement(&buffer, watchPtr->args);
- if (code < UNKNOWN_RETURN_CODE) {
- retCode = codeNames[code];
- } else {
- sprintf_s(string, 200, "%d", code);
- retCode = string;
- }
- Tcl_DStringAppendElement(&buffer, retCode);
- Tcl_DStringAppendElement(&buffer, results);
-
- watchPtr->active = 1;
- status = Tcl_Eval(watchPtr->interp, Tcl_DStringValue(&buffer));
- watchPtr->active = 0;
-
- Tcl_DStringFree(&buffer);
- Blt_Free(watchPtr->args);
- watchPtr->args = NULL;
-
- if (status != TCL_OK) {
- fprintf(stderr, "%s failed: %s\n", watchPtr->postCmd[0],
- Tcl_GetStringResult(watchPtr->interp));
- }
- /*
- * Restore the state of the interpreter.
- */
- if (interp != NULL) {
- if (errorInfo != NULL) {
- Tcl_SetVar2(interp, "errorInfo", (char *)NULL, errorInfo,
- TCL_GLOBAL_ONLY);
- Blt_Free(errorInfo);
- }
- if (errorCode != NULL) {
- Tcl_SetVar2(interp, "errorCode", (char *)NULL, errorCode,
- TCL_GLOBAL_ONLY);
- Blt_Free(errorCode);
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), results, -1);
- }
- }
- return code;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewWatch --
- *
- * Creates a new watch. The new watch is registered into the
- * "watchTable" hash table. Also creates a Tcl_AsyncHandler for
- * triggering "post" events.
- *
- * Results:
- * If memory for the watch could be allocated, a pointer to
- * the new watch is returned. Otherwise NULL, and interp->result
- * points to an error message.
- *
- * Side Effects:
- * A new Tcl_AsyncHandler is created. A new hash table entry
- * is created. Memory the watch structure is allocated.
- *
- *---------------------------------------------------------------------------
- */
-static Watch *
-NewWatch(Tcl_Interp *interp, const char *name)
-{
- Watch *watchPtr;
-
- watchPtr = Blt_Calloc(1, sizeof(Watch));
- if (watchPtr == NULL) {
- Tcl_AppendResult(interp, "can't allocate watch structure", (char *)NULL);
- return NULL;
- }
- watchPtr->state = WATCH_STATE_ACTIVE;
- watchPtr->maxLevel = WATCH_MAX_LEVEL;
- watchPtr->name = Blt_AssertStrdup(name);
- watchPtr->interp = interp;
- watchPtr->asyncHandle = Tcl_AsyncCreate(PostCmdProc, watchPtr);
- return watchPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyWatch --
- *
- * Removes the watch. The resources used by the watch
- * are released.
- * 1) If the watch is active, its trace is deleted.
- * 2) Memory for command strings is free-ed.
- * 3) Entry is removed from watch registry.
- * 4) Async handler is deleted.
- * 5) Memory for watch itself is released.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Everything associated with the watch is freed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyWatch(WatchCmdInterpData *dataPtr, Watch *watchPtr)
-{
- Blt_HashEntry *hPtr;
-
- Tcl_AsyncDelete(watchPtr->asyncHandle);
- if (watchPtr->state == WATCH_STATE_ACTIVE) {
- Tcl_DeleteTrace(watchPtr->interp, watchPtr->trace);
- }
- if (watchPtr->preCmd != NULL) {
- Blt_Free(watchPtr->preCmd);
- }
- if (watchPtr->postCmd != NULL) {
- Blt_Free(watchPtr->postCmd);
- }
- if (watchPtr->args != NULL) {
- Blt_Free(watchPtr->args);
- }
- hPtr = Blt_FindHashEntry(&dataPtr->watchTable, (char *)watchPtr->name);
- Blt_DeleteHashEntry(&dataPtr->watchTable, hPtr);
- if (watchPtr->name != NULL) {
- Blt_Free(watchPtr->name);
- }
- Blt_Free(watchPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetWatchFromObj --
- *
- * Searches for the watch represented by the watch name and its
- * associated interpreter in its directory.
- *
- * Results:
- * If found, the pointer to the watch structure is returned,
- * otherwise NULL. If requested, interp-result will be filled
- * with an error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetWatchFromObj(
- WatchCmdInterpData *dataPtr,
- Tcl_Interp *interp,
- Tcl_Obj *objPtr,
- Watch **watchPtrPtr)
-{
- Blt_HashEntry *hPtr;
- char *string;
-
- string = Tcl_GetString(objPtr);
- hPtr = Blt_FindHashEntry(&dataPtr->watchTable, (char *)string);
- if (hPtr == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "can't find any watch named \"",
- string, "\"", (char *)NULL);
- }
- return TCL_ERROR;
- }
- *watchPtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ListWatches --
- *
- * Creates a list of all watches in the interpreter. The
- * list search may be restricted to selected states by
- * setting "state" to something other than WATCH_STATE_DONT_CARE.
- *
- * Results:
- * A standard TCL result. Interp->result will contain a list
- * of all watches matches the state criteria.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ListWatches(WatchCmdInterpData *dataPtr, Tcl_Interp *interp,
- enum WatchStates state)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- for (hPtr = Blt_FirstHashEntry(&dataPtr->watchTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- Watch *watchPtr;
-
- watchPtr = Blt_GetHashValue(hPtr);
- if ((state == WATCH_STATE_DONT_CARE) ||
- (state == watchPtr->state)) {
- Tcl_ListObjAppendElement(interp, listObjPtr,
- Tcl_NewStringObj(watchPtr->name, -1));
- }
- }
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigWatch --
- *
- * Processes argument list of switches and values, setting
- * Watch fields.
- *
- * Results:
- * If found, the pointer to the watch structure is returned,
- * otherwise NULL. If requested, interp-result will be filled
- * with an error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigWatch(Watch *watchPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (Blt_ParseSwitches(interp, switchSpecs, objc, objv, watchPtr,
- BLT_SWITCH_DEFAULTS) < 0) {
- return TCL_ERROR;
- }
- /*
- * If the watch's max depth changed or its state, reset the traces.
- */
- if (watchPtr->trace != (Tcl_Trace) 0) {
- Tcl_DeleteTrace(interp, watchPtr->trace);
- watchPtr->trace = (Tcl_Trace) 0;
- }
- if (watchPtr->state == WATCH_STATE_ACTIVE) {
- watchPtr->trace = Tcl_CreateTrace(interp, watchPtr->maxLevel,
- PreCmdProc, watchPtr);
- }
- return TCL_OK;
-}
-
-/* TCL interface routines */
-/*
- *---------------------------------------------------------------------------
- *
- * CreateOp --
- *
- * Creates a new watch and processes any extra switches.
- *
- * Results:
- * A standard TCL result.
- *
- * Side Effects:
- * A new watch is created.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-CreateOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- WatchCmdInterpData *dataPtr = clientData;
- Watch *watchPtr;
- int isNew;
- char *string;
- Blt_HashEntry *hPtr;
-
- string = Tcl_GetString(objv[2]);
- hPtr = Blt_CreateHashEntry(&dataPtr->watchTable, string, &isNew);
- if (!isNew) {
- Tcl_AppendResult(interp, "a watch \"", string, "\" already exists",
- (char *)NULL);
- return TCL_ERROR;
- }
- watchPtr = NewWatch(interp, string);
- if (watchPtr == NULL) {
- return TCL_ERROR; /* Can't create new watch */
- }
- Blt_SetHashValue(hPtr, watchPtr);
- return ConfigWatch(watchPtr, interp, objc - 3, objv + 3);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteOp --
- *
- * Deletes the watch.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-DeleteOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Watch *watchPtr;
- WatchCmdInterpData *dataPtr = clientData;
-
- if (GetWatchFromObj(dataPtr, interp, objv[2], &watchPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- DestroyWatch(dataPtr, watchPtr);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ActivateOp --
- *
- * Activate/deactivates the named watch.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ActivateOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- WatchCmdInterpData *dataPtr = clientData;
- Watch *watchPtr;
- enum WatchStates state;
- char *string;
-
- if (GetWatchFromObj(dataPtr, interp, objv[2], &watchPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- string = Tcl_GetString(objv[1]);
- state = (string[0] == 'a') ? WATCH_STATE_ACTIVE : WATCH_STATE_IDLE;
- if (state != watchPtr->state) {
- if (watchPtr->trace == (Tcl_Trace) 0) {
- watchPtr->trace = Tcl_CreateTrace(interp, watchPtr->maxLevel,
- PreCmdProc, watchPtr);
- } else {
- Tcl_DeleteTrace(interp, watchPtr->trace);
- watchPtr->trace = (Tcl_Trace) 0;
- }
- watchPtr->state = state;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NamesOp --
- *
- * Returns the names of all watches in the interpreter.
- *
- * Results:
- * A standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-NamesOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- WatchCmdInterpData *dataPtr = clientData;
- enum WatchStates state;
-
- state = WATCH_STATE_DONT_CARE;
- if (objc == 3) {
- char c;
- char *string;
-
- string = Tcl_GetString(objv[2]);
- c = string[0];
- if ((c == 'a') && (strcmp(string, "active") == 0)) {
- state = WATCH_STATE_ACTIVE;
- } else if ((c == 'i') && (strcmp(string, "idle") == 0)) {
- state = WATCH_STATE_IDLE;
- } else if ((c == 'i') && (strcmp(string, "ignore") == 0)) {
- state = WATCH_STATE_DONT_CARE;
- } else {
- Tcl_AppendResult(interp, "bad state \"", string, "\" should be \
-\"active\", \"idle\", or \"ignore\"", (char *)NULL);
- return TCL_ERROR;
- }
- }
- return ListWatches(dataPtr, interp, state);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureOp --
- *
- * Convert the range of the pixel values allowed into a list.
- *
- * Results:
- * The string representation of the limits is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ConfigureOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- WatchCmdInterpData *dataPtr = clientData;
- Watch *watchPtr;
-
- if (GetWatchFromObj(dataPtr, interp, objv[2], &watchPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return ConfigWatch(watchPtr, interp, objc - 3, objv + 3);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InfoOp --
- *
- * Convert the limits of the pixel values allowed into a list.
- *
- * Results:
- * The string representation of the limits is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-InfoOp(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- WatchCmdInterpData *dataPtr = clientData;
- Watch *watchPtr;
- char **p;
-
- if (GetWatchFromObj(dataPtr, interp, objv[2], &watchPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (watchPtr->preCmd != NULL) {
- Tcl_AppendResult(interp, "-precmd", (char *)NULL);
- for (p = watchPtr->preCmd; *p != NULL; p++) {
- Tcl_AppendResult(interp, " ", *p, (char *)NULL);
- }
- }
- if (watchPtr->postCmd != NULL) {
- Tcl_AppendResult(interp, "-postcmd", (char *)NULL);
- for (p = watchPtr->postCmd; *p != NULL; p++) {
- Tcl_AppendResult(interp, " ", *p, (char *)NULL);
- }
- }
- Tcl_AppendResult(interp, "-maxlevel ", Blt_Itoa(watchPtr->maxLevel), " ",
- (char *)NULL);
- Tcl_AppendResult(interp, "-active ", (watchPtr->state == WATCH_STATE_ACTIVE)
- ? "true" : "false", " ", (char *)NULL);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WatchCmd --
- *
- * This procedure is invoked to process the TCL "blt_watch"
- * command. See the user documentation for details on what
- * it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-static Blt_OpSpec watchOps[] =
-{
- {"activate", 1, ActivateOp, 3, 3, "watchName",},
- {"configure", 2, ConfigureOp, 3, 0,
- "watchName ?options...?"},
- {"create", 2, CreateOp, 3, 0, "watchName ?switches?",},
- {"deactivate", 3, ActivateOp, 3, 3, "watchName",},
- {"delete", 3, DeleteOp, 3, 3, "watchName",},
- {"info", 1, InfoOp, 3, 3, "watchName",},
- {"names", 1, NamesOp, 2, 3, "?state?",},
-};
-static int nWatchOps = sizeof(watchOps) / sizeof(Blt_OpSpec);
-
-/*ARGSUSED*/
-static int
-WatchCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nWatchOps, watchOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (clientData, interp, objc, objv);
- return result;
-}
-
-/* Public initialization routine */
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_WatchCmdInitProc --
- *
- * This procedure is invoked to initialize the TCL command
- * "blt_watch".
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates the new command and adds a new entry into a
- * global Tcl associative array.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_WatchCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {"watch", WatchCmd, NULL};
-
- cmdSpec.clientData = GetWatchCmdInterpData(interp);
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
diff --git a/blt3.0.1/src/bltWin.h b/blt3.0.1/src/bltWin.h
deleted file mode 100644
index 932077d..0000000
--- a/blt3.0.1/src/bltWin.h
+++ /dev/null
@@ -1,265 +0,0 @@
-
-/*
- * bltWin.h --
- *
- * Copyright 1993-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _BLT_WIN_H
-#define _BLT_WIN_H
-
-#define _CRT_SECURE_NO_DEPRECATE
-
-#define STRICT
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef STRICT
-#undef WIN32_LEAN_AND_MEAN
-#include <windowsx.h>
-
-#undef STD_NORMAL_BACKGROUND
-#undef STD_NORMAL_FOREGROUND
-#undef STD_SELECT_BACKGROUND
-#undef STD_SELECT_FOREGROUND
-#undef STD_TEXT_FOREGROUND
-#undef STD_FONT
-#undef STD_FONT_LARGE
-#undef STD_FONT_SMALL
-
-#define STD_NORMAL_BACKGROUND "SystemButtonFace"
-#define STD_NORMAL_FOREGROUND "SystemButtonText"
-#define STD_SELECT_BACKGROUND "SystemHighlight"
-#define STD_SELECT_FOREGROUND "SystemHighlightText"
-#define STD_TEXT_FOREGROUND "SystemWindowText"
-#define STD_FONT "Arial 8"
-#define STD_FONT_LARGE "Arial 12"
-#define STD_FONT_SMALL "Arial 6"
-
-#ifdef CHECK_UNICODE_CALLS
-#define _UNICODE
-#define UNICODE
-#define __TCHAR_DEFINED
-typedef float *_TCHAR;
-#define _TCHAR_DEFINED
-typedef float *TCHAR;
-#endif /* CHECK_UNICODE_CALLS */
-
-/* DOS Encapsulated PostScript File Header */
-#pragma pack(2)
-typedef struct {
- BYTE magic[4]; /* Magic number for a DOS EPS file
- * C5,D0,D3,C6 */
- DWORD psStart; /* Offset of PostScript section. */
- DWORD psLength; /* Length of the PostScript section. */
- DWORD wmfStart; /* Offset of Windows Meta File section. */
- DWORD wmfLength; /* Length of Meta file section. */
- DWORD tiffStart; /* Offset of TIFF section. */
- DWORD tiffLength; /* Length of TIFF section. */
- WORD checksum; /* Checksum of header. If FFFF, ignore. */
-} DOSEPSHEADER;
-
-#pragma pack()
-
-/* Aldus Portable Metafile Header */
-#pragma pack(2)
-typedef struct {
- DWORD key; /* Type of metafile */
- WORD hmf; /* Unused. Must be NULL. */
- SMALL_RECT bbox; /* Bounding rectangle */
- WORD inch; /* Units per inch. */
- DWORD reserved; /* Unused. */
- WORD checksum; /* XOR of previous fields (10 32-bit words). */
-} APMHEADER;
-#pragma pack()
-
-#undef Blt_Export
-#define Blt_Export __declspec(dllexport)
-
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-#define fstat _fstat
-#define stat _stat
-#ifdef _MSC_VER
-#define fileno _fileno
-#endif
-#define isnan(x) _isnan(x)
-#define strcasecmp(s1,s2) _stricmp(s1,s2)
-#define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n)
-#define vsnprintf _vsnprintf
-#define isascii(c) __isascii(c)
-#endif /* _MSC_VER || __BORLANDC__ */
-
-#ifdef __BORLANDC__
-#define isnan(x) _isnan(x)
-#endif
-
-#if defined(__BORLANDC__) || defined(_MSC_VER)
-#ifdef FINITE
-#undef FINITE
-#define FINITE(x) _finite(x)
-#endif
-#endif /* __BORLANDC__ || _MSC_VER */
-
-#ifdef __GNUC__
-#include <wingdi.h>
-#include <windowsx.h>
-#undef Status
-#include <winspool.h>
-#define Status int
-/*
- * Add definitions missing from windgi.h, windowsx.h, and winspool.h
- */
-#include <missing.h>
-#endif /* __GNUC__ */
-
-#undef XCopyArea
-#define XCopyArea Blt_EmulateXCopyArea
-#undef XCopyPlane
-#define XCopyPlane Blt_EmulateXCopyPlane
-#undef XDrawArcs
-#define XDrawArcs Blt_EmulateXDrawArcs
-#undef XDrawLine
-#define XDrawLine Blt_EmulateXDrawLine
-#undef XDrawLines
-#define XDrawLines Blt_EmulateXDrawLines
-#undef XDrawPoints
-#define XDrawPoints Blt_EmulateXDrawPoints
-#undef XDrawRectangle
-#define XDrawRectangle Blt_EmulateXDrawRectangle
-#undef XDrawRectangles
-#define XDrawRectangles Blt_EmulateXDrawRectangles
-#undef XDrawSegments
-#define XDrawSegments Blt_EmulateXDrawSegments
-#undef XDrawString
-#define XDrawString Blt_EmulateXDrawString
-#undef XFillArcs
-#define XFillArcs Blt_EmulateXFillArcs
-#undef XFillPolygon
-#define XFillPolygon Blt_EmulateXFillPolygon
-#undef XFillRectangle
-#define XFillRectangle Blt_EmulateXFillRectangle
-#undef XFillRectangles
-#define XFillRectangles Blt_EmulateXFillRectangles
-#undef XFree
-#define XFree Blt_EmulateXFree
-#undef XGetWindowAttributes
-#define XGetWindowAttributes Blt_EmulateXGetWindowAttributes
-#undef XLowerWindow
-#define XLowerWindow Blt_EmulateXLowerWindow
-#undef XMaxRequestSize
-#define XMaxRequestSize Blt_EmulateXMaxRequestSize
-#undef XRaiseWindow
-#define XRaiseWindow Blt_EmulateXRaiseWindow
-#undef XReparentWindow
-#define XReparentWindow Blt_EmulateXReparentWindow
-#undef XSetDashes
-#define XSetDashes Blt_EmulateXSetDashes
-#undef XUnmapWindow
-#define XUnmapWindow Blt_EmulateXUnmapWindow
-#undef XWarpPointer
-#define XWarpPointer Blt_EmulateXWarpPointer
-
-BLT_EXTERN GC Blt_EmulateXCreateGC(Display *display, Drawable drawable,
- unsigned long mask, XGCValues *valuesPtr);
-BLT_EXTERN void Blt_EmulateXCopyArea(Display *display, Drawable src, Drawable dest,
- GC gc, int src_x, int src_y, unsigned int width, unsigned int height,
- int dest_x, int dest_y);
-BLT_EXTERN void Blt_EmulateXCopyPlane(Display *display, Drawable src,
- Drawable dest, GC gc, int src_x, int src_y, unsigned int width,
- unsigned int height, int dest_x, int dest_y, unsigned long plane);
-BLT_EXTERN void Blt_EmulateXDrawArcs(Display *display, Drawable drawable, GC gc,
- XArc *arcArr, int nArcs);
-BLT_EXTERN void Blt_EmulateXDrawLine(Display *display, Drawable drawable, GC gc,
- int x1, int y1, int x2, int y2);
-BLT_EXTERN void Blt_EmulateXDrawLines(Display *display, Drawable drawable, GC gc,
- XPoint *pointArr, int nPoints, int mode);
-BLT_EXTERN void Blt_EmulateXDrawPoints(Display *display, Drawable drawable, GC gc,
- XPoint *pointArr, int nPoints, int mode);
-BLT_EXTERN void Blt_EmulateXDrawRectangle(Display *display, Drawable drawable,
- GC gc, int x, int y, unsigned int width, unsigned int height);
-BLT_EXTERN void Blt_EmulateXDrawRectangles(Display *display, Drawable drawable,
- GC gc, XRectangle *rectArr, int nRects);
-BLT_EXTERN void Blt_EmulateXDrawSegments(Display *display, Drawable drawable,
- GC gc, XSegment *segArr, int nSegments);
-BLT_EXTERN void Blt_EmulateXDrawSegments(Display *display, Drawable drawable,
- GC gc, XSegment *segArr, int nSegments);
-BLT_EXTERN void Blt_EmulateXDrawString(Display *display, Drawable drawable, GC gc,
- int x, int y, _Xconst char *string, int length);
-BLT_EXTERN void Blt_EmulateXFillArcs(Display *display, Drawable drawable, GC gc,
- XArc *arcArr, int nArcs);
-BLT_EXTERN void Blt_EmulateXFillPolygon(Display *display, Drawable drawable,
- GC gc, XPoint *points, int nPoints, int shape, int mode);
-BLT_EXTERN void Blt_EmulateXFillRectangle(Display *display, Drawable drawable,
- GC gc, int x, int y, unsigned int width, unsigned int height);
-BLT_EXTERN void Blt_EmulateXFillRectangles(Display *display, Drawable drawable,
- GC gc, XRectangle *rectArr, int nRects);
-BLT_EXTERN void Blt_EmulateXFree(void *ptr);
-BLT_EXTERN int Blt_EmulateXGetWindowAttributes(Display *display, Window window,
- XWindowAttributes * attrsPtr);
-BLT_EXTERN void Blt_EmulateXLowerWindow(Display *display, Window window);
-BLT_EXTERN void Blt_EmulateXMapWindow(Display *display, Window window);
-BLT_EXTERN long Blt_EmulateXMaxRequestSize(Display *display);
-BLT_EXTERN void Blt_EmulateXRaiseWindow(Display *display, Window window);
-BLT_EXTERN void Blt_EmulateXReparentWindow(Display *display, Window window,
- Window parent, int x, int y);
-BLT_EXTERN void Blt_EmulateXSetDashes(Display *display, GC gc, int dashOffset,
- _Xconst char *dashList, int n);
-BLT_EXTERN void Blt_EmulateXUnmapWindow(Display *display, Window window);
-BLT_EXTERN void Blt_EmulateXWarpPointer(Display *display, Window srcWindow,
- Window destWindow, int srcX, int srcY, unsigned int srcWidth,
- unsigned int srcHeight, int destX, int destY);
-
-BLT_EXTERN void Blt_DrawLine2D(Display *display, Drawable drawable, GC gc,
- POINT *screenPts, int nScreenPts);
-
-BLT_EXTERN unsigned char *Blt_GetBitmapData(Display *display, Pixmap bitmap,
- int width, int height, int *pitchPtr);
-
-BLT_EXTERN HFONT Blt_CreateRotatedFont(Tk_Window tkwin, unsigned long font,
- float angle);
-
-BLT_EXTERN HPALETTE Blt_GetSystemPalette(void);
-
-BLT_EXTERN HPEN Blt_GCToPen(HDC dc, GC gc);
-
-BLT_EXTERN double hypot(double x, double y);
-BLT_EXTERN int Blt_AsyncRead(int fd, char *buffer, unsigned int size);
-BLT_EXTERN int Blt_AsyncWrite(int fd, const char *buffer, unsigned int size);
-BLT_EXTERN void Blt_CreateFileHandler(int fd, int flags,
- Tcl_FileProc * proc, ClientData clientData);
-BLT_EXTERN void Blt_DeleteFileHandler(int fd);
-BLT_EXTERN int Blt_GetPlatformId(void);
-BLT_EXTERN const char *Blt_LastError(void);
-BLT_EXTERN const char *Blt_PrintError(int error);
-
-BLT_EXTERN int Blt_GetOpenPrinter(Tcl_Interp *interp, const char *id,
- Drawable *drawablePtr);
-BLT_EXTERN int Blt_PrintDialog(Tcl_Interp *interp, Drawable *drawablePtr);
-BLT_EXTERN int Blt_OpenPrinterDoc(Tcl_Interp *interp, const char *id);
-BLT_EXTERN int Blt_ClosePrinterDoc(Tcl_Interp *interp, const char *id);
-BLT_EXTERN void Blt_GetPrinterScale(HDC dc, double *xRatio, double *yRatio);
-BLT_EXTERN int Blt_StartPrintJob(Tcl_Interp *interp, Drawable drawable);
-BLT_EXTERN int Blt_EndPrintJob(Tcl_Interp *interp, Drawable drawable);
-
-#endif /*_BLT_WIN_H*/
diff --git a/blt3.0.1/src/bltWinBitmap.c b/blt3.0.1/src/bltWinBitmap.c
deleted file mode 100644
index a6653c0..0000000
--- a/blt3.0.1/src/bltWinBitmap.c
+++ /dev/null
@@ -1,917 +0,0 @@
-
-/*
- * bltWinPainter.c --
- *
- * This module implements Win32-specific image processing procedures for the
- * BLT toolkit.
- *
- * Copyright 1997-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltBitmap.h"
-#include "bltPicture.h"
-#include "bltPictInt.h"
-#include "bltPainter.h"
-#include "bltWinPainter.h"
-#include <X11/Xutil.h>
-#include "tkDisplay.h"
-
-#define GetBit(x, y) \
- srcBits[(srcBytesPerRow * (srcHeight - y - 1)) + (x>>3)] & (0x80 >> (x&7))
-#define SetBit(x, y) \
- destBits[(destBytesPerRow * (destHeight - y - 1)) + (x>>3)] |= (0x80 >>(x&7))
-
-Pixmap
-Blt_PhotoImageMask(
- Tk_Window tkwin,
- Tk_PhotoImageBlock src)
-{
- TkWinBitmap *twdPtr;
- int offset, count;
- int x, y;
- unsigned char *srcPtr;
- int destBytesPerRow;
- int destHeight;
- unsigned char *destBits;
-
- destBytesPerRow = ((src.width + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(src.height, destBytesPerRow);
- destHeight = src.height;
-
- offset = count = 0;
-
- /* FIXME: figure out why this is so! */
- for (y = src.height - 1; y >= 0; y--) {
- srcPtr = src.pixelPtr + offset;
- for (x = 0; x < src.width; x++) {
- if (srcPtr[src.offset[3]] == 0x00) {
- SetBit(x, y);
- count++;
- }
- srcPtr += src.pixelSize;
- }
- offset += src.pitch;
- }
- if (count > 0) {
- HBITMAP hBitmap;
- BITMAP bm;
-
- bm.bmType = 0;
- bm.bmWidth = src.width;
- bm.bmHeight = src.height;
- bm.bmWidthBytes = destBytesPerRow;
- bm.bmPlanes = 1;
- bm.bmBitsPixel = 1;
- bm.bmBits = destBits;
- hBitmap = CreateBitmapIndirect(&bm);
-
- twdPtr = Blt_AssertMalloc(sizeof(TkWinBitmap));
- twdPtr->type = TWD_BITMAP;
- twdPtr->handle = hBitmap;
- twdPtr->depth = 1;
- if (Tk_WindowId(tkwin) == None) {
- twdPtr->colormap = DefaultColormap(Tk_Display(tkwin),
- DefaultScreen(Tk_Display(tkwin)));
- } else {
- twdPtr->colormap = Tk_Colormap(tkwin);
- }
- } else {
- twdPtr = NULL;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- return (Pixmap)twdPtr;
-}
-
-Pixmap
-Blt_PictureMask(
- Tk_Window tkwin,
- Blt_Picture pict)
-{
- TkWinBitmap *twdPtr;
- int count;
- int x, y;
- Blt_Pixel *sp;
- int destBytesPerRow;
- int destWidth, destHeight;
- unsigned char *destBits;
-
- destWidth = Blt_PictureWidth(pict);
- destHeight = Blt_PictureHeight(pict);
- destBytesPerRow = ((destWidth + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(destHeight, destBytesPerRow);
- count = 0;
- sp = Blt_PictureBits(pict);
- for (y = 0; y < destHeight; y++) {
- for (x = 0; x < destWidth; x++) {
- if (sp->Alpha == 0x00) {
- SetBit(x, y);
- count++;
- }
- sp++;
- }
- }
- if (count > 0) {
- HBITMAP hBitmap;
- BITMAP bm;
-
- bm.bmType = 0;
- bm.bmWidth = Blt_PictureWidth(pict);
- bm.bmHeight = Blt_PictureHeight(pict);
- bm.bmWidthBytes = destBytesPerRow;
- bm.bmPlanes = 1;
- bm.bmBitsPixel = 1;
- bm.bmBits = destBits;
- hBitmap = CreateBitmapIndirect(&bm);
-
- twdPtr = Blt_AssertMalloc(sizeof(TkWinBitmap));
- twdPtr->type = TWD_BITMAP;
- twdPtr->handle = hBitmap;
- twdPtr->depth = 1;
- if (Tk_WindowId(tkwin) == None) {
- twdPtr->colormap = DefaultColormap(Tk_Display(tkwin),
- DefaultScreen(Tk_Display(tkwin)));
- } else {
- twdPtr->colormap = Tk_Colormap(tkwin);
- }
- } else {
- twdPtr = NULL;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- return (Pixmap)twdPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RotateBitmap --
- *
- * Creates a new bitmap containing the rotated image of the given
- * bitmap. We also need a special GC of depth 1, so that we do
- * not need to rotate more than one plane of the bitmap.
- *
- * Note that under Windows, monochrome bitmaps are stored
- * bottom-to-top. This is why the right angle rotations 0/180
- * and 90/270 look reversed.
- *
- * Results:
- * Returns a new bitmap containing the rotated image.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_RotateBitmap(
- Tk_Window tkwin,
- Pixmap srcBitmap, /* Source bitmap to be rotated */
- int srcWidth,
- int srcHeight, /* Width and height of the source bitmap */
- float angle, /* Right angle rotation to perform */
- int *destWidthPtr,
- int *destHeightPtr)
-{
- Display *display; /* X display */
- Window root; /* Root window drawable */
- Pixmap destBitmap;
- double rotWidth, rotHeight;
- HDC hDC;
- TkWinDCState state;
- int x, y; /* Destination bitmap coordinates */
- int sx, sy; /* Source bitmap coordinates */
- unsigned long pixel;
- HBITMAP hBitmap;
- int result;
- struct MonoBitmap {
- BITMAPINFOHEADER bi;
- RGBQUAD colors[2];
- } mb;
- int srcBytesPerRow, destBytesPerRow;
- int destWidth, destHeight;
- unsigned char *srcBits, *destBits;
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
- Blt_GetBoundingBox(srcWidth, srcHeight, angle, &rotWidth, &rotHeight,
- (Point2d *)NULL);
-
- destWidth = (int)ceil(rotWidth);
- destHeight = (int)ceil(rotHeight);
- destBitmap = Tk_GetPixmap(display, root, destWidth, destHeight, 1);
- if (destBitmap == None) {
- return None; /* Can't allocate pixmap. */
- }
- srcBits = Blt_GetBitmapData(display, srcBitmap, srcWidth, srcHeight,
- &srcBytesPerRow);
- if (srcBits == NULL) {
- OutputDebugString("Blt_GetBitmapData failed");
- return None;
- }
- destBytesPerRow = ((destWidth + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(destHeight, destBytesPerRow);
-
- angle = FMOD(angle, 360.0);
- if (FMOD(angle, (double)90.0) == 0.0) {
- int quadrant;
-
- /* Handle right-angle rotations specially. */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- for (y = 0; y < destHeight; y++) {
- sx = y;
- for (x = 0; x < destWidth; x++) {
- sy = destWidth - x - 1;
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_180: /* 180 degrees */
- for (y = 0; y < destHeight; y++) {
- sy = destHeight - y - 1;
- for (x = 0; x < destWidth; x++) {
- sx = destWidth - x - 1;
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_90: /* 90 degrees */
- for (y = 0; y < destHeight; y++) {
- sx = destHeight - y - 1;
- for (x = 0; x < destWidth; x++) {
- sy = x;
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_0: /* 0 degrees */
- for (y = 0; y < destHeight; y++) {
- for (x = 0; x < destWidth; x++) {
- pixel = GetBit(x, y);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- default:
- /* The calling routine should never let this happen. */
- break;
- }
- } else {
- double radians, sinTheta, cosTheta;
- double srcCX, srcCY; /* Center of source rectangle */
- double destCX, destCY; /* Center of destination rectangle */
- double tx, ty;
- double rx, ry; /* Angle of rotation for x and y coordinates */
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
-
- /*
- * Coordinates of the centers of the source and destination rectangles
- */
- srcCX = srcWidth * 0.5;
- srcCY = srcHeight * 0.5;
- destCX = destWidth * 0.5;
- destCY = destHeight * 0.5;
-
- /* Rotate each pixel of dest image, placing results in source image */
-
- for (y = 0; y < destHeight; y++) {
- ty = y - destCY;
- for (x = 0; x < destWidth; x++) {
-
- /* Translate origin to center of destination image */
- tx = x - destCX;
-
- /* Rotate the coordinates about the origin */
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source image */
- rx += srcCX;
- ry += srcCY;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination image can be
- * bigger than the source
- */
-
- if ((sx >= srcWidth) || (sx < 0) || (sy >= srcHeight) ||
- (sy < 0)) {
- continue;
- }
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- }
- hBitmap = ((TkWinDrawable *)destBitmap)->bitmap.handle;
- ZeroMemory(&mb, sizeof(mb));
- mb.bi.biSize = sizeof(BITMAPINFOHEADER);
- mb.bi.biPlanes = 1;
- mb.bi.biBitCount = 1;
- mb.bi.biCompression = BI_RGB;
- mb.bi.biWidth = destWidth;
- mb.bi.biHeight = destHeight;
- mb.bi.biSizeImage = destBytesPerRow * destHeight;
- mb.colors[0].rgbBlue = mb.colors[0].rgbRed = mb.colors[0].rgbGreen = 0x0;
- mb.colors[1].rgbBlue = mb.colors[1].rgbRed = mb.colors[1].rgbGreen = 0xFF;
- hDC = TkWinGetDrawableDC(display, destBitmap, &state);
- result = SetDIBits(hDC, hBitmap, 0, destHeight, (LPVOID)destBits,
- (BITMAPINFO *)&mb, DIB_RGB_COLORS);
- TkWinReleaseDrawableDC(destBitmap, hDC, &state);
- if (!result) {
-#if WINDEBUG
- PurifyPrintf("can't setDIBits: %s\n", Blt_LastError());
-#endif
- destBitmap = None;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- if (srcBits != NULL) {
- Blt_Free(srcBits);
- }
-
- *destWidthPtr = destWidth;
- *destHeightPtr = destHeight;
- return destBitmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ScaleBitmap --
- *
- * Creates a new scaled bitmap from another bitmap.
- *
- * Results:
- * The new scaled bitmap is returned.
- *
- * Side Effects:
- * A new pixmap is allocated. The caller must release this.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_ScaleBitmap(
- Tk_Window tkwin,
- Pixmap srcBitmap,
- int srcWidth,
- int srcHeight,
- int destWidth,
- int destHeight)
-{
- TkWinDCState srcState, destState;
- HDC src, dest;
- Pixmap destBitmap;
- Window root;
- Display *display;
-
- /* Create a new bitmap the size of the region and clear it */
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
- destBitmap = Tk_GetPixmap(display, root, destWidth, destHeight, 1);
- if (destBitmap == None) {
- return None;
- }
- src = TkWinGetDrawableDC(display, srcBitmap, &srcState);
- dest = TkWinGetDrawableDC(display, destBitmap, &destState);
-
- StretchBlt(dest, 0, 0, destWidth, destHeight, src, 0, 0,
- srcWidth, srcHeight, SRCCOPY);
-
- TkWinReleaseDrawableDC(srcBitmap, src, &srcState);
- TkWinReleaseDrawableDC(destBitmap, dest, &destState);
- return destBitmap;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ScaleRotateBitmapArea --
- *
- * Creates a scaled and rotated bitmap from a given bitmap. The
- * caller also provides (offsets and dimensions) the region of
- * interest in the destination bitmap. This saves having to
- * process the entire destination bitmap is only part of it is
- * showing in the viewport.
- *
- * This uses a simple rotation/scaling of each pixel in the
- * destination image. For each pixel, the corresponding
- * pixel in the source bitmap is used. This means that
- * destination coordinates are first scaled to the size of
- * the rotated source bitmap. These coordinates are then
- * rotated back to their original orientation in the source.
- *
- * Results:
- * The new rotated and scaled bitmap is returned.
- *
- * Side Effects:
- * A new pixmap is allocated. The caller must release this.
- *
- *---------------------------------------------------------------------------
- */
-Pixmap
-Blt_ScaleRotateBitmapArea(
- Tk_Window tkwin,
- Pixmap srcBitmap, /* Source bitmap. */
- unsigned int srcWidth,
- unsigned int srcHeight, /* Size of source bitmap */
- int regionX,
- int regionY, /* Offset of region in virtual
- * destination bitmap. */
- unsigned int regionWidth,
- unsigned int regionHeight, /* Desire size of bitmap region. */
- unsigned int virtWidth,
- unsigned int virtHeight, /* Virtual size of destination bitmap. */
- float angle) /* Angle to rotate bitmap. */
-{
- Display *display; /* X display */
- Pixmap destBitmap;
- Window root; /* Root window drawable */
- double rWidth, rHeight;
- double xScale, yScale;
- int srcBytesPerRow, destBytesPerRow;
- int destHeight;
- int result;
- unsigned char *srcBits, *destBits;
-
- display = Tk_Display(tkwin);
- root = Tk_RootWindow(tkwin);
-
- /* Create a bitmap and image big enough to contain the rotated text */
- destBitmap = Tk_GetPixmap(display, root, regionWidth, regionHeight, 1);
- if (destBitmap == None) {
- return None; /* Can't allocate pixmap. */
- }
- srcBits = Blt_GetBitmapData(display, srcBitmap, srcWidth, srcHeight,
- &srcBytesPerRow);
- if (srcBits == NULL) {
- OutputDebugString("Blt_GetBitmapData failed");
- return None;
- }
- destBytesPerRow = ((regionWidth + 31) & ~31) / 8;
- destBits = Blt_AssertCalloc(regionHeight, destBytesPerRow);
- destHeight = regionHeight;
-
- angle = FMOD(angle, 360.0);
- Blt_GetBoundingBox(srcWidth, srcHeight, angle, &rWidth, &rHeight,
- (Point2d *)NULL);
- xScale = rWidth / (double)virtWidth;
- yScale = rHeight / (double)virtHeight;
-
- if (FMOD(angle, (double)90.0) == 0.0) {
- int quadrant;
- int y;
-
- /* Handle right-angle rotations specifically */
-
- quadrant = (int)(angle / 90.0);
- switch (quadrant) {
- case ROTATE_270: /* 270 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sx, x;
-
- sx = (int)(yScale * (double)(y+regionY));
- for (x = 0; x < (int)regionWidth; x++) {
- unsigned long pixel;
- int sy;
-
- sy = (int)(xScale *(double)(virtWidth - (x+regionX) - 1));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_180: /* 180 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sy, x;
-
- sy = (int)(yScale * (double)(virtHeight - (y + regionY) - 1));
- for (x = 0; x < (int)regionWidth; x++) {
- unsigned long pixel;
- int sx;
-
- sx = (int)(xScale *(double)(virtWidth - (x+regionX) - 1));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_90: /* 90 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sx, x;
-
- sx = (int)(yScale * (double)(virtHeight - (y + regionY) - 1));
- for (x = 0; x < (int)regionWidth; x++) {
- int sy;
- unsigned long pixel;
-
- sy = (int)(xScale * (double)(x + regionX));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- case ROTATE_0: /* 0 degrees */
- for (y = 0; y < (int)regionHeight; y++) {
- int sy, x;
-
- sy = (int)(yScale * (double)(y + regionY));
- for (x = 0; x < (int)regionWidth; x++) {
- int sx;
- unsigned long pixel;
-
- sx = (int)(xScale * (double)(x + regionX));
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- break;
-
- default:
- /* The calling routine should never let this happen. */
- break;
- }
- } else {
- double radians, sinTheta, cosTheta;
- double scx, scy; /* Offset from the center of the
- * source rectangle. */
- double rcx, rcy; /* Offset to the center of the
- * rotated rectangle. */
- int y;
-
- radians = (angle / 180.0) * M_PI;
- sinTheta = sin(radians), cosTheta = cos(radians);
-
- /*
- * Coordinates of the centers of the source and destination rectangles
- */
- scx = srcWidth * 0.5;
- scy = srcHeight * 0.5;
- rcx = rWidth * 0.5;
- rcy = rHeight * 0.5;
-
- /* For each pixel of the destination image, transform back to the
- * associated pixel in the source image. */
-
- for (y = 0; y < (int)regionHeight; y++) {
- int x;
- double ty; /* Translated coordinates from center */
-
- ty = (yScale * (double)(y + regionY)) - rcy;
- for (x = 0; x < (int)regionWidth; x++) {
- double rx, ry; /* Angle of rotation for x and y coordinates */
- double tx; /* Translated coordinates from center */
- int sx, sy;
- unsigned long pixel;
-
- /* Translate origin to center of destination image. */
- tx = (xScale * (double)(x + regionX)) - rcx;
-
- /* Rotate the coordinates about the origin. */
- rx = (tx * cosTheta) - (ty * sinTheta);
- ry = (tx * sinTheta) + (ty * cosTheta);
-
- /* Translate back to the center of the source image. */
- rx += scx;
- ry += scy;
-
- sx = ROUND(rx);
- sy = ROUND(ry);
-
- /*
- * Verify the coordinates, since the destination image can be
- * bigger than the source.
- */
-
- if ((sx >= (int)srcWidth) || (sx < 0) ||
- (sy >= (int)srcHeight) || (sy < 0)) {
- continue;
- }
- pixel = GetBit(sx, sy);
- if (pixel) {
- SetBit(x, y);
- }
- }
- }
- }
- {
- HBITMAP hBitmap;
- HDC hDC;
- TkWinDCState state;
- struct MonoBitmap {
- BITMAPINFOHEADER bmiHeader;
- RGBQUAD colors[2];
- } mb;
-
- /* Write the rotated image into the destination bitmap. */
- hBitmap = ((TkWinDrawable *)destBitmap)->bitmap.handle;
- ZeroMemory(&mb, sizeof(mb));
- mb.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- mb.bmiHeader.biPlanes = 1;
- mb.bmiHeader.biBitCount = 1;
- mb.bmiHeader.biCompression = BI_RGB;
- mb.bmiHeader.biWidth = regionWidth;
- mb.bmiHeader.biHeight = regionHeight;
- mb.bmiHeader.biSizeImage = destBytesPerRow * regionHeight;
- mb.colors[0].rgbBlue = mb.colors[0].rgbRed = mb.colors[0].rgbGreen =
- 0x0;
- mb.colors[1].rgbBlue = mb.colors[1].rgbRed = mb.colors[1].rgbGreen =
- 0xFF;
- hDC = TkWinGetDrawableDC(display, destBitmap, &state);
- result = SetDIBits(hDC, hBitmap, 0, regionHeight, (LPVOID)destBits,
- (BITMAPINFO *)&mb, DIB_RGB_COLORS);
- TkWinReleaseDrawableDC(destBitmap, hDC, &state);
- }
- if (!result) {
-#if WINDEBUG
- PurifyPrintf("can't setDIBits: %s\n", Blt_LastError());
-#endif
- destBitmap = None;
- }
- if (destBits != NULL) {
- Blt_Free(destBits);
- }
- if (srcBits != NULL) {
- Blt_Free(srcBits);
- }
- return destBitmap;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PaintPictureWithBlend --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and
- * converts it to a picture.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred,
- * NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_PaintPictureWithBlend(
- Blt_Painter painter,
- Drawable drawable,
- int width, int height, /* Dimension of the drawable. */
- Region2d *regionPtr) /* Area to be snapped. */
-{
- void *data;
- BITMAPINFO bmi;
- DIBSECTION ds;
- HBITMAP hBitmap, oldBitmap;
- HDC memDC;
- unsigned char *bits;
- unsigned char *srcPtr;
- HDC hDC;
- TkWinDCState state;
- Blt_Pixel *destRowPtr;
- Pict *destPtr;
- int x, y;
-
- if (regionPtr == NULL) {
- regionPtr = Blt_SetRegion(0, 0, PictureWidth(pict),
- PictureHeight(pict), ®ion);
- }
- if (regionPtr->left < 0) {
- regionPtr->left = 0;
- }
- if (regionPtr->right >= destWidth) {
- regionPtr->right = destWidth - 1;
- }
- if (regionPtr->top < 0) {
- regionPtr->top = 0;
- }
- if (regionPtr->bottom >= destHeight) {
- regionPtr->bottom = destHeight - 1;
- }
- width = RegionWidth(regionPtr);
- height = RegionHeight(regionPtr);
-
- hDC = TkWinGetDrawableDC(display, drawable, &state);
-
- /* Create the intermediate drawing surface at window resolution. */
- ZeroMemory(&bmi, sizeof(bmi));
- bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bmi.bmiHeader.biWidth = width;
- bmi.bmiHeader.biHeight = height;
- bmi.bmiHeader.biPlanes = 1;
- bmi.bmiHeader.biBitCount = 32;
- bmi.bmiHeader.biCompression = BI_RGB;
- hBitmap = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &data, NULL, 0);
- memDC = CreateCompatibleDC(hDC);
- oldBitmap = SelectBitmap(memDC, hBitmap);
-
-#ifdef notdef
- if (GetDeviceCaps(hDC, RASTERCAPS) & RC_PALETTE) {
- TkWinColormap *cmap;
-
- cmap = (TkWinColormap *)painterPtr->colormap;
- SelectPalette(hDC, cmap->palette, FALSE);
- RealizePalette(hDC);
- SelectPalette(memDC, cmap->palette, FALSE);
- RealizePalette(memDC);
- }
-#endif
- pict = NULL;
- /* Copy the window contents to the memory surface. */
- if (!BitBlt(memDC, 0, 0, width, height, hDC, regionPtr->left,
- regionPtr->top, SRCCOPY)) {
-#ifdef notdef
- PurifyPrintf("can't blit: %s\n", Blt_LastError());
-#endif
- goto done;
- }
- if (GetObject(hBitmap, sizeof(DIBSECTION), &ds) == 0) {
-#ifdef notdef
- PurifyPrintf("can't get object: %s\n", Blt_LastError());
-#endif
- goto done;
- }
- bits = (unsigned char *)ds.dsBm.bmBits;
- destPtr = Blt_CreatePicture(width, height);
- destRowPtr = destPtr->bits;
-
- /*
- * Copy the DIB RGB data into the picture. The DIB scanlines
- * are stored bottom-to-top and the order of the RGBA color
- * components is BGRA. Who says Win32 GDI programming isn't
- * backwards?
- */
- for (y = height - 1; y >= 0; y--) {
- unsigned char *sp;
- Blt_Pixel *dp;
-
- sp = bits + (y * ds.dsBm.bmWidthBytes);
- dp = destRowPtr;
- for (dp = destRowPtr, dend = dp + destPtr->width; dp < dend, dp++) {
- if (dp->Alpha > 0) {
- /* Blend picture with background. */
- dp->Blue = *sp++;
- dp->Green = *sp++;
- dp->Red = *sp++;
- dp->Alpha = ALPHA_OPAQUE;
- sp++;
- }
- }
- destRowPtr += destPtr->pixelsPerRow;
- }
- done:
- DeleteBitmap(SelectBitmap(memDC, oldBitmap));
- DeleteDC(memDC);
- TkWinReleaseDrawableDC(drawable, hDC, &state);
- return pict;
-}
-#endif
-
-#ifdef HAVE_IJL_H
-
-#include <ijl.h>
-
-Blt_Picture
-Blt_JPEGToPicture(interp, fileName)
- Tcl_Interp *interp;
- char *fileName;
-{
- JPEG_CORE_PROPERTIES jpgProps;
- Blt_Picture pict;
-
- ZeroMemory(&jpgProps, sizeof(JPEG_CORE_PROPERTIES));
- if(ijlInit(&jpgProps) != IJL_OK) {
- Tcl_AppendResult(interp, "can't initialize Intel JPEG library",
- (char *)NULL);
- return NULL;
- }
- jpgProps.JPGFile = fileName;
- if (ijlRead(&jpgProps, IJL_JFILE_READPARAMS) != IJL_OK) {
- Tcl_AppendResult(interp, "can't read JPEG file header from \"",
- fileName, "\" file.", (char *)NULL);
- goto error;
- }
-
- // !dudnik: to fix bug case 584680, [OT:287A305B]
- // Set the JPG color space ... this will always be
- // somewhat of an educated guess at best because JPEG
- // is "color blind" (i.e., nothing in the bit stream
- // tells you what color space the data was encoded from).
- // However, in this example we assume that we are
- // reading JFIF files which means that 3 channel images
- // are in the YCbCr color space and 1 channel images are
- // in the Y color space.
- switch(jpgProps.JPGChannels) {
- case 1:
- jpgProps.JPGColor = IJL_G;
- jpgProps.DIBChannels = 4;
- jpgProps.DIBColor = IJL_RGBA_FPX;
- break;
-
- case 3:
- jpgProps.JPGColor = IJL_YCBCR;
- jpgProps.DIBChannels = 4;
- jpgProps.DIBColor = IJL_RGBA_FPX;
- break;
-
- case 4:
- jpgProps.JPGColor = IJL_YCBCRA_FPX;
- jpgProps.DIBChannels = 4;
- jpgProps.DIBColor = IJL_RGBA_FPX;
- break;
-
- default:
- /* This catches everything else, but no color twist will be
- performed by the IJL. */
- jpgProps.DIBColor = (IJL_COLOR)IJL_OTHER;
- jpgProps.JPGColor = (IJL_COLOR)IJL_OTHER;
- jpgProps.DIBChannels = jpgProps.JPGChannels;
- break;
- }
-
- jpgProps.DIBWidth = jpgProps.JPGWidth;
- jpgProps.DIBHeight = jpgProps.JPGHeight;
- jpgProps.DIBPadBytes = IJL_DIB_PAD_BYTES(jpgProps.DIBWidth,
- jpgProps.DIBChannels);
-
- pict = Blt_CreatePicture(jpgProps.JPGWidth, jpgProps.JPGHeight);
-
- jpgProps.DIBBytes = (BYTE *)Blt_PictureBits(pict);
- if (ijlRead(&jpgProps, IJL_JFILE_READWHOLEIMAGE) != IJL_OK) {
- Tcl_AppendResult(interp, "can't read image data from \"", fileName,
- "\"", (char *)NULL);
- goto error;
- }
- if (ijlFree(&jpgProps) != IJL_OK) {
- Tcl_AppendResult(interp, "can't free Intel(R) JPEG library.",
- (char *)NULL);
- }
- return pict;
-
- error:
- ijlFree(&jpgProps);
- if (pict != NULL) {
- Blt_FreePicture(pict);
- }
- ijlFree(&jpgProps);
- return NULL;
-}
-
-#endif /* HAVE_IJL_H */
diff --git a/blt3.0.1/src/bltWinConfig.h b/blt3.0.1/src/bltWinConfig.h
deleted file mode 100644
index 2a02fdb..0000000
--- a/blt3.0.1/src/bltWinConfig.h
+++ /dev/null
@@ -1,144 +0,0 @@
-#ifndef _BLT_WIN_CONFIG_H
-#define _BLT_WIN_CONFIG_H
-/* src/bltConfig.h. Generated automatically by configure. */
-/* src/bltConfig.h.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-#define pid_t int
-#endif /* _MSC_VER || __BORLANDC__ */
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define if your processor stores words with the most significant
- byte first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
-
-/* Define if DBL_EPSILON is not defined in float.h */
-#undef BLT_DBL_EPSILON
-
-/* Define if drand48 is declared in math.h. */
-#define HAVE_DECL_DRAND48 0
-
-/* Define if srand48 is declared in math.h. */
-#define HAVE_DECL_SRAND48 0
-
-/* Define if j1 is declared in a standard header file. */
-#define HAVE_DECL_J1 0
-
-/* Define if union wait type is defined incorrectly. */
-#undef HAVE_UNION_WAIT
-
-/* Define if isfinite is found in libm. */
-#undef HAVE_ISFINITE
-
-/* The number of bytes in a long. */
-#define SIZEOF_LONG 4
-
-/* The number of bytes in a long long. */
-#define SIZEOF_LONG_LONG 8
-
-/* The number of bytes in a void *. */
-#define SIZEOF_VOID_P 4
-
-/* Define if you have the XExtendedMaxRequestSize function. */
-#undef HAVE_XEXTENDEDMAXREQUESTSIZE
-
-/* Define if you have the drand48 function. */
-#define HAVE_DRAND48 1
-
-/* Define if you have the finite function. */
-#undef HAVE_FINITE
-
-/* Define if you have the srand48 function. */
-#define HAVE_SRAND48 1
-
-/* Define if you have the strdup function. */
-#define HAVE_STRDUP 1
-
-#ifndef __BORLANDC__
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strncasecmp function. */
-#define HAVE_STRNCASECMP 1
-#endif
-
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
-
-/* Define if you have the <float.h> header file. */
-#define HAVE_FLOAT_H 1
-
-/* Define if you have the <ieeefp.h> header file. */
-#undef HAVE_IEEEFP_H
-
-/* Define if you have the <jpeglib.h> header file. */
-/* Defined in Makefile */
-/* #undef HAVE_JPEGLIB_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <malloc.h> header file. */
-#define HAVE_MALLOC_H 1
-
-/* Define if you have the <math.h> header file. */
-#define HAVE_MATH_H 1
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <setjmp.h> header file. */
-#define HAVE_SETJMP_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define if you have the <waitflags.h> header file. */
-#undef HAVE_WAITFLAGS_H
-
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define if you have the nsl library (-lnsl). */
-#undef HAVE_LIBNSL
-
-/* Define if you have the socket library (-lsocket). */
-#undef HAVE_LIBSOCKET
-
-
-#if (_MSC_VER == 1400)
-#define HAVE_SPRINTF_S
-#endif
-
-#define WIN32 1
-#endif _BLT_WIN_CONFIG_H
diff --git a/blt3.0.1/src/bltWinDde.c b/blt3.0.1/src/bltWinDde.c
deleted file mode 100644
index 6c1b1d9..0000000
--- a/blt3.0.1/src/bltWinDde.c
+++ /dev/null
@@ -1,1350 +0,0 @@
-
-/*
- * bltWinDde.c --
- *
- * This file provides procedures that implement the "send" command,
- * allowing commands to be passed from interpreter to interpreter.
- *
- * Copyright 1994-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This was copied from tclWinDde.c of the TCL library distribution.
- *
- * Copyright (c) 1997 by Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and
- * redistribution of this file, and for a DISCLAIMER OF ALL
- * WARRANTIES.
- *
- */
-
-#include "bltInt.h"
-
-#ifndef NO_DDE
-
-#include <ddeml.h>
-
-/*
- * The following structure is used to keep track of the interpreters
- * registered by this process.
- */
-
-typedef struct RegisteredInterp {
- struct RegisteredInterp *nextPtr;
- /* The next interp this application knows
- * about. */
- Tcl_Interp *interp; /* The interpreter attached to this name. */
- char name[1]; /* Interpreter's name. Malloc-ed as
- * part of the structure. */
-} RegisteredInterp;
-
-/*
- * Used to keep track of conversations.
- */
-
-typedef struct Conversation {
- struct Conversation *nextPtr;
- /* The next conversation in the list. */
- RegisteredInterp *riPtr; /* The info we know about the conversation. */
- HCONV hConv; /* The DDE handle for this conversation. */
- Tcl_Obj *returnPackagePtr; /* The result package for this conversation. */
-
-} Conversation;
-
-static Conversation *conversations; /* A list of conversations currently
- * being processed. */
-static RegisteredInterp *interps; /* List of all interpreters registered
- * in the current process. */
-static HSZ globalService;
-static DWORD instance; /* The application instance handle given
- * to us by DdeInitialize. */
-static int isServer;
-
-#define TCL_DDE_VERSION "1.2"
-#define TCL_DDE_PACKAGE_NAME "dde"
-#define TCL_DDE_SERVICE_NAME "TclEval"
-
-/*
- * Forward declarations for procedures defined later in this file.
- */
-
-static Tcl_Obj *ExecuteRemoteObject(Tcl_Interp *interp, Tcl_Obj *objPtr);
-static int MakeConnection(Tcl_Interp *interp, const char *name, HCONV *convPtr);
-static HDDEDATA CALLBACK ServerProc(UINT uType, UINT uFmt, HCONV hConv,
- HSZ topic, HSZ item, HDDEDATA hData, DWORD dwData1, DWORD dwData2);
-
-static Tcl_ExitProc ExitProc;
-static Tcl_CmdDeleteProc DeleteProc;
-static void SetError(Tcl_Interp *interp);
-
-static Tcl_ObjCmdProc DdeObjCmd;
-
-/*
- *---------------------------------------------------------------------------
- *
- * Initialize --
- *
- * Initialize the global DDE instance.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Registers the DDE server proc.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-Initialize(void)
-{
- int nameFound = 0;
-
- /*
- * See if the application is already registered; if so, remove its
- * current name from the registry. The deletion of the command
- * will take care of disposing of this entry.
- */
-
- if (interps != NULL) {
- nameFound = 1;
- }
-
- /*
- * Make sure that the DDE server is there. This is done only once,
- * add an exit handler tear it down.
- */
-
- if (instance == 0) {
- if (instance == 0) {
- unsigned int flags;
-
- flags = (CBF_SKIP_REGISTRATIONS | CBF_SKIP_UNREGISTRATIONS |
- CBF_FAIL_POKES);
- if (DdeInitialize(&instance, ServerProc, flags, 0)
- != DMLERR_NO_ERROR) {
- instance = 0;
- }
- }
- }
- if ((globalService == 0) && (nameFound != 0)) {
- if ((globalService == 0) && (nameFound != 0)) {
- isServer = TRUE;
- Tcl_CreateExitHandler(ExitProc, NULL);
- globalService = DdeCreateStringHandle(instance,
- TCL_DDE_SERVICE_NAME, 0);
- DdeNameService(instance, globalService, 0L, DNS_REGISTER);
- } else {
- isServer = FALSE;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetServerName --
- *
- * This procedure is called to associate an ASCII name with a Dde
- * server. If the interpreter has already been named, the
- * name replaces the old one.
- *
- * Results:
- * The return value is the name actually given to the interp.
- * This will normally be the same as name, but if name was already
- * in use for a Dde Server then a name of the form "name #2" will
- * be chosen, with a high enough number to make the name unique.
- *
- * Side effects:
- * Registration info is saved, thereby allowing the "send" command
- * to be used later to invoke commands in the application. In
- * addition, the "send" command is created in the application's
- * interpreter. The registration will be removed automatically
- * if the interpreter is deleted or the "send" command is removed.
- *
- *---------------------------------------------------------------------------
- */
-
-static const char *
-SetServerName(
- Tcl_Interp *interp,
- const char *name) /* The name that will be used to
- * refer to the interpreter in later
- * "send" commands. Must be globally
- * unique. */
-{
- int suffix, offset;
- RegisteredInterp *riPtr, *prevPtr;
- Tcl_DString dString;
-
- /*
- * See if the application is already registered; if so, remove its
- * current name from the registry. The deletion of the command
- * will take care of disposing of this entry.
- */
-
- for (riPtr = interps, prevPtr = NULL; riPtr != NULL;
- prevPtr = riPtr, riPtr = riPtr->nextPtr) {
- if (riPtr->interp == interp) {
- if (name != NULL) {
- if (prevPtr == NULL) {
- interps = interps->nextPtr;
- } else {
- prevPtr->nextPtr = riPtr->nextPtr;
- }
- break;
- } else {
- /*
- * the name was NULL, so the caller is asking for
- * the name of the current interp.
- */
-
- return riPtr->name;
- }
- }
- }
-
- if (name == NULL) {
- /*
- * the name was NULL, so the caller is asking for
- * the name of the current interp, but it doesn't
- * have a name.
- */
-
- return "";
- }
-
- /*
- * Pick a name to use for the application. Use "name" if it's not
- * already in use. Otherwise add a suffix such as " #2", trying
- * larger and larger numbers until we eventually find one that is
- * unique.
- */
-
- suffix = 1;
- offset = 0;
- Tcl_DStringInit(&dString);
-
- /*
- * We have found a unique name. Now add it to the registry.
- */
-
- riPtr = Blt_AssertMalloc(sizeof(RegisteredInterp) + strlen(name));
- riPtr->interp = interp;
- riPtr->nextPtr = interps;
- interps = riPtr;
- strcpy(riPtr->name, name);
-
- Tcl_CreateObjCommand(interp, "dde", DdeObjCmd, riPtr, DeleteProc);
- if (Tcl_IsSafe(interp)) {
- Tcl_HideCommand(interp, "dde", "dde");
- }
- Tcl_DStringFree(&dString);
-
- /*
- * re-initialize with the new name
- */
- Initialize();
-
- return riPtr->name;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DeleteProc
- *
- * This procedure is called when the command "dde" is destroyed.
- *
- * Results:
- * none
- *
- * Side effects:
- * The interpreter given by riPtr is unregistered.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-DeleteProc(clientData)
- ClientData clientData; /* The interp we are deleting passed
- * as ClientData. */
-{
- RegisteredInterp *riPtr = clientData;
- RegisteredInterp *searchPtr, *prevPtr;
-
- for (searchPtr = interps, prevPtr = NULL;
- (searchPtr != NULL) && (searchPtr != riPtr);
- prevPtr = searchPtr, searchPtr = searchPtr->nextPtr) {
- /*
- * Empty loop body.
- */
- }
-
- if (searchPtr != NULL) {
- if (prevPtr == NULL) {
- interps = interps->nextPtr;
- } else {
- prevPtr->nextPtr = searchPtr->nextPtr;
- }
- }
- Tcl_EventuallyFree(clientData, TCL_DYNAMIC);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExecuteRemoteObject --
- *
- * Takes the package delivered by DDE and executes it in
- * the server's interpreter.
- *
- * Results:
- * A list Tcl_Obj * that describes what happened. The first
- * element is the numerical return code (TCL_ERROR, etc.).
- * The second element is the result of the script. If the
- * return result was TCL_ERROR, then the third element
- * will be the value of the global "errorCode", and the
- * fourth will be the value of the global "errorInfo".
- * The return result will have a refCount of 0.
- *
- * Side effects:
- * A TCL script is run, which can cause all kinds of other
- * things to happen.
- *
- *---------------------------------------------------------------------------
- */
-
-static Tcl_Obj *
-ExecuteRemoteObject(
- Tcl_Interp *interp, /* Remote interpreter. */
- Tcl_Obj *objPtr) /* The object to execute. */
-{
- Tcl_Obj *listObjPtr;
- int result;
-
- result = Tcl_GlobalEval(interp, Tcl_GetString(objPtr));
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- Tcl_ListObjAppendElement(NULL, listObjPtr, Tcl_NewIntObj(result));
- Tcl_ListObjAppendElement(NULL, listObjPtr, Tcl_GetObjResult(interp));
- if (result == TCL_ERROR) {
- const char *value;
- Tcl_Obj *objPtr;
-
- value = Tcl_GetVar2(interp, "errorCode", NULL, TCL_GLOBAL_ONLY);
- objPtr = Tcl_NewStringObj(value, -1);
- Tcl_ListObjAppendElement(NULL, listObjPtr, objPtr);
- value = Tcl_GetVar2(interp, "errorInfo", NULL, TCL_GLOBAL_ONLY);
- objPtr = Tcl_NewStringObj(value, -1);
- Tcl_ListObjAppendElement(NULL, listObjPtr, objPtr);
- }
- return listObjPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ServerProc --
- *
- * Handles all transactions for this server. Can handle
- * execute, request, and connect protocols. Dde will
- * call this routine when a client attempts to run a dde
- * command using this server.
- *
- * Results:
- * A DDE Handle with the result of the dde command.
- *
- * Side effects:
- * Depending on which command is executed, arbitrary
- * Tcl scripts can be run.
- *
- *---------------------------------------------------------------------------
- */
-
-static HDDEDATA CALLBACK
-ServerProc (
- UINT uType, /* The type of DDE transaction we
- * are performing. */
- UINT uFmt, /* The format that data is sent or
- * received. */
- HCONV hConv, /* The conversation associated with the
- * current transaction. */
- HSZ topic, /* A string handle. Transaction-type
- * dependent. */
- HSZ item, /* A string handle. Transaction-type
- * dependent. */
- HDDEDATA hData, /* DDE data. Transaction-type dependent. */
- DWORD dwData1, /* Transaction-dependent data. */
- DWORD dwData2) /* Transaction-dependent data. */
-{
- Tcl_DString dString;
- char *utilString;
- Tcl_Obj *objPtr;
- HDDEDATA code = NULL;
- RegisteredInterp *riPtr;
- Conversation *convPtr, *prevConvPtr;
-
- switch(uType) {
- case XTYP_CONNECT:
- {
- int length;
-
- /*
- * Dde is trying to initialize a conversation with us. Check
- * and make sure we have a valid topic.
- */
-
- length = DdeQueryString(instance, topic, NULL, 0, 0);
- Tcl_DStringInit(&dString);
- Tcl_DStringSetLength(&dString, length);
- utilString = Tcl_DStringValue(&dString);
- DdeQueryString(instance, topic, utilString, length + 1,
- CP_WINANSI);
-
- for (riPtr = interps; riPtr != NULL; riPtr = riPtr->nextPtr) {
- if (strcasecmp(utilString, riPtr->name) == 0) {
- Tcl_DStringFree(&dString);
- return (HDDEDATA) TRUE;
- }
- }
-
- Tcl_DStringFree(&dString);
- return (HDDEDATA) FALSE;
- }
- case XTYP_CONNECT_CONFIRM:
- {
- DWORD length;
-
- /*
- * Dde has decided that we can connect, so it gives us a
- * conversation handle. We need to keep track of it
- * so we know which execution result to return in an
- * XTYP_REQUEST.
- */
-
- length = DdeQueryString(instance, topic, NULL, 0, 0);
- Tcl_DStringInit(&dString);
- Tcl_DStringSetLength(&dString, length);
- utilString = Tcl_DStringValue(&dString);
- DdeQueryString(instance, topic, utilString, length + 1,
- CP_WINANSI);
- for (riPtr = interps; riPtr != NULL; riPtr = riPtr->nextPtr) {
- if (strcasecmp(riPtr->name, utilString) == 0) {
- convPtr = Blt_AssertMalloc(sizeof(Conversation));
- convPtr->nextPtr = conversations;
- convPtr->returnPackagePtr = NULL;
- convPtr->hConv = hConv;
- convPtr->riPtr = riPtr;
- conversations = convPtr;
- break;
- }
- }
- Tcl_DStringFree(&dString);
- return (HDDEDATA) TRUE;
- }
- case XTYP_DISCONNECT:
- {
- /*
- * The client has disconnected from our server. Forget this
- * conversation.
- */
-
- for (convPtr = conversations, prevConvPtr = NULL;
- convPtr != NULL;
- prevConvPtr = convPtr, convPtr = convPtr->nextPtr) {
- if (hConv == convPtr->hConv) {
- if (prevConvPtr == NULL) {
- conversations = convPtr->nextPtr;
- } else {
- prevConvPtr->nextPtr = convPtr->nextPtr;
- }
- if (convPtr->returnPackagePtr != NULL) {
- Tcl_DecrRefCount(convPtr->returnPackagePtr);
- }
- Blt_Free(convPtr);
- break;
- }
- }
- return (HDDEDATA) TRUE;
- }
- case XTYP_REQUEST:
- {
- int length;
-
- /*
- * This could be either a request for a value of a TCL variable,
- * or it could be the send command requesting the results of the
- * last execute.
- */
-
- if (uFmt != CF_TEXT) {
- return (HDDEDATA) FALSE;
- }
-
- code = (HDDEDATA) FALSE;
- for (convPtr = conversations; (convPtr != NULL)
- && (convPtr->hConv != hConv); convPtr = convPtr->nextPtr) {
- /*
- * Empty loop body.
- */
- }
-
- if (convPtr != NULL) {
- length = DdeQueryString(instance, item, NULL, 0, CP_WINANSI);
- Tcl_DStringInit(&dString);
- Tcl_DStringSetLength(&dString, length);
- utilString = Tcl_DStringValue(&dString);
- DdeQueryString(instance, item, utilString, length + 1,
- CP_WINANSI);
- if (strcasecmp(utilString, "$TCLEVAL$EXECUTE$RESULT") == 0) {
- const char *value;
-
- value = Tcl_GetStringFromObj(convPtr->returnPackagePtr,
- &length);
- code = DdeCreateDataHandle(instance, (char *)value,
- length+1, 0, item, CF_TEXT, 0);
- } else {
- const char *value;
-
- value = Tcl_GetVar2(convPtr->riPtr->interp, utilString,
- NULL, TCL_GLOBAL_ONLY);
- if (value != NULL) {
- length = strlen(value);
- code = DdeCreateDataHandle(instance, (char *)value,
- length+1, 0, item, CF_TEXT, 0);
- } else {
- code = NULL;
- }
- }
- Tcl_DStringFree(&dString);
- }
- return code;
- }
- case XTYP_EXECUTE:
- {
- DWORD length;
- /*
- * Execute this script. The results will be saved into
- * a list object which will be retreived later. See
- * ExecuteRemoteObject.
- */
-
- Tcl_Obj *returnPackagePtr;
-
- for (convPtr = conversations; (convPtr != NULL)
- && (convPtr->hConv != hConv); convPtr = convPtr->nextPtr) {
- /*
- * Empty loop body.
- */
-
- }
-
- if (convPtr == NULL) {
- return (HDDEDATA) DDE_FNOTPROCESSED;
- }
-
- utilString = (char *) DdeAccessData(hData, &length);
- objPtr = Tcl_NewStringObj(utilString, -1);
- Tcl_IncrRefCount(objPtr);
- DdeUnaccessData(hData);
- if (convPtr->returnPackagePtr != NULL) {
- Tcl_DecrRefCount(convPtr->returnPackagePtr);
- }
- convPtr->returnPackagePtr = NULL;
- returnPackagePtr = ExecuteRemoteObject(convPtr->riPtr->interp,
- objPtr);
- for (convPtr = conversations; (convPtr != NULL)
- && (convPtr->hConv != hConv); convPtr = convPtr->nextPtr) {
- /*
- * Empty loop body.
- */
-
- }
- if (convPtr != NULL) {
- Tcl_IncrRefCount(returnPackagePtr);
- convPtr->returnPackagePtr = returnPackagePtr;
- }
- Tcl_DecrRefCount(objPtr);
- if (returnPackagePtr == NULL) {
- return (HDDEDATA) DDE_FNOTPROCESSED;
- } else {
- return (HDDEDATA) DDE_FACK;
- }
- }
- case XTYP_WILDCONNECT:
- {
- DWORD length;
-
- /*
- * Dde wants a list of services and topics that we support.
- */
-
- HSZPAIR *returnPtr;
- int i;
- int numItems;
-
- for (i = 0, riPtr = interps; riPtr != NULL;
- i++, riPtr = riPtr->nextPtr) {
- /*
- * Empty loop body.
- */
-
- }
-
- numItems = i;
- code = DdeCreateDataHandle(instance, NULL,
- (numItems + 1) * sizeof(HSZPAIR), 0, 0, 0, 0);
- returnPtr = (HSZPAIR *) DdeAccessData(code, &length);
- for (i = 0, riPtr = interps; i < numItems;
- i++, riPtr = riPtr->nextPtr) {
- returnPtr[i].hszSvc = DdeCreateStringHandle(
- instance, "TclEval", CP_WINANSI);
- returnPtr[i].hszTopic = DdeCreateStringHandle(
- instance, riPtr->name, CP_WINANSI);
- }
- returnPtr[i].hszSvc = NULL;
- returnPtr[i].hszTopic = NULL;
- DdeUnaccessData(code);
- return code;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ExitProc --
- *
- * Gets rid of our DDE server when we go away.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The DDE server is deleted.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-ExitProc(
- ClientData clientData) /* Not used in this handler. */
-{
- DdeNameService(instance, NULL, 0, DNS_UNREGISTER);
- DdeUninitialize(instance);
- instance = 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MakeConnection --
- *
- * This procedure is a utility used to connect to a DDE
- * server when given a server name and a topic name.
- *
- * Results:
- * A standard TCL result.
- *
- *
- * Side effects:
- * Passes back a conversation through ddeConvPtr
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-MakeConnection(
- Tcl_Interp *interp, /* Used to report errors. */
- const char *name, /* The connection to use. */
- HCONV *convPtr)
-{
- HSZ topic, service;
- HCONV conv;
-
- service = DdeCreateStringHandle(instance, "TclEval", 0);
- topic = DdeCreateStringHandle(instance, name, 0);
-
- conv = DdeConnect(instance, service, topic, NULL);
- DdeFreeStringHandle(instance, service);
- DdeFreeStringHandle(instance, topic);
-
- if (conv == NULL) {
- if (interp != NULL) {
- Tcl_AppendResult(interp, "no registered server named \"", name,
- "\"", (char *) NULL);
- }
- return TCL_ERROR;
- }
-
- *convPtr = conv;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetError --
- *
- * Sets the interp result to a cogent error message
- * describing the last DDE error.
- *
- * Results:
- * None.
- *
- *
- * Side effects:
- * The interp's result object is changed.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-SetError(
- Tcl_Interp *interp) /* The interp to put the message in.*/
-{
- int err;
- const char *mesg;
-
- err = DdeGetLastError(instance);
- switch (err) {
- case DMLERR_DATAACKTIMEOUT:
- case DMLERR_EXECACKTIMEOUT:
- case DMLERR_POKEACKTIMEOUT:
- mesg = "remote interpreter did not respond";
- break;
-
- case DMLERR_BUSY:
- mesg = "remote server is busy";
- break;
-
- case DMLERR_NOTPROCESSED:
- mesg = "remote server cannot handle this command";
- break;
-
- default:
- mesg = "dde command failed";
- break;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), mesg, -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DdeObjCmd --
- *
- * This procedure is invoked to process the "dde" TCL command.
- * See the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-DdeObjCmd(
- ClientData clientData, /* Used only for deletion */
- Tcl_Interp *interp, /* The interp we are sending from */
- int objc, /* Number of arguments */
- Tcl_Obj *const objv[]) /* The arguments */
-{
- enum {
- DDE_SERVERNAME,
- DDE_EXECUTE,
- DDE_POKE,
- DDE_REQUEST,
- DDE_SERVICES,
- DDE_EVAL
- };
-
- static const char *commands[] = {
- "servername", "execute", "poke", "request", "services", "eval",
- (char *) NULL
- };
- static const char *options[] = {
- "-async", (char *) NULL
- };
- int index, argIndex;
- int async = 0, binary = 0;
- int result = TCL_OK;
- HSZ service = NULL;
- HSZ topic = NULL;
- HSZ item = NULL;
- HDDEDATA data = NULL;
- HDDEDATA itemData = NULL;
- HCONV hConv = NULL;
- HSZ cookie = 0;
- const char *serviceName, *topicName, *itemString, *dataString;
- const char *string;
- int firstArg, length, dataLength;
- HDDEDATA code;
- RegisteredInterp *riPtr;
- Tcl_Interp *sendInterp;
- Tcl_Obj *objPtr;
-
- /*
- * Initialize DDE server/client
- */
-
- if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "?-async? serviceName topicName value");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIndexFromObj(interp, objv[1], commands, "command", 0,
- &index) != TCL_OK) {
- return TCL_ERROR;
- }
-
- serviceName = NULL; /* Suppress compiler warning. */
- firstArg = 1;
- switch (index) {
- case DDE_SERVERNAME:
- if ((objc != 3) && (objc != 2)) {
- Tcl_WrongNumArgs(interp, 1, objv, "servername ?serverName?");
- return TCL_ERROR;
- }
- firstArg = (objc - 1);
- break;
-
- case DDE_EXECUTE:
- if ((objc < 5) || (objc > 6)) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "execute ?-async? serviceName topicName value");
- return TCL_ERROR;
- }
- if (Tcl_GetIndexFromObj(NULL, objv[2], options, "option", 0,
- &argIndex) != TCL_OK) {
- if (objc != 5) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "execute ?-async? serviceName topicName value");
- return TCL_ERROR;
- }
- async = 0;
- firstArg = 2;
- } else {
- if (objc != 6) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "execute ?-async? serviceName topicName value");
- return TCL_ERROR;
- }
- async = 1;
- firstArg = 3;
- }
- break;
- case DDE_POKE:
- if (objc != 6) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "poke serviceName topicName item value");
- return TCL_ERROR;
- }
- firstArg = 2;
- break;
-
- case DDE_REQUEST:
- if (objc != 5) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "request serviceName topicName value");
- return TCL_ERROR;
- }
- binary = 0;
- firstArg = 2;
- break;
-
- case DDE_SERVICES:
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "services serviceName topicName");
- return TCL_ERROR;
- }
- firstArg = 2;
- break;
-
- case DDE_EVAL:
- if (objc < 4) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "eval ?-async? serviceName args");
- return TCL_ERROR;
- }
- if (Tcl_GetIndexFromObj(NULL, objv[2], options, "option", 0,
- &argIndex) != TCL_OK) {
- if (objc < 4) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "eval ?-async? serviceName args");
- return TCL_ERROR;
- }
- async = 0;
- firstArg = 2;
- } else {
- if (objc < 5) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "eval ?-async? serviceName args");
- return TCL_ERROR;
- }
- async = 1;
- firstArg = 3;
- }
- break;
- }
-
- Initialize();
-
- if (firstArg != 1) {
- serviceName = Tcl_GetStringFromObj(objv[firstArg], &length);
- } else {
- length = 0;
- }
-
- if (length == 0) {
- serviceName = NULL;
- } else if ((index != DDE_SERVERNAME) && (index != DDE_EVAL)) {
- service = DdeCreateStringHandle(instance, serviceName,
- CP_WINANSI);
- }
-
- if ((index != DDE_SERVERNAME) && (index != DDE_EVAL)) {
- topicName = Tcl_GetStringFromObj(objv[firstArg + 1], &length);
- if (length == 0) {
- topicName = NULL;
- } else {
- topic = DdeCreateStringHandle(instance, topicName, CP_WINANSI);
- }
- }
-
- switch (index) {
- case DDE_SERVERNAME:
- serviceName = SetServerName(interp, serviceName);
- if (serviceName != NULL) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- serviceName, -1);
- } else {
- Tcl_ResetResult(interp);
- }
- break;
-
- case DDE_EXECUTE:
- {
- dataString = Tcl_GetStringFromObj(objv[firstArg + 2], &dataLength);
- if (dataLength == 0) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- "cannot execute null data", -1);
- result = TCL_ERROR;
- break;
- }
- hConv = DdeConnect(instance, service, topic, NULL);
- DdeFreeStringHandle(instance, service);
- DdeFreeStringHandle(instance, topic);
-
- if (hConv == NULL) {
- SetError(interp);
- result = TCL_ERROR;
- break;
- }
-
- data = DdeCreateDataHandle(instance, (char *)dataString,
- dataLength + 1, 0, 0, CF_TEXT, 0);
- if (data != NULL) {
- if (async) {
- DWORD status;
-
- DdeClientTransaction((LPBYTE) data, 0xFFFFFFFF, hConv, 0,
- CF_TEXT, XTYP_EXECUTE, TIMEOUT_ASYNC, &status);
- DdeAbandonTransaction(instance, hConv, status);
- } else {
- code = DdeClientTransaction((LPBYTE) data, 0xFFFFFFFF,
- hConv, 0, CF_TEXT, XTYP_EXECUTE, 30000, NULL);
- if (code == 0) {
- SetError(interp);
- result = TCL_ERROR;
- }
- }
- DdeFreeDataHandle(data);
- } else {
- SetError(interp);
- result = TCL_ERROR;
- }
- break;
- }
- case DDE_REQUEST:
- {
- itemString = Tcl_GetStringFromObj(objv[firstArg + 2], &length);
- if (length == 0) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- "cannot request value of null data", -1);
- return TCL_ERROR;
- }
- hConv = DdeConnect(instance, service, topic, NULL);
- DdeFreeStringHandle(instance, service);
- DdeFreeStringHandle(instance, topic);
-
- if (hConv == NULL) {
- SetError(interp);
- result = TCL_ERROR;
- } else {
- item = DdeCreateStringHandle(instance, itemString, CP_WINANSI);
- if (item != NULL) {
- data = DdeClientTransaction(NULL, 0, hConv, item, CF_TEXT,
- XTYP_REQUEST, 5000, NULL);
- if (data == NULL) {
- SetError(interp);
- result = TCL_ERROR;
- } else {
- Tcl_Obj *objPtr;
- DWORD dataLength;
-
- dataString = DdeAccessData(data, &dataLength);
- objPtr = Tcl_NewStringObj(dataString, -1);
- DdeUnaccessData(data);
- DdeFreeDataHandle(data);
- Tcl_SetObjResult(interp, objPtr);
- }
- } else {
- SetError(interp);
- result = TCL_ERROR;
- }
- }
-
- break;
- }
- case DDE_POKE:
- {
- itemString = Tcl_GetStringFromObj(objv[firstArg + 2], &length);
- if (length == 0) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- "cannot have a null item", -1);
- return TCL_ERROR;
- }
- dataString = Tcl_GetStringFromObj(objv[firstArg + 3], &length);
-
- hConv = DdeConnect(instance, service, topic, NULL);
- DdeFreeStringHandle(instance, service);
- DdeFreeStringHandle(instance, topic);
-
- if (hConv == NULL) {
- SetError(interp);
- result = TCL_ERROR;
- } else {
- item = DdeCreateStringHandle(instance, itemString,
- CP_WINANSI);
- if (item != NULL) {
- data = DdeClientTransaction((char *)dataString, length+1,
- hConv, item, CF_TEXT, XTYP_POKE, 5000, NULL);
- if (data == NULL) {
- SetError(interp);
- result = TCL_ERROR;
- }
- } else {
- SetError(interp);
- result = TCL_ERROR;
- }
- }
- break;
- }
-
- case DDE_SERVICES:
- {
- HCONVLIST hConvList;
- CONVINFO convInfo;
- Tcl_Obj *convListObjPtr, *elementObjPtr;
- Tcl_DString dString;
- const char *name;
-
- convInfo.cb = sizeof(CONVINFO);
- hConvList = DdeConnectList(instance, service,
- topic, 0, NULL);
- DdeFreeStringHandle(instance, service);
- DdeFreeStringHandle(instance, topic);
- hConv = 0;
- convListObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- Tcl_DStringInit(&dString);
-
- while (hConv = DdeQueryNextServer(hConvList, hConv), hConv != 0) {
- elementObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- DdeQueryConvInfo(hConv, QID_SYNC, &convInfo);
- length = DdeQueryString(instance,
- convInfo.hszSvcPartner, NULL, 0, CP_WINANSI);
- Tcl_DStringSetLength(&dString, length);
- name = Tcl_DStringValue(&dString);
- DdeQueryString(instance, convInfo.hszSvcPartner, (char *)name,
- length + 1, CP_WINANSI);
- Tcl_ListObjAppendElement(interp, elementObjPtr,
- Tcl_NewStringObj(name, length));
- length = DdeQueryString(instance, convInfo.hszTopic,
- NULL, 0, CP_WINANSI);
- Tcl_DStringSetLength(&dString, length);
- name = Tcl_DStringValue(&dString);
- DdeQueryString(instance, convInfo.hszTopic, (char *)name,
- length + 1, CP_WINANSI);
- Tcl_ListObjAppendElement(interp, elementObjPtr,
- Tcl_NewStringObj(name, length));
- Tcl_ListObjAppendElement(interp, convListObjPtr,
- elementObjPtr);
- }
- DdeDisconnectList(hConvList);
- Tcl_SetObjResult(interp, convListObjPtr);
- Tcl_DStringFree(&dString);
- break;
- }
- case DDE_EVAL:
- {
- objc -= (async + 3);
- objv += (async + 3);
-
- /*
- * See if the target interpreter is local. If so, execute
- * the command directly without going through the DDE
- * server. Don't exchange objects between interps. The
- * target interp could compile an object, producing a
- * bytecode structure that refers to other objects owned
- * by the target interp. If the target interp is then
- * deleted, the bytecode structure would be referring to
- * deallocated objects.
- */
-
- for (riPtr = interps; riPtr != NULL;
- riPtr = riPtr->nextPtr) {
- if (strcasecmp(serviceName, riPtr->name) == 0) {
- break;
- }
- }
-
- if (riPtr != NULL) {
- /*
- * This command is to a local interp. No need to go through
- * the server.
- */
-
- Tcl_Preserve(riPtr);
- sendInterp = riPtr->interp;
- Tcl_Preserve(sendInterp);
-
- /*
- * Don't exchange objects between interps. The target interp
- * would compile an object, producing a bytecode structure that
- * refers to other objects owned by the target interp. If the
- * target interp is then deleted, the bytecode structure would
- * be referring to deallocated objects.
- */
-
- if (objc == 1) {
- result = Tcl_GlobalEval(sendInterp,Tcl_GetString(objv[0]));
- } else {
- objPtr = Tcl_ConcatObj(objc, objv);
- Tcl_IncrRefCount(objPtr);
- result = Tcl_GlobalEval(sendInterp, Tcl_GetString(objPtr));
- Tcl_DecrRefCount(objPtr);
- }
- if (interp != sendInterp) {
- if (result == TCL_ERROR) {
- const char *value;
- /*
- * An error occurred, so transfer error information
- * from the destination interpreter back to our
- * interpreter.
- */
-
- Tcl_ResetResult(interp);
- value = Tcl_GetVar2(sendInterp, "errorInfo", NULL,
- TCL_GLOBAL_ONLY);
- Tcl_AddObjErrorInfo(interp, value, length);
-
- value = Tcl_GetVar2(sendInterp, "errorCode", NULL,
- TCL_GLOBAL_ONLY);
- Tcl_SetErrorCode(interp, value, (char *)NULL);
- }
- Tcl_SetObjResult(interp, Tcl_GetObjResult(sendInterp));
- }
- Tcl_Release(riPtr);
- Tcl_Release(sendInterp);
- } else {
- /*
- * This is a non-local request. Send the script to the server
- * and poll it for a result.
- */
-
- if (MakeConnection(interp, serviceName, &hConv) != TCL_OK) {
- goto error;
- }
-
- objPtr = Tcl_ConcatObj(objc, objv);
- string = Tcl_GetStringFromObj(objPtr, &length);
- itemData = DdeCreateDataHandle(instance, (char *)string,
- length+1, 0, 0, CF_TEXT, 0);
-
- if (async) {
- DWORD status;
-
- data = DdeClientTransaction((LPBYTE) itemData, 0xFFFFFFFF,
- hConv, 0, CF_TEXT, XTYP_EXECUTE, TIMEOUT_ASYNC,
- &status);
- DdeAbandonTransaction(instance, hConv, status);
- } else {
- data = DdeClientTransaction((LPBYTE) itemData,
- 0xFFFFFFFF, hConv, 0,
- CF_TEXT, XTYP_EXECUTE, 30000, NULL);
- if (data != 0) {
-
- cookie = DdeCreateStringHandle(instance,
- "$TCLEVAL$EXECUTE$RESULT", CP_WINANSI);
- data = DdeClientTransaction(NULL, 0, hConv,
- cookie, CF_TEXT, XTYP_REQUEST, 30000, NULL);
- }
- }
-
- Tcl_DecrRefCount(objPtr);
-
- if (data == 0) {
- SetError(interp);
- goto errorNoResult;
- }
-
- if (async == 0) {
- Tcl_Obj *resultPtr;
-
- /*
- * The return handle has a two or four element list in
- * it. The first element is the return code (TCL_OK,
- * TCL_ERROR, etc.). The second is the result of the
- * script. If the return code is TCL_ERROR, then the third
- * element is the value of the variable "errorCode", and
- * the fourth is the value of the variable "errorInfo".
- */
-
- resultPtr = Tcl_NewObj();
- length = DdeGetData(data, NULL, 0, 0);
- Tcl_SetObjLength(resultPtr, length);
- string = Tcl_GetStringFromObj(resultPtr, length);
- DdeGetData(data, (char *)string, length, 0);
- Tcl_SetObjLength(resultPtr, strlen(string));
-
- if (Tcl_ListObjIndex(NULL, resultPtr, 0, &objPtr)
- != TCL_OK) {
- Tcl_DecrRefCount(resultPtr);
- goto error;
- }
- if (Tcl_GetIntFromObj(NULL, objPtr, &result) != TCL_OK) {
- Tcl_DecrRefCount(resultPtr);
- goto error;
- }
- if (result == TCL_ERROR) {
- Tcl_ResetResult(interp);
-
- if (Tcl_ListObjIndex(NULL, resultPtr, 3, &objPtr)
- != TCL_OK) {
- Tcl_DecrRefCount(resultPtr);
- goto error;
- }
- length = -1;
- string = Tcl_GetStringFromObj(objPtr, &length);
- Tcl_AddObjErrorInfo(interp, string, length);
-
- Tcl_ListObjIndex(NULL, resultPtr, 2, &objPtr);
- Tcl_SetObjErrorCode(interp, objPtr);
- }
- if (Tcl_ListObjIndex(NULL, resultPtr, 1, &objPtr)
- != TCL_OK) {
- Tcl_DecrRefCount(resultPtr);
- goto error;
- }
- Tcl_SetObjResult(interp, objPtr);
- Tcl_DecrRefCount(resultPtr);
- }
- }
- }
- }
- if (cookie != NULL) {
- DdeFreeStringHandle(instance, cookie);
- }
- if (item != NULL) {
- DdeFreeStringHandle(instance, item);
- }
- if (itemData != NULL) {
- DdeFreeDataHandle(itemData);
- }
- if (data != NULL) {
- DdeFreeDataHandle(data);
- }
- if (hConv != NULL) {
- DdeDisconnect(hConv);
- }
- return result;
-
- error:
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- "invalid data returned from server", -1);
-
- errorNoResult:
- if (cookie != NULL) {
- DdeFreeStringHandle(instance, cookie);
- }
- if (item != NULL) {
- DdeFreeStringHandle(instance, item);
- }
- if (itemData != NULL) {
- DdeFreeDataHandle(itemData);
- }
- if (data != NULL) {
- DdeFreeDataHandle(data);
- }
- if (hConv != NULL) {
- DdeDisconnect(hConv);
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DdeCmdInitProc --
- *
- * This procedure initializes the dde command.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-int
-Blt_DdeCmdInitProc(interp)
- Tcl_Interp *interp;
-{
- Tcl_CreateObjCommand(interp, "dde", DdeObjCmd, NULL, NULL);
- conversations = NULL;
- interps = NULL;
- Tcl_CreateExitHandler(ExitProc, NULL);
- return Tcl_PkgProvide(interp, TCL_DDE_PACKAGE_NAME, TCL_DDE_VERSION);
-}
-
-#endif /* NO_DDE */
diff --git a/blt3.0.1/src/bltWinDll.c b/blt3.0.1/src/bltWinDll.c
deleted file mode 100644
index 45608d5..0000000
--- a/blt3.0.1/src/bltWinDll.c
+++ /dev/null
@@ -1,71 +0,0 @@
-
-/*
- * bltWinDll.c --
- *
- * This module initials the non-Tk command of the BLT toolkit,
- * registering the commands with the TCL interpreter.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#ifdef WIN32
-/*
- *---------------------------------------------------------------------------
- *
- * DllMain --
- *
- * This wrapper function is used by Windows to invoke the
- * initialization code for the DLL.
- *
- * Results:
- * Returns TRUE;
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-BOOL APIENTRY
-DllMain(
- HINSTANCE hInst, /* Library instance handle. */
- DWORD reason, /* Reason this function is being called. */
- LPVOID reserved) /* Not used. */
-{
- return TRUE;
-}
-
-BOOL APIENTRY
-DllEntryPoint(hInst, reason, reserved)
- HINSTANCE hInst; /* Library instance handle. */
- DWORD reason; /* Reason this function is being called. */
- LPVOID reserved; /* Not used. */
-{
- return DllMain(hInst, reason, reserved);
-}
-#endif /* WIN32 */
-
diff --git a/blt3.0.1/src/bltWinDraw.c b/blt3.0.1/src/bltWinDraw.c
deleted file mode 100644
index ed13f93..0000000
--- a/blt3.0.1/src/bltWinDraw.c
+++ /dev/null
@@ -1,2929 +0,0 @@
-
-/*
- * bltWinDraw.c --
- *
- * This module contains WIN32 routines not included in the Tcl/Tk
- * libraries.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <bltInt.h>
-#include <X11/Xutil.h>
-#include <X11/Xlib.h>
-#include <bltFont.h>
-#include <bltText.h>
-#include "tkDisplay.h"
-#include "tkFont.h"
-#include "tkIntBorder.h"
-
-#define WINDEBUG 0
-
-/*
- * Data structure for setting graphics context.
- */
-typedef struct {
- int function; /* logical operation */
- unsigned long plane_mask; /* plane mask */
- unsigned long foreground; /* foreground pixel */
- unsigned long background; /* background pixel */
- int line_width; /* line width */
- int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */
- int cap_style; /* CapNotLast, CapButt,
- CapRound, CapProjecting */
- int join_style; /* JoinMiter, JoinRound, JoinBevel */
- int fill_style; /* FillSolid, FillTiled,
- FillStippled, FillOpaeueStippled */
- int fill_rule; /* EvenOddRule, WindingRule */
- int arc_mode; /* ArcChord, ArcPieSlice */
- Pixmap tile; /* tile pixmap for tiling operations */
- Pixmap stipple; /* stipple 1 plane pixmap for stipping */
- int ts_x_origin; /* offset for tile or stipple operations */
- int ts_y_origin;
- Font font; /* default text font for text operations */
- int subwindow_mode; /* ClipByChildren, IncludeInferiors */
- Bool graphics_exposures; /* boolean, should exposures be generated */
- int clip_x_origin; /* origin for clipping */
- int clip_y_origin;
- Pixmap clip_mask; /* bitmap clipping; other calls for rects */
- int dash_offset; /* patterned/dashed line information */
- char dashes; /* If -1, indicates that the extended
- * information below is available. */
- int nDashValues;
- char dashValues[12];
-} XGCValuesEx;
-
-static int tkpWinRopModes[] =
-{
- R2_BLACK, /* GXclear */
- R2_MASKPEN, /* GXand */
- R2_MASKPENNOT, /* GXandReverse */
- R2_COPYPEN, /* GXcopy */
- R2_MASKNOTPEN, /* GXandInverted */
- R2_NOT, /* GXnoop */
- R2_XORPEN, /* GXxor */
- R2_MERGEPEN, /* GXor */
- R2_NOTMERGEPEN, /* GXnor */
- R2_NOTXORPEN, /* GXequiv */
- R2_NOT, /* GXinvert */
- R2_MERGEPENNOT, /* GXorReverse */
- R2_NOTCOPYPEN, /* GXcopyInverted */
- R2_MERGENOTPEN, /* GXorInverted */
- R2_NOTMASKPEN, /* GXnand */
- R2_WHITE /* GXset */
-};
-
-#define MASKPAT 0x00E20746 /* dest = (src & pat) | (!src & dst) */
-#define COPYFG 0x00CA0749 /* dest = (pat & src) | (!pat & dst) */
-#define COPYBG 0x00AC0744 /* dest = (!pat & src) | (pat & dst) */
-/*
- * Translation table between X gc functions and Win32 BitBlt op modes. Some
- * of the operations defined in X don't have names, so we have to construct
- * new opcodes for those functions. This is arcane and probably not all that
- * useful, but at least it's accurate.
- */
-
-#define NOTSRCAND (DWORD)0x00220326 /* dest = (NOT src) AND dest */
-#define NOTSRCINVERT (DWORD)0x00990066 /* dest = (NOT src) XOR dest */
-#define SRCORREVERSE (DWORD)0x00DD0228 /* dest = src OR (NOT dest) */
-#define SRCNAND (DWORD)0x007700E6 /* dest = NOT (src AND dest) */
-
-static int bltModes[] =
-{
- BLACKNESS, /* GXclear */
- SRCAND, /* GXand */
- SRCERASE, /* GXandReverse */
- SRCCOPY, /* GXcopy */
- NOTSRCAND, /* GXandInverted */
- PATCOPY, /* GXnoop */
- SRCINVERT, /* GXxor */
- SRCPAINT, /* GXor */
- NOTSRCERASE, /* GXnor */
- NOTSRCINVERT, /* GXequiv */
- DSTINVERT, /* GXinvert */
- SRCORREVERSE, /* GXorReverse */
- NOTSRCCOPY, /* GXcopyInverted */
- MERGEPAINT, /* GXorInverted */
- SRCNAND, /* GXnand */
- WHITENESS /* GXset */
-};
-
-#if (_TCL_VERSION < _VERSION(8,1,0))
-typedef void *Tcl_Encoding; /* Make up dummy type for encoding. */
-#else
-static Tcl_Encoding systemEncoding = NULL;
-#endif
-
-HPALETTE
-Blt_GetSystemPalette(void)
-{
- HDC hDC;
- HPALETTE hPalette;
- DWORD flags;
-
- hPalette = NULL;
- hDC = GetDC(NULL); /* Get the desktop device context */
- flags = GetDeviceCaps(hDC, RASTERCAPS);
- if (flags & RC_PALETTE) {
- LOGPALETTE *palettePtr;
-
- palettePtr = (LOGPALETTE *)
- GlobalAlloc(GPTR, sizeof(LOGPALETTE) + 256 * sizeof(PALETTEENTRY));
- palettePtr->palVersion = 0x300;
- palettePtr->palNumEntries = 256;
- GetSystemPaletteEntries(hDC, 0, 256, palettePtr->palPalEntry);
- hPalette = CreatePalette(palettePtr);
- GlobalFree(palettePtr);
- }
- ReleaseDC(NULL, hDC);
- return hPalette;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateRotatedFont --
- *
- * Creates a rotated copy of the given font. This only works
- * for TrueType fonts.
- *
- * Results:
- * Returns the newly create font or NULL if the font could not
- * be created.
- *
- *---------------------------------------------------------------------------
- */
-static HFONT
-CreateRotatedFont(
- unsigned long fontId, /* Font identifier (actually a Tk_Font) */
- float angle)
-{ /* Number of degrees to rotate font */
- TkFontAttributes *faPtr; /* Set of attributes to match. */
- TkFont *fontPtr;
- HFONT hFont;
- LOGFONTW lf;
-
- fontPtr = (TkFont *) fontId;
- faPtr = &fontPtr->fa;
- ZeroMemory(&lf, sizeof(LOGFONT));
- lf.lfHeight = -faPtr->size;
- if (lf.lfHeight < 0) {
- HDC dc;
-
- dc = GetDC(NULL);
- lf.lfHeight = -MulDiv(faPtr->size, GetDeviceCaps(dc, LOGPIXELSY), 72);
- ReleaseDC(NULL, dc);
- }
- lf.lfWidth = 0;
- lf.lfEscapement = lf.lfOrientation = ROUND(angle * 10.0);
-#define TK_FW_NORMAL 0
- lf.lfWeight = (faPtr->weight == TK_FW_NORMAL) ? FW_NORMAL : FW_BOLD;
- lf.lfItalic = faPtr->slant;
- lf.lfUnderline = faPtr->underline;
- lf.lfStrikeOut = faPtr->overstrike;
- lf.lfCharSet = DEFAULT_CHARSET;
- lf.lfOutPrecision = OUT_TT_ONLY_PRECIS;
- lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
- lf.lfQuality = DEFAULT_QUALITY;
- lf.lfQuality = ANTIALIASED_QUALITY;
- lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
-
- hFont = NULL;
- if (faPtr->family == NULL) {
- lf.lfFaceName[0] = '\0';
- } else {
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- Tcl_DString dString;
-
- Tcl_UtfToExternalDString(systemEncoding, faPtr->family, -1, &dString);
-
- if (Blt_GetPlatformId() == VER_PLATFORM_WIN32_NT) {
- Tcl_UniChar *src, *dst;
-
- /*
- * We can only store up to LF_FACESIZE wide characters
- */
- if (Tcl_DStringLength(&dString) >= (LF_FACESIZE * sizeof(WCHAR))) {
- Tcl_DStringSetLength(&dString, LF_FACESIZE);
- }
- src = (Tcl_UniChar *)Tcl_DStringValue(&dString);
- dst = (Tcl_UniChar *)lf.lfFaceName;
- while (*src != '\0') {
- *dst++ = *src++;
- }
- *dst = '\0';
- hFont = CreateFontIndirectW((LOGFONTW *)&lf);
- } else {
- /*
- * We can only store up to LF_FACESIZE characters
- */
- if (Tcl_DStringLength(&dString) >= LF_FACESIZE) {
- Tcl_DStringSetLength(&dString, LF_FACESIZE);
- }
- strcpy((char *)lf.lfFaceName, Tcl_DStringValue(&dString));
- hFont = CreateFontIndirectA((LOGFONTA *)&lf);
- }
- Tcl_DStringFree(&dString);
-#else
- strncpy((char *)lf.lfFaceName, faPtr->family, LF_FACESIZE - 1);
- lf.lfFaceName[LF_FACESIZE] = '\0';
-#endif /* _TCL_VERSION >= 8.1.0 */
- }
-
- if (hFont == NULL) {
-#if WINDEBUG
- PurifyPrintf("can't create font: %s\n", Blt_LastError());
-#endif
- } else {
- HFONT oldFont;
- TEXTMETRIC tm;
- HDC hRefDC;
- int result;
-
- /* Check if the rotated font is really a TrueType font. */
-
- hRefDC = GetDC(NULL); /* Get the desktop device context */
- oldFont = SelectFont(hRefDC, hFont);
- result = ((GetTextMetrics(hRefDC, &tm)) &&
- (tm.tmPitchAndFamily & TMPF_TRUETYPE));
- SelectFont(hRefDC, oldFont);
- ReleaseDC(NULL, hRefDC);
- if (!result) {
-#if WINDEBUG
- PurifyPrintf("not a true type font\n");
-#endif
- DeleteFont(hFont);
- return NULL;
- }
- }
- return hFont;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetBitmapData --
- *
- * Returns the DIB bits from a bitmap.
- *
- * Results:
- * Returns a byte array of bitmap data or NULL if an error
- * occurred. The parameter pitchPtr returns the number
- * of bytes per row.
- *
- *---------------------------------------------------------------------------
- */
-unsigned char *
-Blt_GetBitmapData(
- Display *display, /* Display of bitmap */
- Pixmap bitmap, /* Bitmap to query */
- int width, /* Width of bitmap */
- int height, /* Height of bitmap */
- int *pitchPtr) /* (out) Number of bytes per row */
-{
- TkWinDCState state;
- HDC hDC;
- int result;
- unsigned char *bits;
- unsigned int size;
- HBITMAP hBitmap;
- BITMAPINFOHEADER *bmihPtr;
- HANDLE hMem, hMem2;
- int bytesPerRow, imageSize;
-
- size = sizeof(BITMAPINFOHEADER) + 2 * sizeof(RGBQUAD);
- hMem = GlobalAlloc(GHND, size);
- bmihPtr = (BITMAPINFOHEADER *)GlobalLock(hMem);
- bmihPtr->biSize = sizeof(BITMAPINFOHEADER);
- bmihPtr->biPlanes = 1;
- bmihPtr->biBitCount = 1;
- bmihPtr->biCompression = BI_RGB;
- bmihPtr->biWidth = width;
- bmihPtr->biHeight = height;
-
- hBitmap = ((TkWinDrawable *)bitmap)->bitmap.handle;
- hDC = TkWinGetDrawableDC(display, bitmap, &state);
- result = GetDIBits(hDC, hBitmap, 0, height, (LPVOID)NULL,
- (BITMAPINFO *)bmihPtr, DIB_RGB_COLORS);
- TkWinReleaseDrawableDC(bitmap, hDC, &state);
- if (!result) {
- GlobalUnlock(hMem);
- GlobalFree(hMem);
- return NULL;
- }
- imageSize = bmihPtr->biSizeImage;
- GlobalUnlock(hMem);
- bytesPerRow = ((width + 31) & ~31) / 8;
- if (imageSize == 0) {
- imageSize = bytesPerRow * height;
- }
- hMem2 = GlobalReAlloc(hMem, size + imageSize, 0);
- if (hMem2 == NULL) {
- GlobalFree(hMem);
- return NULL;
- }
- hMem = hMem2;
- bmihPtr = (BITMAPINFOHEADER *)GlobalLock(hMem);
- hDC = TkWinGetDrawableDC(display, bitmap, &state);
- result = GetDIBits(hDC, hBitmap, 0, height, (unsigned char *)bmihPtr + size,
- (BITMAPINFO *)bmihPtr, DIB_RGB_COLORS);
- TkWinReleaseDrawableDC(bitmap, hDC, &state);
- bits = NULL;
- if (!result) {
- OutputDebugString("GetDIBits failed\n");
- } else {
- bits = Blt_Malloc(imageSize);
- if (bits != NULL) {
- memcpy (bits, (unsigned char *)bmihPtr + size, imageSize);
- }
- }
- GlobalUnlock(hMem);
- GlobalFree(hMem);
- *pitchPtr = bytesPerRow;
- return bits;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XFree --
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXFree(void *ptr)
-{
- Blt_Free(ptr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XMaxRequestSize --
- *
- *---------------------------------------------------------------------------
- */
-long
-Blt_EmulateXMaxRequestSize(Display *display)
-{
- return (SHRT_MAX / 4);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XLowerWindow --
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXLowerWindow(
- Display *display,
- Window window)
-{
- HWND hWnd;
-
- hWnd = Tk_GetHWND(window);
- display->request++;
- SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XRaiseWindow --
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXRaiseWindow(
- Display *display,
- Window window)
-{
- HWND hWnd;
-
- hWnd = Tk_GetHWND(window);
- display->request++;
- SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XUnmapWindow --
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXUnmapWindow(
- Display *display,
- Window window)
-{
- HWND hWnd;
-
- hWnd = Tk_GetHWND(window);
- display->request++;
- ShowWindow(hWnd, SW_HIDE);
- /* SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); */
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XWarpPointer --
- *
- * If destWindow is None, moves the pointer by the offsets (destX,
- * destY) relative to the current position of the pointer.
- * If destWindow is a window, moves the pointer to the offsets
- * (destX, destY) relative to the origin of destWindow. However,
- * if srcWindow is a window, the move only takes place if the window
- * srcWindow contains the pointer and if the specified rectangle of
- * srcWindow contains the pointer.
- *
- * The srcX and srcY coordinates are relative to the origin of
- * srcWindow. If srcHeight is zero, it is replaced with the current
- * height of srcWindow minus srcY. If srcWidth is zero, it is
- * replaced with the current width of srcWindow minus srcX.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXWarpPointer(
- Display *display,
- Window srcWindow,
- Window destWindow,
- int srcX,
- int srcY,
- unsigned int srcWidth,
- unsigned int srcHeight,
- int destX,
- int destY)
-{
- HWND hWnd;
- POINT point;
-
- hWnd = Tk_GetHWND(destWindow);
- point.x = destX, point.y = destY;
- if (ClientToScreen(hWnd, &point)) {
- SetCursorPos(point.x, point.y);
- }
-}
-
-#ifdef notdef
-static Blt_HashTable gcTable;
-static int gcInitialized = FALSE;
-#endif
-
-typedef struct {
- HDC dc;
- int count;
- COLORREF color;
- int offset, nBits;
-} DashInfo;
-
-void
-Blt_SetDashes(Display *display, GC gc, Blt_Dashes *dashesPtr)
-{
- XGCValuesEx *gcPtr = (XGCValuesEx *)gc;
-
- /* This must be used only with a privately created GC */
- assert((int)gcPtr->dashes == -1);
- gcPtr->nDashValues = strlen(dashesPtr->values);
- gcPtr->dash_offset = dashesPtr->offset;
- strcpy(gcPtr->dashValues, dashesPtr->values);
-}
-
-static int
-GetDashInfo(
- HDC dc,
- GC gc,
- DashInfo *infoPtr)
-{
- int dashOffset, dashValue;
-
- dashValue = 0;
- dashOffset = gc->dash_offset;
- if ((int)gc->dashes == -1) {
- XGCValuesEx *gcPtr = (XGCValuesEx *)gc;
-
- if (gcPtr->nDashValues == 1) {
- dashValue = gcPtr->dashValues[0];
- }
- } else if (gc->dashes > 0) {
- dashValue = (int)gc->dashes;
- }
- if (dashValue == 0) {
- return FALSE;
- }
- infoPtr->dc = dc;
- infoPtr->nBits = dashValue;
- infoPtr->offset = dashOffset;
- infoPtr->count = 0;
- infoPtr->color = gc->foreground;
- return TRUE;
-}
-
-void
-Blt_SetROP2(HDC dc, int function)
-{
- SetROP2(dc, tkpWinRopModes[function]);
-}
-
-static XGCValuesEx *
-CreateGC()
-{
- XGCValuesEx *gcPtr;
-
- gcPtr = Blt_Malloc(sizeof(XGCValuesEx));
- if (gcPtr == NULL) {
- return NULL;
- }
- gcPtr->arc_mode = ArcPieSlice;
- gcPtr->background = 0xffffff;
- gcPtr->cap_style = CapNotLast;
- gcPtr->clip_mask = None;
- gcPtr->clip_x_origin = gcPtr->clip_y_origin = 0;
- gcPtr->dash_offset = 0;
- gcPtr->fill_rule = WindingRule;
- gcPtr->fill_style = FillSolid;
- gcPtr->font = None;
- gcPtr->foreground = 0;
- gcPtr->function = GXcopy;
- gcPtr->graphics_exposures = True;
- gcPtr->join_style = JoinMiter;
- gcPtr->line_style = LineSolid;
- gcPtr->line_width = 0;
- gcPtr->plane_mask = ~0;
- gcPtr->stipple = None;
- gcPtr->subwindow_mode = ClipByChildren;
- gcPtr->tile = None;
- gcPtr->ts_x_origin = gcPtr->ts_y_origin = 0;
-
- gcPtr->dashes = -1; /* Mark that this an extended GC */
- gcPtr->nDashValues = 0;
-
- return gcPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_EmulateXCreateGC --
- *
- * Allocate a new extended GC, and initialize the specified fields.
- *
- * Results:
- * Returns a newly allocated GC.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-GC
-Blt_EmulateXCreateGC(
- Display *display,
- Drawable drawable,
- unsigned long mask,
- XGCValues *srcPtr)
-{
- XGCValuesEx *destPtr;
-
- destPtr = CreateGC();
- if (destPtr == NULL) {
- return None;
- }
- if (mask & GCFunction) {
- destPtr->function = srcPtr->function;
- }
- if (mask & GCPlaneMask) {
- destPtr->plane_mask = srcPtr->plane_mask;
- }
- if (mask & GCForeground) {
- destPtr->foreground = srcPtr->foreground;
- }
- if (mask & GCBackground) {
- destPtr->background = srcPtr->background;
- }
- if (mask & GCLineWidth) {
- destPtr->line_width = srcPtr->line_width;
- }
- if (mask & GCLineStyle) {
- destPtr->line_style = srcPtr->line_style;
- }
- if (mask & GCCapStyle) {
- destPtr->cap_style = srcPtr->cap_style;
- }
- if (mask & GCJoinStyle) {
- destPtr->join_style = srcPtr->join_style;
- }
- if (mask & GCFillStyle) {
- destPtr->fill_style = srcPtr->fill_style;
- }
- if (mask & GCFillRule) {
- destPtr->fill_rule = srcPtr->fill_rule;
- }
- if (mask & GCArcMode) {
- destPtr->arc_mode = srcPtr->arc_mode;
- }
- if (mask & GCTile) {
- destPtr->tile = srcPtr->tile;
- }
- if (mask & GCStipple) {
- destPtr->stipple = srcPtr->stipple;
- }
- if (mask & GCTileStipXOrigin) {
- destPtr->ts_x_origin = srcPtr->ts_x_origin;
- }
- if (mask & GCTileStipXOrigin) {
- destPtr->ts_y_origin = srcPtr->ts_y_origin;
- }
- if (mask & GCFont) {
- destPtr->font = srcPtr->font;
- }
- if (mask & GCSubwindowMode) {
- destPtr->subwindow_mode = srcPtr->subwindow_mode;
- }
- if (mask & GCGraphicsExposures) {
- destPtr->graphics_exposures = srcPtr->graphics_exposures;
- }
- if (mask & GCClipXOrigin) {
- destPtr->clip_x_origin = srcPtr->clip_x_origin;
- }
- if (mask & GCClipYOrigin) {
- destPtr->clip_y_origin = srcPtr->clip_y_origin;
- }
- if (mask & GCDashOffset) {
- destPtr->dash_offset = srcPtr->dash_offset;
- }
- if (mask & GCDashList) {
- destPtr->dashes = srcPtr->dashes;
- }
- if (mask & GCClipMask) {
- struct ClipMask {
- int type; /* TKP_CLIP_PIXMAP or TKP_CLIP_REGION */
- Pixmap pixmap;
- } *clipPtr;
-
- clipPtr = Blt_AssertMalloc(sizeof(struct ClipMask));
-#define TKP_CLIP_PIXMAP 0
- clipPtr->type = TKP_CLIP_PIXMAP;
- clipPtr->pixmap = srcPtr->clip_mask;
- destPtr->clip_mask = (Pixmap) clipPtr;
- }
- return (GC)destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GCToPen --
- *
- * Set up the graphics port from the given GC.
- *
- * Geometric and cosmetic pens available under both 95 and NT.
- * Geometric pens differ from cosmetic pens in that they can
- * 1. Draw in world units (can have thick lines: line width > 1).
- * 2. Under NT, allow arbitrary line style.
- * 3. Can have caps and join (needed for thick lines).
- * 4. Draw very, very slowly.
- *
- * Cosmetic pens are single line width only.
- *
- * 95 98 NT
- * PS_SOLID c,g c,g c,g
- * PS_DASH c,g c,g c,g
- * PS_DOT c c c,g
- * PS_DASHDOT c - c,g
- * PS_DASHDOTDOT c - c,g
- * PS_USERSTYLE - - c,g
- * PS_ALTERNATE - - c
- *
- * Geometric only for 95/98
- *
- * PS_ENDCAP_ROUND
- * PS_ENDCAP_SQUARE
- * PS_ENDCAP_FLAT
- * PS_JOIN_BEVEL
- * PS_JOIN_ROUND
- * PS_JOIN_MITER
- *
- * Results:
- * None.
- *
- * Side effects:
- * The current port is adjusted.
- *
- *---------------------------------------------------------------------------
- */
-HPEN
-Blt_GCToPen(HDC dc, GC gc)
-{
- DWORD lineAttrs, lineStyle;
- DWORD dashArr[12];
- DWORD *dashPtr;
- int nValues, lineWidth;
- LOGBRUSH lBrush;
- HPEN pen;
-
- nValues = 0;
- lineWidth = (gc->line_width < 1) ? 1 : gc->line_width;
- if ((gc->line_style == LineOnOffDash) ||
- (gc->line_style == LineDoubleDash)) {
- XGCValuesEx *gcPtr = (XGCValuesEx *)gc;
-
- if ((int)gc->dashes == -1) {
- int i;
-
- nValues = strlen(gcPtr->dashValues);
- for (i = 0; i < nValues; i++) {
- dashArr[i] = (DWORD)gcPtr->dashValues[i];
- }
- if (nValues == 1) {
- dashArr[1] = dashArr[0];
- nValues = 2;
- }
- } else {
- dashArr[1] = dashArr[0] = (DWORD) gc->dashes;
- nValues = 2;
- gc->dashes = -1;
- }
- }
-
- switch (nValues) {
- case 0:
- lineStyle = PS_SOLID;
- break;
- case 3:
- lineStyle = PS_DASHDOT;
- break;
- case 4:
- lineStyle = PS_DASHDOTDOT;
- break;
- case 2:
- default:
- /* PS_DASH style dash length is too long. */
- lineStyle = PS_DOT;
- break;
- }
-
- lBrush.lbStyle = BS_SOLID;
- lBrush.lbColor = gc->foreground;
- lBrush.lbHatch = 0; /* Value is ignored when style is BS_SOLID. */
-
- lineAttrs = 0;
- switch (gc->cap_style) {
- case CapNotLast:
- case CapButt:
- lineAttrs |= PS_ENDCAP_FLAT;
- break;
- case CapRound:
- lineAttrs |= PS_ENDCAP_ROUND;
- break;
- default:
- lineAttrs |= PS_ENDCAP_SQUARE;
- break;
- }
- switch (gc->join_style) {
- case JoinMiter:
- lineAttrs |= PS_JOIN_MITER;
- break;
- case JoinBevel:
- lineAttrs |= PS_JOIN_BEVEL;
- break;
- case JoinRound:
- default:
- lineAttrs |= PS_JOIN_ROUND;
- break;
- }
- SetBkMode(dc, TRANSPARENT);
-
- if (Blt_GetPlatformId() == VER_PLATFORM_WIN32_NT) {
- /* Windows NT/2000/XP. */
- if (nValues > 0) {
- lineStyle = PS_USERSTYLE;
- dashPtr = dashArr;
- } else {
- dashPtr = NULL;
- }
- if (lineWidth > 1) {
- /* Limit the use of geometric pens to thick lines. */
- pen = ExtCreatePen(PS_GEOMETRIC | lineAttrs | lineStyle, lineWidth,
- &lBrush, nValues, dashPtr);
- } else {
- /* Cosmetic pens are much faster. */
- pen = ExtCreatePen(PS_COSMETIC | lineAttrs | lineStyle, 1, &lBrush,
- nValues, dashPtr);
- }
- } else {
- /* Windows 95/98. */
- if ((lineStyle == PS_SOLID) && (lineWidth > 1)) {
- /* Use geometric pens with solid, thick lines only. */
- pen = ExtCreatePen(PS_GEOMETRIC | lineAttrs | lineStyle, lineWidth,
- &lBrush, 0, NULL);
- } else {
- /* Otherwise sacrifice thick lines for dashes. */
- pen = ExtCreatePen(PS_COSMETIC | lineStyle, 1, &lBrush, 0, NULL);
- }
- }
- assert(pen != NULL);
- return pen;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XDrawRectangles --
- *
- * Draws the outlines of the specified rectangles as if a
- * five-point PolyLine protocol request were specified for each
- * rectangle:
- *
- * [x,y] [x+width,y] [x+width,y+height] [x,y+height]
- * [x,y]
- *
- * For the specified rectangles, these functions do not draw a
- * pixel more than once. XDrawRectangles draws the rectangles in
- * the order listed in the array. If rectangles intersect, the
- * intersecting pixels are drawn multiple times. Draws a
- * rectangle.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Draws rectangles on the specified drawable.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXDrawRectangles(
- Display *display,
- Drawable drawable,
- GC gc,
- XRectangle *rectangles,
- int nRectangles)
-{
- HBRUSH hBrush, oldBrush;
- HDC hDC;
- HPEN hPen, oldPen;
- TkWinDCState state;
- XRectangle *rp, *rend;
-
- if (drawable == None) {
- return;
- }
- hDC = TkWinGetDrawableDC(display, drawable, &state);
-
- hPen = Blt_GCToPen(hDC, gc);
- oldPen = SelectPen(hDC, hPen);
-
- hBrush = GetStockObject(NULL_BRUSH);
- oldBrush = SelectBrush(hDC, hBrush);
-
- SetROP2(hDC, tkpWinRopModes[gc->function]);
- for (rp = rectangles, rend = rp + nRectangles; rp < rend; rp++) {
- Rectangle(hDC, (int)rp->x, (int)rp->y, (int)(rp->x + rp->width + 1),
- (int)(rp->y + rp->height + 1));
- }
- SelectPen(hDC, oldPen), DeletePen(hPen);
- SelectBrush(hDC, oldBrush), DeleteBrush(hBrush);
- TkWinReleaseDrawableDC(drawable, hDC, &state);
-}
-
-#ifdef notdef
-/*
- * Implements the "pixeling" of small arcs, because GDI-performance
- * for this is awful
- * was made especially for BLT, graph4 demo now runs 4x faster
- *
- */
-/* O-outer , I-inner, B-both */
-#define NEITHER_ 0
-#define OUTLINE 1
-#define FILL 2
-#define BOTH (OUTLINE|FILL)
-#define MINIARCS 5
-static int arcus0[1] =
-{
- BOTH
-};
-static int arcus1[4] =
-{
- BOTH, BOTH,
- BOTH, BOTH
-};
-
-static int arcus2[9] =
-{
- NEITHER, OUTLINE, NEITHER,
- OUTLINE, FILL, OUTLINE,
- NEITHER, OUTLINE, NEITHER
-};
-
-static int arcus3[16] =
-{
- NEITHER, OUTLINE, OUTLINE, NEITHER,
- OUTLINE, FILL, FILL, OUTLINE,
- OUTLINE, FILL, FILL, OUTLINE,
- NEITHER, OUTLINE, OUTLINE, NEITHER
-};
-
-static int arcus4[25] =
-{
- NEITHER, OUTLINE, OUTLINE, OUTLINE, NEITHER,
- OUTLINE, FILL, FILL, FILL, OUTLINE,
- OUTLINE, FILL, FILL, FILL, OUTLINE,
- OUTLINE, FILL, FILL, FILL, OUTLINE,
- NEITHER, OUTLINE, OUTLINE, OUTLINE, NEITHER
-};
-
-static int *arcis[MINIARCS] =
-{
- arcus0, arcus1, arcus2, arcus3, arcus4
-};
-
-static void
-DrawMiniArc(
- HDC dc,
- int width,
- int x,
- int y,
- int mask,
- COLORREF inner,
- COLORREF outer)
-{
- int *arc;
- int i, j;
-
- if (width > MINIARCS) {
- return;
- }
- arc = arcis[width];
- for (i = 0; i <= width; i++) {
- for (j = 0; j <= width; j++) {
- bit = (mask & *arc);
- if (bit & OUTLINE) {
- SetPixelV(dc, x + i, y + j, outer);
- } else if (bit & FILL) {
- SetPixelV(dc, x + i, y + j, inner);
- }
- arc++;
- }
- }
-}
-
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawArc --
- *
- * This procedure handles the rendering of drawn or filled
- * arcs and chords.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Renders the requested arcs.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DrawArc(
- HDC dc,
- int arcMode, /* Mode: either ArcChord or ArcPieSlice */
- XArc *arcPtr,
- HPEN pen,
- HBRUSH brush)
-{
- int start, extent, clockwise;
- int xstart, ystart, xend, yend;
- double radian_start, radian_end, xr, yr;
- double dx, dy;
-
- if ((arcPtr->angle1 == 0) && (arcPtr->angle2 == 23040)) {
- /* Handle special case of circle or ellipse */
- Ellipse(dc, arcPtr->x, arcPtr->y, arcPtr->x + arcPtr->width + 1,
- arcPtr->y + arcPtr->height + 1);
- return;
- }
- start = arcPtr->angle1, extent = arcPtr->angle2;
- clockwise = (extent < 0); /* Non-zero if clockwise */
-
- /*
- * Compute the absolute starting and ending angles in normalized radians.
- * Swap the start and end if drawing clockwise.
- */
- start = start % (64 * 360);
- if (start < 0) {
- start += (64 * 360);
- }
- extent = (start + extent) % (64 * 360);
- if (extent < 0) {
- extent += (64 * 360);
- }
- if (clockwise) {
- int tmp = start;
- start = extent;
- extent = tmp;
- }
-#define XAngleToRadians(a) ((double)(a) / 64 * M_PI / 180);
- radian_start = XAngleToRadians(start);
- radian_end = XAngleToRadians(extent);
-
- /*
- * Now compute points on the radial lines that define the starting and
- * ending angles. Be sure to take into account that the y-coordinate
- * system is inverted.
- */
- dx = arcPtr->width * 0.5;
- dy = arcPtr->height * 0.5;
-
- xr = arcPtr->x + dx;
- yr = arcPtr->y + dy;
- xstart = (int)((xr + cos(radian_start) * dx) + 0.5);
- ystart = (int)((yr + sin(-radian_start) * dy) + 0.5);
- xend = (int)((xr + cos(radian_end) * dx) + 0.5);
- yend = (int)((yr + sin(-radian_end) * dy) + 0.5);
-
- /*
- * Now draw a filled or open figure. Note that we have to
- * increase the size of the bounding box by one to account for the
- * difference in pixel definitions between X and Windows.
- */
-
- if (brush == 0) {
- /*
- * Note that this call will leave a gap of one pixel at the
- * end of the arc for thin arcs. We can't use ArcTo because
- * it's only supported under Windows NT.
- */
- Arc(dc, arcPtr->x, arcPtr->y, arcPtr->x + arcPtr->width + 1,
- arcPtr->y + arcPtr->height + 1, xstart, ystart, xend, yend);
- /* FIXME: */
- } else {
- if (arcMode == ArcChord) {
- Chord(dc, arcPtr->x, arcPtr->y, arcPtr->x + arcPtr->width + 1,
- arcPtr->y + arcPtr->height + 1, xstart, ystart, xend, yend);
- } else if (arcMode == ArcPieSlice) {
- Pie(dc, arcPtr->x, arcPtr->y, arcPtr->x + arcPtr->width + 1,
- arcPtr->y + arcPtr->height + 1, xstart, ystart, xend, yend);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XDrawArcs --
- *
- * Draws multiple circular or elliptical arcs. Each arc is
- * specified by a rectangle and two angles. The center of the
- * circle or ellipse is the center of the rect- angle, and the
- * major and minor axes are specified by the width and height.
- * Positive angles indicate counterclock- wise motion, and
- * negative angles indicate clockwise motion. If the magnitude
- * of angle2 is greater than 360 degrees, XDrawArcs truncates it
- * to 360 degrees.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Draws an arc for each array element on the specified drawable.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXDrawArcs(
- Display *display,
- Drawable drawable,
- GC gc,
- XArc *arcArr,
- int nArcs)
-{
- HPEN pen, oldPen;
- HBRUSH brush, oldBrush;
- HDC dc;
- TkWinDCState state;
-
- display->request++;
- if (drawable == None) {
- return;
- }
- dc = TkWinGetDrawableDC(display, drawable, &state);
- SetROP2(dc, tkpWinRopModes[gc->function]);
- pen = Blt_GCToPen(dc, gc);
- oldPen = SelectPen(dc, pen);
- brush = GetStockBrush(NULL_BRUSH);
- oldBrush = SelectBrush(dc, brush);
- {
- XArc *ap, *aend;
-
- for (ap = arcArr, aend = ap + nArcs; ap < aend; ap++) {
- DrawArc(dc, gc->arc_mode, ap, pen, 0);
- }
- }
- DeleteBrush(SelectBrush(dc, oldBrush));
- DeletePen(SelectPen(dc, oldPen));
- TkWinReleaseDrawableDC(drawable, dc, &state);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XFillArcs --
- *
- * Draw a filled arc.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Draws a filled arc for each array element on the specified drawable.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXFillArcs(
- Display *display,
- Drawable drawable,
- GC gc,
- XArc *arcArr,
- int nArcs)
-{
- HBRUSH brush, oldBrush;
- HPEN pen, oldPen;
- HDC dc;
- TkWinDCState state;
-
- display->request++;
- if (drawable == None) {
- return;
- }
- dc = TkWinGetDrawableDC(display, drawable, &state);
- SetROP2(dc, tkpWinRopModes[gc->function]);
- pen = Blt_GCToPen(dc, gc);
- oldPen = SelectPen(dc, pen);
- brush = CreateSolidBrush(gc->foreground);
- oldBrush = SelectBrush(dc, brush);
- {
- XArc *ap, *aend;
-
- for (ap = arcArr, aend = ap + nArcs; ap < aend; ap++) {
- DrawArc(dc, gc->arc_mode, ap, pen, brush);
- }
- }
- DeleteBrush(SelectBrush(dc, oldBrush));
- DeletePen(SelectPen(dc, oldPen));
- TkWinReleaseDrawableDC(drawable, dc, &state);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * XDrawLines --
- *
- * Draw connected lines.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Renders a series of connected lines.
- *
- *---------------------------------------------------------------------------
- */
-
-static void CALLBACK
-DrawDot(
- int x, int y, /* Coordinates of point */
- LPARAM clientData)
-{ /* Line information */
- DashInfo *infoPtr = (DashInfo *) clientData;
- int count;
-
- infoPtr->count++;
- count = (infoPtr->count + infoPtr->offset) / infoPtr->nBits;
- if (count & 0x1) {
- SetPixelV(infoPtr->dc, x, y, infoPtr->color);
- }
-}
-
-
-void
-Blt_EmulateXDrawLine(
- Display *display,
- Drawable drawable,
- GC gc,
- int x1, int y1,
- int x2, int y2)
-{
- TkWinDCState state;
- HDC dc;
-
- if (drawable == None) {
- return;
- }
- dc = TkWinGetDrawableDC(display, drawable, &state);
- SetROP2(dc, tkpWinRopModes[gc->function]);
- if (gc->line_style != LineSolid) {
- /* Handle dotted lines specially */
- DashInfo info;
- int count;
-
- if (!GetDashInfo(dc, gc, &info)) {
- goto solidLine;
- }
- count = info.offset / info.nBits;
- if (x1 == x2) { /* Vertical line */
- int y;
-
- for (y = y1; y <= y2; y += 2) {
- SetPixelV(dc, x1, y + count, info.color);
- }
- } else if (y1 == y2) { /* Horizontal line */
- int x;
-
- for (x = x1; x <= x2; x += 2) {
- SetPixelV(dc, x + count, y1, info.color);
- }
- } else {
- LineDDA(x1, y1, x2, y2, DrawDot, (LPARAM)&info);
- }
- } else {
- HPEN pen, oldPen;
- HBRUSH brush, oldBrush;
-
- solidLine:
- pen = Blt_GCToPen(dc, gc);
- oldPen = SelectPen(dc, pen);
- brush = CreateSolidBrush(gc->foreground);
- oldBrush = SelectBrush(dc, brush);
- MoveToEx(dc, x1, y1, (LPPOINT)NULL);
- LineTo(dc, x2, y2);
- DeletePen(SelectPen(dc, oldPen));
- DeleteBrush(SelectBrush(dc, oldBrush));
- }
- TkWinReleaseDrawableDC(drawable, dc, &state);
-}
-
-static void
-DrawLine(
- Display *display,
- Drawable drawable,
- GC gc,
- POINT *points,
- int nPoints)
-{
- TkWinDCState state;
- HDC dc;
- int i, n;
- int start, extra, size;
- HPEN pen, oldPen;
- HBRUSH brush, oldBrush;
-
- if (drawable == None) {
- return;
- }
- dc = TkWinGetDrawableDC(display, drawable, &state);
- pen = Blt_GCToPen(dc, gc);
- oldPen = SelectPen(dc, pen);
- brush = CreateSolidBrush(gc->foreground);
- oldBrush = SelectBrush(dc, brush);
- SetROP2(dc, tkpWinRopModes[gc->function]);
-
- start = extra = 0;
- /*
- * Depending if the line is wide (> 1 pixel), arbitrarily break
- * the line in sections of 100 points. This bit of weirdness has
- * to do with wide geometric pens. The longer the polyline, the
- * slower it draws. The trade off is that we lose dash and
- * cap uniformity for unbearably slow polyline draws.
- */
- if (gc->line_width > 1) {
- size = 100;
- } else {
- size = nPoints;
- }
- for (i = nPoints; i > 0; i -= size) {
- n = MIN(i, size);
- Polyline(dc, points + start, n + extra);
- start += (n - 1);
- extra = 1;
- }
- DeletePen(SelectPen(dc, oldPen));
- DeleteBrush(SelectBrush(dc, oldBrush));
- TkWinReleaseDrawableDC(drawable, dc, &state);
-}
-
-void
-Blt_EmulateXDrawLines(
- Display *display,
- Drawable drawable,
- GC gc,
- XPoint *pointArr,
- int nPoints,
- int mode)
-{
- if (drawable == None) {
- return;
- }
- if (gc->line_style != LineSolid) { /* Handle dotted lines specially */
- DashInfo info;
- TkWinDCState state;
- HDC dc;
- int result;
-
- dc = TkWinGetDrawableDC(display, drawable, &state);
- SetROP2(dc, tkpWinRopModes[gc->function]);
- result = GetDashInfo(dc, gc, &info);
- if (result) {
- XPoint *p1, *p2;
- int i;
-
- p1 = pointArr;
- p2 = p1 + 1;
- for (i = 1; i < nPoints; i++, p1++, p2++) {
- LineDDA(p1->x, p1->y, p2->x, p2->y, DrawDot, (LPARAM)&info);
- }
- result = TCL_OK;
- }
- TkWinReleaseDrawableDC(drawable, dc, &state);
- if (result) {
- return;
- }
- } else {
- POINT *points;
-
- points = Blt_Malloc(sizeof(POINT) * nPoints);
- if (points == NULL) {
- return;
- }
- if (mode == CoordModeOrigin) {
- POINT *destPtr;
- XPoint *sp, *send;
-
- destPtr = points;
- for (sp = pointArr, send = sp + nPoints; sp < send; sp++) {
- destPtr->x = (int)sp->x;
- destPtr->y = (int)sp->y;
- destPtr++;
- }
- } else {
- XPoint *sp, *send;
- POINT *destPtr, *lastPtr;
-
- sp = pointArr;
- destPtr = points;
- destPtr->x = (int)sp->x;
- destPtr->y = (int)sp->y;
- lastPtr = destPtr;
- sp++, destPtr++;
- for (send = pointArr + nPoints; sp < send; sp++) {
- destPtr->x = lastPtr->x + (int)sp->x;
- destPtr->y = lastPtr->y + (int)sp->y;
- lastPtr = destPtr;
- destPtr++;
- }
- }
- DrawLine(display, drawable, gc, points, nPoints);
- Blt_Free(points);
- }
-}
-
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_EmultateXDrawSegments --
- *
- * Draws multiple, unconnected lines. For each segment, draws a
- * line between (x1, y1) and (x2, y2). It draws the lines in the
- * order listed in the array of XSegment structures and does not
- * perform joining at coincident endpoints. For any given line,
- * does not draw a pixel more than once. If lines intersect, the
- * intersecting pixels are drawn multiple times.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Draws unconnected line segments on the specified drawable.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXDrawSegments(
- Display *display,
- Drawable drawable,
- GC gc,
- XSegment *segArr,
- int nSegments)
-{
- HDC dc;
- TkWinDCState state;
-
- display->request++;
- if (drawable == None) {
- return;
- }
- dc = TkWinGetDrawableDC(display, drawable, &state);
- SetROP2(dc, tkpWinRopModes[gc->function]);
- if (gc->line_style != LineSolid) {
- XSegment *sp, *send;
-
- /* Handle dotted lines specially */
- DashInfo info;
-
- if (!GetDashInfo(dc, gc, &info)) {
- goto solidLine;
- }
- for (sp = segArr, send = sp + nSegments; sp < send; sp++) {
- info.count = 0; /* Reset dash counter after every segment. */
- LineDDA(sp->x1, sp->y1, sp->x2, sp->y2, DrawDot, (LPARAM)&info);
- }
- } else {
- XSegment *sp, *send;
- HPEN pen, oldPen;
-
- solidLine:
- pen = Blt_GCToPen(dc, gc);
- oldPen = SelectPen(dc, pen);
- for (sp = segArr, send = sp + nSegments; sp < send; sp++) {
- MoveToEx(dc, sp->x1, sp->y1, (LPPOINT)NULL);
- LineTo(dc, sp->x2, sp->y2);
- }
- DeletePen(SelectPen(dc, oldPen));
- }
- TkWinReleaseDrawableDC(drawable, dc, &state);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_EmultateXDrawRectangle --
- *
- * Draws the outlines of the specified rectangle as if a
- * five-point PolyLine protocol request were specified for each
- * rectangle:
- *
- * [x,y] [x+width,y] [x+width,y+height] [x,y+height]
- * [x,y]
- *
- * Results:
- * None.
- *
- * Side effects:
- * Draws a rectangle on the specified drawable.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXDrawRectangle(
- Display *display,
- Drawable drawable,
- GC gc,
- int x, int y,
- unsigned int width,
- unsigned int height)
-{
- TkWinDCState state;
- HPEN pen, oldPen;
- HBRUSH brush, oldBrush;
- HDC dc;
-
- if (drawable == None) {
- return;
- }
- dc = TkWinGetDrawableDC(display, drawable, &state);
- pen = Blt_GCToPen(dc, gc);
- brush = GetStockObject(NULL_BRUSH);
- oldPen = SelectPen(dc, pen);
- oldBrush = SelectBrush(dc, brush);
- SetROP2(dc, tkpWinRopModes[gc->function]);
- if (gc->line_style != LineSolid) {
- /* Handle dotted lines specially */
- int x2, y2;
- DashInfo info;
-
- if (!GetDashInfo(dc, gc, &info)) {
- goto solidLine;
- }
- x2 = x + width;
- y2 = y + height;
- LineDDA(x, y, x2, y, DrawDot, (LPARAM)&info);
- LineDDA(x2, y, x2, y2, DrawDot, (LPARAM)&info);
- LineDDA(x2, y2, x, y2, DrawDot, (LPARAM)&info);
- LineDDA(x, y2, x, y, DrawDot, (LPARAM)&info);
- } else {
- solidLine:
- Rectangle(dc, x, y, x + width + 1, y + height + 1);
- }
- DeletePen(SelectPen(dc, oldPen));
- DeleteBrush(SelectBrush(dc, oldBrush));
- TkWinReleaseDrawableDC(drawable, dc, &state);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_EmulateXDrawPoints --
- *
- * Uses the foreground pixel and function components of the GC to
- * draw a multiple points into the specified drawable.
- * CoordModeOrigin treats all coordinates as relative to the
- * origin, and CoordModePrevious treats all coordinates after
- * the first as relative to the previous point.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Draws points on the specified drawable.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXDrawPoints(
- Display *display,
- Drawable drawable,
- GC gc,
- XPoint *points,
- int nPoints,
- int mode)
-{ /* Ignored. CoordModeOrigin is assumed. */
- HDC dc;
- XPoint *pp, *pend;
- TkWinDCState state;
-
- display->request++;
- if (drawable == None) {
- return;
- }
- dc = TkWinGetDrawableDC(display, drawable, &state);
- SetROP2(dc, tkpWinRopModes[gc->function]);
- for (pp = points, pend = pp + nPoints; pp < pend; pp++) {
- SetPixelV(dc, pp->x, pp->y, gc->foreground);
- }
- TkWinReleaseDrawableDC(drawable, dc, &state);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_EmultateXReparentWindow --
- *
- * If the specified window is mapped, automatically performs an
- * UnmapWindow request on it, removes it from its current
- * position in the hierarchy, and inserts it as the child of the
- * specified parent. The window is placed in the stacking order
- * on top with respect to sibling windows.
- *
- * Note: In WIN32 you can't reparent to/from another application.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Reparents the specified window.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXReparentWindow(
- Display *display,
- Window window,
- Window parent,
- int x, int y)
-{
- HWND child, newParent;
-
- child = Tk_GetHWND(window);
- newParent = Tk_GetHWND(parent);
- SetParent(child, newParent);
- SetWindowLong(child, GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN |
- WS_CLIPSIBLINGS);
-
- XMoveWindow(display, window, x, y);
- XRaiseWindow(display, window);
- XMapWindow(display, window);
-}
-
-void
-Blt_EmulateXSetDashes(
- Display *display,
- GC gc,
- int dashOffset,
- _Xconst char *dashList,
- int n)
-{
- gc->dashes = (unsigned char)strlen(dashList);
- gc->dash_offset = (int)dashList;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_EmultateXDrawString --
- *
- * Draw a single string in the current font.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Renders the specified string in the drawable.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXDrawString(
- Display *display,
- Drawable drawable,
- GC gc,
- int x, int y,
- _Xconst char *string,
- int length)
-{
- if (drawable == None) {
- return;
- }
- Tk_DrawChars(display, drawable, gc, (Tk_Font)gc->font, string, length,
- x, y);
-}
-
-static void
-TileArea(
- HDC destDC, HDC srcDC,
- int tileOriginX, int tileOriginY, int tileWidth, int tileHeight,
- int x, int y, int width, int height)
-{
- int destX, destY;
- int destWidth, destHeight;
- int srcX, srcY;
- int xOrigin, yOrigin;
- int delta;
- int left, top, right, bottom;
-
- xOrigin = x, yOrigin = y;
- if (x < tileOriginX) {
- delta = (tileOriginX - x) % tileWidth;
- if (delta > 0) {
- xOrigin -= (tileWidth - delta);
- }
- } else if (x > tileOriginX) {
- delta = (x - tileOriginX) % tileWidth;
- if (delta > 0) {
- xOrigin -= delta;
- }
- }
- if (y < tileOriginY) {
- delta = (tileOriginY - y) % tileHeight;
- if (delta > 0) {
- yOrigin -= (tileHeight - delta);
- }
- } else if (y >= tileOriginY) {
- delta = (y - tileOriginY) % tileHeight;
- if (delta > 0) {
- yOrigin -= delta;
- }
- }
-#ifdef notdef
- PurifyPrintf("tile is (%d,%d,%d,%d)\n", tileOriginX, tileOriginY,
- tileWidth, tileHeight);
- PurifyPrintf("region is (%d,%d,%d,%d)\n", x, y, width, height);
- PurifyPrintf("starting at %d,%d\n", xOrigin, yOrigin);
-#endif
- left = x;
- right = x + width;
- top = y;
- bottom = y + height;
- for (y = yOrigin; y < bottom; y += tileHeight) {
- srcY = 0;
- destY = y;
- destHeight = tileHeight;
- if (y < top) {
- srcY = (top - y);
- destHeight = tileHeight - srcY;
- destY = top;
- }
- if ((destY + destHeight) > bottom) {
- destHeight = (bottom - destY);
- }
- for (x = xOrigin; x < right; x += tileWidth) {
- srcX = 0;
- destX = x;
- destWidth = tileWidth;
- if (x < left) {
- srcX = (left - x);
- destWidth = tileWidth - srcX;
- destX = left;
- }
- if ((destX + destWidth) > right) {
- destWidth = (right - destX);
- }
-#ifdef notdef
- PurifyPrintf("drawing pattern (%d,%d,%d,%d) at %d,%d\n",
- srcX , srcY, destWidth, destHeight, destX, destY);
-#endif
- BitBlt(destDC, destX, destY, destWidth, destHeight,
- srcDC, srcX, srcY, SRCCOPY);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_EmultateXFillRectangles --
- *
- * Fill multiple rectangular areas in the given drawable.
- * Handles tiling.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Draws onto the specified drawable.
- *
- *---------------------------------------------------------------------------
- */
-
-void
-Blt_EmulateXFillRectangles(
- Display *display,
- Drawable drawable,
- GC gc,
- XRectangle *rectangles,
- int nRectangles)
-{
- HBRUSH oldBrush, hFgBrush, hBgBrush, hBrush;
- HDC hDC;
- HDC memDC;
- TkWinDCState state;
- TkWinDrawable *twdPtr;
- XRectangle *rp, *rend;
-
- if (drawable == None) {
- return;
- }
- hDC = TkWinGetDrawableDC(display, drawable, &state);
- SetROP2(hDC, tkpWinRopModes[gc->function]);
-
- switch(gc->fill_style) {
- case FillTiled:
- if (gc->tile == None) {
- goto fillSolid;
- }
-#ifdef notdef
- if ((GetDeviceCaps(hDC, RASTERCAPS) & RC_BITBLT) == 0) {
- goto fillSolid;
- }
-#endif
- twdPtr = (TkWinDrawable *)gc->tile;
- {
- HBITMAP oldBitmap;
- BITMAP bm;
-
- GetObject(twdPtr->bitmap.handle, sizeof(BITMAP), &bm);
- memDC = CreateCompatibleDC(hDC);
- oldBitmap = SelectBitmap(memDC, twdPtr->bitmap.handle);
- for (rp = rectangles, rend = rp + nRectangles; rp < rend; rp++) {
- TileArea(hDC, memDC, gc->ts_x_origin, gc->ts_y_origin,
- bm.bmWidth, bm.bmHeight,
- (int)rp->x, (int)rp->y, (int)rp->width,
- (int)rp->height);
- }
- SelectBitmap(memDC, oldBitmap);
- DeleteDC(memDC);
- }
- break;
-
- case FillOpaqueStippled:
- case FillStippled:
- if (gc->stipple == None) {
- goto fillSolid;
- }
- twdPtr = (TkWinDrawable *)gc->stipple;
- if (twdPtr->type != TWD_BITMAP) {
- panic("unexpected drawable type in stipple");
- }
- hBrush = CreatePatternBrush(twdPtr->bitmap.handle);
- SetBrushOrgEx(hDC, gc->ts_x_origin, gc->ts_y_origin, NULL);
- oldBrush = SelectBrush(hDC, hBrush);
- memDC = CreateCompatibleDC(hDC);
-
- /*
- * For each rectangle, create a drawing surface which is the size of
- * the rectangle and fill it with the background color. Then merge the
- * result with the stipple pattern.
- */
- hFgBrush = CreateSolidBrush(gc->foreground);
- hBgBrush = CreateSolidBrush(gc->background);
- for (rp = rectangles, rend = rp + nRectangles; rp < rend; rp++) {
- RECT rect;
- HBITMAP oldBitmap, hBitmap;
-
- hBitmap = CreateCompatibleBitmap(hDC, rp->width, rp->height);
- oldBitmap = SelectObject(memDC, hBitmap);
- rect.left = rect.top = 0;
- rect.right = rp->width;
- rect.bottom = rp->height;
- FillRect(memDC, &rect, hFgBrush);
- BitBlt(hDC, rp->x, rp->y, rp->width, rp->height, memDC, 0, 0,
- COPYBG);
- if (gc->fill_style == FillOpaqueStippled) {
- FillRect(memDC, &rect, hBgBrush);
- BitBlt(hDC, rp->x, rp->y, rp->width, rp->height, memDC, 0, 0,
- COPYFG);
- }
- SelectObject(memDC, oldBitmap);
- DeleteObject(hBitmap);
- }
- DeleteBrush(hFgBrush);
- DeleteBrush(hBgBrush);
- DeleteDC(memDC);
- SelectBrush(hDC, oldBrush);
- DeleteBrush(hBrush);
- break;
-
- case FillSolid:
- fillSolid:
-#ifdef notdef
- memDC = CreateCompatibleDC(hDC);
-#endif
- hFgBrush = CreateSolidBrush(gc->foreground);
- for (rp = rectangles, rend = rp + nRectangles; rp < rend; rp++) {
- RECT rect;
-#ifdef notdef
- HBITMAP oldBitmap, hBitmap;
-
- hBitmap = CreateCompatibleBitmap(hDC, rp->width, rp->height);
- oldBitmap = SelectObject(memDC, hBitmap);
-#endif
- /* Note that width and height is already assumed to be
- * subtracted by one. */
- rect.left = rp->x, rect.top = rp->y;
- rect.right = rp->x + rp->width;
- rect.bottom = rp->y + rp->height;
- FillRect(hDC, &rect, hFgBrush);
-#ifdef notdef
- BitBlt(hDC, rp->x, rp->y, rp->width, rp->height, memDC, 0, 0,
- SRCCOPY);
- SelectObject(memDC, oldBitmap);
- DeleteObject(hBitmap);
-#endif
- }
- DeleteBrush(hFgBrush);
-#ifdef notdef
- DeleteDC(memDC);
-#endif
- break;
- }
- TkWinReleaseDrawableDC(drawable, hDC, &state);
-}
-
-void
-Blt_EmulateXFillRectangle(
- Display *display,
- Drawable drawable,
- GC gc,
- int x, int y,
- unsigned int width,
- unsigned int height)
-{
- HDC hDC;
- RECT rect;
- TkWinDCState state;
-
- if (drawable == None) {
- return;
- }
- hDC = TkWinGetDrawableDC(display, drawable, &state);
- SetROP2(hDC, tkpWinRopModes[gc->function]);
- rect.left = rect.top = 0;
- rect.right = width;
- rect.bottom = height;
-
- switch(gc->fill_style) {
- case FillTiled:
- {
- TkWinDrawable *twdPtr;
- HBITMAP oldBitmap;
- HDC memDC;
- BITMAP bm;
-
- if (gc->tile == None) {
- goto fillSolid;
- }
-#ifdef notdef
- if ((GetDeviceCaps(hDC, RASTERCAPS) & RC_BITBLT) == 0) {
- goto fillSolid;
- }
-#endif
- twdPtr = (TkWinDrawable *)gc->tile;
- /* The tiling routine needs to know the size of the bitmap */
- GetObject(twdPtr->bitmap.handle, sizeof(BITMAP), &bm);
-
- memDC = CreateCompatibleDC(hDC);
- oldBitmap = SelectBitmap(memDC, twdPtr->bitmap.handle);
- TileArea(hDC, memDC, gc->ts_x_origin, gc->ts_y_origin, bm.bmWidth,
- bm.bmHeight, x, y, width, height);
- SelectBitmap(memDC, oldBitmap);
- DeleteDC(memDC);
- }
- break;
-
- case FillOpaqueStippled:
- case FillStippled:
- {
- TkWinDrawable *twdPtr;
- HBRUSH oldBrush, hBrush;
- HBRUSH hBrushFg, hBrushBg;
- HBITMAP oldBitmap, hBitmap;
- HDC memDC;
-
- if (gc->stipple == None) {
- goto fillSolid;
- }
- twdPtr = (TkWinDrawable *)gc->stipple;
- if (twdPtr->type != TWD_BITMAP) {
- panic("unexpected drawable type in stipple");
- }
- hBrush = CreatePatternBrush(twdPtr->bitmap.handle);
- SetBrushOrgEx(hDC, gc->ts_x_origin, gc->ts_y_origin, NULL);
- oldBrush = SelectBrush(hDC, hBrush);
- memDC = CreateCompatibleDC(hDC);
-
- hBrushFg = CreateSolidBrush(gc->foreground);
- hBrushBg = CreateSolidBrush(gc->background);
- hBitmap = CreateCompatibleBitmap(hDC, width, height);
- oldBitmap = SelectObject(memDC, hBitmap);
- FillRect(memDC, &rect, hBrushFg);
- SetBkMode(hDC, TRANSPARENT);
- BitBlt(hDC, x, y, width, height, memDC, 0, 0, COPYFG);
- if (gc->fill_style == FillOpaqueStippled) {
- FillRect(memDC, &rect, hBrushBg);
- BitBlt(hDC, x, y, width, height, memDC, 0, 0, COPYBG);
- }
- SelectBrush(hDC, oldBrush);
- SelectBitmap(memDC, oldBitmap);
- DeleteBrush(hBrushFg);
- DeleteBrush(hBrushBg);
- DeleteBrush(hBrush);
- DeleteBitmap(hBitmap);
- DeleteDC(memDC);
- }
- break;
-
- case FillSolid:
- {
- HBRUSH hBrush;
- HBITMAP oldBitmap, hBitmap;
- HDC memDC;
-
- fillSolid:
- /* TkWinFillRect(hDC, x, y, width, height, gc->foreground); */
- memDC = CreateCompatibleDC(hDC);
- hBrush = CreateSolidBrush(gc->foreground);
- hBitmap = CreateCompatibleBitmap(hDC, width, height);
- oldBitmap = SelectBitmap(memDC, hBitmap);
- rect.left = rect.top = 0;
- rect.right = width;
- rect.bottom = height;
- FillRect(memDC, &rect, hBrush);
- BitBlt(hDC, x, y, width, height, memDC, 0, 0, SRCCOPY);
- SelectObject(memDC, oldBitmap);
- DeleteBitmap(hBitmap);
- DeleteBrush(hBrush);
- DeleteDC(memDC);
- }
- break;
- }
- TkWinReleaseDrawableDC(drawable, hDC, &state);
-}
-
-#if (_TCL_VERSION >= _VERSION(8,1,0))
-static BOOL
-DrawChars(HDC dc, int x, int y, char *string, int length)
-{
- BOOL result;
-
- if (systemEncoding == NULL) {
- result = TextOutA(dc, x, y, string, length);
- } else {
- Tcl_DString dString;
- const unsigned short *wstring;
- int wlength;
-
- Tcl_DStringInit(&dString);
- Tcl_UtfToExternalDString(systemEncoding, string, length, &dString);
- wlength = Tcl_DStringLength(&dString) >> 1;
- wstring = (const unsigned short *)Tcl_DStringValue(&dString);
- result = TextOutW(dc, x, y, wstring, wlength);
- Tcl_DStringFree(&dString);
- }
- return result;
-}
-#else
-static BOOL
-DrawChars(HDC dc, int x, int y, char *string, int length)
-{
- return TextOutA(dc, x, y, string, length);
-}
-#endif /* _TCL_VERSION >= _VERSION(8,1,0) */
-
-#ifdef notef
-int
-Blt_DrawTextWithRotatedFont(
- Tk_Window tkwin,
- Drawable drawable,
- int depth,
- float angle,
- TextStyle *tsPtr,
- TextLayout *textPtr,
- int x, int y,
- int xMax)
-{
- Display *display;
- HFONT hFont, oldFont;
- TkWinDCState state;
- HDC hDC;
- int isActive;
- int bbWidth, bbHeight;
- double rotWidth, rotHeight;
- double sinTheta, cosTheta;
- double radians;
- Point2d p, q, center;
- TextFragment *fp, *fend;
-
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- static int initialized = 0;
-
- if (!initialized) {
- if (Blt_GetPlatformId() == VER_PLATFORM_WIN32_NT) {
- /*
- * If running NT, then we will be calling some Unicode
- * functions explictly. So, even if the TCL system
- * encoding isn't Unicode, make sure we convert to/from
- * the Unicode char set.
- */
- systemEncoding = Tcl_GetEncoding(NULL, "unicode");
- }
- initialized = 1;
- }
-#endif
- display = Tk_Display(tkwin);
- hFont = CreateRotatedFont(tsPtr->gc->font, angle);
- if (hFont == NULL) {
- return FALSE;
- }
- Blt_RotateStartingTextPositions(layoutPtr, angle);
- Blt_GetBoundingBox(layoutPtr->width, layoutPtr->height, angle,
- &rotWidth, &rotHeight, (Point2d *)NULL);
- Blt_TranslateAnchor(x, y, ROUND(rotWidth), ROUND(rotHeight), tsPtr->anchor,
- &x, &y);
-
- isActive = (tsPtr->state & STATE_ACTIVE);
- hDC = TkWinGetDrawableDC(display, drawable, &state);
- SetROP2(hDC, tsPtr->gc->function);
- oldFont = SelectFont(hDC, hFont);
-
- SetBkMode(hDC, TRANSPARENT);
- SetTextAlign(hDC, TA_LEFT | TA_BASELINE);
-
- if (tsPtr->state & (STATE_DISABLED | STATE_EMPHASIS)) {
- TkBorder *borderPtr = (TkBorder *) tsPtr->border;
- XColor *color1, *color2;
-
- color1 = borderPtr->lightColor, color2 = borderPtr->darkColor;
- if (tsPtr->state & STATE_EMPHASIS) {
- XColor *hold;
-
- hold = color1, color1 = color2, color2 = hold;
- }
- if (color1 != NULL) {
- SetTextColor(hDC, color1->pixel);
- for (fp = textPtr->fragments, fend = fp + textPtr->nFrags;
- fp < fend; fp++) {
- DrawChars(hDC, fp->sx, fp->sy, fp->text, fp->count);
- }
- }
- if (color2 != NULL) {
- SetTextColor(hDC, color2->pixel);
- for (fp = textPtr->fragments, fend = fp + textPtr->nFrags;
- fp < fend; fp++) {
- DrawChars(hDC, fp->sx + 1, fp->sy + 1, fp->text, fp->count);
- }
- }
- goto done; /* Done */
- }
- SetBkMode(hDC, TRANSPARENT);
- SetTextColor(hDC, tsPtr->color->pixel);
- for (fp = textPtr->fragments, fend = fp + textPtr->nFrags; fp < fend;
- fp++) {
- DrawChars(hDC, fp->sx, fp->sy, fp->text, fp->count);
- }
- done:
- SelectFont(hDC, oldFont);
- DeleteFont(hFont);
- TkWinReleaseDrawableDC(drawable, hDC, &state);
- return TRUE;
-}
-#endif
-
-static void
-DrawPixel(
- HDC hDC,
- int x, int y,
- COLORREF color)
-{
- HDC memDC;
- HBRUSH hBrushFg;
- HBITMAP oldBitmap, hBitmap;
- RECT rect;
- int size;
-
- size = 1;
- memDC = CreateCompatibleDC(hDC);
- hBrushFg = CreateSolidBrush(color);
- hBitmap = CreateCompatibleBitmap(hDC, size, size);
- oldBitmap = SelectObject(memDC, hBitmap);
- rect.left = rect.top = 0;
- rect.right = rect.bottom = size;
- FillRect(memDC, &rect, hBrushFg);
- BitBlt(hDC, x, y, size, size, memDC, 0, 0, SRCCOPY);
- SelectObject(memDC, oldBitmap);
- DeleteObject(hBitmap);
- DeleteBrush(hBrushFg);
- DeleteDC(memDC);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PixelateBitmap --
- *
- * Draws a masked bitmap in given device (should be printer)
- * context. Bit operations on print devices usually fail because
- * there's no way to read back from the device surface to get the
- * previous pixel values, rendering BitBlt useless. The bandaid
- * solution here is to draw 1x1 pixel rectangles at each
- * coordinate as directed by the the mask and source bitmaps.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Draws onto the specified drawable.
- *
- *---------------------------------------------------------------------------
- */
-static void
-PixelateBitmap(
- Display *display,
- Drawable drawable,
- Pixmap srcBitmap,
- Pixmap maskBitmap,
- int width,
- int height,
- GC gc,
- int destX,
- int destY)
-{
- int x, y;
- int dx, dy;
- int pixel;
- unsigned char *srcBits;
- unsigned char *srcPtr;
- int bitPos, bytesPerRow;
- HDC hDC;
- TkWinDCState state;
-
- srcBits = Blt_GetBitmapData(display, srcBitmap, width, height,
- &bytesPerRow);
- if (srcBits == NULL) {
- return;
- }
- hDC = TkWinGetDrawableDC(display, drawable, &state);
- if (maskBitmap != None) {
- unsigned char *maskPtr;
- unsigned char *maskBits;
- maskBits = Blt_GetBitmapData(display, maskBitmap, width, height,
- &bytesPerRow);
- bytesPerRow = ((width + 31) & ~31) / 8;
- for (dy = destY, y = height - 1; y >= 0; y--, dy++) {
- maskPtr = maskBits + (bytesPerRow * y);
- srcPtr = srcBits + (bytesPerRow * y);
- for (dx = destX, x = 0; x < width; x++, dx++) {
- bitPos = x % 8;
- pixel = (*maskPtr & (0x80 >> bitPos));
- if (pixel) {
- pixel = (*srcPtr & (0x80 >> bitPos));
- DrawPixel(hDC, dx, dy,
- (pixel) ? gc->foreground : gc->background);
- }
- if (bitPos == 7) {
- srcPtr++, maskPtr++;
- }
- } /* x */
- }
- Blt_Free(maskBits);
- } else {
- bytesPerRow = ((width + 31) & ~31) / 8;
- for (dy = destY, y = height - 1; y >= 0; y--, dy++) {
- srcPtr = srcBits + (bytesPerRow * y);
- for (dx = destX, x = 0; x < width; x++, dx++) {
- bitPos = x % 8;
- pixel = (*srcPtr & (0x80 >> bitPos));
- DrawPixel(hDC, dx, dy,
- (pixel) ? gc->foreground : gc->background);
- if (bitPos == 7) {
- srcPtr++;
- }
- }
- }
- }
- TkWinReleaseDrawableDC(drawable, hDC, &state);
- Blt_Free(srcBits);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_EmulateXCopyPlane --
- *
- * Simplified version of XCopyPlane. Right now it ignores
- * function,
- * clip_x_origin,
- * clip_y_origin
- *
- * The plane argument must always be 1.
- *
- * This routine differs from the Tk version in how it handles
- * transparency. It uses a different method of drawing transparent
- * bitmaps that doesn't copy the background or use brushes. The
- * second change is to call a special routine when the destDC is
- * a printer. Stippling is done by a very slow brute-force
- * method of drawing 1x1 rectangles for each pixel (bleech).
- *
- * Results:
- * None.
- *
- * Side effects:
- * Changes the destination drawable.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXCopyPlane(
- Display *display,
- Drawable src, Drawable dest,
- GC gc,
- int srcX, int srcY,
- unsigned int width, unsigned int height,
- int destX, int destY,
- unsigned long plane)
-{
- HDC srcDC, destDC;
- TkWinDCState srcState, destState;
- TkpClipMask *clipPtr = (TkpClipMask *) gc->clip_mask;
-
- display->request++;
-
- if (plane != 1) {
- panic("Unexpected plane specified for XCopyPlane");
- }
- srcDC = TkWinGetDrawableDC(display, src, &srcState);
-
- if (src != dest) {
- destDC = TkWinGetDrawableDC(display, dest, &destState);
- } else {
- destDC = srcDC;
- }
- if ((clipPtr == NULL) || (clipPtr->type == TKP_CLIP_REGION)) {
- /*
- * Case 1: opaque bitmaps. Windows handles the conversion
- * from one bit to multiple bits by setting 0 to the
- * foreground color, and 1 to the background color (seems
- * backwards, but there you are).
- */
- if ((clipPtr != NULL) && (clipPtr->type == TKP_CLIP_REGION)) {
- SelectClipRgn(destDC, (HRGN) clipPtr->value.region);
- OffsetClipRgn(destDC, gc->clip_x_origin, gc->clip_y_origin);
- }
- SetBkMode(destDC, OPAQUE);
- SetBkColor(destDC, gc->foreground);
- SetTextColor(destDC, gc->background);
- BitBlt(destDC, destX, destY, width, height, srcDC, srcX, srcY,
- SRCCOPY);
-
- SelectClipRgn(destDC, NULL);
-
- } else if (clipPtr->type == TKP_CLIP_PIXMAP) {
- Drawable mask;
- /*
- * Case 2: transparent bitmaps are handled by setting the
- * destination to the foreground color whenever the source
- * pixel is set.
- */
- /*
- * Case 3: two arbitrary bitmaps. Copy the source rectangle
- * into a color pixmap. Use the result as a brush when
- * copying the clip mask into the destination.
- */
- mask = clipPtr->value.pixmap;
-
-#if WINDEBUG
- PurifyPrintf("mask %s src\n", (mask == src) ? "==" : "!=");
- PurifyPrintf("GetDeviceCaps=%x\n",
- GetDeviceCaps(destDC, TECHNOLOGY) & TABLE_RASDISPLAY);
-#endif
- {
- HDC maskDC;
- TkWinDCState maskState;
-
- if (mask != src) {
- maskDC = TkWinGetDrawableDC(display, mask, &maskState);
- } else {
- maskDC = srcDC;
- }
- SetBkMode(destDC, OPAQUE);
- SetTextColor(destDC, gc->background);
- SetBkColor(destDC, gc->foreground);
- BitBlt(destDC, destX, destY, width, height, srcDC, srcX, srcY,
- SRCINVERT);
- /*
- * Make sure we treat the mask as a monochrome bitmap.
- * We can get alpha-blending with non-black/white fg/bg
- * color selections.
- */
- SetTextColor(destDC, RGB(255,255,255));
- SetBkColor(destDC, RGB(0,0,0));
-
- /* FIXME: Handle gc->clip_?_origin's */
- BitBlt(destDC, destX, destY, width, height, maskDC, 0, 0, SRCAND);
-
- SetTextColor(destDC, gc->background);
- SetBkColor(destDC, gc->foreground);
- BitBlt(destDC, destX, destY, width, height, srcDC, srcX, srcY,
- SRCINVERT);
- if (mask != src) {
- TkWinReleaseDrawableDC(mask, maskDC, &maskState);
- }
- }
- }
- if (src != dest) {
- TkWinReleaseDrawableDC(dest, destDC, &destState);
- }
- TkWinReleaseDrawableDC(src, srcDC, &srcState);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_EmulateXCopyArea --
- *
- * Copies data from one drawable to another using block transfer
- * routines. The small enhancement over the version in Tk is
- * that it doesn't assume that the source and destination devices
- * have the same resolution. This isn't true when the destination
- * device is a printer.
- *
- * FIXME: not true anymore. delete this routine.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Data is moved from a window or bitmap to a second window,
- * bitmap, or printer.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXCopyArea(
- Display *display,
- Drawable src,
- Drawable dest,
- GC gc,
- int srcX, /* Source X-coordinate */
- int srcY, /* Source Y-coordinate. */
- unsigned int width, /* Width of area. */
- unsigned int height, /* Height of area. */
- int destX, /* Destination X-coordinate (in screen
- * coordinates). */
- int destY) /* Destination Y-coordinate (in screen
- * coordinates). */
-{
- HDC srcDC, destDC;
- TkWinDCState srcState, destState;
- TkpClipMask *clipPtr;
-
- srcDC = TkWinGetDrawableDC(display, src, &srcState);
- if (src != dest) {
- destDC = TkWinGetDrawableDC(display, dest, &destState);
- } else {
- destDC = srcDC;
- }
- clipPtr = (TkpClipMask *)gc->clip_mask;
- if ((clipPtr != NULL) && (clipPtr->type == TKP_CLIP_REGION)) {
- SelectClipRgn(destDC, (HRGN)clipPtr->value.region);
- OffsetClipRgn(destDC, gc->clip_x_origin, gc->clip_y_origin);
- }
-
- BitBlt(destDC, destX, destY, width, height, srcDC, srcX, srcY,
- bltModes[gc->function]);
- SelectClipRgn(destDC, NULL);
-
- if (src != dest) {
- TkWinReleaseDrawableDC(dest, destDC, &destState);
- }
- TkWinReleaseDrawableDC(src, srcDC, &srcState);
-}
-
-static void
-StippleArea(
- Display *display,
- HDC hDC, /* Device context: For polygons, clip
- * region will be installed. */
- GC gc,
- int x, int y,
- int width, int height)
-{
- BITMAP bm;
- HBITMAP oldBitmap;
- HDC maskDC, memDC;
- Pixmap mask;
- TkWinDCState maskState;
- TkWinDrawable *twdPtr;
- int dx, dy;
- int left, top, right, bottom;
- int startX, startY; /* Starting upper left corner of region. */
-
- twdPtr = (TkWinDrawable *)gc->stipple;
- GetObject(twdPtr->bitmap.handle, sizeof(BITMAP), &bm);
-
- startX = x;
- if (x < gc->ts_x_origin) {
- dx = (gc->ts_x_origin - x) % bm.bmWidth;
- if (dx > 0) {
- startX -= (bm.bmWidth - dx);
- }
- } else if (x > gc->ts_x_origin) {
- dx = (x - gc->ts_x_origin) % bm.bmWidth;
- if (dx > 0) {
- startX -= dx;
- }
- }
- startY = y;
- if (y < gc->ts_y_origin) {
- dy = (gc->ts_y_origin - y) % bm.bmHeight;
- if (dy > 0) {
- startY -= (bm.bmHeight - dy);
- }
- } else if (y >= gc->ts_y_origin) {
- dy = (y - gc->ts_y_origin) % bm.bmHeight;
- if (dy > 0) {
- startY -= dy;
- }
- }
-#ifdef notdef
- PurifyPrintf("tile is (%d,%d,%d,%d)\n", gc->ts_x_origin, gc->ts_y_origin,
- bm.bmWidth, bm.bmHeight);
- PurifyPrintf("region is (%d,%d,%d,%d)\n", x, y, width, height);
- PurifyPrintf("starting at %d,%d\n", startX, startY);
-#endif
- left = x;
- right = x + width;
- top = y;
- bottom = y + height;
-
- maskDC = memDC = CreateCompatibleDC(hDC);
- oldBitmap = SelectBitmap(memDC, twdPtr->bitmap.handle);
- mask = gc->stipple;
- if (gc->fill_style == FillStippled) { /* With transparency. */
- if (gc->clip_mask != None) {
- TkpClipMask *clipPtr;
-
- mask = gc->stipple;
- clipPtr = (TkpClipMask *)gc->clip_mask;
- if (clipPtr->type == TKP_CLIP_PIXMAP) {
- mask = clipPtr->value.pixmap;
- }
- }
- if (mask != gc->stipple) {
- maskDC = TkWinGetDrawableDC(display, mask, &maskState);
- }
- }
-
- for (y = startY; y < bottom; y += bm.bmHeight) {
- int srcX, srcY;
- int destX, destY, destWidth, destHeight;
-
- srcY = 0;
- destY = y;
- destHeight = bm.bmHeight;
- if (y < top) {
- srcY = (top - y);
- destHeight = bm.bmHeight - srcY;
- destY = top;
- }
- if ((destY + destHeight) > bottom) {
- destHeight = (bottom - destY);
- }
- for (x = startX; x < right; x += bm.bmWidth) {
- srcX = 0;
- destX = x;
- destWidth = bm.bmWidth;
- if (x < left) {
- srcX = (left - x);
- destWidth = bm.bmWidth - srcX;
- destX = left;
- }
- if ((destX + destWidth) > right) {
- destWidth = (right - destX);
- }
-#ifdef notdef
- PurifyPrintf("drawing pattern (%d,%d,%d,%d) at %d,%d\n",
- srcX , srcY, destWidth, destHeight, destX, destY);
-#endif
- if (gc->fill_style == FillStippled) { /* With transparency. */
- SetBkMode(hDC, OPAQUE);
- SetTextColor(hDC, gc->background);
- SetBkColor(hDC, gc->foreground);
- BitBlt(hDC, destX, destY, destWidth, destHeight, memDC,
- srcX, srcY, SRCINVERT);
- SetTextColor(hDC, RGB(255,255,255));
- SetBkColor(hDC, RGB(0,0,0));
- BitBlt(hDC, destX, destY, destWidth, destHeight, maskDC,
- srcX, srcY, SRCAND);
- SetTextColor(hDC, gc->background);
- SetBkColor(hDC, gc->foreground);
- BitBlt(hDC, destX, destY, destWidth, destHeight, memDC,
- srcX, srcY, SRCINVERT);
- } else if (gc->fill_style == FillOpaqueStippled) { /* Opaque. */
- SetBkColor(hDC, gc->foreground);
- SetTextColor(hDC, gc->background);
- BitBlt(hDC, destX, destY, destWidth, destHeight, memDC,
- srcX, srcY, SRCCOPY);
- }
- }
- }
- SelectBitmap(memDC, oldBitmap);
- if (maskDC != memDC) {
- TkWinReleaseDrawableDC(mask, maskDC, &maskState);
- }
- DeleteDC(memDC);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_EmulateXFillPolygon --
- *
- * This differs from Tk's XFillPolygon in that it works around
- * deficencies in Windows 95/98:
- * 1. Stippling bitmap is limited to 8x8.
- * 2. No tiling (with or without mask).
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_EmulateXFillPolygon(
- Display *display,
- Drawable drawable,
- GC gc,
- XPoint *points,
- int nPoints,
- int shape,
- int mode)
-{
- HDC hDC;
- int left, right, top, bottom;
- TkWinDCState state;
- int fillMode;
- POINT *winPts;
-
- if (drawable == None) {
- return;
- }
- /* Allocate array of POINTS to create the polygon's path. */
- winPts = Blt_Malloc(sizeof(POINT) * nPoints);
- if (winPts == NULL) {
- return;
- }
- {
- POINT *wp;
- XPoint *p, *pend;
-
- /* Determine the bounding box of the polygon. */
- left = right = points[0].x;
- top = bottom = points[0].y;
-
- wp = winPts;
- for (p = points, pend = p + nPoints; p < pend; p++) {
- if (p->x < left) {
- left = p->x;
- }
- if (p->x > right) {
- right = p->x;
- }
- if (p->y < top) {
- top = p->y;
- }
- if (p->y > bottom) {
- bottom = p->y;
- }
- wp->x = p->x;
- wp->y = p->y;
- wp++;
- }
- }
-
- hDC = TkWinGetDrawableDC(display, drawable, &state);
- SetROP2(hDC, tkpWinRopModes[gc->function]);
- fillMode = (gc->fill_rule == EvenOddRule) ? ALTERNATE : WINDING;
-
- if ((gc->fill_style == FillStippled) ||
- (gc->fill_style == FillOpaqueStippled)) {
-#ifndef notdef
- POINT *wp, *wend;
- HRGN hRgn;
-
- /* Points are offsets within the bounding box. */
- for (wp = winPts, wend = wp + nPoints; wp < wend; wp++) {
- wp->x -= left;
- wp->y -= top;
- }
- /* Use the polygon as a clip path. */
- LPtoDP(hDC, winPts, nPoints);
- hRgn = CreatePolygonRgn(winPts, nPoints, fillMode);
- SelectClipRgn(hDC, hRgn);
- OffsetClipRgn(hDC, left, top);
-
- /* Tile the bounding box. */
- StippleArea(display, hDC, gc, left, top, right - left + 1, bottom - top + 1);
- SelectClipRgn(hDC, NULL), DeleteRgn(hRgn);
-#else
- TkWinDrawable *twdPtr;
- HBITMAP hBitmap;
- HBRUSH hBrush, oldBrush;
- HPEN hPen, oldPen;
- HDC hMem;
- HBITMAP oldBitmap;
-
- twdPtr = (TkWinDrawable *)gc->stipple;
- if (twdPtr->type != TWD_BITMAP) {
- panic("unexpected drawable type in stipple");
- }
- {
- BITMAP bm;
- int bytesPerRow;
- int y;
- unsigned char *srcRowPtr;
- unsigned char *bits;
-
- GetObject(twdPtr->bitmap.handle, sizeof(BITMAP), &bm);
- bits = Blt_GetBitmapData(display, gc->stipple, bm.bmWidth, bm.bmHeight,
- &bytesPerRow);
- if (bits == NULL) {
- panic("help me");
- }
- srcRowPtr = bits;
- for (y = 0; y < bm.bmHeight; y++) {
- unsigned char *bp, *bend;
- for (bp = srcRowPtr, bend = bp + bytesPerRow; bp < bend; bp++) {
- *bp = ~*bp;
- }
- srcRowPtr += bytesPerRow;
- }
- bm.bmBits = bits;
- bm.bmType = 0;
- bm.bmPlanes = 1;
- bm.bmBitsPixel = 1;
- hBitmap = CreateBitmapIndirect(&bm);
- Blt_Free(bits);
- }
- /* hBrush = CreatePatternBrush(twdPtr->bitmap.handle); */
- hBrush = CreateHatchBrush(HS_VERTICAL, gc->foreground);
- SetBrushOrgEx(hDC, gc->ts_x_origin, gc->ts_y_origin, NULL);
- hPen = GetStockObject(NULL_PEN);
- SetTextColor(hDC, gc->foreground);
- SetBkMode(hDC, TRANSPARENT);
- oldPen = SelectPen(hDC, hPen);
- oldBrush = SelectBrush(hDC, hBrush);
- if (gc->fill_style == FillOpaqueStippled) {
- SetBkColor(hDC, gc->background);
- } else {
- SetBkMode(hDC, TRANSPARENT);
- }
- SetPolyFillMode(hDC, fillMode);
- Polygon(hDC, winPts, nPoints);
- SelectPen(hDC, oldPen), DeletePen(hPen);
- SelectBrush(hDC, oldBrush), DeleteBrush(hBrush);
-#endif
- } else {
- HPEN hPen, oldPen;
- HBRUSH hBrush, oldBrush;
-
- /*
- * FIXME: Right now, we're assuming that it's solid or
- * stippled and ignoring tiling. I'll merge the bits from
- * Blt_TilePolygon later.
- */
- hPen = GetStockObject(NULL_PEN);
- oldPen = SelectPen(hDC, hPen);
- hBrush = CreateSolidBrush(gc->foreground);
- oldBrush = SelectBrush(hDC, hBrush);
- SetPolyFillMode(hDC, fillMode);
- Polygon(hDC, winPts, nPoints);
- SelectPen(hDC, oldPen), DeletePen(hPen);
- SelectBrush(hDC, oldBrush), DeleteBrush(hBrush);
- }
- Blt_Free(winPts);
- TkWinReleaseDrawableDC(drawable, hDC, &state);
-}
-
-
-static void
-DrawTextOut(
- HDC hDC, /* HDC to draw into. */
- HFONT hFont, /* Contains set of fonts to use when drawing
- * following string. */
- const char *text, /* Potentially multilingual UTF-8 string. */
- size_t length, /* Length of string in bytes. */
- int x, int y) /* Coordinates at which to place origin *
- * of string when drawing. */
-{
- HFONT oldFont;
- Tcl_Encoding encoding;
- TEXTMETRIC tm;
-
- oldFont = SelectFont(hDC, hFont);
- encoding = Tcl_GetEncoding(NULL, "unicode");
- GetTextMetrics(hDC, &tm);
- x -= tm.tmOverhang /2;
- if (encoding == NULL) {
- TextOutA(hDC, x, y, text, length);
- } else {
- Tcl_DString ds;
- const unsigned short *wideText;
- int wideLength;
-
- Tcl_DStringInit(&ds);
- Tcl_UtfToExternalDString(encoding, text, length, &ds);
- wideLength = Tcl_DStringLength(&ds) >> 1;
- wideText = (const unsigned short *)Tcl_DStringValue(&ds);
- TextOutW(hDC, x, y, wideText, wideLength);
- Tcl_DStringFree(&ds);
- }
- SelectFont(hDC, oldFont);
-}
-
-void
-Blt_TextOut(
- HDC hDC,
- GC gc, /* Graphics context for drawing characters. */
- HFONT hFont, /* Font in which characters will be drawn;
- * must be the same as font used in GC. */
- const char *text, /* UTF-8 string to be displayed. Need not be
- * '\0' terminated. All Tk meta-characters
- * (tabs, control characters, and newlines)
- * should be stripped out of the string that
- * is passed to this function. If they are
- * not stripped out, they will be displayed as
- * regular printing characters. */
- int nBytes, /* Number of bytes in string. */
- int x, int y) /* Coordinates at which to place origin of
- * string when drawing. */
-{
- TEXTMETRIC tm;
-
-
- SetROP2(hDC, bltModes[gc->function]);
- if ((gc->clip_mask != None) &&
- ((TkpClipMask*)gc->clip_mask)->type == TKP_CLIP_REGION) {
- SelectClipRgn(hDC, (HRGN)((TkpClipMask*)gc->clip_mask)->value.region);
- }
- if (((gc->fill_style == FillStippled) ||
- (gc->fill_style == FillOpaqueStippled)) &&
- (gc->stipple != None)) {
- TkWinDrawable *twdPtr = (TkWinDrawable *)gc->stipple;
- HBRUSH oldBrush, hBrush;
- HBITMAP oldBitmap, hBitmap;
- HDC memDC;
- TEXTMETRIC tm;
- SIZE size;
-
- if (twdPtr->type != TWD_BITMAP) {
- Tcl_Panic("unexpected drawable type in stipple");
- }
-
- /*
- * Select stipple pattern into destination dc.
- */
- memDC = CreateCompatibleDC(hDC);
- hBrush = CreatePatternBrush(twdPtr->bitmap.handle);
- SetBrushOrgEx(hDC, gc->ts_x_origin, gc->ts_y_origin, NULL);
- oldBrush = SelectBrush(hDC, hBrush);
-
- SetTextAlign(memDC, TA_LEFT | TA_BASELINE);
- SetTextColor(memDC, gc->foreground);
- SetBkMode(memDC, TRANSPARENT);
- SetBkColor(memDC, RGB(0, 0, 0));
-
- /*
- * Compute the bounding box and create a compatible bitmap.
- */
- GetTextExtentPoint(memDC, text, nBytes, &size);
- GetTextMetrics(memDC, &tm);
- size.cx -= tm.tmOverhang;
- hBitmap = CreateCompatibleBitmap(hDC, size.cx, size.cy);
- oldBitmap = SelectBitmap(memDC, hBitmap);
- /*
- * The following code is tricky because fonts are rendered in multiple
- * colors. First we draw onto a black background and copy the white
- * bits. Then we draw onto a white background and copy the black bits.
- * Both the foreground and background bits of the font are ANDed with
- * the stipple pattern as they are copied.
- */
- PatBlt(memDC, 0, 0, size.cx, size.cy, BLACKNESS);
- DrawTextOut(hDC, hFont, text, nBytes, x, y);
- BitBlt(hDC, x, y-tm.tmAscent, size.cx, size.cy, memDC, 0, 0, 0xEA02E9);
- PatBlt(memDC, 0, 0, size.cx, size.cy, WHITENESS);
- DrawTextOut(hDC, hFont, text, nBytes, x, y);
- BitBlt(hDC, x, y-tm.tmAscent, size.cx, size.cy, memDC, 0, 0, 0x8A0E06);
-
- /*
- * Destroy the temporary bitmap and restore the device context.
- */
- SelectBrush(memDC, oldBitmap);
- DeleteBitmap(hBitmap);
- DeleteDC(memDC);
- SelectBrush(hDC, oldBrush);
- DeleteBrush(hBrush);
- } else if (gc->function == GXcopy) {
- SetTextAlign(hDC, TA_LEFT | TA_BASELINE);
- SetTextColor(hDC, gc->foreground);
- SetBkMode(hDC, TRANSPARENT);
- DrawTextOut(hDC, hFont, text, nBytes, x, y);
- } else {
- HBITMAP oldBitmap, hBitmap;
- HDC memDC;
- TEXTMETRIC tm;
- SIZE size;
-
- memDC = CreateCompatibleDC(hDC);
- SetTextAlign(memDC, TA_LEFT | TA_BASELINE);
- SetTextColor(memDC, gc->foreground);
- SetBkMode(memDC, TRANSPARENT);
- SetBkColor(memDC, RGB(0, 0, 0));
-
- /*
- * Compute the bounding box and create a compatible bitmap.
- */
- GetTextExtentPoint(memDC, text, nBytes, &size);
- GetTextMetrics(memDC, &tm);
- size.cx -= tm.tmOverhang;
- hBitmap = CreateCompatibleBitmap(hDC, size.cx, size.cy);
- oldBitmap = SelectObject(memDC, hBitmap);
-
- DrawTextOut(memDC, hFont, text, nBytes, 0, tm.tmAscent);
- BitBlt(hDC, x, y - tm.tmAscent, size.cx, size.cy, memDC, 0, 0,
- bltModes[gc->function]);
- SelectBitmap(memDC, oldBitmap);
- DeleteBitmap(hBitmap);
- DeleteDC(memDC);
- }
-}
-
diff --git a/blt3.0.1/src/bltWinFont.c b/blt3.0.1/src/bltWinFont.c
deleted file mode 100644
index b8bcb05..0000000
--- a/blt3.0.1/src/bltWinFont.c
+++ /dev/null
@@ -1,1690 +0,0 @@
-/*
- * bltWinFont.c --
- *
- * This module implements rotated fonts for the BLT toolkit.
- *
- * Copyright 2005 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include <bltHash.h>
-#include "tkDisplay.h"
-#include "tkFont.h"
-
-#include "bltFont.h"
-
-#define WINDEBUG 0
-#define DEBUG_FONT_SELECTION 0
-#define DEBUG_FONT_SELECTION2 0
-
-typedef struct _Blt_Font _Blt_Font;
-
-enum FontTypes {
- FONT_UNKNOWN, /* Unknown font type. */
- FONT_TK, /* Normal Tk font. */
- FONT_WIN /* Windows font. */
-};
-
-#ifndef HAVE_LIBXFT
-#define FC_WEIGHT_THIN 0
-#define FC_WEIGHT_EXTRALIGHT 40
-#define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT
-#define FC_WEIGHT_LIGHT 50
-#define FC_WEIGHT_BOOK 75
-#define FC_WEIGHT_REGULAR 80
-#define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR
-#define FC_WEIGHT_MEDIUM 100
-#define FC_WEIGHT_DEMIBOLD 180
-#define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD
-#define FC_WEIGHT_BOLD 200
-#define FC_WEIGHT_EXTRABOLD 205
-#define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD
-#define FC_WEIGHT_BLACK 210
-#define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK
-#define FC_WEIGHT_EXTRABLACK 215
-#define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK
-
-#define FC_SLANT_ROMAN 0
-#define FC_SLANT_ITALIC 100
-#define FC_SLANT_OBLIQUE 110
-
-#define FC_WIDTH_ULTRACONDENSED 50
-#define FC_WIDTH_EXTRACONDENSED 63
-#define FC_WIDTH_CONDENSED 75
-#define FC_WIDTH_SEMICONDENSED 87
-#define FC_WIDTH_NORMAL 100
-#define FC_WIDTH_SEMIEXPANDED 113
-#define FC_WIDTH_EXPANDED 125
-#define FC_WIDTH_EXTRAEXPANDED 150
-#define FC_WIDTH_ULTRAEXPANDED 200
-
-#define FC_PROPORTIONAL 0
-#define FC_DUAL 90
-#define FC_MONO 100
-#define FC_CHARCELL 110
-
-#define FC_ANTIALIAS "antialias" /* Bool (depends) */
-#define FC_AUTOHINT "autohint" /* Bool (false) */
-#define FC_DECORATIVE "decorative" /* Bool */
-#define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool */
-#define FC_EMBOLDEN "embolden" /* Bool */
-#define FC_FAMILY "family" /* String */
-#define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */
-#define FC_HINTING "hinting" /* Bool (true) */
-#define FC_MINSPACE "minspace" /* Bool */
-#define FC_OUTLINE "outline" /* Bool */
-#define FC_SCALABLE "scalable" /* Bool */
-#define FC_SIZE "size" /* Double */
-#define FC_SLANT "slant" /* Int */
-#define FC_SPACING "spacing" /* Int */
-#define FC_STYLE "style" /* String */
-#define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */
-#define FC_WEIGHT "weight" /* Int */
-#define FC_WIDTH "width" /* Int */
-
-#endif
-
-#ifndef FC_WEIGHT_EXTRABLACK
-#define FC_WEIGHT_EXTRABLACK 215
-#define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK
-#endif
-
-typedef struct {
- char *family;
- const char *weight;
- const char *slant;
- const char *width;
- const char *spacing;
- int size; /* If negative, pixels, else points */
-} FontPattern;
-
-typedef struct {
- const char *name;
- int minChars;
- const char *key;
- int value;
- const char *oldvalue;
-} FontSpec;
-
-static FontSpec fontSpecs[] = {
- { "black", 2, FC_WEIGHT, FC_WEIGHT_BLACK, "*"},
- { "bold", 3, FC_WEIGHT, FC_WEIGHT_BOLD, "bold"},
- { "book", 3, FC_WEIGHT, FC_WEIGHT_MEDIUM, "medium"},
- { "charcell", 2, FC_SPACING, FC_CHARCELL, "c"},
- { "condensed", 2, FC_WIDTH, FC_WIDTH_CONDENSED, "condensed"},
- { "demi", 4, FC_WEIGHT, FC_WEIGHT_BOLD, "semi"},
- { "demibold", 5, FC_WEIGHT, FC_WEIGHT_DEMIBOLD, "semibold"},
- { "dual", 2, FC_SPACING, FC_DUAL, "*"},
- { "i", 1, FC_SLANT, FC_SLANT_ITALIC, "i"},
- { "italic", 2, FC_SLANT, FC_SLANT_ITALIC, "italic"},
- { "light", 1, FC_WEIGHT, FC_WEIGHT_LIGHT, "light"},
- { "medium", 2, FC_WEIGHT, FC_WEIGHT_MEDIUM, "medium"},
- { "mono", 2, FC_SPACING, FC_MONO, "m"},
- { "normal", 1, FC_WEIGHT, FC_WEIGHT_MEDIUM, "normal"},
- { "o", 1, FC_SLANT, FC_SLANT_OBLIQUE, "o"},
- { "obilque", 2, FC_SLANT, FC_SLANT_OBLIQUE, "o"},
- { "overstrike", 2, NULL, 0, "*"},
- { "proportional", 1, FC_SPACING, FC_PROPORTIONAL, "p"},
- { "r", 1, FC_SLANT, FC_SLANT_ROMAN, "r"},
- { "roman", 2, FC_SLANT, FC_SLANT_ROMAN, "roman"},
- { "semibold", 5, FC_WEIGHT, FC_WEIGHT_DEMIBOLD, "semibold"},
- { "semicondensed",5, FC_WIDTH, FC_WIDTH_SEMICONDENSED, "semicondensed"},
- { "underline", 1, NULL, 0, "*"},
-};
-static int nFontSpecs = sizeof(fontSpecs) / sizeof(FontSpec);
-
-static FontSpec weightSpecs[] ={
- { "black", 2, FC_WEIGHT, FC_WEIGHT_BLACK, "bold"},
- { "bold", 3, FC_WEIGHT, FC_WEIGHT_BOLD, "bold"},
- { "book", 3, FC_WEIGHT, FC_WEIGHT_MEDIUM, "*"},
- { "demi", 4, FC_WEIGHT, FC_WEIGHT_BOLD, "*"},
- { "demibold", 5, FC_WEIGHT, FC_WEIGHT_DEMIBOLD, "*"},
- { "extrablack", 6, FC_WEIGHT, FC_WEIGHT_EXTRABLACK, "*"},
- { "extralight", 6, FC_WEIGHT, FC_WEIGHT_EXTRALIGHT, "*"},
- { "heavy", 1, FC_WEIGHT, FC_WEIGHT_HEAVY, "*"},
- { "light", 1, FC_WEIGHT, FC_WEIGHT_LIGHT, "light"},
- { "medium", 1, FC_WEIGHT, FC_WEIGHT_MEDIUM, "medium"},
- { "normal", 1, FC_WEIGHT, FC_WEIGHT_MEDIUM, "normal"},
- { "regular", 1, FC_WEIGHT, FC_WEIGHT_REGULAR, "medium"},
- { "semibold", 1, FC_WEIGHT, FC_WEIGHT_SEMIBOLD, "semibold"},
- { "thin", 1, FC_WEIGHT, FC_WEIGHT_THIN, "thin"},
- { "ultrablack", 7, FC_WEIGHT, FC_WEIGHT_ULTRABLACK, "*"},
- { "ultrabold", 7, FC_WEIGHT, FC_WEIGHT_ULTRABOLD, "*"},
- { "ultralight", 6, FC_WEIGHT, FC_WEIGHT_ULTRALIGHT, "*"},
-};
-static int nWeightSpecs = sizeof(weightSpecs) / sizeof(FontSpec);
-
-static FontSpec slantSpecs[] ={
- { "i", 1, FC_SLANT, FC_SLANT_ITALIC, "italic"},
- { "italic", 2, FC_SLANT, FC_SLANT_ITALIC, "italic"},
- { "o", 1, FC_SLANT, FC_SLANT_OBLIQUE, "o"},
- { "obilque", 3, FC_SLANT, FC_SLANT_OBLIQUE, "o"},
- { "r", 1, FC_SLANT, FC_SLANT_ROMAN, "roman"},
- { "roman", 2, FC_SLANT, FC_SLANT_ROMAN, "roman"},
-};
-static int nSlantSpecs = sizeof(slantSpecs) / sizeof(FontSpec);
-
-static FontSpec spacingSpecs[] = {
- { "charcell", 2, FC_SPACING, FC_CHARCELL, "c"},
- { "dual", 2, FC_SPACING, FC_DUAL, "*"},
- { "mono", 2, FC_SPACING, FC_MONO, "m"},
- { "proportional", 1, FC_SPACING, FC_PROPORTIONAL, "p"},
-};
-static int nSpacingSpecs = sizeof(spacingSpecs) / sizeof(FontSpec);
-
-#ifdef notdef
-static FontSpec widthSpecs[] ={
- { "condensed", 1, FC_WIDTH, FC_WIDTH_CONDENSED, "condensed"},
- { "expanded", 3, FC_WIDTH, FC_WIDTH_EXPANDED, "*"},
- { "extracondensed", 6, FC_WIDTH, FC_WIDTH_EXTRACONDENSED, "*"},
- { "extraexpanded", 6, FC_WIDTH, FC_WIDTH_EXTRAEXPANDED, "*"},
- { "normal", 1, FC_WIDTH, FC_WIDTH_NORMAL, "normal"},
- { "semicondensed", 5, FC_WIDTH, FC_WIDTH_SEMICONDENSED, "semicondensed"},
- { "semiexpanded", 5, FC_WIDTH, FC_WIDTH_SEMIEXPANDED, "*"},
- { "ultracondensed", 6, FC_WIDTH, FC_WIDTH_ULTRACONDENSED, "*"},
- { "ultraexpanded", 6, FC_WIDTH, FC_WIDTH_ULTRAEXPANDED, "*"},
-};
-static int nWidthSpecs = sizeof(widthSpecs) / sizeof(FontSpec);
-
-static FontSpec boolSpecs[] ={
- { "antialias", 1, FC_ANTIALIAS, },
- { "decorative", 1, FC_DECORATIVE, },
- { "embeddedbitmap", 4, FC_EMBEDDED_BITMAP, },
- { "embolden", 4, FC_EMBOLDEN, },
- { "globaladvance", 1, FC_GLOBAL_ADVANCE, },
- { "hinting", 1, FC_HINTING, },
- { "minspace", 1, FC_MINSPACE, },
- { "outline", 1, FC_OUTLINE, },
- { "scalable", 1, FC_SCALABLE, },
- { "verticallayout", 1, FC_VERTICAL_LAYOUT, },
-};
-static int nBoolSpecs = sizeof(boolSpecs) / sizeof(FontSpec);
-#endif
-
-static Blt_HashTable fontTable;
-static Blt_HashTable aliasTable;
-static int initialized = 0;
-static void GetFontFamilies(Tk_Window tkwin, Blt_HashTable *tablePtr);
-
-enum XLFDFields {
- XLFD_FOUNDRY,
- XLFD_FAMILY,
- XLFD_WEIGHT,
- XLFD_SLANT,
- XLFD_SETWIDTH,
- XLFD_ADD_STYLE,
- XLFD_PIXEL_SIZE,
- XLFD_POINT_SIZE,
- XLFD_RESOLUTION_X,
- XLFD_RESOLUTION_Y,
- XLFD_SPACING,
- XLFD_AVERAGE_WIDTH,
- XLFD_CHARSET,
- XLFD_NUMFIELDS
-};
-
-/*
- * Freetype font container.
- */
-typedef struct {
- char *name; /* Name of the font (malloc-ed). */
- int refCount; /* Reference count for this structure. When
- * refCount reaches zero, it means to free the
- * resources associated with this
- * structure. */
-
- Blt_HashEntry *hashPtr; /* Pointer to this entry in global font hash
- * table. Used to remove the entry from the
- * table. */
-
- Blt_HashTable fontTable; /* Hash table containing an Xft font for each
- * angle it's used at. Will always contain a 0
- * degree entry. */
- Tk_Font tkfont;
-
-} RotatedFont;
-
-static double
-PointsToPixels(Tk_Window tkwin, int size)
-{
- double d;
-
- if (size < 0) {
- return -size;
- }
- d = size * 25.4 / 72.0;
- d *= WidthOfScreen(Tk_Screen(tkwin));
- d /= WidthMMOfScreen(Tk_Screen(tkwin));
- return d;
-}
-
-static double
-PixelsToPoints(Tk_Window tkwin, int size)
-{
- double d;
-
- if (size >= 0) {
- return size;
- }
- d = -size * 72.0 / 25.4;
- d *= WidthMMOfScreen(Tk_Screen(tkwin));
- d /= WidthOfScreen(Tk_Screen(tkwin));
- return d;
-}
-
-static void
-ParseXLFD(const char *fontName, int *argcPtr, char ***argvPtr)
-{
- char *p, *pend, *desc, *buf;
- size_t arrayLen, stringLen;
- int count;
- char **field;
-
- arrayLen = (sizeof(char *) * (XLFD_NUMFIELDS + 1));
- stringLen = strlen(fontName);
- buf = Blt_AssertCalloc(1, arrayLen + stringLen + 1);
- desc = buf + arrayLen;
- strcpy(desc, fontName);
- field = (char **)buf;
-
- count = 0;
- for (p = desc, pend = p + stringLen; p < pend; p++, count++) {
- char *word;
-
- field[count] = NULL;
- /* Get the next word, separated by dashes (-). */
- word = p;
- while ((*p != '\0') && (*p != '-')) {
- if (((*p & 0x80) == 0) && Tcl_UniCharIsUpper(UCHAR(*p))) {
- *p = (char)Tcl_UniCharToLower(UCHAR(*p));
- }
- p++;
- }
- if (*p != '\0') {
- *p = '\0';
- }
- if ((word[0] == '\0') ||
- (((word[0] == '*') || (word[0] == '?')) && (word[1] == '\0'))) {
- continue; /* Field not specified. -- -*- -?- */
- }
- field[count] = word;
- }
-
- /*
- * An XLFD of the form -adobe-times-medium-r-*-12-*-* is pretty common,
- * but it is (strictly) malformed, because the first * is eliding both the
- * Setwidth and the Addstyle fields. If the Addstyle field is a number,
- * then assume the above incorrect form was used and shift all the rest of
- * the fields right by one, so the number gets interpreted as a pixelsize.
- * This fix is so that we don't get a million reports that "it works under
- * X (as a native font name), but gives a syntax error under Windows (as a
- * parsed set of attributes)".
- */
-
- if ((count > XLFD_ADD_STYLE) && (field[XLFD_ADD_STYLE] != NULL)) {
- int dummy;
-
- if (Tcl_GetInt(NULL, field[XLFD_ADD_STYLE], &dummy) == TCL_OK) {
- int j;
-
- for (j = XLFD_NUMFIELDS - 1; j >= XLFD_ADD_STYLE; j--) {
- field[j + 1] = field[j];
- }
- field[XLFD_ADD_STYLE] = NULL;
- count++;
- }
- }
- *argcPtr = count;
- *argvPtr = field;
-
- field[XLFD_NUMFIELDS] = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SearchForFontSpec --
- *
- * Performs a binary search on the array of font specification to find a
- * partial, anchored match for the given option string.
- *
- * Results:
- * If the string matches unambiguously the index of the specification in
- * the array is returned. If the string does not match, even as an
- * abbreviation, any operation, -1 is returned. If the string matches,
- * but ambiguously -2 is returned.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SearchForFontSpec(FontSpec *table, int nSpecs, const char *string, int length)
-{
- char c;
- int high, low;
-
- low = 0;
- high = nSpecs - 1;
- c = tolower((unsigned char)string[0]);
- while (low <= high) {
- FontSpec *sp;
- int compare;
- int median;
-
- median = (low + high) >> 1;
- sp = table + median;
-
- /* Test the first character */
- compare = c - sp->name[0];
- if (compare == 0) {
- /* Now test the entire string */
- compare = strncasecmp(string, sp->name, length);
- if (compare == 0) {
- if ((int)length < sp->minChars) {
- return -2; /* Ambiguous spec name */
- }
- }
- }
- if (compare < 0) {
- high = median - 1;
- } else if (compare > 0) {
- low = median + 1;
- } else {
- return median; /* Spec found. */
- }
- }
- return -1; /* Can't find spec */
-}
-
-static FontSpec *
-FindSpec(FontSpec *tablePtr, int nSpecs, const char *string, int length)
-{
- int n;
-
- n = SearchForFontSpec(tablePtr, nSpecs, string, length);
- if (n < 0) {
- if (n == -1) {
- fprintf(stderr, "unknown %s specification \"%s\"\n",
- tablePtr[n].key, string);
- }
- if (n == -2) {
- fprintf(stderr, "ambiguous %s specification \"%s\"\n",
- tablePtr[n].key, string);
- }
- return NULL;
- }
- return tablePtr + n;
-}
-
-
-typedef struct {
- const char *name, *aliases[10];
-} FontAlias;
-
-static FontAlias xlfdFontAliases[] = {
- { "math", {"mathematica1", "courier"}},
- { "serif", {"times"}},
- { "sans serif", { "arial" }},
- { "monospace", { "courier new" }},
- { NULL }
-};
-
-static void
-MakeAliasTable(Tk_Window tkwin)
-{
- Blt_HashTable familyTable;
- FontAlias *fp;
- FontAlias *table;
-
- Blt_InitHashTable(&familyTable, TCL_STRING_KEYS);
- GetFontFamilies(tkwin, &familyTable);
- Blt_InitHashTable(&aliasTable, TCL_STRING_KEYS);
- table = xlfdFontAliases;
- for(fp = table; fp->name != NULL; fp++) {
- Blt_HashEntry *hPtr;
- const char **alias;
-
- for (alias = fp->aliases; *alias != NULL; alias++) {
- hPtr = Blt_FindHashEntry(&familyTable, *alias);
- if (hPtr != NULL) {
- int isNew;
-
- hPtr = Blt_CreateHashEntry(&aliasTable, fp->name, &isNew);
- Blt_SetHashValue(hPtr, *alias);
- break;
- }
- }
- }
- Blt_DeleteHashTable(&familyTable);
-}
-
-static const char *
-GetAlias(const char *family)
-{
- Blt_HashEntry *hPtr;
-
- strtolower((char *)family);
- hPtr = Blt_FindHashEntry(&aliasTable, family);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- return family;
-}
-
-static Blt_NameOfFontProc TkNameOfFontProc;
-static Blt_GetFontMetricsProc TkGetFontMetricsProc;
-static Blt_FontIdProc TkFontIdProc;
-static Blt_MeasureCharsProc TkMeasureCharsProc;
-static Blt_TextStringWidthProc TkTextStringWidthProc;
-static Blt_FreeFontProc TkFreeFontProc;
-static Blt_DrawCharsProc TkDrawCharsProc;
-static Blt_PostscriptFontNameProc TkPostscriptFontNameProc;
-static Blt_FamilyOfFontProc TkFamilyOfFontProc;
-static Blt_CanRotateFontProc TkCanRotateFontProc;
-static Blt_UnderlineCharsProc TkUnderlineCharsProc;
-
-static Blt_FontClass tkFontClass = {
- FONT_TK,
- TkNameOfFontProc, /* Blt_NameOfFontProc */
- TkFamilyOfFontProc, /* Blt_FamilyOfFontProc */
- TkFontIdProc, /* Blt_FontIdProc */
- TkGetFontMetricsProc, /* Blt_GetFontMetricsProc */
- TkMeasureCharsProc, /* Blt_MeasureCharsProc */
- TkTextStringWidthProc, /* Blt_TexStringtWidthProc */
- TkCanRotateFontProc, /* Blt_CanRotateFontProc */
- TkDrawCharsProc, /* Blt_DrawCharsProc */
- TkPostscriptFontNameProc, /* Blt_PostscriptFontNameProc */
- TkFreeFontProc, /* Blt_FreeFontProc */
- TkUnderlineCharsProc, /* Blt_UnderlineCharsProc */
-};
-
-static FontPattern *
-NewFontPattern(void)
-{
- FontPattern *patternPtr;
-
- patternPtr = Blt_Calloc(1, sizeof(FontPattern));
- return patternPtr;
-}
-
-static void
-FreeFontPattern(FontPattern *patternPtr)
-{
- if (patternPtr->family != NULL) {
- Blt_Free((char *)patternPtr->family);
- }
- Blt_Free(patternPtr);
-}
-
-static int CALLBACK
-FontFamilyEnumProc(
- ENUMLOGFONT *lfPtr, /* Logical-font data. */
- NEWTEXTMETRIC *tmPtr, /* Physical-font data (not used). */
- int fontType, /* Type of font (not used). */
- LPARAM lParam) /* Result object to hold result. */
-{
- Blt_HashEntry *hPtr;
- Blt_HashTable *tablePtr;
- Tcl_DString ds;
- const char *faceName;
- Tcl_Encoding encoding;
- int isNew;
-
- tablePtr = (Blt_HashTable *)lParam;
- faceName = lfPtr->elfLogFont.lfFaceName;
- encoding = Tcl_GetEncoding(NULL, "Unicode");
- Tcl_ExternalToUtfDString(encoding, faceName, -1, &ds);
- faceName = Tcl_DStringValue(&ds);
- strtolower((char *)faceName);
- hPtr = Blt_CreateHashEntry(tablePtr, faceName, &isNew);
- Blt_SetHashValue(hPtr, NULL);
- Tcl_DStringFree(&ds);
- return 1;
-}
-
-static void
-GetFontFamilies(Tk_Window tkwin, Blt_HashTable *tablePtr)
-{
- HDC hDC;
- HWND hWnd;
- Window window;
-
- window = Tk_WindowId(tkwin);
- hWnd = (window == None) ? (HWND)NULL : Tk_GetHWND(window);
- hDC = GetDC(hWnd);
-
- /*
- * On any version NT, there may fonts with international names.
- * Use the NT-only Unicode version of EnumFontFamilies to get the
- * font names. If we used the ANSI version on a non-internationalized
- * version of NT, we would get font names with '?' replacing all
- * the international characters.
- *
- * On a non-internationalized verson of 95, fonts with international
- * names are not allowed, so the ANSI version of EnumFontFamilies will
- * work. On an internationalized version of 95, there may be fonts with
- * international names; the ANSI version will work, fetching the
- * name in the system code page. Can't use the Unicode version of
- * EnumFontFamilies because it only exists under NT.
- */
-
- if (Blt_GetPlatformId() == VER_PLATFORM_WIN32_NT) {
- EnumFontFamiliesW(hDC, NULL, (FONTENUMPROCW)FontFamilyEnumProc,
- (LPARAM)tablePtr);
- } else {
- EnumFontFamiliesA(hDC, NULL, (FONTENUMPROCA)FontFamilyEnumProc,
- (LPARAM)tablePtr);
- }
- ReleaseDC(hWnd, hDC);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ParseTkDesc --
- *
- * Parses an array of Tcl_Objs as a Tk style font description .
- *
- * "family [size] [optionList]"
- *
- * Results:
- * Returns a pattern structure, filling in with the necessary fields.
- * Returns NULL if objv doesn't contain a Tk font description.
- *
- * Side effects:
- * Memory is allocated for the font pattern and the its strings.
- *
- *---------------------------------------------------------------------------
- */
-static FontPattern *
-ParseTkDesc(int objc, Tcl_Obj **objv)
-{
- FontPattern *patternPtr;
- Tcl_Obj **aobjv;
- int aobjc;
- int i;
-
- patternPtr = NewFontPattern();
-
- /* Font family. */
- {
- char *family, *dash;
- family = Tcl_GetString(objv[0]);
- dash = strchr(family, '-');
- if (dash != NULL) {
- int size;
-
- if (Tcl_GetInt(NULL, dash + 1, &size) != TCL_OK) {
- goto error;
- }
- patternPtr->size = size;
- }
- if (dash != NULL) {
- *dash = '\0';
- }
- patternPtr->family = Blt_AssertStrdup(GetAlias(family));
- if (dash != NULL) {
- *dash = '-';
- i = 1;
- }
- objv++, objc--;
- }
- if (objc > 0) {
- int size;
-
- if (Tcl_GetIntFromObj(NULL, objv[0], &size) == TCL_OK) {
- patternPtr->size = size;
- objv++, objc--;
- }
- }
- aobjc = objc, aobjv = objv;
- if (objc > 0) {
- if (Tcl_ListObjGetElements(NULL, objv[0], &aobjc, &aobjv) != TCL_OK) {
- goto error;
- }
- }
- for (i = 0; i < aobjc; i++) {
- FontSpec *specPtr;
- const char *key;
- int length;
-
- key = Tcl_GetStringFromObj(aobjv[i], &length);
- specPtr = FindSpec(fontSpecs, nFontSpecs, key, length);
- if (specPtr == NULL) {
- goto error;
- }
- if (specPtr->key == NULL) {
- continue;
- }
- if (strcmp(specPtr->key, FC_WEIGHT) == 0) {
- patternPtr->weight = specPtr->oldvalue;
- } else if (strcmp(specPtr->key, FC_SLANT) == 0) {
- patternPtr->slant = specPtr->oldvalue;
- } else if (strcmp(specPtr->key, FC_SPACING) == 0) {
- patternPtr->spacing = specPtr->oldvalue;
- } else if (strcmp(specPtr->key, FC_WIDTH) == 0) {
- patternPtr->width = specPtr->oldvalue;
- }
- }
- return patternPtr;
- error:
- FreeFontPattern(patternPtr);
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ParseNameValuePairs --
- *
- * Given Tcl_Obj list of name value pairs, parse the list saving in the
- * values in a font pattern structure.
- *
- * "-family family -size size -weight weight"
- *
- * Results:
- * Returns a pattern structure, filling in with the necessary fields.
- * Returns NULL if objv doesn't contain a valid name-value list
- * describing a font.
- *
- * Side effects:
- * Memory is allocated for the font pattern and the its strings.
- *
- *---------------------------------------------------------------------------
- */
-static FontPattern *
-ParseNameValuePairs(Tcl_Interp *interp, Tcl_Obj *objPtr)
-{
- FontPattern *patternPtr;
- Tcl_Obj **objv;
- int objc;
- int i;
-
- if ((Tcl_ListObjGetElements(NULL, objPtr, &objc, &objv) != TCL_OK) ||
- (objc < 1)) {
- return NULL; /* Can't split list or list is empty. */
- }
- if (objc & 0x1) {
- return NULL; /* Odd number of elements in list. */
- }
- patternPtr = NewFontPattern();
- for (i = 0; i < objc; i += 2) {
- const char *key, *value;
- int length;
-
- key = Tcl_GetString(objv[i]);
- value = Tcl_GetStringFromObj(objv[i+1], &length);
- if (strcmp(key, "-family") == 0) {
- if (patternPtr->family != NULL) {
- Blt_Free(patternPtr->family);
- }
- patternPtr->family = Blt_AssertStrdup(GetAlias(value));
- } else if (strcmp(key, "-size") == 0) {
- int size;
-
- if (Tcl_GetIntFromObj(interp, objv[i+1], &size) != TCL_OK) {
- goto error;
- }
- patternPtr->size = size;
- } else if (strcmp(key, "-weight") == 0) {
- FontSpec *specPtr;
-
- specPtr = FindSpec(weightSpecs, nWeightSpecs, value, length);
- if (specPtr == NULL) {
- goto error;
- }
- patternPtr->weight = specPtr->oldvalue;
- } else if (strcmp(key, "-slant") == 0) {
- FontSpec *specPtr;
-
- specPtr = FindSpec(slantSpecs, nSlantSpecs, value, length);
- if (specPtr == NULL) {
- goto error;
- }
- patternPtr->slant = specPtr->oldvalue;
- } else if (strcmp(key, "-spacing") == 0) {
- FontSpec *specPtr;
-
- specPtr = FindSpec(spacingSpecs, nSpacingSpecs, value, length);
- if (specPtr == NULL) {
- goto error;
- }
- patternPtr->spacing = specPtr->oldvalue;
- } else if (strcmp(key, "-hint") == 0) {
- /* Ignore */
- } else if (strcmp(key, "-rgba") == 0) {
- /* Ignore */
- } else if (strcmp(key, "-underline") == 0) {
- /* Ignore */
- } else if (strcmp(key, "-overstrike") == 0) {
- /* Ignore */
- } else {
- /* Ignore */
- }
- }
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "found TkAttrList => Tk font \"%s\"\n",
- Tcl_GetString(objPtr));
-#endif
- return patternPtr;
- error:
- FreeFontPattern(patternPtr);
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ParseFontObj --
- *
- * Given the name of a Tk font object, get its configuration values
- * save the data in a font pattern structure.
- *
- * "-family family -size size -weight weight"
- *
- * Results:
- * Returns a pattern structure, filling in with the necessary fields.
- * Returns NULL if objv doesn't contain a valid name-value list
- * describing a font.
- *
- * Side effects:
- * Memory is allocated for the font pattern and the its strings.
- *
- *---------------------------------------------------------------------------
- */
-static FontPattern *
-ParseFontObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
-{
- FontPattern *patternPtr;
- Tcl_Obj *cmd[3];
- int result;
-
- patternPtr = NULL;
- cmd[0] = Tcl_NewStringObj("font", -1);
- cmd[1] = Tcl_NewStringObj("configure", -1);
- cmd[2] = objPtr;
- Tcl_IncrRefCount(cmd[0]);
- Tcl_IncrRefCount(cmd[1]);
- Tcl_IncrRefCount(cmd[2]);
- result = Tcl_EvalObjv(interp, 3, cmd, 0);
- Tcl_DecrRefCount(cmd[2]);
- Tcl_DecrRefCount(cmd[1]);
- Tcl_DecrRefCount(cmd[0]);
- if (result == TCL_OK) {
- patternPtr = ParseNameValuePairs(interp, Tcl_GetObjResult(interp));
- }
- Tcl_ResetResult(interp);
-#if DEBUG_FONT_SELECTION
- if (patternPtr != NULL) {
- fprintf(stderr, "found FontObject => Tk font \"%s\"\n",
- Tcl_GetString(objPtr));
- }
-#endif
- return patternPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetPattern --
- *
- * Parses the font description so that the font can rewritten with an
- * aliased font name. This allows us to use
- *
- * "Sans Serif", "Serif", "Math", "Monospace"
- *
- * font names that correspond to the proper font regardless if the
- * standard X fonts or XFT fonts are being used.
- *
- * Leave XLFD font descriptions alone. Let users describe exactly the
- * font they wish.
- *
- *---------------------------------------------------------------------------
- */
-static FontPattern *
-GetPattern(Tcl_Interp *interp, Tcl_Obj *objPtr)
-{
- FontPattern *patternPtr;
- const char *desc;
-
- desc = Tcl_GetString(objPtr);
- while (isspace(UCHAR(*desc))) {
- desc++; /* Skip leading blanks. */
- }
- if (*desc == '-') {
- /*
- * Case 1: XLFD font description or Tk attribute list.
- *
- * If the font description starts with a '-', it could be either an
- * old fashion XLFD font description or a Tk font attribute
- * option-value list.
- */
- patternPtr = ParseNameValuePairs(interp, objPtr);
- if (patternPtr == NULL) {
- return NULL; /* XLFD font description */
- }
- } else if (*desc == '*') {
- return NULL; /* XLFD font description */
- } else if (strpbrk(desc, "::") != NULL) {
- patternPtr = ParseFontObj(interp, objPtr);
- } else {
- int objc;
- Tcl_Obj **objv;
- /*
- * Case 3: Tk-style description.
- */
- if ((Tcl_ListObjGetElements(NULL, objPtr, &objc, &objv) != TCL_OK) ||
- (objc < 1)) {
- return NULL; /* Can't split into a list or
- * list is empty. */
- }
- patternPtr = NULL;
- if (objc == 1) {
- /*
- * Case 3a: Tk font object name.
- *
- * Assuming that Tk font object names won't contain whitespace,
- * see if its a font object.
- */
- patternPtr = ParseFontObj(interp, objv[0]);
- }
- if (patternPtr == NULL) {
- /*
- * Case 3b: List of font attributes in the form "family size
- * ?attrs?"
- */
- patternPtr = ParseTkDesc(objc, objv);
- }
- }
- return patternPtr;
-}
-
-static void
-WriteXLFDDescription(Tk_Window tkwin, FontPattern *patternPtr,
- Tcl_DString *resultPtr)
-{
- int size;
-
- /* Rewrite the font description using the aliased family. */
- Tcl_DStringInit(resultPtr);
-
- /* Family */
- if (patternPtr->family != NULL) {
- Tcl_DStringAppendElement(resultPtr, "-family");
- Tcl_DStringAppendElement(resultPtr, patternPtr->family);
- }
- /* Weight */
- if (patternPtr->weight != NULL) {
- Tcl_DStringAppendElement(resultPtr, "-weight");
- Tcl_DStringAppendElement(resultPtr, patternPtr->weight);
- }
- /* Slant */
- if (patternPtr->slant != NULL) {
- Tcl_DStringAppendElement(resultPtr, "-slant");
- Tcl_DStringAppendElement(resultPtr, patternPtr->slant);
- }
- /* Width */
- if (patternPtr->width != NULL) {
- Tcl_DStringAppendElement(resultPtr, "-width");
- Tcl_DStringAppendElement(resultPtr, patternPtr->width);
- }
- /* Size */
- Tcl_DStringAppendElement(resultPtr, "-size");
- size = (int)(PointsToPixels(tkwin, patternPtr->size) + 0.5);
- size = patternPtr->size;
- Tcl_DStringAppendElement(resultPtr, Blt_Itoa(size));
-}
-
-
-static Tk_Font
-OpenTkFont(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)
-{
- Tk_Font tkFont;
- FontPattern *patternPtr;
- Blt_HashEntry *hPtr;
- const char *desc;
-
- desc = Tcl_GetString(objPtr);
- hPtr = Blt_FindHashEntry(&fontTable, desc);
- patternPtr = GetPattern(interp, objPtr);
- if (patternPtr == NULL) {
- tkFont = Tk_GetFont(interp, tkwin, Tcl_GetString(objPtr));
- } else {
- Tcl_DString ds;
-
- /* Rewrite the font description using the aliased family. */
- WriteXLFDDescription(tkwin, patternPtr, &ds);
- tkFont = Tk_GetFont(interp, tkwin, Tcl_DStringValue(&ds));
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "Tkfont: %s => %s\n", Tcl_GetString(objPtr),
- Tcl_DStringValue(&ds));
-#endif
- Tcl_DStringFree(&ds);
- FreeFontPattern(patternPtr);
- }
- return tkFont;
-}
-
-
-static const char *
-TkNameOfFontProc(_Blt_Font *fontPtr)
-{
- return Tk_NameOfFont(fontPtr->clientData);
-}
-
-static const char *
-TkFamilyOfFontProc(_Blt_Font *fontPtr)
-{
- return ((TkFont *)fontPtr->clientData)->fa.family;
-}
-
-static Font
-TkFontIdProc(_Blt_Font *fontPtr)
-{
- return Tk_FontId(fontPtr->clientData);
-}
-
-static void
-TkGetFontMetricsProc(_Blt_Font *fontPtr, Blt_FontMetrics *fmPtr)
-{
- TkFont *tkFontPtr = fontPtr->clientData;
- Tk_FontMetrics fm;
-
- Tk_GetFontMetrics(fontPtr->clientData, &fm);
- fmPtr->ascent = fm.ascent;
- fmPtr->descent = fm.descent;
- fmPtr->linespace = fm.linespace;
- fmPtr->tabWidth = tkFontPtr->tabWidth;
- fmPtr->underlinePos = tkFontPtr->underlinePos;
- fmPtr->underlineHeight = tkFontPtr->underlineHeight;
-}
-
-static int
-TkMeasureCharsProc(_Blt_Font *fontPtr, const char *text, int nBytes, int max,
- int flags, int *lengthPtr)
-{
- return Tk_MeasureChars(fontPtr->clientData, text, nBytes, max, flags,
- lengthPtr);
-}
-
-static int
-TkTextStringWidthProc(_Blt_Font *fontPtr, const char *string, int nBytes)
-{
- return Tk_TextWidth(fontPtr->clientData, string, nBytes);
-}
-
-static void
-TkDrawCharsProc(
- Display *display, /* Display on which to draw. */
- Drawable drawable, /* Window or pixmap in which to draw. */
- GC gc, /* Graphics context for drawing characters. */
- _Blt_Font *fontPtr, /* Font in which characters will be drawn;
- * must be the same as font used in GC. */
- int depth, /* Not used. */
- float angle, /* Not used. */
- const char *text, /* UTF-8 string to be displayed. Need not be
- * '\0' terminated. All Tk meta-characters
- * (tabs, control characters, and newlines)
- * should be stripped out of the string that
- * is passed to this function. If they are
- * not stripped out, they will be displayed as
- * regular printing characters. */
- int nBytes, /* Number of bytes in string. */
- int x, int y) /* Coordinates at which to place origin of
- * string when drawing. */
-{
- Tk_DrawChars(display, drawable, gc, fontPtr->clientData, text, nBytes,
- x, y);
-}
-
-static int
-TkPostscriptFontNameProc(_Blt_Font *fontPtr, Tcl_DString *resultPtr)
-{
- return Tk_PostscriptFontName(fontPtr->clientData, resultPtr);
-}
-
-static int
-TkCanRotateFontProc(_Blt_Font *fontPtr, float angle)
-{
- return FALSE;
-}
-
-static void
-TkFreeFontProc(_Blt_Font *fontPtr)
-{
- Tk_FreeFont(fontPtr->clientData);
- Blt_Free(fontPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TkUnderlineCharsProc --
- *
- * This procedure draws an underline for a given range of characters in a
- * given string. It doesn't draw the characters (which are assumed to
- * have been displayed previously); it just draws the underline. This
- * procedure would mainly be used to quickly underline a few characters
- * without having to construct an underlined font. To produce properly
- * underlined text, the appropriate underlined font should be constructed
- * and used.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets displayed in "drawable".
- *
- *---------------------------------------------------------------------------
- */
-static void
-TkUnderlineCharsProc(
- Display *display, /* Display on which to draw. */
- Drawable drawable, /* Window or pixmap in which to draw. */
- GC gc, /* Graphics context for actually drawing
- * line. */
- _Blt_Font *fontPtr, /* Font used in GC; must have been
- * allocated by Tk_GetFont(). Used for
- * character dimensions, etc. */
- const char *string, /* String containing characters to be
- * underlined or overstruck. */
- int textLen, /* Unused. */
- int x, int y, /* Coordinates at which first character of
- * string is drawn. */
- int first, /* Byte offset of the first character. */
- int last, /* Byte offset after the last character. */
- int xMax)
-{
- Tk_UnderlineChars(display, drawable, gc, fontPtr->clientData, string, x, y,
- first, last);
-}
-
-static Blt_NameOfFontProc WinNameOfFontProc;
-static Blt_GetFontMetricsProc WinGetFontMetricsProc;
-static Blt_FontIdProc WinFontIdProc;
-static Blt_MeasureCharsProc WinMeasureCharsProc;
-static Blt_TextStringWidthProc WinTextStringWidthProc;
-static Blt_FreeFontProc WinFreeFontProc;
-static Blt_DrawCharsProc WinDrawCharsProc;
-static Blt_PostscriptFontNameProc WinPostscriptFontNameProc;
-static Blt_FamilyOfFontProc WinFamilyOfFontProc;
-static Blt_CanRotateFontProc WinCanRotateFontProc;
-static Blt_UnderlineCharsProc WinUnderlineCharsProc;
-
-static Blt_FontClass winFontClass = {
- FONT_WIN,
- WinNameOfFontProc, /* Blt_NameOfFontProc */
- WinFamilyOfFontProc, /* Blt_FamilyOfFontProc */
- WinFontIdProc, /* Blt_FontIdProc */
- WinGetFontMetricsProc, /* Blt_GetFontMetricsProc */
- WinMeasureCharsProc, /* Blt_MeasureCharsProc */
- WinTextStringWidthProc, /* Blt_TextStringWidthProc */
- WinCanRotateFontProc, /* Blt_CanRotateFontProc */
- WinDrawCharsProc, /* Blt_DrawCharsProc */
- WinPostscriptFontNameProc, /* Blt_PostscriptFontNameProc */
- WinFreeFontProc, /* Blt_FreeFontProc */
- WinUnderlineCharsProc, /* Blt_UnderlineCharsProc */
-};
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateRotatedFont --
- *
- * Creates a rotated copy of the given font. This only works for
- * TrueType fonts.
- *
- * Results:
- * Returns the newly create font or NULL if the font could not be
- * created.
- *
- *---------------------------------------------------------------------------
- */
-static HFONT
-CreateRotatedFont(
- TkFont *fontPtr, /* Font identifier (actually a Tk_Font) */
- long angle10)
-{ /* Number of degrees to rotate font */
- TkFontAttributes *faPtr; /* Set of attributes to match. */
- HFONT hfont;
- LOGFONTW lf;
-
- faPtr = &fontPtr->fa;
- ZeroMemory(&lf, sizeof(LOGFONT));
- lf.lfHeight = -faPtr->size;
- if (lf.lfHeight < 0) {
- HDC dc;
-
- dc = GetDC(NULL);
- lf.lfHeight = -MulDiv(faPtr->size, GetDeviceCaps(dc, LOGPIXELSY), 72);
- ReleaseDC(NULL, dc);
- }
- lf.lfWidth = 0;
- lf.lfEscapement = lf.lfOrientation = angle10;
-#define TK_FW_NORMAL 0
- lf.lfWeight = (faPtr->weight == TK_FW_NORMAL) ? FW_NORMAL : FW_BOLD;
- lf.lfItalic = faPtr->slant;
- lf.lfUnderline = faPtr->underline;
- lf.lfStrikeOut = faPtr->overstrike;
- lf.lfCharSet = DEFAULT_CHARSET;
- lf.lfOutPrecision = OUT_TT_ONLY_PRECIS;
- lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
- lf.lfQuality = DEFAULT_QUALITY;
- lf.lfQuality = ANTIALIASED_QUALITY;
- lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
-
- hfont = NULL;
- if (faPtr->family == NULL) {
- lf.lfFaceName[0] = '\0';
- } else {
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- Tcl_DString dString;
- Tcl_Encoding encoding;
-
- encoding = Tcl_GetEncoding(NULL, "unicode");
- Tcl_UtfToExternalDString(encoding, faPtr->family, -1, &dString);
- if (Blt_GetPlatformId() == VER_PLATFORM_WIN32_NT) {
- Tcl_UniChar *src, *dst;
-
- /*
- * We can only store up to LF_FACESIZE wide characters
- */
- if (Tcl_DStringLength(&dString) >= (LF_FACESIZE * sizeof(WCHAR))) {
- Tcl_DStringSetLength(&dString, LF_FACESIZE);
- }
- src = (Tcl_UniChar *)Tcl_DStringValue(&dString);
- dst = (Tcl_UniChar *)lf.lfFaceName;
- while (*src != '\0') {
- *dst++ = *src++;
- }
- *dst = '\0';
- hfont = CreateFontIndirectW((LOGFONTW *)&lf);
- } else {
- /*
- * We can only store up to LF_FACESIZE characters
- */
- if (Tcl_DStringLength(&dString) >= LF_FACESIZE) {
- Tcl_DStringSetLength(&dString, LF_FACESIZE);
- }
- strcpy((char *)lf.lfFaceName, Tcl_DStringValue(&dString));
- hfont = CreateFontIndirectA((LOGFONTA *)&lf);
- }
- Tcl_DStringFree(&dString);
-#else
- strncpy((char *)lf.lfFaceName, faPtr->family, LF_FACESIZE - 1);
- lf.lfFaceName[LF_FACESIZE] = '\0';
-#endif /* _TCL_VERSION >= 8.1.0 */
- }
-
- if (hfont == NULL) {
-#if WINDEBUG
- PurifyPrintf("can't create font: %s\n", Blt_LastError());
-#endif
- } else {
- HFONT oldFont;
- TEXTMETRIC tm;
- HDC hdc;
- int result;
-
- /* Check if the rotated font is really a TrueType font. */
-
- hdc = GetDC(NULL); /* Get the desktop device context */
- oldFont = SelectFont(hdc, hfont);
- result = ((GetTextMetrics(hdc, &tm)) &&
- (tm.tmPitchAndFamily & TMPF_TRUETYPE));
- SelectFont(hdc, oldFont);
- ReleaseDC(NULL, hdc);
- if (!result) {
-#if WINDEBUG
- PurifyPrintf("not a true type font\n");
-#endif
- DeleteFont(hfont);
- return NULL;
- }
- }
- return hfont;
-}
-
-static void
-DestroyFont(RotatedFont *rotFontPtr)
-{
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&rotFontPtr->fontTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- HFONT hfont;
-
- hfont = Blt_GetHashValue(hPtr);
- DeleteFont(hfont);
- }
- Tk_FreeFont(rotFontPtr->tkfont);
- Blt_DeleteHashTable(&rotFontPtr->fontTable);
- Blt_DeleteHashEntry(&fontTable, rotFontPtr->hashPtr);
- Blt_Free(rotFontPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetRotatedFontFromObj --
- *
- * Opens a Tk font based on the description in the Tcl_Obj. We first
- * parse the description and if necessary rewrite it using the proper
- * font aliases. The font names
- *
- * "Sans Serif", "Serif", "Math", "Monospace"
- *
- * correspond to the proper font regardless if the standard X fonts or
- * XFT fonts are being used.
- *
- * Leave XLFD font descriptions alone. Let users describe exactly the
- * font they wish.
- *
- * Outside of reimplementing the Tk font mechanism, rewriting the
- * font allows use to better handle programs that must work with
- * X servers with and without the XRender extension. It means
- * that the widget's default font settings do not have to use
- * XLFD fonts even if XRender is available.
- *
- *---------------------------------------------------------------------------
- */
-static RotatedFont *
-GetRotatedFontFromObj(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)
-{
- Blt_HashEntry *hPtr;
- RotatedFont *rotFontPtr;
- const char *desc;
- int isNew;
-
- desc = Tcl_GetString(objPtr);
- while (isspace(UCHAR(*desc))) {
- desc++; /* Skip leading blanks. */
- }
- /* Is the font already in the cache? */
- hPtr = Blt_CreateHashEntry(&fontTable, desc, &isNew);
- if (isNew) {
- Tk_Font tkFont;
-
- tkFont = OpenTkFont(interp, tkwin, objPtr);
- if (tkFont == NULL) {
- Blt_DeleteHashEntry(&fontTable, hPtr);
- return NULL;
- }
- rotFontPtr = Blt_AssertMalloc(sizeof(RotatedFont));
- rotFontPtr->refCount = 1;
- rotFontPtr->tkfont = tkFont;
- rotFontPtr->name = Blt_AssertStrdup(desc);
- Blt_SetHashValue(hPtr, rotFontPtr);
- Blt_InitHashTable(&rotFontPtr->fontTable, BLT_ONE_WORD_KEYS);
- } else {
- rotFontPtr = Tcl_GetHashValue(hPtr);
- rotFontPtr->refCount++;
- }
- return rotFontPtr;
-}
-
-static const char *
-WinNameOfFontProc(_Blt_Font *fontPtr)
-{
- RotatedFont *rotFontPtr = fontPtr->clientData;
-
- return Tk_NameOfFont(rotFontPtr->tkfont);
-}
-
-static const char *
-WinFamilyOfFontProc(_Blt_Font *fontPtr)
-{
- RotatedFont *rotFontPtr = fontPtr->clientData;
-
- return ((TkFont *)rotFontPtr->tkfont)->fa.family;
-}
-
-static Font
-WinFontIdProc(_Blt_Font *fontPtr)
-{
- RotatedFont *rotFontPtr = fontPtr->clientData;
-
- return Tk_FontId(rotFontPtr->tkfont);
-}
-
-static void
-WinGetFontMetricsProc(_Blt_Font *fontPtr, Blt_FontMetrics *fmPtr)
-{
- RotatedFont *rotFontPtr = fontPtr->clientData;
- TkFont *tkFontPtr = (TkFont *)rotFontPtr->tkfont;
- Tk_FontMetrics fm;
-
- Tk_GetFontMetrics(rotFontPtr->tkfont, &fm);
- fmPtr->ascent = fm.ascent;
- fmPtr->descent = fm.descent;
- fmPtr->linespace = fm.linespace;
- fmPtr->tabWidth = tkFontPtr->tabWidth;
- fmPtr->underlinePos = tkFontPtr->underlinePos;
- fmPtr->underlineHeight = tkFontPtr->underlineHeight;
-}
-
-static int
-WinMeasureCharsProc(_Blt_Font *fontPtr, const char *text, int nBytes,
- int max, int flags, int *lengthPtr)
-{
- RotatedFont *rotFontPtr = fontPtr->clientData;
-
- return Tk_MeasureChars(rotFontPtr->tkfont, text, nBytes, max, flags,
- lengthPtr);
-}
-
-static int
-WinTextStringWidthProc(_Blt_Font *fontPtr, const char *text, int nBytes)
-{
- RotatedFont *rotFontPtr = fontPtr->clientData;
-
- return Tk_TextWidth(rotFontPtr->tkfont, text, nBytes);
-}
-
-
-static void
-WinDrawCharsProc(
- Display *display, /* Display on which to draw. */
- Drawable drawable, /* Window or pixmap in which to draw. */
- GC gc, /* Graphics context for drawing characters. */
- _Blt_Font *fontPtr, /* Font in which characters will be drawn;
- * must be the same as font used in GC. */
- int depth, /* Not used. */
- float angle, /* Not used. */
- const char *text, /* UTF-8 string to be displayed. Need not be
- * '\0' terminated. All Tk meta-characters
- * (tabs, control characters, and newlines)
- * should be stripped out of the string that
- * is passed to this function. If they are
- * not stripped out, they will be displayed as
- * regular printing characters. */
- int nBytes, /* Number of bytes in string. */
- int x, int y) /* Coordinates at which to place origin of
- * string when drawing. */
-{
- RotatedFont *rotFontPtr = fontPtr->clientData;
-
- if (angle != 0.0) {
- long angle10;
- Blt_HashEntry *hPtr;
-
- angle *= 10.0f;
- angle10 = ROUND(angle);
- hPtr = Blt_FindHashEntry(&rotFontPtr->fontTable, (char *)angle10);
- if (hPtr == NULL) {
- fprintf(stderr, "can't find font %s at %g rotated\n",
- rotFontPtr->name, angle);
- return; /* Can't find instance at requested angle. */
- }
- display->request++;
- if (drawable != None) {
- HDC hdc;
- HFONT hfont;
- TkWinDCState state;
-
- hfont = Blt_GetHashValue(hPtr);
- hdc = TkWinGetDrawableDC(display, drawable, &state);
- Blt_TextOut(hdc, gc, hfont, text, nBytes, x, y);
- TkWinReleaseDrawableDC(drawable, hdc, &state);
- }
- } else {
- Tk_DrawChars(display, drawable, gc, rotFontPtr->tkfont, text, nBytes,
- x, y);
- }
-}
-
-
-static int
-WinPostscriptFontNameProc(_Blt_Font *fontPtr, Tcl_DString *resultPtr)
-{
- RotatedFont *rotFontPtr = fontPtr->clientData;
-
- return Tk_PostscriptFontName(rotFontPtr->tkfont, resultPtr);
-}
-
-static int
-WinCanRotateFontProc(_Blt_Font *fontPtr, float angle)
-{
- Blt_HashEntry *hPtr;
- HFONT hfont;
- RotatedFont *rotFontPtr = fontPtr->clientData;
- int isNew;
- long angle10;
-
- angle *= 10.0f;
- angle10 = ROUND(angle);
- if (angle == 0L) {
- return TRUE;
- }
- hPtr = Blt_CreateHashEntry(&rotFontPtr->fontTable, (char *)angle10, &isNew);
- if (!isNew) {
- return TRUE; /* Rotated font already exists. */
- }
- hfont = CreateRotatedFont((TkFont *)Blt_FontId(fontPtr), angle10);
- if (hfont == NULL) {
- Blt_DeleteHashEntry(&rotFontPtr->fontTable, hPtr);
- return FALSE;
- }
- Blt_SetHashValue(hPtr, hfont);
- return TRUE;
-}
-
-static void
-WinFreeFontProc(_Blt_Font *fontPtr)
-{
- RotatedFont *rotFontPtr = fontPtr->clientData;
-
- rotFontPtr->refCount--;
- if (rotFontPtr->refCount <= 0) {
- DestroyFont(rotFontPtr);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WinUnderlineCharsProc --
- *
- * This procedure draws an underline for a given range of characters in a
- * given string. It doesn't draw the characters (which are assumed to
- * have been displayed previously); it just draws the underline. This
- * procedure would mainly be used to quickly underline a few characters
- * without having to construct an underlined font. To produce properly
- * underlined text, the appropriate underlined font should be constructed
- * and used.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Information gets displayed in "drawable".
- *
- *---------------------------------------------------------------------------
- */
-static void
-WinUnderlineCharsProc(
- Display *display, /* Display on which to draw. */
- Drawable drawable, /* Window or pixmap in which to draw. */
- GC gc, /* Graphics context for actually drawing
- * line. */
- _Blt_Font *fontPtr, /* Font used in GC; must have been
- * allocated by Tk_GetFont(). Used for
- * character dimensions, etc. */
- const char *string, /* String containing characters to be
- * underlined or overstruck. */
- int textLen, /* Unused. */
- int x, int y, /* Coordinates at which first character of
- * string is drawn. */
- int first, /* Byte offset of the first character. */
- int last, /* Byte offset after the last character. */
- int xMax)
-{
- RotatedFont *rotFontPtr = fontPtr->clientData;
-
- Tk_UnderlineChars(display, drawable, gc, rotFontPtr->tkfont, string, x, y,
- first, last);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetFontFromObj --
- *
- * Given a string description of a font, map the description to a
- * corresponding Tk_Font that represents the font.
- *
- * Results:
- * The return value is token for the font, or NULL if an error prevented
- * the font from being created. If NULL is returned, an error message
- * will be left in the interp's result.
- *
- * Side effects:
- * The font is added to an internal database with a reference count. For
- * each call to this procedure, there should eventually be a call to
- * Tk_FreeFont() or Tk_FreeFontFromObj() so that the database is cleaned
- * up when fonts aren't in use anymore.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Font
-Blt_GetFontFromObj(
- Tcl_Interp *interp, /* Interp for database and error return. */
- Tk_Window tkwin, /* For display on which font will be used. */
- Tcl_Obj *objPtr) /* String describing font, as: named font,
- * native format, or parseable string. */
-{
- _Blt_Font *fontPtr;
-
- fontPtr = Blt_Calloc(1, sizeof(_Blt_Font));
- if (fontPtr == NULL) {
- return NULL; /* Out of memory. */
- }
- if (!initialized) {
- Blt_InitHashTable(&fontTable, BLT_STRING_KEYS);
- MakeAliasTable(tkwin);
- initialized++;
- }
- fontPtr->clientData = OpenTkFont(interp, tkwin, objPtr);
-
- if (fontPtr->clientData == NULL) {
- Blt_Free(fontPtr);
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "FAILED to find either Xft or Tk font \"%s\"\n",
- Tcl_GetString(objPtr));
-#endif
- return NULL; /* Failed to find either Xft or Tk fonts. */
- }
- fontPtr->classPtr = &tkFontClass;
-#ifdef notdef
- fontPtr->clientData = GetRotatedFontFromObj(interp, tkwin, objPtr);
-#if DEBUG_FONT_SELECTION
- fprintf(stderr, "SUCCESS: Found Tk font \"%s\"\n", Tcl_GetString(objPtr));
-#endif
- fontPtr->classPtr = &winFontClass;
-#endif
- fontPtr->interp = interp;
- fontPtr->display = Tk_Display(tkwin);
- return fontPtr; /* Found Tk font. */
-}
-
-
-Blt_Font
-Blt_AllocFontFromObj(
- Tcl_Interp *interp, /* Interp for database and error return. */
- Tk_Window tkwin, /* For screen on which font will be used. */
- Tcl_Obj *objPtr) /* Object describing font, as: named font,
- * native format, or parseable string. */
-{
- return Blt_GetFontFromObj(interp, tkwin, objPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetFont --
- *
- * Given a string description of a font, map the description to a
- * corresponding Tk_Font that represents the font.
- *
- * Results:
- * The return value is token for the font, or NULL if an error prevented
- * the font from being created. If NULL is returned, an error message
- * will be left in interp's result object.
- *
- * Side effects:
- * The font is added to an internal database with a reference count. For
- * each call to this procedure, there should eventually be a call to
- * Blt_FreeFont so that the database is cleaned up when fonts aren't in
- * use anymore.
- *
- *---------------------------------------------------------------------------
- */
-
-Blt_Font
-Blt_GetFont(
- Tcl_Interp *interp, /* Interp for database and error return. */
- Tk_Window tkwin, /* For screen on which font will be used. */
- const char *string) /* Object describing font, as: named font,
- * native format, or parseable string. */
-{
- Blt_Font font;
- Tcl_Obj *objPtr;
-
- objPtr = Tcl_NewStringObj(string, strlen(string));
- Tcl_IncrRefCount(objPtr);
- font = Blt_GetFontFromObj(interp, tkwin, objPtr);
- Tcl_DecrRefCount(objPtr);
- return font;
-}
-
-Tcl_Interp *
-Blt_GetFontInterp(_Blt_Font *fontPtr)
-{
- return fontPtr->interp;
-}
-
-int
-Blt_TextWidth(_Blt_Font *fontPtr, const char *string, int length)
-{
- if (Blt_Ps_IsPrinting()) {
- int width;
-
- width = Blt_Ps_TextWidth(fontPtr, string, length);
- if (width >= 0) {
- return width;
- }
- }
- return (*fontPtr->classPtr->textWidth)(fontPtr, string, length);
-}
-
-void
-Blt_GetFontMetrics(_Blt_Font *fontPtr, Blt_FontMetrics *fmPtr)
-{
- if (Blt_Ps_IsPrinting()) {
- if (Blt_Ps_GetFontMetrics(fontPtr, fmPtr) == TCL_OK) {
- return;
- }
- }
- return (*fontPtr->classPtr->getFontMetrics)(fontPtr, fmPtr);
-}
diff --git a/blt3.0.1/src/bltWinMain.c b/blt3.0.1/src/bltWinMain.c
deleted file mode 100644
index 64e3f93..0000000
--- a/blt3.0.1/src/bltWinMain.c
+++ /dev/null
@@ -1,630 +0,0 @@
-
-/*
- * bltWinMain.c --
- *
- * Main entry point for wish and other Tk-based applications.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This file was adapted from the Tk library distribution.
- *
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and
- * redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- */
-
-#include "config.h"
-#undef USE_TK_STUBS
-#undef USE_TCL_STUBS
-#include "blt.h"
-#include <tcl.h>
-#include <tk.h>
-#include <locale.h>
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#define _VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-
-#define _TCL_VERSION _VERSION(TCL_MAJOR_VERSION, TCL_MINOR_VERSION, TCL_RELEASE_SERIAL)
-#define _TK_VERSION _VERSION(TK_MAJOR_VERSION, TK_MINOR_VERSION, TK_RELEASE_SERIAL)
-
-#ifdef WIN32
-# define STRICT
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# undef STRICT
-# undef WIN32_LEAN_AND_MEAN
-# include <windowsx.h>
-#endif /* WIN32 */
-
-#define vsnprintf _vsnprintf
-
-/*
- * Forward declarations for procedures defined later in this file:
- */
-
-static void setargv(int *argcPtr, char ***argvPtr);
-
-#ifndef TCL_ONLY
-#if (_TCL_VERSION >= _VERSION(8,2,0))
-static BOOL consoleRequired = TRUE;
-#endif
-#endif
-
-static Tcl_AppInitProc Initialize;
-#ifndef TCL_ONLY
-static Tcl_PanicProc WishPanic;
-#endif
-
-#if (_TK_VERSION < _VERSION(8,2,0))
-/*
- * The following declarations refer to internal Tk routines. These interfaces
- * are available for use, but are not supported.
- */
-extern void Blt_ConsoleCreate(void);
-extern int Blt_ConsoleInit(Tcl_Interp *interp);
-
-#endif /* _TK_VERSION < 8.2.0 */
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * setargv --
- *
- * Parse the Windows command line string into argc/argv. Done here
- * because we don't trust the builtin argument parser in crt0. Windows
- * applications are responsible for breaking their command line into
- * arguments.
- *
- * 2N backslashes + quote -> N backslashes + begin quoted string
- * 2N + 1 backslashes + quote -> literal
- * N backslashes + non-quote -> literal
- * quote + quote in a quoted string -> single quote
- * quote + quote not in quoted string -> empty string
- * quote -> begin quoted string
- *
- * Results:
- * Fills argcPtr with the number of arguments and argvPtr with the
- * array of arguments.
- *
- * Side effects:
- * Memory allocated.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-setargv(
- int *argcPtr, /* Filled with number of argument strings. */
- char ***argvPtr)
-{ /* Filled with argument strings (malloc'd). */
- char *cmdLine, *p, *arg, *argSpace;
- char **argv;
- int argc, size, inquote, copy, slashes;
-
- cmdLine = GetCommandLine(); /* INTL: BUG */
-
- /*
- * Precompute an overly pessimistic guess at the number of arguments in
- * the command line by counting non-space spans.
- */
-
- size = 2;
- for (p = cmdLine; *p != '\0'; p++) {
- if ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */
- size++;
- while ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */
- p++;
- }
- if (*p == '\0') {
- break;
- }
- }
- }
- argSpace = (char *)Tcl_Alloc(
- (unsigned)(size * sizeof(char *) + strlen(cmdLine) + 1));
- argv = (char **)argSpace;
- argSpace += size * sizeof(char *);
- size--;
-
- p = cmdLine;
- for (argc = 0; argc < size; argc++) {
- argv[argc] = arg = argSpace;
- while ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */
- p++;
- }
- if (*p == '\0') {
- break;
- }
- inquote = 0;
- slashes = 0;
- while (1) {
- copy = 1;
- while (*p == '\\') {
- slashes++;
- p++;
- }
- if (*p == '"') {
- if ((slashes & 1) == 0) {
- copy = 0;
- if ((inquote) && (p[1] == '"')) {
- p++;
- copy = 1;
- } else {
- inquote = !inquote;
- }
- }
- slashes >>= 1;
- }
- while (slashes) {
- *arg = '\\';
- arg++;
- slashes--;
- }
-
- if ((*p == '\0') || (!inquote && ((*p == ' ') ||
- (*p == '\t')))) { /* INTL: ISO space. */
- break;
- }
- if (copy != 0) {
- *arg = *p;
- arg++;
- }
- p++;
- }
- *arg = '\0';
- argSpace = arg + 1;
- }
- argv[argc] = NULL;
-
- *argcPtr = argc;
- *argvPtr = argv;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Initialize --
- *
- * 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.
- *
- *---------------------------------------------------------------------------
- */
-
-BLT_EXTERN Tcl_AppInitProc Blt_core_Init;
-BLT_EXTERN Tcl_AppInitProc Blt_core_SafeInit;
-
-#ifndef TCL_ONLY
-BLT_EXTERN Tcl_AppInitProc Blt_x_Init;
-BLT_EXTERN Tcl_AppInitProc Blt_x_SafeInit;
-#endif
-
-#ifdef STATIC_PKGS
-
-/* Picture format packages. */
-#ifndef TCL_ONLY
-BLT_EXTERN Tcl_AppInitProc Blt_PictureBmpInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PictureGifInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PictureJpgInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PicturePbmInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PicturePdfInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PicturePhotoInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PicturePngInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PicturePsInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PictureTifInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PictureXbmInit;
-BLT_EXTERN Tcl_AppInitProc Blt_PictureXpmInit;
-#endif /* TCL_ONLY */
-
-/* Data table format packages. */
-BLT_EXTERN Tcl_AppInitProc Blt_Table_CsvInit;
-#ifdef HAVE_LIBMYSQL
-BLT_EXTERN Tcl_AppInitProc Blt_Table_MysqlInit;
-#endif /* HAVE_LIBMYSQL */
-BLT_EXTERN Tcl_AppInitProc Blt_Table_TreeInit;
-BLT_EXTERN Tcl_AppInitProc Blt_Table_VectorInit;
-#ifdef HAVE_LIBEXPAT
-BLT_EXTERN Tcl_AppInitProc Blt_Table_XmlInit;
-#endif
-
-/* Tree format packages. */
-#ifdef HAVE_LIBEXPAT
-BLT_EXTERN Tcl_AppInitProc Blt_TreeXmlInit;
-#endif
-
-#endif /* STATIC_PKGS */
-
-int
-Initialize(Tcl_Interp *interp) /* Interpreter for application. */
-{
-#ifdef TCLLIBPATH
- /*
- * It seems that some distributions of TCL don't compile-in a
- * default location of the library. This causes Tcl_Init to fail
- * if bltwish and bltsh are moved to another directory. The
- * workaround is to set the magic variable "tclDefaultLibrary".
- */
- Tcl_SetVar(interp, "tclDefaultLibrary", TCLLIBPATH, TCL_GLOBAL_ONLY);
-#endif /* TCLLIBPATH */
- if (Tcl_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- /*
- * 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.
- */
- if (Blt_core_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_core", Blt_core_Init, Blt_core_SafeInit);
-
-#ifdef STATIC_PKGS
- /* Tcl-only static packages */
- if (Blt_Table_CsvInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
-
- /* Data table packages. */
- Tcl_StaticPackage(interp, "blt_datatable_csv", Blt_Table_CsvInit,
- Blt_Table_CsvInit);
-
-#ifdef HAVE_LIBMYSQL
- if (Blt_Table_MysqlInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_datatable_mysql", Blt_Table_MysqlInit,
- Blt_Table_MysqlInit);
-#endif /* HAVE_LIBMYSQL */
-
- if (Blt_Table_TreeInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_datatable_tree", Blt_Table_TreeInit,
- Blt_Table_TreeInit);
-
- if (Blt_Table_VectorInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_datatable_vector", Blt_Table_VectorInit,
- Blt_Table_VectorInit);
-
-#ifdef HAVE_LIBEXPAT
- if (Blt_Table_XmlInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_datatable_xml", Blt_Table_XmlInit,
- Blt_Table_XmlInit);
-#endif /* HAVE_LIBEXPAT */
-
- /* Tree packages. */
-#ifdef HAVE_LIBEXPAT
- if (Blt_TreeXmlInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_tree_xml", Blt_TreeXmlInit, Blt_TreeXmlInit);
-#endif /* HAVE_LIBEXPAT */
-
-#endif /* STATIC_PKGS */
-
-#ifndef TCL_ONLY
- if (Tk_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (Blt_x_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_extra", Blt_x_Init, Blt_x_SafeInit);
-
-#ifdef STATIC_PKGS
-
- /* Picture packages. */
-
- if (Blt_PictureBmpInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_bmp", Blt_PictureBmpInit,
- Blt_PictureBmpInit);
-
- if (Blt_PictureGifInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_gif", Blt_PictureGifInit,
- Blt_PictureGifInit);
-
-#ifdef HAVE_LIBJPG
- if (Blt_PictureJpgInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_jpg", Blt_PictureJpgInit,
- Blt_PictureJpgInit);
-#endif /*HAVE_LIBJPG*/
-
- if (Blt_PicturePbmInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_pbm", Blt_PicturePbmInit,
- Blt_PicturePbmInit);
-
- if (Blt_PicturePhotoInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_photo", Blt_PicturePhotoInit,
- Blt_PicturePhotoInit);
-
-#ifdef HAVE_LIBPNG
- if (Blt_PicturePngInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_png", Blt_PicturePngInit,
- Blt_PicturePngInit);
-#endif /*HAVE_LIBPNG*/
-
- if (Blt_PicturePsInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_ps", Blt_PicturePsInit,
- Blt_PicturePsInit);
-
- if (Blt_PicturePdfInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_pdf", Blt_PicturePdfInit,
- Blt_PicturePdfInit);
-
-#ifdef HAVE_LIBTIF
- if (Blt_PictureTifInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_tif", Blt_PictureTifInit,
- Blt_PictureTifInit);
-#endif /*HAVE_LIBTIF*/
-
- if (Blt_PictureXbmInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_xbm", Blt_PictureXbmInit,
- Blt_PictureXbmInit);
-
-#ifdef HAVE_LIBXPM
- if (Blt_PictureXpmInit(interp) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "blt_picture_xpm", Blt_PictureXpmInit,
- Blt_PictureXpmInit);
-#endif /*HAVE_LIBXPM*/
-
-#endif /* STATIC_PKGS */
-#endif /*TCL_ONLY*/
- /*
- * 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.
- */
-#ifdef TCL_ONLY
- Tcl_SetVar(interp, "tcl_rcFileName", "~/tclshrc.tcl", TCL_GLOBAL_ONLY);
-#else
- Tcl_SetVar(interp, "tcl_rcFileName", "~/wishrc.tcl", TCL_GLOBAL_ONLY);
-#endif
-
-#ifndef TCL_ONLY
-#if (_TCL_VERSION >= _VERSION(8,2,0))
- if (consoleRequired) {
- if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) {
- goto error;
- }
- }
-#else
- /*
- * Initialize the console only if we are running as an interactive
- * application.
- */
- if (Blt_ConsoleInit(interp) == TCL_ERROR) {
- goto error;
- }
-#endif /* _TCL_VERSION >= 8.2.0 */
-#endif /* TCL_ONLY */
- return TCL_OK;
-#ifndef TCL_ONLY
- error:
- WishPanic(Tcl_GetStringResult(interp));
-#endif
- return TCL_ERROR;
-}
-
-#ifdef TCL_ONLY
-/*
- *---------------------------------------------------------------------------
- *
- * main --
- *
- * This is the main program for the application.
- *
- * Results:
- * None: Tcl_Main never returns here, so this procedure never returns
- * either.
- *
- * Side effects:
- * Whatever the application does.
- *
- *---------------------------------------------------------------------------
- */
-int
-main(argc, argv)
- int argc; /* Number of command-line arguments. */
- char **argv; /* Values of command-line arguments. */
-{
- char buffer[MAX_PATH +1];
- char *p;
-
- /*
- * Set up the default locale to be standard "C" locale so parsing is
- * performed correctly.
- */
-
- setlocale(LC_ALL, "C");
- setargv(&argc, &argv);
-
- /*
- * Replace argv[0] with full pathname of executable, and forward slashes
- * substituted for backslashes.
- */
-
- GetModuleFileName(NULL, buffer, sizeof(buffer));
- argv[0] = buffer;
- for (p = buffer; *p != '\0'; p++) {
- if (*p == '\\') {
- *p = '/';
- }
- }
- Tcl_Main(argc, argv, Initialize);
- return 0; /* Needed only to prevent compiler warning. */
-}
-
-#else /* TCL_ONLY */
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * WishPanic --
- *
- * Display a message and exit.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Exits the program.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-WishPanic
-TCL_VARARGS_DEF(const char *, arg1)
-{
- va_list argList;
- char buf[1024];
- const char *format;
-
- format = TCL_VARARGS_START(char *, arg1, argList);
- vsnprintf(buf, 1024, format, argList);
- buf[1023] = '\0';
- MessageBeep(MB_ICONEXCLAMATION);
- MessageBox(NULL, buf, "Fatal Error in Wish",
- MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND);
-#if defined(_MSC_VER) || defined(__BORLANDC__)
- DebugBreak();
-#ifdef notdef /* Panics shouldn't cause exceptions. Simply
- * let the program exit. */
- _asm {
- int 3
- }
-#endif
-#endif /* _MSC_VER || __BORLANDC__ */
- ExitProcess(1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * WinMain --
- *
- * Main entry point from Windows.
- *
- * Results:
- * Returns false if initialization fails, otherwise it never returns.
- *
- * Side effects:
- * Just about anything, since from here we call arbitrary TCL code.
- *
- *---------------------------------------------------------------------------
- */
-
-int APIENTRY
-WinMain(
- HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpszCmdLine,
- int nCmdShow)
-{
- char **argv;
- int argc;
-
- Tcl_SetPanicProc(WishPanic);
-
- /*
- * Set up the default locale to be standard "C" locale so parsing is
- * performed correctly.
- */
-
- setlocale(LC_ALL, "C");
- setargv(&argc, &argv);
-
- /*
- * Increase the application queue size from default value of 8. At the
- * default value, cross application SendMessage of WM_KILLFOCUS will fail
- * because the handler will not be able to do a PostMessage! This is only
- * needed for Windows 3.x, since NT dynamically expands the queue.
- */
-
- SetMessageQueue(64);
-
- /*
- * Create the console channels and install them as the standard channels.
- * All I/O will be discarded until Blt_ConsoleInit is called to attach the
- * console to a text widget.
- */
-#if (_TCL_VERSION >= _VERSION(8,2,0))
- consoleRequired = TRUE;
-#else
- Blt_ConsoleCreate();
-#endif
- Tk_Main(argc, argv, Initialize);
- return 1;
-}
-
-#endif /* TCL_ONLY */
-
-
diff --git a/blt3.0.1/src/bltWinPainter.c b/blt3.0.1/src/bltWinPainter.c
deleted file mode 100644
index 3367fd3..0000000
--- a/blt3.0.1/src/bltWinPainter.c
+++ /dev/null
@@ -1,957 +0,0 @@
-
-/*
- * bltWinPainter.c --
- *
- * This module implements Win32-specific image processing procedures for the
- * BLT toolkit.
- *
- * Copyright 1997-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-#include "bltPicture.h"
-#include "bltPainter.h"
-#include "bltWinPainter.h"
-#include <X11/Xutil.h>
-#include "tkDisplay.h"
-
-#define CLAMP(c) ((((c) < 0.0) ? 0.0 : ((c) > 255.0) ? 255.0 : (c)))
-
-
-#define CFRAC(i, n) ((i) * 65535 / (n))
-/* As for CFRAC, but apply exponent of g. */
-#define CGFRAC(i, n, g) ((int)(65535 * pow((double)(i) / (n), (g))))
-
-typedef struct _Blt_Picture Pict;
-
-/*
- * The following structure is used to encapsulate palette information.
- */
-
-typedef struct {
- HPALETTE palette; /* Palette handle used when drawing. */
- UINT size; /* Number of entries in the palette. */
- int stale; /* 1 if palette needs to be realized,
- * otherwise 0. If the palette is stale,
- * then an idle handler is scheduled to
- * realize the palette. */
- Tcl_HashTable refCounts; /* Hash table of palette entry reference counts
- * indexed by pixel value. */
-} TkWinColormap;
-
-/*
- * PainterKey --
- *
- * This structure represents the key used to uniquely identify painters. A
- * painter is specified by a combination of display, visual, colormap, depth,
- * and monitor gamma value.
- */
-typedef struct {
- Display *display; /* Display of painter. Used to free colors
- * allocated. */
-
- Colormap colormap; /* Colormap used. This may be the default
- * colormap, or an allocated private map. */
-
- int depth; /* Pixel depth of the display. */
-
- float gamma; /* Gamma correction value of monitor. */
-
-} PainterKey;
-
-
-#define GC_PRIVATE 1 /* Indicates if the GC in the painter was
- * shared (allocated by Tk_GetGC) or private
- * (by XCreateGC). */
-
-static Tcl_FreeProc FreePainter;
-
-static Blt_HashTable painterTable;
-static int initialized = 0;
-
-static void
-GetPaletteColors(HDC hDC, Painter *p, Blt_Pixel *colors)
-{
- DWORD flags;
-
- flags = GetDeviceCaps(hDC, RASTERCAPS);
- if (flags & RC_PALETTE) {
- LOGPALETTE *logPalPtr;
- PALETTEENTRY *pePtr;
- Blt_Pixel *dp, *dend;
- TkWinColormap *cmap;
-
- logPalPtr = (LOGPALETTE *) GlobalAlloc(GPTR,
- sizeof(LOGPALETTE) + 256 * sizeof(PALETTEENTRY));
- logPalPtr->palVersion = 0x300;
- cmap = (TkWinColormap *)p->colormap;
- logPalPtr->palNumEntries = GetPaletteEntries(cmap->palette, 0, 256,
- logPalPtr->palPalEntry);
- pePtr = logPalPtr->palPalEntry;
- for (dp = colors, dend = dp + logPalPtr->palNumEntries; dp < dend;
- dp++, pePtr++) {
-#ifdef notdef
- int r, g, b;
- r = p->igammaTable[r];
- g = p->igammaTable[g];
- b = p->igammaTable[b];
-#endif
- dp->Red = pePtr->peRed;
- dp->Green = pePtr->peGreen;
- dp->Blue = pePtr->peBlue;
- dp->Alpha = 0xFF;
- }
- GlobalFree(logPalPtr);
- } else {
- Blt_Pixel *dp, *dend;
- double rScale, gScale, bScale;
- double igamma;
- int i;
- int nRed, nGreen, nBlue;
-
- /*
- * Calculate the RGB coordinates of the colors we want to allocate and
- * store them in *colors.
- */
- igamma = 1.0 / (double)p->gamma;
-
- nRed = nGreen = 8, nBlue = 4;
- rScale = 255.0 / (nRed - 1);
- gScale = 255.0 / (nGreen - 1);
- bScale = 255.0 / (nBlue - 1);
-
- for (i = 0, dp = colors, dend = dp + 256; dp < dend; dp++, i++) {
- int r, g, b;
-
- r = (int)(i * rScale + 0.5);
- g = (int)(i * gScale + 0.5);
- b = (int)(i * bScale + 0.5);
-
- r = p->igammaTable[r];
- g = p->igammaTable[g];
- b = p->igammaTable[b];
-
- dp->Red = (r << 8) + r;
- dp->Green = (g << 8) + g;
- dp->Blue = (b << 8) + b;
- dp->Alpha = 0xFF;
- }
- }
- ReleaseDC(NULL, hDC);
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeGammaTables --
- *
- * Initializes both the power and inverse power tables for the painter
- * with a given gamma value. These tables are used to/from map linear
- * RGB values to/from non-linear monitor intensities.
- *
- * Results:
- * The *gammaTable* and *igammaTable* arrays are filled out to contain
- * the mapped values.
- *
- *---------------------------------------------------------------------------
- */
-static void
-ComputeGammaTables(Painter *p)
-{
- int i;
- double igamma, gamma;
-
- gamma = (double)p->gamma;
- igamma = 1.0 / gamma;
- for (i = 0; i < 256; i++) {
- double value, y;
-
- y = i / 255.0;
- value = pow(y, gamma) * 255.0 + 0.5;
- p->gammaTable[i] = (unsigned char)CLAMP(value);
- value = pow(y, igamma) * 255.0 + 0.5;
- p->igammaTable[i] = (unsigned char)CLAMP(value);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * NewPainter --
- *
- * Creates a new painter to be used to paint pictures. Painters are keyed
- * by the combination of display, colormap, visual, depth, and gamma
- * value used.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- * Side Effects:
- * A color ramp is allocated (not true for TrueColor visuals). Gamma
- * tables are computed and filled.
- *
- *---------------------------------------------------------------------------
- */
-static Painter *
-NewPainter(PainterKey *keyPtr)
-{
- Painter *p;
-
- p = Blt_AssertCalloc(1, sizeof(Painter));
- p->colormap = keyPtr->colormap;
- p->depth = keyPtr->depth;
- p->display = keyPtr->display;
- p->gamma = keyPtr->gamma;
- p->refCount = 0;
-
- ComputeGammaTables(p);
- return p;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FreePainter --
- *
- * Called when the TCL interpreter is idle, this routine frees the
- * painter. Painters are reference counted. Only when no clients are using
- * the painter (the count is zero) is the painter actually freed. By
- * deferring its deletion, this allows client code to call Blt_GetPainter
- * after Blt_FreePainter without incurring a performance penalty.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FreePainter(DestroyData data)
-{
- Painter *p = (Painter *)data;
-
- if (p->refCount <= 0) {
- Blt_DeleteHashEntry(&painterTable, p->hashPtr);
- if (p->gc != NULL) {
- if (p->flags & GC_PRIVATE) {
- XFreeGC(p->display, p->gc);
- } else {
- Tk_FreeGC(p->display, p->gc);
- }
- p->gc = NULL;
- }
- Blt_Free(p);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetPainter --
- *
- * Attempts to retrieve a painter for a particular combination of
- * display, colormap, visual, depth, and gamma value. If no specific
- * painter exists, then one is created.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- * Side Effects:
- * If no current painter exists, a new painter is added to the hash table
- * of painters. Otherwise, the current painter's reference count is
- * incremented indicated how many clients are using the painter.
- *
- *---------------------------------------------------------------------------
- */
-static Painter *
-GetPainter(Display *display, Colormap colormap, int depth, float gamma)
-{
- Painter *p;
- PainterKey key;
- int isNew;
- Blt_HashEntry *hPtr;
-
- if (!initialized) {
- Blt_InitHashTable(&painterTable, sizeof(PainterKey) / sizeof(int));
- initialized = TRUE;
- }
- key.display = display;
- key.colormap = colormap;
- key.depth = depth;
- key.gamma = gamma;
-
- hPtr = Blt_CreateHashEntry(&painterTable, (char *)&key, &isNew);
- if (isNew) {
- p = NewPainter(&key);
- p->hashPtr = hPtr;
- Blt_SetHashValue(hPtr, p);
- } else {
- p = Blt_GetHashValue(hPtr);
- }
- p->refCount++;
- return p;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DrawableToPicture --
- *
- * Takes a snapshot of a DC and converts it to a picture.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred, NULL is
- * returned.
- *
- *---------------------------------------------------------------------------
- */
-static Blt_Picture
-DrawableToPicture(
- Painter *painterPtr,
- Drawable drawable,
- int x, int y,
- int width, int height) /* Dimension of the drawable. */
-{
- BITMAPINFO bmi;
- DIBSECTION ds;
- HBITMAP hBitmap, oldBitmap;
- HDC hDC;
- HDC memDC;
- Pict *destPtr;
- TkWinDCState state;
- void *data;
-
- hDC = TkWinGetDrawableDC(painterPtr->display, drawable, &state);
-
- /* Create the intermediate drawing surface at window resolution. */
- ZeroMemory(&bmi, sizeof(bmi));
- bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bmi.bmiHeader.biWidth = width;
- bmi.bmiHeader.biHeight = height;
- bmi.bmiHeader.biPlanes = 1;
- bmi.bmiHeader.biBitCount = 32;
- bmi.bmiHeader.biCompression = BI_RGB;
-
- hBitmap = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &data, NULL, 0);
- memDC = CreateCompatibleDC(hDC);
- oldBitmap = SelectBitmap(memDC, hBitmap);
-
- if (GetDeviceCaps(hDC, RASTERCAPS) & RC_PALETTE) {
- TkWinColormap *cmap;
-
- cmap = (TkWinColormap *)painterPtr->colormap;
- SelectPalette(hDC, cmap->palette, FALSE);
- RealizePalette(hDC);
- SelectPalette(memDC, cmap->palette, FALSE);
- RealizePalette(memDC);
- }
- destPtr = NULL;
-
- /* Copy the window contents to the memory surface. */
- if (!BitBlt(memDC, 0, 0, width, height, hDC, x, y, SRCCOPY)) {
-#ifdef notdef
- PurifyPrintf("can't blit: %s\n", Blt_LastError());
-#endif
- goto done;
- }
- if (GetObject(hBitmap, sizeof(DIBSECTION), &ds) == 0) {
-#ifdef notdef
- PurifyPrintf("can't get object: %s\n", Blt_LastError());
-#endif
- } else {
- Blt_Pixel *destRowPtr;
- unsigned char *bits, *sp;
-
- bits = (unsigned char *)ds.dsBm.bmBits;
- destPtr = Blt_CreatePicture(width, height);
- destRowPtr = destPtr->bits;
-
- /*
- * Copy the DIB RGB data into the picture. The DIB origin is the
- * bottom-left corner, so the scanlines are stored in reverse order
- * from that of a picture.
- */
- destRowPtr = destPtr->bits + ((height - 1) * destPtr->pixelsPerRow);
- sp = bits;
- for (y = 0; y < height; y++) {
- Blt_Pixel *dp, *dend;
-
- for (dp = destRowPtr, dend = dp + width; dp < dend; dp++) {
- dp->Blue = painterPtr->gammaTable[sp[0]];
- dp->Green = painterPtr->gammaTable[sp[1]];
- dp->Red = painterPtr->gammaTable[sp[2]];
- dp->Alpha = ALPHA_OPAQUE;
- sp += 4;
- }
- destRowPtr -= destPtr->pixelsPerRow;
- }
- }
- done:
- DeleteBitmap(hBitmap);
- DeleteDC(memDC);
- TkWinReleaseDrawableDC(drawable, hDC, &state);
- return destPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaintPicture --
- *
- * Paints the picture to the given drawable. The region of the picture is
- * specified and the coordinates where in the destination drawable is the
- * image to be displayed.
- *
- * The image may be dithered depending upon the bit set in the flags
- * parameter: 0 no dithering, 1 for dithering.
- *
- * Results:
- * Returns TRUE is the picture was successfully display, Otherwise FALSE
- * is returned if the particular combination visual and image depth is
- * not handled.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PaintPicture(
- Painter *painterPtr,
- Drawable drawable,
- Pict *srcPtr,
- int x, int y, /* Coordinates of region in the picture. */
- int w, int h, /* Dimension of the region. Area cannot
- * extend beyond the end of the picture. */
- int dx, int dy, /* Coordinates of region in the drawable. */
- unsigned int flags)
-{
- HDC hDC, memDC;
- Pict *ditherPtr;
- TkWinDCState state;
-
- ditherPtr = NULL;
- hDC = TkWinGetDrawableDC(painterPtr->display, drawable, &state);
- memDC = CreateCompatibleDC(hDC);
- if (GetDeviceCaps(hDC, RASTERCAPS) & RC_PALETTE) {
- TkWinColormap *cmap;
-
- cmap = (TkWinColormap *)painterPtr->colormap;
- SelectPalette(hDC, cmap->palette, FALSE);
- RealizePalette(hDC);
- }
- if (flags & BLT_PAINTER_DITHER) {
- Blt_Pixel colors[256];
-
- GetPaletteColors(hDC, painterPtr, colors);
- ditherPtr = Blt_DitherPicture(srcPtr, colors);
- if (ditherPtr != NULL) {
- srcPtr = ditherPtr;
- }
- }
- assert((x + w) <= srcPtr->width);
- assert((y + h) <= srcPtr->height);
- {
- BITMAPINFO bmi;
- Blt_Pixel *srcRowPtr;
- int sy;
- unsigned char *dp, *bits;
-
- bits = Blt_AssertMalloc(w * h * sizeof(Blt_Pixel));
-
- /*
- * Copy the DIB RGB data into the picture. The DIB scanlines are
- * stored bottom-to-top and the order of the color components is BGRA.
- */
- srcRowPtr = srcPtr->bits + ((y + h - 1) * srcPtr->pixelsPerRow) + x;
- dp = bits;
- for (sy = 0; sy < h; sy++) {
- Blt_Pixel *sp, *send;
-
- for (sp = srcRowPtr, send = sp + w; sp < send; sp++) {
- dp[0] = sp->Blue;
- dp[1] = sp->Green;
- dp[2] = sp->Red;
- dp[3] = ALPHA_OPAQUE;
- dp += 4;
- }
- srcRowPtr -= srcPtr->pixelsPerRow;
- }
-
- /* Create the intermediate drawing surface at window resolution. */
- ZeroMemory(&bmi, sizeof(bmi));
- bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bmi.bmiHeader.biWidth = w;
- bmi.bmiHeader.biHeight = h;
- bmi.bmiHeader.biPlanes = 1;
- bmi.bmiHeader.biBitCount = 32;
- bmi.bmiHeader.biCompression = BI_RGB;
-
- SetDIBitsToDevice(hDC, dx, dy, w, h, 0, 0, 0, h, bits, &bmi,
- DIB_RGB_COLORS);
- Blt_Free(bits);
- }
- TkWinReleaseDrawableDC(drawable, hDC, &state);
- if (ditherPtr != NULL) {
- Blt_FreePicture(ditherPtr);
- }
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PaintPictureWithBlend --
- *
- * Blends and paints the picture in the given drawable. The region of the
- * picture is specified and the coordinates where in the destination
- * drawable is the image to be displayed.
- *
- * The background is snapped from the drawable and converted into a
- * picture. This picture is then blended with the current picture (the
- * background always assumed to be 100% opaque).
- *
- * Results:
- * Returns TRUE is the picture was successfully display, Otherwise FALSE
- * is returned. This may happen if the background can not be obtained
- * from the drawable.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PaintPictureWithBlend(
- Painter *p,
- Drawable drawable,
- Blt_Picture fg,
- int x, int y, /* Coordinates of source region in the
- * picture. */
- int w, int h, /* Dimension of the source region. Region
- * cannot extend beyond the end of the
- * picture. */
- int dx, int dy, /* Coordinates of destination region in the
- * drawable. */
- unsigned int flags,
- int alpha)
-{
- Blt_Picture bg;
-
-#ifdef notdef
- fprintf(stderr, "PaintPictureWithBlend: x=%d,y=%d,w=%d,h=%d,dx=%d,dy=%d\n",
- x, y, w, h, dx, dy);
-#endif
- if (dx < 0) {
- w += dx;
- x -= dx;
- dx = 0;
- }
- if (dy < 0) {
- h += dy;
- y -= dy;
- dy = 0;
- }
- if (dx < 0) {
- dx = 0;
- }
- if (dy < 0) {
- dy = 0;
- }
- if ((w < 0) || (h < 0)) {
- return FALSE;
- }
- bg = DrawableToPicture(p, drawable, dx, dy, w, h);
- if (bg == NULL) {
- return FALSE;
- }
- Blt_BlendPictures(bg, fg, x, y, w, h, 0, 0);
- PaintPicture(p, drawable, bg, 0, 0, w, h, dx, dy, flags);
- Blt_FreePicture(bg);
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPainterFromDrawable --
- *
- * Gets a painter for a particular combination of display, colormap,
- * visual, depth, and gamma value. This information is retrieved from
- * the drawable which is assumed to be a window.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- *---------------------------------------------------------------------------
- */
-Painter *
-Blt_GetPainterFromDrawable(Display *display, Drawable drawable, float gamma)
-{
- XGCValues gcValues;
- unsigned long gcMask;
- Painter *p;
- TkWinBitmap *bmPtr;
-
- bmPtr = (TkWinBitmap *)drawable;
- assert(bmPtr->type != TWD_BITMAP);
- p = GetPainter(display, bmPtr->colormap, bmPtr->depth, gamma);
-
- /*
- * Make a GC with background = black and foreground = white.
- */
- gcMask = GCGraphicsExposures;
- gcValues.graphics_exposures = False;
-
- p->gc = XCreateGC(display, drawable, gcMask, &gcValues);
- p->flags |= GC_PRIVATE;
- return p;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetPainter --
- *
- * Gets a painter for a particular combination of display, colormap,
- * visual, depth, and gamma value. This information (except for the
- * monitor's gamma value) is retrieved from the given Tk window.
- *
- * Results:
- * A pointer to the new painter is returned.
- *
- *---------------------------------------------------------------------------
- */
-Painter *
-Blt_GetPainter(Tk_Window tkwin, float gamma)
-{
- Painter *p;
- XGCValues gcValues;
- unsigned long gcMask;
-
- p = GetPainter(Tk_Display(tkwin), Tk_Colormap(tkwin), Tk_Depth(tkwin),
- gamma);
-
- /*
- * Make a GC with background = black and foreground = white.
- */
- gcMask = GCGraphicsExposures;
- gcValues.graphics_exposures = False;
- p->gc = Tk_GetGC(tkwin, gcMask, &gcValues);
- p->flags &= ~GC_PRIVATE;
- return p;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FreePainter --
- *
- * Frees the painter. Painters are reference counted. Only when no
- * clients are using the painter (the count is zero) is the painter
- * actually freed.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_FreePainter(Painter *p)
-{
- p->refCount--;
- if (p->refCount <= 0) {
- Tcl_EventuallyFree(p, FreePainter);
- }
-}
-
-GC
-Blt_PainterGC(Painter *p)
-{
- return p->gc;
-}
-
-int
-Blt_PainterDepth(Painter *p)
-{
- return p->depth;
-}
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_WindowToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and
- * converts it to a picture.
- *
- * This routine is used to snap foreign (non-Tk) windows. For
- * pixmaps and Tk windows, Blt_DrawableToPicture is preferred.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred,
- * NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_WindowToPicture(
- Display *display,
- Drawable drawable,
- int x, int y, /* Offset of image from the drawable's
- * origin. */
- int width, int height, /* Dimension of the image. Image must
- * be completely contained by the
- * drawable. */
- float gamma)
-{
- Blt_Painter painter;
- Blt_Picture dump; /* Picture containing dump of window. */
-
- painter = Blt_GetPainterFromDrawable(display, drawable, gamma);
- dump = DrawableToPicture(painter, drawable, x, y, width, height);
- Blt_FreePainter(painter);
- return dump;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DrawableToPicture --
- *
- * Takes a snapshot of an X drawable (pixmap or window) and
- * converts it to a picture.
- *
- * Results:
- * Returns a picture of the drawable. If an error occurred,
- * NULL is returned.
- *
- *---------------------------------------------------------------------------
- */
-Blt_Picture
-Blt_DrawableToPicture(
- Tk_Window tkwin,
- Drawable drawable,
- int x, int y, /* Offset of image from the drawable's
- * origin. */
- int width, int height, /* Dimension of the image. Image must
- * be completely contained by the
- * drawable. */
- float gamma)
-{
- Blt_Painter painter;
- Blt_Picture dump; /* Picture containing dump of drawable. */
-
- painter = Blt_GetPainter(tkwin, gamma);
- dump = DrawableToPicture(painter, drawable, x, y, width, height);
- Blt_FreePainter(painter);
- return dump;
-}
-
-
-
-int
-Blt_PaintPicture(
- Blt_Painter painter,
- Drawable drawable,
- Blt_Picture picture,
- int ax, int ay, /* Starting coordinates of subregion in the
- * picture to be painted. */
- int aw, int ah, /* Dimension of the subregion. */
- int x, int y, /* Coordinates of region in the drawable. */
- unsigned int flags)
-{
- /*
- * Nothing to draw. The region offset starts beyond the end of the
- * picture.
- *
- * +---------------+
- * | |
- * | |
- * | | ax,ay
- * | | +---------+
- * | | | |
- * +---------------+ | |
- * | |
- * +---------+
- */
- if ((picture == NULL) ||
- (ax >= Blt_PictureWidth(picture)) ||
- (ay >= Blt_PictureHeight(picture))) {
- return TRUE;
- }
- /*
- * Correct the dimensions if the origin starts before the picture
- * (i.e. coordinate is negative). Reset the coordinate the 0.
- *
- * ax,ay
- * +---------+ ax,ay
- * | +------|--------+ +------+--------+
- * | | | | | | |
- * | | | | | | |
- * +--|------+ | +------+ |
- * | | | |
- * | | | |
- * +---------------+ +---------------+
- *
- */
- if (ax < 0) {
- aw += ax;
- ax = 0;
- }
- if (ay < 0) {
- ah += ay;
- ay = 0;
- }
- /*
- * Check that the given area does not extend beyond the end of the
- * picture.
- *
- * +-----------------+ +-----------------+
- * | | | |
- * | ax,ay | | ax,ay |
- * | +---------+ | +-------+
- * | | | | | | |
- * | | | | | | |
- * +---------|-------+ | +---------+-------+
- * +---------+
- *
- * Clip the end of the area if it's too big.
- */
- if ((aw + ax) > Blt_PictureWidth(picture)) {
- aw = Blt_PictureWidth(picture) - ax;
- }
- if ((ah + ay) > Blt_PictureHeight(picture)) {
- ah = Blt_PictureHeight(picture) - ay;
- }
- /* Check that there's still something to paint. */
- if ((aw <= 0) || (ah <= 0)) {
- return TRUE;
- }
-#ifdef notdef
- if (x < 0) {
- x = 0;
- }
- if (y < 0) {
- y = 0;
- }
-#endif
- if (Blt_PictureIsOpaque(picture)) {
- return PaintPicture(painter, drawable, picture, ax, ay,
- aw, ah, x, y, flags);
- } else {
- int alpha = 128;
-
- return PaintPictureWithBlend(painter, drawable, picture, ax, ay,
- aw, ah, x, y, flags, alpha);
- }
-}
-
-int
-Blt_PaintPictureWithBlend(
- Blt_Painter painter,
- Drawable drawable,
- Blt_Picture picture,
- int x, int y, /* Coordinates of region in the picture. */
- int w, int h, /* Dimension of the region. Area cannot
- * extend beyond the end of the picture. */
- int dx, int dy, /* Coordinates of region in the drawable. */
- unsigned int flags, /* Indicates whether to dither the picture
- * before displaying. */
- double falpha)
-{
- int alpha;
-
- alpha = (int)(falpha * 255.0 + 0.5);
-
- /*
- * Nothing to draw. The selected region is outside of the picture.
- *
- * 0,0
- * +---------+
- * | |
- * | Picture |
- * | |
- * +---------+
- * x,y
- * +-------+
- * | |
- * | | h
- * +-------+
- * w
- */
- if ((picture == NULL) ||
- (x >= Blt_PictureWidth(picture)) ||
- (y >= Blt_PictureHeight(picture)) ||
- ((x + w) <= 0) || ((y + h) <= 0)) {
- return TRUE;
- }
- /*
- * Correct the dimensions if the origin starts before the picture
- * (i.e. coordinate is negative). Reset the coordinate the 0.
- *
- * x,y
- * +---------+ x,y = 0,0
- * | +------|--------+ +------+--------+
- * h | |0,0 | | | | |
- * | | | | | | |
- * +--|------+ | +------+ |
- * w | | | |
- * | | | |
- * +---------------+ +---------------+
- *
- */
- if (x < 0) {
- w += x;
- x = 0;
- }
- if (y < 0) {
- h += y;
- y = 0;
- }
-
- /*
- * Check that the given area does not extend beyond the end of the
- * picture.
- *
- * 0,0 0,0
- * +-----------------+ +-----------------+
- * | | | |
- * | x,y | | x,y |
- * | +---------+ | +-------+
- * | | | | | | |
- * | | | | w | | |
- * +---------|-------+ | +---------+-------+
- * +---------+
- * h
- *
- * Clip the end of the area if it's too big.
- */
- if ((x + w) > Blt_PictureWidth(picture)) {
- w = Blt_PictureWidth(picture) - x;
- }
- if ((y + h) > Blt_PictureHeight(picture)) {
- h = Blt_PictureHeight(picture) - y;
- }
- if (dx < 0) {
- dx = 0;
- }
- if (dy < 0) {
- dy = 0;
- }
- /* Check that there's still something to paint. */
- if ((w <= 0) || (h <= 0)) {
- return TRUE;
- }
- return PaintPictureWithBlend(painter, drawable, picture, x, y, w, h, dx, dy,
- flags, alpha);
-}
-
diff --git a/blt3.0.1/src/bltWinPainter.h b/blt3.0.1/src/bltWinPainter.h
deleted file mode 100644
index a3072ad..0000000
--- a/blt3.0.1/src/bltWinPainter.h
+++ /dev/null
@@ -1,106 +0,0 @@
-
-/*
- * bltWinPainter.h --
- *
- * This header contains the private definitions for a painter in
- * the BLT toolkit.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The color allocation routines are adapted from tkImgPhoto.c of the
- * Tk library distrubution. The photo image type was designed and
- * implemented by Paul Mackerras.
- *
- * Copyright (c) 1987-1993 The Regents of the University of
- * California.
- *
- * Copyright (c) 19941998 Sun Microsystems, Inc.
- *
- */
-
-#ifndef _BLT_WIN_PAINTER_H
-#define _BLT_WIN_PAINTER_H
-
-#ifdef notdef
-#define PAINTER_COLOR_WINDOW (1<<0)
-#define PAINTER_BW (1<<1)
-#define PAINTER_MAP_COLORS (1<<2)
-#endif
-
-/*
- * Painter --
- *
- * This structure represents a painter used to display picture images. A
- * painter is specified by a combination of display, colormap, depth, and
- * monitor gamma value. Painters contain information necessary to display a
- * picture. This includes both an RGB to pixel map, and a RGB to allocated
- * color map.
- *
- * Painters may be shared by more than one client and are reference counted.
- * When no clients are using the painter, it is freed.
- */
-
-struct _Blt_Painter {
- Display *display; /* Display of painter. Used to free colors
- * allocated. */
-
- int depth; /* Pixel depth of the display. */
-
- float gamma; /* Gamma correction value of monitor. */
-
- Colormap colormap;
-
- unsigned int flags; /* Flags listed below. */
-
- int refCount; /* # of clients using this painter. If zero,
- * # the painter is freed. */
-
- Blt_HashEntry *hashPtr; /* Used to delete the painter entry from the
- * hash table of painters. */
-
- GC gc; /* GC used to draw the image. */
-
- unsigned char gammaTable[256]; /* Input gamma lookup table. Used to map
- * non-linear monitor values back to RGB
- * values. This is used whenever we take a
- * snapshot of the screen (e.g. alpha
- * blending). Computes the power mapping. D
- * = I^gamma. */
-
- unsigned char igammaTable[256]; /* Output gamma lookup table. Used to map
- * RGB values to non-linear monitor
- * values. Computes the inverse power mapping.
- * I~ = D^1/gamma. */
-
- Blt_Pixel palette[256]; /* Maps the picture's 8-bit RGB values to the
- * RGB values of the colors actually
- * allocated. This is used for dithering the
- * picture. */
-
-};
-
-typedef struct _Blt_Painter Painter;
-
-#endif /* _BLT_WIN_PAINTER_H */
diff --git a/blt3.0.1/src/bltWinPipe.c b/blt3.0.1/src/bltWinPipe.c
deleted file mode 100644
index 626fd94..0000000
--- a/blt3.0.1/src/bltWinPipe.c
+++ /dev/null
@@ -1,2481 +0,0 @@
-
-/*
- * bltWinPipe.c --
- *
- * This modules replacements for the former Tcl_CreatePipeline API
- * under Windows. This file contains the generic portion of the
- * command channel driver as well as various utility routines used in
- * managing subprocesses.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Parts taken from tclPipe.c and tclWinPipe.c in the TCL distribution.
- *
- * Copyright (c) 1997 by Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and
- * redistribution of this file, and for a DISCLAIMER OF ALL
- * WARRANTIES.
- *
- */
-
-/*
- * Todo:
- * Test on win95
- * Does terminating bltwish kill child processes?
- * Handle EOL translation more cleanly.
- */
-
-#include "bltInt.h"
-#include "bltChain.h"
-#include <fcntl.h>
-
-#define PEEK_DEBUG 0
-#define QUEUE_DEBUG 0
-#define READER_DEBUG 0
-#define ASYNC_DEBUG 0
-#define KILL_DEBUG 0
-
-/*
- * The following type identifies the various types of applications that
- * run under windows. There is special case code for the various types.
- */
-typedef enum ApplicationTypes {
- APPL_NONE,
- APPL_DOS,
- APPL_WIN3X,
- APPL_WIN32,
- APPL_INTERP
-} ApplicationType;
-
-#ifndef IMAGE_OS2_SIGNATURE
-# define IMAGE_OS2_SIGNATURE (0x454E)
-#endif
-#ifndef IMAGE_VXD_SIGNATURE
-# define IMAGE_VXD_SIGNATURE (0x454C)
-#endif
-
-#define PIPE_BUFSIZ (BUFSIZ*2) /* Size of pipe read buffer. */
-
-#define PIPE_PENDING (1<<13) /* Message is pending in the queue. */
-#define PIPE_EOF (1<<14) /* Pipe has reached EOF. */
-#define PIPE_DELETED (1<<15) /* Indicates if the pipe has been deleted
- * but its memory hasn't been freed yet. */
-
-typedef struct {
- int flags; /* State flags, see above for a list. */
- HANDLE hPipe; /* Pipe handle */
- HANDLE thread; /* Thread watching I/O on this pipe. */
- HANDLE parent; /* Handle of main thread. */
- DWORD parentId; /* Main thread ID. */
- HWND hWindow; /* Notifier window in main thread. Used to
- * goose the TCL notifier system indicating
- * that an event has occurred that it
- * needs to process. */
- HANDLE idleEvent; /* Signals that the pipe is idle (no one
- * is reading/writing from it). */
- HANDLE readyEvent; /* Signals that the pipe is ready for
- * the next I/O operation. */
-
- DWORD lastError; /* Error. */
-
- char *buffer; /* Current background output buffer. */
- size_t start, end; /* Pointers into the output buffer */
- size_t size; /* Size of buffer. */
-
- Tcl_FileProc *proc;
- ClientData clientData;
-
-} PipeHandler;
-
-
-typedef struct {
- Tcl_Event header; /* Information that is standard for
- * all events. */
-
- PipeHandler *pipePtr; /* Pointer to pipe handler structure.
- * Note that we still have to verify
- * that the pipe exists before
- * dereferencing this pointer. */
-} PipeEvent;
-
-static int initialized = 0;
-static struct _Blt_Chain pipeChain;
-static CRITICAL_SECTION pipeCriticalSection;
-
-static DWORD WINAPI PipeWriterThread(void *clientData);
-static DWORD WINAPI PipeReaderThread(void *clientData);
-
-static Tcl_FreeProc DestroyPipe;
-
-BLT_EXTERN void Blt_MapPid(HANDLE hProcess, DWORD pid);
-
-#ifndef USE_TCL_STUBS
-BLT_EXTERN HINSTANCE TclWinGetTclInstance(void);
-BLT_EXTERN void TclWinConvertError(DWORD lastError);
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * NotifierWindowProc --
- *
- * This procedure is called to goose the TCL notifier layer when
- * service pending events. The notifier is built upon the
- * Windows message system. The Windows event loop may need to be
- * awakened if it's blocked waiting on messages. Our psuedo
- * pipes (e.g. data available on a pipe) won't do that. While
- * there may be events pending in the TCL queue, Windows knows
- * nothing about TCL events and won't unblock until the next
- * Windows message arrives.
- *
- * This routine sits in the main thread and is triggered by
- * messages posted to a notifier window (we set it up earlier)
- * from the reader/writer pipe threads. It's purpose is two
- * fold.
- *
- * 1) unblock Windows (posting the message does that) and
- * 2) call Tcl_ServiceAll from the main thread.
- *
- * Results:
- * A standard Windows result.
- *
- * Side effects:
- * Services any pending TCL events.
- *
- *---------------------------------------------------------------------------
- */
-static LRESULT CALLBACK
-NotifierWindowProc(
- HWND hWindow,
- UINT message,
- WPARAM wParam,
- LPARAM lParam)
-{
- switch (message) {
- case WM_USER:
- case WM_TIMER:
- break;
-
- default:
- return DefWindowProc(hWindow, message, wParam, lParam);
- }
-
- Tcl_ServiceAll(); /* Process all run-able events. */
- return 0;
-}
-
-static void
-WakeupNotifier(HWND hWindow)
-{
- PostMessage(hWindow, WM_USER, 0, 0);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetNotifierWindow --
- *
- * Initializes the platform specific notifier state.
- *
- * Results:
- * Returns a handle to the notifier state for this thread..
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static HWND
-GetNotifierWindow(void)
-{
- static HWND hWindow = NULL;
- /*
- * Register Notifier window class if this is the first thread to
- * use this module.
- */
- if (hWindow == NULL) {
- WNDCLASS class;
- HINSTANCE hInstance;
-
- memset(&class, 0, sizeof(WNDCLASS));
- hInstance = TclWinGetTclInstance();
- class.hInstance = hInstance;
- class.lpszClassName = "PipeNotifier";
- class.lpfnWndProc = NotifierWindowProc;
-
- if (!RegisterClassA(&class)) {
- panic("Unable to register PipeNotifier window class");
- }
- /*
- * Create a window for communication with the notifier.
- */
- hWindow = CreateWindowA("PipeNotifier", "PipeNotifier", WS_TILED,
- 0, 0, 0, 0, NULL, NULL, hInstance, NULL);
- }
- return hWindow;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PeekOnPipe --
- *
- * See if some data is available, the pipe is at EOF, or the
- * reader thread is currently blocked waiting for data.
- *
- * Results:
- * Return TRUE if data is available, FALSE if otherwise. Note
- * that errors and EOF always return TRUE. We always make the
- * condition available until the caller handles it by deleting
- * the pipe event handler.
- *
- * On TRUE, the number of bytes returned indicates the following:
- * 0 EOF.
- * -1 An error has occured or the thread is currently
- * blocked reading. In that last case, errno is set
- * to EAGAIN.
- * >0 Number of bytes of data in the buffer.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PeekOnPipe(
- PipeHandler *pipePtr, /* Pipe state. */
- int *nAvailPtr)
-{
- int state;
-
- *nAvailPtr = -1;
-#if PEEK_DEBUG
- PurifyPrintf("PEEK(%d): waiting for reader\n", pipePtr->hPipe);
-#endif
- state = WaitForSingleObject(pipePtr->readyEvent, 0);
-#if PEEK_DEBUG
- PurifyPrintf("PEEK(%d): state is %d\n", pipePtr->hPipe, state);
-#endif
- if (state == WAIT_TIMEOUT) {
-#if PEEK_DEBUG
- PurifyPrintf("PEEK(%d): try again, %d\n", pipePtr->hPipe, state);
-#endif
- errno = EAGAIN;
- return FALSE; /* Reader thread is currently blocked. */
- }
- /*
- * At this point the two threads are synchronized. So it's safe
- * to access shared information.
- */
- if (state == WAIT_OBJECT_0) {
- int nAvail;
-
- nAvail = pipePtr->end - pipePtr->start;
-#if PEEK_DEBUG
- PurifyPrintf("PEEK(%d): Found %d bytes available\n",
- pipePtr->hPipe, nAvail);
-#endif
- if ((nAvail <= 0) && !(pipePtr->flags & PIPE_EOF)) {
- TclWinConvertError(pipePtr->lastError);
-#if PEEK_DEBUG
- PurifyPrintf("PEEK(%d): Error = %d\n",
- pipePtr->hPipe, pipePtr->lastError);
-#endif
- nAvail = -1;
- }
- *nAvailPtr = nAvail;
- }
-#if PEEK_DEBUG
- PurifyPrintf("PEEK(%d): Reseting events\n", pipePtr->hPipe);
-#endif
- return TRUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PipeEventProc --
- *
- * This function is invoked by Tcl_ServiceEvent when a file event
- * reaches the front of the event queue. This procedure calls back
- * the handler procedure designated for this pipe.
- *
- * Results:
- * Returns 1 if the event was handled, meaning it should be removed
- * from the queue. Returns 0 if the event was not handled, meaning
- * it should stay on the queue. The only time the event isn't
- * handled is if the TCL_FILE_EVENTS flag bit isn't set.
- *
- * Side effects:
- * Whatever the pipe handler callback does.
- *
- *---------------------------------------------------------------------------
- */
-static int
-PipeEventProc(Tcl_Event * eventPtr, int flags)
-{
- PipeHandler *pipePtr;
-
- if (!(flags & TCL_FILE_EVENTS)) {
- return 0;
- }
- pipePtr = ((PipeEvent *) eventPtr)->pipePtr;
- if ((pipePtr != NULL) && !(pipePtr->flags & PIPE_DELETED)) {
- Tcl_Preserve(pipePtr);
- if (pipePtr->proc != NULL) {
- (*pipePtr->proc) (pipePtr->clientData, flags);
- }
- /* Allow more events again. */
- pipePtr->flags &= ~PIPE_PENDING;
- Tcl_Release(pipePtr);
- }
- return 1;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetupHandlers --
- *
- * This procedure is invoked before Tcl_DoOneEvent blocks waiting
- * for an event.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Adjusts the block time if needed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-SetupHandlers(ClientData clientData, int flags)
-{
- Blt_Chain chain = clientData;
- PipeHandler *pipePtr;
- Blt_ChainLink link;
- int dontBlock, nBytes;
- Tcl_Time blockTime;
-
- if (!(flags & TCL_FILE_EVENTS)) {
- return;
- }
- /*
- * Loop through the list of pipe handlers. Check if any I/O
- * events are currently pending.
- */
- dontBlock = FALSE;
- blockTime.sec = blockTime.usec = 0L;
-#if QUEUE_DEBUG
- PurifyPrintf("SetupHandlers: before loop\n");
-#endif
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- pipePtr = Blt_Chain_GetValue(link);
- if (pipePtr->flags & PIPE_DELETED) {
- continue; /* Ignore pipes pending to be freed. */
- }
- if (pipePtr->flags & TCL_READABLE) {
- if (PeekOnPipe(pipePtr, &nBytes)) {
- dontBlock = TRUE;
- }
- }
- if (pipePtr->flags & TCL_WRITABLE) {
- if (WaitForSingleObject(pipePtr->readyEvent, 0) != WAIT_TIMEOUT) {
- dontBlock = TRUE;
- }
- }
- }
-#if QUEUE_DEBUG
- PurifyPrintf("SetupHandlers: after loop\n");
-#endif
- if (dontBlock) {
- Tcl_SetMaxBlockTime(&blockTime);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CheckHandlers --
- *
- * This procedure is called by Tcl_DoOneEvent to check the pipe
- * event source for events.
- *
- * Results:
- * None.
- *
- * Side effects:
- * May queue an event.
- *
- *---------------------------------------------------------------------------
- */
-static void
-CheckHandlers(ClientData clientData, int flags)
-{
- Blt_Chain chain = clientData;
- PipeHandler *pipePtr;
- Blt_ChainLink link;
- int queueEvent, nBytes;
-
- if ((flags & TCL_FILE_EVENTS) == 0) {
- return;
- }
- /* Queue events for any ready pipes that aren't already queued. */
-
- for (link = Blt_Chain_FirstLink(chain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- pipePtr = Blt_Chain_GetValue(link);
- if (pipePtr->flags & (PIPE_PENDING | PIPE_DELETED)) {
- continue; /* If this pipe already is scheduled to
- * service an event, wait for it to handle
- * it. */
- }
- /* Queue an event if the pipe is signaled for reading or writing. */
- queueEvent = FALSE;
- if (pipePtr->flags & TCL_READABLE) {
- if (PeekOnPipe(pipePtr, &nBytes)) {
- queueEvent = TRUE;
- }
- }
- if (pipePtr->flags & TCL_WRITABLE) {
- if (WaitForSingleObject(pipePtr->readyEvent, 0) != WAIT_TIMEOUT) {
- queueEvent = TRUE;
- }
- }
-#if QUEUE_DEBUG
- PurifyPrintf("Queue event is %d \n", queueEvent);
-#endif
- if (queueEvent) {
- PipeEvent *eventPtr;
-
- pipePtr->flags |= PIPE_PENDING;
- eventPtr = Blt_AssertMalloc(sizeof(PipeEvent));
- eventPtr->header.proc = PipeEventProc;
- eventPtr->pipePtr = pipePtr;
- Tcl_QueueEvent((Tcl_Event *) eventPtr, TCL_QUEUE_TAIL);
- }
- }
-}
-
-static PipeHandler *
-CreatePipeHandler(HANDLE hFile, int flags)
-{
- DWORD id;
- PipeHandler *pipePtr;
- LPTHREAD_START_ROUTINE threadProc;
-
- pipePtr = Blt_AssertCalloc(1, sizeof(PipeHandler));
- pipePtr->hPipe = hFile;
- pipePtr->flags = flags;
- pipePtr->parentId = GetCurrentThreadId();
- pipePtr->parent = GetCurrentThread();
- pipePtr->hWindow = GetNotifierWindow();
- pipePtr->readyEvent = CreateEvent(
- NULL, /* Security attributes. */
- TRUE, /* Manual reset event */
- FALSE, /* Initially not signaled. */
- NULL); /* Event object's name. */
- pipePtr->idleEvent = CreateEvent(
- NULL, /* Security attributes. */
- FALSE, /* Auto reset event. */
- TRUE, /* Initially signaled. */
- NULL); /* Event object's name. */
-
- if (flags & TCL_READABLE) {
- threadProc = (LPTHREAD_START_ROUTINE) PipeReaderThread;
- pipePtr->buffer = Blt_AssertCalloc(1, PIPE_BUFSIZ);
- pipePtr->size = PIPE_BUFSIZ;
- } else {
- threadProc = (LPTHREAD_START_ROUTINE) PipeWriterThread;
- }
-
- pipePtr->thread = CreateThread(
- NULL, /* Security attributes */
- 8000, /* Initial stack size. */
- threadProc, /* Starting address of thread routine */
- (DWORD *) pipePtr, /* One-word of data passed to routine. */
- 0, /* Creation flags */
- &id); /* (out) Will contain Id of new thread. */
- return pipePtr;
-}
-
-static void
-DestroyPipe(DestroyData data)
-{
- PipeHandler *pipePtr = (PipeHandler *)data;
-
- if (pipePtr->buffer != NULL) {
- Blt_Free(pipePtr->buffer);
- }
- Blt_Free(pipePtr);
-}
-
-static void
-DeletePipeHandler(PipeHandler * pipePtr)
-{
-#if KILL_DEBUG
- PurifyPrintf("DestroyPipeHandler(%d)\n", pipePtr->hPipe);
-#endif
- if ((pipePtr->flags & TCL_WRITABLE) &&
- (pipePtr->hPipe != INVALID_HANDLE_VALUE)) {
- /* Wait for the writer thread to finish with the current buffer */
- WaitForSingleObject(pipePtr->idleEvent, INFINITE);
- }
- if (pipePtr->hPipe != INVALID_HANDLE_VALUE) {
- CloseHandle(pipePtr->hPipe);
- }
- CloseHandle(pipePtr->readyEvent);
- CloseHandle(pipePtr->idleEvent);
- CloseHandle(pipePtr->thread);
-
- pipePtr->idleEvent = pipePtr->readyEvent = INVALID_HANDLE_VALUE;
- pipePtr->thread = pipePtr->hPipe = INVALID_HANDLE_VALUE;
- pipePtr->flags |= PIPE_DELETED; /* Mark the pipe has deleted. */
-
- Tcl_EventuallyFree(pipePtr, DestroyPipe);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PipeInit --
- *
- * This function initializes the static variables for this file.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates a new event source.
- *
- *---------------------------------------------------------------------------
- */
-static void
-PipeInit(void)
-{
- initialized = TRUE;
- InitializeCriticalSection(&pipeCriticalSection);
- Blt_Chain_Init(&pipeChain);
- Tcl_CreateEventSource(SetupHandlers, CheckHandlers, &pipeChain);
-}
-
-static PipeHandler *
-GetPipeHandler(HANDLE hPipe)
-{
- PipeHandler *pipePtr;
- Blt_ChainLink link;
-
- for (link = Blt_Chain_FirstLink(&pipeChain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- pipePtr = Blt_Chain_GetValue(link);
- if ((pipePtr->hPipe == hPipe) && !(pipePtr->flags & PIPE_DELETED)){
- return pipePtr;
- }
- }
- return NULL;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_PipeTeardown --
- *
- * This function releases any storage allocated for this file.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates a new event source.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_PipeTeardown(void)
-{
- Blt_ChainLink link;
- PipeHandler *pipePtr;
-
- if (!initialized) {
- return; /* Was never initialized. */
- }
- initialized = FALSE;
- EnterCriticalSection(&pipeCriticalSection);
- for (link = Blt_Chain_FirstLink(&pipeChain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- pipePtr = Blt_Chain_GetValue(link);
- if ((pipePtr != NULL) && !(pipePtr->flags & PIPE_DELETED)) {
- DeletePipeHandler(pipePtr);
- }
- }
- DestroyWindow(GetNotifierWindow());
- UnregisterClassA("PipeNotifier", TclWinGetTclInstance());
-
- Blt_Chain_Reset(&pipeChain);
- LeaveCriticalSection(&pipeCriticalSection);
- Tcl_DeleteEventSource(SetupHandlers, CheckHandlers, &pipeChain);
- DeleteCriticalSection(&pipeCriticalSection);
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * PipeReaderThread --
- *
- * This function runs in a separate thread and waits for input
- * to become available on a pipe.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Signals the main thread when input become available. May
- * cause the main thread to wake up by posting a message.
- *
- *---------------------------------------------------------------------------
- */
-static DWORD WINAPI
-PipeReaderThread(void *clientData)
-{
- PipeHandler *pipePtr = (PipeHandler *) clientData;
- DWORD count;
- BOOL result;
-
- for (;;) {
- if (pipePtr->flags & PIPE_DELETED) {
- break;
- }
- /* Synchronize with the main thread so that we don't try to
- * read from the pipe while it's copying to the buffer. */
-#if READER_DEBUG
- PurifyPrintf("READER(%d): waiting\n", pipePtr->hPipe);
-#endif
- WaitForSingleObject(pipePtr->idleEvent, INFINITE);
-#if READER_DEBUG
- PurifyPrintf("READER(%d): ok\n", pipePtr->hPipe);
-#endif
- /* Read from the pipe. The thread will block here until some
- * data is read into its buffer. */
-#if READER_DEBUG
- PurifyPrintf("READER(%d): before read\n", pipePtr->hPipe);
-#endif
- assert(pipePtr->start == pipePtr->end);
- result = ReadFile(
- pipePtr->hPipe, /* Handle to anonymous pipe. */
- pipePtr->buffer, /* Data buffer. */
- pipePtr->size, /* Requested number of bytes (the size
- * of the buffer) */
- &count, /* (out) Number of bytes actually read. */
- NULL); /* Overlapping I/O */
-
- if (result) {
-#if READER_DEBUG
- PurifyPrintf("READER(%d): after read. status=%d, count=%d\n",
- pipePtr->hPipe, result, count);
-#endif
- }
- /*
- * Reset counters to indicate that the buffer has been refreshed.
- */
- pipePtr->start = 0;
- pipePtr->end = count;
- if (count == 0) {
- /* We've hit EOF or an error. */
- pipePtr->lastError = GetLastError();
- if ((pipePtr->lastError == ERROR_BROKEN_PIPE) ||
- (pipePtr->lastError == ERROR_HANDLE_EOF)) {
- pipePtr->flags |= PIPE_EOF;
- }
-#if READER_DEBUG
- PurifyPrintf("READER(%d): error is %s\n",
- pipePtr->hPipe, Blt_LastError());
-#endif
- }
- WakeupNotifier(pipePtr->hWindow);
- SetEvent(pipePtr->readyEvent);
- if (count == 0) {
-#if READER_DEBUG
- PurifyPrintf("READER(%d): exiting\n", pipePtr->hPipe);
-#endif
- ExitThread(0);
- }
- }
- /* NOTREACHED */
- return 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PipeWriterThread --
- *
- * This function runs in a separate thread and writes data
- * to the process' standard input pipe.
- *
- * Results:
- * Always returns 0.
- *
- * Side effects:
- * Signals the main thread when an output operation is completed.
- * May cause the main thread to wake up by posting a message.
- *
- *---------------------------------------------------------------------------
- */
-static DWORD WINAPI
-PipeWriterThread(void *clientData)
-{
- PipeHandler *pipePtr = (PipeHandler *) clientData;
- DWORD count, bytesLeft;
- char *ptr;
-
- for (;;) {
- if (pipePtr->flags & PIPE_DELETED) {
- break;
- }
-
- /*
- * Synchronize with the main thread so that we don't test the
- * pipe until its done writing.
- */
-
- WaitForSingleObject(pipePtr->idleEvent, INFINITE);
-
- ptr = pipePtr->buffer;
- bytesLeft = pipePtr->end;
-
- /* Loop until all of the bytes are written or an error occurs. */
-
- while (bytesLeft > 0) {
- if (!WriteFile(pipePtr->hPipe, ptr, bytesLeft, &count, NULL)) {
- pipePtr->lastError = GetLastError();
- break;
- }
- bytesLeft -= count;
- ptr += count;
- }
-
- /* Tell the main thread that data can be written to the pipe.
- * Remember to wake up the notifier thread. */
-
- SetEvent(pipePtr->readyEvent);
- WakeupNotifier(pipePtr->hWindow);
- }
- /* NOTREACHED */
- return 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TempFileName --
- *
- * Gets a temporary file name and deals with the fact that the
- * temporary file path provided by Windows may not actually exist
- * if the TMP or TEMP environment variables refer to a
- * non-existent directory.
- *
- * Results:
- * 0 if error, non-zero otherwise. If non-zero is returned, the
- * name buffer will be filled with a name that can be used to
- * construct a temporary file.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-TempFileName(char *name) /* (out) Buffer to hold name of
- * temporary file. */
-{
- if ((GetTempPath(MAX_PATH, name) > 0) &&
- (GetTempFileName(name, "TCL", 0, name))) {
- return 1;
- }
- /* Bail out and use the current working directory. */
- return GetTempFileName(".", "TCL", 0, name);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * OpenRedirectFile --
- *
- * Open a file for use in a pipeline.
- *
- * Results:
- * Returns a new handle or NULL on failure.
- *
- * Side effects:
- * May cause a file to be created on the file system.
- *
- *---------------------------------------------------------------------------
- */
-static HANDLE
-OpenRedirectFile(
- const char *path,
- DWORD accessFlags,
- DWORD createFlags)
-{
- HANDLE hFile;
- DWORD attribFlags;
- int useExisting;
-
- attribFlags = 0;
- useExisting = (createFlags & (TRUNCATE_EXISTING | OPEN_EXISTING));
- if (useExisting) {
- attribFlags = GetFileAttributes(path);
- if (attribFlags == 0xFFFFFFFF) {
- attribFlags = 0;
- }
- }
- hFile = CreateFile(path,
- accessFlags, /* Access mode flags */
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL, /* No security */
- createFlags, /* Creation attributes */
- attribFlags, /* File attribute flags */
- NULL); /* Template file */
-
- if (hFile == INVALID_HANDLE_VALUE) {
- DWORD lastError;
-
- lastError = GetLastError();
- if ((lastError & 0xffffL) == ERROR_OPEN_FAILED) {
- lastError = (useExisting)
- ? ERROR_FILE_NOT_FOUND : ERROR_FILE_EXISTS;
- }
- TclWinConvertError(lastError);
- return INVALID_HANDLE_VALUE;
- }
- /*
- * Seek to the end of file if we are writing.
- */
- if (createFlags & GENERIC_WRITE) {
- SetFilePointer(hFile, 0, NULL, FILE_END);
- }
- return hFile;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * CreateTempFile --
- *
- * This function creates a temporary file initialized with an
- * optional string, and returns a file handle with the file pointer
- * at the beginning of the file.
- *
- * Results:
- * A handle to a file.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static HANDLE
-CreateTempFile(const char *data) /* String to write into temp file, or
- * NULL. */
-{
- char fileName[MAX_PATH + 1];
- HANDLE hFile;
- DWORD lastError;
-
- if (!TempFileName(fileName)) {
- return INVALID_HANDLE_VALUE;
- }
- hFile = CreateFile(
- fileName, /* File path */
- GENERIC_READ | GENERIC_WRITE, /* Access mode */
- 0, /* No sharing. */
- NULL, /* Security attributes */
- CREATE_ALWAYS, /* Overwrite any existing file */
- FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE,
- NULL); /* No template file */
-
- if (hFile == INVALID_HANDLE_VALUE) {
- goto error;
- }
- if (data != NULL) {
- DWORD result, length;
- const char *p;
- const char *string;
-
- string = data;
- for (p = string; *p != '\0'; p++) {
- if (*p == '\n') {
- length = p - string;
- if (length > 0) {
- if (!WriteFile(hFile, string, length, &result, NULL)) {
- goto error;
- }
- }
- if (!WriteFile(hFile, "\r\n", 2, &result, NULL)) {
- goto error;
- }
- string = p + 1;
- }
- }
- length = p - string;
- if (length > 0) {
- if (!WriteFile(hFile, string, length, &result, NULL)) {
- goto error;
- }
- }
- if (SetFilePointer(hFile, 0, NULL, FILE_BEGIN) == (DWORD) - 1) {
- goto error;
- }
- }
- return hFile;
-
- error:
- lastError = GetLastError();
- CloseHandle(hFile);
- DeleteFile(fileName); /* Do I need this? Delete on close? */
- TclWinConvertError(lastError);
- return INVALID_HANDLE_VALUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * HasConsole --
- *
- * Determines whether the current application is attached to a
- * console.
- *
- * Results:
- * Returns TRUE if this application has a console, else FALSE.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static BOOL
-HasConsole(void)
-{
- HANDLE hFile;
-
- hFile = CreateFileA("CONOUT$", GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
- OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- if (hFile == INVALID_HANDLE_VALUE) {
- return FALSE;
- }
- CloseHandle(hFile);
- return TRUE;
-}
-
-static ApplicationType
-GetApplicationType(const char *file, char *cmdPrefix)
-{
- char *dot;
- HANDLE hFile;
- IMAGE_DOS_HEADER imageDosHeader;
- ULONG signature;
- BOOL result;
- DWORD offset;
- DWORD nBytes;
- ApplicationType type;
-
- dot = strrchr(file, '.');
- if ((dot != NULL) && (strcasecmp(dot, ".bat") == 0)) {
- return APPL_DOS;
- }
- /* Work a little harder. Open the binary and read the header */
- hFile = CreateFileA(file, GENERIC_READ, FILE_SHARE_READ, NULL,
- OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- if (hFile == INVALID_HANDLE_VALUE) {
- return APPL_NONE;
- }
- type = APPL_NONE;
- result = ReadFile(hFile, &imageDosHeader, sizeof(IMAGE_DOS_HEADER),
- &nBytes, NULL);
- if ((!result) || (nBytes != sizeof(IMAGE_DOS_HEADER))) {
- goto done;
- }
-#if KILL_DEBUG
- PurifyPrintf("magic number is %x\n", imageDosHeader.e_magic);
-#endif
- if (imageDosHeader.e_magic == 0x2123) { /* #! */
- char *p;
- unsigned int i;
-
- offset = SetFilePointer(hFile, 2, NULL, FILE_BEGIN);
- if (offset == (DWORD) - 1) {
- goto done;
- }
- result = ReadFile(hFile, cmdPrefix, MAX_PATH + 1, &nBytes, NULL);
- if ((!result) || (nBytes < 1)) {
- goto done;
- }
- for (p = cmdPrefix, i = 0; i < nBytes; i++, p++) {
- if ((*p == '\n') || (*p == '\r')) {
- break;
- }
- }
- *p = '\0';
- type = APPL_INTERP;
- goto done;
- }
- /*
- * Doesn't have the magic number for relocatable executables. If
- * filename ends with .com, assume it's a DOS application anyhow.
- * Note that we didn't make this assumption at first, because some
- * supposed .com files are really 32-bit executables with all the
- * magic numbers and everything.
- */
- if ((dot != NULL) && (strcmp(dot, ".com") == 0)) {
-#if KILL_DEBUG
- PurifyPrintf(".com\n");
-#endif
- type = APPL_DOS;
- goto done;
- }
- if (imageDosHeader.e_magic != IMAGE_DOS_SIGNATURE) {
-#if KILL_DEBUG
- PurifyPrintf("Application doesn't have correct sig?\n");
-#endif
- }
- if (imageDosHeader.e_lfarlc != sizeof(IMAGE_DOS_HEADER)) {
- /* This assumes that all 3.x and Win32 programs have their
- * file relocation table immediately following this header. */
- /*
- * All Windows 3.X and Win32 and some DOS programs have this value
- * set here. If it doesn't, assume that since it already had the
- * other magic number it was a DOS application.
- */
-#if KILL_DEBUG
- PurifyPrintf("wrong reloc table address\n");
-#endif
- type = APPL_DOS;
- goto done;
- }
- offset = SetFilePointer(hFile, imageDosHeader.e_lfanew, NULL, FILE_BEGIN);
- if (offset == (DWORD) - 1) {
- goto done;
- }
- result = ReadFile(hFile, &signature, sizeof(ULONG), &nBytes, NULL);
- if ((!result) || (nBytes != sizeof(ULONG))) {
- goto done;
- }
-#if KILL_DEBUG
- PurifyPrintf("signature is %x\n", signature);
-#endif
- switch (signature) {
- case IMAGE_NT_SIGNATURE:
- type = APPL_WIN32;
- break;
- case IMAGE_OS2_SIGNATURE:
- type = APPL_WIN3X;
- break;
- case IMAGE_VXD_SIGNATURE:
- type = APPL_WIN32;
- break;
- default:
- type = APPL_DOS;
- break;
- }
- done:
- CloseHandle(hFile);
- return type;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * GetFullPath --
- *
- * Look for the program as an external program. First try the
- * name as it is, then try adding .com, .exe, and .bat, in that
- * order, to the name, looking for an executable.
- *
- * Using the raw SearchPath() procedure doesn't do quite what is
- * necessary. If the name of the executable already contains a
- * '.' character, it will not try appending the specified
- * extension when searching (in other words, SearchPath will
- * not find the program "a.b.exe" if the arguments specified
- * "a.b" and ".exe"). So, first look for the file as it is
- * named. Then manually append extensions, looking for a
- * match.
- *
- * Results:
- * Always returns TCL_OK.
- *
- * Side Effects:
- *
- *---------------------------------------------------------------------------
- */
-static int
-GetFullPath(
- Tcl_Interp *interp, /* Interpreter to report errors to */
- const char *program, /* Name of program. */
- char *fullPath, /* (out) Returned full path. */
- char *cmdPrefix, /* (out) If program is a script, this contains
- * the name of the interpreter. */
- ApplicationType * typePtr)
-{ /* (out) Type of program */
- TCHAR *rest;
- DWORD attr;
- int length;
- char cmd[MAX_PATH + 5];
- const char **p;
- char *ext;
-
- static const char *dosExts[] =
- {
- "", ".com", ".exe", ".bat", NULL
- };
-
- *typePtr = APPL_NONE;
-
- length = strlen(program);
- strcpy(cmd, program);
- cmdPrefix[0] = '\0';
- ext = cmd + length;
- for (p = dosExts; *p != NULL; p++) {
- *ext = '\0'; /* Reset to original program name. */
- strcpy(ext, *p); /* Append the DOS extension to the
- * program name. */
-
- if (!SearchPath(
- NULL, /* Use standard Windows search paths */
- cmd, /* Program name */
- NULL, /* Extension provided by program name. */
- MAX_PATH, /* Buffer size */
- fullPath, /* Buffer for absolute path of program */
- &rest)) {
- continue; /* Can't find program with that extension */
- }
- /*
- * Ignore matches on directories or data files.
- * Return when we identify a known program type.
- */
- attr = GetFileAttributesA(fullPath);
- if ((attr == (DWORD)-1) || (attr & FILE_ATTRIBUTE_DIRECTORY)) {
- continue;
- }
- *typePtr = GetApplicationType(fullPath, cmdPrefix);
- if (*typePtr != APPL_NONE) {
- break;
- }
- }
- if (*typePtr == APPL_NONE) {
- /*
- * Can't find the program. Check if it's an internal shell command
- * like "copy" or "dir" and let cmd.exe deal with it.
- */
- static const char *shellCmds[] =
- {
- "copy", "del", "dir", "echo", "edit", "erase", "label",
- "md", "rd", "ren", "start", "time", "type", "ver", "vol", NULL
- };
-
- for (p = shellCmds; *p != NULL; p++) {
- if (((*p)[0] == program[0]) && (strcmp(*p, program) == 0)) {
- break;
- }
- }
- if (*p == NULL) {
- Tcl_AppendResult(interp, "can't execute \"", program,
- "\": no such file or directory", (char *)NULL);
- return TCL_ERROR;
- }
- *typePtr = APPL_DOS;
- strcpy(fullPath, program);
- }
- if ((*typePtr == APPL_DOS) || (*typePtr == APPL_WIN3X)) {
-
- /* For 16-bit applications, convert the long executable path
- * name to a short one. Otherwise the application may not be
- * able to correctly parse its own command line. */
-
- GetShortPathName(fullPath, fullPath, MAX_PATH);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConcatCmdArgs --
- *
- * Concatonates command line arguments parsed from TCL into a
- * single string. If an argument contain spaces, it is grouped
- * with surrounding double quotes. Must also escape any quotes we
- * find.
- *
- * Results:
- * Returns a malloc-ed string containing the concatonated command
- * line.
- *
- *---------------------------------------------------------------------------
- */
-static char *
-ConcatCmdArgs(
- Tcl_Interp *interp,
- int argc,
- char **argv,
- Tcl_DString *resultPtr)
-{
- BOOL needQuote;
- const char *s;
- char *cp;
- char *string; /* Will contain the new command line */
- int count;
- int i;
-
- /*
- * Pass 1. Compute how much space we need for an array to hold the entire
- * command line. Then allocate the string.
- */
- count = 0;
- for (i = 0; i < argc; i++) {
- needQuote = FALSE;
- if (*argv[i] == '\0') {
- needQuote = TRUE; /* Zero length args also need quotes. */
- }
- for (s = argv[i]; *s != '\0'; s++) {
- if (*s == '"') {
- const char *bp;
-
- count++; /* +1 Backslash needed to escape quote */
- for (bp = s - 1; (*bp == '\\') && (bp >= argv[i]); bp--) {
- count++; /* +? one for each preceding backslash */
- }
- } else if (isspace(*s)) {
- needQuote = TRUE;
- }
- count++; /* +1 Normal character */
- }
- if (needQuote) {
- count += 2; /* +2 Pair of quotes */
- }
- count++; /* +1 Space separating arguments */
- }
-
- string = Blt_AssertMalloc(count + 1);
- /*
- * Pass 2. Copy the arguments, quoting arguments with embedded spaces and
- * escaping all other quotes in the string.
- */
- cp = string;
- for (i = 0; i < argc; i++) {
- needQuote = FALSE;
-
- if (*argv[i] == '\0') {
- needQuote = TRUE;
- }
- for (s = argv[i]; *s != '\0'; s++) {
- if (isspace(*s)) {
- needQuote = TRUE;
- }
- }
- if (needQuote) {
- *cp++ = '"';
- }
- for (s = argv[i]; *s; s++) {
- if (*s == '"') {
- const char *bp;
-
- for (bp = s - 1; (*bp == '\\') && (bp >= argv[i]); bp--) {
- *cp++ = '\\';
- }
- *cp++ = '\\';
- }
- *cp++ = *s;
- }
- if (needQuote) {
- *cp++ = '"';
- }
- *cp++ = ' ';
- }
- *cp = '\0';
- assert((cp - string) == count);
-
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- {
- Tcl_DString dString;
- Tcl_Encoding encoding;
-
- /* Convert to external encoding */
- encoding = Tcl_GetEncoding(interp, NULL);
- Tcl_UtfToExternalDString(encoding, string, count, &dString);
- Tcl_DStringAppend(resultPtr, Tcl_DStringValue(&dString), -1);
- Tcl_DStringFree(&dString);
- }
-#else
- Tcl_DStringAppend(resultPtr, string, count);
-#endif
- Blt_Free(string);
- return Tcl_DStringValue(resultPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * StartProcess --
- *
- * Create a child process that has the specified files as its
- * standard input, output, and error.
- *
- * The complete Windows search path is searched to find the specified
- * executable. If an executable by the given name is not found,
- * automatically tries appending ".com", ".exe", and ".bat" to the
- * executable name.
- *
- * Results:
- * The return value is TCL_ERROR and an error message is left in
- * the interp's result if there was a problem creating the child
- * process. Otherwise, the return value is TCL_OK and *pidPtr is
- * filled with the process id of the child process.
- *
- * Side effects:
- * A process is created.
- *
- *---------------------------------------------------------------------------
- */
-static int
-StartProcess(
- Tcl_Interp *interp, /* Interpreter to report errors that
- * occurred when creating the child process.
- * Error messages from the child process
- * itself are sent to errorFile. */
- int argc, /* Number of arguments. */
- char **argv, /* Command line arguments. */
- HANDLE hStdin, /* File handle to use as input (stdin) for the
- * child process. If handle is -1, no
- * standard input. */
- HANDLE hStdout, /* File handle to receive output (stdout)
- * from the child process. If -1, output
- * is discarded. */
- HANDLE hStderr, /* File handle to receive errors (stderr)
- * from the child process. If -1, stderr
- * will be discarded. Can be the same handle
- * as hStdOut */
- HANDLE *hProcessPtr, /* (out) Handle of child process. */
- DWORD *pidPtr) /* (out) Id of child process. */
-{
- int result, createFlags;
- ApplicationType applType;
- Tcl_DString dString; /* Complete command line */
- char *command;
- BOOL hasConsole;
-#ifdef notdef
- DWORD idleResult;
-#endif
- STARTUPINFOA si;
- PROCESS_INFORMATION pi;
- SECURITY_ATTRIBUTES securityAttrs;
- HANDLE hProcess, hPipe;
- char progPath[MAX_PATH];
- char cmdPrefix[MAX_PATH];
-
- *hProcessPtr = INVALID_HANDLE_VALUE;
- GetFullPath(interp, argv[0], progPath, cmdPrefix, &applType);
-#if KILL_DEBUG
- PurifyPrintf("Application type is %d\n", (int)applType);
-#endif
- if (applType == APPL_NONE) {
- return TCL_ERROR;
- }
- result = TCL_ERROR;
-
- hProcess = GetCurrentProcess();
-
- ZeroMemory(&si, sizeof(STARTUPINFOA));
- si.cb = sizeof(STARTUPINFOA);
-
- /*
- * The flag STARTF_USESTDHANDLES must be set to pass handles to
- * the child process. Using SetStdHandle and/or dup2 works only
- * when a console mode parent process is spawning an attached
- * console mode child process.
- */
-
- si.dwFlags = STARTF_USESTDHANDLES;
- si.hStdInput = si.hStdOutput = si.hStdError = INVALID_HANDLE_VALUE;
-
- securityAttrs.nLength = sizeof(SECURITY_ATTRIBUTES);
- securityAttrs.lpSecurityDescriptor = NULL;
- securityAttrs.bInheritHandle = TRUE;
-
- /*
- * Duplicate all the handles to be passed off as stdin, stdout and
- * stderr of the child process. The duplicate handles are set to
- * be inheritable, so the child process can use them.
- */
- if (hStdin == INVALID_HANDLE_VALUE) {
- /*
- * If handle was not set, stdin should return immediate EOF.
- * Under Windows95, some applications (both 16 and 32 bit!)
- * can't read from the NUL device; they read from console
- * instead. When running tk, this is fatal because the child
- * process would hang forever waiting for EOF from the unmapped
- * console window used by the helper application.
- *
- * Fortunately, the helper application detects a closed pipe
- * as an immediate EOF and can pass that information to the
- * child process.
- */
- if (CreatePipe(&si.hStdInput, &hPipe, &securityAttrs, 0)) {
- CloseHandle(hPipe);
- }
- } else {
- DuplicateHandle(hProcess, hStdin, hProcess, &si.hStdInput, 0, TRUE,
- DUPLICATE_SAME_ACCESS);
- }
-
- if (si.hStdInput == INVALID_HANDLE_VALUE) {
- Tcl_AppendResult(interp, "can't duplicate input handle: ",
- Blt_LastError(), (char *)NULL);
- goto closeHandles;
- }
- if (hStdout == INVALID_HANDLE_VALUE) {
- /*
- * If handle was not set, output should be sent to an infinitely
- * deep sink. Under Windows 95, some 16 bit applications cannot
- * have stdout redirected to NUL; they send their output to
- * the console instead. Some applications, like "more" or "dir /p",
- * when outputting multiple pages to the console, also then try and
- * read from the console to go the next page. When running tk, this
- * is fatal because the child process would hang forever waiting
- * for input from the unmapped console window used by the helper
- * application.
- *
- * Fortunately, the helper application will detect a closed pipe
- * as a sink.
- */
- if ((Blt_GetPlatformId() == VER_PLATFORM_WIN32_WINDOWS)
- && (applType == APPL_DOS)) {
- if (CreatePipe(&hPipe, &si.hStdOutput, &securityAttrs, 0)) {
- CloseHandle(hPipe);
- }
- } else {
- si.hStdOutput = CreateFileA("NUL:", GENERIC_WRITE, 0,
- &securityAttrs, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- }
- } else {
- DuplicateHandle(hProcess, hStdout, hProcess, &si.hStdOutput, 0, TRUE,
- DUPLICATE_SAME_ACCESS);
- }
- if (si.hStdOutput == INVALID_HANDLE_VALUE) {
- Tcl_AppendResult(interp, "can't duplicate output handle: ",
- Blt_LastError(), (char *)NULL);
- goto closeHandles;
- }
- if (hStderr == INVALID_HANDLE_VALUE) {
- /*
- * If handle was not set, errors should be sent to an infinitely
- * deep sink.
- */
- si.hStdError = CreateFileA("NUL:", GENERIC_WRITE, 0,
- &securityAttrs, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- } else {
- DuplicateHandle(hProcess, hStderr, hProcess, &si.hStdError, 0, TRUE,
- DUPLICATE_SAME_ACCESS);
- }
- if (si.hStdError == INVALID_HANDLE_VALUE) {
- Tcl_AppendResult(interp, "can't duplicate error handle: ",
- Blt_LastError(), (char *)NULL);
- goto closeHandles;
- }
- Tcl_DStringInit(&dString);
- createFlags = 0;
- hasConsole = HasConsole();
- if (!hasConsole) {
- createFlags |= DETACHED_PROCESS;
- }
- /*
- * If we do not have a console window, then we must run DOS and
- * WIN32 console mode applications as detached processes. This tells
- * the loader that the child application should not inherit the
- * console, and that it should not create a new console window for
- * the child application. The child application should get its stdio
- * from the redirection handles provided by this application, and run
- * in the background.
- *
- * If we are starting a GUI process, they don't automatically get a
- * console, so it doesn't matter if they are started as foreground or
- * detached processes. The GUI window will still pop up to the
- * foreground.
- */
- if (applType == APPL_DOS) {
- if (Blt_GetPlatformId() == VER_PLATFORM_WIN32_NT) {
- /*
- * Under NT, 16-bit DOS applications will not run unless they
- * can be attached to a console. If we are running without a
- * console, run the 16-bit program as an normal process inside
- * of a hidden console application, and then run that hidden
- * console as a detached process.
- */
- si.wShowWindow = SW_HIDE;
- si.dwFlags |= STARTF_USESHOWWINDOW;
- createFlags = CREATE_NEW_CONSOLE;
- Tcl_DStringAppend(&dString, "cmd.exe /c ", -1);
- } else {
- /*
- * Under Windows 95, 16-bit DOS applications do not work well
- * with pipes:
- *
- * 1. EOF on a pipe between a detached 16-bit DOS application
- * and another application is not seen at the other
- * end of the pipe, so the listening process blocks forever on
- * reads. This inablity to detect EOF happens when either a
- * 16-bit app or the 32-bit app is the listener.
- *
- * 2. If a 16-bit DOS application (detached or not) blocks when
- * writing to a pipe, it will never wake up again, and it
- * eventually brings the whole system down around it.
- *
- * The 16-bit application is run as a normal process
- * inside of a hidden helper console app, and this helper
- * may be run as a detached process. If a stdio handle is
- * a pipe, the helper application accumulates information
- * into temp files and forwards it to or from the DOS
- * application as appropriate. This means that DOS apps
- * must receive EOF from a stdin pipe before they will
- * actually begin, and must finish generating stdout or
- * stderr before the data will be sent to the next stage
- * of the pipe.
- *
- * The helper app should be located in the same directory
- * as the tcl dll.
- */
- if (!hasConsole) {
- si.wShowWindow = SW_HIDE;
- si.dwFlags |= STARTF_USESHOWWINDOW;
- createFlags = CREATE_NEW_CONSOLE;
- }
- Tcl_DStringAppend(&dString, "tclpip" STRINGIFY(TCL_MAJOR_VERSION)
- STRINGIFY(TCL_MINOR_VERSION) ".dll ", -1);
- }
- } else if (applType == APPL_INTERP) {
- Tcl_DStringAppend(&dString, cmdPrefix, -1);
- Tcl_DStringAppend(&dString, " ", -1);
- }
- argv[0] = progPath;
-
- command = ConcatCmdArgs(interp, argc, argv, &dString);
-#if KILL_DEBUG
- PurifyPrintf("command is %s\n", command);
-#endif
- result = CreateProcess(
- NULL, /* Module name. */
- (TCHAR *)command, /* Command line */
- NULL, /* Process security */
- NULL, /* Thread security */
- TRUE, /* Inherit handles */
- createFlags, /* Creation flags */
- NULL, /* Environment */
- NULL, /* Current working directory */
- &si, /* Initialization for process: includes
- * standard handles, appearance and location
- * of window */
- &pi); /* (out) Information about newly
- created process */
- Tcl_DStringFree(&dString);
-
- if (!result) {
- Tcl_AppendResult(interp, "can't execute \"", argv[0], "\": ",
- Blt_LastError(), (char *)NULL);
- goto closeHandles;
- }
-#if KILL_DEBUG
- PurifyPrintf("Starting process with handle of %d\n", pi.hProcess);
- PurifyPrintf("Starting process with id of %d\n", pi.dwProcessId);
-#endif
- if (applType == APPL_DOS) {
- /* Force the OS to give some time to the DOS process. */
- WaitForSingleObject(hProcess, 50);
- }
-#ifdef notdef /* FIXME: I don't think this actually
- * ever worked. WaitForInputIdle
- * usually fails with "Access is
- * denied" (maybe the process handle
- * isn't valid yet?). When you add a
- * delay, WaitForInputIdle will time
- * out instead. */
- /*
- * PSS ID Number: Q124121
- *
- * "When an application spawns a process repeatedly, a new
- * thread instance will be created for each process but the
- * previous instances may not be cleaned up. This results in
- * a significant virtual memory loss each time the process is
- * spawned. If there is a WaitForInputIdle() call between
- * CreateProcess() and CloseHandle(), the problem does not
- * occur." */
- idleResult = WaitForInputIdle(pi.hProcess, 1000);
- if (idleResult == (DWORD) - 1) {
-#if KILL_DEBUG
- PurifyPrintf("wait failed on %d: %s\n", pi.hProcess, Blt_LastError());
-#endif
- }
-#endif
- CloseHandle(pi.hThread);
-
- *hProcessPtr = pi.hProcess;
-
- /*
- * Add the entry to mapping table. Its purpose is to translate
- * process handles to process ids. Most things we do with the
- * Win32 API take handles, but we still want to present process
- * ids to the user. */
- *pidPtr = pi.dwProcessId;
- result = TCL_OK;
-
- closeHandles:
- if (si.hStdInput != INVALID_HANDLE_VALUE) {
- CloseHandle(si.hStdInput);
- }
- if (si.hStdOutput != INVALID_HANDLE_VALUE) {
- CloseHandle(si.hStdOutput);
- }
- if (si.hStdError != INVALID_HANDLE_VALUE) {
- CloseHandle(si.hStdError);
- }
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FileForRedirect --
- *
- * This procedure does much of the work of parsing redirection
- * operators. It handles "@" if specified and allowed, and a file
- * name, and opens the file if necessary.
- *
- * Results:
- * The return value is the descriptor number for the file. If an
- * error occurs then NULL is returned and an error message is left
- * in interp->result. Several arguments are side-effected; see
- * the argument list below for details.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-static HANDLE
-FileForRedirect(
- Tcl_Interp *interp, /* Intepreter to use for error reporting. */
- char *spec, /* Points to character just after
- * redirection character. */
- BOOL atOK, /* Non-zero means that '@' notation can be
- * used to specify a channel, zero means that
- * it isn't. */
- char *arg, /* Pointer to entire argument containing
- * spec: used for error reporting. */
- char *nextArg, /* Next argument in argc/argv array, if needed
- * for file name or channel name. May be
- * NULL. */
- DWORD accessFlags, /* Flags to use for opening file or to
- * specify mode for channel. */
- DWORD createFlags, /* Flags to use for opening file or to
- * specify mode for channel. */
- int *skipPtr, /* Filled with 1 if redirection target was
- * in spec, 2 if it was in nextArg. */
- int *closePtr) /* Filled with one if the caller should
- * close the file when done with it, zero
- * otherwise. */
-{
- int writing = (accessFlags & GENERIC_WRITE);
- Tcl_Channel chan;
- HANDLE hFile;
-
- *skipPtr = 1;
- *closePtr = FALSE;
- if ((atOK) && (*spec == '@')) {
- spec++;
- if (*spec == '\0') {
- spec = nextArg;
- if (spec == NULL) {
- goto badLastArg;
- }
- *skipPtr = 2;
- }
- chan = Tcl_GetChannel(interp, spec, NULL);
- if (chan == NULL) {
- return INVALID_HANDLE_VALUE;
- }
- if (Tcl_GetChannelHandle(chan, (writing) ? TCL_WRITABLE : TCL_READABLE,
- (ClientData *)&hFile) != TCL_OK) {
- hFile = INVALID_HANDLE_VALUE;
- }
- if (hFile == INVALID_HANDLE_VALUE) {
- Tcl_AppendResult(interp, "channel \"", Tcl_GetChannelName(chan),
- "\" wasn't opened for ",
- ((writing) ? "writing" : "reading"), (char *)NULL);
- return INVALID_HANDLE_VALUE;
- }
- if (writing) {
- /*
- * Be sure to flush output to the file, so that anything
- * written by the child appears after stuff we've already
- * written.
- */
- Tcl_Flush(chan);
- }
- } else {
- char *name;
- Tcl_DString dString;
-
- if (*spec == '\0') {
- spec = nextArg;
- if (spec == NULL) {
- goto badLastArg;
- }
- *skipPtr = 2;
- }
- name = Tcl_TranslateFileName(interp, spec, &dString);
- if (name != NULL) {
- hFile = OpenRedirectFile(name, accessFlags, createFlags);
- } else {
- hFile = INVALID_HANDLE_VALUE;
- }
- Tcl_DStringFree(&dString);
-
- if (hFile == INVALID_HANDLE_VALUE) {
- Tcl_AppendResult(interp, "can't ", (writing) ? "write" : "read",
- " file \"", spec, "\": ", Tcl_PosixError(interp),
- (char *)NULL);
- return INVALID_HANDLE_VALUE;
- }
- *closePtr = TRUE;
- }
- return hFile;
-
- badLastArg:
- Tcl_AppendResult(interp, "can't specify \"", arg,
- "\" as last word in command", (char *)NULL);
- return INVALID_HANDLE_VALUE;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_CreatePipeline --
- *
- * Given an argc/argv array, instantiate a pipeline of processes
- * as described by the argv.
- *
- * Results:
- * The return value is a count of the number of new processes
- * created, or -1 if an error occurred while creating the pipeline.
- * *pidArrayPtr is filled in with the address of a dynamically
- * allocated array giving the ids of all of the processes. It
- * is up to the caller to free this array when it isn't needed
- * anymore. If inPipePtr is non-NULL, *inPipePtr is filled in
- * with the file id for the input pipe for the pipeline (if any):
- * the caller must eventually close this file. If outPipePtr
- * isn't NULL, then *outPipePtr is filled in with the file id
- * for the output pipe from the pipeline: the caller must close
- * this file. If errPipePtr isn't NULL, then *errPipePtr is filled
- * with a file id that may be used to read error output after the
- * pipeline completes.
- *
- * Side effects:
- * Processes and pipes are created.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_CreatePipeline(
- Tcl_Interp *interp, /* Interpreter to use for error reporting. */
- int objc, /* Number of entries in objv. */
- Tcl_Obj *const *objv, /* Array of strings describing commands in
- * pipeline plus I/O redirection with <,
- * <<, >, etc. Objv[objc] must be NULL. */
- ProcessId **pidsPtr, /* *pidsPtr gets filled in with
- * address of array of pids for processes
- * in pipeline (first pid is first process
- * in pipeline). */
- int *inPipePtr, /* If non-NULL, input to the pipeline comes
- * from a pipe (unless overridden by
- * redirection in the command). The file
- * id with which to write to this pipe is
- * stored at *inPipePtr. NULL means command
- * specified its own input source. */
- int *outPipePtr, /* If non-NULL, output to the pipeline goes
- * to a pipe, unless overriden by redirection
- * in the command. The file id with which to
- * read frome this pipe is stored at
- * *outPipePtr. NULL means command specified
- * its own output sink. */
- int *errPipePtr) /* If non-NULL, all stderr output from the
- * pipeline will go to a temporary file
- * created here, and a descriptor to read
- * the file will be left at *errPipePtr.
- * The file will be removed already, so
- * closing this descriptor will be the end
- * of the file. If this is NULL, then
- * all stderr output goes to our stderr.
- * If the pipeline specifies redirection
- * then the file will still be created
- * but it will never get any data. */
-{
- ProcessId *pids = NULL; /* Points to malloc-ed array holding all
- * the handles of child processes. */
- int nPids; /* Actual number of processes that exist
- * at *pids right now. */
- int cmdCount; /* Count of number of distinct commands
- * found in objc/argv. */
- char *inputLiteral = NULL; /* If non-null, then this points to a
- * string containing input data (specified
- * via <<) to be piped to the first process
- * in the pipeline. */
- HANDLE hStdin; /* If != -1, gives file to use as input for
- * first process in pipeline (specified via <
- * or <@). */
- BOOL closeStdin; /* If non-zero, then hStdin should be
- * closed when cleaning up. */
- HANDLE hStdout; /* Writable file for output from last command
- * in pipeline (could be file or pipe). NULL
- * means use stdout. */
- BOOL closeStdout; /* If non-zero, then hStdout should be
- * closed when cleaning up. */
- HANDLE hStderr; /* Writable file for error output from all
- * commands in pipeline. NULL means use
- * stderr. */
- BOOL closeStderr; /* If non-zero, then hStderr should be
- * closed when cleaning up. */
-
- HANDLE hInPipe, hOutPipe, hErrPipe;
- char *p;
- int skip, lastBar, lastArg, i, j, flags;
- int pid;
- BOOL atOK, errorToOutput;
- Tcl_DString dString;
- HANDLE hPipe;
- HANDLE thisInput, thisOutput, thisError;
- char **argv;
-
- if (inPipePtr != NULL) {
- *inPipePtr = -1;
- }
- if (outPipePtr != NULL) {
- *outPipePtr = -1;
- }
- if (errPipePtr != NULL) {
- *errPipePtr = -1;
- }
- Tcl_DStringInit(&dString);
-
- hStdin = hStdout = hStderr = INVALID_HANDLE_VALUE;
- hPipe = thisInput = thisOutput = INVALID_HANDLE_VALUE;
- hInPipe = hOutPipe = hErrPipe = INVALID_HANDLE_VALUE;
- closeStdin = closeStdout = closeStderr = FALSE;
- nPids = 0;
-
- /*
- * First, scan through all the arguments to figure out the structure
- * of the pipeline. Process all of the input and output redirection
- * arguments and remove them from the argument list in the pipeline.
- * Count the number of distinct processes (it's the number of "|"
- * arguments plus one) but don't remove the "|" arguments because
- * they'll be used in the second pass to seperate the individual
- * child processes. Cannot start the child processes in this pass
- * because the redirection symbols may appear anywhere in the
- * command line -- e.g., the '<' that specifies the input to the
- * entire pipe may appear at the very end of the argument list.
- */
-
- /* Convert all the Tcl_Objs to strings. */
- argv = Blt_AssertMalloc((objc + 1) * sizeof(char *));
- for (i = 0; i < objc; i++) {
- argv[i] = Tcl_GetString(objv[i]);
- }
- argv[i] = NULL;
-
- lastBar = -1;
- cmdCount = 1;
- for (i = 0; i < objc; i++) {
- skip = 0;
- p = argv[i];
- switch (*p++) {
- case '|':
- if (*p == '&') {
- p++;
- }
- if (*p == '\0') {
- if ((i == (lastBar + 1)) || (i == (objc - 1))) {
- Tcl_AppendResult(interp,
- "illegal use of | or |& in command",
- (char *)NULL);
- goto error;
- }
- }
- lastBar = i;
- cmdCount++;
- break;
-
- case '<':
- if (closeStdin) {
- closeStdin = FALSE;
- CloseHandle(hStdin);
- }
- if (*p == '<') {
- hStdin = INVALID_HANDLE_VALUE;
- inputLiteral = p + 1;
- skip = 1;
- if (*inputLiteral == '\0') {
- inputLiteral = argv[i + 1];
- if (inputLiteral == NULL) {
- Tcl_AppendResult(interp, "can't specify \"", argv[i],
- "\" as last word in command", (char *)NULL);
- goto error;
- }
- skip = 2;
- }
- } else {
- inputLiteral = NULL;
- hStdin = FileForRedirect(interp, p, TRUE, argv[i], argv[i + 1],
- GENERIC_READ, OPEN_EXISTING, &skip, &closeStdin);
- if (hStdin == INVALID_HANDLE_VALUE) {
- goto error;
- }
- }
- break;
-
- case '>':
- atOK = 1;
- flags = CREATE_ALWAYS;
- errorToOutput = FALSE;
- if (*p == '>') {
- p++;
- atOK = 0;
- flags = OPEN_ALWAYS;
- }
- if (*p == '&') {
- if (closeStderr) {
- closeStderr = FALSE;
- CloseHandle(hStderr);
- }
- errorToOutput = TRUE;
- p++;
- }
- if (closeStdout) {
- closeStdout = FALSE;
- CloseHandle(hStdout);
- }
- hStdout = FileForRedirect(interp, p, atOK, argv[i], argv[i + 1],
- GENERIC_WRITE, flags, &skip, &closeStdout);
- if (hStdout == INVALID_HANDLE_VALUE) {
- goto error;
- }
- if (errorToOutput) {
- closeStderr = FALSE;
- hStderr = hStdout;
- }
- break;
-
- case '2':
- if (*p != '>') {
- break;
- }
- p++;
- atOK = TRUE;
- flags = CREATE_ALWAYS;
- if (*p == '>') {
- p++;
- atOK = FALSE;
- flags = OPEN_ALWAYS;
- }
- if (closeStderr) {
- closeStderr = FALSE;
- CloseHandle(hStderr);
- }
- hStderr = FileForRedirect(interp, p, atOK, argv[i], argv[i + 1],
- GENERIC_WRITE, flags, &skip, &closeStderr);
- if (hStderr == INVALID_HANDLE_VALUE) {
- goto error;
- }
- break;
- }
-
- if (skip != 0) {
- for (j = i + skip; j < objc; j++) {
- argv[j - skip] = argv[j];
- }
- objc -= skip;
- i -= 1;
- }
- }
-
- if (hStdin == INVALID_HANDLE_VALUE) {
- if (inputLiteral != NULL) {
- /*
- * The input for the first process is immediate data coming from
- * Tcl. Create a temporary file for it and put the data into the
- * file.
- */
- hStdin = CreateTempFile(inputLiteral);
- if (hStdin == INVALID_HANDLE_VALUE) {
- Tcl_AppendResult(interp,
- "can't create input file for command: ",
- Tcl_PosixError(interp), (char *)NULL);
- goto error;
- }
- closeStdin = TRUE;
- } else if (inPipePtr != NULL) {
- /*
- * The input for the first process in the pipeline is to
- * come from a pipe that can be written from by the caller.
- */
-
- if (!CreatePipe(&hStdin, &hInPipe, NULL, 0)) {
- Tcl_AppendResult(interp,
- "can't create input pipe for command: ",
- Tcl_PosixError(interp), (char *)NULL);
- goto error;
- }
- closeStdin = TRUE;
- } else {
- /*
- * The input for the first process comes from stdin.
- */
- }
- }
- if (hStdout == INVALID_HANDLE_VALUE) {
- if (outPipePtr != NULL) {
- /*
- * Output from the last process in the pipeline is to go to a
- * pipe that can be read by the caller.
- */
-
- if (!CreatePipe(&hOutPipe, &hStdout, NULL, 0)) {
- Tcl_AppendResult(interp,
- "can't create output pipe for command: ",
- Tcl_PosixError(interp), (char *)NULL);
- goto error;
- }
- closeStdout = TRUE;
- } else {
- /*
- * The output for the last process goes to stdout.
- */
- }
- }
- if (hStderr == INVALID_HANDLE_VALUE) {
- if (errPipePtr != NULL) {
- /*
- * Stderr from the last process in the pipeline is to go to a
- * pipe that can be read by the caller.
- */
- if (CreatePipe(&hErrPipe, &hStderr, NULL, 0) == 0) {
- Tcl_AppendResult(interp,
- "can't create error pipe for command: ",
- Tcl_PosixError(interp), (char *)NULL);
- goto error;
- }
- closeStderr = TRUE;
- } else {
- /*
- * Errors from the pipeline go to stderr.
- */
- }
- }
-
- /*
- * Scan through the objc array, creating a process for each
- * group of arguments between the "|" characters.
- */
-
- Tcl_ReapDetachedProcs();
- pids = Blt_AssertMalloc((unsigned)((cmdCount + 1) * sizeof(ProcessId)));
- thisInput = hStdin;
- if (objc == 0) {
- Tcl_AppendResult(interp, "invalid null command", (char *)NULL);
- goto error;
- }
-
- lastArg = 0; /* Suppress compiler warning */
- for (i = 0; i < objc; i = lastArg + 1) {
- BOOL joinThisError;
- HANDLE hProcess;
- DWORD dw_pid;
- /* Convert the program name into native form. */
- argv[i] = Tcl_TranslateFileName(interp, argv[i], &dString);
- if (argv[i] == NULL) {
- goto error;
- }
- /* Find the end of the current segment of the pipeline. */
- joinThisError = FALSE;
- for (lastArg = i; lastArg < objc; lastArg++) {
- if (argv[lastArg][0] == '|') {
- if (argv[lastArg][1] == '\0') {
- break;
- }
- if ((argv[lastArg][1] == '&') && (argv[lastArg][2] == '\0')) {
- joinThisError = TRUE;
- break;
- }
- }
- }
- argv[lastArg] = NULL;
- if ((lastArg - i) == 0) {
- Tcl_AppendResult(interp, "invalid null command", (char *)NULL);
- goto error;
- }
-
- /*
- * If this is the last segment, use the specified output handle.
- * Otherwise create an intermediate pipe. hPipe will become the
- * input for the next segment of the pipe.
- */
- if (lastArg == objc) {
- thisOutput = hStdout;
- } else {
- if (CreatePipe(&hPipe, &thisOutput, NULL, 0) == 0) {
- Tcl_AppendResult(interp, "can't create pipe: ",
- Tcl_PosixError(interp), (char *)NULL);
- goto error;
- }
- }
-
- if (joinThisError) {
- thisError = thisOutput;
- } else {
- thisError = hStderr;
- }
-
- if (StartProcess(interp, lastArg - i, argv + i, thisInput, thisOutput,
- thisError, &hProcess, &dw_pid) != TCL_OK) {
- goto error;
- }
- pid = (int)dw_pid;
- Tcl_DStringFree(&dString);
-
- pids[nPids].hProcess = hProcess;
- pids[nPids].pid = pid;
- nPids++;
-
- /*
- * Close off our copies of file descriptors that were set up for
- * this child, then set up the input for the next child.
- */
-
- if ((thisInput != INVALID_HANDLE_VALUE) && (thisInput != hStdin)) {
- CloseHandle(thisInput);
- }
- thisInput = hPipe;
- hPipe = INVALID_HANDLE_VALUE;
-
- if ((thisOutput != INVALID_HANDLE_VALUE) && (thisOutput != hStdout)) {
- CloseHandle(thisOutput);
- }
- thisOutput = INVALID_HANDLE_VALUE;
- }
-
- *pidsPtr = pids;
-
- if (inPipePtr != NULL) {
- *inPipePtr = (int)hInPipe;
- }
- if (outPipePtr != NULL) {
- *outPipePtr = (int)hOutPipe;
- }
- if (errPipePtr != NULL) {
- *errPipePtr = (int)hErrPipe;
- }
- /*
- * All done. Cleanup open files lying around and then return.
- */
- cleanup:
- Tcl_DStringFree(&dString);
-
- if (closeStdin) {
- CloseHandle(hStdin);
- }
- if (closeStdout) {
- CloseHandle(hStdout);
- }
- if (closeStderr) {
- CloseHandle(hStderr);
- }
- if (argv != NULL) {
- Blt_Free(argv);
- }
- return nPids;
-
- /*
- * An error occurred. There could have been extra files open, such
- * as pipes between children. Clean them all up. Detach any child
- * processes that have been created.
- */
- error:
- if (hPipe != INVALID_HANDLE_VALUE) {
- CloseHandle(hPipe);
- }
- if ((thisOutput != INVALID_HANDLE_VALUE) && (thisOutput != hStdout)) {
- CloseHandle(thisOutput);
- }
- if ((thisInput != INVALID_HANDLE_VALUE) && (thisInput != hStdin)) {
- CloseHandle(thisInput);
- }
- if (hInPipe != INVALID_HANDLE_VALUE) {
- CloseHandle(hInPipe);
- }
- if (hOutPipe != INVALID_HANDLE_VALUE) {
- CloseHandle(hOutPipe);
- }
- if (hErrPipe != INVALID_HANDLE_VALUE) {
- CloseHandle(hErrPipe);
- }
- if (pids != NULL) {
- for (i = 0; i < nPids; i++) {
- if (pids[i].hProcess != INVALID_HANDLE_VALUE) {
- /* It's Ok to use Tcl_DetachPids, since for WIN32 it's really
- * using process handles, not process ids. */
- Tcl_DetachPids(1, (Tcl_Pid *)&pids[i].pid);
- }
- }
- Blt_Free(pids);
- }
- nPids = -1;
- goto cleanup;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_CreateFileHandler --
- *
- * Limited emulation Tcl_CreateFileHandler for Win32. Works
- * with pipes. Don't know if anything else will (such as sockets).
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Registers procedure and data to call back when data
- * is available on the pipe.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_CreateFileHandler(
- int fd, /* Descriptor or handle of file */
- int flags, /* TCL_READABLE or TCL_WRITABLE */
- Tcl_FileProc *proc,
- ClientData clientData)
-{
- PipeHandler *pipePtr;
-
- if (!initialized) {
- PipeInit();
- }
- if ((flags != TCL_READABLE) && (flags != TCL_WRITABLE)) {
- return; /* Only one of the flags can be set. */
- }
- pipePtr = CreatePipeHandler((HANDLE) fd, flags);
- pipePtr->proc = proc;
- pipePtr->clientData = clientData;
-
- /* Add the handler to the list of managed pipes. */
- EnterCriticalSection(&pipeCriticalSection);
- Blt_Chain_Append(&pipeChain, pipePtr);
- LeaveCriticalSection(&pipeCriticalSection);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_DeleteFileHandler --
- *
- * Win32 emulation Tcl_DeleteFileHandler. Cleans up resources
- * used.
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_DeleteFileHandler(int fd) /* Descriptor or handle of file */
-{
- PipeHandler *pipePtr;
- Blt_ChainLink link;
- HANDLE hPipe;
-
- if (!initialized) {
- PipeInit();
- }
-#if KILL_DEBUG
- PurifyPrintf("Blt_DeleteFileHandler(%d)\n", fd);
-#endif
- hPipe = (HANDLE) fd;
- EnterCriticalSection(&pipeCriticalSection);
-
- for (link = Blt_Chain_FirstLink(&pipeChain); link != NULL;
- link = Blt_Chain_NextLink(link)) {
- pipePtr = Blt_Chain_GetValue(link);
- if ((pipePtr->hPipe == hPipe) && !(pipePtr->flags & PIPE_DELETED)) {
- Blt_Chain_DeleteLink(&pipeChain, link);
- DeletePipeHandler(pipePtr);
- break;
- }
- }
- LeaveCriticalSection(&pipeCriticalSection);
-#if KILL_DEBUG
- PurifyPrintf("Blt_DeleteFileHandler: done\n");
-#endif
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_AsyncRead --
- *
- * Reads input from the pipe into the given buffer.
- *
- * Results:
- * Returns the number of bytes read.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_AsyncRead(
- int f,
- char *buffer,
- unsigned int size)
-{
- PipeHandler *pipePtr;
- unsigned int count;
- int nBytes;
-
-#if ASYNC_DEBUG
- PurifyPrintf("Blt_AsyncRead(f=%d)\n", f);
-#endif
- pipePtr = GetPipeHandler((HANDLE) f);
- if ((pipePtr == NULL) || (pipePtr->flags & PIPE_DELETED)) {
- errno = EBADF;
-#if ASYNC_DEBUG
- PurifyPrintf("Blt_AsyncRead: bad file\n");
-#endif
- return -1;
- }
- if (!PeekOnPipe(pipePtr, &nBytes)) {
-#if ASYNC_DEBUG
- PurifyPrintf("Blt_AsyncRead: pipe is drained (nBytes=%d).\n", nBytes);
-#endif
- return -1; /* No data available. */
- }
- /*
- * nBytes is 0 EOF found.
- * -1 Error occured.
- * 1+ Number of bytes available.
- */
- if (nBytes == -1) {
-#if ASYNC_DEBUG
- PurifyPrintf("Blt_AsyncRead: Error\n");
-#endif
- return -1;
- }
- if (nBytes == 0) {
-#if ASYNC_DEBUG
- PurifyPrintf("Blt_AsyncRead: EOF\n");
-#endif
- return 0;
- }
- count = pipePtr->end - pipePtr->start;
-#if ASYNC_DEBUG
- PurifyPrintf("Blt_AsyncRead: nBytes is %d, %d\n", nBytes, count);
-#endif
- assert(count == (unsigned int)nBytes);
- if (size > count) {
- size = count; /* Reset request to what's available. */
- }
- memcpy(buffer, pipePtr->buffer + pipePtr->start, size);
- pipePtr->start += size;
- if (pipePtr->start == pipePtr->end) {
-#if ASYNC_DEBUG
- PurifyPrintf("Blt_AsyncRead: signaling idle\n");
-#endif
- ResetEvent(pipePtr->readyEvent);
- SetEvent(pipePtr->idleEvent);
- }
- return size;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_AsyncWrite --
- *
- * Writes output to the pipe from the given buffer.
- *
- * Results:
- * Returns the number of bytes written.
- *
- *---------------------------------------------------------------------------
- */
-int
-Blt_AsyncWrite(
- int f,
- const char *buffer,
- unsigned int size)
-{
- PipeHandler *pipePtr;
-
- pipePtr = GetPipeHandler((HANDLE) f);
- if ((pipePtr == NULL) || (pipePtr->flags & PIPE_DELETED)) {
- errno = EBADF;
- return -1;
- }
- if (WaitForSingleObject(pipePtr->readyEvent, 0) == WAIT_TIMEOUT) {
- /*
- * Writer thread is currently blocked waiting for a write to
- * complete.
- */
- errno = EAGAIN;
- return -1;
- }
- /* Check for a background error on the last write. */
- if (pipePtr->lastError) {
- TclWinConvertError(pipePtr->lastError);
- pipePtr->lastError = 0;
- return -1;
- }
- /* Reallocate the buffer to be large enough to hold the data. */
- if (size > pipePtr->size) {
- char *ptr;
-
- ptr = Blt_AssertMalloc(size);
- Blt_Free(pipePtr->buffer);
- pipePtr->buffer = ptr;
- }
- memcpy(pipePtr->buffer, buffer, size);
- pipePtr->end = pipePtr->size = size;
- ResetEvent(pipePtr->readyEvent);
- SetEvent(pipePtr->idleEvent);
- return size;
-}
diff --git a/blt3.0.1/src/bltWinPrnt.c b/blt3.0.1/src/bltWinPrnt.c
deleted file mode 100644
index be20ac6..0000000
--- a/blt3.0.1/src/bltWinPrnt.c
+++ /dev/null
@@ -1,1658 +0,0 @@
-
-/*
- * bltWinPrnt.c --
- *
- * This module implements Win32 printer access.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <bltInt.h>
-#include "bltOp.h"
-#include <bltHash.h>
-#ifndef NO_PRINTER
-#include <X11/Xutil.h>
-#undef Status
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-#include <winspool.h>
-#endif /* _MSC_VER || __BORLANDC__ */
-#include "tkDisplay.h"
-
-/*
- set pid [printer open name]
- printer close $pid
- printer write $pid $data
- printer snap $pid .window
- printer names
- printer enum things
- printer getattr $pid
- printer setattr $pid
-
- set pid [open ]
- blt::printer open {\\alprint\2a211} p1
- p1 getattr varName
- p1 setattr varName
- p1 write $data
- .graph print p1
- p1 snap .window
- p1 close
- blt::printer names
- blt::printer emum things
-*/
-
-#define PRINTER_THREAD_KEY "BLT Printer Data"
-
-#ifdef notdef
-#define DM_SPECVERSION 0x0401
-
-#define DMPAPER_ISO_B4 42 /* B4 (ISO) 250 x 353 mm */
-#define DMPAPER_JAPANESE_POSTCARD 43 /* Japanese Postcard 100 x 148 mm */
-#define DMPAPER_9X11 44 /* 9 x 11 in */
-#define DMPAPER_10X11 45 /* 10 x 11 in */
-#define DMPAPER_15X11 46 /* 15 x 11 in */
-#define DMPAPER_ENV_INVITE 47 /* Envelope Invite 220 x 220 mm */
-#define DMPAPER_RESERVED_48 48 /* RESERVED--DO NOT USE */
-#define DMPAPER_RESERVED_49 49 /* RESERVED--DO NOT USE */
-#define DMPAPER_LETTER_EXTRA 50 /* Letter Extra 9 \275 x 12 in */
-#define DMPAPER_LEGAL_EXTRA 51 /* Legal Extra 9 \275 x 15 in */
-#define DMPAPER_TABLOID_EXTRA 52 /* Tabloid Extra 11.69 x 18 in */
-#define DMPAPER_A4_EXTRA 53 /* A4 Extra 9.27 x 12.69 in */
-#define DMPAPER_LETTER_TRANSVERSE 54 /* Letter Transverse 8 \275 x 11 in */
-#define DMPAPER_A4_TRANSVERSE 55 /* A4 Transverse 210 x 297 mm */
-#define DMPAPER_LETTER_EXTRA_TRANSVERSE 56 /* Letter Extra Transverse 9\275 x 12 in */
-#define DMPAPER_A_PLUS 57 /* SuperA/SuperA/A4 227 x 356 mm */
-#define DMPAPER_B_PLUS 58 /* SuperB/SuperB/A3 305 x 487 mm */
-#define DMPAPER_LETTER_PLUS 59 /* Letter Plus 8.5 x 12.69 in */
-#define DMPAPER_A4_PLUS 60 /* A4 Plus 210 x 330 mm */
-#define DMPAPER_A5_TRANSVERSE 61 /* A5 Transverse 148 x 210 mm */
-#define DMPAPER_B5_TRANSVERSE 62 /* B5 (JIS) Transverse 182 x 257 mm */
-#define DMPAPER_A3_EXTRA 63 /* A3 Extra 322 x 445 mm */
-#define DMPAPER_A5_EXTRA 64 /* A5 Extra 174 x 235 mm */
-#define DMPAPER_B5_EXTRA 65 /* B5 (ISO) Extra 201 x 276 mm */
-#define DMPAPER_A2 66 /* A2 420 x 594 mm */
-#define DMPAPER_A3_TRANSVERSE 67 /* A3 Transverse 297 x 420 mm */
-#define DMPAPER_A3_EXTRA_TRANSVERSE 68 /* A3 Extra Transverse 322 x 445 mm */
-#ifndef DMPAPER_LAST
-#define DMPAPER_LAST DMPAPER_A3_EXTRA_TRANSVERSE
-#endif /*DMPAPER_LAST */
-
-#define DMPAPER_USER 256
-
-/* bin selections */
-#ifndef DMPAPER_FIRST
-#define DMBIN_FIRST DMBIN_UPPER
-#endif /*DMPAPER_FIRST*/
-
-#define DMBIN_UPPER 1
-#define DMBIN_ONLYONE 1
-#define DMBIN_LOWER 2
-#define DMBIN_MIDDLE 3
-#define DMBIN_MANUAL 4
-#define DMBIN_ENVELOPE 5
-#define DMBIN_ENVMANUAL 6
-#define DMBIN_AUTO 7
-#define DMBIN_TRACTOR 8
-#define DMBIN_SMALLFMT 9
-#define DMBIN_LARGEFMT 10
-#define DMBIN_LARGECAPACITY 11
-#define DMBIN_CASSETTE 14
-#define DMBIN_FORMSOURCE 15
-
-#ifndef DMBIN_LAST
-#define DMBIN_LAST DMBIN_FORMSOURCE
-#endif /*DMBIN_LAST*/
-
-#define DMBIN_USER 256 /* device specific bins start here */
-
-/* print qualities */
-#define DMRES_DRAFT (-1)
-#define DMRES_LOW (-2)
-#define DMRES_MEDIUM (-3)
-#define DMRES_HIGH (-4)
-
-#define DMTT_DOWNLOAD_OUTLINE 4 /* download TT fonts as outline soft fonts */
-#endif /* DM */
-
-typedef struct {
- Blt_HashTable printerTable; /* Hash table of printer structures keyed by
- * the name of the printer. */
- int nextId;
-} PrinterInterpData;
-
-typedef struct {
- int type;
- HDC hDC;
-} PrintDrawable;
-
-typedef struct {
- Tcl_Interp *interp;
- Tcl_Command cmdToken; /* Token for vector's TCL command. */
- char *name;
- char *fileName;
- PrintDrawable drawable;
- HANDLE hPrinter;
- Blt_HashEntry *hashPtr;
- Blt_HashTable *tablePtr;
- char *driverName;
- char *deviceName;
- char *printerName;
- char *docName;
- char *portName;
- DEVMODE *dmPtr;
- int dmSize;
-} PrinterQueue;
-
-typedef struct {
- DWORD token;
- const char *string;
-} TokenString;
-
-static TokenString sizeTable[] =
-{
- /* Letter 8 1/2 x 11 in */
- { DMPAPER_LETTER, "Letter" },
- /* Letter Small 8 1/2 x 11 in */
- { DMPAPER_LETTERSMALL, "Letter Small" },
- /* Tabloid 11 x 17 in */
- { DMPAPER_TABLOID, "Tabloid" },
- /* Ledger 17 x 11 in */
- { DMPAPER_LEDGER, "Ledger" },
- /* Legal 8 1/2 x 14 in */
- { DMPAPER_LEGAL, "Legal" },
- /* Statement 5 1/2 x 8 1/2 in */
- { DMPAPER_STATEMENT, "Statement" },
- /* Executive 7 1/4 x 10 1/2 in */
- { DMPAPER_EXECUTIVE, "Executive" },
- /* A3 297 x 420 mm */
- { DMPAPER_A3, "A3" },
- /* A4 210 x 297 mm */
- { DMPAPER_A4, "A4" },
- /* A4 Small 210 x 297 mm */
- { DMPAPER_A4SMALL, "A4 Small" },
- /* A5 148 x 210 mm */
- { DMPAPER_A5, "A5" },
- /* B4 (JIS) 250 x 354 */
- { DMPAPER_B4, "B4 (JIS)" },
- /* B5 (JIS) 182 x 257 mm */
- { DMPAPER_B5, "B5 (JIS)" },
- /* Folio 8 1/2 x 13 in */
- { DMPAPER_FOLIO, "Folio" },
- /* Quarto 215 x 275 mm */
- { DMPAPER_QUARTO, "Quarto" },
- /* 10x14 in */
- { DMPAPER_10X14, "10x14" },
- /* 11x17 in */
- { DMPAPER_11X17, "11x17" },
- /* Note 8 1/2 x 11 in */
- { DMPAPER_NOTE, "Note" },
- /* Envelope #9 3 7/8 x 8 7/8 */
- { DMPAPER_ENV_9, "Envelope #9" },
- /* Envelope #10 4 1/8 x 9 1/2 */
- { DMPAPER_ENV_10, "Envelope #10" },
- /* Envelope #11 4 1/2 x 10 3/8 */
- { DMPAPER_ENV_11, "Envelope #11" },
- /* Envelope #12 4 \276 x 11 */
- { DMPAPER_ENV_12, "Envelope #12" },
- /* Envelope #14 5 x 11 1/2 */
- { DMPAPER_ENV_14, "Envelope #14" },
- /* C size sheet */
- { DMPAPER_CSHEET, "C size sheet" },
- /* D size sheet */
- { DMPAPER_DSHEET, "D size sheet" },
- /* E size sheet */
- { DMPAPER_ESHEET, "E size sheet" },
- /* Envelope DL 110 x 220mm */
- { DMPAPER_ENV_DL, "Envelope DL" },
- /* Envelope C5 162 x 229 mm */
- { DMPAPER_ENV_C5, "Envelope C5" },
- /* Envelope C3 324 x 458 mm */
- { DMPAPER_ENV_C3, "Envelope C3" },
- /* Envelope C4 229 x 324 mm */
- { DMPAPER_ENV_C4, "Envelope C4" },
- /* Envelope C6 114 x 162 mm */
- { DMPAPER_ENV_C6, "Envelope C6" },
- /* Envelope C65 114 x 229 mm */
- { DMPAPER_ENV_C65, "Envelope C65" },
- /* Envelope B4 250 x 353 mm */
- { DMPAPER_ENV_B4, "Envelope B4" },
- /* Envelope B5 176 x 250 mm */
- { DMPAPER_ENV_B5, "Envelope B5" },
- /* Envelope B6 176 x 125 mm */
- { DMPAPER_ENV_B6, "Envelope B6" },
- /* Envelope 110 x 230 mm */
- { DMPAPER_ENV_ITALY, "Envelope Italy" },
- /* Env Monarch 3 7/8 x 7 1/2 in */
- { DMPAPER_ENV_MONARCH, "Envelope Monarch" },
- /* 6 3/4 Envelope 3 5/8 x 6 1/2 in */
- { DMPAPER_ENV_PERSONAL, "6 3/4 Envelope" },
- /* US Std Fanfold 14 7/8 x 11 in */
- { DMPAPER_FANFOLD_US, "US Std Fanfold" },
- /* German Std Fanfold 8 1/2 x 12 in */
- { DMPAPER_FANFOLD_STD_GERMAN, "German Std Fanfold" },
- /* German Legal Fanfold 8 1/2 x 13 in */
- { DMPAPER_FANFOLD_LGL_GERMAN, "German Legal Fanfold" },
- /* B4 (ISO) 250 x 353 mm */
- { DMPAPER_ISO_B4, "ISOB4" },
- /* Japanese Postcard 100 x 148 mm */
- { DMPAPER_JAPANESE_POSTCARD, "Postcard (JIS)" },
- /* 9 x 11 in */
- { DMPAPER_9X11, "9x11" },
- /* 10 x 11 in */
- { DMPAPER_10X11, "10x11" },
- /* 15 x 11 in */
- { DMPAPER_15X11, "15x11" },
- /* Envelope Invite 220 x 220 mm */
- { DMPAPER_ENV_INVITE, "Envelope Invite" },
- /* Letter Extra 9 \275 x 12 in */
- { DMPAPER_LETTER_EXTRA, "Letter Extra" },
- /* Legal Extra 9 \275 x 15 in */
- { DMPAPER_LEGAL_EXTRA, "Legal Extra" },
- /* Tabloid Extra 11.69 x 18 in */
- { DMPAPER_TABLOID_EXTRA, "Tabloid Extra" },
- /* A4 Extra 9.27 x 12.69 in */
- { DMPAPER_A4_EXTRA, "A4 Extra" },
- /* Letter Transverse 8 \275 x 11 in */
- { DMPAPER_LETTER_TRANSVERSE, "Letter Transverse" },
- /* A4 Transverse 210 x 297 mm */
- { DMPAPER_A4_TRANSVERSE, "A4 Transverse" },
- /* Letter Extra Transverse 9\275 x 12 in */
- { DMPAPER_LETTER_EXTRA_TRANSVERSE, "Letter Extra Transverse" },
- /* SuperA/SuperA/A4 227 x 356 mm */
- { DMPAPER_A_PLUS, "Super A Plus" },
- /* SuperB/SuperB/A3 305 x 487 mm */
- { DMPAPER_B_PLUS, "Super B Plus" },
- /* Letter Plus 8.5 x 12.69 in */
- { DMPAPER_LETTER_PLUS, "Letter Plus" },
- /* A4 Plus 210 x 330 mm */
- { DMPAPER_A4_PLUS, "A4 Plus" },
- /* A5 Transverse 148 x 210 mm */
- { DMPAPER_A5_TRANSVERSE, "A5 Transverse" },
- /* B5 (JIS) Transverse 182 x 257 mm */
- { DMPAPER_B5_TRANSVERSE, "B5 Transverse" },
- /* A3 Extra 322 x 445 mm */
- { DMPAPER_A3_EXTRA, "A3 Extra" },
- /* A5 Extra 174 x 235 mm */
- { DMPAPER_A5_EXTRA, "A5 Extra" },
- /* B5 (ISO) Extra 201 x 276 mm */
- { DMPAPER_B5_EXTRA, "B5 Extra" },
- /* A2 420 x 594 mm */
- { DMPAPER_A2, "A2" },
- /* A3 Transverse 297 x 420 mm */
- { DMPAPER_A3_TRANSVERSE, "A3 Transverse" },
- /* A3 Extra Transverse 322 x 445 mm */
- { DMPAPER_A3_EXTRA_TRANSVERSE, "A3 Extra Transverse" },
- { 0, NULL }
-};
-
-static TokenString statusTable[] =
-{
- { PRINTER_STATUS_BUSY, "Busy" },
- { PRINTER_STATUS_DOOR_OPEN, "Door Open" },
- { PRINTER_STATUS_ERROR, "Error" },
- { PRINTER_STATUS_INITIALIZING, "Initializing" },
- { PRINTER_STATUS_IO_ACTIVE, "IO Active" },
- { PRINTER_STATUS_MANUAL_FEED, "Manual Feed" },
- { PRINTER_STATUS_NOT_AVAILABLE, "Not Available" },
- { PRINTER_STATUS_NO_TONER, "No Toner" },
- { PRINTER_STATUS_OFFLINE, "Offline" },
- { PRINTER_STATUS_OUTPUT_BIN_FULL, "Bin Full" },
- { PRINTER_STATUS_OUT_OF_MEMORY, "Out Of Memory" },
- { PRINTER_STATUS_PAGE_PUNT, "Page Punt" },
- { PRINTER_STATUS_PAPER_JAM, "Paper Jam" },
- { PRINTER_STATUS_PAPER_OUT, "Paper Out" },
- { PRINTER_STATUS_PAPER_PROBLEM, "Paper Problem" },
- { PRINTER_STATUS_PAUSED, "Paused" },
- { PRINTER_STATUS_PENDING_DELETION, "Pending Deletion" },
- { PRINTER_STATUS_POWER_SAVE, "Power Save" },
- { PRINTER_STATUS_PRINTING, "Printing" },
- { PRINTER_STATUS_PROCESSING, "Processing" },
- { PRINTER_STATUS_SERVER_UNKNOWN, "Server Unknown" },
- { PRINTER_STATUS_TONER_LOW, "Toner Low" },
- { PRINTER_STATUS_USER_INTERVENTION, "User Intervention" },
- { PRINTER_STATUS_WAITING, "Waiting" },
- { PRINTER_STATUS_WARMING_UP, "Warming Up" },
- { 0, NULL }
-};
-
-static TokenString attributeTable[] =
-{
- { PRINTER_ATTRIBUTE_DEFAULT, "Default" },
- { PRINTER_ATTRIBUTE_DIRECT, "Direct" },
- { PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST, "Do Complete First" },
- { PRINTER_ATTRIBUTE_ENABLE_BIDI, "Enable BIDI" },
- { PRINTER_ATTRIBUTE_ENABLE_DEVQ, "Enable Devq" },
- { PRINTER_ATTRIBUTE_HIDDEN, "Hidden" },
- { PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS, "Keep Printed Jobs" },
- { PRINTER_ATTRIBUTE_LOCAL, "Local" },
- { PRINTER_ATTRIBUTE_NETWORK, "Network" },
- { PRINTER_ATTRIBUTE_QUEUED, "Queued" },
- { PRINTER_ATTRIBUTE_RAW_ONLY, "Raw Only" },
- { PRINTER_ATTRIBUTE_SHARED, "Shared" },
- { PRINTER_ATTRIBUTE_WORK_OFFLINE, "Offline" },
- { 0, NULL }
-};
-
-static TokenString binTable[] =
-{
- { DMBIN_UPPER, "Upper" },
- { DMBIN_LOWER, "Lower" },
- { DMBIN_MIDDLE, "Middle" },
- { DMBIN_MANUAL, "Manual" },
- { DMBIN_ENVELOPE, "Envelope" },
- { DMBIN_ENVMANUAL, "Envelope Manual" },
- { DMBIN_AUTO, "Automatic" },
- { DMBIN_TRACTOR, "Tractor" },
- { DMBIN_SMALLFMT, "Small Format" },
- { DMBIN_LARGEFMT, "Large Format" },
- { DMBIN_LARGECAPACITY, "Large Capacity" },
- { DMBIN_CASSETTE, "Cassette" },
- { DMBIN_FORMSOURCE, "Form Source" },
- { 0, NULL }
-};
-
-static TokenString orientationTable[] =
-{
- { DMORIENT_PORTRAIT, "Portrait" },
- { DMORIENT_LANDSCAPE, "Landscape" },
- { 0, NULL }
-};
-
-static TokenString qualityTable[] =
-{
- { DMRES_HIGH, "High" },
- { DMRES_MEDIUM, "Medium" },
- { DMRES_LOW, "Low" },
- { DMRES_DRAFT, "Draft" },
- { 0, NULL }
-};
-
-static TokenString colorTable[] =
-{
- { DMCOLOR_COLOR, "Color" },
- { DMCOLOR_MONOCHROME, "Monochrome" },
- { 0, NULL }
-};
-
-static TokenString duplexTable[] =
-{
- { DMDUP_SIMPLEX, "Simplex" },
- { DMDUP_HORIZONTAL, "Horizontal" },
- { DMDUP_VERTICAL, "Vertical" },
- { 0, NULL }
-};
-
-static TokenString ttOptionTable[] =
-{
- { DMTT_BITMAP, "Bitmap" },
- { DMTT_DOWNLOAD, "Download" },
- { DMTT_SUBDEV, "Substitute Device" },
- { DMTT_DOWNLOAD_OUTLINE, "Download Outline" },
- { 0, NULL }
-};
-
-static Tcl_ObjCmdProc PrinterCmd;
-static Tcl_InterpDeleteProc PrinterInterpDeleteProc;
-
-void
-Blt_GetPrinterScale(HDC printerDC, double *xRatioPtr, double *yRatioPtr)
-{
- double xScreen, yScreen;
- double xPrinter, yPrinter;
- HDC screenDC;
-
- xPrinter = (double)GetDeviceCaps(printerDC, LOGPIXELSX);
- yPrinter = (double)GetDeviceCaps(printerDC, LOGPIXELSY);
- screenDC = GetDC(NULL);
- xScreen = (double)GetDeviceCaps(screenDC, LOGPIXELSX);
- yScreen = (double)GetDeviceCaps(screenDC, LOGPIXELSY);
- ReleaseDC(NULL, screenDC);
- *xRatioPtr = (xPrinter / xScreen);
- *yRatioPtr = (yPrinter / yScreen);
-}
-
-static PrinterInterpData *
-GetPrinterInterpData(Tcl_Interp *interp)
-{
- PrinterInterpData *dataPtr;
- Tcl_InterpDeleteProc *proc;
-
- dataPtr = (PrinterInterpData *)
- Tcl_GetAssocData(interp, PRINTER_THREAD_KEY, &proc);
- if (dataPtr == NULL) {
- dataPtr = Blt_AssertMalloc(sizeof(PrinterInterpData));
- dataPtr->nextId = 0;
- Tcl_SetAssocData(interp, PRINTER_THREAD_KEY, PrinterInterpDeleteProc,
- dataPtr);
- Blt_InitHashTable(&dataPtr->printerTable, BLT_STRING_KEYS);
- }
- return dataPtr;
-}
-
-static int
-GetQueue(
- Tcl_Interp *interp,
- const char *name,
- PrinterQueue **queuePtrPtr)
-{
- Blt_HashEntry *hPtr;
- PrinterInterpData *dataPtr;
-
- dataPtr = GetPrinterInterpData(interp);
- hPtr = Blt_FindHashEntry(&dataPtr->printerTable, name);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "can't find printer \"", name, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- *queuePtrPtr = Blt_GetHashValue(hPtr);
- return TCL_OK;
-}
-
-static int
-GetQueueFromObj(
- Tcl_Interp *interp,
- Tcl_Obj *objPtr,
- PrinterQueue **queuePtrPtr)
-{
- return GetQueue(interp, Tcl_GetString(objPtr), queuePtrPtr);
-}
-
-static void
-CloseQueue(
- PrinterQueue *queuePtr)
-{
- ClosePrinter(queuePtr->hPrinter);
- queuePtr->hPrinter = NULL;
-}
-
-static int
-OpenQueue(
- Tcl_Interp *interp,
- PrinterQueue *queuePtr)
-{
- PRINTER_DEFAULTS pd;
- HANDLE hPrinter;
-
- ZeroMemory(&pd, sizeof(pd));
- pd.DesiredAccess = PRINTER_ALL_ACCESS;
- if (!OpenPrinter(queuePtr->printerName, &hPrinter, &pd)) {
- Tcl_AppendResult(interp, "can't open printer \"",
- queuePtr->printerName, "\": ", Blt_LastError(), (char *)NULL);
- queuePtr->hPrinter = NULL;
- return TCL_ERROR;
- }
- queuePtr->hPrinter = hPrinter;
- return TCL_OK;
-}
-
-static HGLOBAL
-GetQueueProperties(
- PrinterQueue *queuePtr,
- DEVMODE **dmPtrPtr)
-{
- HWND hWnd;
- unsigned int dmSize;
- HGLOBAL hMem;
- DEVMODE *dmPtr;
-
- hWnd = GetDesktopWindow();
- dmSize = DocumentProperties(hWnd, queuePtr->hPrinter,
- queuePtr->printerName, NULL, NULL, 0);
- if (dmSize == 0) {
- Tcl_AppendResult(queuePtr->interp,
- "can't get document properties for \"",
- queuePtr->printerName,
- "\": ", Blt_LastError(), (char *)NULL);
- return NULL;
- }
- hMem = GlobalAlloc(GHND, dmSize);
- dmPtr = (DEVMODE *)GlobalLock(hMem);
- if (!DocumentProperties(hWnd, queuePtr->hPrinter, queuePtr->printerName,
- dmPtr, NULL, DM_OUT_BUFFER)) {
- Tcl_AppendResult(queuePtr->interp,
- "can't allocate document properties for \"",
- queuePtr->printerName, "\": ", Blt_LastError(),
- (char *)NULL);
- GlobalUnlock(hMem);
- GlobalFree(hMem);
- return NULL;
- }
- *dmPtrPtr = dmPtr;
- queuePtr->dmSize = dmSize;
- return hMem;
-}
-
-static int
-SetQueueProperties(
- Tcl_Interp *interp,
- PrinterQueue *queuePtr,
- DEVMODE *dmPtr)
-{
- HWND hWnd;
- int result;
-
- hWnd = GetDesktopWindow();
- result = DocumentProperties(hWnd, queuePtr->hPrinter,
- queuePtr->printerName, dmPtr, dmPtr, DM_IN_BUFFER | DM_OUT_BUFFER);
- if (result == 0) {
- Tcl_AppendResult(interp, "can't set document properties for \"",
- queuePtr->printerName, "\": ", Blt_LastError(), (char *)NULL);
- return TCL_ERROR;
- }
- if (queuePtr->dmPtr != NULL) {
- Blt_Free(queuePtr->dmPtr);
- }
- queuePtr->dmPtr = Blt_AssertMalloc(queuePtr->dmSize);
- *queuePtr->dmPtr = *dmPtr;
- return TCL_OK;
-}
-
-static void
-DestroyQueue(PrinterQueue *queuePtr)
-{
- if (queuePtr->drawable.hDC != NULL) {
- DeleteDC(queuePtr->drawable.hDC);
- }
- if (queuePtr->printerName != NULL) {
- Blt_Free(queuePtr->printerName);
- }
- if (queuePtr->deviceName != NULL) {
- Blt_Free(queuePtr->deviceName);
- }
- if (queuePtr->portName != NULL) {
- Blt_Free(queuePtr->portName);
- }
- if (queuePtr->driverName != NULL) {
- Blt_Free(queuePtr->driverName);
- }
- if (queuePtr->hashPtr != NULL) {
- Blt_DeleteHashEntry(queuePtr->tablePtr, queuePtr->hashPtr);
- }
- if (queuePtr->dmPtr != NULL) {
- Blt_Free(queuePtr->dmPtr);
- }
- Blt_Free(queuePtr);
-}
-
-static char *
-AttributesToString(DWORD attributes, Tcl_DString * resultPtr)
-{
- TokenString *p;
-
- Tcl_DStringInit(resultPtr);
- for (p = attributeTable; p->string != NULL; p++) {
- if (attributes & p->token) {
- Tcl_DStringAppendElement(resultPtr, p->string);
- }
- }
- return Tcl_DStringValue(resultPtr);
-}
-
-static char *
-StatusToString(DWORD status, Tcl_DString * resultPtr)
-{
- TokenString *p;
-
- Tcl_DStringInit(resultPtr);
- for (p = statusTable; p->string != NULL; p++) {
- if (status & p->token) {
- Tcl_DStringAppendElement(resultPtr, p->string);
- }
- }
- return Tcl_DStringValue(resultPtr);
-}
-
-static const char *
-TokenToString(TokenString *table, DWORD token)
-{
- TokenString *p;
-
- for (p = table; p->string != NULL; p++) {
- if (token == p->token) {
- return p->string;
- }
- }
- return "???";
-}
-
-static DWORD
-StringToToken(TokenString * table, char *string)
-{
- TokenString *p;
- char c;
-
- c = toupper(string[0]);
- for (p = table; p->string != NULL; p++) {
- if ((c == toupper(p->string[0])) &&
- (strcasecmp(string, p->string) == 0)) {
- return p->token;
- }
- }
- return 0;
-}
-
-static void
-GetFormInfo(
- Tcl_Interp *interp,
- FORM_INFO_1 * infoArr,
- int nForms,
- const char *varName)
-{
- Tcl_DString dString;
- int i;
-
- Tcl_DStringInit(&dString);
- for (i = 0; i < nForms; i++) {
- Tcl_DStringAppendElement(&dString, infoArr[i].pName);
- }
- Tcl_SetVar2(interp, varName, "EnumForms", Tcl_DStringValue(&dString),
- TCL_LEAVE_ERR_MSG);
- Tcl_DStringFree(&dString);
-}
-
-
-static int
-GetPrinterAttributes(
- Tcl_Interp *interp, /* Interpreter context. */
- PrinterQueue *queuePtr,
- Tcl_Obj *objPtr) /* Name of array variable to contain
- * printer device information. */
-{
- const char *string;
- Tcl_DString dString;
- DEVMODE *dmPtr;
- DWORD bytesNeeded;
- HGLOBAL hMem1, hMem2;
- PRINTER_INFO_2* pi2Ptr;
- LPVOID buffer;
- int result = TCL_ERROR;
- const char *varName;
-
- if (OpenQueue(interp, queuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_DStringInit(&dString);
- hMem2 = NULL;
-
- GetPrinter(queuePtr->hPrinter, 2, NULL, 0, &bytesNeeded);
-
- /* Windows 95/98 seems to only want locked memory. Allocating
- * unlocked memory will sometimes crash the printer driver and
- * therefore Windows itself. */
-
- hMem1 = GlobalAlloc(GHND, bytesNeeded);
- if (hMem1 == NULL) {
- Tcl_AppendResult(interp, "can't allocate memory for printer \"",
- queuePtr->name, "\": ", Blt_LastError(), (char *)NULL);
- goto error;
- }
- buffer = (LPVOID)GlobalLock(hMem1);
- if (!GetPrinter(queuePtr->hPrinter, 2, buffer, bytesNeeded,
- &bytesNeeded)) {
- Tcl_AppendResult(interp, "can't get printer \"", queuePtr->name, "\": ",
- Blt_LastError(), (char *)NULL);
- goto error;
- }
- hMem2 = GetQueueProperties(queuePtr, &dmPtr);
- if (hMem2 == NULL) {
- Tcl_AppendResult(interp, "can't allocate memory for printer \"",
- queuePtr->name, "\" properties: ", Blt_LastError(), (char *)NULL);
- goto error;
- }
- pi2Ptr = (PRINTER_INFO_2 *)buffer;
- varName = Tcl_GetString(objPtr);
- Tcl_SetVar2(interp, varName, "ServerName", pi2Ptr->pServerName, 0);
- Tcl_SetVar2(interp, varName, "PrinterName", pi2Ptr->pPrinterName, 0);
- Tcl_SetVar2(interp, varName, "PortName", pi2Ptr->pPortName, 0);
- Tcl_SetVar2(interp, varName, "DriverName", pi2Ptr->pDriverName, 0);
- Tcl_SetVar2(interp, varName, "Comment", pi2Ptr->pComment, 0);
- Tcl_SetVar2(interp, varName, "Location", pi2Ptr->pLocation, 0);
- Tcl_SetVar2(interp, varName, "SepFile", pi2Ptr->pSepFile, 0);
- Tcl_SetVar2(interp, varName, "PrintProcessor", pi2Ptr->pPrintProcessor, 0);
- Tcl_SetVar2(interp, varName, "Datatype", pi2Ptr->pDatatype, 0);
- Tcl_SetVar2(interp, varName, "Parameters", pi2Ptr->pParameters, 0);
- Tcl_SetVar2(interp, varName, "Attributes",
- AttributesToString(pi2Ptr->Attributes, &dString), 0);
- Tcl_SetVar2(interp, varName, "Priority", Blt_Itoa(pi2Ptr->Priority), 0);
- Tcl_SetVar2(interp, varName, "DefaultPriority",
- Blt_Itoa(pi2Ptr->DefaultPriority), 0);
- Tcl_SetVar2(interp, varName, "StartTime", Blt_Itoa(pi2Ptr->StartTime), 0);
- Tcl_SetVar2(interp, varName, "UntilTime", Blt_Itoa(pi2Ptr->UntilTime), 0);
- Tcl_SetVar2(interp, varName, "Status",
- StatusToString(pi2Ptr->Status, &dString), 0);
- Tcl_SetVar2(interp, varName, "Jobs", Blt_Itoa(pi2Ptr->cJobs), 0);
- Tcl_SetVar2(interp, varName, "AveragePPM", Blt_Itoa(pi2Ptr->AveragePPM), 0);
-
- if (dmPtr->dmFields & DM_ORIENTATION) {
- Tcl_SetVar2(interp, varName, "Orientation",
- TokenToString(orientationTable, dmPtr->dmOrientation), 0);
- }
- if (dmPtr->dmFields & DM_PAPERSIZE) {
- Tcl_SetVar2(interp, varName, "PaperSize",
- TokenToString(sizeTable, dmPtr->dmPaperSize), 0);
- }
- if (dmPtr->dmFields & DM_PAPERWIDTH) {
- Tcl_SetVar2(interp, varName, "PaperWidth",
- Blt_Itoa(dmPtr->dmPaperWidth), 0);
- }
- if (dmPtr->dmFields & DM_PAPERLENGTH) {
- Tcl_SetVar2(interp, varName, "PaperLength",
- Blt_Itoa(dmPtr->dmPaperLength), 0);
- }
- if (dmPtr->dmFields & DM_SCALE) {
- Tcl_SetVar2(interp, varName, "Scale", Blt_Itoa(dmPtr->dmScale), 0);
- }
- if (dmPtr->dmFields & DM_COPIES) {
- Tcl_SetVar2(interp, varName, "Copies", Blt_Itoa(dmPtr->dmCopies), 0);
- }
- if (dmPtr->dmFields & DM_DEFAULTSOURCE) {
- Tcl_SetVar2(interp, varName, "DefaultSource",
- TokenToString(binTable, dmPtr->dmDefaultSource), 0);
- }
- if (dmPtr->dmFields & DM_PRINTQUALITY) {
- if (dmPtr->dmPrintQuality < 0) {
- string = TokenToString(qualityTable, dmPtr->dmPrintQuality);
- } else {
- string = Blt_Itoa(dmPtr->dmPrintQuality);
- }
- Tcl_SetVar2(interp, varName, "PrintQuality", string, 0);
- }
- if (dmPtr->dmFields & DM_COLOR) {
- Tcl_SetVar2(interp, varName, "Color",
- TokenToString(colorTable, dmPtr->dmColor), 0);
- }
- if (dmPtr->dmFields & DM_DUPLEX) {
- Tcl_SetVar2(interp, varName, "Duplex",
- TokenToString(duplexTable, dmPtr->dmDuplex), 0);
- }
- if (dmPtr->dmFields & DM_YRESOLUTION) {
- Tcl_SetVar2(interp, varName, "YResolution",
- Blt_Itoa(dmPtr->dmYResolution), 0);
- }
- if (dmPtr->dmFields & DM_TTOPTION) {
- Tcl_SetVar2(interp, varName, "TTOption",
- TokenToString(ttOptionTable, dmPtr->dmTTOption), 0);
- }
- if (dmPtr->dmFields & DM_COLLATE) {
- if (dmPtr->dmCollate == DMCOLLATE_TRUE) {
- string = "true";
- } else if (dmPtr->dmCollate == DMCOLLATE_FALSE) {
- string = "false";
- } else {
- string = "???";
- }
- Tcl_SetVar2(interp, varName, "Collate", string, 0);
- }
- if (dmPtr->dmFields & DM_FORMNAME) {
- Tcl_SetVar2(interp, varName, "FormName", dmPtr->dmFormName, 0);
- }
- Tcl_SetVar2(interp, varName, "OutputFile", dmPtr->dmDeviceName, 0);
- result = TCL_OK;
-
- error:
- Tcl_DStringFree(&dString);
- CloseQueue(queuePtr);
- if (hMem1 != NULL) {
- GlobalUnlock(hMem1);
- GlobalFree(hMem1);
- }
- if (hMem2 != NULL) {
- GlobalUnlock(hMem2);
- GlobalFree(hMem2);
- }
- return result;
-}
-
-static int
-SetQueueAttributes(
- Tcl_Interp *interp,
- PrinterQueue *queuePtr,
- Tcl_Obj *objPtr)
-{
- char *string;
- DEVMODE *dmPtr;
- int value;
- HGLOBAL hMem;
- int result;
- char *varName;
-
- if (OpenQueue(interp, queuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- hMem = GetQueueProperties(queuePtr, &dmPtr);
- CloseQueue(queuePtr);
- if (hMem == NULL) {
- return TCL_ERROR;
- }
- dmPtr->dmFields = 0;
- varName = Tcl_GetString(objPtr);
- string = (char *)Tcl_GetVar2(interp, varName, "Orientation", 0);
- if (string != NULL) {
- value = StringToToken(orientationTable, string);
- if (value > 0) {
- dmPtr->dmFields |= DM_ORIENTATION;
- dmPtr->dmOrientation = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "PaperSize", 0);
- if (string != NULL) {
- value = StringToToken(sizeTable, string);
- if (value > 0) {
- dmPtr->dmFields |= DM_PAPERSIZE;
- dmPtr->dmPaperSize = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "PaperWidth", 0);
- if (string != NULL) {
- if (Tcl_GetInt(interp, string, &value) == TCL_OK) {
- dmPtr->dmFields |= DM_PAPERWIDTH;
- dmPtr->dmPaperWidth = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "PaperLength", 0);
- if (string != NULL) {
- if (Tcl_GetInt(interp, string, &value) == TCL_OK) {
- dmPtr->dmFields |= DM_PAPERLENGTH;
- dmPtr->dmPaperLength = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "Scale", 0);
- if (string != NULL) {
- if (Tcl_GetInt(interp, string, &value) == TCL_OK) {
- dmPtr->dmFields |= DM_SCALE;
- dmPtr->dmScale = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "Copies", 0);
- if (string != NULL) {
- if (Tcl_GetInt(interp, string, &value) == TCL_OK) {
- dmPtr->dmFields |= DM_COPIES;
- dmPtr->dmCopies = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "DefaultSource", 0);
- if (string != NULL) {
- value = StringToToken(binTable, string);
- if (value > 0) {
- dmPtr->dmFields |= DM_DEFAULTSOURCE;
- dmPtr->dmDefaultSource = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "PrintQuality", 0);
- if (string != NULL) {
- value = StringToToken(qualityTable, string);
- if (value > 0) {
- dmPtr->dmFields |= DM_PRINTQUALITY;
- dmPtr->dmPrintQuality = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "Color", 0);
- if (string != NULL) {
- value = StringToToken(colorTable, string);
- if (value > 0) {
- dmPtr->dmFields |= DM_COLOR;
- dmPtr->dmColor = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "Duplex", 0);
- if (string != NULL) {
- value = StringToToken(duplexTable, string);
- if (value > 0) {
- dmPtr->dmFields |= DM_DUPLEX;
- dmPtr->dmDuplex = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "YResolution", 0);
- if (string != NULL) {
- if (Tcl_GetInt(interp, string, &value) == TCL_OK) {
- dmPtr->dmFields |= DM_YRESOLUTION;
- dmPtr->dmYResolution = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "TTOption", 0);
- if (string != NULL) {
- value = StringToToken(ttOptionTable, string);
- if (value > 0) {
- dmPtr->dmFields |= DM_TTOPTION;
- dmPtr->dmTTOption = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "Collate", 0);
- if (string != NULL) {
- if (Tcl_GetBoolean(interp, string, &value) == TCL_OK) {
- dmPtr->dmFields |= DM_COLLATE;
- dmPtr->dmCollate = value;
- }
- }
- string = (char *)Tcl_GetVar2(interp, varName, "OutputFile", 0);
- if (string != NULL) {
- if (queuePtr->fileName != NULL) {
- Blt_Free(queuePtr->fileName);
- }
- queuePtr->fileName = Blt_AssertStrdup(string);
- }
- if (queuePtr->dmPtr != NULL) {
- Blt_Free(queuePtr->dmPtr);
- }
- string = (char *)Tcl_GetVar2(interp, varName, "DocumentName", 0);
- if (string != NULL) {
- if (queuePtr->docName != NULL) {
- Blt_Free(queuePtr->docName);
- }
- queuePtr->docName = Blt_AssertStrdup(string);
- }
- result = SetQueueProperties(interp, queuePtr, dmPtr);
- GlobalUnlock(hMem);
- GlobalFree(hMem);
- CloseQueue(queuePtr);
- return result;
-}
-
-/*ARGSUSED*/
-static int
-EnumOp(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- TokenString *p;
- char c;
- unsigned int length;
- char *attr;
-
- attr = Tcl_GetStringFromObj(objv[2], &length);
- c = attr[0];
- if ((c == 'p') && (strncmp(attr, "paper", length) == 0)) {
- p = sizeTable;
- } else if ((c == 'q') && (strncmp(attr, "quality", length) == 0)) {
- p = qualityTable;
- } else if ((c == 'b') && (strncmp(attr, "bin", length) == 0)) {
- p = binTable;
- } else if ((c == 'o') && (strncmp(attr, "orientation", length) == 0)) {
- p = orientationTable;
- } else if ((c == 'c') && (strncmp(attr, "color", length) == 0)) {
- p = colorTable;
- } else if ((c == 'd') && (strncmp(attr, "duplex", length) == 0)) {
- p = duplexTable;
- } else if ((c == 't') && (strncmp(attr, "ttoption", length) == 0)) {
- p = ttOptionTable;
- } else {
- Tcl_AppendResult(interp, "bad enumeration field \"", attr,
-"\": should be \"paper\", \"quality\", \"bin\", \"orientation\", \"color\", \"duplex\", or \"ttoption\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- for ( /*empty*/ ; p->string != NULL; p++) {
- Tcl_AppendElement(interp, p->string);
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-OpenOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- PrinterInterpData *dataPtr = clientData;
- PrinterQueue *queuePtr;
- LPVOID buffer;
- PRINTER_INFO_2* pi2Ptr;
- DWORD bytesNeeded;
- int isNew;
- Blt_HashEntry *hPtr;
- HANDLE hMem;
- char *name;
-
- name = Tcl_GetString(objv[2]);
- hPtr = Blt_CreateHashEntry(&dataPtr->printerTable, name, &isNew);
- if (isNew) {
- queuePtr = Blt_AssertCalloc(1, sizeof(PrinterQueue));
- queuePtr->name = Blt_GetHashKey(&dataPtr->printerTable, hPtr);
- queuePtr->interp = interp;
- Tcl_SetStringObj(Tcl_GetObjResult(interp), name, -1);
- Blt_SetHashValue(hPtr, queuePtr);
- queuePtr->hashPtr = hPtr;
- queuePtr->tablePtr = &dataPtr->printerTable;
- queuePtr->printerName = Blt_AssertStrdup(name);
- } else {
- Tcl_AppendResult(interp, "printer \"", name, "\" is already open",
- (char *)NULL);
- return TCL_ERROR;
- }
- if (OpenQueue(interp, queuePtr) != TCL_OK) {
- DestroyQueue(queuePtr);
- return TCL_ERROR;
- }
- /* Call the first time to determine the amount of memory needed. */
- GetPrinter(queuePtr->hPrinter, 2, NULL, 0, &bytesNeeded);
- if ((bytesNeeded == 0) || (GetLastError() != ERROR_INSUFFICIENT_BUFFER)) {
- Tcl_AppendResult(interp, "can't get size of attribute buffer for \"",
- name, "\": ", Blt_LastError(), (char *)NULL);
- return TCL_ERROR;
- }
- /* Allocate a buffer to contain all printer information. */
- hMem = GlobalAlloc(GHND, bytesNeeded);
- if (hMem == NULL) {
- return TCL_ERROR;
- }
- buffer = (LPVOID)GlobalLock(hMem);
-
- /* And call the again to actually get the printer. */
- if (!GetPrinter(queuePtr->hPrinter, 2, buffer, bytesNeeded,
- &bytesNeeded)) {
- Tcl_AppendResult(interp, "can't get printer attributes for \"",
- name, "\": ", Blt_LastError(), (char *)NULL);
- GlobalUnlock(hMem);
- GlobalFree(hMem);
- return TCL_ERROR;
- }
- pi2Ptr = (PRINTER_INFO_2 *)buffer;
- if (pi2Ptr->pDevMode != NULL) {
- queuePtr->deviceName = Blt_AssertStrdup(pi2Ptr->pDevMode->dmDeviceName);
- }
- queuePtr->driverName = Blt_AssertStrdup(pi2Ptr->pDriverName);
- /*
- queuePtr->printerName = Blt_AssertStrdup(pi2Ptr->pPrinterName);
- */
- queuePtr->portName = Blt_AssertStrdup(pi2Ptr->pPortName);
- GlobalUnlock(hMem);
- GlobalFree(hMem);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-NamesOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv) /* Not used. */
-{
- DWORD nPrinters, bytesNeeded;
- int elemSize, level;
- unsigned char *buffer;
- int result, flags;
- HANDLE hMem;
-
- if (Blt_GetPlatformId() == VER_PLATFORM_WIN32_NT) {
- level = 4;
- elemSize = sizeof(PRINTER_INFO_4);
- flags = PRINTER_ENUM_NAME;
- } else {
- level = 5;
- elemSize = sizeof(PRINTER_INFO_5);
- flags = PRINTER_ENUM_LOCAL;
- }
- result = EnumPrinters(
- flags, /* Flags */
- NULL, /* Printer name */
- level, /* Information level: 1, 2, 4, or 5 */
- NULL, /* Array of returned information */
- 0, /* Size of array */
- &bytesNeeded, /* Size needed for array */
- &nPrinters); /* Number of structures returned */
-
- if ((!result) && (GetLastError() != ERROR_INSUFFICIENT_BUFFER)) {
- Tcl_AppendResult(interp, "can't enumerate printers (memory alloc): ",
- Blt_LastError(), (char *)NULL);
- return TCL_ERROR;
- }
- hMem = GlobalAlloc(GHND, bytesNeeded);
- buffer = (unsigned char *)GlobalLock(hMem);
-
- result = EnumPrinters(
- flags, /* Flags */
- NULL, /* Printer name */
- level, /* Information level: 1, 2, 4, or 5 */
- buffer, /* Array of returned information */
- bytesNeeded, /* Size of array */
- &bytesNeeded, /* Size needed for array */
- &nPrinters); /* Number of structures returned */
-
- if (!result) {
- Tcl_AppendResult(interp, "can't enumerate printers: ",
- Blt_LastError(), (char *)NULL);
- return TCL_ERROR;
- }
- if (objc > 2) {
- unsigned int i;
- char *pattern;
- char *p;
-
- p = buffer;
- pattern = Tcl_GetString(objv[2]);
- for (i = 0; i < nPrinters; i++) {
- if (Tcl_StringMatch(p, pattern)) {
- Tcl_AppendElement(interp, *(char **)p);
- }
- p += elemSize;
- }
- } else {
- unsigned int i;
- char *p;
-
- p = buffer;
- for (i = 0; i < nPrinters; i++) {
- Tcl_AppendElement(interp, *(char **)p);
- p += elemSize;
- }
- }
- GlobalUnlock(hMem);
- GlobalFree(hMem);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-CloseOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- PrinterQueue *queuePtr;
-
- if (GetQueueFromObj(interp, objv[2], &queuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- DestroyQueue(queuePtr);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-GetAttrOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- PrinterQueue *queuePtr;
-
- if (GetQueueFromObj(interp, objv[2], &queuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return GetPrinterAttributes(interp, queuePtr, objv[3]);
-}
-
-/*ARGSUSED*/
-static int
-SetAttrOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- PrinterQueue *queuePtr;
-
- if (GetQueueFromObj(interp, objv[2], &queuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- return SetQueueAttributes(interp, queuePtr, objv[3]);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SnapOp --
- *
- * Prints a snapshot of a Tk_Window to the designated printer.
- *
- * Results:
- * Returns a standard TCL result. If an error occurred
- * TCL_ERROR is returned and interp->result will contain an
- * error message.
- *
- *---------------------------------------------------------------------------
- */
-static int
-SnapOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- BITMAPINFO bi;
- DIBSECTION ds;
- HBITMAP hBitmap;
- HPALETTE hPalette;
- HDC hDC, printDC, memDC;
- void *data;
- Tk_Window tkwin;
- TkWinDCState state;
- int result;
- PrinterQueue *queuePtr;
- DOCINFO di;
- double pageWidth, pageHeight;
- int jobId;
- char *driverName;
- DEVMODE *dmPtr;
- HGLOBAL hMem;
- Tcl_DString dString;
- char *path;
-
- Tcl_DStringInit(&dString);
- if (GetQueueFromObj(interp, objv[2], &queuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- path = Tcl_GetString(objv[3]);
- tkwin = Tk_NameToWindow(interp, path, Tk_MainWindow(interp));
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_WindowId(tkwin) == None) {
- Tk_MakeWindowExist(tkwin);
- }
-
- result = TCL_ERROR;
- hDC = TkWinGetDrawableDC(Tk_Display(tkwin), Tk_WindowId(tkwin), &state);
-
- ZeroMemory(&bi, sizeof(bi));
- bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bi.bmiHeader.biWidth = Tk_Width(tkwin);
- bi.bmiHeader.biHeight = Tk_Height(tkwin);
- bi.bmiHeader.biPlanes = 1;
- bi.bmiHeader.biBitCount = 32;
- bi.bmiHeader.biCompression = BI_RGB;
- hBitmap = CreateDIBSection(hDC, &bi, DIB_RGB_COLORS, &data, NULL, 0);
- memDC = CreateCompatibleDC(hDC);
- SelectBitmap(memDC, hBitmap);
- hPalette = Blt_GetSystemPalette();
- if (hPalette != NULL) {
- SelectPalette(hDC, hPalette, FALSE);
- RealizePalette(hDC);
- SelectPalette(memDC, hPalette, FALSE);
- RealizePalette(memDC);
- }
- /* Copy the window contents to the memory surface. */
- if (!BitBlt(memDC, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), hDC, 0, 0,
- SRCCOPY)) {
- Tcl_AppendResult(interp, "can't blit \"", Tk_PathName(tkwin), "\": ",
- Blt_LastError(), (char *)NULL);
- goto done;
- }
- /* Now that the DIB contains the image of the window, get the
- * databits and write them to the printer device, stretching the
- * image to the fit the printer's resolution. */
- if (GetObject(hBitmap, sizeof(DIBSECTION), &ds) == 0) {
- Tcl_AppendResult(interp, "can't get DIB object: ", Blt_LastError(),
- (char *)NULL);
- goto done;
- }
- driverName = NULL;
- if (Blt_GetPlatformId() == VER_PLATFORM_WIN32_NT) {
- driverName = queuePtr->driverName;
- }
- if (OpenQueue(interp, queuePtr) != TCL_OK) {
- goto done;
- }
- hMem = GetQueueProperties(queuePtr, &dmPtr);
- if (hMem == NULL) {
- goto done;
- }
- printDC = CreateDC(driverName, queuePtr->deviceName, NULL, dmPtr);
- GlobalUnlock(hMem);
- GlobalFree(hMem);
- if (printDC == NULL) {
- Tcl_AppendResult(interp, "can't allocate printer DC for \"",
- queuePtr->name, "\": ", Blt_LastError(), (char *)NULL);
- goto done;
- }
- {
- double scale, sx, sy;
-
- /* Get the resolution of the printer device. */
- sx = (double)GetDeviceCaps(printDC, HORZRES)/(double)Tk_Width(tkwin);
- sy = (double)GetDeviceCaps(printDC, VERTRES)/(double)Tk_Height(tkwin);
- scale = MIN(sx, sy);
- pageWidth = scale * Tk_Width(tkwin);
- pageHeight = scale * Tk_Height(tkwin);
- }
- ZeroMemory(&di, sizeof(di));
- di.cbSize = sizeof(di);
- Tcl_DStringAppend(&dString, "Snapshot of \"", -1);
- Tcl_DStringAppend(&dString, Tk_PathName(tkwin), -1);
- Tcl_DStringAppend(&dString, "\"", -1);
- di.lpszDocName = Tcl_DStringValue(&dString);
- jobId = StartDoc(printDC, &di);
- if (jobId <= 0) {
- Tcl_AppendResult(interp, "can't start document: ", Blt_LastError(),
- (char *)NULL);
- goto done;
- }
- if (StartPage(printDC) <= 0) {
- Tcl_AppendResult(interp, "error starting page: ", Blt_LastError(),
- (char *)NULL);
- goto done;
- }
- StretchDIBits(printDC, 0, 0, ROUND(pageWidth), ROUND(pageHeight), 0, 0,
- Tk_Width(tkwin), Tk_Height(tkwin), ds.dsBm.bmBits,
- (LPBITMAPINFO)&ds.dsBmih, DIB_RGB_COLORS, SRCCOPY);
- EndPage(printDC);
- EndDoc(printDC);
- DeleteDC(printDC);
- Tcl_SetIntObj(Tcl_GetObjResult(interp), jobId);
- result = TCL_OK;
-
- done:
- Tcl_DStringFree(&dString);
- if (queuePtr->hPrinter != NULL) {
- CloseQueue(queuePtr);
- }
- DeleteBitmap(hBitmap);
- DeleteDC(memDC);
- TkWinReleaseDrawableDC(Tk_WindowId(tkwin), hDC, &state);
- if (hPalette != NULL) {
- DeletePalette(hPalette);
- }
- return result;
-}
-
-/*ARGSUSED*/
-static int
-WriteOp(
- ClientData clientData, /* Interpreter-specific data. */
- Tcl_Interp *interp,
- int objc, /* Not used. */
- Tcl_Obj *const *objv)
-{
- DWORD bytesLeft, nBytes;
- DOC_INFO_1 di1;
- DWORD jobId;
- char *title;
- char *data;
- static int nextJob = 0;
- char string[200];
- PrinterQueue *queuePtr;
- int result;
- int size;
-
- if (GetQueueFromObj(interp, objv[2], &queuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (OpenQueue(interp, queuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc == 5) {
- title = Tcl_GetString(objv[3]);
- data = Tcl_GetStringFromObj(objv[4], &size);
- } else {
- sprintf_s(string, 200, "Print Job #%d", nextJob++);
- title = string;
- data = Tcl_GetStringFromObj(objv[3], &size);
- }
- ZeroMemory(&di1, sizeof(DOC_INFO_1));
- di1.pDocName = title;
- if (queuePtr->fileName != NULL) {
- di1.pOutputFile = queuePtr->fileName;
- } else {
- di1.pOutputFile = NULL;
- }
- di1.pDatatype = (char *)"RAW";
-
- result = TCL_ERROR;
- /* Start new document */
- jobId = StartDocPrinter(queuePtr->hPrinter, 1, (unsigned char *)&di1);
- if (jobId == 0) {
- Tcl_AppendResult(interp, "error starting document on \"",
- queuePtr->printerName, "\": ", Blt_LastError(), (char *)NULL);
- goto error;
- }
- /* Start new page */
- if (!StartPagePrinter(queuePtr->hPrinter)) {
- Tcl_AppendResult(interp, "error starting page on \"",
- queuePtr->printerName, "\": ", Blt_LastError(), (char *)NULL);
- goto error;
- }
- bytesLeft = size;
- do {
- if (!WritePrinter(queuePtr->hPrinter, data, bytesLeft, &nBytes)) {
- Tcl_AppendResult(interp, "can't write data to \"",
- queuePtr->printerName, "\": ", Blt_LastError(), (char *)NULL);
- EndDocPrinter(queuePtr->hPrinter);
- goto error;
- }
- data += nBytes;
- bytesLeft -= nBytes;
- } while (bytesLeft > 0);
- /* End last page */
- if (!EndPagePrinter(queuePtr->hPrinter)) {
- Tcl_AppendResult(interp, "error ending page on \"",
- queuePtr->printerName, "\": ", Blt_LastError(), (char *)NULL);
- goto error;
- }
- /* End document */
- if (!EndDocPrinter(queuePtr->hPrinter)) {
- Tcl_AppendResult(interp, "error ending document on \"",
- queuePtr->printerName, "\": ", Blt_LastError(), (char *)NULL);
- goto error;
- }
- result = TCL_OK;
- error:
- CloseQueue(queuePtr);
- return result;
-}
-
-static Blt_OpSpec printerOps[] =
-{
- {"close", 1, CloseOp, 3, 3, "pid",},
- {"enum", 1, EnumOp, 3, 3, "attribute",},
- {"getattrs", 1, GetAttrOp, 4, 4, "pid varName",},
- {"names", 1, NamesOp, 2, 3, "?pattern?",},
- {"open", 1, OpenOp, 3, 3, "printerName",},
- {"setattrs", 1, SetAttrOp, 4, 4, "pid varName",},
- {"snap", 1, SnapOp, 4, 4, "pid window",},
- {"write", 1, WriteOp, 4, 5, "pid ?title? string",},
-};
-static int nPrinterOps = sizeof(printerOps) / sizeof(Blt_OpSpec);
-
-/* ARGSUSED */
-static int
-PrinterCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
- int result;
-
- proc = Blt_GetOpFromObj(interp, nPrinterOps, printerOps, BLT_OP_ARG1,
- objc, objv, 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- result = (*proc) (clientData, interp, objc, objv);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * PrinterInterpDeleteProc --
- *
- * This is called when the interpreter hosting one or more printer
- * commands is destroyed.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Closes and removes all open printers.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-PrinterInterpDeleteProc(clientData, interp)
- ClientData clientData; /* Interpreter-specific data. */
- Tcl_Interp *interp;
-{
- PrinterInterpData *dataPtr = clientData;
- Blt_HashEntry *hPtr;
- Blt_HashSearch cursor;
-
- for (hPtr = Blt_FirstHashEntry(&dataPtr->printerTable, &cursor);
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- PrinterQueue *queuePtr;
-
- queuePtr = Blt_GetHashValue(hPtr);
- queuePtr->hashPtr = NULL;
- DestroyQueue(queuePtr);
- }
- Blt_DeleteHashTable(&dataPtr->printerTable);
- Tcl_DeleteAssocData(interp, PRINTER_THREAD_KEY);
- Blt_Free(dataPtr);
-}
-
-
-int
-Blt_PrinterCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = { "printer", PrinterCmd };
-
- cmdSpec.clientData = GetPrinterInterpData(interp);
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-
-/* Public routines */
-int
-Blt_GetOpenPrinter(
- Tcl_Interp *interp,
- const char *name,
- Drawable *drawablePtr)
-{
- PrinterQueue *queuePtr;
-
- if (GetQueue(interp, name, &queuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- if (queuePtr->drawable.hDC == NULL) {
- char *driverName;
- HGLOBAL hMem;
- DEVMODE *dmPtr;
- HDC hDC;
-
- driverName = NULL;
- if (Blt_GetPlatformId() == VER_PLATFORM_WIN32_NT) {
- driverName = queuePtr->driverName;
- }
- if (OpenQueue(interp, queuePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- hMem = GetQueueProperties(queuePtr, &dmPtr);
- if (hMem == NULL) {
- CloseQueue(queuePtr);
- return TCL_ERROR;
- }
- if (queuePtr->dmPtr != NULL) {
- *dmPtr = *queuePtr->dmPtr;
- }
- hDC = CreateDC(driverName, queuePtr->deviceName, NULL, dmPtr);
- GlobalUnlock(hMem);
- GlobalFree(hMem);
- CloseQueue(queuePtr);
- if (hDC == NULL) {
- Tcl_AppendResult(interp, "can't allocate printer DC for \"",
- queuePtr->name, "\": ", Blt_LastError(), (char *)NULL);
- return TCL_ERROR;
- }
- queuePtr->drawable.hDC = hDC;
- queuePtr->drawable.type = TWD_WINDC;
- }
- *drawablePtr = (Drawable)(&queuePtr->drawable);
- return TCL_OK;
-}
-
-#include <commdlg.h>
-
-int
-Blt_PrintDialog(
- Tcl_Interp *interp,
- Drawable *drawablePtr)
-{
- PRINTDLG dlg;
- static PrintDrawable drawable;
- int mode, result;
-
- ZeroMemory(&dlg, sizeof(PRINTDLG));
- dlg.lStructSize = sizeof(PRINTDLG);
- dlg.Flags = PD_RETURNDC | PD_NOPAGENUMS | PD_NOSELECTION;
- mode = Tcl_SetServiceMode(TCL_SERVICE_NONE);
- result = PrintDlg(&dlg);
- Tcl_SetServiceMode(mode);
- if (!result) {
- if (!CommDlgExtendedError()) {
- return TCL_RETURN; /* Canceled by user. */
- }
- Tcl_AppendResult(interp, "can't access printer:", Blt_LastError(),
- (char *)NULL);
- return TCL_ERROR;
- }
- *drawablePtr = (Drawable)&drawable;
- drawable.type = TWD_WINDC;
- drawable.hDC = dlg.hDC;
- return TCL_OK;
-}
-
-int
-Blt_StartPrintJob(
- Tcl_Interp *interp,
- Drawable drawable)
-{
- DOCINFO di;
- PrintDrawable *drawPtr = (PrintDrawable *)drawable;
- int jobId;
-
- ZeroMemory((char *)&di, sizeof(DOCINFO));
- di.cbSize = sizeof(DOCINFO);
- di.lpszDocName = "Unknown";
- jobId = StartDoc(drawPtr->hDC, &di);
- if (jobId == 0) {
- Tcl_AppendResult(interp, "error starting document: ",
- Blt_LastError(), (char *)NULL);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-int
-Blt_EndPrintJob(
- Tcl_Interp *interp,
- Drawable drawable)
-{
- PrintDrawable *drawPtr = (PrintDrawable *)drawable;
-
- EndPage(drawPtr->hDC);
- EndDoc(drawPtr->hDC);
- return TCL_OK;
-}
-
-#endif /*NO_PRINTER*/
diff --git a/blt3.0.1/src/bltWinUtil.c b/blt3.0.1/src/bltWinUtil.c
deleted file mode 100644
index ca45a30..0000000
--- a/blt3.0.1/src/bltWinUtil.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * bltWinUtil.c --
- *
- * This module contains WIN32 routines not included in the Tcl/Tk
- * libraries.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <bltInt.h>
-
-#ifdef notdef
-double
-drand48(void)
-{
- return (double) rand() / (double)RAND_MAX;
-}
-
-void
-srand48(long int seed)
-{
- srand(seed);
-}
-#endif
-
-int
-Blt_GetPlatformId(void)
-{
- static int platformId = 0;
-
- if (platformId == 0) {
- OSVERSIONINFO opsysInfo;
-
- opsysInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if (GetVersionEx(&opsysInfo)) {
- platformId = opsysInfo.dwPlatformId;
- }
- }
- return platformId;
-}
-
-const char *
-Blt_PrintError(int error)
-{
- static char buffer[1024];
- int length;
-
- FormatMessage(
- FORMAT_MESSAGE_FROM_SYSTEM,
- NULL,
- error,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
- buffer,
- 1024,
- NULL);
- length = strlen(buffer);
- if (buffer[length - 2] == '\r') {
- buffer[length - 2] = '\0';
- }
- return buffer;
-}
-
-const char *
-Blt_LastError(void)
-{
- return Blt_PrintError(GetLastError());
-}
-
diff --git a/blt3.0.1/src/bltWinWindow.c b/blt3.0.1/src/bltWinWindow.c
deleted file mode 100644
index c9855e6..0000000
--- a/blt3.0.1/src/bltWinWindow.c
+++ /dev/null
@@ -1,441 +0,0 @@
-
-/*
- * bltWinWindow.c --
- *
- * This module implements additional window functionality for the BLT toolkit,
- * such as transparent Tk windows, and reparenting Tk windows.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#include <X11/Xlib.h>
-#include "tkDisplay.h"
-
-/*
- *---------------------------------------------------------------------------
- *
- * WindowToHandle --
- *
- *---------------------------------------------------------------------------
- */
-static HWND
-WindowToHandle(Tk_Window tkwin)
-{
- HWND hWnd;
- Window window;
-
- window = Tk_WindowId(tkwin);
- if (window == None) {
- Tk_MakeWindowExist(tkwin);
- }
- hWnd = Tk_GetHWND(Tk_WindowId(tkwin));
- if (Tk_IsTopLevel(tkwin)) {
- hWnd = GetParent(hWnd);
- }
- return hWnd;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DoConfigureNotify --
- *
- * Generate a ConfigureNotify event describing the current configuration
- * of a window.
- *
- * Results:
- * None.
- *
- * Side effects:
- * An event is generated and processed by Tk_HandleEvent.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DoConfigureNotify(Tk_FakeWin *winPtr) /* Window whose configuration
- * was just changed. */
-{
- XEvent event;
-
- event.type = ConfigureNotify;
- event.xconfigure.serial = LastKnownRequestProcessed(winPtr->display);
- event.xconfigure.send_event = False;
- event.xconfigure.display = winPtr->display;
- event.xconfigure.event = winPtr->window;
- event.xconfigure.window = winPtr->window;
- event.xconfigure.x = winPtr->changes.x;
- event.xconfigure.y = winPtr->changes.y;
- event.xconfigure.width = winPtr->changes.width;
- event.xconfigure.height = winPtr->changes.height;
- event.xconfigure.border_width = winPtr->changes.border_width;
- if (winPtr->changes.stack_mode == Above) {
- event.xconfigure.above = winPtr->changes.sibling;
- } else {
- event.xconfigure.above = None;
- }
- event.xconfigure.override_redirect = winPtr->atts.override_redirect;
- Tk_HandleEvent(&event);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MakeTransparentWindowExist --
- *
- * Similar to Tk_MakeWindowExist but instead creates a transparent window
- * to block for user events from sibling windows.
- *
- * Differences from Tk_MakeWindowExist.
- *
- * 1. This is always a "busy" window. There's never a platform-specific
- * class procedure to execute.
- *
- * 2. The window is transparent and never will have children, so
- * colormap information is irrelevant.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the procedure returns, the internal window associated with tkwin
- * is guaranteed to exist. This may require the window's ancestors to be
- * created too.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MakeTransparentWindowExist(
- Tk_Window tkwin, /* Token for window. */
- Window parent, /* Parent window. */
- int isBusy) /* */
-{
- TkWindow *winPtr = (TkWindow *) tkwin;
- TkWindow *winPtr2;
- Tcl_HashEntry *hPtr;
- int notUsed;
- TkDisplay *dispPtr;
- HWND hParent;
- int style;
- DWORD exStyle;
- HWND hWnd;
-
- if (winPtr->window != None) {
- return; /* Window already exists. */
- }
- /* Create a transparent window and put it on top. */
-
- hParent = (HWND) parent;
- style = (WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
- exStyle = (WS_EX_TRANSPARENT | WS_EX_TOPMOST);
-#define TK_WIN_CHILD_CLASS_NAME "TkChild"
- hWnd = CreateWindowEx(exStyle, TK_WIN_CHILD_CLASS_NAME, NULL, style,
- Tk_X(tkwin), Tk_Y(tkwin), Tk_Width(tkwin), Tk_Height(tkwin),
- hParent, NULL, (HINSTANCE)Tk_GetHINSTANCE(), NULL);
- winPtr->window = Tk_AttachHWND(tkwin, hWnd);
-
- dispPtr = winPtr->dispPtr;
- hPtr = Tcl_CreateHashEntry(&dispPtr->winTable, (char *)winPtr->window,
- ¬Used);
- Tcl_SetHashValue(hPtr, winPtr);
- winPtr->dirtyAtts = 0;
- winPtr->dirtyChanges = 0;
-#ifdef TK_USE_INPUT_METHODS
- winPtr->inputContext = NULL;
-#endif /* TK_USE_INPUT_METHODS */
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
- /*
- * If any siblings higher up in the stacking order have already been
- * created then move this window to its rightful position in the
- * stacking order.
- *
- * NOTE: this code ignores any changes anyone might have made to the
- * sibling and stack_mode field of the window's attributes, so it
- * really isn't safe for these to be manipulated except by calling
- * Tk_RestackWindow.
- */
- for (winPtr2 = winPtr->nextPtr; winPtr2 != NULL;
- winPtr2 = winPtr2->nextPtr) {
- if ((winPtr2->window != None) && !(winPtr2->flags & TK_TOP_LEVEL)) {
- XWindowChanges changes;
- changes.sibling = winPtr2->window;
- changes.stack_mode = Below;
- XConfigureWindow(winPtr->display, winPtr->window,
- CWSibling | CWStackMode, &changes);
- break;
- }
- }
- }
- /*
- * Issue a ConfigureNotify event if there were deferred configuration
- * changes (but skip it if the window is being deleted; the
- * ConfigureNotify event could cause problems if we're being called from
- * Tk_DestroyWindow under some conditions).
- */
- if ((winPtr->flags & TK_NEED_CONFIG_NOTIFY)
- && !(winPtr->flags & TK_ALREADY_DEAD)) {
- winPtr->flags &= ~TK_NEED_CONFIG_NOTIFY;
- DoConfigureNotify((Tk_FakeWin *)tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetWindowRegion --
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-int
-Blt_GetWindowRegion(
- Display *display, /* Not used. */
- Window window,
- int *xPtr, int *yPtr, int *widthPtr, int *heightPtr)
-{
- int result;
- RECT region;
- TkWinWindow *winPtr = (TkWinWindow *)window;
-
- result = GetWindowRect(winPtr->handle, ®ion);
- if (!result) {
- return TCL_ERROR;
- }
- if (xPtr != NULL) {
- *xPtr = region.left;
- }
- if (yPtr != NULL) {
- *yPtr = region.top;
- }
- if (widthPtr != NULL) {
- *widthPtr = region.right - region.left;
- }
- if (heightPtr != NULL) {
- *heightPtr = region.bottom - region.top;
- }
- return TCL_OK;
-}
-
-void
-Blt_GetRootCoords(
- Display *display,
- Window window,
- int *xPtr, int *yPtr,
- int *widthPtr, int *heightPtr)
-{
- int result;
- RECT region;
- TkWinWindow *winPtr = (TkWinWindow *)window;
-
- result = GetWindowRect(winPtr->handle, ®ion);
- if (!result) {
- return TCL_ERROR;
- }
- if (xPtr != NULL) {
- *xPtr = region.left;
- }
- if (yPtr != NULL) {
- *yPtr = region.top;
- }
- if (widthPtr != NULL) {
- *widthPtr = region.right - region.left;
- }
- if (heightPtr != NULL) {
- *heightPtr = region.bottom - region.top;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetWindowId --
- *
- * Returns the XID for the Tk_Window given. Starting in Tk 8.0, the
- * toplevel widgets are wrapped by another window. Currently there's no
- * way to get at that window, other than what is done here: query the X
- * window hierarchy and grab the parent.
- *
- * Results:
- * Returns the X Window ID of the widget. If it's a toplevel, then * the
- * XID of the wrapper is returned.
- *
- *---------------------------------------------------------------------------
- */
-Window
-Blt_GetWindowId(Tk_Window tkwin)
-{
- return (Window) WindowToHandle(tkwin);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_GetToplevelWindow --
- *
- * Retrieves the toplevel window which is the nearest ancestor of of the
- * specified window.
- *
- * Results:
- * Returns the toplevel window or NULL if the window has no ancestor
- * which is a toplevel.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-Tk_Window
-Blt_GetToplevelWindow(Tk_Window tkwin) /* Window for which the toplevel
- * should be deterined. */
-{
- while (!Tk_IsTopLevel(tkwin)) {
- tkwin = Tk_Parent(tkwin);
- if (tkwin == NULL) {
- return NULL;
- }
- }
- return tkwin;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RaiseTopLevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_RaiseToplevelWindow(Tk_Window tkwin)
-{
- SetWindowPos(WindowToHandle(tkwin), HWND_TOP, 0, 0, 0, 0,
- SWP_NOMOVE | SWP_NOSIZE);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MapToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MapToplevelWindow(Tk_Window tkwin)
-{
- ShowWindow(WindowToHandle(tkwin), SW_SHOWNORMAL);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_UnmapToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_UnmapToplevelWindow(Tk_Window tkwin)
-{
- ShowWindow(WindowToHandle(tkwin), SW_HIDE);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_MoveResizeToplevelWindow --
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_MoveResizeToplevelWindow(Tk_Window tkwin, int x, int y, int w, int h)
-{
- SetWindowPos(WindowToHandle(tkwin), HWND_TOP, x, y, w, h, 0);
-}
-
-int
-Blt_ReparentWindow(
- Display *display,
- Window window,
- Window newParent,
- int x, int y)
-{
- XReparentWindow(display, window, newParent, x, y);
- return TCL_OK;
-}
-
-int
-Blt_GetWindowFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Window *windowPtr)
-{
- char *string;
-
- string = Tcl_GetString(objPtr);
- if (string[0] == '.') {
- Tk_Window tkwin;
-
- tkwin = Tk_NameToWindow(interp, string, Tk_MainWindow(interp));
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_WindowId(tkwin) == None) {
- Tk_MakeWindowExist(tkwin);
- }
- *windowPtr = (Tk_IsTopLevel(tkwin)) ? Blt_GetWindowId(tkwin) :
- Tk_WindowId(tkwin);
- } else if (strcmp(string, "root") == 0) {
- *windowPtr = Tk_RootWindow(Tk_MainWindow(interp));
- } else {
- static TkWinWindow tkWinWindow;
- int id;
-
- if (Tcl_GetIntFromObj(interp, objPtr, &id) != TCL_OK) {
- return TCL_ERROR;
- }
- tkWinWindow.handle = (HWND)id;
- tkWinWindow.winPtr = NULL;
- tkWinWindow.type = TWD_WINDOW;
- *windowPtr = (Window)&tkWinWindow;
- }
- return TCL_OK;
-}
-
-
-Window
-Blt_GetParentWindow(Display *display, Window window)
-{
- HWND hWnd;
-
- hWnd = Tk_GetHWND(window);
- hWnd = GetParent(hWnd);
- return (Window)hWnd;
-}
diff --git a/blt3.0.1/src/bltWindow.c b/blt3.0.1/src/bltWindow.c
deleted file mode 100644
index de31c7f..0000000
--- a/blt3.0.1/src/bltWindow.c
+++ /dev/null
@@ -1,601 +0,0 @@
-
-/*
- * bltWindow.c --
- *
- * This module implements additional window functions for the BLT
- * toolkit.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#include <X11/Xlib.h>
-#ifdef notdef /* WIN32 */
-#include <X11/Xproto.h>
-#endif
-#include "tkDisplay.h"
-#include "bltHash.h"
-
-/*
- * Cache drawable information.
- *
- * There are specific times when we need information about the drawable
- * that is not available via the normal argument passing. For example,
- * XFT font rendering requires that the correct depth XftDraw be used.
- * If we create a painter from a drawable, we need to know its depth,
- * colormap, and visual also.
- *
- * We can usually get this information using XGetWindowAttributes at
- * the cost of a round-trip to the X server. Instead we'll cache it
- * in a hash table. We don't have to cache every window. We need to
- * watch destroy events and freeing pixmaps.
- */
-
-typedef struct {
- Display *display;
- Drawable drawable;
-} DrawableKey;
-
-static Blt_HashTable attribTable;
-static int initialized = FALSE;
-
-Blt_DrawableAttributes *
-Blt_GetDrawableAttribs(Display *display, Drawable drawable)
-{
- if (drawable != None) {
- Blt_HashEntry *hPtr;
- DrawableKey key;
-
- if (!initialized) {
- Blt_InitHashTable(&attribTable, sizeof(DrawableKey)/sizeof(int));
- initialized = TRUE;
- }
- memset(&key, 0, sizeof(key));
- key.drawable = drawable;
- key.display = display;
- hPtr = Blt_FindHashEntry(&attribTable, &key);
- if (hPtr != NULL) {
- return Blt_GetHashValue(hPtr);
- }
- }
- return NULL; /* Don't have any information about this
- * drawable. */
-}
-
-void
-Blt_SetDrawableAttribs(
- Display *display,
- Drawable drawable,
- int depth,
- int width, int height,
- Colormap colormap,
- Visual *visual)
-{
- if (drawable != None) {
- Blt_DrawableAttributes *attrPtr;
- Blt_HashEntry *hPtr;
- int isNew;
- DrawableKey key;
-
- if (!initialized) {
- Blt_InitHashTable(&attribTable, sizeof(DrawableKey)/sizeof(int));
- initialized = TRUE;
- }
- memset(&key, 0, sizeof(key));
- key.drawable = drawable;
- key.display = display;
- hPtr = Blt_CreateHashEntry(&attribTable, &key, &isNew);
- if (isNew) {
- attrPtr = Blt_AssertMalloc(sizeof(Blt_DrawableAttributes));
- Blt_SetHashValue(hPtr, attrPtr);
- } else {
- attrPtr = Blt_GetHashValue(hPtr);
- }
- /* Set or reset information for drawable. */
- attrPtr->id = drawable;
- attrPtr->depth = depth;
- attrPtr->colormap = colormap;
- attrPtr->visual = visual;
- attrPtr->width = width;
- attrPtr->height = height;
- }
-}
-
-void
-Blt_SetDrawableAttribsFromWindow(Tk_Window tkwin, Drawable drawable)
-{
- if (drawable != None) {
- Blt_SetDrawableAttribs(Tk_Display(tkwin), drawable, Tk_Width(tkwin),
- Tk_Height(tkwin), Tk_Depth(tkwin), Tk_Colormap(tkwin),
- Tk_Visual(tkwin));
- }
-}
-
-void
-Blt_FreeDrawableAttribs(Display *display, Drawable drawable)
-{
- Blt_HashEntry *hPtr;
- DrawableKey key;
-
- if (drawable != None) {
- if (!initialized) {
- Blt_InitHashTable(&attribTable, sizeof(DrawableKey)/sizeof(int));
- initialized = TRUE;
- }
- memset(&key, 0, sizeof(key));
- key.drawable = drawable;
- key.display = display;
- hPtr = Blt_FindHashEntry(&attribTable, &key);
- if (hPtr != NULL) {
- Blt_DrawableAttributes *attrPtr;
-
- attrPtr = Blt_GetHashValue(hPtr);
- Blt_DeleteHashEntry(&attribTable, hPtr);
- Blt_Free(attrPtr);
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FindChild --
- *
- * Performs a linear search for the named child window in a given
- * parent window.
- *
- * This can be done via Tcl, but not through Tk's C API. It's
- * simple enough, if you peek into the Tk_Window structure.
- *
- * Results:
- * The child Tk_Window. If the named child can't be found, NULL
- * is returned.
- *
- *---------------------------------------------------------------------------
- */
-
-/*LINTLIBRARY*/
-Tk_Window
-Blt_FindChild(Tk_Window parent, char *name)
-{
- TkWindow *winPtr;
- TkWindow *parentPtr = (TkWindow *)parent;
-
- for (winPtr = parentPtr->childList; winPtr != NULL;
- winPtr = winPtr->nextPtr) {
- if (strcmp(name, winPtr->nameUid) == 0) {
- return (Tk_Window)winPtr;
- }
- }
- return NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FirstChildWindow --
- *
- * Performs a linear search for the named child window in a given
- * parent window.
- *
- * This can be done via Tcl, but not through Tk's C API. It's
- * simple enough, if you peek into the Tk_Window structure.
- *
- * Results:
- * The child Tk_Window. If the named child can't be found, NULL
- * is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*LINTLIBRARY*/
-Tk_Window
-Blt_FirstChild(Tk_Window parent)
-{
- TkWindow *parentPtr = (TkWindow *)parent;
- return (Tk_Window)parentPtr->childList;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_FindChild --
- *
- * Performs a linear search for the named child window in a given
- * parent window.
- *
- * This can be done via Tcl, but not through Tk's C API. It's
- * simple enough, if you peek into the Tk_Window structure.
- *
- * Results:
- * The child Tk_Window. If the named child can't be found, NULL
- * is returned.
- *
- *---------------------------------------------------------------------------
- */
-
-/*LINTLIBRARY*/
-Tk_Window
-Blt_NextChild(Tk_Window tkwin)
-{
- TkWindow *winPtr = (TkWindow *)tkwin;
-
- if (winPtr == NULL) {
- return NULL;
- }
- return (Tk_Window)winPtr->nextPtr;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * UnlinkWindow --
- *
- * This procedure removes a window from the childList of its
- * parent.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The window is unlinked from its childList.
- *
- *---------------------------------------------------------------------------
- */
-static void
-UnlinkWindow(TkWindow *winPtr)
-{
- TkWindow *prevPtr;
-
- prevPtr = winPtr->parentPtr->childList;
- if (prevPtr == winPtr) {
- winPtr->parentPtr->childList = winPtr->nextPtr;
- if (winPtr->nextPtr == NULL) {
- winPtr->parentPtr->lastChildPtr = NULL;
- }
- } else {
- while (prevPtr->nextPtr != winPtr) {
- prevPtr = prevPtr->nextPtr;
- if (prevPtr == NULL) {
- panic("UnlinkWindow couldn't find child in parent");
- }
- }
- prevPtr->nextPtr = winPtr->nextPtr;
- if (winPtr->nextPtr == NULL) {
- winPtr->parentPtr->lastChildPtr = prevPtr;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RelinkWindow --
- *
- * Relinks a window into a new parent. The window is unlinked
- * from its original parent's child list and added onto the end
- * of the new parent's list.
- *
- * FIXME: If the window has focus, the focus should be moved
- * to an ancestor. Otherwise, Tk becomes confused
- * about which Toplevel turns on focus for the window.
- * Right now this is done at the TCL layer. For example,
- * see blt::CreateTearoff in tabset.tcl.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The window is unlinked from its childList.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_RelinkWindow(
- Tk_Window tkwin, /* Child window to be linked. */
- Tk_Window newParent,
- int x, int y)
-{
- TkWindow *winPtr, *parentWinPtr;
-
- if (Blt_ReparentWindow(Tk_Display(tkwin), Tk_WindowId(tkwin),
- Tk_WindowId(newParent), x, y) != TCL_OK) {
- return;
- }
- winPtr = (TkWindow *)tkwin;
- parentWinPtr = (TkWindow *)newParent;
-
- winPtr->flags &= ~TK_REPARENTED;
- UnlinkWindow(winPtr); /* Remove the window from its parent's list */
-
- /* Append the window onto the end of the parent's list of children */
- winPtr->parentPtr = parentWinPtr;
- winPtr->nextPtr = NULL;
- if (parentWinPtr->childList == NULL) {
- parentWinPtr->childList = winPtr;
- } else {
- parentWinPtr->lastChildPtr->nextPtr = winPtr;
- }
- parentWinPtr->lastChildPtr = winPtr;
-}
-
-#ifdef notdef
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_RelinkWindow --
- *
- * Relinks a window into a new parent. The window is unlinked
- * from its original parent's child list and added onto the end
- * of the new parent's list.
- *
- * FIXME: If the window has focus, the focus should be moved
- * to an ancestor. Otherwise, Tk becomes confused
- * about which Toplevel turns on focus for the window.
- * Right now this is done at the TCL layer. For example,
- * see blt::CreateTearoff in tabset.tcl.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The window is unlinked from its childList.
- *
- *---------------------------------------------------------------------------
- */
-void
-Blt_RelinkWindow2(
- Tk_Window tkwin, /* Child window to be linked. */
- Window window,
- Tk_Window newParent,
- int x, int y)
-{
-#ifdef notdef
- TkWindow *winPtr, *parentWinPtr;
-#endif
- if (Blt_ReparentWindow(Tk_Display(tkwin), window,
- Tk_WindowId(newParent), x, y) != TCL_OK) {
- return;
- }
-#ifdef notdef
- winPtr = (TkWindow *)tkwin;
- parentWinPtr = (TkWindow *)newParent;
-
- winPtr->flags &= ~TK_REPARENTED;
- UnlinkWindow(winPtr); /* Remove the window from its parent's list */
-
- /* Append the window onto the end of the parent's list of children */
- winPtr->parentPtr = parentWinPtr;
- winPtr->nextPtr = NULL;
- if (parentWinPtr->childList == NULL) {
- parentWinPtr->childList = winPtr;
- } else {
- parentWinPtr->lastChildPtr->nextPtr = winPtr;
- }
- parentWinPtr->lastChildPtr = winPtr;
-#endif
-}
-
-void
-Blt_UnlinkWindow(Tk_Window tkwin) /* Child window to be linked. */
-{
- TkWindow *winPtr;
- Window root;
-
- root = Tk_RootWindow(tkwin);
- if (Blt_ReparentWindow(Tk_Display(tkwin), Tk_WindowId(tkwin), root, 0, 0)
- != TCL_OK) {
- return;
- }
- winPtr = (TkWindow *)tkwin;
- winPtr->flags &= ~TK_REPARENTED;
-#ifdef notdef
- UnlinkWindow(winPtr); /* Remove the window from its parent's list */
-#endif
-}
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_Toplevel --
- *
- * Climbs up the widget hierarchy to find the top level window of
- * the window given.
- *
- * Results:
- * Returns the Tk_Window of the toplevel widget.
- *
- *---------------------------------------------------------------------------
- */
-Tk_Window
-Blt_Toplevel(Tk_Window tkwin)
-{
- while (!Tk_IsTopLevel(tkwin)) {
- tkwin = Tk_Parent(tkwin);
- }
- return tkwin;
-}
-
-void
-Blt_RootCoordinates(
- Tk_Window tkwin,
- int x, int y,
- int *rootXPtr, int *rootYPtr)
-{
- int vx, vy, vw, vh;
- int rootX, rootY;
-
- Tk_GetRootCoords(tkwin, &rootX, &rootY);
- x += rootX;
- y += rootY;
- Tk_GetVRootGeometry(tkwin, &vx, &vy, &vw, &vh);
- x += vx;
- y += vy;
- *rootXPtr = x;
- *rootYPtr = y;
-}
-
-
-/* Find the toplevel then */
-int
-Blt_RootX(Tk_Window tkwin)
-{
- int x;
-
- for (x = 0; tkwin != NULL; tkwin = Tk_Parent(tkwin)) {
- x += Tk_X(tkwin) + Tk_Changes(tkwin)->border_width;
- if (Tk_IsTopLevel(tkwin)) {
- break;
- }
- }
- return x;
-}
-
-int
-Blt_RootY(Tk_Window tkwin)
-{
- int y;
-
- for (y = 0; tkwin != NULL; tkwin = Tk_Parent(tkwin)) {
- y += Tk_Y(tkwin) + Tk_Changes(tkwin)->border_width;
- if (Tk_IsTopLevel(tkwin)) {
- break;
- }
- }
- return y;
-}
-
-void
-Blt_SetWindowInstanceData(Tk_Window tkwin, ClientData instanceData)
-{
- TkWindow *winPtr = (TkWindow *)tkwin;
-
- winPtr->instanceData = instanceData;
-}
-
-ClientData
-Blt_GetWindowInstanceData(Tk_Window tkwin)
-{
- TkWindow *winPtr;
-
- while (tkwin != NULL) {
- winPtr = (TkWindow *)tkwin;
- if (winPtr->instanceData != NULL) {
- return (ClientData)winPtr->instanceData;
- }
- tkwin = Tk_Parent(tkwin);
- }
- return NULL;
-}
-
-void
-Blt_DeleteWindowInstanceData(Tk_Window tkwin)
-{
- /* empty */
-}
-
-
-#if HAVE_RANDR
-#include <X11/Xlib.h>
-#include <X11/Xlibint.h>
-#include <X11/Xproto.h>
-#include <X11/extensions/randr.h>
-#include <X11/extensions/Xrandr.h>
-#include <X11/extensions/Xrender.h> /* we share subpixel information */
-
-typedef struct {
- int major, minor; /* XRandR version numbers. */
- int eventNum, errorNum; /* Event offset of XRandr */
- Display *display;
- Tk_Window mainWindow; /* Main window of interpreter. */
- Window root; /* Root window of screen. */
-} XRandr;
-
-/*
- *---------------------------------------------------------------------------
- *
- * XRandrEventProc --
- *
- * Invoked by Tk_HandleEvent whenever a ConfigureNotify or
- * RRScreenChangeNotify event is received on the root window.
- *
- *---------------------------------------------------------------------------
- */
-static int
-XRandrEventProc(ClientData clientData, XEvent *eventPtr)
-{
- XRandr *rrPtr = clientData;
-
- if (eventPtr->xany.window == rrPtr->root) {
- if ((eventPtr->type + (rrPtr->eventNum + RRScreenChangeNotify)) ||
- (eventPtr->type == ConfigureNotify)) {
- if (!XRRUpdateConfiguration(eventPtr)) {
- fprintf(stderr, "can't update screen configuration\n");
- }
- }
- }
- return 0;
-}
-
-void
-Blt_InitXRandrConfig(Tcl_Interp *interp)
-{
- Tk_Window tkwin;
- static XRandr rr;
-
- tkwin = Tk_MainWindow(interp);
- rr.mainWindow = tkwin;
- rr.root = Tk_RootWindow(tkwin);
- rr.display = Tk_Display(tkwin);
- if (!XRRQueryExtension(rr.display, &rr.eventNum, &rr.errorNum)) {
- fprintf(stderr, "Xserver does not support the RANDR extension.\n");
- return;
- }
- if (!XRRQueryVersion(rr.display, &rr.major, &rr.minor)) {
- fprintf(stderr, "Xserver didn't report RANDR version numbers?\n");
- }
- Tk_CreateGenericHandler(XRandrEventProc, &rr);
- XRRSelectInput(rr.display, rr.root, RRScreenChangeNotifyMask);
-#ifdef notdef
- XSelectInput(rr.display, rr.root, StructureNotifyMask);
-#endif
-}
-
-#else
-void
-Blt_InitXRandrConfig(Tcl_Interp *interp)
-{
-}
-#endif /* HAVE_XRANDR */
-
-/* ARGSUSED */
-void
-Blt_SizeOfScreen(Tk_Window tkwin, int *widthPtr, int *heightPtr)
-{
- *widthPtr = WidthOfScreen(Tk_Screen(tkwin));
- *heightPtr = HeightOfScreen(Tk_Screen(tkwin));
-}
-
diff --git a/blt3.0.1/src/bltWinop.c b/blt3.0.1/src/bltWinop.c
deleted file mode 100644
index bc833be..0000000
--- a/blt3.0.1/src/bltWinop.c
+++ /dev/null
@@ -1,410 +0,0 @@
-
-/*
- * bltWinop.c --
- *
- * This module implements simple window commands for the BLT toolkit.
- *
- * Copyright 1991-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "bltInt.h"
-
-#ifndef NO_WINOP
-#include "bltOp.h"
-#include "bltPicture.h"
-#include "bltImage.h"
-#include <X11/Xutil.h>
-#include "tkDisplay.h"
-
-#define CLAMP(c) ((((c) < 0.0) ? 0.0 : ((c) > 255.0) ? 255.0 : (c)))
-static Tcl_ObjCmdProc WinopCmd;
-
-static int
-GetRealizedWindowFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- Tk_Window *tkwinPtr)
-{
- const char *string;
- Tk_Window tkwin;
-
- string = Tcl_GetString(objPtr);
- assert(interp != NULL);
- tkwin = Tk_NameToWindow(interp, string, Tk_MainWindow(interp));
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (Tk_WindowId(tkwin) == None) {
- Tk_MakeWindowExist(tkwin);
- }
- *tkwinPtr = tkwin;
- return TCL_OK;
-}
-
-static int
-GetWindowFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Window *windowPtr)
-{
- const char *string;
-
- string = Tcl_GetString(objPtr);
- if (string[0] == '.') {
- Tk_Window tkwin;
-
- if (GetRealizedWindowFromObj(interp, objPtr, &tkwin) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tk_IsTopLevel(tkwin)) {
- *windowPtr = Blt_GetWindowId(tkwin);
- } else {
- *windowPtr = Tk_WindowId(tkwin);
- }
- } else if (strcmp(string, "root") == 0) {
- *windowPtr = Tk_RootWindow(Tk_MainWindow(interp));
- } else {
- int xid;
-
- if (Tcl_GetIntFromObj(interp, objPtr, &xid) != TCL_OK) {
- return TCL_ERROR;
- }
-#ifdef WIN32
- {
- static TkWinWindow tkWinWindow;
-
- tkWinWindow.handle = (HWND)xid;
- tkWinWindow.winPtr = NULL;
- tkWinWindow.type = TWD_WINDOW;
- *windowPtr = (Window)&tkWinWindow;
- }
-#else
- *windowPtr = (Window)xid;
-#endif
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-LowerOp(Tk_Window tkMain, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 2; i < objc; i++) {
- Window window;
-
- if (GetWindowFromObj(interp, objv[i], &window) != TCL_OK) {
- return TCL_ERROR;
- }
- XLowerWindow(Tk_Display(tkMain), window);
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-RaiseOp(Tk_Window tkMain, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 2; i < objc; i++) {
- Window window;
-
- if (GetWindowFromObj(interp, objv[i], &window) != TCL_OK) {
- return TCL_ERROR;
- }
- XRaiseWindow(Tk_Display(tkMain), window);
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-MapOp(Tk_Window tkMain, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 2; i < objc; i++) {
- const char *string;
- Window window;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] == '.') {
- Tk_Window tkwin;
- Tk_FakeWin *fakePtr;
-
- if (GetRealizedWindowFromObj(interp, objv[i], &tkwin) != TCL_OK) {
- return TCL_ERROR;
- }
-#ifdef WIN32
- Tk_MapWindow(tkwin);
-#endif
- fakePtr = (Tk_FakeWin *) tkwin;
- fakePtr->flags |= TK_MAPPED;
- window = Tk_WindowId(tkwin);
- } else {
- int xid;
-
- if (Tcl_GetIntFromObj(interp, objv[i], &xid) != TCL_OK) {
- return TCL_ERROR;
- }
- window = (Window)xid;
- }
- XMapWindow(Tk_Display(tkMain), window);
- }
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-MoveOp(Tk_Window tkMain, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int x, y;
- Window window;
-
- if (GetWindowFromObj(interp, objv[2], &window) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tk_GetPixelsFromObj(interp, tkMain, objv[3], &x) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tk_GetPixelsFromObj(interp, tkMain, objv[4], &y) != TCL_OK) {
- return TCL_ERROR;
- }
- XMoveWindow(Tk_Display(tkMain), window, x, y);
- return TCL_OK;
-}
-
-/*ARGSUSED*/
-static int
-UnmapOp(Tk_Window tkMain, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int i;
-
- for (i = 2; i < objc; i++) {
- const char *string;
- Window window;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] == '.') {
- Tk_Window tkwin;
- Tk_FakeWin *fakePtr;
-
- if (GetRealizedWindowFromObj(interp, objv[i], &tkwin) != TCL_OK) {
- return TCL_ERROR;
- }
- fakePtr = (Tk_FakeWin *) tkwin;
- fakePtr->flags &= ~TK_MAPPED;
- window = Tk_WindowId(tkwin);
- } else {
- int xid;
-
- if (Tcl_GetIntFromObj(interp, objv[i], &xid) != TCL_OK) {
- return TCL_ERROR;
- }
- window = (Window)xid;
- }
- XMapWindow(Tk_Display(tkMain), window);
- }
- return TCL_OK;
-}
-
-/* ARGSUSED */
-static int
-ChangesOp(Tk_Window tkMain, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Tk_Window tkwin;
-
- if (GetRealizedWindowFromObj(interp, objv[2], &tkwin) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tk_IsTopLevel(tkwin)) {
- XSetWindowAttributes attrs;
- Window window;
- unsigned int mask;
-
- window = Blt_GetWindowId(tkwin);
- attrs.backing_store = WhenMapped;
- attrs.save_under = True;
- mask = CWBackingStore | CWSaveUnder;
- XChangeWindowAttributes(Tk_Display(tkwin), window, mask, &attrs);
- }
- return TCL_OK;
-}
-
-/* ARGSUSED */
-static int
-GeometryOp(Tk_Window tkMain, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Window d;
- int x, y, w, h;
- Tcl_Obj *listObjPtr;
-
- if (GetWindowFromObj(interp, objv[2], &d) != TCL_OK) {
- return TCL_ERROR;
- }
- Blt_GetWindowRegion(Tk_Display(tkMain), d, &x, &y, &w, &h);
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(x));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(y));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(w));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(h));
- Tcl_SetObjResult(interp, listObjPtr);
- return TCL_OK;
-}
-
-/* ARGSUSED */
-static int
-QueryOp(Tk_Window tkMain, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- int rootX, rootY, childX, childY;
- Window root, child;
- unsigned int mask;
-
- /* GetCursorPos */
- if (XQueryPointer(Tk_Display(tkMain), Tk_WindowId(tkMain), &root,
- &child, &rootX, &rootY, &childX, &childY, &mask)) {
- Tcl_Obj *listObjPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(rootX));
- Tcl_ListObjAppendElement(interp, listObjPtr, Tcl_NewIntObj(rootY));
- Tcl_SetObjResult(interp, listObjPtr);
- }
- return TCL_OK;
-}
-
-/* ARGSUSED */
-static int
-TreeOp(Tk_Window tkMain, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- Window *ancestors, window, root, parent;
- unsigned int nAncestors;
-
- if (GetWindowFromObj(interp, objv[2], &window) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((XQueryTree(Tk_Display(tkMain), window, &root, &parent, &ancestors,
- &nAncestors)) && (nAncestors > 0)) {
- unsigned int i;
- Tcl_Obj *listObjPtr;
- char string[200];
- Tcl_Obj *objPtr;
-
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
- sprintf(string, "0x%x", (unsigned int)root);
- objPtr = Tcl_NewStringObj(string , -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- sprintf(string, "0x%x", (unsigned int)parent);
- objPtr = Tcl_NewStringObj(string , -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- sprintf(string, "0x%x", (unsigned int)window);
- objPtr = Tcl_NewStringObj(string , -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- for (i = 0; i < nAncestors; i++) {
- sprintf(string, "0x%x", (unsigned int)ancestors[i]);
- objPtr = Tcl_NewStringObj(string , -1);
- Tcl_ListObjAppendElement(interp, listObjPtr, objPtr);
- }
- Tcl_SetObjResult(interp, listObjPtr);
- if (ancestors != NULL) {
- XFree((char *)ancestors);
- }
- }
- return TCL_OK;
-}
-
-
-/*ARGSUSED*/
-static int
-WarpToOp(Tk_Window tkMain, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
-{
- if (objc == 3) {
- Tk_Window tkwin;
-
- if (GetRealizedWindowFromObj(interp, objv[2], &tkwin) != TCL_OK) {
- return TCL_ERROR;
- }
- if (!Tk_IsMapped(tkwin)) {
- Tcl_AppendResult(interp, "can't warp to unmapped window \"",
- Tk_PathName(tkwin), "\"", (char *)NULL);
- return TCL_ERROR;
- }
- XWarpPointer(Tk_Display(tkwin), None, Tk_WindowId(tkwin),
- 0, 0, 0, 0, Tk_Width(tkwin) / 2, Tk_Height(tkwin) / 2);
- } else if (objc == 4) {
- int x, y;
- Window root;
-
- if ((Tk_GetPixelsFromObj(interp, tkMain, objv[2], &x) != TCL_OK) ||
- (Tk_GetPixelsFromObj(interp, tkMain, objv[3], &y) != TCL_OK)) {
- return TCL_ERROR;
- }
- root = Tk_RootWindow(tkMain);
- XWarpPointer(Tk_Display(tkMain), None, root, 0, 0, 0, 0, x, y);
- }
- return QueryOp(tkMain, interp, 0, (Tcl_Obj **)NULL);
-}
-
-static Blt_OpSpec winOps[] =
-{
- {"changes", 1, ChangesOp, 3, 3, "window",},
- {"geometry",1, GeometryOp, 3, 3, "window",},
- {"lower", 1, LowerOp, 2, 0, "window ?window?...",},
- {"map", 2, MapOp, 2, 0, "window ?window?...",},
- {"move", 2, MoveOp, 5, 5, "window x y",},
- {"query", 1, QueryOp, 2, 2, "",},
- {"raise", 1, RaiseOp, 2, 0, "window ?window?...",},
- {"tree", 1, TreeOp, 3, 3, "window",},
- {"unmap", 1, UnmapOp, 2, 0, "window ?window?...",},
- {"warpto", 1, WarpToOp, 2, 5, "?window?",},
-};
-
-static int nWinOps = sizeof(winOps) / sizeof(Blt_OpSpec);
-
-/* ARGSUSED */
-static int
-WinopCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- Tcl_ObjCmdProc *proc;
- int result;
- Tk_Window tkwin;
-
- proc = Blt_GetOpFromObj(interp, nWinOps, winOps, BLT_OP_ARG1, objc, objv,
- 0);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- tkwin = Tk_MainWindow(interp);
- result = (*proc) (tkwin, interp, objc, objv);
- return result;
-}
-
-int
-Blt_WinopCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpec = {"winop", WinopCmd,};
-
- return Blt_InitCmd(interp, "::blt", &cmdSpec);
-}
-
-#endif /* NO_WINOP */
diff --git a/blt3.0.1/src/config.h.in b/blt3.0.1/src/config.h.in
deleted file mode 100644
index 1150d9e..0000000
--- a/blt3.0.1/src/config.h.in
+++ /dev/null
@@ -1,335 +0,0 @@
-/* src/config.h.in. Generated from configure.in by autoheader. */
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Define the smallest machine value DBL_EPILSON. */
-#undef BLT_DBL_EPSILON
-
-/* Define 'suffix' as the suffix for library names. */
-#undef BLT_LIB_SUFFIX
-
-/* Define 'soext' as the extension for shared libraries. */
-#undef BLT_SO_EXT
-
-/* Define 'prefix' as the prefix for shared library names. */
-#undef BLT_SO_PREFIX
-
-/* Define to 1 if you have the <ctype.h> header file. */
-#undef HAVE_CTYPE_H
-
-/* Define to 1 if you have the declaration of `drand48', and to 0 if you
- don't. */
-#undef HAVE_DECL_DRAND48
-
-/* Define to 1 if you have the declaration of `finite', and to 0 if you don't.
- */
-#undef HAVE_DECL_FINITE
-
-/* Define to 1 if you have the declaration of `free', and to 0 if you don't.
- */
-#undef HAVE_DECL_FREE
-
-/* Define to 1 if you have the declaration of `hypot', and to 0 if you don't.
- */
-#undef HAVE_DECL_HYPOT
-
-/* Define to 1 if you have the declaration of `isfinite', and to 0 if you
- don't. */
-#undef HAVE_DECL_ISFINITE
-
-/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
- */
-#undef HAVE_DECL_ISNAN
-
-/* Define to 1 if you have the declaration of `j1', and to 0 if you don't. */
-#undef HAVE_DECL_J1
-
-/* Define to 1 if you have the declaration of `srand48', and to 0 if you
- don't. */
-#undef HAVE_DECL_SRAND48
-
-/* Define to 1 if you have the declaration of `strcasecmp', and to 0 if you
- don't. */
-#undef HAVE_DECL_STRCASECMP
-
-/* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you
- don't. */
-#undef HAVE_DECL_STRNCASECMP
-
-/* Define to 1 if you have the declaration of `strtolower', and to 0 if you
- don't. */
-#undef HAVE_DECL_STRTOLOWER
-
-/* Define to 1 if you have the `drand48' function. */
-#undef HAVE_DRAND48
-
-/* Define to 1 if you have the <errno.h> header file. */
-#undef HAVE_ERRNO_H
-
-/* Define to 1 if you have the <expat.h> header file. */
-#undef HAVE_EXPAT_H
-
-/* Define to 1 if you have the `finite' function. */
-#undef HAVE_FINITE
-
-/* Define to 1 if you have the <float.h> header file. */
-#undef HAVE_FLOAT_H
-
-/* Define to 1 if you have the <ft2build.h> header file. */
-#undef HAVE_FT2BUILD_H
-
-/* Define to 1 if you have the `getpt' function. */
-#undef HAVE_GETPT
-
-/* Define to 1 if you have the `grantpt' function. */
-#undef HAVE_GRANTPT
-
-/* Define to 1 if you have the <ieeefp.h> header file. */
-#undef HAVE_IEEEFP_H
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `isastream' function. */
-#undef HAVE_ISASTREAM
-
-/* Define if we have a working 'isinfinite'. */
-#undef HAVE_ISFINITE
-
-/* Define to 1 if you have the `isnan' function. */
-#undef HAVE_ISNAN
-
-/* Define to 1 if you have the <jpeglib.h> header file. */
-#undef HAVE_JPEGLIB_H
-
-/* Define to 1 if you have the `EXPAT' library (-lexpat). */
-#undef HAVE_LIBEXPAT
-
-/* Define to 1 if you have the `FT2' library (-lfreetype). */
-#undef HAVE_LIBFT2
-
-/* Define to 1 if you have the `FTCFG' library (-lfontconfig). */
-#undef HAVE_LIBFTCFG
-
-/* Define to 1 if you have the `JPG' library (-ljpeg). */
-#undef HAVE_LIBJPG
-
-/* Define to 1 if you have the `m' library (-lm). */
-#undef HAVE_LIBM
-
-/* Define to 1 if you have the `MYSQL' library (-lmysqlclient). */
-#undef HAVE_LIBMYSQL
-
-/* Define to 1 if you have the `nsl' library (-lnsl). */
-#undef HAVE_LIBNSL
-
-/* Define to 1 if you have the `PNG' library (-lpng). */
-#undef HAVE_LIBPNG
-
-/* Define to 1 if you have the `socket' library (-lsocket). */
-#undef HAVE_LIBSOCKET
-
-/* Define to 1 if you have the `TIF' library (-ltiff). */
-#undef HAVE_LIBTIF
-
-/* Define to 1 if you have the `XAU' library (-lXau). */
-#undef HAVE_LIBXAU
-
-/* Define to 1 if you have the `XDMCP' library (-lXdmcp). */
-#undef HAVE_LIBXDMCP
-
-/* Define to 1 if you have the `XFT' library (-lXft -lexpat). */
-#undef HAVE_LIBXFT
-
-/* Define to 1 if you have the `XPM' library (-lXpm). */
-#undef HAVE_LIBXPM
-
-/* Define to 1 if you have the `XRANDR' library (-lXrandr). */
-#undef HAVE_LIBXRANDR
-
-/* Define to 1 if you have the `XRENDER' library (-lXrender). */
-#undef HAVE_LIBXRENDER
-
-/* Define to 1 if you have the `Z' library (-lz). */
-#undef HAVE_LIBZ
-
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define to 1 if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define to 1 if you have the <math.h> header file. */
-#undef HAVE_MATH_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the <mysql/mysql.h> header file. */
-#undef HAVE_MYSQL_MYSQL_H
-
-/* Define to 1 if you have the `openpty' function. */
-#undef HAVE_OPENPTY
-
-/* Define to 1 if you have the `open_controlling_pty' function. */
-#undef HAVE_OPEN_CONTROLLING_PTY
-
-/* Define to 1 if you have the <png.h> header file. */
-#undef HAVE_PNG_H
-
-/* Define to 1 if you have the `posix_openpt' function. */
-#undef HAVE_POSIX_OPENPT
-
-/* Define to 1 if you have the `ptsname' function. */
-#undef HAVE_PTSNAME
-
-/* Define to 1 if you have the <setjmp.h> header file. */
-#undef HAVE_SETJMP_H
-
-/* Define to 1 if you have the `setsid' function. */
-#undef HAVE_SETSID
-
-/* Define to 1 if you have the `srand48' function. */
-#undef HAVE_SRAND48
-
-/* Define to 1 if you have the <stddef.h> header file. */
-#undef HAVE_STDDEF_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `strcasecmp' function. */
-#undef HAVE_STRCASECMP
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strncasecmp' function. */
-#undef HAVE_STRNCASECMP
-
-/* Define to 1 if you have the <stropts.h> header file. */
-#undef HAVE_STROPTS_H
-
-/* Define to 1 if you have the `strtolower' function. */
-#undef HAVE_STRTOLOWER
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to 1 if you have the `tcflush' function. */
-#undef HAVE_TCFLUSH
-
-/* Define to 1 if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define to 1 if you have the <tiff.h> header file. */
-#undef HAVE_TIFF_H
-
-/* Define if 'wait' is a union. */
-#undef HAVE_UNION_WAIT
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the `unlockpt' function. */
-#undef HAVE_UNLOCKPT
-
-/* Define to 1 if you have the <waitflags.h> header file. */
-#undef HAVE_WAITFLAGS_H
-
-/* Define to 1 if you have the <X11/extensions/randr.h> header file. */
-#undef HAVE_X11_EXTENSIONS_RANDR_H
-
-/* Define to 1 if you have the <X11/Xft/Xft.h> header file. */
-#undef HAVE_X11_XFT_XFT_H
-
-/* Define to 1 if you have the <X11/xpm.h> header file. */
-#undef HAVE_X11_XPM_H
-
-/* Define if we're compiling for an X86. */
-#undef HAVE_X86
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* The size of `float', as computed by sizeof. */
-#undef SIZEOF_FLOAT
-
-/* The size of `int', as computed by sizeof. */
-#undef SIZEOF_INT
-
-/* The size of `long', as computed by sizeof. */
-#undef SIZEOF_LONG
-
-/* The size of `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* The size of `void *', as computed by sizeof. */
-#undef SIZEOF_VOID_P
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define if Tcl stubs are used. */
-#undef USE_TCL_STUBS
-
-/* Define if Tk stubs are used. */
-#undef USE_TK_STUBS
-
-/* Define if building for Win32. */
-#undef WIN32
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
- significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-# define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-# undef WORDS_BIGENDIAN
-# endif
-#endif
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
diff --git a/blt3.0.1/src/missing.h b/blt3.0.1/src/missing.h
deleted file mode 100644
index 373ea51..0000000
--- a/blt3.0.1/src/missing.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef _MISSING_H
-#define _MISSING_H
-
-#include <winspool.h>
-
-#ifndef DeleteBitmap
-#define DeleteBitmap(hbm) DeleteObject((HGDIOBJ)(HBITMAP)(hbm))
-#endif
-#ifndef DeleteBrush
-#define DeleteBrush(hbr) DeleteObject((HGDIOBJ)(HBRUSH)(hbr))
-#endif
-#ifndef DeleteFont
-#define DeleteFont(hfont) DeleteObject((HGDIOBJ)(HFONT)(hfont))
-#endif
-#ifndef DeletePalette
-#define DeletePalette(hpal) DeleteObject((HGDIOBJ)(HPALETTE)(hpal))
-#endif
-#ifndef DeletePen
-#define DeletePen(hpen) DeleteObject((HGDIOBJ)(HPEN)(hpen))
-#endif
-#ifndef SelectBitmap
-#define SelectBitmap(hdc, hbm) ((HBITMAP)SelectObject((hdc), (HGDIOBJ)(HBITMAP)(hbm)))
-#endif
-#ifndef SelectBrush
-#define SelectBrush(hdc, hbr) ((HBRUSH)SelectObject((hdc), (HGDIOBJ)(HBRUSH)(hbr)))
-#endif
-#ifndef SelectFont
-#define SelectFont(hdc, hfont) ((HFONT)SelectObject((hdc), (HGDIOBJ)(HFONT)(hfont)))
-#endif
-#ifndef SelectPen
-#define SelectPen(hdc, hpen) ((HPEN)SelectObject((hdc), (HGDIOBJ)(HPEN)(hpen)))
-#endif
-#ifndef GetNextWindow
-#define GetNextWindow(hWnd,wCmd) GetWindow((hWnd),(wCmd))
-#endif
-#ifndef GetStockBrush
-#define GetStockBrush(i) ((HBRUSH)GetStockObject(i))
-#endif
-#ifndef GetStockPen
-#define GetStockPen(i) ((HPEN)GetStockObject(i))
-#endif
-
-
-#endif /* _MISSING_H */
diff --git a/blt3.0.1/src/pure_api.c b/blt3.0.1/src/pure_api.c
deleted file mode 100644
index a863c7d..0000000
--- a/blt3.0.1/src/pure_api.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Header file of Pure API function declarations.
- *
- * Explicitly no copyright.
- * You may recompile and redistribute these definitions as required.
- *
- * NOTE1: In some situations when compiling with MFC, you should
- * enable the setting 'Not using precompiled headers' in Visual C++
- * to avoid a compiler diagnostic.
- *
- * NOTE2: This file works through the use of deep magic. Calls to functions
- * in this file are replaced with calls into the OCI runtime system
- * when an instrumented version of this program is run.
- *
- * NOTE3: The static vars avoidGy_n (where n is a unique number) are used
- * to prevent optimizing the functions away when compiler option
- * /Gy is set. This is needed so that NOTE2 works properly.
- */
-static int avoidGy_1;
-static int avoidGy_2;
-static int avoidGy_3;
-static int avoidGy_4;
-static int avoidGy_5;
-static int avoidGy_6;
-static int avoidGy_7;
-static int avoidGy_8;
-static int avoidGy_9;
-static int avoidGy_10;
-static int avoidGy_11;
-static int avoidGy_12;
-static int avoidGy_13;
-static int avoidGy_14;
-static int avoidGy_15;
-static int avoidGy_16;
-static int avoidGy_17;
-static int avoidGy_18;
-static int avoidGy_19;
-static int avoidGy_20;
-static int avoidGy_21;
-static int avoidGy_22;
-static int avoidGy_23;
-static int avoidGy_24;
-static int avoidGy_25;
-static int avoidGy_26;
-static int avoidGy_27;
-static int avoidGy_28;
-static int avoidGy_29;
-static int avoidGy_30;
-static int avoidGy_31;
-static int avoidGy_32;
-static int avoidGy_33;
-static int avoidGy_34;
-static int avoidGy_35;
-static int avoidGy_36;
-static int avoidGy_37;
-static int avoidGy_38;
-static int avoidGy_39;
-static int avoidGy_40;
-static int avoidGy_41;
-static int avoidGy_42;
-static int avoidGy_43;
-static int avoidGy_44;
-static int avoidGy_45;
-static int avoidGy_46;
-static int avoidGy_47;
-static int avoidGy_48;
-static int avoidGy_49;
-static int avoidGy_50;
-static int avoidGy_51;
-static int avoidGy_52;
-static int avoidGy_53;
-static int avoidGy_54;
-static int avoidGy_55;
-static int avoidGy_56;
-static int avoidGy_57;
-static int avoidGy_58;
-static int avoidGy_59;
-static int avoidGy_60;
-static int avoidGy_PL_01;
-__declspec(dllexport) int __cdecl PurePrintf(const char *fmt, ...) { avoidGy_1++; fmt; return 0; }
-__declspec(dllexport) int __cdecl PurifyIsRunning(void) { avoidGy_2++; return 0; }
-__declspec(dllexport) int __cdecl PurifyPrintf(const char *fmt, ...) { avoidGy_3++; fmt; return 0; }
-__declspec(dllexport) int __cdecl PurifyNewInuse(void) { avoidGy_4++; return 0; }
-__declspec(dllexport) int __cdecl PurifyAllInuse(void) { avoidGy_5++; return 0; }
-__declspec(dllexport) int __cdecl PurifyClearInuse(void) { avoidGy_6++; return 0; }
-__declspec(dllexport) int __cdecl PurifyNewLeaks(void) { avoidGy_7++; return 0; }
-__declspec(dllexport) int __cdecl PurifyAllLeaks(void) { avoidGy_8++; return 0; }
-__declspec(dllexport) int __cdecl PurifyClearLeaks(void) { avoidGy_9++; return 0; }
-__declspec(dllexport) int __cdecl PurifyAllHandlesInuse(void) { avoidGy_10++; return 0; }
-__declspec(dllexport) int __cdecl PurifyNewHandlesInuse(void) { avoidGy_11++; return 0; }
-__declspec(dllexport) int __cdecl PurifyDescribe(void *addr) { avoidGy_12++; addr; return 0; }
-__declspec(dllexport) int __cdecl PurifyWhatColors(void *addr, int size) { avoidGy_13++; addr; size; return 0; }
-__declspec(dllexport) int __cdecl PurifyAssertIsReadable(const void *addr, int size) { avoidGy_14++; addr; size; return 1; }
-__declspec(dllexport) int __cdecl PurifyAssertIsWritable(const void *addr, int size) { avoidGy_15++; addr; size; return 1; }
-__declspec(dllexport) int __cdecl PurifyIsReadable(const void *addr, int size) { avoidGy_16++; addr; size; return 1; }
-__declspec(dllexport) int __cdecl PurifyIsWritable(const void *addr, int size) { avoidGy_17++; addr; size; return 1; }
-__declspec(dllexport) int __cdecl PurifyIsInitialized(const void *addr, int size) { avoidGy_18++; addr; size; return 1; }
-__declspec(dllexport) int __cdecl PurifyRed(void *addr, int size) { avoidGy_19++; addr; size; return 0; }
-__declspec(dllexport) int __cdecl PurifyGreen(void *addr, int size) { avoidGy_20++; addr; size; return 0; }
-__declspec(dllexport) int __cdecl PurifyYellow(void *addr, int size) { avoidGy_21++; addr; size; return 0; }
-__declspec(dllexport) int __cdecl PurifyBlue(void *addr, int size) { avoidGy_22++; addr; size; return 0; }
-__declspec(dllexport) int __cdecl PurifyMarkAsInitialized(void *addr, int size) { avoidGy_23++; addr; size; return 0; }
-__declspec(dllexport) int __cdecl PurifyMarkAsUninitialized(void *addr, int size) { avoidGy_24++; addr; size; return 0; }
-__declspec(dllexport) int __cdecl PurifyMarkForTrap(void *addr, int size) { avoidGy_25++; addr; size; return 0; }
-__declspec(dllexport) int __cdecl PurifyMarkForNoTrap(void *addr, int size) { avoidGy_26++; addr; size; return 0; }
-__declspec(dllexport) int __cdecl PurifyHeapValidate(unsigned int hHeap, unsigned int dwFlags, const void *addr)
- { avoidGy_27++; hHeap; dwFlags; addr; return 1; }
-__declspec(dllexport) int __cdecl PurifySetLateDetectScanCounter(int counter) { avoidGy_28++; counter; return 0; };
-__declspec(dllexport) int __cdecl PurifySetLateDetectScanInterval(int seconds) { avoidGy_29++; seconds; return 0; };
-__declspec(dllexport) int __cdecl CoverageIsRunning(void) { avoidGy_30++; return 0; }
-__declspec(dllexport) int __cdecl CoverageDisableRecordingData(void) { avoidGy_31++; return 0; }
-__declspec(dllexport) int __cdecl CoverageStartRecordingData(void) { avoidGy_32++; return 0; }
-__declspec(dllexport) int __cdecl CoverageStopRecordingData(void) { avoidGy_33++; return 0; }
-__declspec(dllexport) int __cdecl CoverageClearData(void) { avoidGy_34++; return 0; }
-__declspec(dllexport) int __cdecl CoverageIsRecordingData(void) { avoidGy_35++; return 0; }
-__declspec(dllexport) int __cdecl CoverageAddAnnotation(char *str) { avoidGy_36++; str; return 0; }
-__declspec(dllexport) int __cdecl CoverageSaveData(void) { avoidGy_37++; return 0; }
-__declspec(dllexport) int __cdecl QuantifyIsRunning(void) { avoidGy_42++; return 0; }
-__declspec(dllexport) int __cdecl QuantifyDisableRecordingData(void) { avoidGy_43++; return 0; }
-__declspec(dllexport) int __cdecl QuantifyStartRecordingData(void) { avoidGy_44++; return 0; }
-__declspec(dllexport) int __cdecl QuantifyStopRecordingData(void) { avoidGy_45++; return 0; }
-__declspec(dllexport) int __cdecl QuantifyClearData(void) { avoidGy_46++; return 0; }
-__declspec(dllexport) int __cdecl QuantifyIsRecordingData(void) { avoidGy_47++; return 0; }
-__declspec(dllexport) int __cdecl QuantifyAddAnnotation(char *str) { avoidGy_48++; str; return 0; }
-__declspec(dllexport) int __cdecl QuantifySaveData(void) { avoidGy_49++; return 0; }
-__declspec(dllexport) int __cdecl PurelockIsRunning(void) { avoidGy_PL_01++; return 0; }
diff --git a/blt3.0.1/src/shared/Makefile.in b/blt3.0.1/src/shared/Makefile.in
deleted file mode 100644
index e79dcab..0000000
--- a/blt3.0.1/src/shared/Makefile.in
+++ /dev/null
@@ -1,534 +0,0 @@
-# ------------------------------------------------------------------------
-# Makefile for shared version of BLT library
-# ------------------------------------------------------------------------
-
-SO_SUFFIX = @SO_SUFFIX@
-version = @BLT_MAJOR_VERSION@@BLT_MINOR_VERSION@
-
-# ------------------------------------------------------------------------
-# C Compiler options
-# ------------------------------------------------------------------------
-
-CC = @CC@
-CFLAGS = @CFLAGS@
-DBG = @LIB_SUFFIX@
-DEFINES = @DEFINES@
-DEF_BLTINIT = -DBLT_LIBRARY=\"$(pkgdir)\"
-EXTRA_CFLAGS = @GCCFLAGS@ @SO_CFLAGS@
-EXTRA_LIBS = @EXTRA_LIBS@
-LDFLAGS = @LDFLAGS@ @LD_RUN_PATH@
-LIB_PREFIX = @LIB_PREFIX@
-
-SO_LD = @SO_LD@
-SO_LD_FLAGS = @SO_LD_FLAGS@ @LD_RUN_PATH@
-SO_STD_LIBS = @SO_LIBS@
-SO_TCL_ONLY_LIBS = @SO_TCL_ONLY_LIBS@
-
-STD_LIBS = @LIBS@
-
-STUB_DEFINES = @TCL_STUB_DEFINES@
-TCL_STUB_SPEC = @TCL_STUB_SPEC@
-TK_STUB_SPEC = @TK_STUB_SPEC@
-cyg_prefix = @LIB_PREFIX@
-
-EXPAT_INC_SPEC = @EXPAT_INC_SPEC@
-EXPAT_LIB_SPEC = @EXPAT_LIB_SPEC@
-FT_INC_SPEC = @FT_INC_SPEC@
-FT_LIB_SPEC = @FT_LIB_SPEC@
-JPG_INC_SPEC = @JPG_INC_SPEC@
-JPG_LIB_SPEC = @JPG_LIB_SPEC@
-MYSQL_INC_SPEC = @MYSQL_INC_SPEC@
-MYSQL_LIB_SPEC = @MYSQL_LIB_SPEC@
-PNG_INC_SPEC = @PNG_INC_SPEC@
-PNG_LIB_SPEC = @PNG_LIB_SPEC@
-TCL_INC_SPEC = @TCL_INC_SPEC@
-TCL_LIB_SPEC = @TCL_LIB_SPEC@
-TIF_INC_SPEC = @TIF_INC_SPEC@
-TIF_LIB_SPEC = @TIF_LIB_SPEC@
-TK_INC_SPEC = @TK_INC_SPEC@
-TK_LIB_SPEC = @TK_LIB_SPEC@
-X11_INC_SPEC = @X11_INC_SPEC@
-X11_LIB_SPEC = @X11_LIB_SPEC@
-XFT_INC_SPEC = @XFT_INC_SPEC@
-XFT_LIB_SPEC = @XFT_LIB_SPEC@
-XPM_INC_SPEC = @XPM_INC_SPEC@
-XPM_LIB_SPEC = @XPM_LIB_SPEC@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-bindir = $(exec_prefix)/bin
-srcdir = @srcdir@/..
-
-instdirs = $(exec_prefix) $(libdir)
-
-pkgdir = @BLT_LIBRARY@
-
-BLT_LIBS = $(TK_LIB_SPEC) \
- $(TCL_LIB_SPEC) \
- $(FT_LIB_SPEC) \
- $(XFT_LIB_SPEC) \
- $(X11_LIB_SPEC) \
- $(EXTRA_LIBS)
-
-BLT_LITE_LIBS = $(TCL_LIB_SPEC) \
- $(EXTRA_LIBS)
-
-# ------------------------------------------------------------------------
-# Don't edit anything beyond this point
-# ------------------------------------------------------------------------
-
-N_OBJS = bltTed.o
-V3_OBJS = bltTri.o bltGrMt.o
-
-TK_OBJS = tkButton.o tkFrame.o bltScrollbar.o
-
-GRAPH_OBJS = bltGrAxis.o \
- bltGrBar.o \
- bltGrElem.o \
- bltGrHairs.o \
- bltGrLegd.o \
- bltGrLine.o \
- bltGrMarker.o \
- bltGrMisc.o \
- bltGrPen.o \
- bltGrPs.o \
- bltGraph.o
-
-PICTURE_OBJS = bltPicture.o \
- bltPictCmd.o \
- bltPictDraw.o \
- bltPictMmx.o
-
-TREEVIEW_OBJS = bltTreeView.o \
- bltTvCmd.o \
- bltTvCol.o \
- bltTvEdit.o \
- bltTvStyle.o
-
-TREE_OBJS = bltTree.o \
- bltTreeCmd.o
-
-DATATABLE_OBJS = bltDataTable.o \
- bltDtCmd.o
-
-BLT_LITE_OBJS = bltAlloc.o \
- bltArrayObj.o \
- bltBase64.o \
- bltBgexec.o \
- bltChain.o \
- bltCrc32.o \
- bltCsv.o \
- $(DATATABLE_OBJS) \
- bltDebug.o \
- bltHash.o \
- bltList.o \
- bltNsUtil.o \
- bltParse.o \
- bltPool.o \
- bltSink.o \
- bltSpline.o \
- bltSwitch.o \
- $(TREE_OBJS) \
- bltUnixPipe.o \
- bltUtil.o \
- bltVecCmd.o \
- bltVecMath.o \
- bltVector.o \
- bltWatch.o
-
-BLT_OBJS = $(BLT_LITE_OBJS) \
- $(GRAPH_OBJS) \
- $(PICTURE_OBJS) \
- $(TREEVIEW_OBJS) \
- bltBeep.o \
- bltBgStyle.o \
- bltBind.o \
- bltBitmap.o \
- bltBusy.o \
- bltCanvEps.o \
- bltComboBtn.o \
- bltComboEntry.o \
- bltComboMenu.o \
- bltComboTree.o \
- bltConfig.o \
- bltContainer.o \
- bltCutbuffer.o \
- bltDragdrop.o \
- bltHtext.o \
- bltImage.o \
- bltOldConfig.o \
- bltPainter.o \
- bltPs.o \
- bltTable.o \
- bltTabnotebook.o \
- bltTabset.o \
- bltText.o \
- bltTile.o \
- bltUnixBitmap.o \
- bltUnixFont.o \
- bltUnixDnd.o \
- bltUnixPainter.o \
- bltUnixWindow.o \
- bltWindow.o \
- bltWinop.o \
- $(TK_OBJS) $(N_OBJS)
-
-INCLUDES = -I.. -I$(srcdir) -I$(srcdir)/.. @INCLUDES@
-CC_OPTS = $(EXTRA_CFLAGS) $(CFLAGS) $(DEFINES) $(STUB_DEFINES) $(INCLUDES)
-MAIN_CC_OPTS = $(EXTRA_CFLAGS) $(CFLAGS) $(DEFINES) $(INCLUDES)
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_ROOT =
-SHELL = /bin/sh
-RM = rm -f
-LN_S = @LN_S@
-bltwish = bltwish$(version)
-bltsh = bltsh$(version)
-
-lib_blt_so = $(LIB_PREFIX)BLT$(version)$(DBG)$(SO_SUFFIX)
-lib_blt_lite_so = $(LIB_PREFIX)BLTlite$(version)$(DBG)$(SO_SUFFIX)
-lib_blt_dt_xml_so = $(LIB_PREFIX)BltDataTableXml$(version)$(DBG)$(SO_SUFFIX)
-lib_blt_dt_mysql_so = $(LIB_PREFIX)BltDataTableMysql$(version)$(DBG)$(SO_SUFFIX)
-lib_blt_dt_tree_so = $(LIB_PREFIX)BltDataTableTree$(version)$(DBG)$(SO_SUFFIX)
-lib_blt_dt_vec_so = $(LIB_PREFIX)BltDataTableVector$(version)$(DBG)$(SO_SUFFIX)
-lib_blt_dt_csv_so = $(LIB_PREFIX)BltDataTableCsv$(version)$(DBG)$(SO_SUFFIX)
-
-lib_blt_pict_gif_so = $(LIB_PREFIX)BltPictureGif$(version)$(DBG)$(SO_SUFFIX)
-lib_blt_pict_jpg_so = $(LIB_PREFIX)BltPictureJpg$(version)$(DBG)$(SO_SUFFIX)
-lib_blt_pict_png_so = $(LIB_PREFIX)BltPicturePng$(version)$(DBG)$(SO_SUFFIX)
-lib_blt_pict_tif_so = $(LIB_PREFIX)BltPictureTif$(version)$(DBG)$(SO_SUFFIX)
-lib_blt_pict_xbm_so = $(LIB_PREFIX)BltPictureXbm$(version)$(DBG)$(SO_SUFFIX)
-lib_blt_pict_xpm_so = $(LIB_PREFIX)BltPictureXpm$(version)$(DBG)$(SO_SUFFIX)
-lib_blt_pict_photo_so = $(LIB_PREFIX)BltPicturePhoto$(version)$(DBG)$(SO_SUFFIX)
-
-lib_blt_tree_xml_so = $(LIB_PREFIX)BltTreeXml$(version)$(DBG)$(SO_SUFFIX)
-
-blt_libs_so = \
- $(lib_blt_lite_so) \
- $(lib_blt_so) \
- $(blt_pkg_libs_so)
-
-blt_pkg_libs_so = \
- $(lib_blt_dt_csv_so) \
- $(lib_blt_dt_mysql_so) \
- $(lib_blt_dt_tree_so) \
- $(lib_blt_dt_vec_so) \
- $(lib_blt_dt_xml_so) \
- $(lib_blt_pict_gif_so) \
- $(lib_blt_pict_jpg_so) \
- $(lib_blt_pict_photo_so) \
- $(lib_blt_pict_png_so) \
- $(lib_blt_pict_tif_so) \
- $(lib_blt_pict_xbm_so) \
- $(lib_blt_pict_xpm_so) \
- $(lib_blt_tree_xml_so)
-
-all: build_demo
-
-build_demo: $(blt_libs_so) $(bltsh) $(bltwish)
-
-$(bltwish): $(lib_blt_so)
- $(RM) $(bltwish)
- $(CC) $(MAIN_CC_OPTS) $(LDFLAGS) -o $(bltwish) $(srcdir)/bltUnixMain.c \
- $(lib_blt_so) $(BLT_LIBS)
-
-$(bltsh): $(lib_blt_lite_so)
- $(RM) $(bltsh)
- $(CC) $(MAIN_CC_OPTS) $(LDFLAGS) -DTCL_ONLY -o $(bltsh) \
- $(srcdir)/bltUnixMain.c $(lib_blt_lite_so) \
- $(BLT_LITE_LIBS)
-
-build_lib: $(blt_libs_so)
-
-$(lib_blt_so): $(BLT_OBJS) $(srcdir)/bltInit.c
- $(CC) -c $(CC_OPTS) -DBLT_LIBRARY=\"$(pkgdir)\" \
- $(srcdir)/bltInit.c
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltInit.o $(BLT_OBJS) $(BLT_LIBS) \
- $(TK_STUB_SPEC) $(TCL_STUB_SPEC)
-
-$(lib_blt_lite_so): $(BLT_LITE_OBJS) $(srcdir)/bltInit.c
- $(CC) -c $(CC_OPTS) -DTCL_ONLY -DBLT_LIBRARY=\"$(pkgdir)\" \
- $(srcdir)/bltInit.c
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltInit.o $(BLT_LITE_OBJS) \
- $(BLT_LITE_LIBS) $(TCL_STUB_SPEC)
-
-$(lib_blt_dt_mysql_so): bltDtMysql.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltDtMysql.o $(MYSQL_LIB_SPEC)
-
-$(lib_blt_dt_xml_so): bltDtXml.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltDtXml.o $(EXPAT_LIB_SPEC)
-
-$(lib_blt_dt_csv_so): bltDtCsv.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltDtCsv.o
-
-$(lib_blt_dt_vec_so): bltDtVec.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltDtVec.o
-
-$(lib_blt_dt_tree_so): bltDtTree.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltDtTree.o
-
-$(lib_blt_pict_gif_so): bltPictGif.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictGif.o
-
-$(lib_blt_pict_jpg_so): bltPictJpg.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictJpg.o $(JPG_LIB_SPEC)
-
-$(lib_blt_pict_png_so): bltPictPng.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictPng.o $(PNG_LIB_SPEC)
-
-$(lib_blt_pict_tif_so): bltPictTif.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictTif.o $(TIF_LIB_SPEC)
-
-$(lib_blt_pict_xbm_so): bltPictXbm.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictXbm.o
-
-$(lib_blt_pict_xpm_so): bltPictXpm.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictXpm.o $(X11_LIB_SPEC) $(XPM_LIB_SPEC)
-
-$(lib_blt_pict_photo_so): bltPictPhoto.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltPictPhoto.o
-
-$(lib_blt_tree_xml_so): bltTreeXml.o
- $(RM) $@
- $(SO_LD) $(SO_LD_FLAGS) -o $@ bltTreeXml.o $(EXPAT_LIB_SPEC)
-
-install: mkdirs install-libs install-demo
-
-install-demo: $(bltwish) $(bltsh)
- $(INSTALL) -m 0755 bltwish$(version) $(INSTALL_ROOT)$(bindir)
- $(INSTALL) -m 0755 bltsh$(version) $(INSTALL_ROOT)$(bindir)
-
-install-libs: $(lib_blt_so) $(lib_blt_lite_so) $(blt_pkg_libs_so)
- $(INSTALL) -m 0755 $(lib_blt_so) $(INSTALL_ROOT)$(libdir)
- $(INSTALL) -m 0755 $(lib_blt_lite_so) $(INSTALL_ROOT)$(libdir)
- @for i in $(blt_pkg_libs_so) ; do \
- echo $(RM) $(INSTALL_ROOT)$(libdir)/$$i ; \
- $(RM) $(INSTALL_ROOT)$(libdir)/$$i ; \
- echo $(INSTALL) -m 0755 $$i $(INSTALL_ROOT)$(pkgdir) ; \
- $(INSTALL) -m 0755 $$i $(INSTALL_ROOT)$(pkgdir) ; \
- done
-
-mkdirs:
- @for i in $(instdirs) ; do \
- if test -d $(INSTALL_ROOT)$$i ; then \
- : ;\
- else \
- echo " mkdir $(INSTALL_ROOT)$$i" ; \
- mkdir $(INSTALL_ROOT)$$i ; \
- fi ; \
- done
-clean:
- $(RM) $(BLT_OBJS) bltInit.o $(lib_blt_so) $(lib_blt_lite_so) \
- $(bltsh) $(bltwish) *pure* .pure*
-
-distclean: clean
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"* Makefile TAGS
-
-# ------------------------------------------------------------------------
-# in lieu of viewpath-ing...
-#
-bltAlloc.o: $(srcdir)/bltAlloc.c
- $(CC) -c $(CC_OPTS) $?
-bltArrayObj.o: $(srcdir)/bltArrayObj.c
- $(CC) -c $(CC_OPTS) $?
-bltBase64.o: $(srcdir)/bltBase64.c
- $(CC) -c $(CC_OPTS) $?
-bltBeep.o: $(srcdir)/bltBeep.c
- $(CC) -c $(CC_OPTS) $?
-bltBgexec.o: $(srcdir)/bltBgexec.c
- $(CC) -c $(CC_OPTS) $?
-bltBind.o: $(srcdir)/bltBind.c
- $(CC) -c $(CC_OPTS) $?
-bltBitmap.o: $(srcdir)/bltBitmap.c
- $(CC) -c $(CC_OPTS) $?
-bltBusy.o: $(srcdir)/bltBusy.c
- $(CC) -c $(CC_OPTS) $?
-bltCanvEps.o: $(srcdir)/bltCanvEps.c
- $(CC) -c $(CC_OPTS) $?
-bltChain.o: $(srcdir)/bltChain.c
- $(CC) -c $(CC_OPTS) $?
-bltComboBtn.o: $(srcdir)/bltComboBtn.c
- $(CC) -c $(CC_OPTS) $?
-bltComboEntry.o: $(srcdir)/bltComboEntry.c
- $(CC) -c $(CC_OPTS) $?
-bltComboMenu.o: $(srcdir)/bltComboMenu.c
- $(CC) -c $(CC_OPTS) $?
-bltComboTree.o: $(srcdir)/bltComboTree.c
- $(CC) -c $(CC_OPTS) $?
-bltConfig.o: $(srcdir)/bltConfig.c
- $(CC) -c $(CC_OPTS) $?
-bltContainer.o: $(srcdir)/bltContainer.c
- $(CC) -c $(CC_OPTS) $?
-bltCrc32.o: $(srcdir)/bltCrc32.c
- $(CC) -c $(CC_OPTS) $?
-bltCsv.o: $(srcdir)/bltCsv.c
- $(CC) -c $(CC_OPTS) $?
-bltCutbuffer.o: $(srcdir)/bltCutbuffer.c
- $(CC) -c $(CC_OPTS) $?
-bltDebug.o: $(srcdir)/bltDebug.c
- $(CC) -c $(CC_OPTS) $?
-bltDragdrop.o: $(srcdir)/bltDragdrop.c
- $(CC) -c $(CC_OPTS) $?
-bltGrAxis.o: $(srcdir)/bltGrAxis.c
- $(CC) -c $(CC_OPTS) $?
-bltGrBar.o: $(srcdir)/bltGrBar.c
- $(CC) -c $(CC_OPTS) $?
-bltGrElem.o: $(srcdir)/bltGrElem.c
- $(CC) -c $(CC_OPTS) $?
-bltGrHairs.o: $(srcdir)/bltGrHairs.c
- $(CC) -c $(CC_OPTS) $?
-bltGrLegd.o: $(srcdir)/bltGrLegd.c
- $(CC) -c $(CC_OPTS) $?
-bltGrLine.o: $(srcdir)/bltGrLine.c
- $(CC) -c $(CC_OPTS) $?
-bltGrMisc.o: $(srcdir)/bltGrMisc.c
- $(CC) -c $(CC_OPTS) $?
-bltGrPen.o: $(srcdir)/bltGrPen.c
- $(CC) -c $(CC_OPTS) $?
-bltGrPs.o: $(srcdir)/bltGrPs.c
- $(CC) -c $(CC_OPTS) $?
-bltGrMarker.o: $(srcdir)/bltGrMarker.c
- $(CC) -c $(CC_OPTS) $?
-bltGraph.o: $(srcdir)/bltGraph.c
- $(CC) -c $(CC_OPTS) $?
-bltHash.o: $(srcdir)/bltHash.c
- $(CC) -c $(CC_OPTS) $?
-bltHtext.o: $(srcdir)/bltHtext.c
- $(CC) -c $(CC_OPTS) $?
-bltImage.o: $(srcdir)/bltImage.c
- $(CC) -c $(CC_OPTS) $(srcdir)/bltImage.c
-bltList.o: $(srcdir)/bltList.c
- $(CC) -c $(CC_OPTS) $?
-bltNsUtil.o: $(srcdir)/bltNsUtil.c
- $(CC) -c $(CC_OPTS) $?
-bltOldConfig.o: $(srcdir)/bltOldConfig.c
- $(CC) -c $(CC_OPTS) $?
-bltPicture.o: $(srcdir)/bltPicture.c
- $(CC) -c $(CC_OPTS) $(srcdir)/bltPicture.c
-bltPictCmd.o: $(srcdir)/bltPictCmd.c
- $(CC) -c $(CC_OPTS) $?
-bltPictDraw.o: $(srcdir)/bltPictDraw.c $(srcdir)/bltPaintDraw.c
- $(CC) -c $(CC_OPTS) $(FT_INC_SPEC) $<
-bltPictJpg.o: $(srcdir)/bltPictJpg.c
- $(CC) -c $(CC_OPTS) $(JPG_INC_SPEC) $?
-bltPictTif.o: $(srcdir)/bltPictTif.c
- $(CC) -c $(CC_OPTS) $(TIF_INC_SPEC) $?
-bltPictPng.o: $(srcdir)/bltPictPng.c
- $(CC) -c $(CC_OPTS) $(PNG_INC_SPEC) $?
-bltPictXpm.o: $(srcdir)/bltPictXpm.c
- $(CC) -c $(CC_OPTS) $(XPM_INC_SPEC) $?
-bltPictXbm.o: $(srcdir)/bltPictXbm.c
- $(CC) -c $(CC_OPTS) $?
-bltPictGif.o: $(srcdir)/bltPictGif.c
- $(CC) -c $(CC_OPTS) $?
-bltPictPhoto.o: $(srcdir)/bltPictPhoto.c
- $(CC) -c $(CC_OPTS) $?
-bltPictMmx.o: $(srcdir)/bltPictMmx.c
- $(CC) -c $(CC_OPTS) $(srcdir)/bltPictMmx.c
-bltPainter.o: $(srcdir)/bltPainter.c
- $(CC) -c $(CC_OPTS) $(srcdir)/bltPainter.c
-bltParse.o: $(srcdir)/bltParse.c
- $(CC) -c $(CC_OPTS) $?
-bltPool.o: $(srcdir)/bltPool.c
- $(CC) -c $(CC_OPTS) $?
-bltPs.o: $(srcdir)/bltPs.c
- $(CC) -c $(CC_OPTS) $?
-bltSink.o: $(srcdir)/bltSink.c
- $(CC) -c $(CC_OPTS) $?
-bltSpline.o: $(srcdir)/bltSpline.c
- $(CC) -c $(CC_OPTS) $?
-bltSwitch.o: $(srcdir)/bltSwitch.c
- $(CC) -c $(CC_OPTS) $?
-bltTable.o: $(srcdir)/bltTable.c
- $(CC) -c $(CC_OPTS) $?
-bltTabset.o: $(srcdir)/bltTabset.c
- $(CC) -c $(CC_OPTS) $?
-bltTabnotebook.o: $(srcdir)/bltTabnotebook.c
- $(CC) -c $(CC_OPTS) $?
-bltTed.o: $(srcdir)/bltTed.c
- $(CC) -c $(CC_OPTS) $?
-bltText.o: $(srcdir)/bltText.c
- $(CC) -c $(CC_OPTS) $?
-bltTile.o: $(srcdir)/bltTile.c
- $(CC) -c $(CC_OPTS) $?
-bltTree.o: $(srcdir)/bltTree.c
- $(CC) -c $(CC_OPTS) $?
-bltTreeCmd.o: $(srcdir)/bltTreeCmd.c
- $(CC) -c $(CC_OPTS) $?
-bltTreeXml.o: $(srcdir)/bltTreeXml.c
- $(CC) -c $(CC_OPTS) $(EXPAT_INC_SPEC) $?
-bltTreeView.o: $(srcdir)/bltTreeView.c
- $(CC) -c $(CC_OPTS) $?
-bltTvCmd.o: $(srcdir)/bltTvCmd.c
- $(CC) -c $(CC_OPTS) $?
-bltTvCol.o: $(srcdir)/bltTvCol.c
- $(CC) -c $(CC_OPTS) $?
-bltTvEdit.o: $(srcdir)/bltTvEdit.c
- $(CC) -c $(CC_OPTS) $?
-bltTvStyle.o: $(srcdir)/bltTvStyle.c
- $(CC) -c $(CC_OPTS) $?
-bltDataTable.o: $(srcdir)/bltDataTable.c
- $(CC) -c $(CC_OPTS) $?
-bltDtCmd.o: $(srcdir)/bltDtCmd.c
- $(CC) -c $(CC_OPTS) $?
-bltDtCsv.o: $(srcdir)/bltDtCsv.c
- $(CC) -c $(CC_OPTS) $?
-bltDtMysql.o: $(srcdir)/bltDtMysql.c
- $(CC) -c $(CC_OPTS) $(MYSQL_INC_SPEC) $?
-bltDtTree.o: $(srcdir)/bltDtTree.c
- $(CC) -c $(CC_OPTS) $?
-bltDtVec.o: $(srcdir)/bltDtVec.c
- $(CC) -c $(CC_OPTS) $?
-bltDtXml.o: $(srcdir)/bltDtXml.c
- $(CC) -c $(CC_OPTS) $(EXPAT_INC_SPEC) $?
-bltUnixBitmap.o: $(srcdir)/bltUnixBitmap.c
- $(CC) -c $(CC_OPTS) $?
-bltUnixDnd.o: $(srcdir)/bltUnixDnd.c
- $(CC) -c $(CC_OPTS) $?
-bltUnixFont.o: $(srcdir)/bltUnixFont.c
- $(CC) -c $(CC_OPTS) $(FT_INC_SPEC) $?
-bltUnixPainter.o: $(srcdir)/bltUnixPainter.c
- $(CC) -c $(CC_OPTS) $?
-bltUnixPipe.o: $(srcdir)/bltUnixPipe.c
- $(CC) -c $(CC_OPTS) $?
-bltUnixWindow.o: $(srcdir)/bltUnixWindow.c
- $(CC) -c $(CC_OPTS) $?
-bltUtil.o: $(srcdir)/bltUtil.c
- $(CC) -c $(CC_OPTS) $?
-bltVector.o: $(srcdir)/bltVector.c
- $(CC) -c $(CC_OPTS) $?
-bltVecCmd.o: $(srcdir)/bltVecCmd.c
- $(CC) -c $(CC_OPTS) $?
-bltVecMath.o: $(srcdir)/bltVecMath.c
- $(CC) -c $(CC_OPTS) $?
-bltWatch.o: $(srcdir)/bltWatch.c
- $(CC) -c $(CC_OPTS) $?
-bltWindow.o: $(srcdir)/bltWindow.c
- $(CC) -c $(CC_OPTS) $?
-bltWinop.o: $(srcdir)/bltWinop.c
- $(CC) -c $(CC_OPTS) $?
-tkButton.o: $(srcdir)/tkButton.c
- $(CC) -c $(CC_OPTS) $?
-tkFrame.o: $(srcdir)/tkFrame.c
- $(CC) -c $(CC_OPTS) $?
-tkMenubutton.o: $(srcdir)/tkMenubutton.c
- $(CC) -c $(CC_OPTS) $?
-bltScrollbar.o: $(srcdir)/bltScrollbar.c
- $(CC) -c $(CC_OPTS) $?
-bltBgStyle.o: $(srcdir)/bltBgStyle.c
- $(CC) -c $(CC_OPTS) $?
diff --git a/blt3.0.1/src/tclGet.c b/blt3.0.1/src/tclGet.c
deleted file mode 100644
index 9526cd3..0000000
--- a/blt3.0.1/src/tclGet.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *----------------------------------------------------------------------
- *
- * TclGetLong --
- *
- * Given a string, produce the corresponding long integer value. This
- * routine is a version of Tcl_GetInt but returns a "long" instead of an
- * "int" (a difference that matters on 64-bit architectures).
- *
- * Results:
- * The return value is normally TCL_OK; in this case *longPtr will be set
- * to the long integer value equivalent to src. If src is improperly
- * formed then TCL_ERROR is returned and an error message will be left in
- * the interp's result if interp is non-NULL.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-#include "tcl.h"
-
-int
-TclGetLong(
- Tcl_Interp *interp, /* Interpreter used for error reporting if not
- * NULL. */
- CONST char *src, /* String containing a (possibly signed) long
- * integer in a form acceptable to
- * Tcl_GetLongFromObj(). */
- long *longPtr) /* Place to store converted long result. */
-{
- Tcl_Obj obj;
- int code;
-
- obj.refCount = 1;
- obj.bytes = (char *) src;
- obj.length = strlen(src);
- obj.typePtr = NULL;
-
- code = Tcl_GetLongFromObj(interp, &obj, longPtr);
- if (obj.refCount > 1) {
- Tcl_Panic("invalid sharing of Tcl_Obj on C stack");
- }
- return code;
-}
diff --git a/blt3.0.1/src/tclIntDecls.h b/blt3.0.1/src/tclIntDecls.h
deleted file mode 100644
index ff1a3d8..0000000
--- a/blt3.0.1/src/tclIntDecls.h
+++ /dev/null
@@ -1,401 +0,0 @@
-
-/*
- * tclIntDecls.h --
- *
- * This file contains the declarations for all unsupported functions
- * that are exported by the TCL library. These interfaces are not
- * guaranteed to remain the same between versions. Use at your own
- * risk.
- *
- * Copyright 2003-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This file was adapted from TclIntDecls.h of the TCL library distribution.
- *
- * Copyright (c) 1998-1999 by Scriptics Corporation.
- *
- * See the file "license.terms" for information on usage and
- * redistribution of this file, and for a DISCLAIMER OF ALL
- * WARRANTIES.
- *
- */
-
-#ifndef _TCL_INT_DECLS_H
-#define _TCL_INT_DECLS_H
-
-/*
- * WARNING: This file is automatically generated by the tools/genStubs.tcl
- * script. Any modifications to the function declarations below should be made
- * in the generic/tclInt.decls script.
- */
-
-typedef struct _Tcl_ResolvedVarInfo Tcl_ResolvedVarInfo;
-
-typedef int (Tcl_ResolveCompiledVarProc)(Tcl_Interp *interp, const char *name,
- int length, Tcl_Namespace *context, Tcl_ResolvedVarInfo **rPtr);
-
-typedef int (Tcl_ResolveVarProc)(Tcl_Interp *interp, const char *name,
- Tcl_Namespace *context, int flags, Tcl_Var *rPtr);
-
-typedef int (Tcl_ResolveCmdProc)(Tcl_Interp *interp, const char *name,
- Tcl_Namespace *context, int flags, Tcl_Command *rPtr);
-
-/* !BEGIN!: Do not edit below this line. */
-
-/*
- * Exported function declarations:
- */
-/* 36 */
-extern int TclGetLong(Tcl_Interp * interp, char *str,
- long *longPtr);
-/* 69 */
-extern char * TclpAlloc(unsigned int size);
-/* 74 */
-extern void TclpFree(char * ptr);
-/* 81 */
-extern char * TclpRealloc(char * ptr, unsigned int size);
-/* 113 */
-extern Tcl_Namespace * Tcl_CreateNamespace(Tcl_Interp * interp,
- char * name, ClientData clientData,
- Tcl_NamespaceDeleteProc * deleteProc);
-/* 114 */
-extern void Tcl_DeleteNamespace(Tcl_Namespace * nsPtr);
-/* 115 */
-extern int Tcl_Export(Tcl_Interp * interp,
- Tcl_Namespace * nsPtr, char * pattern,
- int resetListFirst);
-/* 116 */
-extern Tcl_Command Tcl_FindCommand(Tcl_Interp * interp,
- char * name, Tcl_Namespace * contextNsPtr,
- int flags);
-/* 117 */
-extern Tcl_Namespace * Tcl_FindNamespace(Tcl_Interp * interp,
- char * name, Tcl_Namespace * contextNsPtr,
- int flags);
-/* 120 */
-extern Tcl_Var Tcl_FindNamespaceVar(Tcl_Interp * interp, char * name,
- Tcl_Namespace * contextNsPtr, int flags);
-/* 124 */
-extern Tcl_Namespace * Tcl_GetCurrentNamespace(Tcl_Interp * interp);
-/* 125 */
-extern Tcl_Namespace * Tcl_GetGlobalNamespace(Tcl_Interp * interp);
-/* 128 */
-extern void Tcl_PopCallFrame(Tcl_Interp* interp);
-/* 129 */
-extern int Tcl_PushCallFrame(Tcl_Interp* interp,
- Tcl_CallFrame * framePtr,
- Tcl_Namespace * nsPtr, int isProcCallFrame);
-
-/* 131 */
-extern void Tcl_SetNamespaceResolvers(
- Tcl_Namespace *nsPtr,
- Tcl_ResolveCmdProc *cmdProc,
- Tcl_ResolveVarProc *varProc,
- Tcl_ResolveCompiledVarProc *compiledVarProc);
-
-typedef struct TclIntStubs {
- int magic;
- struct TclIntStubHooks *hooks;
-
- void *tclAccess; /* 0 */
- void *tclAccessDeleteProc; /* 1 */
- void *tclAccessInsertProc; /* 2 */
- void *tclAllocateFreeObjects; /* 3 */
- void *reserved4;
- void *tclCleanupChildren; /* 5 */
- void *tclCleanupCommand; /* 6 */
- void *tclCopyAndCollapse; /* 7 */
- void *tclCopyChannel; /* 8 */
- void *tclCreatePipeline; /* 9 */
- void *tclCreateProc; /* 10 */
- void *tclDeleteCompiledLocalVars; /* 11 */
- void *tclDeleteVars; /* 12 */
- void *tclDoGlob; /* 13 */
- void *tclDumpMemoryInfo; /* 14 */
- void *reserved15;
- void *tclExprFloatError; /* 16 */
- void *tclFileAttrsCmd; /* 17 */
- void *tclFileCopyCmd; /* 18 */
- void *tclFileDeleteCmd; /* 19 */
- void *tclFileMakeDirsCmd; /* 20 */
- void *tclFileRenameCmd; /* 21 */
- void *tclFindElement; /* 22 */
- void *tclFindProc; /* 23 */
- void *tclFormatInt; /* 24 */
- void *tclFreePackageInfo; /* 25 */
- void *reserved26;
- void *tclGetDate; /* 27 */
- void *tclpGetDefaultStdChannel; /* 28 */
- void *tclGetElementOfIndexedArray; /* 29 */
- void *reserved30;
- void *tclGetExtension; /* 31 */
- void *tclGetFrame; /* 32 */
- void *tclGetInterpProc; /* 33 */
- void *tclGetIntForIndex; /* 34 */
- void *tclGetIndexedScalar; /* 35 */
-
- int (*tclGetLong)(Tcl_Interp *interp, char *string, long *longPtr); /* 36 */
-
- void *tclGetLoadedPackages; /* 37 */
- void *tclGetNamespaceForQualName; /* 38 */
- void *tclGetObjInterpProc; /* 39 */
- void *tclGetOpenMode; /* 40 */
- void *tclGetOriginalCommand; /* 41 */
- void *tclpGetUserHome; /* 42 */
- void *tclGlobalInvoke; /* 43 */
- void *tclGuessPackageName; /* 44 */
- void *tclHideUnsafeCommands; /* 45 */
- void *tclInExit; /* 46 */
- void *tclIncrElementOfIndexedArray; /* 47 */
- void *tclIncrIndexedScalar; /* 48 */
- void *tclIncrVar2; /* 49 */
- void *tclInitCompiledLocals; /* 50 */
- void *tclInterpInit; /* 51 */
- void *tclInvoke; /* 52 */
- void *tclInvokeObjectCommand; /* 53 */
- void *tclInvokeStringCommand; /* 54 */
- void *tclIsProc; /* 55 */
- void *reserved56;
- void *reserved57;
- void *tclLookupVar; /* 58 */
- void *tclpMatchFiles; /* 59 */
- void *tclNeedSpace; /* 60 */
- void *tclNewProcBodyObj; /* 61 */
- void *tclObjCommandComplete; /* 62 */
- void *tclObjInterpProc; /* 63 */
- void *tclObjInvoke; /* 64 */
- void *tclObjInvokeGlobal; /* 65 */
- void *tclOpenFileChannelDeleteProc; /* 66 */
- void *tclOpenFileChannelInsertProc; /* 67 */
- void *tclpAccess; /* 68 */
- void *tclpAlloc; /* 69 */
- void *tclpCopyFile; /* 70 */
- void *tclpCopyDirectory; /* 71 */
- void *tclpCreateDirectory; /* 72 */
- void *tclpDeleteFile; /* 73 */
-
- void (*tclpFree)(char * ptr); /* 74 */
-
- void *tclpGetClicks; /* 75 */
- void *tclpGetSeconds; /* 76 */
- void *tclpGetTime; /* 77 */
- void *tclpGetTimeZone; /* 78 */
- void *tclpListVolumes; /* 79 */
- void *tclpOpenFileChannel; /* 80 */
-
- char *(*tclpRealloc)(char * ptr, unsigned int size); /* 81 */
-
- void *tclpRemoveDirectory; /* 82 */
- void *tclpRenameFile; /* 83 */
- void *reserved84;
- void *reserved85;
- void *reserved86;
- void *reserved87;
- void *tclPrecTraceProc; /* 88 */
- void *tclPreventAliasLoop; /* 89 */
- void *reserved90;
- void *tclProcCleanupProc; /* 91 */
- void *tclProcCompileProc; /* 92 */
- void *tclProcDeleteProc; /* 93 */
- void *tclProcInterpProc; /* 94 */
- void *tclpStat; /* 95 */
- void *tclRenameCommand; /* 96 */
- void *tclResetShadowedCmdRefs; /* 97 */
- void *tclServiceIdle; /* 98 */
- void *tclSetElementOfIndexedArray; /* 99 */
- void *tclSetIndexedScalar; /* 100 */
- void *tclSetPreInitScript; /* 101 */
- void *tclSetupEnv; /* 102 */
- void *tclSockGetPort; /* 103 */
- void *tclSockMinimumBuffers; /* 104 */
- void *tclStat; /* 105 */
- void *tclStatDeleteProc; /* 106 */
- void *tclStatInsertProc; /* 107 */
- void *tclTeardownNamespace; /* 108 */
- void *tclUpdateReturnInfo; /* 109 */
- void *reserved110;
- void *tcl_AddInterpResolvers; /* 111 */
- void *tcl_AppendExportList; /* 112 */
-
- Tcl_Namespace * (*tcl_CreateNamespace)(Tcl_Interp *interp, char *name,
- ClientData clientData, Tcl_NamespaceDeleteProc *deleteProc); /* 113 */
-
- void (*tcl_DeleteNamespace) (Tcl_Namespace * nsPtr); /* 114 */
-
- int (*tcl_Export) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, char *pattern,
- int resetListFirst); /* 115 */
-
- Tcl_Command (*tcl_FindCommand) (Tcl_Interp *interp, char *name,
- Tcl_Namespace *contextNsPtr, int flags); /* 116 */
-
- Tcl_Namespace *(*tcl_FindNamespace)(Tcl_Interp *interp, char *name,
- Tcl_Namespace *contextNsPtr, int flags); /* 117 */
-
- void *tcl_GetInterpResolvers; /* 118 */
- void *tcl_GetNamespaceResolvers; /* 119 */
-
- Tcl_Var (*tcl_FindNamespaceVar)(Tcl_Interp *interp, char *name,
- Tcl_Namespace *contextNsPtr, int flags); /* 120 */
-
- void *tcl_ForgetImport; /* 121 */
- void *tcl_GetCommandFromObj; /* 122 */
- void *tcl_GetCommandFullName; /* 123 */
-
- Tcl_Namespace *(*tcl_GetCurrentNamespace)(Tcl_Interp *interp); /* 124 */
-
- Tcl_Namespace *(*tcl_GetGlobalNamespace)(Tcl_Interp *interp); /* 125 */
-
- void *tcl_GetVariableFullName; /* 126 */
- void *tcl_Import; /* 127 */
-
- void (*tcl_PopCallFrame)(Tcl_Interp *interp); /* 128 */
-
- int (*tcl_PushCallFrame)(Tcl_Interp *interp, Tcl_CallFrame *framePtr,
- Tcl_Namespace *nsPtr, int isProcCallFrame); /* 129 */
-
- void *tcl_RemoveInterpResolvers; /* 130 */
-
- void (*tcl_SetNamespaceResolvers) (Tcl_Namespace *nsPtr,
- Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc,
- Tcl_ResolveCompiledVarProc *compiledVarProc); /* 131 */
-
- void *tclpHasSockets; /* 132 */
- void *tclpGetDate; /* 133 */
- void *tclpStrftime; /* 134 */
- void *tclpCheckStackSpace; /* 135 */
- void *reserved136;
- void *tclpChdir; /* 137 */
- void *tclGetEnv; /* 138 */
- void *tclpLoadFile; /* 139 */
- void *tclLooksLikeInt; /* 140 */
- void *tclpGetCwd; /* 141 */
- void *tclSetByteCodeFromAny; /* 142 */
- void *tclAddLiteralObj; /* 143 */
- void *tclHideLiteral; /* 144 */
- void *tclGetAuxDataType; /* 145 */
- void *tclHandleCreate; /* 146 */
- void *tclHandleFree; /* 147 */
- void *tclHandlePreserve; /* 148 */
- void *tclHandleRelease; /* 149 */
- void *tclRegAbout; /* 150 */
- void *tclRegExpRangeUniChar; /* 151 */
- void *tclSetLibraryPath; /* 152 */
- void *tclGetLibraryPath; /* 153 */
- void *reserved154;
- void *reserved155;
- void *tclRegError; /* 156 */
- void *tclVarTraceExists; /* 157 */
- void *tclSetStartupScriptFileName; /* 158 */
- void *tclGetStartupScriptFileName; /* 159 */
- void *tclpMatchFilesTypes; /* 160 */
- void *tclChannelTransform; /* 161 */
- void *tclChannelEventScriptInvoker; /* 162 */
- void *tclGetInstructionTable; /* 163 */
- void *tclExpandCodeArray; /* 164 */
-} TclIntStubs;
-
-extern TclIntStubs *tclIntStubsPtr;
-
-#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
-
-/*
- * Inline function declarations:
- */
-#ifndef TclGetLong
-#define TclGetLong \
- (tclIntStubsPtr->tclGetLong) /* 36 */
-#endif
-
-#ifndef TclpAlloc
-#define TclpAlloc \
- (tclIntStubsPtr->tclpAlloc) /* 69 */
-#endif
-
-#ifndef TclpFree
-#define TclpFree \
- (tclIntStubsPtr->tclpFree) /* 74 */
-#endif
-
-#ifndef TclpRealloc
-#define TclpRealloc \
- (tclIntStubsPtr->tclpRealloc) /* 81 */
-#endif
-
-#ifndef Tcl_CreateNamespace
-#define Tcl_CreateNamespace \
- (tclIntStubsPtr->tcl_CreateNamespace) /* 113 */
-#endif
-
-#ifndef Tcl_DeleteNamespace
-#define Tcl_DeleteNamespace \
- (tclIntStubsPtr->tcl_DeleteNamespace) /* 114 */
-#endif
-
-#ifndef Tcl_Export
-#define Tcl_Export \
- (tclIntStubsPtr->tcl_Export) /* 115 */
-#endif
-
-#ifndef Tcl_FindCommand
-#define Tcl_FindCommand \
- (tclIntStubsPtr->tcl_FindCommand) /* 116 */
-#endif
-
-#ifndef Tcl_FindNamespace
-#define Tcl_FindNamespace \
- (tclIntStubsPtr->tcl_FindNamespace) /* 117 */
-#endif
-
-#ifndef Tcl_FindNamespaceVar
-#define Tcl_FindNamespaceVar \
- (tclIntStubsPtr->tcl_FindNamespaceVar) /* 120 */
-#endif
-
-#ifndef Tcl_GetCurrentNamespace
-#define Tcl_GetCurrentNamespace \
- (tclIntStubsPtr->tcl_GetCurrentNamespace) /* 124 */
-#endif
-
-#ifndef Tcl_GetGlobalNamespace
-#define Tcl_GetGlobalNamespace \
- (tclIntStubsPtr->tcl_GetGlobalNamespace) /* 125 */
-#endif
-
-#ifndef Tcl_PopCallFrame
-#define Tcl_PopCallFrame \
- (tclIntStubsPtr->tcl_PopCallFrame) /* 128 */
-#endif
-
-#ifndef Tcl_PushCallFrame
-#define Tcl_PushCallFrame \
- (tclIntStubsPtr->tcl_PushCallFrame) /* 129 */
-#endif
-
-#ifndef Tcl_SetNamespaceResolvers
-#define Tcl_SetNamespaceResolvers \
- (tclIntStubsPtr->tcl_SetNamespaceResolvers) /* 131 */
-#endif
-
-#endif
-#endif /* _TCL_INT_DECLS_H */
diff --git a/blt3.0.1/src/tclIntPlatDecls.h b/blt3.0.1/src/tclIntPlatDecls.h
deleted file mode 100644
index 81535dd..0000000
--- a/blt3.0.1/src/tclIntPlatDecls.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * tclIntPlatDecls.h --
- *
- * This file contains the declarations for all platform dependent
- * unsupported functions that are exported by the TCL library. These
- * * interfaces are not guaranteed to remain the same between
- * versions. Use at your own risk.
- *
- * Copyright 2003-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This file was adapted from tclIntPlatDecls.h of the TCL library distribution.
- *
- * Copyright (c) 1998-1999 by Scriptics Corporation. All rights
- * reserved.
- *
- */
-
-#ifndef _TCLINTPLATDECLS
-#define _TCLINTPLATDECLS
-
-/*
- * WARNING: This file is automatically generated by the tools/genStubs.tcl
- * script. Any modifications to the function declarations below should be made
- * in the generic/tclInt.decls script.
- */
-
-/* !BEGIN!: Do not edit below this line. */
-
-/*
- * Exported function declarations:
- */
-
-#ifdef __WIN32__
-/* 0 */
-extern void TclWinConvertError(DWORD errCode);
-
-/* 4 */
-extern HINSTANCE TclWinGetTclInstance(void);
-#endif /* __WIN32__ */
-
-typedef struct TclIntPlatStubs {
- int magic;
- struct TclIntPlatStubHooks *hooks;
-
-#ifdef WIN32
- void (*tclWinConvertError)(DWORD errCode); /* 0 */
-#else
- void *hook0;
-#endif
- void *hook1;
- void *hook2;
- void *hook3;
-#ifdef WIN32
- HINSTANCE (*tclWinGetTclInstance)(void); /* 4 */
-#else
- void *hook4;
-#endif
- void *hook5;
- void *hook6;
- void *hook7;
- void *hook8;
- void *hook9;
- void *hook10;
- void *hook11;
- void *hook12;
- void *hook13;
- void *hook14;
- void *hook15;
- void *hook16;
- void *hook17;
- void *hook18;
- void *hook19;
- void *hook20;
- void *hook21;
- void *hook22;
- void *hook23;
- void *hook24;
- void *hook25;
-
-} TclIntPlatStubs;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern TclIntPlatStubs *tclIntPlatStubsPtr;
-#ifdef __cplusplus
-}
-#endif
-
-#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
-
-/*
- * Inline function declarations:
- */
-
-#ifdef __WIN32__
-#ifndef TclWinConvertError
-#define TclWinConvertError \
- (tclIntPlatStubsPtr->tclWinConvertError) /* 0 */
-#endif
-#ifndef TclWinGetTclInstance
-#define TclWinGetTclInstance \
- (tclIntPlatStubsPtr->tclWinGetTclInstance) /* 4 */
-#endif
-#endif /* __WIN32__ */
-
-#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
-
-/* !END!: Do not edit above this line. */
-
-#endif /* _TCLINTPLATDECLS */
diff --git a/blt3.0.1/src/tclInterp.h b/blt3.0.1/src/tclInterp.h
deleted file mode 100644
index af222e9..0000000
--- a/blt3.0.1/src/tclInterp.h
+++ /dev/null
@@ -1,272 +0,0 @@
-
-/*
- * tclInterp.h --
- *
- * Excerpts from tclInt.h. Used to examine interpreter internals.
- * Needed by the former parsing (bltParse.c) functions.
- *
- * Copyright 2003-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This file contains excerpts from tclInt.h of the TCL library distribution.
- *
- * Copyright (c) 1987-1993 The Regents of the University of
- * California.
- *
- * Copyright (c) 1994-1998 Sun Microsystems, Inc.
- *
- */
-
-/*
- *---------------------------------------------------------------------------
- * Data structures related to command parsing. These are used in
- * tclParse.c and its clients.
- *---------------------------------------------------------------------------
- */
-
-/*
- * The following data structure is used by various parsing procedures to hold
- * information about where to store the results of parsing (e.g. the
- * substituted contents of a quoted argument, or the result of a nested
- * command). At any given time, the space available for output is fixed, but
- * a procedure may be called to expand the space available if the current
- * space runs out.
- */
-typedef struct _ParseValue ParseValue;
-
-struct _ParseValue {
- char *buffer;
- char *next;
- char *end;
- void (*expandProc)(ParseValue *pvPtr, int needed);
- ClientData clientData;
-};
-
-
-/*
- * The definitions for the LiteralTable and LiteralEntry structures. Each
- * interpreter contains a LiteralTable. It is used to reduce the storage
- * needed for all the TCL objects that hold the literals of scripts compiled
- * by the interpreter. A literal's object is shared by all the ByteCodes that
- * refer to the literal. Each distinct literal has one LiteralEntry entry in
- * the LiteralTable. A literal table is a specialized hash table that is
- * indexed by the literal's string representation, which may contain null
- * characters.
- *
- * Note that we reduce the space needed for literals by sharing literal
- * objects both within a ByteCode (each ByteCode contains a local
- * LiteralTable) and across all an interpreter's ByteCodes (with the
- * interpreter's global LiteralTable).
- */
-
-typedef struct _LiteralEntry LiteralEntry;
-
-struct _LiteralEntry {
- LiteralEntry *nextPtr;
- Tcl_Obj *objPtr;
- int refCount;
-};
-
-typedef struct {
- LiteralEntry **buckets;
- LiteralEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
- int numBuckets;
- int numEntries;
- int rebuildSize;
- int mask;
-} LiteralTable;
-
-/*
- * The following structure defines for each TCL interpreter various
- * statistics-related information about the bytecode compiler and
- * interpreter's operation in that interpreter.
- */
-
-#ifdef TCL_COMPILE_STATS
-typedef struct {
- long numExecutions;
- long numCompilations;
- long numByteCodesFreed;
- long instructionCount[256];
- double totalSrcBytes;
- double totalByteCodeBytes;
- double currentSrcBytes;
- double currentByteCodeBytes;
- long srcCount[32];
- long byteCodeCount[32];
- long lifetimeCount[32];
- double currentInstBytes;
- double currentLitBytes;
- double currentExceptBytes;
- double currentAuxBytes;
- double currentCmdMapBytes;
- long numLiteralsCreated;
- double totalLitStringBytes;
- double currentLitStringBytes;
- long literalCount[32];
-} ByteCodeStats;
-
-#endif /* TCL_COMPILE_STATS */
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * Data structures and procedures related to TclHandles, which are a very
- * lightweight method of preserving enough information to determine if an
- * arbitrary malloc'd block has been deleted.
- *
- *---------------------------------------------------------------------------
- */
-
-typedef VOID **TclHandle;
-
-/*
- * The following fills in dummy types for structure refered to internally by
- * the TCL interpreter. Since we don't need the actual size of the
- * structures (they are only pointer references), we'll simply provide empty
- * opaque types.
- *
- */
-
-typedef struct ActiveCommandTrace ActiveCommandTrace;
-typedef struct ActiveInterpTrace ActiveInterpTrace;
-typedef struct _ActiveVarTrace ActiveVarTrace;
-typedef struct _CallFrame CallFrame;
-typedef struct _ExecEnv ExecEnv;
-typedef struct _Namespace Namespace;
-typedef struct _Proc Proc;
-typedef struct ResolverScheme ResolverScheme;
-typedef struct _TclRegexp TclRegexp;
-typedef struct _Trace Trace;
-
-/*
- *---------------------------------------------------------------------------
- *
- * This structure defines an interpreter, which is a collection of commands
- * plus other state information related to interpreting commands, such as
- * variable storage. Primary responsibility for this data structure is in
- * tclBasic.c, but almost every TCL source file uses something in here.
- *
- *---------------------------------------------------------------------------
- */
-
-
-typedef struct Interp {
- char *result;
- Tcl_FreeProc *freeProc;
- int errorLine;
-
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- struct TclStubs *stubTable;
- TclHandle handle;
-#else
- Tcl_Obj *objResultPtr;
-#endif /* >= 8.1.0 */
-
- Namespace *globalNsPtr;
-
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- Tcl_HashTable *hiddenCmdTablePtr;
- ClientData interpInfo;
-#endif /* >= 8.1.0 */
-
- Tcl_HashTable mathFuncTable;
- int numLevels;
- int maxNestingDepth;
- CallFrame *framePtr;
- CallFrame *varFramePtr;
- ActiveVarTrace *activeTracePtr;
- int returnCode;
- char *errorInfo;
- char *errorCode;
- char *appendResult;
- int appendAvl;
- int appendUsed;
-
-#if (_TCL_VERSION < _VERSION(8,1,0))
- char *patterns[5];
- int patLengths[5];
- regexp *regexps[5];
-#endif /* < 8.1.0 */
-
- Tcl_HashTable packageTable;
- char *packageUnknown;
- int cmdCount;
- int evalFlags;
- int termOffset;
-
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- LiteralTable literalTable;
-#endif
-
- int compileEpoch;
- Proc *compiledProcPtr;
- ResolverScheme *resolverPtr;
-
-#if (_TCL_VERSION >= _VERSION(8,4,0))
- Tcl_Obj *scriptFile;
-#else
- char *scriptFile;
-#endif /* >= 8.4.0 */
-
- int flags;
- long randSeed;
- Trace *tracePtr;
- Tcl_HashTable *assocData;
- struct ExecEnv *execEnvPtr;
- Tcl_Obj *emptyObjPtr;
- char resultSpace[TCL_RESULT_SIZE+1];
-
-#if (_TCL_VERSION >= _VERSION(8,1,0))
- Tcl_Obj *objResultPtr;
- Tcl_ThreadId threadId;
-#endif /* >= 8.1.0 */
-
-#if (_TCL_VERSION >= _VERSION(8,4,0))
- ActiveCommandTrace *activeCmdTracePtr;
- ActiveInterpTrace *activeInterpTracePtr;
- int tracesForbiddingInline;
-#endif /* >= 8.4.0 */
-
-#if (_TCL_VERSION >= _VERSION(8,4,1))
-#ifdef TCL_COMPILE_STATS
- ByteCodeStats stats;
-#endif /* TCL_COMPILE_STATS */
-#endif /* >= 8.4.1 */
-
-} Interp;
-
-/*
- * EvalFlag bits for Interp structures:
- *
- * TCL_BRACKET_TERM 1 means that the current script is terminated by
- * a close bracket rather than the end of the string.
- * TCL_ALLOW_EXCEPTIONS 1 means it's OK for the script to terminate with
- * a code other than TCL_OK or TCL_ERROR; 0 means
- * codes other than these should be turned into errors.
- */
-
-#define TCL_BRACKET_TERM 1
-#define TCL_ALLOW_EXCEPTIONS 4
diff --git a/blt3.0.1/src/tkButton.c b/blt3.0.1/src/tkButton.c
deleted file mode 100644
index dcf5302..0000000
--- a/blt3.0.1/src/tkButton.c
+++ /dev/null
@@ -1,2189 +0,0 @@
-
-/*
- * tkButton.c --
- *
- * This module implements a collection of button-like
- * widgets for the Tk toolkit. The widgets implemented
- * include labels, buttons, check buttons, and radio
- * buttons.
- *
- * Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994-1995 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * SCCS: @(#) tkButton.c 1.128 96/03/01 17:34:49
- */
-
-#include "bltInt.h"
-#ifndef NO_TKBUTTON
-#include "bltBgStyle.h"
-
-#include "bltFont.h"
-#include "bltText.h"
-#include "bltImage.h"
-#include "bltPicture.h"
-#include "bltPainter.h"
-
-#define GAP 4
-
-/*
- * The definitions below provide symbolic names for the default colors.
- * NORMAL_BG - Normal background color.
- * ACTIVE_BG - Background color when widget is active.
- * SELECT_BG - Background color for selected text.
- * TROUGH - Background color for troughs in scales and scrollbars.
- * INDICATOR - Color for indicator when button is selected.
- * DISABLED - Foreground color when widget is disabled.
- */
-
-#define NORMAL_BG "#d9d9d9"
-#define ACTIVE_BG "#ececec"
-#define SELECT_BG "#c3c3c3"
-#define TROUGH "#c3c3c3"
-#define INDICATOR "#b03060"
-#define DISABLED "#a3a3a3"
-
-#define DEF_BUTTON_ANCHOR "center"
-#define DEF_BUTTON_ACTIVE_BACKGROUND STD_ACTIVE_BACKGROUND
-#define DEF_BUTTON_ACTIVE_BG_MONO RGB_BLACK
-#define DEF_BUTTON_ACTIVE_FOREGROUND RGB_BLACK
-#define DEF_BUTTON_ACTIVE_FG_MONO RGB_WHITE
-#define DEF_BUTTON_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_BUTTON_BG_MONO RGB_WHITE
-#define DEF_BUTTON_BITMAP ""
-#define DEF_BUTTON_BORDERWIDTH "2"
-#define DEF_PUSHBUTTON_BORDERWIDTH "1"
-#define DEF_BUTTON_CURSOR ""
-#define DEF_BUTTON_COMMAND ""
-#define DEF_BUTTON_COMPOUND "none"
-#define DEF_BUTTON_DEFAULT "disabled"
-#define DEF_BUTTON_DISABLED_FOREGROUND STD_DISABLED_FOREGROUND
-#define DEF_BUTTON_DISABLED_FG_MONO ""
-#define DEF_BUTTON_FG RGB_BLACK
-#define DEF_BUTTON_FONT STD_FONT
-#define DEF_BUTTON_HEIGHT "0"
-#define DEF_BUTTON_HIGHLIGHT_BG STD_NORMAL_BACKGROUND
-#define DEF_BUTTON_HIGHLIGHT RGB_BLACK
-#define DEF_LABEL_HIGHLIGHT_WIDTH "0"
-#define DEF_PUSHBUTTON_HIGHLIGHT_WIDTH "0"
-#define DEF_BUTTON_HIGHLIGHT_WIDTH "2"
-#define DEF_BUTTON_IMAGE (char *) NULL
-#define DEF_BUTTON_INDICATOR "1"
-#define DEF_BUTTON_JUSTIFY "center"
-#define DEF_BUTTON_OFF_VALUE "0"
-#define DEF_BUTTON_ON_VALUE "1"
-#define DEF_BUTTON_ONIMAGE (char *)NULL
-#define DEF_BUTTON_OFFIMAGE (char *)NULL
-#define DEF_BUTTON_OVER_RELIEF "raised"
-#define DEF_BUTTON_PADX "3m"
-#define DEF_LABCHKRAD_PADX "1"
-#define DEF_BUTTON_PADY "1m"
-#define DEF_LABCHKRAD_PADY "1"
-
-#define DEF_PUSHBUTTON_PADX "2"
-#define DEF_PUSHBUTTON_PADY "2"
-
-#define DEF_BUTTON_RELIEF "raised"
-#define DEF_BUTTON_REPEAT_DELAY "0"
-#define DEF_LABCHKRAD_RELIEF "flat"
-#define DEF_LABCHKRAD_OVER_RELIEF "flat"
-#define DEF_BUTTON_SELECT_BACKGROUND RGB_WHITE
-#define DEF_BUTTON_SELECT_FOREGROUND STD_INDICATOR_COLOR
-#define DEF_BUTTON_SELECT_MONO RGB_BLACK
-#define DEF_BUTTON_SELECT_IMAGE (char *)NULL
-#define DEF_BUTTON_STATE "normal"
-#define DEF_LABEL_TAKE_FOCUS "0"
-#define DEF_BUTTON_TAKE_FOCUS (char *) NULL
-#define DEF_BUTTON_TEXT ""
-#define DEF_BUTTON_TEXT_VARIABLE ""
-#define DEF_BUTTON_UNDERLINE "-1"
-#define DEF_BUTTON_VALUE ""
-#define DEF_BUTTON_WIDTH "0"
-#define DEF_BUTTON_WRAP_LENGTH "0"
-#define DEF_RADIOBUTTON_VARIABLE "selectedButton"
-#define DEF_CHECKBUTTON_VARIABLE ""
-
-/*
- * A data structure of the following type is kept for each
- * widget managed by this file:
- */
-
-typedef struct {
- Tk_Window tkwin; /* Window that embodies the button. NULL
- * means that the window has been destroyed. */
- Display *display; /* Display containing widget. Needed to
- * free up resources after tkwin is gone. */
- Tcl_Interp *interp; /* Interpreter associated with button. */
- Tcl_Command widgetCmd; /* Token for button's widget command. */
- int type; /* Type of widget: restricts operations
- * that may be performed on widget. See
- * below for possible values. */
-
- /*
- * Information about what's in the button.
- */
-
- const char *text; /* Text to display in button (malloc'ed)
- * or NULL. */
- int numChars; /* # of characters in text. */
- int underline; /* Index of character to underline. < 0 means
- * don't underline anything. */
- const char *textVarName; /* Name of variable (malloc'ed) or NULL.
- * If non-NULL, button displays the contents
- * of this variable. */
- Pixmap bitmap; /* Bitmap to display or None. If not None
- * then text and textVar are ignored. */
- Tk_Image image; /* Image to display in window, or NULL if
- * none. */
- Tk_Image selectImage; /* Image to display in window when selected,
- * or NULL if none. Ignored if image is
- * NULL. */
-
- /*
- * Information used when displaying widget:
- */
-
- int state; /* State of button for display purposes:
- * normal, active, or disabled. */
- Blt_Background normalBg; /* Structure used to draw 3-D
- * border and background when window
- * isn't active. NULL means no such
- * border exists. */
- Blt_Background activeBg; /* Structure used to draw 3-D
- * border and background when window
- * is active. NULL means no such
- * border exists. */
- int borderWidth; /* Width of border. */
- int relief; /* 3-d effect: TK_RELIEF_RAISED, etc. */
- int overRelief; /* Value of -overrelief option: specifies a 3-d
- * effect for the border, such as
- * TK_RELIEF_RAISED, to be used when the mouse
- * is over the button. */
- int highlightWidth; /* Width in pixels of highlight to draw
- * around widget when it has the focus.
- * <= 0 means don't draw a highlight. */
- XColor *highlightBgColorPtr;
- /* Color for drawing traversal highlight
- * area when highlight is off. */
- XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
- int inset; /* Total width of all borders, including
- * traversal highlight and 3-D border.
- * Indicates how much interior stuff must
- * be offset from outside edges to leave
- * room for borders. */
- Blt_Font font; /* Information about text font, or NULL. */
- XColor *normalFg; /* Foreground color in normal mode. */
- XColor *activeFg; /* Foreground color in active mode. NULL
- * means use normalFg instead. */
- XColor *disabledFg; /* Foreground color when disabled. NULL
- * means use normalFg with a 50% stipple
- * instead. */
- GC normalTextGC; /* GC for drawing text in normal mode. Also
- * used to copy from off-screen pixmap onto
- * screen. */
- GC activeTextGC; /* GC for drawing text in active mode (NULL
- * means use normalTextGC). */
- Pixmap gray; /* Pixmap for displaying disabled text if
- * disabledFg is NULL. */
- GC disabledGC; /* Used to produce disabled effect. If
- * disabledFg isn't NULL, this GC is used to
- * draw button text or icon. Otherwise
- * text or icon is drawn with normalGC and
- * this GC is used to stipple background
- * across it. For labels this is None. */
- GC copyGC; /* Used for copying information from an
- * off-screen pixmap to the screen. */
- const char *widthString; /* Value of -width option. Malloc'ed. */
- const char *heightString; /* Value of -height option. Malloc'ed. */
- int width, height; /* If > 0, these specify dimensions to request
- * for window, in characters for text and in
- * pixels for bitmaps. In this case the actual
- * size of the text string or bitmap is
- * ignored in computing desired window size. */
- int wrapLength; /* Line length (in pixels) at which to wrap
- * onto next line. <= 0 means don't wrap
- * except at newlines. */
- int xPad, yPad; /* Extra space around text (pixels to leave
- * on each side). Ignored for bitmaps and
- * images. */
- Tk_Anchor anchor; /* Where text/bitmap should be displayed
- * inside button region. */
- Tk_Justify justify; /* Justification to use for multi-line text. */
- int indicatorOn; /* True means draw indicator, false means
- * don't draw it. */
- Blt_Background selectBg; /* For drawing indicator background, or perhaps
- * widget background, when selected. */
- XColor *selectFg; /* For drawing indicator background, or perhaps
- * widget background, when selected. */
- int textWidth; /* Width needed to display text as requested,
- * in pixels. */
- int textHeight; /* Height needed to display text as requested,
- * in pixels. */
- Tk_TextLayout textLayout; /* Saved text layout information. */
- int indicatorSpace; /* Horizontal space (in pixels) allocated for
- * display of indicator. */
- int indicatorDiameter; /* Diameter of indicator, in pixels. */
-
- int defaultState; /* Used in 8.0 (not here) */
-
- /*
- * For check and radio buttons, the fields below are used
- * to manage the variable indicating the button's state.
- */
-
- const char *selVarName; /* Name of variable used to control selected
- * state of button. Malloc'ed (if
- * not NULL). */
- const char *onValue; /* Value to store in variable when
- * this button is selected. Malloc'ed (if
- * not NULL). */
- const char *offValue; /* Value to store in variable when this
- * button isn't selected. Malloc'ed
- * (if not NULL). Valid only for check
- * buttons. */
-
- /*
- * Miscellaneous information:
- */
-
- Tk_Cursor cursor; /* Current cursor for window, or None. */
- const char *takeFocus; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
- const char *command; /* Command to execute when button is
- * invoked; valid for buttons only.
- * If not NULL, it's malloc-ed. */
- const char *compound; /* Value of -compound option; specifies whether
- * the button should show both an image and
- * text, and, if so, how. */
- int repeatDelay; /* Value of -repeatdelay option; specifies
- * the number of ms after which the button will
- * start to auto-repeat its command. */
- int repeatInterval; /* Value of -repeatinterval option; specifies
- * the number of ms between auto-repeat
- * invocataions of the button command. */
- int flags; /* Various flags; see below for
- * definitions. */
- Blt_Picture selectedPicture;
- Blt_Picture normalPicture;
- Blt_Picture disabledPicture;
-
-} Button;
-
-/*
- * Possible "type" values for buttons. These are the kinds of
- * widgets supported by this file. The ordering of the type
- * numbers is significant: greater means more features and is
- * used in the code.
- */
-
-#define TYPE_LABEL 0
-#define TYPE_BUTTON 1
-#define TYPE_PUSH_BUTTON 2
-#define TYPE_CHECK_BUTTON 3
-#define TYPE_RADIO_BUTTON 4
-
-/*
- * Class names for buttons, indexed by one of the type values above.
- */
-
-static const char *classNames[] = {
- "TkLabel",
- "TkButton",
- "TkPushbutton",
- "TkCheckbutton",
- "TkRadiobutton",
-};
-
-/*
- * Flag bits for buttons:
- *
- * REDRAW_PENDING: Non-zero means a DoWhenIdle handler
- * has already been queued to redraw
- * this window.
- * SELECTED: Non-zero means this button is selected,
- * so special highlight should be drawn.
- * GOT_FOCUS: Non-zero means this button currently
- * has the input focus.
- */
-
-#define REDRAW_PENDING 1
-#define SELECTED 2
-#define GOT_FOCUS 4
-
-/*
- * Mask values used to selectively enable entries in the
- * configuration specs:
- */
-
-#define LABEL_MASK BLT_CONFIG_USER_BIT
-#define BUTTON_MASK BLT_CONFIG_USER_BIT << 1
-#define PUSH_BUTTON_MASK BLT_CONFIG_USER_BIT << 2
-#define CHECK_BUTTON_MASK BLT_CONFIG_USER_BIT << 3
-#define RADIO_BUTTON_MASK BLT_CONFIG_USER_BIT << 4
-#define ALL_MASK (LABEL_MASK | BUTTON_MASK \
- | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK)
-
-#define ALL_BUTTONS (BUTTON_MASK | CHECK_BUTTON_MASK | \
- RADIO_BUTTON_MASK | PUSH_BUTTON_MASK)
-
-static int configFlags[] = {
- LABEL_MASK,
- BUTTON_MASK,
- PUSH_BUTTON_MASK,
- CHECK_BUTTON_MASK,
- RADIO_BUTTON_MASK
-};
-
-static Blt_OptionParseProc ObjToImageProc;
-static Blt_OptionPrintProc ImageToObjProc;
-static Blt_OptionFreeProc FreeImageProc;
-static Blt_CustomOption imageOption =
-{
- ObjToImageProc, ImageToObjProc, FreeImageProc, (ClientData)0
-};
-
-/*
- * Information used for parsing configuration specs:
- */
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground", "Foreground",
- DEF_BUTTON_ACTIVE_BACKGROUND, Blt_Offset(Button, activeBg),
- BUTTON_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK |
- BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_BACKGROUND, "-activebackground", "activeBackground", "Foreground",
- DEF_BUTTON_ACTIVE_BG_MONO, Blt_Offset(Button, activeBg),
- BUTTON_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK
- | BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground", "Background",
- DEF_BUTTON_ACTIVE_FOREGROUND, Blt_Offset(Button, activeFg),
- BUTTON_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK
- | BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground", "Background",
- DEF_BUTTON_ACTIVE_FG_MONO, Blt_Offset(Button, activeFg),
- BUTTON_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK
- | BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor",
- DEF_BUTTON_ANCHOR, Blt_Offset(Button, anchor), ALL_MASK},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_BUTTON_BACKGROUND, Blt_Offset(Button, normalBg),
- ALL_MASK | BLT_CONFIG_COLOR_ONLY},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_BUTTON_BG_MONO, Blt_Offset(Button, normalBg),
- ALL_MASK | BLT_CONFIG_MONO_ONLY},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL,
- (char *)NULL, 0, ALL_MASK},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL,
- (char *)NULL, 0, ALL_MASK},
- {BLT_CONFIG_BITMAP, "-bitmap", "bitmap", "Bitmap",
- DEF_BUTTON_BITMAP, Blt_Offset(Button, bitmap),
- ALL_MASK | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_BUTTON_BORDERWIDTH, Blt_Offset(Button, borderWidth),
- BUTTON_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | LABEL_MASK},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_PUSHBUTTON_BORDERWIDTH, Blt_Offset(Button, borderWidth),
- PUSH_BUTTON_MASK},
- {BLT_CONFIG_STRING, "-command", "command", "Command",
- DEF_BUTTON_COMMAND, Blt_Offset(Button, command),
- BUTTON_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK |
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-compound", "compound", "Compound",
- DEF_BUTTON_COMPOUND, Blt_Offset(Button, compound),
- ALL_MASK | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_BUTTON_CURSOR, Blt_Offset(Button, cursor),
- ALL_MASK | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STATE, "-default", "default", "Default",
- DEF_BUTTON_DEFAULT, Blt_Offset(Button, defaultState), BUTTON_MASK},
- {BLT_CONFIG_COLOR, "-disabledforeground", "disabledForeground",
- "DisabledForeground", DEF_BUTTON_DISABLED_FOREGROUND,
- Blt_Offset(Button, disabledFg), BUTTON_MASK | CHECK_BUTTON_MASK |
- RADIO_BUTTON_MASK | PUSH_BUTTON_MASK | BLT_CONFIG_COLOR_ONLY |
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-disabledforeground", "disabledForeground",
- "DisabledForeground", DEF_BUTTON_DISABLED_FG_MONO,
- Blt_Offset(Button, disabledFg), BUTTON_MASK | CHECK_BUTTON_MASK
- | RADIO_BUTTON_MASK | BLT_CONFIG_MONO_ONLY | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL,
- (char *)NULL, 0, ALL_MASK},
- {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_BUTTON_FONT,
- Blt_Offset(Button, font), ALL_MASK},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_BUTTON_FG, Blt_Offset(Button, normalFg), ALL_MASK},
- {BLT_CONFIG_STRING, "-height", "height", "Height",
- DEF_BUTTON_HEIGHT, Blt_Offset(Button, heightString), ALL_MASK},
- {BLT_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG,
- Blt_Offset(Button, highlightBgColorPtr), ALL_MASK},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_BUTTON_HIGHLIGHT, Blt_Offset(Button, highlightColorPtr),
- ALL_MASK},
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness",
- DEF_LABEL_HIGHLIGHT_WIDTH, Blt_Offset(Button, highlightWidth),
- PUSH_BUTTON_MASK | LABEL_MASK},
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness",
- DEF_BUTTON_HIGHLIGHT_WIDTH, Blt_Offset(Button, highlightWidth),
- BUTTON_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK},
- {BLT_CONFIG_CUSTOM, "-image", "image", "Image", DEF_BUTTON_IMAGE,
- Blt_Offset(Button, image), ALL_MASK | BLT_CONFIG_NULL_OK, &imageOption},
- {BLT_CONFIG_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn",
- DEF_BUTTON_INDICATOR, Blt_Offset(Button, indicatorOn),
- CHECK_BUTTON_MASK | RADIO_BUTTON_MASK},
- {BLT_CONFIG_JUSTIFY, "-justify", "justify", "Justify",
- DEF_BUTTON_JUSTIFY, Blt_Offset(Button, justify), ALL_MASK},
- {BLT_CONFIG_SYNONYM, "-offimage", "image", (char *)NULL,
- (char *)NULL, 0, CHECK_BUTTON_MASK | PUSH_BUTTON_MASK},
- {BLT_CONFIG_STRING, "-offvalue", "offValue", "Value",
- DEF_BUTTON_OFF_VALUE, Blt_Offset(Button, offValue),
- CHECK_BUTTON_MASK | PUSH_BUTTON_MASK },
- {BLT_CONFIG_STRING, "-onvalue", "onValue", "Value",
- DEF_BUTTON_ON_VALUE, Blt_Offset(Button, onValue),
- CHECK_BUTTON_MASK | PUSH_BUTTON_MASK | BLT_CONFIG_NULL_OK },
- {BLT_CONFIG_SYNONYM, "-onimage", "selectImage", (char *)NULL,
- (char *)NULL, 0, CHECK_BUTTON_MASK | PUSH_BUTTON_MASK},
- {BLT_CONFIG_RELIEF, "-overrelief", "overRelief", "OverRelief",
- DEF_BUTTON_OVER_RELIEF, Blt_Offset(Button, overRelief),
- BUTTON_MASK | PUSH_BUTTON_MASK},
- {BLT_CONFIG_RELIEF, "-overrelief", "overRelief", "OverRelief",
- DEF_LABCHKRAD_OVER_RELIEF, Blt_Offset(Button, overRelief),
- LABEL_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK},
- {BLT_CONFIG_PIXELS_NNEG, "-padx", "padX", "Pad",
- DEF_BUTTON_PADX, Blt_Offset(Button, xPad), BUTTON_MASK},
- {BLT_CONFIG_PIXELS_NNEG, "-padx", "padX", "Pad",
- DEF_LABCHKRAD_PADX, Blt_Offset(Button, xPad),
- LABEL_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK},
- {BLT_CONFIG_PIXELS_NNEG, "-padx", "padX", "Pad",
- DEF_PUSHBUTTON_PADX, Blt_Offset(Button, xPad), PUSH_BUTTON_MASK},
- {BLT_CONFIG_PIXELS_NNEG, "-pady", "padY", "Pad",
- DEF_BUTTON_PADY, Blt_Offset(Button, yPad), BUTTON_MASK},
- {BLT_CONFIG_PIXELS_NNEG, "-pady", "padY", "Pad",
- DEF_LABCHKRAD_PADY, Blt_Offset(Button, yPad),
- LABEL_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK},
- {BLT_CONFIG_PIXELS_NNEG, "-pady", "padY", "Pad",
- DEF_PUSHBUTTON_PADY, Blt_Offset(Button, yPad), PUSH_BUTTON_MASK},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_BUTTON_RELIEF, Blt_Offset(Button, relief),
- BUTTON_MASK | PUSH_BUTTON_MASK},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_LABCHKRAD_RELIEF, Blt_Offset(Button, relief),
- LABEL_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK},
- {BLT_CONFIG_INT, "-repeatdelay", "repeatDelay", "RepeatDelay",
- DEF_BUTTON_REPEAT_DELAY, Blt_Offset(Button, repeatDelay),
- BUTTON_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK},
- {BLT_CONFIG_COLOR, "-selectforeground", "selectForeground",
- "SelectForeground", DEF_BUTTON_SELECT_FOREGROUND,
- Blt_Offset(Button, selectFg),
- CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK |
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BACKGROUND, "-selectbackground", "selectBackground",
- "SelectBackground", DEF_BUTTON_SELECT_BACKGROUND,
- Blt_Offset(Button, selectBg),
- CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK |
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-selectcolor", "selectBackground", (char *)NULL,
- (char *)NULL, 0,
- CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK |
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_CUSTOM, "-selectimage", "selectImage", "SelectImage",
- DEF_BUTTON_SELECT_IMAGE, Blt_Offset(Button, selectImage),
- CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK |
- BLT_CONFIG_NULL_OK, &imageOption},
- {BLT_CONFIG_STATE, "-state", "state", "State",
- DEF_BUTTON_STATE, Blt_Offset(Button, state),
- BUTTON_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK},
- {BLT_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_LABEL_TAKE_FOCUS, Blt_Offset(Button, takeFocus),
- LABEL_MASK | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_BUTTON_TAKE_FOCUS, Blt_Offset(Button, takeFocus),
- BUTTON_MASK | CHECK_BUTTON_MASK | RADIO_BUTTON_MASK | PUSH_BUTTON_MASK |
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-text", "text", "Text",
- DEF_BUTTON_TEXT, Blt_Offset(Button, text), ALL_MASK},
- {BLT_CONFIG_STRING, "-textvariable", "textVariable", "Variable",
- DEF_BUTTON_TEXT_VARIABLE, Blt_Offset(Button, textVarName),
- ALL_MASK | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_INT, "-underline", "underline", "Underline",
- DEF_BUTTON_UNDERLINE, Blt_Offset(Button, underline), ALL_MASK},
- {BLT_CONFIG_STRING, "-value", "value", "Value",
- DEF_BUTTON_VALUE, Blt_Offset(Button, onValue),
- RADIO_BUTTON_MASK},
- {BLT_CONFIG_STRING, "-variable", "variable", "Variable",
- DEF_RADIOBUTTON_VARIABLE, Blt_Offset(Button, selVarName),
- RADIO_BUTTON_MASK},
- {BLT_CONFIG_STRING, "-variable", "variable", "Variable",
- DEF_CHECKBUTTON_VARIABLE, Blt_Offset(Button, selVarName),
- CHECK_BUTTON_MASK | PUSH_BUTTON_MASK | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-width", "width", "Width",
- DEF_BUTTON_WIDTH, Blt_Offset(Button, widthString), ALL_MASK},
- {BLT_CONFIG_PIXELS_NNEG, "-wraplength", "wrapLength", "WrapLength",
- DEF_BUTTON_WRAP_LENGTH, Blt_Offset(Button, wrapLength), ALL_MASK},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-/*
- * String to print out in error messages, identifying options for
- * widget commands for different types of labels or buttons:
- */
-
-static const char *optionStrings[] =
-{
- "cget or configure",
- "cget, configure, flash, or invoke",
- "cget, configure, deselect, flash, invoke, select, or toggle",
- "cget, configure, deselect, flash, invoke, or select"
-};
-
-/*
- * Forward declarations for procedures defined later in this file:
- */
-static void ButtonCmdDeletedProc _ANSI_ARGS_((ClientData clientData));
-static int ButtonCreate _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const *objv, int type));
-static void ButtonEventProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static char *ButtonTextVarProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, const char *name1, const char *name2,
- int flags));
-static char *ButtonVarProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, const char *name1, const char *name2,
- int flags));
-static int ButtonWidgetCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const *objv));
-static void ComputeButtonGeometry _ANSI_ARGS_((Button *butPtr));
-static int ConfigureButton _ANSI_ARGS_((Tcl_Interp *interp,
- Button *butPtr, int objc, Tcl_Obj *const *objv,
- int flags));
-static void DestroyButton _ANSI_ARGS_((Button *butPtr));
-static void DisplayButton _ANSI_ARGS_((ClientData clientData));
-static int InvokeButton _ANSI_ARGS_((Button *butPtr));
-
-static Tcl_ObjCmdProc ButtonCmd, LabelCmd, CheckbuttonCmd, RadiobuttonCmd;
-
-#ifndef USE_TK_STUBS
-BLT_EXTERN int TkCopyAndGlobalEval _ANSI_ARGS_((Tcl_Interp *interp, char *script));
-
-BLT_EXTERN void TkComputeAnchor _ANSI_ARGS_((Tk_Anchor anchor, Tk_Window tkwin,
- int xPad, int yPad, int innerWidth, int innerHeight, int *xPtr,
- int *yPtr));
-#endif
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImageChangedProc
- *
- * Results:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-/* ARGSUSED */
-static void
-ImageChangedProc(ClientData clientData, int x, int y, int width, int height,
- int imageWidth, int imageHeight)
-{
- Button *butPtr = clientData;
-
- if (butPtr->tkwin != NULL) {
- ComputeButtonGeometry(butPtr);
- if (Tk_IsMapped(butPtr->tkwin) && !(butPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayButton, (ClientData)butPtr);
- butPtr->flags |= REDRAW_PENDING;
- }
- }
-}
-
-
-/*ARGSUSED*/
-static void
-FreeImageProc(ClientData clientData, Display *display, char *widgRec,
- int offset)
-{
- Tk_Image *imagePtr = (Tk_Image *)(widgRec + offset);
-
- if (*imagePtr != NULL) {
- Tk_FreeImage(*imagePtr);
- *imagePtr = NULL;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ObjToImageProc --
- *
- * Given an image name, get the Tk image associated with it.
- *
- * Results:
- * The return value is a standard TCL result.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static int
-ObjToImageProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Interpreter to send results back
- * to */
- Tk_Window tkwin, /* Not used. */
- Tcl_Obj *objPtr, /* String representation of value. */
- char *widgRec, /* Widget record. */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Button *butPtr = (Button *)(widgRec);
- Tk_Image *imagePtr = (Tk_Image *)(widgRec + offset);
- Tk_Image image;
-
- image = Tk_GetImage(interp, butPtr->tkwin, Tcl_GetString(objPtr),
- ImageChangedProc, butPtr);
- if (image == NULL) {
- return TCL_ERROR;
- }
- *imagePtr = image;
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ImageToObjProc --
- *
- * Convert the image name into a string Tcl_Obj.
- *
- * Results:
- * The string representation of the image is returned.
- *
- *---------------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static Tcl_Obj *
-ImageToObjProc(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp,
- Tk_Window tkwin, /* Not used. */
- char *widgRec, /* Widget record */
- int offset, /* Offset to field in structure */
- int flags)
-{
- Tk_Image image = *(Tk_Image *)(widgRec + offset);
-
- if (image == NULL) {
- return Tcl_NewStringObj("", -1);
- }
- return Tcl_NewStringObj(Blt_Image_Name(image), -1);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonCmd, CheckbuttonCmd, LabelCmd, RadiobuttonCmd, PushbuttonCmd --
- *
- * These procedures are invoked to process the "button", "label",
- * "radiobutton", "checkbutton", and "pushbutton" TCL commands.
- * See the user documentation for details on what they do.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation. These procedures are just wrappers;
- * they call ButtonCreate to do all of the real work.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-ButtonCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- return ButtonCreate(clientData, interp, objc, objv, TYPE_BUTTON);
-}
-
-static int
-CheckbuttonCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- return ButtonCreate(clientData, interp, objc, objv, TYPE_CHECK_BUTTON);
-}
-
-static int
-LabelCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- return ButtonCreate(clientData, interp, objc, objv, TYPE_LABEL);
-}
-
-static int
-RadiobuttonCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- return ButtonCreate(clientData, interp, objc, objv, TYPE_RADIO_BUTTON);
-}
-
-static int
-PushbuttonCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- return ButtonCreate(clientData, interp, objc, objv, TYPE_PUSH_BUTTON);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonCreate --
- *
- * This procedure does all the real work of implementing the
- * "button", "label", "radiobutton", and "checkbutton" Tcl
- * commands. See the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-/*ARGSUSED*/
-static int
-ButtonCreate(
- ClientData clientData, /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv, /* Argument strings. */
- int type) /* Type of button to create: TYPE_LABEL,
- * TYPE_BUTTON, TYPE_CHECK_BUTTON, or
- * TYPE_RADIO_BUTTON. */
-{
- Button *butPtr;
- Tcl_CmdInfo cmdInfo;
- Tk_Window tkwin;
- char *path;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?options?\"", (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * First time in this interpreter, set up procs and initialize various
- * bindings for the widget. If the proc doesn't already exist, source it
- * from "$blt_library/comboentry.tcl". We've deferred sourcing this file
- * until now so that the user could reset the variable $blt_library from
- * within her script.
- */
- if (!Tcl_GetCommandInfo(interp, "::blt::Button::Up", &cmdInfo)) {
- static char cmd[] = "source [file join $blt_library pushbutton.tcl]";
- if (Tcl_GlobalEval(interp, cmd) != TCL_OK) {
- char info[200];
- sprintf_s(info, 200, "\n (while loading bindings for %.50s)",
- Tcl_GetString(objv[0]));
- Tcl_AddErrorInfo(interp, info);
- return TCL_ERROR;
- }
- }
- /*
- * Create the new window.
- */
-
- path = Tcl_GetString(objv[1]);
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), path,
- (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- /*
- * Initialize the data structure for the button.
- */
-
- butPtr = Blt_AssertCalloc(1, sizeof(Button));
- butPtr->tkwin = tkwin;
- butPtr->display = Tk_Display(tkwin);
- butPtr->widgetCmd = Tcl_CreateObjCommand(interp, Tk_PathName(butPtr->tkwin),
- ButtonWidgetCmd, butPtr, ButtonCmdDeletedProc);
-
- butPtr->interp = interp;
- butPtr->type = type;
- butPtr->underline = -1;
- butPtr->state = STATE_NORMAL;
- butPtr->relief = TK_RELIEF_FLAT;
- butPtr->anchor = TK_ANCHOR_CENTER;
- butPtr->justify = TK_JUSTIFY_CENTER;
- butPtr->defaultState = STATE_DISABLED;
- butPtr->overRelief = TK_RELIEF_RAISED;
-
-
- Tk_SetClass(tkwin, classNames[type]);
- Tk_CreateEventHandler(butPtr->tkwin,
- ExposureMask | StructureNotifyMask | FocusChangeMask,
- ButtonEventProc, butPtr);
- if (ConfigureButton(interp, butPtr, objc - 2, objv + 2,
- configFlags[type]) != TCL_OK) {
- Tk_DestroyWindow(butPtr->tkwin);
- return TCL_ERROR;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(butPtr->tkwin), -1);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonWidgetCmd --
- *
- * This procedure is invoked to process the TCL command
- * that corresponds to a widget managed by this module.
- * See the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-ButtonWidgetCmd(
- ClientData clientData, /* Information about button widget. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- Button *butPtr = clientData;
- char *string;
- int c;
- int length;
- int result = TCL_OK;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " option ?arg arg ...?\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_Preserve(butPtr);
- string = Tcl_GetStringFromObj(objv[1], &length);
- c = string[0];
- if ((c == 'c') && (length >= 2) && (strncmp(string, "cget", length) == 0)) {
- if (objc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " cget option\"", (char *)NULL);
- goto error;
- }
- result = Blt_ConfigureValueFromObj(interp, butPtr->tkwin, configSpecs,
- (char *)butPtr, objv[2], configFlags[butPtr->type]);
- } else if ((c == 'c') && (length >= 2) &&
- (strncmp(string, "configure", length) == 0)) {
- if (objc == 2) {
- result = Blt_ConfigureInfoFromObj(interp, butPtr->tkwin,
- configSpecs, (char *)butPtr, (Tcl_Obj *)NULL,
- configFlags[butPtr->type]);
- } else if (objc == 3) {
- result = Blt_ConfigureInfoFromObj(interp, butPtr->tkwin,
- configSpecs, (char *)butPtr, objv[2],
- configFlags[butPtr->type]);
- } else {
- result = ConfigureButton(interp, butPtr, objc - 2, objv + 2,
- configFlags[butPtr->type] | BLT_CONFIG_OBJV_ONLY);
- }
- } else if ((c == 'd') && (strncmp(string, "deselect", length) == 0) &&
- (butPtr->type >= TYPE_PUSH_BUTTON)) {
- if (objc > 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " deselect\"", (char *)NULL);
- goto error;
- }
- if ((butPtr->type == TYPE_CHECK_BUTTON) ||
- (butPtr->type == TYPE_PUSH_BUTTON)) {
- if (Tcl_SetVar(interp, butPtr->selVarName, butPtr->offValue,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- result = TCL_ERROR;
- }
- } else if (butPtr->flags & SELECTED) {
- if (Tcl_SetVar(interp, butPtr->selVarName, "",
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- result = TCL_ERROR;
- };
- }
- } else if ((c == 'f') && (strncmp(string, "flash", length) == 0)
- && (butPtr->type != TYPE_LABEL)) {
- int i;
-
- if (objc > 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " flash\"", (char *)NULL);
- goto error;
- }
- if (butPtr->state != STATE_DISABLED) {
- for (i = 0; i < 4; i++) {
- butPtr->state = (butPtr->state == STATE_NORMAL)
- ? STATE_ACTIVE : STATE_NORMAL;
- Blt_SetBackgroundFromBackground(butPtr->tkwin,
- (butPtr->state == STATE_ACTIVE) ? butPtr->activeBg
- : butPtr->normalBg);
- DisplayButton(butPtr);
-
- /*
- * Special note: must cancel any existing idle handler
- * for DisplayButton; it's no longer needed, and DisplayButton
- * cleared the REDRAW_PENDING flag.
- */
-
- Tcl_CancelIdleCall(DisplayButton, butPtr);
-#if !defined(WIN32) && !defined(MACOSX)
- XFlush(butPtr->display);
-#endif
- Tcl_Sleep(50);
- }
- }
- } else if ((c == 'i') && (strncmp(string, "invoke", length) == 0)
- && (butPtr->type > TYPE_LABEL)) {
- if (objc > 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " invoke\"", (char *)NULL);
- goto error;
- }
- if (butPtr->state != STATE_DISABLED) {
- result = InvokeButton(butPtr);
- }
- } else if ((c == 's') && (strncmp(string, "select", length) == 0) &&
- (butPtr->type >= TYPE_PUSH_BUTTON)) {
- if (objc > 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " select\"", (char *)NULL);
- goto error;
- }
- if (Tcl_SetVar(interp, butPtr->selVarName, butPtr->onValue,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- result = TCL_ERROR;
- }
- } else if ((c == 't') && (strncmp(string, "toggle", length) == 0) &&
- (length >= 2) && (butPtr->type == TYPE_PUSH_BUTTON)) {
- if (objc > 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " toggle\"", (char *)NULL);
- goto error;
- }
- if (butPtr->flags & SELECTED) {
- if (Tcl_SetVar(interp, butPtr->selVarName, butPtr->offValue,
- TCL_GLOBAL_ONLY) == NULL) {
- result = TCL_ERROR;
- }
- } else {
- if (Tcl_SetVar(interp, butPtr->selVarName, butPtr->onValue,
- TCL_GLOBAL_ONLY) == NULL) {
- result = TCL_ERROR;
- }
- }
- } else {
- Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]),
- "\": must be ", optionStrings[butPtr->type], (char *)NULL);
- goto error;
- }
- Tcl_Release(butPtr);
- return result;
-
- error:
- Tcl_Release(butPtr);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyButton --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of a button at a safe time
- * (when no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DestroyButton(Button *butPtr)
-{
- /*
- * Free up all the stuff that requires special handling, then
- * let Blt_FreeOptions handle all the standard option-related
- * stuff.
- */
-
- if (butPtr->textVarName != NULL) {
- Tcl_UntraceVar(butPtr->interp, butPtr->textVarName,
- TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
- ButtonTextVarProc, butPtr);
- }
- if (butPtr->normalTextGC != None) {
- Tk_FreeGC(butPtr->display, butPtr->normalTextGC);
- }
- if (butPtr->activeTextGC != None) {
- Tk_FreeGC(butPtr->display, butPtr->activeTextGC);
- }
- if (butPtr->gray != None) {
- Tk_FreeBitmap(butPtr->display, butPtr->gray);
- }
- if (butPtr->disabledGC != None) {
- Tk_FreeGC(butPtr->display, butPtr->disabledGC);
- }
- if (butPtr->copyGC != None) {
- Tk_FreeGC(butPtr->display, butPtr->copyGC);
- }
- if (butPtr->selVarName != NULL) {
- Tcl_UntraceVar(butPtr->interp, butPtr->selVarName,
- TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
- ButtonVarProc, (ClientData)butPtr);
- }
- Tk_FreeTextLayout(butPtr->textLayout);
- Blt_FreeOptions(configSpecs, (char *)butPtr, butPtr->display,
- configFlags[butPtr->type]);
- Tcl_EventuallyFree((ClientData)butPtr, TCL_DYNAMIC);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureButton --
- *
- * This procedure is called to process an objv/objc list, plus
- * the Tk option database, in order to configure (or
- * reconfigure) a button widget.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is
- * returned, then interp->result contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for butPtr; old resources get freed, if there
- * were any. The button is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-ConfigureButton(
- Tcl_Interp *interp, /* Used for error reporting. */
- Button *butPtr, /* Information about widget; may or may
- * not already have values for some fields. */
- int objc, /* Number of valid entries in objv. */
- Tcl_Obj *const *objv, /* Arguments. */
- int flags) /* Flags to pass to Blt_ConfigureWidget. */
-{
- XGCValues gcValues;
- GC newGC;
- unsigned long mask;
-
- /*
- * Eliminate any existing trace on variables monitored by the button.
- */
- if (butPtr->textVarName != NULL) {
- Tcl_UntraceVar(interp, butPtr->textVarName,
- TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
- ButtonTextVarProc, butPtr);
- }
- if (butPtr->selVarName != NULL) {
- Tcl_UntraceVar(interp, butPtr->selVarName,
- TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
- ButtonVarProc, butPtr);
- }
- if (Blt_ConfigureWidgetFromObj(interp, butPtr->tkwin, configSpecs,
- objc, objv, (char *)butPtr, flags) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * A few options need special processing, such as setting the
- * background from a 3-D border, or filling in complicated
- * defaults that couldn't be specified to Blt_ConfigureWidget.
- */
-
- if ((butPtr->state == STATE_ACTIVE) && !Tk_StrictMotif(butPtr->tkwin)) {
- Blt_SetBackgroundFromBackground(butPtr->tkwin, butPtr->activeBg);
- } else {
- Blt_SetBackgroundFromBackground(butPtr->tkwin, butPtr->normalBg);
- if ((butPtr->state != STATE_NORMAL) && (butPtr->state != STATE_ACTIVE)
- && (butPtr->state != STATE_DISABLED)) {
- Tcl_AppendResult(interp, "bad state value \"",
- Blt_Itoa(butPtr->state),
- "\": must be normal, active, or disabled", (char *)NULL);
- butPtr->state = STATE_NORMAL;
- return TCL_ERROR;
- }
- }
-
- if ((butPtr->defaultState != STATE_ACTIVE)
- && (butPtr->defaultState != STATE_DISABLED)
- && (butPtr->defaultState != STATE_NORMAL)) {
- Tcl_AppendResult(interp, "bad -default value \"", butPtr->defaultState,
- "\": must be normal, active, or disabled", (char *)NULL);
- butPtr->defaultState = STATE_DISABLED;
- return TCL_ERROR;
- }
- if (butPtr->highlightWidth < 0) {
- butPtr->highlightWidth = 0;
- }
- gcValues.font = Blt_FontId(butPtr->font);
- gcValues.foreground = butPtr->normalFg->pixel;
- gcValues.background = Blt_BackgroundBorderColor(butPtr->normalBg)->pixel;
-
- /*
- * Note: GraphicsExpose events are disabled in normalTextGC because it's
- * used to copy stuff from an off-screen pixmap onto the screen (we know
- * that there's no problem with obscured areas).
- */
-
- gcValues.graphics_exposures = False;
- newGC = Tk_GetGC(butPtr->tkwin,
- GCForeground | GCBackground | GCFont | GCGraphicsExposures,
- &gcValues);
- if (butPtr->normalTextGC != None) {
- Tk_FreeGC(butPtr->display, butPtr->normalTextGC);
- }
- butPtr->normalTextGC = newGC;
-
- if (butPtr->activeFg != NULL) {
- gcValues.font = Blt_FontId(butPtr->font);
- gcValues.foreground = butPtr->activeFg->pixel;
- gcValues.background = Blt_BackgroundBorderColor(butPtr->activeBg)->pixel;
- newGC = Tk_GetGC(butPtr->tkwin,
- GCForeground | GCBackground | GCFont, &gcValues);
- if (butPtr->activeTextGC != None) {
- Tk_FreeGC(butPtr->display, butPtr->activeTextGC);
- }
- butPtr->activeTextGC = newGC;
- }
- if (butPtr->type != TYPE_LABEL) {
- gcValues.font = Blt_FontId(butPtr->font);
- gcValues.background = Blt_BackgroundBorderColor(butPtr->normalBg)->pixel;
- if ((butPtr->disabledFg != NULL) && (butPtr->image == NULL)) {
- gcValues.foreground = butPtr->disabledFg->pixel;
- mask = GCForeground | GCBackground | GCFont;
- } else {
- gcValues.foreground = gcValues.background;
- if (butPtr->gray == None) {
- butPtr->gray = Tk_GetBitmap(interp, butPtr->tkwin,
- Tk_GetUid("gray50"));
- if (butPtr->gray == None) {
- return TCL_ERROR;
- }
- }
- gcValues.fill_style = FillStippled;
- gcValues.stipple = butPtr->gray;
- mask = GCForeground | GCFillStyle | GCStipple;
- }
- newGC = Tk_GetGC(butPtr->tkwin, mask, &gcValues);
- if (butPtr->disabledGC != None) {
- Tk_FreeGC(butPtr->display, butPtr->disabledGC);
- }
- butPtr->disabledGC = newGC;
- }
- if (butPtr->copyGC == None) {
- butPtr->copyGC = Tk_GetGC(butPtr->tkwin, 0, &gcValues);
- }
- if (butPtr->xPad < 0) {
- butPtr->xPad = 0;
- }
- if (butPtr->yPad < 0) {
- butPtr->yPad = 0;
- }
- if (butPtr->type >= TYPE_PUSH_BUTTON) {
- const char *value;
-
- if (butPtr->selVarName == NULL) {
- butPtr->selVarName = Blt_AssertStrdup(Tk_Name(butPtr->tkwin));
- }
- /*
- * Select the button if the associated variable has the
- * appropriate value, initialize the variable if it doesn't
- * exist, then set a trace on the variable to monitor future
- * changes to its value.
- */
-
- value = Tcl_GetVar(interp, butPtr->selVarName, TCL_GLOBAL_ONLY);
- butPtr->flags &= ~SELECTED;
- if (value != NULL) {
- if (strcmp(value, butPtr->onValue) == 0) {
- butPtr->flags |= SELECTED;
- }
- } else {
- const char *value;
- value = ((butPtr->type == TYPE_CHECK_BUTTON) ||
- (butPtr->type == TYPE_PUSH_BUTTON)) ? butPtr->offValue : "";
- if (Tcl_SetVar(interp, butPtr->selVarName, value,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- }
- Tcl_TraceVar(interp, butPtr->selVarName,
- TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
- ButtonVarProc, (ClientData)butPtr);
- }
- /*
- * Get the images for the widget, if there are any. Allocate the
- * new images before freeing the old ones, so that the reference
- * counts don't go to zero and cause image data to be discarded.
- */
-
- if ((butPtr->image == NULL) && (butPtr->bitmap == None)
- && (butPtr->textVarName != NULL)) {
- /*
- * The button must display the value of a variable: set up a trace
- * on the variable's value, create the variable if it doesn't
- * exist, and fetch its current value.
- */
-
- const char *value;
-
- value = Tcl_GetVar(interp, butPtr->textVarName, TCL_GLOBAL_ONLY);
- if (value == NULL) {
- if (Tcl_SetVar(interp, butPtr->textVarName, butPtr->text,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- } else {
- if (butPtr->text != NULL) {
- Blt_Free(butPtr->text);
- }
- butPtr->text = Blt_AssertStrdup(value);
- }
- Tcl_TraceVar(interp, butPtr->textVarName,
- TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
- ButtonTextVarProc, (ClientData)butPtr);
- }
- if ((butPtr->bitmap != None) || (butPtr->image != NULL)) {
- if (Tk_GetPixels(interp, butPtr->tkwin, butPtr->widthString,
- &butPtr->width) != TCL_OK) {
- widthError:
- Tcl_AddErrorInfo(interp, "\n (processing -width option)");
- return TCL_ERROR;
- }
- if (Tk_GetPixels(interp, butPtr->tkwin, butPtr->heightString,
- &butPtr->height) != TCL_OK) {
- heightError:
- Tcl_AddErrorInfo(interp, "\n (processing -height option)");
- return TCL_ERROR;
- }
- } else {
- if (Tcl_GetInt(interp, butPtr->widthString, &butPtr->width)
- != TCL_OK) {
- goto widthError;
- }
- if (Tcl_GetInt(interp, butPtr->heightString, &butPtr->height)
- != TCL_OK) {
- goto heightError;
- }
- }
- ComputeButtonGeometry(butPtr);
-
- /*
- * Lastly, arrange for the button to be redisplayed.
- */
-
- if (Tk_IsMapped(butPtr->tkwin) && !(butPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayButton, (ClientData)butPtr);
- butPtr->flags |= REDRAW_PENDING;
- }
- return TCL_OK;
-}
-
-static void
-DrawCheckButton(Tk_Window tkwin, Drawable drawable, Button *butPtr,
- int x, int y)
-{
-#ifdef notdef
- Blt_Background bg;
- GC fillGC, boxGC, checkGC;
- int boxWidth, boxHeight;
- int dim;
- int xBox, yBox;
-
- dim = butPtr->indicatorDiameter - 2 * butPtr->borderWidth;
- dim |= 0x1;
- boxWidth = boxHeight = dim;
- xBox = butPtr->borderWidth + GAP;
- yBox = (Tk_Height(tkwin) - boxHeight) / 2;
-
- bg = butPtr->normalBg;
- if (butPtr->state & STATE_DISABLED) {
- fillGC = Blt_BackgroundBorderGC(tkwin, bg, TK_3D_FLAT_GC);
- } else {
- fillGC = Blt_BackgroundBorderGC(tkwin, bg, TK_3D_LIGHT_GC);
- }
- boxGC = Blt_BackgroundBorderGC(tkwin, bg, TK_3D_DARK_GC);
- checkGC = butPtr->normalTextGC;
-
- XFillRectangle(butPtr->display, drawable, fillGC, xBox, yBox,
- boxWidth, boxHeight);
- XDrawRectangle(butPtr->display, drawable, boxGC, xBox, yBox,
- boxWidth, boxHeight);
-
- if (butPtr->flags & SELECTED) {
- int ax, ay, bx, by, cx, cy;
- int i;
-
- ax = xBox + 2, ay = yBox + 2 + (boxHeight / 3);
- bx = xBox + (boxWidth / 2) - 1;
- by = yBox + boxHeight - 4;
- cx = xBox + boxWidth;
- cy = yBox;
- for (i = 0; i < 3; i++) {
- XDrawLine(butPtr->display, drawable, checkGC, ax, ay, bx, by);
- XDrawLine(butPtr->display, drawable, checkGC, bx, by, cx, cy);
- ay++, by++, cy++;
- }
- }
-#else
- Blt_Picture picture;
- Blt_Painter painter;
- int on, dim;
- int w, h;
-
- dim = butPtr->indicatorDiameter;
- x -= butPtr->indicatorSpace + butPtr->borderWidth;
- y -= dim / 2 + butPtr->borderWidth;
-
- w = h = butPtr->indicatorSpace /* - 2 * butPtr->borderWidth; */;
- on = (butPtr->flags & SELECTED);
- picture = NULL;
- if (butPtr->state & STATE_DISABLED) {
- if (butPtr->disabledPicture == NULL) {
- butPtr->disabledPicture =
- Blt_PaintCheckbox(w, h,
- Blt_BackgroundBorderColor(butPtr->normalBg),
- butPtr->disabledFg, butPtr->disabledFg, on);
- }
- picture = butPtr->disabledPicture;
- } else if (butPtr->flags & SELECTED) {
- if (butPtr->selectedPicture == NULL) {
- butPtr->selectedPicture =
- Blt_PaintCheckbox(w, h,
- Blt_BackgroundBorderColor(butPtr->selectBg),
- butPtr->activeFg,
- butPtr->selectFg,
- TRUE);
- }
- picture = butPtr->selectedPicture;
- } else {
- if (butPtr->normalPicture == NULL) {
- butPtr->normalPicture =
- Blt_PaintCheckbox(w, h,
- Blt_BackgroundBorderColor(butPtr->selectBg),
- butPtr->normalFg,
- butPtr->selectFg,
- FALSE);
- }
- picture = butPtr->normalPicture;
- }
- painter = Blt_GetPainter(tkwin, 1.0);
- Blt_PaintPicture(painter, drawable, picture, 0, 0, w, h, x, y, 0);
-#endif
-}
-
-static void
-DrawRadioButton(Tk_Window tkwin, Drawable drawable, Button *butPtr, int x,
- int y)
-{
-#ifdef notdef
- Blt_Background bg;
- GC fillGC, boxGC, checkGC;
- int boxWidth, boxHeight;
- int dim;
- int xBox, yBox;
-
- dim = butPtr->indicatorDiameter - 2 * butPtr->borderWidth;
- dim |= 0x1;
- boxWidth = boxHeight = dim;
- xBox = butPtr->borderWidth + GAP;
- yBox = (Tk_Height(tkwin) - boxHeight) / 2;
-
- bg = butPtr->normalBg;
- if (butPtr->state & STATE_DISABLED) {
- fillGC = Blt_BackgroundBorderGC(tkwin, bg, TK_3D_FLAT_GC);
- } else {
- fillGC = Blt_BackgroundBorderGC(tkwin, bg, TK_3D_LIGHT_GC);
- }
- boxGC = Blt_BackgroundBorderGC(tkwin, bg, TK_3D_DARK_GC);
- checkGC = butPtr->normalTextGC;
-
- XFillRectangle(butPtr->display, drawable, fillGC, xBox, yBox,
- boxWidth, boxHeight);
- XDrawRectangle(butPtr->display, drawable, boxGC, xBox, yBox,
- boxWidth, boxHeight);
-
- if (butPtr->flags & SELECTED) {
- int ax, ay, bx, by, cx, cy;
- int i;
-
- ax = xBox + 2, ay = yBox + 2 + (boxHeight / 3);
- bx = xBox + (boxWidth / 2) - 1;
- by = yBox + boxHeight - 4;
- cx = xBox + boxWidth;
- cy = yBox;
- for (i = 0; i < 3; i++) {
- XDrawLine(butPtr->display, drawable, checkGC, ax, ay, bx, by);
- XDrawLine(butPtr->display, drawable, checkGC, bx, by, cx, cy);
- ay++, by++, cy++;
- }
- }
-#else
- Blt_Picture picture;
- Blt_Painter painter;
- int on, dim;
- int w, h;
-
- dim = butPtr->indicatorDiameter;
- x -= butPtr->indicatorSpace + butPtr->borderWidth;
- y -= dim / 2 + butPtr->borderWidth;
-
- w = h = butPtr->indicatorSpace - 2 * butPtr->borderWidth;
- on = (butPtr->flags & SELECTED);
- picture = NULL;
- if (butPtr->state & STATE_DISABLED) {
- if (butPtr->disabledPicture == NULL) {
- butPtr->disabledPicture =
- Blt_PaintRadioButton(w, h,
- Blt_BackgroundBorderColor(butPtr->normalBg),
- butPtr->disabledFg, butPtr->disabledFg, on);
- }
- picture = butPtr->disabledPicture;
- } else if (butPtr->flags & SELECTED) {
- if (butPtr->selectedPicture == NULL) {
- butPtr->selectedPicture =
- Blt_PaintRadioButton(w, h,
- Blt_BackgroundBorderColor(butPtr->selectBg),
- butPtr->activeFg,
- butPtr->selectFg,
- TRUE);
- }
- picture = butPtr->selectedPicture;
- } else {
- if (butPtr->normalPicture == NULL) {
- butPtr->normalPicture =
- Blt_PaintRadioButton(w, h,
- Blt_BackgroundBorderColor(butPtr->selectBg),
- butPtr->normalFg,
- butPtr->selectFg,
- FALSE);
- }
- picture = butPtr->normalPicture;
- }
- painter = Blt_GetPainter(tkwin, 1.0);
- Blt_PaintPicture(painter, drawable, picture, 0, 0, w, h, x, y, 0);
-#endif
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayButton --
- *
- * This procedure is invoked to display a button widget. It is
- * normally invoked as an idle handler.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the button in its
- * current mode. The REDRAW_PENDING flag is cleared.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-DisplayButton(ClientData clientData)
-{
- Button *butPtr = clientData;
- GC gc;
- Blt_Background bg;
- Pixmap pixmap;
- int x = 0; /* Initialization only needed to stop
- * compiler warning. */
- int y, relief;
- Tk_Window tkwin = butPtr->tkwin;
- int width, height;
- int offset; /* 0 means this is a label widget. 1 means
- * it is a flavor of button, so we offset
- * the text to make the button appear to
- * move up and down as the relief changes. */
-
- butPtr->flags &= ~REDRAW_PENDING;
- if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
- return;
- }
- if ((Tk_Width(butPtr->tkwin) < 2) || (Tk_Height(butPtr->tkwin) < 2)) {
- return;
- }
- bg = butPtr->normalBg;
- if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) {
- gc = butPtr->disabledGC;
- } else if ((butPtr->state == STATE_ACTIVE)
- && !Tk_StrictMotif(butPtr->tkwin)) {
- gc = butPtr->activeTextGC;
- bg = butPtr->activeBg;
- } else {
- gc = butPtr->normalTextGC;
- }
- if ((butPtr->flags & SELECTED) && (butPtr->state != STATE_ACTIVE) &&
- (butPtr->selectBg != NULL) && (!butPtr->indicatorOn)) {
- bg = butPtr->selectBg;
- }
- if ((butPtr->type == TYPE_PUSH_BUTTON) && (butPtr->flags & SELECTED) &&
- (butPtr->state == STATE_ACTIVE) && (butPtr->selectBg != NULL) &&
- (!butPtr->indicatorOn)) {
- bg = butPtr->selectBg;
- }
- /*
- * Override the relief specified for the button if this is a
- * checkbutton or radiobutton and there's no indicator.
- */
- relief = butPtr->relief;
- if ((butPtr->type >= TYPE_PUSH_BUTTON) && (!butPtr->indicatorOn)) {
- relief = (butPtr->flags & SELECTED) ? TK_RELIEF_SUNKEN
- : butPtr->relief;
- }
- offset = (butPtr->type == TYPE_BUTTON) && !Tk_StrictMotif(butPtr->tkwin);
-
- /*
- * In order to avoid screen flashes, this procedure redraws
- * the button in a pixmap, then copies the pixmap to the
- * screen in a single operation. This means that there's no
- * point in time where the on-sreen image has been cleared.
- */
-
- pixmap = Tk_GetPixmap(butPtr->display, Tk_WindowId(tkwin),
- Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin));
- Blt_FillBackgroundRectangle(tkwin, pixmap, bg, 0, 0, Tk_Width(tkwin),
- Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
-
- /*
- * Display image or bitmap or text for button.
- */
-
- if (butPtr->image != None) {
- Tk_SizeOfImage(butPtr->image, &width, &height);
-
- imageOrBitmap:
- TkComputeAnchor(butPtr->anchor, tkwin, butPtr->xPad, butPtr->yPad,
- butPtr->indicatorSpace + width, height, &x, &y);
- x += butPtr->indicatorSpace;
-
- x += offset;
- y += offset;
- if (relief == TK_RELIEF_RAISED) {
- x -= offset;
- y -= offset;
- } else if (relief == TK_RELIEF_SUNKEN) {
- x += offset;
- y += offset;
- }
- if (butPtr->image != NULL) {
- if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) {
- Tk_RedrawImage(butPtr->selectImage, 0, 0, width, height, pixmap,
- x, y);
- } else {
- Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap,
- x, y);
- }
- } else {
- XSetClipOrigin(butPtr->display, gc, x, y);
- XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, gc, 0, 0,
- (unsigned int)width, (unsigned int)height, x, y, 1);
- XSetClipOrigin(butPtr->display, gc, 0, 0);
- }
- y += height / 2;
- } else if (butPtr->bitmap != None) {
- Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
- goto imageOrBitmap;
- } else {
- TkComputeAnchor(butPtr->anchor, tkwin, butPtr->xPad, butPtr->yPad,
- butPtr->indicatorSpace + butPtr->textWidth,
- butPtr->textHeight, &x, &y);
-
- x += butPtr->indicatorSpace;
-
- x += offset;
- y += offset;
- if (relief == TK_RELIEF_RAISED) {
- x -= offset;
- y -= offset;
- } else if (relief == TK_RELIEF_SUNKEN) {
- x += offset;
- y += offset;
- }
- Blt_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout,
- x, y, 0, -1);
- Blt_UnderlineTextLayout(butPtr->display, pixmap, gc,
- butPtr->textLayout, x, y, butPtr->underline);
- y += butPtr->textHeight / 2;
- }
-
- /*
- * Draw the indicator for check buttons and radio buttons. At this
- * point x and y refer to the top-left corner of the text or image
- * or bitmap.
- */
- if ((butPtr->type == TYPE_CHECK_BUTTON) && butPtr->indicatorOn) {
-#ifdef notdef
- int dim;
-
- dim = butPtr->indicatorDiameter;
- x -= butPtr->indicatorSpace;
- y -= dim / 2;
- if (dim > 2 * butPtr->borderWidth) {
-
- Blt_DrawBackgroundRectangle(tkwin, pixmap, bg, x, y, dim, dim,
- butPtr->borderWidth,
- (butPtr->flags & SELECTED) ? TK_RELIEF_SUNKEN :
- TK_RELIEF_RAISED);
- x += butPtr->borderWidth;
- y += butPtr->borderWidth;
- dim -= 2 * butPtr->borderWidth;
- if (butPtr->flags & SELECTED) {
- GC borderGC;
-
- borderGC = Blt_BackgroundBorderGC(tkwin,
- (butPtr->selectBg != NULL)
- ? butPtr->selectBg : butPtr->normalBg, TK_3D_FLAT_GC);
- XFillRectangle(butPtr->display, pixmap, borderGC, x, y,
- (unsigned int)dim, (unsigned int)dim);
- } else {
- Blt_FillBackgroundRectangle(tkwin, pixmap, butPtr->normalBg,
- x, y, dim, dim, butPtr->borderWidth, TK_RELIEF_FLAT);
- }
- }
-#else
- DrawCheckButton(tkwin, pixmap, butPtr, x, y);
- x -= GAP;
-#endif
- } else if ((butPtr->type == TYPE_RADIO_BUTTON) && butPtr->indicatorOn) {
-#ifdef notdef
- XPoint points[4];
- int radius;
-
- radius = butPtr->indicatorDiameter / 2;
- points[0].x = x - butPtr->indicatorSpace;
- points[0].y = y;
- points[1].x = points[0].x + radius;
- points[1].y = points[0].y + radius;
- points[2].x = points[1].x + radius;
- points[2].y = points[0].y;
- points[3].x = points[1].x;
- points[3].y = points[0].y - radius;
- if (butPtr->flags & SELECTED) {
- GC borderGC;
-
- borderGC = Blt_BackgroundBorderGC(tkwin, (butPtr->selectBg != NULL)
- ? butPtr->selectBg : butPtr->normalBg, TK_3D_FLAT_GC);
- XFillPolygon(butPtr->display, pixmap, borderGC, points, 4, Convex,
- CoordModeOrigin);
- } else {
- Tk_Fill3DPolygon(tkwin, pixmap,
- Blt_BackgroundBorder(butPtr->normalBg), points,
- 4, butPtr->borderWidth, TK_RELIEF_FLAT);
- }
- Tk_Draw3DPolygon(tkwin, pixmap, Blt_BackgroundBorder(bg), points, 4,
- butPtr->borderWidth,
- (butPtr->flags & SELECTED) ? TK_RELIEF_SUNKEN :
- TK_RELIEF_RAISED);
-#else
- DrawRadioButton(tkwin, pixmap, butPtr, x, y);
-#endif
- }
- /*
- * If the button is disabled with a stipple rather than a special
- * foreground color, generate the stippled effect. If the widget
- * is selected and we use a different background color when selected,
- * must temporarily modify the GC.
- */
- if ((butPtr->state == STATE_DISABLED) &&
- ((butPtr->disabledFg == NULL) || (butPtr->image != NULL))) {
- if ((butPtr->flags & SELECTED) && (!butPtr->indicatorOn) &&
- (butPtr->selectBg != NULL)) {
- XSetForeground(butPtr->display, butPtr->disabledGC,
- Blt_BackgroundBorderColor(butPtr->selectBg)->pixel);
- }
- XFillRectangle(butPtr->display, pixmap, butPtr->disabledGC,
- butPtr->inset, butPtr->inset,
- (unsigned)(Tk_Width(tkwin) - 2 * butPtr->inset),
- (unsigned)(Tk_Height(tkwin) - 2 * butPtr->inset));
- if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn
- && (butPtr->selectBg != NULL)) {
- XSetForeground(butPtr->display, butPtr->disabledGC,
- Blt_BackgroundBorderColor(butPtr->normalBg)->pixel);
- }
- }
-
- /*
- * Draw the border and traversal highlight last. This way, if the
- * button's contents overflow they'll be covered up by the border.
- */
- if (relief != TK_RELIEF_FLAT) {
- int inset = butPtr->highlightWidth;
-
- if (butPtr->defaultState == STATE_ACTIVE) {
- inset += 2;
- Blt_DrawBackgroundRectangle(tkwin, pixmap, bg, inset, inset,
- Tk_Width(tkwin) - 2 * inset, Tk_Height(tkwin) - 2 * inset,
- 1, TK_RELIEF_SUNKEN);
- inset += 3;
- }
- Blt_DrawBackgroundRectangle(tkwin, pixmap, bg, inset, inset,
- Tk_Width(tkwin) - 2 * inset, Tk_Height(tkwin) - 2 * inset,
- butPtr->borderWidth, relief);
- }
- if (butPtr->highlightWidth != 0) {
- GC highlightGC;
-
- if (butPtr->flags & GOT_FOCUS) {
- highlightGC = Tk_GCForColor(butPtr->highlightColorPtr, pixmap);
- } else {
- highlightGC = Tk_GCForColor(butPtr->highlightBgColorPtr, pixmap);
- }
- Tk_DrawFocusHighlight(tkwin, highlightGC, butPtr->highlightWidth,
- pixmap);
- }
- /*
- * Copy the information from the off-screen pixmap onto the screen,
- * then delete the pixmap.
- */
- XCopyArea(butPtr->display, pixmap, Tk_WindowId(tkwin), butPtr->copyGC,
- 0, 0, (unsigned)Tk_Width(tkwin), (unsigned)Tk_Height(tkwin), 0, 0);
- Tk_FreePixmap(butPtr->display, pixmap);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeButtonGeometry --
- *
- * After changes in a button's text or bitmap, this procedure
- * recomputes the button's geometry and passes this information
- * along to the geometry manager for the window.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The button's window may change size.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-ComputeButtonGeometry(Button *butPtr)
-{
- int width, height;
-
- if (butPtr->highlightWidth < 0) {
- butPtr->highlightWidth = 0;
- }
- butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth;
-
- /*
- * Leave room for the default ring if needed.
- */
-
- if (butPtr->defaultState == STATE_ACTIVE) {
- butPtr->inset += 5;
- }
- butPtr->indicatorSpace = 0;
- if (butPtr->image != NULL) {
- Tk_SizeOfImage(butPtr->image, &width, &height);
- imageOrBitmap:
- if (butPtr->width > 0) {
- width = butPtr->width;
- }
- if (butPtr->height > 0) {
- height = butPtr->height;
- }
- if ((butPtr->type >= TYPE_CHECK_BUTTON) && butPtr->indicatorOn) {
- butPtr->indicatorSpace = height;
- if (butPtr->type == TYPE_CHECK_BUTTON) {
- butPtr->indicatorDiameter = (65 * height) / 100;
- } else {
- butPtr->indicatorDiameter = (75 * height) / 100;
- }
- }
- } else if (butPtr->bitmap != None) {
- Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
- goto imageOrBitmap;
- } else {
- int avgWidth;
- Blt_FontMetrics fm;
-
- if (butPtr->textLayout != NULL) {
- Tk_FreeTextLayout(butPtr->textLayout);
- }
- butPtr->textLayout = Blt_ComputeTextLayout(butPtr->font,
- butPtr->text, -1, butPtr->wrapLength, butPtr->justify, 0,
- &butPtr->textWidth, &butPtr->textHeight);
- width = butPtr->textWidth;
- height = butPtr->textHeight;
- avgWidth = Blt_TextWidth(butPtr->font, "0", 1);
- Blt_GetFontMetrics(butPtr->font, &fm);
-
- if (butPtr->width > 0) {
- width = butPtr->width * avgWidth;
- }
- if (butPtr->height > 0) {
- height = butPtr->height * fm.linespace;
- }
- if ((butPtr->type >= TYPE_CHECK_BUTTON) && butPtr->indicatorOn) {
- butPtr->indicatorDiameter = fm.linespace;
- if (butPtr->type == TYPE_CHECK_BUTTON) {
- butPtr->indicatorDiameter =
- (70 * butPtr->indicatorDiameter) / 100;
- }
- butPtr->indicatorSpace = butPtr->indicatorDiameter + avgWidth;
- }
- }
-
- /*
- * When issuing the geometry request, add extra space for the indicator,
- * if any, and for the border and padding, plus two extra pixels so the
- * display can be offset by 1 pixel in either direction for the raised
- * or lowered effect.
- */
-
-#ifdef notdef
- if ((butPtr->image == NULL) && (butPtr->bitmap == None)) {
- width += 2 * butPtr->xPad;
- height += 2 * butPtr->yPad;
- }
-#else
- width += 2 * butPtr->xPad;
- height += 2 * butPtr->yPad;
-#endif
- if ((butPtr->type == TYPE_BUTTON) && !Tk_StrictMotif(butPtr->tkwin)) {
- width += 2;
- height += 2;
- }
- Tk_GeometryRequest(butPtr->tkwin, (int)(width + butPtr->indicatorSpace
- + 2 * butPtr->inset), (int)(height + 2 * butPtr->inset));
- Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various
- * events on buttons.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-ButtonEventProc(ClientData clientData, XEvent *eventPtr)
-{
- Button *butPtr = clientData;
- if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
- goto redraw;
- } else if (eventPtr->type == ConfigureNotify) {
- /*
- * Must redraw after size changes, since layout could have changed
- * and borders will need to be redrawn.
- */
-
- goto redraw;
- } else if (eventPtr->type == DestroyNotify) {
- if (butPtr->tkwin != NULL) {
- butPtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(butPtr->interp, butPtr->widgetCmd);
- }
- if (butPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayButton, (ClientData)butPtr);
- }
- /* This is a hack to workaround a bug in 8.3.3. */
- DestroyButton((ClientData)butPtr);
- /* Tcl_EventuallyFree((ClientData)butPtr, (Tcl_FreeProc *)Blt_Free); */
- } else if (eventPtr->type == FocusIn) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- butPtr->flags |= GOT_FOCUS;
- if (butPtr->highlightWidth > 0) {
- goto redraw;
- }
- }
- } else if (eventPtr->type == FocusOut) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- butPtr->flags &= ~GOT_FOCUS;
- if (butPtr->highlightWidth > 0) {
- goto redraw;
- }
- }
- }
- return;
-
- redraw:
- if ((butPtr->tkwin != NULL) && !(butPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayButton, (ClientData)butPtr);
- butPtr->flags |= REDRAW_PENDING;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonCmdDeletedProc --
- *
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-ButtonCmdDeletedProc(ClientData clientData)
-{
- Button *butPtr = clientData;
- Tk_Window tkwin = butPtr->tkwin;
-
- /*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin
- * is NULL) or because the command was deleted, and then this procedure
- * destroys the widget.
- */
-
- if (tkwin != NULL) {
- butPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InvokeButton --
- *
- * This procedure is called to carry out the actions associated
- * with a button, such as invoking a TCL command or setting a
- * variable. This procedure is invoked, for example, when the
- * button is invoked via the mouse.
- *
- * Results:
- * A standard TCL return value. Information is also left in
- * interp->result.
- *
- * Side effects:
- * Depends on the button and its associated command.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-InvokeButton(Button *butPtr)
-{
- if ((butPtr->type == TYPE_CHECK_BUTTON) ||
- (butPtr->type == TYPE_PUSH_BUTTON)) {
- if (butPtr->flags & SELECTED) {
- if (Tcl_SetVar(butPtr->interp, butPtr->selVarName,
- butPtr->offValue,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- } else {
- if (Tcl_SetVar(butPtr->interp, butPtr->selVarName, butPtr->onValue,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- }
- } else if (butPtr->type == TYPE_RADIO_BUTTON) {
- if (Tcl_SetVar(butPtr->interp, butPtr->selVarName, butPtr->onValue,
- TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG) == NULL) {
- return TCL_ERROR;
- }
- }
- if ((butPtr->type != TYPE_LABEL) && (butPtr->command != NULL)) {
- return TkCopyAndGlobalEval(butPtr->interp, (char *)butPtr->command);
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonVarProc --
- *
- * This procedure is invoked when someone changes the
- * state variable associated with a radio button. Depending
- * on the new value of the button's variable, the button
- * may be selected or deselected.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The button may become selected or deselected.
- *
- *---------------------------------------------------------------------------
- */
-
- /* ARGSUSED */
-static char *
-ButtonVarProc(
- ClientData clientData, /* Information about button. */
- Tcl_Interp *interp, /* Interpreter containing variable. */
- const char *name1, /* Name of variable. */
- const char *name2, /* Second part of variable name. */
- int flags) /* Information about what happened. */
-{
- Button *butPtr = clientData;
- const char *value;
-
- /*
- * If the variable is being unset, then just re-establish the
- * trace unless the whole interpreter is going away.
- */
-
- if (flags & TCL_TRACE_UNSETS) {
- butPtr->flags &= ~SELECTED;
- if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) {
- Tcl_TraceVar(interp, butPtr->selVarName,
- TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
- ButtonVarProc, clientData);
- }
- goto redisplay;
- }
- /*
- * Use the value of the variable to update the selected status of
- * the button.
- */
-
- value = Tcl_GetVar(interp, butPtr->selVarName, TCL_GLOBAL_ONLY);
- if (value == NULL) {
- value = "";
- }
- if (strcmp(value, butPtr->onValue) == 0) {
- if (butPtr->flags & SELECTED) {
- return (char *) NULL;
- }
- butPtr->flags |= SELECTED;
- } else if (butPtr->flags & SELECTED) {
- butPtr->flags &= ~SELECTED;
- } else {
- return (char *) NULL;
- }
-
- redisplay:
- if ((butPtr->tkwin != NULL) && Tk_IsMapped(butPtr->tkwin)
- && !(butPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayButton, (ClientData)butPtr);
- butPtr->flags |= REDRAW_PENDING;
- }
- return (char *) NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ButtonTextVarProc --
- *
- * This procedure is invoked when someone changes the variable
- * whose contents are to be displayed in a button.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The text displayed in the button will change to match the
- * variable.
- *
- *---------------------------------------------------------------------------
- */
-
- /* ARGSUSED */
-static char *
-ButtonTextVarProc(
- ClientData clientData, /* Information about button. */
- Tcl_Interp *interp, /* Interpreter containing variable. */
- const char *name1, /* Not used. */
- const char *name2, /* Not used. */
- int flags) /* Information about what happened. */
-{
- Button *butPtr = clientData;
- const char *value;
-
- /*
- * If the variable is unset, then immediately recreate it unless
- * the whole interpreter is going away.
- */
-
- if (flags & TCL_TRACE_UNSETS) {
- if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) {
- Tcl_SetVar(interp, butPtr->textVarName, butPtr->text,
- TCL_GLOBAL_ONLY);
- Tcl_TraceVar(interp, butPtr->textVarName,
- TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
- ButtonTextVarProc, clientData);
- }
- return (char *) NULL;
- }
- value = Tcl_GetVar(interp, butPtr->textVarName, TCL_GLOBAL_ONLY);
- if (value == NULL) {
- value = "";
- }
- if (butPtr->text != NULL) {
- Blt_Free(butPtr->text);
- }
- butPtr->text = Blt_AssertStrdup(value);
- ComputeButtonGeometry(butPtr);
-
- if ((butPtr->tkwin != NULL) && Tk_IsMapped(butPtr->tkwin)
- && !(butPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayButton, (ClientData)butPtr);
- butPtr->flags |= REDRAW_PENDING;
- }
- return (char *) NULL;
-}
-
-int
-Blt_ButtonCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpecs[] = {
- {"button", ButtonCmd,},
- {"pushbutton", PushbuttonCmd,},
- {"checkbutton", CheckbuttonCmd,},
- {"radiobutton", RadiobuttonCmd,},
- {"label", LabelCmd,},
- };
- return Blt_InitCmds(interp, "::blt::tk", cmdSpecs, 5);
-}
-
-#endif /* NO_TKBUTTON */
-
diff --git a/blt3.0.1/src/tkConsole.c b/blt3.0.1/src/tkConsole.c
deleted file mode 100644
index baefece..0000000
--- a/blt3.0.1/src/tkConsole.c
+++ /dev/null
@@ -1,652 +0,0 @@
-
-/*
- * tkConsole.c --
- *
- * This file implements a TCL console for systems that may not
- * otherwise have access to a console. It uses the Text widget
- * and provides special access via a console command.
- *
- * Copyright (c) 1995-1996 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * SCCS: @(#) tkConsole.c 1.55 98/01/02 17:40:37
- */
-
-#include "config.h"
-#undef USE_TK_STUBS
-#undef USE_TCL_STUBS
-#include "blt.h"
-#include <tcl.h>
-#include <tk.h>
-#include <locale.h>
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#define _VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-
-#define _TCL_VERSION _VERSION(TCL_MAJOR_VERSION, TCL_MINOR_VERSION, TCL_RELEASE_SERIAL)
-#define _TK_VERSION _VERSION(TK_MAJOR_VERSION, TK_MINOR_VERSION, TK_RELEASE_SERIAL)
-
-#if (_TCL_VERSION < _VERSION(8,2,0))
-
-/*
- * A data structure of the following type holds information for each console
- * which a handler (i.e. a TCL command) has been defined for a particular
- * top-level window.
- */
-
-typedef struct {
- Tcl_Interp *consoleInterp; /* Interpreter for the console. */
- Tcl_Interp *interp; /* Interpreter to send console commands. */
-} ConsoleInfo;
-
-static Tcl_Interp *gStdoutInterp = NULL;
-
-#if (_TCL_VERSION < _VERSION(8,1,0))
-#define HAVE_BROKEN_LIB_PATH 1
-#undef HAVE_UTF
-#endif
-
-#if (_TCL_VERSION >= _VERSION(8,1,1))
-#define HAVE_UTF 1
-extern void TclInitSubsystems _ANSI_ARGS_((const char *argv0));
-#else
-#endif
-
-/*
- * Forward declarations for procedures defined later in this file:
- *
- * The first three will be used in the tk app shells...
- */
-
-extern Tcl_AppInitProc Blt_ConsoleInit;
-extern void Blt_ConsoleCreate _ANSI_ARGS_((void));
-
-static Tcl_CmdDeleteProc ConsoleDeleteProc;
-static Tcl_CmdProc ConsoleCmd;
-static Tcl_CmdProc InterpreterCmd;
-static Tk_EventProc ConsoleEventProc;
-
-static void ConsolePrint _ANSI_ARGS_((Tcl_Interp *interp, int devId,
- const char *buffer, long size));
-
-static int ConsoleInput _ANSI_ARGS_((ClientData instanceData, char *buf,
- int toRead, int *errorCode));
-static int ConsoleOutput _ANSI_ARGS_((ClientData instanceData, char *buf,
- int toWrite, int *errorCode));
-static int ConsoleClose _ANSI_ARGS_((ClientData instanceData,
- Tcl_Interp *interp));
-static void ConsoleWatch _ANSI_ARGS_((ClientData instanceData, int mask));
-static int ConsoleHandle _ANSI_ARGS_((ClientData instanceData, int direction,
- ClientData *handlePtr));
-
-/*
- * This structure describes the channel type structure for file based IO:
- */
-
-static Tcl_ChannelType consoleChannelType =
-{
- "console", /* Type name. */
- NULL, /* Always non-blocking.*/
- ConsoleClose, /* Close proc. */
- ConsoleInput, /* Input proc. */
- ConsoleOutput, /* Output proc. */
- NULL, /* Seek proc. */
- NULL, /* Set option proc. */
- NULL, /* Get option proc. */
- ConsoleWatch, /* Watch for events on console. */
- ConsoleHandle, /* Get a handle from the device. */
-};
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ConsoleCreate --
- *
- * Create the console channels and install them as the standard
- * channels. All I/O will be discarded until Blt_ConsoleInit is
- * called to attach the console to a text widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates the console channel and installs it as the standard
- * channels.
- *
- *---------------------------------------------------------------------------
- */
-
-void
-Blt_ConsoleCreate()
-{
- Tcl_Channel channel;
-
-#ifdef HAVE_UTF
- TclInitSubsystems(NULL);
-#endif
- channel = Tcl_CreateChannel(&consoleChannelType, "console0",
- (ClientData)TCL_STDIN, TCL_READABLE);
- if (channel != NULL) {
- Tcl_SetChannelOption(NULL, channel, "-translation", "lf");
- Tcl_SetChannelOption(NULL, channel, "-buffering", "none");
-#ifdef HAVE_UTF
- Tcl_SetChannelOption(NULL, channel, "-encoding", "utf-8");
-#endif
- }
- Tcl_SetStdChannel(channel, TCL_STDIN);
- channel = Tcl_CreateChannel(&consoleChannelType, "console1",
- (ClientData)TCL_STDOUT, TCL_WRITABLE);
- if (channel != NULL) {
- Tcl_SetChannelOption(NULL, channel, "-translation", "lf");
- Tcl_SetChannelOption(NULL, channel, "-buffering", "none");
-#ifdef HAVE_UTF
- Tcl_SetChannelOption(NULL, channel, "-encoding", "utf-8");
-#endif
- }
- Tcl_SetStdChannel(channel, TCL_STDOUT);
- channel = Tcl_CreateChannel(&consoleChannelType, "console2",
- (ClientData)TCL_STDERR, TCL_WRITABLE);
- if (channel != NULL) {
- Tcl_SetChannelOption(NULL, channel, "-translation", "lf");
- Tcl_SetChannelOption(NULL, channel, "-buffering", "none");
-#ifdef HAVE_UTF
- Tcl_SetChannelOption(NULL, channel, "-encoding", "utf-8");
-#endif
- }
- Tcl_SetStdChannel(channel, TCL_STDERR);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * Blt_ConsoleInit --
- *
- * Initialize the console. This code actually creates a new
- * application and associated interpreter. This effectivly hides
- * the implementation from the main application.
- *
- * Results:
- * None.
- *
- * Side effects:
- * A new console it created.
- *
- *---------------------------------------------------------------------------
- */
-
-int
-Blt_ConsoleInit(interp)
- Tcl_Interp *interp; /* Interpreter to use for prompting. */
-{
- Tcl_Interp *consoleInterp;
- ConsoleInfo *info;
- Tk_Window tkMain = Tk_MainWindow(interp);
-
-#ifdef MAC_TCL
- static char initCmd[] = "source -rsrc {Console}";
-#else
- static char initCmd[] = "source $tk_library/console.tcl";
-#endif
-
- consoleInterp = Tcl_CreateInterp();
- if (consoleInterp == NULL) {
- goto error;
- }
-#if defined(HAVE_BROKEN_LIB_PATH) && defined(TCLLIBPATH)
- Tcl_SetVar(consoleInterp, "tclDefaultLibrary",
- TCLLIBPATH, TCL_GLOBAL_ONLY);
-#endif
- /*
- * Initialized TCL and Tk.
- */
- if (Tcl_Init(consoleInterp) != TCL_OK) {
- goto error;
- }
- if (Tk_Init(consoleInterp) != TCL_OK) {
- goto error;
- }
- gStdoutInterp = interp;
-
- /*
- * Add console commands to the interp
- */
- info = Tcl_Alloc(sizeof(ConsoleInfo));
- info->interp = interp;
- info->consoleInterp = consoleInterp;
- Tcl_CreateCommand(interp, "console", ConsoleCmd, info,
- (Tcl_CmdDeleteProc *)ConsoleDeleteProc);
- Tcl_CreateCommand(consoleInterp, "consoleinterp", InterpreterCmd, info,
- (Tcl_CmdDeleteProc *)NULL);
-
- Tk_CreateEventHandler(tkMain, StructureNotifyMask, ConsoleEventProc, info);
-
- Tcl_Preserve(consoleInterp);
- if (Tcl_Eval(consoleInterp, initCmd) == TCL_ERROR) {
- /* goto error; -- no problem for now... */
- printf("Eval error: %s", consoleInterp->result);
- }
- Tcl_Release((ClientData)consoleInterp);
- return TCL_OK;
-
- error:
- if (consoleInterp != NULL) {
- Tcl_DeleteInterp(consoleInterp);
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConsolePrint --
- *
- * Prints to the give text to the console. Given the main interp
- * this functions find the appropiate console interp and forwards
- * the text to be added to that console.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-ConsolePrint(interp, devId, buffer, size)
- Tcl_Interp *interp; /* Main interpreter. */
- int devId; /* TCL_STDOUT for stdout, TCL_STDERR for
- * stderr. */
- const char *buffer; /* Text buffer. */
- long size; /* Size of text buffer. */
-{
- Tcl_DString command, output;
- Tcl_CmdInfo cmdInfo;
- char *cmd;
- ConsoleInfo *info;
- Tcl_Interp *consoleInterp;
- int result;
-
- if (interp == NULL) {
- return;
- }
- if (devId == TCL_STDERR) {
- cmd = "tkConsoleOutput stderr ";
- } else {
- cmd = "tkConsoleOutput stdout ";
- }
-
- result = Tcl_GetCommandInfo(interp, "console", &cmdInfo);
- if (result == 0) {
- return;
- }
- info = (ConsoleInfo *) cmdInfo.clientData;
-
- Tcl_DStringInit(&output);
- Tcl_DStringAppend(&output, buffer, size);
-
- Tcl_DStringInit(&command);
- Tcl_DStringAppend(&command, cmd, strlen(cmd));
- Tcl_DStringAppendElement(&command, output.string);
-
- consoleInterp = info->consoleInterp;
- Tcl_Preserve((ClientData)consoleInterp);
- Tcl_Eval(consoleInterp, command.string);
- Tcl_Release((ClientData)consoleInterp);
-
- Tcl_DStringFree(&command);
- Tcl_DStringFree(&output);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConsoleOutput--
- *
- * Writes the given output on the IO channel. Returns count of how
- * many characters were actually written, and an error indication.
- *
- * Results:
- * A count of how many characters were written is returned and an
- * error indication is returned in an output argument.
- *
- * Side effects:
- * Writes output on the actual channel.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-ConsoleOutput(instanceData, buf, toWrite, errorCode)
- ClientData instanceData; /* Indicates which device to use. */
- char *buf; /* The data buffer. */
- int toWrite; /* How many bytes to write? */
- int *errorCode; /* Where to store error code. */
-{
- *errorCode = 0;
- Tcl_SetErrno(0);
-
- if (gStdoutInterp != NULL) {
- ConsolePrint(gStdoutInterp, (int)instanceData, buf, toWrite);
- }
- return toWrite;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConsoleInput --
- *
- * Read input from the console. Not currently implemented.
- *
- * Results:
- * Always returns EOF.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
- /* ARGSUSED */
-static int
-ConsoleInput(instanceData, buf, bufSize, errorCode)
- ClientData instanceData; /* Not Used.. */
- char *buf; /* Where to store data read. */
- int bufSize; /* How much space is available
- * in the buffer? */
- int *errorCode; /* Where to store error code. */
-{
- return 0; /* Always return EOF. */
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConsoleClose --
- *
- * Closes the IO channel.
- *
- * Results:
- * Always returns 0 (success).
- *
- * Side effects:
- * Frees the dummy file associated with the channel.
- *
- *---------------------------------------------------------------------------
- */
-
- /* ARGSUSED */
-static int
-ConsoleClose(instanceData, interp)
- ClientData instanceData; /* Not Used.. */
- Tcl_Interp *interp; /* Not Used.. */
-{
- return 0;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConsoleWatch --
- *
- * Called by the notifier to set up the console device so that
- * events will be noticed. Since there are no events on the
- * console, this routine just returns without doing anything.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
- /* ARGSUSED */
-static void
-ConsoleWatch(instanceData, mask)
- ClientData instanceData; /* Device ID for the channel. */
- int mask; /* OR-ed combination of
- * TCL_READABLE, TCL_WRITABLE and
- * TCL_EXCEPTION, for the events
- * we are interested in. */
-{
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConsoleHandle --
- *
- * Invoked by the generic IO layer to get a handle from a channel.
- * Because console channels are not devices, this function always
- * fails.
- *
- * Results:
- * Always returns TCL_ERROR.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
- /* ARGSUSED */
-static int
-ConsoleHandle(instanceData, direction, handlePtr)
- ClientData instanceData; /* Device ID for the channel. */
- int direction; /* TCL_READABLE or TCL_WRITABLE to indicate
- * which direction of the channel is being
- * requested. */
- ClientData *handlePtr; /* Where to store handle */
-{
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConsoleCmd --
- *
- * The console command implements a TCL interface to the various console
- * options.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-ConsoleCmd(clientData, interp, argc, argv)
- ClientData clientData; /* Not used. */
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
-{
- ConsoleInfo *info = (ConsoleInfo *) clientData;
- char c;
- int length;
- int result;
- Tcl_Interp *consoleInterp;
-
- if (argc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " option ?arg arg ...?\"", (char *)NULL);
- return TCL_ERROR;
- }
- c = argv[1][0];
- length = strlen(argv[1]);
- result = TCL_OK;
- consoleInterp = info->consoleInterp;
- Tcl_Preserve(consoleInterp);
- if ((c == 't') && (strncmp(argv[1], "title", length)) == 0) {
- Tcl_DString dString;
-
- Tcl_DStringInit(&dString);
- Tcl_DStringAppend(&dString, "wm title . ", -1);
- if (argc == 3) {
- Tcl_DStringAppendElement(&dString, argv[2]);
- }
- Tcl_Eval(consoleInterp, Tcl_DStringValue(&dString));
- Tcl_DStringFree(&dString);
- } else if ((c == 'h') && (strncmp(argv[1], "hide", length)) == 0) {
- Tcl_Eval(info->consoleInterp, "wm withdraw .");
- } else if ((c == 's') && (strncmp(argv[1], "show", length)) == 0) {
- Tcl_Eval(info->consoleInterp, "wm deiconify .");
- } else if ((c == 'e') && (strncmp(argv[1], "eval", length)) == 0) {
- if (argc == 3) {
- Tcl_Eval(info->consoleInterp, argv[2]);
- } else {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " eval command\"", (char *)NULL);
- return TCL_ERROR;
- }
- } else {
- Tcl_AppendResult(interp, "bad option \"", argv[1],
- "\": should be hide, show, or title",
- (char *)NULL);
- result = TCL_ERROR;
- }
- Tcl_Release(consoleInterp);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InterpreterCmd --
- *
- * This command allows the console interp to communicate with the
- * main interpreter.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-InterpreterCmd(clientData, interp, argc, argv)
- ClientData clientData; /* Not used. */
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
-{
- ConsoleInfo *info = (ConsoleInfo *) clientData;
- char c;
- int length;
- int result;
- Tcl_Interp *otherInterp;
-
- if (argc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " option ?arg arg ...?\"", (char *)NULL);
- return TCL_ERROR;
- }
- c = argv[1][0];
- length = strlen(argv[1]);
- otherInterp = info->interp;
- Tcl_Preserve(otherInterp);
- if ((c == 'e') && (strncmp(argv[1], "eval", length)) == 0) {
- result = Tcl_GlobalEval(otherInterp, argv[2]);
- Tcl_AppendResult(interp, otherInterp->result, (char *)NULL);
- } else if ((c == 'r') && (strncmp(argv[1], "record", length)) == 0) {
- Tcl_RecordAndEval(otherInterp, argv[2], TCL_EVAL_GLOBAL);
- result = TCL_OK;
- Tcl_AppendResult(interp, otherInterp->result, (char *)NULL);
- } else {
- Tcl_AppendResult(interp, "bad option \"", argv[1],
- "\": should be eval or record",
- (char *)NULL);
- result = TCL_ERROR;
- }
- Tcl_Release(otherInterp);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConsoleDeleteProc --
- *
- * If the console command is deleted we destroy the console window
- * and all associated data structures.
- *
- * Results:
- * None.
- *
- * Side effects:
- * A new console it created.
- *
- *---------------------------------------------------------------------------
- */
-
-void
-ConsoleDeleteProc(clientData)
- ClientData clientData;
-{
- ConsoleInfo *info = (ConsoleInfo *) clientData;
-
- Tcl_DeleteInterp(info->consoleInterp);
- info->consoleInterp = NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConsoleEventProc --
- *
- * This event procedure is registered on the main window of the
- * slave interpreter. If the user or a running script causes the
- * main window to be destroyed, then we need to inform the console
- * interpreter by invoking "tkConsoleExit".
- *
- * Results:
- * None.
- *
- * Side effects:
- * Invokes the "tkConsoleExit" procedure in the console interp.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-ConsoleEventProc(ClientData clientData, XEvent *eventPtr)
-{
- ConsoleInfo *info = clientData;
- Tcl_Interp *consoleInterp;
-
- if (eventPtr->type == DestroyNotify) {
- consoleInterp = info->consoleInterp;
-
- /*
- * It is possible that the console interpreter itself has
- * already been deleted. In that case the consoleInterp
- * field will be set to NULL. If the interpreter is already
- * gone, we do not have to do any work here.
- */
-
- if (consoleInterp == (Tcl_Interp *)NULL) {
- return;
- }
- Tcl_Preserve(consoleInterp);
- Tcl_Eval(consoleInterp, "tkConsoleExit");
- Tcl_Release(consoleInterp);
- }
-}
-
-#endif /* _TCL_VERSION >= 8.2.0 */
diff --git a/blt3.0.1/src/tkDisplay.h b/blt3.0.1/src/tkDisplay.h
deleted file mode 100644
index ea8ed05..0000000
--- a/blt3.0.1/src/tkDisplay.h
+++ /dev/null
@@ -1,908 +0,0 @@
-
-/*
- * tkDisplay.h --
- *
- * Excerpts from tkInt.h. Used to examine window internals.
- *
- * Copyright 1998-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This file contains excerpts from tkInt.h of the TCL library distribution.
- *
- * Copyright (c) 1987-1993 The Regents of the University of
- * California.
- *
- * 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.
- *
- */
-
-#ifndef _TK_DISPLAY_H
-#define _TK_DISPLAY_H
-
-typedef struct _TkIdStack TkIdStack;
-typedef struct _TkErrorHandler TkErrorHandler;
-typedef struct _TkSelectionInfo TkSelectionInfo;
-typedef struct _TkClipboardTarget TkClipboardTarget;
-
-typedef struct _TkWindow TkWindow;
-typedef struct _TkWindowEvent TkWindowEvent;
-typedef struct _TkEventHandler TkEventHandler;
-typedef struct _TkSelHandler TkSelHandler;
-typedef struct _TkWinInfo TkWinInfo;
-typedef struct _TkClassProcs TkClassProcs;
-typedef struct _TkWindowPrivate TkWindowPrivate;
-typedef struct _TkGrabEvent TkGrabEvent;
-typedef struct _TkColormap TkColormap;
-typedef struct _TkStressedCmap TkStressedCmap;
-typedef struct _TkWmInfo TkWmInfo;
-
-typedef struct _TkBindInfo *TkBindInfo;
-#ifdef notdef
-typedef struct _TkRegion *TkRegion;
-#endif
-typedef struct _TkpCursor *TkpCursor;
-
-#ifdef XNQueryInputStyle
-#define TK_USE_INPUT_METHODS
-#endif /* XNQueryInputStyle */
-
-/*
- * This defines whether we should try to use XIM over-the-spot style
- * input. Allow users to override it. It is a much more elegant use
- * of XIM, but uses a bit more memory.
- */
-#ifndef TK_XIM_SPOT
-# define TK_XIM_SPOT 1
-#endif /* TK_XIM_SPOT */
-
-#ifndef TK_REPARENTED
-#define TK_REPARENTED 0
-#endif /* TK_REPARENTED */
-
-/*
- * Tk keeps one of the following data structures for each main
- * window (created by a call to TkCreateMainWindow). It stores
- * information that is shared by all of the windows associated
- * with a particular main window.
- */
-
-typedef struct TkMainInfo {
- int refCount; /* Number of windows whose "mainPtr" fields
- * point here. When this becomes zero, can
- * free up the structure (the reference
- * count is zero because windows can get
- * deleted in almost any order; the main
- * window isn't necessarily the last one
- * deleted). */
- struct TkWindow *winPtr; /* Pointer to main window. */
- Tcl_Interp *interp; /* Interpreter associated with application. */
- Tcl_HashTable nameTable; /* Hash table mapping path names to TkWindow
- * structs for all windows related to this
- * main window. Managed by tkWindow.c. */
- long deletionEpoch; /* Incremented by window deletions */
- Tk_BindingTable bindingTable;
- /* Used in conjunction with "bind" command
- * to bind events to TCL commands. */
- TkBindInfo bindInfo; /* Information used by tkBind.c on a per
- * application basis. */
- struct TkFontInfo *fontInfoPtr;
- /* Information used by tkFont.c on a per
- * application basis. */
-
- /*
- * Information used only by tkFocus.c and tk*Embed.c:
- */
-
- struct TkToplevelFocusInfo *tlFocusPtr;
- /* First in list of records containing focus
- * information for each top-level in the
- * application. Used only by tkFocus.c. */
- struct TkDisplayFocusInfo *displayFocusPtr;
- /* First in list of records containing focus
- * information for each display that this
- * application has ever used. Used only
- * by tkFocus.c. */
-
- struct ElArray *optionRootPtr;
- /* Top level of option hierarchy for this
- * main window. NULL means uninitialized.
- * Managed by tkOption.c. */
- Tcl_HashTable imageTable; /* Maps from image names to Tk_ImageMaster
- * structures. Managed by tkImage.c. */
- int strictMotif; /* This is linked to the tk_strictMotif
- * global variable. */
-
-#if (_TK_VERSION >= _VERSION(8,5,0))
- int alwaysShowSelection; /* This is linked to the
- * ::tk::AlwaysShowSelection variable. */
-#endif /* TK_VERSION >= 8.5.0 */
- struct TkMainInfo *nextPtr; /* Next in list of all main windows managed by
- * this process. */
-} TkMainInfo;
-
-#if (_TK_VERSION >= _VERSION(8,1,0))
-
-typedef struct TkCaret {
- struct TkWindow *winPtr; /* the window on which we requested caret
- * placement */
- int x; /* relative x coord of the caret */
- int y; /* relative y coord of the caret */
- int height; /* specified height of the window */
-} TkCaret;
-
-/*
- * One of the following structures is maintained for each display
- * containing a window managed by Tk. In part, the structure is
- * used to store thread-specific data, since each thread will have
- * its own TkDisplay structure.
- */
-
-typedef struct _TkDisplay {
- Display *display; /* Xlib's info about display. */
- struct _TkDisplay *nextPtr; /* Next in list of all displays. */
- char *name; /* Name of display (with any screen
- * identifier removed). Malloc-ed. */
- Time lastEventTime; /* Time of last event received for this
- * display. */
-
- /*
- * Information used primarily by tk3d.c:
- */
-
- int borderInit; /* 0 means borderTable needs initializing. */
- Tcl_HashTable borderTable; /* Maps from color name to TkBorder
- * structure. */
-
- /*
- * Information used by tkAtom.c only:
- */
-
- int atomInit; /* 0 means stuff below hasn't been
- * initialized yet. */
- Tcl_HashTable nameTable; /* Maps from names to Atom's. */
- Tcl_HashTable atomTable; /* Maps from Atom's back to names. */
-
- /*
- * Information used primarily by tkBind.c:
- */
-
- int bindInfoStale; /* Non-zero means the variables in this
- * part of the structure are potentially
- * incorrect and should be recomputed. */
- unsigned int modeModMask; /* Has one bit set to indicate the modifier
- * corresponding to "mode shift". If no
- * such modifier, than this is zero. */
- unsigned int metaModMask; /* Has one bit set to indicate the modifier
- * corresponding to the "Meta" key. If no
- * such modifier, then this is zero. */
- unsigned int altModMask; /* Has one bit set to indicate the modifier
- * corresponding to the "Meta" key. If no
- * such modifier, then this is zero. */
- enum {
- LU_IGNORE, LU_CAPS, LU_SHIFT
- } lockUsage; /* Indicates how to interpret lock modifier. */
- int numModKeyCodes; /* Number of entries in modKeyCodes array
- * below. */
- KeyCode *modKeyCodes; /* Pointer to an array giving keycodes for
- * all of the keys that have modifiers
- * associated with them. Malloc'ed, but
- * may be NULL. */
-
- /*
- * Information used by tkBitmap.c only:
- */
-
- int bitmapInit; /* 0 means tables above need initializing. */
- int bitmapAutoNumber; /* Used to number bitmaps. */
- Tcl_HashTable bitmapNameTable;
- /* Maps from name of bitmap to the first
- * TkBitmap record for that name. */
- Tcl_HashTable bitmapIdTable;/* Maps from bitmap id to the TkBitmap
- * structure for the bitmap. */
- Tcl_HashTable bitmapDataTable;
- /* Used by Tk_GetBitmapFromData to map from
- * a collection of in-core data about a
- * bitmap to a reference giving an auto-
- * matically-generated name for the bitmap. */
-
- /*
- * Information used by tkCanvas.c only:
- */
-
- int numIdSearches;
- int numSlowSearches;
-
- /*
- * Used by tkColor.c only:
- */
-
- int colorInit; /* 0 means color module needs initializing. */
- TkStressedCmap *stressPtr; /* First in list of colormaps that have
- * filled up, so we have to pick an
- * approximate color. */
- Tcl_HashTable colorNameTable;
- /* Maps from color name to TkColor structure
- * for that color. */
- Tcl_HashTable colorValueTable;
- /* Maps from integer RGB values to TkColor
- * structures. */
-
- /*
- * Used by tkCursor.c only:
- */
-
- int cursorInit; /* 0 means cursor module need initializing. */
- Tcl_HashTable cursorNameTable;
- /* Maps from a string name to a cursor to the
- * TkCursor record for the cursor. */
- Tcl_HashTable cursorDataTable;
- /* Maps from a collection of in-core data
- * about a cursor to a TkCursor structure. */
- Tcl_HashTable cursorIdTable;
- /* Maps from a cursor id to the TkCursor
- * structure for the cursor. */
- char cursorString[20]; /* Used to store a cursor id string. */
- Font cursorFont; /* Font to use for standard cursors.
- * None means font not loaded yet. */
-
- /*
- * Information used by tkError.c only:
- */
-
- struct TkErrorHandler *errorPtr;
- /* First in list of error handlers
- * for this display. NULL means
- * no handlers exist at present. */
- int deleteCount; /* Counts # of handlers deleted since
- * last time inactive handlers were
- * garbage-collected. When this number
- * gets big, handlers get cleaned up. */
-
- /*
- * Used by tkEvent.c only:
- */
-
- struct TkWindowEvent *delayedMotionPtr;
- /* Points to a malloc-ed motion event
- * whose processing has been delayed in
- * the hopes that another motion event
- * will come along right away and we can
- * merge the two of them together. NULL
- * means that there is no delayed motion
- * event. */
-
- /*
- * Information used by tkFocus.c only:
- */
-
- int focusDebug; /* 1 means collect focus debugging
- * statistics. */
- struct TkWindow *implicitWinPtr;
- /* If the focus arrived at a toplevel window
- * implicitly via an Enter event (rather
- * than via a FocusIn event), this points
- * to the toplevel window. Otherwise it is
- * NULL. */
- struct TkWindow *focusPtr; /* Points to the window on this display that
- * should be receiving keyboard events. When
- * multiple applications on the display have
- * the focus, this will refer to the
- * innermost window in the innermost
- * application. This information isn't used
- * under Unix or Windows, but it's needed on
- * the Macintosh. */
-
- /*
- * Information used by tkGC.c only:
- */
-
- Tcl_HashTable gcValueTable; /* Maps from a GC's values to a TkGC structure
- * describing a GC with those values. */
- Tcl_HashTable gcIdTable; /* Maps from a GC to a TkGC. */
- int gcInit; /* 0 means the tables below need
- * initializing. */
-
- /*
- * Information used by tkGeometry.c only:
- */
-
- Tcl_HashTable maintainHashTable;
- /* Hash table that maps from a master's
- * Tk_Window token to a list of slaves
- * managed by that master. */
- int geomInit;
-
- /*
- * Information used by tkGet.c only:
- */
-
- Tcl_HashTable uidTable; /* Stores all Tk_Uids used in a thread. */
- int uidInit; /* 0 means uidTable needs initializing. */
-
- /*
- * Information used by tkGrab.c only:
- */
-
- struct TkWindow *grabWinPtr;
- /* Window in which the pointer is currently
- * grabbed, or NULL if none. */
- struct TkWindow *eventualGrabWinPtr;
- /* Value that grabWinPtr will have once the
- * grab event queue (below) has been
- * completely emptied. */
- struct TkWindow *buttonWinPtr;
- /* Window in which first mouse button was
- * pressed while grab was in effect, or NULL
- * if no such press in effect. */
- struct TkWindow *serverWinPtr;
- /* If no application contains the pointer then
- * this is NULL. Otherwise it contains the
- * last window for which we've gotten an
- * Enter or Leave event from the server (i.e.
- * the last window known to have contained
- * the pointer). Doesn't reflect events
- * that were synthesized in tkGrab.c. */
- TkGrabEvent *firstGrabEventPtr;
- /* First in list of enter/leave events
- * synthesized by grab code. These events
- * must be processed in order before any other
- * events are processed. NULL means no such
- * events. */
- TkGrabEvent *lastGrabEventPtr;
- /* Last in list of synthesized events, or NULL
- * if list is empty. */
- int grabFlags; /* Miscellaneous flag values. See definitions
- * in tkGrab.c. */
-
- /*
- * Information used by tkGrid.c only:
- */
-
- int gridInit; /* 0 means table below needs initializing. */
- Tcl_HashTable gridHashTable;/* Maps from Tk_Window tokens to
- * corresponding Grid structures. */
-
- /*
- * Information used by tkImage.c only:
- */
-
- int imageId; /* Value used to number image ids. */
-
- /*
- * Information used by tkMacWinMenu.c only:
- */
-
- int postCommandGeneration;
-
- /*
- * Information used by tkOption.c only.
- */
-
-
-
- /*
- * Information used by tkPack.c only.
- */
-
- int packInit; /* 0 means table below needs initializing. */
- Tcl_HashTable packerHashTable;
- /* Maps from Tk_Window tokens to
- * corresponding Packer structures. */
-
-
- /*
- * Information used by tkPlace.c only.
- */
-
- int placeInit; /* 0 means tables below need initializing. */
- Tcl_HashTable masterTable; /* Maps from Tk_Window toke to the Master
- * structure for the window, if it exists. */
- Tcl_HashTable slaveTable; /* Maps from Tk_Window toke to the Slave
- * structure for the window, if it exists. */
-
- /*
- * Information used by tkSelect.c and tkClipboard.c only:
- */
-
-
- struct TkSelectionInfo *selectionInfoPtr;
- /* First in list of selection information
- * records. Each entry contains information
- * about the current owner of a particular
- * selection on this display. */
- Atom multipleAtom; /* Atom for MULTIPLE. None means
- * selection stuff isn't initialized. */
- Atom incrAtom; /* Atom for INCR. */
- Atom targetsAtom; /* Atom for TARGETS. */
- Atom timestampAtom; /* Atom for TIMESTAMP. */
- Atom textAtom; /* Atom for TEXT. */
- Atom compoundTextAtom; /* Atom for COMPOUND_TEXT. */
- Atom applicationAtom; /* Atom for TK_APPLICATION. */
- Atom windowAtom; /* Atom for TK_WINDOW. */
- Atom clipboardAtom; /* Atom for CLIPBOARD. */
-#if (_TK_VERSION >= _VERSION(8,4,0))
- Atom utf8Atom;
-#endif /* TK_VERSION >= 8.4.0 */
- Tk_Window clipWindow; /* Window used for clipboard ownership and to
- * retrieve selections between processes. NULL
- * means clipboard info hasn't been
- * initialized. */
- int clipboardActive; /* 1 means we currently own the clipboard
- * selection, 0 means we don't. */
- struct TkMainInfo *clipboardAppPtr;
- /* Last application that owned clipboard. */
- struct TkClipboardTarget *clipTargetPtr;
- /* First in list of clipboard type information
- * records. Each entry contains information
- * about the buffers for a given selection
- * target. */
-
- /*
- * Information used by tkSend.c only:
- */
-
- Tk_Window commTkwin; /* Window used for communication
- * between interpreters during "send"
- * commands. NULL means send info hasn't
- * been initialized yet. */
- Atom commProperty; /* X's name for comm property. */
- Atom registryProperty; /* X's name for property containing
- * registry of interpreter names. */
- Atom appNameProperty; /* X's name for property used to hold the
- * application name on each comm window. */
-
- /*
- * Information used by tkXId.c only:
- */
-
- struct TkIdStack *idStackPtr;
- /* First in list of chunks of free resource
- * identifiers, or NULL if there are no free
- * resources. */
- XID(*defaultAllocProc)(Display *display);
- /* Default resource allocator for display. */
- struct TkIdStack *windowStackPtr;
- /* First in list of chunks of window
- * identifers that can't be reused right
- * now. */
-#if (_TK_VERSION < _VERSION(8,4,0))
- int idCleanupScheduled; /* 1 means a call to WindowIdCleanup has
- * already been scheduled, 0 means it
- * hasn't. */
-#else
- Tcl_TimerToken idCleanupScheduled;
- /* If set, it means a call to WindowIdCleanup
- * has already been scheduled, 0 means it
- * hasn't. */
-#endif /* TK_VERSION < 8.4.0 */
- /*
- * Information used by tkUnixWm.c and tkWinWm.c only:
- */
-
-#if (_TK_VERSION < _VERSION(8,4,0))
- int wmTracing; /* Used to enable or disable tracing in
- * this module. If tracing is enabled,
- * then information is printed on
- * standard output about interesting
- * interactions with the window manager. */
-#endif /* TK_VERSION < 8.4.0 */
- struct TkWmInfo *firstWmPtr; /* Points to first top-level window. */
- struct TkWmInfo *foregroundWmPtr;
- /* Points to the foreground window. */
-
- /*
- * Information maintained by tkWindow.c for use later on by tkXId.c:
- */
-
-
- int destroyCount; /* Number of Tk_DestroyWindow operations
- * in progress. */
- unsigned long lastDestroyRequest;
- /* Id of most recent XDestroyWindow request;
- * can re-use ids in windowStackPtr when
- * server has seen this request and event
- * queue is empty. */
-
- /*
- * Information used by tkVisual.c only:
- */
-
- TkColormap *cmapPtr; /* First in list of all non-default colormaps
- * allocated for this display. */
-
- /*
- * Miscellaneous information:
- */
-
-#ifdef TK_USE_INPUT_METHODS
- XIM inputMethod; /* Input method for this display */
-# if (_TK_VERSION >= _VERSION(8,5,0))
- XIMStyle inputStyle; /* Input style selected for this display. */
-# endif /* TK_VERSION >= 8.5.0 */
-# if (_TK_VERSION >= _VERSION(8,4,0))
-# if TK_XIM_SPOT
- XFontSet inputXfs; /* XFontSet cached for over-the-spot XIM. */
-# endif /* TK_XIM_SPOT */
-# endif /* _TK_VERSION >= 8.4 */
-#endif /* TK_USE_INPUT_METHODS */
- Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */
- int refCount; /* Reference count of how many Tk applications
- * are using this display. Used to clean up
- * the display when we no longer have any
- * Tk applications using it.
- */
- /*
- * The following field were all added for Tk8.3
- */
- int mouseButtonState; /* current mouse button state for this
- * display */
-
-#if (_TK_VERSION < _VERSION(8,4,0))
- int warpInProgress;
-#else
- Window mouseButtonWindow; /* Window the button state was set in, added
- * in Tk 8.4. */
-#endif /* TK_VERSION < 8.4.0 */
- Window warpWindow;
- int warpX;
- int warpY;
-
-#if (_TK_VERSION < _VERSION(8,4,0))
- int useInputMethods; /* Whether to use input methods */
- long deletionEpoch; /* Incremented by window deletions */
-#endif /* TK_VERSION < 8.4.0 */
- /*
- * The following field(s) were all added for Tk8.4
- */
- unsigned int flags; /* Various flag values: these are all
- * defined in below. */
- TkCaret caret; /* information about the caret for this
- * display. This is not a pointer. */
-#if (_TK_VERSION >= _VERSION(8,4,0))
- int iconDataSize; /* Size of default iconphoto image data. */
- unsigned char *iconDataPtr; /* Default iconphoto image data, if set. */
-#endif /* TK_VERSION > 8.4.0 */
-
-} TkDisplay;
-
-#else
-
-/*
- * One of the following structures is maintained for each display
- * containing a window managed by Tk:
- */
-typedef struct _TkDisplay {
- Display *display; /* Xlib's info about display. */
- struct _TkDisplay *nextPtr; /* Next in list of all displays. */
- char *name; /* Name of display (with any screen
- * identifier removed). Malloc-ed. */
- Time lastEventTime; /* Time of last event received for this
- * display. */
-
- /*
- * Information used primarily by tkBind.c:
- */
-
- int bindInfoStale; /* Non-zero means the variables in this
- * part of the structure are potentially
- * incorrect and should be recomputed. */
- unsigned int modeModMask; /* Has one bit set to indicate the modifier
- * corresponding to "mode shift". If no
- * such modifier, than this is zero. */
- unsigned int metaModMask; /* Has one bit set to indicate the modifier
- * corresponding to the "Meta" key. If no
- * such modifier, then this is zero. */
- unsigned int altModMask; /* Has one bit set to indicate the modifier
- * corresponding to the "Meta" key. If no
- * such modifier, then this is zero. */
- enum {
- LU_IGNORE, LU_CAPS, LU_SHIFT
- } lockUsage;
- /* Indicates how to interpret lock modifier. */
- int numModKeyCodes; /* Number of entries in modKeyCodes array
- * below. */
- KeyCode *modKeyCodes; /* Pointer to an array giving keycodes for
- * all of the keys that have modifiers
- * associated with them. Malloc'ed, but
- * may be NULL. */
-
- /*
- * Information used by tkError.c only:
- */
-
- TkErrorHandler *errorPtr;
- /* First in list of error handlers
- * for this display. NULL means
- * no handlers exist at present. */
- int deleteCount; /* Counts # of handlers deleted since
- * last time inactive handlers were
- * garbage-collected. When this number
- * gets big, handlers get cleaned up. */
-
- /*
- * Information used by tkSend.c only:
- */
-
- Tk_Window commTkwin; /* Window used for communication
- * between interpreters during "send"
- * commands. NULL means send info hasn't
- * been initialized yet. */
- Atom commProperty; /* X's name for comm property. */
- Atom registryProperty; /* X's name for property containing
- * registry of interpreter names. */
- Atom appNameProperty; /* X's name for property used to hold the
- * application name on each comm window. */
-
- /*
- * Information used by tkSelect.c and tkClipboard.c only:
- */
-
- TkSelectionInfo *selectionInfoPtr;
- /* First in list of selection information
- * records. Each entry contains information
- * about the current owner of a particular
- * selection on this display. */
- Atom multipleAtom; /* Atom for MULTIPLE. None means
- * selection stuff isn't initialized. */
- Atom incrAtom; /* Atom for INCR. */
- Atom targetsAtom; /* Atom for TARGETS. */
- Atom timestampAtom; /* Atom for TIMESTAMP. */
- Atom textAtom; /* Atom for TEXT. */
- Atom compoundTextAtom; /* Atom for COMPOUND_TEXT. */
- Atom applicationAtom; /* Atom for TK_APPLICATION. */
- Atom windowAtom; /* Atom for TK_WINDOW. */
- Atom clipboardAtom; /* Atom for CLIPBOARD. */
-
- Tk_Window clipWindow; /* Window used for clipboard ownership and to
- * retrieve selections between processes. NULL
- * means clipboard info hasn't been
- * initialized. */
- int clipboardActive; /* 1 means we currently own the clipboard
- * selection, 0 means we don't. */
- TkMainInfo *clipboardAppPtr;
- /* Last application that owned clipboard. */
- TkClipboardTarget *clipTargetPtr;
- /* First in list of clipboard type information
- * records. Each entry contains information
- * about the buffers for a given selection
- * target. */
-
- /*
- * Information used by tkAtom.c only:
- */
-
- int atomInit; /* 0 means stuff below hasn't been
- * initialized yet. */
- Tcl_HashTable nameTable; /* Maps from names to Atom's. */
- Tcl_HashTable atomTable; /* Maps from Atom's back to names. */
-
- /*
- * Information used by tkCursor.c only:
- */
-
- Font cursorFont; /* Font to use for standard cursors.
- * None means font not loaded yet. */
-
- /*
- * Information used by tkGrab.c only:
- */
-
- TkWindow *grabWinPtr;
- /* Window in which the pointer is currently
- * grabbed, or NULL if none. */
- TkWindow *eventualGrabWinPtr;
- /* Value that grabWinPtr will have once the
- * grab event queue (below) has been
- * completely emptied. */
- TkWindow *buttonWinPtr;
- /* Window in which first mouse button was
- * pressed while grab was in effect, or NULL
- * if no such press in effect. */
- TkWindow *serverWinPtr;
- /* If no application contains the pointer then
- * this is NULL. Otherwise it contains the
- * last window for which we've gotten an
- * Enter or Leave event from the server (i.e.
- * the last window known to have contained
- * the pointer). Doesn't reflect events
- * that were synthesized in tkGrab.c. */
- TkGrabEvent *firstGrabEventPtr;
- /* First in list of enter/leave events
- * synthesized by grab code. These events
- * must be processed in order before any other
- * events are processed. NULL means no such
- * events. */
- TkGrabEvent *lastGrabEventPtr;
- /* Last in list of synthesized events, or NULL
- * if list is empty. */
- int grabFlags; /* Miscellaneous flag values. See definitions
- * in tkGrab.c. */
-
- /*
- * Information used by tkXId.c only:
- */
-
- TkIdStack *idStackPtr;
- /* First in list of chunks of free resource
- * identifiers, or NULL if there are no free
- * resources. */
- XID(*defaultAllocProc)(Display *display);
- /* Default resource allocator for display. */
- TkIdStack *windowStackPtr;
- /* First in list of chunks of window
- * identifers that can't be reused right
- * now. */
- int idCleanupScheduled; /* 1 means a call to WindowIdCleanup has
- * already been scheduled, 0 means it
- * hasn't. */
-
- /*
- * Information maintained by tkWindow.c for use later on by tkXId.c:
- */
-
-
- int destroyCount; /* Number of Tk_DestroyWindow operations
- * in progress. */
- unsigned long lastDestroyRequest;
- /* Id of most recent XDestroyWindow request;
- * can re-use ids in windowStackPtr when
- * server has seen this request and event
- * queue is empty. */
-
- /*
- * Information used by tkVisual.c only:
- */
-
- TkColormap *cmapPtr; /* First in list of all non-default colormaps
- * allocated for this display. */
-
- /*
- * Information used by tkFocus.c only:
- */
- TkWindow *implicitWinPtr;
- /* If the focus arrived at a toplevel window
- * implicitly via an Enter event (rather
- * than via a FocusIn event), this points
- * to the toplevel window. Otherwise it is
- * NULL. */
- TkWindow *focusPtr; /* Points to the window on this display that
- * should be receiving keyboard events. When
- * multiple applications on the display have
- * the focus, this will refer to the
- * innermost window in the innermost
- * application. This information isn't used
- * under Unix or Windows, but it's needed on
- * the Macintosh. */
-
- /*
- * Used by tkColor.c only:
- */
-
- TkStressedCmap *stressPtr; /* First in list of colormaps that have
- * filled up, so we have to pick an
- * approximate color. */
-
- /*
- * Used by tkEvent.c only:
- */
-
- TkWindowEvent *delayedMotionPtr;
- /* Points to a malloc-ed motion event
- * whose processing has been delayed in
- * the hopes that another motion event
- * will come along right away and we can
- * merge the two of them together. NULL
- * means that there is no delayed motion
- * event. */
- /*
- * Miscellaneous information:
- */
-
-#ifdef TK_USE_INPUT_METHODS
- XIM inputMethod; /* Input method for this display */
-#endif /* TK_USE_INPUT_METHODS */
- Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */
- int refCount; /* Reference count of how many Tk applications
- * are using this display. Used to clean up
- * the display when we no longer have any
- * Tk applications using it.
- */
-} TkDisplay;
-
-#endif /* _TK_VERSION >= _VERSION(8,1,0) */
-
-
-struct _TkWindow {
- Display *display;
- TkDisplay *dispPtr;
- int screenNum;
- Visual *visual;
- int depth;
- Window window;
- TkWindow *childList;
- TkWindow *lastChildPtr;
- TkWindow *parentPtr;
- TkWindow *nextPtr;
- TkMainInfo *mainPtr;
- char *pathName;
- Tk_Uid nameUid;
- Tk_Uid classUid;
- XWindowChanges changes;
- unsigned int dirtyChanges;
- XSetWindowAttributes atts;
- unsigned long dirtyAtts;
- unsigned int flags;
- TkEventHandler *handlerList;
-#ifdef TK_USE_INPUT_METHODS
- XIC inputContext;
-#endif /* TK_USE_INPUT_METHODS */
- ClientData *tagPtr;
- int nTags;
- int optionLevel;
- TkSelHandler *selHandlerList;
- Tk_GeomMgr *geomMgrPtr;
- ClientData geomData;
- int reqWidth, reqHeight;
- int internalBW;
- TkWinInfo *wmInfoPtr;
- TkClassProcs *classProcsPtr;
- ClientData instanceData;
- TkWindowPrivate *privatePtr;
-
-#if (_TK_VERSION >= _VERSION(8,4,0))
- /* The remaining fields of internal border. */
- int internalBorderRight;
- int internalBorderTop;
- int internalBorderBottom;
-
- int minReqWidth; /* Minimum requested width. */
- int minReqHeight; /* Minimum requested height. */
-#endif
-};
-
-/*
- * This structure is used by the Mac and Window porting layers as
- * the internal representation of a clip_mask in a GC.
- */
-
-typedef struct {
- int type; /* One of TKP_CLIP_PIXMAP or TKP_CLIP_REGION */
- union {
- Pixmap pixmap;
- TkRegion region;
- } value;
-} TkpClipMask;
-
-#define TKP_CLIP_PIXMAP 0
-#define TKP_CLIP_REGION 1
-
-#ifdef WIN32
-#include "tkWinDisplay.h"
-#endif
-
-#endif /* _TK_DISPLAY_H */
diff --git a/blt3.0.1/src/tkFont.h b/blt3.0.1/src/tkFont.h
deleted file mode 100644
index 9c28138..0000000
--- a/blt3.0.1/src/tkFont.h
+++ /dev/null
@@ -1,179 +0,0 @@
-
-/*
- * tkFont.h --
- *
- *
- * This file contains definitions of internal Tk font structures.
- *
- * Copyright (c) 1997 by Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- */
-
-#ifndef _TK_FONT_H
-#define _TK_FONT_H
-
-/*
- * Possible values for the "weight" field in a TkFontAttributes structure.
- * Weight is a subjective term and depends on what the company that created
- * the font considers bold.
- */
-
-#define TK_FW_NORMAL 0
-#define TK_FW_BOLD 1
-
-#define TK_FW_UNKNOWN -1 /* Unknown weight. This value is used for
- * error checking and is never actually stored
- * in the weight field. */
-
-/*
- * Possible values for the "slant" field in a TkFontAttributes structure.
- */
-
-#define TK_FS_ROMAN 0
-#define TK_FS_ITALIC 1
-#define TK_FS_OBLIQUE 2 /* This value is only used when parsing X
- * font names to determine the closest
- * match. It is only stored in the
- * XLFDAttributes structure, never in the
- * slant field of the TkFontAttributes. */
-
-#define TK_FS_UNKNOWN -1 /* Unknown slant. This value is used for
- * error checking and is never actually stored
- * in the slant field. */
-typedef struct {
- Tk_Uid family; /* Font family. The most important field. */
- int size; /* Pointsize of font, 0 for default size, or
- * negative number meaning pixel size. */
- int weight; /* Weight flag; see below for def'n. */
- int slant; /* Slant flag; see below for def'n. */
- int underline; /* Non-zero for underline font. */
- int overstrike; /* Non-zero for overstrike font. */
-} TkFontAttributes;
-
-typedef struct {
- int ascent; /* From baseline to top of font. */
- int descent; /* From baseline to bottom of font. */
- int maxWidth; /* Width of widest character in font. */
- int fixed; /* Non-zero if this is a fixed-width font,
- * 0 otherwise. */
-} TkFontMetrics;
-
-
-typedef struct _TkFont {
- /*
- * Fields used and maintained exclusively by generic code.
- */
-#if (_TK_VERSION >= _VERSION(8,1,0))
- int resourceRefCount; /* Number of active uses of this font (each
- * active use corresponds to a call to
- * Tk_AllocFontFromTable or Tk_GetFont).
- * If this count is 0, then this TkFont
- * structure is no longer valid and it isn't
- * present in a hash table: it is being
- * kept around only because there are objects
- * referring to it. The structure is freed
- * when resourceRefCount and objRefCount
- * are both 0. */
- int objRefCount; /* The number of TCL objects that reference
- * this structure. */
-#else
- int refCount; /* Number of users of the TkFont. */
-#endif
- Tcl_HashEntry *cacheHashPtr;/* Entry in font cache for this structure,
- * used when deleting it. */
- Tcl_HashEntry *namedHashPtr;/* Pointer to hash table entry that
- * corresponds to the named font that the
- * tkfont was based on, or NULL if the tkfont
- * was not based on a named font. */
-#if (_TK_VERSION >= _VERSION(8,1,0))
- Screen *screen; /* The screen where this font is valid. */
-#endif /* _TK_VERSION >= 8.1.0 */
- int tabWidth; /* Width of tabs in this font (pixels). */
- int underlinePos; /* Offset from baseline to origin of
- * underline bar (used for drawing underlines
- * on a non-underlined font). */
- int underlineHeight; /* Height of underline bar (used for drawing
- * underlines on a non-underlined font). */
-
- /*
- * Fields in the generic font structure that are filled in by
- * platform-specific code.
- */
-
- Font fid; /* For backwards compatibility with XGCValues
- * structures. Remove when TkGCValues is
- * implemented. */
- TkFontAttributes fa; /* Actual font attributes obtained when the
- * the font was created, as opposed to the
- * desired attributes passed in to
- * TkpGetFontFromAttributes(). The desired
- * metrics can be determined from the string
- * that was used to create this font. */
- TkFontMetrics fm; /* Font metrics determined when font was
- * created. */
-#if (_TK_VERSION >= _VERSION(8,1,0))
- struct _TkFont *nextPtr; /* Points to the next TkFont structure with
- * the same name. All fonts with the
- * same name (but different displays) are
- * chained together off a single entry in
- * a hash table. */
-#endif /* _TK_VERSION >= 8.1.0 */
-} TkFont;
-
-typedef struct TkXLFDAttributes {
- Tk_Uid foundry; /* The foundry of the font. */
- int slant; /* The tristate value for the slant, which
- * is significant under X. */
- int setwidth; /* The proportionate width, see below for
- * definition. */
- Tk_Uid charset; /* The actual charset string. */
-} TkXLFDAttributes;
-
-
-#ifdef notdef
-static const char *encodingList[] = {
- "ucs-2be", "iso8859-1", "jis0208", "jis0212", NULL
-};
-#endif
-/*
- * The following structure and definition is used to keep track of the
- * alternative names for various encodings. Asking for an encoding that
- * matches one of the alias patterns will result in actually getting the
- * encoding by its real name.
- */
-
-typedef struct EncodingAlias {
- char *realName; /* The real name of the encoding to load if
- * the provided name matched the pattern. */
- char *aliasPattern; /* Pattern for encoding name, of the form
- * that is acceptable to Tcl_StringMatch. */
-} EncodingAlias;
-
-/*
- * Just some utility structures used for passing around values in helper
- * procedures.
- */
-
-typedef struct FontAttributes {
- TkFontAttributes fa;
- TkXLFDAttributes xa;
-} FontAttributes;
-
-typedef struct TkFontInfo {
- Tcl_HashTable fontCache; /* Map a string to an existing Tk_Font.
- * Keys are string font names, values are
- * TkFont pointers. */
- Tcl_HashTable namedTable; /* Map a name to a set of attributes for a
- * font, used when constructing a Tk_Font from
- * a named font description. Keys are
- * strings, values are NamedFont pointers. */
- TkMainInfo *mainPtr; /* Application that owns this structure. */
- int updatePending; /* Non-zero when a World Changed event has
- * already been queued to handle a change to
- * a named font. */
-} TkFontInfo;
-
-#endif /* _TK_FONT_H */
diff --git a/blt3.0.1/src/tkFrame.c b/blt3.0.1/src/tkFrame.c
deleted file mode 100644
index 29ddf28..0000000
--- a/blt3.0.1/src/tkFrame.c
+++ /dev/null
@@ -1,975 +0,0 @@
-/*
- * tkFrame.c --
- *
- * This module implements "frame" and "toplevel" widgets for
- * the Tk toolkit. Frames are windows with a background color
- * and possibly a 3-D effect, but not much else in the way of
- * attributes.
- *
- * Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994-1995 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * SCCS: @(#) tkFrame.c 1.68 96/02/15 18:53:30
- */
-
-#include "bltInt.h"
-#include "bltBgStyle.h"
-
-#ifndef NO_TKFRAME
-
-/*
- * Defaults for frames:
- */
-
-#define DEF_FRAME_BACKGROUND STD_NORMAL_BACKGROUND
-#define DEF_FRAME_BG_MONO STD_NORMAL_BG_MONO
-#define DEF_FRAME_BORDERWIDTH "0"
-#define DEF_FRAME_CLASS "Frame"
-#define DEF_FRAME_COLORMAP ""
-#define DEF_FRAME_CONTAINER "0"
-#define DEF_FRAME_CURSOR ""
-#define DEF_FRAME_HEIGHT "0"
-#define DEF_FRAME_HIGHLIGHT_BG STD_NORMAL_BACKGROUND
-#define DEF_FRAME_HIGHLIGHT RGB_BLACK
-#define DEF_FRAME_HIGHLIGHT_WIDTH "0"
-#define DEF_FRAME_RELIEF "flat"
-#define DEF_FRAME_TAKE_FOCUS "0"
-#define DEF_FRAME_USE ""
-#define DEF_FRAME_VISUAL ""
-#define DEF_FRAME_WIDTH "0"
-
-/*
- * Defaults for toplevels (most of the defaults for frames also apply
- * to toplevels):
- */
-
-#define DEF_TOPLEVEL_CLASS "Toplevel"
-#define DEF_TOPLEVEL_SCREEN ""
-#define DEF_TOPLEVEL_MENU ""
-
-/*
- * A data structure of the following type is kept for each
- * frame that currently exists for this process:
- */
-
-typedef struct {
- Tk_Window tkwin; /* Window that embodies the frame. NULL
- * means that the window has been destroyed
- * but the data structures haven't yet been
- * cleaned up. */
- Display *display; /* Display containing widget. Used, among
- * other things, so that resources can be
- * freed even after tkwin has gone away. */
- Tcl_Interp *interp; /* Interpreter associated with widget. Used
- * to delete widget command. */
- Tcl_Command widgetCmd; /* Token for frame's widget command. */
- char *className; /* Class name for widget (from configuration
- * option). Malloc-ed. */
- int mask; /* Either FRAME or TOPLEVEL; used to select
- * which configuration options are valid for
- * widget. */
- char *screenName; /* Screen on which widget is created. Non-null
- * only for top-levels. Malloc-ed, may be
- * NULL. */
- char *visualName; /* Textual description of visual for window,
- * from -visual option. Malloc-ed, may be
- * NULL. */
- char *colormapName; /* Textual description of colormap for window,
- * from -colormap option. Malloc-ed, may be
- * NULL. */
- char *menuName; /* Textual description of menu to use for
- * menubar. Malloc-ed, may be NULL. */
- Colormap colormap; /* If not None, identifies a colormap
- * allocated for this window, which must be
- * freed when the window is deleted. */
- Blt_Background normalBg; /* Structure used to draw 3-D border and
- * background. NULL means no background
- * or border. */
- int borderWidth; /* Width of 3-D border (if any). */
- int relief; /* 3-d effect: TK_RELIEF_RAISED etc. */
- int highlightWidth; /* Width in pixels of highlight to draw
- * around widget when it has the focus.
- * 0 means don't draw a highlight. */
- XColor *highlightBgColorPtr;
- /* Color for drawing traversal highlight
- * area when highlight is off. */
- XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
- int width; /* Width to request for window. <= 0 means
- * don't request any size. */
- int height; /* Height to request for window. <= 0 means
- * don't request any size. */
- Tk_Cursor cursor; /* Current cursor for window, or None. */
- char *takeFocus; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
- int isContainer; /* 1 means this window is a container, 0 means
- * that it isn't. */
- char *useThis; /* If the window is embedded, this points to
- * the name of the window in which it is
- * embedded (malloc'ed). For non-embedded
- * windows this is NULL. */
- int flags; /* Various flags; see below for
- * definitions. */
-} Frame;
-
-/*
- * Flag bits for frames:
- *
- * REDRAW_PENDING: Non-zero means a DoWhenIdle handler
- * has already been queued to redraw
- * this window.
- * GOT_FOCUS: Non-zero means this widget currently
- * has the input focus.
- */
-
-#define REDRAW_PENDING 1
-#define GOT_FOCUS 4
-
-/*
- * The following flag bits are used so that there can be separate
- * defaults for some configuration options for frames and toplevels.
- */
-
-#define FRAME BLT_CONFIG_USER_BIT
-#define TOPLEVEL (BLT_CONFIG_USER_BIT << 1)
-#define BOTH (FRAME | TOPLEVEL)
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_FRAME_BACKGROUND, Blt_Offset(Frame, normalBg),
- BOTH | BLT_CONFIG_COLOR_ONLY | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BACKGROUND, "-background", "background", "Background",
- DEF_FRAME_BG_MONO, Blt_Offset(Frame, normalBg),
- BOTH | BLT_CONFIG_MONO_ONLY | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL,
- (char *)NULL, 0, BOTH},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL,
- (char *)NULL, 0, BOTH},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_FRAME_BORDERWIDTH, Blt_Offset(Frame, borderWidth), BOTH},
- {BLT_CONFIG_STRING, "-class", "class", "Class",
- DEF_FRAME_CLASS, Blt_Offset(Frame, className), FRAME},
- {BLT_CONFIG_STRING, "-class", "class", "Class",
- DEF_TOPLEVEL_CLASS, Blt_Offset(Frame, className), TOPLEVEL},
- {BLT_CONFIG_STRING, "-colormap", "colormap", "Colormap",
- DEF_FRAME_COLORMAP, Blt_Offset(Frame, colormapName),
- BOTH | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BOOLEAN, "-container", "container", "Container",
- DEF_FRAME_CONTAINER, Blt_Offset(Frame, isContainer), BOTH},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_FRAME_CURSOR, Blt_Offset(Frame, cursor), BOTH | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-height", "height", "Height",
- DEF_FRAME_HEIGHT, Blt_Offset(Frame, height), BOTH},
- {BLT_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_FRAME_HIGHLIGHT_BG,
- Blt_Offset(Frame, highlightBgColorPtr), BOTH},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_FRAME_HIGHLIGHT, Blt_Offset(Frame, highlightColorPtr), BOTH},
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_FRAME_HIGHLIGHT_WIDTH,
- Blt_Offset(Frame, highlightWidth), BOTH},
- {BLT_CONFIG_STRING, "-menu", "menu", "Menu",
- DEF_TOPLEVEL_MENU, Blt_Offset(Frame, menuName),
- TOPLEVEL | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_FRAME_RELIEF, Blt_Offset(Frame, relief), BOTH},
- {BLT_CONFIG_STRING, "-screen", "screen", "Screen",
- DEF_TOPLEVEL_SCREEN, Blt_Offset(Frame, screenName),
- TOPLEVEL | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_FRAME_TAKE_FOCUS, Blt_Offset(Frame, takeFocus),
- BOTH | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-use", "use", "Use",
- DEF_FRAME_USE, Blt_Offset(Frame, useThis), TOPLEVEL|BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-visual", "visual", "Visual",
- DEF_FRAME_VISUAL, Blt_Offset(Frame, visualName),
- BOTH | BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-width", "width", "Width",
- DEF_FRAME_WIDTH, Blt_Offset(Frame, width), BOTH},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-/*
- * Forward declarations for procedures defined later in this file:
- */
-
-static int ConfigureFrame (Tcl_Interp *interp, Frame * framePtr,
- int objc, Tcl_Obj *const *objv, int flags);
-
-static Tcl_FreeProc DestroyFrame;
-static Tcl_IdleProc DisplayFrame;
-static Tcl_CmdDeleteProc FrameCmdDeletedProc;
-static Tk_EventProc FrameEventProc;
-static Tcl_ObjCmdProc FrameWidgetCmd;
-static Tcl_IdleProc MapFrame;
-
-static Tcl_ObjCmdProc FrameCmd, ToplevelCmd;
-
-#ifdef TK_MAINWINDOW
-BLT_EXTERN
-#else
-static
-#endif
-int TkCreateFrame (ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv, int toplevel, char *appName);
-
-#ifndef USE_TK_STUBS
-BLT_EXTERN void TkSetWindowMenuBar (Tcl_Interp *interp, Tk_Window tkwin,
- char *oldMenuName, char *menuName);
-
-BLT_EXTERN Tk_Window TkCreateMainWindow (Tcl_Interp * interp,
- char *screenName, char *baseName);
-#if (_TK_VERSION >= _VERSION(8,4,0))
-#define TkSetClassProcs Tk_SetClassProcs
-#else
-BLT_EXTERN void TkSetClassProcs (Tk_Window tkwin, void *procs,
- ClientData instanceData);
-#endif /* TK_MAJOR_VERSION == 8 && TK_MINOR_VERSION > 3 */
-
-BLT_EXTERN void TkpSetMainMenubar (Tcl_Interp * interp, Tk_Window tkwin,
- char *menuName);
-BLT_EXTERN int TkpUseWindow (Tcl_Interp * interp, Tk_Window tkwin, char * string);
-BLT_EXTERN void TkpMakeContainer (Tk_Window tkwin);
-#endif
-
-
-/*
- *---------------------------------------------------------------------------
- *
- * FrameCmd, ToplevelCmd --
- *
- * These procedures are invoked to process the "frame" and
- * "toplevel" TCL commands. See the user documentation for
- * details on what they do.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation. These procedures are just wrappers;
- * they call ButtonCreate to do all of the real work.
- *
- *---------------------------------------------------------------------------
- */
-static int
-FrameCmd(
- ClientData clientData, /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- return TkCreateFrame(clientData, interp, objc, objv, 0, (char *)NULL);
-}
-
-static int
-ToplevelCmd(
- ClientData clientData, /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- return TkCreateFrame(clientData, interp, objc, objv, 1, (char *)NULL);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TkFrameCreate --
- *
- * This procedure is invoked to process the "frame" and "toplevel"
- * Tcl commands; it is also invoked directly by Tk_Init to create
- * a new main window. See the user documentation for the "frame"
- * and "toplevel" commands for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-/*ARGSUSED*/
-#ifndef TK_MAINWINDOW
-static
-#endif /* TK_MAINWINDOW */
-int
-TkCreateFrame(
- ClientData clientData, /* Main window associated with interpreter.
- * If we're called by Tk_Init to create a
- * new application, then this is NULL. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv, /* Argument strings. */
- int toplevel, /* Non-zero means create a toplevel window,
- * zero means create a frame. */
- char *appName) /* Should only be non-NULL if clientData is
- * NULL: gives the base name to use for the
- * new application. */
-{
- Frame *framePtr;
- Tk_Window new;
- const char *className, *screenName, *visualName, *colormapName, *arg,
- *useOption;
- int i, c, depth;
- unsigned int mask;
- Colormap colormap;
- Visual *visual;
- Tk_Window tkwin;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- objv[0], " pathName ?options?\"", (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * Pre-process the argument list. Scan through it to find any
- * "-class", "-screen", "-visual", and "-colormap" options. These
- * arguments need to be processed specially, before the window
- * is configured using the usual Tk mechanisms.
- */
-
- className = colormapName = screenName = visualName = useOption = NULL;
- colormap = None;
- for (i = 2; i < objc; i += 2) {
- int length;
-
- arg = Tcl_GetStringFromObj(objv[i], &length);
- if (length < 2) {
- continue;
- }
- c = arg[1];
- if ((c == 'c') && (strncmp(arg, "-class", length) == 0)
- && (length >= 3)) {
- className = Tcl_GetString(objv[i + 1]);
- } else if ((c == 'c')
- && (strncmp(arg, "-colormap", length) == 0)) {
- colormapName = Tcl_GetString(objv[i + 1]);
- } else if ((c == 's') && (toplevel) &&
- (strncmp(arg, "-screen", length) == 0)) {
- screenName = Tcl_GetString(objv[i + 1]);
- } else if ((c == 'u') && (toplevel) &&
- (strncmp(arg, "-use", length) == 0)) {
- useOption = Tcl_GetString(objv[i + 1]);
- } else if ((c == 'v') && (strncmp(arg, "-visual", length) == 0)) {
- visualName = Tcl_GetString(objv[i + 1]);
- }
- }
-
- /*
- * Create the window, and deal with the special options -use,
- * -classname, -colormap, -screenname, and -visual. These options
- * must be handle before calling ConfigureFrame below, and they must
- * also be processed in a particular order, for the following
- * reasons:
- * 1. Must set the window's class before calling ConfigureFrame,
- * so that unspecified options are looked up in the option
- * database using the correct class.
- * 2. Must set visual information before calling ConfigureFrame
- * so that colors are allocated in a proper colormap.
- * 3. Must call TkpUseWindow before setting non-default visual
- * information, since TkpUseWindow changes the defaults.
- */
-
- if (screenName == NULL) {
- screenName = (toplevel) ? "" : NULL;
- }
- tkwin = Tk_MainWindow(interp);
- if (tkwin != NULL) {
- new = Tk_CreateWindowFromPath(interp, tkwin, Tcl_GetString(objv[1]),
- screenName);
- } else {
- /*
- * We were called from Tk_Init; create a new application.
- */
-
- if (appName == NULL) {
- panic("TkCreateFrame didn't get application name");
- }
- new = (Tk_Window)TkCreateMainWindow(interp, (char *)screenName,appName);
- }
- if (new == NULL) {
- goto error;
- }
- if (className == NULL) {
- className = (char *)Tk_GetOption(new, "class", "Class");
- if (className == NULL) {
- className = (toplevel) ? "Toplevel" : "Frame";
- }
- }
- Tk_SetClass(new, className);
- if (useOption == NULL) {
- useOption = Tk_GetOption(new, "use", "Use");
- }
- if (useOption != NULL) {
- if (TkpUseWindow(interp, new, (char *)useOption) != TCL_OK) {
- goto error;
- }
- }
- if (visualName == NULL) {
- visualName = (char *)Tk_GetOption(new, "visual", "Visual");
- }
- if (colormapName == NULL) {
- colormapName = (char *)Tk_GetOption(new, "colormap", "Colormap");
- }
- if (visualName != NULL) {
- visual = Tk_GetVisual(interp, new, visualName, &depth,
- (colormapName == NULL) ? &colormap : (Colormap *) NULL);
- if (visual == NULL) {
- goto error;
- }
- Tk_SetWindowVisual(new, visual, depth, colormap);
- }
- if (colormapName != NULL) {
- colormap = Tk_GetColormap(interp, new, colormapName);
- if (colormap == None) {
- goto error;
- }
- Tk_SetWindowColormap(new, colormap);
- }
- /*
- * For top-level windows, provide an initial geometry request of
- * 200x200, just so the window looks nicer on the screen if it
- * doesn't request a size for itself.
- */
-
- if (toplevel) {
- Tk_GeometryRequest(new, 200, 200);
- }
- /*
- * Create the widget record, process configuration options, and
- * create event handlers. Then fill in a few additional fields
- * in the widget record from the special options.
- */
-
- framePtr = Blt_AssertCalloc(1, sizeof(Frame));
- framePtr->tkwin = new;
- framePtr->display = Tk_Display(new);
- framePtr->interp = interp;
- framePtr->widgetCmd = Tcl_CreateObjCommand(interp, Tk_PathName(new),
- FrameWidgetCmd, (ClientData)framePtr, FrameCmdDeletedProc);
- framePtr->mask = (toplevel) ? TOPLEVEL : FRAME;
- framePtr->colormap = colormap;
- framePtr->borderWidth = 0;
- framePtr->relief = TK_RELIEF_FLAT;
-
- /*
- * Store backreference to frame widget in window structure.
- */
- TkSetClassProcs(new, NULL, (ClientData)framePtr);
- mask = ExposureMask | StructureNotifyMask | FocusChangeMask;
- if (toplevel) {
- mask |= ActivateMask;
- }
- Tk_CreateEventHandler(new, mask, FrameEventProc, (ClientData)framePtr);
- if (ConfigureFrame(interp, framePtr, objc - 2, objv + 2, 0) != TCL_OK) {
- goto error;
- }
- if ((framePtr->isContainer)) {
- if (framePtr->useThis == NULL) {
- TkpMakeContainer(framePtr->tkwin);
- } else {
- Tcl_AppendResult(interp, "A window cannot have both the -use ",
- "and the -container option set.", (char *)NULL);
- return TCL_ERROR;
- }
- }
- if (toplevel) {
- Tcl_DoWhenIdle(MapFrame, (ClientData)framePtr);
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(new), -1);
- return TCL_OK;
-
- error:
- if (new != NULL) {
- Tk_DestroyWindow(new);
- }
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FrameWidgetCmd --
- *
- * This procedure is invoked to process the TCL command
- * that corresponds to a frame widget. See the user
- * documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-FrameWidgetCmd(ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *const *objv)
-{
- register Frame *framePtr = (Frame *) clientData;
- int result;
- int length;
- int c, i;
- char *string;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " option ?arg arg ...?\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_Preserve((ClientData)framePtr);
- string = Tcl_GetStringFromObj(objv[1], &length);
- c = string[0];
- if ((c == 'c') && (length >= 2) && (strncmp(string, "cget", length) == 0)) {
- if (objc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " cget option\"", (char *)NULL);
- result = TCL_ERROR;
- goto done;
- }
- result = Blt_ConfigureValueFromObj(interp, framePtr->tkwin, configSpecs,
- (char *)framePtr, objv[2], framePtr->mask);
- } else if ((c == 'c') && (length >= 2)
- && (strncmp(string, "configure", length) == 0)) {
- if (objc == 2) {
- result = Blt_ConfigureInfoFromObj(interp, framePtr->tkwin,
- configSpecs, (char *)framePtr, (Tcl_Obj *)NULL, framePtr->mask);
- } else if (objc == 3) {
- result = Blt_ConfigureInfoFromObj(interp, framePtr->tkwin,
- configSpecs, (char *)framePtr, objv[2], framePtr->mask);
- } else {
- /*
- * Don't allow the options -class, -colormap, -container,
- * -newcmap, -screen, -use, or -visual to be changed.
- */
-
- for (i = 2; i < objc; i++) {
- string = Tcl_GetStringFromObj(objv[i], &length);
- if (length < 2) {
- continue;
- }
- c = string[1];
- if (((c == 'c') && (strncmp(string, "-class", length) == 0)) ||
- ((c == 'c') && (framePtr->mask == TOPLEVEL) &&
- (length >= 3) &&
- (strncmp(string, "-colormap", length) == 0)) ||
- ((c == 'c') && (strncmp(string, "-container", length) == 0)
- && (length >= 3))
- || ((c == 's') && (framePtr->mask == TOPLEVEL)
- && (strncmp(string, "-screen", length) == 0))
- || ((c == 'u') && (framePtr->mask == TOPLEVEL)
- && (strncmp(string, "-use", length) == 0))
- || ((c == 'v') && (framePtr->mask == TOPLEVEL)
- && (strncmp(string, "-visual", length) == 0))) {
- Tcl_AppendResult(interp, "can't modify ", string,
- " option after widget is created", (char *)NULL);
- result = TCL_ERROR;
- goto done;
- }
- }
- result = ConfigureFrame(interp, framePtr, objc - 2, objv + 2,
- BLT_CONFIG_OBJV_ONLY);
- }
- } else {
- Tcl_AppendResult(interp, "bad option \"", string,
- "\": must be cget or configure", (char *)NULL);
- result = TCL_ERROR;
- }
-
- done:
- Tcl_Release((ClientData)framePtr);
- return result;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyFrame --
- *
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of a frame at a safe time
- * (when no-one is using it anymore).
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the frame is freed up.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-DestroyFrame(DestroyData memPtr) /* Info about frame widget. */
-{
- register Frame *framePtr = (Frame *) memPtr;
-
- Blt_FreeOptions(configSpecs, (char *)framePtr, framePtr->display,
- framePtr->mask);
- if (framePtr->colormap != None) {
- Tk_FreeColormap(framePtr->display, framePtr->colormap);
- }
- Blt_Free(framePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureFrame --
- *
- * This procedure is called to process an objv/objc list, plus
- * the Tk option database, in order to configure (or
- * reconfigure) a frame widget.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is
- * returned, then interp->result contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for framePtr; old resources get freed, if there
- * were any.
- *
- *---------------------------------------------------------------------------
- */
-static int
-ConfigureFrame(
- Tcl_Interp *interp, /* Used for error reporting. */
- register Frame *framePtr, /* Information about widget; may or may
- * not already have values for some fields. */
- int objc, /* Number of valid entries in objv. */
- Tcl_Obj *const *objv, /* Arguments. */
- int flags) /* Flags to pass to Blt_ConfigureWidget. */
-{
- char *oldMenuName;
-
- /*
- * Need the old menubar name for the menu code to delete it.
- */
-
- if (framePtr->menuName == NULL) {
- oldMenuName = NULL;
- } else {
- oldMenuName = Blt_AssertStrdup(framePtr->menuName);
- }
- if (Blt_ConfigureWidgetFromObj(interp, framePtr->tkwin, configSpecs,
- objc, objv, (char *)framePtr, flags | framePtr->mask) != TCL_OK) {
- return TCL_ERROR;
- }
- if (((oldMenuName == NULL) && (framePtr->menuName != NULL))
- || ((oldMenuName != NULL) && (framePtr->menuName == NULL))
- || ((oldMenuName != NULL) && (framePtr->menuName != NULL)
- && strcmp(oldMenuName, framePtr->menuName) != 0)) {
- TkSetWindowMenuBar(interp, framePtr->tkwin, oldMenuName,
- framePtr->menuName);
- }
-#ifdef notdef
- if (framePtr->normalBg != NULL) {
- Tk_SetBackgroundFromBorder(framePtr->tkwin, framePtr->normalBg);
- } else {
- Tk_SetWindowBackgroundPixmap(framePtr->tkwin, None);
- }
-#endif
- Tk_SetWindowBackgroundPixmap(framePtr->tkwin, None);
- if (framePtr->highlightWidth < 0) {
- framePtr->highlightWidth = 0;
- }
- Tk_SetInternalBorder(framePtr->tkwin,
- framePtr->borderWidth + framePtr->highlightWidth);
-
- if ((framePtr->width > 0) || (framePtr->height > 0)) {
- Tk_GeometryRequest(framePtr->tkwin, framePtr->width,
- framePtr->height);
- }
- if (oldMenuName != NULL) {
- Blt_Free(oldMenuName);
- }
- if (Tk_IsMapped(framePtr->tkwin)) {
- if (!(framePtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayFrame, (ClientData)framePtr);
- }
- framePtr->flags |= REDRAW_PENDING;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayFrame --
- *
- * This procedure is invoked to display a frame widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the frame in its
- * current mode.
- *
- *---------------------------------------------------------------------------
- */
-static void
-DisplayFrame(ClientData clientData) /* Information about widget. */
-{
- register Frame *framePtr = (Frame *) clientData;
- register Tk_Window tkwin = framePtr->tkwin;
- GC gc;
-
- framePtr->flags &= ~REDRAW_PENDING;
- if ((framePtr->tkwin == NULL) || !Tk_IsMapped(tkwin)
- || framePtr->isContainer) {
- return;
- }
- Blt_FillBackgroundRectangle(tkwin, Tk_WindowId(tkwin), framePtr->normalBg,
- framePtr->highlightWidth, framePtr->highlightWidth,
- Tk_Width(tkwin) - 2 * framePtr->highlightWidth,
- Tk_Height(tkwin) - 2 * framePtr->highlightWidth,
- framePtr->borderWidth, framePtr->relief);
- if (framePtr->highlightWidth != 0) {
- if (framePtr->flags & GOT_FOCUS) {
- gc = Tk_GCForColor(framePtr->highlightColorPtr,
- Tk_WindowId(tkwin));
- } else {
- gc = Tk_GCForColor(framePtr->highlightBgColorPtr,
- Tk_WindowId(tkwin));
- }
- Tk_DrawFocusHighlight(tkwin, gc, framePtr->highlightWidth,
- Tk_WindowId(tkwin));
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FrameEventProc --
- *
- * This procedure is invoked by the Tk dispatcher on
- * structure changes to a frame. For frames with 3D
- * borders, this procedure is also invoked for exposures.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-FrameEventProc(
- ClientData clientData, /* Information about window. */
- register XEvent *eventPtr) /* Information about event. */
-{
- register Frame *framePtr = (Frame *) clientData;
-
- if (((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0))
- || (eventPtr->type == ConfigureNotify)) {
- goto redraw;
- } else if (eventPtr->type == DestroyNotify) {
- if (framePtr->menuName != NULL) {
- TkSetWindowMenuBar(framePtr->interp, framePtr->tkwin,
- framePtr->menuName, NULL);
- Blt_Free(framePtr->menuName);
- framePtr->menuName = NULL;
- }
- if (framePtr->tkwin != NULL) {
-
- /*
- * If this window is a container, then this event could be
- * coming from the embedded application, in which case
- * Tk_DestroyWindow hasn't been called yet. When Tk_DestroyWindow
- * is called later, then another destroy event will be generated.
- * We need to be sure we ignore the second event, since the frame
- * could be gone by then. To do so, delete the event handler
- * explicitly (normally it's done implicitly by Tk_DestroyWindow).
- */
- Tk_DeleteEventHandler(framePtr->tkwin,
- ExposureMask | StructureNotifyMask | FocusChangeMask,
- FrameEventProc, (ClientData)framePtr);
- framePtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(framePtr->interp, framePtr->widgetCmd);
- }
- if (framePtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayFrame, (ClientData)framePtr);
- }
- Tcl_CancelIdleCall(MapFrame, (ClientData)framePtr);
- Tcl_EventuallyFree((ClientData)framePtr, (Tcl_FreeProc *)DestroyFrame);
- } else if (eventPtr->type == FocusIn) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- framePtr->flags |= GOT_FOCUS;
- if (framePtr->highlightWidth > 0) {
- goto redraw;
- }
- }
- } else if (eventPtr->type == FocusOut) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- framePtr->flags &= ~GOT_FOCUS;
- if (framePtr->highlightWidth > 0) {
- goto redraw;
- }
- }
- } else if (eventPtr->type == ActivateNotify) {
- TkpSetMainMenubar(framePtr->interp, framePtr->tkwin,
- framePtr->menuName);
- }
- return;
-
- redraw:
- if ((framePtr->tkwin != NULL) && !(framePtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayFrame, (ClientData)framePtr);
- framePtr->flags |= REDRAW_PENDING;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * FrameCmdDeletedProc --
- *
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-static void
-FrameCmdDeletedProc(ClientData clientData) /* Pointer to widget record
- for widget. */
-{
- Frame *framePtr = (Frame *) clientData;
- Tk_Window tkwin = framePtr->tkwin;
-
- if (framePtr->menuName != NULL) {
- TkSetWindowMenuBar(framePtr->interp, framePtr->tkwin,
- framePtr->menuName, NULL);
- Blt_Free(framePtr->menuName);
- framePtr->menuName = NULL;
- }
-
- /*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin
- * is NULL) or because the command was deleted, and then this procedure
- * destroys the widget.
- */
-
- if (tkwin != NULL) {
- framePtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MapFrame --
- *
- * This procedure is invoked as a when-idle handler to map a
- * newly-created top-level frame.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The frame given by the clientData argument is mapped.
- *
- *---------------------------------------------------------------------------
- */
-static void
-MapFrame(ClientData clientData) /* Pointer to frame structure. */
-{
- Frame *framePtr = (Frame *) clientData;
-
- /*
- * Wait for all other background events to be processed before
- * mapping window. This ensures that the window's correct geometry
- * will have been determined before it is first mapped, so that the
- * window manager doesn't get a false idea of its desired geometry.
- */
-
- Tcl_Preserve((ClientData)framePtr);
- for(;;) {
- if (Tcl_DoOneEvent(TCL_IDLE_EVENTS) == 0) {
- break;
- }
- /*
- * After each event, make sure that the window still exists
- * and quit if the window has been destroyed.
- */
-
- if (framePtr->tkwin == NULL) {
- Tcl_Release((ClientData)framePtr);
- return;
- }
- }
- Tk_MapWindow(framePtr->tkwin);
- Tcl_Release((ClientData)framePtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TkInstallFrameMenu --
- *
- * This function is needed when a Windows HWND is created
- * and a menubar has been set to the window with a system
- * menu. It notifies the menu package so that the system
- * menu can be rebuilt.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The system menu (if any) is created for the menubar
- * associated with this frame.
- *
- *---------------------------------------------------------------------------
- */
-#ifdef notdef
-void
-TkInstallFrameMenu(Tk_Window tkwin) /* The window that was just created. */
-{
-#define Tk_InstanceData(tkwin) (((Tk_FakeWin *)(tkwin))->dummy18)
-#define Tk_MainPtr(tkwin) (((Tk_FakeWin *)(tkwin))->dummy5)
- if (Tk_MainPtr(tkwin) != NULL) {
- Frame *framePtr;
-
- framePtr = (Frame *) Tk_InstanceData(tkwin);
- TkpMenuNotifyToplevelCreate(framePtr->interp, framePtr->menuName);
- }
-}
-
-#endif
-
-int
-Blt_FrameCmdInitProc(Tcl_Interp *interp)
-{
- static Blt_InitCmdSpec cmdSpecs[2] = {
- {"frame", FrameCmd,},
- {"toplevel", ToplevelCmd,},
- };
- return Blt_InitCmds(interp, "::blt::tk", cmdSpecs, 2);
-}
-
-#endif /* NO_TKFRAME */
diff --git a/blt3.0.1/src/tkIntBorder.h b/blt3.0.1/src/tkIntBorder.h
deleted file mode 100644
index 13fe0f5..0000000
--- a/blt3.0.1/src/tkIntBorder.h
+++ /dev/null
@@ -1,65 +0,0 @@
-
-/*
- * tkIntBorder.h --
- *
- *
- * The Border structure used internally by the Tk_3D* routines.
- * The following is a copy of it from tk3d.c.
- *
- * Contains copies of internal Tk structures.
- *
- * Copyright (c) 1997 by Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- */
-
-#ifndef _TK_BORDER_INT_H
-#define _TK_BORDER_INT_H
-
-typedef struct _TkBorder {
- Screen *screen; /* Screen on which the border will be used. */
- Visual *visual; /* Visual for all windows and pixmaps using
- * the border. */
- int depth; /* Number of bits per pixel of drawables where
- * the border will be used. */
- Colormap colormap; /* Colormap out of which pixels are
- * allocated. */
- int refCount; /* Number of different users of
- * this border. */
-#if (_TK_VERSION >= _VERSION(8,1,0))
- int objRefCount; /* The number of TCL objects that reference
- * this structure. */
-#endif /* _TK_VERSION >= 8.1.0 */
- XColor *bgColor; /* Background color (intensity between
- * lightColorPtr and darkColorPtr). */
- XColor *darkColor; /* Color for darker areas (must free when
- * deleting structure). NULL means shadows
- * haven't been allocated yet.*/
- XColor *lightColor; /* Color used for lighter areas of border
- * (must free this when deleting structure).
- * NULL means shadows haven't been allocated
- * yet. */
- Pixmap shadow; /* Stipple pattern to use for drawing
- * shadows areas. Used for displays with
- * <= 64 colors or where colormap has filled
- * up. */
- GC bgGC; /* Used (if necessary) to draw areas in
- * the background color. */
- GC darkGC; /* Used to draw darker parts of the
- * border. None means the shadow colors
- * haven't been allocated yet.*/
- GC lightGC; /* Used to draw lighter parts of
- * the border. None means the shadow colors
- * haven't been allocated yet. */
- Tcl_HashEntry *hashPtr; /* Entry in borderTable (needed in
- * order to delete structure). */
- struct _TkBorder *nextPtr; /* Points to the next TkBorder structure with
- * the same color name. Borders with the
- * same name but different screens or
- * colormaps are chained together off a
- * single entry in borderTable. */
-} TkBorder;
-
-#endif /* _TK_BORDER_INT_H */
diff --git a/blt3.0.1/src/tkIntDecls.h b/blt3.0.1/src/tkIntDecls.h
deleted file mode 100644
index 1993b00..0000000
--- a/blt3.0.1/src/tkIntDecls.h
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * tkIntDecls.h --
- *
- * This file contains the declarations for all unsupported functions
- * that are exported by the Tk library. These interfaces are not
- * guaranteed to remain the same between versions. Use at your own
- * risk.
- *
- * Copyright 2003-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This file was adapted from tkIntDecls.h of the Tk library distribution.
- *
- * Copyright (c) 1998-1999 by Scriptics Corporation.
- *
- * See the file "license.terms" for information on usage and
- * redistribution of this file, and for a DISCLAIMER OF ALL
- * WARRANTIES.
- */
-
-#ifndef _TKINTDECLS
-#define _TKINTDECLS
-
-#ifdef BUILD_tk
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
-/*
- * WARNING: This file is automatically generated by the tools/genStubs.tcl
- * script. Any modifications to the function declarations below should be made
- * in the generic/tkInt.decls script.
- */
-
-/* !BEGIN!: Do not edit below this line. */
-
-/*
- * Exported function declarations:
- */
-
-/* 9 */
-extern void TkComputeAnchor(Tk_Anchor anchor, Tk_Window tkwin, int xPad,
- int yPad, int innerWidth, int innerHeight, int *xPtr, int *yPtr);
-/* 10 */
-extern int TkCopyAndGlobalEval(Tcl_Interp *interp, char * script);
-/* 14 */
-extern Tk_Window TkCreateMainWindow(Tcl_Interp *interp, char * screenName,
- char *baseName);
-/* 64 */
-extern void TkpMakeContainer(Tk_Window tkwin);
-/* 74 */
-extern void TkpSetMainMenubar(Tcl_Interp *interp, Tk_Window tkwin,
- char *menuName);
-/* 75 */
-extern int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, char *string);
-/* 84 */
-extern void TkSetClassProcs(Tk_Window tkwin, void *procs,
- ClientData instanceData);
-/* 85 */
-extern void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin,
- char *oldMenuName, char *menuName);
-/* 95 */
-extern void TkWmRestackToplevel(Tk_Window tkwin, int aboveBelow,
- Tk_Window otherPtr);
-
-#if defined (WIN32) || defined(MAC_TCL) || defined(MAC_OSX_TCL)
-/* 114 */
-extern TkRegion TkCreateRegion(void);
-/* 115 */
-extern void TkDestroyRegion (TkRegion rgn);
-/* 116 */
-extern void TkIntersectRegion (TkRegion sra, TkRegion srcb, TkRegion dr_return);
-/* 117 */
-extern int TkRectInRegion(TkRegion rgn, int x, int y, unsigned int width,
- unsigned int height);
-/* 118 */
-extern void TkSetRegion(Display* display, GC gc, TkRegion rgn);
-/* 119 */
-extern void TkUnionRectWithRegion(XRectangle* rect, TkRegion src,
- TkRegion dr_return);
-#endif
-
-typedef struct TkIntStubs {
- int magic;
- struct TkIntStubHooks *hooks;
-
- void *tkAllocWindow; /* 0 */
- void *tkBezierPoints; /* 1 */
- void *tkBezierScreenPoints; /* 2 */
- void *tkBindDeadWindow; /* 3 */
- void *tkBindEventProc; /* 4 */
- void *tkBindFree; /* 5 */
- void *tkBindInit; /* 6 */
- void *tkChangeEventWindow; /* 7 */
- void *tkClipInit; /* 8 */
-
- void (*tkComputeAnchor)(Tk_Anchor anchor, Tk_Window tkwin,
- int xPad, int yPad, int innerWidth, int innerHeight,
- int *xPtr, int *yPtr); /* 9 */
-
- int (*tkCopyAndGlobalEval)(Tcl_Interp *interp, char *script); /* 10 */
-
- void *tkCreateBindingProcedure; /* 11 */
- void *tkCreateCursorFromData; /* 12 */
- void *tkCreateFrame; /* 13 */
-
- Tk_Window (*tkCreateMainWindow)(Tcl_Interp *interp, char *screenName,
- char * baseName); /* 14 */
-
- void *tkCurrentTime; /* 15 */
- void *tkDeleteAllImages; /* 16 */
- void *tkDoConfigureNotify; /* 17 */
- void *tkDrawInsetFocusHighlight; /* 18 */
- void *tkEventDeadWindow; /* 19 */
- void *tkFillPolygon; /* 20 */
- void *tkFindStateNum; /* 21 */
- void *tkFindStateString; /* 22 */
- void *tkFocusDeadWindow; /* 23 */
- void *tkFocusFilterEvent; /* 24 */
- void *tkFocusKeyEvent; /* 25 */
- void *tkFontPkgInit; /* 26 */
- void *tkFontPkgFree; /* 27 */
- void *tkFreeBindingTags; /* 28 */
- void *tkpFreeCursor; /* 29 */
- void *tkGetBitmapData; /* 30 */
- void *tkGetButtPoints; /* 31 */
- void *tkGetCursorByName; /* 32 */
- void *tkGetDefaultScreenName; /* 33 */
- void *tkGetDisplay; /* 34 */
- void *tkGetDisplayOf; /* 35 */
- void *tkGetFocusWin; /* 36 */
- void *tkGetInterpNames; /* 37 */
- void *tkGetMiterPoints; /* 38 */
- void *tkGetPointerCoords; /* 39 */
- void *tkGetServerInfo; /* 40 */
- void *tkGrabDeadWindow; /* 41 */
- void *tkGrabState; /* 42 */
- void *tkIncludePoint; /* 43 */
- void *tkInOutEvents; /* 44 */
- void *tkInstallFrameMenu; /* 45 */
- void *tkKeysymToString; /* 46 */
- void *tkLineToArea; /* 47 */
- void *tkLineToPoint; /* 48 */
- void *tkMakeBezierCurve; /* 49 */
- void *tkMakeBezierPostscript; /* 50 */
- void *tkOptionClassChanged; /* 51 */
- void *tkOptionDeadWindow; /* 52 */
- void *tkOvalToArea; /* 53 */
- void *tkOvalToPoint; /* 54 */
- void *tkpChangeFocus; /* 55 */
- void *tkpCloseDisplay; /* 56 */
- void *tkpClaimFocus; /* 57 */
- void *tkpDisplayWarning; /* 58 */
- void *tkpGetAppName; /* 59 */
- void *tkpGetOtherWindow; /* 60 */
- void *tkpGetWrapperWindow; /* 61 */
- void *tkpInit; /* 62 */
- void *tkpInitializeMenuBindings; /* 63 */
-
- void (*tkpMakeContainer)(Tk_Window tkwin); /* 64 */
-
- void *tkpMakeMenuWindow; /* 65 */
- void *tkpMakeWindow; /* 66 */
- void *tkpMenuNotifyToplevelCreate; /* 67 */
- void *tkpOpenDisplay; /* 68 */
- void *tkPointerEvent; /* 69 */
- void *tkPolygonToArea; /* 70 */
- void *tkPolygonToPoint; /* 71 */
- void *tkPositionInTree; /* 72 */
- void *tkpRedirectKeyEvent; /* 73 */
-
- void (*tkpSetMainMenubar)(Tcl_Interp *interp, Tk_Window tkwin,
- char *menuName); /* 74 */
-
- int (*tkpUseWindow)(Tcl_Interp *interp, Tk_Window tkwin,
- char *string); /* 75 */
-
- void *tkpWindowWasRecentlyDeleted; /* 76 */
- void *tkQueueEventForAllChildren; /* 77 */
- void *tkReadBitmapFile; /* 78 */
- void *tkScrollWindow; /* 79 */
- void *tkSelDeadWindow; /* 80 */
- void *tkSelEventProc; /* 81 */
- void *tkSelInit; /* 82 */
- void *tkSelPropProc; /* 83 */
-
- void (*tkSetClassProcs)(Tk_Window tkwin, void *procs,
- ClientData instanceData); /* 84 */
-
- void (*tkSetWindowMenuBar)(Tcl_Interp *interp, Tk_Window tkwin,
- char *oldMenuName, char *menuName); /* 85 */
-
- void *tkStringToKeysym; /* 86 */
- void *tkThickPolyLineToArea; /* 87 */
- void *tkWmAddToColormapWindows; /* 88 */
- void *tkWmDeadWindow; /* 89 */
- void *tkWmFocusToplevel; /* 90 */
- void *tkWmMapWindow; /* 91 */
- void *tkWmNewWindow; /* 92 */
- void *tkWmProtocolEventProc; /* 93 */
- void *tkWmRemoveFromColormapWindows; /* 94 */
-
- void (*tkWmRestackToplevel)(Tk_Window tkwin, int aboveBelow,
- Tk_Window other); /* 95 */
-
- void *tkWmSetClass; /* 96 */
- void *tkWmUnmapWindow; /* 97 */
- void *tkDebugBitmap; /* 98 */
- void *tkDebugBorder; /* 99 */
- void *tkDebugCursor; /* 100 */
- void *tkDebugColor; /* 101 */
- void *tkDebugConfig; /* 102 */
- void *tkDebugFont; /* 103 */
- void *tkFindStateNumObj; /* 104 */
- void *tkGetBitmapPredefTable; /* 105 */
- void *tkGetDisplayList; /* 106 */
- void *tkGetMainInfoList; /* 107 */
- void *tkGetWindowFromObj; /* 108 */
- void *tkpGetString; /* 109 */
- void *tkpGetSubFonts; /* 110 */
- void *tkpGetSystemDefault; /* 111 */
- void *tkpMenuThreadInit; /* 112 */
- void *tkClipBox; /* 113 */
- void *tkCreateRegion; /* 114 */
- void *tkDestroyRegion; /* 115 */
- void *tkIntersectRegion; /* 116 */
- void *tkRectInRegion; /* 117 */
- void *tkSetRegion; /* 118 */
- void *tkUnionRectWithRegion; /* 119 */
- void *reserved120;
- void *tkpCreateNativeBitmap; /* 121 */
- void *tkpDefineNativeBitmaps; /* 122 */
- void *reserved123;
- void *tkpGetNativeAppBitmap; /* 124 */
- void *reserved125;
- void *reserved126;
- void *reserved127;
- void *reserved128;
- void *reserved129;
- void *reserved130;
- void *reserved131;
- void *reserved132;
- void *reserved133;
- void *reserved134;
- void *tkpDrawHighlightBorder; /* 135 */
- void *tkSetFocusWin; /* 136 */
- void *tkpSetKeycodeAndState; /* 137 */
- void *tkpGetKeySym; /* 138 */
- void *tkpInitKeymapInfo; /* 139 */
-} TkIntStubs;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern TkIntStubs *tkIntStubsPtr;
-#ifdef __cplusplus
-}
-#endif
-
-#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS)
-
-/*
- * Inline function declarations:
- */
-
-#ifndef TkComputeAnchor
-#define TkComputeAnchor \
- (tkIntStubsPtr->tkComputeAnchor) /* 9 */
-#endif
-
-#ifndef TkCopyAndGlobalEval
-#define TkCopyAndGlobalEval \
- (tkIntStubsPtr->tkCopyAndGlobalEval) /* 10 */
-#endif
-
-#ifndef TkCreateMainWindow
-#define TkCreateMainWindow \
- (tkIntStubsPtr->tkCreateMainWindow) /* 14 */
-#endif
-
-#ifndef TkpMakeContainer
-#define TkpMakeContainer \
- (tkIntStubsPtr->tkpMakeContainer) /* 64 */
-#endif
-
-#ifndef TkpSetMainMenubar
-#define TkpSetMainMenubar \
- (tkIntStubsPtr->tkpSetMainMenubar) /* 74 */
-#endif
-
-#ifndef TkpUseWindow
-#define TkpUseWindow \
- (tkIntStubsPtr->tkpUseWindow) /* 75 */
-#endif
-
-#ifndef TkSetClassProcs
-#define TkSetClassProcs \
- (tkIntStubsPtr->tkSetClassProcs) /* 84 */
-#endif
-
-#ifndef TkSetWindowMenuBar
-#define TkSetWindowMenuBar \
- (tkIntStubsPtr->tkSetWindowMenuBar) /* 85 */
-#endif
-
-#ifndef TkWmRestackToplevel
-#define TkWmRestackToplevel \
- (tkIntStubsPtr->tkWmRestackToplevel) /* 95 */
-#endif
-
-#endif
-
-#if defined(WIN32) || defined(MAC_TCL) || defined(MAC_OSX_TCL)
-#ifndef TkClipBox
-#define TkClipBox \
- (tkIntStubsPtr->tkClipBox) /* 113 */
-#endif
-#ifndef TkCreateRegion
-#define TkCreateRegion \
- (tkIntStubsPtr->tkCreateRegion) /* 114 */
-#endif
-#ifndef TkDestroyRegion
-#define TkDestroyRegion \
- (tkIntStubsPtr->tkDestroyRegion) /* 115 */
-#endif
-#ifndef TkIntersectRegion
-#define TkIntersectRegion \
- (tkIntStubsPtr->tkIntersectRegion) /* 116 */
-#endif
-#ifndef TkRectInRegion
-#define TkRectInRegion \
- (tkIntStubsPtr->tkRectInRegion) /* 117 */
-#endif
-#ifndef TkSetRegion
-#define TkSetRegion \
- (tkIntStubsPtr->tkSetRegion) /* 118 */
-#endif
-#ifndef TkUnionRectWithRegion
-#define TkUnionRectWithRegion \
- (tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
-#endif
-#endif /* WIN32 */
-
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLIMPORT
-
-#endif /* _TKINTDECLS */
-
diff --git a/blt3.0.1/src/tkIntPlatDecls.h b/blt3.0.1/src/tkIntPlatDecls.h
deleted file mode 100644
index 789aeca..0000000
--- a/blt3.0.1/src/tkIntPlatDecls.h
+++ /dev/null
@@ -1,186 +0,0 @@
-
-/*
- * tkIntPlatDecls.h --
- *
- * This file contains the declarations for all platform dependent
- * unsupported functions that are exported by the Tk library. These
- * interfaces are not guaranteed to remain the same between versions.
- * Use at your own risk.
- *
- * Copyright 2003-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This file was adapted from tkIntPlatDecls.h of the Tk library distribution.
- *
- * Copyright (c) 1998-1999 by Scriptics Corporation.
- *
- * See the file "license.terms" for information on usage and
- * redistribution of this file, and for a DISCLAIMER OF ALL
- * WARRANTIES.
- */
-
-#ifndef _TKINTPLATDECLS
-#define _TKINTPLATDECLS
-
-#ifdef BUILD_tk
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
-/*
- * WARNING: This file is automatically generated by the tools/genStubs.tcl
- * script. Any modifications to the function declarations below should be made
- * in the generic/tkInt.decls script.
- */
-
-/* !BEGIN!: Do not edit below this line. */
-
-/*
- * Exported function declarations:
- */
-
-#ifdef __WIN32__
-/* 16 */
-extern HDC TkWinGetDrawableDC(Display *display, Drawable drawable,
- TkWinDCState *state);
-/* 22 */
-extern void TkWinReleaseDrawableDC(Drawable drawable, HDC hdc,
- TkWinDCState *state);
-#endif /* __WIN32__ */
-
-typedef struct TkIntPlatStubs {
- int magic;
- struct TkIntPlatStubHooks *hooks;
-
- void *hook0;
- void *hook1;
- void *hook2;
- void *hook3;
- void *hook4;
- void *hook5;
- void *hook6;
- void *hook7;
- void *hook8;
- void *hook9;
- void *hook10;
- void *hook11;
- void *hook12;
- void *hook13;
- void *hook14;
- void *hook15;
-#ifdef WIN32
- HDC (*tkWinGetDrawableDC)(Display *display, Drawable drawable,
- TkWinDCState *state); /* 16 */
-#else
- void *hook16;
-#endif
- void *hook17;
- void *hook18;
- void *hook19;
- void *hook20;
- void *hook21;
-#ifdef WIN32
- void (*tkWinReleaseDrawableDC)(Drawable drawable, HDC hdc,
- TkWinDCState *state); /* 22 */
-#else
- void *hook22;
-#endif
- void *hook23;
- void *hook24;
- void *hook25;
- void *hook26;
- void *hook27;
- void *hook28;
- void *hook29;
- void *hook30;
- void *hook31;
- void *hook32;
- void *hook33;
- void *hook34;
- void *hook35;
- void *hook36;
- void *hook37;
- void *hook38;
- void *hook39;
- void *hook40;
- void *hook41;
- void *hook42;
- void *hook43;
- void *hook44;
- void *hook45;
- void *hook46;
- void *hook47;
- void *hook48;
- void *hook49;
- void *hook50;
- void *hook51;
- void *hook52;
- void *hook53;
- void *hook54;
- void *hook55;
- void *hook56;
- void *hook57;
- void *hook58;
- void *hook59;
- void *hook60;
- void *hook61;
- void *hook62;
- void *hook63;
- void *hook64;
- void *hook65;
- void *hook66;
-} TkIntPlatStubs;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern TkIntPlatStubs *tkIntPlatStubsPtr;
-#ifdef __cplusplus
-}
-#endif
-
-#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS)
-
-/*
- * Inline function declarations:
- */
-#ifdef __WIN32__
-#ifndef TkWinGetDrawableDC
-#define TkWinGetDrawableDC \
- (tkIntPlatStubsPtr->tkWinGetDrawableDC) /* 16 */
-#endif
-#ifndef TkWinReleaseDrawableDC
-#define TkWinReleaseDrawableDC \
- (tkIntPlatStubsPtr->tkWinReleaseDrawableDC) /* 22 */
-#endif
-#endif /* __WIN32__ */
-
-#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
-
-/* !END!: Do not edit above this line. */
-
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLIMPORT
-
-#endif /* _TKINTPLATDECLS */
diff --git a/blt3.0.1/src/tkMenubutton.c b/blt3.0.1/src/tkMenubutton.c
deleted file mode 100644
index 10c6b69..0000000
--- a/blt3.0.1/src/tkMenubutton.c
+++ /dev/null
@@ -1,1200 +0,0 @@
-/*
- * tkMenubutton.c --
- *
- * This module implements button-like widgets that are used
- * to invoke pull-down menus.
- *
- * Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994-1995 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * SCCS: @(#) tkMenubutton.c 1.77 96/02/15 18:52:22
- */
-
-#include "bltInt.h"
-
-/*
- * Defaults for menubuttons:
- */
-
-#define DEF_MENUBUTTON_ANCHOR "center"
-#define DEF_MENUBUTTON_ACTIVE_BG STD_ACTIVE_BACKGROUND
-#define DEF_MENUBUTTON_ACTIVE_FG STD_ACTIVE_FOREGROUND
-#define DEF_MENUBUTTON_BG STD_NORMAL_BACKGROUND
-#define DEF_MENUBUTTON_BITMAP ""
-#define DEF_MENUBUTTON_BORDERWIDTH "2"
-#define DEF_MENUBUTTON_CURSOR ""
-#define DEF_MENUBUTTON_DIRECTION "below"
-#define DEF_MENUBUTTON_DISABLED_FG STD_DISABLED_FOREGROUND
-#define DEF_MENUBUTTON_FONT "Helvetica -12 bold"
-#define DEF_MENUBUTTON_FG STD_NORMAL_FOREGROUND
-#define DEF_MENUBUTTON_HEIGHT "0"
-#define DEF_MENUBUTTON_HIGHLIGHT_BG DEF_MENUBUTTON_BG
-#define DEF_MENUBUTTON_HIGHLIGHT RGB_BLACK
-#define DEF_MENUBUTTON_HIGHLIGHT_WIDTH "0"
-#define DEF_MENUBUTTON_IMAGE (char *) NULL
-#define DEF_MENUBUTTON_INDICATOR "0"
-#define DEF_MENUBUTTON_JUSTIFY "center"
-#define DEF_MENUBUTTON_MENU ""
-#define DEF_MENUBUTTON_PADX "4p"
-#define DEF_MENUBUTTON_PADY "3p"
-#define DEF_MENUBUTTON_RELIEF "flat"
-#define DEF_MENUBUTTON_STATE "normal"
-#define DEF_MENUBUTTON_TAKE_FOCUS "0"
-#define DEF_MENUBUTTON_TEXT ""
-#define DEF_MENUBUTTON_TEXT_VARIABLE ""
-#define DEF_MENUBUTTON_UNDERLINE "-1"
-#define DEF_MENUBUTTON_WIDTH "0"
-#define DEF_MENUBUTTON_WRAP_LENGTH "0"
-
-/*
- * A data structure of the following type is kept for each
- * widget managed by this file:
- */
-
-typedef struct {
- Tk_Window tkwin; /* Window that embodies the widget. NULL
- * means that the window has been destroyed
- * but the data structures haven't yet been
- * cleaned up.*/
- Display *display; /* Display containing widget. Needed, among
- * other things, so that resources can bee
- * freed up even after tkwin has gone away. */
- Tcl_Interp *interp; /* Interpreter associated with menubutton. */
- Tcl_Command widgetCmd; /* Token for menubutton's widget command. */
- char *menuName; /* Name of menu associated with widget.
- * Malloc-ed. */
-
- /*
- * Information about what's displayed in the menu button:
- */
-
- char *text; /* Text to display in button (malloc'ed)
- * or NULL. */
- int numChars; /* # of characters in text. */
- int underline; /* Index of character to underline. */
- char *textVarName; /* Name of variable (malloc'ed) or NULL.
- * If non-NULL, button displays the contents
- * of this variable. */
- Pixmap bitmap; /* Bitmap to display or None. If not None
- * then text and textVar and underline
- * are ignored. */
- char *imageString; /* Name of image to display (malloc'ed), or
- * NULL. If non-NULL, bitmap, text, and
- * textVarName are ignored. */
- Tk_Image image; /* Image to display in window, or NULL if
- * none. */
-
- /*
- * Information used when displaying widget:
- */
-
- int state; /* State of button for display purposes:
- * normal, active, or disabled. */
- Tk_3DBorder normalBorder; /* Structure used to draw 3-D
- * border and background when window
- * isn't active. NULL means no such
- * border exists. */
- Tk_3DBorder activeBorder; /* Structure used to draw 3-D
- * border and background when window
- * is active. NULL means no such
- * border exists. */
- int borderWidth; /* Width of border. */
- int relief; /* 3-d effect: TK_RELIEF_RAISED, etc. */
- int highlightWidth; /* Width in pixels of highlight to draw
- * around widget when it has the focus.
- * <= 0 means don't draw a highlight. */
- XColor *highlightBgColorPtr;
- /* Color for drawing traversal highlight
- * area when highlight is off. */
- XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
- int inset; /* Total width of all borders, including
- * traversal highlight and 3-D border.
- * Indicates how much interior stuff must
- * be offset from outside edges to leave
- * room for borders. */
- XFontStruct *fontPtr; /* Information about text font, or NULL. */
- XColor *normalFg; /* Foreground color in normal mode. */
- XColor *activeFg; /* Foreground color in active mode. NULL
- * means use normalFg instead. */
- XColor *disabledFg; /* Foreground color when disabled. NULL
- * means use normalFg with a 50% stipple
- * instead. */
- GC normalTextGC; /* GC for drawing text in normal mode. */
- GC activeTextGC; /* GC for drawing text in active mode (NULL
- * means use normalTextGC). */
- Pixmap gray; /* Pixmap for displaying disabled text/icon if
- * disabledFg is NULL. */
- GC disabledGC; /* Used to produce disabled effect. If
- * disabledFg isn't NULL, this GC is used to
- * draw button text or icon. Otherwise
- * text or icon is drawn with normalGC and
- * this GC is used to stipple background
- * across it. */
- int leftBearing; /* Distance from text origin to leftmost drawn
- * pixel (positive means to right). */
- int rightBearing; /* Amount text sticks right from its origin. */
- char *widthString; /* Value of -width option. Malloc'ed. */
- char *heightString; /* Value of -height option. Malloc'ed. */
- int width, height; /* If > 0, these specify dimensions to request
- * for window, in characters for text and in
- * pixels for bitmaps. In this case the actual
- * size of the text string or bitmap is
- * ignored in computing desired window size. */
- int wrapLength; /* Line length (in pixels) at which to wrap
- * onto next line. <= 0 means don't wrap
- * except at newlines. */
- int xPad, yPad; /* Extra space around text or bitmap (pixels
- * on each side). */
- Tk_Anchor anchor; /* Where text/bitmap should be displayed
- * inside window region. */
- Tk_Justify justify; /* Justification to use for multi-line text. */
- int textWidth; /* Width needed to display text as requested,
- * in pixels. */
- int textHeight; /* Height needed to display text as requested,
- * in pixels. */
- int indicatorOn; /* Non-zero means display indicator; 0 means
- * don't display. */
- int indicatorHeight; /* Height of indicator in pixels. This same
- * amount of extra space is also left on each
- * side of the indicator. 0 if no indicator. */
- int indicatorWidth; /* Width of indicator in pixels, including
- * indicatorHeight in padding on each side.
- * 0 if no indicator. */
-
- /*
- * Miscellaneous information:
- */
-
- Tk_Cursor cursor; /* Current cursor for window, or None. */
- char *takeFocus; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
- int flags; /* Various flags; see below for
- * definitions. */
-} MenuButton;
-
-/*
- * Flag bits for buttons:
- *
- * REDRAW_PENDING: Non-zero means a DoWhenIdle handler
- * has already been queued to redraw
- * this window.
- * POSTED: Non-zero means that the menu associated
- * with this button has been posted (typically
- * because of an active button press).
- * GOT_FOCUS: Non-zero means this button currently
- * has the input focus.
- */
-
-#define REDRAW_PENDING 1
-#define POSTED 2
-#define GOT_FOCUS 4
-
-/*
- * The following constants define the dimensions of the cascade indicator,
- * which is displayed if the "-indicatoron" option is true. The units for
- * these options are 1/10 millimeters.
- */
-
-#define INDICATOR_WIDTH 40
-#define INDICATOR_HEIGHT 17
-
-/*
- * Information used for parsing configuration specs:
- */
-
-static Blt_ConfigSpec configSpecs[] =
-{
- {BLT_CONFIG_BORDER, "-activebackground", "activeBackground", "Foreground",
- DEF_MENUBUTTON_ACTIVE_BG, Blt_Offset(MenuButton, activeBorder), 0},
- {BLT_CONFIG_COLOR, "-activeforeground", "activeForeground", "Background",
- DEF_MENUBUTTON_ACTIVE_FG, Blt_Offset(MenuButton, activeFg), 0},
- {BLT_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor",
- DEF_MENUBUTTON_ANCHOR, Blt_Offset(MenuButton, anchor), 0},
- {BLT_CONFIG_BORDER, "-background", "background", "Background",
- DEF_MENUBUTTON_BG, Blt_Offset(MenuButton, normalBorder), 0},
- {BLT_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_SYNONYM, "-bg", "background", (char *)NULL,
- (char *)NULL, 0, 0},
- {BLT_CONFIG_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_MENUBUTTON_BITMAP,
- Blt_Offset(MenuButton, bitmap), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_MENUBUTTON_BORDERWIDTH, Blt_Offset(MenuButton, borderWidth), 0},
- {BLT_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_MENUBUTTON_CURSOR, Blt_Offset(MenuButton, cursor),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_COLOR, "-disabledforeground", "disabledForeground",
- "DisabledForeground", DEF_MENUBUTTON_DISABLED_FG,
- Blt_Offset(MenuButton, disabledFg), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0},
- {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_MENUBUTTON_FONT,
- Blt_Offset(MenuButton, fontPtr), 0},
- {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_MENUBUTTON_FG, Blt_Offset(MenuButton, normalFg), 0},
- {BLT_CONFIG_STRING, "-height", "height", "Height",
- DEF_MENUBUTTON_HEIGHT, Blt_Offset(MenuButton, heightString), 0},
- {BLT_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_MENUBUTTON_HIGHLIGHT_BG,
- Blt_Offset(MenuButton, highlightBgColorPtr), 0},
- {BLT_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_MENUBUTTON_HIGHLIGHT, Blt_Offset(MenuButton, highlightColorPtr), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_MENUBUTTON_HIGHLIGHT_WIDTH,
- Blt_Offset(MenuButton, highlightWidth), 0},
- {BLT_CONFIG_STRING, "-image", "image", "Image", DEF_MENUBUTTON_IMAGE,
- Blt_Offset(MenuButton, imageString), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn",
- DEF_MENUBUTTON_INDICATOR, Blt_Offset(MenuButton, indicatorOn), 0},
- {BLT_CONFIG_JUSTIFY, "-justify", "justify", "Justify",
- DEF_MENUBUTTON_JUSTIFY, Blt_Offset(MenuButton, justify), 0},
- {BLT_CONFIG_STRING, "-menu", "menu", "Menu", DEF_MENUBUTTON_MENU,
- Blt_Offset(MenuButton, menuName), BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_PIXELS_NNEG, "-padx", "padX", "Pad", DEF_MENUBUTTON_PADX,
- Blt_Offset(MenuButton, xPad), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-pady", "padY", "Pad", DEF_MENUBUTTON_PADY,
- Blt_Offset(MenuButton, yPad), 0},
- {BLT_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_MENUBUTTON_RELIEF,
- Blt_Offset(MenuButton, relief), 0},
- {BLT_CONFIG_STATE, "-state", "state", "State", DEF_MENUBUTTON_STATE,
- Blt_Offset(MenuButton, state), 0},
- {BLT_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_MENUBUTTON_TAKE_FOCUS, Blt_Offset(MenuButton, takeFocus),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_STRING, "-text", "text", "Text", DEF_MENUBUTTON_TEXT,
- Blt_Offset(MenuButton, text), 0},
- {BLT_CONFIG_STRING, "-textvariable", "textVariable", "Variable",
- DEF_MENUBUTTON_TEXT_VARIABLE, Blt_Offset(MenuButton, textVarName),
- BLT_CONFIG_NULL_OK},
- {BLT_CONFIG_INT, "-underline", "underline", "Underline",
- DEF_MENUBUTTON_UNDERLINE, Blt_Offset(MenuButton, underline), 0},
- {BLT_CONFIG_STRING, "-width", "width", "Width", DEF_MENUBUTTON_WIDTH,
- Blt_Offset(MenuButton, widthString), 0},
- {BLT_CONFIG_PIXELS_NNEG, "-wraplength", "wrapLength", "WrapLength",
- DEF_MENUBUTTON_WRAP_LENGTH, Blt_Offset(MenuButton, wrapLength), 0},
- {BLT_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-};
-
-/*
- * Forward declarations for procedures defined later in this file:
- */
-
-static Tcl_CmdDeleteProc MenuButtonCmdDeletedProc;
-static Tk_EventProc MenuButtonEventProc;
-static Tk_ImageChangedProc MenuButtonImageProc;
-static Tcl_VarTraceProc MenuButtonTextVarProc;
-static Tcl_ObjCmdProc MenuButtonWidgetCmd;
-static Tcl_FreeProc DestroyMenuButton;
-static Tcl_IdleProc DisplayMenuButton;
-
-static int ConfigureMenuButton (Tcl_Interp *interp, MenuButton *mbPtr,
- int objc, Tcl_Obj *const *objv, int flags);
-static void ComputeMenuButtonGeometry (MenuButton *mbPtr);
-/*
- *---------------------------------------------------------------------------
- *
- * Tk_MenubuttonCmd --
- *
- * This procedure is invoked to process the "button", "label",
- * "radiobutton", and "checkbutton" TCL commands. See the
- * user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-int
-Tk_MenubuttonCmd(
- ClientData clientData, /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- register MenuButton *mbPtr;
- Tk_Window tkwin;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " pathName ?options?\"", (char *)NULL);
- return TCL_ERROR;
- }
- /*
- * Create the new window.
- */
-
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
- Tcl_GetString(objv[1]), (char *)NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- /*
- * Initialize the data structure for the button.
- */
-
- mbPtr = Blt_AssertCalloc(1, sizeof(MenuButton));
- mbPtr->tkwin = tkwin;
- mbPtr->display = Tk_Display(tkwin);
- mbPtr->interp = interp;
- mbPtr->widgetCmd = Tcl_CreateObjCommand(interp, Tk_PathName(mbPtr->tkwin),
- MenuButtonWidgetCmd, (ClientData)mbPtr, MenuButtonCmdDeletedProc);
- mbPtr->underline = -1;
- mbPtr->state = STATE_NORMAL;
- mbPtr->relief = TK_RELIEF_FLAT;
- mbPtr->anchor = TK_ANCHOR_CENTER;
- mbPtr->justify = TK_JUSTIFY_CENTER;
-
- Tk_SetClass(mbPtr->tkwin, "Menubutton");
- Tk_CreateEventHandler(mbPtr->tkwin,
- ExposureMask | StructureNotifyMask | FocusChangeMask,
- MenuButtonEventProc, (ClientData)mbPtr);
- if (ConfigureMenuButton(interp, mbPtr, objc - 2, objv + 2, 0) != TCL_OK) {
- Tk_DestroyWindow(mbPtr->tkwin);
- return TCL_ERROR;
- }
- Tcl_SetObjResult(interp, objv[1]);
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MenuButtonWidgetCmd --
- *
- * This procedure is invoked to process the TCL command
- * that corresponds to a widget managed by this module.
- * See the user documentation for details on what it does.
- *
- * Results:
- * A standard TCL result.
- *
- * Side effects:
- * See the user documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-MenuButtonWidgetCmd(
- ClientData clientData, /* Information about button widget. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const *objv) /* Argument strings. */
-{
- MenuButton *mbPtr = clientData;
- char *string;
- int c;
- int length;
- int result = TCL_OK;
-
- if (objc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " option ?arg arg ...?\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- Tcl_Preserve(mbPtr);
- string = Tcl_GetString(objv[1], &length);
- c = string[0];
- if ((c == 'c') && (length >= 2) && (strncmp(string, "cget", length) == 0)) {
- if (objc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " cget option\"", (char *)NULL);
- goto error;
- }
- result = Blt_ConfigureValueFromObj(interp, mbPtr->tkwin, configSpecs,
- (char *)mbPtr, objv[2], 0);
- } else if ((c == 'c') && (length >= 2) &&
- (strncmp(string, "configure", length) == 0)) {
- if (objc == 2) {
- result = Blt_ConfigureInfoFromObj(interp, mbPtr->tkwin, configSpecs,
- (char *)mbPtr, (Tcl_Obj *)NULL, 0);
- } else if (objc == 3) {
- result = Blt_ConfigureInfoFromObj(interp, mbPtr->tkwin, configSpecs,
- (char *)mbPtr, objv[2], 0);
- } else {
- result = ConfigureMenuButton(interp, mbPtr, objc - 2, objv + 2,
- BLT_CONFIG_OBJV_ONLY);
- }
- } else {
- Tcl_AppendResult(interp, "bad option \"", string,
- "\": must be cget or configure", (char *)NULL);
- goto error;
- }
- Tcl_Release(mbPtr);
- return result;
-
- error:
- Tcl_Release(mbPtr);
- return TCL_ERROR;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DestroyMenuButton --
- *
- * This procedure is invoked to recycle all of the resources
- * associated with a button widget. It is invoked as a
- * when-idle handler in order to make sure that there is no
- * other use of the button pending at the time of the deletion.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Everything associated with the widget is freed up.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-DestroyMenuButton(char *memPtr) /* Info about button widget. */
-{
- register MenuButton *mbPtr = (MenuButton *)memPtr;
-
- /*
- * Free up all the stuff that requires special handling, then
- * let Blt_FreeOptions handle all the standard option-related
- * stuff.
- */
-
- if (mbPtr->textVarName != NULL) {
- Tcl_UntraceVar(mbPtr->interp, mbPtr->textVarName,
- TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
- MenuButtonTextVarProc, (ClientData)mbPtr);
- }
- if (mbPtr->image != NULL) {
- Tk_FreeImage(mbPtr->image);
- }
- if (mbPtr->normalTextGC != None) {
- Tk_FreeGC(mbPtr->display, mbPtr->normalTextGC);
- }
- if (mbPtr->activeTextGC != None) {
- Tk_FreeGC(mbPtr->display, mbPtr->activeTextGC);
- }
- if (mbPtr->gray != None) {
- Tk_FreeBitmap(mbPtr->display, mbPtr->gray);
- }
- if (mbPtr->disabledGC != None) {
- Tk_FreeGC(mbPtr->display, mbPtr->disabledGC);
- }
- Blt_FreeOptions(configSpecs, (char *)mbPtr, mbPtr->display, 0);
- Blt_Free(mbPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ConfigureMenuButton --
- *
- * This procedure is called to process an objv/objc list, plus
- * the Tk option database, in order to configure (or
- * reconfigure) a menubutton widget.
- *
- * Results:
- * The return value is a standard TCL result. If TCL_ERROR is
- * returned, then interp->result contains an error message.
- *
- * Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for mbPtr; old resources get freed, if there
- * were any. The menubutton is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-
-static int
-ConfigureMenuButton(
- Tcl_Interp *interp, /* Used for error reporting. */
- MenuButton *mbPtr, /* Information about widget; may or may
- * not already have values for some fields. */
- int objc, /* Number of valid entries in objv. */
- Tcl_Obj *const *objv, /* Arguments. */
- int flags) /* Flags to pass to Blt_ConfigureWidget. */
-{
- XGCValues gcValues;
- GC newGC;
- unsigned long mask;
- int result;
- Tk_Image image;
-
- /*
- * Eliminate any existing trace on variables monitored by the menubutton.
- */
-
- if (mbPtr->textVarName != NULL) {
- Tcl_UntraceVar(interp, mbPtr->textVarName,
- TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
- MenuButtonTextVarProc, (ClientData)mbPtr);
- }
- result = Blt_ConfigureWidgetFromObj(interp, mbPtr->tkwin, configSpecs,
- objc, objv, (char *)mbPtr, flags);
- if (result != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * A few options need special processing, such as setting the
- * background from a 3-D border, or filling in complicated
- * defaults that couldn't be specified to Blt_ConfigureWidget.
- */
-
- if ((mbPtr->state == STATE_ACTIVE) && !Tk_StrictMotif(mbPtr->tkwin)) {
- Tk_SetBackgroundFromBorder(mbPtr->tkwin, mbPtr->activeBorder);
- } else {
- Tk_SetBackgroundFromBorder(mbPtr->tkwin, mbPtr->normalBorder);
- if ((mbPtr->state != STATE_NORMAL) && (mbPtr->state != STATE_ACTIVE)
- && (mbPtr->state != STATE_DISABLED)) {
- Tcl_AppendResult(interp, "bad state value \"",
- Blt_Itoa(mbPtr->state),
- "\": must be normal, active, or disabled", (char *)NULL);
- mbPtr->state = STATE_NORMAL;
- return TCL_ERROR;
- }
- }
-
- if (mbPtr->highlightWidth < 0) {
- mbPtr->highlightWidth = 0;
- }
- gcValues.font = mbPtr->fontPtr->fid;
- gcValues.foreground = mbPtr->normalFg->pixel;
- gcValues.background = Tk_3DBorderColor(mbPtr->normalBorder)->pixel;
-
- /*
- * Note: GraphicsExpose events are disabled in GC's because they're
- * used to copy stuff from an off-screen pixmap onto the screen (we know
- * that there's no problem with obscured areas).
- */
-
- gcValues.graphics_exposures = False;
- newGC = Tk_GetGC(mbPtr->tkwin,
- GCForeground | GCBackground | GCFont | GCGraphicsExposures, &gcValues);
- if (mbPtr->normalTextGC != None) {
- Tk_FreeGC(mbPtr->display, mbPtr->normalTextGC);
- }
- mbPtr->normalTextGC = newGC;
-
- gcValues.font = mbPtr->fontPtr->fid;
- gcValues.foreground = mbPtr->activeFg->pixel;
- gcValues.background = Tk_3DBorderColor(mbPtr->activeBorder)->pixel;
- newGC = Tk_GetGC(mbPtr->tkwin, GCForeground | GCBackground | GCFont,
- &gcValues);
- if (mbPtr->activeTextGC != None) {
- Tk_FreeGC(mbPtr->display, mbPtr->activeTextGC);
- }
- mbPtr->activeTextGC = newGC;
-
- gcValues.font = mbPtr->fontPtr->fid;
- gcValues.background = Tk_3DBorderColor(mbPtr->normalBorder)->pixel;
- if ((mbPtr->disabledFg != NULL) && (mbPtr->imageString == NULL)) {
- gcValues.foreground = mbPtr->disabledFg->pixel;
- mask = GCForeground | GCBackground | GCFont;
- } else {
- gcValues.foreground = gcValues.background;
- if (mbPtr->gray == None) {
- mbPtr->gray = Tk_GetBitmap(interp, mbPtr->tkwin,
- Tk_GetUid("gray50"));
- if (mbPtr->gray == None) {
- return TCL_ERROR;
- }
- }
- gcValues.fill_style = FillStippled;
- gcValues.stipple = mbPtr->gray;
- mask = GCForeground | GCFillStyle | GCStipple;
- }
- newGC = Tk_GetGC(mbPtr->tkwin, mask, &gcValues);
- if (mbPtr->disabledGC != None) {
- Tk_FreeGC(mbPtr->display, mbPtr->disabledGC);
- }
- mbPtr->disabledGC = newGC;
-
- if (mbPtr->xPad < 0) {
- mbPtr->xPad = 0;
- }
- if (mbPtr->yPad < 0) {
- mbPtr->yPad = 0;
- }
- /*
- * Get the image for the widget, if there is one. Allocate the
- * new image before freeing the old one, so that the reference
- * count doesn't go to zero and cause image data to be discarded.
- */
-
- if (mbPtr->imageString != NULL) {
- image = Tk_GetImage(mbPtr->interp, mbPtr->tkwin,
- mbPtr->imageString, MenuButtonImageProc, (ClientData)mbPtr);
- if (image == NULL) {
- return TCL_ERROR;
- }
- } else {
- image = NULL;
- }
- if (mbPtr->image != NULL) {
- Tk_FreeImage(mbPtr->image);
- }
- mbPtr->image = image;
-
- if ((mbPtr->image == NULL) && (mbPtr->bitmap == None)
- && (mbPtr->textVarName != NULL)) {
- /*
- * The menubutton displays a variable. Set up a trace to watch
- * for any changes in it.
- */
-
- char *value;
-
- value = Tcl_GetVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY);
- if (value == NULL) {
- Tcl_SetVar(interp, mbPtr->textVarName, mbPtr->text,
- TCL_GLOBAL_ONLY);
- } else {
- if (mbPtr->text != NULL) {
- Blt_Free(mbPtr->text);
- }
- mbPtr->text = Blt_StrdupAsset(value);
- }
- Tcl_TraceVar(interp, mbPtr->textVarName,
- TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
- MenuButtonTextVarProc, (ClientData)mbPtr);
- }
- /*
- * Recompute the geometry for the button.
- */
-
- if ((mbPtr->bitmap != None) || (mbPtr->image != NULL)) {
- if (Tk_GetPixels(interp, mbPtr->tkwin, mbPtr->widthString,
- &mbPtr->width) != TCL_OK) {
- widthError:
- Tcl_AddErrorInfo(interp, "\n (processing -width option)");
- return TCL_ERROR;
- }
- if (Tk_GetPixels(interp, mbPtr->tkwin, mbPtr->heightString,
- &mbPtr->height) != TCL_OK) {
- heightError:
- Tcl_AddErrorInfo(interp, "\n (processing -height option)");
- return TCL_ERROR;
- }
- } else {
- if (Tcl_GetInt(interp, mbPtr->widthString, &mbPtr->width)
- != TCL_OK) {
- goto widthError;
- }
- if (Tcl_GetInt(interp, mbPtr->heightString, &mbPtr->height)
- != TCL_OK) {
- goto heightError;
- }
- }
- ComputeMenuButtonGeometry(mbPtr);
-
- /*
- * Lastly, arrange for the button to be redisplayed.
- */
-
- if (Tk_IsMapped(mbPtr->tkwin) && !(mbPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayMenuButton, (ClientData)mbPtr);
- mbPtr->flags |= REDRAW_PENDING;
- }
- return TCL_OK;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * DisplayMenuButton --
- *
- * This procedure is invoked to display a menubutton widget.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the menubutton in its
- * current mode.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-DisplayMenuButton(ClientData clientData) /* Information about widget. */
-{
- register MenuButton *mbPtr = clientData;
- GC gc;
- Tk_3DBorder border;
- Pixmap pixmap;
- int x = 0; /* Initialization needed only to stop
- * compiler warning. */
- int y;
- register Tk_Window tkwin = mbPtr->tkwin;
- int width, height;
-
- mbPtr->flags &= ~REDRAW_PENDING;
- if ((mbPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
- return;
- }
- if ((mbPtr->state == STATE_DISABLED) && (mbPtr->disabledFg != NULL)) {
- gc = mbPtr->disabledGC;
- border = mbPtr->normalBorder;
- } else if ((mbPtr->state == STATE_ACTIVE) && !Tk_StrictMotif(mbPtr->tkwin)) {
- gc = mbPtr->activeTextGC;
- border = mbPtr->activeBorder;
- } else {
- gc = mbPtr->normalTextGC;
- border = mbPtr->normalBorder;
- }
-
- /*
- * In order to avoid screen flashes, this procedure redraws
- * the menu button in a pixmap, then copies the pixmap to the
- * screen in a single operation. This means that there's no
- * point in time where the on-sreen image has been cleared.
- */
-
- pixmap = Tk_GetPixmap(mbPtr->display, Tk_WindowId(tkwin),
- Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin));
- Blt_Fill3DRectangle(tkwin, pixmap, border, 0, 0, Tk_Width(tkwin),
- Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
-
- /*
- * Display image or bitmap or text for button.
- */
-
- if (mbPtr->image != None) {
- Tk_SizeOfImage(mbPtr->image, &width, &height);
-
- imageOrBitmap:
- switch (mbPtr->anchor) {
- case TK_ANCHOR_NW:
- case TK_ANCHOR_W:
- case TK_ANCHOR_SW:
- x += mbPtr->inset;
- break;
- case TK_ANCHOR_N:
- case TK_ANCHOR_CENTER:
- case TK_ANCHOR_S:
- x += ((int)(Tk_Width(tkwin) - width
- - mbPtr->indicatorWidth)) / 2;
- break;
- default:
- x += Tk_Width(tkwin) - mbPtr->inset - width
- - mbPtr->indicatorWidth;
- break;
- }
- switch (mbPtr->anchor) {
- case TK_ANCHOR_NW:
- case TK_ANCHOR_N:
- case TK_ANCHOR_NE:
- y = mbPtr->inset;
- break;
- case TK_ANCHOR_W:
- case TK_ANCHOR_CENTER:
- case TK_ANCHOR_E:
- y = ((int)(Tk_Height(tkwin) - height)) / 2;
- break;
- default:
- y = Tk_Height(tkwin) - mbPtr->inset - height;
- break;
- }
- if (mbPtr->image != NULL) {
- Tk_RedrawImage(mbPtr->image, 0, 0, width, height, pixmap,
- x, y);
- } else {
- XCopyPlane(mbPtr->display, mbPtr->bitmap, pixmap,
- gc, 0, 0, (unsigned)width, (unsigned)height, x, y, 1);
- }
- } else if (mbPtr->bitmap != None) {
- Tk_SizeOfBitmap(mbPtr->display, mbPtr->bitmap, &width, &height);
- goto imageOrBitmap;
- } else {
- width = mbPtr->textWidth;
- height = mbPtr->textHeight;
- switch (mbPtr->anchor) {
- case TK_ANCHOR_NW:
- case TK_ANCHOR_W:
- case TK_ANCHOR_SW:
- x = mbPtr->inset + mbPtr->xPad;
- break;
- case TK_ANCHOR_N:
- case TK_ANCHOR_CENTER:
- case TK_ANCHOR_S:
- x = ((int)(Tk_Width(tkwin) - width
- - mbPtr->indicatorWidth)) / 2;
- break;
- default:
- x = Tk_Width(tkwin) - width - mbPtr->xPad - mbPtr->inset
- - mbPtr->indicatorWidth;
- break;
- }
- switch (mbPtr->anchor) {
- case TK_ANCHOR_NW:
- case TK_ANCHOR_N:
- case TK_ANCHOR_NE:
- y = mbPtr->inset + mbPtr->yPad;
- break;
- case TK_ANCHOR_W:
- case TK_ANCHOR_CENTER:
- case TK_ANCHOR_E:
- y = ((int)(Tk_Height(tkwin) - height)) / 2;
- break;
- default:
- y = Tk_Height(tkwin) - mbPtr->inset - mbPtr->yPad - height;
- break;
- }
- TkDisplayText(mbPtr->display, pixmap, mbPtr->fontPtr,
- mbPtr->text, mbPtr->numChars, x, y, mbPtr->textWidth,
- mbPtr->justify, mbPtr->underline, gc);
- }
-
- /*
- * If the menu button is disabled with a stipple rather than a special
- * foreground color, generate the stippled effect.
- */
-
- if ((mbPtr->state == STATE_DISABLED)
- && ((mbPtr->disabledFg == NULL) || (mbPtr->image != NULL))) {
- XFillRectangle(mbPtr->display, pixmap, mbPtr->disabledGC,
- mbPtr->inset, mbPtr->inset,
- (unsigned)(Tk_Width(tkwin) - 2 * mbPtr->inset),
- (unsigned)(Tk_Height(tkwin) - 2 * mbPtr->inset));
- }
- /*
- * Draw the cascade indicator for the menu button on the
- * right side of the window, if desired.
- */
-
- if (mbPtr->indicatorOn) {
- int borderWidth;
-
- borderWidth = (mbPtr->indicatorHeight + 1) / 3;
- if (borderWidth < 1) {
- borderWidth = 1;
- }
- Blt_Fill3DRectangle(tkwin, pixmap, border,
- Tk_Width(tkwin) - mbPtr->inset - mbPtr->indicatorWidth
- + mbPtr->indicatorHeight,
- y + ((int)(height - mbPtr->indicatorHeight)) / 2,
- mbPtr->indicatorWidth - 2 * mbPtr->indicatorHeight,
- mbPtr->indicatorHeight, borderWidth, TK_RELIEF_RAISED);
- }
- /*
- * Draw the border and traversal highlight last. This way, if the
- * menu button's contents overflow onto the border they'll be covered
- * up by the border.
- */
-
- if (mbPtr->relief != TK_RELIEF_FLAT) {
- Blt_Draw3DRectangle(tkwin, pixmap, border,
- mbPtr->highlightWidth, mbPtr->highlightWidth,
- Tk_Width(tkwin) - 2 * mbPtr->highlightWidth,
- Tk_Height(tkwin) - 2 * mbPtr->highlightWidth,
- mbPtr->borderWidth, mbPtr->relief);
- }
- if (mbPtr->highlightWidth != 0) {
- GC gc;
-
- if (mbPtr->flags & GOT_FOCUS) {
- gc = Tk_GCForColor(mbPtr->highlightColorPtr, pixmap);
- } else {
- gc = Tk_GCForColor(mbPtr->highlightBgColorPtr, pixmap);
- }
- Tk_DrawFocusHighlight(tkwin, gc, mbPtr->highlightWidth, pixmap);
- }
- /*
- * Copy the information from the off-screen pixmap onto the screen,
- * then delete the pixmap.
- */
-
- XCopyArea(mbPtr->display, pixmap, Tk_WindowId(tkwin),
- mbPtr->normalTextGC, 0, 0, (unsigned)Tk_Width(tkwin),
- (unsigned)Tk_Height(tkwin), 0, 0);
- Tk_FreePixmap(mbPtr->display, pixmap);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MenuButtonEventProc --
- *
- * This procedure is invoked by the Tk dispatcher for various
- * events on buttons.
- *
- * Results:
- * None.
- *
- * Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-MenuButtonEventProc(
- ClientData clientData, /* Information about window. */
- XEvent *eventPtr) /* Information about event. */
-{
- MenuButton *mbPtr = clientData;
- if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
- goto redraw;
- } else if (eventPtr->type == ConfigureNotify) {
- /*
- * Must redraw after size changes, since layout could have changed
- * and borders will need to be redrawn.
- */
-
- goto redraw;
- } else if (eventPtr->type == DestroyNotify) {
- if (mbPtr->tkwin != NULL) {
- mbPtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(mbPtr->interp, mbPtr->widgetCmd);
- }
- if (mbPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayMenuButton, (ClientData)mbPtr);
- }
- Tcl_EventuallyFree((ClientData)mbPtr, DestroyMenuButton);
- } else if (eventPtr->type == FocusIn) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- mbPtr->flags |= GOT_FOCUS;
- if (mbPtr->highlightWidth > 0) {
- goto redraw;
- }
- }
- } else if (eventPtr->type == FocusOut) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- mbPtr->flags &= ~GOT_FOCUS;
- if (mbPtr->highlightWidth > 0) {
- goto redraw;
- }
- }
- }
- return;
-
- redraw:
- if ((mbPtr->tkwin != NULL) && !(mbPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayMenuButton, (ClientData)mbPtr);
- mbPtr->flags |= REDRAW_PENDING;
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MenuButtonCmdDeletedProc --
- *
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The widget is destroyed.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-MenuButtonCmdDeletedProc(ClientData clientData) /* Pointer to widget
- record for
- widget. */
-{
- MenuButton *mbPtr = clientData;
- Tk_Window tkwin = mbPtr->tkwin;
-
- /*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin
- * is NULL) or because the command was deleted, and then this procedure
- * destroys the widget.
- */
-
- if (tkwin != NULL) {
- mbPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * ComputeMenuButtonGeometry --
- *
- * After changes in a menu button's text or bitmap, this procedure
- * recomputes the menu button's geometry and passes this information
- * along to the geometry manager for the window.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The menu button's window may change size.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-ComputeMenuButtonGeometry(MenuButton *mbPtr)
-{
- int width, height, mm, pixels;
-
- mbPtr->inset = mbPtr->highlightWidth + mbPtr->borderWidth;
- if (mbPtr->image != None) {
- Tk_SizeOfImage(mbPtr->image, &width, &height);
- if (mbPtr->width > 0) {
- width = mbPtr->width;
- }
- if (mbPtr->height > 0) {
- height = mbPtr->height;
- }
- } else if (mbPtr->bitmap != None) {
- Tk_SizeOfBitmap(mbPtr->display, mbPtr->bitmap, &width, &height);
- if (mbPtr->width > 0) {
- width = mbPtr->width;
- }
- if (mbPtr->height > 0) {
- height = mbPtr->height;
- }
- } else {
- mbPtr->numChars = strlen(mbPtr->text);
- TkComputeTextGeometry(mbPtr->fontPtr, mbPtr->text,
- mbPtr->numChars, mbPtr->wrapLength, &mbPtr->textWidth,
- &mbPtr->textHeight);
- width = mbPtr->textWidth;
- height = mbPtr->textHeight;
- if (mbPtr->width > 0) {
- width = mbPtr->width * XTextWidth(mbPtr->fontPtr, "0", 1);
- }
- if (mbPtr->height > 0) {
- height = mbPtr->height * (mbPtr->fontPtr->ascent
- + mbPtr->fontPtr->descent);
- }
- width += 2 * mbPtr->xPad;
- height += 2 * mbPtr->yPad;
- }
-
- if (mbPtr->indicatorOn) {
- mm = WidthMMOfScreen(Tk_Screen(mbPtr->tkwin));
- pixels = WidthOfScreen(Tk_Screen(mbPtr->tkwin));
- mbPtr->indicatorHeight = (INDICATOR_HEIGHT * pixels) / (10 * mm);
- mbPtr->indicatorWidth = (INDICATOR_WIDTH * pixels) / (10 * mm)
- + 2 * mbPtr->indicatorHeight;
- width += mbPtr->indicatorWidth;
- } else {
- mbPtr->indicatorHeight = 0;
- mbPtr->indicatorWidth = 0;
- }
-
- Tk_GeometryRequest(mbPtr->tkwin, (int)(width + 2 * mbPtr->inset),
- (int)(height + 2 * mbPtr->inset));
- Tk_SetInternalBorder(mbPtr->tkwin, mbPtr->inset);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MenuButtonTextVarProc --
- *
- * This procedure is invoked when someone changes the variable
- * whose contents are to be displayed in a menu button.
- *
- * Results:
- * NULL is always returned.
- *
- * Side effects:
- * The text displayed in the menu button will change to match the
- * variable.
- *
- *---------------------------------------------------------------------------
- */
-
- /* ARGSUSED */
-static char *
-MenuButtonTextVarProc(
- ClientData clientData, /* Information about button. */
- Tcl_Interp *interp, /* Interpreter containing variable. */
- char *name1, /* Name of variable. */
- char *name2, /* Second part of variable name. */
- int flags) /* Information about what happened. */
-{
- register MenuButton *mbPtr = clientData;
- char *value;
-
- /*
- * If the variable is unset, then immediately recreate it unless
- * the whole interpreter is going away.
- */
-
- if (flags & TCL_TRACE_UNSETS) {
- if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) {
- Tcl_SetVar(interp, mbPtr->textVarName, mbPtr->text,
- TCL_GLOBAL_ONLY);
- Tcl_TraceVar(interp, mbPtr->textVarName,
- TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
- MenuButtonTextVarProc, clientData);
- }
- return (char *) NULL;
- }
- value = Tcl_GetVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY);
- if (value == NULL) {
- value = "";
- }
- if (mbPtr->text != NULL) {
- Blt_Free(mbPtr->text);
- }
- mbPtr->text = Blt_AssertStrdup(value);
- ComputeMenuButtonGeometry(mbPtr);
-
- if ((mbPtr->tkwin != NULL) && Tk_IsMapped(mbPtr->tkwin)
- && !(mbPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayMenuButton, (ClientData)mbPtr);
- mbPtr->flags |= REDRAW_PENDING;
- }
- return (char *) NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MenuButtonImageProc --
- *
- * This procedure is invoked by the image code whenever the manager
- * for an image does something that affects the size of contents
- * of an image displayed in a button.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Arranges for the button to get redisplayed.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-MenuButtonImageProc(
- ClientData clientData, /* Pointer to widget record. */
- int x, int y, /* Upper left pixel (within image)
- * that must be redisplayed. */
- int width, int height, /* Dimensions of area to redisplay
- * (may be <= 0). */
- int imgWidth, int imgHeight) /* New dimensions of image. */
-{
- register MenuButton *mbPtr = clientData;
-
- if (mbPtr->tkwin != NULL) {
- ComputeMenuButtonGeometry(mbPtr);
- if (Tk_IsMapped(mbPtr->tkwin) && !(mbPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayMenuButton, (ClientData)mbPtr);
- mbPtr->flags |= REDRAW_PENDING;
- }
- }
-}
diff --git a/blt3.0.1/src/tkPlatDecls.h b/blt3.0.1/src/tkPlatDecls.h
deleted file mode 100644
index 660c8f9..0000000
--- a/blt3.0.1/src/tkPlatDecls.h
+++ /dev/null
@@ -1,228 +0,0 @@
-
-/*
- * tkPlatDecls.h --
- *
- * Declarations of functions in the platform-specific public TCL API.
- *
- * Copyright 2003-2004 George A Howlett.
- *
- * 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 AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This file was adapted from tkPlatDecls.h of the Tk library distribution.
- *
- * Copyright (c) 1998-1999 by Scriptics Corporation.
- *
- * See the file "license.terms" for information on usage and
- * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- */
-
-#ifndef _TKPLATDECLS
-#define _TKPLATDECLS
-
-#ifdef BUILD_tk
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
-/*
- * WARNING: This file is automatically generated by the tools/genStubs.tcl
- * script. Any modifications to the function declarations below should be made
- * in the generic/tk.decls script.
- */
-
-
-/* !BEGIN!: Do not edit below this line. */
-
-/*
- * Exported function declarations:
- */
-
-#ifdef __WIN32__
-/* 0 */
-EXTERN Window Tk_AttachHWND(Tk_Window tkwin,
- HWND hwnd);
-/* 1 */
-EXTERN HINSTANCE Tk_GetHINSTANCE(void);
-/* 2 */
-EXTERN HWND Tk_GetHWND(Window window);
-/* 3 */
-EXTERN Tk_Window Tk_HWNDToWindow(HWND hwnd);
-/* 4 */
-EXTERN void Tk_PointerEvent(HWND hwnd, int x, int y);
-/* 5 */
-EXTERN int Tk_TranslateWinEvent(HWND hwnd,
- UINT message, WPARAM wParam, LPARAM lParam,
- LRESULT * result);
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-/* 0 */
-EXTERN void Tk_MacSetEmbedHandler(
- Tk_MacEmbedRegisterWinProc * registerWinProcPtr,
- Tk_MacEmbedGetGrafPortProc * getPortProcPtr,
- Tk_MacEmbedMakeContainerExistProc * containerExistProcPtr,
- Tk_MacEmbedGetClipProc * getClipProc,
- Tk_MacEmbedGetOffsetInParentProc * getOffsetProc);
-/* 1 */
-EXTERN void Tk_MacTurnOffMenus(void);
-/* 2 */
-EXTERN void Tk_MacTkOwnsCursor(int tkOwnsIt);
-/* 3 */
-EXTERN void TkMacInitMenus(Tcl_Interp * interp);
-/* 4 */
-EXTERN void TkMacInitAppleEvents(Tcl_Interp * interp);
-/* 5 */
-EXTERN int TkMacConvertEvent(EventRecord * eventPtr);
-/* 6 */
-EXTERN int TkMacConvertTkEvent(
- EventRecord * eventPtr, Window window);
-/* 7 */
-EXTERN void TkGenWMConfigureEvent(Tk_Window tkwin,
- int x, int y, int width, int height,
- int flags);
-/* 8 */
-EXTERN void TkMacInvalClipRgns(TkWindow * winPtr);
-/* 9 */
-EXTERN int TkMacHaveAppearance(void);
-/* 10 */
-EXTERN GWorldPtr TkMacGetDrawablePort(Drawable drawable);
-#endif /* MAC_TCL */
-
-typedef struct TkPlatStubs {
- int magic;
- struct TkPlatStubHooks *hooks;
-
-#ifdef __WIN32__
- Window (*tk_AttachHWND)(Tk_Window tkwin, HWND hwnd); /* 0 */
- HINSTANCE (*tk_GetHINSTANCE)(void); /* 1 */
- HWND (*tk_GetHWND)(Window window); /* 2 */
- Tk_Window (*tk_HWNDToWindow)(HWND hwnd); /* 3 */
- void (*tk_PointerEvent)(HWND hwnd, int x, int y); /* 4 */
- int (*tk_TranslateWinEvent)(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT * result); /* 5 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tk_MacSetEmbedHandler)(Tk_MacEmbedRegisterWinProc * registerWinProcPtr, Tk_MacEmbedGetGrafPortProc * getPortProcPtr, Tk_MacEmbedMakeContainerExistProc * containerExistProcPtr, Tk_MacEmbedGetClipProc * getClipProc, Tk_MacEmbedGetOffsetInParentProc * getOffsetProc); /* 0 */
- void (*tk_MacTurnOffMenus)(void); /* 1 */
- void (*tk_MacTkOwnsCursor)(int tkOwnsIt); /* 2 */
- void (*tkMacInitMenus)(Tcl_Interp * interp); /* 3 */
- void (*tkMacInitAppleEvents)(Tcl_Interp * interp); /* 4 */
- int (*tkMacConvertEvent)(EventRecord * eventPtr); /* 5 */
- int (*tkMacConvertTkEvent)(EventRecord * eventPtr, Window window); /* 6 */
- void (*tkGenWMConfigureEvent)(Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 7 */
- void (*tkMacInvalClipRgns)(TkWindow * winPtr); /* 8 */
- int (*tkMacHaveAppearance)(void); /* 9 */
- GWorldPtr (*tkMacGetDrawablePort)(Drawable drawable); /* 10 */
-#endif /* MAC_TCL */
-} TkPlatStubs;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern TkPlatStubs *tkPlatStubsPtr;
-#ifdef __cplusplus
-}
-#endif
-
-#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS)
-
-/*
- * Inline function declarations:
- */
-
-#ifdef __WIN32__
-#ifndef Tk_AttachHWND
-#define Tk_AttachHWND \
- (tkPlatStubsPtr->tk_AttachHWND) /* 0 */
-#endif
-#ifndef Tk_GetHINSTANCE
-#define Tk_GetHINSTANCE \
- (tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */
-#endif
-#ifndef Tk_GetHWND
-#define Tk_GetHWND \
- (tkPlatStubsPtr->tk_GetHWND) /* 2 */
-#endif
-#ifndef Tk_HWNDToWindow
-#define Tk_HWNDToWindow \
- (tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */
-#endif
-#ifndef Tk_PointerEvent
-#define Tk_PointerEvent \
- (tkPlatStubsPtr->tk_PointerEvent) /* 4 */
-#endif
-#ifndef Tk_TranslateWinEvent
-#define Tk_TranslateWinEvent \
- (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */
-#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-#ifndef Tk_MacSetEmbedHandler
-#define Tk_MacSetEmbedHandler \
- (tkPlatStubsPtr->tk_MacSetEmbedHandler) /* 0 */
-#endif
-#ifndef Tk_MacTurnOffMenus
-#define Tk_MacTurnOffMenus \
- (tkPlatStubsPtr->tk_MacTurnOffMenus) /* 1 */
-#endif
-#ifndef Tk_MacTkOwnsCursor
-#define Tk_MacTkOwnsCursor \
- (tkPlatStubsPtr->tk_MacTkOwnsCursor) /* 2 */
-#endif
-#ifndef TkMacInitMenus
-#define TkMacInitMenus \
- (tkPlatStubsPtr->tkMacInitMenus) /* 3 */
-#endif
-#ifndef TkMacInitAppleEvents
-#define TkMacInitAppleEvents \
- (tkPlatStubsPtr->tkMacInitAppleEvents) /* 4 */
-#endif
-#ifndef TkMacConvertEvent
-#define TkMacConvertEvent \
- (tkPlatStubsPtr->tkMacConvertEvent) /* 5 */
-#endif
-#ifndef TkMacConvertTkEvent
-#define TkMacConvertTkEvent \
- (tkPlatStubsPtr->tkMacConvertTkEvent) /* 6 */
-#endif
-#ifndef TkGenWMConfigureEvent
-#define TkGenWMConfigureEvent \
- (tkPlatStubsPtr->tkGenWMConfigureEvent) /* 7 */
-#endif
-#ifndef TkMacInvalClipRgns
-#define TkMacInvalClipRgns \
- (tkPlatStubsPtr->tkMacInvalClipRgns) /* 8 */
-#endif
-#ifndef TkMacHaveAppearance
-#define TkMacHaveAppearance \
- (tkPlatStubsPtr->tkMacHaveAppearance) /* 9 */
-#endif
-#ifndef TkMacGetDrawablePort
-#define TkMacGetDrawablePort \
- (tkPlatStubsPtr->tkMacGetDrawablePort) /* 10 */
-#endif
-#endif /* MAC_TCL */
-
-#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
-
-/* !END!: Do not edit above this line. */
-
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLIMPORT
-
-#endif /* _TKPLATDECLS */
diff --git a/blt3.0.1/src/tkUnixFont.h b/blt3.0.1/src/tkUnixFont.h
deleted file mode 100644
index b15ee3f..0000000
--- a/blt3.0.1/src/tkUnixFont.h
+++ /dev/null
@@ -1,128 +0,0 @@
-
-/*
- * tkUnixFont.h --
- *
- *
- * The Font structure used internally by the Tk_3D* routines.
- * The following is a copy of it from tk3d.c.
- *
- * Contains copies of internal Tk structures.
- *
- * Copyright (c) 1997 by Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- */
-
-#ifndef _TK_UNIXFONT_H
-#define _TK_UNIXFONT_H
-
-
-/*
- * The following structure represents a font family. It is assumed that all
- * screen fonts constructed from the same "font family" share certain
- * properties; all screen fonts with the same "font family" point to a shared
- * instance of this structure. The most important shared property is the
- * character existence metrics, used to determine if a screen font can display
- * a given Unicode character.
- *
- * Under Unix, there are three attributes that uniquely identify a "font
- * family": the foundry, face name, and charset.
- */
-
-#define FONTMAP_SHIFT 10
-
-#define FONTMAP_PAGES (1 << (sizeof(Tcl_UniChar)*8 - FONTMAP_SHIFT))
-#define FONTMAP_BITSPERPAGE (1 << FONTMAP_SHIFT)
-
-typedef struct _FontFamily {
- struct _FontFamily *nextPtr; /* Next in list of all known font families. */
- int refCount; /* How many SubFonts are referring to this
- * FontFamily. When the refCount drops to
- * zero, this FontFamily may be freed. */
- /*
- * Key.
- */
-
- Tk_Uid foundry; /* Foundry key for this FontFamily. */
- Tk_Uid faceName; /* Face name key for this FontFamily. */
- Tcl_Encoding encoding; /* Encoding key for this FontFamily. */
-
- /*
- * Derived properties.
- */
-
- int isTwoByteFont; /* 1 if this is a double-byte font, 0
- * otherwise. */
- char *fontMap[FONTMAP_PAGES];
- /* Two-level sparse table used to determine
- * quickly if the specified character exists.
- * As characters are encountered, more pages
- * in this table are dynamically alloced. The
- * contents of each page is a bitmask
- * consisting of FONTMAP_BITSPERPAGE bits,
- * representing whether this font can be used
- * to display the given character at the
- * corresponding bit position. The high bits
- * of the character are used to pick which
- * page of the table is used. */
-} FontFamily;
-
-/*
- * The following structure encapsulates an individual screen font. A font
- * object is made up of however many SubFonts are necessary to display a
- * stream of multilingual characters.
- */
-typedef struct _SubFont {
- char **fontMap; /* Pointer to font map from the FontFamily,
- * cached here to save a dereference. */
- XFontStruct *fontStructPtr; /* The specific screen font that will be
- * used when displaying/measuring chars
- * belonging to the FontFamily. */
- FontFamily *familyPtr; /* The FontFamily for this SubFont. */
-} SubFont;
-
-/*
- * The following structure represents Unix's implementation of a font
- * object.
- */
-
-#define SUBFONT_SPACE 3
-#define BASE_CHARS 256
-
-typedef struct _UnixFont {
- TkFont font; /* Stuff used by generic font package. Must
- * be first in structure. */
- SubFont staticSubFonts[SUBFONT_SPACE];
- /* Builtin space for a limited number of
- * SubFonts. */
- int numSubFonts; /* Length of following array. */
- SubFont *subFontArray; /* Array of SubFonts that have been loaded
- * in order to draw/measure all the characters
- * encountered by this font so far. All fonts
- * start off with one SubFont initialized by
- * AllocFont() from the original set of font
- * attributes. Usually points to
- * staticSubFonts, but may point to malloced
- * space if there are lots of SubFonts. */
- SubFont controlSubFont; /* Font to use to display control-character
- * expansions. */
-
- Display *display; /* Display that owns font. */
- int pixelSize; /* Original pixel size used when font was
- * constructed. */
- TkXLFDAttributes xa; /* Additional attributes that specify the
- * preferred foundry and encoding to use when
- * constructing additional SubFonts. */
- int widths[BASE_CHARS]; /* Widths of first 256 chars in the base
- * font, for handling common case. */
- int underlinePos; /* Offset from baseline to origin of
- * underline bar (used when drawing underlined
- * font) (pixels). */
- int barHeight; /* Height of underline or overstrike bar
- * (used when drawing underlined or strikeout
- * font) (pixels). */
-} UnixFont;
-
-#endif /* _TK_UNIXFONT_H */
diff --git a/blt3.0.1/src/tkWinDisplay.h b/blt3.0.1/src/tkWinDisplay.h
deleted file mode 100644
index f852bb7..0000000
--- a/blt3.0.1/src/tkWinDisplay.h
+++ /dev/null
@@ -1,106 +0,0 @@
-
-/*
- * tkWinDisplay.h --
- *
- * Copyright 2003-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This file contains excerpts from tkInt.h of the Tk library distribution.
- *
- * Copyright (c) 1998-1999 by Scriptics Corporation.
- *
- * See the file "license.terms" for information on usage and
- * redistribution of this file, and for a DISCLAIMER OF ALL
- * WARRANTIES.
- *
- */
-
-#ifndef _TK_WIN_DISPLAY_H
-#define _TK_WIN_DISPLAY_H
-
-/*
- * The TkWinDrawable is the internal implementation of an X Drawable
- * (either a Window or a Pixmap). The following constants define the
- * valid Drawable types.
- */
-
-#define TWD_BITMAP 1
-#define TWD_WINDOW 2
-#define TWD_WINDC 3
-
-typedef struct {
- int type;
- HWND handle;
- TkWindow *winPtr;
-} TkWinWindow;
-
-typedef struct {
- int type;
- HBITMAP handle;
- Colormap colormap;
- int depth;
-} TkWinBitmap;
-
-typedef struct {
- int type;
- HDC hdc;
-} TkWinDC;
-
-typedef union {
- int type;
- TkWinWindow window;
- TkWinBitmap bitmap;
- TkWinDC winDC;
-} TkWinDrawable;
-
-/*
- * The TkWinDCState is used to save the state of a device context
- * so that it can be restored later.
- */
-typedef struct {
- HPALETTE palette;
- int bkmode; /* This field was added in Tk
- * 8.3.1. Be careful that you don't
- * use this structure in a context
- * where its size is important. */
-} TkWinDCState;
-
-#ifdef USE_TK_STUBS
-#include "tkIntPlatDecls.h"
-#else
-extern HDC TkWinGetDrawableDC(Display *display, Drawable drawable,
- TkWinDCState *state);
-
-extern HDC TkWinReleaseDrawableDC(Drawable drawable, HDC dc,
- TkWinDCState *state);
-
-extern HINSTANCE Tk_GetHINSTANCE(void);
-
-extern HWND Tk_GetHWND(Window window);
-
-extern Window Tk_AttachHWND(Tk_Window tkwin, HWND hWnd);
-
-#endif /* USE_TK_STUBS */
-#endif /* _TK_WIN_DISPLAY_H */
-
diff --git a/blt3.0.1/src/tkWinFont.h b/blt3.0.1/src/tkWinFont.h
deleted file mode 100644
index 65f2f77..0000000
--- a/blt3.0.1/src/tkWinFont.h
+++ /dev/null
@@ -1,163 +0,0 @@
-
-/*
- * tkWinFont.h --
- *
- * Copyright 2003-2004 George A Howlett.
- *
- * 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 AUTHORS
- * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * This file contains structure definitions from tkWinFont.h of the Tk
- * library distribution.
- *
- * Copyright (c) 1998-1999 by Scriptics Corporation.
- *
- * See the file "license.terms" for information on usage and
- * redistribution of this file, and for a DISCLAIMER OF ALL
- * WARRANTIES.
- *
- */
-
-#ifndef _TK_WINFONT_H
-#define _TK_WINFONT_H
-
-/*
- * The following structure represents a font family. It is assumed that
- * all screen fonts constructed from the same "font family" share certain
- * properties; all screen fonts with the same "font family" point to a
- * shared instance of this structure. The most important shared property
- * is the character existence metrics, used to determine if a screen font
- * can display a given Unicode character.
- *
- * Under Windows, a "font family" is uniquely identified by its face name.
- */
-
-#define FONTMAP_SHIFT 10
-
-#define FONTMAP_PAGES (1 << (sizeof(Tcl_UniChar)*8 - FONTMAP_SHIFT))
-#define FONTMAP_BITSPERPAGE (1 << FONTMAP_SHIFT)
-
-
-typedef struct FontFamily {
- struct FontFamily *nextPtr; /* Next in list of all known font families. */
- int refCount; /* How many SubFonts are referring to this
- * FontFamily. When the refCount drops to
- * zero, this FontFamily may be freed. */
- /*
- * Key.
- */
-
- Tk_Uid faceName; /* Face name key for this FontFamily. */
-
- /*
- * Derived properties.
- */
-
- Tcl_Encoding encoding; /* Encoding for this font family. */
- int isSymbolFont; /* Non-zero if this is a symbol font. */
- int isWideFont; /* 1 if this is a double-byte font, 0
- * otherwise. */
- BOOL (WINAPI *textOutProc)(HDC, int, int, TCHAR *, int);
- /* The procedure to use to draw text after
- * it has been converted from UTF-8 to the
- * encoding of this font. */
- BOOL (WINAPI *getTextExtentPoint32Proc)(HDC, TCHAR *, int, LPSIZE);
- /* The procedure to use to measure text after
- * it has been converted from UTF-8 to the
- * encoding of this font. */
-
- char *fontMap[FONTMAP_PAGES];
- /* Two-level sparse table used to determine
- * quickly if the specified character exists.
- * As characters are encountered, more pages
- * in this table are dynamically added. The
- * contents of each page is a bitmask
- * consisting of FONTMAP_BITSPERPAGE bits,
- * representing whether this font can be used
- * to display the given character at the
- * corresponding bit position. The high bits
- * of the character are used to pick which
- * page of the table is used. */
-
- /*
- * Cached Truetype font info.
- */
-
- int segCount; /* The length of the following arrays. */
- USHORT *startCount; /* Truetype information about the font, */
- USHORT *endCount; /* indicating which characters this font
- * can display (malloced). The format of
- * this information is (relatively) compact,
- * but would take longer to search than
- * indexing into the fontMap[][] table. */
-} FontFamily;
-
-/*
- * The following structure encapsulates an individual screen font. A font
- * object is made up of however many SubFonts are necessary to display a
- * stream of multilingual characters.
- */
-typedef struct SubFont {
- char **fontMap; /* Pointer to font map from the FontFamily,
- * cached here to save a dereference. */
- HFONT hFont; /* The specific screen font that will be
- * used when displaying/measuring chars
- * belonging to the FontFamily. */
- FontFamily *familyPtr; /* The FontFamily for this SubFont. */
-} SubFont;
-
-/*
- * The following structure represents Windows' implementation of a font
- * object.
- */
-
-#define SUBFONT_SPACE 3
-#define BASE_CHARS 128
-
-typedef struct WinFont {
- TkFont font; /* Stuff used by generic font package. Must
- * be first in structure. */
- SubFont staticSubFonts[SUBFONT_SPACE];
- /* Builtin space for a limited number of
- * SubFonts. */
- int numSubFonts; /* Length of following array. */
- SubFont *subFontArray; /* Array of SubFonts that have been loaded
- * in order to draw/measure all the characters
- * encountered by this font so far. All fonts
- * start off with one SubFont initialized by
- * AllocFont() from the original set of font
- * attributes. Usually points to
- * staticSubFonts, but may point to malloced
- * space if there are lots of SubFonts. */
-
- HWND hwnd; /* Toplevel window of application that owns
- * this font, used for getting HDC for
- * offscreen measurements. */
- int pixelSize; /* Original pixel size used when font was
- * constructed. */
- int widths[BASE_CHARS]; /* Widths of first 128 chars in the base
- * font, for handling common case. The base
- * font is always used to draw characters
- * between 0x0000 and 0x007f. */
-} WinFont;
-
-#endif /* _TK_WINFONT_H */
diff --git a/blt3.0.1/tests/datatable.tcl b/blt3.0.1/tests/datatable.tcl
deleted file mode 100644
index 61ceb21..0000000
--- a/blt3.0.1/tests/datatable.tcl
+++ /dev/null
@@ -1,4252 +0,0 @@
-package require BLT
-
-if {[info procs test] != "test"} {
- source defs
-}
-if [file exists ../library] {
- set blt_library ../library
-}
-
-#set VERBOSE 1
-test datatable.1 {datatable no args} {
- list [catch {blt::datatable} msg] $msg
-} {1 {wrong # args: should be one of...
- blt::datatable create ?name?
- blt::datatable destroy name...
- blt::datatable load name libpath
- blt::datatable names ?pattern?...}}
-
-test datatable.2 {datatable create #auto} {
- list [catch {blt::datatable create #auto} msg] $msg
-} {0 ::datatable0}
-
-test datatable.3 {datatable create #auto.suffix} {
- list [catch {
- blt::datatable create #auto.suffix
- } msg] $msg
-} {0 ::datatable0.suffix}
-
-test datatable.4 {datatable create prefix.#auto} {
- list [catch {
- blt::datatable create prefix.#auto
- } msg] $msg
-} {0 ::prefix.datatable0}
-
-test datatable.5 {datatable create prefix.#auto.suffix} {
- list [catch {
- blt::datatable create prefix.#auto.suffix
- } msg] $msg
-} {0 ::prefix.datatable0.suffix}
-
-test datatable.6 {datatable create prefix.#auto.suffix.#auto} {
- list [catch {
- blt::datatable create prefix.#auto.suffix.#auto
- } msg] $msg
-} {0 ::prefix.datatable0.suffix.#auto}
-
-test datatable.7 {blt::datatable destroy [blt::datatable names *datatable0*]} {
- list [catch {
- eval blt::datatable destroy [blt::datatable names *datatable0*]
- } msg] $msg
-} {0 {}}
-
-test datatable.8 {blt::datatable create} {
- list [catch {
- blt::datatable create
- } msg] $msg
-} {0 ::datatable0}
-
-test datatable.9 {blt::datatable create} {
- list [catch {
- blt::datatable create
- } msg] $msg
-} {0 ::datatable1}
-
-test datatable.10 {blt::datatable create fred} {
- list [catch {
- blt::datatable create fred
- } msg] $msg
-} {0 ::fred}
-
-test datatable.11 {blt::datatable create fred} {
- list [catch {
- blt::datatable create fred
- } msg] $msg
-} {1 {a command "::fred" already exists}}
-
-test datatable.12 {blt::datatable create if} {
- list [catch {
- blt::datatable create if
- } msg] $msg
-} {1 {a command "::if" already exists}}
-
-test datatable.13 {blt::datatable create (bad namespace)} {
- list [catch {
- blt::datatable create badNs::fred
- } msg] $msg
-} {1 {unknown namespace "badNs"}}
-
-test datatable.14 {blt::datatable create (wrong # args)} {
- list [catch {
- blt::datatable create a b
- } msg] $msg
-} {1 {wrong # args: should be "blt::datatable create ?name?"}}
-
-test datatable.15 {names} {
- list [catch {
- blt::datatable names
- } msg] [lsort $msg]
-} {0 {::datatable0 ::datatable1 ::fred}}
-
-test datatable.16 {names pattern)} {
- list [catch {
- blt::datatable names ::datatable*
- } msg] [lsort $msg]
-} {0 {::datatable0 ::datatable1}}
-
-test datatable.17 {names badPattern)} {
- list [catch {
- blt::datatable names badPattern*
- } msg] $msg
-} {0 {}}
-
-test datatable.18 {names pattern arg (wrong # args)} {
- list [catch {
- blt::datatable names pattern arg
- } msg] $msg
-} {1 {wrong # args: should be "blt::datatable names ?pattern?..."}}
-
-test datatable.19 {destroy (wrong # args)} {
- list [catch {
- blt::datatable destroy
- } msg] $msg
-} {1 {wrong # args: should be "blt::datatable destroy name..."}}
-
-test datatable.20 {destroy badName} {
- list [catch {
- blt::datatable destroy badName
- } msg] $msg
-} {1 {can't find table "badName"}}
-
-test datatable.21 {destroy fred} {
- list [catch {
- blt::datatable destroy fred
- } msg] $msg
-} {0 {}}
-
-test datatable.22 {destroy datatable0 datatable1} {
- list [catch {
- blt::datatable destroy datatable0 datatable1
- } msg] $msg
-} {0 {}}
-
-test datatable.23 {create} {
- list [catch {
- blt::datatable create
- } msg] $msg
-} {0 ::datatable0}
-
-test datatable.24 {datatable0} {
- list [catch {
- datatable0
- } msg] $msg
-} {1 {wrong # args: should be one of...
- datatable0 add table ?switches?
- datatable0 append row column value ?value...?
- datatable0 attach args...
- datatable0 column op args...
- datatable0 dump ?switches?
- datatable0 emptyvalue ?newValue?
- datatable0 exists row column
- datatable0 export format args...
- datatable0 find expr ?switches?
- datatable0 get row column ?defValue?
- datatable0 import format args...
- datatable0 keys ?column...?
- datatable0 lappend row column value ?value...?
- datatable0 lookup ?value...?
- datatable0 notify op args...
- datatable0 restore ?switches?
- datatable0 row op args...
- datatable0 set ?row column value?...
- datatable0 sort ?flags...?
- datatable0 trace op args...
- datatable0 unset row column ?row column?}}
-
-test datatable.25 {datatable0 badOp} {
- list [catch {
- datatable0 badOp
- } msg] $msg
-} {1 {bad operation "badOp": should be one of...
- datatable0 add table ?switches?
- datatable0 append row column value ?value...?
- datatable0 attach args...
- datatable0 column op args...
- datatable0 dump ?switches?
- datatable0 emptyvalue ?newValue?
- datatable0 exists row column
- datatable0 export format args...
- datatable0 find expr ?switches?
- datatable0 get row column ?defValue?
- datatable0 import format args...
- datatable0 keys ?column...?
- datatable0 lappend row column value ?value...?
- datatable0 lookup ?value...?
- datatable0 notify op args...
- datatable0 restore ?switches?
- datatable0 row op args...
- datatable0 set ?row column value?...
- datatable0 sort ?flags...?
- datatable0 trace op args...
- datatable0 unset row column ?row column?}}
-
-test datatable.26 {datatable0 column (wrong \# args)} {
- list [catch {
- datatable0 column
- } msg] $msg
-} {1 {wrong # args: should be "datatable0 column op args..."}}
-
-
-test datatable.27 {datatable0 column badOp} {
- list [catch {
- datatable0 column badOp
- } msg] $msg
-} {1 {bad operation "badOp": should be one of...
- datatable0 column copy src dest ?switches...?
- datatable0 column create ?switches?
- datatable0 column delete column...
- datatable0 column dup column...
- datatable0 column exists column
- datatable0 column extend label ?label...?
- datatable0 column get column ?switches?
- datatable0 column index column
- datatable0 column indices column ?column...?
- datatable0 column label column ?label?
- datatable0 column labels ?labelList?
- datatable0 column length
- datatable0 column move from to ?count?
- datatable0 column names ?pattern...?
- datatable0 column notify column ?flags? command
- datatable0 column set column row value...
- datatable0 column tag op args...
- datatable0 column trace column how command
- datatable0 column type column ?type?
- datatable0 column unique column ?switches?
- datatable0 column unset column...
- datatable0 column values column ?valueList?}}
-
-test datatable.28 {datatable0 row (wrong \# args)} {
- list [catch {
- datatable0 row
- } msg] $msg
-} {1 {wrong # args: should be "datatable0 row op args..."}}
-
-
-test datatable.29 {datatable0 row badOp} {
- list [catch {
- datatable0 row badOp
- } msg] $msg
-} {1 {bad operation "badOp": should be one of...
- datatable0 row copy src dest ?switches...?
- datatable0 row create ?switches...?
- datatable0 row delete row...
- datatable0 row dup row...
- datatable0 row exists row
- datatable0 row extend label ?label...?
- datatable0 row get row ?switches?
- datatable0 row index row
- datatable0 row indices row ?row...?
- datatable0 row label row ?label?
- datatable0 row labels ?labelList?
- datatable0 row length
- datatable0 row move from to ?count?
- datatable0 row names ?pattern...?
- datatable0 row notify row ?flags? command
- datatable0 row set row column value...
- datatable0 row tag op args...
- datatable0 row trace row how command
- datatable0 row unique row
- datatable0 row unset row...
- datatable0 row values row ?valueList?}}
-
-test datatable.30 {datatable0 column length} {
- list [catch {datatable0 column length} msg] $msg
-} {0 0}
-
-test datatable.31 {datatable0 column length badArg} {
- list [catch {datatable0 column length badArg} msg] $msg
-} {1 {wrong # args: should be "datatable0 column length "}}
-
-test datatable.32 {datatable0 column -label xyz insert} {
- list [catch {datatable0 column -label xyz insert} msg] $msg
-} {1 {bad operation "-label": should be one of...
- datatable0 column copy src dest ?switches...?
- datatable0 column create ?switches?
- datatable0 column delete column...
- datatable0 column dup column...
- datatable0 column exists column
- datatable0 column extend label ?label...?
- datatable0 column get column ?switches?
- datatable0 column index column
- datatable0 column indices column ?column...?
- datatable0 column label column ?label?
- datatable0 column labels ?labelList?
- datatable0 column length
- datatable0 column move from to ?count?
- datatable0 column names ?pattern...?
- datatable0 column notify column ?flags? command
- datatable0 column set column row value...
- datatable0 column tag op args...
- datatable0 column trace column how command
- datatable0 column type column ?type?
- datatable0 column unique column ?switches?
- datatable0 column unset column...
- datatable0 column values column ?valueList?}}
-
-test datatable.33 {column extend 5} {
- list [catch {datatable0 column extend 5} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.34 {column length} {
- list [catch {datatable0 column length} msg] $msg
-} {0 5}
-
-test datatable.35 {column index end} {
- list [catch {datatable0 column index end} msg] $msg
-} {0 5}
-
-test datatable.36 {row extend 5} {
- list [catch {datatable0 row extend 5} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.37 {row length} {
- list [catch {datatable0 row length} msg] $msg
-} {0 5}
-
-test datatable.38 {column index end} {
- list [catch {datatable0 row index end} msg] $msg
-} {0 5}
-
-test datatable.39 {column index all} {
- list [catch {datatable0 column index all} msg] $msg
-} {0 -1}
-
-test datatable.40 {column indices all} {
- list [catch {datatable0 column indices all} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.41 {column indices 1-end} {
- list [catch {datatable0 column indices 1-end} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.42 {column indices range=1-end} {
- list [catch {datatable0 column indices range=1-end} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.43 {column indices 1-all} {
- list [catch {datatable0 column indices 1-all} msg] $msg
-} {1 {unknown column specification "1-all" in ::datatable0}}
-
-test datatable.44 {column indices range=1-all} {
- list [catch {datatable0 column indices range=1-all} msg] $msg
-} {1 {multiple columns specified by "all"}}
-
-test datatable.45 {column indices 2-5} {
- list [catch {datatable0 column indices 2-5} msg] $msg
-} {0 {2 3 4 5}}
-
-test datatable.46 {column indices 5-2} {
- list [catch {datatable0 column indices 5-2} msg] $msg
-} {0 {}}
-
-test datatable.47 {column index end} {
- list [catch {datatable0 column index end} msg] $msg
-} {0 5}
-
-test datatable.48 {column index end badArg} {
- list [catch {datatable0 column index end badArg} msg] $msg
-} {1 {wrong # args: should be "datatable0 column index column"}}
-
-test datatable.49 {column label 1} {
- list [catch {datatable0 column label 1} msg] $msg
-} {0 c1}
-
-test datatable.50 {column label 1 myLabel} {
- list [catch {datatable0 column label 1 myLabel} msg] $msg
-} {0 {}}
-
-test datatable.51 {column label 1 myLabel} {
- list [catch {datatable0 column label 1 myLabel} msg] $msg
-} {0 {}}
-
-test datatable.52 {column label 2 myLabel} {
- list [catch {datatable0 column label 2 myLabel} msg] $msg
-} {0 {}}
-
-package require blt_datatable_csv
-puts stderr [datatable0 export csv -columnlabels]
-test datatable.53 {column index myLabel} {
- list [catch {datatable0 column index myLabel} msg] $msg
-} {0 1}
-
-test datatable.54 {column label 1 newLabel} {
- list [catch {datatable0 column label 1 newLabel} msg] $msg
-} {0 {}}
-
-test datatable.55 {column index myLabel} {
- list [catch {datatable0 column index myLabel} msg] $msg
-} {0 2}
-
-test datatable.56 {column label 1} {
- list [catch {datatable0 column label 1} msg] $msg
-} {0 newLabel}
-
-test datatable.57 {column label end end} {
- list [catch {datatable0 column label end end} msg] $msg
-} {0 {}}
-
-test datatable.58 {column label end endLabel} {
- list [catch {datatable0 column label end endLabel} msg] $msg
-} {0 {}}
-
-test datatable.59 {column label end label-with-minus} {
- list [catch {datatable0 column label end label-with-minus} msg] $msg
-} {0 {}}
-
-test datatable.60 {column label end 1abc} {
- list [catch {datatable0 column label end 1abc} msg] $msg
-} {0 {}}
-
-test datatable.61 {column label end -abc} {
- list [catch {datatable0 column label end -abc} msg] $msg
-} {1 {column label "-abc" can't start with a '-'.}}
-
-test datatable.62 {column indices 1-5} {
- list [catch {datatable0 column indices 1-5} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.63 {column indices range=1-5} {
- list [catch {datatable0 column indices range=1-5} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.64 {column label 1-5 c1 } {
- list [catch {datatable0 column label 1-5 c1} msg] $msg
-} {1 {multiple columns specified by "1-5"}}
-
-test datatable.65 {column label 1 c1 2 c2 3 c3 4 c4 5 c5 } {
- list [catch {datatable0 column label 1 c1 2 c2 3 c3 4 c4 5 c5} msg] $msg
-} {0 {}}
-
-test datatable.66 {column label 1} {
- list [catch {datatable0 column label 1} msg] $msg
-} {0 c1}
-
-test datatable.67 {column label 2} {
- list [catch {datatable0 column label 2} msg] $msg
-} {0 c2}
-
-test datatable.68 {column label 3} {
- list [catch {datatable0 column label 3} msg] $msg
-} {0 c3}
-
-test datatable.69 {column label 4} {
- list [catch {datatable0 column label 4} msg] $msg
-} {0 c4}
-
-test datatable.70 {column label 5} {
- list [catch {datatable0 column label 5} msg] $msg
-} {0 c5}
-
-test datatable.71 {column label 6} {
- list [catch {datatable0 column label 6} msg] $msg
-} {1 {bad column index "6"}}
-
-test datatable.72 {column names} {
- list [catch {datatable0 column names} msg] $msg
-} {0 {c1 c2 c3 c4 c5}}
-
-test datatable.73 {column names c*} {
- list [catch {datatable0 column names c*} msg] $msg
-} {0 {c1 c2 c3 c4 c5}}
-
-test datatable.74 {column names {*[1-2]}} {
- list [catch {datatable0 column names {*[1-2]}} msg] $msg
-} {0 {c1 c2}}
-
-test datatable.75 {column names noMatch} {
- list [catch {datatable0 column names noMatch} msg] $msg
-} {0 {}}
-
-test datatable.76 {row label 1-5 r1} {
- list [catch {datatable0 row label 1-5 r1} msg] $msg
-} {1 {multiple rows specified by "1-5"}}
-
-test datatable.77 {row label 1 r1 2 r2 3 r3 4 r4 5 r5} {
- list [catch {datatable0 row label 1 r1 2 r2 3 r3 4 r4 5 r5} msg] $msg
-} {0 {}}
-
-test datatable.78 {row names} {
- list [catch {datatable0 row names} msg] $msg
-} {0 {r1 r2 r3 r4 r5}}
-
-test datatable.79 {row names r*} {
- list [catch {datatable0 row names r*} msg] $msg
-} {0 {r1 r2 r3 r4 r5}}
-
-test datatable.80 {row names noMatch} {
- list [catch {datatable0 row names noMatch} msg] $msg
-} {0 {}}
-
-test datatable.81 {column get} {
- list [catch {datatable0 column get} msg] $msg
-} {1 {wrong # args: should be "datatable0 column get column ?switches?"}}
-
-test datatable.82 {column get c1} {
- list [catch {datatable0 column get c1} msg] $msg
-} {0 {1 {} 2 {} 3 {} 4 {} 5 {}}}
-
-test datatable.83 {column get badColumn} {
- list [catch {datatable0 column get badColumn} msg] $msg
-} {1 {unknown column specification "badColumn" in ::datatable0}}
-
-test datatable.84 {column values} {
- list [catch {datatable0 column values} msg] $msg
-} {1 {wrong # args: should be "datatable0 column values column ?valueList?"}}
-
-test datatable.85 {column values c1} {
- list [catch {
- datatable0 column values c1
- } msg] $msg
-} {0 {{} {} {} {} {}}}
-
-test datatable.86 {column values c1 {1.01 2.01 3.01 4.01 5.01}} {
- list [catch {
- datatable0 column values c1 {1.01 2.01 3.01 4.01 5.01}
- } msg] $msg
-} {0 {}}
-
-test datatable.87 {column get 1} {
- list [catch {datatable0 column get 1} msg] $msg
-} {0 {1 1.01 2 2.01 3 3.01 4 4.01 5 5.01}}
-
-test datatable.88 {column set all 1 1.0 2 2.0 3 3.0 4 4.0 5 5.0} {
- list [catch {
- datatable0 column set all 1 1.0 2 2.0 3 3.0 4 4.0 5 5.0
- } msg] $msg
-} {0 {}}
-
-test datatable.89 {column get all} {
- list [catch {datatable0 column get all} msg] $msg
-} {1 {multiple columns specified by "all"}}
-
-test datatable.90 {column get 1-2} {
- list [catch {datatable0 column get 1-2} msg] $msg
-} {1 {multiple columns specified by "1-2"}}
-
-test datatable.91 {datatable0 column get 2} {
- list [catch {datatable0 column get 2} msg] $msg
-} {0 {1 1.0 2 2.0 3 3.0 4 4.0 5 5.0}}
-
-test datatable.92 {datatable0 column get 3} {
- list [catch {datatable0 column get 3} msg] $msg
-} {0 {1 1.0 2 2.0 3 3.0 4 4.0 5 5.0}}
-
-test datatable.93 {datatable0 column get end} {
- list [catch {datatable0 column get end} msg] $msg
-} {0 {1 1.0 2 2.0 3 3.0 4 4.0 5 5.0}}
-
-test datatable.94 {datatable0 column set 1 3 a 2 b 1 c} {
- list [catch {datatable0 column set 1 3 a 2 b 1 c} msg] $msg
-} {0 {}}
-
-test datatable.95 {column values 1} {
- list [catch {datatable0 column values 1} msg] $msg
-} {0 {c b a 4.0 5.0}}
-
-test datatable.96 {column set end 1 x 2 y} {
- list [catch {datatable0 column set end 1 x 2 y} msg] $msg
-} {0 {}}
-
-test datatable.97 {column values end} {
- list [catch {datatable0 column values end} msg] $msg
-} {0 {x y 3.0 4.0 5.0}}
-
-test datatable.98 {column index c5} {
- list [catch {datatable0 column index c5} msg] $msg
-} {0 5}
-
-test datatable.99 {column indices all} {
- list [catch {datatable0 column indices all} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.100 {column index -1} {
- list [catch {datatable0 column index -1} msg] $msg
-} {0 -1}
-
-test datatable.101 {column index 1000} {
- list [catch {datatable0 column index 1000} msg] $msg
-} {0 -1}
-
-test datatable.102 {column type 1} {
- list [catch {datatable0 column type 1} msg] $msg
-} {0 string}
-
-test datatable.103 {column type 2 integer} {
- list [catch {datatable0 column type 2 integer} msg] $msg
-} {1 {expected integer but got "1.0"}}
-
-test datatable.104 {column type 4 double} {
- list [catch {datatable0 column type 4 double} msg] $msg
-} {0 double}
-
-test datatable.106 {column type 1 string} {
- list [catch {datatable0 column type 1 string} msg] $msg
-} {0 string}
-
-test datatable.107 {column type 1 string badArg} {
- list [catch {datatable0 column type 1 string badArg} msg] $msg
-} {1 {wrong # args: should be "datatable0 column type column ?type?"}}
-
-test datatable.108 {column type badTag string} {
- list [catch {datatable0 column type badTag string} msg] $msg
-} {1 {unknown column specification "badTag" in ::datatable0}}
-
-test datatable.109 {column type all string} {
- list [catch {datatable0 column type all string} msg] $msg
-} {0 {string string string string string}}
-
-test datatable.110 {column tag badOp} {
- list [catch {datatable0 column tag badOp} msg] $msg
-} {1 {bad tag operation "badOp": should be one of...
- datatable0 column tag add tag ?column...?
- datatable0 column tag delete tag ?column...?
- datatable0 column tag exists tag ?column?
- datatable0 column tag forget ?tag...?
- datatable0 column tag get column ?pattern...?
- datatable0 column tag indices ?tag...?
- datatable0 column tag labels ?tag...?
- datatable0 column tag range from to ?tag...?
- datatable0 column tag search column ?pattern?
- datatable0 column tag set column tag...
- datatable0 column tag unset column tag...}}
-
-test datatable.111 {column tag (missing args)} {
- list [catch {datatable0 column tag} msg] $msg
-} {1 {wrong # args: should be one of...
- datatable0 column tag add tag ?column...?
- datatable0 column tag delete tag ?column...?
- datatable0 column tag exists tag ?column?
- datatable0 column tag forget ?tag...?
- datatable0 column tag get column ?pattern...?
- datatable0 column tag indices ?tag...?
- datatable0 column tag labels ?tag...?
- datatable0 column tag range from to ?tag...?
- datatable0 column tag search column ?pattern?
- datatable0 column tag set column tag...
- datatable0 column tag unset column tag...}}
-
-test datatable.112 {datatable0 column tag badOp} {
- list [catch {datatable0 column tag badOp} msg] $msg
-} {1 {bad tag operation "badOp": should be one of...
- datatable0 column tag add tag ?column...?
- datatable0 column tag delete tag ?column...?
- datatable0 column tag exists tag ?column?
- datatable0 column tag forget ?tag...?
- datatable0 column tag get column ?pattern...?
- datatable0 column tag indices ?tag...?
- datatable0 column tag labels ?tag...?
- datatable0 column tag range from to ?tag...?
- datatable0 column tag search column ?pattern?
- datatable0 column tag set column tag...
- datatable0 column tag unset column tag...}}
-
-test datatable.113 {datatable0 column tag add} {
- list [catch {datatable0 column tag add} msg] $msg
-} {1 {wrong # args: should be "datatable0 column tag add tag ?column...?"}}
-
-test datatable.114 {datatable0 column tag add newTag (no columns)} {
- list [catch {datatable0 column tag add newTag} msg] $msg
-} {0 {}}
-
-test datatable.115 {datatable0 column tag add newTag badIndex} {
- list [catch {datatable0 column tag add newTag badIndex} msg] $msg
-} {1 {unknown column specification "badIndex" in ::datatable0}}
-
-test datatable.116 {datatable0 column tag add newTag 1} {
- list [catch {datatable0 column tag add newTag 1} msg] $msg
-} {0 {}}
-
-test datatable.117 {datatable0 column tag add newTag1 1 2 3} {
- list [catch {datatable0 column tag add newTag1 1 2 3} msg] $msg
-} {0 {}}
-
-test datatable.117 {datatable0 column tag add newTag2 all} {
- list [catch {datatable0 column tag add newTag2 1} msg] $msg
-} {0 {}}
-
-test datatable.118 {datatable0 column tag search} {
- list [catch {datatable0 column tag search} msg] $msg
-} {1 {wrong # args: should be "datatable0 column tag search column ?pattern?"}}
-
-test datatable.119 {datatable0 column tag search 1} {
- list [catch {datatable0 column tag search 1} msg] [lsort $msg]
-} {0 {all newTag newTag1 newTag2}}
-
-test datatable.120 {datatable0 column tag search 1*Tag*} {
- list [catch {datatable0 column tag search 1 *Tag*} msg] [lsort $msg]
-} {0 {newTag newTag1 newTag2}}
-
-test datatable.121 {datatable0 column tag search all} {
- list [catch {datatable0 column tag search all} msg] $msg
-} {0 {newTag2 newTag newTag1 all end}}
-
-test datatable.122 {datatable0 column tag search end} {
- list [catch {datatable0 column tag search end} msg] $msg
-} {0 {all end}}
-
-test datatable.123 {datatable0 column tag search end end} {
- list [catch {datatable0 column tag search end end} msg] $msg
-} {0 end}
-
-test datatable.124 {datatable0 column tag search end e*} {
- list [catch {datatable0 column tag search end e*} msg] $msg
-} {0 end}
-
-test datatable.125 {datatable0 column tag delete} {
- list [catch {datatable0 column tag delete} msg] $msg
-} {1 {wrong # args: should be "datatable0 column tag delete tag ?column...?"}}
-
-test datatable.126 {datatable0 column tag delete badTag} {
- list [catch {datatable0 column tag delete badTag} msg] $msg
-} {0 {}}
-
-test datatable.127 {datatable0 column tag delete newTag1} {
- list [catch {datatable0 column tag delete newTag1} msg] $msg
-} {0 {}}
-
-test datatable.128 {datatable0 column tag delete newTags1 1} {
- list [catch {datatable0 column tag delete newTag1 1} msg] $msg
-} {0 {}}
-
-test datatable.129 {column tag delete newTag2 1} {
- list [catch {datatable0 column tag delete newTag2 1} msg] $msg
-} {0 {}}
-
-test datatable.130 {column tag delete badTag 1} {
- list [catch {datatable0 column tag delete badTag 1} msg] $msg
-} {1 {unknown column tag "badTag"}}
-
-test datatable.131 {column tag delete someTag 1000} {
- list [catch {datatable0 column tag delete someTag 1000} msg] $msg
-} {1 {bad column index "1000"}}
-
-test datatable.132 {column tag delete end 1} {
- list [catch {datatable0 column tag delete end 1} msg] $msg
-} {0 {}}
-
-test datatable.133 {column tag delete all 1} {
- list [catch {datatable0 column tag delete all 1} msg] $msg
-} {0 {}}
-
-test datatable.134 {column tag forget} {
- list [catch {datatable0 column tag forget} msg] $msg
-} {0 {}}
-
-test datatable.135 {column tag forget all} {
- list [catch {datatable0 column tag forget all} msg] $msg
-} {0 {}}
-
-test datatable.136 {column tag forget newTag1} {
- list [catch {datatable0 column tag forget newTag1} msg] $msg
-} {0 {}}
-
-test datatable.137 {column tag forget newTag1} {
- list [catch {datatable0 column tag forget newTag1} msg] $msg
-} {1 {unknown column tag "newTag1"}}
-
-test datatable.138 {column tag indices} {
- list [catch {datatable0 column tag indices} msg] $msg
-} {0 {}}
-
-test datatable.139 {column tag indices all} {
- list [catch {datatable0 column tag indices all} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.140 {column tag indices end} {
- list [catch {datatable0 column tag indices end} msg] $msg
-} {0 5}
-
-test datatable.141 {column tag indices newTag} {
- list [catch {datatable0 column tag indices newTag} msg] $msg
-} {0 1}
-
-test datatable.142 {column tag range 1 3 midTag} {
- list [catch {datatable0 column tag range 1 3 midTag} msg] $msg
-} {0 {}}
-
-test datatable.143 {column tag indices midTag} {
- list [catch {datatable0 column tag indices midTag} msg] $msg
-} {0 {1 2 3}}
-
-test datatable.144 {column tag range end 1 myTag} {
- list [catch {datatable0 column tag range end 1 myTag} msg] $msg
-} {0 {}}
-
-test datatable.145 {column tag indices myTag} {
- list [catch {datatable0 column tag indices myTag} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.146 {column tag range -1 1 myTag} {
- list [catch {datatable0 column tag range -1 1 myTag} msg] $msg
-} {1 {unknown column specification "-1" in ::datatable0}}
-
-test datatable.147 {column tag range 1 -1 myTag} {
- list [catch {datatable0 column tag range 1 -1 myTag} msg] $msg
-} {1 {unknown column specification "-1" in ::datatable0}}
-
-test datatable.148 {column tag range 1 1000 myTag} {
- list [catch {datatable0 column tag range 1 1000 myTag} msg] $msg
-} {1 {bad column index "1000"}}
-
-test datatable.149 {column unset} {
- list [catch {datatable0 column unset} msg] $msg
-} {1 {wrong # args: should be "datatable0 column unset column..."}}
-
-test datatable.150 {column unset 1} {
- list [catch {datatable0 column unset 1} msg] $msg
-} {0 {}}
-
-test datatable.151 {column unset 1 end} {
- list [catch {datatable0 column unset 1 end} msg] $msg
-} {0 {}}
-
-test datatable.152 {column extend 5 badArg } {
- list [catch {datatable0 column extend 5 badArg} msg] $msg
-} {1 {column label "5" can't be a number.}}
-
-test datatable.153 {column extend} {
- list [catch {datatable0 column extend} msg] $msg
-} {1 {wrong # args: should be "datatable0 column extend label ?label...?"}}
-
-test datatable.154 {column extend -1} {
- list [catch {datatable0 column extend -1} msg] $msg
-} {1 {bad count "-1": # columns can't be negative.}}
-
-if 0 {
-test datatable.155 {column extend 10000000000 } {
- list [catch {datatable0 column extend 10000000000} msg] $msg
-} {1 {can't extend table by 10000000000 columns: out of memory.}}
-}
-test datatable.156 {column extend -10 } {
- list [catch {datatable0 column extend -10} msg] $msg
-} {1 {bad count "-10": # columns can't be negative.}}
-
-test datatable.157 {column extend 10 } {
- list [catch {datatable0 column extend 10} msg] $msg
-} {0 {8 9 10 11 12 13 14 15 16 17}}
-
-test datatable.158 {column label 6 c6 7 c7 8 c8...} {
- list [catch {
- datatable0 column label \
- 6 c6 7 c7 8 c8 9 c9 10 c10 11 c11 12 c12 13 c13 14 c14 15 c15
- } msg] $msg
-} {0 {}}
-
-test datatable.159 {column names} {
- list [catch {datatable0 column names} msg] $msg
-} {0 {c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17}}
-
-test datatable.160 {column delete 10 } {
- list [catch {datatable0 column delete 10} msg] $msg
-} {0 {}}
-
-test datatable.161 {column names} {
- list [catch {datatable0 column names} msg] $msg
-} {0 {c1 c2 c3 c4 c5 c6 c7 c8 c9 c11 c12 c13 c14 c15 c16 c17}}
-
-test datatable.162 {column delete 10 } {
- list [catch {datatable0 column delete 10} msg] $msg
-} {0 {}}
-
-test datatable.163 {column names} {
- list [catch {datatable0 column names} msg] $msg
-} {0 {c1 c2 c3 c4 c5 c6 c7 c8 c9 c12 c13 c14 c15 c16 c17}}
-
-test datatable.164 {column length} {
- list [catch {datatable0 column length} msg] $msg
-} {0 15}
-
-test datatable.165 {column create} {
- list [catch {datatable0 column create} msg] $msg
-} {0 16}
-
-test datatable.166 {column names} {
- list [catch {datatable0 column names} msg] $msg
-} {0 {c1 c2 c3 c4 c5 c6 c7 c8 c9 c12 c13 c14 c15 c16 c17 c18}}
-
-test datatable.167 {column label end fred} {
- list [catch {
- datatable0 column label end fred
- datatable0 column names
- } msg] $msg
-} {0 {c1 c2 c3 c4 c5 c6 c7 c8 c9 c12 c13 c14 c15 c16 c17 fred}}
-
-test datatable.168 {column label end c18} {
- list [catch {
- datatable0 column label end c18
- datatable0 column names
- } msg] $msg
-} {0 {c1 c2 c3 c4 c5 c6 c7 c8 c9 c12 c13 c14 c15 c16 c17 c18}}
-
-test datatable.169 {column create -before 1 -badSwitch} {
- list [catch {datatable0 column create -badSwitch} msg] $msg
-} {1 {unknown switch "-badSwitch"
-following switches are available:
- -after column
- -after row
- -before column
- -before row
- -label string
- -tags tags
- -type type}}
-
-test datatable.170 {datatable0 column create -badSwitch -before 1} {
- list [catch {datatable0 column create -badSwitch} msg] $msg
-} {1 {unknown switch "-badSwitch"
-following switches are available:
- -after column
- -after row
- -before column
- -before row
- -label string
- -tags tags
- -type type}}
-
-test datatable.171 {datatable0 column create -before 1 -badSwitch arg} {
- list [catch {datatable0 column create -badSwitch arg} msg] $msg
-} {1 {unknown switch "-badSwitch"
-following switches are available:
- -after column
- -after row
- -before column
- -before row
- -label string
- -tags tags
- -type type}}
-
-test datatable.172 {datatable0 column create -before 1 -label nc1} {
- list [catch {datatable0 column create -before 1 -label nc1} msg] $msg
-} {0 1}
-
-test datatable.173 {datatable0 column create -before 2 -label nc2} {
- list [catch {datatable0 column create -before 2 -label nc2} msg] $msg
-} {0 2}
-
-test datatable.174 {datatable0 column create -after 3 -label nc3} {
- list [catch {datatable0 column create -after 3 -label nc3} msg] $msg
-} {0 4}
-
-test datatable.175 {datatable0 column length} {
- list [catch {datatable0 column length} msg] $msg
-} {0 19}
-
-test datatable.176 {datatable0 column index end} {
- list [catch {datatable0 column index end} msg] $msg
-} {0 19}
-
-test datatable.177 {datatable0 column names} {
- list [catch {datatable0 column names} msg] $msg
-} {0 {nc1 nc2 c1 nc3 c2 c3 c4 c5 c6 c7 c8 c9 c12 c13 c14 c15 c16 c17 c18}}
-
-test datatable.178 {datatable0 column create -after end} {
- list [catch {datatable0 column create -after end} msg] $msg
-} {0 20}
-
-test datatable.179 {datatable0 column create -after 1} {
- list [catch {datatable0 column create -after 1} msg] $msg
-} {0 2}
-
-test datatable.180 {datatable0 column create -label -one} {
- list [catch {datatable0 column create -label -one} msg] $msg
-} {1 {column label "-one" can't start with a '-'.}}
-
-test datatable.181 {datatable0 column create -label abc-one} {
- list [catch {datatable0 column create -label abc-one} msg] $msg
-} {0 22}
-
-test datatable.182 {datatable0 column create -label} {
- list [catch {datatable0 column create -label} msg] $msg
-} {1 {value for "-label" missing}}
-
-
-test datatable.183 {datatable0 column create -before 0} {
- list [catch {datatable0 column create -before 0} msg] $msg
-} {1 {bad column index "0"}}
-
-test datatable.184 {datatable0 column length} {
- list [catch {datatable0 column length} msg] $msg
-} {0 22}
-
-test datatable.185 {datatable0 column index fred} {
- list [catch {datatable0 column index fred} msg] $msg
-} {0 -1}
-
-test datatable.186 {datatable0 column index one} {
- list [catch {datatable0 column index one} msg] $msg
-} {0 -1}
-
-test datatable.187 {datatable0 column index end} {
- list [catch {datatable0 column index end} msg] $msg
-} {0 22}
-
-test datatable.188 {datatable0 column create -after 40} {
- list [catch {datatable0 column create -after 40} msg] $msg
-} {1 {bad column index "40"}}
-
-test datatable.189 {datatable0 column create -tags {myTag1 myTag2}} {
- list [catch {
- datatable0 column create -tags {myTag1 myTag2}
- } msg] $msg
-} {0 23}
-
-test datatable.190 {datatable0 column create -after end -tags {myTag1 myTag2}} {
- list [catch {
- datatable0 column create -after end -tags {myTag1 myTag2}
- } msg] $msg
-} {0 24}
-
-test datatable.191 {datatable0 column tag indices myTag1 myTag2} {
- list [catch {
- datatable0 column tag indices myTag1 myTag2
- } msg] $msg
-} {0 {23 24}}
-
-test datatable.192 {datatable0 column tag indices myTag1 myTag2} {
- list [catch {
- datatable0 column tag indices myTag1 myTag2
- } msg] $msg
-} {0 {23 24}}
-
-test datatable.193 {datatable0 column move} {
- list [catch {datatable0 column move} msg] $msg
-} {1 {wrong # args: should be "datatable0 column move from to ?count?"}}
-
-test datatable.194 {datatable0 column move 0} {
- list [catch {datatable0 column move 0} msg] $msg
-} {1 {wrong # args: should be "datatable0 column move from to ?count?"}}
-
-test datatable.195 {datatable0 column move 0 0} {
- list [catch {datatable0 column move 0 0} msg] $msg
-} {1 {bad column index "0"}}
-
-test datatable.196 {datatable0 column move 10 0} {
- list [catch {datatable0 column move 10 0} msg] $msg
-} {1 {bad column index "0"}}
-
-test datatable.197 {datatable0 column move all 10} {
- list [catch {datatable0 column move all 10} msg] $msg
-} {1 {multiple columns specified by "all"}}
-
-test datatable.198 {column label} {
- list [catch {
- set nCols [datatable0 column length]
- for { set i 1} { $i <= $nCols } { incr i } {
- lappend labels $i c$i
- }
- eval datatable0 column label $labels
- } msg] $msg
-} {0 {}}
-
-test datatable.199 {datatable0 column move 1 10 0} {
- list [catch {
- # This should be a no-op.
- set before [datatable0 column names]
- datatable0 column move 1 10 0
- set after [datatable0 column names]
- expr {$before == $after}
- } msg] $msg
-} {0 1}
-
-test datatable.200 {datatable0 column move 1 1} {
- list [catch {
- # This should be a no-op.
- set before [datatable0 column names]
- datatable0 column move 1 1
- set after [datatable0 column names]
- expr {$before == $after}
- } msg] $msg
-} {0 1}
-
-test datatable.201 {datatable0 column move 1 10} {
- list [catch {
- datatable0 column move 1 10
- datatable0 column names
- } msg] $msg
-} {0 {c2 c3 c4 c5 c6 c7 c8 c9 c10 c1 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24}}
-
-test datatable.202 {datatable0 column move 1 2} {
- list [catch {
- datatable0 column move 1 2
- datatable0 column names
- } msg] $msg
-} {0 {c3 c2 c4 c5 c6 c7 c8 c9 c10 c1 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24}}
-
-test datatable.203 {datatable0 column move 0 2} {
- list [catch {datatable0 column move 0 2} msg] $msg
-} {1 {bad column index "0"}}
-
-test datatable.204 {datatable0 column move 1 17} {
- list [catch {datatable0 column move 1 17} msg] $msg
-} {0 {}}
-
-test datatable.205 {find expr} {
- list [catch {
- datatable0 column tag set 4 testTag
- datatable0 find { $testTag > 3.0 }
- } msg] $msg
-} {0 {4 5}}
-
-#exit 0
-test datatable.206 {datatable0 column trace} {
- list [catch {datatable0 column trace} msg] $msg
-} {1 {wrong # args: should be "datatable0 column trace column how command"}}
-
-test datatable.207 {column trace all} {
- list [catch {datatable0 column trace all} msg] $msg
-} {1 {wrong # args: should be "datatable0 column trace column how command"}}
-
-test datatable.208 {column trace end} {
- list [catch {datatable0 column trace end} msg] $msg
-} {1 {wrong # args: should be "datatable0 column trace column how command"}}
-
-test datatable.209 {column trace 1} {
- list [catch {datatable0 column trace 1} msg] $msg
-} {1 {wrong # args: should be "datatable0 column trace column how command"}}
-
-test datatable.210 {column trace 1 rwuc} {
- list [catch {datatable0 column trace 1 rwuc} msg] $msg
-} {1 {wrong # args: should be "datatable0 column trace column how command"}}
-
-test datatable.211 {column trace all rwuc} {
- list [catch {datatable0 column trace all rwuc} msg] $msg
-} {1 {wrong # args: should be "datatable0 column trace column how command"}}
-
-proc Doit { args } {
- global mylist; lappend mylist $args
-}
-
-test datatable.212 {column trace all rwuc Doit} {
- list [catch {datatable0 column trace all rwuc Doit} msg] $msg
-} {0 trace0}
-
-test datatable.213 {trace info trace0} {
- list [catch {datatable0 trace info trace0} msg] $msg
-} {0 {id trace0 column all flags rwuc command Doit}}
-
-test datatable.214 {test create trace} {
- list [catch {
- set mylist {}
- datatable0 set all 1 20
- set mylist
- } msg] $msg
-
-} {0 {{::datatable0 1 1 wc} {::datatable0 2 1 wc} {::datatable0 3 1 wc} {::datatable0 4 1 wc} {::datatable0 5 1 wc}}}
-
-test datatable.215 {test read trace} {
- list [catch {
- set mylist {}
- datatable0 column get 1
- set mylist
- } msg] $msg
-} {0 {{::datatable0 1 1 r} {::datatable0 2 1 r} {::datatable0 3 1 r} {::datatable0 4 1 r} {::datatable0 5 1 r}}}
-
-test datatable.216 {test write trace} {
- list [catch {
- set mylist {}
- datatable0 column set 1 1 a 2 b 3 c 4 d 5 e
- set mylist
- } msg] $msg
-} {0 {{::datatable0 1 1 w} {::datatable0 2 1 w} {::datatable0 3 1 w} {::datatable0 4 1 w} {::datatable0 5 1 w}}}
-
-test datatable.217 {test unset trace} {
- list [catch {
- set mylist {}
- datatable0 column unset 1
- set mylist
- } msg] $msg
-} {0 {{::datatable0 1 1 u} {::datatable0 2 1 u} {::datatable0 3 1 u} {::datatable0 4 1 u} {::datatable0 5 1 u}}}
-
-test datatable.218 {trace delete} {
- list [catch {datatable0 trace delete} msg] $msg
-} {0 {}}
-
-if 0 {
-puts stderr [datatable0 column type all double]
-datatable0 column set 4 1 1.0 2 2.0 3 3.0 4 4.0 5 5.0
-datatable0 column set 5 1 1.0 2 2.0 3 3.0 4 4.0 5 5.0
-datatable0 column set 6 1 1.0 2 2.0 3 3.0 4 4.0 5 5.0
-puts stderr [datatable0 export csv]
-puts stderr [datatable0 export xml]
-puts stderr 1,1=[datatable0 get 1 1]
-}
-test datatable.219 {trace delete badId} {
- list [catch {datatable0 trace delete badId} msg] $msg
-} {1 {unknown trace "badId"}}
-
-test datatable.220 {trace delete trace0} {
- list [catch {datatable0 trace delete trace0} msg] $msg
-} {0 {}}
-
-test datatable.221 {export -file} {
- list [catch {datatable0 export -file} msg] $msg
-} {1 {can't export "-file": format not registered}}
-
-test datatable.222 {export csv -file} {
- list [catch {datatable0 export csv -file} msg] $msg
-} {1 {value for "-file" missing}}
-
-test datatable.223 {exportfile csv -file /badDir/badFile } {
- list [catch {datatable0 export csv -file /badDir/badFile} msg] $msg
-} {1 {couldn't open "/badDir/badFile": no such file or directory}}
-
-test datatable.224 {exportfile csv -file @badChannel } {
- list [catch {datatable0 export csv -file @badChannel} msg] $msg
-} {1 {can not find channel named "badChannel"}}
-
-test datatable.225 {export csv -file table.csv} {
- list [catch {datatable0 export csv -file table.csv} msg] $msg
-} {0 {}}
-
-test datatable.109 {column type all double} {
- list [catch {datatable0 column type all double} msg] $msg
-} {0 {double double double double double double double double double double double double double double double double double double double double double double double double}}
-
-
-test datatable.226 {export csv -rowlabels -columnlabels} {
- list [catch {datatable0 export csv -rowlabels -columnlabels} msg] $msg
-} {0 {"*BLT*","c2","c4","c5","c6","c7","c8","c9","c10","c1","c11","c12","c13","c14","c15","c16","c17","c3","c18","c19","c20","c21","c22","c23","c24"
-"r1",,,,1.0,1.0,1.0,,,,,,,,,,,,,,,,,,
-"r2",,,,2.0,2.0,2.0,,,,,,,,,,,,,,,,,,
-"r3",,,,3.0,3.0,3.0,,,,,,,,,,,,,,,,,,
-"r4",,,,4.0,4.0,4.0,,,,,,,,,,,,,,,,,,
-"r5",,,,5.0,5.0,5.0,,,,,,,,,,,,,,,,,,
-}}
-
-test datatable.109 {column type all string} {
- list [catch {datatable0 column type all string} msg] $msg
-} {0 {string string string string string string string string string string string string string string string string string string string string string string string string}}
-
-
-#----------------------
-test datatable.227 {dump -file table.dump} {
- list [catch {datatable0 dump -file table.dump} msg] $msg
-} {0 {}}
-
-test datatable.228 {datatable0 set (no args)} {
- list [catch { datatable0 set } msg] $msg
-} {1 {wrong # args: should be "datatable0 set ?row column value?..."}}
-
-test datatable.229 {datatable0 set 1 (no column)} {
- list [catch { datatable0 set 1 } msg] $msg
-} {1 {wrong # args: should be "datatable0 set ?row column value?..."}}
-
-test datatable.230 {datatable0 set 1 1 (no value)} {
- list [catch { datatable0 set 1 1 } msg] $msg
-} {1 {wrong # args: should be "datatable0 set ?row column value?..."}}
-
-test datatable.231 {datatable0 set 1 1 1.0 3.0 (too many args)} {
- list [catch { datatable0 set 1 1 1.0 3.0} msg] $msg
-} {1 {wrong # args: should be "datatable0 set ?row column value?..."}}
-
-test datatable.232 {datatable0 set 1 1 1.0} {
- list [catch { datatable0 set 1 1 1.0 } msg] $msg
-} {0 {}}
-
-test datatable.233 {datatable0 get 1 1} {
- list [catch { datatable0 get 1 1 } msg] $msg
-} {0 1.0}
-
-test datatable.234 {datatable0 row exists newRow} {
- list [catch { datatable0 row exists newRow } msg] $msg
-} {0 0}
-
-test datatable.235 {datatable0 set newRow 1 abc} {
- list [catch { datatable0 set newRow 1 abc } msg] $msg
-} {0 {}}
-
-test datatable.236 {datatable0 get newRow 1} {
- list [catch { datatable0 get newRow 1 } msg] $msg
-} {0 abc}
-
-test datatable.237 {datatable0 row exists newRow} {
- list [catch { datatable0 row exists newRow } msg] $msg
-} {0 1}
-
-test datatable.238 {datatable0 column exists newColumn} {
- list [catch { datatable0 column exists newColumn } msg] $msg
-} {0 0}
-
-test datatable.239 {datatable0 set 1 newColumn def} {
- list [catch { datatable0 set 1 newColumn def } msg] $msg
-} {0 {}}
-
-test datatable.240 {datatable0 get 1 newColumn} {
- list [catch { datatable0 get 1 newColumn } msg] $msg
-} {0 def}
-
-test datatable.241 {datatable0 row delete newRow} {
- list [catch { datatable0 row delete newRow } msg] $msg
-} {0 {}}
-
-test datatable.242 {datatable0 row exists newRow} {
- list [catch { datatable0 row exists newRow } msg] $msg
-} {0 0}
-
-test datatable.243 {datatable0 column delete newColumn} {
- list [catch { datatable0 column delete newColumn } msg] $msg
-} {0 {}}
-
-test datatable.244 {datatable0 column exists newColumn} {
- list [catch { datatable0 row exists newRow } msg] $msg
-} {0 0}
-
-test datatable.245 {datatable0 set newRow newColumn abc} {
- list [catch { datatable0 set newRow newColumn abc } msg] $msg
-} {0 {}}
-
-test datatable.246 {datatable0 row delete newRow} {
- list [catch { datatable0 row delete newRow } msg] $msg
-} {0 {}}
-
-test datatable.247 {datatable0 column delete newColumn} {
- list [catch { datatable0 column delete newColumn } msg] $msg
-} {0 {}}
-
-test datatable.248 {datatable0 column type 1 double} {
- list [catch { datatable0 column type 1 double } msg] $msg
-} {0 double}
-
-test datatable.249 {datatable0 set 1 1 1.0} {
- list [catch {
- datatable0 set 1 1 1.0
- datatable0 get 1 1
- } msg] $msg
-} {0 1.0}
-
-test datatable.249 {datatable0 set end 1 1.0 end 2 2.0 end 3 3.0 end 4 4.0 } {
- list [catch {
- datatable0 set end 1 1.0 end 2 2.0 end 3 3.0 end 4 4.0
- } msg] $msg
-} {0 {}}
-
-test datatable.249 {datatable0 set 6 1 1.0 6 } {
- list [catch {
- datatable0 set 6 1 1.0 6
- } msg] $msg
-} {1 {wrong # args: should be "datatable0 set ?row column value?..."}}
-
-test datatable.250 {datatable0 set 1 1 abc} {
- list [catch { datatable0 set 1 1 abc } msg] $msg
-} {1 {expected floating-point number but got "abc"}}
-
-test datatable.248 {datatable0 column type 1 string} {
- list [catch { datatable0 column type 1 string } msg] $msg
-} {0 string}
-
-test datatable.250 {datatable0 unset 1 1} {
- list [catch { datatable0 unset 1 1} msg] $msg
-} {0 {}}
-
-test datatable.250 {datatable0 append 1 1 abc (from empty)} {
- list [catch { datatable0 append 1 1 abc} msg] $msg
-} {0 {}}
-
-test datatable.236 {datatable0 get 1 1} {
- list [catch { datatable0 get 1 1 } msg] $msg
-} {0 abc}
-
-test datatable.250 {datatable0 append 1 1 def (from empty)} {
- list [catch { datatable0 append 1 1 def} msg] $msg
-} {0 {}}
-
-test datatable.236 {datatable0 get 1 1} {
- list [catch { datatable0 get 1 1 } msg] $msg
-} {0 abcdef}
-
-test datatable.236 {datatable0 get 1 2 defValue } {
- list [catch { datatable0 get 2 1 defValue } msg] $msg
-} {0 defValue}
-
-test datatable.236 {datatable0 get 1 2 defValue (too many args) } {
- list [catch { datatable0 get 2 1 defValue extraArg } msg] $msg
-} {1 {wrong # args: should be "datatable0 get row column ?defValue?"}}
-
-test datatable.250 {datatable0 append 1 1 123 456 789 (from empty)} {
- list [catch { datatable0 append 1 1 123 456 789 } msg] $msg
-} {0 {}}
-
-test datatable.236 {datatable0 get 1 1} {
- list [catch { datatable0 get 1 1 } msg] $msg
-} {0 abcdef123456789}
-
-test datatable.250 {datatable0 unset 1 1} {
- list [catch { datatable0 unset 1 1} msg] $msg
-} {0 {}}
-
-test datatable.250 {datatable0 unset 1 1} {
- list [catch { datatable0 unset 1 1} msg] $msg
-} {0 {}}
-
-test datatable.249 {datatable0 unset 1 1 1 } {
- list [catch { datatable0 unset 1 1 1 } msg] $msg
-} {1 {wrong # args: should be "datatable0 unset ?row column?...}}
-
-test datatable.249 {datatable0 unset end 1 end 2 end 3 end 4 } {
- list [catch { datatable0 unset end 1 end 2 end 3 end 4 } msg] $msg
-} {0 {}}
-
-test datatable.249 {datatable0 unset 0 0 } {
- list [catch { datatable0 unset 0 0 } msg] $msg
-} {0 {}}
-
-test datatable.249 {datatable0 unset 10000 10000 } {
- list [catch { datatable0 unset 10000 10000 } msg] $msg
-} {0 {}}
-
-test datatable.249 {datatable0 unset 10000 10000 } {
- list [catch { datatable0 unset 10000 10000 } msg] $msg
-} {0 {}}
-
-#---------------------
-
-test datatable.251 {blt::datatable create} {
- list [catch {blt::datatable create} msg] $msg
-} {0 ::datatable1}
-
-test datatable.252 {column extend 5} {
- list [catch {datatable1 column extend 5} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.253 {row length} {
- list [catch {datatable1 row length} msg] $msg
-} {0 0}
-
-test datatable.254 {row length} {
- list [catch {datatable1 row length} msg] $msg
-} {0 0}
-
-test datatable.255 {row length badArg} {
- list [catch {datatable1 row length badArg} msg] $msg
-} {1 {wrong # args: should be "datatable1 row length "}}
-
-test datatable.256 {row -label xyz create} {
- list [catch {datatable1 row -label xyz create} msg] $msg
-} {1 {bad operation "-label": should be one of...
- datatable1 row copy src dest ?switches...?
- datatable1 row create ?switches...?
- datatable1 row delete row...
- datatable1 row dup row...
- datatable1 row exists row
- datatable1 row extend label ?label...?
- datatable1 row get row ?switches?
- datatable1 row index row
- datatable1 row indices row ?row...?
- datatable1 row label row ?label?
- datatable1 row labels ?labelList?
- datatable1 row length
- datatable1 row move from to ?count?
- datatable1 row names ?pattern...?
- datatable1 row notify row ?flags? command
- datatable1 row set row column value...
- datatable1 row tag op args...
- datatable1 row trace row how command
- datatable1 row unique row
- datatable1 row unset row...
- datatable1 row values row ?valueList?}}
-
-test datatable.257 {row extend 5} {
- list [catch {datatable1 row extend 5} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.258 {row length} {
- list [catch {datatable1 row length} msg] $msg
-} {0 5}
-
-test datatable.259 {row index end} {
- list [catch {datatable1 row index end} msg] $msg
-} {0 5}
-
-test datatable.260 {row indices all} {
- list [catch {datatable1 row indices all} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.261 {row indices 1-end} {
- list [catch {datatable1 row indices "1-end" } msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.262 {row indices 1-all} {
- list [catch {datatable1 row indices "1-all" } msg] $msg
-} {1 {unknown row specification "1-all" in ::datatable1}}
-
-test datatable.263 {row indices 2-5} {
- list [catch {datatable1 row indices 2-5} msg] $msg
-} {0 {2 3 4 5}}
-
-test datatable.264 {row indices 5-2} {
- list [catch {datatable1 row indices 5-2} msg] $msg
-} {0 {}}
-
-test datatable.265 {row index end} {
- list [catch {datatable1 row index end} msg] $msg
-} {0 5}
-
-test datatable.266 {row index end badArg} {
- list [catch {datatable1 row index end badArg} msg] $msg
-} {1 {wrong # args: should be "datatable1 row index row"}}
-
-test datatable.267 {row label 1} {
- list [catch {datatable1 row label 1} msg] $msg
-} {0 r1}
-
-test datatable.268 {row label 1 myLabel} {
- list [catch {datatable1 row label 1 myLabel} msg] $msg
-} {0 {}}
-
-test datatable.269 {row label 1} {
- list [catch {datatable1 row label 1} msg] $msg
-} {0 myLabel}
-
-test datatable.270 {row label 2 myLabel} {
- list [catch {datatable1 row label 2 myLabel} msg] $msg
-} {0 {}}
-
-test datatable.271 {row label 1} {
- list [catch {datatable1 row label 1} msg] $msg
-} {0 myLabel}
-
-test datatable.272 {row label end end} {
- list [catch {datatable1 row label end end} msg] $msg
-} {0 {}}
-
-test datatable.273 {row label end endLabel} {
- list [catch {datatable1 row label end endLabel} msg] $msg
-} {0 {}}
-
-test datatable.274 {row label end 1abc} {
- list [catch {datatable1 row label end 1abc} msg] $msg
-} {0 {}}
-
-test datatable.275 {row label end label-with-minus} {
- list [catch {datatable1 row label end label-with-minus} msg] $msg
-} {0 {}}
-
-test datatable.276 {row label end -abc} {
- list [catch {datatable1 row label end -abc} msg] $msg
-} {1 {row label "-abc" can't start with a '-'.}}
-
-test datatable.277 {row names *Label} {
- list [catch {datatable1 row names *Label} msg] $msg
-} {0 {myLabel myLabel}}
-
-test datatable.278 {row names} {
- list [catch {datatable1 row names} msg] $msg
-} {0 {myLabel myLabel r3 r4 label-with-minus}}
-
-test datatable.279 {row names r*} {
- list [catch {datatable1 row names r*} msg] $msg
-} {0 {r3 r4}}
-
-test datatable.280 {row names *-with-*} {
- list [catch {datatable1 row names *-with-*} msg] $msg
-} {0 label-with-minus}
-
-test datatable.281 {datatable1 row names badPattern} {
- list [catch {datatable1 row names badPattern} msg] $msg
-} {0 {}}
-
-test datatable.282 {datatable1 row get myLabel} {
- list [catch {datatable1 row get myLabel} msg] $msg
-} {0 {1 {} 2 {} 3 {} 4 {} 5 {}}}
-
-test datatable.283 {datatable1 row get} {
- list [catch {datatable1 row get} msg] $msg
-} {1 {wrong # args: should be "datatable1 row get row ?switches?"}}
-
-test datatable.284 {datatable1 row set myLabel} {
- list [catch {datatable1 row set myLabel} msg] $msg
-} {1 {wrong # args: should be "datatable1 row set row column value..."}}
-
-test datatable.285 {row set all 1 1.0 2 2.0 3 3.0 4 4.0 5 5.0} {
- list [catch {
- datatable1 row set all 1 1.0 2 2.0 3 3.0 4 4.0 5 5.0
- } msg] $msg
-} {0 {}}
-
-test datatable.286 {datatable1 row values 1} {
- list [catch {datatable1 row values 1} msg] $msg
-} {0 {1.0 2.0 3.0 4.0 5.0}}
-
-test datatable.287 {datatable1 row values all} {
- list [catch {datatable1 row values all} msg] $msg
-} {1 {multiple rows specified by "all"}}
-
-test datatable.288 {datatable1 row values 1-2} {
- list [catch {datatable1 row values 1-2} msg] $msg
-} {1 {multiple rows specified by "1-2"}}
-
-test datatable.289 {datatable1 row values 2} {
- list [catch {datatable1 row values 2} msg] $msg
-} {0 {1.0 2.0 3.0 4.0 5.0}}
-
-test datatable.290 {datatable1 row values 3} {
- list [catch {datatable1 row values 3} msg] $msg
-} {0 {1.0 2.0 3.0 4.0 5.0}}
-
-test datatable.291 {datatable1 row values end} {
- list [catch {datatable1 row values end} msg] $msg
-} {0 {1.0 2.0 3.0 4.0 5.0}}
-
-test datatable.292 {datatable1 row values 1 { a b c }} {
- list [catch {datatable1 row values 1 { a b c }} msg] $msg
-} {0 {}}
-
-test datatable.293 {datatable1 row values 1} {
- list [catch {datatable1 row values 1} msg] $msg
-} {0 {a b c 4.0 5.0}}
-
-test datatable.294 {datatable1 row values end { x y }} {
- list [catch {datatable1 row values end { x y }} msg] $msg
-} {0 {}}
-
-test datatable.295 {datatable1 row values end} {
- list [catch {datatable1 row values end} msg] $msg
-} {0 {x y 3.0 4.0 5.0}}
-
-test datatable.296 {datatable1 row index label-with-minus} {
- list [catch {datatable1 row index label-with-minus} msg] $msg
-} {0 5}
-
-test datatable.297 {datatable1 row indices all} {
- list [catch {datatable1 row indices all} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.298 {datatable1 row index -1} {
- list [catch {datatable1 row index -1} msg] $msg
-} {0 -1}
-
-test datatable.299 {datatable1 row index 1000} {
- list [catch {datatable1 row index 1000} msg] $msg
-} {0 -1}
-
-test datatable.300 {datatable1 row tag badOp} {
- list [catch {datatable1 row tag badOp} msg] $msg
-} {1 {bad tag operation "badOp": should be one of...
- datatable1 row tag add tag ?row...?
- datatable1 row tag delete tag ?row...?
- datatable1 row tag exists tag ?row?
- datatable1 row tag forget ?tag...?
- datatable1 row tag get row ?pattern...?
- datatable1 row tag indices ?tag...?
- datatable1 row tag labels ?tag...?
- datatable1 row tag range from to ?tag...?
- datatable1 row tag search row ?pattern?
- datatable1 row tag set row tag...
- datatable1 row tag unset row tag...}}
-
-test datatable.301 {datatable1 row tag (missing args)} {
- list [catch {datatable1 row tag} msg] $msg
-} {1 {wrong # args: should be one of...
- datatable1 row tag add tag ?row...?
- datatable1 row tag delete tag ?row...?
- datatable1 row tag exists tag ?row?
- datatable1 row tag forget ?tag...?
- datatable1 row tag get row ?pattern...?
- datatable1 row tag indices ?tag...?
- datatable1 row tag labels ?tag...?
- datatable1 row tag range from to ?tag...?
- datatable1 row tag search row ?pattern?
- datatable1 row tag set row tag...
- datatable1 row tag unset row tag...}}
-
-test datatable.302 {datatable1 row tag badOp} {
- list [catch {datatable1 row tag badOp} msg] $msg
-} {1 {bad tag operation "badOp": should be one of...
- datatable1 row tag add tag ?row...?
- datatable1 row tag delete tag ?row...?
- datatable1 row tag exists tag ?row?
- datatable1 row tag forget ?tag...?
- datatable1 row tag get row ?pattern...?
- datatable1 row tag indices ?tag...?
- datatable1 row tag labels ?tag...?
- datatable1 row tag range from to ?tag...?
- datatable1 row tag search row ?pattern?
- datatable1 row tag set row tag...
- datatable1 row tag unset row tag...}}
-
-test datatable.303 {datatable1 row tag add} {
- list [catch {datatable1 row tag add} msg] $msg
-} {1 {wrong # args: should be "datatable1 row tag add tag ?row...?"}}
-
-test datatable.304 {datatable1 row tag add 1} {
- list [catch {datatable1 row tag add 1} msg] $msg
-} {1 {tag "1" can't be a number.}}
-
-test datatable.305 {datatable1 row tag add tag badIndex} {
- list [catch {datatable1 row tag add tag badIndex} msg] $msg
-} {1 {unknown row specification "badIndex" in ::datatable1}}
-
-test datatable.306 {datatable1 row tag add newTag 1} {
- list [catch {datatable1 row tag add newTag 1} msg] $msg
-} {0 {}}
-
-test datatable.307 {datatable1 row tag add newTag1 1} {
- list [catch {datatable1 row tag add newTag1 1} msg] $msg
-} {0 {}}
-
-test datatable.307 {datatable1 row tag add newTag2 1} {
- list [catch {datatable1 row tag add newTag2 1} msg] $msg
-} {0 {}}
-
-test datatable.308 {datatable1 row tag search} {
- list [catch {datatable1 row tag search} msg] $msg
-} {1 {wrong # args: should be "datatable1 row tag search row ?pattern?"}}
-
-test datatable.309 {datatable1 row tag search 1} {
- list [catch {datatable1 row tag search 1} msg] [lsort $msg]
-} {0 {all newTag newTag1 newTag2}}
-
-test datatable.310 {datatable1 row tag search 1*Tag*} {
- list [catch {datatable1 row tag search 1 *Tag*} msg] [lsort $msg]
-} {0 {newTag newTag1 newTag2}}
-
-test datatable.311 {datatable1 row tag search all} {
- list [catch {datatable1 row tag search all} msg] $msg
-} {0 {newTag2 newTag newTag1 all end}}
-
-test datatable.312 {datatable1 row tag search end} {
- list [catch {datatable1 row tag search end} msg] $msg
-} {0 {all end}}
-
-test datatable.313 {datatable1 row tag search end end} {
- list [catch {datatable1 row tag search end end} msg] $msg
-} {0 end}
-
-test datatable.314 {datatable1 row tag search end e*} {
- list [catch {datatable1 row tag search end e*} msg] $msg
-} {0 end}
-
-test datatable.315 {datatable1 row tag delete} {
- list [catch {datatable1 row tag delete} msg] $msg
-} {1 {wrong # args: should be "datatable1 row tag delete tag ?row...?"}}
-
-test datatable.316 {datatable1 row tag delete someTag} {
- list [catch {datatable1 row tag delete someTag} msg] $msg
-} {0 {}}
-
-test datatable.317 {datatable1 row tag delete newTag1 1} {
- list [catch {datatable1 row tag delete newTag1 1} msg] $msg
-} {0 {}}
-
-test datatable.318 {datatable1 row tag delete newTag1 1} {
- list [catch {datatable1 row tag delete newTag1 1} msg] $msg
-} {0 {}}
-
-test datatable.319 {datatable1 row tag delete newTag2 1} {
- list [catch {datatable1 row tag delete newTag2 1} msg] $msg
-} {0 {}}
-
-test datatable.320 {datatable1 row tag delete badTag 1} {
- list [catch {datatable1 row tag delete badTag 1} msg] $msg
-} {1 {unknown row tag "badTag"}}
-
-test datatable.321 {datatable1 row tag delete someTag 1000} {
- list [catch {datatable1 row tag delete someTag 1000} msg] $msg
-} {1 {bad row index "1000"}}
-
-test datatable.322 {datatable1 row tag delete end 1} {
- list [catch {datatable1 row tag delete end 1} msg] $msg
-} {0 {}}
-
-test datatable.323 {datatable1 row tag delete all 1} {
- list [catch {datatable1 row tag delete all 1} msg] $msg
-} {0 {}}
-
-test datatable.324 {datatable1 row tag forget} {
- list [catch {datatable1 row tag forget} msg] $msg
-} {0 {}}
-
-test datatable.325 {row tag forget all} {
- list [catch {datatable1 row tag forget all} msg] $msg
-} {0 {}}
-
-test datatable.326 {row tag forget newTag1} {
- list [catch {datatable1 row tag forget newTag1} msg] $msg
-} {0 {}}
-
-test datatable.327 {row tag forget newTag1} {
- list [catch {datatable1 row tag forget newTag1} msg] $msg
-} {1 {unknown row tag "newTag1"}}
-
-test datatable.328 {row tag indices} {
- list [catch {datatable1 row tag indices} msg] $msg
-} {0 {}}
-
-test datatable.329 {row tag indices all} {
- list [catch {datatable1 row tag indices all} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.330 {row tag indices end} {
- list [catch {datatable1 row tag indices end} msg] $msg
-} {0 5}
-
-test datatable.331 {row tag indices newTag} {
- list [catch {datatable1 row tag indices newTag} msg] $msg
-} {0 1}
-
-test datatable.332 {row tag range 1 3 midTag} {
- list [catch {datatable1 row tag range 1 3 midTag} msg] $msg
-} {0 {}}
-
-test datatable.333 {row tag indices midTag} {
- list [catch {datatable1 row tag indices midTag} msg] $msg
-} {0 {1 2 3}}
-
-test datatable.334 {row tag range end 1 myTag} {
- list [catch {datatable1 row tag range end 1 myTag} msg] $msg
-} {0 {}}
-
-test datatable.335 {row tag indices myTag} {
- list [catch {datatable1 row tag indices myTag} msg] $msg
-} {0 {1 2 3 4 5}}
-
-test datatable.336 {row tag range -1 1 myTag} {
- list [catch {datatable1 row tag range -1 1 myTag} msg] $msg
-} {1 {unknown row specification "-1" in ::datatable1}}
-
-test datatable.337 {row tag range 1 -1 myTag} {
- list [catch {datatable1 row tag range 1 -1 myTag} msg] $msg
-} {1 {unknown row specification "-1" in ::datatable1}}
-
-test datatable.338 {row tag range 1 1000 myTag} {
- list [catch {datatable1 row tag range 1 1000 myTag} msg] $msg
-} {1 {bad row index "1000"}}
-
-test datatable.339 {row unset} {
- list [catch {datatable1 row unset} msg] $msg
-} {1 {wrong # args: should be "datatable1 row unset row..."}}
-
-test datatable.340 {row unset 1} {
- list [catch {datatable1 row unset 1} msg] $msg
-} {0 {}}
-
-test datatable.341 {dump} {
- list [catch {datatable1 dump} msg] $msg
-} {0 {i 5 5 0 0
-c 1 c1 string {}
-c 2 c2 string {}
-c 3 c3 string {}
-c 4 c4 string {}
-c 5 c5 string {}
-r 1 myLabel {myTag midTag newTag}
-r 2 myLabel {myTag midTag}
-r 3 r3 {myTag midTag}
-r 4 r4 {myTag}
-r 5 label-with-minus {myTag}
-d 2 1 1.0
-d 3 1 1.0
-d 4 1 1.0
-d 5 1 x
-d 2 2 2.0
-d 3 2 2.0
-d 4 2 2.0
-d 5 2 y
-d 2 3 3.0
-d 3 3 3.0
-d 4 3 3.0
-d 5 3 3.0
-d 2 4 4.0
-d 3 4 4.0
-d 4 4 4.0
-d 5 4 4.0
-d 2 5 5.0
-d 3 5 5.0
-d 4 5 5.0
-d 5 5 5.0
-}}
-
-test datatable.342 {datatable1 row get 1 defValue} {
- list [catch {
- datatable1 emptyvalue defValue
- set out [datatable1 row get 1]
- datatable1 emptyvalue ""
- eval list $out
- } msg] $msg
-} {0 {1 defValue 2 defValue 3 defValue 4 defValue 5 defValue}}
-
-test datatable.343 {datatable1 row unset 1 end} {
- list [catch {datatable1 row unset 1 end} msg] $msg
-} {0 {}}
-
-test datatable.344 {datatable1 row extend 5 badArg } {
- list [catch {datatable1 row extend 5 badArg} msg] $msg
-} {1 {row label "5" can't be a number.}}
-
-test datatable.345 {datatable1 row extend} {
- list [catch {datatable1 row extend} msg] $msg
-} {1 {wrong # args: should be "datatable1 row extend label ?label...?"}}
-
-test datatable.346 {datatable1 row extend myRow} {
- list [catch {datatable1 row extend myRow} msg] $msg
-} {0 8}
-
-if 0 {
-test datatable.347 {datatable1 row extend 10000000000 } {
- list [catch {datatable1 row extend 10000000000} msg] $msg
-} {1 {can't extend table by 10000000000 rows: out of memory.}}
-}
-
-test datatable.348 {datatable1 row extend -10 } {
- list [catch {datatable1 row extend -10} msg] $msg
-} {1 {bad count "-10": # rows can't be negative.}}
-
-test datatable.349 {datatable1 row extend 10 } {
- list [catch {datatable1 row extend 10} msg] $msg
-} {0 {9 10 11 12 13 14 15 16 17 18}}
-
-test datatable.350 {datatable1 row names} {
- list [catch {datatable1 row names} msg] $msg
-} {0 {myLabel myLabel r3 r4 label-with-minus r6 r7 myRow r9 r10 r11 r12 r13 r14 r15 r16 r17 r18}}
-
-test datatable.351 {datatable1 row delete 10 } {
- list [catch {datatable1 row delete 10} msg] $msg
-} {0 {}}
-
-test datatable.352 {datatable1 row names} {
- list [catch {datatable1 row names} msg] $msg
-} {0 {myLabel myLabel r3 r4 label-with-minus r6 r7 myRow r9 r11 r12 r13 r14 r15 r16 r17 r18}}
-
-test datatable.353 {datatable1 row delete 10 } {
- list [catch {datatable1 row delete 10} msg] $msg
-} {0 {}}
-
-test datatable.354 {datatable1 row length} {
- list [catch {datatable1 row length} msg] $msg
-} {0 16}
-
-test datatable.355 {datatable1 row create} {
- list [catch {datatable1 row create} msg] $msg
-} {0 17}
-
-test datatable.356 {datatable1 row create -before 1 -badSwitch} {
- list [catch {datatable1 row create -badSwitch} msg] $msg
-} {1 {unknown switch "-badSwitch"
-following switches are available:
- -after column
- -after row
- -before column
- -before row
- -label string
- -tags tags
- -type type}}
-
-test datatable.357 {datatable1 row create -badSwitch -before 1} {
- list [catch {datatable1 row create -badSwitch} msg] $msg
-} {1 {unknown switch "-badSwitch"
-following switches are available:
- -after column
- -after row
- -before column
- -before row
- -label string
- -tags tags
- -type type}}
-
-test datatable.358 {datatable1 row create -before 1 -badSwitch arg} {
- list [catch {datatable1 row create -badSwitch arg} msg] $msg
-} {1 {unknown switch "-badSwitch"
-following switches are available:
- -after column
- -after row
- -before column
- -before row
- -label string
- -tags tags
- -type type}}
-
-
-test datatable.359 {datatable1 row create -before 1 -label one} {
- list [catch {datatable1 row create -before 1 -label one} msg] $msg
-} {0 1}
-
-test datatable.360 {datatable1 row create -before 2 -label two} {
- list [catch {datatable1 row create -before 2 -label two} msg] $msg
-} {0 2}
-
-test datatable.361 {datatable1 row create -after 3 -label three} {
- list [catch {datatable1 row create -after 3 -label three} msg] $msg
-} {0 4}
-
-test datatable.362 {datatable1 row length} {
- list [catch {datatable1 row length} msg] $msg
-} {0 20}
-
-test datatable.363 {datatable1 row names} {
- list [catch {datatable1 row names} msg] $msg
-} {0 {one two myLabel three myLabel r3 r4 label-with-minus r6 r7 myRow r9 r12 r13 r14 r15 r16 r17 r18 r19}}
-
-test datatable.364 {datatable1 row index end} {
- list [catch {datatable1 row index end} msg] $msg
-} {0 20}
-
-test datatable.365 {datatable1 row names} {
- list [catch {datatable1 row names} msg] $msg
-} {0 {one two myLabel three myLabel r3 r4 label-with-minus r6 r7 myRow r9 r12 r13 r14 r15 r16 r17 r18 r19}}
-
-test datatable.366 {datatable1 row create -after end} {
- list [catch {datatable1 row create -after end} msg] $msg
-} {0 21}
-
-test datatable.367 {datatable1 row create -after 1} {
- list [catch {datatable1 row create -after 1} msg] $msg
-} {0 2}
-
-test datatable.368 {datatable1 row create -label one} {
- list [catch {datatable1 row create -label one} msg] $msg
-} {0 23}
-
-test datatable.369 {datatable1 row create -label} {
- list [catch {datatable1 row create -label} msg] $msg
-} {1 {value for "-label" missing}}
-
-test datatable.370 {datatable1 row create -before 0} {
- list [catch {datatable1 row create -before 0} msg] $msg
-} {1 {bad row index "0"}}
-
-test datatable.371 {datatable1 row length} {
- list [catch {datatable1 row length} msg] $msg
-} {0 23}
-
-test datatable.372 {datatable1 row index fred} {
- list [catch {datatable1 row index fred} msg] $msg
-} {0 -1}
-
-test datatable.373 {datatable1 row index one} {
- list [catch {datatable1 row index one} msg] $msg
-} {0 23}
-
-test datatable.374 {datatable1 row index end} {
- list [catch {datatable1 row index end} msg] $msg
-} {0 23}
-
-test datatable.375 {datatable1 row create -after 40} {
- list [catch {datatable1 row create -after 40} msg] $msg
-} {1 {bad row index "40"}}
-
-test datatable.376 {datatable1 row create -tags {myTag1 myTag2}} {
- list [catch {
- datatable1 row create -tags {myTag1 myTag2}
- } msg] $msg
-} {0 24}
-
-test datatable.377 {datatable1 row create -after end -tags {myTag1 myTag2}} {
- list [catch {
- datatable1 row create -after end -tags {myTag1 myTag2}
- } msg] $msg
-} {0 25}
-
-test datatable.378 {datatable1 row tag indices myTag1 myTag2} {
- list [catch {
- datatable1 row tag indices myTag1 myTag2
- } msg] $msg
-} {0 {24 25}}
-
-test datatable.379 {datatable1 row tag indices myTag1 myTag2} {
- list [catch {
- datatable1 row tag indices myTag1 myTag2
- } msg] $msg
-} {0 {24 25}}
-
-test datatable.380 {datatable1 row move} {
- list [catch {datatable1 row move} msg] $msg
-} {1 {wrong # args: should be "datatable1 row move from to ?count?"}}
-
-test datatable.381 {datatable1 row move 0} {
- list [catch {datatable1 row move 0} msg] $msg
-} {1 {wrong # args: should be "datatable1 row move from to ?count?"}}
-
-test datatable.382 {datatable1 row move 0 0} {
- list [catch {datatable1 row move 0 0} msg] $msg
-} {1 {bad row index "0"}}
-
-test datatable.383 {datatable1 row move 10 0} {
- list [catch {datatable1 row move 10 0} msg] $msg
-} {1 {bad row index "0"}}
-
-test datatable.384 {datatable1 row move all 10} {
- list [catch {datatable1 row move all 10} msg] $msg
-} {1 {multiple rows specified by "all"}}
-
-test datatable.385 {datatable1 row move 1 10 0} {
- list [catch {
- datatable1 row move 1 10 0
- datatable1 row names
- } msg] $msg
-} {0 {one r24 two myLabel three myLabel r3 r4 label-with-minus r6 r7 end r9 r12 r13 r14 r15 r16 r17 r18 r19 r23 one r26 r27}}
-
-test datatable.386 {datatable1 row move 1 1} {
- list [catch {
- datatable1 row move 1 1
- datatable1 row names
- } msg] $msg
-} {0 {one r24 two myLabel three myLabel r3 r4 label-with-minus r6 r7 end r9 r12 r13 r14 r15 r16 r17 r18 r19 r23 one r26 r27}}
-
-test datatable.387 {datatable1 row move 1 10} {
- list [catch {
- datatable1 row move 1 10
- datatable1 row names
- } msg] $msg
-} {0 {r24 two myLabel three myLabel r3 r4 label-with-minus r6 one r7 end r9 r12 r13 r14 r15 r16 r17 r18 r19 r23 one r26 r27}}
-
-test datatable.388 {datatable1 row move 1 2} {
- list [catch {
- datatable1 row move 1 2
- datatable1 row names
- } msg] $msg
-} {0 {two r24 myLabel three myLabel r3 r4 label-with-minus r6 one r7 end r9 r12 r13 r14 r15 r16 r17 r18 r19 r23 one r26 r27}}
-
-test datatable.389 {export csv} {
- list [catch {datatable1 export csv} msg] $msg
-} {0 {"*BLT*","c1","c2","c3","c4","c5"
-"two",,,,,
-"r24",,,,,
-"myLabel",,,,,
-"three",,,,,
-"myLabel","1.0","2.0","3.0","4.0","5.0"
-"r3","1.0","2.0","3.0","4.0","5.0"
-"r4","1.0","2.0","3.0","4.0","5.0"
-"label-with-minus",,,,,
-"r6",,,,,
-"one",,,,,
-"r7",,,,,
-"end",,,,,
-"r9",,,,,
-"r12",,,,,
-"r13",,,,,
-"r14",,,,,
-"r15",,,,,
-"r16",,,,,
-"r17",,,,,
-"r18",,,,,
-"r19",,,,,
-"r23",,,,,
-"one",,,,,
-"r26",,,,,
-"r27",,,,,
-}}
-
-test datatable.390 {datatable1 row move 0 2} {
- list [catch {datatable1 row move 0 2} msg] $msg
-} {1 {bad row index "0"}}
-
-test datatable.391 {datatable1 row move 1 17} {
- list [catch {datatable1 row move 1 17} msg] $msg
-} {0 {}}
-
-#exit 0
-test datatable.392 {datatable1 row trace} {
- list [catch {datatable1 row trace} msg] $msg
-} {1 {wrong # args: should be "datatable1 row trace row how command"}}
-
-test datatable.393 {datatable1 row trace all} {
- list [catch {datatable1 row trace all} msg] $msg
-} {1 {wrong # args: should be "datatable1 row trace row how command"}}
-
-test datatable.394 {datatable1 row trace end} {
- list [catch {datatable1 row trace end} msg] $msg
-} {1 {wrong # args: should be "datatable1 row trace row how command"}}
-
-test datatable.395 {datatable1 row trace 1} {
- list [catch {datatable1 row trace 1} msg] $msg
-} {1 {wrong # args: should be "datatable1 row trace row how command"}}
-
-test datatable.396 {datatable1 row trace 1 rwuc} {
- list [catch {datatable1 row trace 1 rwuc} msg] $msg
-} {1 {wrong # args: should be "datatable1 row trace row how command"}}
-
-test datatable.397 {datatable1 row trace all rwuc} {
- list [catch {datatable1 row trace all rwuc} msg] $msg
-} {1 {wrong # args: should be "datatable1 row trace row how command"}}
-
-proc Doit { args } {
- global mylist; lappend mylist $args
-}
-
-test datatable.398 {datatable1 row trace all rwuc Doit} {
- list [catch {datatable1 row trace all rwuc Doit} msg] $msg
-} {0 trace0}
-
-test datatable.399 {datatable1 trace info trace0} {
- list [catch {datatable1 trace info trace0} msg] $msg
-} {0 {id trace0 row all flags rwuc command Doit}}
-
-test datatable.400 {test create trace} {
- list [catch {
- set mylist {}
- datatable1 set all 1 20
- set mylist
- } msg] $msg
-} {0 {{::datatable1 1 1 wc} {::datatable1 2 1 wc} {::datatable1 3 1 wc} {::datatable1 4 1 w} {::datatable1 5 1 w} {::datatable1 6 1 w} {::datatable1 7 1 wc} {::datatable1 8 1 wc} {::datatable1 9 1 wc} {::datatable1 10 1 wc} {::datatable1 11 1 wc} {::datatable1 12 1 wc} {::datatable1 13 1 wc} {::datatable1 14 1 wc} {::datatable1 15 1 wc} {::datatable1 16 1 wc} {::datatable1 17 1 wc} {::datatable1 18 1 wc} {::datatable1 19 1 wc} {::datatable1 20 1 wc} {::datatable1 21 1 wc} {::datatable1 2 [...]
-
-test datatable.401 {test read trace} {
- list [catch {
- set mylist {}
- datatable1 row get 1 -valuesonly
- set mylist
- } msg] $msg
-} {0 {{::datatable1 1 1 r} {::datatable1 1 2 r} {::datatable1 1 3 r} {::datatable1 1 4 r} {::datatable1 1 5 r}}}
-
-test datatable.402 {test write trace} {
- list [catch {
- set mylist {}
- datatable1 row values 1 {a b c d e}
- set mylist
- } msg] $msg
-} {0 {{::datatable1 1 1 w} {::datatable1 1 2 wc} {::datatable1 1 3 wc} {::datatable1 1 4 wc} {::datatable1 1 5 wc}}}
-
-test datatable.403 {test unset trace} {
- list [catch {
- set mylist {}
- datatable1 row unset 1
- set mylist
- } msg] $msg
-} {0 {{::datatable1 1 1 u} {::datatable1 1 2 u} {::datatable1 1 3 u} {::datatable1 1 4 u} {::datatable1 1 5 u}}}
-
-test datatable.404 {datatable1 trace delete} {
- list [catch {datatable1 trace delete} msg] $msg
-} {0 {}}
-
-#---------------------
-
-test datatable.405 {datatable1 trace} {
- list [catch {datatable1 trace} msg] $msg
-} {1 {wrong # args: should be one of...
- datatable1 trace create row column how command
- datatable1 trace delete traceId...
- datatable1 trace info traceId
- datatable1 trace names }}
-
-test datatable.406 {datatable1 trace create} {
- list [catch {datatable1 trace create} msg] $msg
-} {1 {wrong # args: should be "datatable1 trace create row column how command"}}
-
-test datatable.407 {datatable1 trace create 1} {
- list [catch {datatable1 trace create 1} msg] $msg
-} {1 {wrong # args: should be "datatable1 trace create row column how command"}}
-
-test datatable.408 {datatable1 trace create 1 1 } {
- list [catch {datatable1 trace create 1 1 } msg] $msg
-} {1 {wrong # args: should be "datatable1 trace create row column how command"}}
-
-test datatable.409 {datatable1 trace create 1 1 rwuc} {
- list [catch {datatable1 trace create 1 1 rwuc} msg] $msg
-} {1 {wrong # args: should be "datatable1 trace create row column how command"}}
-
-proc Doit args { global mylist; lappend mylist $args }
-
-test datatable.410 {datatable1 trace names} {
- list [catch {datatable1 trace names} msg] $msg
-} {0 trace0}
-
-test datatable.411 {datatable1 trace create 1 1 rwuc Doit} {
- list [catch {datatable1 trace create 1 1 rwuc Doit} msg] $msg
-} {0 trace1}
-
-test datatable.412 {datatable1 trace names} {
- list [catch {datatable1 trace names} msg] $msg
-} {0 {trace1 trace0}}
-
-test datatable.413 {datatable1 trace info trace1} {
- list [catch {datatable1 trace info trace1} msg] $msg
-} {0 {id trace1 row 1 column 1 flags rwuc command Doit}}
-
-test datatable.414 {test create trace} {
- list [catch {
- set mylist {}
- datatable1 set 1 1 "newValue"
- set mylist
- } msg] $msg
-} {0 {{::datatable1 1 1 wc} {::datatable1 1 1 wc}}}
-
-test datatable.415 {test read trace} {
- list [catch {
- set mylist {}
- datatable1 get 1 1
- set mylist
- } msg] $msg
-} {0 {{::datatable1 1 1 r} {::datatable1 1 1 r}}}
-
-test datatable.416 {test write trace} {
- list [catch {
- set mylist {}
- datatable1 column values 1 { a b c e d }
- set mylist
- } msg] $msg
-} {0 {{::datatable1 1 1 w} {::datatable1 1 1 w} {::datatable1 2 1 w} {::datatable1 3 1 w} {::datatable1 4 1 w} {::datatable1 5 1 w}}}
-
-test datatable.417 {trace delete trace0} {
- list [catch {datatable1 trace delete trace0} msg] $msg
-} {0 {}}
-
-test datatable.418 {test write trace} {
- list [catch {
- set mylist {}
- datatable1 row values 1 { a b c e d }
- set mylist
- } msg] $msg
-} {0 {{::datatable1 1 1 w}}}
-
-test datatable.419 {test write trace} {
- list [catch {
- set mylist {}
- datatable1 set 1 1 "nextValue"
- set mylist
- } msg] $msg
-} {0 {{::datatable1 1 1 w}}}
-
-test datatable.420 {test unset trace} {
- list [catch {
- set mylist {}
- datatable1 unset 1 1
- set mylist
- } msg] $msg
-} {0 {{::datatable1 1 1 u}}}
-
-test datatable.421 {datatable1 trace delete} {
- list [catch {datatable1 trace delete} msg] $msg
-} {0 {}}
-
-test datatable.422 {datatable1 trace delete badId} {
- list [catch {datatable1 trace delete badId} msg] $msg
-} {1 {unknown trace "badId"}}
-
-test datatable.423 {datatable1 trace names} {
- list [catch {datatable1 trace names} msg] $msg
-} {0 trace1}
-
-test datatable.424 {datatable1 trace names badArg} {
- list [catch {datatable1 trace names badArg} msg] $msg
-} {1 {wrong # args: should be "datatable1 trace names "}}
-
-test datatable.425 {datatable1 trace delete trace1} {
- list [catch {datatable1 trace delete trace1} msg] $msg
-} {0 {}}
-
-test datatable.426 {test create trace} {
- list [catch {
- set mylist {}
- datatable0 set all newKey 20
- set mylist
- } msg] $msg
-} {0 {}}
-
-test datatable.427 {test unset trace} {
- list [catch {
- set mylist {}
- datatable0 unset all newKey
- set mylist
- } msg] $msg
-} {0 {}}
-
-test datatable.428 {datatable0 dump -badSwitch} {
- list [catch {datatable0 dump -badSwitch} msg] $msg
-} {1 {unknown switch "-badSwitch"}}
-
-
-test datatable.429 {datatable0 dump -rows 1} {
- list [catch {datatable0 dump -rows 1} msg] $msg
-} {0 {i 1 22 0 0
-c 1 one string
-c 2 c14 string
-c 3 two string
-c 4 myLabel image {myTag midTag newTag}
-c 5 three string
-c 6 c2 image {myTag midTag}
-c 7 c3 image {myTag midTag}
-c 8 c4 image myTag
-c 9 endLabel image myTag
-c 10 c1 string
-c 11 c5 string
-c 12 c6 string
-c 13 c7 string
-c 14 c10 string
-c 15 c11 string
-c 16 c12 string
-c 17 c13 string
-c 18 c8 string
-c 19 c9 string
-c 20 c15 string
-c 21 c16 string {myTag2 myTag1}
-c 22 c17 string {myTag2 myTag1}
-r 1 r1
-d 1 6 1.0
-d 1 7 1.0
-d 1 8 1.0
-}}
-
-
-test datatable.430 {datatable0 dump -columns 1} {
- list [catch {datatable0 dump -columns 1} msg] $msg
-} {0 {i 5 1 0 0
-c 1 one string
-r 1 r1
-r 2 r2
-r 3 r3
-r 4 r4
-r 5 r5
-}}
-
-test datatable.431 {dump -rows badTag} {
- list [catch {datatable0 dump -rows badTag} msg] $msg
-} {1 {can't find row tag "badTag" in ::datatable0}}
-
-test datatable.432 {dump -columns badTag} {
- list [catch {datatable0 dump -columns badTag} msg] $msg
-} {1 {can't find column tag "badTag" in ::datatable0}}
-
-test datatable.433 {dump -rows 1 -columns 1} {
- list [catch {datatable0 dump -rows 1 -columns 1} msg] $msg
-} {0 {i 1 1 0 0
-c 1 one string
-r 1 r1
-}}
-
-test datatable.434 {dump -file myout.dump} {
- list [catch {datatable0 dump -file myout.dump} msg] $msg
-} {0 {}}
-
-test datatable.435 {blt::datatable destroy datatable0} {
- list [catch {blt::datatable destroy datatable0} msg] $msg
-} {0 {}}
-
-test datatable.436 {blt::datatable create} {
- list [catch {blt::datatable create} msg] $msg
-} {0 ::datatable0}
-
-test datatable.437 {datatable0 column names} {
- list [catch {datatable0 column names} msg] $msg
-} {0 {}}
-
-test datatable.438 {datatable0 dump} {
- list [catch {datatable0 dump} msg] $msg
-} {0 {i 0 0 0 0
-}}
-
-test datatable.439 {datatable0 restore} {
- list [catch {datatable0 restore} msg] $msg
-} {0 {}}
-
-test datatable.440 {datatable0 dump} {
- list [catch {datatable0 dump} msg] $msg
-} {0 {i 5 22 0 0
-c 1 one string
-c 2 c14 string
-c 3 two string
-c 4 myLabel image {myTag midTag newTag}
-c 5 three string
-c 6 c2 image {myTag midTag}
-c 7 c3 image {myTag midTag}
-c 8 c4 image myTag
-c 9 endLabel image myTag
-c 10 c1 string
-c 11 c5 string
-c 12 c6 string
-c 13 c7 string
-c 14 c10 string
-c 15 c11 string
-c 16 c12 string
-c 17 c13 string
-c 18 c8 string
-c 19 c9 string
-c 20 c15 string
-c 21 c16 string {myTag2 myTag1}
-c 22 c17 string {myTag2 myTag1}
-r 1 r1
-r 2 r2
-r 3 r3
-r 4 r4
-r 5 r5
-d 1 6 1.0
-d 1 7 1.0
-d 1 8 1.0
-d 2 6 2.0
-d 2 7 2.0
-d 2 8 2.0
-d 3 6 3.0
-d 3 7 3.0
-d 3 8 3.0
-d 4 6 4.0
-d 4 7 4.0
-d 4 8 4.0
-d 5 6 5.0
-d 5 7 5.0
-d 5 8 5.0
-}}
-
-exit 0
-#----------------------
-
-test datatable.441 {datatable0 column tag names badNode} {
- list [catch {datatable0 column tag names badNode} msg] $msg
-} {1 {can't find tag or id "badNode" in ::datatable0}}
-
-test datatable.442 {datatable0 column tag names all} {
- list [catch {datatable0 column tag names all} msg] $msg
-} {1 {multiple columns specified by "all"}}
-
-test datatable.443 {datatable0 column tag names root} {
- list [catch {datatable0 column tag names root} msg] $msg
-} {0 {all hi newTag root tag2}}
-
-test datatable.444 {datatable0 column tag names 0 1} {
- list [catch {datatable0 column tag names 0 1} msg] $msg
-} {0 {all hi newTag root tag2}}
-
-test datatable.445 {datatable0 column tag nodes (missing arg)} {
- list [catch {datatable0 column tag nodes} msg] $msg
-} {1 {wrong # args: should be "datatable0 column tag nodes tag ?tag...?"}}
-
-test datatable.446 {datatable0 column tag nodes root badTag} {
- list [catch {datatable0 column tag nodes root badTag} msg] $msg
-} {1 {can't find a tag "badTag"}}
-
-test datatable.447 {datatable0 column tag nodes root tag2} {
- list [catch {datatable0 column tag nodes root tag2} msg] $msg
-} {0 {0 1 2 3 4}}
-
-
-test datatable.448 {datatable0 create 0} {
- list [catch {datatable0 create 0} msg] $msg
-} {0 2}
-
-test datatable.449 {datatable0 create root} {
- list [catch {datatable0 create root} msg] $msg
-} {0 3}
-
-test datatable.450 {datatable0 create all} {
- list [catch {datatable0 create all} msg] $msg
-} {1 {multiple columns specified by "all"}}
-
-test datatable.451 {datatable0 create 0 -at badPosition} {
- list [catch {datatable0 create 0 -at badPosition} msg] $msg
-} {1 {expected integer but got "badPosition"}}
-
-test datatable.452 {datatable0 create 0 -at -1} {
- list [catch {datatable0 create 0 -at -1} msg] $msg
-} {1 {bad value "-1": can't be negative}}
-
-test datatable.453 {datatable0 create 0 -at 1000} {
- list [catch {datatable0 create 0 -at 1000} msg] $msg
-} {0 4}
-
-test datatable.454 {datatable0 create 0 -at (no arg)} {
- list [catch {datatable0 create 0 -at} msg] $msg
-} {1 {value for "-at" missing}}
-
-test datatable.455 {datatable0 create 0 -tags myTag} {
- list [catch {datatable0 create 0 -tags myTag} msg] $msg
-} {0 5}
-
-test datatable.456 {datatable0 insert 0 -tags {myTag1 myTag2} } {
- list [catch {datatable0 insert 0 -tags {myTag1 myTag2}} msg] $msg
-} {0 6}
-
-test datatable.457 {datatable0 insert 0 -tags root} {
- list [catch {datatable0 insert 0 -tags root} msg] $msg
-} {1 {can't add reserved tag "root"}}
-
-test datatable.458 {datatable0 insert 0 -tags (missing arg)} {
- list [catch {datatable0 insert 0 -tags} msg] $msg
-} {1 {value for "-tags" missing}}
-
-test datatable.459 {datatable0 insert 0 -label myLabel -tags thisTag} {
- list [catch {datatable0 insert 0 -label myLabel -tags thisTag} msg] $msg
-} {0 8}
-
-test datatable.460 {datatable0 insert 0 -label (missing arg)} {
- list [catch {datatable0 insert 0 -label} msg] $msg
-} {1 {value for "-label" missing}}
-
-test datatable.461 {datatable0 insert 1 -tags thisTag} {
- list [catch {datatable0 insert 1 -tags thisTag} msg] $msg
-} {0 9}
-
-test datatable.462 {datatable0 insert 1 -data key (missing value)} {
- list [catch {datatable0 insert 1 -data key} msg] $msg
-} {1 {missing value for "key"}}
-
-test datatable.463 {datatable0 insert 1 -data {key value}} {
- list [catch {datatable0 insert 1 -data {key value}} msg] $msg
-} {0 11}
-
-test datatable.464 {datatable0 insert 1 -data {key1 value1 key2 value2}} {
- list [catch {datatable0 insert 1 -data {key1 value1 key2 value2}} msg] $msg
-} {0 12}
-
-test datatable.465 {get} {
- list [catch {
- datatable0 get 12
- } msg] $msg
-} {0 {key1 value1 key2 value2}}
-
-test datatable.466 {datatable0 children} {
- list [catch {datatable0 children} msg] $msg
-} {1 {wrong # args: should be "datatable0 children node ?first? ?last?"}}
-
-test datatable.467 {datatable0 children 0} {
- list [catch {datatable0 children 0} msg] $msg
-} {0 {1 2 3 4 5 6 8}}
-
-test datatable.468 {datatable0 children root} {
- list [catch {datatable0 children root} msg] $msg
-} {0 {1 2 3 4 5 6 8}}
-
-test datatable.469 {datatable0 children 1} {
- list [catch {datatable0 children 1} msg] $msg
-} {0 {9 11 12}}
-
-test datatable.470 {datatable0 insert myTag} {
- list [catch {datatable0 insert myTag} msg] $msg
-} {0 13}
-
-test datatable.471 {datatable0 children myTag} {
- list [catch {datatable0 children myTag} msg] $msg
-} {0 13}
-
-test datatable.472 {datatable0 children root 0 end} {
- list [catch {datatable0 children root 0 end} msg] $msg
-} {0 {1 2 3 4 5 6 8}}
-
-test datatable.473 {datatable0 children root 2} {
- list [catch {datatable0 children root 2} msg] $msg
-} {0 3}
-
-test datatable.474 {datatable0 children root 2 end} {
- list [catch {datatable0 children root 2 end} msg] $msg
-} {0 {3 4 5 6 8}}
-
-test datatable.475 {datatable0 children root end end} {
- list [catch {datatable0 children root end end} msg] $msg
-} {0 8}
-
-test datatable.476 {datatable0 children root 0 2} {
- list [catch {datatable0 children root 0 2} msg] $msg
-} {0 {1 2 3}}
-
-test datatable.477 {datatable0 children root -1 -20} {
- list [catch {datatable0 children root -1 -20} msg] $msg
-} {0 {}}
-
-test datatable.478 {datatable0 firstchild (missing arg)} {
- list [catch {datatable0 firstchild} msg] $msg
-} {1 {wrong # args: should be "datatable0 firstchild node"}}
-
-test datatable.479 {datatable0 firstchild root} {
- list [catch {datatable0 firstchild root} msg] $msg
-} {0 1}
-
-test datatable.480 {datatable0 lastchild (missing arg)} {
- list [catch {datatable0 lastchild} msg] $msg
-} {1 {wrong # args: should be "datatable0 lastchild node"}}
-
-test datatable.481 {datatable0 lastchild root} {
- list [catch {datatable0 lastchild root} msg] $msg
-} {0 8}
-
-test datatable.482 {datatable0 nextsibling (missing arg)} {
- list [catch {datatable0 nextsibling} msg] $msg
-} {1 {wrong # args: should be "datatable0 nextsibling node"}}
-
-test datatable.483 {datatable0 nextsibling 1)} {
- list [catch {datatable0 nextsibling 1} msg] $msg
-} {0 2}
-
-test datatable.484 {datatable0 nextsibling 2)} {
- list [catch {datatable0 nextsibling 2} msg] $msg
-} {0 3}
-
-test datatable.485 {datatable0 nextsibling 3)} {
- list [catch {datatable0 nextsibling 3} msg] $msg
-} {0 4}
-
-test datatable.486 {datatable0 nextsibling 4)} {
- list [catch {datatable0 nextsibling 4} msg] $msg
-} {0 5}
-
-test datatable.487 {datatable0 nextsibling 5)} {
- list [catch {datatable0 nextsibling 5} msg] $msg
-} {0 6}
-
-test datatable.488 {datatable0 nextsibling 6)} {
- list [catch {datatable0 nextsibling 6} msg] $msg
-} {0 8}
-
-test datatable.489 {datatable0 nextsibling 8)} {
- list [catch {datatable0 nextsibling 8} msg] $msg
-} {0 -1}
-
-test datatable.490 {datatable0 nextsibling all)} {
- list [catch {datatable0 nextsibling all} msg] $msg
-} {1 { than one node tagged as "all"}}
-
-test datatable.491 {datatable0 nextsibling badTag)} {
- list [catch {datatable0 nextsibling badTag} msg] $msg
-} {1 {can't find tag or id "badTag" in ::datatable0}}
-
-test datatable.492 {datatable0 nextsibling -1)} {
- list [catch {datatable0 nextsibling -1} msg] $msg
-} {1 {can't find tag or id "-1" in ::datatable0}}
-
-test datatable.493 {datatable0 prevsibling 2)} {
- list [catch {datatable0 prevsibling 2} msg] $msg
-} {0 1}
-
-test datatable.494 {datatable0 prevsibling 1)} {
- list [catch {datatable0 prevsibling 1} msg] $msg
-} {0 -1}
-
-test datatable.495 {datatable0 prevsibling -1)} {
- list [catch {datatable0 prevsibling -1} msg] $msg
-} {1 {can't find tag or id "-1" in ::datatable0}}
-
-test datatable.496 {datatable0 root)} {
- list [catch {datatable0 root} msg] $msg
-} {0 0}
-
-test datatable.497 {datatable0 root badArg)} {
- list [catch {datatable0 root badArgs} msg] $msg
-} {1 {wrong # args: should be "datatable0 root "}}
-
-test datatable.498 {datatable0 parent (missing arg))} {
- list [catch {datatable0 parent} msg] $msg
-} {1 {wrong # args: should be "datatable0 parent node"}}
-
-test datatable.499 {datatable0 parent root)} {
- list [catch {datatable0 parent root} msg] $msg
-} {0 -1}
-
-test datatable.500 {datatable0 parent 1)} {
- list [catch {datatable0 parent 1} msg] $msg
-} {0 0}
-
-test datatable.501 {datatable0 parent myTag)} {
- list [catch {datatable0 parent myTag} msg] $msg
-} {0 0}
-
-test datatable.502 {datatable0 next (missing arg))} {
- list [catch {datatable0 next} msg] $msg
-} {1 {wrong # args: should be "datatable0 next node"}}
-
-
-test datatable.503 {datatable0 next (extra arg))} {
- list [catch {datatable0 next root root} msg] $msg
-} {1 {wrong # args: should be "datatable0 next node"}}
-
-test datatable.504 {datatable0 next root} {
- list [catch {datatable0 next root} msg] $msg
-} {0 1}
-
-test datatable.505 {datatable0 next 1)} {
- list [catch {datatable0 next 1} msg] $msg
-} {0 9}
-
-test datatable.506 {datatable0 next 2)} {
- list [catch {datatable0 next 2} msg] $msg
-} {0 3}
-
-test datatable.507 {datatable0 next 3)} {
- list [catch {datatable0 next 3} msg] $msg
-} {0 4}
-
-test datatable.508 {datatable0 next 4)} {
- list [catch {datatable0 next 4} msg] $msg
-} {0 5}
-
-test datatable.509 {datatable0 next 5)} {
- list [catch {datatable0 next 5} msg] $msg
-} {0 13}
-
-test datatable.510 {datatable0 next 6)} {
- list [catch {datatable0 next 6} msg] $msg
-} {0 8}
-
-test datatable.511 {datatable0 next 8)} {
- list [catch {datatable0 next 8} msg] $msg
-} {0 -1}
-
-test datatable.512 {datatable0 previous 1)} {
- list [catch {datatable0 previous 1} msg] $msg
-} {0 0}
-
-test datatable.513 {datatable0 previous 0)} {
- list [catch {datatable0 previous 0} msg] $msg
-} {0 -1}
-
-test datatable.514 {datatable0 previous 8)} {
- list [catch {datatable0 previous 8} msg] $msg
-} {0 6}
-
-test datatable.515 {datatable0 depth (no arg))} {
- list [catch {datatable0 depth} msg] $msg
-} {1 {wrong # args: should be "datatable0 depth node"}}
-
-test datatable.516 {datatable0 depth root))} {
- list [catch {datatable0 depth root} msg] $msg
-} {0 0}
-
-test datatable.517 {datatable0 depth myTag))} {
- list [catch {datatable0 depth myTag} msg] $msg
-} {0 1}
-
-test datatable.518 {datatable0 depth myTag))} {
- list [catch {datatable0 depth myTag} msg] $msg
-} {0 1}
-
-
-test datatable.519 {datatable0 dumpdata 1} {
- list [catch {datatable0 dumpdata 1} msg] $msg
-} {0 {-1 1 {node1} {} {}
-1 9 {node1 node9} {} {thisTag}
-1 11 {node1 node11} {key value} {}
-1 12 {node1 node12} {key1 value1 key2 value2} {}
-}}
-
-test datatable.520 {datatable0 dumpdata this} {
- list [catch {datatable0 dumpdata myTag} msg] $msg
-} {0 {-1 5 {node5} {} {myTag}
-5 13 {node5 node13} {} {}
-}}
-
-test datatable.521 {datatable0 dumpdata 1 badArg (too many args)} {
- list [catch {datatable0 dumpdata 1 badArg} msg] $msg
-} {1 {wrong # args: should be "datatable0 dumpdata node"}}
-
-test datatable.522 {datatable0 dumpdata 11} {
- list [catch {datatable0 dumpdata 11} msg] $msg
-} {0 {-1 11 {node11} {key value} {}
-}}
-
-test datatable.523 {datatable0 dumpdata all} {
- list [catch {datatable0 dumpdata all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.524 {datatable0 dumpdata all} {
- list [catch {datatable0 dumpdata all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.525 {datatable0 dumpfile 0 test.dump} {
- list [catch {datatable0 dumpfile 0 test.dump} msg] $msg
-} {0 {}}
-
-test datatable.526 {datatable0 get 9} {
- list [catch {datatable0 get 9} msg] $msg
-} {0 {}}
-
-test datatable.527 {datatable0 get all} {
- list [catch {datatable0 get all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.528 {datatable0 get root} {
- list [catch {datatable0 get root} msg] $msg
-} {0 {}}
-
-test datatable.529 {datatable0 get 9 key} {
- list [catch {datatable0 get root} msg] $msg
-} {0 {}}
-
-test datatable.530 {datatable0 get 12} {
- list [catch {datatable0 get 12} msg] $msg
-} {0 {key1 value1 key2 value2}}
-
-test datatable.531 {datatable0 get 12 key1} {
- list [catch {datatable0 get 12 key1} msg] $msg
-} {0 value1}
-
-test datatable.532 {datatable0 get 12 key2} {
- list [catch {datatable0 get 12 key2} msg] $msg
-} {0 value2}
-
-test datatable.533 {datatable0 get 12 key1 defValue } {
- list [catch {datatable0 get 12 key1 defValue} msg] $msg
-} {0 value1}
-
-test datatable.534 {datatable0 get 12 key100 defValue } {
- list [catch {datatable0 get 12 key100 defValue} msg] $msg
-} {0 defValue}
-
-test datatable.535 {datatable0 index (missing arg) } {
- list [catch {datatable0 index} msg] $msg
-} {1 {wrong # args: should be "datatable0 index name"}}
-
-test datatable.536 {datatable0 index 0 10 (extra arg) } {
- list [catch {datatable0 index 0 10} msg] $msg
-} {1 {wrong # args: should be "datatable0 index name"}}
-
-test datatable.537 {datatable0 index 0} {
- list [catch {datatable0 index 0} msg] $msg
-} {0 0}
-
-test datatable.538 {datatable0 index root} {
- list [catch {datatable0 index root} msg] $msg
-} {0 0}
-
-test datatable.539 {datatable0 index all} {
- list [catch {datatable0 index all} msg] $msg
-} {0 -1}
-
-test datatable.540 {datatable0 index myTag} {
- list [catch {datatable0 index myTag} msg] $msg
-} {0 5}
-
-test datatable.541 {datatable0 index thisTag} {
- list [catch {datatable0 index thisTag} msg] $msg
-} {0 -1}
-
-test datatable.542 {datatable0 is (no args)} {
- list [catch {datatable0 is} msg] $msg
-} {1 {wrong # args: should be one of...
- datatable0 is ancestor node1 node2
- datatable0 is before node1 node2
- datatable0 is leaf node
- datatable0 is link node
- datatable0 is root node}}
-
-test datatable.543 {datatable0 is badOp} {
- list [catch {datatable0 is badOp} msg] $msg
-} {1 {bad operation "badOp": should be one of...
- datatable0 is ancestor node1 node2
- datatable0 is before node1 node2
- datatable0 is leaf node
- datatable0 is link node
- datatable0 is root node}}
-
-test datatable.544 {datatable0 is before} {
- list [catch {datatable0 is before} msg] $msg
-} {1 {wrong # args: should be "datatable0 is before node1 node2"}}
-
-test datatable.545 {datatable0 is before 0 10 20} {
- list [catch {datatable0 is before 0 10 20} msg] $msg
-} {1 {wrong # args: should be "datatable0 is before node1 node2"}}
-
-test datatable.546 {datatable0 is before 0 12} {
- list [catch {datatable0 is before 0 12} msg] $msg
-} {0 1}
-
-test datatable.547 {datatable0 is before 12 0} {
- list [catch {datatable0 is before 12 0} msg] $msg
-} {0 0}
-
-test datatable.548 {datatable0 is before 0 0} {
- list [catch {datatable0 is before 0 0} msg] $msg
-} {0 0}
-
-test datatable.549 {datatable0 is before root 0} {
- list [catch {datatable0 is before root 0} msg] $msg
-} {0 0}
-
-test datatable.550 {datatable0 is before 0 all} {
- list [catch {datatable0 is before 0 all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.551 {datatable0 is ancestor} {
- list [catch {datatable0 is ancestor} msg] $msg
-} {1 {wrong # args: should be "datatable0 is ancestor node1 node2"}}
-
-test datatable.552 {datatable0 is ancestor 0 12 20} {
- list [catch {datatable0 is ancestor 0 12 20} msg] $msg
-} {1 {wrong # args: should be "datatable0 is ancestor node1 node2"}}
-
-test datatable.553 {datatable0 is ancestor 0 12} {
- list [catch {datatable0 is ancestor 0 12} msg] $msg
-} {0 1}
-
-test datatable.554 {datatable0 is ancestor 12 0} {
- list [catch {datatable0 is ancestor 12 0} msg] $msg
-} {0 0}
-
-test datatable.555 {datatable0 is ancestor 1 2} {
- list [catch {datatable0 is ancestor 1 2} msg] $msg
-} {0 0}
-
-test datatable.556 {datatable0 is ancestor root 0} {
- list [catch {datatable0 is ancestor root 0} msg] $msg
-} {0 0}
-
-test datatable.557 {datatable0 is ancestor 0 all} {
- list [catch {datatable0 is ancestor 0 all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.558 {datatable0 is root (missing arg)} {
- list [catch {datatable0 is root} msg] $msg
-} {1 {wrong # args: should be "datatable0 is root node"}}
-
-test datatable.559 {datatable0 is root 0 20 (extra arg)} {
- list [catch {datatable0 is root 0 20} msg] $msg
-} {1 {wrong # args: should be "datatable0 is root node"}}
-
-test datatable.560 {datatable0 is root 0} {
- list [catch {datatable0 is root 0} msg] $msg
-} {0 1}
-
-test datatable.561 {datatable0 is root 12} {
- list [catch {datatable0 is root 12} msg] $msg
-} {0 0}
-
-test datatable.562 {datatable0 is root 1} {
- list [catch {datatable0 is root 1} msg] $msg
-} {0 0}
-
-test datatable.563 {datatable0 is root root} {
- list [catch {datatable0 is root root} msg] $msg
-} {0 1}
-
-test datatable.564 {datatable0 is root all} {
- list [catch {datatable0 is root all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.565 {datatable0 is leaf (missing arg)} {
- list [catch {datatable0 is leaf} msg] $msg
-} {1 {wrong # args: should be "datatable0 is leaf node"}}
-
-test datatable.566 {datatable0 is leaf 0 20 (extra arg)} {
- list [catch {datatable0 is leaf 0 20} msg] $msg
-} {1 {wrong # args: should be "datatable0 is leaf node"}}
-
-test datatable.567 {datatable0 is leaf 0} {
- list [catch {datatable0 is leaf 0} msg] $msg
-} {0 0}
-
-test datatable.568 {datatable0 is leaf 12} {
- list [catch {datatable0 is leaf 12} msg] $msg
-} {0 1}
-
-test datatable.569 {datatable0 is leaf 1} {
- list [catch {datatable0 is leaf 1} msg] $msg
-} {0 0}
-
-test datatable.570 {datatable0 is leaf root} {
- list [catch {datatable0 is leaf root} msg] $msg
-} {0 0}
-
-test datatable.571 {datatable0 is leaf all} {
- list [catch {datatable0 is leaf all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.572 {datatable0 is leaf 1000} {
- list [catch {datatable0 is leaf 1000} msg] $msg
-} {1 {can't find tag or id "1000" in ::datatable0}}
-
-test datatable.573 {datatable0 is leaf badTag} {
- list [catch {datatable0 is leaf badTag} msg] $msg
-} {1 {can't find tag or id "badTag" in ::datatable0}}
-
-test datatable.574 {datatable0 set (missing arg)} {
- list [catch {datatable0 set} msg] $msg
-} {1 {wrong # args: should be "datatable0 set node ?key value...?"}}
-
-test datatable.575 {datatable0 set 0 (missing arg)} {
- list [catch {datatable0 set 0} msg] $msg
-} {0 {}}
-
-test datatable.576 {datatable0 set 0 key (missing arg)} {
- list [catch {datatable0 set 0 key} msg] $msg
-} {1 {missing value for field "key"}}
-
-test datatable.577 {datatable0 set 0 key value} {
- list [catch {datatable0 set 0 key value} msg] $msg
-} {0 {}}
-
-test datatable.578 {datatable0 set 0 key1 value1 key2 value2 key3 value3} {
- list [catch {datatable0 set 0 key1 value1 key2 value2 key3 value3} msg] $msg
-} {0 {}}
-
-test datatable.579 {datatable0 set 0 key1 value1 key2 (missing arg)} {
- list [catch {datatable0 set 0 key1 value1 key2} msg] $msg
-} {1 {missing value for field "key2"}}
-
-test datatable.580 {datatable0 set 0 key value} {
- list [catch {datatable0 set 0 key value} msg] $msg
-} {0 {}}
-
-test datatable.581 {datatable0 set 0 key1 value1 key2 (missing arg)} {
- list [catch {datatable0 set 0 key1 value1 key2} msg] $msg
-} {1 {missing value for field "key2"}}
-
-test datatable.582 {datatable0 set all} {
- list [catch {datatable0 set all} msg] $msg
-} {0 {}}
-
-test datatable.583 {datatable0 set all abc 123} {
- list [catch {datatable0 set all abc 123} msg] $msg
-} {0 {}}
-
-test datatable.584 {datatable0 set root} {
- list [catch {datatable0 set root} msg] $msg
-} {0 {}}
-
-test datatable.585 {datatable0 restore stuff} {
- list [catch {
- set data [datatable0 dumpdata root]
- blt::datatable create
- datatable1 restore root $data
- set data [datatable1 dumpdata root]
- blt::datatable destroy datatable1
- set data
- } msg] $msg
-} {0 {-1 0 {::datatable0} {key value key1 value1 key2 value2 key3 value3 abc 123} {}
-0 1 {::datatable0 node1} {abc 123} {}
-1 9 {::datatable0 node1 node9} {abc 123} {thisTag}
-1 11 {::datatable0 node1 node11} {key value abc 123} {}
-1 12 {::datatable0 node1 node12} {key1 value1 key2 value2 abc 123} {}
-0 2 {::datatable0 node2} {abc 123} {}
-0 3 {::datatable0 node3} {abc 123} {}
-0 4 {::datatable0 node4} {abc 123} {}
-0 5 {::datatable0 node5} {abc 123} {myTag}
-5 13 {::datatable0 node5 node13} {abc 123} {}
-0 6 {::datatable0 node6} {abc 123} {myTag2 myTag1}
-0 8 {::datatable0 myLabel} {abc 123} {thisTag}
-}}
-
-test datatable.586 {datatable0 restorefile 0 test.dump} {
- list [catch {
- blt::datatable create
- datatable1 restorefile root test.dump
- set data [datatable1 dumpdata root]
- blt::datatable destroy datatable1
- set data
- } msg] $msg
-} {0 {-1 0 {::datatable0} {} {}
-0 1 {::datatable0 node1} {} {}
-1 9 {::datatable0 node1 node9} {} {thisTag}
-1 11 {::datatable0 node1 node11} {key value} {}
-1 12 {::datatable0 node1 node12} {key1 value1 key2 value2} {}
-0 2 {::datatable0 node2} {} {}
-0 3 {::datatable0 node3} {} {}
-0 4 {::datatable0 node4} {} {}
-0 5 {::datatable0 node5} {} {myTag}
-5 13 {::datatable0 node5 node13} {} {}
-0 6 {::datatable0 node6} {} {myTag2 myTag1}
-0 8 {::datatable0 myLabel} {} {thisTag}
-}}
-
-
-test datatable.587 {datatable0 unset 0 key1} {
- list [catch {datatable0 unset 0 key1} msg] $msg
-} {0 {}}
-
-test datatable.588 {datatable0 get 0} {
- list [catch {datatable0 get 0} msg] $msg
-} {0 {key value key2 value2 key3 value3 abc 123}}
-
-test datatable.589 {datatable0 unset 0 key2 key3} {
- list [catch {datatable0 unset 0 key2 key3} msg] $msg
-} {0 {}}
-
-test datatable.590 {datatable0 get 0} {
- list [catch {datatable0 get 0} msg] $msg
-} {0 {key value abc 123}}
-
-test datatable.591 {datatable0 unset 0} {
- list [catch {datatable0 unset 0} msg] $msg
-} {0 {}}
-
-test datatable.592 {datatable0 get 0} {
- list [catch {datatable0 get 0} msg] $msg
-} {0 {}}
-
-test datatable.593 {datatable0 unset all abc} {
- list [catch {datatable0 unset all abc} msg] $msg
-} {0 {}}
-
-test datatable.594 {datatable0 restore stuff} {
- list [catch {
- set data [datatable0 dumpdata root]
- blt::datatable create datatable1
- datatable1 restore root $data
- set data [datatable1 dumpdata root]
- blt::datatable destroy datatable1
- set data
- } msg] $msg
-} {0 {-1 0 {::datatable0} {} {}
-0 1 {::datatable0 node1} {} {}
-1 9 {::datatable0 node1 node9} {} {thisTag}
-1 11 {::datatable0 node1 node11} {key value} {}
-1 12 {::datatable0 node1 node12} {key1 value1 key2 value2} {}
-0 2 {::datatable0 node2} {} {}
-0 3 {::datatable0 node3} {} {}
-0 4 {::datatable0 node4} {} {}
-0 5 {::datatable0 node5} {} {myTag}
-5 13 {::datatable0 node5 node13} {} {}
-0 6 {::datatable0 node6} {} {myTag2 myTag1}
-0 8 {::datatable0 myLabel} {} {thisTag}
-}}
-
-test datatable.595 {datatable0 restore (missing arg)} {
- list [catch {datatable0 restore} msg] $msg
-} {1 {wrong # args: should be "datatable0 restore node dataString ?switches?"}}
-
-test datatable.596 {datatable0 restore 0 badString} {
- list [catch {datatable0 restore 0 badString} msg] $msg
-} {1 {line #1: wrong # elements in restore entry}}
-
-test datatable.597 {datatable0 restore 0 {} arg (extra arg)} {
- list [catch {datatable0 restore 0 {} arg} msg] $msg
-} {1 {unknown option "arg"}}
-
-
-test datatable.598 {datatable0 size (missing arg)} {
- list [catch {datatable0 size} msg] $msg
-} {1 {wrong # args: should be "datatable0 size node"}}
-
-test datatable.599 {datatable0 size 0} {
- list [catch {datatable0 size 0} msg] $msg
-} {0 12}
-
-test datatable.600 {datatable0 size all} {
- list [catch {datatable0 size all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.601 {datatable0 size 0 10 (extra arg)} {
- list [catch {datatable0 size 0 10} msg] $msg
-} {1 {wrong # args: should be "datatable0 size node"}}
-
-test datatable.602 {datatable0 delete (missing arg)} {
- list [catch {datatable0 delete} msg] $msg
-} {1 {wrong # args: should be "datatable0 delete node ?node...?"}}
-
-test datatable.603 {datatable0 delete 11} {
- list [catch {datatable0 delete 11} msg] $msg
-} {0 {}}
-
-test datatable.604 {datatable0 delete 11} {
- list [catch {datatable0 delete 11} msg] $msg
-} {1 {can't find tag or id "11" in ::datatable0}}
-
-test datatable.605 {datatable0 delete 9 12} {
- list [catch {datatable0 delete 9 12} msg] $msg
-} {0 {}}
-
-test datatable.606 {datatable0 dumpdata 0} {
- list [catch {datatable0 dump 0} msg] $msg
-} {0 {-1 0 {::datatable0} {} {}
-0 1 {::datatable0 node1} {} {}
-0 2 {::datatable0 node2} {} {}
-0 3 {::datatable0 node3} {} {}
-0 4 {::datatable0 node4} {} {}
-0 5 {::datatable0 node5} {} {myTag}
-5 13 {::datatable0 node5 node13} {} {}
-0 6 {::datatable0 node6} {} {myTag2 myTag1}
-0 8 {::datatable0 myLabel} {} {thisTag}
-}}
-
-test datatable.607 {delete all} {
- list [catch {
- set data [datatable0 dump root]
- blt::datatable create
- datatable1 restore root $data
- datatable1 delete all
- set data [datatable1 dump root]
- blt::datatable destroy datatable1
- set data
- } msg] $msg
-} {0 {-1 0 {::datatable0} {} {}
-}}
-
-test datatable.608 {delete all all} {
- list [catch {
- set data [datatable0 dump root]
- blt::datatable create
- datatable1 restore root $data
- datatable1 delete all all
- set data [datatable1 dump root]
- blt::datatable destroy datatable1
- set data
- } msg] $msg
-} {0 {-1 0 {::datatable0} {} {}
-}}
-
-test datatable.609 {datatable0 apply (missing arg)} {
- list [catch {datatable0 apply} msg] $msg
-} {1 {wrong # args: should be "datatable0 apply node ?switches?"}}
-
-test datatable.610 {datatable0 apply 0} {
- list [catch {datatable0 apply 0} msg] $msg
-} {0 {}}
-
-test datatable.611 {datatable0 apply 0 -badOption} {
- list [catch {datatable0 apply 0 -badOption} msg] $msg
-} {1 {unknown option "-badOption"}}
-
-test datatable.612 {datatable0 apply badTag} {
- list [catch {datatable0 apply badTag} msg] $msg
-} {1 {can't find tag or id "badTag" in ::datatable0}}
-
-test datatable.613 {datatable0 apply all} {
- list [catch {datatable0 apply all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.614 {datatable0 apply myTag -precommand lappend} {
- list [catch {
- set mylist {}
- datatable0 apply myTag -precommand {lappend mylist}
- set mylist
- } msg] $msg
-} {0 {5 13}}
-
-test datatable.615 {datatable0 apply root -precommand lappend} {
- list [catch {
- set mylist {}
- datatable0 apply root -precommand {lappend mylist}
- set mylist
- } msg] $msg
-} {0 {0 1 2 3 4 5 13 6 8}}
-
-test datatable.616 {datatable0 apply -precommand -postcommand} {
- list [catch {
- set mylist {}
- datatable0 apply root -precommand {lappend mylist} \
- -postcommand {lappend mylist}
- set mylist
- } msg] $msg
-} {0 {0 1 1 2 2 3 3 4 4 5 13 13 5 6 6 8 8 0}}
-
-test datatable.617 {datatable0 apply root -precommand lappend -depth 1} {
- list [catch {
- set mylist {}
- datatable0 apply root -precommand {lappend mylist} -depth 1
- set mylist
- } msg] $msg
-} {0 {0 1 2 3 4 5 6 8}}
-
-
-test datatable.618 {datatable0 apply root -precommand -depth 0} {
- list [catch {
- set mylist {}
- datatable0 apply root -precommand {lappend mylist} -depth 0
- set mylist
- } msg] $msg
-} {0 0}
-
-test datatable.619 {datatable0 apply root -precommand -tag myTag} {
- list [catch {
- set mylist {}
- datatable0 apply root -precommand {lappend mylist} -tag myTag
- set mylist
- } msg] $msg
-} {0 5}
-
-
-test datatable.620 {datatable0 apply root -precommand -key key1} {
- list [catch {
- set mylist {}
- datatable0 set myTag key1 0.0
- datatable0 apply root -precommand {lappend mylist} -key key1
- datatable0 unset myTag key1
- set mylist
- } msg] $msg
-} {0 5}
-
-test datatable.621 {datatable0 apply root -postcommand -regexp node.*} {
- list [catch {
- set mylist {}
- datatable0 set myTag key1 0.0
- datatable0 apply root -precommand {lappend mylist} -regexp {node5}
- datatable0 unset myTag key1
- set mylist
- } msg] $msg
-} {0 5}
-
-test datatable.622 {datatable0 find (missing arg)} {
- list [catch {datatable0 find} msg] $msg
-} {1 {wrong # args: should be "datatable0 find node ?switches?"}}
-
-test datatable.623 {datatable0 find 0} {
- list [catch {datatable0 find 0} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test datatable.624 {datatable0 find root} {
- list [catch {datatable0 find root} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test datatable.625 {datatable0 find 0 -glob node*} {
- list [catch {datatable0 find root -glob node*} msg] $msg
-} {0 {1 2 3 4 13 5 6}}
-
-test datatable.626 {datatable0 find 0 -glob nobody} {
- list [catch {datatable0 find root -glob nobody} msg] $msg
-} {0 {}}
-
-test datatable.627 {datatable0 find 0 -regexp {node[0-3]}} {
- list [catch {datatable0 find root -regexp {node[0-3]}} msg] $msg
-} {0 {1 2 3 13}}
-
-test datatable.628 {datatable0 find 0 -regexp {.*[A-Z].*}} {
- list [catch {datatable0 find root -regexp {.*[A-Z].*}} msg] $msg
-} {0 8}
-
-test datatable.629 {datatable0 find 0 -exact myLabel} {
- list [catch {datatable0 find root -exact myLabel} msg] $msg
-} {0 8}
-
-test datatable.630 {datatable0 find 0 -exact myLabel -invert} {
- list [catch {datatable0 find root -exact myLabel -invert} msg] $msg
-} {0 {1 2 3 4 13 5 6 0}}
-
-test datatable.631 {datatable0 find 3 -exact node3} {
- list [catch {datatable0 find 3 -exact node3} msg] $msg
-} {0 3}
-
-test datatable.632 {datatable0 find 0 -nocase -exact mylabel} {
- list [catch {datatable0 find 0 -nocase -exact mylabel} msg] $msg
-} {0 8}
-
-test datatable.633 {datatable0 find 0 -nocase} {
- list [catch {datatable0 find 0 -nocase} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test datatable.634 {datatable0 find 0 -path -nocase -glob *node1* } {
- list [catch {datatable0 find 0 -path -nocase -glob *node1*} msg] $msg
-} {0 {1 13}}
-
-test datatable.635 {datatable0 find 0 -count 5 } {
- list [catch {datatable0 find 0 -count 5} msg] $msg
-} {0 {1 2 3 4 13}}
-
-test datatable.636 {datatable0 find 0 -count -5 } {
- list [catch {datatable0 find 0 -count -5} msg] $msg
-} {1 {bad value "-5": can't be negative}}
-
-test datatable.637 {datatable0 find 0 -count badValue } {
- list [catch {datatable0 find 0 -count badValue} msg] $msg
-} {1 {expected integer but got "badValue"}}
-
-test datatable.638 {datatable0 find 0 -count badValue } {
- list [catch {datatable0 find 0 -count badValue} msg] $msg
-} {1 {expected integer but got "badValue"}}
-
-test datatable.639 {datatable0 find 0 -leafonly} {
- list [catch {datatable0 find 0 -leafonly} msg] $msg
-} {0 {1 2 3 4 13 6 8}}
-
-test datatable.640 {datatable0 find 0 -leafonly -glob {node[18]}} {
- list [catch {datatable0 find 0 -glob {node[18]} -leafonly} msg] $msg
-} {0 1}
-
-test datatable.641 {datatable0 find 0 -depth 0} {
- list [catch {datatable0 find 0 -depth 0} msg] $msg
-} {0 0}
-
-test datatable.642 {datatable0 find 0 -depth 1} {
- list [catch {datatable0 find 0 -depth 1} msg] $msg
-} {0 {1 2 3 4 5 6 8 0}}
-
-test datatable.643 {datatable0 find 0 -depth 2} {
- list [catch {datatable0 find 0 -depth 2} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test datatable.644 {datatable0 find 0 -depth 20} {
- list [catch {datatable0 find 0 -depth 20} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test datatable.645 {datatable0 find 1 -depth 0} {
- list [catch {datatable0 find 1 -depth 0} msg] $msg
-} {0 1}
-
-test datatable.646 {datatable0 find 1 -depth 1} {
- list [catch {datatable0 find 1 -depth 1} msg] $msg
-} {0 1}
-
-test datatable.647 {datatable0 find 1 -depth 2} {
- list [catch {datatable0 find 1 -depth 2} msg] $msg
-} {0 1}
-
-test datatable.648 {datatable0 find all} {
- list [catch {datatable0 find all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.649 {datatable0 find badTag} {
- list [catch {datatable0 find badTag} msg] $msg
-} {1 {can't find tag or id "badTag" in ::datatable0}}
-
-test datatable.650 {datatable0 find 0 -addtag hi} {
- list [catch {datatable0 find 0 -addtag hi} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test datatable.651 {datatable0 find 0 -addtag all} {
- list [catch {datatable0 find 0 -addtag all} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test datatable.652 {datatable0 find 0 -addtag root} {
- list [catch {datatable0 find 0 -addtag root} msg] $msg
-} {1 {can't add reserved tag "root"}}
-
-test datatable.653 {datatable0 find 0 -exec {lappend list} -leafonly} {
- list [catch {
- set list {}
- datatable0 find 0 -exec {lappend list} -leafonly
- set list
- } msg] $msg
-} {0 {1 2 3 4 13 6 8}}
-
-test datatable.654 {datatable0 find 0 -tag root} {
- list [catch {datatable0 find 0 -tag root} msg] $msg
-} {0 0}
-
-test datatable.655 {datatable0 find 0 -tag myTag} {
- list [catch {datatable0 find 0 -tag myTag} msg] $msg
-} {0 5}
-
-test datatable.656 {datatable0 find 0 -tag badTag} {
- list [catch {datatable0 find 0 -tag badTag} msg] $msg
-} {0 {}}
-
-test datatable.657 {datatable0 tag (missing args)} {
- list [catch {datatable0 tag} msg] $msg
-} {1 {wrong # args: should be "datatable0 tag args"}}
-
-test datatable.658 {datatable0 tag badOp} {
- list [catch {datatable0 tag badOp} msg] $msg
-} {1 {bad operation "badOp": should be one of...
- datatable0 tag add tag node...
- datatable0 tag delete tag node...
- datatable0 tag dump tag...
- datatable0 tag exists node tag...
- datatable0 tag forget tag...
- datatable0 tag get node ?pattern...?
- datatable0 tag names ?node...?
- datatable0 tag nodes tag ?tag...?
- datatable0 tag set node tag...
- datatable0 tag unset node tag...}}
-
-test datatable.659 {datatable0 tag add} {
- list [catch {datatable0 tag add} msg] $msg
-} {1 {wrong # args: should be "datatable0 tag add tag node..."}}
-
-test datatable.660 {datatable0 tag add tag} {
- list [catch {datatable0 tag add tag} msg] $msg
-} {1 {wrong # args: should be "datatable0 tag add tag node..."}}
-
-test datatable.661 {datatable0 tag add tag badNode} {
- list [catch {datatable0 tag add tag badNode} msg] $msg
-} {1 {can't find tag or id "badNode" in ::datatable0}}
-
-test datatable.662 {datatable0 tag add newTag root} {
- list [catch {datatable0 tag add newTag root} msg] $msg
-} {0 {}}
-
-test datatable.663 {datatable0 tag add newTag all} {
- list [catch {datatable0 tag add newTag all} msg] $msg
-} {0 {}}
-
-test datatable.664 {datatable0 tag add tag2 0 1 2 3 4} {
- list [catch {datatable0 tag add tag2 0 1 2 3 4} msg] $msg
-} {0 {}}
-
-test datatable.665 {datatable0 tag add tag2 0 1 2 3 4 1000} {
- list [catch {datatable0 tag add tag2 0 1 2 3 4 1000} msg] $msg
-} {1 {can't find tag or id "1000" in ::datatable0}}
-
-test datatable.666 {datatable0 tag names} {
- list [catch {datatable0 tag names} msg] $msg
-} {0 {all hi myTag myTag1 myTag2 newTag root tag2 thisTag}}
-
-test datatable.667 {datatable0 tag names badNode} {
- list [catch {datatable0 tag names badNode} msg] $msg
-} {1 {can't find tag or id "badNode" in ::datatable0}}
-
-test datatable.668 {datatable0 tag names all} {
- list [catch {datatable0 tag names all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.669 {datatable0 tag names root} {
- list [catch {datatable0 tag names root} msg] $msg
-} {0 {all hi newTag root tag2}}
-
-test datatable.670 {datatable0 tag names 0 1} {
- list [catch {datatable0 tag names 0 1} msg] $msg
-} {0 {all hi newTag root tag2}}
-
-test datatable.671 {datatable0 tag nodes (missing arg)} {
- list [catch {datatable0 tag nodes} msg] $msg
-} {1 {wrong # args: should be "datatable0 tag nodes tag ?tag...?"}}
-
-test datatable.672 {datatable0 tag nodes root badTag} {
- list [catch {datatable0 tag nodes root badTag} msg] $msg
-} {1 {can't find a tag "badTag"}}
-
-test datatable.673 {datatable0 tag nodes root tag2} {
- list [catch {datatable0 tag nodes root tag2} msg] $msg
-} {0 {0 1 2 3 4}}
-
-test datatable.674 {datatable0 ancestor (missing arg)} {
- list [catch {datatable0 ancestor} msg] $msg
-} {1 {wrong # args: should be "datatable0 ancestor node1 node2"}}
-
-test datatable.675 {datatable0 ancestor 0 (missing arg)} {
- list [catch {datatable0 ancestor 0} msg] $msg
-} {1 {wrong # args: should be "datatable0 ancestor node1 node2"}}
-
-test datatable.676 {datatable0 ancestor 0 10} {
- list [catch {datatable0 ancestor 0 10} msg] $msg
-} {1 {can't find tag or id "10" in ::datatable0}}
-
-test datatable.677 {datatable0 ancestor 0 4} {
- list [catch {datatable0 ancestor 0 4} msg] $msg
-} {0 0}
-
-test datatable.678 {datatable0 ancestor 1 8} {
- list [catch {datatable0 ancestor 1 8} msg] $msg
-} {0 0}
-
-test datatable.679 {datatable0 ancestor root 0} {
- list [catch {datatable0 ancestor root 0} msg] $msg
-} {0 0}
-
-test datatable.680 {datatable0 ancestor 8 8} {
- list [catch {datatable0 ancestor 8 8} msg] $msg
-} {0 8}
-
-test datatable.681 {datatable0 ancestor 0 all} {
- list [catch {datatable0 ancestor 0 all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.682 {datatable0 ancestor 7 9} {
- list [catch {
- set n1 1; set n2 1;
- for { set i 0 } { $i < 4 } { incr i } {
- set n1 [datatable0 insert $n1]
- set n2 [datatable0 insert $n2]
- }
- datatable0 ancestor $n1 $n2
- } msg] $msg
-} {0 1}
-
-test datatable.683 {datatable0 path (missing arg)} {
- list [catch {datatable0 path} msg] $msg
-} {1 {wrong # args: should be "datatable0 path node"}}
-
-test datatable.684 {datatable0 path root} {
- list [catch {datatable0 path root} msg] $msg
-} {0 {}}
-
-test datatable.685 {datatable0 path 0} {
- list [catch {datatable0 path 0} msg] $msg
-} {0 {}}
-
-test datatable.686 {datatable0 path 15} {
- list [catch {datatable0 path 15} msg] $msg
-} {0 {node1 node15}}
-
-test datatable.687 {datatable0 path all} {
- list [catch {datatable0 path all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.688 {datatable0 path 0 1 2 4 (extra args)} {
- list [catch {datatable0 path 0 1 2 4} msg] $msg
-} {1 {wrong # args: should be "datatable0 path node"}}
-
-test datatable.689 {datatable0 tag forget} {
- list [catch {datatable0 tag forget} msg] $msg
-} {1 {wrong # args: should be "datatable0 tag forget tag..."}}
-
-test datatable.690 {datatable0 tag forget badTag} {
- list [catch {
- datatable0 tag forget badTag
- lsort [datatable0 tag names]
- } msg] $msg
-} {0 {all hi myTag myTag1 myTag2 newTag root tag2 thisTag}}
-
-test datatable.691 {datatable0 tag forget hi} {
- list [catch {
- datatable0 tag forget hi
- lsort [datatable0 tag names]
- } msg] $msg
-} {0 {all myTag myTag1 myTag2 newTag root tag2 thisTag}}
-
-test datatable.692 {datatable0 tag forget tag1 tag2} {
- list [catch {
- datatable0 tag forget myTag1 myTag2
- lsort [datatable0 tag names]
- } msg] $msg
-} {0 {all myTag newTag root tag2 thisTag}}
-
-test datatable.693 {datatable0 tag forget all} {
- list [catch {
- datatable0 tag forget all
- lsort [datatable0 tag names]
- } msg] $msg
-} {0 {all myTag newTag root tag2 thisTag}}
-
-test datatable.694 {datatable0 tag forget root} {
- list [catch {
- datatable0 tag forget root
- lsort [datatable0 tag names]
- } msg] $msg
-} {0 {all myTag newTag root tag2 thisTag}}
-
-test datatable.695 {datatable0 tag delete} {
- list [catch {datatable0 tag delete} msg] $msg
-} {1 {wrong # args: should be "datatable0 tag delete tag node..."}}
-
-test datatable.696 {datatable0 tag delete tag} {
- list [catch {datatable0 tag delete tag} msg] $msg
-} {1 {wrong # args: should be "datatable0 tag delete tag node..."}}
-
-test datatable.697 {datatable0 tag delete tag 0} {
- list [catch {datatable0 tag delete tag 0} msg] $msg
-} {0 {}}
-
-test datatable.698 {datatable0 tag delete root 0} {
- list [catch {datatable0 tag delete root 0} msg] $msg
-} {1 {can't delete reserved tag "root"}}
-
-test datatable.699 {datatable0 attach} {
- list [catch {datatable0 attach} msg] $msg
-} {0 ::datatable0}
-
-test datatable.700 {datatable0 attach datatable2 datatable3} {
- list [catch {datatable0 attach datatable2 datatable3} msg] $msg
-} {1 {wrong # args: should be "datatable0 attach ?datatable?"}}
-
-test datatable.701 {datatable1 attach datatable0} {
- list [catch {
- blt::datatable create
- datatable1 attach datatable0
- datatable1 dump 0
- } msg] $msg
-} {0 {-1 0 {::datatable0} {} {}
-0 2 {::datatable0 node2} {} {}
-2 1 {::datatable0 node2 node1} {} {}
-1 14 {::datatable0 node2 node1 node14} {} {}
-14 16 {::datatable0 node2 node1 node14 node16} {} {}
-16 18 {::datatable0 node2 node1 node14 node16 node18} {} {}
-18 20 {::datatable0 node2 node1 node14 node16 node18 node20} {} {}
-1 15 {::datatable0 node2 node1 node15} {} {}
-15 17 {::datatable0 node2 node1 node15 node17} {} {}
-17 19 {::datatable0 node2 node1 node15 node17 node19} {} {}
-19 21 {::datatable0 node2 node1 node15 node17 node19 node21} {} {}
-0 3 {::datatable0 node3} {} {}
-0 4 {::datatable0 node4} {} {}
-0 5 {::datatable0 node5} {} {}
-5 13 {::datatable0 node5 node13} {} {}
-0 6 {::datatable0 node6} {} {}
-0 8 {::datatable0 myLabel} {} {}
-}}
-
-test datatable.702 {datatable1 attach} {
- list [catch {datatable1 attach} msg] $msg
-} {0 ::datatable0}
-
-
-test datatable.703 {blt::datatable destroy datatable1} {
- list [catch {blt::datatable destroy datatable1} msg] $msg
-} {0 {}}
-
-test datatable.704 {datatable0 find root -badFlag} {
- list [catch {datatable0 find root -badFlag} msg] $msg
-} {1 {unknown option "-badFlag"}}
-
-test datatable.705 {datatable0 find root -order} {
- list [catch {datatable0 find root -order} msg] $msg
-} {1 {value for "-order" missing}}
-
-test datatable.706 {datatable0 find root ...} {
- list [catch {datatable0 find root -order preorder -order postorder -order inorder} msg] $msg
-} {0 {20 18 16 14 1 21 19 17 15 2 0 3 4 13 5 6 8}}
-
-test datatable.707 {datatable0 find root -order preorder} {
- list [catch {datatable0 find root -order preorder} msg] $msg
-} {0 {0 2 1 14 16 18 20 15 17 19 21 3 4 5 13 6 8}}
-
-test datatable.708 {datatable0 find root -order postorder} {
- list [catch {datatable0 find root -order postorder} msg] $msg
-} {0 {20 18 16 14 21 19 17 15 1 2 3 4 13 5 6 8 0}}
-
-test datatable.709 {datatable0 find root -order inorder} {
- list [catch {datatable0 find root -order inorder} msg] $msg
-} {0 {20 18 16 14 1 21 19 17 15 2 0 3 4 13 5 6 8}}
-
-test datatable.710 {datatable0 find root -order breadthfirst} {
- list [catch {datatable0 find root -order breadthfirst} msg] $msg
-} {0 {0 2 3 4 5 6 8 1 13 14 15 16 17 18 19 20 21}}
-
-test datatable.711 {datatable0 set all key1 myValue} {
- list [catch {datatable0 set all key1 myValue} msg] $msg
-} {0 {}}
-
-test datatable.712 {datatable0 set 15 key1 123} {
- list [catch {datatable0 set 15 key1 123} msg] $msg
-} {0 {}}
-
-test datatable.713 {datatable0 set 16 key1 1234 key2 abc} {
- list [catch {datatable0 set 16 key1 123 key2 abc} msg] $msg
-} {0 {}}
-
-test datatable.714 {datatable0 find root -key } {
- list [catch {datatable0 find root -key} msg] $msg
-} {1 {value for "-key" missing}}
-
-test datatable.715 {datatable0 find root -key noKey} {
- list [catch {datatable0 find root -key noKey} msg] $msg
-} {0 {}}
-
-test datatable.716 {datatable0 find root -key key1} {
- list [catch {datatable0 find root -key key1} msg] $msg
-} {0 {20 18 16 14 21 19 17 15 1 2 3 4 13 5 6 8 0}}
-
-test datatable.717 {datatable0 find root -key key2} {
- list [catch {datatable0 find root -key key2} msg] $msg
-} {0 16}
-
-test datatable.718 {datatable0 find root -key key2 -exact notThere } {
- list [catch {datatable0 find root -key key2 -exact notThere } msg] $msg
-} {0 {}}
-
-test datatable.719 {datatable0 find root -key key1 -glob notThere } {
- list [catch {datatable0 find root -key key2 -exact notThere } msg] $msg
-} {0 {}}
-
-test datatable.720 {datatable0 find root -key badKey -regexp notThere } {
- list [catch {datatable0 find root -key key2 -exact notThere } msg] $msg
-} {0 {}}
-
-test datatable.721 {datatable0 find root -key key1 -glob 12*} {
- list [catch {datatable0 find root -key key1 -glob 12*} msg] $msg
-} {0 {16 15}}
-
-test datatable.722 {datatable0 sort} {
- list [catch {datatable0 sort} msg] $msg
-} {1 {wrong # args: should be "datatable0 sort node ?flags...?"}}
-
-test datatable.723 {datatable0 sort all} {
- list [catch {datatable0 sort all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test datatable.724 {datatable0 sort -recurse} {
- list [catch {datatable0 sort -recurse} msg] $msg
-} {1 {can't find tag or id "-recurse" in ::datatable0}}
-
-test datatable.725 {datatable0 sort 0} {
- list [catch {datatable0 sort 0} msg] $msg
-} {0 {8 2 3 4 5 6}}
-
-test datatable.726 {datatable0 sort 0 -recurse} {
- list [catch {datatable0 sort 0 -recurse} msg] $msg
-} {0 {0 8 1 2 3 4 5 6 13 14 15 16 17 18 19 20 21}}
-
-test datatable.727 {datatable0 sort 0 -decreasing -key} {
- list [catch {datatable0 sort 0 -decreasing -key} msg] $msg
-} {1 {value for "-key" missing}}
-
-test datatable.728 {datatable0 sort 0 -re} {
- list [catch {datatable0 sort 0 -re} msg] $msg
-} {1 {ambiguous option "-re"}}
-
-test datatable.729 {datatable0 sort 0 -decreasing} {
- list [catch {datatable0 sort 0 -decreasing} msg] $msg
-} {0 {6 5 4 3 2 8}}
-
-test datatable.730 {datatable0 sort 0} {
- list [catch {
- set list {}
- foreach n [datatable0 sort 0] {
- lappend list [datatable0 label $n]
- }
- set list
- } msg] $msg
-} {0 {myLabel node2 node3 node4 node5 node6}}
-
-test datatable.731 {datatable0 sort 0 -decreasing} {
- list [catch {datatable0 sort 0 -decreasing} msg] $msg
-} {0 {6 5 4 3 2 8}}
-
-
-test datatable.732 {datatable0 sort 0 -decreasing -key} {
- list [catch {datatable0 sort 0 -decreasing -key} msg] $msg
-} {1 {value for "-key" missing}}
-
-test datatable.733 {datatable0 sort 0 -decreasing -key key1} {
- list [catch {datatable0 sort 0 -decreasing -key key1} msg] $msg
-} {0 {8 6 5 4 3 2}}
-
-test datatable.734 {datatable0 sort 0 -decreasing -recurse -key key1} {
- list [catch {datatable0 sort 0 -decreasing -recurse -key key1} msg] $msg
-} {0 {15 16 0 1 2 3 4 5 6 8 13 14 17 18 19 20 21}}
-
-test datatable.735 {datatable0 sort 0 -decreasing -key key1} {
- list [catch {
- set list {}
- foreach n [datatable0 sort 0 -decreasing -key key1] {
- lappend list [datatable0 get $n key1]
- }
- set list
- } msg] $msg
-} {0 {myValue myValue myValue myValue myValue myValue}}
-
-
-test datatable.736 {datatable0 index 1-firstchild} {
- list [catch {datatable0 index 1-firstchild} msg] $msg
-} {0 14}
-
-test datatable.737 {datatable0 index root-to-firstchild} {
- list [catch {datatable0 index root-to-firstchild} msg] $msg
-} {0 2}
-
-test datatable.738 {datatable0 label root-to-parent} {
- list [catch {datatable0 label root-to-parent} msg] $msg
-} {1 {can't find tag or id "root-to-parent" in ::datatable0}}
-
-test datatable.739 {datatable0 index root-to-parent} {
- list [catch {datatable0 index root-to-parent} msg] $msg
-} {0 -1}
-
-test datatable.740 {datatable0 index root-to-lastchild} {
- list [catch {datatable0 index root-to-lastchild} msg] $msg
-} {0 8}
-
-test datatable.741 {datatable0 index root-to-next} {
- list [catch {datatable0 index root-to-next} msg] $msg
-} {0 2}
-
-test datatable.742 {datatable0 index root-to-previous} {
- list [catch {datatable0 index root-to-previous} msg] $msg
-} {0 -1}
-
-test datatable.743 {datatable0 label root-to-previous} {
- list [catch {datatable0 label root-to-previous} msg] $msg
-} {1 {can't find tag or id "root-to-previous" in ::datatable0}}
-
-test datatable.744 {datatable0 index 1-previous} {
- list [catch {datatable0 index 1-previous} msg] $msg
-} {0 2}
-
-test datatable.745 {datatable0 label root-to-badModifier} {
- list [catch {datatable0 label root-to-badModifier} msg] $msg
-} {1 {can't find tag or id "root-to-badModifier" in ::datatable0}}
-
-test datatable.746 {datatable0 index root-to-badModifier} {
- list [catch {datatable0 index root-to-badModifier} msg] $msg
-} {0 -1}
-
-test datatable.747 {datatable0 index root-to-firstchild-to-parent} {
- list [catch {datatable0 index root-to-firstchild-to-parent} msg] $msg
-} {0 0}
-
-test datatable.748 {datatable0 trace} {
- list [catch {datatable0 trace} msg] $msg
-} {1 {wrong # args: should be one of...
- datatable0 trace create node key how command
- datatable0 trace delete id...
- datatable0 trace info id
- datatable0 trace names }}
-
-
-test datatable.749 {datatable0 trace create} {
- list [catch {datatable0 trace create} msg] $msg
-} {1 {wrong # args: should be "datatable0 trace create node key how command"}}
-
-test datatable.750 {datatable0 trace create root} {
- list [catch {datatable0 trace create root} msg] $msg
-} {1 {wrong # args: should be "datatable0 trace create node key how command"}}
-
-test datatable.751 {datatable0 trace create root * } {
- list [catch {datatable0 trace create root * } msg] $msg
-} {1 {wrong # args: should be "datatable0 trace create node key how command"}}
-
-test datatable.752 {datatable0 trace create root * rwuc} {
- list [catch {datatable0 trace create root * rwuc} msg] $msg
-} {1 {wrong # args: should be "datatable0 trace create node key how command"}}
-
-proc Doit args { global mylist; lappend mylist $args }
-
-test datatable.753 {datatable0 trace create all newKey rwuc Doit} {
- list [catch {datatable0 trace create all newKey rwuc Doit} msg] $msg
-} {0 trace0}
-
-test datatable.754 {datatable0 trace info trace0} {
- list [catch {datatable0 trace info trace0} msg] $msg
-} {0 {all newKey {} Doit}}
-
-test datatable.755 {test create trace} {
- list [catch {
- set mylist {}
- datatable0 set all newKey 20
- set mylist
- } msg] $msg
-} {0 {{::datatable0 0 newKey wc} {::datatable0 2 newKey wc} {::datatable0 1 newKey wc} {::datatable0 14 newKey wc} {::datatable0 16 newKey wc} {::datatable0 18 newKey wc} {::datatable0 20 newKey wc} {::datatable0 15 newKey wc} {::datatable0 17 newKey wc} {::datatable0 19 newKey wc} {::datatable0 21 newKey wc} {::datatable0 3 newKey wc} {::datatable0 4 newKey wc} {::datatable0 5 newKey wc} {::datatable0 13 newKey wc} {::datatable0 6 newKey wc} {::datatable0 8 newKey wc}}}
-
-test datatable.756 {test read trace} {
- list [catch {
- set mylist {}
- datatable0 get root newKey
- set mylist
- } msg] $msg
-} {0 {{::datatable0 0 newKey r}}}
-
-test datatable.757 {test write trace} {
- list [catch {
- set mylist {}
- datatable0 set all newKey 21
- set mylist
- } msg] $msg
-} {0 {{::datatable0 0 newKey w} {::datatable0 2 newKey w} {::datatable0 1 newKey w} {::datatable0 14 newKey w} {::datatable0 16 newKey w} {::datatable0 18 newKey w} {::datatable0 20 newKey w} {::datatable0 15 newKey w} {::datatable0 17 newKey w} {::datatable0 19 newKey w} {::datatable0 21 newKey w} {::datatable0 3 newKey w} {::datatable0 4 newKey w} {::datatable0 5 newKey w} {::datatable0 13 newKey w} {::datatable0 6 newKey w} {::datatable0 8 newKey w}}}
-
-test datatable.758 {test unset trace} {
- list [catch {
- set mylist {}
- datatable0 set all newKey 21
- set mylist
- } msg] $msg
-} {0 {{::datatable0 0 newKey w} {::datatable0 2 newKey w} {::datatable0 1 newKey w} {::datatable0 14 newKey w} {::datatable0 16 newKey w} {::datatable0 18 newKey w} {::datatable0 20 newKey w} {::datatable0 15 newKey w} {::datatable0 17 newKey w} {::datatable0 19 newKey w} {::datatable0 21 newKey w} {::datatable0 3 newKey w} {::datatable0 4 newKey w} {::datatable0 5 newKey w} {::datatable0 13 newKey w} {::datatable0 6 newKey w} {::datatable0 8 newKey w}}}
-
-test datatable.759 {datatable0 trace delete} {
- list [catch {datatable0 trace delete} msg] $msg
-} {0 {}}
-
-test datatable.760 {datatable0 trace delete badId} {
- list [catch {datatable0 trace delete badId} msg] $msg
-} {1 {unknown trace "badId"}}
-
-test datatable.761 {datatable0 trace delete trace0} {
- list [catch {datatable0 trace delete trace0} msg] $msg
-} {0 {}}
-
-test datatable.762 {test create trace} {
- list [catch {
- set mylist {}
- datatable0 set all newKey 20
- set mylist
- } msg] $msg
-} {0 {}}
-
-test datatable.763 {test unset trace} {
- list [catch {
- set mylist {}
- datatable0 unset all newKey
- set mylist
- } msg] $msg
-} {0 {}}
-
-
-test datatable.764 {datatable0 notify} {
- list [catch {datatable0 notify} msg] $msg
-} {1 {wrong # args: should be one of...
- datatable0 notify create ?flags? command
- datatable0 notify delete notifyId...
- datatable0 notify info notifyId
- datatable0 notify names }}
-
-
-test datatable.765 {datatable0 notify create} {
- list [catch {datatable0 notify create} msg] $msg
-} {1 {wrong # args: should be "datatable0 notify create ?flags? command"}}
-
-test datatable.766 {datatable0 notify create -allevents} {
- list [catch {datatable0 notify create -allevents Doit} msg] $msg
-} {0 notify0}
-
-test datatable.767 {datatable0 notify info notify0} {
- list [catch {datatable0 notify info notify0} msg] $msg
-} {0 {notify0 {-create -delete -move -sort -relabel} {Doit}}}
-
-test datatable.768 {datatable0 notify info badId} {
- list [catch {datatable0 notify info badId} msg] $msg
-} {1 {unknown notify name "badId"}}
-
-test datatable.769 {datatable0 notify info} {
- list [catch {datatable0 notify info} msg] $msg
-} {1 {wrong # args: should be "datatable0 notify info notifyId"}}
-
-test datatable.770 {datatable0 notify names} {
- list [catch {datatable0 notify names} msg] $msg
-} {0 notify0}
-
-
-test datatable.771 {test create notify} {
- list [catch {
- set mylist {}
- datatable0 insert 1 -tags test
- set mylist
- } msg] $msg
-} {0 {{-create 22}}}
-
-test datatable.772 {test move notify} {
- list [catch {
- set mylist {}
- datatable0 move 8 test
- set mylist
- } msg] $msg
-} {0 {{-move 8}}}
-
-test datatable.773 {test sort notify} {
- list [catch {
- set mylist {}
- datatable0 sort 0 -reorder
- set mylist
- } msg] $msg
-} {0 {{-sort 0}}}
-
-test datatable.774 {test relabel notify} {
- list [catch {
- set mylist {}
- datatable0 label test "newLabel"
- set mylist
- } msg] $msg
-} {0 {{-relabel 22}}}
-
-test datatable.775 {test delete notify} {
- list [catch {
- set mylist {}
- datatable0 delete test
- set mylist
- } msg] $msg
-} {0 {{-delete 8} {-delete 22}}}
-
-
-test datatable.776 {datatable0 notify delete badId} {
- list [catch {datatable0 notify delete badId} msg] $msg
-} {1 {unknown notify name "badId"}}
-
-
-test datatable.777 {test create notify} {
- list [catch {
- set mylist {}
- datatable0 set all newKey 20
- set mylist
- } msg] $msg
-} {0 {}}
-
-test datatable.778 {test delete notify} {
- list [catch {
- set mylist {}
- datatable0 unset all newKey
- set mylist
- } msg] $msg
-} {0 {}}
-
-test datatable.779 {test delete notify} {
- list [catch {
- set mylist {}
- datatable0 unset all newKey
- set mylist
- } msg] $msg
-} {0 {}}
-
-test datatable.780 {datatable0 copy} {
- list [catch {datatable0 copy} msg] $msg
-} {1 {wrong # args: should be "datatable0 copy srcNode ?destDatatable? destNode ?switches?"}}
-
-test datatable.781 {datatable0 copy root} {
- list [catch {datatable0 copy root} msg] $msg
-} {1 {wrong # args: should be "datatable0 copy srcNode ?destDatatable? destNode ?switches?"}}
-
-test datatable.782 {datatable0 copy root 14} {
- list [catch {datatable0 copy root 14} msg] $msg
-} {0 23}
-
-test datatable.783 {datatable0 copy 14 root} {
- list [catch {datatable0 copy 14 root} msg] $msg
-} {0 24}
-
-test datatable.784 {datatable0 copy root 14 -recurse} {
- list [catch {datatable0 copy root 14 -recurse} msg] $msg
-} {1 {can't make cyclic copy: source node is an ancestor of the destination}}
-
-test datatable.785 {datatable0 copy 2 3 -recurse -tags} {
- list [catch {datatable0 copy 2 3 -recurse -tags} msg] $msg
-} {0 25}
-
-test datatable.786 {datatable0 copy 2 3 -recurse -overwrite} {
- list [catch {
- blt::datatable create datatable1
- foreach node [datatable0 children root] {
- datatable0 copy $node datatable1 root -recurse
- }
- foreach node [datatable0 children root] {
- datatable0 copy $node datatable1 root -recurse
- }
- datatable1 dump root
- } msg] $msg
-} {0 {-1 0 {::datatable1} {} {}
-0 1 {::datatable1 node2} {key1 myValue} {}
-1 2 {::datatable1 node2 node1} {key1 myValue} {}
-2 3 {::datatable1 node2 node1 node14} {key1 myValue} {}
-3 4 {::datatable1 node2 node1 node14 node16} {key1 123 key2 abc} {}
-4 5 {::datatable1 node2 node1 node14 node16 node18} {key1 myValue} {}
-5 6 {::datatable1 node2 node1 node14 node16 node18 node20} {key1 myValue} {}
-3 7 {::datatable1 node2 node1 node14 ::datatable0} {key1 myValue} {}
-2 8 {::datatable1 node2 node1 node15} {key1 123} {}
-8 9 {::datatable1 node2 node1 node15 node17} {key1 myValue} {}
-9 10 {::datatable1 node2 node1 node15 node17 node19} {key1 myValue} {}
-10 11 {::datatable1 node2 node1 node15 node17 node19 node21} {key1 myValue} {}
-0 12 {::datatable1 node3} {key1 myValue} {}
-12 13 {::datatable1 node3 node2} {key1 myValue} {}
-13 14 {::datatable1 node3 node2 node1} {key1 myValue} {}
-14 15 {::datatable1 node3 node2 node1 node14} {key1 myValue} {}
-15 16 {::datatable1 node3 node2 node1 node14 node16} {key1 123 key2 abc} {}
-16 17 {::datatable1 node3 node2 node1 node14 node16 node18} {key1 myValue} {}
-17 18 {::datatable1 node3 node2 node1 node14 node16 node18 node20} {key1 myValue} {}
-15 19 {::datatable1 node3 node2 node1 node14 ::datatable0} {key1 myValue} {}
-14 20 {::datatable1 node3 node2 node1 node15} {key1 123} {}
-20 21 {::datatable1 node3 node2 node1 node15 node17} {key1 myValue} {}
-21 22 {::datatable1 node3 node2 node1 node15 node17 node19} {key1 myValue} {}
-22 23 {::datatable1 node3 node2 node1 node15 node17 node19 node21} {key1 myValue} {}
-0 24 {::datatable1 node4} {key1 myValue} {}
-0 25 {::datatable1 node5} {key1 myValue} {}
-25 26 {::datatable1 node5 node13} {key1 myValue} {}
-0 27 {::datatable1 node6} {key1 myValue} {}
-0 28 {::datatable1 node14} {key1 myValue} {}
-0 29 {::datatable1 node2} {key1 myValue} {}
-29 30 {::datatable1 node2 node1} {key1 myValue} {}
-30 31 {::datatable1 node2 node1 node14} {key1 myValue} {}
-31 32 {::datatable1 node2 node1 node14 node16} {key1 123 key2 abc} {}
-32 33 {::datatable1 node2 node1 node14 node16 node18} {key1 myValue} {}
-33 34 {::datatable1 node2 node1 node14 node16 node18 node20} {key1 myValue} {}
-31 35 {::datatable1 node2 node1 node14 ::datatable0} {key1 myValue} {}
-30 36 {::datatable1 node2 node1 node15} {key1 123} {}
-36 37 {::datatable1 node2 node1 node15 node17} {key1 myValue} {}
-37 38 {::datatable1 node2 node1 node15 node17 node19} {key1 myValue} {}
-38 39 {::datatable1 node2 node1 node15 node17 node19 node21} {key1 myValue} {}
-0 40 {::datatable1 node3} {key1 myValue} {}
-40 41 {::datatable1 node3 node2} {key1 myValue} {}
-41 42 {::datatable1 node3 node2 node1} {key1 myValue} {}
-42 43 {::datatable1 node3 node2 node1 node14} {key1 myValue} {}
-43 44 {::datatable1 node3 node2 node1 node14 node16} {key1 123 key2 abc} {}
-44 45 {::datatable1 node3 node2 node1 node14 node16 node18} {key1 myValue} {}
-45 46 {::datatable1 node3 node2 node1 node14 node16 node18 node20} {key1 myValue} {}
-43 47 {::datatable1 node3 node2 node1 node14 ::datatable0} {key1 myValue} {}
-42 48 {::datatable1 node3 node2 node1 node15} {key1 123} {}
-48 49 {::datatable1 node3 node2 node1 node15 node17} {key1 myValue} {}
-49 50 {::datatable1 node3 node2 node1 node15 node17 node19} {key1 myValue} {}
-50 51 {::datatable1 node3 node2 node1 node15 node17 node19 node21} {key1 myValue} {}
-0 52 {::datatable1 node4} {key1 myValue} {}
-0 53 {::datatable1 node5} {key1 myValue} {}
-53 54 {::datatable1 node5 node13} {key1 myValue} {}
-0 55 {::datatable1 node6} {key1 myValue} {}
-0 56 {::datatable1 node14} {key1 myValue} {}
-}}
-
-puts stderr "done testing datatablecmd.tcl"
-
-exit 0
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blt3.0.1/tests/defs b/blt3.0.1/tests/defs
deleted file mode 100644
index e061b97..0000000
--- a/blt3.0.1/tests/defs
+++ /dev/null
@@ -1,97 +0,0 @@
-# This file contains support code for the Tcl test suite. It is
-# normally sourced by the individual files in the test suite before
-# they run their tests. This improved approach to testing was designed
-# and initially implemented by Mary Ann May-Pumphrey of Sun Microsystems.
-
-if ![info exists VERBOSE] {
- set VERBOSE 0
-}
-if ![info exists TESTS] {
- set TESTS {}
-}
-
-# Some of the tests don't work on some system configurations due to
-# configuration quirks, not due to Tk problems; in order to prevent
-# false alarms, these tests are only run in the master source directory
-# at Berkeley. The presence of a file "Berkeley" in this directory is
-# used to indicate that these tests should be run.
-
-set atBerkeley [file exists Berkeley]
-
-proc print_verbose {test_name test_description contents_of_test code answer} {
- puts stdout "\n"
- puts stdout "==== $test_name $test_description"
- puts stdout "==== Contents of test case:"
- puts stdout "$contents_of_test"
- if {$code != 0} {
- if {$code == 1} {
- puts stdout "==== Test generated error:"
- puts stdout $answer
- } elseif {$code == 2} {
- puts stdout "==== Test generated return exception; result was:"
- puts stdout $answer
- } elseif {$code == 3} {
- puts stdout "==== Test generated break exception"
- } elseif {$code == 4} {
- puts stdout "==== Test generated continue exception"
- } else {
- puts stdout "==== Test generated exception $code; message was:"
- puts stdout $answer
- }
- } else {
- puts stdout "==== Result was:"
- puts stdout "$answer"
- }
-}
-
-proc test {test_name test_description contents_of_test passing_results} {
- global VERBOSE
- global TESTS
- if {[string compare $TESTS ""] != 0} then {
- set ok 0
- foreach test $TESTS {
- if [string match $test $test_name] then {
- set ok 1
- break
- }
- }
- if !$ok then return
- }
- set code [catch {uplevel $contents_of_test} answer]
- if {$code != 0} {
- print_verbose $test_name $test_description $contents_of_test \
- $code $answer
- } elseif {[string compare $answer $passing_results] == 0} then {
- if $VERBOSE then {
- print_verbose $test_name $test_description $contents_of_test \
- $code $answer
- puts stdout "++++ $test_name PASSED"
- }
- } else {
- print_verbose $test_name $test_description $contents_of_test \
- $code $answer
- puts stdout "---- Result should have been:"
- puts stdout "$passing_results"
- puts stdout "---- $test_name FAILED"
- }
-}
-
-proc dotests {file args} {
- global TESTS
- set savedTests $TESTS
- set TESTS $args
- source $file
- set TESTS $savedTests
-}
-
-# If the main window isn't already mapped (e.g. because the tests are
-# being run automatically) , specify a precise size for it so that the
-# user won't have to position it manually.
-
-if { [llength [info commands tk]] > 0 } {
- if {![winfo ismapped .]} {
- wm geometry . +0+0
- update
- }
-}
-
diff --git a/blt3.0.1/tests/renumber.tcl b/blt3.0.1/tests/renumber.tcl
deleted file mode 100644
index 63a930a..0000000
--- a/blt3.0.1/tests/renumber.tcl
+++ /dev/null
@@ -1,17 +0,0 @@
-set infile [lindex $argv 0]
-set outfile [lindex $argv 1]
-set f [open $infile "r"]
-set data [read $f]
-close $f
-
-set test [file root [file tail $infile]]
-set f [open $outfile "w"]
-set count 1
-set pattern [subst -nocommands {^test ${test}\.[a-z0-9]+ }]
-foreach line [split $data \n] {
- if { [regsub $pattern $line "test ${test}.${count} " line] } {
- incr count
- }
- puts $f $line
-}
-close $f
\ No newline at end of file
diff --git a/blt3.0.1/tests/tree.tcl b/blt3.0.1/tests/tree.tcl
deleted file mode 100644
index a472494..0000000
--- a/blt3.0.1/tests/tree.tcl
+++ /dev/null
@@ -1,2108 +0,0 @@
-
-# Test switches
-#
-# -before, -after, -node for "insert" operation
-#
-
-if {[info procs test] != "test"} {
- source defs
-}
-
-if [file exists ../library] {
- set blt_library ../library
-}
-
-#set VERBOSE 1
-
-test tree.1 {tree no args} {
- list [catch {blt::tree} msg] $msg
-} {1 {wrong # args: should be one of...
- blt::tree create ?name?
- blt::tree destroy name...
- blt::tree load name libpath
- blt::tree names ?pattern?...}}
-
-test tree.2 {tree create #auto} {
- list [catch {blt::tree create #auto} msg] $msg
-} {0 ::tree0}
-
-test tree.3 {tree create #auto.suffix} {
- list [catch {blt::tree create #auto.suffix} msg] $msg
-} {0 ::tree0.suffix}
-
-test tree.4 {tree create prefix.#auto} {
- list [catch {blt::tree create prefix.#auto} msg] $msg
-} {0 ::prefix.tree0}
-
-test tree.5 {tree create prefix.#auto.suffix} {
- list [catch {blt::tree create prefix.#auto.suffix} msg] $msg
-} {0 ::prefix.tree0.suffix}
-
-test tree.6 {tree create prefix.#auto.suffix.#auto} {
- list [catch {blt::tree create prefix.#auto.suffix.#auto} msg] $msg
-} {0 ::prefix.tree0.suffix.#auto}
-
-test tree.7 {tree destroy [tree names *tree0*]} {
- list [catch {eval blt::tree destroy [blt::tree names *tree0*]} msg] $msg
-} {0 {}}
-
-test tree.8 {create} {
- list [catch {blt::tree create} msg] $msg
-} {0 ::tree0}
-
-test tree.9 {create} {
- list [catch {blt::tree create} msg] $msg
-} {0 ::tree1}
-
-test tree.10 {create fred} {
- list [catch {blt::tree create fred} msg] $msg
-} {0 ::fred}
-
-test tree.11 {create fred} {
- list [catch {blt::tree create fred} msg] $msg
-} {1 {a command "::fred" already exists}}
-
-test tree.12 {create if} {
- list [catch {blt::tree create if} msg] $msg
-} {1 {a command "::if" already exists}}
-
-test tree.13 {tree create (bad namespace)} {
- list [catch {blt::tree create badName::fred} msg] $msg
-} {1 {unknown namespace "badName"}}
-
-test tree.14 {tree create (wrong # args)} {
- list [catch {blt::tree create a b} msg] $msg
-} {1 {wrong # args: should be "blt::tree create ?name?"}}
-
-test tree.15 {tree names} {
- list [catch {blt::tree names} msg] [lsort $msg]
-} {0 {::fred ::tree0 ::tree1}}
-
-test tree.16 {tree names pattern)} {
- list [catch {blt::tree names ::tree*} msg] [lsort $msg]
-} {0 {::tree0 ::tree1}}
-
-test tree.17 {tree names badPattern)} {
- list [catch {blt::tree names badPattern*} msg] $msg
-} {0 {}}
-
-test tree.18 {tree names pattern arg (wrong # args)} {
- list [catch {blt::tree names pattern arg} msg] $msg
-} {1 {wrong # args: should be "blt::tree names ?pattern?..."}}
-
-test tree.19 {tree destroy (wrong # args)} {
- list [catch {blt::tree destroy} msg] $msg
-} {1 {wrong # args: should be "blt::tree destroy name..."}}
-
-test tree.20 {tree destroy badTree} {
- list [catch {blt::tree destroy badTree} msg] $msg
-} {1 {can't find a tree named "badTree"}}
-
-test tree.21 {tree destroy fred} {
- list [catch {blt::tree destroy fred} msg] $msg
-} {0 {}}
-
-test tree.22 {tree destroy tree0 tree1} {
- list [catch {blt::tree destroy tree0 tree1} msg] $msg
-} {0 {}}
-
-test tree.23 {create} {
- list [catch {blt::tree create} msg] $msg
-} {0 ::tree0}
-
-test tree.24 {tree0} {
- list [catch {tree0} msg] $msg
-} {1 {wrong # args: should be one of...
- tree0 ancestor node1 node2
- tree0 apply node ?switches?
- tree0 attach tree ?switches?
- tree0 children node ?first? ?last?
- tree0 copy parent ?tree? node ?switches?
- tree0 degree node
- tree0 delete node ?node...?
- tree0 depth node
- tree0 dump node
- tree0 dumpfile node fileName
- tree0 exists node ?key?
- tree0 export format ?switches?
- tree0 find node ?switches?
- tree0 findchild node label
- tree0 firstchild node
- tree0 get node ?key? ?defaultValue?
- tree0 import format ?switches?
- tree0 index label|list
- tree0 insert parent ?switches?
- tree0 is oper args...
- tree0 keys node ?node...?
- tree0 label node ?newLabel?
- tree0 lastchild node
- tree0 move node newParent ?switches?
- tree0 next node
- tree0 nextsibling node
- tree0 notify args...
- tree0 parent node
- tree0 parsepath node string ?separator?
- tree0 path node
- tree0 position ?switches? node...
- tree0 previous node
- tree0 prevsibling node
- tree0 restore node data ?switches?
- tree0 restorefile node fileName ?switches?
- tree0 root
- tree0 set node ?key value...?
- tree0 size node
- tree0 sort node ?flags...?
- tree0 tag args...
- tree0 trace args...
- tree0 type node key
- tree0 unset node ?key...?
- tree0 values node ?key?}}
-
-test tree.25 {tree0 badOp} {
- list [catch {tree0 badOp} msg] $msg
-} {1 {bad operation "badOp": should be one of...
- tree0 ancestor node1 node2
- tree0 apply node ?switches?
- tree0 attach tree ?switches?
- tree0 children node ?first? ?last?
- tree0 copy parent ?tree? node ?switches?
- tree0 degree node
- tree0 delete node ?node...?
- tree0 depth node
- tree0 dump node
- tree0 dumpfile node fileName
- tree0 exists node ?key?
- tree0 export format ?switches?
- tree0 find node ?switches?
- tree0 findchild node label
- tree0 firstchild node
- tree0 get node ?key? ?defaultValue?
- tree0 import format ?switches?
- tree0 index label|list
- tree0 insert parent ?switches?
- tree0 is oper args...
- tree0 keys node ?node...?
- tree0 label node ?newLabel?
- tree0 lastchild node
- tree0 move node newParent ?switches?
- tree0 next node
- tree0 nextsibling node
- tree0 notify args...
- tree0 parent node
- tree0 parsepath node string ?separator?
- tree0 path node
- tree0 position ?switches? node...
- tree0 previous node
- tree0 prevsibling node
- tree0 restore node data ?switches?
- tree0 restorefile node fileName ?switches?
- tree0 root
- tree0 set node ?key value...?
- tree0 size node
- tree0 sort node ?flags...?
- tree0 tag args...
- tree0 trace args...
- tree0 type node key
- tree0 unset node ?key...?
- tree0 values node ?key?}}
-
-test tree.26 {tree0 insert (wrong # args)} {
- list [catch {tree0 insert} msg] $msg
-} {1 {wrong # args: should be "tree0 insert parent ?switches?"}}
-
-test tree.27 {tree0 insert badParent} {
- list [catch {tree0 insert badParent} msg] $msg
-} {1 {can't find tag or id "badParent" in ::tree0}}
-
-test tree.28 {tree0 insert 1000} {
- list [catch {tree0 insert 1000} msg] $msg
-} {1 {can't find tag or id "1000" in ::tree0}}
-
-test tree.29 {tree0 insert 0} {
- list [catch {tree0 insert 0} msg] $msg
-} {0 1}
-
-test tree.30 {tree0 insert 0} {
- list [catch {tree0 insert 0} msg] $msg
-} {0 2}
-
-test tree.31 {tree0 insert root} {
- list [catch {tree0 insert root} msg] $msg
-} {0 3}
-
-test tree.32 {tree0 insert all} {
- list [catch {tree0 insert all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.33 {tree0 insert 0 -at badPosition} {
- list [catch {tree0 insert 0 -at badPosition} msg] $msg
-} {1 {expected integer but got "badPosition"}}
-
-test tree.34 {tree0 insert 0 -at -1} {
- list [catch {tree0 insert 0 -at -1} msg] $msg
-} {1 {bad value "-1": can't be negative}}
-
-test tree.35 {tree0 insert 0 -at 1000} {
- list [catch {tree0 insert 0 -at 1000} msg] $msg
-} {0 4}
-
-test tree.36 {tree0 insert 0 -at (no arg)} {
- list [catch {tree0 insert 0 -at} msg] $msg
-} {1 {value for "-at" missing}}
-
-test tree.37 {tree0 insert 0 -tags myTag} {
- list [catch {tree0 insert 0 -tags myTag} msg] $msg
-} {0 5}
-
-test tree.38 {tree0 insert 0 -tags {myTag1 myTag2} } {
- list [catch {tree0 insert 0 -tags {myTag1 myTag2}} msg] $msg
-} {0 6}
-
-test tree.39 {tree0 insert 0 -tags root} {
- list [catch {tree0 insert 0 -tags root} msg] $msg
-} {1 {can't add reserved tag "root"}}
-
-test tree.40 {tree0 insert 0 -tags (missing arg)} {
- list [catch {tree0 insert 0 -tags} msg] $msg
-} {1 {value for "-tags" missing}}
-
-test tree.41 {tree0 insert 0 -label myLabel -tags thisTag} {
- list [catch {tree0 insert 0 -label myLabel -tags thisTag} msg] $msg
-} {0 8}
-
-test tree.42 {tree0 insert 0 -label (missing arg)} {
- list [catch {tree0 insert 0 -label} msg] $msg
-} {1 {value for "-label" missing}}
-
-test tree.43 {tree0 insert 1 -tags thisTag} {
- list [catch {tree0 insert 1 -tags thisTag} msg] $msg
-} {0 9}
-
-test tree.44 {tree0 insert 1 -data key (missing value)} {
- list [catch {tree0 insert 1 -data key} msg] $msg
-} {1 {missing value for "key"}}
-
-test tree.45 {tree0 insert 1 -data {key value}} {
- list [catch {tree0 insert 1 -data {key value}} msg] $msg
-} {0 11}
-
-test tree.46 {tree0 insert 1 -data {key1 value1 key2 value2}} {
- list [catch {tree0 insert 1 -data {key1 value1 key2 value2}} msg] $msg
-} {0 12}
-
-test tree.47 {get} {
- list [catch {
- tree0 get 12
- } msg] $msg
-} {0 {key1 value1 key2 value2}}
-
-test tree.48 {tree0 children} {
- list [catch {tree0 children} msg] $msg
-} {1 {wrong # args: should be "tree0 children node ?first? ?last?"}}
-
-test tree.49 {tree0 children 0} {
- list [catch {tree0 children 0} msg] $msg
-} {0 {1 2 3 4 5 6 8}}
-
-test tree.50 {tree0 children root} {
- list [catch {tree0 children root} msg] $msg
-} {0 {1 2 3 4 5 6 8}}
-
-test tree.51 {tree0 children 1} {
- list [catch {tree0 children 1} msg] $msg
-} {0 {9 11 12}}
-
-test tree.52 {tree0 insert myTag} {
- list [catch {tree0 insert myTag} msg] $msg
-} {0 13}
-
-test tree.53 {tree0 children myTag} {
- list [catch {tree0 children myTag} msg] $msg
-} {0 13}
-
-test tree.54 {tree0 children root 0 end} {
- list [catch {tree0 children root 0 end} msg] $msg
-} {0 {1 2 3 4 5 6 8}}
-
-test tree.55 {tree0 children root 2} {
- list [catch {tree0 children root 2} msg] $msg
-} {0 3}
-
-test tree.56 {tree0 children root 2 end} {
- list [catch {tree0 children root 2 end} msg] $msg
-} {0 {3 4 5 6 8}}
-
-test tree.57 {tree0 children root end end} {
- list [catch {tree0 children root end end} msg] $msg
-} {0 8}
-
-test tree.58 {tree0 children root 0 2} {
- list [catch {tree0 children root 0 2} msg] $msg
-} {0 {1 2 3}}
-
-test tree.59 {tree0 children root -1 -20} {
- list [catch {tree0 children root -1 -20} msg] $msg
-} {0 {}}
-
-test tree.60 {tree0 firstchild (missing arg)} {
- list [catch {tree0 firstchild} msg] $msg
-} {1 {wrong # args: should be "tree0 firstchild node"}}
-
-test tree.61 {tree0 firstchild root} {
- list [catch {tree0 firstchild root} msg] $msg
-} {0 1}
-
-test tree.62 {tree0 lastchild (missing arg)} {
- list [catch {tree0 lastchild} msg] $msg
-} {1 {wrong # args: should be "tree0 lastchild node"}}
-
-test tree.63 {tree0 lastchild root} {
- list [catch {tree0 lastchild root} msg] $msg
-} {0 8}
-
-test tree.64 {tree0 nextsibling (missing arg)} {
- list [catch {tree0 nextsibling} msg] $msg
-} {1 {wrong # args: should be "tree0 nextsibling node"}}
-
-test tree.65 {tree0 nextsibling 1)} {
- list [catch {tree0 nextsibling 1} msg] $msg
-} {0 2}
-
-test tree.66 {tree0 nextsibling 2)} {
- list [catch {tree0 nextsibling 2} msg] $msg
-} {0 3}
-
-test tree.67 {tree0 nextsibling 3)} {
- list [catch {tree0 nextsibling 3} msg] $msg
-} {0 4}
-
-test tree.68 {tree0 nextsibling 4)} {
- list [catch {tree0 nextsibling 4} msg] $msg
-} {0 5}
-
-test tree.69 {tree0 nextsibling 5)} {
- list [catch {tree0 nextsibling 5} msg] $msg
-} {0 6}
-
-test tree.70 {tree0 nextsibling 6)} {
- list [catch {tree0 nextsibling 6} msg] $msg
-} {0 8}
-
-test tree.71 {tree0 nextsibling 8)} {
- list [catch {tree0 nextsibling 8} msg] $msg
-} {0 -1}
-
-test tree.72 {tree0 nextsibling all)} {
- list [catch {tree0 nextsibling all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.73 {tree0 nextsibling badTag)} {
- list [catch {tree0 nextsibling badTag} msg] $msg
-} {1 {can't find tag or id "badTag" in ::tree0}}
-
-test tree.74 {tree0 nextsibling -1)} {
- list [catch {tree0 nextsibling -1} msg] $msg
-} {1 {can't find tag or id "-1" in ::tree0}}
-
-test tree.75 {tree0 prevsibling 2)} {
- list [catch {tree0 prevsibling 2} msg] $msg
-} {0 1}
-
-test tree.76 {tree0 prevsibling 1)} {
- list [catch {tree0 prevsibling 1} msg] $msg
-} {0 -1}
-
-test tree.77 {tree0 prevsibling -1)} {
- list [catch {tree0 prevsibling -1} msg] $msg
-} {1 {can't find tag or id "-1" in ::tree0}}
-
-test tree.78 {tree0 root)} {
- list [catch {tree0 root} msg] $msg
-} {0 0}
-
-test tree.79 {tree0 root badArg)} {
- list [catch {tree0 root badArgs} msg] $msg
-} {1 {wrong # args: should be "tree0 root "}}
-
-test tree.80 {tree0 parent (missing arg))} {
- list [catch {tree0 parent} msg] $msg
-} {1 {wrong # args: should be "tree0 parent node"}}
-
-test tree.81 {tree0 parent root)} {
- list [catch {tree0 parent root} msg] $msg
-} {0 -1}
-
-test tree.82 {tree0 parent 1)} {
- list [catch {tree0 parent 1} msg] $msg
-} {0 0}
-
-test tree.83 {tree0 parent myTag)} {
- list [catch {tree0 parent myTag} msg] $msg
-} {0 0}
-
-test tree.84 {tree0 next (missing arg))} {
- list [catch {tree0 next} msg] $msg
-} {1 {wrong # args: should be "tree0 next node"}}
-
-
-test tree.85 {tree0 next (extra arg))} {
- list [catch {tree0 next root root} msg] $msg
-} {1 {wrong # args: should be "tree0 next node"}}
-
-test tree.86 {tree0 next root} {
- list [catch {tree0 next root} msg] $msg
-} {0 1}
-
-test tree.87 {tree0 next 1)} {
- list [catch {tree0 next 1} msg] $msg
-} {0 9}
-
-test tree.88 {tree0 next 2)} {
- list [catch {tree0 next 2} msg] $msg
-} {0 3}
-
-test tree.89 {tree0 next 3)} {
- list [catch {tree0 next 3} msg] $msg
-} {0 4}
-
-test tree.90 {tree0 next 4)} {
- list [catch {tree0 next 4} msg] $msg
-} {0 5}
-
-test tree.91 {tree0 next 5)} {
- list [catch {tree0 next 5} msg] $msg
-} {0 13}
-
-test tree.92 {tree0 next 6)} {
- list [catch {tree0 next 6} msg] $msg
-} {0 8}
-
-test tree.93 {tree0 next 8)} {
- list [catch {tree0 next 8} msg] $msg
-} {0 -1}
-
-test tree.94 {tree0 previous 1)} {
- list [catch {tree0 previous 1} msg] $msg
-} {0 0}
-
-test tree.95 {tree0 previous 0)} {
- list [catch {tree0 previous 0} msg] $msg
-} {0 -1}
-
-test tree.96 {tree0 previous 8)} {
- list [catch {tree0 previous 8} msg] $msg
-} {0 6}
-
-test tree.97 {tree0 depth (no arg))} {
- list [catch {tree0 depth} msg] $msg
-} {1 {wrong # args: should be "tree0 depth node"}}
-
-test tree.98 {tree0 depth root))} {
- list [catch {tree0 depth root} msg] $msg
-} {0 0}
-
-test tree.99 {tree0 depth myTag))} {
- list [catch {tree0 depth myTag} msg] $msg
-} {0 1}
-
-test tree.100 {tree0 depth myTag))} {
- list [catch {tree0 depth myTag} msg] $msg
-} {0 1}
-
-test tree.101 {tree0 dump (missing arg)))} {
- list [catch {tree0 dump} msg] $msg
-} {1 {wrong # args: should be "tree0 dump node"}}
-
-test tree.102 {tree0 dump root} {
- list [catch {tree0 dump root} msg] $msg
-} {0 {-1 0 {{}} {} {}
-0 1 {{} node1} {} {}
-1 9 {{} node1 node9} {} {thisTag}
-1 11 {{} node1 node11} {key value} {}
-1 12 {{} node1 node12} {key1 value1 key2 value2} {}
-0 2 {{} node2} {} {}
-0 3 {{} node3} {} {}
-0 4 {{} node4} {} {}
-0 5 {{} node5} {} {myTag}
-5 13 {{} node5 node13} {} {}
-0 6 {{} node6} {} {myTag2 myTag1}
-0 8 {{} myLabel} {} {thisTag}
-}}
-
-test tree.103 {tree0 dump 1} {
- list [catch {tree0 dump 1} msg] $msg
-} {0 {-1 1 {node1} {} {}
-1 9 {node1 node9} {} {thisTag}
-1 11 {node1 node11} {key value} {}
-1 12 {node1 node12} {key1 value1 key2 value2} {}
-}}
-
-test tree.104 {tree0 dump this} {
- list [catch {tree0 dump myTag} msg] $msg
-} {0 {-1 5 {node5} {} {myTag}
-5 13 {node5 node13} {} {}
-}}
-
-test tree.105 {tree0 dump 1 badArg (too many args)} {
- list [catch {tree0 dump 1 badArg} msg] $msg
-} {1 {wrong # args: should be "tree0 dump node"}}
-
-test tree.106 {tree0 dump 11} {
- list [catch {tree0 dump 11} msg] $msg
-} {0 {-1 11 {node11} {key value} {}
-}}
-
-test tree.107 {tree0 dump all} {
- list [catch {tree0 dump all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.108 {tree0 dump all} {
- list [catch {tree0 dump all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.109 {tree0 dumpfile 0 test.dump} {
- list [catch {tree0 dumpfile 0 test.dump} msg] $msg
-} {0 {}}
-
-test tree.110 {tree0 get 9} {
- list [catch {tree0 get 9} msg] $msg
-} {0 {}}
-
-test tree.111 {tree0 get all} {
- list [catch {tree0 get all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.112 {tree0 get root} {
- list [catch {tree0 get root} msg] $msg
-} {0 {}}
-
-test tree.113 {tree0 get 9 key} {
- list [catch {tree0 get root} msg] $msg
-} {0 {}}
-
-test tree.114 {tree0 get 12} {
- list [catch {tree0 get 12} msg] $msg
-} {0 {key1 value1 key2 value2}}
-
-test tree.115 {tree0 get 12 key1} {
- list [catch {tree0 get 12 key1} msg] $msg
-} {0 value1}
-
-test tree.116 {tree0 get 12 key2} {
- list [catch {tree0 get 12 key2} msg] $msg
-} {0 value2}
-
-test tree.117 {tree0 get 12 key1 defValue } {
- list [catch {tree0 get 12 key1 defValue} msg] $msg
-} {0 value1}
-
-test tree.118 {tree0 get 12 key100 defValue } {
- list [catch {tree0 get 12 key100 defValue} msg] $msg
-} {0 defValue}
-
-test tree.119 {tree0 index (missing arg) } {
- list [catch {tree0 index} msg] $msg
-} {1 {wrong # args: should be "tree0 index label|list"}}
-
-test tree.120 {tree0 index 0 10 (extra arg) } {
- list [catch {tree0 index 0 10} msg] $msg
-} {1 {wrong # args: should be "tree0 index label|list"}}
-
-test tree.121 {tree0 index 0} {
- list [catch {tree0 index 0} msg] $msg
-} {0 0}
-
-test tree.122 {tree0 index root} {
- list [catch {tree0 index root} msg] $msg
-} {0 0}
-
-test tree.123 {tree0 index all} {
- list [catch {tree0 index all} msg] $msg
-} {0 -1}
-
-test tree.124 {tree0 index myTag} {
- list [catch {tree0 index myTag} msg] $msg
-} {0 5}
-
-test tree.125 {tree0 index thisTag} {
- list [catch {tree0 index thisTag} msg] $msg
-} {0 -1}
-
-test tree.126 {tree0 is (no args)} {
- list [catch {tree0 is} msg] $msg
-} {1 {wrong # args: should be one of...
- tree0 is ancestor node1 node2
- tree0 is before node1 node2
- tree0 is leaf node
- tree0 is root node}}
-
-test tree.127 {tree0 is badOp} {
- list [catch {tree0 is badOp} msg] $msg
-} {1 {bad operation "badOp": should be one of...
- tree0 is ancestor node1 node2
- tree0 is before node1 node2
- tree0 is leaf node
- tree0 is root node}}
-
-test tree.128 {tree0 is before} {
- list [catch {tree0 is before} msg] $msg
-} {1 {wrong # args: should be "tree0 is before node1 node2"}}
-
-test tree.129 {tree0 is before 0 10 20} {
- list [catch {tree0 is before 0 10 20} msg] $msg
-} {1 {wrong # args: should be "tree0 is before node1 node2"}}
-
-test tree.130 {tree0 is before 0 12} {
- list [catch {tree0 is before 0 12} msg] $msg
-} {0 1}
-
-test tree.131 {tree0 is before 12 0} {
- list [catch {tree0 is before 12 0} msg] $msg
-} {0 0}
-
-test tree.132 {tree0 is before 0 0} {
- list [catch {tree0 is before 0 0} msg] $msg
-} {0 0}
-
-test tree.133 {tree0 is before root 0} {
- list [catch {tree0 is before root 0} msg] $msg
-} {0 0}
-
-test tree.134 {tree0 is before 0 all} {
- list [catch {tree0 is before 0 all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.135 {tree0 is ancestor} {
- list [catch {tree0 is ancestor} msg] $msg
-} {1 {wrong # args: should be "tree0 is ancestor node1 node2"}}
-
-test tree.136 {tree0 is ancestor 0 12 20} {
- list [catch {tree0 is ancestor 0 12 20} msg] $msg
-} {1 {wrong # args: should be "tree0 is ancestor node1 node2"}}
-
-test tree.137 {tree0 is ancestor 0 12} {
- list [catch {tree0 is ancestor 0 12} msg] $msg
-} {0 1}
-
-test tree.138 {tree0 is ancestor 12 0} {
- list [catch {tree0 is ancestor 12 0} msg] $msg
-} {0 0}
-
-test tree.139 {tree0 is ancestor 1 2} {
- list [catch {tree0 is ancestor 1 2} msg] $msg
-} {0 0}
-
-test tree.140 {tree0 is ancestor root 0} {
- list [catch {tree0 is ancestor root 0} msg] $msg
-} {0 0}
-
-test tree.141 {tree0 is ancestor 0 all} {
- list [catch {tree0 is ancestor 0 all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.142 {tree0 is root (missing arg)} {
- list [catch {tree0 is root} msg] $msg
-} {1 {wrong # args: should be "tree0 is root node"}}
-
-test tree.143 {tree0 is root 0 20 (extra arg)} {
- list [catch {tree0 is root 0 20} msg] $msg
-} {1 {wrong # args: should be "tree0 is root node"}}
-
-test tree.144 {tree0 is root 0} {
- list [catch {tree0 is root 0} msg] $msg
-} {0 1}
-
-test tree.145 {tree0 is root 12} {
- list [catch {tree0 is root 12} msg] $msg
-} {0 0}
-
-test tree.146 {tree0 is root 1} {
- list [catch {tree0 is root 1} msg] $msg
-} {0 0}
-
-test tree.147 {tree0 is root root} {
- list [catch {tree0 is root root} msg] $msg
-} {0 1}
-
-test tree.148 {tree0 is root all} {
- list [catch {tree0 is root all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.149 {tree0 is leaf (missing arg)} {
- list [catch {tree0 is leaf} msg] $msg
-} {1 {wrong # args: should be "tree0 is leaf node"}}
-
-test tree.150 {tree0 is leaf 0 20 (extra arg)} {
- list [catch {tree0 is leaf 0 20} msg] $msg
-} {1 {wrong # args: should be "tree0 is leaf node"}}
-
-test tree.151 {tree0 is leaf 0} {
- list [catch {tree0 is leaf 0} msg] $msg
-} {0 0}
-
-test tree.152 {tree0 is leaf 12} {
- list [catch {tree0 is leaf 12} msg] $msg
-} {0 1}
-
-test tree.153 {tree0 is leaf 1} {
- list [catch {tree0 is leaf 1} msg] $msg
-} {0 0}
-
-test tree.154 {tree0 is leaf root} {
- list [catch {tree0 is leaf root} msg] $msg
-} {0 0}
-
-test tree.155 {tree0 is leaf all} {
- list [catch {tree0 is leaf all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.156 {tree0 is leaf 1000} {
- list [catch {tree0 is leaf 1000} msg] $msg
-} {1 {can't find tag or id "1000" in ::tree0}}
-
-test tree.157 {tree0 is leaf badTag} {
- list [catch {tree0 is leaf badTag} msg] $msg
-} {1 {can't find tag or id "badTag" in ::tree0}}
-
-test tree.158 {tree0 set (missing arg)} {
- list [catch {tree0 set} msg] $msg
-} {1 {wrong # args: should be "tree0 set node ?key value...?"}}
-
-test tree.159 {tree0 set 0 (missing arg)} {
- list [catch {tree0 set 0} msg] $msg
-} {0 {}}
-
-test tree.160 {tree0 set 0 key (missing arg)} {
- list [catch {tree0 set 0 key} msg] $msg
-} {1 {missing value for field "key"}}
-
-test tree.161 {tree0 set 0 key value} {
- list [catch {tree0 set 0 key value} msg] $msg
-} {0 {}}
-
-test tree.162 {tree0 set 0 key1 value1 key2 value2 key3 value3} {
- list [catch {tree0 set 0 key1 value1 key2 value2 key3 value3} msg] $msg
-} {0 {}}
-
-test tree.163 {tree0 set 0 key1 value1 key2 (missing arg)} {
- list [catch {tree0 set 0 key1 value1 key2} msg] $msg
-} {1 {missing value for field "key2"}}
-
-test tree.164 {tree0 set 0 key value} {
- list [catch {tree0 set 0 key value} msg] $msg
-} {0 {}}
-
-test tree.165 {tree0 set 0 key1 value1 key2 (missing arg)} {
- list [catch {tree0 set 0 key1 value1 key2} msg] $msg
-} {1 {missing value for field "key2"}}
-
-test tree.166 {tree0 set all} {
- list [catch {tree0 set all} msg] $msg
-} {0 {}}
-
-test tree.167 {tree0 set all abc 123} {
- list [catch {tree0 set all abc 123} msg] $msg
-} {0 {}}
-
-test tree.168 {tree0 set root} {
- list [catch {tree0 set root} msg] $msg
-} {0 {}}
-
-test tree.169 {tree0 restore stuff} {
- list [catch {
- set data [tree0 dump root]
- blt::tree create
- tree1 restore root $data
- set data [tree1 dump root]
- blt::tree destroy tree1
- set data
- } msg] $msg
-} {0 {-1 0 {{}} {key value key1 value1 key2 value2 key3 value3 abc 123} {}
-0 1 {{} node1} {abc 123} {}
-1 9 {{} node1 node9} {abc 123} {thisTag}
-1 11 {{} node1 node11} {key value abc 123} {}
-1 12 {{} node1 node12} {key1 value1 key2 value2 abc 123} {}
-0 2 {{} node2} {abc 123} {}
-0 3 {{} node3} {abc 123} {}
-0 4 {{} node4} {abc 123} {}
-0 5 {{} node5} {abc 123} {myTag}
-5 13 {{} node5 node13} {abc 123} {}
-0 6 {{} node6} {abc 123} {myTag2 myTag1}
-0 8 {{} myLabel} {abc 123} {thisTag}
-}}
-
-test tree.170 {tree0 restorefile 0 test.dump} {
- list [catch {
- blt::tree create
- tree1 restorefile root test.dump
- set data [tree1 dump root]
- blt::tree destroy tree1
- file delete test.dump
- set data
- } msg] $msg
-} {0 {-1 0 {{}} {} {}
-0 1 {{} node1} {} {}
-1 9 {{} node1 node9} {} {thisTag}
-1 11 {{} node1 node11} {key value} {}
-1 12 {{} node1 node12} {key1 value1 key2 value2} {}
-0 2 {{} node2} {} {}
-0 3 {{} node3} {} {}
-0 4 {{} node4} {} {}
-0 5 {{} node5} {} {myTag}
-5 13 {{} node5 node13} {} {}
-0 6 {{} node6} {} {myTag2 myTag1}
-0 8 {{} myLabel} {} {thisTag}
-}}
-
-
-test tree.171 {tree0 unset 0 key1} {
- list [catch {tree0 unset 0 key1} msg] $msg
-} {0 {}}
-
-test tree.172 {tree0 get 0} {
- list [catch {tree0 get 0} msg] $msg
-} {0 {key value key2 value2 key3 value3 abc 123}}
-
-test tree.173 {tree0 unset 0 key2 key3} {
- list [catch {tree0 unset 0 key2 key3} msg] $msg
-} {0 {}}
-
-test tree.174 {tree0 get 0} {
- list [catch {tree0 get 0} msg] $msg
-} {0 {key value abc 123}}
-
-test tree.175 {tree0 unset 0} {
- list [catch {tree0 unset 0} msg] $msg
-} {0 {}}
-
-test tree.176 {tree0 get 0} {
- list [catch {tree0 get 0} msg] $msg
-} {0 {}}
-
-test tree.177 {tree0 unset all abc} {
- list [catch {tree0 unset all abc} msg] $msg
-} {0 {}}
-
-test tree.178 {tree0 restore stuff} {
- list [catch {
- set data [tree0 dump root]
- blt::tree create tree1
- tree1 restore root $data
- set data [tree1 dump root]
- blt::tree destroy tree1
- set data
- } msg] $msg
-} {0 {-1 0 {{}} {} {}
-0 1 {{} node1} {} {}
-1 9 {{} node1 node9} {} {thisTag}
-1 11 {{} node1 node11} {key value} {}
-1 12 {{} node1 node12} {key1 value1 key2 value2} {}
-0 2 {{} node2} {} {}
-0 3 {{} node3} {} {}
-0 4 {{} node4} {} {}
-0 5 {{} node5} {} {myTag}
-5 13 {{} node5 node13} {} {}
-0 6 {{} node6} {} {myTag2 myTag1}
-0 8 {{} myLabel} {} {thisTag}
-}}
-
-test tree.179 {tree0 restore (missing arg)} {
- list [catch {tree0 restore} msg] $msg
-} {1 {wrong # args: should be "tree0 restore node data ?switches?"}}
-
-test tree.180 {tree0 restore 0 badString} {
- list [catch {tree0 restore 0 badString} msg] $msg
-} {1 {line #1: wrong # elements in restore entry}}
-
-test tree.181 {tree0 restore 0 {} arg (extra arg)} {
- list [catch {tree0 restore 0 {} arg} msg] $msg
-} {1 {unknown switch "arg"
-following switches are available:
- -notags
- -overwrite }}
-
-
-test tree.182 {tree0 size (missing arg)} {
- list [catch {tree0 size} msg] $msg
-} {1 {wrong # args: should be "tree0 size node"}}
-
-test tree.183 {tree0 size 0} {
- list [catch {tree0 size 0} msg] $msg
-} {0 12}
-
-test tree.184 {tree0 size all} {
- list [catch {tree0 size all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.185 {tree0 size 0 10 (extra arg)} {
- list [catch {tree0 size 0 10} msg] $msg
-} {1 {wrong # args: should be "tree0 size node"}}
-
-test tree.186 {tree0 delete (no args)} {
- list [catch {tree0 delete} msg] $msg
-} {0 {}}
-
-test tree.187 {tree0 delete 11} {
- list [catch {tree0 delete 11} msg] $msg
-} {0 {}}
-
-test tree.188 {tree0 delete 11} {
- list [catch {tree0 delete 11} msg] $msg
-} {1 {can't find tag or id "11" in ::tree0}}
-
-test tree.189 {tree0 delete 9 12} {
- list [catch {tree0 delete 9 12} msg] $msg
-} {0 {}}
-
-test tree.190 {tree0 dump 0} {
- list [catch {tree0 dump 0} msg] $msg
-} {0 {-1 0 {{}} {} {}
-0 1 {{} node1} {} {}
-0 2 {{} node2} {} {}
-0 3 {{} node3} {} {}
-0 4 {{} node4} {} {}
-0 5 {{} node5} {} {myTag}
-5 13 {{} node5 node13} {} {}
-0 6 {{} node6} {} {myTag2 myTag1}
-0 8 {{} myLabel} {} {thisTag}
-}}
-
-test tree.191 {delete all} {
- list [catch {
- set data [tree0 dump root]
- blt::tree create
- tree1 restore root $data
- tree1 delete all
- set data [tree1 dump root]
- blt::tree destroy tree1
- set data
- } msg] $msg
-} {0 {-1 0 {{}} {} {}
-}}
-
-test tree.192 {delete all all} {
- list [catch {
- set data [tree0 dump root]
- blt::tree create
- tree1 restore root $data
- tree1 delete all all
- set data [tree1 dump root]
- blt::tree destroy tree1
- set data
- } msg] $msg
-} {0 {-1 0 {{}} {} {}
-}}
-
-test tree.193 {tree0 apply (missing arg)} {
- list [catch {tree0 apply} msg] $msg
-} {1 {wrong # args: should be "tree0 apply node ?switches?"}}
-
-test tree.194 {tree0 apply 0} {
- list [catch {tree0 apply 0} msg] $msg
-} {0 {}}
-
-test tree.195 {tree0 apply 0 -badSwitch} {
- list [catch {tree0 apply 0 -badSwitch} msg] $msg
-} {1 {unknown switch "-badSwitch"
-following switches are available:
- -precommand command
- -postcommand command
- -depth number
- -exact string
- -glob pattern
- -invert
- -key pattern
- -keyexact string
- -keyglob pattern
- -keyregexp pattern
- -leafonly
- -nocase
- -path
- -regexp pattern
- -tag {?tag?...}}}
-
-
-test tree.196 {tree0 apply badTag} {
- list [catch {tree0 apply badTag} msg] $msg
-} {1 {can't find tag or id "badTag" in ::tree0}}
-
-test tree.197 {tree0 apply all} {
- list [catch {tree0 apply all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.198 {tree0 apply myTag -precommand lappend} {
- list [catch {
- set mylist {}
- tree0 apply myTag -precommand {lappend mylist}
- set mylist
- } msg] $msg
-} {0 {5 13}}
-
-test tree.199 {tree0 apply root -precommand lappend} {
- list [catch {
- set mylist {}
- tree0 apply root -precommand {lappend mylist}
- set mylist
- } msg] $msg
-} {0 {0 1 2 3 4 5 13 6 8}}
-
-test tree.200 {tree0 apply -precommand -postcommand} {
- list [catch {
- set mylist {}
- tree0 apply root -precommand {lappend mylist} \
- -postcommand {lappend mylist}
- set mylist
- } msg] $msg
-} {0 {0 1 1 2 2 3 3 4 4 5 13 13 5 6 6 8 8 0}}
-
-test tree.201 {tree0 apply root -precommand lappend -depth 1} {
- list [catch {
- set mylist {}
- tree0 apply root -precommand {lappend mylist} -depth 1
- set mylist
- } msg] $msg
-} {0 {0 1 2 3 4 5 6 8}}
-
-
-test tree.202 {tree0 apply root -precommand -depth 0} {
- list [catch {
- set mylist {}
- tree0 apply root -precommand {lappend mylist} -depth 0
- set mylist
- } msg] $msg
-} {0 0}
-
-test tree.203 {tree0 apply root -precommand -tag myTag} {
- list [catch {
- set mylist {}
- tree0 apply root -precommand {lappend mylist} -tag myTag
- set mylist
- } msg] $msg
-} {0 5}
-
-
-test tree.204 {tree0 apply root -precommand -key key1} {
- list [catch {
- set mylist {}
- tree0 set myTag key1 0.0
- tree0 apply root -precommand {lappend mylist} -key key1
- tree0 unset myTag key1
- set mylist
- } msg] $msg
-} {0 5}
-
-test tree.205 {tree0 apply root -postcommand -regexp node.*} {
- list [catch {
- set mylist {}
- tree0 set myTag key1 0.0
- tree0 apply root -precommand {lappend mylist} -regexp {node5}
- tree0 unset myTag key1
- set mylist
- } msg] $msg
-} {0 5}
-
-test tree.206 {tree0 find (missing arg)} {
- list [catch {tree0 find} msg] $msg
-} {1 {wrong # args: should be "tree0 find node ?switches?"}}
-
-test tree.207 {tree0 find 0} {
- list [catch {tree0 find 0} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test tree.208 {tree0 find root} {
- list [catch {tree0 find root} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test tree.209 {tree0 find 0 -glob node*} {
- list [catch {tree0 find root -glob node*} msg] $msg
-} {0 {1 2 3 4 13 5 6}}
-
-test tree.210 {tree0 find 0 -glob nobody} {
- list [catch {tree0 find root -glob nobody} msg] $msg
-} {0 {}}
-
-test tree.211 {tree0 find 0 -regexp {node[0-3]}} {
- list [catch {tree0 find root -regexp {node[0-3]}} msg] $msg
-} {0 {1 2 3 13}}
-
-test tree.212 {tree0 find 0 -regexp {.*[A-Z].*}} {
- list [catch {tree0 find root -regexp {.*[A-Z].*}} msg] $msg
-} {0 8}
-
-test tree.213 {tree0 find 0 -exact myLabel} {
- list [catch {tree0 find root -exact myLabel} msg] $msg
-} {0 8}
-
-test tree.214 {tree0 find 0 -exact myLabel -invert} {
- list [catch {tree0 find root -exact myLabel -invert} msg] $msg
-} {0 {1 2 3 4 13 5 6 0}}
-
-
-test tree.215 {tree0 find 3 -exact node3} {
- list [catch {tree0 find 3 -exact node3} msg] $msg
-} {0 3}
-
-test tree.216 {tree0 find 0 -nocase -exact mylabel} {
- list [catch {tree0 find 0 -nocase -exact mylabel} msg] $msg
-} {0 8}
-
-test tree.217 {tree0 find 0 -nocase} {
- list [catch {tree0 find 0 -nocase} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test tree.218 {tree0 find 0 -path -nocase -glob *node1* } {
- list [catch {tree0 find 0 -path -nocase -glob *node1*} msg] $msg
-} {0 {1 13}}
-
-test tree.219 {tree0 find 0 -count 5 } {
- list [catch {tree0 find 0 -count 5} msg] $msg
-} {0 {1 2 3 4 13}}
-
-test tree.220 {tree0 find 0 -count -5 } {
- list [catch {tree0 find 0 -count -5} msg] $msg
-} {1 {bad value "-5": can't be negative}}
-
-test tree.221 {tree0 find 0 -count badValue } {
- list [catch {tree0 find 0 -count badValue} msg] $msg
-} {1 {expected integer but got "badValue"}}
-
-test tree.222 {tree0 find 0 -count badValue } {
- list [catch {tree0 find 0 -count badValue} msg] $msg
-} {1 {expected integer but got "badValue"}}
-
-test tree.223 {tree0 find 0 -leafonly} {
- list [catch {tree0 find 0 -leafonly} msg] $msg
-} {0 {1 2 3 4 13 6 8}}
-
-test tree.224 {tree0 find 0 -leafonly -glob {node[18]}} {
- list [catch {tree0 find 0 -glob {node[18]} -leafonly} msg] $msg
-} {0 1}
-
-test tree.225 {tree0 find 0 -depth 0} {
- list [catch {tree0 find 0 -depth 0} msg] $msg
-} {0 0}
-
-test tree.226 {tree0 find 0 -depth 1} {
- list [catch {tree0 find 0 -depth 1} msg] $msg
-} {0 {1 2 3 4 5 6 8 0}}
-
-test tree.227 {tree0 find 0 -depth 2} {
- list [catch {tree0 find 0 -depth 2} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test tree.228 {tree0 find 0 -depth 20} {
- list [catch {tree0 find 0 -depth 20} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test tree.229 {tree0 find 1 -depth 0} {
- list [catch {tree0 find 1 -depth 0} msg] $msg
-} {0 1}
-
-test tree.230 {tree0 find 1 -depth 1} {
- list [catch {tree0 find 1 -depth 1} msg] $msg
-} {0 1}
-
-test tree.231 {tree0 find 1 -depth 2} {
- list [catch {tree0 find 1 -depth 2} msg] $msg
-} {0 1}
-
-test tree.232 {tree0 find all} {
- list [catch {tree0 find all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.233 {tree0 find badTag} {
- list [catch {tree0 find badTag} msg] $msg
-} {1 {can't find tag or id "badTag" in ::tree0}}
-
-test tree.234 {tree0 find 0 -addtag hi} {
- list [catch {tree0 find 0 -addtag hi} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test tree.235 {tree0 find 0 -addtag all} {
- list [catch {tree0 find 0 -addtag all} msg] $msg
-} {0 {1 2 3 4 13 5 6 8 0}}
-
-test tree.236 {tree0 find 0 -addtag root} {
- list [catch {tree0 find 0 -addtag root} msg] $msg
-} {1 {can't add reserved tag "root"}}
-
-test tree.237 {tree0 find 0 -exec {lappend list} -leafonly} {
- list [catch {
- set list {}
- tree0 find 0 -exec {lappend list} -leafonly
- set list
- } msg] $msg
-} {0 {1 2 3 4 13 6 8}}
-
-test tree.238 {tree0 find 0 -tag root} {
- list [catch {tree0 find 0 -tag root} msg] $msg
-} {0 0}
-
-test tree.239 {tree0 find 0 -tag myTag} {
- list [catch {tree0 find 0 -tag myTag} msg] $msg
-} {0 5}
-
-test tree.240 {tree0 find 0 -tag badTag} {
- list [catch {tree0 find 0 -tag badTag} msg] $msg
-} {0 {}}
-
-test tree.241 {tree0 tag (missing args)} {
- list [catch {tree0 tag} msg] $msg
-} {1 {wrong # args: should be "tree0 tag args..."}}
-
-test tree.242 {tree0 tag badOp} {
- list [catch {tree0 tag badOp} msg] $msg
-} {1 {bad operation "badOp": should be one of...
- tree0 tag add tag ?node...?
- tree0 tag delete tag node...
- tree0 tag dump tag...
- tree0 tag exists tag ?node?
- tree0 tag forget tag...
- tree0 tag get node ?pattern...?
- tree0 tag names ?node...?
- tree0 tag nodes tag ?tag...?
- tree0 tag set node tag...
- tree0 tag unset node tag...}}
-
-test tree.243 {tree0 tag add} {
- list [catch {tree0 tag add} msg] $msg
-} {1 {wrong # args: should be "tree0 tag add tag ?node...?"}}
-
-test tree.244 {tree0 tag add newTag} {
- list [catch {tree0 tag add newTag} msg] $msg
-} {0 {}}
-
-test tree.245 {tree0 tag add tag badNode} {
- list [catch {tree0 tag add tag badNode} msg] $msg
-} {1 {can't find tag or id "badNode" in ::tree0}}
-
-test tree.246 {tree0 tag add newTag root} {
- list [catch {tree0 tag add newTag root} msg] $msg
-} {0 {}}
-
-test tree.247 {tree0 tag add newTag all} {
- list [catch {tree0 tag add newTag all} msg] $msg
-} {0 {}}
-
-test tree.248 {tree0 tag add tag2 0 1 2 3 4} {
- list [catch {tree0 tag add tag2 0 1 2 3 4} msg] $msg
-} {0 {}}
-
-test tree.248 {tree0 tag exists tag2} {
- list [catch {tree0 tag exists tag2} msg] $msg
-} {0 1}
-
-test tree.248 {tree0 tag exists tag2 0} {
- list [catch {tree0 tag exists tag2 0} msg] $msg
-} {0 1}
-
-test tree.248 {tree0 tag exists tag2 5} {
- list [catch {tree0 tag exists tag2 5} msg] $msg
-} {0 0}
-
-test tree.248 {tree0 tag exists badTag} {
- list [catch {tree0 tag exists badTag} msg] $msg
-} {0 0}
-
-test tree.248 {tree0 tag exists badTag 1000} {
- list [catch {tree0 tag exists badTag 1000} msg] $msg
-} {1 {can't find tag or id "1000" in ::tree0}}
-
-test tree.249 {tree0 tag add tag2 0 1 2 3 4 1000} {
- list [catch {tree0 tag add tag2 0 1 2 3 4 1000} msg] $msg
-} {1 {can't find tag or id "1000" in ::tree0}}
-
-test tree.250 {tree0 tag names} {
- list [catch {tree0 tag names} msg] [lsort $msg]
-} {0 {all hi myTag myTag1 myTag2 newTag root tag2 thisTag}}
-
-test tree.251 {tree0 tag names badNode} {
- list [catch {tree0 tag names badNode} msg] $msg
-} {1 {can't find tag or id "badNode" in ::tree0}}
-
-test tree.252 {tree0 tag names all} {
- list [catch {tree0 tag names all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.253 {tree0 tag names root} {
- list [catch {tree0 tag names root} msg] [lsort $msg]
-} {0 {all hi newTag root tag2}}
-
-test tree.254 {tree0 tag names 0 1} {
- list [catch {tree0 tag names 0 1} msg] [lsort $msg]
-} {0 {all hi newTag root tag2}}
-
-test tree.255 {tree0 tag nodes (missing arg)} {
- list [catch {tree0 tag nodes} msg] $msg
-} {1 {wrong # args: should be "tree0 tag nodes tag ?tag...?"}}
-
-test tree.256 {tree0 tag nodes root badTag} {
- # It's not an error to use bad tag.
- list [catch {tree0 tag nodes root badTag} msg] $msg
-} {0 {}}
-
-test tree.257 {tree0 tag nodes root tag2} {
- list [catch {tree0 tag nodes root tag2} msg] [lsort $msg]
-} {0 {0 1 2 3 4}}
-
-test tree.258 {tree0 ancestor (missing arg)} {
- list [catch {tree0 ancestor} msg] $msg
-} {1 {wrong # args: should be "tree0 ancestor node1 node2"}}
-
-test tree.259 {tree0 ancestor 0 (missing arg)} {
- list [catch {tree0 ancestor 0} msg] $msg
-} {1 {wrong # args: should be "tree0 ancestor node1 node2"}}
-
-test tree.260 {tree0 ancestor 0 10} {
- list [catch {tree0 ancestor 0 10} msg] $msg
-} {1 {can't find tag or id "10" in ::tree0}}
-
-test tree.261 {tree0 ancestor 0 4} {
- list [catch {tree0 ancestor 0 4} msg] $msg
-} {0 0}
-
-test tree.262 {tree0 ancestor 1 8} {
- list [catch {tree0 ancestor 1 8} msg] $msg
-} {0 0}
-
-test tree.263 {tree0 ancestor root 0} {
- list [catch {tree0 ancestor root 0} msg] $msg
-} {0 0}
-
-test tree.264 {tree0 ancestor 8 8} {
- list [catch {tree0 ancestor 8 8} msg] $msg
-} {0 8}
-
-test tree.265 {tree0 ancestor 0 all} {
- list [catch {tree0 ancestor 0 all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.266 {tree0 ancestor 7 9} {
- list [catch {
- set n1 1; set n2 1;
- for { set i 0 } { $i < 4 } { incr i } {
- set n1 [tree0 insert $n1]
- set n2 [tree0 insert $n2]
- }
- tree0 ancestor $n1 $n2
- } msg] $msg
-} {0 1}
-
-test tree.267 {tree0 path (missing arg)} {
- list [catch {tree0 path} msg] $msg
-} {1 {wrong # args: should be "tree0 path node"}}
-
-test tree.268 {tree0 path root} {
- list [catch {tree0 path root} msg] $msg
-} {0 {}}
-
-test tree.269 {tree0 path 0} {
- list [catch {tree0 path 0} msg] $msg
-} {0 {}}
-
-test tree.270 {tree0 path 15} {
- list [catch {tree0 path 15} msg] $msg
-} {0 {node1 node15}}
-
-test tree.271 {tree0 path all} {
- list [catch {tree0 path all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.272 {tree0 path 0 1 2 4 (extra args)} {
- list [catch {tree0 path 0 1 2 4} msg] $msg
-} {1 {wrong # args: should be "tree0 path node"}}
-
-test tree.273 {tree0 tag forget} {
- list [catch {tree0 tag forget} msg] $msg
-} {1 {wrong # args: should be "tree0 tag forget tag..."}}
-
-test tree.274 {tree0 tag forget badTag} {
- list [catch {
- tree0 tag forget badTag
- lsort [tree0 tag names]
- } msg] $msg
-} {0 {all hi myTag myTag1 myTag2 newTag root tag2 thisTag}}
-
-test tree.275 {tree0 tag forget hi} {
- list [catch {
- tree0 tag forget hi
- lsort [tree0 tag names]
- } msg] $msg
-} {0 {all myTag myTag1 myTag2 newTag root tag2 thisTag}}
-
-test tree.276 {tree0 tag forget tag1 tag2} {
- list [catch {
- tree0 tag forget myTag1 myTag2
- lsort [tree0 tag names]
- } msg] $msg
-} {0 {all myTag newTag root tag2 thisTag}}
-
-test tree.277 {tree0 tag forget all} {
- list [catch {
- tree0 tag forget all
- lsort [tree0 tag names]
- } msg] $msg
-} {0 {all myTag newTag root tag2 thisTag}}
-
-test tree.278 {tree0 tag forget root} {
- list [catch {
- tree0 tag forget root
- lsort [tree0 tag names]
- } msg] $msg
-} {0 {all myTag newTag root tag2 thisTag}}
-
-test tree.279 {tree0 tag delete} {
- list [catch {tree0 tag delete} msg] $msg
-} {1 {wrong # args: should be "tree0 tag delete tag node..."}}
-
-test tree.280 {tree0 tag delete tag} {
- list [catch {tree0 tag delete tag} msg] $msg
-} {1 {wrong # args: should be "tree0 tag delete tag node..."}}
-
-test tree.281 {tree0 tag delete tag 0} {
- list [catch {tree0 tag delete tag 0} msg] $msg
-} {0 {}}
-
-test tree.282 {tree0 tag delete root 0} {
- list [catch {tree0 tag delete root 0} msg] $msg
-} {1 {can't delete reserved tag "root"}}
-
-test tree.283 {tree0 move} {
- list [catch {tree0 move} msg] $msg
-} {1 {wrong # args: should be "tree0 move node newParent ?switches?"}}
-
-test tree.284 {tree0 move 0} {
- list [catch {tree0 move 0} msg] $msg
-} {1 {wrong # args: should be "tree0 move node newParent ?switches?"}}
-
-test tree.285 {tree0 move 0 0} {
- list [catch {tree0 move 0 0} msg] $msg
-} {1 {can't move root node}}
-
-test tree.286 {tree0 move 0 badNode} {
- list [catch {tree0 move 0 badNode} msg] $msg
-} {1 {can't find tag or id "badNode" in ::tree0}}
-
-test tree.287 {tree0 move 0 all} {
- list [catch {tree0 move 0 all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.288 {tree0 move 1 0 -before 2} {
- list [catch {
- tree0 move 1 0 -before 2
- tree0 children 0
- } msg] $msg
-} {0 {1 2 3 4 5 6 8}}
-
-test tree.289 {tree0 move 1 0 -after 2} {
- list [catch {
- tree0 move 1 0 -after 2
- tree0 children 0
- } msg] $msg
-} {0 {2 1 3 4 5 6 8}}
-
-test tree.290 {tree0 move 1 2} {
- list [catch {
- tree0 move 1 2
- tree0 children 0
- } msg] $msg
-} {0 {2 3 4 5 6 8}}
-
-test tree.291 {tree0 move 0 2} {
- list [catch {tree0 move 0 2} msg] $msg
-} {1 {can't move root node}}
-
-test tree.292 {tree0 move 1 17} {
- list [catch {tree0 move 1 17} msg] $msg
-} {1 {can't move node: "1" is an ancestor of "17"}}
-
-test tree.293 {tree0 attach} {
- list [catch {tree0 attach} msg] $msg
-} {1 {wrong # args: should be "tree0 attach tree ?switches?"}}
-
-test tree.294 {tree0 attach tree2 badArg} {
- list [catch {tree0 attach tree2 badArg} msg] $msg
-} {1 {unknown switch "badArg"
-following switches are available:
- -newtags }}
-
-
-test tree.295 {tree1 attach tree0 -newtags} {
- list [catch {
- blt::tree create
- tree1 attach tree0 -newtags
- tree1 dump 0
- } msg] $msg
-} {0 {-1 0 {{}} {} {}
-0 2 {{} node2} {} {}
-2 1 {{} node2 node1} {} {}
-1 14 {{} node2 node1 node14} {} {}
-14 16 {{} node2 node1 node14 node16} {} {}
-16 18 {{} node2 node1 node14 node16 node18} {} {}
-18 20 {{} node2 node1 node14 node16 node18 node20} {} {}
-1 15 {{} node2 node1 node15} {} {}
-15 17 {{} node2 node1 node15 node17} {} {}
-17 19 {{} node2 node1 node15 node17 node19} {} {}
-19 21 {{} node2 node1 node15 node17 node19 node21} {} {}
-0 3 {{} node3} {} {}
-0 4 {{} node4} {} {}
-0 5 {{} node5} {} {}
-5 13 {{} node5 node13} {} {}
-0 6 {{} node6} {} {}
-0 8 {{} myLabel} {} {}
-}}
-
-test tree.296 {tree1 attach tree0} {
- list [catch {
- blt::tree create
- tree1 attach tree0
- tree1 dump 0
- } msg] $msg
-} {0 {-1 0 {{}} {} {tag2 newTag}
-0 2 {{} node2} {} {tag2 newTag}
-2 1 {{} node2 node1} {} {tag2 newTag}
-1 14 {{} node2 node1 node14} {} {}
-14 16 {{} node2 node1 node14 node16} {} {}
-16 18 {{} node2 node1 node14 node16 node18} {} {}
-18 20 {{} node2 node1 node14 node16 node18 node20} {} {}
-1 15 {{} node2 node1 node15} {} {}
-15 17 {{} node2 node1 node15 node17} {} {}
-17 19 {{} node2 node1 node15 node17 node19} {} {}
-19 21 {{} node2 node1 node15 node17 node19 node21} {} {}
-0 3 {{} node3} {} {tag2 newTag}
-0 4 {{} node4} {} {tag2 newTag}
-0 5 {{} node5} {} {newTag myTag}
-5 13 {{} node5 node13} {} {newTag}
-0 6 {{} node6} {} {newTag}
-0 8 {{} myLabel} {} {thisTag newTag}
-}}
-
-test tree.297 {tree1 attach ""} {
- list [catch {tree1 attach ""} msg] $msg
-} {0 {}}
-
-
-test tree.298 {blt::tree destroy tree1} {
- list [catch {blt::tree destroy tree1} msg] $msg
-} {0 {}}
-
-test tree.299 {tree0 find root -badSwitch} {
- list [catch {tree0 find root -badSwitch} msg] $msg
-} {1 {unknown switch "-badSwitch"
-following switches are available:
- -addtag tagName
- -count number
- -depth number
- -exact string
- -excludes nodes
- -exec command
- -glob pattern
- -invert
- -key string
- -keyexact string
- -keyglob pattern
- -keyregexp pattern
- -leafonly
- -nocase
- -order order
- -path
- -regexp pattern
- -tag {?tag?...}}}
-
-
-test tree.300 {tree0 find root -order} {
- list [catch {tree0 find root -order} msg] $msg
-} {1 {value for "-order" missing}}
-
-test tree.301 {tree0 find root ...} {
- list [catch {tree0 find root -order preorder -order postorder -order inorder} msg] $msg
-} {0 {20 18 16 14 1 21 19 17 15 2 0 3 4 13 5 6 8}}
-
-test tree.302 {tree0 find root -order preorder} {
- list [catch {tree0 find root -order preorder} msg] $msg
-} {0 {0 2 1 14 16 18 20 15 17 19 21 3 4 5 13 6 8}}
-
-test tree.303 {tree0 find root -order postorder} {
- list [catch {tree0 find root -order postorder} msg] $msg
-} {0 {20 18 16 14 21 19 17 15 1 2 3 4 13 5 6 8 0}}
-
-test tree.304 {tree0 find root -order inorder} {
- list [catch {tree0 find root -order inorder} msg] $msg
-} {0 {20 18 16 14 1 21 19 17 15 2 0 3 4 13 5 6 8}}
-
-test tree.305 {tree0 find root -order breadthfirst} {
- list [catch {tree0 find root -order breadthfirst} msg] $msg
-} {0 {0 2 3 4 5 6 8 1 13 14 15 16 17 18 19 20 21}}
-
-test tree.306 {tree0 set all key1 myValue} {
- list [catch {tree0 set all key1 myValue} msg] $msg
-} {0 {}}
-
-test tree.307 {tree0 set 15 key1 123} {
- list [catch {tree0 set 15 key1 123} msg] $msg
-} {0 {}}
-
-test tree.308 {tree0 set 16 key1 1234 key2 abc} {
- list [catch {tree0 set 16 key1 123 key2 abc} msg] $msg
-} {0 {}}
-
-test tree.309 {tree0 find root -key } {
- list [catch {tree0 find root -key} msg] $msg
-} {1 {value for "-key" missing}}
-
-test tree.310 {tree0 find root -key noKey} {
- list [catch {tree0 find root -key noKey} msg] $msg
-} {0 {}}
-
-test tree.311 {tree0 find root -key key1} {
- list [catch {tree0 find root -key key1} msg] $msg
-} {0 {20 18 16 14 21 19 17 15 1 2 3 4 13 5 6 8 0}}
-
-test tree.312 {tree0 find root -key key2} {
- list [catch {tree0 find root -key key2} msg] $msg
-} {0 16}
-
-test tree.313 {tree0 find root -key key2 -exact notThere } {
- list [catch {tree0 find root -key key2 -exact notThere } msg] $msg
-} {0 {}}
-
-test tree.314 {tree0 find root -key key1 -glob notThere } {
- list [catch {tree0 find root -key key2 -exact notThere } msg] $msg
-} {0 {}}
-
-test tree.315 {tree0 find root -key badKey -regexp notThere } {
- list [catch {tree0 find root -key key2 -exact notThere } msg] $msg
-} {0 {}}
-
-test tree.316 {tree0 find root -key key1 -glob 12*} {
- list [catch {tree0 find root -key key1 -glob 12*} msg] $msg
-} {0 {16 15}}
-
-test tree.317 {tree0 sort} {
- list [catch {tree0 sort} msg] $msg
-} {1 {wrong # args: should be "tree0 sort node ?flags...?"}}
-
-test tree.318 {tree0 sort all} {
- list [catch {tree0 sort all} msg] $msg
-} {1 {more than one node tagged as "all"}}
-
-test tree.319 {tree0 sort -recurse} {
- list [catch {tree0 sort -recurse} msg] $msg
-} {1 {can't find tag or id "-recurse" in ::tree0}}
-
-test tree.320 {tree0 sort 0} {
- list [catch {tree0 sort 0} msg] $msg
-} {0 {8 2 3 4 5 6}}
-
-test tree.321 {tree0 sort 0 -recurse} {
- list [catch {tree0 sort 0 -recurse} msg] $msg
-} {0 {0 8 1 2 3 4 5 6 13 14 15 16 17 18 19 20 21}}
-
-test tree.322 {tree0 sort 0 -decreasing -key} {
- list [catch {tree0 sort 0 -decreasing -key} msg] $msg
-} {1 {value for "-key" missing}}
-
-test tree.323 {tree0 sort 0 -re} {
- list [catch {tree0 sort 0 -re} msg] $msg
-} {1 {ambiguous switch "-re"
-following switches are available:
- -ascii
- -command command
- -decreasing
- -dictionary
- -integer
- -key string
- -path
- -real
- -recurse
- -reorder }}
-
-
-test tree.324 {tree0 sort 0 -decreasing} {
- list [catch {tree0 sort 0 -decreasing} msg] $msg
-} {0 {6 5 4 3 2 8}}
-
-test tree.325 {tree0 sort 0} {
- list [catch {
- set list {}
- foreach n [tree0 sort 0] {
- lappend list [tree0 label $n]
- }
- set list
- } msg] $msg
-} {0 {myLabel node2 node3 node4 node5 node6}}
-
-test tree.326 {tree0 sort 0 -decreasing} {
- list [catch {tree0 sort 0 -decreasing} msg] $msg
-} {0 {6 5 4 3 2 8}}
-
-
-test tree.327 {tree0 sort 0 -decreasing -key} {
- list [catch {tree0 sort 0 -decreasing -key} msg] $msg
-} {1 {value for "-key" missing}}
-
-test tree.328 {tree0 sort 0 -decreasing -key key1} {
- list [catch {tree0 sort 0 -decreasing -key key1} msg] $msg
-} {0 {8 6 5 4 3 2}}
-
-test tree.329 {tree0 sort 0 -decreasing -recurse -key key1} {
- list [catch {tree0 sort 0 -decreasing -recurse -key key1} msg] $msg
-} {0 {15 16 0 1 2 3 4 5 6 8 13 14 17 18 19 20 21}}
-
-test tree.330 {tree0 sort 0 -decreasing -key key1} {
- list [catch {
- set list {}
- foreach n [tree0 sort 0 -decreasing -key key1] {
- lappend list [tree0 get $n key1]
- }
- set list
- } msg] $msg
-} {0 {myValue myValue myValue myValue myValue myValue}}
-
-
-test tree.331 {tree0 index 1->firstchild} {
- list [catch {tree0 index 1->firstchild} msg] $msg
-} {0 14}
-
-test tree.332 {tree0 index root->firstchild} {
- list [catch {tree0 index root->firstchild} msg] $msg
-} {0 2}
-
-test tree.333 {tree0 label root->parent} {
- list [catch {tree0 label root->parent} msg] $msg
-} {1 {can't find tag or id "root->parent" in ::tree0}}
-
-test tree.334 {tree0 index root->parent} {
- list [catch {tree0 index root->parent} msg] $msg
-} {0 -1}
-
-test tree.335 {tree0 index root->lastchild} {
- list [catch {tree0 index root->lastchild} msg] $msg
-} {0 8}
-
-test tree.336 {tree0 index root->next} {
- list [catch {tree0 index root->next} msg] $msg
-} {0 2}
-
-test tree.337 {tree0 index root->previous} {
- list [catch {tree0 index root->previous} msg] $msg
-} {0 -1}
-
-test tree.338 {tree0 label root->previous} {
- list [catch {tree0 label root->previous} msg] $msg
-} {1 {can't find tag or id "root->previous" in ::tree0}}
-
-test tree.339 {tree0 index 1->previous} {
- list [catch {tree0 index 1->previous} msg] $msg
-} {0 2}
-
-test tree.340 {tree0 label root->badModifier} {
- list [catch {tree0 label root->badModifier} msg] $msg
-} {1 {can't find tag or id "root->badModifier" in ::tree0}}
-
-test tree.341 {tree0 index root->badModifier} {
- list [catch {tree0 index root->badModifier} msg] $msg
-} {0 -1}
-
-test tree.342 {tree0 index root->firstchild->parent} {
- list [catch {tree0 index root->firstchild->parent} msg] $msg
-} {0 0}
-
-test tree.343 {tree0 trace} {
- list [catch {tree0 trace} msg] $msg
-} {1 {wrong # args: should be one of...
- tree0 trace create node key how command ?-whenidle?
- tree0 trace delete id...
- tree0 trace info id
- tree0 trace names }}
-
-
-test tree.344 {tree0 trace create} {
- list [catch {tree0 trace create} msg] $msg
-} {1 {wrong # args: should be "tree0 trace create node key how command ?-whenidle?"}}
-
-test tree.345 {tree0 trace create root} {
- list [catch {tree0 trace create root} msg] $msg
-} {1 {wrong # args: should be "tree0 trace create node key how command ?-whenidle?"}}
-
-test tree.346 {tree0 trace create root * } {
- list [catch {tree0 trace create root * } msg] $msg
-} {1 {wrong # args: should be "tree0 trace create node key how command ?-whenidle?"}}
-
-test tree.347 {tree0 trace create root * rwuc} {
- list [catch {tree0 trace create root * rwuc} msg] $msg
-} {1 {wrong # args: should be "tree0 trace create node key how command ?-whenidle?"}}
-
-proc Doit args { global mylist; lappend mylist $args }
-
-test tree.348 {tree0 trace create all newKey rwuc Doit} {
- list [catch {tree0 trace create all newKey rwuc Doit} msg] $msg
-} {0 trace0}
-
-test tree.349 {tree0 trace info trace0} {
- list [catch {tree0 trace info trace0} msg] $msg
-} {0 {all newKey rwuc Doit}}
-
-test tree.350 {test create trace} {
- list [catch {
- set mylist {}
- tree0 set all newKey 20
- set mylist
- } msg] $msg
-} {0 {{::tree0 0 newKey wc} {::tree0 2 newKey wc} {::tree0 1 newKey wc} {::tree0 14 newKey wc} {::tree0 16 newKey wc} {::tree0 18 newKey wc} {::tree0 20 newKey wc} {::tree0 15 newKey wc} {::tree0 17 newKey wc} {::tree0 19 newKey wc} {::tree0 21 newKey wc} {::tree0 3 newKey wc} {::tree0 4 newKey wc} {::tree0 5 newKey wc} {::tree0 13 newKey wc} {::tree0 6 newKey wc} {::tree0 8 newKey wc}}}
-
-test tree.351 {test read trace} {
- list [catch {
- set mylist {}
- tree0 get root newKey
- set mylist
- } msg] $msg
-} {0 {{::tree0 0 newKey r}}}
-
-test tree.352 {test write trace} {
- list [catch {
- set mylist {}
- tree0 set all newKey 21
- set mylist
- } msg] $msg
-} {0 {{::tree0 0 newKey w} {::tree0 2 newKey w} {::tree0 1 newKey w} {::tree0 14 newKey w} {::tree0 16 newKey w} {::tree0 18 newKey w} {::tree0 20 newKey w} {::tree0 15 newKey w} {::tree0 17 newKey w} {::tree0 19 newKey w} {::tree0 21 newKey w} {::tree0 3 newKey w} {::tree0 4 newKey w} {::tree0 5 newKey w} {::tree0 13 newKey w} {::tree0 6 newKey w} {::tree0 8 newKey w}}}
-
-test tree.353 {test unset trace} {
- list [catch {
- set mylist {}
- tree0 set all newKey 21
- set mylist
- } msg] $msg
-} {0 {{::tree0 0 newKey w} {::tree0 2 newKey w} {::tree0 1 newKey w} {::tree0 14 newKey w} {::tree0 16 newKey w} {::tree0 18 newKey w} {::tree0 20 newKey w} {::tree0 15 newKey w} {::tree0 17 newKey w} {::tree0 19 newKey w} {::tree0 21 newKey w} {::tree0 3 newKey w} {::tree0 4 newKey w} {::tree0 5 newKey w} {::tree0 13 newKey w} {::tree0 6 newKey w} {::tree0 8 newKey w}}}
-
-test tree.354 {tree0 trace delete} {
- list [catch {tree0 trace delete} msg] $msg
-} {0 {}}
-
-test tree.355 {tree0 trace delete badId} {
- list [catch {tree0 trace delete badId} msg] $msg
-} {1 {unknown trace "badId"}}
-
-test tree.356 {tree0 trace delete trace0} {
- list [catch {tree0 trace delete trace0} msg] $msg
-} {0 {}}
-
-test tree.357 {test create trace} {
- list [catch {
- set mylist {}
- tree0 set all newKey 20
- set mylist
- } msg] $msg
-} {0 {}}
-
-test tree.358 {test unset trace} {
- list [catch {
- set mylist {}
- tree0 unset all newKey
- set mylist
- } msg] $msg
-} {0 {}}
-
-
-test tree.359 {tree0 notify} {
- list [catch {tree0 notify} msg] $msg
-} {1 {wrong # args: should be one of...
- tree0 notify create ?flags? command
- tree0 notify delete notifyId...
- tree0 notify info notifyId
- tree0 notify names }}
-
-
-test tree.360 {tree0 notify create} {
- list [catch {tree0 notify create} msg] $msg
-} {1 {wrong # args: should be "tree0 notify create ?flags? command"}}
-
-test tree.361 {tree0 notify create -allevents} {
- list [catch {tree0 notify create -allevents Doit} msg] $msg
-} {0 notify0}
-
-test tree.362 {tree0 notify info notify0} {
- list [catch {tree0 notify info notify0} msg] $msg
-} {0 {notify0 {-create -delete -move -sort -relabel} {Doit}}}
-
-test tree.363 {tree0 notify info badId} {
- list [catch {tree0 notify info badId} msg] $msg
-} {1 {unknown notify name "badId"}}
-
-test tree.364 {tree0 notify info} {
- list [catch {tree0 notify info} msg] $msg
-} {1 {wrong # args: should be "tree0 notify info notifyId"}}
-
-test tree.365 {tree0 notify names} {
- list [catch {tree0 notify names} msg] $msg
-} {0 notify0}
-
-
-test tree.366 {test create notify} {
- list [catch {
- set mylist {}
- tree0 insert 1 -tags test
- set mylist
- } msg] $msg
-} {0 {{-create 22}}}
-
-test tree.367 {test move notify} {
- list [catch {
- set mylist {}
- tree0 move 8 test
- set mylist
- } msg] $msg
-} {0 {{-move 8}}}
-
-test tree.368 {test sort notify} {
- list [catch {
- set mylist {}
- tree0 sort 0 -reorder
- set mylist
- } msg] $msg
-} {0 {{-sort 0}}}
-
-test tree.369 {test relabel notify} {
- list [catch {
- set mylist {}
- tree0 label test "newLabel"
- set mylist
- } msg] $msg
-} {0 {{-relabel 22}}}
-
-test tree.370 {test delete notify} {
- list [catch {
- set mylist {}
- tree0 delete test
- set mylist
- } msg] $msg
-} {0 {{-delete 8} {-delete 22}}}
-
-
-test tree.371 {tree0 notify delete badId} {
- list [catch {tree0 notify delete badId} msg] $msg
-} {1 {unknown notify name "badId"}}
-
-
-test tree.372 {test create notify} {
- list [catch {
- set mylist {}
- tree0 set all newKey 20
- set mylist
- } msg] $msg
-} {0 {}}
-
-test tree.373 {test delete notify} {
- list [catch {
- set mylist {}
- tree0 unset all newKey
- set mylist
- } msg] $msg
-} {0 {}}
-
-test tree.374 {test delete notify} {
- list [catch {
- set mylist {}
- tree0 unset all newKey
- set mylist
- } msg] $msg
-} {0 {}}
-
-test tree.375 {tree0 copy} {
- list [catch {tree0 copy} msg] $msg
-} {1 {wrong # args: should be "tree0 copy parent ?tree? node ?switches?"}}
-
-test tree.376 {tree0 copy root} {
- list [catch {tree0 copy root} msg] $msg
-} {1 {wrong # args: should be "tree0 copy parent ?tree? node ?switches?"}}
-
-test tree.377 {tree0 copy root 14} {
- list [catch {tree0 copy root 14} msg] $msg
-} {0 23}
-
-test tree.378 {tree0 copy 14 root} {
- list [catch {tree0 copy 14 root} msg] $msg
-} {0 24}
-
-test tree.379 {tree0 copy 14 root -recurse} {
- list [catch {tree0 copy 14 root -recurse} msg] $msg
-} {1 {can't make cyclic copy: source node is an ancestor of the destination}}
-
-test tree.380 {tree0 copy 3 2 -recurse -tags} {
- list [catch {tree0 copy 3 2 -recurse -tags} msg] $msg
-} {0 25}
-
-test tree.381 {copy tree to tree -recurse} {
- list [catch {
- blt::tree create tree1
- foreach node [tree0 children root] {
- tree1 copy root tree0 $node -recurse
- }
- foreach node [tree0 children root] {
- tree1 copy root tree0 $node -recurse
- }
- tree1 dump root
- } msg] $msg
-} {0 {-1 0 {{}} {} {}
-0 1 {{} node2} {key1 myValue} {}
-1 2 {{} node2 node1} {key1 myValue} {}
-2 3 {{} node2 node1 node14} {key1 myValue} {}
-3 4 {{} node2 node1 node14 node16} {key1 123 key2 abc} {}
-4 5 {{} node2 node1 node14 node16 node18} {key1 myValue} {}
-5 6 {{} node2 node1 node14 node16 node18 node20} {key1 myValue} {}
-3 7 {{} node2 node1 node14 {}} {key1 myValue} {}
-2 8 {{} node2 node1 node15} {key1 123} {}
-8 9 {{} node2 node1 node15 node17} {key1 myValue} {}
-9 10 {{} node2 node1 node15 node17 node19} {key1 myValue} {}
-10 11 {{} node2 node1 node15 node17 node19 node21} {key1 myValue} {}
-0 12 {{} node3} {key1 myValue} {}
-12 13 {{} node3 node2} {key1 myValue} {}
-13 14 {{} node3 node2 node1} {key1 myValue} {}
-14 15 {{} node3 node2 node1 node14} {key1 myValue} {}
-15 16 {{} node3 node2 node1 node14 node16} {key1 123 key2 abc} {}
-16 17 {{} node3 node2 node1 node14 node16 node18} {key1 myValue} {}
-17 18 {{} node3 node2 node1 node14 node16 node18 node20} {key1 myValue} {}
-15 19 {{} node3 node2 node1 node14 {}} {key1 myValue} {}
-14 20 {{} node3 node2 node1 node15} {key1 123} {}
-20 21 {{} node3 node2 node1 node15 node17} {key1 myValue} {}
-21 22 {{} node3 node2 node1 node15 node17 node19} {key1 myValue} {}
-22 23 {{} node3 node2 node1 node15 node17 node19 node21} {key1 myValue} {}
-0 24 {{} node4} {key1 myValue} {}
-0 25 {{} node5} {key1 myValue} {}
-25 26 {{} node5 node13} {key1 myValue} {}
-0 27 {{} node6} {key1 myValue} {}
-0 28 {{} node14} {key1 myValue} {}
-0 29 {{} node2} {key1 myValue} {}
-29 30 {{} node2 node1} {key1 myValue} {}
-30 31 {{} node2 node1 node14} {key1 myValue} {}
-31 32 {{} node2 node1 node14 node16} {key1 123 key2 abc} {}
-32 33 {{} node2 node1 node14 node16 node18} {key1 myValue} {}
-33 34 {{} node2 node1 node14 node16 node18 node20} {key1 myValue} {}
-31 35 {{} node2 node1 node14 {}} {key1 myValue} {}
-30 36 {{} node2 node1 node15} {key1 123} {}
-36 37 {{} node2 node1 node15 node17} {key1 myValue} {}
-37 38 {{} node2 node1 node15 node17 node19} {key1 myValue} {}
-38 39 {{} node2 node1 node15 node17 node19 node21} {key1 myValue} {}
-0 40 {{} node3} {key1 myValue} {}
-40 41 {{} node3 node2} {key1 myValue} {}
-41 42 {{} node3 node2 node1} {key1 myValue} {}
-42 43 {{} node3 node2 node1 node14} {key1 myValue} {}
-43 44 {{} node3 node2 node1 node14 node16} {key1 123 key2 abc} {}
-44 45 {{} node3 node2 node1 node14 node16 node18} {key1 myValue} {}
-45 46 {{} node3 node2 node1 node14 node16 node18 node20} {key1 myValue} {}
-43 47 {{} node3 node2 node1 node14 {}} {key1 myValue} {}
-42 48 {{} node3 node2 node1 node15} {key1 123} {}
-48 49 {{} node3 node2 node1 node15 node17} {key1 myValue} {}
-49 50 {{} node3 node2 node1 node15 node17 node19} {key1 myValue} {}
-50 51 {{} node3 node2 node1 node15 node17 node19 node21} {key1 myValue} {}
-0 52 {{} node4} {key1 myValue} {}
-0 53 {{} node5} {key1 myValue} {}
-53 54 {{} node5 node13} {key1 myValue} {}
-0 55 {{} node6} {key1 myValue} {}
-0 56 {{} node14} {key1 myValue} {}
-}}
-
-puts stderr "done testing treecmd.tcl"
-
-exit 0
-
diff --git a/blt3.0.1/win/README b/blt3.0.1/win/README
deleted file mode 100644
index e17af25..0000000
--- a/blt3.0.1/win/README
+++ /dev/null
@@ -1,277 +0,0 @@
-
-This file describes how to build BLT under Windows 95/98/NT/2000/XP.
-
-It's not necessary to compile BLT for Windows 95/98/NT/2000/XP.
-Binary versions are available on ftp.tcltk.com/pub/blt.
-
- http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.0.exe
- -or-
- http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.1.exe
- -or-
- http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.2.exe
- -or-
- http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.3.exe
-
-They will dynamically load into wish80.exe, wish81.exe, wish82.exe, or
-wish83.exe by invoking
-
- package require BLT
-
-from within your script.
-
-If you really need to build BLT yourself, then hold onto your hat.
-It's a lot more difficult to build BLT under Windows than under Unix.
-Most Windows software is designed to be delivered as a self-installing
-binary executable, therefore it's rare to find the installation tools
-necessary to build and install BLT from the source code.
-
-1. What versions of Tcl/Tk can I use?
-
- Any stable release. I've built and tested BLT with Tcl/Tk
- versions 8.0.5, 8.1.1, and 8.2.3, and 8.3.4. Avoid the alpha and
- beta versions.
-
-2. What compiler can I use?
-
- You can use one of the following compilers:
-
- 1. Microsoft Visual C++ 5.0/6.0
- 2. Cygwin's GNU CC 2.95.2 (with or without -mno-cygwin)
- 3. Borland Free compiler 5.5.1
-
- I normally build with VC++ 6.0. This is also what the binary Tcl/Tk
- distribution use.
-
- Note: Unless it's your only option, I don't recommend using the
- Borland free compiler right now.
-
-3. What "make" program do I need?
-
- I highly recommend installing the Cygwin tool suite. You can pick
- this up from
-
- http://sourceware.cygnus.com/cygwin/setup.exe
-
- I normally use GNU make instead of Microsoft's nmake. But you can
- also nmake. If you have a choice, use the Cygnus tools. For
- compiling with Borland's C compiler, you can use Borland's make.exe.
-
-4. Do I need to compile the Tcl/Tk libraries?
-
- More than likely. Unless you're compiling with Cygwin GCC and the
- cygwin-version of the Tcl/Tk libraries, you'll need to obtain the
- Tcl/Tk sources and compile them.
-
-5. Is there anything else I need?
-
- By default, JPEG support is enabled. It uses the jpeg-6b
- libraries from ftp.uu.net. You can pick up the sources from
-
- ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
-
- You can also use the Intel JPEG Libraries. JPEG support is
- optional. You can disable it.
-
-6. Can I mix-and-match DLLs?
-
- You can't really mix the Borland and VC++ compiled DLLs. BLT isn't
- stubbed and the symbol names are incompatible between versions.
- The various workarounds are difficult.
-
- I haven't tested this, but I believe you can load a GNU CC
- (-mno-cygwin) BLT24.dll into a VC++ compiled wish.
-
- In general the best advice is to use the same compiler that
- that you compiled Tcl/Tk to compile BLT.
-
-7. What compiler should I use?
-
- Right now, probably Microsoft VC++. This is what all Tcl/Tk
- releases 8.0 to present have been built with. So you shouldn't
- have to work too hard to compile the Tcl and Tk libraries.
-
- Having said that, Cygwin's GNU CC works just fine. You can
- obtain versions from Mumit Khan to build Tcl and Tk. I recommend
- compiling the Tcl/Tk libraries yourself with the -mno-cygwin
- option.
-
- And if compiling Tcl and Tk is too much of a hassle, you can
- always built BLT with the cygwin Tcl/Tk libraries (cygtcl80.dll
- and cygtk80.dll). The downside is that the cygwin libraries are
- 1) pretty old (version 8.0) and 2) there may be some
- incompatibilities between the native Win32 calls in BLT
- and the cygwin emulation layer.
-
- I have built BLT with the Borland free compiler. It's not
- 100% yet. The problems are
- 1) If you automatically load BLT from a script file, you
- will generate exception in the DLL. Oddly enough,
- you can source the script manually.
- 2) Resampled images are blank (see the graph3.tcl and eps.tcl
- demos). The same code works with both GCC and VC++.
- 3) I can't even get wish83.exe to open a console window.
- Weirdly, bltwish.exe does this properly.
- 4) The turbo debugger is a pain.
-
-
-Building BLT with Microsoft VC++, nmake, and VC++ compiled Tcl/Tk
-libraries.
-====================================================================
-
-1. Install the Tcl/Tk sources. They should reside in the
- same directory tree as the BLT sources.
-
- ______________|______________
- | | | |
- blt2.4 tcl8.3.4 tk8.3.4 jpeg-6b
-
-
-2. Build and install the Tcl and Tk libraries.
-
- cd tcl8.3.4\win
- nmake -f Makefile.vc
- nmake -f Makefile.vc install
- cd ..\..\tk8.3.4\win
- nmake -f Makefile.vc
- nmake -f Makefile.vc install
-
-3. In the BLT directory, edit .\win\makedefs. Set the following
- macros.
-
-
- v1 = 8.3 Tcl/Tk version.
- v2 = 83 Version number without dots.
- v3 = 8.3.4 Suffix of Tcl/Tk directories
-
- prefix = C:/Program\ Files/Tcl
- Location of installed Tcl/Tk files.
- TOOLS32 = C:/Program\ Files/Microsoft\ Visual\ Studio/VC90
- Location of MS C compiler and tools.
- HAVE_JPEG = 0
-
-4. Compile BLT.
-
- make -f blt.mak
-
-5. Install BLT
-
- Since Windows doesn't provide tools to install software, we'll
- use Tcl/Tk to do it. There's an install script in ./win/install.tcl.
- Add the location of wish83.exe to your PATH and run wish83.exe.
-
- wish83.exe ./win/install.tcl
-
-6. Test BLT
-
- cd demos
- bltwish.exe graph1.tcl
-
-Building BLT with Cygwin GCC and mingw (-mno-cygwin) Tcl/Tk libraries.
-======================================================================
-
-1. Install the Tcl/Tk sources. They should reside in the
- same directory tree as the BLT sources.
-
- ______________|______________
- | | | |
- blt2.4 tcl8.3.4 tk8.3.4 jpeg-6b
-
-
-2. Install the cygwin tool suite.
-
-3. Build and install the Tcl and Tk libraries.
-
- cd tcl8.3.4/win
- ./configure --prefix=/usr/local/tcl8.3.4
- make
- make install
- cd ../../tk8.3.4/win
- ./configure --prefix=/usr/local/tcl8.3.4
- make
- make install
-
-3. Compile and install BLT.
-
- ./configure --disable-cygwin --prefix=/usr/local/tcl8.3.4
- make
- make install
-
-4. Test BLT
-
- Add the location of wish83.exe to your PATH and run bltwish.exe.
-
- cd demos
- bltwish.exe graph1.tcl
-
-Building BLT with Cygwin GCC and the cygwin distribution Tcl/Tk
-libraries.
-=============================================================
-
-1. Install the cygwin tool suite.
-
-2. Compile and install BLT.
-
- ./configure --with-scriptdir=/usr/share --prefix=/usr
- make
- make install
-
-3. Test BLT
-
- Add the location of wish83.exe to your PATH and run bltwish.exe.
-
- cd demos
- bltwish.exe graph1.tcl
-
-Building BLT with Borland bcc55 and Borland compiled Tcl/Tk libraries.
-======================================================================
-
-1. Install the Tcl/Tk sources. They should reside in the
- same directory tree as the BLT sources.
-
- ______________|______________
- | | | |
- blt2.4 tcl8.3.4 tk8.3.4 jpeg-6b
-
-
-2. Build and install the Tcl and Tk libraries.
-
- cd tcl8.3.4\win
- make -f Makefile.bc
- make -f Makefile.bc install
- cd ..\..\tk8.3.4\win
- make -f Makefile.bc
- make -f Makefile.bc install
-
-3. In the BLT directory, edit .\win\makedefs. Set the following
- macros.
-
- v1 = 8.3 Tcl/Tk version.
- v2 = 83 Version number without dots.
- v3 = 8.3.4 Suffix of Tcl/Tk directories
-
-4. Edit .\src\Makefile.bc
-
- prefix = C:\Program Files\Tcl
- Location of installed Tcl/Tk files.
- TOOLS32 = C:\Borland\BCC55\
- Location of Borland C compiler and tools.
- HAVE_JPEG = 0
-
-4. Compile BLT.
-
- cd src
- make -f Makefile.bc
-
-5. Install BLT
-
- Since Windows doesn't provide tools to install software, we'll
- use Tcl/Tk to do it. There's an install script in ./win/install.tcl.
- Add the location of wish83.exe to your PATH and run wish83.exe.
-
- wish83.exe ./win/install.tcl
-
-6. Test BLT
-
- cd demos
- bltwish.exe graph1.tcl
-
diff --git a/blt3.0.1/win/README.vc++ b/blt3.0.1/win/README.vc++
deleted file mode 100644
index 8e6d9c1..0000000
--- a/blt3.0.1/win/README.vc++
+++ /dev/null
@@ -1,123 +0,0 @@
-
- How to build BLT with Microsoft VC++.
-
-This file describes how to build BLT under Windows 95/98/NT/2000/XP
-with Visual C++.
-
-For most, it's not necessary to compile BLT for Windows. If you
-have downloaded Tcl/Tk from www.tcltk.com or activestate then
-the precompiled binary versions on www.sourceforge.net should
-suffice. They are
-
- http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.0.exe
- -or-
- http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.1.exe
- -or-
- http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.2.exe
- -or-
- http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.3.exe
- -or-
- http://www.sourceforge.net/projects/blt/files/blt2.4z-for-8.4.exe
-
-
-Simply pick the one that matches the version of Tcl/Tk that you are
-using.
-
-
-Assuming the you need to build BLT from its sources, here is a short
-description.
-
-
-I. Requirements.
-================
-
- Visual C++ 5 or 6 I've tested building BLT with both these
- compilers
-
- Tcl/Tk sources You must have the sources to both Tcl and
- Tk available.
-
-
-II. Directory structure.
-========================
-
-The Tcl/Tk sources must be installed in the same directory and the
-BLT sources. The following is an example.
-
- ______________|______________
- | | | |
- blt2.4 tcl8.3.4 tk8.3.4 jpeg-6b*
-
-* The JPEG library is optional.
-
-
-III. Building Tcl/Tk.
-=====================
-
-You must first build the Tcl and Tk libraries.
-
- cd tcl8.3.4/win
- nmake -f Makefile.vc
- nmake -f Makefile.vc install
- cd ../../tk8.3.4/win
- nmake -f Makefile.vc
- nmake -f Makefile.vc install
-
-This will install Tcl/Tk into C:/Program Files/Tcl
-
-
-IV. Configuring BLT
-===================
-
-In the BLT directory, edit ./win/makedefs. Set the following macros.
-
- v1 = 8.3 Tcl/Tk version.
- v2 = 83 Version number without dots.
- v3 = 8.3.4 Suffix of Tcl/Tk directories
-
- prefix = C:/Program\ Files/Tcl Location of installed Tcl/Tk files.
- TOOLS32 = C:/Program\ Files/Microsoft\ Visual\ Studio/VC90
- Location of MS C compiler and tools.
- HAVE_JPEG = 0
-
-Setting HAVE_JPEG to 0 eliminated the need for the JPEG library.
-
-
-V. Compiling BLT
-================
-
-If you have the Cygwin distribution, go into a bash shell and run
-
- make -f Makefile.vc
-
-from the blt2.4z directory.
-
-Otherwise (without cygwin) it's
-
- nmake -f blt.mak
-
-
-VI. Installing BLT
-==================
-
-Again, if you have the Cygwin distribution, then run
-
- make -f Makefile.vc install
-
-Without cygwin, you must use the home-brew installer script with
-tclsh.
-
- tclsh8.3.exe win/install.tcl
-
-
-VII. Testing BLT
-================
-
-Add the location of BLT24.dll to your PATH variable. For example
-from the bash shell
-
- export PATH=/cygdrive/c/Program\ Files/Tcl/bin:$PATH
- cd demos
-
- bltwish.exe graph1.tcl
-
diff --git a/blt3.0.1/win/X11/X.h b/blt3.0.1/win/X11/X.h
deleted file mode 100644
index a7f6566..0000000
--- a/blt3.0.1/win/X11/X.h
+++ /dev/null
@@ -1,673 +0,0 @@
-/*
- * $XConsortium: X.h,v 1.66 88/09/06 15:55:56 jim Exp $
- */
-
-/* Definitions for the X window system likely to be used by applications */
-
-#ifndef X_H
-#define X_H
-
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-#define X_PROTOCOL 11 /* current protocol version */
-#define X_PROTOCOL_REVISION 0 /* current minor version */
-
-#ifdef MAC_TCL
-# define Cursor XCursor
-# define Region XRegion
-#endif
-
-/* Resources */
-
-typedef unsigned long XID;
-
-typedef XID Window;
-typedef XID Drawable;
-typedef XID Font;
-typedef XID Pixmap;
-typedef XID Cursor;
-typedef XID Colormap;
-typedef XID GContext;
-typedef XID KeySym;
-
-typedef unsigned long Mask;
-
-typedef unsigned long Atom;
-
-typedef unsigned long VisualID;
-
-typedef unsigned long Time;
-
-typedef unsigned long KeyCode; /* In order to use IME, the Macintosh needs
- * to pack 3 bytes into the keyCode field in
- * the XEvent. In the real X.h, a KeyCode is
- * defined as a short, which wouldn't be big
- * enough. */
-
-/*****************************************************************
- * RESERVED RESOURCE AND CONSTANT DEFINITIONS
- *****************************************************************/
-
-#define None 0L /* universal null resource or null atom */
-
-#define ParentRelative 1L /* background pixmap in CreateWindow
- and ChangeWindowAttributes */
-
-#define CopyFromParent 0L /* border pixmap in CreateWindow
- and ChangeWindowAttributes
- special VisualID and special window
- class passed to CreateWindow */
-
-#define PointerWindow 0L /* destination window in SendEvent */
-#define InputFocus 1L /* destination window in SendEvent */
-
-#define PointerRoot 1L /* focus window in SetInputFocus */
-
-#define AnyPropertyType 0L /* special Atom, passed to GetProperty */
-
-#define AnyKey 0L /* special Key Code, passed to GrabKey */
-
-#define AnyButton 0L /* special Button Code, passed to GrabButton */
-
-#define AllTemporary 0L /* special Resource ID passed to KillClient */
-
-#define CurrentTime 0L /* special Time */
-
-#define NoSymbol 0L /* special KeySym */
-
-/*****************************************************************
- * EVENT DEFINITIONS
- *****************************************************************/
-
-/* Input Event Masks. Used as event-mask window attribute and as arguments
- to Grab requests. Not to be confused with event names. */
-
-#define NoEventMask 0L
-#define KeyPressMask (1L<<0)
-#define KeyReleaseMask (1L<<1)
-#define ButtonPressMask (1L<<2)
-#define ButtonReleaseMask (1L<<3)
-#define EnterWindowMask (1L<<4)
-#define LeaveWindowMask (1L<<5)
-#define PointerMotionMask (1L<<6)
-#define PointerMotionHintMask (1L<<7)
-#define Button1MotionMask (1L<<8)
-#define Button2MotionMask (1L<<9)
-#define Button3MotionMask (1L<<10)
-#define Button4MotionMask (1L<<11)
-#define Button5MotionMask (1L<<12)
-#define ButtonMotionMask (1L<<13)
-#define KeymapStateMask (1L<<14)
-#define ExposureMask (1L<<15)
-#define VisibilityChangeMask (1L<<16)
-#define StructureNotifyMask (1L<<17)
-#define ResizeRedirectMask (1L<<18)
-#define SubstructureNotifyMask (1L<<19)
-#define SubstructureRedirectMask (1L<<20)
-#define FocusChangeMask (1L<<21)
-#define PropertyChangeMask (1L<<22)
-#define ColormapChangeMask (1L<<23)
-#define OwnerGrabButtonMask (1L<<24)
-
-/* Event names. Used in "type" field in XEvent structures. Not to be
-confused with event masks above. They start from 2 because 0 and 1
-are reserved in the protocol for errors and replies. */
-
-#define KeyPress 2
-#define KeyRelease 3
-#define ButtonPress 4
-#define ButtonRelease 5
-#define MotionNotify 6
-#define EnterNotify 7
-#define LeaveNotify 8
-#define FocusIn 9
-#define FocusOut 10
-#define KeymapNotify 11
-#define Expose 12
-#define GraphicsExpose 13
-#define NoExpose 14
-#define VisibilityNotify 15
-#define CreateNotify 16
-#define DestroyNotify 17
-#define UnmapNotify 18
-#define MapNotify 19
-#define MapRequest 20
-#define ReparentNotify 21
-#define ConfigureNotify 22
-#define ConfigureRequest 23
-#define GravityNotify 24
-#define ResizeRequest 25
-#define CirculateNotify 26
-#define CirculateRequest 27
-#define PropertyNotify 28
-#define SelectionClear 29
-#define SelectionRequest 30
-#define SelectionNotify 31
-#define ColormapNotify 32
-#define ClientMessage 33
-#define MappingNotify 34
-#define LASTEvent 35 /* must be bigger than any event # */
-
-
-/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
- state in various key-, mouse-, and button-related events. */
-
-#define ShiftMask (1<<0)
-#define LockMask (1<<1)
-#define ControlMask (1<<2)
-#define Mod1Mask (1<<3)
-#define Mod2Mask (1<<4)
-#define Mod3Mask (1<<5)
-#define Mod4Mask (1<<6)
-#define Mod5Mask (1<<7)
-
-/* modifier names. Used to build a SetModifierMapping request or
- to read a GetModifierMapping request. These correspond to the
- masks defined above. */
-#define ShiftMapIndex 0
-#define LockMapIndex 1
-#define ControlMapIndex 2
-#define Mod1MapIndex 3
-#define Mod2MapIndex 4
-#define Mod3MapIndex 5
-#define Mod4MapIndex 6
-#define Mod5MapIndex 7
-
-
-/* button masks. Used in same manner as Key masks above. Not to be confused
- with button names below. */
-
-#define Button1Mask (1<<8)
-#define Button2Mask (1<<9)
-#define Button3Mask (1<<10)
-#define Button4Mask (1<<11)
-#define Button5Mask (1<<12)
-
-#define AnyModifier (1<<15) /* used in GrabButton, GrabKey */
-
-
-/* button names. Used as arguments to GrabButton and as detail in ButtonPress
- and ButtonRelease events. Not to be confused with button masks above.
- Note that 0 is already defined above as "AnyButton". */
-
-#define Button1 1
-#define Button2 2
-#define Button3 3
-#define Button4 4
-#define Button5 5
-
-/* Notify modes */
-
-#define NotifyNormal 0
-#define NotifyGrab 1
-#define NotifyUngrab 2
-#define NotifyWhileGrabbed 3
-
-#define NotifyHint 1 /* for MotionNotify events */
-
-/* Notify detail */
-
-#define NotifyAncestor 0
-#define NotifyVirtual 1
-#define NotifyInferior 2
-#define NotifyNonlinear 3
-#define NotifyNonlinearVirtual 4
-#define NotifyPointer 5
-#define NotifyPointerRoot 6
-#define NotifyDetailNone 7
-
-/* Visibility notify */
-
-#define VisibilityUnobscured 0
-#define VisibilityPartiallyObscured 1
-#define VisibilityFullyObscured 2
-
-/* Circulation request */
-
-#define PlaceOnTop 0
-#define PlaceOnBottom 1
-
-/* protocol families */
-
-#define FamilyInternet 0
-#define FamilyDECnet 1
-#define FamilyChaos 2
-
-/* Property notification */
-
-#define PropertyNewValue 0
-#define PropertyDelete 1
-
-/* Color Map notification */
-
-#define ColormapUninstalled 0
-#define ColormapInstalled 1
-
-/* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
-
-#define GrabModeSync 0
-#define GrabModeAsync 1
-
-/* GrabPointer, GrabKeyboard reply status */
-
-#define GrabSuccess 0
-#define AlreadyGrabbed 1
-#define GrabInvalidTime 2
-#define GrabNotViewable 3
-#define GrabFrozen 4
-
-/* AllowEvents modes */
-
-#define AsyncPointer 0
-#define SyncPointer 1
-#define ReplayPointer 2
-#define AsyncKeyboard 3
-#define SyncKeyboard 4
-#define ReplayKeyboard 5
-#define AsyncBoth 6
-#define SyncBoth 7
-
-/* Used in SetInputFocus, GetInputFocus */
-
-#define RevertToNone (int)None
-#define RevertToPointerRoot (int)PointerRoot
-#define RevertToParent 2
-
-/*****************************************************************
- * ERROR CODES
- *****************************************************************/
-
-#define Success 0 /* everything's okay */
-#define BadRequest 1 /* bad request code */
-#define BadValue 2 /* int parameter out of range */
-#define BadWindow 3 /* parameter not a Window */
-#define BadPixmap 4 /* parameter not a Pixmap */
-#define BadAtom 5 /* parameter not an Atom */
-#define BadCursor 6 /* parameter not a Cursor */
-#define BadFont 7 /* parameter not a Font */
-#define BadMatch 8 /* parameter mismatch */
-#define BadDrawable 9 /* parameter not a Pixmap or Window */
-#define BadAccess 10 /* depending on context:
- - key/button already grabbed
- - attempt to free an illegal
- cmap entry
- - attempt to store into a read-only
- color map entry.
- - attempt to modify the access control
- list from other than the local host.
- */
-#define BadAlloc 11 /* insufficient resources */
-#define BadColor 12 /* no such colormap */
-#define BadGC 13 /* parameter not a GC */
-#define BadIDChoice 14 /* choice not in range or already used */
-#define BadName 15 /* font or color name doesn't exist */
-#define BadLength 16 /* Request length incorrect */
-#define BadImplementation 17 /* server is defective */
-
-#define FirstExtensionError 128
-#define LastExtensionError 255
-
-/*****************************************************************
- * WINDOW DEFINITIONS
- *****************************************************************/
-
-/* Window classes used by CreateWindow */
-/* Note that CopyFromParent is already defined as 0 above */
-
-#define InputOutput 1
-#define InputOnly 2
-
-/* Window attributes for CreateWindow and ChangeWindowAttributes */
-
-#define CWBackPixmap (1L<<0)
-#define CWBackPixel (1L<<1)
-#define CWBorderPixmap (1L<<2)
-#define CWBorderPixel (1L<<3)
-#define CWBitGravity (1L<<4)
-#define CWWinGravity (1L<<5)
-#define CWBackingStore (1L<<6)
-#define CWBackingPlanes (1L<<7)
-#define CWBackingPixel (1L<<8)
-#define CWOverrideRedirect (1L<<9)
-#define CWSaveUnder (1L<<10)
-#define CWEventMask (1L<<11)
-#define CWDontPropagate (1L<<12)
-#define CWColormap (1L<<13)
-#define CWCursor (1L<<14)
-
-/* ConfigureWindow structure */
-
-#define CWX (1<<0)
-#define CWY (1<<1)
-#define CWWidth (1<<2)
-#define CWHeight (1<<3)
-#define CWBorderWidth (1<<4)
-#define CWSibling (1<<5)
-#define CWStackMode (1<<6)
-
-
-/* Bit Gravity */
-
-#define ForgetGravity 0
-#define NorthWestGravity 1
-#define NorthGravity 2
-#define NorthEastGravity 3
-#define WestGravity 4
-#define CenterGravity 5
-#define EastGravity 6
-#define SouthWestGravity 7
-#define SouthGravity 8
-#define SouthEastGravity 9
-#define StaticGravity 10
-
-/* Window gravity + bit gravity above */
-
-#define UnmapGravity 0
-
-/* Used in CreateWindow for backing-store hint */
-
-#define NotUseful 0
-#define WhenMapped 1
-#define Always 2
-
-/* Used in GetWindowAttributes reply */
-
-#define IsUnmapped 0
-#define IsUnviewable 1
-#define IsViewable 2
-
-/* Used in ChangeSaveSet */
-
-#define SetModeInsert 0
-#define SetModeDelete 1
-
-/* Used in ChangeCloseDownMode */
-
-#define DestroyAll 0
-#define RetainPermanent 1
-#define RetainTemporary 2
-
-/* Window stacking method (in configureWindow) */
-
-#define Above 0
-#define Below 1
-#define TopIf 2
-#define BottomIf 3
-#define Opposite 4
-
-/* Circulation direction */
-
-#define RaiseLowest 0
-#define LowerHighest 1
-
-/* Property modes */
-
-#define PropModeReplace 0
-#define PropModePrepend 1
-#define PropModeAppend 2
-
-/*****************************************************************
- * GRAPHICS DEFINITIONS
- *****************************************************************/
-
-/* graphics functions, as in GC.alu */
-
-#define GXclear 0x0 /* 0 */
-#define GXand 0x1 /* src AND dst */
-#define GXandReverse 0x2 /* src AND NOT dst */
-#define GXcopy 0x3 /* src */
-#define GXandInverted 0x4 /* NOT src AND dst */
-#define GXnoop 0x5 /* dst */
-#define GXxor 0x6 /* src XOR dst */
-#define GXor 0x7 /* src OR dst */
-#define GXnor 0x8 /* NOT src AND NOT dst */
-#define GXequiv 0x9 /* NOT src XOR dst */
-#define GXinvert 0xa /* NOT dst */
-#define GXorReverse 0xb /* src OR NOT dst */
-#define GXcopyInverted 0xc /* NOT src */
-#define GXorInverted 0xd /* NOT src OR dst */
-#define GXnand 0xe /* NOT src OR NOT dst */
-#define GXset 0xf /* 1 */
-
-/* LineStyle */
-
-#define LineSolid 0
-#define LineOnOffDash 1
-#define LineDoubleDash 2
-
-/* capStyle */
-
-#define CapNotLast 0
-#define CapButt 1
-#define CapRound 2
-#define CapProjecting 3
-
-/* joinStyle */
-
-#define JoinMiter 0
-#define JoinRound 1
-#define JoinBevel 2
-
-/* fillStyle */
-
-#define FillSolid 0
-#define FillTiled 1
-#define FillStippled 2
-#define FillOpaqueStippled 3
-
-/* fillRule */
-
-#define EvenOddRule 0
-#define WindingRule 1
-
-/* subwindow mode */
-
-#define ClipByChildren 0
-#define IncludeInferiors 1
-
-/* SetClipRectangles ordering */
-
-#define Unsorted 0
-#define YSorted 1
-#define YXSorted 2
-#define YXBanded 3
-
-/* CoordinateMode for drawing routines */
-
-#define CoordModeOrigin 0 /* relative to the origin */
-#define CoordModePrevious 1 /* relative to previous point */
-
-/* Polygon shapes */
-
-#define Complex 0 /* paths may intersect */
-#define Nonconvex 1 /* no paths intersect, but not convex */
-#define Convex 2 /* wholly convex */
-
-/* Arc modes for PolyFillArc */
-
-#define ArcChord 0 /* join endpoints of arc */
-#define ArcPieSlice 1 /* join endpoints to center of arc */
-
-/* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
- GC.stateChanges */
-
-#define GCFunction (1L<<0)
-#define GCPlaneMask (1L<<1)
-#define GCForeground (1L<<2)
-#define GCBackground (1L<<3)
-#define GCLineWidth (1L<<4)
-#define GCLineStyle (1L<<5)
-#define GCCapStyle (1L<<6)
-#define GCJoinStyle (1L<<7)
-#define GCFillStyle (1L<<8)
-#define GCFillRule (1L<<9)
-#define GCTile (1L<<10)
-#define GCStipple (1L<<11)
-#define GCTileStipXOrigin (1L<<12)
-#define GCTileStipYOrigin (1L<<13)
-#define GCFont (1L<<14)
-#define GCSubwindowMode (1L<<15)
-#define GCGraphicsExposures (1L<<16)
-#define GCClipXOrigin (1L<<17)
-#define GCClipYOrigin (1L<<18)
-#define GCClipMask (1L<<19)
-#define GCDashOffset (1L<<20)
-#define GCDashList (1L<<21)
-#define GCArcMode (1L<<22)
-
-#define GCLastBit 22
-/*****************************************************************
- * FONTS
- *****************************************************************/
-
-/* used in QueryFont -- draw direction */
-
-#define FontLeftToRight 0
-#define FontRightToLeft 1
-
-#define FontChange 255
-
-/*****************************************************************
- * IMAGING
- *****************************************************************/
-
-/* ImageFormat -- PutImage, GetImage */
-
-#define XYBitmap 0 /* depth 1, XYFormat */
-#define XYPixmap 1 /* depth == drawable depth */
-#define ZPixmap 2 /* depth == drawable depth */
-
-/*****************************************************************
- * COLOR MAP STUFF
- *****************************************************************/
-
-/* For CreateColormap */
-
-#define AllocNone 0 /* create map with no entries */
-#define AllocAll 1 /* allocate entire map writeable */
-
-
-/* Flags used in StoreNamedColor, StoreColors */
-
-#define DoRed (1<<0)
-#define DoGreen (1<<1)
-#define DoBlue (1<<2)
-
-/*****************************************************************
- * CURSOR STUFF
- *****************************************************************/
-
-/* QueryBestSize Class */
-
-#define CursorShape 0 /* largest size that can be displayed */
-#define TileShape 1 /* size tiled fastest */
-#define StippleShape 2 /* size stippled fastest */
-
-/*****************************************************************
- * KEYBOARD/POINTER STUFF
- *****************************************************************/
-
-#define AutoRepeatModeOff 0
-#define AutoRepeatModeOn 1
-#define AutoRepeatModeDefault 2
-
-#define LedModeOff 0
-#define LedModeOn 1
-
-/* masks for ChangeKeyboardControl */
-
-#define KBKeyClickPercent (1L<<0)
-#define KBBellPercent (1L<<1)
-#define KBBellPitch (1L<<2)
-#define KBBellDuration (1L<<3)
-#define KBLed (1L<<4)
-#define KBLedMode (1L<<5)
-#define KBKey (1L<<6)
-#define KBAutoRepeatMode (1L<<7)
-
-#define MappingSuccess 0
-#define MappingBusy 1
-#define MappingFailed 2
-
-#define MappingModifier 0
-#define MappingKeyboard 1
-#define MappingPointer 2
-
-/*****************************************************************
- * SCREEN SAVER STUFF
- *****************************************************************/
-
-#define DontPreferBlanking 0
-#define PreferBlanking 1
-#define DefaultBlanking 2
-
-#define DisableScreenSaver 0
-#define DisableScreenInterval 0
-
-#define DontAllowExposures 0
-#define AllowExposures 1
-#define DefaultExposures 2
-
-/* for ForceScreenSaver */
-
-#define ScreenSaverReset 0
-#define ScreenSaverActive 1
-
-/*****************************************************************
- * HOSTS AND CONNECTIONS
- *****************************************************************/
-
-/* for ChangeHosts */
-
-#define HostInsert 0
-#define HostDelete 1
-
-/* for ChangeAccessControl */
-
-#define EnableAccess 1
-#define DisableAccess 0
-
-/* Display classes used in opening the connection
- * Note that the statically allocated ones are even numbered and the
- * dynamically changeable ones are odd numbered */
-
-#define StaticGray 0
-#define GrayScale 1
-#define StaticColor 2
-#define PseudoColor 3
-#define TrueColor 4
-#define DirectColor 5
-
-
-/* Byte order used in imageByteOrder and bitmapBitOrder */
-
-#define LSBFirst 0
-#define MSBFirst 1
-
-#ifdef MAC_TCL
-# undef Cursor
-# undef Region
-#endif
-
-#endif /* X_H */
diff --git a/blt3.0.1/win/X11/Xatom.h b/blt3.0.1/win/X11/Xatom.h
deleted file mode 100644
index 485a423..0000000
--- a/blt3.0.1/win/X11/Xatom.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef XATOM_H
-#define XATOM_H 1
-
-/* THIS IS A GENERATED FILE
- *
- * Do not change! Changing this file implies a protocol change!
- */
-
-#define XA_PRIMARY ((Atom) 1)
-#define XA_SECONDARY ((Atom) 2)
-#define XA_ARC ((Atom) 3)
-#define XA_ATOM ((Atom) 4)
-#define XA_BITMAP ((Atom) 5)
-#define XA_CARDINAL ((Atom) 6)
-#define XA_COLORMAP ((Atom) 7)
-#define XA_CURSOR ((Atom) 8)
-#define XA_CUT_BUFFER0 ((Atom) 9)
-#define XA_CUT_BUFFER1 ((Atom) 10)
-#define XA_CUT_BUFFER2 ((Atom) 11)
-#define XA_CUT_BUFFER3 ((Atom) 12)
-#define XA_CUT_BUFFER4 ((Atom) 13)
-#define XA_CUT_BUFFER5 ((Atom) 14)
-#define XA_CUT_BUFFER6 ((Atom) 15)
-#define XA_CUT_BUFFER7 ((Atom) 16)
-#define XA_DRAWABLE ((Atom) 17)
-#define XA_FONT ((Atom) 18)
-#define XA_INTEGER ((Atom) 19)
-#define XA_PIXMAP ((Atom) 20)
-#define XA_POINT ((Atom) 21)
-#define XA_RECTANGLE ((Atom) 22)
-#define XA_RESOURCE_MANAGER ((Atom) 23)
-#define XA_RGB_COLOR_MAP ((Atom) 24)
-#define XA_RGB_BEST_MAP ((Atom) 25)
-#define XA_RGB_BLUE_MAP ((Atom) 26)
-#define XA_RGB_DEFAULT_MAP ((Atom) 27)
-#define XA_RGB_GRAY_MAP ((Atom) 28)
-#define XA_RGB_GREEN_MAP ((Atom) 29)
-#define XA_RGB_RED_MAP ((Atom) 30)
-#define XA_STRING ((Atom) 31)
-#define XA_VISUALID ((Atom) 32)
-#define XA_WINDOW ((Atom) 33)
-#define XA_WM_COMMAND ((Atom) 34)
-#define XA_WM_HINTS ((Atom) 35)
-#define XA_WM_CLIENT_MACHINE ((Atom) 36)
-#define XA_WM_ICON_NAME ((Atom) 37)
-#define XA_WM_ICON_SIZE ((Atom) 38)
-#define XA_WM_NAME ((Atom) 39)
-#define XA_WM_NORMAL_HINTS ((Atom) 40)
-#define XA_WM_SIZE_HINTS ((Atom) 41)
-#define XA_WM_ZOOM_HINTS ((Atom) 42)
-#define XA_MIN_SPACE ((Atom) 43)
-#define XA_NORM_SPACE ((Atom) 44)
-#define XA_MAX_SPACE ((Atom) 45)
-#define XA_END_SPACE ((Atom) 46)
-#define XA_SUPERSCRIPT_X ((Atom) 47)
-#define XA_SUPERSCRIPT_Y ((Atom) 48)
-#define XA_SUBSCRIPT_X ((Atom) 49)
-#define XA_SUBSCRIPT_Y ((Atom) 50)
-#define XA_UNDERLINE_POSITION ((Atom) 51)
-#define XA_UNDERLINE_THICKNESS ((Atom) 52)
-#define XA_STRIKEOUT_ASCENT ((Atom) 53)
-#define XA_STRIKEOUT_DESCENT ((Atom) 54)
-#define XA_ITALIC_ANGLE ((Atom) 55)
-#define XA_X_HEIGHT ((Atom) 56)
-#define XA_QUAD_WIDTH ((Atom) 57)
-#define XA_WEIGHT ((Atom) 58)
-#define XA_POINT_SIZE ((Atom) 59)
-#define XA_RESOLUTION ((Atom) 60)
-#define XA_COPYRIGHT ((Atom) 61)
-#define XA_NOTICE ((Atom) 62)
-#define XA_FONT_NAME ((Atom) 63)
-#define XA_FAMILY_NAME ((Atom) 64)
-#define XA_FULL_NAME ((Atom) 65)
-#define XA_CAP_HEIGHT ((Atom) 66)
-#define XA_WM_CLASS ((Atom) 67)
-#define XA_WM_TRANSIENT_FOR ((Atom) 68)
-
-#define XA_LAST_PREDEFINED ((Atom) 68)
-#endif /* XATOM_H */
diff --git a/blt3.0.1/win/X11/Xfuncproto.h b/blt3.0.1/win/X11/Xfuncproto.h
deleted file mode 100644
index a59379b..0000000
--- a/blt3.0.1/win/X11/Xfuncproto.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* $XConsortium: Xfuncproto.h,v 1.7 91/05/13 20:49:21 rws Exp $ */
-/*
- * Copyright 1989, 1991 by the Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission. M.I.T. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- */
-
-/* Definitions to make function prototypes manageable */
-
-#ifndef _XFUNCPROTO_H_
-#define _XFUNCPROTO_H_
-
-#ifndef NeedFunctionPrototypes
-#define NeedFunctionPrototypes 1
-#endif /* NeedFunctionPrototypes */
-
-#ifndef NeedVarargsPrototypes
-#define NeedVarargsPrototypes 0
-#endif /* NeedVarargsPrototypes */
-
-#if NeedFunctionPrototypes
-
-#ifndef NeedNestedPrototypes
-#define NeedNestedPrototypes 1
-#endif /* NeedNestedPrototypes */
-
-#ifndef _Xconst
-#define _Xconst const
-#endif /* _Xconst */
-
-#ifndef NeedWidePrototypes
-#ifdef NARROWPROTO
-#define NeedWidePrototypes 0
-#else
-#define NeedWidePrototypes 1 /* default to make interropt. easier */
-#endif
-#endif /* NeedWidePrototypes */
-
-#endif /* NeedFunctionPrototypes */
-
-#ifdef __cplusplus
-#define _XFUNCPROTOBEGIN extern "C" {
-#define _XFUNCPROTOEND }
-#endif
-
-#ifndef _XFUNCPROTOBEGIN
-#define _XFUNCPROTOBEGIN
-#define _XFUNCPROTOEND
-#endif /* _XFUNCPROTOBEGIN */
-
-#endif /* _XFUNCPROTO_H_ */
diff --git a/blt3.0.1/win/X11/Xlib.h b/blt3.0.1/win/X11/Xlib.h
deleted file mode 100644
index f89d71a..0000000
--- a/blt3.0.1/win/X11/Xlib.h
+++ /dev/null
@@ -1,1468 +0,0 @@
-/* $XConsortium: Xlib.h,v 11.221 93/07/02 14:13:28 gildea Exp $ */
-/*
- * Copyright 1985, 1986, 1987, 1991 by the Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission. M.I.T. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * X Window System is a Trademark of MIT.
- *
- */
-
-
-/*
- * Xlib.h - Header definition and support file for the C subroutine
- * interface library (Xlib) to the X Window System Protocol (V11).
- * Structures and symbols starting with "_" are private to the library.
- */
-#ifndef _XLIB_H_
-#define _XLIB_H_
-
-#define XlibSpecificationRelease 5
-
-#ifdef MAC_TCL
-# include <X.h>
-# define Cursor XCursor
-# define Region XRegion
-#else
-# include <X11/X.h>
-#endif
-
-/* applications should not depend on these two headers being included! */
-#ifdef MAC_TCL
-#include <Xfuncproto.h>
-#else
-#include <X11/Xfuncproto.h>
-#endif
-
-#ifndef X_WCHAR
-#ifdef X_NOT_STDC_ENV
-#define X_WCHAR
-#endif
-#endif
-
-#ifndef X_WCHAR
-#include <stddef.h>
-#else
-/* replace this with #include or typedef appropriate for your system */
-typedef unsigned long wchar_t;
-#endif
-
-typedef char *XPointer;
-
-#define Bool int
-#ifdef MAC_TCL
-#define Status int
-#else
-typedef int Status;
-#endif
-#define True 1
-#define False 0
-
-#define QueuedAlready 0
-#define QueuedAfterReading 1
-#define QueuedAfterFlush 2
-
-#define ConnectionNumber(dpy) ((dpy)->fd)
-#define RootWindow(dpy, scr) (((dpy)->screens[(scr)]).root)
-#define DefaultScreen(dpy) ((dpy)->default_screen)
-#define DefaultRootWindow(dpy) (((dpy)->screens[(dpy)->default_screen]).root)
-#define DefaultVisual(dpy, scr) (((dpy)->screens[(scr)]).root_visual)
-#define DefaultGC(dpy, scr) (((dpy)->screens[(scr)]).default_gc)
-#define BlackPixel(dpy, scr) (((dpy)->screens[(scr)]).black_pixel)
-#define WhitePixel(dpy, scr) (((dpy)->screens[(scr)]).white_pixel)
-#define AllPlanes ((unsigned long)~0L)
-#define QLength(dpy) ((dpy)->qlen)
-#define DisplayWidth(dpy, scr) (((dpy)->screens[(scr)]).width)
-#define DisplayHeight(dpy, scr) (((dpy)->screens[(scr)]).height)
-#define DisplayWidthMM(dpy, scr)(((dpy)->screens[(scr)]).mwidth)
-#define DisplayHeightMM(dpy, scr)(((dpy)->screens[(scr)]).mheight)
-#define DisplayPlanes(dpy, scr) (((dpy)->screens[(scr)]).root_depth)
-#define DisplayCells(dpy, scr) (DefaultVisual((dpy), (scr))->map_entries)
-#define ScreenCount(dpy) ((dpy)->nscreens)
-#define ServerVendor(dpy) ((dpy)->vendor)
-#define ProtocolVersion(dpy) ((dpy)->proto_major_version)
-#define ProtocolRevision(dpy) ((dpy)->proto_minor_version)
-#define VendorRelease(dpy) ((dpy)->release)
-#define DisplayString(dpy) ((dpy)->display_name)
-#define DefaultDepth(dpy, scr) (((dpy)->screens[(scr)]).root_depth)
-#define DefaultColormap(dpy, scr)(((dpy)->screens[(scr)]).cmap)
-#define BitmapUnit(dpy) ((dpy)->bitmap_unit)
-#define BitmapBitOrder(dpy) ((dpy)->bitmap_bit_order)
-#define BitmapPad(dpy) ((dpy)->bitmap_pad)
-#define ImageByteOrder(dpy) ((dpy)->byte_order)
-#define NextRequest(dpy) ((dpy)->request + 1)
-#define LastKnownRequestProcessed(dpy) ((dpy)->request)
-
-/* macros for screen oriented applications (toolkit) */
-#define ScreenOfDisplay(dpy, scr)(&((dpy)->screens[(scr)]))
-#define DefaultScreenOfDisplay(dpy) (&((dpy)->screens[(dpy)->default_screen]))
-#define DisplayOfScreen(s) ((s)->display)
-#define RootWindowOfScreen(s) ((s)->root)
-#define BlackPixelOfScreen(s) ((s)->black_pixel)
-#define WhitePixelOfScreen(s) ((s)->white_pixel)
-#define DefaultColormapOfScreen(s)((s)->cmap)
-#define DefaultDepthOfScreen(s) ((s)->root_depth)
-#define DefaultGCOfScreen(s) ((s)->default_gc)
-#define DefaultVisualOfScreen(s)((s)->root_visual)
-#define WidthOfScreen(s) ((s)->width)
-#define HeightOfScreen(s) ((s)->height)
-#define WidthMMOfScreen(s) ((s)->mwidth)
-#define HeightMMOfScreen(s) ((s)->mheight)
-#define PlanesOfScreen(s) ((s)->root_depth)
-#define CellsOfScreen(s) (DefaultVisualOfScreen((s))->map_entries)
-#define MinCmapsOfScreen(s) ((s)->min_maps)
-#define MaxCmapsOfScreen(s) ((s)->max_maps)
-#define DoesSaveUnders(s) ((s)->save_unders)
-#define DoesBackingStore(s) ((s)->backing_store)
-#define EventMaskOfScreen(s) ((s)->root_input_mask)
-
-/*
- * Extensions need a way to hang private data on some structures.
- */
-typedef struct _XExtData {
- int number; /* number returned by XRegisterExtension */
- struct _XExtData *next; /* next item on list of data for structure */
- int (*free_private)(); /* called to free private storage */
- XPointer private_data; /* data private to this extension. */
-} XExtData;
-
-/*
- * This file contains structures used by the extension mechanism.
- */
-typedef struct { /* public to extension, cannot be changed */
- int extension; /* extension number */
- int major_opcode; /* major op-code assigned by server */
- int first_event; /* first event number for the extension */
- int first_error; /* first error number for the extension */
-} XExtCodes;
-
-/*
- * Data structure for retrieving info about pixmap formats.
- */
-
-typedef struct {
- int depth;
- int bits_per_pixel;
- int scanline_pad;
-} XPixmapFormatValues;
-
-
-/*
- * Data structure for setting graphics context.
- */
-typedef struct {
- int function; /* logical operation */
- unsigned long plane_mask;/* plane mask */
- unsigned long foreground;/* foreground pixel */
- unsigned long background;/* background pixel */
- int line_width; /* line width */
- int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */
- int cap_style; /* CapNotLast, CapButt,
- CapRound, CapProjecting */
- int join_style; /* JoinMiter, JoinRound, JoinBevel */
- int fill_style; /* FillSolid, FillTiled,
- FillStippled, FillOpaeueStippled */
- int fill_rule; /* EvenOddRule, WindingRule */
- int arc_mode; /* ArcChord, ArcPieSlice */
- Pixmap tile; /* tile pixmap for tiling operations */
- Pixmap stipple; /* stipple 1 plane pixmap for stipping */
- int ts_x_origin; /* offset for tile or stipple operations */
- int ts_y_origin;
- Font font; /* default text font for text operations */
- int subwindow_mode; /* ClipByChildren, IncludeInferiors */
- Bool graphics_exposures;/* boolean, should exposures be generated */
- int clip_x_origin; /* origin for clipping */
- int clip_y_origin;
- Pixmap clip_mask; /* bitmap clipping; other calls for rects */
- int dash_offset; /* patterned/dashed line information */
- char dashes;
-} XGCValues;
-
-/*
- * Graphics context. The contents of this structure are implementation
- * dependent. A GC should be treated as opaque by application code.
- */
-
-typedef XGCValues *GC;
-
-/*
- * Visual structure; contains information about colormapping possible.
- */
-typedef struct {
- XExtData *ext_data; /* hook for extension to hang data */
- VisualID visualid; /* visual id of this visual */
-#if defined(__cplusplus) || defined(c_plusplus)
- int c_class; /* C++ class of screen (monochrome, etc.) */
-#else
- int class; /* class of screen (monochrome, etc.) */
-#endif
- unsigned long red_mask, green_mask, blue_mask; /* mask values */
- int bits_per_rgb; /* log base 2 of distinct color values */
- int map_entries; /* color map entries */
-} Visual;
-
-/*
- * Depth structure; contains information for each possible depth.
- */
-typedef struct {
- int depth; /* this depth (Z) of the depth */
- int nvisuals; /* number of Visual types at this depth */
- Visual *visuals; /* list of visuals possible at this depth */
-} Depth;
-
-/*
- * Information about the screen. The contents of this structure are
- * implementation dependent. A Screen should be treated as opaque
- * by application code.
- */
-typedef struct {
- XExtData *ext_data; /* hook for extension to hang data */
- struct _XDisplay *display;/* back pointer to display structure */
- Window root; /* Root window id. */
- int width, height; /* width and height of screen */
- int mwidth, mheight; /* width and height of in millimeters */
- int ndepths; /* number of depths possible */
- Depth *depths; /* list of allowable depths on the screen */
- int root_depth; /* bits per pixel */
- Visual *root_visual; /* root visual */
- GC default_gc; /* GC for the root root visual */
- Colormap cmap; /* default color map */
- unsigned long white_pixel;
- unsigned long black_pixel; /* White and Black pixel values */
- int max_maps, min_maps; /* max and min color maps */
- int backing_store; /* Never, WhenMapped, Always */
- Bool save_unders;
- long root_input_mask; /* initial root input mask */
-} Screen;
-
-/*
- * Format structure; describes ZFormat data the screen will understand.
- */
-typedef struct {
- XExtData *ext_data; /* hook for extension to hang data */
- int depth; /* depth of this image format */
- int bits_per_pixel; /* bits/pixel at this depth */
- int scanline_pad; /* scanline must padded to this multiple */
-} ScreenFormat;
-
-/*
- * Data structure for setting window attributes.
- */
-typedef struct {
- Pixmap background_pixmap; /* background or None or ParentRelative */
- unsigned long background_pixel; /* background pixel */
- Pixmap border_pixmap; /* border of the window */
- unsigned long border_pixel; /* border pixel value */
- int bit_gravity; /* one of bit gravity values */
- int win_gravity; /* one of the window gravity values */
- int backing_store; /* NotUseful, WhenMapped, Always */
- unsigned long backing_planes;/* planes to be preseved if possible */
- unsigned long backing_pixel;/* value to use in restoring planes */
- Bool save_under; /* should bits under be saved? (popups) */
- long event_mask; /* set of events that should be saved */
- long do_not_propagate_mask; /* set of events that should not propagate */
- Bool override_redirect; /* boolean value for override-redirect */
- Colormap colormap; /* color map to be associated with window */
- Cursor cursor; /* cursor to be displayed (or None) */
-} XSetWindowAttributes;
-
-typedef struct {
- int x, y; /* location of window */
- int width, height; /* width and height of window */
- int border_width; /* border width of window */
- int depth; /* depth of window */
- Visual *visual; /* the associated visual structure */
- Window root; /* root of screen containing window */
-#if defined(__cplusplus) || defined(c_plusplus)
- int c_class; /* C++ InputOutput, InputOnly*/
-#else
- int class; /* InputOutput, InputOnly*/
-#endif
- int bit_gravity; /* one of bit gravity values */
- int win_gravity; /* one of the window gravity values */
- int backing_store; /* NotUseful, WhenMapped, Always */
- unsigned long backing_planes;/* planes to be preserved if possible */
- unsigned long backing_pixel;/* value to be used when restoring planes */
- Bool save_under; /* boolean, should bits under be saved? */
- Colormap colormap; /* color map to be associated with window */
- Bool map_installed; /* boolean, is color map currently installed*/
- int map_state; /* IsUnmapped, IsUnviewable, IsViewable */
- long all_event_masks; /* set of events all people have interest in*/
- long your_event_mask; /* my event mask */
- long do_not_propagate_mask; /* set of events that should not propagate */
- Bool override_redirect; /* boolean value for override-redirect */
- Screen *screen; /* back pointer to correct screen */
-} XWindowAttributes;
-
-/*
- * Data structure for host setting; getting routines.
- *
- */
-
-typedef struct {
- int family; /* for example FamilyInternet */
- int length; /* length of address, in bytes */
- char *address; /* pointer to where to find the bytes */
-} XHostAddress;
-
-/*
- * Data structure for "image" data, used by image manipulation routines.
- */
-typedef struct _XImage {
- int width, height; /* size of image */
- int xoffset; /* number of pixels offset in X direction */
- int format; /* XYBitmap, XYPixmap, ZPixmap */
- char *data; /* pointer to image data */
- int byte_order; /* data byte order, LSBFirst, MSBFirst */
- int bitmap_unit; /* quant. of scanline 8, 16, 32 */
- int bitmap_bit_order; /* LSBFirst, MSBFirst */
- int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */
- int depth; /* depth of image */
- int bytes_per_line; /* accelarator to next line */
- int bits_per_pixel; /* bits per pixel (ZPixmap) */
- unsigned long red_mask; /* bits in z arrangment */
- unsigned long green_mask;
- unsigned long blue_mask;
- XPointer obdata; /* hook for the object routines to hang on */
- struct funcs { /* image manipulation routines */
- struct _XImage *(*create_image)();
-#if NeedFunctionPrototypes
- int (*destroy_image) (struct _XImage *);
- unsigned long (*get_pixel) (struct _XImage *, int, int);
- int (*put_pixel) (struct _XImage *, int, int, unsigned long);
- struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int);
- int (*add_pixel) (struct _XImage *, long);
-#else
- int (*destroy_image)();
- unsigned long (*get_pixel)();
- int (*put_pixel)();
- struct _XImage *(*sub_image)();
- int (*add_pixel)();
-#endif
- } f;
-} XImage;
-
-/*
- * Data structure for XReconfigureWindow
- */
-typedef struct {
- int x, y;
- int width, height;
- int border_width;
- Window sibling;
- int stack_mode;
-} XWindowChanges;
-
-/*
- * Data structure used by color operations
- */
-typedef struct {
- unsigned long pixel;
- unsigned short red, green, blue;
- char flags; /* do_red, do_green, do_blue */
- char pad;
-} XColor;
-
-/*
- * Data structures for graphics operations. On most machines, these are
- * congruent with the wire protocol structures, so reformatting the data
- * can be avoided on these architectures.
- */
-typedef struct {
- short x1, y1, x2, y2;
-} XSegment;
-
-typedef struct {
- short x, y;
-} XPoint;
-
-typedef struct {
- short x, y;
- unsigned short width, height;
-} XRectangle;
-
-typedef struct {
- short x, y;
- unsigned short width, height;
- short angle1, angle2;
-} XArc;
-
-
-/* Data structure for XChangeKeyboardControl */
-
-typedef struct {
- int key_click_percent;
- int bell_percent;
- int bell_pitch;
- int bell_duration;
- int led;
- int led_mode;
- int key;
- int auto_repeat_mode; /* On, Off, Default */
-} XKeyboardControl;
-
-/* Data structure for XGetKeyboardControl */
-
-typedef struct {
- int key_click_percent;
- int bell_percent;
- unsigned int bell_pitch, bell_duration;
- unsigned long led_mask;
- int global_auto_repeat;
- char auto_repeats[32];
-} XKeyboardState;
-
-/* Data structure for XGetMotionEvents. */
-
-typedef struct {
- Time time;
- short x, y;
-} XTimeCoord;
-
-/* Data structure for X{Set,Get}ModifierMapping */
-
-typedef struct {
- int max_keypermod; /* The server's max # of keys per modifier */
- KeyCode *modifiermap; /* An 8 by max_keypermod array of modifiers */
-} XModifierKeymap;
-
-
-/*
- * Display datatype maintaining display specific data.
- * The contents of this structure are implementation dependent.
- * A Display should be treated as opaque by application code.
- */
-typedef struct _XDisplay {
- XExtData *ext_data; /* hook for extension to hang data */
- struct _XFreeFuncs *free_funcs; /* internal free functions */
- int fd; /* Network socket. */
- int conn_checker; /* ugly thing used by _XEventsQueued */
- int proto_major_version;/* maj. version of server's X protocol */
- int proto_minor_version;/* minor version of servers X protocol */
- char *vendor; /* vendor of the server hardware */
- XID resource_base; /* resource ID base */
- XID resource_mask; /* resource ID mask bits */
- XID resource_id; /* allocator current ID */
- int resource_shift; /* allocator shift to correct bits */
- XID (*resource_alloc)(); /* allocator function */
- int byte_order; /* screen byte order, LSBFirst, MSBFirst */
- int bitmap_unit; /* padding and data requirements */
- int bitmap_pad; /* padding requirements on bitmaps */
- int bitmap_bit_order; /* LeastSignificant or MostSignificant */
- int nformats; /* number of pixmap formats in list */
- ScreenFormat *pixmap_format; /* pixmap format list */
- int vnumber; /* Xlib's X protocol version number. */
- int release; /* release of the server */
- struct _XSQEvent *head, *tail; /* Input event queue. */
- int qlen; /* Length of input event queue */
- unsigned long request; /* sequence number of last request. */
- char *last_req; /* beginning of last request, or dummy */
- char *buffer; /* Output buffer starting address. */
- char *bufptr; /* Output buffer index pointer. */
- char *bufmax; /* Output buffer maximum+1 address. */
- unsigned max_request_size; /* maximum number 32 bit words in request*/
- struct _XrmHashBucketRec *db;
- int (*synchandler)(); /* Synchronization handler */
- char *display_name; /* "host:display" string used on this connect*/
- int default_screen; /* default screen for operations */
- int nscreens; /* number of screens on this server*/
- Screen *screens; /* pointer to list of screens */
- unsigned long motion_buffer; /* size of motion buffer */
- unsigned long flags; /* internal connection flags */
- int min_keycode; /* minimum defined keycode */
- int max_keycode; /* maximum defined keycode */
- KeySym *keysyms; /* This server's keysyms */
- XModifierKeymap *modifiermap; /* This server's modifier keymap */
- int keysyms_per_keycode;/* number of rows */
- char *xdefaults; /* contents of defaults from server */
- char *scratch_buffer; /* place to hang scratch buffer */
- unsigned long scratch_length; /* length of scratch buffer */
- int ext_number; /* extension number on this display */
- struct _XExten *ext_procs; /* extensions initialized on this display */
- /*
- * the following can be fixed size, as the protocol defines how
- * much address space is available.
- * While this could be done using the extension vector, there
- * may be MANY events processed, so a search through the extension
- * list to find the right procedure for each event might be
- * expensive if many extensions are being used.
- */
- Bool (*event_vec[128])(); /* vector for wire to event */
- Status (*wire_vec[128])(); /* vector for event to wire */
- KeySym lock_meaning; /* for XLookupString */
- struct _XLockInfo *lock; /* multi-thread state, display lock */
- struct _XInternalAsync *async_handlers; /* for internal async */
- unsigned long bigreq_size; /* max size of big requests */
- struct _XLockPtrs *lock_fns; /* pointers to threads functions */
- /* things above this line should not move, for binary compatibility */
- struct _XKeytrans *key_bindings; /* for XLookupString */
- Font cursor_font; /* for XCreateFontCursor */
- struct _XDisplayAtoms *atoms; /* for XInternAtom */
- unsigned int mode_switch; /* keyboard group modifiers */
- struct _XContextDB *context_db; /* context database */
- Bool (**error_vec)(); /* vector for wire to error */
- /*
- * Xcms information
- */
- struct {
- XPointer defaultCCCs; /* pointer to an array of default XcmsCCC */
- XPointer clientCmaps; /* pointer to linked list of XcmsCmapRec */
- XPointer perVisualIntensityMaps;
- /* linked list of XcmsIntensityMap */
- } cms;
- struct _XIMFilter *im_filters;
- struct _XSQEvent *qfree; /* unallocated event queue elements */
- unsigned long next_event_serial_num; /* inserted into next queue elt */
- int (*savedsynchandler)(); /* user synchandler when Xlib usurps */
-} Display;
-
-#if NeedFunctionPrototypes /* prototypes require event type definitions */
-#undef _XEVENT_
-#endif
-#ifndef _XEVENT_
-
-#define XMaxTransChars 4
-
-/*
- * Definitions of specific events.
- */
-typedef struct {
- int type; /* of event */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* "event" window it is reported relative to */
- Window root; /* root window that the event occured on */
- Window subwindow; /* child window */
- Time time; /* milliseconds */
- int x, y; /* pointer x, y coordinates in event window */
- int x_root, y_root; /* coordinates relative to root */
- unsigned int state; /* key or button mask */
- unsigned int keycode; /* detail */
- Bool same_screen; /* same screen flag */
- char trans_chars[XMaxTransChars];
- /* translated characters */
- int nbytes;
-} XKeyEvent;
-typedef XKeyEvent XKeyPressedEvent;
-typedef XKeyEvent XKeyReleasedEvent;
-
-typedef struct {
- int type; /* of event */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* "event" window it is reported relative to */
- Window root; /* root window that the event occured on */
- Window subwindow; /* child window */
- Time time; /* milliseconds */
- int x, y; /* pointer x, y coordinates in event window */
- int x_root, y_root; /* coordinates relative to root */
- unsigned int state; /* key or button mask */
- unsigned int button; /* detail */
- Bool same_screen; /* same screen flag */
-} XButtonEvent;
-typedef XButtonEvent XButtonPressedEvent;
-typedef XButtonEvent XButtonReleasedEvent;
-
-typedef struct {
- int type; /* of event */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* "event" window reported relative to */
- Window root; /* root window that the event occured on */
- Window subwindow; /* child window */
- Time time; /* milliseconds */
- int x, y; /* pointer x, y coordinates in event window */
- int x_root, y_root; /* coordinates relative to root */
- unsigned int state; /* key or button mask */
- char is_hint; /* detail */
- Bool same_screen; /* same screen flag */
-} XMotionEvent;
-typedef XMotionEvent XPointerMovedEvent;
-
-typedef struct {
- int type; /* of event */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* "event" window reported relative to */
- Window root; /* root window that the event occured on */
- Window subwindow; /* child window */
- Time time; /* milliseconds */
- int x, y; /* pointer x, y coordinates in event window */
- int x_root, y_root; /* coordinates relative to root */
- int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
- int detail;
- /*
- * NotifyAncestor, NotifyVirtual, NotifyInferior,
- * NotifyNonlinear,NotifyNonlinearVirtual
- */
- Bool same_screen; /* same screen flag */
- Bool focus; /* boolean focus */
- unsigned int state; /* key or button mask */
-} XCrossingEvent;
-typedef XCrossingEvent XEnterWindowEvent;
-typedef XCrossingEvent XLeaveWindowEvent;
-
-typedef struct {
- int type; /* FocusIn or FocusOut */
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* window of event */
- int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
- int detail;
- /*
- * NotifyAncestor, NotifyVirtual, NotifyInferior,
- * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
- * NotifyPointerRoot, NotifyDetailNone
- */
-} XFocusChangeEvent;
-typedef XFocusChangeEvent XFocusInEvent;
-typedef XFocusChangeEvent XFocusOutEvent;
-
-/* generated on EnterWindow and FocusIn when KeyMapState selected */
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- char key_vector[32];
-} XKeymapEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- int x, y;
- int width, height;
- int count; /* if non-zero, at least this many more */
-} XExposeEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Drawable drawable;
- int x, y;
- int width, height;
- int count; /* if non-zero, at least this many more */
- int major_code; /* core is CopyArea or CopyPlane */
- int minor_code; /* not defined in the core */
-} XGraphicsExposeEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Drawable drawable;
- int major_code; /* core is CopyArea or CopyPlane */
- int minor_code; /* not defined in the core */
-} XNoExposeEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- int state; /* Visibility state */
-} XVisibilityEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window parent; /* parent of the window */
- Window window; /* window id of window created */
- int x, y; /* window location */
- int width, height; /* size of window */
- int border_width; /* border width */
- Bool override_redirect; /* creation should be overridden */
-} XCreateWindowEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
-} XDestroyWindowEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
- Bool from_configure;
-} XUnmapEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
- Bool override_redirect; /* boolean, is override set... */
-} XMapEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window parent;
- Window window;
-} XMapRequestEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
- Window parent;
- int x, y;
- Bool override_redirect;
-} XReparentEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
- int x, y;
- int width, height;
- int border_width;
- Window above;
- Bool override_redirect;
-} XConfigureEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
- int x, y;
-} XGravityEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- int width, height;
-} XResizeRequestEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window parent;
- Window window;
- int x, y;
- int width, height;
- int border_width;
- Window above;
- int detail; /* Above, Below, TopIf, BottomIf, Opposite */
- unsigned long value_mask;
-} XConfigureRequestEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event;
- Window window;
- int place; /* PlaceOnTop, PlaceOnBottom */
-} XCirculateEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window parent;
- Window window;
- int place; /* PlaceOnTop, PlaceOnBottom */
-} XCirculateRequestEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- Atom atom;
- Time time;
- int state; /* NewValue, Deleted */
-} XPropertyEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- Atom selection;
- Time time;
-} XSelectionClearEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window owner;
- Window requestor;
- Atom selection;
- Atom target;
- Atom property;
- Time time;
-} XSelectionRequestEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window requestor;
- Atom selection;
- Atom target;
- Atom property; /* ATOM or None */
- Time time;
-} XSelectionEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- Colormap colormap; /* COLORMAP or None */
-#if defined(__cplusplus) || defined(c_plusplus)
- Bool c_new; /* C++ */
-#else
- Bool new;
-#endif
- int state; /* ColormapInstalled, ColormapUninstalled */
-} XColormapEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window;
- Atom message_type;
- int format;
- union {
- char b[20];
- short s[10];
- long l[5];
- } data;
-} XClientMessageEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* unused */
- int request; /* one of MappingModifier, MappingKeyboard,
- MappingPointer */
- int first_keycode; /* first keycode */
- int count; /* defines range of change w. first_keycode*/
-} XMappingEvent;
-
-typedef struct {
- int type;
- Display *display; /* Display the event was read from */
- XID resourceid; /* resource id */
- unsigned long serial; /* serial number of failed request */
- unsigned char error_code; /* error code of failed request */
- unsigned char request_code; /* Major op-code of failed request */
- unsigned char minor_code; /* Minor op-code of failed request */
-} XErrorEvent;
-
-typedef struct {
- int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* true if this came from a SendEvent request */
- Display *display;/* Display the event was read from */
- Window window; /* window on which event was requested in event mask */
-} XAnyEvent;
-
-/*
- * this union is defined so Xlib can always use the same sized
- * event structure internally, to avoid memory fragmentation.
- */
-typedef union _XEvent {
- int type; /* must not be changed; first element */
- XAnyEvent xany;
- XKeyEvent xkey;
- XButtonEvent xbutton;
- XMotionEvent xmotion;
- XCrossingEvent xcrossing;
- XFocusChangeEvent xfocus;
- XExposeEvent xexpose;
- XGraphicsExposeEvent xgraphicsexpose;
- XNoExposeEvent xnoexpose;
- XVisibilityEvent xvisibility;
- XCreateWindowEvent xcreatewindow;
- XDestroyWindowEvent xdestroywindow;
- XUnmapEvent xunmap;
- XMapEvent xmap;
- XMapRequestEvent xmaprequest;
- XReparentEvent xreparent;
- XConfigureEvent xconfigure;
- XGravityEvent xgravity;
- XResizeRequestEvent xresizerequest;
- XConfigureRequestEvent xconfigurerequest;
- XCirculateEvent xcirculate;
- XCirculateRequestEvent xcirculaterequest;
- XPropertyEvent xproperty;
- XSelectionClearEvent xselectionclear;
- XSelectionRequestEvent xselectionrequest;
- XSelectionEvent xselection;
- XColormapEvent xcolormap;
- XClientMessageEvent xclient;
- XMappingEvent xmapping;
- XErrorEvent xerror;
- XKeymapEvent xkeymap;
- long pad[24];
-} XEvent;
-#endif
-
-#define XAllocID(dpy) ((*(dpy)->resource_alloc)((dpy)))
-
-/*
- * per character font metric information.
- */
-typedef struct {
- short lbearing; /* origin to left edge of raster */
- short rbearing; /* origin to right edge of raster */
- short width; /* advance to next char's origin */
- short ascent; /* baseline to top edge of raster */
- short descent; /* baseline to bottom edge of raster */
- unsigned short attributes; /* per char flags (not predefined) */
-} XCharStruct;
-
-/*
- * To allow arbitrary information with fonts, there are additional properties
- * returned.
- */
-typedef struct {
- Atom name;
- unsigned long card32;
-} XFontProp;
-
-typedef struct {
- XExtData *ext_data; /* hook for extension to hang data */
- Font fid; /* Font id for this font */
- unsigned direction; /* hint about direction the font is painted */
- unsigned min_char_or_byte2;/* first character */
- unsigned max_char_or_byte2;/* last character */
- unsigned min_byte1; /* first row that exists */
- unsigned max_byte1; /* last row that exists */
- Bool all_chars_exist;/* flag if all characters have non-zero size*/
- unsigned default_char; /* char to print for undefined character */
- int n_properties; /* how many properties there are */
- XFontProp *properties; /* pointer to array of additional properties*/
- XCharStruct min_bounds; /* minimum bounds over all existing char*/
- XCharStruct max_bounds; /* maximum bounds over all existing char*/
- XCharStruct *per_char; /* first_char to last_char information */
- int ascent; /* log. extent above baseline for spacing */
- int descent; /* log. descent below baseline for spacing */
-} XFontStruct;
-
-/*
- * PolyText routines take these as arguments.
- */
-typedef struct {
- char *chars; /* pointer to string */
- int nchars; /* number of characters */
- int delta; /* delta between strings */
- Font font; /* font to print it in, None don't change */
-} XTextItem;
-
-typedef struct { /* normal 16 bit characters are two bytes */
- unsigned char byte1;
- unsigned char byte2;
-} XChar2b;
-
-typedef struct {
- XChar2b *chars; /* two byte characters */
- int nchars; /* number of characters */
- int delta; /* delta between strings */
- Font font; /* font to print it in, None don't change */
-} XTextItem16;
-
-
-typedef union { Display *display;
- GC gc;
- Visual *visual;
- Screen *screen;
- ScreenFormat *pixmap_format;
- XFontStruct *font; } XEDataObject;
-
-typedef struct {
- XRectangle max_ink_extent;
- XRectangle max_logical_extent;
-} XFontSetExtents;
-
-typedef struct _XFontSet *XFontSet;
-
-typedef struct {
- char *chars;
- int nchars;
- int delta;
- XFontSet font_set;
-} XmbTextItem;
-
-typedef struct {
- wchar_t *chars;
- int nchars;
- int delta;
- XFontSet font_set;
-} XwcTextItem;
-
-typedef void (*XIMProc)();
-
-typedef struct _XIM *XIM;
-typedef struct _XIC *XIC;
-
-typedef unsigned long XIMStyle;
-
-typedef struct {
- unsigned short count_styles;
- XIMStyle *supported_styles;
-} XIMStyles;
-
-#define XIMPreeditArea 0x0001L
-#define XIMPreeditCallbacks 0x0002L
-#define XIMPreeditPosition 0x0004L
-#define XIMPreeditNothing 0x0008L
-#define XIMPreeditNone 0x0010L
-#define XIMStatusArea 0x0100L
-#define XIMStatusCallbacks 0x0200L
-#define XIMStatusNothing 0x0400L
-#define XIMStatusNone 0x0800L
-
-#define XNVaNestedList "XNVaNestedList"
-#define XNClientWindow "clientWindow"
-#define XNInputStyle "inputStyle"
-#define XNFocusWindow "focusWindow"
-#define XNResourceName "resourceName"
-#define XNResourceClass "resourceClass"
-#define XNGeometryCallback "geometryCallback"
-#define XNFilterEvents "filterEvents"
-#define XNPreeditStartCallback "preeditStartCallback"
-#define XNPreeditDoneCallback "preeditDoneCallback"
-#define XNPreeditDrawCallback "preeditDrawCallback"
-#define XNPreeditCaretCallback "preeditCaretCallback"
-#define XNPreeditAttributes "preeditAttributes"
-#define XNStatusStartCallback "statusStartCallback"
-#define XNStatusDoneCallback "statusDoneCallback"
-#define XNStatusDrawCallback "statusDrawCallback"
-#define XNStatusAttributes "statusAttributes"
-#define XNArea "area"
-#define XNAreaNeeded "areaNeeded"
-#define XNSpotLocation "spotLocation"
-#define XNColormap "colorMap"
-#define XNStdColormap "stdColorMap"
-#define XNForeground "foreground"
-#define XNBackground "background"
-#define XNBackgroundPixmap "backgroundPixmap"
-#define XNFontSet "fontSet"
-#define XNLineSpace "lineSpace"
-#define XNCursor "cursor"
-
-#define XBufferOverflow -1
-#define XLookupNone 1
-#define XLookupChars 2
-#define XLookupKeySym 3
-#define XLookupBoth 4
-
-#if NeedFunctionPrototypes
-typedef void *XVaNestedList;
-#else
-typedef XPointer XVaNestedList;
-#endif
-
-typedef struct {
- XPointer client_data;
- XIMProc callback;
-} XIMCallback;
-
-typedef unsigned long XIMFeedback;
-
-#define XIMReverse 1
-#define XIMUnderline (1<<1)
-#define XIMHighlight (1<<2)
-#define XIMPrimary (1<<5)
-#define XIMSecondary (1<<6)
-#define XIMTertiary (1<<7)
-
-typedef struct _XIMText {
- unsigned short length;
- XIMFeedback *feedback;
- Bool encoding_is_wchar;
- union {
- char *multi_byte;
- wchar_t *wide_char;
- } string;
-} XIMText;
-
-typedef struct _XIMPreeditDrawCallbackStruct {
- int caret; /* Cursor offset within pre-edit string */
- int chg_first; /* Starting change position */
- int chg_length; /* Length of the change in character count */
- XIMText *text;
-} XIMPreeditDrawCallbackStruct;
-
-typedef enum {
- XIMForwardChar, XIMBackwardChar,
- XIMForwardWord, XIMBackwardWord,
- XIMCaretUp, XIMCaretDown,
- XIMNextLine, XIMPreviousLine,
- XIMLineStart, XIMLineEnd,
- XIMAbsolutePosition,
- XIMDontChange
-} XIMCaretDirection;
-
-typedef enum {
- XIMIsInvisible, /* Disable caret feedback */
- XIMIsPrimary, /* UI defined caret feedback */
- XIMIsSecondary /* UI defined caret feedback */
-} XIMCaretStyle;
-
-typedef struct _XIMPreeditCaretCallbackStruct {
- int position; /* Caret offset within pre-edit string */
- XIMCaretDirection direction; /* Caret moves direction */
- XIMCaretStyle style; /* Feedback of the caret */
-} XIMPreeditCaretCallbackStruct;
-
-typedef enum {
- XIMTextType,
- XIMBitmapType
-} XIMStatusDataType;
-
-typedef struct _XIMStatusDrawCallbackStruct {
- XIMStatusDataType type;
- union {
- XIMText *text;
- Pixmap bitmap;
- } data;
-} XIMStatusDrawCallbackStruct;
-
-typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */
-#if NeedFunctionPrototypes
- Display* /* display */,
- XErrorEvent* /* error_event */
-#endif
-);
-
-_XFUNCPROTOBEGIN
-
-#include "X11/Xutil.h"
-
-extern void XSetDashes(Display * display, GC gc, int dash_offset,
- _Xconst char* dash_list, int n);
-
-extern XModifierKeymap *XGetModifierMapping(Display *display);
-
-extern XImage *XCreateImage(Display *display, Visual *visual, unsigned int ui1,
- int i1, int i2, char* cp, unsigned int ui2, unsigned int ui3,
- int i3, int i4);
-
-extern XImage *XGetImage(Display* display,Drawable dr, int i1, int i2,
- unsigned int ui1, unsigned int ui2, unsigned long ul, int i3);
-
-extern char *XGetAtomName(Display *d, Atom a);
-
-extern char *XKeysymToString(KeySym k);
-
-extern Colormap XCreateColormap(Display *d, Window w, Visual* v,
- int i);
-
-extern Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2,
- XColor* x1, XColor* x2, unsigned int ui1, unsigned int ui2);
-
-extern Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2,
- unsigned int ui1, unsigned int ui2, XColor* x1, XColor* x2);
-
-extern GContext XGContextFromGC(GC g);
-
-extern XHostAddress *XListHosts(Display *d, int* i, Bool* b);
-
-extern KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i);
-
-extern KeySym XStringToKeysym(_Xconst char* c);
-
-extern Window XRootWindow(Display *d, int i);
-
-extern XErrorHandler XSetErrorHandler(XErrorHandler x);
-
-extern Status XIconifyWindow(Display *d, Window w, int i);
-
-extern Status XWithdrawWindow(Display *d, Window w, int i);
-
-extern Status XGetWMColormapWindows(Display *d, Window w, Window** wpp,
- int* ip);
-
-extern Status XAllocColor(Display *d, Colormap c, XColor* xp);
-
-extern void XBell(Display *d, int i);
-
-extern void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1,
- int i2, _Xconst unsigned char* c, int i3);
-
-extern void XChangeWindowAttributes(Display *d, Window w, unsigned long ul,
- XSetWindowAttributes* x);
-
-extern void XClearWindow(Display *d, Window w);
-
-extern void XConfigureWindow(Display *d, Window w, unsigned int i,
- XWindowChanges* x);
-
-extern void XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1,
- int i2, unsigned int ui1, unsigned int ui2, int i3, int i4);
-
-extern void XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1,
- int i2, unsigned int ui1, unsigned int ui2, int i3, int i4,
- unsigned long ul);
-
-extern Pixmap XCreateBitmapFromData(Display *display, Drawable d,
- _Xconst char* data, unsigned int width, unsigned int height);
-
-extern void XDefineCursor(Display *d, Window w, Cursor c);
-
-extern void XDeleteProperty(Display *d, Window w, Atom a);
-
-extern void XDestroyWindow(Display *d, Window w);
-
-extern void XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2,
- unsigned int ui1, unsigned int ui2, int i3, int i4);
-
-extern void XDrawLines(Display *d, Drawable dr, GC g, XPoint* x, int i1,
- int i2);
-
-extern void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2,
- unsigned int ui1, unsigned int ui2);
-
-extern void XFillArc(Display *d, Drawable dr, GC g, int i1, int i2,
- unsigned int ui1, unsigned int ui2, int i3, int i4);
-
-extern void XFillPolygon(Display *d, Drawable dr, GC g, XPoint* x, int i1,
- int i2, int i3);
-
-extern void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle* x,
- int i);
-
-extern void XForceScreenSaver(Display *d, int i);
-
-extern void XFreeColormap(Display *d, Colormap c);
-
-extern void XFreeColors(Display *d, Colormap c, unsigned long* ulp, int i,
- unsigned long ul);
-
-extern void XFreeCursor(Display *d, Cursor c);
-
-extern void XFreeModifiermap(XModifierKeymap* x);
-
-extern Status XGetGeometry(Display *d, Drawable dr, Window* w, int* i1,
- int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3,
- unsigned int* ui4);
-
-extern void XGetInputFocus(Display *d, Window* w, int* i);
-
-extern int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2,
- Bool b, Atom a2, Atom* ap, int* ip, unsigned long* ulp1,
- unsigned long* ulp2, unsigned char** cpp);
-
-extern Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes* x);
-
-extern int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t);
-
-extern int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui, int i1,
- int i2, Window w2, Cursor c, Time t);
-
-extern KeyCode XKeysymToKeycode(Display *d, KeySym k);
-
-extern Status XLookupColor(Display *d, Colormap c1, _Xconst char* c2,
- XColor* x1, XColor* x2);
-
-extern void XMapWindow(Display *d, Window w);
-
-extern void XMoveResizeWindow(Display *d, Window w, int i1, int i2,
- unsigned int ui1, unsigned int ui2);
-
-extern void XMoveWindow(Display *d, Window w, int i1, int i2);
-
-extern void XNextEvent(Display *d, XEvent* x);
-
-extern void XPutBackEvent(Display *d, XEvent* x);
-
-extern void XQueryColors(Display *d, Colormap c, XColor* x, int i);
-
-extern Bool XQueryPointer(Display *d, Window w1, Window* w2, Window* w3,
- int* i1, int* i2, int* i3, int* i4, unsigned int* ui);
-
-extern Status XQueryTree(Display *d, Window w1, Window* w2, Window* w3,
- Window** w4, unsigned int* ui);
-
-extern void XRaiseWindow(Display *d, Window w);
-
-extern void XRefreshKeyboardMapping(XMappingEvent* x);
-
-extern void XResizeWindow(Display *d, Window w, unsigned int ui1,
- unsigned int ui2);
-
-extern void XSelectInput(Display *d, Window w, long l);
-
-extern Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent* x);
-
-extern void XSetCommand(Display *d, Window w, CONST char** c, int i);
-
-extern void XSetIconName(Display *d, Window w, _Xconst char* c);
-
-extern void XSetInputFocus(Display *d, Window w, int i, Time t);
-
-extern void XSetSelectionOwner(Display *d, Atom a, Window w, Time t);
-
-extern void XSetWindowBackground(Display *d, Window w, unsigned long ul);
-
-extern void XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p);
-
-extern void XSetWindowBorder(Display *d, Window w, unsigned long ul);
-
-extern void XSetWindowBorderPixmap(Display *d, Window w, Pixmap p);
-
-extern void XSetWindowBorderWidth(Display *d, Window w, unsigned int ui);
-
-extern void XSetWindowColormap(Display *d, Window w, Colormap c);
-
-extern Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1,
- int i2, int* i3, int* i4, Window* w3);
-
-extern void XUngrabKeyboard(Display *d, Time t);
-
-extern void XUngrabPointer(Display *d, Time t);
-
-extern void XUnmapWindow(Display *d, Window w);
-
-extern void XWindowEvent(Display *d, Window w, long l, XEvent* x);
-
-extern void XDestroyIC(XIC x);
-
-extern Bool XFilterEvent(XEvent* x, Window w);
-
-extern int XmbLookupString(XIC xi, XKeyPressedEvent* xk, char* c, int i,
- KeySym* k, Status* s);
-
-extern void TkPutImage(unsigned long * colors, int ncolors, Display *display,
- Drawable d, GC gc, XImage* image, int src_x, int src_y,
- int dest_x, int dest_y, unsigned int width, unsigned int height);
-
-extern Status XParseColor(Display * display, Colormap map, _Xconst char* spec,
- XColor * colorPtr);
-
-extern GC XCreateGC(Display *display, Drawable d, unsigned long valuemask,
- XGCValues* values);
-
-extern void XFreeGC(Display *display, GC gc);
-
-extern Atom XInternAtom(Display *display, _Xconst char* atom_name,
- Bool only_if_exists);
-
-extern void XSetBackground(Display *display, GC gc, unsigned long foreground);
-
-extern void XSetForeground(Display *display, GC gc, unsigned long foreground);
-
-extern void XSetClipMask(Display *display, GC gc, Pixmap pixmap);
-
-extern void XSetClipOrigin(Display *display, GC gc, int clip_x_origin,
- int clip_y_origin);
-
-extern void XSetTSOrigin(Display *display, GC gc, int ts_x_origin,
- int ts_y_origin);
-
-extern void XChangeGC(Display *display, GC gc, unsigned long mask,
- XGCValues * values);
-
-extern void XSetFont(Display *display, GC gc, Font font);
-
-extern void XSetArcMode(Display *display, GC gc, int arc_mode);
-
-extern void XSetStipple(Display * display, GC gc,
- Pixmap stipple);
-
-extern void XSetFillRule(Display *display, GC gc, int fill_rule);
-
-extern void XSetFillStyle(Display *display, GC gc, int fill_style);
-
-extern void XSetFunction(Display *display, GC gc, int function);
-
-extern void XSetLineAttributes(Display *display, GC gc,
- unsigned int line_width, int line_style, int cap_style,
- int join_style);
-
-extern int _XInitImageFuncPtrs(XImage * image);
-
-extern XIC XCreateIC(void);
-
-extern XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask,
- XVisualInfo* vinfo_template, int* nitems_return);
-
-extern void XSetWMClientMachine(Display *display, Window w,
- XTextProperty* text_prop);
-
-extern Status XStringListToTextProperty(char** list, int count,
- XTextProperty* text_prop_return);
-
-extern void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2,
- int y2);
-
-extern void XWarpPointer(Display *d, Window s, Window dw, int sx, int sy,
- unsigned int sw, unsigned int sh, int dx, int dy);
-
-extern void XFillRectangle(Display *display, Drawable d, GC gc, int x, int y,
- unsigned int width, unsigned int height);
-
-_XFUNCPROTOEND
-
-#ifdef MAC_TCL
-# undef Cursor
-# undef Region
-#endif
-
-#endif /* _XLIB_H_ */
diff --git a/blt3.0.1/win/X11/Xutil.h b/blt3.0.1/win/X11/Xutil.h
deleted file mode 100644
index f6c0a36..0000000
--- a/blt3.0.1/win/X11/Xutil.h
+++ /dev/null
@@ -1,855 +0,0 @@
-/* $XConsortium: Xutil.h,v 11.73 91/07/30 16:21:37 rws Exp $ */
-
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#ifndef _XUTIL_H_
-#define _XUTIL_H_
-
-/* You must include <X11/Xlib.h> before including this file */
-
-#ifdef MAC_TCL
-# define Region XRegion
-#endif
-
-/*
- * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding
- * value (x, y, width, height) was found in the parsed string.
- */
-#define NoValue 0x0000
-#define XValue 0x0001
-#define YValue 0x0002
-#define WidthValue 0x0004
-#define HeightValue 0x0008
-#define AllValues 0x000F
-#define XNegative 0x0010
-#define YNegative 0x0020
-
-/*
- * new version containing base_width, base_height, and win_gravity fields;
- * used with WM_NORMAL_HINTS.
- */
-typedef struct {
- long flags; /* marks which fields in this structure are defined */
- int x, y; /* obsolete for new window mgrs, but clients */
- int width, height; /* should set so old wm's don't mess up */
- int min_width, min_height;
- int max_width, max_height;
- int width_inc, height_inc;
- struct {
- int x; /* numerator */
- int y; /* denominator */
- } min_aspect, max_aspect;
- int base_width, base_height; /* added by ICCCM version 1 */
- int win_gravity; /* added by ICCCM version 1 */
-} XSizeHints;
-
-/*
- * The next block of definitions are for window manager properties that
- * clients and applications use for communication.
- */
-
-/* flags argument in size hints */
-#define USPosition (1L << 0) /* user specified x, y */
-#define USSize (1L << 1) /* user specified width, height */
-
-#define PPosition (1L << 2) /* program specified position */
-#define PSize (1L << 3) /* program specified size */
-#define PMinSize (1L << 4) /* program specified minimum size */
-#define PMaxSize (1L << 5) /* program specified maximum size */
-#define PResizeInc (1L << 6) /* program specified resize increments */
-#define PAspect (1L << 7) /* program specified min and max aspect ratios */
-#define PBaseSize (1L << 8) /* program specified base for incrementing */
-#define PWinGravity (1L << 9) /* program specified window gravity */
-
-/* obsolete */
-#define PAllHints (PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect)
-
-
-
-typedef struct {
- long flags; /* marks which fields in this structure are defined */
- Bool input; /* does this application rely on the window manager to
- get keyboard input? */
- int initial_state; /* see below */
- Pixmap icon_pixmap; /* pixmap to be used as icon */
- Window icon_window; /* window to be used as icon */
- int icon_x, icon_y; /* initial position of icon */
- Pixmap icon_mask; /* icon mask bitmap */
- XID window_group; /* id of related window group */
- /* this structure may be extended in the future */
-} XWMHints;
-
-/* definition for flags of XWMHints */
-
-#define InputHint (1L << 0)
-#define StateHint (1L << 1)
-#define IconPixmapHint (1L << 2)
-#define IconWindowHint (1L << 3)
-#define IconPositionHint (1L << 4)
-#define IconMaskHint (1L << 5)
-#define WindowGroupHint (1L << 6)
-#define AllHints (InputHint|StateHint|IconPixmapHint|IconWindowHint| \
-IconPositionHint|IconMaskHint|WindowGroupHint)
-
-/* definitions for initial window state */
-#define WithdrawnState 0 /* for windows that are not mapped */
-#define NormalState 1 /* most applications want to start this way */
-#define IconicState 3 /* application wants to start as an icon */
-
-/*
- * Obsolete states no longer defined by ICCCM
- */
-#define DontCareState 0 /* don't know or care */
-#define ZoomState 2 /* application wants to start zoomed */
-#define InactiveState 4 /* application believes it is seldom used; */
- /* some wm's may put it on inactive menu */
-
-
-/*
- * new structure for manipulating TEXT properties; used with WM_NAME,
- * WM_ICON_NAME, WM_CLIENT_MACHINE, and WM_COMMAND.
- */
-typedef struct {
- unsigned char *value; /* same as Property routines */
- Atom encoding; /* prop type */
- int format; /* prop data format: 8, 16, or 32 */
- unsigned long nitems; /* number of data items in value */
-} XTextProperty;
-
-#define XNoMemory -1
-#define XLocaleNotSupported -2
-#define XConverterNotFound -3
-
-typedef enum {
- XStringStyle, /* STRING */
- XCompoundTextStyle, /* COMPOUND_TEXT */
- XTextStyle, /* text in owner's encoding (current locale)*/
- XStdICCTextStyle /* STRING, else COMPOUND_TEXT */
-} XICCEncodingStyle;
-
-typedef struct {
- int min_width, min_height;
- int max_width, max_height;
- int width_inc, height_inc;
-} XIconSize;
-
-typedef struct {
- char *res_name;
- char *res_class;
-} XClassHint;
-
-/*
- * These macros are used to give some sugar to the image routines so that
- * naive people are more comfortable with them.
- */
-#define XDestroyImage(ximage) \
- ((*((ximage)->f.destroy_image))((ximage)))
-#define XGetPixel(ximage, x, y) \
- ((*((ximage)->f.get_pixel))((ximage), (x), (y)))
-#define XPutPixel(ximage, x, y, pixel) \
- ((*((ximage)->f.put_pixel))((ximage), (x), (y), (pixel)))
-#define XSubImage(ximage, x, y, width, height) \
- ((*((ximage)->f.sub_image))((ximage), (x), (y), (width), (height)))
-#define XAddPixel(ximage, value) \
- ((*((ximage)->f.add_pixel))((ximage), (value)))
-
-/*
- * Compose sequence status structure, used in calling XLookupString.
- */
-typedef struct _XComposeStatus {
- XPointer compose_ptr; /* state table pointer */
- int chars_matched; /* match state */
-} XComposeStatus;
-
-/*
- * Keysym macros, used on Keysyms to test for classes of symbols
- */
-#define IsKeypadKey(keysym) \
- (((unsigned)(keysym) >= XK_KP_Space) && ((unsigned)(keysym) <= XK_KP_Equal))
-
-#define IsCursorKey(keysym) \
- (((unsigned)(keysym) >= XK_Home) && ((unsigned)(keysym) < XK_Select))
-
-#define IsPFKey(keysym) \
- (((unsigned)(keysym) >= XK_KP_F1) && ((unsigned)(keysym) <= XK_KP_F4))
-
-#define IsFunctionKey(keysym) \
- (((unsigned)(keysym) >= XK_F1) && ((unsigned)(keysym) <= XK_F35))
-
-#define IsMiscFunctionKey(keysym) \
- (((unsigned)(keysym) >= XK_Select) && ((unsigned)(keysym) <= XK_Break))
-
-#define IsModifierKey(keysym) \
- ((((unsigned)(keysym) >= XK_Shift_L) && ((unsigned)(keysym) <= XK_Hyper_R)) \
- || ((unsigned)(keysym) == XK_Mode_switch) \
- || ((unsigned)(keysym) == XK_Num_Lock))
-/*
- * opaque reference to Region data type
- */
-typedef struct _XRegion *Region;
-
-/* Return values from XRectInRegion() */
-
-#define RectangleOut 0
-#define RectangleIn 1
-#define RectanglePart 2
-
-
-/*
- * Information used by the visual utility routines to find desired visual
- * type from the many visuals a display may support.
- */
-
-typedef struct {
- Visual *visual;
- VisualID visualid;
- int screen;
- int depth;
-#if defined(__cplusplus) || defined(c_plusplus)
- int c_class; /* C++ */
-#else
- int class;
-#endif
- unsigned long red_mask;
- unsigned long green_mask;
- unsigned long blue_mask;
- int colormap_size;
- int bits_per_rgb;
-} XVisualInfo;
-
-#define VisualNoMask 0x0
-#define VisualIDMask 0x1
-#define VisualScreenMask 0x2
-#define VisualDepthMask 0x4
-#define VisualClassMask 0x8
-#define VisualRedMaskMask 0x10
-#define VisualGreenMaskMask 0x20
-#define VisualBlueMaskMask 0x40
-#define VisualColormapSizeMask 0x80
-#define VisualBitsPerRGBMask 0x100
-#define VisualAllMask 0x1FF
-
-/*
- * This defines a window manager property that clients may use to
- * share standard color maps of type RGB_COLOR_MAP:
- */
-typedef struct {
- Colormap colormap;
- unsigned long red_max;
- unsigned long red_mult;
- unsigned long green_max;
- unsigned long green_mult;
- unsigned long blue_max;
- unsigned long blue_mult;
- unsigned long base_pixel;
- VisualID visualid; /* added by ICCCM version 1 */
- XID killid; /* added by ICCCM version 1 */
-} XStandardColormap;
-
-#define ReleaseByFreeingColormap ((XID) 1L) /* for killid field above */
-
-
-/*
- * return codes for XReadBitmapFile and XWriteBitmapFile
- */
-#define BitmapSuccess 0
-#define BitmapOpenFailed 1
-#define BitmapFileInvalid 2
-#define BitmapNoMemory 3
-
-/****************************************************************
- *
- * Context Management
- *
- ****************************************************************/
-
-
-/* Associative lookup table return codes */
-
-#define XCSUCCESS 0 /* No error. */
-#define XCNOMEM 1 /* Out of memory */
-#define XCNOENT 2 /* No entry in table */
-
-typedef int XContext;
-
-#define XUniqueContext() ((XContext) XrmUniqueQuark())
-#define XStringToContext(string) ((XContext) XrmStringToQuark(string))
-
-_XFUNCPROTOBEGIN
-
-/* The following declarations are alphabetized. */
-
-extern XClassHint *XAllocClassHint (
-#if NeedFunctionPrototypes
- void
-#endif
-);
-
-extern XIconSize *XAllocIconSize (
-#if NeedFunctionPrototypes
- void
-#endif
-);
-
-extern XSizeHints *XAllocSizeHints (
-#if NeedFunctionPrototypes
- void
-#endif
-);
-
-extern XStandardColormap *XAllocStandardColormap (
-#if NeedFunctionPrototypes
- void
-#endif
-);
-
-extern XWMHints *XAllocWMHints (
-#if NeedFunctionPrototypes
- void
-#endif
-);
-
-extern void XClipBox(
-#if NeedFunctionPrototypes
- Region /* r */,
- XRectangle* /* rect_return */
-#endif
-);
-
-extern Region XCreateRegion(
-#if NeedFunctionPrototypes
- void
-#endif
-);
-
-extern char *XDefaultString(
-#if NeedFunctionPrototypes
- void
-#endif
-);
-
-extern int XDeleteContext(
-#if NeedFunctionPrototypes
- Display* /* display */,
- XID /* rid */,
- XContext /* context */
-#endif
-);
-
-extern void XDestroyRegion(
-#if NeedFunctionPrototypes
- Region /* r */
-#endif
-);
-
-extern void XEmptyRegion(
-#if NeedFunctionPrototypes
- Region /* r */
-#endif
-);
-
-extern void XEqualRegion(
-#if NeedFunctionPrototypes
- Region /* r1 */,
- Region /* r2 */
-#endif
-);
-
-extern int XFindContext(
-#if NeedFunctionPrototypes
- Display* /* display */,
- XID /* rid */,
- XContext /* context */,
- XPointer* /* data_return */
-#endif
-);
-
-extern Status XGetClassHint(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XClassHint* /* class_hints_return */
-#endif
-);
-
-extern Status XGetIconSizes(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XIconSize** /* size_list_return */,
- int* /* count_return */
-#endif
-);
-
-extern Status XGetNormalHints(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XSizeHints* /* hints_return */
-#endif
-);
-
-extern Status XGetRGBColormaps(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XStandardColormap** /* stdcmap_return */,
- int* /* count_return */,
- Atom /* property */
-#endif
-);
-
-extern Status XGetSizeHints(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XSizeHints* /* hints_return */,
- Atom /* property */
-#endif
-);
-
-extern Status XGetStandardColormap(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XStandardColormap* /* colormap_return */,
- Atom /* property */
-#endif
-);
-
-extern Status XGetTextProperty(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* window */,
- XTextProperty* /* text_prop_return */,
- Atom /* property */
-#endif
-);
-
-
-extern Status XGetWMClientMachine(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XTextProperty* /* text_prop_return */
-#endif
-);
-
-extern XWMHints *XGetWMHints(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */
-#endif
-);
-
-extern Status XGetWMIconName(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XTextProperty* /* text_prop_return */
-#endif
-);
-
-extern Status XGetWMName(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XTextProperty* /* text_prop_return */
-#endif
-);
-
-extern Status XGetWMNormalHints(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XSizeHints* /* hints_return */,
- long* /* supplied_return */
-#endif
-);
-
-extern Status XGetWMSizeHints(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XSizeHints* /* hints_return */,
- long* /* supplied_return */,
- Atom /* property */
-#endif
-);
-
-extern Status XGetZoomHints(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XSizeHints* /* zhints_return */
-#endif
-);
-
-extern void XIntersectRegion(
-#if NeedFunctionPrototypes
- Region /* sra */,
- Region /* srb */,
- Region /* dr_return */
-#endif
-);
-
-extern int XLookupString(
-#if NeedFunctionPrototypes
- XKeyEvent* /* event_struct */,
- char* /* buffer_return */,
- int /* bytes_buffer */,
- KeySym* /* keysym_return */,
- XComposeStatus* /* status_in_out */
-#endif
-);
-
-extern Status XMatchVisualInfo(
-#if NeedFunctionPrototypes
- Display* /* display */,
- int /* screen */,
- int /* depth */,
- int /* class */,
- XVisualInfo* /* vinfo_return */
-#endif
-);
-
-extern void XOffsetRegion(
-#if NeedFunctionPrototypes
- Region /* r */,
- int /* dx */,
- int /* dy */
-#endif
-);
-
-extern Bool XPointInRegion(
-#if NeedFunctionPrototypes
- Region /* r */,
- int /* x */,
- int /* y */
-#endif
-);
-
-extern Region XPolygonRegion(
-#if NeedFunctionPrototypes
- XPoint* /* points */,
- int /* n */,
- int /* fill_rule */
-#endif
-);
-
-extern int XRectInRegion(
-#if NeedFunctionPrototypes
- Region /* r */,
- int /* x */,
- int /* y */,
- unsigned int /* width */,
- unsigned int /* height */
-#endif
-);
-
-extern int XSaveContext(
-#if NeedFunctionPrototypes
- Display* /* display */,
- XID /* rid */,
- XContext /* context */,
- _Xconst char* /* data */
-#endif
-);
-
-extern void XSetClassHint(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XClassHint* /* class_hints */
-#endif
-);
-
-extern void XSetIconSizes(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XIconSize* /* size_list */,
- int /* count */
-#endif
-);
-
-extern void XSetNormalHints(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XSizeHints* /* hints */
-#endif
-);
-
-extern void XSetRGBColormaps(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XStandardColormap* /* stdcmaps */,
- int /* count */,
- Atom /* property */
-#endif
-);
-
-extern void XSetSizeHints(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XSizeHints* /* hints */,
- Atom /* property */
-#endif
-);
-
-extern void XSetStandardProperties(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- _Xconst char* /* window_name */,
- _Xconst char* /* icon_name */,
- Pixmap /* icon_pixmap */,
- char** /* argv */,
- int /* argc */,
- XSizeHints* /* hints */
-#endif
-);
-
-extern void XSetTextProperty(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XTextProperty* /* text_prop */,
- Atom /* property */
-#endif
-);
-
-extern void XSetWMHints(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XWMHints* /* wm_hints */
-#endif
-);
-
-extern void XSetWMIconName(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XTextProperty* /* text_prop */
-#endif
-);
-
-extern void XSetWMName(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XTextProperty* /* text_prop */
-#endif
-);
-
-extern void XSetWMNormalHints(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XSizeHints* /* hints */
-#endif
-);
-
-extern void XSetWMProperties(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XTextProperty* /* window_name */,
- XTextProperty* /* icon_name */,
- char** /* argv */,
- int /* argc */,
- XSizeHints* /* normal_hints */,
- XWMHints* /* wm_hints */,
- XClassHint* /* class_hints */
-#endif
-);
-
-extern void XmbSetWMProperties(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- _Xconst char* /* window_name */,
- _Xconst char* /* icon_name */,
- char** /* argv */,
- int /* argc */,
- XSizeHints* /* normal_hints */,
- XWMHints* /* wm_hints */,
- XClassHint* /* class_hints */
-#endif
-);
-
-extern void XSetWMSizeHints(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XSizeHints* /* hints */,
- Atom /* property */
-#endif
-);
-
-extern void XSetRegion(
-#if NeedFunctionPrototypes
- Display* /* display */,
- GC /* gc */,
- Region /* r */
-#endif
-);
-
-extern void XSetStandardColormap(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XStandardColormap* /* colormap */,
- Atom /* property */
-#endif
-);
-
-extern void XSetZoomHints(
-#if NeedFunctionPrototypes
- Display* /* display */,
- Window /* w */,
- XSizeHints* /* zhints */
-#endif
-);
-
-extern void XShrinkRegion(
-#if NeedFunctionPrototypes
- Region /* r */,
- int /* dx */,
- int /* dy */
-#endif
-);
-
-extern void XSubtractRegion(
-#if NeedFunctionPrototypes
- Region /* sra */,
- Region /* srb */,
- Region /* dr_return */
-#endif
-);
-
-extern int XmbTextListToTextProperty(
-#if NeedFunctionPrototypes
- Display* /* display */,
- char** /* list */,
- int /* count */,
- XICCEncodingStyle /* style */,
- XTextProperty* /* text_prop_return */
-#endif
-);
-
-extern int XwcTextListToTextProperty(
-#if NeedFunctionPrototypes
- Display* /* display */,
- wchar_t** /* list */,
- int /* count */,
- XICCEncodingStyle /* style */,
- XTextProperty* /* text_prop_return */
-#endif
-);
-
-extern void XwcFreeStringList(
-#if NeedFunctionPrototypes
- wchar_t** /* list */
-#endif
-);
-
-extern Status XTextPropertyToStringList(
-#if NeedFunctionPrototypes
- XTextProperty* /* text_prop */,
- char*** /* list_return */,
- int* /* count_return */
-#endif
-);
-
-extern int XmbTextPropertyToTextList(
-#if NeedFunctionPrototypes
- Display* /* display */,
- XTextProperty* /* text_prop */,
- char*** /* list_return */,
- int* /* count_return */
-#endif
-);
-
-extern int XwcTextPropertyToTextList(
-#if NeedFunctionPrototypes
- Display* /* display */,
- XTextProperty* /* text_prop */,
- wchar_t*** /* list_return */,
- int* /* count_return */
-#endif
-);
-
-extern void XUnionRectWithRegion(
-#if NeedFunctionPrototypes
- XRectangle* /* rectangle */,
- Region /* src_region */,
- Region /* dest_region_return */
-#endif
-);
-
-extern void XUnionRegion(
-#if NeedFunctionPrototypes
- Region /* sra */,
- Region /* srb */,
- Region /* dr_return */
-#endif
-);
-
-extern int XWMGeometry(
-#if NeedFunctionPrototypes
- Display* /* display */,
- int /* screen_number */,
- _Xconst char* /* user_geometry */,
- _Xconst char* /* default_geometry */,
- unsigned int /* border_width */,
- XSizeHints* /* hints */,
- int* /* x_return */,
- int* /* y_return */,
- int* /* width_return */,
- int* /* height_return */,
- int* /* gravity_return */
-#endif
-);
-
-extern void XXorRegion(
-#if NeedFunctionPrototypes
- Region /* sra */,
- Region /* srb */,
- Region /* dr_return */
-#endif
-);
-
-_XFUNCPROTOEND
-
-#ifdef MAC_TCL
-# undef Region
-#endif
-
-#endif /* _XUTIL_H_ */
diff --git a/blt3.0.1/win/X11/cursorfont.h b/blt3.0.1/win/X11/cursorfont.h
deleted file mode 100644
index 617274f..0000000
--- a/blt3.0.1/win/X11/cursorfont.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* $XConsortium: cursorfont.h,v 1.2 88/09/06 16:44:27 jim Exp $ */
-#define XC_num_glyphs 154
-#define XC_X_cursor 0
-#define XC_arrow 2
-#define XC_based_arrow_down 4
-#define XC_based_arrow_up 6
-#define XC_boat 8
-#define XC_bogosity 10
-#define XC_bottom_left_corner 12
-#define XC_bottom_right_corner 14
-#define XC_bottom_side 16
-#define XC_bottom_tee 18
-#define XC_box_spiral 20
-#define XC_center_ptr 22
-#define XC_circle 24
-#define XC_clock 26
-#define XC_coffee_mug 28
-#define XC_cross 30
-#define XC_cross_reverse 32
-#define XC_crosshair 34
-#define XC_diamond_cross 36
-#define XC_dot 38
-#define XC_dotbox 40
-#define XC_double_arrow 42
-#define XC_draft_large 44
-#define XC_draft_small 46
-#define XC_draped_box 48
-#define XC_exchange 50
-#define XC_fleur 52
-#define XC_gobbler 54
-#define XC_gumby 56
-#define XC_hand1 58
-#define XC_hand2 60
-#define XC_heart 62
-#define XC_icon 64
-#define XC_iron_cross 66
-#define XC_left_ptr 68
-#define XC_left_side 70
-#define XC_left_tee 72
-#define XC_leftbutton 74
-#define XC_ll_angle 76
-#define XC_lr_angle 78
-#define XC_man 80
-#define XC_middlebutton 82
-#define XC_mouse 84
-#define XC_pencil 86
-#define XC_pirate 88
-#define XC_plus 90
-#define XC_question_arrow 92
-#define XC_right_ptr 94
-#define XC_right_side 96
-#define XC_right_tee 98
-#define XC_rightbutton 100
-#define XC_rtl_logo 102
-#define XC_sailboat 104
-#define XC_sb_down_arrow 106
-#define XC_sb_h_double_arrow 108
-#define XC_sb_left_arrow 110
-#define XC_sb_right_arrow 112
-#define XC_sb_up_arrow 114
-#define XC_sb_v_double_arrow 116
-#define XC_shuttle 118
-#define XC_sizing 120
-#define XC_spider 122
-#define XC_spraycan 124
-#define XC_star 126
-#define XC_target 128
-#define XC_tcross 130
-#define XC_top_left_arrow 132
-#define XC_top_left_corner 134
-#define XC_top_right_corner 136
-#define XC_top_side 138
-#define XC_top_tee 140
-#define XC_trek 142
-#define XC_ul_angle 144
-#define XC_umbrella 146
-#define XC_ur_angle 148
-#define XC_watch 150
-#define XC_xterm 152
diff --git a/blt3.0.1/win/X11/keysym.h b/blt3.0.1/win/X11/keysym.h
deleted file mode 100644
index 027afe0..0000000
--- a/blt3.0.1/win/X11/keysym.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* $XConsortium: keysym.h,v 1.13 91/03/13 20:09:49 rws Exp $ */
-
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/* default keysyms */
-#define XK_MISCELLANY
-#define XK_LATIN1
-#define XK_LATIN2
-#define XK_LATIN3
-#define XK_LATIN4
-#define XK_GREEK
-
-#ifdef MAC_TCL
-#include <keysymdef.h>
-#else
-#include <X11/keysymdef.h>
-#endif
diff --git a/blt3.0.1/win/X11/keysymdef.h b/blt3.0.1/win/X11/keysymdef.h
deleted file mode 100644
index b22d41b..0000000
--- a/blt3.0.1/win/X11/keysymdef.h
+++ /dev/null
@@ -1,1169 +0,0 @@
-/* $XConsortium: keysymdef.h,v 1.15 93/04/02 10:57:36 rws Exp $ */
-
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#define XK_VoidSymbol 0xFFFFFF /* void symbol */
-
-#ifdef XK_MISCELLANY
-/*
- * TTY Functions, cleverly chosen to map to ascii, for convenience of
- * programming, but could have been arbitrary (at the cost of lookup
- * tables in client code.
- */
-
-#define XK_BackSpace 0xFF08 /* back space, back char */
-#define XK_Tab 0xFF09
-#define XK_Linefeed 0xFF0A /* Linefeed, LF */
-#define XK_Clear 0xFF0B
-#define XK_Return 0xFF0D /* Return, enter */
-#define XK_Pause 0xFF13 /* Pause, hold */
-#define XK_Scroll_Lock 0xFF14
-#define XK_Sys_Req 0xFF15
-#define XK_Escape 0xFF1B
-#define XK_Delete 0xFFFF /* Delete, rubout */
-
-
-
-/* International & multi-key character composition */
-
-#define XK_Multi_key 0xFF20 /* Multi-key character compose */
-
-/* Japanese keyboard support */
-
-#define XK_Kanji 0xFF21 /* Kanji, Kanji convert */
-#define XK_Muhenkan 0xFF22 /* Cancel Conversion */
-#define XK_Henkan_Mode 0xFF23 /* Start/Stop Conversion */
-#define XK_Henkan 0xFF23 /* Alias for Henkan_Mode */
-#define XK_Romaji 0xFF24 /* to Romaji */
-#define XK_Hiragana 0xFF25 /* to Hiragana */
-#define XK_Katakana 0xFF26 /* to Katakana */
-#define XK_Hiragana_Katakana 0xFF27 /* Hiragana/Katakana toggle */
-#define XK_Zenkaku 0xFF28 /* to Zenkaku */
-#define XK_Hankaku 0xFF29 /* to Hankaku */
-#define XK_Zenkaku_Hankaku 0xFF2A /* Zenkaku/Hankaku toggle */
-#define XK_Touroku 0xFF2B /* Add to Dictionary */
-#define XK_Massyo 0xFF2C /* Delete from Dictionary */
-#define XK_Kana_Lock 0xFF2D /* Kana Lock */
-#define XK_Kana_Shift 0xFF2E /* Kana Shift */
-#define XK_Eisu_Shift 0xFF2F /* Alphanumeric Shift */
-#define XK_Eisu_toggle 0xFF30 /* Alphanumeric toggle */
-
-/* Cursor control & motion */
-
-#define XK_Home 0xFF50
-#define XK_Left 0xFF51 /* Move left, left arrow */
-#define XK_Up 0xFF52 /* Move up, up arrow */
-#define XK_Right 0xFF53 /* Move right, right arrow */
-#define XK_Down 0xFF54 /* Move down, down arrow */
-#define XK_Prior 0xFF55 /* Prior, previous */
-#define XK_Page_Up 0xFF55
-#define XK_Next 0xFF56 /* Next */
-#define XK_Page_Down 0xFF56
-#define XK_End 0xFF57 /* EOL */
-#define XK_Begin 0xFF58 /* BOL */
-
-/* Special Windows keyboard keys */
-
-#define XK_Win_L 0xFF5B /* Left-hand Windows */
-#define XK_Win_R 0xFF5C /* Right-hand Windows */
-#define XK_App 0xFF5D /* Menu key */
-
-/* Misc Functions */
-
-#define XK_Select 0xFF60 /* Select, mark */
-#define XK_Print 0xFF61
-#define XK_Execute 0xFF62 /* Execute, run, do */
-#define XK_Insert 0xFF63 /* Insert, insert here */
-#define XK_Undo 0xFF65 /* Undo, oops */
-#define XK_Redo 0xFF66 /* redo, again */
-#define XK_Menu 0xFF67
-#define XK_Find 0xFF68 /* Find, search */
-#define XK_Cancel 0xFF69 /* Cancel, stop, abort, exit */
-#define XK_Help 0xFF6A /* Help, ? */
-#define XK_Break 0xFF6B
-#define XK_Mode_switch 0xFF7E /* Character set switch */
-#define XK_script_switch 0xFF7E /* Alias for mode_switch */
-#define XK_Num_Lock 0xFF7F
-
-/* Keypad Functions, keypad numbers cleverly chosen to map to ascii */
-
-#define XK_KP_Space 0xFF80 /* space */
-#define XK_KP_Tab 0xFF89
-#define XK_KP_Enter 0xFF8D /* enter */
-#define XK_KP_F1 0xFF91 /* PF1, KP_A, ... */
-#define XK_KP_F2 0xFF92
-#define XK_KP_F3 0xFF93
-#define XK_KP_F4 0xFF94
-#define XK_KP_Home 0xFF95
-#define XK_KP_Left 0xFF96
-#define XK_KP_Up 0xFF97
-#define XK_KP_Right 0xFF98
-#define XK_KP_Down 0xFF99
-#define XK_KP_Prior 0xFF9A
-#define XK_KP_Page_Up 0xFF9A
-#define XK_KP_Next 0xFF9B
-#define XK_KP_Page_Down 0xFF9B
-#define XK_KP_End 0xFF9C
-#define XK_KP_Begin 0xFF9D
-#define XK_KP_Insert 0xFF9E
-#define XK_KP_Delete 0xFF9F
-#define XK_KP_Equal 0xFFBD /* equals */
-#define XK_KP_Multiply 0xFFAA
-#define XK_KP_Add 0xFFAB
-#define XK_KP_Separator 0xFFAC /* separator, often comma */
-#define XK_KP_Subtract 0xFFAD
-#define XK_KP_Decimal 0xFFAE
-#define XK_KP_Divide 0xFFAF
-
-#define XK_KP_0 0xFFB0
-#define XK_KP_1 0xFFB1
-#define XK_KP_2 0xFFB2
-#define XK_KP_3 0xFFB3
-#define XK_KP_4 0xFFB4
-#define XK_KP_5 0xFFB5
-#define XK_KP_6 0xFFB6
-#define XK_KP_7 0xFFB7
-#define XK_KP_8 0xFFB8
-#define XK_KP_9 0xFFB9
-
-
-
-/*
- * Auxilliary Functions; note the duplicate definitions for left and right
- * function keys; Sun keyboards and a few other manufactures have such
- * function key groups on the left and/or right sides of the keyboard.
- * We've not found a keyboard with more than 35 function keys total.
- */
-
-#define XK_F1 0xFFBE
-#define XK_F2 0xFFBF
-#define XK_F3 0xFFC0
-#define XK_F4 0xFFC1
-#define XK_F5 0xFFC2
-#define XK_F6 0xFFC3
-#define XK_F7 0xFFC4
-#define XK_F8 0xFFC5
-#define XK_F9 0xFFC6
-#define XK_F10 0xFFC7
-#define XK_F11 0xFFC8
-#define XK_L1 0xFFC8
-#define XK_F12 0xFFC9
-#define XK_L2 0xFFC9
-#define XK_F13 0xFFCA
-#define XK_L3 0xFFCA
-#define XK_F14 0xFFCB
-#define XK_L4 0xFFCB
-#define XK_F15 0xFFCC
-#define XK_L5 0xFFCC
-#define XK_F16 0xFFCD
-#define XK_L6 0xFFCD
-#define XK_F17 0xFFCE
-#define XK_L7 0xFFCE
-#define XK_F18 0xFFCF
-#define XK_L8 0xFFCF
-#define XK_F19 0xFFD0
-#define XK_L9 0xFFD0
-#define XK_F20 0xFFD1
-#define XK_L10 0xFFD1
-#define XK_F21 0xFFD2
-#define XK_R1 0xFFD2
-#define XK_F22 0xFFD3
-#define XK_R2 0xFFD3
-#define XK_F23 0xFFD4
-#define XK_R3 0xFFD4
-#define XK_F24 0xFFD5
-#define XK_R4 0xFFD5
-#define XK_F25 0xFFD6
-#define XK_R5 0xFFD6
-#define XK_F26 0xFFD7
-#define XK_R6 0xFFD7
-#define XK_F27 0xFFD8
-#define XK_R7 0xFFD8
-#define XK_F28 0xFFD9
-#define XK_R8 0xFFD9
-#define XK_F29 0xFFDA
-#define XK_R9 0xFFDA
-#define XK_F30 0xFFDB
-#define XK_R10 0xFFDB
-#define XK_F31 0xFFDC
-#define XK_R11 0xFFDC
-#define XK_F32 0xFFDD
-#define XK_R12 0xFFDD
-#define XK_F33 0xFFDE
-#define XK_R13 0xFFDE
-#define XK_F34 0xFFDF
-#define XK_R14 0xFFDF
-#define XK_F35 0xFFE0
-#define XK_R15 0xFFE0
-
-/* Modifiers */
-
-#define XK_Shift_L 0xFFE1 /* Left shift */
-#define XK_Shift_R 0xFFE2 /* Right shift */
-#define XK_Control_L 0xFFE3 /* Left control */
-#define XK_Control_R 0xFFE4 /* Right control */
-#define XK_Caps_Lock 0xFFE5 /* Caps lock */
-#define XK_Shift_Lock 0xFFE6 /* Shift lock */
-
-#define XK_Meta_L 0xFFE7 /* Left meta */
-#define XK_Meta_R 0xFFE8 /* Right meta */
-#define XK_Alt_L 0xFFE9 /* Left alt */
-#define XK_Alt_R 0xFFEA /* Right alt */
-#define XK_Super_L 0xFFEB /* Left super */
-#define XK_Super_R 0xFFEC /* Right super */
-#define XK_Hyper_L 0xFFED /* Left hyper */
-#define XK_Hyper_R 0xFFEE /* Right hyper */
-#endif /* XK_MISCELLANY */
-
-/*
- * Latin 1
- * Byte 3 = 0
- */
-#ifdef XK_LATIN1
-#define XK_space 0x020
-#define XK_exclam 0x021
-#define XK_quotedbl 0x022
-#define XK_numbersign 0x023
-#define XK_dollar 0x024
-#define XK_percent 0x025
-#define XK_ampersand 0x026
-#define XK_apostrophe 0x027
-#define XK_quoteright 0x027 /* deprecated */
-#define XK_parenleft 0x028
-#define XK_parenright 0x029
-#define XK_asterisk 0x02a
-#define XK_plus 0x02b
-#define XK_comma 0x02c
-#define XK_minus 0x02d
-#define XK_period 0x02e
-#define XK_slash 0x02f
-#define XK_0 0x030
-#define XK_1 0x031
-#define XK_2 0x032
-#define XK_3 0x033
-#define XK_4 0x034
-#define XK_5 0x035
-#define XK_6 0x036
-#define XK_7 0x037
-#define XK_8 0x038
-#define XK_9 0x039
-#define XK_colon 0x03a
-#define XK_semicolon 0x03b
-#define XK_less 0x03c
-#define XK_equal 0x03d
-#define XK_greater 0x03e
-#define XK_question 0x03f
-#define XK_at 0x040
-#define XK_A 0x041
-#define XK_B 0x042
-#define XK_C 0x043
-#define XK_D 0x044
-#define XK_E 0x045
-#define XK_F 0x046
-#define XK_G 0x047
-#define XK_H 0x048
-#define XK_I 0x049
-#define XK_J 0x04a
-#define XK_K 0x04b
-#define XK_L 0x04c
-#define XK_M 0x04d
-#define XK_N 0x04e
-#define XK_O 0x04f
-#define XK_P 0x050
-#define XK_Q 0x051
-#define XK_R 0x052
-#define XK_S 0x053
-#define XK_T 0x054
-#define XK_U 0x055
-#define XK_V 0x056
-#define XK_W 0x057
-#define XK_X 0x058
-#define XK_Y 0x059
-#define XK_Z 0x05a
-#define XK_bracketleft 0x05b
-#define XK_backslash 0x05c
-#define XK_bracketright 0x05d
-#define XK_asciicircum 0x05e
-#define XK_underscore 0x05f
-#define XK_grave 0x060
-#define XK_quoteleft 0x060 /* deprecated */
-#define XK_a 0x061
-#define XK_b 0x062
-#define XK_c 0x063
-#define XK_d 0x064
-#define XK_e 0x065
-#define XK_f 0x066
-#define XK_g 0x067
-#define XK_h 0x068
-#define XK_i 0x069
-#define XK_j 0x06a
-#define XK_k 0x06b
-#define XK_l 0x06c
-#define XK_m 0x06d
-#define XK_n 0x06e
-#define XK_o 0x06f
-#define XK_p 0x070
-#define XK_q 0x071
-#define XK_r 0x072
-#define XK_s 0x073
-#define XK_t 0x074
-#define XK_u 0x075
-#define XK_v 0x076
-#define XK_w 0x077
-#define XK_x 0x078
-#define XK_y 0x079
-#define XK_z 0x07a
-#define XK_braceleft 0x07b
-#define XK_bar 0x07c
-#define XK_braceright 0x07d
-#define XK_asciitilde 0x07e
-
-#define XK_nobreakspace 0x0a0
-#define XK_exclamdown 0x0a1
-#define XK_cent 0x0a2
-#define XK_sterling 0x0a3
-#define XK_currency 0x0a4
-#define XK_yen 0x0a5
-#define XK_brokenbar 0x0a6
-#define XK_section 0x0a7
-#define XK_diaeresis 0x0a8
-#define XK_copyright 0x0a9
-#define XK_ordfeminine 0x0aa
-#define XK_guillemotleft 0x0ab /* left angle quotation mark */
-#define XK_notsign 0x0ac
-#define XK_hyphen 0x0ad
-#define XK_registered 0x0ae
-#define XK_macron 0x0af
-#define XK_degree 0x0b0
-#define XK_plusminus 0x0b1
-#define XK_twosuperior 0x0b2
-#define XK_threesuperior 0x0b3
-#define XK_acute 0x0b4
-#define XK_mu 0x0b5
-#define XK_paragraph 0x0b6
-#define XK_periodcentered 0x0b7
-#define XK_cedilla 0x0b8
-#define XK_onesuperior 0x0b9
-#define XK_masculine 0x0ba
-#define XK_guillemotright 0x0bb /* right angle quotation mark */
-#define XK_onequarter 0x0bc
-#define XK_onehalf 0x0bd
-#define XK_threequarters 0x0be
-#define XK_questiondown 0x0bf
-#define XK_Agrave 0x0c0
-#define XK_Aacute 0x0c1
-#define XK_Acircumflex 0x0c2
-#define XK_Atilde 0x0c3
-#define XK_Adiaeresis 0x0c4
-#define XK_Aring 0x0c5
-#define XK_AE 0x0c6
-#define XK_Ccedilla 0x0c7
-#define XK_Egrave 0x0c8
-#define XK_Eacute 0x0c9
-#define XK_Ecircumflex 0x0ca
-#define XK_Ediaeresis 0x0cb
-#define XK_Igrave 0x0cc
-#define XK_Iacute 0x0cd
-#define XK_Icircumflex 0x0ce
-#define XK_Idiaeresis 0x0cf
-#define XK_ETH 0x0d0
-#define XK_Eth 0x0d0 /* deprecated */
-#define XK_Ntilde 0x0d1
-#define XK_Ograve 0x0d2
-#define XK_Oacute 0x0d3
-#define XK_Ocircumflex 0x0d4
-#define XK_Otilde 0x0d5
-#define XK_Odiaeresis 0x0d6
-#define XK_multiply 0x0d7
-#define XK_Ooblique 0x0d8
-#define XK_Ugrave 0x0d9
-#define XK_Uacute 0x0da
-#define XK_Ucircumflex 0x0db
-#define XK_Udiaeresis 0x0dc
-#define XK_Yacute 0x0dd
-#define XK_THORN 0x0de
-#define XK_Thorn 0x0de /* deprecated */
-#define XK_ssharp 0x0df
-#define XK_agrave 0x0e0
-#define XK_aacute 0x0e1
-#define XK_acircumflex 0x0e2
-#define XK_atilde 0x0e3
-#define XK_adiaeresis 0x0e4
-#define XK_aring 0x0e5
-#define XK_ae 0x0e6
-#define XK_ccedilla 0x0e7
-#define XK_egrave 0x0e8
-#define XK_eacute 0x0e9
-#define XK_ecircumflex 0x0ea
-#define XK_ediaeresis 0x0eb
-#define XK_igrave 0x0ec
-#define XK_iacute 0x0ed
-#define XK_icircumflex 0x0ee
-#define XK_idiaeresis 0x0ef
-#define XK_eth 0x0f0
-#define XK_ntilde 0x0f1
-#define XK_ograve 0x0f2
-#define XK_oacute 0x0f3
-#define XK_ocircumflex 0x0f4
-#define XK_otilde 0x0f5
-#define XK_odiaeresis 0x0f6
-#define XK_division 0x0f7
-#define XK_oslash 0x0f8
-#define XK_ugrave 0x0f9
-#define XK_uacute 0x0fa
-#define XK_ucircumflex 0x0fb
-#define XK_udiaeresis 0x0fc
-#define XK_yacute 0x0fd
-#define XK_thorn 0x0fe
-#define XK_ydiaeresis 0x0ff
-#endif /* XK_LATIN1 */
-
-/*
- * Latin 2
- * Byte 3 = 1
- */
-
-#ifdef XK_LATIN2
-#define XK_Aogonek 0x1a1
-#define XK_breve 0x1a2
-#define XK_Lstroke 0x1a3
-#define XK_Lcaron 0x1a5
-#define XK_Sacute 0x1a6
-#define XK_Scaron 0x1a9
-#define XK_Scedilla 0x1aa
-#define XK_Tcaron 0x1ab
-#define XK_Zacute 0x1ac
-#define XK_Zcaron 0x1ae
-#define XK_Zabovedot 0x1af
-#define XK_aogonek 0x1b1
-#define XK_ogonek 0x1b2
-#define XK_lstroke 0x1b3
-#define XK_lcaron 0x1b5
-#define XK_sacute 0x1b6
-#define XK_caron 0x1b7
-#define XK_scaron 0x1b9
-#define XK_scedilla 0x1ba
-#define XK_tcaron 0x1bb
-#define XK_zacute 0x1bc
-#define XK_doubleacute 0x1bd
-#define XK_zcaron 0x1be
-#define XK_zabovedot 0x1bf
-#define XK_Racute 0x1c0
-#define XK_Abreve 0x1c3
-#define XK_Lacute 0x1c5
-#define XK_Cacute 0x1c6
-#define XK_Ccaron 0x1c8
-#define XK_Eogonek 0x1ca
-#define XK_Ecaron 0x1cc
-#define XK_Dcaron 0x1cf
-#define XK_Dstroke 0x1d0
-#define XK_Nacute 0x1d1
-#define XK_Ncaron 0x1d2
-#define XK_Odoubleacute 0x1d5
-#define XK_Rcaron 0x1d8
-#define XK_Uring 0x1d9
-#define XK_Udoubleacute 0x1db
-#define XK_Tcedilla 0x1de
-#define XK_racute 0x1e0
-#define XK_abreve 0x1e3
-#define XK_lacute 0x1e5
-#define XK_cacute 0x1e6
-#define XK_ccaron 0x1e8
-#define XK_eogonek 0x1ea
-#define XK_ecaron 0x1ec
-#define XK_dcaron 0x1ef
-#define XK_dstroke 0x1f0
-#define XK_nacute 0x1f1
-#define XK_ncaron 0x1f2
-#define XK_odoubleacute 0x1f5
-#define XK_udoubleacute 0x1fb
-#define XK_rcaron 0x1f8
-#define XK_uring 0x1f9
-#define XK_tcedilla 0x1fe
-#define XK_abovedot 0x1ff
-#endif /* XK_LATIN2 */
-
-/*
- * Latin 3
- * Byte 3 = 2
- */
-
-#ifdef XK_LATIN3
-#define XK_Hstroke 0x2a1
-#define XK_Hcircumflex 0x2a6
-#define XK_Iabovedot 0x2a9
-#define XK_Gbreve 0x2ab
-#define XK_Jcircumflex 0x2ac
-#define XK_hstroke 0x2b1
-#define XK_hcircumflex 0x2b6
-#define XK_idotless 0x2b9
-#define XK_gbreve 0x2bb
-#define XK_jcircumflex 0x2bc
-#define XK_Cabovedot 0x2c5
-#define XK_Ccircumflex 0x2c6
-#define XK_Gabovedot 0x2d5
-#define XK_Gcircumflex 0x2d8
-#define XK_Ubreve 0x2dd
-#define XK_Scircumflex 0x2de
-#define XK_cabovedot 0x2e5
-#define XK_ccircumflex 0x2e6
-#define XK_gabovedot 0x2f5
-#define XK_gcircumflex 0x2f8
-#define XK_ubreve 0x2fd
-#define XK_scircumflex 0x2fe
-#endif /* XK_LATIN3 */
-
-
-/*
- * Latin 4
- * Byte 3 = 3
- */
-
-#ifdef XK_LATIN4
-#define XK_kra 0x3a2
-#define XK_kappa 0x3a2 /* deprecated */
-#define XK_Rcedilla 0x3a3
-#define XK_Itilde 0x3a5
-#define XK_Lcedilla 0x3a6
-#define XK_Emacron 0x3aa
-#define XK_Gcedilla 0x3ab
-#define XK_Tslash 0x3ac
-#define XK_rcedilla 0x3b3
-#define XK_itilde 0x3b5
-#define XK_lcedilla 0x3b6
-#define XK_emacron 0x3ba
-#define XK_gcedilla 0x3bb
-#define XK_tslash 0x3bc
-#define XK_ENG 0x3bd
-#define XK_eng 0x3bf
-#define XK_Amacron 0x3c0
-#define XK_Iogonek 0x3c7
-#define XK_Eabovedot 0x3cc
-#define XK_Imacron 0x3cf
-#define XK_Ncedilla 0x3d1
-#define XK_Omacron 0x3d2
-#define XK_Kcedilla 0x3d3
-#define XK_Uogonek 0x3d9
-#define XK_Utilde 0x3dd
-#define XK_Umacron 0x3de
-#define XK_amacron 0x3e0
-#define XK_iogonek 0x3e7
-#define XK_eabovedot 0x3ec
-#define XK_imacron 0x3ef
-#define XK_ncedilla 0x3f1
-#define XK_omacron 0x3f2
-#define XK_kcedilla 0x3f3
-#define XK_uogonek 0x3f9
-#define XK_utilde 0x3fd
-#define XK_umacron 0x3fe
-#endif /* XK_LATIN4 */
-
-/*
- * Katakana
- * Byte 3 = 4
- */
-
-#ifdef XK_KATAKANA
-#define XK_overline 0x47e
-#define XK_kana_fullstop 0x4a1
-#define XK_kana_openingbracket 0x4a2
-#define XK_kana_closingbracket 0x4a3
-#define XK_kana_comma 0x4a4
-#define XK_kana_conjunctive 0x4a5
-#define XK_kana_middledot 0x4a5 /* deprecated */
-#define XK_kana_WO 0x4a6
-#define XK_kana_a 0x4a7
-#define XK_kana_i 0x4a8
-#define XK_kana_u 0x4a9
-#define XK_kana_e 0x4aa
-#define XK_kana_o 0x4ab
-#define XK_kana_ya 0x4ac
-#define XK_kana_yu 0x4ad
-#define XK_kana_yo 0x4ae
-#define XK_kana_tsu 0x4af
-#define XK_kana_tu 0x4af /* deprecated */
-#define XK_prolongedsound 0x4b0
-#define XK_kana_A 0x4b1
-#define XK_kana_I 0x4b2
-#define XK_kana_U 0x4b3
-#define XK_kana_E 0x4b4
-#define XK_kana_O 0x4b5
-#define XK_kana_KA 0x4b6
-#define XK_kana_KI 0x4b7
-#define XK_kana_KU 0x4b8
-#define XK_kana_KE 0x4b9
-#define XK_kana_KO 0x4ba
-#define XK_kana_SA 0x4bb
-#define XK_kana_SHI 0x4bc
-#define XK_kana_SU 0x4bd
-#define XK_kana_SE 0x4be
-#define XK_kana_SO 0x4bf
-#define XK_kana_TA 0x4c0
-#define XK_kana_CHI 0x4c1
-#define XK_kana_TI 0x4c1 /* deprecated */
-#define XK_kana_TSU 0x4c2
-#define XK_kana_TU 0x4c2 /* deprecated */
-#define XK_kana_TE 0x4c3
-#define XK_kana_TO 0x4c4
-#define XK_kana_NA 0x4c5
-#define XK_kana_NI 0x4c6
-#define XK_kana_NU 0x4c7
-#define XK_kana_NE 0x4c8
-#define XK_kana_NO 0x4c9
-#define XK_kana_HA 0x4ca
-#define XK_kana_HI 0x4cb
-#define XK_kana_FU 0x4cc
-#define XK_kana_HU 0x4cc /* deprecated */
-#define XK_kana_HE 0x4cd
-#define XK_kana_HO 0x4ce
-#define XK_kana_MA 0x4cf
-#define XK_kana_MI 0x4d0
-#define XK_kana_MU 0x4d1
-#define XK_kana_ME 0x4d2
-#define XK_kana_MO 0x4d3
-#define XK_kana_YA 0x4d4
-#define XK_kana_YU 0x4d5
-#define XK_kana_YO 0x4d6
-#define XK_kana_RA 0x4d7
-#define XK_kana_RI 0x4d8
-#define XK_kana_RU 0x4d9
-#define XK_kana_RE 0x4da
-#define XK_kana_RO 0x4db
-#define XK_kana_WA 0x4dc
-#define XK_kana_N 0x4dd
-#define XK_voicedsound 0x4de
-#define XK_semivoicedsound 0x4df
-#define XK_kana_switch 0xFF7E /* Alias for mode_switch */
-#endif /* XK_KATAKANA */
-
-/*
- * Arabic
- * Byte 3 = 5
- */
-
-#ifdef XK_ARABIC
-#define XK_Arabic_comma 0x5ac
-#define XK_Arabic_semicolon 0x5bb
-#define XK_Arabic_question_mark 0x5bf
-#define XK_Arabic_hamza 0x5c1
-#define XK_Arabic_maddaonalef 0x5c2
-#define XK_Arabic_hamzaonalef 0x5c3
-#define XK_Arabic_hamzaonwaw 0x5c4
-#define XK_Arabic_hamzaunderalef 0x5c5
-#define XK_Arabic_hamzaonyeh 0x5c6
-#define XK_Arabic_alef 0x5c7
-#define XK_Arabic_beh 0x5c8
-#define XK_Arabic_tehmarbuta 0x5c9
-#define XK_Arabic_teh 0x5ca
-#define XK_Arabic_theh 0x5cb
-#define XK_Arabic_jeem 0x5cc
-#define XK_Arabic_hah 0x5cd
-#define XK_Arabic_khah 0x5ce
-#define XK_Arabic_dal 0x5cf
-#define XK_Arabic_thal 0x5d0
-#define XK_Arabic_ra 0x5d1
-#define XK_Arabic_zain 0x5d2
-#define XK_Arabic_seen 0x5d3
-#define XK_Arabic_sheen 0x5d4
-#define XK_Arabic_sad 0x5d5
-#define XK_Arabic_dad 0x5d6
-#define XK_Arabic_tah 0x5d7
-#define XK_Arabic_zah 0x5d8
-#define XK_Arabic_ain 0x5d9
-#define XK_Arabic_ghain 0x5da
-#define XK_Arabic_tatweel 0x5e0
-#define XK_Arabic_feh 0x5e1
-#define XK_Arabic_qaf 0x5e2
-#define XK_Arabic_kaf 0x5e3
-#define XK_Arabic_lam 0x5e4
-#define XK_Arabic_meem 0x5e5
-#define XK_Arabic_noon 0x5e6
-#define XK_Arabic_ha 0x5e7
-#define XK_Arabic_heh 0x5e7 /* deprecated */
-#define XK_Arabic_waw 0x5e8
-#define XK_Arabic_alefmaksura 0x5e9
-#define XK_Arabic_yeh 0x5ea
-#define XK_Arabic_fathatan 0x5eb
-#define XK_Arabic_dammatan 0x5ec
-#define XK_Arabic_kasratan 0x5ed
-#define XK_Arabic_fatha 0x5ee
-#define XK_Arabic_damma 0x5ef
-#define XK_Arabic_kasra 0x5f0
-#define XK_Arabic_shadda 0x5f1
-#define XK_Arabic_sukun 0x5f2
-#define XK_Arabic_switch 0xFF7E /* Alias for mode_switch */
-#endif /* XK_ARABIC */
-
-/*
- * Cyrillic
- * Byte 3 = 6
- */
-#ifdef XK_CYRILLIC
-#define XK_Serbian_dje 0x6a1
-#define XK_Macedonia_gje 0x6a2
-#define XK_Cyrillic_io 0x6a3
-#define XK_Ukrainian_ie 0x6a4
-#define XK_Ukranian_je 0x6a4 /* deprecated */
-#define XK_Macedonia_dse 0x6a5
-#define XK_Ukrainian_i 0x6a6
-#define XK_Ukranian_i 0x6a6 /* deprecated */
-#define XK_Ukrainian_yi 0x6a7
-#define XK_Ukranian_yi 0x6a7 /* deprecated */
-#define XK_Cyrillic_je 0x6a8
-#define XK_Serbian_je 0x6a8 /* deprecated */
-#define XK_Cyrillic_lje 0x6a9
-#define XK_Serbian_lje 0x6a9 /* deprecated */
-#define XK_Cyrillic_nje 0x6aa
-#define XK_Serbian_nje 0x6aa /* deprecated */
-#define XK_Serbian_tshe 0x6ab
-#define XK_Macedonia_kje 0x6ac
-#define XK_Byelorussian_shortu 0x6ae
-#define XK_Cyrillic_dzhe 0x6af
-#define XK_Serbian_dze 0x6af /* deprecated */
-#define XK_numerosign 0x6b0
-#define XK_Serbian_DJE 0x6b1
-#define XK_Macedonia_GJE 0x6b2
-#define XK_Cyrillic_IO 0x6b3
-#define XK_Ukrainian_IE 0x6b4
-#define XK_Ukranian_JE 0x6b4 /* deprecated */
-#define XK_Macedonia_DSE 0x6b5
-#define XK_Ukrainian_I 0x6b6
-#define XK_Ukranian_I 0x6b6 /* deprecated */
-#define XK_Ukrainian_YI 0x6b7
-#define XK_Ukranian_YI 0x6b7 /* deprecated */
-#define XK_Cyrillic_JE 0x6b8
-#define XK_Serbian_JE 0x6b8 /* deprecated */
-#define XK_Cyrillic_LJE 0x6b9
-#define XK_Serbian_LJE 0x6b9 /* deprecated */
-#define XK_Cyrillic_NJE 0x6ba
-#define XK_Serbian_NJE 0x6ba /* deprecated */
-#define XK_Serbian_TSHE 0x6bb
-#define XK_Macedonia_KJE 0x6bc
-#define XK_Byelorussian_SHORTU 0x6be
-#define XK_Cyrillic_DZHE 0x6bf
-#define XK_Serbian_DZE 0x6bf /* deprecated */
-#define XK_Cyrillic_yu 0x6c0
-#define XK_Cyrillic_a 0x6c1
-#define XK_Cyrillic_be 0x6c2
-#define XK_Cyrillic_tse 0x6c3
-#define XK_Cyrillic_de 0x6c4
-#define XK_Cyrillic_ie 0x6c5
-#define XK_Cyrillic_ef 0x6c6
-#define XK_Cyrillic_ghe 0x6c7
-#define XK_Cyrillic_ha 0x6c8
-#define XK_Cyrillic_i 0x6c9
-#define XK_Cyrillic_shorti 0x6ca
-#define XK_Cyrillic_ka 0x6cb
-#define XK_Cyrillic_el 0x6cc
-#define XK_Cyrillic_em 0x6cd
-#define XK_Cyrillic_en 0x6ce
-#define XK_Cyrillic_o 0x6cf
-#define XK_Cyrillic_pe 0x6d0
-#define XK_Cyrillic_ya 0x6d1
-#define XK_Cyrillic_er 0x6d2
-#define XK_Cyrillic_es 0x6d3
-#define XK_Cyrillic_te 0x6d4
-#define XK_Cyrillic_u 0x6d5
-#define XK_Cyrillic_zhe 0x6d6
-#define XK_Cyrillic_ve 0x6d7
-#define XK_Cyrillic_softsign 0x6d8
-#define XK_Cyrillic_yeru 0x6d9
-#define XK_Cyrillic_ze 0x6da
-#define XK_Cyrillic_sha 0x6db
-#define XK_Cyrillic_e 0x6dc
-#define XK_Cyrillic_shcha 0x6dd
-#define XK_Cyrillic_che 0x6de
-#define XK_Cyrillic_hardsign 0x6df
-#define XK_Cyrillic_YU 0x6e0
-#define XK_Cyrillic_A 0x6e1
-#define XK_Cyrillic_BE 0x6e2
-#define XK_Cyrillic_TSE 0x6e3
-#define XK_Cyrillic_DE 0x6e4
-#define XK_Cyrillic_IE 0x6e5
-#define XK_Cyrillic_EF 0x6e6
-#define XK_Cyrillic_GHE 0x6e7
-#define XK_Cyrillic_HA 0x6e8
-#define XK_Cyrillic_I 0x6e9
-#define XK_Cyrillic_SHORTI 0x6ea
-#define XK_Cyrillic_KA 0x6eb
-#define XK_Cyrillic_EL 0x6ec
-#define XK_Cyrillic_EM 0x6ed
-#define XK_Cyrillic_EN 0x6ee
-#define XK_Cyrillic_O 0x6ef
-#define XK_Cyrillic_PE 0x6f0
-#define XK_Cyrillic_YA 0x6f1
-#define XK_Cyrillic_ER 0x6f2
-#define XK_Cyrillic_ES 0x6f3
-#define XK_Cyrillic_TE 0x6f4
-#define XK_Cyrillic_U 0x6f5
-#define XK_Cyrillic_ZHE 0x6f6
-#define XK_Cyrillic_VE 0x6f7
-#define XK_Cyrillic_SOFTSIGN 0x6f8
-#define XK_Cyrillic_YERU 0x6f9
-#define XK_Cyrillic_ZE 0x6fa
-#define XK_Cyrillic_SHA 0x6fb
-#define XK_Cyrillic_E 0x6fc
-#define XK_Cyrillic_SHCHA 0x6fd
-#define XK_Cyrillic_CHE 0x6fe
-#define XK_Cyrillic_HARDSIGN 0x6ff
-#endif /* XK_CYRILLIC */
-
-/*
- * Greek
- * Byte 3 = 7
- */
-
-#ifdef XK_GREEK
-#define XK_Greek_ALPHAaccent 0x7a1
-#define XK_Greek_EPSILONaccent 0x7a2
-#define XK_Greek_ETAaccent 0x7a3
-#define XK_Greek_IOTAaccent 0x7a4
-#define XK_Greek_IOTAdiaeresis 0x7a5
-#define XK_Greek_OMICRONaccent 0x7a7
-#define XK_Greek_UPSILONaccent 0x7a8
-#define XK_Greek_UPSILONdieresis 0x7a9
-#define XK_Greek_OMEGAaccent 0x7ab
-#define XK_Greek_accentdieresis 0x7ae
-#define XK_Greek_horizbar 0x7af
-#define XK_Greek_alphaaccent 0x7b1
-#define XK_Greek_epsilonaccent 0x7b2
-#define XK_Greek_etaaccent 0x7b3
-#define XK_Greek_iotaaccent 0x7b4
-#define XK_Greek_iotadieresis 0x7b5
-#define XK_Greek_iotaaccentdieresis 0x7b6
-#define XK_Greek_omicronaccent 0x7b7
-#define XK_Greek_upsilonaccent 0x7b8
-#define XK_Greek_upsilondieresis 0x7b9
-#define XK_Greek_upsilonaccentdieresis 0x7ba
-#define XK_Greek_omegaaccent 0x7bb
-#define XK_Greek_ALPHA 0x7c1
-#define XK_Greek_BETA 0x7c2
-#define XK_Greek_GAMMA 0x7c3
-#define XK_Greek_DELTA 0x7c4
-#define XK_Greek_EPSILON 0x7c5
-#define XK_Greek_ZETA 0x7c6
-#define XK_Greek_ETA 0x7c7
-#define XK_Greek_THETA 0x7c8
-#define XK_Greek_IOTA 0x7c9
-#define XK_Greek_KAPPA 0x7ca
-#define XK_Greek_LAMDA 0x7cb
-#define XK_Greek_LAMBDA 0x7cb
-#define XK_Greek_MU 0x7cc
-#define XK_Greek_NU 0x7cd
-#define XK_Greek_XI 0x7ce
-#define XK_Greek_OMICRON 0x7cf
-#define XK_Greek_PI 0x7d0
-#define XK_Greek_RHO 0x7d1
-#define XK_Greek_SIGMA 0x7d2
-#define XK_Greek_TAU 0x7d4
-#define XK_Greek_UPSILON 0x7d5
-#define XK_Greek_PHI 0x7d6
-#define XK_Greek_CHI 0x7d7
-#define XK_Greek_PSI 0x7d8
-#define XK_Greek_OMEGA 0x7d9
-#define XK_Greek_alpha 0x7e1
-#define XK_Greek_beta 0x7e2
-#define XK_Greek_gamma 0x7e3
-#define XK_Greek_delta 0x7e4
-#define XK_Greek_epsilon 0x7e5
-#define XK_Greek_zeta 0x7e6
-#define XK_Greek_eta 0x7e7
-#define XK_Greek_theta 0x7e8
-#define XK_Greek_iota 0x7e9
-#define XK_Greek_kappa 0x7ea
-#define XK_Greek_lamda 0x7eb
-#define XK_Greek_lambda 0x7eb
-#define XK_Greek_mu 0x7ec
-#define XK_Greek_nu 0x7ed
-#define XK_Greek_xi 0x7ee
-#define XK_Greek_omicron 0x7ef
-#define XK_Greek_pi 0x7f0
-#define XK_Greek_rho 0x7f1
-#define XK_Greek_sigma 0x7f2
-#define XK_Greek_finalsmallsigma 0x7f3
-#define XK_Greek_tau 0x7f4
-#define XK_Greek_upsilon 0x7f5
-#define XK_Greek_phi 0x7f6
-#define XK_Greek_chi 0x7f7
-#define XK_Greek_psi 0x7f8
-#define XK_Greek_omega 0x7f9
-#define XK_Greek_switch 0xFF7E /* Alias for mode_switch */
-#endif /* XK_GREEK */
-
-/*
- * Technical
- * Byte 3 = 8
- */
-
-#ifdef XK_TECHNICAL
-#define XK_leftradical 0x8a1
-#define XK_topleftradical 0x8a2
-#define XK_horizconnector 0x8a3
-#define XK_topintegral 0x8a4
-#define XK_botintegral 0x8a5
-#define XK_vertconnector 0x8a6
-#define XK_topleftsqbracket 0x8a7
-#define XK_botleftsqbracket 0x8a8
-#define XK_toprightsqbracket 0x8a9
-#define XK_botrightsqbracket 0x8aa
-#define XK_topleftparens 0x8ab
-#define XK_botleftparens 0x8ac
-#define XK_toprightparens 0x8ad
-#define XK_botrightparens 0x8ae
-#define XK_leftmiddlecurlybrace 0x8af
-#define XK_rightmiddlecurlybrace 0x8b0
-#define XK_topleftsummation 0x8b1
-#define XK_botleftsummation 0x8b2
-#define XK_topvertsummationconnector 0x8b3
-#define XK_botvertsummationconnector 0x8b4
-#define XK_toprightsummation 0x8b5
-#define XK_botrightsummation 0x8b6
-#define XK_rightmiddlesummation 0x8b7
-#define XK_lessthanequal 0x8bc
-#define XK_notequal 0x8bd
-#define XK_greaterthanequal 0x8be
-#define XK_integral 0x8bf
-#define XK_therefore 0x8c0
-#define XK_variation 0x8c1
-#define XK_infinity 0x8c2
-#define XK_nabla 0x8c5
-#define XK_approximate 0x8c8
-#define XK_similarequal 0x8c9
-#define XK_ifonlyif 0x8cd
-#define XK_implies 0x8ce
-#define XK_identical 0x8cf
-#define XK_radical 0x8d6
-#define XK_includedin 0x8da
-#define XK_includes 0x8db
-#define XK_intersection 0x8dc
-#define XK_union 0x8dd
-#define XK_logicaland 0x8de
-#define XK_logicalor 0x8df
-#define XK_partialderivative 0x8ef
-#define XK_function 0x8f6
-#define XK_leftarrow 0x8fb
-#define XK_uparrow 0x8fc
-#define XK_rightarrow 0x8fd
-#define XK_downarrow 0x8fe
-#endif /* XK_TECHNICAL */
-
-/*
- * Special
- * Byte 3 = 9
- */
-
-#ifdef XK_SPECIAL
-#define XK_blank 0x9df
-#define XK_soliddiamond 0x9e0
-#define XK_checkerboard 0x9e1
-#define XK_ht 0x9e2
-#define XK_ff 0x9e3
-#define XK_cr 0x9e4
-#define XK_lf 0x9e5
-#define XK_nl 0x9e8
-#define XK_vt 0x9e9
-#define XK_lowrightcorner 0x9ea
-#define XK_uprightcorner 0x9eb
-#define XK_upleftcorner 0x9ec
-#define XK_lowleftcorner 0x9ed
-#define XK_crossinglines 0x9ee
-#define XK_horizlinescan1 0x9ef
-#define XK_horizlinescan3 0x9f0
-#define XK_horizlinescan5 0x9f1
-#define XK_horizlinescan7 0x9f2
-#define XK_horizlinescan9 0x9f3
-#define XK_leftt 0x9f4
-#define XK_rightt 0x9f5
-#define XK_bott 0x9f6
-#define XK_topt 0x9f7
-#define XK_vertbar 0x9f8
-#endif /* XK_SPECIAL */
-
-/*
- * Publishing
- * Byte 3 = a
- */
-
-#ifdef XK_PUBLISHING
-#define XK_emspace 0xaa1
-#define XK_enspace 0xaa2
-#define XK_em3space 0xaa3
-#define XK_em4space 0xaa4
-#define XK_digitspace 0xaa5
-#define XK_punctspace 0xaa6
-#define XK_thinspace 0xaa7
-#define XK_hairspace 0xaa8
-#define XK_emdash 0xaa9
-#define XK_endash 0xaaa
-#define XK_signifblank 0xaac
-#define XK_ellipsis 0xaae
-#define XK_doubbaselinedot 0xaaf
-#define XK_onethird 0xab0
-#define XK_twothirds 0xab1
-#define XK_onefifth 0xab2
-#define XK_twofifths 0xab3
-#define XK_threefifths 0xab4
-#define XK_fourfifths 0xab5
-#define XK_onesixth 0xab6
-#define XK_fivesixths 0xab7
-#define XK_careof 0xab8
-#define XK_figdash 0xabb
-#define XK_leftanglebracket 0xabc
-#define XK_decimalpoint 0xabd
-#define XK_rightanglebracket 0xabe
-#define XK_marker 0xabf
-#define XK_oneeighth 0xac3
-#define XK_threeeighths 0xac4
-#define XK_fiveeighths 0xac5
-#define XK_seveneighths 0xac6
-#define XK_trademark 0xac9
-#define XK_signaturemark 0xaca
-#define XK_trademarkincircle 0xacb
-#define XK_leftopentriangle 0xacc
-#define XK_rightopentriangle 0xacd
-#define XK_emopencircle 0xace
-#define XK_emopenrectangle 0xacf
-#define XK_leftsinglequotemark 0xad0
-#define XK_rightsinglequotemark 0xad1
-#define XK_leftdoublequotemark 0xad2
-#define XK_rightdoublequotemark 0xad3
-#define XK_prescription 0xad4
-#define XK_minutes 0xad6
-#define XK_seconds 0xad7
-#define XK_latincross 0xad9
-#define XK_hexagram 0xada
-#define XK_filledrectbullet 0xadb
-#define XK_filledlefttribullet 0xadc
-#define XK_filledrighttribullet 0xadd
-#define XK_emfilledcircle 0xade
-#define XK_emfilledrect 0xadf
-#define XK_enopencircbullet 0xae0
-#define XK_enopensquarebullet 0xae1
-#define XK_openrectbullet 0xae2
-#define XK_opentribulletup 0xae3
-#define XK_opentribulletdown 0xae4
-#define XK_openstar 0xae5
-#define XK_enfilledcircbullet 0xae6
-#define XK_enfilledsqbullet 0xae7
-#define XK_filledtribulletup 0xae8
-#define XK_filledtribulletdown 0xae9
-#define XK_leftpointer 0xaea
-#define XK_rightpointer 0xaeb
-#define XK_club 0xaec
-#define XK_diamond 0xaed
-#define XK_heart 0xaee
-#define XK_maltesecross 0xaf0
-#define XK_dagger 0xaf1
-#define XK_doubledagger 0xaf2
-#define XK_checkmark 0xaf3
-#define XK_ballotcross 0xaf4
-#define XK_musicalsharp 0xaf5
-#define XK_musicalflat 0xaf6
-#define XK_malesymbol 0xaf7
-#define XK_femalesymbol 0xaf8
-#define XK_telephone 0xaf9
-#define XK_telephonerecorder 0xafa
-#define XK_phonographcopyright 0xafb
-#define XK_caret 0xafc
-#define XK_singlelowquotemark 0xafd
-#define XK_doublelowquotemark 0xafe
-#define XK_cursor 0xaff
-#endif /* XK_PUBLISHING */
-
-/*
- * APL
- * Byte 3 = b
- */
-
-#ifdef XK_APL
-#define XK_leftcaret 0xba3
-#define XK_rightcaret 0xba6
-#define XK_downcaret 0xba8
-#define XK_upcaret 0xba9
-#define XK_overbar 0xbc0
-#define XK_downtack 0xbc2
-#define XK_upshoe 0xbc3
-#define XK_downstile 0xbc4
-#define XK_underbar 0xbc6
-#define XK_jot 0xbca
-#define XK_quad 0xbcc
-#define XK_uptack 0xbce
-#define XK_circle 0xbcf
-#define XK_upstile 0xbd3
-#define XK_downshoe 0xbd6
-#define XK_rightshoe 0xbd8
-#define XK_leftshoe 0xbda
-#define XK_lefttack 0xbdc
-#define XK_righttack 0xbfc
-#endif /* XK_APL */
-
-/*
- * Hebrew
- * Byte 3 = c
- */
-
-#ifdef XK_HEBREW
-#define XK_hebrew_doublelowline 0xcdf
-#define XK_hebrew_aleph 0xce0
-#define XK_hebrew_bet 0xce1
-#define XK_hebrew_beth 0xce1 /* deprecated */
-#define XK_hebrew_gimel 0xce2
-#define XK_hebrew_gimmel 0xce2 /* deprecated */
-#define XK_hebrew_dalet 0xce3
-#define XK_hebrew_daleth 0xce3 /* deprecated */
-#define XK_hebrew_he 0xce4
-#define XK_hebrew_waw 0xce5
-#define XK_hebrew_zain 0xce6
-#define XK_hebrew_zayin 0xce6 /* deprecated */
-#define XK_hebrew_chet 0xce7
-#define XK_hebrew_het 0xce7 /* deprecated */
-#define XK_hebrew_tet 0xce8
-#define XK_hebrew_teth 0xce8 /* deprecated */
-#define XK_hebrew_yod 0xce9
-#define XK_hebrew_finalkaph 0xcea
-#define XK_hebrew_kaph 0xceb
-#define XK_hebrew_lamed 0xcec
-#define XK_hebrew_finalmem 0xced
-#define XK_hebrew_mem 0xcee
-#define XK_hebrew_finalnun 0xcef
-#define XK_hebrew_nun 0xcf0
-#define XK_hebrew_samech 0xcf1
-#define XK_hebrew_samekh 0xcf1 /* deprecated */
-#define XK_hebrew_ayin 0xcf2
-#define XK_hebrew_finalpe 0xcf3
-#define XK_hebrew_pe 0xcf4
-#define XK_hebrew_finalzade 0xcf5
-#define XK_hebrew_finalzadi 0xcf5 /* deprecated */
-#define XK_hebrew_zade 0xcf6
-#define XK_hebrew_zadi 0xcf6 /* deprecated */
-#define XK_hebrew_qoph 0xcf7
-#define XK_hebrew_kuf 0xcf7 /* deprecated */
-#define XK_hebrew_resh 0xcf8
-#define XK_hebrew_shin 0xcf9
-#define XK_hebrew_taw 0xcfa
-#define XK_hebrew_taf 0xcfa /* deprecated */
-#define XK_Hebrew_switch 0xFF7E /* Alias for mode_switch */
-#endif /* XK_HEBREW */
-
diff --git a/blt3.0.1/win/install.tcl b/blt3.0.1/win/install.tcl
deleted file mode 100644
index 0a94ece..0000000
--- a/blt3.0.1/win/install.tcl
+++ /dev/null
@@ -1,739 +0,0 @@
-#
-# Script for installation of BLT under Windows
-#
-
-namespace eval Installer {
- variable commandList {}
- variable cmdLog {}
- variable component
- array set component {
- binaries 1
- headers 1
- html 1
- scripts 1
- demos 1
- }
- variable totalBytes 0
- variable totalFiles 0
- variable panel 0
- variable panelList {
- Welcome Directory Components Ready Finish
- }
-}
-
-proc Installer::DoInstall { package version } {
- global prefix srcdir
-
- regsub {\.} $version {} v2
- variable scriptdir
- set scriptdir $prefix/lib/blt${version}
- variable component
- global tcl_platform
- if { $component(binaries) } {
- if { $tcl_platform(platform) == "unix" } {
- Add ${srcdir}/src -perm 0755 \
- -file bltwish \
- -file bltsh \
- -rename "bltwish bltwish${v2}" \
- -rename "bltsh bltsh${v2}" \
- $prefix/bin
- set ext [info sharedlibextension]
- Add ${srcdir}/src -perm 0755 \
- -file libBLT${v2}.a \
- -file libBLTlite${v2}.a \
- -file shared/libBLT${v2}${ext} \
- -file shared/libBLTlite${v2}${ext} \
- $prefix/lib
- } else {
- Add ${srcdir}/src -perm 0755 \
- -file bltwish.exe \
- -file bltsh.exe \
- -file BLT${v2}.dll \
- -file BLTlite${v2}.dll \
- -rename "bltwish.exe bltwish${v2}.exe" \
- -rename "bltsh.exe bltsh${v2}.exe" \
- $prefix/bin
- Add ${srcdir}/src -perm 0755 \
- -file BLT${v2}.lib \
- -file BLTlite${v2}.lib \
- $prefix/lib
- }
- }
- if { $component(headers) } {
- Add ${srcdir}/src \
- -file blt.h \
- -file bltChain.h \
- -file bltVector.h \
- -file bltTree.h \
- $prefix/include
- }
- if { $component(html) } {
- Add ${srcdir}/html -pattern *.html $scriptdir/html
- }
- if { $component(scripts) } {
- Add ${srcdir} -file README -file PROBLEMS $scriptdir
- Add ${srcdir}/library \
- -pattern *.cur \
- -pattern *.tcl \
- -pattern *.pro \
- -file tclIndex \
- $scriptdir
- Add ${srcdir}/library/dd_protocols \
- -pattern *.tcl \
- -file tclIndex \
- $scriptdir/dd_protocols
- }
- if { $component(demos) } {
- Add ${srcdir}/demos \
- -pattern *.tcl \
- -file htext.txt \
- $scriptdir/demos
- Add ${srcdir}/demos/bitmaps -pattern *.xbm $scriptdir/bitmaps
- Add ${srcdir}/demos/bitmaps/hand -pattern *.xbm $scriptdir/bitmaps/hand
- Add ${srcdir}/demos/bitmaps/fish -pattern *.xbm $scriptdir/bitmaps/fish
- Add ${srcdir}/demos/images \
- -pattern *.gif \
- -file out.ps \
- $scriptdir/images
- Add ${srcdir}/demos/scripts -pattern *.tcl $scriptdir/scripts
- }
- Install $package $version
-}
-
-proc Installer::InstallDirectory { dest } {
- variable commandList
- lappend commandList [list CheckPath $dest]
-}
-
-proc Installer::Update { src dest size perm } {
- variable currentBytes
- variable totalBytes
-
- .install.text insert end "file copy -force $src $dest\n"
- if { [catch {file copy -force $src $dest} results] != 0 } {
- .install.text insert end "Error: $results\n" fail
- } else {
- incr currentBytes $size
- }
- global tcl_platform
- if { $tcl_platform(platform) == "unix" } {
- .install.text insert end "file attributes $dest -permissions $perm\n"
- if { [catch {file attributes $dest -permissions $perm} results] != 0 } {
- .install.text insert end "Error: $results\n" fail
- }
- }
- set percent [expr round(double($currentBytes)/$totalBytes * 100.0)]
- .install.current configure -text "$percent% complete"
- update
-}
-
-proc Installer::InstallFile { src dest perm } {
- variable commandList
- variable totalBytes
- variable totalFiles
-
- if { [catch { file size $src } size ] != 0 } {
- set size 0
- }
- lappend commandList [list Update $src $dest $size $perm]
- incr totalBytes $size
- incr totalFiles
-}
-
-proc Installer::Add { dir args } {
- variable commandList
- variable totalBytes
-
- if { ![file exists $dir] } {
- error "can't find directory \"$dir\""
- }
- set argc [llength $args]
- set destDir [lindex $args end]
- incr argc -2
- set perm 0644
-
- InstallDirectory $destDir
- foreach { option value } [lrange $args 0 $argc] {
- switch -- $option {
- "-pattern" {
- foreach f [lsort [glob $dir/$value]] {
- InstallFile $f $destDir/[file tail $f] $perm
- }
- }
- "-rename" {
- set src [lindex $value 0]
- set dest [lindex $value 1]
- InstallFile $dir/$src $destDir/$dest $perm
- }
- "-perm" {
- set perm $value
- }
- "-file" {
- InstallFile $dir/$value $destDir/$value $perm
- }
- default {
- error "Unknown option \"$option\""
- }
- }
- }
-}
-
-proc Installer::CheckPath { dest } {
- set save [pwd]
- if { [file pathtype $dest] == "absolute" } {
- if { [string match {[a-zA-Z]:*} $dest] } {
- cd [string range $dest 0 2]
- set dest [string range $dest 3 end]
- } else {
- cd /
- set dest [string range $dest 1 end]
- }
- }
- set dirs [file split $dest]
- foreach d $dirs {
- if { ![file exists $d] } {
- .install.text insert end "file mkdir $d\n"
- if { [catch { file mkdir $d } result] != 0 } {
- .install.text insert end "Error: $result\n" fail
- break
- }
- }
- if { ![file isdirectory $d] } {
- .install.text insert end "Error: Not a directory: \"$d\"" fail
- break
- }
- update
- cd $d
- }
- cd $save
-}
-
-proc Installer::MakePackageIndex { package version file } {
- global prefix
- set suffix [info sharedlibextension]
- regsub {\.} $version {} version_no_dots
- set libName "${package}${version_no_dots}${suffix}"
- set libPath [file join ${prefix}/bin $libName]
- set cmd [list load $libPath $package]
-
- if { [file exists $file] } {
- file delete $file
- }
- set cmd {
- set fid [open $file "w"]
- puts $fid "# Package Index for $package"
- puts $fid "# generated on [clock format [clock seconds]]"
- puts $fid ""
- puts $fid [list package ifneeded $package $version $cmd]
- close $fid
- }
- if { [catch $cmd result] != 0 } {
- .install.text insert end "Error: $result\n" fail
- }
-}
-
-proc Installer::SetRegistryKey { package version valueName } {
- variable scriptdir
- global tcl_version
-
- package require registry
- set key HKEY_LOCAL_MACHINE\\Software\\$package\\$version\\$tcl_version
- registry set $key $valueName $scriptdir
-}
-
-proc Installer::Install { package version } {
- variable commandList
- variable totalBytes
- variable currentBytes 0
- variable totalFiles
- variable scriptdir
-
- .install.totals configure -text "Files: $totalFiles Size: $totalBytes"
- foreach cmd $commandList {
- if { ![winfo exists .install] } {
- return
- }
- if { [catch $cmd result] != 0 } {
- .install.text insert end "Error: $result\n" fail
- }
- update
- }
- global tcl_version tcl_platform prefix
- set name [string tolower $package]
- MakePackageIndex $package $version $scriptdir/pkgIndex.tcl
- MakePackageIndex $package $version \
- $prefix/lib/tcl${tcl_version}/${name}${version}/pkgIndex.tcl
- if { $tcl_platform(platform) == "windows" } {
- SetRegistryKey $package $version ${package}_LIBRARY
- }
- .install.cancel configure -text "Done"
-}
-
-proc Installer::Next {} {
- variable panel
- variable continue
- variable panelList
-
- incr panel
- set max [llength $panelList]
- if { $panel >= $max } {
- exit 0
- }
- if { ($panel + 1) == $max } {
- .next configure -text "Finish"
- .cancel configure -state disabled
- } else {
- .next configure -text "Next"
- }
- if { $panel > 0 } {
- .back configure -state normal
- }
- set continue 1
-}
-
-proc Installer::Back {} {
- variable panel
- variable continue
-
- incr panel -1
- if { $panel <= 0 } {
- .back configure -state disabled
- set panel 0
- } else {
- .back configure -state normal
- }
- .next configure -text "Next"
- .cancel configure -state normal
- set continue 0
-}
-
-proc Installer::Cancel {} {
- exit 0
-}
-
-if { $tcl_platform(platform) == "unix" } {
- font create textFont -family Helvetica -weight normal -size 11
- font create titleFont -family Helvetica -weight normal -size 14
-} else {
- font create titleFont -family Arial -weight bold -size 12
- font create textFont -family Arial -weight normal -size 9
-}
-font create hugeFont -family {Times New Roman} -size 18 -slant italic \
- -weight bold
-
-proc Installer::MakeLink { widget tag command } {
- $widget tag configure $tag -foreground blue -underline yes
- $widget tag bind $tag <ButtonRelease-1> \
- "$command; $widget tag configure $tag -foreground blue"
- $widget tag bind $tag <ButtonPress-1> \
- [list $widget tag configure $tag -foreground red]
-}
-
-proc Installer::Welcome { package version } {
- global tcl_version
- if { [winfo exists .panel] } {
- destroy .panel
- }
- text .panel -wrap word -width 10 -height 18 \
- -relief flat -padx 4 -pady 4 -cursor arrow \
- -background [. cget -bg]
- .panel tag configure welcome -font titleFont -justify center \
- -foreground navyblue
- .panel tag configure package -font hugeFont -foreground red \
- -justify center
- MakeLink .panel next "Installer::Next"
- MakeLink .panel cancel "Installer::Cancel"
- .panel insert end "Welcome!\n" welcome
- .panel insert end "\n"
- .panel insert end \
- "This installs the compiled \n" "" \
- "${package} ${version}\n" package \
- "binaries and components from the source directories to " "" \
- "where Tcl/Tk is currently installed.\n\nThe compiled binaries " "" \
- "require Tcl/Tk $tcl_version.\n\n"
- .panel insert end \
- "Press the " "" \
- "Next" next \
- " button to continue. Press the " "" \
- "Cancel" cancel \
- " button if you do not wish to install $package at this time."
- .panel configure -state disabled
- blt::table . \
- 0,1 .panel -columnspan 3 -pady 10 -padx { 0 10 } -fill x -anchor n
- tkwait variable Installer::continue
-}
-
-option add *Hierbox.openCommand {Installer::OpenDir %W "%P" %n}
-
-proc Installer::OpenDir { widget path atnode } {
- puts path=$path
- set save [pwd]
- global tcl_platform
-
- if { $tcl_platform(platform) == "windows" } {
- if { $path == "/" } {
- foreach v [file volumes] {
- if { ![string match {[A-B]:/} $v] } {
- .browser.h insert end $v -button yes
- }
- }
- return
- }
- set path [string trimleft $path /]
- }
- cd $path/
- foreach dir [lsort [glob -nocomplain */ ]] {
- set node [$widget insert -at $atnode end $dir]
- # Does the directory have subdirectories?
- set subdirs [glob -nocomplain $dir/*/ ]
- if { $subdirs != "" } {
- $widget entry configure $node -button yes
- } else {
- $widget entry configure $node -button no
- }
- }
- cd $save
-}
-
-proc Installer::CenterPanel { panel } {
- update idletasks
- set x [expr ([winfo width .] - [winfo reqwidth $panel]) / 2]
- set y [expr ([winfo height .] - [winfo reqheight $panel]) / 2]
- incr x [winfo rootx .]
- incr y [winfo rooty .]
- wm geometry $panel +$x+$y
- wm deiconify $panel
-}
-
-proc Installer::Browse { } {
- if { [winfo exists .browser] } {
- raise .browser
- wm deiconify .browser
- return
- }
- toplevel .browser
- entry .browser.entry -bg white -borderwidth 2 -relief sunken \
- -textvariable Installer::selection
- bind .browser.entry <KeyPress-Return> {
- .browser.ok flash
- .browser.ok invoke
- }
- blt::hierbox .browser.h -hideroot yes -separator / -height 1i -width 3i \
- -borderwidth 2 -relief sunken -autocreate yes -trim / \
- -yscrollcommand { .browser.sbar set } \
- -selectcommand {
- set index [.browser.h curselection]
- set path [lindex [.browser.h get -full $index] 0]
- if { $tcl_platform(platform) == "windows" } {
- set path [string trimleft $path /]
- }
- puts $path
- set Installer::selection $path
- }
- scrollbar .browser.sbar -command { .browser.h yview }
- wm protocol .browser WM_DELETE_WINDOW { .browser.cancel invoke }
- wm transient .browser .
- frame .browser.sep -height 2 -borderwidth 1 -relief sunken
- button .browser.ok -text "Continue" -command {
- set prefix $Installer::selection
- grab release .browser
- destroy .browser
- }
- button .browser.cancel -text "Cancel" -command {
- grab release .browser
- destroy .browser
- }
- global tcl_platform
- global prefix
- if { $tcl_platform(platform) == "windows" } {
- set root "C:/"
- .browser.h open "C:/"
- .browser.h open "C:/Program Files"
- if { [file exists $prefix] } {
- .browser.h see $prefix/
- }
- } else {
- set root /usr/local
- #.browser.h open $root
- }
- set Installer::selection $prefix
- wm title .browser "Installer: Select Install Directory"
- blt::table .browser \
- 0,0 .browser.entry -fill x -columnspan 2 -padx 4 -pady 4 \
- 1,0 .browser.h -fill both -columnspan 2 -padx 4 -pady { 0 4 } \
- 1,2 .browser.sbar -fill y \
- 2,0 .browser.sep -fill x -padx 10 -cspan 3 -pady { 4 0 } \
- 3,0 .browser.ok -width .75i -padx 4 -pady 4 \
- 3,1 .browser.cancel -width .75i -padx 4 -pady 4
- blt::table configure .browser c2 r0 r2 r3 -resize none
- wm withdraw .browser
- after idle {
- Installer::CenterPanel .browser
- grab set .browser
- }
-}
-
-proc Installer::Directory { package version } {
- global tcl_version
- if { [winfo exists .panel] } {
- destroy .panel
- }
- frame .panel
- text .panel.text -wrap word -width 10 \
- -height 10 -borderwidth 0 -padx 4 -pady 4 -cursor arrow \
- -background [.panel cget -background]
- .panel.text tag configure title -font titleFont -justify center \
- -foreground navyblue
- .panel.text insert end "Select Destination Directory\n" title
- .panel.text insert end "\n\n"
- .panel.text insert end "Please select the directory where Tcl/Tk \
-$tcl_version is installed. This is also where $package $version will be \
-installed.\n"
- .panel.text configure -state disabled
- frame .panel.frame -relief groove -borderwidth 2
- label .panel.frame.label -textvariable ::prefix
- button .panel.frame.button -text "Browse..." -command Installer::Browse
- blt::table .panel.frame \
- 0,0 .panel.frame.label -padx 4 -pady 4 -anchor w \
- 0,1 .panel.frame.button -padx 4 -pady 4 -anchor e
- blt::table .panel \
- 0,0 .panel.text -padx 4 -pady 4 -fill both \
- 1,0 .panel.frame -padx 4 -fill x
- blt::table . \
- 0,1 .panel -columnspan 3 -pady 10 -padx { 0 10 } -fill both
- tkwait variable Installer::continue
-}
-
-proc Installer::Components { package version } {
- global tcl_version
- if { [winfo exists .panel] } {
- destroy .panel
- }
- regsub {\.} $version {} v2
- frame .panel
- text .panel.text -wrap word -width 10 \
- -height 8 -borderwidth 0 -padx 4 -pady 4 -cursor arrow \
- -background [.panel cget -background]
- .panel.text tag configure title -font titleFont -justify center \
- -foreground navyblue
- .panel.text insert end "Select Components\n" title
- .panel.text insert end "\n\n"
- .panel.text insert end "Please select the components you wish to install. \
-You should install all components.\n"
- .panel.text configure -state disabled
- frame .panel.frame -relief groove -borderwidth 2
- variable component
- global tcl_platform
- if { $tcl_platform(platform) == "unix" } {
- set ext [info sharedlibextension]
- set sharedlib lib${package}${v2}${ext}
- set lib lib${package}${v2}.a
- set exe ""
- } else {
- set sharedlib ${package}${v2}.dll
- set lib ${package}${v2}.lib
- set exe ".exe"
- }
- checkbutton .panel.frame.binaries \
- -text "bltwish${exe} and Shared Library" \
- -variable Installer::component(binaries)
- checkbutton .panel.frame.scripts \
- -text "Script Library" \
- -variable Installer::component(scripts)
- checkbutton .panel.frame.headers \
- -text "Include Files and Static Library" \
- -variable Installer::component(headers)
- checkbutton .panel.frame.html -text "HTML Manual Pages" \
- -variable Installer::component(html)
- checkbutton .panel.frame.demos -text "Demos" \
- -variable Installer::component(demos)
- blt::table .panel.frame \
- 0,0 .panel.frame.binaries -padx 4 -pady 4 -anchor w \
- 1,0 .panel.frame.scripts -padx 4 -pady 4 -anchor w \
- 2,0 .panel.frame.headers -padx 4 -pady 4 -anchor w \
- 3,0 .panel.frame.html -padx 4 -pady 4 -anchor w \
- 4,0 .panel.frame.demos -padx 4 -pady 4 -anchor w
- blt::table .panel \
- 0,0 .panel.text -padx 4 -pady 4 -fill both \
- 1,0 .panel.frame -padx 4 -fill both
- blt::table . \
- 0,1 .panel -columnspan 3 -pady 10 -padx { 0 10 } -fill both
- tkwait variable Installer::continue
-}
-
-proc Installer::Ready { package version } {
- global tcl_version
- if { [winfo exists .panel] } {
- destroy .panel
- }
- text .panel -wrap word -width 10 -height 18 \
- -relief flat -padx 4 -pady 4 -cursor arrow \
- -background [. cget -bg]
- .panel tag configure welcome -font titleFont -justify center \
- -foreground navyblue
- .panel tag configure package -font hugeFont -foreground red \
- -justify center
- MakeLink .panel next "Installer::Next"
- MakeLink .panel cancel "Installer::Cancel"
- MakeLink .panel back "Installer::Back"
- .panel insert end "Ready To Install!\n" welcome
- .panel insert end "\n"
- .panel insert end "We're now ready to install ${package} ${version} \
-and its components.\n\n"
- .panel insert end \
- "Press the " "" \
- "Next" next \
- " button to install all selected components.\n\n" ""
- .panel insert end \
- "To reselect components, click on the " "" \
- "Back" back \
- " button.\n\n"
- .panel insert end \
- "Press the " "" \
- "Cancel" cancel \
- " button if you do not wish to install $package at this time."
- .panel configure -state disabled
- blt::table . \
- 0,1 .panel -columnspan 3 -pady 10 -padx { 0 10 } -fill x -anchor n
- tkwait variable Installer::continue
- if { $Installer::continue } {
- Results
- update
- DoInstall $package $version
- }
-}
-
-proc Installer::Results { } {
- if { [winfo exists .install] } {
- destroy .install
- }
- toplevel .install
- text .install.text -height 10 -width 50 -wrap none -bg white \
- -yscrollcommand { .install.ybar set } \
- -xscrollcommand { .install.xbar set }
- .install.text tag configure fail -foreground red
- label .install.totals -text "Files: 0 Bytes: 0" -width 50
- label .install.current -text "Installing:\n" -height 2 -width 50
- scrollbar .install.ybar -command { .install.text yview }
- scrollbar .install.xbar -command { .install.text xview } -orient horizontal
- wm protocol .install WM_DELETE_WINDOW { .install.cancel invoke }
- wm transient .install .
- button .install.cancel -text "Cancel" -command {
- grab release .install
- destroy .install
- }
- blt::table .install \
- 0,0 .install.totals -anchor w -columnspan 2 \
- 1,0 .install.current -anchor w -cspan 2 \
- 2,0 .install.text -fill both \
- 2,1 .install.ybar -fill y \
- 3,0 .install.xbar -fill x \
- 4,0 .install.cancel -width .75i -padx 4 -pady 4 -cspan 2
- blt::table configure .install c1 r0 r1 r3 -resize none
- wm withdraw .install
- after idle {
- Installer::CenterPanel .install
- grab set .install
- }
-}
-
-proc Installer::Finish { package version } {
- global tcl_version
- if { [winfo exists .panel] } {
- destroy .panel
- }
- text .panel -wrap word -width 10 -height 18 \
- -relief flat -padx 4 -pady 4 -cursor arrow \
- -background [. cget -bg]
- .panel tag configure welcome -font titleFont -justify center \
- -foreground navyblue
- .panel tag configure package -font hugeFont -foreground red \
- -justify center
- .panel insert end "Installation Completed\n" welcome
- .panel insert end "\n"
- .panel insert end "${package} ${version} is now installed.\n\n"
- MakeLink .panel finish "Installer::Next"
- .panel insert end \
- "Press the " "" \
- "Finish" finish \
- " button to exit this installation"
- .panel configure -state disabled
- blt::table . \
- 0,1 .panel -columnspan 3 -pady 10 -padx { 0 10 } -fill x -anchor n
- tkwait variable Installer::continue
-}
-
-
-set prefix [lindex $argv 2]
-set srcdir [lindex $argv 1]
-set version [lindex $argv 0]
-
-set version 2.4
-set package BLT
-regsub {\.} $version {} v2
-set ext [info sharedlibextension]
-
-if { $tcl_platform(platform) == "unix" } {
- set ext [info sharedlibextension]
- set sharedlib shared/lib${package}${v2}${ext}
- set prefix "/usr/local/blt"
-} else {
- set sharedlib ${package}${v2}.dll
- set prefix "C:/Program Files/Tcl"
-}
-if { [file exists ./src/$sharedlib] } {
- load ./src/$sharedlib $package
-} else {
- error "Can't find library \"$sharedlib\" to load"
-}
-set blt_library $srcdir/library
-
-image create photo openFolder -format gif -data {
-R0lGODlhEAANAPIAAAAAAH9/f7+/v///////AAAAAAAAAAAAACH+JEZpbGUgd3JpdHRlbiBi
-eSBBZG9iZSBQaG90b3Nob3CoIDUuMAAsAAAAABAADQAAAzk4Gsz6cIQ44xqCZCGbk4MmclAA
-gNs4ml7rEaxVAkKc3gTAnBO+sbyQT6M7gVQpk9HlAhgHzqhUmgAAOw==
-}
-image create photo closeFolder -format gif -data {
-R0lGODlhEAANAPIAAAAAAH9/f7+/v///AP///wAAAAAAAAAAACH+JEZpbGUgd3JpdHRlbiBi
-eSBBZG9iZSBQaG90b3Nob3CoIDUuMAAsAAAAABAADQAAAzNIGsz6kAQxqAjxzcpvc1KWBUDY
-nRQZWmilYi37EmztlrAt43R8mzrO60P8lAiApHK5TAAAOw==
-}
-image create photo blt -file ${srcdir}/demos/images/blt98.gif
-option add *Text.font textFont
-option add *HighlightThickness 0
-option add *Hierbox.icons "closeFolder openFolder"
-option add *Hierbox.button yes
-
-set color \#accaff
-option add *Frame.background $color
-option add *Toplevel.background $color
-#option add *Button.background $color
-option add *Checkbutton.background $color
-option add *Label.background $color
-option add *Text.background $color
-. configure -bg $color
-wm title . "$package $version Installer"
-label .image -image blt -borderwidth 2 -relief groove
-button .back -text "Back" -state disabled -command Installer::Back -underline 0
-button .next -text "Next" -command Installer::Next -underline 0
-button .cancel -text "Cancel" -command Installer::Cancel -underline 0
-frame .sep -height 2 -borderwidth 1 -relief sunken
-blt::table . \
- 0,0 .image -fill both -padx 10 -pady 10 \
- 1,0 .sep -fill x -padx 4 -pady 4 -columnspan 4 -padx 5 \
- 2,1 .back -anchor e -padx 4 -pady 4 \
- 2,2 .next -anchor w -padx 4 -pady 4 \
- 2,3 .cancel -padx 20 -pady 4
-
-blt::table configure . .back .next .cancel -width .75i
-blt::table configure . r1 r2 -resize none
-blt::table configure . r3 -height 0.125i
-
-while { 1 } {
- namespace eval Installer {
- variable panel
- set cmd [lindex $panelList $panel]
- eval [list $cmd $package $version]
- }
- update
-}
diff --git a/blt3.0.1/win/makedefs b/blt3.0.1/win/makedefs
deleted file mode 100644
index 72edeea..0000000
--- a/blt3.0.1/win/makedefs
+++ /dev/null
@@ -1,90 +0,0 @@
-ENABLE_SYMBOLS=1
-ENABLE_SHARED=1
-ENABLE_STUBS=0
-
-WITH_JPG=0
-
-SRC = H:/src
-JPG_DIR = $(SRC)/libs/jpeg-6b
-
-WITH_PNG=0
-PNG_DIR = $(SRC)/libs/libpng-1.2.15
-ZLIB_DIR = $(SRC)/libs/zlib-1.2.3
-
-WITH_TIF=0
-WITH_EXPAT = 0
-WITH_MYSQL = 0
-
-
-#v1 = 8.4
-#v2 = 84
-#v3 = 8.4.0
-
-v1 = 8.4
-v2 = 84
-v3 = 8.4.14
-
-#v1 = 8.2
-#v2 = 82
-#v3 = 8.2.3
-
-#v1 = 8.1
-#v2 = 81
-#v3 = 8.1.1
-
-#v1 = 8.0
-#v2 = 80
-#v3 = 8.0.5
-
-#Use Independent JPEG Group (IJG) library or Intel JPEG Library (IJL)
-# 0 = None.
-# 1 = IJG
-# 2 = IJL
-
-TCLDIR = $(SRC)/tcl/tcl$(v3)
-TKDIR = $(SRC)/tcl/tk$(v3)
-
-ifeq ($(WITH_JPG),1)
-JPG_LIB_SPEC = $(JPG_DIR)/libjpeg.lib
-JPG_INC_SPEC = -I$(JPG_DIR)
-JPG_DEFINES = -DHAVE_LIBJPG
-endif
-
-ifeq ($(WITH_PNG),1)
-PNG_LIB_SPEC = $(PNG_DIR)/libpng.lib $(ZLIB_DIR)/zlib.lib
-PNG_INC_SPEC = -I$(PNG_DIR) -I$(ZLIB_DIR)
-PNG_DEFINES = -DHAVE_LIBPNG
-endif
-
-ifeq ($(WITH_EXPAT),1)
-EXPAT_DIR = C:/Expat-2.0.0
-EXPAT_INC_SPEC = -I$(EXPAT_DIR)/Source/lib
-EXPAT_LIB_SPEC = $(EXPAT_DIR)/Libs/libexpat.lib
-endif
-
-# ------------------------------------------------------------------------
-# You shouldn't need to edit anything beyond this point
-# ------------------------------------------------------------------------
-
-BLT_MAJOR_VERSION = 3
-BLT_MINOR_VERSION = 0
-BLT_VERSION = 3.0
-
-prefix = C:/Program\ Files/Tcl
-exec_prefix = $(prefix)
-includedir = $(prefix)/include
-bindir = $(prefix)/bin
-libdir = $(prefix)/lib
-scriptdir = $(libdir)/blt$(BLT_VERSION)
-BLT_LIBRARY = $(libdir)/blt$(BLT_VERSION)
-TCLLIBPATH = $(libdir)/tcl$(v1)
-
-AUX_LIBS =
-SHLIB_SUFFIX = .dll
-
-INSTALL = install -m 0755
-INSTALL_DATA = install -m 0444
-RANLIB = :
-SHELL = bash.exe
-RM = rm -f
-
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/saods9.git
More information about the debian-science-commits
mailing list